From 4e694dc71f3b6fa4d18c599a4141650e5b49b395 Mon Sep 17 00:00:00 2001 From: Noah Philips Date: Mon, 9 Sep 2024 23:54:28 -0400 Subject: [PATCH 01/13] attempt at gc pal --- gsc/oot-gc-pal/mem_patch.gsc | 2 + gsc/oot-gc-pal/ups_size_patch.gsc | 244 ++++++++++++++++++++++++++++++ lib/liboot-gc-pal.a | 187 +++++++++++++++++++++++ lua/hooks.lua | 18 ++- lua/rom_table.lua | 20 +++ makefile | 14 +- src/gz/input.c | 3 +- src/gz/state.c | 12 +- src/gz/z64.h | 14 +- 9 files changed, 493 insertions(+), 21 deletions(-) create mode 100644 gsc/oot-gc-pal/mem_patch.gsc create mode 100644 gsc/oot-gc-pal/ups_size_patch.gsc create mode 100644 lib/liboot-gc-pal.a diff --git a/gsc/oot-gc-pal/mem_patch.gsc b/gsc/oot-gc-pal/mem_patch.gsc new file mode 100644 index 00000000..9c4e5605 --- /dev/null +++ b/gsc/oot-gc-pal/mem_patch.gsc @@ -0,0 +1,2 @@ +810004D4 3C02 +810004D6 0040 diff --git a/gsc/oot-gc-pal/ups_size_patch.gsc b/gsc/oot-gc-pal/ups_size_patch.gsc new file mode 100644 index 00000000..f4242b4f --- /dev/null +++ b/gsc/oot-gc-pal/ups_size_patch.gsc @@ -0,0 +1,244 @@ +8109F9F0 0000 +8109F9F2 0000 +8109F9F4 0000 +8109F9F6 0000 +8109F9F8 0000 +8109F9FA 0000 +8109F9FC 0000 +8109F9FE 0000 +8109FA00 0000 +8109FA02 0000 +8109FA04 0000 +8109FA06 0000 +8109FA08 0000 +8109FA0A 0000 +8109FA0C 0000 +8109FA0E 0000 +8109FA30 0000 +8109FA32 0000 +8109FA34 0000 +8109FA36 0000 +8109FA38 0000 +8109FA3A 0000 +8109FA3C 0000 +8109FA3E 0000 +8109FA40 0000 +8109FA42 0000 +8109FA44 0000 +8109FA46 0000 +8109FA48 0000 +8109FA4A 0000 +8109FA4C 0000 +8109FA4E 0000 +8109FA70 0000 +8109FA72 0000 +8109FA74 0000 +8109FA76 0000 +8109FA78 0000 +8109FA7A 0000 +8109FA7C 0000 +8109FA7E 0000 +8109FA80 0000 +8109FA82 0000 +8109FA84 0000 +8109FA86 0000 +8109FA88 0000 +8109FA8A 0000 +8109FA8C 0000 +8109FA8E 0000 +8109FA90 0000 +8109FA92 0000 +8109FA94 0000 +8109FA96 0000 +8109FA98 0000 +8109FA9A 0000 +8109FA9C 0000 +8109FA9E 0000 +8109FAA0 0000 +8109FAA2 0000 +8109FAA4 0000 +8109FAA6 0000 +8109FAA8 0000 +8109FAAA 0000 +8109FAAC 0000 +8109FAAE 0000 +8109FAB0 0000 +8109FAB2 0000 +8109FAB4 0000 +8109FAB6 0000 +8109FAB8 0000 +8109FABA 0000 +8109FABC 0000 +8109FABE 0000 +8109FAC0 0000 +8109FAC2 0000 +8109FAC4 0000 +8109FAC6 0000 +8109FAC8 0000 +8109FACA 0000 +8109FACC 0000 +8109FACE 0000 +8109FAD0 0000 +8109FAD2 0000 +8109FAD4 0000 +8109FAD6 0000 +8109FAD8 0000 +8109FADA 0000 +8109FADC 0000 +8109FADE 0000 +8109FAE0 0000 +8109FAE2 0000 +8109FAE4 0000 +8109FAE6 0000 +8109FAE8 0000 +8109FAEA 0000 +8109FAEC 0000 +8109FAEE 0000 +8109FAF0 0000 +8109FAF2 0000 +8109FAF4 0000 +8109FAF6 0000 +8109FAF8 0000 +8109FAFA 0000 +8109FAFC 0000 +8109FAFE 0000 +8109FB00 0000 +8109FB02 0000 +8109FB04 0000 +8109FB06 0000 +8109FB08 0000 +8109FB0A 0000 +8109FB0C 0000 +8109FB0E 0000 +8109FB10 0000 +8109FB12 0000 +8109FB14 0000 +8109FB16 0000 +8109FB18 0000 +8109FB1A 0000 +8109FB1C 0000 +8109FB1E 0000 +8109FB20 0000 +8109FB22 0000 +8109FB24 0000 +8109FB26 0000 +8109FB28 0000 +8109FB2A 0000 +8109FB2C 0000 +8109FB2E 0000 +8109FB30 0000 +8109FB32 0000 +8109FB54 0000 +8109FB56 0000 +8109FB58 0000 +8109FB5A 0000 +8109FB5C 0000 +8109FB5E 0000 +8109FB60 0000 +8109FB62 0000 +8109FB64 0000 +8109FB66 0000 +8109FB68 0000 +8109FB6A 0000 +8109FB6C 0000 +8109FB6E 0000 +8109FB70 0000 +8109FB72 0000 +8109FB74 0000 +8109FB76 0000 +8109FB78 0000 +8109FB7A 0000 +8109FB7C 0000 +8109FB7E 0000 +8109FB80 0000 +8109FB82 0000 +8109FB84 0000 +8109FB86 0000 +8109FB88 0000 +8109FB8A 0000 +8109FB8C 0000 +8109FB8E 0000 +8109FB90 0000 +8109FB92 0000 +8109FB94 0000 +8109FB96 0000 +8109FB98 0000 +8109FB9A 0000 +8109FB9C 0000 +8109FB9E 0000 +8109FBA0 0000 +8109FBA2 0000 +8109FBA4 0000 +8109FBA6 0000 +8109FBA8 0000 +8109FBAA 0000 +8109FBAC 0000 +8109FBAE 0000 +8109FBB0 0000 +8109FBB2 0000 +8109FBB4 0000 +8109FBB6 0000 +8109FBB8 0000 +8109FBBA 0000 +8109FBBC 0000 +8109FBBE 0000 +8109FBC0 0000 +8109FBC2 0000 +8109FBC4 0000 +8109FBC6 0000 +8109FBC8 0000 +8109FBCA 0000 +8109FBCC 0000 +8109FBCE 0000 +8109FBD0 0000 +8109FBD2 0000 +8109FBD4 0000 +8109FBD6 0000 +8109FBD8 0000 +8109FBDA 0000 +8109FBDC 0000 +8109FBDE 0000 +8109FBE0 0000 +8109FBE2 0000 +8109FBE4 0000 +8109FBE6 0000 +8109FBE8 0000 +8109FBEA 0000 +8109FBEC 0000 +8109FBEE 0000 +8109FBF0 0000 +8109FBF2 0000 +8109FBF4 0000 +8109FBF6 0000 +8109FBF8 0000 +8109FBFA 0000 +8109FBFC 0000 +8109FBFE 0000 +8109FC00 0000 +8109FC02 0000 +8109FC04 0000 +8109FC06 0000 +8109FC08 0000 +8109FC0A 0000 +8109FC0C 0000 +8109FC0E 0000 +8109FC10 0000 +8109FC12 0000 +8109FC14 0000 +8109FC16 0000 +8109FC18 0000 +8109FC1A 0000 +8109FC1C 0000 +8109FC1E 0000 +8109FC20 0000 +8109FC22 0000 +8109FC24 0000 +8109FC26 0000 +8109FC28 0000 +8109FC2A 0000 +8109FC2C 0000 +8109FC2E 0000 +8109FC30 0000 +8109FC32 0000 +8109FC34 0000 +8109FC36 0000 diff --git a/lib/liboot-gc-pal.a b/lib/liboot-gc-pal.a new file mode 100644 index 00000000..0e7bb5d4 --- /dev/null +++ b/lib/liboot-gc-pal.a @@ -0,0 +1,187 @@ +__osPiGetAccess = 0x800019B0 ; +__osPiRelAccess = 0x800019F4 ; +osSendMesg = 0x80001A20 ; +osStopThread = 0x80001B70 ; +osRecvMesg = 0x80001C40 ; +osDestroyThread = 0x80002D00 ; +osCreateThread = 0x80002F10 ; +osSetEventMesg = 0x80003BE0 ; +osCreateMesgQueue = 0x80003E10 ; +osStartThread = 0x80005C60 ; +z64_thread_idle = 0x80006590 ; +z64_thread_main = 0x80006F60 ; +z64_file_mq = 0x80007B90 ; +z64_thread_dmamgr = 0x80007C28 ; +piThread = 0x800088B0 ; +__osEventStateTab = 0x80009C30 ; +__osViIntrCount = 0x80009CDC ; +viThread = 0x80009D70 ; +z64_ftab = 0x8000AF90 ; +z64_Actor_UpdateBgCheckInfo = 0x80021C8C ; +z64_DrawActors = 0x8002490C ; +z64_DeleteActor = 0x80024E38 ; +z64_SpawnActor = 0x80024F68 ; +z64_SpawnActorAttachedB = 0x80025248 ; +z64_CreateStaticCollision = 0x8002E4BC ; +z64_camera_hook = 0x800485FC ; +z64_Camera_ChangeMode = 0x80048EFC ; +z64_Math_SinS = 0x80063314 ; +z64_Math_CosS = 0x800632D4 ; +z64_LoadMinimap = 0x8006BAA4 ; +z64_SwitchAgeEquips = 0x8006F2BC ; +z64_UpdateItemButton = 0x8006F608 ; +z64_LoadActionLabel = 0x80071804 ; +z64_UpdateEquipment = 0x80079284 ; +z64_InitPauseObjects = 0x8007BBE4 ; +z64_LoadRoom = 0x80080588 ; +z64_room_load_sync_hook = 0x800806EC ; +z64_DrawRoom = 0x80080764 ; +z64_UnloadRoom = 0x800807B4 ; +z64_Sram_LoadDebugSave = 0x8008FE2C ; +z64_Io = 0x800912A4 ; +z64_CreateSkyGfx = 0x80095868 ; +z64_CreateSkyVtx = 0x80095A18 ; +z64_entrance_offset_hook = 0x8009A7BC ; +z64_srand_call = 0x8009AA08 ; +z64_draw_room_1_call = 0x8009C4E8 ; +z64_draw_room_2_call = 0x8009C500 ; +z64_draw_actors_call = 0x8009C5D4 ; +z64_StopSfx = 0x8009FE50 ; +z64_UpdateCtxtInput = 0x800A06D4 ; +z64_main_hook = 0x800A0728 ; +z64_disp_swap_1 = 0x800A0C48 ; +z64_disp_swap_2 = 0x800A0C60 ; +z64_disp_swap_3 = 0x800A0C78 ; +z64_disp_swap_4 = 0x800A0C94 ; +z64_frame_input_call = 0x800A118C ; +z64_ocarina_update_call = 0x800A131C ; +z64_GetInput = 0x800A221C ; +z64_AfxCmdF = 0x800BB9F8 ; +z64_AfxCmdW = 0x800BBA1C ; +z64_FlushAfxCmd = 0x800BBAA0 ; +z64_ConfigureAfx = 0x800BBEA8 ; +z64_AfxRand = 0x800BC6E0 ; +z64_ocarina_input_call = 0x800C2940 ; +z64_afx_rand_call = 0x800C4538 ; +z64_ocarina_sync = 0x800C4634 ; +z64_OcarinaUpdate = 0x800C48B0 ; +z64_ResetAudio = 0x800C8964 ; +z64_Audio_PlaySfxGeneral = 0x800C8B3C ; +z64_Audio_IsSfxPlaying = 0x800CA644 ; +z64_CheckAfxConfigBusy = 0x800CC268 ; +z64_LoadOverlay = 0x800CD500 ; +z64_SeedRandom = 0x800CE4B0 ; +z64_guPerspectiveF_hook = 0x800D10C8 ; +z64_guPerspective_camo = 0x800D1300 ; +osGetCurrFaultedThread = 0x800D6540 ; +z64_metronome_start_1 = 0x800DDF48 ; +z64_metronome_start_2 = 0x800DE230 ; +z64_metronome_check_1 = 0x800DE2A0 ; +z64_part_space = 0x800E49B0 ; +z64_part_pos = 0x800E49B4 ; +z64_part_max = 0x800E49B8 ; +z64_part_ovl_tab = 0x800E4AB0 ; +z64_actor_ovl_tab = 0x800E53A0 ; +z_camera_c_data = 0x800E8FE0 ; +z64_hud_state = 0x800EC018 ; +z64_event_state_1 = 0x800EC020 ; +z64_letterbox_time = 0x800EC068 ; +z64_event_state_2 = 0x800EC06C ; +z64_event_camera = 0x800EC0C4 ; +z64_oob_timer = 0x800EC51C ; +z64_cs_message = 0x800ECB40 ; +z64_state_ovl_tab = 0x800EE1B0 ; +z64_weather_state = 0x800EE4B0 ; +z64_day_speed = 0x800EE4C0 ; +z64_sky_images = 0x800EE6BC ; +z64_light_handlers = 0x800F1050 ; +z64_map_mark_ovl = 0x800EEA68 ; +z_onepointdemo_c_data = 0x800EEA80 ; +z64_dins_state_1 = 0x800EEA88 ; +z64_dins_state_2 = 0x800F1A8C ; +z64_minimap_entrance_x = 0x800F23A0 ; +z64_minimap_entrance_y = 0x800F23A4 ; +z64_minimap_entrance_r = 0x800F23A8 ; +z64_hazard_state = 0x800F43A8 ; +z64_temp_day_speed = 0x800F44B4 ; +z64_n_camera_shake = 0x800F4BA4 ; +z64_object_table = 0x800F5E78 ; +z64_entrance_table = 0x800F6B10 ; +z64_scene_table = 0x800F8360 ; +z64_scene_config_table = 0x800F8C44 ; +z64_letterbox_target = 0x800FB2F4 ; +z64_letterbox_current = 0x800FB2F8 ; +z64_play_ovl_tab = 0x800FB300 ; +z64_play_ovl_ptr = 0x800FB33C ; +code_800EC960_c_data = 0x800FE260 ; +z64_sound_state = 0x800FE2F4 ; +z64_night_sfx = 0x800FE3C8 ; +z64_ocarina_state = 0x800FEBF8 ; +z64_song_play_counter = z64_ocarina_state + 0x005C ; +z64_ocarina_song_length = z64_ocarina_state + 0x0068 ; +z64_scarecrow_song = 0x800FF3EC ; +z64_song_ptr = 0x800FF52C ; +z64_song_rec_counter = 0x800FF54C ; +z64_ocarina_button_state = 0x800FF56C ; +z64_sfx_write_pos = 0x80100D50 ; +z64_sfx_read_pos = 0x80100D54 ; +z64_audio_cmd_write_pos = 0x80100DA0 ; +z64_audio_cmd_read_pos = 0x80100DA4 ; +z64_afx_cfg = 0x80100DB0 ; +z64_afx_config_busy = 0x80100DB4 ; +z64_random = 0x80101E50 ; +z64_message_state = 0x801077E4 ; +z64_staff_notes = 0x8010FE3C ; +z64_message_select_state = 0x8010FE74 ; +z64_message_icon_state = 0x8010FED0 ; +z64_message_note_icon_state = 0x801101C8 ; +z64_gameover_countdown = 0x80110260 ; +gspF3DEX2_NoN_fifoTextStart = 0x80111310 ; +gspF3DEX2_NoN_fifoDataStart = 0x80112940 ; +z64_pfx = 0x80113160 ; +z64_fw_state_1 = 0x80116F78 ; +z64_fw_state_2 = 0x80116F80 ; +z64_camera_state = 0x801171C0 ; +z64_file = 0x80118958 ; +z64_cs_state = 0x80119FA0 ; +z64_light_queue = 0x8011A0E0 ; +z64_game_arena = 0x8011A270 ; +z64_map_mark_data_tab = 0x8011A2A0 ; +z64_timer_state = 0x8011A2C0 ; +z64_camera_shake = 0x8011A300 ; +z64_poly_colorfilter_state = 0x8011B4E0 ; +z64_stab = 0x8011B668 ; +z64_thread_sched = 0x8011B718 ; +z64_thread_padmgr = 0x8011B980 ; +z64_input_direct = 0x8011BB30 ; +z64_thread_irqmgr = 0x8011BE00 ; +z64_thread_graph = 0x8011BFE8 ; +z64_thread_audio = 0x8011F320 ; +z64_mtx_stack = 0x8011F7C0 ; +z64_mtx_stack_top = 0x8011F7C4 ; +z64_thread_fault = 0x8011FDF8 ; +code_800EC960_c_bss = 0x80120770 ; +z64_song_state = 0x801208BC; +z64_ocarina_counter = z64_song_state + 0x0010 ; +z64_sfx_mute = 0x80123104 ; +z64_audio_cmd_buf = 0x801231B0 ; +z64_seq_ctl = 0x801235B0 ; +z64_afx = 0x80123FE0 ; +z64_afx_counter = z64_afx + 0x289C ; +z64_afx_cmd_write_pos = z64_afx + 0x5BD8 ; +z64_afx_cmd_read_pos = z64_afx + 0x5BD9 ; +z64_afx_cmd_buf = z64_afx + 0x5C50 ; +z_message_c_bss = 0x8012A800 ; +z64_zimg = 0x8012A840 ; +z64_disp = 0x80169040 ; +z64_ctxt = 0x801C6E60 ; +z64_game = z64_ctxt ; +z64_link = 0x801D93B0 ; +z64_cimg = 0x803B5000 ; +z64_item_highlight_vram = 0x80828824 ; +ovl_En_Skj = 0x80ADD870 ; +z64_metronome_check_2 = ovl_En_Skj + 0x29F4 ; +z64_metronome_check_3 = ovl_En_Skj + 0x2A3C ; +z64_metronome_check_4 = ovl_En_Skj + 0x2AC4 ; +ovl_En_Bom_Chu = 0x809B2180 ; +z64_bombchu_floor_poly_hook = ovl_En_Bom_Chu + 0x654 ; diff --git a/lua/hooks.lua b/lua/hooks.lua index a7c78c31..f37eb52c 100644 --- a/lua/hooks.lua +++ b/lua/hooks.lua @@ -86,7 +86,6 @@ for ovl_type, ovl_tbl in pairs(ovl_tbls) do local layout = ovl_tbl_layout[ovl_type] local p = (ovl_tbl.addr - code_vram) & 0x1FFFFFFF - local tbl_stride = ovl_tbl.stride or layout.stride local tbl_vrom_start = ovl_tbl.vrom_start or layout.vrom_start local tbl_vrom_end = ovl_tbl.vrom_end or layout.vrom_end @@ -130,14 +129,19 @@ for _, gsc in ipairs(gsc_list) do addr = addr - (obj.vram_start & 0x00FFFFFF) local file_idx = fs:vat(obj.vrom_start) - local file_gsc = file_gsc_map[file_idx] - if file_gsc == nil then - file_gsc = gru.gsc_create() - file_gsc_map[file_idx] = file_gsc - end + if file_idx == nil then + print(obj.vrom_start) + else + local file_gsc = file_gsc_map[file_idx] - file_gsc:insert(file_gsc:size(), addr, value) + if file_gsc == nil then + file_gsc = gru.gsc_create() + file_gsc_map[file_idx] = file_gsc + end + + file_gsc:insert(file_gsc:size(), addr, value) + end end end diff --git a/lua/rom_table.lua b/lua/rom_table.lua index 414eae57..ad94756b 100644 --- a/lua/rom_table.lua +++ b/lua/rom_table.lua @@ -223,6 +223,26 @@ rom_table = gz_name = "gz-oot-ce-j" .. version_suffix, title_id = "NGEJ", }, + [0x3FBD519F] = { + game = "oot", + version = "gc", + region = "pal", + boot_ind = 1, + boot_ram = 0x80000460, + code_ind = 28, + code_ram = 0x80010F00, + ovl_tbls = { + part = { addr = 0x800E4AB0 }, + actor = { addr = 0x800E53A0 }, + state = { addr = 0x800EE1B0 }, + map_mark = { addr = 0x800EEA68 }, + play = { addr = 0x800FB300 }, + }, + data_dir = "oot-gc-pal", + gz_version = "oot-gc-pal" .. version_suffix, + gz_name = "gz-oot-gc-pal" .. version_suffix, + title_id = "NGPL", + }, } vc_table = diff --git a/makefile b/makefile index 88de818d..8abb731f 100644 --- a/makefile +++ b/makefile @@ -27,7 +27,7 @@ ALL_LDFLAGS = -T $(LDSCRIPT) -L$(LIBDIR) -nostartfiles -specs=nosys.sp ALL_LDLIBS = $(LDLIBS) LUAFILE = $(EMUDIR)/Lua/patch-data.lua RESDESC = $(RESDIR)/resources.json -GZ_VERSIONS = oot-1.0 oot-1.1 oot-1.2 oot-mq-j oot-mq-u oot-gc-j oot-gc-u oot-ce-j oot-1.0-vc oot-1.1-vc oot-1.2-vc oot-mq-j-vc oot-mq-u-vc oot-gc-j-vc oot-gc-u-vc oot-ce-j-vc +GZ_VERSIONS = oot-gc-pal GZ_ADDRESS = 80400060 LDR_ADDRESS = 80000400 SRCDIR = src @@ -48,6 +48,7 @@ OBJ-OOT-MQ-U = $(OBJ-gz-oot-mq-u) $(OBJ-gz-oot-mq-u-vc) OBJ-OOT-GC-J = $(OBJ-gz-oot-gc-j) $(OBJ-gz-oot-gc-j-vc) OBJ-OOT-GC-U = $(OBJ-gz-oot-gc-u) $(OBJ-gz-oot-gc-u-vc) OBJ-OOT-CE-J = $(OBJ-gz-oot-ce-j) $(OBJ-gz-oot-ce-j-vc) +OBJ-OOT-GC-PAL = $(OBJ-gz-oot-gc-pal) $(OBJ-gz-oot-gc-pal-vc) ELF-OOT-1.0 = $(ELF-gz-oot-1.0) $(ELF-gz-oot-1.0-vc) ELF-OOT-1.1 = $(ELF-gz-oot-1.1) $(ELF-gz-oot-1.1-vc) ELF-OOT-1.2 = $(ELF-gz-oot-1.2) $(ELF-gz-oot-1.2-vc) @@ -56,10 +57,11 @@ ELF-OOT-MQ-U = $(ELF-gz-oot-mq-u) $(ELF-gz-oot-mq-u-vc) ELF-OOT-GC-J = $(ELF-gz-oot-gc-j) $(ELF-gz-oot-gc-j-vc) ELF-OOT-GC-U = $(ELF-gz-oot-gc-u) $(ELF-gz-oot-gc-u-vc) ELF-OOT-CE-J = $(ELF-gz-oot-ce-j) $(ELF-gz-oot-ce-j-vc) -OBJ-N64 = $(OBJ-gz-oot-1.0) $(OBJ-gz-oot-1.1) $(OBJ-gz-oot-1.2) $(OBJ-gz-oot-mq-j) $(OBJ-gz-oot-mq-u) $(OBJ-gz-oot-gc-j) $(OBJ-gz-oot-gc-u) $(OBJ-gz-oot-ce-j) -OBJ-VC = $(OBJ-gz-oot-1.0-vc) $(OBJ-gz-oot-1.1-vc) $(OBJ-gz-oot-1.2-vc) $(OBJ-gz-oot-mq-j-vc) $(OBJ-gz-oot-mq-u-vc) $(OBJ-gz-oot-gc-j-vc) $(OBJ-gz-oot-gc-u-vc) $(OBJ-gz-oot-ce-j-vc) -ELF-N64 = $(ELF-gz-oot-1.0) $(ELF-gz-oot-1.1) $(ELF-gz-oot-1.2) $(ELF-gz-oot-mq-j) $(ELF-gz-oot-mq-u) $(ELF-gz-oot-gc-j) $(ELF-gz-oot-gc-u) $(ELF-gz-oot-ce-j) -ELF-VC = $(ELF-gz-oot-1.0-vc) $(ELF-gz-oot-1.1-vc) $(ELF-gz-oot-1.2-vc) $(ELF-gz-oot-mq-j-vc) $(ELF-gz-oot-mq-u-vc) $(ELF-gz-oot-gc-j-vc) $(ELF-gz-oot-gc-u-vc) $(ELF-gz-oot-ce-j-vc) +ELF-OOT-GC-PAL = $(ELF-gz-oot-gc-pal) $(ELF-gz-oot-gc-pal-vc) +OBJ-N64 = $(OBJ-gz-oot-1.0) $(OBJ-gz-oot-1.1) $(OBJ-gz-oot-1.2) $(OBJ-gz-oot-mq-j) $(OBJ-gz-oot-mq-u) $(OBJ-gz-oot-gc-j) $(OBJ-gz-oot-gc-u) $(OBJ-gz-oot-ce-j) $(OBJ-gz-oot-gc-pal) +OBJ-VC = $(OBJ-gz-oot-1.0-vc) $(OBJ-gz-oot-1.1-vc) $(OBJ-gz-oot-1.2-vc) $(OBJ-gz-oot-mq-j-vc) $(OBJ-gz-oot-mq-u-vc) $(OBJ-gz-oot-gc-j-vc) $(OBJ-gz-oot-gc-u-vc) $(OBJ-gz-oot-ce-j-vc) $(OBJ-gz-oot-gc-pal-vc) +ELF-N64 = $(ELF-gz-oot-1.0) $(ELF-gz-oot-1.1) $(ELF-gz-oot-1.2) $(ELF-gz-oot-mq-j) $(ELF-gz-oot-mq-u) $(ELF-gz-oot-gc-j) $(ELF-gz-oot-gc-u) $(ELF-gz-oot-ce-j) $(ELF-gz-oot-gc-pal) +ELF-VC = $(ELF-gz-oot-1.0-vc) $(ELF-gz-oot-1.1-vc) $(ELF-gz-oot-1.2-vc) $(ELF-gz-oot-mq-j-vc) $(ELF-gz-oot-mq-u-vc) $(ELF-gz-oot-gc-j-vc) $(ELF-gz-oot-gc-u-vc) $(ELF-gz-oot-ce-j-vc) $(ELF-gz-oot-gc-pal-vc) GZ = $(foreach v,$(GZ_VERSIONS),gz-$(v)) HOOKS = $(foreach v,$(GZ_VERSIONS),gz-$(v)-hooks) @@ -162,6 +164,7 @@ $(OBJ-OOT-MQ-U) : ALL_CPPFLAGS += -DZ64_VERSION=Z64_OOTMQU $(OBJ-OOT-GC-J) : ALL_CPPFLAGS += -DZ64_VERSION=Z64_OOTGCJ $(OBJ-OOT-GC-U) : ALL_CPPFLAGS += -DZ64_VERSION=Z64_OOTGCU $(OBJ-OOT-CE-J) : ALL_CPPFLAGS += -DZ64_VERSION=Z64_OOTCEJ +$(OBJ-OOT-GC-PAL) : ALL_CPPFLAGS += -DZ64_VERSION=Z64_OOTGCPAL $(ELF-OOT-1.0) : ALL_LDLIBS += -loot-1.0 $(ELF-OOT-1.1) : ALL_LDLIBS += -loot-1.1 $(ELF-OOT-1.2) : ALL_LDLIBS += -loot-1.2 @@ -170,6 +173,7 @@ $(ELF-OOT-MQ-U) : ALL_LDLIBS += -loot-mq-u $(ELF-OOT-GC-J) : ALL_LDLIBS += -loot-gc-j $(ELF-OOT-GC-U) : ALL_LDLIBS += -loot-gc-u $(ELF-OOT-CE-J) : ALL_LDLIBS += -loot-ce-j +$(ELF-OOT-GC-PAL) : ALL_LDLIBS += -loot-gc-pal ifeq '$(shell $(CC) -dumpmachine 2>/dev/null)' 'mips64-ultra-elf' $(OBJ-VC) : ALL_CFLAGS += -n64-wiivc $(OBJ-VC) : ALL_CXXFLAGS += -n64-wiivc diff --git a/src/gz/input.c b/src/gz/input.c index 67c51bf4..a5b275c4 100644 --- a/src/gz/input.c +++ b/src/gz/input.c @@ -88,7 +88,8 @@ const uint32_t input_button_color[] = Z64_VERSION == Z64_OOTMQU || \ Z64_VERSION == Z64_OOTGCJ || \ Z64_VERSION == Z64_OOTGCU || \ - Z64_VERSION == Z64_OOTCEJ + Z64_VERSION == Z64_OOTCEJ || \ + Z64_VERSION == Z64_OOTGCPAL 0x787878, 0xC0C0C0, 0xFF1E1E, diff --git a/src/gz/state.c b/src/gz/state.c index c65e40af..8e2a3872 100644 --- a/src/gz/state.c +++ b/src/gz/state.c @@ -65,7 +65,8 @@ static void save_ovl(void **p, void *addr, Z64_VERSION == Z64_OOTMQU || \ Z64_VERSION == Z64_OOTGCJ || \ Z64_VERSION == Z64_OOTGCU || \ - Z64_VERSION == Z64_OOTCEJ + Z64_VERSION == Z64_OOTCEJ || \ + Z64_VERSION == Z64_OOTGCPAL z64_ovl_hdr_t l_hdr; hdr = &l_hdr; yaz0_begin(file->prom_start); @@ -149,7 +150,8 @@ static void load_ovl(void **p, void **p_addr, Z64_VERSION == Z64_OOTMQU || \ Z64_VERSION == Z64_OOTGCJ || \ Z64_VERSION == Z64_OOTGCU || \ - Z64_VERSION == Z64_OOTCEJ + Z64_VERSION == Z64_OOTCEJ || \ + Z64_VERSION == Z64_OOTGCPAL z64_ovl_hdr_t l_hdr; hdr = &l_hdr; serial_read(p, hdr, sizeof(*hdr)); @@ -1154,7 +1156,8 @@ uint32_t save_state(struct state_meta *state) Z64_VERSION == Z64_OOTMQU || \ Z64_VERSION == Z64_OOTGCJ || \ Z64_VERSION == Z64_OOTGCU || \ - Z64_VERSION == Z64_OOTCEJ + Z64_VERSION == Z64_OOTCEJ || \ + Z64_VERSION == Z64_OOTGCPAL serial_write(&p, &code_800EC960_c_data[0x0998], 0x0060); /* 12b overhead */ serial_write(&p, &code_800EC960_c_data[0x0A00], 0x0008); serial_write(&p, &code_800EC960_c_data[0x118C], 0x0144); @@ -2112,7 +2115,8 @@ void load_state(const struct state_meta *state) Z64_VERSION == Z64_OOTMQU || \ Z64_VERSION == Z64_OOTGCJ || \ Z64_VERSION == Z64_OOTGCU || \ - Z64_VERSION == Z64_OOTCEJ + Z64_VERSION == Z64_OOTCEJ || \ + Z64_VERSION == Z64_OOTGCPAL serial_read(&p, &code_800EC960_c_data[0x0998], 0x0060); /* 12b overhead */ serial_read(&p, &code_800EC960_c_data[0x0A00], 0x0008); serial_read(&p, &code_800EC960_c_data[0x118C], 0x0144); diff --git a/src/gz/z64.h b/src/gz/z64.h index 6dd76717..39e9f77f 100644 --- a/src/gz/z64.h +++ b/src/gz/z64.h @@ -16,6 +16,8 @@ #define Z64_OOTGCJ 0x05 #define Z64_OOTGCU 0x06 #define Z64_OOTCEJ 0x07 +#define Z64_OOTGCPAL 0x08 + #define Z64_SCREEN_WIDTH 320 #define Z64_SCREEN_HEIGHT 240 @@ -68,7 +70,8 @@ struct z64_arena Z64_VERSION == Z64_OOTMQU || \ Z64_VERSION == Z64_OOTGCJ || \ Z64_VERSION == Z64_OOTGCU || \ - Z64_VERSION == Z64_OOTCEJ + Z64_VERSION == Z64_OOTCEJ || \ + Z64_VERSION == Z64_OOTGCPAL /* 0x0008 */ #endif }; @@ -95,7 +98,8 @@ struct z64_arena_node Z64_VERSION == Z64_OOTMQU || \ Z64_VERSION == Z64_OOTGCJ || \ Z64_VERSION == Z64_OOTGCU || \ - Z64_VERSION == Z64_OOTCEJ + Z64_VERSION == Z64_OOTCEJ || \ + Z64_VERSION == Z64_OOTGCPAL char data[]; /* 0x0010 */ #endif }; @@ -796,7 +800,8 @@ typedef struct Z64_VERSION == Z64_OOTMQU || \ Z64_VERSION == Z64_OOTGCJ || \ Z64_VERSION == Z64_OOTGCU || \ - Z64_VERSION == Z64_OOTCEJ + Z64_VERSION == Z64_OOTCEJ || \ + Z64_VERSION == Z64_OOTGCPAL char unk_0x1410[0x0018]; /* 0x1410 */ z64_gameinfo_t *gameinfo; /* 0x1428 */ char unk_0x142C[0x0024]; /* 0x142C */ @@ -2149,7 +2154,8 @@ typedef struct Z64_VERSION == Z64_OOTMQU || \ Z64_VERSION == Z64_OOTGCJ || \ Z64_VERSION == Z64_OOTGCU || \ - Z64_VERSION == Z64_OOTCEJ + Z64_VERSION == Z64_OOTCEJ || \ + Z64_VERSION == Z64_OOTGCPAL # define z64_icon_item_static 8 # define z64_icon_item_24_static 9 # define z64_icon_item_field_static 10 From c1843afe7443e0c3129bdee39628e6bbecc88e72 Mon Sep 17 00:00:00 2001 From: Noah Philips Date: Tue, 10 Sep 2024 20:47:11 -0400 Subject: [PATCH 02/13] removing ups size patch --- gsc/oot-gc-pal/ups_size_patch.gsc | 244 ------------------------------ 1 file changed, 244 deletions(-) diff --git a/gsc/oot-gc-pal/ups_size_patch.gsc b/gsc/oot-gc-pal/ups_size_patch.gsc index f4242b4f..e69de29b 100644 --- a/gsc/oot-gc-pal/ups_size_patch.gsc +++ b/gsc/oot-gc-pal/ups_size_patch.gsc @@ -1,244 +0,0 @@ -8109F9F0 0000 -8109F9F2 0000 -8109F9F4 0000 -8109F9F6 0000 -8109F9F8 0000 -8109F9FA 0000 -8109F9FC 0000 -8109F9FE 0000 -8109FA00 0000 -8109FA02 0000 -8109FA04 0000 -8109FA06 0000 -8109FA08 0000 -8109FA0A 0000 -8109FA0C 0000 -8109FA0E 0000 -8109FA30 0000 -8109FA32 0000 -8109FA34 0000 -8109FA36 0000 -8109FA38 0000 -8109FA3A 0000 -8109FA3C 0000 -8109FA3E 0000 -8109FA40 0000 -8109FA42 0000 -8109FA44 0000 -8109FA46 0000 -8109FA48 0000 -8109FA4A 0000 -8109FA4C 0000 -8109FA4E 0000 -8109FA70 0000 -8109FA72 0000 -8109FA74 0000 -8109FA76 0000 -8109FA78 0000 -8109FA7A 0000 -8109FA7C 0000 -8109FA7E 0000 -8109FA80 0000 -8109FA82 0000 -8109FA84 0000 -8109FA86 0000 -8109FA88 0000 -8109FA8A 0000 -8109FA8C 0000 -8109FA8E 0000 -8109FA90 0000 -8109FA92 0000 -8109FA94 0000 -8109FA96 0000 -8109FA98 0000 -8109FA9A 0000 -8109FA9C 0000 -8109FA9E 0000 -8109FAA0 0000 -8109FAA2 0000 -8109FAA4 0000 -8109FAA6 0000 -8109FAA8 0000 -8109FAAA 0000 -8109FAAC 0000 -8109FAAE 0000 -8109FAB0 0000 -8109FAB2 0000 -8109FAB4 0000 -8109FAB6 0000 -8109FAB8 0000 -8109FABA 0000 -8109FABC 0000 -8109FABE 0000 -8109FAC0 0000 -8109FAC2 0000 -8109FAC4 0000 -8109FAC6 0000 -8109FAC8 0000 -8109FACA 0000 -8109FACC 0000 -8109FACE 0000 -8109FAD0 0000 -8109FAD2 0000 -8109FAD4 0000 -8109FAD6 0000 -8109FAD8 0000 -8109FADA 0000 -8109FADC 0000 -8109FADE 0000 -8109FAE0 0000 -8109FAE2 0000 -8109FAE4 0000 -8109FAE6 0000 -8109FAE8 0000 -8109FAEA 0000 -8109FAEC 0000 -8109FAEE 0000 -8109FAF0 0000 -8109FAF2 0000 -8109FAF4 0000 -8109FAF6 0000 -8109FAF8 0000 -8109FAFA 0000 -8109FAFC 0000 -8109FAFE 0000 -8109FB00 0000 -8109FB02 0000 -8109FB04 0000 -8109FB06 0000 -8109FB08 0000 -8109FB0A 0000 -8109FB0C 0000 -8109FB0E 0000 -8109FB10 0000 -8109FB12 0000 -8109FB14 0000 -8109FB16 0000 -8109FB18 0000 -8109FB1A 0000 -8109FB1C 0000 -8109FB1E 0000 -8109FB20 0000 -8109FB22 0000 -8109FB24 0000 -8109FB26 0000 -8109FB28 0000 -8109FB2A 0000 -8109FB2C 0000 -8109FB2E 0000 -8109FB30 0000 -8109FB32 0000 -8109FB54 0000 -8109FB56 0000 -8109FB58 0000 -8109FB5A 0000 -8109FB5C 0000 -8109FB5E 0000 -8109FB60 0000 -8109FB62 0000 -8109FB64 0000 -8109FB66 0000 -8109FB68 0000 -8109FB6A 0000 -8109FB6C 0000 -8109FB6E 0000 -8109FB70 0000 -8109FB72 0000 -8109FB74 0000 -8109FB76 0000 -8109FB78 0000 -8109FB7A 0000 -8109FB7C 0000 -8109FB7E 0000 -8109FB80 0000 -8109FB82 0000 -8109FB84 0000 -8109FB86 0000 -8109FB88 0000 -8109FB8A 0000 -8109FB8C 0000 -8109FB8E 0000 -8109FB90 0000 -8109FB92 0000 -8109FB94 0000 -8109FB96 0000 -8109FB98 0000 -8109FB9A 0000 -8109FB9C 0000 -8109FB9E 0000 -8109FBA0 0000 -8109FBA2 0000 -8109FBA4 0000 -8109FBA6 0000 -8109FBA8 0000 -8109FBAA 0000 -8109FBAC 0000 -8109FBAE 0000 -8109FBB0 0000 -8109FBB2 0000 -8109FBB4 0000 -8109FBB6 0000 -8109FBB8 0000 -8109FBBA 0000 -8109FBBC 0000 -8109FBBE 0000 -8109FBC0 0000 -8109FBC2 0000 -8109FBC4 0000 -8109FBC6 0000 -8109FBC8 0000 -8109FBCA 0000 -8109FBCC 0000 -8109FBCE 0000 -8109FBD0 0000 -8109FBD2 0000 -8109FBD4 0000 -8109FBD6 0000 -8109FBD8 0000 -8109FBDA 0000 -8109FBDC 0000 -8109FBDE 0000 -8109FBE0 0000 -8109FBE2 0000 -8109FBE4 0000 -8109FBE6 0000 -8109FBE8 0000 -8109FBEA 0000 -8109FBEC 0000 -8109FBEE 0000 -8109FBF0 0000 -8109FBF2 0000 -8109FBF4 0000 -8109FBF6 0000 -8109FBF8 0000 -8109FBFA 0000 -8109FBFC 0000 -8109FBFE 0000 -8109FC00 0000 -8109FC02 0000 -8109FC04 0000 -8109FC06 0000 -8109FC08 0000 -8109FC0A 0000 -8109FC0C 0000 -8109FC0E 0000 -8109FC10 0000 -8109FC12 0000 -8109FC14 0000 -8109FC16 0000 -8109FC18 0000 -8109FC1A 0000 -8109FC1C 0000 -8109FC1E 0000 -8109FC20 0000 -8109FC22 0000 -8109FC24 0000 -8109FC26 0000 -8109FC28 0000 -8109FC2A 0000 -8109FC2C 0000 -8109FC2E 0000 -8109FC30 0000 -8109FC32 0000 -8109FC34 0000 -8109FC36 0000 From 499d1380459674990f1a3a92fbeebd3a32ef0686 Mon Sep 17 00:00:00 2001 From: Noah Philips Date: Tue, 10 Sep 2024 23:17:10 -0400 Subject: [PATCH 03/13] updating z64_poly_colorfilter_state and z64_light_handlers --- lib/liboot-gc-pal.a | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/liboot-gc-pal.a b/lib/liboot-gc-pal.a index 0e7bb5d4..d9fd3a5d 100644 --- a/lib/liboot-gc-pal.a +++ b/lib/liboot-gc-pal.a @@ -94,7 +94,7 @@ z64_state_ovl_tab = 0x800EE1B0 ; z64_weather_state = 0x800EE4B0 ; z64_day_speed = 0x800EE4C0 ; z64_sky_images = 0x800EE6BC ; -z64_light_handlers = 0x800F1050 ; +z64_light_handlers = 0x800EE9B0 ; z64_map_mark_ovl = 0x800EEA68 ; z_onepointdemo_c_data = 0x800EEA80 ; z64_dins_state_1 = 0x800EEA88 ; @@ -149,7 +149,7 @@ z64_game_arena = 0x8011A270 ; z64_map_mark_data_tab = 0x8011A2A0 ; z64_timer_state = 0x8011A2C0 ; z64_camera_shake = 0x8011A300 ; -z64_poly_colorfilter_state = 0x8011B4E0 ; +z64_poly_colorfilter_state = 0x8011B4E8 ; z64_stab = 0x8011B668 ; z64_thread_sched = 0x8011B718 ; z64_thread_padmgr = 0x8011B980 ; From 4f5c52fb1f3ac1966dd07320ca16733582b00922 Mon Sep 17 00:00:00 2001 From: Noah Philips Date: Wed, 11 Sep 2024 08:23:41 -0400 Subject: [PATCH 04/13] fixing loading savestates --- src/gz/state.c | 19 ++++++++------ src/gz/z64.h | 67 ++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 77 insertions(+), 9 deletions(-) diff --git a/src/gz/state.c b/src/gz/state.c index 8e2a3872..184bd271 100644 --- a/src/gz/state.c +++ b/src/gz/state.c @@ -1618,14 +1618,19 @@ void load_state(const struct state_meta *state) zu_getfile(vaddr, z64_game.pause_ctxt.name_texture, 0x0400); } } - if (z64_file.language == 0) { - zu_getfile_idx(z64_icon_item_jpn_static, - z64_game.pause_ctxt.icon_item_lang); - } - else { - zu_getfile_idx(z64_icon_item_nes_static, + #if Z64_VERSION == Z64_OOTGCPAL + zu_getfile_idx(z64_icon_item_nes_static, z64_game.pause_ctxt.icon_item_lang); - } + #else + if (z64_file.language == 0) { + zu_getfile_idx(z64_icon_item_jpn_static, + z64_game.pause_ctxt.icon_item_lang); + } + else { + zu_getfile_idx(z64_icon_item_nes_static, + z64_game.pause_ctxt.icon_item_lang); + } + #endif zu_getfile_idx(z64_icon_item_static, z64_game.pause_ctxt.icon_item); zu_getfile_idx(z64_icon_item_24_static, z64_game.pause_ctxt.icon_item_24); /* gray out restricted items */ diff --git a/src/gz/z64.h b/src/gz/z64.h index 39e9f77f..83b79b3d 100644 --- a/src/gz/z64.h +++ b/src/gz/z64.h @@ -2154,8 +2154,7 @@ typedef struct Z64_VERSION == Z64_OOTMQU || \ Z64_VERSION == Z64_OOTGCJ || \ Z64_VERSION == Z64_OOTGCU || \ - Z64_VERSION == Z64_OOTCEJ || \ - Z64_VERSION == Z64_OOTGCPAL + Z64_VERSION == Z64_OOTCEJ # define z64_icon_item_static 8 # define z64_icon_item_24_static 9 # define z64_icon_item_field_static 10 @@ -2220,6 +2219,70 @@ typedef struct # define z64_vr_TTVR_pal_static 1001 # define z64_vr_FCVR_static 1002 # define z64_vr_FCVR_pal_static 1003 +#elif Z64_VERSION == Z64_OOTGCPAL +# define z64_icon_item_static 7 +# define z64_icon_item_24_static 8 +# define z64_icon_item_field_static 9 +# define z64_icon_item_dungeon_static 10 +# define z64_icon_item_gameover_static 11 +# define z64_icon_item_nes_static 12 +# define z64_item_name_static 15 +# define z64_map_name_static 16 +# define z64_message_static 18 +# define z64_message_texture_static 19 +# define z64_nes_font_static 20 +# define z64_map_48x85_static 26 +# define z64_parameter_static 940 +# define z64_vr_cloud2_static 952 +# define z64_vr_cloud2_pal_static 954 +# define z64_vr_holy0_static 957 +# define z64_vr_holy0_pal_static 958 +# define z64_vr_holy1_static 959 +# define z64_vr_holy1_pal_static 960 +# define z64_vr_MDVR_static 961 +# define z64_vr_MDVR_pal_static 962 +# define z64_vr_MNVR_static 963 +# define z64_vr_MNVR_pal_static 964 +# define z64_vr_RUVR_static 965 +# define z64_vr_RUVR_pal_static 966 +# define z64_vr_LHVR_static 967 +# define z64_vr_LHVR_pal_static 968 +# define z64_vr_KHVR_static 969 +# define z64_vr_KHVR_pal_static 970 +# define z64_vr_K3VR_static 971 +# define z64_vr_K3VR_pal_static 972 +# define z64_vr_K4VR_static 973 +# define z64_vr_K4VR_pal_static 974 +# define z64_vr_K5VR_static 975 +# define z64_vr_K5VR_pal_static 976 +# define z64_vr_SP1a_static 977 +# define z64_vr_SP1a_pal_static 978 +# define z64_vr_MLVR_static 979 +# define z64_vr_MLVR_pal_static 980 +# define z64_vr_KKRVR_static 981 +# define z64_vr_KKRVR_pal_static 982 +# define z64_vr_KR3VR_static 983 +# define z64_vr_KR3VR_pal_static 984 +# define z64_vr_IPVR_static 985 +# define z64_vr_IPVR_pal_static 986 +# define z64_vr_KSVR_static 987 +# define z64_vr_KSVR_pal_static 988 +# define z64_vr_GLVR_static 989 +# define z64_vr_GLVR_pal_static 990 +# define z64_vr_ZRVR_static 991 +# define z64_vr_ZRVR_pal_static 992 +# define z64_vr_DGVR_static 993 +# define z64_vr_DGVR_pal_static 994 +# define z64_vr_ALVR_static 995 +# define z64_vr_ALVR_pal_static 996 +# define z64_vr_NSVR_static 997 +# define z64_vr_NSVR_pal_static 998 +# define z64_vr_LBVR_static 999 +# define z64_vr_LBVR_pal_static 1000 +# define z64_vr_TTVR_static 1001 +# define z64_vr_TTVR_pal_static 1002 +# define z64_vr_FCVR_static 1003 +# define z64_vr_FCVR_pal_static 1004 #endif /* data */ From b28494f6b8b74e0f856fa160a9366a732085c7a0 Mon Sep 17 00:00:00 2001 From: Noah Philips Date: Fri, 13 Sep 2024 18:45:31 -0400 Subject: [PATCH 05/13] adding oot-gc-pal-vc --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index 8abb731f..8348c206 100644 --- a/makefile +++ b/makefile @@ -27,7 +27,7 @@ ALL_LDFLAGS = -T $(LDSCRIPT) -L$(LIBDIR) -nostartfiles -specs=nosys.sp ALL_LDLIBS = $(LDLIBS) LUAFILE = $(EMUDIR)/Lua/patch-data.lua RESDESC = $(RESDIR)/resources.json -GZ_VERSIONS = oot-gc-pal +GZ_VERSIONS = oot-gc-pal oot-gc-pal-vc GZ_ADDRESS = 80400060 LDR_ADDRESS = 80000400 SRCDIR = src From d9f90ff156630b9103e68ce8c4e6bb66a9186c7a Mon Sep 17 00:00:00 2001 From: Noah Philips Date: Sun, 14 Dec 2025 12:09:02 -0500 Subject: [PATCH 06/13] changes to merge gc pal to latest of master --- Makefile | 4 ++++ lib/liboot-gc-pal.a | 9 ++++----- lua/rom_table.lua | 1 + src/gz/gz_file.c | 2 ++ src/gz/ldr.S | 3 ++- src/gz/z64_version.h | 1 + 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index a8a3455e..3efa5d6c 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,7 @@ OBJ-OOT-MQ-U = $(OBJ-gz-oot-mq-u) $(OBJ-gz-oot-mq-u-vc) OBJ-OOT-GC-J = $(OBJ-gz-oot-gc-j) $(OBJ-gz-oot-gc-j-vc) OBJ-OOT-GC-U = $(OBJ-gz-oot-gc-u) $(OBJ-gz-oot-gc-u-vc) OBJ-OOT-CE-J = $(OBJ-gz-oot-ce-j) $(OBJ-gz-oot-ce-j-vc) +OBJ-OOT-IQUE-CN = $(OBJ-gz-oot-ique-cn) OBJ-OOT-GC-PAL = $(OBJ-gz-oot-gc-pal) $(OBJ-gz-oot-gc-pal-vc) ELF-OOT-1.0 = $(ELF-gz-oot-1.0) $(ELF-gz-oot-1.0-vc) ELF-OOT-1.1 = $(ELF-gz-oot-1.1) $(ELF-gz-oot-1.1-vc) @@ -58,6 +59,7 @@ ELF-OOT-GC-J = $(ELF-gz-oot-gc-j) $(ELF-gz-oot-gc-j-vc) ELF-OOT-GC-U = $(ELF-gz-oot-gc-u) $(ELF-gz-oot-gc-u-vc) ELF-OOT-CE-J = $(ELF-gz-oot-ce-j) $(ELF-gz-oot-ce-j-vc) ELF-OOT-GC-PAL = $(ELF-gz-oot-gc-pal) $(ELF-gz-oot-gc-pal-vc) +ELF-OOT-IQUE-CN = $(ELF-gz-oot-ique-cn) OBJ-N64 = $(OBJ-gz-oot-1.0) $(OBJ-gz-oot-1.1) $(OBJ-gz-oot-1.2) $(OBJ-gz-oot-mq-j) $(OBJ-gz-oot-mq-u) $(OBJ-gz-oot-gc-j) $(OBJ-gz-oot-gc-u) $(OBJ-gz-oot-ce-j) $(OBJ-gz-oot-gc-pal) OBJ-VC = $(OBJ-gz-oot-1.0-vc) $(OBJ-gz-oot-1.1-vc) $(OBJ-gz-oot-1.2-vc) $(OBJ-gz-oot-mq-j-vc) $(OBJ-gz-oot-mq-u-vc) $(OBJ-gz-oot-gc-j-vc) $(OBJ-gz-oot-gc-u-vc) $(OBJ-gz-oot-ce-j-vc) $(OBJ-gz-oot-gc-pal-vc) ELF-N64 = $(ELF-gz-oot-1.0) $(ELF-gz-oot-1.1) $(ELF-gz-oot-1.2) $(ELF-gz-oot-mq-j) $(ELF-gz-oot-mq-u) $(ELF-gz-oot-gc-j) $(ELF-gz-oot-gc-u) $(ELF-gz-oot-ce-j) $(ELF-gz-oot-gc-pal) @@ -165,6 +167,7 @@ $(OBJ-OOT-MQ-U) : ALL_CPPFLAGS += -DZ64_VERSION=Z64_OOTMQU $(OBJ-OOT-GC-J) : ALL_CPPFLAGS += -DZ64_VERSION=Z64_OOTGCJ $(OBJ-OOT-GC-U) : ALL_CPPFLAGS += -DZ64_VERSION=Z64_OOTGCU $(OBJ-OOT-CE-J) : ALL_CPPFLAGS += -DZ64_VERSION=Z64_OOTCEJ +$(OBJ-OOT-IQUE-CN) : ALL_CPPFLAGS += -DZ64_VERSION=Z64_OOTIQC $(OBJ-OOT-GC-PAL) : ALL_CPPFLAGS += -DZ64_VERSION=Z64_OOTGCPAL $(ELF-OOT-1.0) : ALL_LDLIBS += -loot-1.0 $(ELF-OOT-1.1) : ALL_LDLIBS += -loot-1.1 @@ -174,6 +177,7 @@ $(ELF-OOT-MQ-U) : ALL_LDLIBS += -loot-mq-u $(ELF-OOT-GC-J) : ALL_LDLIBS += -loot-gc-j $(ELF-OOT-GC-U) : ALL_LDLIBS += -loot-gc-u $(ELF-OOT-CE-J) : ALL_LDLIBS += -loot-ce-j +$(ELF-OOT-IQUE-CN) : ALL_LDLIBS += -loot-ique-cn $(ELF-OOT-GC-PAL) : ALL_LDLIBS += -loot-gc-pal ifeq '$(shell $(CC) -dumpmachine 2>/dev/null)' 'mips64-ultra-elf' $(OBJ-VC) : ALL_CFLAGS += -n64-wiivc diff --git a/lib/liboot-gc-pal.a b/lib/liboot-gc-pal.a index d9fd3a5d..a9153cac 100644 --- a/lib/liboot-gc-pal.a +++ b/lib/liboot-gc-pal.a @@ -1,25 +1,22 @@ +entrypoint = 0x80000400 ; __osPiGetAccess = 0x800019B0 ; __osPiRelAccess = 0x800019F4 ; osSendMesg = 0x80001A20 ; osStopThread = 0x80001B70 ; osRecvMesg = 0x80001C40 ; -osDestroyThread = 0x80002D00 ; osCreateThread = 0x80002F10 ; osSetEventMesg = 0x80003BE0 ; osCreateMesgQueue = 0x80003E10 ; osStartThread = 0x80005C60 ; z64_thread_idle = 0x80006590 ; z64_thread_main = 0x80006F60 ; -z64_file_mq = 0x80007B90 ; z64_thread_dmamgr = 0x80007C28 ; -piThread = 0x800088B0 ; +z64_file_mq = 0x80007B90 ; __osEventStateTab = 0x80009C30 ; __osViIntrCount = 0x80009CDC ; -viThread = 0x80009D70 ; z64_ftab = 0x8000AF90 ; z64_Actor_UpdateBgCheckInfo = 0x80021C8C ; z64_DrawActors = 0x8002490C ; -z64_DeleteActor = 0x80024E38 ; z64_SpawnActor = 0x80024F68 ; z64_SpawnActorAttachedB = 0x80025248 ; z64_CreateStaticCollision = 0x8002E4BC ; @@ -131,6 +128,7 @@ z64_afx_cfg = 0x80100DB0 ; z64_afx_config_busy = 0x80100DB4 ; z64_random = 0x80101E50 ; z64_message_state = 0x801077E4 ; +z64_textbox_skipped = z64_message_state + 0xC ; z64_staff_notes = 0x8010FE3C ; z64_message_select_state = 0x8010FE74 ; z64_message_icon_state = 0x8010FED0 ; @@ -143,6 +141,7 @@ z64_fw_state_1 = 0x80116F78 ; z64_fw_state_2 = 0x80116F80 ; z64_camera_state = 0x801171C0 ; z64_file = 0x80118958 ; +z64_gameinfo = 0x80119D80 ; z64_cs_state = 0x80119FA0 ; z64_light_queue = 0x8011A0E0 ; z64_game_arena = 0x8011A270 ; diff --git a/lua/rom_table.lua b/lua/rom_table.lua index 0df6f52f..237b0c15 100644 --- a/lua/rom_table.lua +++ b/lua/rom_table.lua @@ -252,6 +252,7 @@ rom_table = data_dir = "oot-gc-pal", gz_version = "oot-gc-pal" .. version_suffix, gz_name = "gz-oot-gc-pal" .. version_suffix, + patches = { "mem_patch", "ups_size_patch" }, title_id = "NGPL", }, [0xF45C5532] = { diff --git a/src/gz/gz_file.c b/src/gz/gz_file.c index ef43b7d2..7704c2f6 100644 --- a/src/gz/gz_file.c +++ b/src/gz/gz_file.c @@ -22,6 +22,8 @@ #define LANGS "japanese\0""english\0" #elif Z64_VERSION == Z64_OOTIQC #define LANGS "japanese\0""chinese\0" +#elif Z64_VERSION == Z64_OOTGCPAL +#define LANGS "english\0""french\0""german\0" #endif static int byte_mod_proc(struct menu_item *item, diff --git a/src/gz/ldr.S b/src/gz/ldr.S index bdc18d8d..de62fcc9 100644 --- a/src/gz/ldr.S +++ b/src/gz/ldr.S @@ -11,7 +11,8 @@ Z64_VERSION == Z64_OOTMQU || \ Z64_VERSION == Z64_OOTGCJ || \ Z64_VERSION == Z64_OOTGCU || \ - Z64_VERSION == Z64_OOTCEJ + Z64_VERSION == Z64_OOTCEJ || \ + Z64_VERSION == Z64_OOTGCPAL .equ entry_size, 0x60 #elif Z64_VERSION == Z64_OOTIQC .equ entry_size, 0x50 diff --git a/src/gz/z64_version.h b/src/gz/z64_version.h index 51c3d000..fd4e73c7 100644 --- a/src/gz/z64_version.h +++ b/src/gz/z64_version.h @@ -14,5 +14,6 @@ #define Z64_OOTGCU 0x06 #define Z64_OOTCEJ 0x07 #define Z64_OOTIQC 0x08 +#define Z64_OOTGCPAL 0x09 #endif From b83200d13ce5f4605ce183c91155e725e6aba24a Mon Sep 17 00:00:00 2001 From: Noah Philips Date: Thu, 18 Dec 2025 11:42:08 -0500 Subject: [PATCH 07/13] adding back other versions to gz_versions in makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3efa5d6c..60e41374 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ ALL_LDFLAGS = -T $(LDSCRIPT) -L$(LIBDIR) -nostartfiles -specs=nosys.sp ALL_LDLIBS = $(LDLIBS) LUAFILE = $(EMUDIR)/Lua/patch-data.lua RESDESC = $(RESDIR)/resources.json -GZ_VERSIONS = oot-gc-pal oot-gc-pal-vc +GZ_VERSIONS = oot-1.0 oot-1.1 oot-1.2 oot-mq-j oot-mq-u oot-gc-j oot-gc-u oot-ce-j oot-ique-cn oot-1.0-vc oot-1.1-vc oot-1.2-vc oot-mq-j-vc oot-mq-u-vc oot-gc-j-vc oot-gc-u-vc oot-ce-j-vc oot-gc-pal oot-gc-pal-vc GZ_ADDRESS = 80400000 SRCDIR = src RESDIR = res From 318b60fe6ad8e6b9b110000dd5d3950ebb1e8442 Mon Sep 17 00:00:00 2001 From: Noah Philips Date: Thu, 18 Dec 2025 11:46:25 -0500 Subject: [PATCH 08/13] reverting hooks.lua debug print changes --- lua/hooks.lua | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/lua/hooks.lua b/lua/hooks.lua index f37eb52c..7abc6140 100644 --- a/lua/hooks.lua +++ b/lua/hooks.lua @@ -86,6 +86,7 @@ for ovl_type, ovl_tbl in pairs(ovl_tbls) do local layout = ovl_tbl_layout[ovl_type] local p = (ovl_tbl.addr - code_vram) & 0x1FFFFFFF + local tbl_stride = ovl_tbl.stride or layout.stride local tbl_vrom_start = ovl_tbl.vrom_start or layout.vrom_start local tbl_vrom_end = ovl_tbl.vrom_end or layout.vrom_end @@ -129,19 +130,14 @@ for _, gsc in ipairs(gsc_list) do addr = addr - (obj.vram_start & 0x00FFFFFF) local file_idx = fs:vat(obj.vrom_start) + local file_gsc = file_gsc_map[file_idx] - if file_idx == nil then - print(obj.vrom_start) - else - local file_gsc = file_gsc_map[file_idx] - - if file_gsc == nil then - file_gsc = gru.gsc_create() - file_gsc_map[file_idx] = file_gsc - end - - file_gsc:insert(file_gsc:size(), addr, value) + if file_gsc == nil then + file_gsc = gru.gsc_create() + file_gsc_map[file_idx] = file_gsc end + + file_gsc:insert(file_gsc:size(), addr, value) end end @@ -158,4 +154,4 @@ end for file_idx, file in pairs(files) do fs:replace(file_idx, file, fs:compressed(file_idx)) -end +end \ No newline at end of file From 78e8002cb4d92a68bdc6b4dae9e2109fdb027edd Mon Sep 17 00:00:00 2001 From: Noah Philips Date: Thu, 18 Dec 2025 11:46:50 -0500 Subject: [PATCH 09/13] Reverting hooks.lua changes --- lua/hooks.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/hooks.lua b/lua/hooks.lua index 7abc6140..a7c78c31 100644 --- a/lua/hooks.lua +++ b/lua/hooks.lua @@ -154,4 +154,4 @@ end for file_idx, file in pairs(files) do fs:replace(file_idx, file, fs:compressed(file_idx)) -end \ No newline at end of file +end From 89f144533a46279e44957bc60d8abc10d776dfd4 Mon Sep 17 00:00:00 2001 From: Noah Philips Date: Thu, 18 Dec 2025 11:58:24 -0500 Subject: [PATCH 10/13] Renaming gc-pal to gc-eu --- Makefile | 18 +++++++++--------- gsc/{oot-gc-pal => oot-gc-eu}/mem_patch.gsc | 0 .../ups_size_patch.gsc | 0 lib/{liboot-gc-pal.a => liboot-gc-eu.a} | 0 lua/rom_table.lua | 6 +++--- src/gz/gz_file.c | 2 +- src/gz/input.c | 2 +- src/gz/ldr.S | 2 +- src/gz/settings.h | 2 +- src/gz/state.c | 10 +++++----- src/gz/z64.h | 6 +++--- src/gz/z64_version.h | 2 +- 12 files changed, 25 insertions(+), 25 deletions(-) rename gsc/{oot-gc-pal => oot-gc-eu}/mem_patch.gsc (100%) rename gsc/{oot-gc-pal => oot-gc-eu}/ups_size_patch.gsc (100%) rename lib/{liboot-gc-pal.a => liboot-gc-eu.a} (100%) diff --git a/Makefile b/Makefile index 60e41374..b896d595 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ ALL_LDFLAGS = -T $(LDSCRIPT) -L$(LIBDIR) -nostartfiles -specs=nosys.sp ALL_LDLIBS = $(LDLIBS) LUAFILE = $(EMUDIR)/Lua/patch-data.lua RESDESC = $(RESDIR)/resources.json -GZ_VERSIONS = oot-1.0 oot-1.1 oot-1.2 oot-mq-j oot-mq-u oot-gc-j oot-gc-u oot-ce-j oot-ique-cn oot-1.0-vc oot-1.1-vc oot-1.2-vc oot-mq-j-vc oot-mq-u-vc oot-gc-j-vc oot-gc-u-vc oot-ce-j-vc oot-gc-pal oot-gc-pal-vc +GZ_VERSIONS = oot-1.0 oot-1.1 oot-1.2 oot-mq-j oot-mq-u oot-gc-j oot-gc-u oot-ce-j oot-ique-cn oot-1.0-vc oot-1.1-vc oot-1.2-vc oot-mq-j-vc oot-mq-u-vc oot-gc-j-vc oot-gc-u-vc oot-ce-j-vc oot-gc-eu oot-gc-eu-vc GZ_ADDRESS = 80400000 SRCDIR = src RESDIR = res @@ -49,7 +49,7 @@ OBJ-OOT-GC-J = $(OBJ-gz-oot-gc-j) $(OBJ-gz-oot-gc-j-vc) OBJ-OOT-GC-U = $(OBJ-gz-oot-gc-u) $(OBJ-gz-oot-gc-u-vc) OBJ-OOT-CE-J = $(OBJ-gz-oot-ce-j) $(OBJ-gz-oot-ce-j-vc) OBJ-OOT-IQUE-CN = $(OBJ-gz-oot-ique-cn) -OBJ-OOT-GC-PAL = $(OBJ-gz-oot-gc-pal) $(OBJ-gz-oot-gc-pal-vc) +OBJ-OOT-GC-EU = $(OBJ-gz-oot-gc-eu) $(OBJ-gz-oot-gc-eu-vc) ELF-OOT-1.0 = $(ELF-gz-oot-1.0) $(ELF-gz-oot-1.0-vc) ELF-OOT-1.1 = $(ELF-gz-oot-1.1) $(ELF-gz-oot-1.1-vc) ELF-OOT-1.2 = $(ELF-gz-oot-1.2) $(ELF-gz-oot-1.2-vc) @@ -58,12 +58,12 @@ ELF-OOT-MQ-U = $(ELF-gz-oot-mq-u) $(ELF-gz-oot-mq-u-vc) ELF-OOT-GC-J = $(ELF-gz-oot-gc-j) $(ELF-gz-oot-gc-j-vc) ELF-OOT-GC-U = $(ELF-gz-oot-gc-u) $(ELF-gz-oot-gc-u-vc) ELF-OOT-CE-J = $(ELF-gz-oot-ce-j) $(ELF-gz-oot-ce-j-vc) -ELF-OOT-GC-PAL = $(ELF-gz-oot-gc-pal) $(ELF-gz-oot-gc-pal-vc) +ELF-OOT-GC-EU = $(ELF-gz-oot-gc-eu) $(ELF-gz-oot-gc-eu-vc) ELF-OOT-IQUE-CN = $(ELF-gz-oot-ique-cn) -OBJ-N64 = $(OBJ-gz-oot-1.0) $(OBJ-gz-oot-1.1) $(OBJ-gz-oot-1.2) $(OBJ-gz-oot-mq-j) $(OBJ-gz-oot-mq-u) $(OBJ-gz-oot-gc-j) $(OBJ-gz-oot-gc-u) $(OBJ-gz-oot-ce-j) $(OBJ-gz-oot-gc-pal) -OBJ-VC = $(OBJ-gz-oot-1.0-vc) $(OBJ-gz-oot-1.1-vc) $(OBJ-gz-oot-1.2-vc) $(OBJ-gz-oot-mq-j-vc) $(OBJ-gz-oot-mq-u-vc) $(OBJ-gz-oot-gc-j-vc) $(OBJ-gz-oot-gc-u-vc) $(OBJ-gz-oot-ce-j-vc) $(OBJ-gz-oot-gc-pal-vc) -ELF-N64 = $(ELF-gz-oot-1.0) $(ELF-gz-oot-1.1) $(ELF-gz-oot-1.2) $(ELF-gz-oot-mq-j) $(ELF-gz-oot-mq-u) $(ELF-gz-oot-gc-j) $(ELF-gz-oot-gc-u) $(ELF-gz-oot-ce-j) $(ELF-gz-oot-gc-pal) -ELF-VC = $(ELF-gz-oot-1.0-vc) $(ELF-gz-oot-1.1-vc) $(ELF-gz-oot-1.2-vc) $(ELF-gz-oot-mq-j-vc) $(ELF-gz-oot-mq-u-vc) $(ELF-gz-oot-gc-j-vc) $(ELF-gz-oot-gc-u-vc) $(ELF-gz-oot-ce-j-vc) $(ELF-gz-oot-gc-pal-vc) +OBJ-N64 = $(OBJ-gz-oot-1.0) $(OBJ-gz-oot-1.1) $(OBJ-gz-oot-1.2) $(OBJ-gz-oot-mq-j) $(OBJ-gz-oot-mq-u) $(OBJ-gz-oot-gc-j) $(OBJ-gz-oot-gc-u) $(OBJ-gz-oot-ce-j) $(OBJ-gz-oot-gc-eu) +OBJ-VC = $(OBJ-gz-oot-1.0-vc) $(OBJ-gz-oot-1.1-vc) $(OBJ-gz-oot-1.2-vc) $(OBJ-gz-oot-mq-j-vc) $(OBJ-gz-oot-mq-u-vc) $(OBJ-gz-oot-gc-j-vc) $(OBJ-gz-oot-gc-u-vc) $(OBJ-gz-oot-ce-j-vc) $(OBJ-gz-oot-gc-eu-vc) +ELF-N64 = $(ELF-gz-oot-1.0) $(ELF-gz-oot-1.1) $(ELF-gz-oot-1.2) $(ELF-gz-oot-mq-j) $(ELF-gz-oot-mq-u) $(ELF-gz-oot-gc-j) $(ELF-gz-oot-gc-u) $(ELF-gz-oot-ce-j) $(ELF-gz-oot-gc-eu) +ELF-VC = $(ELF-gz-oot-1.0-vc) $(ELF-gz-oot-1.1-vc) $(ELF-gz-oot-1.2-vc) $(ELF-gz-oot-mq-j-vc) $(ELF-gz-oot-mq-u-vc) $(ELF-gz-oot-gc-j-vc) $(ELF-gz-oot-gc-u-vc) $(ELF-gz-oot-ce-j-vc) $(ELF-gz-oot-gc-eu-vc) GZ = $(foreach v,$(GZ_VERSIONS),gz-$(v)) HOOKS = $(foreach v,$(GZ_VERSIONS),gz-$(v)-hooks) @@ -168,7 +168,7 @@ $(OBJ-OOT-GC-J) : ALL_CPPFLAGS += -DZ64_VERSION=Z64_OOTGCJ $(OBJ-OOT-GC-U) : ALL_CPPFLAGS += -DZ64_VERSION=Z64_OOTGCU $(OBJ-OOT-CE-J) : ALL_CPPFLAGS += -DZ64_VERSION=Z64_OOTCEJ $(OBJ-OOT-IQUE-CN) : ALL_CPPFLAGS += -DZ64_VERSION=Z64_OOTIQC -$(OBJ-OOT-GC-PAL) : ALL_CPPFLAGS += -DZ64_VERSION=Z64_OOTGCPAL +$(OBJ-OOT-GC-EU) : ALL_CPPFLAGS += -DZ64_VERSION=Z64_OOTGCEU $(ELF-OOT-1.0) : ALL_LDLIBS += -loot-1.0 $(ELF-OOT-1.1) : ALL_LDLIBS += -loot-1.1 $(ELF-OOT-1.2) : ALL_LDLIBS += -loot-1.2 @@ -178,7 +178,7 @@ $(ELF-OOT-GC-J) : ALL_LDLIBS += -loot-gc-j $(ELF-OOT-GC-U) : ALL_LDLIBS += -loot-gc-u $(ELF-OOT-CE-J) : ALL_LDLIBS += -loot-ce-j $(ELF-OOT-IQUE-CN) : ALL_LDLIBS += -loot-ique-cn -$(ELF-OOT-GC-PAL) : ALL_LDLIBS += -loot-gc-pal +$(ELF-OOT-GC-EU) : ALL_LDLIBS += -loot-gc-eu ifeq '$(shell $(CC) -dumpmachine 2>/dev/null)' 'mips64-ultra-elf' $(OBJ-VC) : ALL_CFLAGS += -n64-wiivc $(OBJ-VC) : ALL_CXXFLAGS += -n64-wiivc diff --git a/gsc/oot-gc-pal/mem_patch.gsc b/gsc/oot-gc-eu/mem_patch.gsc similarity index 100% rename from gsc/oot-gc-pal/mem_patch.gsc rename to gsc/oot-gc-eu/mem_patch.gsc diff --git a/gsc/oot-gc-pal/ups_size_patch.gsc b/gsc/oot-gc-eu/ups_size_patch.gsc similarity index 100% rename from gsc/oot-gc-pal/ups_size_patch.gsc rename to gsc/oot-gc-eu/ups_size_patch.gsc diff --git a/lib/liboot-gc-pal.a b/lib/liboot-gc-eu.a similarity index 100% rename from lib/liboot-gc-pal.a rename to lib/liboot-gc-eu.a diff --git a/lua/rom_table.lua b/lua/rom_table.lua index 237b0c15..1af88e1f 100644 --- a/lua/rom_table.lua +++ b/lua/rom_table.lua @@ -249,9 +249,9 @@ rom_table = map_mark = { addr = 0x800EEA68 }, play = { addr = 0x800FB300 }, }, - data_dir = "oot-gc-pal", - gz_version = "oot-gc-pal" .. version_suffix, - gz_name = "gz-oot-gc-pal" .. version_suffix, + data_dir = "oot-gc-eu", + gz_version = "oot-gc-eu" .. version_suffix, + gz_name = "gz-oot-gc-eu" .. version_suffix, patches = { "mem_patch", "ups_size_patch" }, title_id = "NGPL", }, diff --git a/src/gz/gz_file.c b/src/gz/gz_file.c index 7704c2f6..a056b1f2 100644 --- a/src/gz/gz_file.c +++ b/src/gz/gz_file.c @@ -22,7 +22,7 @@ #define LANGS "japanese\0""english\0" #elif Z64_VERSION == Z64_OOTIQC #define LANGS "japanese\0""chinese\0" -#elif Z64_VERSION == Z64_OOTGCPAL +#elif Z64_VERSION == Z64_OOTGCEU #define LANGS "english\0""french\0""german\0" #endif diff --git a/src/gz/input.c b/src/gz/input.c index 83cd2ff8..3b7f5a63 100644 --- a/src/gz/input.c +++ b/src/gz/input.c @@ -90,7 +90,7 @@ const uint32_t input_button_color[] = Z64_VERSION == Z64_OOTGCJ || \ Z64_VERSION == Z64_OOTGCU || \ Z64_VERSION == Z64_OOTCEJ || \ - Z64_VERSION == Z64_OOTGCPAL + Z64_VERSION == Z64_OOTGCEU 0x787878, 0xC0C0C0, 0xFF1E1E, diff --git a/src/gz/ldr.S b/src/gz/ldr.S index de62fcc9..ed20ccbd 100644 --- a/src/gz/ldr.S +++ b/src/gz/ldr.S @@ -12,7 +12,7 @@ Z64_VERSION == Z64_OOTGCJ || \ Z64_VERSION == Z64_OOTGCU || \ Z64_VERSION == Z64_OOTCEJ || \ - Z64_VERSION == Z64_OOTGCPAL + Z64_VERSION == Z64_OOTGCEU .equ entry_size, 0x60 #elif Z64_VERSION == Z64_OOTIQC .equ entry_size, 0x50 diff --git a/src/gz/settings.h b/src/gz/settings.h index 194b52d1..be714111 100644 --- a/src/gz/settings.h +++ b/src/gz/settings.h @@ -16,7 +16,7 @@ #define SETTINGS_TELEPORT_MAX 9 #define SETTINGS_STATE_MAX 3 #define SETTINGS_BIND_MAX COMMAND_MAX -#define SETTINGS_LOG_MAX 4 +#define SETTINGS_LOG_MAX 10 #define SETTINGS_LAG_FRAMES 0 #define SETTINGS_LAG_SECONDS 1 diff --git a/src/gz/state.c b/src/gz/state.c index 35bb4229..da676f38 100644 --- a/src/gz/state.c +++ b/src/gz/state.c @@ -74,7 +74,7 @@ static void save_ovl(void **p, void *addr, Z64_VERSION == Z64_OOTGCJ || \ Z64_VERSION == Z64_OOTGCU || \ Z64_VERSION == Z64_OOTCEJ || \ - Z64_VERSION == Z64_OOTGCPAL || \ + Z64_VERSION == Z64_OOTGCEU || \ Z64_VERSION == Z64_OOTIQC z64_ovl_hdr_t l_hdr; hdr = &l_hdr; @@ -166,7 +166,7 @@ static void load_ovl(void **p, void **p_addr, Z64_VERSION == Z64_OOTGCJ || \ Z64_VERSION == Z64_OOTGCU || \ Z64_VERSION == Z64_OOTCEJ || \ - Z64_VERSION == Z64_OOTGCPAL || \ + Z64_VERSION == Z64_OOTGCEU || \ Z64_VERSION == Z64_OOTIQC z64_ovl_hdr_t l_hdr; hdr = &l_hdr; @@ -1284,7 +1284,7 @@ uint32_t save_state(struct state_meta *state) Z64_VERSION == Z64_OOTGCJ || \ Z64_VERSION == Z64_OOTGCU || \ Z64_VERSION == Z64_OOTCEJ || \ - Z64_VERSION == Z64_OOTGCPAL || \ + Z64_VERSION == Z64_OOTGCEU || \ Z64_VERSION == Z64_OOTIQC serial_write(&p, &code_800EC960_c_data[0x0998], 0x0060); /* 12b overhead */ serial_write(&p, &code_800EC960_c_data[0x0A00], 0x0008); @@ -1760,7 +1760,7 @@ void load_state(const struct state_meta *state) zu_getfile(vaddr, z64_game.pause_ctxt.name_texture, 0x0400); } } - #if Z64_VERSION == Z64_OOTGCPAL + #if Z64_VERSION == Z64_OOTGCEU zu_getfile_idx(z64_icon_item_nes_static, z64_game.pause_ctxt.icon_item_lang); #else @@ -2277,7 +2277,7 @@ void load_state(const struct state_meta *state) Z64_VERSION == Z64_OOTGCJ || \ Z64_VERSION == Z64_OOTGCU || \ Z64_VERSION == Z64_OOTCEJ || \ - Z64_VERSION == Z64_OOTGCPAL || \ + Z64_VERSION == Z64_OOTGCEU || \ Z64_VERSION == Z64_OOTIQC serial_read(&p, &code_800EC960_c_data[0x0998], 0x0060); /* 12b overhead */ serial_read(&p, &code_800EC960_c_data[0x0A00], 0x0008); diff --git a/src/gz/z64.h b/src/gz/z64.h index acc83d36..f99607c4 100644 --- a/src/gz/z64.h +++ b/src/gz/z64.h @@ -57,7 +57,7 @@ struct z64_arena Z64_VERSION == Z64_OOTGCJ || \ Z64_VERSION == Z64_OOTGCU || \ Z64_VERSION == Z64_OOTCEJ || \ - Z64_VERSION == Z64_OOTGCPAL || \ + Z64_VERSION == Z64_OOTGCEU || \ Z64_VERSION == Z64_OOTIQC /* 0x0008 */ #endif @@ -86,7 +86,7 @@ struct z64_arena_node Z64_VERSION == Z64_OOTGCJ || \ Z64_VERSION == Z64_OOTGCU || \ Z64_VERSION == Z64_OOTCEJ || \ - Z64_VERSION == Z64_OOTGCPAL || \ + Z64_VERSION == Z64_OOTGCEU || \ Z64_VERSION == Z64_OOTIQC char data[]; /* 0x0010 */ #endif @@ -2193,7 +2193,7 @@ typedef struct # define z64_vr_TTVR_pal_static 1001 # define z64_vr_FCVR_static 1002 # define z64_vr_FCVR_pal_static 1003 -#elif Z64_VERSION == Z64_OOTGCPAL +#elif Z64_VERSION == Z64_OOTGCEU # define z64_icon_item_static 7 # define z64_icon_item_24_static 8 # define z64_icon_item_field_static 9 diff --git a/src/gz/z64_version.h b/src/gz/z64_version.h index fd4e73c7..be043221 100644 --- a/src/gz/z64_version.h +++ b/src/gz/z64_version.h @@ -14,6 +14,6 @@ #define Z64_OOTGCU 0x06 #define Z64_OOTCEJ 0x07 #define Z64_OOTIQC 0x08 -#define Z64_OOTGCPAL 0x09 +#define Z64_OOTGCEU 0x09 #endif From f17c3533f7a105e6d8a056b6db4bbb43ec66d836 Mon Sep 17 00:00:00 2001 From: Noah Philips Date: Thu, 18 Dec 2025 12:02:51 -0500 Subject: [PATCH 11/13] Reverting settings change for srand debugging --- src/gz/settings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gz/settings.h b/src/gz/settings.h index be714111..194b52d1 100644 --- a/src/gz/settings.h +++ b/src/gz/settings.h @@ -16,7 +16,7 @@ #define SETTINGS_TELEPORT_MAX 9 #define SETTINGS_STATE_MAX 3 #define SETTINGS_BIND_MAX COMMAND_MAX -#define SETTINGS_LOG_MAX 10 +#define SETTINGS_LOG_MAX 4 #define SETTINGS_LAG_FRAMES 0 #define SETTINGS_LAG_SECONDS 1 From 138cff6b149f8c68d44c2f763782d3b0decef39e Mon Sep 17 00:00:00 2001 From: Noah Philips Date: Thu, 18 Dec 2025 12:06:44 -0500 Subject: [PATCH 12/13] Tweaking makefile changes after merge of master --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index b896d595..7cd24ec5 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ ALL_LDFLAGS = -T $(LDSCRIPT) -L$(LIBDIR) -nostartfiles -specs=nosys.sp ALL_LDLIBS = $(LDLIBS) LUAFILE = $(EMUDIR)/Lua/patch-data.lua RESDESC = $(RESDIR)/resources.json -GZ_VERSIONS = oot-1.0 oot-1.1 oot-1.2 oot-mq-j oot-mq-u oot-gc-j oot-gc-u oot-ce-j oot-ique-cn oot-1.0-vc oot-1.1-vc oot-1.2-vc oot-mq-j-vc oot-mq-u-vc oot-gc-j-vc oot-gc-u-vc oot-ce-j-vc oot-gc-eu oot-gc-eu-vc +GZ_VERSIONS = oot-gc-eu oot-gc-eu-vc GZ_ADDRESS = 80400000 SRCDIR = src RESDIR = res @@ -60,9 +60,9 @@ ELF-OOT-GC-U = $(ELF-gz-oot-gc-u) $(ELF-gz-oot-gc-u-vc) ELF-OOT-CE-J = $(ELF-gz-oot-ce-j) $(ELF-gz-oot-ce-j-vc) ELF-OOT-GC-EU = $(ELF-gz-oot-gc-eu) $(ELF-gz-oot-gc-eu-vc) ELF-OOT-IQUE-CN = $(ELF-gz-oot-ique-cn) -OBJ-N64 = $(OBJ-gz-oot-1.0) $(OBJ-gz-oot-1.1) $(OBJ-gz-oot-1.2) $(OBJ-gz-oot-mq-j) $(OBJ-gz-oot-mq-u) $(OBJ-gz-oot-gc-j) $(OBJ-gz-oot-gc-u) $(OBJ-gz-oot-ce-j) $(OBJ-gz-oot-gc-eu) +OBJ-N64 = $(OBJ-gz-oot-1.0) $(OBJ-gz-oot-1.1) $(OBJ-gz-oot-1.2) $(OBJ-gz-oot-mq-j) $(OBJ-gz-oot-mq-u) $(OBJ-gz-oot-gc-j) $(OBJ-gz-oot-gc-u) $(OBJ-gz-oot-ce-j) $(OBJ-gz-oot-ique-cn) $(OBJ-gz-oot-gc-eu) OBJ-VC = $(OBJ-gz-oot-1.0-vc) $(OBJ-gz-oot-1.1-vc) $(OBJ-gz-oot-1.2-vc) $(OBJ-gz-oot-mq-j-vc) $(OBJ-gz-oot-mq-u-vc) $(OBJ-gz-oot-gc-j-vc) $(OBJ-gz-oot-gc-u-vc) $(OBJ-gz-oot-ce-j-vc) $(OBJ-gz-oot-gc-eu-vc) -ELF-N64 = $(ELF-gz-oot-1.0) $(ELF-gz-oot-1.1) $(ELF-gz-oot-1.2) $(ELF-gz-oot-mq-j) $(ELF-gz-oot-mq-u) $(ELF-gz-oot-gc-j) $(ELF-gz-oot-gc-u) $(ELF-gz-oot-ce-j) $(ELF-gz-oot-gc-eu) +ELF-N64 = $(ELF-gz-oot-1.0) $(ELF-gz-oot-1.1) $(ELF-gz-oot-1.2) $(ELF-gz-oot-mq-j) $(ELF-gz-oot-mq-u) $(ELF-gz-oot-gc-j) $(ELF-gz-oot-gc-u) $(ELF-gz-oot-ce-j) $(ELF-gz-oot-ique-cn) $(ELF-gz-oot-gc-eu) ELF-VC = $(ELF-gz-oot-1.0-vc) $(ELF-gz-oot-1.1-vc) $(ELF-gz-oot-1.2-vc) $(ELF-gz-oot-mq-j-vc) $(ELF-gz-oot-mq-u-vc) $(ELF-gz-oot-gc-j-vc) $(ELF-gz-oot-gc-u-vc) $(ELF-gz-oot-ce-j-vc) $(ELF-gz-oot-gc-eu-vc) GZ = $(foreach v,$(GZ_VERSIONS),gz-$(v)) @@ -179,7 +179,7 @@ $(ELF-OOT-GC-U) : ALL_LDLIBS += -loot-gc-u $(ELF-OOT-CE-J) : ALL_LDLIBS += -loot-ce-j $(ELF-OOT-IQUE-CN) : ALL_LDLIBS += -loot-ique-cn $(ELF-OOT-GC-EU) : ALL_LDLIBS += -loot-gc-eu -ifeq '$(shell $(CC) -dumpmachine 2>/dev/null)' 'mips64-ultra-elf' +ifeq '$(target)' 'mips64-ultra-elf' $(OBJ-VC) : ALL_CFLAGS += -n64-wiivc $(OBJ-VC) : ALL_CXXFLAGS += -n64-wiivc $(ELF-VC) : ALL_LDFLAGS += -n64-wiivc From 177aada6a3919f5cf223b11c708101482f719df8 Mon Sep 17 00:00:00 2001 From: Noah Philips Date: Thu, 18 Dec 2025 12:08:50 -0500 Subject: [PATCH 13/13] Changing region to eu in rom table --- lua/rom_table.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/rom_table.lua b/lua/rom_table.lua index 1af88e1f..a59c1353 100644 --- a/lua/rom_table.lua +++ b/lua/rom_table.lua @@ -237,7 +237,7 @@ rom_table = [0x3FBD519F] = { game = "oot", version = "gc", - region = "pal", + region = "eu", boot_ind = 1, boot_ram = 0x80000460, code_ind = 28,