Banner
Views: 771,795,280
Time:
18 users online: Alejendroxxx84,  bebn legg, BlueZy, chickaDEE Magazine, Diego Kaizo, ExONightZ, Flamesofshadow, Fullcannon, Infinity, izaguirrefermin28, NatsuFireball, Nowieso, placeholder02, placeholdertest, Roberto zampari, SammmUuU, Sancles, Tob - Guests: 64 - Bots: 230Users: 40,542 (1,856 active)
Latest: Alejendroxxx84
Tip: Check out the Current Contests & Events forum to participate in any hacking contests that may be going on.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!

--------------------
Current Projects:
Super Kekcroc World 2
Thanks for the awesome tool, I look forward to using it.
Thumbs up on this one!
Just to remember guys: All you need is heal. #HelpKyoAniHeal
Recommended coding font: Iosevka
Is there still anything that love can do?
“Well, don’t think you can beat us just because we’re women.”Sheena, Tales of Symphonia
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 - 2019 - SMW Central
Legal Information - Privacy Policy - Link To Us


Total queries: 9

Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Talkhaus
  • SMBX Community
  • GTx0
  • Super Luigi Bros
  • ROMhacking.net
  • MFGG
  • Gaming Reinvented