Documentation
¶
Index ¶
- Constants
- type Addressable
- type BankMode
- type BootRom
- type Button
- type CPU
- type Cart
- type DMAController
- type Gameboy
- type GameboyOptions
- type GenericRAM
- type IntruptController
- type Joypad
- type MBC1
- type MBC3
- type MMU
- type MemoryBankController
- type PPU
- type PPUState
- type Palette
- type PixelFIFO
- type PixelFIFOItem
- type PixelFIFOState
- type Registers
- type SelectMode
- type SerialPort
- type Sprite
- type Timer
Constants ¶
View Source
const ( BOOT_ROM_BASE = 0x0 BOOR_ROM_TOP = 0xFF BOOT_ROM_ENABLE_ADDR = 0xFF50 )
boot rom will take precedence before I/O address space, for R/W to 0xFF50
View Source
const ( ROM_BASE = 0x0 ROM_TOP = 0x7FFF EXT_RAM_BASE = 0xA000 EXT_RAM_TOP = 0xBFFF )
View Source
const ( ZERO_FLAG_BIT = 7 SUB_FLAG_BIT = 6 HALF_CARRY_FLAG_BIT = 5 CARRY_FLAG_BIT = 4 )
View Source
const ( FPS = 60 TICKS_PER_FRAME = TICKS_PER_SCANLINE * SCANLINES_PER_FRAME GB_SCREEN_WIDTH = 160 GB_SCREEN_HEIGHT = 144 TILE_DATA_SCREEN_WIDTH = 128 TILE_DATA_SCREEN_HEIGHT = 192 TILE_MAP_SCREEN_WIDTH = 256 TILE_MAP_SCREEN_HEIGHT = 256 )
View Source
const ( RAM_SIZE = 0x6000 RAM_BASE = 0xA000 RAM_TOP = 0xFFFF )
View Source
const ( IF_ADDR = 0xFF0F IE_ADDR = 0xFFFF INTRUPT_MSK = 0xE0 VBLANK_INTRUPT_BIT = 0 LCD_INTRUPT_BIT = 1 TIMER_INTRUPT_BIT = 2 SERIAL_INTRUPT_BIT = 3 JOYPAD_INTRUPT_BIT = 4 VBLANK_INTRUPT_VEC = 0x40 STAT_INTRUPT_VEC = 0x48 TIMER_INTRUPT_VEC = 0x50 SERIAL_INTRUPT_VEC = 0x58 JOYPAD_INTRUPT_VEC = 0x60 ISR_CLOCK_TICKS = 20 )
View Source
const ( JOYP_ADDR = 0xFF00 JOYP_A_RIGHT = 0 JOYP_B_LEFT = 1 JOYP_SELECT_UP = 2 JOYP_START_DOWN = 3 JOYP_DPAD_SELECT = 4 JOYP_BTN_SELECT = 5 )
View Source
const ( MODE0 = 0 MODE1 = 1 )
View Source
const ( RAM_SELECT = 0 RTC_SELECT = 1 RTC_S = 0x08 RTC_M = 0x09 RTC_H = 0x0A RTC_DL = 0x0B RTC_DH = 0x0C )
View Source
const ( ReadTileID PixelFIFOState = 0 ReadTileDataLo PixelFIFOState = 1 ReadTileDataHi PixelFIFOState = 2 Sleep PixelFIFOState = 3 PushFIFO PixelFIFOState = 4 BGP Palette = 0 OBP0 Palette = 1 OBP1 Palette = 2 )
View Source
const ( VRAM_SIZE = 0x2000 VRAM_BASE = 0x8000 VRAM_TOP = 0x9FFF OAM_SIZE = 0xA0 OAM_BASE = 0xFE00 OAM_TOP = 0xFE9F TILE_SIZE = 16 TILE_WIDTH = 8 TILE_MAP_WIDTH = 32 NUM_SP_PALETTES = 2 LCDC_ADDR = 0xFF40 STAT_ADDR = 0xFF41 SCY_ADDR = 0xFF42 SCX_ADDR = 0xFF43 LY_ADDR = 0xFF44 LYC_ADDR = 0xFF45 OAM_DMA_TRANSFER_ADDR = 0xFF46 BG_PALETTE_ADDR = 0xFF47 OBP0_ADDR = 0xFF48 OBP1_ADDR = 0xFF49 WY_ADDR = 0xFF4A WX_ADDR = 0xFF4B TICKS_PER_SCANLINE = 456 SCANLINES_PER_FRAME = GB_SCREEN_HEIGHT + 10 STAT_LYC = 2 STAT_SELECT_HBLANK = 3 STAT_SELECT_VBLANK = 4 STAT_SELECT_OAM = 5 STAT_SELECT_LYC = 6 STAT_MSK = 0x7F STAT_RW_MSK = 0x78 LCDC_BGWIN_ENABLE = 0 LCDC_OBJ_ENABLE = 1 LCDC_OBJ_SIZE = 2 LCDC_BG_TILE_MAP = 3 LCDC_TILE_DATA_AREA = 4 LCDC_WIN_ENABLE = 5 LCDC_WIN_TILE_MAP = 6 LCDC_LCD_ENABLE = 7 SPRITES_PER_SCANLINE = 10 OAM_SCAN PPUState = 2 PIXEL_TRANSFER PPUState = 3 HBLANK PPUState = 0 VBLANK PPUState = 1 OAM_SCAN_TICKS = 80 )
View Source
const ( SB_ADDR = 0xFF01 SC_ADDR = 0xFF02 )
View Source
const ( DIV_ADDR = 0xFF04 TIMA_ADDR = 0xFF05 TMA_ADDR = 0xFF06 TAC_ADDR = 0xFF07 TAC_TIMER_ENABLE_BIT = 2 TAC_FREQ_DIV_MSK = 0x3 TAC_MSK = 0x7 HZ_4096 = 0 HZ_262144 = 1 HZ_65536 = 2 HZ_16386 = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Addressable ¶
type Addressable interface {
// contains filtered or unexported methods
}
type DMAController ¶
type DMAController struct {
// contains filtered or unexported fields
}
type Gameboy ¶
type Gameboy struct {
// contains filtered or unexported fields
}
func NewGameboy ¶
func NewGameboy(opts GameboyOptions) *Gameboy
type GameboyOptions ¶
type GenericRAM ¶
type GenericRAM struct {
// contains filtered or unexported fields
}
type IntruptController ¶
type IntruptController struct {
// contains filtered or unexported fields
}
type MemoryBankController ¶
type MemoryBankController interface { Addressable // contains filtered or unexported methods }
type PixelFIFO ¶
type PixelFIFO struct { BGWinComplete bool // contains filtered or unexported fields }
type PixelFIFOItem ¶
type PixelFIFOItem struct {
// contains filtered or unexported fields
}
type PixelFIFOState ¶
type PixelFIFOState uint8
type SelectMode ¶
type SelectMode uint8
type SerialPort ¶
type SerialPort struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.