fix incorrect argument for ASL and LSR

This commit is contained in:
Vineet K 2024-06-30 08:58:06 -04:00
parent 99082b5528
commit 45c2312976

12
cpu.c
View File

@ -904,28 +904,28 @@ interpret(void)
break; break;
case 0x06: case 0x06:
mode = AM_ZP; mode = AM_ZP;
arg = opcode_arg(mode); arg = opcode_mem(mode);
asl(arg); asl(arg);
cycles += 5; cycles += 5;
printf("ASL"); printf("ASL");
break; break;
case 0x16: case 0x16:
mode = AM_ZP_X; mode = AM_ZP_X;
arg = opcode_arg(mode); arg = opcode_mem(mode);
asl(arg); asl(arg);
cycles += 6; cycles += 6;
printf("ASL"); printf("ASL");
break; break;
case 0x0e: case 0x0e:
mode = AM_ABS; mode = AM_ABS;
arg = opcode_arg(mode); arg = opcode_mem(mode);
asl(arg); asl(arg);
cycles += 6; cycles += 6;
printf("ASL"); printf("ASL");
break; break;
case 0x1e: case 0x1e:
mode = AM_ABS_X; mode = AM_ABS_X;
arg = opcode_arg(mode); arg = opcode_mem(mode);
asl(arg); asl(arg);
cycles += 6; cycles += 6;
printf("ASL"); printf("ASL");
@ -1477,14 +1477,14 @@ interpret(void)
break; break;
case 0x4e: case 0x4e:
mode = AM_ABS; mode = AM_ABS;
arg = opcode_arg(mode); arg = opcode_mem(mode);
lsr(arg); lsr(arg);
cycles += 6; cycles += 6;
printf("LSR"); printf("LSR");
break; break;
case 0x5e: case 0x5e:
mode = AM_ABS_X; mode = AM_ABS_X;
arg = opcode_arg(mode); arg = opcode_mem(mode);
lsr(arg); lsr(arg);
cycles += 6; cycles += 6;
printf("LSR"); printf("LSR");