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
7
votes
3 answers

How do I learn to write a console emulator?

Possible Duplicate: How do emulators work and how are they written? I'd like to try writing a basic gameboy emulator, or maybe even NES. I know the basics of C and I'm fairly good at Java, so I know the necessary basics of programming. What I…
ZimZim
  • 3,291
  • 10
  • 49
  • 67
6
votes
3 answers

table of functions vs switch in golang

im am writing a simple emulator in go (should i? or should i go back to c?). anyway, i am fetching the instruction and decoding it. at this point i have a byte like 0x81, and i have to execute the right function. should i have something like…
pvinis
  • 4,059
  • 5
  • 39
  • 59
6
votes
1 answer

Could anything with a Z80 processor run Gameboy games?

Since the Gameboy's processor, the LR35902, is a hybrid of the Z80 and the Intel 8080, keeping in mind that the Z80 and the Intel 8080 were designed to be mostly cross-compatible anyways, could anything that has a Z80 processor run opcodes that were…
Veecy
  • 63
  • 1
  • 4
6
votes
1 answer

How can I have code running while using sampled audio playback in GBDK c?

I am making a game for the GameBoy in GBDK, and I'm trying to add sounds to the game. GBDK has a function that plays sounds from an array of values, the only problem is that while its playing the sound the rest of the script freezes. Is there a way…
isaac tschampl
  • 388
  • 2
  • 12
5
votes
1 answer

Using two Arrays in C/Gameboy programming

For a game in Gameboy programming, I am using four arrays called top, oldTop, bottom and oldBottom: struct Point { int x, y; }; struct Rect { struct Point xx, yy; }; Rect top[size], oldTop[size]; Rect bottom[size], oldBottom[i]; where Rect is a…
sparkonhdfs
  • 1,313
  • 2
  • 17
  • 31
4
votes
2 answers

Using Swift to create a Gameboy game

I was thinking of creating a retro style game for iOS using SpriteKit and I was wondering if there would be any way to run it on a Gameboy Advance. Based on what I've seen, Gameboys can run any game written in any programming language as long as it…
rayaantaneja
  • 1,182
  • 7
  • 18
4
votes
1 answer

How is XOR applied when determining carry?

I'm working on a gameboy emulator. One of the CPU operations I need to implement is the adding of a byte n to the stack pointer sp (opcode E8). The carry flag needs to be set if there is a carry from bit 7. I've looked at two implementations for…
John
  • 652
  • 7
  • 22
4
votes
0 answers

Python Read memory address of Pokemon in VisualBoyAdvance

First off, I'm new to more "Low level" things like this using Python, so please excuse me if this is a noob question. I had an idea for something like an "Achievement" system similar to Xbox and Playstation, where you could possibly track certain…
Jebby
  • 1,845
  • 1
  • 12
  • 25
4
votes
1 answer

GBZ80 - ADC instructions fail test

I've been running Blarggs CPU tests through my Gameboy emulator, and the op r,r test shows that my ADC instruction is not working properly, but that ADD is. My understanding is that the only difference between the two is adding the existing carry…
Triforcer
  • 127
  • 9
4
votes
3 answers

Is it possible to create two uint8_t pointers to the first and second half of a value pointed to by a uint16_t pointer?

I'm attempting to write a Gameboy emulator in C, and am currently in the process of deciding how to implement the following behavior: Two 8-bit registers can be combined and treated as a single 16-bit register changing the value of one of the…
user6290240
4
votes
1 answer

Gameboy Processor LR35902 Opcode 0x08 Meaning

Could someone please explain what the opcode 0x08 does on the LR35902 processor. The mnemonic is LD (a16),SP. I'm confused because the stack pointer is a 16-bit value but (a16) is an address to somewhere only capable of storing 8 bits (I think!). I…
user2674487
  • 113
  • 4
4
votes
1 answer

Writing memory with assembly (Z80 / Gameboy)

I'm trying to programmatically write characters into memory such that I can then display it on screen. How do I take a value (say 65) and write it into memory with Z80 assembly for the Gameboy? From what I've read this is simply a case of loading a…
Paul
  • 1,874
  • 1
  • 19
  • 26
4
votes
1 answer

Gameboy Emulator pop off empty stack

I'm working on a Gameboy Emulator, and I've reached a point in the ROM where I get opcode 0xD1 (pop DE off stack) but the stack is empty (no values have been pushed onto it). All unknown opcodes return an error, and all other instructions seem to be…
Nabushika
  • 364
  • 1
  • 17
4
votes
1 answer

Forward declaration of typedef structs in GBDK C

I'm using GBDK C to create a Game for the original Game Boy, and I have run in to a little problem. Each room in my game needs to have different portals, but each portal needs to reference a room. Here is a cut-back version of the code: typedef…
bashaus
  • 1,614
  • 1
  • 17
  • 33
4
votes
1 answer

MASM - Macro variable?

This is my first question here and I hope that you're able to help me! I'm currently working on a GameBoy Emulator and want to write it in MASM, for handling the CPU instructions, I want to create an array with variables to make it easier for me to…
BolterVi
  • 96
  • 5