mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
core, structural cleanup, fixes and improvements for type issues #2
This commit is contained in:
parent
5ab80df952
commit
f821bb7011
64 changed files with 140 additions and 150 deletions
|
@ -96,10 +96,6 @@ int main(int argc, char *argv[])
|
|||
|
||||
emu_init();
|
||||
|
||||
#ifdef GPERF
|
||||
ProfilerStart("gperf.out");
|
||||
#endif
|
||||
|
||||
engineState = PGS_Menu;
|
||||
|
||||
if (argc > 1)
|
||||
|
@ -142,7 +138,13 @@ int main(int argc, char *argv[])
|
|||
/* vvv fallthrough */
|
||||
|
||||
case PGS_Running:
|
||||
#ifdef GPERF
|
||||
ProfilerStart("gperf.out");
|
||||
#endif
|
||||
emu_loop();
|
||||
#ifdef GPERF
|
||||
ProfilerStop();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case PGS_Quit:
|
||||
|
@ -155,9 +157,6 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
endloop:
|
||||
#ifdef GPERF
|
||||
ProfilerStop();
|
||||
#endif
|
||||
|
||||
emu_finish();
|
||||
plat_finish();
|
||||
|
|
|
@ -55,15 +55,15 @@ static unsigned short fname2color(const char *fname)
|
|||
return 0xffff;
|
||||
}
|
||||
|
||||
#include "../libpicofe/menu.c"
|
||||
#include <platform/libpicofe/menu.c>
|
||||
|
||||
static const char *men_dummy[] = { NULL };
|
||||
|
||||
/* platform specific options and handlers */
|
||||
#if defined(__GP2X__)
|
||||
#include "../gp2x/menu.c"
|
||||
#include <platform/gp2x/menu.c>
|
||||
#elif defined(PANDORA)
|
||||
#include "../pandora/menu.c"
|
||||
#include <platform/pandora/menu.c>
|
||||
#else
|
||||
#define MENU_OPTIONS_GFX
|
||||
#define MENU_OPTIONS_ADV
|
||||
|
@ -84,7 +84,7 @@ static void make_bg(int no_scale)
|
|||
|
||||
if (!no_scale && g_menuscreen_w / w >= 2 && g_menuscreen_h / h >= 2)
|
||||
{
|
||||
unsigned int t, *d = g_menubg_ptr;
|
||||
u32 t, *d = g_menubg_ptr;
|
||||
d += (g_menuscreen_h / 2 - h * 2 / 2)
|
||||
* g_menuscreen_w / 2;
|
||||
d += (g_menuscreen_w / 2 - w * 2 / 2) / 2;
|
||||
|
|
|
@ -33,7 +33,7 @@ static struct in_pdata in_sdl_platform_data = {
|
|||
static int yuv_ry[32], yuv_gy[32], yuv_by[32];
|
||||
static unsigned char yuv_u[32 * 2], yuv_v[32 * 2];
|
||||
static unsigned char yuv_y[256];
|
||||
static struct uyvy { unsigned int y:8; unsigned int vyu:24; } yuv_uyvy[65536];
|
||||
static struct uyvy { uint32_t y:8; uint32_t vyu:24; } yuv_uyvy[65536];
|
||||
|
||||
void bgr_to_uyvy_init(void)
|
||||
{
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
#include "kgsdk/Framework2D.h"
|
||||
#include "kgsdk/FrameworkAudio.h"
|
||||
#include "../common/emu.h"
|
||||
#include "../common/lprintf.h"
|
||||
#include "../common/arm_utils.h"
|
||||
#include "../common/config.h"
|
||||
#include "../libpicofe/lprintf.h"
|
||||
#include "emu.h"
|
||||
#include "menu.h"
|
||||
#include "giz.h"
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "kgsdk/Framework.h"
|
||||
#include "kgsdk/Framework2D.h"
|
||||
#include "giz.h"
|
||||
#include "version.h"
|
||||
#include "../common/version.h"
|
||||
|
||||
#define LOG_FILE "log.log"
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "../common/menu.h"
|
||||
#include "../common/emu.h"
|
||||
#include "../common/config.h"
|
||||
#include "version.h"
|
||||
#include "../common/version.h"
|
||||
|
||||
|
||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "../common/emu.h"
|
||||
#include "../common/readpng.h"
|
||||
#include "../common/input.h"
|
||||
#include "version.h"
|
||||
#include "../common/version.h"
|
||||
|
||||
#include <pico/pico_int.h>
|
||||
#include <pico/patch.h>
|
||||
|
@ -49,8 +49,6 @@ unsigned char *menu_screen = gfx_buffer; /* draw here and blit later, to avoid f
|
|||
void menu_darken_bg(void *dst, const void *src, int pixels, int darker);
|
||||
static void menu_prepare_bg(int use_game_bg);
|
||||
|
||||
static unsigned int inp_prev = 0;
|
||||
|
||||
void menu_draw_begin(int use_bgbuff)
|
||||
{
|
||||
if (use_bgbuff)
|
||||
|
@ -1457,14 +1455,14 @@ static void menu_loop_root(void)
|
|||
// warning: alignment
|
||||
void menu_darken_bg(void *dst, const void *src, int pixels, int darker)
|
||||
{
|
||||
unsigned int *dest = dst;
|
||||
const unsigned int *srce = src;
|
||||
u32 *dest = dst;
|
||||
const u32 *srce = src;
|
||||
pixels /= 2;
|
||||
if (darker)
|
||||
{
|
||||
while (pixels--)
|
||||
{
|
||||
unsigned int p = *srce++;
|
||||
u32 p = *srce++;
|
||||
*dest++ = ((p&0xf79ef79e)>>1) - ((p&0xc618c618)>>3);
|
||||
}
|
||||
}
|
||||
|
@ -1472,7 +1470,7 @@ void menu_darken_bg(void *dst, const void *src, int pixels, int darker)
|
|||
{
|
||||
while (pixels--)
|
||||
{
|
||||
unsigned int p = *srce++;
|
||||
u32 p = *srce++;
|
||||
*dest++ = (p&0xf79ef79e)>>1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
#include "../common/arm_utils.h"
|
||||
#include "../common/menu_pico.h"
|
||||
#include "../common/emu.h"
|
||||
#include "../../pico/pico_int.h"
|
||||
#include "../../pico/sound/ym2612.h"
|
||||
#include "../../pico/sound/mix.h"
|
||||
#include <pico/pico_int.h>
|
||||
#include <pico/sound/ym2612.h>
|
||||
#include <pico/sound/mix.h>
|
||||
#include "code940/940shared.h"
|
||||
#include "plat.h"
|
||||
#include "940ctl.h"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// (c) Copyright 2006-2007, Grazvydas "notaz" Ignotas
|
||||
|
||||
#include "940shared.h"
|
||||
#include "../../common/helix/pub/mp3dec.h"
|
||||
#include <platform/common/helix/pub/mp3dec.h>
|
||||
|
||||
static _940_data_t *shared_data = (_940_data_t *) 0x00100000;
|
||||
static _940_ctl_t *shared_ctl = (_940_ctl_t *) 0x00200000;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "../../../pico/sound/ym2612.h"
|
||||
#include <pico/sound/ym2612.h>
|
||||
|
||||
// max 16 jobs, lower num means higher prio
|
||||
enum _940_job_t {
|
||||
|
|
|
@ -14,7 +14,7 @@ CROSS ?= arm-linux-gnueabi-
|
|||
# settings
|
||||
#up = 1
|
||||
|
||||
CFLAGS += -O2 -Wall -mno-thumb-interwork -fstrict-aliasing -ffast-math
|
||||
CFLAGS += -O3 -Wall -mno-thumb-interwork -fstrict-aliasing -fno-stack-protector -fno-common -ffast-math
|
||||
CFLAGS += -I../../common/helix/pub -I../../.. -I. -D__GP2X__ -DARM
|
||||
CFLAGS += -mcpu=arm940t -mtune=arm940t -mabi=apcs-gnu -mfloat-abi=soft -mfpu=fpa
|
||||
LDFLAGS = -static -e code940 -Ttext 0x0 -L$(lgcc_path) -lgcc
|
||||
|
@ -66,9 +66,6 @@ code940.elf : $(OBJS940) $(LIBHELIX)
|
|||
@echo ">>>" $@
|
||||
$(GCC) $(CFLAGS) -Os -DEXTERNAL_YM2612 -c $< -o $@
|
||||
|
||||
mix.o : ../../../pico/sound/mix.s
|
||||
@echo ">>>" $@
|
||||
$(GCC) $(CFLAGS) -DEXTERNAL_YM2612 -c $< -o $@
|
||||
misc_arm.o : ../../../pico/misc_arm.s
|
||||
@echo ">>>" $@
|
||||
$(GCC) $(CFLAGS) -DEXTERNAL_YM2612 -c $< -o $@
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
//#include "emu.h"
|
||||
//#include "menu.h"
|
||||
#include "../asmutils.h"
|
||||
#include "../../helix/pub/mp3dec.h"
|
||||
#include <platform/common/helix/pub/mp3dec.h>
|
||||
|
||||
/* we will need some gp2x internals here */
|
||||
extern volatile unsigned short *gp2x_memregs; /* from minimal library rlyeh */
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#ifndef _WIN32
|
||||
#ifndef NO_MMAP
|
||||
#ifdef __SWITCH__
|
||||
#include "../switch/mman.h"
|
||||
#include "switch/mman.h"
|
||||
#else
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
@ -37,8 +37,9 @@
|
|||
#endif
|
||||
|
||||
#if defined(RENDER_GSKIT_PS2)
|
||||
#include <malloc.h>
|
||||
#include "libretro-common/include/libretro_gskit_ps2.h"
|
||||
#include "../ps2/asm.h"
|
||||
#include "ps2/asm.h"
|
||||
#endif
|
||||
|
||||
#ifdef _3DS
|
||||
|
|
|
@ -47,9 +47,9 @@ static void draw_cd_leds(void)
|
|||
|
||||
#define p(x) px[(x)*2 >> 2] = px[((x)*2 >> 2) + 1]
|
||||
// 16-bit modes
|
||||
unsigned int *px = (unsigned int *)((short *)g_screen_ptr + scr_offs);
|
||||
unsigned int col_g = (led_reg & 2) ? 0x06000600 : 0;
|
||||
unsigned int col_r = (led_reg & 1) ? 0xc000c000 : 0;
|
||||
uint32_t *px = (uint32_t *)((short *)g_screen_ptr + scr_offs);
|
||||
uint32_t col_g = (led_reg & 2) ? 0x06000600 : 0;
|
||||
uint32_t col_r = (led_reg & 1) ? 0xc000c000 : 0;
|
||||
p(pitch*0) = p(pitch*1) = p(pitch*2) = col_g;
|
||||
p(pitch*0 + led_offs) = p(pitch*1 + led_offs) = p(pitch*2 + led_offs) = col_r;
|
||||
#undef p
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "../libpicofe/input.h"
|
||||
#include "../common/emu.h"
|
||||
#include "../common/input_pico.h"
|
||||
#include "version.h"
|
||||
#include "../common/version.h"
|
||||
|
||||
#include "log_io.h"
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "asm_utils.h"
|
||||
#include "../common/emu.h"
|
||||
#include "../common/config.h"
|
||||
#include "../common/lprintf.h"
|
||||
#include <pico/pico_int.h>
|
||||
#include <pico/cd/cue.h>
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "../common/menu.h"
|
||||
#include "../common/emu.h"
|
||||
#include "../common/config.h"
|
||||
#include "../common/lprintf.h"
|
||||
#include "../libpicofe/lprintf.h"
|
||||
|
||||
#ifdef GPROF
|
||||
#include <pspprof.h>
|
||||
|
|
|
@ -27,9 +27,8 @@
|
|||
#include "../common/menu.h"
|
||||
#include "../common/emu.h"
|
||||
#include "../common/readpng.h"
|
||||
#include "../common/lprintf.h"
|
||||
#include "../common/input.h"
|
||||
#include "version.h"
|
||||
#include "../common/version.h"
|
||||
|
||||
#include <pico/pico_int.h>
|
||||
#include <pico/patch.h>
|
||||
|
@ -51,8 +50,6 @@ void menu_darken_bg(void *dst, const void *src, int pixels, int darker);
|
|||
static void menu_prepare_bg(int use_game_bg, int use_fg);
|
||||
|
||||
|
||||
static unsigned int inp_prev = 0;
|
||||
|
||||
void menu_draw_begin(void)
|
||||
{
|
||||
// short *src = (short *)bg_buffer, *dst = (short *)menu_screen;
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
#include <pspaudiocodec.h>
|
||||
#include <kubridge.h>
|
||||
|
||||
#include "../../pico/pico_int.h"
|
||||
#include "../../pico/sound/mix.h"
|
||||
#include "../common/lprintf.h"
|
||||
#include <pico/pico_int.h>
|
||||
#include <pico/sound/mix.h>
|
||||
#include "../libpicofe/lprintf.h"
|
||||
|
||||
int mp3_last_error = 0;
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
|
||||
#include "psp.h"
|
||||
#include "emu.h"
|
||||
#include "../common/lprintf.h"
|
||||
#include "version.h"
|
||||
#include <pico/pico_int.h>
|
||||
#include "../common/version.h"
|
||||
|
||||
extern int pico_main(void);
|
||||
|
||||
|
|
|
@ -2,15 +2,14 @@
|
|||
#include <commdlg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "../../pico/pico.h"
|
||||
#include <pico/pico.h>
|
||||
#include "../common/readpng.h"
|
||||
#include "../common/config.h"
|
||||
#include "../common/lprintf.h"
|
||||
#include "../common/emu.h"
|
||||
#include "../common/menu.h"
|
||||
#include "../common/input.h"
|
||||
#include "../common/plat.h"
|
||||
#include "version.h"
|
||||
#include "../common/version.h"
|
||||
#include "direct.h"
|
||||
#include "in_vk.h"
|
||||
|
||||
|
|
|
@ -8,11 +8,10 @@
|
|||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "../common/lprintf.h"
|
||||
#include "../common/plat.h"
|
||||
#include "../common/emu.h"
|
||||
#include "../../pico/pico.h"
|
||||
#include "version.h"
|
||||
#include "../common/version.h"
|
||||
#include <pico/pico.h>
|
||||
#include "direct.h"
|
||||
#include "dsnd.h"
|
||||
#include "main.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue