struct Chip8

Overview

The chip object. Contains all the memory and registers of the Chip-8

Defined in:

interpreter.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(file_name, test = Array(UInt8).new) #

[View source]

Instance Method Detail

def delay_reg : UInt8 #

special purpose 8Bit delay register. Decremented at 60Hz


[View source]
def delay_reg=(delay_reg : UInt8) #

special purpose 8Bit delay register. Decremented at 60Hz


[View source]
def i_reg : UInt16 #

16Bit I register


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

16Bit I register


[View source]
def interpret #

[View source]
def load_file(file_name) #

reads in the binary file with chip8 instructions and loads it into memory


[View source]
def load_memory(data : Array(UInt8)) #

Use for manually loading memory values for testing


[View source]
def mem : Array(UInt8) #

4KB of RAM starting at 0x000 to 0xFFF First 512B (0x000 to 0x1FF) are for interpreter and shouldn't be used property mem = Array(UInt8).new(MAX_MEMORY, 0)


[View source]
def mem=(mem : Array(UInt8)) #

4KB of RAM starting at 0x000 to 0xFFF First 512B (0x000 to 0x1FF) are for interpreter and shouldn't be used property mem = Array(UInt8).new(MAX_MEMORY, 0)


[View source]
def mem_size : Int32 #

This will store how large the actual file is


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

This will store how large the actual file is


[View source]
def pc : UInt16 #

16Bit program counter


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

16Bit program counter


[View source]
def reg : Array(UInt8) #

16 general purpose 8Bit registers


[View source]
def reg=(reg : Array(UInt8)) #

16 general purpose 8Bit registers


[View source]
def sound_reg : UInt8 #

special purpose 8Bit sound timer. Decremented at 60Hz


[View source]
def sound_reg=(sound_reg : UInt8) #

special purpose 8Bit sound timer. Decremented at 60Hz


[View source]
def sp : UInt8 #

8Bit stack pointer


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

8Bit stack pointer


[View source]
def stack : Array(UInt16) #

16 16bit stack values


[View source]
def stack=(stack : Array(UInt16)) #

16 16bit stack values


[View source]