Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions build.settings
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ DskDir = 'dsk'

# Set the data start address for variables declared in our code.
DataAddress = '0x6000'

# Specific compiler related.
#PeepHoleFile = './build/sdcc/common/peep_hole_z80.def'
PeepHoleFile = ''
14 changes: 11 additions & 3 deletions build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class Project:
DirIncludes = []
DirLibs = []
LinkLibs = []
FilePeepHole = ''
_loadAddress = ''
_startAddress = ''
DataAddress = ''
Expand Down Expand Up @@ -157,7 +158,7 @@ def _setDirs(self, workdir='current'):
filePy = os.path.join(self.DirPrj, os.path.splitext(os.path.basename(self.SettingsFile))[0] + 'Settings.py')

shutil.copy(self.SettingsFile, filePy)
from buildSettings import IntermediatesDir, ProjectName, OutputDir, ObjectDir, TempDir, SourcesDir, ResourcesDir, DskDir, IncDir, LibDir, LibDir, LibLink, DataAddress
from buildSettings import IntermediatesDir, ProjectName, OutputDir, ObjectDir, TempDir, SourcesDir, ResourcesDir, DskDir, IncDir, LibDir, LibDir, LibLink, DataAddress, PeepHoleFile
os.remove(filePy)

self.DirIntermediates = self.getRealPath(os.path.join(IntermediatesDir, workdir))
Expand All @@ -172,6 +173,7 @@ def _setDirs(self, workdir='current'):
self.DirLibs = self.getRealPath(ensureList(LibDir))
self.LinkLibs = ensureList(LibLink)
self.DataAddress = DataAddress
self.FilePeepHole = PeepHoleFile
self._binFilename = os.path.join(self.DirOutput, self.Name) + '.bin'
self._dskFilename = os.path.join(self.DirDsk, self.Name) + '.dsk'
self._symFilename = os.path.join(self.DirObject, self.Name) + '.noi'
Expand Down Expand Up @@ -289,7 +291,7 @@ def _checkSettings(self):
print ('\n\n= CHECKING PROJECT SETTINGS =')
isProjectOk = self.existDir(self.DirOutput) if isProjectOk else False
isProjectOk = self.existDir(self.DirSources) if isProjectOk else False
isProjectOk = self.existDir(self.DirResources) if isProjectOk else False
isProjectOk = self.existDir(self.DirResources) if isProjectOk else False
isProjectOk = self.existDir(self.DirIncludes) if isProjectOk else False
isProjectOk = self.existDir(self.DirLibs) if isProjectOk else False
isProjectOk = self.existDir(self.DirDsk) if isProjectOk else False
Expand Down Expand Up @@ -367,7 +369,7 @@ def _assemble(self):
bMissingFiles = False;
for srcDir in self.DirSources:
filelist = os.listdir(srcDir)
command = ASM_EXEC + ' -o ' + os.path.join(self.DirObject, '%s') + ' ' + os.path.join(srcDir, '%s')
command = ASM_EXEC + ' -b -w -p -y -o ' + os.path.join(self.DirObject, '%s') + ' ' + os.path.join(srcDir, '%s')

print ('\n= ASSEMBLING FILES =')
print (' - Files:')
Expand Down Expand Up @@ -429,6 +431,9 @@ def _compile(self):
if self.existDir(incDir):
COMMAND += '-I ' + incDir + ' '

if self.FilePeepHole != '':
COMMAND += ' --vc -Wa -p,-w -Wl -m,-w,-u,-p,-M,-I,-X --fverbose-asm -S --peep-asm --peep-file ' + self.FilePeepHole

print ('\n= COMPILING =')
print (' - Files:')
for srcDir in self.DirSources:
Expand Down Expand Up @@ -474,6 +479,9 @@ def _link(self):
for libDir in self.DirLibs:
if self.existDir(libDir):
libDirs += ' -L ' + libDir + ' '

if self.FilePeepHole != '':
COMMAND += ' --vc -Wa -p,-w -Wl -m,-w,-u,-p,-M,-I,-X --fverbose-asm -S --peep-asm --peep-file ' + self.FilePeepHole

print ('\n= LINKING =')
print (' - Libraries:')
Expand Down
6 changes: 6 additions & 0 deletions build/sdcc/common/peep_hole_z80.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
replace {
xor a, a
} by {
xor a
xor a
}
Binary file added doc/Z80_manual_zilog.pdf
Binary file not shown.
Binary file not shown.
Binary file added doc/uPD765_NEC_Datasheet.pdf
Binary file not shown.
Loading