-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cc
80 lines (65 loc) · 2.63 KB
/
main.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include <iostream>
#include "Bus.h"
#include "Z80_Gameboy.h"
#include "PPU_Gameboy.h"
#include "Timer_Gameboy.h"
#include <time.h>
int main(int argc, char **argv)
{
/*if(argc <= 1)
{
std::cout<<"Syntax error, please use : "<<argv[0]<<" RomName.gb"<<std::endl;
return -1;
}
std::string romPath = "";
for(int i = 1; i < argc; i++){
if(i != 1)
romPath += " ";
romPath+=argv[i];
}*/
//srand(time(NULL));
Z80_Gameboy cpu;
PPU_Gameboy ppu;
Timer_Gameboy tim;
//cpu.disassemble = true;
Bus gb(cpu,ppu,tim);
//gb.loadCartridge(romPath);
//gb.loadCartridge("ROMS/cpu_instrs/cpu_instrs.gb");
//gb.loadCartridge("ROMS/cpu_instrs/individual/01-special.gb"); //PASSED
//gb.loadCartridge("ROMS/cpu_instrs/individual/02-interrupts.gb"); //PASSED
//gb.loadCartridge("ROMS/cpu_instrs/individual/03-op sp,hl.gb"); //PASSED
//gb.loadCartridge("ROMS/cpu_instrs/individual/04-op r,imm.gb"); //PASSED
//gb.loadCartridge("ROMS/cpu_instrs/individual/05-op rp.gb"); //PASSED
//gb.loadCartridge("ROMS/cpu_instrs/individual/06-ld r,r.gb"); //PASSED
//gb.loadCartridge("ROMS/cpu_instrs/individual/07-jr,jp,call,ret,rst.gb"); //PASSED
//gb.loadCartridge("ROMS/cpu_instrs/individual/08-misc instrs.gb"); //PASSED
//gb.loadCartridge("ROMS/cpu_instrs/individual/09-op r,r.gb"); //PASSED
//gb.loadCartridge("ROMS/cpu_instrs/individual/10-bit ops.gb"); //PASSED
//gb.loadCartridge("ROMS/cpu_instrs/individual/11-op a,(hl).gb"); //PASSED
//gb.loadCartridge("ROMS/instr_timing.gb"); //PASSED
//gb.loadCartridge("ROMS/01-read_timing.gb");
//gb.loadCartridge("ROMS/02-write_timing.gb");
//gb.loadCartridge("ROMS/03-modify_timing.gb");
//gb.loadCartridge("ROMS/Tetris.GB");
//gb.loadCartridge("ROMS/DRMARIO.GB");
//gb.loadCartridge("ROMS/opus5.gb");
//gb.loadCartridge("ROMS/lyc.gb");
//gb.loadCartridge("ROMS/bpong.gb");
//gb.loadCartridge("ROMS/Soukoban (J).gb");
//All MBC1:
//gb.loadCartridge("ROMS/warioland.gb");
gb.loadCartridge("ROMS/LinksAwakening.gb");
//gb.loadCartridge("ROMS/Donkey Kong Land (USA, Europe).gb");
//gb.loadCartridge("ROMS/Super Mario Land (Patch FR).gb");
//gb.loadCartridge("ROMS/Kirby's Dream Land (UE) [b1].gb");
//gb.loadCartridge("ROMS/PAC-MAN/PAC-MAN.GB");
//Not working
//gb.loadCartridge("ROMS/Space Invaders (PD).gb");
//gb.loadCartridge("ROMS/Mystical Ninja (U) [S][b1].gb");
//gb.loadCartridge("ROMS/Kirby's Dream Land 2 (U) [S][!].gb");
//gb.disassemble();
std::cout << std::hex;
gb.run();
//std::cout << cpu.assembled;
return 0;
}