mirror of
https://github.com/LIJI32/SameBoy.git
synced 2026-06-03 18:44:23 -03:00
Page:
IO Register Constants
Pages
Built‐In DMG Palettes
GB_BIG_ENDIAN
GB_CHEAT_ANY_BANK
GB_CONTEXT_SAFETY
GB_ENUM
GB_LITTLE_ENDIAN
GB_accessory_t
GB_add_cheat
GB_apu_set_sample_callback
GB_attributed_log
GB_audio_format_t
GB_camera_updated
GB_cheat_search_data_type_t
GB_cheat_search_filter
GB_cheat_search_get_results
GB_cheat_search_reset
GB_cheat_search_result_count
GB_cheat_search_result_t
GB_cheat_t
GB_cheats_enabled
GB_clear_joyp_accessed
GB_connect_printer
GB_connect_workboy
GB_convert_rgb15
GB_cpu_disassemble
GB_debugger_break
GB_debugger_clear_symbols
GB_debugger_complete_substring
GB_debugger_describe_address
GB_debugger_evaluate
GB_debugger_execute_command
GB_debugger_is_stopped
GB_debugger_load_symbol_file
GB_debugger_name_for_address
GB_debugger_set_disabled
GB_debugger_set_reload_callback
GB_disconnect_serial
GB_draw_tilemap
GB_draw_tileset
GB_gameboy_t
GB_gbs_info_t
GB_gbs_switch_track
GB_get_apu_wave_table
GB_get_built_in_accessory
GB_get_channel_amplitude
GB_get_channel_edge_triggered
GB_get_channel_period
GB_get_channel_volume
GB_get_cheats
GB_get_clock_rate
GB_get_direct_access
GB_get_joyp_accessed
GB_get_model
GB_get_oam_info
GB_get_pixels_output
GB_get_player_count
GB_get_registers
GB_get_rom_crc32
GB_get_rom_title
GB_get_save_state_size
GB_get_screen_width and GB_get_screen_height
GB_get_state_model
GB_get_state_model_from_buffer
GB_get_unmultiplied_clock_rate
GB_get_usual_frame_rate
GB_has_accelerometer
GB_icd_set_joyp
GB_import_cheat
GB_inline_const
GB_is_cgb
GB_is_cgb_in_cgb_mode
GB_is_channel_muted
GB_is_hle_sgb
GB_is_odd_frame
GB_is_save_state
GB_is_sgb
GB_key_mask_t
GB_key_t
GB_likely
GB_load_battery
GB_load_battery_from_buffer
GB_load_boot_rom
GB_load_boot_rom_from_buffer
GB_load_cheats
GB_load_gbs
GB_load_gbs_from_buffer
GB_load_isx
GB_load_rom
GB_load_rom_from_buffer
GB_load_state
GB_load_state_from_buffer
GB_log
GB_log_attributes_t
GB_map_type_t
GB_model_t
GB_oam_info_t
GB_palette_t
GB_palette_type_t
GB_print_image_callback_t
GB_printer_done_callback_t
GB_quick_reset
GB_random_seed
GB_random_set_enabled
GB_read_memory
GB_registers_t
GB_remove_all_cheats
GB_remove_cheat
GB_reset
GB_rewind_pop
GB_rewind_reset
GB_rom_supports_alarms
GB_run
GB_run_frame
GB_safe_read_memory
GB_sample_t
GB_save_battery
GB_save_battery_size
GB_save_battery_to_buffer
GB_save_cheats
GB_save_state
GB_save_state_to_buffer
GB_serial_get_data_bit
GB_serial_set_data_bit
GB_set_accelerometer_values
GB_set_allow_illegal_inputs
GB_set_background_rendering_disabled
GB_set_boot_rom_load_callback
GB_set_border_mode
GB_set_camera_get_pixel_callback
GB_set_camera_update_request_callback
GB_set_channel_muted
GB_set_cheats_enabled
GB_set_clock_multiplier
GB_set_color_correction_mode
GB_set_emulate_joypad_bouncing
GB_set_execution_callback
GB_set_highpass_filter_mode
GB_set_icd_hreset_callback
GB_set_icd_pixel_callback
GB_set_icd_vreset_callback
GB_set_infrared_callback
GB_set_infrared_input
GB_set_input_callback
GB_set_interference_volume
GB_set_joyp_write_callback
GB_set_key_mask
GB_set_key_mask_for_player
GB_set_key_state
GB_set_key_state_for_player
GB_set_lcd_line_callback
GB_set_lcd_status_callback
GB_set_light_temperature
GB_set_log_callback
GB_set_object_rendering_disabled
GB_set_open_bus_decay_time
GB_set_palette and GB_get_palette
GB_set_pixels_output
GB_set_read_memory_callback
GB_set_rendering_disabled
GB_set_rewind_length
GB_set_rgb_encode_callback
GB_set_rtc_mode
GB_set_rtc_multiplier
GB_set_rumble_callback
GB_set_rumble_mode
GB_set_sample_rate
GB_set_serial_transfer_bit_end_callback
GB_set_serial_transfer_bit_start_callback
GB_set_turbo_mode
GB_set_update_input_hint_callback
GB_set_user_data and GB_get_user_data
GB_set_vblank_callback
GB_set_write_memory_callback
GB_start_audio_recording
GB_stop_audio_recording
GB_switch_model_and_reset
GB_time_to_alarm
GB_unlikely
GB_update_cheat
GB_workboy_is_enabled
GB_workboy_set_key
GB_write_memory
Home
IO Register Constants
Instance Allocation
No results
2
IO Register Constants
Lior Halphon edited this page 2024-12-01 01:09:32 +02:00
Table of Contents
Definition
enum {
/* Joypad and Serial */
GB_IO_JOYP = 0x00, // Joypad (R/W)
GB_IO_SB = 0x01, // Serial transfer data (R/W)
GB_IO_SC = 0x02, // Serial Transfer Control (R/W)
/* Missing */
/* Timers */
GB_IO_DIV = 0x04, // Divider Register (R/W)
GB_IO_TIMA = 0x05, // Timer counter (R/W)
GB_IO_TMA = 0x06, // Timer Modulo (R/W)
GB_IO_TAC = 0x07, // Timer Control (R/W)
/* Missing */
GB_IO_IF = 0x0F, // Interrupt Flag (R/W)
/* Sound */
GB_IO_NR10 = 0x10, // Channel 1 Sweep register (R/W)
GB_IO_NR11 = 0x11, // Channel 1 Sound length/Wave pattern duty (R/W)
GB_IO_NR12 = 0x12, // Channel 1 Volume Envelope (R/W)
GB_IO_NR13 = 0x13, // Channel 1 Frequency lo (Write Only)
GB_IO_NR14 = 0x14, // Channel 1 Frequency hi (R/W)
/* NR20 does not exist */
GB_IO_NR21 = 0x16, // Channel 2 Sound Length/Wave Pattern Duty (R/W)
GB_IO_NR22 = 0x17, // Channel 2 Volume Envelope (R/W)
GB_IO_NR23 = 0x18, // Channel 2 Frequency lo data (W)
GB_IO_NR24 = 0x19, // Channel 2 Frequency hi data (R/W)
GB_IO_NR30 = 0x1A, // Channel 3 Sound on/off (R/W)
GB_IO_NR31 = 0x1B, // Channel 3 Sound Length
GB_IO_NR32 = 0x1C, // Channel 3 Select output level (R/W)
GB_IO_NR33 = 0x1D, // Channel 3 Frequency's lower data (W)
GB_IO_NR34 = 0x1E, // Channel 3 Frequency's higher data (R/W)
/* NR40 does not exist */
GB_IO_NR41 = 0x20, // Channel 4 Sound Length (R/W)
GB_IO_NR42 = 0x21, // Channel 4 Volume Envelope (R/W)
GB_IO_NR43 = 0x22, // Channel 4 Polynomial Counter (R/W)
GB_IO_NR44 = 0x23, // Channel 4 Counter/consecutive, Initial (R/W)
GB_IO_NR50 = 0x24, // Channel control / ON-OFF / Volume (R/W)
GB_IO_NR51 = 0x25, // Selection of Sound output terminal (R/W)
GB_IO_NR52 = 0x26, // Sound on/off
/* Missing */
GB_IO_WAV_START = 0x30, // Wave pattern start
GB_IO_WAV_END = 0x3F, // Wave pattern end
/* Graphics */
GB_IO_LCDC = 0x40, // LCD Control (R/W)
GB_IO_STAT = 0x41, // LCDC Status (R/W)
GB_IO_SCY = 0x42, // Scroll Y (R/W)
GB_IO_SCX = 0x43, // Scroll X (R/W)
GB_IO_LY = 0x44, // LCDC Y-Coordinate (R)
GB_IO_LYC = 0x45, // LY Compare (R/W)
GB_IO_DMA = 0x46, // DMA Transfer and Start Address (W)
GB_IO_BGP = 0x47, // BG Palette Data (R/W) - Non CGB Mode Only
GB_IO_OBP0 = 0x48, // Object Palette 0 Data (R/W) - Non CGB Mode Only
GB_IO_OBP1 = 0x49, // Object Palette 1 Data (R/W) - Non CGB Mode Only
GB_IO_WY = 0x4A, // Window Y Position (R/W)
GB_IO_WX = 0x4B, // Window X Position minus 7 (R/W)
// Controls DMG mode and PGB mode
GB_IO_KEY0 = 0x4C,
/* General CGB features */
GB_IO_KEY1 = 0x4D, // CGB Mode Only - Prepare Speed Switch
/* Missing */
GB_IO_VBK = 0x4F, // CGB Mode Only - VRAM Bank
GB_IO_BANK = 0x50, // Write to disable the boot ROM mapping
/* CGB DMA */
GB_IO_HDMA1 = 0x51, // CGB Mode Only - New DMA Source, High
GB_IO_HDMA2 = 0x52, // CGB Mode Only - New DMA Source, Low
GB_IO_HDMA3 = 0x53, // CGB Mode Only - New DMA Destination, High
GB_IO_HDMA4 = 0x54, // CGB Mode Only - New DMA Destination, Low
GB_IO_HDMA5 = 0x55, // CGB Mode Only - New DMA Length/Mode/Start
/* IR */
GB_IO_RP = 0x56, // CGB Mode Only - Infrared Communications Port
/* Missing */
/* CGB Palettes */
GB_IO_BGPI = 0x68, // CGB Mode Only - Background Palette Index
GB_IO_BGPD = 0x69, // CGB Mode Only - Background Palette Data
GB_IO_OBPI = 0x6A, // CGB Mode Only - Object Palette Index
GB_IO_OBPD = 0x6B, // CGB Mode Only - Object Palette Data
GB_IO_OPRI = 0x6C, // Affects object priority (X based or index based)
/* Missing */
GB_IO_SVBK = 0x70, // CGB Mode Only - WRAM Bank
GB_IO_PSM = 0x71, // Palette Selection Mode, controls the PSW and key combo
GB_IO_PSWX = 0x72, // X position of the palette switching window
GB_IO_PSWY = 0x73, // Y position of the palette switching window
GB_IO_PSW = 0x74, // Key combo to trigger the palette switching window
GB_IO_UNKNOWN5 = 0x75, // (8Fh) - Bit 4-6 (Read/Write)
GB_IO_PCM12 = 0x76, // Channels 1 and 2 amplitudes
GB_IO_PCM34 = 0x77, // Channels 3 and 4 amplitudes
};
enum {
GB_LCDC_BG_EN = 1,
GB_LCDC_OBJ_EN = 2,
GB_LCDC_OBJ_SIZE = 4,
GB_LCDC_BG_MAP = 8,
GB_LCDC_TILE_SEL = 0x10,
GB_LCDC_WIN_ENABLE = 0x20,
GB_LCDC_WIN_MAP = 0x40,
GB_LCDC_ENABLE = 0x80,
};
In gb.h
Description
Constants for accessing memory-mapped IO registers. GB_IO_* constants are offsets from the MMIO base (0xFF00). GB_LCDC_* constants are bit masks for the LCDC register.