Skip to content
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

Update to a compilable state #1

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CompileFlags:
CompilationDatabase: build/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"cmake.configureSettings": {
"CMAKE_TOOLCHAIN_FILE": "/usr/local/pspdev/psp/share/pspdev.cmake",
},
"cmake.generator": "Unix Makefiles",
"cmake.environment": {
"PSPDEV": "/usr/local/pspdev",
"PSPSDK": "/usr/local/pspdev/psp/sdk",
"PATH": "/usr/local/pspdev/bin:/usr/local/pspdev/psp/bin:$PATH"
},
}
81 changes: 81 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
cmake_minimum_required(VERSION 3.5)

project(
File_Downloader
VERSION 1.0
DESCRIPTION "File Downloader"
LANGUAGES CXX
)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(SOURCES
main.cpp
setupwifi.cpp
keyboard.cpp
setup.cpp
)

add_executable(${PROJECT_NAME} ${SOURCES})

target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

if (PSP)

message(STATUS "PSP found")

set(BUILD_PRX 1)

set(DEFAULT_STUBS
pspdebug
pspdisplay
pspge
pspctrl
pspnet
pspnet_apctl
)

set(LIBS
SDLmain
SDL_image
SDL_ttf
SDL
png
jpeg
m
z
freetype
stdc++
curl
pspsdk
pspctrl
psprtc
psppower
pspgu
pspaudiolib
pspaudio
psphprm
bz2
GL
pspvfpu
pspirkeyb
)

target_link_libraries(${PROJECT_NAME} PRIVATE ${LIBS} ${DEFAULT_STUBS})

create_pbp_file(
TARGET ${PROJECT_NAME}
ICON_PATH ${CMAKE_CURRENT_SOURCE_DIR}/ICON0.png
BACKGROUND_PATH ${CMAKE_CURRENT_SOURCE_DIR}/PIC1.png
PREVIEW_PATH ${CMAKE_CURRENT_SOURCE_DIR}/ICON0.png
)

else()

message(STATUS "PSP not found")

endif()
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ PSPBIN = $(PSPSDK)/../bin

LIBDIR =
LDFLAGS =
STDLIBS= -lSDLmain -lSDL_image -lSDL_ttf -lSDL -lpng -ljpeg -lm -lz -lfreetype -lstdc++ -lcurl -lpsp_req\
-lpspsdk -lpspctrl -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lpsphprm
STDLIBS= -lSDLmain -lSDL_image -lSDL_ttf -lSDL -lpng -ljpeg -lm -lz -lfreetype -lstdc++ -lcurl \
-lpspsdk -lpspctrl -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lpsphprm -lbz2 -lGL -lpspvfpu -lpspirkeyb
LIBS=$(STDLIBS)$(YOURLIBS)

# BUILD_PRX = 1

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = File_Downloader
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# PSP File-Downloader

A file downloader for the PSP.
242 changes: 146 additions & 96 deletions keyboard.cpp

Large diffs are not rendered by default.

11 changes: 4 additions & 7 deletions keyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Osk made by Poison from Xtreamlua.com

This is an open software.

I allow people to change/modify my own
I allow people to change/modify my own
code and to publishe it everywhere.

*/
Expand All @@ -24,21 +24,19 @@ code and to publishe it everywhere.

class Osk
{
public:

public:
Osk();
void Init(SceCtrlData *pad, SDL_Surface *ecran, char *phrase, bool *appuis);

private:

private:
SDL_Surface *m_osk_min;
SDL_Surface *m_osk_maj;
SDL_Surface *m_osk_img;
SDL_Surface *m_osk_selector;

SDL_Rect m_osk_position;
SDL_Rect m_selector_position;

std::string m_sentence;
std::string m_alphabet;
std::string m_alphabet_min;
Expand All @@ -51,7 +49,6 @@ class Osk
char m_appuisDOWN;
char m_appuisUP;
char m_minuscule;

};

#endif
74 changes: 21 additions & 53 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,17 @@ int main(int argc, char **argv)

pspDebugScreenInit();

//Chargement du Modules inet
if(pspSdkLoadInetModules() < 0)
// Chargement du Modules inet
if (pspSdkLoadInetModules() < 0)
{
printf("Error, could not load inet modules\n");
sceKernelSleepThread();
}

//Création d'un thread dans lequel on vas "travailler"
// Création d'un thread dans lequel on vas "travailler"
// Creation of a thread in which we will "work"
thid = sceKernelCreateThread("net_thread", net_thread, 0x18, 0x10000, PSP_THREAD_ATTR_USER, NULL);
if(thid < 0)
if (thid < 0)
{
printf("Error, could not create thread\n");
sceKernelSleepThread();
Expand All @@ -51,69 +52,36 @@ int main(int argc, char **argv)

sceKernelExitDeleteThread(0);

return 0;
return 0;
}


































int exit_callback(int arg1, int arg2, void *common)
{
sceKernelExitGame();
return 0;
sceKernelExitGame();
return 0;
}

int CallbackThread(SceSize args, void *argp)
{
int cbid;
int cbid;

cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();

return 0;
return 0;
}

int SetupCallbacks(void)
{
int thid = 0;
int thid = 0;

thid = sceKernelCreateThread("update_thread", CallbackThread,
0x11, 0xFA0, PSP_THREAD_ATTR_USER, 0);
if(thid >= 0)
{
sceKernelStartThread(thid, 0, 0);
}
thid = sceKernelCreateThread("update_thread", CallbackThread,
0x11, 0xFA0, PSP_THREAD_ATTR_USER, 0);
if (thid >= 0)
{
sceKernelStartThread(thid, 0, 0);
}

return thid;
return thid;
}
Loading