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
4
votes
2 answers

GameBoy compiler with system registers and interrupts

I have been spending a lot of time learning GameBoy programming, as I was already familiar with Z80 Assembly I wasn't afraid of jumping into using it. I would (of course) find it much more productive to program in C or C++ however cannot find a full…
Lee Fogg
  • 775
  • 6
  • 22
4
votes
2 answers

Writing Gameboy emulator in C++, how to test opcodes (Google Test Framework)?

I'm trying to write GameBoy emulator, but I'm not sure how should I test my CPU_LR39502 class. To avoid huge if-else-if / switch-case statements, I came up with idea to put opcode functor into map, which takes opcode as key: class Functor { …
pablo432
  • 166
  • 7
3
votes
1 answer

Using DMA to load an image into Visual Boy Advance (VBA)

I am new to C; I have an image file translated by means of online tools into a .h and .c file. The C file contains an array of 1024 16 bit hexadecimal numbers, used to denote on/off of bits. I want to read this file and draw the image onscreen using…
Philip
  • 31
  • 1
  • 3
3
votes
1 answer

Clock timing changes on different computers

I'm working on an implementation for the DMG-01 (A.K.A gameboy 1989) on my github. I've already implemented both the APU and the PPU, with (almost) perfect timing on my pc (and the pc of my friends). However, when I run the emulator on one of my…
Noam Rodrik
  • 552
  • 2
  • 16
3
votes
1 answer

Gameboy rotate instructions

I'm currently implementing gameboy emulator. When I was implementing rotate instructions, I've noticed that RL instruction is rotate through carry, while RLC instruction is rotate without carry. Wouldn't it be more logical to interchange the names.…
alex mafas
  • 41
  • 3
3
votes
2 answers

"\r" Literally Prints Carriage Return Symbol

I'm teaching myself the C programming language. Except I'm learning in context of designing a Gameboy game (using GBDEK). I'm working on a simple Breakout clone, and have decided to use the printf() function to show the player's score. When the…
Ben Klayer
  • 61
  • 6
3
votes
1 answer

GameBoy Classis Emulator - How to initialise VRAM (0x8000)

I'm currently programming a GameBoy Classis Emulator. Here is the GitHub-repo (https://github.com/FelixWeichselgartner/GameBoy-Classic-Emulator). The CPU instructions seem to be working fine. I compared the instructions with the ones of this gameboy…
3
votes
3 answers

GameBoy color emulator opcodes automation

I'm writting a GameBoy color emulator in C, just to introduce myself into this world, it is interpreted, nothing of dynamic or static recompilation :P Now I'm right in the tedious task of implementing all the CPU opcodes in C code, I have to write…
0x77D
  • 1,564
  • 2
  • 18
  • 17
3
votes
2 answers

Gameboy emulation - Clarification need on CD instruction

I'm currently in the process of writing a Gameboy emulator, and I've noticed something that seems strange to me. My emulator is hitting a jump instruction 0xCD, for example CD B6 FF, but my understanding was that a jump should only be jumping to an…
Triforcer
  • 127
  • 9
3
votes
1 answer

How Do I Create a Variable In Z80 Assembly?

I'm trying to create a simple variable containing the hex value 0xffff. I've been able to do it as a macro with SET, but I haven't been able to get it working with something like ld _time,$ffff. How do I load a value into _time?
user6238236
3
votes
1 answer

What do opcodes 0xE9 (JP HL) and 0xF8 (LD HL,SP+r8) do?

I think I am struggling to define correctly the following ambiguous opcodes: LD HL,SP+r8 and JP (HL) opcodes (0xE9 and 0xF8 respectively) In my implementation, LD HL,SP+r8 sets HL to the value of SP+r8, but I have a feeling that it may be to do with…
Nabushika
  • 364
  • 1
  • 17
3
votes
1 answer

CScore output PCM bigger than one byte

I'm programming an C# emulator and decided to output the PCM using CScore. When the sample size (for each channel) is one byte, the sound outputs correctly, but when I increase the sample size to 16 bits, the sound is very very noisy. A related…
3
votes
2 answers

Bug with power-of-two multiplication in GBDK compiler

I'm currently developing a gameboy emulator and to test the correctness of my emulator I'm using GBDK to compile c programs for my emulator. I noticed that the compiler (as expected) optimizes multiplications with constants that are a power of two…
monoceres
  • 4,722
  • 4
  • 38
  • 63
3
votes
1 answer

Does going BW in low-bit mode in Android Wear actually save battery for ALL devices?

I have an Android Wear watch face that I recently put on the Google Play store: https://play.google.com/store/apps/details?id=com.watchfuldesign.wearboy&hl=en I recently got this review: "Please add options to add a small day of month on the…
trx25
  • 359
  • 3
  • 12
3
votes
0 answers

Gameboy emulator - carry and half-carry flag

I'm working on a GameBoy emulator in C and currently I'm working on the CPU core. Nevertheless, I am not sure if I understand when the carry and half-carry flags are set, especially in operations like: LD HL,…
MHN
  • 31
  • 1
  • 3