Results 1 to 10 of 39

Thread: Still Need ASM Help

Hybrid View

  1. #1

    Cool Still Need ASM Help

    I tried making a code involving checks, but my game freezes. It's supposed to check the slots that are empty and put a hockey mask in all of those slots.

    Here's what I did:

    First source (froze):
    Code:
    removed
    Second source (does nothing):
    Code:
    removed

    Please help me so I can continue learning ASM.
    Last edited by Demonic722; 06-14-2010 at 06:51 PM.
    3DS Friend Code: 4699-6293-3106

  2. #2

    Default

    EDIT: Wrong information!
    Last edited by TQX; 06-01-2010 at 06:48 AM.

  3. #3
    J.P. (Global Moderator) Maniac's Avatar
    Join Date
    Sep 2007
    Location
    Ohio, USA
    Posts
    2,083
    Blog Entries
    5

    Default

    Try this.. /: bit tired.. running on 14 hours of sleep over 3 days so i might of missed something. Please send me an msn message or aim message when you can, I will forget to check back on this I'm guessing.
    ldr r0, Slot @r0 = 0x021D88FE
    ldrh r1, Mask @r1 =0x144E
    ldrh r2, Check @r2 = 0xFFF1
    mov r3, #0x1c
    add r3, r0,r3

    Loop:
    cmp r0, r3
    bge End
    ldrh r4, [r0]
    cmp r4, r2
    beq StoreCheck
    strh r1, [r3]
    b Loop

    StoreCheck:
    subs r3, #0x2
    bpl Loop

    End:
    bx lr


    Slot:
    .long 0x21D88FE

    Mask:
    .short 0x144E

    Check:
    .short 0xFFF1
    Last edited by Maniac; 06-01-2010 at 08:12 AM.

    Say what you mean, mean what you say, and let your actions speak for you.


  4. #4
    Member
    Join Date
    Aug 2008
    Location
    Arizona
    Posts
    1,073
    Blog Entries
    2

    Default

    Code:
    ldr r0,=0x21D88FE
    ldrh r1,=0xFFF1
    ldrh r2,=0x144E
    mov r4,#0x1C
    
    CheckSlots:
    ldrh r3,[r0,r4]   @load the item in (first item slot+r4, basically the last slot first, then second to last, etc)
    cmp r3,r1        @check if its empty
    bne DontStore  @if not, dont store the mask
    strh r2,[r0,r4]   @store the mask in (first item slot +r4)
    DontStore:
    subs r4,#2       @subtract #2 from r4 so we go back one slot the next time around
    bpl CheckSlots  
    bx lr
    compiles into
    Code:
    023FF090 012FFF11
    E0000000 00000038
    E59F0024 E1DF12B4
    E1DF22B4 E3A0401C
    E19030B4 E1530001
    1A000000 E18020B4
    E2544002 5AFFFFF9
    E12FFF1E 021D88FE
    0000FFF1 0000144E
    023FF090 E3520003
    could be shorter in THUMB mode
    Always willing to help with anything, code-related or not. :]

  5. #5

    Default

    Thanks, DragonBoy! Maniac, I tried IMing you on AIM using the user name "JPMayIII," but you never responded. I'll use my other aim account (Demonic722) so expect a message from me shortly! :P
    3DS Friend Code: 4699-6293-3106

  6. #6

    Default

    I'm having more problems, Dragonboy. I thought I could finish this but it refuses to compile for some reason. Maybe there are too many registers or registers that shouldn't be used?

    I wanted to make my Search & Replace code activate by typing "re" short for replace. Here's my source:
    Code:
    ldr r0, word
    ldr r2, text
    ldrh r1, [r2]
    cmp r1, r0
    bxne lr
    ldrh r0, activated
    strh r0, [r2]
     
    ldr r3, mapslot
    ldrh r4, searchitem
    ldrh r5, replaceitem
    ldrh r8, 0x1FFE
     
    MapLoop:
    ldrh r12, [r3, r8]
    cmp r12, r4
    bne Replace
    strh r5, [r3, r8]
     
    Replace:
    subs r8, #2
    bpl MapLoop
    bx lr
     
    word:
    .ascii "re"
     
    activated:
    .ascii "ok"
     
    text:
    .long 0x22AF136
     
    mapslot:
    .long 0x21E3124
     
    searchitem:
    .short 0x144E
     
    replaceitem:
    .short 0xFFF1
    My successful Search & Replace (normal activator since I don't know how to add an activator in a source yet):

    Code:
    ldr r0, =0x21E3124
    ldrh r2, =0xFFF1
    ldrh r3, =0x144E
    ldrh r1, =0x1FFE
    MapLoop:
    ldrh r4, [r0, r1]
    cmp r4, r2
    bne Replace
    strh r3, [r0, r1]
    Replace:
    subs r1, #2
    bpl MapLoop
    bx lr
    I made my own source since the Wiki isn't up.

    The code [L+R]:

    Code:
    94000130 FCFF0000
    023FF090 012FFF11
    E0000000 0000003C
    E59F0024 E1DF22B4
    E1DF32B4 E1DF12B4
    E19040B1 E1540002
    1A000000 E18030B1
    E2511002 5AFFFFF9
    E12FFF1E 021E3124
    0000FFF1 0000144E
    00001FFE 00000000
    023FF090 E3520003
    D2000000 00000000
    Same as before replace FFF1 with XXXX (any hex) and 144E with YYYY (any hex).
    3DS Friend Code: 4699-6293-3106

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •