diff --git a/.gitignore b/.gitignore index c0e59a98..622b09b7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,15 @@ *.u *.z *.gcda +*.gba +*.bin gpsp.gpe tags cscope.out pandora/linux bittboy/gpsp +x86/*.txt +bittboy/*.txt +x86/*.cfg +x86/gpsp +bittboy/*.cfg diff --git a/bittboy/Makefile b/bittboy/Makefile index 5d031b58..2ab31682 100644 --- a/bittboy/Makefile +++ b/bittboy/Makefile @@ -5,7 +5,7 @@ # Global definitions -CC = /opt/bittboy-toolchain/usr/bin/arm-miyoo-linux-musleabi-gcc +CC = /opt/bittboy-toolchain/usr/bin/arm-linux-gcc OBJS = main.o cpu.o memory.o video.o input.o sound.o gui.o \ cheats.o zip.o arm_stub.o warm.o cpu_threaded.o video_blend.o sha1.o imageio.o @@ -16,12 +16,12 @@ BIN = gpsp VPATH += .. ../arm CFLAGS += -DARM_ARCH -DPC_BUILD -DBITTBOY -Wall -CFLAGS += -Ofast -fdata-sections -ffunction-sections -flto -fno-PIC -fprofile-use -CFLAGS += `/opt/bittboy-toolchain/arm-miyoo-linux-musleabi/sysroot/usr/bin/sdl-config --cflags` +CFLAGS += -Ofast -fdata-sections -ffunction-sections -fsingle-precision-constant -fno-PIC -flto -march=armv5te -mtune=arm926ej-s -fprofile-generate=./profile +CFLAGS += `/opt/bittboy-toolchain/arm-buildroot-linux-musleabi/sysroot/usr/bin/sdl-config --cflags` # expecting to have PATH set up to get correct sdl-config first -LIBS = -lc -lgcc -lSDL -lpng -lasound -lz -Wl,--as-needed -Wl,--gc-sections -flto -s +LIBS = -nodefaultlibs -lc -lgcc -lSDL -lpng -lasound -lz -Wl,--as-needed -Wl,--gc-sections -flto -s # Compilation: diff --git a/cpu.c b/cpu.c index 55a5aee4..f0504599 100644 --- a/cpu.c +++ b/cpu.c @@ -4429,7 +4429,7 @@ void execute_arm(u32 cycles) } } -void init_cpu() +void init_cpu(uint32_t BootFromBIOS) { u32 i; @@ -4439,7 +4439,9 @@ void init_cpu() } reg[REG_SP] = 0x03007F00; - reg[REG_PC] = 0x08000000; + reg[REG_PC] = BootFromBIOS + ? 0x00000000 + : 0x08000000; reg[REG_CPSR] = 0x0000001F; reg[CPU_HALT_STATE] = CPU_ACTIVE; reg[CPU_MODE] = MODE_USER; diff --git a/cpu.h b/cpu.h index f19d2022..f3775454 100644 --- a/cpu.h +++ b/cpu.h @@ -208,7 +208,7 @@ extern u32 memory_writes_u8; extern u32 memory_writes_u16; extern u32 memory_writes_u32; -void init_cpu(); +void init_cpu(uint32_t BootFromBIOS); void move_reg(); #endif diff --git a/gui.c b/gui.c index 340fd222..3a604033 100644 --- a/gui.c +++ b/gui.c @@ -19,6 +19,8 @@ #include "common.h" #include "font.h" +extern u32 BootBIOS; + #ifndef _WIN32_WCE #include @@ -986,6 +988,8 @@ s32 load_config_file() gamepad_config_map[PLAT_MENU_BUTTON] = BUTTON_ID_MENU; }*/ #endif + BootBIOS = file_options[FILE_OPTION_COUNT-1]; + file_close(config_file); } @@ -1060,6 +1064,8 @@ s32 save_config_file() } #endif + file_options[FILE_OPTION_COUNT-1] = BootBIOS; + file_write_array(config_file, file_options); file_close(config_file); @@ -1259,6 +1265,12 @@ u32 menu(u16 *original_screen) menu_update_clock(); } } + + void menu_bios() + { + if (BootBIOS == 1) BootBIOS = 0; + else BootBIOS = 1; + } void menu_restart() { @@ -1682,8 +1694,13 @@ u32 menu(u16 *original_screen) "loaded.", 9), action_option(menu_exit, NULL, "Return to game", "Select to exit this menu and resume gameplay.", 10), + + numeric_selection_action_option(menu_bios, NULL, + "Boot to BIOS : ", &BootBIOS, 2, + "0 for no, 1 for YES", 11), + action_option(menu_quit, NULL, "Exit gpSP", - "Select to exit gpSP and return to the menu.", 12) + "Select to exit gpSP and return to the menu.", 13) }; make_menu(main, submenu_main, NULL); diff --git a/main.c b/main.c index 29a20a1f..c75ee760 100644 --- a/main.c +++ b/main.c @@ -19,6 +19,8 @@ #include "common.h" +u32 BootBIOS = 0; + #ifdef PSP_BUILD //PSP_MODULE_INFO("gpSP", 0x1000, 0, 6); @@ -328,7 +330,7 @@ int main(int argc, char *argv[]) set_gba_resolution(screen_scale); video_resolution_small(); - init_cpu(); + init_cpu(BootBIOS); init_memory(); } else @@ -353,7 +355,7 @@ int main(int argc, char *argv[]) set_gba_resolution(screen_scale); video_resolution_small(); - init_cpu(); + init_cpu(BootBIOS); init_memory(); } } @@ -908,7 +910,7 @@ void reset_gba() { init_main(); init_memory(); - init_cpu(); + init_cpu(BootBIOS); reset_sound(); } diff --git a/x86/Makefile b/x86/Makefile index e2868b6a..498a405b 100644 --- a/x86/Makefile +++ b/x86/Makefile @@ -9,15 +9,15 @@ AS = as PREFIX = /usr OBJS = main.o cpu.o memory.o video.o input.o sound.o \ - cpu_threaded.o gui.o x86_stub.o cheats.o zip.o sha1.o + cpu_threaded.o gui.o x86_stub.o cheats.o zip.o sha1.o imageio.o BIN ?= gpsp # Platform specific definitions VPATH += .. -CFLAGS += -DPC_BUILD -Wall -m32 +CFLAGS += -DPC_BUILD -Wall -m32 -O0 -g INCLUDES = `sdl-config --cflags` -LIBS = `sdl-config --libs` -lz -m32 +LIBS = `sdl-config --libs` -lz -m32 -lpng # Compilation: