mirror of
https://github.com/akuker/RASCSI.git
synced 2024-12-22 15:30:09 +00:00
41bdcd4aed
* Update logging * Remove duplicate code * Update unit tests * Clean up includes * Merge ProtobufSerializer into protobuf_util namespace * Precompile regex * Add const * Add Split() convenience method, update log level/ID parsing * Move log.h to legacy folder * Elimininate gotos * Fixes for gcc 13 * Update compiler flags * Update default folder handling * Use references instead of pointers * Move code for better encapsulation * Move code * Remove unused method argument * Move device logger * Remove redundant to_string * Rename for consistency * Update handling of protobuf pointers * Simplify protobuf usage * Memory handling update * Add hasher
65 lines
1.6 KiB
C++
65 lines
1.6 KiB
C++
//---------------------------------------------------------------------------
|
||
//
|
||
// SCSI Target Emulator PiSCSI
|
||
// for Raspberry Pi
|
||
//
|
||
// Copyright (C) 2001-2006 PI.(ytanaka@ipc-tokai.or.jp)
|
||
// Copyright (C) 2014-2020 GIMONS
|
||
// Copyright (C) akuker
|
||
//
|
||
// Licensed under the BSD 3-Clause License.
|
||
// See LICENSE file in the project root folder.
|
||
//
|
||
// [ SCSI NEC Compatible Hard Disk]
|
||
//
|
||
//---------------------------------------------------------------------------
|
||
|
||
#pragma once
|
||
|
||
#include "scsihd.h"
|
||
#include <unordered_set>
|
||
#include <map>
|
||
#include <array>
|
||
#include <vector>
|
||
|
||
using namespace std;
|
||
|
||
//===========================================================================
|
||
//
|
||
// SCSI hard disk (PC-9801-55 NEC compatible / Anex86 / T98Next)
|
||
//
|
||
//===========================================================================
|
||
class SCSIHD_NEC : public SCSIHD //NOSONAR The inheritance hierarchy depth is acceptable in this case
|
||
{
|
||
public:
|
||
|
||
explicit SCSIHD_NEC(int lun) : SCSIHD(lun, sector_sizes, false) {}
|
||
~SCSIHD_NEC() override = default;
|
||
|
||
void Open() override;
|
||
|
||
protected:
|
||
|
||
vector<uint8_t> InquiryInternal() const override;
|
||
|
||
void AddFormatPage(map<int, vector<byte>>&, bool) const override;
|
||
void AddDrivePage(map<int, vector<byte>>&, bool) const override;
|
||
|
||
private:
|
||
|
||
pair<int, int> SetParameters(span<const char>, int);
|
||
|
||
static int GetInt16LittleEndian(const uint8_t *);
|
||
static int GetInt32LittleEndian(const uint8_t *);
|
||
|
||
static inline const unordered_set<uint32_t> sector_sizes = { 512 };
|
||
|
||
// Image file offset
|
||
off_t image_offset = 0;
|
||
|
||
// Geometry data
|
||
int cylinders = 0;
|
||
int heads = 0;
|
||
int sectors = 0;
|
||
};
|