This question is about z80 and cartridge ROM banking on the old MSX computers.
I am making a MSX game on PC and using openMSX for emulation and testing. I am making a 32K ROM cartridge. The MSX standard divides this 32 ROM memory into two 16K pages. My basic question is how do I use ROM cartridge banking on MSX-1 computers?-the MSX slot expansion and memory banking description is complicated-I just want a simple example for using in my scenario of cartridges. Basically I want to use ROM banking to draw two different images in MSX screen 2 from a cartridge-each image is about 12K so each image needs a 16K ROM bank of its own in the cartridge.
I will now describe he problem in more detail. I want to use the the bitmap simulation code, in the link and taken from the chibiakumas.com website, that uses all 3 tile banks in screen 2, for MSX 1 to load more than one background screen for a game. I thought it would just be a simple straight forward extension. I will describe a simple extension I tried -but it does not work-I think because the ROM needs to use banks of 16K.
The files used are at this link.
The starting point was the original lines of code below given near the end of the program from chibiakumas.com-I have just given the relevant lines below, instead of the whole program (though that is in the link) for clear reading. The image for the screen used is the image from chibiakumas.com)
TestSprite:
incbin "C:\screens\MSX1Screen.RAW"
TestSpriteEnd:
TestSpritePalette:
incbin "C:\screens\MSX1Screen.RAW.COL"
TestSpritePalette_End:
I extended the original code above (by original I mean the code from chibiakumas.com) with the lines below that come AFTER the above lines OF original code
TestSprite2:
incbin "C:\screens\MSX1Screen.RAW"
TestSprite2End:
TestSprite2Palette:
incbin "C:\screens\MSX1Screen.RAW.COL"
TestSprite2Palette_End:
This code works and the screen shot of the code is shown ("Screenshot for WorkingCode-Sprite2codeafteroriginalcode.png") ans shows the expected image along with the asm code ("WorkingCode-Sprite2codeafteroriginalcode")
But when I make the very simple change of swapping the order of the code so the sprite 2 code does not come after as shown below -the code does not load the screen (it is the same screen or expected image), see the screen shot ("Screenshot forNON WorkingCode-Sprite2code NOT afteroriginalcode") and its code ("NONWorkingCode-Sprite2codeNOTafteroriginalcode") Both the screens/images are the same (but if the code did work then simply replacing one of the screens, to load two different screens by swapping the order of the code).
TestSprite2:
incbin "C:\screens\MSX1Screen.RAW"
TestSprite2End:
TestSprite2Palette:
incbin "C:\screens\MSX1Screen.RAW.COL"
TestSprite2Palette_End:
TestSprite:
incbin "C:\screens\MSX1Screen.RAW"
TestSpriteEnd:
TestSpritePalette:
incbin "C:\screens\MSX1Screen.RAW.COL"
TestSpritePalette_End:
It does not work, I think ,because ROM banking is to be used.