2020-02-28 16:04:28 +00:00
|
|
|
/*
|
|
|
|
DingusPPC - The Experimental PowerPC Macintosh emulator
|
|
|
|
Copyright (C) 2018-20 divingkatae and maximum
|
|
|
|
(theweirdo) spatium
|
|
|
|
|
|
|
|
(Contact divingkatae#1017 or powermax#2286 on Discord for more info)
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2019-07-02 02:15:33 +00:00
|
|
|
|
|
|
|
//The main runfile - main.cpp
|
|
|
|
//This is where the magic begins
|
|
|
|
|
2020-02-24 03:59:10 +00:00
|
|
|
#include <thirdparty/loguru.hpp>
|
2019-07-02 02:15:33 +00:00
|
|
|
#include <iostream>
|
|
|
|
#include <cstring>
|
|
|
|
#include <cinttypes>
|
|
|
|
#include <stdio.h>
|
2019-12-27 19:10:36 +00:00
|
|
|
#include "ppcemu.h"
|
2019-12-14 12:48:54 +00:00
|
|
|
#include "debugger/debugger.h"
|
2020-03-13 21:49:58 +00:00
|
|
|
#include "machines/machinefactory.h"
|
2019-07-02 02:15:33 +00:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
|
2019-07-12 05:27:14 +00:00
|
|
|
std::cout << "DingusPPC - Prototype 5bf4 (7/14/2019) " << endl;
|
2019-07-02 02:15:33 +00:00
|
|
|
std::cout << "Written by divingkatae, (c) 2019. " << endl;
|
|
|
|
std::cout << "This is not intended for general use. " << endl;
|
|
|
|
std::cout << "Use at your own discretion. " << endl;
|
|
|
|
|
2020-02-27 02:51:07 +00:00
|
|
|
if (argc > 1) {
|
|
|
|
string checker = argv[1];
|
|
|
|
cout << checker << endl;
|
2020-02-24 03:59:10 +00:00
|
|
|
|
2020-02-27 02:51:07 +00:00
|
|
|
if ((checker == "1") || (checker == "realtime") || \
|
|
|
|
(checker == "-realtime") || (checker == "/realtime")) {
|
|
|
|
loguru::g_stderr_verbosity = loguru::Verbosity_OFF;
|
2020-02-28 01:41:02 +00:00
|
|
|
loguru::g_preamble_date = false;
|
|
|
|
loguru::g_preamble_time = false;
|
|
|
|
loguru::g_preamble_thread = false;
|
2020-02-27 02:51:07 +00:00
|
|
|
loguru::init(argc, argv);
|
|
|
|
loguru::add_file("dingusppc.log", loguru::Append, 0);
|
|
|
|
//Replace the above line with this for maximum debugging detail:
|
|
|
|
//loguru::add_file("dingusppc.log", loguru::Append, loguru::Verbosity_MAX);
|
|
|
|
}
|
|
|
|
else if ((checker == "debugger") || (checker == "/debugger") ||
|
|
|
|
(checker == "-debugger")) {
|
|
|
|
loguru::g_stderr_verbosity = 0;
|
2020-02-28 01:41:02 +00:00
|
|
|
loguru::g_preamble_date = false;
|
|
|
|
loguru::g_preamble_time = false;
|
|
|
|
loguru::g_preamble_thread = false;
|
|
|
|
loguru::init(argc, argv);
|
2020-02-27 02:51:07 +00:00
|
|
|
}
|
2019-07-02 02:15:33 +00:00
|
|
|
|
2020-02-27 02:51:07 +00:00
|
|
|
uint32_t rom_filesize;
|
2019-07-02 02:15:33 +00:00
|
|
|
|
2020-03-13 21:49:58 +00:00
|
|
|
if (create_machine_for_rom("rom.bin")) {
|
|
|
|
goto bail;
|
2020-02-27 02:51:07 +00:00
|
|
|
}
|
2019-07-02 02:15:33 +00:00
|
|
|
|
2020-02-27 02:51:07 +00:00
|
|
|
if ((checker == "1") || (checker == "realtime") || \
|
|
|
|
(checker == "-realtime") || (checker == "/realtime")) {
|
2019-12-28 01:49:58 +00:00
|
|
|
ppc_exec();
|
2020-01-28 01:20:18 +00:00
|
|
|
} else if ((checker == "debugger") || (checker == "/debugger") ||
|
|
|
|
(checker == "-debugger")) {
|
2019-07-17 13:24:34 +00:00
|
|
|
enter_debugger();
|
2019-07-02 02:15:33 +00:00
|
|
|
}
|
|
|
|
}
|
2020-01-28 01:20:18 +00:00
|
|
|
else {
|
2020-02-28 01:41:02 +00:00
|
|
|
std::cout << " " << endl;
|
2019-07-07 06:10:32 +00:00
|
|
|
std::cout << "Please enter one of the following commands when " << endl;
|
|
|
|
std::cout << "booting up DingusPPC... " << endl;
|
2020-02-28 01:41:02 +00:00
|
|
|
std::cout << " " << endl;
|
|
|
|
std::cout << " " << endl;
|
2019-07-07 06:10:32 +00:00
|
|
|
std::cout << "realtime - Run the emulator in real-time. " << endl;
|
2019-07-19 06:31:16 +00:00
|
|
|
std::cout << "debugger - Enter the interactive debugger. " << endl;
|
2019-07-02 02:15:33 +00:00
|
|
|
}
|
|
|
|
|
2020-03-13 21:49:58 +00:00
|
|
|
bail:
|
|
|
|
LOG_F(INFO, "Cleaning up...");
|
|
|
|
|
|
|
|
delete gMachineObj.release();
|
2019-07-02 02:15:33 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|