Atari Vcs 2600 Pitfall Labeled Source Assembler Code

  • Uploaded by: AlainleGuirec
  • 0
  • 0
  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Atari Vcs 2600 Pitfall Labeled Source Assembler Code as PDF for free.

More details

  • Words: 14,340
  • Pages: 59
; *** P I T F A L L ! *** ; Copyright 1982 Activision ; Designer: David Crane ; Analyzed, labeled and commented ; by Thomas Jentzsch (JTZ) ; Last Update: 09.10.2001 (v0.9) ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;

Scene generation: The 255 scenes are randomly generated through a "bidirecional" LFSR. This means, that the process of generating the next random number is reversible, which is necessary to allow traveling though the jungle in both directions. The random number defines the scene with the following bits: - 0..2: type of object(s) on the ground (logs, fire, cobra, treasure etc.) - 3..5: type of scene (holes, pits, crocdiles, treasures etc.) - 6..7: type of the tree pattern - 7 : position of the wall (left or right) Kernel: The kernel is very large. There are special loops for several horizontal stripes. Before the main kernel the game draws the score and the lives with the timer. Then follow nine stripes, which do: 1. draw the trees and the branches 2. draw the top of the liana and x-position Harry and the ground object 3. draw Harry and the middle of the liana 4. draw Harry and the bottom of the liana 5. draw Harry and the top of the ground object 6. draw the bottom of the ground object and the top of the holes/pits (no Harry) 7. draw Harry, holes/pits and the top of the ladder 8. draw Harry, the ladder and the top of the wall 9. draw Harry, the bottom of the ladder and the wall or the scorpion Finally after that, the copyright message is drawn. Misc: - The game speeds aren't adjusted for PAL, the PAL game run's about 16% slower. (This seems to be true for most PAL conversions.). - The timer is also running slower, it would have been quite easy to adjust that (s. FRAMERATE etc.). processor 6502 include vcs.h

;=============================================================================== ; A S S E M B L E R - S W I T C H E S ;=============================================================================== OPTIMIZE FILL_OPT SCREENSAVER TRAINER NTSC IF NTSC FRAMERATE STARTTIME ELSE FRAMERATE

= = = = =

0 1 1 0 1

; ; ; ; ;

enable some possible optimizations fill optimized bytes with NOPs compile with screensaver code enable training mode compile for NTSC

= 60 = $20 = 60

; 50

use these values to..

STARTTIME ENDIF

= $20

; $24

..adjust the PAL timer

;=============================================================================== ; C O N S T A N T S ;=============================================================================== ; initial value for the random number generator: RAND_SEED = $c4 ; defines the start scene of the game ; color constants: IF NTSC BROWN = $12 YELLOW = $1e ORANGE = $3e RED = $48 GREEN = $d6 BLUE = $a4 YELLOW_GREEN = $c8 PINK = $4a ELSE BROWN = $22 YELLOW = $2e ORANGE = $4e RED = $68 GREEN = $56 BLUE = $b4 YELLOW_GREEN = $78 PINK = $4a ENDIF BLACK = $00 GREY = $06 WHITE = $0e DARK_GREEN = GREEN DARK_RED = RED ; x constants: SCREENWIDTH XMIN_HARRY XMAX_HARRY

- $04 - $06

= 160 = 8 = 148

; y-size constants: HARRY_H = 22 OBJECT_H = 16 DIGIT_H = 8 COPYRIGHT_H = 16 ; some defined y-positions of Harry: JUNGLE_GROUND = 32 UNDER_GROUND = 86 ; positions of Harry at ladder: LADDER_TOP = 11 LADDER_BOTTOM = 22 ; lenght of a jump: JUMP_LEN = 32

; minimal position before next left scene ; maximal position before next right scene ; ; ; ;

height of Harry maximum object height height of the score and time digits height of copyright message

; Harry pattern ID_KNEEING ID_RUNNING4 ID_STANDING ID_SWINGING ID_CLIMBING

ids: = 0 = 4 = 5 = 6 = 7

; objectType ids: ID_STATIONARY = ID_FIRE = ID_COBRA = ID_TREASURES = ID_NOTHING =

4 6 7 8 12

; 0..3 are running ids too

; stationary logs (0..5 are log types) ; 8..11 are treasures

; sceneType constants: HOLE1_SCENE = 0 HOLE3_SCENE = 1 CROCO_SCENE = 4 TREASURE_SCENE = 5 ; flags for ladder: NOLADDER = %00000000 WITHLADDER = %11111111 ; flags for pit color: BLUEPIT = %00000000 BLACKPIT = %10000000 ; offsets in SoundTab for tunes: SOUND_JUMP = $20 SOUND_TREASURE = $25 SOUND_DEAD = $31 SOUND_FALLING = $53

; ; ; ;

Harry Harry Harry Harry

is is is is

jumping collecting a treasure killed falling into a hole

; values for NUSIZx: ONE_COPY = %000 TWO_COPIES = %001 TWO_WIDE_COPIES = %010 THREE_COPIES = %011 DOUBLE_SIZE = %101 THREE_MED_COPIES = %110 QUAD_SIZE = %111 ; mask for SWCHB: BW_MASK = %1000 ; SWCHA joystick bits: MOVE_RIGHT = %0111 MOVE_LEFT = %1011 MOVE_DOWN = %1101 MOVE_UP = %1110 NO_MOVE = %1111 JOY_RIGHT = ~MOVE_RIGHT & NO_MOVE JOY_LEFT = ~MOVE_LEFT & NO_MOVE JOY_DOWN = ~MOVE_DOWN & NO_MOVE JOY_UP = ~MOVE_UP & NO_MOVE JOY_HORZ = JOY_RIGHT|JOY_LEFT

; black and white bit

JOY_VERT

= JOY_DOWN |JOY_UP

; values for ENAxy: DISABLE = %00 ENABLE = %10

; value for enabling a missile

; values for REFPx: NOREFLECT = %0000 REFLECT = %1000 ;=============================================================================== ; Z P - V A R I A B L E S ;=============================================================================== SEG.U ORG

Variables $80

livesPat .byte ; pattern ($a0 = 3, $80 = 2, $00 = 1) random .byte ; this random2 .byte ; joystick .byte ; fireButton .byte ; hitLiana .byte ; yes) cxHarry .byte ; read!) IF SCREENSAVER SS_XOR .byte ; (0/$01..$ff) SS_Mask .byte ; ($ff/$f7) ELSE dummy .word ENDIF colorLst ds 9 ; lianaBottom .byte ; objectType .byte ; & treasures) sceneType .byte ; HMFineLst ds 3 ; object, underground-object HMCoarseLst ds 3 ; ground-object, underground-object posLeftBranch .byte ; graphics posRightBranch .byte ; graphics ladderFlag .byte ; noGameScroll .byte ; PF2QuickSand .byte ; PF2Lst ds 7 ; objColLst ds 7 ; objPatLst ds 7 ; harryPatPtr .word ; = $b5 objPatPtr .word ;

number of lives, stored as displayed all scenes are generated randomly with used for random object animation stores joystick directions stores fire button state Harry collided with liana? (bit 6 = 1 -> Harry's collisions (stored but _never_ change colors in screensaver mode darker colors in screensaver mode

some (mostly constant!?) colors bottom row of liana type of the objects on the ground (hazards type of the scene (0..7 fine positioning value for: Harry, groundcoars positioning value for: Harry, values for positioning left branch values for positioning right branch 0 = no ladder, $ff = with ladder 0 = game is running PF2 data for top quicksand row copied pit pattern data copied object colors copied object patterns pointer to Pitfall Harry patterns pointer to object (hazards, treasure)

patterns harryColPtr objColPtr colors wallPatPtr wallColPtr undrPatPtr scorpion) patterns undrColPtr scorpion) colors digitPtr IF SCREENSAVER SS_Delay SS_DelayLo ENDIF frameCnt nusize1 scoreHi scoreMed scoreLo timerHi timerMed timerLo hmblSum hmblAdd hmblDir lianaPosHi lianaPosLo soundIdx xPosHarry xPosObject xPosScorpion patIdHarry reflectHarry reflectScorpion jumpIndex oldJoystick yPosHarry atLiana treePat climbPos treasureBits found treasureCnt patOfsHarry soundDelay xPosQuickSand jumpMode temp1 temp2 temp3

.word .word

; ;

pointer to Pitfall Harry colors pointer to object (hazards, treasure)

.word .word .word

; ; ;

pointer to wall patterns pointer to wall colors pointer to underground object (wall,

.word

;

pointer to underground object (wall,

ds.w 6

;

pointers for score display

.byte .byte

; = $d1

.byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte ds 4

; ; ;

frame counter (increased every frame) number of ground-objects 3 BCD score bytes

;

2 BCD timer bytes

; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;

decease timer every 60th frame used to generate liana line depends on the liana angle move liana +/-1 high x-position of liana bottom low x-position of liana bottom index of sound-table (0 = no sound) x-position of Pitfall Harry x-position of hazards & treasures x-position of the scorpion (and the wall) id of the animation for Harry reflect Harry graphics reflect scorpion graphics index of jump-table (0..32) saved old joystick direction y-position of Pitfall Harry Harry at liana? (0 = no, -1 = yes) id of the leaves pattern (0..3) position of Harry at ladder (0/11..22) remember which treasures haven't been

.byte .byte .byte .byte .byte .byte .byte .byte

; = $f1 ; ; ; ; = $f5

number of remaining treasures-1 pattern offset (5 while kneeing, 0 else) play a new note every 4th frame border of quicksand similar to jumpIndex (JTZ: superfluous?)

;=============================================================================== ; M A C R O S ;=============================================================================== MAC FILL_NOP

IF FILL_OPT REPEAT {1} NOP REPEND ENDIF ENDM ;=============================================================================== ; R O M - C O D E (Part 1) ;=============================================================================== SEG ORG

Code $f000, 0

START: sei cld ldx #$00 Reset: lda #$00 .loopClear: sta $00,x txs inx bne .loopClear jsr

InitGame

MainLoop: ldx #8 .loopColors: lda ColorTab,x IF SCREENSAVER eor SS_XOR and SS_Mask ELSE FILL_NOP 4 ENDIF sta colorLst,x cpx #4 bcs .skipTIA sta COLUP0,x .skipTIA: dex bpl .loopColors ; ; ; ; ;

; 2 ; 2 ; 2 ; 2 ; ; ; ;

4 2 2 2�

; 6 ; 2 ; 4 ; 3 ; 3

; ; ; ;

4 2 2� 4

store color in list store color in TIA too

; 2 ; 2�

process underground objects (scorpion, wall): Only one object at a time is visible, but two different pointer sets are used, because the wall is much taller than the scorpion. JTZ: two color pointers aren't necessary! ldy #<ScorpionColor ; 2 ldx #<Scorpion0 ; 2 lda xPosScorpion ; 3 lsr ; 2 animate scorpion bcc .scorpion0 ; 2� ldx #<Scorpion1 ; 2

.scorpion0: lda #
; 2 ; 3

ladderFlag .noLadder #<WallColor #<Wall wallPatPtr wallColPtr

; ; ; ; ; ;

undrPatPtr undrColPtr

; 3 ; 3

; calculate pits, quicksand ldx sceneType lda LadderTab,x bpl .noPit lda colorLst+4 sta colorLst+8 .noPit: ldy #0 lda GroundTypeTab,x bpl .noQuickSand lda yPosHarry cmp #55 bcs .doQuickSand cmp #JUNGLE_GROUND+1 bcs .stopQuickSand .doQuickSand: lda noGameScroll bne .stopQuickSand lda frameCnt lsr lsr pha lsr lsr lsr lsr tax pla used and QuickSandTab+2,x pit eor QuickSandTab,x pha tay lda QuickSandSize,y tay pla clc adc #16 .noQuickSand: clc sty xPosQuickSand adc #6 tay

3 2� 2 2 3 3

etc.: ; 3 ; 4 ; 2� ; 3 ; 3 ; ; ; ; ; ; ; ;

2 4 2� 3 2 2� 2 2�

; ; ; ; ; ; ; ; ; ; ; ;

3 2� 3 2 2 3 2 2 2 2 2 4

; 4 ; ; ; ; ; ; ; ;

4 3 2 4 2 4 2 2

; ; ; ;

2 3 2 2

clear ladder data pointer ladder in scene no, skip yes,.. ..load pointers at ladder data set scorpion or ladder pointers

blue swamp? yes, skip no, black tar pit disable quicksand

Harry in underground? yes, animate quicksand stop quicksand animation when.. ..Harry is falling into the pit game running? no, skip

x = framecount / 64 only bits 2..5 of framecounter calculate size of the quicksand

ldx #6 lda ladderFlag eor #$ff sta temp1 .loopPF2Lst: lda PF2PatTab,y sta PF2Lst,x ora temp1 sta PF2QuickSand dey dex bpl .loopPF2Lst .stopQuickSand:

; ; ; ;

2 3 2 3

; ; ; ; ; ; ;

4 4 3 3 2 2 2�

; calculate x-positioning values: ldx #2 ; 2 lda #0 ; 2 IF SCREENSAVER ldy SS_Delay ; 3 bmi .skipHarryPos ; 2� ELSE ldy noGameScroll ; bne .skipHarryPos ; 2� ENDIF .loopPos: lda xPosHarry,x .skipHarryPos: jsr CalcPosX sta HMFineLst,x sty HMCoarseLst,x stx hmblSum dex bpl .loopPos

no swamp etc. when ladder

game running? no, don't draw Harry TODO: bugfix, wall isn't drawn no, don't draw Harry

; 4 ; ; ; ; ; ;

6 4 4 3 2 2�

; load branches x-positioning ldx treePat ; lda BranchPosLTab,x ; sta posLeftBranch ; lda BranchPosRTab,x ; sta posRightBranch ;

values: 3 4 3 4 3

; copy bottom object data: ldy #14 ldx #6 .loopObjLst: lda (objColPtr),y IF SCREENSAVER eor SS_XOR and SS_Mask ELSE FILL_NOP 4 ENDIF sta objColLst,x lda (objPatPtr),y sta objPatLst,x dey dex

4 5 4 2 2

; 2 ; 2 ; 5 ; 3 ; 3

; ; ; ; ;

-> hmblSum = 0

bpl

.loopObjLst

; 2�

.waitTim: lda INTIM ; 4 bne .waitTim ; 2� sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 sta VBLANK ; 3 sta CXCLR ; 3 sta temp3 ; 3 jsr ShowDigits ; 6

don't show anything before score draw score

; set digitPtrs for timer: ldx #timerHi-scoreHi ; 2 ldy #2 ; 2 minutes jsr BCD2DigitPtrs ; 6 inx ; 2 seconds ldy #8 ; 2 jsr BCD2DigitPtrs ; 6 lda livesPat ; 3 show lives before time sta temp3 ; 3 lda #<Space ; 2 sta digitPtr ; 3 ldy digitPtr+2 ; 3 bne .noSpace ; 2� replaced leading zero in timer with space sta digitPtr+2 ; 3 .noSpace: lda #
logs: 3 2 3 3 3 3 3 3 2 3 3 3 2 2 3 2 2

disable vertical delay for object branches color (always BROWN-2) draw four branches

x = coarse x-positioning value of

y = coarse x-positioning value of

sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 nop ; 2 .waitPos0: dex ; 2 bpl .waitPos0 ; 2� sta RESP0 ; 3 lda posLeftBranch ; 3 sta HMP0 ; 3 lda posRightBranch ; 3 sta HMP1 ; 3 .waitPos1: dey ; 2 bpl .waitPos1 ; 2� sta RESP1 ; 3 sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 lda #%101 ; 2 sta CTRLPF ; 3 ldy #31 ; 2 lda treePat ; 3 asl ; 2 asl ; 2 tax ; 2

enable playfield priority, now.. ..the leaves overlap the branches

; Kernel 1 (31 lines): draw liana, branches and bottom of leaves: .loopBranches: clc ; 2 lda hmblSum ; 3 adc hmblAdd ; 3 sta hmblSum ; 3 sta HMCLR ; 3 bcc .noMove0 ; 2� lda hmblDir ; 3 sta HMBL ; 3 .noMove0: lda #0 ; 2 cpy #9 ; 2 draw branches in lower 9 lines bcs .noBranch ; 2� tya ; 2 lsr ; 2 lda BranchTab,y ; 4 .noBranch: sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 sta GRP0 ; 3 sta GRP1 ; 3 bcs .noChangePF ; 2� two line resolution for leaves lda PFLeavesTab,x ; 4 x = 0..3 inx ; 2 sta PF0 ; 3 sta PF1 ; 3 sta PF2 ; 3 .noChangePF: dey ; 2

bne

.loopBranches

; 2�

; prepare Kernel 2: draw liana, disable branches, draw logs: ldx treePat ; 3 clc ; 2 lda hmblSum ; 3 adc hmblAdd ; 3 sta hmblSum ; 3 bcc .noMove1 ; 2� ldy hmblDir ; 3 .noMove1: sty HMBL ; 3 lda #%001 ; 2 sta CTRLPF ; 3 disable playfield priority lda PF1LogTab,x ; 4 ldy PF2LogTab,x ; 4 ldx nusize1 ; 3 sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 sta PF1 ; 3 draw outer logs lda colorLst+5 ; 3 always BROWN-2 sta COLUPF ; 3 lda #0 ; 2 sta GRP0 ; 3 sta GRP1 ; 3 sta NUSIZ0 ; 3 sta PF0 ; 3 sty PF2 ; 3 draw inner logs stx NUSIZ1 ; 3 ; Kernel 2 (4 lines): draw liana, position Harry and other object: ldx #1 ; 2 .loopLianaPos: clc ; 2 lda hmblSum ; 3 adc hmblAdd ; 3 sta hmblSum ; 3 lda #$00 ; 2 bcc .noMove2 ; 2� lda hmblDir ; 3 .noMove2: sta HMBL ; 3 clc ; 2 precalc liana for next line lda hmblSum ; 3 adc hmblAdd ; 3 sta hmblSum ; 3 lda #$00 ; 2 bcc .noMove3 ; 2� lda hmblDir ; 3 .noMove3: sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 ldy #0 ; 2 do the coarse positions sty temp1,x ; 4 ldy HMCoarseLst,x ; 4 position at the very left? bne .waitPos ; 2� no, skip

ldy sty sta sta bne

#$60 temp1,x RESP0,x HMBL .endPos0

; ; ; ; ;

2 4 4 3 3

.waitPos: dey ; 2 bne .waitPos ; 2� sta.w HMBL ; 4 sta RESP0,x ; 4 .endPos0: sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 dex ; 2 bpl .loopLianaPos ; 2� jsr DrawLiana ;31/33 lda HMFineLst ; 3 sta HMP0 ; 3 lda HMFineLst+1 ; 3 sta HMP1 ; 3 sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 jsr DrawLiana ;31/33 lda temp1 ; 3 sta HMP0 ; 3 lda temp2 ; 3 sta HMP1 ; 3 lda yPosHarry ; 3 pattern clc ; 2 adc patOfsHarry ; 3 adc #21 ; 2 tay ; 2 lda reflectHarry ; 3 sta REFP0 ; 3 sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 sta CXCLR ; 3 ldx #20 ; 2 stx VDELP0 ; 3 ; Kernel 3 (21 lines): draw liana and Harry: .loopLianaHarry: clc ; 2 lda hmblSum ; 3 adc hmblAdd ; 3 sta hmblSum ; 3 lda #$00 ; 2 sta HMCLR ; 3 bcc .noMove4 ; 2� lda hmblDir ; 3 .noMove4: sta HMBL ; 3

yes, use special code

"normal" position

do the fine positions

calculate offset for Harry's

disable vertical delay for Harry

jsr DrawHarry ;27/37 sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 sta COLUP0 ; 3 dex ; 2 bpl .loopLianaHarry ; 2� stx inx stx beq

VDELP0 GRP1 .endLiana

.skipHarry: lda #0 sta GRP0 beq .contendLiana

; ; ; ;

3 2 3 3

enable vertical delay for Harry

; 2 ; 3 ; 3

.endLiana: ldx #23 ; 2 ; Kernel 4 (24 lines): draw end of liana, draw Harry: .loopEndLiana: clc ; 2 lda hmblSum ; 3 adc hmblAdd ; 3 sta hmblSum ; 3 lda #$00 ; 2 bcc .noMove5 ; 2� lda hmblDir ; 3 .noMove5: sta HMBL ; 3 dey ; 2 cpy #HARRY_H ; 2 bcs .skipHarry ; 2� lda (harryPatPtr),y ; 5 sta GRP0 ; 3 lda (harryColPtr),y ; 5 IF SCREENSAVER eor SS_XOR ; 3 and SS_Mask ; 3 ELSE FILL_NOP 4 ENDIF .contendLiana: sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 sta COLUP0 ; 3 lda #DISABLE ; 2 cpx lianaBottom ; 3 bottom of liana reached? bcs .skipDisable ; 2� no, skip sta ENABL ; 3 yes, disable liana .skipDisable: sta GRP1 ; 3 dex ; 2 bpl .loopEndLiana ; 2� jsr

DrawHarry

;27/37

ldx CXP0FB-$30 ; 3 stx hitLiana ; 3 sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 sta COLUP0 ; 3 lda colorLst+7 ; 3 sta COLUPF ; 3 ldx #$ff ; 2 stx PF0 ; 3 stx PF1 ; 3 stx PF2 ; 3 lda colorLst+8 ; 3 sta COLUBK ; 3 inx ; 2 stx GRP1 ; 3

draw the jungle ground

ldx #6 ; 2 ; Kernel 5: draw Harry, holes, top of object on the ground: .loopGround: jsr DrawHarry ;27/37 sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 sta COLUP0 ; 3 lda objColLst,x ; 4 sta COLUP1 ; 3 lda objPatLst,x ; 4 draw object (crocodiles, logs, snake...) sta GRP1 ; 3 lda PF2Lst,x ; 4 draw pits sta PF2 ; 3 dex ; 2 bpl .loopGround ; 2�=31/32 tya sec sbc sta

#8 temp1

; ; ; ;

2 2 2 3

calculate and save.. ..Harry's pattern.. ..offset for kernel 7

ldx #0 ; 2 ldy #7 ; 2 ; Kernel 6 (8 lines): draw bottom of object on the ground, holes in the ground: .loopHoles: lda #0 ; 2 sta GRP0 ; 3 lda (objColPtr),y ; 5 IF SCREENSAVER eor SS_XOR ; 3 and SS_Mask ; 3 ELSE FILL_NOP 4 ENDIF sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 sta COLUP1 ; 3 lda (objPatPtr),y ; 5

sta dey bmi lda sta inx bne

GRP1 .exitHoles PF2Lst,x PF2 .loopHoles

.exitHoles: lda #0 sta GRP0 superfluous) ldx HMCoarseLst+2 bne .notZero lda #$60 the very left .notZero: sta temp3

; ; ; ; ; ; ;

3 2 2� 4 3 2 3

exit loop here

loop always

; 2 ; 3

clear Harry again (JTZ:

; 3 ; 2� ; 2

special HMOV when scorpion is at

; 3

; check Harry's collisions (JTZ: superfluous code!) lda CXPPMM-$30 ; 3 Harry collided with other objects? asl ; 2 lda CXP0FB-$30 ; 3 Harry collided with playfield? ror ; 2 sta cxHarry ; 3 store here (this variable isn't used somewhere else!) ; prepare some underground data: lda reflectScorpion ; 3 sta REFP1 ; 3 lda ladderFlag ; 3 and #%000100 ; 2 eor #%100101 ; 2 tax ; 2 ldy colorLst+6 ; 3 lda colorLst+4 ; 3 color sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 jmp ContKernel ; 3 ShowDigits SUBROUTINE sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 lda colorLst ; 3 sta COLUP0 ; 3 sta COLUP1 ; 3 ldy #0 ; 2 sty REFP0 ; 3 sty REFP1 ; 3 ldx #$10|THREE_COPIES; 2 stx NUSIZ0 ; 3 sta RESP0 ; 3 sta RESP1 ; 3 stx HMP1 ; 3 sta WSYNC ; 3

set player 1 reflection calculate playfield reflection ball is 4 clocks wide (ladder) underground color (always BROWN+2) hole, blackground and tar pit

;--------------------------------------sta HMOVE ; 3 stx NUSIZ1 ; 3 iny ; 2 sty CTRLPF ; 3 lda #DIGIT_H-1 ; 2 sta VDELP0 ; 3 sta VDELP1 ; 3 sta temp2 ; 3 sta HMCLR ; 3 jsr SkipIny ;22 lda temp3 ; 3 .loopDigits: ldy temp2 ; 3 lda (digitPtr+10),y ; 5 sta temp1 ; 3 lda (digitPtr+8),y ; 5 tax ; 2 lda (digitPtr),y ; 5 ora temp3 ; 3 sta HMOVE ; 3 sta GRP0 ; 3 lda (digitPtr+2),y ; 5 sta GRP1 ; 3 lda (digitPtr+4),y ; 5 sta GRP0 ; 3 lda (digitPtr+6),y ; 5 ldy temp1 ; 3 sta GRP1 ; 3 stx GRP0 ; 3 sty GRP1 ; 3 sta GRP0 ; 3 dec temp2 ; 5 bpl .loopDigits ; 2� sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 lda #0 ; 2 sta GRP0 ; 3 sta GRP1 ; 3 sta GRP0 ; 3 rts ; 6 DrawHarry SUBROUTINE ; called from kernel: dey cpy #HARRY_H bcs .skipDraw lda (harryPatPtr),y sta GRP0 lda (harryColPtr),y IF SCREENSAVER eor SS_XOR and SS_Mask ELSE FILL_NOP 3 ENDIF

; ; ; ; ; ;

2 2 2� 5 3 5

; 3 ; 3

enable playfield reflection

just waste 22 cycles just waste three cycles

show lives when drawing time produce HMOVE blanks

.exitDraw: rts

; 6 = 21/31

IF SCREENSAVER = 0 ; do some missing nops: FILL_NOP 2 ENDIF .skipDraw: lda #0 sta GRP0 beq .exitDraw

; ; ; ;

7 2 3 3

CalcPosX SUBROUTINE ; calculate coarse and fine x-positioning values: tay ; 2 iny ; 2 tya ; 2 and #$0f ; 2 sta temp1 ; 3 tya ; 2 lsr ; 2 lsr ; 2 lsr ; 2 lsr ; 2 tay ; 2 clc ; 2 adc temp1 ; 3 cmp #$0f ; 2 bcc SkipIny ; 2� sbc #$0f ; 2 iny ; 2 SkipIny: eor #$07 ; 2 asl ; 2 asl ; 2 asl ; 2 asl ; 2 rts ; 6 DrawLiana SUBROUTINE clc lda hmblSum adc hmblAdd sta hmblSum lda #$00 bcc .noMove6 lda hmblDir .noMove6: sta HMBL rts BCD2DigitPtrs SUBROUTINE lda scoreHi,x and #$f0 lsr sta digitPtr,y lda scoreHi,x

; ; ; ; ; ; ;

2 3 3 3 2 2� 3

; 3 ; 6 = 25/27 ; ; ; ; ;

4 2 2 5 4

and asl asl asl sta sta sta rts

#$0f

digitPtr+2,y WSYNC HMOVE

DecScoreLo SUBROUTINE lda #$07 sta AUDC1 lda #$99 DecScoreHi: sed clc adc scoreLo sta scoreLo lda scoreMed sbc #$00 sta scoreMed lda scoreHi sbc #$00 bcs .notZero lda #$00 sta scoreMed sta scoreLo .notZero: sta scoreHi cld rts PFLeavesTab: .byte %11111111 .byte %11001111 .byte %10000011 .byte %00000001

; ; ; ; ; ; ; ;

2 2 2 2 5 3 3 6

; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;

2 3 2 2 2 3 3 3 2 3 3 2 2� 2 3 3

; 3 ; 2 ; 6

; ; ; ;

|XXXXXXXX| |XX XXXX| |X XX| | X|

.byte .byte .byte .byte

%01111111 %00111101 %00011000 %00000000

; ; ; ;

| XXXXXXX| | XXXX X| | XX | | |

.byte .byte .byte .byte

%11111111 %11111110 %10111100 %00011000

; ; ; ;

|XXXXXXXX| |XXXXXXX | |X XXXX | | XX |

.byte .byte .byte .byte

%11111110 %11111100 %01111000 %00110000

; ; ; ;

|XXXXXXX |XXXXXX | XXXX | XX

Kernel2 SUBROUTINE .skipHarry1: lda #0 sta GRP0 beq .conrHarry

| | | |

; 2 ; 3 ; 3

decrease scoreLo by 1 decrease scoreHi by 1

limit score at zero

ContKernel: sta COLUBK ; 3 sty COLUPF ; 3 lda #0 ; 2 sta GRP1 ; 3 lda #$ff ; 2 sta PF1 ; 3 lda PF2QuickSand ; 3 sta PF2 ; 3 stx CTRLPF ; 3 ldy temp1 ; 3 lda #$90 ; 2 sta.w HMBL ; 4 cpy #HARRY_H ; 2 sta RESBL ; 3 bcs .skipHarry1 ; 2�+1 lda (harryPatPtr),y ; 5 sta GRP0 ; 3 lda (harryColPtr),y ; 5 IF SCREENSAVER eor SS_XOR ; 3 and SS_Mask ; 3 ELSE FILL_NOP 4 ENDIF .conrHarry: ldx HMCoarseLst+2 ; 3 sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 sta COLUP0 ; 3 beq .wait1 ; 2� .wait1: beq .wait2 ; 2� .wait2: lda #0 ; 2 sta GRP1 ; 3 .loopWait: dex ; 2 bpl .loopWait ; 2� sta.w RESP1 ; 4 sta HMCLR ; 3 sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 dey ; 2 cpy #HARRY_H ; 2 bcs .skipHarry2 ; 2� lda (harryColPtr),y ; 5 IF SCREENSAVER eor SS_XOR ; 3 and SS_Mask ; 3 ELSE FILL_NOP 3 ENDIF sta COLUP0 ; 3 lda (harryPatPtr),y ; 5

sta GRP0 ; 3 .skipHarry2: lda #0 ; 2 sta GRP1 ; 3 lda HMFineLst+2 ; 3 sta HMP1 ; 3 position scorpion or wall ldx #11 ; 2 dey ; 2 ; Kernel 7 (12 lines): draw top of ladder, draw Harry: .loopLadderTop: dey ; 2 cpy #HARRY_H ; 2 bcs .skipHarry3 ; 2� lda (harryPatPtr),y ; 5 sta GRP0 ; 3 lda (harryColPtr),y ; 5 IF SCREENSAVER eor SS_XOR ; 3 and SS_Mask ; 3 ELSE FILL_NOP 4 ENDIF .contHarry3: sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 sta COLUP0 ; 3 lda #0 ; 2 sta GRP1 ; 3 lda LadderTab,x ; 4 and ladderFlag ; 3 sta ENABL ; 3 dex ; 2 bmi .exitLadderTop ; 2� exit loop lda temp3 ; 3 sta HMCLR ; 3 sta HMP1 ; 3 position scorpion at the very left lda #15 ; 2 clear hmove value, prepare height of a later loop sta temp3 ; 3 bne .loopLadderTop ; 3 loop always .skipHarry3: lda #0 sta GRP0 beq .contHarry3

; 2 ; 3 ; 3

.skipHarry4: lda #0 sta GRP0 beq .contHarry4

; 2 ; 3 ; 3

.exitLadderTop: dey sty temp1 cpy #HARRY_H bcs .skipHarry4 lda (harryPatPtr),y

; ; ; ; ;

2 3 2 2� 5

sta GRP0 ; 3 lda (harryColPtr),y ; 5 IF SCREENSAVER eor SS_XOR ; 3 and SS_Mask ; 3 ELSE FILL_NOP 4 ENDIF .contHarry4: ldy #15 ; 2 sta temp2 ; 3 lda (wallPatPtr),y ; 5 ldx #ONE_COPY ; 2 = 0 stx NUSIZ1 ; 3 sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 sta GRP1 ; 3 lda temp2 ; 3 sta COLUP0 ; 3 stx PF0 ; 3 clear playfield lda #DARK_RED ; 2 wall color IF SCREENSAVER and SS_Mask ; 3 ELSE FILL_NOP 2 ENDIF sta COLUP1 ; 3 stx PF1 ; 3 stx PF2 ; 3 lda ladderFlag ; 3 sta ENABL ; 3 dey ; 2 sty temp2 ; 3 ldx temp1 ; 3 ; Kernel 8 (15 lines): draw Harry, ladder and wall: .loopLadder: dex ; 2 txa ; 2 tay ; 2 cpy #HARRY_H ; 2 bcs .skipHarry5 ; 2�+1 lda (harryPatPtr),y ; 5 sta GRP0 ; 3 lda (harryColPtr),y ; 5 .contHarry5: IF SCREENSAVER eor SS_XOR ; 3 and SS_Mask ; 3 ELSE bit $00 bit $00 ENDIF ldy temp2 ; 3 sta HMOVE ; 3 sta COLUP0 ; 3 lda (wallPatPtr),y ; 5 sta GRP1 ; 3

lda (wallColPtr),y IF SCREENSAVER and SS_Mask ELSE bit $00 ENDIF sta COLUP1 lda LadderTab,y and ladderFlag sta ENABL dec temp2 bpl .loopLadder nop ; Kernel 9 (16 lines): draw .loopUnderground: dex txa tay cpy #HARRY_H bcs .skipHarry6 lda (harryPatPtr),y sta GRP0 lda (harryColPtr),y .contHarry6: IF SCREENSAVER eor SS_XOR and SS_Mask ELSE bit $00 bit $00 ENDIF ldy temp3 sta HMOVE sta COLUP0 lda (undrPatPtr),y sta GRP1 lda (undrColPtr),y IF SCREENSAVER and SS_Mask ELSE bit $00 ENDIF sta COLUP1 lda LadderTab,y and ladderFlag sta.w ENABL dec temp3 bpl .loopUnderground bmi .exitKernel

; 5 ; 3

; 3 ; 4 ; 3 ; 3 ; 5 ; 2�+1 ; 2 Harry, scorpion or the bottom of wall and ladder: ; ; ; ; ; ; ; ;

2 2 2 2 2� 5 3 5

; 3 ; 3

; ; ; ; ; ;

3 3 3 5 3 5

; 3

; ; ; ; ; ; ;

3 4 3 4 5 2� 3

.skipHarry5: lda #0 sta GRP0 nop beq .contHarry5

; ; ; ;

2 3 2 4

.skipHarry6: lda #0

; 2

page crossed!

sta nop nop beq

GRP0 .contHarry6

; ; ; ;

3 2 2 3

.exitKernel: ldx #$ff ; 2 sta WSYNC ; 3 ;--------------------------------------sta HMOVE ; 3 stx PF0 ; 3 stx PF1 ; 3 stx PF2 ; 3 inx ; 2 stx ENABL ; 3 stx GRP0 ; 3 stx GRP1 ; 3 stx GRP0 ; 3 ; show animated copyright: stx temp3 ; 3 ldy #COPYRIGHT_H/2 ; 2 lda noGameScroll ; 3 ldx soundIdx ; 3 beq .noSound0 ; 2� lda #0 ; 2 .noSound0: lsr ; 2 lsr ; 2 lsr ; 2 cmp #20 ; 2 bcs .ok ; 2� ldy #0 ; 2 cmp #12 ; 2 bcc .ok ; 2� sbc #12 ; 2 tay ; 2 .ok: tya ; 2 clc ; 2 adc #
colorLst+4 COLUPF ShowDigits noGameScroll .endCopyright noGameScroll

; ; ; ; ; ;

3 3 6 3 2� 5

fill playfield registers x = 0 clear ball and graphics registers

show nothing before copyright

scroll-animation

game running? yes, no more scrolling no, scoll message

bne .endCopyright dec noGameScroll .endCopyright:

; 2� ; 5

avoid #0

; start timer and vertical blank: IF NTSC lda #32 ; 2 ELSE lda #60 ENDIF ldx #%10000010 ; 2 sta WSYNC ; 3 sta TIM64T ; 4 stx VBLANK ; 3 ; check for killed Harry: lda soundIdx cmp #SOUND_FALLING-1 bne .slipDecrease ; Harry is loosing a live: lda livesPat beq .slipDecrease IF TRAINER FILL_NOP 4 ELSE asl asl sta livesPat ENDIF lda #NOREFLECT sta reflectHarry sta noGameScroll sta CXCLR ldy #$d0|NO_MOVE sty oldJoystick lda #20 sta xPosHarry ldx #JUMP_LEN lda yPosHarry cmp #71 bcc LF5D2 ldy #64 position lda #SCREENWIDTH/2-4 sta xPosScorpion underground LF5D2: stx jumpIndex sty yPosHarry .slipDecrease: ; *** sound routines: *** ldy #0 ldx soundIdx beq .noSound inc soundDelay lda soundDelay and #$03

; 3 ; 2 ; 2�

dead tune at end of playing? no, skip decrease

; 3 ; 2�

any more lives? no, skip decrease

; 2 ; 2 ; 3 ; ; ; ; ; ; ; ; ; ; ; ; ;

2 3 3 3 2 3 2 3 2 3 2 2� 2

; 2 ; 3

yes, decrease lives

upper Harry restart y-position clear joystick

Harry at underground? no, skip yes, lower Harry restart yposition scorpion at center.. ..when Harry restarts at

; 3 ; 3

; ; ; ; ; ;

2 3 2� 5 3 2

next note every 4th frame

bne .skipNext inc soundIdx .skipNext: lda SoundTab-1,x bpl .contSound sty soundIdx .contSound: sta AUDF0 ldy #1 .noSound: sty AUDC0 lda #4 sta AUDV0

; 2� ; 5

play next note

; 4 ; 2� ; 3

stop current sound

; check if Harry has fallen lda climbPos bne .exitBounds lda yPosHarry cmp #JUNGLE_GROUND bne .exitBounds ldx sceneType cpx #CROCO_SCENE bne .noCroco1 bit frameCnt bpl .contCroco dex bne .contCroco

into a hole or pit: ; 3 Harry at ladder? ; 2�+1 yes, skip bounds check ; 3 ; 2 Harry at ground? ; 2� no, skip bounds check ; 3 ; 2 croco scene? ; 2� no, skip ; 3 open croco jaws? ; 2� yes, skip ; 2 no, use other values ; 3

; 3 ; 2 ; 3 ; 2 ; 3

.noCroco1: cpx #HOLE3_SCENE+2 ; bcc .contCroco ; ldx #HOLE3_SCENE+1 ; .contCroco: txa ; asl ; asl ; asl ; tax ; ldy #3 ; .loopBounds: lda HoleBoundsTab,x ; beq .exitBounds ; clc ; adc xPosQuickSand ; cmp xPosHarry ; bcs .inBounds ; lda HoleBoundsTab+1,x; sec ; sbc xPosQuickSand ; cmp xPosHarry ; bcs .outOfBounds ; .inBounds: inx ; inx ; dey ; bpl .loopBounds ; bmi .exitBounds ;

2 2� 2

scene with hole(s) or ???? ? yes, skip no, limit scene type

2 2 2 2 2 2

check up to 4 bounds

4 2� 2 3 3 2� 4 2 3 3 2� 2 2 2 2� 3

no more bounds! Harry left of hole/pit? yes, bound ok

Harry right of hole/pit? no, Harry is falling into

.outOfBounds: inc yPosHarry ldx #JUMP_LEN stx jumpIndex dex stx oldJoystick .exitBounds: lda jumpMode bne .waitTim bit hitLiana bvc .waitTim lda jumpIndex beq .waitTim ldx atLiana bne .waitTim stx jumpIndex inx stx atLiana stx soundIdx

; ; ; ; ;

5 2 3 2 3

Harry is falling down

; ; ; ; ; ; ; ; ; ; ; ;

3 2� 3 2� 3 2� 3 2� 3 2 3 3

JTZ: superfluous code?

x=$1f -> no direction

collison with liana no, skip currently jumping? no, skip Harry already at liana? yes, skip no, stop jump enter "liana mode" start tarzan sound (=0)

; wait for end of vertical blank: .waitTim: lda INTIM ; 4 bne .waitTim ; 2� ; start vertical sync: sta AUDC1 ldy #%10000010 ports (JTZ: why?) sty WSYNC sty VSYNC sty WSYNC sty WSYNC sty WSYNC sta VSYNC IF SCREENSAVER ; process screensaver code: inc SS_DelayLo bne .skipSS_Delay inc SS_Delay bne .skipSS_Delay sec ror SS_Delay .skipSS_Delay: ldy #$ff lda SWCHB and #BW_MASK bne .colorMode ldy #$0f .colorMode: tya ldy #$00 bit SS_Delay bpl .noScreenSaver and #$f7 mode ldy SS_Delay

; 3 ; 2 ; ; ; ; ; ;

3 3 3 3 3 3

; ; ; ; ; ;

5 2� 5 2� 2 5

; ; ; ; ;

2 4 2 2� 2

; ; ; ; ;

2 2 3 2� 2

; 3

enable vertical sync and dump

disable changing colors avoid bright colors in screensaver

.noScreenSaver: sty SS_XOR asl SS_XOR sta SS_Mask ELSE FILL_NOP 39 ENDIF

; 3 ; 5 ; 3

; start timer for vertical sync: IF NTSC lda #47 ; 2 ELSE lda #79 ENDIF sta WSYNC ; 3 sta TIM64T ; 4 ; read joystick: lda SWCHA lsr lsr lsr lsr sta joystick cmp #NO_MOVE beq .noMove ldx #0 IF SCREENSAVER stx SS_Delay ELSE FILL_NOP 2 ENDIF lda timerHi cmp #STARTTIME bne .noMove stx noGameScroll .noMove: ; read RESET switch: lda SWCHB lsr bcs .noReset IF SCREENSAVER ldx #SS_Delay ELSE ldx #frameCnt ENDIF jmp Reset .noReset: lda beq jmp

noGameScroll .processHarry ProcessObjects

; *** process Harry: *** .processHarry: inc frameCnt lda random2

; ; ; ; ; ; ; ; ;

4 2 2 2 2 3 2 2� 2

; 3

reset screensaver

; ; ; ;

timer at 20:00? no, skip yes, game is running

3 2 2� 3

; 4 ; 2 ; 2�

RESET pressed? no, skip

; 2

yes, load init-values offset..

; 2

yes, load init-values offset..

; 3

..and jump to Reset

; 3 ; 2� ; 3

game running? yes, process Harry no, skip Harry, goto objects

; 5 ; 3

asl eor asl rol lda bne ldx beq lda sec sbc sta inc lda cmp bcc lda sta .indexOk:

random2 random2 climbPos .endDoJump jumpIndex .endDoJump yPosHarry JumpTab-1,x yPosHarry jumpIndex jumpIndex #JUMP_LEN+1 .indexOk #JUMP_LEN jumpIndex

ldx yPosHarry cpx #JUNGLE_GROUND beq .stopJump ldy ladderFlag beq .skipFalling cpx #JUNGLE_GROUND+2 bne .skipFalling lda #SOUND_FALLING sta soundIdx lda #$00 jsr DecScoreHi .skipFalling: cpx #UNDER_GROUND beq .stopJump cpx #54 limit? bne .endDoJump tya bne .endDoJump jmp KilledHarry .stopJump: lda #0 sta jumpIndex sta jumpMode .endDoJump: ; countdown timer: dec timerLo bpl .inTime lda #FRAMERATE-1 sta timerLo sed lda timerMed sec sbc #$01 bcs .contMinute lda #$59

; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;

2 3 2 5 3 2�+1 3 2�+1 3 2 4 3 5 3 2 2� 2 3

; ; ; ; ; ; ; ; ; ; ;

3 2 2�+1 3 2�+1 2 2�+1 2 3 2 6

Harry at ladder? no, skip continue jump currently jumping? no, skip continue jump yes, calculate.. ..new y-position of Harry

Harry at jungle ground? yes, stop any jump ladder in scene? no, skip falling Harry is falling into a hole start falling-sound subtract 100 points from score

; 2 ; 2� ; 2

is Harry at underground bottom? yes, stop any jump has Harry reached the falling

; ; ; ;

no, skip ladder in scene? no, skip kill yes, Harry is killed

2� 2 2� 3

; 2 ; 3 ; 3

; ; ; ; ; ; ; ; ; ;

5 2� 2 3 2 3 2 2 2� 2

start next minute

.contMinute: sta timerMed lda timerHi IF TRAINER lda #$19 ELSE sbc #$00 ENDIF sta timerHi cld lda timerHi ora timerMed bne .inTime dec noGameScroll .inTime:

; 3 ; 3 ; 2 ; 2 ; ; ; ; ; ;

3 2 3 3 2� 5

; check collisions between Harry and object: lda CXPPMM-$30 ; 3 bmi .contCollision ; 2� lda #0 ; 2 sta patOfsHarry ; 3 beq .endCollision ; 3 .contCollision: lda yPosHarry cmp #64 bcs .checkWallHit lda atLiana bne .endCollision lda sceneType cmp #CROCO_SCENE beq .endCollision cmp #TREASURE_SCENE bne .noTreasure1 jsr CheckTreasures before bne .endCollision sta treasureBits,x dec treasureCnt bpl .incScore dec noGameScroll ; treasure .incScore: lda and asl asl asl asl adc sed adc sta lda adc sta cld

; ; ; ; ; ; ; ; ; ; ;

3 2 2� 3 2� 3 2 2� 2 2� 6

; ; ; ; ;

2� 4 5 2� 5

any more.. ..time left? yes, continue no, stop game

Harry collided? yes, process collisions no, skip collisions

Harry at underground? yes, check wall no, Harry at liana? yes, skip croco in scene? yes, skip treasue in scene? no, skip yes, check if treasure was found clear treasure bit all treasures found no, skip yes, game finished!!!

found, increase score: objectType #$03

#$20 scoreMed scoreMed #$00 scoreHi scoreHi

; ; ; ; ; ; ; ; ; ; ; ; ; ;

3 2 2 2 2 2 2 2 3 3 2 3 3 2

add at least 2000 points

lda sta bne

#SOUND_TREASURE soundIdx .endCollision

.noTreasure1: lda objectType cmp #ID_FIRE bcc .hitLogs .noWallHit: jmp KilledHarry .hitLogs: lda beq inc bne

climbPos .notAtLadder climbPos .decScore

.notAtLadder: lda yPosHarry cmp #JUNGLE_GROUND+1 bcs .endCollision lda #5 sta patOfsHarry lda objectType and #$04 bne .decScore lda #NO_MOVE sta joystick .decScore: jsr DecScoreLo .endCollision: jmp .swingLiana .checkWallHit: lda wallPatPtr cmp #<Wall bne .noWallHit lda #$01 sta AUDC1 lda xPosHarry cmp #140 bcs .hitFromRight cmp #13 bcc .hitFromLeft cmp #80 bcs .hitFromLeft .hitFromRight: inc xPosHarry ldx #MOVE_RIGHT bne .contWallHit .hitFromLeft: dec xPosHarry ldx #MOVE_LEFT .contWallHit: stx oldJoystick ; let the liana swing:

; 2 ; 3 ; 3 ; 3 ; 2 ; 2�

fire or cobra? no, hit by rolling logs

; 3

Harry is killed

; ; ; ;

3 2� 5 3

Harry at ladder? no, skip push yes, push down Harry

; ; ; ; ; ; ; ; ; ;

3 2 2� 2 3 3 2 2� 2 3

; 6 ; 3 ; ; ; ; ; ; ; ; ; ; ; ;

3 2 2� 2 3 3 2 2� 2 2� 2 2�

wall displayed in scene? no, skip yes, make some noise determine where Harry hit the wall right wall from the right? yes, continue left wall from the left? yes, continue left or right wall?

; 5 ; 2 ; 3

bounce back one pixel and.. ..change direction to right

; 5 ; 2

bounce back one pixel and.. ..change direction to left

; 3

.swingLiana: ; calculate absolute position: lda lianaPosLo ; 3 asl ; 2 lda lianaPosHi ; 3 rol ; 2 bpl .skipNeg ; 2� eor #$ff ; 2 .skipNeg: sta hmblAdd ; 3 liana) ldy #$f0 ; 2 IF OPTIMIZE bcs .skipMoveLeft ; 2� FILL_NOP 2 ELSE lda lianaPosHi ; 3 bmi .skipMoveLeft ; 2� ENDIF ldy #$10 ; 2 .skipMoveLeft: sty hmblDir ; 3 sec ; 2 lda #143 ; 2 sbc hmblAdd ; 3 clc ; 2 adc lianaPosLo ; 3 sta lianaPosLo ; 3 bcc .skipAddHi ; 2� lda lianaPosHi ; 3 adc #3 ; 2 sta lianaPosHi ; 3 .skipAddHi: ; calculate bottom of liana: lda hmblAdd ; 3 lsr ; 2 lsr ; 2 lsr ; 2 cmp #6-1 ; 2 bcs .limitBottom ; 2� lda #6 ; 2 .limitBottom: adc #4 ; 2 sta lianaBottom ; 3 ; check for a new jump: lda jumpIndex beq .notJumping cmp #3 bcc .saveDir .notJumping: ora climbPos ora patOfsHarry ora atLiana bne .noFire lda INPT4-$30 and #%10000000 cmp fireButton

store absolute value (-> angle of liana moves right

liana moves left

this are no exactly maths,.. ..but who cares, as long.. ..as it's looking ok :) limit bottom of liana to 6

; ; ; ;

3 2� 2 2�

currently jumping? no, jump just started? yes, save joystick direction

; ; ; ; ; ; ;

3 3 3 2� 3 2 3

Harry at ladder.. ..or Harry kneeing.. ..or Harry at liana? yes, skip new jump

sta fireButton beq .noFire tax bmi .noFire ; start jump: lda #1 sta jumpIndex IF SCREENSAVER sta SS_Delay ELSE FILL_NOP 2 ENDIF lda #SOUND_JUMP sta soundIdx dec yPosHarry .saveDir: lda joystick sta oldJoystick .noFire:

; ; ; ;

3 2� 2 2�

; 2 ; 3

start jumping sequence

; 3

; 2 ; 3 ; 5

move Harry up

; 3 ; 3

; check for jumping of liana: lda atLiana ; beq .skipJumpOff ; lda joystick ; and #~[$f0|MOVE_DOWN]; bne .skipJumpOff ; sta atLiana ; lda #JUMP_LEN/2 ; sta jumpIndex ; sta jumpMode ; ldy #MOVE_RIGHT ; lda hmblDir ; bmi .jumpRight ; ldy #MOVE_LEFT ; .jumpRight: sty oldJoystick ; .skipJumpOff: ; check for starting climbing lda climbPos ; bne .endStartClimb ; lda ladderFlag ; beq .endStartClimb ; lda xPosHarry ; sec ; sbc #68 ; cmp #15 ; 7)? bcs .endStartClimb ; lda yPosHarry ; cmp #84 ; bcc .skipClimbUp ; lda joystick ; lsr ; bcs .skipClimbUp ; lda #LADDER_BOTTOM-1 ; bne .contClimbUp ;

3 2� 3 2 2� 3 2 3 3 2 3 2� 2

Harry at liana? no, skip jump of liana joystick down? no, skip yes, leave "liana mode" start jump down

jump in liana direction

3 ladder: 3 2� 3 2� 3 2 2 2 2� 3 2 2� 3 2 2� 2 3

Harry at ladder? yes, skip ladder in scene? no, skip

Harry at x-position of ladder (+/no, skip yes, Harry near bottom of underground no, skip yes, joystick up? no, skip yes, start climbing up the ladder

.skipClimbUp: lda yPosHarry ; cmp #JUNGLE_GROUND ; bne .endStartClimb ; lda joystick ; and #~[$f0|MOVE_DOWN]; bne .endStartClimb ; lda #LADDER_TOP+1 ; ladder .contClimbUp: sta climbPos ; lda #SCREENWIDTH/2-4 ; sta xPosHarry ; .endStartClimb:

3 2 2� 3 2 2� 2 3 2 3

; move Harry when swinging at liana: lda atLiana ; 3 beq .skipSwingHarry ; 2� ; set x-position of Harry: lda hmblAdd ; 3 lsr ; 2 lsr ; 2 clc ; 2 ldy hmblDir ; 3 bmi .isNeg ; 2� eor #$ff ; 2 sec ; 2 .isNeg: adc #75 ; 2 sta xPosHarry ; 3 ; set y-position of Harry: lda #$29 ; 2 sec ; 2 sbc lianaBottom ; 3 sta yPosHarry ; 3 .skipSwingHarry: ; check Harry climbing ladder: lda climbPos ; 3 beq .endClimbLadder ; 2� lda #0 ; 2 sta jumpIndex ; 3 lda frameCnt ; 3 and #$07 ; 2 bne .skipAnimClimb ; 2� lda joystick ; 3 lsr ; 2 bcs .notClimbUp ; 2� dec climbPos ; 5 .notClimbUp: lsr ; 2 bcs .notClimbDown ; 2� inc climbPos ; 5 .notClimbDown: lda climbPos ; 3 cmp #LADDER_TOP ; 2 bcs .skipLadderTop ; 2� lda #NO_MOVE ; 2

Harry at jungle-ground? no, skip joystick down? no, skip yes, start climbing down the

set x-position of.. ..Harry at ladder

Harry at liana? no, skip moving Harry

negate

Harry at ladder? no, skip

climb every 8th frame joystick up? no, skip yes, climb up joystick down? no, skip yes, climb down top reached? no, skip

sta oldJoystick ; lda #LADDER_TOP ; .skipLadderTop: cmp #LADDER_BOTTOM ; bcc .skipLadderBottom; lda #0 ; ldx #ID_STANDING ; stx patIdHarry ; ldx #SCREENWIDTH/2+6 ; stx yPosHarry ; .skipLadderBottom: sta climbPos ; .skipAnimClimb: lda climbPos ; beq .endClimbLadder ; asl ; Harry sec ; rol ; adc #1 ; sta yPosHarry ; .endClimbLadder: ; animate running Harry: lda atLiana bne .endHarryId lda climbPos cmp #LADDER_TOP+1 bcs .endHarryId lda frameCnt and #$03 tax lsr bcs .endHarryId lda oldJoystick ldy jumpIndex bne .isJumping lda joystick .isJumping: lsr lsr lsr bcs .skipLeft dec xPosHarry ldy #REFLECT sty reflectHarry cpx #0 bne .skipAnimLeft dec patIdHarry .skipAnimLeft: jmp .endAnimHarry .skipLeft: lsr bcs inc ldy sty

.endAnimHarry xPosHarry #NOREFLECT reflectHarry

3 2 2 2� 2 2 3 2 3

bottom reached? no, skip remove Harry from ladder

3 3 2� 2

Harry at ladder? no, skip yes, calculate y-position of

2 2 2 3

; ; ; ; ; ; ; ; ; ; ; ; ; ;

3 2�+1 3 2 2�+1 3 2 2 2 2�+1 3 3 2� 3

; ; ; ; ; ; ; ; ; ;

2 2 2 2�+1 5 2 3 2 2� 5

Harry at liana? yes, skip running Harry at ladder bottom? no, skip running animate Harry (every 4th frame)

currently jumping? yes, use old joystick input no, use new joystick input

joystick left? no, skip

4th frame? no, skip animation

; 3 ; ; ; ; ;

2 2� 5 2 3

joystick right? no, skip

cpx #0 bne .endAnimHarry dec patIdHarry .endAnimHarry:

; 2 ; 2� ; 5

; goto next scene, if Harry ldx #0 lda yPosHarry cmp #64 bcc .oneScene ldx #2 .oneScene: lda xPosHarry cmp #XMIN_HARRY bcs .notAtLeft jsr LeftRandom lda #XMAX_HARRY sta xPosHarry .notAtLeft: cmp #XMAX_HARRY+1 bcc .notAtRight jsr RightRandom lda #XMIN_HARRY sta xPosHarry .notAtRight: lda patIdHarry bpl .endHarryId lda #ID_RUNNING4 sta patIdHarry .endHarryId:

has reached border of current scene: ; 2 move one scene ; 3 ; 2 Harry at underground? ; 2� yes, move one scene ; 2 no, move three scenes

; move the scorpion towards lda ladderFlag bne .noMoveScorpion ldx #NOREFLECT lda xPosHarry sec sbc xPosScorpion beq .noMoveScorpion bcs .rightOfScorpion ldx #REFLECT .rightOfScorpion: lda frameCnt and #$07 bne .endMoveScorpion inc xPosScorpion bcs .endMoveScorpion dec xPosScorpion dec xPosScorpion .endMoveScorpion: stx reflectScorpion .noMoveScorpion:

harry: ; 3 ; 2� ; 2 ; 3 ; 2 ; 3 ; 2� ; 2� ; 2

lda cmp bne lda and

climbPos #LADDER_TOP .notAtTop joystick #JOY_HORZ

; ; ; ; ; ;

3 2 2� 6 2 3

; ; ; ; ;

2 2� 6 2 3

; ; ; ;

3 2� 2 3

; ; ; ; ; ; ;

3 2 2� 5 2� 5 5

4th frame? no, skip animation

illegal animation id? no, skip yes, start new animation sequence

ladder in scene? yes, skip scorpion

move scorpion every 8th frame

; 3 ; ; ; ; ;

3 2 2� 3 2

Harry at ladder top? no, skip horizontal move

cmp #JOY_HORZ beq .notAtTop lda joystick sta oldJoystick lda #1 sta jumpIndex lsr sta climbPos lda #31 sta yPosHarry .notAtTop: ldx patIdHarry lda joystick and #JOY_HORZ cmp #JOY_HORZ bne .skipStanding ldx #ID_STANDING .skipStanding: lda yPosHarry cmp #31 ladder? bne .notOfTop ldx #3 bne .contPatId .notOfTop: cmp #UNDER_GROUND beq .contPatId cmp #JUNGLE_GROUND beq .contPatId ldx #ID_KNEEING bcc .contPatId cmp #60 bcs .contPatId lda climbPos bne .contPatId ldx #ID_STANDING .contPatId: lda atLiana beq .skipStanding2 ldx #ID_SWINGING .skipStanding2: lda climbPos beq .noAnimClimb and #%1 clc adc #ID_CLIMBING tax .noAnimClimb: lda patOfsHarry beq .skipKneeing ldx #ID_KNEEING .skipKneeing: stx patIdHarry lda HarryPtrTab,x sta harryPatPtr lda #>Harry0 sta harryPatPtr+1

; ; ; ; ; ; ; ; ; ;

2 2� 3 3 2 3 2 3 2 3

; ; ; ; ; ;

3 3 2 2 2� 2

; 3 ; 2 ; 2� ; 2 ; 3 ; ; ; ; ; ; ; ; ; ; ;

2 2� 2 2� 2 2� 2 2� 3 2� 2

joystick left or right? no, skip

remove Harry from ladder (=0) ..and remark this state

joystick left or right?? yes, skip no, draw standing Harry Harry just jumping of top of no, skip yes, draw diffenret shape

Harry at ladder? yes, skip no, draw standing Harry

; 3 ; 2� ; 2

Harry at liana? no, skip yes, draw swinging Harry

; ; ; ; ; ;

Harry at ladder? no, skip yes, animate climbing

3 2� 2 2 2 2

; 3 ; 2� ; 2 ; ; ; ; ;

3 4 3 2 3

Harry hit by logs (kneeing)? no, skip yes, draw kneeing Harry

lda #
; ; ; ;

2 2 2� 2

; 3 ; ; ; ; ; ; ; ; ; ; ;

3 2 3 4 3 2 2� 6 2� 2 3

; ; ; ;

3 2 2 2

treasure in scene? yes, skip

treasures only

; animate some treasures and hazards: lda random2 ; 3 and AnimateTab,x ; 4 sta temp1 ; 3 lda ObjectPtrTab,x ; 4 clc ; 2 adc temp1 ; 3 sta objPatPtr ; 3 lda NuSize1Tab,x ; 4 sta nusize1 ; 3 lda Color1PtrTab,x ; 4 sta objColPtr ; 3 ; special processing for crocodiles: ldy sceneType ; 3 lda CrocoTab,y ; 4 beq .noCroco ; 2� lda #
save number of object copies

open croco jaws? yes, skip no, use other shape

game running?

bne lda bne cpy beq

.skipLogs CrocoTab,y .skipLogs #TREASURE_SCENE .skipLogs

; ; ; ; ;

2� 4 2� 2 2�

; animate, bounce and move rolling logs: lda xPosObject ; 3 asl ; 2 asl ; 2 asl ; 2 and #$30 ; 2 cmp #$30 ; 2 and #$10 ; 2 adc objPatPtr ; 3 sta objPatPtr ; 3 lda frameCnt ; 3 lsr ; 2 bcs .skipLogs ; 2� lda objectType ; 3 cmp #ID_STATIONARY ; 2 bcs .skipLogs ; 2� ldx xPosObject ; 3 bne .skipResetLogs ; 2� ldx #SCREENWIDTH ; 2 .skipResetLogs: dex ; 2 stx xPosObject ; 3 .skipLogs: ; set score pointers, replace jsr SetDigitPtrs ; inx ; .loopSpace: lda digitPtr,x ; bne .exitSpace ; lda #<Space ; sta digitPtr,x ; inx ; inx ; cpx #9 ; bcc .loopSpace ; .exitSpace: jmp MainLoop ; InitGame SUBROUTINE ldx #1 stx random2 .loopInitSound: lda #$04 sta AUDV0,x lda #$10 sta AUDF0,x dex bpl .loopInitSound stx

noGameScroll

no, skip crocos in scene? no, skip treasure in scene? yes, skip

rolling logs bounce for.. ..2 pixel every 8th x-position

move logs every 2nd frame rolling logs scene? no, skip move

leading zeros with space: 6 2 x = 0 4 2� 2 4 2 2 2 2� 3

; 2 ; 3 ; ; ; ; ; ;

2 4 2 4 2 2�

; 3

init both sound channels

game is stopped

sta xPosHarry asl sta yPosHarry sta scoreMed IF STARTTIME != $20 lda #STARTTIME ENDIF sta timerHi ldx .loopInit: lda sta dex bpl lda sta lda sta lda sta lda sta bne

; ; ; ;

3 2 3 3

= $20

; 3

#27

; 2

InitTab,x harryPatPtr,x .loopInit

; ; ; ;

4 4 2 2�

#FRAMERATE-1 timerLo #31 treasureCnt #%10100000 livesPat #RAND_SEED random ContRandom

; ; ; ; ; ; ; ; ;

2 3 2 3 2 3 2 3 3

3 lives set starting scene

LeftRandom SUBROUTINE ; generate new random scene on the left: .loopRandom: ; random' = random >> 1 | (bit4^bit5^bit6^bit1) * $80 lda random ; 3 asl ; 2 eor random ; 3 asl ; 2 eor random ; 3 asl ; 2 asl ; 2 rol ; 2 eor random ; 3 lsr ; 2 ror random ; 5 dex ; 2 bpl .loopRandom ; 2� ContRandom: lda #124 ; 2 x-position of logs, fire, cobra or treasure sta xPosObject ; 3 lda random ; 3 lsr ; 2 lsr ; 2 lsr ; 2 pha ; 3 and #%111 ; 2 sta sceneType ; 3 bits 3..5 pla ; 4 lsr ; 2 lsr ; 2 lsr ; 2

sta lda and sta ldx ldy lda cmp bcs ldy ldx lda asl bcc ldx .setFlag: sty stx

treePat random #%111 objectType #SCREENWIDTH/2-4 #NOLADDER sceneType #HOLE3_SCENE+1 .setFlag #WITHLADDER #17 random .setFlag #136

; ; ; ; ; ; ; ; ; ; ; ; ; ; ;

ldx lda beq lda sta .noCrocos: rts

3 3 2 3 2 2 3 2 2� 2 2 3 2 2� 2

ladderFlag xPosScorpion

; 3 ; 3

sceneType CrocoTab,x .noCrocos #60 xPosObject

; ; ; ; ;

3 4 2� 2 3

; 6

align 256 Harry0: .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte Harry1: .byte .byte .byte .byte

%00000000 %00000000 %00000000 %00000000 %00000000 %00110011 %01110010 %11011010 %00011110 %00011100 %00011000 %01011000 %01011000 %01111100 %00111110 %00011010 %00011000 %00010000 %00011000 %00011000 %00011000 %00000000

; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;

| | | | | | | | | | | XX XX| | XXX X | |XX XX X | | XXXX | | XXX | | XX | | X XX | | X XX | | XXXXX | | XXXXX | | XX X | | XX | | X | | XX | | XX | | XX | | |

%00000000 %10000000 %10000000 %11000011

; ; ; ;

| |X |X |XX

| | | XX|

bits 6 & 7 bits 0..2 center x-position of scorpion scene with hole(s)? no, skip yes, enable ladder left wall x-position position of the wall? (bit 7) left, skip right wall x-position also used for wall position

x-position crocos

.byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte Harry2: .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte Harry3: .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte

%01100010 %01100010 %00110110 %00111110 %00011100 %00011000 %00011000 %00111100 %00111110 %00111010 %00111000 %00011000 %00011000 %00010000 %00011000 %00011000 %00011000 %00000000

; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;

| XX X | XX X | XX XX | XXXXX | XXX | XX | XX | XXXX | XXXXX | XXX X | XXX | XX | XX | X | XX | XX | XX |

| | | | | | | | | | | | | | | | | |

%00010000 %00100000 %00100010 %00100100 %00110100 %00110010 %00010110 %00011110 %00011100 %00011000 %00011000 %00011100 %00011100 %00011000 %00011000 %00011000 %00011000 %00010000 %00011000 %00011000 %00011000 %00000000

; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;

| | | | | | | | | | | | | | | | | | | | | |

X X X X X X XX X XX X X XX XXXX XXX XX XX XXX XXX XX XX XX XX X XX XX XX

| | | | | | | | | | | | | | | | | | | | | |

%00001100 %00001000 %00101000 %00101000 %00111110 %00001010 %00001110 %00011100 %00011000 %00011000 %00011100 %00011100 %00011000 %00011000 %00011000 %00011000

; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;

| | | | | | | | | | | | | | | |

XX X X X X X XXXXX X X XXX XXX XX XX XXX XXX XX XX XX XX

| | | | | | | | | | | | | | | |

.byte .byte .byte .byte .byte .byte Harry4: .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte Harry5: .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte Harry6: .byte .byte .byte .byte .byte

%00011000 %00010000 %00011000 %00011000 %00011000 %00000000

; ; ; ; ; ;

| | | | | |

XX X XX XX XX

%00000000 %00000010 %01000011 %01000100 %01110100 %00010100 %00011100 %00011100 %00011000 %00011000 %00011000 %00111100 %00111110 %00111010 %00111000 %00011000 %00011000 %00010000 %00011000 %00011000 %00011000 %00000000

; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;

| | | X | | X XX| | X X | | XXX X | | X X | | XXX | | XXX | | XX | | XX | | XX | | XXXX | | XXXXX | | XXX X | | XXX | | XX | | XX | | X | | XX | | XX | | XX | | |

%00011000 %00010000 %00011100 %00011000 %00011000 %00011000 %00011000 %00011000 %00011000 %00011000 %00011000 %00011000 %00011100 %00011110 %00011010 %00011000 %00011000 %00010000 %00011000 %00011000 %00011000 %00000000

; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;

| | | | | | | | | | | | | | | | | | | | | |

%00000000 %00000000 %00000000 %00000000 %00000000

; ; ; ; ;

| | | | |

XX X XXX XX XX XX XX XX XX XX XX XX XXX XXXX XX X XX XX X XX XX XX

| | | | | |

| | | | | | | | | | | | | | | | | | | | | | | | | | |

.byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte Harry7: .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte Harry8: .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte

%00000000 %01100011 %11110010 %11110110 %11011100 %11000000 %11000000 %11000000 %11000000 %11000000 %11110000 %11010000 %10010000 %11010000 %11010000 %11000000 %00000000

; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;

| | | XX XX| |XXXX X | |XXXX XX | |XX XXX | |XX | |XX | |XX | |XX | |XX | |XXXX | |XX X | |X X | |XX X | |XX X | |XX | | |

%00110000 %00010000 %00010000 %00010000 %00010110 %00010100 %00010100 %00010110 %00010010 %00010110 %00011110 %00011100 %00011000 %00111000 %00111000 %00111100 %00011110 %00011010 %00000010 %00011000 %00011000 %00011000

; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;

| | | | | | | | | | | | | | | | | | | | | |

%00001100 %00001000 %00001000 %00001000 %01101000 %00101000 %00101000 %01101000 %01001000 %01101000 %01111000 %00111000 %00011000 %00011100 %00011100 %00111100 %01111000

; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;

| | | | | | | | | | | | | | | | |

XX X X X X XX X X X X X XX X X X XX XXXX XXX XX XXX XXX XXXX XXXX XX X X XX XX XX XX X X X XX X X X X X XX X X X XX X XXXX XXX XX XXX XXX XXXX XXXX

| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |

.byte .byte .byte .byte

%01011000 %01000000 %00011000 %00011000

BranchTab: .byte %00011000 .byte %01111110 .byte %11011011 .byte %10011001 .byte %10011001 .byte %10011001 .byte %10011001 .byte %10011001 .byte %10011001 PF1LogTab: .byte %10000000 .byte %00100000 .byte %00001000 .byte %00000100 PF2LogTab: .byte %00000001 .byte %00000100 .byte %00010000 .byte %00100000

; ; ; ;

| X XX | X | XX | XX

| | | |

; ; ; ; ; ; ; ; ;

| XX | | XXXXXX | |XX XX XX| |X XX X| |X XX X| |X XX X| |X XX X| |X XX X| |X XX X|

; ; ; ;

|X | X | X | X

; ; ; ;

| | | |

X X X

| | | | X| | | |

; values for positioning branches (fine and coarse): BranchPosLTab: .byte $43, $c3, $34, $f4 BranchPosRTab: .byte $f2, $72, $00, $40 ; pattern for different the jungle grounds: PF2PatTab: OneHole: .byte %01111111 ; | XXXXXXX| one hole .byte %01111111 ; | XXXXXXX| .byte %01111111 ; | XXXXXXX| .byte %11111111 ; |XXXXXXXX| .byte %11111111 ; |XXXXXXXX| .byte %11111111 ; |XXXXXXXX| .byte %11111111 ; |XXXXXXXX| .byte %11111111 ; |XXXXXXXX| ThreeHoles: .byte %01111000 ; | XXXX | three holes .byte %01111000 ; | XXXX | .byte %01111000 ; | XXXX | .byte %11111111 ; |XXXXXXXX| .byte %11111111 ; |XXXXXXXX| .byte %11111111 ; |XXXXXXXX| .byte %11111111 ; |XXXXXXXX| .byte %11111111 ; |XXXXXXXX| Pit: .byte %00000000 ; | | pits .byte %00000001 ; | X| .byte %00000011 ; | XX| .byte %00001111 ; | XXXX| .byte %01111111 ; | XXXXXXX|

.byte %11111111 ; |XXXXXXXX| .byte %11111111 ; |XXXXXXXX| .byte %11111111 ; |XXXXXXXX| .byte .byte .byte .byte .byte .byte .byte .byte

%11111111 %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 %11111111

; ; ; ; ; ; ; ;

|XXXXXXXX| |XXXXXXXX| |XXXXXXXX| |XXXXXXXX| |XXXXXXXX| |XXXXXXXX| |XXXXXXXX| |XXXXXXXX|

.byte .byte .byte .byte .byte .byte .byte .byte

%11111111 %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 %11111111

; ; ; ; ; ; ; ;

|XXXXXXXX| |XXXXXXXX| |XXXXXXXX| |XXXXXXXX| |XXXXXXXX| |XXXXXXXX| |XXXXXXXX| |XXXXXXXX|

QuickSandSize: .byte 0, 4, 8, 16, 28 ; Harry's colors while climbing: ClimbColTab: .byte DARK_GREEN .byte DARK_GREEN .byte DARK_GREEN .byte DARK_GREEN .byte DARK_GREEN .byte DARK_GREEN .byte DARK_GREEN .byte DARK_GREEN .byte DARK_GREEN .byte DARK_GREEN .byte DARK_GREEN .byte DARK_GREEN .byte YELLOW_GREEN .byte YELLOW_GREEN .byte YELLOW_GREEN .byte YELLOW_GREEN .byte YELLOW_GREEN .byte YELLOW_GREEN .byte PINK .byte PINK .byte PINK .byte BROWN ; Harry's colors while running: RunColTab: .byte DARK_GREEN .byte DARK_GREEN .byte DARK_GREEN .byte DARK_GREEN .byte DARK_GREEN .byte DARK_GREEN .byte DARK_GREEN

.byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte SoundTab: .byte $0b, $0b .byte $8b, $06 .byte .byte .byte $19, $19 .byte $14, $15 .byte .byte

DARK_GREEN DARK_GREEN DARK_GREEN YELLOW_GREEN YELLOW_GREEN YELLOW_GREEN YELLOW_GREEN YELLOW_GREEN YELLOW_GREEN YELLOW_GREEN PINK PINK PINK BROWN $13, $13, $13, $13, $13, $13, $13, $09, $0b, $0b, $0b, $0b, $0b, $0b, $0b, $0b, $0b, $0b, $09, $0b, $09, $0b, $0b, $0b, $0b, $0b, $0b, $0b, $04, $03, $02, $84 $13, $13, $0e, $0b, $09, $09, $09, $0b, $09, $09, $09, $89 $1d, $1d, $1d, $1d, $1d, $1d, $1d, $1d, $1d, $1a, $1a, $19, $19, $19, $19, $1d, $1d, $1d, $1d, $1d, $14, $15, $14, $15, $14, $15, $14, $15, $14, $95 $18, $19, $1a, $1b, $1c, $1d, $1e, $9f

QuickSandTab: .byte %00000000 .byte %00001111 .byte %00001111 .byte %00000000 .byte %00001111

; ; ; ; ;

| | | | |

LadderTab: .byte BLACKPIT|DISABLE, .byte BLUEPIT |DISABLE, .byte DISABLE, DISABLE, LianaTab: .byte DISABLE, DISABLE, CheckTreasures: lda random rol rol rol and #$03 tax ldy objectType lda TreasureMask,y tay and treasureBits,x php tya ora treasureBits,x plp

| XXXX| XXXX| | XXXX|

next byte (0) overlaps

BLACKPIT|DISABLE, BLACKPIT|ENABLE, BLUEPIT|ENABLE BLACKPIT|DISABLE, BLACKPIT|ENABLE, BLUEPIT|ENABLE ENABLE, ENABLE ; some bytes overlap ENABLE, ENABLE, ENABLE, DISABLE, ENABLE, DISABLE ; ; ; ; ; ; ; ; ; ; ; ; ; ;

3 2 2 2 2 2 3 4 2 4 3 2 4 4

bits 7 & 8

rts

; 6

SetDigitPtrs SUBROUTINE ldx #2 .loopSet: txa asl asl tay jsr BCD2DigitPtrs dex bpl .loopSet rts

; ; ; ; ; ; ; ;

2 2 2 2 6 2 2� 6

KilledHarry SUBROUTINE lda #SOUND_DEAD sta soundIdx lda #$84 sta noGameScroll jmp ProcessObjects

; ; ; ; ;

2 3 2 3 3

; 2

; the bounds of the holes and pits where Harry HoleBoundsTab: .byte 72, 79, 0, 0, 0, 0, 0, 0 .byte 44, 55, 72, 79, 96,107, 0, 0 .byte 44,107, 0, 0, 0, 0, 0, 0 .byte 44, 55, 64, 71, 80, 87, 96,107 .byte 44, 61, 64, 77, 80, 93, 96,107 align 256 Log0: .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte Log1: .byte .byte .byte .byte .byte .byte .byte .byte .byte

%00000000; %00011000; %00100100; %01011010; %01011010; %01011010; %01100110; %01111110; %01011110; %01110110; %01111110; %01011110; %01110110; %00111100; %00011000; %00000000;

| | | | | | | | | | | | | | | |

%00000000; %00011000; %00100100; %01011010; %01011010; %01011010; %01100110; %01111110; %01111010;

| | | | | | | | |

XX X X X XX X X XX X X XX X XX XX XXXXXX X XXXX XXX XX XXXXXX X XXXX XXX XX XXXX XX

XX X X X XX X X XX X X XX X XX XX XXXXXX XXXX X

| | | | | | | | | | | | | | | | | | | | | | | | |

-> 8

start copyright.. ..animation falls down: ; ; ; ; ;

single hole triple hole pit closed croco jaws open croco jaws

.byte .byte .byte .byte .byte .byte .byte Fire0: .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte Fire1: .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte Cobra0: .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte

%01101110; %01111110; %01111010; %01101110; %00111100; %00011000; %00000000;

| | | | | | |

XX XXX XXXXXX XXXX X XX XXX XXXX XX

| | | | | | |

%00000000; %11000011; %11100111; %01111110; %00111100; %00011000; %00111100; %01111100; %01111100; %01111000; %00111000; %00111000; %00110000; %00110000; %00010000; %00010000;

| | |XX XX| |XXX XXX| | XXXXXX | | XXXX | | XX | | XXXX | | XXXXX | | XXXXX | | XXXX | | XXX | | XXX | | XX | | XX | | X | | X |

%00000000; %11000011; %11100111; %01111110; %00111100; %00011000; %00111100; %00111110; %00111110; %00011110; %00011100; %00011100; %00001100; %00001100; %00001000; %00001000;

| | |XX XX| |XXX XXX| | XXXXXX | | XXXX | | XX | | XXXX | | XXXXX | | XXXXX | | XXXX | | XXX | | XXX | | XX | | XX | | X | | X |

%00000000; %11111110; %11111001; %11111001; %11111001; %11111001; %01100000; %00010000; %00001000; %00001100; %00001100; %00001000; %00111000; %00110000; %01000000; %00000000;

| | |XXXXXXX | |XXXXX X| |XXXXX X| |XXXXX X| |XXXXX X| | XX | | X | | X | | XX | | XX | | X | | XXX | | XX | | X | | |

Cobra1: .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte Croco0: .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte Croco1: .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte MoneyBag: .byte .byte .byte .byte .byte .byte

%00000000; %11111110; %11111001; %11111001; %11111010; %11111010; %01100000; %00010000; %00001000; %00001100; %00001100; %00001000; %00111000; %00110000; %10000000; %00000000;

| | |XXXXXXX | |XXXXX X| |XXXXX X| |XXXXX X | |XXXXX X | | XX | | X | | X | | XX | | XX | | X | | XXX | | XX | |X | | |

%00000000; %00000000; %00000000; %00000000; %00000000; %11111111; %10101011; %00000011; %00000011; %00001011; %00101110; %10111010; %11100000; %10000000; %00000000; %00000000;

| | | | | | | | | | |XXXXXXXX| |X X X XX| | XX| | XX| | X XX| | X XXX | |X XXX X | |XXX | |X | | | | |

%00000000; %00000000; %00000000; %00000000; %00000000; %11111111; %10101011; %01010101; %11111111; %00000110; %00000100; %00000000; %00000000; %00000000; %00000000; %00000000;

| | | | | | | | | | |XXXXXXXX| |X X X XX| | X X X X| |XXXXXXXX| | XX | | X | | | | | | | | | | |

%00000000; %00111110; %01110111; %01110111; %01100011; %01111011;

| | | | | |

| XXXXX | XXX XXX| XXX XXX| XX XX| XXXX XX|

.byte %01100011; .byte %01101111; .byte %01100011; .byte %00110110; .byte %00110110; .byte %00011100; .byte %00001000; .byte %00011100; .byte %00110110; .byte %00000000; Scorpion0: .byte %10000101; .byte %00110010; .byte %00111101; .byte %01111000; .byte %11111000; .byte %11000110; .byte %10000010; .byte %10010000; .byte %10001000; .byte %11011000; .byte %01110000; .byte %00000000; .byte %00000000; .byte %00000000; .byte %00000000; .byte %00000000; Scorpion1: .byte %01001001; .byte %00110011; .byte %00111100; .byte %01111000; .byte %11111010; .byte %11000100; .byte %10010010; .byte %10001000; .byte %11011000; .byte %01110000; .byte %00000000; .byte %00000000; .byte %00000000; .byte %00000000; .byte %00000000; .byte %00000000; Wall: .byte %11111110; .byte %10111010; .byte %10111010; .byte %10111010; .byte %11111110; .byte %11101110; .byte %11101110; .byte %11101110; .byte %11111110; .byte %10111010; .byte %10111010; .byte %10111010; .byte %11111110;

| XX XX| | XX XXXX| | XX XX| | XX XX | | XX XX | | XXX | | X | | XXX | | XX XX | | | |X X X| | XX X | | XXXX X| | XXXX | |XXXXX | |XX XX | |X X | |X X | |X X | |XX XX | | XXX | | | | | | | | | | | | X X X| | XX XX| | XXXX | | XXXX | |XXXXX X | |XX X | |X X X | |X X | |XX XX | | XXX | | | | | | | | | | | | | |XXXXXXX |X XXX X |X XXX X |X XXX X |XXXXXXX |XXX XXX |XXX XXX |XXX XXX |XXXXXXX |X XXX X |X XXX X |X XXX X |XXXXXXX

| | | | | | | | | | | | |

.byte .byte .byte Bar0: .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte Bar1: .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte Ring: .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte Nothing: .byte .byte .byte

%11101110; |XXX XXX | %11101110; |XXX XXX | %11101110; |XXX XXX | %00000000; %11111000; %11111100; %11111110; %11111110; %01111110; %00111110; %00000000; %00010000; %00000000; %01010100; %00000000; %10010010; %00000000; %00010000; %00000000;

| |XXXXX |XXXXXX |XXXXXXX |XXXXXXX | XXXXXX | XXXXX | | X | | X X X | |X X X | | X |

| | | | | | | | | | | | | | | |

%00000000; %11111000; %11111100; %11111110; %11111110; %01111110; %00111110; %00000000; %00000000; %00101000; %00000000; %01010100; %00000000; %00010000; %00000000; %00000000;

| |XXXXX |XXXXXX |XXXXXXX |XXXXXXX | XXXXXX | XXXXX | | | X X | | X X X | | X | |

| | | | | | | | | | | | | | | |

%00000000; %00000000; %00111000; %01101100; %01000100; %01000100; %01000100; %01101100; %00111000; %00010000; %00111000; %01111100; %00111000; %00000000; %00000000; %00000000;

| | | | | | | | | | | | | | | |

| | | | | | | | | | | | | | | |

%00000000; | %00000000; | %00000000; |

XXX XX XX X X X X X X XX XX XXX X XXX XXXXX XXX

| | |

.byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte

%00000000; %00000000; %00000000; %00000000; %00000000; %00000000; %00000000; %00000000; %00000000; %00000000; %00000000; %00000000; %00000000;

| | | | | | | | | | | | |

| | | | | | | | | | | | |

align 256 IF OPTIMIZE LogColor: .byte BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN .byte BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN FILL_NOP 1 ; JTZ: the logs are only 15 lines tall .pcFire: FireColor = .pcFire - 1 .byte BROWN-2, BROWN-2, BROWN-2, BROWN-2, ORANGE, ORANGE, ORANGE .byte $2e, $2e, $2e, $2e, $2e, $2e, $2e FILL_NOP 2 ; JTZ: the fire is only 14 lines tall .pcCobra: CobraColor = .pcCobra-1 .byte BLACK, GREY-2, BLACK, GREY-2, BLACK, BLACK, BLACK .byte BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, DARK_RED FILL_NOP 2 ; JTZ: the cobra is only 14 bytes tall .pcCroco: CrocoColor = .pcCroco-5 .byte DARK_GREEN-2, DARK_GREEN-2, DARK_GREEN-2, DARK_GREEN-2, DARK_GREEN-2, DARK_GREEN-2, DARK_GREEN-2, DARK_GREEN-2 .byte DARK_GREEN-2 FILL_NOP 7 ; JTZ: the crocos are only 9 lines tall .pcMoneyBag: MoneyBagColor = .pcMoneyBag-1 .byte GREY-2, GREY-2, GREY-2, GREY-2, GREY-2, GREY-2, GREY-2 .byte GREY-2, GREY-2, GREY-2, GREY-2, BROWN, GREY-2, GREY-2 FILL_NOP 2 ; JTZ: the moneybag is only 9 lines tall ScorpionColor: .byte WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE .byte WHITE, WHITE, WHITE FILL_NOP 5 ; JTZ: the scorpion is only 11 lines tall ELSE LogColor: .byte BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN .byte BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN, BROWN FireColor: .byte BROWN-2, BROWN-2, BROWN-2, BROWN-2, BROWN-2, ORANGE, ORANGE, ORANGE .byte $2e, $2e, $2e, $2e, $2e, $2e, $2e, $2e CobraColor: .byte BLACK, BLACK, GREY-2, BLACK, GREY-2, BLACK, BLACK, BLACK .byte BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, DARK_RED, DARK_RED CrocoColor: .byte DARK_GREEN-2, DARK_GREEN-2, DARK_GREEN-2, DARK_GREEN-2, DARK_GREEN-2,

DARK_GREEN-2, DARK_GREEN-2, DARK_GREEN-2 .byte DARK_GREEN-2, DARK_GREEN-2, DARK_GREEN-2, DARK_GREEN-2, DARK_GREEN-2, DARK_GREEN-2, DARK_GREEN-2, DARK_GREEN-2 MoneyBagColor: .byte GREY-2, GREY-2, GREY-2, GREY-2, GREY-2, GREY-2, GREY-2, GREY-2 .byte GREY-2, GREY-2, GREY-2, GREY-2, BROWN, GREY-2, GREY-2, GREY-2 ScorpionColor: .byte WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE .byte WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE ENDIF WallColor: .byte GREY, DARK_RED, DARK_RED, DARK_RED, GREY, DARK_RED, DARK_RED, DARK_RED .byte GREY, DARK_RED, DARK_RED, DARK_RED, GREY, DARK_RED RingColor: .byte DARK_RED, DARK_RED GoldBarColor: .byte YELLOW, YELLOW, YELLOW, YELLOW, YELLOW, YELLOW, YELLOW, YELLOW .byte WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE .byte WHITE SilverBarColor: .byte GREY, GREY, GREY, GREY, GREY, GREY, GREY, WHITE .byte WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE InitTab: .word .word .word .word .word .word .word .word .word .word .word .word .word .word

Harry5 Log0 RunColTab LogColor Wall WallColor Wall WallColor Space Space Two Zero Zero Zero

; ; ; ;

harryPatPtr objPatPtr harryColPtr objColPtr

RightRandom SUBROUTINE ; generate new random scene on the right: .loopRandom: ; random' = random << 1 | (bit3^bit4^bit5^bit7) lda random ; 3 asl ; 2 eor random ; 3 asl ; 2 eor random ; 3 asl ; 2 asl ; 2 eor random ; 3 asl ; 2 rol random ; 5 dex ; 2 bpl .loopRandom ; 2� jmp ContRandom ; 3

; low pointer to harry data: HarryPtrTab: .byte
; silver bar ; gold bar

TreasureMask: .byte %10000000 .byte %01000000 .byte %00100000 .byte %00010000 .byte %00001000 .byte %00000100 .byte %00000010 .byte %00000001 align 256 Zero: .byte .byte .byte .byte .byte .byte .byte .byte One: .byte .byte .byte .byte

%00111100; %01100110; %01100110; %01100110; %01100110; %01100110; %01100110; %00111100;

| | | | | | | |

XXXX XX XX XX XX XX XX XX XX XX XX XX XX XXXX

| | | | | | | |

%00111100; %00011000; %00011000; %00011000;

| | | |

XXXX XX XX XX

| | | |

.byte .byte .byte .byte

%00011000; %00011000; %00111000; %00011000;

| | | |

XX XX XXX XX

| | | |

.byte .byte .byte .byte .byte .byte .byte .byte Three: .byte .byte .byte .byte .byte .byte .byte .byte Four: .byte .byte .byte .byte .byte .byte .byte .byte Five .byte .byte .byte .byte .byte .byte .byte .byte Six: .byte .byte .byte .byte .byte .byte .byte .byte Seven: .byte .byte .byte .byte .byte .byte .byte .byte

%01111110; %01100000; %01100000; %00111100; %00000110; %00000110; %01000110; %00111100;

| | | | | | | |

XXXXXX XX XX XXXX XX XX X XX XXXX

| | | | | | | |

%00111100; %01000110; %00000110; %00001100; %00001100; %00000110; %01000110; %00111100;

| XXXX | X XX | XX | XX | XX | XX | X XX | XXXX

| | | | | | | |

%00001100; %00001100; %00001100; %01111110; %01001100; %00101100; %00011100; %00001100;

| XX | | XX | | XX | | XXXXXX | | X XX | | X XX | | XXX | | XX |

%01111100; %01000110; %00000110; %00000110; %01111100; %01100000; %01100000; %01111110;

| | | | | | | |

XXXXX X XX XX XX XXXXX XX XX XXXXXX

| | | | | | | |

%00111100; %01100110; %01100110; %01100110; %01111100; %01100000; %01100010; %00111100;

| | | | | | | |

XXXX XX XX XX XX XX XX XXXXX XX XX X XXXX

| | | | | | | |

%00011000; %00011000; %00011000; %00011000; %00001100; %00000110; %01000010; %01111110;

| XX | XX | XX | XX | XX | XX | X X | XXXXXX

| | | | | | | |

Two:

Eight: .byte %00111100; .byte %01100110; .byte %01100110; .byte %00111100; .byte %00111100; .byte %01100110; .byte %01100110; .byte %00111100; Nine: .byte %00111100; .byte %01000110; .byte %00000110; .byte %00111110; .byte %01100110; .byte %01100110; .byte %01100110; .byte %00111100; DoublePoint: .byte %00000000; .byte %00011000; .byte %00011000; .byte %00000000; .byte %00000000; .byte %00011000; .byte %00011000; .byte %00000000; Space: .byte %00000000; .byte %00000000; .byte %00000000; .byte %00000000; .byte %00000000; .byte %00000000; .byte %00000000; .byte %00000000; CopyRight0: .byte %00000000; .byte %00000000; .byte %11110111; .byte %10010101; .byte %10000111; .byte %10000000; .byte %10010000; .byte %11110000; .byte %10101101; .byte %10101001; .byte %11101001; .byte %10101001; .byte %11101101; .byte %01000001; .byte %00001111; .byte %00000000; CopyRight1: .byte %01000111; .byte %01000001; .byte %01110111; .byte %01010101;

| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |

XXXX XX XX XX XX XXXX XXXX XX XX XX XX XXXX

| | | | | | | |

XXXX XX XX XXXXX XX XX XX XX XX XX XXXX

| | | | | | | |

X

XX XX XX XX

| | | | | | | | | | | | | | | |

| | | | |XXXX XXX| |X X X X| |X XXX| |X | |X X | |XXXX | |X X XX X| |X X X X| |XXX X X| |X X X X| |XXX XX X| | X X| | XXXX| | | | | | |

X XXX| X X| XXX XXX| X X X X|

.byte %01110101; .byte %00000000; .byte %00000000; .byte %00000000; .byte %01010000; .byte %01011000; .byte %01011100; .byte %01010110; .byte %01010011; .byte %00010001; .byte %11110000; .byte %00000000; CopyRight2: .byte %00000011; .byte %00000000; .byte %01001011; .byte %01001010; .byte %01101011; .byte %00000000; .byte %00001000; .byte %00000000; .byte %10111010; .byte %10001010; .byte %10111010; .byte %10100010; .byte %00111010; .byte %10000000; .byte %11111110; .byte %00000000; CopyRight3: .byte %10000000; .byte %10000000; .byte %10101010; .byte %10101010; .byte %10111010; .byte %00100010; .byte %00100111; .byte %00000010; .byte %11101001; .byte %10101011; .byte %10101111; .byte %10101101; .byte %11101001; .byte %00000000; .byte %00000000; .byte %00000000; CopyRight4: .byte %00000000; .byte %00000000; .byte %00010001; .byte %00010001; .byte %00010111; .byte %00010101; .byte %00010111; .byte %00000000; .byte %00000000; .byte %00000000; .byte %00000000;

| XXX X X| | | | | | | | X X | | X XX | | X XXX | | X X XX | | X X XX| | X X| |XXXX | | | | XX| | | | X X XX| | X X X | | XX X XX| | | | X | | | |X XXX X | |X X X | |X XXX X | |X X X | | XXX X | |X | |XXXXXXX | | | |X | |X | |X X X X | |X X X X | |X XXX X | | X X | | X XXX| | X | |XXX X X| |X X X XX| |X X XXXX| |X X XX X| |XXX X X| | | | | | | | | | | | | | | | | |

X X X X X

| | X| X| XXX| X X| XXX| | | | |

.byte %00000000; .byte %00000000; .byte %00000000; .byte %00000000; .byte %00000000; CopyRight5: .byte %00000000; .byte %00000000; .byte %01110111; .byte %01010100; .byte %01110111; .byte %01010001; .byte %01110111; .byte %00000000; ColorTab: .byte .byte .byte .byte .byte .byte .byte .byte .byte

| | | | |

| | | | |

| | | | | | | |

| | XXX| X | XXX| X| XXX| |

XXX X X XXX X X XXX

$0C $0C DARK_GREEN GREEN BLACK BROWN-2 BROWN+2 YELLOW-6 BLUE

; ; ; ; ; ; ; ; ;

score and copyright color unused leaves color jungle color hole, background and tar pit color branches and log color underground color ground color swamp color

; ; ; ; ; ; ; ; ; ; ; ;

one rolling logs two rolling logs two wide rolling logs three rolling logs one stationary log three stationary logs fire cobra money bag silver bar gold bar ring

Color1PtrTab: .byte
; used to animate some of the hazards: AnimateTab: .byte 0 ; logs .byte 0

.byte .byte .byte .byte .byte .byte .byte .byte .byte .byte .byte

0 0 0 0 OBJECT_H OBJECT_H 0 OBJECT_H OBJECT_H 0 0

GroundTypeTab: .byte <[OneHole .byte <[ThreeHoles .byte <[Pit .byte <[Pit .byte <[Pit .byte $80 .byte $80 .byte $80

-

PF2PatTab] PF2PatTab] PF2PatTab] PF2PatTab] PF2PatTab]

; crocodile in scene? CrocoTab: .ds CROCO_SCENE, 0 .byte 1 .ds 7-CROCO_SCENE, 0 org

$fffc

.word $f000 .word 0

; ; ; ; ; ; ;

fire cobra money bag silver bar gold bar ring nothing (treasure collected)

; ; ; ; ; ; ; ;

one hole three holes tar pit swamp swamp with crocodiles black quicksand with treasure black quicksand blue quicksand

Related Documents


More Documents from ""