Hi guys,
I ported my tiny MSX game I.N.E.R.T.I.A. to SVI-318, ROM format. Since
I don't own an SVI, I used BlueMSX as a test environment.
The final result is crappily coded and fragile, but seems to work, and
an SVI owner confirmed it works on a real SVI. I'm going to share it on
my website next days. While porting I had some doubts and difficulties
to understand the machine and the differences from MSXes, I'm now going
to expose my knowledge in form of a "question + my answer" list.
If you have time to read this and have some experience of the SVI,
would you please confirm or reject my answers, or add further details
you know, whatever you like. I think this isn't a very widespread
machine, so I don't expect heavy traffic on this topic. Thanks in
advance for any feedback.
Q1: is there an SVI video mode equivalent to "SCREEN 1" mode of the MSX?
A1: can't be set by BASIC, can't be set by BIOS calls (ouch!); you can
only set it by writing directly to the VDP registers.
Q2: does SVI have the BASIC "WIDTH" instruction?
A2: no; 40-columns width is fixed
Q3: is this a problem for an ASM program?
A3: yes if you need the MSX "SCREEN 1" mode and wanted to use the CHPUT
and POSIT BIOS calls. These are defined in SVI but assume width is 40
columns, while MSX "SCREEN 1" is 32 columns. You are forced to write
your own replacements for CHPUT and POSIT.
Q4: is there a GTSTCK BIOS call for joysticks and cursor keys?
A4: no! you have to write your own I/O procedure, something like this:
; Get joystick direction ; Result in A ; Each bit is cleared if signal is true ; Bit 0 - Joystick 1 is up ; Bit 1 - Joystick 1 is down ; Bit 2 - Joystick 1 is left ; Bit 3 - Joystick 1 is right ; Bit 4 - Joystick 2 is up ; Bit 5 - Joystick 2 is down ; Bit 6 - Joystick 2 is left ; Bit 7 - Joystick 2 is right JD_PSG_LATCH .equ #0x088 JD_PSG_READ .equ #0x090 LD A,#0x0E OUT (JD_PSG_LATCH),A IN A,(JD_PSG_READ)
Q5: ok but answer A4 is for joysticks, what about cursor keys?
A5: there is a CHSNS BIOS call to check if a key is pressed or not. I don't
know if we can be reasonably sure that cursor keys and spacebar have the
same row and bit-column across SVI models.
Q6: is it easy to write a ROM game for the SVI-318?
A6: no, because the SVI bank switching I/O is more primitive than
MSX. You only have two 32KB banks, the upper at #0x8000 and the lower at
#0x0000. So you can't load your ROM at #0x4000 and use the
BIOS at #0x0000, you are forced to use a procedure P that does:
- bank-switch to see BIOS
- invoke the BIOS call
- bank-switch back to your ROM
Additionally, the procedure P must be located in a bank that isn't
going to be switched off in the middle of its execution, so you are
forced to relocate procedure P in the upper block (RAM).
In my port I chose to invoke BIOS by bank switching, but it's definitely
NOT comfortable.
Alternative solution 1: you can write all the I/O you need and forget
about bank switching, like the ROMTemplate available at Electric Adventures site,
but I don't know how uniform the Spectravideo hardware is.
Alternative solution 2: if your game is really small and all code+data+stack
can fit in 16KB of RAM, you could relocate all your code from ROM to RAM,
bank-switch to have the BIOS bank available and forget about the ROM.