dingusppc/machines/machineproperties.h

44 lines
1.0 KiB
C
Raw Normal View History

2020-08-22 18:05:08 +00:00
#include "endianswap.h"
#include <cinttypes>
2020-08-26 03:07:02 +00:00
#include <string>
2020-08-22 18:05:08 +00:00
#include <map>
#include <iostream>
#include <utility>
2020-08-26 03:07:02 +00:00
#ifndef MACHINE_PROPERTIES_H
#define MACHINE_PROPERTIES_H
2020-08-22 18:05:08 +00:00
using namespace std;
2020-08-26 03:07:02 +00:00
#define ILLEGAL_DEVICE_VALUE 0x168A523B
2020-08-22 18:05:08 +00:00
class StringProperty {
public:
StringProperty(string EnterString) {
StringInput = EnterString;
}
string getString() {
return StringInput;
}
uint32_t IntRep() {
try {
return strtoul(getString().c_str(), 0, 0);
} catch (string bad_string) {
cerr << "Could not convert string " << bad_string << "to an ineteger!" << endl;
2020-08-26 03:07:02 +00:00
return ILLEGAL_DEVICE_VALUE;
2020-08-22 18:05:08 +00:00
}
}
private:
2020-08-26 03:07:02 +00:00
string StringInput = std::to_string(ILLEGAL_DEVICE_VALUE);
2020-08-22 18:05:08 +00:00
};
uint32_t get_gfx_card(std::string gfx_str);
uint32_t get_cpu_type(std::string cpu_str);
void search_properties(uint32_t chosen_gestalt);
int establish_machine_presets(
const char* rom_filepath, std::string machine_str, uint32_t* ram_sizes, uint32_t gfx_mem);
2020-08-22 18:05:08 +00:00
#endif /* MACHINE_PROPERTIES_H */