All Projects → samhocevar → z8lua

samhocevar / z8lua

Licence: other
🧩 A Lua fork that supports PICO-8 syntax extensions and zero-based tables, part of ZEPTO-8

Programming Languages

c
50402 projects - #5 most used programming language
C++
36643 projects - #6 most used programming language
Makefile
30231 projects

Labels

Projects that are alternatives of or similar to z8lua

Anteform
Anteform is a retro weird detective game written using the Minima Engine for PICO-8.
Stars: ✭ 17 (-37.04%)
Mutual labels:  pico8
Pico8Platformer
A platformer sample written for Pico-8, includes slopes and jump buffering
Stars: ✭ 38 (+40.74%)
Mutual labels:  pico8
jspicl-mario-sample
A basic Mario game showcasing how to create PICO-8 games in JavaScript.
Stars: ✭ 19 (-29.63%)
Mutual labels:  pico8
midi2pico
Midi to PICO-8 converter
Stars: ✭ 51 (+88.89%)
Mutual labels:  pico8
P8Coder
A programming tool that replaces the lua code in pico-8 cartridges (p8) with the code you write in P8Coder.
Stars: ✭ 89 (+229.63%)
Mutual labels:  pico8
pico2tic
PICO-8 Wrapper for the TIC-80
Stars: ✭ 48 (+77.78%)
Mutual labels:  pico8
fake-08
A Pico-8 player/emulator for console homebrew
Stars: ✭ 374 (+1285.19%)
Mutual labels:  pico8
Awesome Pico 8
A curated list of awesome PICO-8 resources, carts, tools and more
Stars: ✭ 1,955 (+7140.74%)
Mutual labels:  pico8
PICO-EC
A tiny scene-entity-component library created for the PICO-8 fantasty console.
Stars: ✭ 37 (+37.04%)
Mutual labels:  pico8
tac08
tac08 is an an emulation of the runtime part of the Pico-8 fantasy console. It takes a .p8 (text format) pico-8 cart file and runs it as closely posible
Stars: ✭ 144 (+433.33%)
Mutual labels:  pico8

z8lua

This is a fork of Lua that implements the PICO-8 dialect and adds useful features for emulator implementations.

Branches

The main zepto8 branch is a composite branch built from several feature branches. Please try to submit patches and PRs against the corresponding feature branch instead of zepto8.

There are three main feature branches:

  • pico8: this is a “clean” branch that only implements the PICO-8 syntax and type system, with no extra fancy features; a good start if you’re writing your own emulator.
  • eris: a branch imported from the eris persistence patch with bug fixes and improvements (my pull requests have received little attention so far); this library provides serialisable snapshots of the Lua state (quite useful for emulators).
  • oua: experimental branch allowing to switch on-the-fly to zero-based indices in Lua, using the base(0) function and back with base(1). I call this the Oua language.

PICO-8 features

  • short if syntax (on one line)
  • short print syntax (? at the beginning of a line)
  • compound assignment operators: += /= etc.
  • C style not equal operator: !=
  • C++ style comments with //
  • fixed-point arithmetic with overflows, infinity etc.
  • the PICO-8 math library (shr, atan2, flr etc.)
  • binary literals: 0b1001001.10010
  • works in Windows, Linux, OS X, and many embedded systems

Limitations

  • Lua functions that rely on the PICO-8 state, particularly the VM memory, are beyond the scope of this software; for a more complete PICO-8 implementation, see the zepto8 emulator which is based on z8lua. The only exceptions are the @, % and $ operators (see next section).
  • the sqrt, sin, cos and atan2 functions are implemented using floating point, which is inelegant and a potential performance issue, but which also means the results are not bit-by-bit equivalent to the original PICO-8.

API extensions

LUA_API void lua_setpico8memory (lua_State *L, unsigned char const *p);

Provide the Lua VM with a 64-KiB address space for use with the @, % and $ operators (shorthands for peek, peek2, and peek4). Otherwise these operators will always return 0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].