// squidgehack, no_save_cfg_on_exit, <unused>, 16_bit_mode
// craigix_ram, confirm_save, show_cd_leds, confirm_load
// A_SNs_gamma, perfect_vsync, giz_scanlines, giz_dblbuff
+ // vsync_mode
int PicoOpt; // used for config saving only, see Pico.h
int PsndRate; // ditto
int PicoRegion; // ditto
MA_OPT3_PRES_NOSCALE,
MA_OPT3_PRES_FULLSCR,
MA_OPT3_FILTERING,
+ MA_OPT3_VSYNC,
MA_OPT3_DONE,
MA_CDOPT_TESTBIOS_USA,
MA_CDOPT_TESTBIOS_EUR,
use_cyclone = 1\r
endif\r
\r
-DEFINC = -I../.. -I. -DARM -D__GP2X__ -D_UNZIP_SUPPORT # -DBENCHMARK\r
+DEFINC = -I../.. -I. -DARM -D__GP2X__ # -DBENCHMARK\r
COPT_COMMON = -static -Wall -Winline\r
ifeq ($(DEBUG),)\r
COPT_COMMON += -O2 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math\r
text_out16(tl_x, 20, "PicoDrive v" VERSION " (c) notaz, 2006,2007");\r
y = tl_y;\r
text_out16(tl_x, y, "Credits:");\r
- text_out16(tl_x, (y+=10), "Dave: Cyclone 68000 core,");\r
+ text_out16(tl_x, (y+=10), "fDave: Cyclone 68000 core,");\r
text_out16(tl_x, (y+=10), " base code of PicoDrive");\r
text_out16(tl_x, (y+=10), "Reesy & FluBBa: DrZ80 core");\r
text_out16(tl_x, (y+=10), "MAME devs: YM2612 and SN76496 cores");\r
#up = 1\r
\r
\r
-CFLAGS += -I../.. -I. -D_UNZIP_SUPPORT -DNO_SYNC -D_ASM_DRAW_C_MIPS # -DBENCHMARK\r
+CFLAGS += -I../.. -I. -DNO_SYNC\r
CFLAGS += -Wall -Winline -G0\r
ifeq ($(DEBUG),)\r
CFLAGS += -O2 -ftracer -fstrength-reduce -ffast-math\r
else\r
OBJS += ../../Pico/Area.o ../../Pico/Cart.o ../../Pico/Memory.o ../../Pico/Misc.o \\r
../../Pico/Pico.o ../../Pico/Sek.o ../../Pico/VideoPort.o ../../Pico/Draw2.o ../../Pico/Draw.o \\r
- ../../Pico/Patch.o ../../Pico/Draw_amips.o\r
+ ../../Pico/Patch.o ../../Pico/Draw_amips.o ../../Pico/Memory_amips.o\r
# Pico - CD\r
OBJS += ../../Pico/cd/Pico.o ../../Pico/cd/Memory.o ../../Pico/cd/Sek.o ../../Pico/cd/LC89510.o \\r
../../Pico/cd/cd_sys.o ../../Pico/cd/cd_file.o ../../Pico/cd/gfx_cd.o \\r
TARGET = PicoDrive\r
EXTRA_TARGETS = EBOOT.PBP\r
PSP_EBOOT_TITLE = PICODRIVE\r
-#PSP_EBOOT_ICON = .png\r
+PSP_EBOOT_ICON = data/icon.png\r
#PSP_EBOOT_PIC1 = .png\r
\r
CUSTOM_CLEAN = myclean\r
../../cpu/musashi/m68kops.c :\r
make -C ../../cpu/musashi\r
\r
+../../cpu/fame/famec.o : ../../cpu/fame/famec.c\r
+ @echo ">>>" $<\r
+ $(CC) $(CFLAGS) -Wno-unused -c $< -o $@\r
+\r
+../../Pico/Memory.o : ../../Pico/Memory.c\r
+ @echo ">>>" $<\r
+ $(CC) $(CFLAGS) -c $< -o $@ -D_ASM_MEMORY_C -D_ASM_MEMORY_C_AMIPS\r
+\r
+../../Pico/Draw.o : ../../Pico/Draw.c\r
+ @echo ">>>" $<\r
+ $(CC) $(CFLAGS) -c $< -o $@ -D_ASM_DRAW_C_MIPS\r
+\r
readme.txt: ../../tools/textfilter ../base_readme.txt\r
../../tools/textfilter ../base_readme.txt $@ PSP\r
\r
../../tools/textfilter: ../../tools/textfilter.c\r
make -C ../../tools/ textfilter\r
\r
-../../cpu/fame/famec.o : ../../cpu/fame/famec.c\r
- @echo ">>>" $<\r
- $(CC) $(CFLAGS) -Wno-unused -c $< -o $@\r
-\r
data/bg32.o: data/bg32.bin\r
bin2o -i $< $@ bgdatac32\r
\r
#include "../common/lprintf.h"
#include "../../Pico/PicoInt.h"
-#define OSD_FPS_X 420
+#define OSD_FPS_X 424
// additional pspaudio imports, credits to crazyc
int sceAudio_38553111(unsigned short samples, unsigned short freq, char unknown); // play with conversion?
static void sound_init(void);
static void sound_deinit(void);
-static void blit2(const char *fps, const char *notice);
+static void blit2(const char *fps, const char *notice, int lagging_behind);
static void clearArea(int full);
void emu_noticeMsgUpdated(void)
currentConfig.PicoAutoRgnOrder = 0x184; // US, EU, JP
currentConfig.Frameskip = -1; // auto
currentConfig.volume = 50;
- currentConfig.CPUclock = 222;
+ currentConfig.CPUclock = 333;
currentConfig.KeyBinds[ 4] = 1<<0; // SACB RLDU
currentConfig.KeyBinds[ 6] = 1<<1;
currentConfig.KeyBinds[ 7] = 1<<2;
p = (unsigned int *)((short *)psp_screen + 512*2+4+2);
col_g = (old_reg & 2) ? 0x06000600 : 0;
- col_r = (old_reg & 1) ? 0xc000c000 : 0;
+ col_r = (old_reg & 1) ? 0x00180018 : 0;
*p++ = col_g; *p++ = col_g; p+=2; *p++ = col_r; *p++ = col_r; p += 512/2 - 12/2;
*p++ = col_g; *p++ = col_g; p+=2; *p++ = col_r; *p++ = col_r; p += 512/2 - 12/2;
*p++ = col_g; *p++ = col_g; p+=2; *p++ = col_r; *p++ = col_r;
}
-static void blit2(const char *fps, const char *notice)
+static void blit2(const char *fps, const char *notice, int lagging_behind)
{
- int emu_opt = currentConfig.EmuOpt;
-
- sceGuSync(0,0);
+ int vsync = 0, emu_opt = currentConfig.EmuOpt;
if (notice || (emu_opt & 2)) {
if (notice) osd_text(4, notice, 0);
if ((emu_opt & 0x400) && (PicoMCD & 1))
cd_leds();
- psp_video_flip(0);
+ if (currentConfig.EmuOpt & 0x2000) { // want vsync
+ if (!(currentConfig.EmuOpt & 0x10000) || !lagging_behind) vsync = 1;
+ }
+
+ psp_video_flip(vsync);
}
// clears whole screen or just the notice area (in all buffers)
(!(which & 0x1000) && (currentConfig.EmuOpt & 0x200))) ) // save
{
int keys;
- blit2("", (which & 0x1000) ? "LOAD STATE? (X=yes, O=no)" : "OVERWRITE SAVE? (X=yes, O=no)");
+ sceGuSync(0,0);
+ blit2("", (which & 0x1000) ? "LOAD STATE? (X=yes, O=no)" : "OVERWRITE SAVE? (X=yes, O=no)", 0);
while( !((keys = psp_pad_read(1)) & (BTN_X|BTN_CIRCLE)) )
psp_msleep(50);
if (keys & BTN_CIRCLE) do_it = 0;
PicoFrame();
- blit2(fpsbuff, notice);
+ sceGuSync(0,0);
// check time
tval = sceKernelGetSystemTimeLow();
tval_diff = (int)(tval - tval_thissec) << 8;
+ blit2(fpsbuff, notice, tval_diff > lim_time);
+
if (currentConfig.Frameskip < 0 && tval_diff - lim_time >= (300000<<8)) // slowdown detection
reset_timing = 1;
else if (PsndOut != NULL || currentConfig.Frameskip < 0)
{ NULL, MB_NONE, MA_OPT3_HSCALE32, NULL, 0, 0, 0, 1 },
{ NULL, MB_NONE, MA_OPT3_HSCALE40, NULL, 0, 0, 0, 1 },
{ NULL, MB_ONOFF, MA_OPT3_FILTERING, ¤tConfig.scaling, 1, 0, 0, 1 },
+ { NULL, MB_NONE, MA_OPT3_VSYNC, NULL, 0, 0, 0, 1 },
{ "Set to unscaled centered", MB_NONE, MA_OPT3_PRES_NOSCALE, NULL, 0, 0, 0, 1 },
{ "Set to fullscreen", MB_NONE, MA_OPT3_PRES_FULLSCR, NULL, 0, 0, 0, 1 },
{ "done", MB_NONE, MA_OPT3_DONE, NULL, 0, 0, 0, 1 },
case MA_OPT3_FILTERING:
text_out16(x, y, "Bilinear filtering %s", currentConfig.scaling?"ON":"OFF");
break;
+ case MA_OPT3_VSYNC: {
+ char *val = " never";
+ if (currentConfig.EmuOpt & 0x2000)
+ val = (currentConfig.EmuOpt & 0x10000) ? "sometimes" : " always";
+ text_out16(x, y, "Wait for vsync %s", val);
+ break;
+ }
default: break;
}
}
static void draw_dispmenu_options(int menu_sel)
{
- int tl_x = 80+25, tl_y = 16+50;
+ int tl_x = 80, tl_y = 16+50;
menu_draw_begin();
- menu_draw_selection(tl_x - 16, tl_y + menu_sel*10, 252);
+ menu_draw_selection(tl_x - 16, tl_y + menu_sel*10, 316);
me_draw(opt3_entries, OPT3_ENTRY_COUNT, tl_x, tl_y, menu_opt3_cust_draw, NULL);
menu_sel_max = me_count_enabled(opt3_entries, OPT3_ENTRY_COUNT) - 1;
- for(;;)
+ for (;;)
{
draw_dispmenu_options(menu_sel);
inp = wait_for_input(BTN_UP|BTN_DOWN|BTN_LEFT|BTN_RIGHT|BTN_X|BTN_CIRCLE);
if (inp & (BTN_LEFT|BTN_RIGHT)) // multi choise
{
float *setting = NULL;
+ int tmp;
me_process(opt3_entries, OPT3_ENTRY_COUNT, selected_id, (inp&BTN_RIGHT) ? 1 : 0);
switch (selected_id) {
case MA_OPT3_SCALE: setting = ¤tConfig.scale; break;
case MA_OPT3_HSCALE40: setting = ¤tConfig.hscale40; is_32col = 0; break;
case MA_OPT3_HSCALE32: setting = ¤tConfig.hscale32; is_32col = 1; break;
case MA_OPT3_FILTERING:menu_opt3_preview(is_32col); break;
+ case MA_OPT3_VSYNC: tmp = ((currentConfig.EmuOpt>>13)&1) | ((currentConfig.EmuOpt>>15)&2);
+ tmp = (inp & BTN_LEFT) ? (tmp>>1) : ((tmp<<1)|1);
+ if (tmp > 3) tmp = 3;
+ currentConfig.EmuOpt &= ~0x12000;
+ currentConfig.EmuOpt |= ((tmp&2)<<15) | ((tmp&1)<<13);
+ break;
default: break;
}
if (setting != NULL) {
y = tl_y;
text_out16(tl_x, y, "Credits:");
- text_out16(tl_x, (y+=10), "Dave: base code of PicoDrive");
+ text_out16(tl_x, (y+=10), "fDave: base code of PicoDrive");
+ text_out16(tl_x, (y+=10), "Chui: Fame/C");
+ text_out16(tl_x, (y+=10), "NJ: CZ80");
text_out16(tl_x, (y+=10), "MAME devs: YM2612 and SN76496 cores");
- text_out16(tl_x, (y+=10), "Charles MacDonald: Genesis hw docs");
text_out16(tl_x, (y+=10), "Stephane Dallongeville:");
- text_out16(tl_x, (y+=10), " opensource Gens");
+ text_out16(tl_x, (y+=10), " Gens code, base of Fame/C, CZ80");
+ text_out16(tl_x, (y+=10), "Charles MacDonald: Genesis hw docs");
text_out16(tl_x, (y+=10), "Haze: Genesis hw info");
+ text_out16(tl_x, (y+=10), "ps2dev.org people: PSP SDK/code");
text_out16(tl_x, (y+=10), "ketchupgun: skin design");
menu_draw_end();