wmdots: Add version 0.2beta to repository.

From
http://gentoo.osuosl.org/distfiles/wmdots-0.2beta.tar.gz
This commit is contained in:
Doug Torrance 2016-12-27 11:09:30 -05:00 committed by Carlos R. Mafra
parent 787c7e6848
commit a33dd8bb92
19 changed files with 3210 additions and 0 deletions

23
wmdots/wmdots/Makefile Executable file
View file

@ -0,0 +1,23 @@
LIBDIR = -L/usr/X11R6/lib
LIBS = -lXpm -lXext -lX11
OBJS = wmdots.o ../wmgeneral/wmgeneral.o
.c.o:
cc -c -g -O2 -Wall $< -o $*.o
wmifs: $(OBJS)
cc -o wmdots $^ -lXext $(LIBDIR) $(LIBS)
all:: wmdots
clean::
for i in $(OBJS) ; do \
rm $$i ; \
done
rm wmdots
install::
cp -f wmdots /usr/local/bin/
chmod 755 /usr/local/bin/wmdots
chown root:root /usr/local/bin/wmdots

87
wmdots/wmdots/master.xpm Normal file
View file

@ -0,0 +1,87 @@
/* XPM */
static char * master_xpm[] = {
"64 66 18 1",
" c None",
". c #000000",
"+ c #C300FF",
"@ c #B500F2",
"# c #A800E5",
"$ c #9E00D8",
"% c #9200CC",
"& c #8500BF",
"* c #7900B2",
"= c #6E00A5",
"- c #660099",
"; c #5D008C",
"> c #52007F",
", c #480072",
"' c #3E0066",
") c #37005B",
"! c #2D004C",
"~ c #25003F",
" ",
" ",
" ",
" ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ...................................................... ",
" ",
" ",
" ",
" ",
" ",
"++@@##$$%%&&**==--;;>>,,''))!!~~ ",
"++@@##$$%%&&**==--;;>>,,''))!!~~ "};

View file

@ -0,0 +1,860 @@
;Dogs of war demo by OnlyMe (now called I440r :)
;-------------------------------------------------------------------------
;Assembles with A386.COM (Registered A86).
;-------------------------------------------------------------------------
;Equates
MaxPoints equ 125 ;Maximum number of points in an object
BumpMap equ Bumps+320 ;Pointer to second scan line of bump map
SpotX equ 160 ;Position of static bump map spotlight
SpotY equ 80
;-------------------------------------------------------------------------
;A based structure (See A86 documentation for explanation)
struc [bx] ;Structure does NOT need a name
Counter dw ? ;Countdown to change
Reset dw ? ;Counter reset value
Position dw ? ;Points to item being modified
Delta dw ? ;Speed of change (also direction)
Upper dw ? ;Upper limit for position
Lower dw ? ;Lower limit for position
ends
;-------------------------------------------------------------------------
;Un-Initialised data
data segment
XAngle dw ? ;Angles of rotation for each axis
YAngle dw ? ; higher numbers rotate faster
ZAngle dw ?
X dw ? ;Coordinates of point being calculated
Y dw ?
Z dw ?
XSin dw ? ;Sin and Cos for each axis angle of rotation
YSin dw ?
ZSin dw ?
XCos dw ?
YCos dw ?
ZCos dw ?
NumPoints dw ? ;Number of points in current object
; V---MaxPoints
Trail1: dw 125 dup ? ;Display address of previous 8 positions for
Trail2: dw 125 dup ? ; each point being rotated. We only erase a
Trail3: dw 125 dup ? ; points 8'th previous position. This makes
Trail4: dw 125 dup ? ; the points leave a trail 7 pixles long
Trail5: dw 125 dup ?
Trail6: dw 125 dup ?
Trail7: dw 125 dup ?
Trail8: dw 125 dup ?
CharP dw ? ;Pointer to font def for scrollie char
BumpX dw ? ;Bump map coordinates being calculated
BumpY dw ?
;-------------------------------------------------------------------------
;A copy of the ROM font moved here so we can reference it using DS
Font: db 256*8 dup ?
;-------------------------------------------------------------------------
;Note:
;
; The following buffer is the whole of the bump map. There is 1 scan
;line of ZERO data above and below the area that will contain the bumps.
;
;Therefore the bumpmap is at Bumps+320 (See Equates Above)
Bumps: db 320*18 dup ?
;-------------------------------------------------------------------------
;Da Beeph (moo)
code segment
Start:
jmp Main ;Do it...
;-------------------------------------------------------------------------
;Pre initialised data...
Shape dw Cube ;Pointer to current object
HalfH dw 160 ;Screen coordinates for centre of object
HalfV dw 100
XOff dw 150 ;Position of object in world space
YOff dw 150
ZOff dw 800
DeltaX dw 5 ;Rotational speeds on each axis
DeltaY dw 4
DeltaZ dw 7
;-------------------------------------------------------------------------
;Modifiers: Tables follows this format: (as per above based structure)
;
; Counter Count down to next speed/position change
; Retet Value to reset counter to
; Position Pointer to data item to modify
; Delta Ammount to change item (also direction)
; Upper Upper limit fot item
; Lower Lower limit for item
W1: dw 30,30,offset DeltaX,2,15,2 ;Modifies X Rotational speed
W2: dw 20,20,offset DeltaY,-2,12,4 ;Modifies Y Rotational speed
W3: dw 40,40,offset DeltaZ,2,10,7 ;Modifies Z Rotational speed
W4: dw 02,02,offset ZOff,-3,800,180 ;Zooms object in and out of screen
;-------------------------------------------------------------------------
;Bump mapped scrollie banner text stuffz
Bannerp dw Banner ;Points to next character
CharColumn db 080 ;Mask for next colunn of font def
Banner:
db ' *** The Dogs Of WAR demo by OnlyMe! *** '
db 'Begin! '
Begin:
db 'Oh the dogs they had a meeting '
db 'They came from near and far '
db 'And some dogs came by motor bus '
db 'And some by motor car '
db 0
dw Flies,Hall
Hall:
db 'On entering the meeting hall '
db 'Each dog could take a look '
db 'Where he had to hang his asshole '
db 'Up high upon a hook '
db 0
dw Cross,Fire
Fire:
db 'And when they were assembled '
db 'Each canine son and sire '
db 'Some dirty bulldog son of a bitch '
db 'Jumped up and hollared FIRE '
db 0
dw Square,Panic
Panic:
db 'All was in a panic '
db 'Twas hell upon to look '
db 'Each doggie grabbed at random '
db 'An asshole from a hook '
db 0
dw Cube,Sore
Sore:
db 'Now the assholes were all mixed up '
db 'Which made each doggie sore '
db 'To have to wear another dogs ass '
db 'He''d never worn before '
db 0
dw Star,Bone
Bone:
db 'And that is why until this day '
db 'A dog will drop a bone '
db 'To go and smell another dogs ass '
db 'To see if it''s his OWN! '
db '*** THE END *** ??? '
db 'Now what have i forgotz ???? '
db 'ERM..... Oh Yea.... '
db 'Greetings *** ROTATE *** Out To ~~~~~~ '
db 0
dw Heart,Catgirl
Catgirl:
db 'Catgirl - Jeg Elsker DEG - Purrrrrrrrrrrrr :) '
db 'Myriaam - Cute Sexy BABE Princess DOLL :) - heheheheheh - '
db 'okokokokokokokokokokokokokokokokokokokokokokokokokok '
db 'LuvrsCrs - Manager''ess and savior''ess of UnderNUT #CODERS '
db '--> '
db 0
dw Square,Unf
Unf:
db 'Unf - Fatar - Debonaire - Isomer - Hexsane & MrsHex - '
db 'nop - mole - oreo - RatKing - \hatred\ - KBerg - '
db 'RyanT - Mafia - Yosha - Jungle - Fid - Binary - '
db 'PRIM8 - IiTM - Topanga - Tig2 - deRanged - RuneStar - '
db '_RyAn_ - DaParasit - Spansh - CodeX - Wicked - '
db 'Likwid - KingTroll - tpanther - ED_Lead - Reptile - '
db 0
dw Cross,NoIdea
NoIdea:
db 'Noidea - ^Para^ - Wh0is - Chiew - [QWORD] - LoneWolf - '
db 'DaveDavis - PsYkOtIk - ^Ion^ - Weathros - LittleLoc - '
db 'MissMilla - Centmo - Entlin - CreepGuy - eom - Xico - '
db '^Axe^ & Sturnella - Almighty - o - Zyklon - hammr - '
db '|Geo| - '
db 'MarkIII (Hi Dad) - Diamond1 & Mermaid1 (Hi Sis1 and Sis2 :) - '
db 0
dw Flies,Snoo
Snoo:
db 'Snoo - Queen1 & Truely - Shama - Pink^Rose - Divebum - '
db 'DEWDROP - KaDaM2 - Freakmama - mr007 - SIOK - Alih - '
db 'Asterix - MoKie - Rats - RoadRoach - masdale - mystie - '
db 'e|ectricTom - Techa^ - TX-Cowboy - buch - luth - '
db 0
dw Cross,Eche
Eche:
db 'BaBs - Ratty - Lexzy - PJ - Blondii - dew - Kittie - '
db '^Kristi - strawbery - grlafraid - Krystal1 - ortho - '
db 'Danni_ - Anne^ - brokngrl - keldog - AnGelDevo - '
db '^DE^ - Avantyful & Niece babe :) - mauddib - lil_miss - '
db 'Eche & Godis^ hehehehe - lowlife - X & W - '
db '******** And Everyone else OnlyMe! dun MISSED '
db '*** THE END IS NOT NEIGH *** '
db '---====*** Begin Again ---> ',0
dw Cube,Begin
;-------------------------------------------------------------------------
;Do IT!
Main:
mov ax,013 ;VGA GFX mode = 320 x 200 x 256
int 010
mov cx,(320*18)/2 ;Erase bump map buffer
mov di,Bumps
xor ax,ax
rep stosw
call GetPalette ;Create shaded palette
call GetFont ;Read font data out of ROM into current DS
call InitScroll ;Point to font data for first char of banner
mov ax,0a000 ;Point ES at video segment
mov es,ax
L0:
call ChangeAngles ;Get next angle of rotation for all axis
call GetSinCos ;Calculate Sin and Cos for all rotation angles
call DoFrame ;Rotate all points of shape and display
call DoScroll ;Scroll text through bump map buffer
call DoBump ;Bump map scrolly text and display it
call Retrace ;Wait for next raster frame
call ErasePoints ;Erase all pixles that are 8 frames old
call DoDeltas ;Modify rotational speeds etc
in al,060 ;Read keyboard port
cmp al,081 ;Escape key released?
jne L0
;-------------------------------------------------------------------------
;Exit nicely
mov ax,3 ;Back to textmode
int 010
mov ah,2 ;Place cursor at bottom left of display
mov dx,01700
xor bx,bx
int 010
mov dx,AuRevoir
mov ah,9
int 021
mov ah,04c ;Return control to dos
int 021
;-------------------------------------------------------------------------
;Do one frame of rotating object. Calculate and plot all points
;DI points to first trail buffer. We store the address of every pixle
;we write into this buffer. When it comes time to erase these pixles we
;do not need to recalculat them. We just collect the address!
DoFrame:
xor ch,ch ;Clear hi byte of loop counter
xor di,di ;Point to start of trail buffer
mov si,[Shape] ;Point to object to be rotated
mov cl,[si] ;Get number of points
mov NumPoints,cx ;We need this count later too...
inc si
L0:
movsx ax,[si] ;Get X coordinate of point
mov [X],ax
movsx ax,[si+1] ;Get Y coordinate
mov [Y],ax
movsx ax,[si+2] ;Get Z coordinate
mov [Z],ax
call Rotate ;Rotate point in 3d
call Draw ;Draw this point
add si,3 ;Point to next point
add di,2 ;point to next slot of trail buffer
dec cx
jne L0
ret
;-------------------------------------------------------------------------
;Project a single XYZ point into 2D space on screen
Draw:
mov ax,[YOff] ;YOff * Y / Z+ZOff = Screen Y
imul [Y]
mov bx,[Z]
add bx,[ZOff]
idiv bx
add ax,[HalfV] ;Centre object on screen
cmp dx,0 ;Clip this pixle if outside display area
jb short ret
cmp ax,200
ja short ret
mov bx,320 ;Calculate 320 * Y...
imul bx
mov bx,ax
mov ax,[XOff] ;XOff * X / Z+ ZOff = Screen X
mov bp,[X]
imul bp
mov bp,[Z]
add bp,[ZOff] ;Distance
idiv bp
add ax,[HalfH]
cmp dx,0 ;Clip pixle if outside display area
jb short ret
cmp ax,320
ja short ret
add bx,ax
mov ax,-1 ;Generate colour for point based on X Y and Z axis
sub ax,[Z] ; of dot
xor ax,[X] ;Divides cube into 8 smaller cubes and alternates
or ax,[Y] ; light/dark (opposite corners same shade)
shr ax,4
add ax,[X] ;This addition makes the cube stripey man :)
add ax,[Y]
es mov [bx],al ;Place a dot with color al
mov Trail8[di],bx ;Save address for erase
ret
;-------------------------------------------------------------------------
;Erase pixles that are 8 frames old.
;Every time a pixles is drawn to the display we remember its video
;offset (address). This saves time when we want to erase that dot
;because we dont need to recalculate the address given an XYZ
ErasePoints:
xor di,di
mov cx,MaxPoints
L0:
mov bx,Trail8[di] ;Pixles added to display on THIS frame
; es dec b[bx] ; Make them less bright
xchg bx,Trail7[di] ;Pixles one frame old
; es dec b[bx] ; Make them less bright
xchg bx,Trail6[di] ;Etc...
; es dec b[bx]
xchg bx,Trail5[di]
; es dec b[bx]
xchg bx,Trail4[di]
; es dec b[bx]
xchg bx,Trail3[di]
; es dec b[bx]
xchg bx,Trail2[di]
; es dec b[bx]
xchg bx,Trail1[di] ;Pixles 8 frames old
es mov b[bx],0 ;Erase them
inc di,2
dec cx
jne L0
ret
;-------------------------------------------------------------------------
;Rotate a single point in 3D space
Rotate:
push cx ;Need to keep this....
;Rotate object about X axis (changes Y and Z)
;
;Y' = Y * Cos(Xang) - Z. Sin(Xang)
;Z' = Y * Sin(Xang) + Z. Cos(Xang)
movsx eax,[Z] ;Get Z * Sin(X)
movsx ebx,[XSin]
mul ebx
mov ecx,eax ;Save in cx...
movsx eax,[Y] ;Get Y * Cos(x)
movsx ebx,[XCos]
imul ebx
sub eax,ecx ;Get Y * Cos(X) - Z * Sin(X)
sar eax,14 ;Sin and Cos Table values are scaled up
mov bp,ax ; by 16384. SHR scales results back down
;We just calculated our new Y coordinate. We cant yet overwrite the old
;Y because we still need it to calculated the new Z
movsx eax,[Z] ;Get Z * Cos(X) Exact opposite of above!
movsx ebx,[XCos]
imul ebx
mov ecx,eax ;Save value...
movsx eax,[Y] ;Get Y * Sin(X)
movsx ebx,[XSin]
imul ebx
add eax,ecx ;Get Y * Sin(X) + Z * Cos(X)
sar eax,14 ;Scale results down by 16384
mov [Y],bp ;Set newly calculated Y and Z coordinates
mov [Z],ax
;Rotate point in Y axis
;
;X' = X * Cos(Yang) - Z * Sin(Yang)
;Z' = X * Sin(Yang) + Z * Cos(Yang)
movsx eax,[Z] ;Following code is very similar to above.
movsx ebx,[YSin] ;It rotates the point in the Y axis
imul ebx ;I.E. It calculates new X and Z
mov ecx,eax
movsx eax,[X]
movsx ebx,[YCos]
imul ebx
sub eax,ecx
sar eax,14
mov bp,ax ;Save new X coord
movsx eax,[Z] ;Calculate Z
movsx ebx,[YCos]
imul ebx
mov ecx,eax
movsx eax,[X]
movsx ebx,[YSin]
imul ebx
add eax,ecx
sar eax,14
mov [X],bp ;Set new X and Z for point
mov [Z],ax
;Rotate objecct along Z axis
;
;X' = X * Cos(Zang) - Y * Sin(Zang)
;Y' = X * Sin(Zang) + Y * Cos(Zang)
movsx eax,[Y] ;Hmmm isnt this... the same, arent we just
movsx ebx,[ZSin] ;doing the same, calculations on in exactly
imul ebx ;The same, way but using different
mov ecx,eax ;Variables? Couldnt we optimise here ???
movsx eax,[X]
movsx ebx,[ZCos] ;Answer...
imul ebx ;
sub eax,ecx ;Yes! But that is a space optimisation
sar eax,14 ;Not a speed optimisation. The INLINE
mov bp,ax ;method is faster
movsx eax,[Y] ;There is also a much better way to do this
movsx ebx,[ZCos] ;that is both smaller and faster.
imul ebx
mov ecx,eax ;I.E. Use a Matrix to rotates points
movsx eax,[X] ;This however is much easier to follow
movsx ebx,[ZSin] ;and MAFFZ wuzz never my strong suit :)
imul ebx
add eax,ecx ;Maybe if this gets too.. slow ill use
sar eax,14 ;matricies tho :)
mov [X],bp
mov [Y],ax
pop cx
ret
;-------------------------------------------------------------------------
;calculate new angles of rotation for all points (to angles)
;We do NOT rotate a point by 1 degree on one frame and then rotate that
;rotated point by 1 degree in the next. We rotate by 1 degree in the
;first frame, by 2 in the next, by 3 in the next etc.
;Every time a point is rotated there is a slight ammount of error in our
;calculation. If we rotated previously rotated points we would accumulate
;errors on each rotation of the point and our object would distort.
;By rotating the SAME points (i.e the original shape) on every frame but
;by different ammounts each time, we never distort our shape by more
;than ONE rotations worth of error (which u cant see :)
ChangeAngles:
mov ax,[DeltaX] ;Adjust X angles of rotation
add [XAngle],ax
mov ax,[DeltaY] ;And Y
add [YAngle],ax
mov ax,[DeltaZ] ;And Z
add [ZAngle],ax
ret
;-------------------------------------------------------------------------
;Get Sin and Cos of all 3 angles of rotation.
GetSinCos:
mov ax,[XAngle] ;Get angle
call SinCos ;Get Sin and Cos
mov [XSin],ax ;Save em!
mov [XCos],bx
mov ax,[YAngle] ;Same but different :)
call SinCos
mov [YSin],ax
mov [YCos],bx
mov ax,[ZAngle] ;Same but different :)
call SinCos
mov [ZSin],ax
mov [ZCos],bx
ret
;-------------------------------------------------------------------------
;This moves a value between two limits at a specific rate.
;This code uses the structure defined at the top of the source file.
;The structure is defined as...
;
; struc [bx]
;
;This makes the address in BX the base of the structure. A86 now allows
;us to just name the structure element without reference to BX, This makes
;the code easier to read if you understand the mechanism but impossible to
;follow if you dont :)
;Where you see a something like
;
; dec Counter
;
;read....
;
; dec Counter[bx]
;
DoDeltas:
mov bx,W1 ;Modify X rotation
call >L0
mov bx,W2 ;Modify Y rotation
call >L0
mov bx,W3 ;Modify Z rotation
call >L0
mov bx,W4 ;Zoom in and out
L0:
dec Counter ;Count down to next change
jne ret
mov ax,Reset ;Counter hit ZERO. Reset it
mov Counter,ax
mov ax,Delta ;Get rate. of change (also direction)
mov si,Position ;Get pointer to variable to modify
add ax,[si] ;Add delta to variable
mov [si],ax ;Store back
cmp ax,Upper ;Did variable reach upper limit?
jl >L2
L1:
neg Delta ;Change direction!
ret
L2:
cmp ax,Lower ;Did variable reach lower limit?
jl L1
ret
;-------------------------------------------------------------------------
;MOA's bump mapping routine. (Yea im uzing this again hehe I like it :)
;-------------------------------------------------------------------------
DoBump:
mov ax,0a000 ;Point to video
mov es,ax
mov si,BumpMap+320*16 ;Point to end of last line of bumpmap
mov di,16 ;16 scan lines
mov ax,di
sub ax,SpotY
mov BumpY,ax
;-------------------------------------------------------------------------
L0:
mov ax,320-2 ;320 Pels per scan
mov cx,ax
sub ax,SpotX
mov BumpX,ax
L1:
mov ax,-1[si] ;Look... No spotlight :) (Addition by OnlyMe)
or al,1[si]
or ax,-321[si]
or al,321[si]
test ax
jz >L9
xor ah,ah ;Clear scratch registers
xor bh,bh
mov al,[si+1] ;Read bump heights to left and right of this bump
mov bl,[si-1]
sub ax,bx ;Compute differenct
sub ax,BumpX ;I think this gets a 2D normal (erm)
cwd
xor ax,dx
sub ax,dx ;But Maff izznt my strong suit
mov bx,07f
sub bx,ax
mov ax,bx
cwd
not dx
and bx,dx
push bx
xor ah,ah ;When i understand how this code actually
xor bh,bh ; works ill add propper comments. Maybe someone
mov al,[si+0141] ; can fill me in eh
mov bl,[si-0140]
sub ax,bx
sub ax,BumpY
cwd
xor ax,dx
sub ax,dx
mov bx,07F
sub bx,ax
mov ax,bx
cwd
not dx
and bx,dx
pop ax
mul bl
shr ax,6+2
L9:
; shr ax,2
; add ax,5
es mov 0e600-BumpMap[si],al
dec BumpX
dec si
loop L1
dec BumpY
sub si,2
dec di
jnz L0
ret
;-------------------------------------------------------------------------
DoScroll:
xor si,si ;First pixle row in current column
mov bx,BumpMap ;Erm... Actually.... This is wrong... hehehe
mov bp,[CharP] ;Point to characters font data
mov dh,b[CharColumn] ;Get column mask
L0:
xor cx,cx ;Assume no bumps (0 pixle)
mov al,[bp+si] ;Get character row from font
and al,dh ;Mask out all but current column
if nz mov cx,03030 ;Raise bumps
mov [bx],cx ;Write double width pixle
mov 320[bx],cx ;Double height too!
add bx,2*320
inc si ;Add 1 to row
cmp si,8 ;Font is 8 by 8
jne L0
mov ax,ds
mov es,ax
mov si,BumpMap ;Scroll bumpmap 2 pixles left
mov di,si ;pixles at far left move to far right hehehe
add si,2
mov cx,320*16/2
rep movsw
ror CharColumn,1 ;Shift row mask 1
jnc short ret ;Wrap round and compute next char
InitScroll:
mov si,[BannerP] ;Get pointer to next char in banner
test b[si] ;End of text?
jnz >L0
inc si
lodsw
mov [Shape],ax
lodsw
mov si,ax
L0:
xor ah,ah
lodsb ;Get text character
mov [BannerP],si
shl ax,3 ;Compute chars ROM offset
add ax,Font
mov CharP,ax ;Points to font data for character
ret
;-------------------------------------------------------------------------
;Get a copy of the font data out of ROM into default DS
GetFont:
mov ax,0f000 ;Point to ROM
mov ds,ax
mov si,0fa6e ;Offset to font data in ROM
mov di,Font
mov cx,256*2
rep movsw
mov ax,cs
mov ds,ax
ret
;-------------------------------------------------------------------------
;Write a KEWL purple palette (Shut Up! I like PuRplE :P)
GetPalette:
mov dx,03C8 ;Write new palette
xor cx,cx
xor ax,ax
out dx,al
inc dx
L0:
mov al,cl ;Select colour number to updata
out dx,al ;Write Red
xchg ah,al
out dx,al ;Write Green (Zero)
xchg ah,al
out dx,al ;Write Blue
inc cl
jnz L0
ret
;-------------------------------------------------------------------------
;Shape structure defined as....
;
; db number-of-points
; db x,y,z of first point
; db x,y,z ... of rest
Cube:
db 125
db -35,-35,-35,-35,-35,-15,-35,-35, 05,-35,-35, 25,-35,-35, 45
db -35,-15,-35,-35,-15,-15,-35,-15, 05,-35,-15, 25,-35,-15, 45
db -35, 05,-35,-35, 05,-15,-35, 05, 05,-35, 05, 25,-35, 05, 45
db -35, 25,-35,-35, 25,-15,-35, 25, 05,-35, 25, 25,-35, 25, 45
db -35, 45,-35,-35, 45,-15,-35, 45, 05,-35, 45, 25,-35, 45, 45
db -15,-35,-35,-15,-35,-15,-15,-35, 05,-15,-35, 25,-15,-35, 45
db -15,-15,-35,-15,-15,-15,-15,-15, 05,-15,-15, 25,-15,-15, 45
db -15, 05,-35,-15, 05,-15,-15, 05, 05,-15, 05, 25,-15, 05, 45
db -15, 25,-35,-15, 25,-15,-15, 25, 05,-15, 25, 25,-15, 25, 45
db -15, 45,-35,-15, 45,-15,-15, 45, 05,-15, 45, 25,-15, 45, 45
db 05,-35,-35, 05,-35,-15, 05,-35, 05, 05,-35, 25, 05,-35, 45
db 05,-15,-35, 05,-15,-15, 05,-15, 05, 05,-15, 25, 05,-15, 45
db 05, 05,-35, 05, 05,-15, 05, 05, 05, 05, 05, 25, 05, 05, 45
db 05, 25,-35, 05, 25,-15, 05, 25, 05, 05, 25, 25, 05, 25, 45
db 05, 45,-35, 05, 45,-15, 05, 45, 05, 05, 45, 25, 05, 45, 45
db 25,-35,-35, 25,-35,-15, 25,-35, 05, 25,-35, 25, 25,-35, 45
db 25,-15,-35, 25,-15,-15, 25,-15, 05, 25,-15, 25, 25,-15, 45
db 25, 05,-35, 25, 05,-15, 25, 05, 05, 25, 05, 25, 25, 05, 45
db 25, 25,-35, 25, 25,-15, 25, 25, 05, 25, 25, 25, 25, 25, 45
db 25, 45,-35, 25, 45,-15, 25, 45, 05, 25, 45, 25, 25, 45, 45
db 45,-35,-35, 45,-35,-15, 45,-35, 05, 45,-35, 25, 45,-35, 45
db 45,-15,-35, 45,-15,-15, 45,-15, 05, 45,-15, 25, 45,-15, 45
db 45, 05,-35, 45, 05,-15, 45, 05, 05, 45, 05, 25, 45, 05, 45
db 45, 25,-35, 45, 25,-15, 45, 25, 05, 45, 25, 25, 45, 25, 45
db 45, 45,-35, 45, 45,-15, 45, 45, 05, 45, 45, 25, 45, 45, 45
Star:
db 65
db -35,-35, 05,-35,-15, 05,-35, 05, 05,-35, 25, 05,-35, 45, 05
db -15,-35, 05,-15,-15, 05,-15, 05, 05,-15, 25, 05,-15, 45, 05
db 05,-35, 05, 05,-15, 05, 05, 05, 05, 05, 25, 05, 05, 45, 05
db 25,-35, 05, 25,-15, 05, 25, 05, 05, 25, 25, 05, 25, 45, 05
db 45,-35, 05, 45,-15, 05, 45, 05, 05, 45, 25, 05, 45, 45, 05
db 05,-35,-35, 05,-35,-15, 05,-35, 25, 05,-35, 45,-35, 05,-35
db 05,-15,-35, 05,-15,-15, 05,-15, 25, 05,-15, 45,-15, 05,-35
db 05, 05,-35, 05, 05,-15, 05, 05, 25, 05, 05, 45, 05, 05,-35
db 05, 25,-35, 05, 25,-15, 05, 25, 25, 05, 25, 45, 25, 05,-35
db 05, 45,-35, 05, 45,-15, 05, 45, 25, 05, 45, 45, 45, 05,-35
db -35, 05,-15,-35, 05, 25,-35, 05, 45,-15, 05,-15,-15, 05, 25
db -15, 05, 45, 05, 05,-15, 05, 05, 25, 05, 05, 45, 25, 05,-15
db 25, 05, 25, 25, 05, 45, 45, 05,-15, 45, 05, 25, 45, 05, 45
Flies:
db 6
db -35,-35,-35,-35,-35, 45, 45, 45,-35, 45, 45, 45, 5,-35, 5
db 5, 45, 5
Square:
db 25
db -35,-35,-35,-35,-15,-35,-35, 05,-35,-35, 25,-35,-35, 45,-35
db -15,-35,-35,-15,-15,-35,-15, 05,-35,-15, 25,-35,-15, 45,-35
db 05,-35,-35, 05,-15,-35, 05, 05,-35, 05, 25,-35, 05, 45,-35
db 25,-35,-35, 25,-15,-35, 25, 05,-35, 25, 25,-35, 25, 45,-35
db 45,-35,-35, 45,-15,-35, 45, 05,-35, 45, 25,-35, 45, 45,-35
Heart:
db 32
db -35,-15,-35,-35, 25,-35,-15,-35,-35,-15,-15,-35,-15, 05,-35
db -15, 25,-35,-15, 45,-35, 05,-35,-35, 05,-15,-35, 05, 05,-35
db 05, 25,-35, 05, 45,-35, 25,-15,-35, 25, 05,-35, 25, 25,-35
db 45, 05,-35
db -30,-10,-30,-30, 20,-30,-10,-30,-30,-10,-10,-30,-10, 00,-30
db -10, 20,-30,-10, 40,-30, 00,-30,-30, 00,-10,-30, 00, 00,-30
db 00, 20,-30, 00, 40,-30, 20,-10,-30, 20, 00,-30, 20, 20,-30
db 40, 00,-30
;-------------------------------------------------------------------------
;I discovered this one completely by accident. I moved a table from the
;end of this file to somewhere up there... but forgot to move the label
;(hehehe). I was therfor referencing a table that is INCLUDED here by my
;assembler. It had lotsa junk in with it at first but i cleaned that out
;and this was the result. I love this object :) its KEWKL hehehe!
Cross:
db 75
db 000,000,019,000,005,019,000,014,001,000,032,000,000,07D,000
db 000,0C9,000,001,05F,001,001,0AB,001,001,0F6,001,002,041,002
db 002,08D,002,002,0D8,002,003,023,003,003,005,004,003,06F,003
db 003,0BA,003,004,051,004,004,09C,004,004,0E7,004,005,013,006
db 005,032,005,005,07D,005,005,0C8,005,006,05E,006,006,0A9,006
db 006,0F4,006,007,03F,007,007,08A,007,007,0D5,007,008,000,009
db 008,020,008,008,06B,008,008,0B5,008,009,04B,009,009,095,009
db 009,0E0,009,00A,009,00B,00A,02A,00A,00A,075,00A,00A,0BF,00A
db 00B,054,00B,00D,007,026,00F,002,028,019,009,032,01E,004,037
db 022,00B,03B,02C,006,045,02D,001,046,039,008,052,03D,003,056
db 043,00A,05C,04B,000,064,04B,005,064,058,007,071,05B,002,074
db 064,009,07C,084,008,09C,088,003,0A1,08D,00A,0A6,096,000,0AF
db 096,005,0AF,0A3,007,0BC,0A6,002,0BF,0AE,009,0C7,0B5,004,0CE
db 0C2,006,0DB,0C4,001,0DD,0CE,008,0E7,0D3,003,0EC,0D8,00A,0F1
db 0E1,005,0FA,0E2,000,0FB,0EE,007,007,0F1,002,00A,0F9,009,011
;=========================================================================

Binary file not shown.

View file

@ -0,0 +1,528 @@
;Sin and Cos tables based on 4096 degree circle.
;-------------------------------------------------------------------------
;Does not extend table by a right angle to account for COS...
; Code takes care of this!
;-------------------------------------------------------------------------
even 2
SinTab:
dw 00000,00019,00032,0004b,00064,0007d,00096,000af ;000
dw 000c9,000e2,000fb,00114,0012d,00146,0015f,00178 ;008
dw 00192,001ab,001c4,001dd,001f6,0020f,00228,00241 ;010
dw 0025b,00274,0028d,002a6,002bf,002d8,002f1,0030a ;018
dw 00323,0033d,00356,0036f,00388,003a1,003ba,003d3 ;020
dw 003ec,00405,0041e,00437,00451,0046a,00483,0049c ;028
dw 004b5,004ce,004e7,00500,00519,00532,0054b,00564 ;030
dw 0057d,00596,005af,005c8,005e1,005fa,00613,0062c ;038
dw 00645,0065e,00677,00690,006a9,006c2,006db,006f4 ;040
dw 0070d,00726,0073f,00758,00771,0078a,007a3,007bc ;048
dw 007d5,007ee,00807,00820,00839,00852,0086b,00884 ;050
dw 0089c,008b5,008ce,008e7,00900,00919,00932,0094b ;058
dw 00964,0097c,00995,009ae,009c7,009e0,009f9,00a11 ;060
dw 00a2a,00a43,00a5c,00a75,00a8d,00aa6,00abf,00ad8 ;068
dw 00af1,00b09,00b22,00b3b,00b54,00b6c,00b85,00b9e ;070
dw 00bb6,00bcf,00be8,00c01,00c19,00c32,00c4b,00c63 ;078
dw 00c7c,00c95,00cad,00cc6,00cde,00cf7,00d10,00d08 ;080
dw 00d41,00d59,00d72,00d8b,00da3,00dbc,00dd4,00ded ;088
dw 00e05,00e1e,00e36,00e4f,00e67,00e80,00e98,00eb1 ;090
dw 00ec9,00ee2,00efa,00f12,00f2b,00f43,00f5c,00f74 ;098
dw 00f8c,00fa5,00fbd,00fd6,00fee,01006,0101f,01037 ;0a0
dw 0104f,01068,01080,01098,010b0,010c9,010e1,010f9 ;0a8
dw 01111,0112a,01142,0115a,01172,0118a,011a2,011bb ;0b0
dw 011d3,011eb,01203,0121b,01233,0124b,01263,0127b ;0b8
dw 01294,012ac,012c4,012dc,012f4,0130c,01324,0133c ;0c0
dw 01354,0136c,01383,0139b,013b3,013cb,013e3,013fb ;0c8
dw 01413,0142b,01443,0145a,01472,0148a,014a2,014ba ;0d0
dw 014d1,014e9,01501,01519,01530,01548,01560,01577 ;0d8
dw 0158f,015a7,015be,015d6,015ee,01605,0161d,01634 ;0e0
dw 0164c,01664,0167b,01693,016aa,016c2,016d9,016f1 ;0e8
dw 01708,0171f,01737,0174e,01766,0177d,01794,017ac ;0f0
dw 017c3,017da,017f2,01809,01820,01838,0184f,01866 ;0f8
dw 0187d,01895,018ac,018c3,018da,018f1,01908,01920 ;100
dw 01937,0194e,01965,0197c,01993,019aa,019c1,019d8 ;108
dw 019ef,01a06,01a1d,01a34,01a4b,01a62,01a79,01a8f ;110
dw 01aa6,01abd,01ad4,01aeb,01b02,01b18,01b2f,01b46 ;118
dw 01b5d,01b73,01b8a,01ba1,01bb7,01bce,01be5,01bfb ;120
dw 01c12,01c28,01c3f,01c55,01c6c,01c83,01c99,01caf ;128
dw 01cc6,01cdc,01cf3,01d09,01d20,01d36,01d4c,01d63 ;130
dw 01d79,01d8f,01da6,01dbc,01dd2,01de8,01dfe,01e15 ;138
dw 01e2b,01e41,01e57,01e6d,01e83,01e99,01eb0,01ec6 ;140
dw 01edc,01ef2,01f08,01f1e,01f34,01f49,01f5f,01f75 ;148
dw 01f8b,01fa1,01fb7,01fcd,01fe2,01ff8,0200e,02024 ;150
dw 02039,0204f,02065,0207b,02090,020a6,020bb,020d1 ;158
dw 020e7,020fc,02112,02127,0213d,02152,02168,0217d ;160
dw 02192,021a8,021bd,021d2,021e8,021fd,02212,02228 ;168
dw 0223d,02252,02267,0227d,02292,022a7,022bc,022d1 ;170
dw 022e6,022fb,02310,02325,0233a,0234f,02364,02379 ;178
dw 0238e,023a3,023b8,023cd,023e1,023f6,0240b,02420 ;180
dw 02434,02449,0245e,02473,02487,0249c,024b0,024c5 ;188
dw 024da,024ee,02503,02517,0252c,02540,02554,02569 ;190
dw 0257d,02592,025a6,025ba,025cf,025e3,025f7,0260b ;198
dw 0261f,02634,02648,0265c,02670,02684,02698,026ac ;1a0
dw 026c0,026d4,026e8,026fc,02710,02724,02738,0274c ;1a8
dw 0275f,02773,02787,0279b,027af,027c2,027d6,027ea ;1b0
dw 027fd,02811,02824,02838,0284b,0285f,02872,02886 ;1b8
dw 02899,028ad,028c0,028d4,028e7,028fa,0290e,02921 ;1c0
dw 02934,02947,0295a,0296e,02981,02994,029a7,029ba ;1c8
dw 029cd,029e0,029f3,02a06,02a19,02a2c,02a3f,02a52 ;1d0
dw 02a65,02a77,02a8a,02a9d,02ab0,02ac2,02ad5,02ae8 ;1d8
dw 02afa,02b0d,02b20,02b32,02b45,02b57,02b6a,02b7c ;1e0
dw 02b8e,02ba1,02bb3,02bc6,02bd8,02bea,02bfc,02c0f ;1e8
dw 02c21,02c33,02c45,02c57,02c6a,02c7c,02c8e,02ca0 ;1f0
dw 02cb2,02cc4,02cd6,02ce8,02cf9,02d0b,02d1d,02d2f ;1f8
dw 02d41,02d52,02d64,02d76,02d88,02d99,02dab,02dbc ;200
dw 02dce,02de0,02df1,02e03,02e14,02e25,02e37,02e48 ;208
dw 02e5a,02e6b,02e7c,02e8d,02e9f,02eb0,02ec1,02ed2 ;210
dw 02ee3,02ef4,02f05,02f16,02f28,02f38,02f49,02f5a ;218
dw 02f6b,02f7c,02f8d,02f9e,02faf,02fbf,02fd0,02fe1 ;220
dw 02ff1,03002,03013,03023,03034,03044,03055,03065 ;228
dw 03076,03086,03096,030a7,030b7,030c7,030d8,030e8 ;230
dw 030f8,03108,03118,03128,03138,03149,03159,03169 ;238
dw 03179,03188,03198,031a8,031b8,031c8,031d8,031e7 ;240
dw 031f7,03207,03216,03226,03236,03245,03255,03264 ;248
dw 03274,03283,03293,032a2,032b1,032c1,032d0,032df ;250
dw 032ee,032fe,0330d,0331c,0332b,0333a,03349,03358 ;258
dw 03367,03376,03385,03394,033a3,033b2,033c1,033cf ;260
dw 033de,033ed,033fb,0340a,03419,03427,03436,03444 ;268
dw 03453,03461,03470,0347e,0348c,0349b,034a9,034b7 ;270
dw 034c6,034d4,034e2,034f0,034fe,0350c,0351a,03528 ;278
dw 03536,03544,03552,03560,0356e,0357c,03589,03597 ;280
dw 035a5,035b3,035c0,035ce,035dc,035e9,035f7,03604 ;288
dw 03612,0361f,0362c,0363a,03647,03654,03662,0366f ;290
dw 0367c,03689,03696,036a4,036b1,036be,036cb,036d8 ;298
dw 036e5,036f1,036fe,0370b,03718,03725,03731,0373e ;2a0
dw 0374b,03757,03764,03771,0377d,0378a,03796,037a3 ;2a8
dw 037af,037bb,037c8,037d4,037e0,037ed,037f9,03805 ;2b0
dw 03811,0381d,03829,03835,03841,0384d,03859,03865 ;2b8
dw 03871,0387d,03889,03894,038a0,038ac,038b7,038c3 ;2c0
dw 038cf,038da,038e6,038f1,038fd,03908,03913,0391f ;2c8
dw 0392a,03935,03941,0394c,03957,03962,0396d,03978 ;2d0
dw 03983,0398e,03999,039a4,039af,039ba,039c5,039d0 ;2d8
dw 039da,039e5,039f0,039fb,03a05,03a10,03a1a,03a25 ;2e0
dw 03a2f,03a3a,03a44,03a4f,03a59,03a63,03a6d,03a78 ;2e0
dw 03a82,03a8c,03a96,03aa0,03aaa,03ab4,03abe,03ac8 ;2f0
dw 03ad2,03adc,03ae6,03af0,03afa,03b03,03b0d,03b17 ;2f8
dw 03b20,03b2a,03b34,03b3d,03b47,03b50,03b59,03b63 ;300
dw 03b6c,03b75,03b7f,03b88,03b91,03b9a,03ba3,03bad ;308
dw 03bb6,03bbf,03bc8,03bd1,03bda,03be2,03beb,03bf4 ;310
dw 03bfd,03c06,03c0e,03c17,03c20,03c28,03c31,03c39 ;318
dw 03c42,03c4a,03c53,03c5b,03c63,03c6c,03c74,03c7c ;320
dw 03c84,03c8c,03c95,03c9d,03ca5,03cad,03cb5,03cbd ;328
dw 03cc5,03ccc,03cd4,03cdc,03ce4,03cec,03cf3,03cfb ;320
dw 03d02,03d0a,03d12,03d19,03d21,03d28,03d2f,03d37 ;338
dw 03d3e,03d45,03d4d,03d54,03d5b,03d62,03d69,03d70 ;340
dw 03d77,03d7e,03d85,03d8c,03d93,03d9a,03da1,03da7 ;348
dw 03dae,03db5,03dbb,03dc2,03dc9,03dcf,03dd6,03ddc ;350
dw 03de2,03de9,03def,03df5,03dfc,03e02,03e08,03e0e ;358
dw 03e14,03e1b,03e21,03e27,03e2d,03e33,03e38,03e3e ;360
dw 03e44,03e4a,03e50,03e55,03e5b,03e61,03e66,03e6c ;368
dw 03e71,03e77,03e7c,03e82,03e87,03e8c,03e92,03e97 ;370
dw 03e9c,03ea1,03ea7,03eac,03eb1,03eb6,03ebb,03ec0 ;378
dw 03ec5,03eca,03ece,03ed3,03ed8,03edd,03ee1,03ee6 ;380
dw 03eeb,03eef,03ef4,03ef8,03efd,03f01,03f06,03f0a ;388
dw 03f0e,03f13,03f17,03f1b,03f1f,03f23,03f27,03f2b ;390
dw 03f2f,03f33,03f37,03f3b,03f3f,03f43,03f47,03f4a ;398
dw 03f4e,03f52,03f55,03f59,03f5d,03f60,03f64,03f67 ;3a0
dw 03f6a,03f6e,03f71,03f74,03f78,03f7b,03f7e,03f81 ;3a8
dw 03f84,03f87,03f8a,03f8d,03f90,03f93,03f96,03f99 ;3b0
dw 03f9c,03f9e,03fa1,03fa4,03fa6,03fa9,03fac,03fae ;3b8
dw 03fb1,03fb3,03fb5,03fb8,03fba,03fbc,03fbf,03fc1 ;3c0
dw 03fc3,03fc5,03fc7,03fc9,03fcb,03fcd,03fcf,03fd1 ;3c8
dw 03fd3,03fd5,03fd7,03fd8,03fda,03fdc,03fde,03fdf ;3d0
dw 03fe1,03fe2,03fe4,03fe5,03fe7,03fe8,03fe9,03feb ;3d8
dw 03fec,03fed,03fee,03fef,03ff0,03ff1,03ff2,03ff3 ;3e0
dw 03ff4,03ff5,03ff6,03ff7,03ff8,03ff9,03ff9,03ffa ;3e8
dw 03ffb,03ffb,03ffc,03ffc,03ffd,03ffd,03ffe,03ffe ;3f0
dw 03ffe,03fff,03fff,03fff,03fff,03fff,03fff,03fff ;3f8
dw 03fff,03fff,03fff,03fff,03fff,03fff,03fff,03fff ;400
dw 03ffe,03ffe,03ffe,03ffd,03ffd,03ffc,03ffc,03ffb ;408
dw 03ffb,03ffa,03ff9,03ff9,03ff8,03ff7,03ff6,03ff5 ;410
dw 03ff4,03ff3,03ff2,03ff1,03ff0,03fef,03fee,03fed ;418
dw 03fec,03feb,03fe9,03fe8,03fe7,03fe5,03fe4,03fe2 ;420
dw 03fe1,03fdf,03fde,03fdc,03fda,03fd8,03fd7,03fd5 ;428
dw 03fd3,03fd1,03fcf,03fcd,03fcb,03fc9,03fc7,03fc5 ;430
dw 03fc3,03fc1,03fbf,03fbc,03fba,03fb8,03fb5,03fb3 ;438
dw 03fb1,03fae,03fac,03fa9,03fa6,03fa4,03fa1,03f9e ;440
dw 03f9c,03f99,03f96,03f93,03f90,03f8d,03f8a,03f87 ;448
dw 03f84,03f81,03f7e,03f7b,03f78,03f74,03f71,03f6e ;450
dw 03f6a,03f67,03f64,03f60,03f5d,03f59,03f55,03f52 ;458
dw 03f4e,03f4a,03f47,03f43,03f3f,03f3b,03f37,03f33 ;460
dw 03f2f,03f2b,03f27,03f23,03f1f,03f1b,03f17,03f13 ;468
dw 03f0e,03f0a,03f06,03f01,03efd,03ef8,03ef4,03eef ;470
dw 03eeb,03ee6,03ee1,03edd,03ed8,03ed3,03ece,03eca ;478
dw 03ec5,03ec0,03ebb,03eb6,03eb1,03eac,03ea7,03ea1 ;480
dw 03e9c,03e97,03e92,03e8c,03e87,03e82,03e7c,03e77 ;488
dw 03e71,03e6c,03e66,03e61,03e5b,03e55,03e50,03e4a ;490
dw 03e44,03e3e,03e38,03e33,03e2d,03e27,03e21,03e1b ;498
dw 03e14,03e0e,03e08,03e02,03dfc,03df5,03def,03de9 ;4a0
dw 03de2,03ddc,03dd6,03dcf,03dc9,03dc2,03dbb,03db5 ;4a8
dw 03dae,03da7,03da1,03d9a,03d93,03d8c,03d85,03d7e ;4b0
dw 03d77,03d70,03d69,03d62,03d5b,03d54,03d4d,03d45 ;4b8
dw 03d3e,03d37,03d2f,03d28,03d21,03d19,03d12,03d0a ;4c0
dw 03d02,03cfb,03cf3,03cec,03ce4,03cdc,03cd4,03ccc ;4c8
dw 03cc5,03cbd,03cb5,03cad,03ca5,03c9d,03c95,03c8c ;4d0
dw 03c84,03c7c,03c74,03c6c,03c63,03c5b,03c53,03c4a ;4d8
dw 03c42,03c39,03c31,03c28,03c20,03c17,03c0e,03c06 ;4e0
dw 03bfd,03bf4,03beb,03be2,03bda,03bd1,03bc8,03bbf ;4e8
dw 03bb6,03bad,03ba3,03b9a,03b91,03b88,03b7f,03b75 ;4f0
dw 03b6c,03b63,03b59,03b50,03b47,03b3d,03b34,03b2a ;4f8
dw 03b20,03b17,03b0d,03b03,03afa,03af0,03ae6,03adc ;500
dw 03ad2,03ac8,03abe,03ab4,03aaa,03aa0,03a96,03a8c ;508
dw 03a82,03a78,03a6d,03a63,03a59,03a4f,03a44,03a3a ;510
dw 03a2f,03a25,03a1a,03a10,03a05,039fb,039f0,039e5 ;518
dw 039da,039d0,039c5,039ba,039af,039a4,03999,0398e ;520
dw 03983,03978,0396d,03962,03957,0394c,03941,03935 ;528
dw 0392a,0391f,03913,03908,038fd,038f1,038e6,038da ;530
dw 038cf,038c3,038b7,038ac,038a0,03894,03889,0387d ;538
dw 03871,03865,03859,0384d,03841,03835,03829,0381d ;540
dw 03811,03805,037f9,037ed,037e0,037d4,037c8,037bb ;548
dw 037af,037a3,03796,0378a,0377d,03771,03764,03757 ;550
dw 0374b,0373e,03731,03725,03718,0370b,036fe,036f1 ;558
dw 036e5,036d8,036cb,036be,036b1,036a4,03696,03689 ;560
dw 0367c,0366f,03662,03654,03647,0363a,0362c,0361f ;568
dw 03612,03604,035f7,035e9,035dc,035ce,035c0,035b3 ;570
dw 035a5,03597,03589,0357c,0356e,03560,03552,03544 ;578
dw 03536,03528,0351a,0350c,034fe,034f0,034e2,034d4 ;580
dw 034c6,034b7,034a9,0349b,0348c,0347e,03470,03461 ;588
dw 03453,03444,03436,03427,03419,0340a,033fb,033ed ;590
dw 033de,033cf,033c1,033b2,033a3,03394,03385,03376 ;598
dw 03367,03358,03349,0333a,0332b,0331c,0330d,032fe ;5a0
dw 032ee,032df,032d0,032c1,032b1,032a2,03293,03283 ;5a8
dw 03274,03264,03255,03245,03236,03226,03216,03207 ;5b0
dw 031f7,031e7,031d8,031c8,031b8,031a8,03198,03188 ;5b8
dw 03179,03169,03159,03149,03138,03128,03118,03108 ;5c0
dw 030f8,030e8,030d8,030c7,030b7,030a7,03096,03086 ;5c8
dw 03076,03065,03055,03044,03034,03023,03013,03002 ;5d0
dw 02ff1,02fe1,02fd0,02fbf,02faf,02f9e,02f8d,02f7c ;5d8
dw 02f6b,02f5a,02f49,02f38,02f27,02f16,02f05,02ef4 ;5e0
dw 02ee3,02ed2,02ec1,02eb0,02e9f,02e8d,02e7c,02e6b ;5e8
dw 02e5a,02e48,02e37,02e25,02e14,02e03,02df1,02de0 ;5f0
dw 02dce,02dbc,02dab,02d99,02d88,02d76,02d64,02d52 ;5f8
dw 02d41,02d2f,02d1d,02d0b,02cf9,02ce8,02cd6,02cc4 ;600
dw 02cb2,02ca0,02c8e,02c7c,02c6a,02c57,02c45,02c33 ;608
dw 02c21,02c0f,02bfc,02bea,02bd8,02bc6,02bb3,02ba1 ;610
dw 02b8e,02b7c,02b6a,02b57,02b45,02b32,02b20,02b0d ;618
dw 02afa,02ae8,02ad5,02ac2,02ab0,02a9d,02a8a,02a77 ;620
dw 02a65,02a52,02a3f,02a2c,02a19,02a06,029f3,029e0 ;628
dw 029cd,029ba,029a7,02994,02981,0296e,0295a,02947 ;630
dw 02934,02921,0290e,028fa,028e7,028d4,028c0,028ad ;638
dw 02899,02886,02872,0285f,0284b,02838,02824,02811 ;640
dw 027fd,027ea,027d6,027c2,027af,0279b,02787,02773 ;648
dw 0275f,0274c,02738,02724,02710,026fc,026e8,026d4 ;650
dw 026c0,026ac,02698,02684,02670,0265c,02648,02634 ;658
dw 0261f,0260b,025f7,025e3,025cf,025ba,025a6,02592 ;660
dw 0257d,02569,02554,02540,0252c,02517,02503,024ee ;668
dw 024da,024c5,024b0,0249c,02487,02473,0245e,02449 ;670
dw 02434,02420,0240b,023f6,023e1,023cd,023b8,023a3 ;678
dw 0238e,02379,02364,0234f,0233a,02325,02310,022fb ;680
dw 022e6,022d1,022bc,022a7,02292,0227d,02267,02252 ;688
dw 0223d,02228,02212,021fd,021e8,021d2,021bd,021a8 ;690
dw 02192,0217d,02168,02152,0213d,02127,02112,020fc ;698
dw 020e7,020d1,020bb,020a6,02090,0207b,02065,0204f ;6a0
dw 02039,02024,0200e,01ff8,01fe2,01fcd,01fb7,01fa1 ;6a8
dw 01f8b,01f75,01f5f,01f49,01f34,01f1e,01f08,01ef2 ;6b0
dw 01edc,01ec6,01eb0,01e99,01e83,01e6d,01e57,01e41 ;6b8
dw 01e2b,01e15,01dfe,01de8,01dd2,01dbc,01da6,01d8f ;6c0
dw 01d79,01d63,01d4c,01d36,01d20,01d09,01cf3,01cdc ;6c8
dw 01cc6,01caf,01c99,01c83,01c6c,01c55,01c3f,01c28 ;6d0
dw 01c12,01bfb,01be5,01bce,01bb7,01ba1,01b8a,01b73 ;6d8
dw 01b5d,01b46,01b2f,01b18,01b02,01aeb,01ad4,01abd ;6e0
dw 01aa6,01a8f,01a79,01a62,01a4b,01a34,01a1d,01a06 ;6e8
dw 019ef,019d8,019c1,019aa,01993,0197c,01965,0194e ;6f0
dw 01937,01920,01908,018f1,018da,018c3,018ac,01895 ;6f8
dw 0187d,01866,0184f,01838,01820,01809,017f2,017da ;700
dw 017c3,017ac,01794,0177d,01766,0174e,01737,0171f ;708
dw 01708,016f1,016d9,016c2,016aa,01693,0167b,01664 ;710
dw 0164c,01634,0161d,01605,015ee,015d6,015be,015a7 ;718
dw 0158f,01577,01560,01548,01530,01519,01501,014e9 ;720
dw 014d1,014ba,014a2,0148a,01472,0145a,01443,0142b ;728
dw 01413,013fb,013e3,013cb,013b3,0139b,01383,0136c ;730
dw 01354,0133c,01324,0130c,012f4,012dc,012c4,012ac ;738
dw 01294,0127b,01263,0124b,01233,0121b,01203,011eb ;740
dw 011d3,011bb,011a2,0118a,01172,0115a,01142,0112a ;748
dw 01111,010f9,010e1,010c9,010b0,01098,01080,01068 ;750
dw 0104f,01037,0101f,01006,00fee,00fd6,00fbd,00fa5 ;758
dw 00f8c,00f74,00f5c,00f43,00f2b,00f12,00efa,00ee2 ;760
dw 00ec9,00eb1,00e98,00e80,00e67,00e4f,00e36,00e1e ;768
dw 00e05,00ded,00dd4,00dbc,00da3,00d8b,00d72,00d59 ;770
dw 00d41,00d28,00d10,00cf7,00cde,00cc6,00cad,00c94 ;778
dw 00c7c,00c63,00c4b,00c32,00c19,00c01,00be8,00bcf ;780
dw 00bb6,00b9e,00b85,00b6c,00b54,00b3b,00b22,00b09 ;788
dw 00af1,00ad8,00abf,00aa6,00a8d,00a75,00a5c,00a43 ;790
dw 00a2a,00a11,009f9,009e0,009c7,009ae,00995,0097c ;798
dw 00964,0094b,00932,00919,00900,008e7,008ce,008b5 ;7a0
dw 0089c,00884,0086b,00852,00839,00820,00807,007ee ;7a8
dw 007d5,007bc,007a3,0078a,00771,00758,0073f,00726 ;7b0
dw 0070d,006f4,006db,006c2,006a9,00690,00677,0065e ;7b8
dw 00645,0062c,00613,005fa,005e1,005c8,005af,00596 ;7c0
dw 0057d,00564,0054b,00532,00519,00500,004e7,004ce ;7c8
dw 004b5,0049c,00483,0046a,00450,00437,0041e,00405 ;7d0
dw 003ec,003d3,003ba,003a1,00388,0036f,00356,0033d ;7d8
dw 00323,0030a,002f1,002d8,002bf,002a6,0028d,00274 ;7e0
dw 0025b,00241,00228,0020f,001f6,001dd,001c4,001ab ;7e8
dw 00192,00178,0015f,00146,0012d,00114,000fb,000e2 ;7f0
dw 000c9,000af,00096,0007d,00064,0004b,00032,00019 ;7f8
dw 00000,0ffe7,0ffce,0ffb5,0ff9c,0ff83,0ff6a,0ff51 ;800
dw 0ff37,0ff1e,0ff05,0feec,0fed3,0feba,0fea1,0fe88 ;808
dw 0fe6e,0fe55,0fe3c,0fe23,0fe0a,0fdf1,0fdd8,0fdbf ;810
dw 0fda5,0fd8c,0fd73,0fd5a,0fd41,0fd28,0fd0f,0fcf6 ;818
dw 0fcdd,0fcc3,0fcaa,0fc91,0fc78,0fc5f,0fc46,0fc2d ;820
dw 0fc14,0fbfb,0fbe2,0fbc9,0fbaf,0fb96,0fb7d,0fb64 ;828
dw 0fb4b,0fb32,0fb19,0fb00,0fae7,0face,0fab5,0fa9c ;830
dw 0fa83,0fa6a,0fa51,0fa38,0fa1f,0fa06,0f9ed,0f9d4 ;838
dw 0f9bb,0f9a2,0f989,0f970,0f957,0f93e,0f925,0f90c ;840
dw 0f8f3,0f8da,0f8c1,0f8a8,0f88f,0f876,0f85d,0f844 ;848
dw 0f82b,0f812,0f7f9,0f7e0,0f7c7,0f7ae,0f795,0f77c ;850
dw 0f764,0f74b,0f732,0f719,0f700,0f6e7,0f6ce,0f6b5 ;858
dw 0f69c,0f684,0f66b,0f652,0f639,0f620,0f607,0f5ef ;860
dw 0f5d6,0f5bd,0f5a4,0f58b,0f573,0f55a,0f541,0f528 ;868
dw 0f50f,0f4f7,0f4de,0f4c5,0f4ac,0f494,0f47b,0f462 ;870
dw 0f44a,0f431,0f418,0f3ff,0f3e7,0f3ce,0f3b5,0f39d ;878
dw 0f384,0f36b,0f353,0f33a,0f322,0f309,0f2f0,0f2d8 ;880
dw 0f2bf,0f2a7,0f28e,0f275,0f25d,0f244,0f22c,0f213 ;888
dw 0f1fb,0f1e2,0f1ca,0f1b1,0f199,0f180,0f168,0f14f ;890
dw 0f137,0f11e,0f106,0f0ee,0f0d5,0f0bd,0f0a4,0f08c ;898
dw 0f074,0f05b,0f043,0f02a,0f012,0effa,0efe1,0efc9 ;8a0
dw 0efb1,0ef98,0ef80,0ef68,0ef50,0ef37,0ef1f,0ef07 ;8a8
dw 0eeef,0eed6,0eebe,0eea6,0ee8e,0ee76,0ee5e,0ee45 ;8b0
dw 0ee2d,0ee15,0edfd,0ede5,0edcd,0edb5,0ed9d,0ed85 ;8b8
dw 0ed6c,0ed54,0ed3c,0ed24,0ed0c,0ecf4,0ecdc,0ecc4 ;8c0
dw 0ecac,0ec94,0ec7d,0ec65,0ec4d,0ec35,0ec1d,0ec05 ;8c8
dw 0ebed,0ebd5,0ebbd,0eba6,0eb8e,0eb76,0eb5e,0eb46 ;8d0
dw 0eb2f,0eb17,0eaff,0eae7,0ead0,0eab8,0eaa0,0ea89 ;8d8
dw 0ea71,0ea59,0ea42,0ea2a,0ea12,0e9fb,0e9e3,0e9cc ;8e0
dw 0e9b4,0e99c,0e985,0e96d,0e956,0e93e,0e927,0e90f ;8e8
dw 0e8f8,0e8e1,0e8c9,0e8b2,0e89a,0e883,0e86c,0e854 ;8f0
dw 0e83d,0e826,0e80e,0e7f7,0e7e0,0e7c8,0e7b1,0e79a ;8f8
dw 0e783,0e76b,0e754,0e73d,0e726,0e70f,0e6f8,0e6e0 ;900
dw 0e6c9,0e6b2,0e69b,0e684,0e66d,0e656,0e63f,0e628 ;908
dw 0e611,0e5fa,0e5e3,0e5cc,0e5b5,0e59e,0e587,0e571 ;910
dw 0e55a,0e543,0e52c,0e515,0e4fe,0e4e8,0e4d1,0e4ba ;918
dw 0e4a3,0e48d,0e476,0e45f,0e449,0e432,0e41b,0e405 ;920
dw 0e3ee,0e3d8,0e3c1,0e3ab,0e394,0e37d,0e367,0e351 ;928
dw 0e33a,0e324,0e30d,0e2f7,0e2e0,0e2ca,0e2b4,0e29d ;930
dw 0e287,0e271,0e25a,0e244,0e22e,0e218,0e201,0e1eb ;938
dw 0e1d5,0e1bf,0e1a9,0e193,0e17d,0e167,0e150,0e13a ;940
dw 0e124,0e10e,0e0f8,0e0e2,0e0cc,0e0b7,0e0a1,0e08b ;948
dw 0e075,0e05f,0e049,0e033,0e01e,0e008,0dff2,0dfdc ;950
dw 0dfc7,0dfb1,0df9b,0df85,0df70,0df5a,0df45,0df2f ;958
dw 0df19,0df04,0deee,0ded9,0dec3,0deae,0de98,0de83 ;960
dw 0de6e,0de58,0de43,0de2e,0de18,0de03,0ddee,0ddd8 ;968
dw 0ddc3,0ddae,0dd99,0dd83,0dd6e,0dd59,0dd44,0dd2f ;970
dw 0dd1a,0dd05,0dcf0,0dcdb,0dcc6,0dcb1,0dc9c,0dc87 ;978
dw 0dc72,0dc5d,0dc48,0dc33,0dc1f,0dc0a,0dbf5,0dbe0 ;980
dw 0dbcc,0dbb7,0dba2,0db8d,0db79,0db64,0db50,0db3b ;988
dw 0db26,0db12,0dafd,0dae9,0dad4,0dac0,0daac,0da97 ;990
dw 0da83,0da6e,0da5a,0da46,0da31,0da1d,0da09,0d9f5 ;998
dw 0d9e1,0d9cc,0d9b8,0d9a4,0d990,0d97c,0d968,0d954 ;9a0
dw 0d940,0d92c,0d918,0d904,0d8f0,0d8dc,0d8c8,0d8b4 ;9a8
dw 0d8a1,0d88d,0d879,0d865,0d851,0d83e,0d82a,0d816 ;9b0
dw 0d803,0d7ef,0d7dc,0d7c8,0d7b5,0d7a1,0d78d,0d77a ;9b8
dw 0d767,0d753,0d740,0d72c,0d719,0d706,0d6f2,0d6df ;9c0
dw 0d6cc,0d6b9,0d6a6,0d692,0d67f,0d66c,0d659,0d646 ;9c8
dw 0d633,0d620,0d60d,0d5fa,0d5e7,0d5d4,0d5c1,0d5ae ;9d0
dw 0d59b,0d589,0d576,0d563,0d550,0d53e,0d52b,0d518 ;9d8
dw 0d506,0d4f3,0d4e0,0d4ce,0d4bb,0d4a9,0d496,0d484 ;9e0
dw 0d472,0d45f,0d44d,0d43a,0d428,0d416,0d404,0d3f1 ;9e8
dw 0d3df,0d3cd,0d3bb,0d3a9,0d396,0d384,0d372,0d360 ;9f0
dw 0d34e,0d33c,0d32a,0d318,0d307,0d2f5,0d2e3,0d2d1 ;9f8
dw 0d2bf,0d2ad,0d29c,0d28a,0d278,0d267,0d255,0d244 ;a00
dw 0d232,0d220,0d20f,0d1fd,0d1ec,0d1db,0d1c9,0d1b8 ;a08
dw 0d1a6,0d195,0d184,0d173,0d161,0d150,0d13f,0d12e ;a10
dw 0d11d,0d10c,0d0fb,0d0e9,0d0d8,0d0c8,0d0b7,0d0a6 ;a18
dw 0d095,0d084,0d073,0d062,0d051,0d041,0d030,0d01f ;a20
dw 0d00f,0cffe,0cfed,0cfdd,0cfcc,0cfbc,0cfab,0cf9b ;a28
dw 0cf8a,0cf7a,0cf6a,0cf59,0cf49,0cf39,0cf28,0cf18 ;a30
dw 0cf08,0cef8,0cee8,0ced8,0cec8,0ceb7,0cea7,0ce97 ;a38
dw 0ce87,0ce78,0ce68,0ce58,0ce48,0ce38,0ce28,0ce19 ;a40
dw 0ce09,0cdf9,0cdea,0cdda,0cdca,0cdbb,0cdab,0cd9c ;a48
dw 0cd8c,0cd7d,0cd6d,0cd5e,0cd4f,0cd3f,0cd30,0cd21 ;a50
dw 0cd12,0cd02,0ccf3,0cce4,0ccd5,0ccc6,0ccb7,0cca8 ;a58
dw 0cc99,0cc8a,0cc7b,0cc6c,0cc5d,0cc4e,0cc3f,0cc31 ;a60
dw 0cc22,0cc13,0cc05,0cbf6,0cbe7,0cbd9,0cbca,0cbbc ;a68
dw 0cbad,0cb9f,0cb90,0cb82,0cb74,0cb65,0cb57,0cb49 ;a70
dw 0cb3a,0cb2c,0cb1e,0cb10,0cb02,0caf4,0cae6,0cad8 ;a78
dw 0caca,0cabc,0caae,0caa0,0ca92,0ca84,0ca76,0ca69 ;a80
dw 0ca5b,0ca4d,0ca40,0ca32,0ca24,0ca17,0ca09,0c9fc ;a88
dw 0c9ee,0c9e1,0c9d4,0c9c6,0c9b9,0c9ac,0c99e,0c991 ;a90
dw 0c984,0c977,0c96a,0c95c,0c94f,0c942,0c935,0c928 ;a98
dw 0c91b,0c90f,0c902,0c8f5,0c8e8,0c8db,0c8cf,0c8c2 ;aa0
dw 0c8b5,0c8a9,0c89c,0c88f,0c883,0c876,0c86a,0c85d ;aa8
dw 0c851,0c845,0c838,0c82c,0c820,0c813,0c807,0c7fb ;ab0
dw 0c7ef,0c7e3,0c7d7,0c7cb,0c7bf,0c7b3,0c7a7,0c79b ;ab8
dw 0c78f,0c783,0c777,0c76c,0c760,0c754,0c749,0c73d ;ac0
dw 0c731,0c726,0c71a,0c70f,0c703,0c6f8,0c6ed,0c6e1 ;ac8
dw 0c6d6,0c6cb,0c6bf,0c6b4,0c6a9,0c69e,0c693,0c688 ;ad0
dw 0c67d,0c672,0c667,0c65c,0c651,0c646,0c63b,0c630 ;ad8
dw 0c626,0c61b,0c610,0c605,0c5fb,0c5f0,0c5e6,0c5db ;ae0
dw 0c5d1,0c5c6,0c5bc,0c5b1,0c5a7,0c59d,0c593,0c588 ;ae8
dw 0c57e,0c574,0c56a,0c560,0c556,0c54c,0c542,0c538 ;af0
dw 0c52e,0c524,0c51a,0c510,0c506,0c4fd,0c4f3,0c4e9 ;af8
dw 0c4e0,0c4d6,0c4cc,0c4c3,0c4b9,0c4b0,0c4a7,0c49d ;b00
dw 0c494,0c48b,0c481,0c478,0c46f,0c466,0c45d,0c453 ;b08
dw 0c44a,0c441,0c438,0c42f,0c426,0c41e,0c415,0c40c ;b10
dw 0c403,0c3fa,0c3f2,0c3e9,0c3e0,0c3d8,0c3cf,0c3c7 ;b18
dw 0c3be,0c3b6,0c3ad,0c3a5,0c39d,0c394,0c38c,0c384 ;b20
dw 0c37c,0c374,0c36b,0c363,0c35b,0c353,0c34b,0c343 ;b28
dw 0c33b,0c334,0c32c,0c324,0c31c,0c314,0c30d,0c305 ;b30
dw 0c2fe,0c2f6,0c2ee,0c2e7,0c2df,0c2d8,0c2d1,0c2c9 ;b38
dw 0c2c2,0c2bb,0c2b3,0c2ac,0c2a5,0c29e,0c297,0c290 ;b40
dw 0c289,0c282,0c27b,0c274,0c26d,0c266,0c25f,0c259 ;b48
dw 0c252,0c24b,0c245,0c23e,0c237,0c231,0c22a,0c224 ;b50
dw 0c21e,0c217,0c211,0c20b,0c204,0c1fe,0c1f8,0c1f2 ;b58
dw 0c1ec,0c1e5,0c1df,0c1d9,0c1d3,0c1cd,0c1c8,0c1c2 ;b60
dw 0c1bc,0c1b6,0c1b0,0c1ab,0c1a5,0c19f,0c19a,0c194 ;b68
dw 0c18f,0c189,0c184,0c17e,0c179,0c174,0c16e,0c169 ;b70
dw 0c164,0c15f,0c159,0c154,0c14f,0c14a,0c145,0c140 ;b78
dw 0c13b,0c136,0c132,0c12d,0c128,0c123,0c11f,0c11a ;b80
dw 0c115,0c111,0c10c,0c108,0c103,0c0ff,0c0fa,0c0f6 ;b88
dw 0c0f2,0c0ed,0c0e9,0c0e5,0c0e1,0c0dd,0c0d9,0c0d5 ;b90
dw 0c0d1,0c0cd,0c0c9,0c0c5,0c0c1,0c0bd,0c0b9,0c0b6 ;b98
dw 0c0b2,0c0ae,0c0ab,0c0a7,0c0a3,0c0a0,0c09c,0c099 ;ba0
dw 0c096,0c092,0c08f,0c08c,0c088,0c085,0c082,0c07f ;ba8
dw 0c07c,0c079,0c076,0c073,0c070,0c06d,0c06a,0c067 ;bb0
dw 0c064,0c062,0c05f,0c05c,0c05a,0c057,0c054,0c052 ;bb8
dw 0c04f,0c04d,0c04b,0c048,0c046,0c044,0c041,0c03f ;bc0
dw 0c03d,0c03b,0c039,0c037,0c035,0c033,0c031,0c02f ;bc8
dw 0c02d,0c02b,0c029,0c028,0c026,0c024,0c022,0c021 ;bd0
dw 0c01f,0c01e,0c01c,0c01b,0c019,0c018,0c017,0c015 ;bd8
dw 0c014,0c013,0c012,0c011,0c010,0c00f,0c00e,0c00d ;be0
dw 0c00c,0c00b,0c00a,0c009,0c008,0c007,0c007,0c006 ;be8
dw 0c005,0c005,0c004,0c004,0c003,0c003,0c002,0c002 ;bf0
dw 0c002,0c001,0c001,0c001,0c001,0c001,0c001,0c001 ;bf8
dw 0c001,0c001,0c001,0c001,0c001,0c001,0c001,0c001 ;c00
dw 0c002,0c002,0c002,0c003,0c003,0c004,0c004,0c005 ;c08
dw 0c005,0c006,0c007,0c007,0c008,0c009,0c00a,0c00b ;c10
dw 0c00c,0c00d,0c00e,0c00f,0c010,0c011,0c012,0c013 ;c18
dw 0c014,0c015,0c017,0c018,0c019,0c01b,0c01c,0c01e ;c20
dw 0c01f,0c021,0c022,0c024,0c026,0c028,0c029,0c02b ;c28
dw 0c02d,0c02f,0c031,0c033,0c035,0c037,0c039,0c03b ;c30
dw 0c03d,0c03f,0c041,0c044,0c046,0c048,0c04b,0c04d ;c38
dw 0c04f,0c052,0c054,0c057,0c05a,0c05c,0c05f,0c062 ;c40
dw 0c064,0c067,0c06a,0c06d,0c070,0c073,0c076,0c079 ;c48
dw 0c07c,0c07f,0c082,0c085,0c088,0c08c,0c08f,0c092 ;c50
dw 0c096,0c099,0c09c,0c0a0,0c0a3,0c0a7,0c0ab,0c0ae ;c58
dw 0c0b2,0c0b6,0c0b9,0c0bd,0c0c1,0c0c5,0c0c9,0c0cd ;c60
dw 0c0d1,0c0d5,0c0d9,0c0dd,0c0e1,0c0e5,0c0e9,0c0ed ;c68
dw 0c0f2,0c0f6,0c0fa,0c0ff,0c103,0c108,0c10c,0c111 ;c70
dw 0c115,0c11a,0c11f,0c123,0c128,0c12d,0c132,0c136 ;c78
dw 0c13b,0c140,0c145,0c14a,0c14f,0c154,0c159,0c15f ;c80
dw 0c164,0c169,0c16e,0c174,0c179,0c17e,0c184,0c189 ;c88
dw 0c18f,0c194,0c19a,0c19f,0c1a5,0c1ab,0c1b0,0c1b6 ;c90
dw 0c1bc,0c1c2,0c1c8,0c1cd,0c1d3,0c1d9,0c1df,0c1e5 ;c98
dw 0c1ec,0c1f2,0c1f8,0c1fe,0c204,0c20b,0c211,0c217 ;ca0
dw 0c21e,0c224,0c22a,0c231,0c237,0c23e,0c245,0c24b ;ca8
dw 0c252,0c259,0c25f,0c266,0c26d,0c274,0c27b,0c282 ;cb0
dw 0c289,0c290,0c297,0c29e,0c2a5,0c2ac,0c2b3,0c2bb ;cb8
dw 0c2c2,0c2c9,0c2d1,0c2d8,0c2df,0c2e7,0c2ee,0c2f6 ;cc0
dw 0c2fe,0c305,0c30d,0c314,0c31c,0c324,0c32c,0c334 ;cc8
dw 0c33b,0c343,0c34b,0c353,0c35b,0c363,0c36b,0c374 ;cd0
dw 0c37c,0c384,0c38c,0c394,0c39d,0c3a5,0c3ad,0c3b6 ;cd8
dw 0c3be,0c3c7,0c3cf,0c3d8,0c3e0,0c3e9,0c3f2,0c3fa ;ce0
dw 0c403,0c40c,0c415,0c41e,0c426,0c42f,0c438,0c441 ;ce8
dw 0c44a,0c453,0c45d,0c466,0c46f,0c478,0c481,0c48b ;cf0
dw 0c494,0c49d,0c4a7,0c4b0,0c4b9,0c4c3,0c4cc,0c4d6 ;cf8
dw 0c4e0,0c4e9,0c4f3,0c4fd,0c506,0c510,0c51a,0c524 ;d00
dw 0c52e,0c538,0c542,0c54c,0c556,0c560,0c56a,0c574 ;d08
dw 0c57e,0c588,0c593,0c59d,0c5a7,0c5b1,0c5bc,0c5c6 ;d10
dw 0c5d1,0c5db,0c5e6,0c5f0,0c5fb,0c605,0c610,0c61b ;d18
dw 0c626,0c630,0c63b,0c646,0c651,0c65c,0c667,0c672 ;d20
dw 0c67d,0c688,0c693,0c69e,0c6a9,0c6b4,0c6bf,0c6cb ;d28
dw 0c6d6,0c6e1,0c6ed,0c6f8,0c703,0c70f,0c71a,0c726 ;d30
dw 0c731,0c73d,0c749,0c754,0c760,0c76c,0c777,0c783 ;d38
dw 0c78f,0c79b,0c7a7,0c7b3,0c7bf,0c7cb,0c7d7,0c7e3 ;d40
dw 0c7ef,0c7fb,0c807,0c813,0c820,0c82c,0c838,0c845 ;d48
dw 0c851,0c85d,0c86a,0c876,0c883,0c88f,0c89c,0c8a9 ;d50
dw 0c8b5,0c8c2,0c8cf,0c8db,0c8e8,0c8f5,0c902,0c90f ;d58
dw 0c91b,0c928,0c935,0c942,0c94f,0c95c,0c96a,0c977 ;d60
dw 0c984,0c991,0c99e,0c9ac,0c9b9,0c9c6,0c9d4,0c9e1 ;d68
dw 0c9ee,0c9fc,0ca09,0ca17,0ca24,0ca32,0ca40,0ca4d ;d70
dw 0ca5b,0ca69,0ca77,0ca84,0ca92,0caa0,0caae,0cabc ;d78
dw 0caca,0cad8,0cae6,0caf4,0cb02,0cb10,0cb1e,0cb2c ;d80
dw 0cb3a,0cb49,0cb57,0cb65,0cb74,0cb82,0cb90,0cb9f ;d88
dw 0cbad,0cbbc,0cbca,0cbd9,0cbe7,0cbf6,0cc05,0cc13 ;d90
dw 0cc22,0cc31,0cc3f,0cc4e,0cc5d,0cc6c,0cc7b,0cc8a ;d98
dw 0cc99,0cca8,0ccb7,0ccc6,0ccd5,0cce4,0ccf3,0cd02 ;da0
dw 0cd12,0cd21,0cd30,0cd3f,0cd4f,0cd5e,0cd6d,0cd7d ;da8
dw 0cd8c,0cd9c,0cdab,0cdbb,0cdca,0cdda,0cdea,0cdf9 ;db0
dw 0ce09,0ce19,0ce28,0ce38,0ce48,0ce58,0ce68,0ce78 ;db8
dw 0ce88,0ce97,0cea7,0ceb7,0cec8,0ced8,0cee8,0cef8 ;dc0
dw 0cf08,0cf18,0cf28,0cf39,0cf49,0cf59,0cf6a,0cf7a ;dc8
dw 0cf8a,0cf9b,0cfab,0cfbc,0cfcc,0cfdd,0cfed,0cffe ;dd0
dw 0d00f,0d01f,0d030,0d041,0d051,0d062,0d073,0d084 ;dd8
dw 0d095,0d0a6,0d0b7,0d0c8,0d0d9,0d0ea,0d0fb,0d10c ;de0
dw 0d11d,0d12e,0d13f,0d150,0d161,0d173,0d184,0d195 ;de8
dw 0d1a6,0d1b8,0d1c9,0d1db,0d1ec,0d1fd,0d20f,0d220 ;df0
dw 0d232,0d244,0d255,0d267,0d278,0d28a,0d29c,0d2ae ;df8
dw 0d2bf,0d2d1,0d2e3,0d2f5,0d307,0d318,0d32a,0d33c ;e00
dw 0d34e,0d360,0d372,0d384,0d396,0d3a9,0d3bb,0d3cd ;e08
dw 0d3df,0d3f1,0d404,0d416,0d428,0d43a,0d44d,0d45f ;e10
dw 0d472,0d484,0d496,0d4a9,0d4bb,0d4ce,0d4e0,0d4f3 ;e18
dw 0d506,0d518,0d52b,0d53e,0d550,0d563,0d576,0d589 ;e20
dw 0d59b,0d5ae,0d5c1,0d5d4,0d5e7,0d5fa,0d60d,0d620 ;e28
dw 0d633,0d646,0d659,0d66c,0d67f,0d692,0d6a6,0d6b9 ;e30
dw 0d6cc,0d6df,0d6f2,0d706,0d719,0d72c,0d740,0d753 ;e38
dw 0d767,0d77a,0d78e,0d7a1,0d7b5,0d7c8,0d7dc,0d7ef ;e40
dw 0d803,0d816,0d82a,0d83e,0d851,0d865,0d879,0d88d ;e48
dw 0d8a1,0d8b4,0d8c8,0d8dc,0d8f0,0d904,0d918,0d92c ;e50
dw 0d940,0d954,0d968,0d97c,0d990,0d9a4,0d9b8,0d9cc ;e58
dw 0d9e1,0d9f5,0da09,0da1d,0da32,0da46,0da5a,0da6e ;e60
dw 0da83,0da97,0daac,0dac0,0dad4,0dae9,0dafd,0db12 ;e68
dw 0db26,0db3b,0db50,0db64,0db79,0db8d,0dba2,0dbb7 ;e70
dw 0dbcc,0dbe0,0dbf5,0dc0a,0dc1f,0dc33,0dc48,0dc5d ;e78
dw 0dc72,0dc87,0dc9c,0dcb1,0dcc6,0dcdb,0dcf0,0dd05 ;e80
dw 0dd1a,0dd2f,0dd44,0dd59,0dd6e,0dd84,0dd99,0ddae ;e88
dw 0ddc3,0ddd8,0ddee,0de03,0de18,0de2e,0de43,0de58 ;e90
dw 0de6e,0de83,0de98,0deae,0dec3,0ded9,0deee,0df04 ;e98
dw 0df19,0df2f,0df45,0df5a,0df70,0df85,0df9b,0dfb1 ;ea0
dw 0dfc7,0dfdc,0dff2,0e008,0e01e,0e033,0e049,0e05f ;ea8
dw 0e075,0e08b,0e0a1,0e0b7,0e0cc,0e0e2,0e0f8,0e10e ;eb0
dw 0e124,0e13a,0e150,0e167,0e17d,0e193,0e1a9,0e1bf ;eb8
dw 0e1d5,0e1eb,0e202,0e218,0e22e,0e244,0e25a,0e271 ;ec0
dw 0e287,0e29d,0e2b4,0e2ca,0e2e0,0e2f7,0e30d,0e324 ;ec8
dw 0e33a,0e351,0e367,0e37e,0e394,0e3ab,0e3c1,0e3d8 ;ed0
dw 0e3ee,0e405,0e41b,0e432,0e449,0e45f,0e476,0e48d ;ed8
dw 0e4a3,0e4ba,0e4d1,0e4e8,0e4fe,0e515,0e52c,0e543 ;ee0
dw 0e55a,0e571,0e587,0e59e,0e5b5,0e5cc,0e5e3,0e5fa ;ee8
dw 0e611,0e628,0e63f,0e656,0e66d,0e684,0e69b,0e6b2 ;ef0
dw 0e6c9,0e6e0,0e6f8,0e70f,0e726,0e73d,0e754,0e76b ;ef8
dw 0e783,0e79a,0e7b1,0e7c8,0e7e0,0e7f7,0e80e,0e826 ;f00
dw 0e83d,0e854,0e86c,0e883,0e89a,0e8b2,0e8c9,0e8e1 ;f08
dw 0e8f8,0e90f,0e927,0e93e,0e956,0e96d,0e985,0e99c ;f10
dw 0e9b4,0e9cc,0e9e3,0e9fb,0ea12,0ea2a,0ea42,0ea59 ;f18
dw 0ea71,0ea89,0eaa0,0eab8,0ead0,0eae7,0eaff,0eb17 ;f20
dw 0eb2f,0eb46,0eb5e,0eb76,0eb8e,0eba6,0ebbd,0ebd5 ;f28
dw 0ebed,0ec05,0ec1d,0ec35,0ec4d,0ec65,0ec7d,0ec94 ;f30
dw 0ecac,0ecc4,0ecdc,0ecf4,0ed0c,0ed24,0ed3c,0ed54 ;f38
dw 0ed6c,0ed85,0ed9d,0edb5,0edcd,0ede5,0edfd,0ee15 ;f40
dw 0ee2d,0ee45,0ee5e,0ee76,0ee8e,0eea6,0eebe,0eed6 ;f48
dw 0eeef,0ef07,0ef1f,0ef37,0ef50,0ef68,0ef80,0ef98 ;f50
dw 0efb1,0efc9,0efe1,0effa,0f012,0f02a,0f043,0f05b ;f58
dw 0f074,0f08c,0f0a4,0f0bd,0f0d5,0f0ee,0f106,0f11e ;f60
dw 0f137,0f14f,0f168,0f180,0f199,0f1b1,0f1ca,0f1e2 ;f68
dw 0f1fb,0f213,0f22c,0f244,0f25d,0f275,0f28e,0f2a7 ;f70
dw 0f2bf,0f2d8,0f2f0,0f309,0f322,0f33a,0f353,0f36c ;f78
dw 0f384,0f39d,0f3b5,0f3ce,0f3e7,0f3ff,0f418,0f431 ;f80
dw 0f44a,0f462,0f47b,0f494,0f4ac,0f4c5,0f4de,0f4f7 ;f88
dw 0f50f,0f528,0f541,0f55a,0f573,0f58b,0f5a4,0f5bd ;f90
dw 0f5d6,0f5ef,0f607,0f620,0f639,0f652,0f66b,0f684 ;f98
dw 0f69c,0f6b5,0f6ce,0f6e7,0f700,0f719,0f732,0f74b ;fa0
dw 0f764,0f77c,0f795,0f7ae,0f7c7,0f7e0,0f7f9,0f812 ;fa8
dw 0f82b,0f844,0f85d,0f876,0f88f,0f8a8,0f8c1,0f8da ;fb0
dw 0f8f3,0f90c,0f925,0f93e,0f957,0f970,0f989,0f9a2 ;fb8
dw 0f9bb,0f9d4,0f9ed,0fa06,0fa1f,0fa38,0fa51,0fa6a ;fc0
dw 0fa83,0fa9c,0fab5,0face,0fae7,0fb00,0fb19,0fb32 ;fc8
dw 0fb4b,0fb64,0fb7d,0fb96,0fbb0,0fbc9,0fbe2,0fbfb ;fd0
dw 0fc14,0fc2d,0fc46,0fc5f,0fc78,0fc91,0fcaa,0fcc3 ;fd8
dw 0fcdd,0fcf6,0fd0f,0fd28,0fd41,0fd5a,0fd73,0fd8c ;fe0
dw 0fda5,0fdbf,0fdd8,0fdf1,0fe0a,0fe23,0fe3c,0fe55 ;fe8
dw 0fe6e,0fe88,0fea1,0feba,0fed3,0feec,0ff05,0ff1e ;ff0
dw 0ff37,0ff51,0ff6a,0ff83,0ff9c,0ffb5,0ffce,0ffe7 ;ff8
;=========================================================================

View file

@ -0,0 +1,29 @@
;=========================================================================
;Trig functions for GFX routines Copyright (c) 1995 by Mark I Manning IV
;=========================================================================
CosTab equ SinTab+0800 ;A Right angle foreward in table!
;-------------------------------------------------------------------------
;Return Sin and Cos of angle AX in variables of same name
SinCos:
and ax,0fff ;4096 degrees = 0 degrees
mov bx,ax ;Put into an indexing reg
add bx,bx
mov ax,SinTab[bx] ;Get Sin(N)
mov Sin,ax ;Bah no MOV Sin,[BX]... Crap processor!
;Note.
; Can NOT use mov ax,SinTab[2*ebx] because in following code BX may go
; negative and 2* a negative number = DOUBLY NEGATIVE!
cmp bx,01800 ;Was Sin(N) in last quadrant of circle?
if nl sub bx,02000 ;Cos(N) must be in first quadrant then
mov bx,CosTab[bx] ;Get Cos(n)
mov Cos,bx ;Exits with Sin in AX and Cos in BX too!
ret
;=========================================================================

75
wmdots/wmdots/sintab.c Normal file
View file

@ -0,0 +1,75 @@
// Sin and Cos tables based on 512 degree circle.
// -----------------------------------------------------------------------
short sin_tab[]=
{
0x0000, 0x00c9, 0x0192, 0x025b, 0x0323, 0x03ec, 0x04b5, 0x057d,
0x0645, 0x070d, 0x07d5, 0x089c, 0x0964, 0x0a2a, 0x0af1, 0x0bb6,
0x0c7c, 0x0d41, 0x0e05, 0x0ec9, 0x0f8c, 0x104f, 0x1111, 0x11d3,
0x1294, 0x1354, 0x1413, 0x14d1, 0x158f, 0x164c, 0x1708, 0x17c3,
0x187d, 0x1937, 0x19ef, 0x1aa6, 0x1b5d, 0x1c12, 0x1cc6, 0x1d79,
0x1e2b, 0x1edc, 0x1f8b, 0x2039, 0x20e7, 0x2192, 0x223d, 0x22e6,
0x238e, 0x2434, 0x24da, 0x257d, 0x261f, 0x26c0, 0x275f, 0x27fd,
0x2899, 0x2934, 0x29cd, 0x2a65, 0x2afa, 0x2b8e, 0x2c21, 0x2cb2,
0x2d41, 0x2dce, 0x2e5a, 0x2ee3, 0x2f6b, 0x2ff1, 0x3076, 0x30f8,
0x3179, 0x31f7, 0x3274, 0x32ee, 0x3367, 0x33de, 0x3453, 0x34c6,
0x3536, 0x35a5, 0x3612, 0x367c, 0x36e5, 0x374b, 0x37af, 0x3811,
0x3871, 0x38cf, 0x392a, 0x3983, 0x39da, 0x3a2f, 0x3a82, 0x3ad2,
0x3b20, 0x3b6c, 0x3bb6, 0x3bfd, 0x3c42, 0x3c84, 0x3cc5, 0x3d02,
0x3d3e, 0x3d77, 0x3dae, 0x3de2, 0x3e14, 0x3e44, 0x3e71, 0x3e9c,
0x3ec5, 0x3eeb, 0x3f0e, 0x3f2f, 0x3f4e, 0x3f6a, 0x3f84, 0x3f9c,
0x3fb1, 0x3fc3, 0x3fd3, 0x3fe1, 0x3fec, 0x3ff4, 0x3ffb, 0x3ffe,
0x3fff, 0x3ffe, 0x3ffb, 0x3ff4, 0x3fec, 0x3fe1, 0x3fd3, 0x3fc3,
0x3fb1, 0x3f9c, 0x3f84, 0x3f6a, 0x3f4e, 0x3f2f, 0x3f0e, 0x3eeb,
0x3ec5, 0x3e9c, 0x3e71, 0x3e44, 0x3e14, 0x3de2, 0x3dae, 0x3d77,
0x3d3e, 0x3d02, 0x3cc5, 0x3c84, 0x3c42, 0x3bfd, 0x3bb6, 0x3b6c,
0x3b20, 0x3ad2, 0x3a82, 0x3a2f, 0x39da, 0x3983, 0x392a, 0x38cf,
0x3871, 0x3811, 0x37af, 0x374b, 0x36e5, 0x367c, 0x3612, 0x35a5,
0x3536, 0x34c6, 0x3453, 0x33de, 0x3367, 0x32ee, 0x3274, 0x31f7,
0x3179, 0x30f8, 0x3076, 0x2ff1, 0x2f6b, 0x2ee3, 0x2e5a, 0x2dce,
0x2d41, 0x2cb2, 0x2c21, 0x2b8e, 0x2afa, 0x2a65, 0x29cd, 0x2934,
0x2899, 0x27fd, 0x275f, 0x26c0, 0x261f, 0x257d, 0x24da, 0x2434,
0x238e, 0x22e6, 0x223d, 0x2192, 0x20e7, 0x2039, 0x1f8b, 0x1edc,
0x1e2b, 0x1d79, 0x1cc6, 0x1c12, 0x1b5d, 0x1aa6, 0x19ef, 0x1937,
0x187d, 0x17c3, 0x1708, 0x164c, 0x158f, 0x14d1, 0x1413, 0x1354,
0x1294, 0x11d3, 0x1111, 0x104f, 0x0f8c, 0x0ec9, 0x0e05, 0x0d41,
0x0c7c, 0x0bb6, 0x0af1, 0x0a2a, 0x0964, 0x089c, 0x07d5, 0x070d,
0x0645, 0x057d, 0x04b5, 0x03ec, 0x0323, 0x025b, 0x0192, 0x00c9,
0x0000, 0xff37, 0xfe6e, 0xfda5, 0xfcdd, 0xfc14, 0xfb4b, 0xfa83,
0xf9bb, 0xf8f3, 0xf82b, 0xf764, 0xf69c, 0xf5d6, 0xf50f, 0xf44a,
0xf384, 0xf2bf, 0xf1fb, 0xf137, 0xf074, 0xefb1, 0xeeef, 0xee2d,
0xed6c, 0xecac, 0xebed, 0xeb2f, 0xea71, 0xe9b4, 0xe8f8, 0xe83d,
0xe783, 0xe6c9, 0xe611, 0xe55a, 0xe4a3, 0xe3ee, 0xe33a, 0xe287,
0xe1d5, 0xe124, 0xe075, 0xdfc7, 0xdf19, 0xde6e, 0xddc3, 0xdd1a,
0xdc72, 0xdbcc, 0xdb26, 0xda83, 0xd9e1, 0xd940, 0xd8a1, 0xd803,
0xd767, 0xd6cc, 0xd633, 0xd59b, 0xd506, 0xd472, 0xd3df, 0xd34e,
0xd2bf, 0xd232, 0xd1a6, 0xd11d, 0xd095, 0xd00f, 0xcf8a, 0xcf08,
0xce87, 0xce09, 0xcd8c, 0xcd12, 0xcc99, 0xcc22, 0xcbad, 0xcb3a,
0xcaca, 0xca5b, 0xc9ee, 0xc984, 0xc91b, 0xc8b5, 0xc851, 0xc7ef,
0xc78f, 0xc731, 0xc6d6, 0xc67d, 0xc626, 0xc5d1, 0xc57e, 0xc52e,
0xc4e0, 0xc494, 0xc44a, 0xc403, 0xc3be, 0xc37c, 0xc33b, 0xc2fe,
0xc2c2, 0xc289, 0xc252, 0xc21e, 0xc1ec, 0xc1bc, 0xc18f, 0xc164,
0xc13b, 0xc115, 0xc0f2, 0xc0d1, 0xc0b2, 0xc096, 0xc07c, 0xc064,
0xc04f, 0xc03d, 0xc02d, 0xc01f, 0xc014, 0xc00c, 0xc005, 0xc002,
0xc001, 0xc002, 0xc005, 0xc00c, 0xc014, 0xc01f, 0xc02d, 0xc03d,
0xc04f, 0xc064, 0xc07c, 0xc096, 0xc0b2, 0xc0d1, 0xc0f2, 0xc115,
0xc13b, 0xc164, 0xc18f, 0xc1bc, 0xc1ec, 0xc21e, 0xc252, 0xc289,
0xc2c2, 0xc2fe, 0xc33b, 0xc37c, 0xc3be, 0xc403, 0xc44a, 0xc494,
0xc4e0, 0xc52e, 0xc57e, 0xc5d1, 0xc626, 0xc67d, 0xc6d6, 0xc731,
0xc78f, 0xc7ef, 0xc851, 0xc8b5, 0xc91b, 0xc984, 0xc9ee, 0xca5b,
0xcaca, 0xcb3a, 0xcbad, 0xcc22, 0xcc99, 0xcd12, 0xcd8c, 0xce09,
0xce88, 0xcf08, 0xcf8a, 0xd00f, 0xd095, 0xd11d, 0xd1a6, 0xd232,
0xd2bf, 0xd34e, 0xd3df, 0xd472, 0xd506, 0xd59b, 0xd633, 0xd6cc,
0xd767, 0xd803, 0xd8a1, 0xd940, 0xd9e1, 0xda83, 0xdb26, 0xdbcc,
0xdc72, 0xdd1a, 0xddc3, 0xde6e, 0xdf19, 0xdfc7, 0xe075, 0xe124,
0xe1d5, 0xe287, 0xe33a, 0xe3ee, 0xe4a3, 0xe55a, 0xe611, 0xe6c9,
0xe783, 0xe83d, 0xe8f8, 0xe9b4, 0xea71, 0xeb2f, 0xebed, 0xecac,
0xed6c, 0xee2d, 0xeeef, 0xefb1, 0xf074, 0xf137, 0xf1fb, 0xf2bf,
0xf384, 0xf44a, 0xf50f, 0xf5d6, 0xf69c, 0xf764, 0xf82b, 0xf8f3,
0xf9bb, 0xfa83, 0xfb4b, 0xfc14, 0xfcdd, 0xfda5, 0xfe6e, 0xff37
};
// =======================================================================

BIN
wmdots/wmdots/wmdots Executable file

Binary file not shown.

667
wmdots/wmdots/wmdots.c Normal file
View file

@ -0,0 +1,667 @@
// WM-Dots the Window Maker 3d Rotating Dots Demo by Mark I Manning IV
// =======================================================================
// This demo is based on an old DOS demo I did a number of years ago. The
// trick was to get it to work in an 64 x 64 window instead of the
// 320 x 200 of the original. (and in 16 instead of 256 colours :)
// Much of these sources are based on other dockable application sources.
// For this reason, and because it is the right thing to do, this file is
// distributed under the GPL. Use it and abuse it as you will.
// Flames, critisizm and general nukings can be sent to....
// i440r@mailcity.com
// I have included the sources (in 100% pure ASM) to the afore mentioned
// original demo. These you can also consider covered by the GPL.
// Maybe someone can help me convert the bump mapping in the original to
// use only 16 colours :) (actually, I have space in the master.xpm for
// 32 colours if I retain a 2 x 2 pixle size. If i go to 1 x 1 i can
// fit 64 colours in there :)
// Yea... I know... Im supposed to be sparing of system resources like
// colour allocations but come on guys... this IS a demo after all :)
// Demos are supposed to be abusive of system resources eh??? :)
// This source file is 100% TAB FREE. Use any editor/viewer you want
// to view it with and set ANY size tabs and it will STILL look right.
// TABS ARE EVIL!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Also Linus T is wrong. Indentations of 8 are an abomination and so is
// k&r source formatting. So There!
// Apart from that... Linus for president :)
// or George W. Bush!!!
// -----------------------------------------------------------------------
// blah :)
// Version 0.1 beta Released Saturday October 9 1999
//
// To do... Fix bug that causes core dump when the "cross" object
// rotates outside window (its not a clipping problem).
// Find out why the "cross" object is not cross shaped in
// this demo when it is in the dos version.
// Change pixle sizes to 1 x 1 for objects that are in
// the distance.
// Move all object definitions out of this file and into
// some kind of rc file and allow user defined objects
// Add greets to the credits display :)
// Impliment better light shading (in object space?)
// Prevent dark pixles overwriting light ones
//
// Done... Scrapped idea about different pixle sizez, it didn't look
// as good as i thunked it would :)
// Fixed adjust_angle() to be angle +128 not angle +127
// Fixed cross by defining xyz as char instead of int
// Fixed core dump problem with cross: Oopts it was a
// clipping problem, z clipping points behind camera! :)
// Added size macro (prolly a bad name for it tho :)
// Implimented better light shading but its still not
// quite right yet...
// Removed math.h from includes as im not using any
// functions therein. Saved a whopping 4 bytes :)
// Added code to draw_point() to prevent dark pels from
// being drawn over lighter pels. Dark pels are further
// away and should be BEHIND the lighter ones. There is
// almost no cpu bash here and I dont need to z sort pels
//
//
// Version 0.2 beta Released Saturday October 9 1999
//
// To do.. Still gotta move objects to rc file....
//
//
//
// Done...
// -----------------------------------------------------------------------
// includes
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <X11/xpm.h>
#include "../wmgeneral/wmgeneral.h"
#include "master.xpm"
#include "sintab.c" // sin() and cos() are crap!
// -----------------------------------------------------------------------
// defines
#define PEL_SIZE 2 // 1 or 2 only
#define MAX_POINTS 125 // max # pels in an object
#define MASK_WIDTH 64 // window bitmap mask dimentions
#define MASK_HEIGHT 64
#define MASK_SIZE MASK_WIDTH * MASK_HEIGHT
// adjust angle for cos table lookup. cos = right angle further
// on in sin table, circle = 512 degrees...
#define adjust(angle) ((angle + 128) & 0x1ff)
#define size(array) ((sizeof(array) / sizeof(array[0])))
// -----------------------------------------------------------------------
// typedefs...
typedef struct // a point in 3d space
{
char x, y, z;
}xyz;
typedef struct // a point in 2d space
{
int x, y;
}xy;
typedef struct
{
int counter; // count down to next speed/shape change
int reset; // initial value of counter
int *ptr; // pointer to item to modify
int delta; // ammount to change item by
int upper; // upper limit for item
int lower; // lower limit for item
}modifier;
// -----------------------------------------------------------------------
// object structures...
xyz cube[]=
{
{-35,-35,-35},{-35,-35,-15},{-35,-35, 05},{-35,-35, 25},{-35,-35, 45},
{-35,-15,-35},{-35,-15,-15},{-35,-15, 05},{-35,-15, 25},{-35,-15, 45},
{-35, 05,-35},{-35, 05,-15},{-35, 05, 05},{-35, 05, 25},{-35, 05, 45},
{-35, 25,-35},{-35, 25,-15},{-35, 25, 05},{-35, 25, 25},{-35, 25, 45},
{-35, 45,-35},{-35, 45,-15},{-35, 45, 05},{-35, 45, 25},{-35, 45, 45},
{-15,-35,-35},{-15,-35,-15},{-15,-35, 05},{-15,-35, 25},{-15,-35, 45},
{-15,-15,-35},{-15,-15,-15},{-15,-15, 05},{-15,-15, 25},{-15,-15, 45},
{-15, 05,-35},{-15, 05,-15},{-15, 05, 05},{-15, 05, 25},{-15, 05, 45},
{-15, 25,-35},{-15, 25,-15},{-15, 25, 05},{-15, 25, 25},{-15, 25, 45},
{-15, 45,-35},{-15, 45,-15},{-15, 45, 05},{-15, 45, 25},{-15, 45, 45},
{ 05,-35,-35},{ 05,-35,-15},{ 05,-35, 05},{ 05,-35, 25},{ 05,-35, 45},
{ 05,-15,-35},{ 05,-15,-15},{ 05,-15, 05},{ 05,-15, 25},{ 05,-15, 45},
{ 05, 05,-35},{ 05, 05,-15},{ 05, 05, 05},{ 05, 05, 25},{ 05, 05, 45},
{ 05, 25,-35},{ 05, 25,-15},{ 05, 25, 05},{ 05, 25, 25},{ 05, 25, 45},
{ 05, 45,-35},{ 05, 45,-15},{ 05, 45, 05},{ 05, 45, 25},{ 05, 45, 45},
{ 25,-35,-35},{ 25,-35,-15},{ 25,-35, 05},{ 25,-35, 25},{ 25,-35, 45},
{ 25,-15,-35},{ 25,-15,-15},{ 25,-15, 05},{ 25,-15, 25},{ 25,-15, 45},
{ 25, 05,-35},{ 25, 05,-15},{ 25, 05, 05},{ 25, 05, 25},{ 25, 05, 45},
{ 25, 25,-35},{ 25, 25,-15},{ 25, 25, 05},{ 25, 25, 25},{ 25, 25, 45},
{ 25, 45,-35},{ 25, 45,-15},{ 25, 45, 05},{ 25, 45, 25},{ 25, 45, 45},
{ 45,-35,-35},{ 45,-35,-15},{ 45,-35, 05},{ 45,-35, 25},{ 45,-35, 45},
{ 45,-15,-35},{ 45,-15,-15},{ 45,-15, 05},{ 45,-15, 25},{ 45,-15, 45},
{ 45, 05,-35},{ 45, 05,-15},{ 45, 05, 05},{ 45, 05, 25},{ 45, 05, 45},
{ 45, 25,-35},{ 45, 25,-15},{ 45, 25, 05},{ 45, 25, 25},{ 45, 25, 45},
{ 45, 45,-35},{ 45, 45,-15},{ 45, 45, 05},{ 45, 45, 25},{ 45, 45, 45}
};
xyz star[]=
{
{-35,-35, 05},{-35,-15, 05},{-35, 05, 05},{-35, 25, 05},{-35, 45, 05},
{-15,-35, 05},{-15,-15, 05},{-15, 05, 05},{-15, 25, 05},{-15, 45, 05},
{ 05,-35, 05},{ 05,-15, 05},{ 05, 05, 05},{ 05, 25, 05},{ 05, 45, 05},
{ 25,-35, 05},{ 25,-15, 05},{ 25, 05, 05},{ 25, 25, 05},{ 25, 45, 05},
{ 45,-35, 05},{ 45,-15, 05},{ 45, 05, 05},{ 45, 25, 05},{ 45, 45, 05},
{ 05,-35,-35},{ 05,-35,-15},{ 05,-35, 25},{ 05,-35, 45},{-35, 05,-35},
{ 05,-15,-35},{ 05,-15,-15},{ 05,-15, 25},{ 05,-15, 45},{-15, 05,-35},
{ 05, 05,-35},{ 05, 05,-15},{ 05, 05, 25},{ 05, 05, 45},{ 05, 05,-35},
{ 05, 25,-35},{ 05, 25,-15},{ 05, 25, 25},{ 05, 25, 45},{ 25, 05,-35},
{ 05, 45,-35},{ 05, 45,-15},{ 05, 45, 25},{ 05, 45, 45},{ 45, 05,-35},
{-35, 05,-15},{-35, 05, 25},{-35, 05, 45},{-15, 05,-15},{-15, 05, 25},
{-15, 05, 45},{ 05, 05,-15},{ 05, 05, 25},{ 05, 05, 45},{ 25, 05,-15},
{ 25, 05, 25},{ 25, 05, 45},{ 45, 05,-15},{ 45, 05, 25},{ 45, 05, 45}
};
xyz dots[]=
{
{-35,-35,-35},{-35,-35, 45},{ 45, 45,-35},{ 45, 45, 45},{ 5,-35, 5},
{ 5, 45, 5}
};
xyz square[]=
{
{-35,-35,-35},{-35,-15,-35},{-35, 05,-35},{-35, 25,-35},{-35, 45,-35},
{-15,-35,-35},{-15,-15,-35},{-15, 05,-35},{-15, 25,-35},{-15, 45,-35},
{ 05,-35,-35},{ 05,-15,-35},{ 05, 05,-35},{ 05, 25,-35},{ 05, 45,-35},
{ 25,-35,-35},{ 25,-15,-35},{ 25, 05,-35},{ 25, 25,-35},{ 25, 45,-35},
{ 45,-35,-35},{ 45,-15,-35},{ 45, 05,-35},{ 45, 25,-35},{ 45, 45,-35}
};
xyz cross[]=
{
{0x00,0x00,0x19}, {0x00,0x05,0x19}, {0x00,0x14,0x01}, {0x00,0x32,0x00},
{0x00,0x7D,0x00}, {0x00,0xC9,0x00}, {0x01,0x5F,0x01}, {0x01,0xAB,0x01},
{0x01,0xF6,0x01}, {0x02,0x41,0x02}, {0x02,0x8D,0x02}, {0x02,0xD8,0x02},
{0x03,0x23,0x03}, {0x03,0x05,0x04}, {0x03,0x6F,0x03}, {0x03,0xBA,0x03},
{0x04,0x51,0x04}, {0x04,0x9C,0x04}, {0x04,0xE7,0x04}, {0x05,0x13,0x06},
{0x05,0x32,0x05}, {0x05,0x7D,0x05}, {0x05,0xC8,0x05}, {0x06,0x5E,0x06},
{0x06,0xA9,0x06}, {0x06,0xF4,0x06}, {0x07,0x3F,0x07}, {0x07,0x8A,0x07},
{0x07,0xD5,0x07}, {0x08,0x00,0x09}, {0x08,0x20,0x08}, {0x08,0x6B,0x08},
{0x08,0xB5,0x08}, {0x09,0x4B,0x09}, {0x09,0x95,0x09}, {0x09,0xE0,0x09},
{0x0A,0x09,0x0B}, {0x0A,0x2A,0x0A}, {0x0A,0x75,0x0A}, {0x0A,0xBF,0x0A},
{0x0B,0x54,0x0B}, {0x0D,0x07,0x26}, {0x0F,0x02,0x28}, {0x19,0x09,0x32},
{0x1E,0x04,0x37}, {0x22,0x0B,0x3B}, {0x2C,0x06,0x45}, {0x2D,0x01,0x46},
{0x39,0x08,0x52}, {0x3D,0x03,0x56}, {0x43,0x0A,0x5C}, {0x4B,0x00,0x64},
{0x4B,0x05,0x64}, {0x58,0x07,0x71}, {0x5B,0x02,0x74}, {0x64,0x09,0x7C},
{0x84,0x08,0x9C}, {0x88,0x03,0xA1}, {0x8D,0x0A,0xA6}, {0x96,0x00,0xAF},
{0x96,0x05,0xAF}, {0xA3,0x07,0xBC}, {0xA6,0x02,0xBF}, {0xAE,0x09,0xC7},
{0xB5,0x04,0xCE}, {0xC2,0x06,0xDB}, {0xC4,0x01,0xDD}, {0xCE,0x08,0xE7},
{0xD3,0x03,0xEC}, {0xD8,0x0A,0xF1}, {0xE1,0x05,0xFA}, {0xE2,0x00,0xFB},
{0xEE,0x07,0x07}, {0xF1,0x02,0x0A}, {0xF9,0x09,0x11}
};
// -----------------------------------------------------------------------
// object lists...
xyz *obj_list[]= // pointers to each object
{
(xyz *) &cube,
(xyz *) &dots,
(xyz *) &star,
(xyz *) &square,
(xyz *) &cross
};
int point_counts[]= // number of points in each object
{
size(cube),
size(dots),
size(star),
size(square),
size(cross)
};
#define NUM_OBJECTS size(obj_list)
// -----------------------------------------------------------------------
// i love global variables :)
// I hate 40 page functions with 50 levels if,and and but loop nesting
char *ProgName = NULL;
char *Version = "0.2 Beta";
int x_angle = 0; // angles of rotation in each axis
int y_angle = 0;
int z_angle = 0;
short cos_x = 0; // trig stuff
short cos_y = 0;
short cos_z = 0;
short sin_x = 0;
short sin_y = 0;
short sin_z = 0;
int x_off = 30; // world space position of object
int y_off = 30;
int z_off = 150;
int delta_x = 1; // rotational speed of object
int delta_y = 1;
int delta_z = 1;
int itters = 1; // number of frames till shape change
int num_points = 0; // number of points in object
int obj_number = 0;
xyz *object = NULL; // pointer to current object
xy trail_1[125]; // frame histories
xy trail_2[125];
xy trail_3[125];
char *p_buff; // addr of pel buffer ( see draw_point() )
// -----------------------------------------------------------------------
//
modifier w1 = // changes x rotation speed
{
30, // count down counter
34, // reset value for countdown counter
&delta_x, // item to modify on count = 0
2, // ammount to add to item
8, // upper limit for item
0, // lower limit for item
};
modifier w2 = // changes y rotation speed
{
20, 20, &delta_y, -1, 6, 0
};
modifier w3 = // changes z rotation speed
{
30, 30, &delta_z, 1, 7, 0
};
modifier w4 = // zooms object in / out of window
{
4, 4, &z_off, -2, 200, 90
};
// modifier w5 = // these two do some funky things with
// { // object space but they tend to make
// 10,10,&x_off,-3,30,10 // the objects small and look further
// }; // away so im not using them
//
// modifier w6 = // but go ahead and take a look at what
// { // they do :)
// 10,30,&y_off,-5,30,10
// };
// -----------------------------------------------------------------------
// draw a point at x/y in specified colour
void draw_point(int x, int y, int c)
{
char *p;
if(x != -1) // is point clipped ?
{
c <<= 1; // adjust c for xpm lookup of colour
p = p_buff + (x + (MASK_WIDTH * y));
if (*p > c) // if pel at *p is higher its darker so
{ // its ok to overwrite it
*p = c; // remember pel colour at this position
copyXPMArea(c, 65, PEL_SIZE, PEL_SIZE, x, y);
}
}
}
// -----------------------------------------------------------------------
// Erase previously drawn point (draw again in BLACK!!!)
void erase_point(int x, int y)
{
if(x != -1) // is point clipped?
{
copyXPMArea(34, 65, PEL_SIZE, PEL_SIZE, x, y);
}
}
// -----------------------------------------------------------------------
// Process pending X events
void do_pending(void)
{
XEvent Event;
while (XPending(display)) // for all pending events do...
{
XNextEvent(display, &Event); // get event type
switch (Event.type) // we are only interested in...
{
case Expose: // expose events and...
RedrawWindow();
break;
case DestroyNotify: // our own "pending" demise :)
XCloseDisplay(display);
exit(0);
break;
}
}
}
// -----------------------------------------------------------------------
// clear frame history buffers
void clear_histories(void)
{
int i = MAX_POINTS;
while (i--) // for loops suck
{
trail_1[i].x = trail_1[i].y = -1; // -1 = invalid coordinate
trail_2[i].x = trail_2[i].y = -1; // draw_point() ignores -1
trail_3[i].x = trail_3[i].y = -1;
}
}
// -----------------------------------------------------------------------
// erase points that are 3 frames old. shift frame histories
void do_trails(void)
{
int i = MAX_POINTS;
while (i--)
{
erase_point(trail_3[i].x, trail_3[i].y);
trail_3[i].x = trail_2[i].x; // shift points within history
trail_2[i].x = trail_1[i].x; // buffers
trail_1[i].x = -1;
trail_3[i].y = trail_2[i].y;
trail_2[i].y = trail_1[i].y;
trail_1[i].y = -1;
}
}
// -----------------------------------------------------------------------
// pre calculate sin and cosine values for x y and z angles of rotation
void sincos(void)
{
sin_x = sin_tab[x_angle];
sin_y = sin_tab[y_angle];
sin_z = sin_tab[z_angle];
cos_x = sin_tab[adjust(x_angle)];
cos_y = sin_tab[adjust(y_angle)];
cos_z = sin_tab[adjust(z_angle)];
}
// -----------------------------------------------------------------------
// roatate object about x y and z axis (in object space)
void rotate(int *px, int *py, int *pz)
{
int tx, ty, tz; // temp store
if (x_angle) // rotate point about x axis...
{
ty = (*py * cos_x) - (*pz * sin_x);
tz = (*py * sin_x) + (*pz * cos_x);
*py = (ty >> 14); // sin table is scaled up so we
*pz = (tz >> 14); // must re scale all results down
}
if (y_angle) // rotate point about y axis
{
tx = (*px * cos_y) - (*pz * sin_y);
tz = (*px * sin_y) + (*pz * cos_y);
*px = (tx >> 14);
*pz = (tz >> 14);
}
if (z_angle) // rotate point about z axis
{
tx = (*px * cos_z) - (*py * sin_z);
ty = (*px * sin_z) + (*py * cos_z);
*px = (tx >> 14);
*py = (ty >> 14);
}
}
// -----------------------------------------------------------------------
// project point in 3d space onto plane in 2d space
void project(int px, int py, int pz, int *x, int *y)
{
int tx, ty; // temp store...
*x = *y = -1; // assume point is clipped
if ((z_off + pz - 5) < 0)
{
return;
}
ty = ((y_off * py) / (z_off + pz)) + 30;
if ((ty > 5) && (ty < 59))
{
tx = ((x_off * px) / (z_off + pz)) + 30;
if ((tx > 5) && (tx < 59))
{
*x = tx;
*y = ty;
}
}
}
// -----------------------------------------------------------------------
// draw one frame of object...
void do_frame(void)
{
int px, py, pz; // 3d coordinates to rotate
int x, y, c; // 2d coordiantes of point and colour
int i = num_points; // loop counter
int j = MASK_SIZE;
char pel_buff[MASK_SIZE]; // frame buffer ( see draw_point() )
p_buff = &pel_buff[0];
while (j--) // erase pel buffer
{
pel_buff[j] = 32;
}
do_trails(); // clear pels that are 3 frames old
sincos(); // calculate all sin/cos values
while(i--)
{
px = object[i].x; // collect point from object
py = object[i].y;
pz = object[i].z;
rotate(&px, &py, &pz); // rotate this point about x/y and z axis
project(px, py, pz, &x, &y); // projection = convert xyz to xy
trail_1[i].x = x; // store frame history for all pels
trail_1[i].y = y; // of this frame
c = (((z_off - 90) / 14) & 15) < 1;
c -= ((-pz / 5) - 10);
draw_point(x, y, c);
}
}
// -----------------------------------------------------------------------
// adjust rotational speeds / distance between min and max for each
void modify(modifier *mod)
{
mod->counter--;
if (!mod->counter)
{
mod->counter = mod->reset;
*mod->ptr += mod->delta;
if (*mod->ptr >= mod->upper || *mod->ptr <= mod->lower)
{
mod->delta = -(mod->delta);
}
}
}
// -----------------------------------------------------------------------
// do the above on each of the 4 modifiers
void do_deltas(void)
{
modify(&w1); // modify x rotational speed
modify(&w2); // modify y rotational speed
modify(&w3); // modify z rotational speed
modify(&w4); // zoom object in and out
// modify(&w5); // not used because they make objects
// modify(&w6); // stay in the distance
}
// -----------------------------------------------------------------------
// adjust x y and z angles of ritation for next frame
void change_angles(void)
{
x_angle += delta_x;
y_angle += delta_y;
z_angle += delta_z;
x_angle &= 0x1ff;
y_angle &= 0x1ff;
z_angle &= 0x1ff;
}
// -----------------------------------------------------------------------
void do_demo(void)
{
while (1) // only way out is to die
{
while(--itters) // countdown to next shape change...
{ // shape change FORCED on entry
change_angles(); // adjust angles of rotation
do_frame(); // draw object
do_deltas(); // modify rotation speeds etc
RedrawWindow(); // lets see what weve drawn...
do_pending(); // quit / expose
usleep(50000); // erm... coders never sleep :)
}
itters = 2500; // should randomise this
object = obj_list[obj_number];
num_points = point_counts[obj_number++];
if (obj_number == NUM_OBJECTS)
{
obj_number = 0;
}
}
}
// -----------------------------------------------------------------------
// display version info and credits
void credits(void)
{
printf("\n");
printf("WM-Dots DEMO? version %s\n",Version);
printf(" by Mark I Manning IV\n\n");
printf("greets to follow soon....\n\n");
}
// sgore for helping me get star office :)
// -----------------------------------------------------------------------
// scan command line args
void scan_args(int argc,char **argv)
{
int i;
for (i = 0; i < argc; i++)
{
char *arg = argv[i];
if (*arg == '-')
{
switch (arg[1])
{
case 'v':
credits();
exit(0);
break;
default:
;
break;
}
}
}
}
// -----------------------------------------------------------------------
// main at BOTTOM of source so we have no EVIL forward refs!!
int main(int argc, char *argv[])
{
char mask[MASK_SIZE];
ProgName = argv[0];
if (strlen(ProgName) >= 5)
{
ProgName += (strlen(ProgName) - 5);
}
scan_args(argc, argv);
createXBMfromXPM(mask, master_xpm, MASK_WIDTH, MASK_HEIGHT);
openXwindow(argc, argv, master_xpm, mask, MASK_WIDTH, MASK_HEIGHT);
clear_histories(); // clear frame history buffers
do_demo(); // main = short and sweet :)
return(0); // never gets executed but lets get rid
} // of that stupid warning :)
// =======================================================================

BIN
wmdots/wmdots/wmdots.o Normal file

Binary file not shown.

169
wmdots/wmgeneral/list.c Normal file
View file

@ -0,0 +1,169 @@
/* Generic single linked list to keep various information
Copyright (C) 1993, 1994 Free Software Foundation, Inc.
Author: Kresten Krab Thorup
Many modifications by Alfredo K. Kojima
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable
to be covered by the GNU General Public License. This exception does not
however invalidate any other reasons why the executable file might be
covered by the GNU General Public License. */
#include "list.h"
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#include <stdlib.h>
/* Return a cons cell produced from (head . tail) */
INLINE LinkedList*
list_cons(void* head, LinkedList* tail)
{
LinkedList* cell;
cell = (LinkedList*)malloc(sizeof(LinkedList));
cell->head = head;
cell->tail = tail;
return cell;
}
/* Return the length of a list, list_length(NULL) returns zero */
INLINE int
list_length(LinkedList* list)
{
int i = 0;
while(list)
{
i += 1;
list = list->tail;
}
return i;
}
/* Return the Nth element of LIST, where N count from zero. If N
larger than the list length, NULL is returned */
INLINE void*
list_nth(int index, LinkedList* list)
{
while(index-- != 0)
{
if(list->tail)
list = list->tail;
else
return 0;
}
return list->head;
}
/* Remove the element at the head by replacing it by its successor */
INLINE void
list_remove_head(LinkedList** list)
{
if (!*list) return;
if ((*list)->tail)
{
LinkedList* tail = (*list)->tail; /* fetch next */
*(*list) = *tail; /* copy next to list head */
free(tail); /* free next */
}
else /* only one element in list */
{
free(*list);
(*list) = 0;
}
}
/* Remove the element with `car' set to ELEMENT */
/*
INLINE void
list_remove_elem(LinkedList** list, void* elem)
{
while (*list)
{
if ((*list)->head == elem)
list_remove_head(list);
*list = (*list ? (*list)->tail : NULL);
}
}*/
INLINE LinkedList *
list_remove_elem(LinkedList* list, void* elem)
{
LinkedList *tmp;
if (list) {
if (list->head == elem) {
tmp = list->tail;
free(list);
return tmp;
}
list->tail = list_remove_elem(list->tail, elem);
return list;
}
return NULL;
}
/* Return element that has ELEM as car */
INLINE LinkedList*
list_find(LinkedList* list, void* elem)
{
while(list)
{
if (list->head == elem)
return list;
list = list->tail;
}
return NULL;
}
/* Free list (backwards recursive) */
INLINE void
list_free(LinkedList* list)
{
if(list)
{
list_free(list->tail);
free(list);
}
}
/* Map FUNCTION over all elements in LIST */
INLINE void
list_mapcar(LinkedList* list, void(*function)(void*))
{
while(list)
{
(*function)(list->head);
list = list->tail;
}
}

59
wmdots/wmgeneral/list.h Normal file
View file

@ -0,0 +1,59 @@
/* Generic single linked list to keep various information
Copyright (C) 1993, 1994 Free Software Foundation, Inc.
Author: Kresten Krab Thorup
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable
to be covered by the GNU General Public License. This exception does not
however invalidate any other reasons why the executable file might be
covered by the GNU General Public License. */
#ifndef __LIST_H_
#define __LIST_H_
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
# define INLINE inline
#else
# define INLINE
#endif
typedef struct LinkedList {
void *head;
struct LinkedList *tail;
} LinkedList;
INLINE LinkedList* list_cons(void* head, LinkedList* tail);
INLINE int list_length(LinkedList* list);
INLINE void* list_nth(int index, LinkedList* list);
INLINE void list_remove_head(LinkedList** list);
INLINE LinkedList *list_remove_elem(LinkedList* list, void* elem);
INLINE void list_mapcar(LinkedList* list, void(*function)(void*));
INLINE LinkedList*list_find(LinkedList* list, void* elem);
INLINE void list_free(LinkedList* list);
#endif

BIN
wmdots/wmgeneral/list.o Normal file

Binary file not shown.

164
wmdots/wmgeneral/misc.c Normal file
View file

@ -0,0 +1,164 @@
/* dock.c- built-in Dock module for WindowMaker
*
* WindowMaker window manager
*
* Copyright (c) 1997 Alfredo K. Kojima
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdlib.h>
#include <string.h>
#include "list.h"
#include "misc.h"
/*
*----------------------------------------------------------------------
* parse_command--
* Divides a command line into a argv/argc pair.
*----------------------------------------------------------------------
*/
#define PRC_ALPHA 0
#define PRC_BLANK 1
#define PRC_ESCAPE 2
#define PRC_DQUOTE 3
#define PRC_EOS 4
#define PRC_SQUOTE 5
typedef struct {
short nstate;
short output;
} DFA;
static DFA mtable[9][6] = {
{{3,1},{0,0},{4,0},{1,0},{8,0},{6,0}},
{{1,1},{1,1},{2,0},{3,0},{5,0},{1,1}},
{{1,1},{1,1},{1,1},{1,1},{5,0},{1,1}},
{{3,1},{5,0},{4,0},{1,0},{5,0},{6,0}},
{{3,1},{3,1},{3,1},{3,1},{5,0},{3,1}},
{{-1,-1},{0,0},{0,0},{0,0},{0,0},{0,0}}, /* final state */
{{6,1},{6,1},{7,0},{6,1},{5,0},{3,0}},
{{6,1},{6,1},{6,1},{6,1},{5,0},{6,1}},
{{-1,-1},{0,0},{0,0},{0,0},{0,0},{0,0}}, /* final state */
};
char*
next_token(char *word, char **next)
{
char *ptr;
char *ret, *t;
int state, ctype;
t = ret = malloc(strlen(word)+1);
ptr = word;
state = 0;
*t = 0;
while (1) {
if (*ptr==0)
ctype = PRC_EOS;
else if (*ptr=='\\')
ctype = PRC_ESCAPE;
else if (*ptr=='"')
ctype = PRC_DQUOTE;
else if (*ptr=='\'')
ctype = PRC_SQUOTE;
else if (*ptr==' ' || *ptr=='\t')
ctype = PRC_BLANK;
else
ctype = PRC_ALPHA;
if (mtable[state][ctype].output) {
*t = *ptr; t++;
*t = 0;
}
state = mtable[state][ctype].nstate;
ptr++;
if (mtable[state][0].output<0) {
break;
}
}
if (*ret==0)
t = NULL;
else
t = strdup(ret);
free(ret);
if (ctype==PRC_EOS)
*next = NULL;
else
*next = ptr;
return t;
}
extern void
parse_command(char *command, char ***argv, int *argc)
{
LinkedList *list = NULL;
char *token, *line;
int count, i;
line = command;
do {
token = next_token(line, &line);
if (token) {
list = list_cons(token, list);
}
} while (token!=NULL && line!=NULL);
count = list_length(list);
*argv = malloc(sizeof(char*)*count);
i = count;
while (list!=NULL) {
(*argv)[--i] = list->head;
list_remove_head(&list);
}
*argc = count;
}
extern pid_t
execCommand(char *command)
{
pid_t pid;
char **argv;
int argc;
parse_command(command, &argv, &argc);
if (argv==NULL) {
return 0;
}
if ((pid=fork())==0) {
char **args;
int i;
args = malloc(sizeof(char*)*(argc+1));
if (!args)
exit(10);
for (i=0; i<argc; i++) {
args[i] = argv[i];
}
args[argc] = NULL;
execvp(argv[0], args);
exit(10);
}
return pid;
}

9
wmdots/wmgeneral/misc.h Normal file
View file

@ -0,0 +1,9 @@
#ifndef __MISC_H
#define __MISC_H
#include <unistd.h>
extern void parse_command(char *, char ***, int *);
extern pid_t execCommand(char *);
#endif /* __MISC_H */

BIN
wmdots/wmgeneral/misc.o Normal file

Binary file not shown.

View file

@ -0,0 +1,479 @@
/*
Best viewed with vim5, using ts=4
wmgeneral was taken from wmppp.
It has a lot of routines which most of the wm* programs use.
------------------------------------------------------------
Author: Martijn Pieterse (pieterse@xs4all.nl)
---
CHANGES:
---
14/09/1998 (Dave Clark, clarkd@skyia.com)
* Updated createXBMfromXPM routine
* Now supports >256 colors
11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl)
* Removed a bug from parse_rcfile. You could
not use "start" in a command if a label was
also start.
* Changed the needed geometry string.
We don't use window size, and don't support
negative positions.
03/09/1998 (Martijn Pieterse, pieterse@xs4all.nl)
* Added parse_rcfile2
02/09/1998 (Martijn Pieterse, pieterse@xs4all.nl)
* Added -geometry support (untested)
28/08/1998 (Martijn Pieterse, pieterse@xs4all.nl)
* Added createXBMfromXPM routine
* Saves a lot of work with changing xpm's.
02/05/1998 (Martijn Pieterse, pieterse@xs4all.nl)
* changed the read_rc_file to parse_rcfile, as suggested by Marcelo E. Magallon
* debugged the parse_rc file.
30/04/1998 (Martijn Pieterse, pieterse@xs4all.nl)
* Ripped similar code from all the wm* programs,
and put them in a single file.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include <stdarg.h>
#include <X11/Xlib.h>
#include <X11/xpm.h>
#include <X11/extensions/shape.h>
#include "wmgeneral.h"
/*****************/
/* X11 Variables */
/*****************/
int screen;
int x_fd;
int d_depth;
XSizeHints mysizehints;
XWMHints mywmhints;
Pixel back_pix, fore_pix;
char *Geometry = "";
GC NormalGC;
XpmIcon wmgen;
Pixmap pixmask;
/*****************/
/* Mouse Regions */
/*****************/
typedef struct {
int enable;
int top;
int bottom;
int left;
int right;
} MOUSE_REGION;
MOUSE_REGION mouse_region[MAX_MOUSE_REGION];
/***********************/
/* Function Prototypes */
/***********************/
static void GetXPM(XpmIcon *, char **);
static Pixel GetColor(char *);
void RedrawWindow(void);
void AddMouseRegion(int, int, int, int, int);
int CheckMouseRegion(int, int);
/*******************************************************************************\
|* parse_rcfile *|
\*******************************************************************************/
void parse_rcfile(const char *filename, rckeys *keys) {
char *p,*q;
char temp[128];
char *tokens = " :\t\n";
FILE *fp;
int i,key;
fp = fopen(filename, "r");
if (fp) {
while (fgets(temp, 128, fp)) {
key = 0;
q = strdup(temp);
q = strtok(q, tokens);
while (key >= 0 && keys[key].label) {
if ((!strcmp(q, keys[key].label))) {
p = strstr(temp, keys[key].label);
p += strlen(keys[key].label);
p += strspn(p, tokens);
if ((i = strcspn(p, "#\n"))) p[i] = 0;
free(*keys[key].var);
*keys[key].var = strdup(p);
key = -1;
} else key++;
}
free(q);
}
fclose(fp);
}
}
/*******************************************************************************\
|* parse_rcfile2 *|
\*******************************************************************************/
void parse_rcfile2(const char *filename, rckeys2 *keys) {
char *p;
char temp[128];
char *tokens = " :\t\n";
FILE *fp;
int i,key;
char *family = NULL;
fp = fopen(filename, "r");
if (fp) {
while (fgets(temp, 128, fp)) {
key = 0;
while (key >= 0 && keys[key].label) {
if ((p = strstr(temp, keys[key].label))) {
p += strlen(keys[key].label);
p += strspn(p, tokens);
if ((i = strcspn(p, "#\n"))) p[i] = 0;
free(*keys[key].var);
*keys[key].var = strdup(p);
key = -1;
} else key++;
}
}
fclose(fp);
}
free(family);
}
/*******************************************************************************\
|* GetXPM *|
\*******************************************************************************/
static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) {
XWindowAttributes attributes;
int err;
/* For the colormap */
XGetWindowAttributes(display, Root, &attributes);
wmgen->attributes.valuemask |= (XpmReturnPixels | XpmReturnExtensions);
err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap),
&(wmgen->mask), &(wmgen->attributes));
if (err != XpmSuccess) {
fprintf(stderr, "Not enough free colorcells.\n");
exit(1);
}
}
/*******************************************************************************\
|* GetColor *|
\*******************************************************************************/
static Pixel GetColor(char *name) {
XColor color;
XWindowAttributes attributes;
XGetWindowAttributes(display, Root, &attributes);
color.pixel = 0;
if (!XParseColor(display, attributes.colormap, name, &color)) {
fprintf(stderr, "wm.app: can't parse %s.\n", name);
} else if (!XAllocColor(display, attributes.colormap, &color)) {
fprintf(stderr, "wm.app: can't allocate %s.\n", name);
}
return color.pixel;
}
/*******************************************************************************\
|* flush_expose *|
\*******************************************************************************/
static int flush_expose(Window w) {
XEvent dummy;
int i=0;
while (XCheckTypedWindowEvent(display, w, Expose, &dummy))
i++;
return i;
}
/*******************************************************************************\
|* RedrawWindow *|
\*******************************************************************************/
void RedrawWindow(void) {
flush_expose(iconwin);
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0);
flush_expose(win);
XCopyArea(display, wmgen.pixmap, win, NormalGC,
0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0);
}
/*******************************************************************************\
|* RedrawWindowXY *|
\*******************************************************************************/
void RedrawWindowXY(int x, int y) {
flush_expose(iconwin);
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0);
flush_expose(win);
XCopyArea(display, wmgen.pixmap, win, NormalGC,
x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0);
}
/*******************************************************************************\
|* AddMouseRegion *|
\*******************************************************************************/
void AddMouseRegion(int index, int left, int top, int right, int bottom) {
if (index < MAX_MOUSE_REGION) {
mouse_region[index].enable = 1;
mouse_region[index].top = top;
mouse_region[index].left = left;
mouse_region[index].bottom = bottom;
mouse_region[index].right = right;
}
}
/*******************************************************************************\
|* CheckMouseRegion *|
\*******************************************************************************/
int CheckMouseRegion(int x, int y) {
int i;
int found;
found = 0;
for (i=0; i<MAX_MOUSE_REGION && !found; i++) {
if (mouse_region[i].enable &&
x <= mouse_region[i].right &&
x >= mouse_region[i].left &&
y <= mouse_region[i].bottom &&
y >= mouse_region[i].top)
found = 1;
}
if (!found) return -1;
return (i-1);
}
/*******************************************************************************\
|* createXBMfromXPM *|
\*******************************************************************************/
void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) {
int i,j,k;
int width, height, numcol, depth;
int zero=0;
unsigned char bwrite;
int bcount;
int curpixel;
sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth);
for (k=0; k!=depth; k++)
{
zero <<=8;
zero |= xpm[1][k];
}
for (i=numcol+1; i < numcol+sy+1; i++) {
bcount = 0;
bwrite = 0;
for (j=0; j<sx*depth; j+=depth) {
bwrite >>= 1;
curpixel=0;
for (k=0; k!=depth; k++)
{
curpixel <<=8;
curpixel |= xpm[i][j+k];
}
if ( curpixel != zero ) {
bwrite += 128;
}
bcount++;
if (bcount == 8) {
*xbm = bwrite;
xbm++;
bcount = 0;
bwrite = 0;
}
}
}
}
/*******************************************************************************\
|* copyXPMArea *|
\*******************************************************************************/
void copyXPMArea(int x, int y, int sx, int sy, int dx, int dy) {
XCopyArea(display, wmgen.pixmap, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy);
}
/*******************************************************************************\
|* copyXBMArea *|
\*******************************************************************************/
void copyXBMArea(int x, int y, int sx, int sy, int dx, int dy) {
XCopyArea(display, wmgen.mask, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy);
}
/*******************************************************************************\
|* setMaskXY *|
\*******************************************************************************/
void setMaskXY(int x, int y) {
XShapeCombineMask(display, win, ShapeBounding, x, y, pixmask, ShapeSet);
XShapeCombineMask(display, iconwin, ShapeBounding, x, y, pixmask, ShapeSet);
}
/*******************************************************************************\
|* openXwindow *|
\*******************************************************************************/
void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, int pixmask_width, int pixmask_height) {
unsigned int borderwidth = 1;
XClassHint classHint;
char *display_name = NULL;
char *wname = argv[0];
XTextProperty name;
XGCValues gcv;
unsigned long gcm;
char *geometry = NULL;
int dummy=0;
int i, wx, wy;
for (i=1; argv[i]; i++) {
if (!strcmp(argv[i], "-display")) {
display_name = argv[i+1];
i++;
}
if (!strcmp(argv[i], "-geometry")) {
geometry = argv[i+1];
i++;
}
}
if (!(display = XOpenDisplay(display_name))) {
fprintf(stderr, "%s: can't open display %s\n",
wname, XDisplayName(display_name));
exit(1);
}
screen = DefaultScreen(display);
Root = RootWindow(display, screen);
d_depth = DefaultDepth(display, screen);
x_fd = XConnectionNumber(display);
/* Convert XPM to XImage */
GetXPM(&wmgen, pixmap_bytes);
/* Create a window to hold the stuff */
mysizehints.flags = USSize | USPosition;
mysizehints.x = 0;
mysizehints.y = 0;
back_pix = GetColor("white");
fore_pix = GetColor("black");
XWMGeometry(display, screen, Geometry, NULL, borderwidth, &mysizehints,
&mysizehints.x, &mysizehints.y,&mysizehints.width,&mysizehints.height, &dummy);
mysizehints.width = 64;
mysizehints.height = 64;
win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
/* Activate hints */
XSetWMNormalHints(display, win, &mysizehints);
classHint.res_name = wname;
classHint.res_class = wname;
XSetClassHint(display, win, &classHint);
XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask);
XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask);
if (XStringListToTextProperty(&wname, 1, &name) == 0) {
fprintf(stderr, "%s: can't allocate window name\n", wname);
exit(1);
}
XSetWMName(display, win, &name);
/* Create GC for drawing */
gcm = GCForeground | GCBackground | GCGraphicsExposures;
gcv.foreground = fore_pix;
gcv.background = back_pix;
gcv.graphics_exposures = 0;
NormalGC = XCreateGC(display, Root, gcm, &gcv);
/* ONLYSHAPE ON */
pixmask = XCreateBitmapFromData(display, win, pixmask_bits, pixmask_width, pixmask_height);
XShapeCombineMask(display, win, ShapeBounding, 0, 0, pixmask, ShapeSet);
XShapeCombineMask(display, iconwin, ShapeBounding, 0, 0, pixmask, ShapeSet);
/* ONLYSHAPE OFF */
mywmhints.initial_state = WithdrawnState;
mywmhints.icon_window = iconwin;
mywmhints.icon_x = mysizehints.x;
mywmhints.icon_y = mysizehints.y;
mywmhints.window_group = win;
mywmhints.flags = StateHint | IconWindowHint | IconPositionHint | WindowGroupHint;
XSetWMHints(display, win, &mywmhints);
XSetCommand(display, win, argv, argc);
XMapWindow(display, win);
if (geometry) {
if (sscanf(geometry, "+%d+%d", &wx, &wy) != 2) {
fprintf(stderr, "Bad geometry string.\n");
exit(1);
}
XMoveWindow(display, win, wx, wy);
}
}

View file

@ -0,0 +1,61 @@
#ifndef WMGENERAL_H_INCLUDED
#define WMGENERAL_H_INCLUDED
/***********/
/* Defines */
/***********/
#define MAX_MOUSE_REGION (16)
/************/
/* Typedefs */
/************/
typedef struct _rckeys rckeys;
struct _rckeys {
const char *label;
char **var;
};
typedef struct _rckeys2 rckeys2;
struct _rckeys2 {
const char *family;
const char *label;
char **var;
};
typedef struct {
Pixmap pixmap;
Pixmap mask;
XpmAttributes attributes;
} XpmIcon;
/*******************/
/* Global variable */
/*******************/
Display *display;
Window Root, iconwin, win;
/***********************/
/* Function Prototypes */
/***********************/
void AddMouseRegion(int index, int left, int top, int right, int bottom);
int CheckMouseRegion(int x, int y);
void openXwindow(int argc, char *argv[], char **, char *, int, int);
void RedrawWindow(void);
void RedrawWindowXY(int x, int y);
void createXBMfromXPM(char *, char **, int, int);
void copyXPMArea(int, int, int, int, int, int);
void copyXBMArea(int, int, int, int, int, int);
void setMaskXY(int, int);
void parse_rcfile(const char *, rckeys *);
#endif

Binary file not shown.