- [NEW] Durant l'execució la finestra de debug està dimmada

- [NEW] La finestra del spectrum mostra en el titol si està stoppada l'execució
- [FIX] Durante el debuguech la finestra del spectrum ara s'actualitza
This commit is contained in:
2024-12-10 16:42:01 +01:00
parent f08fbf9e8b
commit 085712437e
3 changed files with 25 additions and 2 deletions

View File

@@ -153,6 +153,7 @@ namespace z80debug
void stop() void stop()
{ {
zxscreen::setTitle(" (stopped)");
pause(); pause();
is_debugging = true; is_debugging = true;
show(); show();
@@ -160,6 +161,7 @@ namespace z80debug
} }
void cont() { void cont() {
zxscreen::setTitle("");
is_debugging = is_paused = false; is_debugging = is_paused = false;
//hide(); //hide();
refresh(); refresh();
@@ -380,6 +382,14 @@ namespace z80debug
ui::printtxt(strlen(console)+1,0, "\x7F", COLOR_WHITE); ui::printtxt(strlen(console)+1,0, "\x7F", COLOR_WHITE);
ui::printtxt(1,1, console_error, COLOR_RED); ui::printtxt(1,1, console_error, COLOR_RED);
if (!is_debugging) {
SDL_SetRenderDrawBlendMode(ren, SDL_BLENDMODE_BLEND);
SDL_SetRenderDrawColor(ren, 0, 0, 0, 128);
SDL_Rect rect {0,0,83*CHR_W, 34*CHR_H};
SDL_GetWindowSize(win, &rect.w, &rect.h);
SDL_RenderFillRect(ren, &rect);
}
SDL_RenderPresent(ren); SDL_RenderPresent(ren);
for (int i=0; i<65536; ++i) mem_modified[i] = false; for (int i=0; i<65536; ++i) mem_modified[i] = false;

View File

@@ -92,8 +92,12 @@ namespace zxscreen
bool eventHandler(SDL_Event *e) bool eventHandler(SDL_Event *e)
{ {
if ((e->type==SDL_WINDOWEVENT) && (e->window.event==SDL_WINDOWEVENT_CLOSE)) { if (e->type==SDL_WINDOWEVENT) {
return false; if (e->window.event==SDL_WINDOWEVENT_CLOSE) {
return false;
} else if ((e->window.event==SDL_WINDOWEVENT_SHOWN) || (e->window.event==SDL_WINDOWEVENT_EXPOSED)) {
redraw();
}
} }
if (!z80debug::debugging()) { if (!z80debug::debugging()) {
if (z80debug::paused()) { if (z80debug::paused()) {
@@ -270,6 +274,14 @@ namespace zxscreen
SDL_RenderPresent(ren); SDL_RenderPresent(ren);
} }
void setTitle(const char* title)
{
char tmp[256];
strcpy(tmp, "ZX Spectrum Screen");
strcat(tmp, title);
SDL_SetWindowTitle(win, tmp);
}
void setZoom(const int value) void setZoom(const int value)
{ {
if (value < 1) return; if (value < 1) return;

View File

@@ -10,6 +10,7 @@ namespace zxscreen
void fullrefresh(); void fullrefresh();
void redraw(const bool present=true); void redraw(const bool present=true);
void present(); void present();
void setTitle(const char* title);
void incZoom(); void incZoom();
void decZoom(); void decZoom();