cleaned up a little the gbz80 and z80 ports
authorjesusc <jesusc@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 13 Jul 2003 00:13:19 +0000 (00:13 +0000)
committerjesusc <jesusc@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 13 Jul 2003 00:13:19 +0000 (00:13 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2729 4a8a32a2-be11-0410-ad9d-d568d2c75423

all.dsp [new file with mode: 0644]
as/as_gbz80.dsp [new file with mode: 0644]
link/z80/aslink.h
link/z80/linkgbz80.dsp [new file with mode: 0644]
link/z80/linkz80.dsp
sdcc.dsw
src/SDCCglue.c
src/SDCCmain.c
src/z80/main.c
src/z80/z80.dsp

diff --git a/all.dsp b/all.dsp
new file mode 100644 (file)
index 0000000..c419808
--- /dev/null
+++ b/all.dsp
@@ -0,0 +1,324 @@
+# Microsoft Developer Studio Project File - Name="all" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Generic Project" 0x010a
+
+CFG=all - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "all.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "all.mak" CFG="all - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "all - Win32 Release" (based on "Win32 (x86) Generic Project")
+!MESSAGE "all - Win32 Debug" (based on "Win32 (x86) Generic Project")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+MTL=midl.exe
+
+!IF  "$(CFG)" == "all - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+
+!ELSEIF  "$(CFG)" == "all - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+
+!ENDIF 
+
+# Begin Target
+
+# Name "all - Win32 Release"
+# Name "all - Win32 Debug"
+# Begin Source File
+
+SOURCE=".\bin_vc\as-gbz80.exe"
+
+!IF  "$(CFG)" == "all - Win32 Release"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+InputPath=".\bin_vc\as-gbz80.exe"
+
+"bin\as-gbz80.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+       copy bin_vc\as-gbz80.exe bin /y > nul
+
+# End Custom Build
+
+!ELSEIF  "$(CFG)" == "all - Win32 Debug"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+InputPath=".\bin_vc\as-gbz80.exe"
+
+"bin\as-gbz80.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+       copy bin_vc\as-gbz80.exe bin /y > nul
+
+# End Custom Build
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=".\bin_vc\as-z80.exe"
+
+!IF  "$(CFG)" == "all - Win32 Release"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+InputPath=".\bin_vc\as-z80.exe"
+
+"bin\as-z80.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+       copy bin_vc\as-z80.exe bin /y > nul
+
+# End Custom Build
+
+!ELSEIF  "$(CFG)" == "all - Win32 Debug"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+InputPath=".\bin_vc\as-z80.exe"
+
+"bin\as-z80.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+       copy bin_vc\as-z80.exe bin /y > nul
+
+# End Custom Build
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\bin_vc\aslink.exe
+
+!IF  "$(CFG)" == "all - Win32 Release"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+InputPath=.\bin_vc\aslink.exe
+
+"bin\aslink.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+       copy bin_vc\aslink.exe bin /y > nul
+
+# End Custom Build
+
+!ELSEIF  "$(CFG)" == "all - Win32 Debug"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+InputPath=.\bin_vc\aslink.exe
+
+"bin\aslink.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+       copy bin_vc\aslink.exe bin /y > nul
+
+# End Custom Build
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\bin_vc\asx8051.exe
+
+!IF  "$(CFG)" == "all - Win32 Release"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+InputPath=.\bin_vc\asx8051.exe
+
+"bin\asx8051.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+       copy bin_vc\asx8051.exe  bin /y > nul
+
+# End Custom Build
+
+!ELSEIF  "$(CFG)" == "all - Win32 Debug"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+InputPath=.\bin_vc\asx8051.exe
+
+"bin\asx8051.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+       copy bin_vc\asx8051.exe  bin /y > nul
+
+# End Custom Build
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=".\bin_vc\link-gbz80.exe"
+
+!IF  "$(CFG)" == "all - Win32 Release"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+InputPath=".\bin_vc\link-gbz80.exe"
+
+".\bin\link-gbz80.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+       copy bin_vc\link-gbz80.exe  bin /y > nul
+
+# End Custom Build
+
+!ELSEIF  "$(CFG)" == "all - Win32 Debug"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+InputPath=".\bin_vc\link-gbz80.exe"
+
+".\bin\link-gbz80.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+       copy bin_vc\link-gbz80.exe  bin /y > nul
+
+# End Custom Build
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=".\bin_vc\link-z80.exe"
+
+!IF  "$(CFG)" == "all - Win32 Release"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+InputPath=".\bin_vc\link-z80.exe"
+
+".\bin\link-z80.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+       copy bin_vc\link-z80.exe  bin /y > nul
+
+# End Custom Build
+
+!ELSEIF  "$(CFG)" == "all - Win32 Debug"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+InputPath=".\bin_vc\link-z80.exe"
+
+".\bin\link-z80.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+       copy bin_vc\link-z80.exe  bin /y > nul
+
+# End Custom Build
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\bin_vc\packihx.exe
+
+!IF  "$(CFG)" == "all - Win32 Release"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+InputPath=.\bin_vc\packihx.exe
+
+"bin\packihx.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+       copy bin_vc\packihx.exe  bin /y > nul
+
+# End Custom Build
+
+!ELSEIF  "$(CFG)" == "all - Win32 Debug"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+InputPath=.\bin_vc\packihx.exe
+
+"bin\packihx.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+       copy bin_vc\packihx.exe  bin /y > nul
+
+# End Custom Build
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\bin_vc\sdcc.exe
+
+!IF  "$(CFG)" == "all - Win32 Release"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+InputPath=.\bin_vc\sdcc.exe
+
+"bin\sdcc.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+       copy bin_vc\sdcc.exe  bin /y > nul
+
+# End Custom Build
+
+!ELSEIF  "$(CFG)" == "all - Win32 Debug"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+InputPath=.\bin_vc\sdcc.exe
+
+"bin\sdcc.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+       copy bin_vc\sdcc.exe  bin /y > nul
+
+# End Custom Build
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\bin_vc\sdcpp.exe
+
+!IF  "$(CFG)" == "all - Win32 Release"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+InputPath=.\bin_vc\sdcpp.exe
+
+"bin\sdcpp.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+       copy bin_vc\sdcpp.exe  bin /y > nul
+
+# End Custom Build
+
+!ELSEIF  "$(CFG)" == "all - Win32 Debug"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+InputPath=.\bin_vc\sdcpp.exe
+
+".bin\sdcpp.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+       copy bin_vc\sdcpp.exe  bin /y > nul
+
+# End Custom Build
+
+!ENDIF 
+
+# End Source File
+# End Target
+# End Project
diff --git a/as/as_gbz80.dsp b/as/as_gbz80.dsp
new file mode 100644 (file)
index 0000000..65e93e3
--- /dev/null
@@ -0,0 +1,171 @@
+# Microsoft Developer Studio Project File - Name="as_gbz80" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=as_gbz80 - Win32 Release
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "as_gbz80.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "as_gbz80.mak" CFG="as_gbz80 - Win32 Release"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "as_gbz80 - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "as_gbz80 - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "as_gbz80 - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "z80\Debug_gbz80"
+# PROP BASE Intermediate_Dir "z80\Debug_gbz80"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "z80\Debug_gbz80"
+# PROP Intermediate_Dir "z80\Debug_gbz80"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "INDEXLIB" /D "MLH_MAP" /D "SDK" /FR /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "INDEXLIB" /D "MLH_MAP" /D "SDK" /FR /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /out:"..\bin_vc\as-z80.exe" /pdbtype:sept
+# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /out:"..\bin_vc\as-gbz80.exe" /pdbtype:sept
+
+!ELSEIF  "$(CFG)" == "as_gbz80 - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "z80\Release_gbz80"
+# PROP BASE Intermediate_Dir "z80\Release_gbz80"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "z80\Release_gbz80"
+# PROP Intermediate_Dir "z80\Release_gbz80"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "INDEXLIB" /D "MLH_MAP" /D "SDK" /FD /c
+# ADD CPP /nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "INDEXLIB" /D "MLH_MAP" /D "SDK" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:console /machine:I386 /out:"..\bin_vc\as-z80.exe" /pdbtype:sept
+# ADD LINK32 /nologo /subsystem:console /machine:I386 /out:"..\bin_vc\as-gbz80.exe" /pdbtype:sept
+
+!ENDIF 
+
+# Begin Target
+
+# Name "as_gbz80 - Win32 Debug"
+# Name "as_gbz80 - Win32 Release"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\z80\asdata.c
+# ADD CPP /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\z80\asexpr.c
+# ADD CPP /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\z80\aslex.c
+# ADD CPP /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\z80\aslist.c
+# ADD CPP /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\z80\asmain.c
+# ADD CPP /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\z80\asout.c
+# ADD CPP /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\z80\assubr.c
+# ADD CPP /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\z80\assym.c
+# ADD CPP /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\z80\z80adr.c
+# ADD CPP /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\z80\z80ext.c
+# ADD CPP /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\z80\z80mch.c
+# ADD CPP /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\z80\z80pst.c
+# ADD CPP /D "GAMEBOY"
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\z80\alloc.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\z80\asm.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\z80\string.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\z80\z80.h
+# End Source File
+# End Group
+# End Target
+# End Project
index bdb0404ab6236b2fad91f60a663612cca4d90a1b..fc80b89035197c8309f4935a72adf63837d212e9 100644 (file)
@@ -88,7 +88,7 @@
  */
 
 #ifdef SDK
-#define        NCPS    32              /* characters per symbol */
+#define        NCPS    80              /* characters per symbol.  Used to be 32... */
 #else /* SDK */
 #define        NCPS    8               /* characters per symbol */
 #endif /* SDK */
diff --git a/link/z80/linkgbz80.dsp b/link/z80/linkgbz80.dsp
new file mode 100644 (file)
index 0000000..bd2ccda
--- /dev/null
@@ -0,0 +1,174 @@
+# Microsoft Developer Studio Project File - Name="linkgbz80" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=linkgbz80 - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "linkgbz80.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "linkgbz80.mak" CFG="linkgbz80 - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "linkgbz80 - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "linkgbz80 - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "linkgbz80 - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release_gbz80"
+# PROP BASE Intermediate_Dir "Release_gbz80"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_gbz80"
+# PROP Intermediate_Dir "Release_gbz80"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 /nologo /subsystem:console /machine:I386 /out:"..\..\bin_vc\link-gbz80.exe"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF  "$(CFG)" == "linkgbz80 - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug_gbz80"
+# PROP BASE Intermediate_Dir "Debug_gbz80"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_gbz80"
+# PROP Intermediate_Dir "Debug_gbz80"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /out:"..\..\bin_vc\link-gbz80.exe" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF 
+
+# Begin Target
+
+# Name "linkgbz80 - Win32 Release"
+# Name "linkgbz80 - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\lkarea.c
+# ADD CPP /D "SDK" /D "INDEXLIB" /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\lkdata.c
+# ADD CPP /D "SDK" /D "INDEXLIB" /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\lkeval.c
+# ADD CPP /D "SDK" /D "INDEXLIB" /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\lkgb.c
+# ADD CPP /D "SDK" /D "INDEXLIB" /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\lkgg.c
+# ADD CPP /D "SDK" /D "INDEXLIB" /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\lkhead.c
+# ADD CPP /D "SDK" /D "INDEXLIB" /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\lkihx.c
+# ADD CPP /D "SDK" /D "INDEXLIB" /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\lklex.c
+# ADD CPP /D "SDK" /D "INDEXLIB" /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\lklibr.c
+# ADD CPP /D "SDK" /D "INDEXLIB" /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\lklist.c
+# ADD CPP /D "SDK" /D "INDEXLIB" /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\lkmain.c
+# ADD CPP /D "SDK" /D "INDEXLIB" /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\lkrloc.c
+# ADD CPP /D "SDK" /D "INDEXLIB" /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\lks19.c
+# ADD CPP /D "SDK" /D "INDEXLIB" /D "GAMEBOY"
+# End Source File
+# Begin Source File
+
+SOURCE=.\lksym.c
+# ADD CPP /D "SDK" /D "INDEXLIB" /D "GAMEBOY"
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\aslink.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
index 1a2e9a777de5f60fc3bbfb058eb914208190ea8a..b6cdc58410f59fc442080fd79de509d16119808d 100644 (file)
@@ -32,13 +32,13 @@ RSC=rc.exe
 
 # PROP BASE Use_MFC 0
 # PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Output_Dir "Release_z80"
+# PROP BASE Intermediate_Dir "Release_z80"
 # PROP BASE Target_Dir ""
 # PROP Use_MFC 0
 # PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
+# PROP Output_Dir "Release_z80"
+# PROP Intermediate_Dir "Release_z80"
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
@@ -57,13 +57,13 @@ LINK32=link.exe
 
 # PROP BASE Use_MFC 0
 # PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Output_Dir "Debug_z80"
+# PROP BASE Intermediate_Dir "Debug_z80"
 # PROP BASE Target_Dir ""
 # PROP Use_MFC 0
 # PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
+# PROP Output_Dir "Debug_z80"
+# PROP Intermediate_Dir "Debug_z80"
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
@@ -90,184 +90,72 @@ LINK32=link.exe
 # Begin Source File
 
 SOURCE=.\lkarea.c
-
-!IF  "$(CFG)" == "linkz80 - Win32 Release"
-
-# ADD CPP /D "SDK"
-
-!ELSEIF  "$(CFG)" == "linkz80 - Win32 Debug"
-
-!ENDIF 
-
+# ADD CPP /D "SDK" /D "INDEXLIB"
 # End Source File
 # Begin Source File
 
 SOURCE=.\lkdata.c
-
-!IF  "$(CFG)" == "linkz80 - Win32 Release"
-
-# ADD CPP /D "SDK"
-
-!ELSEIF  "$(CFG)" == "linkz80 - Win32 Debug"
-
-!ENDIF 
-
+# ADD CPP /D "SDK" /D "INDEXLIB"
 # End Source File
 # Begin Source File
 
 SOURCE=.\lkeval.c
-
-!IF  "$(CFG)" == "linkz80 - Win32 Release"
-
-# ADD CPP /D "SDK"
-
-!ELSEIF  "$(CFG)" == "linkz80 - Win32 Debug"
-
-!ENDIF 
-
+# ADD CPP /D "SDK" /D "INDEXLIB"
 # End Source File
 # Begin Source File
 
 SOURCE=.\lkgb.c
-
-!IF  "$(CFG)" == "linkz80 - Win32 Release"
-
-# ADD CPP /D "SDK"
-
-!ELSEIF  "$(CFG)" == "linkz80 - Win32 Debug"
-
-!ENDIF 
-
+# ADD CPP /D "SDK" /D "INDEXLIB"
 # End Source File
 # Begin Source File
 
 SOURCE=.\lkgg.c
-
-!IF  "$(CFG)" == "linkz80 - Win32 Release"
-
-# ADD CPP /D "SDK"
-
-!ELSEIF  "$(CFG)" == "linkz80 - Win32 Debug"
-
-!ENDIF 
-
+# ADD CPP /D "SDK" /D "INDEXLIB"
 # End Source File
 # Begin Source File
 
 SOURCE=.\lkhead.c
-
-!IF  "$(CFG)" == "linkz80 - Win32 Release"
-
-# ADD CPP /D "SDK"
-
-!ELSEIF  "$(CFG)" == "linkz80 - Win32 Debug"
-
-!ENDIF 
-
+# ADD CPP /D "SDK" /D "INDEXLIB"
 # End Source File
 # Begin Source File
 
 SOURCE=.\lkihx.c
-
-!IF  "$(CFG)" == "linkz80 - Win32 Release"
-
-# ADD CPP /D "SDK"
-
-!ELSEIF  "$(CFG)" == "linkz80 - Win32 Debug"
-
-!ENDIF 
-
+# ADD CPP /D "SDK" /D "INDEXLIB"
 # End Source File
 # Begin Source File
 
 SOURCE=.\lklex.c
-
-!IF  "$(CFG)" == "linkz80 - Win32 Release"
-
-# ADD CPP /D "SDK"
-
-!ELSEIF  "$(CFG)" == "linkz80 - Win32 Debug"
-
-!ENDIF 
-
+# ADD CPP /D "SDK" /D "INDEXLIB"
 # End Source File
 # Begin Source File
 
 SOURCE=.\lklibr.c
-
-!IF  "$(CFG)" == "linkz80 - Win32 Release"
-
-# ADD CPP /D "SDK"
-
-!ELSEIF  "$(CFG)" == "linkz80 - Win32 Debug"
-
-!ENDIF 
-
+# ADD CPP /D "SDK" /D "INDEXLIB"
 # End Source File
 # Begin Source File
 
 SOURCE=.\lklist.c
-
-!IF  "$(CFG)" == "linkz80 - Win32 Release"
-
-# ADD CPP /D "SDK"
-
-!ELSEIF  "$(CFG)" == "linkz80 - Win32 Debug"
-
-!ENDIF 
-
+# ADD CPP /D "SDK" /D "INDEXLIB"
 # End Source File
 # Begin Source File
 
 SOURCE=.\lkmain.c
-
-!IF  "$(CFG)" == "linkz80 - Win32 Release"
-
-# ADD CPP /D "SDK"
-
-!ELSEIF  "$(CFG)" == "linkz80 - Win32 Debug"
-
-!ENDIF 
-
+# ADD CPP /D "SDK" /D "INDEXLIB"
 # End Source File
 # Begin Source File
 
 SOURCE=.\lkrloc.c
-
-!IF  "$(CFG)" == "linkz80 - Win32 Release"
-
-# ADD CPP /D "SDK"
-
-!ELSEIF  "$(CFG)" == "linkz80 - Win32 Debug"
-
-!ENDIF 
-
+# ADD CPP /D "SDK" /D "INDEXLIB"
 # End Source File
 # Begin Source File
 
 SOURCE=.\lks19.c
-
-!IF  "$(CFG)" == "linkz80 - Win32 Release"
-
-# ADD CPP /D "SDK"
-
-!ELSEIF  "$(CFG)" == "linkz80 - Win32 Debug"
-
-!ENDIF 
-
+# ADD CPP /D "SDK" /D "INDEXLIB"
 # End Source File
 # Begin Source File
 
 SOURCE=.\lksym.c
-
-!IF  "$(CFG)" == "linkz80 - Win32 Release"
-
-# ADD CPP /D "SDK"
-
-!ELSEIF  "$(CFG)" == "linkz80 - Win32 Debug"
-
-!ENDIF 
-
+# ADD CPP /D "SDK" /D "INDEXLIB"
 # End Source File
 # End Group
 # Begin Group "Header Files"
index c4df74b4b1fd21cc6595f4b6301b3ed70b98f4dd..24ecc18fecf3e40ecd184955026bf3f4a35a81f4 100644 (file)
--- a/sdcc.dsw
+++ b/sdcc.dsw
@@ -3,6 +3,57 @@ Microsoft Developer Studio Workspace File, Format Version 6.00
 
 ###############################################################################
 
+Project: "all"=.\all.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name as_z80
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name aslink
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name asx8051
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name packihx
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name sdcpp
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name src
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name linkz80
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name linkgbz80
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name as_gbz80
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "as_gbz80"=.\as\as_gbz80.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
 Project: "as_z80"=.\as\as_z80.dsp - Package Owner=<4>
 
 Package=<5>
@@ -117,7 +168,19 @@ Package=<4>
 
 ###############################################################################
 
-Project: "linkz80"=.\link\z80\linkz80.dsp - Package Owner=<4>
+Project: "linkgbz80"=.\link\z80\linkgbz80.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "linkz80"=.\LINK\Z80\linkz80.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
index 7d7cda458072f8696311a3439d7de74f7b009a29..bb9425b3ca2cb6de95073d5fa25de428eae41333 100644 (file)
@@ -1512,6 +1512,17 @@ glue (void)
   FILE *asmFile;
   FILE *ovrFile = tempfile ();
   char moduleBuf[PATH_MAX];
+  int mcs51_like;
+
+  if(port->general.glue_up_main &&
+    (TARGET_IS_MCS51 || TARGET_IS_DS390 || TARGET_IS_XA51 || TARGET_IS_DS400))
+  {
+      mcs51_like=1; /*So it has bits, sfr, sbits, data, idata, etc...*/
+  }
+  else
+  {
+      mcs51_like=0;
+  }
 
   addSetHead (&tmpfileSet, ovrFile);
   /* print the global struct definitions */
@@ -1574,22 +1585,21 @@ glue (void)
   if (port->assembler.externGlobal)
     printExterns (asmFile);
 
-  /* copy the sfr segment */
-  fprintf (asmFile, "%s", iComments2);
-  fprintf (asmFile, "; special function registers\n");
-  fprintf (asmFile, "%s", iComments2);
-  copyFile (asmFile, sfr->oFile);
+  if(mcs51_like)
+  {
+      /* copy the sfr segment */
+      fprintf (asmFile, "%s", iComments2);
+      fprintf (asmFile, "; special function registers\n");
+      fprintf (asmFile, "%s", iComments2);
+      copyFile (asmFile, sfr->oFile);
 
-  /* copy the sbit segment */
-  fprintf (asmFile, "%s", iComments2);
-  fprintf (asmFile, "; special function bits \n");
-  fprintf (asmFile, "%s", iComments2);
-  copyFile (asmFile, sfrbit->oFile);
+      /* copy the sbit segment */
+      fprintf (asmFile, "%s", iComments2);
+      fprintf (asmFile, "; special function bits \n");
+      fprintf (asmFile, "%s", iComments2);
+      copyFile (asmFile, sfrbit->oFile);
   
-  /*JCF: Create the areas for the register banks*/
-  if(port->general.glue_up_main &&
-     (TARGET_IS_MCS51 || TARGET_IS_DS390 || TARGET_IS_XA51 || TARGET_IS_DS400))
-  {
+      /*JCF: Create the areas for the register banks*/
          if(RegBankUsed[0]||RegBankUsed[1]||RegBankUsed[2]||RegBankUsed[3])
          {
                 fprintf (asmFile, "%s", iComments2);
@@ -1608,7 +1618,7 @@ glue (void)
 
   /* copy the data segment */
   fprintf (asmFile, "%s", iComments2);
-  fprintf (asmFile, "; internal ram data\n");
+  fprintf (asmFile, "; %s ram data\n", mcs51_like?"internal":"");
   fprintf (asmFile, "%s", iComments2);
   copyFile (asmFile, data->oFile);
 
@@ -1616,7 +1626,7 @@ glue (void)
   /* create the overlay segments */
   if (overlay) {
     fprintf (asmFile, "%s", iComments2);
-    fprintf (asmFile, "; overlayable items in internal ram \n");
+    fprintf (asmFile, "; overlayable items in %s ram \n", mcs51_like?"internal":"");
     fprintf (asmFile, "%s", iComments2);
     copyFile (asmFile, ovrFile);
   }
@@ -1632,7 +1642,7 @@ glue (void)
     }
 
   /* create the idata segment */
-  if (idata) {
+  if ( (idata) && (mcs51_like) ) {
     fprintf (asmFile, "%s", iComments2);
     fprintf (asmFile, "; indirectly addressable internal ram data\n");
     fprintf (asmFile, "%s", iComments2);
@@ -1640,10 +1650,12 @@ glue (void)
   }
 
   /* copy the bit segment */
-  fprintf (asmFile, "%s", iComments2);
-  fprintf (asmFile, "; bit data\n");
-  fprintf (asmFile, "%s", iComments2);
-  copyFile (asmFile, bit->oFile);
+  if (mcs51_like) {
+    fprintf (asmFile, "%s", iComments2);
+    fprintf (asmFile, "; bit data\n");
+    fprintf (asmFile, "%s", iComments2);
+    copyFile (asmFile, bit->oFile);
+  }
 
   /* if external stack then reserve space of it */
   if (mainf && IFFUNC_HASBODY(mainf->type) && options.useXstack)
@@ -1657,10 +1669,12 @@ glue (void)
 
 
   /* copy xtern ram data */
-  fprintf (asmFile, "%s", iComments2);
-  fprintf (asmFile, "; external ram data\n");
-  fprintf (asmFile, "%s", iComments2);
-  copyFile (asmFile, xdata->oFile);
+  if (mcs51_like) {
+    fprintf (asmFile, "%s", iComments2);
+    fprintf (asmFile, "; external ram data\n");
+    fprintf (asmFile, "%s", iComments2);
+    copyFile (asmFile, xdata->oFile);
+  }
 
   /* copy xternal initialized ram data */
   fprintf (asmFile, "%s", iComments2);
index 66340ca85bd5ca70353fea69eda181baf260f0fc..47727422921b15120e4aa49d4d9f55ee2f283140 100644 (file)
@@ -1295,23 +1295,33 @@ linkEdit (char **envp)
       exit (1);
     }
 
-  /* now write the options.  JCF: added option 'y' */
-  fprintf (lnkfile, "-myux%c\n", (options.out_fmt ? 's' : 'i'));
-
-  /* if iram size specified */
-  if (options.iram_size)
-    fprintf (lnkfile, "-a 0x%04x\n", options.iram_size);
-
-  /* if xram size specified */
-  if (options.xram_size_set)
-    fprintf (lnkfile, "-v 0x%04x\n", options.xram_size);
-
-  /* if code size specified */
-  if (options.code_size)
-    fprintf (lnkfile, "-w 0x%04x\n", options.code_size);
-
-  if (options.debug)
-    fprintf (lnkfile, "-z\n");
+   if (TARGET_IS_Z80 || TARGET_IS_GBZ80)
+   {
+         fprintf (lnkfile, "--\n-m\n-j\n-x\n-%c %s\n",
+          (options.out_fmt ? 's' : 'i'), dstFileName);
+   }
+   else /*For all the other ports.  Including pics???*/
+   {
+         fprintf (lnkfile, "-myux%c\n", (options.out_fmt ? 's' : 'i'));
+   }
+
+   if (!(TARGET_IS_Z80 || TARGET_IS_GBZ80)) /*Not for the z80, gbz80*/
+   {
+         /* if iram size specified */
+         if (options.iram_size)
+               fprintf (lnkfile, "-a 0x%04x\n", options.iram_size);
+
+         /* if xram size specified */
+         if (options.xram_size_set)
+               fprintf (lnkfile, "-v 0x%04x\n", options.xram_size);
+
+         /* if code size specified */
+         if (options.code_size)
+               fprintf (lnkfile, "-w 0x%04x\n", options.code_size);
+
+         if (options.debug)
+               fprintf (lnkfile, "-z\n");
+   }
 
 #define WRITE_SEG_LOC(N, L) \
     segName = Safe_strdup(N); \
@@ -1319,29 +1329,39 @@ linkEdit (char **envp)
     fprintf (lnkfile,"-b %s = 0x%04x\n", c, L); \
     if (segName) { Safe_free(segName); }
 
-  /* code segment start */
-  WRITE_SEG_LOC (CODE_NAME, options.code_loc);
+   if (!(TARGET_IS_Z80 || TARGET_IS_GBZ80)) /*Not for the z80, gbz80*/
+   {
 
-  /* data segment start */
-  if(options.data_loc){ /*JCF: If zero, the linker chooses the best place for data*/
-         WRITE_SEG_LOC (DATA_NAME, options.data_loc);
-  }
+         /* code segment start */
+         WRITE_SEG_LOC (CODE_NAME, options.code_loc);
 
-  /* xdata start */
-  WRITE_SEG_LOC (XDATA_NAME, options.xdata_loc);
+         /* data segment start. If zero, the linker chooses
+      the best place for data*/
+         if(options.data_loc){
+                 WRITE_SEG_LOC (DATA_NAME, options.data_loc);
+         }
 
-  /* indirect data */
-  if (IDATA_NAME) {
-    WRITE_SEG_LOC (IDATA_NAME, options.idata_loc);
-  }
+         /* xdata start */
+         WRITE_SEG_LOC (XDATA_NAME, options.xdata_loc);
 
-  /* bit segment start */
-  WRITE_SEG_LOC (BIT_NAME, 0);
+         /* indirect data */
+         if (IDATA_NAME) {
+               WRITE_SEG_LOC (IDATA_NAME, options.idata_loc);
+         }
 
-  /* JCF: stack start */
-  if ( (options.stack_loc) && (options.stack_loc<0x100) ) {
-       WRITE_SEG_LOC ("SSEG", options.stack_loc);
-  }
+         /* bit segment start */
+         WRITE_SEG_LOC (BIT_NAME, 0);
+
+         /* stack start */
+         if ( (options.stack_loc) && (options.stack_loc<0x100) ) {
+               WRITE_SEG_LOC ("SSEG", options.stack_loc);
+         }
+   }
+   else /*For the z80, gbz80*/
+   {
+       WRITE_SEG_LOC ("_CODE", options.code_loc);
+       WRITE_SEG_LOC ("_DATA", options.data_loc);
+   }
   
   /* If the port has any special linker area declarations, get 'em */
   if (port->extraAreas.genExtraAreaLinkOptions)
@@ -1355,81 +1375,103 @@ linkEdit (char **envp)
   /* other library paths if specified */
   for (s = setFirstItem(libPathsSet); s != NULL; s = setNextItem(libPathsSet))
     fprintf (lnkfile, "-k %s\n", s);
-
+  
   /* standard library path */
-  if (!options.nostdlib)
+    if (!options.nostdlib)
     {
-      switch (options.model)
-       {
-       case MODEL_SMALL:
-         c = "small";
-         break;
-       case MODEL_LARGE:
-         c = "large";
-         break;
-       case MODEL_FLAT24:
-         /* c = "flat24"; */
-           if (TARGET_IS_DS390)
-           {
-               c = "ds390";
-           }
-           else if (TARGET_IS_DS400)
-           {
-               c = "ds400";
-           }
-           else
-           {
-               fprintf(stderr, 
-                       "Add support for your FLAT24 target in %s @ line %d\n",
-                       __FILE__, __LINE__);
-               exit(-1);
-           }
-         break;
-       case MODEL_PAGE0:
-         c = "xa51";
-         break;
-       default:
-         werror (W_UNKNOWN_MODEL, __FILE__, __LINE__);
-         c = "unknown";
-         break;
-       }
-      for (s = setFirstItem(libDirsSet); s != NULL; s = setNextItem(libDirsSet))
-        mfprintf (lnkfile, getRuntimeVariables(), "-k %s{sep}%s\n", s, c);
+        if (!(TARGET_IS_Z80 || TARGET_IS_GBZ80)) /*Not for the z80, gbz80*/
+        {
+            switch (options.model)
+            {
+                case MODEL_SMALL:
+                    c = "small";
+                    break;
+                case MODEL_LARGE:
+                    c = "large";
+                    break;
+                case MODEL_FLAT24:
+                    /* c = "flat24"; */
+                    if (TARGET_IS_DS390)
+                    {
+                        c = "ds390";
+                    }
+                    else if (TARGET_IS_DS400)
+                    {
+                        c = "ds400";
+                    }
+                    else
+                    {
+                        fprintf(stderr, 
+                               "Add support for your FLAT24 target in %s @ line %d\n",
+                               __FILE__, __LINE__);
+                        exit(-1);
+                    }
+                       break;
+                   case MODEL_PAGE0:
+                       c = "xa51";
+                       break;
+                   default:
+                       werror (W_UNKNOWN_MODEL, __FILE__, __LINE__);
+                       c = "unknown";
+                       break;
+               }
+        }
+        else /*for the z80, gbz80*/
+        {
+            if (TARGET_IS_Z80)
+                c = "z80";
+            else
+                c = "gbz80";
+        }
+        for (s = setFirstItem(libDirsSet); s != NULL; s = setNextItem(libDirsSet))
+            mfprintf (lnkfile, getRuntimeVariables(), "-k %s{sep}%s\n", s, c);
+
 
       /* standard library files */
 #if !OPT_DISABLE_DS390
-      if (options.model == MODEL_FLAT24)
-       {
-           if (TARGET_IS_DS390)
-           {
-               fprintf (lnkfile, "-l %s\n", STD_DS390_LIB);
-           }
-           else if (TARGET_IS_DS400)
-           {
-               fprintf (lnkfile, "-l %s\n", STD_DS400_LIB);
-           }
-           else
-           {
-               fprintf(stderr, 
-                       "Add support for your FLAT24 target in %s @ line %d\n",
-                       __FILE__, __LINE__);
-               exit(-1);
-           }
-       }
+        if (options.model == MODEL_FLAT24)
+        {
+            if (TARGET_IS_DS390)
+            {
+                fprintf (lnkfile, "-l %s\n", STD_DS390_LIB);
+            }
+            else if (TARGET_IS_DS400)
+            {
+                fprintf (lnkfile, "-l %s\n", STD_DS400_LIB);
+            }
+            else
+            {
+                fprintf(stderr, 
+                    "Add support for your FLAT24 target in %s @ line %d\n",
+                    __FILE__, __LINE__);
+                exit(-1);
+            }
+        }
 #endif
 
 #if !OPT_DISABLE_XA51 
 #ifdef STD_XA51_LIB
-      if (options.model == MODEL_PAGE0)
-       {
-         fprintf (lnkfile, "-l %s\n", STD_XA51_LIB);
-       }
+        if (options.model == MODEL_PAGE0)
+        {
+            fprintf (lnkfile, "-l %s\n", STD_XA51_LIB);
+        }
 #endif
 #endif
-      fprintf (lnkfile, "-l %s\n", STD_LIB);
-      fprintf (lnkfile, "-l %s\n", STD_INT_LIB);
-      fprintf (lnkfile, "-l %s\n", STD_LONG_LIB);
-      fprintf (lnkfile, "-l %s\n", STD_FP_LIB);
+        if (!(TARGET_IS_Z80 || TARGET_IS_GBZ80)) /*Not for the z80, gbz80*/
+        { /*Why the z80 port is not using the standard libraries?*/
+            fprintf (lnkfile, "-l %s\n", STD_LIB);
+            fprintf (lnkfile, "-l %s\n", STD_INT_LIB);
+            fprintf (lnkfile, "-l %s\n", STD_LONG_LIB);
+            fprintf (lnkfile, "-l %s\n", STD_FP_LIB);
+        }
+        else if (TARGET_IS_Z80)
+        {
+            fprintf (lnkfile, "-l z80\n");
+        }
+        else if (TARGET_IS_GBZ80)
+        {
+            fprintf (lnkfile, "-l gbz80\n");
+        }
     }
 
   /* additional libraries if any */
@@ -1442,6 +1484,37 @@ linkEdit (char **envp)
 
   fputStrSet(lnkfile, relFilesSet);
 
+  /*For the z80 and gbz80 ports, try to find where crt0.o is...*/
+  if (TARGET_IS_Z80 || TARGET_IS_GBZ80) /*For the z80, gbz80*/
+  {
+      char crt0path[PATH_MAX];
+      FILE * crt0fp;
+      for (s = setFirstItem(libDirsSet); s != NULL; s = setNextItem(libDirsSet))
+      {
+          sprintf (crt0path, "%s%s%s%scrt0.o",
+             s, DIR_SEPARATOR_STRING, c, DIR_SEPARATOR_STRING);
+          
+          crt0fp=fopen(crt0path, "r");
+          if(crt0fp!=NULL)/*Found it!*/
+          {
+              fclose(crt0fp);
+              #ifdef __CYGWIN__
+              {
+                 /*The CYGWIN version of the z80-gbz80 linker is getting confused with
+                 windows paths, so convert them to the CYGWIN format*/
+                 char posix_path[PATH_MAX];
+                 void cygwin_conv_to_full_posix_path(char * win_path, char * posix_path);
+                 cygwin_conv_to_full_posix_path(crt0path, posix_path);
+                 strcpy(crt0path, posix_path);
+              }
+              #endif
+              fprintf (lnkfile, "%s\n", crt0path);
+              break;
+          }
+      }
+      if(s==NULL) fprintf (stderr, "Warning: couldn't find crt0.o\n");
+  }
+
   fprintf (lnkfile, "\n-e\n");
   fclose (lnkfile);
 
index 4711840b6bb1e2ec35c2c54c801ddab21e5b83d3..3bff23e24963afd672db25f5e1eb229e50c9d992 100644 (file)
@@ -478,6 +478,9 @@ _hasNativeMulFor (iCode *ic, sym_link *left, sym_link *right)
   return FALSE;
 }
 
+
+#define LINKCMD "link-{port} -nf {dstfilename}"
+/*
 #define LINKCMD \
     "link-{port} -n -c -- {z80bases} -m -j" \
     " {z80libspec}" \
@@ -486,6 +489,7 @@ _hasNativeMulFor (iCode *ic, sym_link *left, sym_link *right)
     " {z80crt0}" \
     " \"{dstfilename}{objext}\"" \
     " {z80extraobj}"
+*/
 
 #define ASMCMD \
     "as-{port} -plosgff \"{objdstfilename}\" \"{dstfilename}{asmext}\""
index 3c627e11286e7ffdbbb38d08c61b162922939f47..a31a82a652316dbb797595ebc484cb056d3d0249 100644 (file)
@@ -90,6 +90,15 @@ SOURCE=.\gen.c
 # Begin Source File
 
 SOURCE=.\main.c
+
+!IF  "$(CFG)" == "z80 - Win32 Debug"
+
+!ELSEIF  "$(CFG)" == "z80 - Win32 Release"
+
+# ADD CPP /D "LNK"
+
+!ENDIF 
+
 # End Source File
 # Begin Source File