tykel / mash16 Goto Github PK
View Code? Open in Web Editor NEWReference Chip16 Emulator
Home Page: http://code.google.com/p/mash16
License: GNU General Public License v3.0
Reference Chip16 Emulator
Home Page: http://code.google.com/p/mash16
License: GNU General Public License v3.0
Currently console output is redirected to stdout.txt
/stderr.txt
on Windows.
Users require output in the console window for interactivity.
Fix: See the SDL wiki: a cleaner solution may be to call freopen()
with stdout
.
The specification says that CLS should clear the foreground, and set the background to 0.
The latter is not done as of now.
I was upgrading my own emulator to add support for the Chip16 v1.3 instructions, and the new division instructions seemed ambiguous to me, specially because behavior around negative operands tends to be problematic, and because there were both MOD and REM instructions without a clear difference between them. Not even the sign of the division operation is not even clearly defined for C89 and C++03, unless you use the div() function (See https://en.wikipedia.org/wiki/Modulo_operation), and information about what the differences between MOD and REM should be online is pretty sparse.
So I wrote a Test ROM and tested it in the two most famous emulators, mash16 and RefChip16. I found that the DIV and REM operations were implemented consistently between the two emulators (they were just the regular results of the /
and %
operator you get with GCC). However, I noticed that there was a different behavior on those two emulators on the MOD operation when the sign of the divisor was negative (the tests labeled test43
and test44
in the test ROM).
There is a pretty detailed write-up on the Test ROM header on the exact behavior implemented by both emulators. While the Chip16 reference is vague about how the instructions should behave, in my opinion I think that mash16's behavior is much harder to justify, both because it's different than other implementations of the modulo such as Haskell's one which are designed around certain useful mathematical properties, and also because behavior like -2 MOD -4 = -6 seems pretty unintuitive.
If you want to play around with it, the Test ROM is also in .c16 format here. It should display a green screen if the MOD behavior is the same as RefChip16. Currently it displays a red screen with Mash16.
Would be happy to see your thoughts about this!
Currently an unsupported Makefile is included in the repository, which does not even compile properly.
Either remove it, or fix it.
Audio crackling noticeable in some programs.
Boing.c16 presents this problem (Linux, Alsa).
Changing the sample rate with --audio-sample-rate
modifies the tone of the output audio -- which is undesired behaviour.
Building currently fails, due to inline declarations with initialisation.
Fix: Move all variable declarations to the beginning of their scopes.
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.