-
Notifications
You must be signed in to change notification settings - Fork 3
/
3d_coins.patch
718 lines (697 loc) · 29.7 KB
/
3d_coins.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
diff --git a/actors/coin/coin_custom.i4.png b/actors/coin/coin_custom.i4.png
new file mode 100644
index 0000000000000000000000000000000000000000..588cd42044a0a7473ce4dcb90ffcb89b026458b2
GIT binary patch
literal 539
zcmV+$0_6RPP)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F80005vNkl<Zc-rlj
zEsVlI5Jne=tgJ*Lkw_#Gi9{liNMvOtva%A1L?V$$B(f66-P`0NJ<@iE-ob^0NhXD5
zcjnE{PU)OZr>px%>3jg*7N95!mt~oYqR7o=v)2M#E*H06uifEraNTa#O(qjJ9*<uK
zu;1@pk|ZvUW3Oamu~@iXulIZaoUK+XAN^=F@&Ewwc{-i?j64-!x7+#XsXaY_0EA<D
z;n6HS1fb}T$D?;n^a$VSiNRp-a6{Gt&}dQ|^Caz?&Biy}d_MoNKhJXy0t8tgLn?<r
zO#nC{%{cu2?dBXsFiN!dM%hbg&gZk=%RV5`e!uV6Xw)D8Q2+o4hlmCPJTc1Wx<(T)
z5PG7VL5IU(7y#os2mmSljQ}EeY?^yO(KJPD5%q#fX$DXa@N5f#bJ?nL-Ux7?33awb
zfE93)a}xlEsU6dfNf#11<CcV+n*o-~<?Zcfku*(x*(@)pAOMjw{TMvF^(>-U!kJL-
z1ObRfqqZtLWafS-vA*4I{d(2iHv>?691{g)sEbwus|->eLQPp{1i(0oaSbHhYg8G~
z<kJYoDKHv5tpP|qhZUKeS9Nz81_7A;thFuyM$2inTr2Gpc-;gv0VsVIr)|%^@89wd
dzz5*3<O}p=)(}esU#tKC002ovPDHLkV1hE>=v@E+
literal 0
HcmV?d00001
diff --git a/actors/coin/geo.inc.c b/actors/coin/geo.inc.c
index bfb2d92..b8067f8 100644
--- a/actors/coin/geo.inc.c
+++ b/actors/coin/geo.inc.c
@@ -1,76 +1,32 @@
-// 0x1600013C
const GeoLayout yellow_coin_geo[] = {
- GEO_SHADOW(SHADOW_CIRCLE_4_VERTS, 0xB4, 50),
+ GEO_SHADOW(SHADOW_CIRCLE_4_VERTS, 0xB4, 80),
GEO_OPEN_NODE(),
- GEO_SWITCH_CASE(8, geo_switch_anim_state),
+ GEO_ASM(0, geo_rotate_coin),
GEO_OPEN_NODE(),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007800),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007800),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007828),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007828),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007850),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007850),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007878),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007878),
+ GEO_DISPLAY_LIST(LAYER_ALPHA, coin_material_yellow),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_END(),
};
-// 0x160001A0
const GeoLayout yellow_coin_no_shadow_geo[] = {
- GEO_NODE_START(),
- GEO_OPEN_NODE(),
- GEO_SWITCH_CASE(8, geo_switch_anim_state),
- GEO_OPEN_NODE(),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007800),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007800),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007828),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007828),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007850),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007850),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007878),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007878),
- GEO_CLOSE_NODE(),
- GEO_CLOSE_NODE(),
+ GEO_BRANCH(1, yellow_coin_geo),
GEO_END(),
};
-// 0x16000200
const GeoLayout blue_coin_geo[] = {
GEO_SHADOW(SHADOW_CIRCLE_4_VERTS, 0xB4, 80),
GEO_OPEN_NODE(),
- GEO_SWITCH_CASE(8, geo_switch_anim_state),
+ GEO_ASM(0, geo_rotate_coin),
GEO_OPEN_NODE(),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_030078A0),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_030078A0),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_030078C8),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_030078C8),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_030078F0),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_030078F0),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007918),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007918),
+ GEO_DISPLAY_LIST(LAYER_ALPHA, coin_material_blue),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_END(),
};
-// 0x16000264
const GeoLayout blue_coin_no_shadow_geo[] = {
- GEO_NODE_START(),
- GEO_OPEN_NODE(),
- GEO_SWITCH_CASE(8, geo_switch_anim_state),
- GEO_OPEN_NODE(),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_030078A0),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_030078A0),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_030078C8),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_030078C8),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_030078F0),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_030078F0),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007918),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007918),
- GEO_CLOSE_NODE(),
- GEO_CLOSE_NODE(),
+ GEO_BRANCH(1, blue_coin_geo),
GEO_END(),
};
@@ -78,16 +34,9 @@ const GeoLayout blue_coin_no_shadow_geo[] = {
const GeoLayout red_coin_geo[] = {
GEO_SHADOW(SHADOW_CIRCLE_4_VERTS, 0xB4, 80),
GEO_OPEN_NODE(),
- GEO_SWITCH_CASE(8, geo_switch_anim_state),
+ GEO_ASM(0, geo_rotate_coin),
GEO_OPEN_NODE(),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007940),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007940),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007968),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007968),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007990),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007990),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_030079B8),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_030079B8),
+ GEO_DISPLAY_LIST(LAYER_ALPHA, coin_material_red),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_END(),
@@ -95,19 +44,6 @@ const GeoLayout red_coin_geo[] = {
// 0x16000328
const GeoLayout red_coin_no_shadow_geo[] = {
- GEO_NODE_START(),
- GEO_OPEN_NODE(),
- GEO_SWITCH_CASE(8, geo_switch_anim_state),
- GEO_OPEN_NODE(),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007940),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007940),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007968),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007968),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007990),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_03007990),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_030079B8),
- GEO_DISPLAY_LIST(LAYER_ALPHA, coin_seg3_dl_030079B8),
- GEO_CLOSE_NODE(),
- GEO_CLOSE_NODE(),
+ GEO_BRANCH(1, red_coin_geo),
GEO_END(),
};
diff --git a/actors/coin/model.inc.c b/actors/coin/model.inc.c
index dcb637d..24429e9 100644
--- a/actors/coin/model.inc.c
+++ b/actors/coin/model.inc.c
@@ -1,176 +1,166 @@
-// Coin
-
-// 0x030056C0
-static const Vtx coin_seg3_vertex_030056C0[] = {
- {{{ -32, 0, 0}, 0, { 0, 1984}, {0xff, 0xff, 0x00, 0xff}}},
- {{{ 32, 0, 0}, 0, { 1984, 1984}, {0xff, 0xff, 0x00, 0xff}}},
- {{{ 32, 64, 0}, 0, { 1984, 0}, {0xff, 0xff, 0x00, 0xff}}},
- {{{ -32, 64, 0}, 0, { 0, 0}, {0xff, 0xff, 0x00, 0xff}}},
-};
-
-// 0x03005700
-static const Vtx coin_seg3_vertex_03005700[] = {
- {{{ -50, 0, 0}, 0, { 0, 1984}, {0x78, 0x78, 0xff, 0xff}}},
- {{{ 50, 0, 0}, 0, { 1984, 1984}, {0x78, 0x78, 0xff, 0xff}}},
- {{{ 50, 100, 0}, 0, { 1984, 0}, {0x78, 0x78, 0xff, 0xff}}},
- {{{ -50, 100, 0}, 0, { 0, 0}, {0x78, 0x78, 0xff, 0xff}}},
-};
-
-// 0x03005740
-static const Vtx coin_seg3_vertex_03005740[] = {
- {{{ -35, 0, 0}, 0, { 0, 1984}, {0xff, 0x00, 0x00, 0xff}}},
- {{{ 35, 0, 0}, 0, { 1984, 1984}, {0xff, 0x00, 0x00, 0xff}}},
- {{{ 35, 70, 0}, 0, { 1984, 0}, {0xff, 0x00, 0x00, 0xff}}},
- {{{ -35, 70, 0}, 0, { 0, 0}, {0xff, 0x00, 0x00, 0xff}}},
-};
-
-// 0x03005780
-ALIGNED8 static const Texture coin_seg3_texture_03005780[] = {
-#include "actors/coin/coin_front.ia16.inc.c"
-};
-
-// 0x03005F80
-ALIGNED8 static const Texture coin_seg3_texture_03005F80[] = {
-#include "actors/coin/coin_tilt_right.ia16.inc.c"
-};
-
-// 0x03006780
-ALIGNED8 static const Texture coin_seg3_texture_03006780[] = {
-#include "actors/coin/coin_side.ia16.inc.c"
-};
-
-// 0x03006F80
-ALIGNED8 static const Texture coin_seg3_texture_03006F80[] = {
-#include "actors/coin/coin_tilt_left.ia16.inc.c"
+ALIGNED8 const Texture coin_i4[] = {
+ #include "actors/coin/coin_custom.i4.inc.c"
+};
+
+Vtx coin_material_mesh_vtx_0[53] = {
+ {{{-17, 6, -5},0, {-784, 939},{0xD1, 0xAC, 0xAD, 0xFF}}},
+ {{{17, 6, -5},0, {-272, 939},{0x2F, 0xAC, 0xAD, 0xFF}}},
+ {{{0, 2, -5},0, {-528, 1008},{0x0, 0xA0, 0xAC, 0xFF}}},
+ {{{30, 19, -5},0, {-85, 752},{0x52, 0xCF, 0xAD, 0xFF}}},
+ {{{-30, 19, -5},0, {-972, 752},{0xAE, 0xCF, 0xAD, 0xFF}}},
+ {{{35, 36, -5},0, {-16, 496},{0x60, 0x0, 0xAD, 0xFF}}},
+ {{{-35, 36, -5},0, {-1040, 496},{0xA0, 0x0, 0xAD, 0xFF}}},
+ {{{30, 53, -5},0, {-85, 240},{0x52, 0x31, 0xAD, 0xFF}}},
+ {{{-30, 53, -5},0, {-972, 240},{0xAE, 0x31, 0xAD, 0xFF}}},
+ {{{17, 66, -5},0, {-272, 52},{0x2F, 0x54, 0xAD, 0xFF}}},
+ {{{-17, 66, -5},0, {-784, 52},{0xD1, 0x54, 0xAD, 0xFF}}},
+ {{{0, 70, -5},0, {-528, -16},{0x0, 0x60, 0xAC, 0xFF}}},
+ {{{-17, 6, -5},0, {-272, -84},{0xD1, 0xAC, 0xAD, 0xFF}}},
+ {{{-30, 19, 5},0, {-85, -272},{0xAE, 0xCF, 0x53, 0xFF}}},
+ {{{-30, 19, -5},0, {-85, -272},{0xAE, 0xCF, 0xAD, 0xFF}}},
+ {{{-17, 6, 5},0, {-272, -84},{0xD1, 0xAC, 0x53, 0xFF}}},
+ {{{0, 2, -5},0, {-528, -16},{0x0, 0xA0, 0xAC, 0xFF}}},
+ {{{-17, 6, 5},0, {-272, -84},{0xD1, 0xAC, 0x53, 0xFF}}},
+ {{{-17, 6, -5},0, {-272, -84},{0xD1, 0xAC, 0xAD, 0xFF}}},
+ {{{0, 2, 5},0, {-528, -16},{0x0, 0xA0, 0x54, 0xFF}}},
+ {{{17, 6, -5},0, {-784, -84},{0x2F, 0xAC, 0xAD, 0xFF}}},
+ {{{17, 6, 5},0, {-784, -84},{0x2F, 0xAC, 0x53, 0xFF}}},
+ {{{30, 19, -5},0, {-972, -272},{0x52, 0xCF, 0xAD, 0xFF}}},
+ {{{30, 19, 5},0, {-972, -272},{0x52, 0xCF, 0x53, 0xFF}}},
+ {{{35, 36, 5},0, {-1040, -528},{0x60, 0x0, 0x53, 0xFF}}},
+ {{{35, 36, -5},0, {-1040, -528},{0x60, 0x0, 0xAD, 0xFF}}},
+ {{{30, 53, -5},0, {-972, -784},{0x52, 0x31, 0xAD, 0xFF}}},
+ {{{30, 53, 5},0, {-972, -784},{0x52, 0x31, 0x53, 0xFF}}},
+ {{{17, 66, -5},0, {-784, -971},{0x2F, 0x54, 0xAD, 0xFF}}},
+ {{{17, 66, 5},0, {-784, -971},{0x2F, 0x54, 0x53, 0xFF}}},
+ {{{0, 70, -5},0, {-528, -1040},{0x0, 0x60, 0xAC, 0xFF}}},
+ {{{0, 70, 5},0, {-528, -1040},{0x0, 0x60, 0x54, 0xFF}}},
+ {{{-17, 66, -5},0, {-272, -971},{0xD1, 0x54, 0xAD, 0xFF}}},
+ {{{0, 70, 5},0, {-528, -1040},{0x0, 0x60, 0x54, 0xFF}}},
+ {{{0, 70, -5},0, {-528, -1040},{0x0, 0x60, 0xAC, 0xFF}}},
+ {{{-17, 66, 5},0, {-272, -971},{0xD1, 0x54, 0x53, 0xFF}}},
+ {{{-30, 53, -5},0, {-85, -784},{0xAE, 0x31, 0xAD, 0xFF}}},
+ {{{-30, 53, 5},0, {-85, -784},{0xAE, 0x31, 0x53, 0xFF}}},
+ {{{-35, 36, 5},0, {-16, -528},{0xA0, 0x0, 0x53, 0xFF}}},
+ {{{-35, 36, -5},0, {-16, -528},{0xA0, 0x0, 0xAD, 0xFF}}},
+ {{{-30, 19, -5},0, {-85, -272},{0xAE, 0xCF, 0xAD, 0xFF}}},
+ {{{-30, 19, 5},0, {-85, -272},{0xAE, 0xCF, 0x53, 0xFF}}},
+ {{{35, 36, 5},0, {-1040, -528},{0x60, 0x0, 0x53, 0xFF}}},
+ {{{30, 19, 5},0, {-972, -272},{0x52, 0xCF, 0x53, 0xFF}}},
+ {{{-17, 6, 5},0, {-272, -84},{0xD1, 0xAC, 0x53, 0xFF}}},
+ {{{17, 6, 5},0, {-784, -84},{0x2F, 0xAC, 0x53, 0xFF}}},
+ {{{0, 2, 5},0, {-528, -16},{0x0, 0xA0, 0x54, 0xFF}}},
+ {{{30, 53, 5},0, {-972, -784},{0x52, 0x31, 0x53, 0xFF}}},
+ {{{-30, 53, 5},0, {-85, -784},{0xAE, 0x31, 0x53, 0xFF}}},
+ {{{30, 53, 5},0, {-972, -784},{0x52, 0x31, 0x53, 0xFF}}},
+ {{{17, 66, 5},0, {-784, -971},{0x2F, 0x54, 0x53, 0xFF}}},
+ {{{-17, 66, 5},0, {-272, -971},{0xD1, 0x54, 0x53, 0xFF}}},
+ {{{0, 70, 5},0, {-528, -1040},{0x0, 0x60, 0x54, 0xFF}}},
+};
+
+Gfx coin_material_mesh_tri_0[] = {
+ gsSPVertex(coin_material_mesh_vtx_0 + 0, 16, 0),
+ gsSP1Triangle(0, 1, 2, 0),
+ gsSP1Triangle(1, 0, 3, 0),
+ gsSP1Triangle(3, 0, 4, 0),
+ gsSP1Triangle(3, 4, 5, 0),
+ gsSP1Triangle(5, 4, 6, 0),
+ gsSP1Triangle(5, 6, 7, 0),
+ gsSP1Triangle(7, 6, 8, 0),
+ gsSP1Triangle(7, 8, 9, 0),
+ gsSP1Triangle(9, 8, 10, 0),
+ gsSP1Triangle(9, 10, 11, 0),
+ gsSP1Triangle(12, 13, 14, 0),
+ gsSP1Triangle(13, 12, 15, 0),
+ gsSPVertex(coin_material_mesh_vtx_0 + 16, 16, 0),
+ gsSP1Triangle(0, 1, 2, 0),
+ gsSP1Triangle(1, 0, 3, 0),
+ gsSP1Triangle(4, 3, 0, 0),
+ gsSP1Triangle(3, 4, 5, 0),
+ gsSP1Triangle(6, 5, 4, 0),
+ gsSP1Triangle(5, 6, 7, 0),
+ gsSP1Triangle(6, 8, 7, 0),
+ gsSP1Triangle(8, 6, 9, 0),
+ gsSP1Triangle(10, 8, 9, 0),
+ gsSP1Triangle(8, 10, 11, 0),
+ gsSP1Triangle(12, 11, 10, 0),
+ gsSP1Triangle(11, 12, 13, 0),
+ gsSP1Triangle(14, 13, 12, 0),
+ gsSP1Triangle(13, 14, 15, 0),
+ gsSPVertex(coin_material_mesh_vtx_0 + 32, 16, 0),
+ gsSP1Triangle(0, 1, 2, 0),
+ gsSP1Triangle(1, 0, 3, 0),
+ gsSP1Triangle(4, 3, 0, 0),
+ gsSP1Triangle(3, 4, 5, 0),
+ gsSP1Triangle(4, 6, 5, 0),
+ gsSP1Triangle(6, 4, 7, 0),
+ gsSP1Triangle(8, 6, 7, 0),
+ gsSP1Triangle(6, 8, 9, 0),
+ gsSP1Triangle(9, 10, 6, 0),
+ gsSP1Triangle(9, 11, 10, 0),
+ gsSP1Triangle(12, 11, 9, 0),
+ gsSP1Triangle(12, 13, 11, 0),
+ gsSP1Triangle(13, 12, 14, 0),
+ gsSP1Triangle(6, 10, 15, 0),
+ gsSP1Triangle(6, 15, 5, 0),
+ gsSPVertex(coin_material_mesh_vtx_0 + 48, 5, 0),
+ gsSP1Triangle(0, 1, 2, 0),
+ gsSP1Triangle(0, 2, 3, 0),
+ gsSP1Triangle(3, 2, 4, 0),
+ gsSPEndDisplayList(),
};
-// 0x03007780 - 0x030077D0
-const Gfx coin_seg3_dl_03007780[] = {
- gsDPPipeSync(),
- gsSPClearGeometryMode(G_LIGHTING),
- gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA),
- gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON),
- gsDPSetTile(G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD),
+Gfx mat_coin_coin[] = {
+ gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT),
+ gsSPTexture(65535, 65535, 0, 0, 1),
+ gsDPTileSync(),
+ gsDPSetTextureImage(G_IM_FMT_I, G_IM_SIZ_8b, 16, coin_i4),
+ gsDPSetTile(G_IM_FMT_I, G_IM_SIZ_8b, 2, 0, 7, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, 0),
gsDPLoadSync(),
- gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
- gsDPSetTile(G_IM_FMT_IA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD),
- gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC),
+ gsDPLoadTile(7, 0, 0, 62, 124),
+ gsDPPipeSync(),
+ gsDPSetTile(G_IM_FMT_I, G_IM_SIZ_4b, 2, 0, 0, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, 0),
+ gsDPSetTileSize(0, 0, 0, 124, 124),
gsSPEndDisplayList(),
};
-// 0x030077D0 - 0x03007800
-const Gfx coin_seg3_dl_030077D0[] = {
- gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0),
- gsSPTexture(0x0001, 0x0001, 0, G_TX_RENDERTILE, G_OFF),
- gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
+Gfx coin_material_mesh[] = {
+ gsSPDisplayList(mat_coin_coin),
+ gsSPDisplayList(coin_material_mesh_tri_0),
+ gsDPPipeSync(),
gsSPSetGeometryMode(G_LIGHTING),
+ gsSPClearGeometryMode(G_TEXTURE_GEN),
+ gsDPSetCombineLERP(0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT, 0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT),
+ gsSPTexture(65535, 65535, 0, 0, 0),
gsSPEndDisplayList(),
};
-// 0x03007800 - 0x03007828
-const Gfx coin_seg3_dl_03007800[] = {
- gsDPPipeSync(),
- gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_03005780),
- gsSPDisplayList(coin_seg3_dl_03007780),
- gsSPVertex(coin_seg3_vertex_030056C0, 4, 0),
- gsSPBranchList(coin_seg3_dl_030077D0),
-};
+Lights1 coin_lights_yellow = gdSPDefLights1(
+ 0x7F, 0x61, 0x07,
+ 0xFF, 0xC2, 0x0E, 0x28, 0x28, 0x28);
-// 0x03007828 - 0x03007850
-const Gfx coin_seg3_dl_03007828[] = {
+Gfx coin_material_yellow[] = {
gsDPPipeSync(),
- gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_03005F80),
- gsSPDisplayList(coin_seg3_dl_03007780),
- gsSPVertex(coin_seg3_vertex_030056C0, 4, 0),
- gsSPBranchList(coin_seg3_dl_030077D0),
+ gsSPSetLights1(coin_lights_yellow),
+ gsSPBranchList(coin_material_mesh),
};
-// 0x03007850 - 0x03007878
-const Gfx coin_seg3_dl_03007850[] = {
- gsDPPipeSync(),
- gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_03006780),
- gsSPDisplayList(coin_seg3_dl_03007780),
- gsSPVertex(coin_seg3_vertex_030056C0, 4, 0),
- gsSPBranchList(coin_seg3_dl_030077D0),
-};
+Lights1 coin_lights_blue = gdSPDefLights1(
+ 0x0D, 0x35, 0x73,
+ 0x1A, 0x6B, 0xE6, 0x28, 0x28, 0x28);
-// 0x03007878 - 0x030078A0
-const Gfx coin_seg3_dl_03007878[] = {
+Gfx coin_material_blue[] = {
gsDPPipeSync(),
- gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_03006F80),
- gsSPDisplayList(coin_seg3_dl_03007780),
- gsSPVertex(coin_seg3_vertex_030056C0, 4, 0),
- gsSPBranchList(coin_seg3_dl_030077D0),
+ gsSPSetLights1(coin_lights_blue),
+ gsSPBranchList(coin_material_mesh),
};
-// 0x030078A0 - 0x030078C8
-const Gfx coin_seg3_dl_030078A0[] = {
- gsDPPipeSync(),
- gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_03005780),
- gsSPDisplayList(coin_seg3_dl_03007780),
- gsSPVertex(coin_seg3_vertex_03005700, 4, 0),
- gsSPBranchList(coin_seg3_dl_030077D0),
-};
-
-// 0x030078C8 - 0x030078F0
-const Gfx coin_seg3_dl_030078C8[] = {
- gsDPPipeSync(),
- gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_03005F80),
- gsSPDisplayList(coin_seg3_dl_03007780),
- gsSPVertex(coin_seg3_vertex_03005700, 4, 0),
- gsSPBranchList(coin_seg3_dl_030077D0),
-};
-
-// 0x030078F0 - 0x03007918
-const Gfx coin_seg3_dl_030078F0[] = {
- gsDPPipeSync(),
- gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_03006780),
- gsSPDisplayList(coin_seg3_dl_03007780),
- gsSPVertex(coin_seg3_vertex_03005700, 4, 0),
- gsSPBranchList(coin_seg3_dl_030077D0),
-};
-
-// 0x03007918 - 0x03007940
-const Gfx coin_seg3_dl_03007918[] = {
- gsDPPipeSync(),
- gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_03006F80),
- gsSPDisplayList(coin_seg3_dl_03007780),
- gsSPVertex(coin_seg3_vertex_03005700, 4, 0),
- gsSPBranchList(coin_seg3_dl_030077D0),
-};
-
-// 0x03007940 - 0x03007968
-const Gfx coin_seg3_dl_03007940[] = {
- gsDPPipeSync(),
- gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_03005780),
- gsSPDisplayList(coin_seg3_dl_03007780),
- gsSPVertex(coin_seg3_vertex_03005740, 4, 0),
- gsSPBranchList(coin_seg3_dl_030077D0),
-};
-
-// 0x03007968 - 0x03007990
-const Gfx coin_seg3_dl_03007968[] = {
- gsDPPipeSync(),
- gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_03005F80),
- gsSPDisplayList(coin_seg3_dl_03007780),
- gsSPVertex(coin_seg3_vertex_03005740, 4, 0),
- gsSPBranchList(coin_seg3_dl_030077D0),
-};
-
-// 0x03007990 - 0x030079B8
-const Gfx coin_seg3_dl_03007990[] = {
- gsDPPipeSync(),
- gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_03006780),
- gsSPDisplayList(coin_seg3_dl_03007780),
- gsSPVertex(coin_seg3_vertex_03005740, 4, 0),
- gsSPBranchList(coin_seg3_dl_030077D0),
-};
+Lights1 coin_lights_red = gdSPDefLights1(
+ 0x78, 0x12, 0x07,
+ 0xF0, 0x25, 0x0F, 0x28, 0x28, 0x28);
-// 0x030079B8 - 0x030079E0
-const Gfx coin_seg3_dl_030079B8[] = {
+Gfx coin_material_red[] = {
gsDPPipeSync(),
- gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_03006F80),
- gsSPDisplayList(coin_seg3_dl_03007780),
- gsSPVertex(coin_seg3_vertex_03005740, 4, 0),
- gsSPBranchList(coin_seg3_dl_030077D0),
+ gsSPSetLights1(coin_lights_red),
+ gsSPBranchList(coin_material_mesh),
};
diff --git a/actors/common1.h b/actors/common1.h
index a82e225..dcbf1f7 100644
--- a/actors/common1.h
+++ b/actors/common1.h
@@ -32,20 +32,10 @@ extern const GeoLayout blue_coin_geo[];
extern const GeoLayout blue_coin_no_shadow_geo[];
extern const GeoLayout red_coin_geo[];
extern const GeoLayout red_coin_no_shadow_geo[];
-extern const Gfx coin_seg3_dl_03007780[];
-extern const Gfx coin_seg3_dl_030077D0[];
-extern const Gfx coin_seg3_dl_03007800[];
-extern const Gfx coin_seg3_dl_03007828[];
-extern const Gfx coin_seg3_dl_03007850[];
-extern const Gfx coin_seg3_dl_03007878[];
-extern const Gfx coin_seg3_dl_030078A0[];
-extern const Gfx coin_seg3_dl_030078C8[];
-extern const Gfx coin_seg3_dl_030078F0[];
-extern const Gfx coin_seg3_dl_03007918[];
-extern const Gfx coin_seg3_dl_03007940[];
-extern const Gfx coin_seg3_dl_03007968[];
-extern const Gfx coin_seg3_dl_03007990[];
-extern const Gfx coin_seg3_dl_030079B8[];
+
+extern const Gfx coin_material_yellow[];
+extern const Gfx coin_material_blue[];
+extern const Gfx coin_material_red[];
// dirt
extern const GeoLayout dirt_animation_geo[];
diff --git a/assets.json b/assets.json
index 177c3cb..c1743dd 100644
--- a/assets.json
+++ b/assets.json
@@ -177,10 +177,6 @@
"actors/chuckya/chuckya_hand_antenna.rgba16.png": [32,32,2048,{"jp":[2032944,30584],"us":[2040320,30584],"eu":[1912288,30584],"sh":[1888800,30584]}],
"actors/clam_shell/clam_shell.rgba16.png": [32,32,2048,{"jp":[1285392,48],"us":[1292560,48],"eu":[1164528,48],"sh":[1141040,48]}],
"actors/clam_shell/clam_shell_mouth.rgba16.png": [32,32,2048,{"jp":[1285392,2096],"us":[1292560,2096],"eu":[1164528,2096],"sh":[1141040,2096]}],
-"actors/coin/coin_front.ia16.png": [32,32,2048,{"jp":[2094912,22400],"us":[2102288,22400],"eu":[1974256,22400],"sh":[1950768,22400]}],
-"actors/coin/coin_side.ia16.png": [32,32,2048,{"jp":[2094912,26496],"us":[2102288,26496],"eu":[1974256,26496],"sh":[1950768,26496]}],
-"actors/coin/coin_tilt_left.ia16.png": [32,32,2048,{"jp":[2094912,28544],"us":[2102288,28544],"eu":[1974256,28544],"sh":[1950768,28544]}],
-"actors/coin/coin_tilt_right.ia16.png": [32,32,2048,{"jp":[2094912,24448],"us":[2102288,24448],"eu":[1974256,24448],"sh":[1950768,24448]}],
"actors/cyan_fish/cyan_fish.rgba16.png": [32,32,2048,{"jp":[1802256,54376],"us":[1809600,54376],"eu":[1681568,54376],"sh":[1658080,54376]}],
"actors/dirt/dirt_particle.rgba16.png": [16,16,512,{"jp":[2094912,179704],"us":[2102288,179704],"eu":[1974256,179704],"sh":[1950768,179704]}],
"actors/door/bbh_door.rgba16.png": [32,64,4096,{"jp":[2094912,66832],"us":[2102288,66832],"eu":[1974256,66832],"sh":[1950768,66832]}],
diff --git a/data/behavior_data.c b/data/behavior_data.c
index 17d3adb..9602d7e 100644
--- a/data/behavior_data.c
+++ b/data/behavior_data.c
@@ -942,7 +942,7 @@ const BehaviorScript bhvMrIBlueCoin[] = {
BEGIN(OBJ_LIST_LEVEL),
SET_INT(oInteractType, INTERACT_COIN),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
- BILLBOARD(),
+ //BILLBOARD(),
SET_INT(oIntangibleTimer, 0),
SET_FLOAT(oCoinUnk110, 20),
SET_INT(oAnimState, -1),
@@ -962,7 +962,7 @@ const BehaviorScript bhvCoinInsideBoo[] = {
SET_INT(oInteractType, INTERACT_COIN),
OR_INT(oFlags, (OBJ_FLAG_ACTIVE_FROM_AFAR | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
SET_OBJ_PHYSICS(/*Wall hitbox radius*/ 30, /*Gravity*/ -400, /*Bounciness*/ -70, /*Drag strength*/ 1000, /*Friction*/ 1000, /*Buoyancy*/ 200, /*Unused*/ 0, 0),
- BILLBOARD(),
+ //BILLBOARD(),
CALL_NATIVE(bhv_init_room),
BEGIN_LOOP(),
CALL_NATIVE(bhv_coin_inside_boo_loop),
@@ -973,7 +973,7 @@ const BehaviorScript bhvCoinInsideBoo[] = {
const BehaviorScript bhvCoinFormationSpawn[] = {
BEGIN(OBJ_LIST_LEVEL),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
- BILLBOARD(),
+ //BILLBOARD(),
BEGIN_LOOP(),
CALL_NATIVE(bhv_coin_formation_spawn_loop),
END_LOOP(),
@@ -997,7 +997,7 @@ const BehaviorScript bhvOneCoin[] = {
const BehaviorScript bhvYellowCoin[] = {
BEGIN(OBJ_LIST_LEVEL),
// Yellow coin - common:
- BILLBOARD(),
+ //BILLBOARD(),
OR_INT(oFlags, (OBJ_FLAG_COMPUTE_DIST_TO_MARIO | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
CALL_NATIVE(bhv_yellow_coin_init),
BEGIN_LOOP(),
@@ -1007,7 +1007,7 @@ const BehaviorScript bhvYellowCoin[] = {
const BehaviorScript bhvTemporaryYellowCoin[] = {
BEGIN(OBJ_LIST_LEVEL),
- BILLBOARD(),
+ //BILLBOARD(),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
CALL_NATIVE(bhv_yellow_coin_init),
BEGIN_LOOP(),
@@ -1036,7 +1036,7 @@ const BehaviorScript bhvTenCoinsSpawn[] = {
const BehaviorScript bhvSingleCoinGetsSpawned[] = {
BEGIN(OBJ_LIST_LEVEL),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
- BILLBOARD(),
+ //BILLBOARD(),
CALL_NATIVE(bhv_coin_init),
SET_OBJ_PHYSICS(/*Wall hitbox radius*/ 30, /*Gravity*/ -400, /*Bounciness*/ -70, /*Drag strength*/ 1000, /*Friction*/ 1000, /*Buoyancy*/ 200, /*Unused*/ 0, 0),
BEGIN_LOOP(),
@@ -2902,7 +2902,7 @@ const BehaviorScript bhvHiddenBlueCoin[] = {
BEGIN(OBJ_LIST_LEVEL),
SET_INT(oInteractType, INTERACT_COIN),
OR_INT(oFlags, (OBJ_FLAG_ACTIVE_FROM_AFAR | OBJ_FLAG_COMPUTE_DIST_TO_MARIO | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
- BILLBOARD(),
+ //BILLBOARD(),
SET_HITBOX(/*Radius*/ 100, /*Height*/ 64),
SET_INT(oDamageOrCoinValue, 5),
SET_INT(oIntangibleTimer, 0),
@@ -3733,7 +3733,7 @@ const BehaviorScript bhvActSelector[] = {
const BehaviorScript bhvMovingYellowCoin[] = {
BEGIN(OBJ_LIST_LEVEL),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
- BILLBOARD(),
+ //BILLBOARD(),
SET_HITBOX(/*Radius*/ 100, /*Height*/ 64),
SET_INT(oInteractType, INTERACT_COIN),
SET_INT(oIntangibleTimer, 0),
@@ -3748,7 +3748,7 @@ const BehaviorScript bhvMovingYellowCoin[] = {
const BehaviorScript bhvMovingBlueCoin[] = {
BEGIN(OBJ_LIST_LEVEL),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
- BILLBOARD(),
+ //BILLBOARD(),
SET_INT(oIntangibleTimer, 0),
SET_INT(oAnimState, -1),
CALL_NATIVE(bhv_moving_blue_coin_init),
@@ -3761,7 +3761,7 @@ const BehaviorScript bhvMovingBlueCoin[] = {
const BehaviorScript bhvBlueCoinSliding[] = {
BEGIN(OBJ_LIST_GENACTOR),
OR_INT(oFlags, (OBJ_FLAG_COMPUTE_ANGLE_TO_MARIO | OBJ_FLAG_COMPUTE_DIST_TO_MARIO | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
- BILLBOARD(),
+ //BILLBOARD(),
SET_INT(oIntangibleTimer, 0),
SET_INT(oAnimState, -1),
CALL_NATIVE(bhv_blue_coin_sliding_jumping_init),
@@ -3774,7 +3774,7 @@ const BehaviorScript bhvBlueCoinSliding[] = {
const BehaviorScript bhvBlueCoinJumping[] = {
BEGIN(OBJ_LIST_GENACTOR),
OR_INT(oFlags, (OBJ_FLAG_COMPUTE_ANGLE_TO_MARIO | OBJ_FLAG_COMPUTE_DIST_TO_MARIO | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
- BILLBOARD(),
+ //BILLBOARD(),
SET_INT(oIntangibleTimer, 0),
SET_INT(oAnimState, -1),
CALL_NATIVE(bhv_blue_coin_sliding_jumping_init),
@@ -4707,7 +4707,7 @@ const BehaviorScript bhvHiddenRedCoinStar[] = {
const BehaviorScript bhvRedCoin[] = {
BEGIN(OBJ_LIST_LEVEL),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
- BILLBOARD(),
+ //BILLBOARD(),
SET_INT(oIntangibleTimer, 0),
SET_INT(oAnimState, -1),
CALL_NATIVE(bhv_init_room),
diff --git a/src/game/ingame_menu.c b/src/game/ingame_menu.c
index 2e0f336..5c91661 100644
--- a/src/game/ingame_menu.c
+++ b/src/game/ingame_menu.c
@@ -2244,26 +2244,14 @@ void shade_screen(void) {
}
void print_animated_red_coin(s16 x, s16 y) {
- s32 globalTimer = gGlobalTimer;
+ f32 rotation = gGlobalTimer * 16;
create_dl_translation_matrix(MENU_MTX_PUSH, x, y, 0);
- create_dl_scale_matrix(MENU_MTX_NOPUSH, 0.2f, 0.2f, 1.0f);
- gDPSetRenderMode(gDisplayListHead++, G_RM_TEX_EDGE, G_RM_TEX_EDGE2);
-
- switch (globalTimer & 6) {
- case 0:
- gSPDisplayList(gDisplayListHead++, coin_seg3_dl_03007940);
- break;
- case 2:
- gSPDisplayList(gDisplayListHead++, coin_seg3_dl_03007968);
- break;
- case 4:
- gSPDisplayList(gDisplayListHead++, coin_seg3_dl_03007990);
- break;
- case 6:
- gSPDisplayList(gDisplayListHead++, coin_seg3_dl_030079B8);
- break;
- }
+ create_dl_scale_matrix(MENU_MTX_NOPUSH, 0.2f, 0.2f, 0);
+ create_dl_rotation_matrix(MENU_MTX_NOPUSH, rotation, 0, 1.0f, 0);
+
+ gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2);
+ gSPDisplayList(gDisplayListHead++, coin_material_red);
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
diff --git a/src/game/object_helpers.c b/src/game/object_helpers.c
index c4575a7..5ed047e 100644
--- a/src/game/object_helpers.c
+++ b/src/game/object_helpers.c
@@ -126,6 +126,34 @@ Gfx *geo_update_layer_transparency(s32 callContext, struct GraphNode *node, UNUS
return dlStart;
}
+#define COIN_ROTATION 0x0800
+
+Gfx *geo_rotate_coin(s32 callContext, UNUSED struct GraphNode *node, UNUSED void *context) {
+ struct Object *obj;
+
+ if (callContext == GEO_CONTEXT_RENDER) {
+ obj = (struct Object *) gCurGraphNodeObject;
+
+ obj->header.gfx.angle[0] = 0;
+ obj->header.gfx.angle[1] = 0;
+ obj->header.gfx.angle[2] = 0;
+
+ obj->oFaceAnglePitch = 0;
+ // Set rotation
+ obj->oFaceAngleYaw += COIN_ROTATION;
+ obj->oFaceAngleRoll = 0;
+
+ // Reset anim state (used in vanilla coins)
+ if (obj->oAnimState > 0) {
+ obj->oAnimState = 0;
+ }
+ }
+
+ return NULL;
+}
+
+#undef COIN_ROTATION
+
/**
* @bug Every geo function declares the 3 parameters of callContext, node, and
* the matrix array. This one (see also geo_switch_area) doesn't. When executed,
diff --git a/src/game/object_helpers.h b/src/game/object_helpers.h
index c7ba8cc..dc8fe5a 100644
--- a/src/game/object_helpers.h
+++ b/src/game/object_helpers.h
@@ -72,6 +72,7 @@ Gfx *geo_switch_area(s32 callContext, struct GraphNode *node, UNUSED void *conte
Gfx *geo_switch_anim_state(s32 callContext, struct GraphNode *node);
Gfx *geo_switch_area(s32 callContext, struct GraphNode *node);
#endif
+Gfx *geo_rotate_coin(s32 callContext, struct GraphNode *node, UNUSED void *context);
void obj_update_pos_from_parent_transformation(Mat4 a0, struct Object *a1);
void obj_apply_scale_to_matrix(struct Object *obj, Mat4 dst, Mat4 src);
void create_transformation_from_matrices(Mat4 a0, Mat4 a1, Mat4 a2);