Compare commits

..

38 commits

Author SHA1 Message Date
Jeff Epler
6eda79158a Merge branch 'reorder-d64' 2022-01-23 09:52:18 -06:00
Jeff Epler
fee356a04a Merge remote-tracking branch 'upstream/master' 2022-01-23 09:52:11 -06:00
Jeff Epler
a95913d27c reorder 64 so that the non-reu version is first 2022-01-23 09:49:13 -06:00
68e93ad37f
enable use of REU for faster scrolling (#11)
If enabled, the first 32 pages (8kB) of REU are used as a temporary area
to speed up screen scrolling.

The programs "80colreu", "80r[234]", and their compressed versions
are built to use the REU.

Lightly tested in vice, typical commandline
```
x64sc -reu -reusize 128 -autostart 80r3-compressed.prg
```
2022-01-23 16:45:39 +01:00
8b506068a1
update exomizer to 3.1.1 with fast decruncher flags (#13)
* Extract exomizer base command

* update exomizer to 3.1.1 with fast decruncher flags

This increases the size of charset3 to 4 blocks instead of 3,
and is said to give faster decrunch time.

It also updates the exomizer submodule to point at the official upstream,
not a defunct github mirror.
2022-01-23 16:44:18 +01:00
bf68bb6c22
Explain why loading the "uncompressed" prg fails (#14)
Closes: #10
2022-01-23 16:43:39 +01:00
999c909b6d
Update font image generator to python3, scale images by 3x, regenerate images (#15)
* Update mkfontimage to python3

* Updated font images

* make the images prettier (& the top image bigger)

* fix resampling
2022-01-23 16:43:14 +01:00
474f7896b3
Build the project with github actions (#12)
* Build the project with github actions

This produces a zip file with all the .prg files as well as the d64
image.

* try attaching files to a release

* only release d64 file

* rely on cc65 from os packages
2022-01-23 16:42:23 +01:00
Jeff Epler
e947379484 Merge branch 'actions' 2022-01-23 09:41:41 -06:00
36b4a8d07c rely on cc65 from os packages 2022-01-23 09:40:13 -06:00
15f3ce0ce9 only release d64 file 2022-01-23 09:40:09 -06:00
c87f1f6b85 try attaching files to a release 2022-01-23 09:40:06 -06:00
19c7bc952f
Merge pull request #1 from jepler/cc65-package
use cc65 from the os package during ci
2022-01-22 22:40:38 -06:00
c3ac7778ed
rely on cc65 from os packages 2022-01-22 22:37:45 -06:00
1b047aa269
only release d64 file 2022-01-22 22:36:07 -06:00
ee37561560
try attaching files to a release 2022-01-22 22:31:29 -06:00
401ba26d0c
invoke c1541 just once 2022-01-22 22:26:24 -06:00
3dd71e3b38
Merge branch 'python3' 2021-11-12 20:05:48 -06:00
31bdd17eea
fix resampling 2021-11-12 20:05:43 -06:00
030b112c71
Merge remote-tracking branch 'jepler/python3' 2021-11-12 20:02:59 -06:00
b1a18c845c
make the images prettier (& the top image bigger) 2021-11-12 20:01:26 -06:00
e16a2e2977 Merge branch 'python3' 2021-11-03 15:32:49 -05:00
8bbe4aee0b Updated font images 2021-11-03 15:30:54 -05:00
0e6bebb989 Update mkfontimage to python3 2021-11-03 15:29:13 -05:00
84e20adff0 Mention how REU mode works 2021-11-03 15:28:05 -05:00
ee7f5cb810 Fix markup of font images 2021-11-03 15:28:01 -05:00
2fed98b562 Merge branch 'use-reu' 2021-11-03 15:14:50 -05:00
7853b88179 Merge branch 'actions' 2021-11-03 15:14:44 -05:00
f0e309fbba Merge branch 'update-exomizer' 2021-11-03 15:14:35 -05:00
c6fc38981a update exomizer to 3.1.1 with fast decruncher flags
This increases the size of charset3 to 4 blocks instead of 3,
and is said to give faster decrunch time.

It also updates the exomizer submodule to point at the official upstream,
not a defunct github mirror.
2021-09-22 21:25:19 -05:00
231f96dce8 Explain why loading the "uncompressed" prg fails
Closes: #10
2021-09-22 21:24:49 -05:00
1a468f87d2 Extract exomizer base command 2021-09-22 20:36:29 -05:00
7c2d6d0aa0 update exomizer to 3.1.1 with fast decruncher flags
This increases the size of charset3 to 4 blocks instead of 3,
and is said to give faster decrunch time.

It also updates the exomizer submodule to point at the official upstream,
not a defunct github mirror.
2021-09-22 20:36:14 -05:00
c657559629 Extract exomizer base command 2021-09-22 20:31:13 -05:00
69e25f7ee6 Build the project with github actions
This produces a zip file with all the .prg files as well as the d64
image.
2021-09-22 20:08:18 -05:00
e34694b843 enable use of REU for faster scrolling
If enabled, the first 32 pages (8kB) of REU are used as a temporary area
to speed up screen scrolling.

The programs "80colreu", "80r[234]", and their compressed versions
are built to use the REU.

Lightly tested in vice, typical commandline
```
x64sc -reu -reusize 128 -autostart 80r3-compressed.prg
```
2021-09-22 10:12:26 -05:00
Jeff Epler
c817deeba2 README.md: Add trailing newline
In part because POSIX defines a text file as having a trailing
newline
https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline
but also because every time I edit this file with my favorite text
editor (vim), it insists on adding the final newline itself, so I
have to repeatedly un-add it manually which is irritating.
2017-07-18 06:02:02 -07:00
Jeff Epler
96007b158c Makefile: make c1541 optional
.. but note that having it installed will produce this additional target
2017-07-18 06:01:22 -07:00
18 changed files with 209 additions and 34 deletions

43
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,43 @@
name: Build
on:
push:
pull_request:
release:
types: [published]
check_suite:
types: [rerequested]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: install deps
run: sudo apt install vice cc65
- name: build toolchain
run: make toolchain-exomizer -j$(nproc)
- name: build 80columns
run: make -j$(nproc)
- uses: actions/upload-artifact@v2
with:
name: artifacts
path: |
*.d64
*.prg
- name: Create release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
*.d64
fail_on_unmatched_files: true
body: "Automatically created release"

6
.gitignore vendored
View file

@ -1,4 +1,8 @@
*.bin
*.d64
*.dbg
*.lst
*.map
*.o
*.prg
*.bin
bin

2
.gitmodules vendored
View file

@ -3,4 +3,4 @@
url = https://github.com/cc65/cc65
[submodule "exomizer"]
path = exomizer
url = https://github.com/bitshifters/exomizer
url = https://bitbucket.org/magli143/exomizer/

2
80colreu.s Normal file
View file

@ -0,0 +1,2 @@
USE_REU = 1
.include "80columns.s"

View file

@ -45,6 +45,61 @@ VICSCN = $C000 ; NEW Video Matrix: 25 Lines X 80 Columns
VICCOL = $D800 ; new color RAM is in RAM at the same address
BITMAP = $E000
.ifndef USE_REU
USE_REU = 0
.endif
.if USE_REU
REU_STATUS = $DF00 ; Status register
REU_COMMAND = $DF01 ; Command register
REU_C64ADDR = $DF02 ; C64 base address register
REU_REUADDR = $DF04 ; REU base address register
REU_COUNT = $DF07 ; Transfer count register
REU_IRQMASK = $DF09 ; IRQ mask register
REU_CONTROL = $DF0A ; Control register
REU_TRIGGER = $FF00 ; REU command trigger
OP_COPYFROM = $ED
OP_COPYTO = $EC
.macro REU_OP addr, len, op
lda R6510
pha
lda #%00110101
sta R6510
lda #0
sta $DF0A ; hold neither address
lda #<(addr)
sta REU_C64ADDR
lda #>(addr)
sta REU_C64ADDR+1
lda #<(len)
sta REU_COUNT
lda #>(len)
sta REU_COUNT+1
ldx #op
jsr reu_op
pla
sta R6510
.endmacro
.macro REU_COPYFROM addr, len
REU_OP addr, len, OP_COPYFROM
.endmacro
.macro REU_COPYTO addr, len
REU_OP addr, len, OP_COPYTO
.endmacro
.macro REU_MEMMOVE addr1, addr2, len
REU_COPYTO addr1, len
REU_COPYFROM addr2, len
.endmacro
.endif
; constants
COLUMNS = 80
LINES = 25
@ -517,9 +572,17 @@ scroll_up:
bne @1
dey
bne @1
@2:
; note that Y is now 0
; ***END*** identical to $E94B in KERNAL
; scroll screen up
@2: lda #COLUMNS
.if USE_REU
; move bitmap RAM (starting at BITMAP) up by 320 bytes
REU_MEMMOVE BITMAP+320, BITMAP, 24*40*8
; move character RAM (starting at VICSCN) up by 80 bytes
REU_MEMMOVE VICSCN+80, VICSCN, 24*80
.else
lda #COLUMNS
sta PNT
lda #>VICSCN
sta PNT + 1
@ -542,7 +605,9 @@ scroll_up:
cpy #$a0
beq :+
jmp :-
: ldy #40
:
.endif
ldy #40
lda #>VICCOL
sty USER
sta USER + 1
@ -571,7 +636,6 @@ scroll_up:
lda #4
sta BLNCT
rts ;returns Z clear because of LDA
petscii_to_screencode:
cmp #$FF ; PI
bne @1
@ -866,6 +930,21 @@ new_cinv:
jsr calc_user
@a6: jmp $EA61
.if USE_REU
reu_op:
lda #0
sta REU_REUADDR
sta REU_REUADDR+1
sta REU_REUADDR+2
stx REU_COMMAND
lda REU_TRIGGER
sta REU_TRIGGER
rts
.endif
.macro exec0 addr, save_y
php
sei

View file

@ -2,24 +2,24 @@ export PATH:= $(abspath bin):$(PATH)
.PHONY: all
all: 80columns-compressed.prg 80c2-compressed.prg 80c3-compressed.prg 80c4-compressed.prg
all: 80colreu-compressed.prg 80r2-compressed.prg 80r3-compressed.prg 80r4-compressed.prg
all: charset.prg charset2.prg charset3.prg charset4.prg
ifneq ($(shell which c1541 2>/dev/null),)
all: 80columns.d64
endif
80columns.d64: 80columns-compressed.prg charset.prg charset2.prg charset3.prg charset4.prg
80columns.d64: 80columns-compressed.prg 80colreu-compressed.prg charset.prg charset2.prg charset3.prg charset4.prg
rm -f $@
c1541 -format 80columns,80 d64 80columns.d64.tmp
for i in $^; do \
c1541 -attach 80columns.d64.tmp -write $$i $${i%[-.]*}; \
done
c1541 -format 80columns,80 d64 80columns.d64.tmp \
$(foreach fn,$^,-write $(fn) $(patsubst %-compressed,%,$(patsubst %.prg,%,$(fn))))
mv -f 80columns.d64.tmp 80columns.d64
EXOMIZER_SFX := exomizer sfx 51200 -q -n -T4 -M256 -Di_perf=2
.INTERMEDIATE: charset.bin
charset.prg: charset.bin
(printf '\0\320'; cat $<) > $@.tmp
exomizer sfx 51200 -q -n -o $@ $@.tmp
$(EXOMIZER_SFX) -o $@ $@.tmp
rm -f $@.tmp
charset.bin: charset.o charset.cfg
@ -27,42 +27,56 @@ charset.bin: charset.o charset.cfg
charset%.prg: charset%.bin
(printf '\0\320'; cat $<) > $@.tmp
exomizer sfx 51200 -q -n -o $@ $@.tmp
$(EXOMIZER_SFX) -o $@ $@.tmp
rm -f $@.tmp
charset%.bin: charset%.o charset.cfg
ld65 -C charset.cfg $< -o $@
%-compressed.prg: %-uncompressed.prg
exomizer sfx 51200 -q -n -o $@ $<
$(EXOMIZER_SFX) -o $@ $<
%-uncompressed.prg: %.bin
(printf '\0\310'; cat $<) > $@
.PHONY: update-font-images
update-font-images: charset.bin charset2.bin charset3.bin charset4.bin mkfontimg.py
python mkfontimg.py -l charset.bin img/t1.png
python mkfontimg.py charset.bin img/g1.png
python mkfontimg.py -l charset2.bin img/t2.png
python mkfontimg.py charset2.bin img/g2.png
python mkfontimg.py -l charset3.bin img/t3.png
python mkfontimg.py charset3.bin img/g3.png
python mkfontimg.py -l charset4.bin img/t4.png
python mkfontimg.py charset4.bin img/g4.png
python3 mkfontimg.py -l charset.bin img/t1.png
python3 mkfontimg.py charset.bin img/g1.png
python3 mkfontimg.py -l charset2.bin img/t2.png
python3 mkfontimg.py charset2.bin img/g2.png
python3 mkfontimg.py -l charset3.bin img/t3.png
python3 mkfontimg.py charset3.bin img/g3.png
python3 mkfontimg.py -l charset4.bin img/t4.png
python3 mkfontimg.py charset4.bin img/g4.png
.INTERMEDIATE: 80colreu.bin
80colreu.bin: 80colreu.o charset.o 80columns.cfg
ld65 -C 80columns.cfg $(filter %.o,$^) -o $@ --mapfile ${@:.bin=.map}
.INTERMEDIATE: 80columns.bin
80columns.bin: 80columns.o charset.o 80columns.cfg
ld65 -C 80columns.cfg $(filter %.o,$^) -o $@
ld65 -C 80columns.cfg $(filter %.o,$^) -o $@ --mapfile ${@:.bin=.map}
80r%.bin: 80colreu.o charset%.o 80columns.cfg
ld65 -C 80columns.cfg $(filter %.o,$^) -o $@ --mapfile ${@:.bin=.map} --dbgfile ${@:.bin=.dbg}
80c%.bin: 80columns.o charset%.o 80columns.cfg
ld65 -C 80columns.cfg $(filter %.o,$^) -o $@
ld65 -C 80columns.cfg $(filter %.o,$^) -o $@ --mapfile ${@:.bin=.map} --dbgfile ${@:.bin=.dbg}
80r%.bin: 80colreu.o charset%.o 80columns.cfg
ld65 -C 80columns.cfg $(filter %.o,$^) -o $@ --mapfile ${@:.bin=.map} --dbgfile ${@:.bin=.dbg}
80colreu.s: 80columns.s
80colreu.s: 80columns.s
%.o: %.s
ca65 -o $@ $<
ca65 -o $@ $< --debug --listing ${@:.o=.lst}
.PHONY: clean
clean:
rm -f *.prg *.bin *.o 80columns.d64
rm -f *.lst *.map *.prg *.bin *.o 80columns.d64
.PHONY: toolchain
toolchain: toolchain-cc65 toolchain-exomizer
@ -80,13 +94,13 @@ toolchain-cc65:
.PHONY: toolchain-exomizer
toolchain-exomizer:
[ -d exomizer/exomizer2/src ] || git submodule update --init exomizer
[ -d exomizer/src ] || git submodule update --init exomizer
$(MAKE) -C exomizer/exomizer2/src CFLAGS="-Wall -Wstrict-prototypes -pedantic -O3"
$(MAKE) -C exomizer/src CFLAGS="-Wall -Wstrict-prototypes -pedantic -O3"
mkdir -p bin
cp exomizer/exomizer2/src/exomizer bin/
cp exomizer/src/exomizer bin/
# have to do this, or git will report untracked files
(cd exomizer && git clean -dxf)

View file

@ -26,12 +26,31 @@ The source contains four character sets (`charset.s`, `charset2.s` etc.) from di
You can also `LOAD`/`RUN` a new exomizer-compressed character set into memory, though this destroys the currently-loaded BASIC program.
### charset.s: 80COLUMNS
![](img/g1.png) ![](img/t1.png) ### charset2.s: COLOR 80 by Richvale Telecommunications ![](img/g2.png) ![](img/t2.png) ### charset3.s: Highspeed80 by CKtwo ![](img/g3.png) ![](img/t3.png) ### charset4.s: SCREEN-80 by Computes Gazette ![](img/g4.png) ![](img/t4.png)
![](img/g1.png)
![](img/t1.png)
### charset2.s: COLOR 80 by Richvale Telecommunications
![](img/g2.png)
![](img/t2.png)
### charset3.s: Highspeed80 by CKtwo
![](img/g3.png)
![](img/t3.png)
### charset4.s: SCREEN-80 by Computes Gazette
![](img/g4.png)
![](img/t4.png)
## Memory Layout
The object code resides at $c800-$cfff. The two character sets are located at $d000-$d7ff. The virtual 80x25 Screen RAM (in order to read back screen contents) is at $c000-$c7ff. The bitmap is at $e000-$ff40, and the color matrix for bitmap mode is at $d800-$dbe8. All this lies beyond the top of BASIC RAM, so BASIC continues to have 38911 bytes free.
The address range where the character sets reside is the normal location of special I/O registers (e.g., the VIC-II registers start at $d000). The normal LOAD command cannot load to this range of memory (instead there are random seeming side-effects such as blanking the screen), but the exomizer uncruncher can.
## REU
If the REU version is used, up to the first 32kB of the REU are used to accelerate screen scrolling operations. By copying the screen to the REU, then from REU back to RAM shifted by 1 screen row, a higher throughput can be obtained.
## TODO
* Support LOCK and UNLOCK codes. (On the C64, these are 8 and 9, on the C128 they are 11 and 12...)
@ -48,4 +67,4 @@ Original author unknown. Reverse-engineered and maintained by Michael Steil, mis
## Contributing
Contributions to this project are very welcome.
Contributions to this project are very welcome.

@ -1 +1 @@
Subproject commit 2426d97207c8dff23cd2a94cc768c8be87a7b5d0
Subproject commit 6a152b5605648f7a41eadd4b011a93ec92f74dd8

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 857 B

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 855 B

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 932 B

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 940 B

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 886 B

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 904 B

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 963 B

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 970 B

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

@ -1,5 +1,6 @@
#!/usr/bin/python
import sys
import struct
import PIL.Image as Image
text = """\
@ -22,9 +23,12 @@ def toscreencode(ch):
if '`' <= ch <= '~': return cc - 96
return cc
charset = map(ord, open(sys.argv[1]).read())
charset = open(sys.argv[1], "rb").read()
FG = 0xFFDE7886
BG = 0xFFAA3A48
def putcat(img, r, c, code, lowercase):
inverse = code & 128
code = code % 128
@ -33,10 +37,19 @@ def putcat(img, r, c, code, lowercase):
data = charset[idx+y+lowercase*1024]
if not inverse: data = ~data
for x in range(4):
img.putpixel((4*c+x,8*r+y), data & (1<<(3-x)))
if ~data & (1<<(3-x)):
img.putpixel((8+4*c+x,8+8*r+y), FG)
img = Image.frombytes('1', (188,64), '\xff' * 188*64)
BG_buf = struct.pack('<I', BG)
img = Image.frombytes('RGBA', (16+188,16+64), BG_buf * (16+188)*(16+64))
for i in range(8):
for x in range(img.width):
img.putpixel((x, i), FG)
img.putpixel((x, img.height-i-1), FG)
for y in range(img.height):
img.putpixel((i, y), FG)
img.putpixel((img.width-i-1, y), FG)
r=c=0
for ch in text:
if ch == '\n':
@ -52,4 +65,5 @@ for r in range(8):
for c in range(16):
putcat(img, r, c+31, r*16+c, lowercase)
img = img.resize((img.size[0]*3, img.size[1]*3), resample=Image.NEAREST)
img.save(sys.argv[2])