export const enum DebuggerEvents { UPDATE = "debug-update" } export const enum RunState { Paused , Stepping , Running } export const enum Register { r0 , at , v0 , v1 , a0 , a1 , a2 , a3 , t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 , s0 , s1 , s2 , s3 , s4 , s5 , s6 , s7 , t8 , t9 , k0 , k1 , gp , sp , fp , ra } export const enum BpFlags { Enabled = 0x01 , Read = 0x02 , Write = 0x04 , Exec = 0x08 , Log = 0x10 , All = Enabled | Read | Write | Exec | Log , RW = Enabled | Read | Write , RWX = Enabled | Read | Write | Exec } export interface BpStruct { address : number ; endAddress : number ; flags : BpFlags ; } export interface BpTriggerInfo { flags : BpFlags ; address : number ; } export const enum MemType { NoMem , Nothing , RDRAM , RDRAMReg , RSPMem , RSPReg , RSP , DP , DPS , VI , AI , PI , RI , SI , FlashRAMStat , ROM , PIF , MI , Breakpoint } export const enum MemFlags { Readable = 0x01 , Writable = 0x02 , ReadableEmuOnly = 0x04 , WritableEmuOnly = 0x08 } export interface Debugger { isSupported ( ) : boolean ; isEnabled ( ) : boolean ; isInitialized ( ) : boolean ; getRunState ( ) : RunState ; setRunState ( state ) : void ; step ( ) : void ; decodeOp ( inst , pc ) : string ; memRead64 ( addr ) : number ; memRead32 ( addr ) : number ; memRead16 ( addr ) : number ; memRead8 ( addr ) : number ; memWrite64 ( addr , val ) : void ; memWrite32 ( addr , val ) : void ; memWrite16 ( addr , val ) : void ; memWrite8 ( addr , val ) : void ; bpCount ( ) : number ; bpLookup ( addr , size , flags ) : number ; bpAddAddress ( addr ) : number ; bpAddStruct ( bp ) : number ; bpReplace ( index , bp ) : void ; bpRemoveAddress ( addr ) : void ; bpRemoveIndex ( index ) : void ; bpEnable ( index ) : void ; bpDisable ( index ) : void ; bpCheck ( addr ) : number ; bpTriggeredBy ( ) : BpTriggerInfo ; getPrevPC ( ) : number ; readPC ( ) : number ; writePC ( pc ) : void ; readRegister ( reg ) : number ; writeRegister ( reg , val ) : void ; virtualToPhysical ( addr ) : number ; getMemType ( addr ) : MemType ; getMemFlags ( addr ) : MemFlags ; }