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 506f134..22ab5ca 100644 Binary files a/scroller/main.tap and b/scroller/main.tap differ 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