class GBA::CPU

Included Modules

Defined in:

crab/gba/cpu.cr

Constant Summary

CLOCK_SPEED = 2 ** 24

Constructors

Instance Method Summary

Instance methods inherited from module GBA::Waitloop

analyze_loop(start_addr : UInt32, end_addr : UInt32) : Nil analyze_loop, attempt_waitloop_detection : Bool attempt_waitloop_detection, attempt_waitloop_detection=(attempt_waitloop_detection : Bool) attempt_waitloop_detection=, build_lut : Slice(Instruction.class) build_lut, cache_waitloop_results : Bool cache_waitloop_results, cache_waitloop_results=(cache_waitloop_results : Bool) cache_waitloop_results=, waitloop_instr_lut : Slice(Instruction.class) waitloop_instr_lut

Instance methods inherited from module GBA::THUMB

fill_thumb_lut fill_thumb_lut, thumb_add_offset_to_stack_pointer(instr : UInt32) : Nil thumb_add_offset_to_stack_pointer, thumb_add_subtract(instr : UInt32) : Nil thumb_add_subtract, thumb_alu_operations(instr : UInt32) : Nil thumb_alu_operations, thumb_conditional_branch(instr : UInt32) : Nil thumb_conditional_branch, thumb_execute(instr : UInt32) : Nil thumb_execute, thumb_high_reg_branch_exchange(instr : UInt32) : Nil thumb_high_reg_branch_exchange, thumb_load_address(instr : UInt32) : Nil thumb_load_address, thumb_load_store_halfword(instr : UInt32) : Nil thumb_load_store_halfword, thumb_load_store_immediate_offset(instr : UInt32) : Nil thumb_load_store_immediate_offset, thumb_load_store_register_offset(instr : UInt32) : Nil thumb_load_store_register_offset, thumb_load_store_sign_extended(instr : UInt32) : Nil thumb_load_store_sign_extended, thumb_long_branch_link(instr : UInt32) : Nil thumb_long_branch_link, thumb_move_compare_add_subtract(instr : UInt32) : Nil thumb_move_compare_add_subtract, thumb_move_shifted_register(instr : UInt32) : Nil thumb_move_shifted_register, thumb_multiple_load_store(instr : UInt32) : Nil thumb_multiple_load_store, thumb_pc_relative_load(instr : UInt32) : Nil thumb_pc_relative_load, thumb_push_pop_registers(instr : UInt32) : Nil thumb_push_pop_registers, thumb_software_interrupt(instr : UInt32) : Nil thumb_software_interrupt, thumb_sp_relative_load_store(instr : UInt32) : Nil thumb_sp_relative_load_store, thumb_unconditional_branch(instr : UInt32) : Nil thumb_unconditional_branch, thumb_unimplemented(instr : UInt32) : Nil thumb_unimplemented

Instance methods inherited from module GBA::ARM

arm_block_data_transfer(instr : UInt32) : Nil arm_block_data_transfer, arm_branch(instr : UInt32) : Nil arm_branch, arm_branch_exchange(instr : UInt32) : Nil arm_branch_exchange, arm_data_processing(instr : UInt32) : Nil arm_data_processing, arm_execute(instr : UInt32) : Nil arm_execute, arm_halfword_data_transfer_immediate(instr : UInt32) : Nil arm_halfword_data_transfer_immediate, arm_halfword_data_transfer_register(instr : UInt32) : Nil arm_halfword_data_transfer_register, arm_multiply(instr : UInt32) : Nil arm_multiply, arm_multiply_long(instr : UInt32) : Nil arm_multiply_long, arm_psr_transfer(instr : UInt32) : Nil arm_psr_transfer, arm_single_data_swap(instr : UInt32) : Nil arm_single_data_swap, arm_single_data_transfer(instr : UInt32) : Nil arm_single_data_transfer, arm_software_interrupt(instr : UInt32) : Nil arm_software_interrupt, arm_unimplemented(instr : UInt32) : Nil arm_unimplemented, arm_unused(instr : UInt32) : Nil arm_unused, fill_lut : Slice(Proc(UInt32, Nil)) fill_lut, immediate_offset(instr : UInt32, carry_out : Pointer(Bool)) : UInt32 immediate_offset, rotate_register(instr : UInt32, carry_out : Pointer(Bool), allow_register_shifts : Bool) : UInt32 rotate_register

Constructor Detail

def self.new(gba : GBA) #

[View source]

Instance Method Detail

def adc(operand_1 : UInt32, operand_2 : UInt32, set_conditions : Bool) : UInt32 #

Add two values with carry


[View source]
def add(operand_1 : UInt32, operand_2 : UInt32, set_conditions : Bool) : UInt32 #

Add two values


[View source]
def asr(word : UInt32, bits : Int::Unsigned, immediate : Bool, carry_out : Pointer(Bool)) : UInt32 #

Arithmetic shift right


[View source]
def check_cond(cond : UInt32) : Bool #

[View source]
def clear_pipeline : Nil #

[View source]
def count_cycles : Int32 #

[View source]
def count_cycles=(count_cycles : Int32) #

[View source]
def cpsr : PSR #

[View source]
def fill_pipeline : Nil #

[View source]
def halted : Bool #

[View source]
def halted=(halted : Bool) #

[View source]
def irq : Nil #

[View source]
def lsl(word : UInt32, bits : Int::Unsigned, carry_out : Pointer(Bool)) : UInt32 #

Logical shift left


[View source]
def lsr(word : UInt32, bits : Int::Unsigned, immediate : Bool, carry_out : Pointer(Bool)) : UInt32 #

Logical shift right


[View source]
def lut : Slice(Proc(UInt32, Nil)) #

[View source]
def pipeline : GBA::Pipeline #

[View source]
def print_state(instr : UInt32 | Nil = nil) : Nil #

[View source]
def r : Slice(UInt32) #

[View source]
def read_instr : UInt32 #

[View source]
def ror(word : UInt32, bits : Int::Unsigned, immediate : Bool, carry_out : Pointer(Bool)) : UInt32 #

Rotate right


[View source]
def sbc(operand_1 : UInt32, operand_2 : UInt32, set_conditions : Bool) : UInt32 #

Subtract two values with carry


[View source]
def set_neg_and_zero_flags(value : UInt32) : Nil #

[View source]
def set_reg(reg : Int, value : UInt32) : UInt32 #

[View source]
def skip_bios : Nil #

[View source]
def step_arm : Nil #

[View source]
def step_thumb : Nil #

[View source]
def sub(operand_1 : UInt32, operand_2 : UInt32, set_conditions : Bool) : UInt32 #

Subtract two values


[View source]
def switch_mode(new_mode : Mode) : Nil #

[View source]
def thumb_lut : Slice(Proc(UInt32, Nil)) #

[View source]
def tick : Nil #

[View source]