Added ENABLE_DEBUGGER option to include built-in console-based debugger in emulator

This commit is contained in:
Nik Henson 2011-06-28 00:27:16 +00:00
parent 8a9924b884
commit 7ea5d31b6c
2 changed files with 78 additions and 4 deletions

View file

@ -28,6 +28,16 @@
#
###############################################################################
# Build Options
###############################################################################
#
# Include console-based debugger in emulator ('yes' or 'no')
#
ENABLE_DEBUGGER = no
###############################################################################
# Required Libraries
#
@ -59,6 +69,15 @@ CFLAGS = $(COMPILER_FLAGS)
CPPFLAGS = $(COMPILER_FLAGS)
LFLAGS = -o $(OUTFILE) -L$(SDL_LIBPATH) -lGL -lGLU -lSDL -lz -lm -lstdc++
#
# Build options...
#
# Add compiler flags for various options
ifeq ($(strip $(ENABLE_DEBUGGER)),yes)
COMPILER_FLAGS += -DSUPERMODEL_DEBUGGER
endif
###############################################################################
# Build Instructions
@ -69,7 +88,21 @@ LFLAGS = -o $(OUTFILE) -L$(SDL_LIBPATH) -lGL -lGLU -lSDL -lz -lm -lstdc++
#
HEADERS = Src/Supermodel.h Src/Games.h Src/OSD/SDL/Types.h
OBJ = $(OBJ_DIR)/Games.o $(OBJ_DIR)/INIFile.o $(OBJ_DIR)/BlockFile.o $(OBJ_DIR)/93C46.o $(OBJ_DIR)/ROMLoad.o $(OBJ_DIR)/unzip.o $(OBJ_DIR)/ioapi.o $(OBJ_DIR)/Error.o $(OBJ_DIR)/glew.o $(OBJ_DIR)/Shader.o $(OBJ_DIR)/Real3D.o $(OBJ_DIR)/Render3D.o $(OBJ_DIR)/Models.o $(OBJ_DIR)/Render2D.o $(OBJ_DIR)/TileGen.o $(OBJ_DIR)/Model3.o $(OBJ_DIR)/ppc.o $(OBJ_DIR)/Main.o $(OBJ_DIR)/IRQ.o $(OBJ_DIR)/53C810.o $(OBJ_DIR)/PCI.o $(OBJ_DIR)/RTC72421.o $(OBJ_DIR)/MPC10x.o $(OBJ_DIR)/PPCDisasm.o $(OBJ_DIR)/Input.o $(OBJ_DIR)/Inputs.o $(OBJ_DIR)/InputSource.o $(OBJ_DIR)/InputSystem.o $(OBJ_DIR)/InputTypes.o $(OBJ_DIR)/MultiInputSource.o $(OBJ_DIR)/SDLInputSystem.o
OBJ = $(OBJ_DIR)/Games.o $(OBJ_DIR)/INIFile.o $(OBJ_DIR)/BlockFile.o $(OBJ_DIR)/93C46.o $(OBJ_DIR)/ROMLoad.o \
$(OBJ_DIR)/unzip.o $(OBJ_DIR)/ioapi.o $(OBJ_DIR)/Error.o $(OBJ_DIR)/glew.o $(OBJ_DIR)/Shader.o $(OBJ_DIR)/Real3D.o \
$(OBJ_DIR)/Render3D.o $(OBJ_DIR)/Models.o $(OBJ_DIR)/Render2D.o $(OBJ_DIR)/TileGen.o $(OBJ_DIR)/Model3.o \
$(OBJ_DIR)/ppc.o $(OBJ_DIR)/Main.o $(OBJ_DIR)/SoundBoard.o $(OBJ_DIR)/IRQ.o $(OBJ_DIR)/53C810.o $(OBJ_DIR)/PCI.o \
$(OBJ_DIR)/RTC72421.o $(OBJ_DIR)/MPC10x.o $(OBJ_DIR)/PPCDisasm.o $(OBJ_DIR)/Input.o $(OBJ_DIR)/Inputs.o \
$(OBJ_DIR)/InputSource.o $(OBJ_DIR)/InputSystem.o $(OBJ_DIR)/InputTypes.o $(OBJ_DIR)/MultiInputSource.o \
$(OBJ_DIR)/SDLInputSystem.o
# If built-in debugger enabled, include all debugging classes
ifeq ($(strip $(ENABLE_DEBUGGER)),yes)
OBJ += $(OBJ_DIR)/Debugger.o $(OBJ_DIR)/ConsoleDebugger.o $(OBJ_DIR)/SupermodelDebugger.o $(OBJ_DIR)/CPUDebug.o \
$(OBJ_DIR)/AddressTable.o $(OBJ_DIR)/Breakpoint.o $(OBJ_DIR)/CodeAnalyser.o $(OBJ_DIR)/Exception.o \
$(OBJ_DIR)/Interrupt.o $(OBJ_DIR)/IO.o $(OBJ_DIR)/Label.o $(OBJ_DIR)/Register.o $(OBJ_DIR)/Watch.o \
$(OBJ_DIR)/PPCDebug.o
endif
#
# Rules
@ -103,6 +136,12 @@ $(OBJ_DIR)/%.o: Src/Graphics/%.cpp Src/Graphics/%.h $(HEADERS)
$(OBJ_DIR)/%.o: Src/Graphics/%.cpp $(HEADERS)
$(CC) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
$(OBJ_DIR)/%.o: Src/Debugger/%.cpp Src/Debugger/%.h $(HEADERS)
$(CC) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
$(OBJ_DIR)/%.o: Src/Debugger/CPU/%.cpp Src/Debugger/CPU/%.h $(HEADERS)
$(CC) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
$(OBJ_DIR)/%.o: Src/CPU/PowerPC/%.cpp Src/CPU/PowerPC/%.h $(HEADERS)
$(CC) $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
@ -115,5 +154,5 @@ $(OBJ_DIR)/%.o: Src/OSD/SDL/%.cpp $(HEADERS)
$(OBJ_DIR)/%.o: Src/Pkgs/%.c Src/Pkgs/%.h
$(CC) $< $(CFLAGS) -o $(OBJ_DIR)/$(*F).o
$(OBJ_DIR)/%.o: Src/Pkgs/*.c
$(OBJ_DIR)/%.o: Src/Pkgs/%.c
$(CC) $< $(CFLAGS) -o $(OBJ_DIR)/$(*F).o

View file

@ -39,6 +39,11 @@
#
BITS = 32
#
# Include console-based debugger in emulator ('yes' or 'no')
#
ENABLE_DEBUGGER = no
#
# Experimental sound code ('yes' on 32-bit builds only or 'no')
#
@ -121,6 +126,12 @@ LFLAGS = /MACHINE:$(ARCH) $(ARCH_LIBS) /LIBPATH:"$(SDL_LIBPATH)" /LIBPATH:"$(ZLI
OBJ_LIBS = kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib \
odbc32.lib odbccp32.lib OpenGL32.lib GLu32.lib SDL.lib SDLmain.lib zlib.lib dinput8.lib dxguid.lib
#
# Turbo68K options
#
MAKE68KFLAGS = -singleaddr
#
# Build options...
#
@ -132,6 +143,11 @@ ifneq ($(strip $(BITS)),32)
endif
# Add compiler flags for various options
ifeq ($(strip $(ENABLE_DEBUGGER)),yes)
COMPILER_FLAGS += /D "SUPERMODEL_DEBUGGER"
MAKE68KFLAGS += -debug
endif
ifeq ($(strip $(ENABLE_SOUND)),yes)
COMPILER_FLAGS += /D "SUPERMODEL_SOUND"
endif
@ -158,6 +174,19 @@ ifeq ($(strip $(ENABLE_SOUND)),yes)
OBJ += $(OBJ_DIR)/Turbo68K.obj $(OBJ_DIR)/SCSP.obj $(OBJ_DIR)/SCSPDSP.obj
endif
# If built-in debugger enabled, include all debugging classes
ifeq ($(strip $(ENABLE_DEBUGGER)),yes)
OBJ += $(OBJ_DIR)/Debugger.obj $(OBJ_DIR)/ConsoleDebugger.obj $(OBJ_DIR)/SupermodelDebugger.obj $(OBJ_DIR)/CPUDebug.obj \
$(OBJ_DIR)/AddressTable.obj $(OBJ_DIR)/Breakpoint.obj $(OBJ_DIR)/CodeAnalyser.obj $(OBJ_DIR)/Exception.obj \
$(OBJ_DIR)/Interrupt.obj $(OBJ_DIR)/IO.obj $(OBJ_DIR)/Label.obj $(OBJ_DIR)/Register.obj $(OBJ_DIR)/Watch.obj \
$(OBJ_DIR)/PPCDebug.obj
# If sound enabled, add debugging support for Turbo68K
ifeq ($(strip $(ENABLE_SOUND)),yes)
OBJ += $(OBJ_DIR)/68KDebug.obj
endif
endif
#
# Targets
@ -189,7 +218,7 @@ $(OBJ_DIR)/Make68K.exe: Src/CPU/68K/Make68K.c
$(LD) /OUT:$(OBJ_DIR)/Make68K.exe /SUBSYSTEM:CONSOLE /NOLOGO /MANIFEST:NO /LTCG $(OBJ_DIR)/Make68K.obj
$(OBJ_DIR)/Turbo68K.obj: $(OBJ_DIR)/Make68K.exe
$(OBJ_DIR)/Make68K.exe $(OBJ_DIR)/Turbo68K.asm -singleaddr
$(OBJ_DIR)/Make68K.exe $(OBJ_DIR)/Turbo68K.asm $(MAKE68KFLAGS)
nasm $(OBJ_DIR)/Turbo68K.asm -o $(OBJ_DIR)/Turbo68K.obj -f win32
@ -216,6 +245,12 @@ $(OBJ_DIR)/%.obj: Src/Sound/%.cpp Src/Sound/%.h $(HEADERS)
$(OBJ_DIR)/%.obj: Src/Sound/%.cpp $(HEADERS)
$(CC) $< $(CPPFLAGS) /Fo$(OBJ_DIR)/$(*F).obj
$(OBJ_DIR)/%.obj: Src/Debugger/%.cpp Src/Debugger/%.h $(HEADERS)
$(CC) $< $(CPPFLAGS) /Fo$(OBJ_DIR)/$(*F).obj
$(OBJ_DIR)/%.obj: Src/Debugger/CPU/%.cpp Src/Debugger/CPU/%.h $(HEADERS)
$(CC) $< $(CPPFLAGS) /Fo$(OBJ_DIR)/$(*F).obj
$(OBJ_DIR)/%.obj: Src/CPU/PowerPC/%.cpp Src/CPU/PowerPC/%.h Src/CPU/PowerPC/ppc603.c Src/CPU/PowerPC/ppc_ops.c $(HEADERS)
$(CC) $< $(CPPFLAGS) /Fo$(OBJ_DIR)/$(*F).obj
@ -235,5 +270,5 @@ $(OBJ_DIR)/%.obj: Src/OSD/Windows/%.cpp Src/OSD/Windows/%.h $(HEADERS)
$(OBJ_DIR)/%.obj: Src/Pkgs/%.c Src/Pkgs/%.h
$(CC) $< $(CFLAGS) /Fo$(OBJ_DIR)/$(*F).obj
$(OBJ_DIR)/%.obj: Src/Pkgs/*.c
$(OBJ_DIR)/%.obj: Src/Pkgs/%.c
$(CC) $< $(CFLAGS) /Fo$(OBJ_DIR)/$(*F).obj