mirror of
https://github.com/mgcaret/rom4x.git
synced 2025-01-02 12:30:18 +00:00
Fix ramdisk recovery to happen whether or not ca was pressed.
Optimize some wee hours/YOLO code into something sensible. Ensure that ram card slot rom space is twiddled so the registers are active.
This commit is contained in:
parent
a0dbf3b85e
commit
64fe87caed
@ -98,11 +98,11 @@ msg3 .db $05,$b0,"SURE? ",$00
|
|||||||
.dsb boot4x - *, 0
|
.dsb boot4x - *, 0
|
||||||
* = boot4x
|
* = boot4x
|
||||||
jsr gobanner ; "Apple //c"
|
jsr gobanner ; "Apple //c"
|
||||||
|
jsr rdrecov ; try to recover ramdisk
|
||||||
lda power2 + rx_mslot ; get action saved by reset4x
|
lda power2 + rx_mslot ; get action saved by reset4x
|
||||||
beq boot4 ; if zero, continue boot
|
beq boot4 ; if zero, continue boot
|
||||||
ldx #(msg2-msg1) ; short banner offset
|
ldx #(msg2-msg1) ; short banner offset
|
||||||
jsr disp ; display it
|
jsr disp ; display it
|
||||||
jsr rdrecov ; try to recover ramdisk
|
|
||||||
lda power2 + rx_mslot ; boot selection
|
lda power2 + rx_mslot ; boot selection
|
||||||
btc2 cmp #$02 ; clear ramcard
|
btc2 cmp #$02 ; clear ramcard
|
||||||
bne btc3
|
bne btc3
|
||||||
@ -153,39 +153,32 @@ bootsl ldx #$00 ; low byte of slot
|
|||||||
bootadr stx $0 ; store address
|
bootadr stx $0 ; store address
|
||||||
sta $1 ; return to bank 0 does jmp (0)
|
sta $1 ; return to bank 0 does jmp (0)
|
||||||
endbt4x jmp gobt4x ; continue boot
|
endbt4x jmp gobt4x ; continue boot
|
||||||
rdrecov ldy #rx_mslot ; attempt to recover ramdisk
|
rdrecov jsr rdinit ; init ramcard
|
||||||
ldx #rx_devno
|
|
||||||
lda pwrup,y ; get power up flag
|
lda pwrup,y ; get power up flag
|
||||||
cmp #pwrbyte ; already initialized?
|
cmp #pwrbyte ; already initialized?
|
||||||
bne checkrd ; continue if not initialized
|
beq recovdn ; exit if initialized
|
||||||
rts ; exit if initialized
|
jsr testsize ; does not wreck x or y
|
||||||
checkrd jsr testsize ; does not wreck x or y
|
|
||||||
lda numbanks,y ; get discovered # banks
|
lda numbanks,y ; get discovered # banks
|
||||||
bne ckrd1 ; continue if size > 0
|
beq recovdn ; no mem
|
||||||
rts ; exit if no mem
|
stz addrl,x ; set slinky address 0
|
||||||
ckrd1 stz addrl,x ; set slinky address 0
|
|
||||||
stz addrm,x
|
stz addrm,x
|
||||||
stz addrh,x
|
stz addrh,x
|
||||||
lda data,x ; start compare to ProDOS boot block
|
lda data,x ; start compare to ProDOS boot block
|
||||||
cmp #$01
|
cmp #$01
|
||||||
beq ckrd2
|
bne recovdn ; not ProDOS
|
||||||
rts ; not ProDOS
|
lda data,x
|
||||||
ckrd2 lda data,x
|
|
||||||
cmp #$38
|
cmp #$38
|
||||||
beq ckrd3
|
bne recovdn ; not ProDOS
|
||||||
rts ; not ProDOS
|
lda data,x
|
||||||
ckrd3 lda data,x
|
|
||||||
cmp #$b0
|
cmp #$b0
|
||||||
beq dorecov
|
bne recovdn ; not ProDOS
|
||||||
rts ; not ProDOS
|
lda #pwrbyte
|
||||||
dorecov lda #pwrbyte
|
|
||||||
sta pwrup,y ; set power byte
|
sta pwrup,y ; set power byte
|
||||||
lda "R" ; tell user
|
lda "R" ; tell user
|
||||||
sta $7d0 ; on screen
|
sta $7d0 ; on screen
|
||||||
rts
|
recovdn rts
|
||||||
; zero ram card space
|
; zero ram card space
|
||||||
rdclear ldy #rx_mslot
|
rdclear jsr rdinit ; init ramcard
|
||||||
ldx #rx_devno
|
|
||||||
jsr testsize ; get size
|
jsr testsize ; get size
|
||||||
lda #$c0 ; 'A' - 1
|
lda #$c0 ; 'A' - 1
|
||||||
sta $400 ; upper left corner
|
sta $400 ; upper left corner
|
||||||
@ -217,6 +210,10 @@ clrdone ldy #rx_mslot
|
|||||||
lda #$a0 ; ' '
|
lda #$a0 ; ' '
|
||||||
sta $400 ; clear progress
|
sta $400 ; clear progress
|
||||||
rts
|
rts
|
||||||
|
rdinit bit rx_mslot *$100 ; activate registers
|
||||||
|
ldy #rx_mslot ; slot offset
|
||||||
|
ldx #rx_devno ; register offset
|
||||||
|
rts
|
||||||
; next is snippet of code to boot external 5.25
|
; next is snippet of code to boot external 5.25
|
||||||
bootext sei
|
bootext sei
|
||||||
lda #$e0
|
lda #$e0
|
||||||
|
Loading…
Reference in New Issue
Block a user