Castle Paintings
#1
Back in late 2016, I looked back to my old geometry layout 0x18 command notes and figured out how to edit the paintings inside the castle; so I thought I would share the notes on how the castle paintings work.

[Image: Aggk712.png?2][Image: blaToFR.png][Image: ps21iJl.png]

Setting up paintings requires at least 2 0x18 commands in the geometry layout:

Code:
[ 18 00 00 00 80 2D 5D 0C ] -- Processes Mario's position (Used for the ripple effect)
[ 18 00 XX YY 80 2D 5B 98 ] -- Renders a painting

The XX parameter tells the game which painting list to use (0 = HMC pool, 1 = Castle Paintings, 2 = TTM slide entrance), while the YY parameter tells the game which painting in that list to use.

Painting list
Each segmented address you see in the painting list points to a C structure containing information on that painting.

Painting struct (0x78 bytes)

Code:
Offsets:
(u16) 0x00 - Index in a list?
(u8) 0x02 - List number?
(u8) 0x03 - Render texture mode? 0 for Normal paintings, 1 for shiny textures (DDD and shiny HMC pool).
(u8) 0x04 - Previous value of 0x05 [see function 0x802D3A2C]
(u8) 0x05 - Current painting collision(s) being processed** [see function 0x802D3A2C]
(u8) 0x06 - (painting->0x04 XOR painting->0x05) AND painting->0x05 [see function 0x802D3A2C]
(u8) 0x07 - Ripple flag. 0 = not rippling, 1 = infront of painting, 2 = jumped into painting
(float) 0x08 - Rotation around X-axis
(float) 0x0C - Rotation around Y-axis
(float) 0x10 - X position
(float) 0x14 - Y position
(float) 0x18 - Z position
(float) 0x1C - Current ripple height
(float) 0x20 - Ripple height (infront of painting, copied to offset 0x1C)
(float) 0x24 - Ripple height (jumping into painting, copied to offset 0x1C)
(float) 0x28 - Current ripple height multiplier
(float) 0x2C - Ripple height multiplier (infront of painting, copied to offset 0x28)
(float) 0x30 - Ripple height multiplier (jumping into painting, copied to offset 0x28)
(float) 0x34 - Current ripple pattern?
(float) 0x38 - Ripple pattern? (infront of painting, copied to offset 0x34)
(float) 0x3C - Ripple pattern? (jumping into painting, copied to offset 0x34)
(float) 0x40 - Current size of ripple wave
(float) 0x44 - Size of the ripple wave (infront of painting, copied to offset 0x40)
(float) 0x48 - Size of the ripple wave (jumping into painting, copied to offset 0x40)
(float) 0x4C - Ripple seed or timer?
(float) 0x50 - X position of ripple center
(float) 0x54 - Y position of ripple center
(u32) 0x58 - Segment address to painting F3D cmds.
(u32) 0x5C - Segment address to another segment address to ???.
(u32) 0x60 - Segment address to another segment address to the painting texture.
(u16) 0x64 - ripple painting texture offset?
(u16) 0x66 - ripple painting texture offset?
(u32) 0x68 - A segmented address. 0x07022640, 0x07021AC0. ???
(u8) 0x6C - ??? usually 0x0A or 0x14
(u8) 0x6D - Transparency while rippling.
(u8) 0x6E - Previous value of 0x6F [see function 0x802D3A2C]
(u8) 0x6F - *((float*)0x80361308) < painting->0x14 ? 1 : 0 [see function 0x802D3A2C]
(u8) 0x70 - (painting->0x6E XOR painting->0x6F) AND painting->0x6F [see function 0x802D3A2C]
(u8) 0x71-0x73 - Unused bytes
(float) 0x74 - Size of painting

** collision values are: 0x20(painting wobble left side), 0x10(painting wobble middle), 0x8(painting wobble right side), 0x4(level entrance left side), 0x02(level entrance middle), or 0x01(level entrance right side).

So, where is the data in the ROM file and in RAM?

The painting data is loaded into memory as soon as the game boots up. You can find the list pointers starting at ROM address 0xEC34C, which is loaded into RAM at 0x8033134C. You will have to look at the level script 0x17 command to find out where segment 0x07 is loaded from.

If you have any questions or additions to the topic, please leave a reply below. I'll try to update the main post as much as I can.
Reply
#2
for the painting to be functional, you gotta use these collision types. i have no idea where this list is from.
A6 Painting wobble (BoB 1)
A7 Painting wobble (BoB 2)
A8 Painting wobble (BoB 3)
A9 Painting wobble (CCM 1)
AA Painting wobble (CCM 2)
AB Painting wobble (CCM 3)
AC Painting wobble (WF 1)
AD Painting wobble (WF 2)
AE Painting wobble (WF 3)
AF Painting wobble (JRB 1)
B0 Painting wobble (JRB 2)
B1 Painting wobble (JRB 3)
B2 Painting wobble (LLL 1)
B3 Painting wobble (LLL 2)
B4 Painting wobble (LLL 3)
B5 Painting wobble (SSL 1)
B6 Painting wobble (SSL 2)
B7 Painting wobble (SSL 3)
B8 Painting wobble (?)
B9 Painting wobble (?)
BA Painting wobble (?)
BB Painting wobble (BFS)
BC Painting wobble (BFS?)
BD Painting wobble (BFS?)
BE Painting wobble (WDW 1)
BF Painting wobble (WDW 2)
C0 Painting wobble (WDW 3)
C1 Painting wobble (THI t 1)
C2 Painting wobble (THI t 2)
C3 Painting wobble (THI t 3)
C4 Painting wobble (TTM 1)
C5 Painting wobble (TTM 2)
C6 Painting wobble (TTM 3)
C7 Painting wobble (?)
C8 Painting wobble (?)
C9 Painting wobble (?)
CA Painting wobble (SML 1, unused)
CB Painting wobble (SML 2, unused)
CC Painting wobble (SML 3, unused)
CD Painting wobble (THI h 1)
CE Painting wobble (THI h 2)
CF Painting wobble (THI h 3)
D0 Painting wobble (Metal cap)
D1 Painting wobble (Metal cap?)
D2 Painting wobble (Metal cap?)
D3 Horizontal level entrance (still have to label these)
D4 Horizontal level entrance ()
D5 Horizontal level entrance ()
D6 Horizontal level entrance ()
D7 Horizontal level entrance ()
D8 Horizontal level entrance ()
D9 Horizontal level entrance ()
DA Horizontal level entrance ()
DB Horizontal level entrance ()
DC Horizontal level entrance ()
DE Horizontal level entrance ()
DF Horizontal level entrance ()
F0 Horizontal level entrance ()
F1 Horizontal level entrance ()
F2 Horizontal level entrance ()
F3 Horizontal level entrance ()
F4 Horizontal level entrance ()
F5 Horizontal level entrance ()
F6 Horizontal level entrance ()
F7 Horizontal level entrance ()
F8 Horizontal level entrance ()
F9 Horizontal level entrance ()
FA Horizontal level entrance ()
FB Horizontal level entrance ()
FC Horizontal level entrance ()
FD Vertical level entrances ?


below D3 are for the wobble graphic effect, the others are for the actual warp.


someone could use my collision detection GSC to label all collisions properly:
812CB1C8 3C06
812CB1CA 8033
812CB1CC 24C6
812CB1CE 6F90
812CB1D0 3C09
812CB1D2 8034
812CB1D4 8D29
812CB1D6 B1D8
812CB1D8 8527
812CB1DA 0000
812CB1DC 2404
812CB1DE 0030
812CB1E0 0C0B
812CB1E2 58B6
812CB1E4 2405
812CB1E6 0012
812CB1E8 1000
812CB1EA 0019
812CB1EC 2400
81336F90 434F
81336F92 4C20
81336F94 2578
Reply




Users browsing this thread: 1 Guest(s)