Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- abstract Rom
- type InesHeader
- PrgRomSize::UInt8
- ChrRomSize::UInt8
- IgnoreMirror::Bool
- Trainer::Bool
- HasBatteryRam::Bool
- Mirror::Bool
- IsNES2Format::Bool
- Arcade2::Bool
- Arcade1::Bool
- PrgRamSize::UInt8
- TVSystem::Bool
- BusConflict::Bool
- PrgRam::Bool
- TVSystem2::UInt8
- Mapper::UInt8
- end
- type Ines <: Rom
- Header::InesHeader
- Rom::Array{UInt8,1}
- Ines(file::String) = begin
- rom = Mmap.mmap(file)
- return((InesHeader(
- rom[5]*16,
- rom[6]*8,
- Bool(rom[7] & 0b00001000),
- Bool(rom[7] & 0b00000100),
- Bool(rom[7] & 0b00000010),
- Bool(rom[7] & 0b00000001),
- if ((rom[8] & 0b00001100) >> 2) == 2
- true
- else
- false
- end,
- Bool(rom[8] * 0b00000010),
- Bool(rom[8] * 0b00000001),
- rom[9] * 8,
- Bool(rom[10] & 0x1),
- Bool(rom[11] & 0b00100000),
- Bool(rom[11] & 0b00010000),
- rom[11] & 0x3,
- (rom[7] & 0b11110000) | (rom[8] & 0b00001111)
- ), rom[16:end]))
- end
- end
- test_rom = Ines("/home/john/Code/ksy/specimens/ines/2600\ Bros\ (SMB1\ Hack).nes")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement