In memory of Ben “bushing” Byer, who passed away on Monday, February 8th, 2016.

Difference between revisions of "Talk:List of homebrew applications"

From WiiBrew
Jump to navigation Jump to search
Line 142: Line 142:
  
 
The function names are mangled because this is C++ code.  See http://en.wikipedia.org/wiki/Name_mangling#Name_mangling_in_C.2B.2B
 
The function names are mangled because this is C++ code.  See http://en.wikipedia.org/wiki/Name_mangling#Name_mangling_in_C.2B.2B
The address of the first instruction of Render() is at 02d0.  This is also line 158 in the file (".loc 1 18 0").  To find the error location, just look at 0x2d0 + 72 = 0x318.  See below:
+
The address of the first instruction of Render() is at 02d0.  This is also line 158 in the file (".loc 1 158 0").  To find the error location, just look at 0x2d0 + 72 = 0x318.  See below:
  
 
                                 .loc 1 168 0
 
                                 .loc 1 168 0

Revision as of 01:32, 24 April 2008

Snes9xGX

Is it possible to launch Snes9xGX via Twilight Hack's ELF Loader or not?

i think you need one of the tools from Segher's_Wii.git to convert dol to an elf

if you get it to work, please share! -- PidGin128 as 65.190.210.163 23:08, 13 March 2008 (PDT)

Table Wiki code

was gonna make a chart but this one already exists. heres the code i stole.

Wii Homebrew Chart
Title Creator Software type Loaders Chainloader Install Loader Return PAL Modes Required Accessories
Test Tesy
Tetris Wii DesktopMan Game Zelda Normal L Button 480i/p NGC Controller

also, fancy captcha is annoying. PidGin128 as 65.190.210.163 23:08, 13 March 2008 (PDT).

Don't you think we should add a version column?

It needs a column with the compatibility of the Wiimote.

Tar

Is it possible to offer a .zip download in addition to whatever tar files are provides? Not everyone has administrative privileges on the pc's they use. For instance even though I'm in college we are monitored heavily on what we use the library pc's for. it's against the rules to install programs on the computer. I would need to install a program in order to decompress any tar file. I love linux and would have a linux machine right now if my last one wasn't destroyed, but windows can not natively read tar files with the installation of some type of program. Windows, linux and macs all support zip files. Zip files aren't exactly too large, they're larger than tar, but not that much. When you're dealing with the file sizes this wiki uses a less capable compresser isn't really going to make you or break you when it comes to its file size. ~gametaku5@gmail.com

Use 7-Zip Portable from a flash drive to extract tar files. You don't need to install it. -- 86.41.192.208 10:50, 14 March 2008 (PDT)

GC SD and Wii SD slots hombrew apps

Is it perhaps best to now section homebrew to ensure they are identified as loading from the GC or Wii SD slot, even until they are perhaps updated to load data from the Wii SD slot?

Versions

I think it would be a good idea to keep the versions up to date in the table.

Loader return

I think its a good idea to say that if possible could dev's include someway of returning to the loader, otherwise you have to reboot you wii to exit

It only even takes 2 lines of code. Declare the function:
void (*reload)() = (void(*)())0x90000020;
and call it:
if(PAD_ButtonsDown(0) & PAD_BUTTON_START) reload();
and voila.
I strongly disagree with this design. Just do what normal cli applications do, they return from main. But that might not work at this moment. Also, that design slowly but surely causes a stack overflow by infinite recursion, not good.--henke37 12:55, 17 April 2008 (PDT)

Type in table?

Since every thing is sorted by type, why do we still need to keep the type of application in the table?

Agreed
Seconded. 198.166.12.229 12:52, 17 April 2008 (PDT)

Homebrew Developer Tips and Suggestions

Here's my proposal for Homebrew Developer Tips and Suggestions. -- PaceMaker

Video Auto-Detect Routine

Please include an autodetect routine (VIDEO_GetCurrentTVMode()) to detect HDTV/EDTV and set the appropriate video mode.

The current video autodetect routine doesn't work with PAL60 (480p @ 60 Hz in PAL Wii) using the offical Nintendo RGB cable for Wii.

Here is the video detect code from the DevKitPro Wii example.

   switch(VIDEO_GetCurrentTvMode())
   {
       case VI_NTSC:
           rmode = &TVNtsc480IntDf;
       break;
       case VI_PAL:
           rmode = &TVPal528IntDf;
       break;
       case VI_MPAL:
           rmode = &TVMpal480IntDf;
       break;
       default:
           rmode = &TVNtsc480IntDf;
       break;
   }
   VIDEO_Configure(rmode);

Exit to Loader

It's a good idea to add some way to return to the loader, otherwise you have to reboot you Wii to exit.

   It only even takes 2 lines of code. Declare the function: 
   void (*reload)() = (void(*)())0x90000020; 
   and call it: 
   if(PAD_ButtonsDown(0) & PAD_BUTTON_START) reload(); 
   and voila.

Note, that this method can eventually cause a stack overflow by infinite recursion. I don't know a better way to do this though.

Debugging Tip

When faced with a crash in your Homebrew, often you'll see a code dump with an address and some machine code. Here's my trick to track that back to a line of C++ code.

For example if your homebrew game crashes it might show something like this:

    CODE DUMP:
    
    800084ac:   809F0020 2F840000 ...
    800084bc:   ...
    800084cc:   ...

The 800084ac is the memory address in hex of where the crash occured. 809F0020 is the machine code for the offending instruction.

  • Step 1:

In your makefile change the CXXFLAGS line to the following:

  CXXFLAGS = -save-temps -Xassembler -aln=$@.lst $(CFLAGS)

The "-save-temps" will save the assembly language file, which can be interesting. The "-Xassembler -aln=$@.lst" creates a list file which contains the assembly and the machine code. Now recompile your entire project. Note, this just affects C++ code.

  • Step 2:

Look at the map file that was built. The mapfile is on by default in the Wii template makefile. Typically it's in the build subdirectory and called something.map. Look in that mapfile for the nearest memory address that doesn't go over the one found in the CODE DUMP. Here is an example:

    0x80008464                ShooterView::Render(BibGraphicsDevice&)

This tells me that the crash was 72 bytes into the ShooterView::Render() function. Now to find the line number in Render()

  • Step 3:

Look at the list file for the relevant function. Here's an example:

   473              		.globl _ZN11ShooterView6RenderER17BibGraphicsDevice
   474              		.type	_ZN11ShooterView6RenderER17BibGraphicsDevice, @function
   475              	_ZN11ShooterView6RenderER17BibGraphicsDevice:
   476              	.LFB1465:
   477              		.loc 1 158 0
   478              	.LVL20:
   479 02d0 9421FF00 		stwu 1,-256(1)

The function names are mangled because this is C++ code. See http://en.wikipedia.org/wiki/Name_mangling#Name_mangling_in_C.2B.2B The address of the first instruction of Render() is at 02d0. This is also line 158 in the file (".loc 1 158 0"). To find the error location, just look at 0x2d0 + 72 = 0x318. See below:

                               .loc 1 168 0
   528 0314 809F0020 		lwz 4,32(31)
   529 0318 2F840000 		cmpwi 7,4,0

This shows machine address 0x318 has the proper machine code and the nearest .loc statement says the problem is at line 168 of the ShooterView.cpp.