#include <pico/pico_int.h>\r
#include <pico/patch.h>\r
\r
+#if defined(__GNUC__) && __GNUC__ >= 7\r
+#pragma GCC diagnostic ignored "-Wformat-truncation"\r
+#endif\r
+\r
#ifndef _WIN32\r
#define PATH_SEP "/"\r
#define PATH_SEP_C '/'\r
\r
int g_screen_width = 320;\r
int g_screen_height = 240;\r
+int g_screen_ppitch = 320; // pitch in pixels\r
\r
const char *PicoConfigFile = "config2.cfg";\r
currentConfig_t currentConfig, defaultConfig;\r
{\r
memcpy(¤tConfig, &defaultConfig, sizeof(currentConfig));\r
PicoIn.opt = currentConfig.s_PicoOpt;\r
- PsndRate = currentConfig.s_PsndRate;\r
+ PicoIn.sndRate = currentConfig.s_PsndRate;\r
PicoIn.regionOverride = currentConfig.s_PicoRegion;\r
PicoIn.autoRgnOrder = currentConfig.s_PicoAutoRgnOrder;\r
}\r
}\r
\r
pemu_validate_config();\r
+ PicoIn.overclockM68k = currentConfig.overclock_68k;\r
\r
// some sanity checks\r
#ifdef PSP\r
} \\r
}\r
\r
-mk_text_out(emu_text_out8, unsigned char, 0xf0, g_screen_ptr, 1, g_screen_width)\r
-mk_text_out(emu_text_out16, unsigned short, 0xffff, g_screen_ptr, 1, g_screen_width)\r
+mk_text_out(emu_text_out8, unsigned char, 0xf0, g_screen_ptr, 1, g_screen_ppitch)\r
+mk_text_out(emu_text_out16, unsigned short, 0xffff, g_screen_ptr, 1, g_screen_ppitch)\r
mk_text_out(emu_text_out8_rot, unsigned char, 0xf0,\r
- (char *)g_screen_ptr + (g_screen_width - 1) * g_screen_height, -g_screen_height, 1)\r
+ (char *)g_screen_ptr + (g_screen_ppitch - 1) * g_screen_height, -g_screen_height, 1)\r
mk_text_out(emu_text_out16_rot, unsigned short, 0xffff,\r
- (short *)g_screen_ptr + (g_screen_width - 1) * g_screen_height, -g_screen_height, 1)\r
+ (short *)g_screen_ptr + (g_screen_ppitch - 1) * g_screen_height, -g_screen_height, 1)\r
\r
#undef mk_text_out\r
\r
for (h = 0; h < 8; h++) {\r
unsigned short *p;\r
p = (unsigned short *)g_screen_ptr\r
- + x + g_screen_width * (y + h);\r
+ + x + g_screen_ppitch * (y + h);\r
for (i = len; i > 0; i--, p++)\r
*p = (*p >> 2) & 0x39e7;\r
}\r
static int set_Frameskip, set_EmuOpt, is_on = 0;\r
\r
if (set_on && !is_on) {\r
- set_PsndOut = PsndOut;\r
+ set_PsndOut = PicoIn.sndOut;\r
set_Frameskip = currentConfig.Frameskip;\r
set_EmuOpt = currentConfig.EmuOpt;\r
- PsndOut = NULL;\r
+ PicoIn.sndOut = NULL;\r
currentConfig.Frameskip = 8;\r
currentConfig.EmuOpt &= ~4;\r
currentConfig.EmuOpt |= 0x40000;\r
emu_status_msg("FAST FORWARD");\r
}\r
else if (!set_on && is_on) {\r
- PsndOut = set_PsndOut;\r
+ PicoIn.sndOut = set_PsndOut;\r
currentConfig.Frameskip = set_Frameskip;\r
currentConfig.EmuOpt = set_EmuOpt;\r
PsndRerate(1);\r
void emu_cmn_forced_frame(int no_scale, int do_emu)\r
{\r
int po_old = PicoIn.opt;\r
+ int y;\r
\r
- memset32(g_screen_ptr, 0, g_screen_width * g_screen_height * 2 / 4);\r
+ for (y = 0; y < g_screen_height; y++)\r
+ memset32((short *)g_screen_ptr + g_screen_ppitch * y, 0,\r
+ g_screen_width * 2 / 4);\r
\r
PicoIn.opt &= ~POPT_ALT_RENDERER;\r
PicoIn.opt |= POPT_ACC_SPRITES;\r
config_readlrom(path);\r
\r
PicoInit();\r
- PicoMessage = plat_status_msg_busy_next;\r
- PicoMCDopenTray = emu_tray_open;\r
- PicoMCDcloseTray = emu_tray_close;\r
+ PicoIn.osdMessage = plat_status_msg_busy_next;\r
+ PicoIn.mcdTrayOpen = emu_tray_open;\r
+ PicoIn.mcdTrayClose = emu_tray_close;\r
\r
sndout_init();\r
}\r
\r
static void snd_write_nonblocking(int len)\r
{\r
- sndout_write_nb(PsndOut, len);\r
+ sndout_write_nb(PicoIn.sndOut, len);\r
}\r
\r
void emu_sound_start(void)\r
{\r
- PsndOut = NULL;\r
+ PicoIn.sndOut = NULL;\r
\r
if (currentConfig.EmuOpt & EOPT_EN_SOUND)\r
{\r
PsndRerate(Pico.m.frame_count ? 1 : 0);\r
\r
printf("starting audio: %i len: %i stereo: %i, pal: %i\n",\r
- PsndRate, PsndLen, is_stereo, Pico.m.pal);\r
- sndout_start(PsndRate, is_stereo);\r
- PicoWriteSound = snd_write_nonblocking;\r
+ PicoIn.sndRate, Pico.snd.len, is_stereo, Pico.m.pal);\r
+ sndout_start(PicoIn.sndRate, is_stereo);\r
+ PicoIn.writeSound = snd_write_nonblocking;\r
plat_update_volume(0, 0);\r
memset(sndBuffer, 0, sizeof(sndBuffer));\r
- PsndOut = sndBuffer;\r
+ PicoIn.sndOut = sndBuffer;\r
}\r
}\r
\r