simonsunnyboy wrote:It seems I have to add some flag waiting code on bit #0 in $FFFFFC00.
This flag tells you new data is available at $FFFC02. If your mouse is disabled you can just read $FFFC02 as a keyboard scancode. If mouse (or joystick) is enabled this is not true because you can have multi byte mouse and joystick packets.
@Charles:
simonsunnyboy is bypassing all TOS routines for reading the keyboard and has disabled the MFP interrupt handling a keyboard packet coming from the ACIA. You never know when those interrupts arrive and those interrupts destroy your rasters. Because there are no interrupts you will have to look at the ACIA data register yourself. This technique is called polling. Normally you read the ACIA data one time per vertical blank. If you don't care to miss some key presses this is a very good technique. Most demo screens use it.
Normally they are only interested to see whether the space bar was pressed and some the cursor keys. It is not a big deal to miss a incoming byte. But all mouse and joystick data is coming in multi byte packets. If you miss the header byte of such a multi byte packet you don't know that the data you are reading belongs to a mouse packet and if you try to use it as normal keyboard scan codes you get unwanted results.
charles wrote:i know just a little above your $fffffc02 is
the $fffffc04 my midi status control register
and
at $fffffc06 is midi in/out data register
so with this applied maybe $ffffff00 is the keyboard control register?
Yes, FFFC00 and FFFC02 for keyboard are working the same way as FFFC04 and FFFC06 for MIDI as they are both ACIA registers.
charles wrote:what is the ipl ?
IPL stand for Interrupt Priority Level. Normally an ST runs at IPL 4, the HBL interrupts are blocked.
At IPL 6 the VBL interrupts are blocked.
At IPL 7 all interrupts are blocked.
charles wrote:the midi adress is bi-directional
is this keyboard address bidirectional as-well??
Yes it is. To disable the mouse you sent data to the keyboard.
charles wrote:anyhow i'm surprised no one else is trying to help.
??? On February 12 simonsunnyboy asked the question. On February 14 he got some useful suggestions. The a long time nothing happened (it is safe to assume the problem is solved or simonsunnyboy is busy testing solutions). On the 1st of March you started to ask a lot of questions clearly showing you didn't have a clue what simonsunnyboy was doing and what problems he faced. Why are you stating no one is helping simonsunnyboy?
Polling $FFFC02 for reading the keyboard works fine. Most demos work this way. But you have to disable the mouse. Sending $12 to the keyboard should work fine. The big question is why it doesn't work as expected for simonsunnyboy.
Hans Wessels