-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoctis-0.cpp
6441 lines (5688 loc) · 171 KB
/
noctis-0.cpp
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
/*
Noctis.
-------
Primo programma pi— serioso del solito, che rovina la sana (ehm...)
manifestazione informatica delle mie follie, pur senza tradirla
del tutto. Oh yes.
Noctis: il popolo dei gatti.
----------------------------
Spazio: ultima frontiera.
Questi sono i viaggi delle zattere cosmiche del popolo felino.
La loro missione (missione?) Š quella di esplorare strani, nuovi
mondi, alla ricerca di un territorio da conquistare, eliminando
eventuali nuove forme di vita o nuove civilt…, per arrivare l…
dove nessun gatto Š mai giunto prima.
Storia.
-------
Complicata. Il programma Š complicato: forse un po' troppo,
comunque pi— del solito. Se non trover• un modo di farlo
digerire al compilatore (siamo a 6900 righe solo con
il sorgente principale), dovr• modulizzarlo (mai fatto prima,
molto laborioso e molto antipatico) oppure trovarmi un altro
compilatore. Sono attivi: astrozattere, stelle e pianeti,
gestore di bordo, riflessi dell'utente, superfici dei
pianeti abitabili, rumori atmosferici principali
(vento, pioggia, tuoni). E' abbozzato, ma fermo,
il controllo degli eventi: in lavorazione il
proiettore fationico. -> 27.1.97
-------
Il programma Š stato spezzato in due moduli. -> 28.1.97
Modulo delle funzioni di base di Noctis.
----------------------------------------
Il progetto Š costituito da NOCTIS-0.CPP, NOCTIS.CPP,
pi— un file includente definizioni comuni ai due moduli.
*/
#include "noctis-d.h"
#include "noctis-2.h"
#include "defs.h"
#include <dir.h>
/*
Dati e funzioni specifiche importate da ASSEMBLY.H
*/
int QUADWORDS = 16000;
unsigned char far * adaptor = (unsigned char far *) 0xA0000000;
unsigned char far * adapted = (unsigned char far *) 0xB0000000;
unsigned char tmppal[768];
char return_palette[768];
char surface_palette[768];
int lstri (char *stri)
{
// misura una stringa e la copia su tmppal.
// Š una funzione di supporto per "reach_your_dir"
int c;
for (c=0; c<768; c++) {
if (stri[c])
tmppal[c] = stri[c];
else {
tmppal[c] = '\0';
return (c);
}
}
return (0);
}
void reach_your_dir ()
{
// Si posiziona nella vera directory in cui attualmente si trova
// il programma, al di l… di quale sia quella di lavoro corrente.
int c;
char d;
c = lstri(_argv[0]) - 1;
while (c>=0&&tmppal[c]!='\\') c--;
if (c>=0) {
if (tmppal[c-1] != ':')
tmppal[c] = 0;
else
tmppal[c+1] = 0;
}
if (_argv[0][0]>='a'&&_argv[0][0]<='z')
d = _argv[0][0] - 'a';
else
d = _argv[0][0] - 'A';
asm {
pusha
mov dl, d
mov ah, 0x0e
int 0x21
mov ah, 0x3b
lea dx, tmppal
int 0x21
popa
}
}
void _320_200_256 () // inizializza grafica a 320x200x256 colori.
{
asm {
push ax
mov ax, 0x13
int 0x10
pop ax
}
}
void _80_25_C () // modo grafico 80x25 testo a colori.
{
asm {
push ax
mov ax, 3
int 0x10
pop ax
}
}
int attendi_pressione_tasto () // aspetta un tasto e d qual'Š.
{
unsigned char ritorno;
asm {
push ax
mov ah, 8
int 0x21
mov ritorno, al
pop ax
}
return (ritorno);
}
int tasto_premuto () // torna 1 se c'Š un tasto premuto da estrarre.
{
asm {
push ax
mov ah, 0xb
int 0x21
cmp al, 0xff
pop ax
jne Stop
}
return (1);
Stop:
return (0);
}
unsigned char range8088[64*3] = {
0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5,
6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11,
12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17,
18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23,
24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29,
30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 35,
36, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41,
42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 46, 47, 47, 47,
48, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 53,
54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 59,
60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63 };
void tavola_colori (unsigned char *nuova_tavolozza,
unsigned colore_di_partenza, unsigned nr_colori,
char filtro_rosso, char filtro_verde, char filtro_blu)
{
int c, cc = 0;
unsigned temp;
nr_colori *= 3;
colore_di_partenza *= 3;
c = colore_di_partenza;
while (cc<nr_colori) {
tmppal[c] = nuova_tavolozza[cc];
cc++;
c++;
}
c = colore_di_partenza;
while (c<nr_colori+colore_di_partenza) {
temp = tmppal[c];
temp *= filtro_rosso;
temp /= 63;
if (temp > 63) temp = 63;
tmppal[c] = temp;
c++;
temp = tmppal[c];
temp *= filtro_verde;
temp /= 63;
if (temp > 63) temp = 63;
tmppal[c] = temp;
c++;
temp = tmppal[c];
temp *= filtro_blu;
temp /= 63;
if (temp > 63) temp = 63;
tmppal[c] = temp;
c++;
}
asm {
push si
push ax
push cx
push dx
mov cx, colore_di_partenza
add cx, nr_colori
lea si, tmppal
mov ax, seg tmppal
mov ds, ax
mov dx, 0x3c8
mov al, 0
out dx, al
inc dx
}
dzap: asm {
mov al, [si]
out dx, al
inc si
loop dzap
pop dx
pop cx
pop ax
pop si
}
}
/* Lettura del mouse e ritorno nelle variabili indicate. */
int mdltx = 0, mdlty = 0, mx = 0, my = 0, mpul = 0;
void mouse_input ()
{
asm {
push ax
push bx
push cx
push dx
mov ax, 0xb
int 0x33
push cx
push dx
mov ax, 5
int 0x33
pop dx
pop cx
mov mdltx, cx
mov mdlty, dx
add mx, cx
add my, dx
cmp ax, 0
je non_imp
mov mpul, ax
}
non_imp:asm {
pop dx
pop cx
pop bx
pop ax
}
}
// Verifica della presenza del mouse (o del supporto per esso).
// Ed inizializzazione del driver (svuotamento del buffer dei movimenti).
char test_and_init_mouse ()
{
asm {
xor ax, ax
int 33h
cmp ax, 0
jne ok
}
return (0);
ok: asm {
pusha
mov ax, 0xb
int 0x33
mov ax, 5
int 0x33
popa
}
return (1);
}
// Ultraveloce copia di pagina grafica.
void pcopy (unsigned char far *dest, unsigned char far *sorg)
{
asm {
push si
push di
push ds
push es
push cx
cld
mov cx, QUADWORDS
lds si, dword ptr sorg
les di, dword ptr dest
db 0xf3 // macro: rep movsd
db 0x66
db 0xa5
pop cx
pop es
pop ds
pop di
pop si
}
}
// Ultraveloce cancella pagina grafica.
void pclear (unsigned char far *target, unsigned char pattern)
{
asm {
push di
push es
push cx
push ax
cld
les di, dword ptr target
mov cx, QUADWORDS
mov al, pattern
mov ah, pattern
db 0x66 // macro: shl eax, 16
db 0xc1
db 0xe0
db 0x10
mov al, pattern
mov ah, pattern
db 0xf3 // macro: rep stosd
db 0x66
db 0xab
pop ax
pop cx
pop es
pop di
}
}
// Copia un'area rettangolare.
void areacopy (unsigned char far *dest, unsigned char far *sorg,
int x, int y, int l, int h)
{
unsigned p;
p = 320 * y + x;
asm { push ds
push es
pusha
cld
lds si, dword ptr sorg
les di, dword ptr dest
add si, p
add di, p }
ac_nextl: asm { push si
push di
mov cx, l
shr cx, 2
jcxz ac_bytes
db 0xf3 // rep movsd
db 0x66
db 0xa5 }
ac_bytes: asm { mov cx, l
and cx, 3
jcxz ac_endl
rep movsb }
ac_endl: asm { pop di
pop si
add si, 320
add di, 320
dec h
jnz ac_nextl
popa
pop es
pop ds }
}
// Cancella un'area rettangolare.
// Esegue tutti i clipping necessari per l'MCGA.
// O si specificano X2 ed Y2, o si specificano L ed H:
// in ogni modo, i valori non usati vanno lasciati a zero.
void areaclear (unsigned char far *dest, int x, int y,
int x2, int y2, int l, int h, unsigned char pattern)
{
unsigned p;
if (x<0) x = 0;
if (y<0) y = 0;
if (x2>=320) x2 = 319;
if (y2>=200) y2 = 199;
if (x2>0) l = x2 - x;
if (y2>0) h = y2 - y;
if (x+l>=320) l = 320 - x;
if (y+h>=200) h = 200 - y;
if (l<1 || h<1) return;
p = 320 * y + x;
asm { push es
pusha
pushf
cld
les di, dword ptr dest
add di, p
mov al, pattern
db 0x66; shl ax, 8
mov al, pattern
db 0x66; shl ax, 8
mov al, pattern
db 0x66; shl ax, 8
mov al, pattern }
ac_nextl: asm { push di
mov cx, l
shr cx, 2
jcxz ac_bytes
db 0xf3 // rep stosd
db 0x66
db 0xab }
ac_bytes: asm { mov cx, l
and cx, 3
jcxz ac_endl
rep stosb }
ac_endl: asm { pop di
add di, 320
dec h
jnz ac_nextl
popf
popa
pop es }
}
/*
Altro gioiellino: smussa lo schermo, attenuando il contrasto dei
bordi con un procedimento di media su 4 x 4 pixels.
Occhio al trucco: normalmente ci sarebbero 16 addizioni e una
divisione (per 16) da fare, per ogni punto.
Col trucco, invece, bastano quattro addizioni a 32 bit,
altre quattro a 8 bit, pi— un paio di shifts ed un and logico su edx.
Normale: 16 + 42 = 58 cicli.
Truccato: 8 + 4 = 12 cicli.
Piuttosto ovvio: la tavola dei colori dev'essere una sfumatura unica
e compatta, da far rientrare nei primi 64 registri del video DAC;
il colore zero Š il pi— tenue, il 63 quello pi— brillante.
Nota: la procedura pu• essere reiterata per ottenere
una maggiore attenuazione.
*/
void psmooth_grays (unsigned char far *target)
{
asm { pusha
push ds
mov cx, QUADWORDS
shl cx, 2
mov ax, 320
shl ax, 2
sub cx, ax
lds di, dword ptr target
add di, 320 }
smooth: asm { db 0x66; mov dx, [di-320]
db 0x66; add dx, [di]
db 0x66; add dx, [di+320]
db 0x66; add dx, [di+640]
/* and edx, 11111100111111001111110011111100b */
db 0x66, 0x81, 0xE2, 0xFC, 0xFC, 0xFC, 0xFC
db 0x66; shr dx, 2
mov al, dl
add al, dh
db 0x66; shr dx, 16
add al, dl
add al, dh
shr al, 2
mov [di], al }
next: asm { inc di
dec cx
jnz smooth
pop ds
popa }
}
/* Produce un effetto di dissolvenza al nero, molto rapido. */
void pfade (unsigned char far *target, unsigned segshift, unsigned char speed)
{
asm { pusha
push ds
mov cx, QUADWORDS
sub cx, 80
shl cx, 2
lds ax, dword ptr target
mov ax, ds
add ax, segshift
mov ds, ax
mov ah, speed
xor di, di }
fader: asm { mov al, [di]
and al, 0x3F
sub al, ah
jnc store
xor al, al }
store: asm { mov [di], al
inc di
dec cx
jnz fader
pop ds
popa }
}
/* Versione a colori: 4 sfumature di 64 intensit… ciascuna. */
/*void psmooth_64 (unsigned char far *target, unsigned segshift)
{
asm { pusha
push ds
mov si, QUADWORDS
sub si, 80
shl si, 2
lds ax, dword ptr target
mov ax, ds
add ax, segshift
mov ds, ax
xor di, di }
smooth: asm { mov al, [di+320]
mov cl, [di+640]
mov ah, [di+960]
mov bl, [di+639]
and ax, 0x3F3F
mov bh, [di+641]
and bx, 0x3F3F
add ax, bx
and cl, 0xC0
add al, ah
shr al, 2
inc di
or al, cl
dec si
mov [di-1], al
jnz smooth
pop ds
popa }
}*/
void psmooth_64 (unsigned char far *target, unsigned segshift)
{
asm { pusha
push ds
mov si, QUADWORDS
sub si, 80
shl si, 2
lds ax, dword ptr target
mov ax, ds
add ax, segshift
mov ds, ax
xor di, di }
smooth: asm { mov ax, [di+320]
mov bx, [di+640]
and ax, 0x3F3F
and bx, 0x3F3F
mov cl, [di+320]
add ax, bx
and cl, 0xC0
add al, ah
inc di
shr al, 2
or al, cl
dec si
mov [di-1], al
jnz smooth
pop ds
popa }
}
/* Versione circolare del procedimento di smoothing */
void smootharound_64 (unsigned char far *target, long cx, long cy, long r, char diffuse)
{
long x1 = cx - r, y1 = cy - r;
long x2 = cx + r, y2 = cy + r;
long px, py, rs = r*r;
unsigned cp;
if (r <= 0) return;
if (x1 > 318) return;
if (y1 > 198) return;
if (y1 < 0) y1 = 0;
if (x2 < 0) return;
if (x2 > 318) x2 = 318;
if (y2 < 0) return;
if (y2 > 198) y2 = 198;
py = -r;
while (y1 <= y2) {
px = -r;
x1 = cx - r;
if (x1 < 0) {
px -= x1;
x1 = 0;
}
cp = (320 * y1) + x1;
if (diffuse) {
while (x1 <= x2) {
if (px*px + py*py < rs) {
asm { les di, dword ptr target
add di, cp
mov ax, es:[di]
mov cx, ax
mov bx, es:[di+320]
mov dx, bx
and ax, 0x3F3F
and bx, 0x3F3F
add ax, bx
and cx, 0xC0C0
add al, ah
and dx, 0xC0C0
shr al, 2
mov ah, al
mov bx, ax
or ax, cx
or bx, dx
mov es:[di], ax
mov es:[di+320], bx }
}
cp++;
px++;
x1++;
}
}
else {
while (x1 <= x2) {
if (px*px + py*py < rs) {
asm { les di, dword ptr target
add di, cp
mov ax, es:[di]
mov bx, es:[di+320]
mov cl, al
and ax, 0x3F3F
and bx, 0x3F3F
and cl, 0xC0
add ax, bx
add al, ah
shr al, 2
or al, cl
mov es:[di], al }
}
cp++;
px++;
x1++;
}
}
py++;
y1++;
}
}
// Usando 64 livelli in 4 sfumature, porta lo schermo ad una sola sfumatura.
void mask_pixels (unsigned char far *target, unsigned char mask)
{
asm { pusha
push ds
mov bl, mask
mov bh, mask
db 0x66; shl bx, 16
mov bl, mask
mov bh, mask
mov ax, 0x3F3F
db 0x66; shl ax, 16
mov ax, 0x3F3F
mov cx, QUADWORDS
lds di, target }
mloop: asm { db 0x66; and word ptr [di], ax
db 0x66; add word ptr [di], bx
add di, 4
dec cx
jnz mloop
pop ds
popa }
}
/*
Inclusioni HSP.
*/
#include "tdpolygs.h" // 3d-Engine.
/*
Catalogo files di supporto.
*/
char *situation_file = "..\\DATA\\Current.BIN";
char *starmap_file = "..\\DATA\\StarMap.BIN";
char *goesoutputfile = "..\\DATA\\GOESfile.TXT";
char *surface_file = "..\\DATA\\Surface.BIN";
int sfh; // handle del file della situazione di superficie.
/*
Dati globali di continuit… (salvati e ripristinati).
*/
char sync = 1; // 0
char anti_rad = 1; // 1
char pl_search = 0; // 2
char field_amplificator = 0; // 3
char ilight = 63; // 4
char ilightv = 1; // 5
char charge = 3; // 6
char revcontrols = 0; // 7
char ap_targetting = 0; // 8
char ap_targetted = 0; // 9
char ip_targetting = 0; // 10
char ip_targetted = -1; // 11
char ip_reaching = 0; // 12
char ip_reached = 0; // 13
char ap_target_spin = 0; // 14
char ap_target_r = 0; // 15
char ap_target_g = 0; // 16
char ap_target_b = 0; // 17
char nearstar_spin = 0; // 18
char nearstar_r = 0; // 19
char nearstar_g = 0; // 20
char nearstar_b = 0; // 21
char gburst = 0; // 22
char menusalwayson = 1; // 23
char depolarize = 0; // 24
int sys = 4; // 25
int pwr = 20000; // 27
int dev_page = 0; // 29
int ap_target_class = 0; // 31
int f_ray_elapsed = 0; // 33
int nearstar_class = 0; // 35
int nearstar_nop = 0; // 37
float pos_x = 0; // 39
float pos_y = 0; // 43
float pos_z = -500; // 47
float user_alfa = 0; // 51
float user_beta = 0; // 55
float navigation_beta = 0; // 59
float ap_target_ray = 1000; // 63
float nearstar_ray = 1000; // 67
double dzat_x = +3797120; // 71
double dzat_y = -4352112; // 79
double dzat_z = -925018; // 87
double ap_target_x = 0; // 95
double ap_target_y = 1E8; // 103
double ap_target_z = 0; // 111
double nearstar_x = 0; // 119
double nearstar_y = 1E8; // 127
double nearstar_z = 0; // 135
double helptime = 0; // 143
double ip_target_initial_d= 1E8; // 151
double requested_approach_coefficient=1;// 159
double current_approach_coefficient = 1;// 167
double reaction_time = 0.01; // 175
char fcs_status[11] = "STANDBY"; // 183
int fcs_status_delay = 0; // 194
int psys = 4; // 196
double ap_target_initial_d= 1E8; // 198
double requested_vimana_coefficient = 1;// 206
double current_vimana_coefficient = 1; // 214
double vimana_reaction_time = 0.01; // 222
char lithium_collector = 0; // 230
char autoscreenoff = 0; // 231
char ap_reached = 0; // 232
int lifter = 0; // 233
double secs = 0; // 235
char data = 0; // 243
char surlight = 16; // 244
Word old_currentbin_length = 245;
//Additional variables: (SL and Mega)
Dword lastSnapshot = -1; //0
char option_mouseLook = 0; //4
Word new_currentbin_length = 5;
char fcs_status_extended[42] = "STANDBY";
/*
Dati di controllo per lo sbarco sulla superficie.
*/
char land_now = 0;
char landing_point = 0;
int landing_pt_lon = 0;
int landing_pt_lat = 60;
int crepzone;
int nightzone;
int sun_x_factor;
/*
Dati globali non salvati (deducibili da quelli salvati).
*/
char seconds[3], minutes[3], hours[3], day[3], month[3], year[5];
int epoc = 6011;
char ctb[512];
char dec[20];
char _delay = 12;
char stspeed = 0;
char bright;
char elight = 0;
unsigned gl_start = 0;
unsigned point;
unsigned vptr;
int infoarea = 0;
int s_control = 1;
int s_command = 0;
int isecs, p_isecs;
double fsecs;
int gl_fps = 1;
int fps = 1;
float dlt_alfa = 0;
float dlt_beta = 0;
float dlt_nav_beta = 0;
float step = 0;
float shift = 0;
double s_m = 1000;
double plx, ply, plz;
double pxx, pyy;
double delta_x, delta_y;
double nearstar_identity;
int nearstar_nob = 0, nearstar_labeled;
int npcs, resident_map1, resident_map2;
char ontheroof;
int datasheetscroll = 0;
int datasheetdelta = 0;
extern int movieexists;
extern char movie;
float moviefps;
/*
Dati costanti nel segmento globale.
*/
/* Alcuni ordinali (da 0 a 20) per determinate rappresentazioni.
Il corrispondente "zeresimo" Š infrequente ma si pu• usare: Š corretto. */
char *ord[21] = { "zeroth", "first", "second", "third", "fourth", "fifth",
"sixth", "seventh", "eight", "nineth", "tenth", "eleventh",
"twelveth", "thiteenth", "fourteenth",
"fifteenth", "sixteenth", "seventeenth",
"eighteenth", "nineteenth", "twentyth" };
char *star_description[star_classes] = {
"medium size, yellow star, suitable for planets having indigenous lifeforms.",
"very large, blue giant star, high energy radiations around.",
"white dwarf star, possible harmful radiations.",
"very large, ancient, red giant star.",
"large and glowing, orange giant star, high nuclear mass.",
"small, weak, cold, brown dwarf substellar object.",
"large, very weak, very cold, gray giant dead star.",
"very small, blue dwarf star, strong gravity well around.",
"possible MULTIPLE system - planets spread over wide ranges.",
"medium size, surrounded by gas clouds, young star.",
"very large and ancient runaway star, unsuitable for planets.",
"tiny pulsar object, unsafe, high radiation, strong gravity." };
char class_rgb[3*star_classes] = {
63, 58, 40,
30, 50, 63,
63, 63, 63,
63, 30, 20,
63, 55, 32,
32, 16, 10,
32, 28, 24,
10, 20, 63,
63, 32, 16,
48, 32, 63,
40, 10, 10,
00, 63, 63
};
int class_ray[star_classes] = { 5000, 15000, 300, 20000, 15000, 1000, 3000,
2000, 4000, 1500, 30000, 250 };
int class_rayvar[star_classes] = { 2000, 10000, 200, 15000, 5000, 1000, 3000,
500, 5000, 10000, 1000, 10 };
int class_act[star_classes] = { 2, 4, 1, 6, 5, 10, 100, 1, 2, 1, 10, 1 };
char class_planets[star_classes] = { 12, 18, 8, 15, 20, 3, 0, 1, 7, 20, 2, 5 };
char nearstar_p_type [maxbodies];
int nearstar_p_owner [maxbodies];
char nearstar_p_moonid [maxbodies];
double nearstar_p_ring [maxbodies];
double nearstar_p_tilt [maxbodies];
double nearstar_p_ray [maxbodies];
double nearstar_p_orb_ray [maxbodies];
double nearstar_p_orb_seed [maxbodies];
double nearstar_p_orb_tilt [maxbodies];
double nearstar_p_orb_orient [maxbodies];
double nearstar_p_orb_ecc [maxbodies];
int nearstar_p_rtperiod [maxbodies];
int nearstar_p_rotation [maxbodies];
int nearstar_p_term_start [maxbodies];
int nearstar_p_term_end [maxbodies];
int nearstar_p_qsortindex [maxbodies];
float nearstar_p_qsortdist [maxbodies];
char *planet_description[] = { "medium size, internally hot, unstable surface, no atmosphere.",
"small, solid, dusty, craterized, no atmosphere.",
"medium size, solid, thick atmosphere, fully covered by clouds.",
"medium size, felisian, breathable atmosphere, suitable for life.",
"medium size, rocky, creased, no atmosphere.",
"small, solid, thin atmosphere.",
"large, not consistent, covered with dense clouds.",
"small, solid, icy surface, no atmosphere.",
"medium size, surface is mainly native quartz, oxygen atmosphere.",
"very large, substellar object, not consistent.",
"companion star - not a planet" };
unsigned char planet_rgb_and_var[] = { 60, 30, 15, 20,
40, 50, 40, 25,
32, 32, 32, 32,
16, 32, 48, 40,
32, 40, 32, 20,
32, 32, 32, 32,
32, 32, 32, 32,
32, 40, 48, 24,
40, 40, 40, 30,
50, 25, 10, 20,
40, 40, 40, 40 };
int planet_possiblemoons[] = { 1, 1, 2, 3, 2, 2, 18, 2, 3, 20, 20 };
const double planet_orb_scaling= 5.0;
const double avg_planet_sizing = 2.4;
const double moon_orb_scaling = 12.8;
const double avg_moon_sizing = 1.8;
double avg_planet_ray[] = { 0.007, 0.003, 0.010, 0.011, 0.010,
0.008, 0.064, 0.009, 0.012, 0.125,
5.000 };
float mindiff = 0.01;
/*
Matrici video fisiche e logiche, cartografie,
ed altri blocchi di memoria...
*/
unsigned char far *s_background;
unsigned char far *p_background;
unsigned char huge *p_surfacemap;
quadrant far *objectschart;
unsigned char far *ruinschart; // come objectschart, ma dichiarato in bytes
unsigned char far *pvfile;