X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=ppu098.c;h=7591282663e5cc0aa9904ef81fc84cba9e54f05c;hp=023975b7723363674c66d3a584f54ca68d06b1e7;hb=5bd16b94320afa9dfba4985f5d69c2d84bae4c33;hpb=cd9a6b519c9c465d6781d4a6636d715542e6e0f6 diff --git a/ppu098.c b/ppu098.c index 023975b..7591282 100644 --- a/ppu098.c +++ b/ppu098.c @@ -34,8 +34,8 @@ #include "video.h" #include "input.h" -#ifdef GP2X -#include "drivers/gp2x/asmutils.h" +#ifdef __arm__ +#include "drivers/arm/asmutils.h" #endif #define Pal (PALRAM) @@ -86,34 +86,6 @@ static void makeppulut(void) } } -#if defined(ASM_6502) && !defined(DEBUG_ASM_6502) -static void asmcpu_update(int32 cycles) -{ - // some code from x6502.c - fhcnt-=cycles; - if(fhcnt<=0) - { - FrameSoundUpdate(); - fhcnt+=fhinc; - } - - if(PCMIRQCount>0) - { - PCMIRQCount-=cycles; - if(PCMIRQCount<=0) - { - vdis=1; - if((PSG[0x10]&0x80) && !(PSG[0x10]&0x40)) - { - extern uint8 SIRQStat; - SIRQStat|=0x80; - X6502_IRQBegin(FCEU_IQDPCM); - } - } - } -} -#endif - extern int ppudead; extern int kook; @@ -370,7 +342,7 @@ static void ResetRL(uint8 *target) Plinef=target; Pline=target; firsttile=0; - linestartts=timestamp*48+X.count; + linestartts=timestamp*48+X6502_GetCycleCount(); tofix=0; FCEUPPU_LineUpdate098(); tofix=1; @@ -489,9 +461,13 @@ static void FASTAPASS(1) RefreshLine098(int lastpixel) if(!ScreenON && !SpriteON) { uint32 tem; + int tiles; tem=Pal[0]|(Pal[0]<<8)|(Pal[0]<<16)|(Pal[0]<<24); tem|=0x40404040; - FCEU_dwmemset(Pline,tem,numtiles*8); + tiles=numtiles; + if(firsttile+tiles > 256/8) tiles=256/8-firsttile; + if(tiles > 0) + FCEU_dwmemset(Pline,tem,tiles*8); P+=numtiles*8; Pline=P; @@ -695,7 +671,7 @@ static void Fixit1(void) void MMC5_hb(int); /* Ugh ugh ugh. */ static void DoLine(void) { -#ifndef GP2X +#ifndef __arm__ int x; #endif uint8 *target=XBuf+scanline*320+32; @@ -716,7 +692,7 @@ static void DoLine(void) if(SpriteON) CopySprites098(target); -#ifdef GP2X +#ifdef __arm__ if(ScreenON || SpriteON) // Yes, very el-cheapo. { if(PPU[1]&0x01)