Skip to content
Browse files

Attempted line ending fix

  • Loading branch information...
1 parent 1e3d46d commit bc9ce5bb8bac333f7559720812f8f0c24b168250 jmechner committed
Sorry, we could not display the entire diff because it was too big.
View
1,956 01 POP Source/Source/AUTO.S
1,955 additions, 1 deletion not shown because the diff is too large. Please use a local Git client to view these changes.
View
199 01 POP Source/Source/BGDATA.S
@@ -1 +1,198 @@
-* bgdata
+* bgdata
+ tr on
+*-------------------------------
+* Indexed by PIECE ID#:
+
+space = 0
+floor = 1
+spikes = 2
+posts = 3
+gate = 4
+dpressplate = 5 ;down
+pressplate = 6 ;up
+panelwif = 7 ;w/floor
+pillarbottom = 8
+pillartop = 9
+flask = 10
+loose = 11
+panelwof = 12 ;w/o floor
+mirror = 13
+rubble = 14
+upressplate = 15
+exit = 16
+exit2 = 17
+slicer = 18
+torch = 19
+block = 20
+bones = 21
+sword = 22
+window = 23
+window2 = 24
+archbot = 25
+archtop1 = 26
+archtop2 = 27
+archtop3 = 28
+archtop4 = 29
+
+*-------------------------------
+* A & B sections have l.l. of (X = BlockLeft, Y = BlockBot-3)
+* C & D sections have l.l. of (X = BlockLeft, Y = BlockBot)
+* All x & y offsets are relative to these values
+* (Front pieces are relative to A)
+
+*-------------------------------
+* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+* 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
+
+maska hex 00,03,03,03,03,03,03,03,03,00,03,03,00,03,03,03
+ hex 03,00,00,03,00,03,00,03,00,03,00,00,00,00
+
+piecea hex 00,01,05,07,0a,01,01,0a,10,00,01,00,00,14,20,4b
+ hex 01,00,00,01,00,97,00,01,00,a7,a9,aa,ac,ad
+
+pieceay hex 00,00,00,00,00,01,00,00,00,00,00,00,00,00,00,00
+ dfb 00,00,00,00,00,00,00,00,00,00,00,-4,-4,-4
+
+maskb hex 00,04,04,04,04,04,04,00,04,00,04,00,00,04,04,04
+ hex 00,04,04,04,04,04,04,00,04,04,00,00,00,00
+
+pieceb hex 00,02,06,08,0b,1b,02,9e,1a,1c,02,00,9e,4a,21,1b
+ hex 4d,4e,02,51,84,98,02,91,92,02,00,00,00,00
+
+pieceby dfb 00,00,00,00,00,01,00,03,00,03,00,00,03,00,00,-1
+ dfb 00,00,00,-1,02,00,00,00,00,00,00,00,00,00
+
+bstripe hex 00,47,47,00,00,47,47,00,00,00,47,47,00,00,47,47
+ hex 00,00,47,00,00,00,47,00,00,47,00,00,00,00
+
+* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+* 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
+
+piecec hex 00,00,00,09,0c,00,00,9f,00,1d,00,00,9f,00,00,00
+ hex 4f,50,00,00,85,00,00,93,94,00,00,00,00,00
+
+pieced hex 00,15,15,15,15,18,19,16,15,00,15,00,17,15,2e,4c
+ hex 15,15,15,15,86,15,15,15,15,15,ab,00,00,00
+
+fronti hex 00,00,00,45,46,00,00,46,48,49,87,00,46,0f,13,00
+ hex 00,00,00,00,83,00,00,00,00,a8,00,ae,ae,ae
+
+fronty dfb 00,00,00,-1,00,00,00,00,-1,03,-3,00,00,-1,00,00
+ dfb 00,00,00,00,00,00,00,00,00,-1,0,-36,-36,-36
+
+frontx hex 00,00,00,01,03,00,00,03,01,01,02,00,03,01,00,00
+ hex 00,00,00,00,00,00,00,00,00,01,00,00,00,00
+
+*-------------------------------
+* special pieces
+
+gatebotSTA = $43
+gatebotORA = $44
+gateB1 = $37
+gatecmask = $0d
+
+gate8c hex 2f,30,31,32,33,34,35,36
+gate8b hex 3e,3d,3c,3b,3a,39,38,37
+
+*-------------------------------
+* Climbup masking
+
+CUmask = $11
+CUpiece = $12
+CUpost = $0e
+
+*-------------------------------
+* Exit
+
+stairs = $6b
+door = $6c
+doormask = $6d
+toprepair = $6e
+
+archtop3sp = $a1
+
+*-------------------------------
+* Spike animation frames
+* 0 1 2 3 4 5 6 7 8 9 10 11
+
+spikea hex 00,22,24,26,28,2a,28,24,22,00
+spikeb hex 00,23,25,27,29,2b,29,25,23,00
+
+spikeExt = 5 ;
+spikeRet = 9 ;must match MOVEDATA
+
+*-------------------------------
+* Slicer animation frames
+* 0 1 2 3 4 5 6 7 8 9 10 11
+
+slicerseq dfb 04,03,01,02,05,04,04
+
+slicerExt = 2
+slicerRet = 6 ;must match MOVEDATA
+
+slicertop hex 00,58,5a,5c,5e
+slicerbot hex 57,59,5b,5d,5f
+slicerbot2 hex 8e,8f,90,5d,5f ;smeared
+slicergap dfb 00,38,46,53,55
+slicerfrnt hex 65,66,67,68,69
+
+*-------------------------------
+* Loose floor
+* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+
+looseb = $1b
+
+loosea hex 01,1e,01,1f,1f,01,01,01,1f,1f,1f
+looseby dfb 00,01,00,-1,-1,00,00,00,-1,-1,-1
+loosed hex 15,2c,15,2d,2d,15,15,15,2d,2d,2d
+
+Ffalling = 10 ;1st "falling" frame
+;must match MOVEDATA
+
+*-------------------------------
+specialflask = $95
+
+swordgleam1 = $b3
+swordgleam0 = $99
+
+*-------------------------------
+* panels
+
+panelb0 = $9e
+panelc0 = $9f
+numpans = 3
+
+panelb hex 9e,9a,81
+panelc hex 9f,9b,82
+
+archpanel = $a1
+
+*-------------------------------
+* back wall panels for space & floor
+
+numbpans = 3
+
+spaceb hex 00,a3,a5,a6
+spaceby dfb 0,-20,-20,0
+
+floorb hex 02,a2,a4,a4
+floorby dfb 00,00,00,00
+
+*-------------------------------
+* solid blocks
+
+numblox = 2
+
+blockb hex 84,6f
+blockc hex 85,85
+blockd hex 86,86
+blockfr hex 83,83
+
+*-------------------------------
+* moveparams
+
+gmaxval = 47*4
+gminval = 0
+
+*-------------------------------
+eof
View
235 01 POP Source/Source/BOOT.S
@@ -1 +1,234 @@
-* boot
+* boot
+org = $800
+ lst off
+*-------------------------------
+* $800 TS (0,0) boot sector
+
+SLOT = $2b
+sector = $50
+
+text = $fb2f
+home = $fc58
+vtab = $FB5B
+cout = $FDF0
+normal = $fe84
+pr0 = $fe93
+in0 = $fe89
+
+*-------------------------------
+ org org
+
+ hex 01
+
+entry lda #$60
+ sta entry
+
+ lda #$ff
+ sta $4fb
+ sta $3f3
+ sta $3f4
+ sta $c000 ;80store off
+ sta $c002 ;RAMRD main
+ sta $c004 ;RAMWRT main
+ sta $c00c ;80col off
+ sta $c00e ;Altcharset off
+ sta $c081 ;write RAM, read ROM (2nd 4k bank)
+ jsr text
+ jsr home
+ jsr normal
+ jsr pr0
+ jsr in0
+
+ ldx SLOT
+ txa
+ lsr
+ lsr
+ lsr
+ lsr
+ ora #$c0
+ sta :rdsect+2
+ lda #$0f
+ sta sector
+
+:0 ldy sector
+ lda skewtbl,y
+ sta $3d
+ lda sectaddr,y
+ beq :1
+ sta $27
+:rdsect jsr $005c
+:1 dec sector
+ bne :0
+
+ lda SLOT
+ jmp $900
+
+skewtbl hex 00,0d,0b,09,07,05,03,01
+ hex 0e,0c,0a,08,06,04,02,0f
+
+sectaddr hex 00,09,00,00,00,00,00,00
+ hex 30,31,32,33,34,00,00,00
+
+*===============================
+* boot stage 2
+
+rw18 = $d000
+
+slot = $fd
+track = $fe
+lastrack = $ff
+
+ dum $00
+
+dest ds 2
+source ds 2
+endsourc ds 2
+
+ dend
+*-------------------------------
+ ds $900-*
+
+stage2 stx slot
+
+ jsr check128k ;check for 128K memory
+
+ jsr moverw18 ;& move RW18 to D000
+
+ lda #0
+ sta lastrack
+ sta $3f3
+ sta $3f4 ;zero reset vector
+
+ jsr rw18
+ hex 07,a9 ;Bbund ID byte
+
+ jsr rw18
+ hex 00,01,00 ;drive 1 on
+
+ jsr rw18 ;seek track 1
+ hex 02,00,01
+
+* load & run stage 3 boot
+* from drive 1
+
+ jsr rw18
+ hex c3,ee
+
+ jmp $ee00
+
+*-------------------------------------------------
+* Check for AUX memory routine
+
+CHECKER lda #$EE
+ sta $C005
+ sta $C003
+ sta $0800
+ lda $0C00
+ cmp #$EE
+ bne :0
+ asl $0C00
+ lda $0800
+ cmp $0C00
+ beq :1
+:0 clc
+:1 sta $C004
+ sta $C002
+ rts
+
+CHECKEND = *-CHECKER
+
+*-------------------------------------------------
+*
+* Check to make sure //c or //e
+* with 128k
+*
+*-------------------------------
+check128k
+ sta $c081
+
+ lda $FBB3 ;Apple // family ID byte
+ cmp #6
+ bne NOT128K ;Must be e/c/GS
+
+ bit $C017
+ bmi NOT128K
+
+ ldx #CHECKEND
+:0 lda CHECKER,X
+ sta $180,X
+ dex
+ bpl :0
+
+ jsr $180
+ bcs NOT128K
+
+ rts
+
+*-------------------------------
+* Turn off drive and display message
+
+NOT128K ldx SLOT
+ lda $C088,X
+
+ jsr text
+ jsr home
+ lda #8
+ jsr vtab
+
+ ldy #0
+:0 lda MEMTEXT,Y
+ beq *
+ jsr cout
+ cmp #$8D
+ bne :1
+ lda #4
+ sta $24
+:1 iny
+ bne :0
+
+MEMTEXT hex 8D
+ asc "REQUIRES A //C OR //E WITH 128K"
+ hex 00
+
+*-------------------------------
+* Move RW18
+* d0 < 30.40
+*-------------------------------
+moverw18
+ bit $c08b
+ bit $c08b ;rd/wrt RAM, 1st 4k bank
+
+ lda #$d0
+ ldx #$30
+ ldy #$40
+
+* a < x.y
+* 20 < 40.60 means 2000 < 4000.5fffm
+* WARNING: If x >= y, routine will wipe out 64k
+
+movemem sta dest+1
+ stx source+1
+ sty endsourc+1
+
+ ldy #0
+ sty dest
+ sty source
+ sty endsourc
+
+:loop lda (source),y
+ sta (dest),y
+
+ iny
+ bne :loop
+
+ inc source+1
+ inc dest+1
+
+ lda source+1
+ cmp endsourc+1
+ bne :loop
+
+ rts
+
+*-------------------------------
+ sav boot
View
1,516 01 POP Source/Source/COLL.S
1,515 additions, 1 deletion not shown because the diff is too large. Please use a local Git client to view these changes.
View
2,169 01 POP Source/Source/CTRL.S
2,168 additions, 1 deletion not shown because the diff is too large. Please use a local Git client to view these changes.
View
2,121 01 POP Source/Source/CTRLSUBS.S
2,120 additions, 1 deletion not shown because the diff is too large. Please use a local Git client to view these changes.
View
495 01 POP Source/Source/EQ.S
@@ -1 +1,494 @@
- tr on
+ tr on
+ lst off
+* eq
+*-------------------------------
+*
+* Equates
+*
+*-------------------------------
+* Main l.c.
+
+rw18 = $d000
+peelbuf1 = $d000
+peelbuf2 = $d800
+hrtables = $e000
+unpack = $ea00 ;game only
+hires = $ee00
+master = $f880
+
+* Auxmem
+
+grafix = $400
+tables = $e00
+frameadv = $1290
+redbufs = $5e00
+menudata = $960f ;ed only
+imlists = $ac00
+endimspace = $b600
+blueprnt = $b700
+
+* Aux l.c.
+
+bluecopy = $d000 ;bank 1
+
+*-------------------------------
+*
+* Jump tables
+*
+*-------------------------------
+ dum master
+
+_firstboot ds 3
+_loadlevel ds 3
+_reload ds 3
+_loadstage2 ds 3
+ ds 3
+
+_attractmode ds 3
+_cutprincess ds 3
+_savegame ds 3
+_loadgame ds 3
+_dostartgame ds 3
+
+_epilog ds 3
+_loadaltset ds 3
+ ds 3 ;_screendump
+
+ dum master ;ed
+
+ ds 15
+
+_edreboot ds 3
+_gobuild ds 3
+_gogame ds 3
+_writedir ds 3
+_readdir ds 3
+
+_savelevel ds 3
+_savelevelg ds 3
+_screendump ds 3
+
+ dum hrtables
+
+YLO ds $c0
+YHI ds $c0
+
+ dum hires
+
+_boot3 ds 3
+_cls ds 3
+_lay ds 3
+_fastlay ds 3
+_layrsave ds 3
+
+_lrcls ds 3
+_fastmask ds 3
+_fastblack ds 3
+_peel ds 3
+_getwidth ds 3
+
+_copy2000 ds 3
+_copy2000aux ds 3
+_setfastaux ds 3
+_setfastmain ds 3
+_copy2000ma ds 3
+
+_copy2000am ds 3
+
+
+ dum unpack
+
+SngExpand ds 3
+DblExpand ds 3
+DeltaExpPop ds 3
+_inverty ds 3
+DeltaExpWipe ds 3
+
+purple ds 3
+prompt ds 3
+blackout ds 3
+clr ds 3
+text ds 3
+
+setdhires ds 3
+fadein ds 3
+loadsuper ds 3
+fadeout ds 3
+
+ dum grafix
+
+gr ds 3
+drawall ds 3
+controller ds 3
+ ds 3
+saveblue ds 3
+
+reloadblue ds 3
+movemem ds 3
+buttons ds 3
+gtone ds 3
+setcenter ds 3
+
+dimchar ds 3
+cvtx ds 3
+zeropeel ds 3
+zeropeels ds 3
+pread ds 3
+
+addpeel ds 3
+copyscrn ds 3
+sngpeel ds 3
+rnd ds 3
+cls ds 3
+
+lay ds 3
+fastlay ds 3
+layrsave ds 3
+lrcls ds 3
+fastmask ds 3
+
+fastblack ds 3
+peel ds 3
+getwidth ds 3
+copy2000 ds 3
+copy2000ma ds 3
+
+setfastaux ds 3
+setfastmain ds 3
+loadlevel ds 3
+attractmode ds 3
+xminit ds 3
+
+xmplay ds 3
+cutprincess ds 3
+xtitle ds 3
+copy2000am ds 3
+reload ds 3
+
+loadstage2 ds 3
+ ds 3
+getselect ds 3
+getdesel ds 3
+edreboot ds 3 ;ed
+
+gobuild ds 3 ;ed
+gogame ds 3 ;ed
+writedir ds 3 ;ed
+readdir ds 3 ;ed
+savelevel ds 3 ;ed
+
+savelevelg ds 3 ;ed
+addback ds 3
+addfore ds 3
+addmid ds 3
+addmidez ds 3
+
+addwipe ds 3
+addmsg ds 3
+savegame ds 3
+loadgame ds 3
+zerolsts ds 3
+
+screendump ds 3
+minit ds 3
+mplay ds 3
+savebinfo ds 3
+reloadbinfo ds 3
+
+inverty ds 3
+normspeed ds 3
+addmidezo ds 3
+calcblue ds 3
+zerored ds 3
+
+xplaycut ds 3
+checkIIGS ds 3
+fastspeed ds 3
+musickeys ds 3
+dostartgame ds 3
+
+epilog ds 3
+loadaltset ds 3
+xmovemusic ds 3
+whoop ds 3
+vblank ds 3
+
+vbli ds 3
+
+ dum redbufs
+
+ ds 60 ;unused
+halfbuf ds 30
+redbuf ds 30
+fredbuf ds 30
+floorbuf ds 30
+wipebuf ds 30
+movebuf ds 30
+objbuf ds 30
+whitebuf ds 30
+topbuf ds 10
+
+ dum menudata ;ed only
+
+menutype ds 30
+menuspec ds 30
+menubspec ds 30
+
+ dum frameadv
+
+sure ds 3
+fast ds 3
+getinitobj ds 3
+
+ dum tables
+
+ByteTable ds $100
+OffsetTable ds $100
+BlockTable ds $100
+PixelTable ds $100
+Mult10 ds $10
+Mult7 ds $10
+Mult30 ds $40
+BlockEdge ds 20
+BlockTop ds 5
+BlockBot ds 5
+FloorY ds 5
+BlockAy ds 5
+
+ dum blueprnt
+
+BLUETYPE ds 24*30
+BLUESPEC ds 24*30
+LINKLOC ds 256
+LINKMAP ds 256
+MAP ds 24*4
+INFO ds 256
+
+*-------------------------------
+*
+* Blueprint info
+*
+*-------------------------------
+ dum INFO
+
+ ds 64
+KidStartScrn ds 1
+KidStartBlock ds 1
+KidStartFace ds 1
+ ds 1
+SwStartScrn ds 1
+SwStartBlock ds 1
+ ds 1
+GdStartBlock ds 24
+GdStartFace ds 24
+GdStartX ds 24
+GdStartSeqL ds 24
+GdStartProg ds 24
+GdStartSeqH ds 24
+
+*-------------------------------
+*
+* Image lists
+*
+*-------------------------------
+maxback = 200 ;x4
+maxfore = 100 ;x4
+maxwipe = 20 ;x5
+maxpeel = 46 ;x4
+maxmid = 46 ;x11
+maxobj = 20 ;x12
+maxmsg = 32 ;x5
+
+ dum imlists
+
+genCLS ds 1
+
+bgX ds maxback
+bgY ds maxback
+bgIMG ds maxback
+bgOP ds maxback
+
+fgX ds maxfore
+fgY ds maxfore
+fgIMG ds maxfore
+fgOP ds maxfore
+
+wipeX ds maxwipe
+wipeY ds maxwipe
+wipeH ds maxwipe
+wipeW ds maxwipe
+wipeCOL ds maxwipe
+
+peelX ds maxpeel*2
+peelY ds maxpeel*2
+peelIMGL ds maxpeel*2
+peelIMGH ds maxpeel*2
+
+midX ds maxmid
+midOFF ds maxmid
+midY ds maxmid
+midIMG ds maxmid
+midOP ds maxmid
+midTYP ds maxmid
+midCU ds maxmid
+midCD ds maxmid
+midCL ds maxmid
+midCR ds maxmid
+midTAB ds maxmid
+
+objINDX ds maxobj
+objX ds maxobj
+objOFF ds maxobj
+objY ds maxobj
+objIMG ds maxobj
+objFACE ds maxobj
+objTYP ds maxobj
+objCU ds maxobj
+objCD ds maxobj
+objCL ds maxobj
+objCR ds maxobj
+objTAB ds maxobj
+
+msgX ds maxmsg
+msgOFF ds maxmsg
+msgY ds maxmsg
+msgIMG ds maxmsg
+msgOP ds maxmsg
+
+*-------------------------------
+*
+* Zero page
+*
+*-------------------------------
+* $00-17: Hires parameters
+*-------------------------------
+ dum $00
+
+PAGE ds 1
+XCO ds 1
+YCO ds 1
+OFFSET ds 1
+IMAGE ds 2
+OPACITY ds 1
+TABLE ds 2
+PEELBUF ds 2
+PEELIMG ds 2
+PEELXCO ds 1
+PEELYCO ds 1
+TOPCUT ds 1
+LEFTCUT ds 1
+RIGHTCUT ds 1
+BANK ds 1
+BOTCUT ds 1
+
+height = IMAGE
+width = IMAGE+1
+
+*-------------------------------
+* $18-3f: Global vars
+*-------------------------------
+ dum $18
+
+JSTKX ds 1
+JSTKY ds 1
+BTN0 ds 1
+BTN1 ds 1
+BUTT0 ds 1
+BUTT1 ds 1
+JSTKUP ds 1
+b0down ds 1
+b1down ds 1
+SINGSTEP ds 1
+blackflag ds 1
+SCRNUM ds 1
+BlueType ds 2
+BlueSpec ds 2
+CUTTIMER ds 1
+PRECED ds 1
+spreced ds 1
+PREV ds 3
+sprev ds 3
+scrnLeft ds 1
+scrnRight ds 1
+scrnAbove ds 1
+scrnBelow ds 1
+scrnBelowL ds 1
+scrnAboveL ds 1
+scrnAboveR ds 1
+scrnBelowR ds 1
+kbdX ds 1
+kbdY ds 1
+joyX ds 1
+joyY ds 1
+btn ds 1
+butt ds 1
+
+*-------------------------------
+*
+* Pages 2-3
+*
+*-------------------------------
+ dum $200
+
+inmenu ds 1
+inbuilder ds 1
+ineditor ds 1
+soundon ds 1
+jctr ds 2
+jthres1x ds 1
+jthres1y ds 1
+jthres2x ds 1
+jthres2y ds 1
+jvert ds 1
+jhoriz ds 1
+jbtns ds 1
+joyon ds 1
+develment ds 1
+keypress ds 1
+keydown ds 1
+IIGS ds 1
+
+ dum $3c0
+
+sortX ds $10
+BELOW ds $10
+SBELOW ds $10
+
+ dum $3f0
+
+bluepTRK ds 1
+bluepREG ds 1
+binfoTRK ds 1
+binfoREG ds 1
+level ds 1
+BBundID ds 1
+redherring2 ds 1
+pausetemp ds 1
+recheck0 ds 1
+
+ dend
+
+*-------------------------------
+*
+* Misc. constants
+*
+*-------------------------------
+ScrnWidth = 140
+ScrnHeight = 192
+
+ScrnLeft = 58
+ScrnRight = ScrnLeft+ScrnWidth-1
+ScrnTop = 0
+ScrnBottom = ScrnTop+ScrnHeight-1
+
+secmask = %11000000
+reqmask = %00100000
+idmask = %00011111
+
+and = 0
+ora = 1
+sta = 2
+eor = 3
+mask = 4
+
+ lst off
View
2,268 01 POP Source/Source/FRAMEADV.S
2,267 additions, 1 deletion not shown because the diff is too large. Please use a local Git client to view these changes.
View
491 01 POP Source/Source/FRAMEDEF.S
@@ -1 +1,490 @@
-* framedef
+* framedef
+bof = $2800
+ tr on ;TABS 15,20,40
+ lst off
+ lstdo off
+
+*-------------------------------
+ dum bof
+
+org ds 1200
+altset1 ds 200
+altset2 ds 450
+swordtab ds 192
+
+ dend
+
+*-------------------------------
+ org org
+Fdef
+
+* Fimage, Fsword, Fdx, Fdy, Fcheck
+
+:1 db $01,0,1,0,$c0+4 ;run-4
+:2 db $02,0,1,0,$40+4 ;run-5
+:3 db $03,0,3,0,$40+7 ;run-6
+:4 db $04,0,4,0,$40+8 ;run-7
+:5 db $05,0,0,0,$c0+$20+6 ;run-8
+:6 db $06,0,0,0,$40+9 ;run-9
+:7 db $07,0,0,0,$40+10 ;run-10
+:8 db $08,0,0,0,$c0+5 ;run-11
+:9 db $09,0,0,0,$40+4 ;run-12
+:10 db $0a,0,0,0,$40+7 ;run-13
+:11 db $0b,0,0,0,$40+11 ;run-14
+:12 db $0c,0,0,0,$40+3 ;run-15
+:13 db $0d,0,0,0,$c0+3 ;run-16
+:14 db $0e,0,0,0,$40+7 ;run-17
+:15 db $0f,9,0,0,$40+3 ;stand
+:16 db $10,0,0,0,$c0+3 ;standjump-9
+:17 db $11,0,0,0,$40+4 ;standjump-10
+:18 db $12,0,0,0,$40+6 ;standjump-11
+:19 db $13,0,0,0,$40+8 ;standjump-12
+:20 db $14,0,0,0,$80+9 ;standjump-13
+:21 db $15,0,0,0,$00+11 ;standjump-14
+:22 db $16,0,0,0,$80+11 ;standjump-15
+:23 db $17,0,0,0,$00+17 ;standjump-16
+:24 db $18,0,0,0,$00+7 ;standjump-17
+:25 db $19,0,0,0,$00+5 ;standjump-18
+:26 db $1a,0,0,0,$c0+1 ;standjump-19
+:27 db $1b,0,0,0,$c0+6 ;standjump-20
+:28 db $1c,0,0,0,$40+3 ;standjump-21
+:29 db $1d,0,0,0,$40+8 ;standjump-22
+:30 db $1e,0,0,0,$40+2 ;standjump-23
+:31 db $1f,0,0,0,$40+2 ;standjump-24
+:32 db $20,0,0,0,$c0+2 ;standjump-25
+:33 db $21,0,0,0,$c0+2 ;standjump-26
+:34 db $22,0,0,0,$40+3 ;runjump-1
+:35 db $23,0,0,0,$40+8 ;runjump-2
+:36 db $24,0,0,0,$c0+14 ;runjump-3
+:37 db $25,0,0,0,$c0+1 ;runjump-4
+:38 db $26,0,0,0,$40+5 ;runjump-5
+:39 db $27,0,0,0,$80+14 ;runjump-6
+:40 db $28,0,0,0,$00+11 ;runjump-7
+:41 db $29,0,0,0,$80+11 ;runjump-8
+:42 db $2a,0,0,0,$80+10 ;runjump-9
+:43 db $2b,0,0,0,$00+1 ;runjump-10
+:44 db $2c,0,0,0,$c0+4 ;runjump-11
+:45 db $2d,0,0,0,$c0+3 ;turn-2
+:46 db $2e,0,0,0,$c0+3 ;turn-3
+:47 db $2f,0,0,0,$80+$20+5 ;turn-4
+:48 db $30,0,0,0,$80+$20+4 ;turn-5
+:49 db $31,0,0,0,$40+$20+6 ;turn-6
+:50 db $32,0,4,0,$40+$20+7 ;turn-7
+:51 db $33,0,3,0,$40+$20+6 ;turn-8
+:52 db $34,0,1,0,$40+4 ;turn-10
+:53 db $01,$40,0,0,$c0+2 ;runturn-8
+:54 db $02,$40,0,0,$40+1 ;runturn-9
+:55 db $03,$40,0,0,$40+2 ;runturn-10
+:56 db $04,$40,0,0,$00 ;runturn-11
+:57 db $05,$40,0,0,$00 ;runturn-12
+:58 db $06,$40,0,0,$80 ;runturn-13
+:59 db $07,$40,0,0,$00 ;runturn-14
+:60 db $08,$40,0,0,$80 ;runturn-15
+:61 db $09,$40,0,0,$00 ;runturn-16
+:62 db $0a,$40,0,0,$80 ;runturn-17
+:63 db $0b,$40,0,0,$00 ;runturn-18
+:64 db $0c,$40,0,0,$00 ;runturn-19
+:65 db $0d,$40,0,0,$80 ;runturn-20
+:66 db 0,0,0,0,0
+:67 db $11,$40,-2,0,$40+1 ;jumphang-2
+:68 db $12,$40,-2,0,$40+1 ;jumphang-3
+:69 db $13,$40,-1,0,$c0+2 ;jumphang-4
+:70 db $14,$40,-2,0,$40+2 ;jumphang-5
+:71 db $15,$40,-2,0,$40+1 ;jumphang-6
+:72 db $16,$40,-2,0,$40+1 ;jumphang-7
+:73 db $17,$40,-2,0,$40+1 ;jumphang-8
+:74 db $18,$40,-1,0,$00+7 ;jumphang-9
+:75 db $19,$40,-1,0,$00+5 ;jumphang-10
+:76 db $1a,$40,2,0,$00+7 ;jumphang-11
+:77 db $1b,$40,2,0,$00+7 ;jumphang-12
+:78 db $1c,$40,2,-3,$00 ;jumphang-13
+:79 db $1d,$40,2,-10,$00 ;jumphang-14
+:80 db $1e,$40,2,-11,$80 ;jumphang-15
+:81 db $1f,$40,3,-2,$40+3 ;hangdrop-4
+:82 db $20,$40,3,0,$c0+3 ;hangdrop-5
+:83 db $21,$40,3,0,$c0+3 ;hangdrop-6
+:84 db $22,$40,3,0,$40+$20+3 ;hangdrop-7
+:85 db $23,$40,4,0,$c0+$20+3 ;hangdrop-8
+:86 db $1d,0,0,0,$00 ;test w/foot
+:87 db $25,$40,7,-14,$80 ;jumphang-22
+:88 db $26,$40,7,-12,$80 ;jumphang-23
+:89 db $27,$40,4,-12,$00 ;jumphang-24
+:90 db $28,$40,3,-10,$80 ;jumphang-25
+:91 db $29,$40,2,-10,$80 ;jumphang-26
+:92 db $2a,$40,1,-10,$80 ;jumphang-27
+:93 db $2b,$40,0,-11,$00 ;jumphang-28
+:94 db $2c,$40,-1,-12,$00 ;jumphang-29
+:95 db $2d,$40,-1,-14,$00 ;jumphang-30
+:96 db $2e,$40,-1,-14,$00 ;jumphang-31
+:97 db $2f,$40,-1,-15,$80 ;jumphang-32
+:98 db $30,$40,-1,-15,$80 ;jumphang-33
+:99 db $31,$40,0,-15,$00 ;jumphang-34
+:100 db 0,0,0,0,0
+:101 db 0,0,0,0,0
+:102 db $32,$40,0,0,$c0+6 ;jumpfall-2
+:103 db $33,$40,0,0,$40+6 ;jumpfall-3
+:104 db $34,$40,0,0,$c0+5 ;jumpfall-4
+:105 db $35,$40,0,0,$40+5 ;jumpfall-5
+:106 db $36,$40,0,0,$c0+2 ;jumpfall-6
+:107 db $37,$40,0,0,$c0+4 ;jumpfall-7
+:108 db $38,$40,0,0,$c0+5 ;jumpfall-8
+:109 db $39,$40,0,0,$40+6 ;jumpfall-9
+:110 db $3a,$40,0,0,$40+7 ;jumpfall-10
+:111 db $3b,$40,0,0,$40+7 ;jumpfall-11
+:112 db $3c,$40,0,0,$40+9 ;jumpfall-12
+:113 db $3d,$40,0,0,$c0+8 ;jumpfall-13
+:114 db $3e,$40,0,0,$c0+9 ;jumpfall-14
+:115 db $3f,$40,0,0,$40+9 ;jumpfall-15
+:116 db $40,$40,0,0,$40+5 ;jumpfall-16
+:117 db $41,$40,2,0,$40+5 ;jumpfall-17
+:118 db $42,$40,2,0,$c0+5 ;jumpfall-18
+:119 db $43,$40,0,0,$c0+3 ;jumpfall-19
+:120 db 0,0,0,0,0
+:121 db $01,$80,0,0,$40+3 ;stepfwd-1
+:122 db $02,$80,0,0,$c0+4 ;stepfwd-2
+:123 db $03,$80,0,0,$c0+5 ;stepfwd-3
+:124 db $04,$80,0,0,$40+8 ;stepfwd-4
+:125 db $05,$80,0,0,$40+$20+12 ;stepfwd-5
+:126 db $06,$80,0,0,$c0+$20+15 ;stepfwd-6
+:127 db $07,$80,0,0,$40+$20+3 ;stepfwd-7
+:128 db $08,$80,0,0,$c0+3 ;stepfwd-8
+:129 db $09,$80,0,0,$40+3 ;stepfwd-9
+:130 db $0a,$80,0,0,$40+3 ;stepfwd-10
+:131 db $0b,$80,0,0,$40+4 ;stepfwd-11
+:132 db $0c,$80,0,0,$40+4 ;stepfwd-12
+:133 db $3e,$80,00,1,$c0+1 ;sheathe34
+:134 db $3f,$80,00,1,$c0+7 ;sheathe37
+:135 db $0d,$80,-5+5,51-63,$00+1 ;climbup-int1
+:136 db $0e,$80,-5+5,42-63,$00 ;climbup-int2
+:137 db $0f,$80,-4+5,37-63,$80 ;climbup-8
+:138 db $10,$80,-1+5,31-63,$80 ;climbup-10
+:139 db $11,$80,1+5,27-63,$80+1 ;climbup-14
+:140 db $12,$80,2+5,22-63,$80+2 ;climbup-16
+:141 db $13,$80,2,17,$40+2 ;climbup-22
+:142 db $14,$80,4,9,$c0+4 ;climbup-28
+:143 db $15,$80,4,5,$c0+9 ;climbup-30
+:144 db $16,$80,4,4,$c0+8 ;climbup-32
+:145 db $17,$80,5,0,$40+$20+9 ;climbup-34
+:146 db $18,$80,5,0,$c0+$20+9 ;climbup-35
+:147 db $19,$80,5,0,$c0+$20+8 ;climbup-36
+:148 db $1a,$80,5,0,$40+$20+9 ;climbup-37
+:149 db $1b,$80,5,0,$40+$20+9 ;climbup-38
+:150 db $8b,16,0,2,$80 ;missed block
+:151 db $81,26,0,2,$80
+:152 db $82,18,3,2,$00 ;guy4/rob20
+:153 db $83,22,7,2,$c0+4
+:154 db $84,21,10,2,$00 ;full ext.
+:155 db $85,23,7,2,$80 ;guy-7
+:156 db $86,25,4,2,$80 ;guy-8
+:157 db $87,24,0,2,$c0+14 ;guy-9
+:158 db $88,15,0,2,$c0+13 ;guy10/rob15 (ready)
+:159 db $89,20,3,2,$00 ;guy19/rob22
+:160 db $8a,31,3,2,$00 ;guy20/rob23
+:161 db $8b,16,0,2,$80 ;guy21/rob18 (blocking)
+:162 db $8c,17,0,2,$80 ;guy22/rob19 (block-to-strike)
+:163 db $8d,32,0,2,$00 ;guy-31 (advance)
+:164 db $8e,33,0,2,$80 ;guy-32
+:165 db $8f,34,2,2,$c0+3 ;guy-33
+:166 db $0f,0,0,0,$40+3 ;stand
+:167 db $91,19,7,2,$80 ;guy18/rob21 (blocked)
+:168 db $92,14,1,2,$80 ;pre-strike
+:169 db $93,27,0,2,$80 ;rob17 (begin block)
+:170 db $88,15,0,2,$c0+13 ;guy10/rob15 (ready)
+:171 db $88,15,0,2,$c0+13 ;guy10/rob15 (ready)
+:172 db $32,$40+43,0,0,$c0+6 ;jumpfall-2
+:173 db $33,$40+44,0,0,$40+6 ;jumpfall-3
+:174 db $34,$40+45,0,0,$c0+5 ;jumpfall-4
+:175 db $35,$40+46,0,0,$40+5 ;jumpfall-5
+:176 db $34,$40,0,0,$c0+5
+:177 db $0f,$40,0,3,$80+10 ;impaled
+:178 db $0e,$40,4,3,$80+7 ;halves
+:179 db $a8,0,0,1,$40+4 ;collapse15
+:180 db $a9,0,0,1,$40+4 ;collapse16
+:181 db $aa,0,0,1,$40+4 ;collapse17
+:182 db $ab,0,0,1,$40+7 ;collapse18
+:183 db $ac,0,0,7,$40+11 ;collapse19
+:184 db 0,0,0,0,0
+:185 db $10,$40,4,7,$40+9 ;dead
+:186 db $44,$40,0,0,$40+4 ;mouse-1
+:187 db $45,$40,0,0,$40+4 ;mouse-2
+:188 db $46,$40,0,2,$40+4 ;mouse crouch
+:189 db 0,0,0,0,0
+:190 db 0,0,0,0,0
+:191 db $94,0,0,0,$00 ;drink4
+:192 db $95,0,0,1,$00 ;drink5
+:193 db $96,0,0,0,$80 ;drink6
+:194 db $97,0,0,0,$00 ;drink7
+:195 db $98,0,-1,0,$00 ;drink8
+:196 db $99,0,-1,0,$00 ;drink9
+:197 db $9a,0,-1,0,$00 ;drink10
+:198 db $9b,0,-4,0,$00 ;drink11
+:199 db $9c,0,-4,0,$80 ;drink12
+:200 db $9d,0,-4,0,$00 ;drink13
+:201 db $9e,0,-4,0,$00 ;drink14
+:202 db $9f,0,-4,0,$00 ;drink15
+:203 db $a0,0,-4,0,$00 ;drink16
+:204 db $a1,0,-5,0,$00 ;drink17
+:205 db $a2,0,-5,0,$00 ;drink18
+:206 db $a3,0,0,0,0 ;unused
+:207 db $a4,0,0,1,$40+6 ;draw5
+:208 db $a5,0,0,1,$c0+6 ;draw6
+:209 db $a6,0,0,1,$c0+8 ;draw7
+:210 db $a7,0,0,1,$40+10 ;draw8
+:211 db 0,0,0,0,$00
+:212 db 0,0,0,0,$00
+:213 db 0,0,0,0,$00
+:214 db 0,0,0,0,$00
+:215 db 0,0,0,0,$00
+:216 db 0,0,0,0,$00
+:217 db $35,0,0,0,$80 ;climbst2
+:218 db $36,0,0,0,$00 ;climbst3
+:219 db $37,0,0,0,$00 ;climbst4
+:220 db $38,0,0,0,$00 ;climbst5
+:221 db $39,0,0,0,$80 ;climbst6
+:222 db $3a,0,0,0,$00 ;climbst7
+:223 db $3b,0,0,0,$00 ;climbst8
+:224 db $3c,0,0,0,$00 ;climbst9
+:225 db $3d,0,0,0,$80 ;climbst10
+:226 db $3e,0,0,0,$00 ;climbst11
+:227 db $3f,0,0,0,$80 ;climbst12
+:228 db $40,0,0,0,$00 ;climbst13
+:229 db $32,$80+35,1,1,$c0+3 ;sheathe22
+:230 db $33,$80+36,0,1,$40+9 ;sheathe23
+:231 db $34,$80+37,0,1,$c0+3 ;sheathe24
+:232 db $35,$80+38,0,1,$40+9 ;sheathe25
+:233 db $36,$80+39,0,1,$c0+3 ;sheathe26
+:234 db $37,$80+40,1,1,$40+9 ;sheathe27
+:235 db $38,$80+41,1,1,$40+3 ;sheathe28
+:236 db $39,$80+42,1,1,$c0+9 ;sheathe29
+:237 db $3a,$80,4,1,$c0+6 ;sheathe30
+:238 db $3b,$80,3,1,$c0+10 ;sheathe31
+:239 db $3c,$80,1,1,$40+3 ;sheathe32
+:240 db $3d,$80,1,1,$c0+8 ;sheathe33 (-->133)
+
+*-------------------------------
+*
+* Alternate character set 1 (chtable4)
+*
+* 200 bytes allocated -- 40 frames (150-189)
+*
+* Frame def list shows kid, sword in RIGHT hand
+* Altset1 shows enemy, sword in LEFT hand (to be mirrored)
+* (Image tables always show character facing LEFT)
+*
+*-------------------------------
+ ds altset1-*
+
+ALTSET1
+
+:150 db $0b,$c0+13,2,1,$00 ;missed block
+:151 db $01,$c0+1,3,1,$00 ;guy-3
+:152 db $02,$c0+2,4,1,$00 ;guy-4
+:153 db $03,$c0+3,7,1,$40+4 ;guy-5
+:154 db $04,$c0+4,10,1,$00 ;guy-6 (full ext)
+:155 db $05,$c0+5,7,1,$80 ;guy-7
+:156 db $06,$c0+6,4,1,$80 ;guy-8
+:157 db $07,$c0+7,0,1,$80 ;guy-9
+:158 db $08,$c0+8,0,1,$c0+13 ;guy-10 (ready)
+:159 db $09,$c0+11,7,1,$80 ;guy-19
+:160 db $0a,$c0+12,3,1,$00 ;guy-20
+:161 db $0b,$c0+13,2,1,$00 ;guy-21 (blocking)
+:162 db $0c,$c0,2,1,$00 ;guy-22
+:163 db $0d,$c0+28,0,1,$00 ;guy-31 (advance)
+:164 db $0e,$c0+29,0,1,$80 ;guy-32
+:165 db $0f,$c0+30,2,1,$c0+3 ;guy-33
+:166 db $10,$c0+9,-1,1,$40+8 ;alertstand
+:167 db $11,$c0+10,7,1,$80 ;guy-18 (blocked)
+:168 db $12,$c0+14,3,1,$80 ;guy-15
+:169 db $08,$c0+8,0,1,$80 ;?? (ready-->block)
+:170 db $13,$c0+8,0,1,$c0+13 ;guy-11/12 (ready)
+:171 db $14,$c0+8,0,1,$c0+13 ;guy-13/14 (ready)
+:172 db $15,$c0+47,0,0,$c0+6 ;jumpfall-2 (stabbed)
+:173 db $16,$c0+48,0,0,$40+6 ;jumpfall-3
+:174 db $17,$c0+49,0,0,$c0+5 ;jumpfall-4
+:175 db $17,$c0+49,0,0,$c0+5 ;for jumpfall-5
+:176 db $17,$c0+49,0,0,$c0+5 ;for jumpfall-6
+:177 db $19,$c0,0,3,$80+10 ;impaled
+:178 db $1a,$c0,4,4,$80+7 ;halves
+:179 db $1b,$c0,-2,1,$40+4 ;collapse15
+:180 db $1c,$c0,-2,1,$40+4 ;collapse16
+:181 db $1d,$c0,-2,1,$40+4 ;collapse17
+:182 db $1e,$c0,-2,2,$40+7 ;collapse18
+:183 db $1f,$c0,-2,2,$40+10 ;collapse19
+:184 db 0,0,0,0,0
+:185 db $20,$c0,3,4,$c0+9 ;dead
+:186 db 0,0,0,0,0
+:187 db 0,0,0,0,0
+:188 db 0,0,0,0,0
+:189 db 0,0,0,0,0
+
+*-------------------------------
+*
+* Alternate character set 2 (chtable6)
+*
+* (450 bytes allocated -- 90 frames)
+*
+*-------------------------------
+ ds altset2-*
+
+ALTSET2
+
+:1 db $8a,$40,0,0,$00 ;pslump-1
+:2 db $9a,$40,0,0,$80 ;pturn-4
+:3 db $9b,$40,0,0,$80 ;pturn-5
+:4 db $9c,$40,0,0,$80 ;pturn-6
+:5 db $9d,$40,-1,0,$00 ;pturn-7
+:6 db $9e,$40,2,0,$80 ;pturn-8
+:7 db $9f,$40,2,0,$00 ;pturn-9
+:8 db $a0,$40,0,0,$80 ;pturn-10
+:9 db $a1,$40,1,0,$80 ;pturn-11
+:10 db $a2,$40,2,0,$80 ;unused
+:11 db $99,$40,0,0,$80 ;pturn-15 (stand)
+:12 db $a3,$40,0,0,$80 ;pback-3
+:13 db $a4,$40,0,0,$00 ;pback-5
+:14 db $a5,$40,0,0,$80 ;pback-7
+:15 db $a6,$40,0,0,$80 ;pback-9
+:16 db $a7,$40,0,0,$80 ;pback-11
+:17 db $a8,$40,0,0,$00 ;pback-13 (stand)
+:18 db $8b,$40,0,0,$00 ;pslump-1
+:19 db $a9,$40,0,0,$00 ;plie
+:20 db $ad,$40,0,0,$00 ;embrace-1
+:21 db $ae,$40,0,0,$00 ;embrace-2
+:22 db $af,$40,0,0,$80 ;embrace-3
+:23 db $b0,$40,0,0,$00 ;embrace-4
+:24 db $b1,$40,0,0,$80 ;embrace-5
+:25 db $b2,$40,0,0,$80 ;embrace-6
+:26 db $b3,$40,0,0,$00 ;embrace-7
+:27 db $b4,$40,0,0,$00 ;embrace-8
+:28 db $b5,$40,0,0,$00 ;embrace-9
+:29 db $b6,$40,0,0,$00 ;embrace-10
+:30 db $b7,$40,0,0,$00 ;embrace-11
+:31 db $b8,$40,0,0,$00 ;embrace-12
+:32 db $b9,$40,0,0,$00 ;embrace-13
+:33 db $ba,$40,0,0,$00 ;embrace-14
+:34 db $bb,$40,0,0,$00 ;prise-1
+:35 db $bc,$40,0,0,$00 ;prise-2
+:36 db $bd,$40,0,0,$00 ;prise-3
+:37 db $be,$40,0,0,$00 ;prise-4
+:38 db $bf,$40,0,0,$80 ;prise-5
+:39 db $bf,$40,0,0,$80 ;prise-6
+:40 db $c1,$40,1,0,$00 ;prise-7
+:41 db $c2,$40,-1,0,$00 ;prise-8
+:42 db $c3,$40,2,0,$00 ;prise-9
+:43 db $c4,$40,1,0,$80 ;prise-10
+:44 db $c5,$40,0,0,$80 ;prise-11
+:45 db $c6,$40,0,0,$80 ;prise-12
+:46 db $c7,$40,0,0,$80 ;prise-13
+:47 db $c8,$40,-1,0,$00 ;prise-14
+:48 db $ca,$40,0,0,$80 ;vwalk-8
+:49 db $cb,$40,0,0,$80 ;vwalk-9
+:50 db $cc,$40,0,0,$80 ;vwalk-10
+:51 db $cd,$40,0,0,$00 ;vwalk-11
+:52 db $ce,$40,0,0,$00 ;vwalk-12
+:53 db $cf,$40,0,0,$80 ;vwalk-13
+:54 db $d0,$40,0,0,$80 ;vstand-3
+:55 db $d1,$40,0,0,$80 ;vstand-2
+:56 db $d2,$40,0,0,$80 ;vstand-1
+:57 db $d3,$40,0,0,$80 ;vturn-5
+:58 db $d4,$40,0,0,$80 ;vturn-6
+:59 db $d5,$40,0,0,$80 ;vturn-7
+:60 db $d6,$40,0,0,$80 ;vturn-8
+:61 db $d7,$40,0,0,$00 ;vturn-9
+:62 db $d8,$40,0,0,$80 ;vturn-10
+:63 db $d9,$40,0,0,$00 ;vturn-11
+:64 db $da,$40,0,0,$00 ;vturn-12
+:65 db $db,$40,0,0,$80 ;vturn-13
+:66 db $dc,$40,0,0,$00 ;vturn-14
+:67 db $dd,$40,3,0,$00 ;vcast-2
+:68 db $de,$40,3,0,$00 ;vcast-3
+:69 db $df,$40,3,0,$00 ;vcast-4
+:70 db $e0,$40,2,0,$00 ;vcast-5
+:71 db $e1,$40,3,0,$80 ;vcast-6
+:72 db $e2,$40,5,0,$00 ;vcast-7
+:73 db $e3,$40,5,0,$00 ;vcast-8
+:74 db $e4,$40,1,0,$80 ;vcast-9
+:75 db $e5,$40,2,0,$80 ;vcast-10
+:76 db $e6,$40,2,0,$80 ;vcast-11 (held)
+:77 db $e7,$40,1,0,$80 ;vcast-13
+:78 db $81,$80,1,0,$00 ;vcast-14
+:79 db $82,$80,2,0,$00 ;vcast-15
+:80 db $83,$80,3,0,$00 ;vcast-16
+:81 db $84,$80,3,0,$00 ;vcast-17
+:82 db $85,$80,0,0,$80 ;vcast-18
+:83 db $86,$80,2,0,$80 ;vcast-10a
+:84 db $87,$80,2,0,$80 ;vcast-10b
+:85 db $88,$80,1,0,$00 ;vcast-1
+
+
+*-------------------------------
+*
+* S W O R D T A B L E
+*
+* (192 bytes allocated -- 64 swords)
+*
+* Sword images are taken from chtable3
+*
+*-------------------------------
+ ds swordtab-*
+
+SWORDTAB
+
+* (Image, DX, DY)
+
+:1 db $1d,0,-9
+:2 db $22,-9,-29
+:3 db $1e,7,-25
+:4 db $1f,17,-26
+:5 db $23,7,-14
+:6 db $24,0,-5
+:7 db $20,17,-16
+:8 db $21,16,-19
+:9 db $4b,12,-9 ;alertstand
+:10 db $26,13,-34
+:11 db $27,7,-25
+:12 db $28,10,-16
+:13 db $29,10,-11
+:14 db $2a,22,-21
+:15 db $2b,28,-23
+:16 db $2c,13,-35
+:17 db $2d,0,-38
+:18 db $2e,0,-29
+:19 db $2f,21,-19
+:20 db $30,14,-23
+:21 db $31,21,-22
+:22 db $31,22,-23
+:23 db $2f,7,-13
+:24 db $2f,15,-18 ;$20,17,-19 for flash
+:25 db $24,0,-8
+:26 db $1e,7,-27
+:27 db $48,14,-28
+:28 db $26,7,-27
+:29 db $21,6,-23
+:30 db $21,9,-21
+:31 db $28,11,-18
+:32 db $2b,24,-23
+:33 db $2b,19,-23
+:34 db $2b,21,-23
+;sheathing
+:35 db $40,7,-32
+:36 db $41,14,-32
+:37 db $42,14,-31
+:38 db $43,14,-29
+:39 db $44,28,-28
+:40 db $45,28,-28
+:41 db $46,21,-25
+:42 db $47,14,-22
+
+:43 db 0,14,-25 ;43-46: kid stabbed
+:44 db 0,21,-25
+:45 db $4a,0,-16
+:46 db $26,8,-37
+:47 db $4c,14,-24 ;47-50: enemy stabbed
+:48 db $4d,14,-24
+:49 db $4e,7,-14
+:50 db $26,8,-37
+
+*-------------------------------
+ lst
+ ds 1
+ usr $a9,15,$00,*-org
+ lst off
View
1,193 01 POP Source/Source/GAMEBG.S
@@ -1 +1,1192 @@
-* gamebg
+* gamebg
+ThreeFive = 1
+EditorDisk = 0
+org = $4c00
+ tr on
+ lst off
+ lstdo off
+*-------------------------------
+*
+* PRINCE OF PERSIA
+* Copyright 1989 Jordan Mechner
+*
+*-------------------------------
+ org org
+
+ jmp UPDATEMETERS
+ jmp DRAWKIDMETER
+ jmp DRAWSWORD
+ jmp DRAWKID
+ jmp DRAWSHAD
+
+ jmp SETUPFLAME
+ jmp CONTINUEMSG
+ jmp ADDCHAROBJ
+ jmp SETOBJINDX
+ jmp PRINTLEVEL
+
+ jmp DRAWOPPMETER
+ jmp FLIPDISKMSG
+ jmp TIMELEFTMSG
+ jmp DRAWGUARD
+ jmp DRAWGUARD
+
+ jmp SETUPFLASK
+ jmp SETUPCOMIX
+ jmp PSETUPFLAME
+ jmp DRAWPOST
+ jmp DRAWGLASS
+
+ jmp INITLAY
+ jmp TWINKLE
+ jmp FLOW
+ jmp PMASK
+ jmp YELLOW
+
+ jmp SETRECHECK0
+ jmp RECHECKYEL
+ ds 3
+ ds 3
+ ds 3
+
+*-------------------------------
+ lst
+ put eq
+ lst
+ put gameeq
+ lst off
+
+*-------------------------------
+*
+* 2nd level copy protection
+* signature check routine
+*
+*-------------------------------
+ do ThreeFive
+YELLOW lda #$80
+ sta yellowflag
+ rts
+
+ else
+ put ryellow1
+ fin
+
+*-------------------------------
+ lst
+ put movedata
+ lst off
+
+*-------------------------------
+ dum locals
+
+xsave ds 1
+addr ds 2
+temp ds 1
+
+ dend
+
+tempsave ds $10
+
+*-------------------------------
+* Strength meters
+
+KidStrX db 00,01,02,03,04,05,06,08,09,10,11,12
+KidStrOFF db 00,01,02,03,04,05,06,00,01,02,03,04
+
+OppStrX db 39,38,37,36,35,34,32,31,30,29,28,27
+OppStrOFF db 05,04,03,02,01,00,06,05,04,03,02,01
+
+bullet = $88 ;in bgtable2
+blank = $8c
+bline hex 89,8a,8b
+
+*-------------------------------
+* Post in Princess's room
+
+postx = 31
+posty = 152
+postimg = $c ;chtable6
+
+*-------------------------------
+* Stars outside Princess's window
+
+starx = 2
+stary hex 62,65,6d,72
+stari hex 2a,2b,2b,2a ;chtable6
+
+*-------------------------------
+* Hourglass
+
+glassx = 19
+glassy = 151
+glassimg hex 15,0d,0e,0f,10,11,12,13,14 ;chtable6
+sandht db 0,1,2,3,4,5,6,7
+
+flowx = glassx+1
+flowy = glassy-2
+flowimg hex 16,17,18 ;chtable6
+
+*-------------------------------
+* Masks for Princess's face & hair
+
+pmaskdx hex 00,00
+pmaskdy db -4,-33
+pmaski hex 2c,22
+
+*-------------------------------
+* Comix
+
+starimage = $41
+startable = 0 ;chtable1
+
+*-------------------------------
+* Torch animation frames
+* 0 1 2 3 4 5 6 7 8 9 10 11
+* 12 13 14 15 16 17
+
+torchflame hex 52,53,54,55,56,61,62,63,64,52,54,56
+ hex 63,61,55,53,64,62
+
+ptorchflame db 1,2,3,4,5,6,7,8,9,3,5,7,1,4,9,2,8,6
+
+*-------------------------------
+* Bubbling flask frames
+* 0 1 2 3 4 5 6 7 8 9 10 11
+
+bubble hex b2,af,b0,b1,b0,af,b1,b0,af
+
+*-------------------------------
+* Message data: YCO, XCO, OFFSET, IMAGE
+
+my = 90
+lowmy = 153
+hiconty = 73
+lowconty = 168
+
+contbox db hiconty,13,0,$7c ;Press button to continue
+msgbox db my,15,0,$7b ;Empty message box
+levelmsg db my-5,16,3,$7a ;"Level"
+flipbox db my-1,13,0,$7e ;Turn disk over
+timeleft db my,11,0,$7d ;Minutes left
+seconds db my-5,14,0,$7f ;"Seconds"
+
+*-------------------------------
+* Numbers (0-12)
+
+digit1 hex 00,00,00,00,00,00,00,00,00,00
+ hex 71,71,71
+
+digit2 hex 70,71,72,73,74,75,76,77,78,79
+ hex 70,71,72
+
+*-------------------------------
+* Print "XX Minutes Left"
+*-------------------------------
+]rts rts
+
+TIMELEFTMSG
+ lda #timeleft
+ ldx #>timeleft
+ jsr setupimage
+
+ lda MinLeft
+ cmp #2
+ bcs :ok
+ lda KidAction
+ cmp #3
+ beq :ok
+ cmp #4
+ beq :ok ;falling
+ lda KidBlockY
+ cmp #1
+ bne :ok
+ lda #lowmy
+ sta YCO ;keep msg box out of kid's way
+:ok jsr superim1
+
+ lda YCO
+ sec
+ sbc #5
+ sta YCO
+
+ lda XCO
+ clc
+ adc #1
+ sta XCO
+ lda #0
+ sta OPACITY
+
+ lda #ora
+ sta OPACITY
+
+ jsr getminleft
+
+ lda MinLeft ;BCD byte (e.g., $55 = 55 minutes)
+ cmp #2
+ bcs :1
+ lda SecLeft
+:1 sta temp
+ lsr
+ lsr
+ lsr
+ lsr
+ beq :skip1st
+ tax
+ lda digit2,x ;1st digit
+ sta IMAGE
+
+ jsr addmsg
+
+:skip1st lda XCO
+ clc
+ adc #1
+ sta XCO
+
+ lda temp
+ and #$f
+ tax
+ lda digit2,x ;2nd digit
+ sta IMAGE
+
+ jsr addmsg
+
+* Minutes or seconds?
+
+ lda MinLeft
+ cmp #2
+ bcs ]rts
+
+ lda YCO
+ pha
+ lda #seconds
+ ldx #>seconds
+ jsr setupimage
+ pla
+ sta YCO
+ lda #sta
+ sta OPACITY
+ jmp addmsg ;replace "minutes" with "seconds"
+
+*-------------------------------
+* Print "Level XX"
+*-------------------------------
+]rts rts
+
+PRINTLEVEL
+ lda #msgbox
+ ldx #>msgbox
+ jsr superimage
+
+ lda #levelmsg
+ ldx #>levelmsg
+ jsr setupimage
+
+ jsr getlevelno
+ cpx #10
+ bcc :1
+ lda #0
+ sta OFFSET
+:1
+ lda #ora
+ sta OPACITY
+ jsr addmsg
+
+ lda XCO
+ clc
+ adc #6
+ sta XCO
+
+ jsr getlevelno ;X = level # (0-12)
+ lda digit1,x ;1st digit
+ beq :skip1st
+ sta IMAGE
+
+ lda #ora
+ sta OPACITY
+ jsr addmsg
+
+ lda XCO
+ clc
+ adc #1
+ sta XCO
+
+ jsr getlevelno
+:skip1st lda digit2,x ;2nd digit
+ sta IMAGE
+
+ lda #ora
+ sta OPACITY
+ jmp addmsg
+
+*-------------------------------
+getlevelno
+ ldx level
+ cpx #13
+ bcc :ok
+ ldx #12
+:ok
+]rts rts
+
+*-------------------------------
+* Superimpose "Press button to continue" message
+*-------------------------------
+CONTINUEMSG
+ lda #contbox
+ ldx #>contbox
+ jsr setupimage
+
+ lda KidBlockX
+ and #1
+ bne :1
+ lda #lowconty
+ sta YCO
+:1 jmp superim1
+
+*-------------------------------
+* Superimpose "Turn disk over" message
+*-------------------------------
+FLIPDISKMSG
+ lda #flipbox
+ ldx #>flipbox
+ jmp superimage
+
+*-------------------------------
+* Superimpose image (using layrsave)
+*-------------------------------
+superimage
+ jsr setupimage
+superim1
+ lda #sta.$40
+ sta OPACITY
+ jmp addmsg
+
+*-------------------------------
+* Set up image
+*
+* In: A-X = image data addr
+* Out: XCO, YCO, IMAGE
+*-------------------------------
+setupimage
+ sta addr
+ stx addr+1
+
+ ldy #0
+ lda (addr),y
+ sta YCO
+ iny
+ lda (addr),y
+ sta XCO
+ iny
+ lda (addr),y
+ sta OFFSET
+ iny
+ lda (addr),y
+ sta IMAGE
+]rts
+:rts rts
+
+*-------------------------------
+* Draw Kid
+*-------------------------------
+DRAWKID
+ lda backtolife
+ beq :2
+ lda PAGE
+ beq ]rts ;flash when coming back to life
+
+:2 lda mergetimer
+ bmi :1
+ and #1
+ beq :1
+ jmp DrawEored ;flash between kid & shadowman
+
+:1 jmp DrawNormal
+
+*-------------------------------
+* Draw Sword
+*-------------------------------
+DRAWSWORD
+ jmp DrawNormal
+
+*-------------------------------
+* Draw Shadowman
+*-------------------------------
+DRAWSHAD
+ jmp DrawEored
+
+*-------------------------------
+* Draw Guard
+*-------------------------------
+DRAWGUARD
+ do EditorDisk
+ lda #EditorDisk
+ cmp #2
+ beq DrawNormal
+ fin
+
+ lda GuardColor ;set by "ADDGUARD" in AUTO
+ beq DrawNormal
+ bne DrawShifted
+
+*-------------------------------
+DrawNormal
+ lda #mask
+ sta OPACITY
+
+ lda #UseLayrsave.$80
+ jmp addmid
+
+]rts rts
+
+*-------------------------------
+DrawShifted
+ lda #1
+ jsr chgoffset
+
+ lda #mask
+ sta OPACITY
+
+ lda #UseLayrsave.$80
+ jmp addmid
+
+*-------------------------------
+DrawEored
+ lda #eor
+ sta OPACITY
+
+ lda #UseLayrsave.$80
+ jmp addmid
+
+*-------------------------------
+chgoffset
+ clc
+ adc OFFSET
+ cmp #7
+ bcc :1
+
+ inc XCO
+ sec
+ sbc #7
+
+:1 sta OFFSET
+ rts
+
+*-------------------------------
+*
+* Update strength meters
+*
+*-------------------------------
+UPDATEMETERS
+ lda redkidmeter
+ beq :1
+
+ jsr DrawKidMeter
+
+:1 lda redoppmeter
+ beq ]rts
+
+ jmp DrawOppMeter
+]rts rts
+
+*-------------------------------
+*
+* Draw kid's strength meter at lower left
+*
+*-------------------------------
+DRAWKIDMETER
+ lda inbuilder
+ bne ]rts
+
+ lda #191
+ sta YCO
+ lda #sta
+ sta OPACITY
+
+ ldx #0
+ stx xsave ;# of bullets drawn so far
+
+:loop lda KidStrength
+ sec
+ sbc xsave ;# of bullets left to draw
+ beq :darkpart
+ cmp #4
+ bcs :draw3
+ cmp #3
+ bcs :draw2
+ cmp #2
+ bcc :drawlast
+;Draw 1 bullet
+:draw1 ldy #1
+ bne :drline
+ ;Draw 2 bullets
+:draw2 ldy #2
+ bne :drline
+;Draw 3 bullets
+:draw3 ldy #3
+ bne :drline
+
+:drawlast lda KidStrength
+ cmp #2
+ bcs :steady
+ lda PAGE
+ beq :skip ;flashes when down to 1
+:steady lda #bullet
+ ldy #1
+ jsr :draw
+:skip jmp :darkpart
+
+* Draw line of 1-3 bullets
+
+:drline lda bline-1,y ;image #
+ jsr :draw
+ jmp :loop
+
+:draw sta IMAGE
+ ldx xsave
+ tya
+ clc
+ adc xsave
+ sta xsave
+
+* In: IMAGE; x = unit # (0 = leftmost)
+
+:drawimg lda KidStrX,x
+ sta XCO
+ lda KidStrOFF,x
+ sta OFFSET
+ jmp addmsg
+
+* Draw blanks to limit of MaxKidStr
+
+:darkpart
+ lda #and
+ sta OPACITY
+ lda #blank
+ sta IMAGE
+:dloop ldx xsave
+ cpx MaxKidStr
+ bcs ]rts
+ jsr :drawimg
+ inc xsave
+ bne :dloop
+]rts rts
+
+*-------------------------------
+*
+* Draw opp's strength meter at lower right
+*
+*-------------------------------
+DRAWOPPMETER
+ lda inbuilder
+ bne ]rts
+
+ lda OppStrength
+ beq ]rts
+
+ lda ShadID
+ cmp #24 ;mouse
+ beq ]rts
+ cmp #4 ;skel
+ beq ]rts
+ cmp #1 ;shadow
+ bne :1
+ lda level
+ cmp #12
+ bne ]rts ;shad strength shows only on level 12
+:1
+ lda #191
+ sta YCO
+ lda #sta.$80 ;mirror
+ sta OPACITY
+
+ ldx #0
+ stx xsave ;# of bullets drawn so far
+
+:loop lda OppStrength
+ sec
+ sbc xsave ;# of bullets left to draw
+ beq :darkpart
+ cmp #4
+ bcs :draw3
+ cmp #3
+ bcs :draw2
+ cmp #2
+ bcc :drawlast
+;Draw 1 bullet
+:draw1 ldy #1
+ bne :drline
+ ;Draw 2 bullets
+:draw2 ldy #2
+ bne :drline
+;Draw 3 bullets
+:draw3 ldy #3
+ bne :drline
+
+:drawlast lda OppStrength
+ cmp #2
+ bcs :steady
+ lda PAGE
+ beq :darkpart ;flashes when down to 1
+:steady lda #bullet
+ ldy #1
+ jmp :draw
+
+* Draw line of 1-3 bullets
+
+:drline lda bline-1,y ;image #
+ jsr :draw
+ jmp :loop
+
+:draw sta IMAGE
+ ldx xsave
+ tya
+ clc
+ adc xsave
+ sta xsave
+
+:drawimg lda OppStrX,x
+ sta XCO
+ lda OppStrOFF,x
+ sta OFFSET
+ jmp addmsg
+
+:darkpart
+ lda #and.$80
+ sta OPACITY
+ lda #blank
+ sta IMAGE
+ ldx xsave
+ jmp :drawimg
+
+*-------------------------------
+*
+* Set up to draw bubbling flask
+*
+* In/out: same as SETUPFLAME
+*
+*-------------------------------
+EmptyPot = 0
+RefreshPot = %00100000
+BoostPot = %01000000
+MystPot = %01100000
+
+boffset = 2
+
+SETUPFLASK
+ lda #boffset
+ sta OFFSET
+
+ txa
+ and #%11100000
+ cmp #EmptyPot
+ beq :0
+ cmp #BoostPot
+ beq :tall ;special flask (taller)
+ bcc :cont
+
+ inc OFFSET ;mystery potion (blue)
+
+:tall lda YCO
+ sec
+ sbc #4
+ sta YCO
+
+:cont txa
+ and #%00011111
+ tax
+ cpx #bubbLast+1
+ bcc :ok
+ ldx #0
+:ok lda bubble,x
+ sta IMAGE
+
+ inc XCO
+ inc XCO
+
+ lda YCO
+ sec
+ sbc #14
+ sta YCO
+
+ lda #sta
+ sta OPACITY
+
+ lda #bgtable2
+ sta TABLE
+ lda #>bgtable2
+ sta TABLE+1
+
+]rts rts
+
+:0 ldx #0
+ beq :ok
+
+*-------------------------------
+*
+* Setup to draw flame
+*
+* In: XCO = blockxco
+* YCO = Ay
+* X = spreced
+*
+* Out: ready to call ADDBACK (or FASTLAY)
+*
+*-------------------------------
+SETUPFLAME
+ cpx #torchLast+1
+ bcs ]rts
+
+ lda torchflame,x
+ sta IMAGE
+
+ inc XCO
+
+ lda YCO
+ sec
+ sbc #43
+ sta YCO
+
+ lda #sta
+ sta OPACITY
+
+ lda #bgtable1
+ sta TABLE
+ lda #>bgtable1
+ sta TABLE+1
+
+]rts rts
+
+*-------------------------------
+*
+* Setup to draw flame (Princess's room)
+*
+* In: XCO, YCO; X = frame #
+* Out: Ready to call ADDMID or LAY
+*
+*-------------------------------
+PSETUPFLAME
+ cpx #torchLast+1
+ bcs ]rts
+
+ lda ptorchflame,x
+ sta IMAGE
+
+ lda #sta
+ sta OPACITY
+
+ jsr initlay
+
+]setch6 lda #chtable6
+ sta TABLE
+ lda #>chtable6
+ sta TABLE+1
+
+]rts rts
+
+*-------------------------------
+*
+* Twinkle one of the stars outside Princess's window
+* (Update it directly on both screens)
+*
+* In: X = star # (0-3)
+*
+*-------------------------------
+TWINKLE
+ lda #starx
+ sta XCO
+ lda stary,x
+ sta YCO
+ lda stari,x
+ sta IMAGE
+ lda #eor
+ sta OPACITY
+ jsr ]setch6
+ jsr fastlay ;<--DIRECT HIRES CALL
+ lda PAGE
+ eor #$20
+ sta PAGE ;& on other page
+ jsr fastlay
+ lda PAGE
+ eor #$20
+ sta PAGE
+ rts
+
+*-------------------------------
+*
+* Draw big white post in Princess's room
+*
+*-------------------------------
+DRAWPOST
+ lda #postx
+ sta XCO
+ lda #posty
+ sta YCO
+ lda #postimg
+ sta IMAGE
+ lda #ora
+ sta OPACITY
+ jsr ]setch6
+ jmp addfore
+
+*-------------------------------
+*
+* Draw hourglass in Princess's room
+*
+* In: X = glass state (0-8, 0 = full)
+*
+*-------------------------------
+DRAWGLASS
+ lda #glassx
+ sta XCO
+ lda #glassy
+ sta YCO
+ lda glassimg,x
+ sta IMAGE
+ lda #sta
+ sta OPACITY
+ jsr ]setch6
+ jmp addback
+
+*-------------------------------
+*
+* Mask princess's face & hair for certain CharPosns
+*
+* (Called after ADDCHAROBJ)
+*
+*-------------------------------
+PMASK
+ ldx CharPosn
+ cpx #19 ;plie
+ bne :1
+ ldx #0
+ bpl :mask
+:1 cpx #1 ;pslump-1
+ beq :m1
+ cpx #18 ;pslump-2
+ bne :2
+:m1 ldx #1
+ bpl :mask
+:2
+
+]rts rts
+
+:mask
+ lda FCharY
+ clc
+ adc pmaskdy,x
+ sta YCO
+
+ lda XCO
+ clc
+ adc pmaskdx,x
+ sta XCO
+
+ lda pmaski,x
+ sta IMAGE
+
+ lda #5 ;chtable6
+ sta TABLE
+
+ lda #and
+ sta OPACITY
+ lda #UseLayrsave.$80
+ jmp addmid
+
+*-------------------------------
+* If failed copy prot check due to disk not in drive, recheck
+* In: a = 0 (Call after setrecheck0)
+*-------------------------------
+RECHECKYEL
+ sta tempblockx
+ sta tempblocky
+ jsr indexblock ;set y = 0
+ lda (locals),y ;All of this just to hide "lda recheck0"!
+ beq ]rts
+ ldx #5
+ jsr yellow
+ lda #$ff
+ rts
+
+*-------------------------------
+*
+* Draw sand flowing through hourglass
+*
+* In: X = frame # (0-3)
+* Y = hourglass state (0-8)
+*
+*-------------------------------
+FLOW
+ cpy #8
+ bcs ]rts ;glass is empty
+ jsr initlay
+ lda #glassy
+ sec
+ sbc sandht,y
+ sta BOTCUT
+ lda flowimg,x
+ sta IMAGE
+ lda #flowx
+ sta XCO
+ lda #0
+ sta OFFSET
+ lda #flowy
+ sta YCO
+ lda #sta
+ sta OPACITY
+ jsr ]setch6
+ jmp lay ;<---DIRECT HIRES CALL
+
+*-------------------------------
+* Save/restore FCharVars
+
+saveFChar
+ ldx #$f
+:loop lda FCharVars,x
+ sta tempsave,x
+ dex
+ bpl :loop
+ rts
+
+restoreFChar
+ ldx #$f
+:loop lda tempsave,x
+ sta FCharVars,x
+ dex
+ bpl :loop
+]rts rts
+
+*-------------------------------
+*
+* Draw "comix" star
+*
+* In: Char data
+*
+*-------------------------------
+SETUPCOMIX
+ jsr saveFChar
+ jsr :sub
+ jmp restoreFChar
+
+:sub lda #$ff
+ sta FCharIndex
+
+* Get y-coord