View Single Post
  #200    
Old July 27th, 2013 (06:35 PM). Edited July 28th, 2013 by dd409.
dd409's Avatar
dd409 dd409 is offline
For the Swarm!
 
Join Date: Jul 2008
Gender: Male
Nature: Lax
Posts: 15
Original post by Darthatron:
Spoiler:
Quote originally posted by Darthatron:
I want to find a better place to put it. Right now, the image showing if it's physical/special/status appears a frame before the rest of the screen is loaded. :\ I mean, it's not that bad. I just don't love it.

Change these bytes:
Code:
@0813A130: 0x2F
@0813A17B: 0x47
@0813A1A0: [Pointer to Routine, plus 1 (one).]
Here's the source:
Code:
.align 2
.thumb
Start:
    push {r0-r4}
    ldr r0, .CurMoveIndex
    ldrb r1, [r0]
    lsl r1, r1, #1
    ldr r0, .Move_List
    add r0, r0, r1
    ldrh r3, [r0]
    lsl r0, r3, #1
    add r0, r0, r3
    lsl r0, r0, #2
    ldr r1, .MoveBase
    add r0, r0, r1
    ldrb r4, [r0, #10]
    lsl r0, r4, #1
    add r4, r4, r0
    lsl r4, r4, #6
    
    ldr r0, .SplitImages
    add r0, r4
    ldr r1, .VRAM
    mov r2, #0x30
    swi #0xB
    
    ldr r0, .SplitImages
    add r0, r4
    add r0, #0x60
    ldr r1, .VRAM
    mov r2, #0x1E
    lsl r2, #0x04
    add r1, r1, r2
    mov r2, #0x30
    swi #0xB
    
Finish:
    pop {r0-r4}
    ldr r4, .Some_Offset
    ldr r0, [r4]
    ldr r1, .Return_Addr
    bx r1

.align 2
.MoveBase:        .word 0x08250C04
.CurMoveIndex:    .word 0x0203B16D
.Move_List:        .word 0x02003268

.VRAM:            .word 0x06001800
.SplitImages:    .word 0xYYYYYYYY

.Some_Offset:    .word 0x0203B148
.Return_Addr:    .word 0x0813A17C+1
Change the .SplitImages (0xYYYYYYYY) pointer to where ever you have the images.
The images are uncompressed. And should look like this:
They need to be in this order. Use TileMolester or something to insert them.
They use the same palette as the Types, which is located at 0x08E95DBC in a clean FireRed ROM.


Suggested fix by Jambo:
Spoiler:
Quote originally posted by Jambo51:
I think I've found the code which causes the Mirror Coat/Counter bug in Fire Red.
Change it to this, and it should hopefully fix it.
Code:
0801F6C2: 86 7A
0801F908: 00 2E
0801F90A: 41 D1
Also, Darthatron's routine for showing the images is slightly buggy. It turns out the move index is actually DMA protected, but in a really odd way. It only gets DMA shifted after certain actions are taken within the game's overworld. Anyway - to solve this, change the parts in BOLD in Darthatron's original routine (or just copy this routine, I suppose), and then follow Darthatron's original post to insert it.

Code:
.align 2
.thumb
Start:
 push {r0-r4}
 ldr r0, .CurMoveIndex
 ldrb r1, [r0]
 lsl r1, r1, #1
 ldr r0, .Move_List_Loc
 ldr r0, [r0]
 ldr r3, .number
 add r0, r0, r3
 add r0, r0, r1
 ldrh r3, [r0]
 cmp r3, #0x0
 beq Finish
 lsl r0, r3, #1
 add r0, r0, r3
 lsl r0, r0, #2
 ldr r1, .MoveBase
 add r0, r0, r1
 ldrb r4, [r0, #10]
 lsl r0, r4, #1
 add r4, r4, r0
 lsl r4, r4, #6
 ldr r0, .SplitImages
 add r0, r4
 ldr r1, .VRAM
 mov r2, #0x30
 swi #0xB 
 ldr r0, .SplitImages
 add r0, r4
 add r0, #0x60
 ldr r1, .VRAM
 mov r2, #0x1E
 lsl r2, #0x04
 add r1, r1, r2
 mov r2, #0x30
 swi #0xB 
Finish:
 pop {r0-r4}
 ldr r4, .Some_Offset
 ldr r0, [r4]
 ldr r1, .Return_Addr
 bx r1
.align 2
.MoveBase:  .word 0x08250C04
.number: .word 0x00003258
.CurMoveIndex: .word 0x0203B16D
.Move_List_Loc:  .word 0x0203B140
.VRAM:   .word 0x06001800
.SplitImages: .word 0x08YYYYYY
.Some_Offset: .word 0x0203B148
.Return_Addr: .word 0x0813A17D


I'm trying to add in these images to an Emerald rom, but I seem to have hit a wall. I've added in the actual image with TileMolester already, but as I understand it the offsets in the code here are for a Fire Red rom. I assume they aren't interchangeable with Emerald, so how would I go about finding the equivalent offsets? Also, how do I find the addresses of the bytes for the code pointers?
Reply With Quote