diff --git a/bin/basic_generic.rom b/bin/basic_generic.rom index bfdb0f18..4df641d4 100644 Binary files a/bin/basic_generic.rom and b/bin/basic_generic.rom differ diff --git a/bin/basic_mega65.rom b/bin/basic_mega65.rom index 39165f09..fc64445f 100644 Binary files a/bin/basic_mega65.rom and b/bin/basic_mega65.rom differ diff --git a/bin/basic_testing.rom b/bin/basic_testing.rom index 7597c515..c5f9a87d 100644 Binary files a/bin/basic_testing.rom and b/bin/basic_testing.rom differ diff --git a/bin/basic_ultimate64.rom b/bin/basic_ultimate64.rom index 56989957..d6c333b7 100644 Binary files a/bin/basic_ultimate64.rom and b/bin/basic_ultimate64.rom differ diff --git a/bin/kernal_generic.rom b/bin/kernal_generic.rom index 6b99eb9f..dc594837 100644 Binary files a/bin/kernal_generic.rom and b/bin/kernal_generic.rom differ diff --git a/bin/kernal_mega65.rom b/bin/kernal_mega65.rom index 1c091b93..939e42e9 100644 Binary files a/bin/kernal_mega65.rom and b/bin/kernal_mega65.rom differ diff --git a/bin/kernal_testing.rom b/bin/kernal_testing.rom index 1947d680..9b10448d 100644 Binary files a/bin/kernal_testing.rom and b/bin/kernal_testing.rom differ diff --git a/bin/kernal_ultimate64.rom b/bin/kernal_ultimate64.rom index 3ca562a5..e53f8efe 100644 Binary files a/bin/kernal_ultimate64.rom and b/bin/kernal_ultimate64.rom differ diff --git a/c64/kernal/iec/iec_pull_atn_clk_release_data.s b/c64/kernal/iec/iec_pull_atn_clk_release_data.s deleted file mode 100644 index 1b8ba0d9..00000000 --- a/c64/kernal/iec/iec_pull_atn_clk_release_data.s +++ /dev/null @@ -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 diff --git a/c64/kernal/iec/iec_pull_clk_release_data.s b/c64/kernal/iec/iec_pull_clk_release_data.s deleted file mode 100644 index 18ffda0a..00000000 --- a/c64/kernal/iec/iec_pull_clk_release_data.s +++ /dev/null @@ -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 diff --git a/c64/kernal/iec/iec_pull_clk_release_data_oneshot.s b/c64/kernal/iec/iec_pull_clk_release_data_oneshot.s deleted file mode 100644 index f3d7696b..00000000 --- a/c64/kernal/iec/iec_pull_clk_release_data_oneshot.s +++ /dev/null @@ -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 diff --git a/c64/kernal/iec/iec_pull_data_release_atn_clk.s b/c64/kernal/iec/iec_pull_data_release_atn_clk.s deleted file mode 100644 index 58d3ca1f..00000000 --- a/c64/kernal/iec/iec_pull_data_release_atn_clk.s +++ /dev/null @@ -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 diff --git a/c64/kernal/iec/iec_pull_release.s b/c64/kernal/iec/iec_pull_release.s new file mode 100644 index 00000000..8be0e851 --- /dev/null +++ b/c64/kernal/iec/iec_pull_release.s @@ -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 diff --git a/c64/kernal/iec/iec_release_atn.s b/c64/kernal/iec/iec_release_atn.s deleted file mode 100644 index c9d49478..00000000 --- a/c64/kernal/iec/iec_release_atn.s +++ /dev/null @@ -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 diff --git a/c64/kernal/iec/iec_release_atn_clk_data.s b/c64/kernal/iec/iec_release_atn_clk_data.s deleted file mode 100644 index b572dfc3..00000000 --- a/c64/kernal/iec/iec_release_atn_clk_data.s +++ /dev/null @@ -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 diff --git a/c64/kernal/iec/iec_release_clk_data.s b/c64/kernal/iec/iec_release_clk_data.s deleted file mode 100644 index 35deb964..00000000 --- a/c64/kernal/iec/iec_release_clk_data.s +++ /dev/null @@ -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 diff --git a/c64/kernal/iec/iec_release_clk_pull_data.s b/c64/kernal/iec/iec_release_clk_pull_data.s deleted file mode 100644 index ad98c987..00000000 --- a/c64/kernal/iec/iec_release_clk_pull_data.s +++ /dev/null @@ -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