alloncm / magenboy Goto Github PK
View Code? Open in Web Editor NEWGameBoy and GameBoy Color emulator written in Rust
License: GNU General Public License v3.0
GameBoy and GameBoy Color emulator written in Rust
License: GNU General Public License v3.0
crossbeam channel is being used in the std as of Rust 1.67 so there is no reason to import another lib
The sound gets de-synced from the video over time.
In order to solve this every time Im pushing new sound to the sound device (right now to SDL) Im blocking until the samples queue is almost empty and only than pushing the buffer.
I believe the de-syncing happens for 2 reasons:
Running the emulator at the correct original fps and using float to calculate the samples to skip.
Currently the PPU is almost ready (line based not pixel based)
The CPU is not ready and once is ready needs to pass the passed cycles to the PPU
Once ready fix the MMU to block VRAM and OAM
There are still uncompleted tasks:
roms-folder
from the image sd cardtarget-feature=+virtualization
with target-cpu=cpu
for the compiled cpu.ifdef
where necessary to add support for coretx-a53 and moreSupport cartridges that can receive in the external ram a memory mapped file and use it (probably a pointer or &mut [u8]
Right now the dma is inside the gb_mmu, mainly because it needs access the mmu and needs to be under the io_bus in order to expose its memory interface to the mmu.
I think that by making another bus for regular memory (addresses 0x0 - 0xFDFF) we can separate the dma implementation to its own independent structure.
Hopefully it wont harm performance :)
The opcodes that fails the test are:
Unit tests -
https://github.com/alloncm/GBCM/blob/master/lib_gbc/tests/rotate_shift_tests.rs
The code never disables the sound terminals
The line Im taking about
I had those two errors on RPI linux:
When using the manual resampler:
malloc(): invalid size (unsorted)
When using sdl resampler:
free(): invalid pointer
when activating the push-audio
feature the error will no longer occur
The screen is tearing
The frame isnt being drawn in the end, but all over the place (not LY = 153 but all kinds of LY's).
Add the option to save the state of a game anywhere I want (also support for saves in games that do not support it).
I think could be done with two matches ine for the to get opcode type enum and one to run the the specific enum with the func pointer
Use the vblank as indication for an end of frame
In order to run on weaker hardware I want to improve performance as much as I can.
In order to do that I opened a new branch called feature/mt, a PR will be opened soon.
In this branch I will convert the program to 2 threads (or maybe 3) in order to move the IO from the logic thread.
When doing this I need to figure out how to draw properly without busy waiting in the IO thread for new frame buffer from the emulation thread while not making the window unresponsive in case the PPU is turned off.
This be achievable with blocking function that has a timeout, when the timeout is set the function will update the UI (accept new events) and than block again for the amount of time.
Sync the sound using the callback api of sdl and not the push api.
It will grant a better performance at the cost of another thread.
Adafruit I2S 3W Class D Amplifier Breakout - MAX98357A : ID 3006 : $5.95 : Adafruit Industries, Unique & fun DIY electronics and kits
Add an folder that the user could add roma to and upon start could choose to be prompt with a menu to select a game.
Could use the dialoguer lib
In order to do that there are a few areas that will need to change
The emulator will have a port for "technician" which will allow to read logs from the uart and when choose upload new rom in the menu will allow the user to upload a rom to the gameboy.
Perhaps there will be a program from the other side which will stream the rom and communicate with the emulator
When playing this game the score section is blinking upon moving right.
I believe this is due to not accurate enough fifo ppu implementation.
The game boots correctly but wont return gracefully from dialogues and menus.
Originally posted by @alloncm in #97 (comment)
Added one here, needs to be added correctly - #27 (comment)
This is the next bottleneck :)
It decrease video buffer size by x2
Originally posted by @alloncm in #125 (comment)
For some reason the audio is missing samples on linux and sounds horrible
Currently for every instruction Im updating the register, since it is not necessary for most of the instructions I can just update it when the cpu tries to read the joypad register.
This will give a better emulation accuracy and I'm believe a faster emulation too.
The emulator barely runs at 120 fps without the sound implemented.
After the sound it will barely run at 60 fps (on an I7 machine)
Currently Im using vsync but for screen with higher refresh rate this wont work.
Move to 1 buffer - might also increase performance
Originally posted by @alloncm in #27 (comment)
When following an NPC the NPC flickers while leading the character.
In order to save the state of the game some games have an battery packed MBC that allow them to save the sate of the game to the MBC.
I want to support that and for this Ill need some way of access to the MBC from outside the gameboy (that should be multi platform).
I can drop the gameboy
as the program receive close signal and only pass the MBC as & mut
so Ill still have access to it after.
Tell about the different features flags during compilation
Currently the setup described the RaspberryPi section takes about 15 seconds to boot, I want to cut it to 1-3 seconds to achieve an authentic feeling as much as I can.
I believe running bare metal could help achieve this goal.
This issue depends on this #123 and is used to collect all the resources in one place
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.