[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Another experiment in crunching...



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.