mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-29 15:51:02 +00:00
Display emulation status
This commit is contained in:
110
page/src/fb/debugger/emulation-status.ts
Normal file
110
page/src/fb/debugger/emulation-status.ts
Normal file
@@ -0,0 +1,110 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
|
||||
|
||||
export class EmulationStatus implements flatbuffers.IUnpackableObject<EmulationStatusT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):EmulationStatus {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsEmulationStatus(bb:flatbuffers.ByteBuffer, obj?:EmulationStatus):EmulationStatus {
|
||||
return (obj || new EmulationStatus()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsEmulationStatus(bb:flatbuffers.ByteBuffer, obj?:EmulationStatus):EmulationStatus {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new EmulationStatus()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
executedInstructions():bigint {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
|
||||
}
|
||||
|
||||
mutate_executed_instructions(value:bigint):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb!.writeUint64(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
activeThreads():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
mutate_active_threads(value:number):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb!.writeUint32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
static startEmulationStatus(builder:flatbuffers.Builder) {
|
||||
builder.startObject(2);
|
||||
}
|
||||
|
||||
static addExecutedInstructions(builder:flatbuffers.Builder, executedInstructions:bigint) {
|
||||
builder.addFieldInt64(0, executedInstructions, BigInt('0'));
|
||||
}
|
||||
|
||||
static addActiveThreads(builder:flatbuffers.Builder, activeThreads:number) {
|
||||
builder.addFieldInt32(1, activeThreads, 0);
|
||||
}
|
||||
|
||||
static endEmulationStatus(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
|
||||
static createEmulationStatus(builder:flatbuffers.Builder, executedInstructions:bigint, activeThreads:number):flatbuffers.Offset {
|
||||
EmulationStatus.startEmulationStatus(builder);
|
||||
EmulationStatus.addExecutedInstructions(builder, executedInstructions);
|
||||
EmulationStatus.addActiveThreads(builder, activeThreads);
|
||||
return EmulationStatus.endEmulationStatus(builder);
|
||||
}
|
||||
|
||||
unpack(): EmulationStatusT {
|
||||
return new EmulationStatusT(
|
||||
this.executedInstructions(),
|
||||
this.activeThreads()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
unpackTo(_o: EmulationStatusT): void {
|
||||
_o.executedInstructions = this.executedInstructions();
|
||||
_o.activeThreads = this.activeThreads();
|
||||
}
|
||||
}
|
||||
|
||||
export class EmulationStatusT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public executedInstructions: bigint = BigInt('0'),
|
||||
public activeThreads: number = 0
|
||||
){}
|
||||
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
return EmulationStatus.createEmulationStatus(builder,
|
||||
this.executedInstructions,
|
||||
this.activeThreads
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user