diff options
-rw-r--r-- | Makefile | 12 | ||||
-rw-r--r-- | cpu.c | 2 | ||||
-rw-r--r-- | gui.c | 6 | ||||
-rw-r--r-- | libretro.c | 14 | ||||
-rw-r--r-- | main.c | 2 | ||||
-rw-r--r-- | memory.c | 6 | ||||
-rw-r--r-- | memory.h | 4 | ||||
-rw-r--r-- | sound.c | 2 |
8 files changed, 31 insertions, 17 deletions
@@ -1,10 +1,10 @@ -TARGET := gpsp_libretro.so +TARGET := gpsp_libretro CC = gcc AR = psp-ar STATIC_LINKING = 0 -CFLAGS += -fPIC -Werror-implicit-function-declaration +CFLAGS += -Werror-implicit-function-declaration CFLAGS += -DPC_BUILD -Wall -m32 CFLAGS += -D__LIBRETRO__ @@ -33,14 +33,18 @@ OBJS += zip.o OBJS += libretro.o OBJS += libco/libco.o - +ifeq ($(STATIC_LINKING), 1) +TARGET := $(TARGET).a +else +TARGET := $(TARGET).so +CFLAGS += -fPIC +endif ASFLAGS = $(CFLAGS) INCDIRS := -I. LDFLAGS += -shared -m32 -Wl,--no-undefined -Wl,--version-script=link.T LDLIBS += -lz - all: $(TARGET) $(TARGET): $(OBJS) @@ -4274,7 +4274,7 @@ void function_cc step_debug(u32 pc, u32 cycles) u16 *current_screen = copy_screen(); get_savestate_filename_noshot(savestate_slot, current_savestate_filename); - save_state(current_savestate_filename, current_screen); + gba_save_state(current_savestate_filename, current_screen); free(current_screen); break; } @@ -1150,7 +1150,7 @@ u32 menu(u16 *original_screen) { get_savestate_filename_noshot(savestate_slot, current_savestate_filename); - save_state(current_savestate_filename, original_screen); + gba_save_state(current_savestate_filename, original_screen); } menu_change_state(); } @@ -1159,7 +1159,7 @@ u32 menu(u16 *original_screen) { if(!first_load) { - load_state(current_savestate_filename); + gba_load_state(current_savestate_filename); return_value = 1; repeat = 0; } @@ -1171,7 +1171,7 @@ u32 menu(u16 *original_screen) char load_filename[512]; if(load_file(file_ext, load_filename) != -1) { - load_state(load_filename); + gba_load_state(load_filename); return_value = 1; repeat = 0; } @@ -227,17 +227,25 @@ bool retro_load_game(const struct retro_game_info *info) // strncat(dir_save, "/",sizeof(dir_save)); - strncat(main_path, "/",sizeof(main_path)); +// strncat(main_path, "/",sizeof(main_path)); - if (load_bios(filename_bios) < 0) + if (load_bios(filename_bios) != 0) { error_msg("Could not load BIOS image file.\n"); return false; } + if(bios_rom[0] != 0x18) + { + info_msg("You have an incorrect BIOS image.\n"); + info_msg("While many games will work fine, some will not. It\n"); + info_msg("is strongly recommended that you obtain the\n"); + info_msg("correct BIOS file.\n"); + } + gamepak_filename[0] = 0; - if (load_gamepak(info->path) < 0) + if (load_gamepak(info->path) != 0) { error_msg("Could not load the game file.\n"); return false; @@ -439,7 +439,7 @@ void trigger_ext_event() get_savestate_filename_noshot(savestate_slot, current_savestate_filename); - load_state(current_savestate_filename); + gba_load_state(current_savestate_filename); switch(event_number) { @@ -3160,7 +3160,7 @@ void bios_region_read_protect() sound_##type##_savestate(savestate_file); \ video_##type##_savestate(savestate_file) \ -void load_state(char *savestate_filename) +void gba_load_state(char *savestate_filename) { file_open(savestate_file, savestate_filename, read); if(file_check_valid(savestate_file)) @@ -3196,7 +3196,7 @@ void load_state(char *savestate_filename) { reset_gba(); // Okay, so this takes a while, but for now it works. - load_state(savestate_filename); + gba_load_state(savestate_filename); } else { @@ -3229,7 +3229,7 @@ void load_state(char *savestate_filename) u8 savestate_write_buffer[506947]; u8 *write_mem_ptr; -void save_state(char *savestate_filename, u16 *screen_capture) +void gba_save_state(char *savestate_filename, u16 *screen_capture) { write_mem_ptr = savestate_write_buffer; file_open(savestate_file, savestate_filename, write); @@ -188,8 +188,8 @@ void bios_region_read_protect(); u8 *load_gamepak_page(u32 physical_index); void memory_write_mem_savestate(file_tag_type savestate_file); void memory_read_savestate(file_tag_type savestate_file); -void load_state(char *savestate_filename); -void save_state(char *savestate_filename, u16 *screen_capture); +void gba_load_state(char *savestate_filename); +void gba_save_state(char *savestate_filename, u16 *screen_capture); extern u8 *gamepak_rom; extern u32 gamepak_ram_buffer_size; @@ -852,6 +852,8 @@ void render_audio(void) u32 i; s32 current_sample; + return; + while (((gbc_sound_buffer_index - sound_buffer_base) % BUFFER_SIZE) > 512) { sound_copy(sound_buffer_base, 512, normal); audio_batch_cb(stream_base, 256); |