Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Paddle stuff

Reply to topic
Author Message
  • Joined: 28 Sep 1999
  • Posts: 1197
Reply with quote
Paddle stuff
Post Posted: Thu Jan 10, 2002 7:28 pm
I recently looked at Megumi Rescue to figure out how the paddle works, and wanted to give a brief description of how it functions.

The up/down/left/right bits of $DC return the high or low nibble of an 8-bit value which represents how far clockwise the paddle has been turned with 0=default position, 255=fully clockwise.
This value isn't inverted unlike the buttons, of which only button 1 (TL) is present. TR is configured as an output and selects the high or low nibble of the paddle value.

Does anyone know of other games that use the paddle, or if there are any other games that have weird peripherals? I seem to remember a trackball device that could be used with a football game, but I could be thinking of another system.


  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 25 Oct 1999
  • Posts: 2029
  • Location: Monterey, California
Reply with quote
Post Posted: Thu Jan 10, 2002 7:54 pm
Quote
> This value isn't inverted unlike the buttons, of which only button 1 (TL) is present. TR is configured as an output and selects the high or low nibble of the paddle value.

Specifically, if it's set it returns the high nibble, if it's clear it returns the low nibble.

That's about all you need to emulate the paddle, although if you wanted to write software that worked with real paddles, it seems there is some sort of delay that's required between setting port 0x3f and reading 0xdc.

I've also noticed that paddle games generally won't work if port 0x3f isn't properly emulated (as it wasn't in early versions of Smeg, it just returned 0xff)... so that has something to do with how paddles are detected.

One remaining mystery, Out Run 3D, which works with both paddles and joypads, doesn't detect the paddle in Smeg. I have been meaning to investigate what you have to do to satisfy its paddle detection, but if anyone knows offhand (ha HEM bock) I could save myself the trouble.

Quote
> Does anyone know of other games that use the paddle, or if there are any other games that have weird peripherals? I seem to remember a trackball device that could be used with a football game, but I could be thinking of another system.

Woody Pop, Alex Kidd BMX Challenge, Megumi Rescue, and Out Run 3D all use the paddle.

The trackballs were called Sports Pads, I think I have a pair lying around somewhere (ha HEM heliophobe). They were supported for a variation of Great Football called Sports Pad football, as well as a hockey game (possibly Great Hockey, or else they made a seperate Sports Pad version).

There's the Terebi Oekaki thing, as Bock has documented... that's all I can think of.
  View user's profile Send private message Visit poster's website
  • Joined: 28 Sep 1999
  • Posts: 1197
Reply with quote
Post Posted: Fri Jan 11, 2002 4:28 am

Quote
> That's about all you need to emulate the paddle, although if you wanted to write software that worked with real paddles, it seems there is some sort of delay that's required between setting port 0x3f and reading 0xdc.

I've seen this in other systems, for example the TurboGrafx-16 controller has a chip which selects which set of two inputs to return, and after selecting a set you have to wait for a bit for the change to take place.
Otherwise the chip hasn't made the switch and you'll read the old data. Probably the paddle uses something similar to pick the high or low parts of the paddle rotation value.

Quote
> I've also noticed that paddle games generally won't work if port 0x3f isn't properly emulated (as it wasn't in early versions of Smeg, it just returned 0xff)... so that has something to do with how paddles are detected.

Do you mean that some games read port $3F?

Quote
> One remaining mystery, Out Run 3D, which works with both paddles and joypads, doesn't detect the paddle in Smeg. I have been meaning to investigate what you have to do to satisfy its paddle detection, but if anyone knows offhand (ha HEM bock) I could save myself the trouble.

This one is a little confusing. The paddle detection code does the following:

- Make both TH pins outputs and set their output level to high, read them back, and set $C001 to $00 if they are not zero.
- Make both TH pins outputs and set their output level to low, read them back, and set $C001 to $00 if they are not zero.
- Else if the two previous tests returned zero, set $C001 to $FF.

The input reading code uses the paddle if $C001 is $FF, implying that TH would have had to returned zero in both cases. It could be that the paddle changes TH, as it isn't connected to anything in the 2-button pads.

However, this seems to conflict with a test I had tried earlier.
If my Genesis has the console type switch set for 'Megadrive' mode, reading TH when configured as an output always returns zero. Otherwise it returns whatever value TH was assigned to.
For Outrun 3D, the paddle should always be picked in Megadrive mode since TH would return zero in both tests. But I had tried running Outrun 3D with the switch set both ways and the joypad is selected.

Maybe the Genesis does things differently than a real SMS. I'm not really sure.

Quote
> Woody Pop, Alex Kidd BMX Challenge, Megumi Rescue, and Out Run 3D all use the paddle.

Cool, I'll check these out.

Quote
> The trackballs were called Sports Pads, I think I have a pair lying around somewhere (ha HEM heliophobe). They were supported for a variation of Great Football called Sports Pad football, as well as a hockey game (possibly Great Hockey, or else they made a seperate Sports Pad version).

Too bad Marble Madness didn't support it. But I'll try to hunt down Sports Pad Football and see how it accesses the trackball.

Quote
> There's the Terebi Oekaki thing, as Bock has documented... that's all I can think of.

I thought it was pretty frustrating to try to draw with it in Meka, so maybe I'll bother with emulating it when I'm bored someday. ;)


  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8653
  • Location: Paris, France
Reply with quote
Post Posted: Fri Jan 11, 2002 12:58 pm
Quote
> One remaining mystery, Out Run 3D, which works with both paddles and joypads, doesn't detect the paddle in Smeg. I have been meaning to investigate what you have to do to satisfy its paddle detection, but if anyone knows offhand (ha HEM bock) I could save myself the trouble.

Out Run also supports both.
I don't remember off hand, but what I remember is that the detection is completely different for Japanese and non Japanese systems!
Basically on the paddle control, one button is always kept pressed. If you plug one while a normal game is running, it acts this way.

Quote
>> Does anyone know of other games that use the paddle, or if there are any other games that have weird peripherals? I seem to remember a trackball device that could be used with a football game, but I could be thinking of another system.
> Woody Pop, Alex Kidd BMX Challenge, Megumi Rescue, and Out Run 3D all use the paddle.

Out Run does, too. And Galactic Protector, and Super Racing.

Quote
> The trackballs were called Sports Pads, I think I have a pair lying around somewhere (ha HEM heliophobe).

Yeah yeah, it's been a while. Are you receiving my e-mail at mrscreen@hotmail.com, btw ? I don't think I've received any answer from that address since a long time, but I got answers from your smeg address.

As for the Sport Pads, I think SDI supports them, since I saw code for it once when disassembling it. But I've not figured out the detection yet.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8653
  • Location: Paris, France
Reply with quote
Detection
Post Posted: Fri Jan 11, 2002 1:05 pm
How my god, my input code is too messy.
I wrote most of the things a long time ago, before 3F was documented at all, and currently I even wonder how it could work :)

Basically detection works with buttons, button 1 may in fact return what was sent on the TH line.

I think that I'm gonna work out detection of the Sport Pad, and it will be an excuse to rewrite my inputs emulation code from stratch.

Also notice, since this problem puzzled me for a long time, that Super Racing seems to have a bug when two paddle controllers are plugged on the machine.
So on one hand it is a problem for Super Racing, on another Galactic Protector supports two Paddles.
(trivia) That is the reason which made me add the inputs configuration stuff in MEKA.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8653
  • Location: Paris, France
Reply with quote
Woody Pop
Post Posted: Fri Jan 11, 2002 1:07 pm
Also, some informations: for some reasons I can't explain, Woody Pop doesn't play correctly on a non Japanese system (I tried on several systems).
Paddle works for not perfectly. Both sides are ok (when you're set to max left or right), but beside that it shakes a lots between two positions (as if a bit was flip flopping), making the game unplayable.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8653
  • Location: Paris, France
Reply with quote
Out Run Detection code
Post Posted: Fri Jan 11, 2002 1:14 pm
I disassembled this one a long time ago, may be flaws in it.


000000E6: CALL 082Ah ; Detect Nationalization
000000E9: OR A
000000EA: JR NZ,+0Ch >ÄÄÄÄÄÄÄ¿
000000EC: LD B,02h ³
000000EE: LD DE,FFFFh ³
000000F1: DEC DE ³
000000F2: LD A,D ³
000000F3: OR E ³
000000F4: JR NZ,-05h ³
000000F6: DJNZ -0Ah ³
000000F8: LD A,(C109h) <ÄÄÄÄÄÙ
000000FB: OR A ; A==0 -> Japan, A==255 -> Export
000000FC: JR NZ,+1Ch >ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
000000FE: LD BC,0000h ³ ; Japanese detection
00000101: INA (DCh) <ÄÄÄÄÄÄÄÄ¿ ³
00000103: BIT 5,A ³ ³
00000105: JR NZ,+01h >ÄÄ¿ ³ ³
00000107: INC C ³ ³ ³
00000108: DJNZ -09h <ÄÄÄÙ>ÄÄÄÙ ³
0000010A: LD A,C ³
0000010B: LD B,00h (NO PADDLE) ³
0000010D: SUB 60h ³
0000010F: JR C,+29h >ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄijÄÄÄÄÄ¿
00000111: CP 40h ³ ³
00000113: JR NC,+25h >ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄijÄÄÄÄij
00000115: LD B,FFh (PADDLE) ³ ³
00000117: JP 013Ah >ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄijÄÄÄÄij
-- ³ ³ ; Export Detection
0000011A: LD A,DDh ; out DDh to [3Fh] <ÄÄÄÙ ³
0000011C: OUTA (3Fh) ³
0000011E: LD B,37h ; delay ³
00000120: DJNZ -02h ³
00000122: INA (DCh) ; read from [DCh] ³
00000124: AND 20h ; bit 5, save to C ³
00000126: LD C,A ³
00000127: LD A,FDh ; out FDh to [3Fh] ³
00000129: OUTA (3Fh) ³
0000012B: LD B,0Dh ; delay ³
0000012D: DJNZ -02h ³
0000012F: INA (DCh) ; read from [DCh] ³
00000131: AND 20h ; bit 5, save to A ³
00000133: CP C ; calc (A-R) ³
00000134: LD B,00h ; (NO PADDLE) ³
00000136: JR Z,+02h ; if = 0 then: ³
00000138: LD B,FFh (PADDLE) ³
0000013A: LD A,B <ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
0000013B: LD (C107h),A ; save to RAM
0000013D: RET

  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8653
  • Location: Paris, France
Reply with quote
Paste this into a DOS edit to see it properly *nt*
Post Posted: Fri Jan 11, 2002 1:15 pm
Quote
> I disassembled this one a long time ago, may be flaws in it.

>

> 000000E6: CALL 082Ah ; Detect Nationalization
> 000000E9: OR A
> 000000EA: JR NZ,+0Ch >ÄÄÄÄÄÄÄ¿
> 000000EC: LD B,02h ³
> 000000EE: LD DE,FFFFh ³
> 000000F1: DEC DE ³
> 000000F2: LD A,D ³
> 000000F3: OR E ³
> 000000F4: JR NZ,-05h ³
> 000000F6: DJNZ -0Ah ³
> 000000F8: LD A,(C109h) <ÄÄÄÄÄÙ
> 000000FB: OR A ; A==0 -> Japan, A==255 -> Export
> 000000FC: JR NZ,+1Ch >ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
> 000000FE: LD BC,0000h ³ ; Japanese detection
> 00000101: INA (DCh) <ÄÄÄÄÄÄÄÄ¿ ³
> 00000103: BIT 5,A ³ ³
> 00000105: JR NZ,+01h >ÄÄ¿ ³ ³
> 00000107: INC C ³ ³ ³
> 00000108: DJNZ -09h <ÄÄÄÙ>ÄÄÄÙ ³
> 0000010A: LD A,C ³
> 0000010B: LD B,00h (NO PADDLE) ³
> 0000010D: SUB 60h ³
> 0000010F: JR C,+29h >ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄijÄÄÄÄÄ¿
> 00000111: CP 40h ³ ³
> 00000113: JR NC,+25h >ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄijÄÄÄÄij
> 00000115: LD B,FFh (PADDLE) ³ ³
> 00000117: JP 013Ah >ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄijÄÄÄÄij
> -- ³ ³ ; Export Detection
> 0000011A: LD A,DDh ; out DDh to [3Fh] <ÄÄÄÙ ³
> 0000011C: OUTA (3Fh) ³
> 0000011E: LD B,37h ; delay ³
> 00000120: DJNZ -02h ³
> 00000122: INA (DCh) ; read from [DCh] ³
> 00000124: AND 20h ; bit 5, save to C ³
> 00000126: LD C,A ³
> 00000127: LD A,FDh ; out FDh to [3Fh] ³
> 00000129: OUTA (3Fh) ³
> 0000012B: LD B,0Dh ; delay ³
> 0000012D: DJNZ -02h ³
> 0000012F: INA (DCh) ; read from [DCh] ³
> 00000131: AND 20h ; bit 5, save to A ³
> 00000133: CP C ; calc (A-R) ³
> 00000134: LD B,00h ; (NO PADDLE) ³
> 00000136: JR Z,+02h ; if = 0 then: ³
> 00000138: LD B,FFh (PADDLE) ³
> 0000013A: LD A,B <ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
> 0000013B: LD (C107h),A ; save to RAM
> 0000013D: RET
>

  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!