[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ADTPro 1.1.6 released
schmidtd wrote:
> On Aug 3, 8:39�am, lyricalnan...@dosius.ath.cx (Steve Nickolas) wrote:
>> I actually wrote a bootloader which is connected with the system I use to
>> pack my games. �It's actually possible on a ][+ or //e to load a
>> compressed
>> image of ProDOS, then a compressed image of a system file, with a little
>> stub activated by typing nothing else but LOAD.
>
> That's very cool. More the approach I took with the /// - there are
> multiple phases to the bootstrapping, but they all happen
> automatically once you kick it off.
>
> How much compression do you get out of the ProDOS image? And what
> compression method do you use? Is there much benefit in the overall
> time/space trade-off in compressing it?
>
I use Exomizer, a tool intended for compressing C64 programs that generates
a C64 BASIC payload. The payload of PRODOS itself was compressed from 15360
bytes to 11367, which isn't that much compression, but the big advantage is
the stub it creates - by doing a single-byte patch to the stub (changing the
C64's "SYS" token to an FPBASIC "CALL" token) and stripping off the 2-byte
(address) header, I created a file I could load on an Apple. (This is the
same thing I do for Apple Crunch. Exomizer wants files with Commodore-style
2-byte headers, so I put the headers on and take them off.)
The initial payload - which doesn't benefit from compression, but I use it
since it's stupid simple - is this:
000000r 1 putch = $FDED
000000r 1 read = $FEFD
000000r 1
000000r 1 .org $6000
006000 1 A0 00 entry: ldy #$00
006002 1 B9 69 60 @1: lda signon, y
006005 1 F0 08 beq @2
006007 1 09 80 ora #$80
006009 1 20 ED FD jsr putch
00600C 1 C8 iny
00600D 1 D0 F3 bne @1
00600F 1 20 47 60 @2: jsr vartio ; get
ProDOS-8 payload
006012 1 20 FD FE jsr read
006015 1 18 clc
006016 1 A5 67 lda $67
006018 1 65 50 adc $50
00601A 1 85 69 sta $69
00601C 1 A5 68 lda $68
00601E 1 65 51 adc $51
006020 1 85 6A sta $6A
006022 1 20 58 60 jsr progio
006025 1 20 FD FE jsr read
006028 1 20 0D 08 jsr 2061
00602B 1 20 47 60 jsr vartio ; get SYS
payload
00602E 1 20 FD FE jsr read
006031 1 18 clc
006032 1 A5 67 lda $67
006034 1 65 50 adc $50
006036 1 85 69 sta $69
006038 1 A5 68 lda $68
00603A 1 65 51 adc $51
00603C 1 85 6A sta $6A
00603E 1 20 58 60 jsr progio
006041 1 20 FD FE jsr read
006044 1 4C 0D 08 jmp 2061
006047 1 A9 50 vartio: lda #$50
006049 1 A0 00 ldy #$00
00604B 1 85 3C sta $3C
00604D 1 84 3D sty $3D
00604F 1 A9 52 lda #$52
006051 1 85 3E sta $3E
006053 1 84 3F sty $3F
006055 1 84 D6 sty $D6
006057 1 60 rts
006058 1 A5 67 progio: lda $67
00605A 1 A4 68 ldy $68
00605C 1 85 3C sta $3C
00605E 1 84 3D sty $3D
006060 1 A5 69 lda $69
006062 1 A4 6A ldy $6A
006064 1 85 3E sta $3E
006066 1 84 3F sty $3F
006068 1 60 rts
006069 1 4C 4F 41 44 signon: .byte "LOADING PRODOS-8 PAYLOAD FROM
TAPE", 13, 0
00606D 1 49 4E 47 20
006071 1 50 52 4F 44
00608C 1
The "JSR/JMP 2061", or $080D, jumps over the stub - any program compressed
with Exomizer "exomizer sfx 0xADDR -n -o filename.pak filename.prg" will
start at this address - and in fact there are 3 actual stages of loading.
The first stage is the above code run through exomizer. The second stage is
an ordinary PRODOS (version 1.2 or later only, as it uses the $2003 vector
which only 1.2 and later have) file, also run through exomizer, and the
third stage is usually a SYSTEM file run through exomizer.
Someone, I can't remember who (this is getting annoyingly common), posted on
a previous thread a link to a program called a2audioup. I use this to then
take an fpbasic payload and convert it into something that can be run with
LOAD, by generating the proper header (length low-endian, followed by a byte
with the high order bit set), running a2audioup on it, then doing the same
with the actual payload. I add about a second's pause after the longer
file, then merge them together, using ffmpeg to "sanitize" the WAV file. I
believe I put a 5 second pause after each component to give the computer
time to catch up.
-uso.