added mappers (not working)

This commit is contained in:
Lauchmelder 2021-10-28 16:57:37 +02:00
parent 034645154d
commit 9039fa0ccf
14 changed files with 512 additions and 106 deletions

View file

@ -68,6 +68,7 @@ int tickCPU(struct CPU* cpu)
cpu->nmi = 0;
printf("NMI TRIGGERED FROM $%04x\n", cpu->pc.word);
cpu->pc.lo = readBus(cpu->bus, 0xFFFA);
cpu->pc.hi = readBus(cpu->bus, 0xFFFB);
@ -335,6 +336,19 @@ void execute(struct CPU* cpu)
}
} break;
case BRK:
{
cpu->pc.word++;
Push(cpu->bus, cpu->pc.hi);
Push(cpu->bus, cpu->pc.lo);
Push(cpu->bus, cpu->status.raw | 0b00110000);
cpu->status.id = 1;
cpu->pc.hi = readBus(cpu->bus, 0xFFFF);
cpu->pc.lo = readBus(cpu->bus, 0xFFFE);
} break;
case BVC:
{
if (!cpu->status.overflow)