Log In  
Follow
EBArtSoft
Follow

Hi,

I played around with Pico-8 and wanted a fancy way to build and run
custom cart when the idea came to me like the urge to go π :

I NEEDED A DEDICATED SPLORE SERVER !

One hour later it was alive

Showing custom list and loading whatever I want directly from SPLORE.
I was surprised at how simple it is to make a proxy.

First I edited "drivers\etc\hosts" but it lacked flexibility...

Then I came up with the idea of ​​replacing wininet.dll by a custom script.
That way you just put (or remove) the file near pico.exe and start it.
No user hack, no patch, no third party.

You can make your own proxy with the MASM32 code below
(I think I can share it with you because it does not disclose any flaws or infringe any copyright)
(The code of the server may be more sensitive to disclose)

Anyway, I swear that no "pico8.exe" were harmed during the making of this progam.

.386
.model flat, stdcall
option casemap :none
option Prologue:none
option Epilogue:none

include windows.inc
include user32.inc
include kernel32.inc

includelib user32.lib
includelib kernel32.lib

.data

  _Wininet           dd 0
  _InternetOpenA     dd 0
  _InternetOpenUrlA  dd 0
  _InternetReadFile  dd 0
  _sInternetOpenA    db "InternetOpenA"                  , 0
  _sInternetOpenUrlA db "InternetOpenUrlA"               , 0
  _sInternetReadFile db "InternetReadFile"               , 0
  _URL               db "http://127.0.0.1:80"            , 0 ;<=== YOUR SERVER URL HERE
  _SysDLL            db "c:\windows\system32\WININET.DLL", 0 ;<=== YOUR PATH HERE
  temp               db 260 DUP(0)                           ; GIVE IT SOME SPACE !!

.code

; MAIN DLL FUNCTION
_DllMainCRTStartup proc instance:DWORD,reason:DWORD,unused:DWORD

  ; ONLY ON PROCESS ATTACH
  mov eax, [esp+8]
  cmp eax, 1
  jne @next

  ; GET REAL "WININET.DLL"
  push offset _SysDLL
  call LoadLibraryA
  mov _Wininet, eax

  ; GET REAL "InternetOpen"
  push offset _sInternetOpenA
  push _Wininet
  call GetProcAddress
  mov _InternetOpenA, eax 

  ; GET REAL "InternetOpenUrl"
  push offset _sInternetOpenUrlA
  push _Wininet
  call GetProcAddress
  mov _InternetOpenUrlA, eax 

  ; GET REAL "InternetReadFile"
  push offset _sInternetReadFile
  push _Wininet
  call GetProcAddress
  mov _InternetReadFile, eax 

@next:
  mov eax, 1
  ret 12
_DllMainCRTStartup endp

; FAKE "InternetOpen"
InternetOpenA proc
  jmp [_InternetOpenA]
InternetOpenA endp

; FAKE "InternetReadFile"
InternetReadFile proc
  jmp [_InternetReadFile]
InternetReadFile endp

; FAKE "InternetOpenUrl"
InternetOpenUrlA proc

  ; LAZY STRING REPLACE ^^
  mov eax, [esp+8]
  add eax, 25
  push eax
  push offset _URL
  call lstrcat
  mov [esp+8], eax

  ; CALL REAL "InternetOpenUrl"
  jmp [_InternetOpenUrlA]
InternetOpenUrlA endp

end

; DEF FILE LOOK LIKE =>
;LIBRARY WININET
;EXPORTS 
;
;InternetOpenA     @1
;InternetOpenUrlA  @2
;InternetReadFile  @3

Unfortunately while the dedicated server works perfectly, the SPLORE internal cache ttl make it useless for its original purpose (eg:dynamic build and run).

If you have any new idea to use such a product let me know.

.

P#89697 2021-03-28 17:08

Hi,

I had fun making a compilation of statistics on my cartridge library
(line of code, number of sprites, color etc...).

And I surprised myself when I learned that :

**1.15%** of all the cartridges are **Celeste fork**! (^w^ )

Other fun facts such as

The most used colors are :

  • N°0 with 72.06% [#000000] of all sprites (obviously empty pixels fall in that slot)
  • N°7 with 3.52% [#E8F1FF]
  • N°1 with 2.95% [#532B1D]

The most used notes are :

  • N°12 with 5.10% [C3] "Do" rules !
  • N°24 with 4.28% [C4]
  • N°31 with 3.51% [C5]

You can see all computed statistics in the CSV available on My Website. More than 4700 P8.PNG cartridges have been deeply analyzed, not all metrics has been written to the doccument. I plan to add more interesting metrics like "code token" but for now I struggle to compute them correctly.

If you think of any interesting data to extract please let me know

+===================+
| EDIT 2021-03-29
+===================+

Solved the PXA decompression issue and now all the cartridges are correctly analyzed.
I Updated the CSV with the lastest cartridges.

Enjoy

.

Note: Some Lua data are wrong - see column [Lua ERR] in CSV - due to a problem in my PXA decompression algorithm (happen with special characters) /!\ PROBLEME SOLVED

P#89683 2021-03-27 18:36 ( Edited 2021-03-29 12:58)

Hi,

This is my first post and I don't know if it's a good thing to write a question here, so let's see.

First of all I LOVE Pico-8 since years, a friend of mine introduce me to this awesome project in a game jam and I immediately felt good with it. But I am bad at drawing, composing music and coding innovative games so after that event I stopped lua coding and just continued reading news and playing cartridge made by other. You guys really make my eyes shine.

Well today I decided to contribute by making a cart reader, browser, assets extractor and a sound/music player and editor (to begin). Things are progressing well and I will soon be ready for public release. But... questions :

  • Is it legally authorized to distribute such tool ?
  • Do anybody (other than me) need/want it ?
  • Can someone help solve a pxa compression problem (maybe unicode related...) ? /!\ SOLVED

Screenshot of the actual cart browser (all WIP) :

Screenshot of the actual sound editor :

am i off topic ?

+===================+
| EDIT 2021-03-21
+===================+

A little update with two side projects, the first is intended to produce custom cartridge picture. Create or load custom picture or use pre-loaded templates, change color and text. You can also change existing cartridge picture without altering ROM data.

The second is intended to let you produce custom font file (.TTF) from a small pixel editor and use it anywhere for your game or any other document.

Tell me what you think.

+===================+
| EDIT 2021-03-26
+===================+

I just released the Pixel Font Editor (still in early dev stage, Windows only) with a TTF sample.
Use it at your own risk ^^. The editor is safe but installing custom font on your OS can put you in trouble !
Download it here : My Website

+===================+
| EDIT 2021-03-29
+===================+

Solved the PXA problem, I will be able to continue the dev.
Thanks to zeto8.

+===================+
| EDIT 2021-03-31
+===================+

Released another small tool that allows you to extract information (label, spritesheet, tilemap, lua code, P8 data) from a cartridge see picture below.
Download it here : My Website
If you have any problem or suggestion just let me know

Enjoy

.

P#88972 2021-03-14 21:28 ( Edited 2021-03-31 14:18)

Follow Lexaloffle:        
Generated 2022-05-03 21:14:46 | 0.095s | Q:9