diesel-net / kiwi-8 Goto Github PK
View Code? Open in Web Editor NEWCHIP-8 interpreter for Windows and MacOS
License: GNU General Public License v3.0
CHIP-8 interpreter for Windows and MacOS
License: GNU General Public License v3.0
Add a file menu to support toggling certain features on/off. This should also allow the user to change the foreground/background colors.
GUI debugger would be nice.
This is most likely due to the fact that I am currently using SDL_GetTicks() for timing control. This function has a nasty precision of about 10ms. I would need to switch to high performance timers for more accurate timing of the frame-rate as well as the emulator itself. The current FPS display is an average, so it isn't too accurate just by nature and is more of a debugging tool.
Edit: I think I may actually be rednering a few extra frames, this is a reminder to look into this.
No audio has been implemented yet.
If you load up "Animal Race", the text is not correct. The first sprite of the text seems to be repeated.
Reported by @cassianoperin here in #9.
0nnn - SYS addr
Jump to a machine code routine at nnn.
This instruction is only used on the old computers on which Chip-8 was originally implemented. It is ignored by modern interpreters.
*0x02D8 opcode found in "Clock Program [Bill Fisher, 1981].ch8"
TODO: Use modulo to wrap around the the edges of the screen
Areas affected.
This is a reminder to switch to unicode before the next release.
Add support for creation and modification of config files for first launch of game. If config file already exists then use the settings applied in the file.
I'll get to it eventually.
I haven't tested the binaries on other systems than my own. I know for a fact that I need to add the linker flag: -mmacosx-version-min=10.5 to make sure the MacOS app can run on older versions of MacOS.
This opcode is supposed to pause emulation until a key is pressed. I just realized that its simply returning without updating the Program Counter until a key is pressed. This is incorrect and could explain the input issues with the Rom's Connect4 and ClockProgram.
Occasional deadlock after new implementation which reduces CPU usage
Most important issue right now. Currently using a recursive mutex which implies that locking more than once should be OK, however results are iffy.
Need to confirm and research relative timings of checking the keypad
Full screen toggling using SDL2 is very buggy on MacOS right now. Switching to fullscreen when a ROM is in at the "end state" (infinite loop, no more rendering to be done, etc.) causes the image to appear for a split second. The issue is resolved by cmd+tabbing out and back into the window.
TODO:
Update both Windows and MacOS frameworks to the latest version of SDL2
Add a toggle to allow turning vertical wrapping on or off. Some games break with it on, some games break with it off.
Hovering around (13% - Windows) and (99% - MacOS) which confirms the program is maxing out an entire core. Windows and Mac OS X report CPU usage differently. Windows reports it as a true percentage between all of the cores while Mac OS X reports it as a percentage of a single core being used.
Suggested to go back and try using SDL_Delay(), to truly eliminate the "busy-waiting" for-loop.
Reddit discussion reference:
https://www.reddit.com/r/EmuDev/comments/5zb6w0/c_chip_8_emulator_high_cpu_usage/
Here is an incomplete list of known CHIP-8 programs that require special settings to run properly, those that have unresolved issues with my emulator, or those that simply have issues in general. Some of these settings or "quirks" will apply to other CHIP-8 emulators as well so I wanted to take this chance to document something that should've been documented a long time ago. Hopefully this will shed some light on the discrepancies between the various CHIP-8 documents and opcode implementations that you will find all over the web.
load_store_quirk = 1
load_store_quirk = 1
load_store_quirk = 0
shift_quirk = 1
shift_quirk = 1
shift_quirk = 1
load_store_quirk = 1
load_store_quirk = 1
load_store_quirk = 1
shift_quirk = 1
load_store_quirk = 1
If any ROM uses this opcode, Soft-resetting will most likely result in buggy behavior (e.g. pixels rendered where they are not supposed to be). This is due to the fact that soft-resetting clears everything BUT the memory in the current implementation. I originally thought I could get away with this, but the entire memory should be cleared and the rom copied back at offset 0x200 every time.
CPU timing and Sound timers not implemented. Games might not work at all or appear to run faster/slower than intended.
This is a reminder for me to fix the style of functions or function calls that have parameters which cause the call to span multiple lines. The indentation is inconsistent.
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.