summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorTwinaphex2014-12-09 13:28:17 +0100
committerTwinaphex2014-12-09 13:28:17 +0100
commit988c2e2655c7c1f724ba727f008d84e3faa6cd24 (patch)
treeda7bf131f33b9ae16d2a93a0a7615a3c0b9c7535 /main.c
parent7bb77f4fc090cadc23c3e05998ccebac7156e3cf (diff)
parente2d6ea9082a5ff977f834eda0bbb2362397422df (diff)
downloadpicogpsp-988c2e2655c7c1f724ba727f008d84e3faa6cd24.tar.gz
picogpsp-988c2e2655c7c1f724ba727f008d84e3faa6cd24.tar.bz2
picogpsp-988c2e2655c7c1f724ba727f008d84e3faa6cd24.zip
Merge pull request #2 from aliaspider/master
initial port of gpsp to libretro.
Diffstat (limited to 'main.c')
-rw-r--r--main.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/main.c b/main.c
index b09f472..f019d21 100644
--- a/main.c
+++ b/main.c
@@ -18,6 +18,7 @@
*/
#include "common.h"
+#include <ctype.h>
#ifdef PSP_BUILD
@@ -213,6 +214,7 @@ void init_main()
flush_translation_cache_bios();
}
+#ifndef __LIBRETRO__
int main(int argc, char *argv[])
{
char bios_filename[512];
@@ -383,6 +385,7 @@ int main(int argc, char *argv[])
#endif
return 0;
}
+#endif
void print_memory_stats(u32 *counter, u32 *region_stats, char *stats_str)
{
@@ -436,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)
{
@@ -511,8 +514,10 @@ void trigger_ext_event()
event_number++;
}
+#ifndef __LIBRETRO__
static u32 fps = 60;
static u32 frames_drawn = 60;
+#endif
u32 update_gba()
{
@@ -624,6 +629,12 @@ u32 update_gba()
flush_ram_count = 0;
#endif
+#ifdef __LIBRETRO__
+ switch_to_main_thread();
+
+ update_gbc_sound(cpu_ticks);
+ gbc_sound_update = 0;
+#else
if(update_input())
continue;
@@ -644,7 +655,7 @@ u32 update_gba()
if(update_backup_flag)
update_backup();
-
+#endif
process_cheats();
event_cycles++;
@@ -773,6 +784,8 @@ void synchronize()
*/
}
+#elif defined(__LIBRETRO__)
+
#else
u32 real_frame_count = 0;
@@ -870,6 +883,8 @@ void quit()
sound_exit();
+#ifndef __LIBRETRO__
+
#ifdef REGISTER_USAGE_ANALYZE
print_register_usage();
#endif
@@ -885,6 +900,8 @@ void quit()
exit(0);
#endif
+
+#endif
}
void reset_gba()
@@ -919,7 +936,7 @@ void get_ticks_us(u64 *tick_return)
#else
-u32 file_length(char *dummy, FILE *fp)
+u32 file_length(const char *dummy, FILE *fp)
{
u32 length;
@@ -930,7 +947,9 @@ u32 file_length(char *dummy, FILE *fp)
return length;
}
-#ifdef PC_BUILD
+#ifdef __LIBRETRO__
+
+#elif defined(PC_BUILD)
void delay_us(u32 us_count)
{