34
A Myst Demake for the Apple II Vince “DEATER” Weaver [email protected] University of Maine Kansasfest 2020 — 24 July 2020

DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

A Myst Demake for the Apple IIVince “DEATER” Weaver

[email protected]

University of Maine

Kansasfest 2020 — 24 July 2020

Page 2: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Are there any Maine Apple II Connections?

1

Page 3: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

UMaine famous alum – Chuck Peddle

Designer of the 6502 Chip

2

Page 4: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

6502 Exhibit

3

Page 5: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Apple II Demakes and Demos by Me

4

Page 6: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Background on Myst

• Early CD-ROM game, 550MB

• Point and click, pre-rendered graphics

• Cyan Inc (Miller Brothers) 1993

• Originally for Mac with 256 colors, HyperCard

• 6 million copies sold

5

Page 7: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

How Do You Fit a 1993 CD-ROM Gameonto an Apple II from 1977?

6

Page 8: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

System Requirements

• Apple II/II+/IIe (also IIc/IIgs, not well tested)

• Disk II drive

• 48k RAM (64k required for digitized sound effect)

• Mockingboard for music in intro

7

Page 9: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Status

• Game fully playable from intro to various endings

• The main island is more or less complete

• Some of the puzzles in the sub-ages are not quite done

yet.

• Some, like the submarine puzzle, probably never will be

8

Page 10: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Broken up into 15 Segments (RAM)

9

Page 11: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Game Engine

• Overall fairly simple

• Wrote from scratch by playing game, did not investigate

original game code

• Written entirely in 6502 assembly language

10

Page 12: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Main Game Loop

• Copy background from $C00 to off-screen page

• Draw foreground items/animations (optional)

• Draw hand cursor: (special cases: edge of screen check

for valid directions holding pages, matches, key)

• Graphics Page Flip

• Check keyboard, Move Cursor

• If clicked, change location/bg, or special action

• If click takes us to new level, exit back to loader

11

Page 13: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Some Common Helper Routines

• Decompress background in LZSA to $C00

• Fast memory copy to $400 or $800 (lores page1/page2)

• Sprite drawing code

◦ Cheats and Y must be even (code much simpler)

◦ Handles transparency, Grey2 is transparent color

(so we can have black in sprites)

• Text is often stored in graphics, as LORES/TEXT are

equivalent in Apple II

12

Page 14: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Series of Connected Rooms – Example; MIST_CLOCK -- clock

location11:

.byte MIST_TREE_CORRIDOR_5 ; north exit

.byte MIST_CLOCK_PUZZLE ; south exit

.byte $ff ; east exit

.byte $ff ; west exit

.byte DIRECTION_N ; north exit_dir

.byte DIRECTION_S ; south exit_dir

.byte $ff ; east exit_dir

.byte $ff ; west exit_dir

.word clock_n_lzsa ; north bg

.word clock_s_lzsa ; south bg

.word clock_e_lzsa ; east bg

.word $0000 ; west bg

.byte BG_SOUTH|BG_EAST|BG_NORTH

.byte DIRECTION_E ; special exit

.byte 5,30 ; special x

.byte 2,46 ; special y

.word enter_channel_clock -1 ; special function

13

Page 15: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Complex puzzles

• Mixed Text/Graphics (Generator and Planetarium)

• Rooms with more than 4 exits (library)

14

Page 16: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Input Issues

• Keyboard

◦ Always a challenge on Apple II

◦ No up/down on II+, so also allow WASD

◦ Can’t tell how long key being held (needed for example

in the gear puzzle)

• Joystick – TODO. Latency?

• Mouse – don’t have one?

15

Page 17: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Currently 729 Background Images

16

Page 18: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Graphics Design

• All are hand-traced over screenshots from game

• Slow. Can watch a video of the procedure here:

https://www.youtube.com/watch?v=6XNu3v8rukQ

17

Page 19: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Most common question: Why not usebetter graphics?

• I like lo-res graphics and have existing code for loading,

animating, sprites

• I want this to run on an Apple II+

• I want to fit as much into RAM as possible to avoid

disk accesses

18

Page 20: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Graphics Examples

• AppleWin 1.29.12.0 with 50% Color TV

• Generated using Bill Buckels’ Bmp2DHR v1.0

Using -d1 (Floyd-Steinberg dithering)

• SHR with GSplus 0.14 and SuperConverter 4.0

19

Page 21: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Lo-res (automatic)

40x48, 15 colors. ˜1kB

20

Page 22: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Lo-res (hand-drawn)

40x48, 15 colors. ˜1kB

21

Page 23: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Double Lo-res

80x48, 15 colors. ˜2kB, IIe/80col card, complicated code

22

Page 24: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Hi-res

280x192, 6 colors. 8kB

23

Page 25: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Double Hi-res

280x192, 15 colors. ˜16kB, 128k IIe, complicated code

24

Page 26: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Super Hi-res

320x200 or 640x300 4096 colors, 32kB, IIgs

IIgs was contemporary with systems that saw real ports

25

Page 27: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Minimizing the number of 140k Floppies

• Compression

• Lo-res images

• Fewer areas of the game

(generally skip every other step)

• Simplify some corner cases

(e.g. pentagon platforms in channelwood)

• This also helps fit in RAM better, swapping floppies

and waiting 45s to load takes you out of game

26

Page 28: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Potential Ways to Get Even Smaller

• Simpler graphics (that compress better)

• Generate backgrounds algorithmicly (pillars area with

distinct backgrounds)

• Some paths in game are mirror-images, have some sort

of flag to specify flipped background?

• Crazy disk hacks

◦ Use custom booter/RWTS to save 12k from dos33

◦ RWTS18 disk format (Gustafsson) 157k on disk

27

Page 29: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Compression

• Uses LZSA2 compression library by Emmanual Marty

https://github.com/emmanuel-marty/lzsa

• Qkumba had some part in the optimizations

• Graphics compress down to only 33% of original size

0

256

512

768

1024

Co

mp

resse

d S

ize

(b

yte

s)

arborcabin

channeldentist

dnigenerator

mechemist

nibeloctagon

selenaship

stoneytitle

viewer

28

Page 30: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Disk I/O and Load/Save Games

• Levels are split up as max size is 40k

• DOS33 filesystem but not DOS33 (too big in RAM)

• Use Qkumba’s RTS

• He made write code; haven’t had time to use it yet

• Load and Save games

◦ Loading is straightforward, state is in zero page and is

only 74 bytes ($80-$CA)

◦ Save is TODO but definitely possible

29

Page 31: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Myst has a lot of Sound

• Many sound puzzles, hard to implement on Apple II

• For simple clicks/tones just use the speaker

• Digital sounds are large, use language card.

• Currently linking noise (12k) with the 4k possibly for

“bring red page”

• Use “BTC” player by Oliver Schmidt.

• If you have a Mockingboard a PT3 rendition of the

Myst theme plays during the intro using my pt3-player

30

Page 32: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Development

• Develop on Linux

• Graphics in Gimp plus custom tools

• Assembler is ca65 from the cc65 project

• nano text editor

• Testing in AppleWin under Wine on Linux

31

Page 33: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Future Work

• Hooking up rest of puzzles, especially Stoneship

• Some of the missing locations, especially Channelwood

• Various missing animations

• Sound and music

32

Page 34: DEATER Weaver · If clicked, change location/bg, or special action If click takes us to new level, exit back to loader 11. Some Common Helper Routines ... Crazy disk hacks Use custom

Questions?

[email protected]

More Info and Sourcecode

Mist/Myst Apple II Demakehttp://www.deater.net/weave/vmwprod/mist/

Sourcecodehttps://github.com/deater/dos33fsprogs/mist/

33