diff --git a/build/utils/SSB64ImageFileAppender.class b/build/utils/SSB64ImageFileAppender.class index 06ae8373..e87493c6 100644 Binary files a/build/utils/SSB64ImageFileAppender.class and b/build/utils/SSB64ImageFileAppender.class differ diff --git a/build/utils/SSB64ImageFileAppender.jar b/build/utils/SSB64ImageFileAppender.jar index 360a59a2..07c854c2 100644 Binary files a/build/utils/SSB64ImageFileAppender.jar and b/build/utils/SSB64ImageFileAppender.jar differ diff --git a/build/utils/SSB64ImageFileAppender.java b/build/utils/SSB64ImageFileAppender.java index 044fcce9..3a8c8d3d 100644 --- a/build/utils/SSB64ImageFileAppender.java +++ b/build/utils/SSB64ImageFileAppender.java @@ -21,12 +21,12 @@ public void run(String ssb64file, String filename) { try { // init BufferedImage this.bi = ImageIO.read(new File(filename)); - + } catch (IOException e) { // close when file is not present System.out.println("File not found!"); System.exit(0); - + } catch (Exception e) { // generic error catch System.out.println("Unknown error occured!"); @@ -78,8 +78,8 @@ public byte[] rgba5551(int[] rgbArray) { red = (getRed(argb8888) & 0xF8) >> 3; green = (getGreen(argb8888) & 0xF8) >> 3; blue = (getBlue(argb8888) & 0xF8) >> 3; - - // check for transparency + + // check for transparency alpha = getAlpha(argb8888); if (alpha > 0) { alpha = 1; @@ -88,14 +88,14 @@ public byte[] rgba5551(int[] rgbArray) { } // bit manipulation - // have + // have // 000rrrrr // 000ggggg // 000bbbbb // 0000000a - // need + // need // rrrrrggg - // ggbbbbba + // ggbbbbba colorHigh = 0; colorHigh |= red << 3; colorHigh |= (green & 0x1D) >> 2; @@ -126,15 +126,15 @@ public void appendStageIcon(int[] rgbArray) { byte outArray[] = new byte[0]; byte dataArray[] = rgba5551(rgbArray); - + try { currentFile = Files.readAllBytes(Paths.get("./0A04.bin")); currentLength = currentFile.length; - + // next pointer currentFile[currentLength - 0x14] = (byte) (((currentLength + dataArray.length + 0x10) / 4) >> 8); currentFile[currentLength - 0x13] = (byte) (((currentLength + dataArray.length + 0x10) / 4)); - + outArray = new byte[dataArray.length + currentLength + 0x60]; System.arraycopy(currentFile, 0, outArray, 0, currentLength); } catch (IOException ex) { @@ -152,132 +152,132 @@ public void appendStageIcon(int[] rgbArray) { outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + data1 = j / 4; - + System.arraycopy(dataArray, 0, outArray, j, dataArray.length); j += dataArray.length; - + data2 = j / 4; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x28; // width outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x28; // width - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - - + + pointer1 = (j + 60) / 4; outArray[j++] = (byte) (pointer1 >> 8); // pointer 1 outArray[j++] = (byte) pointer1; // pointer 1 outArray[j++] = (byte) (data1 >> 8); // data 1 outArray[j++] = (byte) data1; // data 1 - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x1E; // height outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x28; // width outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x1E; // height - - + + // x scale outArray[j++] = (byte) 0x3F; outArray[j++] = (byte) 0x80; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + // y scale outArray[j++] = (byte) 0x3F; outArray[j++] = (byte) 0x80; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0x02; outArray[j++] = (byte) 0x20; outArray[j++] = (byte) 0x12; outArray[j++] = (byte) 0x34; - + // color outArray[j++] = (byte) 0xFF; outArray[j++] = (byte) 0xFF; outArray[j++] = (byte) 0xFF; outArray[j++] = (byte) 0xFF; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x01; // ? - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x01; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x24; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x1E; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x1E; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x02; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0xFF; outArray[j++] = (byte) 0xFF; outArray[j++] = (byte) (data2 >> 8); // data 2 outArray[j++] = (byte) data2; // data 2 - + // empty line outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; @@ -302,15 +302,20 @@ public void appendCharacterIcon(int[] rgbArray) { byte outArray[] = new byte[0]; byte dataArray[] = rgba5551(rgbArray); - + try { currentFile = Files.readAllBytes(Paths.get("./0A05.bin")); currentLength = currentFile.length; - + // next pointer - currentFile[currentLength - 0x14] = (byte) (((currentLength + dataArray.length + 0x10) / 4) >> 8); - currentFile[currentLength - 0x13] = (byte) (((currentLength + dataArray.length + 0x10) / 4)); - + if (currentFile[currentLength - 0x14] == -1 && currentFile[currentLength - 0x13] == -1) { + currentFile[currentLength - 0x14] = (byte) (((currentLength + dataArray.length + 0x10) / 4) >> 8); + currentFile[currentLength - 0x13] = (byte) (((currentLength + dataArray.length + 0x10) / 4)); + } else { + currentFile[currentLength - 0xC] = (byte) (((currentLength + dataArray.length + 0x10) / 4) >> 8); + currentFile[currentLength - 0xB] = (byte) (((currentLength + dataArray.length + 0x10) / 4)); + } + outArray = new byte[dataArray.length + currentLength + 0x60]; System.arraycopy(currentFile, 0, outArray, 0, currentLength); } catch (IOException ex) { @@ -328,132 +333,132 @@ public void appendCharacterIcon(int[] rgbArray) { outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + data1 = j / 4; - + System.arraycopy(dataArray, 0, outArray, j, dataArray.length); j += dataArray.length; - + data2 = j / 4; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x20; // width outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x20; // width - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - - + + pointer1 = (j + 60) / 4; outArray[j++] = (byte) (pointer1 >> 8); // pointer 1 outArray[j++] = (byte) pointer1; // pointer 1 outArray[j++] = (byte) (data1 >> 8); // data 1 outArray[j++] = (byte) data1; // data 1 - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x20; // height outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x20; // width outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x20; // height - - + + // x scale outArray[j++] = (byte) 0x3F; outArray[j++] = (byte) 0x80; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + // y scale outArray[j++] = (byte) 0x3F; outArray[j++] = (byte) 0x80; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0x02; outArray[j++] = (byte) 0x20; outArray[j++] = (byte) 0x12; outArray[j++] = (byte) 0x34; - + // color outArray[j++] = (byte) 0xFF; outArray[j++] = (byte) 0xFF; outArray[j++] = (byte) 0xFF; outArray[j++] = (byte) 0xFF; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x01; // ? - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x01; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x24; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x20; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x20; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x02; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0xFF; outArray[j++] = (byte) 0xFF; outArray[j++] = (byte) (data2 >> 8); // data 2 outArray[j++] = (byte) data2; // data 2 - + // empty line outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; - + outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; outArray[j++] = (byte) 0x00; @@ -486,8 +491,8 @@ public int getBlue(int argb8888) { public void interleave(byte[] array) { // every other line needs to be interleaved - - // if standard bmp/image data looks like + + // if standard bmp/image data looks like // (line 0) AABBCCDD EEFFGGHH // (line 1) IIJJKKLL MMNNOOPP // (line 2) QQRRSSTT UUVVWWXX diff --git a/original.xdelta b/original.xdelta index 0a4fcf7b..31437ff3 100644 Binary files a/original.xdelta and b/original.xdelta differ diff --git a/readme.md b/readme.md index 4e640d6d..8276af61 100644 --- a/readme.md +++ b/readme.md @@ -93,6 +93,9 @@ A menu for modifying certain character attributes is available on each panel. ##### Dpad ctrl - Available control schemes are: 'Stick Swap', 'Stickless', 'Stick Swap J', or 'Stickless J' - 'Stick Swap' switches Dpad and Stick inputs, and can be used in conjunction with 'Dpad Map'. + - 'J' options = Jump with Dpad Up + - You can hold B during Up Special for an alternate angle (works in all directions) + - Applies to: Fox, Falco, Wolf, Peppy, Mewtwo - Note: When using this, Shield is mapped to L and Taunt is mapped to Z. ##### Initial Damage - Allows setting the damage percent to begin the match with. @@ -230,10 +233,10 @@ A menu for modifying certain character attributes is available on each panel. #### Toggle Name: Jab Locking -### Edge C-Jumping +### Ledge Jump - If enabled, you can press one of the C-Buttons to jump up while hanging from a ledge. -#### Toggle Name: Edge C-Jumping +#### Toggle Name: Ledge Jump ### Perfect Shielding - If enabled, you can perform perfect/power shielding against your opponents attacks. @@ -392,7 +395,7 @@ When Special Model Display is Hitbox or Hitbox+, these changes are applied: - Players can change music tracks during a match with d-pad while the game is paused. - D-Pad Right cycles through the stage's music tracks. - D-Pad Down picks a random music track. - - Can view current track in Pause Legend. + - Can view current track in Pause Legend. ### Settings Menu Shorcut - Quickly access Settings from any CSS or SSS screen by holding 'L'. @@ -691,35 +694,59 @@ _Random Toggles for All Stages_ | [Community] | [Tournament] | [Semi These stages are set to On in the Tournament profile: - Dream Land +- Fray's Stage +- Fray's Stage - Night +- First Destination +- Pokemon Stadium +- Pokemon Stadium 2 - Deku Tree - Kalos Pokemon League -- Pokemon Stadium +- Smashville +- Goomba Road +- Gym Leader Castle +- Saffron City DL +- Ganon's Tower +- Glacial River Remix +- Dr. Mario - Tal Tal Heights (Hazards Off) - Glacial River -- Dr. Mario -- Fray's Stage -- Spiral Mountain -- Mushroom Kingdom DL (Hazards Off) -- Crateria -- Smashville +- Melrode - Yoshi's Story +- Battlefield - Gerudo Valley -- Hyrule Castle DL (Hazards Off) +- WarioWare, Inc. +- Delfino Plaza +- Castle Siege +- Spiral Mountain +- Smashville Remix +- Yoshi's Island DL +- Yoshi's Island II +- Planet Clancer +- Fountain of Dreams +- Final Destination +- Glacial River +- Big Boo's Haunt +- Green Hill Zone +- New Pork City +- Bowser's Keep +- dataDyne Central (Movement Off) - Peach's Castle DL (Hazards Off) -- Fray's Stage - Night -- Goomba Road -- Sector Z DL (Hazards Off) -- Saffron City DL -- Yoshi's Island DL (Hazards Off) +- Congo Jungle DL (Hazards Off) +- Hyrule Castle DL (Hazards Off) - Zebes DL (Hazards Off) -- Planet Clancer -- Final Destination DL +- Mushroom Kingdom DL (Hazards Off) - Duel Zone DL +- Yoshi's Island DL (Hazards Off) +- Dream Land (Hazards Off) +- Sector Z DL (Hazards Off) +- Saffron City DL (Hazards Off) +- Final Destination DL - Meta Crysal DL -- Green Hill Zone -- Pokemon Stadium 2 +- Mute City DL - Winter Dream Land -- Glacial River Remix +- Deku Tree DL +- Crateria DL +- Battlefield DL These stages are set to On in the Semi-Competitive profile: - Congo Jungle @@ -731,13 +758,15 @@ These stages are set to On in the Semi-Competitive profile: - Mini Yoshi's Island - First Destination - Ganon's Tower -- Kalos Pokemon League +- Gym Leader Castle - Pokemon Stadium - Tal Tal Heights - Glacial River - WarioWare, Inc. +- Battlefield - Dr. Mario -- Great Bay +- Dragon King +- Fray's Stage - Tower of Heaven - Fountain of Dreams - Muda Kingdom @@ -747,8 +776,8 @@ These stages are set to On in the Semi-Competitive profile: - Mad Monster Mansion - Bowser's Stadium - Delfino Plaza +- Corneria - Kitchen Island -- Crateria - Smashville - New Pork City - Norfair @@ -762,18 +791,31 @@ These stages are set to On in the Semi-Competitive profile: - Yoshi's Island DL - Bowser's Keep - Windy -- dataDyne +- dataDyne Central - Planet Clancer - Castle Siege - Yoshi's Island II - Cool Cool Mountain SR - Cool Cool Mountain DL -- Hyrule Castle SR - Mute City +- Mushroom Kingdom SR - Green Hill Zone +- Subcon - Pirate Land - Casino Night Zone - Metallic Madness - Pokemon Stadium 2 - Norfair Remix +- Tal Tal Heights Remix +- Winter Dream Land - Glacial River Remix +- Crateria DL +- Twilight City +- Melrode +- Grim Reaper's Cavern +- Scuttle Town +- Big Boo's Haunt +- Dinosaur Land +- Spawned Fear +- Smashville Remix +- Big Snowman \ No newline at end of file diff --git a/roms/filename_overrides.txt b/roms/filename_overrides.txt index 9e939de6..8cfc97c2 100644 --- a/roms/filename_overrides.txt +++ b/roms/filename_overrides.txt @@ -578,8 +578,8 @@ 0A83 Bowser Platforms Stage 0A84 Giga Bowser Entry Right 0A85 Giga Bowser Entry Left -0A86 Ganondorf Entry 1 Right -0A87 Ganondorf Entry 1 Left +0A86 Ganondorf Entry 1 +0A87 Ganondorf Entry 1 Left (UNUSED/PLACEHOLDER) 0A88 Ganondorf Entry 2 Right 0A89 Ganondorf Entry 2 Left 0A8A Bowser's Keep Header @@ -2696,6 +2696,7 @@ 12C9 Ebisumaru Ending Image 1 12CA Ebisumaru Ending Image 2 12CB EPuff Main +12CC Dark Samus CSS Idle 0611 CAPTAIN DeadU 0611 CAPTAIN ScreenKO diff --git a/src/AI.asm b/src/AI.asm index bbdba232..df457be6 100644 --- a/src/AI.asm +++ b/src/AI.asm @@ -24,10 +24,10 @@ scope AI { nop _return: OS.patch_end() - + addiu s3, s3, 0xBDC8 // og line 2 - + li at, is_default_cpu_lvl_set lw t2, 0x0000(at) // t2 = 0 if default cpu level is not already set up bnez t2, _skip_initial_setup @@ -118,10 +118,10 @@ scope AI { beqz v1, _fix_recovery // improved recovery if level 10 // No fix if Vanilla 1P - OS.read_word(Global.match_info, at) // at = current match info struct - lbu v1, 0x0000(at) // + OS.read_word(Global.match_info, at) // at = current match info struct + lbu v1, 0x0000(at) // lli at, Global.GAMEMODE.CLASSIC - beq at, v1, _original // dont use toggle if 1P/RTTF + beq at, v1, _original // dont use toggle if 1P/RTTF nop // Fix if improved AI is on @@ -183,7 +183,7 @@ scope AI { _peppy: lw v0, 0x0024(a0) // v0 = current action ID - addiu at, r0, 0x00F2 // at = Peppy's Aerial Charge action + addiu at, r0, 0x00F2 // at = Peppy's Aerial Charge action bne at, v0, _normal nop // if here, cancel NSP @@ -205,7 +205,7 @@ scope AI { _pikachu: - OS.read_word(Global.match_info, v0) // v0 = current match info struct + OS.read_word(Global.match_info, v0) // v0 = current match info struct lbu v0, 0x0000(v0) lli at, Global.GAMEMODE.CLASSIC beq v0, at, _pikachu_normal // branch if vanilla 1P/RTTF @@ -246,7 +246,7 @@ scope AI { nop _wolf: - lw v0, 0x0024(a0) // get current action + lw v0, 0x0024(a0) // get current action addiu at, r0, 0x00E4 // wolf USP action 1 beq at, v0, _wolf_set_target_coordinates addiu at, r0, 0x00E3 // wolf USP action 2 @@ -341,22 +341,22 @@ scope AI { beq t2, t1, _fail // if sandbag, don't tech ever nop - _check_level_10: - lbu t1, 0x0013(t0) // v1 = cpu level - slti t1, t1, 10 // t6 = 0 if 10 or greater - beqz t1, _advanced_ai // random teching if level 10 + _check_level_10: + lbu t1, 0x0013(t0) // v1 = cpu level + slti t1, t1, 10 // t6 = 0 if 10 or greater + beqz t1, _advanced_ai // random teching if level 10 addiu t1, r0, 0x0004 OS.read_word(SinglePlayerModes.singleplayer_mode_flag, t0) beq t0, t1, _advanced_ai // if Remix 1p, automatic advanced ai nop - // No fix if Vanilla 1P - OS.read_word(Global.match_info, t1) // t1 = current match info struct - lbu t0, 0x0000(t1) + // No fix if Vanilla 1P + OS.read_word(Global.match_info, t1) // t1 = current match info struct + lbu t0, 0x0000(t1) lli t1, Global.GAMEMODE.CLASSIC - beq t1, t0, _original // dont use toggle if 1P/RTTF - nop + beq t1, t0, _original // dont use toggle if 1P/RTTF + nop Toggles.guard(Toggles.entry_improved_ai, j_random_teching__orginal_) @@ -369,8 +369,8 @@ scope AI { beq t1, t0, _original // if we're on the DK vs Samus intro screen, then skip all this nop - _improved_ai: - OS.read_word(Global.match_info, t0) // t0 = address of match_info + _improved_ai: + OS.read_word(Global.match_info, t0) // t0 = address of match_info addiu t0, t0, Global.vs.P_OFFSET // t0 = address of first player sturct _loop: @@ -514,21 +514,22 @@ scope AI { OS.patch_end() _original: - lw t6, 0x0160(v1) // original line 1 - slti at, t6, 0x000B // original line 2 + // lw t6, 0x0160(v1) // original line 1 (moved to 'ZCancel._z_cancel_opts') + // slti at, t6, 0x000B // original line 2 (moved to 'ZCancel._z_cancel_opts') + or at, r0, r0 // clear at addiu sp, sp,-0x0010 // allocate stack space sw t0, 0x0004(sp) // ~ sw t1, 0x0008(sp) // save registers - _check_level_10: - lw t0, 0x0084(a0) // t0 = player struct - lbu t0, 0x0013(t0) // t0 = cpu level - slti t0, t0, 10 // t0 = 0 if 10 or greater - beqz t0, _advanced_ai // z cancel if lvl 10 + _check_level_10: + lw t0, 0x0084(a0) // t0 = player struct + lbu t0, 0x0013(t0) // t0 = cpu level + slti t0, t0, 10 // t0 = 0 if 10 or greater + beqz t0, _advanced_ai // z cancel if lvl 10 - // Fix if Remix 1P + // Fix if Remix 1P addiu t1, r0, 0x0004 OS.read_word(SinglePlayerModes.singleplayer_mode_flag, t0) // t0 = singleplayer mode flag beq t0, t1, _advanced_ai // if Remix 1p, automatic advanced ai @@ -586,11 +587,11 @@ scope AI { beqz t2, _end // if (t2 == man), skip nop - // No fix if Vanilla 1P - OS.read_word(Global.match_info, t0) // t0 = current match info struct - lbu t2, 0x0000(t0) - lli at, Global.GAMEMODE.CLASSIC - beq t2, at, _end // dont use toggle if vanilla 1P/RTTF + // No fix if Vanilla 1P + OS.read_word(Global.match_info, t0) // t0 = current match info struct + lbu t2, 0x0000(t0) + lli a0, Global.GAMEMODE.CLASSIC + beq t2, a0, _end // dont use toggle if vanilla 1P/RTTF // Some characters have extra hitboxes if they don't z cancel. lw t1, 0x0008(v1) // get character ID @@ -632,35 +633,35 @@ scope AI { lli a0, 100 // ~ _dair_check: // bowser and puff - lw t1, 0x0024(v1) // t1 = current action + lw t1, 0x0024(v1) // t1 = current action lli at, Action.AttackAirD // at = dair beql t1, at, _rng // maybe don't cancel if attack has extra hitboxes lli a0, 400 // ~1/4 chance to z cancel - b _rng_normal // otherwise do normal - nop + b _rng_normal // otherwise do normal + nop _fair_check: // pika - lw t1, 0x0024(v1) // t1 = current action + lw t1, 0x0024(v1) // t1 = current action lli at, Action.AttackAirF // at = fair beql t1, at, _rng // maybe don't cancel if attack has extra hitboxes lli a0, 400 // ~1/4 chance to z cancel - b _rng_normal // otherwise do normal - nop + b _rng_normal // otherwise do normal + nop _nair_check: // Mewtwo and DSamus - lw t1, 0x0024(v1) // t1 = current action + lw t1, 0x0024(v1) // t1 = current action lli at, Action.AttackAirN // at = nair beql t1, at, _rng // maybe don't cancel if attack has extra hitboxes lli a0, 400 // ~1/4 chance to z cancel - b _rng_normal // otherwise do normal - nop + b _rng_normal // otherwise do normal + nop _kirby: lw t1, 0x0024(v1) // t1 = current action lli at, Action.AttackAirB // at = attack with no extra hitbox bnel t1, at, _rng // maybe don't cancel if attack has extra hitboxes lli a0, 400 // ~1/4 chance to z cancel - // otherwise do normal + // otherwise do normal _rng_normal: lli a0, 000100 // ~ @@ -693,7 +694,7 @@ scope AI { // @ Description // Improves cpu ability to utilize charge attacks - // Removed for Level 10 cpus (experimental) + // Removed for Level 10 cpus (experimental) // routine is part of 0x8013837C scope improve_remix_specials: { OS.patch_start(0xB1494, 0x80136A54) @@ -784,11 +785,11 @@ scope AI { // if here, check needle ammo lw t0, 0x0AE0(a0) // t0 = needle charge level slti at, t0, 0x0006 // - beqz at, _end // + beqz at, _end // nop j 0x80136B3C // go to original routine for Samus B press? nop - + _bowser: lw v0, 0x0024(a0) // v0 = current action id addiu at, r0, 0xDE // Bowser.Action.USPGround @@ -1104,7 +1105,7 @@ scope AI { b _continue nop - + _ebisumaru_action_check: lw v0, 0x0024(a0) // v0 = current action addiu at, r0, 0xDF // MagicCloudRide @@ -1145,114 +1146,114 @@ scope AI { - // CONTROLLER COMMANDS - // 0xAxyy - yy = Stick X - macro STICK_X(stick_value) { - db 0xA0 //TODO: WAIT TIMER - db {stick_value} - } - - // 0xBxyy - yy = Stick Y - macro STICK_Y(stick_value) { - db 0xB0 //TODO: WAIT TIMER - db {stick_value} - } - // 0xAxyy - yy = Stick X - macro STICK_X(stick_value, wait) { - db 0xA{wait} - db {stick_value} - } - - // 0xBxyy - yy = Stick Y - macro STICK_Y(stick_value, wait) { - db 0xB{wait} - db {stick_value} - } - - // moves towards target coordinates - macro MOVE() { - db 0xC0FF; - } - - macro PRESS_Z() { - dh 0xC040; - } - macro UNPRESS_Z() { - dh 0xC050; - } - macro PRESS_L() { - dh 0xC060; - } - - macro UNPRESS_B() { - db 0x30; - } - macro UNPRESS_A() { - db 0x50; - } - - macro RESET_TIMER() { - dh 0xC0FF; - } - macro FAST_FALL() { - dh 0xC0B1; db 0xB0; - } - macro PK_THUNDER() { - db 0xF3; - } - - macro CUSTOM(id) { - db CUSTOM_ROUTINE_ID - db {id} - } - - // 0xFF00 - End Control Routine - macro END() { - db 0xFF; OS.align(4); - } - - // @ Description - // New Controller Routines for Cpus - SHORT_HOP_COMMAND: // 0x31 + // CONTROLLER COMMANDS + // 0xAxyy - yy = Stick X + macro STICK_X(stick_value) { + db 0xA0 //TODO: WAIT TIMER + db {stick_value} + } + + // 0xBxyy - yy = Stick Y + macro STICK_Y(stick_value) { + db 0xB0 //TODO: WAIT TIMER + db {stick_value} + } + // 0xAxyy - yy = Stick X + macro STICK_X(stick_value, wait) { + db 0xA{wait} + db {stick_value} + } + + // 0xBxyy - yy = Stick Y + macro STICK_Y(stick_value, wait) { + db 0xB{wait} + db {stick_value} + } + + // moves towards target coordinates + macro MOVE() { + db 0xC0FF; + } + + macro PRESS_Z() { + dh 0xC040; + } + macro UNPRESS_Z() { + dh 0xC050; + } + macro PRESS_L() { + dh 0xC060; + } + + macro UNPRESS_B() { + db 0x30; + } + macro UNPRESS_A() { + db 0x50; + } + + macro RESET_TIMER() { + dh 0xC0FF; + } + macro FAST_FALL() { + dh 0xC0B1; db 0xB0; + } + macro PK_THUNDER() { + db 0xF3; + } + + macro CUSTOM(id) { + db CUSTOM_ROUTINE_ID + db {id} + } + + // 0xFF00 - End Control Routine + macro END() { + db 0xFF; OS.align(4); + } + + // @ Description + // New Controller Routines for Cpus + SHORT_HOP_COMMAND: // 0x31 //UNPRESS_Z() - CUSTOM(1) // press C - dh 0xA17F // stick x towards opponent. wait(1) - CUSTOM(2) // unpress C - dh 0x0 // reset stick x - END(); + CUSTOM(1) // press C + dh 0xA17F // stick x towards opponent. wait(1) + CUSTOM(2) // unpress C + dh 0x0 // reset stick x + END(); SHORT_HOP_NAIR: // 0x32 UNPRESS_Z() - CUSTOM(1) // press C - dh 0xA17F // stick x towards opponent. wait(1) - CUSTOM(2) // unpress C - dh 0xA17F // stick x towards opponent. wait(1) - CUSTOM(0) // wait until jumpsquat is complete - // attack: - dh 0xA000 // reset stick x - STICK_Y(0x00) // reset stick y - dh 0x0111 // press A wait(1) + CUSTOM(1) // press C + dh 0xA17F // stick x towards opponent. wait(1) + CUSTOM(2) // unpress C + dh 0xA17F // stick x towards opponent. wait(1) + CUSTOM(0) // wait until jumpsquat is complete + // attack: + dh 0xA000 // reset stick x + STICK_Y(0x00) // reset stick y + dh 0x0111 // press A wait(1) END(); - SHORT_HOP_DAIR: // 0x33 + SHORT_HOP_DAIR: // 0x33 UNPRESS_Z() - CUSTOM(1) // press C - dh 0xA17F // stick x towards opponent. wait(1) - CUSTOM(2) // unpress C - dh 0xA17F // stick x towards opponent. wait(1) - CUSTOM(0) // wait until jumpsquat is complete - // attack: - dh 0xA000 // reset stick x - STICK_Y(0xB0) // point stick down - dh 0x0111 // press A - END(); - - NESS_DJC_NAIR: // 0x34 - dh 0xA07F // point towards opponent - dh 0xB200 // reset y. wait 2 frames - dh 0xA07F // keep pointing - dh 0xB135 // jump, wait 2 frames - dh 0xA07F // point to opponent + CUSTOM(1) // press C + dh 0xA17F // stick x towards opponent. wait(1) + CUSTOM(2) // unpress C + dh 0xA17F // stick x towards opponent. wait(1) + CUSTOM(0) // wait until jumpsquat is complete + // attack: + dh 0xA000 // reset stick x + STICK_Y(0xB0) // point stick down + dh 0x0111 // press A + END(); + + NESS_DJC_NAIR: // 0x34 + dh 0xA07F // point towards opponent + dh 0xB200 // reset y. wait 2 frames + dh 0xA07F // keep pointing + dh 0xB135 // jump, wait 2 frames + dh 0xA07F // point to opponent dh 0xB300 dh 0xA07F dh 0xB135 @@ -1261,14 +1262,14 @@ scope AI { dh 0x0111 dh 0xA07F dh 0xB200 - END(); - - NESS_DJC_DAIR: // 0x?? - dh 0xA07F // point towards opponent - dh 0xB200 // reset y. wait 2 frames - dh 0xA07F // keep pointing - dh 0xB135 // jump, wait 2 frames - dh 0xA07F // point to opponent + END(); + + NESS_DJC_DAIR: // 0x?? + dh 0xA07F // point towards opponent + dh 0xB200 // reset y. wait 2 frames + dh 0xA07F // keep pointing + dh 0xB135 // jump, wait 2 frames + dh 0xA07F // point to opponent dh 0xB300 dh 0xA07F dh 0xB135 @@ -1277,84 +1278,84 @@ scope AI { dh 0x0111 dh 0xA07F dh 0xB200 - END(); - - MULTI_SHINE: // 0x35 - dh 0xA000 // reset sticks - dh 0xB100 // ~ wait(1) - dh 0xA07F // stick x = dash to opponent - dh 0xB100 // stick y = 0. wait 1 frames - dh 0xA000 // stick x = 0 - dh 0xB135 // jump. wait 3 frames - dh 0xA000 // - dh 0xB0B0 // point stick down. wait 2 frames + END(); + + MULTI_SHINE: // 0x35 + dh 0xA000 // reset sticks + dh 0xB100 // ~ wait(1) + dh 0xA07F // stick x = dash to opponent + dh 0xB100 // stick y = 0. wait 1 frames + dh 0xA000 // stick x = 0 + dh 0xB135 // jump. wait 3 frames + dh 0xA000 // + dh 0xB0B0 // point stick down. wait 2 frames dh 0x0221 // press B - END(); - - MULTI_SHINE_TURNAROUND: // 0x36 - dh 0xA000 // reset sticks - dh 0xB100 // ~ wait(1) - dh 0xA07F // stick x = dash to opponent - dh 0xB500 // stick y = 0. wait 6 frames - dh 0xA000 // stick x = 0 - dh 0xB135 // jump. wait 3 frames - dh 0xA000 // - dh 0xB0B0 // point stick down. wait 2 frames + END(); + + MULTI_SHINE_TURNAROUND: // 0x36 + dh 0xA000 // reset sticks + dh 0xB100 // ~ wait(1) + dh 0xA07F // stick x = dash to opponent + dh 0xB500 // stick y = 0. wait 6 frames + dh 0xA000 // stick x = 0 + dh 0xB135 // jump. wait 3 frames + dh 0xA000 // + dh 0xB0B0 // point stick down. wait 2 frames dh 0x0221 // press B - END(); - - SHIELD_DROP: // 0x37 - STICK_X(0) // reset sticks - STICK_Y(0) // reset sticks - db 0x41 // PRESS_Z(); WAIT(1) - PRESS_Z() // Keep Z down - STICK_X(0) - dh 0xB1B0 // STICK_Y(0xB0) Wait(1) - STICK_X(0) // reset sticks - STICK_Y(0) // reset sticks - UNPRESS_Z() // Unpress Z - END(); // End routine - - LUCAS_BAT_BACKWARDS: - dh 0xC0C0 // reset buttons? - STICK_X(0) // reset stick X - dh 0xB200 // and stick Y, wait(1) - STICK_X(0xC0) // hold stick backwards - dh 0x0111 // press A - END(); // End routine - - LUCAS_BAT_FORWARDS: - dh 0xC0C0 // reset buttons? - STICK_X(0) // reset stick X - dh 0xB200 // and stick Y, wait(1) - STICK_X(0x70) // hold stick forward - dh 0x0111 // press A - END(); // End routine - - PUFF_SHORT_HOP_DAIR: - UNPRESS_Z() - CUSTOM(1) // press C - dh 0xA17F // stick x towards opponent. wait(1) - CUSTOM(2) // unpress C - dh 0xA17F // stick x towards opponent. wait(1) - CUSTOM(0) // wait until jumpsquat is complete - dh 0xB100 // wait(1) - // attack: - dh 0xA000 // reset stick x - STICK_Y(0xB0) // point stick down - dh 0x0111 // press A - END(); + END(); + + SHIELD_DROP: // 0x37 + STICK_X(0) // reset sticks + STICK_Y(0) // reset sticks + db 0x41 // PRESS_Z(); WAIT(1) + PRESS_Z() // Keep Z down + STICK_X(0) + dh 0xB1B0 // STICK_Y(0xB0) Wait(1) + STICK_X(0) // reset sticks + STICK_Y(0) // reset sticks + UNPRESS_Z() // Unpress Z + END(); // End routine + + LUCAS_BAT_BACKWARDS: + dh 0xC0C0 // reset buttons? + STICK_X(0) // reset stick X + dh 0xB200 // and stick Y, wait(1) + STICK_X(0xC0) // hold stick backwards + dh 0x0111 // press A + END(); // End routine + + LUCAS_BAT_FORWARDS: + dh 0xC0C0 // reset buttons? + STICK_X(0) // reset stick X + dh 0xB200 // and stick Y, wait(1) + STICK_X(0x70) // hold stick forward + dh 0x0111 // press A + END(); // End routine + + PUFF_SHORT_HOP_DAIR: + UNPRESS_Z() + CUSTOM(1) // press C + dh 0xA17F // stick x towards opponent. wait(1) + CUSTOM(2) // unpress C + dh 0xA17F // stick x towards opponent. wait(1) + CUSTOM(0) // wait until jumpsquat is complete + dh 0xB100 // wait(1) + // attack: + dh 0xA000 // reset stick x + STICK_Y(0xB0) // point stick down + dh 0x0111 // press A + END(); // alternate cliff getup for level 10 - CLIFF_LET_GO: - UNPRESS_A(); UNPRESS_B(); - STICK_X(0) // stick x = 0 - dh 0xB100 // stick y = 0, wait(1) - STICK_Y(0xB0) // point stick down - dh 0xA100 // stick x = 0, wait(1) - STICK_Y(0x80) // jump - dh 0xA400 // stick x = 0, wait(4) - STICK_Y(0); STICK_X(0); END(); // reset sticks, end + CLIFF_LET_GO: + UNPRESS_A(); UNPRESS_B(); + STICK_X(0) // stick x = 0 + dh 0xB100 // stick y = 0, wait(1) + STICK_Y(0xB0) // point stick down + dh 0xA100 // stick x = 0, wait(1) + STICK_Y(0x80) // jump + dh 0xA400 // stick x = 0, wait(4) + STICK_Y(0); STICK_X(0); END(); // reset sticks, end // @ Description // DI Types scope di_type { @@ -1398,7 +1399,7 @@ scope AI { evaluate stick_y_frame_4(stick_direction.{stick_y}) } - STICK_Y(stick_direction.{stick_y}) // set stick y + STICK_Y(stick_direction.{stick_y}) // set stick y STICK_X(stick_direction.{stick_x}, {wait}) // set stick x, wait according to strength STICK_Y({stick_y_frame_2}) // set stick y STICK_X({stick_x_frame_2}, {wait}) // set stick x, wait according to strength @@ -1409,9 +1410,9 @@ scope AI { END() } else { evaluate wait(di_strength.{strength}) - STICK_Y(stick_direction.{stick_y}) // set stick y + STICK_Y(stick_direction.{stick_y}) // set stick y STICK_X(stick_direction.{stick_x}, {wait}) // set stick x, wait according to strength - STICK_Y(0) // stick y = 0 + STICK_Y(0) // stick y = 0 STICK_X(0, {wait}) // stick x = 0, wait according to strength END() } @@ -1489,334 +1490,334 @@ scope AI { DI_SLIDE_LOW_DOWN: di_input(SLIDE, LOW, CENTER, DOWN) - // @ Description - // Copy and extend the vanilla ai cpu command table - // 0x80188340 - constant ORIGINAL_TABLE(0x102D80) - OS.align(16) - command_table: - constant TABLE_ORIGIN(origin()) - OS.copy_segment(ORIGINAL_TABLE, (0x31 * 0x4)) - dw SHORT_HOP_DAIR // 0x31 - dw SHORT_HOP_NAIR // 0x32 - dw SHORT_HOP_DAIR // 0x33 - dw NESS_DJC_NAIR // 0x34 - dw MULTI_SHINE // 0x35 - dw MULTI_SHINE_TURNAROUND // 0x36 - dw SHIELD_DROP // 0x37 - dw LUCAS_BAT_BACKWARDS // 0x38 - dw LUCAS_BAT_FORWARDS // 0x39 - dw PUFF_SHORT_HOP_DAIR // 0x3A - dw CLIFF_LET_GO // 0x3B - dw DI_SMASH_HIGH_LEFT // 0x3C - dw DI_SMASH_HIGH_RIGHT // 0x3D - dw DI_SMASH_HIGH_UP // 0x3E - dw DI_SMASH_HIGH_DOWN // 0x3F - dw DI_SMASH_MEDIUM_LEFT // 0x40 - dw DI_SMASH_MEDIUM_RIGHT // 0x41 - dw DI_SMASH_MEDIUM_UP // 0x42 - dw DI_SMASH_MEDIUM_DOWN // 0x43 - dw DI_SMASH_LOW_LEFT // 0x44 - dw DI_SMASH_LOW_RIGHT // 0x45 - dw DI_SMASH_LOW_UP // 0x46 - dw DI_SMASH_LOW_DOWN // 0x47 - dw DI_SLIDE_HIGH_LEFT // 0x48 - dw DI_SLIDE_HIGH_RIGHT // 0x49 - dw DI_SLIDE_HIGH_UP // 0x4A - dw DI_SLIDE_HIGH_DOWN // 0x4B - dw DI_SLIDE_MEDIUM_LEFT // 0x4C - dw DI_SLIDE_MEDIUM_RIGHT // 0x4D - dw DI_SLIDE_MEDIUM_UP // 0x4E - dw DI_SLIDE_MEDIUM_DOWN // 0x4F - dw DI_SLIDE_LOW_LEFT // 0x50 - dw DI_SLIDE_LOW_RIGHT // 0x51 - dw DI_SLIDE_LOW_UP // 0x52 - dw DI_SLIDE_LOW_DOWN // 0x53 - - // new commands go here ^ - - // @ Description - // Command routine index points to entry in table 0x80132564 - // Applies controller command to cpu + // @ Description + // Copy and extend the vanilla ai cpu command table + // 0x80188340 + constant ORIGINAL_TABLE(0x102D80) + OS.align(16) + command_table: + constant TABLE_ORIGIN(origin()) + OS.copy_segment(ORIGINAL_TABLE, (0x31 * 0x4)) + dw SHORT_HOP_DAIR // 0x31 + dw SHORT_HOP_NAIR // 0x32 + dw SHORT_HOP_DAIR // 0x33 + dw NESS_DJC_NAIR // 0x34 + dw MULTI_SHINE // 0x35 + dw MULTI_SHINE_TURNAROUND // 0x36 + dw SHIELD_DROP // 0x37 + dw LUCAS_BAT_BACKWARDS // 0x38 + dw LUCAS_BAT_FORWARDS // 0x39 + dw PUFF_SHORT_HOP_DAIR // 0x3A + dw CLIFF_LET_GO // 0x3B + dw DI_SMASH_HIGH_LEFT // 0x3C + dw DI_SMASH_HIGH_RIGHT // 0x3D + dw DI_SMASH_HIGH_UP // 0x3E + dw DI_SMASH_HIGH_DOWN // 0x3F + dw DI_SMASH_MEDIUM_LEFT // 0x40 + dw DI_SMASH_MEDIUM_RIGHT // 0x41 + dw DI_SMASH_MEDIUM_UP // 0x42 + dw DI_SMASH_MEDIUM_DOWN // 0x43 + dw DI_SMASH_LOW_LEFT // 0x44 + dw DI_SMASH_LOW_RIGHT // 0x45 + dw DI_SMASH_LOW_UP // 0x46 + dw DI_SMASH_LOW_DOWN // 0x47 + dw DI_SLIDE_HIGH_LEFT // 0x48 + dw DI_SLIDE_HIGH_RIGHT // 0x49 + dw DI_SLIDE_HIGH_UP // 0x4A + dw DI_SLIDE_HIGH_DOWN // 0x4B + dw DI_SLIDE_MEDIUM_LEFT // 0x4C + dw DI_SLIDE_MEDIUM_RIGHT // 0x4D + dw DI_SLIDE_MEDIUM_UP // 0x4E + dw DI_SLIDE_MEDIUM_DOWN // 0x4F + dw DI_SLIDE_LOW_LEFT // 0x50 + dw DI_SLIDE_LOW_RIGHT // 0x51 + dw DI_SLIDE_LOW_UP // 0x52 + dw DI_SLIDE_LOW_DOWN // 0x53 + + // new commands go here ^ + + // @ Description + // Command routine index points to entry in table 0x80132564 + // Applies controller command to cpu scope ROUTINE: { - constant RESET_STICK(0x00) - constant MOVE(0x01) - constant TURN(0x02) - constant WAIT_1_FRAME(0x03) - constant JUMP(0x04) - constant FTILT(0x05) - // constant attack_a?(0x06) // constant attack_a?(0x07) // constant attack_a?(0x08) - constant NSP(0x09) - //constant NSP2?(0x0A) //constant NSP3?(0x0B) + constant RESET_STICK(0x00) + constant MOVE(0x01) + constant TURN(0x02) + constant WAIT_1_FRAME(0x03) + constant JUMP(0x04) + constant FTILT(0x05) + // constant attack_a?(0x06) // constant attack_a?(0x07) // constant attack_a?(0x08) + constant NSP(0x09) + //constant NSP2?(0x0A) //constant NSP3?(0x0B) constant PRESS_Z(0x0C) - constant USP(0x0D) - //constant USP2?(0x0E) - constant TAUNT(0x0F) - constant SHIELD_2(0x10) - // constant WALK2?(0x11) // constant WALK3?(0x12) - constant PRESS_A(0x13) - constant JAB(0x13) - constant NAIR(0x13) - // constant ?(0x0E) // constant ?(0x0F) // constant ?(0x10) // constant ?(0x11) // constant ?(0x12) // constant ?(0x13) // constant ?(0x14) - constant SMASH_FORWARD(0x15) - // constant ?(0x16) - constant UTILT(0x17) - // constant RANDOM_ATTACKS?(0x18) - constant SMASH_UP(0x19) - // constant RANDOM_ATTACKS?(0x1A) - constant DSP(0x1B) - constant GRAB(0x1C) - //constant GRAB2?(0x1D) - constant STICK_LEFT(0x1E) - constant STICK_RIGHT(0x1F) - constant DTILT(0x20) - // constant RANDOM_ATTACKS?(0x21) - constant SMASH_DOWN(0x22) - //constant SHIELD_3(0x23) - - constant STICK_DOWN(0x27) // fast fall, plat drop - constant CLIFF_ATTACK(0x28) - constant HARD_ITEM_THROW(0x2A) - constant LIGHT_ITEM_THROW(0x2B) + constant USP(0x0D) + //constant USP2?(0x0E) + constant TAUNT(0x0F) + constant SHIELD_2(0x10) + // constant WALK2?(0x11) // constant WALK3?(0x12) + constant PRESS_A(0x13) + constant JAB(0x13) + constant NAIR(0x13) + // constant ?(0x0E) // constant ?(0x0F) // constant ?(0x10) // constant ?(0x11) // constant ?(0x12) // constant ?(0x13) // constant ?(0x14) + constant SMASH_FORWARD(0x15) + // constant ?(0x16) + constant UTILT(0x17) + // constant RANDOM_ATTACKS?(0x18) + constant SMASH_UP(0x19) + // constant RANDOM_ATTACKS?(0x1A) + constant DSP(0x1B) + constant GRAB(0x1C) + //constant GRAB2?(0x1D) + constant STICK_LEFT(0x1E) + constant STICK_RIGHT(0x1F) + constant DTILT(0x20) + // constant RANDOM_ATTACKS?(0x21) + constant SMASH_DOWN(0x22) + //constant SHIELD_3(0x23) + + constant STICK_DOWN(0x27) // fast fall, plat drop + constant CLIFF_ATTACK(0x28) + constant HARD_ITEM_THROW(0x2A) + constant LIGHT_ITEM_THROW(0x2B) constant ROLL_LEFT(0x2D) constant ROLL_RIGHT(0x2E) - constant YOSHI_USP(0x2F) - constant PK_THUNDER(0x30) // goes to 0x801324F0 - - // custom routines start here - constant SHORT_HOP_DAIR(0x31) - constant SHORT_HOP_NAIR(0x32) - constant SHORT_HOP_DAIR_2(0x32) // todo: make different - constant NESS_DJC_NAIR(0x34) - constant MULTI_SHINE(0x35) - constant MULTI_SHINE_TURNAROUND(0x36) - constant SHIELD_DROP(0x37) - constant LUCAS_BAT_BACKWARDS(0x38) - constant LUCAS_BAT_FORWARDS(0x39) - constant PUFF_SHORT_HOP_DAIR(0x3A) - constant CLIFF_LET_GO(0x3B) - constant DI_SMASH_HIGH_LEFT(0x3C) - constant DI_SMASH_HIGH_RIGHT(0x3D) - constant DI_SMASH_HIGH_UP(0x3E) - constant DI_SMASH_HIGH_DOWN(0x3F) - constant DI_SMASH_MEDIUM_LEFT(0x40) - constant DI_SMASH_MEDIUM_RIGHT(0x41) - constant DI_SMASH_MEDIUM_UP(0x42) - constant DI_SMASH_MEDIUM_DOWN(0x43) - constant DI_SMASH_LOW_LEFT(0x44) - constant DI_SMASH_LOW_RIGHT(0x45) - constant DI_SMASH_LOW_UP(0x46) - constant DI_SMASH_LOW_DOWN(0x47) - constant DI_SLIDE_HIGH_LEFT(0x48) - constant DI_SLIDE_HIGH_RIGHT(0x49) - constant DI_SLIDE_HIGH_UP(0x4A) - constant DI_SLIDE_HIGH_DOWN(0x4B) - constant DI_SLIDE_MEDIUM_LEFT(0x4C) - constant DI_SLIDE_MEDIUM_RIGHT(0x4D) - constant DI_SLIDE_MEDIUM_UP(0x4E) - constant DI_SLIDE_MEDIUM_DOWN(0x4F) - constant DI_SLIDE_LOW_LEFT(0x50) - constant DI_SLIDE_LOW_RIGHT(0x51) - constant DI_SLIDE_LOW_UP(0x52) - constant DI_SLIDE_LOW_DOWN(0x53) + constant YOSHI_USP(0x2F) + constant PK_THUNDER(0x30) // goes to 0x801324F0 + + // custom routines start here + constant SHORT_HOP_DAIR(0x31) + constant SHORT_HOP_NAIR(0x32) + constant SHORT_HOP_DAIR_2(0x32) // todo: make different + constant NESS_DJC_NAIR(0x34) + constant MULTI_SHINE(0x35) + constant MULTI_SHINE_TURNAROUND(0x36) + constant SHIELD_DROP(0x37) + constant LUCAS_BAT_BACKWARDS(0x38) + constant LUCAS_BAT_FORWARDS(0x39) + constant PUFF_SHORT_HOP_DAIR(0x3A) + constant CLIFF_LET_GO(0x3B) + constant DI_SMASH_HIGH_LEFT(0x3C) + constant DI_SMASH_HIGH_RIGHT(0x3D) + constant DI_SMASH_HIGH_UP(0x3E) + constant DI_SMASH_HIGH_DOWN(0x3F) + constant DI_SMASH_MEDIUM_LEFT(0x40) + constant DI_SMASH_MEDIUM_RIGHT(0x41) + constant DI_SMASH_MEDIUM_UP(0x42) + constant DI_SMASH_MEDIUM_DOWN(0x43) + constant DI_SMASH_LOW_LEFT(0x44) + constant DI_SMASH_LOW_RIGHT(0x45) + constant DI_SMASH_LOW_UP(0x46) + constant DI_SMASH_LOW_DOWN(0x47) + constant DI_SLIDE_HIGH_LEFT(0x48) + constant DI_SLIDE_HIGH_RIGHT(0x49) + constant DI_SLIDE_HIGH_UP(0x4A) + constant DI_SLIDE_HIGH_DOWN(0x4B) + constant DI_SLIDE_MEDIUM_LEFT(0x4C) + constant DI_SLIDE_MEDIUM_RIGHT(0x4D) + constant DI_SLIDE_MEDIUM_UP(0x4E) + constant DI_SLIDE_MEDIUM_DOWN(0x4F) + constant DI_SLIDE_LOW_LEFT(0x50) + constant DI_SLIDE_LOW_RIGHT(0x51) + constant DI_SLIDE_LOW_UP(0x52) + constant DI_SLIDE_LOW_DOWN(0x53) + } + + // @ Description + // modifies a hard-coded routine which gets the ptr to an ai's command + scope extend_commands_1: { + OS.patch_start(0xAD174, 0x80132734) + constant UPPER(command_table >> 16) + constant LOWER(command_table & 0xFFFF) + + if LOWER > 0x7FFF { + lui t9, (UPPER + 0x1) // original line 1 (modified) + } else { + lui t9, UPPER // original line 1 (modified) + } + + sll t7, t8, 2 // original line 2 + addu t9, t9, t7 // original line 3 + lw t9, LOWER(t9) // original line 4 (modified) + OS.patch_end() + } + + // another hard-coded place + scope extend_commands_2: { + OS.patch_start(0xAD378, 0x80132938) + constant UPPER(command_table >> 16) + constant LOWER(command_table & 0xFFFF) + + if (LOWER > 0x7FFF) { + lui t9, (UPPER + 0x1) // original line 1 (modified) + } else { + lui t9, UPPER // original line 1 (modified) + } + + sll t7, t8, 2 // original line 2 + addu t9, t9, t7 // original line 3 + lw t9, LOWER(t9) // original line 4 (modified) + OS.patch_end() + } + + // another hard-coded place + scope extend_commands_3: { + OS.patch_start(0xAD1A0, 0x80132760) + constant UPPER(command_table >> 16) + constant LOWER(command_table & 0xFFFF) + + if (LOWER > 0x7FFF) { + lui t8, (UPPER + 0x1) // original line 1 (modified) + } else { + lui t8, UPPER // original line 1 (modified) + } + + sb t6, 0x01D3(a0) // original line 2 + addu t8, t8, t7 // original line 3 + lw t8, LOWER(t8) // original line 4 (modified) + OS.patch_end() } - // @ Description - // modifies a hard-coded routine which gets the ptr to an ai's command - scope extend_commands_1: { - OS.patch_start(0xAD174, 0x80132734) - constant UPPER(command_table >> 16) - constant LOWER(command_table & 0xFFFF) - - if LOWER > 0x7FFF { - lui t9, (UPPER + 0x1) // original line 1 (modified) - } else { - lui t9, UPPER // original line 1 (modified) - } - - sll t7, t8, 2 // original line 2 - addu t9, t9, t7 // original line 3 - lw t9, LOWER(t9) // original line 4 (modified) - OS.patch_end() - } - - // another hard-coded place - scope extend_commands_2: { - OS.patch_start(0xAD378, 0x80132938) - constant UPPER(command_table >> 16) - constant LOWER(command_table & 0xFFFF) - - if (LOWER > 0x7FFF) { - lui t9, (UPPER + 0x1) // original line 1 (modified) - } else { - lui t9, UPPER // original line 1 (modified) - } - - sll t7, t8, 2 // original line 2 - addu t9, t9, t7 // original line 3 - lw t9, LOWER(t9) // original line 4 (modified) - OS.patch_end() - } - - // another hard-coded place - scope extend_commands_3: { - OS.patch_start(0xAD1A0, 0x80132760) - constant UPPER(command_table >> 16) - constant LOWER(command_table & 0xFFFF) - - if (LOWER > 0x7FFF) { - lui t8, (UPPER + 0x1) // original line 1 (modified) - } else { - lui t8, UPPER // original line 1 (modified) - } - - sb t6, 0x01D3(a0) // original line 2 - addu t8, t8, t7 // original line 3 - lw t8, LOWER(t8) // original line 4 (modified) - OS.patch_end() - } - - // @ Description + // @ Description // Allows custom AI controller commands. - // Command = 0xFExx (xx = routine index) - constant CUSTOM_ROUTINE_ID(0xFE) - scope CUSTOM_COMMANDS: { - - // halts commands from processing until out of jumpsquat - scope JUMPSQUAT_WAIT: { - lw t7, 0x0024(a0) // t7 = current action - addiu t6, r0, Action.JumpSquat // t6 = Action.JumpSquat - beql t6, t7, _jump_squat// branch if doing a jumpsquat - addiu at, r0, 0x0001 // a1 = 1 - - _end: - j 0x8013253C // back to original routine - nop - _jump_squat: - - sh at, 0x0006(t0) // wait 1 frame - j 0x8013254C // exit command processing - addiu a2, a2, -0x0002 // read this command next frame - - } - - // TODO: MAKE SURE THIS DOESN'T STAY STUCK ON. - scope PRESS_C: { - constant index(1) - lh t7, 0x01C6(a0) // t7 = cpu button pressed flags - ori t8, t7, 0x0001 // t8 = t7 + c-button press - j 0x8013253C // back to original routine - sh t8, 0x01C6(a0) // save c button press - } - - scope UNPRESS_C: { - constant index(2) - lh t7, 0x01C6(a0) // t7 = cpu button pressed flags - andi t8, t7, 0xFFF0 // t8 = t7 - c-button press - j 0x8013253C // back to original routine - sh t8, 0x01C6(a0) // save c button press - } - - table: // Command - dw JUMPSQUAT_WAIT // 0xFE00 - dw PRESS_C // 0xFE01 - dw UNPRESS_C // 0xFE02 - - scope extend_routines: { - OS.patch_start(0x1065BC, 0x8018BB7C) - dw extend_routines - OS.patch_end() - - // a0 = cpu player struct, a2 = argument - li at, table // at = custom ai command table - lb t7, 0x0000(a2) // t7 = custom routine idle - sll t7, t7, 0x0002 // t7 = offset in table - addu at, at, t7 - lw at, 0x0000(at) - jr at // go to the custom routine - addiu a2, a2, 0x0001 // increment a2 - - } - } - - // If the opponent is above? classic characters might do a up special - scope AERIAL_CHASE: { - - scope ROUTINE: { - // og table addr. 0x8018BC64 - // vanilla - constant NORMAL(0x8013389C) - constant CHASE(0x80133A14) - // remix - } - - - scope extend_polygon_check_: { - OS.patch_start(0xAE2C0, 0x80133880) - j extend_polygon_check_ - sll t8, v0, 2 // OG line 2 t8 = offset in ai_long_range_table_ - _return: - OS.patch_end() - - // at = 0 if character ID is >= POLY MARIO - bnez at, _normal_vanilla_character // branch if orginal vanilla fighter - sltiu at, v0, Character.id.FALCO // at = 1 if vanilla polygon - bnez at, _polygon_fighter // branch if vanilla polygon fighter - sltiu at, v0, Character.NUM_CHARACTERS - Character.NUM_POLYGONS // at = 0 if remix polygon - bnez at, _normal_vanilla_character - nop - - _polygon_fighter: - j 0x8013389C // original line 1 branch - nop - - _normal_vanilla_character: - j _return - nop - - } - } - - - // if the opponent is far away? classic characters will do one of these jumps - scope LONG_RANGE: { - scope ROUTINE: { - // og table addr. 0x8018BF20 - // vanilla - constant NSP_SHOOT(0x80138D24) // used by Mario, Fox, Samus etc. - constant NONE(0x80138ECC) - constant PHYSICAL_SHOOT(0x80138CD4) // LINK, boomerang if opponent within 1500.0 units - // remix - } - - // @ Description - // Extends a check that is meant to exclude polygons specifically for determining behaviour when a fighter is far away - // a0 = character ID - scope extend_polygon_check_: { - OS.patch_start(0xB36F8, 0x80138CB8) - j extend_polygon_check_ - sll t5, a0, 2 // OG line 2 t5 = offset in ai_long_range_table_ - _return: - OS.patch_end() - - // at = 0 if character ID is >= POLY MARIO - bnez at, _normal_vanilla_character // branch if orginal vanilla fighter - sltiu at, a0, Character.id.FALCO // at = 1 if vanilla polygon - bnez at, _polygon_fighter // branch if vanilla polygon fighter - sltiu at, a0, Character.NUM_CHARACTERS - Character.NUM_POLYGONS // at = 0 if remix polygon - bnez at, _normal_vanilla_character - nop - - _polygon_fighter: - j 0x80138ECC // original line 1 branch - nop - - _normal_vanilla_character: - j _return - nop - - } - } + // Command = 0xFExx (xx = routine index) + constant CUSTOM_ROUTINE_ID(0xFE) + scope CUSTOM_COMMANDS: { + + // halts commands from processing until out of jumpsquat + scope JUMPSQUAT_WAIT: { + lw t7, 0x0024(a0) // t7 = current action + addiu t6, r0, Action.JumpSquat // t6 = Action.JumpSquat + beql t6, t7, _jump_squat// branch if doing a jumpsquat + addiu at, r0, 0x0001 // a1 = 1 + + _end: + j 0x8013253C // back to original routine + nop + _jump_squat: + + sh at, 0x0006(t0) // wait 1 frame + j 0x8013254C // exit command processing + addiu a2, a2, -0x0002 // read this command next frame + + } + + // TODO: MAKE SURE THIS DOESN'T STAY STUCK ON. + scope PRESS_C: { + constant index(1) + lh t7, 0x01C6(a0) // t7 = cpu button pressed flags + ori t8, t7, 0x0001 // t8 = t7 + c-button press + j 0x8013253C // back to original routine + sh t8, 0x01C6(a0) // save c button press + } + + scope UNPRESS_C: { + constant index(2) + lh t7, 0x01C6(a0) // t7 = cpu button pressed flags + andi t8, t7, 0xFFF0 // t8 = t7 - c-button press + j 0x8013253C // back to original routine + sh t8, 0x01C6(a0) // save c button press + } + + table: // Command + dw JUMPSQUAT_WAIT // 0xFE00 + dw PRESS_C // 0xFE01 + dw UNPRESS_C // 0xFE02 + + scope extend_routines: { + OS.patch_start(0x1065BC, 0x8018BB7C) + dw extend_routines + OS.patch_end() + + // a0 = cpu player struct, a2 = argument + li at, table // at = custom ai command table + lb t7, 0x0000(a2) // t7 = custom routine idle + sll t7, t7, 0x0002 // t7 = offset in table + addu at, at, t7 + lw at, 0x0000(at) + jr at // go to the custom routine + addiu a2, a2, 0x0001 // increment a2 + + } + } + + // If the opponent is above? classic characters might do a up special + scope AERIAL_CHASE: { + + scope ROUTINE: { + // og table addr. 0x8018BC64 + // vanilla + constant NORMAL(0x8013389C) + constant CHASE(0x80133A14) + // remix + } + + + scope extend_polygon_check_: { + OS.patch_start(0xAE2C0, 0x80133880) + j extend_polygon_check_ + sll t8, v0, 2 // OG line 2 t8 = offset in ai_long_range_table_ + _return: + OS.patch_end() + + // at = 0 if character ID is >= POLY MARIO + bnez at, _normal_vanilla_character // branch if orginal vanilla fighter + sltiu at, v0, Character.id.FALCO // at = 1 if vanilla polygon + bnez at, _polygon_fighter // branch if vanilla polygon fighter + sltiu at, v0, Character.NUM_CHARACTERS - Character.NUM_POLYGONS // at = 0 if remix polygon + bnez at, _normal_vanilla_character + nop + + _polygon_fighter: + j 0x8013389C // original line 1 branch + nop + + _normal_vanilla_character: + j _return + nop + + } + } + + + // if the opponent is far away? classic characters will do one of these jumps + scope LONG_RANGE: { + scope ROUTINE: { + // og table addr. 0x8018BF20 + // vanilla + constant NSP_SHOOT(0x80138D24) // used by Mario, Fox, Samus etc. + constant NONE(0x80138ECC) + constant PHYSICAL_SHOOT(0x80138CD4) // LINK, boomerang if opponent within 1500.0 units + // remix + } + + // @ Description + // Extends a check that is meant to exclude polygons specifically for determining behaviour when a fighter is far away + // a0 = character ID + scope extend_polygon_check_: { + OS.patch_start(0xB36F8, 0x80138CB8) + j extend_polygon_check_ + sll t5, a0, 2 // OG line 2 t5 = offset in ai_long_range_table_ + _return: + OS.patch_end() + + // at = 0 if character ID is >= POLY MARIO + bnez at, _normal_vanilla_character // branch if orginal vanilla fighter + sltiu at, a0, Character.id.FALCO // at = 1 if vanilla polygon + bnez at, _polygon_fighter // branch if vanilla polygon fighter + sltiu at, a0, Character.NUM_CHARACTERS - Character.NUM_POLYGONS // at = 0 if remix polygon + bnez at, _normal_vanilla_character + nop + + _polygon_fighter: + j 0x80138ECC // original line 1 branch + nop + + _normal_vanilla_character: + j _return + nop + + } + } // @ Description // Location of vanilla cpus attack arrays @@ -2107,7 +2108,7 @@ scope AI { // @ Description // Jumps used by character jump table at 0x801334E4 - // Used to prevent bad AI attacks + // Used to prevent bad AI attacks scope PREVENT_ATTACK: { scope ROUTINE: { // vanilla @@ -2115,11 +2116,11 @@ scope AI { constant MARIO(0x801334EC) // Used by Mario Clones in vanilla (Prevents sd from DSP/USP) constant YOSHI_FALCON(0x80133510) // Checks Down Special constant KIRBY(0x80133500) // Checks Down Special and Up Special - // remix - constant SKIP_ATTACK(0x80133A14) // debug option for us + // remix + constant SKIP_ATTACK(0x80133A14) // debug option for us - // @ Description - // Prevents Falco SD with phantasm and usp + // @ Description + // Prevents Falco SD with phantasm and usp scope FALCO_NSP: { // t1 = current cpu attack input addiu at, r0, ATTACK_TABLE.NSPG.INPUT @@ -2148,25 +2149,25 @@ scope AI { } - // @ Description - // Prevents Bowser from doing a dangerous attack near ledge + // @ Description + // Prevents Bowser from doing a dangerous attack near ledge scope BOWSER_USP_DSP: { // t1 = current cpu attack command addiu at, r0, ATTACK_TABLE.DSPG.INPUT - beq t1, at, _prevent_sd // branch if doing grounded DSP + beq t1, at, _prevent_sd // branch if doing grounded DSP addiu at, r0, ATTACK_TABLE.USPG.INPUT - bne t1, at, _allow_attack // branch if not doing grounded USP + bne t1, at, _allow_attack // branch if not doing grounded USP nop - _prevent_sd: + _prevent_sd: j 0x80133520 // jump to original routine addiu t2, r0, 0x0001 - _allow_attack: + _allow_attack: j 0x80133520 // jump to original routine nop } - + // @ Description // Prevents Bowser from doing a dangerous attack near ledge scope GBOWSER: { @@ -2186,19 +2187,19 @@ scope AI { } - // @ Description - // Prevents Wolf SD with USP + // @ Description + // Prevents Wolf SD with USP scope USP: { // t1 = current cpu attack command addiu at, r0, ATTACK_TABLE.USPG.INPUT bne t1, at, _allow_attack nop - // _prevent_sd: + // _prevent_sd: j 0x80133520 // jump to original routine addiu t2, r0, 0x0001 - _allow_attack: + _allow_attack: j 0x80133520 // jump to original routine nop } @@ -2220,383 +2221,383 @@ scope AI { nop } - // @ Description - // Prevents Conker from using Grenade when he can't. + // @ Description + // Prevents Conker from using Grenade when he can't. scope CONKER_GRENADE: { // t1 = current cpu attack command addiu at, r0, ATTACK_TABLE.DSPG.INPUT // 0x1B bne t1, at, _allow_attack nop - // if here check if grenade available: - // s0 = player struct - lw at, 0x0ADC(s0) - beqz at, _allow_attack // branch if grenade available + // if here check if grenade available: + // s0 = player struct + lw at, 0x0ADC(s0) + beqz at, _allow_attack // branch if grenade available nop j 0x80133A14 // skip this attack nop - _allow_attack: + _allow_attack: j 0x80133520 // jump to original routine nop } - // @ Description - // Prevents Marina from doing a dangerous neutral special. + // @ Description + // Prevents Marina from doing a dangerous neutral special. scope MARINA_NSP: { // t1 = current cpu attack command addiu at, r0, ATTACK_TABLE.NSPG.INPUT bne t1, at, _allow_attack nop - // _prevent_sd: + // _prevent_sd: j 0x80133520 // jump to original routine addiu t2, r0, 0x0001 - _allow_attack: + _allow_attack: j 0x80133520 // jump to original routine nop } - // @ Description - // Prevents non-level 10 puffs from using down special. + // @ Description + // Prevents non-level 10 puffs from using down special. scope PUFF_DSP: { // t1 = current cpu attack command - addiu at, r0, ATTACK_TABLE.DSPG.INPUT // at = down special command input - bne t1, at, _allow_attack // allow the attack if it is not down special + addiu at, r0, ATTACK_TABLE.DSPG.INPUT // at = down special command input + bne t1, at, _allow_attack // allow the attack if it is not down special + nop + lbu at, 0x0013(s0) // at = cpu level + slti at, at, 10 // at = 0 if 10 or greater + beqz at, _lvl_10_dsp // allow DSP if LVL 10 nop - lbu at, 0x0013(s0) // at = cpu level - slti at, at, 10 // at = 0 if 10 or greater - beqz at, _lvl_10_dsp // allow DSP if LVL 10 - nop - _prevent_dsp: - j 0x80133A14 // No DSP if < LVL 10 + _prevent_dsp: + j 0x80133A14 // No DSP if < LVL 10 nop - _lvl_10_dsp: - lw at, 0x01FC(s0) // get target player object + _lvl_10_dsp: + lw at, 0x01FC(s0) // get target player object beqz at, _allow_attack // skip if no target player (somehow) nop - lw v0, 0x0084(at) // v0 = target player struct - lh t6, 0x05BA(v0) // t6 = targets tangibility flag - addiu at, r0, 0x0003 - beq at, t6, _prevent_dsp // don't try to rest if they are intangible - lli at, 30 // at = 30 hp - lw t6, 0x002C(v0) // t6 = target players hp% - blt at, t6, _prevent_dsp // skip rest check if player is less than 30 percent - nop - - _allow_attack: - j 0x80133520 // jump to original routine + lw v0, 0x0084(at) // v0 = target player struct + lh t6, 0x05BA(v0) // t6 = targets tangibility flag + addiu at, r0, 0x0003 + beq at, t6, _prevent_dsp // don't try to rest if they are intangible + lli at, 30 // at = 30 hp + lw t6, 0x002C(v0) // t6 = target players hp% + blt at, t6, _prevent_dsp // skip rest check if player is less than 30 percent + nop + + _allow_attack: + j 0x80133520 // jump to original routine nop } - // @ Description - // Prevents 10 Fox from using up special offensively + // @ Description + // Prevents 10 Fox from using up special offensively scope FOX_USP: { // t1 = current cpu attack command - addiu at, r0, ATTACK_TABLE.USPG.INPUT // at = up special command input - bne t1, at, _allow_attack // allow the attack if it is not down special + addiu at, r0, ATTACK_TABLE.USPG.INPUT // at = up special command input + bne t1, at, _allow_attack // allow the attack if it is not down special + nop + lbu at, 0x0013(s0) // at = cpu level + slti at, at, 10 // at = 0 if 10 or greater + bnez at, _allow_attack // allow attack if not level 10 nop - lbu at, 0x0013(s0) // at = cpu level - slti at, at, 10 // at = 0 if 10 or greater - bnez at, _allow_attack // allow attack if not level 10 - nop - j 0x80133A14 // No USP if LVL 10 + j 0x80133A14 // No USP if LVL 10 nop - _allow_attack: - j 0x80133520 // jump to original routine + _allow_attack: + j 0x80133520 // jump to original routine nop } } - // places of interest - // 0x8013295C checks if cpu should attack + // places of interest + // 0x8013295C checks if cpu should attack - // 0x80134000 recovery routine - // 0x80138EAC neutral B routine + // 0x80134000 recovery routine + // 0x80138EAC neutral B routine } - // @ Description - // This is the main routine that handles how a cpu player functions - // There are 3 subroutines which determine the cpus input - // The last subroutine applies the cpu input - scope MANAGE_CPU: { - constant ROUTINE(0x8013A834) - - // skip to the last JAL if still processing a controller command - - // @ Description - // First, read byte 0x05 and sets byte 0x03 - // Overrides the behaviour - scope OVERRIDE: { - constant MAIN(0x8013A63C) - constant TABLE(0x8018BFFC) - - scope TYPE: { - constant DEFAULT(0x00) // ? Used in VS and for some 1P characters - constant LINK(0x01) // Do nothing for a bit (1P Link) - constant YOSHI_TEAM(0x02) // set to 0x07 - constant KIRBY(0x03) // set to 0x08 - constant POLYGON(0x04) // set to 0x09 - constant MARIO_BROS(0x05) // set to 0x03 for Luigi players - constant GIANT_DK(0x06) // set to 0x00 - constant UNKNOWN_1(0x07) // set to 0x02 - constant RTTF(0x08) // set to 0x0D - constant ALLY(0x09) // set to 0x03 - constant TRAINING(0x0A) // No override - } - } - - // @ Description - // Second, read byte 0x03 and sets byte 0x01 - // Sets the main behaviour subroutine - scope SET: { - constant MAIN(0x8013A4AC) - constant TABLE(0x8018BFAC) - - scope STATE: { - constant DEFAULT(0x00) // 0x0C = 0x80137778, 0x01 = 0x02 - constant UNKNOWN_1(0x01) // 0x0C = 0x80137778, 0x01 = 0x03 - constant UNKNOWN_2(0x02) // 0x0C = 0x80137778, 0x01 = 0x08 - constant ALLY(0x03) // 0x0C = 0x80137778, 0x01 = 0x09 - constant FALCON(0x04) // 0x0C = 0x80137778, 0x01 = 0x0A - constant YOSHI_TEAM(0x07) // 0x0C = 0x80137778, 0x01 = 0x09 - constant KIRBY_TEAM(0x08) // 0x0C = 0x80137778, 0x01 = 0x0A - constant POLYGON(0x09) // 0x0C = 0x80137778, 0x01 = 0x02 - //constant UNUSED_1(0x0A) // nothing - //constant UNUSED_2(0x0B) // nothing - //constant UNUSED_3(0x0C) // nothing - constant RTTF(0x0D) // 0x0C = 0x80137778, 0x01 = 0x0B - //constant UNUSED_4(0x0E) // nothing - constant STAND(0x0F) // 0x0C = 0x80137A18 - constant WALK(0x10) // 0x0C = 0x80137AA4 - constant EVADE(0x11) // 0x0C = 0x80137C7C - constant JUMP(0x12) // 0x0C = 0x80137CD8 - constant UNKNOWN_3(0x13) // 0x0C = 0x80137E70 - } - } - - // @ Description - // Third, run - // Runs the main behaviour subroutine. (usually is 0x80137778) - // If still performing a controller command, exit. - scope CALCULATE_INPUT: { - - // Run the main subroutine to determine the state. Then runs the state. - - // @ Description - // This is the usually routine that handles SSB's AI - scope DEFAULT: { - constant MAIN(0x80137778) - - - // Checks own action to decide next input - scope ACTION_CHECK: { - constant MAIN(0x80136D0C) - - // BRANCH LOCATIONS - // 0x80136D20 if Action.CliffWait - // 0x80136E20 if Action.DownWaitD/DownWaitU - // 0x80136F4C if Action.Teeter/TeeterStart - // 0x80136F60 if Action.CrouchIdle - // 0x80136F7C if Action.Barrel - // 0x80137024 if Action.GrabPull - // 0x80137074 if Action.InhaleWait - // 0x80137080 if Action.EggLay - // 0x80137088 if Action.Stun - // 0x80137090 if Action.Sleep - // 0x80137098 if Action.ThrownDK - // 0x801370F0 Kirby Check - // 0x80137160 Ness Check - // 0x80137294 branch if not in STAND (training) - // 0x801372D0 branch if unknown timer (0x2C) is not > 300 - // 0x80137300 stick jump if unknown flag? - // 0x8013731C branch if not taken damage - // check if state = YOSHI_TEAM, KIRBY_TEAM, or POLYGON? - // 0x8013759C if Action.Tumble - - - } - - // Loops through each player. Run away from them if they meet a criteria - scope EVADE_CHECK: { - constant MAIN(0x80132BC8) // Returns 1 to change state to EVADE - scope PLAYERS: { - constant OBJ_PTR(0x800466FC) - - // 0x80132BF8 - Skip to end if no players found - - // 0x80132C00 - Load these floats in case cpu wants to run away from them - scope evade_area: { - constant address(0x8018BB90) - constant x_tolerance(2500.0) - constant y_tolerance(1500.0) - constant multiplier(3.0) // magic - } - - // loop through players - // 0x80132C24 - Skip if player = self - // 0x80132C38 - Skip if same team - - // if here, player = enemy - // 0x80132C40 - Get enemy x velocity - // 0x80132C50 - Take enemy coordinates - // 0x80132C88 - skip enemy if they have a star - // 0x80132CAC - check if enemy has an item - // 0x80132CBC - if item = hammer, don't approach - // if they are too close, walk away from them - } - } - - // skip PROJECTILE_CHECK if Character.ID = METAL - // skip PROJECTILE_CHECK if Character.ID = GDK - // Remix skips projectile check for GBOWSER - - // @ Description - // Change state if a hazard is near - scope HAZARD_CHECK: { - constant MAIN(0x80135B78) - scope PROJECTILES: { - constant OBJECT_PTR(0x80046704) - scope DANGER_AREA: { - constant unknown_1(9.0) // f28 magic # 0x80135C38 - constant distance(15.0) // f26 magic # 0x80135C40 - constant unknown_2(0.5) // f24 magic # 0x80135C48 - } - // 0x80135C34 - skip if to no active projectiles - // 0x80135C68 - goto 80135CA0 if owner = self - // 0x80135C78 - goto 80135CA0 if a specific mode? - // 0x80135D4C - goto 80135CA0 if projectile is not close? - // 0x80135CA0 - skip if update_interval(0x100) = 0 - // 0x80135CA8 - skip if update_interval(0x100) = 1 - // 0x80135CB8 - skip if tangibility(0x144) = FALSE - // 0x80135CCC - skip if hitbox(0x150) <= 0 - // 0x80135CF8 - skip if projectile not moving towards cpu - - // 0x80135E70 - Check if cpu can reflect/absorb this (character id check) - } - - scope ITEMS: { - constant OBJECT_PTR(0x80046700) - scope DANGER_AREA: { - constant unknown_1(9.0) // f28 magic # 0x80135EE4 - constant distance(15.0)// f26 magic # 0x80135ED4 - constant unknown_2(0.5) // f24 magic # 0x80135C38 - } - // 0x80135EF4 - skip if no active items - // todo: see what is here - - // 0x80136114 - Reflect/Absorb check - } - - } - // IF HAZARD FOUND, SET STATE TO SHIELD - - // ITEM CHECK - // 0x801379B4 - exit routine if no item is in hand - // ^ check if holding crate, barrel, capsule, or egg - // Sets state to ITEM_HAVE if they have another item - - } - - // @ Description - // After the main subroutine is completed, - scope RUN_STATE: { - // 0x8013A3C0 - run the state if v0 != 0 - - constant TABLE(0x8018BF7C) - scope STATE_ID: { - constant NOTHING(0x0) // do nothing - constant MOVE(0x01) // move to a position - constant ATTACK(0x02) // attack a position - constant EVADE(0x03) // runs away from player - constant RECOVER(0x04) // recover to stage - constant UNKNOWN_1(0x05) // ? JAL 0x80138104, Chad walks over and jabs you - constant ITEM_HAVE(0x06) // If they have an item in hand 0x8013815C - constant SHIELD(0x07) // ? JAL 0x80137FD4, shields on and off constantly - constant UNKNOWN_4(0x08) // ? JAL 0x801397F4 - constant YOSHI_TEAM(0x09) // JAL 0x80139A60 - constant UNKNOWN_5(0x0A) // ? JAL 0x80139D6C - constant RTTF(0x0B) // JAL 0x8013A298 - } - - scope STATE: { - - // state 0x02 - scope ATTACK: { - constant MAIN(0x801392C8) - - // returns 1 if valid target found - scope LOCATE_TARGET: { - constant MAIN(0x8013837C) - // checks cpu is yoshi team or Giant DK - // loop through each player - scope TARGET_PLAYER: { - constant MAIN(0x80132D18) - constant PLAYER_1_PTR(0x800466FC) - constant RNG_PTR(0x8003B944) - - // 0x80132D8C branch if player changed percent - - // 0x80132DE8 update target player - } - // 0x80132A10 - // Returns 0 if target is off stage - scope IGNORE_CHECK: { - constant main(0x800F8FFC) - constant clipping_enabled_PTR(0x80131368) - - } - - // branch if IGNORE_CHECK returned 0 - } - - // loops through each - // a0 = target player - scope ATTACK_CHECK: { - constant MAIN(0x80132EC8) - } - - // 0x801332E0 check if target in Action.PASS - // 0x801392D8 branch if no valid target found - - // load the targets coordinates - - // 0x80139384 branch if target is too far away - - // 0x- check if target has a super star? - } - - - - // @ Description - // Used while an item is held by cpu players - scope ITEM_HAVE: { - constant MAIN(0x8013815C) - - // first reads item id, then branch if its crate, capsule or egg - - // 0x80138308 - branch if Item ID < Item.EGG.ID - // 0x80138318 - branch if NOT a Pokeball - } - } - - - } - } + // @ Description + // This is the main routine that handles how a cpu player functions + // There are 3 subroutines which determine the cpus input + // The last subroutine applies the cpu input + scope MANAGE_CPU: { + constant ROUTINE(0x8013A834) + + // skip to the last JAL if still processing a controller command + + // @ Description + // First, read byte 0x05 and sets byte 0x03 + // Overrides the behaviour + scope OVERRIDE: { + constant MAIN(0x8013A63C) + constant TABLE(0x8018BFFC) + + scope TYPE: { + constant DEFAULT(0x00) // ? Used in VS and for some 1P characters + constant LINK(0x01) // Do nothing for a bit (1P Link) + constant YOSHI_TEAM(0x02) // set to 0x07 + constant KIRBY(0x03) // set to 0x08 + constant POLYGON(0x04) // set to 0x09 + constant MARIO_BROS(0x05) // set to 0x03 for Luigi players + constant GIANT_DK(0x06) // set to 0x00 + constant UNKNOWN_1(0x07) // set to 0x02 + constant RTTF(0x08) // set to 0x0D + constant ALLY(0x09) // set to 0x03 + constant TRAINING(0x0A) // No override + } + } + + // @ Description + // Second, read byte 0x03 and sets byte 0x01 + // Sets the main behaviour subroutine + scope SET: { + constant MAIN(0x8013A4AC) + constant TABLE(0x8018BFAC) + + scope STATE: { + constant DEFAULT(0x00) // 0x0C = 0x80137778, 0x01 = 0x02 + constant UNKNOWN_1(0x01) // 0x0C = 0x80137778, 0x01 = 0x03 + constant UNKNOWN_2(0x02) // 0x0C = 0x80137778, 0x01 = 0x08 + constant ALLY(0x03) // 0x0C = 0x80137778, 0x01 = 0x09 + constant FALCON(0x04) // 0x0C = 0x80137778, 0x01 = 0x0A + constant YOSHI_TEAM(0x07) // 0x0C = 0x80137778, 0x01 = 0x09 + constant KIRBY_TEAM(0x08) // 0x0C = 0x80137778, 0x01 = 0x0A + constant POLYGON(0x09) // 0x0C = 0x80137778, 0x01 = 0x02 + //constant UNUSED_1(0x0A) // nothing + //constant UNUSED_2(0x0B) // nothing + //constant UNUSED_3(0x0C) // nothing + constant RTTF(0x0D) // 0x0C = 0x80137778, 0x01 = 0x0B + //constant UNUSED_4(0x0E) // nothing + constant STAND(0x0F) // 0x0C = 0x80137A18 + constant WALK(0x10) // 0x0C = 0x80137AA4 + constant EVADE(0x11) // 0x0C = 0x80137C7C + constant JUMP(0x12) // 0x0C = 0x80137CD8 + constant UNKNOWN_3(0x13) // 0x0C = 0x80137E70 + } + } + + // @ Description + // Third, run + // Runs the main behaviour subroutine. (usually is 0x80137778) + // If still performing a controller command, exit. + scope CALCULATE_INPUT: { + + // Run the main subroutine to determine the state. Then runs the state. + + // @ Description + // This is the usually routine that handles SSB's AI + scope DEFAULT: { + constant MAIN(0x80137778) + + + // Checks own action to decide next input + scope ACTION_CHECK: { + constant MAIN(0x80136D0C) + + // BRANCH LOCATIONS + // 0x80136D20 if Action.CliffWait + // 0x80136E20 if Action.DownWaitD/DownWaitU + // 0x80136F4C if Action.Teeter/TeeterStart + // 0x80136F60 if Action.CrouchIdle + // 0x80136F7C if Action.Barrel + // 0x80137024 if Action.GrabPull + // 0x80137074 if Action.InhaleWait + // 0x80137080 if Action.EggLay + // 0x80137088 if Action.Stun + // 0x80137090 if Action.Sleep + // 0x80137098 if Action.ThrownDK + // 0x801370F0 Kirby Check + // 0x80137160 Ness Check + // 0x80137294 branch if not in STAND (training) + // 0x801372D0 branch if unknown timer (0x2C) is not > 300 + // 0x80137300 stick jump if unknown flag? + // 0x8013731C branch if not taken damage + // check if state = YOSHI_TEAM, KIRBY_TEAM, or POLYGON? + // 0x8013759C if Action.Tumble + + + } + + // Loops through each player. Run away from them if they meet a criteria + scope EVADE_CHECK: { + constant MAIN(0x80132BC8) // Returns 1 to change state to EVADE + scope PLAYERS: { + constant OBJ_PTR(0x800466FC) + + // 0x80132BF8 - Skip to end if no players found + + // 0x80132C00 - Load these floats in case cpu wants to run away from them + scope evade_area: { + constant address(0x8018BB90) + constant x_tolerance(2500.0) + constant y_tolerance(1500.0) + constant multiplier(3.0) // magic + } + + // loop through players + // 0x80132C24 - Skip if player = self + // 0x80132C38 - Skip if same team + + // if here, player = enemy + // 0x80132C40 - Get enemy x velocity + // 0x80132C50 - Take enemy coordinates + // 0x80132C88 - skip enemy if they have a star + // 0x80132CAC - check if enemy has an item + // 0x80132CBC - if item = hammer, don't approach + // if they are too close, walk away from them + } + } + + // skip PROJECTILE_CHECK if Character.ID = METAL + // skip PROJECTILE_CHECK if Character.ID = GDK + // Remix skips projectile check for GBOWSER + + // @ Description + // Change state if a hazard is near + scope HAZARD_CHECK: { + constant MAIN(0x80135B78) + scope PROJECTILES: { + constant OBJECT_PTR(0x80046704) + scope DANGER_AREA: { + constant unknown_1(9.0) // f28 magic # 0x80135C38 + constant distance(15.0) // f26 magic # 0x80135C40 + constant unknown_2(0.5) // f24 magic # 0x80135C48 + } + // 0x80135C34 - skip if to no active projectiles + // 0x80135C68 - goto 80135CA0 if owner = self + // 0x80135C78 - goto 80135CA0 if a specific mode? + // 0x80135D4C - goto 80135CA0 if projectile is not close? + // 0x80135CA0 - skip if update_interval(0x100) = 0 + // 0x80135CA8 - skip if update_interval(0x100) = 1 + // 0x80135CB8 - skip if tangibility(0x144) = FALSE + // 0x80135CCC - skip if hitbox(0x150) <= 0 + // 0x80135CF8 - skip if projectile not moving towards cpu + + // 0x80135E70 - Check if cpu can reflect/absorb this (character id check) + } + + scope ITEMS: { + constant OBJECT_PTR(0x80046700) + scope DANGER_AREA: { + constant unknown_1(9.0) // f28 magic # 0x80135EE4 + constant distance(15.0)// f26 magic # 0x80135ED4 + constant unknown_2(0.5) // f24 magic # 0x80135C38 + } + // 0x80135EF4 - skip if no active items + // todo: see what is here + + // 0x80136114 - Reflect/Absorb check + } + + } + // IF HAZARD FOUND, SET STATE TO SHIELD + + // ITEM CHECK + // 0x801379B4 - exit routine if no item is in hand + // ^ check if holding crate, barrel, capsule, or egg + // Sets state to ITEM_HAVE if they have another item + + } + + // @ Description + // After the main subroutine is completed, + scope RUN_STATE: { + // 0x8013A3C0 - run the state if v0 != 0 + + constant TABLE(0x8018BF7C) + scope STATE_ID: { + constant NOTHING(0x0) // do nothing + constant MOVE(0x01) // move to a position + constant ATTACK(0x02) // attack a position + constant EVADE(0x03) // runs away from player + constant RECOVER(0x04) // recover to stage + constant UNKNOWN_1(0x05) // ? JAL 0x80138104, Chad walks over and jabs you + constant ITEM_HAVE(0x06) // If they have an item in hand 0x8013815C + constant SHIELD(0x07) // ? JAL 0x80137FD4, shields on and off constantly + constant UNKNOWN_4(0x08) // ? JAL 0x801397F4 + constant YOSHI_TEAM(0x09) // JAL 0x80139A60 + constant UNKNOWN_5(0x0A) // ? JAL 0x80139D6C + constant RTTF(0x0B) // JAL 0x8013A298 + } + + scope STATE: { + + // state 0x02 + scope ATTACK: { + constant MAIN(0x801392C8) + + // returns 1 if valid target found + scope LOCATE_TARGET: { + constant MAIN(0x8013837C) + // checks cpu is yoshi team or Giant DK + // loop through each player + scope TARGET_PLAYER: { + constant MAIN(0x80132D18) + constant PLAYER_1_PTR(0x800466FC) + constant RNG_PTR(0x8003B944) + + // 0x80132D8C branch if player changed percent + + // 0x80132DE8 update target player + } + // 0x80132A10 + // Returns 0 if target is off stage + scope IGNORE_CHECK: { + constant main(0x800F8FFC) + constant clipping_enabled_PTR(0x80131368) + + } + + // branch if IGNORE_CHECK returned 0 + } + + // loops through each + // a0 = target player + scope ATTACK_CHECK: { + constant MAIN(0x80132EC8) + } - // @ Description - // Fourth, applies the input that was determined by the previous routines. - // Uses controller commands to set - scope APPLY_INPUT: { - constant MAIN(0x80131C68) - constant TABLE(0x8018B7C0) - } - } + // 0x801332E0 check if target in Action.PASS + // 0x801392D8 branch if no valid target found + + // load the targets coordinates + + // 0x80139384 branch if target is too far away + + // 0x- check if target has a super star? + } + + + + // @ Description + // Used while an item is held by cpu players + scope ITEM_HAVE: { + constant MAIN(0x8013815C) + + // first reads item id, then branch if its crate, capsule or egg + + // 0x80138308 - branch if Item ID < Item.EGG.ID + // 0x80138318 - branch if NOT a Pokeball + } + } + + + } + } + + // @ Description + // Fourth, applies the input that was determined by the previous routines. + // Uses controller commands to set + scope APPLY_INPUT: { + constant MAIN(0x80131C68) + constant TABLE(0x8018B7C0) + } + } // @ Description // Level 10 stuff @@ -2642,155 +2643,155 @@ scope AI { } - // Run away from opponents who are coming off the respawn plat - // However, vanilla AI doesn't seem too great at evading. - scope check_invulnerable_: { - OS.patch_start(0xAD6C4, 0x80132C84) - j check_invulnerable_ - lw t9, 0x05B4(s0) // original line 1, get player invuln flag - OS.patch_end() - - beq s3, t9, _avoid_player - lbu t9, 0x0013(a0) // t6 = cpu level - slti t9, t9, 10 // t9 = 0 if 10 or greater - bnez t9, _normal // do normal logic if not LVL 10 - lw t9, 0x05A4(s0) // get invulnerability timer - - beqz t9, _normal // proceed as normal if not invulnerable - nop - - _avoid_player: - j 0x80132C90 - nop - - _normal: - j 0x80132CAC - lw v0, 0x084C(s0) // original branch line 2 - - } - - // @ Description - // Allows for additional ways to get up a cliff - scope extend_cliff_attack_: { - OS.patch_start(0xB1844, 0x80136E04) - j extend_cliff_attack_ - lbu t9, 0x0013(a0) // t6 = cpu level - OS.patch_end() - - slti t9, t9, 10 // t9 = 0 if 10 or greater - bnez t9, _set_input // do normal logic if not LVL 10 - addiu a1, r0, 0x0004 // a1 = default input (normal getup) - - // if here, choose to attack normally or to jump - jal Global.get_random_int_ // v0 = (random value) - lli a0, 0x2 // a0 = 2 - lw a0, 0x004C(sp) // restore a0 - srl v0, v0, 1 // v0 = v0 >> 1 - beqzl v0, _set_input - addiu a1, r0, ROUTINE.CLIFF_LET_GO // a1 = custom input - - _set_input: - jal 0x80132564 // set cpus input - nop - j 0x80137768 // goto rest of routine. - or v0, r0, r0 - } - - // @ Description - // Instead of taunting, do something else or nothing - scope taunt_replace_: { - OS.patch_start(0xB2194, 0x80137754) - j taunt_replace_ - lbu t6, 0x0013(a0) // t6 = cpu level - OS.patch_end() - - slti at, t6, 10 // at = 0 if 10 or greater - bnez at, _set_input - addiu a1, r0, ROUTINE.TAUNT // do taunt - - - // level_10: - lw t6, 0x0008(a0) // t6 = current character id - addiu at, r0, Character.id.NESS - beq at, t6, _pk_thunder // branch if NESS - addiu at, r0, Character.id.LUCAS - beq at, t6, _pk_thunder // branch if LUCAS - addiu at, r0, Character.id.JNESS - bne at, t6, _no_input // branch if not JNESS - nop - - _pk_thunder: + // Run away from opponents who are coming off the respawn plat + // However, vanilla AI doesn't seem too great at evading. + scope check_invulnerable_: { + OS.patch_start(0xAD6C4, 0x80132C84) + j check_invulnerable_ + lw t9, 0x05B4(s0) // original line 1, get player invuln flag + OS.patch_end() + + beq s3, t9, _avoid_player + lbu t9, 0x0013(a0) // t6 = cpu level + slti t9, t9, 10 // t9 = 0 if 10 or greater + bnez t9, _normal // do normal logic if not LVL 10 + lw t9, 0x05A4(s0) // get invulnerability timer + + beqz t9, _normal // proceed as normal if not invulnerable + nop + + _avoid_player: + j 0x80132C90 + nop + + _normal: + j 0x80132CAC + lw v0, 0x084C(s0) // original branch line 2 + + } + + // @ Description + // Allows for additional ways to get up a cliff + scope extend_cliff_attack_: { + OS.patch_start(0xB1844, 0x80136E04) + j extend_cliff_attack_ + lbu t9, 0x0013(a0) // t6 = cpu level + OS.patch_end() + + slti t9, t9, 10 // t9 = 0 if 10 or greater + bnez t9, _set_input // do normal logic if not LVL 10 + addiu a1, r0, 0x0004 // a1 = default input (normal getup) + + // if here, choose to attack normally or to jump + jal Global.get_random_int_ // v0 = (random value) + lli a0, 0x2 // a0 = 2 + lw a0, 0x004C(sp) // restore a0 + srl v0, v0, 1 // v0 = v0 >> 1 + beqzl v0, _set_input + addiu a1, r0, ROUTINE.CLIFF_LET_GO // a1 = custom input + + _set_input: + jal 0x80132564 // set cpus input + nop + j 0x80137768 // goto rest of routine. + or v0, r0, r0 + } + + // @ Description + // Instead of taunting, do something else or nothing + scope taunt_replace_: { + OS.patch_start(0xB2194, 0x80137754) + j taunt_replace_ + lbu t6, 0x0013(a0) // t6 = cpu level + OS.patch_end() + + slti at, t6, 10 // at = 0 if 10 or greater + bnez at, _set_input + addiu a1, r0, ROUTINE.TAUNT // do taunt + + + // level_10: + lw t6, 0x0008(a0) // t6 = current character id + addiu at, r0, Character.id.NESS + beq at, t6, _pk_thunder // branch if NESS + addiu at, r0, Character.id.LUCAS + beq at, t6, _pk_thunder // branch if LUCAS + addiu at, r0, Character.id.JNESS + bne at, t6, _no_input // branch if not JNESS + nop + + _pk_thunder: // Adding these temporary lines to prevent SD related to PK Thunder b _no_input // temporary line 1 nop // temporary line 2 - b _set_input - addiu a1, r0, ROUTINE.USP // For Ness clones and Lucas - - _set_input: - // a1 = command to take - jal 0x80132564 // execute AI command. original line 1 - nop - _no_input: - j 0x80137768 // original branch - or v0, r0, r0 // original branch line 2 - - } - - // @ Description - // Adds alternate options for LVL 10 cpus to use instead of rolling back and forth. - // Not perfect but better than roll spamming - scope stop_roll_spam_: { - OS.patch_start(0xB3CD4, 0x80139294) - j stop_roll_spam_ - // keep line 2 - OS.patch_end() - OS.patch_start(0xB3CE4, 0x801392A4) - j stop_roll_spam_ - // keep line 2 - OS.patch_end() + b _set_input + addiu a1, r0, ROUTINE.USP // For Ness clones and Lucas + + _set_input: + // a1 = command to take + jal 0x80132564 // execute AI command. original line 1 + nop + _no_input: + j 0x80137768 // original branch + or v0, r0, r0 // original branch line 2 + + } + + // @ Description + // Adds alternate options for LVL 10 cpus to use instead of rolling back and forth. + // Not perfect but better than roll spamming + scope stop_roll_spam_: { + OS.patch_start(0xB3CD4, 0x80139294) + j stop_roll_spam_ + // keep line 2 + OS.patch_end() + OS.patch_start(0xB3CE4, 0x801392A4) + j stop_roll_spam_ + // keep line 2 + OS.patch_end() lw t6, 0x0008(a0) // t6 = character id addiu at, r0, Character.id.GBOWSER beq at, t6, _advanced_ai // automatic advanced AI if GBOWSER - lbu t6, 0x0013(a0) // t6 = cpu level - slti at, t6, 10 // at = 0 if 10 or greater - bnez at, _end // do normal if not LVL 10 + lbu t6, 0x0013(a0) // t6 = cpu level + slti at, t6, 10 // at = 0 if 10 or greater + bnez at, _end // do normal if not LVL 10 + nop + + _advanced_ai: + lw t6, 0x0024(a0) // get current action + lli at, Action.TurnRun + slt at, at, t6 // ~ + bnezl at, _end // ~ + lli a1, ROUTINE.RESET_STICK // Tell the bot to reset stick. Skip if not moving/idle. + + lw t6, 0x0008(a0) // get character ID + sll t6, t6, 2 + li at, Character.close_quarter_combat.table + addu t6, t6, at // t6 = entry + lw t6, 0x0000(t6) // load characters entry in jump table + beqz t6, _continue // use do a short hop aerial attack most likely + nop + jr t6 nop - _advanced_ai: - lw t6, 0x0024(a0) // get current action - lli at, Action.TurnRun - slt at, at, t6 // ~ - bnezl at, _end // ~ - lli a1, ROUTINE.RESET_STICK // Tell the bot to reset stick. Skip if not moving/idle. - - lw t6, 0x0008(a0) // get character ID - sll t6, t6, 2 - li at, Character.close_quarter_combat.table - addu t6, t6, at // t6 = entry - lw t6, 0x0000(t6) // load characters entry in jump table - beqz t6, _continue // use do a short hop aerial attack most likely - nop - jr t6 - nop - - _ness: - b _end - addiu a1, r0, 0x34 // command = Ness double jump cancel. - - _lucas: - jal Global.get_random_int_ // v0 = (random value) - lli a0, 0xFF // ~ - sll at, v0, 31 - beqz at, _continue // 1/2 chance to shine - lw a0, 0x0048(sp) // restore player struct - b _shine - nop - - _yoshi: - b _end - addiu a1, r0, 0x37 // double jump cancel + _ness: + b _end + addiu a1, r0, 0x34 // command = Ness double jump cancel. + + _lucas: + jal Global.get_random_int_ // v0 = (random value) + lli a0, 0xFF // ~ + sll at, v0, 31 + beqz at, _continue // 1/2 chance to shine + lw a0, 0x0048(sp) // restore player struct + b _shine + nop + + _yoshi: + b _end + addiu a1, r0, 0x37 // double jump cancel _fox: lw t0, 0x01FC(a0) // get opponent struct @@ -2812,163 +2813,163 @@ scope AI { _shine_check: jal Global.get_random_int_ // v0 = (random value) - lli a0, 10 // 1 in 10 chance to not shine + lli a0, 10 // 1 in 10 chance to not shine beqz v0, _continue - lw a0, 0x0048(sp) // restore player struct - - _shine: - addiu at, r0, 0x2E // at = rolling forwards command - beql at, a1, _fox_direction_check // branch if opponent to the right - addiu t6, r0, 0x0001 // a0 = direction to match - addiu t6, r0, 0xFFFF // ~ - - _fox_direction_check: - lh at, 0x0046(a0) // at = current direction - bnel at, t6, _end - addiu a1, r0, ROUTINE.MULTI_SHINE_TURNAROUND // custom - - b _end - addiu a1, r0, ROUTINE.MULTI_SHINE // custom - - - b _continue - nop - - ///// kirby - - _kirby: - constant UTILT_DISTANCE(0x4382) - addiu at, r0, 0x2E // at = rolling forwards command - beql at, a1, _kirby_direction_check // branch if opponent to the right - addiu t6, r0, 0x0001 // a0 = direction to match - addiu t6, r0, 0xFFFF // - _kirby_direction_check: - lh at, 0x0046(a0) // at = current direction - beq at, t6, _continue // maybe do a short hop aerial if opponent in front - addiu at, r0, 0x2E // at = rolling forwards command - beq at, a1, _kirby_less_than // branch if opponent is to the right - nop - _kirby_greater_than: - sub.s f6, f0, f6 // f6 = f6 - f0 - nop - b _kirby_compare - nop - _kirby_less_than: - sub.s f6, f8, f0 // f6 = f8 - f0 - nop - _kirby_compare: - abs.s f6, f6 - nop - lui at, UTILT_DISTANCE // at = float 260.0 - mtc1 at, f12 // move at to f12 - c.le.s f6, f12 // code = 1 if distance less than radius - nop - bc1f _continue - nop - b _end - lli a1, ROUTINE.UTILT // do a UTILT if opponent is behind - - _puff: - lw at, 0x01FC(a0) // get target player + lw a0, 0x0048(sp) // restore player struct + + _shine: + addiu at, r0, 0x2E // at = rolling forwards command + beql at, a1, _fox_direction_check // branch if opponent to the right + addiu t6, r0, 0x0001 // a0 = direction to match + addiu t6, r0, 0xFFFF // ~ + + _fox_direction_check: + lh at, 0x0046(a0) // at = current direction + bnel at, t6, _end + addiu a1, r0, ROUTINE.MULTI_SHINE_TURNAROUND // custom + + b _end + addiu a1, r0, ROUTINE.MULTI_SHINE // custom + + + b _continue + nop + + ///// kirby + + _kirby: + constant UTILT_DISTANCE(0x4382) + addiu at, r0, 0x2E // at = rolling forwards command + beql at, a1, _kirby_direction_check // branch if opponent to the right + addiu t6, r0, 0x0001 // a0 = direction to match + addiu t6, r0, 0xFFFF // + _kirby_direction_check: + lh at, 0x0046(a0) // at = current direction + beq at, t6, _continue // maybe do a short hop aerial if opponent in front + addiu at, r0, 0x2E // at = rolling forwards command + beq at, a1, _kirby_less_than // branch if opponent is to the right + nop + _kirby_greater_than: + sub.s f6, f0, f6 // f6 = f6 - f0 + nop + b _kirby_compare + nop + _kirby_less_than: + sub.s f6, f8, f0 // f6 = f8 - f0 + nop + _kirby_compare: + abs.s f6, f6 + nop + lui at, UTILT_DISTANCE // at = float 260.0 + mtc1 at, f12 // move at to f12 + c.le.s f6, f12 // code = 1 if distance less than radius + nop + bc1f _continue + nop + b _end + lli a1, ROUTINE.UTILT // do a UTILT if opponent is behind + + _puff: + lw at, 0x01FC(a0) // get target player beqz at, _continue // branch if no opponent (somehow) nop - lw v0, 0x0084(at) // v0 = target player struct - lh t6, 0x05BA(v0) // t6 = tangibility flag - addiu at, r0, 0x0003 - beq at, t6, _continue // don't try to rest if they are intangible - lli at, 30 // at = 30 hp - lw t6, 0x002C(v0) // t6 = target players hp% - blt at, t6, _continue // skip rest check if player is less than 30 percent - addiu at, r0, 0x2E // at = rolling forwards command - beq at, a1, _puff_less_than // branch if opponent is to the right - nop - _puff_greater_than: - sub.s f6, f0, f6 // f6 = f6 - f0 - nop - b _puff_compare - nop - _puff_less_than: - sub.s f6, f8, f0 // f6 = f8 - f0 - nop - _puff_compare: - abs.s f6, f6 - nop - lui at, 0x4382 // at = float 260.0 - mtc1 at, f12 // move at to f12 - c.le.s f6, f12 // code = 1 if distance less than radius - nop - bc1f _continue - lli a1, ROUTINE.PUFF_SHORT_HOP_DAIR // custom - b _end - lli a1, ROUTINE.DSP // do a DSP if close enough to the enemy - - _continue: - jal Global.get_random_int_ // v0 = (random value) - lli a0, 0xFF // ~ - sll at, v0, 30 - beqz at, _end // 1/4 chance to roll around normally - lw a0, 0x0048(sp) // restore player struct - - // if here then do either a normal shorthop, shorthop dair, or shorthop nair - addiu a1, r0, 0x30 // start of custom commands - 1 - andi at, v0, 3 - addu a1, a1, at // command = 0x31 + random(3) - - _end: - // a1 = command to take (default is a roll. 0x2E or 0x2D) - jal 0x80132564 // execute AI command. original line 1 - nop - j 0x801392B8 // original branch - addiu v0, r0, 0x0001 // ~ + lw v0, 0x0084(at) // v0 = target player struct + lh t6, 0x05BA(v0) // t6 = tangibility flag + addiu at, r0, 0x0003 + beq at, t6, _continue // don't try to rest if they are intangible + lli at, 30 // at = 30 hp + lw t6, 0x002C(v0) // t6 = target players hp% + blt at, t6, _continue // skip rest check if player is less than 30 percent + addiu at, r0, 0x2E // at = rolling forwards command + beq at, a1, _puff_less_than // branch if opponent is to the right + nop + _puff_greater_than: + sub.s f6, f0, f6 // f6 = f6 - f0 + nop + b _puff_compare + nop + _puff_less_than: + sub.s f6, f8, f0 // f6 = f8 - f0 + nop + _puff_compare: + abs.s f6, f6 + nop + lui at, 0x4382 // at = float 260.0 + mtc1 at, f12 // move at to f12 + c.le.s f6, f12 // code = 1 if distance less than radius + nop + bc1f _continue + lli a1, ROUTINE.PUFF_SHORT_HOP_DAIR // custom + b _end + lli a1, ROUTINE.DSP // do a DSP if close enough to the enemy + + _continue: + jal Global.get_random_int_ // v0 = (random value) + lli a0, 0xFF // ~ + sll at, v0, 30 + beqz at, _end // 1/4 chance to roll around normally + lw a0, 0x0048(sp) // restore player struct + + // if here then do either a normal shorthop, shorthop dair, or shorthop nair + addiu a1, r0, 0x30 // start of custom commands - 1 + andi at, v0, 3 + addu a1, a1, at // command = 0x31 + random(3) + + _end: + // a1 = command to take (default is a roll. 0x2E or 0x2D) + jal 0x80132564 // execute AI command. original line 1 + nop + j 0x801392B8 // original branch + addiu v0, r0, 0x0001 // ~ _skip: j 0x801392B8 // original branch addiu v0, r0, 0x0000 // ~ } - // Add characters to roll spam jump-table - // KIRBY - Character.table_patch_start(close_quarter_combat, Character.id.KIRBY, 0x4) - dw stop_roll_spam_._kirby; OS.patch_end() - // EKIRBY - Character.table_patch_start(close_quarter_combat, Character.id.JKIRBY, 0x4) - dw stop_roll_spam_._kirby; OS.patch_end() - // NKIRBY - Character.table_patch_start(close_quarter_combat, Character.id.NKIRBY, 0x4) - dw stop_roll_spam_._kirby; OS.patch_end() - // PUFF - Character.table_patch_start(close_quarter_combat, Character.id.JIGGLYPUFF, 0x4) - dw stop_roll_spam_._puff; OS.patch_end() - // JPUFF - Character.table_patch_start(close_quarter_combat, Character.id.JPUFF, 0x4) - dw stop_roll_spam_._puff; OS.patch_end() - // EPUFF - Character.table_patch_start(close_quarter_combat, Character.id.EPUFF, 0x4) - dw stop_roll_spam_._puff; OS.patch_end() - // FOX - Character.table_patch_start(close_quarter_combat, Character.id.FOX, 0x4) - dw stop_roll_spam_._fox; OS.patch_end() - // JFOX - Character.table_patch_start(close_quarter_combat, Character.id.JFOX, 0x4) - dw stop_roll_spam_._fox; OS.patch_end() - // FALCO - Character.table_patch_start(close_quarter_combat, Character.id.FALCO, 0x4) - dw stop_roll_spam_._fox; OS.patch_end() - // WOLF - Character.table_patch_start(close_quarter_combat, Character.id.WOLF, 0x4) - dw stop_roll_spam_._fox; OS.patch_end() - // NESS - Character.table_patch_start(close_quarter_combat, Character.id.NESS, 0x4) - dw stop_roll_spam_._ness; OS.patch_end() - // NNESS - Character.table_patch_start(close_quarter_combat, Character.id.NNESS, 0x4) - dw stop_roll_spam_._ness; OS.patch_end() - // JNESS - Character.table_patch_start(close_quarter_combat, Character.id.JNESS, 0x4) - dw stop_roll_spam_._ness; OS.patch_end() - // LUCAS - Character.table_patch_start(close_quarter_combat, Character.id.LUCAS, 0x4) - dw stop_roll_spam_._lucas; OS.patch_end() + // Add characters to roll spam jump-table + // KIRBY + Character.table_patch_start(close_quarter_combat, Character.id.KIRBY, 0x4) + dw stop_roll_spam_._kirby; OS.patch_end() + // EKIRBY + Character.table_patch_start(close_quarter_combat, Character.id.JKIRBY, 0x4) + dw stop_roll_spam_._kirby; OS.patch_end() + // NKIRBY + Character.table_patch_start(close_quarter_combat, Character.id.NKIRBY, 0x4) + dw stop_roll_spam_._kirby; OS.patch_end() + // PUFF + Character.table_patch_start(close_quarter_combat, Character.id.JIGGLYPUFF, 0x4) + dw stop_roll_spam_._puff; OS.patch_end() + // JPUFF + Character.table_patch_start(close_quarter_combat, Character.id.JPUFF, 0x4) + dw stop_roll_spam_._puff; OS.patch_end() + // EPUFF + Character.table_patch_start(close_quarter_combat, Character.id.EPUFF, 0x4) + dw stop_roll_spam_._puff; OS.patch_end() + // FOX + Character.table_patch_start(close_quarter_combat, Character.id.FOX, 0x4) + dw stop_roll_spam_._fox; OS.patch_end() + // JFOX + Character.table_patch_start(close_quarter_combat, Character.id.JFOX, 0x4) + dw stop_roll_spam_._fox; OS.patch_end() + // FALCO + Character.table_patch_start(close_quarter_combat, Character.id.FALCO, 0x4) + dw stop_roll_spam_._fox; OS.patch_end() + // WOLF + Character.table_patch_start(close_quarter_combat, Character.id.WOLF, 0x4) + dw stop_roll_spam_._fox; OS.patch_end() + // NESS + Character.table_patch_start(close_quarter_combat, Character.id.NESS, 0x4) + dw stop_roll_spam_._ness; OS.patch_end() + // NNESS + Character.table_patch_start(close_quarter_combat, Character.id.NNESS, 0x4) + dw stop_roll_spam_._ness; OS.patch_end() + // JNESS + Character.table_patch_start(close_quarter_combat, Character.id.JNESS, 0x4) + dw stop_roll_spam_._ness; OS.patch_end() + // LUCAS + Character.table_patch_start(close_quarter_combat, Character.id.LUCAS, 0x4) + dw stop_roll_spam_._lucas; OS.patch_end() // SLIPPY Character.table_patch_start(close_quarter_combat, Character.id.SLIPPY, 0x4) dw stop_roll_spam_._fox; OS.patch_end() @@ -2980,93 +2981,93 @@ scope AI { dw stop_roll_spam_._skip; OS.patch_end() - // @ Description - // Allows cpus to perform a shield drop instead of a normal plat drop - scope shield_drop_: { - OS.patch_start(0xB057C, 0x80135B3C) - j shield_drop_ - addiu a1, r0, ROUTINE.STICK_DOWN // control routine to run. original line 2 - _return: - OS.patch_end() + // @ Description + // Allows cpus to perform a shield drop instead of a normal plat drop + scope shield_drop_: { + OS.patch_start(0xB057C, 0x80135B3C) + j shield_drop_ + addiu a1, r0, ROUTINE.STICK_DOWN // control routine to run. original line 2 + _return: + OS.patch_end() - lbu at, 0x0013(a0) // at = cpu level - slti at, at, 10 // at = 0 if 10 or greater - bnez at, _end // do normal if not LVL 10 - nop + lbu at, 0x0013(a0) // at = cpu level + slti at, at, 10 // at = 0 if 10 or greater + bnez at, _end // do normal if not LVL 10 + nop - _advanced_ai: - lw at, 0x0024(a0) // at = current action - addiu a1, r0, Action.Idle - beql at, a1, _end // only shield drop if idle - addiu a1, r0, ROUTINE.SHIELD_DROP// a1 = custom shield drop routine - addiu a1, r0, ROUTINE.STICK_DOWN // control routine to run. original line 2 + _advanced_ai: + lw at, 0x0024(a0) // at = current action + addiu a1, r0, Action.Idle + beql at, a1, _end // only shield drop if idle + addiu a1, r0, ROUTINE.SHIELD_DROP// a1 = custom shield drop routine + addiu a1, r0, ROUTINE.STICK_DOWN // control routine to run. original line 2 - _end: - // a1 = command to take - jal 0x80132564 // execute AI command. original line 1 - nop - j 0x80135B68 // original branch - lw ra, 0x0024(sp) // original branch line + _end: + // a1 = command to take + jal 0x80132564 // execute AI command. original line 1 + nop + j 0x80135B68 // original branch + lw ra, 0x0024(sp) // original branch line - } + } - // @ Description - // Adds DSP for LVL 10 JigglyPuffs to use - scope Puff_DSP_: { + // @ Description + // Adds DSP for LVL 10 JigglyPuffs to use + scope Puff_DSP_: { - // These patches will prevent non-level 10 puffs from using DSP - // JIGGLYPUFF - Character.table_patch_start(ai_attack_prevent, Character.id.JIGGLYPUFF, 0x4) - dw PREVENT_ATTACK.ROUTINE.PUFF_DSP - OS.patch_end() + // These patches will prevent non-level 10 puffs from using DSP + // JIGGLYPUFF + Character.table_patch_start(ai_attack_prevent, Character.id.JIGGLYPUFF, 0x4) + dw PREVENT_ATTACK.ROUTINE.PUFF_DSP + OS.patch_end() - // JPUFF - Character.table_patch_start(ai_attack_prevent, Character.id.JPUFF, 0x4) - dw PREVENT_ATTACK.ROUTINE.PUFF_DSP - OS.patch_end() + // JPUFF + Character.table_patch_start(ai_attack_prevent, Character.id.JPUFF, 0x4) + dw PREVENT_ATTACK.ROUTINE.PUFF_DSP + OS.patch_end() - // EPUFF - Character.table_patch_start(ai_attack_prevent, Character.id.EPUFF, 0x4) - dw PREVENT_ATTACK.ROUTINE.PUFF_DSP - OS.patch_end() + // EPUFF + Character.table_patch_start(ai_attack_prevent, Character.id.EPUFF, 0x4) + dw PREVENT_ATTACK.ROUTINE.PUFF_DSP + OS.patch_end() - // Add DSP as an option to Puffs attack behaviour table - constant CPU_ATTACKS_ORIGIN(0x1026A4) - constant dsp_padding(40) - edit_attack_behavior(CPU_ATTACKS_ORIGIN, DSPA, -1, 1, 1, -130 - dsp_padding, 130 + dsp_padding, 20 - dsp_padding, 280 + dsp_padding) - edit_attack_behavior(CPU_ATTACKS_ORIGIN, DSPG, -1, 1, 1, -130 - dsp_padding, 130 + dsp_padding, 20 - dsp_padding, 280 + dsp_padding) + // Add DSP as an option to Puffs attack behaviour table + constant CPU_ATTACKS_ORIGIN(0x1026A4) + constant dsp_padding(40) + edit_attack_behavior(CPU_ATTACKS_ORIGIN, DSPA, -1, 1, 1, -130 - dsp_padding, 130 + dsp_padding, 20 - dsp_padding, 280 + dsp_padding) + edit_attack_behavior(CPU_ATTACKS_ORIGIN, DSPG, -1, 1, 1, -130 - dsp_padding, 130 + dsp_padding, 20 - dsp_padding, 280 + dsp_padding) - } + } - // @ Description - // Helps level 10 Fox not spam his up special - scope Fox_USP_: { + // @ Description + // Helps level 10 Fox not spam his up special + scope Fox_USP_: { - // These patches will allow LVL 10 fox to not rely on his up special - // JIGGLYPUFF - Character.table_patch_start(ai_attack_prevent, Character.id.FOX, 0x4) - dw PREVENT_ATTACK.ROUTINE.FOX_USP - OS.patch_end() + // These patches will allow LVL 10 fox to not rely on his up special + // JIGGLYPUFF + Character.table_patch_start(ai_attack_prevent, Character.id.FOX, 0x4) + dw PREVENT_ATTACK.ROUTINE.FOX_USP + OS.patch_end() - // JFOX - Character.table_patch_start(ai_attack_prevent, Character.id.JFOX, 0x4) - dw PREVENT_ATTACK.ROUTINE.FOX_USP - OS.patch_end() + // JFOX + Character.table_patch_start(ai_attack_prevent, Character.id.JFOX, 0x4) + dw PREVENT_ATTACK.ROUTINE.FOX_USP + OS.patch_end() - // SLIPPY - Character.table_patch_start(ai_attack_prevent, Character.id.SLIPPY, 0x4) - dw PREVENT_ATTACK.ROUTINE.FOX_USP - OS.patch_end() + // SLIPPY + Character.table_patch_start(ai_attack_prevent, Character.id.SLIPPY, 0x4) + dw PREVENT_ATTACK.ROUTINE.FOX_USP + OS.patch_end() - // FALCO - Character.table_patch_start(ai_attack_prevent, Character.id.FALCO, 0x4) - dw PREVENT_ATTACK.ROUTINE.FOX_USP - OS.patch_end() + // FALCO + Character.table_patch_start(ai_attack_prevent, Character.id.FALCO, 0x4) + dw PREVENT_ATTACK.ROUTINE.FOX_USP + OS.patch_end() - } + } // @ Description // Adds DI to CPU behavior @@ -3153,10 +3154,10 @@ scope AI { jal Global.get_random_int_ // v0 = [1, 8] lli a0, 0x0009 // a0 = 9 - beqzl a0, _end // if 0, then don't DI + beqzl v0, _end // if 0, then don't DI lw t8, 0x8340(t8) // original line 2 - addiu a0, a0, -0x0001 // a0 = index, maybe + addiu t0, v0, -0x0001 // t0 = index, maybe sltiu t1, t0, 0x0003 // t1 = 1 if [0, 3] li t8, smash_di_table + 0x10 // t8 = smash_di_table, medium strength @@ -3178,10 +3179,10 @@ scope AI { jal Global.get_random_int_ // v0 = [1, 8] lli a0, 0x0009 // a0 = 9 - beqzl a0, _end // if 0, then don't DI + beqzl v0, _end // if 0, then don't DI lw t8, 0x8340(t8) // original line 2 - addiu a0, a0, -0x0001 // a0 = index, maybe + addiu t0, v0, -0x0001 // a0 = index, maybe sltiu t1, t0, 0x0003 // t1 = 1 if [0, 3] li t8, smash_di_table // t8 = smash_di_table, high strength @@ -3228,65 +3229,65 @@ scope AI { dw DI_SLIDE_LOW_DOWN } - // @ Description - // Allow level 10 in CSS. Also allows for all Handicaps to be used. - scope VS_CSS: { - scope TABLE { - constant STRUCT(0x8009EDD0) - } - - // Handles right arrow press - scope handle_right_arrow_press_: { - OS.patch_start(0x133AC8, 0x80135848) - jal handle_right_arrow_press_ - lw t8, 0x0000(s2) // original line 1 - get current value - OS.patch_end() - - // s0 = CSS panel struct - - lw t0, 0x0084(s0) // t0 = type (0 = HMN, 1 = CPU) - beqzl t0, _end // if Human, then this is Handicap - lli t0, 0x0028 // t0 = 40 = max Handicap value - - lli t0, 0x000A // t0 = 10 = max CPU Level value - - _end: - jr ra - slt at, t8, t0 // original line 2 modified from slti - } - - // Occurs when going from 2 to 1 (left arrow press) - OS.patch_start(0x134D44, 0x80136AC4) - b 0x80136B2C // original line 1 modified to point to jal for render_right_arrow_ - OS.patch_end() - - // 0x80136B2C - // Check to determine if right arrow should be rendered - scope render_right_arrow_: { - OS.patch_start(0x134DAC, 0x80136B2C) - jal render_right_arrow_ - sll t7, s3, 0x0002 // t7 = port * 4 - bne s1, at, 0x80136B5C // original line 2 (line 3 and 4 are identical, so we can overwrite 3) - OS.patch_end() - - // s8 = CSS panel struct p1 - // s3 = port - subu t7, t7, s3 // t7 = port * 3 - sll t7, t7, 0x0004 // t7 = port * 0x30 - subu t7, t7, s3 // t7 = port * 0x2F - sll t7, t7, 0x0002 // t7 = port * 0xBC = offset to CSS panel struct - addu t7, s8, t7 // t7 = CSS panel struct - - lw t7, 0x0084(t7) // t7 = type (0 = HMN, 1 = CPU) - beqzl t7, _end // if Human, then this is Handicap - lli at, 0x0028 // at = 40 = max Handicap value - - lli at, 0x000A // at = 10 = max CPU Level value - - _end: - jr ra - nop - } + // @ Description + // Allow level 10 in CSS. Also allows for all Handicaps to be used. + scope VS_CSS: { + scope TABLE { + constant STRUCT(0x8009EDD0) + } + + // Handles right arrow press + scope handle_right_arrow_press_: { + OS.patch_start(0x133AC8, 0x80135848) + jal handle_right_arrow_press_ + lw t8, 0x0000(s2) // original line 1 - get current value + OS.patch_end() + + // s0 = CSS panel struct + + lw t0, 0x0084(s0) // t0 = type (0 = HMN, 1 = CPU) + beqzl t0, _end // if Human, then this is Handicap + lli t0, 0x0028 // t0 = 40 = max Handicap value + + lli t0, 0x000A // t0 = 10 = max CPU Level value + + _end: + jr ra + slt at, t8, t0 // original line 2 modified from slti + } + + // Occurs when going from 2 to 1 (left arrow press) + OS.patch_start(0x134D44, 0x80136AC4) + b 0x80136B2C // original line 1 modified to point to jal for render_right_arrow_ + OS.patch_end() + + // 0x80136B2C + // Check to determine if right arrow should be rendered + scope render_right_arrow_: { + OS.patch_start(0x134DAC, 0x80136B2C) + jal render_right_arrow_ + sll t7, s3, 0x0002 // t7 = port * 4 + bne s1, at, 0x80136B5C // original line 2 (line 3 and 4 are identical, so we can overwrite 3) + OS.patch_end() + + // s8 = CSS panel struct p1 + // s3 = port + subu t7, t7, s3 // t7 = port * 3 + sll t7, t7, 0x0004 // t7 = port * 0x30 + subu t7, t7, s3 // t7 = port * 0x2F + sll t7, t7, 0x0002 // t7 = port * 0xBC = offset to CSS panel struct + addu t7, s8, t7 // t7 = CSS panel struct + + lw t7, 0x0084(t7) // t7 = type (0 = HMN, 1 = CPU) + beqzl t7, _end // if Human, then this is Handicap + lli at, 0x0028 // at = 40 = max Handicap value + + lli at, 0x000A // at = 10 = max CPU Level value + + _end: + jr ra + nop + } // Renders 10 for CPU Level or the appropriate Handicap indicators scope render_10_: { @@ -3306,127 +3307,127 @@ scope AI { OS.patch_end() _render_1: - // 0x0028(sp) = CSS panel struct + // 0x0028(sp) = CSS panel struct // t6 = CPU level / Handicap - lw at, 0x0028(sp) // at = CSS panel struct - lw at, 0x0084(at) // at = type (0 = HMN, 1 = CPU) - beqz at, _handicap // if Human, then this is Handicap + lw at, 0x0028(sp) // at = CSS panel struct + lw at, 0x0084(at) // at = type (0 = HMN, 1 = CPU) + beqz at, _handicap // if Human, then this is Handicap lli at, 0x000A // at = 10 beql t6, at, pc() + 8 // if level 10... lw t9, 0x003C(sp) // ...then set the offset to be for "1" - _render_number_return: + _render_number_return: jr ra lw a0, 0x0034(sp) // original line 2 - a0 = CPU level object - _handicap: - slt at, t6, at // at = 1 if less than 10 - bnez at, _render_number_return // if less than 10, just render the number - addiu t0, t6, -0x000A // t0 = index in handicap.table - - // if 10 or higher, then we'll render icons for indicators - li at, handicap.table - sll t0, t0, 0x0001 // t0 = offset to handicap indicator info - addu at, at, t0 // at = handicap indicator info - lbu t1, 0x0001(at) // t1 = level - sw t1, 0x0030(sp) // save level to stack - lb t0, 0x0000(at) // t0 = icon - bltz t0, _use_css_images // if not a char_id, then we'll use the CSS images file + _handicap: + slt at, t6, at // at = 1 if less than 10 + bnez at, _render_number_return // if less than 10, just render the number + addiu t0, t6, -0x000A // t0 = index in handicap.table + + // if 10 or higher, then we'll render icons for indicators + li at, handicap.table + sll t0, t0, 0x0001 // t0 = offset to handicap indicator info + addu at, at, t0 // at = handicap indicator info + lbu t1, 0x0001(at) // t1 = level + sw t1, 0x0030(sp) // save level to stack + lb t0, 0x0000(at) // t0 = icon + bltz t0, _use_css_images // if not a char_id, then we'll use the CSS images file lw a0, 0x0034(sp) // a0 = Handicap value object - li t1, 0x80116E10 // t1 = main character struct table - sll t2, t0, 0x0002 // t2 = t0 * 4 (offset in struct table) - addu t1, t1, t2 // t1 = pointer to character struct - lw t1, 0x0000(t1) // t1 = character struct - lw t2, 0x0028(t1) // t2 = main character file address pointer - lw t2, 0x0000(t2) // t2 = main character file address - lw t1, 0x0060(t1) // t1 = offset to attribute data - addu t1, t2, t1 // t1 = attribute data address - lw t1, 0x0340(t1) // t1 = pointer to stock icon footer address - b _draw_icon - lw a1, 0x0000(t1) // a1 = stock icon footer address - - _use_css_images: - addiu sp, sp, -0x0030 // allocate stack space - sw a0, 0x0004(sp) // save registers - sw at, 0x0008(sp) // ~ - - // make sure CSS images file is loaded (this can run before setup_) - Render.load_file(File.CSS_IMAGES, Render.file_pointer_2) // load CSS images into file_pointer_2 - - lw a0, 0x0004(sp) // load registers - lw at, 0x0008(sp) // ~ - addiu sp, sp, 0x0030 // deallocate stack space - - lbu t0, 0x0000(at) // t0 = icon type - li a1, Render.file_pointer_2 // a1 = pointer to CSS images file start address - lw a1, 0x0000(a1) // a1 = base file address - lli t1, handicap.type.POLYGON_TEAM - beql t0, t1, _draw_icon // if polygon, use polygon icon - addiu a1, a1, CharacterSelect.VARIANT_ICON_OFFSET.POLYGON // a1 = address of polygon icon image - lli t1, handicap.type.METAL - beql t0, t1, _draw_icon // if metal mario, use metal mario icon - addiu a1, a1, CharacterSelect.VARIANT_ICON_OFFSET.METAL // a1 = address of metal mario icon image - // if here, then masterhand - addiu a1, a1, CharacterSelect.VARIANT_ICON_OFFSET.MASTER_HAND // a1 = address of masterhand icon image - - _draw_icon: - jal Render.TEXTURE_INIT_ // v0 = RAM address of texture struct - addiu sp, sp, -0x0030 // allocate stack space for TEXTURE_INIT_ - addiu sp, sp, 0x0030 // restore stack space - - lw at, 0x0028(sp) // at = CSS panel struct - lw at, 0x0020(at) // at = Handicap texture object - lw at, 0x0074(at) // at = Handicap image struct - lwc1 f0, 0x0058(at) // f0 = Handicap x position - lui at, 0x4204 // at = x offset - mtc1 at, f2 // f2 = x offset - add.s f0, f0, f2 // f0 = x position - lui at, 0x4347 // at = y position - swc1 f0, 0x0058(v0) // set X position - sw at, 0x005C(v0) // set Y position - lli a1, 0x0201 - sh a1, 0x0024(v0) // turn on blur - - // now draw a rectangle colored for 1p difficulty - lw t1, 0x0030(sp) // t1 = type - beqz t1, _end_handicap // if type is NONE, skip - lui t0, 0x8014 - lw t0, 0xC4A4(t0) // t0 = file 0x000 address - addiu a1, t0, 0x330 // a1 = address of a rectangle + li t1, 0x80116E10 // t1 = main character struct table + sll t2, t0, 0x0002 // t2 = t0 * 4 (offset in struct table) + addu t1, t1, t2 // t1 = pointer to character struct + lw t1, 0x0000(t1) // t1 = character struct + lw t2, 0x0028(t1) // t2 = main character file address pointer + lw t2, 0x0000(t2) // t2 = main character file address + lw t1, 0x0060(t1) // t1 = offset to attribute data + addu t1, t2, t1 // t1 = attribute data address + lw t1, 0x0340(t1) // t1 = pointer to stock icon footer address + b _draw_icon + lw a1, 0x0000(t1) // a1 = stock icon footer address + + _use_css_images: + addiu sp, sp, -0x0030 // allocate stack space + sw a0, 0x0004(sp) // save registers + sw at, 0x0008(sp) // ~ + + // make sure CSS images file is loaded (this can run before setup_) + Render.load_file(File.CSS_IMAGES, Render.file_pointer_2) // load CSS images into file_pointer_2 + + lw a0, 0x0004(sp) // load registers + lw at, 0x0008(sp) // ~ + addiu sp, sp, 0x0030 // deallocate stack space + + lbu t0, 0x0000(at) // t0 = icon type + li a1, Render.file_pointer_2 // a1 = pointer to CSS images file start address + lw a1, 0x0000(a1) // a1 = base file address + lli t1, handicap.type.POLYGON_TEAM + beql t0, t1, _draw_icon // if polygon, use polygon icon + addiu a1, a1, CharacterSelect.VARIANT_ICON_OFFSET.POLYGON // a1 = address of polygon icon image + lli t1, handicap.type.METAL + beql t0, t1, _draw_icon // if metal mario, use metal mario icon + addiu a1, a1, CharacterSelect.VARIANT_ICON_OFFSET.METAL // a1 = address of metal mario icon image + // if here, then masterhand + addiu a1, a1, CharacterSelect.VARIANT_ICON_OFFSET.MASTER_HAND // a1 = address of masterhand icon image + + _draw_icon: + jal Render.TEXTURE_INIT_ // v0 = RAM address of texture struct + addiu sp, sp, -0x0030 // allocate stack space for TEXTURE_INIT_ + addiu sp, sp, 0x0030 // restore stack space + + lw at, 0x0028(sp) // at = CSS panel struct + lw at, 0x0020(at) // at = Handicap texture object + lw at, 0x0074(at) // at = Handicap image struct + lwc1 f0, 0x0058(at) // f0 = Handicap x position + lui at, 0x4204 // at = x offset + mtc1 at, f2 // f2 = x offset + add.s f0, f0, f2 // f0 = x position + lui at, 0x4347 // at = y position + swc1 f0, 0x0058(v0) // set X position + sw at, 0x005C(v0) // set Y position + lli a1, 0x0201 + sh a1, 0x0024(v0) // turn on blur + + // now draw a rectangle colored for 1p difficulty + lw t1, 0x0030(sp) // t1 = type + beqz t1, _end_handicap // if type is NONE, skip + lui t0, 0x8014 + lw t0, 0xC4A4(t0) // t0 = file 0x000 address + addiu a1, t0, 0x330 // a1 = address of a rectangle lw a0, 0x0034(sp) // a0 = Handicap value object - jal Render.TEXTURE_INIT_ // v0 = RAM address of texture struct - addiu sp, sp, -0x0030 // allocate stack space for TEXTURE_INIT_ - addiu sp, sp, 0x0030 // restore stack space - - lli t0, 0x0003 // t0 = height - sh t0, 0x003C(v0) // set height - lui t0, 0x4352 // Y position - sw t0, 0x005C(v0) // set Y position - lw t0, 0x000C(v0) // t0 = icon image struct - lw t0, 0x0058(t0) // t0 = X position - sw t0, 0x0058(v0) // set X position - lli a1, 0x0201 - sh a1, 0x0024(v0) // turn on blur - - li t0, level_colors - lw t1, 0x0030(sp) // t1 = type - addiu t1, t1, -0x0001 // t1 = index in colors table - sll t1, t1, 0x0002 // t1 = offset in colors table - addu t0, t0, t1 // t0 = address of color - lw t0, 0x0000(t0) // t0 = color - sw t0, 0x0028(v0) // set color - - _end_handicap: - // skip rendering numbers - j 0x80136FF8 - nop - - level_colors: - dw 0x416FE4FF // Very Easy - dw 0x8DBB5AFF // Easy - dw 0xE4BE41FF // Normal - dw 0xE47841FF // Hard - dw 0xE44141FF // Very Hard + jal Render.TEXTURE_INIT_ // v0 = RAM address of texture struct + addiu sp, sp, -0x0030 // allocate stack space for TEXTURE_INIT_ + addiu sp, sp, 0x0030 // restore stack space + + lli t0, 0x0003 // t0 = height + sh t0, 0x003C(v0) // set height + lui t0, 0x4352 // Y position + sw t0, 0x005C(v0) // set Y position + lw t0, 0x000C(v0) // t0 = icon image struct + lw t0, 0x0058(t0) // t0 = X position + sw t0, 0x0058(v0) // set X position + lli a1, 0x0201 + sh a1, 0x0024(v0) // turn on blur + + li t0, level_colors + lw t1, 0x0030(sp) // t1 = type + addiu t1, t1, -0x0001 // t1 = index in colors table + sll t1, t1, 0x0002 // t1 = offset in colors table + addu t0, t0, t1 // t0 = address of color + lw t0, 0x0000(t0) // t0 = color + sw t0, 0x0028(v0) // set color + + _end_handicap: + // skip rendering numbers + j 0x80136FF8 + nop + + level_colors: + dw 0x416FE4FF // Very Easy + dw 0x8DBB5AFF // Easy + dw 0xE4BE41FF // Normal + dw 0xE47841FF // Hard + dw 0xE44141FF // Very Hard _render_0: lw t6, 0x002C(sp) // t6 = CPU level @@ -3459,243 +3460,243 @@ scope AI { jr ra nop - scope handicap { - scope type { - constant POLYGON_TEAM(0xFD) - constant METAL(0xFE) - constant MASTER_HAND(0xFF) - } - scope level { - constant NONE(0) - constant VERY_EASY(1) - constant EASY(2) - constant NORMAL(3) - constant HARD(4) - constant VERY_HARD(5) - } - - table: - db Character.id.YOSHI, level.VERY_EASY - db Character.id.YOSHI, level.EASY - db Character.id.YOSHI, level.NORMAL - db Character.id.YOSHI, level.HARD - db Character.id.YOSHI, level.VERY_HARD - db Character.id.KIRBY, level.VERY_EASY - db Character.id.KIRBY, level.EASY - db Character.id.KIRBY, level.NORMAL - db Character.id.KIRBY, level.HARD - db Character.id.KIRBY, level.VERY_HARD - db type.POLYGON_TEAM, level.VERY_EASY - db type.POLYGON_TEAM, level.EASY - db type.POLYGON_TEAM, level.NORMAL - db type.POLYGON_TEAM, level.HARD - db type.POLYGON_TEAM, level.VERY_HARD - db Character.id.DK, level.VERY_EASY - db Character.id.DK, level.EASY - db Character.id.DK, level.NORMAL - db Character.id.DK, level.HARD - db Character.id.DK, level.VERY_HARD - db type.METAL, level.VERY_EASY - db type.METAL, level.EASY - db type.METAL, level.NORMAL - db type.METAL, level.HARD - db type.METAL, level.VERY_HARD - db type.MASTER_HAND, level.VERY_EASY - db type.MASTER_HAND, level.EASY - db type.MASTER_HAND, level.NORMAL - db type.MASTER_HAND, level.HARD - db type.MASTER_HAND, level.VERY_HARD - db Character.id.SAMUS, level.NONE - OS.align(4) - } + scope handicap { + scope type { + constant POLYGON_TEAM(0xFD) + constant METAL(0xFE) + constant MASTER_HAND(0xFF) + } + scope level { + constant NONE(0) + constant VERY_EASY(1) + constant EASY(2) + constant NORMAL(3) + constant HARD(4) + constant VERY_HARD(5) + } + + table: + db Character.id.YOSHI, level.VERY_EASY + db Character.id.YOSHI, level.EASY + db Character.id.YOSHI, level.NORMAL + db Character.id.YOSHI, level.HARD + db Character.id.YOSHI, level.VERY_HARD + db Character.id.KIRBY, level.VERY_EASY + db Character.id.KIRBY, level.EASY + db Character.id.KIRBY, level.NORMAL + db Character.id.KIRBY, level.HARD + db Character.id.KIRBY, level.VERY_HARD + db type.POLYGON_TEAM, level.VERY_EASY + db type.POLYGON_TEAM, level.EASY + db type.POLYGON_TEAM, level.NORMAL + db type.POLYGON_TEAM, level.HARD + db type.POLYGON_TEAM, level.VERY_HARD + db Character.id.DK, level.VERY_EASY + db Character.id.DK, level.EASY + db Character.id.DK, level.NORMAL + db Character.id.DK, level.HARD + db Character.id.DK, level.VERY_HARD + db type.METAL, level.VERY_EASY + db type.METAL, level.EASY + db type.METAL, level.NORMAL + db type.METAL, level.HARD + db type.METAL, level.VERY_HARD + db type.MASTER_HAND, level.VERY_EASY + db type.MASTER_HAND, level.EASY + db type.MASTER_HAND, level.NORMAL + db type.MASTER_HAND, level.HARD + db type.MASTER_HAND, level.VERY_HARD + db Character.id.SAMUS, level.NONE + OS.align(4) + } + } + } + + + // @ Description + // asm fixes and so LVL 10 works in normal gameplay without causing issues for the other cpu levels + scope fixes: { + + // occurs often + scope clamp_level_9_1: { + OS.patch_start(0xACFD0, 0x80132590) + j clamp_level_9_1 + // keeping original line 2 + _return: + OS.patch_end() + + lbu t7, 0x0013(a0) // original line + slti v1, t7, 10 // v1 = 0 if 10 or greater + beqzl v1, pc() + 8 + lli t7, 9 // if above 9, clamp to 9 + + j _return + 0x8 + addiu v1, a0, 0x01CC // original line 3 + } + + // occurs often + scope clamp_level_9_2: { + OS.patch_start(0xB2ED0, 0x80138490) + j clamp_level_9_2 + // keeping original line 2 + _return: + OS.patch_end() + + lbu t7, 0x0013(a0) // original line + slti t0, t7, 10 // t0 = 0 if 10 or greater + beqzl t0, pc() + 8 + lli t7, 9 // if above 9, clamp to 9 + + j _return + 0x8 + addiu t0, r0, 0x0001 // original line 3 + } + + // while aerial against an opponent + scope clamp_level_9_3: { + OS.patch_start(0xAD0A4, 0x80132664) + j clamp_level_9_3 + // keeping original line 2 + _return: + OS.patch_end() + + lbu t2, 0x0013(a0) // original line + slti v0, t2, 10 // v0 = 0 if 10 or greater + beqzl v0, pc() + 8 + lli t2, 9 // if above 9, clamp to 9 + + j _return + 0x8 + subu v0, t3, t2 // original line 3 + } + + // ? + scope clamp_level_9_4: { + OS.patch_start(0xB3568, 0x80138B28) + j clamp_level_9_4 + // keeping original line 2 + _return: + OS.patch_end() + + lbu t8, 0x0013(s0) // original line + slti t2, t8, 10 // t2 = 0 if 10 or greater + beqzl t2, pc() + 8 + lli t8, 9 // if above 9, clamp to 9 + + j _return + 0x8 + addiu t2, r0, 0x0001 // original line 3 + } + + // ? + scope clamp_level_9_5: { + OS.patch_start(0xAD1E4, 0x801327A4) + j clamp_level_9_5 + // keeping original line 2 + _return: + OS.patch_end() + + lbu t7, 0x0013(a0) // original line + slti at, t7, 10 // at = 0 if 10 or greater + beqzl at, pc() + 8 + lli t7, 9 // if above 9, clamp to 9 + + j _return + 0x8 + lui at, 0x3F80 // original line 3 + } + + // ? + scope clamp_level_9_6: { + OS.patch_start(0xAD2C4, 0x80132884) + j clamp_level_9_6 + // keeping original line 2 + _return: + OS.patch_end() + + lbu t2, 0x0013(a0) // original line + slti t6, t2, 10 // t6 = 0 if 10 or greater + beqzl t6, pc() + 8 + lli t2, 9 // if above 9, clamp to 9 + + j _return + 0x8 + addiu t6, r0, 0x0001 // original line 3 + } + + // while near an opponent + scope clamp_level_9_7: { + OS.patch_start(0xADAA0, 0x80133060) + j clamp_level_9_7 + // keeping original line 2 + _return: + OS.patch_end() + + lbu t8, 0x0013(s0) // original line + slti at, t8, 10 // at = 0 if 10 or greater + beqzl at, pc() + 8 + lli t8, 9 // if above 9, clamp to 9 + + j _return + 0x8 + lui at, 0x3f80 // original line 3 + } + + // while hanging on cliff + scope clamp_level_9_8: { + OS.patch_start(0xB17AC, 0x80136D6C) + j clamp_level_9_8 + lbu t9, 0x0013(a2) // get cpu level + nop + nop + _return: + OS.patch_end() + + slti a1, t9, 10 // a1 = 0 if 10 or greater + lbu t9, 0x0013(a2) + beqzl a1, pc() + 8 + lli t9, 9 // if above 9, clamp to 9 + + bc1fl _og_skip + nop + sll v1, v1, 1 + + _og_skip: + j _return + addiu a1, r0, 0x0009 } - } - - - // @ Description - // asm fixes and so LVL 10 works in normal gameplay without causing issues for the other cpu levels - scope fixes: { - - // occurs often - scope clamp_level_9_1: { - OS.patch_start(0xACFD0, 0x80132590) - j clamp_level_9_1 - // keeping original line 2 - _return: - OS.patch_end() - - lbu t7, 0x0013(a0) // original line - slti v1, t7, 10 // v1 = 0 if 10 or greater - beqzl v1, pc() + 8 - lli t7, 9 // if above 9, clamp to 9 - - j _return + 0x8 - addiu v1, a0, 0x01CC // original line 3 - } - - // occurs often - scope clamp_level_9_2: { - OS.patch_start(0xB2ED0, 0x80138490) - j clamp_level_9_2 - // keeping original line 2 - _return: - OS.patch_end() - - lbu t7, 0x0013(a0) // original line - slti t0, t7, 10 // t0 = 0 if 10 or greater - beqzl t0, pc() + 8 - lli t7, 9 // if above 9, clamp to 9 - - j _return + 0x8 - addiu t0, r0, 0x0001 // original line 3 - } - - // while aerial against an opponent - scope clamp_level_9_3: { - OS.patch_start(0xAD0A4, 0x80132664) - j clamp_level_9_3 - // keeping original line 2 - _return: - OS.patch_end() - - lbu t2, 0x0013(a0) // original line - slti v0, t2, 10 // v0 = 0 if 10 or greater - beqzl v0, pc() + 8 - lli t2, 9 // if above 9, clamp to 9 - - j _return + 0x8 - subu v0, t3, t2 // original line 3 - } - - // ? - scope clamp_level_9_4: { - OS.patch_start(0xB3568, 0x80138B28) - j clamp_level_9_4 - // keeping original line 2 - _return: - OS.patch_end() - - lbu t8, 0x0013(s0) // original line - slti t2, t8, 10 // t2 = 0 if 10 or greater - beqzl t2, pc() + 8 - lli t8, 9 // if above 9, clamp to 9 - - j _return + 0x8 - addiu t2, r0, 0x0001 // original line 3 - } - - // ? - scope clamp_level_9_5: { - OS.patch_start(0xAD1E4, 0x801327A4) - j clamp_level_9_5 - // keeping original line 2 - _return: - OS.patch_end() - - lbu t7, 0x0013(a0) // original line - slti at, t7, 10 // at = 0 if 10 or greater - beqzl at, pc() + 8 - lli t7, 9 // if above 9, clamp to 9 - - j _return + 0x8 - lui at, 0x3F80 // original line 3 - } - - // ? - scope clamp_level_9_6: { - OS.patch_start(0xAD2C4, 0x80132884) - j clamp_level_9_6 - // keeping original line 2 - _return: - OS.patch_end() - - lbu t2, 0x0013(a0) // original line - slti t6, t2, 10 // t6 = 0 if 10 or greater - beqzl t6, pc() + 8 - lli t2, 9 // if above 9, clamp to 9 - - j _return + 0x8 - addiu t6, r0, 0x0001 // original line 3 - } - - // while near an opponent - scope clamp_level_9_7: { - OS.patch_start(0xADAA0, 0x80133060) - j clamp_level_9_7 - // keeping original line 2 - _return: - OS.patch_end() - - lbu t8, 0x0013(s0) // original line - slti at, t8, 10 // at = 0 if 10 or greater - beqzl at, pc() + 8 - lli t8, 9 // if above 9, clamp to 9 - - j _return + 0x8 - lui at, 0x3f80 // original line 3 - } - - // while hanging on cliff - scope clamp_level_9_8: { - OS.patch_start(0xB17AC, 0x80136D6C) - j clamp_level_9_8 - lbu t9, 0x0013(a2) // get cpu level - nop - nop - _return: - OS.patch_end() - - slti a1, t9, 10 // a1 = 0 if 10 or greater - lbu t9, 0x0013(a2) - beqzl a1, pc() + 8 - lli t9, 9 // if above 9, clamp to 9 - - bc1fl _og_skip - nop - sll v1, v1, 1 - - _og_skip: - j _return - addiu a1, r0, 0x0009 - } - - // other addresses that read cpus lvl - // 80131EEC - check if LVL => 5 - // 80133830 - check if LVL => 5 - // 80133A38 - check if LVL => 3 - // 80133A6C - check if LVL => 3 - // 80133A78 - check if LVL => 3 - // 80133A94 - ? - // 801355E8 - ? - // 80135684 - check if LVL => 6 (fast fall) - // 8013569C - ? - // 80135734 - check if LVL => 5 - // 80135744 - check if LVL => 5 - // 80135784 - check if LVL => 5 - // 80135E38 - ? - // 801360DC - ? - // 80136E30 - math - // 80136E98 - check if LVL => 4 - // 80136EC0 - ? - // 801370B0 - ? - // 80137364 - ? - // 801373B0 - ? - // 801373FC - ? - // 801375E8 - check if LVL => 4 - // 80137610 - ? - // 80137900 - ? - // 801381B8 - check if LVL => 4 - // 801389C4 - prevent LVL 9 cpu from using Links Bomb, or PK Thunder - // 80138BE4 - ? - // 8013908C - check if LVL => 4, or 3 - // 801390B4 - ? - // 80139138 - check if LVL => 7 - // 80139160 - ? - // 8013940C - ? - // 80139934 - ? - // 80139EB0 - ? - // 8013A964 - ? - } + + // other addresses that read cpus lvl + // 80131EEC - check if LVL => 5 + // 80133830 - check if LVL => 5 + // 80133A38 - check if LVL => 3 + // 80133A6C - check if LVL => 3 + // 80133A78 - check if LVL => 3 + // 80133A94 - ? + // 801355E8 - ? + // 80135684 - check if LVL => 6 (fast fall) + // 8013569C - ? + // 80135734 - check if LVL => 5 + // 80135744 - check if LVL => 5 + // 80135784 - check if LVL => 5 + // 80135E38 - ? + // 801360DC - ? + // 80136E30 - math + // 80136E98 - check if LVL => 4 + // 80136EC0 - ? + // 801370B0 - ? + // 80137364 - ? + // 801373B0 - ? + // 801373FC - ? + // 801375E8 - check if LVL => 4 + // 80137610 - ? + // 80137900 - ? + // 801381B8 - check if LVL => 4 + // 801389C4 - prevent LVL 9 cpu from using Links Bomb, or PK Thunder + // 80138BE4 - ? + // 8013908C - check if LVL => 4, or 3 + // 801390B4 - ? + // 80139138 - check if LVL => 7 + // 80139160 - ? + // 8013940C - ? + // 80139934 - ? + // 80139EB0 - ? + // 8013A964 - ? + } // MISC CHECKS // NESS 0x80133854 diff --git a/src/BGM.asm b/src/BGM.asm index d545fc7f..8b81cf5a 100644 --- a/src/BGM.asm +++ b/src/BGM.asm @@ -562,7 +562,7 @@ scope BGM { bgez a1, _original // play if any songs are ON sw r0, 0x0000(a0) // clear menu_randomizing_all flag // Easter Egg to handle if there were no songs to pick from - jal Global.get_random_int_alt_ // v0 = (0, N-1) + jal Global.get_random_int_safe_ // v0 = (0, N-1) addiu a0, r0, 4 // a0 = number of hidden Gameboy songs addiu a1, v0, 0xA2 // a1 = random bgm_id + offset to Gameboy songs b _original // play @@ -570,7 +570,7 @@ scope BGM { _random_menu_song: lli a0, Toggles.menu_music.MAX_VALUE - 4 // a0 - range (0, N-1) Menu Music values (excluding DEFAULT / RANDOM / RANDOM CLASSICS / RANDOM ALL / OFF) - jal Global.get_random_int_alt_ // v0 = (0, N-1) + jal Global.get_random_int_safe_ // v0 = (0, N-1) nop b _check_music_value // check again, using our spoofed value addiu t0, v0, 1 // t0 = random menu music value @@ -578,7 +578,7 @@ scope BGM { _random_menu_song_classics: lli a0, Toggles.menu_music.MAX_VALUE - 4 // a0 - range (0, N-1) Menu Music values (excluding DEFAULT / RANDOM / RANDOM CLASSICS / RANDOM ALL / OFF) addiu a0, a0, -4 // also exclude MAIN / MAIN_MELEE / MAIN_BRAWL / MAIN_MENU2 - jal Global.get_random_int_alt_ // v0 = (0, N-1) + jal Global.get_random_int_safe_ // v0 = (0, N-1) nop addiu v0, v0, 4 // if we're here, we need to apply offset b _check_music_value // check again, using our spoofed value diff --git a/src/Banjo/Banjo.asm b/src/Banjo/Banjo.asm index a852d5ba..4c1abb8b 100644 --- a/src/Banjo/Banjo.asm +++ b/src/Banjo/Banjo.asm @@ -154,8 +154,8 @@ scope Banjo { NSP_FORWARD: dw 0xA0A80001; dw 0xA0900001; - Moveset.VOICE(0x504) Moveset.WAIT(4); + Moveset.VOICE(0x504) Moveset.SET_FLAG(0); Moveset.WAIT(4) Moveset.SET_FLAG(1); @@ -608,24 +608,24 @@ scope Banjo { // Edit cpu attack behaviours, original table is from Falcon // edit_attack_behavior(table, attack, override, start_hb, end_hb, min_x, max_x, min_y, max_y) - AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, DAIR, -1, 6, 0, -132, 276, -90, 329) // - AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, DSPA, -1, 26, 0, 0, 100, 100, 330) // - AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, DSPG, -1, 14, 0, 0, 100, 100, 330) // - AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, DSMASH, -1, 10, 0, -320, 320, -100, 300) // - AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, DTILT, -1, 5, 0, -50, 499, -100, 325) // - AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, BAIR, -1, 12, 0, -40, 280, 100, 300) // - AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, FSMASH, -1, 16, 0, 250, 1170, 50, 590) // - AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, FTILT, -1, 8, 0, 45, 560, -45, 270) // - AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, GRAB, -1, 6, 0, 50, 240, 65, 355.0) // - AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, JAB, -1, 4, 0, 25, 495, 280, 510) // - AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, NAIR, -1, 5, 0, -192, 201, -30, 280) // - AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, NSPA, -1, 14, 0, 200, 900, 100, 250) // - AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, NSPG, -1, 14, 0, 200, 900, 100, 250) // - AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, UAIR, -1, 7, 0, 50, 200, 128, 500) // + AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, DAIR, -1, 6, 0, -132, 276, -90, 329) // + AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, DSPA, -1, 26, 0, 0, 100, 100, 330) // + AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, DSPG, -1, 14, 0, 0, 100, 100, 330) // + AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, DSMASH, -1, 10, 0, -320, 320, -100, 300) // + AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, DTILT, -1, 5, 0, -50, 499, -100, 325) // + AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, BAIR, -1, 12, 0, -40, 280, 100, 300) // + AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, FSMASH, -1, 16, 0, 250, 1170, 50, 590) // + AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, FTILT, -1, 8, 0, 45, 560, -45, 270) // + AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, GRAB, -1, 6, 0, 50, 240, 65, 355.0) // + AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, JAB, -1, 4, 0, 25, 495, 280, 510) // + AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, NAIR, -1, 5, 0, -192, 201, -30, 280) // + AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, NSPA, -1, 14, 0, 200, 900, 100, 250) // + AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, NSPG, -1, 14, 0, 200, 900, 100, 250) // + AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, UAIR, -1, 7, 0, 50, 200, 128, 500) // AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, USPA, -1, 0, 0, 89, 475, 242, 1000) // no offensive up B AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, USPG, -1, 0, 0, 89, 475, 242, 1700) // no offensive up B - AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, USMASH, -1, 12, 0, -174, 243, 177, 940) // - AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, UTILT, -1, 6, 0, -274, 326, 196, 717) // + AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, USMASH, -1, 12, 0, -174, 243, 177, 940) // + AI.edit_attack_behavior(CPU_ATTACKS_ORIGIN, UTILT, -1, 6, 0, -274, 326, 196, 717) // // Set default costumes(id, costume_1, costume_2, costume_3, costume_4, red_team, blue_team, green_team) Character.set_default_costumes(Character.id.BANJO, 0, 2, 4, 5, 1, 2, 3) diff --git a/src/Banjo/Moveset/DOWNATTACKU.bin b/src/Banjo/Moveset/DOWNATTACKU.bin index 8ec09cd2..04ea1049 100644 Binary files a/src/Banjo/Moveset/DOWNATTACKU.bin and b/src/Banjo/Moveset/DOWNATTACKU.bin differ diff --git a/src/Boot.asm b/src/Boot.asm index 2ae155df..79880456 100644 --- a/src/Boot.asm +++ b/src/Boot.asm @@ -139,7 +139,7 @@ scope Boot { nop } - string_version:; String.insert("Smash Remix v1.5.0") + string_version:; String.insert("Smash Remix v1.5.1") // @ Description // Use larger logo black backsplash diff --git a/src/Camera.asm b/src/Camera.asm index 6dd51620..0f60c57c 100644 --- a/src/Camera.asm +++ b/src/Camera.asm @@ -84,6 +84,8 @@ scope Camera { beq at, v0, mkingdom_camera addiu at, r0, Stages.id.BIG_SNOWMAN beq at, v0, mkingdom_camera + addiu at, r0, Stages.id.GYM_LEADER_CASTLE + beq at, v0, mkingdom_camera addiu at, r0, Stages.id.TOADSTURNPIKE bnel at, v0, _end addiu t0, r0, 0 // if here, use default camera index (0) @@ -903,6 +905,10 @@ scope Camera { ori t2, r0, Stages.id.HRC // t2 = id.HRC beq t0, t2, _frozen // use frozen camera if stage = HRC nop + li t1, fixed_pokefloats // t1 = frozen camera parameters for POKEFLOATS + ori t2, r0, Stages.id.POKEFLOATS// t2 = id.POKEFLOATS + beq t0, t2, _frozen // use frozen camera if stage = GB_LAND + nop OS.read_word(Toggles.entry_hazard_mode + 0x4, t1) // t1 = 1 if hazard_mode is 1 or 3, 0 otherwise andi t1, t1, 0x0001 // t1 = 1 if hazard_mode is 1 or 3, 0 otherwise bnez t1, _normal // if hazard_mode enabled, skip frozen camera for flat zones @@ -911,10 +917,7 @@ scope Camera { ori t2, r0, Stages.id.GB_LAND // t2 = id.GB_LAND beq t0, t2, _frozen // use frozen camera if stage = GB_LAND nop - li t1, fixed_pokefloats // t1 = frozen camera parameters for POKEFLOATS - ori t2, r0, Stages.id.POKEFLOATS// t2 = id.POKEFLOATS - beq t0, t2, _frozen // use frozen camera if stage = GB_LAND - nop + li t1, frozen_flat_zone_2 // t1 = frozen camera parameters for FLAT_ZONE_2 ori t2, r0, Stages.id.FLAT_ZONE_2 // t2 = id.FLAT_ZONE_2 beq t0, t2, _frozen // use frozen camera if stage = FLAT_ZONE_2 diff --git a/src/ChargeSmashAttacks.asm b/src/ChargeSmashAttacks.asm index 697b7db6..00615bb0 100644 --- a/src/ChargeSmashAttacks.asm +++ b/src/ChargeSmashAttacks.asm @@ -17,7 +17,7 @@ dw 0,0,0,0 shared_item_smash_table: - dw 16 // BeamSwordSmash + dw 14 // BeamSwordSmash dw 22 // BatSmash dw 7 // FanSmash dw 15 // StarRodSmash diff --git a/src/DSamus/DSamus.asm b/src/DSamus/DSamus.asm index e2202052..b013a643 100644 --- a/src/DSamus/DSamus.asm +++ b/src/DSamus/DSamus.asm @@ -104,7 +104,7 @@ scope DSamus { Character.edit_action(DSAMUS, 0xE4, -1, -1, 0x80160370, -1, -1) // Modify Menu Action Parameters // Action // Animation // Moveset Data // Flags - Character.edit_menu_action_parameters(DSAMUS, 0x0, File.DARK_SAMUS_IDLE, -1, -1) + Character.edit_menu_action_parameters(DSAMUS, 0x0, File.DSAMUS_IDLE_CSS, -1, -1) Character.edit_menu_action_parameters(DSAMUS, 0x1, -1, VICTORY, -1) Character.edit_menu_action_parameters(DSAMUS, 0x2, File.DSAMUS_VICTORY1, VICTORY1, -1) Character.edit_menu_action_parameters(DSAMUS, 0x3, File.DSAMUS_SELECT, SELECT, -1) diff --git a/src/Dedede/Dedede.asm b/src/Dedede/Dedede.asm index 5b4bd6b7..97f0fdcb 100644 --- a/src/Dedede/Dedede.asm +++ b/src/Dedede/Dedede.asm @@ -98,6 +98,7 @@ scope Dedede { insert DOWNATTACK_D,"moveset/DOWNATTACK_D.bin" insert DOWNATTACK_U,"moveset/DOWNATTACK_U.bin" insert LANDING_AIR_U,"moveset/LANDING_AIR_U.bin" + insert LANDING_AIR_D,"moveset/LANDING_AIR_D.bin" insert NSP_SUBROUTINE,"moveset/NSP_SUBROUTINE.bin" insert NSP_BEGIN,"moveset/NSP_BEGIN.bin"; Moveset.SUBROUTINE(NSP_SUBROUTINE); dw 0x00000000 @@ -477,7 +478,7 @@ Character.edit_action_parameters(DEDEDE, Action.LandingAirN, File.DED Character.edit_action_parameters(DEDEDE, Action.LandingAirF, File.DEDEDE_LANDING, -1, -1) Character.edit_action_parameters(DEDEDE, Action.LandingAirB, File.DEDEDE_LANDING_AIR_B, -1, -1) Character.edit_action_parameters(DEDEDE, Action.LandingAirU, File.DEDEDE_LANDING_AIR_U, LANDING_AIR_U, -1) -Character.edit_action_parameters(DEDEDE, Action.LandingAirD, File.DEDEDE_LANDING_AIR_D, -1, -1) +Character.edit_action_parameters(DEDEDE, Action.LandingAirD, File.DEDEDE_LANDING_AIR_D, LANDING_AIR_D, -1) Character.edit_action_parameters(DEDEDE, Action.LandingAirX, File.DEDEDE_LANDING, -1, -1) Character.edit_action_parameters(DEDEDE, Action.USP_BEGIN, File.DEDEDE_USP_BEGIN, USP_BEGIN, 0) diff --git a/src/Dedede/Moveset/LANDING_AIR_D.bin b/src/Dedede/Moveset/LANDING_AIR_D.bin new file mode 100644 index 00000000..1cc163fa Binary files /dev/null and b/src/Dedede/Moveset/LANDING_AIR_D.bin differ diff --git a/src/DragonKingHUD.asm b/src/DragonKingHUD.asm index 995c09b1..9943b86d 100644 --- a/src/DragonKingHUD.asm +++ b/src/DragonKingHUD.asm @@ -282,6 +282,12 @@ scope DragonKingHUD { lui at, LOWER_Y // at = lower Y position OS.patch_end() + // when 0:00 + OS.patch_start(0x8E478, 0x80112C78) + jal adjust_timer_position_._digits_timeout + lui at, LOWER_Y // at = lower Y position + OS.patch_end() + OS.patch_start(0x8E888, 0x80113088) jal adjust_timer_position_._colon addiu a0, a0, 0x17C8 // original line 1 @@ -310,6 +316,29 @@ scope DragonKingHUD { jr ra lui a2, 0x8013 // original line 2 + _digits_timeout: + Toggles.read(entry_dragon_king_hud, t9) // t9 = 2 if off + lli t5, 0x0002 // t5 = 2 = off always + beq t9, t5, _end_digits_timeout // if off, skip + lli t5, 0x0001 // t5 = 1 = always on + beql t9, t5, _end_digits_timeout // if on, use Dragon King position + mtc1 at, f2 // f2 = lower Y position + + // if here, check if on a Dragon King stage + OS.read_word(Global.match_info, t9) + lbu t9, 0x0001(t9) // t9 = stage_id + lli t5, Stages.id.DRAGONKING + beql t9, t5, _end_digits_timeout // if Dragon King, use Dragon King position + mtc1 at, f2 // f2 = lower Y position + lli t5, Stages.id.DRAGONKING_REMIX + beql t9, t5, _end_digits_timeout // if Dragon King Remix, use Dragon King position + mtc1 at, f2 // f2 = lower Y position + + _end_digits_timeout: + addiu t3, t3, 0xEE54 // original line 1 + jr ra + addiu t6, t7, 0x003C // original line 2 + _colon: Toggles.read(entry_dragon_king_hud, t7) // t7 = 2 if off lli t6, 0x0002 // t6 = 2 = off always diff --git a/src/Ebi/Ebi.asm b/src/Ebi/Ebi.asm index b36f579b..c8b7b098 100644 --- a/src/Ebi/Ebi.asm +++ b/src/Ebi/Ebi.asm @@ -83,7 +83,7 @@ scope Ebi { IDLE:; dw 0 TAUNT:; - Moveset.VOICE(0x523); + Moveset.HIDE_ITEM(); Moveset.VOICE(0x523); dw MODEL.WEAPON.CAMERA; dw MODEL.FACE.BLUSH; Moveset.AFTER(20); dw 0x98007C00, 0x00000100, 0x00800000, 0x00000000 // flash gfx dw 0xB0C00000// overlay diff --git a/src/FD.asm b/src/FD.asm index 558b2a69..3da8c3ab 100644 --- a/src/FD.asm +++ b/src/FD.asm @@ -62,14 +62,29 @@ scope FD { _music_fix_return: OS.patch_end() - li t0, Global.vs.stage // t0 = address of stage_id - lbu t0, 0x0000(t0) // t0 = stage_id + li t0, Global.match_info + lw t0, 0x0000(t0) // t0 = match info + lbu t0, 0x0001(t0) // t0 = current stage ID lli t9, Stages.id.FINAL_DESTINATION beq t0, t9, _final_destination // if FD, branch to final destination music routines lli t9, Stages.id.FINAL_DESTINATION_TENT beq t0, t9, _final_destination // if FD, branch to final destination music routines lli t9, Stages.id.FINAL_DESTINATION_DL - bne t0, t9, _end // if not FDDL, then skip to end + beq t0, t9, _final_destination // if FDDL, branch to final destination music routines + nop + + // Check for 1P mode FD (Final Stage) + li t9, SinglePlayerModes.singleplayer_mode_flag // t9 = singleplayer mode flag + lw t9, 0x0000(t9) // t9 = 1P mode (0 = standard, 4 = Remix) + addiu t0, r0, SinglePlayerModes.REMIX_1P_ID + beq t9, t0, pc() + 16 // proceed checking if Remix 1P + nop + bnez t9, _end // if not 1P or Remix 1P, then skip to end + nop + li t9, SinglePlayerModes.STAGE_FLAG // load current stage address + lb t9, 0x0000(t9) // load current stage + addiu t0, r0, 13 // t0 = Final Stage ID + bne t9, t0, _end // if not on Final Stage, then skip to end nop _final_destination: diff --git a/src/FGM.asm b/src/FGM.asm index 2de494ca..e279f590 100644 --- a/src/FGM.asm +++ b/src/FGM.asm @@ -365,7 +365,7 @@ scope FGM { predictors_moved: global variable predictors_moved_origin(origin()) - variable SPACE_REQUIRED((new_sample_count - 0x280) * 0x4) // need a word for each new sample that overflows + variable SPACE_REQUIRED((new_sample_count - 0x288) * 0x4) // need a word for each new sample that overflows variable total_predictors_size(0) define n(1) while total_predictors_size < SPACE_REQUIRED { @@ -786,19 +786,25 @@ scope FGM { origin predictors_moved_origin variable predictors_origin(origin()) variable start(PREDICTORS) + variable predictor_pc(pc() - PREDICTOR_PC) while {x} < {predictor_blocks} { origin predictors_origin - variable predictor_pc(pc()) insert "../roms/original.z64", start, PREDICTOR_SIZE_{x} variable start(start + PREDICTOR_SIZE_{x}) - variable new_offset(predictor_pc - PREDICTOR_PC + predictor_curr_pointer_info_{x}) + variable new_offset(predictor_pc + predictor_curr_pointer_info_{x}) variable predictors_origin(origin()) // now fix the pointer to the predictors origin PARAMETERS_MAP + 0x8 + (({x} - 1) * 0x10) dw new_offset // now fix the pointer inside the predictors - origin predictors_origin - 0x8 + origin predictors_origin - 0xC + // if there are loop params, need to update the pointer + if PREDICTOR_SIZE_{x} > 0xA8 { + dw new_offset - 0x30 + } else { + dw 0 + } dw new_offset + 0x18 - PREDICTOR_SIZE_{x} evaluate x({x} + 1) } diff --git a/src/File.asm b/src/File.asm index bc6776b4..33299c05 100644 --- a/src/File.asm +++ b/src/File.asm @@ -572,8 +572,8 @@ scope File { constant STG_BOWSER_PLATFORM(0xA83) constant GBOWSER_ENTRY_RIGHT(0xA84) constant GBOWSER_ENTRY_LEFT(0xA85) - constant GND_ENTRY_1_RIGHT(0xA86) - constant GND_ENTRY_1_LEFT(0xA87) + constant GND_ENTRY_1(0xA86) + constant GND_ENTRY_UNUSED(0xA87) // PLACEHOLDER constant GND_ENTRY_2_RIGHT(0xA88) constant GND_ENTRY_2_LEFT(0xA89) constant STG_BOWSERS_KEEP_HEADER(0xA8A) @@ -2688,4 +2688,5 @@ scope File { constant EBI_VICTORY_IMAGE_BOTTOM(0x12C9) constant EBI_VICTORY_IMAGE_TOP(0x12CA) constant EPUFF_MAIN(0x12CB) + constant DSAMUS_IDLE_CSS(0x12CC) } \ No newline at end of file diff --git a/src/GBowser/gbowser.asm b/src/GBowser/gbowser.asm index 70d06153..a79f6165 100644 --- a/src/GBowser/gbowser.asm +++ b/src/GBowser/gbowser.asm @@ -228,6 +228,7 @@ scope GBowser { Character.edit_action_parameters(GBOWSER, Action.FallAerial, File.BOWSER_FALL2, -1, -1) Character.edit_action_parameters(GBOWSER, Action.AttackAirF, File.BOWSER_FAIR, FAIR, -1) Character.edit_action_parameters(GBOWSER, Action.LandingAirF, File.BOWSER_FAIR_LAND, -1, -1) + Character.edit_action_parameters(GBOWSER, Action.LandingAirN, File.BOWSER_LANDING, -1, -1) Character.edit_action_parameters(GBOWSER, Action.Grab, File.BOWSER_GRAB, GRAB, 0x10000000) Character.edit_action_parameters(GBOWSER, Action.FSmash, File.BOWSER_FSMASH, FSMASH, 0x40000000) Character.edit_action_parameters(GBOWSER, Action.FSmashHigh, 0, 0x80000000, 0) diff --git a/src/Ganondorf/Ganondorf.asm b/src/Ganondorf/Ganondorf.asm index d2a22e10..cfe76795 100644 --- a/src/Ganondorf/Ganondorf.asm +++ b/src/Ganondorf/Ganondorf.asm @@ -54,7 +54,7 @@ scope Ganondorf { insert VICTORY_POSE_2,"moveset/VICTORY_POSE_2.bin" insert VICTORY_POSE_3,"moveset/VICTORY_POSE_3.bin" insert ONEP,"moveset/ONEP.bin" - insert ENTRY_1,"moveset/ENTRY_1.bin" + ENTRY_1:; insert "moveset/ENTRY_1.bin" insert ENTRY_2,"moveset/ENTRY_2.bin" insert DOWN_STAND,"moveset/DOWN_STAND.bin" @@ -111,10 +111,10 @@ scope Ganondorf { Character.edit_action_parameters(GND, Action.AttackAirD, -1, DAIR, -1) Character.edit_action_parameters(GND, Action.LandingAirN, 0x66B, 0x1720, -1) Character.edit_action_parameters(GND, Action.LandingAirF, 0, 0x80000000, -1) - Character.edit_action_parameters(GND, 0xE0, File.GND_ENTRY_1_LEFT, ENTRY_1, 0x40000000) - Character.edit_action_parameters(GND, 0xE1, File.GND_ENTRY_1_RIGHT, ENTRY_1, 0x40000000) - Character.edit_action_parameters(GND, 0xE2, File.GND_ENTRY_2_LEFT, ENTRY_2, 0x40000000) - Character.edit_action_parameters(GND, 0xE3, File.GND_ENTRY_2_RIGHT, ENTRY_2, 0x40000000) + Character.edit_action_parameters(GND, 0xE0, File.GND_ENTRY_1, ENTRY_1, 0x40000000) + Character.edit_action_parameters(GND, 0xE1, File.GND_ENTRY_1, ENTRY_1, 0x40000000) + Character.edit_action_parameters(GND, 0xE2, File.GND_ENTRY_2_LEFT, ENTRY_2, 0x40000000) + Character.edit_action_parameters(GND, 0xE3, File.GND_ENTRY_2_RIGHT, ENTRY_2, 0x40000000) Character.edit_action_parameters(GND, 0xE4, -1, NSP_GROUND, -1) Character.edit_action_parameters(GND, 0xE5, -1, NSP_AIR, -1) Character.edit_action_parameters(GND, 0xE6, -1, DSP_GROUND, -1) @@ -144,7 +144,7 @@ scope Ganondorf { // Set menu zoom size. Character.table_patch_start(menu_zoom, Character.id.GND, 0x4) - float32 1.2 + float32 1.125 OS.patch_end() // Remove entry script. diff --git a/src/Ganondorf/Moveset/ENTRY_1.bin b/src/Ganondorf/Moveset/ENTRY_1.bin index ae85274e..9f5a668d 100644 Binary files a/src/Ganondorf/Moveset/ENTRY_1.bin and b/src/Ganondorf/Moveset/ENTRY_1.bin differ diff --git a/src/Goemon/Goemon.asm b/src/Goemon/Goemon.asm index 7a904203..14161000 100644 --- a/src/Goemon/Goemon.asm +++ b/src/Goemon/Goemon.asm @@ -108,8 +108,7 @@ scope Goemon { insert TECH, "moveset/TECH.bin" insert TECH_ROLL, "moveset/TECH_ROLL.bin" TEETER:; dw MODEL.FACE.HURT; Moveset.VOICE(0x440); Moveset.END(); - - + insert CLIFF_ESCAPE_S2, "moveset/CLIFF_ESCAPE_S2.bin" DOWN_ATTACK_D:; dw MODEL.FACE.ATTACK; dw MODEL.PIPE.SHOW; insert "moveset/DOWN_ATTACK_D.bin" DOWN_ATTACK_U:; dw MODEL.FACE.ATTACK; dw MODEL.PIPE.SHOW; insert "moveset/DOWN_ATTACK_U.bin" @@ -357,7 +356,7 @@ scope Goemon { Character.edit_action_parameters(GOEMON, Action.CliffAttackSlow2, File.GOEMON_CLIFF_ATTACK_SLOW_2, CLIFF_ATTACK_S, -1) Character.edit_action_parameters(GOEMON, Action.CliffEscapeQuick2, File.GOEMON_CLIFF_ESCAPE_QUICK_2, -1, -1) Character.edit_action_parameters(GOEMON, Action.CliffEscapeSlow1, File.GOEMON_CLIFF_ESCAPE_SLOW_1, -1, -1) - Character.edit_action_parameters(GOEMON, Action.CliffEscapeSlow2, File.GOEMON_CLIFF_ESCAPE_SLOW_2, -1, -1) + Character.edit_action_parameters(GOEMON, Action.CliffEscapeSlow2, File.GOEMON_CLIFF_ESCAPE_SLOW_2, CLIFF_ESCAPE_S2, -1) Character.edit_action_parameters(GOEMON, Action.DownAttackD, File.GOEMON_DOWN_ATTACK_D, DOWN_ATTACK_D, -1) Character.edit_action_parameters(GOEMON, Action.DownAttackU, File.GOEMON_DOWN_ATTACK_U, DOWN_ATTACK_U, -1) Character.edit_action_parameters(GOEMON, Action.DownStandD, File.GOEMON_DOWN_STAND_D, -1, -1) @@ -456,7 +455,7 @@ scope Goemon { Character.add_new_action(GOEMON, DSPAirPull, -1, ActionParams.DSPAirPull, 0x1E, GoemonDSP.pull_main_, 0, 0x800D93E4, GoemonDSP.shared_air_collision_) Character.add_new_action(GOEMON, DSPAirWallPull, -1, ActionParams.DSPAirPull, 0x1E, GoemonDSP.wall_pull_main_, 0, 0x800D93E4, GoemonDSP.shared_air_collision_) Character.add_new_action(GOEMON, DSPAAttack, -1, ActionParams.DSPAAttack, 0x1E, 0x800D94E8, 0, 0x800D91EC, GoemonDSP.shared_air_collision_) - Character.add_new_action(GOEMON, DSPEnd, -1, ActionParams.DSPEnd, 0x1E, 0x800D94E8, 0, 0x800D9160, 0x800DE99C) + Character.add_new_action(GOEMON, DSPEnd, -1, ActionParams.DSPEnd, 0x1E, 0x800D94E8, 0, 0x800D9160, 0x800DE978) // Modify Menu Action Parameters // Action // Animation // Moveset Data // Flags Character.edit_menu_action_parameters(GOEMON, 0x0, File.GOEMON_IDLE, IDLE, -1) diff --git a/src/Goemon/Moveset/CLIFF_ESCAPE_S2.bin b/src/Goemon/Moveset/CLIFF_ESCAPE_S2.bin new file mode 100644 index 00000000..467c0096 Binary files /dev/null and b/src/Goemon/Moveset/CLIFF_ESCAPE_S2.bin differ diff --git a/src/InputDisplay.asm b/src/InputDisplay.asm index 4200ec4b..c72fe738 100644 --- a/src/InputDisplay.asm +++ b/src/InputDisplay.asm @@ -35,8 +35,11 @@ scope InputDisplay { lw at, 0x0000(s2) // at = pointer to percent HUD object for port beqz at, _next // skip if not turned on for port or a1, s0, r0 // a1 = port - jal create_input_display_objects_ lw a0, 0x0074(at) // a0 = image position struct for series logo + beqz a0, _next // skip if image position struct does not exist (fixes allstar bug when dying simultaneously w/opponent) + nop + jal create_input_display_objects_ + nop _next: sltiu at, s0, 0x0003 // at = 1 if more ports to check @@ -939,6 +942,14 @@ scope InputDisplay { lui at, 0x41F0 // original line 1 - at = Y position OS.patch_end() + // when 0:00 + OS.patch_start(0x8E468, 0x80112C68) + jal adjust_timer_position_._digits + lui at, 0x41F0 // original line 1 - at = Y position + addu t7, t5, t6 // original line 2 + lui t3, 0x8013 // original line 3 + OS.patch_end() + OS.patch_start(0x8E880, 0x80113080) jal adjust_timer_position_._colon lui at, 0x41F0 // original line 1 - at = Y position @@ -954,7 +965,7 @@ scope InputDisplay { _end_digits: jr ra - mtc1 at, f2 // original line 2 - f2 = Y position + mtc1 at, f2 // original line 2 (line 4 for 0:00) - f2 = Y position _colon: li a0, state_table diff --git a/src/NDSamus/NDSamus.asm b/src/NDSamus/NDSamus.asm index a127b9dd..8e4084b0 100644 --- a/src/NDSamus/NDSamus.asm +++ b/src/NDSamus/NDSamus.asm @@ -58,7 +58,7 @@ scope NDSamus { Character.edit_action(NDSAMUS, 0xDD, -1, 0x8013D994, 0x00000000, 0x00000000, 0x00000000) // Modify Menu Action Parameters // Action // Animation // Moveset Data // Flags - Character.edit_menu_action_parameters(NDSAMUS, 0x0, File.DARK_SAMUS_IDLE, -1, -1) + Character.edit_menu_action_parameters(NDSAMUS, 0x0, File.DSAMUS_IDLE_CSS, -1, -1) Character.edit_menu_action_parameters(NDSAMUS, 0x1, -1, DSamus.VICTORY, -1) Character.edit_menu_action_parameters(NDSAMUS, 0x2, File.DSAMUS_VICTORY1, DSamus.VICTORY1, -1) Character.edit_menu_action_parameters(NDSAMUS, 0x3, File.DSAMUS_SELECT, DSamus.SELECT, -1) diff --git a/src/NGanondorf/NGanondorf.asm b/src/NGanondorf/NGanondorf.asm index c86a0814..005e6a13 100644 --- a/src/NGanondorf/NGanondorf.asm +++ b/src/NGanondorf/NGanondorf.asm @@ -73,7 +73,7 @@ scope NGanondorf { // Set menu zoom size. Character.table_patch_start(menu_zoom, Character.id.NGND, 0x4) - float32 1.2 + float32 1.125 OS.patch_end() // Set Kirby star damage diff --git a/src/NSheik/NSheik.asm b/src/NSheik/NSheik.asm index e57d0c05..326ba067 100644 --- a/src/NSheik/NSheik.asm +++ b/src/NSheik/NSheik.asm @@ -308,4 +308,9 @@ Character.edit_action_parameters(NSHEIK, Action.LandingAirX, File.SH dw AI.PREVENT_ATTACK.ROUTINE.NONE OS.patch_end() + // Set menu zoom size. + Character.table_patch_start(menu_zoom, Character.id.NSHEIK, 0x4) + float32 0.95 + OS.patch_end() + } \ No newline at end of file diff --git a/src/Req/GBOWSER_MODEL.req b/src/Req/GBOWSER_MODEL.req index 393cd6cb..88b07a38 100644 --- a/src/Req/GBOWSER_MODEL.req +++ b/src/Req/GBOWSER_MODEL.req @@ -1,59 +1,59 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Sheik/Sheik.asm b/src/Sheik/Sheik.asm index cb2e0692..357186a7 100644 --- a/src/Sheik/Sheik.asm +++ b/src/Sheik/Sheik.asm @@ -504,6 +504,11 @@ Character.edit_action_parameters(SHEIK, Action.LandingAirX, File.SHE dh 0x1E OS.patch_end() + // Set menu zoom size. + Character.table_patch_start(menu_zoom, Character.id.SHEIK, 0x4) + float32 0.95 + OS.patch_end() + // Set rapid jab begin action. Character.table_patch_start(rapid_jab_begin_action, Character.id.SHEIK, 0x4) dw 0x8014F13C diff --git a/src/SinglePlayerModes.asm b/src/SinglePlayerModes.asm index 79669246..f1863c67 100644 --- a/src/SinglePlayerModes.asm +++ b/src/SinglePlayerModes.asm @@ -752,7 +752,7 @@ scope SinglePlayerModes: { lw t0, 0x0004(sp) // ~ _allstar: - li t0, 0x800A4AE7 + li t0, STAGE_FLAG lbu t0, 0x0000(t0) // load from current progress of 1p ID bnez t0, _1p lw t0, 0x0004(sp) // ~ @@ -763,7 +763,7 @@ scope SinglePlayerModes: { nop _remix_1p: - li t0, 0x800A4AE7 + li t0, STAGE_FLAG lbu t0, 0x0000(t0) // load from current progress of 1p ID addiu t6, r0, 0x000D beq t0, t6, _giga @@ -775,7 +775,8 @@ scope SinglePlayerModes: { lw t6, 0x2EE0(at) // original line 2 _giga: - addiu t0, r0, 0x0001 + li t0, 0x800A4AE8 // 1p port + lbu t0, 0x0000(t0) // load the point being used li t6, 0x801938EC sw t0, 0x0000(t6) // this ensures the game looks to Giga Bowser's hp to change stage and end level lw t0, 0x0004(sp) // ~ @@ -1173,30 +1174,32 @@ scope SinglePlayerModes: { nop _return: OS.patch_end() - + + li t8, singleplayer_mode_flag // t8 = singleplayer mode flag + lw t8, 0x0000(t8) // t8 = 2 if multiman + addiu at, r0, ALLSTAR_ID // insert check + bne t8, at, _skip_limbo // if not allstar, branch + nop + + li at, allstar_limbo + sw t8, 0x0000(at) // set limbo to true + + _skip_limbo: li at, SinglePlayer.high_score_enabled // at = high_score_enabled lw at, 0x0000(at) // at = high_score_enabled flag beqz at, _normal // if high scores are not enabled, don't save - addiu at, r0, MULTIMAN_ID // insert chec - li t8, singleplayer_mode_flag // t8 = singleplayer mode flag - lw t8, 0x0000(t8) // t8 = 2 if multiman - - + addiu at, r0, MULTIMAN_ID // insert check + beq t8, at, _multiman // if multiman, skip addiu at, r0, CRUEL_ID // insert check beq t8, at, _cruel // if multiman, skip - addiu at, r0, ALLSTAR_ID // insert check - bne t8, at, _normal // if not allstar, branch nop - li at, allstar_limbo - sw t8, 0x0000(at) // set limbo to true - + _normal: lb t8, 0x002B(a2) // original line 1 j _return addiu at, r0, 0xFFFF // original line 2 - _cruel: addiu sp, sp,-0x0018 // allocate stack space sw a0, 0x0004(sp) // ~ @@ -2694,8 +2697,8 @@ scope SinglePlayerModes: { dh 0x0909 // Giga Bowser - dw 0x00000608 // byte 1 team attack, byte 2 item spawn, byte 3 very easy cpu level, byte 4 easy cpu level - dw 0x0909091C // byte 1 normal cpu level, byte 2 hard cpu level, byte 3 very hard cpu level, byte 4 opponent knockback ratio very easy + dw 0x00000305 // byte 1 team attack, byte 2 item spawn, byte 3 very easy cpu level, byte 4 easy cpu level + dw 0x0709091C // byte 1 normal cpu level, byte 2 hard cpu level, byte 3 very hard cpu level, byte 4 opponent knockback ratio very easy dw 0x1D1E1F20 // byte 1 opponent easy knockback ratio, byte 2 opponent normal knockback ratio, byte 3 opponent hard knockback ratio, byte 4 opponent very hard knockback ratio dw 0x01010101 // byte 1 ally cpu level very easy, ally cpu level easy, ally cpu level normal, ally cpu level hard, dw 0x01090909 // byte 1 ally cpu level very hard, ally kb ratio very easy, ally kb ratio easy, ally kb ratio normal @@ -4780,6 +4783,42 @@ scope SinglePlayerModes: { j _return nop } + + // Correct Stage Text for Metal Mario Bros. Event + scope metal_bros_stage_text: { + OS.patch_start(0x12E028, 0x80134CE8) + j metal_bros_stage_text + addiu t7, r0, REMIX_1P_ID // Remix ID put into s0 + _return: + OS.patch_end() + + li t6, singleplayer_mode_flag // t6 = singleplayer mode flag + lw t6, 0x0000(t6) // t6 = 4 if Remix 1p + bne t6, t7, _normal // if not Remix 1p, skip + nop + + li t6, STAGE_FLAG + lb t6, 0x0000(t6) // load current stage of 1p + addiu t7, r0, 0x000A + bne t6, t7, _normal + nop + + li t6, metal_bros_flag + lbu t6, 0x0000(t6) // load if metal bros + beqz t6, _normal + nop + + jal 0x80131F98 // original line 1 + addiu a0, r0, 0x000A // set text to function like normal for Metal Mario Bros + j _return + nop + + _normal: + jal 0x80131F98 // original line 1 + lw a0, 0x0000(s2) // original line 2, load stage of 1p + j _return + nop + } // @ Description // Makes CPU 1 a giant in Remix 1P @@ -6432,8 +6471,8 @@ scope SinglePlayerModes: { dh 0x0909 // Giga Bowser - dw 0x00000909 // byte 1 team attack, byte 2 item spawn, byte 3 very easy cpu level, byte 4 easy cpu level - dw 0x0909091E // byte 1 normal cpu level, byte 2 hard cpu level, byte 3 very hard cpu level, byte 4 opponent knockback ratio very easy + dw 0x00000305 // byte 1 team attack, byte 2 item spawn, byte 3 very easy cpu level, byte 4 easy cpu level + dw 0x0709091E // byte 1 normal cpu level, byte 2 hard cpu level, byte 3 very hard cpu level, byte 4 opponent knockback ratio very easy dw 0x1F1F2022 // byte 1 opponent easy knockback ratio, byte 2 opponent normal knockback ratio, byte 3 opponent hard knockback ratio, byte 4 opponent very hard knockback ratio dw 0x01010101 // byte 1 ally cpu level very easy, ally cpu level easy, ally cpu level normal, ally cpu level hard, dw 0x01090909 // byte 1 ally cpu level very hard, ally kb ratio very easy, ally kb ratio easy, ally kb ratio normal diff --git a/src/Size.asm b/src/Size.asm index d103dc4d..f72af39c 100644 --- a/src/Size.asm +++ b/src/Size.asm @@ -2295,6 +2295,8 @@ scope Size { beq a1, at, _apply_scale // apply scale if J Luigi lli at, Character.id.METAL beq a1, at, _apply_scale // apply scale if Metal Mario + lli at, Character.id.MLUIGI + beq a1, at, _apply_scale // apply scale if Metal LUIGI lli at, Character.id.CONKER beq a1, at, _apply_scale // apply scale if Conker nop @@ -2478,6 +2480,10 @@ scope Size { lw t5, 0x0044(sp) // original line 2 _link_ground_gfx: + // If Banjo, don't update z offset to spawn position + lw t1, 0x0008(s0) // t1 = char_id + lli t7, Character.id.BANJO // t7 = Character.id.BANJO + bnel t1, t7, pc() + 8 // if not Banjo, skip updating z offset sw t0, 0x0024(v1) // original line 2 - set z offset // This one's a bit complicated... the update routine is set to 800FD714, which diff --git a/src/Spawn.asm b/src/Spawn.asm index c30eb5c7..09a94e4f 100644 --- a/src/Spawn.asm +++ b/src/Spawn.asm @@ -1863,8 +1863,8 @@ scope Spawn { // 2B - GANONS TOWER float32 -2200, 1954 float32 1996, 1954 - float32 -2200, 1954 - float32 1996, 1954 + float32 -1076, 1042 + float32 0902, 1042 // 2C - KALOS POKEMON LEAGUE float32 -2371, 0921 diff --git a/src/Stages.asm b/src/Stages.asm index 286186e5..2fc13e84 100644 --- a/src/Stages.asm +++ b/src/Stages.asm @@ -3579,7 +3579,7 @@ scope Stages { float32 0.4 // Cool Cool Mountain float32 0.4 // Dragon King float32 0.5 // Great Bay - float32 0.4 // Fray's Stage + float32 0.5 // Fray's Stage float32 0.45 // Tower of Heaven float32 0.5 // Fountain of Dreams float32 0.5 // Muda Kingdom @@ -3595,7 +3595,7 @@ scope Stages { float32 0.4 // Peach's Castle II float32 0.5 // Delfino Plaza float32 0.4 // Corneria - float32 0.5 // Uncanny Mansion + float32 0.5 // Kitchen Island float32 0.4 // Big Blue float32 0.30 // Onett float32 0.3 // Zebes Landing @@ -4812,41 +4812,41 @@ scope Stages { // Add stages here // add_stage(name, display_name, bgm_default, bgm_occasional, bgm_rare, tournament_legal, tournament_hazard_mode, netplay_legal, can_toggle, class, btx_word_1, btx_word_2, btx_word_3, variant_for_stage_id, variant_type, cloaking_device_rate, super_mushroom_rate, poison_mushroom_rate, blue_shell_rate, lightning_rate, deku_nut_rate, franklin_badge_rate, series_logo, hazard_type add_stage(deku_tree, "Deku Tree", {MIDI.id.KOKIRI_FOREST}, {MIDI.id.BRAWL_OOT}, {MIDI.id.SARIA}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, 0x03, 0x02, default_item_rate + 2, default_item_rate, ZELDA, Hazards.type.NONE) - add_stage(first_destination, "First Destination", {MIDI.id.FIRST_DESTINATION}, {MIDI.id.MULTIMAN2}, {MIDI.id.CREDITS_BRAWL}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, SMASH, Hazards.type.NONE) - add_stage(ganons_tower, "Ganon's Tower", {MIDI.id.GANONDORF_BATTLE}, {MIDI.id.MAJORA_MIDBOSS}, {MIDI.id.GANONMEDLEY}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, 0x03, 0x02, default_item_rate + 2, default_item_rate, ZELDA, Hazards.type.NONE) + add_stage(first_destination, "First Destination", {MIDI.id.FIRST_DESTINATION}, {MIDI.id.MULTIMAN2}, {MIDI.id.CREDITS_BRAWL}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, SMASH, Hazards.type.NONE) + add_stage(ganons_tower, "Ganon's Tower", {MIDI.id.GANONDORF_BATTLE}, {MIDI.id.MAJORA_MIDBOSS}, {MIDI.id.GANONMEDLEY}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, 0x03, 0x02, default_item_rate + 2, default_item_rate, ZELDA, Hazards.type.NONE) add_stage(gym_leader_castle, "Gym Leader Castle", {MIDI.id.RBY_GYMLEADER}, {MIDI.id.POKEMON_CHAMPION}, {MIDI.id.POKEMON_STADIUM}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, POKEMON, Hazards.type.NONE) add_stage(pokemon_stadium, "Pokemon Stadium", {MIDI.id.POKEMON_STADIUM}, {MIDI.id.POKEMON_CHAMPION}, {MIDI.id.POKEFLOATS}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, POKEMON, Hazards.type.NONE) add_stage(taltal, "Tal Tal Heights", {MIDI.id.LINKS_AWAKENING_MEDLEY}, {MIDI.id.BRAWL_OOT}, {MIDI.id.GERUDO_VALLEY}, OS.TRUE, HAZARDS_OFF_MOVEMENT_OFF, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, 0x03, 0x02, default_item_rate + 2, default_item_rate, ZELDA, Hazards.type.HAZARDS) add_stage(glacial, "Glacial River", {MIDI.id.GLACIAL}, {MIDI.id.CLOCKTOWER}, {MIDI.id.ROLL}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, MVC, Hazards.type.NONE) - add_stage(warioware, "WarioWare, Inc.", {MIDI.id.WARIOWARE}, {MIDI.id.ASHLEYS_THEME}, {MIDI.id.MONKEY_WATCH}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, WARIO, Hazards.type.NONE) - add_stage(battlefield, "Battlefield", {MIDI.id.BATTLEFIELD}, {MIDI.id.BATTLEFIELDV2}, {MIDI.id.MULTIMAN}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, SMASH, Hazards.type.NONE) + add_stage(warioware, "WarioWare, Inc.", {MIDI.id.WARIOWARE}, {MIDI.id.ASHLEYS_THEME}, {MIDI.id.MONKEY_WATCH}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, WARIO, Hazards.type.NONE) + add_stage(battlefield, "Battlefield", {MIDI.id.BATTLEFIELD}, {MIDI.id.BATTLEFIELDV2}, {MIDI.id.MULTIMAN}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, SMASH, Hazards.type.NONE) add_stage(flat_zone, "Flat Zone", {MIDI.id.FLAT_ZONE}, {MIDI.id.FLAT_ZONE_2}, -1, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, GAME_AND_WATCH, Hazards.type.HAZARDS) add_stage(dr_mario, "Dr. Mario", {MIDI.id.DR_MARIO}, {MIDI.id.CHILL}, {MIDI.id.QUEQUE}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, DR_MARIO, Hazards.type.NONE) add_stage(cool_cool_mountain, "Cool Cool Mountain", {MIDI.id.COOLCOOLMOUNTAIN}, {MIDI.id.FRAPPE_SNOWLAND}, {MIDI.id.WING_CAP}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate + 1, default_lightning_rate + 1, default_item_rate, default_item_rate, MARIO_BROS, Hazards.type.NONE) - add_stage(dragon_king, "Dragon King", {MIDI.id.DRAGONKING}, {MIDI.id.TARGET_TEST}, -1, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, SMASH, Hazards.type.NONE) - add_stage(great_bay, "Great Bay", {MIDI.id.SARIA}, {MIDI.id.CLOCKTOWN}, {MIDI.id.ASTRAL_OBSERVATORY}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, 0x03, 0x02, default_item_rate + 2, default_item_rate, ZELDA, Hazards.type.MOVEMENT) - add_stage(frays_stage, "Fray's Stage", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TRAVELING}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, REMIX, Hazards.type.NONE) + add_stage(dragon_king, "Dragon King", {MIDI.id.DRAGONKING}, {MIDI.id.TARGET_TEST}, -1, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, SMASH, Hazards.type.NONE) + add_stage(great_bay, "Great Bay", {MIDI.id.SARIA}, {MIDI.id.CLOCKTOWN}, {MIDI.id.ASTRAL_OBSERVATORY}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, 0x03, 0x02, default_item_rate + 2, default_item_rate, ZELDA, Hazards.type.MOVEMENT) + add_stage(frays_stage, "Fray's Stage", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TRAVELING}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, REMIX, Hazards.type.NONE) add_stage(toh, "Tower of Heaven", {MIDI.id.TOWEROFHEAVEN}, {MIDI.id.PLANTATION}, {MIDI.id.FLANDRES_THEME}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, TOH, Hazards.type.NONE) - add_stage(fod, "Fountain of Dreams", {MIDI.id.FOD}, {MIDI.id.NIGHTMARE}, {MIDI.id.VS_MARX}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, KIRBY, Hazards.type.MOVEMENT) + add_stage(fod, "Fountain of Dreams", {MIDI.id.FOD}, {MIDI.id.NIGHTMARE}, {MIDI.id.VS_MARX}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, KIRBY, Hazards.type.MOVEMENT) add_stage(muda, "Muda Kingdom", {MIDI.id.MUDA}, {MIDI.id.GB_MEDLEY}, {MIDI.id.EASTON_KINGDOM}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, id.GB_LAND, variant_type.REMIX, 0x05, 0x05, 0x05, default_blue_shell_rate + 1, default_lightning_rate + 1, default_item_rate, default_item_rate, MARIO_BROS, Hazards.type.NONE) - add_stage(mementos, "Mementos", {MIDI.id.MEMENTOS}, {MIDI.id.THE_DAYS_WHEN_MY_MOTHER_WAS_THERE}, {MIDI.id.BATTLE_C1}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, id.REAPERS, variant_type.REMIX, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, PERSONA, Hazards.type.MOVEMENT) + add_stage(mementos, "Mementos", {MIDI.id.MEMENTOS}, {MIDI.id.THE_DAYS_WHEN_MY_MOTHER_WAS_THERE}, {MIDI.id.BATTLE_C1}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, id.REAPERS, variant_type.REMIX, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, PERSONA, Hazards.type.MOVEMENT) add_stage(showdown, "Showdown", {MIDI.id.FD_BRAWL}, {MIDI.id.BIS_THEGRANDFINALE}, {MIDI.id.FUGUE}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.FIRST_DESTINATION, variant_type.REMIX2, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, SMASH, Hazards.type.NONE) add_stage(spiralm, "Spiral Mountain", {MIDI.id.SPIRAL_MOUNTAIN}, {MIDI.id.BANJO_MAIN}, {MIDI.id.BK_FINALBATTLE}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, BANJO_KAZOOIE, Hazards.type.MOVEMENT) add_bg_animation(SPIRALM) add_stage(n64, "N64", {MIDI.id.N64}, {MIDI.id.TALENTSTUDIO}, -1, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, REMIX, Hazards.type.NONE) - add_stage(mute_dl, "Mute City DL", {MIDI.id.MUTE_CITY}, {MIDI.id.FIRE_FIELD}, {MIDI.id.MACHRIDER}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, id.MUTE, variant_type.DL, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, FZERO, Hazards.type.NONE) + add_stage(mute_dl, "Mute City DL", {MIDI.id.MUTE_CITY}, {MIDI.id.FIRE_FIELD}, {MIDI.id.MACHRIDER}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, id.MUTE, variant_type.DL, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, FZERO, Hazards.type.NONE) add_stage(madmm, "Mad Monster Mansion", {MIDI.id.MADMONSTER}, {MIDI.id.MRPATCH}, {MIDI.id.VS_KLUNGO}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, BANJO_KAZOOIE, Hazards.type.NONE) add_stage(smbbf, "Mushroom Kingdom DL", -1, -1, -1, OS.TRUE, HAZARDS_OFF_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.MUSHROOM_KINGDOM, variant_type.DL, 0x05, 0x05, 0x05, default_blue_shell_rate + 1, default_lightning_rate + 1, default_item_rate, default_item_rate, MARIO_BROS, Hazards.type.HAZARDS) add_stage(smbo, "Mushroom Kingdom ~", -1, -1, -1, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.MUSHROOM_KINGDOM, variant_type.OMEGA, 0x05, 0x05, 0x05, default_blue_shell_rate + 1, default_lightning_rate + 1, default_item_rate, default_item_rate, MARIO_BROS, Hazards.type.HAZARDS) add_stage(bowserb, "Bowser's Stadium", {MIDI.id.BOWSERBOSS}, {MIDI.id.BOWSERROAD}, {MIDI.id.BOWSERFINAL}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, BOWSER, Hazards.type.HAZARDS) add_stage(peach2, "Peach's Castle II", {MIDI.id.PEACH_CASTLE}, {MIDI.id.SLIDER}, {MIDI.id.SMB3OVERWORLD}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate + 1, default_lightning_rate + 1, default_item_rate, default_item_rate, MARIO_BROS, Hazards.type.MOVEMENT) - add_stage(delfino, "Delfino Plaza", {MIDI.id.DELFINO}, {MIDI.id.SMW_TITLECREDITS}, {MIDI.id.SMW_ATHLETIC}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate + 1, default_lightning_rate + 1, default_item_rate, default_item_rate, MARIO_BROS, Hazards.type.MOVEMENT) - add_stage(corneria2, "Corneria", {MIDI.id.CORNERIA}, {MIDI.id.AREA6}, {MIDI.id.CORNERIA}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, STARFOX, Hazards.type.HAZARDS) + add_stage(delfino, "Delfino Plaza", {MIDI.id.DELFINO}, {MIDI.id.SMW_TITLECREDITS}, {MIDI.id.SMW_ATHLETIC}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate + 1, default_lightning_rate + 1, default_item_rate, default_item_rate, MARIO_BROS, Hazards.type.MOVEMENT) + add_stage(corneria2, "Corneria", {MIDI.id.STARFOX_MEDLEY}, {MIDI.id.AREA6}, {MIDI.id.CORNERIA}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, STARFOX, Hazards.type.HAZARDS) add_stage(kitchen, "Kitchen Island", {MIDI.id.KITCHEN_ISLAND}, {MIDI.id.WL2_PERFECT}, {MIDI.id.STARRING_WARIO}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, WARIO, Hazards.type.MOVEMENT) add_position_array(KITCHEN, 0, -832, 0) add_stage(blue, "Big Blue", {MIDI.id.BIG_BLUE}, {MIDI.id.MACHRIDER}, {MIDI.id.FZERO_CLIMBUP}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, FZERO, Hazards.type.BOTH) add_stage(onett, "Onett", {MIDI.id.ONETT}, {MIDI.id.BEIN_FRIENDS}, {MIDI.id.POLLYANNA}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate + 2, EARTHBOUND, Hazards.type.HAZARDS) - add_stage(zlanding, "Crateria", {MIDI.id.CRATERIA_MAIN}, {MIDI.id.ZEBES_LANDING}, {MIDI.id.NORFAIR}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, METROID, Hazards.type.MOVEMENT) + add_stage(zlanding, "Crateria", {MIDI.id.CRATERIA_MAIN}, {MIDI.id.ZEBES_LANDING}, {MIDI.id.NORFAIR}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, METROID, Hazards.type.MOVEMENT) add_bg_animation(ZLANDING) add_stage(frosty, "Frosty Village", {MIDI.id.FROSTY_VILLAGE}, {MIDI.id.DKR_BOSS}, {MIDI.id.CRESCENT_ISLAND}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, DONKEY_KONG, Hazards.type.NONE) add_stage(smashville2, "Smashville", {MIDI.id.AC_TITLE}, {MIDI.id.KK_RIDER}, {MIDI.id.SMASHVILLE}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, ANIMAL_CROSSING, Hazards.type.MOVEMENT) @@ -4854,7 +4854,7 @@ scope Stages { add_stage(drm_btt, "Break the Targets", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTT, 0x000056A8, 0x00005B10, 0x00005D20, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) add_stage(gnd_btt, "Break the Targets", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTT, 0x00004178, 0x000045F0, 0x00004800, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) add_stage(yl_btt, "Break the Targets", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTT, 0x00002A18, 0x00002CE0, 0x00002EF0, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) - add_stage(battlefield_dl, "Battlefield DL", {MIDI.id.BATTLEFIELD}, {MIDI.id.BATTLEFIELDV2}, {MIDI.id.MULTIMAN}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.BATTLEFIELD, variant_type.DL, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, SMASH, Hazards.type.NONE) + add_stage(battlefield_dl, "Battlefield DL", {MIDI.id.BATTLEFIELD}, {MIDI.id.BATTLEFIELDV2}, {MIDI.id.MULTIMAN}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.BATTLEFIELD, variant_type.DL, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, SMASH, Hazards.type.NONE) add_stage(ds_btt, "Break the Targets", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTT, 0x00003160, 0x000036D0, 0x000038E0, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) add_stage(stg1_btt, "Break the Targets", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTT, 0x00006588, 0x00006A40, 0x00006C50, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) add_stage(falco_btt, "Break the Targets", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTT, 0x000036C0, 0x00003BB0, 0x00003DC0, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) @@ -4862,7 +4862,7 @@ scope Stages { add_stage(htemple, "Hyrule Temple", {MIDI.id.HYRULE_TEMPLE}, {MIDI.id.FINALTEMPLE}, {MIDI.id.DARKWORLD}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, 0x03, 0x02, default_item_rate + 2, default_item_rate, ZELDA, Hazards.type.NONE) add_stage(lucas_btt, "Break the Targets", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTT, 0x000032D8, 0x00003650, 0x00003860, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) add_stage(gnd_btp, "Board the Platforms", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTP, 0x00003C70, 0x00003DA8, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) - add_stage(npc, "New Pork City", {MIDI.id.DCMC}, {MIDI.id.UNFOUNDED_REVENGE}, {MIDI.id.SAMBA_DE_COMBO}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate + 2, EARTHBOUND, Hazards.type.NONE) + add_stage(npc, "New Pork City", {MIDI.id.DCMC}, {MIDI.id.UNFOUNDED_REVENGE}, {MIDI.id.SAMBA_DE_COMBO}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate + 2, EARTHBOUND, Hazards.type.NONE) add_stage(ds_btp, "Board the Platforms", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTP, 0x00003F10, 0x00003FC0, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) add_stage(smashketball, "Smashketball", {MIDI.id.NBA_JAM}, {MIDI.id.KENGJR}, {MIDI.id.SOCCER_MENU}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NBA_JAM, Hazards.type.HAZARDS) add_stage(drm_btp, "Board the Platforms", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTP, 0x00004E08, 0x00004EC0, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) @@ -4880,7 +4880,7 @@ scope Stages { add_stage(poly_btp, "Board the Platforms", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTP, 0x000047E0, 0x00004890, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) add_stage(hcastle_dl, "Hyrule Castle DL", -1, {MIDI.id.FINALTEMPLE}, {MIDI.id.GODDESSBALLAD}, OS.TRUE, HAZARDS_OFF_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.HYRULE_CASTLE, variant_type.DL, 0x05, 0x05, 0x05, 0x03, 0x02, default_item_rate + 2, default_item_rate, ZELDA, Hazards.type.HAZARDS) add_stage(hcastle_o, "Hyrule Castle ~", -1, {MIDI.id.FINALTEMPLE}, {MIDI.id.GODDESSBALLAD}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.HYRULE_CASTLE, variant_type.OMEGA, 0x05, 0x05, 0x05, 0x03, 0x02, default_item_rate + 2, default_item_rate, ZELDA, Hazards.type.HAZARDS) - add_stage(congoj_dl, "Congo Jungle DL", -1, {MIDI.id.SKERRIES}, {MIDI.id.SNAKEY_CHANTEY}, OS.FALSE, HAZARDS_OFF_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.CONGO_JUNGLE, variant_type.DL, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, DONKEY_KONG, Hazards.type.HAZARDS) + add_stage(congoj_dl, "Congo Jungle DL", -1, {MIDI.id.SKERRIES}, {MIDI.id.SNAKEY_CHANTEY}, OS.TRUE, HAZARDS_OFF_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.CONGO_JUNGLE, variant_type.DL, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, DONKEY_KONG, Hazards.type.HAZARDS) add_bg_animation(CONGOJ_DL) add_stage(congoj_o, "Congo Jungle ~", -1, {MIDI.id.SKERRIES}, {MIDI.id.SNAKEY_CHANTEY}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.CONGO_JUNGLE, variant_type.OMEGA, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, DONKEY_KONG, Hazards.type.HAZARDS) add_bg_animation(CONGOJ_O) @@ -4912,7 +4912,7 @@ scope Stages { add_bg_animation(ZEBES_O) add_stage(bowser_btt, "Break the Targets", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTT, 0x00004040, 0x000043F0, 0x00004600, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) add_stage(bowser_btp, "Board the Platforms", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTP, 0x00003260, 0x00003398, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) - add_stage(bowsers_keep, "Bowser's Keep", {MIDI.id.FIGHT_AGAINST_BOWSER}, {MIDI.id.KING_OF_THE_KOOPAS}, {MIDI.id.BIS_THEGRANDFINALE}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, BOWSER, Hazards.type.MOVEMENT) + add_stage(bowsers_keep, "Bowser's Keep", {MIDI.id.FIGHT_AGAINST_BOWSER}, {MIDI.id.KING_OF_THE_KOOPAS}, {MIDI.id.BIS_THEGRANDFINALE}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, BOWSER, Hazards.type.MOVEMENT) add_stage(rith_essa, "Rith Essa", {MIDI.id.RITH_ESSA}, {MIDI.id.JFG_SELECT}, -1, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, JET_FORCE_GEMINI, Hazards.type.NONE) add_stage(venom, "Venom", {MIDI.id.VENOM}, {MIDI.id.STAR_WOLF}, {MIDI.id.BOSS_E}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, STARFOX, Hazards.type.HAZARDS) add_stage(wolf_btt, "Break the Targets", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTT, 0x00003238, 0x000037A0, 0x000039B0, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) @@ -4920,7 +4920,7 @@ scope Stages { add_stage(conker_btt, "Break the Targets", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTT, 0x00005778, 0x00005CD0, 0x00005EE0, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) add_stage(conker_btp, "Board the Platforms", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTP, 0x000075C0, 0x000077A8, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) add_stage(windy, "Windy", {MIDI.id.WINDY}, {MIDI.id.OLE}, {MIDI.id.SLOPRANO}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, CONKER, Hazards.type.MOVEMENT) - add_stage(data, "dataDyne Central", {MIDI.id.DATADYNE}, {MIDI.id.INVESTIGATION_X}, {MIDI.id.CRADLE}, OS.FALSE, HAZARDS_ON_MOVEMENT_OFF, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x35, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, PERFECT_DARK, Hazards.type.MOVEMENT) + add_stage(data, "dataDyne Central", {MIDI.id.DATADYNE}, {MIDI.id.INVESTIGATION_X}, {MIDI.id.CRADLE}, OS.TRUE, HAZARDS_ON_MOVEMENT_OFF, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x35, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, PERFECT_DARK, Hazards.type.MOVEMENT) add_stage(clancer, "Planet Clancer", {MIDI.id.TROUBLE_MAKER}, {MIDI.id.MM_TITLE}, {MIDI.id.ESPERANCE}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, MISCHIEF_MAKERS, Hazards.type.MOVEMENT) add_stage(japes, "Jungle Japes", {MIDI.id.JUNGLEJAPES}, {MIDI.id.FOREST_INTERLUDE}, {MIDI.id.DKCTITLE}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, DONKEY_KONG, Hazards.type.HAZARDS) add_bg_animation(JAPES) @@ -4930,9 +4930,9 @@ scope Stages { add_stage(marth_btp, "Board the Platforms", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTP, 0x000045E0, 0x000047C8, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) add_stage(rest, "Allstar Rest Area", {MIDI.id.REST}, -1, -1, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) add_stage(mtwo_btp, "Board the Platforms", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTP, 0x000059F0, 0x00005BD8, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) - add_stage(csiege, "Castle Siege", {MIDI.id.FE_MEDLEY}, {MIDI.id.FIRE_EMBLEM}, {MIDI.id.WITHMILASDIVINEPROTECTION}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, FIRE_EMBLEM, Hazards.type.NONE) + add_stage(csiege, "Castle Siege", {MIDI.id.FE_MEDLEY}, {MIDI.id.FIRE_EMBLEM}, {MIDI.id.WITHMILASDIVINEPROTECTION}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, FIRE_EMBLEM, Hazards.type.NONE) add_bg_animation(CSIEGE) - add_stage(yoshis_island_II, "Yoshi's Island II", -1, {MIDI.id.WILDLANDS}, {MIDI.id.YOSHI_GOLF}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, YOSHI, Hazards.type.MOVEMENT) + add_stage(yoshis_island_II, "Yoshi's Island II", -1, {MIDI.id.WILDLANDS}, {MIDI.id.YOSHI_GOLF}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, YOSHI, Hazards.type.MOVEMENT) add_bg_animation(YOSHIS_ISLAND_II) add_stage(final_destination_dl, "Final Destination DL", -1, {MIDI.id.FIRST_DESTINATION}, {MIDI.id.FD_BRAWL}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.FINAL_DESTINATION, variant_type.DL, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, SMASH, Hazards.type.NONE) add_stage(final_destination_tent, "Final Tentination", -1, {MIDI.id.FIRST_DESTINATION}, {MIDI.id.FD_BRAWL}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.FINAL_DESTINATION, variant_type.REMIX, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, SMASH, Hazards.type.NONE) @@ -4944,16 +4944,16 @@ scope Stages { add_bg_animation(DREAM_LAND_SR) add_stage(pcastle_beta, "Peach's Castle Beta", -1, {MIDI.id.BOB}, {MIDI.id.SLIDER}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.PEACHS_CASTLE, variant_type.REMIX, 0x05, 0x05, 0x05, default_blue_shell_rate + 1, default_lightning_rate + 1, default_item_rate, default_item_rate, MARIO_BROS, Hazards.type.BOTH) add_bg_animation(PCASTLE_BETA) - add_stage(hcastle_remix, "Hyrule Castle SR", -1, {MIDI.id.FINALTEMPLE}, {MIDI.id.GODDESSBALLAD}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, id.HYRULE_CASTLE, variant_type.REMIX, 0x05, 0x05, 0x05, 0x03, 0x02, default_item_rate + 2, default_item_rate, ZELDA, Hazards.type.HAZARDS) + add_stage(hcastle_remix, "Hyrule Castle SR", -1, {MIDI.id.FINALTEMPLE}, {MIDI.id.GODDESSBALLAD}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.HYRULE_CASTLE, variant_type.REMIX, 0x05, 0x05, 0x05, 0x03, 0x02, default_item_rate + 2, default_item_rate, ZELDA, Hazards.type.HAZARDS) add_stage(sector_z_remix, "Sector Z SR", -1, {MIDI.id.SURPRISE_ATTACK}, {MIDI.id.CORNERIA}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.SECTOR_Z, variant_type.REMIX, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, STARFOX, Hazards.type.HAZARDS) add_bg_animation(SECTOR_Z_REMIX) add_position_array(SECTOR_Z_REMIX, -3328, 0, 2048) add_stage(mute, "Mute City", {MIDI.id.MUTE_CITY}, {MIDI.id.FIRE_FIELD}, {MIDI.id.MACHRIDER}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, FZERO, Hazards.type.BOTH) add_stage(hrc, "Home Run Contest", -1, -1, -1, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.RTTF, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, REMIX, Hazards.type.NONE) - add_stage(mk_remix, "Mushroom Kingdom SR", -1, -1, -1, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.MUSHROOM_KINGDOM, variant_type.REMIX, 0x05, 0x05, 0x05, default_blue_shell_rate + 1, default_lightning_rate + 1, default_item_rate, default_item_rate, MARIO_BROS, Hazards.type.HAZARDS) + add_stage(mk_remix, "Mushroom Kingdom SR", -1, -1, -1, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, id.MUSHROOM_KINGDOM, variant_type.REMIX, 0x05, 0x05, 0x05, default_blue_shell_rate + 1, default_lightning_rate + 1, default_item_rate, default_item_rate, MARIO_BROS, Hazards.type.HAZARDS) add_stage(ghz, "Green Hill Zone", {MIDI.id.GREEN_HILL_ZONE}, {MIDI.id.EMERALDHILL}, {MIDI.id.CHEMICAL_PLANT}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, SONIC, Hazards.type.MOVEMENT) add_bg_animation(GHZ) - add_stage(subcon, "Subcon", {MIDI.id.SMB2OVERWORLD}, {MIDI.id.SMB2_MEDLEY}, {MIDI.id.SMB2_MEDLEY}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate + 1, default_lightning_rate + 1, default_item_rate, default_item_rate, MARIO_BROS, Hazards.type.MOVEMENT) + add_stage(subcon, "Subcon", {MIDI.id.SMB2OVERWORLD}, {MIDI.id.SMB2_MEDLEY}, {MIDI.id.SMB2_MEDLEY}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate + 1, default_lightning_rate + 1, default_item_rate, default_item_rate, MARIO_BROS, Hazards.type.MOVEMENT) add_stage(pirate, "Pirate Land", {MIDI.id.PIRATELAND}, {MIDI.id.TROPICALISLAND}, {MIDI.id.WIDE_UNDERWATER}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate + 1, default_lightning_rate + 1, default_item_rate, default_item_rate, MARIO_BROS, Hazards.type.HAZARDS) add_stage(casino, "Casino Night Zone", {MIDI.id.CASINO_NIGHT}, {MIDI.id.SONIC2_BOSS}, {MIDI.id.GIANTWING}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, SONIC, Hazards.type.HAZARDS) add_stage(sonic_btt, "Break the Targets", -1, {MIDI.id.SONICCD_SPECIAL}, {MIDI.id.SONIC2_SPECIAL}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTT, 0x00005C40, 0x00006260, 0x00006470, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) @@ -4963,9 +4963,9 @@ scope Stages { add_stage(pokemon_stadium_2, "Pokemon Stadium 2", {MIDI.id.BATTLE_GOLD_SILVER}, {MIDI.id.KANTO_WILD_BATTLE}, {MIDI.id.SS_AQUA}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, id.POKEMON_STADIUM, variant_type.REMIX, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, POKEMON, Hazards.type.NONE) add_stage(norfair_remix, "Norfair Remix", {MIDI.id.NORFAIR}, {MIDI.id.VSRIDLEY}, {MIDI.id.VSRIDLEY}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, id.NORFAIR, variant_type.REMIX, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, METROID, Hazards.type.HAZARDS) add_stage(toadsturnpike, "Toad's Turnpike", {MIDI.id.TOADS_TURNPIKE}, {MIDI.id.RACEWAYS}, {MIDI.id.WALUIGI_PINBALL}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate + 1, default_lightning_rate + 1, default_item_rate, default_item_rate, MARIO_BROS, Hazards.type.BOTH) - add_stage(taltal_remix, "Tal Tal Heights Remix", {MIDI.id.LINKS_AWAKENING_MEDLEY}, {MIDI.id.BRAWL_OOT}, {MIDI.id.GERUDO_VALLEY}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.TALTAL, variant_type.REMIX, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, ZELDA, Hazards.type.HAZARDS) + add_stage(taltal_remix, "Tal Tal Heights Remix", {MIDI.id.LINKS_AWAKENING_MEDLEY}, {MIDI.id.BRAWL_OOT}, {MIDI.id.GERUDO_VALLEY}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, id.TALTAL, variant_type.REMIX, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, ZELDA, Hazards.type.HAZARDS) add_stage(sheik_btp, "Board the Platforms", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTP, 0x00003E40, 0x00004028, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) - add_stage(winter_dl, "Winter Dream Land", -1, {MIDI.id.FROZEN_HILLSIDE}, {MIDI.id.BUMPERCROPBUMP}, OS.TRUE, HAZARDS_OFF_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.DREAM_LAND, variant_type.DL, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, KIRBY, Hazards.type.HAZARDS) + add_stage(winter_dl, "Winter Dream Land", -1, {MIDI.id.FROZEN_HILLSIDE}, {MIDI.id.BUMPERCROPBUMP}, OS.TRUE, HAZARDS_OFF_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, id.DREAM_LAND, variant_type.DL, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, KIRBY, Hazards.type.HAZARDS) add_bg_animation(WINTER_DL) add_stage(sheik_btt, "Break the Targets", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTT, 0x00003000, 0x00003370, 0x00003580, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) add_stage(glacial_remix, "Glacial River Remix", {MIDI.id.GLACIAL}, {MIDI.id.CLOCKTOWER}, {MIDI.id.ROLL}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, id.GLACIAL, variant_type.REMIX, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, MVC, Hazards.type.NONE) @@ -4977,7 +4977,7 @@ scope Stages { add_stage(inverted_castle, "Reverse Castle", {MIDI.id.IRON_BLUE_INTENTION}, {MIDI.id.DRACULAS_CASTLE}, {MIDI.id.DRACULAS_TEARS}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.DRACULAS_CASTLE, variant_type.REMIX, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, CASTLEVANIA, Hazards.type.MOVEMENT) add_stage(dedede_btp, "Board the Platforms", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.BUMPERCROPBUMP}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTP, 0x000073A0, 0x000074D8, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) add_stage(mt_dedede, "Mt. Dedede", {MIDI.id.DEDEDE}, {MIDI.id.MK_REVENGE}, {MIDI.id.KIRBY_64_BOSS}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, KIRBY, Hazards.type.MOVEMENT) - add_stage(edo, "Edo Town", {MIDI.id.OEDO_EDO}, {MIDI.id.KAI_HIGHWAY}, {MIDI.id.MUSICAL_CASTLE}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, GOEMON, Hazards.type.NONE) + add_stage(edo, "Edo Town", {MIDI.id.OEDO_EDO}, {MIDI.id.KAI_HIGHWAY}, {MIDI.id.MUSICAL_CASTLE}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, GOEMON, Hazards.type.NONE) add_bg_animation(EDO) add_stage(deku_tree_dl, "Deku Tree DL", {MIDI.id.KOKIRI_FOREST}, {MIDI.id.BRAWL_OOT}, {MIDI.id.SARIA}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.DEKU_TREE, variant_type.DL, 0x05, 0x05, 0x05, 0x03, 0x02, default_item_rate + 2, default_item_rate, ZELDA, Hazards.type.NONE) add_stage(zlanding_dl, "Crateria DL", {MIDI.id.CRATERIA_MAIN}, {MIDI.id.ZEBES_LANDING}, {MIDI.id.NORFAIR}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, id.ZLANDING, variant_type.DL, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, METROID, Hazards.type.NONE) @@ -4986,12 +4986,12 @@ scope Stages { add_stage(btp_goemon, "Board the Platforms", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTP, 0x00006810, 0x00006948, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) add_stage(twilight_city, "Twilight City", {MIDI.id.TWILIGHT_CITY}, {MIDI.id.SOUTHERNISLAND}, {MIDI.id.MARINE_FORTRESS}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, WAVERACE, Hazards.type.MOVEMENT) add_stage(melrode, "Melrode", {MIDI.id.QUEST64_BATTLE}, {MIDI.id.DECISIVE}, {MIDI.id.FF4BOSS}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, QUEST64, Hazards.type.NONE) - add_stage(meta_remix, "Meta Crystent", -1, {MIDI.id.METAL_BATTLE}, {MIDI.id.EASTON_KINGDOM}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.META_CRYSTAL, variant_type.REMIX, 0x05, 0x05, 0x05, default_blue_shell_rate + 1, default_lightning_rate + 1, default_item_rate, default_item_rate, MARIO_BROS, Hazards.type.NONE) + add_stage(meta_remix, "Meta Crystent", -1, {MIDI.id.METAL_BATTLE}, {MIDI.id.EASTON_KINGDOM}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, id.META_CRYSTAL, variant_type.REMIX, 0x05, 0x05, 0x05, default_blue_shell_rate + 1, default_lightning_rate + 1, default_item_rate, default_item_rate, MARIO_BROS, Hazards.type.NONE) add_stage(remix_rttf, "Remix 1p Race to the Finish", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) add_stage(reapers, "Grim Reaper's Cavern", {MIDI.id.GRIMREAPERSCAVERN}, {MIDI.id.WORLD_OF_ENVY}, {MIDI.id.ARIA_OF_THE_SOUL}, OS.FALSE, HAZARDS_OFF_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, JACKBROS, Hazards.type.NONE) add_stage(scuttle_town, "Scuttle Town", {MIDI.id.SHANTAEMEDLEY}, {MIDI.id.BURNINGTOWN}, {MIDI.id.SHANTAEBOSS}, OS.FALSE, HAZARDS_OFF_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, SHANTAE, Hazards.type.MOVEMENT) add_bg_animation(SCUTTLE_TOWN) - add_stage(big_boos_haunt, "Big Boo's Haunt", {MIDI.id.BIG_BOO}, {MIDI.id.HORROR_LAND}, {MIDI.id.GHOSTGULPING}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, MARIO_BROS, Hazards.type.MOVEMENT) + add_stage(big_boos_haunt, "Big Boo's Haunt", {MIDI.id.BIG_BOO}, {MIDI.id.HORROR_LAND}, {MIDI.id.GHOSTGULPING}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, MARIO_BROS, Hazards.type.MOVEMENT) add_bg_animation(BIG_BOOS_HAUNT) add_stage(yoshis_island_melee, "Dinosaur Land", {MIDI.id.SMW_ATHLETIC}, {MIDI.id.SMW_TITLECREDITS}, {MIDI.id.FORTRESS_BOSS}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, YOSHI, Hazards.type.MOVEMENT) add_stage(banjo_btt, "Break the Targets", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTT, 0x00005300, 0x00005970, 0x00005B80, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) @@ -4999,7 +4999,7 @@ scope Stages { add_stage(smashville_remix, "Smashville Remix", {MIDI.id.ANIMAL_CROSSING}, {MIDI.id.KK_RIDER}, {MIDI.id.7AM}, OS.TRUE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, id.SMASHVILLE2, variant_type.REMIX, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, ANIMAL_CROSSING, Hazards.type.MOVEMENT) add_stage(btp_banjo, "Board the Platforms", -1, {MIDI.id.TARGET_TEST}, {MIDI.id.TARGET_TEST}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.FALSE, class.BTP, 0x00007050, 0x00007188, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, NONE, Hazards.type.NONE) add_bg_animation(SMASHVILLE_REMIX) - add_stage(pokefloats, "Poke Floats", {MIDI.id.POKEFLOATS}, {MIDI.id.BATTLE_GOLD_SILVER}, {MIDI.id.GOLDENROD_CITY}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, POKEMON, Hazards.type.MOVEMENT) + add_stage(pokefloats, "Poke Floats", {MIDI.id.POKEFLOATS}, {MIDI.id.BATTLE_GOLD_SILVER}, {MIDI.id.GOLDENROD_CITY}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.FALSE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, POKEMON, Hazards.type.MOVEMENT) add_stage(big_snowman, "Big Snowman", {MIDI.id.BIG_SNOWMAN}, {MIDI.id.WENDYS_HOUSE}, {MIDI.id.SILVER_MOUNTAIN}, OS.FALSE, HAZARDS_ON_MOVEMENT_ON, OS.TRUE, OS.TRUE, class.BATTLE, -1, -1, -1, -1, -1, 0x05, 0x05, 0x05, default_blue_shell_rate, default_lightning_rate, default_item_rate, default_item_rate, SNOWBOARDKIDS, Hazards.type.MOVEMENT) map 0, 0, 256 // restore string mappings diff --git a/src/Toggles.asm b/src/Toggles.asm index 8c1002b0..48199b2f 100644 --- a/src/Toggles.asm +++ b/src/Toggles.asm @@ -1634,7 +1634,7 @@ scope Toggles { _random_menu_song: lli a0, Toggles.menu_music.MAX_VALUE - 4 // a0 - range (0, N-1) Menu Music values (excluding DEFAULT / RANDOM / RANDOM CLASSICS / RANDOM ALL / OFF) - jal Global.get_random_int_ // v0 = (0, N-1) + jal Global.get_random_int_safe_ // v0 = (0, N-1) nop b _check_bgm // loop back and check again addiu t0, v0, 1 // t0++ @@ -1642,7 +1642,7 @@ scope Toggles { _random_menu_song_classics: lli a0, Toggles.menu_music.MAX_VALUE - 4 // a0 - range (0, N-1) Menu Music values (excluding DEFAULT / RANDOM / RANDOM CLASSICS / RANDOM ALL / OFF) addiu a0, a0, -4 // also exclude MAIN / MAIN_MELEE / MAIN_BRAWL / MAIN_MENU2 - jal Global.get_random_int_ // v0 = (0, N-1) + jal Global.get_random_int_safe_ // v0 = (0, N-1) nop addiu v0, v0, 4 // if we're here, we need to apply offset b _check_bgm // loop back and check again @@ -1658,7 +1658,7 @@ scope Toggles { bgez a1, _play // play if any songs are ON sw r0, 0x0000(a0) // clear menu_randomizing_all flag // Easter Egg to handle if there were no songs to pick from - jal Global.get_random_int_alt_ // v0 = (0, N-1) + jal Global.get_random_int_safe_ // v0 = (0, N-1) addiu a0, r0, 4 // a0 = number of hidden Gameboy songs addiu a1, v0, 0xA2 // a1 = random bgm_id + offset to Gameboy songs b _play // play @@ -2050,7 +2050,7 @@ scope Toggles { entry_footstool:; entry_bool("Footstool Jumping", OS.FALSE, OS.FALSE, OS.FALSE, OS.FALSE, entry_air_dodge) entry_air_dodge:; entry("Air Dodging", Menu.type.INT, 0, 0, 0, 0, 0, 3, OS.NULL, string_table_air_dodge, OS.NULL, entry_jab_lock) entry_jab_lock:; entry_bool("Jab Locking", OS.FALSE, OS.FALSE, OS.FALSE, OS.FALSE, entry_ledge_jump) - entry_ledge_jump:; entry_bool("Edge C-Jumping", OS.FALSE, OS.FALSE, OS.FALSE, OS.FALSE, entry_perfect_shield) + entry_ledge_jump:; entry_bool("Ledge Jump", OS.FALSE, OS.FALSE, OS.FALSE, OS.FALSE, entry_perfect_shield) entry_perfect_shield:; entry_bool("Perfect Shielding", OS.FALSE, OS.FALSE, OS.FALSE, OS.FALSE, entry_spot_dodge) entry_spot_dodge:; entry_bool("Spot Dodging", OS.FALSE, OS.FALSE, OS.FALSE, OS.FALSE, entry_fast_fall_aerials) entry_fast_fall_aerials:; entry_bool("Fast Fall Aerials", OS.FALSE, OS.FALSE, OS.FALSE, OS.FALSE, entry_ledge_trump) @@ -2856,7 +2856,6 @@ scope Toggles { li v0, Global.current_screen // v0 = address of current_screen (note: keep v0 for routine) lbu a0, 0x0000(v0) // a0 = current screens addiu t1, r0, Global.screen._1P_CSS - li t0, 0x80137F5C // t0 = 1P routine beq a0, t1, _save_css_routine_1p addiu t1, r0, Global.screen.VS_CSS li t0, 0x8013A664 // t0 = VS routine @@ -2886,7 +2885,16 @@ scope Toggles { nop _save_css_routine_1p: + li a0, 0x80138FB4 // a0 = address of current 1P settings + lw t0, 0x0000(a0) // t0 = difficulty level (0-4) + lw t1, 0x0004(a0) // t1 = stock count (0-4) + + li a0, 0x800A493A // a0 = stored 1P settings + sb t0, 0x0000(a0) // update stored difficulty level + sb t1, 0x0001(a0) // update stored stock count + li a0, 0x80138EE8 // a0 = address of currently selected 1P character + li t0, 0x80137F5C // t0 = 1P routine _save_css_routine: jalr t0 // call save css routine nop diff --git a/src/ZCancel.asm b/src/ZCancel.asm index 21ef20f5..35a1695e 100644 --- a/src/ZCancel.asm +++ b/src/ZCancel.asm @@ -198,6 +198,11 @@ scope ZCancel { OS.patch_end() // s1 = player struct // t6 is safe + // at is boolean for a CPU z cancel that was set in 'AI.z_cancel_' + + bnez at, _cpu_z_cancel // branch accordingly + nop + li t6, Toggles.entry_z_cancel_opts lw t6, 0x0004(t6) // t0 = 0 for DEFAULT, 1 for Disabled, 2 for Melee, 3 for Auto, 4 for Glide beqz t6, _default // branch accordingly @@ -211,6 +216,21 @@ scope ZCancel { beq at, t6, _default // branch accordingly nop + // if we're here, this is a CPU z cancel + _cpu_z_cancel: + li t6, Toggles.entry_z_cancel_opts + lw t6, 0x0004(t6) // t0 = 0 for DEFAULT, 1 for Disabled, 2 for Melee, 3 for Auto, 4 for Glide + beqz t6, _z_cancel_success // branch accordingly + lli at, 0x0001 // t1 = 1 (Disabled) + beq at, t6, _return // branch accordingly + lli at, 0x0002 // t1 = 2 (Melee) + beq at, t6, _z_cancel_success // branch accordingly + lli at, 0x0003 // t1 = 3 (Auto) + beq at, t6, _z_cancel_success // branch accordingly + lli at, 0x0004 // t1 = 4 (Glide) + beq at, t6, _z_cancel_miss // branch accordingly + nop + // Melee cancel window (7 frames instead of 11) _z_cancel_melee: lw t6, 0x0160(v1) // t6 = frames since 'Z' pressed diff --git a/src/items/DekuNut.asm b/src/items/DekuNut.asm index 64755682..71995431 100644 --- a/src/items/DekuNut.asm +++ b/src/items/DekuNut.asm @@ -4,7 +4,7 @@ constant SPAWN_ITEM(spawn_deku_nut_) // bomb is 0x80177D9C constant SHOW_GFX_WHEN_SPAWNED(OS.TRUE) constant PICKUP_ITEM_MAIN(pickup_deku_nut) constant PICKUP_ITEM_INIT(prepickup_) // prepickup -constant DROP_ITEM(drop_item_) // same as Maxim Tomato, but removes damage type +constant DROP_ITEM(throw_initial_) constant THROW_ITEM(throw_initial_) constant PLAYER_COLLISION(0) @@ -172,23 +172,23 @@ scope prepickup_: { // @ Description // Custom item drop routine with vanilla logic too -scope drop_item_: { - addiu sp, sp, -0x18 - sw ra, 0x0014(sp) - sw v0, 0x0010(sp) +// scope drop_item_: { + // addiu sp, sp, -0x18 + // sw ra, 0x0014(sp) + // sw v0, 0x0010(sp) - sw r0, 0x011C(v0) // damage type = normal + // sw r0, 0x011C(v0) // damage type = normal - jal 0x801745FC // item drop subroutine for tomato - nop - lw v0, 0x0010(sp) + // jal 0x801745FC // item drop subroutine for tomato + // nop + // lw v0, 0x0010(sp) - sw r0, 0x140(v0) // set kb to 0 + // sw r0, 0x140(v0) // set kb to 0 - lw ra, 0x0014(sp) - jr ra - addiu sp, sp, 0x18 -} + // lw ra, 0x0014(sp) + // jr ra + // addiu sp, sp, 0x18 +// } // @ Description // based on bobbomb throw routine @ 0x80177590 diff --git a/src/items/Pitfall.asm b/src/items/Pitfall.asm index cc832210..f7165212 100644 --- a/src/items/Pitfall.asm +++ b/src/items/Pitfall.asm @@ -4,7 +4,7 @@ constant SPAWN_ITEM(stage_setting_) // bomb is 0x80177D9C constant SHOW_GFX_WHEN_SPAWNED(OS.TRUE) constant PICKUP_ITEM_MAIN(pickup_item) constant PICKUP_ITEM_INIT(prepickup_) // prepickup -constant DROP_ITEM(drop_item_) +constant DROP_ITEM(throw_initial_) constant THROW_ITEM(throw_initial_) constant PLAYER_COLLISION(0) @@ -159,21 +159,22 @@ scope stage_setting_: { } -scope drop_item_: { - addiu sp, sp, -0x18 - sw ra, 0x0014(sp) - sw v0, 0x0010(sp) - sw r0, 0x011C(v0) // damage type = normal - jal 0x801745FC // item drop subroutine for tomato - nop - lw v0, 0x0010(sp) - sw r0, 0x0140(v0) // set kb to 0 - sw r0, 0x0144(v0) // set kb to 0 - sw r0, 0x0148(v0) // set kb to 0 - lw ra, 0x0014(sp) - jr ra - addiu sp, sp, 0x18 -} +// not used +// scope drop_item_: { + // addiu sp, sp, -0x18 + // sw ra, 0x0014(sp) + // sw v0, 0x0010(sp) + // sw r0, 0x011C(v0) // damage type = normal + // jal 0x801745FC // item drop subroutine for tomato + // nop + // lw v0, 0x0010(sp) + // sw r0, 0x0140(v0) // set kb to 0 + // sw r0, 0x0144(v0) // set kb to 0 + // sw r0, 0x0148(v0) // set kb to 0 + // lw ra, 0x0014(sp) + // jr ra + // addiu sp, sp, 0x18 +// } diff --git a/src/items/WaddleDee.asm b/src/items/WaddleDee.asm index 0c78b13c..90b64a80 100644 --- a/src/items/WaddleDee.asm +++ b/src/items/WaddleDee.asm @@ -215,6 +215,11 @@ scope stage_setting_: { li t1, minion_blast_zone_ // load waddle_dee blast zone routine sw t1, 0x0398(v1) // save routine to part of item special struct that carries unique blast wall destruction routines + //disable clang + lh t0, 0x0158(v1) // t0 = clang bitfield + andi t0, t0, 0x7FFF // disable clang + sh t0, 0x0158(v1) // ~ + // set direction lw t1, 0x0038(sp) // a0 = player object lw t1, 0x0084(t1) // t1 = player struct @@ -1356,6 +1361,9 @@ scope check_for_targets_: { lw s0, 0x0008(a0) // s0 = player owner lw s2, 0x0084(s0) // s2 = player owner struct + beqz s2, _player_loop_exit // exit if no player owner (can happen against 1P Dedede Team) + nop + _player_loop: beqz s1, _player_loop_exit // exit loop when s1 no longer holds an object pointer nop @@ -1755,29 +1763,42 @@ scope remove_minion_check_: { // slot 1 should always contain the oldest minion. scope minion_free_: { lw v0, 0x0084(a0) // v0 = minion struct - lw v1, 0x01C4(v0) // v1 = player owner object - lw v1, 0x0084(v1) // v1 = player owner struct - lw at, 0x0B20(v1) // get held minion ptr - beql at, a0, _continue // branch if... - sw r0, 0x0B20(v1) // ...held minion = this minion - _continue: - lw at, 0x0ADC(v1) // at = slot 1 minion object - beql at, a0, _move_slot_2_to_slot_1 - sw r0, 0x0ADC(v1) // remove self from player struct - lw at, 0x0AE0(v1) // at = slot 2 minion object - beql at, a0, _end - sw r0, 0x0AE0(v1) // remove self from player struct - - // if here, no action needed. - _end: + lw v1, 0x01C4(v0) // v1 = player owner object + + // check if owner is still around + OS.read_word(0x800466FC, t1) // t1 = player object head + _player_loop: + beqz t1, _end // exit loop when t1 no longer holds an object pointer + nop + beq t1, v1, _free_minion // loop if current player and target object match... + nop + + b _player_loop // loop + lw t1, 0x0004(t1) // t1 = next player object + + _free_minion: + lw v1, 0x0084(v1) // v1 = player owner struct + lw at, 0x0B20(v1) // get held minion ptr + beql at, a0, _continue // branch if... + sw r0, 0x0B20(v1) // ...held minion = this minion + _continue: + lw at, 0x0ADC(v1) // at = slot 1 minion object + beql at, a0, _move_slot_2_to_slot_1 + sw r0, 0x0ADC(v1) // remove self from player struct + lw at, 0x0AE0(v1) // at = slot 2 minion object + beql at, a0, _end + sw r0, 0x0AE0(v1) // remove self from player struct + + // if here, no action needed. + _end: jr ra - nop + nop - _move_slot_2_to_slot_1: - lw at, 0x0AE0(v1) // at = newest minion (or 0) - sw at, 0x0ADC(v1) // overwrite slot 1 with it. + _move_slot_2_to_slot_1: + lw at, 0x0AE0(v1) // at = newest minion (or 0) + sw at, 0x0ADC(v1) // overwrite slot 1 with it. jr ra - sw r0, 0x0AE0(v1) // clear value in slot 2 + sw r0, 0x0AE0(v1) // clear value in slot 2 } diff --git a/src/linkshared.asm b/src/linkshared.asm index 61cf940a..5058f772 100644 --- a/src/linkshared.asm +++ b/src/linkshared.asm @@ -668,6 +668,10 @@ scope LinkShared { lui at, 0x428E // at = float: 71 beq t1, t0, _end // end if character id = JLINK nop + ori t1, r0, Character.id.ELINK // t1 = id.ELINK + lui at, 0x4290 // at = float: 72 + beq t1, t0, _end // end if character id = ELINK + nop lui at, 0x428A // at = float: 69 (original line 1) _end: diff --git a/src/music/sonic2_special.bin b/src/music/sonic2_special.bin index 62f88c7f..027fbcbf 100644 Binary files a/src/music/sonic2_special.bin and b/src/music/sonic2_special.bin differ diff --git a/src/stages/profiles/no_omega.asm b/src/stages/profiles/no_omega.asm index da57caa1..0d28ddc9 100644 --- a/src/stages/profiles/no_omega.asm +++ b/src/stages/profiles/no_omega.asm @@ -107,3 +107,19 @@ add_to_stage_profile(no_omega, draculas_castle) add_to_stage_profile(no_omega, dragonking_remix) add_to_stage_profile(no_omega, mt_dedede) add_to_stage_profile(no_omega, glacial_remix) +add_to_stage_profile(no_omega, edo) +add_to_stage_profile(no_omega, deku_tree_dl) +add_to_stage_profile(no_omega, zlanding_dl) +add_to_stage_profile(no_omega, first_remix) +add_to_stage_profile(no_omega, twilight_city) +add_to_stage_profile(no_omega, melrode) +add_to_stage_profile(no_omega, meta_remix) +add_to_stage_profile(no_omega, reapers) +add_to_stage_profile(no_omega, scuttle_town) +add_to_stage_profile(no_omega, big_boos_haunt) +add_to_stage_profile(no_omega, yoshis_island_melee) +add_to_stage_profile(no_omega, spawned_fear) +add_to_stage_profile(no_omega, smashville_remix) +add_to_stage_profile(no_omega, pokefloats) +add_to_stage_profile(no_omega, big_snowman) +add_to_stage_profile(no_omega, battlefield_dl) diff --git a/src/stages/profiles/no_variant.asm b/src/stages/profiles/no_variant.asm index fa6c11c8..7e3b2d7a 100644 --- a/src/stages/profiles/no_variant.asm +++ b/src/stages/profiles/no_variant.asm @@ -9,7 +9,6 @@ add_to_stage_profile(no_variant, congo_jungle) add_to_stage_profile(no_variant, planet_zebes) add_to_stage_profile(no_variant, hyrule_castle) add_to_stage_profile(no_variant, yoshis_island) -add_to_stage_profile(no_variant, mini_yoshis_island) add_to_stage_profile(no_variant, saffron_city) add_to_stage_profile(no_variant, mushroom_kingdom) add_to_stage_profile(no_variant, meta_crystal) @@ -32,8 +31,6 @@ add_to_stage_profile(no_variant, frays_stage) add_to_stage_profile(no_variant, frays_stage_night) add_to_stage_profile(no_variant, toh) add_to_stage_profile(no_variant, fod) -add_to_stage_profile(no_variant, mementos) -add_to_stage_profile(no_variant, showdown) add_to_stage_profile(no_variant, spiralm) add_to_stage_profile(no_variant, n64) add_to_stage_profile(no_variant, mute) @@ -58,7 +55,6 @@ add_to_stage_profile(no_variant, corneriacity) add_to_stage_profile(no_variant, osohe) add_to_stage_profile(no_variant, world1) add_to_stage_profile(no_variant, flat_zone) -add_to_stage_profile(no_variant, flat_zone_2) add_to_stage_profile(no_variant, gerudo) add_to_stage_profile(no_variant, goomba_road) add_to_stage_profile(no_variant, bowsers_keep) @@ -81,4 +77,17 @@ add_to_stage_profile(no_variant, ghz) add_to_stage_profile(no_variant, toadsturnpike) add_to_stage_profile(no_variant, rainbowroad) add_to_stage_profile(no_variant, draculas_castle) -add_to_stage_profile(no_variant, mt_dedede) \ No newline at end of file +add_to_stage_profile(no_variant, mt_dedede) +add_to_stage_profile(no_variant, edo) +add_to_stage_profile(no_variant, deku_tree_dl) +add_to_stage_profile(no_variant, zlanding_dl) +add_to_stage_profile(no_variant, first_remix) +add_to_stage_profile(no_variant, twilight_city) +add_to_stage_profile(no_variant, melrode) +add_to_stage_profile(no_variant, reapers) +add_to_stage_profile(no_variant, scuttle_town) +add_to_stage_profile(no_variant, big_boos_haunt) +add_to_stage_profile(no_variant, yoshis_island_melee) +add_to_stage_profile(no_variant, spawned_fear) +add_to_stage_profile(no_variant, pokefloats) +add_to_stage_profile(no_variant, big_snowman)