abstract class GB::Cartridge

Direct Known Subclasses

Defined in:

crab/gb/cartridge.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(rom_path : String) : Cartridge #

open rom, determine MBC type, and initialize the correct cartridge


[View source]
def self.new(rom : Bytes) : Cartridge #

create a new Cartridge with the given bytes as rom


[View source]

Instance Method Detail

abstract def [](index : Int) : UInt8 #

read from cartridge memory


[View source]
abstract def []=(index : Int, value : UInt8) : Nil #

[View source]
def cgb : CGB #

[View source]
def load_game : Nil #

load the game from a .sav file


[View source]
def ram_bank_offset(bank_number : Int) : Int #

the offset of the given bank number in ram


[View source]
def ram_offset(index : Int) : Int #

adjust the index for local ram


[View source]
def ram_size : Int32 #

[View source]
def rom_bank_offset(bank_number : Int) : Int #

the offset of the given bank number in rom


[View source]
def rom_offset(index : Int) : Int #

adjust the index for local rom


[View source]
def rom_size : UInt32 #

[View source]
def sav_file_path : String #

[View source]
def sav_file_path=(sav_file_path : String) #

[View source]
def save_game : Nil #

save the game to a .sav file


[View source]
def title : String #

[View source]