class CPU

Defined in:

cryboy/cpu.cr

Constant Summary

CLOCK_SPEED = 4194304

Constructors

Instance Method Summary

Macro Summary

Constructor Detail

def self.new(gb : Motherboard) #

[View source]

Instance Method Detail

def a : UInt8 #

[View source]
def a=(value : UInt8) : UInt8 #

[View source]
def af : UInt16 #

[View source]
def af=(value : UInt16) : UInt16 #

[View source]
def af=(value : UInt8) : UInt16 #

[View source]
def b : UInt8 #

[View source]
def b=(value : UInt8) : UInt8 #

[View source]
def bc : UInt16 #

[View source]
def bc=(value : UInt16) : UInt16 #

[View source]
def bc=(value : UInt8) : UInt16 #

[View source]
def c : UInt8 #

[View source]
def c=(value : UInt8) : UInt8 #

[View source]
def d : UInt8 #

[View source]
def d=(value : UInt8) : UInt8 #

[View source]
def de : UInt16 #

[View source]
def de=(value : UInt16) : UInt16 #

[View source]
def de=(value : UInt8) : UInt16 #

[View source]
def e : UInt8 #

[View source]
def e=(value : UInt8) : UInt8 #

[View source]
def f : UInt8 #

[View source]
def f=(value : UInt8) : UInt8 #

[View source]
def f_c : Bool #

[View source]
def f_c=(on : Int | Bool) #

[View source]
def f_h : Bool #

[View source]
def f_h=(on : Int | Bool) #

[View source]
def f_n : Bool #

[View source]
def f_n=(on : Int | Bool) #

[View source]
def f_nc : Bool #

[View source]
def f_nh : Bool #

[View source]
def f_nn : Bool #

[View source]
def f_nz : Bool #

[View source]
def f_z : Bool #

[View source]
def f_z=(on : Int | Bool) #

[View source]
def h : UInt8 #

[View source]
def h=(value : UInt8) : UInt8 #

[View source]
def halt : Nil #

Handle regular and obscure halting behavior


[View source]
def handle_interrupts #

service all interrupts


[View source]
def hl : UInt16 #

[View source]
def hl=(value : UInt16) : UInt16 #

[View source]
def hl=(value : UInt8) : UInt16 #

[View source]
def ime : Bool #

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

[View source]
def inc_pc : Nil #

Increment PC unless the halt bug should cause it to fail to increment


[View source]
def l : UInt8 #

[View source]
def l=(value : UInt8) : UInt8 #

[View source]
def memory : Memory #

[View source]
def memory=(memory : Memory) #

[View source]
def memory_at_hl : UInt8 #

[View source]
def memory_at_hl=(val : UInt8) : Nil #

[View source]
def pc : UInt16 #

[View source]
def pc=(pc : UInt16) #

[View source]
def print_state(op : String | Nil = nil) : Nil #

[View source]
def scheduler : Scheduler #

[View source]
def scheduler=(scheduler : Scheduler) #

[View source]
def skip_boot : Nil #

[View source]
def sp : UInt16 #

[View source]
def sp=(sp : UInt16) #

[View source]
def tick : Nil #

Runs for the specified number of machine cycles. If no argument provided, runs only one instruction. Handles interrupts after the instruction is executed.


[View source]

Macro Detail

macro flag(name, mask) #

[View source]
macro register(upper, lower, mask = nil) #

[View source]