|
|
@ -5,24 +5,53 @@ |
|
|
|
* SPDX-License-Identifier: MIT |
|
|
|
* SPDX-License-Identifier: MIT |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
#include "loader.h" |
|
|
|
#include <string_view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "inferno.h" |
|
|
|
|
|
|
|
#include "inferno/entrypoint.h" |
|
|
|
#include "ruc/argparser.h" |
|
|
|
#include "ruc/argparser.h" |
|
|
|
#include "ruc/format/print.h" |
|
|
|
#include "ruc/format/print.h" |
|
|
|
#include "ruc/timer.h" |
|
|
|
#include "ruc/timer.h" |
|
|
|
#include <string_view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, const char* argv[]) |
|
|
|
#include "emu.h" |
|
|
|
{ |
|
|
|
#include "loader.h" |
|
|
|
std::string_view bootrom_path = "gbc_bios.bin"; |
|
|
|
|
|
|
|
std::string_view rom_path; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ruc::ArgParser argParser; |
|
|
|
class GarbAGE final : public Inferno::Application { |
|
|
|
argParser.addOption(bootrom_path, 'b', "bootrom", nullptr, nullptr, "", ruc::ArgParser::Required::Yes); |
|
|
|
public: |
|
|
|
argParser.addOption(rom_path, 'r', "rom", nullptr, nullptr, "", ruc::ArgParser::Required::Yes); |
|
|
|
GarbAGE(int argc, char* argv[]) |
|
|
|
argParser.parse(argc, argv); |
|
|
|
: Application() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
std::string_view bootrom_path = "gbc_bios.bin"; |
|
|
|
|
|
|
|
std::string_view rom_path; |
|
|
|
|
|
|
|
|
|
|
|
Loader::the().setBootromPath(bootrom_path); |
|
|
|
ruc::ArgParser argParser; |
|
|
|
Loader::the().loadRom(rom_path); |
|
|
|
argParser.addOption(bootrom_path, 'b', "bootrom", nullptr, nullptr, "", ruc::ArgParser::Required::Yes); |
|
|
|
|
|
|
|
argParser.addOption(rom_path, 'r', "rom", nullptr, nullptr, "", ruc::ArgParser::Required::Yes); |
|
|
|
|
|
|
|
argParser.parse(argc, argv); |
|
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
Loader::the().setBootromPath(bootrom_path); |
|
|
|
|
|
|
|
Loader::the().loadRom(rom_path); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
~GarbAGE() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void update() override |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// 154 scanlines * 456 cycles = 70224 cycles per frame
|
|
|
|
|
|
|
|
for (int i = 0; i < (144 * 456 + 10 * 456); ++i) { |
|
|
|
|
|
|
|
Emu::the().update(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void render() override |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Inferno::Application* Inferno::createApplication(int argc, char* argv[]) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
GarbAGE* gameboy = new GarbAGE(argc, argv); |
|
|
|
|
|
|
|
return gameboy; |
|
|
|
} |
|
|
|
} |
|
|
|