forked from AppleWin/AppleWin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPropertySheetHelper.cpp
More file actions
588 lines (499 loc) · 17.5 KB
/
Copy pathPropertySheetHelper.cpp
File metadata and controls
588 lines (499 loc) · 17.5 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
/*
AppleWin : An Apple //e emulator for Windows
Copyright (C) 1994-1996, Michael O'Brien
Copyright (C) 1999-2001, Oliver Schmidt
Copyright (C) 2002-2005, Tom Charlesworth
Copyright (C) 2006-2012, Tom Charlesworth, Michael Pohoreski
AppleWin is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
AppleWin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with AppleWin; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "StdAfx.h"
#include "../Applewin.h" // g_nAppMode, g_uScrollLockToggle, sg_PropertySheet
#include "../Disk.h"
#include "../Frame.h"
#include "../Log.h"
#include "../Registry.h"
#include "../SaveState.h"
#include "IPropertySheet.h"
#include "PropertySheetHelper.h"
/*
Config causing AfterClose msgs:
===============================
Page: Action: Comment:
------------------------------------------------------------------------
Config
. Computer WM_USER_RESTART
. Benchmark PSBTN_OK -> WM_USER_BENCHMARK Forces PSBTN_OK
Input
. Mouse WM_USER_RESTART
. CP/M WM_USER_RESTART
Sound
. MB/Phasor/SAM/None WM_USER_RESTART
Disk
. HDD enable WM_USER_RESTART
Advanced
. Save State WM_USER_SAVESTATE
. Load State WM_USER_LOADSTATE
. Clone WM_USER_RESTART
. MrFreeze Rom WM_USER_RESTART
Requirements:
-------------
. Want to change multiple HW at once.
. Allow change Computer & Load State (ie. multiple AfterClose msgs)
Design:
-------
. At PropSheet init, copy original config state (for above items)
. On last Page close, compare new config state, if changed:
- Show 1 restart + confirm msg (if necessary)
- Cancel will rollback to original config (for above items), but other items will be applied
. Load State button
- Don't action it immediately.
- .aws should contain config (but doesn't), so should override any config changes.
- so this can just discard any config changes
- if any config change, then show msg box to say they won't be applied
. Save State button
- Don't action it immediately.
- save state applies to current config (prior to restart).
- so this can just discard any config changes
- if any config change, then show msg box to say they won't be applied
. Benchmark button
- Action it immediately.
- If config has changed:
- Prompt to either do benchmark (and lose new config) or cancel benchmark (and drop back to Configuration dialog).
*/
void CPropertySheetHelper::FillComboBox(HWND window, int controlid, LPCTSTR choices, int currentchoice)
{
_ASSERT(choices);
HWND combowindow = GetDlgItem(window, controlid);
SendMessage(combowindow, CB_RESETCONTENT, 0, 0);
while (choices && *choices)
{
SendMessage(combowindow, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)choices);
choices += _tcslen(choices)+1;
}
if (SendMessage(combowindow, CB_SETCURSEL, currentchoice, 0) == CB_ERR && currentchoice != -1)
{
_ASSERT(0);
SendMessage(combowindow, CB_SETCURSEL, 0, 0); // GH#434: Failed to set currentchoice, so select item-0
}
}
void CPropertySheetHelper::SaveComputerType(eApple2Type NewApple2Type)
{
if (NewApple2Type == A2TYPE_CLONE) // Clone picked from Config tab, but no specific one picked from Advanced tab
NewApple2Type = A2TYPE_PRAVETS82;
ConfigSaveApple2Type(NewApple2Type);
}
void CPropertySheetHelper::ConfigSaveApple2Type(eApple2Type apple2Type)
{
REGSAVE(TEXT(REGVALUE_APPLE2_TYPE), apple2Type);
LogFileOutput("Config: Apple2 Type changed to %d\n", apple2Type);
}
void CPropertySheetHelper::SaveCpuType(eCpuType NewCpuType)
{
REGSAVE(TEXT(REGVALUE_CPU_TYPE), NewCpuType);
}
void CPropertySheetHelper::SetSlot4(SS_CARDTYPE NewCardType)
{
g_Slot4 = NewCardType;
REGSAVE(TEXT(REGVALUE_SLOT4),(DWORD)g_Slot4);
}
void CPropertySheetHelper::SetSlot5(SS_CARDTYPE NewCardType)
{
g_Slot5 = NewCardType;
REGSAVE(TEXT(REGVALUE_SLOT5),(DWORD)g_Slot5);
}
// Looks like a (bad) C&P from SaveStateSelectImage()
// - eg. see "RAPCS" tags below...
// Used by:
// . CPageDisk: IDC_CIDERPRESS_BROWSE
// . CPageAdvanced: IDC_PRINTER_DUMP_FILENAME_BROWSE
std::string CPropertySheetHelper::BrowseToFile(HWND hWindow, TCHAR* pszTitle, TCHAR* REGVALUE, TCHAR* FILEMASKS)
{
static char PathToFile[MAX_PATH] = {0}; //This is a really awkward way to prevent mixing CiderPress and SaveStated values (RAPCS), but it seem the quickest. Here is its Line 1.
strcpy(PathToFile, Snapshot_GetFilename()); //RAPCS, line 2.
TCHAR szDirectory[MAX_PATH] = TEXT("");
TCHAR szFilename[MAX_PATH];
strcpy(szFilename, "");
RegLoadString(TEXT("Configuration"), REGVALUE, 1, szFilename ,MAX_PATH);
std::string PathName = szFilename;
OPENFILENAME ofn;
ZeroMemory(&ofn,sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hWindow;
ofn.hInstance = g_hInstance;
ofn.lpstrFilter = FILEMASKS;
/*ofn.lpstrFilter = TEXT("Applications (*.exe)\0*.exe\0")
TEXT("Text files (*.txt)\0*.txt\0")
TEXT("All Files\0*.*\0");*/
ofn.lpstrFile = szFilename;
ofn.nMaxFile = MAX_PATH;
ofn.lpstrInitialDir = szDirectory;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_HIDEREADONLY;
ofn.lpstrTitle = pszTitle;
int nRes = GetOpenFileName(&ofn);
if(nRes) // Okay is pressed
{
strcpy(m_szNewFilename, &szFilename[ofn.nFileOffset]); // TODO:TC: m_szNewFilename not used! (Was g_szNewFilename)
szFilename[ofn.nFileOffset] = 0;
if (_tcsicmp(szDirectory, szFilename))
strcpy(m_szSSNewDirectory, szFilename); // TODO:TC: m_szSSNewDirectory looks dodgy! (Was g_szSSNewDirectory)
PathName = szFilename;
PathName.append (m_szNewFilename);
}
else // Cancel is pressed
{
RegLoadString(TEXT("Configuration"), REGVALUE, 1, szFilename,MAX_PATH);
PathName = szFilename;
}
strcpy(m_szNewFilename, PathToFile); //RAPCS, line 3 (last).
return PathName;
}
void CPropertySheetHelper::SaveStateUpdate()
{
if (m_bSSNewFilename)
{
Snapshot_SetFilename(m_szSSNewPathname);
RegSaveString(TEXT(REG_CONFIG), REGVALUE_SAVESTATE_FILENAME, 1, m_szSSNewPathname);
if(m_szSSNewDirectory[0])
RegSaveString(TEXT(REG_PREFS), REGVALUE_PREF_START_DIR, 1, m_szSSNewDirectory);
}
}
void CPropertySheetHelper::GetDiskBaseNameWithAWS(TCHAR* pszFilename)
{
LPCTSTR pDiskName = sg_Disk2Card.GetBaseName(DRIVE_1);
if (pDiskName && pDiskName[0])
{
strcpy(pszFilename, pDiskName);
strcpy(&pszFilename[strlen(pDiskName)], ".aws.yaml");
}
}
// NB. OK'ing this property sheet will call Snapshot_SetFilename() with this new filename
int CPropertySheetHelper::SaveStateSelectImage(HWND hWindow, TCHAR* pszTitle, bool bSave)
{
TCHAR szDirectory[MAX_PATH] = TEXT("");
TCHAR szFilename[MAX_PATH] = {0};
if (bSave)
{
// Attempt to use drive1's image name as the name for the .aws file
// Else Attempt to use the Prop Sheet's filename
GetDiskBaseNameWithAWS(szFilename);
if (szFilename[0] == 0)
{
strcpy(szFilename, Snapshot_GetFilename());
}
}
else // Load (or Browse)
{
// Attempt to use the Prop Sheet's filename first
// Else attempt to use drive1's image name as the name for the .aws file
strcpy(szFilename, Snapshot_GetFilename());
if (szFilename[0] == 0)
{
GetDiskBaseNameWithAWS(szFilename);
}
strcpy(szDirectory, Snapshot_GetPath());
}
if (szDirectory[0] == 0)
strcpy(szDirectory, g_sCurrentDir);
//
OPENFILENAME ofn;
ZeroMemory(&ofn,sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hWindow;
ofn.hInstance = g_hInstance;
if (bSave)
{
ofn.lpstrFilter = TEXT("Save State files (*.aws.yaml)\0*.aws.yaml\0");
TEXT("All Files\0*.*\0");
}
else
{
ofn.lpstrFilter = TEXT("Save State files (*.aws,*.aws.yaml)\0*.aws;*.aws.yaml\0");
TEXT("All Files\0*.*\0");
}
ofn.lpstrFile = szFilename; // Dialog strips the last .EXT from this string (eg. file.aws.yaml is displayed as: file.aws
ofn.nMaxFile = MAX_PATH;
ofn.lpstrInitialDir = szDirectory;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_HIDEREADONLY;
ofn.lpstrTitle = pszTitle;
int nRes = bSave ? GetSaveFileName(&ofn) : GetOpenFileName(&ofn);
if(nRes)
{
if (bSave) // Only for saving (allow loading of any file for backwards compatibility)
{
// Append .aws.yaml if it's not there
const char szAWS_EXT1[] = ".aws";
const char szAWS_EXT2[] = ".yaml";
const char szAWS_EXT3[] = ".aws.yaml";
const UINT uStrLenFile = strlen(&szFilename[ofn.nFileOffset]);
const UINT uStrLenExt1 = strlen(szAWS_EXT1);
const UINT uStrLenExt2 = strlen(szAWS_EXT2);
const UINT uStrLenExt3 = strlen(szAWS_EXT3);
if (uStrLenFile <= uStrLenExt1)
{
strcpy(&szFilename[ofn.nFileOffset+uStrLenFile], szAWS_EXT3); // "file" += ".aws.yaml"
}
else if (uStrLenFile <= uStrLenExt2)
{
if (strcmp(&szFilename[ofn.nFileOffset+uStrLenFile-uStrLenExt1], szAWS_EXT1) == 0)
strcpy(&szFilename[ofn.nFileOffset+uStrLenFile-uStrLenExt1], szAWS_EXT3); // "file.aws" -> "file" + ".aws.yaml"
else
strcpy(&szFilename[ofn.nFileOffset+uStrLenFile], szAWS_EXT3); // "file" += ".aws.yaml"
}
else if ((uStrLenFile <= uStrLenExt3) || (strcmp(&szFilename[ofn.nFileOffset+uStrLenFile-uStrLenExt3], szAWS_EXT3) != 0))
{
if (strcmp(&szFilename[ofn.nFileOffset+uStrLenFile-uStrLenExt1], szAWS_EXT1) == 0)
strcpy(&szFilename[ofn.nFileOffset+uStrLenFile-uStrLenExt1], szAWS_EXT3); // "file.aws" -> "file" + ".aws.yaml"
else if (strcmp(&szFilename[ofn.nFileOffset+uStrLenFile-uStrLenExt2], szAWS_EXT2) == 0)
strcpy(&szFilename[ofn.nFileOffset+uStrLenFile-uStrLenExt2], szAWS_EXT3); // "file.yaml" -> "file" + ".aws.yaml"
else
strcpy(&szFilename[ofn.nFileOffset+uStrLenFile], szAWS_EXT3); // "file" += ".aws.yaml"
}
}
strcpy(m_szSSNewFilename, &szFilename[ofn.nFileOffset]);
strcpy(m_szSSNewPathname, szFilename);
szFilename[ofn.nFileOffset] = 0;
if (_tcsicmp(szDirectory, szFilename))
strcpy(m_szSSNewDirectory, szFilename);
}
m_bSSNewFilename = nRes ? true : false;
return nRes;
}
// On OK: Optionally post a single "uAfterClose" msg after last page closes
void CPropertySheetHelper::PostMsgAfterClose(HWND hWnd, PAGETYPE page)
{
m_bmPages &= ~(1<<(UINT32)page);
if (m_bmPages)
return; // Still pages to close
//
if (m_ConfigNew.m_uSaveLoadStateMsg && IsOkToSaveLoadState(hWnd, IsConfigChanged()))
{
// Drop any config change, and do load/save state
PostMessage(g_hFrameWindow, m_ConfigNew.m_uSaveLoadStateMsg, 0, 0);
return;
}
if (m_bDoBenchmark)
{
// Drop any config change, and do benchmark
PostMessage(g_hFrameWindow, WM_USER_BENCHMARK, 0, 0); // NB. doesn't do WM_USER_RESTART
return;
}
UINT uAfterClose = 0;
if (m_ConfigNew.m_Apple2Type == A2TYPE_CLONE)
{
MessageBox(hWnd, "Error - Unable to change configuration\n\nReason: A specific clone wasn't selected from the Advanced tab", g_pAppTitle, MB_ICONSTOP | MB_SETFOREGROUND);
return;
}
_ASSERT(m_ConfigNew.m_CpuType != CPU_UNKNOWN); // NB. Could only ever be CPU_UNKNOWN for a clone (and only if a mistake was made when adding a new clone)
if (m_ConfigNew.m_CpuType == CPU_UNKNOWN)
{
m_ConfigNew.m_CpuType = ProbeMainCpuDefault(m_ConfigNew.m_Apple2Type);
}
if (IsConfigChanged())
{
if (!CheckChangesForRestart(hWnd))
{
// Cancelled
RestoreCurrentConfig();
return;
}
ApplyNewConfig();
uAfterClose = WM_USER_RESTART;
}
if (uAfterClose)
PostMessage(g_hFrameWindow, uAfterClose, 0, 0);
}
bool CPropertySheetHelper::CheckChangesForRestart(HWND hWnd)
{
if (!HardwareConfigChanged(hWnd))
return false; // Cancelled
if (!IsOkToRestart(hWnd))
return false; // Cancelled
return true; // OK
}
#define CONFIG_CHANGED_LOCAL(var) \
(ConfigOld.var != ConfigNew.var)
// Apply changes to Registry
void CPropertySheetHelper::ApplyNewConfig(const CConfigNeedingRestart& ConfigNew, const CConfigNeedingRestart& ConfigOld)
{
if (CONFIG_CHANGED_LOCAL(m_Apple2Type))
{
SaveComputerType(ConfigNew.m_Apple2Type);
}
if (CONFIG_CHANGED_LOCAL(m_CpuType))
{
SaveCpuType(ConfigNew.m_CpuType);
}
if (CONFIG_CHANGED_LOCAL(m_Slot[4]))
SetSlot4(ConfigNew.m_Slot[4]);
if (CONFIG_CHANGED_LOCAL(m_Slot[5]))
SetSlot5(ConfigNew.m_Slot[5]);
if (CONFIG_CHANGED_LOCAL(m_bEnableHDD))
{
REGSAVE(TEXT(REGVALUE_HDD_ENABLED), ConfigNew.m_bEnableHDD ? 1 : 0);
}
if (CONFIG_CHANGED_LOCAL(m_bEnableTheFreezesF8Rom))
{
REGSAVE(TEXT(REGVALUE_THE_FREEZES_F8_ROM), ConfigNew.m_bEnableTheFreezesF8Rom);
}
}
void CPropertySheetHelper::ApplyNewConfig(void)
{
ApplyNewConfig(m_ConfigNew, m_ConfigOld);
}
void CPropertySheetHelper::SaveCurrentConfig(void)
{
// NB. clone-type is encoded in g_Apple2Type
m_ConfigOld.m_Apple2Type = GetApple2Type();
m_ConfigOld.m_CpuType = GetMainCpu();
m_ConfigOld.m_Slot[4] = g_Slot4;
m_ConfigOld.m_Slot[5] = g_Slot5;
m_ConfigOld.m_bEnableHDD = HD_CardIsEnabled();
m_ConfigOld.m_bEnableTheFreezesF8Rom = sg_PropertySheet.GetTheFreezesF8Rom();
// Reset flags each time:
m_ConfigOld.m_uSaveLoadStateMsg = 0;
m_bDoBenchmark = false;
// Setup ConfigNew
m_ConfigNew = m_ConfigOld;
}
void CPropertySheetHelper::RestoreCurrentConfig(void)
{
// NB. clone-type is encoded in g_Apple2Type
SetApple2Type(m_ConfigOld.m_Apple2Type);
SetMainCpu(m_ConfigOld.m_CpuType);
g_Slot4 = m_ConfigOld.m_Slot[4];
g_Slot5 = m_ConfigOld.m_Slot[5];
HD_SetEnabled(m_ConfigOld.m_bEnableHDD);
sg_PropertySheet.SetTheFreezesF8Rom(m_ConfigOld.m_bEnableTheFreezesF8Rom);
}
bool CPropertySheetHelper::IsOkToSaveLoadState(HWND hWnd, const bool bConfigChanged)
{
if (bConfigChanged)
{
if (MessageBox(hWnd,
TEXT("The hardware configuration has changed. Save/Load state will lose these changes.\n\n")
TEXT("Are you sure you want to do this?"),
TEXT(REG_CONFIG),
MB_ICONQUESTION | MB_OKCANCEL | MB_SETFOREGROUND) == IDCANCEL)
return false;
}
return true;
}
bool CPropertySheetHelper::IsOkToRestart(HWND hWnd)
{
if (g_nAppMode == MODE_LOGO)
return true;
if (MessageBox(hWnd,
TEXT("Restarting the emulator will reset the state ")
TEXT("of the emulated machine, causing you to lose any ")
TEXT("unsaved work.\n\n")
TEXT("Are you sure you want to do this?"),
TEXT(REG_CONFIG),
MB_ICONQUESTION | MB_OKCANCEL | MB_SETFOREGROUND) == IDCANCEL)
return false;
return true;
}
#define CONFIG_CHANGED(var) \
(m_ConfigOld.var != m_ConfigNew.var)
bool CPropertySheetHelper::HardwareConfigChanged(HWND hWnd)
{
std::string strMsg("The emulator needs to restart as the hardware configuration has changed:\n");
strMsg += "\n";
std::string strMsgMain;
{
if (CONFIG_CHANGED(m_Apple2Type))
strMsgMain += ". Emulated computer has changed\n";
if (CONFIG_CHANGED(m_CpuType))
strMsgMain += ". Emulated main CPU has changed\n";
if (CONFIG_CHANGED(m_Slot[4]))
strMsgMain += GetSlot(4);
if (CONFIG_CHANGED(m_Slot[5]))
strMsgMain += GetSlot(5);
if (CONFIG_CHANGED(m_bEnableHDD))
strMsgMain += ". Harddisk(s) have been plugged/unplugged\n";
if (CONFIG_CHANGED(m_bEnableTheFreezesF8Rom))
strMsgMain += ". F8 ROM changed (The Freeze's F8 Rom)\n";
}
std::string strMsgPost("\n");
strMsgPost += "This change will not take effect until the next time you restart the emulator.\n\n";
strMsgPost += "Would you like to restart the emulator now?";
strMsg += strMsgMain;
strMsg += strMsgPost;
if (MessageBox(hWnd,
strMsg.c_str(),
TEXT(REG_CONFIG),
MB_ICONQUESTION | MB_OKCANCEL | MB_SETFOREGROUND) == IDCANCEL)
return false;
return true;
}
std::string CPropertySheetHelper::GetSlot(const UINT uSlot)
{
// strMsg = ". Slot n: ";
std::string strMsg(". Slot ");
strMsg += '0' + uSlot;
strMsg += ": ";
const SS_CARDTYPE OldCardType = m_ConfigOld.m_Slot[uSlot];
const SS_CARDTYPE NewCardType = m_ConfigNew.m_Slot[uSlot];
if ((OldCardType == CT_Empty) || (NewCardType == CT_Empty))
{
if (NewCardType == CT_Empty)
{
strMsg += GetCardName(OldCardType);
strMsg += " card removed\n";
}
else
{
strMsg += GetCardName(NewCardType);
strMsg += " card added\n";
}
}
else
{
strMsg += GetCardName(OldCardType);
strMsg += " card removed & ";
strMsg += GetCardName(NewCardType);
strMsg += " card added\n";
}
return strMsg;
}
std::string CPropertySheetHelper::GetCardName(const SS_CARDTYPE CardType)
{
switch (CardType)
{
case CT_Empty:
return "Empty";
case CT_Disk2: // Apple Disk][
return "Disk][";
case CT_SSC: // Apple Super Serial Card
return "Super Serial";
case CT_MockingboardC: // Soundcard
return "Mockingboard";
case CT_GenericPrinter:
return "Printer";
case CT_GenericHDD: // Hard disk
return "Hard Disk";
case CT_GenericClock:
return "Clock";
case CT_MouseInterface:
return "Mouse";
case CT_Z80:
return "CP/M";
case CT_Phasor: // Soundcard
return "Phasor";
case CT_Echo: // Soundcard
return "Echo";
case CT_SAM: // Soundcard: Software Automated Mouth
return "SAM";
default:
return "Unknown";
}
}