Log In  

Hi. Apologies for bothering, especially on my first post.

I find lots of great PICO-8 games that are published over on itch.io but not on the BBS. I was trying to figure out if there'd be a way to convert the HTML5 output to a proper cartridge that we can load on PICO-8.

I got as far as getting the byte array from the .js file (_cartdat), but then trying to export it to a binary file seems to create a corrupted cartridge.

I tried over C, just load it into a char[] and then write it to a file. I have a 32kb file, but it's neither a PNG nor does it load.

Is there anything else I should be looking for, or should I just give up on it?

Thanks.

P#72238 2020-01-25 20:52 ( Edited 2020-01-25 20:52)

I can answer this, @pjft.

NO.

Pico-8 is a commercial product and compiling to either JS/Mac/Unix/ or Windows is not intended to be reverse-engineered.

If the author doesn't want to share the source-code, and this can definitely be the case, then they are welcome to compile to the aforementioned consoles such as JS/Mac/Unix/Windows.

Only if it is posted in Lexaloffle or Splore do you have a chance to see the source-code of other peoples carts.

While posting sourcecode in Lex is greatly encouraged, it is not a requirement, especially to those who have purchased Pico-8.

P#72242 2020-01-25 22:40

Hi @dw817.

Thanks for the reply. Let me take a step further and ask more, as I may not have the full context here.

If we have a Pico-8 cartridge, do we always have have access to the source code? To be clear, I don't want to have access to the source code at all, but what I'd be looking for is the ability to store some of those games in my Pico-8 library, just that.

If you're telling me that the cartridges always include the non-compiled code, then I can understand why this would not be something that'd be encouraged.

What led me to think that that would perhaps not be the case is that, for what it's worth, is that the documentation itself just states:

https://pico-8.fandom.com/wiki/Export

"Exporting a web player
To export the cartridge so it can be embedded in a website, use a filename that ends in .html. PICO-8 generates two files: an HTML file with this name, and a JavaScript file with a similar name and a .js extension.

The HTML file contains the code that adds the cart to the page along with control features. You can include this code in your website and modify it as needed.

The JS file contains the cartridge data and a standalone PICO-8 player that runs in a web browser. This file is referenced by the HTML file, and should not be changed."

So, in effect, I assumed that the cartridge data would be there and that it would be possible to extract it in order to be able to run it in the Pico-8 application.

I apologize if I come across the wrong way, as it was never my intention to suggest that I wanted access to the source code (though, if one implies the other, then that's now clear to me). I run Pico-8 on a Raspberry Pi in the living room, and was really just trying to collect (offline) some of those games.

Thanks for the reply, and if per chance I misunderstood something here let me know.

Regards and have a great weekend.

P#72244 2020-01-25 23:25 ( Edited 2020-01-25 23:26)

Let's go through this, @pjft.

If we have a Pico-8 cartridge, do we always have have access to the source code?

Yes, but to view the source-code the cartridge must either have an extension of .p8 or .p8.png. There are no other exceptions.

The HTML file contains the code that adds the cart to the page along with control features. You can include this code in your website and modify it as needed.

Yes, but you can only create this HTML file if you own Pico-8 itself and use the export to HTML command. You cannot take someone's existing HTML from off of the internet and run it in the Pico-8 system.

You cannot import to Pico-8 from any of the following:

  1. Macintosh APP
  2. Linux
  3. Windows EXE
  4. HTML
  5. JS

Export is a one-way ticket. It cannot be reversed.

So, in effect, I assumed that the cartridge data would be there and that it would be possible to extract it in order to be able to run it in the Pico-8 application.

No, any cart that has been converted to HTML/JS, Macintosh, Linux, or Windows EXE CANNOT run in the Pico-8 program itself. You can neither load the source-code nor find it in Splore.

I apologize if I come across the wrong way,

That's fine. People get a little twitchy when someone speaks about reverse-engineering their code or getting an offline copy when it was intended only for online.

Take care ...

P#72254 2020-01-26 16:12 ( Edited 2020-01-26 16:26)

@dw817 thanks for clarifying these. I went over on itch.io and asked each project owner if they'd be available to/interested in sharing their work on the BBS. Here's hoping!

P#72257 2020-01-26 17:01

Note that many games cannot be shared as they won't fit into a cartridge (multi-cart or over compressed size).

P#72261 2020-01-26 19:56

@freds72 ah, the plot thickens! That makes perfect sense, thanks for sharing that additional variable as well.
Thank you both for helping introduce me a bit better to the context of Pico-8 development and ecosystem.

P#72262 2020-01-26 20:33

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 09:13:32 | 0.032s | Q:22