Swap in LC before destructors, ROM after
This commit is contained in:
committed by
Oliver Schmidt
parent
57e65a6bf6
commit
f0b5b02966
@@ -62,7 +62,7 @@ Special locations:
|
|||||||
</descrip><p>
|
</descrip><p>
|
||||||
|
|
||||||
While running <tt/main()/ the Language Card bank 2 is enabled for read access.
|
While running <tt/main()/ the Language Card bank 2 is enabled for read access.
|
||||||
However while running module constructors/destructors the Language Card is disabled.
|
However while running module constructors the Language Card is disabled.
|
||||||
|
|
||||||
Enabling the Language Card allows to use it as additional memory for cc65
|
Enabling the Language Card allows to use it as additional memory for cc65
|
||||||
generated code. However code is never automatically placed there. Rather code
|
generated code. However code is never automatically placed there. Rather code
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ Special locations:
|
|||||||
</descrip><p>
|
</descrip><p>
|
||||||
|
|
||||||
While running <tt/main()/ the Language Card bank 2 is enabled for read access.
|
While running <tt/main()/ the Language Card bank 2 is enabled for read access.
|
||||||
However while running module constructors/destructors the Language Card is disabled.
|
However while running module constructors the Language Card is disabled.
|
||||||
|
|
||||||
Enabling the Language Card allows to use it as additional memory for cc65
|
Enabling the Language Card allows to use it as additional memory for cc65
|
||||||
generated code. However code is never automatically placed there. Rather code
|
generated code. However code is never automatically placed there. Rather code
|
||||||
|
|||||||
@@ -40,12 +40,15 @@ _exit: ldx #<exit
|
|||||||
lda #>exit
|
lda #>exit
|
||||||
jsr reset ; Setup RESET vector
|
jsr reset ; Setup RESET vector
|
||||||
|
|
||||||
; Switch in ROM, in case it wasn't already switched in by a RESET.
|
; Switch in LC bank 2 for R/O in case it was switched out by a RESET.
|
||||||
bit $C082
|
bit $C080
|
||||||
|
|
||||||
; Call the module destructors.
|
; Call the module destructors.
|
||||||
jsr donelib
|
jsr donelib
|
||||||
|
|
||||||
|
; Switch in ROM.
|
||||||
|
bit $C082
|
||||||
|
|
||||||
; Restore the original RESET vector.
|
; Restore the original RESET vector.
|
||||||
exit: ldx #$02
|
exit: ldx #$02
|
||||||
: lda rvsave,x
|
: lda rvsave,x
|
||||||
|
|||||||
Reference in New Issue
Block a user