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.
Pages: 1 2
I may be extremely lazy, so here it goes.
I have the codes for dumping the BIOS of Super GB, Super GB2, and GBC.
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.
Offline
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/
Offline
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.
Offline
Also, I already have these boot ROMs except fortune_rom.bin and gamefighter_rom.bin. Those two files are the non-official boot ROMs.
Offline
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.
Offline
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)
Offline
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:
I hope this helps you.
Last edited by rune-dev-matt (2020-12-30 08:24:20)
Offline
I made a c_cpp_properties.json file. It looks like this.
And, I have edited my main.c file.
And when I started the .\make command, I have this error.
Offline
sorry K5T3, but development is probably not your vocation.
Offline
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.
Offline
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):
#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:
{ "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
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.
Offline
So, I used the .\make.bat command. I do not see any errors, so it worked well.
And, I have a .gb file in this folder.
Plus, I have a .gb file with a message, "HELLO WORLD".
Offline
I have the codes for dumping the Super GB BIOS, the Super GB2 BIOS, and the GBC BIOS in .s and .c.
https://jumpshare.com/v/fym0Bfka7XpdURPqkyh8
Offline
Before making the GBC version of the Hello World sample, what codes should I make for GBC (.gbc file)?
Offline
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.
Offline
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
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.pngWhat 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
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)
Offline
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
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.
And when I tried to compile my main.c file, these are the errors that I have watched.
I also made some scripts for the SGB+SGB2 BIOS-dumping programs.
Last edited by K5T3 (2021-01-11 19:28:36)
Offline
oh, assembler! you better use rgbds!
Offline
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
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
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.
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.
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)
Offline
Pages: 1 2