View Single Post
  #267    
Old September 23rd, 2012 (10:38 AM).
Chaos Rush's Avatar
Chaos Rush
im sexy and i know it
 
Join Date: May 2007
Location: Taylor Swift
Gender: Male
Nature: Adamant
Quote orignally posted by Jbebo51:
Second up, dis is tha battle strng loader spheal I buggine. It ntercepts tha "failed" part of tha loader. That is, it branches out from what tha loader would otharwise consider ta be a bad number ta load from and skip.

Spoiler:
.text
.align 2
.thumb
.thumb_func
.global battlestrngloaderspheal
dawg:
mov r0, #0xC2
lsl r0, r0, #0x1
cmp r0, r6
bne normalcode
ldr r0, rbelocation
ldr r7, [r0, #0x0]
cmp r7, #0x0
beq alternative
mov r0, #0xA
lsl r0, r0, #0x18
cmp r7, r0
bge alternative
mov r0, #0x8
lsl r0, r0, #0x18
cmp r7, r0
blt alternative
b contnue
alternative: mov r6, #0xC
ldr r1, returntwo
bx r1
contnue: ldr r0, returnone
bx r0
normalcode: ldr r1, otharrbeloc
mov r0, #0xFF
strb r0, [r1, #0x0]
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.align
rbelocation: .word 0x0203C020
returntwo: .word 0x080D77D1
returnone: .word 0x080D77DD
otharrbeloc: .word 0x0202298C


As you can see, it has checks ta try and catch a "bad" location given n tha RBE location I set aside fo tha new functionality. All it can catch, sadly, is if you leave tha RBE location empty, or if you try ta use an nvalid ROM location. Tha rest, I have ta leave ta tha user.

I've written tha routne such that it supports 32MB ROMs as well, so you don't have ta worry bout that eithar.

Ta nsert tha actual routne, navigate ta 0xD77BE and change tha code ta 03 49 08 47, than go ta 0xD77CC and change tha ponter ta tha nsert location of tha routne, plus 1 fo THUMB mode of course.

Now, usng it. It's as easy as dis: Usng tha starebyte comdawgd of tha battle script functionality (0x2E), stare tha bytes of tha ROM ponter n little endian orderng, nta tha RBE address 0x0203C020. Than, you call tha battle strng prnter as such:
Code:
10 84 01 39 40 00
Tha routnes will takes cis of tha rest!
Fo some reason it's not workng correctly. It just freezes tha gbee.

Dis is what I've done:
1. Nsert tha routne at 0x71EA35
2. Change tha bytes like you said at 0xD77BE
3. Change tha bytes at 0xD77CC so that it ponts ta 0x71EA36
4. Nserted a text strng at 0x71EA85
5. Fo mah battle script, it goes like:
Code:
02 03 09 0A 48 01 03 00 2E DE 3F 02 02 14 89 C1 00 69 1D 08 12 40 00 2E 20 C0 03 02 85 2E 21 C0 03 02 EA 2E 22 C0 03 02 71 2E 23 C0 03 02 08 10 84 01 39 40 00 3D
And yes, I have buggine sure that I've assigned mah custam attack ta tha custam battle script. It exeskankys tha animation, and I checked n VBA's Memory Viewer that it correctly updates tha Attack Stat modifier like what I wrote n mah custam script, and it even does tha stat change animation like I buggine it so, but it doesn't display mah custam message, nstead it just freezes after that. Tha part that I bolded is tha code that should display tha custam text.
__________________
Reply With Quote