fixed stupid bug with video renderer

This commit is contained in:
ekeeke31 2008-10-26 18:32:32 +00:00
parent f2bf794996
commit 0bc38ba32c
8 changed files with 51 additions and 53 deletions

View File

@ -34,7 +34,7 @@ LDFLAGS = $(MACHDEP) -Wl,-Map,$(notdir $@).map
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS := -ldi -lfat -lwiiuse -lbte -logc -lm -lz -lsamplerate
LIBS := -ldi -lfat -lwiiuse -lbte -logc -lm -lz
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing

View File

@ -15,21 +15,21 @@ CURRENT:
- improved HBLANK flag accuracy, fixes line flickering in "Gouketsuji Ichizoku"
- re-enabled Z80 banked access to WRAM, fixes hang-up in "Mamono Hunter Youko"
- modified JCART emulation, fixes corrupted tracks logo in "Micro Machines 2"
- added Blargg's NTSC Filters support (emulates NTSC composite video artifacts)
- added Blargg's NTSC Filters support (NTSC composite video artifacts emulation)
[NGC/Wii]
- remove useless libsamplerate settings in "HQ YM2612" mode, only keeps SRC_LINEAR (faster) and SRC_SINC_FAST (better)
- implemented fast scrolling in menus using Wiimote D-PAD
- fixed config file incompatibilities when switching between Gamecube and Wii versions
- added an option to enable/disable bilinear filtering (can reduce scroll tearing sometime)
- added antialiasing support (optional)
- modified Xscale/Yscale values to show scaled width/height instead of scaling offsets
- removed embedded font, back to internal IPL font: it should still works for Qoob users (thanks to emukiddid !)
- added an option to enable/disable bilinear filtering
- rewrote video scaling code
- removed embedded font, back to internal IPL font: it should still works for Qoob users (fix from emukiddid)
- improved SDCARD access speed (svpe's libogc patch)
- added SDHC support (marcan's libogc patch)
[NGC]
- added proper 480p menu detection for NTSC Gamecube users
- prevents FAT automatic operations if no SDCARD is present

View File

@ -4,10 +4,9 @@
#include <fat.h>
#include <sys/dir.h>
#define CONFIG_VERSION "GENPLUS 1.2.6 "
#define CONFIG_VERSION "GENPLUS 1.2.2 "
t_config config;
bool use_FAT;
void config_save()
{

View File

@ -857,15 +857,10 @@ int loadsavemenu (int which)
if ((device == 0) || (device == 3))
{
PARTITION_INTERFACE dev = device ? PI_USBSTORAGE : PI_INTERNAL_SD;
if (FatIsMounted(dev)) fatSetDefaultInterface(dev);
else
{
WaitPrompt ("Device not found!");
break;
}
fatSetDefaultInterface(dev);
fatEnableReadAhead (dev, 6, 64);
}
#endif
fatEnableReadAhead (PI_DEFAULT, 6, 64);
if (which == 1) quit = ManageState(ret-1,device);
else if (which == 0) quit = ManageSRAM(ret-1,device);
if (quit) return 1;
@ -964,15 +959,10 @@ void loadmenu ()
case 2:
{
PARTITION_INTERFACE dev = (ret&2) ? PI_USBSTORAGE : PI_INTERNAL_SD;
if (FatIsMounted(dev)) fatSetDefaultInterface(dev);
else
{
WaitPrompt ("Device not found!");
break;
}
fatSetDefaultInterface(dev);
fatEnableReadAhead (dev, 6, 64);
}
#endif
fatEnableReadAhead (PI_DEFAULT, 6, 64);
quit = OpenSD();
break;

View File

@ -100,6 +100,7 @@ void reloadrom ()
***************************************************************************/
int FramesPerSecond = 0;
int frameticker = 0;
bool use_FAT = 0;
int main (int argc, char *argv[])
{
@ -125,12 +126,11 @@ int main (int argc, char *argv[])
#endif
/* Initialize SDCARD Interface (LibFAT) */
use_FAT = 0;
#ifdef HW_RVL
if (fatInit (8, false) == true) use_FAT = 1;
#else
if (fatInitDefault() == true) use_FAT = 1;
#endif
if (fatInitDefault() == true)
{
use_FAT = 1;
fatEnableReadAhead (PI_DEFAULT, 6, 64);
}
/* Restore User Configuration */
set_config_defaults();

View File

@ -395,18 +395,25 @@ static void gxStart(void)
static void gxScale(GXRModeObj *rmode)
{
int scale = 0;
/* GX filtering is disabled, VI handles full strecthing */
if (!config.bilinear && (vwidth < 640)) rmode->fbWidth = vwidth;
else rmode->fbWidth = 640;
/* Configure GX scaler and VI width */
/* GX Scaler (by default, use EFB maximal width) */
rmode->fbWidth = 640;
if (!config.bilinear)
{
/* try to prevent GX bilinear filtering */
/* if possible, let GX simply doubles the width, otherwise disable GX stretching completely */
if ((vwidth * 2) <= 640) rmode->fbWidth = vwidth * 2;
else if (vwidth <= 640) rmode->fbWidth = vwidth;
}
/* Horizontal Scaling (GX/VI) */
if (xscale > (rmode->fbWidth/2))
{
/* check max upscaling */
if (xscale > 360)
{
scale = xscale - 360; /* save offset for later */
/* save offset for later */
scale = xscale - 360;
xscale = 360;
}
@ -416,16 +423,16 @@ static void gxScale(GXRModeObj *rmode)
/* set GX scaling to max EFB width */
scale += (rmode->fbWidth/2);
}
else
{
}
else
{
/* VI should not upscale anything */
rmode->viWidth = rmode->fbWidth;
rmode->viXOrigin = (720 - rmode->fbWidth) / 2;
/* set GX scaling to max EFB width */
scale = xscale;
}
}
/* update GX scaler (Vertex Position Matrix) */
square[6] = square[3] = scale + xshift;
@ -433,13 +440,13 @@ static void gxScale(GXRModeObj *rmode)
square[4] = square[1] = yscale + yshift;
square[7] = square[10] = -yscale + yshift;
draw_init();
}
}
/* Set Aspect Ratio (depending on current configuration) */
void ogc_video__aspect()
{
if (config.aspect)
{
if (config.aspect)
{
/* original aspect ratio */
/* the following values have been detected from comparison with a real 50/60hz Mega Drive */
if (config.overscan)
@ -456,22 +463,22 @@ void ogc_video__aspect()
yscale = bitmap.viewport.h / 2;
if (vdp_pal && (!gc_pal || config.render)) yscale = yscale * 243 / 288;
else if (!vdp_pal && gc_pal && !config.render) yscale = yscale * 288 / 243;
}
}
xshift = 8 + config.xshift; /* default RGB offset, composite might be shifted less */
yshift = (vdp_pal ? 1 : 3) - (config.overscan ? 0 : 1) + config.yshift;
}
}
else
{
/* manual aspect ratio (default is fullscreen) */
if (config.overscan)
{
{
/* borders are emulated */
xscale = 352;
yscale = (gc_pal && !config.render) ? (vdp_pal ? (268*144 / bitmap.viewport.h):143) : (vdp_pal ? (224*144 / bitmap.viewport.h):120);
}
else
{
}
else
{
xscale = 320;
yscale = (gc_pal && !config.render) ? 134 : 112;
}
@ -584,6 +591,8 @@ void ogc_video__update()
/* check if viewport has changed */
if (bitmap.viewport.changed)
{
bitmap.viewport.changed = 0;
/* update texture size */
vwidth = bitmap.viewport.w + 2 * bitmap.viewport.x;
vheight = bitmap.viewport.h + 2 * bitmap.viewport.y;

View File

@ -1170,10 +1170,10 @@ INLINE void chan_calc(FM_CH *CH)
/* add support for 3 slot mode */
if ((ym2612.OPN.ST.mode & 0xC0) && (CH == &ym2612.CH[2]))
{
update_phase_lfo_slot(&ym2612.CH[2].SLOT[SLOT1], CH->pms, ym2612.OPN.SL3.block_fnum[1]);
update_phase_lfo_slot(&ym2612.CH[2].SLOT[SLOT2], CH->pms, ym2612.OPN.SL3.block_fnum[2]);
update_phase_lfo_slot(&ym2612.CH[2].SLOT[SLOT3], CH->pms, ym2612.OPN.SL3.block_fnum[0]);
update_phase_lfo_slot(&ym2612.CH[2].SLOT[SLOT4], CH->pms, CH->block_fnum);
update_phase_lfo_slot(&CH->SLOT[SLOT1], CH->pms, ym2612.OPN.SL3.block_fnum[1]);
update_phase_lfo_slot(&CH->SLOT[SLOT2], CH->pms, ym2612.OPN.SL3.block_fnum[2]);
update_phase_lfo_slot(&CH->SLOT[SLOT3], CH->pms, ym2612.OPN.SL3.block_fnum[0]);
update_phase_lfo_slot(&CH->SLOT[SLOT4], CH->pms, CH->block_fnum);
}
else update_phase_lfo_channel(CH);
}

View File

@ -12,7 +12,7 @@ NAME = ../gen_sdl.exe
CC = gcc
CFLAGS = `sdl-config --cflags` -O6 -march=i686 -fomit-frame-pointer
DEFINES = -DLSB_FIRST -DX86_ASM -DLOG_ERROR=1
DEFINES = -DLSB_FIRST -DX86_ASM -DLOGERROR=1
INCLUDES = -I. -I.. -I../z80 -I../m68k -I../dos -I../sound -I../sound/SRC -I../cart_hw -I../cart_hw/svp -I../ntsc
LIBS = `sdl-config --libs` -lz -lm