Надіслав: Admin , дата:

First of all I want to say that I was dreaming about PSP since 2008 and didn't have time/money/will to buy it. The kids, problems came and this idea was put to the highest shelf.

One day my wife was on the playground with kids and sent me a photo where a lonely PSP was down in the sand just on the sand! Someone throw it away with other toys maybe thinking it's not working. The screen was cracked a bit.

Зображення

Зображення

After some time I was holding that PSP in my hands. I've ordered a new battery and turn it on. And it was working at the end. Screen is totally fine, all buttons are working. The latest firmware was installed and patched successfully.

Зображення

So now I have a device to test on and it's time to port a new game on it!

Installation docs:

https://pspdev.github.io/installation/ubuntu.html

I prefer to use the /usr/local/pspdev since all ps SDKs are located there. Download fully compiled SDK here.

https://github.com/pspdev/pspdev/releases

Precompiled SDK will save you lot's of time, but if there will be some issue with the lib you should figure out how to build it. These repositories should help:

https://github.com/pspdev/psptoolchain

Or this one where additional libs could be rebuilded

https://github.com/pspdev/psp-packages

Latest emulator download

https://github.com/hrydgard/ppsspp/releases/tag/v1.20.4

Custom cmake build

There is a psp-cmake program which will do all work for you. But I have a custom cmake flow and it was a good way to make it work with PSP.

if(NOT DEFINED ENV{PSPDEV})
	message(FATAL_ERROR "Need environment variable PSPDEV set")
endif()

set(PSP 1)

set(PSPDEV "$ENV{PSPDEV}")

if(NOT IS_DIRECTORY "${PSPDEV}")
	message(FATAL_ERROR "PSPDEV must be a folder path (${PSPDEV})")
endif()

include (${PSPDEV}/psp/share/pspdev.cmake)
    
set(
  MY_LINK_DIRS
  ${PSPDEV}/lib
  ${PSPDEV}/psp/lib
  ${PSPDEV}/psp/sdk/lib
)

set(
  MY_LIBRARIES
  SDL3
  SDL3_mixer
  SDL3_ttf
  freetype
  z
  GL
  modplug
  stdc++
  m
  bz2
  png16
  harfbuzz
  pspdebug
  pspdisplay
  pspge
  pspaudiolib
  pspaudio
  pspgum
  pspgu
  pspvram
  pspsdk
  pspuser
  pspctrl
  pspnet_apctl
  pspnet
  psphprm
  pspvfpu
  # pspkernel
)

set(
  MY_INCLUDE_DIRS
  ${PSPDEV}/include/
  ${PSPDEV}/psp/sdk/include/
)

file(GLOB all_SRCS
    "${PROJECT_SOURCE_DIR}/src/*.cpp"
)

add_executable(${PROJECT_NAME} ${all_SRCS})

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/psp)

target_link_directories(${PROJECT_NAME} PUBLIC ${MY_LINK_DIRS} )
target_include_directories(${PROJECT_NAME} PUBLIC ${MY_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} PUBLIC ${MY_LIBRARIES})

set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")

# Create an EBOOT.PBP file
create_pbp_file(
	TARGET ${PROJECT_NAME}
	ICON_PATH NULL
	BACKGROUND_PATH NULL
	PREVIEW_PATH NULL
	TITLE ${PROJECT_NAME}
	VERSION 01.10
)
    

I was trying to play with MY_LIBRARIES variable, but it works in this order. Changing some values just break the flow. I didn't have much time there, it was enough playing when it's working.

Debugging

https://pspdev.github.io/debugging.html

I should be more careful with the memory since I hit the memory limit bug on PSP 100x when tried to create or load a texture that was bigger than 512x512.

Another issue that produced a bug was with typeid() function which went completely fatal on psp. Also Android builds were not success withot -frtti flag.

It's good to see transparency bit in BMP is working fine on PSP. It's still a hard to me to make it work in PS3 PSL1GHT port for SDL3. I'm still in progress there.

One thing I also notices that size_t type is 8 bits on my local 86_64 machine but 4 bits on PSP.

MP3 sounds works fine on PSP if they are small enought and use the lower encoding as possible. I've choose 11kHz and 64Kbs MP3 bitrate for 30sec long music.