Files
atari2600/source/main.cpp
T
raimon@prometeo e245410c0a - [NEW] 6502dis i 6502debugger implementats
- [FIX] font.bmp afegit
- [NEW] Afegides regles de comprobació de memòria en la versió debug de compilació en el lagueirtofile
- [FIX] la rom ha de carregar abans de atari2600::init()
- [NEW] Implementació bàsica del PIA completada.
- [FIX] El framebuffer intern en el mòdul TIA era incorrecte.
- [NEW] Afegits accesors als registres del 6502
- [NEW] m6502::reset()
- [FIX] [6502m] Corregits opcodes amb direccionament implicit: CLC, SEC, PHA, CLI, PLA, SEI, DEY, TXA, TYA, TXS, TAY, TAX, CLV, TSX, INY, DEX, CLD, INX, NOP i SED). Augmentaven el PC una posició de més.
2026-09-17 17:43:33 +02:00

49 lines
1.4 KiB
C++

#include <SDL3/SDL.h>
#include "atari2600.h"
#include "rom.h"
#include "ui.h"
#include "ui_window.h"
#include "6502debugger.h"
int main(int argc, char *argv[]) {
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO);
if (argc > 1) {
rom::load(argv[1]);
} else {
rom::load("combat.bin");
}
atari2600::init();
atari2600::pause();
m6502debugger::show();
int wait = 16;
SDL_Event e;
while (!atari2600::is_quitting()) {
wait--;
if (wait==0) {
wait = 16;
if (atari2600::is_paused()) SDL_WaitEventTimeout(NULL, 1000);
while (SDL_PollEvent(&e)) {
bool result = true;
if (e.type == SDL_EVENT_QUIT) { atari2600::quit(); break; }
if (e.type == SDL_EVENT_KEY_DOWN) {
if (atari2600::is_paused()) {
switch (e.key.scancode) {
case SDL_SCANCODE_F10: atari2600::step(); m6502debugger::refresh(); break;
}
}
}
SDL_Window* window = SDL_GetWindowFromEvent(&e);
if (!ui::window::sendEvent(SDL_GetWindowID(window), &e)) { atari2600::quit(); break; }
}
}
if (!atari2600::is_paused()) atari2600::step();
ui::setClicked(false);
}
SDL_Quit();
return 0;
}