Initial commit

This commit is contained in:
david-schmidt 2020-06-04 11:32:14 -04:00
commit b1748ae0a9
9 changed files with 8454 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.project

41
README.md Normal file
View File

@ -0,0 +1,41 @@
# tlc-apple2
Some bits and bobs regarding the Tiger Learning Computer.
The TLC was a "toy" computer that had an Apple IIe at its core.
There was a UI that would come up by default that was an early,
proprietary windowing system that was little more than a program launcher.
The TLC can be booted and you can get into Applesoft BASIC without any problem.
The problem is that I/O is pretty difficult. No one with one of these
machines has come forward with the ability to get anything into or out of the
existing serial port.
The goal: get the ROM data of the TLC out of the machine. Hard to do with funcitonal I/O.
### Audio to the rescue
One thing the TLC _does_ have is sound. And a headphone jack. So we have... output.
#### A long time ago...
In the dark ages, when dinosaurs roamed the Earth, there was cassette tape.
As an analog-digital storage medium. It was slow, crappy, error-prone, and all
that - but it at least worked.
Early Apple II specimens came with this audio interface built-in - the original Apple ][,
all the way through to the last Apple IIe.
But the audio jacks and attendant ROM code was missing from the IIgs, the IIc, and the IIc+.
And the TLC.
#### Steal all teh cassette ROM
Handily enough, the early ROM code is quite tidy and compact; this is before the days of the crazy
gymnastics of the IIe and beyond that moved Heaven and Earth to keep the entry points constant
(because programmers are bad, and used them literally). The angle of attack:
* Copy out just enough Apple II ROM code to do the moral equivalent of the monitor's save memory to tape command (i.e. `*300.400W`)
* Change cassette output (`$C020`) to speaker output (`$C030`)
* Assemble and get a raw hex dump of that code
* Type that code into the TLC's RAM and run it, dumping all non-banked ROM (`$C100-$FFFF`)
* Capture the audio on a modern computer
* Run that audio through CiderPress, which knows how to take tape audio and reconstruct data from it
* Profit
The source code to do these activities is in the `src` directory, and the resulting ROM from the Tiger Learning computer is in the `rom` directory.

Binary file not shown.

BIN
rom/C100-FFFF.bin Normal file

Binary file not shown.

8307
rom/C100-FFFF.lst Normal file

File diff suppressed because it is too large Load Diff

2
src/make.bat Normal file
View File

@ -0,0 +1,2 @@
ca65 tapeout.asm -l tapeout.lst
ld65 tapeout.o -o tapeout.bin -C tapeout.cfg

73
src/tapeout.asm Normal file
View File

@ -0,0 +1,73 @@
; da65 V2.13.9 - (C) Copyright 2000-2009, Ullrich von Bassewitz
; Created: 2020-06-04 02:08:05
.setcpu "6502"
.org $0300
lda #$00
ldy #$03
sta $3c
sty $3d
lda #$00
ldy #$04
sta $3e
sty $3f
jsr WRITE
rts
LFCBA: lda $3C
cmp $3E
lda $3D
sbc $3F
inc $3C
bne LFCC8
inc $3D
LFCC8: rts
LEADER:
LFCC9: ldy #$4B
jsr LFCDB
bne LFCC9
adc #$FE
bcs LFCC9
ldy #$21
LFCD6: jsr LFCDB
iny
iny
LFCDB: dey
bne LFCDB
bcc LFCE5
ldy #$32
LFCE2: dey
bne LFCE2
LFCE5: ldy $C030
ldy #$2C
dex
rts
WRITE:
lda #$40
jsr LFCC9
ldy #$27
LFED4: ldx #$00
eor ($3C,x)
pha
lda ($3C,x)
jsr LFEED
jsr LFCBA
ldy #$1D
pla
bcc LFED4
ldy #$22
jsr LFEED
beq LFF3A
LFEED: ldx #$10
LFEEF: asl a
jsr LFCD6
bne LFEEF
rts
LFF3A: lda #$DA
jmp $FDED

9
src/tapeout.cfg Normal file
View File

@ -0,0 +1,9 @@
MEMORY {
RAM: start = $0300, size = $6500, define = yes, file = %O;
}
SEGMENTS {
CODE: load = RAM, type = ro;
RODATA: load = RAM, type = ro;
BSS: load = RAM, type = bss;
}

21
src/tapeout.txt Normal file
View File

@ -0,0 +1,21 @@
This is the part you get to type in by hand if you
have no other way to communicate to a machine.
Begin and end addresses are two-byte LSB/MSB pointers
in $3c/$3d and $3e/$3f; they are loaded for you from
$301/$303 and $309/$30b if you just want to call
the entry point at $300. Otherwise, fill them in
directly and call the WRITE entry point at $346.
When the sound output is complete, a "Z" will be
printed and you'll be back at the prompt. (The
original monitor code would print a Ctrl-G (beep),
which is not desirable now.)
300:A9 00 A0 03 85 3C 84 3D A9 00 A0 04 85 3E 84 3F
310:20 46 03 60 A5 3C C5 3E A5 3D E5 3F E6 3C D0 02
320:E6 3D 60 A0 4B 20 35 03 D0 F9 69 FE B0 F5 A0 21
330:20 35 03 C8 C8 88 D0 FD 90 05 A0 32 88 D0 FD AC
340:30 C0 A0 2C CA 60 A9 40 20 23 03 A0 27 A2 00 41
350:3C 48 A1 3C 20 66 03 20 14 03 A0 1D 68 90 EE A0
360:22 20 66 03 F0 09 A2 10 0A 20 30 03 D0 FA 60 A9
370:DA 4C ED FD