kage 83-84
cvn3 ~88
+--
+v03+merge
if(t>=XBuf)
{
DrawTextLineBG(t);
- DrawTextTrans(t+3*SCREEN_WIDTH+(128-strlen(errmsg)*4),SCREEN_WIDTH,(uint8 *)errmsg,128+4);
+ DrawTextTrans(t+3*SCREEN_WIDTH+(128-strlen(errmsg)*4),SCREEN_WIDTH,(uint8 *)errmsg,4);
}
}
}
void flushcache(unsigned int beginning_addr, unsigned int end_addr, unsigned int flags);\r
+void block_or(void *src, size_t n, int pat);\r
+void block_andor(void *src, size_t n, int andpat, int orpat);\r
\r
mov pc, lr
+.global block_or @ void *src, size_t n, int pat
+
+block_or:
+ stmfd sp!, {r4-r5}
+ orr r2, r2, r2, lsl #8
+ orr r2, r2, r2, lsl #16
+ mov r1, r1, lsr #4
+block_loop_or:
+ ldmia r0, {r3-r5,r12}
+ subs r1, r1, #1
+ orr r3, r3, r2
+ orr r4, r4, r2
+ orr r5, r5, r2
+ orr r12,r12,r2
+ stmia r0!, {r3-r5,r12}
+ bne block_loop_or
+ ldmfd sp!, {r4-r5}
+ bx lr
+
+
+.global block_andor @ void *src, size_t n, int andpat, int orpat
+
+block_andor:
+ stmfd sp!, {r4-r6}
+ orr r2, r2, r2, lsl #8
+ orr r2, r2, r2, lsl #16
+ orr r3, r3, r3, lsl #8
+ orr r3, r3, r3, lsl #16
+ mov r1, r1, lsr #4
+block_loop_andor:
+ ldmia r0, {r4-r6,r12}
+ subs r1, r1, #1
+ and r4, r4, r2
+ orr r4, r4, r3
+ and r5, r5, r2
+ orr r5, r5, r3
+ and r6, r6, r2
+ orr r6, r6, r3
+ and r12,r12,r2
+ orr r12,r12,r3
+ stmia r0!, {r4-r6,r12}
+ bne block_loop_andor
+ ldmfd sp!, {r4-r6}
+ bx lr
+
+
+
/* buggy and slow, probably because function call overhead
@ renderer helper, based on bitbank's method
.global draw8pix @ uint8 *P, uint8 *C, uint8 *PALRAM @ dest, src, pal
int scaled_display=0;
int paletterefresh;
-#define FPS_COLOR 61
+#define FPS_COLOR 1
static unsigned char fontdata8x8[] =
int c=4;
while (c--)
{
- memset (gp2x_screen8, 0x80, 320*240);
+ memset (gp2x_screen8, 0, 320*240);
gp2x_video_flip();
}
XBuf = gp2x_screen8;
srendline=0;
erendline=239;
- XBuf = gp2x_screen8; // TODO: use mmuhacked upper mem
+ XBuf = gp2x_screen8;
return 1;
}
int y, *destt = (int *) screen;
for (y = 20/*240*/; y; y--)
{
- *destt++ = 0x3F3F3F3F; *destt++ = 0x3F3F3F3F; *destt++ = 0x3F3F3F3F; *destt++ = 0x3F3F3F3F;
- *destt++ = 0x3F3F3F3F; *destt++ = 0x3F3F3F3F; *destt++ = 0x3F3F3F3F; *destt++ = 0x3F3F3F3F;
+ *destt++ = 0; *destt++ = 0; *destt++ = 0; *destt++ = 0;
+ *destt++ = 0; *destt++ = 0; *destt++ = 0; *destt++ = 0;
destt += 64+8;
//*destt++ = 0x3F3F3F3F; *destt++ = 0x3F3F3F3F; *destt++ = 0x3F3F3F3F; *destt++ = 0x3F3F3F3F;
#include "dface.h"
+// just for printing some iNES info for user..
+#include "../../fce.h"
+#include "../../ines.h"
+
static int ntsccol=0,ntschue=-1,ntsctint=-1;
int soundvol=70;
int inited=0;
ParseGI(tmp);
//RefreshThrottleFPS();
InitOtherInput();
+
+ // additional print for gpfce
+ {
+ int MapperNo;
+ iNES_HEADER *head = iNESGetHead();
+ MapperNo = (head->ROM_type>>4);
+ MapperNo|=(head->ROM_type2&0xF0);
+ FCEU_DispMessage("%s, Mapper: %d%s%s", PAL?"PAL":"NTSC", MapperNo, (head->ROM_type&2)?", BB":"", (head->ROM_type&4)?", T":"");
+ }
+
FCEUI_Emulate();
dk:
#include "dprintf.h"
+#ifdef GP2X
+#include "drivers/gp2x/asmutils.h"
+#endif
+
#define Pal (PALRAM)
#endif
if(ScreenON)
{
- if(scanline>=FSettings.FirstSLine && scanline<=FSettings.LastSLine)
+ if(scanline>=FSettings.FirstSLine && scanline<=Settings.LastSLine)
BGRender(target);
else
{
for(x=63;x>=0;x--)
((uint32 *)target)[x]=((uint32*)target)[x]&0xF0F0F0F0;
}
+#ifdef GP2X
+ if((PPU[1]>>5)==0x7) block_or(target, 256, 0xc0);
+ else if(PPU[1]&0xE0) block_andor(target, 256, 0x3f, 0x40);
+ else block_andor(target, 256, 0x3f, 0x80);
+#else
if((PPU[1]>>5)==0x7)
for(x=63;x>=0;x--)
- ((uint32 *)target)[x]=(((uint32*)target)[x]&0x3f3f3f3f)|0x40404040;
+ ((uint32 *)target)[x]=(((uint32*)target)[x])|0xc0c0c0c0;
else if(PPU[1]&0xE0)
for(x=63;x>=0;x--)
- ((uint32 *)target)[x]=((uint32*)target)[x]|0xC0C0C0C0;
+ ((uint32 *)target)[x]=(((uint32*)target)[x]&0x3f3f3f3f)|0x40404040;
else
for(x=63;x>=0;x--)
- ((uint32 *)target)[x]=((uint32*)target)[x]&0x3f3f3f3f;
- FCEU_dwmemset(target- 8,0x3f3f3f3f,8);
- FCEU_dwmemset(target+256,0x3f3f3f3f,8);
+ ((uint32 *)target)[x]=(((uint32*)target)[x]&0x3f3f3f3f)|0x80808080;
+#endif
+ // black borders
+ ((uint32 *)target)[-2]=((uint32 *)target)[-1]=0;
+ ((uint32 *)target)[64]=((uint32 *)target)[65]=0;
#ifdef FRAMESKIP
}
#endif
// FCEUPPU_Loop:
if(ppudead) /* Needed for Knight Rider, possibly others. */
{
- memset(XBuf, 0x80, 320*240);
+ //memset(XBuf, 0, 320*240);
X6502_Run(scanlines_per_frame*(256+85));
ppudead--;
goto update;
if(FCEUGameInfo.type==GIT_NSF)
{
+ // run scanlines for asm core to fuction
for(scanline=0;scanline<240;scanline++)
X6502_Run(256+85);
}
- #ifdef FRAMESKIP
- else if(FSkip)
- {
- int y;
-
- y=SPRAM[0];
- y++;
-
- PPU_status|=0x20; // Fixes "Bee 52". Does it break anything?
- if(GameHBIRQHook)
- {
- X6502_Run(256);
- for(scanline=0;scanline<240;scanline++)
- {
- if(ScreenON || SpriteON)
- GameHBIRQHook();
- if(scanline==y && SpriteON) PPU_status|=0x40;
- X6502_Run((scanline==239)?85:(256+85));
- ResetRL(); // ??
- }
- }
- else if(y<240)
- {
- X6502_Run((256+85)*y);
- if(SpriteON) PPU_status|=0x40; // Quick and very dirty hack.
- X6502_Run((256+85)*(240-y));
- }
- else
- X6502_Run((256+85)*240);
- }
- #endif
else
{
int x,max,maxref;
}\r
return(0);\r
}\r
+\r
+iNES_HEADER *iNESGetHead(void)\r
+{\r
+ return &head;\r
+}\r
+\r
void FASTAPASS(1) MIRROR_SET2(uint8 V);\r
void FASTAPASS(1) MIRROR_SET(uint8 V);\r
\r
+iNES_HEADER *iNESGetHead(void);\r
+\r
void Mapper0_init(void);\r
void Mapper1_init(void);\r
//void Mapper2_init(void);\r
int x;\r
\r
for(x=0;x<7;x++)\r
- FCEUD_SetPalette(128+x,unvpalette[x].r,unvpalette[x].g,unvpalette[x].b);\r
+ FCEUD_SetPalette(x,unvpalette[x].r,unvpalette[x].g,unvpalette[x].b);\r
if(FCEUGameInfo.type==GIT_NSF)\r
{\r
//for(x=0;x<128;x++)\r
// FCEUD_SetPalette(x,x,0,x);\r
- for(x=0;x<7;x++)\r
- FCEUD_SetPalette(x,unvpalette[x].r,unvpalette[x].g,unvpalette[x].b);\r
}\r
else\r
{\r
for(x=0;x<64;x++)\r
- FCEUD_SetPalette(x,palo[x].r,palo[x].g,palo[x].b);\r
+ FCEUD_SetPalette(x+128,palo[x].r,palo[x].g,palo[x].b);\r
SetNESDeemph(lastd,1);\r
}\r
}\r
XBuf=(uint8 *)m;
}
*/
- memset(XBuf,128,320*240);
+ memset(XBuf,0,320*240);
return 1;
}