News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

RSX infos

Started by arnoldemu, 11:41, 02 June 09

Previous topic - Next topic

0 Members and 5 Guests are viewing this topic.

arnoldemu

It is possible to redefine RSX commands using more than one call to KL LOG EXT.

;
;; firmware functions we use in this example
kl_log_ext: equ &bcd1
txt_output: equ &bb5a
org &4000
start:
LD HL,BufferRsx1
LD BC,RsxTable1
call kl_log_ext
LD HL,BufferRsx2
LD BC,RsxTable2
call kl_log_ext
ret


RsxTable1:
DW RsxCmdTable1
JP FunctionA

BufferRsx1:
defs 4
RsxCmdTable1:
DB "A"+&80
DB 0
RsxTable2:
DW RsxCmdTable2
JP FunctionB

BufferRsx2:
defs 4

RsxCmdTable2:
DB "B"+&80
DB 0
FunctionA:
ld a,"A"
call txt_output
ret

FunctionB:
ld a,"B"
call txt_output
ret
;;end start


Any call to MC START PROGRAM or MC BOOT PROGRAM will clear RSXs you have defined.
This means running a Binary program from BASIC.

I remember one other way that RSXs are removed, but I don't remember it at the moment.

Another thing, RSXs you defined are checked first.
so in theory (not tested yet), you can define a RSX with the same name as an existing RSX in ROM (or even RSXs that were loaded before yours).

If you want to also call the other RSX you would need to find it and store the details of it before you initialise your RSX command.

e.g.
find existing command and store infos (address and rom select).
Setup your RSX.
In your RSX, call the existing one.

So for example, you could implement your own |DRIVE command to accept your own parameter, but if the parameter was not one for you, pass it to the existing DRIVE command.

Just some things I found while I looked at CPC6128 OS rom one day.

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Powered by SMFPacks Menu Editor Mod