- [NEW] Zoom per a la pantalla retina

- Treballant en la càrrega instantànea de TAPs
This commit is contained in:
2025-07-29 10:05:06 +02:00
parent fee07b6e1b
commit 913450fadb
4 changed files with 17 additions and 9 deletions

View File

@@ -190,10 +190,11 @@ namespace z80
{
t+=1;
reading_m1 = true;
/*if (rPC==0x056c) {
zx_tape::rewind();
zx_tape::play();
}*/
if (rPC==0x056A) {
z80debug::stop();
//zx_tape::rewind();
//zx_tape::play();
}
return READ_MEM_8();
}

View File

@@ -104,6 +104,7 @@ namespace z80debug
if ((e->window.event==SDL_WINDOWEVENT_SHOWN) || (e->window.event==SDL_WINDOWEVENT_EXPOSED)) {
int w; int h;
SDL_GetWindowSize(win, &w, &h);
w/=2; h/=2;
midx = (w/CHR_W) - 25;
win_h = (h/CHR_H);
mem_y = win_h - mem_h - con_h;
@@ -332,8 +333,9 @@ namespace z80debug
void show()
{
if (!win) {
win = SDL_CreateWindow("Z80 Debugger", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 98*CHR_W, 44*CHR_H, SDL_WINDOW_RESIZABLE);
win = SDL_CreateWindow("Z80 Debugger", 10, 50, 98*CHR_W*2, 44*CHR_H*2, SDL_WINDOW_SHOWN);
ren = SDL_CreateRenderer(win, -1, 0);
SDL_RenderSetLogicalSize(ren, 98*CHR_W, 44*CHR_H);
ui::window::registerWindow(SDL_GetWindowID(win), eventHandler);
tex = ui::createtexture(ren);
}
@@ -382,7 +384,7 @@ namespace z80debug
void cont() {
zxscreen::setTitle("");
is_debugging = is_paused = false;
//hide();
hide();
refresh();
zxscreen::focus();
speaker::enable();

View File

@@ -26,7 +26,7 @@ namespace zxscreen
uint32_t t_states_per_scanline = 224;
uint32_t vsync_lines = 16;
uint8_t zoom = 1;
uint8_t zoom = 2;
bool fullscreen = false;
bool full_refresh = true;
int fullscreen_scale = 1;
@@ -113,6 +113,11 @@ namespace zxscreen
bool eventHandler(SDL_Event *e)
{
if (e->type==SDL_WINDOWEVENT) {
//int x, y;
//SDL_GetWindowPosition(win, &x, &y);
//char tmp[256];
//sprintf(tmp, " %ix%i", x, y);
//setTitle(tmp);
if (e->window.event==SDL_WINDOWEVENT_CLOSE) {
return false;
} else if ((e->window.event==SDL_WINDOWEVENT_SHOWN) || (e->window.event==SDL_WINDOWEVENT_EXPOSED)) {
@@ -163,7 +168,7 @@ namespace zxscreen
if (win) SDL_DestroyWindow(win);
const int z = fullscreen ? 1 : zoom;
win = SDL_CreateWindow("ZX Spectrum Screen", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 352*z, 296*z, fullscreen?SDL_WINDOW_FULLSCREEN_DESKTOP:SDL_WINDOW_SHOWN);
win = SDL_CreateWindow("ZX Spectrum Screen", 1216, 565, 352*z, 296*z, fullscreen?SDL_WINDOW_FULLSCREEN_DESKTOP:SDL_WINDOW_ALLOW_HIGHDPI);
ren = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED);
tex = SDL_CreateTexture(ren, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, 352, 296);
uitex = ui::createtexture(ren);

View File

@@ -202,7 +202,7 @@ namespace zx_tape
pulse_pos -= PULSE_LEN_SYNC3;
pulse_level = 0;
current_section = PULSE_WAIT;
printf("going to pulse_wait..%i.\n", current_block);
printf("going to pulse_wait..%i (%i).\n", current_block, blocks[current_block].length);
}
}