mirror of
https://github.com/irmen/prog8.git
synced 2025-01-12 04:30:03 +00:00
cx16: reset rom/ram/monitor banks at program exit to sane values.
This commit is contained in:
parent
7901ec2a64
commit
fb989ae62f
@ -127,11 +127,8 @@ internal class ProgramAndVarsGen(
|
|||||||
"cx16" -> {
|
"cx16" -> {
|
||||||
if(options.floats)
|
if(options.floats)
|
||||||
asmgen.out(" lda #4 | sta $01") // to use floats, make sure Basic rom is banked in
|
asmgen.out(" lda #4 | sta $01") // to use floats, make sure Basic rom is banked in
|
||||||
asmgen.out(" jsr main.start | lda #4 | sta $01")
|
asmgen.out(" jsr main.start")
|
||||||
if(!options.noSysInit)
|
|
||||||
asmgen.out(" jmp ${compTarget.name}.cleanup_at_exit")
|
asmgen.out(" jmp ${compTarget.name}.cleanup_at_exit")
|
||||||
else
|
|
||||||
asmgen.out(" rts")
|
|
||||||
}
|
}
|
||||||
"c64" -> {
|
"c64" -> {
|
||||||
asmgen.out(" jsr main.start | lda #31 | sta $01")
|
asmgen.out(" jsr main.start | lda #31 | sta $01")
|
||||||
|
@ -639,8 +639,12 @@ asmsub init_system_phase2() {
|
|||||||
|
|
||||||
asmsub cleanup_at_exit() {
|
asmsub cleanup_at_exit() {
|
||||||
; executed when the main subroutine does rts
|
; executed when the main subroutine does rts
|
||||||
; just an rts here, nothing special to clean up on cx16
|
|
||||||
%asm {{
|
%asm {{
|
||||||
|
lda #1
|
||||||
|
sta $00 ; ram bank 1
|
||||||
|
lda #4
|
||||||
|
sta $01 ; rom bank 4 (kernal)
|
||||||
|
stz $2d ; hack to reset machine code monitor bank to 0
|
||||||
rts
|
rts
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
@ -3,9 +3,6 @@ TODO
|
|||||||
|
|
||||||
For next release
|
For next release
|
||||||
^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^
|
||||||
- cx16 programs seem to poke 0, 56 at exit?
|
|
||||||
- assembling hello4.asm prints stray characters in the string
|
|
||||||
|
|
||||||
- petaxian roller.p8 line 49 (also see test.p8) generates large code compared to 8.2
|
- petaxian roller.p8 line 49 (also see test.p8) generates large code compared to 8.2
|
||||||
|
|
||||||
- code gen for if statements has become inefficient? vm/6502?
|
- code gen for if statements has become inefficient? vm/6502?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user