galeblon / gbc_emulator Goto Github PK
View Code? Open in Web Editor NEWGameBoy Color emulator written in C
GameBoy Color emulator written in C
Emulator should have a verbosity flag. If enabled, it should print every instruction it executes, this will be useful in future development and debugging.
The output in console should look something like this:
Address Mnemonic Operands
0x0100 LD A, 0xFC
At this point instead of mnemonic we could print just the hex code of the instruction, but we should think about a way of mapping the hex codes to mnemonics.
We should also think whether this should be printed in separate console window.
(Maybe one window shows instructions and second current registers values)
Also the option of step by step execution should be considered
(Not high on priority list, we can just use breakpoints when debugging to achieve the same result)
This issue will be probably split into smaller tasks.
Also coding style guidelines should probably be included somewhere in documentation.
Investigate and implement Sprite Attribute Table support in mem
module
Implement all instructions considered miscellaneous by this:
Gameboy CPU (LR35902) instruction set
In GPU module, in functions gpu_write_bgpd()
and gpu_write_spd()
, there are two TODOs.
They require finding the CGB Object (Sprite) Color Palette Memory and CGB Background Color Palette Memory addresses and putting them in defines, if constant, or in MEM/ROM modules as a get()
function, if not.
Open questions:
Should we do it on wiki? It makes sense, as it probably will be our docs repository, but then how should we approach the visual identification aspect?
Are we ultimately deciding on wiki instead of repository to store the docs?
Also, I'm guessing we should write all of RPI related docs in Polish?
Implement emulator state saving, which allows for dumping the state of all relevant modules along with memory into a file, which can be loaded later to recreate the exact state.
It would probably be beneficial for the project to have one main way of reporting errors and the status of the programme during the error.
Most importantly, it would need to log the CPU register status, which module registered the error and some module-specific info.
Easiest way would probably be to have a single error_log function which takes some error strings and prints them to stderr with CPU status or a separate logging function set/module.
I have not added this issue to the project yet - it should be confirmed which way we should do it and whether we should do it.
We should limit access to mem_{read/write}{8/16}
functions to cpu only, so that we have one mem API that can work as an emulated memory access (emulated program view) and another one that enables memory access for other components.
e.g. right now if DMA emulation is in progress no memory can be accessed, which is desirable for program-initiated mem access, but interferes with other components' functionality.
module dependencies including #71 and intended timer module implementation
module dependencies after removing mem_{read/write}
from gpu
Legend:
Determine the way memory read/write errors are handled on GBC and implement emulation of it
mem_block_write_t
if neededAND, XOR, OR and CP (compare).
I would think that rom
module might be the right place to have this sort of thing. Though, I think we could do a bigger refactor and move all of the ROM-header parsing logic and make g_mem_cart_type
accessible to other modules. We can make it a separate issue.
Originally posted by @mzal in #50 (comment)
After further consideration, I think it is cleaner to let the particular modules handle IO ports registers related to them.
Previously, I thought about creating whole memory blocks to be handled by outside modules, but after further examination it appears that in many cases the IO ports addresses are not consecutive and assigning a handler function on per-address basis seems to make more sense.
Add build target with alternative entry point to the program running selective functionality tests.
Add the target as automatic github action executed on pull request
Implementation of 8 bit ADD and ADC instructions
When loading up a GameBoy game, user could manually select their palette for the game, using key combinations during startup.
Sources:
Implement memory interface mapping addresses to correct memory block
Add to the GPU
module logic that, according to:
shall return the proper RGB values for use in DISPLAY
module.
Some GameBoy games, when put into a CGB, gain preassigned palettes, based on their hashes. They should be added.
Remove any stray printfs, add #define to enable/disable non-critical logging
Add sprite drawing logic to _gpu_draw_sprites()
in the GPU
module.
During the Legend of Zelda: The Link's Awakening's intro, there are 3 places, where, starting from some X, some tiles seems to have moved on the Y axis. Those places are:
Bug does not appear when intro is skipped (important for the Egg).
We should decide on graphic library we want to use at least for now.
For now all it should do is set it's window title to rom name.
Implement basic input module that works with keyboard atleast.
Implement the second instruction table.
The instructions are highly similar so it should be possible to do it under single issue.
Work on next batch of cpu instructions.
On CGB VRAM consists of 2 switchable memory banks. Implement bank selection in mem
. Supply passthru API for gpu
to use selected VRAM bank at any time.
Create mem
interface to be used by emulator-internal functions, as opposed to the memory used by the program ran (through cpu
).
Implement those operations and measure time it took,
this will help us approximate time/efforts needed to add all operations
Add background drawing logic to _gpu_draw_background()
and window drawing logic to _gpu_draw_window()
in GPU
module
Module handling the interrupt procedure is needed.
It will be done in accordance to chapter 2.12 of Game BoyTM CPU Manual.
Some of Memory Bank Controllers support Real-Time clock functionality accessible through memory mapping of some RAM Bank numbers.
Implementation of 8 bit SUB and SBC instructions.
In CGB mode addresses 0xD000-0xDFFF are mapped to one of RAM Banks (number 1-7)
There are still some common Memory Bank Controllers which are not implemented in mem
.
The ones which need to be supported are:
Create timer
module to handle DIV(0xFF04), TIMA (0xFF05), TMA (0xFF06), TAC (0xFF07) registers and request timer interrupt (INT 50)
There are a couple of instruction left to finish the primary table. Even though they may not be closely related I see point in further delegating them into separate issues.
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.