summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile4
-rw-r--r--src/gui.c2
-rw-r--r--src/main.c33
-rw-r--r--src/memmenu.c11
-rw-r--r--src/spec.c20
-rw-r--r--src/spec.h2
6 files changed, 49 insertions, 23 deletions
diff --git a/src/Makefile b/src/Makefile
index 68ecd6d..5d98ed7 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -18,7 +18,7 @@
#
# -------------------------------------------------------------------------
#
-# $Id: Makefile,v 1.5 2004-01-06 02:06:36 ianc Exp $
+# $Id: Makefile,v 1.6 2004-01-14 01:50:20 ianc Exp $
#
@@ -61,7 +61,7 @@ $(TARGET): $(OBJECTS) $(Z80LIB)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
$(Z80LIB): z80/*.[ch]
- cd z80; make ; cd ..
+ cd z80; make "EXTERNAL_CFLAGS=`sdl-config --cflags`" ; cd ..
clean:
rm -f $(TARGET) $(OBJECTS) core
diff --git a/src/gui.c b/src/gui.c
index cfd109e..c922aba 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -150,7 +150,7 @@ int GUIMessage(GUIBoxType type, const char *title, const char *format,...)
}
width=(width*8)+18;
- height=(no+3)*12;
+ height=(no+5)*10;
if (width>(GFX_WIDTH-10))
width=GFX_WIDTH-10;
diff --git a/src/main.c b/src/main.c
index 75352f5..a79464c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -84,8 +84,9 @@ int main(int argc, char *argv[])
SPECReadWord,
SPECWritePort,
SPECReadPort,
- SPECReadForDisassem,
- SPECGetLabel);
+ SPECReadForDisassem);
+
+ Z80SetLabels(z80,SPECGetLabel());
GFXInit();
@@ -146,6 +147,8 @@ int main(int argc, char *argv[])
"HELP",
"ESC - Quit \n"
"F1 - Help \n"
+ "F2 - About \n"
+ "F3 - View Spectrum keyboad \n"
"F8 - Select tape file for loading\n"
"F9 - Select tape file for saving \n"
"F10 - Close all open tape files \n"
@@ -153,6 +156,32 @@ int main(int argc, char *argv[])
"F12 - Toggle onscreen trace ");
break;
+ case SDLK_F2:
+ if (e->key.state==SDL_PRESSED)
+ GUIMessage(eMessageBox,
+ "espec - ZX Spectrum Emulator",
+ "(c) 2004 Ian Cowburn\n"
+ " \n"
+ "This software comes with ABSOLUTELY \n"
+ "NO WARRANTY, and you are free to \n"
+ "to redistribute it under certain \n"
+ "conditions. See the supplied GNU \n"
+ "General Public License in LICENSE \n"
+ "for details. \n"
+ " \n"
+ "If you did not recieve a license, \n"
+ "vist www.gnu.org or wrote to: \n"
+ " \n"
+ "Free Software Foundation, Inc., \n"
+ "59 Temple Place, Suite 330, \n"
+ "Boston, MA 02111-1307 USA ");
+ break;
+
+ case SDLK_F3:
+ if (e->key.state==SDL_PRESSED)
+ GUIMessage(eMessageBox,"TODO","Sorry, not done yet");
+ break;
+
case SDLK_F8:
if (e->key.state==SDL_PRESSED)
{
diff --git a/src/memmenu.c b/src/memmenu.c
index 60e2c03..dfce66d 100644
--- a/src/memmenu.c
+++ b/src/memmenu.c
@@ -71,6 +71,7 @@ typedef struct
static FILE *trace=NULL;
static Breakpoint bpoint={NULL,0};
static const char *brk=NULL;
+static int lodged=FALSE;
/* ---------------------------------------- PROTOS
@@ -82,15 +83,21 @@ static int Instruction(Z80 *z80, Z80Val data);
*/
static void SetCallback(Z80 *z80)
{
- if (trace || bpoint.no)
+ if ((trace || bpoint.no) && !lodged)
+ {
Z80LodgeCallback(z80,eZ80_Instruction,Instruction);
+ lodged=TRUE;
+ }
}
static void ClearCallback(Z80 *z80)
{
- if (!trace && !bpoint.no)
+ if (!trace && !bpoint.no && lodged)
+ {
Z80RemoveCallback(z80,eZ80_Instruction,Instruction);
+ lodged=FALSE;
+ }
}
diff --git a/src/spec.c b/src/spec.c
index 3be7753..1cfa2ba 100644
--- a/src/spec.c
+++ b/src/spec.c
@@ -622,15 +622,9 @@ Z80Byte SPECReadForDisassem(Z80 *z80, Z80Word addr)
}
-/* TODO: Implement this as a binary search
-*/
-const char *SPECGetLabel(Z80 *z80, Z80Word addr)
+const Z80Label *SPECGetLabel(void)
{
- static const struct
- {
- Z80Word addr;
- const char *txt;
- } label[]=
+ static const Z80Label label[]=
{
{0x5c00, "KSTATE"},
{0x5c01, "KSTATE+1"},
@@ -811,16 +805,12 @@ const char *SPECGetLabel(Z80 *z80, Z80Word addr)
{0x5cb3, "RAMTOP+1"},
{0x5cb4, "P_RAMT"},
{0x5cb5, "P_RAMT+1"},
+
+ {0x0c0a, "PRINT_STRING"},
{0, NULL}
};
- int f;
-
- for(f=0;label[f].txt;f++)
- if (addr==label[f].addr)
- return label[f].txt;
-
- return NULL;
+ return label;
}
diff --git a/src/spec.h b/src/spec.h
index f771480..0dae7e7 100644
--- a/src/spec.h
+++ b/src/spec.h
@@ -51,7 +51,7 @@ void SPECWriteWord(Z80 *z80, Z80Word addr, Z80Word val);
Z80Byte SPECReadPort(Z80 *z80, Z80Word port);
void SPECWritePort(Z80 *z80, Z80Word port, Z80Byte val);
Z80Byte SPECReadForDisassem(Z80 *z80, Z80Word addr);
-const char *SPECGetLabel(Z80 *z80, Z80Word addr);
+const Z80Label *SPECGetLabel(void);
/* Interfaces for memory menu
*/