IKBD queries

GFA, ASM, STOS, ...

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

Post Reply
User avatar
shoggoth
Nature
Nature
Posts: 1222
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

IKBD queries

Post by shoggoth »

Howdy folks,

For undisclosed reasons I've been implementing an IKBD-equivalent of sorts. There be dragons.

Questions:
- When exactly would/should joystick 0 generate events? I turn off mouse events. I enable joystick events. It doesn't generate joystick 0 events.
- Mouse button action (command 0x07) mode 0x04 should, as I read the documentation, generate make/break key codes (0x74 and 075) when mouse keys are pressed. I've tested this on Hatari but it doesn't happen. I do Ikbdws(str, 1), where str is {0x07, 0x04}.
- Joystick 1 doesn't report fire button events. I know this signal is shared with the right mouse button, but shouldn't it be reflected in the joystick packet too?
- Absolute mouse reports are only generated if asked for it in one way or another (either explicitly or using mouse button action modes 0x01-0x03). It will never do so solely on mouse movement. Did I get this right?

Cheers!
Ain't no space like PeP-space.
User avatar
Eero Tamminen
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2841
Joined: Sun Jul 31, 2011 1:11 pm

Re: IKBD queries

Post by Eero Tamminen »

shoggoth wrote: Fri Sep 09, 2022 8:42 am For undisclosed reasons I've been implementing an IKBD-equivalent of sorts. There be dragons.
No need to tell, but I'm guessing you're sharpening your vampire stakes...
shoggoth wrote: Fri Sep 09, 2022 8:42 am Questions:
- When exactly would/should joystick 0 generate events? I turn off mouse events. I enable joystick events. It doesn't generate joystick 0 events.
In the Punssi game: http://eerott.mbnet.fi/hatari/programs.shtml#punssi

I start joystick tracking with:

Code: Select all

  /* Install new joystick packet handler into keyboard vector table.
   * Turn mouse off and tell IKBD to send joystick packets.
   */
  table_addr = Kbdvbase();
  key_handler = table_addr->ikbdsys;    /* earlier handler: ->joyvec */
  table_addr->ikbdsys = KeyISR;
  Ikbdws(1, "\022\024");
And restore things at exit with:

Code: Select all

  table_addr = Kbdvbase();
  table_addr->ikbdsys = key_handler;    /* earlier handler: ->joyvec */
  Ikbdws(1, "\025\010");
shoggoth wrote: Fri Sep 09, 2022 8:42 am - Mouse button action (command 0x07) mode 0x04 should, as I read the documentation, generate make/break key codes (0x74 and 075) when mouse keys are pressed. I've tested this on Hatari but it doesn't happen. I do Ikbdws(str, 1), where str is {0x07, 0x04}.
Note that Hatari does not emulate IKBD processor. There's old work-in-progress IKBD emulation code in Hatari sources, but it's never been used. Hatari just emulates mouse and joystick and maps specific IKBD programs to specific actions case-by-case.
shoggoth wrote: Fri Sep 09, 2022 8:42 am - Joystick 1 doesn't report fire button events. I know this signal is shared with the right mouse button, but shouldn't it be reflected in the joystick packet too?
Works fine for me with Punssi. Or did you mean mean when also mouse is enabled?
shoggoth wrote: Fri Sep 09, 2022 8:42 am - Absolute mouse reports are only generated if asked for it in one way or another (either explicitly or using mouse button action modes 0x01-0x03). It will never do so solely on mouse movement. Did I get this right?
tzok
Captain Atari
Captain Atari
Posts: 281
Joined: Fri Jun 30, 2017 7:22 pm
Location: Bielsko-Biala, PL
Contact:

Re: IKBD queries

Post by tzok »

As far as I know, STeEM fully emulates IKBD, and you should be able to find IKBD source code in its repositories.
User avatar
Eero Tamminen
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2841
Joined: Sun Jul 31, 2011 1:11 pm

Re: IKBD queries

Post by Eero Tamminen »

While Hatari does not do real IKBD *processor* emulation, there are NO known cases (demos or otherwise) where that would be a problem. But, if one wants to try programming IKBD, instead of just using it, that's something to keep in mind.
ijor
Hardware Guru
Hardware Guru
Posts: 4348
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: IKBD queries

Post by ijor »

tzok wrote: Mon Sep 12, 2022 8:01 pm As far as I know, STeEM fully emulates IKBD, and you should be able to find IKBD source code in its repositories.
Are you sure? I don't remember seeing the IKBD source in Steem archive. Steem doesn't need the source to be able to fully emulate the IKBD, the same that it doesn't need TOS sources. Only binaries are required.

But yes, Steem SSE has a full IKBD processor emulator. Could be very useful for the OP purposes.
Fx Cast: Atari St cycle accurate fpga core
User avatar
shoggoth
Nature
Nature
Posts: 1222
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: IKBD queries

Post by shoggoth »

I think I'm exploring some of the more exotic features of this thing, so I'd better check some more sources (ideally a real machine).
Ain't no space like PeP-space.
tzok
Captain Atari
Captain Atari
Posts: 281
Joined: Fri Jun 30, 2017 7:22 pm
Location: Bielsko-Biala, PL
Contact:

Re: IKBD queries

Post by tzok »

Yeah, I was thinking about Steem SSE. Yet original Steem also had some kind of IKBD emulation:
https://github.com/steem-engine/steem-e ... e/ikbd.cpp

Steem SSE:
https://sourceforge.net/p/steemsse/code ... m/ikbd.cpp

You'll also find some documents in:
https://sourceforge.net/p/steemsse/code ... steem/doc/
ijor
Hardware Guru
Hardware Guru
Posts: 4348
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: IKBD queries

Post by ijor »

tzok wrote: Tue Sep 13, 2022 11:07 am Steem SSE:
https://sourceforge.net/p/steemsse/code ... m/ikbd.cpp
This is not the IKBD source. It is the source for the old, non-full (same level as Hatari and old Steem), IKBD emulation.
Fx Cast: Atari St cycle accurate fpga core
ijor
Hardware Guru
Hardware Guru
Posts: 4348
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: IKBD queries

Post by ijor »

shoggoth wrote: Tue Sep 13, 2022 8:11 am I think I'm exploring some of the more exotic features of this thing, so I'd better check some more sources (ideally a real machine).
Well, the exotic features are mostly related to custom code upload. I assume you are not going to support that, or I am wrong?
Fx Cast: Atari St cycle accurate fpga core
User avatar
shoggoth
Nature
Nature
Posts: 1222
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: IKBD queries

Post by shoggoth »

ijor wrote: Tue Sep 13, 2022 12:32 pmWell, the exotic features are mostly related to custom code upload. I assume you are not going to support that, or I am wrong?
Nah, won't support that. The most "exotic" thing I do is "mouse button action" = 0x04, really. I haven't found any code that actually use this. I've seen code that uses the other button modes, but not that one.
Ain't no space like PeP-space.
tzok
Captain Atari
Captain Atari
Posts: 281
Joined: Fri Jun 30, 2017 7:22 pm
Location: Bielsko-Biala, PL
Contact:

Re: IKBD queries

Post by tzok »

ijor wrote: Tue Sep 13, 2022 12:30 pm
tzok wrote: Tue Sep 13, 2022 11:07 am Steem SSE:
https://sourceforge.net/p/steemsse/code ... m/ikbd.cpp
This is not the IKBD source. It is the source for the old, non-full (same level as Hatari and old Steem), IKBD emulation.
I'm not sure, but it states:
This file contains a high-level emulation (not OPTION_C1) as well as an
interface for the low-level emulation (OPTION_C1)
So it contains an interface for this:
https://sourceforge.net/p/steemsse/code ... arty/6301/
ijor
Hardware Guru
Hardware Guru
Posts: 4348
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: IKBD queries

Post by ijor »

tzok wrote: Tue Sep 13, 2022 2:23 pm I'm not sure, but it states:
...
So it contains an interface for this:
https://sourceforge.net/p/steemsse/code ... arty/6301/
Yes, but, again, that is not the IKBD source. The IKBD source should be an assembler 6301 source file.
Fx Cast: Atari St cycle accurate fpga core
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2372
Joined: Sun Aug 03, 2014 5:54 pm

Re: IKBD queries

Post by ThorstenOtto »

ijor
Hardware Guru
Hardware Guru
Posts: 4348
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: IKBD queries

Post by ijor »

ThorstenOtto wrote: Tue Sep 13, 2022 3:14 pm That is also there: https://sourceforge.net/p/steemsse/code ... mented.txt
Ah, nice. Steve did a good job reversing this file. It is not really the "original" source, which sadly seems to be lost, but it is still very useful.
Fx Cast: Atari St cycle accurate fpga core
gstoll
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 145
Joined: Sun Feb 17, 2008 4:29 pm

Re: IKBD queries

Post by gstoll »

ThorstenOtto wrote: Tue Sep 13, 2022 3:14 pm That is also there: https://sourceforge.net/p/steemsse/code ... mented.txt
In the german magazin ST-Computer 3/1990, 4/1990 and 5/1990 was some article about the 6301. Here is also a listing from the rom with many german comments.
You do not have the required permissions to view the files attached to this post.
User avatar
shoggoth
Nature
Nature
Posts: 1222
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: IKBD queries

Post by shoggoth »

Thanks guys! I was reading the disassembled code before - but I didn't have the commented versions (helps a lot, I'm definitely not fluent in 6301).
Ain't no space like PeP-space.
ijor
Hardware Guru
Hardware Guru
Posts: 4348
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: IKBD queries

Post by ijor »

shoggoth wrote: Tue Sep 13, 2022 6:18 pm Thanks guys! I was reading the disassembled code before - but I didn't have the commented versions (helps a lot, I'm definitely not fluent in 6301).
Even if you do are fluent with 6301, it is still not easy because the IKBD code is mostly event based, not linear. Best way to follow the code is with a debugger. I don't know if this has been changed recently, but Steem has (or had) only limited 6301 debugging support (no breakpoints or tracing). May be this was improved in later versions?
Fx Cast: Atari St cycle accurate fpga core
User avatar
shoggoth
Nature
Nature
Posts: 1222
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: IKBD queries

Post by shoggoth »

I'll loose my mind tracing this code I think. I had a peek at the Eiffel sources instead, since that's a somewhat proven solution. I've interpreted the docs the same way they did, so I guess my last resort will have to test things on Steam or a real machine.
Ain't no space like PeP-space.
Post Reply

Return to “Coding”