UX improvements for preview build

This commit is contained in:
wheremyfoodat 2023-07-09 14:07:50 +03:00
parent 5bcc35dfc8
commit b51a1aae5e
3 changed files with 10 additions and 4 deletions

View file

@ -2,6 +2,7 @@
#include <climits>
#include <cstdarg>
#include <cstdint>
#include <conio.h>
#include <iostream>
#include <iterator>
#include <sstream>
@ -36,7 +37,9 @@ namespace Helpers {
std::cout << termcolor::on_red << "[FATAL] ";
std::printf(fmt, args...);
std::cout << termcolor::reset << "\n";
std::cout << "Press any button to exit\n";
getch();
exit(1);
}

View file

@ -116,7 +116,7 @@ PICAShader::vec4f PICAShader::getSource(u32 source) {
else if (source <= 0x7f)
return floatUniforms[source - 0x20];
else {
Helpers::warn("[PICA] Unimplemented source value: %X\n", source);
//Helpers::warn("[PICA] Unimplemented source value: %X\n", source);
return vec4f({ f24::zero(), f24::zero(), f24::zero(), f24::zero() });
}
}

View file

@ -1,11 +1,14 @@
#include "emulator.hpp"
int main (int argc, char *argv[]) {
Emulator emu;
int main(int argc, char *argv[]) {
if (argc < 2) {
Helpers::panic("No ROM provided. Usage: Alber.exe <ROM here>");
}
Emulator emu;
emu.initGraphicsContext();
auto romPath = std::filesystem::current_path() / (argc > 1 ? argv[1] : "teapot.elf");
auto romPath = std::filesystem::current_path() / argv[1];
if (!emu.loadROM(romPath)) {
// For some reason just .c_str() doesn't show the proper path
Helpers::panic("Failed to load ROM file: %s", romPath.string().c_str());