1 |
|
/* |
2 |
|
* macos_util.cpp - MacOS definitions/utility functions |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-1999 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2001 Christian Bauer |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
20 |
|
|
21 |
|
#include "sysdeps.h" |
22 |
|
#include "cpu_emulation.h" |
23 |
+ |
#include "adb.h" |
24 |
|
#include "main.h" |
25 |
|
#include "sony.h" |
26 |
|
#include "disk.h" |
35 |
|
* Enqueue QElem to list |
36 |
|
*/ |
37 |
|
|
38 |
< |
void Enqueue(uint32 elem, uint32 list) |
38 |
> |
void EnqueueMac(uint32 elem, uint32 list) |
39 |
|
{ |
40 |
|
WriteMacInt32(elem + qLink, 0); |
41 |
|
if (!ReadMacInt32(list + qTail)) { |
57 |
|
uint32 e = ReadMacInt32(0x308 + qHead); |
58 |
|
while (e) { |
59 |
|
uint32 d = e - dsQLink; |
60 |
< |
if (ReadMacInt16(d + dsQDrive) == num) |
60 |
> |
if ((int)ReadMacInt16(d + dsQDrive) == num) |
61 |
|
return false; |
62 |
|
e = ReadMacInt32(e + qLink); |
63 |
|
} |
87 |
|
|
88 |
|
|
89 |
|
/* |
89 |
– |
* Test if basic MacOS initializations (of the ROM) are done |
90 |
– |
*/ |
91 |
– |
|
92 |
– |
bool HasMacStarted(void) |
93 |
– |
{ |
94 |
– |
return ReadMacInt32(0xcfc) == 'WLSC'; // Mac warm start flag |
95 |
– |
} |
96 |
– |
|
97 |
– |
|
98 |
– |
/* |
90 |
|
* Calculate disk image file layout given file size and first 256 data bytes |
91 |
|
*/ |
92 |
|
|
102 |
|
real_size = size - start_byte; |
103 |
|
} |
104 |
|
} |
105 |
+ |
|
106 |
+ |
|
107 |
+ |
uint32 DebugUtil(uint32 Selector) |
108 |
+ |
{ |
109 |
+ |
switch (Selector) |
110 |
+ |
{ |
111 |
+ |
case duDebuggerGetMax: |
112 |
+ |
return 3; |
113 |
+ |
case duDebuggerEnter: |
114 |
+ |
return 0; |
115 |
+ |
case duDebuggerExit: |
116 |
+ |
return 0; |
117 |
+ |
case duDebuggerPoll: |
118 |
+ |
ADBInterrupt(); |
119 |
+ |
return 0; |
120 |
+ |
default: |
121 |
+ |
return (uint32) paramErr; |
122 |
+ |
} |
123 |
+ |
} |
124 |
+ |
|