Announcement

Collapse
No announcement yet.

[Mario Kart DS] Problem with 5 type AR code!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Mario Kart DS] Problem with 5 type AR code!

    I've recently been making my own codes for mario kart ds, and i wanted to use an "if" block to make one of my codes.
    However, my code uses a pointer, and for some reason using the offset in the "if" line won't work! if i use a normal address it works ok, but not for an offset.

    I also tried using the 9 type code aswell but it gave the same result.

    Can anyone help?

    Also heres the code:
    6217BC4C 00000000
    B217BC4C 00000000
    5000002C 00000002 <if line
    0000002C 0000000C <code that should run when if above statement is true
    D0000000 00000000
    D2000000 00000000

  • #2
    Off the top...since I've been away from this in a long time. :\
    Code:
    6217BC4C 00000000 // If true
    B217BC4C 00000000 // Load pointer
    D9000000 0000002C // Load data from offset 0x2C (ldr)
    D3000000 00000000 // Clear 'Dx data register'
    D6000000 02000000 // Store data from offset 0x2C (str) into 0x02000000 (or find a block of memory with 'free' space)
    D0000000 00000000 // End If -- [s]Can be omitted if I remember correctly, but I put it there just because...[/s]
    52000000 00000002 // If true
    B217BC4C 00000000 // Reload pointer
    0000002C 0000000C // Write
    D2000000 00000000 // End
    I can't remember if there's an easier way to do it with pointers. Maybe Helder or AsPika remembers.
    I only bother with things that interest me.

    Comment


    • #3
      Thanks for the reply! i tried using the code you provided, but for some reason, the code didn't appear to change the value. I looked at the RAM, and whilst the value of the offset was being stored to the address 02000000, the value of the offset remained constant.

      Comment


      • #4
        I did some testing and it does fail on Desmume. Here's a fix: change that 'end if' to a full 'end'. I guess it can't be omitted.

        Updated:
        Code:
        6217BC4C 00000000
        B217BC4C 00000000
        D9000000 0000002C
        D3000000 00000000
        D6000000 02000000
        [B]D2000000 00000000[/B]
        52000000 00000002
        B217BC4C 00000000
        0000002C 00000000
        D2000000 00000000
        I only bother with things that interest me.

        Comment


        • #5
          I tried the new code and now it works. Thanks for the help!

          Comment


          • #6
            Odd it should have worked the first way since it was a terminator with continuation D0 and not the Full Ender D2. Anyways you got it working and if I remember correctly the I could hardly ever get that D0 Ender to work as it was intended so stick to D2 in the future.
            Spoiler Alert! Click to view...

            THE BAD GUY!!!!!!

            Comment

            Working...
            X