Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ elseif (RG35XX)
INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIRS} ${SDL2MIXER_INCLUDE_DIRS} ${SDL2TTF_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${SDL2_LIBRARIES} ${SDL2MIXER_LIBRARIES} ${SDL2TTF_LIBRARIES})


elseif(PS2)
set(CMAKE_EXECUTABLE_SUFFIX .elf)
include_directories("${PS2SDK}/ports/include/SDL2")
target_link_libraries(blockamokremix ps2_drivers patches audsrv SDL2main SDL2_mixer freetype png z SDL2_ttf pad modplug xmp SDL2 atomic gskit dma dmakit debug
config draw stdc++ m c)
else()
if (LINUX)
add_definitions(-DLINUX)
Expand Down
6 changes: 6 additions & 0 deletions Makefiles/make_ps2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export PS2DEV=/usr/local/ps2dev
rm -r build_ps2
mkdir build_ps2
cd build_ps2
cmake ../ -DCMAKE_TOOLCHAIN_FILE=$PS2DEV/share/ps2dev.cmake -DPS2=ON -DLOW_SPEC_BG=ON
make
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ Install devkitPro and SDL2 for 3DS, then run `make -f Makefiles/Makefile_3ds`.
Install VitaSDK, then build with CMake. I've included a `make_vita.sh` file for convenience once you have everything installed.
#### PSP
Install [the PSPDEV toolchain](https://pspdev.github.io/), which should also come with SDL2, SDL2_ttf, and SDL2_mixer (Linux or WSL is strongly recommended), then run `make -f Makefiles/Makefile_psp`.
##### PS2
Install [the PS2DEV toolchain](https://ps2dev.github.io/), which should also come with SDL2, SDL2_ttf, and SDL2_mixer (Linux or WSL is strongly recommended), then run sh `Makefiles/make_ps2.sh`.

## License

Expand Down
2 changes: 2 additions & 0 deletions src/draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ void saveBackgroundAsTexture(SDL_Renderer *renderer) {

#if defined(THREEDS)
Uint32 pixelFormat = SDL_PIXELFORMAT_RGB565;
#elif defined(__PS2__)
Uint32 pixelFormat = SDL_PIXELFORMAT_RGB555;
#else
Uint32 pixelFormat = SDL_PIXELFORMAT_RGB888;
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/game.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ float cubeBoundsBase = 7.5f; // 31-60 FPS (about half the difficulty settings hi
float cubeBoundsBase = 8.8f; // 60 FPS
#elif defined(THREEDS)
float cubeBoundsBase = 4.8f; // 40-60 FPS on New 3DS, 12-22 FPS on Old 3DS; with widescreen, 36-60 and 11-20
#elif defined(PSP)
#elif defined(PSP) || defined(__PS2__)
float cubeBoundsBase = 3.5f; // 23-48 FPS without overclock, 48-59 FPS with 333 MHz (full) overclock
#elif defined(VITA)
float cubeBoundsBase = 8.5f; // 52-60 FPS without overclock, 60 FPS with 444 MHz (partial) overclock
Expand Down
2 changes: 1 addition & 1 deletion src/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ static void handleAllCurrentInputs() {
const char *btn_RS = "?";
const char *btn_Start = "+/Start";
const char *btn_Select = "-/Z";
#elif defined(PSP) | defined(VITA)
#elif defined(PSP) || defined(VITA) || defined(__PS2__)
const char *btn_Up = "Up";
const char *btn_Down = "Down";
const char *btn_Left = "Left";
Expand Down
6 changes: 6 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ static void init() {
#elif defined(ANDROID)
window = SDL_CreateWindow("Blockamok Remix", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, WINDOW_WIDTH, WINDOW_HEIGHT, SDL_WINDOW_FULLSCREEN);
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
#elif defined(__PS2__)
SDL_SetHint(SDL_HINT_PS2_DYNAMIC_VSYNC, "1");
SDL_SetHint(SDL_HINT_PS2_GS_WIDTH, "640");
SDL_SetHint(SDL_HINT_PS2_GS_HEIGHT, "480");
window = SDL_CreateWindow("Blockamok Remix", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, WINDOW_WIDTH, WINDOW_HEIGHT, SDL_WINDOW_FULLSCREEN);
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
#else
window = SDL_CreateWindow("Blockamok Remix", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, WINDOW_WIDTH, WINDOW_HEIGHT, 0);
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
Expand Down