mirror of
https://github.com/uffejakobsen/acme.git
synced 2024-11-29 04:49:20 +00:00
21cc635bc8
<cbm/msbstring.a> defines macro to store a string with msb set in last character, <cbm/multicolor.a> defines macros to "paint" 4-color graphics via strings. git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@269 4df02467-bbd4-4a76-a152-e7ce94205b78
21 lines
355 B
Plaintext
21 lines
355 B
Plaintext
;ACME 0.97
|
|
|
|
; macro to store a petscii string with msb set in last byte
|
|
!macro msbstring @s {
|
|
!ct pet {
|
|
@l = len(@s)
|
|
!if @l < 1 {
|
|
!error "String is empty!"
|
|
}
|
|
!for @i, 0, @l - 1 {
|
|
!if $80 & @s[@i] {
|
|
!error "String already contains character(s) with MSB set!"
|
|
}
|
|
}
|
|
!for @i, 0, @l - 2 {
|
|
!byte @s[@i]
|
|
}
|
|
!byte $80 | @s[-1]
|
|
}
|
|
}
|