import { BankType , SimulatedMemory } from './simmemory' ; import { CustomMemoryType } from '../../settings' ; /**
 * Takes the custom memory model description and creates a memory out of it.
 */ export class CustomMemory extends SimulatedMemory { param customMemory constructor ( customMemory ) { super ( customMemory . numberOfBanks , customMemory . numberOfBanks ) ; const nob = customMemory . numberOfBanks ; for ( let b = 0 ; b < nob ; b ++ ) { let bankName = customMemory . banks [ b . toString ( ) ] ; let bankType = BankType . UNUSED ; if ( bankName != undefined ) bankType = ( BankType as any ) [ bankName ] ; this . bankTypes [ b ] = bankType ; if ( bankType == BankType . UNUSED ) { this . fillBank ( b , 0xFF ) ; } } } }