2013-09-19 21:21:09 +00:00
|
|
|
;
|
|
|
|
; Macros to disable and enable the ROM on Atari XL systems.
|
|
|
|
;
|
|
|
|
; Christian Groessler, chris@groessler.org, 19-Sep-2013
|
|
|
|
;
|
2013-09-19 22:10:34 +00:00
|
|
|
;
|
|
|
|
; Defines which modify the operation of the macros:
|
|
|
|
;
|
|
|
|
; CHARGEN_RELOC: If defined, CHBAS and CHBASE are updated when
|
|
|
|
; enabling or disabling the ROM.
|
|
|
|
; If the ROM is enabled, $E0 is written to CHBAS
|
|
|
|
; and CHBASE.
|
|
|
|
; If the ROM is disabled, the upper byte of
|
|
|
|
; __CHARGEN_START__ is written to CHBAS and CHBASE.
|
|
|
|
; USEWSYNC: If defined, the code waits for horizontal retrace
|
|
|
|
; before switching the ROM and updating CHBAS and
|
2013-09-19 22:26:49 +00:00
|
|
|
; CHBASE. This define only has effect if CHARGEN_RELOC
|
2013-09-19 22:10:34 +00:00
|
|
|
; is also defined.
|
2013-09-19 21:21:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
.ifdef __ATARIXL__
|
|
|
|
|
2013-09-19 22:10:34 +00:00
|
|
|
.ifdef CHARGEN_RELOC
|
|
|
|
|
|
|
|
.macro set_chbase val
|
|
|
|
lda #val
|
|
|
|
sta CHBAS
|
|
|
|
sta CHBASE
|
|
|
|
.endmacro
|
|
|
|
|
2013-10-16 15:55:45 +00:00
|
|
|
.else ; above CHARGEN_RELOC, below not
|
2013-09-19 22:10:34 +00:00
|
|
|
|
|
|
|
.macro set_chbase val
|
|
|
|
.endmacro
|
|
|
|
|
|
|
|
.endif ; .ifdef CHARGEN_RELOC
|
|
|
|
|
|
|
|
|
2013-09-19 21:34:45 +00:00
|
|
|
.if .defined(USEWSYNC) .and .defined(CHARGEN_RELOC)
|
2013-09-19 22:10:34 +00:00
|
|
|
|
2013-09-19 21:21:09 +00:00
|
|
|
.macro wsync
|
|
|
|
sta WSYNC
|
|
|
|
.endmacro
|
2013-09-19 22:10:34 +00:00
|
|
|
|
2013-10-16 15:55:45 +00:00
|
|
|
.else ; above USEWSYNC, below not
|
2013-09-19 22:10:34 +00:00
|
|
|
|
2013-09-19 21:21:09 +00:00
|
|
|
.macro wsync
|
|
|
|
.endmacro
|
2013-09-19 22:10:34 +00:00
|
|
|
|
2013-09-19 21:21:09 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
|
2013-09-19 22:10:34 +00:00
|
|
|
; "disable ROM" macros
|
|
|
|
|
2013-09-19 21:21:09 +00:00
|
|
|
.macro disable_rom
|
|
|
|
lda PORTB
|
|
|
|
and #$fe
|
|
|
|
wsync
|
|
|
|
sta PORTB
|
2013-09-19 22:10:34 +00:00
|
|
|
set_chbase >__CHARGEN_START__
|
2013-09-19 21:21:09 +00:00
|
|
|
.endmacro
|
2013-09-19 22:10:34 +00:00
|
|
|
|
2013-09-19 21:21:09 +00:00
|
|
|
.macro disable_rom_quick
|
|
|
|
lda PORTB
|
|
|
|
and #$fe
|
|
|
|
sta PORTB
|
2013-09-19 22:10:34 +00:00
|
|
|
set_chbase >__CHARGEN_START__
|
2013-09-19 21:21:09 +00:00
|
|
|
.endmacro
|
2013-09-19 22:10:34 +00:00
|
|
|
|
2013-09-19 21:21:09 +00:00
|
|
|
.macro disable_rom_val val
|
|
|
|
lda val
|
|
|
|
wsync
|
|
|
|
sta PORTB
|
2013-09-19 22:10:34 +00:00
|
|
|
set_chbase >__CHARGEN_START__
|
2013-09-19 21:21:09 +00:00
|
|
|
.endmacro
|
|
|
|
|
2013-09-19 22:10:34 +00:00
|
|
|
; "enable ROM" macros
|
|
|
|
|
2013-09-19 21:21:09 +00:00
|
|
|
.macro enable_rom
|
|
|
|
lda PORTB
|
|
|
|
ora #1
|
|
|
|
wsync
|
|
|
|
sta PORTB
|
2013-09-19 22:10:34 +00:00
|
|
|
set_chbase $E0
|
2013-09-19 21:21:09 +00:00
|
|
|
.endmacro
|
2013-09-19 22:10:34 +00:00
|
|
|
|
2013-09-19 21:21:09 +00:00
|
|
|
.macro enable_rom_quick
|
|
|
|
lda PORTB
|
|
|
|
ora #1
|
|
|
|
sta PORTB
|
2013-09-19 22:10:34 +00:00
|
|
|
set_chbase $E0
|
2013-09-19 21:21:09 +00:00
|
|
|
.endmacro
|
|
|
|
|
|
|
|
.else ; above __ATARIXL__, below not
|
|
|
|
|
|
|
|
.macro disable_rom
|
|
|
|
.endmacro
|
|
|
|
.macro enable_rom
|
|
|
|
.endmacro
|
|
|
|
|
|
|
|
.endif
|