Steem's emulation of STE analog joy. input

A forum for anything about the Steem Engine STE emulator, comments, problems, bug reports etc. Steven Seagal regularly provides updated versions of the original STEem code. The current version is v3.9.4.

Moderators: Mug UK, Steem Authors, Moderator Team

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2906
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Steem's emulation of STE analog joy. input

Postby AtariZoll » Tue Jun 13, 2017 8:06 am

I don't see is it emulated at all, or how to set it in joystick settings. Manual says that Steem handles well digital and analog joysticks, and that's true. But as I see, it can be mapped only for digital inputs - regular ST joystick, or STE advanced. You can set sensitivity of analog, and can see how you move paddles, but nothing changes at ports $FF9210-$FF9216 . I know that it was barely used in SW, so may be that it is the reason why is not emulated.
Looked Steem SSE, latest versions, and nothing better.
Negative feedback has usually positive effect.

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1982
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: Steem's emulation of STE analog joy. input

Postby Steven Seagal » Wed Jun 14, 2017 8:10 am

It's currently not emulated. By "digital and analog joysticks", the manual means PC joysticks.
Big problem is that there are no programs to test against AFAIK, which also raises the usefulness question.

WoodlandSpirit
Atariator
Atariator
Posts: 21
Joined: Sun Apr 30, 2017 10:33 am

Re: Steem's emulation of STE analog joy. input

Postby WoodlandSpirit » Wed Jun 14, 2017 8:34 am

Won't be the most complete test case but I seem to remember the game Zero-5 making use of the Jaguar pad if you had it plugged in, might be an avenue to explore/get strated.

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2906
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: Steem's emulation of STE analog joy. input

Postby AtariZoll » Wed Jun 14, 2017 8:53 am

Steven Seagal wrote:It's currently not emulated. By "digital and analog joysticks", the manual means PC joysticks.
Big problem is that there are no programs to test against AFAIK, which also raises the usefulness question.

Moonspeeder is listed as only one supporting analog. Too bad, it's Falcon only. But possible that I can do some tests on Falcon

...
WoodlandSpirit wrote:Won't be the most complete test case but I seem to remember the game Zero-5 making use of the Jaguar pad if you had it plugged in, might be an avenue to explore/get strated.

I tried Zero-5 couple days ago in Steem. There is only Jagpad support, so no analog.
Negative feedback has usually positive effect.

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2906
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: Steem's emulation of STE analog joy. input

Postby AtariZoll » Thu Jun 15, 2017 10:54 am

I did testing on real Falcon with PC analog joystick, connected via simple adapter - need only 3 lines for X-Y analog inputs.
The range of value on ports is ~ $4 - $3E when adjusters are in middle pos. When centered value is about %1F . Variable resistor in that joystick goes up to about 115 KB, what is according to specs of it. So, I'm not sure that low max value ($3E) is result of that Atari designed port for higher value variable resistors, or it is just it ... In any case Moonspeeder steering with PC joystick was fine - there is calibration before start.
I just thought that would be good to try some games with analog control - Flight Sim. 2, OIDS, Vroom - should be much better than with mouse.
That would be usefulness :D
Negative feedback has usually positive effect.

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2906
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: Steem's emulation of STE analog joy. input

Postby AtariZoll » Fri Jun 16, 2017 9:05 am

I did more testings, and can confirm that values in my previous post are real, good working ones. In case of resistor value over 100K it becomes non-linear. So, we have all necessary to add support for it in Steem.
If Steven won't do it, I will put together all my C knowledge and go on it - first for Steem 3.2 Debugger (needed for testings, SW mods) - and then for basic v.
Negative feedback has usually positive effect.

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1982
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: Steem's emulation of STE analog joy. input

Postby Steven Seagal » Fri Jun 16, 2017 6:32 pm

AtariZoll wrote:I did more testings, and can confirm that values in my previous post are real, good working ones. In case of resistor value over 100K it becomes non-linear. So, we have all necessary to add support for it in Steem.
If Steven won't do it, I will put together all my C knowledge and go on it - first for Steem 3.2 Debugger (needed for testings, SW mods) - and then for basic v.


There's also the GUI aspect of course.
It's not that I don't want to do it, but I can't jump on this.
The priority now is bugfixes for next release, planned for end of this month.
And then we would need a test case for STE (not Falcon).

czietz
Hardware Guru
Hardware Guru
Posts: 478
Joined: Tue May 24, 2016 6:47 pm

Re: Steem's emulation of STE analog joy. input

Postby czietz » Fri Jun 16, 2017 7:54 pm

AtariZoll wrote:I did more testings, and can confirm that values in my previous post are real, good working ones. In case of resistor value over 100K it becomes non-linear. So, we have all necessary to add support for it in Steem.


Since we have the STE schematic and inner workings of the GSTMCU, we can fully-reverse engineer the circuit for the analog joysticks:

The analog part of the circuit consists of LM556 timers working in monostable mode. From the datasheet we can see that in this configuration the output of the LM556 will be high for T = 1.1 * Ra * C, and from the STE schematic we get C = 680 pF and Ra = (Rjoy || 1 Mohm) + 470 Ohms. Rjoy is the resistance of the joystick -- assuming the other end is connected to 5V.
The digital part of the circuit consists of an 8-bit counter inside the GSTMCU. It is clocked by a 500 kHz clock. When it overflows, i.e. every 256 clock cycles or every 512 µs, both the counter and the LM556 are reset. When the output of the LM556 goes low, the counter value is latched into the respective register that can be read out at addresses $FF9210-$FF9216.

Hence, one can derive the formula for the register value N as:
N = floor((176 + 374 * (Rjoy/1kOhm)) / (1000 + (Rjoy/1kOhm))).

For Rjoy bigger than a few kiloohms this can be be approximated by:
N = floor(374 / (1 + 1000/(Rjoy/1kOhm)))

Now the question is: How big is the range of Rjoy supposed to be? Does anyone have specs for the analog joysticks that were meant to be connected to the STE?

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2906
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: Steem's emulation of STE analog joy. input

Postby AtariZoll » Fri Jun 16, 2017 9:35 pm

Here are more details:
viewtopic.php?f=15&t=31806
Negative feedback has usually positive effect.

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2906
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: Steem's emulation of STE analog joy. input

Postby AtariZoll » Sun Jun 25, 2017 9:30 am

Here is what to change in Steem, to get emulation of 1 X-Y paddle on port A, using some gamepad with paddles as joystick 0 of PC.
In file stjoy.cpp :

Code: Select all

    case 0xff9210: return 255;  / no change
    case 0xff9211: return 4+(HIBYTE(GetAxisPosition(0,&JoyPos[0]))/4);
    case 0xff9212: return 255;  / no change
    case 0xff9213: return 4+(HIBYTE(GetAxisPosition(1,&JoyPos[0]))/4);
   

Only 2 lines to change. This will give input range very close to what I got on Falcon with 100K variable resistors in analog joystick, adjusters in middle pos. (and that is most likely what is target value for some Atari paddle, if such was ever made).
That's what I could to do. Adding some calibration/adjust in Joystick menu is on you Steven :D
Works fine with so far only one game - modded OIDS :D Vroom is next candidate :idea:
Negative feedback has usually positive effect.

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1982
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: Steem's emulation of STE analog joy. input

Postby Steven Seagal » Mon Jul 10, 2017 11:15 am

So do you have a test program available?

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2906
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: Steem's emulation of STE analog joy. input

Postby AtariZoll » Mon Jul 10, 2017 12:05 pm

Steven Seagal wrote:So do you have a test program available?

Here is it:
OIDSAJ.ZIP

In game acceleration is with paddle (attached to port 0) up, rotation with left or right. It needs some more work, to be really comfortable to use - here I mean to maximize rotation to 180 degrees at on movement, and solving slowdown too - probably with automatic ship rotation of 180 degrees - but that's are details not relevant for test. I plan to do Vroom with analog instead mouse.
In DIR is proggie SHOWANLG.TOS which reads values at 4 analog inputs, in order port 0: X, Y . port 1: X, Y .
Normal values are:
4 for most left and top pos .
$24 for middle
$43 for most right and bottom
All in Hex .
You do not have the required permissions to view the files attached to this post.
Negative feedback has usually positive effect.

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1982
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: Steem's emulation of STE analog joy. input

Postby Steven Seagal » Mon Jul 10, 2017 3:09 pm

Thx.
I started from your code but tried to make it independent of PC joystick order, and work for the 2 ports.

Using my good old M$ Sidewinder, for your info, the values are $4-$23-$43.

It seems almost ready to go. Not sure we need GUI complications such as calibration after all. Of course, the "digital" STE joystick values will still be updated that way.

The game doesn't use STE fire button?
Notice your intro pic has dots in some "wakestate" (Steem needs WU2).

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2906
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: Steem's emulation of STE analog joy. input

Postby AtariZoll » Mon Jul 10, 2017 3:45 pm

Yes, I think that no need for calibration in Steem. There will be calibration in games self.
Fire is assigned to Button 1 - port $FF9201, bit 0 . That's Fire button in Steem Settings.
By my experience STE and Mega STE wake up 90% in WU1 state, so intro (cover) pic displaying is for that.
Actually it is WS1 for ST mode, and WS4 in STE mode when displaying is good.
Negative feedback has usually positive effect.

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1982
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: Steem's emulation of STE analog joy. input

Postby Steven Seagal » Mon Jul 10, 2017 7:11 pm

AtariZoll wrote:Fire is assigned to Button 1 - port $FF9201, bit 0 . That's Fire button in Steem Settings.


Indeed, it's a bug I introduced to quiet compiler warnings... nice coding here :)
So it's OK now, a feature + a bugfix. Thx.

In Steem if you use an analog joystick as STE joystick A/0 or B/0, it will work as a normal joystick + as paddles.
I think it's the simplest approach, if not rigorously perfect emulation.
If you will, you may specify a formula to convert the PC reading to STE reading. After all, you're the only source of games using the feature, you have a say in this :)

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1982
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: Steem's emulation of STE analog joy. input

Postby Steven Seagal » Tue Jul 11, 2017 7:35 am

Some tests on my 4MB STE + HxC.
No dots. But it's when Overscan demos 2000 don't work. Wouldn't dare give a % of success.
(EDIT and Circus backstage also has horrible dots in that state - what's more, when the STE was colder, it said it didn't have enough memory...)
The test program shows analog joystick reading varies when there's no joystick.

After the FTL logo, game says "Please re-boot...".
It happens in Steem too with the same HFE and STW but not the ST image, fast or slow.

Uploaded a beta: https://sourceforge.net/projects/steemsse/files/DevBuilds/Steem.SSE.Beta.Win32.D3D.zip/download
Can upload the HFE file if necessary.
Last edited by Steven Seagal on Tue Jul 11, 2017 7:53 am, edited 2 times in total.

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2906
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: Steem's emulation of STE analog joy. input

Postby AtariZoll » Tue Jul 11, 2017 7:38 am

Steven Seagal wrote:In Steem if you use an analog joystick as STE joystick A/0 or B/0, it will work as a normal joystick + as paddles.
I think it's the simplest approach, if not rigorously perfect emulation.
If you will, you may specify a formula to convert the PC reading to STE reading. After all, you're the only source of games using the feature, you have a say in this :)

The problem is that, it seems no one saw such type game controller made for Atari STE or Falcon. Everyone have only JagPad or in rarer case practically same PowerPad . Even Steem authors made support by available specs of it - like devdocu5.htm , and analog input emulation is missing because lack of available specs, device. According to number of buttons supported you can have 4 directions + Fire beside analog paddles, and connect 2 of such on 1 port, but total number of analog inputs is 2 on 1 port. Possible to make some controller with 10 buttons too.
PC reading is, as I see 16 bit, unsigned. But I have only one cheap gamepad. Surprised on that 16 bit, because it really has no sense for games. Probably it can be used for some more serious stuff, with some accurate A-D converter.
Formula is practically there in code snippet I gave. Using highest 6 bits of 16-bit input value, and add 4 to it. 10 bits went in trash can - not something rare in case of Windows :lol:
Negative feedback has usually positive effect.

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2906
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: Steem's emulation of STE analog joy. input

Postby AtariZoll » Tue Jul 11, 2017 8:03 am

I getting all $FF-s when no controller attached, but that's on Falcon. What is value range you see ?
Inputs are 100% same on Falcon schematic.

That OIDSAJ is more for hard disk usage, but it works from floppy too on ST(E) .
Its strange that works not with different floppy image formats. Game uses strictly file access via TOS. But there is lot of short accesses to LIB file, where some hidden code is placed.
Anyway, try this direct runnable version:
OIAJ.ZIP


P.S. Tried your latest beta, and OIDS AJ works well.
You do not have the required permissions to view the files attached to this post.
Negative feedback has usually positive effect.

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1982
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: Steem's emulation of STE analog joy. input

Postby Steven Seagal » Tue Jul 11, 2017 8:26 am

STW and HFE are more precise (but if it works on floppy maybe there's a problem in those formats - or it depends on sectors/track?)
Yes, this one loads, but as I have no paddles, it just spins and drifts to the rocks. :)
The value range is more or less like in the beta ($8. etc.), except it changes faster in Steem (it uses rand() at each read).
In fact if it's stable, you know there's a paddle on the STE (hopefully).
Notice it's just my STE, maybe it's acting up.


Social Media

     

Return to “Steem”

Who is online

Users browsing this forum: No registered users and 1 guest