Views: 845,440,564
30 users online: 7 up,  Amine Retro,  bebn legg, Centipede, Daizo Dee Von, DeppySlide, Dobosco,  E-man38, Earthling, Epic_stuff, Everest, FrozenQuills, Green Jerry,  JamesD28, Knight of Time, Lumy, Maruhai,  Nameless, Pedroalone, qantuum, Reese_Pufferson, RetroJunky.T, SamuM6pdt, savagecabbage,  Sinc-X, SLBros., toad64, Ultima, xamexer, YamiMario - Guests: 58 - Bots: 77 Users: 46,497 (2,735 active)
Latest: peepee123
Tip: Do not set the music bypass to 00 in a level with a P-switch/star; the music will endlessly loop.Not logged in.
FreeRAM handling library (WIP, feedback welcome)
Forum Index - SMW Hacking - Resource & Tool Releases - FreeRAM handling library (WIP, feedback welcome)
Pages: « 1 »
This is a library which handles managing FreeRAM addresses for you. It is quite flexible, supporting both SA-1 and LoROM, and is compatible with most tools with only a few lines of code changed (this is mostly due to needing to pass extra info on to Asar, which I really couldn't avoid). It allows you to share FreeRAM values between different types of resources too (e.g. blocks and UberASM).

Currently, it's integrated with Asar, so any tool that uses Asar underneath should be able to use this.

Usage for regular users: First, download the modified version of asar which is compatible with this. (exe, dll - rename the dll to just asar.dll to get tools to recognize it though!). Then download the library freeram.dll and keep it around next to asar (both asar.dll and asar.exe). Then, download the SMW base ram description and rename it to <your_rom_name>.ramdesc. After this, you're good to go, just insert some resources that utilize this freeram library (that means you're currently limited to patches only, and no existing patches have been converted to use it yet, soo... just wait a bit). You'll know if you did something wrong because you'll get errors. (Linux users: clone the Asar repository and checkout the freeram branch. Then build like you normally build asar. For the freeram library, clone its repository and build it with CMake.)

Usage for patch/ASM developers: The version of asar included here has a single new function simply called "freeram". It takes 3 arguments: identifier, size and flags. Identifier can be any valid C-style identifier (start with alphabetical or underscore, continue with alphanumeric or underscore) and is used to uniquely identify this freeram (this is what allows you to share freeram between e.g. sprites and blocks). Size should be obvious, it's how many bytes of free RAM you're requesting. Flags is a bit more complicated: it's a comma-separated list of flags which allows you to place certain restrictions on the type of RAM you get assigned. Each region of unused RAM in SMW is assigned a set of flags. These include things like when is the RAM cleared (on level load, on reset, on overworld load, etc), what region of memory is it in (whether it's direct page, <$1FFF, or a long address), and what enhancement chips this address is available on. If, when requesting RAM, you prefix a flag with -, you are explicitly requesting RAM that doesn't have that flag set. Another thing to note is that some addresses have flags prefixed with @. This means you'll never be assigned a freeram with those flags unless you explicitly request them. This is useful for things like SA1-only addresses.

Usage for tool developers that wish to use this outside of asar: The github readme provides documentation of the C API.

This is not quite finished yet: The base ramdesc file still needs filling in. Currently, it's missing all SA-1 exclusive addresses, and it's missing claims for tools that use hardcoded memory locations (e.g. Lunar Magic, most Sprite Tools). The ramdesc format is also documented on github.

In the next few days, I'll port most common tools to add support for this, and then (if this thing becomes accepted enough), I'll convert existing resources using freeram to use this library too.
Oh my goodness this is so useful! Thank you for doing this.
this is actually very useful. Awesome!

Currently working on:
Super Kekcroc World 3
Thanks for the awesome tool, I look forward to using it.
Thumbs up on this one!
Posting posts around at the speed of sound. Got places to go, gotta follow my rainbow!
Remember to wash your hands and stay safe!
“Even if you personally are so dissatisfied with life that you want the world to end, surely the cruel reality is that it will continue on, unchanging. All the better for someone perfectly content, like me.”Aya Shameimaru, Touhou Suzunaan ~ Forbidden Scrollery
Pages: « 1 »
Forum Index - SMW Hacking - Resource & Tool Releases - FreeRAM handling library (WIP, feedback welcome)

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2020 - SMW Central
Legal Information - Privacy Policy - Link To Us


Follow Us On

  • YouTube
  • Twitch
  • Twitter


  • Super Mario Bros. X Community
  • Mario Fan Games Galaxy