.extern currentHeap .extern MakeScene .extern DVDClass .extern GetSceneLightInfo .extern GetRes .extern GetAnmScn .extern BindAnmScn .extern AssignAnmScnToLightInfo .extern LoadBlight .extern LoadBlmap .extern OSReport .text .set sp,1 .set rtoc,2 .global LoadMapScene LoadMapScene: stwu sp, -0x30(sp) mflr r0 stw r0, 0x34(sp) stw r31, 0x2C(sp) stw r30, 0x28(sp) stw r29, 0x24(sp) lis r30, m_str@h ori r30, r30, m_str@l mr r3, r30 li r4, 1 crclr 4*cr1+eq bl OSReport lis r3, currentHeap@h ori r3, r3, currentHeap@l lwz r3, 0(r3) li r4, 36 #Light count li r5, 8 #Ambient light count li r6, 2 #Dunno li r7, 0 #Make fog (bool) li r8, 0 #Scene ID bl MakeScene mr r3, r30 li r4, 2 crclr 4*cr1+eq bl OSReport # Now make the actual scene! # Get light info li r3, 0 bl GetSceneLightInfo mr r31, r3 mr r3, r30 li r4, 3 crclr 4*cr1+eq bl OSReport # Get scene/scene.brres lis r3, DVDClass@h ori r3, r3, DVDClass@l lwz r3, 0(r3) addi r3, r3, 4 lis r4, EnvWorld@h ori r4, r4, EnvWorld@l lis r5, SceneBrres@h ori r5, r5, SceneBrres@l bl GetRes # Got that, now get the AnmScn we want (MainSelect) stw r3, 0x0C(sp) #ResFile mr r3, r30 li r4, 4 crclr 4*cr1+eq bl OSReport addi r3, sp, 0xC lis r4, MainSelect@h ori r4, r4, MainSelect@l bl GetAnmScn stw r3, 0x10(sp) mr r3, r30 li r4, 5 crclr 4*cr1+eq bl OSReport # Bind it addi r3, sp, 0x10 addi r4, sp, 0x10 bl BindAnmScn mr r3, r30 li r4, 6 crclr 4*cr1+eq bl OSReport # Add it to lightinfo mr r3, r31 #This addi r4, sp, 0x10 #AnmScn pointer li r5, -1 #Dunno li r6, 3 #Dunno lis r9, Zero@h ori r9, r9, Zero@l lfs f1, 0(r9) #Dunno bl AssignAnmScnToLightInfo mr r3, r30 li r4, 7 crclr 4*cr1+eq bl OSReport # Now set up the rest of the scene # Get blight lis r3, DVDClass@h ori r3, r3, DVDClass@l lwz r3, 0(r3) addi r3, r3, 4 lis r4, EnvWorld@h ori r4, r4, EnvWorld@l lis r5, BlightW1@h ori r5, r5, BlightW1@l bl GetRes mr r29, r3 mr r3, r30 li r4, 8 crclr 4*cr1+eq bl OSReport # Load it into lightinfo mr r3, r31 mr r4, r29 bl LoadBlight mr r3, r30 li r4, 9 crclr 4*cr1+eq bl OSReport # Do the same for blmap lis r3, DVDClass@h ori r3, r3, DVDClass@l lwz r3, 0(r3) addi r3, r3, 4 lis r4, EnvWorld@h ori r4, r4, EnvWorld@l lis r5, BlmapW1@h ori r5, r5, BlmapW1@l bl GetRes mr r29, r3 mr r3, r30 li r4, 10 crclr 4*cr1+eq bl OSReport # Load it into its class lwz r3, 0x14(r31) mr r4, r29 bl LoadBlmap mr r3, r30 li r4, 11 crclr 4*cr1+eq bl OSReport # DONE!! lwz r29, 0x24(sp) lwz r30, 0x28(sp) lwz r31, 0x2C(sp) lwz r0, 0x34(sp) mtlr r0 addi sp, sp, 0x30 blr .data EnvWorld: .string "Env_world" SceneBrres: .string "scene/scene.brres" MainSelect: .string "MainSelect" Zero: .float 0.0 BlightW1: .string "light/W8.blight" BlmapW1: .string "light/W8.blmap" m_str: .string "LMS:%d\n" .align 4