Schrijver
| MSX1 pages and slots
|
ARTRAG msx master Berichten: 1737 | Geplaatst: 18 Juli 2006, 16:44   |
Do you know if in openmsx and bluemsx the fact that
you run C-bios or a standard msx1/2 bios can affect
the autodetect routine of the plugged ROM ?
|
|
tokumaru msx lover Berichten: 83 | Geplaatst: 21 Juli 2006, 03:58   |
You know, I found it strange when I was told you could put your ROM in page 0 but you still had to init it in page 1 or page 2. I don't want to use any BIOS routines in the project I'm working on right now, and I wish I could just start program execution in page 0. Are you saying that this is actually possible, but the emulators do not emulate this correctly?
|
|
ARTRAG msx master Berichten: 1737 | Geplaatst: 21 Juli 2006, 09:18   |
Actually, in C-bios, I put the AB signature in page 0 at 0000H,
I DO NOT initialize page 1 and page 2 and
everithing WORKS perfectly!!!
Moreover all the rom data in page 1 & 2 are in the corret place!
When I boot with the standard MSX roms, my rom in page 0 is not detected
so I cannot say if this is a problem with the emulators and
if page 1&2 are correctly set to my rom or not
I would like to undestand if :
1) custom ROMs can be detected in page 0 in the standard MSX or this is only a C-bios feature
2) setting page 1 & 2 to the same slot detected for page 0 is done by the standard MSX or if this is only a C-bios feature
|
|
ricbit msx lover Berichten: 116 | Geplaatst: 21 Juli 2006, 09:46   |
As far as I know AB signature in 0000 is not recognized by the original bios. Some 16kb games manage to run from 0000 using a trick: their cartridges doesn't have the A15 and A14 connections, and so the entire game is mirrored four times in the slot. This way, the signature is visible from 4000 too.
|
|
zeilemaker54 msx lover Berichten: 97 | Geplaatst: 21 Juli 2006, 16:00   |
Orginal MSX systemroms only check for the AB signature at 4000 and at 8000, so signatures at 0000 have no effect for sure. MSX2 and MSX2+ also check for the CD signature at 0000 but that is used for the subrom.
|
|
tokumaru msx lover Berichten: 83 | Geplaatst: 21 Juli 2006, 17:01   |
Can you still have the signature at $4000 or $8000 but have the init address point to somewhere in page 0? Or must program execution start on the same page as the signature?
I don't really understand how the cartridge slot is "filled". Some ROMs do not have anything on the first page (their ROM files start at $4000), so how come it gets mapped to the correct page? How can an emulator/MSX tell if a ROM should begin at $0000 (a 48KB ROM, for example) or at $4000 (32KB or 16KB ROMs)?
Also, I read it would be possible to have a 64KB ROM without bankswitching, as it could fill the whole cartridge slot. Is that true? I don't see a reason why not... I would like to use the last page (wich would normally be RAM) to store some data, such as graphics, that can be copied directly to VRAM, but I want to make sure it's possible.
Unfortunately I can not test ROMs on my MSX, so I want to ask if emulators can be trusted when it comes to the behavior of slots.
|
|
zeilemaker54 msx lover Berichten: 97 | Geplaatst: 21 Juli 2006, 17:12   |
Quote:
| Can you still have the signature at $4000 or $8000 but have the init address point to somewhere in page 0? Or must program execution start on the same page as the signature?
|
Well, the init address is read from 4002 or from 8002, and then the init routine is started with a CALSLT bios call. So this means that you can use an address in any page. using page 3 is not very wise, because then the systemvariables are switched away, and a crash is the result. page 0 should work ok, but take care there because the BIOS is switched away and you have to take care of interrupts and other stuff. |
|
tokumaru msx lover Berichten: 83 | Geplaatst: 21 Juli 2006, 19:19   |
Quote:
| Well, the init address is read from 4002 or from 8002, and then the init routine is started with a CALSLT bios call.
|
OK, it uses that magic routine! I get it!
Quote:
| using page 3 is not very wise, because then the systemvariables are switched away, and a crash is the result.
|
Quote:
| the BIOS is switched away and you have to take care of interrupts and other stuff.
|
But that's exactly the point. If the BIOS is switched away (meaning I have my own interrupt routine, or don't use one at all, whatever) there is no problem in switching the system variables away, isn't that correct? Anyway, I think I could still use ROM in page 3 momentarily as long as interrupts were disabled, and RAM was switched back in before enabling them again. But that's not the point, the point is whether ROM can or can not be maped to page 3, regardless of how carefull the programmer must be about that.  |
|
NYYRIKKI msx master Berichten: 1525 | Geplaatst: 21 Juli 2006, 20:11   |
Quote:
| But that's not the point, the point is whether ROM can or can not be maped to page 3, regardless of how carefull the programmer must be about that. 
|
Yes, you can map ROM to page 3 just like any other page. If you map ROM to all pages, you can't use stack so you can't call anything, but yes it is still possible.
There might be some hardware limitations (like SVI-738 slot 3-x) that prevents this kind of mapping but in any normal situation (external ROM) this should not be a problem.
|
|
tokumaru msx lover Berichten: 83 | Geplaatst: 21 Juli 2006, 22:02   |
Quote:
| If you map ROM to all pages, you can't use stack so you can't call anything, but yes it is still possible.
|
Yeah, it'd be a very limited thing. But, as I said, if you use that space for graphics, for example, it is possible to come up with a routine that does not use any RAM or even the stack to copy that data to VRAM. After the transfer is done, just switch RAM back in. C'mon, it's usefull!!! =)
Quote:
| There might be some hardware limitations (like SVI-738 slot 3-x) that prevents this kind of mapping but in any normal situation (external ROM) this should not be a problem.
|
By "external ROM" you mean cartridges, right? I don't know what a "SVI-738" is. |
|
NYYRIKKI msx master Berichten: 1525 | Geplaatst: 22 Juli 2006, 10:29   |
right
|
|
AuroraMSX
 msx master Berichten: 1260 | Geplaatst: 22 Juli 2006, 10:44   |
Quote:
| Quote:
| But that's not the point, the point is whether ROM can or can not be maped to page 3, regardless of how carefull the programmer must be about that. 
|
Yes, you can map ROM to page 3 just like any other page. If you map ROM to all pages, you can't use stack so you can't call anything, but yes it is still possible.
|
And you will have to disable interrupts, because the z80 will try to push a return address onto the stack when an interrupt occurs. Which leaves only the registers to play with. I'd say: "yes it is possible to map ROM to the complete z80 address space, but it's pretty useless for all practival purposes."
|
|
NYYRIKKI msx master Berichten: 1525 | Geplaatst: 22 Juli 2006, 13:45   |
Well, you can enable interrups in order to make a timed jump, you just can't return from it.
Quote:
| yes it is possible to map ROM to the complete z80 address space, but it's pretty useless for all practival purposes
|
I wouldn't say that... I think page 3 is very good for storing graphics, samples and other this kind of stuff. This kind of mapping also works as a pretty good copy protection because you can't load this kind of game in real MSX without real cartridge or at least external memory. If you expect that the coputer has more than 16KB RAM you can also put RAM to page 2.
|
|
tokumaru msx lover Berichten: 83 | Geplaatst: 22 Juli 2006, 19:00   |
Yeah, not useless at all. There's a ton of stuff you can fit in 16kb. You can fit 4 uncompressed mode 2 background tilesets. That would be more than enough for most games. If you use some simple compression, who knows how much you can fit in there! Before a level begins you could easily disble interrupts, switch ROM in page 3, copy the data to VRAM using only registers (no RAM/stack), and then switch RAM back in and enable interrupts. The Z80 has a lot of registers, so it's easy to code a simple routine that makes no use of memory. I doubt it could be done with a 6502, for example.
|
|
ARTRAG msx master Berichten: 1737 | Geplaatst: 28 Augustus 2006, 22:49   |
Help !!
I am doing the startup code on a rom that has the AB signature in page 0
why this code doed not work ?
in a,(0xA8)
and 3 ; which slot are we?
ld c,a
sla a
sla a
or c
sla a
sla a
or c
out (0xA8),a ; page 0,1 & 2 are at the same primary slot of page 0
ld a,(-1)
cpl
and 3 ; which sub slot are we?
ld c,a
sla a
sla a
or c
sla a
sla a
or c
ld (-1),a ; page 0,1 & 2 are at the same secondary slot of page 0
|
|
|
|
|