- [CHG] mode berserk passa a per Fast Tape. sistema de Opcions.
- [NEW] Opció per a parar execució al acabar de carregar una cinta. - [NEW] Opció per a parar l'execució al trobar una instrucció del Z80 no vàlida - [NEW] Savestate del Fernando Martin, per a provar més ràpid. - [NEW] Treballant en el sistema d'anàlisi visual del codi
This commit is contained in:
34
main.cpp
34
main.cpp
@@ -10,6 +10,7 @@
|
||||
#include <string.h>
|
||||
#include "ui.h"
|
||||
#include "ui_menu.h"
|
||||
#include "z80analyze.h"
|
||||
|
||||
uint8_t memory[65536];
|
||||
uint32_t time = 0;
|
||||
@@ -24,10 +25,16 @@ namespace actions
|
||||
zxscreen::refresh(dt);
|
||||
}
|
||||
|
||||
int berserk(int value)
|
||||
int fastload(int value)
|
||||
{
|
||||
zx_tape::setberserk(!zx_tape::getberserk());
|
||||
return zx_tape::getberserk();
|
||||
zx_tape::toggleOption(ZXTAPE_OPTION_FAST_LOAD);
|
||||
return zx_tape::getOption(ZXTAPE_OPTION_FAST_LOAD);
|
||||
}
|
||||
|
||||
int stopatend(int value)
|
||||
{
|
||||
zx_tape::toggleOption(ZXTAPE_OPTION_STOP_AT_END);
|
||||
return zx_tape::getOption(ZXTAPE_OPTION_STOP_AT_END);
|
||||
}
|
||||
|
||||
int decZoom(int value)
|
||||
@@ -47,6 +54,12 @@ namespace actions
|
||||
zxscreen::toggleFullscreen();
|
||||
return zxscreen::getFullscreen();
|
||||
}
|
||||
|
||||
int showAnalyzer(int value)
|
||||
{
|
||||
z80analyze::show();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@@ -73,13 +86,18 @@ int main(int argc, char *argv[])
|
||||
ui::menu::addoption(menu, "SAVE STATE", nullptr);
|
||||
|
||||
menu = ui::menu::addsubmenu("TAPE");
|
||||
ui::menu::addbooloption(menu, "BERSERK MODE", zx_tape::getberserk(), actions::berserk);
|
||||
ui::menu::addbooloption(menu, "BERSERK MODE", zx_tape::getOption(ZXTAPE_OPTION_FAST_LOAD), actions::fastload);
|
||||
ui::menu::addbooloption(menu, "STOP AT END", zx_tape::getOption(ZXTAPE_OPTION_STOP_AT_END), actions::stopatend);
|
||||
|
||||
menu = ui::menu::addsubmenu("SCREEN");
|
||||
ui::menu::addoption(menu, "DEC ZOOM", actions::decZoom);
|
||||
ui::menu::addoption(menu, "INC ZOOM", actions::incZoom);
|
||||
ui::menu::addbooloption(menu, "FULLSCREEN", zxscreen::getFullscreen(), actions::fullscreen);
|
||||
|
||||
menu = ui::menu::addsubmenu("EMULATION");
|
||||
ui::menu::addbooloption(menu, "STOP ON INVALID OP", z80::getOption(Z80_OPTION_STOP_ON_INVALID), actions::decZoom);
|
||||
ui::menu::addoption(menu, "SHOW ANALYZER", actions::showAnalyzer);
|
||||
|
||||
zx_ula::sound_init();
|
||||
|
||||
zx_tape::load("fernandomartin.tap");
|
||||
@@ -206,9 +224,9 @@ int main(int argc, char *argv[])
|
||||
zxscreen::redraw();
|
||||
} else {
|
||||
//if (z80::getPC()==0x05C8) zx_tape::go_berserk();
|
||||
bool berserk=false;
|
||||
if (zx_tape::getplaying() && zx_tape::getberserk()) { berserk=true; time = SDL_GetTicks(); }
|
||||
while (zx_tape::getplaying() && zx_tape::getberserk())
|
||||
bool fastload=false;
|
||||
if (zx_tape::getplaying() && zx_tape::getOption(ZXTAPE_OPTION_FAST_LOAD)) { fastload=true; time = SDL_GetTicks(); }
|
||||
while (zx_tape::getplaying() && zx_tape::getOption(ZXTAPE_OPTION_FAST_LOAD))
|
||||
{
|
||||
// zx_tape::update(z80::step());
|
||||
uint8_t dt = z80::step();
|
||||
@@ -221,7 +239,7 @@ int main(int argc, char *argv[])
|
||||
//zx_ula::sound_update(dt);
|
||||
//zxscreen::refresh(dt);
|
||||
}
|
||||
if (berserk) { printf("%i\n", SDL_GetTicks()-time); t_states=0; }
|
||||
if (fastload) { printf("%i\n", SDL_GetTicks()-time); t_states=0; }
|
||||
// En cada bucle fem 10 pasos de la CPU, sino s'ofega
|
||||
for (int i=0;i<5;++i) {
|
||||
uint8_t dt = z80::step();
|
||||
|
||||
Reference in New Issue
Block a user