Free Look [JoshuaMK]
This was a code I was wanting to keep to myself until completed, but I just simply can't figure out why the camera's params are corrupting when the camera's angle float values are subtracted from. If I or some other person can figure this out, I can continue with this code. Currently only tilting up or right works. Down and left corrupt everything.

Free Look [JoshuaMK]

28343E80 F7FF0800
C2597F54 0000002A
3D808034 618CC202
3FA08145 8BFD01FF
281F0000 40A20014
999D01FF D05D0200
D01D0204 D03D0208
C05D0200 C01D0204
892C0000 888C0001
886C0002 88AC0003
3929FF80 3884FF80
3863FF80 38A5FF80
2C090041 41810014
2C09FFBF 41810010
3920FFBF 48000008
39200041 2C040041
41810014 2C04FFBF
41810010 3880FFBF
48000008 38800041
2C030041 41810014
2C03FFBF 41810010
3860FFBF 48000008
38600041 2C030041
4181FFF8 2C05FFBF
41810010 38A0FFBF
48000008 38A00041
993D020C 989D0210
987D0214 98BD0218
2C03000F 41810010
2C03FFF1 41800008
4800000C C3FD0214
EC42F82A 2C05000F
41810010 2C05FFF1
41800008 4800000C
C3DD0218 EC00F02A
2C1E0090 40820020
2C05000F 41810010
2C05FFF1 41800008
4800000C C3BD0218
EC21E82A D05D0200
D01D0204 D03D0208
D05C00AC D03C00B4
D01C00B0 00000000
CC000000 00000000
04597F54 D01C00B0
054501FF 00000000
E0000000 80008000


#Inject > 80597F54#

#PARAMS for camera angle
#f2 = X Axis Position
#f1 = Z Axis Position
#f0 = Y Axis Position

.macro grab_controller_address
lis r12, 0x8034
ori r12, r12, 0xC202

.macro grab_camera_params
lis r29, 0x8145
lbz r31, 0x01FF (r29)
cmplwi r31, 0
bne+ params_set
stb r12, 0x01FF (r29)
stfs f2, 0x0200 (r29)
stfs f0, 0x0204 (r29)
stfs f1, 0x0208 (r29)
lfs f2, 0x0200 (r29)
lfs f0, 0x0204 (r29)
lfs f1, 0x0208 (r29)

.macro store_floats
stfs f2, 0x0200 (r29)
stfs f0, 0x0204 (r29)
stfs f1, 0x0208 (r29)
stfs f2, 0x00AC (r28)
stfs f1, 0x00B4 (r28)
stfs f0, 0x00B0 (r28)

.macro subtract
subi r9, r9, 0x80
subi r4, r4, 0x80
subi r3, r3, 0x80
subi r5, r5, 0x80

.macro divide
li r11, 0x4
divw r9, r9, r11
divw r4, r4, r11
divw r3, r3, r11
divw r5, r5, r11

.macro multiply
mulli r9, r9, 3
mulli r4, r4, 3
mulli r3, r3, 3
mulli r5, r5, 3

.macro compare_statements
cmpwi r9, 0x41
bgt shrink_r9
cmpwi r9, -0x41
bgt continue
li r9, -0x41
b continue
li r9, 0x41
cmpwi r4, 0x41
bgt shrink_r4
cmpwi r4, -0x41
bgt continue_1
li r4, -0x41
b continue_1
li r4, 0x41
cmpwi r3, 0x41
bgt shrink_r3
cmpwi r3, -0x41
bgt continue_2
li r3, -0x41
b continue_2
li r3, 0x41
cmpwi r5, 0x41
bgt shrink_r5
cmpwi r5, -0x41
bgt continue_3
li r5, -0x41
b continue_3
li r5, 0x41

.macro figure_controller_values
lhz r30, -0x2 (r12)
lbz r9, 0 (r12)
lbz r4, 0x1 (r12)
lbz r3, 0x2 (r12)
lbz r5, 0x3 (r12)
stb r9, 0x020C (r29)
stb r4, 0x0210 (r29)
stb r3, 0x0214 (r29)
stb r5, 0x0218 (r29)

.macro compare_and_add
cmpwi r3, 15
bgt add_f31
cmpwi r3, -15
blt add_f31
b check_vertical
lfs f31, 0x0214 (r29)
fadds f2, f2, f31
cmpwi r5, 15
bgt add_f30
cmpwi r5, -15
blt add_f30
b check_z
lfs f30, 0x0218 (r29)
fadds f0, f0, f30
cmpwi r30, 0x0090
bne the_end
cmpwi r5, 15
bgt add_f29
cmpwi r5, -15
blt add_f29
b the_end
lfs f29, 0x0218 (r29)
fadds f1, f1, f29


I don't expect anything to come from this, but I wanted to try all options.
(10-14-2019, 11:55 PM)Vega Wrote: Was lucky enough to be one of few to learn proper ASM. Now I just post random garbage on Make it to a 1000 thread.
Was lucky enough to be one of few to learn proper ASM. Now I'm writing codes that I hope amaze!  Tongue

Messages In This Thread
Free Look [JoshuaMK] - by JoshuaMK - 09-21-2019, 10:09 PM
RE: Free Look [JoshuaMK] - by Vega - 09-22-2019, 01:48 PM
RE: Free Look [JoshuaMK] - by JoshuaMK - 09-22-2019, 06:40 PM
RE: Free Look [JoshuaMK] - by salmon01 - 09-22-2019, 11:39 PM
RE: Free Look [JoshuaMK] - by JoshuaMK - 09-23-2019, 12:50 AM
RE: Free Look [JoshuaMK] - by Vega - 10-09-2019, 10:47 PM
RE: Free Look [JoshuaMK] - by salmon01 - 10-09-2019, 11:51 PM
RE: Free Look [JoshuaMK] - by JoshuaMK - 10-10-2019, 03:11 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)