From ceb015ce8a290cfabea950e238eff6633e4b342a Mon Sep 17 00:00:00 2001 From: CrazyRedMachine Date: Tue, 18 Jun 2024 00:35:43 +0200 Subject: [PATCH] cleanup a little --- popnhax/omnimix_patch.cc | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/popnhax/omnimix_patch.cc b/popnhax/omnimix_patch.cc index 8eab33d..1671911 100644 --- a/popnhax/omnimix_patch.cc +++ b/popnhax/omnimix_patch.cc @@ -239,11 +239,8 @@ for (WORD SectionIndex = 0; SectionIndex < headers->FileHeader.NumberOfSections; LOG("Disassemble .text section... "); x86_init(opt_none, NULL, NULL); unsigned int num_insn = x86_disasm_range( (unsigned char *)text, (uint32_t) buf, 0, text_size, &add_xref, NULL); - - LOG("done (%u instructions)\n", num_insn); - - x86_cleanup(); -/* instruction table is done */ + x86_cleanup(); + LOG("done (%u instructions)\n", num_insn); LOG("\n"); LOG("\n"); @@ -277,34 +274,6 @@ g_tables[STYLE_IDX].limit = get_table_size_by_xref(data, data_size, g_tables[STY g_tables[FLAVOR_IDX].limit = get_table_size_by_xref(data, data_size, g_tables[FLAVOR_IDX].addr, g_tables[FLAVOR_IDX].size); g_tables[CHARA_IDX].limit = get_table_size_by_xref(data, data_size, g_tables[CHARA_IDX].addr, g_tables[CHARA_IDX].size); -/* -# Modify the entry sizes as required -buffer_addrs = [ - # entry type, table address, entry size - [MUSIC_IDX, music_table_addr, 0xac], - [CHART_IDX, chart_table_addr, 0x20], # Probably won't change? - [STYLE_IDX, style_table_addr, 0x10], # Unlikely to change - [FLAVOR_IDX, flavor_table_addr, 0x60], - [CHARA_IDX, chara_table_addr, 0x4C], -] - -limit_info_list = [ - # buffer_addr + (buffer_entry_size * limit) should give you the very end of the array (after the last entry) - [MUSIC_IDX, get_table_size_by_xref(*buffer_addrs[MUSIC_IDX][1:])], - [CHART_IDX, get_table_size_by_xref(*buffer_addrs[CHART_IDX][1:])], - [STYLE_IDX, get_table_size_by_xref(*buffer_addrs[STYLE_IDX][1:])], - [FLAVOR_IDX, get_table_size_by_xref(*buffer_addrs[FLAVOR_IDX][1:])], - [CHARA_IDX, get_table_size_by_xref(*buffer_addrs[CHARA_IDX][1:])], -] - -for limit_info in limit_info_list: - patch_target, limit_value = limit_info - if TARGETS[patch_target] == "music": - music_limit = limit_value - LOG("\t\t<%s __type=\"u32\">%d\n", TARGETS[patch_target], limit_value, TARGETS[patch_target]); -LOG("\t\n"); -*/ - LOG("\t\n"); for (int i=0; i < NUM_IDX; i++) {