Revert "ioport: driver shortname in the INP file header should be 16 characters"

This reverts commit f33e0ca126.
This commit is contained in:
mahlemiut 2017-02-16 14:18:34 +13:00
parent cf6de9abb0
commit 6ed0bad7f8

View File

@ -681,14 +681,11 @@ class inp_header
public:
// parameters
static constexpr unsigned MAJVERSION = 3;
static constexpr unsigned MINVERSION = 1;
static constexpr unsigned MINVERSION = 0;
bool read(emu_file &f)
{
bool ret = f.read(m_data, sizeof(m_data)) == sizeof(m_data);
if(get_minversion() < 1)
f.seek(-4,SEEK_CUR); // adjust for smaller v3.0 header
return ret;
return f.read(m_data, sizeof(m_data)) == sizeof(m_data);
}
bool write(emu_file &f) const
{
@ -721,17 +718,11 @@ public:
}
std::string get_sysname() const
{
if(get_minversion() < 1)
return get_string<OFFS_SYSNAME, OFFS_APPDESC - 4>(); // v3.0 INPs have maximum 12 character shortnames
else
return get_string<OFFS_SYSNAME, OFFS_APPDESC>();
return get_string<OFFS_SYSNAME, OFFS_APPDESC>();
}
std::string get_appdesc() const
{
if(get_minversion() < 1)
return get_string<OFFS_APPDESC - 4, OFFS_END - 4>();
else
return get_string<OFFS_APPDESC, OFFS_END>();
return get_string<OFFS_APPDESC, OFFS_END>();
}
void set_magic()
@ -782,9 +773,9 @@ private:
static constexpr std::size_t OFFS_MAJVERSION = 0x10; // 0x01 bytes (binary integer)
static constexpr std::size_t OFFS_MINVERSION = 0x11; // 0x01 bytes (binary integer)
// 0x02 bytes reserved
static constexpr std::size_t OFFS_SYSNAME = 0x14; // 0x10 bytes (ASCII)
static constexpr std::size_t OFFS_APPDESC = 0x24; // 0x20 bytes (ASCII)
static constexpr std::size_t OFFS_END = 0x44;
static constexpr std::size_t OFFS_SYSNAME = 0x14; // 0x0c bytes (ASCII)
static constexpr std::size_t OFFS_APPDESC = 0x20; // 0x20 bytes (ASCII)
static constexpr std::size_t OFFS_END = 0x40;
static u8 const MAGIC[OFFS_BASETIME - OFFS_MAGIC];