I'm struggling for time, planning to take a couple of weeks off to finish the game at the end of July before the deadline so if anyone wants to write something to do the SIO save/load to a sector as detailed in the last few posts that would be great. I have 3x77byte tables to store.
I tried to clobber something together but had not time to test it yet. Doesn't really work yet, and I have no time to debug it further. I think I didn't get the device control block setup right.
Reading material is in the OS Manual and Mapping the Atari at $300.
I also found some Action! code referenced in this thread that looks good and should be convertible to assembler.
; sample SIO direct load/save for TRBB
; assumes data to be saved is stored in contiguous memory locations starting at TABLE
DDEVIC equ $300
DUNIT equ $301
DCOMND equ $302
DSTATS equ $303
DBUFLO equ $304
DBUFHI equ $305
DTIMLO equ $306
DBYTLO equ $308
DBYTHI equ $309
DAUX1 equ $30A
DAUX2 equ $30B
DSKINV equ $E453
COLBK equ $D01A
TABLE equ $600 ;this should be the address of the table you want to load save
SAVESEC equ 700 ;this should be the first sector where your data is written/read
; Test Code
; this fills page 6 with $80, saves them, fills it with $81 and loads
; the saved $80's back
SAVETABLE;JSR here to save table to two sectors
STA DCOMND ;write (with verify)
STA DSTATS ;send data to drive
LOADTABLE;JSR here to load table from two sectors
STA DCOMND ;read
STA DSTATS ;read data from drive
JSR DSKINV ;call disk handler to read/write first sector
;error handler missing here
INC DAUX1 ;increase sector by one
BCC MOVE_BUF ;in case of overflow
INC DAUX2 ;increase high byte of sector number
ADC #$80 ;add 128 (byte count for SD/ED sector) to buffer address
INC DBUFHI ;in case of overflow, increase high byte of buffer as well
JSR DSKINV ;call disk handler to read/write second sector
;error handler missing here
RTS ;return to game
STA DUNIT ;select drive 1
STA DBUFHI ;set data buffer to address of data to be saved/read
Finally made it through Star Raiders Commander Mission, but barely.
Galactic Cook Class 5 with 6059 energy remaining, I must have played the better part of an hour and it mostly felt like work. I must have had those shields repaired a dozen times.
Despite several tries never managed to beat my previous high score in Time Pilot. Made it to the UFO level and saw the boss UFO but got finished off before I could engage it. Can't fail to admire the port. Even if it's not 100% like the original, it feels like I remember the Arcade machine and that's most important! I love the community that results in great games like this 30 years after the Atari's heyday!
Jac! said that the editor scatters direct screen writes all over the place. If everything was channelled through calls to a central "put character" routine, it would be much easier to abstract the display device and start supporting different screen geometries (80 columns, etc) and even different platforms. I suppose the intention is - eventually - to do just that.
I had a look at the source code and it looks modular enough to separate the compiler from the editor, making into a kind of "command line" compiler as a first step (but then my ML experience is quite limited, especially regarding large projects like this). There seems to be a separate memory allocation part in the compiler which might be a starting point to use more memory on the Ataris.
Conversion would also require the library and memory map of the output to be adapted to the target system, so it would be quite a tall order in total, even if using an existing editor on the target system.