New to Gecko OS code making, need a little help

Started by LRFLEW, November 22, 2009, 10:43:22 PM

Previous topic - Next topic

LRFLEW

I want to make a code (actually, I want to mess with a few codes to make new ones (to start off with)(I won't be taking credit for them)), but I can't find a few things about how the codes work. 

1)  Is there/Where is a guide that says how each code acts.  Can you put a list of how each kind of line of code does? 

2)  How can I access what button is pressed?  Is the ram spot different per game or controller configuration?  I am really lost here. 

Thank you. 
LRFLEW

Romaap

You can find the different codetypes here.

The addresses for which button is pressed differs per game, this guide should give some more information about button activators.

LRFLEW

Quote from: Romaap on November 22, 2009, 11:01:12 PM
You can find the different codetypes here.

The addresses for which button is pressed differs per game, this guide should give some more information about button activators.

This is all great, but two more things...

here there appear to be two codes for everything.  What's the difference? 

this is really good and in depth, but I can't get WiiRD to work for now.  Does anybody just know what the button activators are for SSBB p1 using the sideways remote? 

Thank you. 
LRFLEW

Romaap

What do you mean with two codes for everything?

LRFLEW

#4
Quote from: Romaap on November 23, 2009, 12:09:55 AM
What do you mean with two codes for everything?
QuoteCST0: 8bits Write & Fill
00______ YYYY00XX : 8bits ram write and fill (ba) writes XX YYYY+1 times at ba+address

10______ YYYY00XX : 8bits ram write and fill (po) writes XX YYYY+1 times at po+address

What's the difference?

Romaap

00xxxxxx writes to xxxxxx + the Base Address (ba) and 10xxxxxx writes to xxxxxx + the Pointer Offset (po)
Basically the ba is for normal codes and po is for pointer codes.

LRFLEW

Quote from: Romaap on November 23, 2009, 01:53:11 AM
00xxxxxx writes to xxxxxx + the Base Address (ba) and 10xxxxxx writes to xxxxxx + the Pointer Offset (po)
Basically the ba is for normal codes and po is for pointer codes.

Wow, that clarifies alot. 

Now, where would I go for the button activators for SSBB? 

Romaap

You would have to look in the SSBB code thread and look for a code that is already button activated.
It would probably be the first line and start with an 2, like:
204A8370 0000A000

LRFLEW

#8
Quote from: Romaap on November 23, 2009, 02:51:40 AM
You would have to look in the SSBB code thread and look for a code that is already button activated.
It would probably be the first line and start with an 2, like:
204A8370 0000A000

I think I get it.  Does it work if...

Quote from: Full Metal KirbyWiimote Inputs (Note: This is assuming you're holding the Wiimote sideways.)

0000 - None
0001 - Down
0002 - Up
0004 - Right
0008 - Left
0010 - +
0100 - 2
0200 - 1
0400 - B
0800 - A
1000 - -
2000 - Z (Nunchuck)
4000 - C (Nunchuck)
8000 - Home Button

Quote from: hetoan2Wii Controller
1) 284F7880

...and...

4A000000 90180F08
1000002E 000000XX
E0000000 80008000


If I want to have it where I press A, and XX=10, otherwise XX=00.  Does this work? 

4A000000 90180F08
284F7880 00000800
1000002E 00000010
284F7881 00000800
2A4F7880 00000800
1000002E 00000000
2A4F7881 00000800
E0000000 80008000


I don't know if I terminated the "if" correctly. 

Edit:  Something is wrong; it doesn't work. 

Romaap

#9
You put way to much if statements in that code.
This is what you are doing:

4A000000 90180F08 ; change po
284F7880 00000800 ; only execute the rest of this code (before the endif) if A is pressed
1000002E 00000010 ; write 10 somewhere
284F7881 00000800 ; endif, execute rest of the code (before the endif) if A is pressed
2A4F7880 00000800 ; execute rest of the code (before the endif) if A is not pressed
1000002E 00000000 ; write 0 somewhere
2A4F7881 00000800 ; endif, execute rest of the code (before the endif) if A is not pressed
E0000000 80008000 ; endif, reset the po

in something like C this would be something like this:

change_po();  //change po
if(A is pressed)
{
   write(); //write 10 somewhere
}
if(A is pressed)
{
   if(A is not pressed)
   {
      write(); //write 0 somewhere
   }
   if(A is not pressed)
   {
   }
}

LRFLEW

Quote from: Romaap on November 23, 2009, 11:31:35 PM2A4F7880 00000800 ; execute rest of the code (before the endif) if A is pressed

Wouldn't it be "execute rest of the code (before the endif) if A is NOT pressed"? 

Anyways, Does this work? 

4A000000 90180F08
284F7880 00000800
1000002E 00000010
E2100001 00000000
1000002E 00000000
E2000001 80008000

Romaap

Oops, you're right. I edited it in my previous post :)

That code looks a lot better, I'm not sure if it would work but I think it will.
But what you could also do is:
always write 0
when A is pressed
write 10


BTW, do you keep in mind that you actually write 16 and not 10?
Because the values in the codes are always in hex.

LRFLEW

#12
Quote from: Romaap on November 24, 2009, 12:42:27 AMI'm not sure if it would work but I think it will.

Nope.  Will try other suggestion.  (I actually didn't know that would work because I thought having conflicting writes would crash it). 

Post Merge: November 24, 2009, 02:27:32 AM

Quote from: Romaap on November 24, 2009, 12:42:27 AM
But what you could also do is:
always write 0
when A is pressed
write 10

4A000000 90180F08
1000002E 00000000
284F7880 00000800
1000002E 00000010
E2000001 80008000


Strangest thing happened. 

Did I ever tell you what the code does?  It's designed that when the A button is pressed (taunt using sideways controller), It would cause mass spawning of items.  When not pressed, stop items altogether.  (SSBB)

This code made it so that no items spawned, but if I pressed A, occasionally, an Item would spawn (0x10 is suppose to make the spawn rate at W.T.F. speed).  I am totally lost here :confused:. 

P.S.  I tried the code alone.  Maybe 0x10 is a little to much :o.