mirror of
https://github.com/a2-4am/pitch-dark.git
synced 2024-06-13 18:29:28 +00:00
support VidHD SHR
This commit is contained in:
parent
a3ab7caa71
commit
c57bfdbefa
|
@ -17,7 +17,7 @@
|
||||||
;~7400...... - program data (approximate)
|
;~7400...... - program data (approximate)
|
||||||
;
|
;
|
||||||
|
|
||||||
kPitchDarkBinaryAddress = $3F55
|
kPitchDarkBinaryAddress = $3F2F
|
||||||
|
|
||||||
kGameInfoBuffer = $0800 ; used by LoadGameInfo
|
kGameInfoBuffer = $0800 ; used by LoadGameInfo
|
||||||
kProDOSFileBuffer = $1C00 ; 1K buffer for ProDOS MLI calls
|
kProDOSFileBuffer = $1C00 ; 1K buffer for ProDOS MLI calls
|
||||||
|
|
|
@ -43,6 +43,33 @@
|
||||||
dec DEVCNT ; reduce ProDOS device count
|
dec DEVCNT ; reduce ProDOS device count
|
||||||
@noRAMdisk
|
@noRAMdisk
|
||||||
|
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
|
; detect VidHD by searching for magic bytes across all slots
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
ldx #$c7
|
||||||
|
@findVidHD
|
||||||
|
stx @matchVidHD+2
|
||||||
|
ldy #2
|
||||||
|
@matchVidHD
|
||||||
|
lda $c700, y ; SMC
|
||||||
|
cmp @kVidHDID, y
|
||||||
|
bne @nextslot
|
||||||
|
dey
|
||||||
|
bpl @matchVidHD
|
||||||
|
dec PatchVidHD1+1 ; affect branch to pretend IIGS
|
||||||
|
lda #$90
|
||||||
|
sta PatchVidHD2 ; affect branch to pretend IIGS
|
||||||
|
ldx #$c1 ; force exit via fall-through
|
||||||
|
|
||||||
|
@nextslot
|
||||||
|
dex
|
||||||
|
cpx #$c0
|
||||||
|
bne @findVidHD
|
||||||
|
beq +
|
||||||
|
@kVidHDID
|
||||||
|
!byte $24, $EA, $4C
|
||||||
|
+
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
; clear options script and make checksum invalid
|
; clear options script and make checksum invalid
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
|
|
|
@ -184,22 +184,25 @@ LoadSHRFile
|
||||||
bne -
|
bne -
|
||||||
|
|
||||||
jsr _openfile
|
jsr _openfile
|
||||||
bcs @exit ; C set on error
|
bcs exit ; C set on error
|
||||||
sta @saverefnum ; store file refnum
|
sta saverefnum ; store file refnum
|
||||||
|
|
||||||
ldy #$20
|
ldy #$20
|
||||||
stz mliparam+2 ; read into $2000 in main mem
|
stz mliparam+2 ; read into $2000 in main mem
|
||||||
sty mliparam+3
|
sty mliparam+3
|
||||||
stz mliparam+4 ; read length = $2000 bytes (one quarter of file)
|
stz mliparam+4 ; read length = $2000 bytes (one quarter of file)
|
||||||
sty mliparam+5
|
sty mliparam+5
|
||||||
sty @shrdest+2
|
sty shrdest+2
|
||||||
|
|
||||||
ldx #4 ; four quarters
|
ldx #4 ; four quarters
|
||||||
- lda @saverefnum ; file refnum
|
- lda saverefnum ; file refnum
|
||||||
jsr _readfile
|
jsr _readfile
|
||||||
bcs @close
|
bcs close
|
||||||
phx
|
phx
|
||||||
|
|
||||||
|
PatchVidHD2
|
||||||
|
bcs copyvidhd
|
||||||
|
|
||||||
!cpu 65816
|
!cpu 65816
|
||||||
xce
|
xce
|
||||||
rep #$30
|
rep #$30
|
||||||
|
@ -208,29 +211,58 @@ LoadSHRFile
|
||||||
lda #$1FFF
|
lda #$1FFF
|
||||||
tax
|
tax
|
||||||
inx
|
inx
|
||||||
@shrdest ldy #$FD00 ; SMC
|
shrdest ldy #$FD00 ; SMC
|
||||||
phb
|
phb
|
||||||
mvn 0,$E1
|
mvn 0,$E1
|
||||||
plb
|
plb
|
||||||
sty @shrdest+1
|
sty shrdest+1
|
||||||
!as
|
!as
|
||||||
!rs
|
!rs
|
||||||
sec
|
sec
|
||||||
xce
|
xce
|
||||||
!cpu 65C02
|
!cpu 65C02
|
||||||
|
resumeread
|
||||||
plx
|
plx
|
||||||
dex
|
dex
|
||||||
bne -
|
bne -
|
||||||
|
|
||||||
@close php ; save flags from readfile
|
close php ; save flags from readfile
|
||||||
@saverefnum=*+1
|
saverefnum=*+1
|
||||||
lda #$FD ; file refnum (SMC)
|
lda #$FD ; file refnum (SMC)
|
||||||
jsr _closefile
|
jsr _closefile
|
||||||
plp ; restore flags from readfile
|
plp ; restore flags from readfile
|
||||||
@exit rts
|
exit rts
|
||||||
|
|
||||||
|
copyvidhd
|
||||||
|
lda $C035
|
||||||
|
and #$F7 ;Enable SHR shadowing
|
||||||
|
sta $C035
|
||||||
|
lda #$a0
|
||||||
|
sec
|
||||||
|
@calcdest
|
||||||
|
sbc #$20
|
||||||
|
dex
|
||||||
|
bne @calcdest
|
||||||
|
sta $45
|
||||||
|
stx $44
|
||||||
|
ldx #$20
|
||||||
|
ldy #0
|
||||||
|
stx $43
|
||||||
|
sty $42
|
||||||
|
sta $C005 ;CPU writes go to aux 64K
|
||||||
|
@copyshr
|
||||||
|
lda ($42), y
|
||||||
|
sta ($44), y
|
||||||
|
iny
|
||||||
|
bne @copyshr
|
||||||
|
inc $43
|
||||||
|
inc $45
|
||||||
|
dex
|
||||||
|
bne @copyshr
|
||||||
|
sta $C004 ;CPU writes go to main 64K
|
||||||
|
clc
|
||||||
|
bcc resumeread
|
||||||
|
|
||||||
;-------------------------------
|
|
||||||
; SaveFile
|
; SaveFile
|
||||||
; save a file to disk all at once, using ProDOS MLI calls
|
; save a file to disk all at once, using ProDOS MLI calls
|
||||||
;
|
;
|
||||||
|
|
|
@ -27,6 +27,7 @@ DisplayArtwork
|
||||||
!cpu 65816
|
!cpu 65816
|
||||||
rep #2 ; clear Z flag on 65816 only
|
rep #2 ; clear Z flag on 65816 only
|
||||||
!cpu 65c02
|
!cpu 65c02
|
||||||
|
PatchVidHD1
|
||||||
beq + ; skip GS-specific code on non-GS machines (required, will crash on //c, grr)
|
beq + ; skip GS-specific code on non-GS machines (required, will crash on //c, grr)
|
||||||
lda $C029
|
lda $C029
|
||||||
ora #$40
|
ora #$40
|
||||||
|
|
Loading…
Reference in New Issue
Block a user