mirror of
https://github.com/cc65/cc65.git
synced 2025-04-10 02:39:26 +00:00
Swap in LC before destructors, ROM after
This commit is contained in:
parent
57e65a6bf6
commit
f0b5b02966
@ -62,7 +62,7 @@ Special locations:
|
||||
</descrip><p>
|
||||
|
||||
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
|
||||
generated code. However code is never automatically placed there. Rather code
|
||||
|
@ -63,7 +63,7 @@ Special locations:
|
||||
</descrip><p>
|
||||
|
||||
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
|
||||
generated code. However code is never automatically placed there. Rather code
|
||||
|
@ -40,12 +40,15 @@ _exit: ldx #<exit
|
||||
lda #>exit
|
||||
jsr reset ; Setup RESET vector
|
||||
|
||||
; Switch in ROM, in case it wasn't already switched in by a RESET.
|
||||
bit $C082
|
||||
; Switch in LC bank 2 for R/O in case it was switched out by a RESET.
|
||||
bit $C080
|
||||
|
||||
; Call the module destructors.
|
||||
jsr donelib
|
||||
|
||||
; Switch in ROM.
|
||||
bit $C082
|
||||
|
||||
; Restore the original RESET vector.
|
||||
exit: ldx #$02
|
||||
: lda rvsave,x
|
||||
|
Loading…
x
Reference in New Issue
Block a user