IEC code size optimizations
This commit is contained in:
1 parent
f5eef54df6
commit
0cafc8defb
5 files changed
+34
-21
No files matched your search
@@ -1,4 +1,8 @@
|
|||||||
|
|
||||||
|
//
|
||||||
|
// Note: damages .X
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
#if CONFIG_IEC
|
#if CONFIG_IEC
|
||||||
|
|
||||||
@@ -14,8 +18,8 @@ iec_wait60us:
|
|||||||
|
|
||||||
// Waste cycles in a loop
|
// Waste cycles in a loop
|
||||||
|
|
||||||
ldy #$0A // 2 cycles
|
ldx #$0A // 2 cycles
|
||||||
!: dey // 2 cycles * 10
|
!: dex // 2 cycles * 10
|
||||||
bpl !- // 3 cycles * 9 + 2 cycles
|
bpl !- // 3 cycles * 9 + 2 cycles
|
||||||
rts // 6 cycles
|
rts // 6 cycles
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ load_iec:
|
|||||||
// Display start address
|
// Display start address
|
||||||
jsr lvs_display_loading_verifying
|
jsr lvs_display_loading_verifying
|
||||||
|
|
||||||
#if CONFIG_IEC_JIFFYDOS && !CONFIG_MEMORY_MODEL_60K
|
#if (CONFIG_IEC_JIFFYDOS || CONFIG_IEC_DOLPHINDOS) && !CONFIG_MEMORY_MODEL_60K
|
||||||
|
|
||||||
// If feasible, use JiffyDOS optimized LOAD loop
|
// If feasible, use JiffyDOS optimized LOAD loop
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
//
|
||||||
|
// Common routines for multiple IEC fact protocols
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#if (CONFIG_IEC_JIFFYDOS || CONFIG_IEC_DOLPHINDOS) && !CONFIG_MEMORY_MODEL_60K
|
||||||
|
|
||||||
|
|
||||||
|
iec_update_EAL_by_Y:
|
||||||
|
|
||||||
|
tya
|
||||||
|
sec
|
||||||
|
adc EAL+0
|
||||||
|
sta EAL+0
|
||||||
|
bcc !+
|
||||||
|
inc EAL+1
|
||||||
|
!:
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -39,10 +39,8 @@ load_dolphindos_loop:
|
|||||||
lda CIA2_PRA
|
lda CIA2_PRA
|
||||||
bpl !-
|
bpl !-
|
||||||
|
|
||||||
// Check if EOI - routine can damage .Y, so store it in safe place
|
// Check if EOI - routine can damage .X, but this is safe
|
||||||
sty TBTCNT
|
|
||||||
jsr iec_rx_check_eoi
|
jsr iec_rx_check_eoi
|
||||||
ldy TBTCNT
|
|
||||||
|
|
||||||
// Retrieve and store byte
|
// Retrieve and store byte
|
||||||
lda CIA2_PRB
|
lda CIA2_PRB
|
||||||
@@ -62,14 +60,8 @@ load_dolphindos_loop:
|
|||||||
|
|
||||||
load_dolphindos_end:
|
load_dolphindos_end:
|
||||||
|
|
||||||
// Update EAL - XXX deduplicate with JiffyDOS counterpart
|
// Update EAL
|
||||||
tya
|
jsr iec_update_EAL_by_Y
|
||||||
sec
|
|
||||||
adc EAL+0
|
|
||||||
sta EAL+0
|
|
||||||
bcc !+
|
|
||||||
inc EAL+1
|
|
||||||
!:
|
|
||||||
|
|
||||||
// End of load loop
|
// End of load loop
|
||||||
jmp load_iec_loop_end
|
jmp load_iec_loop_end
|
||||||
|
|||||||
@@ -132,13 +132,8 @@ load_jiffydos_end:
|
|||||||
tax
|
tax
|
||||||
|
|
||||||
// Update EAL
|
// Update EAL
|
||||||
tya
|
jsr iec_update_EAL_by_Y
|
||||||
sec
|
|
||||||
adc EAL+0
|
|
||||||
sta EAL+0
|
|
||||||
bcc !+
|
|
||||||
inc EAL+1
|
|
||||||
!:
|
|
||||||
// Indicate that no byte waits in output buffer
|
// Indicate that no byte waits in output buffer
|
||||||
lda #$00
|
lda #$00
|
||||||
sta C3PO
|
sta C3PO
|
||||||
|
|||||||
Reference in new issue
Block a user