- Find empty space at the end of block $0000 and patch the initial loader to derive slot number and store it in smartport entry areas
0801 - 4C E0 09 - JMP $09E0
09E0 - 8A - TXA
09E1 - 29 70 - AND #$70
09E3 - 4A - LSR
09E4 - 4A - LSR
09E5 - 4A - LSR
09E6 - 4A - LSR
09E7 - 09 C0 - ORA #$C0
09E9 - 8D FB 08 - STA $08FB
09EC - 8D 08 09 - STA $0908
09EF - 78 - SEI
09F0 - 38 - SEC
09F1 - FB - XCE
09F2 - 4C 04 08 - JMP $0804
Used Block Warden to set these bytes directly on block $0000
- Patch block $0001 patch loader to also be slot-independent
0BD8 - AD FB 08 - LDA $08FB
0BDB - 8D E0 0B - STA $0BE0
0BDE - 20 0D C5 - JSR $Cx0D
0BE1 - 01 E7 0B
0BE4 - 4C 00 90 - JMP $9000
0BE7 - 03 01 00 90 00 06 00
Used Block Warden to set these bytes directly on block $0001
- Update the $9000 patcher/loader to work slightly differently:
org $9000
clc
xce
rep #$30
ldx #$0000
relo lda patch,x
sta $9C6F,x
inx
inx
cpx #pend-patch2
bcc relo
* TEST area to insert other stuff
nop
nop
nop
nop
nop
nop
nop
nop
* TEST end
jmp $9478
patch = *
* new regular smartport loader to replace Load_Segment
org $9C6F
patch2
pha
sec
xce
sep #$30
lda $08FB
sta entry+2 ; slot independence
stz blksdone
lda #$41
sta $C029
lda #$F0
sta $C022
clc
xce
rep #$30
pla
sta $00
lda ($00)
sta blknum
]loadlp inc $00
inc $00
lda ($00)
sta buffer
inc $00
inc $00
lda ($00)
sta buffer+2
inc $00
inc $00
lda ($00)
beq ret
lsr
tay
inc $00
inc $00
]blklp phy
sec
xce
sep #$30
* back by popular demand, make things happen while loading
lda blksdone
bmi entry
inc blksdone
lda blksdone
cmp #$3a
bne entry
clc
xce
rep #$30
cli
jsr $9d8c ; upload sound to DOC
jsr $a040 ; play sound
sec
xce
sep #$30
lda #$FF
sta blksdone
entry jsr $C50D
db $41
adrl params
bcc ]cont
cmp #$2e
beq entry
]cont clc
xce
rep #$30
inc buffer+1
inc buffer+1
inc blknum
ply
dey
cpy #$00
bne ]blklp
jmp ]loadlp
ret rts
params db $03
db $01
buffer adrl $0
blknum adrl $0
blksdone dw $00
pend = *
The only real bear I ran into here is that the first extended-smartport call to the CFFA3K will return with carry set and A=$2E, which means 'try again'. It took me about an hour to figure out why the first block at $1000 was not loading on non-emulated hardware and correct for that. Also note I got rid of the nifty running display of blocks being read because those monitor firmware routines just slow us down. The resulting experience is exactly authentic.
[note: not exactly authentic, missing a SHR title screen at load time. blast. does this mean there will be a Modulae Part 3 entry now?]
Used Block Warden to Follow the assembled Merlin output, then Change to slot5 drive1, then Write it to block $0600 of the Modulae disk.
Tested and works fine on CFFA3000 / ROM03