Skip to content

Commit

Permalink
Improving cassette utility (#14)
Browse files Browse the repository at this point in the history
* Refactoring source code and updating README.md

* Adjusting compilation folder

* Specify installation folder

* Incrementing version number

* Refactoring cassette utility

* Further tuning cassette utility
  • Loading branch information
ifilot authored Mar 16, 2024
1 parent 83748b9 commit fa004d8
Show file tree
Hide file tree
Showing 58 changed files with 331 additions and 132 deletions.
43 changes: 22 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ env:
BUILD_TYPE: Release
PROGNAME: p2000t-fat-flasher
EXEC: p2000t-fat-flasher.exe
FIRMWAREFLASHER_BIN: FIRMWAREFLASHER.BIN
LAUNCHERFIRMWARE_BIN: LAUNCHERFIRMWARE.BIN
FLASHER_BIN: FLASHER.BIN
LAUNCHER_BIN: LAUNCHER.BIN
CASSETTE_UTILITY_BIN: CASSETTE_UTILITY.BIN
BASICROM_BIN: BASICBOOTSTRAP.BIN

Expand Down Expand Up @@ -49,15 +49,15 @@ jobs:
- uses: actions/checkout@v3
- name: Build launcher application
run: |
cd launch-os
cd launcher
sed -i 's/node2000/node2000000/' Makefile
make
mv main.rom ${{env.LAUNCHERFIRMWARE_BIN}}
mv main.rom ${{env.LAUNCHER_BIN}}
- name: Upload launcher
uses: actions/upload-artifact@v3
with:
name: ${{env.LAUNCHERFIRMWARE_BIN}}
path: launch-os/${{env.LAUNCHERFIRMWARE_BIN}}
name: ${{env.LAUNCHER_BIN}}
path: launcher/${{env.LAUNCHER_BIN}}

store-checksums:
runs-on: ubuntu-latest
Expand All @@ -70,10 +70,10 @@ jobs:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: ${{env.LAUNCHERFIRMWARE_BIN}}
name: ${{env.LAUNCHER_BIN}}
path: ./
- name: Run checksum
run: python3 launch-os/checksums.py ${{env.LAUNCHERFIRMWARE_BIN}} > launcher-checksums.txt
run: python3 launcher/checksums.py ${{env.LAUNCHER_BIN}} > launcher-checksums.txt
- name: Upload checksums
uses: actions/upload-artifact@v3
with:
Expand All @@ -89,7 +89,7 @@ jobs:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: ${{env.LAUNCHERFIRMWARE_BIN}}
name: ${{env.LAUNCHER_BIN}}
path: ./
- name: Upload Release Asset
id: upload-release-asset-launcher-firmware
Expand All @@ -98,8 +98,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{env.LAUNCHERFIRMWARE_BIN}}
asset_name: ${{env.LAUNCHERFIRMWARE_BIN}}
asset_path: ${{env.LAUNCHER_BIN}}
asset_name: ${{env.LAUNCHER_BIN}}
asset_content_type: application/octet-stream
- name: Upload Release Asset
id: upload-release-asset-checksums
Expand All @@ -124,16 +124,16 @@ jobs:
- uses: actions/checkout@v3
- name: Build launcher application
run: |
cd firmwareflasher
cd flasher
sed -i 's/node2000/node2000000/' Makefile
make
mv main.rom ${{env.FIRMWAREFLASHER_BIN}}
truncate -s 16K ${{env.FIRMWAREFLASHER_BIN}}
mv main.rom ${{env.FLASHER_BIN}}
truncate -s 16K ${{env.FLASHER_BIN}}
- name: Upload launcher
uses: actions/upload-artifact@v3
with:
name: ${{env.FIRMWAREFLASHER_BIN}}
path: firmwareflasher/${{env.FIRMWAREFLASHER_BIN}}
name: ${{env.FLASHER_BIN}}
path: flasher/${{env.FLASHER_BIN}}

deploy-firmware-flasher-rom:
runs-on: ubuntu-latest
Expand All @@ -144,7 +144,7 @@ jobs:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: ${{env.FIRMWAREFLASHER_BIN}}
name: ${{env.FLASHER_BIN}}
path: ./
- name: Upload Release Asset
id: upload-release-asset
Expand All @@ -153,8 +153,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{env.FIRMWAREFLASHER_BIN}}
asset_name: ${{env.FIRMWAREFLASHER_BIN}}
asset_path: ${{env.FLASHER_BIN}}
asset_name: ${{env.FLASHER_BIN}}
asset_content_type: application/octet-stream

################################################################################
Expand Down Expand Up @@ -248,7 +248,7 @@ jobs:

################################################################################

# GUI to interface with a P2000TFAT-chip
# GUI to interface with a P2000T FAT-chip
build-gui-windows:
runs-on: windows-latest
steps:
Expand Down Expand Up @@ -282,6 +282,7 @@ jobs:
version: '5.15.2'
target: 'desktop'
arch: 'win64_msvc2019_64'
dir: '${{ github.workspace }}/qt/'
tools: 'tools_ifw'
cache: true
- name: Download artifact
Expand All @@ -294,7 +295,7 @@ jobs:
- name: Copy assets
run: copy gui\assets\icons\icon.ico gui\packaging\packages\com.vendor.product\data\icon.ico
- name: Create installer
run: ${{github.workspace}}\..\Qt\Tools\QtInstallerFramework\4.6\bin\binarycreator.exe -c config\config.xml -p packages ${{env.PROGNAME}}-installer-win64.exe
run: ${{ github.workspace }}\qt\Qt\Tools\QtInstallerFramework\4.7\bin\binarycreator.exe -c config\config.xml -p packages ${{env.PROGNAME}}-installer-win64.exe
working-directory: gui/packaging
- name: Upload installer
uses: actions/upload-artifact@v3
Expand Down
44 changes: 26 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This project is still under development. Below a list of features can be found.
Checked features are implemented, unchecked features are work in progress.

- [x] Launch tape files from data cartridge in SLOT2
- [ ] Write tape data to data cartridge in SLOT2
- [x] Write tape data to data cartridge in SLOT2
- [ ] Write data back to tapes from the data cartridge

## Explainer
Expand All @@ -20,42 +20,50 @@ In the conventional approach, the user would start the P2000T and load programs
from the cassette. Under the hood, data is copied from the cassette to the
internal memory after which the program can be started.

The data cartridge essentially imitates on this process. Upon boot, a bit of
firmware is loaded from the data cartridge into memory and launched. This firmware
The data cartridge essentially imitates this process. Upon boot, a driver is
loaded from the data cartridge into memory and launched. This driver
scans the external ROM chip for programs and shows a list of those programs. The
user can then select a program and execute it. Upon selection, the program is
user can then select a program and executes it. Upon selection, the program is
first copied from the external chip to the internal RAM chip in the data cartridge.
Next, the firmware is removed (actually, it is simply overwritten), and the new
data is copied from the RAM chip to the same position as where normally cassette
data is copied. Finally, the `RUN` command is executed which starts the program.
Next, the driver is unloaded from memory, and the new data is copied from the
RAM chip to the same position as where normally cassette data is copied.
Finally, the `RUN` command is executed which starts the program.

![Explain how the data cartridge works](img/datacartridge_explainer.jpg)

## Contents
This repository is organized as follows

* `basicmod`: Modified BASIC ROM. This ROM is needed for the cartridge in SLOT1.
* `docs`: Technical documentation; mainly needed for development
* `firmwareflasher`: SLOT1 program to transfer launch-os from external ROM chip
* `cassette-utility`: Source code of the SLOT1 program to copy programs and data
from the data cassette to the data cartridge.
* `docs`: Technical documentation; mainly needed for development.
* `flasher`: SLOT1 program to transfer the launcher from external ROM chip
on the data cartridge to the internal ROM.
* `gui`: GUI to add and delete programs from the data cartridge and to format a
chip.
* `launcher`: Source code of the launcher application.
* `pcb`: PCBs for the SLOT2 data cartridge. Also includes .stl files for the cartridge enclosure.
* `src`: Source files for the SLOT1 program "tape monitor" that can be used to
transfer tapes to the external rom. **This program is still in development,
use at your own risk.**


## Files

The latest version of the files below can be obtained from the action artifacts
of the [last build](https://github.com/ifilot/p2000t-tape-monitor/actions/workflows/build.yml).

* [`BASICBOOTSTRAP.BIN`](https://nightly.link/ifilot/p2000t-tape-monitor/workflows/build/master/BASICBOOTSTRAP.BIN.zip): Modified BASIC cartridge. This is a SLOT1 cartridge.
* [`CASSETTE-UTILITY.BIN`](https://nightly.link/ifilot/p2000t-tape-monitor/workflows/build/master/CASSETTE-UTILITY.BIN.zip): Utility for copying files directly from the cassette to the (external) ROM chip. This is a SLOT1 cartridge.
* [`FIRMWAREFLASHER.BIN`](https://nightly.link/ifilot/p2000t-tape-monitor/workflows/build/master/FIRMWAREFLASHER.BIN): Firmware flasher for the data cartridge firmware. This is a SLOT1 cartridge that copies firmware from the external to the internal ROM on the SLOT2 cartridge.
* [`LAUNCHER.BIN`](https://nightly.link/ifilot/p2000t-tape-monitor/workflows/build/master/LAUNCHER.BIN): Firmware for the data cartridge. This firmware is stored on the internal ROM of the SLOT2 cartridge.
* [`p2000t-fat-flasher--installer-win64.exe`](https://nightly.link/ifilot/p2000t-tape-monitor/workflows/build/master/p2000t-fat-flasher-installer-win64.exe.zip): Windows installer for the Flasher GUI. This GUI is used to put cassette files on a ROM
chip which can be loaded on the P2000T.
* [`BASICBOOTSTRAP.BIN`](https://nightly.link/ifilot/p2000t-tape-monitor/workflows/build/master/BASICBOOTSTRAP.BIN.zip):
Modified BASIC cartridge. This is a SLOT1 cartridge.
* [`CASSETTE-UTILITY.BIN`](https://nightly.link/ifilot/p2000t-tape-monitor/workflows/build/master/CASSETTE-UTILITY.BIN.zip):
Utility for copying files directly from the cassette to the (external) ROM chip. This is a SLOT1 cartridge.
* [`FLASHER.BIN`](https://nightly.link/ifilot/p2000t-tape-monitor/workflows/build/master/FLASHER.BIN):
Flasher for the data cartridge driver. This is a SLOT1 cartridge that copies
the driver from the external to the internal ROM on the SLOT2 cartridge.
* [`LAUNCHER.BIN`](https://nightly.link/ifilot/p2000t-tape-monitor/workflows/build/master/LAUNCHER.BIN):
Driver for the data cartridge. This driver is stored on the internal ROM of
the SLOT2 cartridge.
* [`p2000t-fat-flasher--installer-win64.exe`](https://nightly.link/ifilot/p2000t-tape-monitor/workflows/build/master/p2000t-fat-flasher-installer-win64.exe.zip):
Windows installer for the Flasher GUI. This GUI is used to put cassette files
on a ROM chip which can be loaded on the P2000T.

## File system

Expand Down
4 changes: 3 additions & 1 deletion cassette-utility/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
main.bin main.map main.rom: main.c sst39sf.c memory.c leds.c tape.asm util.c \
romchip.c copy.asm crc16.asm
romchip.c copy.asm crc16.asm terminal.c
zcc \
+embedded -clib=sdcc_iy \
main.c \
Expand All @@ -11,6 +11,7 @@ main.bin main.map main.rom: main.c sst39sf.c memory.c leds.c tape.asm util.c \
romchip.c \
tape.asm \
crc16.asm \
terminal.c \
-startup=2 \
-pragma-define:CRT_ORG_CODE=0x1000 \
-pragma-define:CRT_ORG_DATA=0x6500 \
Expand All @@ -21,3 +22,4 @@ main.bin main.map main.rom: main.c sst39sf.c memory.c leds.c tape.asm util.c \
--max-allocs-per-node2000 \
-SO3 -bn main.bin \
-create-app -m

Loading

0 comments on commit fa004d8

Please sign in to comment.