mirror of https://github.com/zeldaret/tmc.git
Split asset config into multiple files
This commit is contained in:
parent
1eb15e495a
commit
dbb3eb700e
|
@ -185,7 +185,7 @@ _080197DC:
|
|||
ldr r1, [r4]
|
||||
ldr r0, _08019808 @ =0x7FFFFFFF
|
||||
ands r1, r0
|
||||
ldr r0, _0801980C @ =gAssets
|
||||
ldr r0, _0801980C @ =gMapData
|
||||
adds r1, r1, r0
|
||||
ldr r2, [r4, #8]
|
||||
adds r0, r2, #0
|
||||
|
@ -201,7 +201,7 @@ _080197DC:
|
|||
b _0801982E
|
||||
.align 2, 0
|
||||
_08019808: .4byte 0x7FFFFFFF
|
||||
_0801980C: .4byte gAssets
|
||||
_0801980C: .4byte gMapData
|
||||
_08019810:
|
||||
adds r0, r1, #0
|
||||
adds r1, r3, #0
|
||||
|
|
|
@ -762,7 +762,7 @@ _0801DE46:
|
|||
beq _0801DEE0
|
||||
ldr r2, _0801DEF8 @ =0x040000D4
|
||||
ldr r0, [r4, #4]
|
||||
ldr r1, _0801DEFC @ =gAssets
|
||||
ldr r1, _0801DEFC @ =gMapData
|
||||
adds r0, r0, r1
|
||||
str r0, [r2]
|
||||
ldr r0, _0801DF00 @ =gUnk_02019EE0
|
||||
|
@ -847,7 +847,7 @@ _0801DEEA:
|
|||
pop {r4, r5, r6, r7, pc}
|
||||
.align 2, 0
|
||||
_0801DEF8: .4byte 0x040000D4
|
||||
_0801DEFC: .4byte gAssets
|
||||
_0801DEFC: .4byte gMapData
|
||||
_0801DF00: .4byte gUnk_02019EE0
|
||||
_0801DF04: .4byte 0x84000100
|
||||
_0801DF08: .4byte gAreaRoomHeaders
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
*
|
||||
!*.json
|
||||
!.gitignore
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -4,7 +4,7 @@
|
|||
.section .rodata
|
||||
.align 2
|
||||
|
||||
gAssets:: @ 08324AE4
|
||||
gMapData:: @ 08324AE4
|
||||
.include "data/assets.s"
|
||||
.align 2
|
||||
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
@ programmable wave samples
|
||||
|
||||
gUnk_08A11BAC:: @ 08A11BAC
|
||||
.incbin "voicegroups/gUnk_08A11BAC.bin"
|
||||
.incbin "programmable_wave_samples/gUnk_08A11BAC.bin"
|
||||
|
||||
gUnk_08A11BDC:: @ 08A11BDC
|
||||
.incbin "voicegroups/gUnk_08A11BDC.bin"
|
||||
.incbin "programmable_wave_samples/gUnk_08A11BDC.bin"
|
||||
|
||||
gUnk_08A11C0C:: @ 08A11C0C
|
||||
.incbin "voicegroups/gUnk_08A11C0C.bin"
|
||||
.incbin "programmable_wave_samples/gUnk_08A11C0C.bin"
|
||||
|
||||
gUnk_08A11C1C:: @ 08A11C1C
|
||||
.incbin "voicegroups/gUnk_08A11C1C.bin"
|
||||
.incbin "programmable_wave_samples/gUnk_08A11C1C.bin"
|
||||
|
|
|
@ -3757,37 +3757,6 @@ voicegroup033:: @ 08A07394
|
|||
voice_directsound 60, 0, gUnk_08A84DCC, 255, 0, 255, 165
|
||||
voice_directsound 60, 0, gUnk_08A5496C, 255, 0, 255, 165
|
||||
|
||||
@ .ifdef EU
|
||||
@ @ TODO only small differences
|
||||
@ .incbin "voicegroups/voicegroup033_EU.bin"
|
||||
@ .4byte 0x2
|
||||
@ .incbin "voicegroups/voicegroup033_1_EU.bin"
|
||||
@ .else
|
||||
@ .incbin "voicegroups/voicegroup033_2_USA-JP-DEMO_USA-DEMO_JP.bin"
|
||||
@ .4byte gUnk_08A12ED0
|
||||
@ .incbin "voicegroups/voicegroup033_3_USA-JP-DEMO_USA-DEMO_JP.bin"
|
||||
@ .endif
|
||||
@ .4byte gUnk_08A16610
|
||||
@ .ifdef EU
|
||||
@ @ TODO only small differences
|
||||
@ .incbin "voicegroups/voicegroup033_4_EU.bin"
|
||||
@ .else
|
||||
@ .incbin "voicegroups/voicegroup033_5_USA-JP-DEMO_USA-DEMO_JP.bin"
|
||||
@ .endif
|
||||
@ .4byte gUnk_08A12ED0
|
||||
@ .ifdef EU
|
||||
@ @ TODO only small differences
|
||||
@ .incbin "voicegroups/voicegroup033_6_EU.bin"
|
||||
@ .else
|
||||
@ .incbin "voicegroups/voicegroup033_7_USA-JP-DEMO_USA-DEMO_JP.bin"
|
||||
@ .endif
|
||||
@ .4byte gUnk_08A1A54C
|
||||
@ .incbin "voicegroups/voicegroup033_8.bin"
|
||||
@ .4byte gUnk_08A84DCC
|
||||
@ .incbin "voicegroups/voicegroup033_9.bin"
|
||||
@ .4byte gUnk_08A5496C
|
||||
@ .incbin "voicegroups/voicegroup033_10.bin"
|
||||
|
||||
voicegroup034:: @ 08A07610
|
||||
voice_square_1 60, 0, 0, 2, 0, 0, 15, 0
|
||||
voice_square_1 60, 0, 0, 2, 0, 0, 15, 0
|
||||
|
|
|
@ -5,7 +5,7 @@ extern void LoadPalettes(const u8*, s32, s32);
|
|||
|
||||
extern u16 gMetatilesBottom[];
|
||||
extern u16 gMetatilesTop[];
|
||||
extern u8 gAssets;
|
||||
extern u8 gMapData;
|
||||
|
||||
extern const u8 gUnk_020176E0[];
|
||||
|
||||
|
@ -13,7 +13,7 @@ void sub_0807C960(void* dest, u32 offset) {
|
|||
void* src;
|
||||
|
||||
if (offset != -1) {
|
||||
src = &gAssets + (offset & 0x7fffffff);
|
||||
src = &gMapData + (offset & 0x7fffffff);
|
||||
if ((u32)dest >> 0x18 == 6) {
|
||||
LZ77UnCompVram(src, (void*)dest);
|
||||
} else {
|
||||
|
|
|
@ -35,18 +35,22 @@ def extract_assets(variant, assets_folder):
|
|||
with open(baserom_path, 'rb') as file:
|
||||
baserom = bytearray(file.read())
|
||||
|
||||
config_modified = os.path.getmtime('assets.json')
|
||||
# json_modified = os.path.getmtime('assets.json')
|
||||
# if json_modified < config_modified:
|
||||
# print('Convert yaml to json...', flush=True)
|
||||
# subprocess.check_call('cat assets.yaml | yq . > assets.json', shell=True)
|
||||
|
||||
with open('assets.json') as file:
|
||||
# Handle all json config files in the assets folder
|
||||
configs = [x for x in os.listdir('assets') if x.endswith('.json')] # TODO this would break with a folder that is named .json
|
||||
|
||||
print(configs)
|
||||
|
||||
for config in configs:
|
||||
path = os.path.join('assets', config)
|
||||
config_modified = os.path.getmtime(path)
|
||||
|
||||
with open(path) as file:
|
||||
current_offset = 0
|
||||
#print('Parsing yaml...', flush=True)
|
||||
#assets = yaml.safe_load(file)
|
||||
#print('done', flush=True)
|
||||
print('Parsing json...', flush=True)
|
||||
print(f'Parsing {config}...', flush=True)
|
||||
assets = json.load(file)
|
||||
print('done', flush=True)
|
||||
for asset in assets:
|
||||
|
@ -81,6 +85,7 @@ def extract_assets(variant, assets_folder):
|
|||
if extract_file:
|
||||
if verbose:
|
||||
print(f'Extracting {path}...')
|
||||
|
||||
start = 0
|
||||
if 'start' in asset:
|
||||
# Apply offset to the start of the USA variant
|
||||
|
|
Loading…
Reference in New Issue