mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-01-11 14:30:08 +00:00
whitespace changes for sanity and righteousness!
This commit is contained in:
parent
f462f79708
commit
6d9aa66c01
57
src/cpu.S
57
src/cpu.S
@ -31,12 +31,14 @@
|
||||
CPU (6502) Helper Routines
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#define GetFromPC_B movl PC_Reg_E, EffectiveAddr_E; \
|
||||
#define GetFromPC_B \
|
||||
movl PC_Reg_E, EffectiveAddr_E; \
|
||||
incw PC_Reg; \
|
||||
call *SN(cpu65_vmem) \
|
||||
(,EffectiveAddr_E,8);
|
||||
|
||||
#define GetFromPC_W movl PC_Reg_E, EffectiveAddr_E; \
|
||||
#define GetFromPC_W \
|
||||
movl PC_Reg_E, EffectiveAddr_E; \
|
||||
incw EffectiveAddr; \
|
||||
addw $2, PC_Reg; \
|
||||
call *SN(cpu65_vmem) \
|
||||
@ -46,10 +48,12 @@
|
||||
call *SN(cpu65_vmem) \
|
||||
(,EffectiveAddr_E,8); \
|
||||
|
||||
#define GetFromEA_B call *SN(cpu65_vmem) \
|
||||
#define GetFromEA_B \
|
||||
call *SN(cpu65_vmem) \
|
||||
(,EffectiveAddr_E,8);
|
||||
|
||||
#define GetFromEA_W incw EffectiveAddr; \
|
||||
#define GetFromEA_W \
|
||||
incw EffectiveAddr; \
|
||||
call *SN(cpu65_vmem) \
|
||||
(,EffectiveAddr_E,8); \
|
||||
decw EffectiveAddr; \
|
||||
@ -57,7 +61,8 @@
|
||||
call *SN(cpu65_vmem) \
|
||||
(,EffectiveAddr_E,8);
|
||||
|
||||
#define PutToEA_B call *SN(cpu65_vmem)+4\
|
||||
#define PutToEA_B \
|
||||
call *SN(cpu65_vmem)+4 \
|
||||
(,EffectiveAddr_E,8);
|
||||
#define GetFromMem_B(x) \
|
||||
movl x, EffectiveAddr_E; \
|
||||
@ -75,10 +80,12 @@
|
||||
(,EffectiveAddr_E,8); \
|
||||
|
||||
/* h means hooked */
|
||||
#define GetFromEA_Bh orb $1, SN(cpu65_debug)+3; \
|
||||
#define GetFromEA_Bh \
|
||||
orb $1, SN(cpu65_debug)+3; \
|
||||
GetFromEA_B
|
||||
|
||||
#define PutToEA_Bh orb $2, SN(cpu65_debug)+3; \
|
||||
#define PutToEA_Bh \
|
||||
orb $2, SN(cpu65_debug)+3; \
|
||||
orb %al, SN(cpu65_debug)+2; \
|
||||
PutToEA_B
|
||||
|
||||
@ -88,12 +95,14 @@
|
||||
|
||||
// NOTE: the orb functions as a move, but we want to
|
||||
// set the flags and we know %ah is zero
|
||||
#define Continue xorl %eax, %eax; \
|
||||
#define Continue \
|
||||
xorl %eax, %eax; \
|
||||
orb SN(cpu65__signal), %ah; \
|
||||
jnz exception; \
|
||||
jmp continue;
|
||||
|
||||
#define SaveState movw EffectiveAddr, SN(cpu65_debug); \
|
||||
#define SaveState \
|
||||
movw EffectiveAddr, SN(cpu65_debug); \
|
||||
movw PC_Reg, SN(cpu65_current); \
|
||||
movb A_Reg, SN(cpu65_current)+2; \
|
||||
movb F_Reg, SN(cpu65_current)+3; \
|
||||
@ -109,7 +118,8 @@
|
||||
* polluting this module with Apple-specific stuff. But we need to do
|
||||
* it, else aux-stack using programs will crash when debugged.)
|
||||
*/
|
||||
#define ReplaceState xorl %eax, %eax; \
|
||||
#define ReplaceState \
|
||||
xorl %eax, %eax; \
|
||||
xorl %ebx, %ebx; \
|
||||
xorl %ecx, %ecx; \
|
||||
movl $0x0100, %edx; \
|
||||
@ -159,7 +169,8 @@
|
||||
* constant, but saves three instruction prefixes.
|
||||
* This doesn't affect the cycle count.
|
||||
*/
|
||||
#define FlagNVZC pushfl; \
|
||||
#define FlagNVZC \
|
||||
pushfl; \
|
||||
popl %eax; \
|
||||
andl $0x08C1,%eax; \
|
||||
andb $~(N_Flag|V_Flag|Z_Flag|C_Flag), F_Reg; \
|
||||
@ -184,7 +195,8 @@
|
||||
|
||||
/* Zero Page Addressing - the second byte of the instruction is an
|
||||
address on the zero page */
|
||||
#define GetZPage GetFromPC_B; \
|
||||
#define GetZPage \
|
||||
GetFromPC_B; \
|
||||
movl %eax, EffectiveAddr_E;
|
||||
|
||||
/* Zero Page Indexed Addressing - The effective address is calculated by
|
||||
@ -192,23 +204,27 @@
|
||||
to the zero page addressing nature of this mode, no carry is added
|
||||
to the high address byte, and the crossing of page boundaries does
|
||||
not occur. */
|
||||
#define GetZPage_X GetFromPC_B; \
|
||||
#define GetZPage_X \
|
||||
GetFromPC_B; \
|
||||
addb X_Reg, %al; \
|
||||
movl %eax, EffectiveAddr_E;
|
||||
|
||||
#define GetZPage_Y GetFromPC_B; \
|
||||
#define GetZPage_Y \
|
||||
GetFromPC_B; \
|
||||
addb Y_Reg, %al; \
|
||||
movl %eax, EffectiveAddr_E;
|
||||
|
||||
/* Absolute Indexed Addressing - The effective address is formed by
|
||||
adding the contents of X or Y to the address contained in the
|
||||
second and third bytes of the instruction. */
|
||||
#define GetAbs_X GetFromPC_W; \
|
||||
#define GetAbs_X \
|
||||
GetFromPC_W; \
|
||||
addb X_Reg, %al; \
|
||||
adcb $0, %ah; \
|
||||
movl %eax, EffectiveAddr_E;
|
||||
|
||||
#define GetAbs_Y GetFromPC_W; \
|
||||
#define GetAbs_Y \
|
||||
GetFromPC_W; \
|
||||
addb Y_Reg, %al; \
|
||||
adcb $0, %ah; \
|
||||
movl %eax, EffectiveAddr_E;
|
||||
@ -228,7 +244,8 @@
|
||||
instruction points to a memory location on page zero containing the
|
||||
low order byte of the effective address. The next location on page
|
||||
zero contains the high order byte of the address. */
|
||||
#define GetIndZPage GetFromPC_B; \
|
||||
#define GetIndZPage \
|
||||
GetFromPC_B; \
|
||||
incb %al; \
|
||||
movl %eax, EffectiveAddr_E; \
|
||||
GetFromEA_B; \
|
||||
@ -245,7 +262,8 @@
|
||||
next memory location in page zero contains the high-order byte of
|
||||
the effective address. Both memory locations specifying the high
|
||||
and low-order bytes must be in page zero. */
|
||||
#define GetIndZPage_X GetFromPC_B; \
|
||||
#define GetIndZPage_X \
|
||||
GetFromPC_B; \
|
||||
addb X_Reg, %al; \
|
||||
incb %al; \
|
||||
movl %eax, EffectiveAddr_E; \
|
||||
@ -263,7 +281,8 @@
|
||||
carry from this addition is added to the contents of the next page
|
||||
zero memory location, the result being the high order byte of the
|
||||
effective address. */
|
||||
#define GetIndZPage_Y GetFromPC_B; \
|
||||
#define GetIndZPage_Y \
|
||||
GetFromPC_B; \
|
||||
incb %al; \
|
||||
movl %eax, EffectiveAddr_E; \
|
||||
GetFromEA_B; \
|
||||
|
Loading…
x
Reference in New Issue
Block a user