marethyu / noufu Goto Github PK
View Code? Open in Web Editor NEWGameBoy emulator with debugger written in C++ using Win32 and SDL2
License: GNU General Public License v3.0
GameBoy emulator with debugger written in C++ using Win32 and SDL2
License: GNU General Public License v3.0
When running the boot rom, the emulator takes a while to exit this loop
LD A,($FF00+$44) ; $0064 wait for screen frame
CP $90 ; $0066
JR NZ, Addr_0064 ; $0068
DEC C ; $006a
JR NZ, Addr_0064 ; $006b
WHY?!??
What the hell is going on?!?
The basic structure of the current emulator code can be simplified like below
/* g++ _test.cpp -o test */
#include <iostream>
#include <memory>
using namespace std;
class Component;
class A;
class B;
class Kontroller;
class Component
{
protected:
Kontroller *m_Kontrol;
public:
virtual void ident(bool b) = 0;
};
class A : Component
{
public:
A(Kontroller *kontrol);
~A();
void ident(bool b);
private:
Kontroller *m_Kontrol;
};
class B : Component
{
public:
B(Kontroller *kontrol);
~B();
void ident(bool b);
private:
Kontroller *m_Kontrol;
};
class Kontroller
{
public:
Kontroller();
~Kontroller();
void run();
unique_ptr<A> m_A;
unique_ptr<B> m_B;
};
A::A(Kontroller *kontrol)
{
m_Kontrol = kontrol;
}
A::~A()
{
delete m_Kontrol;
}
void A::ident(bool b)
{
cout << "A::ident()" << endl;
if (b) return;
m_Kontrol->m_B->ident(true);
}
B::B(Kontroller *kontrol)
{
m_Kontrol = kontrol;
}
B::~B()
{
delete m_Kontrol;
}
void B::ident(bool b)
{
cout << "B::ident()" << endl;
if (b) return;
m_Kontrol->m_A->ident(true);
}
Kontroller::Kontroller()
{
m_A = unique_ptr<A>(new A(this));
m_B = unique_ptr<B>(new B(this));
}
Kontroller::~Kontroller()
{
}
void Kontroller::run()
{
m_A->ident(false);
m_B->ident(false);
}
int main()
{
Kontroller *k = new Kontroller();
k->run();
// adding this line will cause issues...
// delete k;
return 0;
}
Is it possible to break this large file into small files and successfully compile??!?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.