c128: fix memory bank resetting

This commit is contained in:
Irmen de Jong 2023-04-28 04:02:07 +02:00
parent 0bea721c2e
commit e056a28316
2 changed files with 7 additions and 10 deletions

View File

@ -150,8 +150,7 @@ internal class ProgramAndVarsGen(
asmgen.out(" rts") asmgen.out(" rts")
} }
"c128" -> { "c128" -> {
asmgen.out(" jsr main.start") asmgen.out(" jsr main.start | lda #0 | sta ${"$"}ff00")
// TODO c128: how to bank basic+kernal back in?
if(!options.noSysInit) if(!options.noSysInit)
asmgen.out(" jmp ${compTarget.name}.cleanup_at_exit") asmgen.out(" jmp ${compTarget.name}.cleanup_at_exit")
else else

View File

@ -480,10 +480,8 @@ asmsub init_system() {
%asm {{ %asm {{
sei sei
cld cld
;;lda #%00101111 ; TODO c128 ram and rom bank selection how? lda #0
;;sta $00 sta $ff00 ; select default bank 15
;;lda #%00100111
;;sta $01
jsr c64.IOINIT jsr c64.IOINIT
jsr c64.RESTOR jsr c64.RESTOR
jsr c64.CINT jsr c64.CINT
@ -549,8 +547,8 @@ sys {
; Soft-reset the system back to initial power-on Basic prompt. ; Soft-reset the system back to initial power-on Basic prompt.
%asm {{ %asm {{
sei sei
;lda #14 lda #0
;sta $01 ; bank the kernal in TODO c128 how to do this? sta $ff00 ; default bank 15
jmp (c64.RESET_VEC) jmp (c64.RESET_VEC)
}} }}
} }
@ -731,8 +729,8 @@ _longcopy
inline asmsub exit(ubyte returnvalue @A) { inline asmsub exit(ubyte returnvalue @A) {
; -- immediately exit the program with a return code in the A register ; -- immediately exit the program with a return code in the A register
%asm {{ %asm {{
;lda #14 lda #0
;sta $01 ; bank the kernal in TODO c128 how to do this? sta $ff00 ; default bank 15
jsr c64.CLRCHN ; reset i/o channels jsr c64.CLRCHN ; reset i/o channels
jsr c64.enable_runstop_and_charsetswitch jsr c64.enable_runstop_and_charsetswitch
ldx prog8_lib.orig_stackpointer ldx prog8_lib.orig_stackpointer