auto-slot MB for Willy Byte levels

This commit is contained in:
Peter Ferrie 2025-01-02 16:18:15 -08:00
parent 4bde0e2a7d
commit 7a58ae390c
3 changed files with 241 additions and 38 deletions

View File

@ -10,3 +10,4 @@ KAMUNGAS.MB=Type(06),AuxType(0200),Access(C3)
RESQ.RAIDERS.MB=Type(06),AuxType(0300),Access(C3)
SITCRIT.CHEAT=Type(06),AuxType(BC00),Access(C3)
SPIKES.CHEAT=Type(06),AuxType(0250),Access(C3)
WILLY.BYTE.MB=Type(06),AuxType(D000),Access(C3)

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2021-2022 by qkumba
;(c) 2024-2025 by qkumba
!cpu 6502
!to "build/PRELAUNCH.INDEXED/WILLY.BYTE",plain
@ -7,38 +7,22 @@
!source "src/macros.a"
+ENABLE_ACCEL
+READ_RAM2_WRITE_RAM2
jsr EnableAccelerator
+LOAD_FILE_AT willybyte_mb, $D000
+READ_ROM_NO_WRITE
ldx #(accel_e - accel)
- lda accel, x
sta callback1, x
dex
bpl -
lda #<callback1
sta $414A
lda #>callback1
sta $414B
lda #$60
sta $426B
jsr $4000 ; decompress
+GET_MOCKINGBOARD_SLOT
bcc no_mock
- ldy $76BF, x
cpy #$C4
bne +
sta $76BF, x
+ ldy $7842, x
cpy #$C4
bne +
sta $7842, x
+ ldy $9FCC, x
cpy #$C4
bne +
sta $9FCC, x
+ ldy $A0F6, x
cpy #$C4
bne +
sta $A0F6, x
+ inx
bne -
sta $9EB6
no_mock
lda #<callback1
sta $BD7C
lda #>callback1
sta $BD7D
lda #$20
sta $7852
lda #<callback2
@ -53,16 +37,8 @@ no_mock
stx $B6D9
inx
stx $B6DA ; reset vector
+DISABLE_ACCEL
jmp $6000
callback1
+ENABLE_ACCEL
jsr $BD80 ; decompress
+DISABLE_ACCEL
lda #0 ; set Z
rts
callback2
sbc $8A
cmp #8
@ -70,6 +46,21 @@ callback2
cmp #9
+ rts
accel !pseudopc $bf80 {
callback1
+READ_RAM2_NO_WRITE
jsr EnableAccelerator
jsr $D000
jsr DisableAccelerator
+READ_ROM_NO_WRITE
lda #0 ; set Z
rts
}
accel_e
willybyte_mb
+PSTRING "PRELAUNCH/WILLY.BYTE.MB"
!if * > $1C0 {
!error "code is too large, ends at ", *
}

View File

@ -0,0 +1,211 @@
;license:MIT
;(c) 2025 by qkumba
!cpu 6502
!to "build/PRELAUNCH/WILLY.BYTE.MB",plain
*=$D000
!source "src/constants.a" ; no code in these
!source "src/macros.a"
callback3
jsr $BD80 ; decompress
lda MockingboardStuff
bne is_mock
rts
is_mock
and #7
ora #$C0
ldx #0
ldy $BE96
cpy #$41
bne not_a04f
ldy $BE98
cpy #$34
bne skip_a04f
ldy $3
cpy #$60
bne skip_a04f
- ldy $76BF, x
cpy #$C4
bne +
sta $76BF, x
+ ldy $7842, x
cpy #$C4
bne +
sta $7842, x
+ ldy $9FCC, x
cpy #$C4
bne +
sta $9FCC, x
+ ldy $A0F6, x
cpy #$C4
bne +
sta $A0F6, x
+ inx
bne -
sta $9EB6
skip_a04f
rts
not_a04f
ldy $BE98
cpy #$30
bne not_ba06
ldy $3
cpy #$A0
bne skip_ba06_a
- ldy $A05E, x
cpy #$C4
bne +
sta $A05E, x
+ inx
bne -
rts
skip_ba06_a
cpy #$60
bne skip_ba06_b
- ldy $9228, x
cpy #$C4
bne +
sta $9228, x
+ inx
bne -
skip_ba06_b
rts
not_ba06
cpy #$32
bne not_b22f
- ldy $6909, x
cpy #$C4
bne +
sta $6909, x
+ inx
bne -
rts
not_b22f
cpy #$34
bne not_bx4y
ldy $be99
cpy #$41
ldy $3
bcc not_b04a
cpy #$60
bne skip_b04a
- ldy $7CFB, x
cpy #$C4
bne +
sta $7CFB, x
+ ldy $8EF6, x
cpy #$C4
bne +
sta $8EF6, x
+ ldy $92FB, x
cpy #$C4
bne +
sta $92FB, x
+ inx
bne -
skip_b04a
rts
not_b04a
cpy #$60
bne skip_b142
- ldy $705E, x
cpy #$C4
bne +
sta $705E, x
+ ldy $82E6, x
cpy #$C4
bne +
sta $82E6, x
+ inx
bne -
skip_b142
rts
not_bx4y
cpy #$39
bne not_b193
ldy $3
cpy #$60
bne skip_b193
- ldy $92A8, x
cpy #$C4
bne +
sta $92A8, x
+ inx
bne -
skip_b193
rts
not_b193
cpy #$43
bne not_bxcy
ldy $be99
cpy #$32
ldy $3
bcs not_b0c1
cpy #$60
bne skip_b0c1
- ldy $927B, x
cpy #$C4
bne +
sta $927B, x
+ inx
bne -
skip_b0c1
rts
not_b0c1
cpy #$60
bne skip_b0c6
- ldy $72EB, x
cpy #$C4
bne +
sta $72EB, x
+ ldy $832A, x
cpy #$C4
bne +
sta $832A, x
+ inx
bne -
skip_b0c6
rts
not_bxcy
cpy #$46
bne not_b1f4
ldy $3
cpy #$60
bne skip_b1f4
- ldy $78CB, x
cpy #$C4
bne +
sta $78CB, x
+ inx
bne -
sta $77B6
sta $79F5
sta $79F8
sta $79FB
skip_b1f4
not_b1f4
rts
!if * > $D1FF {
!error "code is too large, ends at ", *
}