Moar routines and debug

This commit is contained in:
Pedro de Oliveira 2014-08-19 08:00:19 +01:00
parent 1326881923
commit 7c089a9ea7
3 changed files with 39 additions and 14 deletions

View File

@ -29,7 +29,7 @@ rom_define_borda equ $2294; Rotina da ROM que define a borda
screen_attribute equ $47
; Valor de 0 a 7
border_color equ $0
border_color equ $6
clear_screen
ld a, screen_attribute

View File

@ -8,11 +8,9 @@ clr_screen EQU $0daf ; ROM routine to clear the screen
; Star Structure
; X - 1 Byte $00 - $20
; Xbit - 1 Byte $7 - $0
; Y - 1 Byte $00 - $bf
; ----------
; Z - 1 Byte
; ZLoop - 1Byte
STAR_SIZE EQU $4
MAX_STARS EQU 10
@ -22,11 +20,12 @@ start
xor a
ld (tv_flag), a
push bc
call clear_screen
main_start
ld hl, StarRnd
ld c, MAX_STARS
main
ld a, (hl)
ld e, a
@ -44,10 +43,36 @@ main
inc hl
dec c
jr nz, main
;call increment_x
;jr main_start
pop bc
ret
PROC
; Increment X
increment_x
push bc
ld hl, StarRnd
ld c, MAX_STARS
increment_x_loop
inc hl
ld a, (hl)
inc a
cp $20
jr z, increment_x_zero
increment_x_update
ld (hl), a
inc hl
dec c
jr nz, increment_x_loop
pop bc
ret
increment_x_zero
ld a, $0
jr increment_x_update
ENDP
PROC
; Video Ram Address in HL

View File

@ -1,11 +1,11 @@
StarRnd
db 10, 0
db 10, 1
db 20, 0
db 20, 1
db 30, 0
db 30, 1
db 40, 0
db 40, 1
db 50, 0
db 50, 1
db 0, 0
db 1, 10
db 2, 20
db 3, 30
db 4, 40
db 5, 50
db 6, 60
db 7, 70
db 8, 80
db 9, 90