Blah
Free supporter
- 1,924
- Posts
- 12
- Years
- Unknown Island
- Seen Feb 19, 2025
You don't have square brackets.When I try to assemble this(it's a code of my own design), I get an error from the assembler. It tells me that lines 13, 14, and 15 are messed up. The exact error I get is 'invalid offset, value too big (0xFFFFFFFC)', which doesn't make any sense to me.Code:.thumb start: push {r0-r7, lr} ldr r0, =(0x20370D0) @x800D, holds the berry number ldrh r1, [r0] @r1 now holds the number held in x800D ldr r0, =(0x3005541) @may change later because I don't know if this is free add r0, r0, r1 @gets the address of the table mov r2, r0 mov r1, r0 add r2, #0x3 add r1, #0x2 @r0 is the year pointer, r1 is the month, and r2 is the day ldrh r0, r3 ldrb r1, r4 ldrb r2, r5 ldr r6, =(0x300553C) ldrh r7, [r6] cmp r3, r7 blo x800D_1 ldr r6, =(0x300553F) ldrb r7, [r6] blo x800D_1 ldr r6, =(0x3005540) ldrb r7, [r6] blo x800D_1 ldr r0, =(0x20370D0) mov r1, #0x0 strh r0, [r1] pop {r0-r7} x800D_1: ldr r6, =(0x300553C) ldrh r7, [r6] strh r7, [r0] ldr r6, =(0x300553C) ldrb r7, [r6] strb r7, [r1] ldr r6, =(0x300553C) ldrb r7, [r6] strb r7, [r2] ldr r0, =(0x20370D0) mov r1, #0x1 strh r0, [r1] pop {r0-r7, pc}
Code:
ldrh r0, [r3]
ldrb r1, [r4]
ldrb r2, [r5]
Oh my gosh. FBI actually responded to my question. I'm at awe. O.O Thank you for the first parts! ^U^
As for the last part of your reply, I'd guess it was JPAN's source code you wanted me to pastebin right? Well, here it is. https://pastebin.com/dxpEFdWb
EDIT: Oh. I forgot to ask. In the Frontier Opponent Party Generation Routine, how do I make it so that it generates constant number of Pokemon (let's say, I want it to generate 3 Pokemon the whole time), should I remove the "genAmount" section? And if so, what would I replace it with?
P.S. The Pokemon can't be generated with random level each right? (Or did I guess wrong?)
You can make it generate a static amount, yes. Change:
Code:
ldr r4, =(0x8044EC8 +1)@gen random number
bl linker
lsl r0, r0, #0x10
lsr r0, r0, #0x10
mov r1, #0x6
ldr r4, =(0x81E4684 +1)
bl linker
add r0, r0, #0x1
mov r5, r0
to
Code:
mov r5, #0xAmount you want
As for generating random levels, change:
Code:
mov r0, #0x64
mul r0, r0, r7
add r0, r0, r6 @free memory
mov r2, #0x32 @level
mov r3, #0x20 @cnst
ldr r4, =(0x803DA54 +1)
bl linker
add r7, r7, #0x1
b genLoop
to:
Code:
mov r0, #0x64
mul r0, r0, r7
add r0, r0, r6 @free memory
push {r0-r3}
ldr r4, =(0x8044EC8 +1)@gen random number
bl linker
mov r1, #0x64
ldr r4, =(0x81E4684 +1)
bl linker
mov r4, r0
pop {r0-r3}
mov r2, r4
mov r3, #0x20 @cnst
ldr r4, =(0x803DA54 +1)
bl linker
add r7, r7, #0x1
b genLoop
For Jpan's thing. He explains right here:
setvar 0x8008 and 0x8009 to 0x0 before doing callasm./*This code is meant to create a small box, based on the multichoice
box code, that can be used to input numeric values in-game.
This box will receive as input the largest possible number in variable
0x8008 and 0x8009 as a 32 bit number, and returns 0x8008 and 0x8009 as
the 32 bit input number, and 0x800D as either the digit A was pressed on
or 0x7f if B was pressed to cancel the box input.*/