Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2020-12-28 19:37:56

K5T3
Member
Registered: 2020-12-28
Posts: 19

Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

I may be extremely lazy, so here it goes.

I have the codes for dumping the BIOS of Super GB, Super GB2, and GBC.

Code:

https://jumpshare.com/v/VFxBI4E8Owh2cc0La6on

I am new to these codes, and I seriously need a help with this situation.

If anyone can help me on this situation, I will be very much appreciated.


Nintendo rules!

Offline

 

#2 2020-12-28 20:30:38

nitro2k01
Administrator
Registered: 2008-02-22
Posts: 242

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

Hi. What is the goal you're trying to achieve? To use that code you need some sort of hardware glitch setup that you can use bypass the boot ROM lockout, which would require you to open up the Gameboy and solder to the main board. But unless you have some unreleased Gameboy hardware that differs from anything that's already known, there isn't point in doing that. You can download the currently known boot ROMs here:

https://gbdev.gg8.se/files/roms/bootroms/


Blog: Gameboy Genius
"A journey of a thousand miles begins with one small step"
Old Chinese Proverb

Offline

 

#3 2020-12-29 04:18:15

K5T3
Member
Registered: 2020-12-28
Posts: 19

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

nitro2k01 wrote:

Hi. What is the goal you're trying to achieve? To use that code you need some sort of hardware glitch setup that you can use bypass the boot ROM lockout, which would require you to open up the Gameboy and solder to the main board. But unless you have some unreleased Gameboy hardware that differs from anything that's already known, there isn't point in doing that. You can download the currently known boot ROMs here:

https://gbdev.gg8.se/files/roms/bootroms/

My goal is to find a way to dump the boot ROMs.


Nintendo rules!

Offline

 

#4 2020-12-29 11:56:11

K5T3
Member
Registered: 2020-12-28
Posts: 19

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

Also, I already have these boot ROMs except fortune_rom.bin and gamefighter_rom.bin. Those two files are the non-official boot ROMs.


Nintendo rules!

Offline

 

#5 2020-12-29 17:19:58

K5T3
Member
Registered: 2020-12-28
Posts: 19

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

I know how to solder the clock pin. But to me, it sounds like a general thing. And, I know that there are other boot ROMs out there, including the GBC boot ROM in GBA.

There is something that is called BIOS Protection (or Anti-Tamper). I can think of that as Windows Defender or Windows Firewall. In my experience, I know a way of disabling the tamper protection of Windows Defender. If I can disable the tamper protection of Windows Defender, I might be able to disable the BIOS protection of the boot ROM as well. And, the question is this. How do I disable the BIOS protection? To me, this question sounds obvious. The GBA boot ROMs have the lack of the BIOS protection, and the GB+GBC boot ROMs do not have the lack of the BIOS protection. I should create a tool to disable the BIOS protection of GB+GBC.


Nintendo rules!

Offline

 

#6 2020-12-29 20:46:36

K5T3
Member
Registered: 2020-12-28
Posts: 19

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

Before doing the whole BIOS-dumping thing, here are a few of these errors.

I was making the hello-world example, but these errors appeared. What can I do with them?

https://i.postimg.cc/k4k67zr4/M-0.png

Also, when I run the command, .\make.bat, it cannot find the main.o file.

https://i.postimg.cc/kGvnLpqL/M-1.png
https://i.postimg.cc/CMGLZzkJ/M-2.png

So, I need your help on these errors.

Last edited by K5T3 (2020-12-29 20:46:50)


Nintendo rules!

Offline

 

#7 2020-12-30 08:22:32

rune-dev-matt
Member
From: Germany
Registered: 2020-11-30
Posts: 12

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

Hello,

about the coding question, I can give you following input:

1.) in the Picture M-0.png it shows that you are using the wrong type of brackets. Use {} instead of () for the body of the main function.
This is also what the compilier error shows in the picture M-2.

2.) Because the compilier cant compile your code, no *.o file was created for the second step in your *.bat file

3.) The error in Image M-0.png means that VSCode can't find the dependencies for GBDK.
You have to create a configuration file (*.json) for C with the path of your GBDK installation.

https://code.visualstudio.com/docs/cpp/ … igurations

On my machine (Mac OSX) it looks like this:

https://i.postimg.cc/DJ4FyL7F/Bildschirmfoto-2020-12-30-um-14-11-41.png

I hope this helps you.

Last edited by rune-dev-matt (2020-12-30 08:24:20)

Offline

 

#8 2021-01-03 17:53:36

K5T3
Member
Registered: 2020-12-28
Posts: 19

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

I made a c_cpp_properties.json file. It looks like this.

https://i.postimg.cc/zB5sC0ZB/WRK-0.png

And, I have edited my main.c file.

https://i.postimg.cc/KY7V8Bky/WRK-1.png

And when I started the .\make command, I have this error.

https://i.postimg.cc/xd95g7CW/WRK-2.png


Nintendo rules!

Offline

 

#9 2021-01-04 09:39:59

toxa
Member
Registered: 2020-02-13
Posts: 305

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

sorry K5T3, but development is probably not your vocation.

Offline

 

#10 2021-01-04 17:49:02

K5T3
Member
Registered: 2020-12-28
Posts: 19

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

toxa wrote:

sorry K5T3, but development is probably not your vocation.

I watched the Youtube users, who are developing the Game Boy programs and the Game Boy tools. But, what I meant is how to fix this error.

https://i.postimg.cc/vBz9ycD0/K-0.png


Nintendo rules!

Offline

 

#11 2021-01-05 00:23:40

Tauwasser
Member
Registered: 2010-10-23
Posts: 160

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

What rune-dev-matt meant in his previous post was that you need to use curly brackets "{" and "}" for the body of the main function. He did not say to replace all parenthesis with curly brackets.

Your program should look like this (assuming that the GBDK include is fixed):

Code:

#include <gb/gb.h>
#include <stdio.h>

void main() {
    printf("HELLO WORLD");
}

You will need to meticulously copy the example code as shown in the tutorials (e.g. here on Youtube) if you do not know C in order to get started.
But you will definitely need to learn C for your endeavor!

Please also notice that rune-dev-matt only showed you the relevant parts of the configuration file to make the GBDK include work. However, you do need the proper structure in c_cpp_properties.json, see the documentation page he linked to. You will also need to move the file to the .vscode sub-directory of your project directory as stated in the documentation I just linked to.

Look at the example: "includePath" is defined within each configuration JSON Object ("dictionary"; identified by the curly square brackets "{" and "}") of the configuration JSON Array ("list"; identified by the square brackets "[" and "]"), as shown in the example here:

Code:

{
  "configurations": [
    {
      "name": "GCC",
      "includePath": ["${workspaceFolder}/**"],
      "defines": ["_DEBUG", "UNICODE", "_UNICODE"],
      "windowsSdkVersion": "10.0.18362.0",
      "compilerPath": "C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/g++.exe",
      "cStandard": "c11",
      "intelliSenseMode": "gcc-x64"
    }
  ],
  "version": 4
}

Notice how you need a name for your configuration, possibly some defines etc.
Notice also that there is a version number identifying the configuration file format version at the bottom.
Notice again that the file is one huge JSON Object (look at the curly brackets "{" at the top and "}" bottom).
You can read more about JSON on Wikipedia if you have trouble with the format.

Last edited by Tauwasser (2021-01-05 00:38:27)

Offline

 

#12 2021-01-05 04:52:08

K5T3
Member
Registered: 2020-12-28
Posts: 19

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

Tauwasser wrote:

What rune-dev-matt meant in his previous post was that you need to use curly brackets "{" and "}" for the body of the main function. He did not say to replace all parenthesis with curly brackets.

Your program should look like this (assuming that the GBDK include is fixed):

Code:

#include <gb/gb.h>
#include <stdio.h>

void main() {
    printf("HELLO WORLD");
}

You will need to meticulously copy the example code as shown in the tutorials (e.g. here on Youtube) if you do not know C in order to get started.
But you will definitely need to learn C for your endeavor!

Please also notice that rune-dev-matt only showed you the relevant parts of the configuration file to make the GBDK include work. However, you do need the proper structure in c_cpp_properties.json, see the documentation page he linked to. You will also need to move the file to the .vscode sub-directory of your project directory as stated in the documentation I just linked to.

Look at the example: "includePath" is defined within each configuration JSON Object ("dictionary"; identified by the curly square brackets "{" and "}") of the configuration JSON Array ("list"; identified by the square brackets "[" and "]"), as shown in the example here:

Code:

{
  "configurations": [
    {
      "name": "GCC",
      "includePath": ["${workspaceFolder}/**"],
      "defines": ["_DEBUG", "UNICODE", "_UNICODE"],
      "windowsSdkVersion": "10.0.18362.0",
      "compilerPath": "C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/g++.exe",
      "cStandard": "c11",
      "intelliSenseMode": "gcc-x64"
    }
  ],
  "version": 4
}

Notice how you need a name for your configuration, possibly some defines etc.
Notice also that there is a version number identifying the configuration file format version at the bottom.
Notice again that the file is one huge JSON Object (look at the curly brackets "{" at the top and "}" bottom).
You can read more about JSON on Wikipedia if you have trouble with the format.

I edited this c_cpp_properties.json file, and it looks like this.
https://i.postimg.cc/G2mY9CBL/sdv0s00sdv.png


Nintendo rules!

Offline

 

#13 2021-01-05 10:58:22

K5T3
Member
Registered: 2020-12-28
Posts: 19

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

So, I used the .\make.bat command. I do not see any errors, so it worked well.

https://i.postimg.cc/qvR8xF2D/WLM-0.png

And, I have a .gb file in this folder.

https://i.postimg.cc/15R6yd7R/WLM-1.png

Plus, I have a .gb file with a message, "HELLO WORLD".

https://i.postimg.cc/JhjtN3Yd/WLM-2.png
https://i.postimg.cc/d0WQmWm6/WLM-3-0.png


Nintendo rules!

Offline

 

#14 2021-01-05 16:19:29

K5T3
Member
Registered: 2020-12-28
Posts: 19

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

I have the codes for dumping the Super GB BIOS, the Super GB2 BIOS, and the GBC BIOS in .s and .c.

Code:

https://jumpshare.com/v/fym0Bfka7XpdURPqkyh8

Nintendo rules!

Offline

 

#15 2021-01-07 15:30:28

AntonioND
Member
Registered: 2014-06-17
Posts: 134
Website

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

You do realize that the code is 100% useless if you don't have the exact setup that he had, right?

Offline

 

#16 2021-01-09 03:51:26

K5T3
Member
Registered: 2020-12-28
Posts: 19

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

Before making the GBC version of the Hello World sample, what codes should I make for GBC (.gbc file)?


Nintendo rules!

Offline

 

#17 2021-01-09 19:03:46

K5T3
Member
Registered: 2020-12-28
Posts: 19

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

I used the same codes (plus a bit more of the codes) to compile the main.c file to a .gbc file as a Hello World example. But, it ends up like the same .gb file. I think that I have done something wrong in here.

Here are the codes that I have so far.

https://i.postimg.cc/jq0BKhZC/UWRK.png


Nintendo rules!

Offline

 

#18 2021-01-10 05:53:51

rune-dev-matt
Member
From: Germany
Registered: 2020-11-30
Posts: 12

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

K5T3 wrote:

I used the same codes (plus a bit more of the codes) to compile the main.c file to a .gbc file as a Hello World example. But, it ends up like the same .gb file. I think that I have done something wrong in here.

Here are the codes that I have so far.

https://i.postimg.cc/jq0BKhZC/UWRK.png

What makes you think that is wrong?
If it works than it works. If not then what are the issues?

BTW: What are you trying to archieve?
GB/C development is not a beginner friendly path to software development because it requires a lot of knowledge. Even I (10+ .net Developer) have to read a lot about this topic and ask (stupid) questions because it’s on a whole other level.

If you simple want to create games I would recommend you, to give GBStudio a chance. It does a lot of background work for you, has good UI and there is nice community which also produces great games. It allows you to create your ideas without the hassle and gives you a basic introduction into the basics of loops, events and triggers. And the next version (currently in Beta) allows you, to create also Game Boy Color Games.

https://www.gbstudio.dev/

- Matt

Offline

 

#19 2021-01-11 03:23:03

K5T3
Member
Registered: 2020-12-28
Posts: 19

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

rune-dev-matt wrote:

K5T3 wrote:

I used the same codes (plus a bit more of the codes) to compile the main.c file to a .gbc file as a Hello World example. But, it ends up like the same .gb file. I think that I have done something wrong in here.

Here are the codes that I have so far.

https://i.postimg.cc/jq0BKhZC/UWRK.png

What makes you think that is wrong?
If it works than it works. If not then what are the issues?

BTW: What are you trying to archieve?
GB/C development is not a beginner friendly path to software development because it requires a lot of knowledge. Even I (10+ .net Developer) have to read a lot about this topic and ask (stupid) questions because it’s on a whole other level.

If you simple want to create games I would recommend you, to give GBStudio a chance. It does a lot of background work for you, has good UI and there is nice community which also produces great games. It allows you to create your ideas without the hassle and gives you a basic introduction into the basics of loops, events and triggers. And the next version (currently in Beta) allows you, to create also Game Boy Color Games.

https://www.gbstudio.dev/

- Matt

https://i.postimg.cc/k48Tqtp3/Trying-to-Compile-C-to-GBC.png
https://i.postimg.cc/jdkP3SMz/Trying-to-Compile-C-to-GBC-0.png

I am trying to compile the .c file to a .gbc file. Also, I wanted to make the simple applications for dumping the BIOS (Super GB, Super GB2, and GBC).

Last edited by K5T3 (2021-01-11 03:27:34)


Nintendo rules!

Offline

 

#20 2021-01-11 05:16:43

rune-dev-matt
Member
From: Germany
Registered: 2020-11-30
Posts: 12

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

K5T3 wrote:

I am trying to compile the .c file to a .gbc file. Also, I wanted to make the simple applications for dumping the BIOS (Super GB, Super GB2, and GBC).

So, I did some research about this topic and I've to tell you, what you are trying to archieve is not possible the way you think.

Look at Pierre's really well writen blog entry:

https://kemenaran.winosx.com/posts/game … om-dumped/

Well, the issue is that after it initialized the hardware, the boot ROM locks itself, just before giving the control to the cartridge code. That means you can’t read the boot ROM memory location anymore. The only thing someone managed to do was to dump the original black & white GameBoy ROM, using a powerfull microscope to read the bits one-by-one on the chip — that’s how easy this locking protection is to bypass.

And also the guy which achieved this used a hardware hacking aproach:

Basically, he breaked out the GameBoy Color case, and took control of the cartridge connector, the CPU clock cristal and the CPU voltage.

This means, it's technical not possible to write a "simple" script and execute it from a cartridge to dump the BIOS from a GB or GBC. You have to to get a flashcard with a dumper software, then do nasty hardware tricks at the right time to skip the instruction that disables the ROM Locking and then using said dumper software.

- Matt

Offline

 

#21 2021-01-11 19:28:12

K5T3
Member
Registered: 2020-12-28
Posts: 19

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

rune-dev-matt wrote:

K5T3 wrote:

I am trying to compile the .c file to a .gbc file. Also, I wanted to make the simple applications for dumping the BIOS (Super GB, Super GB2, and GBC).

So, I did some research about this topic and I've to tell you, what you are trying to archieve is not possible the way you think.

Look at Pierre's really well writen blog entry:

https://kemenaran.winosx.com/posts/game … om-dumped/

Well, the issue is that after it initialized the hardware, the boot ROM locks itself, just before giving the control to the cartridge code. That means you can’t read the boot ROM memory location anymore. The only thing someone managed to do was to dump the original black & white GameBoy ROM, using a powerfull microscope to read the bits one-by-one on the chip — that’s how easy this locking protection is to bypass.

And also the guy which achieved this used a hardware hacking aproach:

Basically, he breaked out the GameBoy Color case, and took control of the cartridge connector, the CPU clock cristal and the CPU voltage.

This means, it's technical not possible to write a "simple" script and execute it from a cartridge to dump the BIOS from a GB or GBC. You have to to get a flashcard with a dumper software, then do nasty hardware tricks at the right time to skip the instruction that disables the ROM Locking and then using said dumper software.

- Matt

I do not see a program like a GBC BIOS-dumping program. I searched around for a GBC BIOS-dumping program, but it is not found.

So, I decided to make a GBC-BIOS-dumping program, and here is the script that I have written.

https://i.postimg.cc/RhgTQ66p/IM-0.png

And when I tried to compile my main.c file, these are the errors that I have watched.

https://i.postimg.cc/V619xBXH/IM-1.png

I also made some scripts for the SGB+SGB2 BIOS-dumping programs.

https://i.postimg.cc/C5rjn3XW/SGB-BIOS-Dumping-Script.png
https://i.postimg.cc/VsK9htvD/SGB2-BIOS-Dumping-Script.png

Last edited by K5T3 (2021-01-11 19:28:36)


Nintendo rules!

Offline

 

#22 2021-01-12 12:37:59

toxa
Member
Registered: 2020-02-13
Posts: 305

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

oh, assembler! you better use rgbds!

Offline

 

#23 2021-01-12 19:32:45

AntonioND
Member
Registered: 2014-06-17
Posts: 134
Website

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

That code is useless. You need to connect a FPGA to the cartridge bus, you need to replace the oscillator of the GB by a circuit in the FPGA, and you need to really know what you are doing. That is not going to work.

EDIT: At the very least you need to replace the oscillator, the cartridge bus thing is for one of the methods only.

Last edited by AntonioND (2021-01-12 19:35:32)

Offline

 

#24 2021-01-12 19:34:22

AntonioND
Member
Registered: 2014-06-17
Posts: 134
Website

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

https://www.its.caltech.edu/~costis/sgb_hack/

Take a look at the photos. If you aren't happy working with that kind of stuff, don't try this.

Offline

 

#25 2021-01-24 20:41:57

K5T3
Member
Registered: 2020-12-28
Posts: 19

Re: Codes for Dumping the BIOS of Super GB, Super GB2, and GBC

Speaking of the FPGA thing, I know that there is another way to dump the GB+SGB+SGB2+GBC BIOS, and that is the Visual Inspection.

The Game Boy CPU chip has 80 pins (48 pins in-length + 32 pins in-width). The CPU chip has the BIOS.

https://i.postimg.cc/MThGnLgT/df00dfs-s0df0sdf.png

To the PCB, I should first use a soldering heater to make the pins safer for the CPU chip to pull out. Second, I should use a small tip-looking tool to pull out the CPU chip. Third, I should put a CPU chip in a slot of a programmer.

https://i.postimg.cc/Vkf3W6FQ/s-dvdv0dvs00dvs0dvs.jpg

Fourth, I should use the programmer to analyze the data of the CPU chip, and I should save the data in a computer.

Last edited by K5T3 (2021-01-25 02:59:44)


Nintendo rules!

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson