Fixed fake character text; added support for control codes in packer.

This commit is contained in:
Martin Haye 2015-06-28 10:07:50 -07:00
parent 7cf8cbeb0e
commit cf55e06347
3 changed files with 26 additions and 7 deletions

View File

@ -1401,10 +1401,27 @@ class PackPartitions
def vec_moveBackward = 0x31E
def vec_getCharacter = 0x321
def emitAuxString(str)
def emitAuxString(inStr)
{
emitCodeByte(0x54) // CALL
emitCodeWord(vec_pushAuxStr)
def buf = new StringBuilder()
def prev = ' '
inStr.each { ch ->
if (ch == '^') {
if (prev == '^')
buf.append(ch)
}
else if (prev == '^') {
def cp = Character.codePointAt(ch.toUpperCase(), 0)
if (cp > 64 && cp < 96)
buf.appendCodePoint(cp - 64)
}
else
buf.append(ch)
prev = ch
}
def str = buf.toString()
assert str.size() < 256 : "String too long, max is 255 characters: $str"
emitCodeByte(str.size())
str.each { ch -> emitCodeByte((byte)ch) }

View File

@ -779,7 +779,7 @@ init: !zone
sta setAuxRd
lda $2000
sta clrAuxRd
cmp #1
cmp #2
beq +
ldx #<.auxMsg
ldy #>.auxMsg

View File

@ -753,12 +753,14 @@ end
def fakeChars()
setWindow3()
displayChar('L'-$40)
displayStr("Name Life Gun\n")
displayStr("Name Life Gun\n")
displayChar('L'-$40)
displayStr("Black Bart 12 4\n")
displayStr("Wyld Bill 8 2\n")
displayStr("Lucy Lawless ")
displayChar('H'-$40) // back 1 pixel
displayStr("Black Bart ")
displayChar('U'-$40) // right 1 pix
displayStr("12 4\n")
displayStr("Wyld Bill 8 2\n")
displayStr("Lucy Lawless ")
displayChar('U'-$40) // right 1 pix
displayStr("9 6")
if mapIs3D; copyWindow(); fin
setWindow2()