0 Members and 2 Guests are viewing this topic.
You can? O.o I didn't know that.
Word SizeThe last feature of the T6A04 is the ability to change the word size from 8-bit to 6-bit. Technically, a word is defined as a string of bits that can occupy a single addressable location. This kind of conflicts with the popular definition of a word being a size of 16 bits, which is due to the fact that Intel made some computers with 16-bit words that were very popular. But this is the official Toshiba name, and I can't think of a better one, so oh well.The word size is changed with two commands:$00 Configure six bits per word$01 Configure eight bits per wordWhat can we use this for? Well, Toshiba thought it would be nice if computers could have two font sizes, and in fact the 6x8 character routines do use 6-bit word mode to display characters. Maybe we could make a custom large font routine?Program 26-4Code: [Select] b_call(_ClrLCDFull) b_call(_HomeUp) LD HL, text CALL CustomStr RETtext: .DB "Hello ", 1, 0CustomStr: LD A, (HL) OR A RET Z CP 1 JR NZ, NormalChar ; Trap for char $01 (custom) PUSH AF XOR A ; Configure word size OUT ($10), A LD A, $05 ; Configure X auto-increment CALL $000B OUT ($10), A LD A, (CurCol) ; Set LCD Row ADD A, $20 CALL $000B OUT ($10), A LD A, (CurRow) ; Set LCD Row ADD A, A ADD A, A ADD A, A ADD A, $80 OUT ($10), A LD DE, Smilie LD B, 8FontLoop: LD A, (DE) CALL $000B OUT ($11), A INC DE DJNZ FontLoop LD A, (CurCol) ; Advance cursor position INC A AND %00001111 LD (CurCol), A JR NZ, DoneCustomFont LD A, (CurRow) ; Advance row. This doesn't check for a bad INC A ; position or scroll. Do that on your own time. LD (CurRow), ADoneCustomFont: POP AF JR DoneCharNormalChar: b_call(_PutC)DoneChar: INC HL JR CustomStr; Our custom character!smilie: .DB %00011110 .DB %00101101 .DB %00101101 .DB %00111111 .DB %00101101 .DB %00110011 .DB %00011110 .DB %00000000
b_call(_ClrLCDFull) b_call(_HomeUp) LD HL, text CALL CustomStr RETtext: .DB "Hello ", 1, 0CustomStr: LD A, (HL) OR A RET Z CP 1 JR NZ, NormalChar ; Trap for char $01 (custom) PUSH AF XOR A ; Configure word size OUT ($10), A LD A, $05 ; Configure X auto-increment CALL $000B OUT ($10), A LD A, (CurCol) ; Set LCD Row ADD A, $20 CALL $000B OUT ($10), A LD A, (CurRow) ; Set LCD Row ADD A, A ADD A, A ADD A, A ADD A, $80 OUT ($10), A LD DE, Smilie LD B, 8FontLoop: LD A, (DE) CALL $000B OUT ($11), A INC DE DJNZ FontLoop LD A, (CurCol) ; Advance cursor position INC A AND %00001111 LD (CurCol), A JR NZ, DoneCustomFont LD A, (CurRow) ; Advance row. This doesn't check for a bad INC A ; position or scroll. Do that on your own time. LD (CurRow), ADoneCustomFont: POP AF JR DoneCharNormalChar: b_call(_PutC)DoneChar: INC HL JR CustomStr; Our custom character!smilie: .DB %00011110 .DB %00101101 .DB %00101101 .DB %00111111 .DB %00101101 .DB %00110011 .DB %00011110 .DB %00000000