From: John Tsiombikas Date: Sun, 9 Feb 2020 21:02:19 +0000 (+0200) Subject: added numbers and logo X-Git-Tag: v1.0~2 X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=zxkeybtest;a=commitdiff_plain;h=a63899029c65781a66b02c4da7f35a36699525bc added numbers and logo --- diff --git a/.gitignore b/.gitignore index 7c5782d..84ca4a0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ *.rom *.tap *.swp +*.lst diff --git a/Makefile b/Makefile index e0e5c42..501cb6f 100644 --- a/Makefile +++ b/Makefile @@ -26,11 +26,13 @@ $(tap): $(bin) appmake +zx -o $@ --org 28000 --blockname $(name) -b $< %.o: %.asm - $(AS) -o $@ $(ASFLAGS) $< >/dev/null + $(AS) -o $@ $(ASFLAGS) -L $*.lst $< >/dev/null + +testrom.o: testrom.asm glyphs.inc logo.inc .PHONY: clean clean: - rm -f $(bin) $(rom) $(tap) $(obj) + rm -f $(bin) $(rom) $(tap) $(obj) $(obj:.o=.lst) .PHONY: run run: $(tap) diff --git a/data/zxkeyb.xbm b/data/zxkeyb.xbm new file mode 100644 index 0000000..9bfa0b6 --- /dev/null +++ b/data/zxkeyb.xbm @@ -0,0 +1,13 @@ +#define zxkeyb_width 56 +#define zxkeyb_height 16 +static unsigned char zxkeyb_bits[] = { + 0xfc, 0x7f, 0x3f, 0x3f, 0x00, 0x00, 0x00, 0xfc, 0x7f, 0x3f, 0x3f, 0x00, + 0x00, 0x00, 0xfc, 0x7f, 0x1c, 0x0e, 0x00, 0x00, 0x00, 0x3c, 0x38, 0x1c, + 0x0e, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x38, 0x07, 0x00, 0x00, 0x00, 0x00, + 0x2e, 0x38, 0x47, 0x00, 0x00, 0x20, 0x00, 0x27, 0xf1, 0x43, 0x00, 0x00, + 0x20, 0x00, 0x97, 0x00, 0x22, 0x00, 0x24, 0x10, 0x80, 0x53, 0x9c, 0x28, + 0x0c, 0x97, 0x1e, 0xc0, 0x73, 0xa2, 0xe4, 0x92, 0x72, 0x11, 0x60, 0x88, + 0x12, 0x33, 0x51, 0x12, 0x19, 0x70, 0x89, 0xcc, 0x9d, 0x49, 0x1b, 0x0d, + 0x78, 0x86, 0x3f, 0x7b, 0xf6, 0x17, 0x0b, 0xfc, 0x30, 0xc0, 0x08, 0x00, + 0x00, 0x00, 0xfc, 0x7f, 0xaf, 0x22, 0x00, 0x00, 0x00, 0xfc, 0x7f, 0x6f, + 0x3e, 0x00, 0x00, 0x00}; diff --git a/glyphs.inc b/glyphs.inc index c0e4cd2..a464d6c 100644 --- a/glyphs.inc +++ b/glyphs.inc @@ -1,10 +1,100 @@ ; vi:filetype=z80: +glyph_0: + db %00111000 + db %01001100 + db %01001100 + db %01010100 + db %01100100 + db %01100100 + db %00111000 + db %00000000 +glyph_1: + db %00010000 + db %00110000 + db %00010000 + db %00010000 + db %00010000 + db %00010000 + db %00111000 + db %00000000 +glyph_2: + db %00111000 + db %01000100 + db %00000100 + db %00001000 + db %00010000 + db %00100000 + db %01111100 + db %00000000 +glyph_3: + db %00111000 + db %01000100 + db %00000100 + db %00011000 + db %00000100 + db %01000100 + db %00111000 + db %00000000 +glyph_4: + db %00001000 + db %00011000 + db %00101000 + db %01001000 + db %01111100 + db %00001000 + db %00001000 + db %00000000 +glyph_5: + db %01111100 + db %01000000 + db %01111000 + db %00000100 + db %00000100 + db %01000100 + db %00111000 + db %00000000 +glyph_6: + db %00111000 + db %01000100 + db %01000000 + db %01111000 + db %01000100 + db %01000100 + db %00111000 + db %00000000 +glyph_7: + db %01111100 + db %00000100 + db %00001000 + db %00001000 + db %00010000 + db %00010000 + db %00010000 + db %00000000 +glyph_8: + db %00111000 + db %01000100 + db %01000100 + db %00111000 + db %01000100 + db %01000100 + db %00111000 + db %00000000 +glyph_9: + db %00111000 + db %01000100 + db %01000100 + db %00111100 + db %00000100 + db %01000100 + db %00111000 + db %00000000 glyph_a: db %00010000 db %00101000 db %00101000 - db %01111100 db %01000100 + db %01111100 db %01000100 db %11101110 db %00000000 diff --git a/logo.inc b/logo.inc new file mode 100644 index 0000000..7c6f0bb --- /dev/null +++ b/logo.inc @@ -0,0 +1,18 @@ +; vi:filetype=z80: +logo: + db $3f,$fe,$fc,$fc,$00,$00,$00 + db $3f,$fe,$fc,$fc,$00,$00,$00 + db $3f,$fe,$38,$70,$00,$00,$00 + db $3c,$1c,$38,$70,$00,$00,$00 + db $30,$30,$1c,$e0,$00,$00,$00 + db $00,$74,$1c,$e2,$00,$00,$04 + db $00,$e4,$8f,$c2,$00,$00,$04 + db $00,$e9,$00,$44,$00,$24,$08 + db $01,$ca,$39,$14,$30,$e9,$78 + db $03,$ce,$45,$27,$49,$4e,$88 + db $06,$11,$48,$cc,$8a,$48,$98 + db $0e,$91,$33,$b9,$92,$d8,$b0 + db $1e,$61,$fc,$de,$6f,$e8,$d0 + db $3f,$0c,$03,$10,$00,$00,$00 + db $3f,$fe,$f5,$44,$00,$00,$00 + db $3f,$fe,$f6,$7c,$00,$00,$00 diff --git a/testrom.asm b/testrom.asm index 5d6ce67..592c7c5 100644 --- a/testrom.asm +++ b/testrom.asm @@ -3,19 +3,18 @@ fb_addr equ $4000 attr_addr equ $5800 ula_port equ $fe + main: call init - ld c, 16 + + ld hl, fb_addr + 25 + call draw_logo + + ld c, 4 ld b, 12 call calc_cell_addr - ld a, 'F' - call putchar - inc de - ld a, 'O' - call putchar - inc de - ld a, 'O' - call putchar + ld hl, str_foobar + call putstr .looptop: jr .looptop @@ -82,21 +81,59 @@ calc_cell_addr: pop af ret + ; hl: dest +draw_logo: + ld de, logo + ld b, 16 +.logoy: ld c, 7 + push bc +.logox: ld a, (de) + ld (hl), a + inc de + inc l + dec c + jr nz, .logox + ld bc, 7 + sbc hl, bc + inc h + + ld a, h + and $e7 + ld h, a + and $7 + jr nz, .skipinc + ld a, l + add $20 + ld l, a +.skipinc: + pop bc + dec b + jr nz, .logoy + ret ; de: dest ; a: char putchar: - sub 'A' + ; is it a digit? + ld bc, glyph_0 + sub '0' + ret c + cp 10 + jr c, .common + ; is it A-Z ? + sub 'A'-'0' ret c cp 27 ret nc + ld bc, glyph_a +.common: push de + push hl sla a sla a sla a ld h, 0 ld l, a - ld bc, glyph_a add hl, bc ld c, 8 .chartop: @@ -106,7 +143,31 @@ putchar: inc hl dec c jr nz, .chartop + pop hl pop de ret + ; de: dest + ; hl: str +putstr: + xor a + ld b, (hl) + cp b + jr z, .done + ld a, b + call putchar + inc hl + inc de + jr putstr +.done: ret + + ; de: dest + ; a: number +putbin8: + ld b, 8 + + +str_foobar asciiz 'FOOBAR 1234567890' + include glyphs.inc + include logo.inc