X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=platform%2Flinux%2Fgp2x.c;h=ca915bc133915a1e0dd3e889716caf3771fd3868;hb=0d9bf4fcda2bf375a1fabd4a42e244701b8a185f;hp=4c11d2b1dab8235ef41da6ebcd9332275d3d4e86;hpb=e096cf887b91638bb4f0f663d3b3e260c90ac771;p=picodrive.git diff --git a/platform/linux/gp2x.c b/platform/linux/gp2x.c index 4c11d2b..ca915bc 100644 --- a/platform/linux/gp2x.c +++ b/platform/linux/gp2x.c @@ -1,4 +1,4 @@ -/* faking/emulating gp2x.c by using gtk */ +/* faking/emulating gp2x by using gtk */ #include #include #include @@ -13,7 +13,7 @@ #include #include "../gp2x/emu.h" -#include "../gp2x/gp2x.h" +//#include "../gp2x/gp2x.h" #include "../gp2x/version.h" #include "../common/emu.h" #include "sndout_oss.h" @@ -27,7 +27,6 @@ static const char *verstring = "PicoDrive " VERSION; static int scr_changed = 0, scr_w = SCREEN_WIDTH, scr_h = SCREEN_HEIGHT; // dummies -char *ext_menu = 0, *ext_state = 0; int mix_32_to_16l_level; /* gtk */ @@ -48,6 +47,12 @@ static void destroy (GtkWidget *widget, gpointer data) gtk_main_quit (); } +/* faking GP2X pad */ +enum { GP2X_UP=0x1, GP2X_LEFT=0x4, GP2X_DOWN=0x10, GP2X_RIGHT=0x40, + GP2X_START=1<<8, GP2X_SELECT=1<<9, GP2X_L=1<<10, GP2X_R=1<<11, + GP2X_A=1<<12, GP2X_B=1<<13, GP2X_X=1<<14, GP2X_Y=1<<15, + GP2X_VOL_UP=1<<23, GP2X_VOL_DOWN=1<<22, GP2X_PUSH=1<<27 }; + static gint key_press_event (GtkWidget *widget, GdkEventKey *event) { switch (event->hardware_keycode) @@ -205,7 +210,7 @@ static void realloc_screen(void) scr_changed = 0; } -void gp2x_init(void) +void plat_init(void) { printf("entering init()\n"); fflush(stdout); @@ -220,7 +225,7 @@ void gp2x_init(void) printf("exitting init()\n"); fflush(stdout); } -void gp2x_deinit(void) +void plat_finish(void) { free(g_screen_ptr); sndout_oss_exit(); @@ -303,42 +308,16 @@ void gp2x_video_setpalette(int *pal, int len) memcpy(current_pal, pal, len*4); } -void gp2x_video_flush_cache(void) -{ -} - void gp2x_video_RGB_setscaling(int v_offs, int W, int H) { } -void gp2x_memcpy_buffers(int buffers, void *data, int offset, int len) -{ - if ((char *)g_screen_ptr + offset != data) - memcpy((char *)g_screen_ptr + offset, data, len); -} - -void gp2x_memcpy_all_buffers(void *data, int offset, int len) -{ - memcpy((char *)g_screen_ptr + offset, data, len); -} - - void gp2x_memset_all_buffers(int offset, int byte, int len) { memset((char *)g_screen_ptr + offset, byte, len); } -void gp2x_pd_clone_buffer2(void) -{ - memset(g_screen_ptr, 0, g_screen_width * g_screen_height * 2); -} - /* joy */ -unsigned long gp2x_joystick_read(int allow_usb_joy) -{ - return current_keys; -} - int gp2x_touchpad_read(int *x, int *y) { return -1; @@ -346,28 +325,11 @@ int gp2x_touchpad_read(int *x, int *y) /* 940 */ int crashed_940 = 0; -void Pause940(int yes) +void pause940(int yes) { } -void Reset940(int yes, int bank) -{ -} - -/* faking gp2x cpuctrl.c */ -void cpuctrl_init(void) -{ -} - -void cpuctrl_deinit(void) -{ -} - -void set_FCLK(unsigned MHZ) -{ -} - -void Disable_940(void) +void reset940(int yes, int bank) { } @@ -375,35 +337,18 @@ void gp2x_video_wait_vsync(void) { } -void set_RAM_Timings(int tRC, int tRAS, int tWR, int tMRD, int tRFC, int tRP, int tRCD) -{ -} - void set_gamma(int g100, int A_SNs_curve) { } -void set_LCD_custom_rate(int rate) +void set_lcd_custom_rate(int rate) { } -void unset_LCD_custom_rate(void) +void unset_lcd_custom_rate(void) { } -/* squidgehack.c */ -int mmuhack(void) -{ - return 0; -} - - -int mmuunhack(void) -{ - return 0; -} - - /* misc */ void spend_cycles(int c) {