- [NEW] La posició del cursor se marca amb un requadre blau (no relleno) en el desensamblador
- [NEW] setcursor corregeix l'adreça si no coincideix amb una instrucció - [FIX] Corregits els opcodes FD34 i FD35 - [NEW] Ara en el analitzador es borra o es fixa la memòria amb DELETE i RETURN - [NEW] Fent click en un pixel del analitzador du a la posició de memòria que toca en el desensamblador - [NEW] ui::printvoidrect() - [NEW] la finestra del analitzador pilla el foco nomes amb pasar per damunt - [NEW] Fent click en una linea del desensamblador fica o lleva un breakpoint en eixa adreça - [FIX] les accions en el analitzador actualitzen la finestra del debugger - [FIX] El cursor del analitzador nomes es deu moure al estar damunt de al finestra del analitzador - [FIX] El desensamblador, quan el tag de memoria era MIXED no reconixia part de la instrucció - [FIX] El desensamblador usava el color incorrecte per a codi amb el tag REPEAT
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "z80analyze.h"
|
||||
#include "z80.h"
|
||||
#include "z80debug.h"
|
||||
#include <SDL2/SDL.h>
|
||||
#include "ui_window.h"
|
||||
#include "ui.h"
|
||||
@@ -10,6 +11,7 @@ namespace z80analyze
|
||||
SDL_Renderer *ren = nullptr;
|
||||
SDL_Texture *tex = nullptr;
|
||||
SDL_Texture *uitex = nullptr;
|
||||
uint16_t address = 0;
|
||||
|
||||
void refreshTitle();
|
||||
|
||||
@@ -17,18 +19,36 @@ namespace z80analyze
|
||||
{
|
||||
if (e->type == SDL_MOUSEBUTTONUP)
|
||||
{
|
||||
if (e->button.button == 1)
|
||||
//z80::clearMemTouched();
|
||||
z80::clearMemTag();
|
||||
//if (z80::getMemTag(address)!=MEMTAG_INST) address = find_previous_opcode(address);
|
||||
z80debug::setcursor(address);
|
||||
z80debug::refresh();
|
||||
|
||||
/*if (e->button.button == 1)
|
||||
z80::clearMemTouched();
|
||||
//z80::clearMemTag();
|
||||
else
|
||||
z80::fixMemTouched();
|
||||
z80::fixMemTouched();*/
|
||||
refresh();
|
||||
}
|
||||
if (e->type == SDL_MOUSEMOTION)
|
||||
{
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
refreshTitle();
|
||||
refresh();
|
||||
if (e->motion.windowID == SDL_GetWindowID(win)) {
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
refreshTitle();
|
||||
refresh();
|
||||
focus();
|
||||
}
|
||||
}
|
||||
if (e->type == SDL_KEYDOWN) {
|
||||
if (e->key.keysym.scancode == SDL_SCANCODE_RETURN) {
|
||||
z80::fixMemTouched();
|
||||
refresh();
|
||||
z80debug::refresh();
|
||||
} else if (e->key.keysym.scancode == SDL_SCANCODE_BACKSPACE) {
|
||||
z80::clearMemTouched();
|
||||
refresh();
|
||||
z80debug::refresh();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -53,7 +73,8 @@ namespace z80analyze
|
||||
int mx, my;
|
||||
SDL_GetMouseState(&mx, &my);
|
||||
mx/=2; my/=2;
|
||||
SDL_SetWindowTitle(win, SDL_itoa(mx+my*256, tmp, 16));
|
||||
address = mx+my*256;
|
||||
SDL_SetWindowTitle(win, SDL_itoa(address, tmp, 16));
|
||||
}
|
||||
void refresh()
|
||||
{
|
||||
@@ -65,11 +86,11 @@ namespace z80analyze
|
||||
SDL_LockTexture(tex, NULL, (void**)&pixels, &pitch);
|
||||
for (int i=0; i<65536; ++i)
|
||||
{
|
||||
uint8_t tag = z80::getMemTag(i);
|
||||
pixels[i] = tag==MEMTAG_NONE ? 0x808080 : tag==MEMTAG_DATA ? 0x0000FF : tag==MEMTAG_MIXED ? 0xFF00FF : 0x00FF00;
|
||||
//uint8_t tag = z80::getMemTag(i);
|
||||
//pixels[i] = tag==MEMTAG_NONE ? 0x808080 : tag==MEMTAG_DATA ? 0x0000FF : tag==MEMTAG_MIXED ? 0xFF00FF : 0x00FF00;
|
||||
|
||||
//uint8_t tag = z80::getMemTouched(i);
|
||||
//pixels[i] = tag==MEMTAG_NONE ? 0x808080 : tag==MEMTAG_DATA ? 0x0000FF : tag==MEMTAG_REPEAT ? 0xFF0000 : 0x00FF00;
|
||||
uint8_t tag = z80::getMemTouched(i);
|
||||
pixels[i] = tag==MEMTAG_NONE ? 0x808080 : tag==MEMTAG_DATA ? 0x0000FF : tag==MEMTAG_REPEAT ? 0xFF0000 : 0x00FF00;
|
||||
}
|
||||
pixels[z80::getPC()] = 0xFFFFFF;
|
||||
|
||||
@@ -99,4 +120,13 @@ namespace z80analyze
|
||||
SDL_DestroyRenderer(ren); ren = nullptr;
|
||||
SDL_DestroyWindow(win); win = nullptr;
|
||||
}
|
||||
|
||||
void focus()
|
||||
{
|
||||
if (win) {
|
||||
SDL_RaiseWindow(win);
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user