[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Another experiment in crunching...
- Subject: Another experiment in crunching...
- From: Steve Nickolas <usotsuki@buric.co>
- Date: Tue, 25 Sep 2012 22:31:37 -0400
- Cancel-lock: sha1:zPoHiCWRsHCJ1+Ed8bUEcODL4B0=
- Injection-info: mx04.eternal-september.org; posting-host="b1331f5cb4326106a7720f5a86b16b36"; logging-data="14996"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+eahJLBQUI1dDEUIQC8x2gNaHvsOA8U4="
- Newsgroups: comp.sys.apple2
- Organization: A noiseless patient Spider
- User-agent: Alpine 2.02 (DEB 1266 2009-07-14)
The 1980 game OREGON (forerunner of the more popular "Oregon Trail") is 3
files on a standard DOS 3.3 disk. (Elementary Volume 6)
It is made up of 3 files:
*A 036 OREGON
*A 042 OREGONA
*B 015 OREGONMAP
Now, the only overlap is between the two BASIC programs, and all the DOS
work is done at one time in OREGON. (OREGONA disables DOS first thing.)
Nothing fancy is done with the load addresses, either. Piece o' cake.
By patching OREGON:
1. OREGONMAP is preloaded above OREGON in its final resting place,
immediately below graphics page 2.
2. OREGONA is loaded high, on top of graphics page 2 (where there is
plenty of space).
3. Instead of loading the other two files, OREGON calls a relocator to
move OREGONA over it, then calls the FPBASIC RUN code.
After this, I used Exomizer to crunch it. tl;dr you can download the file
from http://1.buric.co/oregon.dsk.gz . And now for the gories...
I wrote a wrapper that turns this all into binary, to the tune of:
-8X--------------------------------------------------------------------
.org $07FD
jmp $4000
.byte $00
.incbin "oretan/OREGON#fc0801"
.res $32AA-*, 0
.incbin "oretan/OREGONMAP#0632aa"
.res $4000-*, 0
entry: jsr $FE84
jsr $FE89
jsr $FE93
jsr $FB2F
lda #<$0801
sta $67
lda #>$0801
sta $68
lda #<$2A1F
sta $69
sta $AF
lda #>$2A1F
sta $6A
sta $AF
jmp run
.res $4080-*, 0 ; CALL 16512
entry3: lda #<$4800
sta $3C
lda #>$4800
sta $3D
lda #<$0800
sta $3E
lda #>$0800
sta $3F
ldy #$00
@1: lda ($3C), y
sta ($3E), y
inc $3C
bne @2
inc $3D
@2: inc $3E
bne @3
inc $3F
@3: lda $3C
cmp #<eoprog
bne @1
lda $3D
cmp #>eoprog
bne @1
ldy #$00
lda #<$307D
sta $69
sta $AF
lda #>$307D
sta $6A
sta $AF
run: sty $F3
sty $33
sty $D8
iny
sty $F1
jsr $D665
jmp $D7D2
.res $4700-*, 0
.res $4801-*, 0
.incbin "oretan/OREGONA#fc0801"
eoprog:
-8X--------------------------------------------------------------------
My alteration of OREGON was to replace line 940 with:
940 CALL 16512: REM MOVE REST OF CODE DOWN & RERUN
The other files were unaltered. The code is tested and working.
-uso.