Sign in to follow this  
  • entries
    177
  • comments
    531
  • views
    163636

GameKnight

Sign in to follow this  
Scet

243 views

GameKnight is another emulator I'm working on for the GameBoy. Right now it is a horrible mix of C++ and C#. This is because originally it was supposed to be a GameBoy emulator for the GBA, however after weeks of having to use ARM assembly and C, I decided to go back to the PC before I went insane.

As of right now all of the "emulator" portion of the program is in the C++ DLL while the interface is in C#. I did this so I could at least test that what I had worked before porting it all to C#. The C++ code makes heavy use of pointers and byte/short variables which don't work quite as expected in C# since it bitches about anything that isn't an integer, so porting is going to take a while. I'm not leaving it as C++ because whoever designed the C/C++ compilation model must have been on crack, no matter how nice I try to make it look it still looks like crap.

Here's what I've got done:
- Entire CPU core
- Default memory mapper(can run small demos)
- Scan-line based map renderer(no sprite support yet)

Well that first one is a big milestone, I've never completed the CPU portion of an emulator I've worked on(although FatMan was close). It needs to be rewritten though, right now it's just a giant switch statement, but I want something similar to the OOP/JIT method used in Apex.

VRAM dump screenshot as usual:



Apex is on hold since I've gotten this far in GameKnight. It's not dead, but I won't be working on it till I get something running in GameKnight.
Sign in to follow this  


2 Comments


Recommended Comments

How will you be testing the emulator? I used ZEXALL, but as that's for a 'real' Z80 so I don't know how useful it would be. The variation on SMS Power! has a fairly sane layout and should be easy enough to modify to your own needs. (It also doesn't test undocumented flags, which makes life rather more straightforwards).

Excellent work. [grin]

Share this comment


Link to comment
I use VisualBoyAdvance to make sure mine does everything right. Right now "testing" consists of writing out the registers and memory to the debug console. I'm working on my own dialogs similar to VBAs.

I'm also using VBAs source whenever I get stuck, since I've found very little documentation(absolutly nothing on the GameBoy Colour). The "SharpZ80"(as I call it) has a few dozen different opcodes then the normal Z80 and also lacks the IX and IY registers, so a pure Z80 emulator wouldn't work.

I'll just continue porting my C++ code to C#. Even someone elses C# code I would have to reformat to my own style, and your style of coding seems to be quite different from mine.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now