import { DecodeRegisterData , RegisterData } from './decoderegisterdata' ; import { Z80_REG } from './z80registers' ; /**
 * The standard decoder for registers.
 * Can be used if no external remote is involved, e.g. for the internal
 * simulator.
 */ export class Z80RegistersStandardDecoder extends DecodeRegisterData { param data returns public parsePC ( data ) { return data [ Z80_REG . PC ] ; } public parseSP ( data ) { return data [ Z80_REG . SP ] ; } public parseAF ( data ) { return data [ Z80_REG . AF ] ; } public parseBC ( data ) { return data [ Z80_REG . BC ] ; } public parseHL ( data ) { return data [ Z80_REG . HL ] ; } public parseDE ( data ) { return data [ Z80_REG . DE ] ; } public parseIX ( data ) { return data [ Z80_REG . IX ] ; } public parseIY ( data ) { return data [ Z80_REG . IY ] ; } public parseAF2 ( data ) { return data [ Z80_REG . AF2 ] ; } public parseBC2 ( data ) { return data [ Z80_REG . BC2 ] ; } public parseHL2 ( data ) { return data [ Z80_REG . HL2 ] ; } public parseDE2 ( data ) { return data [ Z80_REG . DE2 ] ; } public parseI ( data ) { return data [ Z80_REG . IR ] >>> 8 ; } public parseR ( data ) { return data [ Z80_REG . IR ] & 0xFF ; } public parseIM ( data ) { return data [ Z80_REG . IM ] ; } public parseSlots ( data ) { let i = Z80_REG . IM + 1 ; const slotCount = data [ i ++ ] ; const slots = new Array < number > ( slotCount ) ; for ( let k = 0 ; k < slotCount ; k ++ ) { slots [ k ] = data [ i ++ ] ; } return slots ; } }