-
Notifications
You must be signed in to change notification settings - Fork 1
/
plasma.asm
106 lines (91 loc) · 1.34 KB
/
plasma.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
org 100h
call bgl_init
mov dx,3c8h
xor al,al
out dx,al
mov dx,3c9h
mov cx,768
palette:
mov ax,cx
dec ax
shr ax,2
push ax
xor al,al
out dx,al
pop ax
out dx,al
out dx,al
loop palette
draw:
xor cx,cx
xor dx,dx
xor di,di
.loop:
mov ax,cx
shr ax,1
add ax,[frame_counter]
call bgl_get_sine
add word [colour],ax
mov ax,dx
add ax,[frame_counter]
call bgl_get_sine
add word [colour],ax
mov ax,cx
shl ax,1
mov bx,dx
add bx,[frame_counter]
add bx,[frame_counter]
add ax,bx
call bgl_get_sine
add ax,[frame_counter]
shr ax,1
add word [colour],ax
mov ax,[colour]
shr ax,2
mov ah,al
push ax
shl eax,16
pop ax
mov dword [es:di],eax
push di
add di,320
mov dword [es:di],eax
add di,320
mov dword [es:di],eax
add di,320
mov dword [es:di],eax
add di,4
mov dword [es:di],eax
pop di
add di,4
;;;
mov word [colour],0
inc cx
inc cx
inc cx
inc cx
cmp cx,320
jne .loop_skip
add di,320
add di,320
add di,320
xor cx,cx
inc dx
inc dx
inc dx
inc dx
cmp dx,200
jne .loop_skip
jmp .loop_end
.loop_skip:
cmp di,64000
jne .loop
.loop_end:
call bgl_wait_retrace
call bgl_write_buffer_fast
add word [frame_counter],1
jmp draw
%include "bgl.asm"
%include "general.asm"
frame_counter dw 0
colour dw 0