Openmsx no longer freaking out on bad rom blocks

By Daemos

Paragon (1669)

Daemos's picture

24-10-2018, 20:00

Ill start with some code example:

;extra mapdata 6
; block $AE - AF
phase   $8000


backgrl120: incbin "../level_editor/_Levels/maplevel6-05a.stg.pck" | blockbackgrl120: equ $AE ;chocolate5a 
backgrl121: incbin "../level_editor/_Levels/maplevel6-05b.stg.pck" | blockbackgrl121: equ $AE ;chocolate5b 

backgrl122: incbin "../level_editor/_Levels/maplevel6-06a.stg.pck" | blockbackgrl122: equ $AE ;chocolate6a 
backgrl123: incbin "../level_editor/_Levels/maplevel6-06b.stg.pck" | blockbackgrl123: equ $AE ;chocolate6b 

backgrl124: incbin "../level_editor/_Levels/maplevel6-07a.stg.pck" | blockbackgrl124: equ $AE ;chocolate7a
backgrl125: incbin "../level_editor/_Levels/maplevel6-07b.stg.pck" | blockbackgrl125: equ $AE ;chocolate7b
backgrl126: incbin "../level_editor/_Levels/maplevel6-07c.stg.pck" | blockbackgrl126: equ $AE ;chocolate7c
backgrl127: incbin "../level_editor/_Levels/maplevel6-07d.stg.pck" | blockbackgrl127: equ $AE ;chocolate7d
backgrl128: incbin "../level_editor/_Levels/maplevel6-07e.stg.pck" | blockbackgrl128: equ $AE ;chocolate7e

backgrl129: incbin "../level_editor/_Levels/maplevel6-08a.stg.pck" | blockbackgrl129: equ $AE ;chocolate8a
backgrl130: incbin "../level_editor/_Levels/maplevel6-08b.stg.pck" | blockbackgrl130: equ $AE ;chocolate8b

        ds                $c000-$,$ff

the last two incbinned data parts are outside of the $c000 data boundaries so the rom is not good. Normally after compiling and running openmsx would refuse to load the ROM insisting that the ROM no longer matches the mapper type which should be made out of 8K blocks.

With the newest version this behaviour has changed. The ROM simply starts and I have to find out myself that the data block is too big. This was still present on 0.10 but I cannot remember when this changed. For sure this is new since version 0.14

If this is something I can enable from the commandline or options please let me know how. This error behaviour is very important to me...


After some discussion with a very knowledgable person it seems this new behaviour should be normal and that most propably what is beneficial to me seems to have been a bug in earlier versions of openmsx. This "bug" however is used by the entire team to scan for rom errors Tongue So the "bug" seems to be a feature. A very cool one.


found this.

0.14.0 release notes:- automatically pad ROM files if they are not a multiple of the block size, instead of refusing to run that ROM.

There you might have it. Can this become a option?

Login or register to post comments

By Manuel

Ascended (15449)

Manuel's picture

24-10-2018, 21:41

It still gives a warning, but it is no longer an error. So you can still use the checking.

Quote from the openMSX code:

                        "(uncompressed) ROM image filesize was not a multiple "
                        "of ", BANK_SIZE / 1024, "kB (which is required for mapp
er type ",
                        config.findChild("mappertype")->getData(), "), so we "
                        "padded it to be correct. But if the ROM you are "
                        "running was just dumped, the dump is probably not "

Example where I deleted 1 byte from a Konami game ROM:

$ openmsx crippled.rom 
warning: (uncompressed) ROM image filesize was not a multiple of 8kB (which is required for mapper type KonamiSCC), so we padded it to be correct. But if the ROM you are running was just dumped, the dump is probably not complete/correct!

By sd_snatcher

Prophet (3014)

sd_snatcher's picture

24-10-2018, 22:33

Just a small remark on this topic: openMSX now behaves as the real hardware.

If you save a file of 1KB to an 8KB EPROM, the unused area will remain with the default FFh value.

In fact, when you erase an EPROM you clear all bits to 1. Then you can only burn zeroes to it.

By Daemos

Paragon (1669)

Daemos's picture

24-10-2018, 23:49

The warning will do Smile noted.

Just tested with a ROM and indeed it works as it should. Although the error behaviour as an option would still be awesome if its easy to make. Wink