You are not logged in.
Hi,
I made a new build of Desmume for MacOsX, with the latest CVS. Unfortunately, the Intel build does'nt work (I do not have any Intel Mac). So, for Intel mac, launch Desmume under Rosetta.
Link:
http://membres.lycos.fr/jvernet/Softs/software.htm
Jerome
Offline
Hi,
Bad news... My latest build, from the CVS sources doesn't run any commercial ROM, even those marqued as "playable" in the compatibility list. I tried with WarioWare Touched.
But it can run my little "homebrew démo"...
It was working better before. Any help ?
Offline
Define "before" with a CVS revision time, else it's quite futile to search
Offline
Well, it was working for some ROM the last time I build Desmume (circa, 02/2008). Since, some change was made, and I cannot play any ROM, except the little demo I made.
It seems that the CPU emulator hang. Nothing happen, except a blank screen.
Offline
Could you please check out a few older CVS versions and be a bit more exact. Remember I can't debug neither "see" that bug, so try to be 100% concise about which commit is the culprit
Offline
The culprit is the revision 1.36 of NDSSystem.c, 1.35 is working fine.
Patch:
--- src/NDSSystem.c 20 Feb 2008 00:04:51 -0000 1.36
+++ src/NDSSystem.c 28 Mar 2008 14:02:25 -0000
@@ -491,7 +491,7 @@
// Reference: http://nocash.emubase.de/gbatek.htm#dscartridgeheader
for (i = 0; i < ((0x170+0x90)/4); i++)
{
- MMU_write32 (0, 0x027FFE00+i*4, ((u32*)MMU.CART_ROM)[i]);
+ MMU_write32 (0, 0x027FFE00+i*4, LE_TO_LOCAL_32(((u32*)MMU.CART_ROM)[i]));
}
MainScreen.offset = 0;
Last edited by Phazz (2008-03-28 14:09:06)
Offline
Oh, thanks for the patch. I wrote the problematic piece of code, but, obviously, I didn't remember to use the endian safe memory functions I've just committed it to the official CVS
Offline
Yesss !!! It's working, now. Nearly usable on my iBook G4 1.33 Mhz
I will try some ROM, from the compatibility list.
Offline
I guess it's 1.33 Ghz and not Mhz, else you've got a singular piece of hardware there
Offline
I didn't tried to build Desmume on my Apple IIgs.
We still experience some graphical glitch, like this on Warioware on the PPC build:
More over, I will see how I can enable Opengl with the Cocoa build.
Jerome
Offline
Well, probably some stuff isn't still endianess safe. If some active developer with a Mac could work on that, we'd probably get those bugs fixed quite easily: if I had access to any type of Mac hardware, I would do myself
Offline
Give me some hint to look for. Where should I search ?
Offline
I'm currently looking into it.
Offline
Give me some hint to look for. Where should I search ?
If I knew, I'd fix it myself. It's just a matter of looking for memory read/writes that don't use the endian safe functions, which is quite a lot of work considering desmume's size.
I'm currently looking into it.
Nice
Offline
I'm looking for every MMU_WRITE32 to see if there an other example of what Phazz found, but cannot find the same thing.
Does thing like that:
MMU_write32(1, 0x00, 0xE25EF002);
MMU_write32(1, dst, T1ReadLong(MMU.CART_ROM, src));
MMU_write8(cpu->proc_ID, 0x4000300+cpu->proc_ID, cpu->R[0]);
need LE_TO_LOCAL ?
Offline
No, it's a matter of direct memory reading or writing, there's none there.
Offline
I fixed the particular Wario sprites problem, but there is a lot of discoloration, so I'm working on that.
Last edited by Phazz (2008-03-30 12:00:31)
Offline
Can you give us the patch <? Thanks !
Offline
Sure.
--- src/GPU.c 12 Nov 2007 00:41:51 -0000 1.131
+++ src/GPU.c 30 Mar 2008 20:24:41 -0000
@@ -1436,7 +1436,19 @@
u8 block = gpu->sprBoundary;
u16 i;
- for(i = 0; i<nbShow; ++i, --spriteInfo) /* check all sprites */
+#ifdef WORDS_BIGENDIAN
+ *(((u16*)spriteInfo)+1) = (*(((u16*)spriteInfo)+1) >> 1) | *(((u16*)spriteInfo)+1) << 15;
+ *(((u16*)spriteInfo)+2) = (*(((u16*)spriteInfo)+2) >> 2) | *(((u16*)spriteInfo)+2) << 14;
+#endif
+
+ for(i = 0; i<nbShow; ++i, --spriteInfo
+#ifdef WORDS_BIGENDIAN
+ ,*(((u16*)(spriteInfo+1))+1) = (*(((u16*)(spriteInfo+1))+1) << 1) | *(((u16*)(spriteInfo+1))+1) >> 15
+ ,*(((u16*)(spriteInfo+1))+2) = (*(((u16*)(spriteInfo+1))+2) << 2) | *(((u16*)(spriteInfo+1))+2) >> 14
+ ,*(((u16*)spriteInfo)+1) = (*(((u16*)spriteInfo)+1) >> 1) | *(((u16*)spriteInfo)+1) << 15
+ ,*(((u16*)spriteInfo)+2) = (*(((u16*)spriteInfo)+2) >> 2) | *(((u16*)spriteInfo)+2) << 14
+#endif
+ ) /* check all sprites */
{
size sprSize;
s32 sprX, sprY, x, y, lg;
@@ -1671,6 +1683,10 @@
render_sprite_16 (gpu, l, dst, src, pal, prioTab, prio, lg, sprX, x, xdir, spriteInfo->Mode == 1);
}
}
+#ifdef WORDS_BIGENDIAN
+ *(((u16*)spriteInfo)+1) = (*(((u16*)spriteInfo)+1) << 1) | *(((u16*)spriteInfo)+1) >> 15;
+ *(((u16*)spriteInfo)+2) = (*(((u16*)spriteInfo)+2) << 2) | *(((u16*)spriteInfo)+2) >> 14;
+#endif
}
void sprite2D(GPU * gpu, u16 l, u8 * dst, u8 * prioTab)
@@ -1679,7 +1695,19 @@
_OAM_ * spriteInfo = (_OAM_*)(gpu->oam + (nbShow-1));// + 127;
u16 i;
- for(i = 0; i<nbShow; ++i, --spriteInfo)
+#ifdef WORDS_BIGENDIAN
+ *(((u16*)spriteInfo)+1) = (*(((u16*)spriteInfo)+1) >> 1) | *(((u16*)spriteInfo)+1) << 15;
+ *(((u16*)spriteInfo)+2) = (*(((u16*)spriteInfo)+2) >> 2) | *(((u16*)spriteInfo)+2) << 14;
+#endif
+
+ for(i = 0; i<nbShow; ++i, --spriteInfo
+#ifdef WORDS_BIGENDIAN
+ ,*(((u16*)(spriteInfo+1))+1) = (*(((u16*)(spriteInfo+1))+1) << 1) | *(((u16*)(spriteInfo+1))+1) >> 15
+ ,*(((u16*)(spriteInfo+1))+2) = (*(((u16*)(spriteInfo+1))+2) << 2) | *(((u16*)(spriteInfo+1))+2) >> 14
+ ,*(((u16*)spriteInfo)+1) = (*(((u16*)spriteInfo)+1) >> 1) | *(((u16*)spriteInfo)+1) << 15
+ ,*(((u16*)spriteInfo)+2) = (*(((u16*)spriteInfo)+2) >> 2) | *(((u16*)spriteInfo)+2) << 14
+#endif
+ ) /* check all sprites */
{
size sprSize;
s32 sprX, sprY, x, y, lg;
@@ -1915,6 +1943,10 @@
prioTab, prio, lg, sprX, x, xdir, spriteInfo->Mode == 1);
}
}
+#ifdef WORDS_BIGENDIAN
+ *(((u16*)spriteInfo)+1) = (*(((u16*)spriteInfo)+1) << 1) | *(((u16*)spriteInfo)+1) >> 15;
+ *(((u16*)spriteInfo)+2) = (*(((u16*)spriteInfo)+2) << 2) | *(((u16*)spriteInfo)+2) >> 14;
+#endif
}
/*****************************************************************************/
--- src/GPU.h 12 Nov 2007 00:41:51 -0000 1.94
+++ src/GPU.h 30 Mar 2008 20:26:13 -0000
@@ -521,6 +549,27 @@
typedef struct
{
+#ifdef WORDS_BIGENDIAN
+// attr0
+/* 0*/ unsigned Y:8;
+/*14*/ unsigned Shape:2; // (00: Square, 01: Wide, 10: Tall, 11: Illegal)
+/*13*/ unsigned Depth:1; // (0: 16, 1: 256)
+/*12*/ unsigned Mosaic:1; // (1: Enabled)
+/*10*/ unsigned Mode:2; // (00: Normal, 01: Transparent, 10: Object window, 11: Bitmap)
+/* 8*/ unsigned RotScale:2; // (00: Normal, 01: Rot/scale, 10: Disabled, 11: Double-size rot/scale)
+// attr1
+/* 0*/ signed X:9;
+/*14*/ unsigned Size:2;
+/*13*/ unsigned VFlip:1;
+/*12*/ unsigned HFlip:1;
+/* 9*/ unsigned RotScalIndex:3; // Rot/scale matrix index
+// attr2
+/* 0*/ unsigned TileIndex:10;
+/*12*/ unsigned PaletteIndex:4;
+/*10*/ unsigned Priority:2;
+// attr3
+unsigned attr3:16;
+#else
// attr0
/* 0*/ unsigned Y:8;
/* 8*/ unsigned RotScale:2; // (00: Normal, 01: Rot/scale, 10: Disabled, 11: Double-size rot/scale)
@@ -540,6 +589,8 @@
/*12*/ unsigned PaletteIndex:4;
// attr3
unsigned attr3:16;
+#endif
+
} _OAM_;
typedef struct
It does create noticeable overhead, though.
Last edited by Phazz (2008-03-30 22:00:27)
Offline
Do we have an ETA for a working build, guys?
And by the way, hi all devs, you're great
Offline
espire: As long as something involves me (mainly something with the emulation core), there's no ETA, but I will try to apply phazz and jvernet patches as fast as possible.
Offline
It's looking a lot better, but is far more slower !
Offline
It's looking a lot better, but is far more slower !
Well, now that something's actually being rendered this shouldn't be surprising.
Offline
it appears that the link to the file on jvernet's website is incorrect. It takes me to a page saying that the file is not there. any chance on an updated link?
Offline
Link fixed, sorry !
Offline