Welcome, Guest. Please login or register.

Author Topic: Simulate key press, help need.  (Read 7378 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline balrogsoftTopic starter

  • Full Member
  • ***
  • Join Date: Jan 2006
  • Posts: 186
    • Show all replies
    • http://www.amigaskoolnet
Simulate key press, help need.
« on: May 29, 2006, 12:40:57 AM »
 Hi, i saw a interesting page with all games that support 4 player adaptor, and i have a idea that i don't know if it can work.

 I played with Blitz Basic 2 and my new 4 players adaptor on my Amiga 600, i made some asm functions to read player 3 and 4 joysticks, and it work perfectly, i used an asm example on aminet.

 Some games have options to play with 4 players, 2 players on joystick and 2 players on keyboard, i want to make a program that redirect player 3 and 4 joysticks to Amiga keyboard, then a lot of games will be able to use the 4 players adaptor. I only made small asm programs some years ago, i have some Amiga programming books, but i don't find a way to simulate a key press event, exist a method to make it work? and for no-multitask games also? somebody knows how to make it in assembler?
Balrog Software · http://www.amigaskool.net
Mac Mini G4 1,5ghz · MorphOS 2.7 · Ati Radeon 9200 64Mb · 1 Gb RAM · 80 GB HD
Efika · MorphOS 2.7 · Ati Radeon 9250 128Mb · 120 Gb WD HD
Amiga 1200T · OS 3.9 · Voodoo3 · Blizzard 603e/240mhz 060/50mhz · 98 Mb RAM · 40 GB HD
Amiga 600 · OS 3.1 · ACA 630/25mhz 32 Mb RAM · 4Gb CF
 

Offline balrogsoftTopic starter

  • Full Member
  • ***
  • Join Date: Jan 2006
  • Posts: 186
    • Show all replies
    • http://www.amigaskoolnet
Re: Simulate key press, help need.
« Reply #1 on: May 29, 2006, 09:34:33 AM »
Thanks a lot, Piru! I think that exist a way to make it work with no multitasking games, but this piece of code can be usefull. I will try after work and will see how many games will work with it. There is a site where i can download Amiga include files for assembler? i found a web with AsmOne but it don't have includes.
Balrog Software · http://www.amigaskool.net
Mac Mini G4 1,5ghz · MorphOS 2.7 · Ati Radeon 9200 64Mb · 1 Gb RAM · 80 GB HD
Efika · MorphOS 2.7 · Ati Radeon 9250 128Mb · 120 Gb WD HD
Amiga 1200T · OS 3.9 · Voodoo3 · Blizzard 603e/240mhz 060/50mhz · 98 Mb RAM · 40 GB HD
Amiga 600 · OS 3.1 · ACA 630/25mhz 32 Mb RAM · 4Gb CF
 

Offline balrogsoftTopic starter

  • Full Member
  • ***
  • Join Date: Jan 2006
  • Posts: 186
    • Show all replies
    • http://www.amigaskoolnet
Re: Simulate key press, help need.
« Reply #2 on: May 29, 2006, 12:43:08 PM »
Quote

Piru wrote:
That is completely different thing, it would require patches for every imaginable game.

Hardly useful for generic joy->keyboard patch.


Different but not at all, WHDLoad execute a routine to test F10 key on non multitasking games, maybe it will not work with the code above because it is working on OS level, if i can get a method to simulate the key press at hardware level working with raw key codes, maybe i can make it work. Correct me if i'm wrong...
Balrog Software · http://www.amigaskool.net
Mac Mini G4 1,5ghz · MorphOS 2.7 · Ati Radeon 9200 64Mb · 1 Gb RAM · 80 GB HD
Efika · MorphOS 2.7 · Ati Radeon 9250 128Mb · 120 Gb WD HD
Amiga 1200T · OS 3.9 · Voodoo3 · Blizzard 603e/240mhz 060/50mhz · 98 Mb RAM · 40 GB HD
Amiga 600 · OS 3.1 · ACA 630/25mhz 32 Mb RAM · 4Gb CF
 

Offline balrogsoftTopic starter

  • Full Member
  • ***
  • Join Date: Jan 2006
  • Posts: 186
    • Show all replies
    • http://www.amigaskoolnet
Re: Simulate key press, help need.
« Reply #3 on: May 29, 2006, 02:13:39 PM »
The method above use input.device to send a key event, then it will depend on how the game capture keyboard events, if it use a system friendly method to capture the keyboard, and it isn't multitask, it will work?
Balrog Software · http://www.amigaskool.net
Mac Mini G4 1,5ghz · MorphOS 2.7 · Ati Radeon 9200 64Mb · 1 Gb RAM · 80 GB HD
Efika · MorphOS 2.7 · Ati Radeon 9250 128Mb · 120 Gb WD HD
Amiga 1200T · OS 3.9 · Voodoo3 · Blizzard 603e/240mhz 060/50mhz · 98 Mb RAM · 40 GB HD
Amiga 600 · OS 3.1 · ACA 630/25mhz 32 Mb RAM · 4Gb CF
 

Offline balrogsoftTopic starter

  • Full Member
  • ***
  • Join Date: Jan 2006
  • Posts: 186
    • Show all replies
    • http://www.amigaskoolnet
Re: Simulate key press, help need.
« Reply #4 on: May 29, 2006, 09:36:55 PM »
Some hours offline and i found 2 pages on this topic, thanks to all, i will try to use input device and send system friendly events, i found a device example on blitz basic 2, blitz2 have commands to access AmigaOS devices, but i will take a look on my Amiga Hardware books and read about keyboard interrupts. Thanks to all, very interesting reading.
Balrog Software · http://www.amigaskool.net
Mac Mini G4 1,5ghz · MorphOS 2.7 · Ati Radeon 9200 64Mb · 1 Gb RAM · 80 GB HD
Efika · MorphOS 2.7 · Ati Radeon 9250 128Mb · 120 Gb WD HD
Amiga 1200T · OS 3.9 · Voodoo3 · Blizzard 603e/240mhz 060/50mhz · 98 Mb RAM · 40 GB HD
Amiga 600 · OS 3.1 · ACA 630/25mhz 32 Mb RAM · 4Gb CF
 

Offline balrogsoftTopic starter

  • Full Member
  • ***
  • Join Date: Jan 2006
  • Posts: 186
    • Show all replies
    • http://www.amigaskoolnet
Re: Simulate key press, help need.
« Reply #5 on: May 30, 2006, 08:52:48 AM »
A few questions more, as i understand the main problem to use keyboard interrupt is that joystick don't generate a interrupt, when i send an event to keyboard using input.device, it will call keyboard interrupt? And if we put something on the keyboard to have a key continously pressed? then the interrupt will be called, then you can overwrite the interrupt and read joystick, and put the key that we want to simulate. I don't know if it will work... I saw also a note on Amiga hardware reference saying that you can't use $BFEC01 address, that is the serial input connected to keyboard, it says that hardware is using continously.
Balrog Software · http://www.amigaskool.net
Mac Mini G4 1,5ghz · MorphOS 2.7 · Ati Radeon 9200 64Mb · 1 Gb RAM · 80 GB HD
Efika · MorphOS 2.7 · Ati Radeon 9250 128Mb · 120 Gb WD HD
Amiga 1200T · OS 3.9 · Voodoo3 · Blizzard 603e/240mhz 060/50mhz · 98 Mb RAM · 40 GB HD
Amiga 600 · OS 3.1 · ACA 630/25mhz 32 Mb RAM · 4Gb CF