Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component list #1

Open
dennisjanssen opened this issue Feb 10, 2021 · 11 comments
Open

Component list #1

dennisjanssen opened this issue Feb 10, 2021 · 11 comments

Comments

@dennisjanssen
Copy link

Hi!

First of all, great project! I've been looking for an easy DIY method of making one of these. From what I can tell it's still WIP, but your goal is to be able to flash a new ROM to an unlocked flash cart?

I've been looking at the PCB files, from what I can tell I'll need these components:

And then just order the PCB from PCBway, JLCPCB, ...

If I got all of that right I'll start ordering and build one.

@X-death25
Copy link
Owner

X-death25 commented Feb 10, 2021

Hi,
Yes sorry i missed the part list 👍
so :

74LS273N : https://fr.aliexpress.com/item/32879353216.html
GB/GBC cartridge slot : https://fr.aliexpress.com/item/33007365661.html
100nF condensator ( can works without but it's better ) : https://fr.aliexpress.com/item/1005002060914434.html
STM32 ( i recommand the Rebotdyn design for better USB support but blue pill can works too :
https://fr.aliexpress.com/item/3301602535

Code steel need some flash compatibility improvement but yet you can dump any GB/GBC games and R/W saves.

And then yes just drag the gerber files on any PCB builder shop.
Wish you great build !

@dennisjanssen
Copy link
Author

This is great, thanks! Any idea on cartridge compatibility? I'm guessing it takes some custom work based on the cartridge chipset, since most flasher list these. Any recommendations?

@dennisjanssen
Copy link
Author

dennisjanssen commented Apr 8, 2021

EDIT: Ignore this comment, see below.
Just in case any other total noob like myself reads this afterwards, a USB TTL adapter apparently is also pretty useful when you order an STM32 that doesn't come preflashed.

I ordered this one: https://nl.aliexpress.com/item/4000308135007.html?spm=a2g0s.9042311.0.0.7b984c4dJZShqL

@X-death25
Copy link
Owner

X-death25 commented Apr 10, 2021

Hi,
you can also use ST-link clone and official STM32 ST-link utility

https://fr.aliexpress.com/item/1827010981.html?
After that i use this bootloader for dev
https://github.com/rogerclarkmelbourne/STM32duino-bootloader
and this for release ( user don't need to install driver for the second)
https://github.com/Serasidis/STM32_HID_Bootloader

Please tell me if you will do some code modification or if you have some issue with some GB cartridge.
AS i'm said i'm be able to dump all of my GB/GBC cartridge collection , some users report me issue with some MBC5 based games.

@dennisjanssen
Copy link
Author

You are probably right, not having much luck with the USB-TTL adapter in any method available. Ordered an ST-LINK programmer on AliExpress now, so I'll be waiting for a while now.

I do have some cartridges around, as well as a bunch of Chinese reproductions, so very curious about compatibility. I noticed you added flash capabilities too, would be very interesting to flash ROMs to those Chinese cartridges. I'll keep you posted on progress!

@dennisjanssen
Copy link
Author

I managed to get it working with a UART adapter after all, got the HID bootloader on there and managed to flash your firmware through the script, so I'm fully done hardware wise!

Started testing with some cartridges, managed to dump one (type C9 according to the dumper), but you're right, Pokemon Red (MBC5) is giving me trouble. Also tried to dump a bootleg cartridge, which gave me a .gb file with the correct size, but it's not functional. Also tried to flash one of those with another ROM, no luck. What did work on that bootleg cartridge was erasing flash, it now says it's empty and will only return an empty .gb file when dumping. Weirdly enough the cartridge still works fine in a GameBoy, the ROM is still there.

@dennisjanssen
Copy link
Author

Sorry to spam these comments, but I've been combing through code and looking up other examples to add compatibility with more types of cartridges, when I came across this: https://github.com/lesserkuma/FlashGBX

They seems set up in a way that allows them to add more hardware devices to their flashing/dumping software and already offer a very broad range of different cartridges. Maybe it's a good idea to collaborate? Connect their software with your firmware to offer a very complete solution?

@X-death25
Copy link
Owner

X-death25 commented Apr 20, 2021

1)Good to read you have sucessfully flashed it , now with bootloader inside , update will be easier.
Did you have troubles with a lot of cartrige ?
Some games with MBC5 dumps correctly for exemple Oracle of Seasons.
Lots of chinese cartridge bootleg use crappy flash with no level shifter or some uncommun mapper clone.
Can you report me game that's don't works correctly ?
I don't have Rewritable GB cartridge in my hand so can't do real hardware test for reflash memory.

2)Github links you show it's just a graphical interface for GBxCart and not include mapper support ( these code are in GBxCart firmware and maybe not open source).
Also seems to use serial communication and not bulk USB like me.
GBxCart use Atmel 5V processor for better compatibility but harder to solder and costs a lot more.
All of YAGB design is open source so feel free to do what you want with it.

@dennisjanssen
Copy link
Author

So far Pokemon Red gave me trouble, Power Rangers The Movie worked fine. But I'll test a bit more to rule out I have hardware trouble or something.

On the software side, bear with me. And quick disclaimer, I barely consider myself a programmer, so I might have all of this wrong. I took a look at GBxCart since they seem to have the broadest support for all kinds of cartridges. Turns out their firmware isn't exactly closed source, I found it here: https://github.com/insidegadgets/GBxCart-RW/blob/06b1ac4196e76209cee02668608f618dbebd87ed/MCU_Files/GBxCart_RW_v1.3_R22/main.c

I was expecting to see mappings for different kinds of cartridges as well, in that file. I haven't found much in there, but maybe I'm looking in the wrong places. As far as I can tell they handle this a bit more backwards than YAGB, where the software part handles the logic and mapping and the firmware just does the reading and writing parts. But you're way better placed to estimate that I suppose.

Anyway, next I started looking into how they communicate between software and firmware, to figure out how that works. FlashGBX seemed like a good place to start since they had to figure out the same thing. As far as I can tell the makers of FlashGBX didn't intend to only work with GBxCart, they even separated the hardware integration in a separate file (https://github.com/lesserkuma/FlashGBX/blob/master/FlashGBX/hw_GBxCartRW.py) that is loaded into an array of devices (https://github.com/lesserkuma/FlashGBX/blob/master/FlashGBX/FlashGBX_GUI.py#L11). That hardware file also seems to hand off certain functions to the firmware (like GBA_FLASH_WRITE_BYTE), which are named the same in the GBxCart fimware. In their commits I found indications that they added support for different kinds of cartridges, which struck me as weird because I also expected that part to be handled by the GBxCart firmware. Turns out they have a massive pile of config files for different types of cartridges (https://github.com/lesserkuma/FlashGBX/tree/master/FlashGBX/config), I'm guessing that's the mapping you mentioned?

Again, I might look at this all wrong (sorry if that's the case), but I think both FlashGBX and the GBxCart firmware have a lot of parts that might be useful for you to add more compatibility (or even troubleshoot the MBC5 cartridges). But it might even be interesting to update the firmware and work on a hardware file with the FlashGBX guys in order to piggyback on a lot of work they already did?

@X-death25
Copy link
Owner

X-death25 commented May 9, 2021

Hi,
i have made a special exe for MBC5 issues.
Could you test these file with your Pokemon Red or other MBC5 games will bad dump ?
https://github.com/X-death25/YAGB/blob/main/Software/GB_Dumper_mbc5.exe

Greetings

@dennisjanssen
Copy link
Author

Right now I'm having issues reading any cartridge so I opened up the cartridges I have and found my Pokemon Red is actually an MBC3. Also have another official MBC1 and 3, none are MBC5. I also notice in the software none of the header tags are being read correctly, so I'm guessing I messed up some hardware and that's what causing my issues. Parts for a new reader are on their way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants