Disable interrupts during aux memory access.
Interrupt handlers rather likely access text screen holes. Especially MSLOT is obligatory for every interrupt handler that requires access to an extension ROM ($C800-$CFFE) in order to be able to re-enable the extension ROM that was enabled when the interrupt occured. Those text screen holes only hold valid values in main memory so interrupts must be disabled while the aux memory text screen is mapped.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
.import uppercasemask
|
||||
.endif
|
||||
|
||||
.include "zeropage.inc"
|
||||
.include "apple2.inc"
|
||||
|
||||
.macpack cpu
|
||||
@@ -87,23 +88,28 @@ putchar:
|
||||
mask: and INVFLG ; Apply normal, inverse, flash
|
||||
|
||||
putchardirect:
|
||||
pha
|
||||
tax
|
||||
.ifdef __APPLE2ENH__
|
||||
lda CH
|
||||
sec ; Assume main memory
|
||||
bit RD80VID ; In 80 column mode?
|
||||
bpl put ; No, just go ahead
|
||||
lsr ; Div by 2
|
||||
bcs put ; Odd cols go in main memory
|
||||
php
|
||||
sei ; No valid MSLOT et al. in aux memory
|
||||
bit HISCR ; Assume SET80COL
|
||||
put: tay
|
||||
.else
|
||||
ldy CH
|
||||
.endif
|
||||
lda (BASL),Y ; Get current character
|
||||
tax ; Return old character for _cgetc
|
||||
pla
|
||||
sta tmp3 ; Save old character for _cgetc
|
||||
txa
|
||||
sta (BASL),Y
|
||||
.ifdef __APPLE2ENH__
|
||||
bit LOWSCR ; Doesn't hurt in 40 column mode
|
||||
.endif
|
||||
bcs :+ ; In main memory
|
||||
bit LOWSCR
|
||||
plp
|
||||
: .endif
|
||||
rts
|
||||
|
||||
Reference in New Issue
Block a user