-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PS3 Build #91
Comments
You would need to build from the 3.6 source. Allot of the mugen stuff was very preliminary and experimental in that release. |
We should use meson to build. I doubt the ps3 stuff will work anymore. Maybe we could test it in an emulator or something if there are any good ones. |
Makes sense. I'm gonna try to build the pkg using docker as a cross compiler such as you did previously with mingw |
Thats cool that it works on RPCS3. The latest version of paintown now requires c++11 and threading support in gcc, so I'm not sure if the PS3 sdk PSL1ght supports that. |
It's almost working https://github.com/kazzmir/paintown/actions/runs/7941175624/job/21683244586#step:3:1 I have created the container with embedded ps3toolchain and it comes with compiled sdl1.2. Now it's needed to add the sdl2 and other paintown dependencies. Teorically, after that we should to be ready to compile and package. |
Once it's building and you are able to generate a pkg we should migrate the environment over from Scons to Meson. |
Ah ok, now it makes sense. |
The error occurred while attempting to compile yaml-cpp using psp-g++ How to reproducedocker run --platform=linux/amd64 --rm -i -v `mktemp -d`:/source pspdev/pspdev:latest sh -s <<EOF
wget https://github.com/jbeder/yaml-cpp/archive/refs/tags/0.8.0.tar.gz
tar xvfz 0.8.0.tar.gz
cd yaml-cpp-0.8.0
env
mkdir -p build
cd build
cmake -Wno-dev -DCMAKE_TOOLCHAIN_FILE=/usr/local/pspdev/psp/share/pspdev.cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/pspdev/psp -DBUILD_SHARED_LIBS=OFF ..
make
make install
EOF Error
|
Easy solution is to not include yaml. It's not required. |
The error suggests a general issue with compiling for a specific abi though, should we remove that -meabi flag? |
Yeah. Even removing, fail. weird. |
i'm gonna try |
I found the problem and submitted a fix jbeder/yaml-cpp#1271 |
Cool, hopefully they accept it but I bet they'll ask for something more generic (i.e. not ps3/psp) to check. But who knows. if meson.is_cross_build()
fs = import('fs')
if fs.is_dir('.tmp/yaml-cpp')
add_global_arguments('-DHAVE_YAML_CPP', language: 'cpp')
subdir('.tmp/yaml-cpp')
endif
subdir('.tmp/SDL_gfx')
endif |
We could apply a local patch to the yaml code, if upstream won't accept a change |
Good idea! git clone https://github.com/kazzmir/paintown -b build-psp
cd paintown
./easy-compile-docker-psp Error
|
https://en.wikipedia.org/wiki/PlayStation_Portable_hardware Looks like the PSP is little endian. We just have to define BLARGG_LITTLE_ENDIAN in gme/blargg_endian.h for the PSP |
Well this github issue is supposed to be about the ps3 build, but now we are discussing psp. Maybe we should move psp discussion to its own issue? |
Oh.. that's true. I'm gonna create another issue for psp |
Fixed e0f5bcb |
Merged jbeder/yaml-cpp#1271 |
Unfortunately the container PSL1GHT doesn't include SDL2_image|ttf|mixer|glx and I'm gonna add on ps3libraries |
Image ps3dev-sdl2 created Content:SDL_PSL1GHT + SDL_PSL1GHT_Libs
SDL2_PSL1GHT + SDL2_PSL1GHT_Libs
|
Are we going to use pthread instead of std:thread or the same approach used for file-system?
https://github.com/kazzmir/paintown/actions/runs/8146492951/job/22265104133#step:3:404 |
it would be nice if we could continue to use std::thread, and have std::thread use some native thread implementation, or perhaps use sdl2's threading system. if that doesn't work then maybe I will write some wrapper around std::thread that can use whatever the native threading system is for each port |
what version of g++ is ppu-g++ based off of? if ppu-g++ is something recent, like gcc 11 then I would expect std::thread to be there. if not, maybe ppu-g++ can be updated? |
7.2.0 DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run -it hldtux/ps3dev-sdl2 bash -c "ppu-gcc --version"
ppu-gcc (GCC) 7.2.0 |
We are using the toolchain https://github.com/ps3dev/ps3toolchain it's adapted for archlinux |
PR - Upgrading version - ps3dev/ps3toolchain#121
Now we can retry to compile paintown with c11 feature std::thread |
Success!
|
Awesome! How far does the game get at runtime? Does the menu show up? |
I have anticipated myself.
Well, at least now thread are detected on std namespace |
I think i understood what is going on. Paintown uses std::thread with c++11 that is Object-Oriented and pthread-emb library inside the container is compiled only in c as procedural at pthread-emb-ps3 I think the problem is that. Another point is that ppu-g++ is compiled with --enable-threads at 002-gcc-newlib-PPU.sh Testing inside the container DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run -it hldtux/ps3dev-sdl2 bash procedural.c #include <stdio.h>
#include <pthread.h>
#include <unistd.h> // For sleep() function
void* thread_function(void* arg) {
int thread_num = *((int*)arg);
printf("Thread %d is running\n", thread_num);
sleep(1); // Simulate some work
printf("Thread %d finished\n", thread_num);
return NULL;
}
int main() {
pthread_t thread1, thread2;
int thread1_num = 1, thread2_num = 2;
// Create threads
pthread_create(&thread1, NULL, thread_function, (void*)&thread1_num);
pthread_create(&thread2, NULL, thread_function, (void*)&thread2_num);
// Wait for threads to finish
pthread_join(thread1, NULL);
pthread_join(thread2, NULL);
printf("Both threads have finished\n");
return 0;
} ppu-gcc -std=c11 procedural.c -o procedural `pkg-config --libs --cflags pthread`
oo.cpp #include <iostream>
#include <thread>
// Function to be executed by the thread
void threadFunction(int threadID) {
std::cout << "Thread " << threadID << " is executing" << std::endl;
}
int main() {
// Creating a thread and passing a function to execute
std::thread t1(threadFunction, 1);
// Joining the thread to the main thread
t1.join();
// Output a message from the main thread
std::cout << "Main thread is executing" << std::endl;
return 0;
} ppu-g++ -std=c++11 oo.cpp -o oo `pkg-config --libs --cflags pthread` Result
Using -pthead
Using -fpthread
|
If you are compiling c++ code try adding |
I have solved using Util::Thread instead. |
I've notice that ps3 build were made through SCons and python.
https://github.com/kazzmir/paintown/releases/download/v3.6.0/paintown-ps3-3.6.0.pkg
Should we keep that way or try something new?
if so, do you remember steps?
I was looking at ps3toolchain : https://github.com/ps3dev/ps3toolchain
The text was updated successfully, but these errors were encountered: