Syzero said:all i get is a white screen so i dont know wat i did wrong this is what i did:
1. load up the game and cheat txt and choose what to save it as
2. changed the slowmo and enable disable keys
3. did not add ram dump
4. hook into-arm7 embed into- arm7
5. auto patch
by 'normal method, do you mean no auto patching?cracker said:Syzero said:all i get is a white screen so i dont know wat i did wrong this is what i did:
1. load up the game and cheat txt and choose what to save it as
2. changed the slowmo and enable disable keys
3. did not add ram dump
4. hook into-arm7 embed into- arm7
5. auto patch
And this is with v3.1? Try using the address you used before but patching with the normal method. If it doesn't give you a white screen on boot then it means that the flash cart is ignoring the header.
ldr r3,numbytes
ldr r2,realtraineraddress
add r1,r15,#0x18
trainercopyloop:
ldr r0,[r1],#0x4
str r0,[r2],#0x4
subs r3,r3,#0x1
bne trainercopyloop
ldr r15,armstart
realtraineraddress: .long 0x23FE000
armstart: .long 0x2380000
trainerstart:
str r0,swap
ldr r0,irqjump0
stmdb r13!,{r0}
ldr r0,swap
b start
str r0,swap
ldr r0,irqjump1
stmdb r13!,{r0}
ldr r0,swap
start:
stmdb r13!,{r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r14}
ldr r1,enableflag
ldr r2,enablekey
ldr r3,disablekey
mov r0,#0x4000000
ldr r0,[r0,#0x130]
cmp r0,r2
moveq r1,#0x1
cmp r0,r3
moveq r1,#0x0
str r1,enableflag
cmp r1,#0x0
bne turnedon
ldmia r13!,{r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r14}
ldmia r13!,{r15}
turnedon:
ldr r4,slowdownkey
ldr r5,speedupkey
mov r1,#0x4000000
ldr r1,[r1,#+0x130]
ldr r0,slowmolevel
cmp r1,r4
addeq r0,#0x1
cmp r0,#0x1500
movgt r0,#0x1500
cmp r1,r5
subeqs r0,#0x1
movlt r0,#0x0
str r0,slowmolevel
slowmoloop:
mov r1,#0x1
slowmoinnerloop:
subs r1,r1,#0x1
bne slowmoinnerloop
subs r0,r0,#0x1
bcc slowmodone
b slowmoloop
slowmolevel: .long 0x0
slowmodone:
mov r0,#0x0
ldr r1,address0
ldr r1,[r1]
cmp r0,r1
beq label0
mov r0,#0x0
ldr r1,address1
ldr r1,[r1]
cmp r0,r1
beq label0
ldr r5,address-1
ldrh r5,[r5]
ldr r2,lval0
ldr r0,lval1
and r5,r5,r2
cmp r5,r0
bne label0
ldr r0,lval2
mov r2,#0xE8
strh r0,[r1,+r2]
label0:
ldr r5,address2
ldrh r5,[r5]
ldr r2,lval0
ldr r0,lval3
and r5,r5,r2
cmp r5,r0
bne label1
ldr r5,address3
ldrh r5,[r5]
ldr r2,lval0
mov r0,#0x0
and r5,r5,r2
cmp r5,r0
bne label1
ldr r0,lval4
ldr r1,address4
str r0,[r1]
label1:
mov r0,#0x0
ldr r1,address0
ldr r1,[r1]
cmp r0,r1
beq label4
mov r0,#0x0
ldr r1,address1
ldr r1,[r1]
cmp r0,r1
beq label4
ldr r1,address-1
ldr r1,[r1]
mov r2,#0x38
ldrh r6,[r1,+r2]
ldr r5,address5
ldrh r5,[r5]
ldr r2,lval5
mov r0,#0x0
and r5,r5,r2
cmp r5,r0
bne label2
mov r5,#0x20
add r6,r6,r5
label2:
ldr r5,address5
ldrh r5,[r5]
ldr r2,lval6
mov r0,#0x0
and r5,r5,r2
cmp r5,r0
bne label3
ldr r5,lval7
add r6,r6,r5
label3:
mov r2,#0x38
mov r1,#0x0
str r6,[r1,+r2]
add r1,r1,#0x4
mov r2,#0x38
mov r1,#0x0
str r6,[r1,+r2]
add r1,r1,#0x4
mov r2,#0x38
mov r1,#0x0
str r6,[r1,+r2]
add r1,r1,#0x4
label4:
ldmia r13!,{r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r14}
ldmia r13!,{r15}
address0: .long 0x2134020
address1: .long 0x2139F9C
address2: .long 0x213A0F0
address3: .long 0x213A0F4
address4: .long 0x218E458
address5: .long 0x4000130
lval0: .long 0xFFFF
lval1: .long 0xFFFA
lval2: .long 0x12C0
lval3: .long 0x201
lval4: .long 0xE0000
lval5: .long 0x204
lval6: .long 0x104
lval7: .long 0xFFFFFFD0
enableflag: .long 0x0
enablekey: .long 0x2FE;@R+A
disablekey: .long 0x2FD;@R+B
slowdownkey: .long 0x27F;@R+DOWN
speedupkey: .long 0x2BF;@R+UP
swap: .long 0x0
irqjump0: .long 0x37FB9D4
irqjump1: .long 0x3806BE0
trainerend:
numbytes: .long (trainerend-trainerstart)/4
Max Boost
62134020 00000000
62139f9c 00000000
b2139f9c 00000000
90000000 0000fffa
100000e8 000012c0
d2000000 00000000
Extra Sea Chart Ink
9213a0f0 00000201
9213a0f4 00000000
0218e458 000e0000
d2000000 00000000
Press SELECT+L to Grow / SELECT+R to Shrink
62134020 00000000
62139f9c 00000000
b2139f9c 00000000
b000001c 00000000
da000000 00000038
94000130 fdfb0000
d4000000 00000020
d0000000 00000000
94000130 fefb0000
d4000000 ffffffd0
d0000000 00000000
d6000000 00000038
d6000000 00000038
d6000000 00000038
d2000000 00000000
Fermosi said:Darn it, i still get an error (black screen either with new game or load, with load it comes up as soon as i enter a menu/shop/pub/fight) with FFTA2 using these
*snip*
Any clue to get it work? D:
EDIT : using m3 sd slot 2
ÂÂÂÂLDRÂÂÂÂ R0, =0x4000204
ÂÂÂÂMOVÂÂÂÂ R1, #0x6800
ÂÂÂÂSTRHÂÂÂÂR1, [R0]
ÂÂÂÂMOVÂÂÂÂ R0, #0xD200
ÂÂÂÂLDRÂÂÂÂ R3, =0x9FE0000
ÂÂÂÂMOVÂÂÂÂ R1, #0x1500
ÂÂÂÂSTRHÂÂÂÂR0, [R3]
ÂÂÂÂMOVÂÂÂÂ R2, #0x8000000
ÂÂÂÂSUBÂÂÂÂ R3, R3, #0x1FC0000
ÂÂÂÂSTRHÂÂÂÂR1, [R2]
ÂÂÂÂSTRHÂÂÂÂR0, [R3]
ÂÂÂÂADDÂÂÂÂ R2, R2, #0x40000
ÂÂÂÂLDRÂÂÂÂ R3, =0x9E20000
ÂÂÂÂSTRHÂÂÂÂR1, [R2]
ÂÂÂÂMOVÂÂÂÂ R0, #0xF0
ÂÂÂÂMOVÂÂÂÂ R0, R0,LSL#16
ÂÂÂÂMOVÂÂÂÂ R0, R0,LSR#16
ÂÂÂÂADDÂÂÂÂ R2, R2, #0x1F80000
ÂÂÂÂSTRHÂÂÂÂR0, [R3]
ÂÂÂÂSTRHÂÂÂÂR1, [R2]
ÂÂÂÂMOVÂÂÂÂ R0, #0x0
ÂÂÂÂMOVÂÂÂÂ R2, #0x8000000
ÂÂÂÂSTRÂÂÂÂ R0, [R2]
ÂÂÂÂADDÂÂÂÂ R0, R0, #2
ÂÂÂÂSTRÂÂÂÂ R0, [R2]
ldr r3,numbytes
ldr r2,realtraineraddress
add r1,r15,#0x18
trainercopyloop:
ldr r0,[r1],#0x4
str r0,[r2],#0x4
subs r3,r3,#0x1
bne trainercopyloop
ldr r15,armstart
realtraineraddress: .long 0x23FE000
armstart: .long 0x2000800
trainerstart:
str r0,swap
ldr r0,irqjump0
stmdb r13!,{r0}
ldr r0,swap
start:
stmdb r13!,{r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r14}
label0:
ldmia r13!,{r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r14}
ldmia r13!,{r15}
swap: .long 0x0
irqjump0: .long 0x1FF8000
trainerend:
numbytes: .long (trainerend-trainerstart)/4
cory1492 said:cracker, is there anything I should be aware of with the .asm file parser? Using 3.3 my code never winds up in the asm, trying this on metroid prime pinball (basically trying to work out simple rumble enable "cheat" patch for 3in1.) I have "hook into" and "embed into" set to both ARM9, but it always says "autopatching trainer at end of arm7.bin" - that normal?
Also, another dumb question that comes up as a result - is there a way to make it so that a given code only runs once (or once per enable/disable) instead of on each interrupt (not that I've gotten it working to find out if it is actually doing that like I suspect it would)? I'll do up my own vars to track this stuff if there isn't a simpler way, though![]()
Hopefully I haven't missed anything completely obvious.
my code
the resulting trainer.asm, don't see any trace of my code in there...Code:ÂÂÂÂLDRÂÂÂÂ R0, =0x4000204 ÂÂÂÂMOVÂÂÂÂ R1, #0x6800 ÂÂÂÂSTRHÂÂÂÂR1, [R0] ÂÂÂÂMOVÂÂÂÂ R0, #0xD200 ÂÂÂÂLDRÂÂÂÂ R3, =0x9FE0000 ÂÂÂÂMOVÂÂÂÂ R1, #0x1500 ÂÂÂÂSTRHÂÂÂÂR0, [R3] ÂÂÂÂMOVÂÂÂÂ R2, #0x8000000 ÂÂÂÂSUBÂÂÂÂ R3, R3, #0x1FC0000 ÂÂÂÂSTRHÂÂÂÂR1, [R2] ÂÂÂÂSTRHÂÂÂÂR0, [R3] ÂÂÂÂADDÂÂÂÂ R2, R2, #0x40000 ÂÂÂÂLDRÂÂÂÂ R3, =0x9E20000 ÂÂÂÂSTRHÂÂÂÂR1, [R2] ÂÂÂÂMOVÂÂÂÂ R0, #0xF0 ÂÂÂÂMOVÂÂÂÂ R0, R0,LSL#16 ÂÂÂÂMOVÂÂÂÂ R0, R0,LSR#16 ÂÂÂÂADDÂÂÂÂ R2, R2, #0x1F80000 ÂÂÂÂSTRHÂÂÂÂR0, [R3] ÂÂÂÂSTRHÂÂÂÂR1, [R2] ÂÂÂÂMOVÂÂÂÂ R0, #0x0 ÂÂÂÂMOVÂÂÂÂ R2, #0x8000000 ÂÂÂÂSTRÂÂÂÂ R0, [R2] ÂÂÂÂADDÂÂÂÂ R0, R0, #2 ÂÂÂÂSTRÂÂÂÂ R0, [R2]
Code:ldr r3,numbytes ldr r2,realtraineraddress add r1,r15,#0x18 trainercopyloop: ldr r0,[r1],#0x4 str r0,[r2],#0x4 subs r3,r3,#0x1 bne trainercopyloop ldr r15,armstart realtraineraddress: .long 0x23FE000 armstart: .long 0x2000800 trainerstart: str r0,swap ldr r0,irqjump0 stmdb r13!,{r0} ldr r0,swap start: stmdb r13!,{r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r14} label0: ldmia r13!,{r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r14} ldmia r13!,{r15} swap: .long 0x0 irqjump0: .long 0x1FF8000 trainerend: numbytes: .long (trainerend-trainerstart)/4
Seems to work OK in 1.3, at least I can tinker with my code till you let me know if 3.x is broke.
edit:/ take that back, didn't work so good in 1.3, whitescreens on arm9 and card insert error/halt on arm7 (which can't write to exmemcnt anyway.) I guess patience will be the virtue then![]()
I accidently broke .asm a while back it seems by inadvertently using a temp variable for the check in between the call to the patching function.![]()
I only half-read what you wrote about the code execution and went off on a different feature that I had been planning on doing for a while and thought was what you were talking about -- executing the function every x cycles. It's not hard at all to do it once:
mov r1,donealready
cmp r1,#0x0
bne endfunc
mov r1,#0x1
str r1,donealready
.
Code:. b endfunc donealready: .long 0x0 endfunc: For what you are looking to do doing it once should be fine enough since I don't think it would be written over again. QUOTE(Antoligy @ Jul 6 2008, 03:20 PM) This is so useful that it calls for... [size=36][color=#FF0000]STICKY![/color][/size][/quote] Glad you like it. [img]http://gbatemp.net/vanilla/emoticons/yaynds.gif[/img]
ÂÂÂÂmovÂÂÂÂ r1, donealready
ÂÂÂÂmovÂÂÂÂ r1, #donealready
cory1492 said:Nice one, works well now cracker and thanks yet again. Now I see the explanation in the log as to why it's sticking stuff into arm7 when I tell it to use arm9, too![]()
-as doesn't seem to like
it tells me it wantsCode:ÂÂÂÂmovÂÂÂÂ r1, donealready
Code:ÂÂÂÂmovÂÂÂÂ r1, #donealready![]()
Whats needed to find "safe" locations to patch into arm9? I'm going to review the thread now, see if I missed it last night.
edit:/ argh, moving irq targets? This would be so much simpler if arm7 could set external/mem control registers![]()
the final arm9 using the default memory gives the error "Undefined opcode - with no debug vector defined" or on starfox "bad SWI number" in no$, which I assume is what is crashing it...?
cory1492 said:By "patch into" I mean, using 0xdeadbeef padding and a memory dump absolutely no arm9 locations are given. Any locations I have tried so far have yielded a white screen. Is it possible arm/thumb is the issue (trying to rule out everything)? ATM (heh) I feel like I'm missing something important.

