Skip to content

Commit 8b37697

Browse files
committed
All attached HDs are marked as bootable
1 parent 90d92bd commit 8b37697

File tree

9 files changed

+21
-61
lines changed

9 files changed

+21
-61
lines changed

Emulator/VAmiga/Components/Zorro/HdController.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,13 @@ HdController::spypeek16(u32 addr) const
263263
case EXPROM_SIZE + 4:
264264

265265
// Should auto boot be disabled?
266-
if (df0.hasDisk() || !drive.hasBootBlock()) {
266+
/*
267+
if (df0.hasDisk() && ...) {
267268
268269
debug(HDR_DEBUG, "Disabling auto boot\n");
269270
return u16(true);
270271
}
271-
272+
*/
272273
return u16(false);
273274

274275
case EXPROM_SIZE + 6:

Emulator/VAmiga/Foundation/Defaults.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ Defaults::Defaults()
113113
setFallback(Opt::DRIVE_POLL_VOLUME, 0, { 0, 1, 2, 3 });
114114
setFallback(Opt::DRIVE_INSERT_VOLUME, 50, { 0, 1, 2, 3 });
115115
setFallback(Opt::DRIVE_EJECT_VOLUME, 50, { 0, 1, 2, 3 });
116-
setFallback(Opt::HDC_CONNECT, true, { 0 });
117-
setFallback(Opt::HDC_CONNECT, false, { 1, 2, 3 });
116+
// setFallback(Opt::HDC_CONNECT, true, { 0 });
117+
setFallback(Opt::HDC_CONNECT, false, { 0, 1, 2, 3 });
118118
setFallback(Opt::HDR_TYPE, (i64)HardDriveType::GENERIC, { 0, 1, 2, 3 });
119119
setFallback(Opt::HDR_PAN, 300, { 0, 2 });
120120
setFallback(Opt::HDR_PAN, 100, { 1, 3 });

Emulator/VAmiga/Media/DiskFiles/HDFFile.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,11 @@ HDFFile::getPartitionDescriptor(isize part) const
156156

157157
assert(part == 0);
158158

159-
// Add a default partition spanning the whole disk
159+
// Add a default partition spanning the entire disk
160160
auto geo = getGeometryDescriptor();
161161
result = PartitionDescriptor(geo);
162162

163-
// Make the first partition bootable if a boot block exists
164-
// if (hasBootBlock()) result.flags |= 1;
163+
// Make the first partition bootable
165164
result.flags |= 1;
166165
}
167166

@@ -300,17 +299,6 @@ HDFFile::getInfo() const
300299
return info;
301300
}
302301

303-
bool
304-
HDFFile::hasBootBlock() const
305-
{
306-
if (data.size > 512) {
307-
for (isize i = 12; i < 512; i++) {
308-
if (data[i]) return true;
309-
}
310-
}
311-
return false;
312-
}
313-
314302
bool
315303
HDFFile::hasRDB() const
316304
{

Emulator/VAmiga/Media/DiskFiles/HDFFile.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,6 @@ class HDFFile : public DiskFile {
117117
// Returns the (predicted) geometry for this disk
118118
const GeometryDescriptor getGeometry() const { return geometry; }
119119

120-
// Returns true if this image contains a boot block
121-
bool hasBootBlock() const;
122-
123120
// Returns true if this image contains a rigid disk block
124121
bool hasRDB() const;
125122

Emulator/VAmiga/Peripherals/Drive/HardDrive.cpp

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,15 @@ HardDrive::init(const GeometryDescriptor &geometry)
101101

102102
// Create the drive description
103103
this->geometry = geometry;
104-
ptable.push_back(PartitionDescriptor(geometry));
104+
105+
// Add a default partition spanning the entire disk
106+
auto partition = PartitionDescriptor(geometry);
107+
108+
// Make the partition bootable
109+
partition.flags |= 1;
110+
111+
// Add the descriptor to the partition table
112+
ptable.push_back(partition);
105113

106114
// Create the new drive
107115
data.resize(geometry.numBytes());
@@ -161,12 +169,10 @@ HardDrive::init(const HDFFile &hdf)
161169
if (auto value = hdf.getControllerRevision(); value) controllerRevision = *value;
162170

163171
// Copy geometry
164-
assert(hdf.geometry == hdf.getGeometryDescriptor());
165-
geometry = hdf.getGeometryDescriptor(); // TODO: Replace by " = hdf.geometry" (?!)
172+
geometry = hdf.geometry;
166173

167174
// Copy partition table
168-
ptable = hdf.getPartitionDescriptors(); // TODO: Replace by " = hdf.ptable" (?!)
169-
assert(ptable.size() == hdf.getPartitionDescriptors().size());
175+
ptable = hdf.ptable;
170176

171177
// Copy over all needed file system drivers
172178
for (const auto &driver : hdf.drivers) {
@@ -399,8 +405,6 @@ HardDrive::_dump(Category category, std::ostream& os) const
399405
os << HardDriveStateEnum::key(state) << std::endl;
400406
os << tab("Flags");
401407
os << DiskFlagsEnum::mask(flags) << std::endl;
402-
os << tab("Boot block");
403-
os << bol(hasBootBlock()) << std::endl;
404408
os << tab("Capacity");
405409
os << dec(cap1) << "." << dec(cap2) << " MB" << std::endl;
406410
geometry.dump(os);
@@ -499,17 +503,6 @@ HardDrive::setProtectionFlag(bool value)
499503
if (hasDisk()) setFlag(DiskFlags::PROTECTED, value);
500504
}
501505

502-
bool
503-
HardDrive::hasBootBlock() const
504-
{
505-
if (data.size > 512) {
506-
for (isize i = 12; i < 512; i++) {
507-
if (data[i]) return true;
508-
}
509-
}
510-
return false;
511-
}
512-
513506
string
514507
HardDrive::defaultName(isize partition) const
515508
{

Emulator/VAmiga/Peripherals/Drive/HardDrive.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,6 @@ class HardDrive final : public Drive, public Inspectable<HardDriveInfo> {
263263
bool hasProtectedDisk() const override;
264264
void setModificationFlag(bool value) override;
265265
void setProtectionFlag(bool value) override;
266-
267-
bool hasBootBlock() const;
268266

269267

270268
//

Emulator/VAmiga/Utilities/Compression.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,10 @@ gunzip(u8 *compressed, isize len, std::vector<u8> &result, isize sizeEstimate)
222222

223223
#else
224224

225-
void
226-
gzip(u8 *uncompressed, isize len, std::vector<u8> &result) {
225+
void gzip(u8 *uncompressed, isize len, std::vector<u8> &result) {
227226
throw std::runtime_error("No zlib support.");
228227
}
229-
void gunzip(u8 *compressed, isize len, std::vector<u8> &result) {
228+
void gunzip(u8 *compressed, isize len, std::vector<u8> &result, isize sizeEstimate) {
230229
throw std::runtime_error("No zlib support.");
231230
}
232231

Emulator/VAmigaCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ int main(int argc, char *argv[])
3434
std::cout << " <script> Execute this script instead of the default" << std::endl;
3535
std::cout << std::endl;
3636

37-
if (auto what = string(e.what()); !what.empty()) {
37+
if (auto what = std::string(e.what()); !what.empty()) {
3838
std::cout << what << std::endl;
3939
}
4040

vAmiga.xcodeproj/xcuserdata/hoff.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -261,21 +261,5 @@
261261
landmarkType = "21">
262262
</BreakpointContent>
263263
</BreakpointProxy>
264-
<BreakpointProxy
265-
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
266-
<BreakpointContent
267-
uuid = "CDE299FF-8C61-4C06-8687-58C4FB2E8AF2"
268-
shouldBeEnabled = "No"
269-
ignoreCount = "0"
270-
continueAfterRunningActions = "No"
271-
filePath = "Emulator/VAmiga/Components/Zorro/HdController.cpp"
272-
startingColumnNumber = "9223372036854775807"
273-
endingColumnNumber = "9223372036854775807"
274-
startingLineNumber = "268"
275-
endingLineNumber = "268"
276-
landmarkName = "HdController::spypeek16(addr)"
277-
landmarkType = "7">
278-
</BreakpointContent>
279-
</BreakpointProxy>
280264
</Breakpoints>
281265
</Bucket>

0 commit comments

Comments
 (0)