[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

DOS 3.3 commands from 6502 assembly? (Aztec)



I don't have Beneath Apple DOS (I wish I did), so I guess I'd like to make
a request. Can someone tell me how a 6502 machine language program can go
about executing DOS 3.3 or ProDOS commands?

So far there seems to be hints that point to putting the DOS command in
the keyboard buffer ($200-2FF), with a Control-D as the first character of
the buffer, and then somehow calling a subroutine to "fake" hitting
Return and treating the keyboard buffer like the command was entered in
immediate mode. And I want the machine code to continue running once the
DOS command is finished.


You may be wondering why. Well, I am doing some exploration and learning
about DOS, and trying to do something interesting and useful. It's a major
sort of a hack on a game I like.

Basically, I am attempting to turn the ol' Apple II game AZTEC into a game
that uses normal DOS/ProDOS binary files rather than using direct RWTS as
it does now. This way it can run under DOS/ProDOS, instead of having to
always boot it off its own custom 5.25" disk.

I have figured out a great deal, and I now know how it gets/puts data on a
disk It has five subroutines located in $320-3CF that do direct RWTS calls
to read and write game data. The routines are: read/write sector,
read/write 1 track, and read 2 tracks.

I want to put in normal DOS commands in place of the current direct RWTS
commands. Where it does a direct read of a sector, 1 track, or two tracks,
I will have code that does a substitute BLOAD command, and where it
writes a sector or one track, I will do a BSAVE command. This way Aztec
will use the normal DOS catalog and track/sector lists, and would make
it runnable under ProDOS as well.

EXAMPLE--- Start track: 20  Start sector: 0  Address $0900

For reading a sector, 1 track, or 2 tracks: BLOAD AZTEC-T20-S0,A$0900
For writing a sector BSAVE AZTEC-T20-S0,A$0900,L$0100
For writing 1 track  BSAVE AZTEC-T20-S0,A$0900,L$1000  

I would greatly appreciate any help here, since I do not have access to
Beneath Apple DOS, which would probably answer my question easily.

And once the conversion is done, if I had Beneath Apple ProDOS, I could
probably turn the binary code into a ProDOS-8 system program, so
BASIC.SYSTEM isn't needed to run the game under ProDOS. :)

-Scalar