annotate 3rdparty/packages/sierra/objs/shdw.asm @ 1797:3084051a2863

Updated
author boisy
date Mon, 11 Apr 2005 15:42:16 +0000
parents 2d67237cca33
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1059
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1 ********************************************************************
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2 * SHDW - Kings Quest III screen rendering module??
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
3 * $Id$
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
4 *
1356
2d67237cca33 Added new style comments
boisy
parents: 1059
diff changeset
5 * Note the header shows a data size of 0 called from the sierra
2d67237cca33 Added new style comments
boisy
parents: 1059
diff changeset
6 * module and accesses data set up in that module.
1059
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
7 *
1356
2d67237cca33 Added new style comments
boisy
parents: 1059
diff changeset
8 * Much credit and thanks is give to Nick Sonneveld and the other NAGI
2d67237cca33 Added new style comments
boisy
parents: 1059
diff changeset
9 * folks. Following his sources made it so much easier to document what
2d67237cca33 Added new style comments
boisy
parents: 1059
diff changeset
10 * was happening in here.
2d67237cca33 Added new style comments
boisy
parents: 1059
diff changeset
11 *
2d67237cca33 Added new style comments
boisy
parents: 1059
diff changeset
12 * This source will assemble byte for byte to the original kq3 shdw module.
1059
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
13 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
14 * Header for : shdw
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
15 * Module size: $A56 #2646
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
16 * Module CRC : $E9E019 (Good)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
17 * Hdr parity : $74
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
18 * Exec. off : $0012 #18
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
19 * Data size : $0000 #0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
20 * Edition : $00 #0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
21 * Ty/La At/Rv: $11 $81
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
22 * Prog mod, 6809 Obj, re-ent, R/O
1356
2d67237cca33 Added new style comments
boisy
parents: 1059
diff changeset
23 *
2d67237cca33 Added new style comments
boisy
parents: 1059
diff changeset
24 * Edt/Rev YYYY/MM/DD Modified by
2d67237cca33 Added new style comments
boisy
parents: 1059
diff changeset
25 * Comment
2d67237cca33 Added new style comments
boisy
parents: 1059
diff changeset
26 * ------------------------------------------------------------------
2d67237cca33 Added new style comments
boisy
parents: 1059
diff changeset
27 * 0 2003/03/14 Paul W. Zibaila
2d67237cca33 Added new style comments
boisy
parents: 1059
diff changeset
28 * Disassembly of original distribution using a combination of disasm
2d67237cca33 Added new style comments
boisy
parents: 1059
diff changeset
29 * v1.6 and the os9tools disassembler Os9disasm.
1059
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
30
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
31 nam shdw
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
32 ttl program module
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
33
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
34 ifp1
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
35 use defsfile
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
36 endc
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
37
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
38 tylg set Prgrm+Objct
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
39 atrv set ReEnt+rev
1356
2d67237cca33 Added new style comments
boisy
parents: 1059
diff changeset
40 rev set $00
1059
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
41 mod eom,name,tylg,atrv,start,size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
42
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
43 size equ .
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
44
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
45 Xffa9 equ $FFA9 task 1 block 2
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
46 X01af equ $01AF a state.flag byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
47 X0551 equ $0551 given_pic_data
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
48
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
49
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
50 * OS9 data area definitions
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
51
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
52 u001a equ $001A shdw MMU block data
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
53 u002e equ $002E Load offset
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
54 u0042 equ $0042 Sierra process descriptor block
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
55 u0043 equ $0043 Sierra 2nd 8K data block
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
56 u005a equ $005A color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
57 u005b equ $005B sbuff_drawmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
58 u005c equ $005C flag_control
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
59 u006b equ $006B pen_status
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
60
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
61 * these look like gen purpose scratch vars
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
62
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
63 u009e equ $009E
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
64 u009f equ $009F
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
65 u00a0 equ $00A0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
66 u00a1 equ $00A1
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
67 u00a2 equ $00A2
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
68 u00a3 equ $00A3
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
69 u00a4 equ $00A4
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
70 u00a5 equ $00A5
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
71 u00a6 equ $00A6
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
72 u00a7 equ $00A7
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
73 u00a8 equ $00A8
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
74 u00a9 equ $00A9
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
75 u00aa equ $00AA
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
76 u00ab equ $00AB
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
77 u00ac equ $00AC
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
78 u00ad equ $00AD
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
79 u00ae equ $00AE
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
80 u00af equ $00AF
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
81 u00b0 equ $00B0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
82 u00b2 equ $00B2
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
83 u00b3 equ $00B3
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
84
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
85
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
86
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
87
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
88 * VIEW OBJECTS FLAGS
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
89
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
90 O_DRAWN equ $01 * 0 - object has been drawn
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
91 O_BLKIGNORE equ $02 * 1 - ignore blocks and condition lines
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
92 O_PRIFIXED equ $04 * 2 - fixes priority agi cannot change it based on position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
93 O_HRZNIGNORE equ $08 * 3 - ignore horizon
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
94 O_UPDATE equ $10 * 4 - update every cycle
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
95 O_CYCLE equ $20 * 5 - the object cycles
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
96 O_ANIMATE equ $40 * 6 - animated
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
97 O_BLOCK equ $80 * 7 - resting on a block
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
98 O_WATER equ $100 * 8 - only allowed on water
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
99 O_OBJIGNORE equ $200 * 9 - ignore other objects when determining contacts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
100 O_REPOS equ $400 * 10 - set whenever a obj is repositioned
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
101 * that way the interpeter doesn't check it's next movement for one cycle
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
102 O_LAND equ $800 * 11 - only allowed on land
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
103 O_SKIPUPDATE equ $1000 * 12 - does not update obj for one cycle
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
104 O_LOOPFIXED equ $2000 * 13 - agi cannot set the loop depending on direction
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
105 O_MOTIONLESS equ $4000 * 14 - no movement.
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
106 * if position is same as position in last cycle then this flag is set.
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
107 * follow/wander code can then create a new direction
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
108 * (ie, if it hits a wall or something)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
109 O_UNUSED equ $8000
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
110
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
111 * Local Program Defines
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
112
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
113 PICBUFF_WIDTH equ 160 ($A0)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
114 PICBUFF_HEIGHT equ 168 ($A8)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
115
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
116 picb_size equ PICBUFF_WIDTH*PICBUFF_HEIGHT $6900
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
117 x_max equ PICBUFF_WIDTH-1 159 ($9F)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
118 y_max equ PICBUFF_HEIGHT-1 167 ($A7)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
119
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
120 gfx_picbuff equ $6040 screen buff low address
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
121 gbuffend equ gfx_picbuff+picb_size screen buff high address $C940
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
122
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
123 blit_end equ gfx_picbuff+$6860
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
124
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
125 cmd_start equ $F0 first command value
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
126
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
127
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
128 name equ *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
129 L000d fcs 'shdw'
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
130 fcb $00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
131
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
132 * This module is linked to in sierra
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
133
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
134 start equ *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
135 L0012 lbra L05fb gfx_picbuff_update_remap
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
136 lbra L0713 obj_chk_control
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
137 lbra L0175 render_pic (which calls pic_cmd_loop)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
138 lbra L0189 pic_cmd_loop
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
139 lbra L07be obj_blit
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
140 lbra L0927 obj_add_pic_pri
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
141 lbra L0a0f blit_restore
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
142 lbra L09d8 blit_save
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
143 lbra L040e sbuff_fill
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
144 lbra L063a blitlist_draw
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
145 lbra L0615 blitlist_erase
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
146
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
147 fcc 'AGI (c) copyright 1988 SIERRA On-Line'
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
148 fcc 'CoCo3 version by Chris Iden'
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
149 fcb C$NULL
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
150
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
151 * Twiddles with MMU
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
152 * accd is loaded by calling program
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
153 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
154 * u001a = shdw mem block data
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
155 * u0042 = sierra process descriptor block
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
156 * u0043 = Sierra 2nd 8K data block
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
157
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
158 L0074 cmpa u001a compare to shdw mem block
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
159 beq L008e equal ?? no work to be done move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
160 orcc #IntMasks turn off interupts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
161 sta u001a store the value passed in by a
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
162 lda u0042 get sierra process descriptor map block
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
163 sta Xffa9 map it in to $2000-$3FFF
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
164 ldu u0043 2nd 8K data block in Sierra
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
165 lda u001a load my mem block value
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
166 sta ,u save my values at address held in u0043
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
167 stb $02,u
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
168 std Xffa9 map it to task 1 block 2
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
169 andcc #^IntMasks restore the interupts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
170 L008e rts we done
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
171
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
172 L008f fcb $00 load offsets updated flag
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
173
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
174 * binary_list[] (pic_render.c)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
175 L0090 fdb $8000
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
176 fdb $4000
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
177 fdb $2000
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
178 fdb $1000
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
179 fdb $0800
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
180 fdb $0400
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
181 fdb $0200
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
182 fdb $0100
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
183 fdb $0080
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
184 fdb $0040
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
185 fdb $0020
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
186 fdb $0010
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
187 fdb $0008
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
188 fdb $0004
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
189 fdb $0002
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
190 fdb $0001
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
191
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
192 * circle_data[] (pic_render.c)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
193 L00b0 fdb $8000
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
194 fdb $e000
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
195 fdb $e000
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
196 fdb $e000
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
197 fdb $7000
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
198 fdb $f800
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
199 fdb $f800
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
200 fdb $f800
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
201 fdb $7000
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
202 fdb $3800
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
203 fdb $7c00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
204 fdb $fe00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
205 fdb $fe00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
206 fdb $fe00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
207 fdb $7c00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
208 fdb $3800
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
209 fdb $1c00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
210 fdb $7f00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
211 fdb $ff80
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
212 fdb $ff80
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
213 fdb $ff80
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
214 fdb $ff80
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
215 fdb $ff80
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
216 fdb $7f00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
217 fdb $1c00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
218 fdb $0e00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
219 fdb $3f80
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
220 fdb $7fc0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
221 fdb $7fc0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
222 fdb $ffe0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
223 fdb $ffe0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
224 fdb $ffe0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
225 fdb $7fc0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
226 fdb $7fc0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
227 fdb $3f80
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
228 fdb $1f00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
229 fdb $0e00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
230 fdb $0f80
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
231 fdb $3fe0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
232 fdb $7ff0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
233 fdb $7ff0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
234 fdb $fff8
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
235 fdb $fff8
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
236 fdb $fff8
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
237 fdb $fff8
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
238 fdb $fff8
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
239 fdb $7ff0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
240 fdb $7ff0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
241 fdb $3fe0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
242 fdb $0f80
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
243 fdb $07c0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
244 fdb $1ff0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
245 fdb $3ff8
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
246 fdb $7ffc
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
247 fdb $7ffc
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
248 fdb $fffe
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
249 fdb $fffe
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
250 fdb $fffe
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
251 fdb $fffe
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
252 fdb $fffe
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
253 fdb $7ffc
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
254 fdb $7ffc
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
255 fdb $3ff8
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
256 fdb $1ff0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
257 fdb $07c0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
258
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
259 * circle_list[] (pic_render.c)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
260 * this data is different in the file
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
261 * { 0, 1, 4, 9, 16, 25, 37, 50 }
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
262 * These run like a set of numbers**2 {0,1,2,3,4,5,~6,~7}
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
263 * ah ha these are multiples 2*(0,1,2,3,4,5,~6,~7)**2)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
264
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
265 L0132 fcb $00,$00 0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
266 fcb $00,$02 2
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
267 fcb $00,$08 8
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
268 fcb $00,$12 18
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
269 fcb $00,$20 32
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
270 fcb $00,$32 50
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
271 fcb $00,$4a 74
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
272 fcb $00,$64 100
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
273
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
274
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
275 * select case dispatch table for pic_cmd_loop()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
276
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
277 L0142 fdb $01bc enable_pic_draw()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
278 fdb $01c9 disable_pic_draw()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
279 fdb $01d4 enable_pri_draw()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
280 fdb $01e9 disable_pri_draw()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
281 fdb $02de draw_y_corner()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
282 fdb $02d1 draw_x_corner()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
283 fdb $0309 absolute_line()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
284 fdb $031d relative_line()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
285 fdb $0359 pic_fill()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
286 fdb $0211 read_pen_status()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
287 fdb $01f4 plot_with_pen()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
288
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
289
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
290 * This code adds the load offsets to the program offsets above
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
291 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
292 * u00ab = loop counter
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
293 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
294 L0158 tst L008f,pcr test if we've loaded the offsets already
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
295 bne L0174 done once leave
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
296 inc L008f,pcr not done set the flag
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
297 lda #$0b set our index to 11
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
298 sta u00ab stow it in mem since we are going to clobber b
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
299 leau >L0142,pcr load table head address
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
300 L016a ldd u002e get load offset set in sierra
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
301 addd ,u add the load offset
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
302 std ,u++ and stow it back, bump pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
303 dec u00ab decrement the index
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
304 bne L016a ain't done go again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
305 L0174 rts we're out of here
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
306
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
307
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
308 * The interaction between render_pic and pic_cmd_loop is divided
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
309 * differently in the NAGI source pic_render.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
310
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
311 * render_pic()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
312 * 4 = proirity and color = F, so the note says
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
313 * so the priority is MSnibble and the color is LSnibble
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
314
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
315 L0175 ldd #$4f4f load the color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
316 pshs d push it on the stack for the pass
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
317 lbsr L040e call sbuff_fill routine
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
318 leas $02,s reset stack to value at entry
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
319 ldd $02,s pull the next word
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
320 pshs d push it on top of the stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
321 lbsr L0189 call pic_cmd_loop()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
322 leas $02,s once we return clean up stack again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
323 rts return
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
324
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
325 * pic_cmd_loop() (pic_render.c)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
326 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
327 * u005a = color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
328 * u005b = sbuff_drawmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
329 * u006b = pen_status
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
330
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
331 L0189 pshs y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
332 bsr L0158 ensure load offset has been added to table address
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
333 lbsr L06fc sbuff_fill()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
334 clra make a zero
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
335 sta u005b sbuff_drawmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
336 sta u006b pen_status
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
337 coma make the complement FF
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
338 sta u005a store color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
339
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
340 ldu 4,s get the word passed in to us on the stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
341 ldd 5,u pull out the required info for the mmu twiddle
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
342 lbsr L0074 twiddle mmu
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
343
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
344 * pic_cmd_loop() (pic_render.c) starts here
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
345 ldx X0551 given_pic_data set in pic_res.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
346 L01a2 lda ,x+ pic_byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
347
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
348 L01a4 cmpa #$ff if it's FF were done
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
349 beq L01b9 so head out
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
350 suba #cmd_start first valid cmd = F0 so subtract to get index
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
351 blo L01a2 less than F0 ignore it get next byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
352 cmpa #$0a check for top end
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
353 bhi L01a2 greater than FA ignore it get next byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
354 leau >L0142,pcr load the addr of the dispatch table
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
355 asla sign extend multiply by two for double byte offset
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
356 jsr [a,u] make the call
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
357 bra L01a4 loop again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
358
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
359 L01b9 puls y done then fetch the y back
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
360 rts and return
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
361
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
362 * Command $F0 change picture color and enable picture draw
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
363 * enable_pic_draw() pic_render.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
364 * differs slightly with pic_render.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
365 * does't have colour_render()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
366 * and setting of colour_picpart
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
367 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
368 * u005a = color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
369 * u005b = sbuff_drawmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
370 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
371 * x contains pointer to given_pic_data known as the pic_byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
372 * after ldd
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
373 * a contains color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
374 * b contains draw mask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
375 * returns the next pic_byte in a
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
376
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
377 L01bc ldd u005a pulls in color and sbuff_drawmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
378 anda #$f0 and color with $F0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
379 ora ,x+ or that result with the pic_byte and bump to next
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
380 orb #$0f or the sbuff_drawmask with $0F
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
381 std u005a store the updated values
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
382 lda ,x+ return value ignored so this just bumps to next pic_byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
383 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
384
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
385
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
386 * Command $F1 Disable picture draw
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
387 * disable_pic_draw()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
388 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
389 * u005a = color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
390 * u005b = sbuff_drawmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
391 * x contains pointer to given_pic_data known as the pic_byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
392 * after ldd
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
393 * a contains color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
394 * b contains draw mask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
395 * returns the next pic_byte in a
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
396
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
397 L01c9 ldd u005a pulls in color and sbuff_drawmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
398 ora #$0f ors color with $0F (white ??)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
399 andb #$f0 ands draw mask with $F0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
400 std u005a store the updated values
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
401 lda ,x+ return value ignored so this just bumps to next pic_byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
402 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
403
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
404 * Command $F2 Changes priority color and enables priority draw
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
405 * enable_pri_draw() pic_render.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
406 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
407 * u005a = color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
408 * u005b = sbuff_drawmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
409 * x contains pointer to given_pic_data known as the pic_byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
410 * after ldd
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
411 * a contains color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
412 * b contains draw mask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
413 * returns the next pic_byte in a
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
414
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
415 L01d4 ldd u005a pulls in color and sbuff_drawmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
416 anda #$0f ands color with $0F
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
417 sta u005a save color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
418 lda ,x+ loads pic_byte and bumps to next
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
419 asla times 2 with sign extend
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
420 asla again times 2
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
421 asla and again times 2
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
422 asla end result is multiply pic_byte by 16 ($10)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
423 ora u005a or that value with the modified color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
424 orb #$f0 or the sbuff_drawmask with $F0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
425 std u005a store the updated values
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
426 lda ,x+ return value ignored so this just bumps to next pic_byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
427 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
428
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
429 * Command $F3 Disable priority draw
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
430 * diasable_pri_draw() pic_render.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
431 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
432 * u005a = color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
433 * u005b = sbuff_drawmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
434 * x contains pointer to given_pic_data known as the pic_byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
435 * after ldd
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
436 * a contains color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
437 * b contains draw mask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
438 * returns the next pic_byte in a
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
439
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
440
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
441 L1e9 ldd u005a pulls in color and sbuff_drawmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
442 ora #$f0 or the color with $F0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
443 andb #$0f and the sbuff_drawmask with $0F
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
444 std u005a store the updated values
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
445 lda ,x+ return value ignored so this just bumps to next pic_byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
446 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
447
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
448 * Command $FA plot with pen
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
449 * Logic is pic_byte >= 0xF0 in c source.
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
450 * Emailed Nick Sonneveld 3/14/ 03
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
451 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
452 * u006b = pen_status
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
453 * u00a2 = pen_x position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
454 * u00a3 = pen_y position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
455 * u00a6 = texture_num
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
456 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
457 * x contains pointer to given_pic_data known as the pic_byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
458 * returns the next pic_byte in a
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
459
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
460 * plot_with_pen() (pic_render.c)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
461 L01f4 lda u006b pen_status
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
462 bita #$20 and but don't change check for pen type solid or splater ($20)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
463 beq L0204 is splater
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
464 lda ,x+ load pic_byte (acca) from pic_code and bump pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
465 cmpa #cmd_start test against $F0 if a is less than
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
466 * based on discussions with Nick this must have been a bug
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
467 * in the earlier versions of software...
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
468 * if it is less than $F0 it's just a picture byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
469 * fix next rev.
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
470 lblo L02ea branch to a return statement miles away (could be fixed)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
471 sta u00a6 save our pic_byte in texture_num
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
472 L0204 lbsr L0364 call read_xy_postion
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
473 lblo L02ea far off rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
474 std u00a2 pen x/y position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
475 bsr L0218 call plot_with_pen2()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
476 bra L01f4 go again ...
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
477 * yes there is no rts here in the c source either
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
478
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
479
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
480 * Command $F9 Change pen size and style
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
481 * read_pen_status() pic_render.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
482 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
483 * u006b = pen_status
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
484 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
485 * x contains pointer to given_pic_data known as the pic_byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
486 * returns the next pic_byte in a
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
487
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
488 L0211 lda ,x+ get pic_byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
489 sta u006b save as pen_status
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
490 lda ,x+ return value ignored so this just bumps to next pic_byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
491 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
492
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
493
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
494 * plot_with_pen2()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
495 * called from plot with pen
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
496 * Sets up circle_ptr
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
497 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
498 * u006b = pen_status
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
499 * u009e = pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
500 * u009f = pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
501 * u00a2 = pen_x position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
502 * u00a3 = pen_y position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
503 * u00a4 = pen_final_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
504 * u00a5 = pen_final_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
505 * u00a7 = pen.size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
506 * u00a8 = t
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
507 * u00a9 = pensize x 2
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
508 * u00aa = "
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
509 * u00ab = scratch var
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
510 * u00ac = scratch var
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
511 * u00ad = penwidth
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
512 * u00ae = "
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
513
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
514 L0218 ldb u006b pen_status
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
515 andb #$07
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
516 stb u00a7 pen.size ?? save for pen_status & $07
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
517
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
518 clra clear a and condition codes
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
519 lslb multiply by 2
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
520 std u00a9 pen size x 2
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
521 leau L0132,pcr circle_list[]
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
522 ldd b,u d now holds one of the circle_list values
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
523 leau L00b0,pcr circle_data[]
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
524 leau d,u use that to index to a circle_data item
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
525 * u now is circle_ptr
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
526
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
527 * Set up x position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
528 clra
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
529 ldb u00a2 load pen_x position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
530 lslb multiply by two
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
531 rola
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
532 subb u00a7 subtract the pen.size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
533 bcc L023f outcome not less than zero move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
534 deca
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
535 bpl L023f if we still have pos must be 0 or >
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
536 ldd #0000
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
537 bra L024d
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
538 L023f std u00ab store pen_x at scratch
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
539
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
540 ldd #$0140 start with 320
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
541 subd u00a9 subtract 2 x pen.size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
542 cmpd u00ab pen_x to calc
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
543 bls L024d if pen_x is greater keep temp calc
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
544 ldd u00ab otherwise use pen_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
545
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
546 L024d lsra divide by 2
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
547 rorb
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
548 stb u00a2 stow at pen_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
549 stb u00a4 stow at pen_final_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
550
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
551 * Set up y position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
552 lda u00a3 pen_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
553 suba u00a7 pen.size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
554 bcc L025c >= 0 Ok go stow it
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
555 clra otherwise less than zero so set it to 0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
556 bra L0268 go stow it
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
557 L025c sta u00ab store pen_y at scratch
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
558
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
559 lda #y_max start with 167
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
560 suba u00aa subtract 2 x pen.size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
561 cmpa u00ab compare to pen_y calced so far
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
562 bls L0268 if pen_y > calc use calc and save it
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
563 lda u00ab otherwise use pen_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
564 L0268 sta u00a3 pen_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
565 sta u00a5 pen_final_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
566
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
567 lda u00a6 texture_num
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
568 ora #$01
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
569 sta u00a8 t ??
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
570
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
571 ldb u00aa 2 x pen.size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
572 incb bump it by one
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
573 tfr b,a copy b into a
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
574 adda u00a5 add value to pen_final_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
575 sta u00a5 save new pen_final_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
576 lslb shift b left (multiply by 2)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
577
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
578 leax L0090,pcr binary list[]
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
579 ldd b,x use 2x pensize + 1 to index into list
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
580 std u00ad pen width ???
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
581
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
582 * this looks like it should have been nested for loops
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
583 * but not coded that way in pic_render.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
584
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
585 * new y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
586 L0284 leax L0090,pcr binary_list[]
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
587
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
588 * new x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
589 L0288 lda u006b pen_status
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
590 bita #O_UPDATE and it with $10 but don't change
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
591 bne L0298 not equal zero go on to next pen status test
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
592 ldd ,u otherwise load data at circle_ptr
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
593 anda ,x and that with first element in binary_list
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
594 bne L0298 if thats not zero go on to next pen status check
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
595
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
596 andb $01,x and the second bytes of data at circle_ptr
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
597 * and binary_list
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
598 beq L02ba that outcome is equ zero head for next calcs
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
599
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
600 L0298 lda u006b pen_status
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
601 bita #$20 anded with $20 but don't change
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
602 beq L02af equals zero set up and plot buffer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
603 lda u00a8 otherwise load t (texture_num | $01)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
604 lsra divide by 2
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
605 bcc L02a5 no remainder save that number as t
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
606 eora #$b8 exclusive or t with $B8
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
607 L02a5 sta u00a8 save new t
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
608 bita #O_DRAWN anded with 1 but don't change
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
609 bne L02ba not equal zero don't plot
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
610 bita #O_BLKIGNORE anded with 2 but don't change
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
611 beq L02ba does equal zero don't plot
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
612
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
613 L02af pshs u save current u sbuff_plot uses it
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
614 ldd u00a2 load pen_x/pen_y values
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
615 std u009e save at pos_init_x/y positions
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
616 lbsr L046f head for sbuff_plot()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
617 puls u retrieve u from before call
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
618
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
619 L02ba inc u00a2 increment pen_x value
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
620
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
621 leax $04,x move four bytes in the binary_list
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
622 cmpx u00ad comapre that value to pen_width
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
623 bls L0288 less or same go again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
624
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
625 leau $02,u bump circle_ptr to next location in circle_data[]
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
626
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
627 lda u00a4 load pen_final_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
628 sta u00a2 store at pen_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
629 inc u00a3 bump pen_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
630 lda u00a3 pen_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
631 cmpa u00a5 compare to pen_final_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
632 bne L0284 not equal go do the next row
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
633 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
634
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
635
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
636 * Command $F5 Draw an X corner
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
637 * draw_x_corner() pic_render.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
638 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
639 * u009e = pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
640 * u009f = pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
641
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
642 L02d1 lbsr L0364 call read_xy_pos
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
643 bcs L02ea next subs rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
644 std u009e save pos_init_x/y positions
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
645 lbsr L046f head for sbuff_plot()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
646 bsr L02eb draw_corner(0)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
647 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
648
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
649
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
650 * Command $F4 Draw a Y corner
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
651 * draw_y_corner() pic_render.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
652 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
653 * u009e = pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
654 * u009f = pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
655
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
656 L02de lbsr L0364 call read_xy_pos
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
657 bcs L02ea return
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
658 std u009e save at pos_init_x/y positions
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
659 lbsr L046f head for sbuff_plot()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
660 bsr L02f9 draw_corner(1)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
661 L02ea rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
662
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
663
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
664
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
665 * draw_corner(u8 type) pic_render.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
666 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
667 * u009e = pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
668 * u009f = pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
669 * u00a0 = pos_final_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
670 * u00a1 = pos_final_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
671
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
672 draw_x:
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
673 L02eb lbsr L036f get_x_pos()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
674 bcs L02ea prior subs return
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
675 sta u00a0 store as pos_final_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
676 ldb u009f load pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
677 stb u00a1 store as pos_final_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
678 lbsr L0421 call sbuff_xline()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
679
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
680 draw_y:
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
681 L02f9 lbsr L0381 get_y_pos
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
682 bcs L02ea prior subs return
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
683 stb u00a1 save pos_final_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
684 lda u009e load pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
685 sta u00a0 save pos_final_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
686 lbsr L0447 sbuff_yline()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
687 bra L02eb head for draw_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
688
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
689
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
690
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
691 * Command $F6 Absolute line
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
692 * absolute_line()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
693 * This command is before Draw X corner in nagi source
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
694 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
695 * u009e = pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
696 * u009f = pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
697 * u00a0 = pos_final_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
698 * u00a1 = pos_final_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
699
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
700 L0309 bsr L0364 call read_xy_pos
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
701 bcs L02ea prior subs return
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
702 std u009e save at pos_init_x/y positions
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
703 lbsr L046f head for sbuff_plot()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
704 L0312 bsr L0364 call read_xy_pos
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
705 bcs L02ea prior subs return
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
706 std u00a0 save at pos_final_x/y and passed draw_line in d
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
707 lbsr L0394 call draw_line()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
708 bra L0312 go again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
709
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
710
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
711
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
712 * relative_line()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
713 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
714 * u009e = pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
715 * u009f = pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
716 * u00a0 = pos_final_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
717 * u00a1 = pos_final_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
718
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
719 L031D bsr L0364 call read_xy_pos
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
720 bcs L02ea prior subs return
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
721 std u009e save at pos_init_x/y positions
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
722 lbsr L046f head for sbuff_plot()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
723
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
724 * calc x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
725 L0326 lda ,x+ get next pic_byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
726 * and load it in pos_data in c source
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
727 cmpa #cmd_start is that equal $F0 or greater
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
728 bcc L02ea yep were done so return (we use prior subs return ??)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
729 * that rascal in acca changes names again to x_step
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
730 * but it's still the same old data
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
731 anda #$70 and that with $70
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
732 * (where these values are derived from I haven't a clue, as of yet :-))
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
733 lsra divide by 2
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
734 lsra and again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
735 lsra once more
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
736 lsra and finally another for a /16
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
737 ldb -$01,x get the original value
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
738 bpl L0337 if original value not negative move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
739 nega else it was so flip the sign of the computed value
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
740 L0337 adda u009e add pos_init_x position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
741 cmpa #x_max compare to 159
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
742 bls L033f if it's less or same move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
743 lda #x_max else cap it at 159
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
744 L033f sta u00a0 store as pos_final_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
745
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
746 * calc y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
747 * not quite the same as pic_render.c almost
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
748 * we've go the pic_byte ... er pos_data ... now called y_step
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
749 * in b so lets calc the y_step
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
750 andb #$0f and with $0F (not in pic_render.c)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
751 bitb #$08 and that with $08 but don't change
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
752 beq L034a if result = 0 move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
753 andb #$07 else and it with $07
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
754 negb and negate it
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
755 L034a addb u009f add calced value to pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
756 cmpb #y_max compare to 167
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
757 bls L0352 less or same move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
758 ldb #y_max greater ? cap it
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
759 L0352 stb u00a1 pos_final_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
760
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
761 * passes pos_final_x/y in d
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
762 lbsr L0394 call draw_line()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
763
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
764 bra L0326 go again exit is conditinals inside loop
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
765
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
766 * Command $F8 Fill
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
767 * pic_fill()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
768 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
769 * u009e = pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
770 * u009f = pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
771
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
772 L0359 bsr L0364 call read_xy_pos
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
773 bcs L02ea returned a 1 head for prior subs return
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
774 std u009e save at pos_init_x/y position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
775 lbsr L0486 call sbuff_picfill()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
776 bra L0359 loop till we get a 1 back from read_xy_pos
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
777
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
778 * read_xy_pos()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
779 L0364 lbsr L036f go get x position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
780 lblo L02ea prior subs return
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
781 lbsr L0381 go get the y position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
782 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
783
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
784
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
785 * get_x_pos()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
786 L036f lda ,x+ load pic_byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
787 cmpa #cmd_start is it a command?
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
788 bhs L037e if so set CC
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
789 cmpa #x_max compare to 159
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
790 bls L037b is it less or same clear CC and return
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
791 lda #x_max greater than load acca with 159
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
792 L037b andcc #$fe clear CC ad return
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
793 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
794
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
795
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
796 L037e orcc #1 returns a "1"
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
797 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
798
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
799 * get_y_pos()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
800 L0381 ldb ,x+ load pic_byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
801 cmpb #cmd_start is it a command
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
802 blo L038b nope less than command
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
803 lda -$01,x was a command load x back in acca
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
804 bra L037e go set CC
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
805 L038b cmpb #y_max compare to 167
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
806 bls L0391 is it less or same clear CC and return
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
807 ldb #y_max greater than load accb with 167
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
808 L0391 andcc #$fe clear CC and return
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
809 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
810
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
811
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
812 * draw_line() pic_render.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
813 * while this is a void function() seems pos_final_x/y are passed in d
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
814 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
815 * u009e = pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
816 * u009f = pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
817 * u00a0 = pos_final_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
818 * u00a1 = pos_final_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
819 * u00a2 = x_count
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
820 * u00a3 = y_count
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
821 * u00a4 = pos_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
822 * u00a5 = pos_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
823 * u00a6 = line_x_inc
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
824 * u00a7 = line_y_inc
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
825 * u00a8 = x_component
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
826 * u00a9 = y_component
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
827 * u00aa = largest_line
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
828 * u00ab = counter
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
829
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
830 * process straight lines
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
831 L0394 cmpb u009f compare pos_final_y with pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
832 lbeq L0421 if equal call sbuff_xline() and don't return here
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
833 cmpa u009e else compare with pos_init_x position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
834 lbeq L0447 if equal call sbuff_yline() and don't return here
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
835
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
836 ldd u009e load pos_init_x/y positions
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
837 std u00a4 store at pen_final ??? not in pic_render.c version
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
838
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
839 * process y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
840 lda #$01 line_y_inc
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
841
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
842 ldb u00a1 load pos_final_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
843 subb u009f subtract pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
844 bcc L03ae greater or equal zero don't negate
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
845 * less than zero
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
846 nega flip the sign of line_y_inc
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
847 negb flip the sign of y_component
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
848
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
849 L03ae sta u00a7 store line_y_inc
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
850 stb u00a9 store y_component
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
851
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
852 * process x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
853 lda #$01 line_x_inc
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
854
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
855 ldb u00a0 load pos_final_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
856 subb u009e subtract pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
857 bcc L03bc greater or equal zero don't negate
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
858 * less than zero
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
859 nega flip the sign of line_x_inc
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
860 negb flip the sign of x_component
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
861 L03bc sta u00a6 store line_x_inc
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
862 stb u00a8 store x_component
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
863
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
864 * compare x/y components
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
865 cmpb u00a9 compare y_component to x_component
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
866 blo L03d0 if x_component is smaller move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
867
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
868
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
869 * x >= y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
870 * x_component is in b
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
871 stb u00ab counter
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
872 stb u00aa largest_line
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
873 lsrb divide by 2
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
874 stb u00a3 store y_count
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
875 clra make a zero
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
876 sta u00a2 store x_count
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
877 bra L03dc move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
878
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
879 * x < y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
880 L03d0 lda u00a9 load y_component
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
881 sta u00ab stow as counter
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
882 sta u00aa stow as largest line
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
883 lsra divide by 2
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
884 sta u00a2 store x_count
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
885 clrb make a zero
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
886 stb u00a3 store as y_count
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
887
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
888
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
889 * loops through the line and uses sbuff_plot to do the screen write
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
890 * y_count is in b
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
891 L03dc addb u00a9 add in the y_component
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
892 stb u00a3 and stow back as y_count
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
893 cmpb u00aa compare that with line_largest
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
894 blo L03ee if y_count >= line_largest is not the case branch
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
895 subb u00aa subtract line_largest
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
896 stb u00a3 store as y_count
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
897 ldb u00a5 load pos_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
898 addb u00a7 add line_y_inc
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
899 stb u00a5 stow as pos_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
900
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
901 * x_count is in a
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
902 L03ee adda u00a8 add in x_component
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
903 sta u00a2 store as x_count
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
904 cmpa u00aa compare that with line_largest
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
905 blo L0400 if x_count >= line_largest is not the case branch
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
906 suba u00aa subtract line_longest
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
907 sta u00a2 store at x_count
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
908 lda u00a4 load pos_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
909 adda u00a6 add line_x_inc
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
910 sta u00a4 stow as pos_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
911
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
912 L0400 ldd u00a4 load computed pos_x/y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
913 std u009e store at pos_init_x/y positions
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
914 lbsr L046f head for sbuff_plot()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
915 ldd u00a2 reload x/y_count
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
916 dec u00ab decrement counter
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
917 bne L03dc if counter not zero go again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
918 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
919
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
920 ***********************************************************************
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
921
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
922
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
923 * sbuff_fill() sbuf_util.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
924 * fill color is passed in s register
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
925
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
926 L040e pshs x save x as we use it for an index
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
927 ldu #gbuffend address to write to
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
928 ldx #picb_size $6900 bytes to write (26.25K)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
929 * this would be picture buffer width x height
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
930 ldd $04,s since we pushed x pull our color input out of the stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
931 L0418 std ,--u store them and dec dest address
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
932 leax -$02,x dec counter
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
933 bne L0418 loop till done
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
934 puls x fetch the x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
935 rts return
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
936
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
937
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
938 * sbuff_xline() sbuff_util.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
939 * gets called here with pos_final_x/y in accd
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
940 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
941 * u005a = color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
942 * u005b = sbuff_drawmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
943 * u009e = pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
944 * u009f = pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
945 * u00a0 = pos_final_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
946 * u00a1 = pos_final_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
947 * u00ac = x_orig
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
948
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
949 L0421 sta u00ac stow as x_orig
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
950 cmpa u009e compare with pos_init_x position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
951 bhs L042d if pos_final_x same or greater branch
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
952
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
953 * otherwise init > final so swap init and final
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
954 ldb u009e load pos_init_x position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
955 stb u00a0 save pos_final_x position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
956 sta u009e save pos_init_x position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
957
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
958 L042d bsr L046f head for sbuff_plot() returns pointer in u
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
959
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
960 ldb u00a0 load pos_final_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
961 subb u009e subtract pos_init_x position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
962 beq L0442 if they are the same move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
963 * b now holds the loop counter len
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
964 * u is the pointer returned from sbuff_plot
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
965 leau $01,u bump the pointer one byte right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
966 L0437 lda ,u get the the byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
967 ora u005b or it with sbuff_drawmmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
968 anda u005a and it with the color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
969 sta ,u+ save it back and bump u to next byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
970 decb decrememnt the loop counter
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
971 bne L0437 done them all? Nope loop
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
972
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
973 L0442 lda u00ac x_orig (pos_final_x)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
974 sta u009e save at pos_init_x position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
975 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
976
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
977
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
978 * sbuff_yline() sbuf_util.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
979 * gets called here with pos_final_x/y in accd
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
980 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
981 * u005a = color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
982 * u005b = sbuff_drawmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
983 * u009e = pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
984 * u009f = pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
985 * u00a0 = pos_final_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
986 * u00a1 = pos_final_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
987 * u00ac = y_orig
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
988
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
989 L0447 stb u00ac stow as y_orig
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
990 cmpb u009f compare with pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
991 bhs L0453 if pos_final same or greater branch
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
992
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
993 * otherwise init > final so swap 'em
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
994 lda u009f load pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
995 sta u00a1 stow as pos_final_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
996 stb u009f stow as pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
997
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
998 L0453 bsr L046f head for sbuff_plot() returns pointer in u
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
999 ldb u00a1 load pos_final_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1000 subb u009f subtract pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1001 beq L046a if they are the same move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1002 * b now holds the loop counter len
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1003 * u is the pointer returned from sbuff_plot
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1004 L045b leau PICBUFF_WIDTH,u bump ptr one line up
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1005 lda ,u get the byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1006 ora u005b or it with sbuff_drawmmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1007 anda u005a and it with the color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1008 sta ,u save it back out
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1009 decb decrement the loop counter
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1010 bne L045b done them all ? Nope loop
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1011
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1012 L046a ldb u00ac load y_orig
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1013 stb u009f save it as pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1014 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1015
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1016
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1017 * sbuff_plot() from sbuf_util.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1018 * according to agi.h PBUF_MULT(width) ((( (width)<<2) + (width))<<5)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1019 * which next 3 lines equate to so the $A0 is from 2 x 5
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1020 * pointer is returned in index reg u
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1021 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1022 * u005a = color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1023 * u005b = sbuff_drawmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1024 * u009e = pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1025 * u009f = pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1026
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1027 L046f ldb u009f load pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1028 lda #$A0 according to PBUF_MULT()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1029 mul do the math
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1030 addb u009e add pos_init_x position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1031 adca #0000 this adds the carry bit in to a
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1032 addd #gfx_picbuff add that to the start of the screen buf $6040
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1033 tfr d,u move this into u
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1034 lda ,u get the byte u points to
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1035 ora u005b or it with sbuff_drawmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1036 anda u005a and it with the color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1037 sta ,u and stow it back at the same place
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1038 rts return
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1039
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1040
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1041
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1042
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1043 * sbuff_picfill(u8 ypos, u8 xpos) sbuf_util.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1044 * u005a = color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1045 * u005b = sbuff_drawmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1046 * u009e = pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1047 * u009f = pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1048 * u00a0 = left
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1049 * u00a1 = right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1050 * u00a2 = old_direction
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1051 * u00a3 = direction
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1052 * u00a4 = old_initx
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1053 * u00a5 = old_inity
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1054 * u00a6 = old_left
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1055 * u00a7 = old_right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1056 * u00a8 = stack_left
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1057 * u00a9 = stack_right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1058 * u00aa = toggle
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1059 * u00ab = old_toggle
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1060 * u00ae = color_bl
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1061 * u00af = mask_dl
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1062 * u00b0 = old_buff (word)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1063 * u00b2 = temp (buff)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1064
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1065
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1066 colorbl set $4F
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1067 temp_stk set $E000
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1068
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1069 L0486 pshs x save x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1070 ldx #temp_stk load addr to create a new stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1071 sts ,--x store current stack pointer there and decrement x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1072 tfr x,s make that the stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1073 * s is now stack_ptr pointing to fill_stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1074
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1075 ldb u009f pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1076 lda #$a0 set up PBUF_MULT
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1077 mul do the math
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1078 addb u009e add pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1079 adca #0000 add in that carry bit
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1080 addd #gfx_picbuff add the start of screen buffer $6040
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1081 tfr d,u move this to u
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1082 * u now is pointer to screen buffer b
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1083
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1084
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1085 ldb u005a load color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1086 lda u005b load sbuff_drawmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1087
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1088 * next 2 lines must have been a if (sbuff_drawmask > 0)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1089 * not in the nagi source
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1090
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1091 lbeq L05f5 if sbuff_drawmask = 0 we're done
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1092 bpl L04b8 if not negative branch to test color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1093
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1094 cmpa #cmd_start comp $F0 with sbuff_drawmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1095 bne L04b8 not = go test color for $0F
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1096 andb #$f0 and color with $F0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1097 cmpb #$40 compare that to $40 (input was $4x)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1098 lbeq L05f5 if so were done
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1099 lda #$f0 set up value for mask_dl
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1100 bra L04c2 go save it
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1101
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1102 L04b8 andb #$0f and color with $0F
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1103 cmpb #$0f was it already $0F
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1104 lbeq L05f5 if so we're done
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1105 lda #$0f set up value for mask_dl
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1106
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1107 L04c2 sta u00af stow as mask_dl
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1108 anda #colorbl and that with $4F
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1109 sta u00ae stow that as color_bl
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1110 lda ,u get byte at screen buffer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1111 anda u00af and with mask_dl
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1112 cmpa u00ae compare to color_bl
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1113 lbne L05f5 not equal were done
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1114
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1115 ldd #$FFFF push 7 $FF bytes on temp stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1116 pshs a,b and set stack_ptr accordingly
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1117 pshs a,b
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1118 pshs a,b
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1119 pshs a
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1120
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1121 lda #$a1 load a with 161
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1122 sta u00a0 stow it at left
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1123 clra make a zero
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1124 sta u00a1 stow it at right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1125 sta u00aa stow it at toggle
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1126 inca now we want a 1
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1127 sta u00a3 stow it at direction
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1128
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1129 * fill a new line
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1130 L04e9 ldd u00a0 load left/right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1131 std u00a6 stow at old_left/right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1132 lda u00aa load toggle
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1133 sta u00ab stow at old_toggle
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1134 ldb u009e load pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1135 stb u00a4 store as old_initx
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1136 incb accb now becomes counter
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1137 stu u00b0 stow current screen byte as old_buff
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1138
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1139 L04f8 lda ,u get the screen byte pointed to by u
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1140 ora u005b or it with sbuff_drawmmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1141 anda u005a and that with the color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1142 sta ,u stow that back
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1143 lda ,-u get the screen byte befor that one
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1144 anda u00af and that with mask_dl
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1145 cmpa u00ae compare result with color_bl
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1146 bne L050b not equal move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1147 decb otherwise decrement the counter
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1148 bne L04f8 if were not at zero go again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1149
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1150 L050b leau 1,u since cranked to zero bump the screen pointer by one
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1151 tfr u,d move that into d
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1152 subd u00b0 subtract old_buff
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1153 addb u009e add pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1154 stb u00a0 stow at left
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1155 lda u009e load pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1156 stb u009e store left at pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1157 stu u00b2 temp buff
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1158 ldu u00b0 load old_buff
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1159 leau 1,u bump to the next byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1160 nega negate pos_init_x value
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1161 adda #x_max add that to 159 (subtract pos_init_x)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1162 beq L0537 that's the new counter and if zero move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1163
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1164 L0524 ldb ,u get that screen byte (color_old)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1165 andb u00af and it with mask_dl
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1166 cmpb u00ae check against color_bl
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1167 bne L0537 not equal move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1168 ldb ,u load that byte again to do something with
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1169 orb u005b or it with sbuff_drawmmask
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1170 andb u005a and it with color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1171 stb ,u+ stow it back and bump the pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1172 deca decrement the counter
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1173 bne L0524 if we haven't hit zero go again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1174
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1175 L0537 tfr u,d move the screen buff ptr to d
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1176 subd u00b2 subtract that saved old pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1177 decb sunbtract a 1
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1178 addb u00a0 add in the left
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1179 stb u00a1 store as the right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1180 lda u00a6 load old_left
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1181 cmpa #$a1 compare to 161
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1182 beq L0577 if it is move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1183
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1184 cmpb u00a7 if the new right == old right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1185 beq L0552 then move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1186 bhi L0566 not equal and right > old_right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1187 * otherwise
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1188 stb u00a4 stow right as old_initx
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1189 clr u00aa clear toggle
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1190 bra L056c head for next calc
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1191 * they were equal
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1192 L0552 lda u00a0 load a with left
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1193 cmpa u00a6 compare that to old_left
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1194 bne L0566 move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1195 lda #$01 set up a one
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1196 cmpa u00aa compare toggle
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1197 beq L0577 is a one ? go to locnext
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1198 sta u00aa not one ? set it to 1
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1199 lda u00a1 load right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1200 sta u00a4 stow it as old_initx
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1201 bra L056c head for the next calc
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1202 * right > old_right or left > old left
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1203 L0566 clr u00aa clear toggle
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1204 lda u00a7 load old right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1205 sta u00a4 save as old_initx
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1206
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1207 * push a bunch on our temp stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1208 L056c ldy u00a2 old_direction/direction
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1209 ldx u00a4 old_initx/y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1210 ldu u00a6 old_left/right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1211 lda u00ab old_toggle
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1212 pshs a,x,y,u push them on the stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1213
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1214 locnext:
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1215 L0577 lda u00a3 load direction
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1216 sta u00a2 stow as old_direction
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1217 ldb u009f load pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1218 stb u00a5 stow as old_inity
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1219
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1220 L057f addb u00a3 add direction to pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1221 stb u009f stow the updated pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1222 cmpb #y_max compare that to 167
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1223 bhi L05c5 greater than 167 go test direction
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1224
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1225 L0587 ldb u009f load pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1226 lda #$A0 according to PBUF_MULT
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1227 mul do the math
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1228 addb u009e add pos_init_x position
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1229 adca #0000 this adds the carry bit into the answer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1230 addd #gfx_picbuff add that to the screen buff start addr $6040
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1231 tfr d,u move it into u
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1232 lda ,u get the byte pointed to
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1233 anda u00af and with mask_dl
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1234 cmpa u00ae compare with color_bl
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1235 lbeq L04e9 if equal go fill a new line
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1236
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1237 lda u009e load pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1238 ldb u00a3 load direction
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1239 cmpb u00a2 compare to old_direction
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1240 beq L05bc go comapre pos_init_x and right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1241 tst u00aa test toggle
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1242 bne L05bc not zero go comapre pos_init_x and right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1243 cmpa u00a8 compare pos_init_x and stack_left
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1244 blo L05bc less than stack_left go comapre pos_init_x and right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1245 cmpa u00a9 compare it to stack_right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1246 bhi L05bc greater than go comapre pos_init_x and right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1247 lda u00a9 load stack_right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1248 cmpa u00a1 compare to right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1249 bhs L05c5 greater or equal go check direction
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1250 inca add one to stack_right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1251 sta u009e stow as pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1252
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1253 L05bc cmpa u00a1 compare updated value to right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1254 bhs L05c5 go check directions
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1255 inca less than then increment by 1
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1256 sta u009e stow updated value pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1257 bra L0587 loop for next byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1258
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1259 * test direction and toggle
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1260 L05c5 lda u00a3 load direction
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1261 cmpa u00a2 compare old_direction
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1262 bne L05dc not equal go pull stacked values
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1263 tst u00aa test toggle
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1264 bne L05dc not zero go pull stack values
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1265 nega negate direction
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1266 sta u00a3 store back at direction
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1267 lda u00a0 load left
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1268 sta u009e stow as pos_init_x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1269 ldb u00a5 load old_inity
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1270 stb u009f stow at pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1271 bra L05ef go grab off stack and move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1272
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1273 * directions not equal
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1274 L05dc puls a,x,y,u grab the stuff off the stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1275 cmpa #$FF test toggle for $FF source has test of pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1276 beq L05f5 equal ? clean up stack and return
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1277 sty u00a2 stow old_direction/direction
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1278 stx u009e stow pos_init_x/y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1279 stu u00a0 stow left/right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1280 sta u00aa stow toggle
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1281
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1282 ldb u009f load pos_init_y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1283 stb u00a5 stow old_inity
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1284 L05ef ldx $05,s gets left right off stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1285 stx u00a8 stow stack_left/right
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1286 bra L057f always loop
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1287
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1288 L05f5 lds ,s reset stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1289 puls x retrieve our x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1290 rts return
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1291
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1292
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1293 * this routine effective swaps postion of
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1294 * the two nibbles of the byte loaded
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1295 * and returns it to the screen
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1296 * it is the workhorse loop in gfx_picbuff_update gfx.c ???
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1297 * called via remap call in mnln
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1298
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1299 gfx_picbuff_update_remap
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1300 L05fb ldx #gfx_picbuff starting low address of srceen mem
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1301 L05fe lda ,x get the first byte bit order 0,1,2,3,4,5,6,7
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1302 clrb empty b
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1303 lsra shift one bit from a
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1304 rorb into b
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1305 lsra again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1306 rorb
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1307 lsra and again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1308 rorb
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1309 lsra and finally once more
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1310 rorb
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1311 stb ,x were changing x anyway so use it for temp storage
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1312 ora ,x or that with acca so now bit order from orig
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1313 * is 4,5,6,7,0,1,2,3
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1314 sta ,x+ put it back at x and go for the next one
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1315 cmpx #gbuffend ending high address of screen mem
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1316 bcs L05fe
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1317 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1318
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1319 * our blit_struct is a bit different from the one in nagi
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1320 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1321 * struct blit_struct
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1322 * {
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1323 * struct blit_struct *prev; // 0-1
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1324 * struct blit_struct *next; // 2-3
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1325 * struct view_struct *v; // 4-5
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1326 * s8 x; // 6
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1327 * s8 y; // 7
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1328 * s8 x_size; // 8
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1329 * s8 y_size; // 9
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1330 * u16 *buffer; // A-B
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1331 * u16 *view_data // C-D info for mmu twiddler
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1332 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1333 * };
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1334
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1335
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1336 * blitlist_draw(BLIT *b) obj_base.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1337 L0615 leas -$02,s make room on the stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1338 ldx $04,s get the blit_struct pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1339 ldu $02,x load u with pointer to next blit
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1340
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1341 L061b stu ,s stow it on the stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1342 beq L0637 if it's zero we're done
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1343 pshs u push the pointer on the stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1344 lbsr L09d8 call blit_save()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1345 leas $02,s get the pointer back in s
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1346 ldu ,s put it in u
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1347 ldu $04,u get the pointer to view_struct
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1348 pshs u push that on the stack and
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1349 lbsr L07be call obj_blit()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1350 leas $02,s get the pointer back in s
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1351 ldu ,s put it in u
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1352 ldu $02,u get the pointer to the next one
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1353 bra L061b and go again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1354
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1355 L0637 leas $02,s clean up stack and leave
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1356 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1357
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1358 * blitlist_erase(BLIT *b) obj_base.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1359 * nagi has a return blitlist_free at the end
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1360
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1361 L063a leas -$02,s make room on the stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1362 ldx $04,s get the blit_struct pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1363 ldu ,x load u with the prev pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1364 beq L0651 if it's zero we're done
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1365 L0642 stu ,s stow it on the stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1366 pshs u push the pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1367 lbsr L0a0f call blit_restore()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1368 leas $02,s get the pointer back in s
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1369 ldx ,s load x with the pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1370 ldu ,x get the prev from that struct
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1371 bne L0642 loop again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1372
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1373 L0651 leas $02,s clean up stack and leave
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1374 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1375
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1376 * From obj_picbuff.c the pri_table[172]
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1377 * ours is only 168
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1378 pri_table
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1379 L0654 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1380 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1381 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1382 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1383 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1384 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1385 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1386 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1387
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1388 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1389 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1390
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1391 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1392 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1393
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1394 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1395 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1396
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1397 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1398 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1399
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1400 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1401 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1402
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1403 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1404 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1405
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1406 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1407 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1408
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1409 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1410 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1411
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1412 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1413 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1414
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1415 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1416 fcb $00,$00,$00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1417
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1418 * loops thru 48 bytes with a = 4
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1419 * bumps a by one load b with 12 this
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1420 * iterates thru ten sets of twelve bytes
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1421 * bumping acca by one as it goes.
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1422
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1423 * table_init() obj_pic_buff.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1424 L06fc leax L0654,pcr point to data block
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1425 ldb #$30 load index 48
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1426 lda #4 load acca = 4
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1427 L0704 sta ,x+ save a in buffer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1428 decb dec the inner loop counter
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1429 bne L0704 go again if loop not finished
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1430 cmpa #$0e get here when inner loop is done
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1431 bcc L0712 did we do 10 loops (e-4)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1432 inca nope bump data byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1433 ldb #$0c set new counter on loops 2-10
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1434 * to do 12 bytes and
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1435 bra L0704 have at it again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1436 L0712 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1437
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1438
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1439 * obj_chk_control(VIEW *x) obj_picbuff.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1440 * our index reg x points to the view structure
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1441 * are 3 = x, 4 = y instead of 3-4 = x & 5-6 = y ???
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1442
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1443 * This routine is passed a pointer to a view_structure
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1444 * from agi.h in the nagi source
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1445 * struct view_struct
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1446 *{
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1447 * u8 step_time; // 0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1448 * u8 step_count; // 1 // counts down until the next step
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1449 * u8 num; // 2
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1450
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1451 * s16 x; // 3-4 in nagi
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1452 * s16 y; // 5-6 in nagi
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1453
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1454
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1455 * u8 x; // 3 in ours
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1456 * u8 y: // 4 the rest of the offsets hold true
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1457 * u8 dummy1 // 5 who knows what these are
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1458 * u8 dummy2 // 6 maybe just fillers
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1459
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1460
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1461 * u8 view_cur; // 7
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1462 * u8 *view_data; // 8-9
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1463 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1464 * u8 loop_cur; // A
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1465 * u8 loop_total; // B
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1466 * u8 *loop_data; // C-D
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1467 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1468 * u8 cel_cur; // E
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1469 * u8 cel_total; // F
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1470 * u8 *cel_data; // 10-11
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1471 * u8 cel_prev_width; // new ones added to prevent kq4 crashing
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1472 * u8 cel_prev_height;
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1473 * //u8 *cel_data_prev;// 12-13
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1474 * BLIT *blit; // 14-15
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1475 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1476 * s16 x_prev; // 16-17
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1477 * s16 y_prev; // 18-19
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1478 * s16 x_size; // 1A-1B
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1479 * s16 y_size; // 1C-1D
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1480 * u8 step_size; // 1E
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1481 * u8 cycle_time; // 1F
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1482 * u8 cycle_count; // 20 // counts down till next cycle
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1483 * u8 direction; // 21
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1484 * u8 motion; // 22
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1485 * u8 cycle; // 23
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1486 * u8 priority; // 24
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1487 * u16 flags; // 25-26
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1488 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1489 * //u8 unknown27; // 27 // these variables depend on the motion
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1490 * //u8 unknown28; // 28 // type set by follow ego, move, obj.. stuff
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1491 * //u8 unknown29; // 29 // like that
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1492 * //u8 unknown2A; // 2A
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1493 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1494 * union
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1495 * {
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1496 * struct // move_ego move_obj
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1497 * {
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1498 * s16 x; // 27
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1499 * s16 y; // 28
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1500 * u8 step_size; // 29 // original stepsize
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1501 * u8 flag; // 2A
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1502 * } move;
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1503 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1504 * struct // follow_ego
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1505 * {
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1506 * u8 step_size; // 27
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1507 * u8 flag; // 28
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1508 * u8 count; // 29
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1509 * } follow;
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1510 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1511 * // wander
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1512 * u8 wander_count; // 27
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1513 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1514 * // reverse or end of loop
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1515 * u8 loop_flag; // 27
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1516 * };
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1517 *};
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1518 *typedef struct view_struct VIEW;
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1519
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1520
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1521 * u00a5 = flag_signal
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1522 * u00a6 = flag_water
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1523 * u005c = flag_control
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1524 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1525 * X01af is loaction of state.flag
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1526 * see agi.h for definition of state structure
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1527 L0713 pshs y save y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1528
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1529 ldx $04,s sets up mmu info
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1530 ldd $08,x load view_data passed to mmu twiddler
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1531 lbsr L0074 twiddle mmu
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1532
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1533 ldb $04,x load y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1534 lda $26,x load flags
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1535 bita #O_PRIFIXED and with $04 but don't change
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1536 bne L072f not zero move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1537 * it is zero then
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1538 leau L0654,pcr load buffer address
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1539 clra clear a since we will use d as an index
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1540 lda d,u fetch the data from pri_table
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1541 sta $24,x save as priority
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1542
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1543 L072f lda #$A0 set up PBUF_MULT()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1544 mul do the math
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1545 addb $03,x add in x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1546 adca #0000 add in the carry bit
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1547 addd #gfx_picbuff add it to the start of the screen buff addr 6040
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1548 tfr d,u move the pointer pb to u
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1549
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1550 ldy $10,x load y with cel_data ptr
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1551 clra make a zero
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1552 sta u00a6 stow it at flag_water
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1553 sta u00a5 stow it at flag_signal
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1554 inca make a 1
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1555 sta u005c stow it at flag_contro1
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1556 ldb $24,x load priority
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1557 cmpb #$0F compare it with 15
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1558 beq L078b If it equals 15 move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1559 * otherwise if not equal 15
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1560 sta u00a6 stow that 1 at flag_water
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1561 ldb ,y cx first byte of cel_data (cel_width)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1562
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1563 * do while cx != 0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1564
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1565 L0752 lda ,u+ (pri) put byte at pb in acca and bump pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1566 anda #$F0 and that with $F0 (obstacle ??)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1567 beq L077a if it equals 0 set flag_control =0 and check_finish
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1568
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1569 cmpa #$30 compare pri to 48 (water ??)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1570 beq L0766 not equal move to end of loop
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1571 clr u00a6 clear the water flag
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1572 cmpa #$10 compare it with 16 (conditional ??)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1573 beq L077e if equal go test for observe blocks
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1574 cmpa #$20 compare with 32
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1575 beq L0787
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1576
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1577 L0766 decb decrement cx
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1578 bne L0752 not zero yet loop again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1579
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1580 lda $25,x load flags in acca
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1581 tst u00a6 test flag_water
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1582 bne L0776 not zero next test
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1583 bita #O_DRAWN should be O_WATER Looks like a BUG in ours
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1584 beq L078b if it equals one head for check_finish
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1585 bra L077a clear that flag control first and leave
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1586 L0776 bita #O_HRZNIGNORE should be O_LAND Looks like a BUG in ours
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1587 beq L078b
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1588
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1589 L077a clr u005c clear flag_control
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1590 bra L078b head for check_finish
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1591
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1592 L077e lda $26,x load flags in acca
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1593 bita #O_BLKIGNORE and with $02 but don't change
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1594 beq L077a equals zero clear flag_control and go check_finish
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1595 bra L0766 then head back in the loop
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1596
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1597 L0787 sta u00a5 store acca at flag signal (obj_picbuff.c has =1)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1598 bra L0766 continue with loop
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1599
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1600
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1601
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1602 L078b lda $02,x load num
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1603 bne L07bb if not zero were done head out
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1604
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1605 * flag signal test
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1606 lda u00a5 load flag_signal
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1607 * operates on F03_EGOSIGNAL
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1608 beq L079d if its zero go reset the signal
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1609 * otherwise set the flag
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1610 lda X01af load the state.flag element
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1611 ora #$10 set the bits
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1612 sta X01af save it back
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1613 bra L07a5 go test the water flag
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1614 L079d lda X01af load the state.flag element
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1615 anda #$ef reset the bits
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1616 sta X01af save it back
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1617
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1618 * flag_water test
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1619 L07a5 lda u00a6 load flag_water
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1620 beq L07b3 if zero go reset the flag
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1621 * otherwise set it
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1622 lda X01af load the state.flag element
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1623 ora #$80 set the bits
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1624 sta X01af save it back
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1625 bra L07bb baby we're out of here
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1626 L07b3 lda X01af load the state.flag element
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1627 anda #$7f reset the bits
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1628 sta X01af save it back
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1629
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1630 L07bb puls y retrieve our y and leave
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1631 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1632
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1633
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1634 * obj_blit(VIEW *v) obj_blit.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1635 * our index reg x points to the view structure
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1636 * are 3 = x, 4 = y instead of 3-4 = x & 5-6 = y ???
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1637 * u00a2 = cel_height
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1638 * u00a7 = cel_trans
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1639 * u00a8 = init (pb)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1640 * u00ac = cel_invis
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1641 * u00ad = pb_pri
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1642 * u009e = view_pri
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1643 * u009f = col
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1644
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1645 L07be ldx $02,s pull our x pointer off the stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1646 ldd $08,x load d with view_data
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1647 lbsr L0074 twiddle mmu
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1648
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1649 ldu $10,x u now is a pointer to cel_data
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1650 lda $02,u cel_data[$02] loaded
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1651 bita #O_Block are we testing against a block or does $80 mean something else here?
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1652 beq L07d1 if zero skip next instruction
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1653
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1654 lbsr L087f otherwise call obj_cell_mirror
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1655
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1656 L07d1 ldd ,u++ load the first 2 bytes of cel_data and bump to next word
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1657 * cel_width is in acca we ignore
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1658 stb u00a2 save as cel_height
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1659 * obj_blit.c has and $0F which is a divide by 16
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1660 * we do a multiply x 16 ???
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1661 lda ,u+ cel_trans
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1662 asla
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1663 asla
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1664 asla
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1665 asla
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1666 sta u00a7 save as cel_tran
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1667
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1668 lda $24,x priority
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1669 asla shift left 4
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1670 asla
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1671 asla
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1672 asla
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1673 sta u009e view_pri
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1674
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1675 ldb $04,x load the y value
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1676 subb u00a2 subtract the cel_height
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1677 incb add 1
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1678 lda #$a0 set up PBUF_MULT()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1679 mul do the math
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1680 addb $03,x add in the x value
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1681 adca #0000 add in the carry from multiply
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1682 addd #gfx_picbuff add this to the start of the screen buff addr $6040
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1683 std u00a8 pb pointer to the pic buffer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1684 ldx u00a8 load it in an index reg
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1685
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1686 lda #$01
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1687 sta u00ac set cel_invis to 1 and save
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1688
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1689 bra L0800
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1690 L07ff abx bump the pb pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1691
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1692 L0800 lda ,u+ get the next "chunk"
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1693 beq L082d if zero
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1694 ldb -$01,u not zero load the same byte in accb
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1695 anda #$f0 and chunk with $F0 (col)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1696 andb #$0f and chunk with $0F (chunk_len)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1697 cmpa u00a7 compare with cel_trans
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1698 beq L07ff set up and go again color is trasnparent
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1699 lsra shift right 4
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1700 lsra
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1701 lsra
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1702 lsra
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1703 sta u009f save the color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1704
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1705 L0814 lda ,x get the byte pointed to by pb
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1706 anda #$f0 get the priority portion
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1707 cmpa #$20 compare to $20
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1708 bls L083b less or equal
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1709 cmpa u009e compare to view_pri
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1710 bhi L085b pb_pri > view_pri
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1711 * otherwise
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1712 lda u009e load view_pri
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1713 L0822 ora u009f or it with col
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1714 sta ,x+ store that at pb and bump the pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1715 clr u00ac zero cel_invis
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1716 decb decrement chunk_len
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1717 bne L0814 not equal zero go again inner loop
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1718 bra L0800 go again outer loop
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1719
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1720 L082d dec u00a2 decrement cel_height
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1721 beq L0862 equal zero move on out of cel_height loop
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1722 ldx u00a8 load init
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1723 leax >PICBUFF_WIDTH,x move 160 into screen
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1724 stx u00a8 stow that back as init/pb
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1725 bra L0800 go again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1726
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1727 L083b stx u00ad save the pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1728 clra set up ch
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1729
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1730 L083e cmpx #blit_end compare to gfx_picbuff+$6860
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1731 bhs L084f not less than then branch out
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1732 * less than the end
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1733 leax >PICBUFF_WIDTH,x bump the pointer by 160
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1734 lda ,x get that byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1735 anda #$f0 and it with $F0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1736 cmpa #$20 test against $20
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1737 bls L083e less or equal go again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1738
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1739 L084f ldx u00ad load pb_pri
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1740 cmpa u009e compare with view_pri
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1741 bhi L085b pb_pri > view_pri
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1742 lda ,x make the next
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1743 anda #$f0 pb_pri
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1744 bra L0822 go or it with the color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1745
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1746 L085b leax $01,x bump the pb pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1747 decb decrement chunk_len
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1748 bne L0814 not equal do middle loop again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1749 bra L0800 go again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1750
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1751 L0862 ldx $02,s pull our view pointer back off the stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1752 lda $02,x get the num
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1753 bne L087e if not zero exit routine
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1754 lda u00ac get the cel_invis value
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1755 beq L0876 reset the flag
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1756
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1757 * set the flag
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1758 lda X01af load the state.flag
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1759 ora #$40 set it
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1760 sta X01af stow it back
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1761 bra L087e exit routine
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1762
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1763 * reset the flag
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1764 L0876 lda X01af load state.flag
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1765 anda #$bf clear it
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1766 sta X01af stow it
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1767 L087e rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1768
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1769
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1770 * obj_cel_mirror(View *v) in obj_picbuff.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1771 * we use different values from those shown nagi files
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1772 * on entry
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1773 * a contains cell_data[$02] in call from obj_blit()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1774 * x contains pointer to view data
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1775 * u contains pointer to cel_data
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1776 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1777 * saves and restores x,y,u regs on exit
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1778 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1779 * u00a1 = width
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1780 * u00a2 = height_count
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1781 * u00a7 = trans transparent color left shifted 4
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1782 * u00aa = tran_size ??
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1783 * u00ab = meat_size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1784 * u00af = loop_cur << 4
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1785 * u00b0 = al
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1786
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1787
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1788 L087f anda #$30 and that with $30 (nagi has $70)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1789 lsra shift right 4
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1790 lsra
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1791 lsra
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1792 lsra
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1793 cmpa $0A,x compare that with loop_cur
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1794 lbeq L0926 if equal we're done
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1795
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1796 pshs x,y,u save our view (x) what ever (y) and cel_data (u) pointers
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1797
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1798 lda $0A,x load loop_cur
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1799 asla and shift it 4 left
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1800 asla
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1801 asla
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1802 asla
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1803 sta u00af stow it as ??
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1804 lda #$cf load a with with $CF (nagi has $8F)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1805 anda $02,u and that with cel[2]
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1806 ora u00af or with loop_cur<<4
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1807 sta $02,u stow it back at cel[2]
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1808
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1809 ldy #gbuffend
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1810
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1811 ldd ,u++ load d with width and hieght
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1812 std u00a1 stow that
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1813 lda ,u+ load a with trans color
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1814 asla and shift left 4
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1815 asla
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1816 asla
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1817 asla
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1818 sta u00a7 stow as trans
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1819 stu u00b0 stow u as al
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1820 L08af clrb make a zero
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1821 stb u00ab stow it as meat_size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1822
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1823 * nagi code has tran_size set to width and
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1824 * al&$0F subtracted from it.
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1825 * in this loop
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1826
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1827 L08b2 stb u00aa and tran_size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1828
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1829 lda ,u+ load in the next cel_data byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1830 beq L08fc if its a zero leave loop
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1831 ldb -$01,u otherwise fetch the same data into b
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1832 * at this point a & b both have the same data byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1833 anda #$f0 and the a copy with $F0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1834 andb #$0f and the b copy with $0F
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1835 cmpa u00a7 compare byte&$F0 with trans
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1836 bne L08cc not equal branch out of loop
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1837 addb u00aa otherwise add in tran_size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1838 bra L08b2 and loop
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1839
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1840 L08c6 ldb ,u+ load the nbext byte and bump the pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1841 beq L08d4 if it was zero move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1842 andb #$0f otherwise and it with $0F
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1843 L08cc addb u00aa add in tran_size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1844 stb u00aa save it as tran_size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1845 inc u00ab bump meat_size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1846 bra L08c6 loop to the next byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1847
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1848 L08d4 lda u00aa load tran_size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1849 nega negate it
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1850 adda u00a1 add in the width
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1851 beq L08f1 if that is zero move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1852
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1853 L08db suba #$0f subtract 15 from it
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1854 bls L08eb less or same move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1855 sta u00aa otherwise stow that back as tran_size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1856 lda u00a7 fetch trans
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1857 ora #$0f or it with 15
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1858 sta ,y+ store it at buff (gbuffend) and bump pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1859 lda u00aa fetch tra_size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1860 bra L08db loop again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1861
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1862 L08eb adda #$0f add 15 back into a (tran_size)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1863 ora u00a7 or that with trans
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1864 sta ,y+ stow that at buff and bump the pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1865
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1866 L08f1 leax -$01,u set x to the last cel_data byte processed
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1867 ldb u00ab load b with the meat_size (the loop counter)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1868 L08f5 lda ,-x copy from the cel_data end
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1869 sta ,y+ to the buff front
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1870 decb dec the counter
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1871 bne L08f5 not done loop again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1872
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1873 L08fc stb ,y+ on entry b should always = 0 stow that at the next buff location
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1874 dec u00a2 decrement the height_count
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1875 bne L08af not zero go again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1876
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1877 * now we are going to copy the backward temp buffer back to the cel
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1878 tfr y,d get the buff pointer in d
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1879 subd #gbuffend subtract the starting value of the buffer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1880 stb u00b2 save that as the buffer size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1881 andb #$fe make it an even number
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1882 tfr d,x transfer that to x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1883 ldu u00b0 al cel_data pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1884 ldy #gbuffend load y start of our temp buffer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1885
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1886 L0913 ldd ,y++ get a word
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1887 std ,u++ stow a word
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1888 leax -$02,x dec the counter by a word
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1889 bne L0913 not zero go again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1890 * so we've moved an even number of bytes
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1891 lda u00b2 load the actual byte count
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1892 lsra divide by 2
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1893 bcc L0924 no remainder (not odd) we're done
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1894 lda ,y otherwise move the last
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1895 sta ,u byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1896 L0924 puls x,y,u retrieve our x,y,u values
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1897
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1898 L0926 rts and return to caller
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1899
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1900
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1901
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1902 * obj_add_pic_pri(VIEW *v) obj_picbuff.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1903 * our index reg x points to the view structure
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1904 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1905 * u009e = priority&$F0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1906 * u00a3 = pri_table[y]
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1907 * u00a4 = pri_table[y]
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1908 * u00a8 = pb (word)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1909 * u00a9 = "
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1910 * u00b3 = pri_height/height
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1911
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1912 L0927 pshs y save the y
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1913 ldx $04,s get the the pointer to our view
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1914 ldd $08,x load d with view_data ?
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1915 lbsr L0074 twiddle mmu
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1916
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1917 * set up d as pointer to pri_table value
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1918 clra zero a
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1919 ldb $04,x load view y value
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1920 leau L0654,pcr load pri_table address
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1921 lda d,u fetch the pri_table y data
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1922 std u00a3 stow it in a temp
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1923 ldb $24,x load priority
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1924 andb #$0f and that with $0F
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1925 bne L0948 if that equals zero move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1926 ora $24,x otherwise or the pri_table[y] with priority
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1927 sta $24,x stow that back as priority
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1928
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1929 L0948 pshs x push the pointer to the view on the stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1930 lbsr L07be call obj_blit()
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1931 leas $02,s reset the stack
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1932 ldx $04,s get the pointer to our view
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1933 lda $24,x load priority
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1934 cmpa #$3F compare to $3F
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1935 lbhi L09d5 if greater then nothing to do head out
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1936
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1937 leau L0654,pcr load pri_table address
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1938 ldb u00a4 fetch pri_table[y] (cx)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1939 clr u00b3 clear pri_height
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1940 L0962 clra zero acca
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1941 inc u00b3 bump pri_hieght
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1942 tstb is pri_table[y]
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1943 beq L096f equal zero if so move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1944 decb dec our counter cx
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1945 lda d,u load pri_table[cx]
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1946 cmpa u00a3 compare to pri_table[y]
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1947 beq L0962 if they are equal loop again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1948
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1949 * set up and execute PBUF_MULT call
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1950 L096f ldb $04,x load the view->y in
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1951 lda #$a0 from pbuf mult
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1952 mul do the math
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1953 addb $03,x add in the x value
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1954 adca #0000 add in the carry
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1955 addd #gfx_picbuff add in the base address $6040
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1956 tfr d,u move that to an index reg (pb)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1957 stu u00a8 stow it as pb
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1958
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1959 ldy $10,x load y with cel_data pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1960 ldb $01,y get the second byte (height)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1961 cmpb u00b3 compare to pri_height
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1962 bhi L098b greater move on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1963 stb u00b3 otherwise save the largest as pri_height
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1964 L098b lda $24,x load the priority again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1965 anda #$f0 and it with $F0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1966 sta u009e stow that for later use
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1967
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1968 * bottom line
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1969 ldb ,y load b with the first byte in cel_data (cx)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1970 L0994 lda ,u get the byte at our pic buff pb
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1971 anda #$0f and it with $0F
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1972 ora u009e or it with priority&F0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1973 sta ,u+ stow it back and bump the pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1974 decb dec the loop counter cx
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1975 bne L0994 not zero go again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1976
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1977 * it has a height
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1978 dec u00b3 test "height" for > 1
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1979 beq L09d5 wasn't head no more to do so head out
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1980 ldu u00a8 reset u to our pb pic buff pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1981
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1982 * the sides
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1983 ldb ,y get the first byte of cel_data
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1984 decb subtract 1 (sideoff)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1985 L09a8 leau -$A0,u decrement pb by 160
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1986 tfr u,x move that value into x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1987 lda ,u get the data
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1988 anda #$0f and it with $0F
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1989 ora u009e or it priority&$F0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1990 sta ,u stow it back
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1991 clra zero a so we can use d as a pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1992 lda d,u use "sideoff" as an index into pb
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1993 anda #$0f and that with $0F
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1994 ora u009e or that rascal with priority&$F0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1995 abx add that value to our x pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1996 sta ,x and store it there
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1997 dec u00b3 dec the height
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1998 bne L09a8 greater than zero go again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
1999
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2000 * the top of the box
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2001
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2002 ldb ,y get the cel_data first byte in b
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2003 subb #$02 subtract 2
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2004 leau $01,u bump the pb pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2005 L09ca lda ,u grab the byte
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2006 anda #$0f and that with $0F
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2007 ora u009e or it with priority &$F0
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2008 sta ,u+ stow it back and bump the pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2009 decb dec our counter
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2010 bne L09ca loop if not finished
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2011
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2012 L09d5 puls y return the y value
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2013 rts return
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2014
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2015
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2016
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2017 * blit_save(BLIT *b) obj_blit.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2018 * our blit_struct is a bit different from the one in nagi
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2019 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2020 * u00a0 = zeroed and never changed cause we use the next byte :-)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2021 * u00a1 = x_count (x_size) when cmpx ha ha
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2022 * u00a2 = y_count (y_size)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2023 * u00a8 = pic buffer start pic_cur
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2024 * u00ad = pic_cur + offset
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2025
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2026 L09d8 ldu $02,s get the pointer to the blit_struct
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2027 ldd $0C,u get the pointer to the view_data for mmu twiddler
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2028 lbsr L0074 twiddle mmu
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2029
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2030 ldu $02,s get the pointer to the blit_struct data back in u
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2031 ldd $08,u load the x/y_size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2032 std u00a1 stow that at x/y_count
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2033 clr u00a0 zero some adder
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2034 ldb $07,u get the y value
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2035 lda #$a0 set up PBUF_MULT
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2036 mul do the math
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2037 addb $06,u add in x
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2038 adca #0 add in the carry bit
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2039 addd #gfx_picbuff add in pic buff base $6040
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2040
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2041 ldu $0A,u load u with with the buffer pointer blit_cur
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2042 L09f5 std u00a8 save the buffer start pointer pic_cur
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2043 addd u00a0 add in the offset x_size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2044 std u00ad stow that at pic_cur + offset
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2045 ldx u00a8 load x with pic_cur
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2046 L09fd ldd ,x++ copy 2 bytes at a time
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2047 std ,u++ to the buffer at blit_cur
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2048 cmpx u00ad have we copied it all ??
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2049 blo L09fd nope loop again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2050
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2051 ldd u00a8 load with pic buffer start
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2052 addd #PICBUFF_WIDTH add 160
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2053 dec u00a2 dec y_count
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2054 bne L09f5 not zero loop again
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2055 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2056
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2057
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2058 * blit_restore(BLIT *b) obj_blit.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2059 * blit_save(BLIT *b) obj_blit.c
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2060 * our blit_struct is a bit different from the one in nagi
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2061 *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2062 * u00a0 = zeroed and never changed cause we use the next byte :-)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2063 * u00a1 = x_count (x_size) when cmpx ha ha
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2064 * u00a2 = y_count (y_size)
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2065 * u00a8 = pic buffer start pic_cur
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2066 * u00ad = pic_cur + offset
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2067
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2068 L0a0f ldu $02,s get the pointer to the blit structure
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2069 ldd $0C,u
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2070 lbsr L0074 twiddle mmu
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2071
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2072 ldu $02,s get the blit_structure back in u
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2073 ldd $08,u load x/y_size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2074 std u00a1 stow them at x/y_count
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2075 clr u00a0 clear the byte prior to x_size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2076 ldb $07,u get the y value
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2077 lda #$a0 set up PBUF_MULT
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2078 mul do the math
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2079 addb $06,u add in the x value
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2080 adca #0 add in the carry bit
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2081 addd #gfx_picbuff add in the base address $6040
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2082
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2083 ldu $0A,u load u with buffer pointer blit_cur
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2084 L0a2c std u00a8 save the screen start buffer pic_cur
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2085 addd u00a0 add in the x_size
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2086 std u00ad stow at pic_cur + offset
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2087 ldx u00a8 load x pic_cur pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2088 L0a34 ldd ,u++ grab em from the buffer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2089 std ,x++ and send them to the screen
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2090 cmpx u00ad moved them all ??
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2091 blo L0a34 nope then keep on keeping on
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2092
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2093 ldd u00a8 load the pic_cur pointer
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2094 addd #PICBUFF_WIDTH add 160
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2095 dec u00a2 dec the y count
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2096 bne L0a2c not zero move some more
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2097 rts
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2098
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2099 fcb $00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2100 fcb $00,$00,$00,$00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2101 fcc "shdw"
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2102 fcb $00
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2103
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2104 emod
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2105 eom equ *
4c5e21e215f6 Changed line endings
boisy
parents: 1057
diff changeset
2106 end
1356
2d67237cca33 Added new style comments
boisy
parents: 1059
diff changeset
2107