pauwell / chip8-script Goto Github PK
View Code? Open in Web Editor NEW:floppy_disk: The 'easy' way to create chip-8 ROM's.
License: MIT License
:floppy_disk: The 'easy' way to create chip-8 ROM's.
License: MIT License
Most important functions:
Chip8Script | Opcode | Description |
---|---|---|
cls() |
00E0 | Clears the screen |
draw(w) |
DXYN | draw(Vx,Vy,N) - N is the width |
waitKey() |
FX0A | A key press is awaited, and stored in VX (Blocking Operation). |
readSprite() |
FX29 | Set I to position of sprite (I=sprite_addr[Vx]) |
lel
Crashes when the corresponding endif or endfor are missing.
if-conditions without any statements in the body messes up the parsing process without showing any errors.
๐
E.g the following compiler test will fail when doing the token to AST parsing:
c8s::test_compiler(
" {1} Full set of commands",
"VAR a = 4\n"\
"IF a == 4:\n"\
" VAR b = 8\n"\
"ENDIF"
);
Remove the loop variables from the variables list to make space.
Change it to:
namespace no_indent
{
void foo_no_indent()
{
std::cout << "hi";
}
}
if-conditions without any statements in the body messes up the parsing process without showing any errors.
๐
The following test fails:
c8s::test_compiler(
" {1} Full set of commands",
"VAR a = 4\n"\
"IF a == 4:\n"\
" IF a != 4:\n"\
" ENDIF\n"\
"ENDIF"
);
FIX
Loop exit-conditions are only tested for equality not greater or less then.
This can result in an infinite loop if e.g: FOR i=5 TO 10 STEP 2 '(i: 5,7,9, 11 ! )
This can be intended behavior..
The following is an idea on how to implement if-conditions
and for-loops
:
if a==b
):if a==2:
// 5XY0 Cond if(Vx==Vy) Skips the next instruction if VX equals VY.
NOT TRUE
// 1NNN Flow goto 123; Jumps to address NNN.
TRUE
// 1NNN Flow goto 345; Jumps to address NNN.
123 NOT_TRUE:
345 TRUE:
for i=0 TO 10
):v[x] = 0
v[y] = i-max(10)
v[x] += 1;
// Inkrementiere V[x]5XY0
// V[y] muss i(max) beinhaltenGOTO 1
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.