Skip to content

Commit 5066584

Browse files
author
Andrew Owen
committed
Update repository to version 4.1.0 beta
1 parent fb280e6 commit 5066584

Some content is hidden

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

44 files changed

+20313
-12048
lines changed

Makefile

100755100644
Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
rom=1
21
TARGET=se-$(rom).rom
32

43
# Point to z80-binutils installation (if required)
@@ -11,36 +10,48 @@ SUBDIRS=
1110

1211
# Linker script (config)
1312
#
14-
LDSCRIPT=sebasic.ld
13+
LDSCRIPT=sebasic4.ld
1514

1615
# Library, link and include directories
1716
#
1817
LIB_DIRS =
1918
LINK_LIBS =
20-
INC_DIRS = data
19+
INC_DIRS = data modules
2120

2221
# COFF sections to output into target
2322
#
2423
OUTSECTIONS= .text
2524

2625
# Parameter files that get processed first
2726
#
28-
PARAMFILES= sebasic.def
27+
PARAMFILES= sebasic4.def
2928

3029
# Define file ending for src files (defaults to z8s)
3130
#
3231
SRC_EXT=asm
3332

3433
# Source files
3534
Z80_ASM = \
36-
sebasic.asm
35+
sebasic4.asm
3736

37+
all: rom0 rom1
3838

39-
# Local Makefile Targets
40-
#
41-
all: dirs $(TARGET) map
39+
rom0: dirs clean $(Z80_ASM)
40+
@make build rom=0
41+
42+
rom1: dirs clean $(Z80_ASM)
43+
@make build rom=1
44+
45+
announce:
46+
@echo "Info: Building SE Basic IV ROM $(rom) : $(TARGET)"
47+
48+
build: dirs announce $(TARGET) map
49+
@cp $(TARGET) bin/
4250
@echo "Done."
51+
@echo ""
4352

53+
# Local Makefile Targets
54+
#
4455
fresh: clean all
4556

4657
dirs :
@@ -58,7 +69,7 @@ map :
5869
echo "End Addr is " $$E; \
5970
)
6071

61-
dump: sebasic.coff
72+
dump: sebasic4.coff
6273
$(OBJDUMP) -s $?
6374

6475
#include $(CROSSASM)/z80/Makefile_Z80

Makefile_Z80

100755100644
Lines changed: 115 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,115 @@
1-
#.SILENT:
2-
# These shouldn't need to be changed
3-
#
4-
#
5-
ifneq ($(strip $(CROSSASM)),)
6-
export Z80BASE=$(CROSSASM)/z80/tools/bin/
7-
endif
8-
9-
export AS=$(Z80BASE)z80-unknown-coff-as
10-
export AR=$(Z80BASE)z80-unknown-coff-ar
11-
export LD=$(Z80BASE)z80-unknown-coff-ld
12-
export OBJCOPY=$(Z80BASE)z80-unknown-coff-objcopy
13-
export OBJDUMP=$(Z80BASE)z80-unknown-coff-objdump
14-
15-
export ASFLAGS += --defsym ROM$(rom)=1 -z80 -ignore-undocumented-instructions -warn-unportable-instructions
16-
# --oformat forces coff output, as small single file programs seem to generate binary output directly, which is not what we want
17-
export LDFLAGS = --trace --oformat coff-z80
18-
19-
ifneq ($(strip $(LDSCRIPT)),)
20-
LDFLAGS += -T $(LDSCRIPT)
21-
endif
22-
ifneq ($(strip $(OUTSECTIONS)),)
23-
COPYSECTIONS = $(addprefix -j,$(OUTSECTIONS))
24-
endif
25-
26-
export ROOT=$(shell pwd)
27-
28-
# Define the extension for src files
29-
ifneq ($(strip $(SRC_EXT)),)
30-
SRCEXT = $(SRC_EXT)
31-
else
32-
SRCEXT = z80
33-
endif
34-
35-
BIN=rom
36-
OBJ=obj
37-
LST=lst
38-
39-
COFF=$(TARGET:%.rom=%.coff)
40-
41-
OBJF = $(Z80_ASM:%.$(SRCEXT)=%.o)
42-
OBJFILES = $(addprefix $(OBJ)/,$(OBJF))
43-
LDLIBS = $(addprefix -l,$(LINK_LIBS))
44-
LDLIBSDIR= $(addprefix -L,$(LIB_DIRS))
45-
INCDIRS = $(addprefix -I,$(INC_DIRS))
46-
47-
ASFLAGS += $(INCDIRS)
48-
49-
$(TARGET) : bdirs binary
50-
$(LIBRARY): bdirs library
51-
52-
# Build target.coff from target.rom through objcopy
53-
binary: $(COFF)
54-
@echo Info: Extract sections $(OUTSECTIONS) "-->" $(TARGET)
55-
@$(OBJCOPY) -v $(OBJCOPYFLAGS) $(COPYSECTIONS) -O binary $< $(TARGET)
56-
@chmod +x $(TARGET)
57-
@echo
58-
59-
libf:
60-
@echo $(OBJFILES)
61-
62-
# Produce library archive from OBJFILES
63-
library: $(OBJFILES)
64-
@echo Info: Creating library $@
65-
@rm -f $(LIBRARY)
66-
@$(AR) -rsv $(LIBRARY) $(OBJFILES)
67-
@echo
68-
69-
# Assemble .z8s into .o
70-
$(OBJ)/%.o: %.$(SRCEXT)
71-
@echo "Info: Assemble" $@ "<--" $<
72-
@$(AS) $(ASFLAGS) -al=$(LST)/$(<:%.$(SRCEXT)=%.lst) -o$@ $(PARAMFILES) $<
73-
74-
# Produce .coff by assembling Z80_ASM into a single .o and then linking with
75-
# libraries
76-
%.coff : $(Z80_ASM)
77-
@echo "info: Assemble" $(@:%.coff=%.o) "<--" $?
78-
$(AS) $(ASFLAGS) -al=$(LST)/$(@:%.coff=%.lst) -o$(OBJ)/$(@:%.coff=%.o) $(PARAMFILES) $?
79-
@echo
80-
@echo "Info: Link " $(@:%.coff=%.o) "-->" $@
81-
$(LD) $(LDFLAGS) -Map=$(LST)/$(@:%.coff=%.map) -o$@ $(OBJ)/$(@:%.coff=%.o) $(LDLIBSDIR) $(LDLIBS)
82-
@echo
83-
@echo Info: Create object dump $(@:%.coff=%.dump)
84-
@$(OBJDUMP) -d -S $(COPYSECTIONS) $@ > $(LST)/$(@:%.coff=%.dump)
85-
86-
# Link .coff from individual .o files
87-
%.coff_needs_globl : $(OBJFILES)
88-
@echo "Info: Link " $? "-->" $@
89-
$(LD) $(LDFLAGS) -Map=$(LST)/$(@:%.coff=%.map) -o$@ $? $(LDLIBSDIR) $(LDLIBS)
90-
@echo
91-
@echo Info: Create object dump $(@:%.coff=%.dump)
92-
@$(OBJDUMP) -d -S $(COPYSECTIONS) $@ > $(LST)/$(@:%.coff=%.dump)
93-
94-
95-
# Utility targets
96-
#
97-
bdirs:
98-
@#[ -d $(BIN) ] || mkdir $(BIN)
99-
@[ -d $(OBJ) ] || mkdir $(OBJ)
100-
@[ -d $(LST) ] || mkdir $(LST)
101-
102-
.PHONY: tags
103-
tags :
104-
@rm -f ctags
105-
find . -name \*.c -exec ctags -a {} \;
106-
find . -name \*.h -exec ctags -a {} \;
107-
108-
.PHONEY: gclean
109-
gclean :
110-
find . -name \*.o -exec rm -f {} \;
111-
find . -name \*.o._x -exec rm -f {} \;
112-
find . -name .depend -exec rm -f {} \;
113-
rm -f $(LST)/*.map $(LST)/*.lst *.coff *.rom $(LST)/*.dump
114-
rmdir $(LST)
115-
rmdir $(OBJ)
116-
117-
clean: gclean
1+
#.SILENT:
2+
# These shouldn't need to be changed
3+
#
4+
#
5+
ifneq ($(strip $(CROSSASM)),)
6+
export Z80BASE=$(CROSSASM)/z80/tools/bin/
7+
endif
8+
9+
export AS=$(Z80BASE)z80-unknown-coff-as
10+
export AR=$(Z80BASE)z80-unknown-coff-ar
11+
export LD=$(Z80BASE)z80-unknown-coff-ld
12+
export OBJCOPY=$(Z80BASE)z80-unknown-coff-objcopy
13+
export OBJDUMP=$(Z80BASE)z80-unknown-coff-objdump
14+
15+
export ASFLAGS += --defsym ROM$(rom)=1 -z80 -ignore-undocumented-instructions -warn-unportable-instructions
16+
# --oformat forces coff output, as small single file programs seem to generate binary output directly, which is not what we want
17+
export LDFLAGS = --trace --oformat coff-z80
18+
19+
ifneq ($(strip $(LDSCRIPT)),)
20+
LDFLAGS += -T $(LDSCRIPT)
21+
endif
22+
ifneq ($(strip $(OUTSECTIONS)),)
23+
COPYSECTIONS = $(addprefix -j,$(OUTSECTIONS))
24+
endif
25+
26+
export ROOT=$(shell pwd)
27+
28+
# Define the extension for src files
29+
ifneq ($(strip $(SRC_EXT)),)
30+
SRCEXT = $(SRC_EXT)
31+
else
32+
SRCEXT = z80
33+
endif
34+
35+
BIN=rom
36+
OBJ=obj
37+
LST=lst
38+
39+
COFF=$(TARGET:%.rom=%.coff)
40+
41+
OBJF = $(Z80_ASM:%.$(SRCEXT)=%.o)
42+
OBJFILES = $(addprefix $(OBJ)/,$(OBJF))
43+
LDLIBS = $(addprefix -l,$(LINK_LIBS))
44+
LDLIBSDIR= $(addprefix -L,$(LIB_DIRS))
45+
INCDIRS = $(addprefix -I,$(INC_DIRS))
46+
47+
ASFLAGS += $(INCDIRS)
48+
49+
$(TARGET) : bdirs binary
50+
$(LIBRARY): bdirs library
51+
52+
# Build target.coff from target.rom through objcopy
53+
binary: $(COFF)
54+
@echo Info: Extract sections $(OUTSECTIONS) "-->" $(TARGET)
55+
@$(OBJCOPY) -v $(OBJCOPYFLAGS) $(COPYSECTIONS) -O binary $< $(TARGET)
56+
@chmod +x $(TARGET)
57+
@echo
58+
59+
libf:
60+
@echo $(OBJFILES)
61+
62+
# Produce library archive from OBJFILES
63+
library: $(OBJFILES)
64+
@echo Info: Creating library $@
65+
@rm -f $(LIBRARY)
66+
@$(AR) -rsv $(LIBRARY) $(OBJFILES)
67+
@echo
68+
69+
# Assemble .z8s into .o
70+
#$(OBJ)/%.o: %.$(SRCEXT)
71+
# @echo "Info: X Assemble" $@ "<--" $<
72+
# @$(AS) $(ASFLAGS) -al=$(LST)/$(<:%.$(SRCEXT)=%.lst) -o$@ $(PARAMFILES) $<
73+
74+
# Produce .coff by assembling Z80_ASM into a single .o and then linking with
75+
# libraries
76+
%.coff : $(Z80_ASM)
77+
@echo "info: Assemble" $(@:%.coff=%.o) "<--" $?
78+
$(AS) $(ASFLAGS) -al=$(LST)/$(@:%.coff=%.lst) -o$(OBJ)/$(@:%.coff=%.o) $(PARAMFILES) $?
79+
@echo
80+
@echo "Info: Link " $(@:%.coff=%.o) "-->" $@
81+
$(LD) $(LDFLAGS) -Map=$(LST)/$(@:%.coff=%.map) -o$@ $(OBJ)/$(@:%.coff=%.o) $(LDLIBSDIR) $(LDLIBS)
82+
@echo
83+
@echo Info: Create object dump $(@:%.coff=%.dump)
84+
@$(OBJDUMP) -d -S $(COPYSECTIONS) $@ > $(LST)/$(@:%.coff=%.dump)
85+
86+
# Link .coff from individual .o files
87+
%.coff_needs_globl : $(OBJFILES)
88+
@echo "Info: Link " $? "-->" $@
89+
$(LD) $(LDFLAGS) -Map=$(LST)/$(@:%.coff=%.map) -o$@ $? $(LDLIBSDIR) $(LDLIBS)
90+
@echo
91+
@echo Info: Create object dump $(@:%.coff=%.dump)
92+
@$(OBJDUMP) -d -S $(COPYSECTIONS) $@ > $(LST)/$(@:%.coff=%.dump)
93+
94+
95+
# Utility targets
96+
#
97+
bdirs:
98+
@#[ -d $(BIN) ] || mkdir $(BIN)
99+
@[ -d $(OBJ) ] || mkdir $(OBJ)
100+
@[ -d $(LST) ] || mkdir $(LST)
101+
102+
.PHONY: tags
103+
tags :
104+
@rm -f ctags
105+
find . -name \*.c -exec ctags -a {} \;
106+
find . -name \*.h -exec ctags -a {} \;
107+
108+
.PHONEY: gclean
109+
gclean :
110+
find . -name \*.o -exec rm -f {} \;
111+
find . -name \*.o._x -exec rm -f {} \;
112+
find . -name .depend -exec rm -f {} \;
113+
rm -f $(LST)/*.map $(LST)/*.lst *.coff *.rom $(LST)/*.dump;
114+
115+
clean: gclean

bin/loader.tap

219 Bytes
Binary file not shown.

bin/se-0.rom

0 Bytes
Binary file not shown.

bin/se-1.rom

0 Bytes
Binary file not shown.

bin/se-1.tap

16.2 KB
Binary file not shown.

build.sh

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

build_p3.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
rm ./bin/*.rom
2+
rm ./bin/se-1.tap
3+
make rom=0
4+
cp se-0.rom ./bin/
5+
make clean
6+
make rom=1
7+
cp se-1.rom ./bin/
8+
make clean
9+
cd bin
10+
bin2tap se-1.rom rom.tap 32768
11+
cat loader.tap rom.tap > se-1.tap
12+
rm rom.tap
13+
cd ..

code_pages/512.bin

1 KB
Binary file not shown.

code_pages/512.tap

1.02 KB
Binary file not shown.

0 commit comments

Comments
 (0)