Layout:
 800- 81c some table for music player(only?)
 813- 818 temp storage for zp ptrs at $8b/c, $fb/c, $fd/e (swapped in/out for music routine)
   81b    basic music speed
   81c    metronome
   820    basic player sprite shape, from 9417+player#
   821    timer
   822    timer/2
 824- 828 Keyboard Control and Joystick: space, "x"-"z" , ","-"l" =
   824    fire button
   826    x-axis
   827    y-axis
   828    Return-key, seems unused throughout the game
   829    kb-row counter
 82a- 86a kb switches, 1=pressed
   8c9    basic player sprite shape+directional offset
   8ce    player weapon
   8da    current room bg color
 8dc- 8e1 score digits
 90e- 917 camper state: 04=normal, 05=in sanctuary, 07=looking like jason
                             40=being hit, 80=dying, 00=dead
   918    player state (see above), initially=$ff
 92e- 937 some camper value
   938    Panic Level
   943    Player Strength, from 9421+player#
 97b- 985 Camper/PLR.something table
 986- 990 Camper/PLR.somethingelse table
 9a7- 9af various spriteshapes to move to $57f8-$57ff
   9aa    player spriteshape+animation stuff
 9e4- 9e9 sprite#6 pos temp storage (used for weapon status disp.):
          X,Y,X-msb,shape,color,$d015 enable bit
   9ee    current player#
   9ef    current round#
   9f0    Player Sprite Color, from 9426+player#
   a20    offset value for char "0" ($30 for rom-chars, $5b for custom set)

  3xxx    "the scream"-routine

4000-7fff Vic-Bank
4000-47ff Rom-Charset for text printouts between levels
  4000    Ingame Bitmap Mem (-...)
5400-57ff Ingame Text Screen
  56ac    "score:" printout pos
  56fc    panic-o-meter
  5700    strength-o-meter
  5706    mask/time left (except score they're all mini-bitmaps within the custom charset)
5800-5b3f custom charset
5b40-7fff sprites

xxxx-9200 diverse Daten (?)

9200-9400 Init & andere Routinen
939b-939e IRQ fr Textscreens (a679 readkb+joy)
93a1-93c7 Endtext (?"press button" and wait on buttonpress)

93c8-9411 Print Text between Levels
9417-9a7f Daten:
  9417    PlayerSprite Basic Shape Offsets(*5)
  941c    Player specific panic raise speed
  9421    Basic Strength
  9426    Sprite Color
  942b    "oh dear, you have lost your head"
  94ac    "you ran out of time"
  9521    "friday the 13th blablabal.. before he can kill you?"
  95a2    "jason is dead, but for how long?..."
  962d    "gerry king..."
  970f    "wendy watson"
  97e2    "amanda baxter"
  989b    "brian bones"
  9967    "stuart palmer"
  9a25    "press fire button"
  9a44    weapon tabl,e 4x11 numbers from 0 to 10, put to a5aa (jason's revenge list?)
  9a7b    weapon table index, one set of 11 weapons for each character

9a80-xxxx code/daten:
 9a80     setup raster irq/screen mode
 a5aa     11 byte table of currently available weapons, from 9a44+player#*11
aa0f-aa3d Copy rom-charset to $4000-47ff
a67b-a71a read kb+joy, 824=button, 826=xaxis, 827=yaxis
a71b-a803 irq used while changing from info-screens to levelplay (partly reused by ingame irq)
 b49f     init sid-rnd-gen
b4a7-b4be return a random number ranging from 0 to .A-1
     c374 Schreiroutine ($3xxx) Setup
     c5fa ingame IRQ (a723,a7a1/c60a), including music player
c811-c869 switch between normal/music zp ptrs&bank
     c9e9 Schreiroutine +Bild Setup


cdasm version1.3, written by peter gonzalez <pbgonz@mail.wm.edu>, 1995



;---------------------------------------------;
;  disassembly for: f139200.prg
;---------------------------------------------;
;load address: $9200

	_9200:	sei
	_9201:	lda #$12	;set stop vector
	_9203:	sta $0328
	_9206:	lda #$94
	_9208:	sta $0329
	_920b:	cli
	_920c:	ldx #$ff
	_920e:	nop
	_920f:	nop
	_9210:	nop
	_9211:	txs
	_9212:	lda #$8e	;upper case
	_9214:	jsr $ffd2
	_9217:	lda #$08	;disable cbm+shift
	_9219:	jsr $ffd2
	_921c:	lda #$ff	;gameflag=gameon
	_921e:	sta $0918
	_9221:	jsr $9315	;init screen, irq & stuff
	_9224:	lda #$00	;player/round=0
	_9226:	sta $09ee	;player#
	_9229:	sta $09ef	;round#
	_922c:	lda $0918
	_922f:	cmp #$ff	;if game on
	_9231:	beq $924f
	_9233:	cmp #$00	;if out of time
	_9235:	bne $923f
	_9237:	lda #$00	;else lost your head
	_9239:	jsr $93c8
	_923c:	jmp $9244
	_923f:	lda #$01
	_9241:	jsr $93c8

	_9244:	lda #$30	;poke a20,30
	_9246:	sta $0a20	;rom charset offset "0"
	_9249:	jsr $c3dd	;print score
	_924c:	jsr $93a1	;endtext, wait on button

	_924f:	lda #$00	;(newgame)
	_9251:	ldx #$05
	_9253:	sta $08dc,x	;reset score to 0
	_9256:	dex
	_9257:	bpl $9253

	_9259:	lda #$02	;print pre-level text
	_925b:	jsr $93c8
	_925e:	jmp $92b0

	_9261:	jsr $9315
	_9264:	lda #$03
	_9266:	jsr $93c8
	_9269:	ldx #$09
	_926b:	ldy #$00
	_926d:	lda $090e,x
	_9270:	beq $9273
	_9272:	iny
	_9273:	dex
	_9274:	bpl $926d
	_9276:	tya
	_9277:	asl acc
	_9278:	sta $0822
	_927b:	asl acc
	_927c:	asl acc
	_927d:	clc
	_927e:	adc $0822
	_9281:	sty $0822
	_9284:	ldx #$0a
	_9286:	ldy $0822
	_9289:	jsr $c404
	_928c:	dex
	_928d:	bne $9286
	_928f:	lda $0822
	_9292:	clc
	_9293:	adc #$30
	_9295:	sta $54f4
	_9298:	sta $5506
	_929b:	inc $09ef	;round+1
	_929e:	lda $09ee	;player#
	_92a1:	clc
	_92a2:	adc #$01	;+1
	_92a4:	sta $09ee	;player#
	_92a7:	cmp #$05	;if<5
	_92a9:	bcc $92b0
	_92ab:	lda #$00	;else player#=0
	_92ad:	sta $09ee

	_92b0:	lda $09ee	;(init), round/player character counter
	_92b3:	clc
	_92b4:	adc #$04	;+4
	_92b6:	jsr $93c8	;to select character description text
	_92b9:	ldy $09ee	;current character:
	_92bc:	lda $9417,y
	_92bf:	sta $0820	;basic spriteptr (the look of the guy/gal)
	_92c2:	sta $57f8
	_92c5:	lda #$05	;default panic
	_92c7:	sta $0938
	_92ca:	lda $9421,y	;basic strenght
	_92cd:	sta $0943
	_92d0:	lda $9426,y	;sprite color
	_92d3:	sta $09f0
	_92d6:	sta $d027	;sprite 0 color (used for pre-level display)
	_92d9:	lda #$7a	;sprite0 x,y pos
	_92db:	sta $d001
	_92de:	lda #$ac
	_92e0:	sta $d000
	_92e3:	lda #$01	;sprite 0 on
	_92e5:	sta $d015
	_92e8:	ldx #$09	;x=10 campers-1
	_92ea:	lda #$00	;clear some flags (partly used for splatter pics)
	_92ec:	sta $09f1,x
	_92ef:	dex
	_92f0:	bpl $92ec
	_92f2:	jsr $93a1	;? "press button" & wait
	_92f5:	jsr $b49f	;init sid-rnd-gen
	_92f8:	lda #$5b	;custom charset "0" offset=5b
	_92fa:	sta $0a20
	_92fd:	ldx $09ee	;player#
	_9300:	lda $9a7b,x	;get player#*11 from table
	_9303:	tay
	_9304:	ldx #$00
	_9306:	lda $9a44,y	;copy 11 bytes from weapons table
	_9309:	sta $a5aa,x	;to random arsenal table
	_930c:	inx	;could be jason's revenge list?
	_930d:	iny
	_930e:	cpx #$0b
	_9310:	bcc $9306
	_9312:	jmp $9a80	;continue

initscrn&irq	_9315:	jsr $c88a 	;setup table 800-81c
	_9318:	sei
	_9319:	lda $d011 	;turn off screen
	_931c:	and #$cf
	_931e:	sta $d011
	_9321:	lda $01
	_9323:	and #$fe	;turn of basic
	_9325:	sta $01
	_9327:	lda #$9b	;set irq to 939b
	_9329:	sta $0314
	_932c:	lda #$93
	_932e:	sta $0315
	_9331:	lda #$00	;set to 0:
	_9333:	sta $d01a	;vic irq mask
	_9336:	sta $d01d	;sprite xpand
	_9339:	sta $d017
	_933c:	sta $d010	;sprite x-msbs
	_933f:	sta $d015	;sprite enable
	_9342:	lda #$ff
	_9344:	sta $d01c	;multicolor
	_9347:	lda #$06	;sprite mc0=6
	_9349:	sta $d025
	_934c:	lda #$0a	;mc1=10
	_934e:	sta $d026
	_9351:	lda #$01	;start continuos timer1
	_9353:	sta $dc0e
	_9356:	lda $dd02	;switch video bank to $4000-$7fff
	_9359:	ora #$03
	_935b:	sta $dd02
	_935e:	lda $dd00
	_9361:	and #$fc
	_9363:	ora #$02
	_9365:	sta $dd00
	_9368:	lda #$50	;matrix=5400, chars=5000
	_936a:	sta $d018
	_936d:	lda #$54	;screen editor=5400
	_936f:	sta $0288
	_9372:	lda #$01	;clear vic latch
	_9374:	sta $d019
	_9377:	cli
	_9378:	jsr $aa0f	;copy uc romchars to 4000-47ff
	_937b:	lda #$93	;clear screen
	_937d:	jsr $ffd2
	_9380:	lda #$0a	;poke53280,10
	_9382:	sta $d020
	_9385:	lda #$00	;poke53281,0
	_9387:	sta $d021
	_938a:	lda $d016	;hires chars
	_938d:	and #$ef
	_938f:	sta $d016
	_9392:	lda $d011	;screen on
	_9395:	ora #$10
	_9397:	sta $d011
	_939a:	rts

irq	_939b:	jsr $a67b	;read kb & screen
	_939e:	jmp $ea31	;normal irq (inc clock, scan kb again)

endtext	_93a1:	ldx #$17	;repeat: cursor to 17,0
	_93a3:	ldy #$00
	_93a5:	clc
	_93a6:	jsr $fff0
	_93a9:	ldy #$00	;print "press fire button"
	_93ab:	lda $9a25,y
	_93ae:	cmp #$ff
	_93b0:	beq $93b8
	_93b2:	jsr $ffd2
	_93b5:	iny
	_93b6:	bne $93ab

	_93b8:	lda $0824	;until button not pressed
	_93bb:	beq $93a1
	_93bd:	lda $0824	;while button not pressed
	_93c0:	bne $93bd	;endwhile
	_93c2:	lda $0824	;while button pressed
	_93c5:	beq $93c2	;endwhile
	_93c7:	rts
;---end endtext

	_93c8:	pha
	_93c9:	cmp #$04
	_93cb:	bcc $93d8
	_93cd:	ldx #$0e
	_93cf:	ldy #$0c
	_93d1:	clc
	_93d2:	jsr $fff0
	_93d5:	jmp $93dd
	_93d8:	lda #$93
	_93da:	jsr $ffd2
	_93dd:	lda #$2b
	_93df:	sta $fb
	_93e1:	lda #$94
	_93e3:	sta $fc
	_93e5:	ldy #$00
	_93e7:	pla
	_93e8:	tax
	_93e9:	beq $9400
	_93eb:	lda ($fb),y
	_93ed:	cmp #$ff
	_93ef:	beq $93f8
	_93f1:	iny
	_93f2:	bne $93eb
	_93f4:	inc $fc
	_93f6:	bne $93eb
	_93f8:	iny
	_93f9:	bne $93fd
	_93fb:	inc $fc
	_93fd:	dex
	_93fe:	bne $93eb
	_9400:	lda ($fb),y
	_9402:	cmp #$ff
	_9404:	beq $9411
	_9406:	jsr $ffd2
	_9409:	inc $fb
	_940b:	bne $9400
	_940d:	inc $fc
	_940f:	bne $9400
	_9411:	rts

STOP	_9412:	lda #$ff
	_9414:	cmp #$7f
	_9416:	rts

;---------------------------------------------;
...diverse Texte
;---------------------------------------------;
;load address: $9a80

	_9a80:	sei	;continued from newgame setup
	_9a81:	lda $01	;bank out basic
	_9a83:	and #$fe
	_9a85:	sta $01
	_9a87:	lda #$1b	;irq to a71b
	_9a89:	sta $0314
	_9a8c:	lda #$a7
	_9a8e:	sta $0315
	_9a91:	lda $d011	;at raster $100
	_9a94:	ora #$80
	_9a96:	sta $d011
	_9a99:	lda #$00	;some music related flag
	_9a9b:	sta $08d0
	_9a9e:	sta $d012
	_9aa1:	lda #$00	;stop timer irq
	_9aa3:	sta $dc0e
	_9aa6:	lda #$01	;rasterirq on
	_9aa8:	sta $0825	;some music related flag
	_9aab:	sta $d01a
	_9aae:	cli
	_9aaf:	lda $dd02	;switch video bank to $4000-$47ff
	_9ab2:	ora #$03
	_9ab4:	sta $dd02
	_9ab7:	lda $dd00
	_9aba:	and #$fc
	_9abc:	ora #$02
	_9abe:	sta $dd00
	_9ac1:	lda #$56	;screen mem at $5400, charset at $5800,
	_9ac3:	sta $d018	;bitmap at $4000
	_9ac6:	lda #$54	;screen editor to $5400
	_9ac8:	sta $0288
	_9acb:	lda #$00	;0-out a whole bunch of bytes:
	_9acd:	sta $09eb
	_9ad0:	sta $09ed
	_9ad3:	sta $08ca
	_9ad6:	sta $08cb
	_9ad9:	sta $d021	;screen all black
	_9adc:	sta $d020
	_9adf:	lda #$90	;chr$(black)
	_9ae1:	jsr $ffd2
	_9ae4:	lda #$93	;clr/home
	_9ae6:	jsr $ffd2
	_9ae9:	lda #$0b	;dark grey bg
	_9aeb:	sta $d021
	_9aee:	lda #$0a	;char mc 0= light red
	_9af0:	sta $d022
	_9af3:	lda #$06	;char mc 2= blue
	_9af5:	sta $d023	;(both used for status display)
	_9af8:	lda $d016
	_9afb:	ora #$10	;turn on multicolor
	_9afd:	sta $d016
	_9b00:	lda #$ff	;255=none
	_9b02:	sta $08ce	;->player weapon
	_9b05:	ldy #$0a	;all campers+player (?)
	_9b07:	sta $097b,y	;poke unknown table,255
	_9b0a:	dey
	_9b0b:	bpl $9b07
	_9b0d:	lda $820	;copy basic plr spriteshape
	_9b10:	sta $08c9	;to directional basic plr shape &
	_9b13:	sta $09aa	;plr spriteshape+dir/movement temp
	_9b16:	lda #$00
	_9b18:	sta $09cc
	_9b1b:	sta $09d2
	_9b1e:	sta $0821
	_9b21:	sta $09ae
	_9b24:	sta $08c8
	_9b27:	sta $d015	;sprites off
	_9b2a:	sta $d010	;xmsbs=0
	_9b2d:	lda #$04
	_9b2f:	sta $0824	;kill fire button state
	_9b32:	sta $0918	;player status=alive&healthy
	_9b35:	ldy #$0a	;repeat for 10 campers (incl. player)
	_9b37:	ldx #$0a	;  repeat for 10 campers (incl. player)
	_9b39:	lda #$2c
	_9b3b:	jsr $b4a7	;    A=random value 0-2b
	_9b3e:	cmp $097b,x
	_9b41:	beq $9b37
	_9b43:	dex
	_9b44:	bpl $9b3e	;  until A<>camper.something(0-10)
	_9b46:	cmp $086c
	_9b49:	beq $9b37
	_9b4b:	sta $097b,y	;  camper.something(y)=A
	_9b4e:	lda #$20
	_9b50:	jsr $b4a7	;  A=random value 0-20
	_9b53:	sta $0986,y	;  camper.somethingelse(y)=a
	_9b56:	dey
	_9b57:	bpl $9b37	;until all campers done
	_9b59:	jsr $9b62
	_9b5c:	jsr $9b6e
	_9b5f:	jmp $9b88
	_9b62:	lda #$09
	_9b64:	clc
	_9b65:	adc #$01
	_9b67:	jsr $b4a7	;calc random value
	_9b6a:	sta $0992
	_9b6d:	rts
	_9b6e:	lda #$14
	_9b70:	jsr $b4a7	;calc random value
	_9b73:	clc
	_9b74:	adc #$18
	_9b76:	ldx #$09
	_9b78:	cmp $097b,x
	_9b7b:	beq $9b6e
	_9b7d:	dex
	_9b7e:	bpl $9b78
	_9b80:	sta $0985
	_9b83:	lda #$13
	_9b85:	sta $0990
	_9b88:	lda #$00
	_9b8a:	sta $086a
	_9b8d:	lda #$01
	_9b8f:	sta $086b
	_9b92:	lda #$02
	_9b94:	sta $08b9
	_9b97:	jsr $a8c8
	_9b9a:	jsr $aee0
	_9b9d:	jsr $a209
	_9ba0:	lda #$08
	_9ba2:	sta $d027
	_9ba5:	lda #$06
	_9ba7:	sta $d025
	_9baa:	lda #$0a
	_9bac:	sta $d026
	_9baf:	lda #$ff
	_9bb1:	sta $d01c
	_9bb4:	lda #$70
	_9bb6:	sta $08f7
	_9bb9:	sta $09a6
	_9bbc:	lda #$35
	_9bbe:	sta $0902
	_9bc1:	sta $09a2
	_9bc4:	jsr $9bca
	_9bc7:	jmp $9d02
	_9bca:	ldx #$11
	_9bcc:	ldy #$00
	_9bce:	clc
	_9bcf:	jsr $fff0
	_9bd2:	ldx #$00
	_9bd4:	lda $a5b9,x
	_9bd7:	cmp #$ff
	_9bd9:	beq $9be1
	_9bdb:	jsr $ffd2
	_9bde:	inx
	_9bdf:	bne $9bd4
	_9be1:	jsr $bff4
	_9be4:	rts
	_9be5:	lda $09b7
	_9be8:	bne $9be5
	_9bea:	lda $08ec
	_9bed:	jsr $bf17
	_9bf0:	lda #$08
	_9bf2:	sta $08c2
	_9bf5:	lda #$06
	_9bf7:	sta $08b8
	_9bfa:	lda $d015
	_9bfd:	and #$f0
	_9bff:	sta $d015
	_9c02:	ldx #$03
	_9c04:	lda #$00
	_9c06:	sta $09bb,x
	_9c09:	lda $099f,x
	_9c0c:	sta $09bf,x
	_9c0f:	dex
	_9c10:	bpl $9c04
	_9c12:	ldx #$03
	_9c14:	lda #$fe
	_9c16:	cmp $09bf,x
	_9c19:	bcc $9c21
	_9c1b:	lda $09bf,x
	_9c1e:	stx $09b8
	_9c21:	dex
	_9c22:	bpl $9c16
	_9c24:	ldx $09b8
	_9c27:	lda $09a3,x
	_9c2a:	sta $08ba
	_9c2d:	lda $09bf,x
	_9c30:	sta $08bb
	_9c33:	lda $09af,x
	_9c36:	sta $08b7
	_9c39:	lda $09b3,x
	_9c3c:	sta $08b5
	_9c3f:	lda #$0a
	_9c41:	sta $0991
	_9c44:	jsr $9fa2
	_9c47:	sta $0822
	_9c4a:	lda $d010
	_9c4d:	and $08c3
	_9c50:	ora $0822
	_9c53:	sta $d010
	_9c56:	lda $d01b
	_9c59:	and $08c3
	_9c5c:	ora $08bc
	_9c5f:	sta $d01b
	_9c62:	txa
	_9c63:	ldx $08b8
	_9c66:	sta $d000,x
	_9c69:	tya
	_9c6a:	sta $d001,x
	_9c6d:	ldx $09b8
	_9c70:	lda $08b8
	_9c73:	lsr acc
	_9c74:	tay
	_9c75:	lda $09ab,x
	_9c78:	sta $09bb,y
	_9c7b:	lda $09a7,x
	_9c7e:	sta $57f8,y
	_9c81:	lda $d015
	_9c84:	ora $08c2
	_9c87:	sta $d015
	_9c8a:	lsr $08c2
	_9c8d:	dec $08b8
	_9c90:	dec $08b8
	_9c93:	lda #$ff
	_9c95:	ldx $09b8
	_9c98:	sta $09bf,x
	_9c9b:	lda $09ab,x
	_9c9e:	bne $9cc8
	_9ca0:	lda $08b8
	_9ca3:	clc
	_9ca4:	adc #$02
	_9ca6:	lsr acc
	_9ca7:	sta $08cc
	_9caa:	lda $08c2
	_9cad:	asl acc
	_9cae:	sta $08cd
	_9cb1:	lda $08ba
	_9cb4:	and #$fe
	_9cb6:	sta $08f7
	_9cb9:	lda $08bb
	_9cbc:	sta $0902
	_9cbf:	lda $09f0
	_9cc2:	sta $d027,y
	_9cc5:	jmp $9ce1
	_9cc8:	tax
	_9cc9:	dex
	_9cca:	lda $090e,x	;camper status flag
	_9ccd:	and #$3f	;-death flags
	_9ccf:	cmp #$07
	_9cd1:	bne $9cd7
	_9cd3:	lda #$00
	_9cd5:	beq $9cde
	_9cd7:	lda $bb83,x
	_9cda:	lsr acc
	_9cdb:	lsr acc
	_9cdc:	lsr acc
	_9cdd:	lsr acc
	_9cde:	sta $d027,y
	_9ce1:	ldx #$03
	_9ce3:	lda $09bf,x
	_9ce6:	cmp #$ff
	_9ce8:	bne $9cff
	_9cea:	dex
	_9ceb:	bpl $9ce3
	_9ced:	lda $09eb
	_9cf0:	beq $9cf9
	_9cf2:	lda #$03
	_9cf4:	sta $08c7
	_9cf7:	bne $9d02
	_9cf9:	jsr $c145
	_9cfc:	jmp $9d02
	_9cff:	jmp $9c12
	_9d02:	lda $0315
	_9d05:	cmp #$c5
	_9d07:	beq $9d0e
	_9d09:	lda #$00
	_9d0b:	jsr $c4ce
	_9d0e:	lda $0918
	_9d11:	bne $9d1e
	_9d13:	jsr $c374
	_9d16:	lda #$00
	_9d18:	sta $d015
	_9d1b:	jmp $9221
	_9d1e:	ldx $0992
	_9d21:	lda $090e,x	;camper status flag
	_9d24:	bne $9d31
	_9d26:	jsr $a57c
	_9d29:	lda #$00
	_9d2b:	sta $d015
	_9d2e:	jmp $9261
	_9d31:	lda $08c7
	_9d34:	cmp #$02
	_9d36:	bcc $9d31
	_9d38:	lda $09eb
	_9d3b:	bne $9d4f
	_9d3d:	lda $09cc
	_9d40:	cmp #$04
	_9d42:	bne $9d47
	_9d44:	jsr $b92e
	_9d47:	lda #$01
	_9d49:	sta $09eb
	_9d4c:	jmp $9d9d
	_9d4f:	lda $08c7
	_9d52:	cmp #$04
	_9d54:	bcc $9d4f
	_9d56:	lda #$00
	_9d58:	sta $09eb
	_9d5b:	sta $08c7
	_9d5e:	inc $08d5
	_9d61:	bne $9d68
	_9d63:	lda #$05
	_9d65:	jsr $a24c
	_9d68:	jsr $be11
	_9d6b:	lda $08d5
	_9d6e:	and #$7f
	_9d70:	bne $9d84
	_9d72:	inc $0821
	_9d75:	lda $0821
	_9d78:	cmp #$c0
	_9d7a:	bcc $9d84
	_9d7c:	lda #$00
	_9d7e:	sta $d015
	_9d81:	jmp $9221
	_9d84:	lda $d01f
	_9d87:	sta $08c5
	_9d8a:	lda $d01e
	_9d8d:	sta $08c6
	_9d90:	lda #$ff
	_9d92:	sta $09b8
	_9d95:	lda $09eb
	_9d98:	bne $9d9d
	_9d9a:	jsr $af49
	_9d9d:	lda $09cc
	_9da0:	sta $09d6
	_9da3:	lda $0824	;fire button
	_9da6:	bne $9db8
	_9da8:	lda $0825
	_9dab:	beq $9dbd
	_9dad:	lda #$00
	_9daf:	sta $0825
	_9db2:	jsr $b5ac
	_9db5:	jmp $9dbd
	_9db8:	lda #$01
	_9dba:	sta $0825
	_9dbd:	lda $09cc
	_9dc0:	cmp $09d6
	_9dc3:	beq $9dce
	_9dc5:	lda $09cc
	_9dc8:	sta $09d6
	_9dcb:	jmp $9de2
	_9dce:	lda $09cc
	_9dd1:	beq $9df3
	_9dd3:	jsr $b92e
	_9dd6:	lda $09cc
	_9dd9:	cmp $09d6
	_9ddc:	bne $9de2
	_9dde:	cmp #$04
	_9de0:	beq $9df3
	_9de2:	lda #$00
	_9de4:	sta $08b7
	_9de7:	sta $08b5
	_9dea:	lda $09d8
	_9ded:	sta $09aa	;plr spriteshape+dir/movement temp
	_9df0:	jmp $9f82
	_9df3:	lda $09cc
	_9df6:	sta $09d6
	_9df9:	lda $0918
	_9dfc:	and #$c0
	_9dfe:	beq $9e2b
	_9e00:	lda $820	;basic plr spriteshape
	_9e03:	clc
	_9e04:	adc #$05
	_9e06:	cmp $09aa	;plr spriteshape+dir/movement temp
	_9e09:	bcc $9e18
	_9e0b:	clc
	_9e0c:	adc #$0c
	_9e0e:	cmp $09aa	;plr spriteshape+dir/movement temp
	_9e11:	beq $9e1a
	_9e13:	clc
	_9e14:	adc #$01
	_9e16:	bne $9e1a
	_9e18:	adc #$0c
	_9e1a:	sta $09aa	;plr spriteshape+dir/movement temp
	_9e1d:	lda #$00
	_9e1f:	sta $08c8
	_9e22:	sta $08b5
	_9e25:	sta $08b7
	_9e28:	jmp $9f82
	_9e2b:	lda $0826
	_9e2e:	ora $0827
	_9e31:	bne $9e5e
	_9e33:	lda #$00
	_9e35:	sta $08c8
	_9e38:	sta $08b7
	_9e3b:	sta $08b5
	_9e3e:	lda $820	;basic plr spriteshape
	_9e41:	clc
	_9e42:	adc #$04
	_9e44:	cmp $09aa	;plr spriteshape+dir/movement temp
	_9e47:	bcc $9e52
	_9e49:	lda $820	;basic plr spriteshape
	_9e4c:	sta $09aa	;plr spriteshape+dir/movement temp
	_9e4f:	jmp $9f82
	_9e52:	lda $820	;basic plr spriteshape
	_9e55:	clc
	_9e56:	adc #$05
	_9e58:	sta $09aa	;plr spriteshape+dir/movement temp
	_9e5b:	jmp $9f82
	_9e5e:	lda #$0a
	_9e60:	sta $0991
	_9e63:	inc $08c8
	_9e66:	inc $08ca
	_9e69:	lda $08ca
	_9e6c:	cmp #$04
	_9e6e:	bcc $9e75
	_9e70:	lda #$00
	_9e72:	sta $08ca
	_9e75:	lda $08c8
	_9e78:	cmp #$05
	_9e7a:	bcc $9e81
	_9e7c:	lda #$00
	_9e7e:	sta $08c8
	_9e81:	lda $0826
	_9e84:	beq $9e99
	_9e86:	bmi $9e93
	_9e88:	lda $820	;basic plr spriteshape
	_9e8b:	clc
	_9e8c:	adc #$05
	_9e8e:	sta $8c9	;base plr spriteshape+direction offset
	_9e91:	bne $9e99
	_9e93:	lda $820	;basic plr spriteshape
	_9e96:	sta $8c9	;base plr spriteshape+direction offset
	_9e99:	lda $0826
	_9e9c:	sta $08b4
	_9e9f:	sta $08b5
	_9ea2:	lda $0827
	_9ea5:	sta $08b7
	_9ea8:	sta $08b6
	_9eab:	lda #$00
	_9ead:	sta $0826
	_9eb0:	sta $0827
	_9eb3:	lda $08b9
	_9eb6:	beq $9ed6
	_9eb8:	lda $08f7
	_9ebb:	sta $08ba
	_9ebe:	lda $0902
	_9ec1:	sta $08bb
	_9ec4:	jsr $aa86
	_9ec7:	lda $08ba
	_9eca:	sta $08f7
	_9ecd:	lda $08bb
	_9ed0:	sta $0902
	_9ed3:	jmp $9eff
	_9ed6:	lda $08b4
	_9ed9:	asl acc
	_9eda:	asl acc
	_9edb:	clc
	_9edc:	adc $08f7
	_9edf:	cmp #$e9
	_9ee1:	bcs $9eeb
	_9ee3:	ldx #$00
	_9ee5:	stx $08b4
	_9ee8:	sta $08f7
	_9eeb:	lda $08b6
	_9eee:	asl acc
	_9eef:	clc
	_9ef0:	adc $0902
	_9ef3:	cmp #$6c
	_9ef5:	bcs $9eff
	_9ef7:	ldx #$00
	_9ef9:	stx $08b6
	_9efc:	sta $0902
	_9eff:	lda $08b4
	_9f02:	ora $08b6
	_9f05:	beq $9f47
	_9f07:	jsr $a1c8
	_9f0a:	lda $08b9
	_9f0d:	beq $9f2d
	_9f0f:	lda $08f7
	_9f12:	sta $08ba
	_9f15:	lda $0902
	_9f18:	sta $08bb
	_9f1b:	jsr $abc5
	_9f1e:	lda $08ba
	_9f21:	sta $08f7
	_9f24:	lda $08bb
	_9f27:	sta $0902
	_9f2a:	jmp $9f47
	_9f2d:	lda $08b4
	_9f30:	beq $9f3a
	_9f32:	lda $08f7
	_9f35:	eor #$e8
	_9f37:	sta $08f7
	_9f3a:	lda $08b6
	_9f3d:	beq $9f47
	_9f3f:	lda $0902
	_9f42:	eor #$6a
	_9f44:	sta $0902
	_9f47:	lda $8c9	;base plr spriteshape+direction offset
	_9f4a:	clc
	_9f4b:	adc $08c8
	_9f4e:	sta $09aa	;plr spriteshape+dir/movement temp
	_9f51:	lda $08b5
	_9f54:	bne $9f78
	_9f56:	lda $08b7
	_9f59:	beq $9f78
	_9f5b:	ldy $08ca
	_9f5e:	lda $a677,y
	_9f61:	ldy $08b7
	_9f64:	bmi $9f69
	_9f66:	clc
	_9f67:	adc #$03
	_9f69:	clc
	_9f6a:	adc $820	;basic plr spriteshape
	_9f6d:	adc #$0b
	_9f6f:	sta $09aa	;plr spriteshape+dir/movement temp
	_9f72:	jsr $c1eb
	_9f75:	jmp $9f82
	_9f78:	lda $08c8
	_9f7b:	cmp #$03
	_9f7d:	bne $9f82
	_9f7f:	jsr $c1eb
	_9f82:	lda $08f7
	_9f85:	sta $09a6
	_9f88:	lda $08b7
	_9f8b:	sta $09b2
	_9f8e:	lda $08b5
	_9f91:	sta $09b6
	_9f94:	lda $0902
	_9f97:	sta $09a2
	_9f9a:	lda #$00
	_9f9c:	sta $09ae
	_9f9f:	jmp $9be5
	_9fa2:	lda $09ab,x
	_9fa5:	beq $9fa9
	_9fa7:	lda #$01
	_9fa9:	sta $08d3
	_9fac:	lda #$00
	_9fae:	sta $0999
	_9fb1:	sta $099a
	_9fb4:	lda $08c2
	_9fb7:	eor #$ff
	_9fb9:	sta $08c3
	_9fbc:	ldx #$00
	_9fbe:	lda #$1f
	_9fc0:	cmp $08ba
	_9fc3:	bcs $9fca
	_9fc5:	adc #$20
	_9fc7:	inx
	_9fc8:	bne $9fc0
	_9fca:	stx $08bd
	_9fcd:	stx $08be
	_9fd0:	sec
	_9fd1:	sbc #$18
	_9fd3:	cmp $08ba
	_9fd6:	bcs $9fdc
	_9fd8:	inx
	_9fd9:	stx $08be
	_9fdc:	ldx #$00
	_9fde:	lda #$1f
	_9fe0:	cmp $08bb
	_9fe3:	bcs $9fea
	_9fe5:	adc #$20
	_9fe7:	inx
	_9fe8:	bne $9fe0
	_9fea:	pha
	_9feb:	txa
	_9fec:	asl acc
	_9fed:	asl acc
	_9fee:	asl acc
	_9fef:	pha
	_9ff0:	clc
	_9ff1:	adc $08bd
	_9ff4:	sta $08bd
	_9ff7:	adc #$08
	_9ff9:	sta $08bf
	_9ffc:	pla
	_9ffd:	adc $08be
	_a000:	sta $08be
	_a003:	adc #$08
	_a005:	sta $08c0
	_a008:	cmp #$20
	_a00a:	bcc $a014
	_a00c:	lda #$ff
	_a00e:	sta $08bf
	_a011:	sta $08c0
	_a014:	pla
	_a015:	sta $08c1
	_a018:	sec
	_a019:	sbc #$14
	_a01b:	cmp $08bb
	_a01e:	bcc $a02c
	_a020:	lda $08bd
	_a023:	sta $08bf
	_a026:	lda $08be
	_a029:	sta $08c0
	_a02c:	ldx $08bd
	_a02f:	lda $0894,x
	_a032:	ldx $08be
	_a035:	ora $0894,x
	_a038:	beq $a09a
	_a03a:	ldx $08bd
	_a03d:	lda $0894,x
	_a040:	jsr $ae8f
	_a043:	bcc $a069
	_a045:	cmp #$01
	_a047:	bne $a0b1
	_a049:	lda $08bd
	_a04c:	clc
	_a04d:	adc #$08
	_a04f:	cmp #$20
	_a051:	bcs $a05c
	_a053:	tax
	_a054:	lda $0894,x
	_a057:	jsr $ae8f
	_a05a:	bcc $a09a
	_a05c:	ldx $08bf
	_a05f:	bmi $a0b1
	_a061:	lda $0894,x
	_a064:	jsr $ae8f
	_a067:	bcs $a0b1
	_a069:	ldx $08be
	_a06c:	lda $0894,x
	_a06f:	jsr $ae8f
	_a072:	bcc $a09a
	_a074:	cmp #$01
	_a076:	bne $a0b1
	_a078:	lda $08be
	_a07b:	clc
	_a07c:	adc #$08
	_a07e:	cmp #$20
	_a080:	bcs $a08d
	_a082:	tax
	_a083:	lda $0894,x
	_a086:	jsr $ae8f
	_a089:	bcc $a09a
	_a08b:	bcs $a0b1
	_a08d:	ldx $08c0
	_a090:	bmi $a0b1
	_a092:	lda $0894,x
	_a095:	jsr $ae8f
	_a098:	bcs $a0b1
	_a09a:	lda $08c1
	_a09d:	sec
	_a09e:	sbc #$16
	_a0a0:	cmp $08bb
	_a0a3:	beq $a11e
	_a0a5:	bcs $a112
	_a0a7:	adc #$02
	_a0a9:	cmp $08bb
	_a0ac:	bne $a0b1
	_a0ae:	jmp $a15b
	_a0b1:	lda $08bf
	_a0b4:	cmp $08bd
	_a0b7:	bne $a0de
	_a0b9:	clc
	_a0ba:	adc #$08
	_a0bc:	cmp #$20
	_a0be:	bcs $a100
	_a0c0:	tax
	_a0c1:	lda $0894,x
	_a0c4:	jsr $ae8f
	_a0c7:	bcc $a0cd
	_a0c9:	cmp #$01
	_a0cb:	beq $a112
	_a0cd:	lda $08be
	_a0d0:	clc
	_a0d1:	adc #$08
	_a0d3:	tax
	_a0d4:	lda $0894,x
	_a0d7:	jsr $ae8f
	_a0da:	bcc $a100
	_a0dc:	bcs $a0fc
	_a0de:	ldx $08bf
	_a0e1:	cpx #$20
	_a0e3:	bcs $a100
	_a0e5:	lda $0894,x
	_a0e8:	jsr $ae8f
	_a0eb:	bcc $a0f1
	_a0ed:	cmp #$01
	_a0ef:	beq $a112
	_a0f1:	ldx $08c0
	_a0f4:	lda $0894,x
	_a0f7:	jsr $ae8f
	_a0fa:	bcc $a100
	_a0fc:	cmp #$01
	_a0fe:	beq $a112
	_a100:	ldy #$00
	_a102:	ldx $08bd
	_a105:	lda $0894,x
	_a108:	bne $a115
	_a10a:	ldx $08be
	_a10d:	lda $0894,x
	_a110:	bne $a115
	_a112:	ldy $08c2
	_a115:	sty $08bc
	_a118:	jsr $acf6
	_a11b:	jmp $a195
	_a11e:	lda $08d3
	_a121:	bne $a12d
	_a123:	lda $08cd
	_a126:	and $08c5
	_a129:	beq $a158
	_a12b:	bne $a13f
	_a12d:	lda #$00
	_a12f:	ldx $08bd
	_a132:	cmp $0894,x
	_a135:	bne $a13f
	_a137:	ldx $08be
	_a13a:	cmp $0894,x
	_a13d:	beq $a158
	_a13f:	lda $08b7
	_a142:	cmp #$ff
	_a144:	bne $a158
	_a146:	jsr $a4ce
	_a149:	lda $08bb
	_a14c:	clc
	_a14d:	adc #$02
	_a14f:	sta $08bb
	_a152:	jsr $ae41
	_a155:	jmp $9fbc
	_a158:	jmp $a112
	_a15b:	lda $08d3
	_a15e:	bne $a16a
	_a160:	lda $08cd
	_a163:	and $08c5
	_a166:	beq $a192
	_a168:	bne $a17c
	_a16a:	lda #$00
	_a16c:	ldx $08bd
	_a16f:	cmp $0894,x
	_a172:	bne $a17c
	_a174:	ldx $08be
	_a177:	cmp $0894,x
	_a17a:	beq $a192
	_a17c:	lda $08b7
	_a17f:	cmp #$01
	_a181:	bne $a192
	_a183:	lda $08bb
	_a186:	sec
	_a187:	sbc #$02
	_a189:	sta $08bb
	_a18c:	jsr $ae41
	_a18f:	jmp $9fbc
	_a192:	jmp $a0b1
	_a195:	lda $0999
	_a198:	bne $a1b0
	_a19a:	ldx $0991
	_a19d:	lda $0965,x
	_a1a0:	cmp #$ff
	_a1a2:	beq $a1b0
	_a1a4:	and #$01
	_a1a6:	beq $a1b0
	_a1a8:	lda #$ff
	_a1aa:	sta $0965,x
	_a1ad:	jsr $ae80
	_a1b0:	lda $08bb
	_a1b3:	clc
	_a1b4:	adc #$32
	_a1b6:	tay
	_a1b7:	lda $08ba
	_a1ba:	clc
	_a1bb:	adc #$38
	_a1bd:	tax
	_a1be:	lda #$00
	_a1c0:	adc #$00
	_a1c2:	beq $a1c7
	_a1c4:	lda $08c2
	_a1c7:	rts
	_a1c8:	lda $08b9
	_a1cb:	asl acc
	_a1cc:	tay
	_a1cd:	lda $08b4
	_a1d0:	beq $a1ec
	_a1d2:	clc
	_a1d3:	adc $086a
	_a1d6:	sta $086a
	_a1d9:	ldx #$00
	_a1db:	cmp $a58c,y
	_a1de:	beq $a1e9
	_a1e0:	bcc $a1ec
	_a1e2:	lda $a58c,y
	_a1e5:	sec
	_a1e6:	sbc #$01
	_a1e8:	tax
	_a1e9:	stx $086a
	_a1ec:	lda $08b6
	_a1ef:	clc
	_a1f0:	adc $086b
	_a1f3:	sta $086b
	_a1f6:	ldx #$00
	_a1f8:	cmp $a58d,y
	_a1fb:	beq $a206
	_a1fd:	bcc $a209
	_a1ff:	lda $a58d,y
	_a202:	sec
	_a203:	sbc #$01
	_a205:	tax
	_a206:	stx $086b
	_a209:	lda $08b9
	_a20c:	asl acc
	_a20d:	tay
	_a20e:	lda #$00
	_a210:	ldx $086b
	_a213:	beq $a21c
	_a215:	clc
	_a216:	adc $a58c,y
	_a219:	dex
	_a21a:	bne $a215
	_a21c:	clc
	_a21d:	adc $086a
	_a220:	ldx $08b9
	_a223:	clc
	_a224:	adc $a5b5,x
	_a227:	sta $086c
	_a22a:	lda $08b9
	_a22d:	lsr acc
	_a22e:	ror acc
	_a22f:	ror acc
	_a230:	sta $0822
	_a233:	lda $086a
	_a236:	asl acc
	_a237:	asl acc
	_a238:	asl acc
	_a239:	ora $0822
	_a23c:	ora $086b
	_a23f:	sta $08ec
	_a242:	sta $090d
	_a245:	jsr $a2a2
	_a248:	jsr $ca47
	_a24b:	rts
	_a24c:	ldy $0992
	_a24f:	lda $090e,y	;camper status flag
	_a252:	cmp #$07
	_a254:	bne $a257
	_a256:	rts
	_a257:	lda $0821
	_a25a:	clc
	_a25b:	adc #$14
	_a25d:	jsr $b4a7	;calc random value
	_a260:	cmp $0821
	_a263:	bcc $a266
	_a265:	rts
	_a266:	lda #$07
	_a268:	sta $090e,y	;camper status flag
	_a26b:	ldy #$09
	_a26d:	lda #$00
	_a26f:	tax
	_a270:	cmp $092e,y	;some camper value
	_a273:	bcs $a28f
	_a275:	cpy $0992
	_a278:	beq $a28f
	_a27a:	sta $0822
	_a27d:	lda $090e,y	;camper status flag
	_a280:	cmp #$05
	_a282:	bne $a28a
	_a284:	lda $0822
	_a287:	jmp $a28f
	_a28a:	tya
	_a28b:	tax
	_a28c:	lda $092e,y	;some camper value
	_a28f:	dey
	_a290:	bpl $a270
	_a292:	cmp $0938	;player panic level
	_a295:	bcs $a299
	_a297:	ldx #$0a
	_a299:	stx $0993
	_a29c:	lda #$04
	_a29e:	jsr $c4ce
	_a2a1:	rts
	_a2a2:	lda #$00
	_a2a4:	sta $d015
	_a2a7:	jsr $c8df
	_a2aa:	jsr $a909
	_a2ad:	ldx #$00
	_a2af:	stx $0822
	_a2b2:	lda $086c
	_a2b5:	asl acc
	_a2b6:	rol $0822
	_a2b9:	asl acc
	_a2ba:	rol $0822
	_a2bd:	asl acc
	_a2be:	rol $0822
	_a2c1:	asl acc
	_a2c2:	rol $0822
	_a2c5:	asl acc
	_a2c6:	rol $0822
	_a2c9:	clc
	_a2ca:	adc #$00
	_a2cc:	sta $fb
	_a2ce:	lda $0822
	_a2d1:	adc #$0c
	_a2d3:	sta $fc
	_a2d5:	lda #$00
	_a2d7:	sta $086d
	_a2da:	lda #$04
	_a2dc:	sta $086e
	_a2df:	lda #$04
	_a2e1:	sta $fd
	_a2e3:	lda #$00
	_a2e5:	sta $fe
	_a2e7:	lda #$08
	_a2e9:	sta $086f
	_a2ec:	lda #$00
	_a2ee:	sta $0870
	_a2f1:	lda $fd
	_a2f3:	sta $8b
	_a2f5:	lda $fe
	_a2f7:	clc
	_a2f8:	adc #$d8
	_a2fa:	sta $8c
	_a2fc:	lda #$04
	_a2fe:	sta $0871
	_a301:	ldy $086d
	_a304:	lda ($fb),y
	_a306:	sta $0894,y
	_a309:	tax
	_a30a:	lda $a5da,x
	_a30d:	sta $0872
	_a310:	and #$0f
	_a312:	sta $0873
	_a315:	lda $fb
	_a317:	pha
	_a318:	lda $fc
	_a31a:	pha
	_a31b:	lda #$00
	_a31d:	sta $fc
	_a31f:	txa
	_a320:	asl acc
	_a321:	rol $fc
	_a323:	asl acc
	_a324:	rol $fc
	_a326:	asl acc
	_a327:	rol $fc
	_a329:	asl acc
	_a32a:	rol $fc
	_a32c:	asl acc
	_a32d:	rol $fc
	_a32f:	clc
	_a330:	adc #$00
	_a332:	sta $fb
	_a334:	lda #$80
	_a336:	adc $fc
	_a338:	sta $fc
	_a33a:	ldy #$1f
	_a33c:	lda ($fb),y
	_a33e:	sta $0874,y
	_a341:	dey
	_a342:	bpl $a33c
	_a344:	pla
	_a345:	sta $fc
	_a347:	pla
	_a348:	sta $fb
	_a34a:	ldx #$00
	_a34c:	ldy $0870
	_a34f:	lda $0875,x
	_a352:	sta $09df
	_a355:	lda $0874,x
	_a358:	jsr $a806
	_a35b:	lda $0873
	_a35e:	sta ($8b),y
	_a360:	iny
	_a361:	lda $0877,x
	_a364:	sta $09df
	_a367:	lda $0876,x
	_a36a:	jsr $a806
	_a36d:	lda $0873
	_a370:	sta ($8b),y
	_a372:	iny
	_a373:	lda $0879,x
	_a376:	sta $09df
	_a379:	lda $0878,x
	_a37c:	jsr $a806
	_a37f:	lda $0873
	_a382:	sta ($8b),y
	_a384:	iny
	_a385:	lda $087b,x
	_a388:	sta $09df
	_a38b:	lda $087a,x
	_a38e:	jsr $a806
	_a391:	lda $0873
	_a394:	sta ($8b),y
	_a396:	txa
	_a397:	clc
	_a398:	adc #$08
	_a39a:	tax
	_a39b:	tya
	_a39c:	clc
	_a39d:	adc #$25
	_a39f:	tay
	_a3a0:	dec $0871
	_a3a3:	bne $a34f
	_a3a5:	lda $0870
	_a3a8:	clc
	_a3a9:	adc #$04
	_a3ab:	sta $0870
	_a3ae:	inc $086d
	_a3b1:	dec $086f
	_a3b4:	beq $a3b9
	_a3b6:	jmp $a2fc
	_a3b9:	lda $fd
	_a3bb:	clc
	_a3bc:	adc #$a0
	_a3be:	sta $fd
	_a3c0:	lda $fe
	_a3c2:	adc #$00
	_a3c4:	sta $fe
	_a3c6:	dec $086e
	_a3c9:	bne $a3da
	_a3cb:	lda $086c
	_a3ce:	cmp $0985
	_a3d1:	bne $a3dd
	_a3d3:	lda #$01
	_a3d5:	sta $09ed
	_a3d8:	bne $a3dd
	_a3da:	jmp $a2e7
	_a3dd:	jsr $bf7b
	_a3e0:	lda $d015
	_a3e3:	and #$3f
	_a3e5:	sta $d015
	_a3e8:	ldy #$0a
	_a3ea:	lda $086c
	_a3ed:	cmp $097b,y
	_a3f0:	beq $a409
	_a3f2:	dey
	_a3f3:	bpl $a3ed
	_a3f5:	lda #$ff
	_a3f7:	sta $099f
	_a3fa:	sta $09a0
	_a3fd:	sta $09a1
	_a400:	lda #$02
	_a402:	sta $08c7
	_a405:	sta $09eb
	_a408:	rts
	_a409:	lda $0986,y
	_a40c:	tax
	_a40d:	lda $0894,x
	_a410:	cmp #$00
	_a412:	beq $a426
	_a414:	lda $0986,y
	_a417:	sec
	_a418:	sbc #$01
	_a41a:	sta $0986,y
	_a41d:	bpl $a409
	_a41f:	lda #$1f
	_a421:	sta $0986,y
	_a424:	bne $a409
	_a426:	lda $08b9
	_a429:	beq $a44b
	_a42b:	ldx #$11
	_a42d:	lda $0986,y
	_a430:	cmp $a665,x
	_a433:	beq $a44b
	_a435:	dex
	_a436:	bpl $a430
	_a438:	lda $0986,y
	_a43b:	sec
	_a43c:	sbc #$01
	_a43e:	sta $0986,y
	_a441:	bpl $a409
	_a443:	lda #$1f
	_a445:	sta $0986,y
	_a448:	jmp $a409
	_a44b:	ldx #$00
	_a44d:	stx $08ba
	_a450:	stx $08bb
	_a453:	lda $0986,y
	_a456:	cmp #$08
	_a458:	bcc $a461
	_a45a:	sbc #$08
	_a45c:	inc $08bb
	_a45f:	bne $a456
	_a461:	asl acc
	_a462:	asl acc
	_a463:	asl acc
	_a464:	asl acc
	_a465:	asl acc
	_a466:	clc
	_a467:	adc #$04
	_a469:	sta $08ba
	_a46c:	lda $08bb
	_a46f:	asl acc
	_a470:	asl acc
	_a471:	asl acc
	_a472:	asl acc
	_a473:	asl acc
	_a474:	clc
	_a475:	adc #$0b
	_a477:	sta $08bb
	_a47a:	lda $08c2
	_a47d:	pha
	_a47e:	lda #$80
	_a480:	sta $08c2
	_a483:	tya
	_a484:	pha
	_a485:	jsr $a1b0
	_a488:	sta $0822
	_a48b:	lda $d010
	_a48e:	and #$7f
	_a490:	ora $0822
	_a493:	sta $d010
	_a496:	stx $d00e
	_a499:	sty $d00f
	_a49c:	lda $d01b
	_a49f:	and #$3f
	_a4a1:	sta $d01b
	_a4a4:	pla
	_a4a5:	pha
	_a4a6:	tay
	_a4a7:	sta $08d1
	_a4aa:	lda $a5aa,y
	_a4ad:	tay
	_a4ae:	lda $a594,y
	_a4b1:	sta $d02e
	_a4b4:	lda $a59f,y
	_a4b7:	sta $57ff
	_a4ba:	lda $d015
	_a4bd:	ora #$80
	_a4bf:	sta $d015
	_a4c2:	pla
	_a4c3:	tay
	_a4c4:	pla
	_a4c5:	sta $08c2
	_a4c8:	lda $086c
	_a4cb:	jmp $a3f2
	_a4ce:	ldx $09b8
	_a4d1:	cpx #$ff
	_a4d3:	beq $a4dc
	_a4d5:	lda $09ab,x
	_a4d8:	cmp #$00
	_a4da:	beq $a4dd
	_a4dc:	rts
	_a4dd:	lda $08bd
	_a4e0:	cmp $08be
	_a4e3:	bne $a4e6
	_a4e5:	rts
	_a4e6:	lda $08b9
	_a4e9:	cmp #$03
	_a4eb:	bne $a4fa
	_a4ed:	ldy $08bd
	_a4f0:	lda $0894,y
	_a4f3:	ldx #$03
	_a4f5:	cmp #$56
	_a4f7:	beq $a542
	_a4f9:	rts
	_a4fa:	cmp #$00
	_a4fc:	bne $a515
	_a4fe:	ldy $08bd
	_a501:	ldx #$01
	_a503:	lda $0894,y
	_a506:	cmp #$2c
	_a508:	beq $a527
	_a50a:	inx
	_a50b:	cmp #$20
	_a50d:	beq $a527
	_a50f:	inx
	_a510:	cmp #$36
	_a512:	beq $a527
	_a514:	rts
	_a515:	ldy $08bd
	_a518:	lda $0894,y
	_a51b:	ldx #$01
	_a51d:	cmp #$54
	_a51f:	beq $a542
	_a521:	inx
	_a522:	cmp #$02
	_a524:	beq $a542
	_a526:	rts
	_a527:	lda #$00
	_a529:	sta $086a
	_a52c:	sta $086b
	_a52f:	stx $08b9
	_a532:	jsr $a209
	_a535:	lda #$74
	_a537:	sta $08ba
	_a53a:	lda #$0d
	_a53c:	sta $08bb
	_a53f:	jmp $a566
	_a542:	lda $bb29,x
	_a545:	pha
	_a546:	and #$07
	_a548:	sta $086b
	_a54b:	pla
	_a54c:	and #$38
	_a54e:	lsr acc
	_a54f:	lsr acc
	_a550:	lsr acc
	_a551:	sta $086a
	_a554:	lda #$00
	_a556:	sta $08b9
	_a559:	jsr $a209
	_a55c:	lda #$94
	_a55e:	sta $08ba
	_a561:	lda #$4d
	_a563:	sta $08bb
	_a566:	pla
	_a567:	pla
	_a568:	lda #$00
	_a56a:	sta $08c5
	_a56d:	sta $08c6
	_a570:	lda $08ec
	_a573:	jsr $bf17
	_a576:	ldx $09b8
	_a579:	jmp $9fa2
	_a57c:	lda #$00
	_a57e:	sta $08c7
	_a581:	inc $d020
	_a584:	lda $08c7
	_a587:	cmp #$a0
	_a589:	bcc $a581
	_a58b:	rts
	_a58c:	dat $04
	_a58d:	asl $03
	_a58f:	dat $04
	_a590:	dat $02
	_a591:	dat $02
	_a592:	dat $02
	_a593:	dat $02
	_a594:	ora ($01,x)
	_a596:	ora ($01,x)
	_a598:	ora ($01,x)
	_a59a:	ora ($01,x)
	_a59c:	ora ($01,x)
	_a59e:	ora ($e4,x)
	_a5a0:	inc $e8
	_a5a2:	nop
	_a5a3:	cpx $f0ee
	_a5a6:	dat $f2
	_a5a7:	sed
	_a5a8:	dat $f2
	_a5a9:	inc $0100,x
	_a5ac:	dat $02
	_a5ad:	dat $03
	_a5ae:	dat $04
	_a5af:	ora $06
	_a5b1:	dat $07
	_a5b2:	php
	_a5b3:	ora #$0a
	_a5b5:	brk
	_a5b6:	clc
	_a5b7:	bit $28
	_a5b9:	dat $9e
	_a5ba:	jsr $2020
	_a5bd:	jsr $4140
	_a5c0:	dat $42
	_a5c1:	dat $43
	_a5c2:	dat $44
	_a5c3:	jsr $2049
	_a5c6:	jsr $2020
	_a5c9:	jsr $2020
	_a5cc:	jsr $2020
	_a5cf:	jsr $4520
	_a5d2:	dat $44
	_a5d3:	lsr $47
	_a5d5:	dat $42
	_a5d6:	pha
	_a5d7:	jsr $ff49
	_a5da:	brk
	_a5db:	ora ($09,x)
	_a5dd:	ora #$07
	_a5df:	dat $0c
	_a5e0:	sta ($21,x)
	_a5e2:	and ($98,x)
	_a5e4:	tya
	_a5e5:	tya
	_a5e6:	tya
	_a5e7:	dat $02
	_a5e8:	dat $02
	_a5e9:	dat $02
	_a5ea:	dat $02
	_a5eb:	dat $02
	_a5ec:	dat $02
	_a5ed:	dat $02
	_a5ee:	ora $00
	_a5f0:	brk
	_a5f1:	brk
	_a5f2:	brk
	_a5f3:	dat $0f
	_a5f4:	dat $0f
	_a5f5:	ora ($01,x)
	_a5f7:	dat $0f
	_a5f8:	dat $0f
	_a5f9:	dat $0f
	_a5fa:	dat $0f
	_a5fb:	dat $0f
	_a5fc:	dat $0f
	_a5fd:	php
	_a5fe:	php
	_a5ff:	php
	_a600:	php
	_a601:	dat $02
	_a602:	dat $02
	_a603:	dat $02
	_a604:	dat $02
	_a605:	dat $02
	_a606:	dat $02
	_a607:	dat $02
	_a608:	dat $97
	_a609:	dat $97
	_a60a:	dat $97
	_a60b:	dat $97
	_a60c:	tya
	_a60d:	tya
	_a60e:	tya
	_a60f:	tya
	_a610:	tya
	_a611:	tya
	_a612:	dat $07
	_a613:	dat $07
	_a614:	dat $07
	_a615:	sta ($91),y
	_a617:	dat $9f
	_a618:	dat $0c
	_a619:	ora $05
	_a61b:	ora $05
	_a61d:	ora $05
	_a61f:	ora $07
	_a621:	brk
	_a622:	brk
	_a623:	dat $07
	_a624:	brk
	_a625:	brk
	_a626:	ora $03
	_a628:	txs
	_a629:	ora #$0a
	_a62b:	dat $07
	_a62c:	php
	_a62d:	ora #$02
	_a62f:	dat $02
	_a630:	tya
	_a631:	tya
	_a632:	sbc ($e1,x)
	_a634:	sbc ($e1,x)
	_a636:	adc ($61,x)
	_a638:	rts
	_a639:	rts
	_a63a:	rts
	_a63b:	rts
	_a63c:	bvs $a6ae
	_a63e:	sta ($91),y
	_a640:	bcc $a6a2
	_a642:	cpx #$70
	_a644:	bvs $a6ad
	_a646:	dat $67
	_a647:	dat $04
	_a648:	dat $04
	_a649:	ora #$09
	_a64b:	ora #$c1
	_a64d:	asl $7001,x
	_a650:	bvs $a643
	_a652:	sbc ($f1),y
	_a654:	dat $04
	_a655:	dat $04
	_a656:	adc $65
	_a658:	dat $93
	_a659:	ora ($01,x)
	_a65b:	eor $55,x
	_a65d:	dat $77
	_a65e:	dat $77
	_a65f:	jsr $0520
	_a662:	ora $05
	_a664:	dat $0c
	_a665:	asl acc
	_a666:	dat $0b
	_a667:	dat $0c
	_a668:	ora $1211
	_a66b:	dat $13
	_a66c:	dat $14
	_a66d:	ora $16,x
	_a66f:	clc
	_a670:	ora $1b1a,y
	_a673:	dat $1c
	_a674:	ora $1f1e,x
	_a677:	brk
	_a678:	ora ($02,x)
	_a67a:	ora ($20,x)

getinputs	_a67b:	jsr $a681	;scan keyboard&save matrix
	_a67e:	jmp $a6c6	;do some weird stuff and read joystick:)

	_a681:	lda #$07	;keyboard row counter=8-1
	_a683:	sta $0829
	_a686:	ldx #$2a	;keymatrix buffer
	_a688:	ldy #$08	;at 82a
	_a68a:	stx $a3	;->a3/a4
	_a68c:	sty $a4
	_a68e:	lda #$ff
	_a690:	clc
	_a691:	rol acc
	_a692:	tax
	_a693:	sta $dc00	;pokedc00,fe (read f-keys [+joy] only)
	_a696:	lda $dc01
	_a699:	ldy #$07	;for each of 8-1 columns
	_a69b:	lsr acc	;get switch state
	_a69c:	pha
	_a69d:	bcc $a6a2	;if closed...
	_a69f:	lda #$00	;else write 0
	_a6a1:	bit $01a9	;then write 1
	_a6a4:	sta ($a3),y	;into keyboard matrix
	_a6a6:	pla
	_a6a7:	dey
	_a6a8:	bpl $a69b	;next y
	_a6aa:	clc
	_a6ab:	lda $a3	;bufferpos+8
	_a6ad:	adc #$08
	_a6af:	sta $a3
	_a6b1:	lda $a4
	_a6b3:	adc #$00
	_a6b5:	sta $a4
	_a6b7:	dec $0829	;if rows left
	_a6ba:	lda $0829
	_a6bd:	bpl $a6c0	;then...
	_a6bf:	rts	;else done
	_a6c0:	txa	;...row mask
	_a6c1:	sec	;*2+1
	_a6c2:	rol acc
	_a6c3:	jmp $a692	;read next row

	_a6c6:	lda $083a	;"X"
	_a6c9:	sec
	_a6ca:	sbc $0835	;-"Z"
	_a6cd:	sta $0826	;=xaxis
	_a6d0:	lda $085a	;";"
	_a6d3:	sec
	_a6d4:	sbc $085f	;-"/"
	_a6d7:	sta $0827	;=yaxis
	_a6da:	lda $0865	;1-space
	_a6dd:	eor #$01
	_a6df:	sta $0824	;=button
	_a6e2:	lda $0830	;1-return
	_a6e5:	eor #$01
	_a6e7:	sta $0828	;=828(?)
	_a6ea:	lda $dc00	;read joyport2
	_a6ed:	ldy #$00
	_a6ef:	ldx #$00
	_a6f1:	lsr acc	;up?
	_a6f2:	bcs $a6f5
	_a6f4:	dey
	_a6f5:	lsr acc	;down?
	_a6f6:	bcs $a6f9
	_a6f8:	iny
	_a6f9:	lsr acc	;left?
	_a6fa:	bcs $a6fd
	_a6fc:	dex
	_a6fd:	lsr acc	;right
	_a6fe:	bcs $a701
	_a700:	inx
	_a701:	cpy #$00	;if yaxis
	_a703:	bne $a70f
	_a705:	cpx #$00	;or xaxis...
	_a707:	bne $a70f
	_a709:	and #$01	;else check fire:
	_a70b:	cmp #$00
	_a70d:	bne $a71a	;if not pressed then exit
	_a70f:	stx $0826	;...then save axisses
	_a712:	sty $0827
	_a715:	and #$01	;and button
	_a717:	sta $0824
	_a71a:	rts
;--- end inputs-------------------------------------
irq2	_a71b:	lda $d011	;used as irq during level start:
	_a71e:	bpl $a723	;if irq was on raster $b2
	_a720:	jmp $a7a1	;then...
	_a723:	and #$df	;else
	_a725:	ora #$80	;next irq on $100
	_a727:	sta $d011	;also keep bitmap mode etc
	_a72a:	lda #$00	;black bg for status bar
	_a72c:	sta $d021
	_a72f:	lda #$00
	_a731:	sta $09b7
	_a734:	sta $d012
	_a737:	lda $08ce	;if player weapon
	_a73a:	ora $08d0	;or something
	_a73d:	cmp #$ff	;<>none
	_a73f:	bne $a749	;then
	_a741:	lda #$ff	;else
	_a743:	sta $09e4	;spr6xpos=255
	_a746:	jmp $a7fe	;end irq

	_a749:	lda $d00c	;temp save sprite 6 pos
	_a74c:	sta $09e4	;to 9e4/e5
	_a74f:	lda $d00d
	_a752:	sta $09e5
	_a755:	lda $d010	;save spr6 xpos msb
	_a758:	and #$40
	_a75a:	sta $09e6
	_a75d:	lda $57fe	;save shape
	_a760:	sta $09e7
	_a763:	lda $d02d	;save color
	_a766:	sta $09e8
	_a769:	lda $d015	;save enable bitstate
	_a76c:	and #$40
	_a76e:	sta $09e9
	_a771:	lda #$b6	;weapon status-disp sprite
	_a773:	sta $d00d	;ypos=b6
	_a776:	lda $d010
	_a779:	ora #$40
	_a77b:	sta $d010	;xpos=118
	_a77e:	lda #$18
	_a780:	sta $d00c
	_a783:	ldy $08ce	;player weapon#
	_a786:	lda $a5aa,y	;idx from current arsenal table
	_a789:	tay
	_a78a:	lda $a594,y	;weapon color
	_a78d:	sta $d02d
	_a790:	lda $a59f,y	;basic spriteshape
	_a793:	sta $57fe
	_a796:	lda $d015	;enable weapon sprite
	_a799:	ora #$40	;(status bar?)
	_a79b:	sta $d015
	_a79e:	jmp $a7fe	;end irq

	_a7a1:	lda $08da	;...(irq @ $100) room bg color
	_a7a4:	sta $d021
	_a7a7:	lda #$b2	;next irq at raster $b2
	_a7a9:	sta $d012
	_a7ac:	lda $d011
	_a7af:	and #$7f
	_a7b1:	ora #$20
	_a7b3:	sta $d011
	_a7b6:	lda #$56	;vic-addresses for hires, charset, screenram
	_a7b8:	sta $d018
	_a7bb:	inc $08c7	;???
	_a7be:	lda #$01
	_a7c0:	sta $09b7	;???
	_a7c3:	lda $09e4	;if sprite6 temp x-pos
	_a7c6:	cmp #$ff	;=ff
	_a7c8:	beq $a7f8	;then shortcut to inputs
	_a7ca:	lda $09e4	;else write back:
	_a7cd:	sta $d00c	;xpos,
	_a7d0:	lda $09e5	;ypos,
	_a7d3:	sta $d00d
	_a7d6:	lda $d010	;x-msb,
	_a7d9:	and #$bf
	_a7db:	ora $09e6
	_a7de:	sta $d010
	_a7e1:	lda $09e7	;shape,
	_a7e4:	sta $57fe
	_a7e7:	lda $09e8	;color
	_a7ea:	sta $d02d
	_a7ed:	lda $d015	;enable bit
	_a7f0:	and #$bf
	_a7f2:	ora $09e9
	_a7f5:	sta $d015

	_a7f8:	jsr $a67b	;get inputs
	_a7fb:	jsr $bf9d
	_a7fe:	lda #$01	;ack irq
	_a800:	sta $d019
	_a803:	jmp $ea81	;exit
;---end irq2----------------------------------------------

	_a806:	sta $0822
	_a809:	lda $fd
	_a80b:	pha
	_a80c:	lda $fe
	_a80e:	pha
	_a80f:	tya
	_a810:	sta $bba8
	_a813:	clc
	_a814:	adc $fd
	_a816:	sta $fd
	_a818:	lda $fe
	_a81a:	adc #$00
	_a81c:	sta $fe
	_a81e:	lda $fd
	_a820:	asl acc
	_a821:	rol $fe
	_a823:	asl acc
	_a824:	rol $fe
	_a826:	asl acc
	_a827:	rol $fe
	_a829:	clc
	_a82a:	adc #$00
	_a82c:	sta $fd
	_a82e:	lda $fe
	_a830:	adc #$40
	_a832:	sta $fe
	_a834:	lda $0822
	_a837:	ldy $09df
	_a83a:	sty $a85b
	_a83d:	asl acc
	_a83e:	rol $a85b
	_a841:	asl acc
	_a842:	rol $a85b
	_a845:	asl acc
	_a846:	rol $a85b
	_a849:	clc
	_a84a:	adc #$80
	_a84c:	sta $a85a
	_a84f:	lda $a85b
	_a852:	adc #$11
	_a854:	sta $a85b
	_a857:	ldy #$07
	_a859:	lda $2000,y
	_a85c:	beq $a885
	_a85e:	sta $09de
	_a861:	and #$aa
	_a863:	sta $09dc
	_a866:	lsr acc
	_a867:	ora $09dc
	_a86a:	sta $09dd
	_a86d:	lda $09de
	_a870:	and #$55
	_a872:	sta $09dc
	_a875:	asl acc
	_a876:	ora $09dc
	_a879:	ora $09dd
	_a87c:	eor #$ff
	_a87e:	and ($fd),y
	_a880:	ora $09de
	_a883:	sta ($fd),y
	_a885:	dey
	_a886:	bpl $a859
	_a888:	lda $8c
	_a88a:	sec
	_a88b:	sbc #$84
	_a88d:	sta $fe
	_a88f:	lda $8b
	_a891:	sta $fd
	_a893:	ldy $bba8
	_a896:	lda $0872
	_a899:	lsr acc
	_a89a:	lsr acc
	_a89b:	lsr acc
	_a89c:	lsr acc
	_a89d:	sta $09dc
	_a8a0:	lda ($fd),y
	_a8a2:	and #$f0
	_a8a4:	ora $09dc
	_a8a7:	pha
	_a8a8:	lda $08b9
	_a8ab:	bne $a8b9
	_a8ad:	pla
	_a8ae:	lda $0872
	_a8b1:	and #$f0
	_a8b3:	ora $09dc
	_a8b6:	jmp $a8ba
	_a8b9:	pla
	_a8ba:	sta ($fd),y
	_a8bc:	pla
	_a8bd:	sta $fe
	_a8bf:	pla
	_a8c0:	sta $fd
	_a8c2:	lda #$02
	_a8c4:	sta $08c7
	_a8c7:	rts
	_a8c8:	jsr $aa3e
	_a8cb:	lda #$53
	_a8cd:	sta $fc
	_a8cf:	ldy #$00
	_a8d1:	sty $fb
	_a8d3:	lda #$aa
	_a8d5:	sta ($fb),y
	_a8d7:	dey
	_a8d8:	bne $a8d5
	_a8da:	dec $fc
	_a8dc:	lda $fc
	_a8de:	cmp #$40
	_a8e0:	bcs $a8d3
	_a8e2:	lda #$00
	_a8e4:	sta $bba8
	_a8e7:	lda #$56
	_a8e9:	sta $fc
	_a8eb:	lda #$00
	_a8ed:	sta $fb
	_a8ef:	lda $bba8
	_a8f2:	ldy #$00
	_a8f4:	sta ($fb),y
	_a8f6:	ldy #$7f
	_a8f8:	lda $bba8
	_a8fb:	sta ($fb),y
	_a8fd:	dey
	_a8fe:	bne $a8fb
	_a900:	dec $fc
	_a902:	lda $fc
	_a904:	cmp #$54
	_a906:	bcs $a8f8
	_a908:	rts
	_a909:	lda $08b9
	_a90c:	beq $a911
	_a90e:	jmp $a939
;------------------------------------------------
	_a911:	ldx #$10	;blank part of the bitmap?
	_a913:	lda #$40
	_a915:	sta $fc
	_a917:	lda #$0b	;poke 8da,b?
	_a919:	sta $08da	;room bg color
	_a91c:	lda #$20	;$4020->fb/fc
	_a91e:	sta $fb

	_a920:	lda #$00
	_a922:	tay
	_a923:	sta ($fb),y	;fill with 0s
	_a925:	dey
	_a926:	bne $a923	;if bytes left on page
	_a928:	lda $fb	;fb/fc+64
	_a92a:	clc
	_a92b:	adc #$40
	_a92d:	sta $fb
	_a92f:	lda $fc
	_a931:	adc #$01
	_a933:	sta $fc
	_a935:	dex	;16 times = $4020-4420. WTF?
	_a936:	bne $a920
	_a938:	rts
;--- end strange routine
	_a939:	lda #$00
	_a93b:	clc
	_a93c:	adc #$20
	_a93e:	sta $fb
	_a940:	lda #$40
	_a942:	adc #$00
	_a944:	sta $fc
	_a946:	lda #$00
	_a948:	sta $fd
	_a94a:	lda #$04
	_a94c:	sta $fe
	_a94e:	lda #$10
	_a950:	sta $08d9
	_a953:	ldy #$00
	_a955:	tya
	_a956:	pha
	_a957:	ldy #$00
	_a959:	lda ($fd),y
	_a95b:	asl acc
	_a95c:	asl acc
	_a95d:	asl acc
	_a95e:	tax
	_a95f:	pla
	_a960:	tay
	_a961:	bcc $a971
	_a963:	lda $0700,x
	_a966:	sta ($fb),y
	_a968:	inx
	_a969:	iny
	_a96a:	txa
	_a96b:	and #$07
	_a96d:	bne $a963
	_a96f:	beq $a97d
	_a971:	lda $0600,x
	_a974:	sta ($fb),y
	_a976:	inx
	_a977:	iny
	_a978:	txa
	_a979:	and #$07
	_a97b:	bne $a971
	_a97d:	inc $fd
	_a97f:	bne $a983
	_a981:	inc $fe
	_a983:	cpy #$00
	_a985:	bne $a955
	_a987:	lda $fb
	_a989:	clc
	_a98a:	adc #$40
	_a98c:	sta $fb
	_a98e:	lda $fc
	_a990:	adc #$01
	_a992:	sta $fc
	_a994:	dec $08d9
	_a997:	bne $a953
	_a999:	lda $086c
	_a99c:	sec
	_a99d:	sbc #$18
	_a99f:	asl acc
	_a9a0:	tay
	_a9a1:	lda $aa5e,y
	_a9a4:	pha
	_a9a5:	lsr acc
	_a9a6:	lsr acc
	_a9a7:	lsr acc
	_a9a8:	lsr acc
	_a9a9:	sta $08da	;room bg color
	_a9ac:	pla
	_a9ad:	asl acc
	_a9ae:	asl acc
	_a9af:	asl acc
	_a9b0:	asl acc
	_a9b1:	sta $aa5a
	_a9b4:	lda $aa5f,y
	_a9b7:	pha
	_a9b8:	and #$f0
	_a9ba:	sta $aa5b
	_a9bd:	pla
	_a9be:	asl acc
	_a9bf:	asl acc
	_a9c0:	asl acc
	_a9c1:	asl acc
	_a9c2:	sta $aa5c
	_a9c5:	lda #$00
	_a9c7:	sta $fb
	_a9c9:	lda #$04
	_a9cb:	sta $fc
	_a9cd:	lda #$54
	_a9cf:	sta $fe
	_a9d1:	lda #$04
	_a9d3:	sta $fd
	_a9d5:	lda #$10
	_a9d7:	sta $08d9
	_a9da:	ldy #$1f
	_a9dc:	lda ($fb),y
	_a9de:	asl acc
	_a9df:	rol acc
	_a9e0:	rol acc
	_a9e1:	and #$03
	_a9e3:	tax
	_a9e4:	lda $aa5a,x
	_a9e7:	sta ($fd),y
	_a9e9:	dey
	_a9ea:	bpl $a9dc
	_a9ec:	lda $fb
	_a9ee:	clc
	_a9ef:	adc #$20
	_a9f1:	sta $fb
	_a9f3:	lda $fc
	_a9f5:	adc #$00
	_a9f7:	sta $fc
	_a9f9:	lda $fd
	_a9fb:	clc
	_a9fc:	adc #$28
	_a9fe:	sta $fd
	_aa00:	lda $fe
	_aa02:	adc #$00
	_aa04:	sta $fe
	_aa06:	dec $08d9
	_aa09:	bne $a9da
	_aa0b:	jsr $c213
	_aa0e:	rts
;--------------------------------------------------
copychars	_aa0f:	sei	;copy charset to $4000-47ff
	_aa10:	lda $01	;the chars are used for the texts
	_aa12:	and #$fb	;between levels
	_aa14:	sta $01	;bank in charrom
	_aa16:	lda #$d7	;from $d700-d000
	_aa18:	sta $fc
	_aa1a:	lda #$47	;to $4700-4000
	_aa1c:	sta $fe
	_aa1e:	lda #$00
	_aa20:	sta $fb
	_aa22:	sta $fd
	_aa24:	tay
	_aa25:	lda ($fb),y	;copy page
	_aa27:	sta ($fd),y
	_aa29:	dey
	_aa2a:	bne $aa25
	_aa2c:	dec $fc	;src/tgt--
	_aa2e:	dec $fe
	_aa30:	lda $fe
	_aa32:	cmp #$40	;if tgt still >=$4000
	_aa34:	bcs $aa25
	_aa36:	lda $01	;else bank in I/O
	_aa38:	ora #$04
	_aa3a:	sta $01
	_aa3c:	cli
	_aa3d:	rts
;----end copychars
	_aa3e:	lda #$60
	_aa40:	sta $fb
	_aa42:	lda #$e8
	_aa44:	sta $fd
	_aa46:	lda #$32
	_aa48:	sta $fc
	_aa4a:	lda #$59
	_aa4c:	sta $fe
	_aa4e:	ldy #$ef
	_aa50:	lda ($fb),y
	_aa52:	sta ($fd),y
	_aa54:	dey
	_aa55:	cpy #$ff
	_aa57:	bne $aa50
	_aa59:	rts
	_aa5a:	rti
	_aa5b:	rts
	_aa5c:	bvs $aa5e
	_aa5e:	dat $04
	_aa5f:	ldy $be,x
	_aa61:	dat $53
	_aa62:	dat $53
	_aa63:	eor $6c,x
	_aa65:	ldx $08,y
	_aa67:	txs
	_aa68:	dat $4f
	_aa69:	cpy $be
	_aa6b:	dat $64
	_aa6c:	dat $0c
	_aa6d:	dat $bf
	_aa6e:	ldx $ba65,y
	_aa71:	sta $d5
	_aa73:	adc $9ee8
	_aa76:	dat $bf
	_aa77:	dat $cb
	_aa78:	dat $bf
	_aa79:	dat $cb
	_aa7a:	dat $bf
	_aa7b:	dat $cb
	_aa7c:	dat $bf
	_aa7d:	dat $cb
	_aa7e:	clv
	_aa7f:	dat $9b
	_aa80:	ldx $b66b,y
	_aa83:	dat $5b
	_aa84:	clv
	_aa85:	dat $9b
	_aa86:	lda #$00
	_aa88:	sta $aeb4
	_aa8b:	jmp $aa93
	_aa8e:	lda #$01
	_aa90:	sta $aeb4
	_aa93:	lda $08b4
	_aa96:	asl acc
	_aa97:	asl acc
	_aa98:	clc
	_aa99:	adc $08ba
	_aa9c:	sta $08ba
	_aa9f:	lda $08b6
	_aaa2:	sta $aeb6
	_aaa5:	asl acc
	_aaa6:	clc
	_aaa7:	adc $08bb
	_aaaa:	sta $08bb
	_aaad:	lda $08ba
	_aab0:	sec
	_aab1:	sbc #$74
	_aab3:	bcs $aaba
	_aab5:	eor #$ff
	_aab7:	clc
	_aab8:	adc #$01
	_aaba:	sta $bba8
	_aabd:	lda $08bb
	_aac0:	cmp #$0a
	_aac2:	bcs $aadb
	_aac4:	jsr $abf6
	_aac7:	lda #$0b
	_aac9:	sta $08bb
	_aacc:	ldy $0991
	_aacf:	ldx #$0f
	_aad1:	lda $08e2,y
	_aad4:	and #$03
	_aad6:	beq $ab12
	_aad8:	jmp $ab17
	_aadb:	ldx #$0f
	_aadd:	lda #$12
	_aadf:	cmp $08bb
	_aae2:	bcs $ab12
	_aae4:	adc #$06
	_aae6:	dex
	_aae7:	bpl $aadf
	_aae9:	jsr $abf6
	_aaec:	ldx #$00
	_aaee:	lda #$6b
	_aaf0:	sta $08bb
	_aaf3:	ldy $0991
	_aaf6:	lda $08e2,y
	_aaf9:	pha
	_aafa:	asl acc
	_aafb:	rol acc
	_aafc:	rol acc
	_aafd:	and #$03
	_aaff:	asl acc
	_ab00:	tay
	_ab01:	lda $a58d,y
	_ab04:	sec
	_ab05:	sbc #$01
	_ab07:	sta $09e0
	_ab0a:	pla
	_ab0b:	and #$03
	_ab0d:	cmp $09e0
	_ab10:	bne $ab17
	_ab12:	lda #$00
	_ab14:	sta $08b6
	_ab17:	lda $aeb7,x
	_ab1a:	stx $aeb5
	_ab1d:	cmp $bba8
	_ab20:	bcc $ab25
	_ab22:	jmp $abb9
	_ab25:	jsr $acb0
	_ab28:	lda $08bb
	_ab2b:	cmp #$2a
	_ab2d:	bcs $ab80
	_ab2f:	cmp #$1f
	_ab31:	bcc $ab80
	_ab33:	ldy $0991
	_ab36:	lda $08e2,y
	_ab39:	sta $09e1
	_ab3c:	and #$38
	_ab3e:	bne $ab4a
	_ab40:	lda $08ba
	_ab43:	cmp #$74
	_ab45:	bcs $ab6c
	_ab47:	jmp $ab80
	_ab4a:	lsr acc
	_ab4b:	lsr acc
	_ab4c:	lsr acc
	_ab4d:	sta $09e0
	_ab50:	lda $09e1
	_ab53:	asl acc
	_ab54:	rol acc
	_ab55:	rol acc
	_ab56:	and #$03
	_ab58:	asl acc
	_ab59:	tay
	_ab5a:	lda $a58c,y
	_ab5d:	sec
	_ab5e:	sbc #$01
	_ab60:	cmp $09e0
	_ab63:	bne $ab6c
	_ab65:	lda $08ba
	_ab68:	cmp #$74
	_ab6a:	bcs $ab80
	_ab6c:	lda $08b4
	_ab6f:	eor #$ff
	_ab71:	clc
	_ab72:	adc #$01
	_ab74:	asl acc
	_ab75:	asl acc
	_ab76:	clc
	_ab77:	adc $08ba
	_ab7a:	sta $08ba
	_ab7d:	jmp $abbe
	_ab80:	lda $08ba
	_ab83:	cmp #$74
	_ab85:	bcc $ab97
	_ab87:	cmp #$fa
	_ab89:	bcs $ab97
	_ab8b:	lda #$74
	_ab8d:	clc
	_ab8e:	adc $aeb7,x
	_ab91:	sta $08ba
	_ab94:	jmp $aba0
	_ab97:	lda #$74
	_ab99:	sec
	_ab9a:	sbc $aeb7,x
	_ab9d:	sta $08ba
	_aba0:	lda $aeb4
	_aba3:	beq $abb9
	_aba5:	ldx $0991
	_aba8:	lda $0965,x
	_abab:	bmi $abb9
	_abad:	and #$01
	_abaf:	beq $abb9
	_abb1:	lda $0965,x
	_abb4:	eor #$02
	_abb6:	sta $0965,x
	_abb9:	lda #$00
	_abbb:	sta $08b4
	_abbe:	lda $aeb6
	_abc1:	sta $08b7
	_abc4:	rts
	_abc5:	lda $08b4
	_abc8:	beq $abe8
	_abca:	lda $08ba
	_abcd:	ldx $aeb5
	_abd0:	cmp #$74
	_abd2:	bcc $abde
	_abd4:	lda #$74
	_abd6:	sec
	_abd7:	sbc $aeb7,x
	_abda:	sta $08ba
	_abdd:	rts
	_abde:	lda #$74
	_abe0:	clc
	_abe1:	adc $aeb7,x
	_abe4:	sta $08ba
	_abe7:	rts
	_abe8:	lda $08b6
	_abeb:	beq $abf5
	_abed:	lda $08bb
	_abf0:	eor #$60
	_abf2:	sta $08bb
	_abf5:	rts
	_abf6:	jsr $ac72
	_abf9:	lda $aeb4
	_abfc:	bne $abff
	_abfe:	rts
	_abff:	lda $08ba
	_ac02:	cmp #$74
	_ac04:	bcc $ac3c
	_ac06:	lda $08b5
	_ac09:	beq $ac24
	_ac0b:	cmp #$ff
	_ac0d:	beq $ac36
	_ac0f:	lda $08ba
	_ac12:	sec
	_ac13:	sbc #$08
	_ac15:	sta $08ba
	_ac18:	lda $bba8
	_ac1b:	sec
	_ac1c:	sbc #$08
	_ac1e:	sta $bba8
	_ac21:	jmp $ac36
	_ac24:	lda $08ba
	_ac27:	sec
	_ac28:	sbc #$04
	_ac2a:	sta $08ba
	_ac2d:	lda $bba8
	_ac30:	sec
	_ac31:	sbc #$04
	_ac33:	sta $bba8
	_ac36:	lda #$00
	_ac38:	sta $aedf
	_ac3b:	rts
	_ac3c:	lda $08b5
	_ac3f:	beq $ac5a
	_ac41:	cmp #$01
	_ac43:	beq $ac6c
	_ac45:	lda $08ba
	_ac48:	clc
	_ac49:	adc #$08
	_ac4b:	sta $08ba
	_ac4e:	lda $bba8
	_ac51:	sec
	_ac52:	sbc #$08
	_ac54:	sta $bba8
	_ac57:	jmp $ac6c
	_ac5a:	lda $08ba
	_ac5d:	clc
	_ac5e:	adc #$04
	_ac60:	sta $08ba
	_ac63:	lda $bba8
	_ac66:	sec
	_ac67:	sbc #$04
	_ac69:	sta $bba8
	_ac6c:	lda #$05
	_ac6e:	sta $aedf
	_ac71:	rts
	_ac72:	lda $08ba
	_ac75:	cmp #$6c
	_ac77:	bcc $aca0
	_ac79:	cmp #$7c
	_ac7b:	bcs $aca0
	_ac7d:	lda $aeb4
	_ac80:	bne $ac96
	_ac82:	lda $086a
	_ac85:	ora $086b
	_ac88:	bne $ac9f
	_ac8a:	lda $08bb
	_ac8d:	cmp #$0b
	_ac8f:	bcs $ac9f
	_ac91:	lda #$00
	_ac93:	sta $08b6
	_ac96:	lda #$00
	_ac98:	sta $08b4
	_ac9b:	pla
	_ac9c:	pla
	_ac9d:	pla
	_ac9e:	pla
	_ac9f:	rts
	_aca0:	lda #$00
	_aca2:	sta $08b6
	_aca5:	lda $aeb4
	_aca8:	beq $acaf
	_acaa:	lda #$00
	_acac:	sta $aeb6
	_acaf:	rts
	_acb0:	lda $aeb4
	_acb3:	bne $acb6
	_acb5:	rts
	_acb6:	lda $08b4
	_acb9:	bne $acbe
	_acbb:	jmp $abff
	_acbe:	lda $08bb
	_acc1:	cmp #$27
	_acc3:	bcc $ace2
	_acc5:	lda $08b7
	_acc8:	beq $acd8
	_acca:	cmp #$ff
	_accc:	beq $ace1
	_acce:	lda $08bb
	_acd1:	sec
	_acd2:	sbc #$04
	_acd4:	sta $08bb
	_acd7:	rts
	_acd8:	lda $08bb
	_acdb:	sec
	_acdc:	sbc #$02
	_acde:	sta $08bb
	_ace1:	rts
	_ace2:	lda $08b7
	_ace5:	beq $acec
	_ace7:	cmp #$01
	_ace9:	beq $acf5
	_aceb:	rts
	_acec:	lda $08bb
	_acef:	clc
	_acf0:	adc #$02
	_acf2:	sta $08bb
	_acf5:	rts
	_acf6:	lda $099a
	_acf9:	beq $acfc
	_acfb:	rts
	_acfc:	jsr $ad1c
	_acff:	lda $099a
	_ad02:	bne $ad17
	_ad04:	ldx $0991
	_ad07:	lda $0965,x
	_ad0a:	and #$01
	_ad0c:	bne $ad16
	_ad0e:	lda #$ff
	_ad10:	sta $0965,x
	_ad13:	jmp $ae32
	_ad16:	rts
	_ad17:	pla
	_ad18:	pla
	_ad19:	jmp $9fbc
	_ad1c:	lda #$00
	_ad1e:	sta $099a
	_ad21:	lda #$03
	_ad23:	sta $09e0
	_ad26:	ldy $09e0
	_ad29:	ldx #$0e
	_ad2b:	lda $08bd,y
	_ad2e:	cmp #$20
	_ad30:	bcs $ad3e
	_ad32:	tay
	_ad33:	lda $0894,y
	_ad36:	cmp $aec7,x
	_ad39:	beq $ad44
	_ad3b:	dex
	_ad3c:	bpl $ad36
	_ad3e:	dec $09e0
	_ad41:	bpl $ad26
	_ad43:	rts
	_ad44:	lda $09e0
	_ad47:	and #$01
	_ad49:	sta $09e1
	_ad4c:	txa
	_ad4d:	and #$01
	_ad4f:	bne $ad5f
	_ad51:	lda $09e1
	_ad54:	bne $ad6d
	_ad56:	lda $08bd
	_ad59:	cmp $08be
	_ad5c:	beq $ad6d
	_ad5e:	rts
	_ad5f:	lda $09e1
	_ad62:	beq $ad6d
	_ad64:	lda $08bd
	_ad67:	cmp $08be
	_ad6a:	beq $ad6d
	_ad6c:	rts
	_ad6d:	lda $09e0
	_ad70:	eor #$02
	_ad72:	tay
	_ad73:	lda $08bd,y
	_ad76:	cmp #$20
	_ad78:	bcs $adc0
	_ad7a:	tay
	_ad7b:	lda $0894,y
	_ad7e:	bne $adc0
	_ad80:	lda $08bb
	_ad83:	and #$1f
	_ad85:	sta $09ea
	_ad88:	lda $09e0
	_ad8b:	and #$02
	_ad8d:	bne $ad9f
	_ad8f:	lda $09ea
	_ad92:	cmp #$0d
	_ad94:	bne $ad6c
	_ad96:	lda $08b7
	_ad99:	cmp #$ff
	_ad9b:	beq $adad
	_ad9d:	bne $adc0
	_ad9f:	lda $09ea
	_ada2:	cmp #$0d
	_ada4:	bne $adc0
	_ada6:	lda $08b7
	_ada9:	cmp #$01
	_adab:	bne $adc0
	_adad:	lda $08b7
	_adb0:	eor #$ff
	_adb2:	clc
	_adb3:	adc #$01
	_adb5:	asl acc
	_adb6:	clc
	_adb7:	adc $08bb
	_adba:	sta $08bb
	_adbd:	jmp $ae41
	_adc0:	cpx #$06
	_adc2:	bcs $adce
	_adc4:	lda $08bb
	_adc7:	and #$1f
	_adc9:	cmp #$0b
	_adcb:	bcs $ade0
	_adcd:	rts
	_adce:	cpx #$0a
	_add0:	bcs $ade0
	_add2:	cpx #$06
	_add4:	bcc $ade0
	_add6:	lda $08bb
	_add9:	and #$1f
	_addb:	cmp #$0b
	_addd:	bcc $ade0
	_addf:	rts
	_ade0:	lda $08b5
	_ade3:	eor #$ff
	_ade5:	clc
	_ade6:	adc #$01
	_ade8:	asl acc
	_ade9:	asl acc
	_adea:	clc
	_adeb:	adc $08ba
	_adee:	sta $08ba
	_adf1:	ldx $0991
	_adf4:	lda $0965,x
	_adf7:	cmp #$ff
	_adf9:	beq $ae16
	_adfb:	and #$01
	_adfd:	beq $ae08
	_adff:	lda $0965,x
	_ae02:	eor #$02
	_ae04:	sta $0965,x
	_ae07:	rts
	_ae08:	lda $0965,x
	_ae0b:	asl acc
	_ae0c:	tax
	_ae0d:	lda $bb36,x
	_ae10:	sta $099a
	_ae13:	jmp $ae32
	_ae16:	lda $08b7
	_ae19:	cmp #$ff
	_ae1b:	bne $ae28
	_ae1d:	sta $099a
	_ae20:	lda #$00
	_ae22:	sta $0965,x
	_ae25:	jmp $ae32
	_ae28:	lda #$01
	_ae2a:	sta $099a
	_ae2d:	lda #$02
	_ae2f:	sta $0965,x
	_ae32:	lda $08b5
	_ae35:	beq $ae3b
	_ae37:	sta $0999
	_ae3a:	rts
	_ae3b:	lda #$01
	_ae3d:	sta $0999
	_ae40:	rts
	_ae41:	ldx $0991
	_ae44:	lda $0965,x
	_ae47:	cmp #$ff
	_ae49:	beq $ae66
	_ae4b:	and #$01
	_ae4d:	bne $ae58
	_ae4f:	lda $0965,x
	_ae52:	eor #$02
	_ae54:	sta $0965,x
	_ae57:	rts
	_ae58:	lda $0965,x
	_ae5b:	asl acc
	_ae5c:	tax
	_ae5d:	lda $bb35,x
	_ae60:	sta $0999
	_ae63:	jmp $ae80
	_ae66:	lda $08b5
	_ae69:	cmp #$ff
	_ae6b:	bne $ae78
	_ae6d:	sta $0999
	_ae70:	lda #$03
	_ae72:	sta $0965,x
	_ae75:	jmp $ae80
	_ae78:	lda #$01
	_ae7a:	sta $0999
	_ae7d:	sta $0965,x
	_ae80:	lda $08b7
	_ae83:	beq $ae89
	_ae85:	sta $099a
	_ae88:	rts
	_ae89:	lda #$01
	_ae8b:	sta $099a
	_ae8e:	rts
	_ae8f:	ldy #$04
	_ae91:	cmp $aeaf,y
	_ae94:	beq $aeab
	_ae96:	dey
	_ae97:	bpl $ae91
	_ae99:	cmp #$19
	_ae9b:	bcs $aea1
	_ae9d:	lda #$00
	_ae9f:	clc
	_aea0:	rts
	_aea1:	cmp #$38
	_aea3:	bcc $aea7
	_aea5:	clc
	_aea6:	rts
	_aea7:	lda #$01
	_aea9:	sec
	_aeaa:	rts
	_aeab:	lda #$00
	_aead:	sec
	_aeae:	rts
	_aeaf:	dat $0f
	_aeb0:	dat $12
	_aeb1:	ora $17,x
	_aeb3:	eor $00
	_aeb5:	brk
	_aeb6:	brk
	_aeb7:	dat $74
	_aeb8:	bvs $af26
	_aeba:	pla
	_aebb:	dat $64
	_aebc:	rts
	_aebd:	dat $5c
	_aebe:	cli
	_aebf:	dat $54
	_aec0:	bvc $af0e
	_aec2:	pha
	_aec3:	dat $44
	_aec4:	rti
	_aec5:	dat $3c
	_aec6:	sec
	_aec7:	bpl $aedc
	_aec9:	asl $18,x
	_aecb:	dat $44
	_aecc:	dat $ff
	_aecd:	asl $4811
	_aed0:	dat $47
	_aed1:	dat $0f
	_aed2:	dat $12
	_aed3:	ora $17,x
	_aed5:	eor $6d
	_aed7:	dey
	_aed8:	ldx $a3,y
	_aeda:	cmp #$77
	_aedc:	dat $92
	_aedd:	cpy #$ad
	_aedf:	brk
	_aee0:	ldx #$09
	_aee2:	lda #$54
	_aee4:	sta $08ed,x
	_aee7:	lda #$09
	_aee9:	sta $0923,x
	_aeec:	lda #$31
	_aeee:	sta $08f8,x
	_aef1:	lda #$04
	_aef3:	sta $090e,x	;camper status flag
	_aef6:	lda $bb79,x
	_aef9:	sta $08e2,x
	_aefc:	sta $0903,x
	_aeff:	lda #$41
	_af01:	jsr $b4a7	;calc random value
	_af04:	clc
	_af05:	adc #$0a
	_af07:	sta $092e,x	;some camper value
	_af0a:	lda #$28
	_af0c:	jsr $b4a7	;calc random value
	_af0f:	clc
	_af10:	adc #$14
	_af12:	sta $0939,x
	_af15:	lda #$00
	_af17:	sta $0970,x
	_af1a:	sta $0944,x
	_af1d:	sta $094f,x
	_af20:	sta $095a,x
	_af23:	lda #$ff
	_af25:	sta $0965,x
	_af28:	dex
	_af29:	bpl $aee2
	_af2b:	ldx #$3f
	_af2d:	lda #$ff
	_af2f:	sta $02c0,x
	_af32:	dex
	_af33:	bpl $af2f
	_af35:	ldx #$06
	_af37:	lda #$0b
	_af39:	sta $57f9,x
	_af3c:	dex
	_af3d:	bpl $af37
	_af3f:	lda #$00
	_af41:	sta $099d
	_af44:	lda #$3c
	_af46:	sta $092f
	_af49:	ldx #$03
	_af4b:	lda #$ff
	_af4d:	sta $099f,x
	_af50:	dex
	_af51:	bpl $af4d
	_af53:	ldx #$09
	_af55:	lda #$02
	_af57:	sta $08b8
	_af5a:	inc $099d
	_af5d:	inc $08cb
	_af60:	lda $08cb
	_af63:	cmp #$04
	_af65:	bcc $af6c
	_af67:	lda #$00
	_af69:	sta $08cb
	_af6c:	lda $099d
	_af6f:	cmp #$05
	_af71:	bcc $af7b
	_af73:	lda #$00
	_af75:	sta $099d
	_af78:	sta $d020
	_af7b:	stx $0991
	_af7e:	lda #$a0
	_af80:	sta $09e3
	_af83:	lda #$31
	_af85:	sta $09e2
	_af88:	lda $090e,x	;camper status flag
	_af8b:	cmp #$05
	_af8d:	bne $afb0
	_af8f:	lda $08d5
	_af92:	and #$0f
	_af94:	bne $afb0
	_af96:	lda #$01
	_af98:	jsr $c404
	_af9b:	dec $095a,x
	_af9e:	bne $afb0
	_afa0:	lda $bb79,x
	_afa3:	sta $0903,x
	_afa6:	lda #$04
	_afa8:	sta $090e,x	;camper status flag
	_afab:	lda #$09
	_afad:	sta $0923,x
	_afb0:	lda $0903,x
	_afb3:	sta $08d7
	_afb6:	sta $08d8
	_afb9:	lda $090e,x	;camper status flag
	_afbc:	cmp #$04
	_afbe:	bcs $afc8
	_afc0:	cmp #$03
	_afc2:	bcc $afc8
	_afc4:	dex
	_afc5:	bpl $af7b
	_afc7:	rts
	_afc8:	lda $090e,x	;camper status flag
	_afcb:	cmp #$08
	_afcd:	bcs $afd3
	_afcf:	cmp #$04
	_afd1:	bcs $afdb
	_afd3:	ldy #$00
	_afd5:	sty $0995
	_afd8:	jmp $b179
	_afdb:	lda $08e2,x
	_afde:	and #$c0
	_afe0:	sta $0822
	_afe3:	lda $0903,x
	_afe6:	and #$c0
	_afe8:	cmp $0822
	_afeb:	beq $b014
	_afed:	lda $0822
	_aff0:	asl acc
	_aff1:	rol acc
	_aff2:	rol acc
	_aff3:	tay
	_aff4:	lda $bb29,y
	_aff7:	sta $08d8
	_affa:	ldy $0822
	_affd:	cpy #$00
	_afff:	bne $b011
	_b001:	lda $0903,x
	_b004:	and #$c0
	_b006:	sta $08d8
	_b009:	asl acc
	_b00a:	rol acc
	_b00b:	rol acc
	_b00c:	tay
	_b00d:	lda $bb29,y
	_b010:	tay
	_b011:	sty $08d7
	_b014:	lda $08e2,x
	_b017:	cmp $08d7
	_b01a:	beq $b09a
	_b01c:	ldy $094f,x
	_b01f:	bne $b058
	_b021:	lda $08e2,x
	_b024:	and #$07
	_b026:	sta $0994
	_b029:	lda $08d7
	_b02c:	and #$07
	_b02e:	ldy #$00
	_b030:	sec
	_b031:	sbc $0994
	_b034:	beq $b058
	_b036:	bmi $b03b
	_b038:	iny
	_b039:	bne $b03c
	_b03b:	dey
	_b03c:	sta $0822
	_b03f:	lda $08e2,x
	_b042:	and #$c0
	_b044:	bne $b058
	_b046:	lda $0822
	_b049:	cmp #$04
	_b04b:	bcc $b058
	_b04d:	cmp #$fc
	_b04f:	bcs $b058
	_b051:	tya
	_b052:	eor #$ff
	_b054:	clc
	_b055:	adc #$01
	_b057:	tay
	_b058:	sty $0995
	_b05b:	ldy #$00
	_b05d:	lda $0944,x
	_b060:	bne $b097
	_b062:	lda $08e2,x
	_b065:	and #$38
	_b067:	sta $0994
	_b06a:	lda $08d7
	_b06d:	and #$38
	_b06f:	sec
	_b070:	sbc $0994
	_b073:	beq $b097
	_b075:	bmi $b07a
	_b077:	iny
	_b078:	bne $b07b
	_b07a:	dey
	_b07b:	sta $0822
	_b07e:	lda $08e2,x
	_b081:	and #$c0
	_b083:	bne $b097
	_b085:	lda $0822
	_b088:	cmp #$10
	_b08a:	bcc $b097
	_b08c:	cmp #$f0
	_b08e:	bcs $b097
	_b090:	tya
	_b091:	eor #$ff
	_b093:	clc
	_b094:	adc #$01
	_b096:	tay
	_b097:	jmp $b179
	_b09a:	lda $08e2,x
	_b09d:	cmp $0903,x
	_b0a0:	bne $b0b1
	_b0a2:	lda $090e,x	;camper status flag
	_b0a5:	cmp #$05
	_b0a7:	bne $b0b1
	_b0a9:	ldy #$00
	_b0ab:	sty $0995
	_b0ae:	jmp $b179
	_b0b1:	lda $08e2,x
	_b0b4:	ldy #$00
	_b0b6:	cmp $0903,x
	_b0b9:	bne $b0dc
	_b0bb:	ldy $094f,x
	_b0be:	bne $b126
	_b0c0:	lda $090e,x	;camper status flag
	_b0c3:	cmp #$07
	_b0c5:	bne $b10d
	_b0c7:	ldy $0993
	_b0ca:	lda $08f8,y
	_b0cd:	sta $0822
	_b0d0:	ldy #$00
	_b0d2:	lda $08f8,x
	_b0d5:	sec
	_b0d6:	sbc $0822
	_b0d9:	jmp $b11e
	_b0dc:	lda $08e2,x
	_b0df:	and #$c0
	_b0e1:	sta $0822
	_b0e4:	lda $0903,x
	_b0e7:	and #$c0
	_b0e9:	cmp $0822
	_b0ec:	beq $b10d
	_b0ee:	lda $0822
	_b0f1:	beq $b100
	_b0f3:	lda #$0d
	_b0f5:	sta $09e2
	_b0f8:	lda #$74
	_b0fa:	sta $09e3
	_b0fd:	jmp $b117
	_b100:	lda #$4d
	_b102:	sta $09e2
	_b105:	lda #$94
	_b107:	sta $09e3
	_b10a:	jmp $b117
	_b10d:	lda #$31
	_b10f:	sta $09e2
	_b112:	lda #$a0
	_b114:	sta $09e3
	_b117:	lda $08f8,x
	_b11a:	sec
	_b11b:	sbc $09e2
	_b11e:	beq $b126
	_b120:	bcs $b125
	_b122:	iny
	_b123:	bne $b126
	_b125:	dey
	_b126:	sty $0995
	_b129:	ldy #$00
	_b12b:	lda $0944,x
	_b12e:	bne $b179
	_b130:	lda $08e2,x
	_b133:	cmp $0903,x
	_b136:	bne $b16a
	_b138:	lda $090e,x	;camper status flag
	_b13b:	cmp #$07
	_b13d:	bne $b16a
	_b13f:	lda $09d2
	_b142:	beq $b14c
	_b144:	ldy #$00
	_b146:	sty $0995
	_b149:	jmp $b179
	_b14c:	ldy $0993
	_b14f:	lda $08ed,y
	_b152:	clc
	_b153:	adc #$0c
	_b155:	cmp #$80
	_b157:	bcc $b15b
	_b159:	sbc #$18
	_b15b:	sta $0822
	_b15e:	ldy #$00
	_b160:	lda $08ed,x
	_b163:	sec
	_b164:	sbc $0822
	_b167:	jmp $b171
	_b16a:	lda $08ed,x
	_b16d:	sec
	_b16e:	sbc $09e3
	_b171:	beq $b179
	_b173:	bcs $b178
	_b175:	iny
	_b176:	bne $b179
	_b178:	dey
	_b179:	tya
	_b17a:	ora $0944,x
	_b17d:	cmp #$00
	_b17f:	beq $b18d
	_b181:	ldy #$00
	_b183:	cmp #$ff
	_b185:	beq $b18d
	_b187:	ldy #$05
	_b189:	cmp #$01
	_b18b:	bne $b190
	_b18d:	sty $aedf
	_b190:	pha
	_b191:	lda $090e,x	;camper status flag
	_b194:	and #$c0
	_b196:	bne $b19b
	_b198:	sta $0970,x
	_b19b:	pla
	_b19c:	ldy $0995
	_b19f:	sta $08b4
	_b1a2:	sty $08b6
	_b1a5:	sta $08b5
	_b1a8:	sty $08b7
	_b1ab:	sta $099b
	_b1ae:	sty $099c
	_b1b1:	lda $08e2,x
	_b1b4:	and #$c0
	_b1b6:	beq $b1e5
	_b1b8:	lda $08ed,x
	_b1bb:	sta $08ba
	_b1be:	lda $08f8,x
	_b1c1:	sta $08bb
	_b1c4:	jsr $aa8e
	_b1c7:	ldx $0991
	_b1ca:	lda $08ba
	_b1cd:	sta $08ed,x
	_b1d0:	lda $08bb
	_b1d3:	sta $08f8,x
	_b1d6:	lda $08b4
	_b1d9:	sta $099b
	_b1dc:	lda $08b6
	_b1df:	sta $099c
	_b1e2:	jmp $b216
	_b1e5:	lda $099b
	_b1e8:	asl acc
	_b1e9:	asl acc
	_b1ea:	clc
	_b1eb:	adc $08ed,x
	_b1ee:	cmp #$e9
	_b1f0:	bcs $b1fa
	_b1f2:	sta $08ed,x
	_b1f5:	lda #$00
	_b1f7:	sta $099b
	_b1fa:	sta $08ba
	_b1fd:	lda #$00
	_b1ff:	sta $0944,x
	_b202:	lda $0995
	_b205:	asl acc
	_b206:	clc
	_b207:	adc $08f8,x
	_b20a:	cmp #$6c
	_b20c:	bcs $b216
	_b20e:	sta $08f8,x
	_b211:	lda #$00
	_b213:	sta $099c
	_b216:	lda $099b
	_b219:	ora $099c
	_b21c:	beq $b257
	_b21e:	jsr $b4bf
	_b221:	lda $08e2,x
	_b224:	and #$c0
	_b226:	beq $b23d
	_b228:	jsr $abc5
	_b22b:	ldx $0991
	_b22e:	lda $08ba
	_b231:	sta $08ed,x
	_b234:	lda $08bb
	_b237:	sta $08f8,x
	_b23a:	jmp $b257
	_b23d:	lda $099b
	_b240:	beq $b24a
	_b242:	lda $08ed,x
	_b245:	eor #$e8
	_b247:	sta $08ed,x
	_b24a:	lda $099c
	_b24d:	beq $b257
	_b24f:	lda $08f8,x
	_b252:	eor #$6a
	_b254:	sta $08f8,x
	_b257:	lda $08e2,x
	_b25a:	jsr $bec7
	_b25d:	ldx $0991
	_b260:	lda $08ec
	_b263:	cmp $08e2,x
	_b266:	beq $b26b
	_b268:	jmp $b365
	_b26b:	ldy #$00
	_b26d:	lda $090e,x	;camper status flag
	_b270:	cmp #$07
	_b272:	beq $b284
	_b274:	ldy $08b8
	_b277:	cmp #$04
	_b279:	bcs $b280
	_b27b:	ldy #$02
	_b27d:	sty $08b8
	_b280:	cpy #$01
	_b282:	bcc $b268
	_b284:	lda $bb83,x
	_b287:	and #$03
	_b289:	sta $0822
	_b28c:	lda $090e,x	;camper status flag
	_b28f:	and #$3f
	_b291:	cmp #$07
	_b293:	bne $b29a
	_b295:	lda #$04
	_b297:	sta $0822
	_b29a:	lda $090e,x	;camper status flag
	_b29d:	cmp #$04
	_b29f:	bcs $b2ae
	_b2a1:	ldx $0822
	_b2a4:	clc
	_b2a5:	adc $aedb,x
	_b2a8:	sta $09ea
	_b2ab:	jmp $b2e0
	_b2ae:	ldx $0822
	_b2b1:	lda $aed6,x
	_b2b4:	clc
	_b2b5:	adc $aedf
	_b2b8:	adc $099d
	_b2bb:	sta $09ea
	_b2be:	ldx $0991
	_b2c1:	lda $090e,x	;camper status flag
	_b2c4:	cmp #$05
	_b2c6:	bne $b2d2
	_b2c8:	lda $08e2,x
	_b2cb:	cmp $0903,x
	_b2ce:	beq $b2d6
	_b2d0:	bne $b2e0
	_b2d2:	cmp #$08
	_b2d4:	bcc $b2e0
	_b2d6:	lda $09ea
	_b2d9:	sec
	_b2da:	sbc $099d
	_b2dd:	sta $09ea
	_b2e0:	ldx $0991
	_b2e3:	lda $09ea
	_b2e6:	sta $09a7,y
	_b2e9:	lda $08b5
	_b2ec:	bne $b316
	_b2ee:	lda $08b7
	_b2f1:	beq $b316
	_b2f3:	sty $09ea
	_b2f6:	ldy $08cb
	_b2f9:	lda $a677,y
	_b2fc:	ldy $08b7
	_b2ff:	bmi $b304
	_b301:	clc
	_b302:	adc #$03
	_b304:	clc
	_b305:	ldx $0822
	_b308:	adc $aed6,x
	_b30b:	adc #$0b
	_b30d:	ldy $09ea
	_b310:	sta $09a7,y
	_b313:	ldx $0991
	_b316:	lda $08ed,x
	_b319:	sta $09a3,y
	_b31c:	lda $08f8,x
	_b31f:	sta $099f,y
	_b322:	lda $08b7
	_b325:	sta $09af,y
	_b328:	lda $08b5
	_b32b:	sta $09b3,y
	_b32e:	txa
	_b32f:	clc
	_b330:	adc #$01
	_b332:	sta $09ab,y
	_b335:	lda $090e,x	;camper status flag
	_b338:	and #$c0
	_b33a:	beq $b359
	_b33c:	lda $0970,x
	_b33f:	bne $b344
	_b341:	lda $09a7,y
	_b344:	ldx $0822
	_b347:	sec
	_b348:	sbc $aed6,x
	_b34b:	tax
	_b34c:	lda $bb8d,x
	_b34f:	ldx $0822
	_b352:	clc
	_b353:	adc $aed6,x
	_b356:	sta $09a7,y
	_b359:	ldx $0991
	_b35c:	lda $09a7,y
	_b35f:	sta $0970,x
	_b362:	dec $08b8
	_b365:	lda $090e,x	;camper status flag
	_b368:	cmp #$07
	_b36a:	bne $b36f
	_b36c:	jsr $b7b4
	_b36f:	lda $08e2,x
	_b372:	cmp $0903,x
	_b375:	bne $b389
	_b377:	lda $08f8,x
	_b37a:	cmp $09e2
	_b37d:	bne $b3be
	_b37f:	lda $08ed,x
	_b382:	cmp $09e3
	_b385:	beq $b3c8
	_b387:	bne $b3be
	_b389:	cmp $08d7
	_b38c:	bne $b3be
	_b38e:	lda $08f8,x
	_b391:	cmp $09e2
	_b394:	bne $b3be
	_b396:	lda $08ed,x
	_b399:	cmp $09e3
	_b39c:	bne $b3be
	_b39e:	lda $08d8
	_b3a1:	sta $08e2,x
	_b3a4:	and #$c0
	_b3a6:	beq $b3b4
	_b3a8:	lda #$74
	_b3aa:	sta $08ed,x
	_b3ad:	lda #$0d
	_b3af:	sta $08f8,x
	_b3b2:	bne $b3be
	_b3b4:	lda #$94
	_b3b6:	sta $08ed,x
	_b3b9:	lda #$4d
	_b3bb:	sta $08f8,x
	_b3be:	dex
	_b3bf:	bmi $b3c7
	_b3c1:	stx $0991
	_b3c4:	jmp $af7b
	_b3c7:	rts
	_b3c8:	lda $090e,x	;camper status flag
	_b3cb:	cmp #$07
	_b3cd:	bne $b3d2
	_b3cf:	jmp $b3be
	_b3d2:	inc $0923,x
	_b3d5:	lda $0923,x
	_b3d8:	cmp #$0a
	_b3da:	bcc $b3e9
	_b3dc:	lda #$00
	_b3de:	sta $0923,x
	_b3e1:	lda #$18
	_b3e3:	jsr $b4a7	;calc random value
	_b3e6:	sta $0919,x
	_b3e9:	lda $0919,x
	_b3ec:	and #$03
	_b3ee:	sta $0994
	_b3f1:	lda $0919,x
	_b3f4:	and #$fc
	_b3f6:	lsr acc
	_b3f7:	sta $0995
	_b3fa:	asl acc
	_b3fb:	asl acc
	_b3fc:	clc
	_b3fd:	adc $0995
	_b400:	sta $0995
	_b403:	lda $0923,x
	_b406:	clc
	_b407:	adc $0995
	_b40a:	tay
	_b40b:	lda $bb3d,y
	_b40e:	clc
	_b40f:	adc $0994
	_b412:	and #$03
	_b414:	sta $0994
	_b417:	lda $08e2,x
	_b41a:	and #$38
	_b41c:	lsr acc
	_b41d:	lsr acc
	_b41e:	lsr acc
	_b41f:	sta $0995
	_b422:	lda $08e2,x
	_b425:	and #$07
	_b427:	sta $0996
	_b42a:	lda $08e2,x
	_b42d:	and #$c0
	_b42f:	asl acc
	_b430:	rol acc
	_b431:	rol acc
	_b432:	asl acc
	_b433:	pha
	_b434:	tay
	_b435:	lda $a58c,y
	_b438:	sta $0822
	_b43b:	lda $0994
	_b43e:	jsr $b493
	_b441:	clc
	_b442:	adc $0995
	_b445:	cmp $0822
	_b448:	bcc $b457
	_b44a:	beq $b455
	_b44c:	lda $0822
	_b44f:	sec
	_b450:	sbc #$01
	_b452:	jmp $b457
	_b455:	lda #$00
	_b457:	asl acc
	_b458:	asl acc
	_b459:	asl acc
	_b45a:	sta $0995
	_b45d:	pla
	_b45e:	tax
	_b45f:	lda $a58d,x
	_b462:	sta $0822
	_b465:	tya
	_b466:	clc
	_b467:	adc $0996
	_b46a:	cmp $0822
	_b46d:	bcc $b47c
	_b46f:	beq $b47a
	_b471:	lda $0822
	_b474:	sec
	_b475:	sbc #$01
	_b477:	jmp $b47c
	_b47a:	lda #$00
	_b47c:	ora $0995
	_b47f:	sta $0994
	_b482:	ldx $0991
	_b485:	lda $08e2,x
	_b488:	and #$c0
	_b48a:	ora $0994
	_b48d:	sta $0903,x
	_b490:	jmp $b3be
	_b493:	asl acc
	_b494:	tay
	_b495:	lda $bb35,y
	_b498:	pha
	_b499:	lda $bb36,y
	_b49c:	tay
	_b49d:	pla
	_b49e:	rts

;--------------------------------------------------------
randomize	_b49f:	lda #$80 	;noise at freq. $8000
	_b4a1:	sta $d412	;no gate bit=silent noise :)
	_b4a4:	sta $d40f

random_a	_b4a7:	sta $0998	;0 <= random <= max.value-1 in .A:
	_b4aa:	cld
	_b4ab:	lda $d012	;raster bit0
	_b4ae:	and #$01
	_b4b0:	ora $d41b	;ora sid-rnd gen
	_b4b3:	sec
	_b4b4:	sbc $0998	;repeat -max.value
	_b4b7:	beq $b4be	;If=0 then done
	_b4b9:	bcs $b4b4	;if >0 then repeat
	_b4bb:	adc $0998	;else add max.value
	_b4be:	rts	;A contains rnd from 0 to maxvalue-1
;---end random--------------------------------------------
	_b4bf:	pha
	_b4c0:	tya
	_b4c1:	pha
	_b4c2:	lda $08e2,x
	_b4c5:	and #$07
	_b4c7:	sta $0994
	_b4ca:	lda $08e2,x
	_b4cd:	and #$38
	_b4cf:	lsr acc
	_b4d0:	lsr acc
	_b4d1:	lsr acc
	_b4d2:	sta $0995
	_b4d5:	lda $08e2,x
	_b4d8:	and #$c0
	_b4da:	asl acc
	_b4db:	rol acc
	_b4dc:	rol acc
	_b4dd:	asl acc
	_b4de:	tay
	_b4df:	lda $a58c,y
	_b4e2:	sta $0822
	_b4e5:	lda $099b
	_b4e8:	clc
	_b4e9:	adc $0995
	_b4ec:	cmp $0822
	_b4ef:	bcc $b4fe
	_b4f1:	beq $b4fc
	_b4f3:	lda $0822
	_b4f6:	sec
	_b4f7:	sbc #$01
	_b4f9:	jmp $b4fe
	_b4fc:	lda #$00
	_b4fe:	asl acc
	_b4ff:	asl acc
	_b500:	asl acc
	_b501:	sta $0995
	_b504:	lda $a58d,y
	_b507:	sta $0822
	_b50a:	lda $099c
	_b50d:	clc
	_b50e:	adc $0994
	_b511:	cmp $0822
	_b514:	bcc $b522
	_b516:	beq $b520
	_b518:	ldy $0822
	_b51b:	dey
	_b51c:	tya
	_b51d:	jmp $b522
	_b520:	lda #$00
	_b522:	ora $0995
	_b525:	sta $0994
	_b528:	lda $08e2,x
	_b52b:	and #$c0
	_b52d:	ora $0994
	_b530:	sta $08e2,x
	_b533:	pla
	_b534:	tay
	_b535:	pla
	_b536:	rts
	_b537:	tax
	_b538:	lda $bb2d,x
	_b53b:	and $08c6
	_b53e:	bne $b543
	_b540:	lda #$ff
	_b542:	rts
	_b543:	ldy #$07
	_b545:	lda $bb2d,x
	_b548:	eor #$ff
	_b54a:	and $08c6
	_b54d:	cmp $bb2d,y
	_b550:	beq $b557
	_b552:	dey
	_b553:	bpl $b54d
	_b555:	bmi $b559
	_b557:	tya
	_b558:	rts
	_b559:	txa
	_b55a:	asl acc
	_b55b:	tay
	_b55c:	lda $d000,y
	_b55f:	sec
	_b560:	sbc #$38
	_b562:	sta $09b9
	_b565:	lda $d001,y
	_b568:	sta $09ba
	_b56b:	stx $09c3
	_b56e:	ldx #$08
	_b570:	dex
	_b571:	bmi $b5aa
	_b573:	cpx $09c3
	_b576:	beq $b570
	_b578:	lda $bb2d,x
	_b57b:	and $08c6
	_b57e:	beq $b570
	_b580:	txa
	_b581:	asl acc
	_b582:	tay
	_b583:	lda $d001,y
	_b586:	sec
	_b587:	sbc $09ba
	_b58a:	bcs $b591
	_b58c:	eor #$ff
	_b58e:	clc
	_b58f:	adc #$01
	_b591:	cmp #$15
	_b593:	bcs $b570
	_b595:	lda $d000,y
	_b598:	sec
	_b599:	sbc #$38
	_b59b:	sec
	_b59c:	sbc $09b9
	_b59f:	bcs $b5a6
	_b5a1:	eor #$ff
	_b5a3:	clc
	_b5a4:	adc #$01
	_b5a6:	cmp #$18
	_b5a8:	bcs $b570
	_b5aa:	txa
	_b5ab:	rts
	_b5ac:	lda $09b7
	_b5af:	beq $b5ac
	_b5b1:	lda #$ff
	_b5b3:	sta $08d0
	_b5b6:	jsr $b5c4
	_b5b9:	lda $09b7
	_b5bc:	beq $b5b9
	_b5be:	lda #$00
	_b5c0:	sta $08d0
	_b5c3:	rts
	_b5c4:	lda $08ce	;player weapon
	_b5c7:	cmp #$0a
	_b5c9:	bne $b5d1
	_b5cb:	lda $08b9
	_b5ce:	bne $b5d1
	_b5d0:	rts
	_b5d1:	lda $0827
	_b5d4:	ora $0826
	_b5d7:	beq $b5dc
	_b5d9:	jmp $b885
	_b5dc:	lda $08cc
	_b5df:	jsr $b537
	_b5e2:	cmp #$ff
	_b5e4:	beq $b5ee
	_b5e6:	cmp #$06
	_b5e8:	bcc $b5ed
	_b5ea:	jmp $b6ee
	_b5ed:	rts
	_b5ee:	lda $08ce	;player weapon
	_b5f1:	cmp #$ff
	_b5f3:	beq $b5ed
	_b5f5:	lda $08f7
	_b5f8:	sta $08ba
	_b5fb:	lda $0902
	_b5fe:	sta $08bb
	_b601:	lda #$00
	_b603:	sta $08b7
	_b606:	sta $08c2
	_b609:	jsr $9fa7
	_b60c:	sta $0822
	_b60f:	lda #$00
	_b611:	sta $08ba
	_b614:	sta $08bb
	_b617:	ldx $08ce	;player weapon
	_b61a:	lda $d015
	_b61d:	and #$80
	_b61f:	bne $b62a
	_b621:	lda $08ce	;player weapon
	_b624:	sta $08d1
	_b627:	jmp $b63b
	_b62a:	lda #$28
	_b62c:	jsr $b4a7	;calc random value
	_b62f:	ldy #$0a
	_b631:	cmp $097b,y
	_b634:	beq $b62a
	_b636:	dey
	_b637:	bpl $b631
	_b639:	bmi $b63e
	_b63b:	lda $086c
	_b63e:	ldy $08d1
	_b641:	sta $097b,y
	_b644:	lda $086c
	_b647:	sta $097b,x
	_b64a:	lda $08bd
	_b64d:	sta $0986,x
	_b650:	ldx #$80
	_b652:	ldy #$0e
	_b654:	lda $d015
	_b657:	and #$80
	_b659:	beq $b66b
	_b65b:	lda $08d1
	_b65e:	sta $08cf
	_b661:	lda $08ce	;player weapon
	_b664:	sta $08d1
	_b667:	ldx #$40
	_b669:	ldy #$0c
	_b66b:	stx $08c2
	_b66e:	sty $08b8
	_b671:	lda $08c2
	_b674:	eor #$ff
	_b676:	sta $08c3
	_b679:	lda $08cd
	_b67c:	and $d010
	_b67f:	pha
	_b680:	lda $08cd
	_b683:	and $d01b
	_b686:	beq $b68b
	_b688:	lda $08c2
	_b68b:	sta $08bc
	_b68e:	lda $08cc
	_b691:	asl acc
	_b692:	tax
	_b693:	lda $d001,x
	_b696:	tay
	_b697:	lda $d000,x
	_b69a:	tax
	_b69b:	pla
	_b69c:	cmp #$00
	_b69e:	beq $b6a3
	_b6a0:	lda $08c2
	_b6a3:	sta $0822
	_b6a6:	lda $d010
	_b6a9:	and $08c3
	_b6ac:	ora $0822
	_b6af:	sta $d010
	_b6b2:	lda $d01b
	_b6b5:	and $08c3
	_b6b8:	ora $08bc
	_b6bb:	sta $d01b
	_b6be:	txa
	_b6bf:	ldx $08b8
	_b6c2:	sta $d000,x
	_b6c5:	tya
	_b6c6:	sta $d001,x
	_b6c9:	txa
	_b6ca:	lsr acc
	_b6cb:	tax
	_b6cc:	ldy $08ce	;player weapon
	_b6cf:	lda $a5aa,y
	_b6d2:	tay
	_b6d3:	lda $a59f,y
	_b6d6:	sta $57f8,x
	_b6d9:	lda $a594,y
	_b6dc:	sta $d027,x
	_b6df:	lda $d015
	_b6e2:	ora $08c2
	_b6e5:	sta $d015
	_b6e8:	lda #$ff
	_b6ea:	sta $08ce	;player weapon
	_b6ed:	rts
	_b6ee:	sta $0822
	_b6f1:	lda $08ce	;player weapon
	_b6f4:	cmp #$ff
	_b6f6:	bne $b6fb
	_b6f8:	jmp $b72c
	_b6fb:	ldy $08ce	;player weapon
	_b6fe:	lda $a5aa,y
	_b701:	tay
	_b702:	lda $a59f,y
	_b705:	sta $57ff
	_b708:	lda $a594,y
	_b70b:	sta $d02e
	_b70e:	ldx $08d1
	_b711:	ldy $08ce	;player weapon
	_b714:	lda $097b,x
	_b717:	sta $097b,y
	_b71a:	lda $0986,x
	_b71d:	sta $0986,y
	_b720:	lda #$ff
	_b722:	sta $097b,x
	_b725:	stx $08ce	;player weapon
	_b728:	sty $08d1
	_b72b:	rts
	_b72c:	lda $0822
	_b72f:	cmp #$07
	_b731:	beq $b756
	_b733:	ldx $08d1
	_b736:	stx $08ce	;player weapon
	_b739:	lda $08cf
	_b73c:	sta $08d1
	_b73f:	lda #$ff
	_b741:	sta $097b,x
	_b744:	ldx $08d1
	_b747:	lda $086c
	_b74a:	sta $097b,x
	_b74d:	lda $d015
	_b750:	and #$bf
	_b752:	sta $d015
	_b755:	rts
	_b756:	lda $08cf
	_b759:	sta $08ce	;player weapon
	_b75c:	lda $d015
	_b75f:	and #$40
	_b761:	beq $b7a0
	_b763:	lda $57fe
	_b766:	sta $57ff
	_b769:	lda $d02d
	_b76c:	sta $d02e
	_b76f:	lda $d00c
	_b772:	sta $d00e
	_b775:	lda $d00d
	_b778:	sta $d00f
	_b77b:	lda $d010
	_b77e:	and #$40
	_b780:	asl acc
	_b781:	sta $0822
	_b784:	lda $d010
	_b787:	and #$3f
	_b789:	ora $0822
	_b78c:	sta $d010
	_b78f:	ldx $08ce	;player weapon
	_b792:	lda #$ff
	_b794:	sta $097b,x
	_b797:	lda $d015
	_b79a:	and #$bf
	_b79c:	sta $d015
	_b79f:	rts
	_b7a0:	lda $d015
	_b7a3:	and #$3f
	_b7a5:	sta $d015
	_b7a8:	ldx $08d1
	_b7ab:	stx $08ce	;player weapon
	_b7ae:	lda #$ff
	_b7b0:	sta $097b,x
	_b7b3:	rts
	_b7b4:	ldy $0993
	_b7b7:	lda #$02
	_b7b9:	lda $08e2,x
	_b7bc:	cmp $08e2,y
	_b7bf:	beq $b7d5
	_b7c1:	lda $08e2,y
	_b7c4:	sta $0903,x
	_b7c7:	lda #$00
	_b7c9:	sta $09d2
	_b7cc:	lda $d015
	_b7cf:	and #$df
	_b7d1:	sta $d015
	_b7d4:	rts
	_b7d5:	lda $090e,x	;camper status flag
	_b7d8:	and #$c0
	_b7da:	bne $b7c7
	_b7dc:	lda $090e,y	;camper status flag
	_b7df:	cmp #$05
	_b7e1:	beq $b85f
	_b7e3:	cmp #$08
	_b7e5:	bcs $b829
	_b7e7:	lda #$3c
	_b7e9:	jsr $b4a7	;calc random value
	_b7ec:	cmp $092e,y	;some camper value
	_b7ef:	bcs $b85f
	_b7f1:	lda #$08
	_b7f3:	sta $090e,y	;camper status flag
	_b7f6:	ldy #$09
	_b7f8:	lda $092e,y	;some camper value
	_b7fb:	beq $b806
	_b7fd:	clc
	_b7fe:	adc #$02
	_b800:	cmp #$51
	_b802:	bcc $b806
	_b804:	lda #$50
	_b806:	sta $092e,y	;some camper value
	_b809:	dey
	_b80a:	bpl $b7f8
	_b80c:	txa
	_b80d:	pha
	_b80e:	ldx $09ee	;player#
	_b811:	lda $0938	;player panic level
	_b814:	clc
	_b815:	adc $941c,x	;+panic factor(player#)
	_b818:	sta $0938	;->player panic level
	_b81b:	pla
	_b81c:	tax
	_b81d:	lda $0938	;if player panic level
	_b820:	cmp #$50	;<$50
	_b822:	bcc $b829	;then
	_b824:	lda #$50	;else $50
	_b826:	sta $0938	;->player panic level
	_b829:	lda $09d2
	_b82c:	bne $b84e
	_b82e:	lda $08ed,x
	_b831:	sec
	_b832:	sbc $08ed,y
	_b835:	cmp #$0d
	_b837:	bcc $b83e
	_b839:	cmp #$ed
	_b83b:	bcs $b83e
	_b83d:	rts
	_b83e:	lda $08f8,x
	_b841:	sec
	_b842:	sbc $08f8,y
	_b845:	cmp #$04
	_b847:	bcc $b84e
	_b849:	cmp #$fc
	_b84b:	bcs $b84e
	_b84d:	rts
	_b84e:	jsr $bc66
	_b851:	ldy $0993
	_b854:	ldx $0992
	_b857:	lda $090e,y	;camper status flag
	_b85a:	beq $b85d
	_b85c:	rts
	_b85d:	lda #$01
	_b85f:	lda $bb79,x
	_b862:	sta $0903,x
	_b865:	sta $08d7
	_b868:	sta $08d8
	_b86b:	lda $0939,x
	_b86e:	clc
	_b86f:	adc #$03
	_b871:	cmp #$51
	_b873:	bcc $b877
	_b875:	lda #$50
	_b877:	sta $0939,x
	_b87a:	lda #$04
	_b87c:	sta $090e,x	;camper status flag
	_b87f:	lda #$09
	_b881:	sta $0923,x
	_b884:	rts
	_b885:	lda $09cc
	_b888:	bne $b8c4
	_b88a:	lda $08ce	;player weapon
	_b88d:	cmp #$ff
	_b88f:	beq $b8c4
	_b891:	cmp #$0a
	_b893:	beq $b8c4
	_b895:	lda $820	;basic plr spriteshape
	_b898:	sta $09c7
	_b89b:	clc
	_b89c:	adc #$04
	_b89e:	ldx #$01
	_b8a0:	cmp $09aa	;plr spriteshape+dir/movement temp
	_b8a3:	bcc $b8a7
	_b8a5:	ldx #$ff
	_b8a7:	stx $09c5
	_b8aa:	ldx $08ce	;player weapon
	_b8ad:	lda $a5aa,x
	_b8b0:	sta $09d7
	_b8b3:	jsr $b8c5
	_b8b6:	ldx #$05
	_b8b8:	lda $09c4,x
	_b8bb:	sta $09ca,x
	_b8be:	dex
	_b8bf:	bpl $b8b8
	_b8c1:	jsr $b92e
	_b8c4:	rts
	_b8c5:	ldy #$03
	_b8c7:	lda $09d7
	_b8ca:	cmp #$03
	_b8cc:	bcc $b8f2
	_b8ce:	dey
	_b8cf:	cmp #$07
	_b8d1:	bcc $b910
	_b8d3:	dey
	_b8d4:	tax
	_b8d5:	lda $a594,x
	_b8d8:	sta $09c9
	_b8db:	lda $a59f,x
	_b8de:	sty $09c6
	_b8e1:	ldx $09c5
	_b8e4:	bmi $b8e9
	_b8e6:	clc
	_b8e7:	adc #$03
	_b8e9:	sta $09c8
	_b8ec:	lda #$03
	_b8ee:	sta $09c4
	_b8f1:	rts
	_b8f2:	sty $09c6
	_b8f5:	tax
	_b8f6:	lda $a594,x
	_b8f9:	sta $09c9
	_b8fc:	lda $a59f,x
	_b8ff:	ldx $09c5
	_b902:	bmi $b907
	_b904:	clc
	_b905:	adc #$01
	_b907:	sta $09c8
	_b90a:	lda #$02
	_b90c:	sta $09c4
	_b90f:	rts
	_b910:	sty $09c6
	_b913:	tax
	_b914:	lda $a594,x
	_b917:	sta $09c9
	_b91a:	lda $a59f,x
	_b91d:	ldx $09c5
	_b920:	bmi $b925
	_b922:	clc
	_b923:	adc #$01
	_b925:	sta $09c8
	_b928:	lda #$03
	_b92a:	sta $09c4
	_b92d:	rts
	_b92e:	lda $09cc
	_b931:	cmp #$04
	_b933:	bcs $b938
	_b935:	jmp $b9bf
	_b938:	bne $b997
	_b93a:	lda $d010
	_b93d:	and #$10
	_b93f:	lsr acc
	_b940:	lsr acc
	_b941:	lsr acc
	_b942:	lsr acc
	_b943:	sta $0822
	_b946:	lda $09cb
	_b949:	bpl $b95c
	_b94b:	lda $d008
	_b94e:	sec
	_b94f:	sbc #$04
	_b951:	sta $d008
	_b954:	lda $0822
	_b957:	sbc #$00
	_b959:	jmp $b96a
	_b95c:	asl acc
	_b95d:	asl acc
	_b95e:	clc
	_b95f:	adc $d008
	_b962:	sta $d008
	_b965:	lda $0822
	_b968:	adc #$00
	_b96a:	asl acc
	_b96b:	asl acc
	_b96c:	asl acc
	_b96d:	asl acc
	_b96e:	sta $0822
	_b971:	lda $d010
	_b974:	and #$ef
	_b976:	ora $0822
	_b979:	sta $d010
	_b97c:	lda $0822
	_b97f:	bne $b98c
	_b981:	lda $d008
	_b984:	cmp #$38
	_b986:	bcc $b99d
	_b988:	jsr $bbaa
	_b98b:	rts
	_b98c:	lda $d008
	_b98f:	cmp #$20
	_b991:	bcs $b99d
	_b993:	jsr $bbaa
	_b996:	rts
	_b997:	dec $09ca
	_b99a:	beq $b99d
	_b99c:	rts
	_b99d:	lda #$00
	_b99f:	sta $09cc
	_b9a2:	sta $09ca
	_b9a5:	lda $d015
	_b9a8:	and #$ef
	_b9aa:	sta $d015
	_b9ad:	lda $09cd
	_b9b0:	ldx $09cb
	_b9b3:	bmi $b9b8
	_b9b5:	clc
	_b9b6:	adc #$05
	_b9b8:	sta $09d8
	_b9bb:	jsr $c43c
	_b9be:	rts
	_b9bf:	ldx #$05
	_b9c1:	lda $09ca,x
	_b9c4:	sta $09c4,x
	_b9c7:	dex
	_b9c8:	bpl $b9c1
	_b9ca:	lda $09c6
	_b9cd:	cmp #$03
	_b9cf:	beq $b9d7
	_b9d1:	jsr $ba77
	_b9d4:	jmp $b9da
	_b9d7:	jsr $bacf
	_b9da:	ldx #$05
	_b9dc:	lda $09c4,x
	_b9df:	sta $09ca,x
	_b9e2:	dex
	_b9e3:	bpl $b9dc
	_b9e5:	lda #$00
	_b9e7:	sta $0822
	_b9ea:	lda $08f7
	_b9ed:	clc
	_b9ee:	adc #$38
	_b9f0:	sta $0823
	_b9f3:	bcc $b9f8
	_b9f5:	inc $0822
	_b9f8:	lda $09da
	_b9fb:	ldx $09c5
	_b9fe:	bmi $ba14
	_ba00:	clc
	_ba01:	adc #$08
	_ba03:	asl acc
	_ba04:	tax
	_ba05:	lda $0823
	_ba08:	clc
	_ba09:	adc $bb09,x
	_ba0c:	bcc $ba22
	_ba0e:	inc $0822
	_ba11:	jmp $ba22
	_ba14:	asl acc
	_ba15:	tax
	_ba16:	lda $0823
	_ba19:	sec
	_ba1a:	sbc $bb09,x
	_ba1d:	bcs $ba22
	_ba1f:	inc $0822
	_ba22:	sta $d008
	_ba25:	lda $0822
	_ba28:	beq $ba2c
	_ba2a:	lda #$10
	_ba2c:	sta $0822
	_ba2f:	lda $d010
	_ba32:	and #$ef
	_ba34:	ora $0822
	_ba37:	sta $d010
	_ba3a:	lda $d01b
	_ba3d:	and $08cd
	_ba40:	beq $ba44
	_ba42:	lda #$10
	_ba44:	sta $0822
	_ba47:	lda $d01b
	_ba4a:	and #$ef
	_ba4c:	ora $0822
	_ba4f:	sta $d01b
	_ba52:	lda $0902
	_ba55:	clc
	_ba56:	adc $bb0a,x
	_ba59:	clc
	_ba5a:	adc #$32
	_ba5c:	sta $d009
	_ba5f:	lda $09d9
	_ba62:	sta $57fc
	_ba65:	lda $09cf
	_ba68:	sta $d02b
	_ba6b:	lda $d015
	_ba6e:	ora #$10
	_ba70:	sta $d015
	_ba73:	jsr $bbaa
	_ba76:	rts
	_ba77:	lda $09c4
	_ba7a:	clc
	_ba7b:	adc #$12
	_ba7d:	ldx $09c5
	_ba80:	cpx #$ff
	_ba82:	beq $ba87
	_ba84:	clc
	_ba85:	adc #$04
	_ba87:	clc
	_ba88:	adc $09c7
	_ba8b:	sta $09d8
	_ba8e:	ldx $09c4
	_ba91:	dex
	_ba92:	stx $09da
	_ba95:	lda $09c6
	_ba98:	cmp #$01
	_ba9a:	beq $baa5
	_ba9c:	txa
	_ba9d:	clc
	_ba9e:	adc #$05
	_baa0:	sta $09da
	_baa3:	ldx #$00
	_baa5:	txa
	_baa6:	clc
	_baa7:	adc $09c8
	_baaa:	sta $09d9
	_baad:	dec $09c4
	_bab0:	bne $bace
	_bab2:	lda $09c6
	_bab5:	cmp #$02
	_bab7:	beq $bac4
	_bab9:	lda #$05
	_babb:	sta $09c6
	_babe:	lda #$05
	_bac0:	sta $09c4
	_bac3:	rts
	_bac4:	lda #$04
	_bac6:	sta $09c6
	_bac9:	lda #$01
	_bacb:	sta $09c4
	_bace:	rts
	_bacf:	lda #$15
	_bad1:	ldx $09c5
	_bad4:	bmi $bad9
	_bad6:	clc
	_bad7:	adc #$04
	_bad9:	ldx $09c4
	_badc:	cpx #$01
	_bade:	bne $bae3
	_bae0:	sec
	_bae1:	sbc #$02
	_bae3:	clc
	_bae4:	adc $09c7
	_bae7:	sta $09d8
	_baea:	lda $09c8
	_baed:	sta $09d9
	_baf0:	lda $09c4
	_baf3:	clc
	_baf4:	adc #$02
	_baf6:	sta $09da
	_baf9:	dec $09c4
	_bafc:	bne $bb08
	_bafe:	lda #$05
	_bb00:	sta $09c6
	_bb03:	lda #$05
	_bb05:	sta $09c4
	_bb08:	rts
	_bb09:	ora ($04),y
	_bb0b:	dat $12
	_bb0c:	brk
	_bb0d:	dat $02
	_bb0e:	sbc $0014
	_bb11:	dat $14
	_bb12:	brk
	_bb13:	ora $0d00
	_bb16:	dat $fc
	_bb17:	sed
	_bb18:	sed
	_bb19:	dat $13
	_bb1a:	dat $04
	_bb1b:	asl $00,x
	_bb1d:	dat $02
	_bb1e:	sbc $0018
	_bb21:	clc
	_bb22:	brk
	_bb23:	dat $0b
	_bb24:	brk
	_bb25:	dat $0b
	_bb26:	dat $fc
	_bb27:	php
	_bb28:	sed
	_bb29:	brk
	_bb2a:	dat $0c
	_bb2b:	dat $1a
	_bb2c:	asl acc
	_bb2d:	ora ($02,x)
	_bb2f:	dat $04
	_bb30:	php
	_bb31:	bpl $bb53
	_bb33:	rti
	_bb34:	dat $80
	_bb35:	brk
	_bb36:	dat $ff
	_bb37:	ora ($00,x)
	_bb39:	brk
	_bb3a:	ora ($ff,x)
	_bb3c:	brk
	_bb3d:	dat $03
	_bb3e:	brk
	_bb3f:	brk
	_bb40:	ora ($01,x)
	_bb42:	dat $02
	_bb43:	ora ($02,x)
	_bb45:	dat $03
	_bb46:	dat $03
	_bb47:	dat $03
	_bb48:	brk
	_bb49:	ora ($01,x)
	_bb4b:	ora ($02,x)
	_bb4d:	dat $03
	_bb4e:	dat $02
	_bb4f:	dat $03
	_bb50:	brk
	_bb51:	dat $03
	_bb52:	brk
	_bb53:	brk
	_bb54:	ora ($02,x)
	_bb56:	ora ($01,x)
	_bb58:	dat $02
	_bb59:	dat $03
	_bb5a:	dat $03
	_bb5b:	dat $03
	_bb5c:	dat $03
	_bb5d:	brk
	_bb5e:	ora ($02,x)
	_bb60:	dat $02
	_bb61:	ora ($01,x)
	_bb63:	brk
	_bb64:	dat $03
	_bb65:	dat $03
	_bb66:	brk
	_bb67:	brk
	_bb68:	ora ($01,x)
	_bb6a:	ora ($02,x)
	_bb6c:	dat $02
	_bb6d:	dat $03
	_bb6e:	dat $03
	_bb6f:	dat $03
	_bb70:	dat $02
	_bb71:	ora ($00,x)
	_bb73:	brk
	_bb74:	ora ($02,x)
	_bb76:	dat $02
	_bb77:	dat $03
	_bb78:	brk
	_bb79:	ora #$18
	_bb7b:	dat $13
	_bb7c:	dat $04
	_bb7d:	eor ($4b,x)
	_bb7f:	bvc $bb01
	_bb81:	dat $89
	_bb82:	cmp #$50
	_bb84:	eor ($12,x)
	_bb86:	dat $33
	_bb87:	bpl $bbda
	_bb89:	dat $32
	_bb8a:	dat $13
	_bb8b:	rti
	_bb8c:	ora ($12),y
	_bb8e:	dat $12
	_bb8f:	dat $12
	_bb90:	dat $12
	_bb91:	dat $12
	_bb92:	ora ($11),y
	_bb94:	ora ($11),y
	_bb96:	ora ($11),y
	_bb98:	dat $12
	_bb99:	dat $12
	_bb9a:	dat $12
	_bb9b:	ora ($11),y
	_bb9d:	ora ($11),y
	_bb9f:	dat $12
	_bba0:	dat $12
	_bba1:	dat $12
	_bba2:	dat $12
	_bba3:	dat $12
	_bba4:	ora ($11),y
	_bba6:	ora ($11),y
	_bba8:	brk
	_bba9:	brk
	_bbaa:	ldx #$03
	_bbac:	stx $bba8
	_bbaf:	ldx $bba8
	_bbb2:	lda $09bb,x
	_bbb5:	bne $bbbd
	_bbb7:	dec $bba8
	_bbba:	bpl $bbaf
	_bbbc:	rts
	_bbbd:	txa
	_bbbe:	jsr $bc35
	_bbc1:	cmp #$04
	_bbc3:	beq $bbcb
	_bbc5:	dec $bba8
	_bbc8:	bpl $bbaf
	_bbca:	rts
	_bbcb:	ldx $bba8
	_bbce:	lda $09bb,x
	_bbd1:	sec
	_bbd2:	sbc #$01
	_bbd4:	tax
	_bbd5:	lda $090e,x	;camper status flag
	_bbd8:	and #$c0
	_bbda:	cmp #$40
	_bbdc:	beq $bc2a
	_bbde:	lda $0939,x
	_bbe1:	ldy $08ce	;player weapon
	_bbe4:	sec
	_bbe5:	sbc $bc52,y
	_bbe8:	bcs $bc00
	_bbea:	lda $090e,x	;camper status flag
	_bbed:	and #$3f
	_bbef:	beq $bc00
	_bbf1:	lda #$40
	_bbf3:	sta $090e,x	;camper status flag
	_bbf6:	lda #$00
	_bbf8:	sta $092e,x	;some camper value
	_bbfb:	jsr $c374
	_bbfe:	lda #$00
	_bc00:	sta $0939,x
	_bc03:	lda $090e,x	;camper status flag
	_bc06:	ora #$40
	_bc08:	sta $090e,x	;camper status flag
	_bc0b:	cpx $0992
	_bc0e:	bne $bc2b
	_bc10:	ldy $08ce	;player weapon
	_bc13:	lda $bc5c,y
	_bc16:	jsr $c404
	_bc19:	lda $090e,x	;camper status flag
	_bc1c:	and #$3f
	_bc1e:	beq $bc2a
	_bc20:	lda #$47
	_bc22:	sta $090e,x	;camper status flag
	_bc25:	lda #$0a
	_bc27:	sta $0993
	_bc2a:	rts
	_bc2b:	lda $0821
	_bc2e:	clc
	_bc2f:	adc #$02
	_bc31:	sta $0821
	_bc34:	rts
	_bc35:	sta $09ea
	_bc38:	lda $08c6
	_bc3b:	pha
	_bc3c:	and #$df
	_bc3e:	sta $08c6
	_bc41:	lda $09ea
	_bc44:	jsr $b537
	_bc47:	sta $09ea
	_bc4a:	pla
	_bc4b:	sta $08c6
	_bc4e:	lda $09ea
	_bc51:	rts
	_bc52:	asl $06
	_bc54:	asl $02
	_bc56:	dat $02
	_bc57:	dat $03
	_bc58:	dat $02
	_bc59:	php
	_bc5a:	php
	_bc5b:	php
	_bc5c:	dat $3c
	_bc5d:	dat $3c
	_bc5e:	dat $3c
	_bc5f:	asl acc
	_bc60:	asl acc
	_bc61:	dat $0f
	_bc62:	asl acc
	_bc63:	sei
	_bc64:	sei
	_bc65:	sei
	_bc66:	lda $09d2
	_bc69:	bne $bc9d
	_bc6b:	lda #$c9
	_bc6d:	sta $09c7
	_bc70:	ldx $0992
	_bc73:	ldy $0993
	_bc76:	lda $08ed,x
	_bc79:	ldx #$ff
	_bc7b:	sec
	_bc7c:	sbc $08ed,y
	_bc7f:	bcs $bc83
	_bc81:	ldx #$01
	_bc83:	stx $09c5
	_bc86:	lda #$08
	_bc88:	sta $09d7
	_bc8b:	jsr $b8c5
	_bc8e:	ldx #$05
	_bc90:	lda $09c4,x
	_bc93:	sta $09d0,x
	_bc96:	dex
	_bc97:	bpl $bc90
	_bc99:	jsr $bc9d
	_bc9c:	rts
	_bc9d:	lda $09d2
	_bca0:	cmp #$04
	_bca2:	bcc $bcde
	_bca4:	bne $bcac
	_bca6:	lda $09d0
	_bca9:	bne $bcb2
	_bcab:	rts
	_bcac:	dec $09d0
	_bcaf:	beq $bcb2
	_bcb1:	rts
	_bcb2:	lda #$00
	_bcb4:	sta $09d2
	_bcb7:	sta $09d0
	_bcba:	ldy $0993
	_bcbd:	lda $d015
	_bcc0:	and #$df
	_bcc2:	sta $d015
	_bcc5:	lda $09d3
	_bcc8:	ldx $09d1
	_bccb:	cpx #$ff
	_bccd:	beq $bcd2
	_bccf:	clc
	_bcd0:	adc #$05
	_bcd2:	sta $09a7
	_bcd5:	lda $090e,y	;camper status flag
	_bcd8:	and #$3f
	_bcda:	sta $090e,y	;camper status flag
	_bcdd:	rts
	_bcde:	ldx #$05
	_bce0:	lda $09d0,x
	_bce3:	sta $09c4,x
	_bce6:	dex
	_bce7:	bpl $bce0
	_bce9:	lda $09c6
	_bcec:	cmp #$03
	_bcee:	beq $bcf6
	_bcf0:	jsr $ba77
	_bcf3:	jmp $bcf9
	_bcf6:	jsr $bacf
	_bcf9:	ldx #$05
	_bcfb:	lda $09c4,x
	_bcfe:	sta $09d0,x
	_bd01:	dex
	_bd02:	bpl $bcfb
	_bd04:	lda #$00
	_bd06:	sta $0822
	_bd09:	lda $09da
	_bd0c:	ldx $09c5
	_bd0f:	bmi $bd25
	_bd11:	clc
	_bd12:	adc #$05
	_bd14:	asl acc
	_bd15:	tax
	_bd16:	lda $09a3
	_bd19:	clc
	_bd1a:	adc $bb09,x
	_bd1d:	bcc $bd33
	_bd1f:	inc $0822
	_bd22:	jmp $bd33
	_bd25:	asl acc
	_bd26:	tax
	_bd27:	lda $09a3
	_bd2a:	sec
	_bd2b:	sbc $bb09,x
	_bd2e:	bcs $bd33
	_bd30:	inc $0822
	_bd33:	clc
	_bd34:	adc #$38
	_bd36:	sta $d00a
	_bd39:	lda #$00
	_bd3b:	adc $0822
	_bd3e:	beq $bd42
	_bd40:	lda #$20
	_bd42:	sta $0822
	_bd45:	lda $d010
	_bd48:	and #$df
	_bd4a:	ora $0822
	_bd4d:	sta $d010
	_bd50:	lda $d01b
	_bd53:	ora #$20
	_bd55:	sta $d01b
	_bd58:	lda $099f
	_bd5b:	clc
	_bd5c:	adc $bb0a,x
	_bd5f:	clc
	_bd60:	adc #$32
	_bd62:	sta $d00b
	_bd65:	lda $09d9
	_bd68:	sta $57fd
	_bd6b:	lda $09d5
	_bd6e:	sta $d02c
	_bd71:	ldx $0992
	_bd74:	lda $08e2,x
	_bd77:	cmp $08ec
	_bd7a:	bne $bd86
	_bd7c:	lda $d015
	_bd7f:	ora #$20
	_bd81:	sta $d015
	_bd84:	bne $bd8e
	_bd86:	lda $d015
	_bd89:	and #$df
	_bd8b:	sta $d015
	_bd8e:	jsr $bd98
	_bd91:	lda $09d8
	_bd94:	sta $09a7
	_bd97:	rts
	_bd98:	ldx $0992
	_bd9b:	lda $08e2,x
	_bd9e:	cmp $08ec
	_bda1:	beq $bda9
	_bda3:	ldx $0993
	_bda6:	jmp $bddc
	_bda9:	ldx #$03
	_bdab:	stx $bba8
	_bdae:	ldx $bba8
	_bdb1:	lda $09bb,x
	_bdb4:	beq $bdc4
	_bdb6:	sec
	_bdb7:	sbc #$01
	_bdb9:	cmp $0992
	_bdbc:	bne $bdc4
	_bdbe:	dec $bba8
	_bdc1:	bpl $bdae
	_bdc3:	rts
	_bdc4:	txa
	_bdc5:	jsr $b537
	_bdc8:	cmp #$05
	_bdca:	beq $bdce
	_bdcc:	bne $bdbe
	_bdce:	ldx $bba8
	_bdd1:	lda $09bb,x
	_bdd4:	sec
	_bdd5:	sbc #$01
	_bdd7:	tax
	_bdd8:	bpl $bddc
	_bdda:	ldx #$0a
	_bddc:	lda $090e,x	;camper status flag
	_bddf:	and #$c0
	_bde1:	cmp #$80	;if dead
	_bde3:	beq $be10
	_bde5:	lda $0939,x	;strength(x)
	_bde8:	sec
	_bde9:	sbc $bc5a	;-jason's dft strength (=8)
	_bdec:	sbc $09ef	;-round#
	_bdef:	bpl $be05

	_bdf1:	lda $090e,x	;camper status flag
	_bdf4:	beq $be05
	_bdf6:	lda #$80
	_bdf8:	sta $090e,x	;camper status flag
	_bdfb:	lda #$00
	_bdfd:	sta $092e,x	;some camper value
	_be00:	jsr $c374
	_be03:	lda #$00
	_be05:	sta $0939,x
	_be08:	lda $090e,x	;camper status flag
	_be0b:	ora #$80	;ora dead-bit
	_be0d:	sta $090e,x	;->camper status flag
	_be10:	rts
	_be11:	lda $09ed
	_be14:	bne $be17
	_be16:	rts
	_be17:	lda $0985
	_be1a:	cmp #$ff
	_be1c:	bne $be21
	_be1e:	jmp $beaa
	_be21:	lda $08cc
	_be24:	jsr $b537
	_be27:	cmp #$04
	_be29:	bcc $be2c
	_be2b:	rts
	_be2c:	tax
	_be2d:	lda $09bb,x
	_be30:	sec
	_be31:	sbc #$01
	_be33:	tax
	_be34:	lda $090e,x	;camper status flag
	_be37:	beq $be41
	_be39:	cmp #$07
	_be3b:	beq $be41
	_be3d:	cmp #$05
	_be3f:	bne $be42
	_be41:	rts
	_be42:	lda #$5a
	_be44:	sec
	_be45:	sbc $092e,x	;some camper value
	_be48:	sta $095a,x
	_be4b:	lda #$05
	_be4d:	sta $090e,x	;camper status flag
	_be50:	ldy #$03
	_be52:	lda $0985
	_be55:	cmp $a5b5,y
	_be58:	bcs $be5d
	_be5a:	dey
	_be5b:	bne $be55
	_be5d:	sec
	_be5e:	sbc $a5b5,y
	_be61:	sta $0822
	_be64:	tya
	_be65:	lsr acc
	_be66:	ror acc
	_be67:	ror acc
	_be68:	sta $bba8
	_be6b:	tya
	_be6c:	asl acc
	_be6d:	tay
	_be6e:	txa
	_be6f:	pha
	_be70:	ldx #$00
	_be72:	lda $0822
	_be75:	cmp $a58c,y
	_be78:	bcc $be80
	_be7a:	sbc $a58c,y
	_be7d:	inx
	_be7e:	bne $be75
	_be80:	asl acc
	_be81:	asl acc
	_be82:	asl acc
	_be83:	ora $bba8
	_be86:	sta $bba8
	_be89:	txa
	_be8a:	ora $bba8
	_be8d:	sta $bba8
	_be90:	pla
	_be91:	tax
	_be92:	lda $bba8
	_be95:	sta $0903,x
	_be98:	lda $08ce	;player weapon
	_be9b:	cmp #$ff
	_be9d:	bne $bea0
	_be9f:	rts
	_bea0:	lda $092e,x	;some camper value
	_bea3:	clc
	_bea4:	adc #$02
	_bea6:	sta $092e,x	;some camper value
	_bea9:	rts
	_beaa:	ldx #$09
	_beac:	lda $090e,x	;camper status flag
	_beaf:	cmp #$05
	_beb1:	bne $bec3
	_beb3:	lda $bb79,x
	_beb6:	sta $0903,x
	_beb9:	lda #$04
	_bebb:	sta $090e,x	;camper status flag
	_bebe:	lda #$09
	_bec0:	sta $0923,x
	_bec3:	dex
	_bec4:	bpl $beac
	_bec6:	rts
	_bec7:	jsr $bf17
	_beca:	lda $08b8
	_becd:	pha
	_bece:	lda $08c5
	_bed1:	pha
	_bed2:	lda #$01
	_bed4:	sta $08c2
	_bed7:	lda #$00
	_bed9:	sta $08b8
	_bedc:	ldx $0991
	_bedf:	lda $08ed,x
	_bee2:	sta $08ba
	_bee5:	lda $08f8,x
	_bee8:	sta $08bb
	_beeb:	lda #$01
	_beed:	sta $08c5
	_bef0:	jsr $9fa7
	_bef3:	ldx $0991
	_bef6:	lda $08ba
	_bef9:	sta $08ed,x
	_befc:	lda $08bb
	_beff:	sta $08f8,x
	_bf02:	lda $0999
	_bf05:	sta $0944,x
	_bf08:	lda $099a
	_bf0b:	sta $094f,x
	_bf0e:	pla
	_bf0f:	sta $08c5
	_bf12:	pla
	_bf13:	sta $08b8
	_bf16:	rts
	_bf17:	pha
	_bf18:	asl acc
	_bf19:	rol acc
	_bf1a:	rol acc
	_bf1b:	and #$03
	_bf1d:	sta $0823
	_bf20:	asl acc
	_bf21:	tay
	_bf22:	pla
	_bf23:	pha
	_bf24:	and #$07
	_bf26:	tax
	_bf27:	lda #$00
	_bf29:	cpx #$00
	_bf2b:	beq $bf34
	_bf2d:	clc
	_bf2e:	adc $a58c,y
	_bf31:	dex
	_bf32:	bne $bf2d
	_bf34:	sta $0822
	_bf37:	pla
	_bf38:	and #$38
	_bf3a:	lsr acc
	_bf3b:	lsr acc
	_bf3c:	lsr acc
	_bf3d:	clc
	_bf3e:	adc $0822
	_bf41:	ldx $0823
	_bf44:	clc
	_bf45:	adc $a5b5,x
	_bf48:	ldx #$00
	_bf4a:	stx $0822
	_bf4d:	asl acc
	_bf4e:	rol $0822
	_bf51:	asl acc
	_bf52:	rol $0822
	_bf55:	asl acc
	_bf56:	rol $0822
	_bf59:	asl acc
	_bf5a:	rol $0822
	_bf5d:	asl acc
	_bf5e:	rol $0822
	_bf61:	clc
	_bf62:	adc #$00
	_bf64:	sta $fb
	_bf66:	lda $0822
	_bf69:	adc #$0c
	_bf6b:	sta $fc
	_bf6d:	ldy #$1f
	_bf6f:	lda ($fb),y
	_bf71:	sta $0894,y
	_bf74:	dey
	_bf75:	bpl $bf6f
	_bf77:	jsr $bf7b
	_bf7a:	rts
	_bf7b:	ldx #$1f
	_bf7d:	lda $0894,x
	_bf80:	cmp #$81
	_bf82:	beq $bf94
	_bf84:	cmp #$82
	_bf86:	beq $bf94
	_bf88:	cmp #$83
	_bf8a:	beq $bf94
	_bf8c:	cmp #$84
	_bf8e:	beq $bf94
	_bf90:	dex
	_bf91:	bpl $bf7d
	_bf93:	rts
	_bf94:	lda #$00
	_bf96:	sta $0894,x
	_bf99:	dex
	_bf9a:	bpl $bf7d
	_bf9c:	rts
	_bf9d:	lda $09cc
	_bfa0:	bne $bfaf
	_bfa2:	ldx #$09
	_bfa4:	lda $090e,x	;camper status flag
	_bfa7:	and #$bf
	_bfa9:	sta $090e,x	;camper status flag
	_bfac:	dex
	_bfad:	bpl $bfa4
	_bfaf:	lda $09d2
	_bfb2:	bne $bfc1
	_bfb4:	ldx #$0a
	_bfb6:	lda $090e,x	;camper status flag
	_bfb9:	and #$7f
	_bfbb:	sta $090e,x	;camper status flag
	_bfbe:	dex
	_bfbf:	bpl $bfb6
	_bfc1:	ldx $0992
	_bfc4:	lda $090e,x	;camper status flag
	_bfc7:	and #$3f
	_bfc9:	cmp #$07
	_bfcb:	beq $bfd2
	_bfcd:	lda #$ff
	_bfcf:	sta $0993
	_bfd2:	ldx #$09
	_bfd4:	lda $090e,x	;camper status flag
	_bfd7:	cmp #$08
	_bfd9:	bne $bff0
	_bfdb:	cpx $0993
	_bfde:	beq $bff0
	_bfe0:	lda $bb79,x
	_bfe3:	sta $0903,x
	_bfe6:	lda #$04
	_bfe8:	sta $090e,x	;camper status flag
	_bfeb:	lda #$09
	_bfed:	sta $0923,x
	_bff0:	dex
	_bff1:	bpl $bfd4
	_bff3:	rts
	_bff4:	lda #$00
	_bff6:	clc
	_bff7:	adc #$fc
	_bff9:	sta $fb
	_bffb:	sta $fd
	_bffd:	lda #$54
	_bfff:	adc #$02
	_c001:	sta $fc
	_c003:	clc
	_c004:	adc #$84
	_c006:	sta $fe
	_c008:	ldy #$00
	_c00a:	lda #$0f
	_c00c:	sta $0822
	_c00f:	lda #$10
	_c011:	jsr $c077
	_c014:	lda $fb
	_c016:	clc
	_c017:	adc #$0a
	_c019:	sta $fb
	_c01b:	sta $fd
	_c01d:	lda $fc
	_c01f:	adc #$00
	_c021:	sta $fc
	_c023:	clc
	_c024:	adc #$84
	_c026:	sta $fe
	_c028:	ldy #$00
	_c02a:	ldx #$04
	_c02c:	lda #$09
	_c02e:	sta $0822
	_c031:	lda #$31
	_c033:	jsr $c114
	_c036:	lda #$00
	_c038:	sta $fb
	_c03a:	sta $fd
	_c03c:	lda #$54
	_c03e:	clc
	_c03f:	adc #$03
	_c041:	sta $fc
	_c043:	clc
	_c044:	adc #$84
	_c046:	sta $fe
	_c048:	ldy #$00
	_c04a:	lda #$0a
	_c04c:	sta ($fb),y
	_c04e:	lda #$01
	_c050:	sta ($fd),y
	_c052:	tya
	_c053:	clc
	_c054:	adc #$05
	_c056:	tay
	_c057:	lda #$0b
	_c059:	sta ($fb),y
	_c05b:	lda #$01
	_c05d:	sta ($fd),y
	_c05f:	tya
	_c060:	clc
	_c061:	adc #$23
	_c063:	tay
	_c064:	cmp #$96
	_c066:	bcc $c04a
	_c068:	lda #$01
	_c06a:	sta $fb
	_c06c:	sta $fd
	_c06e:	lda #$09
	_c070:	sta $0822
	_c073:	ldy #$00
	_c075:	lda #$21
	_c077:	ldx #$04
	_c079:	sta ($fb),y
	_c07b:	clc
	_c07c:	adc #$01
	_c07e:	pha
	_c07f:	lda $0822
	_c082:	sta ($fd),y
	_c084:	pla
	_c085:	iny
	_c086:	dex
	_c087:	bne $c079
	_c089:	pha
	_c08a:	tya
	_c08b:	clc
	_c08c:	adc #$24
	_c08e:	tay
	_c08f:	pla
	_c090:	cpy #$96
	_c092:	bcc $c077
	_c094:	rts
	_c095:	lda #$0c
	_c097:	clc
	_c098:	adc #$00
	_c09a:	sta $fb
	_c09c:	sta $fd
	_c09e:	lda #$54
	_c0a0:	adc #$03
	_c0a2:	sta $fc
	_c0a4:	clc
	_c0a5:	adc #$84
	_c0a7:	sta $fe
	_c0a9:	ldx #$09
	_c0ab:	stx $0822
	_c0ae:	ldx $0822
	_c0b1:	lda $bb83,x
	_c0b4:	lsr acc
	_c0b5:	lsr acc
	_c0b6:	lsr acc
	_c0b7:	lsr acc
	_c0b8:	ora #$08
	_c0ba:	sta $0823
	_c0bd:	lda $090e,x	;camper status flag
	_c0c0:	cmp #$03
	_c0c2:	bcs $c0cd
	_c0c4:	lda #$09
	_c0c6:	sta $0823
	_c0c9:	lda #$55
	_c0cb:	bne $c0de
	_c0cd:	lda $bb83,x
	_c0d0:	and #$0f
	_c0d2:	asl acc
	_c0d3:	sta $09ea
	_c0d6:	asl acc
	_c0d7:	clc
	_c0d8:	adc $09ea
	_c0db:	clc
	_c0dc:	adc #$3d
	_c0de:	jsr $c0e7
	_c0e1:	dec $0822
	_c0e4:	bpl $c0ae
	_c0e6:	rts
	_c0e7:	pha
	_c0e8:	ldx $0822
	_c0eb:	lda $c209,x
	_c0ee:	tay
	_c0ef:	ldx #$03
	_c0f1:	pla
	_c0f2:	sta ($fb),y
	_c0f4:	clc
	_c0f5:	adc #$01
	_c0f7:	pha
	_c0f8:	lda $0823
	_c0fb:	sta ($fd),y
	_c0fd:	iny
	_c0fe:	pla
	_c0ff:	sta ($fb),y
	_c101:	clc
	_c102:	adc #$01
	_c104:	pha
	_c105:	lda $0823
	_c108:	sta ($fd),y
	_c10a:	tya
	_c10b:	clc
	_c10c:	adc #$27
	_c10e:	tay
	_c10f:	pla
	_c110:	dex
	_c111:	bne $c0f2
	_c113:	rts
	_c114:	sta ($fb),y
	_c116:	clc
	_c117:	adc #$01
	_c119:	pha
	_c11a:	lda $0822
	_c11d:	sta ($fd),y
	_c11f:	pla
	_c120:	iny
	_c121:	sta ($fb),y
	_c123:	clc
	_c124:	adc #$01
	_c126:	pha
	_c127:	lda $0822
	_c12a:	sta ($fd),y
	_c12c:	pla
	_c12d:	iny
	_c12e:	sta ($fb),y
	_c130:	clc
	_c131:	adc #$01
	_c133:	pha
	_c134:	lda $0822
	_c137:	sta ($fd),y
	_c139:	pla
	_c13a:	pha
	_c13b:	tya
	_c13c:	clc
	_c13d:	adc #$26
	_c13f:	tay
	_c140:	pla
	_c141:	dex
	_c142:	bne $c114
	_c144:	rts
	_c145:	jsr $c155	;draw fright-o-meter
	_c148:	jsr $c18a
	_c14b:	jsr $c453
	_c14e:	jsr $c095
	_c151:	jsr $c3dd
	_c154:	rts
;-----------------------------------------------
frightometer	_c155:	lda #$80	;ptr to fright-o-meter within charset
	_c157:	sta $fd	;to fd/fe
	_c159:	lda #$58
	_c15b:	sta $fe
	_c15d:	lda $0938	;A=player panic level
	_c160:	ldy #$00	;Y=0 (default piccy no panic yet)
	_c162:	cmp #$0a	;if A<10
	_c164:	bcc $c16c	;then...
	_c166:	sec	;else a=a-10
	_c167:	sbc #$0a
	_c169:	iny	;panic pic-index++
	_c16a:	bne $c162	;test again
	_c16c:	tya
	_c16d:	and #$07	;(piccy index and 7)*2
	_c16f:	asl acc
	_c170:	tay
	_c171:	lda $c1db,y	;ptr to matching panic pic
	_c174:	clc
	_c175:	adc #$80
	_c177:	sta $fb	;to fb/fc
	_c179:	lda $c1dc,y
	_c17c:	adc #$2d
	_c17e:	sta $fc
	_c180:	ldy #$7f	;15 chars to copy
	_c182:	lda ($fb),y
	_c184:	sta ($fd),y
	_c186:	dey
	_c187:	bpl $c182
	_c189:	rts
;---end fright-o-meter---------------------------------------
draw timer	_c18a:	lda #$88	;base addr. mask display area
	_c18c:	sta $fd
	_c18e:	lda #$59
	_c190:	sta $fe
	_c192:	lda #$00	;base addr. mask piccy within charset
	_c194:	sta $fb
	_c196:	lda #$32
	_c198:	sta $fc
	_c19a:	ldy #$5f
	_c19c:	lda #$00	;wipe out piccy-chars
	_c19e:	sta ($fd),y
	_c1a0:	dey
	_c1a1:	bpl $c19e
	_c1a3:	lda $0821	;timer
	_c1a6:	sta $09ea	;->temp(?)
	_c1a9:	ldy #$00
	_c1ab:	lsr acc	;/2
	_c1ac:	sta $0822	;->822
	_c1af:	cmp #$00
	_c1b1:	beq $c1c9	;if=0 then...
	_c1b3:	lda ($fb),y	;else copy piccy
	_c1b5:	sta ($fd),y
	_c1b7:	tya	;every 8th byte
	_c1b8:	clc
	_c1b9:	adc #$08
	_c1bb:	tay
	_c1bc:	cmp #$60	;until all done
	_c1be:	bcc $c1c4
	_c1c0:	sec	;-back to start+1
	_c1c1:	sbc #$5f
	_c1c3:	tay
	_c1c4:	dec $0822	;repeat until timer/2=0
	_c1c7:	bne $c1b3
	_c1c9:	lda $09ea	;...
	_c1cc:	and #$01
	_c1ce:	tax
	_c1cf:	lda $c1d9,x
	_c1d2:	and ($fb),y
	_c1d4:	ora ($fd),y
	_c1d6:	sta ($fd),y
	_c1d8:	rts
	_c1d9:	brk
	_c1da:	beq $c1dc
	_c1dc:	brk
	_c1dd:	dat $80
	_c1de:	brk
	_c1df:	brk
	_c1e0:	ora ($80,x)
	_c1e2:	ora ($00,x)
	_c1e4:	dat $02
	_c1e5:	dat $80
	_c1e6:	dat $02
	_c1e7:	brk
	_c1e8:	dat $03
	_c1e9:	dat $80
	_c1ea:	dat $03
	_c1eb:	rts
	_c1ec:	sta $d418
	_c1ef:	lda #$00
	_c1f1:	sta $d404
	_c1f4:	lda #$10
	_c1f6:	sta $d401
	_c1f9:	lda #$04
	_c1fb:	sta $d405
	_c1fe:	lda #$00
	_c200:	sta $d406
	_c203:	lda #$81
	_c205:	sta $d404
	_c208:	rts
	_c209:	brk
	_c20a:	dat $03
	_c20b:	asl $09
	_c20d:	dat $0c
	_c20e:	sei
	_c20f:	dat $7b
	_c210:	ror $8481,x
	_c213:	lda $086a
	_c216:	bne $c21b
	_c218:	jsr $c28c
	_c21b:	lda $08b9
	_c21e:	asl acc
	_c21f:	tax
	_c220:	lda $a58c,x
	_c223:	sec
	_c224:	sbc #$01
	_c226:	cmp $086a
	_c229:	bne $c22e
	_c22b:	jsr $c2e2
	_c22e:	lda $086b
	_c231:	bne $c236
	_c233:	jsr $c24a
	_c236:	lda $08b9
	_c239:	asl acc
	_c23a:	tax
	_c23b:	lda $a58d,x
	_c23e:	sec
	_c23f:	sbc #$01
	_c241:	cmp $086b
	_c244:	bne $c249
	_c246:	jsr $c271
	_c249:	rts
	_c24a:	lda #$00
	_c24c:	clc
	_c24d:	adc #$90
	_c24f:	sta $fb
	_c251:	lda #$40
	_c253:	sta $fc
	_c255:	ldx #$04
	_c257:	ldy #$1f
	_c259:	lda #$55
	_c25b:	sta ($fb),y
	_c25d:	dey
	_c25e:	bpl $c25b
	_c260:	lda $fb
	_c262:	clc
	_c263:	adc #$40
	_c265:	sta $fb
	_c267:	lda $fc
	_c269:	adc #$01
	_c26b:	sta $fc
	_c26d:	dex
	_c26e:	bne $c257
	_c270:	rts
	_c271:	lda #$00
	_c273:	clc
	_c274:	adc #$50
	_c276:	sta $fb
	_c278:	lda #$40
	_c27a:	adc #$13
	_c27c:	sta $fc
	_c27e:	ldy #$1f
	_c280:	lda #$55
	_c282:	sta ($fb),y
	_c284:	tya
	_c285:	sec
	_c286:	sbc #$08
	_c288:	tay
	_c289:	bpl $c280
	_c28b:	rts
	_c28c:	lda #$00
	_c28e:	clc
	_c28f:	adc #$c8
	_c291:	sta $fb
	_c293:	lda #$40
	_c295:	adc #$02
	_c297:	sta $fc
	_c299:	lda #$00
	_c29b:	sta $0822
	_c29e:	ldy #$00
	_c2a0:	ldx $0822
	_c2a3:	jsr $c2c7
	_c2a6:	inc $0822
	_c2a9:	ldx $0822
	_c2ac:	jsr $c2c7
	_c2af:	lda $fb
	_c2b1:	clc
	_c2b2:	adc #$40
	_c2b4:	sta $fb
	_c2b6:	lda $fc
	_c2b8:	adc #$01
	_c2ba:	sta $fc
	_c2bc:	inc $0822
	_c2bf:	lda $0822
	_c2c2:	cmp #$0c
	_c2c4:	bcc $c29e
	_c2c6:	rts
	_c2c7:	lda $c368,x
	_c2ca:	asl acc
	_c2cb:	asl acc
	_c2cc:	asl acc
	_c2cd:	tax
	_c2ce:	lda #$08
	_c2d0:	sta $0823
	_c2d3:	lda ($fb),y
	_c2d5:	ora $0730,x
	_c2d8:	sta ($fb),y
	_c2da:	iny
	_c2db:	inx
	_c2dc:	dec $0823
	_c2df:	bne $c2d3
	_c2e1:	rts
	_c2e2:	lda #$00
	_c2e4:	clc
	_c2e5:	adc #$68
	_c2e7:	sta $fb
	_c2e9:	lda #$40
	_c2eb:	adc #$03
	_c2ed:	sta $fc
	_c2ef:	lda #$00
	_c2f1:	sta $0822
	_c2f4:	ldy #$00
	_c2f6:	ldx $0822
	_c2f9:	jsr $c31d
	_c2fc:	inc $0822
	_c2ff:	ldx $0822
	_c302:	jsr $c31d
	_c305:	lda $fb
	_c307:	clc
	_c308:	adc #$40
	_c30a:	sta $fb
	_c30c:	lda $fc
	_c30e:	adc #$01
	_c310:	sta $fc
	_c312:	inc $0822
	_c315:	lda $0822
	_c318:	cmp #$0c
	_c31a:	bcc $c2f4
	_c31c:	rts
	_c31d:	lda $c35c,x
	_c320:	asl acc
	_c321:	asl acc
	_c322:	asl acc
	_c323:	tax
	_c324:	lda #$08
	_c326:	sta $0823
	_c329:	lda $0822
	_c32c:	pha
	_c32d:	lda $0730,x
	_c330:	stx $bba8
	_c333:	ldx #$04
	_c335:	lsr acc
	_c336:	ror $0822
	_c339:	lsr acc
	_c33a:	rol $09e0
	_c33d:	asl $0822
	_c340:	rol $09e0
	_c343:	dex
	_c344:	bne $c335
	_c346:	ldx $bba8
	_c349:	lda ($fb),y
	_c34b:	ora $09e0
	_c34e:	sta ($fb),y
	_c350:	iny
	_c351:	inx
	_c352:	dec $0823
	_c355:	bne $c32d
	_c357:	pla
	_c358:	sta $0822
	_c35b:	rts
	_c35c:	ora ($00,x)
	_c35e:	dat $03
	_c35f:	dat $02
	_c360:	dat $03
	_c361:	dat $04
	_c362:	dat $03
	_c363:	dat $04
	_c364:	ora $04
	_c366:	dat $07
	_c367:	asl $00
	_c369:	ora ($02,x)
	_c36b:	dat $03
	_c36c:	dat $04
	_c36d:	dat $03
	_c36e:	dat $04
	_c36f:	dat $03
	_c370:	dat $04
	_c371:	ora $06
	_c373:	dat $07

	_c374:	pha	;copy bitmap into bitmapmem
	_c375:	txa
	_c376:	pha
	_c377:	tya
	_c378:	pha
	_c379:	lda #$00
	_c37b:	clc
	_c37c:	adc #$80
	_c37e:	sta $fb
	_c380:	sta $fd
	_c382:	lda #$54
	_c384:	adc #$02
	_c386:	sta $fc
	_c388:	clc
	_c389:	adc #$84
	_c38b:	sta $fe
	_c38d:	ldy #$00
	_c38f:	lda $08da	;room bg color
	_c392:	asl acc
	_c393:	asl acc
	_c394:	asl acc
	_c395:	asl acc
	_c396:	ora $08da	;room bg color
	_c399:	sta ($fb),y
	_c39b:	sta ($fd),y
	_c39d:	dey
	_c39e:	bne $c399
	_c3a0:	inc $fc
	_c3a2:	inc $fe
	_c3a4:	ldy #$67
	_c3a6:	sta ($fb),y
	_c3a8:	sta ($fd),y
	_c3aa:	dey
	_c3ab:	bpl $c3a6
	_c3ad:	lda $09b7
	_c3b0:	beq $c3ad
	_c3b2:	jsr $3600
	_c3b5:	lda #$00
	_c3b7:	clc
	_c3b8:	adc #$80
	_c3ba:	sta $fb
	_c3bc:	lda #$54
	_c3be:	adc #$02
	_c3c0:	sta $fc
	_c3c2:	lda #$20
	_c3c4:	ldy #$00
	_c3c6:	sta ($fb),y
	_c3c8:	dey
	_c3c9:	bne $c3c6
	_c3cb:	ldy #$67
	_c3cd:	inc $fc
	_c3cf:	sta ($fb),y
	_c3d1:	dey
	_c3d2:	bpl $c3cf
	_c3d4:	jsr $9bca
	_c3d7:	pla
	_c3d8:	tay
	_c3d9:	pla
	_c3da:	tax
	_c3db:	pla
	_c3dc:	rts

printscore	_c3dd:	ldx #$05	;print the 6 score digits
	_c3df:	ldy #$00
	_c3e1:	jsr $c3f3
	_c3e4:	dex
	_c3e5:	bpl $c3e1
	_c3e7:	lda $0a20	;last digit is always 5b (=0)
	_c3ea:	sta $56b5,y
	_c3ed:	lda #$03	;cyan color
	_c3ef:	sta $dab5,y
	_c3f2:	rts

	_c3f3:	lda $08dc,x	;score digits
	_c3f6:	clc
	_c3f7:	adc $0a20	;+petscii offset $5b
	_c3fa:	sta $56b5,y	;to screen
	_c3fd:	lda #$03	;cyan
	_c3ff:	sta $dab5,y	;to color mem
	_c402:	iny	;next pos
	_c403:	rts
;---end printscore

	_c404:	sta $09ec
	_c407:	txa
	_c408:	pha
	_c409:	tya
	_c40a:	pha
	_c40b:	ldx $09ec
	_c40e:	jsr $c419
	_c411:	dex
	_c412:	bne $c40e
	_c414:	pla
	_c415:	tay
	_c416:	pla
	_c417:	tax
	_c418:	rts
	_c419:	ldy #$00
	_c41b:	lda $08dc,y
	_c41e:	clc
	_c41f:	adc #$01
	_c421:	sta $08dc,y
	_c424:	cmp #$0a
	_c426:	bcc $c43b
	_c428:	lda #$00
	_c42a:	sta $08dc,y
	_c42d:	iny
	_c42e:	cpy #$06
	_c430:	bcc $c41b
	_c432:	dey
	_c433:	lda #$00
	_c435:	sta $08dc,y
	_c438:	dey
	_c439:	bpl $c435
	_c43b:	rts
	_c43c:	ldx #$09
	_c43e:	lda $090e,x	;camper status flag
	_c441:	and #$c0
	_c443:	cmp #$40
	_c445:	bne $c44f
	_c447:	lda $090e,x	;camper status flag
	_c44a:	and #$3f
	_c44c:	sta $090e,x	;camper status flag
	_c44f:	dex
	_c450:	bpl $c43e
	_c452:	rts
	_c453:	lda $0943
	_c456:	lsr acc
	_c457:	lsr acc
	_c458:	pha
	_c459:	and #$07
	_c45b:	sta $0a1c
	_c45e:	pla
	_c45f:	lsr acc
	_c460:	lsr acc
	_c461:	lsr acc
	_c462:	sta $0a1d
	_c465:	lda #$00
	_c467:	sta $0a1b
	_c46a:	ldy #$00
	_c46c:	jsr $c488
	_c46f:	ldx #$00
	_c471:	lda $09fb,x
	_c474:	sta $5908,y
	_c477:	iny
	_c478:	inx
	_c479:	cpx #$20
	_c47b:	bcc $c471
	_c47d:	inc $0a1b
	_c480:	lda $0a1b
	_c483:	cmp #$04
	_c485:	bcc $c46c
	_c487:	rts
	_c488:	tya
	_c489:	pha
	_c48a:	lda $0a1d
	_c48d:	clc
	_c48e:	adc $0a1b
	_c491:	asl acc
	_c492:	asl acc
	_c493:	asl acc
	_c494:	asl acc
	_c495:	asl acc
	_c496:	clc
	_c497:	adc $0a1c
	_c49a:	and #$7f
	_c49c:	tay
	_c49d:	ldx #$00
	_c49f:	lda $3180,y
	_c4a2:	sta $09fb,x
	_c4a5:	lda $3188,y
	_c4a8:	sta $0a03,x
	_c4ab:	lda $3190,y
	_c4ae:	sta $0a0b,x
	_c4b1:	lda $3198,y
	_c4b4:	sta $0a13,x
	_c4b7:	iny
	_c4b8:	tya
	_c4b9:	and #$07
	_c4bb:	bne $c4c2
	_c4bd:	tya
	_c4be:	clc
	_c4bf:	adc #$18
	_c4c1:	tay
	_c4c2:	tya
	_c4c3:	and #$7f
	_c4c5:	tay
	_c4c6:	inx
	_c4c7:	cpx #$08
	_c4c9:	bcc $c49f
	_c4cb:	pla
	_c4cc:	tay
	_c4cd:	rts
	_c4ce:	sta $0819
	_c4d1:	sei
	_c4d2:	lda #$00
	_c4d4:	sta $081d
	_c4d7:	sta $081e
	_c4da:	sta $081f
	_c4dd:	lda $0314
	_c4e0:	cmp #$fa
	_c4e2:	bne $c4eb
	_c4e4:	lda $0315
	_c4e7:	cmp #$c5
	_c4e9:	beq $c501
	_c4eb:	lda $0314
	_c4ee:	sta $080a
	_c4f1:	lda $0315
	_c4f4:	sta $080b
	_c4f7:	lda #$fa
	_c4f9:	sta $0314
	_c4fc:	lda #$c5
	_c4fe:	sta $0315
	_c501:	jsr $c811	;switch between normal/music zp&bank
	_c504:	lda #$01
	_c506:	sta $081a
	_c509:	ldx $0819
	_c50c:	lda $c8d1,x
	_c50f:	sta $081b
	_c512:	lda $c8d8,x
	_c515:	sta $0812
	_c518:	lda $0819
	_c51b:	asl acc
	_c51c:	tax
	_c51d:	lda $c8c3,x
	_c520:	sta $fb
	_c522:	sta $080c
	_c525:	inx
	_c526:	lda $c8c3,x
	_c529:	sta $fc
	_c52b:	sta $080d
	_c52e:	ldy #$00
	_c530:	ldx #$00
	_c532:	lda ($fb),y
	_c534:	cmp #$ff
	_c536:	beq $c53f
	_c538:	iny
	_c539:	bne $c532
	_c53b:	inc $fc
	_c53d:	bne $c532
	_c53f:	cpx #$02
	_c541:	bcs $c55b
	_c543:	iny
	_c544:	tya
	_c545:	dey
	_c546:	clc
	_c547:	adc $fb
	_c549:	sta $fd,x
	_c54b:	sta $080e,x
	_c54e:	lda $fc
	_c550:	adc #$00
	_c552:	inx
	_c553:	sta $fd,x
	_c555:	sta $080e,x
	_c558:	inx
	_c559:	bne $c538
	_c55b:	iny
	_c55c:	tya
	_c55d:	clc
	_c55e:	adc $fb
	_c560:	sta $8b
	_c562:	sta $0810
	_c565:	lda $fc
	_c567:	adc #$00
	_c569:	sta $8c
	_c56b:	sta $0811
	_c56e:	lda $0819
	_c571:	asl acc
	_c572:	tax
	_c573:	lda $c8c3,x
	_c576:	sta $fb
	_c578:	inx
	_c579:	lda $c8c3,x
	_c57c:	sta $fc
	_c57e:	ldy #$0d
	_c580:	lda #$00
	_c582:	sta $d400,y
	_c585:	dey
	_c586:	bpl $c582
	_c588:	sta $d412
	_c58b:	lda #$01
	_c58d:	sta $0806
	_c590:	sta $0807
	_c593:	sta $0808
	_c596:	ldx #$02
	_c598:	ldy #$00
	_c59a:	lda ($fb),y
	_c59c:	sta $d400,x
	_c59f:	lda ($fd),y
	_c5a1:	sta $d407,x
	_c5a4:	lda ($8b),y
	_c5a6:	sta $d40e,x
	_c5a9:	inx
	_c5aa:	iny
	_c5ab:	cpy #$05
	_c5ad:	bcc $c59a
	_c5af:	ldy #$02
	_c5b1:	lda ($fb),y
	_c5b3:	sta $0803
	_c5b6:	lda ($fd),y
	_c5b8:	sta $0804
	_c5bb:	lda ($8b),y
	_c5bd:	sta $0805
	_c5c0:	ldy #$05
	_c5c2:	tya
	_c5c3:	clc
	_c5c4:	adc $fb
	_c5c6:	sta $fb
	_c5c8:	bcc $c5cc
	_c5ca:	inc $fc
	_c5cc:	tya
	_c5cd:	clc
	_c5ce:	adc $fd
	_c5d0:	sta $fd
	_c5d2:	bcc $c5d6
	_c5d4:	inc $fe
	_c5d6:	tya
	_c5d7:	clc
	_c5d8:	adc $8b
	_c5da:	sta $8b
	_c5dc:	bcc $c5e0
	_c5de:	inc $8c
	_c5e0:	lda #$0a
	_c5e2:	sta $081c
	_c5e5:	lda #$01
	_c5e7:	sta $0800
	_c5ea:	sta $0801
	_c5ed:	sta $0802
	_c5f0:	lda #$0f
	_c5f2:	sta $d418
	_c5f5:	jsr $c811	;switch between normal/music zp&bank
	_c5f8:	cli
	_c5f9:	rts
;----------------------------------------------------------------------------------------
ingameirq	_c5fa:	lda $d011	;theres two irqs, one at $b2 and one at $100
	_c5fd:	bpl $c607	;if at $b2 then a723
	_c5ff:	dec $081c	;else metronome--
	_c602:	beq $c60a	;if time for new notes
	_c604:	jmp $a7a1	;else
	_c607:	jmp $a723
	_c60a:	lda $081b	;reset metronome to songspeed
	_c60d:	sta $081c
	_c610:	jsr $c811	;switch between normal/music zp&bank
	_c613:	dec $0800
	_c616:	bne $c663
	_c618:	lda $0803
	_c61b:	eor $0806
	_c61e:	sta $d404
	_c621:	ldy #$01
	_c623:	lda ($fb),y
	_c625:	sta $0800
	_c628:	dey
	_c629:	lda ($fb),y
	_c62b:	cmp #$80
	_c62d:	bcc $c647
	_c62f:	cmp #$ff
	_c631:	beq $c63d
	_c633:	ldx #$00
	_c635:	ldy #$00
	_c637:	jsr $c780
	_c63a:	jmp $c621
	_c63d:	lda #$00
	_c63f:	sta $0803
	_c642:	sta $0806
	_c645:	beq $c663
	_c647:	cmp #$00
	_c649:	beq $c64f
	_c64b:	clc
	_c64c:	adc $081d
	_c64f:	jsr $c752
	_c652:	stx $d401
	_c655:	sta $d400
	_c658:	lda $fb
	_c65a:	clc
	_c65b:	adc #$02
	_c65d:	sta $fb
	_c65f:	bcc $c663
	_c661:	inc $fc
	_c663:	dec $0801
	_c666:	bne $c6b3
	_c668:	lda $0804
	_c66b:	eor $0807
	_c66e:	sta $d40b
	_c671:	ldy #$01
	_c673:	lda ($fd),y
	_c675:	sta $0801
	_c678:	dey
	_c679:	lda ($fd),y
	_c67b:	cmp #$80
	_c67d:	bcc $c697
	_c67f:	cmp #$ff
	_c681:	beq $c68d
	_c683:	ldx #$07
	_c685:	ldy #$01
	_c687:	jsr $c780
	_c68a:	jmp $c671
	_c68d:	lda #$00
	_c68f:	sta $0804
	_c692:	sta $0807
	_c695:	beq $c6b3
	_c697:	cmp #$00
	_c699:	beq $c69f
	_c69b:	clc
	_c69c:	adc $081e
	_c69f:	jsr $c752
	_c6a2:	stx $d408
	_c6a5:	sta $d407
	_c6a8:	lda $fd
	_c6aa:	clc
	_c6ab:	adc #$02
	_c6ad:	sta $fd
	_c6af:	bcc $c6b3
	_c6b1:	inc $fe
	_c6b3:	dec $0802
	_c6b6:	bne $c703
	_c6b8:	lda $0805
	_c6bb:	eor $0808
	_c6be:	sta $d412
	_c6c1:	ldy #$01
	_c6c3:	lda ($8b),y
	_c6c5:	sta $0802
	_c6c8:	dey
	_c6c9:	lda ($8b),y
	_c6cb:	cmp #$80
	_c6cd:	bcc $c6e7
	_c6cf:	cmp #$ff
	_c6d1:	beq $c6dd
	_c6d3:	ldx #$0e
	_c6d5:	ldy #$02
	_c6d7:	jsr $c780
	_c6da:	jmp $c6c1
	_c6dd:	lda #$00
	_c6df:	sta $0805
	_c6e2:	sta $0808
	_c6e5:	beq $c703
	_c6e7:	cmp #$00
	_c6e9:	beq $c6ef
	_c6eb:	clc
	_c6ec:	adc $081f
	_c6ef:	jsr $c752
	_c6f2:	stx $d40f
	_c6f5:	sta $d40e
	_c6f8:	lda $8b
	_c6fa:	clc
	_c6fb:	adc #$02
	_c6fd:	sta $8b
	_c6ff:	bcc $c703
	_c701:	inc $8c
	_c703:	lda $0803
	_c706:	ora $0806
	_c709:	sta $d404
	_c70c:	lda $0804
	_c70f:	ora $0807
	_c712:	sta $d40b
	_c715:	lda $0805
	_c718:	ora $0808
	_c71b:	sta $d412
	_c71e:	lda $0803
	_c721:	ora $0804
	_c724:	ora $0805
	_c727:	beq $c72f
	_c729:	jsr $c811	;switch between normal/music zp&bank
	_c72c:	jmp $a7a1
	_c72f:	lda $0812
	_c732:	beq $c73a
	_c734:	jsr $c7cf
	_c737:	jmp $a7a1
	_c73a:	sei
	_c73b:	lda $080a
	_c73e:	sta $0314
	_c741:	lda $080b
	_c744:	sta $0315
	_c747:	jsr $c811	;switch between normal/music zp&bank
	_c74a:	lda #$00
	_c74c:	sta $081a
	_c74f:	jmp $a7a1
	_c752:	cmp #$00
	_c754:	bne $c759
	_c756:	ldx #$00
	_c758:	rts
	_c759:	ldx #$07
	_c75b:	dex
	_c75c:	sec
	_c75d:	sbc #$0c
	_c75f:	bpl $c75b
	_c761:	clc
	_c762:	adc #$0c
	_c764:	inx
	_c765:	asl acc
	_c766:	tay
	_c767:	lda $c86a,y
	_c76a:	sta $0809
	_c76d:	iny
	_c76e:	lda $c86a,y
	_c771:	cpx #$00
	_c773:	beq $c77c
	_c775:	lsr $0809
	_c778:	ror acc
	_c779:	dex
	_c77a:	bne $c775
	_c77c:	ldx $0809
	_c77f:	rts
	_c780:	and #$7f
	_c782:	cmp #$04
	_c784:	bcc $c787
	_c786:	rts
	_c787:	sty $0809
	_c78a:	asl acc
	_c78b:	tay
	_c78c:	iny
	_c78d:	lda $c882,y
	_c790:	pha
	_c791:	dey
	_c792:	lda $c882,y
	_c795:	pha
	_c796:	ldy $0809
	_c799:	rts
	_c79a:	lda $0800,y
	_c79d:	sta $0803,y
	_c7a0:	ldy #$02
	_c7a2:	jmp $c7f0
	_c7a5:	txa
	_c7a6:	clc
	_c7a7:	adc #$05
	_c7a9:	tax
	_c7aa:	lda $0800,y
	_c7ad:	sta $d400,x
	_c7b0:	ldy #$02
	_c7b2:	jmp $c7f0
	_c7b5:	txa
	_c7b6:	clc
	_c7b7:	adc #$06
	_c7b9:	tax
	_c7ba:	lda $0800,y
	_c7bd:	sta $d400,x
	_c7c0:	ldy #$02
	_c7c2:	jmp $c7f0
	_c7c5:	lda #$01
	_c7c7:	sta $0812
	_c7ca:	ldy #$01
	_c7cc:	jmp $c7f0
	_c7cf:	lda $080c
	_c7d2:	sta $fb
	_c7d4:	lda $080d
	_c7d7:	sta $fc
	_c7d9:	lda $080e
	_c7dc:	sta $fd
	_c7de:	lda $080f
	_c7e1:	sta $fe
	_c7e3:	lda $0810
	_c7e6:	sta $8b
	_c7e8:	lda $0811
	_c7eb:	sta $8c
	_c7ed:	jmp $c57e
	_c7f0:	tya
	_c7f1:	pha
	_c7f2:	ldy $0809
	_c7f5:	ldx #$fb
	_c7f7:	cpy #$00
	_c7f9:	beq $c803
	_c7fb:	ldx #$fd
	_c7fd:	cpy #$01
	_c7ff:	beq $c803
	_c801:	ldx #$8b
	_c803:	pla
	_c804:	clc
	_c805:	adc $00,x
	_c807:	sta $00,x
	_c809:	inx
	_c80a:	lda $00,x
	_c80c:	adc #$00
	_c80e:	sta $00,x
	_c810:	rts
;----------------------------------------------
switchzp&bank	_c811:	lda #$0f	;full volume
	_c813:	sta $d418
	_c816:	ldx $fb	;copy fb/fc to 813/814
	_c818:	lda $0813	;copy 813/814 to fb/fc
	_c81b:	sta $fb
	_c81d:	stx $0813
	_c820:	ldx $fc
	_c822:	lda $0814
	_c825:	sta $fc
	_c827:	stx $0814
	_c82a:	ldx $fd	;copy fd/fe to 815/16
	_c82c:	lda $0815	;copy 815/16 to fd/fe
	_c82f:	sta $fd
	_c831:	stx $0815
	_c834:	ldx $fe
	_c836:	lda $0816
	_c839:	sta $fe
	_c83b:	stx $0816
	_c83e:	ldx $8b	;copy 8b/8c to 817/818
	_c840:	lda $0817	;copy 817/18 to 8b/8c
	_c843:	sta $8b
	_c845:	stx $0817
	_c848:	ldx $8c
	_c84a:	lda $0818
	_c84d:	sta $8c
	_c84f:	stx $0818
	_c852:	lda $01	;if bank =%xx1x
	_c854:	and #$02
	_c856:	bne $c861	;then...
	_c858:	lda $01	;else bank %xx1x
	_c85a:	ora #$02
	_c85c:	and #$fe
	_c85e:	sta $01
	_c860:	rts
	_c861:	lda $01	;bank %xx01
	_c863:	and #$fd
	_c865:	ora #$01
	_c867:	sta $01
	_c869:	rts
;------end switch zp&bank-------------------------------------
	_c86a:	sta ($78,x)
	_c86c:	dat $89
	_c86d:	dat $2b
	_c86e:	sta ($53),y
	_c870:	sta $a3f7,y
	_c873:	dat $1f
	_c874:	ldy $b7d2
	_c877:	ora $fcc1,y
	_c87a:	cmp $d985
	_c87d:	lda $b3e6,x
	_c880:	dat $f4
	_c881:	dat $67
	_c882:	cpy $c7
	_c884:	sta $a4c7,y
	_c887:	dat $c7
	_c888:	ldy $c7,x

	_c88a:	sei	;setup some table?
	_c88b:	lda #$c0
	_c88d:	sta $0813
	_c890:	sta $0815
	_c893:	sta $0817
	_c896:	lda #$c8
	_c898:	sta $0814
	_c89b:	sta $0816
	_c89e:	sta $0818
	_c8a1:	lda #$00
	_c8a3:	sta $0812
	_c8a6:	lda #$01
	_c8a8:	sta $0800
	_c8ab:	sta $0801
	_c8ae:	sta $0802
	_c8b1:	sta $081b
	_c8b4:	sta $081c
	_c8b7:	cli
	_c8b8:	lda $0315	;while irq=??c5
	_c8bb:	cmp #$c5
	_c8bd:	beq $c8b8	;endwhile (?)
	_c8bf:	rts

	_c8c0:	brk
	_c8c1:	ora ($ff,x)
	_c8c3:	brk
	_c8c4:	cpx #$f6
	_c8c6:	cpx $28
	_c8c8:	inc $12
	_c8ca:	nop
	_c8cb:	tya
	_c8cc:	dat $eb
	_c8cd:	dat $63
	_c8ce:	cpx $edc9
	_c8d1:	dat $03
	_c8d2:	dat $03
	_c8d3:	dat $03
	_c8d4:	dat $03
	_c8d5:	asl $01
	_c8d7:	dat $02
	_c8d8:	ora ($00,x)
	_c8da:	brk
	_c8db:	brk
	_c8dc:	brk
	_c8dd:	brk
	_c8de:	brk

	_c8df:	ldx #$09
	_c8e1:	lda $090e,x	;camper status flag
	_c8e4:	bne $c8ee
	_c8e6:	lda $08e2,x
	_c8e9:	cmp $08ec
	_c8ec:	beq $c8f2
	_c8ee:	dex
	_c8ef:	bpl $c8e1
	_c8f1:	rts

	_c8f2:	lda $09f1,x 	;if ?-flag set
	_c8f5:	bne $c91e	;then...
	_c8f7:	lda #$01	;else
	_c8f9:	sta $09f1,x	;set ?-flag
	_c8fc:	lda #$32	;rnd max=32-1
	_c8fe:	jsr $b4a7	;calc random value
	_c901:	cmp #$28	;if<$28
	_c903:	bcc $c91e
	_c905:	ldx $09ee	;then add twice the character-specific
	_c908:	lda $941c,x	;panic-value
	_c90b:	asl acc
	_c90c:	clc
	_c90d:	adc $0938	;to panic level
	_c910:	sta $0938
	_c913:	cmp #$51	;max $50=80
	_c915:	bcc $c91f
	_c917:	lda #$50
	_c919:	sta $0938
	_c91c:	bne $c91f
	_c91e:	rts

	_c91f:	jsr $a911	;blank part of bitmap
	_c922:	lda #$00
	_c924:	sta $08da	;room bg color
	_c927:	sta $d021	;black screen
	_c92a:	jsr $c931	;random splatter pic
	_c92d:	jsr $c374
	_c930:	rts

	_c931:	sei	;turn off irqs
	_c932:	lda $01	;bank out kernal
	_c934:	and #$fd
	_c936:	ora #$01
	_c938:	sta $01
	_c93a:	lda #$28
	_c93c:	jsr $b4a7	;if ($28-1)*rnd(sid)
	_c93f:	cmp #$14	;>=$14
	_c941:	bcs $c959	;then...
	_c943:	lda #$00	;else
	_c945:	sta $0a1e
	_c948:	lda #$f0
	_c94a:	sta $0a1f
	_c94d:	lda #$07
	_c94f:	sta $0822
	_c952:	lda #$09
	_c954:	sta $0823
	_c957:	bne $c96d

	_c959:	lda #$30	;...
	_c95b:	sta $0a1e
	_c95e:	lda #$f9
	_c960:	sta $0a1f
	_c963:	lda #$03
	_c965:	sta $0822
	_c968:	lda #$01
	_c96a:	sta $0823
	_c96d:	jsr $c9e9	;print shocking gfx
	_c970:	lda #$00
	_c972:	clc
	_c973:	adc #$20
	_c975:	sta $fb
	_c977:	lda #$40
	_c979:	sta $fc
	_c97b:	lda $0a1e
	_c97e:	sta $fd
	_c980:	lda $0a1f
	_c983:	sta $fe
	_c985:	lda #$10
	_c987:	sta $08d9
	_c98a:	ldy #$00
	_c98c:	tya
	_c98d:	pha
	_c98e:	ldy #$00
	_c990:	sty $0822
	_c993:	lda ($fd),y
	_c995:	asl acc
	_c996:	rol $0822
	_c999:	asl acc
	_c99a:	rol $0822
	_c99d:	asl acc
	_c99e:	rol $0822
	_c9a1:	clc
	_c9a2:	adc $0a1e
	_c9a5:	sta $c9b9
	_c9a8:	lda $0822
	_c9ab:	adc $0a1f
	_c9ae:	clc
	_c9af:	adc #$02
	_c9b1:	sta $c9ba
	_c9b4:	pla
	_c9b5:	tay
	_c9b6:	ldx #$00
	_c9b8:	lda $1200,x
	_c9bb:	sta ($fb),y
	_c9bd:	inx
	_c9be:	iny
	_c9bf:	cpx #$08
	_c9c1:	bcc $c9b8
	_c9c3:	inc $fd
	_c9c5:	bne $c9c9
	_c9c7:	inc $fe
	_c9c9:	cpy #$00
	_c9cb:	bne $c98c
	_c9cd:	lda $fb
	_c9cf:	clc
	_c9d0:	adc #$40
	_c9d2:	sta $fb
	_c9d4:	lda $fc
	_c9d6:	adc #$01
	_c9d8:	sta $fc
	_c9da:	dec $08d9
	_c9dd:	bne $c98a
	_c9df:	lda $01
	_c9e1:	and #$fe
	_c9e3:	ora #$02
	_c9e5:	sta $01
	_c9e7:	cli
	_c9e8:	rts
	_c9e9:	lda $0a1e
	_c9ec:	clc
	_c9ed:	adc #$30
	_c9ef:	sta $fb
	_c9f1:	lda $0a1f
	_c9f4:	adc $0822
	_c9f7:	sta $fc
	_c9f9:	lda #$54
	_c9fb:	sta $fe
	_c9fd:	lda #$d8
	_c9ff:	sta $8c
	_ca01:	lda #$04
	_ca03:	sta $fd
	_ca05:	sta $8b
	_ca07:	lda #$10
	_ca09:	sta $08d9
	_ca0c:	ldy #$1f
	_ca0e:	lda ($fb),y
	_ca10:	sta ($fd),y
	_ca12:	lda $0823
	_ca15:	sta ($8b),y
	_ca17:	dey
	_ca18:	bpl $ca0e
	_ca1a:	lda $fb
	_ca1c:	clc
	_ca1d:	adc #$20
	_ca1f:	sta $fb
	_ca21:	lda $fc
	_ca23:	adc #$00
	_ca25:	sta $fc
	_ca27:	lda $fd
	_ca29:	clc
	_ca2a:	adc #$28
	_ca2c:	sta $fd
	_ca2e:	lda $fe
	_ca30:	adc #$00
	_ca32:	sta $fe
	_ca34:	lda $8b
	_ca36:	clc
	_ca37:	adc #$28
	_ca39:	sta $8b
	_ca3b:	lda $8c
	_ca3d:	adc #$00
	_ca3f:	sta $8c
	_ca41:	dec $08d9
	_ca44:	bne $ca0c
	_ca46:	rts
	_ca47:	ldx #$05
	_ca49:	lda $08ec
	_ca4c:	cmp $ca61,x
	_ca4f:	beq $ca55
	_ca51:	dex
	_ca52:	bpl $ca4c
	_ca54:	rts
	_ca55:	lda $0819
	_ca58:	beq $ca5b
	_ca5a:	rts
	_ca5b:	inx
	_ca5c:	txa
	_ca5d:	jsr $c4ce
	_ca60:	rts
	_ca61:	dey
	_ca62:	sta ($10,x)
	_ca64:	dat $ff
	_ca65:	cpy #$13
	_ca67:	brk
;---------------------------------------------;
