methodfastpower.blogg.se

Working nds emulator mac
Working nds emulator macworking nds emulator mac
  1. WORKING NDS EMULATOR MAC CODE
  2. WORKING NDS EMULATOR MAC WINDOWS

This is one of the more unique aspects of my emulator since most other Game Boy emulators were written in an older C standard, (or an undesirable alternative like C++), they didn't have access to anonymous structs or unions, which meant that they either had to access registers with a messy chain, like gameboy_proc->AF.b.h (this is how GBE accesses register a), or rely on bit operations. I used C11's anonymous structs and unions so that I could access individual registers, or grouped registers straight from the root structure: registers.a or registers.af for example. I revised my register structure to make accessing grouped registers easier: While this model is fine for dealing with instructions that access the 8 bit registers individually, what I didn't realise is that often the 8 bit registers are grouped together to form the 16 bit registers: AF, BC, DE, and HL. Initially I implemented the registers like so: The Game Boy has eight 8 bit registers: A, B, C, D, E, F, H, and L, as well as two 16 bit registers: SP, and PC. Being aware of this is essential when reading through documents written by different people. High RAM is sometimes called Zero Page Memory, Cartridge Data is sometimes just called ROM, and if a document just says RAM, it is usually refering to the Working RAM.

WORKING NDS EMULATOR MAC CODE

It wasn't worth trying to write code on my own just yet, I needed to have a base to work with first, before I could experiment with doing things my own way.ĭifferent sources can refer to memory regions differently. I looked at how two or three different emulators did it, and then wrote it into Cinoop in my own style. Most of the Game Boy specific code that I wrote in the beginning, such as loading a ROM, was based heavily on other emulators. In hindsight, I should have spent much longer doing this so that I wouldn't have to keep looking things up later, but I was excited! I then read through some Game Boy documents to get a better overview of the project. A better choice would have been something more standard, and cross-platform, such as SDL, however, I went with LDFS just because I was familiar with it. I used my own library, LDFS, to create a window with a valid OpenGL context. While I wouldn't recommend trying to learn about emulation from someone as inexperienced as me, I wanted to outline the process of starting an emulator for the first time, talk about which documents were most helpful to me, and also talk about some of the design choices I went through.

WORKING NDS EMULATOR MAC WINDOWS

Windows version of Cinoop running Tetris before randomisation support It can be run on Windows, DS, GameCube, 3DS, Linux based OSes, PSP, and PS4. I called the project Cinoop.Ĭinoop is written in C and is open source. On the other hand, there's the NES and Game Boy both of which seemed far too advanced for me!Įventually, I decided to write a minimalist Game Boy interpreting emulator, without support for custom mappers or sound, (and probably many inaccuracies). I felt that I got enough out of just reading through other people's emulators, and that writing my own would be a pointless exercise. Reading about CHIP-8 definitely helped me to understand a lot of emulation concepts, but it seemed a bit too basic. Picking a system to emulate isn't an easy choice the standard first emulator project seems to be a CHIP-8 emulator.

working nds emulator mac

I've always wanted to write an emulator from scratch, but I've held off for a long time because it's probably the most advanced programming project I've ever wanted to do. Writing a Game Boy emulator, Cinoop Initial publication: March 24th, 2015

Working nds emulator mac