-
Notifications
You must be signed in to change notification settings - Fork 3
/
jagonly.c
1860 lines (1469 loc) · 35.2 KB
/
jagonly.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* marsonly.c */
#include "doomdef.h"
#include "r_local.h"
/*
JAGUAR MEMORY MAP
0x 4000 text/data/bss
0x 80000 start heap
0x1c8000 sbarback (0x3210)
0x1cb210 sbarfront (0x3200)
0x1ce410 debugscreen (0x1bf0)
0x1d0000 screens[0]
0x1e0000 screens[1]
0x1f0000 soundbuffer
0x1f4000 stack (8 bytes of screenshade)
0x200000 end of ram
at all times,
pixel_t *workingscreen; will point to the undisplayed screens[workpage]
*/
boolean debugscreenstate = false;
boolean debugscreenactive;
pixel_t *screens[2]; /* [SCREENWIDTH*SCREENHEIGHT]; */
short *palette8; /* [256] for translating 8 bit source to 16 bit */
int *screenshade; /* pixels for screen shifting */
byte *debugscreen;
extern jagobj_t *sbar;
extern byte *sbartop;
int workpage; /* which frame is not being displayed */
int worklist; /* which listbuffer is not being used */
int isrvmode = 0xC1+(7<<9); /* vmode value set by ISR each screen */
extern int listbuffer[256];
extern int listbuffer1[256];
extern int listbuffer2[256];
extern int stopobj[2];
int *listbuffers[2] = {listbuffer1,listbuffer2};
int *displaylist_p; /* list currently being displayed */
int *readylist_p = stopobj; /* list to display next frame */
int *worklist_p, *work_p; /* list currently being built */
int joypad[32];
int joystick1;
int ticcount;
unsigned branch1, branch2;
int junk;
int spincount;
int ZERO = 0, zero = 0, zero2 = 0;
pixel_t *framebuffer;
extern jagobj_t *sbar;
char hexdigits[16] = "0123456789ABCDEF";
void InitDisplay (void);
void Spin (void)
{
I_Print8 (1,24,"Spin...");
while (1)
;
}
void ReadEEProm (void);
/*
================
=
= Jag68k_main
=
================
*/
extern int gpubase,gpubase_init;
extern int dspbase,dspbase_init;
extern int enddata;
extern short video_height;
extern short a_vdb, a_vde, a_hdb, a_hde;
unsigned BASEORGY;
void Jag68k_main (void)
{
int i;
debugscreenactive = debugscreenstate;
/* clear screen */
readylist_p = stopobj;
*(int *)0xf1a114 = ZERO; /* make sure it's stopped */
*(int *)0xf02114 = ZERO; /* make sure it's stopped */
/* clear bss and screens */
D_memset (&enddata, 0, 0x1fc000 - (int)&enddata);
/* init vars */
sbar = (jagobj_t *)0x1c8000;
sbartop = (byte *)0x1cb210;
debugscreen = (byte *)0x1ce410;
framebuffer = screens[0] = (pixel_t *)0x1d0000;
screens[1] = (pixel_t *)0x1e0000;
screenshade = (int *)0x1f4000;
#if 0
soundbuffer[0] = 0xffff; /* debug click in sound buffer */
soundbuffer[1] = 0xffff;
soundbuffer[4] = 0xeeee;
soundbuffer[5] = 0xeeee;
#endif
I_Print8 (1,0,"GPU_main");
/* */
/* copy dsp programs */
/* */
*(int *)0xf1a10c = 0x00050005; /* operate in correct endian mode */
*(int *)0xf1a114 = ZERO; /* make sure it's stopped */
*(int *)0xf1a100 = (31<<9)+(1<<17); /* clear interrupt latches */
for (i=0 ; i< 128 ; i++)
((int *)0xf1b000)[i] = ((int *)&dspbase)[i];
for ( ; i< 2048 ; i++)
((int *)0xf1b000)[i] = ZERO;
*(int *)0xf1a110 = (int)&dspbase_init; /* set it up at init code */
*(int *)0xf1a114 = 1; /* start it */
/* */
/* init NTSC/PAL stuff */
/* */
if (video_height >= 256) /* pal */
{
BASEORGY = 48;
}
else
{
BASEORGY = 24; /* NTSC */
}
branch1 = 0x8003 + (a_vde<<3);
branch2 = 0x4003 + (a_vdb<<3);
/* */
/* init sound hardware */
/* */
/* *(int *)0xf1a148 = ZERO; // R_DAC */
/* *(int *)0xf1a14c = ZERO; // L_DAC */
*(int *)0xf14000 = 0x100; /* JOYSTICK (unmute sound) */
*(int *)0xf1a150 = 19; /* SCLK (SSI Clock frequency) */
*(int *)0xf1a154 = 0x15; /* SMODE (SSI Control) */
/* copy gpu programs */
*(int *)0xf02114 = ZERO; /* make sure it's stopped */
*(int *)0xf02100 = (31<<9); /* clear interrupt latches */
*(int *)0xf0211c = ZERO; /* clear divide control */
for (i=0 ; i< 64 ; i++)
((int *)0xf03000)[i] = ((int *)&gpubase)[i];
for ( ; i< 1024 ; i++)
((int *)0xf03000)[i] = 0;
*(int *)0xf02110 = (int)&gpubase_init; /* set it up at init code */
*(int *)0xf02114 = 1; /* start it */
/* set a two color palette */
((pixel_t *)0xf00400)[0] = ZERO;
for (i=1 ; i<256 ; i++)
((pixel_t *)0xf00400)[i] = (pixel_t)0xffff;
I_Update ();
/* */
/* load defaults */
/* */
ReadEEProm ();
/* */
/* start doom */
/* */
D_DoomMain ();
}
/*
==============================================================================
DOOM INTERFACE CODE
==============================================================================
*/
byte font8[] =
{0,0,0,0,0,0,0,0,24,24,24,24,24,0,24,0,
54,54,54,0,0,0,0,0,108,108,254,108,254,108,108,0,
48,124,192,120,12,248,48,0,198,204,24,48,102,198,0,0,
56,108,56,118,220,204,118,0,24,24,48,0,0,0,0,0,
6,12,24,24,24,12,6,0,48,24,12,12,12,24,48,0,
0,102,60,255,60,102,0,0,0,24,24,126,24,24,0,0,
0,0,0,0,48,48,96,0,0,0,0,0,126,0,0,0,
0,0,0,0,0,96,96,0,6,12,24,48,96,192,128,0,
56,108,198,198,198,108,56,0,24,56,24,24,24,24,60,0,
248,12,12,56,96,192,252,0,248,12,12,56,12,12,248,0,
28,60,108,204,254,12,12,0,252,192,248,12,12,12,248,0,
60,96,192,248,204,204,120,0,252,12,24,48,96,192,192,0,
120,204,204,120,204,204,120,0,120,204,204,124,12,12,120,0,
0,96,96,0,96,96,0,0,0,96,96,0,96,96,192,0,
12,24,48,96,48,24,12,0,0,0,252,0,0,252,0,0,
96,48,24,12,24,48,96,0,124,6,6,28,24,0,24,0,
124,198,222,222,222,192,120,0,48,120,204,204,252,204,204,0,
248,204,204,248,204,204,248,0,124,192,192,192,192,192,124,0,
248,204,204,204,204,204,248,0,252,192,192,248,192,192,252,0,
252,192,192,248,192,192,192,0,124,192,192,192,220,204,124,0,
204,204,204,252,204,204,204,0,60,24,24,24,24,24,60,0,
12,12,12,12,12,12,248,0,198,204,216,240,216,204,198,0,
192,192,192,192,192,192,252,0,198,238,254,214,198,198,198,0,
198,230,246,222,206,198,198,0,120,204,204,204,204,204,120,0,
248,204,204,248,192,192,192,0,120,204,204,204,204,216,108,0,
248,204,204,248,240,216,204,0,124,192,192,120,12,12,248,0,
252,48,48,48,48,48,48,0,204,204,204,204,204,204,124,0,
204,204,204,204,204,120,48,0,198,198,198,214,254,238,198,0,
198,198,108,56,108,198,198,0,204,204,204,120,48,48,48,0,
254,12,24,48,96,192,254,0,120,96,96,96,96,96,120,0,
192,96,48,24,12,6,0,0,120,24,24,24,24,24,120,0,
24,60,102,66,0,0,0,0,0,0,0,0,0,0,255,0,
192,192,96,0,0,0,0,0,0,0,120,12,124,204,124,0,
192,192,248,204,204,204,248,0,0,0,124,192,192,192,124,0,
12,12,124,204,204,204,124,0,0,0,120,204,252,192,124,0,
60,96,96,248,96,96,96,0,0,0,124,204,124,12,248,0,
192,192,248,204,204,204,204,0,24,0,56,24,24,24,60,0,
24,0,24,24,24,24,240,0,192,192,204,216,240,216,204,0,
56,24,24,24,24,24,60,0,0,0,236,214,214,214,214,0,
0,0,248,204,204,204,204,0,0,0,120,204,204,204,120,0,
0,0,248,204,204,248,192,0,0,0,124,204,204,124,12,0,
0,0,220,224,192,192,192,0,0,0,124,192,120,12,248,0,
96,96,252,96,96,96,60,0,0,0,204,204,204,204,124,0,
0,0,204,204,204,120,48,0,0,0,214,214,214,214,110,0,
0,0,198,108,56,108,198,0,0,0,204,204,124,12,248,0,
0,0,252,24,48,96,252,0,28,48,48,224,48,48,28,0,
24,24,24,0,24,24,24,0,224,48,48,28,48,48,224,0,
118,220,0,0,0,0,0,0,252,252,252,252,252,252,252,0};
/*
=================
=
= I_Print8
=
=================
*/
void I_Print8 (int x, int y, char *string)
{
int c;
byte *source,*dest;
dest = debugscreen + (y<<8) + x;
if (y > 224/8)
return;
while ((c=*string++) && x<32)
{
if (c < 32 || c>= 128)
continue;
source = font8 + ((c-32)<<3);
dest[0] = *source++;
dest[32] = *source++;
dest[32*2] = *source++;
dest[32*3] = *source++;
dest[32*4] = *source++;
dest[32*5] = *source++;
dest[32*6] = *source;
dest++;
x++;
}
}
/*
================
=
= I_Error
=
================
*/
char errormessage[80];
void I_Error (char *error, ...)
{
D_vsprintf (errormessage,error,((int *)&error)+1);
I_Print8 (0,25,errormessage);
debugscreenactive = true;
I_Update ();
while (1)
;
}
/*
================
=
= I_Init
=
= Called after all other subsystems have been started
================
*/
void I_Init (void)
{
int i;
palette8 = W_CacheLumpName ("CRYPAL",PU_STATIC);
for (i=0 ; i<256 ; i++)
((pixel_t *)0xf00400)[i] = palette8[i];
}
void I_DrawSbar (void)
{
jagobj_t *frag;
int x,y;
unsigned *source, *dest;
W_ReadLump (W_GetNumForName ("STBAR"), sbar); /* background */
if (netgame != gt_deathmatch)
return;
frag = W_CacheLumpName ("STBARNET",PU_STATIC);
dest = (unsigned *)((byte *)sbar->data + 240);
source = (unsigned *)frag->data;
for (y=0 ; y< 40 ; y++)
{
for (x=0 ; x<20 ; x++)
dest[x] = source[x];
source += 20;
dest += 80;
}
Z_Free (frag);
}
boolean I_RefreshCompleted (void)
{
return gpufinished;
}
boolean I_RefreshLatched (void)
{
return phasetime[3] != 0;
}
/*
====================
=
= I_WadBase
=
= Return a pointer to the wadfile. In a cart environment this will
= just be a pointer to rom. In a simulator, load the file from disk.
====================
*/
byte *I_WadBase (void)
{
return (byte *)0x840000;
}
/*
====================
=
= I_ZoneBase
=
= Return the location and size of the heap for dynamic memory allocation
====================
*/
#define STARTHEAP 0x80000
#define ENDHEAP 0x1c8000
byte *I_ZoneBase (int *size)
{
*size = ENDHEAP-STARTHEAP; /* leave 64k for stack */
return (byte *)STARTHEAP;
}
/*
====================
=
= I_ReadControls
=
====================
*/
#define TICSCALE 2
int I_ReadControls (void)
{
static int oldticcount;
int stoptic, i, cumulative;
stoptic = ticcount;
if (stoptic - oldticcount > 4)
oldticcount = stoptic - 4;
if (oldticcount >= stoptic)
oldticcount = stoptic - 1;
cumulative = 0;
for (i=oldticcount ; i<stoptic ; i++)
{
cumulative |= joypad[i&31];
}
oldticcount = stoptic;
return cumulative;
/* return joystick1; */
}
int I_GetTime (void)
{
return ticcount;
}
/*
==============================================================================
MATH CODE
==============================================================================
*/
int __mulsi3 (int a, int b)
{
int sign;
unsigned short a1,a2,b1,b2;
unsigned c;
sign = a^b;
if (a&0x80000000)
a = -a;
if (b&0x80000000)
b = -b;
a1 = a&0xffff;
a2 = a>>16;
b1 = b&0xffff;
b2 = b>>16;
c = a1*b1;
c += (a2*b1)<<16;
c += (b2*a1)<<16;
if (sign < 0)
c = -c;
return c;
}
unsigned __udivsi3 (unsigned aa, unsigned bb)
{
unsigned bit;
unsigned c;
if ( (aa>>30) >= bb)
return 0x7fffffff;
bit = 1;
while (aa > bb && bb < 0x80000000)
{
bb <<= 1;
bit <<= 1;
}
c = 0;
do
{
if (aa >= bb)
{
aa -=bb;
c |= bit;
}
bb >>=1;
bit >>= 1;
} while (bit && aa);
return c;
}
int __divsi3 (int a, int b)
{
unsigned aa,bb,c;
int sign;
sign = a^b;
if (a<0)
aa = -a;
else
aa = a;
if (b<0)
bb = -b;
else
bb = b;
c = __udivsi3 (aa,bb);
if (sign < 0)
c = -(int)c;
return c;
}
unsigned __umodsi3 (unsigned aa, unsigned bb)
{
unsigned div;
div = aa/bb;
return aa - (div*bb);
}
unsigned __modsi3 (unsigned aa, unsigned bb)
{
return __umodsi3 (aa,bb);
}
#if 1
/*
================
=
= FixedMul
=
= Perform a signed 16.16 by 16.16 mutliply
================
*/
fixed_t FixedMul (fixed_t a, fixed_t b)
{
/* this code is very slow, but exactly simulates the proper assembly */
/* operation that C doesn't let you represent well */
int sign;
unsigned a1,a2,b1,b2;
unsigned c;
sign = a^b;
if (a<0)
a = -a;
if (b<0)
b = -b;
a1 = a&0xffff;
a2 = (unsigned)a>>16;
b1 = b&0xffff;
b2 = (unsigned)b>>16;
c = (a1*b1) >> 16;
c += a2*b1;
c += b2*a1;
c += (b2*a2)<<16;
if (sign < 0)
c = -c;
return c;
}
/*
================
=
= FixedDiv
=
= Perform a signed 16.16 by 16.16 divide (a/b)
================
*/
fixed_t FixedDiv (fixed_t a, fixed_t b)
{
/* this code is VERY slow, but exactly simulates the proper assembly */
/* operation that C doesn't let you represent well */
unsigned aa,bb,c;
unsigned bit;
int sign;
sign = a^b;
if (a<0)
aa = -a;
else
aa = a;
if (b<0)
bb = -b;
else
bb = b;
if ( (aa>>14) >= bb)
return sign<0 ? MININT : MAXINT;
bit = 0x10000;
while (aa > bb)
{
bb <<= 1;
bit <<= 1;
}
c = 0;
do
{
if (aa >= bb)
{
aa -=bb;
c |= bit;
}
aa <<=1;
bit >>= 1;
} while (bit && aa);
if (sign < 0)
c = -c;
return c;
}
#endif
/*
==============================================================================
TEXTURE MAPPING CODE
==============================================================================
*/
byte *framebuffer_p;
/*
==================
=
= I_DrawColumn
=
= Source is the top of the column to scale
=
==================
*/
void I_DrawColumn (int dc_x, int dc_yl, int dc_yh, int light, fixed_t frac, fixed_t fracstep, inpixel_t *dc_source)
{
int count;
pixel_t *dest;
count = dc_yh - dc_yl;
if (count < 0)
return;
#ifdef RANGECHECK
if ((unsigned)dc_x >= SCREENWIDTH || dc_yl < 0 || dc_yh >= SCREENHEIGHT)
I_Error ("R_DrawColumn: %i to %i at %i", dc_yl, dc_yh, dc_x);
#endif
dest = (pixel_t *)(framebuffer_p + dc_yl*320 + dc_x*2);
do
{
*dest = dc_source[(frac>>FRACBITS)&127];
dest += SCREENWIDTH;
frac += fracstep;
} while (count--);
}
/*
================
=
= I_DrawSpan
=
================
*/
void I_DrawSpan (int ds_y, int ds_x1, int ds_x2, int light, fixed_t ds_xfrac, fixed_t ds_yfrac, fixed_t ds_xstep, fixed_t ds_ystep, inpixel_t *ds_source)
{
fixed_t xfrac, yfrac;
pixel_t *dest;
int count, spot;
#ifdef RANGECHECK
if (ds_x2 < ds_x1 || ds_x1<0 || ds_x2>=SCREENWIDTH
|| (unsigned)ds_y>SCREENHEIGHT)
I_Error ("R_DrawSpan: %i to %i at %i",ds_x1,ds_x2,ds_y);
#endif
xfrac = ds_xfrac;
yfrac = ds_yfrac;
dest = (pixel_t *)(framebuffer_p + ds_y*320 + ds_x1*2);
count = ds_x2 - ds_x1;
do
{
spot = ((yfrac>>(16-6))&(63*64)) + ((xfrac>>16)&63);
*dest++ = ds_source[spot];
xfrac += ds_xstep;
yfrac += ds_ystep;
} while (count--);
}
/*=========================================================================== */
/*
====================
=
= I_Update
=
= Display the current framebuffer
= If < 1/15th second has passed since the last display, busy wait.
= 15 fps is the maximum frame rate, and any faster displays will
= only look ragged.
=
= When displaying the automap, use full resolution, otherwise use
= wide pixels
====================
*/
#define GPULINE (BASEORGY+SCREENHEIGHT+1)
int lastticcount;
int lasttics;
extern pixel_t shadepixel;
void I_Update (void)
{
int *worklist_p; /* list currently being built */
unsigned link;
unsigned pwidth;
unsigned temp;
int delta;
/* */
/* set up new list */
/* */
workingscreen = screens[workpage];
worklist_p = listbuffers[worklist];
workpage ^= 1;
worklist ^= 1;
/* make working visible now */
delta = (byte *)worklist_p - (byte *)listbuffer;
/* */
/* stupid branch objects */
/* */
link = (int)stopobj>>3;
worklist_p[0] = link>>8;
worklist_p[1] = (link<<24) + 0x00008fdb; /* first branch object */
worklist_p[2] = link>>8;
worklist_p[3] = (link<<24) + 0x000040cb; /* second branch object */
/* */
/* branch < gpuline */
/* */
link = (int)( (byte *)&worklist_p[12] - delta)>>3;
worklist_p[4] =
(link>>8); /* link */
worklist_p[5] =
(link<<24) /* link */
+ (1<<14) /* branch ypos > VC */
+ (224<<14) /* height */
+ (GPULINE<<4) /* ypos */
+ 3; /* branch type */
/* */
/* branch > gpuline */
/* */
worklist_p[6] =
(link>>8); /* link */
worklist_p[7] =
(link<<24) /* link */
+ (2<<14) /* branch ypos < VC */
+ (224<<14) /* height */
+ (GPULINE<<4) /* ypos */
+ 3; /* branch type */
/* */
/* gpu object */
/* */
worklist_p[8] = 0;
worklist_p[9] =
((GPULINE)<<4) /* ypos */
+ 2; /* gpu type */
/* */
/* nop branch */
/* */
link = (int)stopobj>>3;
worklist_p[10] = link>>8;
worklist_p[11] = (link<<24) + 0x00008fdb; /* first branch object */
/* */
/* background object */
/* */
/* skip the color add object if it doesn't do anything */
if (shadepixel)
link = (int)( (byte *)&worklist_p[16] - delta)>>3;
else
link = (int)( (byte *)&worklist_p[20] - delta)>>3;
pwidth = SCREENWIDTH/4;
worklist_p[12] =
((int)workingscreen<<8) /* data pointer */
+ (link>>8); /* link */
worklist_p[13] =
(link<<24) /* link */
+ (SCREENHEIGHT<<14) /* height */
+ (BASEORGY<<4) /* ypos */
+ 0; /* bitmap type */
worklist_p[14] =
(0<<(49-32)) /* firstpix */
+ (0<<(48-32)) /* release */
+ (0<<(47-32)) /* transparent */
+ (0<<(46-32)) /* add to buffer */
+ (0<<(45-32)) /* reflect */
+ (0<<(38-32)) /* color index */
+ ((pwidth)>>4); /* iwidth */
temp =
((pwidth)<<28) /* iwidth */
+ ((pwidth)<<18) /* dwidth */
+ (1<<15) /* pitch */
+ (4<<12) /* depth */
+ BASEORGX; /* xpos */
worklist_p[15] = temp;
/* */
/* color add object */
/* */
link = (int)( (byte *)&worklist_p[20] - delta)>>3;
worklist_p[16] =
((int)screenshade<<8) /* data pointer */
+ (link>>8); /* link */
worklist_p[17] =
(link<<24) /* link */
+ (180<<14) /* height */
+ ((BASEORGY)<<4) /* ypos */
+ 0; /* bitmap type */
worklist_p[18] =
(0<<(49-32)) /* firstpix */
+ (0<<(48-32)) /* release */
+ (0<<(47-32)) /* transparent */
+ (1<<(46-32)) /* add to buffer */
+ (0<<(45-32)) /* reflect */
+ (0<<(38-32)) /* color index */
+ (40>>4); /* iwidth */
worklist_p[19] =
(40<<28) /* iwidth */
+ (0<<18) /* dwidth */
+ (0<<15) /* pitch */
+ (4<<12) /* depth */
+ BASEORGX; /* xpos */
/* */
/* status bar background */
/* */
link = (int)( (byte *)&worklist_p[24] - delta)>>3;
pwidth = 320/8;
worklist_p[20] =
((int)sbar->data<<8) /* data pointer */
+ (link>>8); /* link */
worklist_p[21] =
(link<<24) /* link */
+ (sbar->height<<14) /* height */
+ ((BASEORGY+SCREENHEIGHT+1)<<4) /* ypos */
+ 0; /* bitmap type */
worklist_p[22] =
(0<<(49-32)) /* firstpix */
+ (0<<(48-32)) /* release */
+ (0<<(47-32)) /* transparent */
+ (0<<(46-32)) /* add to buffer */
+ (0<<(45-32)) /* reflect */
+ (0<<(38-32)) /* color index */
+ ((pwidth)>>4); /* iwidth */
worklist_p[23] =
((pwidth)<<28) /* iwidth */
+ ((pwidth)<<18) /* dwidth */
+ (1<<15) /* pitch */
+ (3<<12) /* depth */
+ BASEORGX*2; /* xpos */
/* */
/* status bar foreground */
/* */
/* skip debug screen if not active */
if (debugscreenactive)
link = (int)( (byte *)&worklist_p[28] - delta)>>3;
else
link = (int)stopobj>>3;
worklist_p[24] =
((int)sbartop<<8) /* data pointer */
+ (link>>8); /* link */
worklist_p[25] =
(link<<24) /* link */
+ (sbar->height<<14) /* height */
+ ((BASEORGY+SCREENHEIGHT+1)<<4) /* ypos */
+ 0; /* bitmap type */
worklist_p[26] =
(0<<(49-32)) /* firstpix */
+ (0<<(48-32)) /* release */
+ (1<<(47-32)) /* transparent */
+ (0<<(46-32)) /* add to buffer */
+ (0<<(45-32)) /* reflect */
+ (0<<(38-32)) /* color index */
+ ((pwidth)>>4); /* iwidth */
worklist_p[27] =
((pwidth)<<28) /* iwidth */
+ ((pwidth)<<18) /* dwidth */
+ (1<<15) /* pitch */
+ (3<<12) /* depth */
+ BASEORGX*2; /* xpos */
/* */
/* debug screen object */
/* */
link = (int)stopobj>>3;
pwidth = 256/64;
worklist_p[28] =
((int)debugscreen<<8) /* data pointer */
+ (link>>8); /* link */
worklist_p[29] =
(link<<24) /* link */
+ (216<<14) /* height */
+ ((BASEORGY)<<4) /* ypos */
+ 0; /* bitmap type */
worklist_p[30] =
(0<<(49-32)) /* firstpix */
+ (0<<(48-32)) /* release */
+ (1<<(47-32)) /* transparent */
+ (0<<(46-32)) /* add to buffer */
+ (0<<(45-32)) /* reflect */
+ (0x70<<(38-32)) /* color index */
+ (pwidth>>4); /* iwidth */
worklist_p[31] =
(pwidth<<28) /* iwidth */
+ (pwidth<<18) /* dwidth */
+ (1<<15) /* pitch */
+ (0<<12) /* depth */
+ BASEORGX; /* xpos */
/* */
/* wait until on the third tic after last display */
/* */
do