1
1
# z8lua
2
2
3
- This is a fork of Lua that implements the PICO-8 dialect and adds useful features for
4
- emulator implementations.
3
+ This is a fork of Lua that implements the [ PICO-8] ( https://www.lexaloffle.com/pico-8.php )
4
+ dialect and adds useful features for emulator implementations.
5
5
6
6
### Branches
7
7
@@ -10,13 +10,14 @@ try to submit patches and PRs against the corresponding feature branch instead o
10
10
11
11
There are three main feature branches:
12
12
13
- - ` pico8 ` : the PICO-8 syntax branch.
13
+ - ` pico8 ` : this is a “clean” branch that only implements the PICO-8 syntax and type system,
14
+ with no extra fancy features; a good start if you’re writing your own emulator.
14
15
- ` eris ` : a branch imported from the [ eris persistence patch] ( https://github.com/fnuecke/eris )
15
16
with bug fixes and improvements ([ my pull requests have received little attention so
16
17
far] ( https://github.com/fnuecke/eris/pulls ) ); this library provides serialisable snapshots
17
18
of the Lua state (quite useful for emulators).
18
- - ` oua ` : allow to switch on-the-fly to zero-based indices in Lua, using the ` base(0) ` function
19
- and back with ` base(1) ` . I call this the ** Oua** language.
19
+ - ` oua ` : experimental branch allowing to switch on-the-fly to zero-based indices in Lua, using
20
+ the ` base(0) ` function and back with ` base(1) ` . I call this the ** Oua** language.
20
21
21
22
## PICO-8 features
22
23
@@ -30,6 +31,16 @@ There are three main feature branches:
30
31
- binary literals: ` 0b1001001.10010 `
31
32
- works in Windows, Linux, OS X, and many embedded systems
32
33
34
+ ### Limitations
35
+
36
+ - Lua functions that rely on the PICO-8 state, particularly the VM memory, are beyond the scope
37
+ of this software; for a more complete PICO-8 implementation, see the [ zepto8
38
+ emulator] ( https://github.com/samhocevar/zepto8 ) which is based on z8lua. The only exceptions
39
+ are the ` @ ` , ` % ` and ` $ ` operators (see next section).
40
+ - the ` sqrt ` , ` sin ` , ` cos ` and ` atan2 ` functions are implemented using floating point, which
41
+ is inelegant and a potential performance issue, but which also means the results are not
42
+ bit-by-bit equivalent to the original PICO-8.
43
+
33
44
## API extensions
34
45
35
46
``` c
0 commit comments