(09-08-2017, 06:06 AM)One More Try Wrote: [ -> ]Yeah, then it multiplies them together in various ways between the three values.
Ah, I see. That's not what I expected, since each of the three values seems to correspond to an axis, but I suppose if the axes are relative to the object and not the plane that would make sense.
Quote:I think rather than automatic calcs after setting it between -180, 180 we need to compare the difference and make adjustments based on it. Like if the difference is greater than 90, but it's 88 vs -88, then just neg one. Or just check if the negative of one side makes the difference smaller -- within limits 2, -2 wouldn't want to trigger it probably...
We seem to be at about the same place now regarding this. My only problem, though, is that there should be some kind of rule governing when to neg and when not too, but it just doesn't seem to be consistent.
Quote:I saw a value over 3000
I'll need that remainder code.
I'll see what I can do about a proper one; I'd rather not have to use a loop like I have been for numbers that high.
Quote:It'll sometimes skip over our difference code entirely and intentionally load a certain value. Not sure if that's the source of any bugs. My difference comparison code runs rather well with mostly camera glitches.
That's strange. Any idea why?
(09-08-2017, 11:10 AM)JershJopstin Wrote: [ -> ]Ah, I see. That's not what I expected, since each of the three values seems to correspond to an axis, but I suppose if the axes are relative to the object and not the plane that would make sense.
We seem to be at about the same place now regarding this. My only problem, though, is that there should be some kind of rule governing when to neg and when not too, but it just doesn't seem to be consistent.
I'll see what I can do about a proper one; I'd rather not have to use a loop like I have been for numbers that high.
That's strange. Any idea why?
I think we can get the light sword to work correctly, and since we have the memory range for its values, I've been focusing on that. Your video looks similar to my results.
I can write a remainder code without a loop, but the problem is that it causes codewrite to output junk code at the end, so it's more of a final optimization code.
I'm not sure why it skips the difference. There's some comparison to determine it.
Rotating one value by 180 and seeing if it's near the second value seems important. Probably helps to load another float for comparisons:
0466daaX 41700000 X = 4, 8, or C and then lfs f##, X (r2) . 41700000 is a float of 15 in hex. You stick it above or below the codewrite output.
0466daa4 41700000 -> lfs f##, 4 (r2) -> f## = 15
We've basically been going through the same thought process since you realized negative angles give different sine lookups. I've been hesitant to rotate by 180, since that effectively limits the output to [-90,90], which feels too small. However, I'd also expect 4 to be about 172 degrees away from -176, based on a circle, and yet it's not. I may as well try it, I suppose.
Here's some more analysis:
f31= x = -156 vs 19
f30 = y = -47 vs -132
f29 = z = 62 vs -113
Outputs that are nearly equal:
-Sin(z)Cos(y) (output twice)
-Sin(y)
Maybe:
Cos(z)Cos(y)
I might be able to write a code that differences the outputs, but the angles themselves are saved for later too. Maybe a hybrid between saving good angle estimates and differencing the outputs.
Here's a crude rotation code, if the abs values add to 180 +/- 20. It also checks if the negative of one value is near the second value, in which case it negates one. Negatives may not line up.
$movie rotate test
0466daa4 41A00000
C23E1954 0000001A
C2420000 EE329028
FF408890 EF129024
EF18C02A EE920632
EEB2C024 FF20E090
FE600210 FC008840
EE130024 40A20008
EE129024 FC139040
40810014 EED40432
EC00B028 FE600210
4BFFFFEC FC15C040
41A20014 FF00A890
FF200090 FC00E090
4BFFFFC0 C2220004
FE600210 FE80CA10
EEC0C828 FEC0B210
FC168840 40A10038
FC000050 EEC0C828
FEC0B210 FC168840
40A10024 FC000050
EED3A02A EED69028
FEC0B210 FC168840
41A1000C EC129828
FF20A090 EC190028
FC1B1040 41820008
4E800020 FF609090
60000000 00000000
That works pretty well. I may try to refine the rotation calc, but I'd like to entertain another small idea I have first. What's the memory addresses for the function calls to the sine and cosine lookup tables? I can't seem to find them.
8040d608 code -> 8051d7fc mem. The psq_l after that for r5 loads the sin/cos, then I think it loads the next sin/cos values to calculate the fractions. The code might step in increments of 8 or 10 (hex). Code above 8040d680 is just getting the values and dealing with the decimals, so breakpoint at this address to see the values in f0,f1,f2. ps calculations do math on both the left and right float register at once and hold sin and cos for one value. ps instructions look complicated, but aren't much different than float instructions.
http://wiibrew.org/wiki/Paired_single
Someone said there was a speed bug at the end of movies, which I forgot to look into. Going to go back to bug hunting the main code.
/edit Objects that flicker (the hand when it crashes into the ocean) or soldiers that pop onto the screen for one frame are due to it skipping our code. Haven't looked into if it can be fixed.
Final alpha/beta bug fixes. Including: Burst Hit B! prompt accuracy, selection controls for arts ect being slowed down to normal, movies lagging at the end.
$Final Alpha 3
04667870 43480000 //Burst B fix
C2181264 00000002
EC0010FA EC00182A
60000000 00000000
0412e66c 41820008 //Slow Text
C212E668 00000003
7F85E378 7F66DB78
3E608000 82731824
2C130001 00000000 //Text End
041a3dec 41820008 //Slow Cutscene Text
C21A3DE8 00000003
807F0088 7FA4EB78
3E608000 82731824
2C130001 00000000
0466AB90 3F000000 //Cutscene Switch speed
C24A0838 00000002
3E808082 82949E68
2C140002 00000000
C203A52C 00000004 //screen dimming duration
3E808082 82949E68
2C140001 3803F800
41A20008 3803F000
60000000 00000000
C249A358 00000005 //Menu 60fps
3FC080CA 63DE54B4
EE80002A EE80A024
7C03F000 41A20008
EC210532 83C10008
60000000 00000000
041C3904 3803FFFA
041C38EC 2800001A
041C3890 2800001A
041C38A8 3803FFFA
046687A0 41A00000
046687A8 40666667
04668890 42080000
04668894 41900000 //Menu End
C24497D4 00000002 //Select art controls
7D084214 7CE83A14
60000000 00000000
C24497FC 00000002
7D084214 7CE83850
60000000 00000000 //Controls End
C20BAD8C 00000003 //Grass double value if fraction
EEA1082A FE810878
FC34A86E C01F2F48
60000000 00000000
C248C048 00000006 //waterfall pause 2
C3C2CE5C 3E808081
62949E68 82940000
2C140002 41820018
3E808000 82941824 //Gr1824
2C140000 41A20008
EFDEF028 00000000
C244B714 0000000A //Important Timer mod set
3E808000 62941824 //Gr 1824
80140000 68000001 //and FPS setter
90140000 3E808066
82944268 2C140000
38000001 41A2001C
3C008083 600047D4
7C140000 38000001
41A20008 38000002
3E808082 90149E68
38630001 00000000
C216ADC4 00000005 //Timer mods using Gr1824
3E808082 82949E68 //skip if movie
2C140002 3A800001
4182000C 3E808000
82941824 7C04A214
60000000 00000000
C216ADCC 00000001
7C03A214 00000000
C21669CC 00000003 //not skipped
EE421024 EE52902A
EC009024 D01E01E8
60000000 00000000 //End Timer
C244B468 00000001 //disable run speed update
60000000 00000000
C2137DE8 00000003 //UI Speeds Half
EC01082A EC000824
EC210024 C0030010
60000000 00000000
C205C414 00000002 //Climb fix
EC1FF82A EFFF0024
EC01EFFA 00000000
04819e78 0000001E //set run speed manually
22CA54C0 00000000
04CA54C0 3F000000 //60 fps speed
0466766c 3F000000 //intro speed adjust
E0000000 80008000
I'd like to post this on the first page, but I'll wait a day in case someone wants to try it and report back. I saw no problems myself.
(09-09-2017, 04:06 PM)One More Try Wrote: [ -> ]8040d608 code -> 8051d7fc mem. The psq_l after that for r5 loads the sin/cos, then I think it loads the next sin/cos values to calculate the fractions. The code might step in increments of 8 or 10 (hex). Code above 8040d680 is just getting the values and dealing with the decimals, so breakpoint at this address to see the values in f0,f1,f2. ps calculations do math on both the left and right float register at once and hold sin and cos for one value. ps instructions look complicated, but aren't much different than float instructions. http://wiibrew.org/wiki/Paired_single
Someone said there was a speed bug at the end of movies, which I forgot to look into. Going to go back to bug hunting the main code.
/edit Objects that flicker (the hand when it crashes into the ocean) or soldiers that pop onto the screen for one frame are due to it skipping our code. Haven't looked into if it can be fixed.
Final alpha/beta bug fixes. Including: Burst Hit B! prompt accuracy, selection controls for arts ect being slowed down to normal, movies lagging at the end.
$Final Alpha 3
04667870 43480000 //Burst B fix
C2181264 00000002
EC0010FA EC00182A
60000000 00000000
0412e66c 41820008 //Slow Text
C212E668 00000003
7F85E378 7F66DB78
3E608000 82731824
2C130001 00000000 //Text End
041a3dec 41820008 //Slow Cutscene Text
C21A3DE8 00000003
807F0088 7FA4EB78
3E608000 82731824
2C130001 00000000
044A083C 60000000 //Slow Cutscene switch
0466AB90 3F000000
0403A52C 3803F800 //Slow screen Dimming
C249A358 00000005 //Menu 60fps
3FC080CA 63DE54B4
EE80002A EE80A024
7C03F000 41A20008
EC210532 83C10008
60000000 00000000
041C3904 3803FFFA
041C38EC 2800001A
041C3890 2800001A
041C38A8 3803FFFA
046687A0 41A00000
046687A8 40666667
04668890 42080000
04668894 41900000 //Menu End
C24497D4 00000002 //Select art controls
7D084214 7CE83A14
60000000 00000000
C24497FC 00000002
7D084214 7CE83850
60000000 00000000 //Controls End
C20BAD8C 00000003 //Grass double value if fraction
EEA1082A FE810878
FC34A86E C01F2F48
60000000 00000000
C248C048 00000006 //waterfall pause 2
C3C2CE5C 3E808081
62949E68 82940000
2C140002 41820018
3E808000 82941824 //Gr1824
2C140000 41A20008
EFDEF028 00000000
C244B714 0000000A //Important Timer mod set
3E808000 62941824 //Gr 1824
80140000 68000001 //and FPS setter
90140000 3E808066
82944268 2C140000
38000001 41A2001C
3C008083 600047D4
7C140000 38000001
41A20008 38000002
3E808082 90149E68
38630001 00000000
C216ADC4 00000005 //Timer mods using Gr1824
3E808082 82949E68 //skip if movie
2C140002 3A800001
4182000C 3E808000
82941824 7C04A214
60000000 00000000
C216ADCC 00000001
7C03A214 00000000
C21669CC 00000003 //not skipped
EE421024 EE52902A
EC009024 D01E01E8
60000000 00000000 //End Timer
C244B468 00000001 //disable run speed update
60000000 00000000
C2137DE8 00000003 //UI Speeds Half
EC01082A EC000824
EC210024 C0030010
60000000 00000000
C205C414 00000002 //Climb fix
EC1FF82A EFFF0024
EC01EFFA 00000000
04819e78 0000001E //set run speed manually
22CA54C0 00000000
04CA54C0 3F000000 //60 fps speed
0466766c 3F000000 //intro speed adjust
E0000000 80008000
I'd like to post this on the first page, but I'll wait a day in case someone wants to try it and report back. I saw no problems myself.
I noticed that this new code stutters more than the old one even in Vulkan renderer, CPU Clock Override 250% and no antialiasing. In the beginning, once you are able to control Dunban and his party against the mechons it stutters every 15 seconds or so, this little inconvenience didn't happened with the older code you provided. I only tested that little bit though, I reverted back to the old code because of this inconvenience, don't know if anyone else is having that stutter.
But anyways like always, keep up the amazing work dude!
Thanks, I tend not to use the intro as a benchmark because it has more lag than normal. Could you see if a normal fight after that, with the Monado, is much worse? I can probably look into any lag issues that are past the intro.
Also, what is the last code you're referring to? Is it a final alpha code or a code in the first post?
I've found something interesting regarding angle calcs 60fps movies, but I'll need to investigate a bit more before I can put it into words here. /edit: Okay, I made a mistake and didn't find what I think I did. However, I did find something else; it's conditionally negating the sine value. Figuring out what the condition is may tell us how to correctly find the intermediate angle. /edit2: Nevermind, it seems the sine lookup table will always produce a positive result. The conditional flip just flips sine if the angle was less than 0, giving the correct value. Strangely, the cosine lookup table works perfectly fine.
@Resus: In addition to One More Try's questions, what do you mean by stutter? Dropping down below 60 but still running (and still staying above 30), or hard pauses that last half a second or so? If it's the latter, are you running a version of dolphin that's newer than 5.0-4575?