summaryrefslogtreecommitdiff
path: root/src/cpu/6502.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/6502.c')
-rw-r--r--src/cpu/6502.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/cpu/6502.c b/src/cpu/6502.c
index a5c47f5..a1d3a38 100644
--- a/src/cpu/6502.c
+++ b/src/cpu/6502.c
@@ -12,14 +12,14 @@ byte getFlag(byte flag) {
return ((P & flag) == flag) ? 1 : 0;
}
-void setFlag(byte flag, int x) {
+void SetFlag(byte flag, int x) {
if (x == 1){
if ((P & flag) == 0x0) P += flag;
}else if (x == 0){
if ((P & flag) == flag) P -= flag;
}
else{
- fprintf(stderr, "setFlag() passed arg neither 0 or 1");
+ fprintf(stderr, "SetFlag() passed arg neither 0 or 1");
}
}
@@ -33,61 +33,61 @@ void flagClear(byte flag){
// Functions which perform reusable routines for finding if a specific flag should be set.
-void setFlagN(byte x){
+void SetFlagN(byte x){
if ((x & flag_N) == flag_N)
- setFlag(flag_N, 1);
+ SetFlag(flag_N, 1);
else
- setFlag(flag_N, 0);
+ SetFlag(flag_N, 0);
}
//Perform prior to any changes
-void setFlagV(byte x, byte y){
+void SetFlagV(byte x, byte y){
if ((x & flag_N) == (y & flag_N)){
- if (((x + y) & (flag_N ^ 0xFF)) > 0x7F) setFlag(flag_V, 1);
- else setFlag(flag_V, 0);
+ if (((x + y) & (flag_N ^ 0xFF)) > 0x7F) SetFlag(flag_V, 1);
+ else SetFlag(flag_V, 0);
}else{
- if (((x - y) & (flag_N ^ 0xFF)) > 0x7F) setFlag(flag_V, 1);
- else setFlag(flag_V, 0);
+ if (((x - y) & (flag_N ^ 0xFF)) > 0x7F) SetFlag(flag_V, 1);
+ else SetFlag(flag_V, 0);
}
}
-/*void setFlagB(){ //WORK ON
- setFlag(flag_B, 1);
+/*void SetFlagB(){ //WORK ON
+ SetFlag(flag_B, 1);
}*/
-/*void setFlagD(){
- setFlag(flag_D, 1);
+/*void SetFlagD(){
+ SetFlag(flag_D, 1);
}*/
-/*void setFlagI(){ //WORK ON
- setFlag(flag_Z, 1);
+/*void SetFlagI(){ //WORK ON
+ SetFlag(flag_Z, 1);
}*/
-void setFlagZ(int x){
+void SetFlagZ(int x){
if (x == 0)
- setFlag(flag_Z, 1);
+ SetFlag(flag_Z, 1);
else
- setFlag(flag_Z, 0);
+ SetFlag(flag_Z, 0);
}
-/*void setFlagC(){
- setFlag(flag_Z, 1);
+/*void SetFlagC(){
+ SetFlag(flag_Z, 1);
}*/
-/*byte getMemory(address x){
+/*byte GetMemory(address x){
return Memory[x];
}
-void setMemory(address x, byte y){
+void SetMemory(address x, byte y){
Memory[x] = y;
}*/
-byte getStack() {
- return getMemory(0x01FF - S);
+byte GetStack() {
+ return GetMemory(0x01FF - S);
}
-void setStack(byte z) {
- setMemory(0x01FF - S, z);
+void SetStack(byte z) {
+ SetMemory(0x01FF - S, z);
} \ No newline at end of file