-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathHint.cpp
More file actions
7936 lines (7555 loc) · 173 KB
/
Hint.cpp
File metadata and controls
7936 lines (7555 loc) · 173 KB
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
#include "stdafx.h"
#include "UI.h"
#include "Dispatch.h"
//#include "Objects.h"
#include "CSB.h"
#include <stdio.h>
#undef wordGear
i16& wordGear(pnt A){return *((i16 *)A);}
i16& wordGear(unsigned char * A){return *((i16 *)A);};
#define testfornotimplemented false
#define HINTFILL(a,b) i8 fill##a[a-b];
#define MAXHINTINDICES 9
i32 ReadExtendedFeatures(i32 handle);
void RC4_prepare_key(unsigned char *key_data_ptr, i32 key_data_len);
extern bool ForcedScreenDraw;
extern char hintKey[8];
#pragma pack(1)
typedef pnt aReg;
//#define longGear(A) (*((i32 *)(A)))
//i32& longGear(pnt p);
//pnt& pntGear(pnt p);
//#define wordGear(A) (*((i16 *)(A)))
void StorePnt(pnt addr, pnt data);
ui8 *LoadPnt(aReg addr);
ui8 *LoadPnt(ui8 *addr);
i32 LoadLong(pnt addr);
i32 LoadLong(i32 *addr){return LoadLong((pnt)addr);};
void StoreLong(pnt addr, i32 data);
void StoreLong(i32 *addr, i32 data){StoreLong((pnt)addr, data);};
void info(char *, unsigned int);
#ifdef _MSVC_INTEL
i32 LE32(i32 lng);
#endif
struct S6
{
ui8 b0;
ui8 b1;
i16 w2;
i16 w4;
};
struct S12
{
i32 i0;
i16 w4;
i16 w6;
void (*pnt8)(pnt);
};
struct SS12
{
i32 i0;
i32 i4;
i32 (*pnt8)(i32, pnt);
};
struct T12
{
i8 b0;
i8 b1;
wordRectPos rectPos2;
i16 w10;
};
struct S20
{
i16 w0;
i8 b2;
i8 b3;
wordRectPos rectPos4;
i16 w12;
const char* pnt14;
i16 w18;
};
struct S18
{
pnt pnt0;
i32 i6;
pnt pnt10;
i32 i14;
i16 w4;
i16 unused;
};
struct TEXT
{
i16 w0;
char *pnt2;
wordRectPos rectPos6;
i16 w14;
i16 w16;
i16 w18;
i16 w20;
};
struct PAGE
{
i16 w0;
i16 w2;
i32 i4;
TEXT *pText8;
i32 i12;
};
struct NODE
{
PAGE *pPage0;
NODE *pNode4;
};
struct BOOK
{
i16 w0; //#pages?
NODE *pNode2; // node of first page
NODE *pNode6; // node of last page
};
struct S4076
{
i16 w0;
i8 FirstBlock2[512];
i8 SecondBlock514[128];
pnt pnt642;
pnt pnt646;
pnt pnt650;
pnt pnt654;
pnt pnt658;
pnt pnt662;
pnt pnt668;
pnt pnt672[16];
i8 Characters[3328];
pnt pnt4064;
pnt pnt4068;
pnt pnt4072;
HINTFILL(668,666)
//HINTFILL(670,666)
};
struct PALETTEPKT
{
i16 w0; //always 13?
i16 *pw2;
PALETTE *pPalette6;
i16 w10;
i16 w12;
i16 w14;
};
struct HCTI
{
pnt *pSeg1Addr;
pnt *pSeg2Addr;
pnt *pSeg3Addr;
i16 *pSeg1Len;
i16 *pSeg2Len;
i32 *pSeg3Len;
};
struct DATINDEX
{
i16 handle0;
i16 numSeg2;
i32 *fileOffsets4;
};
struct F {
pnt Pointer16908;
pnt Pointer16904;
pnt Pointer16900;
pnt Pointer16506[2];//set to logbase()
pnt Pointer15794;
pnt Pointer15080;
pnt Pointer15076;
BOOK *pBook14608[23]; //uses memory to 14516
//i16 rectPos14516[4];(use rectPos14516)
i16 (*Pointer14508)(i32, pnt, i16);
i32 Long14504;
i32 Long16876;
SS12 ss12_14498[1];
i32 Long14110;//VBLCnt copied here
//T12 t12_14106[12];(use t12_14106)
pnt Pointer13962[12];
i32 Long12814;//disguised code pointer???
i32 Long12810;//disguised code pointer???
DATINDEX *pDatIndex12802; //HCSB.DAT handle, numseg, offsets
pnt Pointer12798;
pnt Seg1Addr10550;
pnt Seg2Addr10546;
pnt Seg3Addr10542;
HCTI HCTi10514; //Three pointers to pointers (segment addresses)
//followed by three pointers to words (lengths)
i32 Seg3Len10534;
TEXT *pText10480;
TEXT *pText10476;
S4076 s4076_8816[2];
pnt Pointer9710[100];
pnt Pointer9310[100];
TEXT *Pointer652;
i32 Long288[3];
i16 *Pointer268;
pnt Pointer264;
i16 *Pointer260;
i16 *Pointer256;
i32 *Pointer252;
pnt Pointer248;
i16 **Pointer244;
i16 *Pointer218;
pnt Pointer214;
i16 *Pointer210;
i16 *Pointer206;
i16 (*Pointer184)(i16, i16);// initially MinA
i16 (*Pointer180)(i16, i16);// initially MinB
pnt Pointer136;
pnt Pointer132;
S18 s18_124[1];
// *************************************************
i16 Word16914;
i16 Word16912;
i16 Word16910;
i8 Byte16896[1];
HINTFILL(16895,16888)
//i32 VBLCnt16888; // (use VBLCount)
i16 Segment1_16872[50];//First segment of HCBS
//i32 Long16864; // part of Segment1_16872
//i16 Word16860; // part of Segment1_16872
//i16 Word16858; // part of Segment1_16872
//i16 Word16856; // part of Segment1_16872
//i16 Word16848; // part of Segment1_16872
//i16 Word16846; // part of Segment1_16872
//i16 Word16808; // part of Segment1_16872
//i16 Word16806; // part of Segment1_16872
//i16 Word16800; // part of Segment1_16872
PALETTE Palette16672;
PALETTE Palette16640;
PALETTE Palette16608;
//i8 Byte16544[16];(use byte16544)
//i8 Byte16528[16];(use byte16528)
//HINTFILL(16607,16508)
i16 Word16508;
i16 Word16498;
i16 Word16496;
//i16 Word16494[3];(use word16494)
//i16 Word16488[3];(use word16488)
//pnt Pointer16272[16];(use pText_16272)
//S20 s20_16208[1];(use s20_16208)
i8 Byte15808[1];
HINTFILL(15807,15794)
i8 Byte15788[1];
HINTFILL(15787,15708)
//i16 Word15708;//(use word15708)
i16 Word15706;
i16 Word15704;
i16 Word15702;
i16 Word15700;
i16 Word15698;
i16 Word15696;
i8 Byte15694;
i16 Word15072;
i16 Word15070;
i8 Byte15068[1];
HINTFILL(15067,15046)
i8 Byte15046[6];
HINTFILL(15040,15024)
//pnt Pointer15024[5];//(use text15024)
i16 Word14500;
i8 Byte14210[2];
i8 Byte14208[2];
//i16 Word14204;(use word14204)
//i16 Word14202;(use word14202)
//i16 Word14200;(use word14200)
i16 Word14198;
i16 Word14196;
i16 Word14194;
i16 Word14192;
S6 s6_14190[5]; //Keystroke queue???
S6 s6_14160;
HINTFILL(14156,14130)
//pnt *Pointer14130; (use pointer14130)
//i16 Word14126[7];(use word14126)
i16 Word14112;
//i8 Byte13914[1];(use byte13914)
HINTFILL(13913,13900)
i16 Word13900;
i16 Word13898;
i16 Word13896;
S6 s6_13884;
i16 Word13878;
i16 Word13876;
i16 Word13874;
i16 Word13870;
i16 Word13864;
i16 Word13862; //upper half of pointer into code
i16 Word13860; //lower half of pointer into code
i16 Word13858; //upper half of disassembled long at 12814
i16 Word13856; //lower half of disassembled long at 12814
i16 Word13852[1];
HINTFILL(13850,13596)
i16 Word13596;
HINTFILL(13594,13340)
i8 Byte13340[1];
HINTFILL(13339,13084)
i16 Word13084;
i16 Word13082;
HINTFILL(13080,12824)
i16 Word12824;
i16 Word12822;
i16 Word12820;
i16 Word12818;
i16 Word12804;
i8 Byte12792[2240];//Hints are expanded into this area.
//HINTFILL(12791,10552)
i16 NumHint10552; // #entries in HintIndices10530
i16 Seg1Len10538;
i16 Seg2Len10536;
i16 HintIndices10530[MAXHINTINDICES];
i16 Word10516;
i16 Word10486;
i16 CurPage10484;//page of current hint being displayed
i16 Word10482;
//i32 Long10472;(use long10472)
//i32 Long10468;(use long10468)
i16 Word10464;
i16 Word10462;
i16 Word8910;
//i16 Word8908;//use word8908
//i16 Word8906;//use word8906
//i16 Word8904;//use word8904
//i16 Word8902;//use word8902
i16 Word8900;
i8 Byte8898[12];
i16 Word8886;
i16 Word8884;
//i8 Byte8873;(use byte8873)
i16 Word8864;
i16 Word8862;
i16 Word8860;
//pnt Pointer8858[6];//use pointer8858[0]
//pnt Pointer8854;//use pointer8858[1]
//pnt Pointer8850;//use pointer8858[2]
//pnt Pointer8846;//use pointer8858[3]
//pnt Pointer8842;//use pointer8858[4]
//pnt Pointer8838;//use pointer8858[5]
i16 Word8818;
i16 Word664;
i16 Word662;
i8 Byte658;
HINTFILL(657,652)
i16 Word380[5];
i8 Byte370[32];
i16 Word338[17];
i16 Word304[8];
i8 Byte276[8];
i16 Word240;
i16 Word194;
i16 Word128;
i16 Word126;
};
F f;
#if defined _MSVC_INTEL || defined _MSVC_CE2002ARM
#pragma warning (disable:4305)
#pragma warning (disable:4309)
#endif
ui8 byte16544[16] ALIGN4 =
{
0x00,0x0a,0x14,0x1e,0x28,0x32,0x3c,0x46,
0x50,0x5a,0x64,0x6e,0x78,0x82,0x8c,0x96
};
ui8 byte16528[16] ALIGN4 =
{
0x00,0x0a,0x14,0x1e,0x28,0x32,0x3c,0x46,
0x50,0x5a,0x64,0x6e,0x5a,0x82,0x8c,0x96
};
i16 word16494[3] ALIGN4 = {0x700, 0x070, 0x007};
i16 word16488[3] ALIGN4 = {0x100, 0x010, 0x001};
//struct S20
//{
// i16 w0;
// i8 b2;
// i8 b3;
// wordRectPos rectPos4;
// i16 w12;
// pnt pnt14;
// i16 w18;
//};
S20 s20_16208[] ALIGN4 =
{
{0xd,0x01,0,0x7f,0x00c2,0xb3,0xc0,0x0,"LOAD" ,0x1},
{0xd,0x03,0,0x21,0x0064,0xb3,0xc0,0x0,"LAST" ,0x1},
{0xd,0x08,0,0x21,0x0064,0xb3,0xc0,0x0,"Dump" ,0x1},
{0xd,0x04,0,0x7f,0x00c2,0xb3,0xc0,0x0,"NEXT" ,0x1},
{0xd,0x05,0,0xdd,0x0121,0xb3,0xc0,0x0,"DONE" ,0x1},
{0xd,0x0a,0,0x28,0x0118,0x1e,0x2a,0x0,NULL ,0x2},
{0xd,0x0b,0,0x28,0x0118,0x2e,0x3a,0x0,NULL ,0x2},
{0xd,0x0c,0,0x28,0x0118,0x3e,0x4a,0x0,NULL ,0x2},
{0xd,0x0d,0,0x28,0x0118,0x4e,0x5a,0x0,NULL ,0x2},
{0xd,0x0e,0,0x28,0x0118,0x5e,0x6a,0x0,NULL ,0x2},
{0xd,0x0f,0,0x28,0x0118,0x6e,0x7a,0x0,NULL ,0x2},
{0xd,0x10,0,0x28,0x0118,0x7e,0x8a,0x0,NULL ,0x2},
{0xd,0x11,0,0x28,0x0118,0x8e,0x9a,0x0,NULL ,0x2},
{0xd,0x06,0,0x7f,0x00c2,0xb3,0xc0,0x0,"OK" ,0x1},
{0xd,0x02,0,0xdd,0x0121,0xb3,0xc0,0x0,"EXIT" ,0x1},
{0xd,0x00,0,0x00,0x0000,0x00,0x00,0x0,NULL ,0x0},
{0xd,0x07,0,0xdd,0x0121,0xb3,0xc0,0x0,"CANCEL",0x1},
{0xd,0x06,0,0x00,0x0021,0xb3,0xc0,0x0,NULL ,0x1},
{0x0,0x00,0,0x00,0x0000,0x00,0x00,0x0,NULL ,0x0},
{0x0,0x00,0,0x00,0x0000,0x00,0x00,0x0,NULL ,0x0}
};
#if defined _MSVC_INTEL || defined _MSVC_CE2002ARM
#pragma warning (default:4305)
#pragma warning (default:4309)
#endif
char str15692_0[] =
"Chaos Strikes Back/Hint Oracle//"
"Please insert a Chaos Strikes Back"
" saved game disk in drive A://Then press LOAD" ;
char str15692_1[] =
"Chaos Strikes Back/Hint Oracle//"
"Please insert a Chaos Strikes Back"
" saved game disk in drive B://Then press LOAD" ;
char str15692_2[] =
"Please insert a saved game disk in drive A:" ;
char str15692_3[] =
"Please insert a saved game disk in drive B:" ;
char str15692_4[] =
"There are no clues for this location." ;
char str15692_5[] =
"Chaos Strikes Back/Hint Oracle Version A//"
"Safe to turn system off." ;
char str15692_6[] =
"Please Insert The Chaos Strikes Back Utility"
" Disk in Drive A: " ;
char str15692_7[] =
"Disk Error/Please Try Again" ;
char str15692_8[] =
"Incorrect/or damaged saved game./"
"Retry with a new saved game." ;
TEXT text15024[9] ALIGN4 =
{
{3, str15692_0, 0x1f, 0x122, 0x32, 0x96, 1, 0, 0, 0},
{3, str15692_1, 0x1f, 0x122, 0x32, 0x96, 1, 0, 0, 0},
{3, str15692_2, 0x1f, 0x122, 0x46, 0x96, 1, 0, 0, 0},
{3, str15692_3, 0x1f, 0x122, 0x46, 0x96, 1, 0, 0, 0},
{3, str15692_4, 0x1f, 0x122, 0x46, 0x96, 1, 0, 0, 0},
{3, str15692_5, 0x1f, 0x122, 0x46, 0x96, 1, 0, 0, 0},
{3, str15692_6, 0x1f, 0x122, 0x46, 0x96, 1, 0, 0, 0},
{3, str15692_7, 0x1f, 0x122, 0x46, 0x96, 1, 0, 0, 0},
{3, str15692_8, 0x1f, 0x122, 0x46, 0x96, 1, 0, 0, 0}
};
TEXT *(pText16272[]) =
{
&text15024[0], //[0]16272
&text15024[1], //[1]16268
&text15024[2], //[2]16264
&text15024[3], //[3]16260
&text15024[4], //[4]16256
&text15024[5], //[5]16252
&text15024[6], //[6]16248
&text15024[6], //[7]16244
&text15024[7], //[8]16240
&text15024[7], //[9]16236
&text15024[7], //[10]16232
&text15024[7], //[11]16228
&text15024[7], //[12]16224
&text15024[7], //[13]16220
&text15024[7], //[14]16216
&text15024[8] //[15]16212
};
i16 word15708 = -1;
const char* pointer15024[5] =
{
"A:\\", "B:\\", "C:\\", "D:\\", "E:\\"
};
wordRectPos rectPos14516 = {0x0000, 0x013f, 0x0000, 0x00c7};
i16 word14204 = 0;
i16 word14202 = 4;
i16 word14200 = 1;
pnt pointer14154[6] = {NULL,NULL,NULL,NULL,NULL,NULL};
pnt *pointer14130 = pointer14154;
i16 word14126[7] = {0x4737,0x4838,0x4b34,0x4d36,0x5032,0x5230,0x532e};
T12 t12_14106[12];
struct CLICKMAP
{
i8 b0;
i8 b1;
T12 *pt12_2;
pnt *pPnt6;
pnt p10;
};
CLICKMAP clickMap13914 = {0x0a,0x00,t12_14106,f.Pointer13962,NULL};
i32 long10472 = 9999999;
i32 long10468 = 9999999;
i16 word8908 = 0x0014; //dd34
i16 word8906 = 0x0000; //dd36
i16 bitsPerCodeword = 0x0000; //word8904 = 0x0000; //dd38
i16 codewordMask = 0x000; //word8902 = 0x0000; //dd3a
i16 word8900 = 0x1000; //dd3c
ui8 byte8873[]= {0x00,0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f,0xff};
static const char *gameName;
const char* pointer8858[6] = {
"", //[0]8858
"", //[1]8854
"0hcsb.hct", //[2]8850
"0hcsb.dat", //[3]8846
"1CSBGAME.DAT", //[4]8842
"1CSBGAME.BAK" //[5]8838
};
extern ui32 VBLCount;
extern i32 NumberFloppyDrives;
extern i16 globalPalette[];
i16 dumpFile = -1;
void NotImplemented(i32);
void SetSupervisorMode();
void ClearSupervisorMode();
i32 READ(i32 file, i32 len, ui8 *buf);
i32 LSEEK(i32 offset, i32 file, i32 origin);
i16 CLOSE(i32 handle);
ui8 *MALLOC(i32 size);
void MFREE(ui8 *);
pnt GETDTA();
void SETDTA(pnt);
i16 drvmap(); //Bios function TRAP #13
void StrCpy(char *dst, const char *src);//TAG003264
i32 atari_sprintf(char *,const char*, i32, i32=0, i32=0);//TAG0065e0
void MemoryMove(ui8 *src, ui8 *dst, i16, i16, i32);//like MemMove
ui8 *physbase();
ui8 *logbase();
void setscreen(ui8 *logaddr, ui8 *physaddr, i16 res);
#define wvbl(n) CALL0(n,wvbl)
void setpalette(PALETTE *palette);
void ForceScreenDraw();
void ShrinkBLT(ui8 *src,
ui8 *dst,
i32 srcWidth,
i32 srcHeight,
i32 dstWidth,
i32 dstHeight,
ui8 *colorMap);
void TAG0088b2(ui8 *src,
ui8 *dst,
RectPos *dstPos, // Position in dest image
i32 SrcOffsetX, // Source Starting x Pixel Offset
i32 SrcOffsetY, // Source Starting y Pixel Offset
i32 SrcByteWidth, // #bytes per line in source bitmap
i32 DestByteWidth, // #bytes per line in destination bitmap
i32 P8);
i16 Unscramble(ui8 *buf, i32 initialChecksum, i32 numword);
void ExpandRectangle(wordRectPos *, wordRectPos *, i16, i16);
class FILE_DESCRIPTOR
{
public:
i16 word0;
i16 fileHandle; //word2
i16 word4;
i16 word6;
i16 word8;
char byte10[1]; //Don't know how big
char xxbyte11[14-11];
i32 long14;
i32 long18;
char byte22[1]; //Don't know how big. Error message?
char xxbyte23[82-23];
pnt pointer82;
i32 long86;
pnt pointer90;
i32 long94;
char byte98[1]; //Don't know how big.
char xxbyte99[104-99];
char byte104[1];//Don't know how big
char xxbyte105[116-105];
i16 word116;
i16 word118;
i32 long120;
};
FILE_DESCRIPTOR *FindFileDescriptor(i32 FDnum);//TAG000450(i32);
i32 TAG0004b6(i32, FILE_DESCRIPTOR *);//TAG0004b6(i32, pnt);
i32 TAG000606(i16, i16, i16);
void TAG000678(pnt, pnt, i32);
i16 TAG0006bc(pnt, pnt, i16);
void TAG0006f8(FILE_DESCRIPTOR *, i16, i16);//TAG0006f8(pnt, i16, i16);
i16 GetAvailFloppyMap();//TAG00073c
i32 TAG000784(i16, i32 *);
i32 TAG0008c4(FILE_DESCRIPTOR *pFD);//TAG0008c4(pnt);
i16 TAG000956(FILE_DESCRIPTOR *);//TAG000956(pnt);
i32 TAG000b46(i16, FILE_DESCRIPTOR *pFD);//TAG000b46(i16, pnt);
i32 OpenHelpFile(FILE_DESCRIPTOR *pFD);//TAG000bd2(pnt);
void TAG000f50(i16);
void TAG001006();
i16 TAG00101c();
void TAG001064(i16);
i32 TAG001096_2(i16);
i32 ReadFile(i16);//TAG001096_7
i32 FileSeek(i16);//TAG001096_9
i32 TAG001096_10(i16);
i32 TAG001096_11(i16);
i32 TAG001096_22(i16);
void SetFileName(i32, pnt);//TAG0015d6_2
void SetBufferAddress(i16, pnt);//TAG0015d6_8
void SetBufferLength(i16, i32);//TAG0015d6_16
void TAG0015d6_128(i16, i32);
void SetDriveName(i32, i32);//TAG0015d6_256
i32 TAG00181e(i16);
i16 TAG001840(i32, pnt, i16);
void TAG00187e();
i32 TAG001896();
i32 TAG00189c(i16, i32, const char*);
i16 TAG001964(i16, i32, i32, i32 (*)(i32, pnt));
i16 TAG001a32(pnt, i16, i16);
void ClearKeyboard();//TAG001a6a
i16 TAG001a9e(pnt, i16, i16, i16);
void TAG001afe(i32, i32, i32);
void TAG001bee();
void TAG001c0c(i32);
i16 EnableButtons(CLICKMAP *);
void TAG001ec0(pnt,pnt,wordRectPos *,i16,i16,i16,i16,i16);
void ExpandGraphic(i8 *, ui8 *, i16, i16, i32 maxSize);//TAG00227a
void TAG0025a0(ui8 *,ui8 *,i16,i16,i16,i16,ui8 *);
void TAG002798(ui8 *, wordRectPos *, i16, i16);
void TAG0029de();
void TAG002a2a();
void TAG002a5a(i16);
void TAG002ae4();
void TAG002af4();
void TAG002b0c();
void TAG002b3c(i16, i16);
void TAG002b5c(i16, i16);
void TAG002bf4();
void TAG002c1a();
i32 TAG002c5e(pnt P1,pnt P2,pnt P3);
void TAG002e64();
i32 ReadDatSeg(pnt, i16);//TAG002eb8
i32 TAG002f6c(ui8 *P1, i16 P2, i16 P3, i16 P4);
i32 TAG003006(ui8 *P1, i16 P2);
i32 LZWRawChar(i16 P1, i32 *P2);//TAG003022
void TAG003194(i16, pnt *);
i32 TAG003210(i16 handle, // @8
i32 fileSize, // @10
pnt rsltAddr, // @14
pnt tmpBuf1, // @18
pnt tmpBuf2); // @22
void TAG00339e(wordRectPos *, i16);
//void TAG003444(i16 *, pnt); StrCpy
i16 StrLen(const char *);//TAG0034a2
//void TAG0034c6(pnt, pnt, pnt);//(Use TAG0065e0)
pnt TAG0035e6(pnt);
S18 *TAG00360a(pnt);
void TAG00364c(pnt, S18 *);
void TAG003682(pnt, S18 *);
void TAG0036e4(pnt, i32, S18 *);
void TAG003720(pnt, i32, S18 *);
pnt TAG003788(i32, S18 *, i16 *);
i16 TAG003b3a(S18 *, i32);
pnt TAG003c50(i16);
pnt TAG003cf6(pnt *);
pnt TAG003f82(S12 *);
void TAG003d9e(pnt);
S18 *TAG003df0(S12 *);
pnt TAG003efc(i32, i16, S18 *);
void TAG00404c(pnt, S18 *);
i16 TAG004078(i16, i16);
void TAG00418a();
pnt TAG00419a(i32, i16);
i32 TAG0041c8(pnt);
pnt TAG00421e(pnt);
void TAG004254(pnt);
i32 TAG004316(pnt);
//void TAG0047c2(pnt, pnt, i16, i16, i32);//MemoryMovevoid y
void ClearMemory(ui8 *dest, i32 numByte); // TAG0048de(i32 *, i32);
void TAG004962(i16, i16, pnt);
i32 TAG0049fe(TEXT *,i32,i32);
pnt TAG004a22_14(i16 P1);
pnt TAG004a22_16(i16 P1, i32 nP2);
// TAG004a22_20
void Free_TEXT(i16 P1, TEXT *nP2);
void TAG004a22_26(i16 /*P1*/, i32 nP2, i32 nP3);
pnt TAG004f3a_1(i16 /*P1*/);
void TAG004f3a_2(i16 /*P1*/);
pnt AssignMemory(i16 /*P1*/, i32 nP2);//TAG004f3a_14
pnt TAG004f3a_16(i16 P1, i32 nP2);
pnt ReleaseMem(i32 /*P1*/, ui8 *nP2);//TAG004f3a_20
i16 TAG0051a2(i16 P1, i16 P2);
void TAG0051c2_35(i16 P1);
void TAG0051c2_36(i16 P1);
void TAG0051c2_37(i16 /*P1*/);
void TAG005ae8_1(i16 P1);
void TAG005ae8_2(i16 P1);
void TAG005ae8_9(i16 P1, PALETTEPKT *nP2);
void TAG005ae8_38(i16 P1, PALETTEPKT *nP2);
void TAG005d98();
//void TAG005dcc(wordRectPos *, wordRectPos *, i16, i16);(use expandRectangle)
void TAG005f9a_1(wordRectPos *, i16, i16);
void TAG0059fe(i32 P1, i32 P2); //Fake function
static i16 MinA(i16, i16);// TAG0060a4
i32 TAG0060c4();
static i16 MinB(i16, i16);// TAG006282
void TAG0062a2(wordRectPos *P1, ui8 *P2);
void TAG00636a();
void TAG006388();
void TAG0063a6(i16);
i16 TAG0064fc(pnt, pnt);
pnt StrCpyTo(pnt,pnt,i16);//TAG006538
i32 TAG006570(pnt, i32);
//void TAG0065d0(pnt buf, i32 initialChecksum, i32 numword);(use Unscramble)
i32 TAG006636(pnt, i32, i16, i16);
// TAG006672;
i32 MyReadFirstBlock(pnt P1);
void TAG006718(i16 P1);
i32 TAG00686a(i16 P1);
pnt TAG006bc0(i32 P1);
i32 TAG006c1c(i16, i32, pnt);
void TAG006bfc(pnt P1);
void TAG006c5e();
void TAG007540();
void TAG007560(i16);
void TAG0075c8();
i32 TAG0076a0_8(i16 P1, pnt nP2, i32 nP3);
i32 TAG0076a0_13(i16 P1);
void TAG0076a0_40(i32 /*P1*/, i32 nP2, const char* nP3, i32 nP4);
void TAG0078fa(TEXT *);
i32 TAG007908(i32, pnt);
i16 TAG00794e(pnt, pnt);
void TAG00797a();
void TAG00799a_1(i16 /*P1*/);
void TAG00799a_2(i16 /*P1*/);
void SetSelectedLine(i16 /*P1*/, i32 nP2);//TAG00799a_7
i32 TAG00799a_13(i16 P1);
void TAG007fbc();
void TAG007fdc_2(i16 P1);
i32 TAG00835c_25(i16 P1);
void TAG0083ac(i16, i16, i16, i16, i16);
i16 TAG0083cc(pnt, pnt); //Adds words between two addresses
void TAG008898(i16, i16);
void TAG0088b8(wordRectPos *, ui8 *, i16);
void TAG008a42();
i32 TAG008a62();
void TAG008b90(i16,S20 *,T12 *);
void TAG008c20();
void TAG008c40_1(i16 P1);
void TAG008c40_2(i16 /*P1*/);
void TAG008c40_3(i16 P1, i32 nP2, i32 nP3);
i32 TAG008c40_12(i16 /*P1*/, i32 nP2, i32 nP3, pnt nP4);
void TAG008c40_30(i16 /*P1*/);
void TAG0093a0_17(i16,i32);
void TAG0093a0_18(i32 , i32);
void Clear_14608();//TAG009462
i32 TAG00948c(i16 P1);
pnt TAG0094de(i16 P1, PAGE *P2, NODE *P3);
i32 AddPage(i16 P1, PAGE *P2);//TAG009516
i16 PageCount(i16);//TAG00958a
pnt TAG0095b0(i32 P1, i32 P2);
pnt TAG00964e(i32 P1, i32 P2);
void TAG00978a_1(i16 /*P1*/);
void TAG00978a_3(i16 P1, PAGE *nP2);
pnt TAG00978a_12(i16 P1, i32 nP2);
i32 TAG00978a_13(i16 P1);
pnt TAG00978a_21(i16 P1, i32 nP2);
void TAG00978a_27(i16 P1, i32 nP2, pnt nP3, i32 nP4);
pnt TAG00978a_28(i16 P1,i16 nP2,i16 nP3);
void TAG00978a_29(i16 P1, i16 nP2);
void TAG009d7e(i16, i16 *, i16 *, i16 *);
//void TAG009a02(i32, i32);
//void TAG009a1c(i32, i32);
void TAG009a40();
void TAG009d36(i16, i16);
void TAG009d5e(i16);
void TAG009db6(i16, i32, i32 *);
void TAG009dea(i16, i32, i32 *);
void TAG009ea0(i16 *, i16 *, i16 *);
void TAG009f1c(i16 *, i16 *, i16 *);
void TAG009f80(i16);
void TAG00a05c(i16 **);
i16 TAG00a07a(i16);
i16 TAG00a238();
i16 TAG00a28c();
i16 TAG00aa22(i16 *, i16 *, i16 *, i16 *);
void TAG00aa58(i16, i32);
void TAG00adf4(i32);
void TAG00ae38(i32 *);
void TAG00ae58();
//pnt TAG00aeda(i16, i16); TRAP #1
void TAG00aef0(i16);
void TAG00af06();
void NotImpMsg(i32 addr)
{
char msg[1000];
sprintf(msg,
"I did not translate all of the Atari\n"
"code. Some of it appeared to never be used.\n"
"You have encountered code that I did not\n"
"translate at address 0x%04x.\n"
"Let me know and I will fix it.\n"
"prsteven@facstaff.wisc.edu", addr);
UI_MessageBox(msg,NULL,MESSAGE_OK);
die(0);
}
void SFIRST(pnt /*mask*/, i32 /*flg*/)
{
char *dta;
dta = (char *)GETDTA();
strcpy(dta+30,"abc");
}
// *********************************************************
//
// *********************************************************
// TAG000450
FILE_DESCRIPTOR *FindFileDescriptor(i32 FDnum)
{
FILE_DESCRIPTOR *A4;
//
if ( (FDnum < 0) || (FDnum >= f.Word15070) )
{
TAG00189c(1, 0x0106000e, (char *)FDnum);
};
A4 = (FILE_DESCRIPTOR *)LoadPnt(f.Pointer15080);
//A4 += 124 * FDnum;
ASSERT(sizeof(*A4) == 124,"A4");
A4 += FDnum;
//if (wordGear(A4+4) == 0)
if (A4->word4 == 0)
{
TAG00189c(1, 0x0106000e, (char *)FDnum);
};
return A4;
}
// *********************************************************
//
// *********************************************************
i32 TAG0004b6(i32 P1, FILE_DESCRIPTOR *P2)
{
dReg D7;
FILE_DESCRIPTOR *A4;
D7L = P1;
A4 = P2;
switch (D7L)
{
case 0x01060003:
NotImpMsg(0x506);
/*
*/
break;
case 0x0106000c:
case 0x01060004:
NotImpMsg(0x51e);
/*
*/
break;
case 0x01060006:
NotImpMsg(0x530);
/*
*/
break;
case 0x01060007:
//if (wordGear(A4+2) == -1)
if (A4->fileHandle == -1)
{
//StrCpy(A4+22, "A read error occurred on %s");
StrCpy(A4->byte22, "A read error occurred on %s");
}
else
{
atari_sprintf((char *)A4->byte22,
"A read error occurred on file %s in %%s",
(i32)LoadPnt((ui8 *)&A4->pointer82));
};
break;
case 0x01060008:
NotImpMsg(0x57a);
/*
*/
break;
case 0x01060009:
NotImpMsg(0x58a);
/*
*/
break;
case 0x0106000d:
NotImpMsg(0x5be);
/*
*/
break;
case 0x010600ff:
//atari_sprintf(
// A4+22,
// "IO Error occured on %%s in %s",
// (i32)A4+10,
// 0);
atari_sprintf(
(char *)A4->byte22,
"IO Error occured on %%s in %s",
(i32)A4->byte10,
0);
break;
}; //switch
//TAG00189c(0, D7L, (pnt)(UI16)(wordGear(A4)));
TAG00189c(0, D7L, (char *)((int)(A4->word0)));
return D7L;
}
// *********************************************************
//
// *********************************************************
i32 TAG000606(i16 P1, i16 P2, i16 P3)
{
dReg D5, D6, D7;
D7W = P1;
for (D6W=1, D5W=0, D7W>>=P2;
(P2++) <= P3;
D6W <<= 1)
{
if (D7W & D6W)
{
D5W++;
};
//
};
return D5W;
}
// *********************************************************
//
// *********************************************************
void TAG000678(pnt src, pnt dst, i32 P3)
{
dReg D6, D7;
aReg A3, A4;
A4 = src;
A3 = dst;
D7W = sw(P3);
for (D6L = 0; (*A4 != 0) && (D7W != 0); D7W--)
{
*(A3++) = (*A4++);
//
//
};
while ((D7W--) != 0)
{
*(A3++) = 0;
};