Language…
16 users online:  AmperSam,  Anorakun, CalHal, DoubleCakes, gui, h.carrell, Hammerer, Israelcv12cv, lirdufu, MariGanza 1995, MellowYouth, MM102, SeoMa, Sheilal14, ShoopDaWhoop, Tulip Time Scholarship Games - Guests: 127 - Bots: 347
Users: 64,662 (2,405 active)
Latest user: lirdufu

Asar v1.90

Tools → Asar v1.90

Submission Details

Name: Asar v1.90
Authors: Alcaro, Check changelog for full list
Added:
Version History: View
Operating System: Windows, Mac OS X, Linux
Platforms: SNES
Games: General
Source Available: Yes
Featured: Essential
Website: Link
Description: Asar is a Super Nintendo assembler based on xkas v0.06. It's the assembler used primarily on SMW Central.

Asar's got a freespace finder, will ask for filenames if double clicked, can use parentheses and proper priority in math, can assemble SPC-700 and SuperFX codes, and has many, many other neat little features. The full list of features can be found in the manual.

Some of the new features in Asar 1.90:
  • For loops that look like for i = 0..123, which are a more convenient notation for while loops.
  • spcblock is a new, more flexible replacement for arch spc700-inline.
  • "static" labels (that is, labels that are defined with the label = $123456 syntax) can now be used in if conditions.
  • freecode can now be used in HiROM, ExHiROM, and ExLoROM mappers.
  • New pc() and realbase() math functions.

1.90 also deprecates a lot of features that will be removed in 2.0. For more details, check the changelog and the release announcement thread. For more details about new features, see the manual.

Source code can be found on GitHub, where you can also contribute using issues and pull requests.
Tags: assembler patcher
Comments: 120 (jump to comments)
Rating:
4.5 (2 ratings)
No rating
Download 583.18 KiB | 14,394 downloads

Comments (120)

 Atari2.0 Link
LGTM, tested on Windows 10, 22H2 (OS Build 19045.4123)
Tested by applying all the patches in the site one by one and checking output almost-equivalence with previous asar version (total equivalence is impossible due to changes in the freespace finder algorithm).
bandicoot Link
my windows gave an virus warning when I downloaded this, some trojan file.
 NinCollin Link
It's definitely just a false positive; double checking on VirusTotal yields nothing anyways
Joosh From older version: Asar v1.81 Link
Originally posted by RPG Hacker
That sounds like you're not passing the ROM file to Asar correctly (or perhaps, not passing a ROM file to Asar at all).


ASAR asks for a patch and I type "[patchname].asm"
Next it asks for the ROM and I type "[romname].smc"
Am I missing a step?
 RPG Hacker From older version: Asar v1.81 Link
If both files are in the same directory as Asar, it shoud work.
Can you verify the file size of your ROM? It should be 1 MB or larger. If that's not the case, you're likely trying to use a corrupt rom.
A read at $00FFD5 failing is something I can only imagine happening if either you're not providing a ROM file, or you're providing an incorrect ROM file (smaller than 1 MB).
Joosh From older version: Asar v1.81 Link
When I try to apply asm to my .smc rom file, I get the following error:
"retry.asm:23: error: (E5039): SNES address 00FFD5 in read function out of bounds. [if read1($00FFD5) == $23]
retry.asm:40: error: (E5039): SNES address 01E762 in read function out of bounds. [if read2($01E762) == $EAEA && read1($009EF0) != $00]
retry.asm:48: error: (E5039): SNES address 05DAA3 in read function out of bounds. [if read1($05DAA3) == $5C]
Errors were detected while assembling the patch. Assembling aborted. Your ROM has not been modified."
I could not find a solution in the user's manual.
 RPG Hacker From older version: Asar v1.81 Link
That sounds like you're not passing the ROM file to Asar correctly (or perhaps, not passing a ROM file to Asar at all).
Ams From older version: Asar v1.81 Link
When Is Gonna Asar 1.82 Released?#smw{o_O?}
 RPG Hacker From older version: Asar v1.81 Link
Tomorrow!
 RPG Hacker From older version: Asar v1.81 Link
Originally posted by MarioSMWGooder
When Is Gonna Asar 1.82 Released?#smw{o_O?}


Probably never. Next version is likely gonna be 1.91. Not ETA yet, though.
MarioSMWGooder From older version: Asar v1.81 Link
When Is Gonna Asar 1.82 Released?#smw{o_O?}
RedHotYosh From older version: Asar v1.81 Link
What Does This Do?#wario{-_-?}#smw{o_O?}#fim{?_?}#lm{sprites}
 RPG Hacker From older version: Asar v1.81 Link
How did you even get here if you need to ask that question in the first place? 🤔
MarioSMWGooder From older version: Asar v1.81 Link
WHY ARE YOU EVEN HERE#smw{o_O?}
El Cuh Fermin From older version: Asar v1.81 Link
Originally posted by Soul
when a patch puts "lorom" at the top, the message appears since asar defaults to lorom

thanks to yoshifanatic for telling me this


Never mind, I removed the lorom version to work with SA-1 and it works now
El Cuh Fermin From older version: Asar v1.81 Link
It tells me,
Code
c:/users/acost/downloads/beach park at isla blanca hack/nuke_statusbar.asm:11: warning: (W1029): A mapper has already been selected. [sa1rom]
One or more warnings were detected while assembling the patch. Do you want insert the patch anyways? (Default: yes)
Soul From older version: Asar v1.81 Link
when a patch puts "lorom" at the top, the message appears since asar defaults to lorom

thanks to yoshifanatic for telling me this
Ssanchez From older version: Asar v1.81 Link
This tool is pretty useful, thanks :)
CruelKaizo42 From older version: Asar v1.81 Link
I have an error prompt come up in the asar command box saying "*File name* is not a regular file". What does this mean and how do I fix it?
SJandCharlieTheCat From older version: Asar v1.81 Link
Originally posted by Xboy1282
It says "Your rom name seems to be *some gibberish* (which looks like garbage). Is that the name of your rom?" which it isn't and when I say no it doesn't patch it


That's usually an issue with the file extension. Change to .smc instead of .sfc, if you haven't.
Xboy1282 From older version: Asar v1.81 Link
It says "Your rom name seems to be *some gibberish* (which looks like garbage). Is that the name of your rom?" which it isn't and when I say no it doesn't patch it
Nara Sherko From older version: Asar v1.71 Link
I patched the rom and it says
Code
A fatal error was detected while assembling the patch. Assembling aborted. Your ROM has not been modified.
Press any key to continue . . .
BuckeyeB_06 From older version: Asar v1.71 Link
Similar problem. On a Mac using WINE to run LM and AddMusic, but ASAR won't open with WINE. Alternatives?
trillian From older version: Asar v1.81 Link
updated to 1.81, this is just a tiny bugfix release, check the changelog for the 2 bugs which were fixed
oderjunks From older version: Asar v1.71 Link
comment so i can rate it five stars please ignore
Klug From older version: Asar v1.81 Link
FINALLY! A new Asar update after 2 years.
Shiva619 From older version: Asar v1.71 Link
Smw asm with C or C++...

Is it possible. #smw{o_O?}
Moltz From older version: Asar v1.71 Link
Originally posted by GRIMMKIN
I have a Mac and every time I go to open the .exe file nothing happens


You need a tool that runs Windows tools like CrossOver to make it work.
ninj From older version: Asar v1.71 Link
Originally posted by GRIMMKIN
I have a Mac and every time I go to open the .exe file nothing happens


macs don't use .exe files
GRIMMKIN From older version: Asar v1.71 Link
I have a Mac and every time I go to open the .exe file nothing happens
Drink From older version: Asar v1.71 Link
I get this error even though the file exists.
error: (E5016): File 'owcount.asm' wasn't found.
Errors were detected while assembling the patch. Assembling aborted. Your ROM has not been modified.
0034:fixme:ver:GetCurrentPackageId (0x33fe94 0x0): stub
GoldGames From older version: Asar v1.71 Link
Thank you, very useful!#smw{:TUP:}
Von Fahrenheit From older version: Asar v1.71 Link
Good assembler lol
Shiva619 From older version: Asar v1.71 Link
Can someone tell me how to make patches????#smw{o_O?}
CONLUSH666 From older version: Asar v1.71 Link
best tool i am a noob and i got it
Mechanical koopa From older version: Asar v1.71 Link
What there's a trojan malware in asar? Omg I gotta tell everyone!

But seriously, even if there was a trojan (I trust the community enough that I personally don't worry) you can actually modify a trojan to actually act as an automatic updater! Also fun fact: did you know that some antivirus software is actually a modified virus? Also, did you know that, in practicality, any installer file (apk, set up wizards, ect...) are, by definition, a trojan? So, a trojan "malware" might actually BE beneficial! Just thought I'd share this! I hope goombud sees this... Or anyone else that thinks this a virus, for that matter.
Speedrunner Mario From older version: Asar v1.71 Link
good
 RPG Hacker From older version: Asar v1.71 Link
xkas compatibility is still there, just deprecated.
DTA450 From older version: Asar v1.71 Link
No more xkas patches compatibility for this version? However this feature is useful because some patches aren't remoderated yet and are still in 'xkas format'.
LOLRyan2006 the Goombud From older version: Asar v1.71 Link
Hey! There is no virus!
Sonck's entertainment From older version: Asar v1.71 Link
Esto es fácil y sencillo.
1 Azar te dice el nombre del parche lo insertas en Entre patch name
2 y luego te dice el ROM y listo no es complicado del todo
Dominicentek From older version: Asar v1.71 Link
Virus NO MORE!
 RPG Hacker From older version: Asar v1.71 Link
Seriously, can you all at least TRY to read the previous comments before making any more claims about viruses?
Rip_van_Fish From older version: Asar v1.71 Link
okay so it seems like there is the trojan Win32/Fuery.B!cl inside which is a serious threat to your safety! this will steal your bank account data and shit like this.....
Koop the Koopa From older version: Asar v1.71 Link
Originally posted by LOLRyan2006 Mario Fan
YAY!!! No virus message!

Code
C:\Users\****\Documents\asar171\asar.exe

Operation did not complete successfully because the file contains a virus or potentially unwanted software.



O.O
ruadeil From older version: Asar v1.71 Link
If you install Visual Studio (2019) and Cmake you can build your own version of Asar which will not have the virus warning.
LOLRyan2006 the Goombud From older version: Asar v1.71 Link
YAY!!! No virus message!

Code
C:\Users\****\Documents\asar171\asar.exe

Operation did not complete successfully because the file contains a virus or potentially unwanted software.


 RPG Hacker From older version: Asar v1.71 Link
There is no virus. Read comments below.
Dominicentek From older version: Asar v1.71 Link
virus detected?
XAGES From older version: Asar v1.71 Link
noice
rafaelfutbal From older version: Asar v1.71 Link
Thanks! Its works! 😄
h.carrell From older version: Asar v1.71 Link
better than xkas
El Cuh Fermin From older version: Asar v1.50 Link
Ill be forced to use this.
El Cuh Fermin From older version: Asar v1.71 Link
I did it. I already remove the real time virus. It works fine.
El Cuh Fermin From older version: Asar v1.71 Link
Originally posted by RPG Hacker
Add an exception to your virus scanner or something like that.


Can you help me with tutorial
 RPG Hacker From older version: Asar v1.71 Link
Add an exception to your virus scanner or something like that.
El Cuh Fermin From older version: Asar v1.71 Link
I cant open because it says virus
Rocky From older version: Asar v1.37 Link
this old version saved me
jayhawker6 From older version: Asar v1.71 Link
It's great! you just need to copy the file paths.
trillian From older version: Asar v1.61 Link
yes i messed that up don't bully
Kiatus From older version: Asar v1.61 Link
>ver1.61
>app says ver1.60

12/10
thecentralbus From older version: Asar v1.61 Link
My antivirus detects this as a virus...
???
kiki79250 From older version: Asar v1.61 Link
I think it would be nice to develop a graphical interface for this great software ...
trillian From older version: Asar v1.61 Link
I'm approving this without a proper moderation process since both of the tool moderators (me and RPG Hacker) are important contributors to this, which means neither of us can test it "properly". But it has been used by hundreds of people by now and there haven't been any serious bugs so it's good enough.
trillian From older version: Asar v1.50 Link
Which patch are you applying? What error are you getting? You're probably better off making a thread on the forums for your issue.
Vitor Vilela From older version: Asar v1.61 Link
yeah,.
trillian From older version: Asar v1.61 Link
You already removed your usage of if !condition, but probably not everyone has. it just deserves a proper deprecation process
Vitor Vilela From older version: Asar v1.61 Link
(As in, if I decide to bring it back to SA-1 Pack... it will give warnings so eehhh)
Vitor Vilela From older version: Asar v1.61 Link
...I don't see much point in reimplementing it if it's gonna be removed later again, lol.
 RPG Hacker From older version: Asar v1.61 Link
randomdude999 updated this to v1.61, which reintroduces !condition (and throws a deprecation warning).
 RPG Hacker From older version: Asar v1.61 Link
What's SA-1? #ab{O.O}

But yeah, an alternate way of doing the same thing would be

Code
if !whatever_define_there_actually_is == 0


which is what I've been using so far. I assumed it was more common than !!.
Vitor Vilela From older version: Asar v1.61 Link
yeah so unused that only SA-1 Pack, the largest/biggest patch ever made was using it :P

Regardless, I edited it in the 1.27 version.
 RPG Hacker From older version: Asar v1.61 Link
@TheBiob: that feature was removed because it was undocumented and, after looking at the code for a lengthy amount, I could not figure out how to make use of it and was pretty sure that it was unusable in the first place and that thus no patch could be using it. Apparently I was wrong and it was usable in the form of !!Define, causing this incompatibility (though I'm still surprised about the fact that people actually did, considering it was undocumented - I think it was only ever mentioned in one of Alcaro's old changelogs, but not in the manual, and the source code even contains a comment stating "this feature is undocumented", making it seem like that was actually on purpose).

So yeah, not quite sure what to do about it in the future. I think randomdude proposed reintroduing the feature, but marking it as "deprecated" and making it throw a warning.
Mogu94 From older version: Asar v1.61 Link
Ok, I'm glad it's known. Thanks for the speedy reply. I'll just use 1.50 for now until it's all fixed.
TheBiob From older version: Asar v1.61 Link
There have been changes to how !!define should be handled for some reason. (iirc the main reason was !! being confusing? dunno)

People are aware of this and an update will probably happen soon after this one is accepted.
For now, changing the if statement on line 203 of lzx.asm to
Code
if not(!whatever_define_there_actually_is)
should fix that
Mogu94 From older version: Asar v1.61 Link
SA-1 1.26 inserts fine with Asar 1.50 but with this version there are errors when inserting.
Code
boost/lzx.asm:154: error: <E5060>: Label 'Decompress_back' wasn't found. [LDX.w #.back]
boost/lzx.asm:156: error: <E5060>: Label 'Decompress_back2' wasn't found. [LDX.w #.back2]
boost/lzx.asm:171: error: <E5060>: Label 'Decompress_main' wasn't found. [JMP .main]
boost/lzx.asm:203: error: <E5027>: Invalid number. [if !0]
 RPG Hacker From older version: Asar v1.61 Link
What patches?
Guscraft808Beta2 From older version: Asar v1.61 Link
how about making the xkas patches work
 RPG Hacker From older version: Asar v1.61 Link
Fair point, although changing the default behavior would mean making the syntax context-dependent. In other words,

Label:
.Label:
+
-

would mean different things, depending on if they were used inside or outside of a macro. In my opinion not an ideal solution, either. With the current implementation, the syntax is clear and means just a single thing, no matter the context (of course ?Label can't be used outside of macros, anyways, so the context doesn't matter there, but Label and #Label do the same thing, no matter where they are used).

I think one reason for this mess is that the concept of macros in xkas/Asar is kinda shaky to begin with. I personally like to think of macros as a text replacement mechanism, kinda like in C preprocessors, and that's mostly how I treat them, though in xkas and Asar, they also have traits/behaviors that are more function-like. This makes everything regarding them a bit tricky to deal with. When working with them, though, I prefer to lean more towards the "text replacement" side, which also influenced my decision here. Letting labels "leak" outside of macros by default is more "text replacement"-like, while not letting them leak outside is more "function"-like.
Alcaro Author From older version: Asar v1.61 Link
Macros leaking labels should be possible, yes, but I'm not sure how much sense it makes to do that by default. And macrolabels messing with subsequent sublabels doesn't make much sense either.

But backwards compatibility says that's hard or impossible to fix.
 RPG Hacker From older version: Asar v1.61 Link
And I'd disagree. There can be legitimate use cases for actually wanting labels in macros to be accessible from the outside and/or modify label hierarchies, so I strictly oppose removing that possibility.
Alcaro Author From older version: Asar v1.61 Link
i'd say that design sucks though
 RPG Hacker From older version: Asar v1.61 Link
You're supposed to use the correct type of label.

?Label
?.Label
?+
?-

for labels that should be local to the macro they're in.

#Label

for labels that are global, but don't modify the label hierarchy. All other types of labels are supposed to leak outside of macros, that's by design.
HammerBrother From older version: Asar v1.61 Link
Is the "leaking macro label" fixed? Can't find the glitches for that in the bug fixes changelog.
obersteiner86 From older version: Asar v1.50 Link
Why you dont upload the 1.60 asar version @Looney Balloon i compiled it on my windows 10 with visual studio and it works fine its the 1.60 version and the 1.50 version works to your get are strange error right you need to click on allowed left button
EnderofGames From older version: Asar v1.50 Link
Works great with Windows 10, not sure the other person's problem. I originally found a link to a download of Asar from a forum post, but I found the version was too old to patch for me. I luckily found this easily, unlike a lot on SMWCentral. Worked fast, just wish I had known not to put file extension in the first time.
HammerBrother From older version: Asar v1.50 Link
To get the notepad++ XML (syntax-highlighting.xml) to run, copy that file and paste it in Notepad++\plugins\APIs. Then run notepad++, and on the menubar, Language -> Define Your Language..., click on "Import", and navigate to where you placed the file, and select the file, and you're done.
Looney Balloon From older version: Asar v1.50 Link
can someone make a windows 10 version? It doesn't work for me. :/
MagicalKoopa From older version: Asar v1.50 Link
It's necessary if you wanna make a patch.
Erikas0012 From older version: Asar v1.50 Link
Best tool for patches. Thanks for including the freespace finder, saves a lot of trouble.
TheN64man From older version: Asar v1.50 Link
It would've been nice if the freespace finder worked with the xkas thing because I added ;@xkas to the patch and then Mario stopped existing and it was Bad ROM which was a problem. It seems a magic MarioFanGamer or someone else shows up and replies to problems though, please someone suggest something
zRoch From older version: Asar v1.50 Link
How do I add the ;@xkas header?
I have tried 4 times and I just can`t get it to work. It says it can`t open the file.

EDIT: I`m just stupid, I forgot to type a bit of the patch name.
Vexcrate From older version: Asar v1.50 Link
Why doesn't this work with Wine?
yoshifanatic From older version: Asar v1.50 Link
There is a bug with the readfile and canreadfile functions where asar crashes if these functions are used to read from 17 or more different files. I know that these functions are able to cache up to 16 files simultaneously, but I would have expected asar to close the oldest opened file when attempting to open more than 16 files.

This bug has been complicating some of the stuff I've worked on recently, and it'd be nice if it was fixed.
HammerBrother From older version: Asar v1.50 Link
Be careful that this version still have a bug with the labels that crosses over a %callMacro(). If inside the macro has the same label as outside of it (or that the macro have a perent label when a sublabel jumps over it), causes glitches, as the exe treats contents inside the macro as if its located in the same location as the call itself, so be aware of that. Here is Alcaro's example

Originally posted by alcaro
Code
foo:
JSR .baz
%macro() containing ?bar:
.baz


should attach .baz to foo:, not ?bar:.


This also happens on +/- symbols too, as tested on GPS.

Possibly the most annoying bug I've experienced when using GPS and PIXI. Thank god uberasm tool's library does not use that, instead it uses filename_label:
Logg From older version: Asar v1.50 Link
This program doesn't patch BPS. It's for patching code to the ROM. If you want to patch BPS files, you should use Floating IPS from https://www.smwcentral.net/?p=section&a=details&id=11474
Scoutellite From older version: Asar v1.50 Link
Ehhh I don't think so...
Alcaro Author From older version: Asar v1.50 Link
It just does.

Probably, I'm not sure.

Actually, judging by test.cpp being made for Windows and Linux simultaneously (backslashes, but also including sys/stat.h), someone dropping a libasar.so in the source directory, and the empty help.sfc, there's a fair chance it doesn't.
Scoutellite From older version: Asar v1.50 Link
WHAT? How does this wierd thing work?
 RPG Hacker From older version: Asar v1.50 Link
Care to either give more details on what exactly isn't working for you or stop leaving pointless comments?
Epic_Manky From older version: Asar v1.50 Link
care to explain why this doesn't work at all
 RPG Hacker From older version: Asar v1.50 Link
Thanks, Raiden, definitely glad to read that!
So at least it seems like I didn't break anything that was previously working.
Wooden Chair From older version: Asar v1.50 Link
Good news, I just ran this latest asar on my entire Yoshi disassembly, which has tons of 65816, super fx, and SPC code and various features, basically a good "testing ground", and it worked the same as before. So, I APPROVE OF this latest version!!
 RPG Hacker From older version: Asar v1.50 Link
Updated to version 1.50. Changelog:

New features:
  • Added support for structs. Credits go to p4plus2: GitHub repository.
  • Added API to Asar lib for getting information on all blocks of data written by Asar.
  • Added API to Asar lib for getting the mapper currently used by Asar.
  • Added support for ExLoROM and ExHiROM mappers.
    NOTE: Based entirely on conversion tables I got from Ladida; don't know if these conversions are actually correct. Some features may not work as intended when using those mappers (such as freedata, for example), but I can't verify this.
  • Added pushtable and pulltable commands, which let you back-up or restore the current character table to the/from the stack.
  • Added "ext\notepad-plus-plus\syntax-highlighting.xml". This file can be imported into Notepad++ as a user-defined language to add syntax highlighting for Asar patches, featuring all commands currently supported by Asar. By default, this syntax highlighting is enabled on all files with an extension of .asm or .asr, but this can be customized via Notepad++.


Bug fixes:
  • Lines starting with @ or ;@ that don't map to a recognized special command now only throw warnings at best and no errors.
  • Rewrote code of tests a little to make them easier to execute and make them clean up their own mess.
  • C# wrapper for Asar DLL was non-functional since it didn't specify a calling convention, making it always lead to an exception in some scenarios.


Notes:
  • Just like the last version, this version of Asar was built in MSVC rather than g++, but this time I also updated the Asar DLL (which I had overlooked last time). I'm not sure if Windows applications are compatible with DLLs that were built by a different compiler, so if you're planning to use the DLL, this is something to watch out for. If you're planning to use a compiler other than MSVC, I recommend just rebuilding the DLL from source in whatever compiler you're using (or directly including the Asar library code in your project).
 RPG Hacker From older version: Asar v1.50 Link
Please read this.

Also if a tools moderator sees this, can you please moderate this version? I don't want to submit version 1.50 before version 1.40 has been approved (or denied). Thanks!
 RPG Hacker From older version: Asar v1.50 Link
Originally posted by imamelia
Did anyone ever fix the bug with indirect JMPs and JSRs to labels?


I'm late (don't regularly check the comments here). What bug is it? Maybe report it here if it still exists and needs to be fixed?
Alcaro Author From older version: Asar v1.50 Link
There's a reason we renamed it to Destroyer.

The first sentence of its description should be removed.
 Sayuri From older version: Asar v1.50 Link
No, do not use that tool. It will break your ROM completely.

Kamekku, don't mislead people like that.
Klug From older version: Asar v1.50 Link
Originally posted by toad64
How i remove Asar patches.

Use Destroyer.
 imamelia From older version: Asar v1.50 Link
Did anyone ever fix the bug with indirect JMPs and JSRs to labels?
Konata Izumi From older version: Asar v1.50 Link
@toad64: Use LM's restore option
TheOrangeToad From older version: Asar v1.50 Link
How i remove Asar patches.
Wooden Chair From older version: Asar v1.50 Link
whoops, I forgot to update the tests. Good catch, and good work on this, seems like a lotta neat fixes.
Wooden Chair From older version: Asar v1.37 Link
asar uses the file extension (.sfc or .smc) to tell it whether to apply a header or not. Sometimes headered ROMs will be .sfc or unheadered ROMs will be .smc; these cases both will cause errors with asar. Just rename your ROM to .smc and try again.
 Erik From older version: Asar v1.50 Link
Quote
Defines in elseif conditionals now get properly resolved

niiice.
I don't really see much uses for the new functions but readfile seems cool.
 RPG Hacker From older version: Asar v1.50 Link
Just copy-pasting the list of new features from the changelog:

New features:
  • readfile functions: readfile1(filename, offset), readfile2(filename, offset), readfile3(filename, offset), readfile4(filename, offset) - similiar to read1() etc. functions, except data is read from another file instead of from the ROM (note that offset is a PC offset, not a SNES offset). You can pass an optional third value which is returned if the read fails.
  • canreadfile functions: canreadfile1(filename, offset), canreadfile2(filename, offset), canreadfile3(filename, offset), canreadfile4(filename, offset), canreadfile(filename, offset, length) - basically the readfile() equivalents of canread1() etc.
  • snestopc(address) and pctosnes(address) functions: for manually converting addresses (note that those functions are dependent on the ROM's mapping mode, so use them with caution - chance are you'll never need them, anyways)
  • max(a, b), min(a, b) and clamp(value, min, max) functions: max()/min() return the maximum/minimum of two values, whereas clamp() makes sure that that value is >= min and <= max
  • safediv(dividend, divisor, exception) function: divides dividend by divisor, unless divisor is 0, in which case exception is returned
  • select(statement, true, false) function: if statement is 0, false is returned, in any other case, true is returned. Basically, a mathematical version of "if/else". Please note that unlike if/else blocks, function arguments in asar are always evaluated before a function returns. In other words: if you do select(1, 1/1, 1/0), asar will throw a "division by zero" error, even though the function would return 1/1. In this particular case, it's recommended to simply use the safediv() function in place of a regular division.
  • not(value) function: returns 1 if value is 0 and 0 in any other case
  • comparison functions: equal(a, b), notequal(a, b), less(a, b), lessequal(a, b), greater(a, b), greaterequal(a, b) - rather self-explanatory, return 1 if the respective comparison is true and 0 otherwise. Primarily intended to be passed as statement to select() function.
  • logical functions: and(a, b), or(a, b), nand(a, b), nor(a, b), xor(a, b) - also self-explanatory, return 1 if the respective logical operation is true and 0 otherwise. Primarily intended to be passed as statement to select() function.
  • while loops: Added compile-time while loops to Asar. Those work similar to if conditionals, with the difference that their blocks are compiled repeatedly until their condition becomes false. For easier implementation and higher compatibility, while loops are terminated with endifs, just like if conditionals. When using while loops, be careful not to cause an infinite loop.
  • Multiline commands: You can now put \ at the end of any line of source code and Asar will append the following lines to that line. This is similar to putting , at the end of a line, with the difference, that the \ does not appear in the concatenated string, whereas the , does. This is useful to split long functions into multiplie lines, for example. Note that all whitespace following the \ is removed, whereas whitespace preceeding the \ isn't. So

    Code
    db\
    	   $FF


    turns into

    Code
    db$FF


    for example, whereas

    Code
    db \
    	   $FF


    turns into

    Code
    db $FF

  • double(num) print function: Can be passed to print to print a double variable with its fractional part. Has a default precision of 5 decimal places, but can be passed a second argument to override the precision.
  • round(num, precision) function: Rounds the double variable num to precision decimal places. Pass 0 to precision to round to the nearest integer.




Bug fixes:
  • Asar 1.37 suppported overloaded versions of read1() to read4(), but always threw "Wrong number of parameters to function" errors when actually using those overloaded versions
  • Asar 1.37 threw "Wrong number of parameters to function" for function canread() when passing 2 arguments to it, because it actually treated it as canread1() due to an error in string comparison
  • Using better double -> int conversions in some places - where dd $FFFFFFFF would assemble to 00 00 00 80 ($80000000) in Asar 1.37, it now assembles to FF FF FF FF
  • Defines in elseif conditionals now get properly resolved
  • The #= define operator now doesn't truncate its value when using "math round off", making it possible to do double-precision math with it
  • Asar 1.37 detected misplaced elses and endifs, but not misplaced elseifs
  • Putting "@xkas : @asar 1.37" on the first line would previously lead to an error, whereas putting "@asar 1.37 : @xkas" there would not. Both variations lead to an error message now, since it really doesn't make much sense to use them together in any combination.
  • Special commands like @asar or @include could previously be used on the first line only and needed to be chained with a : inbetween. They can now be used on any line as long as no other command comes before or inbetween them.
  • Asar 1.37 fixed a bug in SuperFX compilation, but src/test/arch-superfx.asm was never edited to acknowledge this fix, so the test always failed
  • Added different define operators (=, +=, :=, #=, ?=) to manual.txt. Those have been in Asar for quite a while, but were never documented yet, although they can be quite useful.




Notes:
  • This version of Asar was build in MSVC rather than g++, mainly because I already had that installed and use Visual Studo as an IDE, anyways. Functionally, this shouldn't make any difference, unless using Asar in unintended ways, where anything goes. I did build the Linux version in g++ to confirm compatibility, though.
ASuperMarioWiggler From older version: Asar v1.37 Link
Dunno why but I'm using a .sfc file and it says my ROM name is a bunch of smiley faces...
Vitor Vilela From older version: Asar v1.37 Link
It's better compared to Asar 1.36 in many aspects; most notably the fixed SA-1 and Super FX mapping related issues.

It is recommend to everyone update it to avoid further issues, specially if you're using an enhancement chip in your ROM hack.
HammerBrother From older version: Asar v1.36 Link
[Note to all users] the double click feature doesn't work on Windows (due to the fact that you need to double click in order to run, else it either select or renames on single).
Alcaro Author From older version: Asar v1.36 Link
It asks for a filename, then it asks for another filename. That counts as asking for filenames.