Skip to content

Commit a8f7d79

Browse files
Made it so we can now specify which routines we want
+ Also fixed di :P
1 parent 08a966a commit a8f7d79

File tree

269 files changed

+373
-85
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

269 files changed

+373
-85
lines changed

CEdev/bin/main_makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ endif
9494
#Define the nesassary headers, along with any the user may have defined, where modification should just trigger a build
9595
USERHEADERS := $(call WINPATH,$(foreach dir,$(ALLDIRS),$(wildcard $(dir)*.h)))
9696
HEADERS := $(subst $(space),;,$(call WINPATH,. $(ALLDIRS) $(addprefix $(CEDEV)/,. include include/asm include/lib/ce include/lib/std $(LIBLOC))))
97-
LIBRARIES := $(call WINPATH,$(addprefix $(CEDEV)/lib/std/,ce/ctice.lib ce/cdebug.lib chelp.lib crt.lib crtS.lib nokernel.lib fplib.lib fplibS.lib))
97+
LIBRARIES := $(call WINPATH,$(addprefix $(CEDEV)/lib/std/,ce/ctice.lib ce/cdebug.lib chelp.lib crt.lib))
98+
ifneq ($(USE_FLASH_FUNCTIONS),NO)
99+
LIBRARIES += $(call WINPATH,$(addprefix $(CEDEV)/lib/std/,crt_linked.lib))
100+
else
101+
LIBRARIES += $(call WINPATH,$(addprefix $(CEDEV)/lib/std/,crt_static.lib))
102+
endif
98103
LIBRARIES += $(call WINPATH,$(foreach var,$(L),$(CEDEV)/lib/ce/$(var)/$(var).lib))
99104

100105
#Define the assembler flags used by the Zilog assembler

CEdev/examples/template/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,10 @@ STACK_HIGH := D1A87E
3939
INIT_LOC := D1A87F
4040
#----------------------------
4141

42+
#Use the (slower) OS embedded functions (Advanced)
43+
44+
#----------------------------
45+
USE_FLASH_FUNCTIONS ?= YES
46+
#----------------------------
47+
4248
include $(CEDEV)/bin/main_makefile

CEdev/include/asm/cstartup.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ _init:
4141
;-------------------------------------------------------------------------------
4242
segment .startup
4343

44-
di
4544
call 0020848h ; _RunInicOff
45+
di
4646
ld hl,__low_bss
4747
ld bc,010DE2h ; maximum size of BSS+Heap
4848
call 00210DCh ; _MemClear

CEdev/lib/src/buildall.bat

Lines changed: 48 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,37 @@ REM ----------------------------------------------------
44
REM Batch file to build all runtime libraries
55
REM
66
REM (c) Zilog, Inc.
7-
REM Modified by Matt Waltz for CE support
7+
REM Modified by Matt "MateoConLechuga" Waltz for CE support
88
REM ----------------------------------------------------
99

1010
REM +--Setting environment variables-------------------+
11+
12+
set SRC=.
1113
set BIN=%CEDEV%\bin
1214
set INC=%CEDEV%\include
1315
set LIBPATH=%CEDEV%\lib
14-
set SRC=.
16+
set SHARED_PATH=std\shared
17+
set STATIC_PATH=std\static
18+
set LINKED_PATH=std\linked
19+
set CE_PATH=ce
1520

1621
set ASM=%BIN%\ez80asm.exe
1722
set CC=%BIN%\eZ80cc.exe
1823
set LIB=%BIN%\ez80lib.exe
1924

20-
set RTL_C_SRC=bsearch.c maptab.c modf.c qsort.c strtod.c strtol.c strtoul.c ufltinfo.c ufltrnd.c ureverse.c
21-
set RTL_ST_C_SRC=uitoa.c ultoa.c ustoa.c uuitoa.c uultoa.c uustoa.c vsprintf.c
25+
REM -- Static and linked hold the same file names --
2226

23-
set RTL_NOKERNEL_C_SRC=free.c malloc.c realloc.c
24-
set RTL_ASM_SRC=atoi.asm atol.asm atos.asm abs.asm calloc.asm isalnum.asm isalpha.asm iscntrl.asm isdigit.asm isgraph.asm islower.asm isprint.asm ispunct.asm isspace.asm isupper.asm isxdigit.asm isascii.asm labs.asm sprintf.asm strtok.asm longjmp.asm memchr.asm memcmp.asm memcpy.asm memmove.asm memset.asm sbrk.asm setjmp.asm strcat.asm strchr.asm strcmp.asm strcpy.asm strcspn.asm strlen.asm strncat.asm strncmp.asm strncpy.asm strpbrk.asm strrchr.asm strspn.asm strstr.asm div.asm ldiv.asm tolower.asm toupper.asm strncasecmp.asm srand.asm rand.asm strdup.asm
27+
set RTL_STATIC_C_SRC=asin.c atan.c atan2.c exp.c floor.c fmod.c frexp.c ldexp.c log.c log10.c modf.c pow.c sin.c sinh.c sqrt.c strtod.c tan.c tanh.c ufltinfo.c ufltrnd.c
28+
set RTL_STATIC_ASM_SRC=acos.asm atof.asm ceil.asm cos.asm fabs.asm isalnum.asm isalpha.asm iscntrl.asm isdigit.asm isgraph.asm islower.asm isprint.asm ispunct.asm isspace.asm isupper.asm isxdigit.asm
2529

26-
set HLP_C_SRC=
27-
set HLP_ASM_SRC=bdivs.asm bdivu.asm bldix.asm bldiy.asm bmuls.asm brems.asm bremu.asm bshl.asm bshrs.asm bshru.asm bstix.asm bstiy.asm case.asm iand.asm idivs.asm idivu.asm ildix.asm ildiy.asm imulu.asm indcall.asm ineg.asm inot.asm ior.asm irems.asm iremu.asm ishl.asm ishrs.asm ishru.asm istix.asm istiy.asm itol.asm ixor.asm ladd.asm land.asm lcmpu.asm lcmps.asm ldivs.asm ldivu.asm lldix.asm lldiy.asm lmulu.asm lmuls.asm lneg.asm lnot.asm lor.asm lrems.asm lremu.asm lshl.asm lshrs.asm lshru.asm lstix.asm lstiy.asm lsub.asm lxor.asm sand.asm sdivs.asm sdivu.asm sldix.asm sldiy.asm smulu.asm sneg.asm snot.asm sor.asm srems.asm sremu.asm sshl.asm sshrs.asm sshru.asm sstix.asm sstiy.asm stoi.asm stoiu.asm sxor.asm frbmuls.asm frbtof.asm frftob.asm frftoi.asm frftos.asm frftoub.asm frftoui.asm frftous.asm frimuls.asm frimulu.asm fritof.asm frsmuls.asm frsmulu.asm frstof.asm frubtof.asm fruitof.asm frustof.asm frameset0.asm frameset.asm setflag.asm scmpzero.asm icmpzero.asm lcmpzero.asm seqcase.asm seqcaseD.asm case24.asm case24D.asm case16.asm case16D.asm case8.asm case8D.asm
30+
set RTL_LINKED_C_SRC=
31+
set RTL_LINKED_ASM_SRC=acos.asm asin.asm atan.asm atan2.asm atof.asm ceil.asm cos.asm cosh.asm exp.asm fabs.asm floor.asm fmod.asm frexp.asm isalnum.asm isalpha.asm iscntrl.asm isdigit.asm isgraph.asm islower.asm isprint.asm ispunct.asm isspace.asm isupper.asm isxdigit.asm ldexp.asm log.asm log10.asm modf.asm pow.asm sin.asm sinh.asm sqrt.asm strtod.asm tan.asm tanh.asm ufltinfo.asm ufltrnd.asm
32+
33+
set RTL_SHARED_C_SRC=bsearch.c fpdata.c free.c gamma.c malloc.c maptab.c qsort.c realloc.c strtol.c strtoul.c udtoe.c udtof.c udtog.c uitoa.c ultoa.c ureverse.c ustoa.c uuitoa.c uultoa.c uustoa.c vsprintf.c
34+
set RTL_SHARED_ASM_SRC=abs.asm atoi.asm atol.asm atos.asm calloc.asm div.asm finite.asm fpadd.asm fpcmp.asm fpdiv.asm fpftol.asm fpltof.asm fpmul.asm fpneg.asm fppack.asm fpsub.asm fpultof.asm fpupop1.asm fpupop2.asm isascii.asm isinf.asm isnan.asm longjmp.asm memchr.asm memcmp.asm memcpy.asm memmove.asm memset.asm rand.asm sbrk.asm setjmp.asm sprintf.asm sqrtf.asm srand.asm stoi.asm strcasecmp.asm strcat.asm strchr.asm strcmp.asm strcpy.asm strcspn.asm strdup.asm strlen.asm strncasecmp.asm strncat.asm strncmp.asm strncpy.asm strpbrk.asm strrchr.asm strspn.asm strstr.asm strtok.asm tolower.asm toupper.asm uldiv.asm
2835

29-
set FP_C_SRC=asin.c atan.c atan2.c exp.c floor.c fmod.c fpdata.c frexp.c ldexp.c log.c log10.c modf.c pow.c sin.c sinh.c sqrt.c tan.c tanh.c gamma.c udtoe.c
30-
set FP_ST_C_SRC=udtof.c udtog.c
31-
set FP_ASM_SRC=acos.asm atof.asm ceil.asm cos.asm fabs.asm finite.asm fpadd.asm fpcmp.asm fpdiv.asm fpftol.asm fpltof.asm fpmul.asm fpneg.asm fppack.asm fpsub.asm fpultof.asm fpupop1.asm fpupop2.asm sqrtf.asm isnan.asm isinf.asm
36+
set HLP_C_SRC=
37+
set HLP_ASM_SRC=bdivs.asm bdivu.asm bldix.asm bldiy.asm bmuls.asm brems.asm bremu.asm bshl.asm bshrs.asm bshru.asm bstix.asm bstiy.asm case.asm case24.asm case24D.asm case16.asm case16D.asm case8.asm case8D.asm iand.asm idivs.asm idivu.asm ildix.asm ildiy.asm imulu.asm imuls.asm indcall.asm ineg.asm inot.asm ior.asm irems.asm iremu.asm ishl.asm ishrs.asm ishru.asm istix.asm istiy.asm itol.asm ixor.asm ladd.asm land.asm lcmpu.asm lcmps.asm ldivs.asm ldivu.asm lldix.asm lldiy.asm lmulu.asm lmuls.asm lneg.asm lnot.asm lor.asm lrems.asm lremu.asm lshl.asm lshrs.asm lshru.asm lstix.asm lstiy.asm lsub.asm lxor.asm sand.asm sdivs.asm sdivu.asm sldix.asm sldiy.asm smulu.asm sneg.asm snot.asm sor.asm srems.asm sremu.asm sshl.asm sshrs.asm sshru.asm sstix.asm sstiy.asm stoi.asm stoiu.asm sxor.asm frbmuls.asm frbtof.asm frftob.asm frftoi.asm frftos.asm frftoub.asm frftoui.asm frftous.asm frimuls.asm frimulu.asm fritof.asm frsmuls.asm frsmulu.asm frstof.asm frubtof.asm fruitof.asm frustof.asm frameset0.asm frameset.asm setflag.asm scmpzero.asm icmpzero.asm lcmpzero.asm seqcase.asm seqcaseD.asm
3238

3339
set DEBUG_C_SRC=
3440
set DEBUG_ASM_SRC=debugger.asm removeallbreakpoints.asm removeallwatchpoints.asm removebreakpoint.asm removewatchpoint.asm setbreakpoint.asm setreadwatchpoint.asm setwritewatchpoint.asm setreadwritewatchpoint.asm setwatchpoint.asm
@@ -38,7 +44,7 @@ set TICE_ASM_SRC=tice.asm memset_fast.asm prgmcleanup.asm abort.asm os.asm
3844
set CPU=EZ80F91
3945
set STDINC=%INC%\lib\std
4046
set CEINC=%CEDEV%\include\lib\ce
41-
set ZLGINC=%SRC%\std_include
47+
set ZLGINC=%SRC%\include
4248
set CFLG_REL=-NOdebug -optsize -NOkeeplst -promote -quiet -fplib
4349
set AFLG=-genobj -NOigcase -include:%STDINC% -include:%ZLGINC% -NOlist -NOlistmac -pagelen:56 -pagewidth:100 -quiet -sdiopt -warn -NOzmasm
4450

@@ -49,60 +55,47 @@ mkdir %LIBPATH%\std\ce
4955

5056
REM --- CE Libraries
5157

52-
echo --Building CE Debugger library...
58+
set C_FLG=%CFLG_REL% -cpu:%CPU% -asmsw:"-cpu:%CPU% -include:%STDINC% -include:%ZLGINC%" -define:_%CPU%
59+
set ASM_FLG=%AFLG% -cpu:%CPU% -NOdebug
60+
61+
echo -- Building CE Debugger library...
62+
set MY_PATH=%CE_PATH%
5363
set C_SRC=%DEBUG_C_SRC%
5464
set ASM_SRC=%DEBUG_ASM_SRC%
55-
set C_FLG=%CFLG_DBG% -cpu:%CPU% -asmsw:"-cpu:%CPU% -include:%STDINC% -include:%ZLGINC%" -define:_%CPU%
56-
set ASM_FLG=%AFLG% -cpu:%CPU% -debug -include:%CEINC%
57-
call buildcelib.bat cdebug.lib
65+
call buildlib.bat cdebug.lib
5866

59-
echo --Building TICE library...
67+
echo -- Building TICE library...
68+
set MY_PATH=%CE_PATH%
6069
set C_SRC=%TICE_C_SRC%
6170
set ASM_SRC=%TICE_ASM_SRC%
62-
set C_FLG=%CFLG_DBG% -cpu:%CPU% -asmsw:"-cpu:%CPU% -include:%STDINC% -include:%ZLGINC%" -define:_%CPU%
63-
set ASM_FLG=%AFLG% -cpu:%CPU% -debug -include:%CEINC%
64-
call buildcelib.bat ctice.lib
65-
66-
echo --Building RTL libraries...
67-
set C_SRC=%RTL_C_SRC%
68-
set ASM_SRC=%RTL_ASM_SRC%
69-
set C_FLG=%CFLG_REL% -cpu:%CPU% -asmsw:"-cpu:%CPU% -include:%STDINC% -include:%ZLGINC%" -define:_%CPU%
70-
set ASM_FLG=%AFLG% -cpu:%CPU% -NOdebug
71-
call buildstdlib.bat crt.lib
71+
call buildlib.bat ctice.lib
7272

73-
set C_SRC=%RTL_ST_C_SRC%
74-
set ASM_SRC=
75-
set C_FLG=%CFLG_REL% -cpu:%CPU% -asmsw:"-cpu:%CPU% -include:%STDINC% -include:%ZLGINC%" -define:_%CPU%
76-
set ASM_FLG=%AFLG% -cpu:%CPU% -NOdebug
77-
call buildstdlib.bat crtS.lib
78-
79-
set C_SRC=%RTL_NOKERNEL_C_SRC%
80-
set ASM_SRC=
81-
set C_FLG=%CFLG_REL% -cpu:%CPU% -asmsw:"-cpu:%CPU% -include:%STDINC% -include:%ZLGINC%" -define:_%CPU%
82-
set ASM_FLG=%AFLG% -cpu:%CPU% -NOdebug
83-
call buildstdlib.bat nokernel.lib
84-
85-
echo --Building CHLP libraries...
73+
echo -- Building CHLP libraries...
74+
set MY_PATH=%SHARED_PATH%
8675
set C_SRC=%HLP_C_SRC%
8776
set ASM_SRC=%HLP_ASM_SRC%
88-
set C_FLG=%CFLG_REL% -cpu:%CPU% -asmsw:"-cpu:%CPU% -include:%STDINC% -include:%ZLGINC%"
89-
set ASM_FLG=%AFLG% -cpu:%CPU% -NOdebug
90-
call buildstdlib.bat chelp.lib
77+
call buildlib.bat chelp.lib
9178

92-
echo --Building FPLIB libraries...
93-
set C_SRC=%FP_C_SRC%
94-
set ASM_SRC=%FP_ASM_SRC%
95-
set C_FLG=%CFLG_REL% -cpu:%CPU% -asmsw:"-cpu:%CPU% -include:%STDINC% -include:%ZLGINC%"
96-
set ASM_FLG=%AFLG% -cpu:%CPU% -NOdebug
97-
call buildstdlib.bat fplib.lib
79+
echo -- Building RTL...
80+
set MY_PATH=%SHARED_PATH%
81+
set C_SRC=%RTL_SHARED_C_SRC%
82+
set ASM_SRC=%RTL_SHARED_ASM_SRC%
83+
call buildlib.bat crt.lib
9884

99-
set C_SRC=%FP_ST_C_SRC%
100-
set ASM_SRC=
101-
set C_FLG=%CFLG_REL% -cpu:%CPU% -asmsw:"-cpu:%CPU% -include:%STDINC% -include:%ZLGINC%"
102-
set ASM_FLG=%AFLG% -cpu:%CPU% -NOdebug
103-
call buildstdlib.bat fplibS.lib
85+
echo -- Building RT Linked Library Portion...
86+
set MY_PATH=%LINKED_PATH%
87+
set C_SRC=%RTL_LINKED_C_SRC%
88+
set ASM_SRC=%RTL_LINKED_ASM_SRC%
89+
call buildlib.bat crt_linked.lib
90+
91+
echo -- Building RT Static Library Portion...
92+
set MY_PATH=%STATIC_PATH%
93+
set C_SRC=%RTL_STATIC_C_SRC%
94+
set ASM_SRC=%RTL_STATIC_ASM_SRC%
95+
call buildlib.bat crt_static.lib
96+
97+
echo -- Copying the libraries...
10498

105-
echo --Copying the libraries...
10699
REM -- copy the libraries --
107100
copy /Y *.lib %LIBPATH%\std
108101
move /Y %LIBPATH%\std\ctice.lib %LIBPATH%\std\ce\ctice.lib

CEdev/lib/src/buildcelib.bat renamed to CEdev/lib/src/buildlib.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ if exist %1 del %1
66

77
set ALL_SRC=%C_SRC% %ASM_SRC%
88

9-
for %%i in (%C_SRC%) do %CC% %C_FLG% -stdinc:"%STDINC%;%ZLGINC%" "%cd%\ce\%%i"
9+
for %%i in (%C_SRC%) do %CC% %C_FLG% -stdinc:"%STDINC%;%ZLGINC%" "%cd%\%MY_PATH%\%%i"
1010

11-
for %%i in (%ASM_SRC%) do %ASM% %ASM_FLG% ce\%%i
11+
for %%i in (%ASM_SRC%) do %ASM% %ASM_FLG% %MY_PATH%\%%i
1212

1313
for %%i in (%ALL_SRC%) do %LIB% -quiet -warn %1=+%%~ni.obj

CEdev/lib/src/buildstdlib.bat

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)