diff --git a/src/sm_82.c b/src/sm_82.c index d816636..4c376f0 100644 --- a/src/sm_82.c +++ b/src/sm_82.c @@ -2592,7 +2592,7 @@ void EquipmentScreenGlowingArrow(void) { if ((uint8)pausemenu_equipment_category_item) EquipmentScreenGlowingArrowSolidOff(); else - kEquipmentScreenGlowingArrowFuncs[0](); + kEquipmentScreenGlowingArrowFuncs[HIBYTE(pausemenu_equipment_category_item)](); } static const uint16 kEquipmentScreenGlowingArrowPalettes0[32] = { 0x39e, 0x77d, 0xb5c, 0xf5b, 0x133a, 0x171a, 0x1f19, 0x22f8, 0x26d7, 0x2ad6, 0x2eb6, 0x3695, 0x3a94, 0x3e73, 0x4253, 0x4a52, 0x4a52, 0x4253, 0x3e73, 0x3a94, 0x3695, 0x2eb6, 0x2ad6, 0x26d7, 0x22f8, 0x1f19, 0x171a, 0x133a, 0xf5b, 0xb5c, 0x77d, 0x39e }; @@ -2624,44 +2624,19 @@ void EquipmentScreenGlowingArrowSolidOff(void) { // 0x82ADEF } void EquipmentScreenEnergyArrowGlow_On(void) { // 0x82AE01 - int16 v0; - int16 v2; - - v0 = 16; - uint16 v1 = 0; - do { - ram3800.cinematic_bg_tilemap[v1 + 129] = ram3800.cinematic_bg_tilemap[v1 + 129] & 0xE3FF | 0x1800; - v1 += 32; - v0 -= 2; - } while (v0); - v2 = 4; - uint16 v3 = 0; - do { - ram3800.cinematic_bg_tilemap[v3 + 385] = ram3800.cinematic_bg_tilemap[v3 + 385] & 0xE3FF | 0x1800; - ++v3; - v2 -= 2; - } while (v2); + for (int i = 0; i < 8; i++) + ram3800.equipment_screen_bg1_tilemap[129 + i * 32] = ram3800.equipment_screen_bg1_tilemap[129 + i * 32] & ~0x1C00 | 0x1800; + for(int i = 0; i < 2; i++) + ram3800.equipment_screen_bg1_tilemap[385 + i] = ram3800.equipment_screen_bg1_tilemap[385 + i] & ~0x1C00 | 0x1800; } void EquipmentScreenEnergyArrowGlow_Off(void) { // 0x82AE46 - int16 v0; - int16 v2; - - v0 = 16; - uint16 v1 = 0; - do { - ram3800.cinematic_bg_tilemap[v1 + 129] = ram3800.cinematic_bg_tilemap[v1 + 129] & 0xE3FF | 0x1C00; - v1 += 32; - v0 -= 2; - } while (v0); - v2 = 4; - uint16 v3 = 0; - do { - ram3800.cinematic_bg_tilemap[v3 + 385] = ram3800.cinematic_bg_tilemap[v3 + 385] & 0xE3FF | 0x1C00; - ++v3; - v2 -= 2; - } while (v2); + for(int i = 0; i < 8; i++) + ram3800.equipment_screen_bg1_tilemap[129 + i * 32] = ram3800.equipment_screen_bg1_tilemap[129 + i * 32] & ~0x1C00 | 0x1C00; + for (int i = 0; i < 2; i++) + ram3800.equipment_screen_bg1_tilemap[385 + i] = ram3800.equipment_screen_bg1_tilemap[385 + i] & ~0x1C00 | 0x1C00; } + static const uint16 kEquipmentScreenTilemap_MODE_MANUAL[7] = { 0x2519, 0x251a, 0x251b, 0x3d46, 0x3d47, 0x3d48, 0x3d49 }; static const uint16 kEquipmentScreenTilemap_RESERVE_TANK[7] = { 0x3c80, 0x3c81, 0x3c82, 0x3c83, 0x3c84, 0x3c85, 0x3c86 }; static const uint16 kEquipmentScreenTilemap_MANUAL[4] = { 0x3d46, 0x3d47, 0x3d48, 0x3d49 }; diff --git a/src/sm_91.c b/src/sm_91.c index d7253b6..8dbda9b 100644 --- a/src/sm_91.c +++ b/src/sm_91.c @@ -2596,8 +2596,8 @@ uint8 HandleVisorPalette(void) { // 0x91D83F if ((uint8)v1) return 0; samus_visor_palette_timer_index = v1 | 5; - palette_buffer[196] = word_9BA3C0[(uint16)((uint16)(v1 | 5) >> 8) >> 1]; - v2 = ((uint16)(v1 | 5) >> 8) + 2; + palette_buffer[196] = word_9BA3C0[HIBYTE(v1) >> 1]; + v2 = HIBYTE(v1) + 2; if (sign16(v2 - 12)) { v4 = v2; LOBYTE(v3) = HIBYTE(v2); diff --git a/src/snes/cpu.c b/src/snes/cpu.c index cfd5ffd..e6ad932 100644 --- a/src/snes/cpu.c +++ b/src/snes/cpu.c @@ -724,14 +724,11 @@ int CpuOpcodeHook(uint32_t addr); uint32_t pc_hist[8], pc_hist_ctr; -uint32_t pc_bp = 0x828A55; +uint32_t pc_bp = 0; static void cpu_doOpcode(Cpu* cpu, uint8_t opcode) { - pc_hist[pc_hist_ctr] = cpu->k << 16 | cpu->pc; - pc_hist_ctr = (pc_hist_ctr + 1) & 7; - if (cpu->pc == 0x910b) { - opcode += 0; - } +// pc_hist[pc_hist_ctr] = cpu->k << 16 | cpu->pc; +// pc_hist_ctr = (pc_hist_ctr + 1) & 7; if (((cpu->k << 16) | cpu->pc - 1) == pc_bp) { opcode += 0; }