initial patch from #1972

This commit is contained in:
mrdudz
2025-06-30 18:39:33 +02:00
parent 4899b6dc0c
commit 26cf19642c
25 changed files with 133 additions and 53 deletions

View File

@@ -9,7 +9,6 @@
.import push0, callmain
.import RESTOR, BSOUT, CLRCH
.import __MAIN_START__, __MAIN_SIZE__, __STACKSIZE__
.importzp ST
.include "zeropage.inc"
.include "c128.inc"
@@ -92,7 +91,7 @@ L2: lda zpsave,x
; Place the program return code into BASIC's status variable.
pla
sta ST
sta STATUS
; Reset the stack and the memory configuration.

View File

@@ -1,5 +1,15 @@
;
; Oliver Schmidt, 2012-09-30
; Stefan Haubenthal, 2023-01-16
;
.exportzp ST := $90 ; IEC status byte
.export initst
.include "c128.inc"
.proc initst
lda #$00
sta STATUS
rts
.endproc

View File

@@ -10,9 +10,9 @@
.import initlib, donelib
.import callmain, zerobss
.import MEMTOP, RESTOR, BSOUT, CLRCH
.importzp ST
.include "zeropage.inc"
.include "c16.inc"
; ------------------------------------------------------------------------
; Startup code
@@ -76,7 +76,7 @@ L2: lda zpsave,x
; Store the return code into BASIC's status variable.
pla
sta ST
sta STATUS
; Restore the stack pointer.

View File

@@ -10,9 +10,9 @@
.import BSOUT
.import __MAIN_START__, __MAIN_SIZE__ ; Linker generated
.import __STACKSIZE__ ; from configure file
.importzp ST
.include "zeropage.inc"
.include "c64.inc"
; ------------------------------------------------------------------------
@@ -62,7 +62,7 @@ L2: lda zpsave,x
; Place the program return code into BASIC's status variable.
pla
sta ST
sta STATUS
; Restore the system stuff.

View File

@@ -1,5 +1,15 @@
;
; Oliver Schmidt, 2012-09-30
; Stefan Haubenthal, 2023-01-16
;
.exportzp ST := $90 ; IEC status byte
.export initst
.include "c64.inc"
.proc initst
lda #$00
sta STATUS
rts
.endproc

View File

@@ -10,7 +10,8 @@
.import isdisk
.import opencmdchannel
.import closecmdchannel
.importzp ST
.import initst
.import READST
.importzp tmp2
;------------------------------------------------------------------------------
@@ -40,8 +41,7 @@ next: inx
; only [in|de]crement the reference count of the shared cmdchannel
; so we need to explicitly initialize ST here
lda #$00
sta ST
jsr initst
stx tmp2
jsr opencmdchannel
@@ -49,10 +49,7 @@ next: inx
jsr closecmdchannel
ldx tmp2
; As we had to reference ST above anyway we can as well do so
; here too (instead of calling READST)
lda ST
jsr READST
; Either the Kernal calls above were successful or there was
; already a cmdchannel to the device open - which is a pretty

View File

@@ -16,11 +16,9 @@
jsr sys_bank
sty ktmp ; Save Y register
ldy #$9C ; STATUS
ldy #STATUS
lda (sysp0),y ; Load STATUS from system bank
ldy ktmp
jmp restore_bank ; Will set condition codes on A
.endproc

View File

@@ -22,7 +22,7 @@
sty ktmp
txa
ldy #$90 ; FNAM
ldy #FNAM
sta (sysp0),y
lda ktmp
@@ -33,13 +33,10 @@
ldy #$92 ; FNAM_SEG
sta (sysp0),y
ldy #$9D ; FNAM_LEN
ldy #FNAM_LEN
pla
sta (sysp0),y
ldy ktmp
jmp restore_bank
.endproc

21
libsrc/cbm510/status.s Normal file
View File

@@ -0,0 +1,21 @@
;
; Stefan Haubenthal, 2023-01-16
;
.export initst
.include "extzp.inc"
.include "cbm510.inc"
.proc initst
ldx IndReg
ldy #$0F
sty IndReg ; Switch to the system bank
ldy #STATUS
lda #$00 ; Initialize value
sta (sysp0),y
stx IndReg
rts
.endproc

View File

@@ -394,7 +394,7 @@ _exit: pha ; Save the return code
; Place the program return code into BASIC's status variable.
pla
ldy #$9C ; ST
ldy #STATUS
sta (sysp0),y
; Set up the welcome code at the stack bottom in the system bank.

View File

@@ -16,11 +16,9 @@
jsr sys_bank
sty ktmp ; Save Y register
ldy #$9C ; STATUS
ldy #STATUS
lda (sysp0),y ; Load STATUS from system bank
ldy ktmp
jmp restore_bank ; Will set condition codes on A
.endproc

View File

@@ -22,7 +22,7 @@
sty ktmp
txa
ldy #$90 ; FNAM
ldy #FNAM
sta (sysp0),y
lda ktmp
@@ -30,14 +30,13 @@
sta (sysp0),y
lda ExecReg ; Assume name is always in this segment
ldy #$92 ; FNAM_SEG
ldy #FNAM_SEG
sta (sysp0),y
ldy #$9D ; FNAM_LEN
ldy #FNAM_LEN
pla
sta (sysp0),y
ldy ktmp
jmp restore_bank
.endproc

21
libsrc/cbm610/status.s Normal file
View File

@@ -0,0 +1,21 @@
;
; Stefan Haubenthal, 2023-01-16
;
.export initst
.include "extzp.inc"
.include "cbm610.inc"
.proc initst
ldx IndReg
ldy #$0F
sty IndReg ; Switch to the system bank
ldy #STATUS
lda #$00 ; Initialize value
sta (sysp0),y
stx IndReg
rts
.endproc

View File

@@ -6,12 +6,12 @@
;
.export checkst
.importzp ST
.include "pet.inc"
.proc checkst
lda ST
lda STATUS
beq @L1
lda #5 ; ### Device not present
sec

View File

@@ -8,7 +8,6 @@
.import zerobss, push0
.import callmain
.import CLRCH, BSOUT
.importzp ST
.include "zeropage.inc"
.include "pet.inc"
@@ -80,7 +79,7 @@ L2: lda zpsave,x
; Store the program return code into BASIC's status variable.
pla
sta ST
sta STATUS
; Restore the stack pointer.

View File

@@ -5,14 +5,12 @@
;
.export READST
.importzp ST
.include "pet.inc"
.proc READST
lda ST
lda STATUS
rts
.endproc

View File

@@ -1,5 +1,15 @@
;
; Oliver Schmidt, 2012-09-30
; Stefan Haubenthal, 2023-01-16
;
.exportzp ST := $96 ; IEC status byte
.export initst
.include "pet.inc"
.proc initst
lda #$00
sta STATUS
rts
.endproc

View File

@@ -10,7 +10,6 @@
.import callmain, zerobss
.import __INTERRUPTOR_COUNT__
.import __HIMEM__ ; Linker generated
.importzp ST
.include "zeropage.inc"
.include "plus4.inc"
@@ -121,7 +120,7 @@ L2: lda zpsave,x
; Place the program return code into BASIC's status variable.
pla
sta ST
sta STATUS
; Restore the stack pointer.

View File

@@ -7,12 +7,11 @@
.export READST
.include "plus4.inc"
.importzp ST
; Read the status byte from the zero page instead of banking in the ROM
.proc READST
lda ST ; Load status
lda STATUS ; Load status
rts ; Return to caller
.endproc

View File

@@ -1,5 +1,15 @@
;
; Oliver Schmidt, 2012-09-30
; Stefan Haubenthal, 2023-01-16
;
.exportzp ST := $90 ; IEC status byte
.export initst
.include "plus4.inc"
.proc initst
lda #$00
sta STATUS
rts
.endproc

View File

@@ -10,9 +10,9 @@
.import RESTOR, BSOUT, CLRCH
.import __MAIN_START__, __MAIN_SIZE__ ; Linker generated
.import __STACKSIZE__ ; Linker generated
.importzp ST
.include "zeropage.inc"
.include "vic20.inc"
; ------------------------------------------------------------------------
; Startup code
@@ -72,7 +72,7 @@ L2: lda zpsave,x
; Place the program return code into BASIC's status variable.
pla
sta ST
sta STATUS
; Restore the stack pointer.

View File

@@ -1,5 +1,15 @@
;
; Oliver Schmidt, 2012-09-30
; Stefan Haubenthal, 2023-01-16
;
.exportzp ST := $90 ; IEC status byte
.export initst
.include "vic20.inc"
.proc initst
lda #$00
sta STATUS
rts
.endproc