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 > Ideas emulator debug output and breakpoint via swi calls

#166702 - a128 - Sun Feb 15, 2009 12:32 pm

Since Ideas 1.0.2.8 beta there are calls to output strings on the debug console of the emulator, and you can trigger breakpoints.

From the changelog:
# Added program breakpoint (SWI #0xFDFDFD).
# Added output on console for user's messages (SWI #0xFCFCFC).


So I used this functions , and it works fine on windows. on linux it also works , but you have to open the debug window first. Lino will bug fix the linux version soon.

it has to be in ARM mode
Code:

 .global ideasMessage
    .arm
//---------------------------------------------------------------------------------
//ideas  1.0.2.8  debug output function
//---------------------------------------------------------------------------------
ideasMessage:  // params = { string }
//---------------------------------------------------------------------------------
 
 
      //  ldr     r0,=buffer  // get buffer address
         swi     0xfcfcfc
          bx      lr          // exit
 
     .thumb
        .global ideasBreak
   .arm
//---------------------------------------------------------------------------------
ideasBreak:   
         swi     0xfdfdfd
    bx      lr          // exit
 
    .thumb
//---------------------------------------------------------------------------------
        .pool

#166704 - Maxxie - Sun Feb 15, 2009 2:20 pm

Any reason you didn't use the BKPT instruction?
_________________
Trying to bring more detail into understanding the wireless hardware

#166706 - a128 - Sun Feb 15, 2009 2:54 pm

Maxxie wrote:
Any reason you didn't use the BKPT instruction?


I only used the message print function. which Is great. about BKPT ?! well, maybe Lino just forgot this ARM feature?!

I do not know.