Compare commits

...

3 Commits

Author SHA1 Message Date
flowenol 146e94aa6a additional mapping starting at C600 2023-03-29 01:50:49 +02:00
flowenol 21cddcb618 add make targets to burn ROM & GAL 2023-03-29 01:50:49 +02:00
flowenol 6b3f439e94 added BASE and OFFSET defs, additional mapping starting at C300 2023-03-29 01:50:49 +02:00
14 changed files with 333 additions and 32 deletions

View File

@ -8,10 +8,35 @@ $(SUBDIRS):
.PHONY: $(TOPTARGETS) $(SUBDIRS)
apple1serial.bin:
xa -W -C -v -O ASCII -c src/apple1serial.a65 -l apple1serial.label -o apple1serial.bin
apple1serial-C000.bin:
xa -DOFFSET="0" -W -C -v -O ASCII -c src/apple1serial.a65 -l apple1serial-C000.label -o apple1serial-C000.bin
all: apple1serial.bin
apple1serial-C300.bin:
xa -DOFFSET="768" -W -C -v -O ASCII -c src/apple1serial.a65 -l apple1serial-C300.label -o apple1serial-C300.bin
apple1serial-C600.bin:
xa -DOFFSET="1536" -W -C -v -O ASCII -c src/apple1serial.a65 -l apple1serial-C600.label -o apple1serial-C600.bin
all: apple1serial-C000.bin apple1serial-C300.bin apple1serial-C600.bin
clean:
rm apple1serial.bin apple1serial.label
rm -f apple1serial*.bin apple1serial*.label
burn-C000-gal:
minipro -p GAL20V8B -w mapping/address_decoder-C000.jed
burn-C000-rom: apple1serial-C000.bin
minipro -s -p 28C64B -w apple1serial-C000.bin
burn-C300-gal:
minipro -p GAL20V8B -w mapping/address_decoder-C300.jed
burn-C300-rom: apple1serial-C300.bin
minipro -s -p 28C64B -w apple1serial-C300.bin
burn-C600-gal:
minipro -p GAL20V8B -w mapping/address_decoder-C600.jed
burn-C600-rom: apple1serial-C600.bin
minipro -s -p 28C64B -w apple1serial-C600.bin

View File

@ -57,16 +57,42 @@ The contents of this repository are as following:
* src/ - contains the 6502 assembly sources for the A1SI onboard ROM routines
* scripts/ - contains python based file transfer utility
## Mappings
There are two .jed files for the GAL20V8 based address decoder:
1. **address_decoder-C000.jed** - defines the standard mapping where the device mimics the original ACI loader program at `$C100`.
2. **address_decoder-C300.jed** - defines an alternative mapping to run Apple-1 Serial Interface together with the original ACI within the same system.
All program and hardware entries are shifted by offset `$300`, so the loader program can be accessed at `$C400`.
2. **address_decoder-C600.jed** - defines an alternative mapping to run Apple-1 Serial Interface together with both the original and Improved ACI 2.0 (by Uncle Bernie) within the same system.
All program and hardware entries are shifted by offset `$600`, so the loader program can be accessed at `$C700`.
Please be sure to program the ROM with the bin image corresponding to the selected mapping.
You can use the convenient `make` targets to burn ROM and GAL, if you have the `minipro` utility installed:
```bash
make burn-C000-gal
make burn-C000-rom
make burn-C300-gal
make burn-C300-rom
make burn-C600-gal
make burn-C600-rom
```
## Requirements
You need the following to successfully build the firmware:
* [xa](https://www.floodgap.com/retrotech/xa/) cross assembler
* [avr-gcc](https://gcc.gnu.org/wiki/avr-gcc) toolchain
* [avr-libc](https://www.nongnu.org/avr-libc/) set of libraries
* [AVRDUDE](https://www.nongnu.org/avrdude/) AVR programmer software or equivalent to program the ATMega328P MCU
* [xa](https://www.floodgap.com/retrotech/xa/) cross assembler.
* [avr-gcc](https://gcc.gnu.org/wiki/avr-gcc) toolchain.
* [avr-libc](https://www.nongnu.org/avr-libc/) set of libraries.
* [AVRDUDE](https://www.nongnu.org/avrdude/) AVR programmer software or equivalent to program the ATMega328P MCU.
* Software capable of translating the .eqn files into .jed's. I used for this purpose the DOS based EQN2JED from OPALjr PLD Development Package. This is only required if you wish to make some changes to the GAL based address decoder. The default .jed file should be fine for most users.
* EEPROM programmer to write ROM and GAL. I used [TL866](http://autoelectric.cn/EN/TL866_main.html) programmer for this purpose. It can also program the ATMega328P MCU.
* You can use the [minipro](https://gitlab.com/DavidGriffith/minipro/) utility to write ROM, GAL and MCU.
## How to build?

View File

@ -0,0 +1,15 @@
chip GAL20V8
NC3=1 RW=2 A0=11 A1=10 A2=9 A3=8 A4=7 A5=6 A6=5 A7=4 A8=3 GND=12
A9=16 A10=15 A11=14 SR=17 RD=18 WD=19 ROM=20 RES=21 PHI=22
T=23 VCC=24
equations
SR = /A0 * /A1 * /A2 * /A3 * /A4 * /A5 * /A6 * /A7 * A8 * A9 * /A10 * /A11 * /T * RW
RD = /A0 * /A1 * /A2 * /A3 * /A4 * /A5 * /A6 * A7 * A8 * A9 * /A10 * /A11 * /T * RW
WD = A0 * /A1 * /A2 * /A3 * /A4 * /A5 * /A6 * A7 * A8 * A9 * /A10 * /A11 * /T * /RW * PHI
/ROM = /A11 * A10 * /T * RW
+ A11 * /A10 * /T * RW
+ A2 * A3 * A4 * A5 * A6 * A7 * A8 * A9 * /A10 * /A11 * /T * RW
RES = A0 * /A1 * /A2 * /A3 * /A4 * /A5 * /A6 * /A7 * A8 * A9 * /A10 * /A11 * /T * RW

View File

@ -0,0 +1,33 @@

GAL20V8
EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
Copyright (c) National Semiconductor Corporation 1990-1993
Assembled from "ADDRES~1.EQN". Date: 1-13-123
*
NOTE PINS RW:2 A8:3 A7:4 A6:5 A5:6 A4:7 A3:8 A2:9 A1:10 A0:11*
NOTE PINS GND:12 A11:14 A10:15 A9:16 SR:17 RD:18 WD:19 ROM:20*
NOTE PINS RES:21 PHI:22 T:23 VCC:24*
NOTE GALMODE SMALL*
QF2706*QP24*F0*
L0320
0111011010111011101110111001101010100111*
L0640
0111111011111111111111111111110111101111
0111111011111111111111111111111011011111
0111011001110111011101110101011011101111*
L0960
1011011001011011101110111001101010100111*
L1280
0111011001111011101110111001101010101011*
L1600
0111011010111011101110111001101010101011*
L2560
01011100*
L2632
10000011*
L2640
0000000010000000111000001000000010000000100000000000000000000000*
L2704
10*
C1A4F*
0000

View File

@ -0,0 +1,73 @@
EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
Copyright (c) National Semiconductor Corporation 1990-1993
Log file for ADDRES~1.EQN
Device: 20V8
Pin Label Type
--- ----- ----
2 RW pos,com input
3 A8 pos,com input
4 A7 pos,com input
5 A6 pos,com input
6 A5 pos,com input
7 A4 pos,com input
8 A3 pos,com input
9 A2 pos,com input
10 A1 pos,com input
11 A0 pos,com input
12 GND ground pin
14 A11 pos,com input
15 A10 pos,com input
16 A9 pos,com input
17 SR pos,com output
18 RD pos,com output
19 WD pos,com output
20 ROM neg,com output
21 RES pos,com output
22 PHI pos,com input
23 T pos,com input
24 VCC power pin
EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
Copyright (c) National Semiconductor Corporation 1990-1993
Device Utilization:
No of dedicated inputs used : 14/14 (100.0%)
No of feedbacks used as dedicated inputs : 1/6 (16.7%)
No of dedicated outputs used : 2/2 (100.0%)
No of feedbacks used as dedicated outputs : 3/6 (50.0%)
------------------------------------------
Pin Label Terms Usage
------------------------------------------
21 RES 1/8 (12.5%)
20 ROM 3/8 (37.5%)
19 WD 1/8 (12.5%)
18 RD 1/8 (12.5%)
17 SR 1/8 (12.5%)
------------------------------------------
Total Terms 7/64 (10.9%)
------------------------------------------
EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
Copyright (c) National Semiconductor Corporation 1990-1993
Chip diagram (DIP)
._____ _____.
| \__/ |
| 1 24 | VCC
RW | 2 23 | T
A8 | 3 22 | PHI
A7 | 4 21 | RES
A6 | 5 20 | ROM
A5 | 6 19 | WD
A4 | 7 18 | RD
A3 | 8 17 | SR
A2 | 9 16 | A9
A1 | 10 15 | A10
A0 | 11 14 | A11
GND | 12 13 |
|______________|

View File

@ -0,0 +1,15 @@
chip GAL20V8
NC3=1 RW=2 A0=11 A1=10 A2=9 A3=8 A4=7 A5=6 A6=5 A7=4 A8=3 GND=12
A9=16 A10=15 A11=14 SR=17 RD=18 WD=19 ROM=20 RES=21 PHI=22
T=23 VCC=24
equations
SR = /A0 * /A1 * /A2 * /A3 * /A4 * /A5 * /A6 * /A7 * /A8 * A9 * A10 * /A11 * /T * RW
RD = /A0 * /A1 * /A2 * /A3 * /A4 * /A5 * /A6 * A7 * /A8 * A9 * A10 * /A11 * /T * RW
WD = A0 * /A1 * /A2 * /A3 * /A4 * /A5 * /A6 * A7 * /A8 * A9 * A10 * /A11 * /T * /RW * PHI
/ROM = A11 * /T * RW
+ /A11 * A10 * A9 * A8 * /T * RW
+ A2 * A3 * A4 * A5 * A6 * A7 * /A8 * A9 * A10 * /A11 * /T * RW
RES = A0 * /A1 * /A2 * /A3 * /A4 * /A5 * /A6 * /A7 * /A8 * A9 * A10 * /A11 * /T * RW

View File

@ -0,0 +1,33 @@

GAL20V8
EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
Copyright (c) National Semiconductor Corporation 1990-1993
Assembled from "d:\ADDRES~2.EQN". Date: 3-29-123
*
NOTE PINS RW:2 A8:3 A7:4 A6:5 A5:6 A4:7 A3:8 A2:9 A1:10 A0:11*
NOTE PINS GND:12 A11:14 A10:15 A9:16 SR:17 RD:18 WD:19 ROM:20*
NOTE PINS RES:21 PHI:22 T:23 VCC:24*
NOTE GALMODE SMALL*
QF2706*QP24*F0*
L0320
0111101010111011101110111001100110100111*
L0640
0111111011111111111111111111111111011111
0111011011111111111111111101110111101111
0111101001110111011101110101010111101111*
L0960
1011101001011011101110111001100110100111*
L1280
0111101001111011101110111001100110101011*
L1600
0111101010111011101110111001100110101011*
L2560
01011100*
L2632
10000011*
L2640
0000000010000000111000001000000010000000100000000000000000000000*
L2704
10*
C1BAB*
0000

View File

@ -0,0 +1,73 @@
EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
Copyright (c) National Semiconductor Corporation 1990-1993
Log file for d:\ADDRES~2.EQN
Device: 20V8
Pin Label Type
--- ----- ----
2 RW pos,com input
3 A8 pos,com input
4 A7 pos,com input
5 A6 pos,com input
6 A5 pos,com input
7 A4 pos,com input
8 A3 pos,com input
9 A2 pos,com input
10 A1 pos,com input
11 A0 pos,com input
12 GND ground pin
14 A11 pos,com input
15 A10 pos,com input
16 A9 pos,com input
17 SR pos,com output
18 RD pos,com output
19 WD pos,com output
20 ROM neg,com output
21 RES pos,com output
22 PHI pos,com input
23 T pos,com input
24 VCC power pin
EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
Copyright (c) National Semiconductor Corporation 1990-1993
Device Utilization:
No of dedicated inputs used : 14/14 (100.0%)
No of feedbacks used as dedicated inputs : 1/6 (16.7%)
No of dedicated outputs used : 2/2 (100.0%)
No of feedbacks used as dedicated outputs : 3/6 (50.0%)
------------------------------------------
Pin Label Terms Usage
------------------------------------------
21 RES 1/8 (12.5%)
20 ROM 3/8 (37.5%)
19 WD 1/8 (12.5%)
18 RD 1/8 (12.5%)
17 SR 1/8 (12.5%)
------------------------------------------
Total Terms 7/64 (10.9%)
------------------------------------------
EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
Copyright (c) National Semiconductor Corporation 1990-1993
Chip diagram (DIP)
._____ _____.
| \__/ |
| 1 24 | VCC
RW | 2 23 | T
A8 | 3 22 | PHI
A7 | 4 21 | RES
A6 | 5 20 | ROM
A5 | 6 19 | WD
A4 | 7 18 | RD
A3 | 8 17 | SR
A2 | 9 16 | A9
A1 | 10 15 | A10
A0 | 11 14 | A11
GND | 12 13 |
|______________|

View File

@ -1,3 +1,11 @@
#ifndef BASE
#define BASE $C000
#endif
#ifndef OFFSET
#define OFFSET 0
#endif
;End address of dump block
#define hex1_l $34
#define hex1_h $35
@ -19,10 +27,10 @@
#define echo $FFEF ;Echo character to terminal
#define prbyte $FFDC
#define serial_ready $C000
#define serial_reset $C001
#define serial_read $C080
#define serial_write $C081
#define serial_ready BASE + OFFSET
#define serial_reset BASE + $1 + OFFSET
#define serial_read BASE + $80 + OFFSET
#define serial_write BASE + $81 + OFFSET
#define R_LETTER $D2
@ -34,14 +42,14 @@
#define SPACE $A0
; pad first 252 bytes with zeroes
.dsb 252, 0
.dsb 252 + OFFSET, 0
; include identification bytes
.byt "A1SI"
; this section is almost identical to original WOZ ACI
; adapted from https://www.sbprojects.net/projects/apple1/aci.php
* = $C100
* = BASE + $100 + OFFSET
apple_serial
lda #CR ;Drop the cursor one line
jsr echo

View File

@ -4,9 +4,9 @@
; regarding the IO of the serial interface.
;-------------------------------------------------------------------------
#define serial_ready $C000
#define serial_read $C080
#define serial_write $C081
#define serial_ready BASE + $000 + OFFSET
#define serial_read BASE + $080 + OFFSET
#define serial_write BASE + $081 + OFFSET
;-------------------------------------------------------------------------
; Memory declaration
@ -64,9 +64,9 @@
; Let's get started
;-------------------------------------------------------------------------
* = $C600
* = BASE + $600 + OFFSET
.dsb (*-end_of_counter_remote), 0
* = $C600
* = BASE + $600 + OFFSET
reset
jsr reset_serial

View File

@ -1,22 +1,22 @@
#define echo $FFEF
#define kbd_data $D010
#define kbd_cr $D011
#define serial_ready $C000
#define serial_read $C080
#define serial_write $C081
#define serial_ready BASE + $000 + OFFSET
#define serial_read BASE + $080 + OFFSET
#define serial_write BASE + $081 + OFFSET
; How to store INTEGER BASIC progams?
; C100R - run serial monitor
; C100( + OFFSET)R - run serial monitor
; 004A.00FFW 0800.0FFFW - write data for default LOMEM & HIMEM
; E2B3R - warm entry point
* = $C300
* = BASE + $300 + OFFSET
.dsb (*-end_of_apple1serial), 0
; teletype on apple-1
; the data from remote appears on apple-1 screen
* = $C300
teletype_apple1 = $C300
* = BASE + $300 + OFFSET
teletype_apple1 = BASE + $300 + OFFSET
jsr reset_serial
lda serial_read
teletype_apple1_wait
@ -29,11 +29,11 @@ end_of_teletype_apple1
; teletype on remote
; the data from apple-1 appears on remote
* = $C400
* = BASE + $400 + OFFSET
.dsb (*-end_of_teletype_apple1), 0
* = $C400
teletype_remote = $C400
* = BASE + $400 + OFFSET
teletype_remote = BASE + $400 + OFFSET
jsr reset_serial
lda #$FF
sta serial_write
@ -52,11 +52,11 @@ teletype_remote_wait
end_of_teletype_remote
; 0-255 repeating counter over TXD
* = $C500
* = BASE + $500 + OFFSET
.dsb (*-end_of_teletype_remote), 0
* = $C500
counter_remote = $C500
* = BASE + $500 + OFFSET
counter_remote = BASE + $500 + OFFSET
jsr reset_serial
ldy #$00
sta serial_write