mirror of
https://github.com/a2-4am/pitch-dark.git
synced 2024-06-01 14:41:40 +00:00
work around NSC memory overwrite
This commit is contained in:
parent
566f2356ab
commit
6b960358b8
|
@ -19,7 +19,7 @@ init
|
|||
op_c7
|
||||
!byte $c7
|
||||
!word c7_parms
|
||||
ldx $200
|
||||
ldx $280
|
||||
bne +
|
||||
|
||||
;if not, get volume name
|
||||
|
@ -27,24 +27,24 @@ op_c7
|
|||
jsr $bf00
|
||||
!byte $c5
|
||||
!word c5_parms
|
||||
ldx $201
|
||||
ldx $281
|
||||
inx
|
||||
txa
|
||||
and #$0f
|
||||
sta $200
|
||||
sta $280
|
||||
lda #$2f
|
||||
sta $201
|
||||
sta $281
|
||||
|
||||
;set that as prefix
|
||||
|
||||
dec op_c7
|
||||
bne -
|
||||
+ lda #$2f
|
||||
cmp $200,x
|
||||
cmp $280,x
|
||||
beq +
|
||||
inx
|
||||
stx $200
|
||||
sta $200,x
|
||||
stx $280
|
||||
sta $280,x
|
||||
|
||||
;form absolute path
|
||||
|
||||
|
@ -57,11 +57,11 @@ op_c7
|
|||
tya
|
||||
pha
|
||||
clc
|
||||
adc $200
|
||||
sta $200
|
||||
adc $280
|
||||
sta $280
|
||||
tax
|
||||
- lda $2006,y
|
||||
sta $200,x
|
||||
sta $280,x
|
||||
dex
|
||||
dey
|
||||
bne -
|
||||
|
@ -159,14 +159,13 @@ quit jsr $bf00
|
|||
jmp $3000
|
||||
|
||||
c7_parms
|
||||
cc_parms
|
||||
!byte 1
|
||||
!word $200
|
||||
!word $280
|
||||
|
||||
c5_parms
|
||||
!byte 2
|
||||
!byte 0
|
||||
!word $201
|
||||
!word $281
|
||||
!byte $d1
|
||||
|
||||
c6_parms
|
||||
|
@ -192,6 +191,10 @@ ca_parms
|
|||
!word $ffff
|
||||
!word $ffff
|
||||
|
||||
cc_parms
|
||||
!byte 1
|
||||
!byte 0
|
||||
|
||||
filename
|
||||
!byte (filename_e-filename)-1
|
||||
!text "LIB/ONBEYONDZ"
|
||||
|
|
|
@ -42,6 +42,7 @@ zp_E5 = $E5
|
|||
zp_E6 = $E6
|
||||
zp_E7 = $E7
|
||||
|
||||
jsr exchange
|
||||
jsr $bf00
|
||||
!byte $c8 ;open file
|
||||
!word c8_parms
|
||||
|
@ -50,7 +51,6 @@ zp_E7 = $E7
|
|||
sta ce_handle
|
||||
sta ca_handle
|
||||
|
||||
jsr exchange
|
||||
lda #>info_buffer
|
||||
sta zpage_info+1
|
||||
lda #<info_buffer
|
||||
|
@ -92,14 +92,6 @@ fetch_info
|
|||
!byte $cc ;close file
|
||||
!word cc_parms
|
||||
|
||||
exchange
|
||||
ldx #(zp_E7-zp_91)
|
||||
- ldy zpage_old-1,x
|
||||
lda zp_91-1,x
|
||||
sty zp_91-1,x
|
||||
sta zpage_old-1,x
|
||||
dex
|
||||
bne -
|
||||
quit
|
||||
lda $bf30
|
||||
sta c5_parms+1
|
||||
|
@ -117,6 +109,16 @@ quit
|
|||
!byte $c6
|
||||
!word c6_parms
|
||||
|
||||
exchange
|
||||
ldx #(zp_E7-zp_91)
|
||||
- ldy zpage_old-1,x
|
||||
lda zp_91-1,x
|
||||
sty zp_91-1,x
|
||||
sta zpage_old-1,x
|
||||
dex
|
||||
bne -
|
||||
rts
|
||||
|
||||
load_page
|
||||
cmp zp_C0
|
||||
beq seek_ret
|
||||
|
|
|
@ -44,6 +44,7 @@ zp_E7 = $e7
|
|||
zp_E8 = $e8
|
||||
zp_E9 = $e9
|
||||
|
||||
jsr exchange
|
||||
jsr $bf00
|
||||
!byte $c8 ;open file
|
||||
!word c8_parms
|
||||
|
@ -52,7 +53,6 @@ zp_E9 = $e9
|
|||
sta ce_handle
|
||||
sta ca_handle
|
||||
|
||||
jsr exchange
|
||||
lda #>info_buffer
|
||||
sta zpage_info+1
|
||||
lda #<info_buffer
|
||||
|
@ -94,6 +94,7 @@ fetch_info
|
|||
!byte $cc ;close file
|
||||
!word cc_parms
|
||||
|
||||
quit
|
||||
jsr $bf00
|
||||
!byte $c5
|
||||
!word c5_parms
|
||||
|
@ -116,7 +117,6 @@ exchange
|
|||
sta zpage_old-1,x
|
||||
dex
|
||||
bne -
|
||||
quit
|
||||
rts
|
||||
|
||||
load_page
|
||||
|
|
|
@ -52,6 +52,7 @@ zp_D8 = $d8
|
|||
zp_DB = $db
|
||||
zp_DC = $dc
|
||||
|
||||
jsr exchange
|
||||
jsr $bf00
|
||||
!byte $c8 ;open file
|
||||
!word c8_parms
|
||||
|
@ -59,7 +60,6 @@ zp_DC = $dc
|
|||
sta ce_handle
|
||||
sta ca_handle
|
||||
|
||||
jsr exchange
|
||||
lda #>info_buffer
|
||||
sta zpage_info+1
|
||||
lda #<info_buffer
|
||||
|
@ -133,6 +133,7 @@ nextpos
|
|||
!byte $cc ;close file
|
||||
!word cc_parms
|
||||
|
||||
quit
|
||||
lda $bf30
|
||||
sta c5_parms+1
|
||||
jsr $bf00
|
||||
|
@ -157,7 +158,6 @@ exchange
|
|||
sta zpage_old-1,x
|
||||
dex
|
||||
bne -
|
||||
quit
|
||||
rts
|
||||
|
||||
load_page
|
||||
|
|
|
@ -19,7 +19,7 @@ init
|
|||
op_c7
|
||||
!byte $c7
|
||||
!word c7_parms
|
||||
ldx $200
|
||||
ldx $280
|
||||
bne +
|
||||
|
||||
;if not, get volume name
|
||||
|
@ -27,24 +27,24 @@ op_c7
|
|||
jsr $bf00
|
||||
!byte $c5
|
||||
!word c5_parms
|
||||
ldx $201
|
||||
ldx $281
|
||||
inx
|
||||
txa
|
||||
and #$0f
|
||||
sta $200
|
||||
sta $280
|
||||
lda #$2f
|
||||
sta $201
|
||||
sta $281
|
||||
|
||||
;set that as prefix
|
||||
|
||||
dec op_c7
|
||||
bne -
|
||||
+ lda #$2f
|
||||
cmp $200,x
|
||||
cmp $280,x
|
||||
beq +
|
||||
inx
|
||||
stx $200
|
||||
sta $200,x
|
||||
stx $280
|
||||
sta $280,x
|
||||
|
||||
;form absolute path
|
||||
|
||||
|
@ -57,11 +57,11 @@ op_c7
|
|||
tya
|
||||
pha
|
||||
clc
|
||||
adc $200
|
||||
sta $200
|
||||
adc $280
|
||||
sta $280
|
||||
tax
|
||||
- lda $2006,y
|
||||
sta $200,x
|
||||
sta $280,x
|
||||
dex
|
||||
dey
|
||||
bne -
|
||||
|
@ -118,13 +118,13 @@ quit jsr $bf00
|
|||
jsr $bf00
|
||||
!byte $c5
|
||||
!word c5_parms
|
||||
ldx $301
|
||||
ldx $381
|
||||
inx
|
||||
txa
|
||||
and #$0f
|
||||
sta $300
|
||||
sta $380
|
||||
lda #$2f
|
||||
sta $301
|
||||
sta $381
|
||||
|
||||
;use that for intepreter location
|
||||
|
||||
|
@ -168,19 +168,18 @@ quit jsr $bf00
|
|||
jmp $3000
|
||||
|
||||
c7_parms
|
||||
cc_parms
|
||||
!byte 1
|
||||
!word $200
|
||||
!word $280
|
||||
|
||||
c5_parms
|
||||
!byte 2
|
||||
!byte 0
|
||||
!word $201
|
||||
!word $281
|
||||
!byte $d1
|
||||
|
||||
c6_parms
|
||||
!byte 1
|
||||
!word $300
|
||||
!word $380
|
||||
|
||||
c4_parms
|
||||
!byte $0a
|
||||
|
@ -201,6 +200,10 @@ ca_parms
|
|||
!word $ffff
|
||||
!word $ffff
|
||||
|
||||
cc_parms
|
||||
!byte 1
|
||||
!byte 0
|
||||
|
||||
filename
|
||||
!byte (filename_e-filename)-1
|
||||
!text "LIB/ZINFO"
|
||||
|
|
Loading…
Reference in New Issue
Block a user