-
Notifications
You must be signed in to change notification settings - Fork 2
/
Draw.z80s
98 lines (80 loc) · 2.1 KB
/
Draw.z80s
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
;
; Use draw actually to display graphics. The automatic
; frame rate compensation mechanisms mean that drawing
; and updating are decoupled. See Update.z80s for the
; code that updates the game from one discrete moment
; to the next.
;
Draw:
;
; The following are two test calls to my DrawPoly routine;
; there's nothing else in the code that's smart enough
; to clip polygons so they're not actually enabled for
; 3d (and would probably be too slow anyway)
;
; call ClearDisplay
; ld a, 4
; ld b, 0xcc
; ld hl, PolyVerticesX
; call DrawPoly
; ret
; ld a, 4
; ld b, 0xfc
; ld hl, PolyVerticesX
; call DrawPoly
; ret
; make new player matrix by setting a camera per
; the rotations described in the player info block
ld iy, PlayerInfoBlock
call SetCamera_Rot3
; if you wanted to see the version with just the
; Cobra Mk3 (ie, not the stress test) then you'd
; enable the jump below
;
; jr @+nostress
; draw House
ld iy, HouseBlock2
call DrawModel_Rot3
; a ret here would leave you with just the house,
; so this is an alternative simple scene for
; benchmarking.
;
; ret
; draw House
ld iy, HouseBlock1
call DrawModel_Rot3
; draw House
ld iy, HouseBlock3
call DrawModel_Rot3
; draw House
ld iy, HouseBlock4
call DrawModel_Rot3
; draw House
ld iy, HouseBlock5
call DrawModel_Rot3
@nostress:
; draw Cobra Mk 3 model
ld iy, CobraMk3Block
call DrawModel_Rot3
; this is an alternative jump into an alternative
; model drawer that I was experimenting with (being
; basically a precompiled model, with little
; prewritten programs to handle arbitrary data
; duplication); it ended up not being sufficiently
; faster than the original to justify the effort
; so is currently disabled
; ld iy, CobraMk3BlockNew
; call DrawModel_Rot3New
ret
;
; Test tables are below that would be used by the test
; DrawPoly call above. So these would establish a polygon
; with vertices at (2, 70), (28, 20), (245, 30) and (5, 190)
;
;DS ALIGN 256
;PolyVerticesX:
; db 2, 28, 245, 5
;
;DS ALIGN 256
;PolyVerticesY:
; db 70, 20, 30, 190