mirror of
https://github.com/a2-4am/4cade.git
synced 2024-11-27 08:50:01 +00:00
Merge branch 'master' of https://github.com/a2-4am/4cade
This commit is contained in:
commit
2963344307
@ -363,6 +363,21 @@ CopyDevs
|
|||||||
!word gGamesListStore
|
!word gGamesListStore
|
||||||
!word -
|
!word -
|
||||||
|
|
||||||
|
!ifndef RELEASE {
|
||||||
|
+READ_ROM_NO_WRITE
|
||||||
|
lda #40
|
||||||
|
sta $21
|
||||||
|
lda #36
|
||||||
|
sta $24
|
||||||
|
dec $25
|
||||||
|
jsr $FC22
|
||||||
|
lda SRC+1
|
||||||
|
jsr $FDDA
|
||||||
|
lda SRC
|
||||||
|
jsr $FDDA
|
||||||
|
+READ_RAM2_WRITE_RAM2
|
||||||
|
}
|
||||||
|
|
||||||
+LDADDR gGamesListStore
|
+LDADDR gGamesListStore
|
||||||
jsr okvs_len
|
jsr okvs_len
|
||||||
sta GameCount
|
sta GameCount
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
; D000..E891 - persistent data structures (per-game cheat categories,
|
; D000..E891 - persistent data structures (per-game cheat categories,
|
||||||
; gGlobalPrefsStore, gGamesListStore)
|
; gGlobalPrefsStore, gGamesListStore)
|
||||||
; ...unused...
|
; ...unused...
|
||||||
; E9E6..FFF9 - main program code
|
; EA6F..FFF9 - main program code
|
||||||
; FFFA..FFFF - NMI, reset, IRQ vectors
|
; FFFA..FFFF - NMI, reset, IRQ vectors
|
||||||
;
|
;
|
||||||
; LC RAM BANK 2
|
; LC RAM BANK 2
|
||||||
@ -123,7 +123,7 @@ MOCKINGBOARD_SLOT = %00001111
|
|||||||
HAS_SPEECH = %10000000
|
HAS_SPEECH = %10000000
|
||||||
|
|
||||||
; AND masks for game info bitfield (after game title in gGamesList)
|
; AND masks for game info bitfield (after game title in gGamesList)
|
||||||
HAS_DHGR_TITLE = %10000000
|
HAS_DHGR_TITLE = %10000000 ; this one is hard-coded via BMI instead of AND/BNE
|
||||||
CHEAT_CATEGORY = %00001111
|
CHEAT_CATEGORY = %00001111
|
||||||
|
|
||||||
; AND masks for MachineStatus
|
; AND masks for MachineStatus
|
||||||
|
12
src/macros.a
12
src/macros.a
@ -11,16 +11,12 @@
|
|||||||
!macro PARAMS_ON_STACK .bytes {
|
!macro PARAMS_ON_STACK .bytes {
|
||||||
pla
|
pla
|
||||||
sta PARAM
|
sta PARAM
|
||||||
pla
|
|
||||||
tax
|
|
||||||
stx PARAM+1
|
|
||||||
lda #.bytes
|
|
||||||
clc
|
clc
|
||||||
adc PARAM
|
adc #.bytes
|
||||||
tay
|
tay
|
||||||
bcc +
|
pla
|
||||||
inx
|
sta PARAM+1
|
||||||
+ txa
|
adc #0
|
||||||
pha
|
pha
|
||||||
tya
|
tya
|
||||||
pha
|
pha
|
||||||
|
12
src/okvs.a
12
src/okvs.a
@ -1,5 +1,5 @@
|
|||||||
;license:MIT
|
;license:MIT
|
||||||
;(c) 2018-9 by 4am
|
;(c) 2018-2020 by 4am
|
||||||
;
|
;
|
||||||
; Ordered key/value store (6502 compatible)
|
; Ordered key/value store (6502 compatible)
|
||||||
;
|
;
|
||||||
@ -127,7 +127,7 @@ okvs_append
|
|||||||
; PTR -> store
|
; PTR -> store
|
||||||
; Y = 0
|
; Y = 0
|
||||||
lda (PTR),y ; A = number of keys in store
|
lda (PTR),y ; A = number of keys in store
|
||||||
clc
|
;;clc
|
||||||
adc #1
|
adc #1
|
||||||
pha ; will return this later
|
pha ; will return this later
|
||||||
sta (PTR),y ; increment number of keys
|
sta (PTR),y ; increment number of keys
|
||||||
@ -155,7 +155,7 @@ okvs_append
|
|||||||
cpy #$FF
|
cpy #$FF
|
||||||
bne -
|
bne -
|
||||||
|
|
||||||
sec
|
;;sec
|
||||||
txa
|
txa
|
||||||
adc PTR ; update PTR to byte after copied key
|
adc PTR ; update PTR to byte after copied key
|
||||||
sta PTR
|
sta PTR
|
||||||
@ -163,7 +163,7 @@ okvs_append
|
|||||||
inc PTR+1
|
inc PTR+1
|
||||||
+ ; PTR -> space for new value
|
+ ; PTR -> space for new value
|
||||||
+LDPARAMPTR 5, SRC ; SRC -> new value to copy
|
+LDPARAMPTR 5, SRC ; SRC -> new value to copy
|
||||||
ldy #7
|
iny ;;ldy #7
|
||||||
lda (PARAM),y ; get max length of value
|
lda (PARAM),y ; get max length of value
|
||||||
tax
|
tax
|
||||||
bne +
|
bne +
|
||||||
@ -260,8 +260,8 @@ KEYLEN = *+1
|
|||||||
adc KEYLEN
|
adc KEYLEN
|
||||||
bcc +
|
bcc +
|
||||||
iny
|
iny
|
||||||
+ clc
|
clc
|
||||||
adc #2
|
+ adc #2
|
||||||
sta PTR
|
sta PTR
|
||||||
bcc +
|
bcc +
|
||||||
iny
|
iny
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
;License:MIT
|
;License:MIT
|
||||||
;(c) 2018-9 by 4am
|
;(c) 2018-2020 by 4am
|
||||||
;
|
;
|
||||||
; functions for animated title screens
|
; functions for animated title screens
|
||||||
;
|
;
|
||||||
@ -28,9 +28,9 @@ MaybeAnimateTitle
|
|||||||
eor #$60
|
eor #$60
|
||||||
+ sta SAVE+1
|
+ sta SAVE+1
|
||||||
and #$60
|
and #$60
|
||||||
sta @a+2
|
sta PageFrom+2
|
||||||
eor #$60
|
eor #$60
|
||||||
sta @b+2
|
tax
|
||||||
lda #$FD
|
lda #$FD
|
||||||
sta SAVE
|
sta SAVE
|
||||||
ldy #0
|
ldy #0
|
||||||
@ -41,17 +41,8 @@ MaybeAnimateTitle
|
|||||||
; file -- this area part of a 'screen
|
; file -- this area part of a 'screen
|
||||||
; hole' and is not displayed on screen)
|
; hole' and is not displayed on screen)
|
||||||
bne @exit ; if not, we're done here
|
bne @exit ; if not, we're done here
|
||||||
|
txa
|
||||||
; copy one HGR screen to the other
|
jsr CopyHGR
|
||||||
ldx #$20
|
|
||||||
@a lda $FD00,y ; SMC
|
|
||||||
@b sta $FD00,y ; SMC
|
|
||||||
iny
|
|
||||||
bne @a
|
|
||||||
inc @a+2
|
|
||||||
inc @b+2
|
|
||||||
dex
|
|
||||||
bne @a
|
|
||||||
|
|
||||||
; load the animation routine, which is stored in a subdirectory by filename
|
; load the animation routine, which is stored in a subdirectory by filename
|
||||||
jsr GetGameToLaunch
|
jsr GetGameToLaunch
|
||||||
|
@ -318,32 +318,13 @@ RedrawForDHGR
|
|||||||
; $0200..$02CB clobbered by decompressor
|
; $0200..$02CB clobbered by decompressor
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
DecompressDHGR
|
DecompressDHGR
|
||||||
jsr SwitchToBank2
|
|
||||||
jsr EnableAccelerator
|
|
||||||
clc
|
|
||||||
lda sizelo2
|
|
||||||
adc #$F8
|
|
||||||
sta _byte_lo
|
|
||||||
lda sizehi2
|
|
||||||
adc #$3F
|
|
||||||
sta _byte_hi
|
|
||||||
sta $C003
|
sta $C003
|
||||||
sta $C005
|
sta $C005
|
||||||
jsr decrunch
|
jsr DecompressHGR
|
||||||
sta $C004
|
sta $C004
|
||||||
lda #$60
|
lda #$60
|
||||||
sta @copyaux+2
|
sta PageFrom+2
|
||||||
lda #$40
|
lda #$40
|
||||||
sta @copyaux+5
|
jsr CopyHGR
|
||||||
ldy #0
|
|
||||||
@copyaux
|
|
||||||
lda $D100, y ; SMC
|
|
||||||
sta $D100, y ; SMC
|
|
||||||
iny
|
|
||||||
bne @copyaux
|
|
||||||
inc @copyaux+5
|
|
||||||
inc @copyaux+2
|
|
||||||
bpl @copyaux
|
|
||||||
sta $C002
|
sta $C002
|
||||||
jsr DisableAccelerator
|
rts
|
||||||
jmp SwitchToBank1
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
;license:MIT
|
;license:MIT
|
||||||
;(c) 2018-9 by 4am
|
;(c) 2018-2020 by 4am
|
||||||
;
|
;
|
||||||
; GR action slideshows
|
; GR action slideshows
|
||||||
;
|
;
|
||||||
@ -52,16 +52,12 @@ GRSingle
|
|||||||
; graphics mode set to display lo-res screen
|
; graphics mode set to display lo-res screen
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
BlankGR
|
BlankGR
|
||||||
|
ldy #$2C ; BIT
|
||||||
|
sty PageFrom
|
||||||
ldx #$04
|
ldx #$04
|
||||||
stx @loop+2
|
stx PageTo+2
|
||||||
lda #0
|
lda #0
|
||||||
tay
|
jsr ClearGR
|
||||||
@loop sta $FD00,y
|
|
||||||
iny
|
|
||||||
bne @loop
|
|
||||||
inc @loop+2
|
|
||||||
dex
|
|
||||||
bne @loop
|
|
||||||
bit PAGE1
|
bit PAGE1
|
||||||
bit $C056 ; set GR mode
|
bit $C056 ; set GR mode
|
||||||
jmp GRMode
|
jmp GRMode
|
||||||
|
@ -173,15 +173,18 @@ HGRActionCallback
|
|||||||
; $0200..$02CB clobbered by decompressor
|
; $0200..$02CB clobbered by decompressor
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
DecompressHGR
|
DecompressHGR
|
||||||
|
lda #$3F
|
||||||
|
|
||||||
|
DecompressCommon
|
||||||
|
pha
|
||||||
jsr SwitchToBank2
|
jsr SwitchToBank2
|
||||||
jsr EnableAccelerator
|
jsr EnableAccelerator
|
||||||
clc
|
clc
|
||||||
lda sizelo2
|
lda sizelo2
|
||||||
adc #$F8
|
adc #$F8
|
||||||
sta _byte_lo
|
sta _byte_lo
|
||||||
lda sizehi2
|
pla
|
||||||
adc #$3F
|
adc sizehi2
|
||||||
sta _byte_hi
|
sta _byte_hi
|
||||||
jsr decrunch
|
jsr decrunch
|
||||||
jsr DisableAccelerator
|
jmp DisableAcceleratorAndSwitchToBank1
|
||||||
jmp SwitchToBank1
|
|
||||||
|
@ -121,13 +121,13 @@ BlankSHR
|
|||||||
jsr Home
|
jsr Home
|
||||||
|
|
||||||
lda NEWVIDEO ; set GS NEWVIDEO mode to turn on linearize
|
lda NEWVIDEO ; set GS NEWVIDEO mode to turn on linearize
|
||||||
ora #%01000000
|
ora #%01000000 ; can't use TSB here - might not be 65816
|
||||||
sta NEWVIDEO
|
sta NEWVIDEO
|
||||||
|
|
||||||
sta WRITEAUXMEM ; writes go to auxmem
|
sta WRITEAUXMEM ; writes go to auxmem
|
||||||
|
|
||||||
lda SHADOW ; enable auxmem-to-bank-E1 shadowing on IIgs
|
lda SHADOW ; enable auxmem-to-bank-E1 shadowing on IIgs
|
||||||
and #$F7
|
and #$F7 ; can't use TRB here - might not be 65816
|
||||||
sta SHADOW
|
sta SHADOW
|
||||||
|
|
||||||
lda #$20 ; clear $2000..$9FFF in auxmem
|
lda #$20 ; clear $2000..$9FFF in auxmem
|
||||||
@ -137,7 +137,7 @@ BlankSHR
|
|||||||
sta WRITEMAINMEM ; writes go to main memory
|
sta WRITEMAINMEM ; writes go to main memory
|
||||||
|
|
||||||
lda NEWVIDEO ; set GS NEWVIDEO mode to turn on SHR mode
|
lda NEWVIDEO ; set GS NEWVIDEO mode to turn on SHR mode
|
||||||
ora #%10000001
|
ora #%10000001 ; can't use TSB here - might not be 65816
|
||||||
sta NEWVIDEO
|
sta NEWVIDEO
|
||||||
|
|
||||||
rts
|
rts
|
||||||
@ -154,15 +154,6 @@ BlankSHR
|
|||||||
; $0200..$02CB clobbered by decompressor
|
; $0200..$02CB clobbered by decompressor
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
DecompressSHR
|
DecompressSHR
|
||||||
jsr SwitchToBank2
|
lda #$1F
|
||||||
jsr EnableAccelerator
|
jmp DecompressCommon
|
||||||
clc
|
|
||||||
lda sizelo2
|
|
||||||
adc #$F8
|
|
||||||
sta _byte_lo
|
|
||||||
lda sizehi2
|
|
||||||
adc #$1F
|
|
||||||
sta _byte_hi
|
|
||||||
jsr decrunch
|
|
||||||
jsr DisableAccelerator
|
|
||||||
jmp SwitchToBank1
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
;license:MIT
|
;license:MIT
|
||||||
;(c) 2018-9 by 4am
|
;(c) 2018-2020 by 4am
|
||||||
;
|
;
|
||||||
; credits page
|
; credits page
|
||||||
;
|
;
|
||||||
@ -26,7 +26,7 @@ Credits
|
|||||||
lda OffscreenPage
|
lda OffscreenPage
|
||||||
ror ; draw on offscreen page
|
ror ; draw on offscreen page
|
||||||
+LDADDR $8000
|
+LDADDR $8000
|
||||||
ldx #0
|
tax
|
||||||
jsr DrawPage ; draw credits
|
jsr DrawPage ; draw credits
|
||||||
jsr ShowOtherPage ; show credits
|
jsr ShowOtherPage ; show credits
|
||||||
jsr WaitForKeyFor30Seconds; wait
|
jsr WaitForKeyFor30Seconds; wait
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
;license:MIT
|
;license:MIT
|
||||||
;(c) 2018-9 by 4am
|
;(c) 2018-2020 by 4am
|
||||||
;
|
;
|
||||||
; hi-res font drawing routines
|
; hi-res font drawing routines
|
||||||
;
|
;
|
||||||
@ -18,24 +18,26 @@
|
|||||||
DrawString
|
DrawString
|
||||||
jsr SwitchToBank2
|
jsr SwitchToBank2
|
||||||
jsr DrawStringInternal
|
jsr DrawStringInternal
|
||||||
jmp SwitchToBank1
|
bmi JmpSwitch ; always
|
||||||
|
|
||||||
DrawPage
|
DrawPage
|
||||||
jsr SwitchToBank2
|
jsr SwitchToBank2
|
||||||
jsr DrawPageInternal
|
jsr DrawPageInternal
|
||||||
|
|
||||||
|
JmpSwitch
|
||||||
jmp SwitchToBank1
|
jmp SwitchToBank1
|
||||||
|
|
||||||
Draw40Chars
|
Draw40Chars
|
||||||
jsr SwitchToBank2
|
jsr SwitchToBank2
|
||||||
jsr Draw40CharsInternal
|
jsr Draw40CharsInternal
|
||||||
jmp SwitchToBank1
|
beq JmpSwitch ; always
|
||||||
|
|
||||||
DrawCenteredString
|
DrawCenteredString
|
||||||
jsr SwitchToBank2
|
jsr SwitchToBank2
|
||||||
jsr DrawCenteredStringInternal
|
jsr DrawCenteredStringInternal
|
||||||
jmp SwitchToBank1
|
bmi JmpSwitch ; always
|
||||||
|
|
||||||
DrawBuffer
|
DrawBuffer
|
||||||
jsr SwitchToBank2
|
jsr SwitchToBank2
|
||||||
jsr DrawBufferInternal
|
jsr DrawBufferInternal
|
||||||
jmp SwitchToBank1
|
bmi JmpSwitch ; always
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
;License:MIT
|
;License:MIT
|
||||||
;(c) 2018-9 by 4am
|
;(c) 2018-2020 by 4am
|
||||||
;
|
;
|
||||||
; functions for managing which HGR page is showing, and doing things on the other one
|
; functions for managing which HGR page is showing, and doing things on the other one
|
||||||
;
|
;
|
||||||
@ -94,8 +94,8 @@ LoadGameTitleOffscreen
|
|||||||
sta SAVE
|
sta SAVE
|
||||||
tay
|
tay
|
||||||
lda (PTR),y ; A = game info bitfield
|
lda (PTR),y ; A = game info bitfield
|
||||||
and #HAS_DHGR_TITLE
|
;;and #HAS_DHGR_TITLE
|
||||||
bne @dhgr
|
bmi @dhgr
|
||||||
@hgr
|
@hgr
|
||||||
jsr ForceHGRMode
|
jsr ForceHGRMode
|
||||||
jsr GetOffscreenAddress
|
jsr GetOffscreenAddress
|
||||||
@ -135,17 +135,35 @@ ClearHGR1
|
|||||||
lda #$20 ; note to self: LDX #$20 can't move here
|
lda #$20 ; note to self: LDX #$20 can't move here
|
||||||
ldx #$20
|
ldx #$20
|
||||||
ClearMem
|
ClearMem
|
||||||
sta @a+2
|
ldy #$2C ; BIT
|
||||||
|
bne + ; always
|
||||||
|
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
|
; CopyHGR
|
||||||
|
;
|
||||||
|
; in: source and destination page pointers set
|
||||||
|
; out: all registers clobbered
|
||||||
|
; 8kb memory region duplicated
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
|
CopyHGR
|
||||||
|
ldx #$20
|
||||||
|
ldy #$B9 ; LDY
|
||||||
|
+ sty PageFrom
|
||||||
|
sta PageTo+2
|
||||||
lda #$80
|
lda #$80
|
||||||
|
ClearGR
|
||||||
ldy #0
|
ldy #0
|
||||||
@a sta $2000,y
|
PageFrom lda $FD00,y ; SMC
|
||||||
|
PageTo sta $FD00,y ; SMC
|
||||||
iny
|
iny
|
||||||
bne @a
|
bne PageFrom
|
||||||
inc @a+2
|
inc PageFrom+2
|
||||||
|
inc PageTo+2
|
||||||
dex
|
dex
|
||||||
bne @a
|
bne PageFrom
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
ResyncPage
|
ResyncPage
|
||||||
jsr ToggleOffscreenPage
|
jsr ToggleOffscreenPage
|
||||||
; /!\ execution falls through here to ShowOtherPage
|
; /!\ execution falls through here to ShowOtherPage
|
||||||
|
Loading…
Reference in New Issue
Block a user