2 ; Atari XL shadow RAM preparation routines
5 ; - move screen memory below load address
6 ; - copy shadow RAM contents to their destination
8 ; Christian Groessler, chris@groessler.org, 2013
11 .if .defined(__ATARIXL__)
14 .import __SRPREP_LOAD__, __SRPREP_SIZE__
15 .import __SHADOW_RAM_LOAD__, __SHADOW_RAM_SIZE__
16 .import __CHARGEN_LOAD__, __CHARGEN_SIZE__
17 .import __SAVEAREA_LOAD__
19 .include "zeropage.inc"
21 .include "save_area.inc"
23 .macro print_string text
26 start: .byte text, ATEOL
27 cont: ldx #0 ; channel 0
41 ; ------------------------------------------------------------------------
47 .word __SRPREP_LOAD__ + __SRPREP_SIZE__ - 1
49 ; ------------------------------------------------------------------------
55 print_string "in sramprep"
57 ; save values of modified system variables and ports
78 ; ... change memory bla
80 CMPVAL = 64+255+992 ; you may ask, why these values... @@@ document
82 sys_ok: lda #<__SAVEAREA_LOAD__
87 lda #>__SAVEAREA_LOAD__
92 lda #>__SAVEAREA_LOAD__ - 1
97 ; ... issue ar GRAPHICS 0 call (copied'n'pasted from TGI drivers)
100 ldx #$50 ; take any IOCB, hopefully free (@@@ fixme)
102 ; Reopen it in Graphics 0
113 lda #<screen_device_length
115 lda #>screen_device_length
120 print_string "GR 0 FAILED"
130 ; Now close it again; we don't need it anymore :)
135 print_string "GR 0 OKOKO"
171 screen_device: .byte "S:",0
172 screen_device_length = * - screen_device
174 .byte " ** srprep ** end-->"
176 ; ------------------------------------------------------------------------
177 ; Chunk "trailer" - sets INITAD
183 .word __SRPREP_LOAD__
185 .endif ; .if .defined(__ATARIXL__)