Development ASM Resource Thread Page 64

Started by esperance September 19th, 2014 3:13 PM
  • 388463 views
  • 1577 replies
Male
Seen 3 Hours Ago
Posted 5 Days Ago
81 posts
4.8 Years
Is there any way I can find the corresponding compensation for ruby?

Furthermore when I applied to Emerald, the game would soft reset every time I received the experience
Well, the creator left a link with both routines, obviously you must apply depending on the rom you use, surely you are putting FR in Em and that's why that happens, and I don't know if there is a way to find all that data for ruby, as you do. I say it is more complicated to find those data for ruby, I would have to review them but I do not assure you that they are all found.
Age 32
Male
Philippines
Seen 1 Hour Ago
Posted 5 Days Ago
17 posts
321 Days

Stats on the Pokédex screen replacing the weight comparison




.thumb

@ credits to DoesntKnowHowToPlay and Squeetz

.equ rom, 0x08000000
.equ offset, 0x

.org 0x10611E, 0xFF
	.byte 0x43, 0xE0
	
.org 0x106370, 0xFF
	.byte 0x0, 0x48, 0x0, 0x47
	.word main + rom + 1

.org 0x106530, 0xFF
	.byte 0xCE, 0xE0
	
.org 0x452200, 0xFF
	.byte 0xA

.org offset, 0xFF
main:
    mov r5, #4
    str r5, [sp]
    str r6, [sp, #4]
    mov r0, r10
    cmp r0, #0
    beq unknown_base_stats

hp:
    mov r0, #0
    bl print_stat
    mov r3, #4 @ y co-ord
    str r3, [sp]
    mov r3, #0 @ x co-ord
    ldr r5, write_method
    bl call_via_r5
    
atk:
    mov r0, #1
    bl print_stat
    mov r3, #4 @ y co-ord
    str r3, [sp]
    mov r3, #0x2C @ x co-ord
    ldr r5, write_method
    bl call_via_r5
     
def:
    mov r0, #2
    bl print_stat
    mov r3, #18 @ y co-ord
    str r3, [sp]
    mov r3, #0 @ x co-ord
    ldr r5, write_method
    bl call_via_r5
     
spa:
    mov r0, #4
    bl print_stat
    mov r3, #18 @ y co-ord
    str r3, [sp]
    mov r3, #0x2C @ x co-ord
    ldr r5, write_method
    bl call_via_r5
     
spd:
    mov r0, #5
    bl print_stat
    mov r3, #32 @ y co-ord
    str r3, [sp]
    mov r3, #0 @ x co-ord
    ldr r5, write_method
    bl call_via_r5
     
spe:
    mov r0, #3
    bl print_stat
    mov r3, #32 @ y co-ord
    str r3, [sp]
    mov r3, #0x2C @ x co-ord
    ldr r5, write_method
    bl call_via_r5
    
print_ability_one:
    ldr r0, [sp, #0x1C]
    mov r3, #0x1C
    mul r0, r3
    ldr r1, base_stats
	ldr r1, [r1]
    mov r3, #0x16
    add r1, r1, r3
    add r1, r0, r1
    ldr r3, abilities
	ldr r3, [r3]
    ldrb r2, [r1]
    mov r1, #0xD
    mul r1, r2
    add r2, r1, r3    
    ldr r1, [r7]
    add r1, #0x53
    ldrb r1, [r1]
    mov r0, r1
    mov r1, #0
    mov r3, #46
    str r3, [sp]
    mov r3, #0
    ldr r5, write_method
    bl call_via_r5
    
print_ability_two:
    ldr r0, [sp, #0x1C]
    mov r3, #0x1C
    mul r0, r3
    ldr r1, base_stats
	ldr r1, [r1]
    mov r3, #0x16
    add r1, r1, r3
    add r1, r0, r1
    ldrb r2, [r1, #1]
    ldrb r5, [r1, #0]
    ldr r3, abilities
	ldr r3, [r3]
    cmp r2, r5
    beq return
    cmp r2, #0
    beq return
    mov r1, #0xD
    mul r1, r2
    add r2, r1, r3
    
    ldr r1, [r7]
    add r1, #0x53
    ldrb r1, [r1]
    mov r0, r1
    mov r1, #0
    mov r3, #60
    str r3, [sp]
    mov r3, #0
    ldr r5, write_method
    bl call_via_r5
    b return
    
unknown_base_stats:
    mov r0, r1
    mov r1, #0
    ldr r2, str_unknown
    mov r3, #4 @ y co-ord
    str r3, [sp]
    mov r3, #0 @ x co-ord
    ldr r5, write_method
    bl call_via_r5
    
return:
    mov r5, #0
    ldr r0, return_loc
    bx r0
    
print_stat:
    push {lr}
    ldr r3, [sp, #0x20]
    mov r1, #0x1C
    mul r3, r1
    ldr r2, base_stats
	ldr r2, [r2]
    add r2, r3
    add r2, r0
    ldrb r1, [r2]
    mov r4, r0
    ldr r0, fcode_buffer2
    mov r3, #0
    cmp r1, #99
    bhi no_leading_zeroes
    cmp r1, #9
    bhi one_leading_zero

two_leading_zeroes:
    str r3, [r0]
    add r0, #1

one_leading_zero:
    str r3, [r0]
    add r0, #1

no_leading_zeroes:
    mov r3, #3
    ldr r5, int_to_str
    bl call_via_r5
    
    mov r2, r4
    ldr r0, displayed_string
    ldr r1, str_table
    lsl r2, r2, #2
    add r1, r2
    ldr r1, [r1]
    ldr r5, fdecoder
    bl call_via_r5
    ldr r1, [r7]
    add r1, #0x53
    ldrb r1, [r1]
    mov r0, r1
    mov r1, #0
    ldr r2, displayed_string
    pop {r5}
    
call_via_r5:
    bx r5

.align 2
    base_stats:             .word 0x1BC + rom
    abilities:              .word 0x1C0 + rom
    str_table:              .word table + rom
    str_unknown:            .word capture + rom
    fcode_buffer2:          .word 0x02021CD0
    displayed_string:       .word 0x02021D18
    int_to_str:             .word 0x08008E78|1
    fdecoder:               .word 0x08008FCC|1
    write_method:           .word 0x081047C8|1
    return_loc:             .word 0x08106380|1
table:
	.word stat_hp + rom
	.word stat_atk + rom
	.word stat_def + rom
	.word stat_spe + rom
	.word stat_spa + rom
	.word stat_spd + rom
	
stat_hp:
	.byte 0xC2, 0xCA, 0x0, 0x0, 0xFD, 0x2, 0xFF
	
stat_atk:
	.byte 0xBB, 0xE8, 0xDF, 0x0, 0xFD, 0x2, 0xFF 
	
stat_def:
	.byte 0xBE, 0xD9, 0xDA, 0x0, 0xFD, 0x2, 0xFF
	
stat_spe:
	.byte 0xCD, 0xE4, 0xD9, 0x0, 0xFD, 0x2, 0xFF
	
stat_spa:
	.byte 0xCD, 0xE4, 0xBB, 0x0, 0xFD, 0x2, 0xFF
	
stat_spd:
	.byte 0xCD, 0xE4, 0xBE, 0x0, 0xFD, 0x2, 0xFF
	
capture:
	.byte 0xBD, 0xD5, 0xE4, 0xE8, 0xE9, 0xE6, 0xD9, 0x0, 0xDA, 0xE3, 0xE6, 0xFE, 0xE1, 0xE3, 0xE6, 0xD9, 0x0, 0xDD, 0xE2, 0xDA, 0xE3, 0xE6, 0xE1, 0xD5, 0xE8, 0xDD, 0xE3, 0xE2, 0xAB, 0xFF
Thanks to DoesntKnowHowToPlay for the base routine which I slightly edited / optimised, and to Squeetz for making the routine into a form that can be applied as a patch.
HI SIR!!!!!!!!... Do you also have this kind of patch to Pokemon Emerald?....thanks in advance sir!!!
Age 26
Male
Seen 34 Minutes Ago
Posted 1 Day Ago
31 posts
2 Years
Scaled Experience Formula

In Generation V, a new way of determining the Experience Points gained after Battle was introduced. Previously, the Experience Formula was a flat one, which did not change based on Level Differences between your Pokemon and the other one.

In Black & White, they used a Scaled Experience Formula, which would cause your Pokemon to gain more experience if their opponent was a higher Level, and less if their opponent was a lower one.

Today, I am sharing a way to have this sort of Scaled Experience Points in Fire Red or Emerald. I have included the download link to a folder which contains four items.

Spoiler:
Folder: (Download)
  1. The Routine (For Fire Red)
  2. The Routine (For Emerald)
  3. Think0028's Experience All Patch
  4. An Instruction Manual

The Instruction Manual explains how the routine works and any extra information that is necessary to know (particularly if you would like to modify this routine for your specific hack).

Important:
Considering I first uploaded the first version of this routine a long time ago, you may have an older version of it. This version may be preferable to that one, and it is smaller than the previous version is. Therefore, one can simply insert it over the old version and not have to repoint anything.

Extra Information

This routine is compatible with Think0028's Experience All Patch. His original download link is unfortunately broken, hence why I put it in the download folder. If it was still active, I would have linked directly to it.

If you inserted the Disable Experience Gain With Flag routine, originally by FBI, then you may wish to remove it, as this routine implements it. I am not sure if there is a conflict due to this, but at the very least there is a redundant check if you have two routines which both check the same Flag. It is also possible that this routine bypasses that one entirely, in which case you would want to remove it to avoid wasting space.

Thanks and credits to FBI for that original routine, as without it I would likely not have been able to find the correct branching address for this routine.

As I have nowhere else to post this information, I will say here that to remove the 1.5x Experience Boost you get for defeating a Pokemon in a Trainer Battle (like they did in Generation VII), do the following:

Put 07 E0 at 0x21DD8 (FireRed) or 0x4A698 (Emerald)

Put 1C E0 at 0x21E00 (FireRed) or put 28 E0 at 0x4A6C0 (Emerald)
Amazing stuff, but I never get success :(
I try the script for EM, first I modified 0x0804A67B to 0x0804A66B at line 10 because I don't use that Exp. All patch, then I compiled it and insert them into 0x32A5F0 since there has a lot of 00, modified 0x4A5AC to 00 48 00 47 F0 A5 32 08 as your tutorial said, seems it all OK, but...
I tried to find a wild Pokemon to battle, after I win, the game crashed and mGBA gives an error message said somehow "Jumped to invalid address 0x09670880".
Could you help me how to implement it so it works well? Thanks.