Prev: 9AAB Up: Map Next: 9BA7
9AEC: Plot mini font characters
Used by the routines at drive_chatter and noise_effect.
Input
A flag?
D The character to plot (ASCII)
plot_mini_font_1 9AEC LD BC,$0000
9AEF JR pmf_go Jump to pmf_go
This entry point is used by the routines at drive_chatter, print_chatter and noise_effect.
plot_mini_font_2 9AF1 LD BC,$0780 values to self modify with
pmf_go 9AF4 EX AF,AF' Preserve A
9AF5 LD A,B self modify LD C and OR 7 later
9AF6 LD ($9B64),A
9AF9 LD A,C
9AFA LD ($9B61),A
9AFD EX AF,AF' Restore A
9AFE CP $FF If not string terminator, goto pmf_regular_char -- or is this a flag?
9B00 JR NZ,pmf_regular_char
String terminator?
9B02 LD E,$BF $BF / 8?
9B04 LD A,$05
9B06 JR pmf_9b10
pmf_regular_char 9B08 LD E,A A = A*5+2
9B09 ADD A,A
9B0A ADD A,A
9B0B ADD A,E
9B0C ADD A,$02
9B0E LD E,$C0 8 - $C0 / 8 ??
pmf_9b10 9B10 LD C,$08
pmf_9b12 9B12 INC E divider / rounding?
9B13 SUB C
9B14 JP NC,pmf_9b12
9B17 NEG
9B19 LD B,A Modify jump table - A * 4 - 4 bytes per sequence
9B1A ADD A,A
9B1B ADD A,A
9B1C LD ($9B67),A
9B1F LD A,$FF
pmf_9b21 9B21 ADD A,A General multiplier by A
9B22 DJNZ pmf_9b21
9B24 LD ($9B89),A Self modify 9B88 which is a mask
9B27 LD A,D Get ASCII character
Turn ASCII into glyph IDs
9B28 LD D,$45 likely the screen addr top
9B2A CP $2E Is it '.'? glyph ID = 26; goto have_glyph_id
9B2C LD C,$1A
9B2E JR Z,pmf_have_glyph_id
9B30 INC C Is it ','? glyph ID = 27; goto have_glyph_id
9B31 CP $2C
9B33 JR Z,pmf_have_glyph_id
9B35 INC C Is it '!'? glyph ID = 28; goto have_glyph_id
9B36 CP $21
9B38 JR Z,pmf_have_glyph_id
9B3A INC C Is it ' '? glyph ID = 29; goto have_glyph_id
9B3B CP $20
9B3D JR Z,pmf_have_glyph_id
9B3F INC C Is it '''? glyph ID = 30; goto have_glyph_id
9B40 CP $27
9B42 JR Z,pmf_have_glyph_id
9B44 CP $3A Is it >= ';'? goto have_ascii
9B46 JR NC,pmf_have_ascii
9B48 SUB $2F C += A - 47 -- not convinced this is ever used
9B4A ADD A,C
9B4B LD C,A
pmf_have_glyph_id 9B4C LD A,C Turn the glyph ID in C into ASCII in A
9B4D ADD A,$41
pmf_have_ascii 9B4F SUB $41 BC = (A - 'A') * 6
9B51 ADD A,A
9B52 LD C,A
9B53 ADD A,A
9B54 ADD A,C
9B55 LD C,A
9B56 LD B,$00
9B58 LD HL,$DFF8 Point HL at minifont
9B5B ADD HL,BC
9B5C EX DE,HL
9B5D LD A,$06
pmf_9b5f 9B5F EX AF,AF'
9B60 LD C,$80 Self modified earlier
9B62 LD A,(DE)
9B63 OR $07 Self modified earlier
9B65 LD B,A
plot_mini_font_1_0 9B66 JR plot_mini_font_1_0 Jump table (self modified)
9B68 SRL B
9B6A RR C
9B6C SRL B
9B6E RR C
9B70 SRL B
9B72 RR C
9B74 SRL B
9B76 RR C
9B78 SRL B
9B7A RR C
9B7C SRL B
9B7E RR C
9B80 SRL B
9B82 RR C
9B84 SRL B
9B86 RR C
9B88 LD A,$00 This must be self modified
9B8A AND (HL) *scr++ = (*scr AND A) OR B
9B8B OR B
9B8C LD (HL),A
9B8D INC L
9B8E LD (HL),C *scr-- = C
9B8F DEC L
9B90 INC DE Next source byte ?
9B91 INC H Move to next scanline
9B92 LD A,H
9B93 AND $07
9B95 JR NZ,pmf_next_row
9B97 LD A,L
9B98 ADD A,$20
9B9A LD L,A
9B9B JR C,pmf_next_row
9B9D LD A,H
9B9E SUB $08
9BA0 LD H,A
pmf_next_row 9BA1 EX AF,AF' Decrement row counter
9BA2 DEC A
9BA3 JP NZ,pmf_9b5f Loop while rows remain
9BA6 RET Return
Prev: 9AAB Up: Map Next: 9BA7