; ;################################# ;# Font Generator # ;# public domain # ;# by B.W. van Schooten # ;################################# ;------------------------------- CONSTANTS -------------------------------- fontstartpage equ $1c ;--------------------------- ZEROPAGE VARIABLES --------------------------- tmpadr1_w equ $fc tmpadr1_lo equ $fc tmpadr1_hi equ $fd tmpadr2_w equ $fe tmpadr2_lo equ $fe tmpadr2_hi equ $ff org 4095 db lo 4097,hi 4097 db 11,17,204,7,158,'4109',0,0,0 ;BASIC program entrypoint: lda #$ff sta $9005 lda #8 sta $900f jsr genchars ldx #63 drawtest: txa sta $1e00,x dex bpl drawtest rts genchars: lda #0 sta tmpadr1_lo sta tmpadr2_lo lda #fontstartpage sta tmpadr1_hi lda #hi $8000 sta tmpadr2_hi ldx #64 genchars_char: ldy #2 lda (tmpadr2_w),y and #60 dey ora (tmpadr2_w),y sta (tmpadr1_w),y dey lda (tmpadr2_w),y sta (tmpadr1_w),y ldy #7 lda #0 sta (tmpadr1_w),y genchars_copy: lda (tmpadr2_w),y dey sta (tmpadr1_w),y cpy #3 bpl genchars_copy clc lda tmpadr1_lo adc #8 sta tmpadr1_lo sta tmpadr2_lo bcc genchars_c_noc inc tmpadr1_hi inc tmpadr2_hi genchars_c_noc: dex bne genchars_char lda #0 sta tmpadr1_lo lda #fontstartpage sta tmpadr1_hi ldx #0 chargen_patch: lda fontpatches,x bmi chargen_patchdone inx clc adc tmpadr1_lo sta tmpadr1_lo bcc genchars_p_noc inc tmpadr1_hi genchars_p_noc: lda fontpatches,x inx ldy #0 sta (tmpadr1_w),y jmp chargen_patch chargen_patchdone: rts fontpatches: db 10,66, 11-10,126 ;A db 57-11,32 ;G db 105-57,102 ;M db 153-105,64 ;S db 186-153,66 ;W db 193-186,36 ;X db 240-193,8 ;^ db 281-240,126 ;# db 289-281,30,290-289,60 ;$ db 297-290,100 ;% db 313-297,8,314-313,16 ;' db 321-314,8 ;( db 329-321,16 ;) db 336-329,42,337-336,28,341-337,0 ;* db 344-341,8 ;+ db 377-344,4 ;/ db 416-377,12,417-416,20 ;4 db 425-417,64,426-425,124 ;5 db 441-426,68 ;7 db -1