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
|
||||
|
||||
@@ -14,8 +18,8 @@ iec_wait60us:
|
||||
|
||||
// Waste cycles in a loop
|
||||
|
||||
ldy #$0A // 2 cycles
|
||||
!: dey // 2 cycles * 10
|
||||
ldx #$0A // 2 cycles
|
||||
!: dex // 2 cycles * 10
|
||||
bpl !- // 3 cycles * 9 + 2 cycles
|
||||
rts // 6 cycles
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ load_iec:
|
||||
// Display start address
|
||||
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
|
||||
|
||||
|
||||
@@ -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
|
||||
bpl !-
|
||||
|
||||
// Check if EOI - routine can damage .Y, so store it in safe place
|
||||
sty TBTCNT
|
||||
// Check if EOI - routine can damage .X, but this is safe
|
||||
jsr iec_rx_check_eoi
|
||||
ldy TBTCNT
|
||||
|
||||
// Retrieve and store byte
|
||||
lda CIA2_PRB
|
||||
@@ -62,14 +60,8 @@ load_dolphindos_loop:
|
||||
|
||||
load_dolphindos_end:
|
||||
|
||||
// Update EAL - XXX deduplicate with JiffyDOS counterpart
|
||||
tya
|
||||
sec
|
||||
adc EAL+0
|
||||
sta EAL+0
|
||||
bcc !+
|
||||
inc EAL+1
|
||||
!:
|
||||
// Update EAL
|
||||
jsr iec_update_EAL_by_Y
|
||||
|
||||
// End of load loop
|
||||
jmp load_iec_loop_end
|
||||
|
||||
@@ -132,13 +132,8 @@ load_jiffydos_end:
|
||||
tax
|
||||
|
||||
// Update EAL
|
||||
tya
|
||||
sec
|
||||
adc EAL+0
|
||||
sta EAL+0
|
||||
bcc !+
|
||||
inc EAL+1
|
||||
!:
|
||||
jsr iec_update_EAL_by_Y
|
||||
|
||||
// Indicate that no byte waits in output buffer
|
||||
lda #$00
|
||||
sta C3PO
|
||||
|
||||
Reference in new issue
Block a user