- [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:
43
z80analyze.cpp
Normal file
43
z80analyze.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
#include "z80analyze.h"
|
||||
#include "z80.h"
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
namespace z80analyze
|
||||
{
|
||||
SDL_Window *win = nullptr;
|
||||
SDL_Renderer *ren = nullptr;
|
||||
SDL_Texture *tex = nullptr;
|
||||
|
||||
void show()
|
||||
{
|
||||
if (!win)
|
||||
{
|
||||
win = SDL_CreateWindow("Z80 Analyzer", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 256, 256, SDL_WINDOW_SHOWN);
|
||||
ren = SDL_CreateRenderer(win, -1, 0);
|
||||
tex = SDL_CreateTexture(ren, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, 256, 256);
|
||||
}
|
||||
refresh();
|
||||
}
|
||||
|
||||
void refresh()
|
||||
{
|
||||
Uint32 *pixels;
|
||||
int pitch;
|
||||
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 : 0x00FF00;
|
||||
}
|
||||
SDL_UnlockTexture(tex);
|
||||
SDL_RenderCopy(ren, tex, NULL, NULL);
|
||||
SDL_RenderPresent(ren);
|
||||
}
|
||||
|
||||
void hide()
|
||||
{
|
||||
SDL_DestroyTexture(tex);
|
||||
SDL_DestroyRenderer(ren);
|
||||
SDL_DestroyWindow(win);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user