From 234bb989e41a7dd6002624f7930df49d49be625b Mon Sep 17 00:00:00 2001 From: Pedro de Oliveira Date: Mon, 11 Aug 2014 04:58:52 +0100 Subject: [PATCH] =?UTF-8?q?Rotina=20para=20definir=20a=20cor=20do=20ecr?= =?UTF-8?q?=C3=A3=20e=20border?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scroller/clear.asm | 39 ++++++++++++++++++++++++++++++++++++++ scroller/main.asm | 7 +++++-- scroller/main.tap | Bin 284 -> 291 bytes scroller/scroll_pixel.asm | 8 +++----- 4 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 scroller/clear.asm diff --git a/scroller/clear.asm b/scroller/clear.asm new file mode 100644 index 0000000..4f335d6 --- /dev/null +++ b/scroller/clear.asm @@ -0,0 +1,39 @@ +; Cores +; Numero | Binario | Nome +; 0 | 000 | Preto +; 1 | 001 | Azul +; 2 | 010 | Vermelho +; 3 | 011 | Roxo +; 4 | 100 | Verde +; 5 | 101 | Cyan +; 6 | 110 | Amarelo +; 7 | 111 | Branco + +; 8 bits para definir ink, paper, brightness e flash +; |F |B |P2|P1|P0|I2|I1|I0| +; F Flash +; B Brightness +; P Paper +; I Ink + +; Entćo para definir o flash desligado, o brightness ligado com o +; fundo a preto e o texto a amarelo fica-se com: +; 01000110 = 70 +; 01000000 = 64 - Tudo preto +screen_attribute db 64 + +; Valor de 0 a 7 +border_attribute db 0 + +clear_screen + ld a, (screen_attribute) + ld (23693), a ; Variavel de sistema que permite definir + ; o ink, paper, brightness e flash + call 3503 ; Chama a funēćo da ROM para fazer clear + ; screen + + ld a, (border_attribute) + call 8859 ; Chama a funēćo da ROM para actualizar + ; a border com o valor que estį em A + ; O valor fica guardado em 23624 + ret diff --git a/scroller/main.asm b/scroller/main.asm index 0731095..ce72953 100644 --- a/scroller/main.asm +++ b/scroller/main.asm @@ -6,7 +6,7 @@ tv_flag equ 5C3Ch ; 17 Ć© para definir o PAPER ; 22 Ć© para definir as Cordenadas Y,X ; 255 Marcador de fim da string -mystr db 22,10,0, 16, 7, 17, 2, " ", 16,0, 17,1, ".o0O0o. ", 17, 5, 16, 2, "LOL GORDOS", 17, 1, 16,6, " .o0O0o.", 16, 7, 17, 2, " ", 255 +mystr db 22,10,0, 16, 7, " ", 16, 6, ".o0O0o. LOL GORDOS .o0O0o.", 16, 7, " ", 255 start xor a ; O mesmo que LD a, 0 @@ -15,6 +15,8 @@ start push bc ; Parece que Ć© algum standard guardar o BC ; na stack, e tirar no fim do programa. + call clear_screen ; Limpa o ecrĆ£ + ld hl, mystr ; Le para HL o endereƧo da string a printar printa_ate_255 @@ -29,7 +31,7 @@ printa_ate_255 inc hl ; Incrementa o valor de HL ; Passa a ter o endereƧo do proximo caracater da str - + jr printa_ate_255 ; Volta ao inicio da rotina mainloop @@ -53,5 +55,6 @@ exit ;INCLUDE "scroll_pc.asm" INCLUDE "scroll_pixel.asm" INCLUDE "delay.asm" +INCLUDE "clear.asm" end start diff --git a/scroller/main.tap b/scroller/main.tap index 506f134f6101862d333383b945ef0d94a6b6789e..22ab5ca7d27a4a178d5c1cae6b344f1fd5132653 100644 GIT binary patch delta 213 zcmbQkw3ul^SiOl69|J>FDFbh*FarZ~ZenJhUP)qsg2E~WgHnbDoiz;q#kd#**cAlW z^zse-4f6FA6cl{?eH7gNgIxTBfgGqXP|5%GMm8}=&z>q(G$^h6_g{nU>Gg-o5?}2Y zj5uP>c9q&Op50k$#S!z5LF3KAlMFzh=-}bU$D!0#dUkH9R$HkGufpe(K>8@70>fJ` zrH;~rY>IW_<=O(jv^q-bE~ delta 206 zcmZ3?G>2(ISiPwk9|J>1DFd&QFarZ~ZenJhUP)qsg2G}3gHnbD)ujyo#kd#**aevs z1Q-Mv_3{n;4f6FA6chwm1(U6}}uinFj!Ten0B~ diff --git a/scroller/scroll_pixel.asm b/scroller/scroll_pixel.asm index 6daaf18..1305a86 100644 --- a/scroller/scroll_pixel.asm +++ b/scroller/scroll_pixel.asm @@ -30,18 +30,16 @@ scrolla_0 scrolla_1 ld hl, (tmpScroll1) ; Le o argumento tmp1 para HL - ; Soma $1F ao endereƧo para comeƧar no fim da linha, tudo Ć  direita + ; Soma $20 ao endereƧo para comeƧar no fim da linha, tudo Ć  direita push bc - ;ld bc, 1Fh - ld bc, 20h + ld bc, 20h adc hl, bc ; Guarda o endereƧo do fim da linha em (ultimoaddr) ld (ultimoaddr), hl pop bc - ;ld b, 1Fh ; Numero de vezes que a rotina vai correr - ld b, 21h ; Numero de vezes que a rotina vai correr + ld b, 21h ; Loop2 scrolla_2