joeldipops / gbz80-pseudoOps

Set of rgbasm macros and constants to facilitate readability for modern programmers
MIT License
8 stars 1 forks source link

`ld16` is bugged #17

Closed ISSOtm closed 5 years ago

ISSOtm commented 5 years ago

This condition can never be met.

Unsure how to fix it.

joeldipops commented 5 years ago

rgbasm macro language can be very weird about brackets. To get it working I had to surround the two terms with brackets. IF STRIN("\1", "[") == 1 && STRIN("\1", "]") == STRLEN("\1") vs IF (STRIN("\1", "[") == 1) && (STRIN("\1", "]") == STRLEN("\1"))

All good now:

MEH EQU $c000
ld16 [MEH], BC
ld16 BC, [$ff10]

becomes

ld A, B
ld [$c000], A
ld A, C
ld [$c001], A
ldh A, $ff10
ld B, A
ldh A, $ff11
ld C, A
ISSOtm commented 5 years ago

I hardly see how that could work, since this expects STRIN("\1", "[") to return two different values.