mirror of
https://github.com/V2RetroComputing/analog-utilities.git
synced 2024-11-24 06:30:57 +00:00
Menu changes
This commit is contained in:
parent
ce990bb9e7
commit
34c697e2aa
251
Makefile
Normal file
251
Makefile
Normal file
@ -0,0 +1,251 @@
|
||||
DISK525A_OBJS = menu config
|
||||
DISK525B_OBJS = menu
|
||||
DISK525C_OBJS = menu fontmgr
|
||||
DISK525D_OBJS = menu fontmgr
|
||||
DISK35_OBJS = menu config fontmgr
|
||||
|
||||
FONT_OBJS = 01.us.une.cf 02.clintonv1.cf 03.reactive.cf 04.danpaymar.cf \
|
||||
05.blippo.cf 06.byte.cf 07.colossal.cf 08.count.cf \
|
||||
09.flow.cf 0a.gothic.cf 0b.outline.cf 0c.pigfont.cf \
|
||||
0d.pinocchio.cf 0e.slant.cf 0f.stop.cf 10.euro.une.cf \
|
||||
11.euro.enh.cf 12.clintonv2.cf 13.germanenh.cf 14.germanune.cf \
|
||||
15.frenchenh.cf 16.frenchune.cf 17.hebrewenh.cf 18.hebrewune.cf \
|
||||
19.plus.enh.cf 1a.plus.une.cf 1b.katakana.cf 1c.cyrillic.cf \
|
||||
1d.greek.cf 1e.esperanto.cf 1f.videx.cf 20.plus.une.cf \
|
||||
21.us.enh.cf 22.us.enh.cf 23.cyrillic.cf 24.pcbold.cf
|
||||
|
||||
SYSTEM_TARGETS = menu
|
||||
BASE_TARGETS = menu config fontmgr
|
||||
ENH_TARGETS = menu config fontmgr
|
||||
DISK_TARGETS = disk35 disk525a disk525b disk525c disk525d
|
||||
|
||||
|
||||
# For this one see https://applecommander.github.io/
|
||||
AC ?= tools/ac.jar
|
||||
ACX ?= tools/acx.jar
|
||||
DEFLATE ?= tools/deflater
|
||||
|
||||
# Just the usual way to find out if we're
|
||||
# using cmd.exe to execute make rules.
|
||||
ifneq ($(shell echo),)
|
||||
CMD_EXE = 1
|
||||
endif
|
||||
|
||||
ifdef CMD_EXE
|
||||
NULLDEV = nul:
|
||||
DEL = -del /f
|
||||
RMDIR = rmdir /s /q
|
||||
else
|
||||
NULLDEV = /dev/null
|
||||
DEL = $(RM)
|
||||
RMDIR = $(RM) -r
|
||||
endif
|
||||
|
||||
ifdef CC65_HOME
|
||||
AS = $(CC65_HOME)/bin/ca65
|
||||
CC = $(CC65_HOME)/bin/cc65
|
||||
CL = $(CC65_HOME)/bin/cl65
|
||||
LD = $(CC65_HOME)/bin/ld65
|
||||
else
|
||||
AS := $(if $(wildcard ../../bin/ca65*),../../bin/ca65,ca65)
|
||||
CC := $(if $(wildcard ../../bin/cc65*),../../bin/cc65,cc65)
|
||||
CL := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65)
|
||||
LD := $(if $(wildcard ../../bin/ld65*),../../bin/ld65,ld65)
|
||||
endif
|
||||
|
||||
ENFORCESIZE = @(FILESIZE=`stat -c%s $1` ; \
|
||||
if [ $2 -gt 0 ]; then \
|
||||
if [ $$FILESIZE -gt $2 ] ; then \
|
||||
echo "ERROR: File $1 exceeds size limit ($$FILESIZE > $2)" ; \
|
||||
exit 1 ; \
|
||||
fi ; \
|
||||
fi )
|
||||
|
||||
OBJDIR = obj
|
||||
SRCDIR = src
|
||||
|
||||
all: binaries disks
|
||||
binaries: fonts systems bases enhs
|
||||
fonts: $(addprefix $(OBJDIR)/,$(FONT_OBJS))
|
||||
systems: fonts $(addprefix $(OBJDIR)/,$(addsuffix .system,$(SYSTEM_TARGETS)))
|
||||
bases: $(addprefix $(OBJDIR)/,$(addsuffix .base,$(BASE_TARGETS)))
|
||||
enhs: $(addprefix $(OBJDIR)/,$(addsuffix .enh,$(ENH_TARGETS)))
|
||||
disks: $(addprefix $(OBJDIR)/,$(addsuffix .po,$(DISK_TARGETS)))
|
||||
|
||||
.PHONY: binaries fonts systems bases enhs disks $(SYSTEM_TARGETS)
|
||||
|
||||
$(OBJDIR)/%.xf: fonts/00.us.enh.pf fonts/%.pf
|
||||
tools/xorfont US.ENH....00.PF $^ $@
|
||||
|
||||
$(OBJDIR)/%.cf: $(OBJDIR)/%.xf
|
||||
tools/rlefont $< $@
|
||||
|
||||
$(OBJDIR)/%.base: $(SRCDIR)/%.c
|
||||
$(CL) -O -t apple2 -C apple2-system.cfg -m $@.map -o $@.AppleSingle $^
|
||||
@~/applesingle/applesingle -r < $@.AppleSingle > $@ 2>$(NULLDEV)
|
||||
@echo $@"\r\t\t\t" `wc -c $@ | cut -d ' ' -f 1`
|
||||
|
||||
$(OBJDIR)/%.enh: $(SRCDIR)/%.c
|
||||
$(CL) -O -t apple2enh -C apple2-system.cfg -m $@.map -o $@.AppleSingle $^
|
||||
@~/applesingle/applesingle -r < $@.AppleSingle > $@ 2>$(NULLDEV)
|
||||
@echo $@"\r\t\t\t" `wc -c $@ | cut -d ' ' -f 1`
|
||||
|
||||
$(OBJDIR)/%.system: $(SRCDIR)/loader.c
|
||||
$(CL) -O -t apple2 -DNEXTNAME=\"`echo $(notdir $(basename $@)) | tr a-z A-Z`\" -C apple2-system.cfg -m $@.map -o $@.AppleSingle $(SRCDIR)/loader.c
|
||||
@~/applesingle/applesingle -r < $@.AppleSingle > $@ 2>$(NULLDEV)
|
||||
@echo $@"\r\t\t\t" `wc -c $@ | cut -d ' ' -f 1`
|
||||
|
||||
$(OBJDIR)/disk525a.po: $(OBJDIR)/menu.system $(addprefix $(OBJDIR)/,$(addsuffix .base,$(DISK525A_OBJS))) $(addprefix $(OBJDIR)/,$(addsuffix .enh,$(DISK525A_OBJS)))
|
||||
@cp prodos/pd525.po $@
|
||||
java -jar $(AC) -n $@ V2A.SIDEA
|
||||
java -jar $(AC) -p $@ MENU.SYSTEM SYS 0x2000 <$(OBJDIR)/menu.system
|
||||
java -jar $(AC) -p $@ MENU.BASE SYS 0x2000 <$(OBJDIR)/menu.base
|
||||
java -jar $(AC) -p $@ MENU.ENH SYS 0x2000 <$(OBJDIR)/menu.enh
|
||||
java -jar $(AC) -p $@ CONFIG.BASE SYS 0x2000 <$(OBJDIR)/config.base
|
||||
java -jar $(AC) -p $@ CONFIG.ENH SYS 0x2000 <$(OBJDIR)/config.enh
|
||||
java -jar $(AC) -p $@ BASIC.SYSTEM SYS 0x2000 <prodos/basic.system
|
||||
|
||||
$(OBJDIR)/disk525b.po: $(addprefix $(OBJDIR)/,$(addsuffix .base,$(DISK525B_OBJS))) $(addprefix $(OBJDIR)/,$(addsuffix .enh,$(DISK525B_OBJS)))
|
||||
@cp prodos/pd525.po $@
|
||||
java -jar $(AC) -n $@ V2A.SIDEB
|
||||
java -jar $(AC) -p $@ BASIC.SYSTEM SYS 0x2000 <prodos/basic.system
|
||||
java -jar $(ACX) mkdir -d=$@ ADTPRO
|
||||
java -jar $(AC) -p $@ ADTPRO/ADTPRO SYS 0x2000 <adtpro/adtpro
|
||||
java -jar $(AC) -p $@ ADTPRO/ADTPRO.BIN BIN 0x0800 <adtpro/adtpro.bin
|
||||
java -jar $(AC) -p $@ ADTPRO/ADTPROAUD SYS 0x2000 <adtpro/adtproaud
|
||||
java -jar $(AC) -p $@ ADTPRO/ADTPROAUD.BIN BIN 0x0800 <adtpro/adtproaud.bin
|
||||
java -jar $(AC) -p $@ ADTPRO/ADTPROETH SYS 0x2000 <adtpro/adtproeth
|
||||
java -jar $(AC) -p $@ ADTPRO/ADTPROETH.BIN BIN 0x0800 <adtpro/adtproeth.bin
|
||||
java -jar $(ACX) mkdir -d=$@ VDRIVE
|
||||
java -jar $(AC) -p $@ VDRIVE/VEDRIVE.BIN BIN 0x2000 <adtpro/vedrive
|
||||
java -jar $(AC) -p $@ VDRIVE/VEDRIVE.LOW SYS 0x2000 <adtpro/vedrive.low
|
||||
java -jar $(AC) -p $@ VDRIVE/VEDRIVE.SETUP BAS 0x0801 <adtpro/vedrive.setup
|
||||
java -jar $(AC) -p $@ VDRIVE/VEDRIVE.SYSTEM SYS 0x2000 <adtpro/vedrive.system
|
||||
java -jar $(AC) -p $@ VDRIVE/VSDRIVE SYS 0x2000 <adtpro/vsdrive
|
||||
java -jar $(AC) -p $@ VDRIVE/VSDRIVE.LOW SYS 0x2000 <adtpro/vsdrive.low
|
||||
|
||||
$(OBJDIR)/disk525c.po: $(OBJDIR)/menu.system $(addprefix $(OBJDIR)/,$(addsuffix .base,$(DISK525B_OBJS))) $(addprefix $(OBJDIR)/,$(addsuffix .enh,$(DISK525B_OBJS)))
|
||||
@cp prodos/pd525.po $@
|
||||
java -jar $(AC) -n $@ FONTS
|
||||
java -jar $(ACX) mkdir -d=$@ FONTS
|
||||
java -jar $(AC) -p $@ FONTS/US.ENH....00.PF BIN 0xF027 <fonts/00.us.enh.pf
|
||||
java -jar $(AC) -p $@ FONTS/US.UNE....01.CF BIN 0xCF27 <$(OBJDIR)/01.us.une.cf
|
||||
java -jar $(AC) -p $@ FONTS/CLINTONV1.02.CF BIN 0xCF27 <$(OBJDIR)/02.clintonv1.cf
|
||||
java -jar $(AC) -p $@ FONTS/REACTIVE..03.CF BIN 0xCF27 <$(OBJDIR)/03.reactive.cf
|
||||
java -jar $(AC) -p $@ FONTS/DANPAYMAR.04.CF BIN 0xCF27 <$(OBJDIR)/04.danpaymar.cf
|
||||
java -jar $(AC) -p $@ FONTS/BLIPPO....05.CF BIN 0xCF27 <$(OBJDIR)/05.blippo.cf
|
||||
java -jar $(AC) -p $@ FONTS/BYTE......06.CF BIN 0xCF27 <$(OBJDIR)/06.byte.cf
|
||||
java -jar $(AC) -p $@ FONTS/COLOSSAL..07.CF BIN 0xCF27 <$(OBJDIR)/07.colossal.cf
|
||||
java -jar $(AC) -p $@ FONTS/COUNT.....08.CF BIN 0xCF27 <$(OBJDIR)/08.count.cf
|
||||
java -jar $(AC) -p $@ FONTS/FLOW......09.CF BIN 0xCF27 <$(OBJDIR)/09.flow.cf
|
||||
java -jar $(AC) -p $@ FONTS/GOTHIC....0A.CF BIN 0xCF27 <$(OBJDIR)/0a.gothic.cf
|
||||
java -jar $(AC) -p $@ FONTS/OUTLINE...0B.CF BIN 0xCF27 <$(OBJDIR)/0b.outline.cf
|
||||
java -jar $(AC) -p $@ FONTS/PIGFONT...0C.CF BIN 0xCF27 <$(OBJDIR)/0c.pigfont.cf
|
||||
java -jar $(AC) -p $@ FONTS/PINOCCHIO.0D.PF BIN 0xF027 <fonts/0d.pinocchio.pf
|
||||
java -jar $(AC) -p $@ FONTS/SLANT.....0E.CF BIN 0xCF27 <$(OBJDIR)/0e.slant.cf
|
||||
java -jar $(AC) -p $@ FONTS/STOP......0F.CF BIN 0xCF27 <$(OBJDIR)/0f.stop.cf
|
||||
java -jar $(AC) -p $@ MENU.SYSTEM SYS 0x2000 <$(OBJDIR)/menu.system
|
||||
java -jar $(AC) -p $@ MENU.BASE SYS 0x2000 <$(OBJDIR)/menu.base
|
||||
java -jar $(AC) -p $@ MENU.ENH SYS 0x2000 <$(OBJDIR)/menu.enh
|
||||
java -jar $(AC) -p $@ FONTMGR.BASE SYS 0x2000 <$(OBJDIR)/fontmgr.base
|
||||
java -jar $(AC) -p $@ FONTMGR.ENH SYS 0x2000 <$(OBJDIR)/fontmgr.enh
|
||||
|
||||
$(OBJDIR)/disk525d.po: $(OBJDIR)/menu.system $(addprefix $(OBJDIR)/,$(addsuffix .base,$(DISK525B_OBJS))) $(addprefix $(OBJDIR)/,$(addsuffix .enh,$(DISK525B_OBJS)))
|
||||
@cp prodos/pd525.po $@
|
||||
java -jar $(AC) -n $@ FONTS
|
||||
java -jar $(ACX) mkdir -d=$@ FONTS
|
||||
java -jar $(AC) -p $@ FONTS/US.ENH....00.PF BIN 0xF027 <fonts/00.us.enh.pf
|
||||
java -jar $(AC) -p $@ FONTS/EURO.UNE..10.CF BIN 0xCF27 <$(OBJDIR)/10.euro.une.cf
|
||||
java -jar $(AC) -p $@ FONTS/EURO.ENH..11.CF BIN 0xCF27 <$(OBJDIR)/11.euro.enh.cf
|
||||
java -jar $(AC) -p $@ FONTS/CLINTONV2.12.CF BIN 0xCF27 <$(OBJDIR)/12.clintonv2.cf
|
||||
java -jar $(AC) -p $@ FONTS/GERMANENH.13.CF BIN 0xCF27 <$(OBJDIR)/13.germanenh.cf
|
||||
java -jar $(AC) -p $@ FONTS/GERMANUNE.14.CF BIN 0xCF27 <$(OBJDIR)/14.germanune.cf
|
||||
java -jar $(AC) -p $@ FONTS/FRENCHENH.15.CF BIN 0xCF27 <$(OBJDIR)/15.frenchenh.cf
|
||||
java -jar $(AC) -p $@ FONTS/FRENCHUNE.16.CF BIN 0xCF27 <$(OBJDIR)/16.frenchune.cf
|
||||
java -jar $(AC) -p $@ FONTS/HEBREWENH.17.CF BIN 0xCF27 <$(OBJDIR)/17.hebrewenh.cf
|
||||
java -jar $(AC) -p $@ FONTS/HEBREWUNE.18.CF BIN 0xCF27 <$(OBJDIR)/18.hebrewune.cf
|
||||
java -jar $(AC) -p $@ FONTS/PLUS.ENH..19.PF BIN 0xF027 <fonts/19.plus.enh.pf
|
||||
java -jar $(AC) -p $@ FONTS/PLUS.UNE..1A.PF BIN 0xF027 <fonts/1a.plus.une.pf
|
||||
java -jar $(AC) -p $@ FONTS/KATAKANA..1B.PF BIN 0xF027 <fonts/1b.katakana.pf
|
||||
java -jar $(AC) -p $@ FONTS/CYRILLIC..1C.CF BIN 0xCF27 <$(OBJDIR)/1c.cyrillic.cf
|
||||
java -jar $(AC) -p $@ FONTS/GREEK.....1D.CF BIN 0xCF27 <$(OBJDIR)/1d.greek.cf
|
||||
java -jar $(AC) -p $@ FONTS/ESPERANTO.1E.CF BIN 0xCF27 <$(OBJDIR)/1e.esperanto.cf
|
||||
java -jar $(AC) -p $@ FONTS/VIDEX.....1F.CF BIN 0xCF27 <$(OBJDIR)/1f.videx.cf
|
||||
java -jar $(AC) -p $@ FONTS/PLUS.UNE..20.PF BIN 0xF027 <fonts/20.plus.une.pf
|
||||
java -jar $(AC) -p $@ FONTS/US.ENH....21.CF BIN 0xCF27 <$(OBJDIR)/21.us.enh.cf
|
||||
java -jar $(AC) -p $@ FONTS/US.ENH....22.CF BIN 0xCF27 <$(OBJDIR)/22.us.enh.cf
|
||||
java -jar $(AC) -p $@ FONTS/CYRILLIC..23.CF BIN 0xCF27 <$(OBJDIR)/23.cyrillic.cf
|
||||
java -jar $(AC) -p $@ FONTS/PCBOLD....24.CF BIN 0xCF27 <$(OBJDIR)/24.pcbold.cf
|
||||
java -jar $(AC) -p $@ MENU.SYSTEM SYS 0x2000 <$(OBJDIR)/menu.system
|
||||
java -jar $(AC) -p $@ MENU.BASE SYS 0x2000 <$(OBJDIR)/menu.base
|
||||
java -jar $(AC) -p $@ MENU.ENH SYS 0x2000 <$(OBJDIR)/menu.enh
|
||||
java -jar $(AC) -p $@ FONTMGR.BASE SYS 0x2000 <$(OBJDIR)/fontmgr.base
|
||||
java -jar $(AC) -p $@ FONTMGR.ENH SYS 0x2000 <$(OBJDIR)/fontmgr.enh
|
||||
|
||||
$(OBJDIR)/disk35.po: $(OBJDIR)/menu.system $(addprefix $(OBJDIR)/,$(addsuffix .base,$(DISK35_OBJS))) $(addprefix $(OBJDIR)/,$(addsuffix .enh,$(DISK35_OBJS)))
|
||||
@cp prodos/pd35.po $@
|
||||
java -jar $(AC) -n $@ V2ANALOG
|
||||
java -jar $(AC) -p $@ MENU.SYSTEM SYS 0x2000 <$(OBJDIR)/menu.system
|
||||
java -jar $(AC) -p $@ BASIC.SYSTEM SYS 0x2000 <prodos/basic.system
|
||||
java -jar $(ACX) mkdir -d=$@ ADTPRO
|
||||
java -jar $(AC) -p $@ ADTPRO/ADTPRO SYS 0x2000 <adtpro/adtpro
|
||||
java -jar $(AC) -p $@ ADTPRO/ADTPRO.BIN BIN 0x0800 <adtpro/adtpro.bin
|
||||
java -jar $(AC) -p $@ ADTPRO/ADTPROAUD SYS 0x2000 <adtpro/adtproaud
|
||||
java -jar $(AC) -p $@ ADTPRO/ADTPROAUD.BIN BIN 0x0800 <adtpro/adtproaud.bin
|
||||
java -jar $(AC) -p $@ ADTPRO/ADTPROETH SYS 0x2000 <adtpro/adtproeth
|
||||
java -jar $(AC) -p $@ ADTPRO/ADTPROETH.BIN BIN 0x0800 <adtpro/adtproeth.bin
|
||||
java -jar $(ACX) mkdir -d=$@ VDRIVE
|
||||
java -jar $(AC) -p $@ VDRIVE/VEDRIVE.BIN BIN 0x2000 <adtpro/vedrive
|
||||
java -jar $(AC) -p $@ VDRIVE/VEDRIVE.LOW SYS 0x2000 <adtpro/vedrive.low
|
||||
java -jar $(AC) -p $@ VDRIVE/VEDRIVE.SETUP BAS 0x0801 <adtpro/vedrive.setup
|
||||
java -jar $(AC) -p $@ VDRIVE/VEDRIVE.SYSTEM SYS 0x2000 <adtpro/vedrive.system
|
||||
java -jar $(AC) -p $@ VDRIVE/VSDRIVE SYS 0x2000 <adtpro/vsdrive
|
||||
java -jar $(AC) -p $@ VDRIVE/VSDRIVE.LOW SYS 0x2000 <adtpro/vsdrive.low
|
||||
java -jar $(ACX) mkdir -d=$@ FONTS
|
||||
java -jar $(AC) -p $@ FONTS/US.ENH....00.PF BIN 0xF027 <fonts/00.us.enh.pf
|
||||
java -jar $(AC) -p $@ FONTS/US.UNE....01.CF BIN 0xCF27 <$(OBJDIR)/01.us.une.cf
|
||||
java -jar $(AC) -p $@ FONTS/CLINTONV1.02.CF BIN 0xCF27 <$(OBJDIR)/02.clintonv1.cf
|
||||
java -jar $(AC) -p $@ FONTS/REACTIVE..03.CF BIN 0xCF27 <$(OBJDIR)/03.reactive.cf
|
||||
java -jar $(AC) -p $@ FONTS/DANPAYMAR.04.CF BIN 0xCF27 <$(OBJDIR)/04.danpaymar.cf
|
||||
java -jar $(AC) -p $@ FONTS/BLIPPO....05.CF BIN 0xCF27 <$(OBJDIR)/05.blippo.cf
|
||||
java -jar $(AC) -p $@ FONTS/BYTE......06.CF BIN 0xCF27 <$(OBJDIR)/06.byte.cf
|
||||
java -jar $(AC) -p $@ FONTS/COLOSSAL..07.CF BIN 0xCF27 <$(OBJDIR)/07.colossal.cf
|
||||
java -jar $(AC) -p $@ FONTS/COUNT.....08.CF BIN 0xCF27 <$(OBJDIR)/08.count.cf
|
||||
java -jar $(AC) -p $@ FONTS/FLOW......09.CF BIN 0xCF27 <$(OBJDIR)/09.flow.cf
|
||||
java -jar $(AC) -p $@ FONTS/GOTHIC....0A.CF BIN 0xCF27 <$(OBJDIR)/0a.gothic.cf
|
||||
java -jar $(AC) -p $@ FONTS/OUTLINE...0B.CF BIN 0xCF27 <$(OBJDIR)/0b.outline.cf
|
||||
java -jar $(AC) -p $@ FONTS/PIGFONT...0C.CF BIN 0xCF27 <$(OBJDIR)/0c.pigfont.cf
|
||||
java -jar $(AC) -p $@ FONTS/PINOCCHIO.0D.PF BIN 0xF027 <fonts/0d.pinocchio.pf
|
||||
java -jar $(AC) -p $@ FONTS/SLANT.....0E.CF BIN 0xCF27 <$(OBJDIR)/0e.slant.cf
|
||||
java -jar $(AC) -p $@ FONTS/STOP......0F.CF BIN 0xCF27 <$(OBJDIR)/0f.stop.cf
|
||||
java -jar $(AC) -p $@ FONTS/EURO.UNE..10.CF BIN 0xCF27 <$(OBJDIR)/10.euro.une.cf
|
||||
java -jar $(AC) -p $@ FONTS/EURO.ENH..11.CF BIN 0xCF27 <$(OBJDIR)/11.euro.enh.cf
|
||||
java -jar $(AC) -p $@ FONTS/CLINTONV2.12.CF BIN 0xCF27 <$(OBJDIR)/12.clintonv2.cf
|
||||
java -jar $(AC) -p $@ FONTS/GERMANENH.13.CF BIN 0xCF27 <$(OBJDIR)/13.germanenh.cf
|
||||
java -jar $(AC) -p $@ FONTS/GERMANUNE.14.CF BIN 0xCF27 <$(OBJDIR)/14.germanune.cf
|
||||
java -jar $(AC) -p $@ FONTS/FRENCHENH.15.CF BIN 0xCF27 <$(OBJDIR)/15.frenchenh.cf
|
||||
java -jar $(AC) -p $@ FONTS/FRENCHUNE.16.CF BIN 0xCF27 <$(OBJDIR)/16.frenchune.cf
|
||||
java -jar $(AC) -p $@ FONTS/HEBREWENH.17.CF BIN 0xCF27 <$(OBJDIR)/17.hebrewenh.cf
|
||||
java -jar $(AC) -p $@ FONTS/HEBREWUNE.18.CF BIN 0xCF27 <$(OBJDIR)/18.hebrewune.cf
|
||||
java -jar $(AC) -p $@ FONTS/PLUS.ENH..19.PF BIN 0xF027 <fonts/19.plus.enh.pf
|
||||
java -jar $(AC) -p $@ FONTS/PLUS.UNE..1A.PF BIN 0xF027 <fonts/1a.plus.une.pf
|
||||
java -jar $(AC) -p $@ FONTS/KATAKANA..1B.PF BIN 0xF027 <fonts/1b.katakana.pf
|
||||
java -jar $(AC) -p $@ FONTS/CYRILLIC..1C.CF BIN 0xCF27 <$(OBJDIR)/1c.cyrillic.cf
|
||||
java -jar $(AC) -p $@ FONTS/GREEK.....1D.CF BIN 0xCF27 <$(OBJDIR)/1d.greek.cf
|
||||
java -jar $(AC) -p $@ FONTS/ESPERANTO.1E.CF BIN 0xCF27 <$(OBJDIR)/1e.esperanto.cf
|
||||
java -jar $(AC) -p $@ FONTS/VIDEX.....1F.CF BIN 0xCF27 <$(OBJDIR)/1f.videx.cf
|
||||
java -jar $(AC) -p $@ FONTS/PLUS.UNE..20.PF BIN 0xCF27 <fonts/20.plus.une.pf
|
||||
java -jar $(AC) -p $@ FONTS/US.ENH....21.CF BIN 0xCF27 <$(OBJDIR)/21.us.enh.cf
|
||||
java -jar $(AC) -p $@ FONTS/US.ENH....22.CF BIN 0xCF27 <$(OBJDIR)/22.us.enh.cf
|
||||
java -jar $(AC) -p $@ FONTS/CYRILLIC..23.CF BIN 0xCF27 <$(OBJDIR)/23.cyrillic.cf
|
||||
java -jar $(AC) -p $@ FONTS/PCBOLD....24.CF BIN 0xCF27 <$(OBJDIR)/24.pcbold.cf
|
||||
java -jar $(AC) -p $@ MENU.BASE SYS 0x2000 <$(OBJDIR)/menu.base
|
||||
java -jar $(AC) -p $@ MENU.ENH SYS 0x2000 <$(OBJDIR)/menu.enh
|
||||
java -jar $(AC) -p $@ CONFIG.BASE SYS 0x2000 <$(OBJDIR)/config.base
|
||||
java -jar $(AC) -p $@ CONFIG.ENH SYS 0x2000 <$(OBJDIR)/config.enh
|
||||
java -jar $(AC) -p $@ FONTMGR.BASE SYS 0x2000 <$(OBJDIR)/fontmgr.base
|
||||
java -jar $(AC) -p $@ FONTMGR.ENH SYS 0x2000 <$(OBJDIR)/fontmgr.enh
|
||||
|
||||
clean:
|
||||
@$(DEL) obj/* 2>$(NULLDEV)
|
||||
|
55
src/cfgtoken.h
Normal file
55
src/cfgtoken.h
Normal file
@ -0,0 +1,55 @@
|
||||
|
||||
#define NEWCONFIG_MAGIC 0x0001434E // "NC\x01\x00"
|
||||
#define NEWCONFIG_EOF_MARKER 0x00464F45 // "EOF\x00"
|
||||
#define CFGTOKEN_REVISION 0x0001434E // "RV\xXX\x00"
|
||||
|
||||
#define CFGTOKEN_MODE_VGA 0x0000564D // "MV\x00\x00" VGA
|
||||
#define CFGTOKEN_MODE_PCPI 0x00005A4D // "MZ\x00\x00" PCPI Applicard
|
||||
#define CFGTOKEN_MODE_SER 0x0000534D // "MS\x00\x00" Serial
|
||||
#define CFGTOKEN_MODE_PAR 0x0000504D // "MP\x00\x00" Parallel
|
||||
#define CFGTOKEN_MODE_SNES 0x0000474D // "MG\x00\x00" SNESMAX
|
||||
#define CFGTOKEN_MODE_NET 0x0000454D // "ME\x00\x00" Ethernet
|
||||
#define CFGTOKEN_MODE_FILE 0x0000464D // "MF\x00\x00" Filesystem
|
||||
|
||||
#define CFGTOKEN_HOST_AUTO 0x00004148 // "HA\x00\x00" Autodetect
|
||||
#define CFGTOKEN_HOST_II 0x00003248 // "H2\x00\x00" II/II+
|
||||
#define CFGTOKEN_HOST_IIE 0x00004548 // "HE\x00\x00" IIe
|
||||
#define CFGTOKEN_HOST_IIGS 0x00004748 // "HG\x00\x00" IIgs
|
||||
#define CFGTOKEN_HOST_PRAVETZ 0x00005048 // "HP\x00\x00" Pravetz
|
||||
#define CFGTOKEN_HOST_BASIS 0x00004248 // "HB\x00\x00" Basis 108
|
||||
|
||||
#define CFGTOKEN_MUX_LOOP 0x00004C53 // "SL\x00\x00" Serial Loopback
|
||||
#define CFGTOKEN_MUX_UART 0x00005353 // "SS\x00\x00" UART
|
||||
#define CFGTOKEN_MUX_USB 0x00005553 // "SU\x00\x00" USB CDC
|
||||
#define CFGTOKEN_MUX_WIFI 0x00005753 // "SW\x00\x00" WiFi Modem
|
||||
#define CFGTOKEN_MUX_PRN 0x00005053 // "SP\x00\x00" WiFi Printer
|
||||
#define CFGTOKEN_SER_BAUD 0x02004253 // "SB\x00\x01" Serial Baudrate Divisor
|
||||
|
||||
#define CFGTOKEN_USB_HOST 0x00004855 // "UH\x00\x00" USB CDC Host
|
||||
#define CFGTOKEN_USB_GUEST 0x00004755 // "UG\x00\x00" USB CDC Guest Device
|
||||
#define CFGTOKEN_USB_MIDI 0x00004D55 // "UM\x00\x00" USB MIDI Guest Device
|
||||
|
||||
#define CFGTOKEN_WIFI_AP 0x00004157 // "WA\x00\x00" WiFi AP
|
||||
#define CFGTOKEN_WIFI_CL 0x00004357 // "WC\x00\x00" WiFi Client
|
||||
|
||||
#define CFGTOKEN_WIFI_SSID 0x00005357 // "WS\x00\xSS" WiFi SSID
|
||||
#define CFGTOKEN_WIFI_PSK 0x00005057 // "WP\x00\xSS" WiFi PSK
|
||||
|
||||
#define CFGTOKEN_WIFI_IP 0x04004957 // "WI\x00\xSS" WiFi IP
|
||||
#define CFGTOKEN_WIFI_NM 0x04004E57 // "WN\x00\xSS" WiFi Netmask
|
||||
|
||||
#define CFGTOKEN_JD_HOST 0x0000484A // "JH\x00\x01" JetDirect Hostname
|
||||
#define CFGTOKEN_JD_PORT 0x0200444A // "JD\x00\x01" JetDirect Port
|
||||
|
||||
#define CFGTOKEN_MONO_00 0x00005056 // "VP\x00\x00" Full Color Video
|
||||
#define CFGTOKEN_MONO_80 0x00805056 // "VP\x80\x00" B&W Video
|
||||
#define CFGTOKEN_MONO_90 0x00905056 // "VP\x90\x00" B&W Inverse
|
||||
#define CFGTOKEN_MONO_A0 0x00A05056 // "VP\xA0\x00" Amber
|
||||
#define CFGTOKEN_MONO_B0 0x00B05056 // "VP\xB0\x00" Amber Inverse
|
||||
#define CFGTOKEN_MONO_C0 0x00C05056 // "VP\xC0\x00" Green
|
||||
#define CFGTOKEN_MONO_D0 0x00D05056 // "VP\xD0\x00" Green Inverse
|
||||
#define CFGTOKEN_MONO_E0 0x00E05056 // "VP\xE0\x00" C64
|
||||
#define CFGTOKEN_MONO_F0 0x00F05056 // "VP\xF0\x00" Custom
|
||||
|
||||
#define CFGTOKEN_TBCOLOR 0x00005456 // "VT\xXX\x00" Custom default TBCOLOR
|
||||
#define CFGTOKEN_BORDER 0x00004256 // "VB\xXX\x00" Custom default BORDER
|
1766
src/config.c
Normal file
1766
src/config.c
Normal file
File diff suppressed because it is too large
Load Diff
765
src/fontmgr.c
Normal file
765
src/fontmgr.c
Normal file
@ -0,0 +1,765 @@
|
||||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
#include "v2types.h"
|
||||
#include "v2loader.h"
|
||||
|
||||
#define PROGNAME "Font Manager"
|
||||
volatile uint16_t cardslot = 3;
|
||||
|
||||
#include "v2analog.h"
|
||||
#include "menu.h"
|
||||
|
||||
#if defined(__APPLE2ENH__)
|
||||
#define UP_ARROW 0xCB
|
||||
#define RIGHT_ARROW 0xD5
|
||||
#define DOWN_ARROW 0xCA
|
||||
#else
|
||||
#define UP_ARROW '^'
|
||||
#define RIGHT_ARROW ('>' | 0x80)
|
||||
#define DOWN_ARROW 'v'
|
||||
#endif
|
||||
|
||||
#define FONT_MAX 18
|
||||
|
||||
int selected_entry = 0;
|
||||
int top_entry = 0;
|
||||
int more_fonts = 0;
|
||||
int arrow_line = 0;
|
||||
int total_fonts = 0;
|
||||
int total_pages = 0;
|
||||
int line_count = 0;
|
||||
|
||||
DIR *fontdir;
|
||||
uint8_t fontbuffer[2048];
|
||||
uint8_t filebuffer[2048];
|
||||
char prefix[FILENAME_MAX];
|
||||
char pathname[FILENAME_MAX];
|
||||
char fontname[FILENAME_MAX];
|
||||
|
||||
void print_menu_item(char *str, int highlighted) {
|
||||
revers(highlighted);
|
||||
cputs(str);
|
||||
revers(0);
|
||||
}
|
||||
|
||||
void remove_font(uint16_t block) {
|
||||
backdrop(PROGNAME);
|
||||
window(" Please Wait ", 26, 6, 1);
|
||||
gotoy(11); gotox(13);
|
||||
cputs("Removing Font,");
|
||||
gotoy(12); gotox(8);
|
||||
cputs("your screen may flicker.");
|
||||
|
||||
if(cfg_cmd1("fe", block)) {
|
||||
backdrop(PROGNAME);
|
||||
message(" Error ", "Unable to erase block.");
|
||||
return;
|
||||
}
|
||||
|
||||
backdrop(PROGNAME);
|
||||
message(" Success ", "Block erased.");
|
||||
}
|
||||
|
||||
void upload_font(uint8_t *buffer) {
|
||||
backdrop(PROGNAME);
|
||||
window(" Please Wait ", 26, 6, 1);
|
||||
gotoy(11); gotox(13);
|
||||
cputs("Uploading font,");
|
||||
gotoy(12); gotox(8);
|
||||
cputs("your screen may flicker.");
|
||||
|
||||
if(cfg_cmd1("CT", (uint16_t)buffer)) {
|
||||
backdrop(PROGNAME);
|
||||
message(" Error ", "Communication Error");
|
||||
return;
|
||||
}
|
||||
|
||||
backdrop(PROGNAME);
|
||||
message(" Success ", "Font uploaded.");
|
||||
}
|
||||
|
||||
int write_font(uint8_t *buffer, uint16_t block) {
|
||||
int rv = 1;
|
||||
char dummy;
|
||||
uint16_t i;
|
||||
|
||||
backdrop(PROGNAME);
|
||||
window(" Please Wait ", 26, 6, 1);
|
||||
gotoy(11); gotox(13);
|
||||
cputs("Flashing font,");
|
||||
gotoy(12); gotox(8);
|
||||
cputs("your screen may flicker.");
|
||||
|
||||
dummy = *(volatile char*)0xCFFF;
|
||||
|
||||
for(i = 0; i < 4096; i++) {
|
||||
CF_DATA = buffer[i];
|
||||
}
|
||||
if(cfg_cmd1("fw", block)) {
|
||||
backdrop(PROGNAME);
|
||||
message(" Error ", "Unable to write block.");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
backdrop(PROGNAME);
|
||||
message(" Success ", "Font uploaded.");
|
||||
rv = 0;
|
||||
|
||||
cleanup:
|
||||
dummy = *(volatile char*)0xCFFF;
|
||||
return rv;
|
||||
}
|
||||
|
||||
int read_font(uint8_t *buffer, uint16_t block) {
|
||||
int rv = 1;
|
||||
char dummy;
|
||||
uint16_t i;
|
||||
|
||||
backdrop(PROGNAME);
|
||||
window(" Please Wait ", 26, 6, 1);
|
||||
gotoy(11); gotox(13);
|
||||
cputs("Retrieving font,");
|
||||
gotoy(12); gotox(8);
|
||||
cputs("your screen may flicker.");
|
||||
|
||||
dummy = *(volatile char*)0xCFFF;
|
||||
|
||||
if(cfg_cmd1("fr", block)) {
|
||||
backdrop(PROGNAME);
|
||||
message(" Error ", "Unable to read block.");
|
||||
goto cleanup;
|
||||
}
|
||||
for(i = 0; i < 4096; i++) {
|
||||
buffer[i] = CF_DATA;
|
||||
}
|
||||
|
||||
backdrop(PROGNAME);
|
||||
message(" Success ", "Font downloaded.");
|
||||
rv = 0;
|
||||
|
||||
cleanup:
|
||||
dummy = *(volatile char*)0xCFFF;
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
typedef struct font_slot_s {
|
||||
char *entry;
|
||||
uint16_t block;
|
||||
} font_slot_t;
|
||||
|
||||
font_slot_t font_slot[] = {
|
||||
{ " 00 US (Enh) ", 0x00 },
|
||||
{ " 01 US (UnEnh) ", 0x01 },
|
||||
{ " 02 Clinton Turner V1 ", 0x02 },
|
||||
{ " 03 ReActiveMicro (Enh) ", 0x03 },
|
||||
{ " 04 Dan Paymar (Enh) ", 0x04 },
|
||||
{ " 05 Blippo Black (Enh) ", 0x05 },
|
||||
{ " 06 Byte (Enh) ", 0x06 },
|
||||
{ " 07 Colossal (Enh) ", 0x07 },
|
||||
{ " 08 Count (Enh) ", 0x08 },
|
||||
{ " 09 Flow (Enh) ", 0x09 },
|
||||
{ " 0A Gothic (Enh) ", 0x0a },
|
||||
{ " 0B Outline (Enh) ", 0x0b },
|
||||
{ " 0C PigFont (Enh) ", 0x0c },
|
||||
{ " 0D Pinocchio (Enh) ", 0x0d },
|
||||
{ " 0E Slant (Enh) ", 0x0e },
|
||||
{ " 0F Stop (Enh) ", 0x0f },
|
||||
|
||||
{ " 10 Euro (UnEnh) ", 0x10 },
|
||||
{ " 11 Euro (Enh) ", 0x11 },
|
||||
{ " 12 Clinton Turner V2 ", 0x12 },
|
||||
{ " 13 German (Enh) ", 0x13 },
|
||||
{ " 14 German (UnEnh) ", 0x14 },
|
||||
{ " 15 French (Enh) ", 0x15 },
|
||||
{ " 16 French (UnEnh) ", 0x16 },
|
||||
{ " 17 Hebrew (Enh) ", 0x17 },
|
||||
{ " 18 Hebrew (UnEnh) ", 0x18 },
|
||||
{ " 19 Apple II+ (Enh) ", 0x19 },
|
||||
{ " 1A Apple II+ (UnEnh) ", 0x1a },
|
||||
{ " 1B Katakana (Enh) ", 0x1b },
|
||||
{ " 1C Cyrillic (Enh) ", 0x1c },
|
||||
{ " 1D Greek (Enh) ", 0x1d },
|
||||
{ " 1E Esperanto (Enh) ", 0x1e },
|
||||
{ " 1F Videx (Enh) ", 0x1f },
|
||||
|
||||
{ " 20 Apple II/II+ ", 0x20 },
|
||||
{ " 21 Apple IIe ", 0x21 },
|
||||
{ " 22 Apple IIgs ", 0x22 },
|
||||
{ " 23 Pravetz ", 0x23 },
|
||||
{ " 24 Custom ", 0x24 },
|
||||
{ " 25 Custom ", 0x25 },
|
||||
{ " 26 Custom ", 0x26 },
|
||||
{ " 27 Custom ", 0x27 },
|
||||
};
|
||||
|
||||
uint8_t parsehex8(char *str) {
|
||||
uint8_t ch = 0;
|
||||
switch(str[0]) {
|
||||
case '0': case '1': case '2': case '3': case '4':
|
||||
case '5': case '6': case '7': case '8': case '9':
|
||||
ch = (str[0] - '0') << 4;
|
||||
break;
|
||||
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
|
||||
ch = (str[0] + 0xa - 'a') << 4;
|
||||
break;
|
||||
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
|
||||
ch = (str[0] + 0xA - 'A') << 4;
|
||||
break;
|
||||
}
|
||||
switch(str[1]) {
|
||||
case '0': case '1': case '2': case '3': case '4':
|
||||
case '5': case '6': case '7': case '8': case '9':
|
||||
ch |= (str[1] - '0');
|
||||
break;
|
||||
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
|
||||
ch |= (str[1] + 0xa - 'a');
|
||||
break;
|
||||
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
|
||||
ch |= (str[1] + 0xA - 'A');
|
||||
break;
|
||||
}
|
||||
return ch;
|
||||
}
|
||||
|
||||
int slot_menu() {
|
||||
int paint_menu = 2;
|
||||
int selected_slot = 0;
|
||||
int top = 0;
|
||||
int y, i;
|
||||
uint8_t block = parsehex8(fontname);
|
||||
|
||||
#if 0
|
||||
// Try to find a matching slot from our table
|
||||
for(i = 0; i < (sizeof(font_slot)/sizeof(font_slot_t)); i++) {
|
||||
if(block == font_slot[i].block) {
|
||||
selected_slot = i;
|
||||
top = (selected_slot / 15) * 15;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
while(paint_menu >= 0) {
|
||||
if(paint_menu == 2) {
|
||||
backdrop(PROGNAME);
|
||||
window(" Font Slot? ", 24, 17, 0);
|
||||
paint_menu = 1;
|
||||
}
|
||||
if(paint_menu > 0) {
|
||||
for(y = 0; y < 15; y++) {
|
||||
i = y+top;
|
||||
if(i < (sizeof(font_slot)/sizeof(font_slot_t))) {
|
||||
gotoy(5+y); gotox(9);
|
||||
print_menu_item(font_slot[i].entry, (selected_slot == i));
|
||||
} else {
|
||||
gotoy(5+y); gotox(9);
|
||||
repeatchar(' ', 22);
|
||||
}
|
||||
}
|
||||
|
||||
paint_menu = 0;
|
||||
}
|
||||
|
||||
switch(cgetc()) {
|
||||
case 0x08:
|
||||
case 0x0B:
|
||||
if(selected_slot > 0) {
|
||||
selected_slot--;
|
||||
if(selected_slot < top)
|
||||
top = (selected_slot / 15) * 15;
|
||||
}
|
||||
paint_menu = 1;
|
||||
break;
|
||||
case 0x0A:
|
||||
case 0x15:
|
||||
if(selected_slot < ((sizeof(font_slot)/sizeof(font_slot_t))-1)) {
|
||||
selected_slot++;
|
||||
if(selected_slot > top + 14)
|
||||
top = (selected_slot / 15) * 15;
|
||||
}
|
||||
paint_menu = 1;
|
||||
break;
|
||||
case 0x1B:
|
||||
return -1;
|
||||
case 0x0D:
|
||||
// Select
|
||||
return(selected_slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int action_menu_action(int action) {
|
||||
int selected_slot;
|
||||
switch(action) {
|
||||
case 0:
|
||||
upload_font(fontbuffer);
|
||||
return 2;
|
||||
case 1:
|
||||
selected_slot = slot_menu();
|
||||
if(selected_slot >= 0) {
|
||||
write_font(fontbuffer, font_slot[selected_slot].block);
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void action_menu(void) {
|
||||
int paint_menu = 2;
|
||||
int selected_action = 0;
|
||||
|
||||
while(paint_menu >= 0) {
|
||||
if(paint_menu == 2) {
|
||||
backdrop(PROGNAME);
|
||||
window(" Action? ", 18, 7, 0);
|
||||
paint_menu = 1;
|
||||
}
|
||||
if(paint_menu > 0) {
|
||||
gotoy(11); gotox(13);
|
||||
revers(selected_action == 0);
|
||||
cputs(" Test ");
|
||||
|
||||
gotoy(13); gotox(13);
|
||||
revers(selected_action == 1);
|
||||
cputs(" Install ");
|
||||
|
||||
revers(0);
|
||||
paint_menu = 0;
|
||||
}
|
||||
|
||||
switch(cgetc()) {
|
||||
case 'T':
|
||||
case 't':
|
||||
paint_menu = action_menu_action(selected_action = 0);
|
||||
break;
|
||||
case 'I':
|
||||
case 'i':
|
||||
paint_menu = action_menu_action(selected_action = 1);
|
||||
break;
|
||||
case 0x08:
|
||||
case 0x0A:
|
||||
case 0x0B:
|
||||
case 0x15:
|
||||
selected_action = !selected_action;
|
||||
paint_menu = 1;
|
||||
break;
|
||||
case 0x1B:
|
||||
return;
|
||||
case 0x0D:
|
||||
// Select
|
||||
paint_menu = action_menu_action(selected_action);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int open_fontdir(void) {
|
||||
struct dirent *ent;
|
||||
char *ext;
|
||||
|
||||
fontdir = opendir ("FONTS");
|
||||
if(fontdir == NULL) {
|
||||
fontdir = opendir (".");
|
||||
prefix[0] = 0;
|
||||
} else {
|
||||
strcpy(prefix, "FONTS/");
|
||||
}
|
||||
|
||||
if(fontdir == NULL)
|
||||
return 0;
|
||||
|
||||
total_fonts = 0;
|
||||
|
||||
while (ent = readdir(fontdir)) {
|
||||
ext = strrchr (ent->d_name, '.');
|
||||
if (!ext || (strcasecmp (ext, ".pf") && strcasecmp (ext, ".cf")))
|
||||
continue;
|
||||
total_fonts++;
|
||||
}
|
||||
|
||||
total_pages = (total_fonts - 1) / FONT_MAX;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int load_font(void) {
|
||||
struct dirent *ent;
|
||||
char *ext;
|
||||
int current_entry = 0;
|
||||
FILE *f;
|
||||
uint8_t ch, last = 0;
|
||||
uint16_t i, o, len;
|
||||
|
||||
backdrop(PROGNAME);
|
||||
gotoy(12); gotox(14);
|
||||
cputs("Loading Font");
|
||||
|
||||
rewinddir(fontdir);
|
||||
while (ent = readdir(fontdir)) {
|
||||
ext = strrchr (ent->d_name, '.');
|
||||
if (!ext || (strcasecmp (ext, ".pf") && strcasecmp (ext, ".cf")))
|
||||
continue;
|
||||
|
||||
// Seek to first entry on the screen
|
||||
if(current_entry < selected_entry) {
|
||||
current_entry++;
|
||||
continue;
|
||||
}
|
||||
|
||||
strcpy(pathname, prefix);
|
||||
strcat(pathname, ent->d_name);
|
||||
strcpy(fontname, ent->d_name);
|
||||
|
||||
// Pixel Font
|
||||
if(!strcasecmp (ext, ".pf")) {
|
||||
f = fopen(pathname, "rb");
|
||||
if(f == NULL) {
|
||||
backdrop(PROGNAME);
|
||||
gotoy(4); gotox(2);
|
||||
cputs(pathname);
|
||||
message(" Error ", "Unable to open font file.");
|
||||
return 0;
|
||||
}
|
||||
fread(fontbuffer, 512, 4, f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// XOR & RLE Compressed Font
|
||||
if(!strcasecmp (ext, ".cf")) {
|
||||
f = fopen(pathname, "rb");
|
||||
if(f == NULL) {
|
||||
backdrop(PROGNAME);
|
||||
gotoy(4); gotox(2);
|
||||
cputs(pathname);
|
||||
message(" Error ", "Unable to open font file.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Get base font name
|
||||
strcpy(pathname, prefix);
|
||||
fread(pathname + strlen(prefix), 1, 16, f);
|
||||
pathname[strlen(prefix)+15] = 0;
|
||||
|
||||
fread(filebuffer, 512, 4, f);
|
||||
fclose(f);
|
||||
|
||||
// Undo the RLE compression
|
||||
i = 0;
|
||||
o = 0;
|
||||
while(o < 2048) {
|
||||
ch = filebuffer[i++];
|
||||
if(ch & 0x80) {
|
||||
ch = (ch & 0x7f) ? (ch & 0x7f) : 128;
|
||||
len = longmin(ch, (2048-o));
|
||||
memset(fontbuffer+o, last, len);
|
||||
o += len;
|
||||
} else {
|
||||
fontbuffer[o++] = ch;
|
||||
last = ch;
|
||||
}
|
||||
}
|
||||
|
||||
// If this font is XOR'ed with a base font, undo that now.
|
||||
if(strlen(pathname) != strlen(prefix)) {
|
||||
f = fopen(pathname, "rb");
|
||||
if(f == NULL) {
|
||||
backdrop(PROGNAME);
|
||||
gotoy(4); gotox(2);
|
||||
cputs(pathname);
|
||||
message(" Error ", "Unable to open base font.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
fread(filebuffer, 512, 4, f);
|
||||
fclose(f);
|
||||
|
||||
i = 0;
|
||||
while(i < 2048) {
|
||||
fontbuffer[i++] ^= filebuffer[i++];
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int save_font(char *filename) {
|
||||
int current_entry = 0;
|
||||
FILE *f;
|
||||
|
||||
strcpy(pathname, prefix);
|
||||
strcat(pathname, filename);
|
||||
|
||||
f = fopen(pathname, "wb");
|
||||
if(f == NULL) {
|
||||
backdrop(PROGNAME);
|
||||
message(" Error ", "Unable to open font file.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
backdrop(PROGNAME);
|
||||
gotoy(12); gotox(14);
|
||||
cputs("Saving Font");
|
||||
|
||||
fwrite(fontbuffer, 512, 4, f);
|
||||
|
||||
fclose(f);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void index_fonts(void) {
|
||||
struct dirent *ent;
|
||||
char *ext;
|
||||
int current_entry = 0;
|
||||
|
||||
rewinddir(fontdir);
|
||||
|
||||
backdrop(PROGNAME);
|
||||
line_count = 0;
|
||||
if(top_entry > 0) {
|
||||
gotoy(2); gotox(1);
|
||||
cputc(UP_ARROW);
|
||||
}
|
||||
while (ent = readdir(fontdir)) {
|
||||
ext = strrchr (ent->d_name, '.');
|
||||
if (!ext || (strcasecmp (ext, ".pf") && strcasecmp (ext, ".cf")))
|
||||
continue;
|
||||
|
||||
// Seek to first entry on the screen
|
||||
if(current_entry < top_entry) {
|
||||
current_entry++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(line_count < FONT_MAX) {
|
||||
gotoy(3+line_count);
|
||||
if(current_entry == selected_entry) {
|
||||
gotox(1);
|
||||
cputc(RIGHT_ARROW);
|
||||
arrow_line = 3+line_count;
|
||||
}
|
||||
gotox(3);
|
||||
printlimited(ent->d_name, 32);
|
||||
cputs("\r\n");
|
||||
current_entry++;
|
||||
line_count++;
|
||||
}
|
||||
}
|
||||
|
||||
more_fonts = (total_fonts > current_entry);
|
||||
if(more_fonts) {
|
||||
gotoy(21); gotox(1);
|
||||
cputc(DOWN_ARROW);
|
||||
}
|
||||
}
|
||||
|
||||
int select_font(void) {
|
||||
for(;;) {
|
||||
switch(cgetc()) {
|
||||
case 0x0D:
|
||||
// Select
|
||||
if(load_font()) {
|
||||
action_menu();
|
||||
}
|
||||
return 1;
|
||||
case 'T':
|
||||
case 't':
|
||||
if(load_font()) {
|
||||
upload_font(fontbuffer);
|
||||
}
|
||||
return 1;
|
||||
case 'I':
|
||||
case 'i':
|
||||
if(load_font()) {
|
||||
int selected_slot = slot_menu();
|
||||
if(selected_slot >= 0) {
|
||||
write_font(fontbuffer, font_slot[selected_slot].block);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
case 0x08:
|
||||
case 0x0B:
|
||||
// Left (UP)
|
||||
if(selected_entry > 0) {
|
||||
selected_entry--;
|
||||
}
|
||||
if(selected_entry < 0) {
|
||||
selected_entry = 0;
|
||||
}
|
||||
|
||||
// Entry is on the same page, don't re-read the disk directory
|
||||
if((selected_entry >= top_entry) && (selected_entry < (top_entry + line_count))) {
|
||||
gotoy(arrow_line); gotox(1);
|
||||
cputc(' ');
|
||||
|
||||
arrow_line = 3+(selected_entry - top_entry);
|
||||
gotoy(arrow_line); gotox(1);
|
||||
cputc(RIGHT_ARROW);
|
||||
break;
|
||||
} else {
|
||||
// Entry is on another page, re-read the disk directory
|
||||
top_entry = (selected_entry / FONT_MAX) * FONT_MAX;
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
case 0x0A:
|
||||
case 0x15:
|
||||
// Right (DOWN)
|
||||
if(selected_entry < (total_fonts - 1)) {
|
||||
selected_entry++;
|
||||
}
|
||||
if(selected_entry >= total_fonts) {
|
||||
selected_entry = total_fonts - 1;
|
||||
}
|
||||
|
||||
// Entry is on the same page, don't re-read the disk directory
|
||||
if((selected_entry >= top_entry) && (selected_entry < (top_entry + line_count))) {
|
||||
gotoy(arrow_line); gotox(1);
|
||||
cputc(' ');
|
||||
|
||||
arrow_line = 3+(selected_entry - top_entry);
|
||||
gotoy(arrow_line); gotox(1);
|
||||
cputc(RIGHT_ARROW);
|
||||
break;
|
||||
} else {
|
||||
// Entry is on another page, re-read the disk directory
|
||||
top_entry = (selected_entry / FONT_MAX) * FONT_MAX;
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
case 0x1B:
|
||||
// Abort
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void browse_fonts(void) {
|
||||
if(!open_fontdir()) {
|
||||
backdrop(PROGNAME);
|
||||
message(" Error ", "Unable to open font folder.");
|
||||
return;
|
||||
}
|
||||
|
||||
do {
|
||||
index_fonts();
|
||||
} while(select_font());
|
||||
closedir(fontdir);
|
||||
}
|
||||
|
||||
int main_menu_action(int action) {
|
||||
int selected_slot;
|
||||
|
||||
switch(action) {
|
||||
case 0:
|
||||
browse_fonts();
|
||||
return 2;
|
||||
case 1:
|
||||
memset(fontname, 0, sizeof(fontname));
|
||||
selected_slot = slot_menu();
|
||||
if(selected_slot >= 0) {
|
||||
read_font(fontbuffer, font_slot[selected_slot].block);
|
||||
//save_font(font_slot[selected_slot].diskname);
|
||||
}
|
||||
return 2;
|
||||
case 2:
|
||||
memset(fontname, 0, sizeof(fontname));
|
||||
selected_slot = slot_menu();
|
||||
if(selected_slot >= 0) {
|
||||
remove_font(font_slot[selected_slot].block);
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void main_menu(void) {
|
||||
int paint_menu = 2;
|
||||
int selected_action = 0;
|
||||
|
||||
for(;;) {
|
||||
if(paint_menu == 2) {
|
||||
backdrop(PROGNAME);
|
||||
window(" Main Menu ", 24, 7, 0);
|
||||
paint_menu = 1;
|
||||
}
|
||||
if(paint_menu > 0) {
|
||||
gotoy(10); gotox(9);
|
||||
revers(selected_action == 0);
|
||||
cputs(" Browse fonts ");
|
||||
|
||||
gotoy(12); gotox(9);
|
||||
revers(selected_action == 1);
|
||||
cputs(" Download stored font ");
|
||||
|
||||
gotoy(14); gotox(9);
|
||||
revers(selected_action == 2);
|
||||
cputs(" Remove stored font ");
|
||||
|
||||
revers(0);
|
||||
paint_menu = 0;
|
||||
}
|
||||
|
||||
switch(cgetc()) {
|
||||
case 'B':
|
||||
case 'b':
|
||||
paint_menu = main_menu_action(selected_action = 0);
|
||||
break;
|
||||
case 'D':
|
||||
case 'd':
|
||||
paint_menu = main_menu_action(selected_action = 1);
|
||||
break;
|
||||
case 'R':
|
||||
case 'r':
|
||||
paint_menu = main_menu_action(selected_action = 2);
|
||||
break;
|
||||
case 0x08:
|
||||
case 0x0B:
|
||||
if(selected_action > 0)
|
||||
selected_action--;
|
||||
paint_menu = 1;
|
||||
break;
|
||||
case 0x0A:
|
||||
case 0x15:
|
||||
if(selected_action < 2)
|
||||
selected_action++;
|
||||
paint_menu = 1;
|
||||
break;
|
||||
case 0x1B:
|
||||
if(confirm(" Are you sure? ", "Quit the Font Manager?"))
|
||||
return;
|
||||
|
||||
paint_menu = 2;
|
||||
break;
|
||||
case 0x0D:
|
||||
// Select
|
||||
paint_menu = main_menu_action(selected_action);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void main (void) {
|
||||
if(!prompt_slot(PROGNAME)) {
|
||||
exec("MENU.SYSTEM", "");
|
||||
return;
|
||||
}
|
||||
|
||||
backdrop(PROGNAME);
|
||||
gotoy(12); gotox(13);
|
||||
cputs("Indexing Fonts");
|
||||
|
||||
main_menu();
|
||||
clrscr();
|
||||
exec("MENU.SYSTEM", "");
|
||||
}
|
21
src/menu.c
21
src/menu.c
@ -32,6 +32,7 @@ typedef enum {
|
||||
} menu_type_t;
|
||||
|
||||
typedef struct menu_s {
|
||||
int enabled;
|
||||
menu_type_t type;
|
||||
char *entry;
|
||||
char *filename_enhanced;
|
||||
@ -40,17 +41,15 @@ typedef struct menu_s {
|
||||
} menu_t;
|
||||
|
||||
menu_t launcher[] = {
|
||||
{ MENU_LAUNCH_NOCHECKARGS, " Config Utility ", "CONFIG.ENH", "CONFIG.BASE", "" },
|
||||
{ MENU_LAUNCH_NOCHECKARGS, " Font Manager ", "FONTMGR.ENH", "FONTMGR.BASE", "" },
|
||||
{ MENU_LAUNCH_CHECKARGS, " Theme Chooser ", "BASIC.SYSTEM", "BASIC.SYSTEM", "THEMES.BAS" },
|
||||
{ MENU_LAUNCH_NOCHECKARGS, " Format Utility ", "FORMAT.ENH", "FORMAT.BASE", "" },
|
||||
{ MENU_LAUNCH_NOCHECKARGS, " Config Remover ", "RMCFG.ENH", "RMCFG.BASE", "" },
|
||||
{ MENU_LAUNCH_NOCHECKARGS, " One-time VGA Tool ", "OTVGA.ENH", "OTVGA.BASE", "" },
|
||||
{ MENU_SEPARATOR, NULL, NULL, NULL, NULL },
|
||||
{ MENU_LAUNCH_NOCHECKARGS, " Applesoft Basic ", "BASIC.SYSTEM", "BASIC.SYSTEM", "" },
|
||||
{ MENU_SEPARATOR, NULL, NULL, NULL, NULL },
|
||||
{ MENU_EXIT, " Exit ", NULL, NULL, NULL },
|
||||
{ MENU_TERMINATOR, NULL, NULL, NULL, NULL },
|
||||
{ 0, MENU_LAUNCH_NOCHECKARGS, " Config Utility ", "CONFIG.ENH", "CONFIG.BASE", "" },
|
||||
{ 0, MENU_LAUNCH_NOCHECKARGS, " Font Manager ", "FONTMGR.ENH", "FONTMGR.BASE", "" },
|
||||
{ 0, MENU_SEPARATOR, NULL, NULL, NULL, NULL },
|
||||
{ 0, MENU_LAUNCH_NOCHECKARGS, " Applesoft Basic ", "BASIC.SYSTEM", "BASIC.SYSTEM", "" },
|
||||
{ 0, MENU_LAUNCH_NOCHECKARGS, " ADTPRO ", "ADTPRO/ADTPRO", "ADTPRO/ADTPRO", "" },
|
||||
{ 0, MENU_LAUNCH_NOCHECKARGS, " VSDRIVE ", "VDRIVE/VSDRIVE", "VDRIVE/VSDRIVE", "" },
|
||||
{ 0, MENU_SEPARATOR, NULL, NULL, NULL, NULL },
|
||||
{ 1, MENU_EXIT, " Exit ", NULL, NULL, NULL },
|
||||
{ 0, MENU_TERMINATOR, NULL, NULL, NULL, NULL },
|
||||
};
|
||||
|
||||
int main_menu_action(int action) {
|
||||
|
110
src/v2analog.h
110
src/v2analog.h
@ -52,64 +52,14 @@ typedef enum {
|
||||
WIFI_AP,
|
||||
} wifimode_t;
|
||||
|
||||
#define FS_COMMAND CARD_REGISTER(0x0)
|
||||
#define FS_FILE CARD_REGISTER(0x1)
|
||||
#define FS_FLAGS CARD_REGISTER(0x1)
|
||||
#define FS_SIZELSB CARD_REGISTER(0x2)
|
||||
#define FS_SIZEMSB CARD_REGISTER(0x3)
|
||||
#define FS_OFFLSB CARD_REGISTER(0x2)
|
||||
#define FS_OFFMSB CARD_REGISTER(0x3)
|
||||
#define FS_WHENCE CARD_REGISTER(0x4)
|
||||
#define FS_BUSY CARD_REGISTER(0xD)
|
||||
#define FS_STATUS CARD_REGISTER(0xE)
|
||||
#define FS_EXECUTE CARD_REGISTER(0xF)
|
||||
|
||||
#define FS_O_RDONLY 0x0001
|
||||
#define FS_O_WRONLY 0x0002
|
||||
#define FS_O_RDWR 0x0003
|
||||
#define FS_O_CREAT 0x0100
|
||||
#define FS_O_EXCL 0x0200
|
||||
#define FS_O_TRUNC 0x0400
|
||||
#define FS_O_APPEND 0x0800
|
||||
|
||||
#define FS_SEEK_SET 0
|
||||
#define FS_SEEK_CUR 1
|
||||
#define FS_SEEK_END 2
|
||||
|
||||
typedef enum {
|
||||
FS_OPEN = 0x10,
|
||||
FS_CLOSE = 0x11,
|
||||
FS_READ = 0x12,
|
||||
FS_WRITE = 0x13,
|
||||
FS_SEEK = 0x14,
|
||||
FS_TELL = 0x15,
|
||||
} fscommand_t;
|
||||
|
||||
typedef enum {
|
||||
FS_ERR_OK = 0, // No error
|
||||
FS_ERR_IO = -1, // Error during device operation
|
||||
FS_ERR_CORRUPT = -2, // Corrupted
|
||||
FS_ERR_NOENT = -3, // No directory entry
|
||||
FS_ERR_EXIST = -4, // Entry already exists
|
||||
FS_ERR_NOTDIR = -5, // Entry is not a dir
|
||||
FS_ERR_ISDIR = -5, // Entry is a dir
|
||||
FS_ERR_NOTEMPTY = -7, // Dir is not empty
|
||||
FS_ERR_BADF = -8, // Bad file number
|
||||
FS_ERR_FBIG = -9, // File too large
|
||||
FS_ERR_INVAL = -10, // Invalid parameter
|
||||
FS_ERR_NOSPC = -11, // No space left on device
|
||||
FS_ERR_NOMEM = -12, // No more memory available
|
||||
FS_ERR_NOATTR = -13, // No data/attr available
|
||||
FS_ERR_NAMETOOLONG = -14 // File name too long
|
||||
} fserror_t;
|
||||
|
||||
typedef enum {
|
||||
MACHINE_AUTO = 0,
|
||||
MACHINE_APPLE_II = 1,
|
||||
MACHINE_APPLE_IIE = 2,
|
||||
MACHINE_APPLE_IIGS = 3,
|
||||
MACHINE_PRAVETZ = 4,
|
||||
MACHINE_MAXVALUE = 5
|
||||
MACHINE_BASIS = 5,
|
||||
MACHINE_MAXVALUE = 6
|
||||
} compat_t;
|
||||
|
||||
void hexprint(volatile uint8_t *buf, int size) {
|
||||
@ -171,60 +121,4 @@ int cfg_cmd0(char *cmd) {
|
||||
return cfg_cmd3(cmd, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#define NEWCONFIG_MAGIC 0x0001434E // "NC\x01\x00"
|
||||
|
||||
#define CFGTOKEN_MODE_VGA 0x0000564D // "MV\x00\x00" VGA
|
||||
#define CFGTOKEN_MODE_PCPI 0x00005A4D // "MZ\x00\x00" PCPI Applicard
|
||||
#define CFGTOKEN_MODE_SER 0x0000534D // "MS\x00\x00" Serial
|
||||
#define CFGTOKEN_MODE_PAR 0x0000504D // "MP\x00\x00" Parallel
|
||||
#define CFGTOKEN_MODE_SNES 0x0000474D // "MG\x00\x00" SNESMAX
|
||||
#define CFGTOKEN_MODE_MIDI 0x00004D4D // "MM\x00\x00" SNESMAX
|
||||
#define CFGTOKEN_MODE_NET 0x0000454D // "ME\x00\x00" Ethernet
|
||||
#define CFGTOKEN_MODE_FILE 0x0000464D // "MF\x00\x00" Filesystem
|
||||
|
||||
#define CFGTOKEN_HOST_AUTO 0x00004148 // "HA\x00\x00" Autodetect
|
||||
#define CFGTOKEN_HOST_II 0x00003248 // "H2\x00\x00" II/II+
|
||||
#define CFGTOKEN_HOST_IIE 0x00004548 // "HE\x00\x00" IIe
|
||||
#define CFGTOKEN_HOST_IIGS 0x00004748 // "HG\x00\x00" IIgs
|
||||
#define CFGTOKEN_HOST_PRAVETZ 0x00005048 // "HP\x00\x00" Pravetz
|
||||
|
||||
#define CFGTOKEN_MUX_LOOP 0x00004C53 // "SL\x00\x00" Serial Loopback
|
||||
#define CFGTOKEN_MUX_USB 0x00005553 // "SU\x00\x00" USB CDC
|
||||
#define CFGTOKEN_MUX_WIFI 0x00005753 // "SW\x00\x00" WiFi Modem
|
||||
#define CFGTOKEN_MUX_PRN 0x00005053 // "SP\x00\x00" WiFi Printer
|
||||
#define CFGTOKEN_SER_BAUD 0x02004253 // "SB\x00\x00" Serial Baudrate
|
||||
|
||||
#define CFGTOKEN_USB_HOST 0x00004855 // "UH\x00\x00" USB CDC Host
|
||||
#define CFGTOKEN_USB_GUEST 0x00004755 // "UG\x00\x00" USB CDC Guest Device
|
||||
#define CFGTOKEN_USB_MIDI 0x00004D55 // "UM\x00\x00" USB MIDI Guest Device
|
||||
|
||||
#define CFGTOKEN_WIFI_AP 0x00004157 // "WA\x00\x00" WiFi AP
|
||||
#define CFGTOKEN_WIFI_CL 0x00004357 // "WC\x00\x00" WiFi Client
|
||||
|
||||
#define CFGTOKEN_WIFI_SSID 0x00005357 // "WS\x00\xSS" WiFi SSID
|
||||
#define CFGTOKEN_WIFI_PSK 0x00005057 // "WS\x00\xSS" WiFi PSK
|
||||
|
||||
#define CFGTOKEN_WIFI_IP 0x04504957 // "WIP\xSS" WiFi IP
|
||||
#define CFGTOKEN_WIFI_NM 0x044D4E57 // "WNM\xSS" WiFi Netmask
|
||||
|
||||
#define CFGTOKEN_JD_HOST 0x0000484A // "JH\x00\x01" JetDirect Hostname
|
||||
#define CFGTOKEN_JD_PORT 0x0200444A // "JD\x00\x01" JetDirect Port
|
||||
|
||||
#define CFGTOKEN_MONO_00 0x00005056 // "VP\x00\x00" Full Color Video
|
||||
#define CFGTOKEN_MONO_80 0x00805056 // "VP\x80\x00" B&W Video
|
||||
#define CFGTOKEN_MONO_90 0x00905056 // "VP\x90\x00" B&W Inverse
|
||||
#define CFGTOKEN_MONO_A0 0x00A05056 // "VP\xA0\x00" Amber
|
||||
#define CFGTOKEN_MONO_B0 0x00B05056 // "VP\xB0\x00" Amber Inverse
|
||||
#define CFGTOKEN_MONO_C0 0x00C05056 // "VP\xC0\x00" Green
|
||||
#define CFGTOKEN_MONO_D0 0x00D05056 // "VP\xD0\x00" Green Inverse
|
||||
#define CFGTOKEN_MONO_E0 0x00E05056 // "VP\xE0\x00" C64
|
||||
#define CFGTOKEN_MONO_F0 0x00F05056 // "VP\xF0\x00" Custom
|
||||
|
||||
#define CFGTOKEN_TBCOLOR 0x00005456 // "VT\xXX\x00" Custom default TBCOLOR
|
||||
#define CFGTOKEN_BORDER 0x00004256 // "VB\xXX\x00" Custom default BORDER
|
||||
|
||||
|
||||
#endif /* __V2ANALOG_H */
|
||||
|
Loading…
Reference in New Issue
Block a user