PSP Coding
Would you like to react to this message? Create an account in a few clicks or log in to continue.

PSP Coding


 
HomeLatest imagesSearchRegisterLog in

 

 Whats wrong with this sub?

Go down 
3 posters
Go to page : Previous  1, 2, 3
AuthorMessage
GunstarBlue




Posts : 37
Points : 41
Reputation : 0
Join date : 2010-09-29

Whats wrong with this sub? - Page 3 Empty
PostSubject: Re: Whats wrong with this sub?   Whats wrong with this sub? - Page 3 I_icon_minitimeWed Oct 06, 2010 5:48 am

Alright gonna try and do the pin pointing when I get a chance at work today.

But just had a few quick questions about the sub routine because I kind of wrote it blindly with pieces of other subs that I've seen and ones that you've helped me with.

First is this string right here:

Code:
bne t0, t2, $To "//here"

If I set the two addresses to check to t0 and t1, and the value to check for at t2, then how come I only have to put t0 and t2 in that line to have it check for the value? Wouldn't it just check t0 for the value and not t0 and t1?

Back to top Go down
-LeetGamer-
Admin



Posts : 247
Points : 397
Reputation : 4
Join date : 2010-09-29
Age : 30

Whats wrong with this sub? - Page 3 Empty
PostSubject: Re: Whats wrong with this sub?   Whats wrong with this sub? - Page 3 I_icon_minitimeWed Oct 06, 2010 7:17 am

DMA 1
0xFFFFFFFF 0x004DFB90
0x00000AC4 0x00000000

DMA 2
0xFFFFFFFF 0x004DFCB0
0x00000ACC 0x00000000


0x001DE3F0 0x03E00008
0x001DE3F4 0x00000000

Alright, I messed up Razz sorry, here is one that should work:

Code:

Lui t0 $08CE
Lw t1 $FB90(t0)
Lw t1 $0AC4(t1)
Lw t2 $FCB0(t0)
Lw t2 $0ACC(t2)
Addi t3 zero $0001
Lui t4 $089E
Lui t5 $03E0
Addi t5 t5 $0008
Lui t6 $Upper off value for address 089DE3F0
Ori t6 t6 $Lower off value for address 089DE3F0
Lui t7 $Upper off value for address 089DE3F4
Ori t7 t7 $Lower off value for address 089DE3F3
Bne t1 t3 $To next bne
Nop
Sw t5 $E3F0(t4)
Sw zero $E3F4(t4)
Bne t2 t3 $To "here"
Nop
Sw t5 $E3F4(t4)
Sw zero $E3F4(t4)
Jr ra
Nop
"here" Sw t6 $E3F0(t3)
Sw t7 $E3F4(t3)
Jr ra

Let me know if that works Razz
Back to top Go down
GunstarBlue




Posts : 37
Points : 41
Reputation : 0
Join date : 2010-09-29

Whats wrong with this sub? - Page 3 Empty
PostSubject: Re: Whats wrong with this sub?   Whats wrong with this sub? - Page 3 I_icon_minitimeWed Oct 06, 2010 10:58 am

Just got around to trying it. I activate the code and like half a second later the game just freezes. Before it was freezing when I tried to do something associated with the code. Now it just freezes =(

Pretty sure I entered the mips and all the values in correctly. But I was wondering how come in this instance none of the branches branch to a jr ra like in some of the other subs? Also why are there two jr ra's in one code? Just trying to learn a bit as I go.

Back to top Go down
-LeetGamer-
Admin



Posts : 247
Points : 397
Reputation : 4
Join date : 2010-09-29
Age : 30

Whats wrong with this sub? - Page 3 Empty
PostSubject: Re: Whats wrong with this sub?   Whats wrong with this sub? - Page 3 I_icon_minitimeWed Oct 06, 2010 1:47 pm

Bne t1 t3 $To next bne // if t1 != t3 go to next bne
Nop
// if t1 == t3
Sw t5 $E3F0(t4)
Sw zero $E3F4(t4)
Bne t2 t3 $To "here" // if t2 != t3 then both dma address's values are != 1 so we go to "here" which will store the off value
Nop
// if t2 = =t3
Sw t5 $E3F4(t4)
Sw zero $E3F4(t4)
Jr ra // End code so we don't store the off value
Nop
"here" Sw t6 $E3F0(t3)
Sw t7 $E3F4(t3)
Jr ra

Again, use the pinpoint method to find the freezing line then let me know what it is.
Back to top Go down
GunstarBlue




Posts : 37
Points : 41
Reputation : 0
Join date : 2010-09-29

Whats wrong with this sub? - Page 3 Empty
PostSubject: Re: Whats wrong with this sub?   Whats wrong with this sub? - Page 3 I_icon_minitimeThu Oct 07, 2010 12:42 pm

Alright, so I used the debug script and the game froze after the very first line in this sub:

Code:

Lui t0 $08CE
Lw t1 $FB90(t0)
Lw t1 $0AC4(t1)
Lw t2 $FCB0(t0)
Lw t2 $0ACC(t2)
Addi t3 zero $0001
Lui t4 $089E
Lui t5 $03E0
Addi t5 t5 $0008
Lui t6 $Upper off value for address 089DE3F0
Ori t6 t6 $Lower off value for address 089DE3F0
Lui t7 $Upper off value for address 089DE3F4
Ori t7 t7 $Lower off value for address 089DE3F3
Bne t1 t3 $To next bne
Nop
Sw t5 $E3F0(t4)
Sw zero $E3F4(t4)
Bne t2 t3 $To "here"
Nop
Sw t5 $E3F4(t4)
Sw zero $E3F4(t4)
Jr ra
Nop
"here" Sw t6 $E3F0(t3)
Sw t7 $E3F4(t3)
Jr ra

So basically it froze on the "Lw t1 $FB90(t0)"...

I don't see how that can be screwed up as it's the next logical step in the subroutine. The only thing I can figure is that it has something to do with the (T0) but besides that I'm lost. Do you have any thoughts?
Back to top Go down
-LeetGamer-
Admin



Posts : 247
Points : 397
Reputation : 4
Join date : 2010-09-29
Age : 30

Whats wrong with this sub? - Page 3 Empty
PostSubject: Re: Whats wrong with this sub?   Whats wrong with this sub? - Page 3 I_icon_minitimeThu Oct 07, 2010 12:49 pm

You sure that the pointer is 0x004DFB90 ? if it's not then the negative rule or the pointer in the subroutine is wrong.
Back to top Go down
GunstarBlue




Posts : 37
Points : 41
Reputation : 0
Join date : 2010-09-29

Whats wrong with this sub? - Page 3 Empty
PostSubject: Re: Whats wrong with this sub?   Whats wrong with this sub? - Page 3 I_icon_minitimeThu Oct 07, 2010 12:59 pm

Im sure about both. Assuming that like you said, all I had to do was change the value in the debug code by subtracting one to test it, then thats where it froze.

And Im sure that it's the right address and pointer is because I did a subroutine with only that dma code and it works by itself. I've only had problems when I've tried to run the subroutine including that address and another subroutine with the 2nd dma code at the same time.

The whole reason I'm trying to write this sub in the first place is because I can get one dma address to work with the code and the other to work with the code, but not both at the same time. So I figured if I just put both codes in one subroutine (since they both activate at the same value) I'd be fine, but it's not working =( .

Not that I don't still want your help or input on this code but do you know any reason why if I put them in 2 seperate subroutine'd codes why they cant work together?
Back to top Go down
-LeetGamer-
Admin



Posts : 247
Points : 397
Reputation : 4
Join date : 2010-09-29
Age : 30

Whats wrong with this sub? - Page 3 Empty
PostSubject: Re: Whats wrong with this sub?   Whats wrong with this sub? - Page 3 I_icon_minitimeThu Oct 07, 2010 1:02 pm

To be honest I don't know, this code is starting to annoy me lol Razz
Back to top Go down
GunstarBlue




Posts : 37
Points : 41
Reputation : 0
Join date : 2010-09-29

Whats wrong with this sub? - Page 3 Empty
PostSubject: Re: Whats wrong with this sub?   Whats wrong with this sub? - Page 3 I_icon_minitimeThu Oct 07, 2010 1:08 pm

You're not the only one... pissing me off too because this is like one of the biggest/last ones that I have to do before I can release the code project on my site.

A lot of ppl have been waiting for these codes so that the game can be played fairly...

Only thing I can do is try and undma it again and see if maybe I did it wrong, cuz to be honest even when I do use the subroutine that works with that code it still freezes after I quit the match anyway.

-EDIT-

OK, I went back and chose another pointer and address and when I put in the same subroutine by itself it works fine and doesn't freeze the game when I leave the match. But it STILL doesn't work in the sub that checks both that and the other address for the value. Dammnit!!!!!

Please tell me, Mips wise is there any reason these 2 codes shouldn't both work if I activate them at the same time?

(It's basically the same subroutine with the dma address changed, the share the same pointer and yes I've also tried it with different pointers that point to an address that does almost the same thing)

Code:

lui t0, $08ce
lw t0, $fcb0(t0)
lw t0, $0ac4(t0)
ori t1, zero, $0001
lui t2, $089e
lui t3, $03e0
ori t3, t3, $0008
lui t4 $Upper off value
ori t4 t4 $Lower off value
lui t5 $Upper off value for the next line
ori t5 t5 $Lower off value for the next line
bne t0, t1, $To "//here"
nop
sw t3, $e3f0(t2)
sw zero, $e3f4(t2)
beq zero zero $To jr ra
nop
//here
sw t4 $e3f0(t2)
sw t5 $e3f4(t2)
jr ra
nop

Code:
lui t0, $08ce
lw t0, $fbe0(t0)
lw t0, $0ac4(t0)
ori t1, zero, $0001
lui t2, $089e
lui t3, $03e0
ori t3, t3, $0008
lui t4 $Upper off value
ori t4 t4 $Lower off value
lui t5 $Upper off value for the next line
ori t5 t5 $Lower off value for the next line
bne t0, t1, $To "//here"
nop
sw t3, $e3f0(t2)
sw zero, $e3f4(t2)
beq zero zero $To jr ra
nop
//here
sw t4 $e3f0(t2)
sw t5 $e3f4(t2)
jr ra
nop
Back to top Go down
-LeetGamer-
Admin



Posts : 247
Points : 397
Reputation : 4
Join date : 2010-09-29
Age : 30

Whats wrong with this sub? - Page 3 Empty
PostSubject: Re: Whats wrong with this sub?   Whats wrong with this sub? - Page 3 I_icon_minitimeFri Oct 08, 2010 11:56 am

They look like they would work fine Sad
Back to top Go down
GunstarBlue




Posts : 37
Points : 41
Reputation : 0
Join date : 2010-09-29

Whats wrong with this sub? - Page 3 Empty
PostSubject: Re: Whats wrong with this sub?   Whats wrong with this sub? - Page 3 I_icon_minitimeSat Oct 09, 2010 7:56 am

Well thats just it, they do work fine just not when I put them both on at the same time.

Which ever one I put on 2nd takes over for the first code...

I know that we went through some stuff with that subroutine where we had to make it so that the code cut off at the end since it was having a problem with staying on. Is there anything I can tweak in terms of how the code ends that would allow them to both work?

I know I'm getting annoying but I can't believe that this wouldnt work when if I manually turn off one code and put on the other in the coderpr menu it works.
Back to top Go down
-LeetGamer-
Admin



Posts : 247
Points : 397
Reputation : 4
Join date : 2010-09-29
Age : 30

Whats wrong with this sub? - Page 3 Empty
PostSubject: Re: Whats wrong with this sub?   Whats wrong with this sub? - Page 3 I_icon_minitimeSat Oct 09, 2010 12:21 pm

Wait, do they both use the same hook or both use the same addresses?
Back to top Go down
GunstarBlue




Posts : 37
Points : 41
Reputation : 0
Join date : 2010-09-29

Whats wrong with this sub? - Page 3 Empty
PostSubject: Re: Whats wrong with this sub?   Whats wrong with this sub? - Page 3 I_icon_minitimeSat Oct 09, 2010 4:42 pm

They use different hooks and different addresses in the ram dump (i.e code 1 starts at 088006FC and 0880075C or something to that effect, but they don't overlap each other).

I think it might have something to do how we make the code end in the subroutine.. I could be wrong, just fishing for answers since it doesn't make any sense at all why it doesn't work when my other more simple subroutines work when I put them both on at the same times =(
Back to top Go down
Sponsored content





Whats wrong with this sub? - Page 3 Empty
PostSubject: Re: Whats wrong with this sub?   Whats wrong with this sub? - Page 3 I_icon_minitime

Back to top Go down
 
Whats wrong with this sub?
Back to top 
Page 3 of 3Go to page : Previous  1, 2, 3

Permissions in this forum:You cannot reply to topics in this forum
PSP Coding :: PSP Section :: PSP Chat :: PSP Coding Help-
Jump to: