mirror of
https://github.com/cc65/cc65.git
synced 2024-09-27 19:55:09 +00:00
Refactorred a CBM screen-code macro, so that we can use it as an operand.
For example: lda #scrbyte 'B'
This commit is contained in:
parent
cc6559c3f6
commit
13fa31a3bc
@ -1,9 +1,13 @@
|
|||||||
; Convert characters to screen codes
|
; Convert characters to screen codes
|
||||||
|
|
||||||
; Helper macro that converts and outputs one character
|
; Macro that converts one character.
|
||||||
|
; scrbyte() can be used as an instruction operand
|
||||||
|
.define scrbyte(code) (<(.strat ("h@dbdlhh", code >> 5) << 4) ^ code)
|
||||||
|
|
||||||
|
; Helper macro that stores one character
|
||||||
.macro _scrcode char
|
.macro _scrcode char
|
||||||
.if (char < 256)
|
.if (char < 256)
|
||||||
.byte <(.strat ("h@dbdlhh", char >> 5) << 4) ^ char
|
.byte scrbyte {char}
|
||||||
.else
|
.else
|
||||||
.error "scrcode: Character constant out of range"
|
.error "scrcode: Character constant out of range"
|
||||||
.endif
|
.endif
|
||||||
@ -38,13 +42,9 @@
|
|||||||
|
|
||||||
; Anything else is an error
|
; Anything else is an error
|
||||||
.else
|
.else
|
||||||
|
|
||||||
.error "scrcode: invalid argument type"
|
.error "scrcode: invalid argument type"
|
||||||
|
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
; Call the macro recursively with the remaining args
|
; Call the macro recursively with the remaining args
|
||||||
scrcode arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
|
scrcode arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user