PowerGlove Problem: Famicom with US Cart

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
PowerGlove Problem: Famicom with US Cart
by on (#142309)
Hi all, this is probably a stupid question but i've come up against a brick wall and am looking for advice, you guys look like the right place to turn for NES related issues so here it am, lets see if anyone can help.
So i'm in the UK and wanted a Powerglove, obviously PAL units are the most expensive so i took that option off the table, i bought a Famicom glove instead because i have a Twin Famicom, this works well with the glove on Famicom carts and also on my PAL carts (inserted using a 72pin - 60 pin adapter) though of course those play in a sped up format. I bought a copy of Super Glove Ball because obviously its a game designed specifically with the Powerglove in mind and i figured it'd be fun to play but this is where i've run into a problem;
The game is only available as a US release as far as i'm aware but it plays fine on my Twin Famicom (again using the adapter) with the built in control pad, obviously there is no speed up as both the Famicom and US NES work at the same speed so the game is playing as it should. However when i attach the glove and try to play my luck seems to run out, the glove beeps to start up, then beeps 5 times which i assume indicates that the automatic programming from the cartridge has been uploaded to the glove (as this uses a special program contained on the cartridge)? The LEDs seem to be responding correctly but i can't get the game past the title screen, it wants me to press start but ignores the start button on the glove (which i know works in other games) if i press start on the control pad the game starts but ignores the glove and is controlled by the pad instead.
Obviously i'd like to be able to use the Powerglove with this game to really get a feel for it but i'm out of ideas, i can only assume that it's because i'm using a Famicom rather than a NES and unlike other games this one does not get the glove to emulate a pad but instead uses the glove as a unique controller and theres some kind of problem for the software running on the famicom?
Any help anyone can provide would be greatly appreciated, my technical knowledge is limited but i can follow instructions, thanks for your time and thanks in advance for any help you can give

Matt
Re: PowerGlove Problem: Famicom with US Cart
by on (#142311)
The Famicom gets two different signals for the two wired controllers, and the expansion port, so the game software explicitly has to support the expansion port for something plugged into it to work. Many US-market NES games do not support the Famicom expansion port.

Either you can patch the ROM you want to play with added support, or you can wire your PowerGlove directly into the system (replacing the wired controllers), or you could get an NES extension cable and use it to add NES-type controller sockets for the wired controllers, which would let you change things easily.

Actually, I don't know which data lines the PowerGlove needs to use. (Nobody has documented it on the wiki yet...) There are a bunch of weird differences about which data lines are connected where between the Famicom and NES. If it uses more than the one line that standard controllers use, that might be why you're seeing partial functionality through the expansion port, but it might be tricky to connect to the Famicom.
Re: PowerGlove Problem: Famicom with US Cart
by on (#142312)
rainwarrior wrote:
The Famicom gets two different signals for the two wired controllers, and the expansion port, so the game software explicitly has to support the expansion port for something plugged into it to work. Many US-market NES games do not support the Famicom expansion port.

Either you can patch the ROM you want to play with added support, or you can wire your PowerGlove directly into the system (replacing the wired controllers), or you could get an NES extension cable and use it to add NES-type controller sockets for the wired controllers, which would let you change things easily.

Actually, I don't know which data lines the PowerGlove needs to use. (Nobody has documented it on the wiki yet...) There are a bunch of weird differences about which data lines are connected where between the Famicom and NES. If it uses more than the one line that standard controllers use, that might be why you're seeing partial functionality through the expansion port, but it might be tricky to connect to the Famicom.


hmmmm i'm assuming that patching support would be pretty much impossible (despite probably being the best option) as i have absolutely no idea what i'd be doing there which leaves me with the option of modding the hardware itself, how simple would that be? am i going to find the same wires in the cable going into the expansion port as i am in the wires going from the control pad? if so i assume i could use some kind of generic socket (with the right number of connectors) to allow swapping between the pad and the glove?
Re: PowerGlove Problem: Famicom with US Cart
by on (#142313)
Patching the ROM would probably be very easy for a lot of people here, I'm sure somebody could help you with that.

The harder part is getting the ROM on the cartridge. If you've got something like an Everdrive or PowerPak it's really simple, otherwise you'd need to burn an EPROM and solder it into the cartridge.

We might need to know about the adapter you're connecting the PowerGlove through. Does it connect all the data lines from the NES controllers, or does it just connect the controller's D0 to the famicom expansion port's D1? (Do you know what kind of adapter it is, have a schematic, or a multimeter to test it with?)
Re: PowerGlove Problem: Famicom with US Cart
by on (#142314)
rainwarrior wrote:
Patching the ROM would probably be very easy for a lot of people here, I'm sure somebody could help you with that.

The harder part is getting the ROM on the cartridge. If you've got something like an Everdrive or PowerPak it's really simple, otherwise you'd need to burn an EPROM and solder it into the cartridge.

We might need to know about the adapter you're connecting the PowerGlove through. Does it connect all the data lines from the NES controllers, or does it just connect the controller's D0 to the famicom expansion port's D1? (Do you know what kind of adapter it is, have a schematic, or a multimeter to test it with?)


Wow! that'd be great if someone could, i'm sure i can borrow an EverDrive from someone, i know a few people with them.
The Powerglove is connected directly to the Famicom as per the out of the box setup, as the Jap version simply has a Fami expansion plug on the end instead of a NES plug (all versions of the the glove itself have a standard Genesis/Atari style connector which goes into a little box which is attached to the sensors and then plugs into the console via the expansion port for Fami or controller port 1 for NES) so i'm not using any kind of extra adapter. the only adapter i'm using is to allow the 72pin Super Glove Ball NES cart to be fit the 60pin Fami cartridge port, hope that helps, massive thanks for your help so far

edit: in basic terms im assuming the problem is that Glove Ball is looking for control inputs coming from controller port 1 but on the Fami controller port 1 is always a standard controller while the glove connects via the expansion port, so essentially we want to tell the game ROM to stop looking at controller port 1 and look at the expansion port instead
Re: PowerGlove Problem: Famicom with US Cart
by on (#142318)
Oh! I didn't realize there was a Japanese version of the Power Glove! That makes this easier. Yeah, don't do any hardware mod then, we should just patch the game.

So... there's a Japanese version of Bad Street Brawler, but not Super Glove Ball, right? Should be pretty easy to look at the differences between the two BSB versions and create a patch for SGB.
Re: PowerGlove Problem: Famicom with US Cart
by on (#142319)
Or... no. There was never a Japanese Bad Street Brawler. There was a Power Glove release, but no games? Hrm. I don't have any reference to go by, then. Do you have any way of testing the pinout of the Power Glove adapter you have? A multimeter maybe?
Re: PowerGlove Problem: Famicom with US Cart
by on (#142321)
Okay, after some digging around, it seems like the Power Glove doesn't use the other data lines anyway, everything goes in through the standard $4016 write (which is why you can see it being "programmed"), and everything comes out through D0 normally, but D1 on your Famicom, which is why it will work with some games, but not the US made Glove Ball.

Presuming this, I think a patch to Glove Ball would be straightforward. Find all the $4016 reads, and patch them to do D0 = D0 | D1, though finding them all might be tricky, since I can't seem to find a debugging emulator that emulates the Power Glove. :S Might not be too bad though.
Re: PowerGlove Problem: Famicom with US Cart
by on (#142341)
Wow, you've been busy while i've been asleep :lol:

rainwarrior wrote:
Or... no. There was never a Japanese Bad Street Brawler. There was a Power Glove release, but no games? Hrm. I don't have any reference to go by, then. Do you have any way of testing the pinout of the Power Glove adapter you have? A multimeter maybe?


Yeah it's a weird thing, in Japan the Powerglove was marketed purely as a different way to control games so was only used with existing games, no new software came out for it (though i think the instructions still mention special software) it's the same with the European glove too. Yeah i've got a multimeter if there's anything specific you wanted me to look at?

rainwarrior wrote:
Okay, after some digging around, it seems like the Power Glove doesn't use the other data lines anyway, everything goes in through the standard $4016 write (which is why you can see it being "programmed"), and everything comes out through D0 normally, but D1 on your Famicom, which is why it will work with some games, but not the US made Glove Ball.

Presuming this, I think a patch to Glove Ball would be straightforward. Find all the $4016 reads, and patch them to do D0 = D0 | D1, though finding them all might be tricky, since I can't seem to find a debugging emulator that emulates the Power Glove. :S Might not be too bad though.


so is D0 D1 etc just a reference for controller ports (sorry i literally have no idea abut this and am trying to educate myself a little while i'm here) in which case wouldn't the expansion slot be D2? because there are 2 control pads and then the expansion port or does it not work like that?
I think the reason it works with other (non glove specific) games is because when you're using it to play Punch Out or Rad Racer etc the glove is simply emulating a control pad so it detects your motions and converts them into a button press which is then sent to the console whereas with Gloveball and most likely Bad Street Brawlers too the game has a totally different way of using the glove, from what i can see the number of "buttons" for example is increased with specific "moves" only being possible with the Powerglove and not a regular control pad, i believe one such example is the ability to twist the on screen glove? i think this can only be done with the Powerglove and not a control pad

Lastly if all you need to do is change all D0 references to D1 is there not some sort of find and replace option you could use in whatever editor you use for this job? (sorry i'm probably being very thick here, it just strikes me that when i've edited other types of code (mainly HTML in the past) find and replace is an easy way of not missing any references, but of course this is jsut my simplistic view of an undoubtedly complex task :)
Re: PowerGlove Problem: Famicom with US Cart
by on (#142346)
ReplayRetro wrote:
so is D0 D1 etc just a reference for controller ports

No, these are references to the individual bits read back from the controller ports. Controllers normally return data in bit 0 (D0), but Famicom controllers plugged to the expansion port return data in bit 1 (D1). "D" stands for "data" I believe.

Quote:
Lastly if all you need to do is change all D0 references to D1 is there not some sort of find and replace option you could use in whatever editor you use for this job?

Not really, because each game uses different code for reading input... there are literally hundreds of ways of checking the value of a bit, so there isn't a constant string you can search for. Also, the code you have to replace the original with could be larger than the code being replaced, meaning you couldn't simply overwrite the original, you'd have to shift things a bit in the ROM to make room for the new code.

Each game has to be individually debugged, and once you find its input reading routine you have to redesign it so that bit 1 isn't ignored and make sure it fits in the ROM. It's not a difficult process at all, but it's not simple to the point where it can be automated.
Re: PowerGlove Problem: Famicom with US Cart
by on (#142347)
Ah ok I see thanks for the clear explanation, so realistically how likely is it that someone on here will be willing and able to attempt to do this?

also as another option how possible would it be to take a famicom extension cord and wire it into the player one control input to allow the glove to plug in as controller 1? would that even work? (i'm guessing the expansion port has more pins than the internal controller port)
Re: PowerGlove Problem: Famicom with US Cart
by on (#142353)
1. As tokumaru was saying, it can't be automated, but it's not difficult for someone who knows what to do. It might require a few tries to hunt down all the input code. If you get yourself a flash cart I'd be willing to give it a try for you, and others here might be willing if I were unavailable by then. It will probably take a few tries, since we can't really test it on an emulator.

2. Yes, if you wired the powerglove directly into the wired controller port, it should just work. (In theory.) The NES has two extra pins on controller 1 (D3 and D4) (pinout) that the Famicom didn't have, but almost no controllers use them, and I don't think the powerglove does either, so it's largely not a problem.

If you look for "NES extension cable" you can find a cable with a female/male NES controller connector that would be easy to use for this. Just cut the famicom wired cables in the middle, and solder them up to the ends of the extension cable. This would let you use NES controllers (and the powerglove) with your Famicom, and make your wired controllers detachable.

3. I know you said your powerglove works with games you've tried, but do you have any games made outside of Japan like Solar Jetman or Battletoads that you could plug in with the 72-60 pin adapter? Many non-Famicom releases don't listen for D1; these ones in particular should only work with the wired controllers.
Re: PowerGlove Problem: Famicom with US Cart
by on (#142354)
rainwarrior wrote:
1. As tokumaru was saying, it can't be automated, but it's not difficult for someone who knows what to do. It might require a few tries to hunt down all the input code. If you get yourself a flash cart I'd be willing to give it a try for you, and others here might be willing if I were unavailable by then. It will probably take a few tries, since we can't really test it on an emulator.

a friend has said he'll lend me his NES flash cart to test the modified ROM and obviously i'll connect that using my 72>60 pin adapter so getting hold of the cart isn't a problem if you're willing to try for me, this offer is greatly appreciated by the way, this is undoubtedly the most helpful forum i've ever been in, most places you'd get torn apart for asking questions whereas here you genuinely seem to want to help, so thanks for that

rainwarrior wrote:
If you look for "NES extension cable" you can find a cable with a female/male NES controller connector that would be easy to use for this. Just cut the famicom wired cables in the middle, and solder them up to the ends of the extension cable. This would let you use NES controllers (and the powerglove) with your Famicom, and make your wired controllers detachable.


the famicom powerglove doesn't have a standard NES style connector as its designed for the expansion port which uses the same connector as Neo Geo consoles, i figure i could use a Neo Geo expansion cable somehow to do a similar thing? but god knows where everything would be soldered

rainwarrior wrote:
3. I know you said your powerglove works with games you've tried, but do you have any games made outside of Japan like Solar Jetman or Battletoads that you could plug in with the 72-60 pin adapter? Many non-Famicom releases don't listen for D1; these ones in particular should only work with the wired controllers.


so far the NES (pal) carts i've tried are Double Dragon, Mario Bros and Punch Out, not sure if i have any games that weren't released in Japan, are you asking this because you wanna see if they will ignore the expansion port as well? with your thinking being that games which had a release in Japan as well as western markets will include the code for the expansion port (and thus will work with the glove) whereas games which were only released outside Japan will not have this code (and won't work)

UPDATE: i just tried it with McDonaldland/McKids which i believe was never released in Japan, and once again the Powerglove didn't work, so clearly as you suggest the problem is that games not released in Japan don't include the code for using the expansion port, hope this helps :)

also just tried Snake Rattle N Roll, the glove controls were ignored by the game once again, however i also tried Tale Spin and that worked
Re: PowerGlove Problem: Famicom with US Cart
by on (#142355)
Yeah, just thought I'd mention it in case you had any lying around. Any developer that worked with Nintendo would have been told to listen for D1 in their controller read code for Famicom expansion controllers, but outside of Japan it wasn't necessary, and if you were an unlicensed developer you might have had no way of knowing about it.

Battletoads US doesn't do it, but they later made a release in Japan that does (with modified levels too, one of the few cases where the Japanese version is actually the easier one). Solar Jetman doesn't, and never had a release in Japan. I think the Codemasters games have this problem too. Can't remember any more examples offhand.
Re: PowerGlove Problem: Famicom with US Cart
by on (#142380)
Ok well it sounds like that confirms the nature of the problem so altering the rom is probably the way to go? So where do we go from here?
Re: PowerGlove Problem: Famicom with US Cart
by on (#142381)
Do you already have an Everdrive/PowerPak ready?
Re: PowerGlove Problem: Famicom with US Cart
by on (#142397)
i've not picked it up off my friend yet but i could easily do so as early as tomorrow, he has the NES everdrive (i think its called the N8 or something like that?)
Re: PowerGlove Problem: Famicom with US Cart
by on (#142400)
Okay, well, I'll put it on my list of things to do and try to find some time in the next few days to prepare a test patch (unless someone else is interested in doing it, in the meantime).
Re: PowerGlove Problem: Famicom with US Cart
by on (#142401)
ok that's brilliant, thanks for your time, hope to hear from you soon :)
Re: PowerGlove Problem: Famicom with US Cart
by on (#144781)
I've attached a potential patch for Super Glove Ball. Please test it out and let me know if it works.

I also looked at Bad Street Brawler, but it seems to do the correct thing when it reads the controller. Could you play Bad Street Brawler and tell me if that game works? (No patch should be needed.)

The patch was pretty straightforward, there were only a few places in the code that seemed to be reading the controller, and they were all in the fixed bank.

Code:
; replacements for lda $4016 and lda $4017, placed in unused region at $FFEA
patch2:
        lda     $4017
        jmp     patch_common
patch1:
        lda     $4016
patch_common:
        and     #3
        cmp     #1
        rol     a
        rts

; patch at $DC74
:
        ;lda    $4016
        jsr     patch1
        ror     a
        rol     $2A
        ;lda    $4017
        jsr     patch2
        ror     a
        rol     $2C
        dex
        bne     :-

; patch at $DD03
:
        ;lda    $4016
        jsr     patch1
        lsr     a
        rol     $24
        ;lda    $4017
        jsr     patch2
        lsr     a
        rol     $2C
        dey
        bne     :-

; patch at $DD3D
:
        ;lda    $4016
        jsr     patch1
        lsr     a
        rol     $24
        dey
        bne     :-
Re: PowerGlove Problem: Famicom with US Cart
by on (#144944)
Excellent work, thanks, it seems to be working, control is a little sketchy but i think that's likely to be the actual glove rather than anything else, i'm going to try it on a smaller TV later and see if that helps.
Also took a look at Bad Street Brawlers and you're right, it seems to work fine so it must just be that Glove Ball was coded for the US market only, i think BSB is a conversion of something else though so that could explain it too as it may already have been designed to work with the expansion socket on the famicom.
The only problem i'm really having is that sometimes the game doesn't seem to load the instructions to the Glove, but i think that's an issue with the flash cart as the glove isn't getting the instructions as soon as the console boots, seems to work 70% of the time though at least.
Thanks for your work, i really appreciate everything you've done for me