Leaderboard


Popular Content

Showing content with the highest reputation on 05/31/2021 in all areas

  1. 2 points
    "Might as well jump!" - Van Halen The last update mentioned the mystery of the unconditional jump at the end of a subroutine, and explained it's a return statement. Let's look at it in a bit more detail. 7054 CONSTS [ 7059 CPTOPSP -4 1 7067 ADDxx 7069 CONSTS ] 7074 ADDxx 7076 CPDOWNSP -6 1 7084 MOVSP -4 7090 JMP 7108 *7096 MOVSP -1* //Dead code *7102 MOVSP -3* //Dead code 7108 MOVSP -1 7114 RETN Why is this happening? It's the result of the compiler building the subroutine in stages. Let's separate the op codes into subroutine Parts: Part 2 7054 CONSTS [ 7059 CPTOPSP -4 1 7067 ADDxx 7069 CONSTS ] 7074 ADDxx 7076 CPDOWNSP -6 1 Part 3 (New) 7084 MOVSP -4 7090 JMP 7108 7096 MOVSP -1 Part 3 (Original) 7102 MOVSP -3 Part 4 7108 MOVSP -1 7114 RETN Oho! This subroutine returns a value (Part 2), clears local variables (Part 3), and clears arguments (Part 4). But, why are there two Part 3's? Top to bottom, the stack looks like this: Temporary return values Local variables Arguments Return values The compiler first writes the code for clearing the arguments (Part 4), which is easy because there is a fixed number. Then, it writes code for clearing the local variables (Part 3 - Original). In the example, the subroutine has 3 local variables. Next, the compiler calculates the number of values returned in Part 2 and adds that to the number of local variables. The result is 3 + 1. The compiler does not remove the original Part 3, so it's necessary to jump over it (Part 3 - New). So, why is there a MOVSP after the jump? As far as I can tell, it's a quirk of the compiler. Part 2 returns a value by evaluating a set of expressions. The result is then copied down the stack past the arguments. The result is then cleared in the new Part 3. However, the compiler inserts a MOVSP after the jump that would have cleared the result of the last expression. That leaves us with two MOVSPs that are jumped over: one to clear the local variables, and one to clear the last expression (in this case, the return value). I'm rewriting my code to take advantage of this. Instead of calculating all of the changes made to the stack in order to find the subroutine signature, it could be easier to look for a jump and evaluate the code around it. The question is how to handle subroutines that don't return values, and therefore lack the jump... This newfound knowledge is useful for another reason: I now know how to properly analyze switch statements. More in a future post.
  2. 1 point

    Version 1.0

    48,676 downloads

    A KNIGHTS OF THE OLD REPUBLIC MODIFICATION High Quality Cockpit Skyboxes By Sithspecter Description: Through the course of Knights of the Old Republic, the Ebon Hawk become's the player's home. Complete with a workbench, engine room, crew quarters, and racy swoop bike, the Ebon Hawk doesn't lack much. Except for a view, that is. Looking out the cockpit windows is less than inspiring, given the blurry and inaccurate view presented. After tjsase released his High Quality Cockpit Skyboxes for TSL, I knew the first game needed the same treatment. This mod completely replaces the existing cockpit skybox with a newly modeled and textured skybox with HD textures. The skybox has been rendered to reasonably accurate perspective, and shows you a real, crisp view of the landing area. Use: Use of High Quality Cockpit Skyboxes is extremely easy: Put all the files in your Override folder and then play! That's it! The new models and textures will automatically appear when you load up your last save. If the Ebon Hawk is taking too long to load, see "Texture Quality" below. Installation: 1. Open the .zip file for the mod 2. Open the folder labeled override 3. Extract all the files to your KotOR override folder Incompatibility: This mod should be compatible with any mod. I do not know of any other mods that alter the Ebon Hawk skybox, so it should be fine with any combination of mods. Texture Quality: Due to the way the skybox is set up and the massive file sizes used in this mod, the Ebon Hawk will take about 5-10 seconds longer to load each time. There are four different size versions available on Nexus and Deadly Stream to suit different player needs. If the Ebon Hawk it taking too long to load, you can download smaller version to reduce load time somewhat: Extra Large: 2048 by 2048 textures, best quality, longest load time Large: 1536 by 1536 textures, great quality, long load time Medium: 1024 by 1024 textures, good quality, reduced load time Small: 512 by 512 textures, reduced quality, fastest load time Credit: Credit goes to tjsase for inspiration from your TSL High Quality Cockpit Skyboxes and for giving me permission to do this mod. Credit goes to Kexikus for the inspiration from your screenshots. They look fantastic so I modeled the screenshots for this mod after your High Definition Skyboxes mod. Permissions: Do not upload this mod or assets from this mod, modified or not, to other sites without my express permission. I have uploaded this mod to multiple sites and can provide support on those sites. Legal: THIS MODIFICATION IS PROVIDED AS-IS AND IS NOT SUPPORTED BY BIOWARE/OBSIDIAN ENTERTAINMENT, LUCASARTS, DISNEY OR ANY LICENSERS/SPONSORS OF THE MENTIONED COMPANIES. USE OF THIS FILE IS AT YOUR OWN RISK AND THE ABOVE MENTIONED COMPANIES OR THE AUTHOR IS NOT RESPONSIBLE FOR ANY DAMAGE CAUSED TO YOUR COMPUTER FOR THE USAGE OF THIS FILE.
  3. 1 point

    Version 2.2

    110,767 downloads

    ABOUT: This mod replaces every skybox and every planetary backdrop in the game with a new high resolution version made from scratch. This includes a replacement of every skybox model to fix all the glaring issues with the original. There are also some additional minor changes that either fix issues with the vanilla environments or serve to better blend ingame terrain and skybox. Other than that I recommend you just check out the screenshots as pictures say more than a thousand words or check the video to see the animated skyboxes. Click the following image to see additional interactive screenshot comparisons: There are also add-ons with new skyboxes for the following mods: Brotherhood of Shadows: Solomon's Revenge Yavin IV Ord Mandell including InSidious' reskin Green Grass for Dantooine If you find any issues or have any other comments, please let me know and I'll see what can be done. INSTALLATION: If you have a previous version of this mod installed, remove it before installing the new version or you might run into some issues. For installation instructions check the read-me files of the individual downloads. Usually it's just copying files to your Override folder. For the mod to take full effect you need a savegame where you have not yet left Dantooine. COMPABILITY: This mod is not compatible with any mod that edits skyboxes in any way. This includes mods that only edit their models. There might also be rare incompabilities with mods that edit non-skybox area models if those models are also edited by this mod. PERMISSIONS: You may NOT redistribute any textures included in this archive without my explicit permission. You may however use all the models as long as you give me credit. CREDITS: This mod was created by Kexikus using mainly Terragen 4, Photoshop CS6 and 3ds Max as well as some After Effects. Additional tools used: KotOR Tool by Fred Tetra K-GFF by TK102 MDL edit by bead-v MDLOps by ndix UR KOTORmax by bead-v tga2tpc by ndix UR Additional resources by: Andy Welder: Dantooine tree model Animum: Yavin tree model Bioware: Taris buildings, Kashyyyk buildings, Kashyyyk tree textures, Manaan building textures, Hammerhead cruiser model, Yavin ruins dandelO: grass shader Dantooine and Yavin, snow shader Dantooine Jeronimoe: BOS:SR Taris ship models Jorak Uln: Taris window texture killst4r: Unknown World palm tree Martin Frank: Yavin bush model Misha Winkler: Grass model Dantooine and Yavin Quanon: Additional Taris buildings, Unknown World crashed ship rhcreations: Yavin temple Riccardo Faidutti (SCIFI 3D): Additional Taris buildings Solarsystem Scope: Moon textures Dantooine, Unknown World and Ord Mandell, Yavin texture Tom Patterson: Yavin cloud texture Veronica Bush: Yavin bush model Yughues: Kashyyyk branch texture Unknown: Unknown World fern model THIS MOD IS NOT SUPPORTED BY LUCASARTS OR BIOWARE. USE THIS FILE AT YOUR OWN RISK. NEITHER THE AUTHOR OF THIS MOD NOR THE COMPANIES MENTIONED ABOVE ARE RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER WHEN USING THIS FILE.