# Functions
No description provided by the author
No description provided by the author
Load the gameboy instructions set from the JSON file.
No description provided by the author
No description provided by the author
constructor for the Bus struct */.
No description provided by the author
Create a new CPU : + initializes the memories and attaches them to the bus - HRAM: 127 bytes @ 0xFF80 - VRAM: 8KB bytes @ 0x8000 - WRAM: 8KB @ 0xC000 - I/O Registers: 128 bytes @ 0xFF00
+ randomizes the CPU registers + sets the cpuCycles count to 0 + sets the program counter to 0x0000.
instantiate a new debugger: - instanciates a new gameboy - initializes the internal channels to listen to the gameboy state - initializes the breakpoints list - initializes the program flow queue - initializes the state queues (cpu, ppu, apu, memory, joypad).
create a new gameboy struct.
No description provided by the author
*
* NewMemory creates a new Memory object with the given size.
*
* NewMemoryWithData creates a new Memory object with the given size and data.
*
* NewMemoryWithRandomData creates a new Memory object with the given size and random data.
constructor for the MMU struct.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
memory.
No description provided by the author
No description provided by the author
CONSTANTS.
CONSTANTS.
CONSTANTS.
No description provided by the author
No description provided by the author
No description provided by the author
CPU execution state : cycles through fetch -> decode -> execute -> fetch -> ...
stall the CPU and wait for the gameboy clock to catch up with the cpu clock.
4.194304MHz.
On Write, disable the bootrom.
70,224 dots per frame.
LCD properties.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
if 0, BG and Window are white (overrides FF40_5).
if 0, OBJs are not displayed (can be changed mid-frame to prevent obj parts to be displayed over the window).
if 0, 8x8, if 1, 8x16.
if 0, $9800-$9BFF, if 1, $9C00-$9FFF.
if 0, unsigned addressing mode accross Block 0 & 1 (0-255), if 1, signed addressing mode accross Block 1 & 2 (-128 to 127).
if 0, window is not displayed (overriden by FF40_0).
if 0, $9800-$9BFF, if 1, $9C00-$9FFF.
if 0, LCD and PPU are turned off.
2 bits to indicate the current PPU mode (0-3).
1 if LYC == LY.
if set, trigger HBlank interrupt for STAT interrupt.
if set, trigger VBlank interrupt for STAT interrupt.
if set, trigger OAM interrupt for STAT interrupt.
if set, trigger LCD interrupt for STAT interrupt.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
IE register: controls whether an interrupt is enabled or not.
IF register: flags that are set when an interrupt is requested.
FIFO STRUCT */.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Interrupts jump vectors.
No description provided by the author
start and length of the memory regions inside memory map.
interrupt parameters.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Sound channel 1 sweep (R/W).
Sound channel 1 length timer & duty cycle (Mixed).
Sound channel 1 volume & envelope (R/W).
Sound channel 1 period low (W).
Sound channel 1 period high & control (Mixed).
Sound channel 2 length timer & duty cycle (Mixed).
Sound channel 2 volume & envelope (R/W).
Sound channel 2 period low (W).
Sound channel 2 period high & control (Mixed).
Sound channel 3 DAC enable (R/W).
Sound channel 3 length timer (W).
Sound channel 3 output level (R/W).
Sound channel 3 period low (W).
Sound channel 3 period high & control (Mixed).
Sound channel 4 length timer (W).
Sound channel 4 volume & envelope (R/W).
Sound channel 4 frequency & randomness (R/W).
Sound channel 4 control (Mixed).
Master volume & VIN panning (R/W).
Sound panning (R/W).
Sound on/off (Mixed).
No description provided by the author
No description provided by the author
23,040 pixels per frame.
Waiting until the end of the scanline.
Waiting until the next frame.
Searching for OBJs which overlap this line.
Sending pixels to the LCD.
divider register: incremented at a rate of 16384 Hz.
timer counter: incremented at the rate specified by TAC.
timer modulo: when TIMA overflows, it is reset to TMA.
timer control: enables/disables the timer TIMA and sets its frequency.
LCD Control.
LCD Status.
LCD Scroll Y.
LCD Scroll X.
LCD Y (set by the PPU).
LCD Y Compare (set by the programmer).
DMA Transfer.
BG Palette.
OBP0 Palette.
OBP1 Palette.
Window Y.
Window X.
CONSTANTS.
CONSTANTS.
No description provided by the author
Gameboy states.
CONSTANTS.
CONSTANTS.
No description provided by the author
No description provided by the author
No description provided by the author
Wave RAM: Storage for one of the sound channels’ waveform (R/W).
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
Represents the GameBoy bus which connects the CPU, PPU, APU, RAM, ROM and other components together.
No description provided by the author
* CPU: executes instructions fetched from memory, reads and writes to memory (internal registers, flags & bus)
*/.
No description provided by the author
debugger struct: combination of a gameboy, its internal state and a list of breakpoints set by the user.
No description provided by the author
No description provided by the author
the gameboy is composed out of a CPU, memories (ram & registers), a cartridge and a bus.
No description provided by the author
No description provided by the author
No description provided by the author
*
* Memory struct represents any memory type RAM or ROM in the GameBoy.
represents a memory mapped to a specific address Name: string name of the memory Address: uint16 address where the memory is mapped Memory: Accessible memory.
*
* represents a memory write operation used by the mmu to keep track of all memory changes between 2 states
* memory writes can be either reset:
* - before every step from the debugger
* - before a new run from a breakpoint to another breakpoint
*/.
the memory management unit (MMU) is responsible for routing memory accesses to the correct memory.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
represents an 8-bit flag register it will allow the user to: - manipulate the register as a whole passing it a uint8 value - manipulate the register bit by bit using the GetBit, SetBit and ResetBit methods - have access to any bit using its shorthand notation (Z, N, H, C).
No description provided by the author
generates a tick at a given frequency.
# Interfaces
No description provided by the author
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author
256x256 pixels, 4 colors if I code every pixel as a uint8 when it only needs 2 bits, I get a state size of 256x256x8 > 524 kB which exceeds the 64kB limit for channel message communication Using a bool instead of uint8 doesn't change the size of the state since a bool is represented as a byte in Go The size of the whole image (including the part not visible in the viewport) is 256*256*2 bits ∼ 16kB which is acceptable I will therefore regroup pixels color information by groups of 8 x 2bits = 1 byte I need 256 * 2 bits = 512 bits, represented as 64 * 8 bits = 64 bytes In summary, the 2D image (superposition of background, window & objects) will be arranged as 256 lines of 64 bytes In this struct, coord (x,y) will correspond to pixels on line y from [y*8, y*9[.
No description provided by the author
*
* JSONableSlice is a type alias for a slice of uint8 used to make it JSONable by defining a custom JSON marshalling method.
No description provided by the author
No description provided by the author