X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Cyclone.h;h=f3c18359e0859a7d94e058b0affe7896e65a2a54;hb=refs%2Fheads%2Fmaster;hp=1933a46837dcca2b67676e7c15da510f12092480;hpb=c6237d9e43c8a8854155757b80b77161a9570535;p=cyclone68000.git diff --git a/Cyclone.h b/Cyclone.h index 1933a46..f3c1835 100644 --- a/Cyclone.h +++ b/Cyclone.h @@ -19,6 +19,8 @@ extern "C" { extern int CycloneVer; // Version number of library +extern long CycloneJumpTab[65536]; // default jump table + struct Cyclone { unsigned int d[8]; // [r7,#0x00] @@ -48,14 +50,21 @@ struct Cyclone int (*IrqCallback)(int int_level); // [r7,#0x8c] optional irq callback function, see config.h void (*ResetCallback)(void); // [r7,#0x90] if enabled in config.h, calls this whenever RESET opcode is encountered. int (*UnrecognizedCallback)(void); // [r7,#0x94] if enabled in config.h, calls this whenever unrecognized opcode is encountered. - unsigned int internal[6]; // [r7,#0x98] reserved for internal use, do not change. + void *internal_CycloneEnd; // [r7,#0x98] internal, do not modify + int internal_s_cycles; // [r7,#0x9c] internal, do not modify + void *internal_s_CycloneEnd; // [r7,#0xa0] internal, do not modify + unsigned int internal[3]; // [r7,#0xa4] reserved for internal use, do not change. }; // Initialize. Used only if Cyclone was compiled with compressed jumptable, see config.h -void CycloneInit(void); +#define CycloneInit() \ + CycloneInitJT(CycloneJumpTab) +void CycloneInitJT(void *jt); // Reset -void CycloneReset(struct Cyclone *pcy); +#define CycloneReset(pcy) \ + CycloneResetJT(pcy, CycloneJumpTab) +void CycloneResetJT(struct Cyclone *pcy, void *jt); // Run cyclone. Cycles should be specified in context (pcy->cycles) void CycloneRun(struct Cyclone *pcy); @@ -75,7 +84,9 @@ void CyclonePack(const struct Cyclone *pcy, void *save_buffer); void CycloneUnpack(struct Cyclone *pcy, const void *save_buffer); // genesis: if 1, switch to normal TAS handlers -void CycloneSetRealTAS(int use_real); +#define CycloneSetRealTAS(use_real) \ + CycloneSetRealTAS_JT(use_real, CycloneJumpTab) +void CycloneSetRealTAS_JT(int use_real, void *jt); // These values are special return values for IrqCallback.