mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-06-12 11:29:29 +00:00
Merge pull request #54 from mihaip/upstreaming
Upstream small changes from the Infinite Mac fork
This commit is contained in:
commit
55a354406a
|
@ -26,7 +26,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
|
|
||||||
#if defined(__GNUG__) && !defined(__clang__) // GCC, mybe ICC but not Clang
|
#if defined(__GNUG__) && !defined(__clang__) && (defined(__x86_64__) || defined(__i386__)) // GCC, mybe ICC but not Clang
|
||||||
|
|
||||||
# include <x86intrin.h>
|
# include <x86intrin.h>
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,8 @@ void ScsiBus::change_bus_phase(int initiator_id)
|
||||||
|
|
||||||
void ScsiBus::assert_ctrl_line(int initiator_id, uint16_t mask)
|
void ScsiBus::assert_ctrl_line(int initiator_id, uint16_t mask)
|
||||||
{
|
{
|
||||||
|
DCHECK_F(initiator_id >= 0 && initiator_id < SCSI_MAX_DEVS, "ScsiBus: invalid initiator ID %d", initiator_id);
|
||||||
|
|
||||||
uint16_t new_state = 0xFFFFU & mask;
|
uint16_t new_state = 0xFFFFU & mask;
|
||||||
|
|
||||||
this->dev_ctrl_lines[initiator_id] |= new_state;
|
this->dev_ctrl_lines[initiator_id] |= new_state;
|
||||||
|
@ -84,6 +86,8 @@ void ScsiBus::assert_ctrl_line(int initiator_id, uint16_t mask)
|
||||||
|
|
||||||
void ScsiBus::release_ctrl_line(int id, uint16_t mask)
|
void ScsiBus::release_ctrl_line(int id, uint16_t mask)
|
||||||
{
|
{
|
||||||
|
DCHECK_F(id >= 0 && id < SCSI_MAX_DEVS, "ScsiBus: invalid initiator ID %d", id);
|
||||||
|
|
||||||
uint16_t new_state = 0;
|
uint16_t new_state = 0;
|
||||||
|
|
||||||
this->dev_ctrl_lines[id] &= ~mask;
|
this->dev_ctrl_lines[id] &= ~mask;
|
||||||
|
|
11
main.cpp
11
main.cpp
|
@ -140,7 +140,7 @@ int main(int argc, char** argv) {
|
||||||
machine_str = MachineFactory::machine_name_from_rom(bootrom_path);
|
machine_str = MachineFactory::machine_name_from_rom(bootrom_path);
|
||||||
if (machine_str.empty()) {
|
if (machine_str.empty()) {
|
||||||
LOG_F(ERROR, "Could not autodetect machine");
|
LOG_F(ERROR, "Could not autodetect machine");
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LOG_F(INFO, "Machine was autodetected as: %s", machine_str.c_str());
|
LOG_F(INFO, "Machine was autodetected as: %s", machine_str.c_str());
|
||||||
|
@ -150,7 +150,7 @@ int main(int argc, char** argv) {
|
||||||
/* handle overriding of machine settings from command line */
|
/* handle overriding of machine settings from command line */
|
||||||
map<string, string> settings;
|
map<string, string> settings;
|
||||||
if (MachineFactory::get_machine_settings(machine_str, settings) < 0) {
|
if (MachineFactory::get_machine_settings(machine_str, settings) < 0) {
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLI::App sa;
|
CLI::App sa;
|
||||||
|
@ -168,7 +168,7 @@ int main(int argc, char** argv) {
|
||||||
|
|
||||||
if (SDL_Init(SDL_INIT_VIDEO)) {
|
if (SDL_Init(SDL_INIT_VIDEO)) {
|
||||||
LOG_F(ERROR, "SDL_Init error: %s", SDL_GetError());
|
LOG_F(ERROR, "SDL_Init error: %s", SDL_GetError());
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize global profiler object
|
// initialize global profiler object
|
||||||
|
@ -180,6 +180,9 @@ int main(int argc, char** argv) {
|
||||||
|
|
||||||
// graceful handling of fatal errors
|
// graceful handling of fatal errors
|
||||||
loguru::set_fatal_handler([](const loguru::Message& message) {
|
loguru::set_fatal_handler([](const loguru::Message& message) {
|
||||||
|
// Make sure the reason for the failure is visible (it may have been
|
||||||
|
// sent to the logfile only).
|
||||||
|
cerr << message.preamble << message.indentation << message.prefix << message.message << endl;
|
||||||
enter_debugger();
|
enter_debugger();
|
||||||
|
|
||||||
abort();
|
abort();
|
||||||
|
@ -206,7 +209,7 @@ int main(int argc, char** argv) {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG_F(ERROR, "Invalid EXECUTION MODE");
|
LOG_F(ERROR, "Invalid EXECUTION MODE");
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bail:
|
bail:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user