From http://www.jwz.org/xscreensaver/xscreensaver-5.18.tar.gz
[xscreensaver] / hacks / asm6502.h
index 6f64d218ae4811eb0bb277dda58e3fdb16141b88..79b13a2b0144b0c9e1337370b3591358ec989a3c 100644 (file)
@@ -56,7 +56,7 @@ typedef enum{
     ZERO, ZERO_X, ZERO_Y,
     ABS_VALUE, ABS_OR_BRANCH, ABS_X, ABS_Y,
     ABS_LABEL_X, ABS_LABEL_Y, DCB_PARAM
-} AddrMode;
+} m6502_AddrMode;
 
 typedef struct machine_6502 machine_6502;
 
@@ -73,14 +73,14 @@ typedef struct {
   Bit8 INDY;
   Bit8 SNGL;
   Bit8 BRA;
-  void (*func) (machine_6502*, AddrMode);
-} Opcodes;
+  void (*func) (machine_6502*, m6502_AddrMode);
+} m6502_Opcodes;
 
 /* Used to cache the index of each opcode */
 typedef struct {
   Bit8 index;
-  AddrMode adm;
-} OpcodeIndex;
+  m6502_AddrMode adm;
+} m6502_OpcodeIndex;
 
 /* Plotter is a function that will be called everytime a pixel
    needs to be updated. The first two parameter are the x and y
@@ -108,7 +108,7 @@ typedef struct {
    parameter. You can use this parameter to store state information.
 
 */
-typedef void (*Plotter) (Bit8, Bit8, Bit8, void*);
+typedef void (*m6502_Plotter) (Bit8, Bit8, Bit8, void*);
 
 struct machine_6502 {
   BOOL codeCompiledOK;
@@ -124,54 +124,54 @@ struct machine_6502 {
   int labelPtr;
   BOOL codeRunning;
   int myInterval;
-  Opcodes opcodes[NUM_OPCODES];
+  m6502_Opcodes opcodes[NUM_OPCODES];
   int screen[32][32];
   int codeLen;
-  OpcodeIndex opcache[0xff];
-  Plotter plot;
+  m6502_OpcodeIndex opcache[0xff];
+  m6502_Plotter plot;
   void *plotterState;
 };
 
 /* build6502() - Creates an instance of the 6502 machine */
-machine_6502 *build6502(void);
+machine_6502 *m6502_build(void);
 
 /* destroy6502() - compile the file and exectue it until the program
    is finished */
-void destroy6502(machine_6502 *machine);
+void m6502_destroy6502(machine_6502 *machine);
 
 /* eval_file() - Compiles and runs a file until the program is
    finished */
-void eval_file(machine_6502 *machine, const char *filename, 
-              Plotter plot, void *plotterState);
+void m6502_eval_file(machine_6502 *machine, const char *filename, 
+              m6502_Plotter plot, void *plotterState);
 
 /* start_eval_file() - Compile the file and execute the first
    instruction */
-void start_eval_file(machine_6502 *machine, const char *filename, 
-                    Plotter plot, void *plotterState);
+void m6502_start_eval_file(machine_6502 *machine, const char *filename, 
+                    m6502_Plotter plot, void *plotterState);
 
 /* XXX
-void start_eval_binary(machine_6502 *machine, Bit8 *program,
+void m6502_start_eval_binary(machine_6502 *machine, Bit8 *program,
                       unsigned int proglen,
                       Plotter plot, void *plotterState);
 */
 
-void start_eval_string(machine_6502 *machine, const char *code,
-                      Plotter plot, void *plotterState);
+void m6502_start_eval_string(machine_6502 *machine, const char *code,
+                      m6502_Plotter plot, void *plotterState);
 
 /* next_eval() - Execute the next insno of machine instructions */
-void next_eval(machine_6502 *machine, int insno);
+void m6502_next_eval(machine_6502 *machine, int insno);
 
 /* hexDump() - Dumps memory to output */
-void hexDump(machine_6502 *machine, Bit16 start, 
+void m6502_hexDump(machine_6502 *machine, Bit16 start, 
             Bit16 numbytes, FILE *output);
 
 /* Disassemble() - Prints the assembly code for the program currently
    loaded in memory.*/
-void disassemble(machine_6502 *machine, FILE *output);
+void m6502_disassemble(machine_6502 *machine, FILE *output);
 
 /* trace() - Prints to output the current value of registers, the
    current nmemonic, memory address and value. */
-void trace(machine_6502 *machine, FILE *output);
+void m6502_trace(machine_6502 *machine, FILE *output);
 
 /* save_program() - Writes a binary file of the program loaded in
    memory. */