- [FIX] arreglat el càlcul de adreces en opcodes que usen zero page - [FIX] Arreglat el càlcul de flags en opcodes incrementadors, decrementadors i transfers - [FIX] Si ja havem identificat una adreça de memòria com a instrucció, usar eixe tag al desensamblar cap enrere - [NEW] Càrrega de simbols al principi
51 lines
1.5 KiB
C++
51 lines
1.5 KiB
C++
#include <SDL3/SDL.h>
|
|
#include "atari2600.h"
|
|
#include "rom.h"
|
|
#include "ui.h"
|
|
#include "ui_window.h"
|
|
#include "6502debugger.h"
|
|
#include "6502dis.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");
|
|
}
|
|
m6502dis::loadSymbols();
|
|
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;
|
|
default: 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;
|
|
} |