prime/asm/Kyoto/Graphics/DolphinCPalette.s

209 lines
9.9 KiB
ArmAsm
Raw Permalink Normal View History

2022-04-16 07:50:32 +00:00
.include "macros.inc"
2022-07-14 05:36:41 +00:00
.section .sbss, "wa"
.balign 8
2022-07-14 05:36:41 +00:00
.global sCurrentFrameCount__16CGraphicsPalette
sCurrentFrameCount__16CGraphicsPalette:
2022-07-14 05:36:41 +00:00
.skip 0x8
.section .text, "ax"
2022-04-16 07:50:32 +00:00
.global UnLock__16CGraphicsPaletteFv
UnLock__16CGraphicsPaletteFv:
/* 8030DE5C 0030ADBC 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 8030DE60 0030ADC0 7C 08 02 A6 */ mflr r0
/* 8030DE64 0030ADC4 90 01 00 14 */ stw r0, 0x14(r1)
/* 8030DE68 0030ADC8 93 E1 00 0C */ stw r31, 0xc(r1)
/* 8030DE6C 0030ADCC 7C 7F 1B 78 */ mr r31, r3
/* 8030DE70 0030ADD0 80 03 00 08 */ lwz r0, 8(r3)
/* 8030DE74 0030ADD4 80 63 00 0C */ lwz r3, 0xc(r3)
/* 8030DE78 0030ADD8 54 04 08 3C */ slwi r4, r0, 1
/* 8030DE7C 0030ADDC 48 07 0C 65 */ bl DCStoreRange
/* 8030DE80 0030ADE0 80 1F 00 08 */ lwz r0, 8(r31)
/* 8030DE84 0030ADE4 38 7F 00 10 */ addi r3, r31, 0x10
/* 8030DE88 0030ADE8 80 BF 00 00 */ lwz r5, 0(r31)
/* 8030DE8C 0030ADEC 80 9F 00 0C */ lwz r4, 0xc(r31)
/* 8030DE90 0030ADF0 54 06 04 3E */ clrlwi r6, r0, 0x10
/* 8030DE94 0030ADF4 48 06 C6 55 */ bl GXInitTlutObj
/* 8030DE98 0030ADF8 80 1F 00 08 */ lwz r0, 8(r31)
/* 8030DE9C 0030ADFC 80 7F 00 0C */ lwz r3, 0xc(r31)
/* 8030DEA0 0030AE00 54 04 08 3C */ slwi r4, r0, 1
/* 8030DEA4 0030AE04 48 07 0C 0D */ bl DCFlushRange
/* 8030DEA8 0030AE08 38 00 00 00 */ li r0, 0
/* 8030DEAC 0030AE0C 98 1F 00 1C */ stb r0, 0x1c(r31)
/* 8030DEB0 0030AE10 80 01 00 14 */ lwz r0, 0x14(r1)
/* 8030DEB4 0030AE14 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 8030DEB8 0030AE18 7C 08 03 A6 */ mtlr r0
/* 8030DEBC 0030AE1C 38 21 00 10 */ addi r1, r1, 0x10
2022-07-14 05:48:03 +00:00
/* 8030DEC0 0030AE20 4E 80 00 20 */ blr
2022-04-16 07:50:32 +00:00
.global Load__16CGraphicsPaletteCFv
Load__16CGraphicsPaletteCFv:
/* 8030DEC4 0030AE24 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 8030DEC8 0030AE28 7C 08 02 A6 */ mflr r0
/* 8030DECC 0030AE2C 38 80 00 00 */ li r4, 0
/* 8030DED0 0030AE30 90 01 00 14 */ stw r0, 0x14(r1)
/* 8030DED4 0030AE34 93 E1 00 0C */ stw r31, 0xc(r1)
/* 8030DED8 0030AE38 7C 7F 1B 78 */ mr r31, r3
/* 8030DEDC 0030AE3C 38 7F 00 10 */ addi r3, r31, 0x10
/* 8030DEE0 0030AE40 48 06 C6 51 */ bl GXLoadTlut
/* 8030DEE4 0030AE44 80 0D A8 68 */ lwz r0, sCurrentFrameCount__16CGraphicsPalette@sda21(r13)
2022-04-16 07:50:32 +00:00
/* 8030DEE8 0030AE48 90 1F 00 04 */ stw r0, 4(r31)
/* 8030DEEC 0030AE4C 80 01 00 14 */ lwz r0, 0x14(r1)
/* 8030DEF0 0030AE50 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 8030DEF4 0030AE54 7C 08 03 A6 */ mtlr r0
/* 8030DEF8 0030AE58 38 21 00 10 */ addi r1, r1, 0x10
2022-07-14 05:48:03 +00:00
/* 8030DEFC 0030AE5C 4E 80 00 20 */ blr
2022-04-16 07:50:32 +00:00
.global __dt__16CGraphicsPaletteFv
__dt__16CGraphicsPaletteFv:
/* 8030DF00 0030AE60 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 8030DF04 0030AE64 7C 08 02 A6 */ mflr r0
/* 8030DF08 0030AE68 90 01 00 14 */ stw r0, 0x14(r1)
/* 8030DF0C 0030AE6C 93 E1 00 0C */ stw r31, 0xc(r1)
/* 8030DF10 0030AE70 7C 9F 23 78 */ mr r31, r4
/* 8030DF14 0030AE74 93 C1 00 08 */ stw r30, 8(r1)
/* 8030DF18 0030AE78 7C 7E 1B 79 */ or. r30, r3, r3
/* 8030DF1C 0030AE7C 41 82 00 50 */ beq lbl_8030DF6C
/* 8030DF20 0030AE80 80 7E 00 04 */ lwz r3, 4(r30)
/* 8030DF24 0030AE84 80 0D A8 68 */ lwz r0, sCurrentFrameCount__16CGraphicsPalette@sda21(r13)
2022-04-16 07:50:32 +00:00
/* 8030DF28 0030AE88 7C 03 00 50 */ subf r0, r3, r0
/* 8030DF2C 0030AE8C 28 00 00 02 */ cmplwi r0, 2
/* 8030DF30 0030AE90 40 80 00 1C */ bge lbl_8030DF4C
/* 8030DF34 0030AE94 80 9E 00 0C */ lwz r4, 0xc(r30)
/* 8030DF38 0030AE98 38 60 00 00 */ li r3, 0
/* 8030DF3C 0030AE9C 7C 00 00 34 */ cntlzw r0, r0
/* 8030DF40 0030AEA0 90 7E 00 0C */ stw r3, 0xc(r30)
/* 8030DF44 0030AEA4 54 03 D9 7E */ srwi r3, r0, 5
/* 8030DF48 0030AEA8 48 05 EC D5 */ bl sub_8036cc1c__19CFrameDelayedKillerFbPv
2022-04-16 07:50:32 +00:00
lbl_8030DF4C:
/* 8030DF4C 0030AEAC 34 1E 00 0C */ addic. r0, r30, 0xc
/* 8030DF50 0030AEB0 41 82 00 0C */ beq lbl_8030DF5C
/* 8030DF54 0030AEB4 80 7E 00 0C */ lwz r3, 0xc(r30)
/* 8030DF58 0030AEB8 48 00 79 D9 */ bl Free__7CMemoryFPCv
lbl_8030DF5C:
/* 8030DF5C 0030AEBC 7F E0 07 35 */ extsh. r0, r31
/* 8030DF60 0030AEC0 40 81 00 0C */ ble lbl_8030DF6C
/* 8030DF64 0030AEC4 7F C3 F3 78 */ mr r3, r30
/* 8030DF68 0030AEC8 48 00 79 C9 */ bl Free__7CMemoryFPCv
lbl_8030DF6C:
/* 8030DF6C 0030AECC 80 01 00 14 */ lwz r0, 0x14(r1)
/* 8030DF70 0030AED0 7F C3 F3 78 */ mr r3, r30
/* 8030DF74 0030AED4 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 8030DF78 0030AED8 83 C1 00 08 */ lwz r30, 8(r1)
/* 8030DF7C 0030AEDC 7C 08 03 A6 */ mtlr r0
/* 8030DF80 0030AEE0 38 21 00 10 */ addi r1, r1, 0x10
2022-07-14 05:48:03 +00:00
/* 8030DF84 0030AEE4 4E 80 00 20 */ blr
2022-04-16 07:50:32 +00:00
.global __ct__16CGraphicsPaletteFR12CInputStream
__ct__16CGraphicsPaletteFR12CInputStream:
/* 8030DF88 0030AEE8 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 8030DF8C 0030AEEC 7C 08 02 A6 */ mflr r0
/* 8030DF90 0030AEF0 90 01 00 24 */ stw r0, 0x24(r1)
/* 8030DF94 0030AEF4 93 E1 00 1C */ stw r31, 0x1c(r1)
/* 8030DF98 0030AEF8 93 C1 00 18 */ stw r30, 0x18(r1)
/* 8030DF9C 0030AEFC 7C 9E 23 78 */ mr r30, r4
/* 8030DFA0 0030AF00 93 A1 00 14 */ stw r29, 0x14(r1)
/* 8030DFA4 0030AF04 7C 7D 1B 78 */ mr r29, r3
/* 8030DFA8 0030AF08 7F C3 F3 78 */ mr r3, r30
/* 8030DFAC 0030AF0C 48 03 0C D9 */ bl ReadLong__12CInputStreamFv
/* 8030DFB0 0030AF10 90 7D 00 00 */ stw r3, 0(r29)
/* 8030DFB4 0030AF14 7F C3 F3 78 */ mr r3, r30
/* 8030DFB8 0030AF18 48 03 0C F9 */ bl ReadShort__12CInputStreamFv
/* 8030DFBC 0030AF1C 7C 7F 07 34 */ extsh r31, r3
/* 8030DFC0 0030AF20 7F C3 F3 78 */ mr r3, r30
/* 8030DFC4 0030AF24 48 03 0C ED */ bl ReadShort__12CInputStreamFv
/* 8030DFC8 0030AF28 7C 60 07 34 */ extsh r0, r3
/* 8030DFCC 0030AF2C 3C 80 80 3D */ lis r4, lbl_803D73E8@ha
/* 8030DFD0 0030AF30 7C 00 F9 D6 */ mullw r0, r0, r31
2022-10-15 04:33:23 +00:00
/* 8030DFD4 0030AF34 3C 60 80 3D */ lis r3, kUnknownType__10CCallStack@ha
2022-04-16 07:50:32 +00:00
/* 8030DFD8 0030AF38 38 A4 73 E8 */ addi r5, r4, lbl_803D73E8@l
2022-10-15 04:33:23 +00:00
/* 8030DFDC 0030AF3C 38 C3 6A A8 */ addi r6, r3, kUnknownType__10CCallStack@l
2022-04-16 07:50:32 +00:00
/* 8030DFE0 0030AF40 38 61 00 08 */ addi r3, r1, 8
/* 8030DFE4 0030AF44 38 80 FF FF */ li r4, -1
/* 8030DFE8 0030AF48 90 1D 00 08 */ stw r0, 8(r29)
/* 8030DFEC 0030AF4C 4B FC 83 E9 */ bl __ct__10CCallStackFUiPCcPCc
/* 8030DFF0 0030AF50 80 1D 00 08 */ lwz r0, 8(r29)
/* 8030DFF4 0030AF54 7C 67 1B 78 */ mr r7, r3
/* 8030DFF8 0030AF58 38 80 00 02 */ li r4, 2
/* 8030DFFC 0030AF5C 38 A0 00 01 */ li r5, 1
/* 8030E000 0030AF60 54 03 08 3C */ slwi r3, r0, 1
/* 8030E004 0030AF64 38 C0 00 00 */ li r6, 0
/* 8030E008 0030AF68 48 00 79 8D */ bl Alloc__7CMemoryFUlQ210IAllocator5EHintQ210IAllocator6EScopeQ210IAllocator5ETypeRC10CCallStack
/* 8030E00C 0030AF6C 90 7D 00 0C */ stw r3, 0xc(r29)
/* 8030E010 0030AF70 38 00 00 00 */ li r0, 0
/* 8030E014 0030AF74 7F C3 F3 78 */ mr r3, r30
/* 8030E018 0030AF78 98 1D 00 1C */ stb r0, 0x1c(r29)
/* 8030E01C 0030AF7C 80 1D 00 08 */ lwz r0, 8(r29)
/* 8030E020 0030AF80 80 9D 00 0C */ lwz r4, 0xc(r29)
/* 8030E024 0030AF84 54 05 08 3C */ slwi r5, r0, 1
/* 8030E028 0030AF88 48 03 0F 2D */ bl Get__12CInputStreamFPvUl
/* 8030E02C 0030AF8C 80 1D 00 08 */ lwz r0, 8(r29)
/* 8030E030 0030AF90 38 7D 00 10 */ addi r3, r29, 0x10
/* 8030E034 0030AF94 80 BD 00 00 */ lwz r5, 0(r29)
/* 8030E038 0030AF98 80 9D 00 0C */ lwz r4, 0xc(r29)
/* 8030E03C 0030AF9C 54 06 04 3E */ clrlwi r6, r0, 0x10
/* 8030E040 0030AFA0 48 06 C4 A9 */ bl GXInitTlutObj
/* 8030E044 0030AFA4 80 1D 00 08 */ lwz r0, 8(r29)
/* 8030E048 0030AFA8 80 7D 00 0C */ lwz r3, 0xc(r29)
/* 8030E04C 0030AFAC 54 04 08 3C */ slwi r4, r0, 1
/* 8030E050 0030AFB0 48 07 0A 61 */ bl DCFlushRange
/* 8030E054 0030AFB4 80 01 00 24 */ lwz r0, 0x24(r1)
/* 8030E058 0030AFB8 7F A3 EB 78 */ mr r3, r29
/* 8030E05C 0030AFBC 83 E1 00 1C */ lwz r31, 0x1c(r1)
/* 8030E060 0030AFC0 83 C1 00 18 */ lwz r30, 0x18(r1)
/* 8030E064 0030AFC4 83 A1 00 14 */ lwz r29, 0x14(r1)
/* 8030E068 0030AFC8 7C 08 03 A6 */ mtlr r0
/* 8030E06C 0030AFCC 38 21 00 20 */ addi r1, r1, 0x20
2022-07-14 05:48:03 +00:00
/* 8030E070 0030AFD0 4E 80 00 20 */ blr
2022-04-16 07:50:32 +00:00
.global __ct__16CGraphicsPaletteF14EPaletteFormati
__ct__16CGraphicsPaletteF14EPaletteFormati:
/* 8030E074 0030AFD4 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 8030E078 0030AFD8 7C 08 02 A6 */ mflr r0
/* 8030E07C 0030AFDC 3C C0 80 3D */ lis r6, lbl_803D73E8@ha
/* 8030E080 0030AFE0 90 01 00 24 */ stw r0, 0x24(r1)
/* 8030E084 0030AFE4 93 E1 00 1C */ stw r31, 0x1c(r1)
/* 8030E088 0030AFE8 7C BF 2B 78 */ mr r31, r5
/* 8030E08C 0030AFEC 38 A6 73 E8 */ addi r5, r6, lbl_803D73E8@l
/* 8030E090 0030AFF0 93 C1 00 18 */ stw r30, 0x18(r1)
/* 8030E094 0030AFF4 7C 7E 1B 78 */ mr r30, r3
/* 8030E098 0030AFF8 90 83 00 00 */ stw r4, 0(r3)
2022-10-15 04:33:23 +00:00
/* 8030E09C 0030AFFC 3C 60 80 3D */ lis r3, kUnknownType__10CCallStack@ha
/* 8030E0A0 0030B000 38 C3 6A A8 */ addi r6, r3, kUnknownType__10CCallStack@l
2022-04-16 07:50:32 +00:00
/* 8030E0A4 0030B004 38 80 FF FF */ li r4, -1
/* 8030E0A8 0030B008 93 FE 00 08 */ stw r31, 8(r30)
/* 8030E0AC 0030B00C 38 61 00 08 */ addi r3, r1, 8
/* 8030E0B0 0030B010 4B FC 83 25 */ bl __ct__10CCallStackFUiPCcPCc
/* 8030E0B4 0030B014 7C 67 1B 78 */ mr r7, r3
/* 8030E0B8 0030B018 57 E3 08 3C */ slwi r3, r31, 1
/* 8030E0BC 0030B01C 38 80 00 02 */ li r4, 2
/* 8030E0C0 0030B020 38 A0 00 01 */ li r5, 1
/* 8030E0C4 0030B024 38 C0 00 00 */ li r6, 0
/* 8030E0C8 0030B028 48 00 78 CD */ bl Alloc__7CMemoryFUlQ210IAllocator5EHintQ210IAllocator6EScopeQ210IAllocator5ETypeRC10CCallStack
/* 8030E0CC 0030B02C 90 7E 00 0C */ stw r3, 0xc(r30)
/* 8030E0D0 0030B030 38 00 00 00 */ li r0, 0
/* 8030E0D4 0030B034 38 7E 00 10 */ addi r3, r30, 0x10
/* 8030E0D8 0030B038 98 1E 00 1C */ stb r0, 0x1c(r30)
/* 8030E0DC 0030B03C 80 1E 00 08 */ lwz r0, 8(r30)
/* 8030E0E0 0030B040 80 BE 00 00 */ lwz r5, 0(r30)
/* 8030E0E4 0030B044 80 9E 00 0C */ lwz r4, 0xc(r30)
/* 8030E0E8 0030B048 54 06 04 3E */ clrlwi r6, r0, 0x10
/* 8030E0EC 0030B04C 48 06 C3 FD */ bl GXInitTlutObj
/* 8030E0F0 0030B050 80 01 00 24 */ lwz r0, 0x24(r1)
/* 8030E0F4 0030B054 7F C3 F3 78 */ mr r3, r30
/* 8030E0F8 0030B058 83 E1 00 1C */ lwz r31, 0x1c(r1)
/* 8030E0FC 0030B05C 83 C1 00 18 */ lwz r30, 0x18(r1)
/* 8030E100 0030B060 7C 08 03 A6 */ mtlr r0
/* 8030E104 0030B064 38 21 00 20 */ addi r1, r1, 0x20
/* 8030E108 0030B068 4E 80 00 20 */ blr
2022-07-18 05:21:27 +00:00
.section .rodata
.balign 8
2022-07-18 05:21:27 +00:00
.global lbl_803D73E8
lbl_803D73E8:
# ROM: 0x3D43E8
.asciz "??(??)"
.balign 4