import { BankType , SimulatedMemory } from './simmemory' ; import * as fs from 'fs' ; import { Utility } from '../../misc/utility' ; /**
 * Represents the memory of a ZX 16k.
 * Especially sets the ROM area.
 */ export class Zx16Memory extends SimulatedMemory { constructor ( ) { super ( 4 , 4 ) ; this . bankTypes [ 0 ] = BankType . ROM ; const romFilePath = Utility . getExtensionPath ( ) + '/data/48.rom' ; const romBuffer = fs . readFileSync ( romFilePath ) ; const size = 0x4000 ; const rom = new Uint8Array ( romBuffer . buffer , 0 , size ) ; this . writeBank ( 0 , rom ) ; this . fillBank ( 2 , 0xFF ) ; this . bankTypes [ 2 ] = BankType . UNUSED ; this . fillBank ( 3 , 0xFF ) ; this . bankTypes [ 3 ] = BankType . UNUSED ; } }