WRP_Beater

Mickey Mania PS1 autosplitter

May 16th, 2021
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.35 KB | None | 0 0
  1. //Installation: name this file Livesplit.MickeyMania.asl, put it anywhere you want. In Livesplit, go to edit layout, add -> control -> scriptable auto splitter, and find the file's path. If you did it correctly, you should see some options.
  2.  
  3. //IMPORTANT: Note that you still have to start and stop the timer yourself. If the autosplitter doesn't work, maybe you are using a different version of the emulator. In this case, you can open Cheat Engine and look for the address of the level indicator value. To do so, open the game, select the process in Cheat Engine, and make sure you activate level select in game.
  4.  
  5. //Instructions to find the level indicator address and add a new emulator: Press start game and make sure Steamboat is displayed. With Cheat Engine, do a scan for a 4 byte value that has value 0 (first scan). Next, press right on the dpad to highlight Wharf, and search for value 1. Next, highlight Outside Lab and search for value 2. Repeat until it's obvious which address contains the value you need. Double click the address to save it in the address list below. There, double click the address. You will see a window with the base module and offset: for example, doing this on BizHawk gives me address octoshock.dll+3BDB70. This means the base module is octoshock.dll, and the offset is 0x3BDB70.
  6. //In the first state environment below, replace "epsxe" with the executable name of your emulator, and replace the definition of byte level with the following:
  7. // byte level : "base module", 0x###;
  8. //replacing of course the base module and the offset with the ones you obtained from Cheat Engine. If the base module is the same as the executable (as is the case with ePSXe), you don't need to write it.
  9.  
  10. //Instructions to find the loading indicator address: This address should be exactly 53C greater than the level indicator that you found previously. Try to calculate what it should be with a hex calculator. For example, for ePSXe below, notice that the offset for loading is B3213C, which is B31C00 + 53C. Check with Cheat Engine that the value you obtain behaves as expected: what I know about this value is that it returns 1 while the game is loading (Mickey idle animation loading screen) and that it returns 0 during gameplay, on menus and during cutscenes (including the blue screens with text). If the previous value does not work, then do some scans based on this information.
  11.  
  12. //For any questions, reach out to WRP_Beater in the Discord server linked in https://www.speedrun.com/mickey_mania/thread/zrj1e
  13.  
  14. //If you wish to improve the autosplitter to also start and stop the timer, simply look for some relevant addresses and reach out to me so I can implement them here.
  15.  
  16. state("epsxe", "1") //tested on ePSXe 2.0.5
  17. {
  18.   byte level : 0xB31C00;
  19.   byte loading : 0xB3213C;
  20. }
  21.  
  22. state("emuhawk", "2") //tested on BizHawk 2.4.2
  23. {
  24.   byte level : "octoshock.dll", 0x3BDB70;
  25.   byte loading : "octoshock.dll", 0x3BE0AC;
  26. }
  27.  
  28. state("retroarch", "3") //tested on Retroarch 1.7.3, only supports Beetle PSX and Beetle PSX HW cores. Edit comments below if using HW
  29. {
  30.   byte level : "mednafen_psx_libretro.dll", 0x5948E0; //use this if you use Beetle PSX core, comment if using Beetle PSX HW
  31.   //byte level : "mednafen_psx_hw_libretro.dll", 0x760900; //uncomment this if you use Beetle PSX HW core
  32.   byte loading : "mednafen_psx_libretro.dll", 0x594E1C; //for Beetle PSX
  33.   //byte loading : "mednafen_psx_hw_libretro.dll", 0x760E3C // for Beetle PSX HW
  34. }
  35.  
  36. init{}
  37.  
  38. startup
  39. { //these are the settings you see when you edit the layout element in livesplit; don't change them here
  40.   settings.Add("allsplit", false, "Split after every screen (if activating this, settings below don't matter)");
  41.   settings.Add("null1", false, "------------------------------------------");
  42.   settings.Add("loadless", true, "Remove loading times. Make sure comparison is set to game time");
  43.   settings.Add("null2", false, "------------------------------------------");
  44.   settings.Add("null3", false, "Uncheck the three options below if you don't have a Pete split:");
  45.   settings.Add("dungeon", false, "End Prince and the Pauper split after The Dungeon");
  46.   settings.Add("tower", false, "End Prince and the Pauper split after Up the Tower");
  47.   settings.Add("escape", true, "End Prince and the Pauper split after The Escape!");
  48. }
  49.  
  50. split
  51. {
  52.   if (settings["allsplit"]) {
  53.     return (old.level != current.level); //this splits on every screen if the corresponding option is checked
  54.   }
  55.  
  56.   else if (current.level == 22) {
  57.     return (old.level != current.level && settings["dungeon"]); //this splits after The Dungeon if checked
  58.   }
  59.  
  60.   else if (current.level == 23) {
  61.     return (old.level != current.level && settings["tower"]); //this splits after Up the Tower if checked
  62.   }
  63.  
  64.   else if (current.level == 24) {
  65.     return (old.level != current.level && settings["escape"]); //this splits after The Escape if checked
  66.   }
  67.   else if (current.level == 2 || current.level == 9 || current.level == 11 || current.level == 14 || current.level == 19) {
  68.     return (old.level != current.level); //this splits at the start of screens 2 (Outside Lab), 9 (Moose Hunt), 11 (Ghost House), 14 (Nice Garden), 19 (The Library)
  69.   }
  70.   else {
  71.     return (false);
  72.   }
  73. }
  74.  
  75. isLoading
  76. {
  77.   if (current.loading == 1 && settings["loadless"]) {
  78.     return (true); //this freezes the timer during loading
  79.   }
  80.   else {
  81.     return (false);
  82.   }
  83. }
Add Comment
Please, Sign In to add comment