Questions tagged [gameboy]

The Game Boy was the first portable console released by Nintendo. It has a black and white screen and, compared to more recent portable devices, it has relatively simple programming API.

The Game Boy was the first portable console released by Nintendo. It has a black and white screen and, compared to more recent portable devices, it has relatively simple programming API.

Questions relating to the Nintendo Game Boy and Nintendo Game Boy Color consoles, along with development of games and their .

Questions relating to the Nintendo DS and subsequent consoles belong on . Questions relating to the Nintendo Game Boy Advance should use .

Useful resources

  • GBDK: GameBoy Developers Kit. Contains some of the essential tools for DMG Game Boy development, including an ANSI C compiler, assembler, linker, several libraries, and some example programs.
  • RGBDS: Rednex Game Boy Development System. An assembly toolchain for the Nintendo Game Boy & Game Boy Color
  • Awesome List: A curated list of Game Boy development resources such as tools, guides, technical documentation, tutorials, emulators, related projects and open-source ROMs.
  • GameBoy Dev'rs: Various resources, tutorials, and documentation for the original Game Boy.
  • GameBoy Advance Dev'rs: Various resources, tutorials, and documentation for the Game Boy Advance.
104 questions
0
votes
3 answers

Bits: Search&Replace bit sequences

Being a high-level programmer myself, I struggle a lot with bitwise operations. I hope what I'm trying to achieve is doable? Let's say I have one unsigned 8-bits integer - it can be any value. Let's work on two examples: 0xe4 (11100100) and 0xa5…
Sabikku
  • 78
  • 6
0
votes
1 answer

Relative Jump in GameBoy emulator isn't jumping to where it should

I'm working on a GameBoy emulator on C#, and testing it with Blargg's test ROMs (cpu_instrs from here). I'm going through tests individually, and now I'm using 07-jr,jp,call,ret,and rst. I am comparing my results with bgb's debugger. Now, when I get…
0
votes
2 answers

How do GPU/PPU timings work on the Gameboy?

I’m writing a gameboy emulator and I’ve come to implementing the graphics. However I can’t quite figure out how it works with the cpu as far as timing/clock cycles go. Does the CPU execute a certain amount of cycles (if so how many) and then hand it…
0
votes
0 answers

How ot display a Tilemap in Game Boy

I am trying to display this image with Game Boy Developer Kit and i don't see it displayed when i run the emulator The code i use is this one void displayDodge(){ int nbTiles = (160 * 144) / 8; int i,j; SPRITES_8x8; j = 0; set_sprite_data(0,…
nazimboudeffa
  • 939
  • 6
  • 20
0
votes
1 answer

Using NAudio for my GameBoy emulator

I have started to implement audio in my GB emulator and for this I am using NAudio. The emulator calculates the output into a byte array and after every frame loads it into a BufferedWaveProvider. For the output I use WaveOut which I start after the…
Patrick S
  • 3
  • 2
0
votes
3 answers

Converting an unsigned 16-bit integer from HL into text using my own non-ASCII charmap as decimal, with LR35902 assembly

I need to figure out how to make a routine for the LR35902 (the Game Boy's Z80-like CPU) that will take the contents of HL (not where it points to, the actual number stored in it) and convert it into 1 to 5 (actual values would range from 0 to…
Tachytaenius
  • 147
  • 8
0
votes
2 answers

For emulating the Gameboy, why does it matter that the memory is broken up into different areas?

So I'm writing a gameboy emulator, and I'm not 100% sure why other projects took the time to break up the memory into proper categories. I don't know if there is a major technical dilemma I'm missing (maybe handling illegal parameters in…
OopyDoopy
  • 3
  • 1
0
votes
2 answers

Which of these pieces of code is faster in Java

I was wondering which piece of code is going to run faster since I want to optimize as much as possible. code A: if(((a & 0x0FFF) + (b & 0x0FFF)) & 0x1000 != 0) { Register.setHCarryFlag(true); } else { Register.setHCarryFlag(false); } code…
0
votes
3 answers

I am running gbdk a gameboy game making program and I am getting parse errors on the following code

#include #include #include "racecars.h" /* RACECARS.C Tile Source File. Info: Form : All tiles as one unit. Format : Gameboy 4 color. Compression : None. Counter …
user2939381
  • 1
  • 1
  • 2
0
votes
1 answer

Gameboy emulation - SwingWorker stuck at Unsafe.park

I am making an emulator for the Gameboy system, and I am using Swing as my GUI. My implementation uses a SwingWorker to run the CPU emulation in a background thread. Through SwingWorker.doInBackground method I publish an array containing the…
rationalrevolt
  • 663
  • 1
  • 6
  • 13
-1
votes
1 answer

C Gameboy separate functions an main files

I am working on a gameboy project for a class asignment. I was told, that we needed to have a separate "functions" file, and "main" file. I am going insane doing this. I have made a header file "myLib.h", and in it I include definitions, and…
Reid
  • 4,376
  • 11
  • 43
  • 75
-1
votes
1 answer

Fetching a game boy ROM image

i've started to develop a very simple emulator for game boy in C, i've already studied hoe work the cpu of the Z80 and the relative OpCodes but there is a question in my mind that i never found answer. When i open the ROM image using…
Fasertio
  • 29
  • 5
-2
votes
2 answers

Extern syntax in C?

I am slightly confused about using "extern" in my c code, when there is a global variable involved. I tried the following, and got a compilation error: Main.c: extern unsigned short *videobuffer; //I also tried this in a separate and it failed with…
Shanty
  • 101
  • 8
-2
votes
3 answers

c variable turning into -17918 when incremented

hi i am making a programming language that will run on the nintendo gameboy in c which is why you will see some functions like waitpad(); but this question is unrelated the the gameboy librarys for some reason when ever i try to increment a certain…
1 2 3 4 5 6
7