Announcement

Collapse
No announcement yet.

help: AR NDS is possible mutiply on ar code?

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

  • help: AR NDS is possible mutiply on ar code?

    exist a AR Adress that multiply the value stored with
    DA000000 XXXXXXXX function?
    ?

    like DA000000 01234567 (and the value is 400)
    then 400 * 100 = 40000
    and save the value back
    like D7000000 01234567
    ??

  • #2
    No; you would have to use ASM to multiply.
    I only bother with things that interest me.

    Comment


    • #3
      and where i find the material to learn NDS ASM?

      Comment


      • #4
        Honestly, I've never came across a good tutorial for ARM ASM; however, a friend of mine named Siestacat and I wrote a beginners ASM tutorial for NDS located here. We haven't really updated that tutorial in awhile so if there are grammar errors or anything, please let me know so I can fix them.

        Also, you should look into studying the ARM Instruction Set.
        I only bother with things that interest me.

        Comment


        • #5
          i have a 2 questions,
          the ds asm is
          instruction destination,source
          or
          instruction source,destination

          and the use o [] (what they realy do)

          Comment


          • #6
            Originally posted by TheAleG View Post
            i have a 2 questions,
            the ds asm is
            instruction destination,source
            or
            instruction source,destination
            Example:
            Code:
            add     r0,r2,r1          ;@r0 = r2 + r1
            Originally posted by TheAleG View Post
            and the use o [] (what they realy do)
            I always looked at the brackets as "into."

            Example:
            Code:
            ldr     r0,[r2,r1]        ;@load  r0 into r2 + r1
            str     r0,[r2,r3]        ;@store r0 into r2 + r3
            I only bother with things that interest me.

            Comment


            • #7
              for learn i will use a rune factory 3 code
              ldr r0,BagSlot1
              ldrh r1,ItemGold
              strh r1,[r0]
              bx lr

              BagSlot1:
              .long 0x023139BC
              ItemGold:
              .short 0x06DE

              so its load on r0 the adress of bag slot 1
              load on r1 the value of gold ore + 1unit (2DE + 400) 2de is the "item id" and 400 is has 1 of it (so item id+400=1 item id+800=2 etc... ) (in hex)
              store the value in r1 into r0
              end code

              define
              so this code is ok? it will add the value defined in r1 on r0?

              Comment


              • #8
                when i run the code on no$gba
                i get 2 error on no$gba

                unknown command on line 9
                unexpected end of file

                i did something wrong?

                Comment


                • #9
                  Originally posted by TheAleG View Post
                  for learn i will use a rune factory 3 code


                  so this code is ok? it will add the value defined in r1 on r0?
                  Yes; in other words, that code looks like this:

                  Code:
                  123139BC 000006DE
                  Originally posted by TheAleG View Post
                  when i run the code on no$gba
                  i get 2 error on no$gba

                  unknown command on line 9
                  unexpected end of file

                  i did something wrong?
                  How are you compiling the ASM?

                  The Code should compile to:
                  Code:
                  023FE074 012FFF11
                  E0000000 00000016
                  E59F0008 E1DF10B8
                  E1C010B0 E12FFF1E
                  023139BC 000006DE
                  023FE074 E3520003
                  I don't think NO$GBA supports Kenobi's ARDS Hack #4 so you will have to either patch the ROM with the code, use your flash cart, or ARDS and retail cart if you have it.
                  I only bother with things that interest me.

                  Comment


                  • #10
                    the no$gba was a option to load asm
                    so i used it

                    Comment


                    • #11
                      well the code work
                      but

                      i'm making a code that change the "upgraded item"
                      since you update 9times

                      but
                      1 need
                      4 upgrade store address
                      9 inventory address
                      2 multiply address
                      1 subtract address

                      and the code become tooooooooooooooo long in r1 to r40
                      there a way to reuse the "r"

                      like i want in this code:

                      ldr r0,BagSlot1E1
                      ldr r1,BagSlot4
                      ldr r2,Mul1
                      mov r3,#0
                      str r1,[r3]
                      sub r3,r2
                      str r3,[r0]
                      ldr r1,BagSlot5
                      str r1,[r3]
                      sub r3,r2
                      mul r4,r3,r2
                      str r4,[r0]
                      ldr r1,BagSlot5
                      ldr r2,Mul2
                      str r1,[r3]
                      sub r3,r2
                      mul r4,r3,r2
                      str r4,[r0]
                      bx lr

                      Comment


                      • #12
                        Some of those lines there like the sub r3,r2 don't even need to be there since you are making r3 have #0 then its doing nothing but taking up space in your code and all you need to do is look up push and pop instructions. Basically you push the registers into the stack which is temporary holding area then once you need those registers back with the values you originally pushed to stack then you pop them back. Look some info on those 2 instructions and also look at your code more closely.
                        Spoiler Alert! Click to view...

                        THE BAD GUY!!!!!!

                        Comment


                        • #13
                          There's no such thing as an "r40" in ARM9 ASM. What is the code supposed to do? I need a more thorough explanation than "i'm making a code that change the 'upgraded item' since you update 9 times" if you need further assistance.
                          I only bother with things that interest me.

                          Comment


                          • #14
                            since i don't know if the r3 was been used by the game i clean it first
                            the game store the id of item used on upgrade in 3 addresses
                            then if i put a item on a slot i will store on that address
                            if i try to use a code to store 1 value, it's ok but, if i try 2 or 3 i can't store since there a limit of "r#"
                            so there a way of change the address hold on r0 for exemple?

                            Comment


                            • #15
                              I still don't understand what you're trying to do. Is English your first language? Anyway, you can reuse registers once you're done using them.

                              Example:
                              Code:
                              ldr     r0,address_one
                              mov     r1,#0xFF
                              strb    r1,[r0]
                              ldr     r0,address_two
                              mov     r1,#0x0
                              strb    r1,[r0]
                              bx      lr
                              
                              address_one:
                              .long 0x02000000
                              address_two:
                              .long 0x021C0000
                              I only bother with things that interest me.

                              Comment

                              Working...
                              X