#include "fce.h"
#include "ppu098.h"
#include "nsf.h"
-#include "sound098.h"
+#include "sound.h"
#include "memory.h"
#include "cart.h"
#include "video.h"
#include "input.h"
+#ifdef __arm__
+#include "drivers/arm/asmutils.h"
+#endif
+
#define Pal (PALRAM)
static void FetchSpriteData098(void);
}
}
-// TODO: make this compatible with the new sound code
-#ifdef ASM_6502
-#define asmcpu_update(c) \
- FCEU_SoundCPUHook098((((c) >> 4) * 43) >> 7)
-#endif
-
extern int ppudead;
extern int kook;
{
// FCEU_printf("Trigger NMI, %d, %d\n",timestamp,ppudead);
// TriggerNMI2();
- TriggerNMI(); // TODO
+ TriggerNMI(); // TODO?
}
PPU[0]=V;
TempAddr&=0xF3FF;
static void ResetRL(uint8 *target)
{
- memset(target,0xFF,256);
+ FCEU_dwmemset(target,0xffffffff,256);
if(InputScanlineHook)
InputScanlineHook(0,0,0,0);
Plinef=target;
Pline=target;
firsttile=0;
- linestartts=timestamp*48+X.count;
+ linestartts=timestamp*48+X6502_GetCycleCount();
tofix=0;
FCEUPPU_LineUpdate098();
tofix=1;
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;
void MMC5_hb(int); /* Ugh ugh ugh. */
static void DoLine(void)
{
+#ifndef __arm__
int x;
+#endif
uint8 *target=XBuf+scanline*320+32;
if(MMC5Hack && (ScreenON || SpriteON)) MMC5_hb(scanline);
if(SpriteON)
CopySprites098(target);
+#ifdef __arm__
+ if(ScreenON || SpriteON) // Yes, very el-cheapo.
+ {
+ if(PPU[1]&0x01)
+ block_and(target, 256, 0x30);
+ }
+ if((PPU[1]>>5)==0x7)
+ block_or(target, 256, 0xc0);
+ else if(PPU[1]&0xE0)
+ block_or(target, 256, 0x40);
+ else
+ block_andor(target, 256, 0x3f, 0x80);
+#else
if(ScreenON || SpriteON) // Yes, very el-cheapo.
{
if(PPU[1]&0x01)
else
for(x=63;x>=0;x--)
*(uint32 *)&target[x<<2]=((*(uint32*)&target[x<<2])&0x3f3f3f3f)|0x80808080;
+#endif
sphitx=0x100;