mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-05 14:57:46 -04:00
FAME + some random stuff added
git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@276 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
703e4c7bbb
commit
2b90fc61e0
8 changed files with 71 additions and 8 deletions
|
@ -2,7 +2,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define lprintf printf
|
#define lprintf printf
|
||||||
#elif defined(PSP)
|
#elif defined(PSP)
|
||||||
#if 0
|
#if 1
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define lprintf printf
|
#define lprintf printf
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
|
|
||||||
# settings
|
# settings
|
||||||
dprint = 1
|
use_fame = 1
|
||||||
|
|
||||||
# profile = 1
|
# profile = 1
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,8 +47,13 @@ OBJS += ../../zlib/gzio.o ../../zlib/inffast.o ../../zlib/inflate.o ../../zlib/i
|
||||||
# unzip
|
# unzip
|
||||||
OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o
|
OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o
|
||||||
# CPU cores
|
# CPU cores
|
||||||
|
ifeq "$(use_fame)" "1"
|
||||||
|
DEFINC += -DEMU_F68K
|
||||||
|
OBJS += ../../cpu/fame/famec.o
|
||||||
|
else
|
||||||
DEFINC += -DEMU_M68K
|
DEFINC += -DEMU_M68K
|
||||||
OBJS += ../../cpu/musashi/m68kops.o ../../cpu/musashi/m68kcpu.o
|
OBJS += ../../cpu/musashi/m68kops.o ../../cpu/musashi/m68kcpu.o
|
||||||
|
endif
|
||||||
# mz80
|
# mz80
|
||||||
DEFINC += -D_USE_MZ80
|
DEFINC += -D_USE_MZ80
|
||||||
OBJS += ../../cpu/mz80/mz80.o
|
OBJS += ../../cpu/mz80/mz80.o
|
||||||
|
@ -95,3 +101,7 @@ PicoDrive : $(OBJS) ../common/helix/helix_mp3_x86.a
|
||||||
@echo $@
|
@echo $@
|
||||||
@$(GCC) $(COPT_COMMON) $(DEFINC) -c $< -o $@ # -mtune=arm940t -DEXTERNAL_YM2612
|
@$(GCC) $(COPT_COMMON) $(DEFINC) -c $< -o $@ # -mtune=arm940t -DEXTERNAL_YM2612
|
||||||
|
|
||||||
|
../../cpu/fame/famec.o : ../../cpu/fame/famec.c
|
||||||
|
@echo $<
|
||||||
|
@$(GCC) $(COPT) $(DEFINC) -Wno-unused -c $< -o $@
|
||||||
|
|
||||||
|
|
21
psp/Makefile
21
psp/Makefile
|
@ -3,7 +3,7 @@
|
||||||
PSPSDK = $(shell psp-config --pspsdk-path)
|
PSPSDK = $(shell psp-config --pspsdk-path)
|
||||||
|
|
||||||
# settings
|
# settings
|
||||||
use_musashi = 1
|
#use_musashi = 1
|
||||||
use_mz80 = 1
|
use_mz80 = 1
|
||||||
amalgamate = 0
|
amalgamate = 0
|
||||||
#profile = 1
|
#profile = 1
|
||||||
|
@ -13,7 +13,7 @@ amalgamate = 0
|
||||||
CFLAGS += -I../.. -I. -D_UNZIP_SUPPORT -DNO_SYNC # -DBENCHMARK
|
CFLAGS += -I../.. -I. -D_UNZIP_SUPPORT -DNO_SYNC # -DBENCHMARK
|
||||||
CFLAGS += -Wall -Winline
|
CFLAGS += -Wall -Winline
|
||||||
ifeq ($(DEBUG),)
|
ifeq ($(DEBUG),)
|
||||||
CFLAGS += -O2 -G0 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math
|
CFLAGS += -O2 -G0 -ftracer -fstrength-reduce -ffast-math
|
||||||
else
|
else
|
||||||
CFLAGS += -ggdb
|
CFLAGS += -ggdb
|
||||||
endif
|
endif
|
||||||
|
@ -37,7 +37,7 @@ OBJS += ../../PicoAll.o
|
||||||
else
|
else
|
||||||
OBJS += ../../Pico/Area.o ../../Pico/Cart.o ../../Pico/Memory.o ../../Pico/Misc.o \
|
OBJS += ../../Pico/Area.o ../../Pico/Cart.o ../../Pico/Memory.o ../../Pico/Misc.o \
|
||||||
../../Pico/Pico.o ../../Pico/Sek.o ../../Pico/VideoPort.o ../../Pico/Draw2.o ../../Pico/Draw.o \
|
../../Pico/Pico.o ../../Pico/Sek.o ../../Pico/VideoPort.o ../../Pico/Draw2.o ../../Pico/Draw.o \
|
||||||
../../Pico/Patch.o
|
../../Pico/Patch.o ../../Pico/Draw_amips.o
|
||||||
# Pico - CD
|
# Pico - CD
|
||||||
OBJS += ../../Pico/cd/Pico.o ../../Pico/cd/Memory.o ../../Pico/cd/Sek.o ../../Pico/cd/LC89510.o \
|
OBJS += ../../Pico/cd/Pico.o ../../Pico/cd/Memory.o ../../Pico/cd/Sek.o ../../Pico/cd/LC89510.o \
|
||||||
../../Pico/cd/cd_sys.o ../../Pico/cd/cd_file.o ../../Pico/cd/gfx_cd.o \
|
../../Pico/cd/cd_sys.o ../../Pico/cd/cd_file.o ../../Pico/cd/gfx_cd.o \
|
||||||
|
@ -59,6 +59,9 @@ OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o
|
||||||
ifeq "$(use_musashi)" "1"
|
ifeq "$(use_musashi)" "1"
|
||||||
CFLAGS += -DEMU_M68K
|
CFLAGS += -DEMU_M68K
|
||||||
OBJS += ../../cpu/musashi/m68kops.o ../../cpu/musashi/m68kcpu.o
|
OBJS += ../../cpu/musashi/m68kops.o ../../cpu/musashi/m68kcpu.o
|
||||||
|
else
|
||||||
|
CFLAGS += -DEMU_F68K
|
||||||
|
OBJS += ../../cpu/fame/famec.o
|
||||||
endif
|
endif
|
||||||
# z80
|
# z80
|
||||||
ifeq "$(use_mz80)" "1"
|
ifeq "$(use_mz80)" "1"
|
||||||
|
@ -69,7 +72,7 @@ $(error nothing here!)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
LIBS += -lpng -lm -lpspgu # -lpspaudio -lpspgu -lpsppower -lpsphprm -lz -lm -lstdc++
|
LIBS += -lpng -lm -lpspgu -lpsppower -Wl,-Map=PicoDrive.map # -lpspaudio -lpsphprm
|
||||||
|
|
||||||
# target
|
# target
|
||||||
TARGET = PicoDrive
|
TARGET = PicoDrive
|
||||||
|
@ -82,12 +85,17 @@ CUSTOM_CLEAN = myclean
|
||||||
|
|
||||||
include $(PSPSDK)/lib/build.mak
|
include $(PSPSDK)/lib/build.mak
|
||||||
|
|
||||||
|
|
||||||
# some additional rules
|
# some additional rules
|
||||||
.c.o:
|
.c.o:
|
||||||
@echo ">>>" $<
|
@echo ">>>" $<
|
||||||
$(CC) $(CFLAGS) -c $< -o $@
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
AS := psp-as
|
||||||
|
|
||||||
|
.s.o:
|
||||||
|
@echo ">>>" $<
|
||||||
|
$(AS) -march=allegrex -mtune=allegrex $< -o $@
|
||||||
|
|
||||||
../../cpu/musashi/m68kops.c :
|
../../cpu/musashi/m68kops.c :
|
||||||
make -C ../../cpu/musashi
|
make -C ../../cpu/musashi
|
||||||
|
|
||||||
|
@ -97,6 +105,9 @@ readme.txt: ../../tools/textfilter ../base_readme.txt
|
||||||
../../tools/textfilter: ../../tools/textfilter.c
|
../../tools/textfilter: ../../tools/textfilter.c
|
||||||
make -C ../../tools/ textfilter
|
make -C ../../tools/ textfilter
|
||||||
|
|
||||||
|
../../cpu/fame/famec.o : ../../cpu/fame/famec.c
|
||||||
|
@echo ">>>" $<
|
||||||
|
$(CC) $(CFLAGS) -Wno-unused -c $< -o $@
|
||||||
|
|
||||||
# ?
|
# ?
|
||||||
up: EBOOT.PBP
|
up: EBOOT.PBP
|
||||||
|
|
12
psp/emu.c
12
psp/emu.c
|
@ -3,6 +3,7 @@
|
||||||
#include <sys/syslimits.h> // PATH_MAX
|
#include <sys/syslimits.h> // PATH_MAX
|
||||||
|
|
||||||
#include <pspthreadman.h>
|
#include <pspthreadman.h>
|
||||||
|
#include <pspdisplay.h>
|
||||||
|
|
||||||
#include "psp.h"
|
#include "psp.h"
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
|
@ -121,6 +122,7 @@ void emu_setDefaultConfig(void)
|
||||||
currentConfig.PicoAutoRgnOrder = 0x184; // US, EU, JP
|
currentConfig.PicoAutoRgnOrder = 0x184; // US, EU, JP
|
||||||
currentConfig.Frameskip = -1; // auto
|
currentConfig.Frameskip = -1; // auto
|
||||||
currentConfig.volume = 50;
|
currentConfig.volume = 50;
|
||||||
|
currentConfig.CPUclock = 222;
|
||||||
currentConfig.KeyBinds[ 4] = 1<<0; // SACB RLDU
|
currentConfig.KeyBinds[ 4] = 1<<0; // SACB RLDU
|
||||||
currentConfig.KeyBinds[ 6] = 1<<1;
|
currentConfig.KeyBinds[ 6] = 1<<1;
|
||||||
currentConfig.KeyBinds[ 7] = 1<<2;
|
currentConfig.KeyBinds[ 7] = 1<<2;
|
||||||
|
@ -386,6 +388,9 @@ static void updateKeys(void)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
keys = psp_pad_read(0);
|
keys = psp_pad_read(0);
|
||||||
|
if (keys & PSP_CTRL_HOME)
|
||||||
|
sceDisplayWaitVblankStart();
|
||||||
|
|
||||||
if (keys & BTN_SELECT)
|
if (keys & BTN_SELECT)
|
||||||
engineState = PGS_Menu;
|
engineState = PGS_Menu;
|
||||||
|
|
||||||
|
@ -498,6 +503,13 @@ void emu_Loop(void)
|
||||||
|
|
||||||
fpsbuff[0] = 0;
|
fpsbuff[0] = 0;
|
||||||
|
|
||||||
|
if (currentConfig.CPUclock != psp_get_cpu_clock()) {
|
||||||
|
lprintf("setting cpu clock to %iMHz... ", currentConfig.CPUclock);
|
||||||
|
i = psp_set_cpu_clock(currentConfig.CPUclock);
|
||||||
|
lprintf(i ? "failed\n" : "done\n");
|
||||||
|
currentConfig.CPUclock = psp_get_cpu_clock();
|
||||||
|
}
|
||||||
|
|
||||||
// make sure we are in correct mode
|
// make sure we are in correct mode
|
||||||
vidResetMode();
|
vidResetMode();
|
||||||
Pico.m.dirtyPal = 1;
|
Pico.m.dirtyPal = 1;
|
||||||
|
|
12
psp/menu.c
12
psp/menu.c
|
@ -1032,6 +1032,7 @@ menu_entry opt_entries[] =
|
||||||
{ "Use SRAM/BRAM savestates", MB_ONOFF, MA_OPT_SRAM_STATES, ¤tConfig.EmuOpt, 0x0001, 0, 0, 1 },
|
{ "Use SRAM/BRAM savestates", MB_ONOFF, MA_OPT_SRAM_STATES, ¤tConfig.EmuOpt, 0x0001, 0, 0, 1 },
|
||||||
{ NULL, MB_NONE, MA_OPT_CONFIRM_STATES,NULL, 0, 0, 0, 1 },
|
{ NULL, MB_NONE, MA_OPT_CONFIRM_STATES,NULL, 0, 0, 0, 1 },
|
||||||
{ "Save slot", MB_RANGE, MA_OPT_SAVE_SLOT, &state_slot, 0, 0, 9, 1 },
|
{ "Save slot", MB_RANGE, MA_OPT_SAVE_SLOT, &state_slot, 0, 0, 9, 1 },
|
||||||
|
{ NULL, MB_NONE, MA_OPT_CPU_CLOCKS, NULL, 0, 0, 0, 1 },
|
||||||
{ "[Sega/Mega CD options]", MB_NONE, MA_OPT_SCD_OPTS, NULL, 0, 0, 0, 1 },
|
{ "[Sega/Mega CD options]", MB_NONE, MA_OPT_SCD_OPTS, NULL, 0, 0, 0, 1 },
|
||||||
{ "[advanced options]", MB_NONE, MA_OPT_ADV_OPTS, NULL, 0, 0, 0, 1 },
|
{ "[advanced options]", MB_NONE, MA_OPT_ADV_OPTS, NULL, 0, 0, 0, 1 },
|
||||||
{ NULL, MB_NONE, MA_OPT_SAVECFG, NULL, 0, 0, 0, 1 },
|
{ NULL, MB_NONE, MA_OPT_SAVECFG, NULL, 0, 0, 0, 1 },
|
||||||
|
@ -1102,6 +1103,9 @@ static void menu_opt_cust_draw(const menu_entry *entry, int x, int y, void *para
|
||||||
}
|
}
|
||||||
text_out16(x, y, "Confirm savestate %s", str);
|
text_out16(x, y, "Confirm savestate %s", str);
|
||||||
break;
|
break;
|
||||||
|
case MA_OPT_CPU_CLOCKS:
|
||||||
|
text_out16(x, y, "CPU/bus clock %3i/%3iMHz", currentConfig.CPUclock, currentConfig.CPUclock/2);
|
||||||
|
break;
|
||||||
case MA_OPT_SAVECFG:
|
case MA_OPT_SAVECFG:
|
||||||
str24[0] = 0;
|
str24[0] = 0;
|
||||||
if (config_slot != 0) sprintf(str24, " (profile: %i)", config_slot);
|
if (config_slot != 0) sprintf(str24, " (profile: %i)", config_slot);
|
||||||
|
@ -1250,6 +1254,14 @@ static int menu_loop_options(void)
|
||||||
} else {state_slot--; if (state_slot < 0) state_slot = 9;
|
} else {state_slot--; if (state_slot < 0) state_slot = 9;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case MA_OPT_CPU_CLOCKS:
|
||||||
|
while ((inp = psp_pad_read(0)) & (BTN_LEFT|BTN_RIGHT)) {
|
||||||
|
currentConfig.CPUclock += (inp & BTN_LEFT) ? -1 : 1;
|
||||||
|
if (currentConfig.CPUclock < 19) currentConfig.CPUclock = 19;
|
||||||
|
if (currentConfig.CPUclock > 333) currentConfig.CPUclock = 333;
|
||||||
|
draw_menu_options(menu_sel); // will wait vsync
|
||||||
|
}
|
||||||
|
break;
|
||||||
case MA_OPT_SAVECFG:
|
case MA_OPT_SAVECFG:
|
||||||
case MA_OPT_SAVECFG_GAME:
|
case MA_OPT_SAVECFG_GAME:
|
||||||
case MA_OPT_LOADCFG:
|
case MA_OPT_LOADCFG:
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#define CPU_CALL
|
#define CPU_CALL
|
||||||
|
|
||||||
// draw.c
|
// draw.c
|
||||||
|
#define USE_BGR555 1
|
||||||
#define OVERRIDE_HIGHCOL 0
|
#define OVERRIDE_HIGHCOL 0
|
||||||
|
|
||||||
// draw2.c
|
// draw2.c
|
||||||
|
|
17
psp/psp.c
17
psp/psp.c
|
@ -5,6 +5,7 @@
|
||||||
#include <pspkernel.h>
|
#include <pspkernel.h>
|
||||||
#include <pspiofilemgr.h>
|
#include <pspiofilemgr.h>
|
||||||
#include <pspdisplay.h>
|
#include <pspdisplay.h>
|
||||||
|
#include <psppower.h>
|
||||||
#include <pspgu.h>
|
#include <pspgu.h>
|
||||||
|
|
||||||
#include "psp.h"
|
#include "psp.h"
|
||||||
|
@ -76,7 +77,8 @@ void psp_finish(void)
|
||||||
void psp_video_flip(int wait_vsync)
|
void psp_video_flip(int wait_vsync)
|
||||||
{
|
{
|
||||||
if (wait_vsync) sceDisplayWaitVblankStart();
|
if (wait_vsync) sceDisplayWaitVblankStart();
|
||||||
sceDisplaySetFrameBuf(psp_screen, 512, PSP_DISPLAY_PIXEL_FORMAT_565, PSP_DISPLAY_SETBUF_NEXTFRAME);
|
sceDisplaySetFrameBuf(psp_screen, 512, PSP_DISPLAY_PIXEL_FORMAT_565,
|
||||||
|
wait_vsync ? PSP_DISPLAY_SETBUF_IMMEDIATE : PSP_DISPLAY_SETBUF_NEXTFRAME);
|
||||||
current_screen ^= 1;
|
current_screen ^= 1;
|
||||||
psp_screen = current_screen ? PSP_VRAM_BASE0 : PSP_VRAM_BASE1;
|
psp_screen = current_screen ? PSP_VRAM_BASE0 : PSP_VRAM_BASE1;
|
||||||
}
|
}
|
||||||
|
@ -108,6 +110,19 @@ unsigned int psp_pad_read(int blocking)
|
||||||
return pad.Buttons;
|
return pad.Buttons;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int psp_get_cpu_clock(void)
|
||||||
|
{
|
||||||
|
return scePowerGetCpuClockFrequencyInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
int psp_set_cpu_clock(int clock)
|
||||||
|
{
|
||||||
|
int ret = scePowerSetClockFrequency(clock, clock, clock/2);
|
||||||
|
if (ret != 0) lprintf("failed to set clock: %i\n", ret);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* alt logging */
|
/* alt logging */
|
||||||
#define LOG_FILE "log.log"
|
#define LOG_FILE "log.log"
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,8 @@ extern void *psp_screen;
|
||||||
|
|
||||||
unsigned int psp_pad_read(int blocking);
|
unsigned int psp_pad_read(int blocking);
|
||||||
|
|
||||||
|
int psp_get_cpu_clock(void);
|
||||||
|
int psp_set_cpu_clock(int clock);
|
||||||
|
|
||||||
/* shorter btn names */
|
/* shorter btn names */
|
||||||
#define BTN_UP PSP_CTRL_UP
|
#define BTN_UP PSP_CTRL_UP
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue