Code Monkey home page Code Monkey logo

fake-08's Introduction

fake-08

A Pico 8 player for homebrew consoles. Not related to or supported by Lexaloffle Software. Latest release includes releases for Nintendo 3DS, Nintendo Switch, Sony PS Vita, Nintendo Wii U, the Miyoo CFW for bittboy and similar consoles, and the Miyoo Mini. If you are feeling extra brave, you can also download build aftifacts from the latest CI runs in the Actions section

Project Goals

The goal of Fake-08 is to make Pico-8 games playable on platforms that aren't officially supported. As such, I will only be providing builds for platforms that won't run Pico-8 proper (No Windows, Mac, Linux, Raspberry Pi, or web builds). As maintainer, my focus is on improving compatibility having fun. If you would like a specific feature or bug fixed, feel free to add an issue (but be patient- it may not be worked on immediately) or submit a pull request (see Other Notes below).

Usage:

Installation will vary by console and executable type. If it is a console with a homebrew menu (Switch, Wii U, 3DS using .3dsx), place the executable file in the directory with other executables. If it is a console with installable hombrew (3ds with .cia, or PS Vita) install executable (VitaShell on Vita or FBI on 3DS).

Pico 8 cart files go in the p8carts/ directory of your memory card (SD card on 3DS, Switch, and Wii U, memory card at ux0:/ on Vita). .p8 text file carts and .p8.png image file carts are supported.

Launch FAKE-08 either via the homebrew menu or normal system UI (depending on how you installed). Use left and right to cycle through carts on the SD card. Choose a cart using the A (Nintendo consoles) or X(Vita) button. To exit the currently running cart, press Start or + to open the pause menu and select Exit to Menu. Press R to cycle between rendering sizes. Press L and R simultaneously to exit the appication. You can also close it via your console's operating system controls (home button etc).

For bittboy and similar consoles, back up emus/pico8/pico8.elf and replace it with the one from the release. Place your cart files in roms/pico-8/ and use the front end of choice to launch games. Press the menu button to return to the menu (though you can also press start and exit to the FAKE-08 bios menu if you would like).

To launch on a Miyoo Mini you need to call the executable directly from the terminal emulator, or create a shortcut. I'm not sure exactly how that works and don't have a device to figure it out, so help is welcome if anyone would like to provide guidance there. If you are using onion OS just copy FAKE08 to the Emu/PICO directory, overwriting the existing build (make a backup first just in case).

Libretro cores are still in early development but should be working. Installation can be tricky however. In general you'll need to install the core (Load Core -> Install or Restore a Core -> {Navigate to core file location}) and also drop the fake08_libretro.info into the retroarch cores directory. This directory may be hidden and its location varies from platform to platform. Once that file is in place, you should be able to scan for Pico-8 carts using "Scan Directory." If that doesn't work for some reason, you can do a "Manual Scan." If doing a manual scan, choose the directory, set the custom system name to "Pico-8", set the default core to the one you just installed, and file extensions to "p8 png" and it should add a playlist of your Pico-8 carts associated with the newly installed core.

Building:

All platforms have automated builds set up via GitHub actions using docker images. You can see how those are set up in the .github/workflows directory of the repo. To run them locally using docker run the following command from the root directory of this repo (replace {docker-image} and {platform} with the values from your platform of choice in .github/workflows/build.yml):

docker run -v $PWD:/build_dir {docker-image} /bin/sh -ex /build_dir/.github/workflows/{platform}.sh

-v $PWD:/build_dir mounts the output of pwd (current working directory) in the docker container at .build_dir

/bin/sh -ex /build_dir/.github/workflows/{platform}.sh executes the build script for that platform. Most just call make, but a few also execute a couple extra steps

Building outside of a pre-setup docker container will require a toolchain installation for the platform that you want to build.

For the Nintendo consoles, install the appropriate toolchain from devkitpro (see https://devkitpro.org/wiki/Getting_Started). Switch and Wii U also require the platform specific SDL2 portlibs to be installed.

Building for the Vita requires Vita SDK (see https://vitasdk.org/) to be installed.

Once you have the appropriate toolchain(s) installed, call make followed by the platform name (3ds, switch, vita, or wiiu) to build that platform, or just make to build them all. make clean will clean all files from all platforms.

Building tested on windows using devkitpro's msys2 and Ubuntu (WSL and standalone). Should work on other plaforms as well.

Building for bittboy requires builing your own toolchain first (and will probably only work on unix.). The toolchain is available at https://github.com/bittboy/buildroot/. Clone and build that repo, then recursively copy the contents of output/host/ to /opt/bittboy-toolchain/. You should then be able to use the make bittboy command.

Building for Miyoo mini uses shauninman's Union Miyoo Mini toolchain: https://github.com/shauninman/union-miyoomini-toolchain

Acknowledgements

  • Zep/Lexaloffle software for making pico 8. Buy a copy if you can. You won't regret it. https://www.lexaloffle.com/pico-8.php
  • Nintendo Homebrew Community
  • Vita Homebrew Community
  • zepto8 (https://github.com/samhocevar/zepto8) - Probably the best Pico 8 emulator. FAKE-08's audio, tline, emoji conversion, and newer png decompression implementations were ported from zepto8, and other parts were heavily influenced. I also use a slightly modified z8lua (https://github.com/samhocevar/z8lua) for pico 8 specific features.
  • PicoLove (https://github.com/gamax92/picolove) - Noise synthesis ported from this Pico Love, and it was also the basis for my previous project - PicoLovePotion - and where I first learned the basics of Pico 8's API
  • tac08 (https://github.com/0xcafed00d/tac08) - a Pico 8 emulator that I leared a lot from. FAKE-08's sprite rendering and cart parsing were originally based on tac08's implementations
  • LovePotion (https://github.com/TurtleP/LovePotion) - an implementation of Love2d for 3DS and switch that served as the runtime for PicoLovePotion, and a great way to make homebrew games for the 3DS and switch. I also use a modified version of their static Logger implementation
  • ps4-p8 for a working save state implementation to reference. Savestates currently only available in libretro cores

See LICENSE.MD for FAKE-08 license (MIT) as well as licenses of all other software used

Known Issues:

Latest Pico 8 version v0.2.2 features (sprite fill patterns, text control codes, custom fonts, etc) not implemented yet

Games using flip() (like tweetcarts) have intermittent problems exiting back to the menu, and may crash the console. Use with caution.

Sound emulation is not perfect, and the noise implementation is noticably inaccurrate. Most of my sound implementation was ported over from Zepto 8. with the exception of the Noise instrument which was ported from PicoLove. It is not 100% accurate, and some games have noticable clipping/popping.

Performance is not great on Old 3ds systems. Some games may experience slowdowns on the faster consoles as well. More optimizations are probably possible, but keep in mind that Pico 8 lists a raspberry pi 1 with a 700 MHz ARM11 professor as minimum spec, and the old 3DS's CPU is 268 MHz ARM11. Many games should be playable regardless, and hopefully more optimizations can be made.

See Issues page for more specifics

Carts

You browse and download carts by using the SPLORE() function in Pico 8 (again, if you have $15 to spend, and you are interested in game dev, it is well worth your money). Once you have loaded a cart that you want to try on FAKE-08, type save {{cartname}}.p8 to save the cart as a text file, then copy that file to your device's SD card.

You can also browse carts on the Pico-8 BBS website (https://www.lexaloffle.com/bbs/), but can only download complete carts in png format. As of pre release v0.0.1.1 Fake-08 should load and play png carts provided they don't use any other unsupported features. You can download p8.png carts from the Cart link in the lower left of the game view, and save it into your p8carts directory.

If you are trying to play a multi cart game, it should be noted that you must provide all the carts required by the game as FAKE-08 currently does not have cart downloading capabilities. All carts should be placed in the same directory.

Other Notes

Compatibility is improving, but not perfect. I think many carts should work, but this is still a project in the early stages, and it is my first real foray into C or C++ development and low level game dev in general. I'm mostly doing this project as a fun way to learn.

Feel free to write up any issues you come across, and attach or link to a cart that reproduces the issue. My main goal is to improve compatibility with Pico 8, and then improve speed of carts that are too slow on New 3DS systems.

Pull requests are also welcome. There are some requirements noted in the pull request template. Notably that all platforms build cleanly, the tests pass, new tests are added if applicable, and each PR is limited to a single feature or bug fix.

Postcard Image From Vita Sprite Credits:

fake-08's People

Contributors

bslenul avatar christianhaitian avatar darktiny avatar dps2004 avatar fifteenhex avatar fringd avatar gameblabla avatar godmil avatar jtothebell avatar prashantkamdar avatar sylverb avatar willjow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fake-08's Issues

Cartdata is not persisted

Cartdata can be stored and retrieved with dget and dset but it does not currently persist. This means nothing is saved between runs of a cart.

Pico-8 Cart Errors- Preprocessor not matching pico 8

So I keep getting errors for carts that genuinely work with pico-8, so I'm going to list the errors off from the log, and also add the carts.

Carts:
https://drive.google.com/drive/folders/1TQU9NKIOhswd8n70f1HKT-70EbrC0jIZ?usp=sharing

  1. SkiFree
    Setting cart audio rom data from strings
    ERROR loading cart
    Error: [string "s="--"d=1x=64o={}j=add...']:10; unexpected symbol near '?'

  2. Mini Golf
    Setting cart audio rom data from strings
    ERROR loading cart
    Error: [string "q=circfill r=rnd b=btn f=0p=pal..."]:2: expected nar '<\146>'

  3. Automata
    Setting cart audio rom data from strings
    ERROR loading card
    Error: [string "-- 1-d cellular automata demo..."]:20: unexpected symbol near '<\151>'

And those are the 3 files I have troubles with.

Some carts not working with "eRROR LOADING CART LUA"

Some pico-8 carts, when loaded, do not boot and instead display on the console "eRROR LOADING CART LUA"
The games I have had trouble with are:

  • Dodge
  • Alone in pico
  • Warehouse Panic
    I am using .p8.png files on my 3DS using the .3dsx executable.

Typo in readme

While browsing your repo, I noticed the picolove link was broken due to a typo.
Have submitted a PR that will fix that: #15

Front end and feedback

Hey it's m Agen got a chance to mess around with fake-8 game compatibility has improved wonderfully I was wondering if you have any plans to add a front end of say a IMG of the cartridge and some details to make IT easer to diside on what to play sorry about the mobile typing :)

Text outline issue

affects multiple carts: Sonic, soulbound. Example cart text:
function brd(f)
apal(0)
camera(-1,0) f()
camera(1,0) f()
camera(0,-1) f()
camera(0,1) f()
pal()
camera() f()
end

function apal(n)
for i=0,15 do pal(i,n) end
end

function _draw()
cls(10)

local s="press ❎ to start"
function f()
print(s,64-2*#s,88,15)
end
brd(f)

end

Sound on Wii U

Sound on the Wii U is currently turned off because it sounds mixed up. The sounds sound like the right pitches, but out of order. Since Wii U is an SDL 2 platform, my first suspicion is that it is a problem with the Wii U being Big Endian, but I've been focusing on other issues and haven't dug too deep.

Request for 4:3 aspect ratio stretch mode

Request from u/nowhere_man87 on reddit:

I wanted to know if you could incorporate two more resolutions, one in 4:3 aspect, to take better advantage of the PSVita screen, but without distorting the proportions of the game as much as the full screen 16: 9 mode does.

Should be relatively easy to add a new stretch mode

PS Vita bugs/crashes/LUA missing

Hi. I'm testing a bunch of carts on PS Vita Pico-8 version, most of them works very well but there are some bugs yet.
Tested with v0.0.2.4 . Created an account in here just to report these issues for you. Amazing work by the way.

LUA ERROR/MISSING

3D Racing Game WIP.p8 | work in progress (https://www.lexaloffle.com/bbs/?pid=16351#p)
SlipWays.p8 | (https://www.lexaloffle.com/bbs/?pid=50626#p)
Chimeras Garden.p8 | work in progress (https://www.lexaloffle.com/bbs/?tid=27877)

GENERAL BUGS

Desert Lead 3D.p8 | (https://www.lexaloffle.com/bbs/?pid=43451)
Issue: buttons does't work

Explorers.p8 | (https://www.lexaloffle.com/bbs/?pid=82024#p)
issue: black screen

Hydra.p8 | (https://www.lexaloffle.com/bbs/?pid=19600#p)
issue: split screen in half and slow speed

Jack of Spades.p8 | (https://www.lexaloffle.com/bbs/?pid=65294#p)
issue: screen frozen

Katamari Christmassy.p8 | (https://www.lexaloffle.com/bbs/?pid=71186#p)
issue: messy controllers

PICO ARCADE.p8 | (https://www.lexaloffle.com/bbs/?pid=72470#p)
issue: unable to launch games with "X"

PICOWARE.p8 | (https://www.lexaloffle.com/bbs/?pid=65884#p)
issue: black screen after dialogue with mom

Pinballvania!.p8 | (https://www.lexaloffle.com/bbs/?pid=63353#p)
issue: controllers, pressing up to continue doesn't work

Soulbound.p8 | (https://www.lexaloffle.com/bbs/?pid=82570#p)
issue: difficulty to read dialogues

Storming The Grandmothership.p8 | (https://www.lexaloffle.com/bbs/?pid=89237#p)
issue: buggy intro animation, crashes after pressing Z+X to start

Sugar Rush.p8 | (https://www.lexaloffle.com/bbs/?pid=88978#p)
issue: after the counter in the beginning of the game, it appears "not so much" every time

Super Contra Hot.p8 | (https://www.lexaloffle.com/bbs/?pid=69629#p)
issue: buggy screen

Super Pico Runner Brothers.p8 | (https://www.lexaloffle.com/bbs/?pid=30095#p)
issue: black screen

Tomato Worm.p8 | (https://www.lexaloffle.com/bbs/?pid=55292#p)
issue: playable but buggy screen, shows weird screens during gameplay

CRASHES RIGHT AFTER LAUNCHING THE CART

Across The River.p8 | (https://www.lexaloffle.com/bbs/?pid=10832#p)
Crowded Dungeon Crawler.p8 | (https://www.lexaloffle.com/bbs/?pid=82720#p)
Delia Mute in Grave Grotto.p8 | (https://www.lexaloffle.com/bbs/?pid=11873#p)
Demon Castle.p8 | (https://www.lexaloffle.com/bbs/?pid=66004#p)
Gifts on Venus.p8 | (https://www.lexaloffle.com/bbs/?pid=60313#p)
GRiPPY.p8 | (https://www.lexaloffle.com/bbs/?pid=86852#p)
Impossible Mission R.T..p8 | (https://www.lexaloffle.com/bbs/?pid=88937#p)
Lemmtris.p8 | (https://www.lexaloffle.com/bbs/?pid=11644#p)
Masters of the Universe.p8 | (https://www.lexaloffle.com/bbs/?pid=81037#p)
PicoKart.p8 | (https://www.lexaloffle.com/bbs/?pid=17739#p)
Picopolis.p8 | (https://www.lexaloffle.com/bbs/?pid=42185#p)
Ramps.p8 | (https://www.lexaloffle.com/bbs/?pid=77443#p)
Scrap Boy.p8 | (https://www.lexaloffle.com/bbs/?pid=82518#p)
The Chamber Scrolls.p8 | (https://www.lexaloffle.com/bbs/?pid=33420#p)
The Stroll.p8 | (https://www.lexaloffle.com/bbs/?pid=15316#p)
Tower Noire.p8 | (https://www.lexaloffle.com/bbs/?pid=11028#p)
Willo.p8 | (https://www.lexaloffle.com/bbs/?pid=83251#p)

Pause menu not correct when using different draw modes

The pause menu is drawn in the normal framebuffer, so when using different draw modes (flipped, 64x64, etc) it doesn't get drawn correctly. The pause menu should be drawn independent of the regular frame buffer to fix this issue.

.cia build

I have CFW on my 3DS, so i prefer .cia to .3dsx as a file format

btn() and btnp() do not accept emojis as arguments

In PICO-8, btn() and btnp() functions can accept emojis(such as ⬅️ and ➡️) (NOT STRING) as argument for what input to read. However, in FAKE-08, these presented in arguments return "unexpected symbol" error and do not allow running the cart.
cart+log.zip
(Tested on New 3DS XL via CIA prebuild in release)

Possible solution: make gamepad emojis into global variables like here
image

Add keyboard on bottom touchscreen+Cart issues

I believe that fake-08 would be much easier to use if there was a keyboard on the bottom touchscreen while the console is open. i also had some issues loading X-ZERO (attached here)

xzero-3 p8

i would launch the cart, it would show the title screen, and when i would press O to play, it crashes fake-08 and goes into the HOME menu :/

Blue(12) color displays as black + some shapes aren't drawn + map() doesn't work when not all arguments provided

Issues encountered in: Iceberg Curse
icecur p8
Version: 3DS CIA build v0.0.2

As I was trying to debug with other carts I couldn't find the exact why first 2 issues happen as other carts work fine (Pico De Pon as example) but blue color (12) is displayed as black instead as well as some shapes not being drawn in that particular cart. map() not displaying when not all arguments provided seems to be consistent though?

(Sorry for throwing several issues in one but i was too lazy to post each one separately)

Pico Driller not working - tonum needs to support fixed point binary string literals

Sorry if there was a comment section I could not find but I just wanted to thank you for makeing this

As I Really Love Pico-8 can't wait to give this ago if/when my 3ds gets here my old one got stolen 2 years ago with my 2 favourite games at the time :( anyway I was wondering if U have any plans to
Change the icon? Also some screenshots s whod be cool :) I'd love to see
Pico driller running on this!

Multicart support

load and reload with a cart file name are not yet supported. These are needed for multi cart games

Create loader for custom bubbles

Can you create a loader for adding custom bubbles to the live area? Retroarch and DaedalusX64 both have this, and this would make it easier to create bubbles for specific games instead of having to sort thru the list.

Dank tomb green outline

From u/bruno84000 on Reddit
Dank Tomb has a green square permanently around the protagonist.

Remember screen size setting.

The default screen size looks weird on 3DS. I won't need to change it every time if the setting can be remembered.
IMG_3774

srand and music bugs

Doing srand() without providing a seed throws an error in fake-08 despite working fine in PICO-8. Can be worked around by giving srand a seed of 0 as in srand(0). Both probably do the same thing in PICO-8, but it is still incorrect behavior for srand() to not work. Can probably be fixed by making the seed an optional argument that defaults to zero when no argument is provided.

music(-1) is incorrectly interpreted as music(0) by fake-08. music(-1) is supposed to terminate any music that this currently playing.

Finally, and I know this is a 0.2 feature but I will mention it anyway, rnd() throws an error when given a table. Can be worked around using the trick that was used to get random choices from tables prior to 0.2.

Issues with two player games

From u/Snowbro88 on Reddit
HI have come to report a problem with games that support 2 players such as Mistigri or Amazeball Dudes, when I play in single player mode, when you press X (button to attack) automatically the second player enters into action and in fact the two characters both are controlled in a rare way with the same control

Edit: This bug also messes up the controls on X-Wing Vs Tie Fighter

Wii U resolution/scaling

If you press the R button to toggle between scales on Wii U, FAKE-08 seems to get stuck in a "toggling scales" state, so that every single frame after that, the scaling changes, making it unusable and probably a health hazard for anybody with photosensitive epilepsy. The issue is only resolved by completely exiting and restarting the app.

Separately from the actual bug, if the scaling worked it could probably be somewhat better, given the multi-screen, multi-resolution setup of the Wii U. I'm not sure what the exact limitations of working with the Wii U SDL2 port are, but my understanding is that it only supports 720p. The real ideal would be not dealing with that limitation at all, so that you could have native resolution output at all resolutions, but that falls beyond the scope of a FAKE-08 issue.

That said, I wonder if it could be handled better within those limitations? Currently, the 720p output of FAKE-08 is being scaled with nearest-neighbor (no interpolation) to the output resolution: 480p on the GamePad, and any of 480p, 720p and 1080p on the TV. This is resulting in uneven pixel shapes on the GamePad and on TV for any users set to 480p or 1080p; only 720p on TV really looks correct. If it's possible with SDL2 on Wii U, the final scale for output should be performed with bilinear filtering, preserving the correct pixel shapes on both TV and GamePad regardless of resolution, in exchange for some mild blurring at pixel edges.

Request for vertical option on vita

from u/nowhere_man87 on reddit

  1. I wanted to know if you could incorporate two more resolutions, one in 4:3 aspect, to take better advantage of the PSVita screen, but without distorting the proportions of the game as much as the full screen 16: 9 mode does.

  2. Also another in vertical 4: 5 or 2: 3, with the image rotated to the left, therefore in TATE mode, so that the games can be controlled with the right stick and played with the square and triangle, it would made the Vita a Game Boy on steroids. This portrait mode would allow for the largest image size with little deformation (or none if 1:1).

Reduce code duplication in SDL 2 platforms

Switch, Wii U, and Vita host classes have a lot of code duplication. Should probably use an intermediate subclass to share code between the three of them where it makes sense.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.