Wow notaz, nice to see you here. We have tracked down the problem. The function to copy data from RAM to VRAM (copied from Shiru) was randomly causing the problems:
Code: Select all
u16 vram_copy(u16 adr,const void *data,u16 size)
{
volatile u16 *pw;
volatile u32 *pl;
u32 src;
pw=(u16*)GFXCNTL;
*pw=0x9300+((size>>1)&0xff);
*pw=0x9400+((size>>9)&0xff);
src=(u32)data;
*pw=0x9500+((src>>1)&0xff);
*pw=0x9600+((src>>9)&0xff);
*pw=0x9700+((src>>17)&0x7f);
busreq_on();
pl=(u32*)GFXCNTL;
*pl=GFX_DMA_VRAM((u32)adr);
busreq_off();
return adr+size;
}
I replaced the code to copy data with a DMA transfer, and all the problems are gone!
Code: Select all
u16 vram_copy(u16 adr,const void *data,u16 size)
{
VDP_doVRamDMA((u32)data, adr, size>>1);
return adr+size;
}
About the fail in Picodrive, this is de PND log:
Code: Select all
=======================================================================================
PND : /media/IORI_PANDORA/pandora/menu/PicoDrive_180pxml_tv.pnd
PND_FSTYPE : Squashfs
APPDATADIR : /media/IORI_PANDORA/pandora/appdata/picodrive.notaz.1.80
APPDD_FSTYPE : ext2
PND_CPUSPEED : <unset>
EXENAME : PicoDrive.run
ARGUMENTS : <unset>
=======================================================================================
[ START ]--- Mount the PND ----------
Mounting : mount -t squashfs -o ro "/dev/loop0" "/mnt/utmp/picodrive.notaz.1.80"
Mounting the Union FS : mount -t aufs -o exec,dirs="/media/IORI_PANDORA/pandora/appdata/picodrive.notaz.1.80=rw+nolwh":"/mnt/pnd/picodrive.notaz.1.80=rr" none "/mnt/utmp/picodrive.notaz.1.80"
[SUCCESS]--- Mount the PND ----------
[ START ]--- Starting the application (PicoDrive.run ) ----------
oshide: open /dev/tty: No such device or address
Segmentation fault
open /dev/tty: No such device or address
[ FAILED]--- Starting the application (PicoDrive.run ) ----------
[ START ]--- Restoring the frame buffer status ----------
[SUCCESS]--- Restoring the frame buffer status ----------
[ START ]--- uMount the PND ----------
[ START ]--- Waiting the Union to be available ----------
[SUCCESS]--- Waiting the Union to be available ----------
auplink:plink.c:223: AUFS_CTL_PLINK_MAINT: Inappropriate ioctl for device
rmdir: failed to remove `/mnt/utmp/picodrive.notaz.1.80': Device or resource busy
[ START ]--- Waiting the PND mount dir to be free ----------
[SUCCESS]--- Waiting the PND mount dir to be free ----------
cleanup done
[SUCCESS]--- uMount the PND ----------
=======================================================================================
Return code is : 2
I can't see how the vram_copy function code could depend on something done at initialization. In the tests we have done, the function worked perfect for some segments of the game, and halted the system other times. Why it always worked with Everdrive and most emulators? Why it always worked when doing hotswap with a commercial game? It's a really really weird problem.