Compare commits
2 Commits
620cd8d88c
...
bdec53eb97
| Author | SHA1 | Date | |
|---|---|---|---|
| bdec53eb97 | |||
| dfcc0a26fe |
BIN
batman.sav
Normal file
BIN
batman.sav
Normal file
Binary file not shown.
BIN
batmanritman.tap
Normal file
BIN
batmanritman.tap
Normal file
Binary file not shown.
1
main.cpp
1
main.cpp
@@ -236,6 +236,7 @@ int main(int argc, char *argv[])
|
|||||||
time = SDL_GetTicks();
|
time = SDL_GetTicks();
|
||||||
z80analyze::refresh();
|
z80analyze::refresh();
|
||||||
}
|
}
|
||||||
|
z80analyze::refresh(true);
|
||||||
|
|
||||||
|
|
||||||
} else if (!z80debug::debugging() && z80debug::paused()) {
|
} else if (!z80debug::debugging() && z80debug::paused()) {
|
||||||
|
|||||||
13
symbols-glaurung.txt
Normal file
13
symbols-glaurung.txt
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
0x5e38 STACK
|
||||||
|
0x9a01 DRW_ROOM
|
||||||
|
0x9f00 DRW_SCO_HERO
|
||||||
|
0x9f0f VAR_VIDES
|
||||||
|
0x9f8d DRW_SCO_INV
|
||||||
|
0xa00a DRW_SCO_LIVS
|
||||||
|
0xa01a DRW_SCO_NBAG
|
||||||
|
0xa022 DRW_SCO_NARW
|
||||||
|
0xa02a DRW_SCO_PNTS
|
||||||
|
0xc661 CLEAR_SCR
|
||||||
|
0xed5e MAINLOOP
|
||||||
|
0xf2b1 DRW_HERO
|
||||||
|
0xfed5 COUNT500
|
||||||
14
symbols.txt
14
symbols.txt
@@ -1,13 +1 @@
|
|||||||
0x5e38 STACK
|
0x6580 START
|
||||||
0x9a01 DRW_ROOM
|
|
||||||
0x9f00 DRW_SCO_HERO
|
|
||||||
0x9f0f VAR_VIDES
|
|
||||||
0x9f8d DRW_SCO_INV
|
|
||||||
0xa00a DRW_SCO_LIVS
|
|
||||||
0xa01a DRW_SCO_NBAG
|
|
||||||
0xa022 DRW_SCO_NARW
|
|
||||||
0xa02a DRW_SCO_PNTS
|
|
||||||
0xc661 CLEAR_SCR
|
|
||||||
0xed5e MAINLOOP
|
|
||||||
0xf2b1 DRW_HERO
|
|
||||||
0xfed5 COUNT500
|
|
||||||
|
|||||||
50
z80.cpp
50
z80.cpp
@@ -217,6 +217,7 @@ namespace z80
|
|||||||
memtag[addr] = MEMTAG_MIXED;
|
memtag[addr] = MEMTAG_MIXED;
|
||||||
} else {
|
} else {
|
||||||
memtag[addr] = MEMTAG_DATA;
|
memtag[addr] = MEMTAG_DATA;
|
||||||
|
memtouched[addr] = MEMTAG_DATA;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -717,30 +718,6 @@ namespace z80
|
|||||||
RETN();
|
RETN();
|
||||||
}
|
}
|
||||||
|
|
||||||
void interrupt()
|
|
||||||
{
|
|
||||||
if (!iff1) return;
|
|
||||||
exit_from_halt = true;
|
|
||||||
PUSH(rPC);
|
|
||||||
uint16_t address;
|
|
||||||
if (im==1) {
|
|
||||||
rPC = 0x38;
|
|
||||||
} else if (im==2) {
|
|
||||||
address = (rI<<8) | 0xFE;
|
|
||||||
rPC = READ_MEM_16(address);
|
|
||||||
} else if (im==0) {
|
|
||||||
printf("Interrupt mode 0!\n");
|
|
||||||
z80debug::stop();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (options[Z80_OPTION_BREAK_ON_INTERRUPT]) {
|
|
||||||
printf("Break on interrupt! 0x%2x, PC: 0x%2x\n", address, rPC);
|
|
||||||
z80debug::setcursor(rPC);
|
|
||||||
z80debug::history::store();
|
|
||||||
z80debug::stop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void RST(uint8_t vec)
|
void RST(uint8_t vec)
|
||||||
{
|
{
|
||||||
PUSH(rPC);
|
PUSH(rPC);
|
||||||
@@ -785,6 +762,31 @@ namespace z80
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void interrupt()
|
||||||
|
{
|
||||||
|
if (!iff1) return;
|
||||||
|
DI();
|
||||||
|
exit_from_halt = true;
|
||||||
|
PUSH(rPC);
|
||||||
|
uint16_t address;
|
||||||
|
if (im==1) {
|
||||||
|
rPC = 0x38;
|
||||||
|
} else if (im==2) {
|
||||||
|
address = (rI<<8) | 0xFE;
|
||||||
|
rPC = READ_MEM_16(address);
|
||||||
|
} else if (im==0) {
|
||||||
|
printf("Interrupt mode 0!\n");
|
||||||
|
z80debug::stop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (options[Z80_OPTION_BREAK_ON_INTERRUPT]) {
|
||||||
|
printf("Break on interrupt! 0x%2x, PC: 0x%2x\n", address, rPC);
|
||||||
|
z80debug::setcursor(rPC);
|
||||||
|
z80debug::history::store();
|
||||||
|
z80debug::stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static inline const uint8_t RLC(const uint8_t v)
|
static inline const uint8_t RLC(const uint8_t v)
|
||||||
{
|
{
|
||||||
const uint8_t res = (v>>7) | (v<<1);
|
const uint8_t res = (v>>7) | (v<<1);
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ namespace z80analyze
|
|||||||
SDL_Texture *tex = nullptr;
|
SDL_Texture *tex = nullptr;
|
||||||
SDL_Texture *uitex = nullptr;
|
SDL_Texture *uitex = nullptr;
|
||||||
uint16_t address = 0;
|
uint16_t address = 0;
|
||||||
|
int mx, my;
|
||||||
|
bool needs_refresh = true;
|
||||||
|
|
||||||
void refreshTitle();
|
void refreshTitle();
|
||||||
|
|
||||||
@@ -34,8 +36,11 @@ namespace z80analyze
|
|||||||
{
|
{
|
||||||
if (e->motion.windowID == SDL_GetWindowID(win)) {
|
if (e->motion.windowID == SDL_GetWindowID(win)) {
|
||||||
SDL_ShowCursor(SDL_DISABLE);
|
SDL_ShowCursor(SDL_DISABLE);
|
||||||
|
mx = e->motion.x/2;
|
||||||
|
my = e->motion.y/2;
|
||||||
|
|
||||||
refreshTitle();
|
refreshTitle();
|
||||||
refresh();
|
needs_refresh=true;
|
||||||
focus();
|
focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -70,15 +75,17 @@ namespace z80analyze
|
|||||||
char tmp[10];
|
char tmp[10];
|
||||||
void refreshTitle()
|
void refreshTitle()
|
||||||
{
|
{
|
||||||
int mx, my;
|
if (mx>=0 && my>=0 && mx<256 && my<256) {
|
||||||
SDL_GetMouseState(&mx, &my);
|
address = mx+my*256;
|
||||||
mx/=2; my/=2;
|
SDL_SetWindowTitle(win, SDL_itoa(address, tmp, 16));
|
||||||
address = mx+my*256;
|
}
|
||||||
SDL_SetWindowTitle(win, SDL_itoa(address, tmp, 16));
|
|
||||||
}
|
}
|
||||||
void refresh()
|
void refresh(const bool conditional)
|
||||||
{
|
{
|
||||||
if (!win) return;
|
if (!win) return;
|
||||||
|
if (conditional && !needs_refresh) return;
|
||||||
|
needs_refresh = false;
|
||||||
|
|
||||||
ui::setrenderer(ren, uitex);
|
ui::setrenderer(ren, uitex);
|
||||||
|
|
||||||
Uint32 *pixels;
|
Uint32 *pixels;
|
||||||
@@ -88,23 +95,22 @@ namespace z80analyze
|
|||||||
{
|
{
|
||||||
//uint8_t tag = z80::getMemTag(i);
|
//uint8_t tag = z80::getMemTag(i);
|
||||||
//pixels[i] = tag==MEMTAG_NONE ? 0x808080 : tag==MEMTAG_DATA ? 0x0000FF : tag==MEMTAG_MIXED ? 0xFF00FF : 0x00FF00;
|
//pixels[i] = tag==MEMTAG_NONE ? 0x808080 : tag==MEMTAG_DATA ? 0x0000FF : tag==MEMTAG_MIXED ? 0xFF00FF : 0x00FF00;
|
||||||
|
uint32_t none_color = i<0x4000 ? 0x101010 : i<0x5800 ? 0x202020 : i<0x5b00 ? 0x404040 : 0x808080;
|
||||||
uint8_t tag = z80::getMemTouched(i);
|
uint8_t tag = z80::getMemTouched(i);
|
||||||
pixels[i] = tag==MEMTAG_NONE ? 0x808080 : tag==MEMTAG_DATA ? 0x0000FF : tag==MEMTAG_REPEAT ? 0xFF0000 : 0x00FF00;
|
pixels[i] = tag==MEMTAG_NONE ? none_color : tag==MEMTAG_DATA ? 0x0000FF : tag==MEMTAG_REPEAT ? 0xFF0000 : 0x00FF00;
|
||||||
}
|
}
|
||||||
pixels[z80::getPC()] = 0xFFFFFF;
|
pixels[z80::getPC()] = 0xFFFFFF;
|
||||||
|
|
||||||
int mx, my;
|
if (mx>=0 && my>=0 && mx<256 && my<256) {
|
||||||
SDL_GetMouseState(&mx, &my);
|
if (mx>2) pixels[(mx-2)+(my)*256] = 0x000000;
|
||||||
mx/=2; my/=2;
|
if (mx>1) pixels[(mx-1)+(my)*256] = 0x000000;
|
||||||
pixels[(mx-2)+(my)*256] = 0x000000;
|
if (mx<255) pixels[(mx+1)+(my)*256] = 0x000000;
|
||||||
pixels[(mx-1)+(my)*256] = 0x000000;
|
if (mx<254) pixels[(mx+2)+(my)*256] = 0x000000;
|
||||||
pixels[(mx+1)+(my)*256] = 0x000000;
|
if (my>1) pixels[(mx)+(my-1)*256] = 0x000000;
|
||||||
pixels[(mx+2)+(my)*256] = 0x000000;
|
if (my>2) pixels[(mx)+(my-2)*256] = 0x000000;
|
||||||
pixels[(mx)+(my-1)*256] = 0x000000;
|
if (my<255) pixels[(mx)+(my+1)*256] = 0x000000;
|
||||||
pixels[(mx)+(my-2)*256] = 0x000000;
|
if (my<254) pixels[(mx)+(my+2)*256] = 0x000000;
|
||||||
pixels[(mx)+(my+1)*256] = 0x000000;
|
}
|
||||||
pixels[(mx)+(my+2)*256] = 0x000000;
|
|
||||||
|
|
||||||
SDL_UnlockTexture(tex);
|
SDL_UnlockTexture(tex);
|
||||||
SDL_RenderCopy(ren, tex, NULL, NULL);
|
SDL_RenderCopy(ren, tex, NULL, NULL);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
namespace z80analyze
|
namespace z80analyze
|
||||||
{
|
{
|
||||||
void show();
|
void show();
|
||||||
void refresh();
|
void refresh(const bool conditional=false);
|
||||||
void hide();
|
void hide();
|
||||||
void focus();
|
void focus();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,6 +93,9 @@ namespace z80debug
|
|||||||
|
|
||||||
bool eventHandler(SDL_Event *e)
|
bool eventHandler(SDL_Event *e)
|
||||||
{
|
{
|
||||||
|
if (e->type == SDL_MOUSEMOTION) {
|
||||||
|
SDL_ShowCursor(SDL_ENABLE);
|
||||||
|
}
|
||||||
if (z80debug::debugging()) {
|
if (z80debug::debugging()) {
|
||||||
if (e->type==SDL_WINDOWEVENT) {
|
if (e->type==SDL_WINDOWEVENT) {
|
||||||
if ((e->window.event==SDL_WINDOWEVENT_SHOWN) || (e->window.event==SDL_WINDOWEVENT_EXPOSED)) {
|
if ((e->window.event==SDL_WINDOWEVENT_SHOWN) || (e->window.event==SDL_WINDOWEVENT_EXPOSED)) {
|
||||||
@@ -164,7 +167,6 @@ namespace z80debug
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (e->type == SDL_MOUSEMOTION) {
|
if (e->type == SDL_MOUSEMOTION) {
|
||||||
SDL_ShowCursor(SDL_ENABLE);
|
|
||||||
if (!resizing) {
|
if (!resizing) {
|
||||||
if ( (e->motion.y > (mem_y*CHR_H)-8) && (e->motion.y < (mem_y*CHR_H)+8) && ( e->motion.x < midx*CHR_W ) ) {
|
if ( (e->motion.y > (mem_y*CHR_H)-8) && (e->motion.y < (mem_y*CHR_H)+8) && ( e->motion.x < midx*CHR_W ) ) {
|
||||||
if (resizing_type != RESIZING_MEMORY) SDL_SetCursor(cur_ns);
|
if (resizing_type != RESIZING_MEMORY) SDL_SetCursor(cur_ns);
|
||||||
@@ -1026,6 +1028,8 @@ namespace z80debug
|
|||||||
fread(regs, 31, 1, f);
|
fread(regs, 31, 1, f);
|
||||||
fread(&memory[0x4000], 0xc000, 1, f);
|
fread(&memory[0x4000], 0xc000, 1, f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
history::store();
|
||||||
|
history::gototop();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setcursor(const uint16_t address)
|
void setcursor(const uint16_t address)
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ namespace z80dis
|
|||||||
if (strstr(buffer, "4x"))
|
if (strstr(buffer, "4x"))
|
||||||
{
|
{
|
||||||
opcode_size+=2;
|
opcode_size+=2;
|
||||||
const uint16_t word = *(uint16_t*)(memory+((*memory==0xFD) || (*memory==0xDD)?2:1));
|
const uint16_t word = *(uint16_t*)(memory+((*memory==0xFD) || (*memory==0xDD) || (*memory==0xED)?2:1));
|
||||||
if (symbols[word][0]!=0) {
|
if (symbols[word][0]!=0) {
|
||||||
char *p = strstr(buffer, "$");
|
char *p = strstr(buffer, "$");
|
||||||
(*p)='%'; p++;
|
(*p)='%'; p++;
|
||||||
|
|||||||
@@ -128,6 +128,9 @@ namespace zxscreen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (e->type == SDL_MOUSEMOTION) {
|
||||||
|
SDL_ShowCursor(true);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user