Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs

TIC-80

tiny computer for making, playing and sharing tiny games · By Nesbox

PICO-8 API Wrapper for TIC-80

A topic by gl.itch created Feb 22, 2017 Views: 1,388 Replies: 8
Viewing posts 1 to 5
(3 edits) (+1)

I've been working on a PICO-8 API wrapper for TIC-80. It's not feature-complete yet, but it's getting there and has helped me move many of my PICO-8 projects into the TIC environment very quickly. Thought I'd share and see if it's useful to others.

It wraps most of the API functionality—favoring compatibility over performance—and also initializes the PICO-8 palette in the correct color order.

Check it out here and let me know what you think: https://github.com/musurca/pico2tic/

Developer(+2)

Also you can use cartridge metadata to init palette https://github.com/nesbox/tic.computer/wiki#cartri...

Try to add the code to initialize pico palette in the correct order

-- pal: 0000001d2b537e2553008751ab52365f574fc2c3c7fff1e8ff004dffa300ffec2700e43629adff83769cff77a8ffccaa

Interesting idea btw

Thanks

(1 edit)

Ah, I didn't realize you could do that--thanks. There may still be an advantage to storing it outside of the metadata so that changing/restoring the screen palette via pal(a,b,1) will work—but I guess I could always pull it directly out of memory during initialization.

this is very handy! Great idea!

The only thing I really miss from pico8 is the += functionality. Though I don't think that can be added externally

TIC-80 is based on real LUA on the contrary of PICO-8. And LUA doesn't support shorthands.

If you want to use shorthands like +=, -=, *=, /=, %= you should try moonscript which is supported by TIC-80

(+1)

Yeah, I get that. I'm pretty sure pico uses "real" lua too, It just has some of the standard library inaccessible on purpose, to keep it in line with their philosophy of an old ass computer. I'm also pretty sure it accomplishes its three, incredibly useful, short hands by parsing your code and modifying it before passing it to what ever handles the lua calls in the engine.


Those short hands, the "IF (NOT B) I=1 J=2" if statement, the unary math operators, and the "!= " so much more readable than ~= in the low-fi font, would be nice to see in tic. But i love tic, I'm just griping.


Also, something about moonscript just turns me off. I don't like its syntax at all, it looks like an interactive fiction language like Alan or Inform7.

Interesting, I tried it on a small game I've made and it fixed all missing function issues except tostr. There were no assets, which contained level design so the game is not playable, but it seems promising (even with the game assets I would still need to replace the missing sprite flag feature in TIC-80 by manually calling fset at the beginning of the game... not designer-friendly, but ok).

For remaining functions like tostr, you can get some inspiration from pico-love, since they also adapt PICO-8 functions to native Lua: api.lua

I use myself a simplified version for my unit tests that run directly in Lua (pico8api.lua). Since I don't test rendering, most render/audio methods are empty, though.

(1 edit) (+1)

I have a PHP script that will export the PICO-8 map to a .map file that can be imported into TIC-80. It will also export the sprite flag data into CSV to be used in a table for my own fset and fget functions (and looks like it would work with gl.itch/musurca's functions (__p8_sflags) as well).

I'd already written the few functions I needed before I found this excellent script. It has been handy to add one or two though.

I've just uploaded my first ever project to the PICO-8 BBS, and am now looking to write the camera code for the TIC-80 so that I can upload the port.

https://gist.github.com/neilpopham/938cb47239be25e6155f020a30681d5b

$ php convert.php foo.p8

Will create foo.p8.map and foo.p8.gff with CSV data.