annotate 3rdparty/packages/sierra/objs/shdw.asm @ 1059:4c5e21e215f6

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