Emuforums.com

Go Back   Emuforums.com > Handheld Emulation > DeSmuME Discussion
About Us Register FAQ Members List Calendar Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old July 3rd, 2008   #361 (permalink)
Emu author
 
shashClp's Avatar
 
Join Date: Sep 2006
Location: VisualC
Posts: 749
Quote:
Originally Posted by NHervé View Post
Shash : before, DeSmuME was written in C++. Why did you rewrite it to pure C ? I always thought that C++ was faster.
I didn't, my 3D core was written in C++ (and still is on my build, with the texture cache being C++ and the math helpers being C++ also), and my build uses C++. I don't know the exact reasons to loose such a large amount of time porting it over C (maybe due to most know machines have at least a C compiler, maybe due to author preference, don't know), but it was done by the Desmume team (CyberwarriorX, Guillaume, etc), not me, and it's something I definitely don't support.
__________________
Emulator development blog
shashClp is offline   Reply With Quote
Old July 4th, 2008   #362 (permalink)
Plugin author
 
NHervé's Avatar
 
Join Date: Jul 2007
Location: Nulle part
Posts: 518
Ah, okay. Do you think C++ is faster than C ?
__________________
No pity for n00bs here !
NHervé is offline   Reply With Quote
Old July 4th, 2008   #363 (permalink)
Emu author
 
shashClp's Avatar
 
Join Date: Sep 2006
Location: VisualC
Posts: 749
Quote:
Originally Posted by NHervé View Post
Ah, okay. Do you think C++ is faster than C ?
They should be comparable as long as you don't abuse certain stuff (mainly abstract classes and other stuff that can only be resolved during runtime). I mainly code C++ because I'm more productive with it. I've coded on C for almost a decade, but now I prefer C++.
__________________
Emulator development blog
shashClp is offline   Reply With Quote
Old July 4th, 2008   #364 (permalink)
Plugin author
 
NHervé's Avatar
 
Join Date: Jul 2007
Location: Nulle part
Posts: 518
Okay.

After some debugging on Worms2, I noticed it's always reading/writing to some IRQ/timer related I/O regs (namely IME, IE, IF, TM0CNT_L, TM1CNT_H). So I think the problem COULD be related to timers/IRQs, this isn't sure at all, it needs more debugging, especially on which proc is this happening and also what values are read/written.
__________________
No pity for n00bs here !

Last edited by NHervé; July 4th, 2008 at 21:56. Reason: Automerged Doublepost
NHervé is offline   Reply With Quote
Old July 10th, 2008   #365 (permalink)
Plugin author
 
NHervé's Avatar
 
Join Date: Jul 2007
Location: Nulle part
Posts: 518
Some news :

Before releasing Mod 4, I'll be focused on fixing Rayman DS. The game works, but instead of the "press start" screen, there's a black screen, and when I press Start, the game does strange things, like overwriting data at some memory locations. For the black screen, I noticed that the game sends data to the 3D core and all of these data seem valid, except the vertex coordinates that are always zero (don't know why, it needs more debugging).

Anyway, I've fixed one of the big bugs of Mario Party : the players were "not fully visible", even almost invisible. After doing some logging, I noticed that the game was changing material colors for each vertex. I thought that it wasn't allowed in OpenGL. While searching a way to do this, I found the official description page for glMaterial. I read there that OpenGL allows, just like the DS, to call glMaterial between glBegin and glEnd in order to set a material color per vertex.
The bug was that the 3D core was stopping and resuming vertex list at each glMaterial call. Try drawing some geometry with OpenGL, and calling glEnd and glBegin between each vertex. OpenGL won't draw anything. Here the problem was the same. So I modified the 3D core to don't stop vertex list at each glMaterial call, and then the characters in Mario Party now look correct.
There're still some bugs in this game : some lighting bugs, and the star being badly placed and giant !
Here're two shots of Mario Party, I let you guess which one is the fixed one. :P
Attached Images
File Type: jpg marioparty1.JPG (33.2 KB, 38 views)
File Type: jpg marioparty2.JPG (41.4 KB, 41 views)
__________________
No pity for n00bs here !

Last edited by NHervé; July 10th, 2008 at 18:14.
NHervé is offline   Reply With Quote
Old July 15th, 2008   #366 (permalink)
Plugin author
 
NHervé's Avatar
 
Join Date: Jul 2007
Location: Nulle part
Posts: 518
I found an interesting thing with Rayman DS : this game uses DMAs in Repeat mode, and DeSmuME doesn't seem to support this feature. I'll try to implement it, maybe it's the cause of the vertices with zero-coords, data overwriting and a lot of other strange memory operations.
__________________
No pity for n00bs here !
NHervé is offline   Reply With Quote
Old July 16th, 2008   #367 (permalink)
Emu author
 
shashClp's Avatar
 
Join Date: Sep 2006
Location: VisualC
Posts: 749
Quote:
Originally Posted by NHervé View Post
I found an interesting thing with Rayman DS : this game uses DMAs in Repeat mode, and DeSmuME doesn't seem to support this feature. I'll try to implement it, maybe it's the cause of the vertices with zero-coords, data overwriting and a lot of other strange memory operations.
Afaik, it's supported. Source code reference (line 2838-2839):

Code:
if(!(MMU.DMACrt[proc][num]&(1<<25)))
        MMU.DMAStartTime[proc][num] = 0;
__________________
Emulator development blog
shashClp is offline   Reply With Quote
Old July 16th, 2008   #368 (permalink)
Plugin author
 
NHervé's Avatar
 
Join Date: Jul 2007
Location: Nulle part
Posts: 518
Did you check it with a homebrew or any other sort of test ?
It seems that the DMAs are stopped when word count has been reached, no matter if they're in repeat mode. The code you're showing only sets start mode to 0 (start immediately) if DMA isn't in repeat mode.
__________________
No pity for n00bs here !
NHervé is offline   Reply With Quote
Old July 16th, 2008   #369 (permalink)
Emu author
 
shashClp's Avatar
 
Join Date: Sep 2006
Location: VisualC
Posts: 749
That's because DMA on mode zero, start only when the control word is written. Repeat mode is only meant for DMAs on VBlank/timers/etc, which is why it is reset to immediate mode: this way, it won't repeat. Thus my code shows that repeat is correctly emulated, afaik. You're free to prove me wrong, though, but I don't recommend you re-implementing things that already work based only on assumptions.
__________________
Emulator development blog
shashClp is offline   Reply With Quote
Old July 16th, 2008   #370 (permalink)
Plugin author
 
NHervé's Avatar
 
Join Date: Jul 2007
Location: Nulle part
Posts: 518
Okay, I believe you, I tried changing some things, but it didn't solve anything, so I reverted my changes.
__________________
No pity for n00bs here !
NHervé is offline   Reply With Quote
Old July 18th, 2008   #371 (permalink)
Plugin author
 
NHervé's Avatar
 
Join Date: Jul 2007
Location: Nulle part
Posts: 518
Hi ! What do you think if 3D renderer was having its own thread ?
This could work, since it only requires synch with VBlank when swapping rendering buffers. (this synch is missing and this causes 3D screens to be reversed when there're 3D graphics on both screens).
I think this would give some speed-up, even if minor (at least on dual-cores), but I would like to do this mainly for accuracy purposes (correct gfx fifo (render queue) and irq emulation, synch on VBlank, would fix "Mario&Sonic at the Olympic Games").
__________________
No pity for n00bs here !
NHervé is offline   Reply With Quote
Old August 28th, 2008   #372 (permalink)
Registered User
 
Join Date: Nov 2007
Location: NZ
Posts: 11
NHervé,

Why don't you join the official desmume team? wouldn't it be better than releasing a seperate mod?
Normmatt is offline   Reply With Quote
Old August 28th, 2008   #373 (permalink)
Eric Cartmenez
 
dreampeppers99's Avatar
 
Join Date: Jul 2006
Location: you know...
Posts: 381
Yes, Normatt saids all!!!
__________________
OS: Windows XP Professional SP2 (32bits)
CPU: Athlon XP 2400+ (2.0 Ghz)
Graphics Card: ATI X1650 Pro 512MB
Memory: 1GB DDR
dreampeppers99 is offline   Reply With Quote
Old August 30th, 2008   #374 (permalink)
Plugin author
 
NHervé's Avatar
 
Join Date: Jul 2007
Location: Nulle part
Posts: 518
I'm wondering if I'll do this.
__________________
No pity for n00bs here !
NHervé is offline   Reply With Quote
Old August 31st, 2008   #375 (permalink)
Registered User
 
Join Date: Nov 2007
Location: NZ
Posts: 11
If you do be sure you join the official irc channel on freenode #desmume
Normmatt is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 21:07.

© 2006 - 2008 Emu Forums | About Emu Forums | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.7.0 Release Candidate 3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5