Monday, February 23, 2009

General Design

Well the first thing you should do is a general design, but as I have experienced, at first you will most probably do a design that don't fit all requirements, probably because you didn't know all the things you will need. But still, without an initial design, you won't make your program.

My design is pretty simple and somewhat modular; I have the functionalities separated by files:

myemu: This is the file containing the main. It initializes the Window, DirectX (or other video API) and calls the initGB() function. After that it keeps receiving windows messages.

console: Console has the main code of the emulator. Like the fetching of the opcodes, the video writing to the framebuffer and so.

cpu: Has the code directly related with the CPU. Registers, initial values, etc.

memory: Has the code related to the memory, memory map and memory handling.

rom: Has code to initialize the rom and stores all the information in a structure.

video: This file is in charge of doing tasks as acquiring the tile data, sprites and other

dx: This file has all the DX initialization, use and destruction.

There are still a couple of things "mixed", but mainly because they can be in more than one category.

No comments:

Post a Comment