No problem. In this cas only the first header is take into account with my method. The first header and the file size having priority. Obviously, my method may be faulty by a person that creates non-standard headers or as a decoy.
The #41 #42 at offset #0000 can be a header or just data (41 42 43 44...). The MSX standard does not say anything about that.
Some games, like Corageous perseus or MSX Shogi has a "dummy" header at #0000 and the real one at #4000.
Those 32K ROM could be located at page 0 or page 1 (it could be deduced from the second header). But the fact is that in the ROM file itself there is no enough information to be 100% sure how the real cartridge works.
So, this is why I said:
BIOS searchs for ROMs only at pages 1 and 2. If it finds a ROM header with a valid (non 0) start address, it makes a interslot call to that address.
ROMs that start with 00 00 ... are probably located at address #0000 and are bigger than 16K, so they have the ROM header at #4000. But they could also be located at #4000 with the header at #8000.
I would check the ROM size, then the first bytes searching for a valid ROM header. Depending on the result, I would search for the header at offset #4000 and/or #8000.
You must to figure out how the ROM must be loaded and launched, or create a database with that information.
Thanks Ramones. Think I got all information needed now thanks to you guys. Currently testing my own "guess" function and BASIC launch code, always nice to have different approaches. I'll come back to you if I'm stuck.
Ok. I was thinking to add new features like:
- Run MSX1 games using Franky / Playsoniq interrupt (you can play with MSX1 PAL machine at 60 fps)
- Run MSX1 games with Franky / Playsoniq output. (ugly palette I know, but RGB output).
I think you could add this features easily in SofaRun. Really you only need a patched MSX1 BIOS. I can send it, if you want.
You only need load these BIOS in RAM page 0 instead ROM BIOS in page 0 and run the game.
Courageous Perseus and MSX Shogi Game also work fine. The "dummy" header is "41 42 00 00 00 00 00 00 00 00 00 00...". Until proven otherwise ROM2MMM can execute all existing Roms.
Courageous Perseus and MSX Shogi Game also work fine. The "dummy" header is "41 42 00 00 00 00 00 00 00 00 00 00...". Until proven otherwise ROM2MMM can execute all existing Roms.
Again, that is not the point. You are the only one talking about ROM2MMM and the ROMs it can load.
The point is that a 32K ROM could be at pages 0,1 or 1,2, or 2,3. And if you always set it at pages 1,2 it is not right, since you can't know where it is visible in the real cartridge, or if it is mirrored in other pages.
My method for 32 KB Roms is :
- If a Basic program is present the rom is inevitably placed on banks 1 and 2 with mirror of bank 1 on bank 3 and mirror of bank 2 on bank 0.
- If the adresse from first header is between 0001h~3FFFh the rom is inevitably placed between on banks 0 and 1 with mirrors on Banks 2 and 3.
- If the adresse from first header is between 4000h~7FFFh the rom is inevitably placed between on banks 1 and 2 with mirror of bank 1 on bank 3 and mirror of bank 2 on bank 0.
- If the adresse from first header is between 8000h~bFFFh the rom is inevitably placed on banks 2 and 3 with mirror of bank 0 on bank 1. (This configuration exist?)
You can see the source code of ROM2MMM to see if I have forgotten nothing. I cannot easily explain in English.
Again, that is not the point.
You say my method is insufficient to execute all games. I take this example because I used this method for ROM2MMM and all roms work without exception.
You method will work in most cases, but it is not 100% right.
If it is 100% all ROMs would work, including the one in my previous example. I can easily make a ROM or a cartridge that will not work with you loader. So your method is not 100% right.
Again, you can't know if a ROM is mirrored or not only checking the header. You must check the real hardware.
Again, that is not the point.
You say my method is insufficient to execute all games. I take this example because I used this method for ROM2MMM and all roms work without exception.
That's false. Where I have said that?
AFAIK, all my afirmation were right. You said they were false and I proved you were wrong. (BIOS checks only pages 1 and 2, and a ROM does not contain enough information to know 100% how it is mapped)
But I'm just trying to explain who is the best way to guess how to run a ROM and why it is not possible to know all the details of the real hardware only with a ROM.
There is the distinction between theoretically correct detection and practically functional detection; in theory you do not have sufficient information to make the perfect decision (which is what Guillian is saying), in practice there are methods which work well enough for all the existing published software (which is what gdx is saying).
The latter will be sufficient in practice, but it can be broken if desired and done intentionally, or in a super-unlucky case of ROM contents. At least the detection situation is much better than mapper type.
So, you're both right .
We have a recent example with the game released by Relevo Videogames for MSXdev'15 : Ninja Savior, a 16 kb ROM. This ROM can't be runned with the ODO loader, although conceived for especially all 16 kb roms.
We have a recent example with the game released by Relevo Videogames for MSXdev'15 : Ninja Savior, a 16 kb ROM. This ROM can't be runned with the ODO loader, although conceived for especially all 16 kb roms.
Can someone explain me the problem with this ROM? I tried it with ROM loader I made for SVI-328 and it worked out of the box. AFAIK my code has no anything special related to loading of the ROM, so I'm really puzzled why other loaders have problem with it? (In my loader I always expect that /CE of the ROM is connected to /CS12)
The problem with Ninja Savior and ODO loader is different. This game works with MMM2ROM.
If it is 100% all ROMs would work, including the one in my previous example. I can easily make a ROM or a cartridge that will not work with you loader.
I am not saying that my method is theoretically perfect but it can execute 100% of existing Roms.
Your previous example does not seem appropriate to me. Please make this ROM for I understand your explanation.