Page 1 of 1

PICO-8 Possible?

Posted: Sun May 30, 2021 4:24 am
by PikWik

i just ran thru that celeste classic GBA port (https://gbatemp.net/threads/release-cel ... rt.544992/)
seeing as this port is based on the PICO-8 version of celeste, is making a PICO-8 FPGA core possible?

it would be a cool project to develop,
as theres a bunch of other celeste mods and plenty other cool games to play on PICO-8 (https://www.lexaloffle.com/pico-8.php)


Re: PICO-8 Possible?

Posted: Sun May 30, 2021 9:19 am
by Newsdee
Is the PICO-8 source code open? Or at least a spec for the file format it uses?

Re: PICO-8 Possible?

Posted: Sun May 30, 2021 10:00 am
by Higgy
You can play Pico-8 games in browser, but it needs a licence which you need to buy ($15) to use it on RPi, Linux, Win etc.
I have it running on an original RPi v1 256mb, a handy use for it!

This is a currently active small company so we would not want any licence purchase bypassing.

Re: PICO-8 Possible?

Posted: Sun May 30, 2021 11:44 am
by pgimeno
PICO-8 is not exactly a machine. As a machine, it comes with a quite abstract specification, without even an indication of a CPU; it is more like an app.

The closest might be to emulate a Pocket C.H.I.P., which comes with the app bundled: https://pico-8.fandom.com/wiki/PocketChip

Re: PICO-8 Possible?

Posted: Sun May 30, 2021 9:27 pm
by PikWik
ahh, that makes sense regarding infringing on licenses.
im not 100% if making a PICO-8 emulator would be infringing on a license due to other PICO-8 emulators existing in the wild,
and online play of several PICO-8 games is free in-browser.

i was so impressed with the celeste GBA port, i am hopeful something like a PICO-8 emulator would be possible.
heck, the rasp pi 1 is a suggested minimum spec system which can install PICO-8 to play games with, so id think PICO-8 would be possible on a MiSTer.

until then, im looking forward to other ports of PICO-8 games on retro consoles,
and seeing how well the fake-08 emulator runs on a new2DS - https://github.com/jtothebell/fake-08

-----
EDIT ... wow, the new2DS plays these P8 games great using fake-08
-----

Re: PICO-8 Possible?

Posted: Mon May 31, 2021 8:52 am
by gibs
Maybe a pokitto (www.pokitto.com) core ?
It's a real console and I think the CPU has already been done in whdl.
Would like to have this one consolized !

Re: PICO-8 Possible?

Posted: Tue Jun 01, 2021 12:21 pm
by pgimeno
It doesn't seem capable of running Pico-8 either. It can run Chip-8 though, but we already have a Chip-8 core!

Re: PICO-8 Possible?

Posted: Tue Jun 01, 2021 12:51 pm
by softtest9
Pico-8, like Löve/love2d, EasyRPG and others, is a game engine. So the first question to ask is, can it run on an existing core? Is there a Pico-8 port for DOS or Windows 9x (ao486), or the Amiga (Minimig)?

Another alternative is to design a completely new console core around Pico-8's requirements. These games run almost entirely on the CPU with no acceleration. So I would imagine that fake 2d (two 3d triangles) would the way to go for graphics. And then you also need a way to output stereo audio.

The big question here is the CPU. Can a powerful enough CPU be implemented on the MiSTer, to actually run Pico-8 at fullspeed? Would the games be fullspeed on, say, an 80mhz RISC-V CPU?

Re: PICO-8 Possible?

Posted: Tue Jun 01, 2021 1:53 pm
by Higgy
Pico-8 can run in Linux, so why can't there be one that runs on the MiSTer like the other Linux programs?

Re: PICO-8 Possible?

Posted: Tue Jun 01, 2021 3:08 pm
by softtest9
That wouldn't be an FPGA core. But yes, it should be possible. Would it be fullspeed? No idea.

Re: PICO-8 Possible?

Posted: Tue Jun 01, 2021 7:14 pm
by PikWik
hmmm, these are all good points,
and i did find another person asked this same question on the atari forums - https://www.atari-forum.com/viewtopic.php?t=36756
as discussed here, the original poster had the same idea to implement it in linux.

im perfectly fine with PICO-8 being a separate linux project for the MiSTer, and it seems the DE10 has the required specs to run it, ~700mhz CPU as suggested on lexaloffle.

i understand the PICO-8 is a lesser known game engine, but some very fun games have been made for it,
and i think most of the people on these message boards would find at least a handful of games to play.

i have been surprised at how polished some of these indie games are.
they play very much like retro arcade titles, with modern game aesthetics/design

-------------------------

celeste classic
IoT0TGF.gif
IoT0TGF.gif (1.16 MiB) Viewed 21859 times

combo pool
Mrjjo9Q.gif
Mrjjo9Q.gif (1.06 MiB) Viewed 21859 times

omega enforcer x
xNrstVv.gif
xNrstVv.gif (582.09 KiB) Viewed 21858 times

mai chans sweet buns
CCieuHv.gif
CCieuHv.gif (1.44 MiB) Viewed 21858 times

solais
Klso3Ih.gif
Klso3Ih.gif (1.4 MiB) Viewed 21858 times

Re: PICO-8 Possible?

Posted: Fri Jun 04, 2021 12:13 pm
by Matsu
Always have been fascinated with this project.
I would welcome a Pico-8 core with my whole heart.
I was one of the 2 lone people who entered the Pico-8 as a suggestion in the big mister survey,
so it could benefit from some more exposure.
Let’s keep this thread active :)

Re: PICO-8 Possible?

Posted: Fri Jun 04, 2021 1:29 pm
by darksakul
Looks to me like Pico-8 Runs on Linux with a min of 700 mhz, and it supports both x86 and Arm. (The DE 10 has a 800mhz Arm CPU on the Arm side of the Cyclone V SIC). Assuming the Linux side of the MiSTer isn't too stripped down, I can see it running as a script.
People were doing that for Doom before the 486 core got a much needed upgrade.

I know it's not a FPGA core, but it could be the "foot" into the door of many MiSTer users.

One issue I see is that Pico-8 does require a license, that toes I don't want to step on.
softtest9 wrote: Tue Jun 01, 2021 12:51 pm The big question here is the CPU. Can a powerful enough CPU be implemented on the MiSTer, to actually run Pico-8 at fullspeed? Would the games be fullspeed on, say, an 80mhz RISC-V CPU?
That's a interesting Question. The Pico-8 operates in it's own VM environment with no physical machine present.
And the programing language of choice Lua, does not define anything in hardware.

I did found this while trying to search up what does the Pico-8 supposed to simulate

https://www.lexaloffle.com/bbs/?tid=2091
Yeah, there really isn't any 'real' hardware emulation going on underneath (so no instruction pointer calls etc). In fact, even the Lua vm and runtime data is quite hidden -- it could plausibly be replaced with something completely different without breaking carts in the wild. The idea is that for 99% of users, the implementation doesn't really matter, and it's better instead to focus on design and tools that only /feel/ like there is some cute 16-bit machine running behind it.

Re: PICO-8 Possible?

Posted: Fri Jun 04, 2021 1:33 pm
by KremlingKuthroat19
Yeah I'm all for Pico-8. As mentioned, it could bring a lot of exposure to the development community and maybe get more aspiring FPGA developers to work on the MiSTer project, which would be great.

The big question is how would we get around the license issue?

Re: PICO-8 Possible?

Posted: Fri Jun 04, 2021 10:16 pm
by Higgy
Hopefully I am reading that wrong.
We should not be trying to get past the licence. You can have it so you download the MiSTer program, then you copy the files which you get from buying the licence to get it to run.

There is a Bare Metal Raspberry Pi Pico-8 project, which does the same. You can setup your SDcard and then copy across the files after you have bought the licence.

Other systems have Pico-8 'included' but I expect they paid a lump sum.

Re: PICO-8 Possible?

Posted: Sat Jun 05, 2021 1:47 am
by darksakul
But how do you translate that into a FPGA core?
Also as a FPGA core it couldn't be given for free like the other core

Re: PICO-8 Possible?

Posted: Sat Jun 05, 2021 3:31 am
by PikWik
i dont have a whole lot of experience with PICO-8, but it appears the full version that requires a license also includes a game making suite
(that also allows you to play games offline)

that $14.99 downloadable suite includes everything you need to create and play a PICO-8 game,
but again, there are plenty of other cart playing PICO-8 emulators people have made.
these emulators are strictly for playing PICO-8 games and dont include all the game creation tools in the full suite.

i would be fine with installing said full linux suite on the MISTer, if thats whats decided is best by the community,
and i could also see something like a barebones PICO-8 cart playing emulator/core developed for the MiSTer that only plays games.
but, with both of those option, having the PICO-8 loadable from the MiSTer menu is the end goal.

eitherway, im very sure PICO-8 is possible after looking at the minimum spec requirements,
(and seeing how well most games run on a nintendo 3DS)
in the grand scheme of development, i could this as a quick-ish project for someone to cut their teeth on core/emulator/script development

Re: PICO-8 Possible?

Posted: Sat Jun 05, 2021 7:41 am
by Pierco
I think a fantasy console could be a cool project for MiSTer but I don't think it's possible to replicate a Pico-8 or a Tic-80 on the FPGA side. They are just game engines with built-in tools, there's no CPU behind them and additionally, the LUA interpreter makes it very difficult to port on FPGA. If you really want a FPGA core then I think we need to build it from scratch. Creating a fantasy system is easy, we can hdl-glue components together. The hard part is software because we need a program to control all the components and to provide a full UI with a sprite/tile editor, a tilemap editor, a sound tracker etc. The first task is to write the specifications and to create an emulator to facilitate the software development.

Re: PICO-8 Possible?

Posted: Sat Jun 05, 2021 3:23 pm
by pgimeno
Totally agree. Lua compiles to bytecode, but the Lua bytecode is far too high-level to be directly run on an FPGA, as it assumes things like memory management or string hashing to be done by the interpreting CPU. There's a reason why LuaJIT is not able to compile everything.

I'm all for creating a new computer from scratch, even if it only runs on an FPGA. In fact I had a similar idea in my mind for a while. I wanted to create a computer with some retro feel, but with a fast CPU that allows use of a HLL without the performance penalty being an obstacle, and with good graphic capabilities (perhaps modelled after the Neo Geo's). So, maybe a late 80's or early 90's arcade machine turned into a computer.

This idea is a bit different, in that the target is more limited graphically for an even more retro feel (early 80s I guess), and the base software includes a full game editor rather than just a programming language. I guess that since my idea is a superset of this one, it's all about the software: let it impose the additional limitations. After all, Pico-8 and Liko-12 run on modern machines that inherently have far fewer limitations than the fantasy consoles they implement.

Re: PICO-8 Possible?

Posted: Sat Jun 05, 2021 4:10 pm
by softtest9
There are (at least) two fantasy FPGA console projects that look a bit interesting:

https://github.com/dan-rodrigues/icestation-32
https://github.com/Wren6991/RISCBoy

They won't play any Pico-8 games though.

Re: PICO-8 Possible?

Posted: Sat Jun 05, 2021 6:51 pm
by Hackshed_Carl
Both of those projects are still active too... which is a good sign.
Might be worth opening a new topic to discuss the potential of porting them over though.

Also, we'd need to find someone willing to work on it....

Re: PICO-8 Possible?

Posted: Wed Jun 09, 2021 1:47 pm
by Newsdee
This was discussed a while ago, though I can't remember if it was in this forum or the old atari-forum.

In any case, the key question is which fantasy console / framework is worth porting over. Some of this was discussed with Sorg a while ago over at the old Atari forums:
https://www.atari-forum.com/viewtopic.p ... a1#p333130

Re: PICO-8 Possible?

Posted: Wed Jun 09, 2021 3:26 pm
by pgimeno
I've been developing this idea for some days now. Initially I wanted a new computer, but I've changed my mind, or at least I've postponed it.

My current idea is to write a portable game development environment similar to Liko-12 (I don't have access to Pico-8's IDE), which can run on today's three major desktop platforms (Linux, Mac and Windows) and generates a GBA ROM.

What it won't have, is Lua. Currently I'm considering Nelua, https://nelua.io/ which compiles to C, which in turn can be compiled to GBA with a cross-compiler. Nelua misses the most salient features of Lua (tables, coroutines, dynamic types), but in place of tables it has records, and it should be about as fast as C. Not sure if there will be float support, because the GBA doesn't have an FPU, so FP operations would be very slow in comparison with integer operations.

Re: PICO-8 Possible?

Posted: Wed Jun 09, 2021 7:24 pm
by gibs
@pgimeno very good idea !

Re: PICO-8 Possible?

Posted: Thu Jun 10, 2021 1:56 am
by PikWik
that does sound like a fun project, pgimeno !
very cool idea to have the environment export a GBA rom, ill keep an eye out for any progress.

as for PICO-8 games running on the MiSTer, i hope someone will find a way to run the linux version of PICO-8, or create an emulator to just play the games/carts.
darksakul mentioned it could be possible to run PICO-8 as a linux script on the MiSTer, referencing people were doing that for Doom before the 486 core got a much needed upgrade.

i wish i knew more about this stuff to test that linux script out

Re: PICO-8 Possible?

Posted: Mon Jun 14, 2021 1:26 am
by pgimeno
To not spam this forum, those interested may follow the development here: https://codeberg.org/pgimeno/not-so-fantasy-blog

Re: PICO-8 Possible?

Posted: Mon Oct 11, 2021 6:34 pm
by pgimeno
Milestone reached! The framework is now usable, to some extent:

https://codeberg.org/pgimeno/not-so-fan ... /issues/10

Re: PICO-8 Possible?

Posted: Tue Jul 19, 2022 2:33 am
by Kalixtan
softtest9 wrote: Tue Jun 01, 2021 12:51 pm

Pico-8, like Löve/love2d, EasyRPG and others, is a game engine. So the first question to ask is, can it run on an existing core? Is there a Pico-8 port for DOS or Windows 9x (ao486), or the Amiga (Minimig)?

Just made an account to answer this:

I made a DOS implementation of Pico8 it was canned very early on and wasnt that quick but did get my friends to test on there DOS systems here are a few videos of my port (has to have the LUA script baked into the exe, no cart loading or sound ect but does work with a bunch of test games and programs).

PS: was working on a few other LUA based Fantasy systems but that was after Pico8 was added and was running out of motivation for the project.

https://cdn.discordapp.com/attachments/ ... 153948.mp4

https://www.youtube.com/watch?v=l2LN5ATFUx8

In short if you can get LUA running at a good speed then you just need to code a simple lib for the graphics and stuff. (for dos or any other system)
Things like the GBA port of Celeste is more or a conversion of the game than actaly running anything Pico8 related so you would have to start from scratch every game.

This is the tech demo thats seen running on the systems, i dont own a Mister so i dont have any ability to test. (likely will have to uppen the specs for this)

CelesteDOS-Test.zip
(319.7 KiB) Downloaded 26 times

though that said i saw basic Linux running on the Mister and im betting it will run much better than this DOS implementation.

(sorry if i formated this post poorly its my first message here so sorry about that.)


Re: PICO-8 Possible?

Posted: Tue Aug 16, 2022 9:39 am
by lordelan
Hi guys, I just created an account here to answer since this is something I'm very interested in.
While it still won't help much creating an FPGA core for a fantasy console, still here's an open source reimplementation of the (otherwise closed source) PICO-8 emulator called FAKE-08 and it's able to play almost all currently available PICO-8 games:
https://github.com/jtothebell/fake-08/