another LDA and another LDY

This commit is contained in:
Brad Grantham 2016-11-06 14:14:17 -08:00
parent 484c94df98
commit dcc884487e

View File

@ -501,6 +501,16 @@ struct CPU6502
break;
}
case 0xB5: {
unsigned char zpg = read_pc_inc(bus);
if(debug & DEBUG_DECODE) printf("LDA %02x, X\n", zpg);
int addr = zpg + y;
a = bus.read(addr & 0xFF);
flag_change(Z, a == 0x00);
flag_change(N, a & 0x80);
break;
}
case 0xB1: {
unsigned char zpg = read_pc_inc(bus);
if(debug & DEBUG_DECODE) printf("LDA (%02x), Y\n", zpg);
@ -768,6 +778,15 @@ struct CPU6502
break;
}
case 0xB4: {
unsigned char zpg = read_pc_inc(bus);
if(debug & DEBUG_DECODE) printf("LDY %02X,X\n", zpg);
y = bus.read(zpg + x);
flag_change(N, y & 0x80);
flag_change(Z, y == 0);
break;
}
case 0xA4: {
unsigned char zpg = read_pc_inc(bus);
if(debug & DEBUG_DECODE) printf("LDY %02X\n", zpg);