1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-05 06:28:57 +00:00
cc65/libsrc/atari/romswitch.inc

74 lines
1.2 KiB
PHP

;
; Macros to disable and enable the ROM on Atari XL systems.
;
; Christian Groessler, chris@groessler.org, 19-Sep-2013
;
.ifdef __ATARIXL__
USEWSYNC= 1
.if USEWSYNC
.macro wsync
sta WSYNC
.endmacro
.else
.macro wsync
.endmacro
.endif
.macro disable_rom
lda PORTB
and #$fe
wsync
sta PORTB
lda #>__CHARGEN_START__
sta CHBAS
sta CHBASE
.endmacro
.macro disable_rom_quick
lda PORTB
and #$fe
sta PORTB
lda #>__CHARGEN_START__
sta CHBAS
sta CHBASE
.endmacro
.macro disable_rom_val val
lda val
wsync
sta PORTB
lda #>__CHARGEN_START__
sta CHBAS
sta CHBASE
.endmacro
.macro enable_rom
lda PORTB
ora #1
wsync
sta PORTB
lda #$E0
sta CHBAS
sta CHBASE
.endmacro
.macro enable_rom_quick
lda PORTB
ora #1
sta PORTB
lda #$E0
sta CHBAS
sta CHBASE
.endmacro
.else ; above __ATARIXL__, below not
.macro disable_rom
.endmacro
.macro enable_rom
.endmacro
.endif