mirror of
https://github.com/mattrberry/crab.git
synced 2025-01-03 06:54:52 +01:00
save memory 0x0F mirroring, default sram to 0xFF, less restrictive save type search
This commit is contained in:
parent
7444832159
commit
7679e985d6
3 changed files with 7 additions and 7 deletions
|
@ -23,8 +23,8 @@ class Bus
|
||||||
when 0x8, 0x9,
|
when 0x8, 0x9,
|
||||||
0xA, 0xB,
|
0xA, 0xB,
|
||||||
0xC, 0xD then @gba.cartridge.rom[index & 0x01FFFFFF]
|
0xC, 0xD then @gba.cartridge.rom[index & 0x01FFFFFF]
|
||||||
when 0xE then @gba.storage[index & 0xFFFF]
|
when 0xE, 0xF then @gba.storage[index & 0xFFFF]
|
||||||
else abort "Unmapped read: #{hex_str index.to_u32}"
|
else abort "Unmapped read: #{hex_str index.to_u32}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -49,8 +49,8 @@ class Bus
|
||||||
when 0x8, 0x9,
|
when 0x8, 0x9,
|
||||||
0xA, 0xB,
|
0xA, 0xB,
|
||||||
0xC, 0xD then (@gba.cartridge.rom.to_unsafe + (index & 0x01FFFFFF)).as(HalfWord*).value
|
0xC, 0xD then (@gba.cartridge.rom.to_unsafe + (index & 0x01FFFFFF)).as(HalfWord*).value
|
||||||
when 0xE then read_half_slow(index)
|
when 0xE, 0xF then read_half_slow(index)
|
||||||
else abort "Unmapped read: #{hex_str index.to_u32}"
|
else abort "Unmapped read: #{hex_str index.to_u32}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ abstract class Storage
|
||||||
FLASH512
|
FLASH512
|
||||||
FLASH1M
|
FLASH1M
|
||||||
|
|
||||||
def regex : Regex
|
def regex : Regex # don't rely on the 3 digits after this string
|
||||||
/#{self}_V\d{3}/
|
/#{self}_V/
|
||||||
end
|
end
|
||||||
|
|
||||||
def bytes : Int
|
def bytes : Int
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class SRAM < Storage
|
class SRAM < Storage
|
||||||
@memory = Bytes.new(Type::SRAM.bytes, 0x00)
|
@memory = Bytes.new(Type::SRAM.bytes, 0xFF)
|
||||||
|
|
||||||
def [](index : Int) : Byte
|
def [](index : Int) : Byte
|
||||||
index < @memory.size ? @memory[index] : 0_u8
|
index < @memory.size ? @memory[index] : 0_u8
|
||||||
|
|
Loading…
Reference in a new issue