Skip to content

Commit

Permalink
Merge pull request #21 from ivop/master
Browse files Browse the repository at this point in the history
Atari 800 XL/XE Port
  • Loading branch information
davidgiven authored May 17, 2023
2 parents b4128e2 + d0dee65 commit 7ef574d
Show file tree
Hide file tree
Showing 14 changed files with 1,630 additions and 3 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*~
.obj
apple2e.po
atari800.atr
atari800hd.atr
bbcmicro.ssd
bin
c64.d64
pet.d64
vic20.d64
x16.zip
58 changes: 56 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,33 @@ APPS = \
$(OBJDIR)/asm.com \
$(OBJDIR)/apps/bedit.com \
$(OBJDIR)/apps/dump.com \
$(OBJDIR)/apps/dinfo.com \
$(OBJDIR)/apps/cls.com \
$(OBJDIR)/apps/ls.com \
$(OBJDIR)/apps/capsdrv.com \
apps/bedit.asm \
apps/dump.asm \
apps/dinfo.asm \
apps/cls.asm \
apps/ls.asm \
cpmfs/asm.txt \
cpmfs/bedit.txt \
cpmfs/demo.sub \
cpmfs/hello.asm \

MINIMAL_APPS = \
$(OBJDIR)/submit.com \
$(OBJDIR)/stat.com \
$(OBJDIR)/copy.com \
$(OBJDIR)/asm.com \
$(OBJDIR)/apps/bedit.com \
$(OBJDIR)/apps/dump.com \
$(OBJDIR)/apps/dinfo.com \
$(OBJDIR)/apps/cls.com \
$(OBJDIR)/apps/ls.com \
$(OBJDIR)/apps/capsdrv.com \
apps/dump.asm \

LIBCPM_OBJS = \
$(OBJDIR)/lib/printi.o \
$(OBJDIR)/lib/bdos.o \
Expand All @@ -41,7 +60,7 @@ CPMEMU_OBJS = \
$(OBJDIR)/tools/cpmemu/biosbdos.o \
$(OBJDIR)/third_party/lib6502/lib6502.o \

all: apple2e.po c64.d64 bbcmicro.ssd x16.zip pet.d64 vic20.d64 bin/cpmemu
all: apple2e.po c64.d64 bbcmicro.ssd x16.zip pet.d64 vic20.d64 bin/cpmemu atari800.atr atari800hd.atr

$(OBJDIR)/multilink: $(OBJDIR)/tools/multilink.o
@mkdir -p $(dir $@)
Expand Down Expand Up @@ -220,8 +239,43 @@ vic20.d64: $(OBJDIR)/vic20.exe $(OBJDIR)/bdos.img Makefile $(APPS) \
cpmcp -f c1541 $@ $(OBJDIR)/ccp.sys $(APPS) 0:
cpmchattr -f c1541 $@ s 0:cbmfs.sys 0:ccp.sys

# Atari targets call /usr/bin/printf directly because 'make' calls /bin/sh
# which might be the Defective Annoying SHell which has a broken printf
# implementation.

$(OBJDIR)/src/bios/atari800.o: CFLAGS65 += -DATARI_SD
$(OBJDIR)/atari800.exe:
atari800.atr: $(OBJDIR)/atari800.exe $(OBJDIR)/bdos.img Makefile \
$(MINIMAL_APPS) $(OBJDIR)/ccp.sys
dd if=/dev/zero of=$@ bs=128 count=720
mkfs.cpm -f atari90 $@
cpmcp -f atari90 $@ $(OBJDIR)/ccp.sys $(MINIMAL_APPS) 0:
cpmchattr -f atari90 $@ s 0:ccp.sys
dd if=$(OBJDIR)/atari800.exe of=$@ bs=128 conv=notrunc
dd if=$(OBJDIR)/bdos.img of=$@ bs=128 seek=8 conv=notrunc
mv $@ $@.raw
/usr/bin/printf '\x96\x02\x80\x16\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' > $@
cat $@.raw >> $@
rm $@.raw

$(OBJDIR)/src/bios/atari800hd.o: CFLAGS65 += -DATARI_HD
$(OBJDIR)/atari800hd.exe:
atari800hd.atr: $(OBJDIR)/atari800hd.exe $(OBJDIR)/bdos.img Makefile \
$(APPS) $(OBJDIR)/ccp.sys
dd if=/dev/zero of=$@ bs=128 count=8190
mkfs.cpm -f atarihd $@
cpmcp -f atarihd $@ $(OBJDIR)/ccp.sys $(APPS) 0:
cpmchattr -f atarihd $@ s 0:ccp.sys
dd if=$(OBJDIR)/atari800hd.exe of=$@ bs=128 conv=notrunc
dd if=$(OBJDIR)/bdos.img of=$@ bs=128 seek=10 conv=notrunc
mv $@ $@.raw
/usr/bin/printf '\x96\x02\xf0\xff\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' > $@
cat $@.raw >> $@
rm $@.raw


clean:
rm -rf $(OBJDIR) bin apple2e.po c64.d64 bbcmicro.ssd x16.zip pet.d64 vic20.d64
rm -rf $(OBJDIR) bin apple2e.po c64.d64 bbcmicro.ssd x16.zip pet.d64 vic20.d64 atari800.atr atari800hd.atr

.DELETE_ON_ERROR:
.SECONDARY:
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ No, it won't let you run 8080 programs on the 6502!
<a href="doc/apple2e.png"><img src="doc/apple2e.png" style="width:40%" alt="CP/M-65 running on an Apple IIe"></a>
<a href="doc/pet4032.png"><img src="doc/pet4032.png" style="width:40%" alt="CP/M-65 running on a Commodore PET 4032"></a>
<a href="doc/vic20.png"><img src="doc/vic20.png" style="width:40%" alt="CP/M-65 running on a Commodore VIC-20"></a>
<a href="doc/atari800.png"><img src="doc/atari800.png" style="width:40%" alt="CP/M-65 running on an Atari 800XL"></a>
</div>


Expand Down Expand Up @@ -149,6 +150,21 @@ drive) and BBC Micro (producing a 200kB SSSD DFS disk).

- This port runs completely bare-metal and does not use any ROM routines.

### Atari 800 XL/XE notes

- Standard 720 sectors single-sided single-density disk. The first three
tracks are reserved (54 sectors). The rest contains a standard CP/M 2.2
filesystem. Boot with BASIC disabled.

- Uses the Atari OS boot loader to load both BIOS and BDOS to avoid needing
Atari DOS 2.0 DOS.SYS which would consumes precious memory and is useless
afterwards. CCP.SYS is loaded from the CP/M filesystem.

- Console is standard 40x24 and it uses the Atari OS routines to read the
keyboard and write to the screen.

- There are 41728 bytes of TPA memory.

### Supported programs

You don't get a lot right now. As transients, you get `DUMP`, `STAT`, `COPY`,
Expand Down
8 changes: 8 additions & 0 deletions apps/cls.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
\ cls - clear screen
BDOS_CONOUT = 2
BDOS = start-3
start:
ldy #BDOS_CONOUT
lda #26
jmp BDOS

Loading

0 comments on commit 7ef574d

Please sign in to comment.