-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathmachine.c
840 lines (714 loc) · 18.9 KB
/
machine.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
/*
* machine.c - detection of machine type
*
* Copyright (C) 2001-2024 The EmuTOS development team
*
* Authors:
* LVL Laurent Vogel
*
* This file is distributed under the GPL, version 2 or at your
* option any later version. See doc/license.txt for details.
*/
/* #define ENABLE_KDEBUG */
#include "emutos.h"
#include "cookie.h"
#include "machine.h"
#include "has.h"
#include "processor.h"
#include "biosmem.h"
#include "vectors.h"
#include "nvram.h"
#include "tosvars.h"
#include "country.h"
#include "clock.h"
#include "natfeat.h"
#include "xhdi.h"
#include "string.h"
#include "dmasound.h"
#include "dsp.h"
#include "acsi.h"
#include "scsi.h"
#include "ide.h"
#include "scsidriv.h"
#include "asm.h"
#include "delay.h"
#include "mfp.h"
#include "scc.h"
#include "memory.h"
#include "coldfire.h"
#include "dma.h"
#include "nova.h"
#include "biosext.h"
#include "amiga.h"
#if CONF_WITH_ADVANCED_CPU
UBYTE is_bus32; /* 1 if address bus is 32-bit, 0 if it is 24-bit */
#endif
ULONG detected_busses; /* bitmap of i/o busses detected */
ULONG cookie_vdo;
#if CONF_WITH_FDC
ULONG cookie_fdc;
#endif
ULONG cookie_snd;
ULONG cookie_mch;
#if CONF_WITH_DIP_SWITCHES
ULONG cookie_swi;
#endif
/*
* test specific hardware features
*/
#if CONF_WITH_STE_SHIFTER
int has_ste_shifter;
#endif
#if CONF_WITH_TT_SHIFTER
int has_tt_shifter;
#endif
#if CONF_WITH_VIDEL
int has_videl;
#endif
#if CONF_ATARI_HARDWARE
int has_modectl;
/*
* Check if the DMA 'modectl' register exists
*
* A bus error _may_ occur when accessing 'modectl' on some systems that
* do not support HD floppies [Christian Zietz's investigations indicate
* that the error occurs on systems with the IMP chip set].
*/
static void detect_modectl(void)
{
has_modectl = 0;
if (check_read_byte((LONG)&DMA->modectl))
has_modectl = 1;
KDEBUG(("has_modectl = %d\n", has_modectl));
}
#endif
/*
* Tests video capabilities (STe Enhanced Shifter, TT Shifter and VIDEL)
*/
static void detect_video(void)
{
#if CONF_WITH_STE_SHIFTER
/* test if we have an STe Shifter by testing if register 820d
* works (put a value, read other reg, read again, and compare)
*/
volatile UBYTE *ste_reg = (UBYTE *) 0xffff820d;
volatile UBYTE *other_reg1 = (UBYTE *) 0xffff8203;
volatile WORD *other_reg2 = (WORD *) 0xffff8240;
has_ste_shifter = 0;
if (!check_read_byte((long)ste_reg))
return;
*ste_reg = 90;
*other_reg1; /* force register read (really useful ?) */
if (*ste_reg == 90)
{
*ste_reg = 0;
*other_reg2; /* force register read (really useful ?) */
if (*ste_reg == 0)
has_ste_shifter = 1;
}
KDEBUG(("has_ste_shifter = %d\n", has_ste_shifter));
#endif
#if CONF_WITH_TT_SHIFTER
/* test if we have a TT Shifter by testing for TT color palette */
has_tt_shifter = 0;
if (check_read_byte((long)TT_PALETTE_REGS))
has_tt_shifter = 1;
KDEBUG(("has_tt_shifter = %d\n", has_tt_shifter));
#endif
#if CONF_WITH_VIDEL
/* test if we have Falcon VIDEL by testing for f030_xreg */
has_videl = 0;
if (check_read_byte(FALCON_HHT))
has_videl = 1;
KDEBUG(("has_videl = %d\n", has_videl));
/*
* The Falcon Bus Control Register uses the following bits:
* 0x40 : type of start (0=cold, 1=warm)
* 0x20 : STe Bus emulation (0=on, 1=off)
* 0x08 : blitter control (0=on, 1=off)
* 0x04 : blitter speed (0=8MHz, 1=16MHz)
* 0x01 : cpu speed (0=8MHz, 1=16MHz)
* Source: Hatari source code
*
* STe Bus emulation needs to be switched off for
* bus-error-based hardware detection to work on the Falcon.
*/
if (has_videl) /* i.e. it's a Falcon */
{
volatile UBYTE *fbcr = (UBYTE *)FALCON_BUS_CTL;
*fbcr |= 0x25; /* set STe Bus emulation off, 16MHz blitter & CPU */
}
#endif
}
#if CONF_WITH_TT_MFP
int has_tt_mfp;
/*
* detect second MFP (TT only)
*/
static void detect_tt_mfp(void)
{
has_tt_mfp = 0;
if (check_read_byte((LONG)TT_MFP_BASE+1))
has_tt_mfp = 1;
KDEBUG(("has_tt_mfp = %d\n", has_tt_mfp));
}
#endif /* CONF_WITH_TT_MFP */
#if CONF_WITH_SCC
int has_scc;
/*
* detect SCC (Falcon and TT)
*/
static void detect_scc(void)
{
has_scc = 0;
if (check_read_byte(SCC_BASE))
has_scc = 1;
KDEBUG(("has_scc = %d\n", has_scc));
}
#endif /* CONF_WITH_SCC */
#if CONF_WITH_VME
int has_vme;
static void detect_vme(void)
{
volatile UBYTE *vme_mask = (UBYTE *) VME_INT_MASK;
volatile UBYTE *sys_mask = (UBYTE *) SYS_INT_MASK;
if (check_read_byte(SCU_GPR1))
{
*vme_mask = VME_INT_MFP; /* allow MFP interrupts */
*sys_mask = SYS_INT_VSYNC | SYS_INT_HSYNC; /* allow VSYNC, HSYNC */
has_vme = 1;
} else {
has_vme = 0;
}
KDEBUG(("has_vme = %d\n", has_vme));
}
#endif /* CONF_WITH_VME */
#if CONF_WITH_MONSTER
int has_monster;
static void detect_monster(void)
{
if (IS_ARANYM)
{
/* The auto-detection currently crashes ARAnyM-JIT. */
has_monster = 0;
}
else
{
has_monster = check_read_byte(MONSTER_REG);
}
KDEBUG(("has_monster = %d\n", has_monster));
}
#endif /* CONF_WITH_MONSTER */
#if CONF_WITH_MAGNUM
int has_magnum;
/*
* These are the magic addresses for the activation sequence used by the
* Magnum driver. Actually, the least significant 16 bits are 'don't care'
* due to the hardware design.
*/
#define MAGNUM_MAGIC1 (0x6C4710ul)
#define MAGNUM_MAGIC2 (0x5D1234ul)
#define MAGNUM_MAGIC3 (0x6D3148ul)
#define MAGNUM_MEM_START (0x400000ul)
static void detect_magnum(void)
{
/* Assume no Magnum RAM expansion card. */
has_magnum = 0;
do
{
/* ARAnyM cannot have a Magnum. */
if (IS_ARANYM)
break;
/*
* Magnum will be initially disabled. Thus check that there *is*
* a bus error at 4 MB. Otherwise there already is RAM or another
* peripheral at that address and not a Magnum.
*/
if (check_read_byte(MAGNUM_MEM_START))
break;
/*
* Magnum is enabled by a sequence of reads to magic addresses.
* These reads cause a bus-error on the Magnum. If they don't,
* it's not a Magnum card.
*/
if (check_read_byte(MAGNUM_MAGIC1))
break;
if (check_read_byte(MAGNUM_MAGIC2))
break;
if (check_read_byte(MAGNUM_MAGIC3))
break;
/* If Magnum is present, an access to 4 MB must now work. */
has_magnum = check_read_byte(MAGNUM_MEM_START);
} while (0);
KDEBUG(("has_magnum = %d\n", has_magnum));
}
#endif /* CONF_WITH_MAGNUM */
#if CONF_WITH_BLITTER
/* blitter */
int has_blitter;
int blitter_is_enabled;
static void detect_blitter(void)
{
has_blitter = blitter_is_enabled = 0;
/*
* although no Atari-developed system has both TT-RAM and a blitter,
* some add-ons to Atari systems do (e.g. a CT60 in 68060 mode).
* because the Atari blitter only supports 24-bit addressing, we must
* prevent its use on such systems. we do allow a blitter on the
* FireBee, which by design supports 32-bit blitting.
*/
#ifndef MACHINE_FIREBEE
if (!ramtop)
#endif
if (check_read_byte(BLITTER_CONFIG1))
has_blitter = 1;
KDEBUG(("has_blitter = %d\n", has_blitter));
}
#endif /* CONF_WITH_BLITTER */
#if CONF_WITH_DIP_SWITCHES
int has_dip_switches;
static void detect_dip_switches(void)
{
if (IS_ARANYM)
{
/* The auto-detection currently crashes ARAnyM-JIT. */
has_dip_switches = 0;
}
else
{
has_dip_switches = check_read_byte(DIP_SWITCHES+1);
}
KDEBUG(("has_dip_switches = %d\n", has_dip_switches));
}
/* DIP switch usage is as follows (according to the "ATARI FALCON030
* Service Guide", dated October 1, 1992):
* bit 7: off => no DMA sound hardware
* bit 6: off => AJAX FDC chip installed (support for 1.44MB floppy)
* bit 5: off => quad density floppy
* other bits are not used (and are set on)
*/
static void setvalue_swi(void)
{
cookie_swi = HIBYTE(*(volatile UWORD *)DIP_SWITCHES);
KDEBUG(("cookie_swi = 0x%08lx\n", cookie_swi));
}
#endif /* CONF_WITH_DIP_SWITCHES */
/* video type */
static void setvalue_vdo(void)
{
#if CONF_ATARI_HARDWARE
if (HAS_VIDEL)
cookie_vdo = VDO_FALCON;
else if (HAS_TT_SHIFTER)
cookie_vdo = VDO_TT;
else if (HAS_STE_SHIFTER)
cookie_vdo = VDO_STE;
else
cookie_vdo = VDO_ST;
#else
cookie_vdo = VDO_NOHARD;
#endif /* CONF_ATARI_HARDWARE */
KDEBUG(("cookie_vdo = 0x%08lx\n", cookie_vdo));
}
/* machine type */
static void setvalue_mch(void)
{
#if CONF_ATARI_HARDWARE
if (IS_ARANYM)
cookie_mch = MCH_ARANYM;
else if (HAS_VIDEL)
cookie_mch = MCH_FALCON;
else if (HAS_TT_SHIFTER)
cookie_mch = MCH_TT;
else if (HAS_STE_SHIFTER)
{
if (HAS_VME)
cookie_mch = MCH_MSTE;
else
cookie_mch = MCH_STE;
}
else
cookie_mch = MCH_ST;
#else
cookie_mch = MCH_NOHARD;
#endif /* CONF_ATARI_HARDWARE */
KDEBUG(("cookie_mch = 0x%08lx\n", cookie_mch));
}
/* SND */
static void setvalue_snd(void)
{
cookie_snd = 0;
#if CONF_WITH_YM2149
cookie_snd |= SND_PSG;
#endif
if (HAS_DMASOUND)
{
cookie_snd |= SND_8BIT;
}
if (HAS_FALCON_DMASOUND)
{
cookie_snd |= SND_16BIT | SND_MATRIX;
}
if (HAS_DSP)
{
cookie_snd |= SND_DSP;
}
#if CONF_WITH_DIP_SWITCHES
if (has_dip_switches)
{
/*
* if DIP sw 8 is on (i.e. bit 7 is off), then we turn off the
* indicator for 8-bit DMA stereo in the _SND cookie, just like
* TOS3/TOS4 do.
*/
if (!(cookie_swi & 0x80))
{
cookie_snd &= ~SND_8BIT;
}
}
#endif
KDEBUG(("cookie_snd = 0x%08lx\n", cookie_snd));
}
#if CONF_WITH_FRB
/*
* FRB (FastRAM Buffer)
* This needs to be set up after TT-RAM detection,
* and before BDOS RAM initialization.
*/
static void add_cookie_frb(void)
{
BOOL need_frb = FALSE; /* Required only if the system has Alt-RAM */
#if CONF_WITH_TTRAM
/* We need FRB if TT-RAM is present */
need_frb = (ramtop != NULL);
#endif
#if CONF_WITH_MONSTER
need_frb |= has_monster;
#endif
#if CONF_WITH_MAGNUM
need_frb |= has_magnum;
#endif
if (need_frb)
{
UBYTE *cookie_frb = balloc_stram(FRB_SIZE, FALSE);
cookie_add(COOKIE_FRB, (ULONG)cookie_frb);
KDEBUG(("cookie_frb = %p\n", cookie_frb));
}
}
#endif /* CONF_WITH_FRB */
#if CONF_WITH_FDC
/* FDC */
static void setvalue_fdc(void)
{
#if CONF_WITH_DIP_SWITCHES
if (has_dip_switches && !(cookie_swi & 0x40))
{
/* switch *off* means AJAX controller is installed */
cookie_fdc = FDC_1ATC;
} else
#endif
{
cookie_fdc = FDC_0ATC;
}
KDEBUG(("cookie_fdc = 0x%08lx\n", cookie_fdc));
}
#endif /* CONF_WITH_FDC */
#if CONF_WITH_ARANYM
static const char aranym_name[] = "ARAnyM";
int is_aranym;
static void aranym_machine_detect(void)
{
char buffer[80];
long bufsize;
bufsize = nfGetFullName(buffer, sizeof(buffer)-1);
is_aranym = bufsize > 0 && !strncasecmp(buffer, aranym_name, strlen(aranym_name));
KDEBUG(("is_aranym = %d\n", is_aranym));
}
#endif
static ULONG check_busses(void)
{
ULONG found = 0UL;
#if CONF_WITH_ACSI
if (detect_acsi())
found |= (1 << ACSI_BUS);
#endif
#if CONF_WITH_SCSI
if (detect_scsi())
found |= (1 << SCSI_BUS);
#endif
#if CONF_WITH_IDE
if (detect_ide())
found |= (1 << IDE_BUS);
#endif
return found;
}
/* Detect optional hardware and fill has_* variables accordingly.
* Those detection routines must *NOT* rely on cookies,
* because cookies are initialized later.
*/
void machine_detect(void)
{
#if CONF_WITH_ARANYM
aranym_machine_detect();
#endif
#ifdef MACHINE_AMIGA
amiga_machine_detect();
#endif
#if CONF_ATARI_HARDWARE
detect_modectl();
#endif
/* Detect TT-RAM and set up ramtop/ramvalid */
KDEBUG(("ttram_detect()\n"));
ttram_detect();
detect_video();
#if CONF_WITH_TT_MFP
if (!IS_ARANYM)
detect_tt_mfp();
#endif
#if CONF_WITH_SCC
if (!IS_ARANYM)
detect_scc();
#endif
#if CONF_WITH_VME
if (!IS_ARANYM)
detect_vme();
#endif
#if CONF_WITH_MEGARTC
if (!IS_ARANYM)
detect_megartc();
KDEBUG(("has_megartc = %d\n", has_megartc));
#endif /* CONF_WITH_MEGARTC */
#if CONF_WITH_ICDRTC
detect_icdrtc();
KDEBUG(("has_icdrtc = %d\n", has_icdrtc));
#endif /* CONF_WITH_ICDRTC */
#if CONF_WITH_NVRAM
detect_nvram();
#endif
#if CONF_WITH_DMASOUND
detect_dmasound();
#endif
#if CONF_WITH_DSP
detect_dsp();
#endif
#if CONF_WITH_DIP_SWITCHES
detect_dip_switches();
#endif
#if CONF_WITH_BLITTER
detect_blitter();
#endif
detected_busses = check_busses();
KDEBUG(("detected_busses = 0x%lx\n", detected_busses));
#if CONF_WITH_MONSTER
detect_monster();
if (has_monster)
{
detect_monster_rtc();
KDEBUG(("has_monster_rtc = %d\n", has_monster_rtc));
}
#endif
#if CONF_WITH_MAGNUM
detect_magnum();
#endif
#if CONF_WITH_NOVA
if (!IS_ARANYM)
detect_nova();
#endif
}
/*
* perform machine-specific initialisation
*/
void machine_init(void)
{
#if !CONF_WITH_RESET
/*
* we must disable interrupts here, because the reset instruction hasn't
* been run during startup
*/
#if CONF_WITH_MFP
{
MFP *mfp = MFP_BASE; /* set base address of MFP */
mfp->iera = 0x00; /* disable MFP interrupts */
mfp->ierb = 0x00;
}
#endif
#if CONF_WITH_TT_MFP
if (has_tt_mfp)
{
MFP *mfp = TT_MFP_BASE; /* set base address of TT MFP */
mfp->iera = 0x00; /* disable MFP interrupts */
mfp->ierb = 0x00;
}
#endif
#if CONF_WITH_SCC
if (has_scc)
{
SCC *scc = (SCC *)SCC_BASE;
ULONG loops = loopcount_1_msec / 1000; /* 1 usec = 8 cycles of SCC PCLK */
scc->portA.ctl = 0x09; /* issue hardware reset */
delay_loop(loops);
scc->portA.ctl = 0xC0;
delay_loop(loops);
}
#endif
#endif /* CONF_WITH_RESET */
}
void fill_cookie_jar(void)
{
#ifdef __mcoldfire__
cookie_add(COOKIE_COLDFIRE, 0);
setvalue_mcf();
cookie_add(COOKIE_MCF, (ULONG)&cookie_mcf);
#else
/* this is detected by detect_cpu(), called from processor_init() */
cookie_add(COOKIE_CPU, mcpu);
#endif
/* _VDO
* This cookie represents the revision of the video shifter present.
* Currently valid values are:
* 0x00000000 ST
* 0x00010000 STe
* 0x00020000 TT030
* 0x00030000 Falcon030
*/
setvalue_vdo();
cookie_add(COOKIE_VDO, cookie_vdo);
#ifndef __mcoldfire__
/* this is detected by detect_fpu(), called from processor_init() */
cookie_add(COOKIE_FPU, fputype);
#endif
/* _MCH */
setvalue_mch();
cookie_add(COOKIE_MCH, cookie_mch);
#if CONF_WITH_DIP_SWITCHES
/* _SWI On machines that contain internal configuration dip switches,
* this value specifies their positions as a bitmap. Dip switches are
* generally used to indicate the presence of additional hardware which
* will be represented by other cookies.
*/
if (has_dip_switches)
{
setvalue_swi();
cookie_add(COOKIE_SWI, cookie_swi);
}
#endif
/* _SND
* This cookie contains a bitmap of sound features available to the
* system as follows:
* 0x01 GI Sound Chip (PSG)
* 0x02 1 Stereo 8-bit Playback
* 0x04 DMA Record (w/XBIOS)
* 0x08 16-bit CODEC
* 0x10 DSP
*/
setvalue_snd();
cookie_add(COOKIE_SND, cookie_snd);
#if CONF_WITH_FRB
/* _FRB This cookie is present when alternative RAM is present. It
* points to a 64k buffer that may be used by DMA device drivers to
* transfer memory between alternative RAM and ST RAM for DMA operations.
*/
KDEBUG(("add_cookie_frb()\n"));
add_cookie_frb();
#endif
/* _FLK The presence of this cookie indicates that file and record
* locking extensions to GEMDOS exist. The value field is a version
* number currently undefined.
*/
/* _AKP This cookie indicates the presence of an Advanced Keyboard
* Processor. The high word of this cookie is currently reserved.
* The low word indicates the language currently used by TOS for
* keyboard interpretation and alerts.
*/
detect_akp();
KDEBUG(("cookie_akp = 0x%08lx\n", cookie_akp));
cookie_add(COOKIE_AKP, cookie_akp);
/* _IDT This cookie defines the currently configured date and time
* format. Bits #0-7 contain the ASCII code of the date separator.
* Bits #8-11 contain a value indicating the date display format as
* follows:
* 0 MM-DD-YY
* 1 DD-MM-YY
* 2 YY-MM-DD
* 3 YY-DD-MM
* Bits #12-15 contain a value indicating the time format as follows:
* 0 12 hour
* 1 24 hour
* Note: The value of this cookie does not affect any of the internal
* time functions. It is intended for informational use by applications
* and may also used by the desktop for its date & time displays.
*/
detect_idt();
KDEBUG(("cookie_idt = 0x%08lx\n", cookie_idt));
cookie_add(COOKIE_IDT, cookie_idt);
#if CONF_WITH_FDC
/* Floppy Drive Controller
* Most significant byte means:
* 0 - DD (Normal floppy interface)
* 1 - HD (1.44 MB with 3.5")
* 2 - ED (2.88 MB with 3.5")
* the 3 other bytes are the Controller ID:
* 0 - No information available
* 'ATC' - Fully compatible interface built in a way that
* behaves like part of the system.
*/
setvalue_fdc();
cookie_add(COOKIE_FDC, cookie_fdc);
#endif
#if DETECT_NATIVE_FEATURES
if (has_natfeats())
{
cookie_add(COOKIE_NATFEAT, (ULONG)&natfeat_cookie);
}
#endif
#if CONF_WITH_XHDI
cookie_add(COOKIE_XHDI, (ULONG)xhdi_vec);
#endif
#if CONF_WITH_SCSI_DRIVER
cookie_add(COOKIE_SCSIDRIV, (ULONG)&scsidriv_root);
#endif
#if !CONF_WITH_MFP
/* Set the _5MS cookie with the address of the 200 Hz system timer
* interrupt vector so FreeMiNT can hook it. */
cookie_add(COOKIE__5MS, (ULONG)&vector_5ms);
#endif
}
static const char * guess_machine_name(void)
{
#if CONF_WITH_ARANYM
if (is_aranym)
return aranym_name;
#endif
switch(cookie_mch) {
case MCH_ST:
if (HAS_MEGARTC)
return "Atari Mega ST";
else
return "Atari ST";
case MCH_STE:
return "Atari STe";
case MCH_MSTE:
return "Atari Mega STe";
case MCH_TT:
return "Atari TT";
case MCH_FALCON:
return "Atari Falcon";
default:
return "unknown";
}
}
const char * machine_name(void)
{
MAYBE_UNUSED(guess_machine_name);
#ifdef MACHINE_FIREBEE
return "FireBee";
#elif defined(MACHINE_AMIGA)
return amiga_machine_name();
#elif defined(MACHINE_LISA)
return "Apple Lisa";
#elif defined(MACHINE_M548X)
return m548x_machine_name();
#else
return guess_machine_name();
#endif
}