mirror of
https://github.com/a2-4am/4cade.git
synced 2024-11-24 03:34:02 +00:00
Merge branch 'master' of https://github.com/a2-4am/4cade
This commit is contained in:
commit
c2e5fe8a92
BIN
res/proboothd
BIN
res/proboothd
Binary file not shown.
52
src/4cade.a
52
src/4cade.a
@ -56,20 +56,21 @@ Reenter
|
||||
ldx #$A4
|
||||
stx $3F4
|
||||
RestoreStackNextTime
|
||||
clc ; SMC
|
||||
bcc SearchMode ; not an unconditional branch because code
|
||||
; might change the 'clc' just before it
|
||||
bne SearchMode ; (SMC) not an unconditional branch because code
|
||||
; might change the branch target to the next opcode
|
||||
; If we fall through to here, it's because we backed up the stack and
|
||||
; stack pointer and wanted this routine to restore it and return to
|
||||
; caller.
|
||||
lda #$18 ; reset to 'clc' opcode so we don't try to
|
||||
sta RestoreStackNextTime ; restore the same stack twice
|
||||
lda #(SearchMode - RestoreStackNextTime) - 2
|
||||
; reset to branch so we don't try to
|
||||
sta RestoreStackNextTime + 1
|
||||
; restore the same stack twice
|
||||
ldx #$F1
|
||||
- lda $DF00,x ; restore stack
|
||||
- lda STACKBASE - $F0,x ; restore stack
|
||||
sta $100,x
|
||||
inx
|
||||
bne -
|
||||
ldx $DFF0 ; restore stack pointer
|
||||
ldx STACKBASE ; restore stack pointer
|
||||
txs
|
||||
SwitchToBank1
|
||||
+READ_RAM1_WRITE_RAM1
|
||||
@ -119,21 +120,52 @@ SwitchToBank2
|
||||
!word Reenter ; IRQ vector ($FFFE-F)
|
||||
}
|
||||
LastMover
|
||||
!pseudopc $D600 {
|
||||
!if ((hdddataend & 255) > $ec) and ((hdddataend & 255) < $f0) {
|
||||
; 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
|
||||
FONTSRC = *
|
||||
!pseudopc STACKBASE + 16 {
|
||||
FONTDST = *
|
||||
!source "src/ui.font.data.a"
|
||||
COPYDST = *
|
||||
COPYSRC = LastMover + COPYDST - FONTDST
|
||||
!source "src/ui.font.a"
|
||||
!source "src/prodos.impl.a"
|
||||
LCRAM2_END = *
|
||||
!if * > $DFEF {
|
||||
!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 = *
|
||||
!source "src/prodos.impl.a"
|
||||
!source "src/ui.font.a"
|
||||
STACKBASE = *
|
||||
LCRAM2_END = STACKBASE + 16
|
||||
FONTDST = (LCRAM2_END + 255) and -256
|
||||
}
|
||||
EvenLasterMover
|
||||
FONTSRC = *
|
||||
!pseudopc FONTDST {
|
||||
!source "src/ui.font.data.a"
|
||||
!if * > $E000 {
|
||||
!error "code is too large: ends at ", *
|
||||
}
|
||||
}
|
||||
}
|
||||
!if RELBASE = $2000 {
|
||||
!ifdef PASS2 {
|
||||
} else { ;PASS2
|
||||
!set PASS2=1
|
||||
!warn "LCRAM2 ends at ", LCRAM2_END
|
||||
!warn "ProRWTS ends at ", hddcodeend - 1
|
||||
!warn "STACK at ", STACKBASE
|
||||
!warn "LCRAM2 ends at ", LCRAM2_END - 1
|
||||
!warn "RELBASE = ", $10000 - (LastMover - FirstMover)
|
||||
}
|
||||
}
|
||||
|
@ -121,9 +121,20 @@ NotGS clc
|
||||
inc @FM+5
|
||||
bne @FM
|
||||
|
||||
+ ldy #>(255 + EvenLasterMover - LastMover)
|
||||
@LM lda LastMover,x ; relocate font data to $D600 in RAM bank 2
|
||||
sta $D600,x ; and pseudo-ProDOS to $DA00 in RAM bank 2
|
||||
ldy #4
|
||||
@ELM lda FONTSRC,x
|
||||
; relocate font data to RAM bank 2
|
||||
sta FONTDST,x
|
||||
inx
|
||||
bne @ELM
|
||||
inc @ELM+2
|
||||
inc @ELM+5
|
||||
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
|
||||
|
@ -9,16 +9,16 @@
|
||||
; D000..E5F4 - persistent data structures (per-game cheat categories,
|
||||
; gGlobalPrefsStore, gGamesListStore)
|
||||
; ...unused...
|
||||
; EC9F..FFF9 - main program code
|
||||
; ECA0..FFF9 - main program code
|
||||
; FFFA..FFFF - NMI, reset, IRQ vectors
|
||||
;
|
||||
; LC RAM BANK 2
|
||||
; D000..D3FF - ProRWTS data
|
||||
; D400..D5FF - ProRWTS code
|
||||
; D600..D9FF - HGR font data
|
||||
; DA00..DF5D - HGR font code & ProRWTS glue code
|
||||
; D400..D5F7 - ProRWTS code
|
||||
; D5F8..DB52 - HGR font code & ProRWTS glue code
|
||||
; DB53..DB62 - backup of stack (during gameplay and self-running demos)
|
||||
; ...unused...
|
||||
; DFF0..DFFF - backup of stack (during gameplay and self-running demos)
|
||||
; DC00..DFFF - HGR font data
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
; soft switches
|
||||
|
@ -117,7 +117,8 @@ seekread stx bloklo
|
||||
sty blokhi
|
||||
entry jmp $d1d1
|
||||
|
||||
fakeMLI pla
|
||||
fakeMLI beq readblk
|
||||
retcall pla
|
||||
tax
|
||||
inx
|
||||
inx
|
||||
@ -125,6 +126,12 @@ fakeMLI pla
|
||||
txa
|
||||
pha
|
||||
rts
|
||||
readblk dey
|
||||
dey
|
||||
sty adrhi
|
||||
tay
|
||||
jsr seekread
|
||||
bcc retcall
|
||||
fakeMLI_e
|
||||
|
||||
filename !byte filename_e - filename_b
|
||||
|
@ -635,13 +635,13 @@ LaunchInternal
|
||||
jsr SaveOrRestoreScreenHoles ; save screen hole contents
|
||||
ldy #$F1
|
||||
- lda $100,y
|
||||
sta $DF00,y ; back up stack
|
||||
sta STACKBASE - $F0,y ; back up stack
|
||||
iny
|
||||
bne -
|
||||
tsx ; back up stack pointer
|
||||
stx $DFF0
|
||||
lda #$38 ; 'sec' opcode to tell |Reenter| to
|
||||
sta RestoreStackNextTime ; restore the stack and stack pointer
|
||||
stx STACKBASE
|
||||
sty RestoreStackNextTime + 1
|
||||
; tell |Reenter| to restore the stack and stack pointer
|
||||
|
||||
ldx #(end_promote-promote-1)
|
||||
- lda promote,x ; copy ProDOS shim to main memory
|
||||
|
107
src/prorwts2.a
107
src/prorwts2.a
@ -16,7 +16,7 @@ ver_02 = 1
|
||||
verbose_info = 0 ;set to 1 to enable display of memory usage
|
||||
enable_floppy = 0 ;set to 1 to enable floppy drive support
|
||||
poll_drive = 0 ;set to 1 to check if disk is in drive, recommended if allow_multi is enabled
|
||||
allow_extend = 1 ;enable support for more than two MicroDrive (or more than four CFFA) partitions
|
||||
use_smartport = 1 ;set to 1 to enable support for more than two MicroDrive (or more than four CFFA) partitions
|
||||
override_adr = 1 ;set to 1 to require an explicit load address
|
||||
aligned_read = 0 ;set to 1 if all reads can be a multiple of block size
|
||||
enable_readseq=0 ;set to 1 to enable reading multiple sequential times from the same file without seek
|
||||
@ -207,7 +207,9 @@ init jsr SETKBD
|
||||
jsr SETVID
|
||||
lda DEVNUM
|
||||
sta x80_parms + 1
|
||||
!if use_smartport = 0 {
|
||||
sta unrunit1 + 1
|
||||
} ;use_smartport
|
||||
and #$70
|
||||
!if (enable_floppy + enable_write) > 1 {
|
||||
sta unrslot1 + 1
|
||||
@ -380,16 +382,37 @@ adjpath tya
|
||||
lsr
|
||||
tay
|
||||
ldx DEVADR01HI, y
|
||||
!if (enable_floppy + allow_extend) > 0 {
|
||||
cpx #$c8
|
||||
bcc set_slot
|
||||
!if enable_floppy = 1 {
|
||||
php
|
||||
|
||||
;check if current device is floppy
|
||||
|
||||
lsr
|
||||
ora #$c0
|
||||
tax
|
||||
plp
|
||||
} else { ;enable_floppy = 0
|
||||
stx blokhi
|
||||
ldy #0
|
||||
sty bloklo
|
||||
iny
|
||||
lda (bloklo), y
|
||||
cmp #$20
|
||||
bne not_floppy
|
||||
iny
|
||||
iny
|
||||
lda (bloklo), y
|
||||
bne not_floppy
|
||||
iny
|
||||
iny
|
||||
lda (bloklo), y
|
||||
cmp #3
|
||||
bne not_floppy
|
||||
ldy #$ff
|
||||
lda (bloklo), y
|
||||
beq set_slot
|
||||
|
||||
not_floppy
|
||||
} ;enable_floppy
|
||||
|
||||
;find SmartPort device for basic MicroDrive support
|
||||
|
||||
@ -414,25 +437,22 @@ adjpath tya
|
||||
ldy #$ff
|
||||
lda (bloklo), y
|
||||
beq -
|
||||
} ;enable_floppy
|
||||
} ;enable_floppy or allow_extend
|
||||
|
||||
set_slot stx slot + 2
|
||||
!if allow_extend = 1 {
|
||||
stx unrentry1 + 2
|
||||
} ;allow_extend
|
||||
!if use_smartport = 0 {
|
||||
stx unrentry2 + 2
|
||||
!if allow_extend = 1 {
|
||||
} else { ;use_smartport = 1
|
||||
stx unrentry1 + 2
|
||||
stx unrentry3 + 2
|
||||
} ;allow_extend
|
||||
} ;use_smartport
|
||||
slot ldx $cfff
|
||||
!if enable_floppy = 1 {
|
||||
php
|
||||
beq bankram
|
||||
} ;enable_floppy
|
||||
!if use_smartport = 0 {
|
||||
stx unrentry2 + 1
|
||||
!if allow_extend = 1 {
|
||||
bcc bankram
|
||||
} else { ;use_smartport = 1
|
||||
|
||||
;use SmartPort entrypoint instead
|
||||
|
||||
@ -442,8 +462,6 @@ slot ldx $cfff
|
||||
stx unrentry1 + 1
|
||||
stx unrentry3 + 1
|
||||
|
||||
;detect extended remapping and update unit accordingly
|
||||
|
||||
lda #<(readbuff + $200)
|
||||
sta adrlo
|
||||
ldy #>(readbuff + $200)
|
||||
@ -451,30 +469,24 @@ slot ldx $cfff
|
||||
stx x80_parms + 4
|
||||
lda #0
|
||||
sta x80_parms + 5
|
||||
jsr unrhddrd
|
||||
jsr MLI
|
||||
!byte $80
|
||||
!word x80_parms
|
||||
bcc + ;always
|
||||
|
||||
iterunit inc unrunit2
|
||||
|
||||
;enable use of SmartPort entrypoint
|
||||
|
||||
lda #$2c
|
||||
sta unrentry2
|
||||
|
||||
unrentry1 jsr $d1d1
|
||||
!byte cmdread
|
||||
!word unrpacket
|
||||
bcs iterunit
|
||||
|
||||
+ ldy #$0f
|
||||
ldy #$0f
|
||||
- lda readbuff + 4, y
|
||||
cmp readbuff + $204, y
|
||||
bne iterunit
|
||||
dey
|
||||
bpl -
|
||||
} ;allow_extend
|
||||
} ;use_smartport
|
||||
|
||||
bankram
|
||||
!if load_banked = 1 {
|
||||
@ -2608,7 +2620,11 @@ skiptree
|
||||
beq +
|
||||
} ;enable_seek
|
||||
!if enable_write = 1 {
|
||||
!if use_smartport = 0 {
|
||||
stx command
|
||||
} else { ;use_smartport = 1
|
||||
stx pcommand
|
||||
} ;use_smartport
|
||||
} ;enable_write
|
||||
} ;aligned_read
|
||||
} else { ;rwts_mode = 1
|
||||
@ -2813,34 +2829,43 @@ hddreaddirsect ldy #>hdddirbuf
|
||||
ldy #>hdddirbuf
|
||||
hddreaddirsect
|
||||
} ;allow_trees
|
||||
unrhddrd = unrelochdd + (* - reloc)
|
||||
sty adrhi
|
||||
hddseekrd ldy #cmdread
|
||||
!if (aligned_read + enable_write) > 1 {
|
||||
hddseekrdwr sty command
|
||||
} else { ;aligned_read = 0 or enable_write = 0
|
||||
hddseekrdwr
|
||||
!if use_smartport = 0 {
|
||||
sty command
|
||||
} else { ;use_smartport = 1
|
||||
sty pcommand
|
||||
} ;use_smartport
|
||||
} else { ;aligned_read = 0 or enable_write = 0
|
||||
!if use_smartport = 0 {
|
||||
sty command
|
||||
} else { ;use_smartport = 1
|
||||
sty pcommand
|
||||
} ;use_smartport
|
||||
hddseekrdwr
|
||||
} ;aligned_read and enable_write
|
||||
|
||||
!if use_smartport = 0 {
|
||||
stx bloklo
|
||||
sta blokhi
|
||||
} else { ;use_smartport = 1
|
||||
stx pblock
|
||||
sta pblock + 1
|
||||
} ;use_smartport
|
||||
|
||||
!if use_smartport = 0 {
|
||||
unrunit1 = unrelochdd + (* - reloc)
|
||||
lda #$d1
|
||||
sta unit
|
||||
unrentry2 = unrelochdd + (* - reloc)
|
||||
jmp $d1d1
|
||||
|
||||
!if allow_extend = 1 {
|
||||
ldx #4
|
||||
- lda command + 1, x
|
||||
sta packet + 1, x
|
||||
dex
|
||||
bne -
|
||||
lda command
|
||||
sta pcommand
|
||||
|
||||
} else { ;use_smartport = 1
|
||||
lda adrhi
|
||||
sta paddr + 1
|
||||
lda adrlo
|
||||
sta paddr
|
||||
unrentry3 = unrelochdd + (* - reloc)
|
||||
jsr $d1d1
|
||||
pcommand !byte 0
|
||||
@ -2851,9 +2876,9 @@ unrpacket = unrelochdd + (* - reloc)
|
||||
packet !byte 3
|
||||
unrunit2 = unrelochdd + (* - reloc)
|
||||
!byte 0
|
||||
!word readbuff + $200
|
||||
!byte 2, 0, 0
|
||||
} ;allow_extend
|
||||
paddr !word readbuff + $200
|
||||
pblock !byte 2, 0, 0
|
||||
} ;use_smartport
|
||||
|
||||
!if rwts_mode = 1 {
|
||||
vollist_b
|
||||
|
Loading…
Reference in New Issue
Block a user