40 lines
888 B
ArmAsm
40 lines
888 B
ArmAsm
;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*-
|
|
|
|
;; Test program that tries to draw a triangle
|
|
.scope triangle_test
|
|
.include "triangle.inc"
|
|
LDA #$33
|
|
STA A_X
|
|
STA A_Y
|
|
LDA #$55
|
|
STA C_X
|
|
STA C_Y
|
|
LDA #$77
|
|
STA B_X
|
|
LDA #$20
|
|
STA B_Y
|
|
|
|
; jmp skipp_edges ; Skip drawing the edges
|
|
;;Draw the edges (only for reference)
|
|
edges:
|
|
X_end = $EF
|
|
Y_end = $F0
|
|
;X_pos = $FC
|
|
;Y_pos = $FB
|
|
;;; A -- B
|
|
Mov_16 X_pos, Y_pos, A_X, A_Y
|
|
Mov_16 X_end, Y_end, B_X, B_Y
|
|
JSR line
|
|
;;; A -- C
|
|
Mov_16 X_pos, Y_pos, A_X, A_Y
|
|
Mov_16 X_end, Y_end, C_X, C_Y
|
|
JSR line
|
|
;;; B -- C
|
|
Mov_16 X_pos, Y_pos, C_X, C_Y
|
|
Mov_16 X_end, Y_end, B_X, B_Y
|
|
JSR line
|
|
skip_edges:
|
|
;; lets draw the example triangle
|
|
JSR triangle
|
|
JMP exit
|
|
.endscope
|