wernsey / chip8 Goto Github PK
View Code? Open in Web Editor NEWA CHIP-8 interpreter, assembler and disassembler in C
License: Apache License 2.0
A CHIP-8 interpreter, assembler and disassembler in C
License: Apache License 2.0
Hey! I think there's an inaccuracy in the implementations of scroll left (00FC
) and scroll right (00FB
). In scroll right there's a left shift and in scroll left there's a right shift, it should be the other way around if I'm not mistaken.
Here's a link to a possible solution, if you find it acceptable I can make a pull request.
I was testing this software out (the emulator, assembler and disassembler) and everything worked perfectly fine
until I tried to assemble a very simple program that I made which didn't work on other emulators but it did work on this emulator. I looked into it and I think I found the reason why on some emulators the assembled program doesn't work.
Well let's take a look at the program with which I noticed this issue:
start:
cls
ld V0, #0
ld V1, #1
ld V2, #2
ld V3, #3
ld V4, #4
ld V5, #5
ld V6, #5
ld V7, #7
ld V8, #8
ld V9, #9
ld VA, #a
ld VB, #b
ld VC, #c
ld VD, #d
ld VE, #e
JP start
This program should work right? Well it does on this emulator but not on many others. Lets take a look at the assembled a.ch8 file that the assembler produces:
00000000 00 e0 60 00 61 01 62 02 63 03 64 04 65 05 66 05
00000010 67 07 68 08 69 09 6a 0a 6b 0b 6c 0c 6d 0d 6e 0e
00000020 12
(hexdump -C a.ch8 should produce the same result)
The last byte is 0x12 and as we know the opcode 1nnn is the jump (JP) opcode but on this executable it is never "completed" i.e. it's not 1200 it is 12 which is why some emulators/interpreters may interpret this as an unknown opcode or something like that.
Now to prove that that is the case I modified the original test program by adding these 2 lines:
JP start
offset #201
This means that the program doesn't start at 200 but 201, doing this caused the hexdump of the a.ch8 file to be this:
00000000 12 01 e0 60 00 61 01 62 02 63 03 64 04 65 05 66
00000010 05 67 07 68 08 69 09 6a 0a 6b 0b 6c 0c 6d 0d 6e
00000020 0e 12 01
Now as we can see at the end the program jumps to 0x201 where as previously it jumped to the address 0x2
And now this program works on all emulators.
Is this a bug or is this something that has been implemented on purpose?
The right side player's score does not increment when they get a point. I've tested the game on another emulator to verify that the problem does not lie in the rom itself.
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.