Releases: StanHash/ColorzCore
2024-05-05
This is probably the last release for this branch feature-wise.
See https://gist.github.com/StanHash/c6005f6e4aaded3c9a774b48366f58df for a friendly summary of changes.
See FireEmblemUniverse#63 for a full summary of changes.
Stuff since https://github.com/StanHash/ColorzCore/releases/tag/20240428:
BASE64
STRING
and#inctbl
for loading custom .TBL encodings.- Formatted Interpolated Strings now accept values that expand to strings as well as numbers (such as
__FILE__
) - detect
SetSymbol
-like macros because they are now broken - detect
ASSERT UpperBound - CURRENTOFFSET
because it is otherwise broken. --nocash-sym
emits labels in local scopes (prefixed with$N$
where N is an arbitrary number).- The
extensions
system introduced in the last updated was removed. - Many internal refactoring
- Many fixes
Binary is a .NET Framework 4.8 Assembly. Should work on most stock Windows and Mono.
2024-04-23
Changes since https://github.com/StanHash/ColorzCore/releases/tag/20240419 :
- ASSERT now always behaves as expected regarding conditionals
- minor format strings fixes
- Add
ReadByteAt(offset)
,ReadShortAt(offset)
andReadWordAt(offset)
built-in macros. Those macros are disabled in AA mode.
Binary is a .NET Framework 4.8 Assembly. Should work on most stock Windows and Mono.
2024-04-19
- ORG now accepts addresses: ORG 0x08000010 is now equivalent to ORG 0x10 (if the rom base address is 0x08000000)
- POIN (and friends) now only converts offsets to addresses for non-zero offsets that are within ROM boundaries (1~0x1FFFFFF by default)
- this allows feeding non-ROM addresses to POIN statements, possibly output by tools such as lyn
- new "--maximum-size" option for configuring ranges relevant to the above two features
- if no raws folder is given, and 'Language Raws' does not exist, a set of 7 built-in "fallback" raws will be available (those being BYTE, SHORT, WORD, POIN, SHORT2, WORD2 and POIN2).
- old behavior was just an error
- new operators: '==', '!=', '<', '>', '<=', '>=', '&&', '||', unary '!'. They work mostly like in C (|| is more like ?: and && evaluates to right operand if left is nonzero).
- those operators can be used with the new generic '#if' preprocessor directive.
- ASSERT behaves differently for conditional operators (fails on 0 rather than negative)
- Partially address FireEmblemUniverse#22 (on raw param error, print the "signature" of that/those raw(s))
- Add binary negation operator ('~') (addresses FireEmblemUniverse#42)
- Symbol assignment using ':=' (addresses FireEmblemUniverse#48)
- "undefined-coalescing" operator '??' ('L ?? R' evaluates to L if L does not contain undefined symbols, R otherwise)
- make macro([a, b, c]) result in it having 1 parameter instead of 3
- IsSymbolDefined (and IsLabelDefined alias) macro that expands to 0 or 1 depending on whether that symbol is visible and was defined before its expansion.
- Better error messages in the very specific case where the expansion of a macro produces an invalid statement.
- MESSAGE, ERROR and WARNING now print strings properly, and accept format bits: '{expr:spec}' which are expanded within.
- format specifier are the same as the standard C# ones (for example: {MyOffset:X8})
Binary is a .NET Framework 4.8 Assembly. Should work on most stock Windows and Mono.
2024-04-28
NOTE: I made an oopsie and the tag for this release refers to the wrong branch.
Changes since https://github.com/StanHash/ColorzCore/releases/tag/20240423 :
#define
now allows any sequence of tokens as macro body. This means that you don't have to fit everything into a string if you aren't defining a numeric value or a vector.- for example:
#define MyData(a, b, c) ALIGN 4 ;WORD a ; SHORT b ; BYTE c
(no quotes!) - this will break some existing macros that were expanded in non intuitive ways due to a quirk in the previous version (a new warning has been added to help one find such cases).
- for example:
- defining a definition as itself will result in that definition not participating in macro expansion (I call this a non-productive definition). It is still visible to
#ifdef
and friends though- example:
#define ItemTable ItemTable
, one can doItemTable:
later without causing an infinite loop, yet also#ifdef ItemTable
is validated.
- example:
- Error messages caused by expressions or tokens produced by expansion of a macro now follow the entire chain down to the macro.
- Working
__LINE__
and__FILE__
identifiers. - Any newline can be escaped using
\
, not just within strings. - On Windows only, non-portable path expressions (which include folder or file names with capitalization that don't match) in include and incbin will cause warnings
- Labels values are now addresses. (
ORG 0x123 ; Label: ; MESSAGE "{Label:X8}"
prints08000123
, not00000123
). This will break the "SetSymbol" hack. If you need to set a Label to an arbitrary value, use the new symbol assignment syntax (Symbol := value
).- Eventually, I will try to emit a warning when I find on such macro being defined or used.
- New command line options:
--warnings:...
and--extensions:...
.--warnings:...
allows you to disable or enable some warnings.--extensions:...
allows you to enable "extensions", that is, extra language features that are otherwise disabled by default.- Example:
--warnings:no-redefine
will turn off warnings when you redefine a label.--extensions:read-data-macros
enables theReadByteAt
macros and friends- By the way,
ReadByteAt
and friends are now disabled by default and need to be enabled using the command line flag above.
- By the way,
- Example:
- A new warning, enabled by
--warnings:unguarded-expression-macros
, will be emitted when a macro is expanded that features operators that aren't guarded by parenthesis. - A new warning, enabled by default but disabled by
--warnings:no-unintuitive-expression-macros
, will be emitted when a macro that looks like a self-contained expression will be expanded in a way that makes it merge with its surroundings in unintuitive ways.- for example:
#define MyMacro(a, b) a + b
BYTE MyMacro(1, 2) * 2
will result inBYTE 1 + 2 * 2
which would not result in what one would intuitively expect. This is particularly useful as it helps find cases where the changes in edge-case macro behavior described earlier would cause a change. An example of such case can be seen explained here: FireEmblemUniverse/SkillSystem_FE8#637. - This is kinda a less aggressive version of the previous warning. This is why this one is enabled by default while the other isn't.
- for example:
Binary is a .NET Framework 4.8 Assembly. Should work on most stock Windows and Mono.