Posted By
Mad on 2017-04-23 18:44:48
| Re: "Ram under Rom"
What Csabo said.
Referring to the basic code above:
The datas place this code to $0fe8 (4072) .C:0fe8 78 SEI .C:0fe9 8D 3F FF STA $FF3F .C:0fec 20 00 80 JSR $8000 .C:0fef 8D 3E FF STA $FF3E .C:0ff2 58 CLI .C:0ff3 60 RTS
and this code to $8000 .C:8000 A9 32 LDA #$32 .C:8002 8D 19 FF STA $FF19 .C:8005 60 RTS
The first code is used to disable the interrupts (SEI) and turn on RAM (sta $ff3f) then the routine jumps to the routine at $8000 and changes the bordercolor. The wedge then takes care of reenabling the ROM(sta $ff3e) and turns on the interrupts again(CLI).
Perhaps you should install this wedge ($0fe8) somewhere in a unused zeropage area or in a place which is not touched by the system and then exchange only the $8000 in the JSR instruction for your needs on the fly. You can call the same wedge routine (which is on a safe place), for all your basic SYS calls which should go into the ram under the rom.
edit: oh my, surely the place $0fe8 choosen by csabo is already sufficient for persistence. It will not be overwritten by anything systemwise. just for the record :).. Nice place for a very small routine :)..
|