HDD: Fixed SmartPort return address wrong when crossing page + some space-saving optimisations (Fixes #319)

This commit is contained in:
tomcw 2019-10-05 17:01:35 +01:00
parent 31b78aa09a
commit 94926b4f55
3 changed files with 12 additions and 21 deletions

Binary file not shown.

View File

@ -34,6 +34,7 @@
; . GH#370 (Robert Hoem, 27 Oct 2016):
; . Added a check against open-apple during boot to route boot to slot 6
; . This happens after the first two blocks are loaded from the HD.
; . GH#319: smartport return address wrong when crossing page
; TODO:
; . Make code relocatable (so HDD controller card can go into any slot)
; . Remove support for Entrypoint_C746 (old AppleWin) & Entrypoint_C761 (Apple Oasis)
@ -108,14 +109,7 @@ Bootstrap
; error capturing code. Applewin is picky
; about code assigning data to registers and
; memory. The safest method is via I/O port
pha
lda hd_error
clc
cmp #1
bne noerr0
sec
noerr0
pla
ror hd_error ; Post: C=0 or 1
bcc hdboot
; no image ready, boot diskette image instead
@ -129,12 +123,14 @@ BootSlot6
SmartPort
pla
sta $46
adc #3 ; Pre: C=0, Post: C=0 or 1
tay
pla
sta $47 ; ($47) = &cmd_hdr
sta $47 ; ($46) = &cmd_hdr
adc #0
pha
lda $46
adc #3 ; Pre: C=0, Post: assume C=0
pha ; (sp).w += 3
tya
pha ; (sp).w += 3
ldy #1
lda ($46),y ; cmd
@ -143,7 +139,7 @@ SmartPort
bne SmartPort2
;======================================
; 2 unused bytes
; 8 unused bytes
*= $c746 ; org $c746
@ -237,12 +233,7 @@ cmdproc
bne skipSread
jsr sread
skipSread
lda hd_error
clc
cmp #1
bne noerr2
sec
noerr2
ror hd_error ; Post: C=0 or 1
pla
rts
@ -253,7 +244,7 @@ noerr2
; the emulated code increments the buffer by 1 on each read) to (memblock),y
; increment memblock+1 and read the second 256 bytes via hd_nextbyte.
;
; if I could figure out how to consistantly get applewin to update it's memory regions all
; if I could figure out how to consistently get applewin to update it's memory regions all
; this code can be moved into the emulation code (although, this is how I'd build the hardware
; anyway...)
@ -299,7 +290,7 @@ SmartPort3
bne cmdproc
;======================================
; 12 unused bytes
; 18 unused bytes
!zone data

Binary file not shown.