Results 1 to 9 of 9

Thread: Save the trees, flowers, etc.

  1. #1
    Chris (Administrator) Vash's Avatar
    Join Date
    Sep 2007
    Location
    Teh Interwebz
    Posts
    1,992
    Blog Entries
    27

    Default Save the trees, flowers, etc.

    I figured it's time for another one of my theory posts. Keep in mind, my last post like this turned into the Real-Time World Edit code. Here it goes.

    AC:WW uses a series of bytes that read either 00 or 01 to decide if an item on the world map is buried. Why not apply the same idea to save the current position of all of your trees, or all of your flowers, or a rock maze? Before I go into detail, I'd like to answer the question as to how this would be helpful? Like I said above, you could create and destroy massive mazes with the press of an activator. You could save your town from being destroyed by visitors by simply saving the position of your trees and re-creating them after your visitors leave. The same goes for flowers.

    Now, what would we need to make this happen? 4,096 bytes of free ram, to be exact. Luckily for us, the DS version of AC has plenty of free ram. 256 free lines in a debugger is easy to spot. What would we need to do? Write an ASM routine to search through the world map for a given hex (0xF1FF for example). When it finds it, it'll change the 00 to a 01 at that slot's corresponding spot in the free ram. How would we do this? By creating an equation that would take the address of each slot on the world map and correspond it to one of the free bytes of ram. It will be in a series, so we can also write the opposite of this equation to go through the series of bytes and find any that are set to 01. When it finds one, it'll change that free byte's address back to the actual map slot address and place the item there. Complicated, but it's definitely possible. Much easier than the RTWE, accomplished by Toenailed.

    So, who's up for the challenge?

    EDIT: We can use 0x022BF200 to 0x022C1200. Starting at the first slot, it's 0x021E3124 + DC0DCh to get to the first byte we're using. Really we just need to write an ASM routine to subtract 1h from the number we're adding (DC0DC) each time it runs through the loop. This will get you to each of the free ram slots. For example:

    0x021E3124 -World Slot 1
    +DC0DC
    __________
    0x022BF200 -Free Slot 1

    Then

    0x021E3126 -World Slot 2
    +DC0DB
    __________
    0x022BF201 -Free Slot 2
    Animal Crossing: City Folk
    ACToolkit - NPC_Tool - PattView

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

    Default

    Sounds easy enough to adapt something of mine >__> Meh I'll ask a few question on msn and maybe work on it.

    Edit:
    This what you want? :P (If you want me to note it more I can >_>)
    It currently can only do one item, it may be able to be adapted to do several... just depends :\ Anyways doing the reverse of this should be simple so I won't post it now.


    EDIT2: Please not the below code it not the up to date one.
    Code:
    ldr r0, Map
    add r1, r0, #0x2000
    ldr r4, AddVal
    ldrh r8, SearchFor
    ldrb r5,  One @Pointless, I know but it wont let me do streqb #0x1,[r3], it wants a register...
    
    Loop:
    cmp r0, r1
    bxeq lr
    ldrh r2, [r0], #0x2 @r2 = 16 bits from Map, r0 + 2 -> r0
    add r3, r0, r4 @Our open byte = r3
    sub r4, r4, #0x1 @r4 - 1 -> r4
    cmp r2, r8
    streqb r5,[r3]
    b Loop
    
    Map:
    .long 0x21e3124
    AddVal:
    .long 0xDC0DC
    SearchFor:
    .short 0xF1FF
    One:
    .byte 0x01
    Last edited by Maniac; 11-30-2008 at 03:18 PM.

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


  3. #3

    Default

    Shouldn't that have an activator? There aren't any conditionals...

    Remember to always click the thanks button of those who help you! It makes them feel wanted:

  4. #4
    Chris (Administrator) Vash's Avatar
    Join Date
    Sep 2007
    Location
    Teh Interwebz
    Posts
    1,992
    Blog Entries
    27

    Default

    That's just a routine. It's not the entire code.
    Animal Crossing: City Folk
    ACToolkit - NPC_Tool - PattView

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

    Default

    Its also not the up to date routine >_> i.e. it has bugs.

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


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

    Default

    Just wondering, has anything new happened with this code?

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

    Default

    yes and no >_>

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


  8. #8
    Chris (Administrator) Vash's Avatar
    Join Date
    Sep 2007
    Location
    Teh Interwebz
    Posts
    1,992
    Blog Entries
    27

    Default

    Sort of...
    Animal Crossing: City Folk
    ACToolkit - NPC_Tool - PattView

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

    Default

    Wow, now that I look back at this it looks extremely easy
    I may make something like this for AC:CF soon, if there's free space like that in the game
    I Still don't have a USBGecko though so I don't really know much about the inner workings of the game
    Anyway so long everyone

Posting Permissions

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