turn on/off video/logging

This commit is contained in:
corey 2024-05-17 12:52:37 -05:00
parent 87cc4a9fbe
commit ddb69c4517
5 changed files with 264 additions and 267 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
*.gb
*.exe
/rosgb
.*.swp

Binary file not shown.

524
cpu.c

File diff suppressed because it is too large Load Diff

4
cpu.h
View File

@ -24,8 +24,8 @@ typedef struct Cpu
uint8_t ime;
} Cpu;
void cpu_decexec(Cpu*cpu,struct Ppu*ppu,uint8_t*rom,uint8_t*op,uint8_t*ram);
void cpu_decexecCB(uint8_t*cpu,uint8_t*rom,uint8_t*op,uint8_t*ram);
void cpu_decexec(Cpu*cpu,struct Ppu*ppu,uint8_t*rom,uint8_t*op,uint8_t*ram,bool quiet);
void cpu_decexecCB(uint8_t*cpu,uint8_t*rom,uint8_t*op,uint8_t*ram,bool quiet);
void cpu_fetch16(Cpu*cpu,uint8_t*rom,uint16_t*u16,uint8_t*ram);
void cpu_fetch8(Cpu*cpu,uint8_t*rom,uint8_t*u8,uint8_t*ram);
void cpu_romhexdump(uint8_t*rom);

2
main.c
View File

@ -116,7 +116,7 @@ int main(int argc,char **argv)
// Fetch, decode, execute instruction
cpu_fetch8(gb.cpu,gb.rom,&gb.op,gb.ram);
cpu_decexec(gb.cpu,gb.ppu,gb.rom,&gb.op,gb.ram);
cpu_decexec(gb.cpu,gb.ppu,gb.rom,&gb.op,gb.ram,!gb.log);
}
// Clean up, exit