one more IEC size optimization, 37 bytes saved

This commit is contained in:
FeralChild64 committed 2019-10-29 17:10:00 +01:00
1 parent e9140607bc
commit 9f4c399158
17 files changed
+85 -154

No files matched your search

@@ -1,22 +0,0 @@
#if CONFIG_IEC
iec_pull_atn_clk_release_data:
// Pulled CLK = DATA considered invalid; for extra robustness on non-emulated
// hardware give some lines few more cycles to stabilize; see page 10 of
// http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf
lda CIA2_PRA
ora #BIT_CIA2_PRA_ATN_OUT // pull
sta CIA2_PRA
ora #BIT_CIA2_PRA_CLK_OUT // pull
sta CIA2_PRA
and #$FF - BIT_CIA2_PRA_DAT_OUT // release
sta CIA2_PRA
rts
#endif // CONFIG_IEC
@@ -1,19 +0,0 @@
#if CONFIG_IEC
iec_pull_clk_release_data:
// Pulled CLK = DATA considered invalid; for extra robustness on non-emulated
// hardware give some lines few more cycles to stabilize; see page 10 of
// http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf
lda CIA2_PRA
ora #BIT_CIA2_PRA_CLK_OUT // pull
sta CIA2_PRA
and #$FF - BIT_CIA2_PRA_DAT_OUT // release
sta CIA2_PRA
rts
#endif // CONFIG_IEC
@@ -1,15 +0,0 @@
#if CONFIG_IEC
iec_pull_clk_release_data_oneshot:
lda CIA2_PRA
ora #BIT_CIA2_PRA_CLK_OUT // pull
and #$FF - BIT_CIA2_PRA_DAT_OUT // release
sta CIA2_PRA
rts
#endif // CONFIG_IEC
@@ -1,22 +0,0 @@
#if CONFIG_IEC
iec_pull_data_release_atn_clk:
// Released CLK = DATA considered valid; for extra robustness on non-emulated
// hardware give some lines few more cycles to stabilize; see page 10 of
// http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf
lda CIA2_PRA
ora #BIT_CIA2_PRA_DAT_OUT // pull
sta CIA2_PRA
and #$FF - BIT_CIA2_PRA_CLK_OUT // release
sta CIA2_PRA
and #$FF - BIT_CIA2_PRA_ATN_OUT // release
sta CIA2_PRA
rts
#endif // CONFIG_IEC
+85
View File
@@ -0,0 +1,85 @@
//
// Helper IEC routines to pull/release certain lines
//
// Order of operation is set for extra robustness, on non-emulated hardware
// lines might need few cycles to stabilize (released CLK = DATA considered valid),
// see page 10 of http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf
//
#if CONFIG_IEC
iec_pull_atn_clk_release_data:
lda CIA2_PRA
ora #BIT_CIA2_PRA_ATN_OUT // pull
sta CIA2_PRA
// FALLTROUGH
iec_pull_clk_release_data:
lda CIA2_PRA
ora #BIT_CIA2_PRA_CLK_OUT // pull
sta CIA2_PRA
!:
and #$FF - BIT_CIA2_PRA_DAT_OUT // release
bne iec_pull_release_end // branch always
iec_pull_clk_release_data_oneshot:
lda CIA2_PRA
ora #BIT_CIA2_PRA_CLK_OUT // pull
bne !- // branch always
iec_release_atn_clk_data:
lda CIA2_PRA
and #$FF - BIT_CIA2_PRA_ATN_OUT // release
sta CIA2_PRA
// FALLTROUGH
iec_release_clk_data:
lda CIA2_PRA
and #$FF - BIT_CIA2_PRA_DAT_OUT // release
sta CIA2_PRA
and #$FF - BIT_CIA2_PRA_CLK_OUT // release
jmp iec_pull_release_end
iec_release_clk_pull_data:
lda CIA2_PRA
ora #BIT_CIA2_PRA_DAT_OUT // pull
sta CIA2_PRA
and #$FF - BIT_CIA2_PRA_CLK_OUT // release
bne iec_pull_release_end // branch always
iec_pull_data_release_atn_clk:
lda CIA2_PRA
ora #BIT_CIA2_PRA_DAT_OUT // pull
sta CIA2_PRA
and #$FF - BIT_CIA2_PRA_CLK_OUT // release
sta CIA2_PRA
// FALLTROUGH
iec_release_atn:
lda CIA2_PRA
and #$FF - BIT_CIA2_PRA_ATN_OUT // release
// FALLTROUGH
iec_pull_release_end:
sta CIA2_PRA
rts
#endif // CONFIG_IEC
-14
View File
@@ -1,14 +0,0 @@
#if CONFIG_IEC
iec_release_atn:
lda CIA2_PRA
and #$FF - BIT_CIA2_PRA_ATN_OUT // release
sta CIA2_PRA
rts
#endif // CONFIG_IEC
-22
View File
@@ -1,22 +0,0 @@
#if CONFIG_IEC
iec_release_atn_clk_data:
// Released CLK = DATA considered valid; for extra robustness on non-emulated
// hardware give some lines few more cycles to stabilize; see page 10 of
// http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf
lda CIA2_PRA
and #$FF - BIT_CIA2_PRA_ATN_OUT // release
sta CIA2_PRA
and #$FF - BIT_CIA2_PRA_DAT_OUT // release
sta CIA2_PRA
and #$FF - BIT_CIA2_PRA_CLK_OUT // release
sta CIA2_PRA
rts
#endif // CONFIG_IEC
-20
View File
@@ -1,20 +0,0 @@
#if CONFIG_IEC
iec_release_clk_data:
// Released CLK = DATA considered valid; for extra robustness on non-emulated
// hardware give some lines few more cycles to stabilize; see page 10 of
// http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf
lda CIA2_PRA
and #$FF - BIT_CIA2_PRA_DAT_OUT // release
sta CIA2_PRA
and #$FF - BIT_CIA2_PRA_CLK_OUT // release
sta CIA2_PRA
rts
#endif // CONFIG_IEC
@@ -1,20 +0,0 @@
#if CONFIG_IEC
iec_release_clk_pull_data:
// Released CLK = DATA considered valid; for extra robustness on non-emulated
// hardware give some lines few more cycles to stabilize; see page 10 of
// http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf
lda CIA2_PRA
ora #BIT_CIA2_PRA_DAT_OUT // pull
sta CIA2_PRA
and #$FF - BIT_CIA2_PRA_CLK_OUT // release
sta CIA2_PRA
rts
#endif // CONFIG_IEC