This commit is contained in:
2026-05-15 09:45:26 +02:00
parent 9a2d437b24
commit 723e66871d
5 changed files with 52 additions and 12 deletions
+13 -4
View File
@@ -34,8 +34,14 @@ int main(int argc, char **argv) {
},
"DOL binary to load");
if (!flags.parse(argc, argv))
if (argc < 3) {
flags.print_usage("./weee <binary type flag> <binary path>",
"Available options:", "https://git.irco.sh/weeemu/weee");
return -1;
}
if (!flags.parse(argc, argv))
return -2;
SDL_Init(SDL_INIT_VIDEO);
SDL_Window *window = SDL_CreateWindow("weee", 800, 600, SDL_WINDOW_HIGH_PIXEL_DENSITY | SDL_WINDOW_RESIZABLE);
@@ -44,7 +50,8 @@ int main(int argc, char **argv) {
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0);
SDL_SetRenderLogicalPresentation(renderer, 640, 480, SDL_LOGICAL_PRESENTATION_LETTERBOX);
ircolib::u8 *rgbTexture = (ircolib::u8 *)calloc(640 * 240, 3);
std::vector<ircolib::u8> rgbTexture;
rgbTexture.resize(640 * 240 * 3);
bool open = true;
while (open) {
@@ -62,14 +69,16 @@ int main(int argc, char **argv) {
}
SDL_ConvertPixels(640, 240, SDL_PIXELFORMAT_UYVY, &mem.mem1[0x104000], 640 * 4, SDL_PIXELFORMAT_BGR24,
rgbTexture, 640 * 3);
rgbTexture.data(), 640 * 3);
SDL_RenderClear(renderer);
SDL_UpdateTexture(texture, nullptr, rgbTexture, 640 * 3);
SDL_UpdateTexture(texture, nullptr, rgbTexture.data(), 640 * 3);
SDL_RenderTexture(renderer, texture, nullptr, nullptr);
SDL_RenderPresent(renderer);
}
SDL_DestroyTexture(texture);
SDL_DestroyRenderer(renderer);
SDL_DestroyWindow(window);
SDL_Quit();