Recent Posts

Pages: 1 ... 8 9 [10]
I suppose… In a way, I don't want to implement the fix myself, since I'd be tempted to make it properly correct and not just put a band-aid on it – which might take a lot of time and work. But… on the other hand, I guess I wouldn't be opposed to making sure it gets done right, and I do know the ins and outs of the issue.

Where can I get in contact with Matthias?
You may want to reach out to Matthias to see if you can get the Retrode's source code to implement the fix. That is, of course, if you have the time/desire to do so.
The problem

Lately, I've been researching an as of yet obscure Game Boy cartridge mod, where you switch out the SRAM chip for a non-volatile FRAM chip, effectively making the cartridge's saves immortal. Long story short, to make this mod compatible with some of the more obscure features of the Game Boy, the memory's chip enable pin has to be connected to an OR of the normal signal (the MBC's ¬RAMCS) and the cartridge bus's clock signal (CLK), meaning that the RAM chip (¬CE) is only active when both of those are low. This works A-OK on console – both saving and loading work perfectly! However, the Retrode (firmware version 0.25) can neither read nor write successfully to the saves of these modded cartridges.

The symptoms are awfully strange: writing overwrites every byte with 0xFF, and reading turns all 0x00s (and only 0x00s!) into 0x02! This screamed "timing issue" to me, so I checked out the signals, and indeed – the Retrode pulses the signals completely unlike the Game Boy does!


I connected up an oscilloscope up to both a Game Boy Advance and to the Retrode to compare how they pulse the signals when reading and writing SRAM. Check out the results!

YellowCLKThe console's generated clock signal. Constantly pulses on console. Pin 2 of the cartridge connector.
Pink¬RAMCSThe MBC's "activate SRAM" signal. Active low. A pin on the MBC (which one depends on the MBC).
Blue¬RDPuts the save memory into read mode (or not, depending on MBC). Active low. Pin 4 of the cartridge connector.
Green¬WRPuts the save memory into write mode (or not, depending on MBC). Active low. Pin 3 of the cartridge connector.



A one-byte read from an MBC5 game on console running in double-speed mode:

¬WR is constantly inactive, ¬RD is constantly active, and CLK pulses at a constant rate of ~2.1 MHz (as it always does). ¬RAMCS goes active for ~400 ns. Not pictured is that the Game Boy samples the data lines at the midpoint of CLK being low while ¬RAMCS is active.


In comparison, two bytes (I think?) read from an MBC5 game on a Retrode:

As you can see, it looks quite different. For starters, ¬WR is constantly asserted active alongside ¬RD, which is a bit befuddling – ¬WR shouldn't be active when reading. ¬RAMCS goes active for ~9 µs, during which CLK pulses 10 times. CLK doesn't pulse outside of ¬RAMCS being active. When the Retrode samples the data lines I don't know, but given that CLK pulses ten times, I wouldn't think it's in the middle of any specific one of those.



A one-byte write to an MBC5 game on console running in double-speed mode:

CLK pulses at a constant rate of ~2.1 MHz (as usual). ¬RD goes inactive at the same time ¬RAMCS goes active. The next time CLK goes low, ¬WR goes active with it. ¬WR goes inactive a little bit later, after which ¬CLK goes high and brings ¬RAMCS to inactive and ¬RD active with it. Not pictured is that the Game Boy makes data available on the data lines at the same time as ¬WR goes active.


A one-byte (I think?) write to an MBC5 game on a Retrode:

I don't quite know what's going on here. At the beginning of the entire length of bytes written, ¬RD briefly goes active (probably just incidentally), after which it goes inactive again and stays that way for the rest of the write. ¬WR is constantly active. ¬RAMCS goes active for ~10 µs, during which CLK pulses 10 times. ¬RAMCS then goes inactive again, and… CLK pulses 10 more times? When the Retrode makes the data available I haven't checked.

For a more formal reference for the console timings, see appendix C of GB-CTR. To note is that GB-CTR uses the name "PHI" for the signal called "CLK" above, and that it documents normal-speed mode – multiply the frequencies by 2 to get the timings for double-speed mode.

The fix

The technically correct fix for this is, of course, to rewrite a bunch of code and make the Retrode's timings more or less match those of the Game Boy. The specific lengths of the pulses aren't immensely important – after all, the Game Boy Color can run at twice the speed of the Game Boy – but the order of rises and falls is. This way, the Retrode is guaranteed to be timing-compatible with anything that works on console. However, the particular case I mentioned can be solved with smaller modifications.

The reason reading doesn't work is probably because the data lines are sampled either while CLK is high or hasn't been low for very long (thus trying to read while the chip is disabled or not ready) – so moving that sampling to a time when CLK is low (and has been low for at least 100 ns) would fix reading.

As for writing, I'm not sure what exactly the issue is! It may be the same thing there – the Retrode could be making data available while CLK is high or similar.

I'd also recommend only one CLK pulse per byte read/write – it's not strictly necessary for this case, but… the current 10× pulse behavior is weird, and might waste memory write cycles when that's wired up to CLK.

I hope that this can be fixed soon! As the batteries of MBC5 games run out in greater and greater numbers, and word of this mod gets out, I expect mods like these to become more pervasive. It'd be nice if the Retrode could handle it correctly!
Support / Re: Cannot get n64 plugin to work.
« Last post by newbie2 on 05/Apr/2019 01:29:56 AM »
Nothing additional comes to mind. I just updated to .25a and tested on a mac, but mine is working fine. Maybe reach out to dragonbox and ask them to verify that the plugin is working for them?
Support / Re: Cannot get n64 plugin to work.
« Last post by mrhappyasthma on 04/Apr/2019 04:59:01 AM »
My existing configuration is:

Code: [Select]
; Retrode .25a-beta - Config
; Remove any line to revert setting to factory default

[HIDMode] 2 ; 0: Off; 1: 4Joy+Mouse; 2: 2Joy; 3: KB; 4: iCade
[blinkControllers] 1

[nesMode] 0         ; 1: NES gamepads; 0: SNES

[filenameChksum] 1  ; checksum in filename? 0=no, 1=yes
[detectionDelay] 5  ; how long to wait after cart insertion/removal
[saveReadonly] 1    ; write protect save? 0=no, 1=yes
[segaSram16bit] 1   ; 0=no, 1=yes, 2=y+large
[sramExt] srm
[snesRomExt] sfc
[snesOverdump] 1    ; overdump correction? 0=no, 1=yes
[snesRomVer] 0      ; version instead of checksum? 0=no, 1=yes
[segaRomExt] bin
; Override autodetect:
[forceSystem] auto
[forceSize] 0
[forceMapper] 0
; Optional plug-ins:
[n64RomExt] z64
[gbRomExt] gb
[gbaRomExt] gba
[smsRomExt] sms
[ggRomExt] gg

Updating the forceSystem to n64 does not do anything different:
Code: [Select]
[forceSystem] n64.

Support / Re: Cannot get n64 plugin to work.
« Last post by newbie2 on 03/Apr/2019 12:54:32 PM »
Sorry I was thinking of another system. Regarding orientation, at least on the ones Matthias made the instructions were correct and the n64 game works oriented with its label on the same side as the label on the plugin (so label facing out).

This should be more pertinent: Is [forceSystem] set to anything other than auto? Could you see what happens to set it to n64?
Support / I need help getting Final Fantasy Tactics Advance to work
« Last post by cpwzhr on 03/Apr/2019 08:34:41 AM »
I am not able to get Final Fantasy Tactics Advance (for GBA) to boot in an emulator. The game worked fine on an actual GBA so I went searching for an answer. The solution that has worked for many people encountering issues with GBA games is to edit the RETRODE.CFG and set [forceSystem] to "auto" and [forceSize] to "16" (16 MB in my case Final Fantasy Tactics Advance is a 128mbit game). I still can't get the game to boot I just encounter a black screen. Any suggestions?
Support / Re: Cannot get n64 plugin to work.
« Last post by mrhappyasthma on 03/Apr/2019 05:34:08 AM »
I'm plugging it into the Genesis cartridge slot. (Same as the other plug-ins). It wouldn't even fit onto the prongs for the snes slot.

The instructions say to have the game face the same direction as the label on the plugin. Just to be encompassing I tried both orientations. I confirmed that when it was backwards it did not work and the LED would not turn on. But putting it in the correct orientation will get the LED on, but the computers never show the ROM.
Support / Re: Cannot get n64 plugin to work.
« Last post by newbie2 on 02/Apr/2019 01:50:40 PM »
Just to rule it out as the problem, what slot are you plugging the n64 plugin into?
Support / Cannot get n64 plugin to work.
« Last post by mrhappyasthma on 01/Apr/2019 07:31:49 AM »
I purchased the Retrode 2 and all the plugins from I have no problem with gameboy, SNES, or Genesis games. But the n64 games won't work.

I flipped the switch to 3.3v. I've tried multiple games (all of which were cleaned with q-tips and rubbing alcohol). No luck.

The green LED on the front of the device lights up when I plug a game into the plug-in slot, but I only see the retrode.cfg file. I don't see the n64 game at all.

I tried on both a PC and a Mac, the behavior is the same.

According to the Mac Retrode tool, I'm running firmware 0.25a, which from what I can tell is the latest.

Any help would be appreciated.
Pages: 1 ... 8 9 [10]