Draw clock face
This commit is contained in:
parent
4396f2935e
commit
05ebcea523
43
dosclock.asm
43
dosclock.asm
|
@ -4,6 +4,7 @@ bits 16
|
||||||
|
|
||||||
midpoint_x equ 160
|
midpoint_x equ 160
|
||||||
midpoint_y equ 100
|
midpoint_y equ 100
|
||||||
|
|
||||||
hour_hand_len equ 50
|
hour_hand_len equ 50
|
||||||
hour_hand_color equ 7
|
hour_hand_color equ 7
|
||||||
minute_hand_len equ 80
|
minute_hand_len equ 80
|
||||||
|
@ -11,6 +12,10 @@ minute_hand_color equ 7
|
||||||
second_hand_len equ 75
|
second_hand_len equ 75
|
||||||
second_hand_color equ 4
|
second_hand_color equ 4
|
||||||
|
|
||||||
|
face_notch_len equ 8
|
||||||
|
face_notch_distance equ 90
|
||||||
|
face_notch_color equ 47
|
||||||
|
|
||||||
section .code
|
section .code
|
||||||
|
|
||||||
setup:
|
setup:
|
||||||
|
@ -28,6 +33,44 @@ setup:
|
||||||
mov ax, 0xa000
|
mov ax, 0xa000
|
||||||
mov es, ax
|
mov es, ax
|
||||||
|
|
||||||
|
clockface:
|
||||||
|
xor bx, bx
|
||||||
|
.loop:
|
||||||
|
cmp bx, 360
|
||||||
|
je .done
|
||||||
|
|
||||||
|
mov word [line_sx], midpoint_x
|
||||||
|
mov word [line_sy], midpoint_y
|
||||||
|
mov word [line_ex], midpoint_x
|
||||||
|
mov word [line_ey], midpoint_y
|
||||||
|
|
||||||
|
mov ax, face_notch_distance
|
||||||
|
call sinx
|
||||||
|
add [line_sx], ax
|
||||||
|
|
||||||
|
mov ax, face_notch_distance
|
||||||
|
call cosx
|
||||||
|
sub [line_sy], ax
|
||||||
|
|
||||||
|
mov ax, face_notch_distance + face_notch_len
|
||||||
|
call sinx
|
||||||
|
add [line_ex], ax
|
||||||
|
|
||||||
|
mov ax, face_notch_distance + face_notch_len
|
||||||
|
call cosx
|
||||||
|
sub [line_ey], ax
|
||||||
|
|
||||||
|
push bx
|
||||||
|
mov bl, face_notch_color
|
||||||
|
call draw_line
|
||||||
|
pop bx
|
||||||
|
|
||||||
|
add bx, 15
|
||||||
|
|
||||||
|
jmp .loop
|
||||||
|
|
||||||
|
.done:
|
||||||
|
|
||||||
mainloop:
|
mainloop:
|
||||||
; Check keyboard
|
; Check keyboard
|
||||||
mov ah, 6
|
mov ah, 6
|
||||||
|
|
Loading…
Reference in New Issue