REFACTOR : brace x86-specific defines, prep for __arm__

This commit is contained in:
Aaron Culliney 2015-02-09 21:45:20 -08:00
parent b246baa90d
commit 7bd7899325
3 changed files with 24 additions and 27 deletions

View File

@ -17,6 +17,9 @@
#ifndef __CPU_H_ #ifndef __CPU_H_
#define __CPU_H_ #define __CPU_H_
// Virtual machine is an Apple //e (not an NES, etc...)
#define APPLE2_VM 1
#if !defined(__ASSEMBLER__) #if !defined(__ASSEMBLER__)
#include <sys/types.h> #include <sys/types.h>
#include <stdint.h> #include <stdint.h>
@ -76,30 +79,28 @@ void cpu65_trace_checkpoint(void);
#define IRQGeneric 0x80 #define IRQGeneric 0x80
/* Note: These are *not* the bit positions used for the flags in the P /* Note: These are *not* the bit positions used for the flags in the P
* register of a real 6502. Rather, they have been distorted so that C, * register of a real 65c02. Rather, they have been distorted so that C,
* N and Z match the analogous flags in the _80386_ flags register. * N, Z, etc match the analogous flags in the host flags register.
*
* Additionally, V matches the position of the overflow flag in the high byte
* of the 80386 register.
*
*/ */
#define C_Flag 0x1 /* 6502 Carry */ #if defined(__i386__) || defined(__x86_64__)
#define X_Flag 0x2 /* 6502 Xtra */ /*
#define I_Flag 0x4 /* 6502 Interrupt disable */ * x86 NOTE: V matches the position of the overflow flag in the high byte
#define V_Flag 0x8 /* 6502 Overflow */ * of the 80386 register.
#define B_Flag 0x10 /* 6502 Break */ */
#define D_Flag 0x20 /* 6502 Decimal mode */ # define C_Flag_Bit 8 /* 6502 Carry */
#define Z_Flag 0x40 /* 6502 Zero */ # define C_Flag (C_Flag_Bit>>3) /* 6502 Carry */
#define N_Flag 0x80 /* 6502 Neg */ # define X_Flag 0x2 /* 6502 Xtra */
# define I_Flag 0x4 /* 6502 Interrupt disable */
#define C_Flag_Bit 8 /* 6502 Carry */ # define V_Flag 0x8 /* 6502 Overflow */
#define X_Flag_Bit 9 /* 6502 Xtra */ # define B_Flag 0x10 /* 6502 Break */
#define I_Flag_Bit 10 /* 6502 Interrupt disable */ # define D_Flag 0x20 /* 6502 Decimal mode */
#define V_Flag_Bit 11 /* 6502 Overflow */ # define Z_Flag 0x40 /* 6502 Zero */
#define B_Flag_Bit 12 /* 6502 Break */ # define N_Flag 0x80 /* 6502 Neg */
#define D_Flag_Bit 13 /* 6502 Decimal mode */ #elif defined(__arm__)
#define Z_Flag_Bit 14 /* 6502 Zero */ # error in progress ...
#define N_Flag_Bit 15 /* 6502 Neg */ #elif defined(__aarch64__)
# error soon ...
#endif
/* /*
* 6502 flags bit mask * 6502 flags bit mask

View File

@ -18,9 +18,6 @@
#include "cpu.h" #include "cpu.h"
// Virtual machine is an Apple ][ (not an NES, etc...)
#define APPLE2_VM 1
#define X_Reg %bl /* 6502 X register in %bl */ #define X_Reg %bl /* 6502 X register in %bl */
#define Y_Reg %bh /* 6502 Y register in %bh */ #define Y_Reg %bh /* 6502 Y register in %bh */
#define A_Reg %cl /* 6502 A register in %cl */ #define A_Reg %cl /* 6502 A register in %cl */

View File

@ -14,7 +14,6 @@
* *
*/ */
#define __ASSEMBLY__
#include "misc.h" #include "misc.h"
#include "cpu-regs.h" #include "cpu-regs.h"