mirror of https://github.com/falsovsky/z80.git
Rotina para definir a cor do ecrã e border
This commit is contained in:
parent
e80e6bbcb4
commit
234bb989e4
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue