autch / piemu

Aquaplus P/ECE ("piece") emulator on SDL
Other
22 stars 6 forks source link

Building for macOS in 2020 #1

Closed gingerbeardman closed 4 years ago

gingerbeardman commented 4 years ago

Hi! Thanks for your PIECE emulator.

I'm trying to build for macOS right now.

$ make
c++ -DDEBUG -I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -I. -Iinclude -Icore -g -pthread -Wall -O2 -o piemu main.o core/core.a  -L/usr/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa -lrt -L. -Lcore
ld: library not found for -lrt
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [piemu] Error 1

Do you have any ideas? Maybe I am missing a requirement?

Arigatou gozaimasu!

gingerbeardman commented 4 years ago

If I remove -lrt then it builds but running a .pex file just gives a white window.

How did you build using macOS previously when you added fuse support?

autch commented 4 years ago

First of all, master branch is not working one; please use piemu_old branch instead (latest commits are in modernize or revert-to-single-thread branch, these branches come with CMakeLists.txt!)

This emulator requires flash memory image file named piece.pfi. It can be prepared either by ripping from the real hardware or generating one from F/W updater (can be downloaded from P/ECE Official Site).

PEX files are written into that image file (using pfar or pffs tool), then feed it to emulator. FUSE support is intended to ease above procedure.

Steps to prepare Flash image with no real hardware

(brief translation from corresponding section in readme.txt)

Go to PieceSystem 1.20 download and grab update120.exe (direct link)

Extract it by running in Windows or lha x update120.exe (Homebrew: brew install lha)

Locate piece/update/all.bin or piece/update/2mb/all.bin. Former is for 512KB flash model (genuine), latter is for 2MB flash model (hand-soldered custom)

Once piemu build succeeds, mkpfi tool is placed under tools/ directory. Run it with the path to all.bin:

$ mkpfi [-512kb|-2mb] all.bin

Now you have piece.pfi generated. Put it in the same directory of piemu.

Start piemu; you'll see the launcher menu (no apps are installed yet).

Steps to install PEX files to the flash image

tools/pffs or tools/pfar is the tool to add/remove files to/from piece.pfi image file.

$ pffs piece.pfi -adelv files...

Buttons

PC/Mac  P/ECE
---------------
Z       A
X       B
A       START
S       SELECT
Cursor  D-pad
gingerbeardman commented 4 years ago

Thanks so much! I'm confident that I can get this working. I'll report back

gingerbeardman commented 4 years ago

I think success? Thank you for the detailed instructions!

$ make
[ 29%] Built target c33core
[ 64%] Built target piemu
[ 76%] Built target mkpfi
[ 88%] Built target fusepfi
[100%] Built target pfar

pffs is missing? I guess I do not need it?

cmake found fuse 2.9.7


Branch piemu_old I cannot build

$ make
cl /c /Iinclude /W3 /WX /DWINDOWS /MD /Ox /G6 /GL /nologo bcu.c
make: cl: No such file or directory
make: *** [bcu.obj] Error 1
autch commented 4 years ago

pfar has same functionality as pffs, you can use them interchangeably.

piemu_old branch is quite old, Mac users will prefer modernize or revert-to-single-thread branch

slaminger commented 2 years ago

Hello. My name is Steve, I build Retro Arena Linux OS and Slash TV Android OS, we support over 50 devices currently, and I support things like Microvison, Arcadia 2001, Bally Astrocade, Megaduck, Supervision, Adventurevision. I will be adding this to many of our builds along with another user, adding controller supports, will push back a pull request with any relevant changes.

gingerbeardman commented 2 years ago

Thanks @slaminger !

Would be good to have a way to be able to select .pex files and have them loaded directly without having to create/add to a filesystem image.

gingerbeardman commented 2 years ago

@slaminger I have a GameForce Chi, so I'll be happy to help out with testing if/when the time comes.