init files
194
loader/samples/minexample/Makefile
Normal file
|
|
@ -0,0 +1,194 @@
|
|||
|
||||
ifeq ($(PLATFORM),)
|
||||
_PLATFORM_ = c64
|
||||
else ifeq ($(PLATFORM),c116)
|
||||
_PLATFORM_ = c16
|
||||
else ifeq ($(PLATFORM),plus4)
|
||||
_PLATFORM_ = c16
|
||||
else
|
||||
_PLATFORM_ = $(PLATFORM)
|
||||
endif
|
||||
|
||||
ifeq ($(NO_VICE),)
|
||||
NO_VICE = 0
|
||||
endif
|
||||
|
||||
|
||||
ifneq ($(_PLATFORM_),c64)
|
||||
ifneq ($(_PLATFORM_),c128)
|
||||
ifneq ($(_PLATFORM_),c16)
|
||||
$(error invalid platform $(_PLATFORM_) specified)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
ARCH = $(shell uname | tr "[a-z]" "[A-Z]" | tr -c -d "[A-Z]")
|
||||
|
||||
ifneq ($(findstring CYGWINNT,$(ARCH)),)
|
||||
ifeq (CYGWINNT,$(ARCH))
|
||||
ARCH = WIN32
|
||||
else
|
||||
ARCH = WIN64
|
||||
endif
|
||||
endif
|
||||
ifneq ($(findstring DARWIN,$(ARCH)),)
|
||||
ARCH = MACOSX
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(_PLATFORM_),c16)
|
||||
ifneq ($(NO_VICE),0)
|
||||
ifneq ($(findstring WIN,$(ARCH)),)
|
||||
USE_PLUS4EMU = 0
|
||||
USE_YAPE = 1
|
||||
else
|
||||
USE_PLUS4EMU = 1
|
||||
USE_YAPE = 0
|
||||
endif
|
||||
else
|
||||
USE_PLUS4EMU = 0
|
||||
USE_YAPE = 0
|
||||
endif
|
||||
else
|
||||
USE_PLUS4EMU = 0
|
||||
USE_YAPE = 0
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(_PLATFORM_),c16)
|
||||
ifeq ($(ARCH),MACOSX)
|
||||
# MacOSX, these programs must be installed as applications
|
||||
VICE = xplus4
|
||||
PLUS4EMU = open /Applications/plus4emu.app --args
|
||||
else
|
||||
VICE = xplus4
|
||||
PLUS4EMU = plus4emu
|
||||
ifeq ($(ARCH),WIN64)
|
||||
YAPE = YapeWin64
|
||||
else
|
||||
YAPE = Yape
|
||||
endif
|
||||
endif
|
||||
else
|
||||
ifeq ($(_PLATFORM_),c128)
|
||||
VICE = x128
|
||||
USE_VICE = 1
|
||||
else
|
||||
VICE = x64
|
||||
USE_VICE = 1
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(USE_VICE),1)
|
||||
EMU = $(VICE) -drive8type 1541 -drive9type 0 -autostart
|
||||
EMU71 = $(VICE) -drive8type 1571 -drive9type 0 -autostart
|
||||
else
|
||||
EMU = $(PLUS4EMU) -disk
|
||||
endif
|
||||
|
||||
|
||||
ECHO = echo
|
||||
PRINTF = printf
|
||||
|
||||
AS = cl65
|
||||
LD = ld65
|
||||
C1541 = c1541
|
||||
CC1541 = ../../tools/cc1541/cc1541
|
||||
|
||||
MKDIR = mkdir -p
|
||||
RM = rm -f
|
||||
ifeq ($(ARCH),MACOSX)
|
||||
RMDIR = rmdir # XXX TODO xargs to remove .DS_Store
|
||||
else
|
||||
RMDIR = rmdir
|
||||
endif
|
||||
CAT = cat
|
||||
|
||||
|
||||
.PHONY: default loader assemble diskimage run clean distclean wipe
|
||||
.PHONY: tellarch
|
||||
|
||||
|
||||
BUILDDIR = ../../build
|
||||
INTERMDIR = ../../build/intermediate
|
||||
LOADER_SRC = ../../src
|
||||
LOADER = $(BUILDDIR)/loader-$(_PLATFORM_).prg
|
||||
|
||||
RESOURCESDIR = ../resources
|
||||
|
||||
NAME = minexample
|
||||
|
||||
SOURCE = $(NAME).s
|
||||
LOADERCFG = loaderconfig.inc
|
||||
ASSEMBLE = $(INTERMDIR)/$(NAME)-uncompressed-$(_PLATFORM_).prg
|
||||
DISKIMAGE = $(BUILDDIR)/$(NAME)-$(_PLATFORM_).d64
|
||||
|
||||
AS_FLAGS = -Wa -I../../../shared -I ../../include -u __EXEHDR__
|
||||
|
||||
|
||||
default: diskimage
|
||||
|
||||
|
||||
tellarch:
|
||||
@$(ECHO) $(ARCH)
|
||||
|
||||
|
||||
loader: $(LOADER)
|
||||
|
||||
$(LOADER): $(LOADERCFG)
|
||||
make -C $(LOADER_SRC) EXTCONFIGPATH=../samples/$(NAME) PLATFORM=$(_PLATFORM_) INSTALL=1800 RESIDENT=1700 ZP=02 prg
|
||||
|
||||
|
||||
assemble: $(ASSEMBLE)
|
||||
|
||||
$(ASSEMBLE): $(SOURCE) $(LOADER) $(LOADERCFG)
|
||||
$(MKDIR) $(BUILDDIR)
|
||||
$(MKDIR) $(INTERMDIR)
|
||||
ifeq ($(_PLATFORM_),c64)
|
||||
$(AS) $(AS_FLAGS) -C c64-asm.cfg -Wa -DPLATFORM=64 -o $@ $<
|
||||
else ifeq ($(_PLATFORM_),c128)
|
||||
$(AS) $(AS_FLAGS) -t c128 -Wa -DPLATFORM=128 -o $@ $<
|
||||
else
|
||||
$(AS) $(AS_FLAGS) -t c16 -Wa -DPLATFORM=16 -o $@ $<
|
||||
endif
|
||||
|
||||
|
||||
diskimage: $(DISKIMAGE)
|
||||
|
||||
$(DISKIMAGE): $(ASSEMBLE)
|
||||
$(RM) $@
|
||||
$(CC1541) -n "ys2 intro" -i test \
|
||||
-f $(NAME) -w $< \
|
||||
-f "sid" -w sid.bin \
|
||||
-f "badguy" -w badguy.zx0.prg \
|
||||
$@
|
||||
|
||||
|
||||
ifneq ($(USE_YAPE),0)
|
||||
run: $(DISKIMAGE)
|
||||
$(YAPE) "..\..\build\$^"
|
||||
else
|
||||
run: $(DISKIMAGE)
|
||||
$(EMU) $(realpath $^)
|
||||
|
||||
run71: $(DISKIMAGE)
|
||||
$(EMU71) $(realpath $^)
|
||||
endif
|
||||
|
||||
$(INTERMDIR)/%.prg: $(RESOURCESDIR)/%.bin
|
||||
$(PRINTF) '\000\140' | $(CAT) - $? > $@ # octal 140 = hex 60
|
||||
|
||||
|
||||
clean:
|
||||
-$(RM) *.o $(ASSEMBLE) $(DISKIMAGE)
|
||||
-$(RM) -rf $(INTERMDIR)
|
||||
-$(RM) $(BUILDDIR)/loader-c64.prg
|
||||
-$(RM) $(BUILDDIR)/loader-c128.prg
|
||||
-$(RM) $(BUILDDIR)/loader-c16.prg
|
||||
-$(RMDIR) $(BUILDDIR)
|
||||
|
||||
distclean:
|
||||
-$(MAKE) -C $(LOADER_SRC) clean
|
||||
|
||||
wipe: distclean clean
|
||||
77
loader/samples/minexample/anim2cus.py
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
import sys
|
||||
f = list(open(sys.argv[1], "rb").read())[2:]
|
||||
|
||||
out = f[:(0x4711-0x2000)]
|
||||
|
||||
a = open(sys.argv[2],"r").read().split("\n")
|
||||
a = [x for x in a if x != ""]
|
||||
a = [x.split(",")[1] for x in a[:-1]]
|
||||
|
||||
frame = []
|
||||
frame_dict = {}
|
||||
|
||||
cnt = 0
|
||||
def append_frame(frame):
|
||||
global cnt
|
||||
if cnt < len(a):
|
||||
filename_csv = a[cnt]
|
||||
if filename_csv not in frame_dict:
|
||||
frame_dict[filename_csv] = []
|
||||
for d in frame:
|
||||
if d not in frame_dict[filename_csv]:
|
||||
frame_dict[filename_csv].append(d)
|
||||
else:
|
||||
print(cnt, len(a))
|
||||
cnt += 1
|
||||
|
||||
ptr = 0x4711-0x2000
|
||||
while ptr < len(f):
|
||||
num_chars = f[ptr]
|
||||
#print(ptr,len(f),num_chars)
|
||||
ptr += 1
|
||||
if num_chars == 0:
|
||||
delay = f[ptr]
|
||||
ptr += 1
|
||||
append_frame(frame)
|
||||
frame = []
|
||||
continue
|
||||
elif num_chars == 0xFF:
|
||||
append_frame(frame)
|
||||
break
|
||||
bitmap = (f[ptr]|(f[ptr+1]<<8))+0x2000
|
||||
ptr += 2
|
||||
screen = (f[ptr]|(f[ptr+1]<<8))+0x400
|
||||
cram = (f[ptr]|(f[ptr+1]<<8))+0xd800
|
||||
ptr += 2
|
||||
for i in range(num_chars):
|
||||
frame.append([bitmap,f[ptr:ptr+8]])
|
||||
ptr += 8
|
||||
frame.append([screen,f[ptr]])
|
||||
frame.append([cram,f[ptr+1]])
|
||||
ptr += 2
|
||||
bitmap += 8
|
||||
screen += 1
|
||||
cram += 1
|
||||
|
||||
out_pat_addr = len(out)
|
||||
out.extend([0]*(len(a)*3))
|
||||
|
||||
frame_dict_offs = []
|
||||
for i in frame_dict:
|
||||
frame_dict_offs.append(len(out))
|
||||
sort_dict = sorted([x for x in frame_dict[i]], key=lambda x : x[0])
|
||||
print(sort_dict)
|
||||
for j in sort_dict:
|
||||
out.append(j[0]&0xff)
|
||||
out.append(j[0]>>8&0xff)
|
||||
if type(j[1]) == list:
|
||||
out.extend(j[1])
|
||||
else:
|
||||
out.append(j[1])
|
||||
|
||||
#print(out)
|
||||
|
||||
print(hex(0x2000+len(out)))
|
||||
f = open(sys.argv[3],"wb")
|
||||
f.write(bytearray(out))
|
||||
f.close()
|
||||
BIN
loader/samples/minexample/badguy.bin
Normal file
BIN
loader/samples/minexample/badguy.prg
Normal file
BIN
loader/samples/minexample/badguy.zx0
Normal file
BIN
loader/samples/minexample/badguy.zx0.prg
Normal file
BIN
loader/samples/minexample/badguy_bi.bin
Normal file
BIN
loader/samples/minexample/badguy_no_prg.bin
Normal file
BIN
loader/samples/minexample/badguys_new.bin
Normal file
BIN
loader/samples/minexample/badguys_new.bin.bak
Executable file
4
loader/samples/minexample/c1541
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
export VICE_INITIAL_CWD="$(pwd)"
|
||||
export PROGRAM="c1541"
|
||||
"/Applications/vice-arm64-gtk3-3.9/VICE.app/Contents/Resources/script" "$@"
|
||||
3
loader/samples/minexample/conv_zx0.sh
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
zx02/zx02 badguys_new.bin badguy.zx0
|
||||
printf "\x00\xe0" > badguy.zx0.prg
|
||||
cat badguy.zx0 >> badguy.zx0.prg
|
||||
BIN
loader/samples/minexample/libopencbm.dylib
Normal file
131
loader/samples/minexample/loaderconfig.inc
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
|
||||
; configuration
|
||||
; set .defines to non-0 to enable the corresponding features
|
||||
|
||||
; see loader.inc for function calls and convenience macros
|
||||
|
||||
; parameters
|
||||
|
||||
.ifndef PLATFORM
|
||||
PLATFORM = diskio::platform::COMMODORE_64; available are COMMODORE_64, COMMODORE_128 and COMMODORE_16
|
||||
.endif
|
||||
|
||||
; parameter, this changes the host-side code only
|
||||
|
||||
DECOMPRESSOR = DECOMPRESSORS::NONE; available are NONE, BITNAX (recommended for demos), BYTEBOOZER2, DOYNAX_LZ, EXOMIZER (not recommended for demos), LEVELCRUSH, LZSA2 (recommended for demos), NUCRUNCH, PUCRUNCH, SUBSIZER, TINYCRUNCH (recommended for demos), TSCRUNCH (strongly recommended for demos), ZX0 (strongly recommended for demos)
|
||||
|
||||
|
||||
; features
|
||||
|
||||
; following settings are independent from the installed drive code, several host-side
|
||||
; resident binaries with different features may be used with the same installed drive code
|
||||
|
||||
|
||||
; basic features, different settings can be run with the same installed drive code, increase host-side code size
|
||||
|
||||
.define LOAD_COMPD_API 0 ; include the loadcompd routine to load and depack compressed files on the fly
|
||||
; requires DECOMPRESSOR != DECOMPRESSORS::NONE
|
||||
|
||||
.define LOAD_RAW_API 1 ; include the loadraw routine to load files without decompressing
|
||||
|
||||
.define NTSC_COMPATIBILITY 0 ; C-64/128 only: be able to run on both PAL and NTSC machines, this slightly decreases loading speed on PAL,
|
||||
; note that PAL vs. NTSC is not detected by the install routine, and no error is returned when running on an
|
||||
; NTSC machine with the NTSC_COMPATIBILITY option disabled: detect, then select either of both incarnations
|
||||
; of the resident portion (with and without NTSC support) for maximum speed with NTSC and PAL
|
||||
|
||||
.define PREFER_SPEED_OVER_SIZE 0 ; For TSCrunch or ZX0, use a bigger but potentially faster decompression routine
|
||||
|
||||
.define UNINSTALL_API 0 ; include an uninstallation routine
|
||||
|
||||
|
||||
; extended features, different settings can be run with the same installed drive code, increase host-side code size
|
||||
|
||||
.define FILE_EXISTS_API 0 ; include the fileexists call for simple multi-disk handling
|
||||
|
||||
.define LOAD_UNDER_D000_DFFF 0 ; C-64/128: enable loading (and decompression) to the RAM at $D000..$DFFF,
|
||||
; note that this does not slow down loading when not loading to RAM at $D000..$DFFF,
|
||||
; as there are two separate routines to load data (one regular, the other to RAM at $D000..$DFFF).
|
||||
; the IRQ handlers will need to change $01 ($FF00 on C-128) to enable the I/O registers at $D000..$DFFF,
|
||||
; so make sure the IRQ handlers restore the $01 status on C-64 to the value as when they are called.
|
||||
; the IRQs must run via $FFFE/F, since the ROM is disabled when accessing the RAM at $D000-$DFFF
|
||||
; this is not needed when only memdecompressing to $D000..$DFFF (simply set $01 to $30 on C-64 and jsr memdecomp in that case)
|
||||
|
||||
.define ALLOW_2_MHZ_ON_C128 0 ; C-64 only: allow 2 MHz usage on C-128 in C-64 mode,
|
||||
; this does not increase raw loading speed but increases combined loading + decompression speed using loadcompd.
|
||||
; the clock is temporarily switched to 1 MHz while loading,
|
||||
; interrupt handlers changing the clock speed must restore it upon return to the mainline thread.
|
||||
|
||||
.define MEM_DECOMP_API 0 ; include a routine for memory decompression, that is, loading and decompression can be separated.
|
||||
; C-64: decompression to $D000..$DFFF need not have LOAD_UNDER_D000_DFFF enabled,
|
||||
; just enable 64 kB of RAM before jsr memdecomp.
|
||||
; requires DECOMPRESSOR != DECOMPRESSORS::NONE
|
||||
; this option does not implicitly turn on the LOAD_RAW_API
|
||||
|
||||
.define MEM_DECOMP_TO_API 0 ; if carry is set on decompression, the decompressor will use the address set in decdestlo/decdesthi as
|
||||
; decompression destination address and ignore the file's decompression address.
|
||||
; requires MEM_DECOMP_API != 0
|
||||
|
||||
.define LOAD_TO_API 0 ; if the carry flag is set on load, override load and decompression destination addresses.
|
||||
; load raw files: use the address set in loadaddrlo/loadaddrhi as absolute loading address
|
||||
; load compressed files: use relative loading address offset in loadaddroffslo/loadaddroffshi, it is added to the load/depack addresses
|
||||
|
||||
.define END_ADDRESS_API 0 ; during and after loading, the file's current and then final end address (address of last file byte + 1) is stored in
|
||||
; endaddrlo and endaddrhi. for loading compressed files using loadcompd, the end address of the compressed data is stored.
|
||||
; the file's loading address can be found in loadaddrlo/loadaddrhi during and after loading, so polling the current
|
||||
; difference of endaddrlo/hi and loadaddrlo/hi can be used to implement progress displays.
|
||||
|
||||
.define LOAD_VIA_KERNAL_FALLBACK 0 ; loads via the KERNAL API if drive code installation was not successful
|
||||
; (i.e., if it cannot installed due to an incompatible drive - possible if it is not
|
||||
; a 1541, 1541-C, 1541-II, 1541U, 1570, 1571, 1571CR, 1581, or FD2000/4000),
|
||||
; or true drive emulation being disabled.
|
||||
; note that this does not necessarily mean slow or non-IRQ loading, as custom KERNALs like JiffyDOS or IDEDOS
|
||||
; use the original KERNAL API as well.
|
||||
; the IRQ handlers can be delayed for some rasterlines up to several frames due to KERNAL routines
|
||||
; temporarily disabling IRQ (but that is unlikely for devices not using the serial bus).
|
||||
; for the sake of compatibility, only disable this option if the space is really needed.
|
||||
; C-64:
|
||||
; Attention: KERNAL, BASIC, and possible cartridge ROMs are enabled, so IRQ handlers are not
|
||||
; allowed in the ranges $8000..$BFFF and $D000..$FFFF.
|
||||
; Attention: KERNAL routines may execute CLI, so make sure to have valid IRQ vectors and handlers,
|
||||
; or disable all IRQ sources (not via SEI), also make sure to correctly handle the different
|
||||
; IRQ conditions when called via KERNAL vector ($0314) vs. non-KERNAL vector ($FFFE), both are possible -
|
||||
; best have KERNAL and BASIC enabled before calling the loader, so only the KERNAL vector IRQ handler is
|
||||
; needed (please note that the handler code is delayed a little when called via $0314 rather than $FFFE).
|
||||
; C-128:
|
||||
; Attention: System ROM is enabled, so IRQ handlers are not allowed in the range $C000..$FFFF.
|
||||
; Attention: KERNAL routines may execute CLI, so make sure to have valid IRQ vectors and handlers,
|
||||
; or disable all IRQ sources (not via SEI), also make sure to correctly handle the different
|
||||
; IRQ conditions when called via KERNAL vector ($0314) vs. non-KERNAL vector ($FFFE) - best have System ROM
|
||||
; enabled before calling the loader, so only the KERNAL vector IRQ handler is needed (please note that
|
||||
; the handler code is delayed a little when called via $0314 rather than $FFFE).
|
||||
; C-64/128:
|
||||
; Attention: KERNAL routines use CIA1 timer A ($DC04/5).
|
||||
; Plus/4:
|
||||
; Attention: The ROM space in the upper memory half is enabled, so IRQ handlers are not allowed
|
||||
; in the range $8000..$FFFF.
|
||||
; Attention: The ROM routines may execute CLI, so make sure to have valid IRQ vectors and handlers,
|
||||
; or disable all IRQ sources (not via SEI), also make sure to correctly handle the different
|
||||
; IRQ conditions when called via ROM vector ($0314) vs. non-ROM vector ($FFFE) - best have ROM enabled
|
||||
; before calling the loader, so only the ROM vector IRQ handler is needed (please note that
|
||||
; the handler code is delayed a little when being called via $0314 rather than $FFFE).
|
||||
; requires ONLY_1541_AND_COMPATIBLE = 0
|
||||
|
||||
.define CLOSE_FILE_API 0 ; include the closefile call to close an open file
|
||||
|
||||
|
||||
; these options change drive-side code
|
||||
|
||||
.define DIRTRACK 18 ; actual directory track, this can be changed to have a shadow directory so that the
|
||||
; normal directory does not list the files and can be used entirely for bootstrap and dir-art
|
||||
.define DIRTRACK81 40 ; (i.e., the loader's directory can be relocated to hide it from the normal directory command).
|
||||
; DIRTRACK must be 18 when LOAD_VIA_KERNAL_FALLBACK != 0
|
||||
; DIRTRACK81 must be 40 when LOAD_VIA_KERNAL_FALLBACK != 0
|
||||
|
||||
.define FILENAME_MAXLENGTH 16 ; maximum length of filename, if a directory is capable of holding longer names, extra characters are ignored,
|
||||
; to facilitate dir-art, set to, e.g., 2, then load files as "01*", "02*", etc.
|
||||
|
||||
|
||||
; this reduces host-side install code
|
||||
|
||||
.define ONLY_1541_AND_COMPATIBLE 0 ; reduces host-side install code by omitting any native custom drive code for non-1541 compatible
|
||||
; drives, treats any drive as 1541, using an incompatible drive will cause undefined behaviour
|
||||
76
loader/samples/minexample/main.asm
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
.feature c_comments
|
||||
|
||||
.zeropage
|
||||
|
||||
.segment "CODE"
|
||||
|
||||
.org $080D
|
||||
main:
|
||||
sei
|
||||
lda #$35
|
||||
sta $01
|
||||
|
||||
lda #127
|
||||
sta $dc0d
|
||||
|
||||
and $d011
|
||||
sta $d011
|
||||
|
||||
lda $dc0d
|
||||
lda $dd0d
|
||||
|
||||
lda #<irq
|
||||
sta $fffe
|
||||
lda #>irq
|
||||
sta $ffff
|
||||
|
||||
lda #$0b
|
||||
sta $d011
|
||||
lda #$00
|
||||
sta $d012
|
||||
|
||||
lda #0
|
||||
sta $d01a
|
||||
|
||||
lda #$63; <(985248/100)
|
||||
sta $dc04
|
||||
lda #$26;>(985248/100)
|
||||
sta $dc05
|
||||
|
||||
lda $dc0d
|
||||
and #$81
|
||||
sta $dc0d
|
||||
|
||||
lda #$40
|
||||
sta $dc0c
|
||||
|
||||
lda #$81
|
||||
sta $dc0d
|
||||
|
||||
lda #0
|
||||
jsr $1000
|
||||
cli
|
||||
jmp *
|
||||
|
||||
irq_music:
|
||||
pha
|
||||
txa
|
||||
pha
|
||||
tya
|
||||
pha
|
||||
|
||||
inc $d020
|
||||
jsr $1003
|
||||
dec $d020
|
||||
|
||||
pla
|
||||
tay
|
||||
pla
|
||||
tax
|
||||
pla
|
||||
;rti
|
||||
jmp $dc0c
|
||||
|
||||
|
||||
.res $1000-*
|
||||
.incbin "ys2_sid.sid", $7e+($1000-$ff6)
|
||||
BIN
loader/samples/minexample/minexample.o
Normal file
346
loader/samples/minexample/minexample.s
Normal file
|
|
@ -0,0 +1,346 @@
|
|||
.feature c_comments
|
||||
.include "../../build/loadersymbols-c64.inc"
|
||||
|
||||
.ZEROPAGE
|
||||
.org $10
|
||||
bmp_delay: .res 1
|
||||
bmp_addr: .res 2
|
||||
bmp_ptr: .res 2
|
||||
scr_ptr_lo: .res 1
|
||||
scr_ptr: .res 2
|
||||
cram_ptr: .res 2
|
||||
chr_count: .res 1
|
||||
vbl: .res 1
|
||||
frame: .res 1
|
||||
cur_frame: .res 1
|
||||
frame_delay: .res 1
|
||||
frame_until: .res 1
|
||||
|
||||
.segment "CODE"
|
||||
|
||||
ZP=$e0
|
||||
offset = ZP+0
|
||||
ZX0_src = ZP+2
|
||||
ZX0_dst = ZP+4
|
||||
bitr = ZP+6
|
||||
pntr = ZP+7
|
||||
|
||||
|
||||
.org $080d
|
||||
jsr install
|
||||
|
||||
sei
|
||||
lda #$35
|
||||
sta $01
|
||||
|
||||
lda #0
|
||||
sta ZX0_dst+0
|
||||
|
||||
ldx #<badguy
|
||||
ldy #>badguy
|
||||
jsr loadraw
|
||||
|
||||
lda #0
|
||||
sta ZX0_src
|
||||
lda #$e0
|
||||
sta ZX0_src+1
|
||||
lda #0
|
||||
sta ZX0_dst
|
||||
lda #$20
|
||||
jsr zx02
|
||||
|
||||
lda #127
|
||||
sta $dc0d
|
||||
|
||||
and $d011
|
||||
sta $d011
|
||||
|
||||
lda $dc0d
|
||||
lda $dd0d
|
||||
|
||||
lda #<irq_badguy
|
||||
sta $fffe
|
||||
lda #>irq_badguy
|
||||
sta $ffff
|
||||
|
||||
lda #$1b
|
||||
sta $d011
|
||||
lda #$80
|
||||
sta $d012
|
||||
|
||||
lda #1
|
||||
sta $d01a
|
||||
sta bmp_delay
|
||||
jsr init_bmp
|
||||
|
||||
lda #0
|
||||
sta vbl
|
||||
|
||||
cli
|
||||
|
||||
lda #7
|
||||
sta frame_until
|
||||
jsr wait_frame_until
|
||||
|
||||
lda #50*5
|
||||
sta frame_delay
|
||||
jsr wait_loop
|
||||
|
||||
lda #$0d
|
||||
sta frame_until
|
||||
jsr wait_frame_until
|
||||
|
||||
lda #50*5
|
||||
sta frame_delay
|
||||
jsr wait_loop
|
||||
|
||||
lda #50*5
|
||||
sta frame_delay
|
||||
jsr wait_loop
|
||||
|
||||
lda #26
|
||||
sta frame_until
|
||||
jsr wait_frame_until
|
||||
jmp *
|
||||
|
||||
wait_loop:
|
||||
loop2:
|
||||
lda vbl
|
||||
beq loop2
|
||||
|
||||
lda #0
|
||||
sta vbl
|
||||
|
||||
jsr sfx_play
|
||||
|
||||
dec frame_delay
|
||||
lda frame_delay
|
||||
beq :+
|
||||
jmp loop2
|
||||
:
|
||||
rts
|
||||
|
||||
wait_frame_until:
|
||||
loop:
|
||||
lda vbl
|
||||
beq loop
|
||||
|
||||
lda #0
|
||||
sta vbl
|
||||
|
||||
lda cur_frame
|
||||
cmp #2
|
||||
bcc :+
|
||||
jsr sfx_play
|
||||
:
|
||||
|
||||
dec bmp_delay
|
||||
bpl :+
|
||||
jsr update_bmp
|
||||
:
|
||||
|
||||
lda cur_frame
|
||||
cmp frame_until
|
||||
beq :+
|
||||
|
||||
jmp loop
|
||||
:
|
||||
rts
|
||||
|
||||
init_bmp:
|
||||
lda #$3b
|
||||
sta $d011
|
||||
lda #$19
|
||||
sta $d018
|
||||
lda #$d8
|
||||
sta $d016
|
||||
|
||||
lda $4710
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
sta $d020
|
||||
|
||||
lda $4710
|
||||
and #$0f
|
||||
sta $d021
|
||||
|
||||
lda #0
|
||||
sta cur_frame
|
||||
sta bmp_delay
|
||||
|
||||
lda #$11
|
||||
sta bmp_addr
|
||||
lda #$47
|
||||
sta bmp_addr+1
|
||||
|
||||
ldx #0
|
||||
:
|
||||
.repeat 4, I
|
||||
lda $3f40+(I*250), x
|
||||
sta $400+(I*250), x
|
||||
lda $4328+(I*250), x
|
||||
sta $d800+(I*250), x
|
||||
.endrepeat
|
||||
inx
|
||||
cpx #250
|
||||
bne :-
|
||||
rts
|
||||
|
||||
inc_bmp_addr:
|
||||
inc bmp_addr
|
||||
bne :+
|
||||
inc bmp_addr+1
|
||||
:
|
||||
rts
|
||||
|
||||
update_bmp:
|
||||
ldy #0
|
||||
sty scr_ptr
|
||||
sty cram_ptr
|
||||
lda (bmp_addr), y
|
||||
jsr inc_bmp_addr
|
||||
sta chr_count
|
||||
cmp #0 ; tfw flags update in inc_bmp_addr
|
||||
bne @skip_frame_end
|
||||
lda (bmp_addr), y
|
||||
jsr inc_bmp_addr
|
||||
sta bmp_delay
|
||||
inc cur_frame
|
||||
lda cur_frame
|
||||
cmp #2
|
||||
bne :+
|
||||
lda #0
|
||||
jsr sfx_init
|
||||
:
|
||||
rts
|
||||
@skip_frame_end:
|
||||
|
||||
lda (bmp_addr), y
|
||||
sta bmp_ptr
|
||||
iny
|
||||
lda (bmp_addr), y
|
||||
clc
|
||||
adc #$20
|
||||
sta bmp_ptr+1
|
||||
|
||||
iny
|
||||
lda (bmp_addr), y
|
||||
sta scr_ptr_lo
|
||||
iny
|
||||
lda (bmp_addr), y
|
||||
clc
|
||||
adc #$04
|
||||
sta scr_ptr+1
|
||||
clc
|
||||
adc #$d8-$04
|
||||
sta cram_ptr+1
|
||||
|
||||
ldy #0
|
||||
lda bmp_addr
|
||||
clc
|
||||
adc #4
|
||||
sta bmp_addr
|
||||
bcc :+
|
||||
inc bmp_addr+1
|
||||
:
|
||||
|
||||
ldx #0
|
||||
@loop:
|
||||
ldy #0
|
||||
lda (bmp_addr), y
|
||||
sta (bmp_ptr), y
|
||||
iny
|
||||
lda (bmp_addr), y
|
||||
sta (bmp_ptr), y
|
||||
iny
|
||||
lda (bmp_addr), y
|
||||
sta (bmp_ptr), y
|
||||
iny
|
||||
lda (bmp_addr), y
|
||||
sta (bmp_ptr), y
|
||||
iny
|
||||
lda (bmp_addr), y
|
||||
sta (bmp_ptr), y
|
||||
iny
|
||||
lda (bmp_addr), y
|
||||
sta (bmp_ptr), y
|
||||
iny
|
||||
lda (bmp_addr), y
|
||||
sta (bmp_ptr), y
|
||||
iny
|
||||
lda (bmp_addr), y
|
||||
sta (bmp_ptr), y
|
||||
|
||||
lda bmp_ptr
|
||||
clc
|
||||
adc #8
|
||||
sta bmp_ptr
|
||||
bcc :+
|
||||
inc bmp_ptr+1
|
||||
:
|
||||
lda bmp_addr
|
||||
clc
|
||||
adc #8
|
||||
sta bmp_addr
|
||||
bcc :+
|
||||
inc bmp_addr+1
|
||||
:
|
||||
|
||||
ldy #0
|
||||
lda (bmp_addr), y
|
||||
ldy scr_ptr_lo
|
||||
sta (scr_ptr), y
|
||||
|
||||
ldy #1
|
||||
lda (bmp_addr), y
|
||||
ldy scr_ptr_lo
|
||||
sta (cram_ptr), y
|
||||
|
||||
inc scr_ptr_lo
|
||||
bne :+
|
||||
inc scr_ptr+1
|
||||
inc cram_ptr+1
|
||||
:
|
||||
|
||||
lda bmp_addr
|
||||
clc
|
||||
adc #2
|
||||
sta bmp_addr
|
||||
bcc :+
|
||||
inc bmp_addr+1
|
||||
:
|
||||
|
||||
dec chr_count
|
||||
ldx chr_count
|
||||
bne @loop
|
||||
jmp update_bmp
|
||||
|
||||
irq_badguy:
|
||||
pha
|
||||
txa
|
||||
pha
|
||||
tya
|
||||
pha
|
||||
|
||||
inc vbl
|
||||
|
||||
asl $d019
|
||||
pla
|
||||
tay
|
||||
pla
|
||||
tax
|
||||
pla
|
||||
rti
|
||||
|
||||
badguy: .byte "badguy",0
|
||||
|
||||
.include "sfx.asm"
|
||||
.include "zx02.asm"
|
||||
|
||||
.res loadraw - *
|
||||
.incbin "../../build/loader-c64.prg", 2
|
||||
|
||||
.res install - *
|
||||
.incbin "../../build/install-c64.prg", 2
|
||||
BIN
loader/samples/minexample/png2prg 2/01_badguys.prg
Normal file
29
loader/samples/minexample/png2prg 2/01_badguyz_cut.csv
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
100,ys2/01_badguyz/koala/png/00.png
|
||||
3,ys2/01_badguyz/koala/png/01.png
|
||||
3,ys2/01_badguyz/koala/png/02.png
|
||||
3,ys2/01_badguyz/koala/png/03.png
|
||||
3,ys2/01_badguyz/koala/png/04.png
|
||||
3,ys2/01_badguyz/koala/png/05.png
|
||||
50,ys2/01_badguyz/koala/png/06.png
|
||||
15,ys2/01_badguyz/koala/png/07.png
|
||||
15,ys2/01_badguyz/koala/png/08.png
|
||||
15,ys2/01_badguyz/koala/png/09.png
|
||||
15,ys2/01_badguyz/koala/png/10.png
|
||||
15,ys2/01_badguyz/koala/png/11.png
|
||||
100,ys2/01_badguyz/koala/png/12.png
|
||||
15,ys2/01_badguyz/koala/png/10.png
|
||||
15,ys2/01_badguyz/koala/png/09.png
|
||||
15,ys2/01_badguyz/koala/png/08.png
|
||||
15,ys2/01_badguyz/koala/png/07.png
|
||||
100,ys2/01_badguyz/koala/png/06.png
|
||||
3,ys2/01_badguyz/koala/png/13.png
|
||||
3,ys2/01_badguyz/koala/png/14.png
|
||||
3,ys2/01_badguyz/koala/png/15.png
|
||||
3,ys2/01_badguyz/koala/png/16.png
|
||||
3,ys2/01_badguyz/koala/png/17.png
|
||||
3,ys2/01_badguyz/koala/png/18.png
|
||||
3,ys2/01_badguyz/koala/png/19.png
|
||||
100,ys2/01_badguyz/koala/png/00.png
|
||||
|
||||
|
||||
|
||||
|
20
loader/samples/minexample/png2prg 2/03_tower.csv
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
100,ys2/03_tower/koala/png/01.png
|
||||
3,ys2/03_tower/koala/png/02.png
|
||||
3,ys2/03_tower/koala/png/03.png
|
||||
3,ys2/03_tower/koala/png/04.png
|
||||
3,ys2/03_tower/koala/png/05.png
|
||||
3,ys2/03_tower/koala/png/06.png
|
||||
3,ys2/03_tower/koala/png/03.png
|
||||
50,ys2/03_tower/koala/png/01.png
|
||||
10,ys2/03_tower/koala/png/07.png
|
||||
10,ys2/03_tower/koala/png/08.png
|
||||
10,ys2/03_tower/koala/png/09.png
|
||||
10,ys2/03_tower/koala/png/10.png
|
||||
10,ys2/03_tower/koala/png/11.png
|
||||
10,ys2/03_tower/koala/png/12.png
|
||||
10,ys2/03_tower/koala/png/13.png
|
||||
10,ys2/03_tower/koala/png/14.png
|
||||
150,ys2/03_tower/koala/png/15.png
|
||||
|
||||
|
||||
|
||||
|
BIN
loader/samples/minexample/png2prg 2/03_tower.prg
Normal file
40
loader/samples/minexample/png2prg 2/04_tower_beam.csv
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
50,ys2/04_tower_beam/koala/png/01.png
|
||||
5,ys2/04_tower_beam/koala/png/02.png
|
||||
5,ys2/04_tower_beam/koala/png/03.png
|
||||
3,ys2/04_tower_beam/koala/png/04.png
|
||||
3,ys2/04_tower_beam/koala/png/05.png
|
||||
3,ys2/04_tower_beam/koala/png/06.png
|
||||
3,ys2/04_tower_beam/koala/png/07.png
|
||||
3,ys2/04_tower_beam/koala/png/08.png
|
||||
3,ys2/04_tower_beam/koala/png/09.png
|
||||
3,ys2/04_tower_beam/koala/png/10.png
|
||||
3,ys2/04_tower_beam/koala/png/11.png
|
||||
3,ys2/04_tower_beam/koala/png/12.png
|
||||
3,ys2/04_tower_beam/koala/png/13.png
|
||||
|
||||
3,ys2/04_tower_beam/koala/png/11.png
|
||||
3,ys2/04_tower_beam/koala/png/12.png
|
||||
3,ys2/04_tower_beam/koala/png/13.png
|
||||
|
||||
3,ys2/04_tower_beam/koala/png/11.png
|
||||
3,ys2/04_tower_beam/koala/png/12.png
|
||||
3,ys2/04_tower_beam/koala/png/13.png
|
||||
|
||||
3,ys2/04_tower_beam/koala/png/11.png
|
||||
3,ys2/04_tower_beam/koala/png/12.png
|
||||
3,ys2/04_tower_beam/koala/png/13.png
|
||||
|
||||
3,ys2/04_tower_beam/koala/png/11.png
|
||||
3,ys2/04_tower_beam/koala/png/12.png
|
||||
3,ys2/04_tower_beam/koala/png/13.png
|
||||
|
||||
3,ys2/04_tower_beam/koala/png/11.png
|
||||
3,ys2/04_tower_beam/koala/png/12.png
|
||||
3,ys2/04_tower_beam/koala/png/13.png
|
||||
|
||||
3,ys2/04_tower_beam/koala/png/11.png
|
||||
3,ys2/04_tower_beam/koala/png/12.png
|
||||
3,ys2/04_tower_beam/koala/png/13.png
|
||||
|
||||
|
||||
|
||||
|
BIN
loader/samples/minexample/png2prg 2/04_tower_beam.prg
Normal file
69
loader/samples/minexample/png2prg 2/05_field.csv
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
3,ys2/05_field/koala/png/01.png
|
||||
3,ys2/05_field/koala/png/02.png
|
||||
3,ys2/05_field/koala/png/03.png
|
||||
3,ys2/05_field/koala/png/04.png
|
||||
3,ys2/05_field/koala/png/05.png
|
||||
3,ys2/05_field/koala/png/06.png
|
||||
3,ys2/05_field/koala/png/07.png
|
||||
3,ys2/05_field/koala/png/08.png
|
||||
|
||||
3,ys2/05_field/koala/png/01.png
|
||||
3,ys2/05_field/koala/png/02.png
|
||||
3,ys2/05_field/koala/png/03.png
|
||||
3,ys2/05_field/koala/png/04.png
|
||||
3,ys2/05_field/koala/png/05.png
|
||||
3,ys2/05_field/koala/png/06.png
|
||||
3,ys2/05_field/koala/png/07.png
|
||||
3,ys2/05_field/koala/png/08.png
|
||||
|
||||
3,ys2/05_field/koala/png/01.png
|
||||
3,ys2/05_field/koala/png/02.png
|
||||
3,ys2/05_field/koala/png/03.png
|
||||
3,ys2/05_field/koala/png/04.png
|
||||
3,ys2/05_field/koala/png/05.png
|
||||
3,ys2/05_field/koala/png/06.png
|
||||
3,ys2/05_field/koala/png/07.png
|
||||
3,ys2/05_field/koala/png/08.png
|
||||
|
||||
3,ys2/05_field/koala/png/01.png
|
||||
3,ys2/05_field/koala/png/02.png
|
||||
3,ys2/05_field/koala/png/03.png
|
||||
3,ys2/05_field/koala/png/04.png
|
||||
3,ys2/05_field/koala/png/05.png
|
||||
3,ys2/05_field/koala/png/06.png
|
||||
3,ys2/05_field/koala/png/07.png
|
||||
3,ys2/05_field/koala/png/08.png
|
||||
|
||||
3,ys2/05_field/koala/png/01.png
|
||||
3,ys2/05_field/koala/png/02.png
|
||||
3,ys2/05_field/koala/png/03.png
|
||||
3,ys2/05_field/koala/png/04.png
|
||||
3,ys2/05_field/koala/png/05.png
|
||||
3,ys2/05_field/koala/png/06.png
|
||||
3,ys2/05_field/koala/png/07.png
|
||||
3,ys2/05_field/koala/png/08.png
|
||||
|
||||
3,ys2/05_field/koala/png/09.png
|
||||
3,ys2/05_field/koala/png/10.png
|
||||
3,ys2/05_field/koala/png/11.png
|
||||
3,ys2/05_field/koala/png/12.png
|
||||
3,ys2/05_field/koala/png/13.png
|
||||
3,ys2/05_field/koala/png/14.png
|
||||
3,ys2/05_field/koala/png/15.png
|
||||
3,ys2/05_field/koala/png/16.png
|
||||
3,ys2/05_field/koala/png/17.png
|
||||
3,ys2/05_field/koala/png/18.png
|
||||
3,ys2/05_field/koala/png/19.png
|
||||
3,ys2/05_field/koala/png/20.png
|
||||
3,ys2/05_field/koala/png/21.png
|
||||
3,ys2/05_field/koala/png/22.png
|
||||
3,ys2/05_field/koala/png/23.png
|
||||
3,ys2/05_field/koala/png/24.png
|
||||
3,ys2/05_field/koala/png/25.png
|
||||
3,ys2/05_field/koala/png/26.png
|
||||
3,ys2/05_field/koala/png/27.png
|
||||
3,ys2/05_field/koala/png/28.png
|
||||
3,ys2/05_field/koala/png/29.png
|
||||
3,ys2/05_field/koala/png/30.png
|
||||
|
||||
|
||||
|
BIN
loader/samples/minexample/png2prg 2/05_field.prg
Normal file
38
loader/samples/minexample/png2prg 2/06_falling_star.csv
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
50,ys2/06_falling_star/koala/png/01.png
|
||||
5,ys2/06_falling_star/koala/png/02.png
|
||||
5,ys2/06_falling_star/koala/png/03.png
|
||||
5,ys2/06_falling_star/koala/png/04.png
|
||||
5,ys2/06_falling_star/koala/png/05.png
|
||||
5,ys2/06_falling_star/koala/png/06.png
|
||||
5,ys2/06_falling_star/koala/png/07.png
|
||||
5,ys2/06_falling_star/koala/png/08.png
|
||||
5,ys2/06_falling_star/koala/png/09.png
|
||||
5,ys2/06_falling_star/koala/png/10.png
|
||||
5,ys2/06_falling_star/koala/png/11.png
|
||||
5,ys2/06_falling_star/koala/png/12.png
|
||||
5,ys2/06_falling_star/koala/png/13.png
|
||||
5,ys2/06_falling_star/koala/png/14.png
|
||||
5,ys2/06_falling_star/koala/png/15.png
|
||||
5,ys2/06_falling_star/koala/png/16.png
|
||||
5,ys2/06_falling_star/koala/png/17.png
|
||||
5,ys2/06_falling_star/koala/png/18.png
|
||||
5,ys2/06_falling_star/koala/png/19.png
|
||||
|
||||
5,ys2/06_falling_star/koala/png/18.png
|
||||
5,ys2/06_falling_star/koala/png/19.png
|
||||
|
||||
5,ys2/06_falling_star/koala/png/18.png
|
||||
5,ys2/06_falling_star/koala/png/19.png
|
||||
|
||||
5,ys2/06_falling_star/koala/png/18.png
|
||||
5,ys2/06_falling_star/koala/png/19.png
|
||||
|
||||
5,ys2/06_falling_star/koala/png/18.png
|
||||
5,ys2/06_falling_star/koala/png/19.png
|
||||
|
||||
5,ys2/06_falling_star/koala/png/18.png
|
||||
5,ys2/06_falling_star/koala/png/19.png
|
||||
|
||||
5,ys2/06_falling_star/koala/png/18.png
|
||||
5,ys2/06_falling_star/koala/png/19.png
|
||||
|
||||
|
BIN
loader/samples/minexample/png2prg 2/06_falling_star.prg
Normal file
BIN
loader/samples/minexample/png2prg 2/07_lilia.prg
Normal file
BIN
loader/samples/minexample/png2prg 2/08_lilia_hero.prg
Normal file
66
loader/samples/minexample/png2prg 2/11_lilia_final.csv
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
7,ys2/11_lilia_final/koala/png/01.png
|
||||
7,ys2/11_lilia_final/koala/png/02.png
|
||||
7,ys2/11_lilia_final/koala/png/03.png
|
||||
7,ys2/11_lilia_final/koala/png/02.png
|
||||
7,ys2/11_lilia_final/koala/png/01.png
|
||||
7,ys2/11_lilia_final/koala/png/02.png
|
||||
7,ys2/11_lilia_final/koala/png/03.png
|
||||
7,ys2/11_lilia_final/koala/png/02.png
|
||||
7,ys2/11_lilia_final/koala/png/01.png
|
||||
7,ys2/11_lilia_final/koala/png/02.png
|
||||
7,ys2/11_lilia_final/koala/png/03.png
|
||||
7,ys2/11_lilia_final/koala/png/02.png
|
||||
7,ys2/11_lilia_final/koala/png/01.png
|
||||
7,ys2/11_lilia_final/koala/png/02.png
|
||||
7,ys2/11_lilia_final/koala/png/03.png
|
||||
7,ys2/11_lilia_final/koala/png/02.png
|
||||
50,ys2/11_lilia_final/koala/png/01.png
|
||||
|
||||
20,ys2/11_lilia_final/koala/png/04.png
|
||||
3,ys2/11_lilia_final/koala/png/05.png
|
||||
3,ys2/11_lilia_final/koala/png/06.png
|
||||
3,ys2/11_lilia_final/koala/png/07.png
|
||||
3,ys2/11_lilia_final/koala/png/06.png
|
||||
3,ys2/11_lilia_final/koala/png/05.png
|
||||
3,ys2/11_lilia_final/koala/png/04.png
|
||||
|
||||
7,ys2/11_lilia_final/koala/png/01.png
|
||||
7,ys2/11_lilia_final/koala/png/02.png
|
||||
7,ys2/11_lilia_final/koala/png/03.png
|
||||
7,ys2/11_lilia_final/koala/png/02.png
|
||||
7,ys2/11_lilia_final/koala/png/01.png
|
||||
7,ys2/11_lilia_final/koala/png/02.png
|
||||
7,ys2/11_lilia_final/koala/png/03.png
|
||||
7,ys2/11_lilia_final/koala/png/02.png
|
||||
7,ys2/11_lilia_final/koala/png/01.png
|
||||
7,ys2/11_lilia_final/koala/png/02.png
|
||||
7,ys2/11_lilia_final/koala/png/03.png
|
||||
7,ys2/11_lilia_final/koala/png/02.png
|
||||
|
||||
3,ys2/11_lilia_final/koala/png/08.png
|
||||
3,ys2/11_lilia_final/koala/png/09.png
|
||||
3,ys2/11_lilia_final/koala/png/10.png
|
||||
3,ys2/11_lilia_final/koala/png/11.png
|
||||
3,ys2/11_lilia_final/koala/png/10.png
|
||||
3,ys2/11_lilia_final/koala/png/09.png
|
||||
3,ys2/11_lilia_final/koala/png/08.png
|
||||
|
||||
7,ys2/11_lilia_final/koala/png/01.png
|
||||
7,ys2/11_lilia_final/koala/png/02.png
|
||||
7,ys2/11_lilia_final/koala/png/03.png
|
||||
7,ys2/11_lilia_final/koala/png/02.png
|
||||
7,ys2/11_lilia_final/koala/png/01.png
|
||||
7,ys2/11_lilia_final/koala/png/02.png
|
||||
7,ys2/11_lilia_final/koala/png/03.png
|
||||
7,ys2/11_lilia_final/koala/png/02.png
|
||||
7,ys2/11_lilia_final/koala/png/01.png
|
||||
7,ys2/11_lilia_final/koala/png/02.png
|
||||
7,ys2/11_lilia_final/koala/png/03.png
|
||||
7,ys2/11_lilia_final/koala/png/02.png
|
||||
50,ys2/11_lilia_final/koala/png/01.png
|
||||
|
||||
3,ys2/11_lilia_final/koala/png/12.png
|
||||
3,ys2/11_lilia_final/koala/png/13.png
|
||||
3,ys2/11_lilia_final/koala/png/14.png
|
||||
3,ys2/11_lilia_final/koala/png/15.png
|
||||
200,ys2/11_lilia_final/koala/png/16.png
|
||||
|
BIN
loader/samples/minexample/png2prg 2/11_lilia_final.prg
Normal file
BIN
loader/samples/minexample/png2prg 2/examples.d64
Normal file
9
loader/samples/minexample/png2prg 2/lilia.csv
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
50,ys2/07_lilia/lilia1.png
|
||||
4,ys2/07_lilia/lilia2.png
|
||||
4,ys2/07_lilia/lilia3.png
|
||||
4,ys2/07_lilia/lilia4.png
|
||||
4,ys2/07_lilia/lilia5.png
|
||||
4,ys2/07_lilia/lilia6.png
|
||||
4,ys2/07_lilia/lilia7.png
|
||||
4,ys2/07_lilia/lilia8.png
|
||||
150,ys2/07_lilia/lilia9.png
|
||||
|
BIN
loader/samples/minexample/png2prg 2/lilia.prg
Normal file
BIN
loader/samples/minexample/png2prg 2/png2prg_darwin_arm64
Executable file
BIN
loader/samples/minexample/png2prg 2/png2prg_win_x86.exe
Normal file
687
loader/samples/minexample/png2prg 2/readme.md
Normal file
|
|
@ -0,0 +1,687 @@
|
|||
# PNG2PRG 1.12 by burg
|
||||
|
||||
Png2prg converts a 320x200 image (png/gif/jpeg) to a c64 hires or
|
||||
multicolor bitmap, charset, petscii, ecm or sprites prg. It will find the best
|
||||
matching palette and background/bitpair-colors automatically, no need to modify
|
||||
your source images or configure a palette.
|
||||
|
||||
Vice screenshots with default borders (384x272) are automatically cropped.
|
||||
Vice's main screen offset is at x=32, y=35.
|
||||
Quite a few people (and possibly tools too) use the incorrect 32,36 offset.
|
||||
Use the -alt-offset or -ao flag to use 32,36 as offset.
|
||||
Images in sprite dimensions will be converted to sprites.
|
||||
|
||||
The resulting .prg includes the 2-byte start address and optional displayer.
|
||||
The displayers can optionally play a .sid tune.
|
||||
|
||||
This tool can be used in all buildchains on all common platforms.
|
||||
|
||||
## What Is New
|
||||
|
||||
Png2prg 1.12 introduces animation.csv support for custom delays per frame.
|
||||
See 'Animation csv' below for details.
|
||||
The -no-loop flag causes animations to only display once.
|
||||
|
||||
This release contains an important bugfix related to mixedcharsets,
|
||||
where in some cases, png2prg would require more unique chars than necessary.
|
||||
There were more issues with png2prg 1.10, which were hotfixed in 1.10.1.
|
||||
It is best to delete any 1.10 version and upgrade to 1.12.
|
||||
|
||||
ECM conversion has been improved, now png2prg also searches for potential
|
||||
char reduction by searching for invertable characters.
|
||||
|
||||
Trident added [devcontainer files](https://github.com/staD020/png2prg/commit/6cb6c48a2804fa5210cf704e0af4cff3313398fe) for setting up a Docker
|
||||
development environment to compile png2prg directly from within VSCode.
|
||||
|
||||
See 'Changes for version 1.12' below for more features and details.
|
||||
|
||||
## What it is *not*
|
||||
|
||||
Png2prg is not a tool to wire fullcolor images. It needs input images to
|
||||
already be compliant with c64 color and size restrictions.
|
||||
In verbose mode (-v) it outputs locations of color clashes, if any.
|
||||
|
||||
If you do need to wire fullcolor images, check out Youth's [Retropixels](https://www.micheldebree.nl/retropixels/).
|
||||
|
||||
## Supported Graphics Modes
|
||||
|
||||
koala: multicolor bitmap (max 4 colors per char)
|
||||
hires: singlecolor bitmap (max 2 colors per char)
|
||||
mixedcharset: multicolor charset (max 4 colors per char (fixed bgcol, d022, d023))
|
||||
mccharset: multicolor charset (max 4 colors)
|
||||
sccharset: singlecolor charset (max 2 colors per char (fixed bgcol))
|
||||
petscii: singlecolor rom charset (max 2 colors per char (fixed bgcol))
|
||||
ecm: singlecolor charset (max 2 colors per char (4 fixed bgcolors), max 64 chars)
|
||||
mcsprites: multicolor sprites (max 4 colors)
|
||||
scsprites: singlecolor sprites (max 2 colors)
|
||||
mcibitmap: 320x200 multicolor interlace bitmap (max 4 colors per char/frame)
|
||||
|
||||
Png2prg is mostly able to autodetect the correct graphics mode, but you can
|
||||
also force a specific graphics mode with the -mode flag:
|
||||
|
||||
./png2prg -m koala image.png
|
||||
|
||||
## Koala or Hires Bitmap
|
||||
|
||||
Bitmap: $2000 - $3f3f
|
||||
Screen: $3f40 - $4327
|
||||
D020: $4328 (singlecolor only)
|
||||
D800: $4328 - $470f (multicolor only)
|
||||
D021: $4710 (multicolor only, low-nibble)
|
||||
D020: $4710 (multicolor only, high-nibble)
|
||||
|
||||
## Multicolor Interlace Bitmap
|
||||
|
||||
You can supply one 320x200 multicolor image with max 4 colors per 8x8 pixel
|
||||
char per frame of which at least 2 are shared (the D021 and D800 colors).
|
||||
|
||||
Or supply both frames in regular koala specs (-interlace flag required).
|
||||
When making screenshots in vice, please disable the d016 pixel shift manually.
|
||||
|
||||
./png2prg -i testdata/madonna/frame_0.png testdata/madonna/frame_1.png
|
||||
|
||||
### Drazlace (shared screenram and colorram for both frames)
|
||||
|
||||
./png2prg testdata/madonna/cjam_pure_madonna.png
|
||||
|
||||
D800: $5800 - $5be7
|
||||
Screen: $5c00 - $5fe7
|
||||
Bitmap1: $6000 - $7f3f
|
||||
D021: $7f40 (low-nibble)
|
||||
D020: $7f40 (high-nibble)
|
||||
D016Offset: $7f42
|
||||
Bitmap2: $8000 - $9f3f
|
||||
|
||||
### Multicolor Interlace (shared colorram, true paint .mci format)
|
||||
|
||||
./png2prg -i -d016 1 testdata/mcinterlace/parriot?.png
|
||||
|
||||
Screen1: $9c00 - $9fe7
|
||||
D021: $9fe8 (low-nibble)
|
||||
D020: $9fe8 (high-nibble)
|
||||
D016Offset: $9fe9
|
||||
Bitmap1: $a000 - $bf3f
|
||||
Bitmap2: $c000 - $df3f
|
||||
Screen2: $e000 - $e3e7
|
||||
D800: $e400 - $e7e7
|
||||
|
||||
## Singlecolor, PETSCII or ECM Charset (individual d800 colors)
|
||||
|
||||
By default charsets are packed, they only contain unique characters.
|
||||
If you do not want charpacking, eg for a 1x1 charset, please use -no-pack.
|
||||
|
||||
With ECM -bitpair-colors can be used to force d021-d024 colors.
|
||||
|
||||
NB: individual d800 colors are not supported with -no-pack.
|
||||
|
||||
./png2prg -m sccharset testdata/hirescharset/ohno_logo.png
|
||||
./png2prg -m petscii testdata/petscii/hein_hibiscus.png
|
||||
./png2prg -m ecm testdata/ecm/xpardey.png
|
||||
./png2prg -m ecm testdata/ecm/shampoo.png
|
||||
./png2prg -m ecm -bpc 2,7,14,0 testdata/ecm/orion.png
|
||||
|
||||
Charset: $2000-$27ff (omitted for petscii)
|
||||
Screen: $2800-$2be7
|
||||
D800: $2c00-$2fe7
|
||||
D020: $2fe8
|
||||
D021: $2fe9
|
||||
D022: $2fea (ecm only)
|
||||
D023: $2feb (ecm only)
|
||||
D024: $2fec (ecm only)
|
||||
|
||||
## Mixed Multi/Singlecolor Charset (individual d800 colors)
|
||||
|
||||
Png2prg tries to figure out the right -bitpair-colors and auto-corrects
|
||||
where it can, but there still are edge-cases like the ones below.
|
||||
If an impossible color is found, an error will be displayed.
|
||||
Swap some -bpc colors around and retry.
|
||||
There can also be cases where manual -bpc colors can influence char-count or
|
||||
packed size.
|
||||
|
||||
You may want to add the -brute-force flag so most color options will be tried.
|
||||
The best packed result wins, not necessarily the version with the least amount
|
||||
of chars.
|
||||
|
||||
./png2prg -m mixedcharset testdata/mixedcharset/hein_neo.png
|
||||
./png2prg -m mixedcharset testdata/mixedcharset/huntress.gif
|
||||
./png2prg -m mixedcharset -bpc 3 testdata/mixedcharset/shine.png
|
||||
./png2prg -m mixedcharset -bpc 0 testdata/mixedcharset/charsetcompo.png
|
||||
|
||||
Charset: $2000-$27ff
|
||||
Screen: $2800-$2be7
|
||||
D800: $2c00-$2fe7
|
||||
D020: $2fe8
|
||||
D021: $2fe9
|
||||
D022: $2fea
|
||||
D023: $2feb
|
||||
|
||||
## Single or Multicolor Sprites
|
||||
|
||||
If the source image size is a multiple of a 24x21 pixel sprite,
|
||||
the image is considered to contain sprites.
|
||||
|
||||
The image will be converted from left to right, top to bottom.
|
||||
|
||||
./png2prg image.png
|
||||
./png2prg -m scsprites image.png
|
||||
./png2prg -m mcsprites image.png
|
||||
|
||||
Sprite 1: $2000-$203f
|
||||
Sprite 2: $2040-$207f
|
||||
...
|
||||
|
||||
## Bitpair Colors
|
||||
|
||||
By default, png2prg guesses bitpair colors by itself. In most cases you
|
||||
don't need to configure anything. It will provide a mostly normalized image
|
||||
which should yield good pack results, but your miles may vary.
|
||||
|
||||
To give you more control, you can force/prefer a specific bitpair
|
||||
color-order. Use c64 colors, so 0 for black, 1 for white, 2 for red, etc.
|
||||
|
||||
The following example will force background color 0 for bitpair 00 and
|
||||
prefer colors 6,14,3 for bitpairs 01,10,11:
|
||||
|
||||
./png2prg -bitpair-colors 0,6,14,3 image.png
|
||||
|
||||
It's also possible to explicitly skip certain bitpair preferences with -1:
|
||||
|
||||
./png2prg -bitpair-colors 0,-1,-1,3 image.png
|
||||
|
||||
## Animations
|
||||
|
||||
When multiple files are added, they are treated as animation frames.
|
||||
You can also supply an animated .gif.
|
||||
|
||||
## Sprite Animation
|
||||
|
||||
Each frame will be concatenated in the output .prg.
|
||||
|
||||
## Bitmap Animation (only koala and hires)
|
||||
|
||||
Note that png2prg uses a rather simple generic diff approach, where small
|
||||
changes frame by frame work well. Trying to change large areas at once
|
||||
is not advised.
|
||||
Use the -no-fade flag if you run out of memory.
|
||||
|
||||
The first image will be exported with all framedata appended.
|
||||
Koala animation frames start at $4711, hires at $4329.
|
||||
|
||||
The frame files are following this format.
|
||||
Each frame consists of 1 or more chunks. A chunk looks like this:
|
||||
|
||||
.byte $03 // number of chars in this chunk
|
||||
// $00 marks end of frame
|
||||
// $ff marks end of all frames
|
||||
.word bitmap // bitmap address of this chunk (the high byte is <$20)
|
||||
.word screen // screenram address (the high byte is <$04)
|
||||
|
||||
For each char in this chunk:
|
||||
|
||||
.byte 0,31,15,7,8,34,0,128 // pixels
|
||||
.byte $64 // screenram colors
|
||||
.byte $01 // colorram color (koala only)
|
||||
... // next char(s)
|
||||
|
||||
... // next chunks
|
||||
.byte 0 // end of frame
|
||||
.byte 6 // wait for 6 frames
|
||||
... // next frame(s)
|
||||
.byte $ff // end of all frames
|
||||
|
||||
## PETSCII and Charset Animation
|
||||
|
||||
Only petscii and sccharset modes support different background and
|
||||
bordercolors per frame.
|
||||
All chars used in all frames must fit into a single 256 char charset.
|
||||
|
||||
Each frame consists of 1 or more chunks. A chunk looks like this:
|
||||
|
||||
.byte $xy // $y = bgcol, $x = bordercol (only for petscii/sccharset)
|
||||
.byte $03 // number of chars in this chunk
|
||||
// $00 marks end of frame
|
||||
// $ff marks end of all frames
|
||||
.word screen // screenram address (the high byte is <$04)
|
||||
|
||||
For each char in this chunk:
|
||||
|
||||
.byte $03 // character
|
||||
.byte $01 // colorram color
|
||||
... // next char(s)
|
||||
|
||||
... // next chunks
|
||||
.byte 0 // end of frame
|
||||
.byte 6 // wait for 6 frames
|
||||
... // next frame(s)
|
||||
.byte $ff // end of all frames
|
||||
|
||||
## Animation csv
|
||||
|
||||
Since version 1.12 animation.csv support has been added to give more
|
||||
freedom to users wanting to create animation displayers.
|
||||
It is now possible to use a custom frame-delay per frame.
|
||||
|
||||
The csv should contain rows of frame delay value and image, where the
|
||||
delay can be any value from 0 till 255. The highest delay is a little
|
||||
over 5 seconds on PAL systems.
|
||||
If you want longer delays, just copy a row.
|
||||
|
||||
10,frame0.png
|
||||
50,frame1.png
|
||||
10,frame2.png
|
||||
|
||||
Examples can be found here: [Évoluer by The Sarge](https://github.com/staD020/png2prg/blob/master/testdata/evoluer/evoluer.csv) and [Rose by Sander](https://github.com/staD020/png2prg/blob/master/testdata/petscii/anim/rose.csv)
|
||||
|
||||
png2prg -d -o evoluer.prg -sid testdata/evoluer/Evoluer.sid testdata/evoluer/evoluer.csv
|
||||
png2prg -d -o rose.prg testdata/petscii/anim/rose.csv
|
||||
|
||||
## Displayer
|
||||
|
||||
The -d or -display flag will link displayer code infront of the picture.
|
||||
By default it will also crunch the resulting file with Antonio Savona's
|
||||
[TSCrunch](https://github.com/tonysavon/TSCrunch/) with a couple of changes in my own [fork](https://github.com/staD020/TSCrunch/).
|
||||
|
||||
All displayers except for sprites support adding a .sid.
|
||||
Multispeed sids are supported as long as the .sid initializes the CIA timers
|
||||
correctly.
|
||||
|
||||
You can use sids located from $0e00-$1fff or $e000+ in the displayers.
|
||||
More areas may be free depending on graphics type.
|
||||
A memory usage map is shown on error and in -vv (very verbose) mode.
|
||||
|
||||
If needed, you can relocate most sids using lft's [sidreloc](http://www.linusakesson.net/software/sidreloc/index.php).
|
||||
|
||||
Zeropages $08-$0f are used in the animation displayers, while none are used
|
||||
in hires/koala displayers, increasing sid compatibility.
|
||||
|
||||
## Brute Force Mode and Pack Optimization
|
||||
|
||||
By default png2prg 1.8 does a pretty good job at optimizing the resulting prg
|
||||
for crunchers and packers. It is not enough to beat [SPOT 1.3](https://csdb.dk/release/?id=242492).
|
||||
|
||||
The optimization techniques used by png2prg are also responsible for cleaning
|
||||
up the bitmap, making it ideal for animations and color effects.
|
||||
|
||||
### -brute-force (-bf)
|
||||
|
||||
Iterates are over many -bitpair-colors permutations automatically, packs
|
||||
with the built in TSCrunch and selects the shortest.
|
||||
|
||||
./png2prg -bf image.png
|
||||
|
||||
The -brute-force mode can be used in combination with additional flags.
|
||||
|
||||
### -no-bitpair-counters (-nbc)
|
||||
|
||||
Disable counting of bitpairs per color to guess a bitpair for a color.
|
||||
|
||||
./png2prg -bf -nbc image.png
|
||||
|
||||
### -no-prev-char-colors (-npcc)
|
||||
|
||||
Disable lookback to previous char's charcolors to guess a bitpair for a color.
|
||||
|
||||
./png2prg -bf -npcc image.png
|
||||
|
||||
Since TSCrunch is optimized for speed, packing with Dali can give varying
|
||||
results. This is also the reason for not including these options in the
|
||||
brute force permutations automatically.
|
||||
|
||||
## Benchmark
|
||||
|
||||
The [koala otpimizing thread](https://csdb.dk/forums/?roomid=13&topicid=38311&showallposts=1) on csdb has gained some interest in the scene.
|
||||
Since Sparta released [SPOT](https://csdb.dk/release/?id=242492) it has been the best optimizer available.
|
||||
|
||||
Png2prg 1.8 has improved optimization techniques but requires -brute-force
|
||||
mode to beat SPOT 1.3. Manual flags can optimize even better in some cases.
|
||||
|
||||
All koalas are packed with [Dali 0.3.2](https://csdb.dk/release/?id=223584).
|
||||
|
||||
+---------+--------+----------+------------+--------+
|
||||
| spot1.3 | p2p1.8 | p2p1.8bf | p2p1.8best | p2p1.6 |
|
||||
+---------+--------+----------+------------+--------+
|
||||
| 7332 | 7372 | 7332 | 7324 | 7546 | Untitled/Floris
|
||||
| 5136 | 5190 | 5149 | bf | 5464 | Song of the Sunset/Mermaid
|
||||
| 5968 | 5998 | 5963 | bf | 6155 | Short Circuit/Karen Davies
|
||||
| 3618 | 3647 | 3616 | 3589 | 3830 | Portrait L+D/Sander
|
||||
| 5094 | 5080 | 5083 | 5078 | 5320 | Weee/Mermaid
|
||||
| 7497 | 7471 | 7458 | bf | 7612 | Deadlock/Robin Levy
|
||||
| 8068 | 8097 | 8046 | 8038 | 8227 | Room with a view/Veto
|
||||
| 7445 | 7490 | 7432 | bf | 7582 | Vangelis/Talent
|
||||
| 6759 | 6739 | 6737 | bf | 6963 | Temple of Tears/Hend
|
||||
| 7859 | 7848 | 7839 | 7821 | 7998 | Thanos/JonEgg
|
||||
| 4859 | 4849 | 4782 | bf | 4983 | Solar-Sonar/Leon
|
||||
| 5640 | 5671 | 5613 | bf | 5869 | Cisco Heat/Alan Grier
|
||||
| 6243 | 6286 | 6228 | bf | 6430 | Daylight/Sulevi
|
||||
| 2850 | 2884 | 2848 | bf | 3092 | Yie Ar Kung Fu/Steve Wahid
|
||||
| 6727 | 6721 | 6730 | 6711 | 6901 | Lee/The Sarge
|
||||
| 7837 | 7828 | 7798 | bf | 7960 | Parrot/Mirage
|
||||
| 4559 | 4536 | 4494 | bf | 4821 | Dragon's Lair
|
||||
| 4275 | 4324 | 4292 | 4284 | 4519 | Scorpion/SIR'88
|
||||
| 5562 | 5558 | 5506 | bf | 5668 | Hatching/Joe
|
||||
+---------+--------+----------+------------+--------+
|
||||
| 113328 | 113589 | 112946 | 112853 | 116940 | Total
|
||||
+---------+--------+----------+------------+--------+
|
||||
|
||||
- p2p1.8: default png2prg result w/o options
|
||||
- p2p1.8bf: -brute-force mode
|
||||
- p2p1.8best: hand-picked -bitpair-colors, or bruteforced with -npcc and/or -nbc flags
|
||||
- p2p1.6: default png2prg 1.6 result w/o options
|
||||
|
||||
## Examples
|
||||
|
||||
This release contains examples with all assets included for you to test with.
|
||||
Also included are the assets of [Évoluer](https://csdb.dk/release/?id=220170) by The Sarge and Flotsam.
|
||||
A larger set of testdata can be found in the [github repo](https://github.com/staD020/png2prg/tree/master/testdata).
|
||||
|
||||
## Install from source
|
||||
|
||||
Png2prg was built on Linux, building on Mac should work out of the box.
|
||||
For Windows, try out Windows Subsystem Linux (WSL), works pretty well.
|
||||
However, natively building on Windows should be easy enough, look at
|
||||
Compiling without Make below.
|
||||
|
||||
The compiled displayer prgs are included in the repo to ease building
|
||||
and importing png2prg as a library. Java is only required to build
|
||||
the displayers with KickAssembler (included in the repo).
|
||||
|
||||
But first [install Go 1.20 or higher](https://go.dev/dl/).
|
||||
|
||||
### Simple install
|
||||
|
||||
go install -v github.com/staD020/png2prg@master
|
||||
|
||||
### Compiling with Make (recommended)
|
||||
|
||||
git clone https://github.com/staD020/png2prg.git
|
||||
cd png2prg
|
||||
make -j
|
||||
|
||||
Build for all common targets:
|
||||
|
||||
make all -j
|
||||
|
||||
### Compiling without Make
|
||||
|
||||
go build ./cmd/png2prg
|
||||
|
||||
## Install and use as library
|
||||
|
||||
In your Go project's path, go get the library:
|
||||
|
||||
go get github.com/staD020/png2prg
|
||||
|
||||
In essence png2prg implements the [io.WriterTo](https://pkg.go.dev/io#WriterTo) interface.
|
||||
Typical usage could look like below. A more complex example can be found
|
||||
in the [source](https://github.com/staD020/png2prg/blob/master/cmd/png2prg/main.go) of the cli tool.
|
||||
|
||||
```go
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"github.com/staD020/png2prg"
|
||||
)
|
||||
|
||||
func convertPNG(w io.Writer, png io.Reader) (int64, error) {
|
||||
p, err := png2prg.New(png2prg.Options{}, png)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("png2prg.New failed: %w", err)
|
||||
}
|
||||
return p.WriteTo(w)
|
||||
}
|
||||
```
|
||||
|
||||
## Changes for version 1.12
|
||||
|
||||
- Bugfix: Fix regression with handling mixedcharsets that was increasing
|
||||
char usage count in some cases (thanks Shine).
|
||||
- Feature: Press CBM key in petscii (animation) displayers to switch
|
||||
charset case.
|
||||
- Feature: Add -brute-force support to all charset modes.
|
||||
- Feature: Improve ECM handling by searching for invertable characters to
|
||||
reduce char usage.
|
||||
- Feature: Add animation.csv support to allow for custom delays per frame.
|
||||
- Feature: Add -no-loop support for animations (thanks jab).
|
||||
- Feature: Add -no-fade support to other displayers (thanks Shine).
|
||||
- Feature: Disable repeating color optimization for koala & hires anims.
|
||||
This reduces animation size & runtime processing at the cost of initial
|
||||
image optimization.
|
||||
- Feature: Allow sids to use all memory below $0400 (thanks kbs).
|
||||
- Feature: VSCode Docker build support for a devcontainer was added by
|
||||
Trident (thanks!).
|
||||
- Experimental: Add secondary+tertiary preferred bitpair colors with -bpc2
|
||||
and -bpc3 (thanks Fungus).
|
||||
|
||||
## Changes for version 1.10.1
|
||||
|
||||
- Play NTSC .sid tunes at the right speed (thanks Acrouzet).
|
||||
- Bugfix: palette detection must detect all hires colors, also on odd pixels.
|
||||
- Bugfix: dont look at border area to determine hires pixels.
|
||||
- Bugfix: fix -frame-delay for charset anim displayers.
|
||||
|
||||
## Changes for version 1.10
|
||||
|
||||
- Add gfxmode to .sym files and display in terminal output (thanks Spider-J).
|
||||
- Add petscii animation support.
|
||||
- Add background and bordercolor to each petscii or sccharset animation frame.
|
||||
- Add -no-anim flag disable sc/mccharset animations and store frames as separate
|
||||
screens.
|
||||
- Add -no-fade flag for koala, hires, petscii and sccharset animation
|
||||
displayers, this frees up a lot of RAM for animation data and sid.
|
||||
- Code refactor, standardizing color and bitpair code, separated palettes in
|
||||
palettes.yaml and more.
|
||||
- Bugfix: repair -force-border-color.
|
||||
- Bugfix: handle blank ECM images as well as ECM images using few bg colors
|
||||
(thanks Brush).
|
||||
- Typofix: fix simple install docs (thanks IcePic).
|
||||
- Added another weird palette (thanks Fungus).
|
||||
|
||||
## Changes for version 1.8
|
||||
|
||||
- Improve crunchiness by re-using the previous char's bitpair-colors.
|
||||
- Add -no-prev-char-colors flag to disable re-use of the previous char's
|
||||
bitpair-colors, in some cases this optimization causes worse pack results.
|
||||
- Add -brute-force mode to find bitpair color combinations with better
|
||||
crunchiness. Burns some CPU for a couple seconds.
|
||||
- Add -no-bitpair-counters flag to disable using bitpair counters per color
|
||||
for color guessing.
|
||||
- Added multi-frame support for mccharset, where all frames use the same
|
||||
charset.
|
||||
- Add support for any centered fullscreen image resolution bigger than
|
||||
320x200 and other than 384x272.
|
||||
- Add support for Marq's PETSCII tool .png resolution 352x232 (thanks jab).
|
||||
- Bugfix: docs fixes related to installation from source (thanks jab).
|
||||
- Bugfix: hide findECMColors log behind -verbose mode (thanks jab).
|
||||
- Docs fix: add a bit more info for sprites (thanks fungus).
|
||||
|
||||
## Changes for version 1.6
|
||||
|
||||
- Added -mode mixedcharset for mixed multicolor/singlecolor and
|
||||
individual d800 colors per char.
|
||||
- Modified -mode sccharset to use individual d800 colors per char.
|
||||
- Added -mode petscii.
|
||||
- Added -mode ecm.
|
||||
- Added -no-pack-empty to skip packing empty chars to filled chars to re-use
|
||||
for different colors. Only for mixed and ecm charsets.
|
||||
- Added -force-pack-empty for singlecolor and multicolor charset, may save
|
||||
a char, but usually pack-ratio is worse due to increased d800 color usage.
|
||||
- Improved auto-detection of graphics modes, including various charset modes.
|
||||
- Added sid support to charset displayers.
|
||||
- Added fullscreen fade in/out to charset displayers.
|
||||
- Bug Fix: -force-border-color for singlecolor charset (thanks Raistlin).
|
||||
- Bug Fix: do not write empty .prg file on error.
|
||||
- Standardized d02x colors in output.prg for charset modes.
|
||||
|
||||
## Changes for version 1.4
|
||||
|
||||
- Support for even more far-out palette ranges (thanks Perplex).
|
||||
- Now throws an error if the palette can't be detected properly, this should
|
||||
never happen. Please let me know if you run into this error.
|
||||
- Separated library and cli tool.
|
||||
- Library supports the standard [io.Reader](https://pkg.go.dev/io#Reader) and [io.Writer](https://pkg.go.dev/io#Writer) interfaces.
|
||||
- Patched [TSCrunch](https://github.com/staD020/TSCrunch/) further to increase crunch speed and use less memory.
|
||||
- Added -parallel and -worker flags to treat each input file as standalone
|
||||
and convert all files in parallel. Gifs with multiple frames are still
|
||||
treated as animations.
|
||||
- Stop relying on .gif filename extension, detect it.
|
||||
- Add -alt-offset flag to force screenshot offset 32, 36), used by a few
|
||||
graphicians. Though, please switch to the correct 32, 35.
|
||||
- Add -symbols flag to write symbols to a .sym file.
|
||||
- Interlace support for mcibitmap (drazlace and truepaint).
|
||||
- Bugfix: allow blank images input (thanks Spider-J).
|
||||
- Allow colors not present in the image as -bitpair-colors (thanks Map).
|
||||
|
||||
## Changes for version 1.2
|
||||
|
||||
- Added displayer for koala animations.
|
||||
- Added displayer for hires animations.
|
||||
- Added -frame-delay flag for animation displayers.
|
||||
- Added -wait-seconds flag for animation displayers.
|
||||
- Fixed bug in koala/hires displayers not allowing sids to overlap $c000-$c7ff.
|
||||
- Expanding wildcards: using pic??.png or pic*.png now also works on Windows.
|
||||
- Set bank via $dd00 in displayers.
|
||||
|
||||
## Changes for version 1.0
|
||||
|
||||
- Added fullscreen fade in/out to koala and hires displayers.
|
||||
- Added optional .sid support for koala and hires displayers.
|
||||
- Added optional crunching for all displayers using TSCrunch.
|
||||
|
||||
## Credits
|
||||
|
||||
Png2prg was created by Burglar, using the following third-party libraries:
|
||||
|
||||
[TSCrunch 1.3](https://github.com/tonysavon/TSCrunch/) by Antonio Savona for optional crunching when exporting
|
||||
an image with a displayer.
|
||||
|
||||
[Colfade Doc](https://csdb.dk/release/?id=132276) by Veto for the color fade tables used in the displayers.
|
||||
|
||||
[Kick Assembler](http://www.theweb.dk/KickAssembler/) by Slammer to compile the displayers.
|
||||
|
||||
[Go](https://go.dev/) by The Go Authors is the programming language used to create png2prg.
|
||||
|
||||
### Thanks to
|
||||
|
||||
Apollyon, Spider-J, Brush, The Sarge, Fungus, Jab, Shine, Raistlin, Perplex,
|
||||
Map, Youth, IcePic, Sander, Guinea Pig, Krill, Christopher Jam, Sparta,
|
||||
Acrouzet, Trident, Worrior1 and Antonio Savona.
|
||||
|
||||
## Options
|
||||
|
||||
```
|
||||
-alt-offset
|
||||
use alternate screenshot offset with x,y = 32,36
|
||||
-ao
|
||||
alt-offset
|
||||
-bf
|
||||
brute-force
|
||||
-bitpair-colors string
|
||||
prefer these colors in 2bit space, eg 0,6,14,3
|
||||
-bpc string
|
||||
bitpair-colors
|
||||
-bpc2 string
|
||||
secondary bitpair colors eg 0,2,10,7
|
||||
-bpc3 string
|
||||
tertiary bitpair colors eg 0,11,12,15
|
||||
-brute-force
|
||||
brute force bitpair-colors
|
||||
-cpuprofile file
|
||||
write cpu profile to file
|
||||
-d display
|
||||
-d016 int
|
||||
d016offset (default 1)
|
||||
-d016offset int
|
||||
number of pixels to shift with d016 when using interlace (default 1)
|
||||
-display
|
||||
include displayer
|
||||
-force-border-color int
|
||||
force border color (default -1)
|
||||
-force-pack-empty
|
||||
optimize packing empty chars (only for sccharset)
|
||||
-fpe
|
||||
force-pack-empty
|
||||
-frame-delay int
|
||||
frames to wait before displaying next animation frame (default 6)
|
||||
-h help
|
||||
-help
|
||||
help
|
||||
-i interlace
|
||||
-interlace
|
||||
when you supply 2 frames, specify -interlace to treat the images as such
|
||||
-m string
|
||||
mode
|
||||
-memprofile file
|
||||
write memory profile to file (only in -parallel mode)
|
||||
-mode string
|
||||
force graphics mode to koala, hires, mixedcharset, sccharset, mccharset (4col), scsprites or mcsprites
|
||||
-na
|
||||
no-anim
|
||||
-nbc
|
||||
no-bitpair-counters
|
||||
-nc
|
||||
no-crunch
|
||||
-nf
|
||||
no-fade
|
||||
-ng
|
||||
no-guess
|
||||
-nl
|
||||
no-loop
|
||||
-no-anim
|
||||
disable charset animations and store frames as separate screens
|
||||
-no-bitpair-counters
|
||||
do not use c64color bitpar counters optimization
|
||||
-no-crunch
|
||||
do not TSCrunch displayer
|
||||
-no-fade
|
||||
do not use fade in/out and free up a lot of memory
|
||||
-no-guess
|
||||
do not guess preferred bitpair-colors
|
||||
-no-loop
|
||||
play animations only once
|
||||
-no-pack
|
||||
do not pack chars (only for sc/mc charset)
|
||||
-no-pack-empty
|
||||
do not optimize packing empty chars (only for mc/mixed/ecm charset)
|
||||
-no-prev-char-colors
|
||||
do not look at the previous char's bitpair-colors, in some cases this optimization causes worse pack results
|
||||
-np
|
||||
no-pack
|
||||
-npcc
|
||||
no-prev-char-colors
|
||||
-npe
|
||||
no-pack-empty
|
||||
-o string
|
||||
out
|
||||
-out string
|
||||
specify outfile.prg, by default it changes extension to .prg
|
||||
-p parallel
|
||||
-parallel
|
||||
run number of workers in parallel for fast conversion, treat each image as a standalone, not to be used for animations, unless an anim.csv is used
|
||||
-q quiet
|
||||
-quiet
|
||||
quiet, only display errors
|
||||
-sid string
|
||||
include .sid in displayer (see -help for free memory locations)
|
||||
-sym
|
||||
symbols
|
||||
-symbols
|
||||
export symbols to .sym
|
||||
-targetdir string
|
||||
specify targetdir
|
||||
-td string
|
||||
targetdir
|
||||
-trd
|
||||
has side effect of enforcing screenram bitpair colors in level area
|
||||
-v verbose
|
||||
-verbose
|
||||
verbose output
|
||||
-vv
|
||||
very verbose, show memory usage map in most cases and implies -verbose
|
||||
-w int
|
||||
workers (default 12)
|
||||
-wait-seconds int
|
||||
seconds to wait before animation starts
|
||||
-workers int
|
||||
number of concurrent workers in -parallel or -brute-force mode (default 12)
|
||||
```
|
||||
|
||||
BIN
loader/samples/minexample/png2prg 2/title_ifli.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
loader/samples/minexample/png2prg 2/title_ifli_i1.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
loader/samples/minexample/png2prg 2/title_ifli_i1_2x.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
loader/samples/minexample/png2prg 2/title_ifli_i2.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
loader/samples/minexample/png2prg 2/title_ifli_i2_2x.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
29
loader/samples/minexample/png2prg 2/ys2.csv
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
5,ys2/01_badguyz/koala/png/01.png
|
||||
5,ys2/01_badguyz/koala/png/02.png
|
||||
5,ys2/01_badguyz/koala/png/03.png
|
||||
5,ys2/01_badguyz/koala/png/04.png
|
||||
5,ys2/01_badguyz/koala/png/05.png
|
||||
50,ys2/01_badguyz/koala/png/06.png
|
||||
15,ys2/01_badguyz/koala/png/07.png
|
||||
15,ys2/01_badguyz/koala/png/08.png
|
||||
15,ys2/01_badguyz/koala/png/09.png
|
||||
15,ys2/01_badguyz/koala/png/10.png
|
||||
15,ys2/01_badguyz/koala/png/11.png
|
||||
100,ys2/01_badguyz/koala/png/12.png
|
||||
15,ys2/01_badguyz/koala/png/10.png
|
||||
15,ys2/01_badguyz/koala/png/09.png
|
||||
15,ys2/01_badguyz/koala/png/08.png
|
||||
15,ys2/01_badguyz/koala/png/07.png
|
||||
100,ys2/01_badguyz/koala/png/06.png
|
||||
5,ys2/01_badguyz/koala/png/13.png
|
||||
5,ys2/01_badguyz/koala/png/14.png
|
||||
5,ys2/01_badguyz/koala/png/15.png
|
||||
5,ys2/01_badguyz/koala/png/16.png
|
||||
5,ys2/01_badguyz/koala/png/17.png
|
||||
5,ys2/01_badguyz/koala/png/18.png
|
||||
5,ys2/01_badguyz/koala/png/19.png
|
||||
100,ys2/01_badguyz/koala/png/00.png
|
||||
|
||||
|
||||
|
||||
|
BIN
loader/samples/minexample/png2prg 2/ys2.prg
Normal file
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/00.bmp
Normal file
|
After Width: | Height: | Size: 175 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/01.bmp
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/02.bmp
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/03.bmp
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/04.bmp
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/05.bmp
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/06.bmp
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/07.bmp
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/08.bmp
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/09.bmp
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/10.bmp
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/11.bmp
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/12.bmp
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/13.bmp
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/14.bmp
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/15.bmp
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/16.bmp
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/17.bmp
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/18.bmp
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/19.bmp
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/koala/00.bmp
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/koala/01.bmp
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/koala/02.bmp
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/koala/03.bmp
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/koala/04.bmp
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/koala/05.bmp
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/koala/06.bmp
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/koala/07.bmp
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/koala/08.bmp
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/koala/09.bmp
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/koala/10.bmp
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/koala/11.bmp
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/koala/12.bmp
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/koala/13.bmp
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/koala/14.bmp
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/koala/15.bmp
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/koala/16.bmp
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/koala/17.bmp
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/koala/18.bmp
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
loader/samples/minexample/png2prg 2/ys2/01_badguyz/koala/19.bmp
Normal file
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 188 KiB |