Merge pull request #54 from mihaip/upstreaming

Upstream small changes from the Infinite Mac fork
This commit is contained in:
dingusdev 2023-10-22 06:55:20 -07:00 committed by GitHub
commit 55a354406a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 5 deletions

View File

@ -26,7 +26,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#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>

View File

@ -67,6 +67,8 @@ void ScsiBus::change_bus_phase(int initiator_id)
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;
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)
{
DCHECK_F(id >= 0 && id < SCSI_MAX_DEVS, "ScsiBus: invalid initiator ID %d", id);
uint16_t new_state = 0;
this->dev_ctrl_lines[id] &= ~mask;

View File

@ -140,7 +140,7 @@ int main(int argc, char** argv) {
machine_str = MachineFactory::machine_name_from_rom(bootrom_path);
if (machine_str.empty()) {
LOG_F(ERROR, "Could not autodetect machine");
return 0;
return 1;
}
else {
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 */
map<string, string> settings;
if (MachineFactory::get_machine_settings(machine_str, settings) < 0) {
return 0;
return 1;
}
CLI::App sa;
@ -168,7 +168,7 @@ int main(int argc, char** argv) {
if (SDL_Init(SDL_INIT_VIDEO)) {
LOG_F(ERROR, "SDL_Init error: %s", SDL_GetError());
return 0;
return 1;
}
// initialize global profiler object
@ -180,6 +180,9 @@ int main(int argc, char** argv) {
// graceful handling of fatal errors
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();
abort();
@ -206,7 +209,7 @@ int main(int argc, char** argv) {
break;
default:
LOG_F(ERROR, "Invalid EXECUTION MODE");
return 0;
return 1;
}
bail: