import { Utility } from '../../misc/utility' ; import { PagedMemory } from './pagedmemory' ; import * as fs from 'fs' ; import { BankType } from './simmemory' ; /**
 * Represents the memory of a ZX Next.
 * Especially sets the ROM area and
 * the initial slot/bank configuration.
 */ export class ZxNextMemory extends PagedMemory { constructor ( ) { super ( 8 , 256 ) ; this . bankTypes [ 0xFE ] = BankType . ROM ; this . bankTypes [ 0xFF ] = BankType . ROM ; this . slots = [ 0xFE , 0xFF , 10 , 11 , 4 , 5 , 0 , 1 ] ; const romFilePath = Utility . getExtensionPath ( ) + '/data/48.rom' ; const romBuffer = fs . readFileSync ( romFilePath ) ; const size = 0x2000 ; const rom_a = new Uint8Array ( romBuffer . buffer , 0 , size ) ; const rom_b = new Uint8Array ( romBuffer . buffer , size , size ) ; this . writeBank ( 0xFE , rom_a ) ; this . writeBank ( 0xFF , rom_b ) ; } }