Page 2 of 7

Re: Gameking

Posted: Sun Dec 29, 2013 10:55 am
by lidnariq
Gamekin wrote:Yes I have to learn and study more. But first I have to know what microcontroller I should buy to not buy the wrong stuff and waste too much money.
Honestly, it's really hard to go wrong. ARM, atmega, PIC will all work.
With a 3V Arduino how do I get data to a 5V PC?
Most Arduino and clones use a USB-serial converter and take care of that invisibly.
There are different Gamekings and probably many people in China and elsewhere own one and maybe tried.
If they were in China and tried to dump them, there's no reason to think they'd have written about it in a way that is easy for english speakers to find.
And I don't think that Genesis, GBA and Gameking are that similar.
You're getting stuck on high-level details. Electrically, the thing you're trying to interface, at least for the 128KiB versions, is something that behaves identically to a 3V 27C1000.
Even a Gameboy has many different styles of cartridges.
Yes, banking might be a pain. But once you get something that can implement any part, it's a lot easier to see what you need to do next.

Re: Gameking

Posted: Sun Dec 29, 2013 11:51 am
by Gilbert
Correct me if I am wrong, but I see no indication that Brian had "stopped" his original site. What led to this conclusion?
Instead of "stopping" or removing the site I think he just abandoned it because he was busy with other stuff, and the domain just expired and the site disappeared. It's until fairly recently that he directed the domain name to his twitter page.

Re: Gameking

Posted: Sun Dec 29, 2013 12:12 pm
by Gamekin
I found someone who gave a little more details (not much though) and some advice what I should buy and link to a similar project.

I still have to study much more about that. And I'm not sure if I can handle all that in the near future.
Probably I will order a (cheap) microcontroller . After having ruined some cartridges or the controller, I think I have to pay someone to build that for me or give it up.
I don't want to study for a very long time and waste money and destroy rare cartridges. Maybe I'm not smart enough or didn't spent enough time.

I don't understand Chinese either. Although projects and images would have been found. I even searched the web by typing Chinese stuff. "Gameking" and most games have English titles even in China or elsewhere.
One of the problems is still to find a cartridge slot.

Brian obviously stopped (or paused or abandoned) his project and deleted everything from the web including that particular SourceForge project (robots.txt). He claims to put there an emulator. Nothing to find at all anymore except via archive.org. Also others say that he stopped that.
Yes he is or was obviously busy with something else. What doesn't mean he consider(ed) making money of his knowledge in the future. Maybe there were legal issues or other reasons or he tries to find some cooperation with companies. Gameking 3 and 4 are even more mysterious and rare. I don't know the truth but I still doubt that he will help me. Interesting there are even at least 2 clones of the Gameking. So clones of the clone.

Re: Gameking

Posted: Sun Dec 29, 2013 12:26 pm
by tepples
"Cooperation" looks likely. I'm under the impression Mr. Provinciano blanked his reverse-engineering past to make Vblank Entertainment (his game studio) more attractive to gaming platform gatekeepers such as SNE/MSFT/NTDOY.

Re: Gameking

Posted: Sun Dec 29, 2013 12:32 pm
by Gamekin
That sounds plausible. But he didn't remove his 2 other SourceForge projects, just this one. And he can always be found at archive.org, Wikipedia and elsewhere including this forum.
We can only speculate.

Re: Gameking

Posted: Mon Dec 30, 2013 11:19 am
by Hamtaro126
Since GrandTheftTendo was the original NES version of Retro City Rampage, And the original NES version was recompleted for the Wii as an extra, I highly doubt that things would be valid here (it is an MMC5 rom, same as the old one), does it?

Re: Gameking

Posted: Sun Jan 05, 2014 12:59 pm
by Gamekin
I researched a bit more and almost ordered the dumping stuff.

For the socket: Gameking, GB and GBA sockets seem to have the same contact distance. The Gameking cartridge is similar to the GB cart and the 30 pins seem to be at the same places as the 32 pins of the GB missing the outermost 2 pins. I need pins on both sides, so either use 2 GB slots or at least one slot on the rear and attach wires on front manually or build something custom.

I only have 4-in1 carts. I opened one and it says Rev 1.0 2007E, year 2005. Different pinouts.
Brian claims to have Rev 1.0 but pics and descriptions match Rev 2.0.
I traced the lines and the 4-1 carts obviously have 20 instead of 17 ADR lines. Pins 20,21 and 50 connected to the glob.
Pin 10 is also connected to VCC. Brian said S1 with unknown function.
Pin 15 is NC (Brian said S2).
Pin 46 is connected somewhere to the front PCB (Brian said S3). I can't see exactly where, as text is printed on.
ADR pins are much better arranged making a 45 degree line.
Some other pins seem to be arranged or shifted differently. Pin 29 is attached to the glob on the front side instead of the rear. I can upload PCB pics.

What does that mean, especially for dumping? Bank switching? Pins must be compatible to all Gamekings. Maybe the 4-1 carts have color infos for Gameking 3?

What about emulating? A 65C02 is used. Much of the data are uncompressed graphics (which can be extracted using Brian's editor). The sound probably consists of samples. The rest must be the game code.
Is that simple 6502 code or maybe encrypted opcodes or a custom 6502? Could Brian and LiraLuna managed it that easy with encryption? Graphics are more likely GB based, games NES based. Sound, music and digitized speech of unknown origin. The GB has predefined sound effects, maybe they have been used. But could be any samples. Is NES capable of digitized speech?

An Arduino ProMini 3.3 V is maybe the cheapest solution. 3 more ADR lines is no problem as I need 3 shifting devices anyway. I have rough schematics and tried to wire that up using fritzing.
Can I use pins 2-9 as data lines (analog or digital ?) and what latch pin to choose? Previously I have chosen Pin 6. Latch pin could be chosen but pins on a tiny board are limited and some reserved.
Any advice?

Re: Gameking

Posted: Sun Jan 05, 2014 1:50 pm
by lidnariq
Gamekin wrote:Pin 10 is also connected to VCC. Brian said S1 with unknown function.
Pin 15 is NC (Brian said S2).
Pin 46 is connected somewhere to the front PCB (Brian said S3). I can't see exactly where, as text is printed on.
The S pins look like they are for signalling static content back to the console, with one of 8 numbers specified in binary by tying the lines high or low.
... Although, if one is N/C it might be trinary, but that feels unlikely.
I can upload PCB pics.
That'd be helpful.
What does that mean, especially for dumping? Bank switching? Pins must be compatible to all Gamekings. Maybe the 4-1 carts have color infos for Gameking 3?
It's hard to tell, because the only information we have is that it's a 65C02 at 6MHz, using a very low resolution framebuffer. With 60 whole pins for it, who knows what they did with the extra pins? It could be like the NES or NeoGeo and export the graphics bus to the cartridge, or maybe something else.
Is that simple 6502 code or maybe encrypted opcodes or a custom 6502?
Encrypted is unlikely because doing so would be more expensive. It is probably either a plain-jane 65C02 (CMOS variant) or a SunPlus part (which we believe is a superset of the 65C02 but don't have public documentation)
Is NES capable of digitized speech?
The NES's CPU is fast enough to implement a simple speech synthesizer. There's no dedicated hardware for it.
Can I use pins 2-9 as data lines (analog or digital ?)
All of the pins of the atmega168# that are brought out from the original package can be used fine for digital I/O. (There are two pins that can't be, ADC6 and ADC7, but they are harder to get to)

Re: Gameking

Posted: Sun Jan 05, 2014 2:34 pm
by Gamekin
Thanks.
I will upload PCB pics tomorrow.

On the one hand cart specs must be the same to match the same hardware slot.
On the other hand the whole thing is getting more and more complicated.
Obviously I'm the first in the world figuring out the different cart revisions.
I don't know if I should dare dumping it.

How do I know If I need 3V? 3V GB dumping projects use 5V powered controllers. Don't know about resistor (others use 10k, others say no need) and caps values, timing, software access etc.
Brian claims, one pin could be OE, but he only used CE.
Some controllers have built-in resistors others don't. There seem to be different Arduinos standards. (especially PIN 13). And 3V hardware.
Cart size should be 128k. But how do I know if 4-in1 carts are bigger? And how big? The code would later give the answer. How long would a dump takes at 8MHZ? 5 minutes?

Maybe a simulation like the LCD games would be easier. But needs completely playing a game and recording sound samples. Then drawing each pixel of the graphics by hand (background and character) what is no big deal at this resolution. However it's not the same as emulating.

Re: Gameking

Posted: Sun Jan 05, 2014 3:03 pm
by lidnariq
Gamekin wrote:On the one hand cart specs must be the same to match the same hardware slot.
On the other hand the whole thing is getting more and more complicated.
Obviously I'm the first in the world figuring out the different cart revisions.
I don't know if I should dare dumping it.
The only alternatives are finding someone else who's already comfortable with 3V digital stuff, or leaving it alone.
How do I know If I need 3V?
The Gameking (apparently) runs at 3V, so you should use 3V.
3V GB dumping projects use 5V powered controllers.
The GB and GBC are 5V; the GBA is 3V.
Brian claims, one pin could be OE, but he only used CE.
These are the reasons that having a logic analyzer or oscilloscope would be useful.
How long would a dump takes at 8MHZ? 5 minutes?
That depends entirely on what connection you're using to the computer.
At absolute fastest, you could plausibly read an entire 128KiB game in less than 1/40th of a second, because the cartridge must be able to provide new data every 1/(6MHz) for the CPU to work.
But you don't have the necessary hardware to upload 6MB/sec to your computer. In practice you will probably be uploading stuff at 11kiB/sec or slower (by using 115200 baud asynchronous serial).

Re: Gameking

Posted: Mon Jan 06, 2014 2:33 am
by Gamekin
I don't give up easily, until someone's telling me that it's extremely difficult and the risk of damaging the carts is too high. But people say dumping is easy. And it must be possible with 5V like Brian did. You have to convert the voltage either way to get it to the PC. There are few 3V microcontrollers and they have limitations (hard+software). Anyway here are the pics. I don't think that more pins are used on other carts although there were other manufacturers. There are single games and 4-in1 games. Nothing else. Gameking 3 is probably different, but is backwards compatible playing old games in color like GBC. And I don't think that's a special 6502 as Brian created an emulator and a devcart without problems.

Re: Gameking

Posted: Mon Jan 06, 2014 2:07 pm
by lidnariq
And it must be possible with 5V like Brian did. You have to convert the voltage either way to get it to the PC.
Sure, it's just a lot easier to convert 1 or 2 lines instead of 30. Also, the PC parallel port has run at 3.3V since the mid-to-late-1990s, not 5V as on the original XT, so he was most likely actually using 3V logic to talk to the ROM anyway.
There are few 3V microcontrollers and they have limitations (hard+software).
Whenever I look, I see about twice as many 3V microcontrollers as 5V ones. No idea what's true where you are... Since you're going to have to program a little bit, what experience do you have? There's a fork of GCC for the atmega microcontrollers, so you can program them using C even without the arduino environment. And ARM or MIPS microcontrollers can be used with plain GCC, and it's not too hard to get a hold of a PIC C compiler.
I don't think that more pins are used on other carts although there were other manufacturers.
I agree, it looks like you've got 20 address lines, 8 data lines, and 2 control lines.
I don't think that's a special 6502 as Brian created an emulator and a devcart without problems.
Well, the devcart isn't relevant, since the Sunplus is a superset of the 65C02 is a superset of the 6502, and so even a bare 6502 program would work.
Whether the emulator is relevant really depends on whether the games he dumped use any of the more advances features of the CPU.

Re: Gameking

Posted: Tue Jan 07, 2014 1:05 am
by TmEE
Most of the 5V MCUs run fine at 3.3V, especially AVRs.

Re: Gameking

Posted: Tue Jan 07, 2014 4:35 am
by Gamekin
Although most Arduinos has 5V and 3.3V pins (internal or external voltage ?) the official specs don't recommend 3V. There are very few plain 3 V controllers. The Due (incompatible with other 5V Arduino hardware like shields, other problems and of course more expensive) and some tiny boards, most with fewer pins. So someone recommends a ProMini 3.3 V. A 5V Uno would require a secondary 3V AtMega 1284 controller.
The ProMini needs pin soldering and external USB board and shifting devices. But is probably the cheapest solution. The ProMin has internal (software ?) pull-up resistors but I understand that I better need resistors at the address lines.
Should I use 10k resistors with that 3V board? And a 100nF capacitor at the shifting device ST_CP? The dumping speed was meant with this hardware and Arduino USB connection.

We can only speculate what PC Brian used in 2004. But he told about 5V pulling-up and pulling-down stuff.

PCB pics: So I hope that pin 29 is still A1 although other aligned. Pin 46 is connected (s3) but I don't need it. Where is the 2nd control line? I only know for sure pin 18 CE.
If I don't need games 2-4 is it possible to use fewer address lines? Is bank switching likely here ? Or other dumping problems?

I probably don't have enough programming skills, so that's why I want to use an existing similar project and simply change the values. And why not using the Arduino IDE?

I first have ordered a GBA slot to check if I can use it.

Re: Gameking

Posted: Tue Jan 07, 2014 1:41 pm
by lidnariq
Gamekin wrote:Should I use 10k resistors with that 3V board? And a 100nF capacitor at the shifting device ST_CP?
I'm not clear why you would need resistors? "ST_CP"? You'll need to find me a schematic for me to understand.
The dumping speed was meant with this hardware and Arduino USB connection.
Ah. Arduinos use a standard USB-serial bridge, so you'll probably be transmitting bytes as 115200 baud (as it's the fastest standardized speed). You could probably read a 128KiB ROM in about 12 seconds.
We can only speculate what PC Brian used in 2004. But he told about 5V pulling-up and pulling-down stuff.
Using 3.3V for parallel ports has been standard since at least 1998, so while it's true that we don't know exactly what computer he was using, I doubt it was old enough to be actually running at 5V. He said he was using the Gameking as power rather than using an external adapter, so he was using its 3V supply for everything anyway, including buffering the output of the parallel port. So he dumped it all at 3V, even if he thought otherwise.
PCB pics: So I hope that pin 29 is still A1 although other aligned. Pin 46 is connected (s3) but I don't need it. Where is the 2nd control line? I only know for sure pin 18 CE.
If I don't need games 2-4 is it possible to use fewer address lines? Is bank switching likely here ? Or other dumping problems?
It looks like whatever bankswitching happens here is going to be part of the CPU, not part of the cartridge.
If you look at your photos, there's a bank of 10 on each side (address lines), skip 3, 1 line by itself on each side (control lines), skip one, and a final bank of 4 on each side (data lines).
The control lines are probably "output data on data lines when both control lines are low"
If you need more lines than you have control lines for, you could fix some lines high or low manually and toggle them by hand, to dump N KB slices at a time and then reassemble them later.
I probably don't have enough programming skills, so that's why I want to use an existing similar project and simply change the values. And why not using the Arduino IDE?
The software is really simple, and I think you could even do this without a reference to adapt from. As long as the arduino IDE works, there's no reason to not use it.