This isn't really a question about the NES, rather CA65. Is there a way to use the parameter passed to a macro as a label prefix? For example, here is my CHR loading macro:
This works fine, and is obviously less verbose than typing all of that out every time, but it would be really nice if I could just pass a single "TITLE" parameter and it would automatically append _CHR, _CHR_START, CHR_ROWS, and CHR_BANK where needed.
Code:
.MACRO LCHR chr, addr, rows, bank.IFNBLANK bank LDA #bank JSR Bankswap.ENDIF LDA #<chr STA pointer LDA #>chr STA pointer+1 LDA #>addr STA >address LDA #<addr STA <address LDX #rows JSR Load_CHR.ENDMACRO LCHR TITLE_CHR, TITLE_CHR_START, TITLE_CHR_TILES
Statistics: Posted by dragonsbrethren — Sun Sep 01, 2024 11:19 am — Replies 0 — Views 27