add Bejeweled to the collection, make TR compatible

This commit is contained in:
Peter Ferrie 2020-01-28 11:19:10 -08:00
parent 4d66f48cfd
commit cd73cff13d
8 changed files with 128 additions and 83 deletions

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -145,49 +145,27 @@ SwitchToBank2
!word Ignore ; IRQ vector ($FFFE-F)
}
LastMover
!if ((hdddataend & 255) > $ec) and ((hdddataend & 255) < $f2) {
; in the unlikely event that a bit over 16 bytes are left in the page
; then use it for the stack
STACKBASE = ((hdddataend + 15) and -16) + 1
FONTSRC = *
!pseudopc STACKBASE + 15 {
FONTDST = *
!source "src/ui.font.data.lc2.a"
COPYDST = *
COPYSRC = LastMover + COPYDST - FONTDST
!source "src/ui.font.lc2.a"
!source "src/prodos.impl.lc2.a"
!source "src/glue.prorwts2.lc2.a"
!source "src/glue.launch.lc2.a"
!source "src/hw.accel.lc2.a"
LCRAM2_END = *
!if * > $E000 {
!error "code is too large: ends at ", *
}
}
EvenLasterMover
} else {
; otherwise place stack after code
; and begin font on the next page
COPYSRC = *
!pseudopc hdddataend {
COPYDST = *
COPYSRC = *
!pseudopc hdddataend {
COPYDST = *
!source "src/prodos.impl.lc2.a"
!source "src/ui.font.lc2.a"
!source "src/glue.prorwts2.lc2.a"
!source "src/glue.launch.lc2.a"
!source "src/hw.accel.lc2.a"
STACKBASE = *
LCRAM2_END = STACKBASE + 15
FONTDST = (LCRAM2_END + 255) and -256
STACKBASE = *
LCRAM2_END = STACKBASE + 15
!if LCRAM2_END > DisableAccelerator {
!error "code is too large: ends at ", LCRAM2_END
}
FONTDST = (LCRAM2_END + 255) and -256
}
EvenLasterMover
FONTSRC = *
!pseudopc FONTDST {
!pseudopc FONTDST {
!source "src/ui.font.data.lc2.a"
!if * > $E000 {
!if * > $E000 {
!error "code is too large: ends at ", *
}
}
}
!if RELBASE = $2000 {

View File

@ -134,6 +134,16 @@
inc @FM+5
bne @FM
ldy #>(255 + EvenLasterMover - LastMover)
@LM lda COPYSRC,x ; relocate pseudo-ProDOS to RAM bank 2
sta COPYDST,x
inx
bne @LM
inc @LM+2
inc @LM+5
dey
bne @LM
ldy #4
@ELM lda FONTSRC,x
; relocate font data to RAM bank 2
@ -145,16 +155,6 @@
dey
bne @ELM
ldy #>(255 + EvenLasterMover - LastMover)
@LM lda COPYSRC,x ; relocate pseudo-ProDOS to RAM bank 2
sta COPYDST,x
inx
bne @LM
inc @LM+2
inc @LM+5
dey
bne @LM
+READ_ROM_NO_WRITE
jsr BuildAcceleratorFunction
+READ_RAM2_WRITE_RAM2

View File

@ -9,14 +9,14 @@
; D000..E635 - persistent data structures (per-game cheat categories,
; gGlobalPrefsStore, gGamesListStore)
; ...unused...
; ECBB..FFF9 - main program code
; ECA6..FFF9 - main program code
; FFFA..FFFF - NMI, reset, IRQ vectors
;
; LC RAM BANK 2
; D000..D3FF - ProRWTS data
; D400..D66F - ProRWTS code
; D670..DB6C - HGR font code & ProRWTS glue code
; DB6D..DB7B - backup of stack (during gameplay and self-running demos)
; D670..DB98 - HGR font code & ProRWTS glue code
; DB99..DBA7 - backup of stack (during gameplay and self-running demos)
; ...unused...
; DBAF..DBFF - (de)acceleration function
; DC00..DFFF - HGR font data

24
src/prelaunch/bejeweled.a Normal file
View File

@ -0,0 +1,24 @@
;license:MIT
;(c) 2020 by qkumba
!cpu 6502
!to "build/PRELAUNCH/BEJEWELED",plain
*=$106
!source "src/prelaunch/common.a"
+ENABLE_ACCEL
lda #<callback
sta $4451
lda #>callback
sta $4452
jmp $800 ; decompress
callback
jsr $BE00
+DISABLE_ACCEL
rts
!if * > $1C0 {
!error "code is too large, ends at ", *
}

View File

@ -43,16 +43,22 @@ ProDOS_enter
pha
@request
lda #$d1
cmp #$40
beq @imp_allocint ;;@do_allocint
cmp #$41
beq @do_deallocint
cmp #$80
beq @do_readblock
beq @imp_rdwrblock ;;@do_readblock
cmp #$81
beq @do_writeblock
beq @imp_rdwrblock ;;@do_writeblock
cmp #$c0
beq @do_create
cmp #$c4
beq @do_getattrib
beq @imp_getattrib ;;@do_getattrib
cmp #$c6
beq @do_nothing
beq @do_setprefix
cmp #$c7
beq @do_prefix
beq @do_getprefix
cmp #$c8
beq @do_open
cmp #$ca
@ -63,19 +69,21 @@ ProDOS_enter
beq @do_close
cmp #$ce
beq @do_seek
cmp #$d1
cmp #$d0
beq @do_seteof
;; cmp #$d1
;; bne @do_fatal
@do_eof
jmp @imp_eof
@do_geteof
jmp @imp_geteof
@do_allocint
;; jmp @imp_allocint
@do_readblock
@do_writeblock
jmp @imp_rdwrblock
;; jmp @imp_rdwrblock
@do_getattrib
jmp @imp_getattrib
@do_nothing
jmp @restore_zp
@do_prefix
jmp @imp_prefix
;; jmp @imp_getattrib
@do_getprefix
jmp @imp_getprefix
@do_open
jmp @imp_open
@do_read
@ -84,12 +92,31 @@ ProDOS_enter
jmp @imp_write
@do_close
jsr @imp_close ;subroutine special case because of dual-use
@do_deallocint ;nothing for now
@do_create ;nothing for now
@do_setprefix ;nothing for now
@do_seteof ;nothing for now
jmp @restore_zp
@do_seek
jmp @imp_seek
@do_fatal
;; jmp ProDOS_fatal
@imp_allocint
ldy #2
lda (ipacket), y
sta ProDOS_irq + 1
iny
lda (ipacket), y
sta ProDOS_irq + 2
lda #<ProDOS_int
ldx #>ProDOS_int
sta $3fe
sta $fffe
stx $3ff
stx $ffff
bne @jmp_zp2 ;always
@imp_rdwrblock
and #$7f
tay
@ -143,7 +170,7 @@ ProDOS_enter
@jmp_zp2
jmp @restore_zp
@imp_prefix
@imp_getprefix
ldx #buffer
jsr @setbuffer1
ldy ProDOS_prefix
@ -259,7 +286,7 @@ ProDOS_enter
@jmp_zp
jmp @restore_zp
@imp_eof
@imp_geteof
ldy #2
lda bleftlo
sta (ipacket), y
@ -513,6 +540,28 @@ ProDOS_savedY
ProDOS_unit
!byte $d1
ProDOS_int
pha
txa
pha
tya
pha
ProDOS_irq
jsr $d1d1 ;SMC
pla
tay
pla
tax
pla
bit $c012
bmi +
lda $45
+ rti
!if * > $bf58 {
!error "code is too large, ends at ", *
}
ProDOS_fatal ;only for debugging, will be removed
;; bit $c081
;; pha

View File

@ -38,14 +38,13 @@ DrawPageInternal
beq @doneParsingLine
ldx #3
- cmp @subs_a,x
beq @makesub
dex
bpl -
bmi +
@makesub
bne @nosub
lda @subs_b,x
sta (PTR),y
+ iny
@nosub
dex
bpl -
iny
bne @parseLine
@doneParsingLine
sty SAVE
@ -99,17 +98,15 @@ DrawCenteredStringInternal
; clobbers PTR/PTR+1
+STAY PTR
php
ldy #0
lda (PTR),y
sta HTAB
php
lda #40
sec
sbc HTAB
sbc (PTR),y
lsr
sta HTAB
plp
jmp +
beq +
DrawStringInternal
; A/Y contains address of length-prefixed string
@ -145,12 +142,7 @@ DrawBufferInternal
; VTAB is NOT incremented
; clobbers A/X/Y
+STAY @src+1
bcs +
lda #$00
+HIDE_NEXT_2_BYTES
+
lda #$60
sta @pagemask
php
dex
lda VTAB
asl
@ -174,10 +166,12 @@ DrawBufferInternal
adc #$10
asl @hgrlo+1
rol
@pagemask=*+1
eor #$FD ; SMC (0=hi-res page 1, #$60=hi-res page 2)
sta @row0+2
plp
bcc +
eor #$60
clc
+
sta @row0+2
adc #$04
sta @row1+2
adc #$04