gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Desmume source maintainer

#112823 - Mighty Max - Wed Dec 20, 2006 3:45 pm

Heya,

ive searched the web for the current desmume maintainer, and failed.

What ive found so far, is a defect source for 0.4.0 (by "NDS") and a working source from 0.3.3 (sourceforge.net)

Is there someone who keeps the sources together right now? I got a fix for a bug it has (better: missing feature) and it would be a waste if i were the only one who is able to use the fixed version.
_________________
GBAMP Multiboot

#112824 - Sausage Boy - Wed Dec 20, 2006 3:51 pm

The sourceforge guys sound a lot more credible. If I remember correctly, that was where simon sent his debugging stuff.
_________________
"no offense, but this is the gayest game ever"

#112828 - Mighty Max - Wed Dec 20, 2006 4:59 pm

Sent that to them now, gonna look what happens.

virtual16 should be able to run on desmume with the patch implemented :)
_________________
GBAMP Multiboot

#112829 - Sausage Boy - Wed Dec 20, 2006 5:00 pm

Good job!
_________________
"no offense, but this is the gayest game ever"

#112884 - Normmatt - Thu Dec 21, 2006 3:45 am

So what exactly does this fix/add?

#112896 - OOPMan - Thu Dec 21, 2006 8:49 am

Check the thread on "Dynamically Loading & Executing Code" for details Normmatt...
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI

You can find my NDS homebrew projects here...

#112901 - Mighty Max - Thu Dec 21, 2006 11:20 am

Normmatt wrote:
So what exactly does this fix/add?


The handling of SWI.

Desmume uses internal function to emulate the bios. Thats a good solution, but it fails when the bios vector was changed by the cp15. The lil patch detects such relocated vectors and jumps to the new biosrange instead of using the internal functions.

:edit: Its GPLed anyways, the patch (arm swi & thumb changes the same)
Code:

//--------------SWI-------------------------------
static u32 FASTCALL  OP_SWI(armcpu_t *cpu)
{
     int translated = (cpu->intVector != 0) ^ (cpu->proc_ID == 0) ;
     if (translated) {
              /* we use an irq thats not in the irq tab, as it was replaced duie to a changed intVector */       
            Status_Reg tmp = cpu->CPSR;
            armcpu_switchMode(cpu, SVC);
            cpu->R[14] = cpu->R[15] - 4 ;           /* jump to swi Vector */
            cpu->SPSR = tmp;                        /* save old CPSR as new SPSR */
            cpu->CPSR.bits.T = 0;                   /* handle as ARM32 code */
            cpu->CPSR.bits.I = cpu->SPSR.bits.I ;   /* keep int disable flag */
            cpu->R[15] = cpu->intVector + 0x08;
            cpu->next_instruction = cpu->R[15] ;
             return 4;
     } else {
          unsigned long swinum = (cpu->instruction>>16)&0x1F;
          return cpu->swi_tab[swinum](cpu) + 3; 
     }
}

_________________
GBAMP Multiboot