I forgot to commit for a while and I haven't done much, but got the very basics of the game pong working. Signed-off-by: deadvey <deadvey@deadvey.com>
54 lines
612 B
NASM
54 lines
612 B
NASM
os_set_graphics_mode:
|
|
pusha
|
|
|
|
mov ah, 00h
|
|
mov al, 13h
|
|
int 10h
|
|
|
|
popa
|
|
ret
|
|
|
|
; --------------------------------------
|
|
|
|
; x_end
|
|
; y_end
|
|
; x_start
|
|
; y_start
|
|
; colour
|
|
os_draw_graphical_rectangle:
|
|
; Tell BIOS we're changing 'da pixels!
|
|
mov ah, 0Ch
|
|
|
|
mov al, 1100b
|
|
|
|
mov cx, [x_start]
|
|
mov dx, [y_start]
|
|
|
|
jmp .x_loop
|
|
|
|
.x_loop:
|
|
int 10h
|
|
cmp cx, [x_end]
|
|
je .next_row
|
|
inc cx
|
|
call .x_loop
|
|
|
|
.next_row:
|
|
mov cx, [x_start]
|
|
cmp dx, [y_end]
|
|
je .finish
|
|
inc dx ; Increase Row
|
|
call .x_loop
|
|
|
|
.finish:
|
|
ret
|
|
|
|
|
|
section .data
|
|
x_start dw 0
|
|
y_start dw 0
|
|
x_end dw 0
|
|
y_end dw 0
|
|
colour db 1111b
|
|
|