Skip to content

Commit

Permalink
The emulator builds; sdcc C programs now build correctly, and run in the
Browse files Browse the repository at this point in the history
emulator; add a simple copy program.
  • Loading branch information
davidgiven committed Jun 8, 2019
1 parent b8cfeb2 commit 12b49c9
Show file tree
Hide file tree
Showing 12 changed files with 520 additions and 9 deletions.
3 changes: 3 additions & 0 deletions build.lua
@@ -1,4 +1,5 @@
vars.cflags = { "-g", "-Og" }
vars.ldflags = { "-lm" }
vars.cpmcflags = { "--opt-code-size" }
vars.cpmldflags = {}

Expand All @@ -10,6 +11,7 @@ diskimage {
["dump.com"] = "cpmtools+dump",
["stat.com"] = "cpmtools+stat",
["asm.com"] = "cpmtools+asm",
["copy.com"] = "cpmtools+copy",

-- These binary tools are here temporarily and need to be removed ---
-- we have no license for them.
Expand Down Expand Up @@ -44,6 +46,7 @@ diskimage {
installable {
name = "all",
map = {
["emu"] = "utils/emu+emu",
["nc200.img"] = "+nc200-img",
-- ["osborne1.img"] = "+osborne1-img"
}
Expand Down
2 changes: 1 addition & 1 deletion build/build.lua
Expand Up @@ -225,7 +225,7 @@ definerule("cprogram",
commands = {
type="strings",
default={
"$(CC) -o %{outs[1]} %{ins} %{ins} -lm"
"$(CC) -o %{outs[1]} %{ins} %{ins} %{ldflags}"
},
}
},
Expand Down
5 changes: 4 additions & 1 deletion build/cpm.lua
Expand Up @@ -66,11 +66,13 @@ definerule("sdccprogram",
deps = { type="targets", default={} },
},
function (e)
local crt = "cpmtools+cpmcrt"

return cprogram {
name = e.name,
srcs = e.srcs,
deps = {
"cpmtools/libcpm+cpmcrt",
crt,
"cpmtools/libcpm+libcpm",
e.deps,
},
Expand All @@ -82,6 +84,7 @@ definerule("sdccprogram",
.. "-k /usr/share/sdcc/lib/z80 "
.. "-l z80 "
.. "-m "
.. filenamesof(crt)[1] .. " "
.. "%{ins} ",
"makebin -p %{outs}.ihx - | dd status=none of=%{outs} bs=128 skip=2"
}
Expand Down
10 changes: 10 additions & 0 deletions cpmtools/build.lua
@@ -1,3 +1,8 @@
sdccfile {
name = "cpmcrt",
srcs = {"./cpmcrt.s"}
}

sdccprogram {
name = "dump",
srcs = { "./dump.c" },
Expand All @@ -12,3 +17,8 @@ sdccprogram {
name = "asm",
srcs = { "./asm.c" },
}

sdccprogram {
name = "copy",
srcs = { "./copy.c" },
}

0 comments on commit 12b49c9

Please sign in to comment.