After using the apple 3 driver for awhile I became frustrated with the lack of auto-repeat on the keyboard. Retyping lines by hitting the right arrow key repeatedly 30 times is just something the dude cannot abide.

So let's scarf some code from the apple2 driver:

src/mame/includes/apple3.h

add a timer callback for ay3600_repeat
and a write line member for ay3600_ako_w (any key out)

Code
        DECLARE_READ_LINE_MEMBER(ay3600_shift_r);
        DECLARE_READ_LINE_MEMBER(ay3600_control_r);
        DECLARE_WRITE_LINE_MEMBER(ay3600_data_ready_w);
+       DECLARE_WRITE_LINE_MEMBER(ay3600_ako_w);
+       TIMER_DEVICE_CALLBACK_MEMBER(ay3600_repeat);
        virtual void device_post_load() override;


a couple of variables to hold the anykeydown state and repeat delay

Code
       uint16_t m_lastchar, m_strobe;
        uint8_t m_transchar;
        bool m_charwrt;
+bool m_anykeydown;
+int m_repeatdelay;
 

src/mame/drivers/apple3.cpp
Code
        m_ay3600->shift().set(FUNC(apple3_state::ay3600_shift_r));
        m_ay3600->control().set(FUNC(apple3_state::ay3600_control_r));
        m_ay3600->data_ready().set(FUNC(apple3_state::ay3600_data_ready_w));
+        m_ay3600->ako().set(FUNC(apple3_state::ay3600_ako_w));   // ako is anykey output
+        timer_device &timer(TIMER(config, "repttmr", 0));
+        timer.configure_periodic(timer_device::expired_delegate(FUNC(apple2e_state::ay3600_repeat), this), attotime::from_hz(15));
+

src/mame/machine/apple3.cpp

Code
+
+WRITE_LINE_MEMBER(apple3_state::ay3600_ako_w)
+{
+        m_anykeydown = (state == ASSERT_LINE) ? true : false;
+
+        if (m_anykeydown)
+        {
+                m_repeatdelay = 10;
+        }
+}
+
+TIMER_DEVICE_CALLBACK_MEMBER(apple3_state::ay3600_repeat)
+{
+        if (m_anykeydown)
+        {
+                if (m_repeatdelay)
+                {
+                        m_repeatdelay--;
+                }
+                else
+                {  
+                        m_strobe = 0x80;
+                        ay3600_data_ready_w(true);    // must set the ay3600_data_ready_w to TRUE
+                }
+        }
+}
+
+
+


After I copied the code from the apple2 driver it just didn't work. Finally I realized that I had to set the data_ready_line to true! Then I got my auto repeat working.

I know it isn't exact, but hey it works 8-) The dude can now go back to abiding.



Supposedly it's supposed to go faster if the solid apple key is held and the arrow keys do 2 speed stages or something:

https://www.wap.org/a3/a3library/a3beginninglll.html

"Every key is equipped with an automatic repeat. Holding down the key causes the letter or number to be repeated until the key is released. Some of the special character keys have a two speed repeat. The longer the pressure on the key, the faster the character is repeated. This is advantageous when moving the cursor and drawing lines or dots."

https://archive.org/details/Apple_3_Data_Sheet_A3/page/n3

"All keys have automatic repeat; Four directional-arrow keys with two-speed repeat"

https://archive.org/details/DTCA3DOC-012_review_apple_3_byte_1982-09/page/n5

[Linked Image from i.imgur.com]

Apple III Review - PCW - August 1980.pdf

[Linked Image from i.imgur.com]

edit:

Apparently the arrow keys are "double action" switches:

https://deskthority.net/viewtopic.php?t=17354


Last edited by Golden Child; 09/08/19 05:53 PM.