Skip to content

Commit

Permalink
psp gfx scaling/etc stuff
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@279 be3aeb3a-fb24-0410-a615-afba39da0efa
  • Loading branch information
notaz committed Oct 25, 2007
1 parent 3aa1e14 commit 8ab3e3c
Show file tree
Hide file tree
Showing 26 changed files with 559 additions and 313 deletions.
14 changes: 7 additions & 7 deletions Pico/Memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static __inline int PicoMemBase(u32 pc)
#endif


static u32 CPU_CALL PicoCheckPc(u32 pc)
static u32 PicoCheckPc(u32 pc)
{
u32 ret=0;
#if defined(EMU_C68K)
Expand Down Expand Up @@ -315,7 +315,7 @@ static void OtherWrite8End(u32 a,u32 d,int realsize)
// Read Rom and read Ram

#ifndef _ASM_MEMORY_C
PICO_INTERNAL_ASM u32 CPU_CALL PicoRead8(u32 a)
PICO_INTERNAL_ASM u32 PicoRead8(u32 a)
{
u32 d=0;

Expand Down Expand Up @@ -351,7 +351,7 @@ PICO_INTERNAL_ASM u32 CPU_CALL PicoRead8(u32 a)
return d;
}

PICO_INTERNAL_ASM u32 CPU_CALL PicoRead16(u32 a)
PICO_INTERNAL_ASM u32 PicoRead16(u32 a)
{
u32 d=0;

Expand Down Expand Up @@ -387,7 +387,7 @@ PICO_INTERNAL_ASM u32 CPU_CALL PicoRead16(u32 a)
return d;
}

PICO_INTERNAL_ASM u32 CPU_CALL PicoRead32(u32 a)
PICO_INTERNAL_ASM u32 PicoRead32(u32 a)
{
u32 d=0;

Expand Down Expand Up @@ -426,7 +426,7 @@ PICO_INTERNAL_ASM u32 CPU_CALL PicoRead32(u32 a)
// Write Ram

#ifndef _ASM_MEMORY_C
PICO_INTERNAL_ASM void CPU_CALL PicoWrite8(u32 a,u8 d)
PICO_INTERNAL_ASM void PicoWrite8(u32 a,u8 d)
{
#ifdef __debug_io
dprintf("w8 : %06x, %02x @%06x", a&0xffffff, d, SekPc);
Expand All @@ -446,7 +446,7 @@ PICO_INTERNAL_ASM void CPU_CALL PicoWrite8(u32 a,u8 d)
}
#endif

void CPU_CALL PicoWrite16(u32 a,u16 d)
void PicoWrite16(u32 a,u16 d)
{
#ifdef __debug_io
dprintf("w16: %06x, %04x", a&0xffffff, d);
Expand All @@ -462,7 +462,7 @@ void CPU_CALL PicoWrite16(u32 a,u16 d)
OtherWrite16(a,d);
}

static void CPU_CALL PicoWrite32(u32 a,u32 d)
static void PicoWrite32(u32 a,u32 d)
{
#ifdef __debug_io
dprintf("w32: %06x, %08x", a&0xffffff, d);
Expand Down
21 changes: 12 additions & 9 deletions Pico/Pico.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ static int PicoFrameSimple(void)
int cycles_68k_vblock,cycles_68k_block;

// split to 16 run calls for active scan, for vblank split to 2 (ntsc), 3 (pal 240), 4 (pal 224)
if (Pico.m.pal && (pv->reg[1]&8)) { // 240 lines
if (Pico.m.pal && (pv->reg[1]&8)) {
if(pv->reg[1]&8) { // 240 lines
cycles_68k_block = 7329; // (488*240+148)/16.0, -4
cycles_68k_vblock = 11640; // (72*488-148-68)/3.0, 0
Expand Down Expand Up @@ -378,14 +378,6 @@ static int PicoFrameSimple(void)
PicoRunZ80Simple(line, lines);
}

// here we render sound if ym2612 is disabled
if (!(PicoOpt&1) && PsndOut) {
int len = sound_render(0, PsndLen);
if (PicoWriteSound) PicoWriteSound(len);
// clear sound buffer
sound_clear();
}

// render screen
if (!PicoSkipFrame)
{
Expand All @@ -401,6 +393,17 @@ static int PicoFrameSimple(void)
for (y=0;y<224;y++) PicoLine(y);
#endif
else PicoFrameFull();
#ifdef DRAW_FINISH_FUNC
DRAW_FINISH_FUNC();
#endif
}

// here we render sound if ym2612 is disabled
if (!(PicoOpt&1) && PsndOut) {
int len = sound_render(0, PsndLen);
if (PicoWriteSound) PicoWriteSound(len);
// clear sound buffer
sound_clear();
}

// a gap between flags set and vint
Expand Down
4 changes: 4 additions & 0 deletions Pico/PicoFrameHints.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ static int PicoFrameHints(void)
#endif
}

#ifdef DRAW_FINISH_FUNC
DRAW_FINISH_FUNC();
#endif

// V-int line (224 or 240)
Pico.m.scanline=(short)y;

Expand Down
2 changes: 1 addition & 1 deletion Pico/PicoInt.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ PICO_INTERNAL void PicoFrameFull();

// Memory.c
PICO_INTERNAL int PicoInitPc(unsigned int pc);
PICO_INTERNAL_ASM unsigned int CPU_CALL PicoRead32(unsigned int a);
PICO_INTERNAL_ASM unsigned int PicoRead32(unsigned int a);
PICO_INTERNAL void PicoMemSetup(void);
PICO_INTERNAL_ASM void PicoMemReset(void);
PICO_INTERNAL int PadRead(int i);
Expand Down
2 changes: 1 addition & 1 deletion cpu/Cyclone/Disa/Disa.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ unsigned int DisaPc=0;
char *DisaText=NULL; // Text buffer to write in
static char Tasm[]="bwl?";
static char Comment[64]="";
unsigned short (CPU_CALL *DisaWord)(unsigned int a)=NULL;
unsigned short (*DisaWord)(unsigned int a)=NULL;

static unsigned int DisaLong(unsigned int a)
{
Expand Down
8 changes: 1 addition & 7 deletions cpu/Cyclone/Disa/Disa.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,10 @@
extern "C" {
#endif

#if defined(ARM) || defined(GP32) || !defined (__WINS__)
#define CPU_CALL
#else
#define CPU_CALL __fastcall
#endif

extern unsigned int DisaPc;
extern char *DisaText; // Text buffer to write in

extern unsigned short (CPU_CALL *DisaWord)(unsigned int a);
extern unsigned short (*DisaWord)(unsigned int a);
int DisaGetEa(char *t,int ea,int size);

int DisaGet();
Expand Down
2 changes: 1 addition & 1 deletion cpu/Cyclone/OpAny.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ int opend_op_changes_cycles, opend_check_interrupt, opend_check_trace;

static unsigned char OpData[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};

static unsigned short CPU_CALL OpRead16(unsigned int a)
static unsigned short OpRead16(unsigned int a)
{
return (unsigned short)( (OpData[a&15]<<8) | OpData[(a+1)&15] );
}
Expand Down
1 change: 1 addition & 0 deletions platform/base_readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ If you have any problems (game does not boot, sound is glitchy, broken graphics)
make sure you enable "Accurate timing", "Emulate Z80" and use "16bit accurate
renderer". This way you will get the best compatibility this emulator can
provide.
For possible Sega/Mega CD problems, see "Other important stuff" section below.


How to run Sega/Mega CD games
Expand Down
4 changes: 3 additions & 1 deletion platform/common/emu.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ typedef struct {
int JoyBinds[4][32];
int PicoAutoRgnOrder;
int PicoCDBuffers;
int scaling; // 0=center, 1=hscale, 2=hvscale, 3=hsoftscale
int scaling; // gp2x: 0=center, 1=hscale, 2=hvscale, 3=hsoftscale; psp: bilinear filtering
float scale; // psp: screen scale
float hscale32, hscale40; // psp: horizontal scale
} currentConfig_t;


Expand Down
8 changes: 8 additions & 0 deletions platform/common/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ typedef enum
MA_OPT_CPU_CLOCKS,
MA_OPT_SCD_OPTS,
MA_OPT_ADV_OPTS,
MA_OPT_DISP_OPTS, /* psp */
MA_OPT_SAVECFG,
MA_OPT_SAVECFG_GAME,
MA_OPT_LOADCFG,
Expand All @@ -63,6 +64,13 @@ typedef enum
MA_OPT2_RAMTIMINGS, /* gp2x */
MA_OPT2_SQUIDGEHACK, /* gp2x */
MA_OPT2_DONE,
MA_OPT3_SCALE, /* psp (all OPT3) */
MA_OPT3_HSCALE32,
MA_OPT3_HSCALE40,
MA_OPT3_PRES_NOSCALE,
MA_OPT3_PRES_FULLSCR,
MA_OPT3_FILTERING,
MA_OPT3_DONE,
MA_CDOPT_TESTBIOS_USA,
MA_CDOPT_TESTBIOS_EUR,
MA_CDOPT_TESTBIOS_JAP,
Expand Down
2 changes: 0 additions & 2 deletions platform/gizmondo/port_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#ifndef PORT_CONFIG_H
#define PORT_CONFIG_H

#define CPU_CALL

// draw.c
#define OVERRIDE_HIGHCOL 1

Expand Down
2 changes: 0 additions & 2 deletions platform/gp2x/port_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#ifndef PORT_CONFIG_H
#define PORT_CONFIG_H

#define CPU_CALL

// draw.c
#define OVERRIDE_HIGHCOL 0

Expand Down
1 change: 0 additions & 1 deletion platform/linux/port_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#ifndef PORT_CONFIG_H
#define PORT_CONFIG_H

#define CPU_CALL
#define NO_SYNC

// draw2.c
Expand Down
17 changes: 13 additions & 4 deletions platform/psp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ amalgamate = 0


CFLAGS += -I../.. -I. -D_UNZIP_SUPPORT -DNO_SYNC # -DBENCHMARK
CFLAGS += -Wall -Winline
CFLAGS += -Wall -Winline -G0
ifeq ($(DEBUG),)
CFLAGS += -O2 -G0 -ftracer -fstrength-reduce -ffast-math
CFLAGS += -O2 -ftracer -fstrength-reduce -ffast-math
else
CFLAGS += -ggdb
endif
Expand Down Expand Up @@ -52,7 +52,8 @@ OBJS += ../../Pico/sound/mix.o
OBJS += ../../Pico/sound/sn76496.o ../../Pico/sound/ym2612.o
# zlib (hacked)
OBJS += ../../zlib/gzio.o ../../zlib/inffast.o ../../zlib/inflate.o ../../zlib/inftrees.o ../../zlib/trees.o \
../../zlib/deflate.o ../../zlib/crc32.o ../../zlib/adler32.o ../../zlib/zutil.o ../../zlib/compress.o
../../zlib/deflate.o ../../zlib/crc32.o ../../zlib/adler32.o ../../zlib/zutil.o ../../zlib/compress.o \
../../zlib/uncompr.o
# unzip
OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o
# CPU cores
Expand All @@ -70,6 +71,8 @@ OBJS += ../../cpu/mz80/mz80.o
else
$(error nothing here!)
endif
# bg images
OBJS += data/bg32.o data/bg40.o


LIBS += -lpng -lm -lpspgu -lpsppower -Wl,-Map=PicoDrive.map # -lpspaudio -lpsphprm
Expand Down Expand Up @@ -109,7 +112,13 @@ readme.txt: ../../tools/textfilter ../base_readme.txt
@echo ">>>" $<
$(CC) $(CFLAGS) -Wno-unused -c $< -o $@

# ?
data/bg32.o: data/bg32.bin
bin2o -i $< $@ bgdatac32

data/bg40.o: data/bg40.bin
bin2o -i $< $@ bgdatac40

#
up: EBOOT.PBP
@cp -v $^ /media/disk/PSP/GAME/PicoDrive/

Expand Down
Binary file added platform/psp/data/bg32.bin
Binary file not shown.
Binary file added platform/psp/data/bg40.bin
Binary file not shown.
Loading

0 comments on commit 8ab3e3c

Please sign in to comment.