1706
|
1 *
|
|
2 * Setup for GIF
|
|
3 *
|
|
4 * Globals
|
|
5 * SetGIF -- Initialization. Reserves tables, sets format
|
|
6 *
|
|
7 ifp1
|
1912
|
8 use os9defs.d
|
1706
|
9 endc
|
|
10
|
|
11 psect view_gifset_a,0,0,0,0,0
|
|
12
|
|
13 *
|
|
14 * GIF initialization
|
|
15 * Since GIF requires such large tables, we don't allocate them
|
|
16 * statically, but instead request them from the operating system at
|
|
17 * run time.
|
|
18 *
|
|
19 giftablesize equ 4096*3 3 bytes, 2^12 entries for 12-bit code size
|
|
20 gifstacksize equ 4096 Stack for reversing the pixel strings from table
|
|
21
|
|
22 SetGIF:
|
|
23 pshs a,b,x
|
|
24 tst <format If format already set, just ignore this.
|
|
25 bne SetGIF1
|
|
26 sta <format Set format code.
|
|
27
|
|
28 ldd #giftablesize+gifstacksize Allocate the memory
|
|
29 lbsr malloc
|
|
30 stx <giftable
|
|
31
|
|
32 leax giftablesize+gifstacksize,x
|
|
33 stx <gifstack
|
|
34 SetGIF1
|
|
35 puls a,b,x,pc
|
|
36
|
|
37 *
|
|
38 * Return memory reserved by SetGIF.
|
|
39 *
|
|
40 EndGIF:
|
|
41 lbsr unmalloc
|
|
42 rts
|
|
43
|
|
44 endsect
|
|
45
|