Advertisement
Guest User

E.T. the Extra-Terrestrial(1982) Atari 2600 Source Code

a guest
May 1st, 2014
41,084
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 209.38 KB | None | 0 0
  1. LIST OFF
  2. ; *** E . T. T H E E X T R A - T E R R E S T R I A L ***
  3. ; Copyright 1982 Atari, Inc.
  4. ; Designer: Howard Scott Warshaw
  5. ; Artist: Jerome Domurat
  6.  
  7. ; Analyzed, labeled and commented
  8. ; by Dennis Debro
  9. ; Last Update: July 18, 2006
  10. ;
  11. ; *** 116 BYTES OF RAM USED 12 BYTES FREE
  12. ;
  13. ; NTSC ROM usage stats
  14. ; -------------------------------------------
  15. ; *** 25 BYTES OF ROM FREE IN BANK0
  16. ; *** 24 BYTES OF ROM FREE IN BANK1
  17. ; ===========================================
  18. ; *** 49 TOTAL BYTES FREE
  19. ;
  20. ; PAL ROM usage stats
  21. ; -------------------------------------------
  22. ; *** 23 BYTES OF ROM FREE IN BANK0
  23. ; *** 24 BYTES OF ROM FREE IN BANK1
  24. ; ===========================================
  25. ; *** 47 TOTAL BYTES FREE
  26.  
  27. ; This is Howard Scott Warshaw's third game with Atari. It was conceived and
  28. ; developed in roughly 5 weeks! The licensing deal didn't complete until the
  29. ; end of July (in an interview Howard says July 25). Atari wanted this game
  30. ; for the Christmas season which meant Howard had to finish this game by
  31. ; September 1st!
  32. ;
  33. ; - Pits are arranged in the order of...
  34. ; 1) ID_FOUR_DIAMOND_PITS
  35. ; 2) ID_EIGHT_PITS
  36. ; 3) ID_ARROW_PITS
  37. ; 4) ID_WIDE_DIAMOND_PITS
  38. ; - Objects are never placed in the overlapping pits for ID_EIGHT_PITS
  39. ; - Playfield is a 2LK while sprites are a 1LK
  40. ; - PAL conversion adjusts E.T. movement and colors
  41. ; - It seems RAM location $8B is not used
  42.  
  43. processor 6502
  44.  
  45. ;
  46. ; NOTE: You must compile this with vcs.h version 105 or greater.
  47. ;
  48. TIA_BASE_READ_ADDRESS = $30 ; set the read address base so this runs on
  49. ; the real VCS and compiles to the exact
  50. ; ROM image
  51.  
  52. include macro.h
  53. include vcs.h
  54.  
  55. LIST ON
  56.  
  57. ;============================================================================
  58. ; A S S E M B L E R - S W I T C H E S
  59. ;============================================================================
  60.  
  61. NTSC = 0
  62. PAL = 1
  63.  
  64. COMPILE_VERSION = NTSC ; change this to compile for different
  65. ; regions
  66.  
  67. ;============================================================================
  68. ; T I A - M U S I C C O N S T A N T S
  69. ;============================================================================
  70.  
  71. SOUND_CHANNEL_SAW = 1 ; sounds similar to a saw waveform
  72. SOUND_CHANNEL_ENGINE = 3 ; many games use this for an engine sound
  73. SOUND_CHANNEL_SQUARE = 4 ; a high pitched square waveform
  74. SOUND_CHANNEL_BASS = 6 ; fat bass sound
  75. SOUND_CHANNEL_PITFALL = 7 ; log sound in pitfall, low and buzzy
  76. SOUND_CHANNEL_NOISE = 8 ; white noise
  77. SOUND_CHANNEL_LEAD = 12 ; lower pitch square wave sound
  78. SOUND_CHANNEL_BUZZ = 15 ; atonal buzz, good for percussion
  79.  
  80. LEAD_F4_SHARP = 13
  81. LEAD_E4 = 15
  82. LEAD_D4_SHARP = 16
  83. LEAD_D4 = 17
  84. LEAD_C4_SHARP = 18
  85. LEAD_H3 = 20
  86. LEAD_A3 = 23
  87. LEAD_G3_SHARP = 24
  88. LEAD_F3_SHARP = 27
  89. LEAD_E3_2 = 31
  90.  
  91. ;============================================================================
  92. ; T I A - C O N S T A N T S
  93. ;============================================================================
  94.  
  95. HMOVE_L7 = $70
  96. HMOVE_L6 = $60
  97. HMOVE_L5 = $50
  98. HMOVE_L4 = $40
  99. HMOVE_L3 = $30
  100. HMOVE_L2 = $20
  101. HMOVE_L1 = $10
  102. HMOVE_0 = $00
  103. HMOVE_R1 = $F0
  104. HMOVE_R2 = $E0
  105. HMOVE_R3 = $D0
  106. HMOVE_R4 = $C0
  107. HMOVE_R5 = $B0
  108. HMOVE_R6 = $A0
  109. HMOVE_R7 = $90
  110. HMOVE_R8 = $80
  111.  
  112. ; values for ENAMx and ENABL
  113. DISABLE_BM = %00
  114. ENABLE_BM = %10
  115.  
  116. ; values for RESMPx
  117. LOCK_MISSILE = %10
  118. UNLOCK_MISSILE = %00
  119.  
  120. ; values for REFPx:
  121. NO_REFLECT = %0000
  122. REFLECT = %1000
  123.  
  124. ; values for NUSIZx:
  125. ONE_COPY = %000
  126. TWO_COPIES = %001
  127. TWO_MED_COPIES = %010
  128. THREE_COPIES = %011
  129. TWO_WIDE_COPIES = %100
  130. DOUBLE_SIZE = %101
  131. THREE_MED_COPIES = %110
  132. QUAD_SIZE = %111
  133. MSBL_SIZE1 = %000000
  134. MSBL_SIZE2 = %010000
  135. MSBL_SIZE4 = %100000
  136. MSBL_SIZE8 = %110000
  137.  
  138. ; values for CTRLPF:
  139. PF_PRIORITY = %100
  140. PF_SCORE = %10
  141. PF_REFLECT = %01
  142. PF_NO_REFLECT = %00
  143.  
  144. ; values for SWCHB
  145. P1_DIFF_MASK = %10000000
  146. P0_DIFF_MASK = %01000000
  147. BW_MASK = %00001000
  148. SELECT_MASK = %00000010
  149. RESET_MASK = %00000001
  150.  
  151. VERTICAL_DELAY = 1
  152.  
  153. ; SWCHA joystick bits:
  154. MOVE_RIGHT = %01111111
  155. MOVE_LEFT = %10111111
  156. MOVE_DOWN = %11011111
  157. MOVE_UP = %11101111
  158. P0_NO_MOVE = %11110000
  159. P1_NO_MOVE = %00001111
  160. NO_MOVE = P0_NO_MOVE | P1_NO_MOVE
  161.  
  162. ; values for VBLANK:
  163. DUMP_PORTS = %10000000
  164. ENABLE_LATCHES = %01000000
  165. DISABLE_TIA = %00000010
  166. ENABLE_TIA = %00000000
  167.  
  168. ;values for VSYNC:
  169. START_VERT_SYNC = %10
  170. STOP_VERT_SYNC = %00
  171.  
  172. ;============================================================================
  173. ; U S E R - C O N S T A N T S
  174. ;============================================================================
  175.  
  176. BANK0TOP = $1000
  177. BANK1TOP = $2000
  178.  
  179. BANK0_REORG = $B000
  180. BANK1_REORG = $F000
  181.  
  182. BANK0STROBE = $FFF8
  183. BANK1STROBE = $FFF9
  184.  
  185. NTSC_OVERSCAN_TIME = 45
  186. NTSC_VBLANK_TIME = 47
  187. PAL_VBLANK_TIME = 78
  188. PAL_OVERSCAN_TIME = 72
  189.  
  190. IF COMPILE_VERSION = NTSC
  191.  
  192. VBLANK_TIME = NTSC_VBLANK_TIME
  193. OVERSCAN_TIME = NTSC_OVERSCAN_TIME
  194.  
  195. ; NTSC color constants
  196. BLACK = $00
  197. WHITE = $0E
  198. LT_RED = $20
  199. RED = $30
  200. ORANGE = $40
  201. ORANGE_2 = ORANGE
  202. RED_2 = ORANGE
  203. DK_PINK = $50
  204. DK_BLUE = $70
  205. BLUE = $80
  206. LT_BLUE = $90
  207. GREEN = $C0
  208. GREEN_2 = GREEN
  209. DK_GREEN = $D0
  210. DK_GREEN_2 = DK_GREEN
  211. LT_BROWN = $E0
  212. LT_BROWN_2 = LT_BROWN
  213. BROWN = $F0
  214. NTSC_BROWN = BROWN
  215.  
  216. START_LANDING_TIMER = 63 ; staring value for landing timer
  217.  
  218. FRAME_DELAY_ONE_HALF = $81 ; move 1 out of 2 frames
  219. FRAME_DELAY_ONE_THIRD = $5D ; move 1 out of 3 frames
  220. FRAME_DELAY_ONE_FORTH = $3F ; move 1 out of 4 frames
  221. FRAME_DELAY_ONE_FIFTH = $3B ; move 1 out of 5 frames
  222.  
  223. ELSE
  224.  
  225. VBLANK_TIME = PAL_VBLANK_TIME
  226. OVERSCAN_TIME = PAL_OVERSCAN_TIME
  227.  
  228. ; PAL color constants
  229. BLACK = $00
  230. WHITE = $0E
  231. LT_RED = $20
  232. LT_BROWN_2 = LT_RED
  233. BROWN = LT_RED
  234. GREEN_2 = $30
  235. RED = $40
  236. RED_2 = RED + 2
  237. ORANGE = RED
  238. LT_BROWN = $50
  239. DK_GREEN = LT_BROWN
  240. ORANGE_2 = $62
  241. DK_BLUE = $70
  242. DK_PINK = $80
  243. LT_BLUE = $90
  244. BLUE = $D0
  245. DK_GREEN_2 = BLUE
  246. GREEN = $E0
  247. NTSC_BROWN = $F0
  248.  
  249. START_LANDING_TIMER = 57 ; staring value for landing timer
  250.  
  251. FRAME_DELAY_ONE_HALF = $9A ; move 1 out of 2 frames
  252. FRAME_DELAY_ONE_THIRD = $6F ; move 1 out of 3 frames
  253. FRAME_DELAY_ONE_FORTH = $4B ; move 1 out of 4 frames
  254. FRAME_DELAY_ONE_FIFTH = $46 ; move 1 out of 5 frames
  255.  
  256. ENDIF
  257.  
  258. LDA_ABS = $AD ; instruction to LDA $XXXX
  259. JMP_ABS = $4C ; instruction for JMP $XXXX
  260.  
  261. XMIN = 0
  262. XMAX = 119
  263.  
  264. ET_YMIN = 0
  265. ET_YMAX = 58
  266.  
  267. OBJECT_IN_PIT_Y = 50
  268. OBJECT_IN_PIT_X = 41
  269.  
  270. PIT_XMIN = 32
  271. PIT_XMAX = 88
  272.  
  273. FBI_AGENT_VERT_MAX = 48
  274. ELLIOTT_VERT_MAX = 52
  275. SCIENTIST_VERT_MAX = 48
  276.  
  277. FBI_AGENT_VERT_TARGET = 15
  278. ELLIOTT_VERT_TARGET = 47
  279. SCIENTIST_VERT_TARGET = 15
  280.  
  281. FBI_AGENT_HORIZ_TARGET = 28
  282. ELLIOTT_HORIZ_TARGET = 60
  283. SCIENTIST_HORIZ_TARGET = 94
  284.  
  285. H_ET_GRAPH = 40 ; height of E.T. face for title screen
  286. H_FONT = 8
  287. H_FBIAGENT = 28
  288. H_ELLIOTT = 22
  289. H_SCIENTIST = 28
  290. H_PHONE_PIECES = 10
  291. H_FLOWER = 14
  292. H_MOTHERSHIP = 32
  293. H_YAR = 16
  294. H_INDY = 20
  295.  
  296. MAX_GAME_SELECTION = 3
  297.  
  298. MAX_ENERGY = $99 ; maximum energy value (BCD)
  299. MAX_HOLD_CANDY = 9 << 4
  300.  
  301. INIT_NUM_TRIES = 3 ; initial number of tries to get E.T. home
  302. NUM_PHONE_PIECES = 3
  303.  
  304. ; screen id values
  305. ID_FOUR_DIAMOND_PITS = 0
  306. ID_EIGHT_PITS = 1
  307. ID_ARROW_PITS = 2
  308. ID_WIDE_DIAMOND_PITS = 3
  309. ID_FOREST = 4
  310. ID_WASHINGTON_DC = 5
  311. ID_PIT = 6
  312. ID_ET_HOME = 7
  313. ID_TITLE_SCREEN = 8
  314.  
  315. ; pit id values
  316. ID_PIT_OUT_OF_RANGE = -1
  317.  
  318. ID_TOP_DIAMOND_PIT = 0
  319. ID_LEFT_DIAMOND_PIT = 1
  320. ID_RIGHT_DIAMOND_PIT = 2
  321. ID_LOWER_DIAMOND_PIT = 3
  322.  
  323. ID_TOP_EIGHT_PITS = 4
  324. ID_LEFT_EIGHT_PITS = 5
  325. ID_RIGHT_EIGHT_PIT = 6
  326. ID_BOTTOM_EIGHT_PIT = 7
  327.  
  328. ID_TOP_LEFT_ARROW_PIT = 8
  329. ID_TOP_RIGHT_ARROW_PIT = 9
  330. ID_LOWER_LEFT_ARROW_PIT = 10
  331. ID_LOWER_RIGHT_ARROW_PIT = 11
  332.  
  333. ID_UPPER_LEFT_WIDE_PIT = 12
  334. ID_UPPER_RIGHT_WIDE_PIT = 13
  335. ID_LOWER_LEFT_WIDE_PIT = 14
  336. ID_LOWER_RIGHT_WIDE_PIT = 15
  337.  
  338. ; object ids
  339. ID_FBIAGENT = 0
  340. ID_ELLIOTT = 1
  341. ID_SCIENTIST = 2
  342. ID_H_PHONE_PIECE = 3
  343. ID_S_PHONE_PIECE = 4
  344. ID_W_PHONE_PIECE = 5
  345. ID_FLOWER = 6
  346. ID_MOTHERSHIP = 7
  347. ID_YAR_0 = 8
  348. ID_YAR_1 = 9
  349. ID_INDY = 10
  350.  
  351. ; power zone indicator ids
  352. ID_BLANK_ZONE = 0
  353. ID_WARP_LEFT_ZONE = 1
  354. ID_WARP_RIGHT_ZONE = 2
  355. ID_WARP_UP_ZONE = 3
  356. ID_WARP_DOWN_ZONE = 4
  357. ID_FIND_PHONE_ZONE = 5
  358. ID_EAT_CANDY_ZONE = 6
  359. ID_RETURN_HOME_ZONE = 7
  360. ID_CALL_ELLIOTT_ZONE = 8
  361. ID_CALL_SHIP_ZONE = 9
  362. ID_LANDING_ZONE = 10
  363. ID_PIT_ZONE = 11
  364. ID_FLOWER_ZONE = 12
  365.  
  366. ; candy status values
  367. FOUR_DIAMOND_PITS_CANDY = %0001
  368. EIGHT_PITS_CANDY = %0010
  369. ARROW_PITS_CANDY = %0100
  370. WIDE_DIAMOND_PITS_CANDY = %1000
  371.  
  372. SHOW_HSW_INITIALS_VALUE = $69 ; BCD value :-)
  373.  
  374. ; player state values
  375. ET_DEAD = %10000000
  376. ELLIOTT_REVIVE_ET = %01000000
  377.  
  378. ; E.T. home Elliott movement values
  379. MOVE_ELLIOTT_RIGHT = %10000000
  380.  
  381. ; collected candy scoring values
  382. COLLECT_CANDY_SCORE_INC = %01000000
  383. CLOSED_EATING_CANDY_ICON = %00000001
  384.  
  385. ; E.T. motion values
  386. ET_RUNNING = %10000000
  387. ET_CARRIED_BY_SCIENTIST = %01000000
  388. ET_MOTION_MASK = %00001111
  389.  
  390. ; human attribute values
  391. RETURN_HOME = %10000000
  392. MOTION_MASK = %00001111
  393.  
  394. ; fireResetStatus values
  395. FIRE_BUTTON_HELD = %10000000
  396. RESET_SWITCH_HELD = %01000000
  397.  
  398. ; starting screen id values
  399. SET_STARTING_SCREEN = %10000000
  400. STARTING_SCREEN_ID = %00001111
  401.  
  402. ; phone piece attribute values
  403. ET_HAS_PHONE_PIECE = %10000000
  404. PHONE_PIECE_SCREEN_LOC = %01000000
  405. FBI_HAS_PHONE_PIECE = %00100000
  406. ELLIOTT_HAS_PHONE_PIECE = %00010000
  407. PHONE_PIECE_PIT_NUMBER = %00001111
  408.  
  409. ; neck extension values
  410. NECK_EXTENDED = %10000000
  411. NECK_DECENDING = %01000000
  412.  
  413. ; flower state values
  414. FLOWER_REVIVED = %10000000
  415. FLOWER_REVIVE_ANIMATION = %00110000
  416. FLOWER_PIT_NUMBER = %00001111
  417.  
  418. ; E.T. pit status values
  419. FALLING_IN_PIT = %10000000
  420. LEVITATING = %01000000
  421. IN_PIT_BOTTOM = %00100000
  422.  
  423. ; mothership status values
  424. MOTHERSHIP_PRESENT = %10000000
  425. ET_GOING_HOME = %01000000
  426. MOTHERSHIP_LEAVING = %00000001
  427.  
  428. ; Easter Egg sprite values
  429. SHOW_YAR_SPRITE = %10000000
  430. SHOW_INDY_SPRITE = %11000000
  431.  
  432. ; sound data channel 0 values
  433. PLAY_SOUND_CHANNEL0 = %10000000
  434.  
  435. ; Easter Egg status values
  436. DONE_EASTER_EGG_CHECK = %10000000
  437. DONE_EASTER_EGG_STEPS = %00000111
  438.  
  439. ;============================================================================
  440. ; Z P - V A R I A B L E S
  441. ;============================================================================
  442.  
  443. currentScreenId = $80
  444. frameCount = $81
  445. secondTimer = $82 ; updates ~every second
  446. temp = $83
  447. ;--------------------------------------
  448. tempNumberFonts = temp
  449. ;--------------------------------------
  450. powerZoneIndex = temp
  451. ;--------------------------------------
  452. loopCount = temp
  453. ;--------------------------------------
  454. tempJoystickValues = temp
  455. ;--------------------------------------
  456. humanETHorizDistRange = temp
  457. ;--------------------------------------
  458. pointsTensValue = temp
  459. ;--------------------------------------
  460. pointsHundredsValue = temp
  461. ;--------------------------------------
  462. energyIncTensValue = temp
  463. ;--------------------------------------
  464. energyIncHundredsValue = temp
  465. ;--------------------------------------
  466. humanDirectionIndex = temp
  467. ;--------------------------------------
  468. newHumanDirection = temp
  469. ;--------------------------------------
  470. totalCandyCollected = temp
  471. ;--------------------------------------
  472. tempPitNumber = temp
  473. tempCharHolder = $84
  474. nextETGraphicData = $86
  475. ;--------------------------------------
  476. energyDecTensValue = nextETGraphicData
  477. ;--------------------------------------
  478. energyDecHundredsValue = energyDecTensValue
  479. nextObjectGraphicData = $87
  480. nextObjectColorData = $88
  481. ;--------------------------------------
  482. displayKernelBankSwitch = loopCount
  483. bankSwitchStrobe = displayKernelBankSwitch+1
  484. bankSwitchABSJmp = bankSwitchStrobe+2
  485. bankSwitchRoutinePtr = bankSwitchABSJmp+1
  486. fireResetStatus = $89 ; hold when fire button and RESET held
  487. soundDataChannel0 = $8A
  488. unknown = $8B
  489. currentSpriteHeight = $8C
  490. etHeight = $8D
  491. powerZoneColor = $8E
  492. timerColor = $8F
  493. telephoneColor = $90
  494. etMotionValues = $91
  495. etFractionalDelay = $92
  496. humanFractionalDelay = $93
  497. etNeckExtensionValues = $94
  498. currentObjectHorizPos = $95
  499. etHorizPos = $96
  500. etHeartHorizPos = $97
  501. phonePieceMapHorizPos = $98
  502. candyHorizPos = $99
  503. humanTargetHorizPos = $9A
  504. currentObjectVertPos = $9B
  505. etVertPos = $9C
  506. etHeartVertPos = $9D
  507. phonePieceMapVertPos = $9E
  508. candyVertPos = $9F
  509. humanTargetVertPos = $A0
  510. currentObjectId = $A1
  511. humanAttributes = $A2 ; $A2 - $A4
  512. ;--------------------------------------
  513. fbiAttributes = humanAttributes
  514. elliottAttributes = fbiAttributes+1
  515. scientistAttributes = elliottAttributes+1
  516. objectScreenId = $A5 ; $A5 - $A7
  517. ;--------------------------------------
  518. fbiScreenId = objectScreenId
  519. elliottScreenId = fbiScreenId+1
  520. scientistScreenId = elliottScreenId+1
  521. objectHorizPos = $A8 ; $A8 - $B1
  522. ;--------------------------------------
  523. fbiAgentHorizPos = objectHorizPos
  524. elliottHorizPos = fbiAgentHorizPos+1
  525. scientistHorizPos = elliottHorizPos+1
  526. objectVertPos = $AB ; $AB - $AD
  527. ;--------------------------------------
  528. fbiAgentVertPos = objectVertPos
  529. elliottVertPos = fbiAgentVertPos+1
  530. scientistVertPos = elliottVertPos+1
  531. objectGraphicPointers = $AE ; $AE - $B1
  532. ;--------------------------------------
  533. objectGraphicPtrs_0 = objectGraphicPointers
  534. objectGraphicPtrs_1 = objectGraphicPtrs_0+2
  535. objectColorPointers = $B2 ; $B2 - $B5
  536. ;--------------------------------------
  537. objectColorPtrs_0 = objectColorPointers
  538. objectColorPtrs_1 = objectColorPtrs_0+2
  539. etGraphicsPointers = $B6 ; $B6 - $B9
  540. ;--------------------------------------
  541. etGraphicPointers0 = etGraphicsPointers; $B6 - $B7
  542. etGraphicPointers1 = etGraphicPointers0+2; $B8 - $B9
  543. playfieldGraphicPtrs = $BA ; $BA - $BD
  544. ;--------------------------------------
  545. pf1GraphicPtrs = playfieldGraphicPtrs
  546. pf2GraphicPtrs = pf1GraphicPtrs+2
  547. graphicPointers = $BE ; $BE - $C9
  548. phonePieceAttributes = $CA ; $CA - $CC
  549. ;--------------------------------------
  550. h_phonePieceAttribute = phonePieceAttributes
  551. s_phonePieceAttribute = h_phonePieceAttribute+1
  552. w_phonePieceAttribute = s_phonePieceAttribute+1
  553. powerZonePointer = $CD ; $CD - $CE
  554. powerZoneIndicatorId = $CF
  555. shipLandingTimer = $D0
  556. candyStatus = $D1
  557. heldCandyPieces = $D2
  558. etEnergy = $D3 ; $D3 - $D4
  559. etHMOVEValue = $D5
  560. holdETHorizPos = $D6
  561. holdETVertPos = $D7
  562. holdETScreenId = $D8
  563. etPitStatus = $D9
  564. currentPitNumber = $DA
  565. callHomeScreenId = $DB
  566. extraCandyPieces = $DC
  567. collectedCandyPieces = $DD
  568. collectedCandyScoring = $DE
  569. playerScore = $DF ; $DF - $E1
  570. startingScreenId = $E2
  571. playerState = $E3
  572. gameState = $E4
  573. numberOfTries = $E5
  574. flowerState = $E6
  575. powerZoneLSBValues = $E7 ; $E7 - $E9
  576. ;--------------------------------------
  577. powerZoneLSBValue_01 = powerZoneLSBValues
  578. powerZoneLSBValue_02 = powerZoneLSBValue_01+1
  579. powerZoneLSBValue_03 = powerZoneLSBValue_02+1
  580. gameSelection = $EA
  581. mothershipStatus = $EB
  582. etAnimationIndex = $EC
  583. etHomeElliottMovement = $ED
  584. themeMusicNoteDelay = $EE
  585. themeMusicFreqIndex = $EF
  586. easterEggStatus = $F0
  587. programmerInitialFlag = $F1
  588. easterEggSpriteFlag = $F2
  589. artistInitialFlag = $F3
  590.  
  591. ;============================================================================
  592. ; R O M - C O D E (BANK 0)
  593. ;============================================================================
  594.  
  595. SEG Bank0
  596. .org BANK0TOP
  597. .rorg BANK0_REORG
  598.  
  599. lda BANK0STROBE
  600. jmp Start
  601.  
  602. HorizPositionObjects
  603. ldx #<RESBL - RESP0
  604. .moveObjectLoop
  605. sta WSYNC ; wait for next scan line
  606. lda currentObjectHorizPos,x ; get object's horizontal position
  607. tay
  608. lda HMOVETable,y ; get fine motion/coarse position value
  609. sta HMP0,x ; set object's fine motion value
  610. and #$0F ; mask off fine motion value
  611. tay ; move coarse move value to y
  612. .coarseMoveObject
  613. dey
  614. bpl .coarseMoveObject
  615. sta RESP0,x ; set object's coarse position
  616. dex
  617. bpl .moveObjectLoop
  618. sta WSYNC ; wait for next scan line
  619. sta HMOVE
  620. pla ; pull E.T. horizontal position from stack
  621. sta etHorizPos
  622. tax
  623. lda HMOVETable,x
  624. sta etHMOVEValue ; set E.T. horizontal move value
  625. jmp JumpToDisplayKernel
  626.  
  627. SetScreenIdFromStartingScreen
  628. lda startingScreenId ; get starting screen id
  629. bpl .skipScreenIdSet ; branch if screen id already set
  630. and #<(~SET_STARTING_SCREEN)
  631. sta currentScreenId ; set screen id from starting screen id
  632. jsr SetCurrentScreenData
  633. lsr startingScreenId ; shift right to show value already set
  634. .skipScreenIdSet
  635. bit mothershipStatus ; check mothership status
  636. bmi .jmpToVerticalSync ; branch if Mothership is present
  637. lda currentScreenId ; get the current screen id
  638. cmp #ID_TITLE_SCREEN
  639. bne .checkForETHome ; branch if not on the title screen
  640. .jmpToVerticalSync
  641. jmp VerticalSync
  642.  
  643. .checkForETHome
  644. lda currentScreenId ; get the current screen id
  645. cmp #ID_ET_HOME
  646. bne .checkForElliottToReviveET ; branch if not on home (game done) screen
  647. jmp VerticalSync
  648.  
  649. .checkForElliottToReviveET
  650. bit playerState ; check the player state
  651. bpl .checkETNeckExtension ; branch if E.T. is not dead
  652. bvc .checkETNeckExtension ; branch if Elliott not reviving E.T.
  653. lda currentObjectId ; get the current object id
  654. bpl .checkETNeckExtension ; branch if current object still on screen
  655. ldx #ID_ELLIOTT
  656. stx currentObjectId ; set current object id to Elliott
  657. jsr SetCurrentObjectData
  658. lda #<(MOVE_UP >> 4)
  659. sta elliottAttributes ; set Elliott attributes to move up
  660. lda currentScreenId ; get the current screen id
  661. sta elliottScreenId ; place Elliott on the current screen
  662. lda #5
  663. sta elliottHorizPos
  664. sta elliottVertPos
  665. .checkETNeckExtension
  666. bit etNeckExtensionValues ; check neck extension value
  667. bpl CheckETPlayerCollisions ; branch if E.T. neck not extended
  668. .jmpToCheckForETOnPitScreen
  669. jmp CheckIfETOnPitScreen
  670.  
  671. CheckETPlayerCollisions
  672. bit CXPPMM ; check player to player collisions
  673. bpl .jmpToCheckForETOnPitScreen ; branch if E.T. not collided with object
  674. ldx currentObjectId ; get the current object id
  675. bpl .checkCollisionObjectNotInWell; branch if object not in a well
  676. jmp .checkCollisionObjectInWell
  677.  
  678. .checkCollisionObjectNotInWell
  679. lda humanAttributes,x ; get the human attribute value
  680. bmi .jmpToCheckForETOnPitScreen ; branch if returning home
  681. txa ; move current object id to accumulator
  682. bne .checkForScientistCollision ; branch if not FBI Agent
  683. ldx #NUM_PHONE_PIECES - 1
  684. .checkToTakePhoneOrCandy
  685. lda phonePieceAttributes,x ; get phone piece attribute value
  686. bmi .fbiTakePhonePieceFromET ; branch if E.T. took phone piece
  687. dex
  688. bpl .checkToTakePhoneOrCandy
  689. lda #$0A
  690. sta heldCandyPieces ; clear carried candy from E.T.
  691. bne .setForFBITakingObjectSound ; unconditional branch
  692.  
  693. .fbiTakePhonePieceFromET
  694. lda frameCount ; get the current frame count
  695. and #PHONE_PIECE_PIT_NUMBER
  696. ora #FBI_HAS_PHONE_PIECE
  697. sta phonePieceAttributes,x ; set new location for phone piece
  698. .setForFBITakingObjectSound
  699. lda #PLAY_SOUND_CHANNEL0 | $1C
  700. sta soundDataChannel0
  701. jmp .setHumanToReturnHome
  702.  
  703. .checkForScientistCollision
  704. cpx #ID_SCIENTIST
  705. bne .etCollidedWithElliott ; branch if not collided with Scientist
  706. lda etMotionValues ; get E.T. motion values
  707. ora #ET_CARRIED_BY_SCIENTIST ; set E.T. motion value to show E.T.
  708. sta etMotionValues ; carried by Scientist
  709. rol fbiAttributes ; set FBI Agent to return home
  710. sec
  711. ror fbiAttributes
  712. rol elliottAttributes ; set Elliott to return home
  713. sec
  714. ror elliottAttributes
  715. bne .setHumanToReturnHome ; unconditional branch
  716.  
  717. .etCollidedWithElliott
  718. lda #PLAY_SOUND_CHANNEL0 | $0C
  719. sta soundDataChannel0
  720. bit playerState ; check the player state
  721. bpl .checkItemExchange ; branch if E.T. is not dead
  722. ldy numberOfTries ; get number of tries
  723. bpl .reviveET ; revive E.T. for another try
  724. rol gameState ; rotate game state left
  725. sec ; set carry and rotate value right to set
  726. ror gameState ; game loss state (i.e. D7 = 1)
  727. jsr SetCurrentScreenToETHome
  728. jmp VerticalSync
  729.  
  730. .reviveET
  731. dec numberOfTries ; reduce number of tries
  732. ldx #$15
  733. ldy #$00
  734. jsr IncrementETEnergy ; give E.T. 1500 units of energy
  735. sty currentSpriteHeight
  736. sty playerState ; reset player state
  737. dey ; y = -1
  738. sty currentObjectId
  739. sty elliottScreenId
  740. sty elliottAttributes
  741. bne .setHumanToReturnHome ; unconditional branch
  742.  
  743. .checkItemExchange
  744. ldx #0
  745. lda #ELLIOTT_HAS_PHONE_PIECE
  746. bit h_phonePieceAttribute
  747. bne .giveElliottPhonePieceToET ; branch if Elliott has H phone piece
  748. inx
  749. bit s_phonePieceAttribute
  750. bne .giveElliottPhonePieceToET ; branch if Elliott has S phone piece
  751. inx
  752. bit w_phonePieceAttribute
  753. beq .giveCandyPiecesToElliott ; branch if Elliott has no phone pieces
  754. .giveElliottPhonePieceToET
  755. lda #ET_HAS_PHONE_PIECE
  756. sta phonePieceAttributes,x
  757. bne .setHumanToReturnHome ; unconditional branch
  758.  
  759. .giveCandyPiecesToElliott
  760. lda heldCandyPieces ; get number of candy pieces held by E.T.
  761. lsr ; shift upper nybbles to lower nybbles
  762. lsr
  763. lsr
  764. lsr
  765. beq .setHumanToReturnHome ; branch if no candy pieces collected
  766. clc
  767. adc collectedCandyPieces ; increment collected candy pieces
  768. sta collectedCandyPieces
  769. lda heldCandyPieces ; get number of candy pieces held by E.T.
  770. cmp #MAX_HOLD_CANDY ; see if E.T. is holding maximum candy
  771. bcc .clearNumberHeldCandyPieces ; clear held candy count if not
  772. ldx #NUM_PHONE_PIECES - 1
  773. lda #$F0
  774. bit w_phonePieceAttribute
  775. beq .givePhonePieceToElliott
  776. dex
  777. bit s_phonePieceAttribute
  778. beq .givePhonePieceToElliott
  779. dex
  780. bit h_phonePieceAttribute
  781. bne .clearNumberHeldCandyPieces
  782. .givePhonePieceToElliott
  783. lda #ELLIOTT_HAS_PHONE_PIECE
  784. sta phonePieceAttributes,x
  785. .clearNumberHeldCandyPieces
  786. lda heldCandyPieces ; get number of candy pieces held by E.T.
  787. and #$0F ; mask to clear number of candy held
  788. sta heldCandyPieces
  789. .setHumanToReturnHome
  790. ldx currentObjectId ; get the current object id
  791. rol humanAttributes,x ; shift human attribute left
  792. sec ; set carry and shift value right to set
  793. ror humanAttributes,x ; RETURN_HOME flag (i.e. D7 = 1)
  794. bmi CheckIfETOnPitScreen ; unconditional branch
  795.  
  796. .checkCollisionObjectInWell
  797. cpx #$80 | ID_FLOWER
  798. bcs CheckIfETOnPitScreen ; branch if E.T. didn't pick up phone piece
  799. lda #PLAY_SOUND_CHANNEL0 | $0D
  800. sta soundDataChannel0
  801. txa ; move current object id to accumulator
  802. and #$0F ; mask pit value to keep object id
  803. sec
  804. sbc #3 ; subtract value by 3
  805. tax
  806. cmp #3
  807. bcs CheckIfETOnPitScreen ; branch if E.T. didn't pick up phone piece
  808. lda #ET_HAS_PHONE_PIECE
  809. sta phonePieceAttributes,x
  810. asl ; a = 0
  811. sta currentSpriteHeight
  812. CheckIfETOnPitScreen
  813. lda currentScreenId ; get the current screen id
  814. cmp #ID_FOREST
  815. bcc CheckETPitCollisions ; branch if E.T. on a pit screen
  816. .jmpToDetermineHumanDirection
  817. jmp DetermineHumanDirection
  818.  
  819. CheckETPitCollisions
  820. bit etMotionValues ; check E.T. motion values
  821. bvs .jmpToDetermineHumanDirection; branch if E.T. carried by Scientist
  822. bit CXP1FB ; check E.T. and playfield collision
  823. bmi PlaceETInPit ; branch if E.T. collided with pit
  824. lda #0
  825. sta etPitStatus ; clear E.T. pit status flags
  826. beq .jmpToDetermineHumanDirection; unconditional branch
  827.  
  828. PlaceETInPit
  829. bit etNeckExtensionValues ; check neck extension value
  830. bmi .jmpToDetermineHumanDirection; branch if E.T. neck extended
  831. lda etVertPos ; get E.T.'s vertical position
  832. sta holdETVertPos ; save for when E.T. emerges from pit
  833. lda etHorizPos ; get E.T.'s horizontal position
  834. sta holdETHorizPos ; save for when E.T. emerges from pit
  835. ldy #0
  836. ldx currentScreenId ; get the current screen id
  837. stx holdETScreenId ; save for when E.T. emerges from pit
  838. beq SetPitNumberForDiamondPits ; branch if FOUR_DIAMOND_PITS
  839. dex
  840. beq SetPitNumberForEightPits ; branch if EIGHT_PITS
  841. dex
  842. beq SetPitNumberForArrowPits ; branch if ARROW_PITS
  843. ldx #ID_UPPER_LEFT_WIDE_PIT
  844. bne CalculateCurrentPitNumber ; unconditional branch -- WIDE_DIAMOND_PITS
  845.  
  846. SetPitNumberForArrowPits
  847. ldx #ID_TOP_LEFT_ARROW_PIT
  848. CalculateCurrentPitNumber
  849. stx tempPitNumber
  850. cmp #59 ; compare E.T.'s horizontal position
  851. bcc .compareETVerticalPosition
  852. iny ; y = 1
  853. .compareETVerticalPosition
  854. lda etVertPos ; get E.T.'s vertical position
  855. cmp #33
  856. bcc .combineTempPitNumber
  857. iny
  858. iny
  859. .combineTempPitNumber
  860. tya
  861. ora tempPitNumber
  862. bne .setCurrentPitNumber ; unconditional branch
  863.  
  864. SetPitNumberForDiamondPits
  865. cmp #41 ; compare E.T.'s horizontal position
  866. bcs .etNotInPitOne
  867. lda #ID_LEFT_DIAMOND_PIT ; show that E.T. is in pit number 1
  868. bne .setCurrentPitNumber ; unconditional branch
  869.  
  870. .etNotInPitOne
  871. cmp #81 ; compare E.T.'s horizontal position
  872. bcc .etNotInPitTwo
  873. lda #ID_RIGHT_DIAMOND_PIT ; show that E.T. is in pit number 2
  874. bne .setCurrentPitNumber ; unconditional branch
  875.  
  876. .etNotInPitTwo
  877. lda etVertPos ; get E.T.'s vertical position
  878. cmp #29
  879. lda #ID_TOP_DIAMOND_PIT
  880. bcc .setCurrentPitNumber ; set E.T. to pit number 0
  881. lda #ID_LOWER_DIAMOND_PIT ; show that E.T. is in pit number 3
  882. bne .setCurrentPitNumber ; unconditional branch
  883.  
  884. SetPitNumberForEightPits
  885. ldx etVertPos ; get E.T.'s vertical position
  886. cpx #19
  887. bcc .checkForOutOfRangePit
  888. cpx #40
  889. bcc .checkHorizPosForPitNumber
  890. ldy #3
  891. .checkForOutOfRangePit
  892. cmp #32 ; compare E.T.'s horizontal position
  893. bcc .setToOutOfRangePitNumber
  894. cmp #96 ; compare E.T.'s horizontal position
  895. bcs .setToOutOfRangePitNumber
  896. .combineIndexForPitNumber
  897. tya
  898. ora #ID_TOP_EIGHT_PITS
  899. bne .setCurrentPitNumber ; unconditional branch
  900.  
  901. .setToOutOfRangePitNumber
  902. lda #<ID_PIT_OUT_OF_RANGE
  903. bne .setCurrentPitNumber ; unconditional branch
  904.  
  905. .checkHorizPosForPitNumber
  906. iny ; y = 1
  907. cmp #64 ; compare E.T. horizontal position
  908. bcc .combineIndexForPitNumber
  909. iny ; y = 2
  910. bne .combineIndexForPitNumber ; unconditional branch
  911.  
  912. .setCurrentPitNumber
  913. sta currentPitNumber
  914. lda #ID_PIT
  915. sta currentScreenId ; set the current screen id
  916. jsr SetCurrentScreenData
  917. DetermineHumanDirection
  918. lda frameCount ; get the current frame count
  919. and #3 ; make value 0 <= a <= 3
  920. cmp #ID_SCIENTIST + 1
  921. beq CheckForETCollectingCandy ; branch if out of human id range
  922. tax ; move object id to x
  923. lda objectScreenId,x ; get the object's screen id
  924. bpl .multiplyScreenIdBy8 ; branch if human is active
  925. lda humanAttributes,x ; get human attribute value
  926. bmi CheckForETCollectingCandy ; branch if returning home
  927. lda #ID_WASHINGTON_DC
  928. jsr CheckForHumanOnScreen
  929. bcs CheckForETCollectingCandy ; branch if human on WASHINGTON_DC screen
  930. sta objectScreenId,x ; set object screen id to WASHINGTON_DC
  931. lda HumanTargetVertPosTable,x
  932. sta objectVertPos,x
  933. lda HumanTargetHorizPosTable,x
  934. sta objectHorizPos,x
  935. lda #<(MOVE_LEFT >> 4)
  936. sta humanAttributes,x ; set human to move left
  937. lda #ID_WASHINGTON_DC
  938. cmp currentScreenId
  939. bne CheckForETCollectingCandy
  940. stx currentObjectId
  941. jsr SetCurrentObjectData
  942. jmp CheckForETCollectingCandy
  943.  
  944. .multiplyScreenIdBy8
  945. asl
  946. asl
  947. asl
  948. sta humanDirectionIndex
  949. lda humanAttributes,x ; get human attribute value
  950. bpl .checkToChangeHumanDirection ; branch if not returning home
  951. lda #5
  952. clc
  953. bcc .setNewHumanDirection ; unconditional branch
  954.  
  955. .checkToChangeHumanDirection
  956. lda currentScreenId ; get the current screen id
  957. cmp #ID_PIT ; if on PIT or HOME or TITLE SCREEN then
  958. bcs CheckForETCollectingCandy ; don't change human direction
  959. .setNewHumanDirection
  960. adc humanDirectionIndex
  961. tay
  962. lda HumanDirectionTable,y
  963. bmi CheckForETCollectingCandy
  964. sta newHumanDirection
  965. lda humanAttributes,x ; get human attribute value
  966. and #$F0 ; clear current human direction
  967. ora newHumanDirection ; or in new direction value
  968. sta humanAttributes,x ; set new direction value
  969. CheckForETCollectingCandy
  970. bit CXP1FB ; check E.T. collision with PF and BALL
  971. bvc .skipCandyCollection ; branch if E.T. did not collect candy
  972. ldx currentScreenId ; get the current screen id
  973. cpx #ID_FOREST
  974. bcs .skipCandyCollection ; branch if E.T. not on a pit screen
  975. lda heldCandyPieces ; get number of candy pieces held by E.T.
  976. cmp #MAX_HOLD_CANDY
  977. bcs .skipCandyCollection ; branch if E.T. holding maximum candy
  978. adc #1 * 16 ; increment held candy pieces by 1
  979. sta heldCandyPieces
  980. lda #PLAY_SOUND_CHANNEL0 | $1C
  981. sta soundDataChannel0
  982. lda #127 ; set candy piece vertical position to be
  983. sta candyVertPos ; out of visual range
  984. lda CandyStatusMaskTable,x
  985. and candyStatus
  986. sta candyStatus
  987. .skipCandyCollection
  988. lda secondTimer
  989. and #$0F
  990. bne CheckForETNeckExtension
  991. lda frameCount ; get the current frame count
  992. and #$3F
  993. cmp #23
  994. bne CheckForETNeckExtension
  995. lda candyStatus ; get candy status flag value
  996. and #$0F
  997. tax
  998. lda extraCandyPieces ; get extra candy pieces value
  999. sec
  1000. sbc ExtraCandyReductionTable,x
  1001. bmi CheckForETNeckExtension
  1002. sta extraCandyPieces
  1003. lda #$0F
  1004. ora candyStatus
  1005. sta candyStatus
  1006. CheckForETNeckExtension
  1007. bit etNeckExtensionValues ; check neck extension value
  1008. bmi .etNeckExtended ; branch if E.T. neck extended
  1009. jmp DeterminePitPowerZone
  1010.  
  1011. .etNeckExtended
  1012. lda frameCount ; get the current frame count
  1013. and #3
  1014. bne .jmpToSetPhoneHiddenLocation
  1015. bvc ExtendedETNeck ; branch if extending E.T. neck
  1016. bit etPitStatus ; check E.T. pit status flags
  1017. bvs .jmpToSetPhoneHiddenLocation ; branch if E.T. levitating
  1018. dec etNeckExtensionValues
  1019. lda etNeckExtensionValues
  1020. and #7
  1021. cmp #7
  1022. beq .reduceETNeckExtension
  1023. inc etVertPos ; move E.T. down 1 pixel
  1024. bne .jmpToSetPhoneHiddenLocation ; unconditional branch
  1025.  
  1026. .reduceETNeckExtension
  1027. lda #$00
  1028. sta etNeckExtensionValues ; clear neck extension value
  1029. inc etVertPos ; move E.T. down 1 pixel
  1030. ldx #NUM_PHONE_PIECES - 1
  1031. .clearHiddenPhonePieceLoc
  1032. lda phonePieceAttributes,x ; get phone piece attribute value
  1033. and #<(~PHONE_PIECE_SCREEN_LOC) ; clear phone piece screen location bit to
  1034. sta phonePieceAttributes,x ; show phone not hidden (i.e. E.T. in pit)
  1035. dex
  1036. bpl .clearHiddenPhonePieceLoc
  1037. .jmpToSetPhoneHiddenLocation
  1038. jmp SetPhonePieceHiddenLocation
  1039.  
  1040. ExtendedETNeck SUBROUTINE
  1041. inc etNeckExtensionValues
  1042. lda etNeckExtensionValues
  1043. and #7
  1044. cmp #4
  1045. bcs ETNeckExtendedToMax
  1046. lda etVertPos ; get E.T.'s vertical position
  1047. beq .jmpToSetPhoneHiddenLocation ; branch if E.T. out of the pit
  1048. dec etVertPos ; move E.T. up 1 pixel
  1049. .jmpToSetPhoneHiddenLocation
  1050. jmp SetPhonePieceHiddenLocation
  1051.  
  1052. ETNeckExtendedToMax
  1053. lda #NECK_EXTENDED | NECK_DECENDING | 3
  1054. sta etNeckExtensionValues ; set E.T. neck to decend
  1055. ldx #$00
  1056. ldy #$19
  1057. jsr DecrementETEnergy ; reduce E.T. energy by 19 units
  1058. ldy currentScreenId ; get the current screen id
  1059. lda powerZoneIndicatorId ; get the power zone id
  1060. asl ; multiply value by 2
  1061. tax
  1062. lda PowerZoneJumpTable+1,x
  1063. pha
  1064. lda PowerZoneJumpTable,x
  1065. pha
  1066. lda gameSelection ; get the current game selection
  1067. cmp #2
  1068. bcs .jumpToPowerZone
  1069. lda scientistScreenId ; get the Scientist's screen id
  1070. bpl .jumpToPowerZone ; branch if Scientist not at home
  1071. rol scientistAttributes ; rotate Scientist attribute left and
  1072. clc ; clear carry and rotate right to clear
  1073. ror scientistAttributes ; RETURN_HOME flag (i.e. D7 = 0)
  1074. .jumpToPowerZone
  1075. rts
  1076.  
  1077. ReviveFlower
  1078. bit flowerState ; check the flower state
  1079. bmi .setPhonePieceHiddenLocation ; branch if flower already revived
  1080. inc numberOfTries ; increment number of tries
  1081. rol flowerState ; rotate flower state left
  1082. sec ; set carry flag and rotate flower state
  1083. ror flowerState ; right to set FLOWER_REVIVED state
  1084. bmi .setPhonePieceHiddenLocation ; unconditional branch
  1085.  
  1086. LevitateETOutOfPit
  1087. lda #LEVITATING
  1088. sta etPitStatus ; set status to show E.T. levitating
  1089. dec etVertPos ; move E.T. up two pixels
  1090. dec etVertPos
  1091. .setPhonePieceHiddenLocation
  1092. jmp SetPhonePieceHiddenLocation
  1093.  
  1094. DetermineHiddenPhonePiece
  1095. ldx #NUM_PHONE_PIECES - 1
  1096. .hiddenPhonePieceLoop
  1097. lda phonePieceAttributes,x ; get phone piece attribute value
  1098. and #<(~PHONE_PIECE_PIT_NUMBER) ; mask PHONE_PIECE_PIT_NUMBER value
  1099. bne .nextPhonePiece ; branch if phone piece not hidden
  1100. lda phonePieceAttributes,x ; get phone piece attribute value
  1101. and #PHONE_PIECE_PIT_NUMBER ; keep PHONE_PIECE_PIT_NUMBER value
  1102. lsr ; divide pit number value by 4
  1103. lsr
  1104. cmp currentScreenId ; compare with current screen id value
  1105. beq .setPhoneHiddenOnScreen ; branch if phone piece hidden on screen
  1106. .nextPhonePiece
  1107. dex
  1108. bpl .hiddenPhonePieceLoop
  1109. .setHiddenPhonePieceLocation
  1110. jmp SetPhonePieceHiddenLocation
  1111.  
  1112. .setPhoneHiddenOnScreen
  1113. lda phonePieceAttributes,x ; get phone piece attribute value
  1114. ora #PHONE_PIECE_SCREEN_LOC ; set value to show phone hidden on screen
  1115. sta phonePieceAttributes,x
  1116. bne .setHiddenPhonePieceLocation ; unconditional branch
  1117.  
  1118. WarpETRight
  1119. lda RightScreenIdTable,y
  1120. jmp .warpETToNewScreen
  1121.  
  1122. WarpETLeft
  1123. lda LeftScreenIdTable,y
  1124. jmp .warpETToNewScreen
  1125.  
  1126. WarpETUp
  1127. lda UpperScreenIdTable,y
  1128. jmp .warpETToNewScreen
  1129.  
  1130. WarpETDown
  1131. lda LowerScreenIdTable,y
  1132. .warpETToNewScreen
  1133. sta currentScreenId ; set the current screen id
  1134. jsr SetCurrentScreenData
  1135. jmp SetPhonePieceHiddenLocation
  1136.  
  1137. ClearElliottReturnHomeFlag
  1138. rol elliottAttributes ; rotate Elliott attributes left
  1139. clc ; clear carry and rotate Elliott attributes
  1140. ror elliottAttributes ; right to clear RETURN_HOME flag
  1141. bpl SetPhonePieceHiddenLocation ; unconditional branch
  1142.  
  1143. CallMothership
  1144. ldx currentObjectId ; get the current object id
  1145. bmi .checkToStartShipLandingTimer; branch if current object returning home
  1146. bit SWCHB ; check console switch values
  1147. bvs SetPhonePieceHiddenLocation ; branch if player 1 difficulty set to PRO
  1148. cpx #ID_ELLIOTT
  1149. bne SetPhonePieceHiddenLocation ; branch if current object is not Elliott
  1150. .checkToStartShipLandingTimer
  1151. lda shipLandingTimer ; get timer value for ship landing
  1152. bpl SetPhonePieceHiddenLocation ; branch if landing timer already started
  1153. bit h_phonePieceAttribute ; check H phone piece value
  1154. bpl SetPhonePieceHiddenLocation ; branch if E.T. not taken H phone piece
  1155. bit s_phonePieceAttribute ; check S phone piece value
  1156. bpl SetPhonePieceHiddenLocation ; branch if E.T. not taken S phone piece
  1157. bit w_phonePieceAttribute ; check W phone piece value
  1158. bpl SetPhonePieceHiddenLocation ; branch if E.T. not taken W phone piece
  1159. lda #PLAY_SOUND_CHANNEL0 | $0C
  1160. sta soundDataChannel0
  1161. lda #START_LANDING_TIMER
  1162. sta shipLandingTimer ; set ship landing timer value
  1163. lda #RETURN_HOME | P1_NO_MOVE
  1164. sta fbiAttributes ; set all human objects to return home and
  1165. sta elliottAttributes ; don't move
  1166. sta scientistAttributes
  1167. bne SetPhonePieceHiddenLocation ; unconditional branch
  1168.  
  1169. ReturnCurrentHumanHome
  1170. ldx currentObjectId ; get the current object id
  1171. bmi SetPhonePieceHiddenLocation ; branch if human set to return home
  1172. rol humanAttributes,x ; rotate human attribute value left
  1173. sec ; set carry and rotate value right to set
  1174. ror humanAttributes,x ; RETURN_HOME flag (i.e. D7 = 1)
  1175. bmi SetPhonePieceHiddenLocation ; unconditional branch
  1176.  
  1177. EatCandyPiece
  1178. lda heldCandyPieces ; get number of candy pieces held by E.T.
  1179. sec
  1180. sbc #1 * 16 ; reduce number of candy pieces held by 1
  1181. bcc SetPhonePieceHiddenLocation
  1182. sta heldCandyPieces
  1183. ldx #$03
  1184. ldy #$60
  1185. jsr IncrementETEnergy ; increment energy by 360 units
  1186. SetPhonePieceHiddenLocation
  1187. ldx #NUM_PHONE_PIECES - 1
  1188. bit w_phonePieceAttribute ; check W phone piece value
  1189. bvs .setHiddenPhonePiecePosition ; branch if W phone piece present on screen
  1190. dex
  1191. bit s_phonePieceAttribute ; check S phone piece
  1192. bvs .setHiddenPhonePiecePosition ; branch if S phone piece present on screen
  1193. dex
  1194. bit h_phonePieceAttribute ; check H phone piece
  1195. bvc .turnOffHiddentPhonePiece ; branch if H phone piece not on screen
  1196. .setHiddenPhonePiecePosition
  1197. lda phonePieceAttributes,x ; get the phone piece attribute value
  1198. and #PHONE_PIECE_PIT_NUMBER ; mask bits to keep pit number
  1199. tay
  1200. lda PhonePiecePitHorizPosition,y ; get phone piece pit horizontal position
  1201. sta phonePieceMapHorizPos
  1202. ldx PhonePiecePitVertPosition,y ; get phone piece pit vertical position
  1203. lda frameCount ; get the current frame count
  1204. ror ; move D2 of frame count to carry
  1205. ror ; flash hidden phone piece every 8 frames
  1206. ror
  1207. bcc .setHiddenPhonePieceVertPos
  1208. .turnOffHiddentPhonePiece
  1209. ldx #127
  1210. .setHiddenPhonePieceVertPos
  1211. stx phonePieceMapVertPos
  1212. lda powerZoneIndicatorId ; get current power zone id
  1213. jmp .setPowerZoneGraphicPtrLSB
  1214.  
  1215. DeterminePitPowerZone
  1216. lda currentScreenId ; get the current screen id
  1217. cmp #ID_PIT
  1218. bne DetermineCurrentPowerZone ; branch if E.T. not in pit
  1219. lda currentObjectId ; get the current object id
  1220. cmp #$80 | ID_FLOWER
  1221. bne .setPowerZoneToPitZone ; branch if the flower not present
  1222. lda etHorizPos ; get E.T.'s horizontal position
  1223. sbc currentObjectHorizPos ; subtract flower horizontal position
  1224. cmp #16
  1225. bcs .setPowerZoneToPitZone
  1226. lda #ID_FLOWER_ZONE
  1227. bne .setPowerZoneIndicatorId ; set power zone to flower zone
  1228.  
  1229. .setPowerZoneToPitZone
  1230. lda #ID_PIT_ZONE
  1231. bne .setPowerZoneIndicatorId ; unconditional branch
  1232.  
  1233. DetermineCurrentPowerZone
  1234. lda etHorizPos ; get E.T.'s horizontal position
  1235. lsr ; divide horizontal value by 8
  1236. lsr
  1237. lsr
  1238. and #$0C ; a = 0 || a = 4 || a = 8 || a = 12
  1239. sta powerZoneIndex
  1240. lda etVertPos ; get E.T.'s vertical position
  1241. lsr ; divide vertical value by 16 (i.e. move
  1242. lsr ; upper nybble to lower nybble)
  1243. lsr
  1244. lsr
  1245. ora powerZoneIndex ; increase value for index pointer
  1246. lsr ; divide value by 2 (i.e. 0 <= x <= 7)
  1247. tay
  1248. lda (powerZonePointer),y
  1249. bcc .checkForValidFindPhoneZone ; branch if index value was even
  1250. lsr ; shift upper nybble to lower nybble
  1251. lsr
  1252. lsr
  1253. lsr
  1254. .checkForValidFindPhoneZone
  1255. and #$0F
  1256. cmp #ID_FIND_PHONE_ZONE
  1257. bne .checkForValidCallElliottZone
  1258. ldx currentScreenId ; get the current screen id
  1259. cpx #ID_FOREST
  1260. bcs .setPowerZoneToBlankZone ; set power zone to blank if in forest
  1261. .checkForValidCallElliottZone
  1262. cmp #ID_CALL_ELLIOTT_ZONE
  1263. bne .checkForValidLandingZone
  1264. ldx #ID_FOREST
  1265. cpx currentScreenId
  1266. beq .setPowerZoneToBlankZone ; set power zone to blank if in forest
  1267. .checkForValidLandingZone
  1268. cmp #ID_LANDING_ZONE
  1269. bne .checkForValidCallShipZone
  1270. ldx #ID_FOREST
  1271. cpx currentScreenId
  1272. bne .setPowerZoneToBlankZone ; set power zone to blank if not in forest
  1273. .checkForValidCallShipZone
  1274. cmp #ID_CALL_SHIP_ZONE
  1275. bne .setPowerZoneIndicatorId
  1276. ldx callHomeScreenId
  1277. cpx currentScreenId
  1278. beq .setPowerZoneIndicatorId ; set power zone if on call home screen
  1279. .setPowerZoneToBlankZone
  1280. lda #ID_BLANK_ZONE
  1281. .setPowerZoneIndicatorId
  1282. sta powerZoneIndicatorId
  1283. .setPowerZoneGraphicPtrLSB
  1284. asl ; multiply power zone indicator value by 8
  1285. asl ; (height of Power Zone sprites) to set
  1286. asl ; graphic pointer LSB
  1287. sta graphicPointers
  1288. VerticalSync SUBROUTINE
  1289. .waitTime
  1290. lda INTIM
  1291. bne .waitTime
  1292. StartNewFrame
  1293. lda #START_VERT_SYNC
  1294. sta WSYNC ; wait for next scan line
  1295. sta VSYNC ; start vertical sync (D1 = 1)
  1296. inc frameCount ; increment frame count each new frame
  1297. bne .firstLineOfVerticalSync
  1298. bit playerState ; check player state
  1299. bmi .firstLineOfVerticalSync ; branch if E.T. dead
  1300. lda gameSelection ; get the current game selection
  1301. cmp #MAX_GAME_SELECTION
  1302. bcs .firstLineOfVerticalSync
  1303. lda fbiScreenId ; get FBI Agent screen id
  1304. bpl .firstLineOfVerticalSync ; branch if FBI Agent active
  1305. bit etMotionValues ; check E.T. motion values
  1306. bvs .firstLineOfVerticalSync ; branch if E.T. carried by Scientist
  1307. lda #P1_NO_MOVE
  1308. sta fbiAttributes ; set FBI Agent not to move
  1309. .firstLineOfVerticalSync
  1310. sta WSYNC
  1311. lda #$3F
  1312. and frameCount
  1313. bne .secondLineOfVerticalSync
  1314. inc secondTimer ; increment ~every second (i.e 63 frames)
  1315. lda SWCHB ; read console switches
  1316. and #SELECT_MASK
  1317. bne .secondLineOfVerticalSync ; branch if SELECT not pressed
  1318. ldx gameSelection ; get the current game selection
  1319. inx ; increment game selection
  1320. cpx #MAX_GAME_SELECTION + 1 ; see if game selection should wrap
  1321. bcc .setGameSelection
  1322. ldx #1 ; set game selection to 1
  1323. .setGameSelection
  1324. stx gameSelection
  1325. .secondLineOfVerticalSync
  1326. sta WSYNC
  1327. lda currentScreenId ; get the current screen id
  1328. cmp #ID_TITLE_SCREEN
  1329. bne .endVerticalSync ; branch if not on TITLE_SCREEN
  1330. lda #24
  1331. sta currentObjectHorizPos
  1332. lda #65
  1333. sta etHorizPos
  1334. lda #58
  1335. sta etHeartHorizPos
  1336. lda #95
  1337. sta phonePieceMapHorizPos
  1338. .endVerticalSync
  1339. lda #STOP_VERT_SYNC
  1340. ldx #VBLANK_TIME
  1341. sta WSYNC ; last line of vertical sync
  1342. sta VSYNC ; end vertical sync (D1 = 0)
  1343. stx TIM64T ; set timer for vertical blanking period
  1344. bit mothershipStatus ; check mothership status
  1345. bpl .checkToPlayThemeForTitleScreen; branch if mothership not present
  1346. jmp DetermineObjectToMove
  1347.  
  1348. .checkToPlayThemeForTitleScreen
  1349. lda currentScreenId ; get the current screen id
  1350. cmp #ID_TITLE_SCREEN
  1351. beq PlayThemeMusic ; branch if on TITLE_SCREEN
  1352. bit playerState ; check player state
  1353. bpl CheckToPlayETFallingSound ; branch if E.T. not dead
  1354. ldx currentObjectId ; get the current object id
  1355. dex
  1356. bne CheckToPlayETFallingSound ; branch if current object is not Elliott
  1357. PlayThemeMusic
  1358. lda #7
  1359. sta AUDV1
  1360. lda #SOUND_CHANNEL_LEAD
  1361. sta AUDC1
  1362. ldx themeMusicNoteDelay ; get theme music note delay value
  1363. dex
  1364. bpl .playCurrentThemeNote ; hold note if not negative
  1365. ldx #11 ; initial hold note delay
  1366. ldy themeMusicFreqIndex ; get theme music frequency index
  1367. iny ; increment frequency index
  1368. cpy #55
  1369. bcc .setThemeMusicFreqIndex
  1370. ldy #0
  1371. .setThemeMusicFreqIndex
  1372. sty themeMusicFreqIndex
  1373. .playCurrentThemeNote
  1374. stx themeMusicNoteDelay
  1375. ldy themeMusicFreqIndex
  1376. lda ThemeMusicFrequencyTable,y
  1377. sta AUDF1
  1378. lda #0
  1379. sta AUDV0
  1380. jmp .donePlayingSoundChannel1
  1381.  
  1382. CheckToPlayETFallingSound
  1383. bit etPitStatus ; check E.T. pit value
  1384. bpl CheckToPlayETLevitationSound ; branch if E.T. not falling in pit
  1385. lda #SOUND_CHANNEL_SQUARE + 1
  1386. sta AUDC1
  1387. asl ; multiple value by 2 to set volume
  1388. sta AUDV1
  1389. lda etVertPos ; get E.T.'s vertical position
  1390. lsr ; divide value by 2 to set frequency
  1391. sta AUDF1
  1392. bne .donePlayingSoundChannel1 ; unconditional branch
  1393.  
  1394. CheckToPlayETLevitationSound
  1395. bvc CheckToPlayNeckExtensionSound; branch if E.T. not levitating
  1396. lda etEnergy+1
  1397. and #$0F
  1398. bne .turnOffETWalkingSound
  1399. lda #4
  1400. sta AUDV1
  1401. lda #$1C
  1402. bne .setSoundChannel1AndFrequency; unconditional branch
  1403.  
  1404. CheckToPlayNeckExtensionSound
  1405. lda etNeckExtensionValues ; get neck extension value
  1406. bpl PlayETWalkingSound ; branch if E.T. neck not extended
  1407. sec
  1408. rol
  1409. sec
  1410. rol
  1411. sta AUDV1
  1412. lda #$0E
  1413. bne .setSoundChannel1AndFrequency; unconditional branch
  1414.  
  1415. PlayETWalkingSound
  1416. lda SWCHA ; read joystick values
  1417. cmp #P0_NO_MOVE
  1418. bcs .turnOffETWalkingSound
  1419. bit etMotionValues ; check E.T. motion values
  1420. bpl .playETWalkingSound ; branch if E.T. not running
  1421. lda frameCount ; get the current frame count
  1422. lsr ; divide value by 4
  1423. lsr
  1424. and #7
  1425. sta AUDF1
  1426. lda #SOUND_CHANNEL_SQUARE + 1
  1427. sta AUDC1
  1428. lda #7
  1429. sta AUDV1
  1430. bne .donePlayingSoundChannel1 ; unconditional branch
  1431.  
  1432. .playETWalkingSound
  1433. lda frameCount ; get the current frame count
  1434. and #7
  1435. bne .turnOffETWalkingSound
  1436. lda frameCount ; get the current frame count
  1437. lsr ; divide value by 8
  1438. lsr
  1439. lsr
  1440. and #3
  1441. beq .turnOffETWalkingSound
  1442. ldx #7
  1443. stx AUDV1
  1444. adc #$16
  1445. bne .setSoundChannel1AndFrequency
  1446.  
  1447. .turnOffETWalkingSound
  1448. lda #0
  1449. sta AUDV1
  1450. .setSoundChannel1AndFrequency
  1451. sta AUDC1
  1452. sta AUDF1
  1453. .donePlayingSoundChannel1
  1454. lda currentScreenId ; get the current screen id
  1455. cmp #ID_ET_HOME
  1456. bne .checkIfOnTitleScreen
  1457. jmp SetSpecialSpriteForPit
  1458.  
  1459. .checkIfOnTitleScreen
  1460. cmp #ID_TITLE_SCREEN
  1461. bne CheckForTimeToLandMothership
  1462. jmp SetCurrentObjectXYCoordinates
  1463.  
  1464. CheckForTimeToLandMothership
  1465. lda shipLandingTimer ; get ship landing timer value
  1466. bpl .reduceLandingTimerValue ; branch if timer set for count down
  1467. lda #<BlankIcon
  1468. sta graphicPointers+2
  1469. beq MoveET ; unconditional branch
  1470.  
  1471. .reduceLandingTimerValue
  1472. lda frameCount ; get the current frame count
  1473. and #$1F
  1474. bne SetCountdownClockSpriteLSB
  1475. dec shipLandingTimer ; decrement ship landing timer
  1476. bpl PlayShipLandingTimerSound
  1477. lda #<BlankIcon
  1478. sta graphicPointers+2 ; clear landing timer icon
  1479. lda powerZoneIndicatorId ; get power zone indicator id
  1480. cmp #ID_LANDING_ZONE
  1481. bne .dontLandMothership ; branch if E.T. not in landing zone
  1482. lda currentObjectId ; get the current object id
  1483. bmi .landMothership
  1484. bit SWCHB ; check console switch values
  1485. bvs .dontLandMothership ; branch if player 1 difficulty set to PRO
  1486. cmp #ID_ELLIOTT ; don't land Mothership if present human
  1487. bne .dontLandMothership ; is not Elliott
  1488. .landMothership
  1489. lda #PLAY_SOUND_CHANNEL0 | $0D
  1490. sta soundDataChannel0
  1491. lda heldCandyPieces ; get number of candy pieces held by E.T.
  1492. lsr ; shift upper nybbles to lower nybble
  1493. lsr
  1494. lsr
  1495. lsr
  1496. clc
  1497. adc collectedCandyPieces ; add in number of candy held by Elliott
  1498. sta totalCandyCollected ; save total candy pieces collected
  1499. lsr ; divide value by 2
  1500. clc ; add collected candy value back in so
  1501. adc totalCandyCollected ; value is multiplied by 1.5
  1502. cmp #16
  1503. bcs .setExtraCandyPiecesValue
  1504. lda #16
  1505. .setExtraCandyPiecesValue
  1506. sta extraCandyPieces
  1507. ldx #ID_MOTHERSHIP
  1508. jsr SetCurrentObjectData ; set current object to the MOTHERSHIP
  1509. lda #240
  1510. sta currentObjectVertPos ; set Mothership's vertical position
  1511. lda etHorizPos ; get E.T.'s horizontal position
  1512. sec
  1513. sbc #5
  1514. bpl .setMothershipHorizPos
  1515. lda #0
  1516. .setMothershipHorizPos
  1517. sta currentObjectHorizPos
  1518. lda #MOTHERSHIP_PRESENT | ET_GOING_HOME
  1519. sta mothershipStatus
  1520. jmp DetermineObjectToMove
  1521.  
  1522. .dontLandMothership
  1523. lda #PLAY_SOUND_CHANNEL0 | $1F
  1524. sta soundDataChannel0
  1525. bne MoveET ; unconditional branch
  1526.  
  1527. PlayShipLandingTimerSound
  1528. lda shipLandingTimer ; get timer value for ship landing
  1529. ldx #PLAY_SOUND_CHANNEL0 | $04
  1530. cmp #7
  1531. bcc .setSoundDataChannel0
  1532. and #7
  1533. cmp #7
  1534. bne SetCountdownClockSpriteLSB
  1535. ldx #PLAY_SOUND_CHANNEL0 | $0C
  1536. .setSoundDataChannel0
  1537. stx soundDataChannel0
  1538. SetCountdownClockSpriteLSB
  1539. lda shipLandingTimer ; get timer value for ship landing
  1540. cmp #8
  1541. bcs .setCountdownClockLSB
  1542. asl ; multiply by 8 to speed up timer icon
  1543. asl
  1544. asl
  1545. .setCountdownClockLSB
  1546. and #$38
  1547. clc
  1548. adc #<CountdownClockIcons
  1549. sta graphicPointers+2
  1550. MoveET
  1551. lda SWCHA ; read joystick values
  1552. lsr ; shift player 1 joystick values to
  1553. lsr ; lower nybbles
  1554. lsr
  1555. lsr
  1556. sta tempJoystickValues
  1557. lda etMotionValues ; get E.T. motion values
  1558. and #<(~ET_MOTION_MASK)
  1559. ora tempJoystickValues
  1560. sta etMotionValues ; set new E.T. joystick direction
  1561. bit playerState ; check current player state
  1562. bmi .checkETMotion ; branch if E.T. dead
  1563. bit INPT4 ; check player one fire button
  1564. bmi .clearETRunningStatus ; branch if fire button not pressed
  1565. lda fireResetStatus ; check to see if fire button held
  1566. bmi .checkETMotion ; branch if fire button held
  1567. ora #FIRE_BUTTON_HELD
  1568. sta fireResetStatus ; set status to show fire button held
  1569. lda SWCHA ; read joystick values
  1570. cmp #P0_NO_MOVE
  1571. bcs .skipSetETRunningFlag ; branch if joystick not moved
  1572. rol etMotionValues ; rotate E.T. motion values left
  1573. sec ; set carry and rotate value right to show
  1574. ror etMotionValues ; E.T. is running (i.e. D7 = 1)
  1575. bne .checkETMotion ; unconditional branch
  1576.  
  1577. .skipSetETRunningFlag
  1578. bit etMotionValues ; check E.T. motion values
  1579. bvs .checkETMotion ; branch if E.T. carried by Scientist
  1580. bit etNeckExtensionValues ; check neck extension value
  1581. bmi .checkETMotion ; branch if E.T. neck extended
  1582. dec etVertPos ; move E.T. up 1 pixel
  1583. bpl .setETNeckExtendedValue
  1584. inc etVertPos ; move E.T. down 1 pixel
  1585. .setETNeckExtendedValue
  1586. lda #NECK_EXTENDED
  1587. sta etNeckExtensionValues ; set to show E.T. neck extended
  1588. bne .checkETMotion ; unconditional branch
  1589.  
  1590. .clearETRunningStatus
  1591. rol fireResetStatus ; rotate fire button held status to carry
  1592. clc ; clear carry and rotate value right to
  1593. ror fireResetStatus ; clear fire button held status
  1594. rol etMotionValues ; rotate E.T. motion value left
  1595. clc ; clear carry and rotate value right to
  1596. ror etMotionValues ; set E.T. not running (i.e. D7 = 0)
  1597. .checkETMotion
  1598. bit etMotionValues ; check E.T. motion values
  1599. bvc CheckToRestrictETMovementInPit; branch if E.T. not carried Scientist
  1600. lda scientistScreenId ; get the Scientist screen id
  1601. cmp currentScreenId ; compare with current screen id
  1602. beq .setETLocationToCurrentObject
  1603. bit etMotionValues ; check E.T. motion values
  1604. bpl .setCurrentScreenId ; branch if E.T. not running
  1605. lda etMotionValues ; get E.T. motion values
  1606. and #<(~ET_CARRIED_BY_SCIENTIST)
  1607. sta etMotionValues ; release E.T. from Scientist
  1608. bne .jmpToCheckToMoveET ; unconditional branch
  1609.  
  1610. .setCurrentScreenId
  1611. sta currentScreenId ; set the current screen id
  1612. jsr SetCurrentScreenData
  1613. .setETLocationToCurrentObject
  1614. lda currentObjectVertPos ; get current object vertical position
  1615. sta etVertPos ; set E.T. vertical position
  1616. lda currentObjectHorizPos ; get current object horizontal position
  1617. sta etHorizPos ; set E.T. horizontal position
  1618. .jmpToCheckToMoveET
  1619. jmp CheckIfOkayToMoveET
  1620.  
  1621. CheckToRestrictETMovementInPit
  1622. lda etPitStatus ; get E.T. pit status values
  1623. bne .restrictETMovement ; branch if E.T. is in a pit
  1624. bit etNeckExtensionValues ; check neck extension value
  1625. bpl .jmpToCheckToMoveET ; branch if E.T. neck not extended
  1626. .restrictETMovement
  1627. and #IN_PIT_BOTTOM
  1628. beq CheckForETLevitatingInPit ; branch if E.T. not reached pit bottom
  1629. ldx etHorizPos ; get E.T.'s horizontal position
  1630. lda etMotionValues ; get E.T. motion values
  1631. and #ET_MOTION_MASK
  1632. ora #[~(MOVE_DOWN & MOVE_UP) >> 4] & 15;don't allow E.T. to move vertically
  1633. cpx #PIT_XMIN ; compare E.T. horizontal position
  1634. bcs .checkForPitXMAX
  1635. ora #[(~MOVE_LEFT) >> 4] & 15 ; don't allow E.T. to move left
  1636. .checkForPitXMAX
  1637. cpx #PIT_XMAX ; compare E.T. horizontal position
  1638. bcc .setETPitMotionValue
  1639. ora #[(~MOVE_RIGHT) >> 4] & 15 ; don't allow E.T. to move right
  1640. .setETPitMotionValue
  1641. sta etMotionValues
  1642. jmp CheckIfOkayToMoveET
  1643.  
  1644. CheckForETLevitatingInPit
  1645. bit etPitStatus ; check E.T. pit values
  1646. bvc ETFallingInPit ; branch if E.T. not levitating
  1647. lda frameCount ; get the current frame count
  1648. and #7
  1649. bne .skipEnergyDecrement
  1650. ldx #$00
  1651. ldy #$01
  1652. jsr DecrementETEnergy ; decrement energy by 1 unit
  1653. .skipEnergyDecrement
  1654. lda currentScreenId ; get the current screen id
  1655. cmp #ID_FOREST
  1656. bne CheckForETInPit ; branch if E.T. not in the forest
  1657. lda #0
  1658. sta etPitStatus ; clear E.T. pit status flags
  1659. jmp DetermineObjectToMove
  1660.  
  1661. CheckForETInPit
  1662. cmp #ID_PIT
  1663. bne CheckIfOkayToMoveET
  1664. lda etVertPos ; get E.T.'s vertical position
  1665. cmp #45
  1666. bcc .checkIfETOutOfPit
  1667. lda #IN_PIT_BOTTOM
  1668. sta etPitStatus ; set flag to show E.T. at pit bottom
  1669. bne .jmpToDetermineObjectToMove ; unconditional branch
  1670.  
  1671. .checkIfETOutOfPit
  1672. cmp #2 ; compare E.T.'s vertical position
  1673. bcs .restrictETHorizMovement
  1674. lda holdETVertPos ; get E.T. vertical position before falling
  1675. sta etVertPos ; set E.T. vertical position
  1676. lda holdETHorizPos ; get E.T. horiz position before falling
  1677. sta etHorizPos ; set E.T. horizontal position
  1678. ldx holdETScreenId ; get E.T. screen id before falling
  1679. stx currentScreenId ; set the current screen id
  1680. jsr SetCurrentScreenData
  1681. .jmpToDetermineObjectToMove
  1682. jmp DetermineObjectToMove
  1683.  
  1684. .restrictETHorizMovement
  1685. lda etMotionValues ; get E.T. motion value
  1686. and #ET_MOTION_MASK
  1687. ora #[~(MOVE_RIGHT & MOVE_LEFT) >> 4] & 15; don't allow E.T. to move horiz
  1688. bne .setETPitMotionValue ; unconditional branch
  1689.  
  1690. ETFallingInPit
  1691. bpl .jmpToDetermineObjectToMove ; branch if E.T. not falling
  1692. ldx etVertPos ; get E.T.'s vertical position
  1693. cpx #49
  1694. bcs ETReachedPitBottom
  1695. inc etVertPos
  1696. bne .jmpToDetermineObjectToMove ; unconditional branch
  1697.  
  1698. ETReachedPitBottom SUBROUTINE
  1699. lda #PLAY_SOUND_CHANNEL0 | $1F
  1700. sta soundDataChannel0
  1701. ldx #$02
  1702. ldy #$69 ; reduce energy by 296 units for falling
  1703. jsr DecrementETEnergy ; into pit
  1704. lda #IN_PIT_BOTTOM
  1705. sta etPitStatus ; set flag to show E.T. at pit bottom
  1706. .jmpToDetermineObjectToMove
  1707. jmp DetermineObjectToMove
  1708.  
  1709. CheckIfOkayToMoveET
  1710. bit playerState ; check player state
  1711. bmi .jmpToDetermineObjectToMove ; branch if E.T. is dead
  1712. ldx #0
  1713. lda etMotionValues ; get E.T. motion value
  1714. bpl .determineETFractionalDelay ; branch if E.T. not running
  1715. inx
  1716. .determineETFractionalDelay
  1717. and #ET_MOTION_MASK
  1718. cmp #$0F
  1719. beq CheckToWrapETToAdjacentScreen; branch if E.T. not moving
  1720. lda etFractionalDelay ; get E.T. fractional delay value
  1721. clc
  1722. adc ETFrameDelayTable,x
  1723. sta etFractionalDelay ; set E.T. new fractional delay value
  1724. bcc CheckToWrapETToAdjacentScreen; branch if not time to move E.T.
  1725. lda etMotionValues ; get E.T. motion value
  1726. ldx #1 ; move E.T.
  1727. jsr ObjectDirectionCheck
  1728. ldx #0
  1729. ldy #1
  1730. jsr DecrementETEnergy ; reduce energy by 1 unit
  1731. lda etPitStatus ; get E.T. pit value flags
  1732. bne DetermineObjectToMove ; branch if E.T. is in a pit
  1733. lda etMotionValues ; get E.T. motion value
  1734. bpl CheckToWrapETToAdjacentScreen; branch if E.T. not running
  1735. ldx #1 ; move E.T. again because he's running
  1736. jsr ObjectDirectionCheck
  1737. ldx #0
  1738. ldy #1
  1739. jsr DecrementETEnergy ; reduce energy by 1 unit
  1740. CheckToWrapETToAdjacentScreen
  1741. ldx currentScreenId ; get the current screen id
  1742. lda etHorizPos ; get E.T.'s horizontal position
  1743. cmp #XMAX + 1
  1744. bcc CheckToWrapETVertically ; branch if E.T. not on right screen border
  1745. bpl CheckForETWrappingToRight
  1746. lda LeftScreenIdHorizPosTable,x
  1747. beq .setETVertPos ; never branches -- value never 0
  1748. sta etHorizPos ; set E.T. horizontal position
  1749. .setETVertPos
  1750. lda LeftScreenIdVertPosTable,x
  1751. beq .jmpToSetScreenIdToLeftScreen
  1752. sta etVertPos ; set E.T. vertical position
  1753. .jmpToSetScreenIdToLeftScreen
  1754. lda LeftScreenIdTable,x
  1755. jmp SetCurrentScreenId
  1756.  
  1757. CheckForETWrappingToRight SUBROUTINE
  1758. lda RightScreenIdHorizPosTable,x
  1759. beq .setETVertPos
  1760. sta etHorizPos ; set E.T. horizontal position
  1761. .setETVertPos
  1762. lda RightScreenIdVertPosTable,x
  1763. beq .jmpToSetScreenIdToRightScreen
  1764. sta etVertPos ; set E.T. vertical position
  1765. .jmpToSetScreenIdToRightScreen
  1766. lda RightScreenIdTable,x
  1767. jmp SetCurrentScreenId
  1768.  
  1769. CheckToWrapETVertically SUBROUTINE
  1770. lda etVertPos ; get E.T.'s vertical position
  1771. cmp #59
  1772. bcc DetermineObjectToMove
  1773. bpl CheckForETWrappingDown
  1774. lda UpperScreenIdHorizPosTable,x
  1775. beq .setETVertPos
  1776. sta etHorizPos ; set E.T. horizontal position
  1777. .setETVertPos
  1778. lda UpperScreenIdVertPosTable,x
  1779. beq .jmpToSetScreenIdToUpperScreen; never branches -- value never 0
  1780. sta etVertPos ; set E.T. vertical position
  1781. .jmpToSetScreenIdToUpperScreen
  1782. lda UpperScreenIdTable,x
  1783. jmp SetCurrentScreenId
  1784.  
  1785. CheckForETWrappingDown SUBROUTINE
  1786. lda LowerScreenIdHorizPosTable,x
  1787. beq .setETVertPos
  1788. sta etHorizPos ; set E.T. horizontal position
  1789. .setETVertPos
  1790. lda LowerScreenIdVertPosTable,x
  1791. beq .jmpToSetScreenIdToLowerScreen; never branches -- value never 0
  1792. sta etVertPos ; set E.T. vertical position
  1793. .jmpToSetScreenIdToLowerScreen
  1794. lda LowerScreenIdTable,x
  1795. SetCurrentScreenId
  1796. sta currentScreenId ; set the current screen id
  1797. jsr SetCurrentScreenData
  1798. DetermineObjectToMove
  1799. bit mothershipStatus ; check Mothership status
  1800. bmi CheckToLandMothership ; branch if Mothership is present
  1801. jmp DetermineToMoveHumans
  1802.  
  1803. CheckToLandMothership
  1804. lda mothershipStatus ; get Mothership status
  1805. bvs .mothershipPickingUpET
  1806. ror ; shift D0 to carry
  1807. bcs .mothershipLeavingWithoutET ; branch if Mothership leaving Earth
  1808. lda frameCount ; get the current frame count
  1809. and #3
  1810. bne .playMothershipSound
  1811. inc currentObjectVertPos ; move Mothership down 1 pixel
  1812. inc etVertPos ; move E.T. down 1 pixel
  1813. lda currentObjectVertPos ; get current object's vertical position
  1814. bmi .playMothershipSound
  1815. cmp #H_MOTHERSHIP
  1816. bcc .playMothershipSound
  1817. ror mothershipStatus ; rotate Mothership status right
  1818. sec ; set carry and rotate Mothership status
  1819. rol mothershipStatus ; left to set MOTHERSHIP_LEAVING status
  1820. .playMothershipSound
  1821. jsr PlayMothershipSound
  1822. lda frameCount ; get the current frame count
  1823. and #7
  1824. bne .doneLandMothership
  1825. ldx objectColorPtrs_0
  1826. inx
  1827. cpx #<MotherShipColors+6
  1828. bcc .setMothershipColorPointer
  1829. ldx #<MotherShipColors
  1830. .setMothershipColorPointer
  1831. stx objectColorPtrs_0
  1832. .doneLandMothership
  1833. jmp SetCurrentObjectXYCoordinates
  1834.  
  1835. .mothershipLeavingWithoutET
  1836. dec currentObjectVertPos ; move current object up 1 pixel
  1837. lda currentObjectVertPos ; get current object vertical position
  1838. bpl .playMothershipSound
  1839. cmp #240
  1840. bcs .playMothershipSound
  1841. lda #$00
  1842. sta mothershipStatus ; clear Mothership status flags
  1843. sta graphicPointers+2
  1844. beq .doneLandMothership ; unconditional branch
  1845.  
  1846. .mothershipPickingUpET
  1847. ror ; shift D0 to carry
  1848. bcs .etGoingHome ; branch if Mothership leaving Earth
  1849. lda frameCount ; get the current frame count
  1850. and #3
  1851. bne .playMothershipSound
  1852. inc currentObjectVertPos ; move Mothership down 1 pixel
  1853. lda #H_MOTHERSHIP * 2
  1854. sec
  1855. sbc currentObjectVertPos
  1856. cmp #H_MOTHERSHIP / 2
  1857. bcc .setMothershipHeightForLanding
  1858. lda #H_MOTHERSHIP / 2
  1859. .setMothershipHeightForLanding
  1860. sta currentSpriteHeight
  1861. lda etVertPos ; get E.T.'s vertical position
  1862. clc ; carry clear so SBC is A = A - M ~C
  1863. sbc #4 - 1 ; A = A - 4
  1864. cmp currentObjectVertPos
  1865. bne .playMothershipSound
  1866. ror mothershipStatus ; rotate Mothership status right
  1867. sec ; set carry and rotate Mothership status
  1868. rol mothershipStatus ; left to set MOTHERSHIP_LEAVING status
  1869. bne .playMothershipSound ; unconditional branch
  1870.  
  1871. .etGoingHome
  1872. dec etVertPos ; move E.T. up 1 pixel
  1873. dec currentObjectVertPos ; move current object up 1 pixel
  1874. lda #H_MOTHERSHIP * 2
  1875. sec
  1876. sbc currentObjectVertPos
  1877. cmp #H_MOTHERSHIP / 2
  1878. bcc .setMothershipHeightForLeaving
  1879. lda #H_MOTHERSHIP / 2
  1880. .setMothershipHeightForLeaving
  1881. sta currentSpriteHeight
  1882. lda currentObjectVertPos ; get current object's vertical position
  1883. bpl .playMothershipSound
  1884. cmp #240
  1885. bcs .playMothershipSound
  1886. lda #$00
  1887. sta mothershipStatus ; clear Mothership status flags
  1888. jsr SetCurrentScreenToETHome
  1889. jmp SetCurrentObjectXYCoordinates
  1890.  
  1891. DetermineToMoveHumans
  1892. lda etNeckExtensionValues ; get neck extension value
  1893. bmi .jmpToSetETGraphicPointers ; branch if E.T. neck extended
  1894. lda #FRAME_DELAY_ONE_THIRD ; assume move humans 1 out of 3 frames
  1895. bit SWCHB ; check console switch values
  1896. bmi .calculateHumanMovementDelay ; branch if player 2 difficulty set to PRO
  1897. lda #FRAME_DELAY_ONE_FIFTH ; move humans 1 out of 5 frames
  1898. .calculateHumanMovementDelay
  1899. clc
  1900. adc humanFractionalDelay
  1901. sta humanFractionalDelay
  1902. bcs MoveHumanSprites
  1903. .jmpToSetETGraphicPointers
  1904. jmp SetETGraphicPointers
  1905.  
  1906. MoveHumanSprites
  1907. ldx #3
  1908. MoveHumanLoop
  1909. dex
  1910. bmi .jmpToSetETGraphicPointers
  1911. lda objectScreenId,x ; get the human's screen id
  1912. bmi MoveHumanLoop
  1913. cmp #ID_WASHINGTON_DC ; see if human is on WASHINGTON_DC screen
  1914. bne .checkForHumanOnCurrentScreen
  1915. ldy humanAttributes,x ; get the human's attributes
  1916. bpl .checkForHumanOnCurrentScreen; branch if not returning home
  1917. lda HumanTargetVertPosTable,x
  1918. sta humanTargetVertPos
  1919. ldy HumanTargetHorizPosTable,x
  1920. sty humanTargetHorizPos
  1921. cmp objectVertPos,x
  1922. bne .moveHumanToHomeArea
  1923. tya
  1924. cmp objectHorizPos,x
  1925. bne .moveHumanToHomeArea
  1926. lda #<-1
  1927. sta objectScreenId,x
  1928. txa ; move object id to accumulator
  1929. bne .checkForElliottHome ; branch if not FBI Agent
  1930. lda #<(~FBI_HAS_PHONE_PIECE) ; have FBI Agent release phone piece
  1931. and h_phonePieceAttribute
  1932. sta h_phonePieceAttribute
  1933. lda #<(~FBI_HAS_PHONE_PIECE)
  1934. and s_phonePieceAttribute
  1935. sta s_phonePieceAttribute
  1936. lda #<(~FBI_HAS_PHONE_PIECE)
  1937. and w_phonePieceAttribute
  1938. sta w_phonePieceAttribute
  1939. .checkForElliottHome
  1940. cpx #ID_ELLIOTT
  1941. bne .checkForScientistHome
  1942. bit etMotionValues ; check E.T. motion value
  1943. bvs .checkForScientistHome ; branch if E.T. carried by Scientist
  1944. bit playerState ; check player state
  1945. bmi .checkForScientistHome ; branch if E.T. is dead
  1946. lda #ELLIOTT_HAS_PHONE_PIECE
  1947. bit h_phonePieceAttribute
  1948. bne .clearElliottReturnHomeFlag ; branch if Elliott has H phone piece
  1949. bit s_phonePieceAttribute
  1950. bne .clearElliottReturnHomeFlag ; branch if Elliott has S phone piece
  1951. bit w_phonePieceAttribute
  1952. beq .checkForScientistHome ; branch if Elliott has no phone pieces
  1953. .clearElliottReturnHomeFlag
  1954. rol elliottAttributes ; rotate Elliott attributes left and
  1955. clc ; clear carry and rotate value right to
  1956. ror elliottAttributes ; clear RETURN_HOME flag (i.e. D7 = 0)
  1957. .checkForScientistHome
  1958. cpx #ID_SCIENTIST
  1959. bne .checkToClearCurrentHuman
  1960. lda etMotionValues ; get E.T. motion value
  1961. and #<(~ET_CARRIED_BY_SCIENTIST)
  1962. sta etMotionValues ; release E.T. from Scientist
  1963. .checkToClearCurrentHuman
  1964. cpx currentObjectId
  1965. bne MoveHumanLoop
  1966. lda #<-1
  1967. sta currentObjectId ; clear human as current object
  1968. lda #0
  1969. sta currentSpriteHeight
  1970. beq MoveHumanLoop ; unconditional branch
  1971.  
  1972. .moveHumanToHomeArea
  1973. ldy #4 ; human to go to target area
  1974. bne .moveHumanTowardTarget ; unconditional branch
  1975.  
  1976. .checkForHumanOnCurrentScreen
  1977. cmp currentScreenId
  1978. bne MoveHumans
  1979. ldy humanAttributes,x ; get human attribute value
  1980. bmi MoveHumans ; branch if returning home
  1981. lda objectVertPos,x
  1982. cmp HumanVerticalMaxTable,x
  1983. bcc .humanSeekOutET
  1984. dec objectVertPos,x ; move human up 1 pixel
  1985. .humanSeekOutET
  1986. ldy #0
  1987. .moveHumanTowardTarget
  1988. jsr MoveHumanTowardTarget
  1989. .nextHumanId
  1990. jmp MoveHumanLoop
  1991.  
  1992. MoveHumans
  1993. lda humanAttributes,x ; get human attributes
  1994. lsr ; shift MOVE_UP value to carry
  1995. bcc MoveHumanUp
  1996. lsr ; shift MOVE_DOWN value to carry
  1997. bcc MoveHumanDown
  1998. lsr ; shift MOVE_LEFT value to carry
  1999. bcs .checkForMovingRight
  2000. jmp MoveHumanLeft
  2001.  
  2002. .checkForMovingRight
  2003. lsr ; shift MOVE_RIGHT value to carry
  2004. bcs .nextHumanId
  2005. jmp MoveHumanRight
  2006.  
  2007. MoveHumanUp SUBROUTINE
  2008. dec objectVertPos,x ; move object up
  2009. bpl .nextHuman ; branch if object still on screen
  2010. ldy objectScreenId,x ; get the current screen id of the object
  2011. lda UpperScreenIdTable,y
  2012. jsr CheckForHumanOnScreen ; check to see if human on screen
  2013. bcs .moveHumanDown2Pixels ; branch if human already on the screen
  2014. sta objectScreenId,x ; set human's new screen id
  2015. cpx currentObjectId ; see if the human is the current object
  2016. bne .setHumanPosition ; branch if human not the current object
  2017. lda #<-1
  2018. sta currentObjectId ; clear human as current object (i.e. human
  2019. lda #0 ; moved off current screen)
  2020. sta currentSpriteHeight
  2021. .setHumanPosition
  2022. lda UpperScreenIdVertPosTable,y
  2023. beq .setHumanHorizontalPosition
  2024. cmp HumanVerticalMaxTable,x
  2025. bcc .setHumanVerticalPosition
  2026. lda HumanVerticalMaxTable,x
  2027. sbc #1
  2028. .setHumanVerticalPosition
  2029. sta objectVertPos,x
  2030. .setHumanHorizontalPosition
  2031. lda UpperScreenIdHorizPosTable,y
  2032. beq .checkToSetAsCurrentHuman
  2033. sta objectHorizPos,x
  2034. .checkToSetAsCurrentHuman
  2035. lda objectScreenId,x ; get the object's screen id
  2036. cmp currentScreenId ; see if object is on current screen
  2037. bne .nextHuman ; branch if object not on current screen
  2038. stx currentObjectId
  2039. jsr SetCurrentObjectData
  2040. .nextHuman
  2041. jmp MoveHumanLoop
  2042.  
  2043. .moveHumanDown2Pixels
  2044. inc objectVertPos,x
  2045. inc objectVertPos,x
  2046. jmp MoveHumanLoop
  2047.  
  2048. MoveHumanDown SUBROUTINE
  2049. inc objectVertPos,x ; move object down
  2050. lda HumanVerticalMaxTable,x ; get the object's vertical max value
  2051. cmp objectVertPos,x ; compare with object vertical position
  2052. bcs .moveNextHuman
  2053. ldy objectScreenId,x ; get the current screen id of the object
  2054. lda LowerScreenIdTable,y
  2055. jsr CheckForHumanOnScreen ; check to see if human on screen
  2056. bcs .moveHumanUp2Pixels ; branch if human already on the screen
  2057. sta objectScreenId,x ; set human's new screen id
  2058. cpx currentObjectId ; see if the human is the current object
  2059. bne .setHumanPosition
  2060. lda #<-1
  2061. sta currentObjectId ; clear human as current object (i.e. human
  2062. lda #0 ; moved off current screen)
  2063. sta currentSpriteHeight
  2064. .setHumanPosition
  2065. lda LowerScreenIdVertPosTable,y
  2066. beq .setHumanHorizontalPosition
  2067. cmp HumanVerticalMaxTable,x
  2068. bcc .setHumanVerticalPosition
  2069. lda HumanVerticalMaxTable,x
  2070. sbc #1
  2071. .setHumanVerticalPosition
  2072. sta objectVertPos,x
  2073. .setHumanHorizontalPosition
  2074. lda LowerScreenIdHorizPosTable,y
  2075. beq .checkToSetAsCurrentHuman
  2076. sta objectHorizPos,x
  2077. .checkToSetAsCurrentHuman
  2078. lda objectScreenId,x ; get the object's screen id
  2079. cmp currentScreenId ; see if object is on current screen
  2080. bne .moveNextHuman ; branch if object not on current screen
  2081. stx currentObjectId
  2082. jsr SetCurrentObjectData
  2083. .moveNextHuman
  2084. jmp MoveHumanLoop
  2085.  
  2086. .moveHumanUp2Pixels
  2087. dec objectVertPos,x
  2088. dec objectVertPos,x
  2089. jmp MoveHumanLoop
  2090.  
  2091. MoveHumanLeft SUBROUTINE
  2092. dec objectHorizPos,x ; move object left
  2093. bpl .nextHuman
  2094. ldy objectScreenId,x ; get the current screen id of the object
  2095. lda LeftScreenIdTable,y
  2096. jsr CheckForHumanOnScreen ; check to see if human on screen
  2097. bcs .moveHumanRight2Pixels ; branch if human already on the screen
  2098. sta objectScreenId,x ; set human's new screen id
  2099. cpx currentObjectId ; see if the human is the current object
  2100. bne .setHumanPosition
  2101. lda #<-1
  2102. sta currentObjectId ; clear human as current object (i.e. human
  2103. lda #0 ; moved off current screen)
  2104. sta currentSpriteHeight
  2105. .setHumanPosition
  2106. lda LeftScreenIdVertPosTable,y
  2107. beq .setHumanHorizontalPosition
  2108. cmp HumanVerticalMaxTable,x
  2109. bcc .setHumanVerticalPosition
  2110. lda HumanVerticalMaxTable,x
  2111. sbc #1
  2112. .setHumanVerticalPosition
  2113. sta objectVertPos,x
  2114. .setHumanHorizontalPosition
  2115. lda LeftScreenIdHorizPosTable,y
  2116. beq .checkToSetAsCurrentHuman
  2117. sta objectHorizPos,x
  2118. .checkToSetAsCurrentHuman
  2119. lda objectScreenId,x ; get the object's screen id
  2120. cmp currentScreenId ; see if object is on current screen
  2121. bne .nextHuman ; branch if object not on current screen
  2122. stx currentObjectId
  2123. jsr SetCurrentObjectData
  2124. .nextHuman
  2125. jmp MoveHumanLoop
  2126.  
  2127. .moveHumanRight2Pixels
  2128. inc objectHorizPos,x
  2129. inc objectHorizPos,x
  2130. jmp MoveHumanLoop
  2131.  
  2132. MoveHumanRight SUBROUTINE
  2133. inc objectHorizPos,x ; move object right
  2134. ldy objectHorizPos,x ; get the object's horizontal position
  2135. cpy #XMAX + 1
  2136. bcc .nextHuman
  2137. ldy objectScreenId,x ; get the current screen id of the object
  2138. lda RightScreenIdTable,y
  2139. jsr CheckForHumanOnScreen ; check to see if human on screen
  2140. bcs .moveHumanLeft2Pixels ; branch if human already on the screen
  2141. sta objectScreenId,x ; set human's new screen id
  2142. cpx currentObjectId ; see if the human is the current object
  2143. bne .setHumanPosition
  2144. lda #<-1
  2145. sta currentObjectId ; clear human as current object (i.e. human
  2146. lda #0 ; moved off current screen)
  2147. sta currentSpriteHeight
  2148. .setHumanPosition
  2149. lda RightScreenIdVertPosTable,y
  2150. beq .setHumanHorizontalPosition
  2151. cmp HumanVerticalMaxTable,x
  2152. bcc .setHumanVerticalPosition
  2153. lda HumanVerticalMaxTable,x
  2154. sbc #1
  2155. .setHumanVerticalPosition
  2156. sta objectVertPos,x
  2157. .setHumanHorizontalPosition
  2158. lda RightScreenIdHorizPosTable,y
  2159. beq .checkToSetAsCurrentHuman
  2160. sta objectHorizPos,x
  2161. .checkToSetAsCurrentHuman
  2162. lda objectScreenId,x ; get the object's screen id
  2163. cmp currentScreenId ; see if object is on current screen
  2164. bne .nextHuman ; branch if object not on current screen
  2165. stx currentObjectId
  2166. jsr SetCurrentObjectData
  2167. .nextHuman
  2168. jmp MoveHumanLoop
  2169.  
  2170. .moveHumanLeft2Pixels
  2171. dec objectHorizPos,x
  2172. dec objectHorizPos,x
  2173. jmp MoveHumanLoop
  2174.  
  2175. SetETGraphicPointers
  2176. bit playerState ; check player state
  2177. bpl .setETGraphicPointersNotDead ; branch if E.T. is not dead
  2178. lda #<ETDead_1
  2179. sta etGraphicPointers1
  2180. lda #<ETDead_0
  2181. sta etGraphicPointers0
  2182. lda #12 / 2
  2183. sta etHeight
  2184. bne .setETSpritePtrMSB ; unconditional branch
  2185.  
  2186. .setETGraphicPointersNotDead
  2187. lda etNeckExtensionValues ; get neck extension value
  2188. bpl .setNormalETGraphicPointers ; branch if neck not extended
  2189. and #3
  2190. tax
  2191. lda ETNeckExtensionHeightTable,x
  2192. sta etHeight
  2193. lda ETNeckExtensionLSBTable_A,x
  2194. sta etGraphicPointers0
  2195. lda ETNeckExtensionLSBTable_B,x
  2196. sta etGraphicPointers1
  2197. bne .setETSpritePtrMSB ; unconditional branch
  2198.  
  2199. .setNormalETGraphicPointers
  2200. lda #18 / 2
  2201. sta etHeight
  2202. lda SWCHA ; read joystick values
  2203. cmp #P0_NO_MOVE
  2204. bcs .setToETRestSpritePtrs ; branch if E.T. not moving
  2205. lda #3
  2206. bit etMotionValues ; check E.T. motion value
  2207. bpl .determineETAnimationIndex ; branch if E.T. is not running
  2208. lsr
  2209. .determineETAnimationIndex
  2210. and frameCount
  2211. bne .setETSpritePtrMSB
  2212. ldx etAnimationIndex ; get E.T. animation table index
  2213. dex
  2214. bpl .setETAnimationGraphicPtrs ; branch if index didn't wrap around
  2215. ldx #2
  2216. .setETAnimationGraphicPtrs
  2217. stx etAnimationIndex
  2218. lda ETAnimationLSBTable_A,x
  2219. sta etGraphicPointers0
  2220. lda ETAnimationLSBTable_B,x
  2221. sta etGraphicPointers1
  2222. bne .setETSpritePtrMSB ; unconditional branch
  2223.  
  2224. .setToETRestSpritePtrs
  2225. lda #<ETWalkSprite_A0
  2226. sta etGraphicPointers0
  2227. lda #<ETWalkSprite_B0
  2228. sta etGraphicPointers1
  2229. .setETSpritePtrMSB
  2230. lda #>ETSprites
  2231. sta etGraphicPointers0+1
  2232. sta etGraphicPointers1+1
  2233. SetSpecialSpriteForPit
  2234. lda currentObjectId ; get the current object id
  2235. cmp #$80 | ID_FLOWER
  2236. bne DetermineObjectAnimationPtrs
  2237. bit easterEggSpriteFlag ; check Easter Egg sprite flags
  2238. bpl .setFlowerGrowthAnimation ; animate flower growth
  2239. ldx #ID_INDY ; assume we are showing Indy sprite
  2240. bvs .setEasterEggSpriteInfo ; branch if set current object data
  2241. dex ; reduce object id to be Yar wings up
  2242. lda frameCount ; get the current frame count
  2243. and #2
  2244. bne .setEasterEggSpriteInfo
  2245. dex ; reduce object id to be Yar wings down
  2246. .setEasterEggSpriteInfo
  2247. jsr SetCurrentObjectData
  2248. jmp SetCurrentObjectXYCoordinates
  2249.  
  2250. .setFlowerGrowthAnimation
  2251. lda flowerState ; get the flower state
  2252. lsr ; move revive animation to lower nybbles
  2253. lsr
  2254. lsr
  2255. lsr
  2256. and #3
  2257. tax
  2258. lda FlowerAnimationLSBTable_A,x
  2259. sta objectGraphicPtrs_0
  2260. lda FlowerAnimationLSBTable_B,x
  2261. sta objectGraphicPtrs_1
  2262. jmp SetCurrentObjectXYCoordinates
  2263.  
  2264. DetermineObjectAnimationPtrs
  2265. ldx currentObjectId ; get the current object id
  2266. bmi SetCurrentObjectXYCoordinates
  2267. lda HumanAnimationRate,x ; get human animation rate
  2268. and frameCount
  2269. bne SetCurrentObjectXYCoordinates; skip animation if not time
  2270. lda objectGraphicPtrs_0 ; get the object's graphic LSB value
  2271. clc
  2272. adc SpriteHeightValues,x ; increase by sprite height
  2273. cmp HumanEndAnimationTable,x
  2274. bcc .setHumanAnimationGraphicPtrs
  2275. lda ObjectGraphicPointersLSB_0,x
  2276. sta objectGraphicPtrs_0
  2277. lda ObjectGraphicPointersLSB_1,x
  2278. sta objectGraphicPtrs_1
  2279. bne SetCurrentObjectXYCoordinates; unconditional branch
  2280.  
  2281. .setHumanAnimationGraphicPtrs
  2282. sta objectGraphicPtrs_0
  2283. lda objectGraphicPtrs_1
  2284. clc
  2285. adc SpriteHeightValues,x
  2286. sta objectGraphicPtrs_1
  2287. SetCurrentObjectXYCoordinates
  2288. lda currentScreenId ; get the current screen id
  2289. cmp #ID_ET_HOME
  2290. beq .setObjectsHorizPosition
  2291. ldx currentObjectId ; get the current object id
  2292. bmi .setObjectsHorizPosition
  2293. lda objectVertPos,x
  2294. sta currentObjectVertPos
  2295. lda objectHorizPos,x
  2296. sta currentObjectHorizPos
  2297. .setObjectsHorizPosition
  2298. lda etHorizPos ; get E.T.'s horizontal position
  2299. pha ; push value on to stack
  2300. lda #30
  2301. sta etHorizPos ; set position for status icons
  2302. jmp HorizPositionObjects
  2303.  
  2304. SetCurrentScreenData
  2305. ldx currentScreenId ; get the current screen id
  2306. lda PlayfieldGraphicPointersMSB,x
  2307. sta pf1GraphicPtrs+1
  2308. sta pf2GraphicPtrs+1
  2309. lda PF1GraphicPointersLSB,x
  2310. sta pf1GraphicPtrs
  2311. lda PF2GraphicPointersLSB,x
  2312. sta pf2GraphicPtrs
  2313. lda #$00
  2314. sta easterEggSpriteFlag ; clear Easter Egg sprite flags
  2315. sta programmerInitialFlag ; clear flag to show programmer initials
  2316. ldy #<(~PHONE_PIECE_SCREEN_LOC)
  2317. tya
  2318. and h_phonePieceAttribute
  2319. sta h_phonePieceAttribute
  2320. tya
  2321. and s_phonePieceAttribute
  2322. sta s_phonePieceAttribute
  2323. tya
  2324. and w_phonePieceAttribute
  2325. sta w_phonePieceAttribute
  2326. lda #127
  2327. sta etHeartVertPos
  2328. sta phonePieceMapVertPos
  2329. sta candyVertPos
  2330. bit mothershipStatus ; check Mothership status
  2331. bpl CheckToEnableETHeart ; branch if Mothership not present
  2332. lda #<-1
  2333. sta currentObjectId
  2334. lda #61
  2335. sta etHorizPos
  2336. lda #244
  2337. sta etVertPos
  2338. lda #18 / 2
  2339. sta etHeight
  2340. lda #<ETWalkSprite_A0
  2341. sta etGraphicPointers0
  2342. lda #<ETWalkSprite_B0
  2343. sta etGraphicPointers1
  2344. lda #>ETSprites
  2345. sta etGraphicPointers0+1
  2346. sta etGraphicPointers1+1
  2347. ldx #ID_MOTHERSHIP
  2348. jsr SetCurrentObjectData
  2349. lda #56
  2350. sta currentObjectHorizPos
  2351. lda #240
  2352. sta currentObjectVertPos
  2353. rts
  2354.  
  2355. CheckToEnableETHeart
  2356. cpx #ID_ET_HOME
  2357. bne .checkForETInPit ; branch if E.T. not on HOME screen
  2358. bit playerState ; check player state
  2359. bpl .doneCheckForETHeart ; branch if E.T. is not dead
  2360. lda #51
  2361. sta etHeartVertPos
  2362. lda #64
  2363. sta etHeartHorizPos
  2364. .doneCheckForETHeart
  2365. rts
  2366.  
  2367. .checkForETInPit
  2368. cpx #ID_PIT
  2369. beq PositionETInPit
  2370. txa
  2371. ldx #ID_SCIENTIST
  2372. .findCurrentHumanLoop
  2373. cmp objectScreenId,x ; see if human is on current screen
  2374. beq .setCurrentHumanId ; if so then set current object attributes
  2375. dex
  2376. bpl .findCurrentHumanLoop
  2377. lda #<-1
  2378. sta currentObjectId
  2379. lda #0
  2380. sta currentSpriteHeight
  2381. sta currentObjectVertPos
  2382. beq CalculatePowerZonePointer ; unconditional branch
  2383.  
  2384. .setCurrentHumanId
  2385. stx currentObjectId ; set current object id
  2386. jsr SetCurrentObjectData
  2387. CalculatePowerZonePointer
  2388. ldx currentScreenId ; get the current screen id
  2389. cpx #ID_FOREST
  2390. bcs .determinePowerZonePointerLSB; branch if not a well screen
  2391. lda CandyStatusValueTable,x
  2392. and candyStatus
  2393. beq .determinePowerZonePointerLSB
  2394. lda CandyVertPositionTable,x
  2395. sta candyVertPos ; set candy vertical position
  2396. lda CandyHorizPositionTable,x
  2397. sta candyHorizPos ; set candy horizontal position
  2398. .determinePowerZonePointerLSB
  2399. lda currentScreenId ; get the current screen id
  2400. cmp #ID_PIT
  2401. bcs .doneCalculatePowerZonePointer; branch if in pit or game over
  2402. lsr ; divide current screen id by 2
  2403. tax
  2404. lda powerZoneLSBValues,x
  2405. bcs .multi8 ; branch if odd screen id (EIGHT_PITS, FOUR_PITS, WASH)
  2406. lsr ; divide value by 2
  2407. bpl .setPowerZonePointerLSB ; unconditional branch
  2408.  
  2409. .multi8
  2410. asl
  2411. asl
  2412. asl
  2413. .setPowerZonePointerLSB
  2414. and #$78
  2415. sta powerZonePointer
  2416. .doneCalculatePowerZonePointer
  2417. rts
  2418.  
  2419. CandyVertPositionTable
  2420. .byte 32,32,32,32
  2421.  
  2422. CandyHorizPositionTable
  2423. .byte 60,60,38,38
  2424.  
  2425. PositionETInPit
  2426. lda #69
  2427. sta etHorizPos
  2428. lda #3
  2429. sta etVertPos
  2430. lda #FALLING_IN_PIT
  2431. sta etPitStatus ; set status to show E.T. falling in a pit
  2432. bit playerState ; check player state
  2433. bmi .noObjectInCurrentPit ; branch if E.T. is dead
  2434. ldx #NUM_PHONE_PIECES - 1
  2435. .checkPhonePieceInCurrentPit
  2436. lda phonePieceAttributes,x ; get phone piece attribute value
  2437. and #<(~PHONE_PIECE_PIT_NUMBER)
  2438. bne .checkNextPhonePiece ; branch if phone piece taken
  2439. lda phonePieceAttributes,x ; get phone piece attribute value
  2440. and #PHONE_PIECE_PIT_NUMBER ; keep phone piece pit number
  2441. cmp currentPitNumber ; compare with current pit number
  2442. beq .setCurrentObjectToPhonePiece; branch if phone piece in current pit
  2443. .checkNextPhonePiece
  2444. dex
  2445. bpl .checkPhonePieceInCurrentPit
  2446. lda flowerState ; get flower state
  2447. and #FLOWER_PIT_NUMBER ; keep flower pit number
  2448. cmp currentPitNumber ; compare with current pit number
  2449. bne .noObjectInCurrentPit ; branch if flower not in current pit
  2450. lda #$80 | ID_FLOWER
  2451. bne .setCurrentObjectIdInPit ; unconditional branch
  2452.  
  2453. .noObjectInCurrentPit
  2454. ldx #<-1
  2455. stx currentObjectId
  2456. inx ; x = 0
  2457. stx currentSpriteHeight
  2458. rts
  2459.  
  2460. .setCurrentObjectToPhonePiece
  2461. txa
  2462. adc #$80 | ID_H_PHONE_PIECE - 1
  2463. .setCurrentObjectIdInPit
  2464. sta currentObjectId
  2465. and #$0F
  2466. tax
  2467. jsr SetCurrentObjectData
  2468. lda #OBJECT_IN_PIT_Y
  2469. sta currentObjectVertPos
  2470. lda #OBJECT_IN_PIT_X
  2471. sta currentObjectHorizPos
  2472. rts
  2473.  
  2474. BOUNDARY 0
  2475.  
  2476. HMOVETable
  2477. .byte HMOVE_R1,HMOVE_R2,HMOVE_R3,HMOVE_R4,HMOVE_R5,HMOVE_R6,HMOVE_R7
  2478. COARSE_MOTION SET 0
  2479. REPEAT 8
  2480.  
  2481. COARSE_MOTION SET COARSE_MOTION + 1
  2482. .byte HMOVE_L7 | COARSE_MOTION
  2483. .byte HMOVE_L6 | COARSE_MOTION
  2484. .byte HMOVE_L5 | COARSE_MOTION
  2485. .byte HMOVE_L4 | COARSE_MOTION
  2486. .byte HMOVE_L3 | COARSE_MOTION
  2487. .byte HMOVE_L2 | COARSE_MOTION
  2488. .byte HMOVE_L1 | COARSE_MOTION
  2489. .byte HMOVE_0 | COARSE_MOTION
  2490. .byte HMOVE_R1 | COARSE_MOTION
  2491. .byte HMOVE_R2 | COARSE_MOTION
  2492. .byte HMOVE_R3 | COARSE_MOTION
  2493. .byte HMOVE_R4 | COARSE_MOTION
  2494. .byte HMOVE_R5 | COARSE_MOTION
  2495. .byte HMOVE_R6 | COARSE_MOTION
  2496. .byte HMOVE_R7 | COARSE_MOTION
  2497.  
  2498. REPEND
  2499.  
  2500. Start
  2501. ;
  2502. ; Set up everything so the power up state is known.
  2503. ;
  2504. sei ; disable interrupts
  2505. cld ; clear decimal mode
  2506. ldx #$FF
  2507. txs ; set stack to the beginning
  2508. inx ; x = 0
  2509. txa
  2510. .clearLoop
  2511. sta VSYNC,x
  2512. dex
  2513. bne .clearLoop
  2514. lda #$01
  2515. sta CTRLPF
  2516. sta gameSelection ; set initial game selection to 1
  2517. lda #>PowerZoneMap
  2518. sta powerZonePointer+1
  2519. lda #ORANGE+10
  2520. sta telephoneColor
  2521. lda #LT_BLUE+12
  2522. sta powerZoneColor
  2523. lda #BROWN+10
  2524. sta timerColor
  2525. lda #ID_TITLE_SCREEN
  2526. sta currentScreenId ; set the current screen id
  2527. jsr SetCurrentScreenData
  2528. jmp StartNewFrame
  2529.  
  2530. JumpToDisplayKernel SUBROUTINE
  2531. .waitTime
  2532. lda INTIM
  2533. bne .waitTime
  2534. sta WSYNC
  2535. sta WSYNC
  2536. lda #<DisplayKernel
  2537. sta bankSwitchRoutinePtr
  2538. lda #>DisplayKernel
  2539. sta bankSwitchRoutinePtr+1
  2540. lda #LDA_ABS
  2541. sta displayKernelBankSwitch
  2542. lda #<BANK1STROBE
  2543. sta bankSwitchStrobe
  2544. lda #>BANK1STROBE
  2545. sta bankSwitchStrobe+1
  2546. lda #JMP_ABS
  2547. sta bankSwitchABSJmp
  2548. jmp.w displayKernelBankSwitch
  2549.  
  2550. ObjectDirectionCheck
  2551. ror ; shift up motion flag to carry
  2552. bcs .checkForDownMotion ; check down motion if not moving up
  2553. dec currentObjectVertPos,x ; move object up
  2554. .checkForDownMotion
  2555. ror ; shift down motion flag to carry
  2556. bcs .checkForLeftMotion ; check left motion if not moving down
  2557. inc currentObjectVertPos,x ; move object down
  2558. .checkForLeftMotion
  2559. ror ; shift left motion flag to carry
  2560. bcs .checkForRightMotion ; check right motion if not moving left
  2561. dec currentObjectHorizPos,x ; move object left
  2562. .checkForRightMotion
  2563. ror ; shift right motion flag to carry
  2564. bcs .doneObjectDirectionCheck ; done if not moving right
  2565. inc currentObjectHorizPos,x ; move object right
  2566. .doneObjectDirectionCheck
  2567. rts
  2568.  
  2569. MoveHumanTowardTarget
  2570. lda objectVertPos,x ; get the object's vertical position
  2571. cmp etVertPos,y ; compare with target's vertical position
  2572. beq .checkTargetHorizPosition ; check horizontal position if the same
  2573. bcs .moveObjectUpTowardTarget
  2574. inc objectVertPos,x ; move object down
  2575. bne .checkTargetHorizPosition ; unconditional branch
  2576.  
  2577. .moveObjectUpTowardTarget
  2578. dec objectVertPos,x ; move object up
  2579. .checkTargetHorizPosition
  2580. lda objectHorizPos,x ; get the object's horizontal position
  2581. cmp etHorizPos,y ; compare with target's horizontal position
  2582. beq .doneMoveHumanTowardTarget ; done if the same
  2583. bcs .moveObjectLeftTowardTarget
  2584. inc objectHorizPos,x ; move the object right
  2585. .doneMoveHumanTowardTarget
  2586. rts
  2587.  
  2588. .moveObjectLeftTowardTarget
  2589. dec objectHorizPos,x ; move the object left
  2590. rts
  2591.  
  2592. PhonePiecePitVertPosition
  2593. .byte 19,32,32,44,11,32,32,52,21,21,45,45,15,15,47,47
  2594.  
  2595. PhonePiecePitHorizPosition
  2596. .byte 62,25,101,62,62,30,95,62,25,100,28,96,30,95,30,95
  2597. .byte 0,0,0,0,0,10,9,11,0,6,5,7,0,14,13,15
  2598.  
  2599. PlayfieldGraphicPointersMSB
  2600. .byte >WideDiamondPitGraphics,>EightPitGraphics,>ArrowPitGraphics
  2601. .byte >FourDiamondPitGraphics,>ForestGraphics,>WashingtonDCGraphics
  2602. .byte >PitGraphics,>ETHomePFGraphics
  2603.  
  2604. PF1GraphicPointersLSB
  2605. .byte <WideDiamondPitPF1Graphics,<EightPitGraphics,<ArrowPitPF1Graphics
  2606. .byte <FourDiamondPitGraphics,<ForestPF1Graphics,<WashingtonPF1Graphics
  2607. .byte <PitPF1Graphics,<ETHomePF1Graphics
  2608.  
  2609. PF2GraphicPointersLSB
  2610. .byte <WideDiamondPitPF2Graphics,<EightPitGraphics,<ArrowPitPF2Graphics
  2611. .byte <FourDiamondPitGraphics,<ForestPF2Graphics,<WashingtonPF2Graphics
  2612. .byte <PitPF2Graphics,<ETHomePF2Graphics
  2613.  
  2614. LeftScreenIdHorizPosTable
  2615. .byte 119,119,119,119,68,68
  2616.  
  2617. RightScreenIdHorizPosTable
  2618. .byte 1,1,1,1,58,58
  2619.  
  2620. UpperScreenIdHorizPosTable
  2621. .byte 0,117,0,4,0,0
  2622.  
  2623. LowerScreenIdHorizPosTable
  2624. .byte 0,4,0,117,0,0
  2625.  
  2626. LeftScreenIdVertPosTable
  2627. .byte 0,0,0,0,4,53
  2628.  
  2629. RightScreenIdVertPosTable
  2630. .byte 0,0,0,0,4,53
  2631.  
  2632. UpperScreenIdVertPosTable
  2633. .byte 8,36,57,36,8,57
  2634.  
  2635. LowerScreenIdVertPosTable
  2636. .byte 2,28,50,28,2,50
  2637.  
  2638. LeftScreenIdTable
  2639. .byte ID_EIGHT_PITS,ID_ARROW_PITS,ID_WIDE_DIAMOND_PITS
  2640. .byte ID_FOUR_DIAMOND_PITS,ID_WIDE_DIAMOND_PITS,ID_EIGHT_PITS
  2641.  
  2642. RightScreenIdTable
  2643. .byte ID_WIDE_DIAMOND_PITS,ID_FOUR_DIAMOND_PITS,ID_EIGHT_PITS
  2644. .byte ID_ARROW_PITS,ID_EIGHT_PITS,ID_WIDE_DIAMOND_PITS
  2645.  
  2646. UpperScreenIdTable
  2647. .byte ID_FOREST,ID_FOREST,ID_FOREST,ID_FOREST
  2648. .byte ID_FOUR_DIAMOND_PITS,ID_FOUR_DIAMOND_PITS
  2649.  
  2650. LowerScreenIdTable
  2651. .byte ID_WASHINGTON_DC,ID_WASHINGTON_DC,ID_WASHINGTON_DC
  2652. .byte ID_WASHINGTON_DC,ID_ARROW_PITS,ID_ARROW_PITS
  2653.  
  2654. HumanTargetHorizPosTable
  2655. .byte FBI_AGENT_HORIZ_TARGET
  2656. .byte ELLIOTT_HORIZ_TARGET
  2657. .byte SCIENTIST_HORIZ_TARGET
  2658.  
  2659. HumanTargetVertPosTable
  2660. .byte FBI_AGENT_VERT_TARGET
  2661. .byte ELLIOTT_VERT_TARGET
  2662. .byte SCIENTIST_VERT_TARGET
  2663.  
  2664. HumanVerticalMaxTable
  2665. .byte FBI_AGENT_VERT_MAX
  2666. .byte ELLIOTT_VERT_MAX
  2667. .byte SCIENTIST_VERT_MAX
  2668.  
  2669. FlowerAnimationLSBTable_A
  2670. .byte <Flower_A0,<Flower_A1,<Flower_A2,<Flower_A3
  2671.  
  2672. FlowerAnimationLSBTable_B
  2673. .byte <Flower_B0,<Flower_B1,<Flower_B2,<Flower_B3
  2674.  
  2675. ObjectGraphicPointersMSB
  2676. .byte >FBIAgent_0,>Elliott_0,>Scientist_0,>H_PhonePiece_0,>S_PhonePiece_0
  2677. .byte >W_PhonePiece_0,>Flower_A0,>MotherShip,>Yar_0,>Yar_1,>IndySprite
  2678.  
  2679. ObjectGraphicPointersLSB_0
  2680. .byte <FBIAgent_0,<Elliott_0,<Scientist_0,<H_PhonePiece_0,<S_PhonePiece_0
  2681. .byte <W_PhonePiece_0,<Flower_A0,<MotherShip,<Yar_0,<Yar_1,<IndySprite
  2682.  
  2683. ObjectGraphicPointersLSB_1
  2684. .byte <FBIAgent_4,<Elliott_6,<Scientist_5,<H_PhonePiece_1,<S_PhonePiece_1
  2685. .byte <W_PhonePiece_1,<Flower_B0,<MotherShip,<Yar_0,<Yar_1,<IndySprite
  2686.  
  2687. ObjectColorPointersMSB
  2688. .byte >FBIAgentColors_A
  2689. .byte >ElliottColors_A
  2690. .byte >ScientistColors_A
  2691. .byte >PhonePieceColors_A
  2692. .byte >PhonePieceColors_A
  2693. .byte >PhonePieceColors_A
  2694. .byte >FlowerColors
  2695. .byte >MotherShipColors
  2696. .byte >YarColor
  2697. .byte >YarColor
  2698. .byte >IndyColors
  2699.  
  2700. ObjectColorPointersLSB_A
  2701. .byte <FBIAgentColors_A
  2702. .byte <ElliottColors_A
  2703. .byte <ScientistColors_A
  2704. .byte <PhonePieceColors_A
  2705. .byte <PhonePieceColors_A
  2706. .byte <PhonePieceColors_A
  2707. .byte <FlowerColors
  2708. .byte <MotherShipColors
  2709. .byte <YarColor
  2710. .byte <YarColor
  2711. .byte <IndyColors
  2712.  
  2713. ObjectColorPointersLSB_B
  2714. .byte <FBIAgentColors_B
  2715. .byte <ElliottColors_B
  2716. .byte <ScientistColors_B
  2717. .byte <PhonePieceColors_B
  2718. .byte <PhonePieceColors_B
  2719. .byte <PhonePieceColors_B
  2720. .byte <FlowerColors
  2721. .byte <MotherShipColors
  2722. .byte <YarColor
  2723. .byte <YarColor
  2724. .byte <IndyColors
  2725.  
  2726. HumanEndAnimationTable
  2727. .byte <FBIAgent_4
  2728. .byte <Elliott_5 + (H_ELLIOTT / 2) - 1
  2729. .byte <Scientist_5
  2730.  
  2731. SpriteHeightValues
  2732. .byte H_FBIAGENT/2, H_ELLIOTT/2, H_SCIENTIST/2, H_PHONE_PIECES/2
  2733. .byte H_PHONE_PIECES/2, H_PHONE_PIECES/2, H_FLOWER/2, H_MOTHERSHIP/2
  2734. .byte H_YAR/2, H_YAR/2, H_INDY/2
  2735.  
  2736. HumanAnimationRate
  2737. .byte 3,3,3
  2738.  
  2739. ETAnimationLSBTable_A
  2740. .byte <ETWalkSprite_A0,<ETWalkSprite_A1,<ETWalkSprite_A2
  2741.  
  2742. ETAnimationLSBTable_B
  2743. .byte <ETWalkSprite_B0,<ETWalkSprite_B1,<ETWalkSprite_B2
  2744.  
  2745. HumanDirectionTable
  2746. .byte NO_MOVE,MOVE_LEFT>>4,MOVE_UP>>4,MOVE_RIGHT>>4,MOVE_UP>>4,MOVE_DOWN>>4
  2747. .byte P0_NO_MOVE,P0_NO_MOVE,MOVE_RIGHT>>4,NO_MOVE,MOVE_LEFT>>4,MOVE_UP>>4
  2748. .byte MOVE_UP>>4,MOVE_DOWN>>4,P0_NO_MOVE,P0_NO_MOVE
  2749.  
  2750. .byte MOVE_UP>>4,MOVE_RIGHT>>4,NO_MOVE,MOVE_LEFT>>4,MOVE_UP>>4,MOVE_DOWN>>4
  2751. .byte P0_NO_MOVE,P0_NO_MOVE,MOVE_LEFT>>4,MOVE_DOWN>>4,MOVE_RIGHT>>4,NO_MOVE
  2752. .byte MOVE_UP>>4,MOVE_DOWN>>4,P0_NO_MOVE,P0_NO_MOVE
  2753.  
  2754. .byte MOVE_UP>>4,MOVE_RIGHT>>4,MOVE_DOWN>>4,MOVE_LEFT>>4,NO_MOVE
  2755. .byte MOVE_DOWN>>4,P0_NO_MOVE,P0_NO_MOVE,MOVE_UP>>4,MOVE_LEFT>>4
  2756. .byte MOVE_DOWN>>4,MOVE_RIGHT>>4,MOVE_UP>>4,NO_MOVE,P0_NO_MOVE,P0_NO_MOVE
  2757.  
  2758. ETFrameDelayTable
  2759. .byte FRAME_DELAY_ONE_FORTH,FRAME_DELAY_ONE_HALF
  2760.  
  2761. PowerZoneJumpTable
  2762. .word SetPhonePieceHiddenLocation - 1
  2763. .word WarpETLeft - 1
  2764. .word WarpETRight - 1
  2765. .word WarpETUp - 1
  2766. .word WarpETDown - 1
  2767. .word DetermineHiddenPhonePiece - 1
  2768. .word EatCandyPiece - 1
  2769. .word ReturnCurrentHumanHome - 1
  2770. .word ClearElliottReturnHomeFlag - 1
  2771. .word CallMothership - 1
  2772. .word SetPhonePieceHiddenLocation - 1
  2773. .word LevitateETOutOfPit - 1
  2774. .word ReviveFlower - 1
  2775.  
  2776. ETNeckExtensionLSBTable_A
  2777. .byte <ETExtensionSprite_A0,<ETExtensionSprite_A1
  2778. .byte <ETExtensionSprite_A2,<ETExtensionSprite_A3
  2779.  
  2780. ETNeckExtensionLSBTable_B
  2781. .byte <ETExtensionSprite_B0,<ETExtensionSprite_B1
  2782. .byte <ETExtensionSprite_B2,<ETExtensionSprite_B3
  2783.  
  2784. CandyStatusMaskTable
  2785. .byte ~FOUR_DIAMOND_PITS_CANDY
  2786. .byte ~EIGHT_PITS_CANDY
  2787. .byte ~ARROW_PITS_CANDY
  2788. .byte ~WIDE_DIAMOND_PITS_CANDY
  2789.  
  2790. CandyStatusValueTable
  2791. .byte FOUR_DIAMOND_PITS_CANDY
  2792. .byte EIGHT_PITS_CANDY
  2793. .byte ARROW_PITS_CANDY
  2794. .byte WIDE_DIAMOND_PITS_CANDY
  2795.  
  2796. ExtraCandyReductionTable
  2797. .byte 4,3,3,2,3,2,2,1,3,2,2,1,2,1,1,0
  2798.  
  2799. ETNeckExtensionHeightTable
  2800. .byte 10,11,12,13
  2801.  
  2802. PlayMothershipSound
  2803. lda frameCount ; get the current frame count
  2804. ora #$18
  2805. sta AUDF0
  2806. and #7
  2807. sta AUDF1
  2808. lda frameCount ; get the current frame count
  2809. lsr
  2810. and #$1F
  2811. cmp #16
  2812. bcc .setVolumeAndChannel
  2813. eor #$0F
  2814. .setVolumeAndChannel
  2815. sta AUDV0
  2816. eor #$0F
  2817. sta AUDV1
  2818. lda #$0F
  2819. sta AUDC0
  2820. lda #$0D
  2821. sta AUDC1
  2822. rts
  2823.  
  2824. SetCurrentObjectData
  2825. lda SpriteHeightValues,x
  2826. sta currentSpriteHeight
  2827. lda ObjectGraphicPointersLSB_0,x
  2828. sta objectGraphicPtrs_0
  2829. lda ObjectGraphicPointersLSB_1,x
  2830. sta objectGraphicPtrs_1
  2831. lda ObjectGraphicPointersMSB,x
  2832. sta objectGraphicPtrs_0+1
  2833. sta objectGraphicPtrs_1+1
  2834. lda ObjectColorPointersLSB_A,x
  2835. sta objectColorPtrs_0
  2836. lda ObjectColorPointersLSB_B,x
  2837. sta objectColorPtrs_1
  2838. lda ObjectColorPointersMSB,x
  2839. sta objectColorPtrs_0+1
  2840. sta objectColorPtrs_1+1
  2841. bit easterEggSpriteFlag ; check Easter Egg sprite flags
  2842. bmi .doneSetCurrentObjectData ; branch if showing special object in pit
  2843. lda objectHorizPos,x
  2844. sta currentObjectHorizPos
  2845. lda objectVertPos,x
  2846. sta currentObjectVertPos
  2847. .doneSetCurrentObjectData
  2848. rts
  2849.  
  2850. ThemeMusicFrequencyTable
  2851. .byte LEAD_A3,LEAD_A3,LEAD_A3,LEAD_A3,LEAD_E4,LEAD_E4,LEAD_E4,LEAD_E4
  2852. .byte LEAD_D4,LEAD_C4_SHARP,LEAD_H3,LEAD_C4_SHARP,LEAD_A3,LEAD_A3,LEAD_A3
  2853. .byte LEAD_A3,LEAD_E3_2,LEAD_E3_2,LEAD_E3_2,LEAD_E3_2,LEAD_E3_2,LEAD_E3_2
  2854. .byte LEAD_E3_2,LEAD_E3_2,LEAD_F3_SHARP,LEAD_F3_SHARP,LEAD_F3_SHARP
  2855. .byte LEAD_F3_SHARP,LEAD_F4_SHARP,LEAD_F4_SHARP,LEAD_F4_SHARP,LEAD_F4_SHARP
  2856. .byte LEAD_E4,LEAD_D4_SHARP,LEAD_C4_SHARP,LEAD_D4_SHARP,LEAD_H3,LEAD_H3
  2857. .byte LEAD_H3,LEAD_H3,LEAD_F3_SHARP,LEAD_F3_SHARP,LEAD_F3_SHARP
  2858. .byte LEAD_F3_SHARP,LEAD_G3_SHARP,LEAD_G3_SHARP,LEAD_G3_SHARP,LEAD_H3
  2859. .byte LEAD_C4_SHARP,LEAD_A3,LEAD_E3_2,LEAD_E3_2,LEAD_E3_2,LEAD_E3_2
  2860. .byte LEAD_E3_2
  2861.  
  2862. BOUNDARY 0
  2863.  
  2864. PowerZoneMap
  2865. .byte ID_WARP_UP_ZONE << 4 | ID_RETURN_HOME_ZONE
  2866. .byte ID_WARP_UP_ZONE << 4 | ID_CALL_SHIP_ZONE
  2867. .byte ID_WARP_RIGHT_ZONE << 4 | ID_WARP_RIGHT_ZONE
  2868. .byte ID_WARP_DOWN_ZONE << 4 | ID_LANDING_ZONE
  2869. .byte ID_FIND_PHONE_ZONE << 4 | ID_WARP_DOWN_ZONE
  2870. .byte ID_CALL_ELLIOTT_ZONE << 4 | ID_WARP_LEFT_ZONE
  2871. .byte ID_BLANK_ZONE
  2872. .byte ID_EAT_CANDY_ZONE << 4 | ID_WARP_LEFT_ZONE
  2873.  
  2874. .byte ID_LANDING_ZONE << 4 | ID_EAT_CANDY_ZONE
  2875. .byte ID_RETURN_HOME_ZONE << 4 | ID_WARP_DOWN_ZONE
  2876. .byte ID_WARP_LEFT_ZONE << 4 | ID_BLANK_ZONE
  2877. .byte ID_BLANK_ZONE << 4 | ID_WARP_UP_ZONE
  2878. .byte ID_WARP_RIGHT_ZONE << 4 | ID_WARP_RIGHT_ZONE
  2879. .byte ID_WARP_DOWN_ZONE << 4 | ID_CALL_ELLIOTT_ZONE
  2880. .byte ID_FIND_PHONE_ZONE << 4 | ID_CALL_SHIP_ZONE
  2881. .byte ID_WARP_LEFT_ZONE << 4 | ID_WARP_UP_ZONE
  2882.  
  2883. .byte ID_LANDING_ZONE << 4 | ID_BLANK_ZONE
  2884. .byte ID_WARP_RIGHT_ZONE << 4 | ID_WARP_LEFT_ZONE
  2885. .byte ID_WARP_UP_ZONE << 4 | ID_WARP_LEFT_ZONE
  2886. .byte ID_EAT_CANDY_ZONE << 4 | ID_WARP_UP_ZONE
  2887. .byte ID_WARP_DOWN_ZONE << 4 | ID_BLANK_ZONE
  2888. .byte ID_WARP_DOWN_ZONE << 4 | ID_FIND_PHONE_ZONE
  2889. .byte ID_WARP_RIGHT_ZONE << 4 | ID_RETURN_HOME_ZONE
  2890. .byte ID_CALL_SHIP_ZONE << 4 | ID_CALL_ELLIOTT_ZONE
  2891.  
  2892. .byte ID_WARP_DOWN_ZONE << 4 | ID_WARP_UP_ZONE
  2893. .byte ID_EAT_CANDY_ZONE << 4 | ID_FIND_PHONE_ZONE
  2894. .byte ID_BLANK_ZONE
  2895. .byte ID_WARP_RIGHT_ZONE << 4 | ID_LANDING_ZONE
  2896. .byte ID_RETURN_HOME_ZONE << 4 | ID_WARP_LEFT_ZONE
  2897. .byte ID_WARP_DOWN_ZONE << 4 | ID_CALL_ELLIOTT_ZONE
  2898. .byte ID_CALL_SHIP_ZONE << 4 | ID_WARP_UP_ZONE
  2899. .byte ID_WARP_LEFT_ZONE << 4 | ID_WARP_RIGHT_ZONE
  2900.  
  2901. .byte ID_EAT_CANDY_ZONE << 4 | ID_CALL_ELLIOTT_ZONE
  2902. .byte ID_CALL_SHIP_ZONE << 4 | ID_WARP_RIGHT_ZONE
  2903. .byte ID_FIND_PHONE_ZONE << 4 | ID_WARP_UP_ZONE
  2904. .byte ID_WARP_UP_ZONE << 4 | ID_WARP_LEFT_ZONE
  2905. .byte ID_RETURN_HOME_ZONE << 4 | ID_LANDING_ZONE
  2906. .byte ID_WARP_DOWN_ZONE << 4 | ID_WARP_LEFT_ZONE
  2907. .byte ID_BLANK_ZONE << 4 | ID_WARP_DOWN_ZONE
  2908. .byte ID_WARP_RIGHT_ZONE << 4 | ID_BLANK_ZONE
  2909.  
  2910. .byte ID_WARP_UP_ZONE << 4 | ID_WARP_LEFT_ZONE
  2911. .byte ID_LANDING_ZONE << 4 | ID_WARP_RIGHT_ZONE
  2912. .byte ID_WARP_UP_ZONE << 4 | ID_WARP_LEFT_ZONE
  2913. .byte ID_BLANK_ZONE << 4 | ID_EAT_CANDY_ZONE
  2914. .byte ID_CALL_ELLIOTT_ZONE << 4 | ID_CALL_SHIP_ZONE
  2915. .byte ID_BLANK_ZONE << 4 | ID_RETURN_HOME_ZONE
  2916. .byte ID_FIND_PHONE_ZONE << 4 | ID_WARP_DOWN_ZONE
  2917. .byte ID_WARP_DOWN_ZONE << 4 | ID_WARP_RIGHT_ZONE
  2918.  
  2919. .byte ID_EAT_CANDY_ZONE << 4 | ID_WARP_DOWN_ZONE
  2920. .byte ID_CALL_ELLIOTT_ZONE << 4 | ID_WARP_LEFT_ZONE
  2921. .byte ID_FIND_PHONE_ZONE << 4 | ID_WARP_RIGHT_ZONE
  2922. .byte ID_WARP_RIGHT_ZONE << 4 | ID_WARP_LEFT_ZONE
  2923. .byte ID_BLANK_ZONE << 4 | ID_WARP_UP_ZONE
  2924. .byte ID_WARP_DOWN_ZONE << 4 | ID_LANDING_ZONE
  2925. .byte ID_WARP_UP_ZONE << 4 | ID_CALL_SHIP_ZONE
  2926. .byte ID_BLANK_ZONE << 4 | ID_RETURN_HOME_ZONE
  2927.  
  2928. .byte ID_WARP_LEFT_ZONE << 4 | ID_EAT_CANDY_ZONE
  2929. .byte ID_RETURN_HOME_ZONE << 4 | ID_WARP_UP_ZONE
  2930. .byte ID_BLANK_ZONE << 4 | ID_WARP_UP_ZONE
  2931. .byte ID_LANDING_ZONE << 4 | ID_FIND_PHONE_ZONE
  2932. .byte ID_WARP_LEFT_ZONE << 4 | ID_WARP_DOWN_ZONE
  2933. .byte ID_BLANK_ZONE << 4 | ID_WARP_DOWN_ZONE
  2934. .byte ID_CALL_ELLIOTT_ZONE << 4 | ID_CALL_SHIP_ZONE
  2935. .byte ID_WARP_RIGHT_ZONE << 4 | ID_WARP_RIGHT_ZONE
  2936.  
  2937. .byte ID_WARP_RIGHT_ZONE << 4 | ID_LANDING_ZONE
  2938. .byte ID_RETURN_HOME_ZONE << 4 | ID_WARP_UP_ZONE
  2939. .byte ID_BLANK_ZONE << 4 | ID_WARP_DOWN_ZONE
  2940. .byte ID_WARP_LEFT_ZONE << 4 | ID_BLANK_ZONE
  2941. .byte ID_WARP_UP_ZONE << 4 | ID_CALL_ELLIOTT_ZONE
  2942. .byte ID_WARP_DOWN_ZONE << 4 | ID_FIND_PHONE_ZONE
  2943. .byte ID_WARP_RIGHT_ZONE << 4 | ID_EAT_CANDY_ZONE
  2944. .byte ID_CALL_SHIP_ZONE << 4 | ID_WARP_LEFT_ZONE
  2945.  
  2946. .byte ID_EAT_CANDY_ZONE << 4 | ID_WARP_LEFT_ZONE
  2947. .byte ID_WARP_RIGHT_ZONE << 4 | ID_CALL_SHIP_ZONE
  2948. .byte ID_WARP_LEFT_ZONE << 4 | ID_WARP_RIGHT_ZONE
  2949. .byte ID_WARP_DOWN_ZONE << 4 | ID_WARP_DOWN_ZONE
  2950. .byte ID_RETURN_HOME_ZONE << 4 | ID_LANDING_ZONE
  2951. .byte ID_BLANK_ZONE << 4 | ID_WARP_UP_ZONE
  2952. .byte ID_CALL_ELLIOTT_ZONE << 4 | ID_BLANK_ZONE
  2953. .byte ID_FIND_PHONE_ZONE << 4 | ID_WARP_UP_ZONE
  2954.  
  2955. .byte ID_CALL_SHIP_ZONE << 4 | ID_EAT_CANDY_ZONE
  2956. .byte ID_WARP_DOWN_ZONE << 4 | ID_BLANK_ZONE
  2957. .byte ID_WARP_UP_ZONE << 4 | ID_FIND_PHONE_ZONE
  2958. .byte ID_BLANK_ZONE << 4 | ID_WARP_RIGHT_ZONE
  2959. .byte ID_WARP_UP_ZONE << 4 | ID_CALL_ELLIOTT_ZONE
  2960. .byte ID_WARP_LEFT_ZONE << 4 | ID_WARP_DOWN_ZONE
  2961. .byte ID_WARP_LEFT_ZONE << 4 | ID_RETURN_HOME_ZONE
  2962. .byte ID_LANDING_ZONE << 4 | ID_WARP_RIGHT_ZONE
  2963.  
  2964. .byte ID_WARP_LEFT_ZONE << 4 | ID_WARP_UP_ZONE
  2965. .byte ID_LANDING_ZONE << 4 | ID_WARP_DOWN_ZONE
  2966. .byte ID_RETURN_HOME_ZONE << 4 | ID_WARP_LEFT_ZONE
  2967. .byte ID_WARP_RIGHT_ZONE << 4 | ID_WARP_UP_ZONE
  2968. .byte ID_CALL_ELLIOTT_ZONE << 4 | ID_BLANK_ZONE
  2969. .byte ID_EAT_CANDY_ZONE << 4 | ID_BLANK_ZONE
  2970. .byte ID_WARP_DOWN_ZONE << 4 | ID_WARP_RIGHT_ZONE
  2971. .byte ID_FIND_PHONE_ZONE << 4 | ID_CALL_SHIP_ZONE
  2972.  
  2973. .byte ID_WARP_DOWN_ZONE << 4 | ID_WARP_RIGHT_ZONE
  2974. .byte ID_WARP_LEFT_ZONE << 4 | ID_WARP_DOWN_ZONE
  2975. .byte ID_FIND_PHONE_ZONE << 4 | ID_WARP_UP_ZONE
  2976. .byte ID_CALL_SHIP_ZONE << 4 | ID_EAT_CANDY_ZONE
  2977. .byte ID_WARP_LEFT_ZONE << 4 | ID_WARP_UP_ZONE
  2978. .byte ID_WARP_RIGHT_ZONE << 4 | ID_BLANK_ZONE
  2979. .byte ID_LANDING_ZONE << 4 | ID_RETURN_HOME_ZONE
  2980. .byte ID_CALL_ELLIOTT_ZONE << 4 | ID_BLANK_ZONE
  2981.  
  2982. .byte ID_WARP_RIGHT_ZONE << 4 | ID_WARP_UP_ZONE
  2983. .byte ID_CALL_ELLIOTT_ZONE << 4 | ID_WARP_DOWN_ZONE
  2984. .byte ID_WARP_UP_ZONE << 4 | ID_WARP_RIGHT_ZONE
  2985. .byte ID_FIND_PHONE_ZONE << 4 | ID_WARP_DOWN_ZONE
  2986. .byte ID_BLANK_ZONE << 4 | ID_WARP_LEFT_ZONE
  2987. .byte ID_EAT_CANDY_ZONE << 4 | ID_CALL_SHIP_ZONE
  2988. .byte ID_RETURN_HOME_ZONE << 4 | ID_LANDING_ZONE
  2989. .byte ID_WARP_LEFT_ZONE << 4 | ID_BLANK_ZONE
  2990.  
  2991. .byte ID_WARP_DOWN_ZONE << 4 | ID_WARP_UP_ZONE
  2992. .byte ID_BLANK_ZONE << 4 | ID_WARP_RIGHT_ZONE
  2993. .byte ID_CALL_SHIP_ZONE << 4 | ID_RETURN_HOME_ZONE
  2994. .byte ID_CALL_ELLIOTT_ZONE << 4 | ID_FIND_PHONE_ZONE
  2995. .byte ID_WARP_RIGHT_ZONE << 4 | ID_BLANK_ZONE
  2996. .byte ID_WARP_DOWN_ZONE << 4 | ID_WARP_UP_ZONE
  2997. .byte ID_WARP_LEFT_ZONE << 4 | ID_WARP_LEFT_ZONE
  2998. .byte ID_EAT_CANDY_ZONE << 4 | ID_LANDING_ZONE
  2999.  
  3000. .byte ID_WARP_RIGHT_ZONE << 4 | ID_WARP_DOWN_ZONE
  3001. .byte ID_CALL_ELLIOTT_ZONE << 4 | ID_WARP_UP_ZONE
  3002. .byte ID_WARP_DOWN_ZONE << 4 | ID_WARP_UP_ZONE
  3003. .byte ID_BLANK_ZONE << 4 | ID_WARP_LEFT_ZONE
  3004. .byte ID_EAT_CANDY_ZONE << 4 | ID_LANDING_ZONE
  3005. .byte ID_WARP_RIGHT_ZONE << 4 | ID_CALL_SHIP_ZONE
  3006. .byte ID_WARP_LEFT_ZONE << 4 | ID_FIND_PHONE_ZONE
  3007. .byte ID_BLANK_ZONE << 4 | ID_RETURN_HOME_ZONE
  3008.  
  3009. CheckForHumanOnScreen
  3010. cmp fbiScreenId ; compare with FBI screen id
  3011. beq .doneCheckForHumanOnScreen
  3012. cmp elliottScreenId ; compare with Elliott screen id
  3013. beq .doneCheckForHumanOnScreen
  3014. cmp scientistScreenId ; compare with Scientist screen id
  3015. beq .doneCheckForHumanOnScreen
  3016. clc ; clear carry to show human not on screen
  3017. .doneCheckForHumanOnScreen
  3018. rts
  3019.  
  3020. IncrementETEnergy
  3021. sed
  3022. sty energyIncTensValue
  3023. lda etEnergy+1
  3024. clc
  3025. adc energyIncTensValue
  3026. sta etEnergy+1
  3027. stx energyIncHundredsValue
  3028. lda etEnergy
  3029. adc energyIncHundredsValue
  3030. sta etEnergy
  3031. bcc .doneEnergyIncrement
  3032. lda #MAX_ENERGY
  3033. sta etEnergy
  3034. sta etEnergy+1
  3035. .doneEnergyIncrement
  3036. cld
  3037. rts
  3038.  
  3039. SetCurrentScreenToETHome
  3040. lda #ID_ET_HOME
  3041. sta currentScreenId ; set the current screen id
  3042. sta frameCount
  3043. jsr SetCurrentScreenData
  3044. ldx #ID_ELLIOTT
  3045. stx currentObjectId ; set Elliott on current screen
  3046. jsr SetCurrentObjectData
  3047. lda #60
  3048. sta currentObjectHorizPos ; set Elliott's horizontal position
  3049. sta etHorizPos ; set E.T. horizontal position
  3050. lda #15
  3051. sta currentObjectVertPos ; set Elliott's vertical position
  3052. lda #48
  3053. sta etVertPos ; set E.T. vertical position
  3054. lda #$00
  3055. sta collectedCandyScoring ; clear collected candy scoring flags
  3056. sta etHomeElliottMovement ; clear Elliott movement flags
  3057. rts
  3058.  
  3059. DecrementETEnergy
  3060. sty energyDecTensValue
  3061. sed
  3062. lda etEnergy+1
  3063. sec
  3064. sbc energyDecTensValue
  3065. sta etEnergy+1
  3066. stx energyDecHundredsValue
  3067. lda etEnergy
  3068. sbc energyDecHundredsValue
  3069. sta etEnergy
  3070. bcs .doneEnergyDecrement
  3071. lda #$00
  3072. sta etEnergy
  3073. sta etEnergy+1
  3074. rol playerState ; rotate E.T. death flag to carry
  3075. sec ; set carry
  3076. ror playerState ; rotate right to set E.T. death flag
  3077. .doneEnergyDecrement
  3078. cld
  3079. rts
  3080.  
  3081. IF COMPILE_VERSION = NTSC
  3082.  
  3083. .org BANK0TOP + 4096 - 6, 0
  3084.  
  3085. ELSE
  3086.  
  3087. .org BANK0TOP + 4096 - 8, 0
  3088. .byte 0, -1
  3089.  
  3090. ENDIF
  3091.  
  3092. .word Start
  3093. .word Start
  3094. .word Start
  3095.  
  3096. ;============================================================================
  3097. ; R O M - C O D E (BANK 1)
  3098. ;============================================================================
  3099.  
  3100. SEG Bank1
  3101. .org BANK1TOP
  3102. .rorg BANK1_REORG
  3103.  
  3104. BANK1Start
  3105. lda BANK0STROBE
  3106. jmp Start
  3107.  
  3108. .checkForEndGameKernel
  3109. cpx #64 ; 2
  3110. bcc .skipObjectDraw ; 2≥
  3111. jmp ScoreKernel ; 3
  3112.  
  3113. .skipObjectDraw
  3114. lda #0 ; 2
  3115. sta GRP0 ; 3 = @13
  3116. sta nextObjectGraphicData ; 3
  3117. lda frameCount ; 3 get the current frame count
  3118. lsr ; 2
  3119. and #$1F ; 2
  3120. ora #$40 ; 2
  3121. sta COLUP0 ; 3
  3122. lda temp ; 3 waste 3 cycles
  3123. nop ; 2
  3124. jmp .checkToDrawET ; 3
  3125.  
  3126. GameKernel
  3127. cpx candyVertPos ; 3
  3128. php ; 3 = @41 enable/disable BALL
  3129. cpx phonePieceMapVertPos ; 3
  3130. php ; 3 = @47 enable/disable M1
  3131. cpx etHeartVertPos ; 3
  3132. php ; 3 = @53 enable/disable M0
  3133. inx ; 2 increment scan line count
  3134. ldy nextETGraphicData ; 3
  3135. JumpIntoGameKernel
  3136. txa ; 2 move scan line count to accumulator
  3137. sec ; 2
  3138. sbc currentObjectVertPos ; 3 subtract object vertical position
  3139. cmp currentSpriteHeight ; 3 compare with sprite height
  3140. sty GRP1 ; 3 draw ET graphic data
  3141. sta WSYNC
  3142. ;--------------------------------------
  3143. bcs .checkForEndGameKernel ; 2≥ skip object draw if greater
  3144. tay ; 2
  3145. lda (objectGraphicPtrs_0),y; 5
  3146. sta GRP0 ; 3 = @12
  3147. lda (objectColorPtrs_0),y ; 5
  3148. sta COLUP0 ; 3 = @20
  3149. lda (objectGraphicPtrs_1),y; 5
  3150. sta nextObjectGraphicData ; 3
  3151. lda (objectColorPtrs_1),y ; 5
  3152. sta nextObjectColorData ; 3
  3153. .checkToDrawET
  3154. txa ; 2
  3155. ldx #<ENABL ; 2
  3156. txs ; 2 point stack to ENABL
  3157. tax ; 2
  3158. sec ; 2
  3159. sbc etVertPos ; 3
  3160. cmp etHeight ; 3
  3161. bcs .skipETDraw ; 2≥
  3162. tay ; 2
  3163. lda (etGraphicPointers1),y ; 5
  3164. sta nextETGraphicData ; 3
  3165. lda (etGraphicPointers0),y ; 5
  3166. sta GRP1 ; 3
  3167. .drawNextObjectData
  3168. sta WSYNC
  3169. ;--------------------------------------
  3170. lda nextObjectGraphicData ; 3
  3171. sta GRP0 ; 3 = @06
  3172. lda nextObjectColorData ; 3
  3173. sta COLUP0 ; 3 = @12
  3174. txa ; 2
  3175. tay ; 2
  3176. lda (pf1GraphicPtrs),y ; 5
  3177. sta PF1 ; 3 = @24
  3178. lda (pf2GraphicPtrs),y ; 5
  3179. sta PF2 ; 3 = @32
  3180. jmp GameKernel ; 3
  3181.  
  3182. .skipETDraw
  3183. lda #0 ; 2
  3184. sta GRP1 ; 3 = @60
  3185. sta nextETGraphicData ; 3
  3186. beq .drawNextObjectData ; 3 unconditional branch
  3187.  
  3188. TitleScreenKernel
  3189. .waitLoop
  3190. sta WSYNC
  3191. ;--------------------------------------
  3192. inx ; 2
  3193. cpx #16 ; 2
  3194. bcc .waitLoop ; 2≥
  3195. lda #LT_RED+4 ; 2
  3196. sta COLUP0 ; 3 = @11
  3197. sta COLUP1 ; 3 = @14
  3198. lda #MSBL_SIZE2 | QUAD_SIZE; 2
  3199. sta NUSIZ0 ; 3 = @19
  3200. sta NUSIZ1 ; 3 = @22
  3201. lda #NO_REFLECT ; 2
  3202. sta REFP0 ; 3 = @27
  3203. sta REFP1 ; 3 = @30
  3204. ldx #15 ; 2
  3205. sta WSYNC
  3206. ;--------------------------------------
  3207. .drawETTitle
  3208. lda ETTitle_E,x ; 4
  3209. sta GRP0 ; 3 = @07
  3210. lda ETTitle_T,x ; 4
  3211. sta GRP1 ; 3 = @14
  3212. cpx #2 ; 2
  3213. bcs .nextETTileScanline ; 2≥
  3214. lda #$0F ; 2 enable missiles for dots in E.T.
  3215. sta ENAM0 ; 3 = @23
  3216. sta ENAM1 ; 3 = @26
  3217. .nextETTileScanline
  3218. sta WSYNC
  3219. ;--------------------------------------
  3220. dex ; 2
  3221. sta WSYNC
  3222. ;--------------------------------------
  3223. bpl .drawETTitle ; 2≥
  3224. lda #0 ; 2
  3225. sta GRP0 ; 3 = @07
  3226. sta GRP1 ; 3 = @10
  3227. sta ENAM0 ; 3 = @13
  3228. sta ENAM1 ; 3 = @16
  3229. ldx #47 ; 2
  3230. .upperTitleWaitLoop
  3231. sta WSYNC
  3232. ;--------------------------------------
  3233. inx ; 2
  3234. cpx #64 ; 2
  3235. bcc .upperTitleWaitLoop ; 2≥
  3236. sta WSYNC
  3237. ;--------------------------------------
  3238. sta HMOVE ; 3
  3239. lda #THREE_COPIES ; 2
  3240. ldy #NO_REFLECT ; 2
  3241. sty REFP1 ; 3 = @10
  3242. sta NUSIZ0 ; 3 = @13
  3243. sta NUSIZ1 ; 3 = @16
  3244. sta VDELP0 ; 3 = @19 vertically delay players
  3245. sta VDELP1 ; 3 = @22
  3246. sty GRP0 ; 3 = @25 clear plaer graphics
  3247. sty GRP1 ; 3 = @28
  3248. sty GRP0 ; 3 = @31
  3249. sty GRP1 ; 3 = @34
  3250. nop ; 2
  3251. sta RESP0 ; 3 = @39 coarse position player 0 to pixel 117
  3252. sta RESP1 ; 3 = @42 coarse position player 1 to pixel 126
  3253. sty HMP1 ; 3 = @45
  3254. lda #HMOVE_R1 ; 2
  3255. sta HMP0 ; 3 = @50 position player 0 to pixel 118
  3256. sty REFP0 ; 3 = @53
  3257. sta WSYNC
  3258. ;--------------------------------------
  3259. sta HMOVE ; 3
  3260. lda #>TitleETGraphics ; 2
  3261. sta graphicPointers+1 ; 3
  3262. sta graphicPointers+3 ; 3
  3263. sta graphicPointers+5 ; 3
  3264. sta graphicPointers+7 ; 3
  3265. sta graphicPointers+9 ; 3
  3266. sta graphicPointers+11 ; 3
  3267. lda #<TitleETGraphics_1 ; 2
  3268. sta graphicPointers ; 3
  3269. lda #<TitleETGraphics_2 ; 2
  3270. sta graphicPointers+2 ; 3
  3271. lda #<TitleETGraphics_3 ; 2
  3272. sta graphicPointers+4 ; 3
  3273. lda #<TitleETGraphics_4 ; 2
  3274. sta graphicPointers+6 ; 3
  3275. lda #<TitleETGraphics_5 ; 2
  3276. sta graphicPointers+8 ; 3
  3277. lda #<TitleETGraphics_0 ; 2
  3278. sta graphicPointers+10 ; 3
  3279. sta WSYNC
  3280. ;--------------------------------------
  3281. lda #LT_BROWN+10 ; 2
  3282. sta COLUP0 ; 3 = @05
  3283. sta COLUP1 ; 3 = @08
  3284. lda #H_ET_GRAPH-1 ; 2
  3285. sta loopCount ; 3
  3286. jsr SixDigitKernel ; 6
  3287. ldx #110 ; 2 = @08
  3288. .lowerTitleWaitLoop
  3289. sta WSYNC
  3290. ;--------------------------------------
  3291. inx ; 2
  3292. cpx #128 ; 2
  3293. bcc .lowerTitleWaitLoop ; 2≥
  3294. ScoreKernel
  3295. sta WSYNC
  3296. ;--------------------------------------
  3297. ldx #$FF ; 2
  3298. txs ; 2 reset stack to beginning
  3299. stx PF1 ; 3 = @07
  3300. stx PF2 ; 3 = @10
  3301. inx ; 2 x = 0
  3302. stx GRP0 ; 3 = @15 clear player graphic data
  3303. stx GRP1 ; 3 = @18
  3304. stx ENAM0 ; 3 = @21 disable missile graphics
  3305. stx ENAM1 ; 3 = @24
  3306. stx ENABL ; 3 = @27 disable BALL
  3307. sta WSYNC
  3308. ;--------------------------------------
  3309. lda frameCount ; 3 get the current frame count
  3310. and #7 ; 2
  3311. bne .skipFlowerAnimation ; 2≥
  3312. lda flowerState ; 3 get flower state
  3313. bpl .skipFlowerAnimation ; 2≥ branch if flower not revived
  3314. and #<(~FLOWER_REVIVED) ; 2
  3315. cmp #FLOWER_REVIVE_ANIMATION; 2
  3316. bcs .skipFlowerAnimation ; 2≥
  3317. adc #FLOWER_REVIVED | (1 * 16); 2 increment flower animation frame
  3318. sta flowerState ; 3
  3319. lda #PLAY_SOUND_CHANNEL0 | $03; 2
  3320. sta soundDataChannel0 ; 3
  3321. .skipFlowerAnimation
  3322. sta WSYNC
  3323. ;--------------------------------------
  3324. lda #GREEN ; 2
  3325. sta COLUP0 ; 3 = @05
  3326. sta COLUP1 ; 3 = @08
  3327. ldx #HMOVE_0 ; 2
  3328. stx HMP0 ; 3 = @13
  3329. sta WSYNC
  3330. ;--------------------------------------
  3331. stx PF0 ; 3 = @03 remove border from around screen
  3332. stx COLUBK ; 3 = @06 set background color to BLACK
  3333. stx PF1 ; 3 = @09
  3334. stx PF2 ; 3 = @12
  3335. sta WSYNC
  3336. ;--------------------------------------
  3337. sta HMOVE ; 3
  3338. lda #THREE_COPIES ; 2
  3339. ldy #NO_REFLECT ; 2
  3340. sty REFP1 ; 3 = @10
  3341. sta NUSIZ0 ; 3 = @13
  3342. sta NUSIZ1 ; 3 = @16
  3343. sta VDELP0 ; 3 = @19
  3344. sta VDELP1 ; 3 = @22
  3345. sty GRP0 ; 3 = @25
  3346. sty GRP1 ; 3 = @28
  3347. sty GRP0 ; 3 = @31
  3348. sty GRP1 ; 3 = @34
  3349. nop ; 2
  3350. sta RESP0 ; 3 = @39 coarse position GRP0 to pixel 117
  3351. sta RESP1 ; 3 = @42 coarse position GRP1 to pixel 126
  3352. sty HMP1 ; 3 = @45
  3353. lda #HMOVE_R1 ; 2
  3354. sta HMP0 ; 3 = @50 GRP0 now set to pixel 127
  3355. sty REFP0 ; 3 = @53
  3356. sta WSYNC
  3357. ;--------------------------------------
  3358. sta HMOVE ; 3
  3359. lda heldCandyPieces ; 3 get number of candy pieces held by E.T.
  3360. sta tempNumberFonts ; 3
  3361. lda etEnergy ; 3
  3362. sta tempNumberFonts+1 ; 3
  3363. lda etEnergy+1 ; 3
  3364. sta tempNumberFonts+2 ; 3
  3365. lda currentScreenId ; 3 get the current screen id
  3366. cmp #ID_TITLE_SCREEN ; 2
  3367. bne .setToShowScoreOrEnergy; 2≥
  3368. bit gameState ; 3 check the game state
  3369. bmi .setToShowScoreOrEnergy; 2≥ branch if player loss the game
  3370. lda #>Copyright_0 ; 2 set to show copyright information
  3371. bne .setGraphicPointersMSB ; 3 unconditional branch
  3372.  
  3373. .setToShowScoreOrEnergy
  3374. lda #>NumberFonts ; 2
  3375. .setGraphicPointersMSB
  3376. sta graphicPointers+1 ; 3
  3377. sta graphicPointers+3 ; 3
  3378. sta graphicPointers+5 ; 3
  3379. sta graphicPointers+7 ; 3
  3380. sta graphicPointers+9 ; 3
  3381. sta graphicPointers+11 ; 3
  3382. sta WSYNC
  3383. ;--------------------------------------
  3384. lda currentScreenId ; 3 get the current screen id
  3385. cmp #ID_ET_HOME ; 2
  3386. bcc .setGraphicPointers ; 2≥ branch if not showing the score
  3387. lda playerScore ; 3
  3388. sta tempNumberFonts ; 3
  3389. lda playerScore+1 ; 3
  3390. sta tempNumberFonts+1 ; 3
  3391. lda playerScore+2 ; 3
  3392. sta tempNumberFonts+2 ; 3
  3393. .setGraphicPointers
  3394. sta WSYNC
  3395. ;--------------------------------------
  3396. lda #LT_BLUE+10 ; 2
  3397. sta COLUBK ; 3 = @05
  3398. lda tempNumberFonts ; 3
  3399. and #$F0 ; 2
  3400. bne .setGraphicsPointerLSB ; 2≥
  3401. lda #<Blank * 2 ; 2
  3402. .setGraphicsPointerLSB
  3403. lsr ; 2
  3404. sta graphicPointers ; 3
  3405. lda tempNumberFonts ; 3
  3406. and #$0F ; 2
  3407. asl ; 2
  3408. asl ; 2
  3409. asl ; 2
  3410. sta graphicPointers+2 ; 3
  3411. sta WSYNC
  3412. ;--------------------------------------
  3413. lda tempNumberFonts+1 ; 3
  3414. and #$F0 ; 2
  3415. lsr ; 2
  3416. sta graphicPointers+4 ; 3
  3417. lda tempNumberFonts+1 ; 3
  3418. and #$0F ; 2
  3419. asl ; 2
  3420. asl ; 2
  3421. asl ; 2
  3422. sta graphicPointers+6 ; 3
  3423. sta WSYNC
  3424. ;--------------------------------------
  3425. lda #SHOW_HSW_INITIALS_VALUE; 2
  3426. cmp programmerInitialFlag ; 3
  3427. bne .skipShowHSWInitials ; 2≥
  3428. lda #[(<HSWInitials / 8) << 4] | [(<HSWInitials + 8) / 8]; 2
  3429. sta tempNumberFonts+2 ; 3
  3430. .skipShowHSWInitials
  3431. lda tempNumberFonts+2 ; 3
  3432. and #$F0 ; 2
  3433. lsr ; 2
  3434. sta graphicPointers+8 ; 3
  3435. lda tempNumberFonts+2 ; 3
  3436. and #$0F ; 2
  3437. asl ; 2
  3438. asl ; 2
  3439. asl ; 2
  3440. sta graphicPointers+10 ; 3
  3441. sta WSYNC
  3442. ;--------------------------------------
  3443. ldy #<Blank ; 2
  3444. ldx currentScreenId ; 3 get the current screen id
  3445. cpx #ID_ET_HOME ; 2
  3446. bcc .suppressZeroDigits ; 2≥ branch if not ET_HOME or TITLE_SCREEN
  3447. cpy graphicPointers ; 3
  3448. bne .checkToSetCopyrightInfo; 2≥
  3449. lda graphicPointers+2 ; 3
  3450. bne .checkToSetCopyrightInfo; 2≥
  3451. sty graphicPointers+2 ; 3
  3452. .suppressZeroDigits
  3453. lda graphicPointers+4 ; 3
  3454. bne .checkToSetCopyrightInfo; 2≥
  3455. sty graphicPointers+4 ; 3
  3456. lda graphicPointers+6 ; 3
  3457. bne .checkToSetCopyrightInfo; 2≥
  3458. sty graphicPointers+6 ; 3
  3459. lda graphicPointers+8 ; 3
  3460. bne .checkToSetCopyrightInfo; 2≥
  3461. sty graphicPointers+8 ; 3
  3462. .checkToSetCopyrightInfo
  3463. sta WSYNC
  3464. ;--------------------------------------
  3465. lda #>Copyright_0 ; 2
  3466. cmp graphicPointers+1 ; 3
  3467. bne .skipSetCopyrightInfo ; 2≥
  3468. lda #<BlankIcon ; 2
  3469. sta graphicPointers ; 3
  3470. lda #<Copyright_0 ; 2
  3471. sta graphicPointers+2 ; 3
  3472. lda #<Copyright_1 ; 2
  3473. sta graphicPointers+4 ; 3
  3474. lda #<Copyright_2 ; 2
  3475. sta graphicPointers+6 ; 3
  3476. lda #<Copyright_3 ; 2
  3477. sta graphicPointers+8 ; 3
  3478. lda #<Copyright_4 ; 2
  3479. sta graphicPointers+10 ; 3
  3480. .skipSetCopyrightInfo
  3481. lda #H_FONT - 1 ; 2
  3482. sta loopCount ; 3
  3483. jsr SixDigitKernel ; 6
  3484. sta WSYNC
  3485. ;--------------------------------------
  3486. lda #SELECT_MASK ; 2
  3487. and SWCHB ; 4 check console switch value
  3488. bne Overscan ; 2≥ branch if SELECT not pressed
  3489. lda #SET_STARTING_SCREEN | ID_TITLE_SCREEN
  3490. sta startingScreenId
  3491. sta gameState
  3492. lda #$00
  3493. sta mothershipStatus ; clear Mothership status flags
  3494. Overscan
  3495. sta WSYNC
  3496. sta WSYNC
  3497. sta WSYNC
  3498. sta WSYNC
  3499. sta WSYNC
  3500. ldx #$0F
  3501. stx VBLANK ; disable TIA (D1 = 1)
  3502.  
  3503. IF COMPILE_VERSION = NTSC
  3504.  
  3505. jsr Waste12Cycles
  3506. jsr Waste12Cycles
  3507.  
  3508. ELSE
  3509.  
  3510. nop ; waste 12 cycles
  3511. nop
  3512. nop
  3513. nop
  3514. nop
  3515. nop
  3516.  
  3517. ENDIF
  3518.  
  3519. ldx #OVERSCAN_TIME
  3520. stx TIM64T ; set timer for overscan period
  3521. ror SWCHB ; shift RESET into carry
  3522. bcs .clearResetHeldFlag ; branch if RESET not pressed
  3523. lda #RESET_SWITCH_HELD
  3524. bit fireResetStatus ; check RESET held status
  3525. bvs .skipResetStatus ; branch if RESET held
  3526. ora fireResetStatus ; set flag to show RESET held this frame
  3527. sta fireResetStatus
  3528. jmp StartNewGame
  3529.  
  3530. .clearResetHeldFlag
  3531. lda fireResetStatus
  3532. and #<(~RESET_SWITCH_HELD)
  3533. sta fireResetStatus
  3534. .skipResetStatus
  3535. jsr CheckForYarIndyOrHSWEasterEgg
  3536. jsr CheckToFlyYarSprite
  3537. jsr DetermineToShowArtistInitials
  3538. lda soundDataChannel0 ; get sound data for channel 0
  3539. bmi CheckToPlaySoundForChannel0 ; branch if playing sound for channel 0
  3540. ldx currentObjectId ; get the current object id
  3541. bmi .turnOffSoundChannel0 ; branch if not human or human not present
  3542. lda currentScreenId ; get the current screen id
  3543. cmp #ID_ET_HOME
  3544. beq CheckToPlaySoundForChannel0 ; branch if E.T. is home
  3545. lda frameCount ; get the current frame count
  3546. and #$0F
  3547. beq PlayHumanWalkingSound
  3548. .turnOffSoundChannel0
  3549. lda #PLAY_SOUND_CHANNEL0 | $00
  3550. jmp .setChannel0SoundRegisters
  3551.  
  3552. PlayHumanWalkingSound
  3553. lda #19
  3554. sta AUDC0
  3555. bit frameCount
  3556. bne .setHumanWalkingFrequency
  3557. lda #22
  3558. .setHumanWalkingFrequency
  3559. sta AUDF0
  3560. lda etHorizPos ; get E.T.'s horizontal position
  3561. sbc currentObjectHorizPos ; subtract human's horizontal position
  3562. bpl .setHorizDistanceRange
  3563. eor #$FF ; get absolute value of horiz distance
  3564. .setHorizDistanceRange
  3565. sta humanETHorizDistRange
  3566. lda etVertPos ; get E.T.'s vertical position
  3567. sbc currentObjectVertPos ; subtract human's vertical position
  3568. asl ; multiply value by 2
  3569. bpl .compareVertAndHorizDistance
  3570. eor #$FF ; get absolute value of vert distance
  3571. .compareVertAndHorizDistance
  3572. cmp humanETHorizDistRange
  3573. bcs .divideDistanceRangeBy2
  3574. lsr
  3575. bpl .addWithHorizDistance ; unconditional branch
  3576.  
  3577. .divideDistanceRangeBy2
  3578. lsr humanETHorizDistRange
  3579. .addWithHorizDistance
  3580. clc
  3581. adc humanETHorizDistRange
  3582. bpl .determineHumanSoundVolume
  3583. lda #0
  3584. beq .setHumanWalkingVolume ; unconditional branch
  3585.  
  3586. .determineHumanSoundVolume
  3587. lsr
  3588. lsr
  3589. lsr
  3590. eor #$0F
  3591. .setHumanWalkingVolume
  3592. sta AUDV0
  3593. CheckToPlaySoundForChannel0
  3594. lda soundDataChannel0 ; get sound data for channel 0
  3595. bpl .setToDontSetChannel0Data ; branch if not player sound for channel 0
  3596. .setChannel0SoundRegisters
  3597. sta AUDC0 ; set sound channel 0 value
  3598. sta AUDV0 ; set sound channel 0 volume
  3599. sta AUDF0 ; set sound channel 0 frequency
  3600. asl ; shift value left
  3601. beq .setToDontSetChannel0Data ; branch if channel set to off this frame
  3602. lda #PLAY_SOUND_CHANNEL0 | $00 ; turn off channel 0 sound next frame
  3603. sta soundDataChannel0
  3604. bne .doneCheckToPlaySoundChannel0; unconditional branch
  3605.  
  3606. .setToDontSetChannel0Data
  3607. lsr soundDataChannel0 ; shift value right (i.e. D7 = 0)
  3608. .doneCheckToPlaySoundChannel0
  3609. bit mothershipStatus ; check the Mothership status
  3610. bmi .jmpToBANK0 ; branch if Mothership is present
  3611. lda currentScreenId ; get the current screen id
  3612. cmp #ID_ET_HOME
  3613. beq DoETHomeProcessing ; branch if ET HOME screen
  3614. cmp #ID_TITLE_SCREEN
  3615. bne .jmpCheckForElliottToReviveET; branch if not on TITLE SCREEN
  3616. bit INPT4 ; check player one fire button
  3617. bmi .jmpToBANK0 ; branch if fire button not pressed
  3618. jmp StartNewGame
  3619.  
  3620. .jmpToBANK0
  3621. jmp JumpToBank0
  3622.  
  3623. .jmpCheckForElliottToReviveET
  3624. jmp CheckForElliottToReviveET
  3625.  
  3626. HeldCandyScoreLSB
  3627. .byte $00,$90,$80,$70,$60,$50,$40,$30,$20,$10
  3628.  
  3629. HeldCandyScoreMSB
  3630. .byte $00,$04,$09,$14,$19,$24,$29,$34,$39,$44
  3631.  
  3632. DoETHomeProcessing
  3633. lda #3
  3634. and frameCount
  3635. bne .skipChangeElliottDirection
  3636. bit etHomeElliottMovement ; check Elliott move values
  3637. bpl .moveElliottLeft
  3638. inc currentObjectHorizPos ; move Elliott right
  3639. bne .checkToChangeElliottDirection; unconditional branch
  3640.  
  3641. .moveElliottLeft
  3642. dec currentObjectHorizPos ; move Elliott left
  3643. .checkToChangeElliottDirection
  3644. lda currentObjectHorizPos ; get Elliott's horizontal position
  3645. sec
  3646. sbc #28
  3647. cmp #64
  3648. bcc .skipChangeElliottDirection
  3649. lda #MOVE_ELLIOTT_RIGHT
  3650. eor etHomeElliottMovement ; flip the flag to determine if Elliott
  3651. sta etHomeElliottMovement ; moves left or right on ET_HOME screen
  3652. .skipChangeElliottDirection
  3653. bit collectedCandyScoring ; check the collected candy scoring values
  3654. bvs IncrementScoreForCollectedCandy; branch if scoring for collected candy
  3655. lda frameCount ; get the current frame count
  3656. cmp #96
  3657. bne .checkToIncreaseScoreForHeldCandy
  3658. ldy etEnergy+1
  3659. ldx etEnergy
  3660. jmp .incrementScore
  3661.  
  3662. .checkToIncreaseScoreForHeldCandy
  3663. cmp #192
  3664. beq IncrementScoreForHeldCandy
  3665. cmp #255
  3666. bne .jmpToBranchToBANK0
  3667. lda #COLLECT_CANDY_SCORE_INC
  3668. ora collectedCandyScoring ; set flag so we increment score for
  3669. sta collectedCandyScoring ; collected candy pieces
  3670. bne .jmpToBranchToBANK0 ; unconditional branch
  3671.  
  3672. IncrementScoreForHeldCandy
  3673. lda heldCandyPieces ; get number of candy pieces held by E.T.
  3674. lsr ; move upper nybbles to lower nybbles
  3675. lsr
  3676. lsr
  3677. lsr
  3678. tay
  3679. ldx HeldCandyScoreMSB,y
  3680. lda HeldCandyScoreLSB,y
  3681. tay
  3682. .incrementScore
  3683. jsr IncrementScore
  3684. lda #PLAY_SOUND_CHANNEL0 | $0C
  3685. sta soundDataChannel0
  3686. bne .jmpToBranchToBANK0 ; unconditional branch
  3687.  
  3688. IncrementScoreForCollectedCandy
  3689. ldy collectedCandyPieces ; get number of candy held by Elliott
  3690. beq CheckIfPlayerWonGameRound ; branch if Elliott has no candy
  3691. lda frameCount ; get the current frame count
  3692. and #$1F
  3693. bne .openCandyEatingAnimation
  3694. dey ; reduce number of candy held by Elliott
  3695. sty collectedCandyPieces
  3696. lda #PLAY_SOUND_CHANNEL0 | $0F
  3697. sta soundDataChannel0
  3698. lda #6
  3699. sta unknown ; this not used in the game
  3700. lda #CLOSED_EATING_CANDY_ICON ; set collected candy scoring flag to
  3701. ora collectedCandyScoring ; show closed eating candy animation
  3702. sta collectedCandyScoring
  3703. ldx #$07
  3704. ldy #$70
  3705. jsr IncrementScore ; increment score by 770 points
  3706. .jmpToBranchToBANK0
  3707. jmp .branchToBANK0
  3708.  
  3709. .openCandyEatingAnimation
  3710. cmp #$0F
  3711. bne .jmpToBranchToBANK0
  3712. lda #PLAY_SOUND_CHANNEL0 | $08
  3713. sta soundDataChannel0
  3714. lda collectedCandyScoring
  3715. and #<(~CLOSED_EATING_CANDY_ICON); set collected candy scoring flag to
  3716. sta collectedCandyScoring ; show open eating candy animation
  3717. jmp .branchToBANK0
  3718.  
  3719. CheckIfPlayerWonGameRound
  3720. bit gameState ; check the game state
  3721. bpl .checkToStartNextRound ; branch if player won this round
  3722. lda #SET_STARTING_SCREEN | ID_TITLE_SCREEN
  3723. sta startingScreenId ; set screen id to TITLE_SCREEN
  3724. jmp JumpToBank0
  3725.  
  3726. .checkToStartNextRound
  3727. bit INPT4 ; check player one fire button
  3728. bmi .jmpToBranchToBANK0 ; branch if fire button not pressed
  3729. bpl .startNextGameRound ; unconditional branch
  3730.  
  3731. StartNewGame
  3732. lda #16
  3733. sta extraCandyPieces
  3734. sta gameState
  3735. lda #INIT_NUM_TRIES - 1
  3736. sta numberOfTries
  3737. lda #0
  3738. sta playerState ; reset player state
  3739. sta collectedCandyPieces ; initialize number of collected candy
  3740. sta mothershipStatus ; clear Mothership status flags
  3741. sta etPitStatus ; clear E.T. pit status flags
  3742. sta etNeckExtensionValues ; clear neck extension values
  3743. sta etMotionValues ; clear E.T. motion value
  3744. sta easterEggStatus ; clear Easter Egg status flags
  3745. sta playerScore
  3746. sta playerScore+1
  3747. lda #$03
  3748. sta playerScore+2 ; set initial score to 3
  3749. .startNextGameRound
  3750. rol fireResetStatus ; rotate fire button held status to carry
  3751. sec ; set carry and rotate value right to set
  3752. ror fireResetStatus ; fire button held status (i.e. D7 = 1)
  3753. rol easterEggStatus ; rotate status left
  3754. clc ; clear carry and rotate status right to
  3755. ror easterEggStatus ; clear Easter Egg check done flag
  3756. lda #SET_STARTING_SCREEN | ID_FOREST
  3757. sta startingScreenId
  3758. sta mothershipStatus
  3759. lda #<-1
  3760. sta fbiAttributes
  3761. sta elliottAttributes
  3762. sta scientistAttributes
  3763. sta fbiAttributes
  3764. sta elliottAttributes
  3765. sta scientistAttributes
  3766. sta shipLandingTimer
  3767. lda #$0A
  3768. sta heldCandyPieces
  3769. lda frameCount ; get the current frame count
  3770. eor secondTimer
  3771. and #7
  3772. cmp #ID_PIT
  3773. bcc .setCallHomeScreenId ; branch if value less than ID_PIT
  3774. sbc #ID_FOREST ; subtract value to get it below ID_PIT
  3775. .setCallHomeScreenId
  3776. sta callHomeScreenId
  3777. lda secondTimer
  3778. and #3
  3779. tax
  3780. lda frameCount ; get the current frame count
  3781. and #FLOWER_PIT_NUMBER
  3782. sta flowerState ; set flower pit number
  3783. adc PsuedoRandomValueIncTable,x
  3784. and #PHONE_PIECE_PIT_NUMBER
  3785. sta s_phonePieceAttribute ; set S phone piece location
  3786. adc PsuedoRandomValueIncTable,x
  3787. and #PHONE_PIECE_PIT_NUMBER
  3788. sta h_phonePieceAttribute ; set H phone piece location
  3789. adc PsuedoRandomValueIncTable,x
  3790. and #PHONE_PIECE_PIT_NUMBER
  3791. sta w_phonePieceAttribute ; set W phone piece location
  3792. lda frameCount ; get the current frame count
  3793. and #3
  3794. tax
  3795. lda secondTimer
  3796. sta powerZoneLSBValue_01
  3797. adc PsuedoRandomValueIncTable,x
  3798. sta powerZoneLSBValue_02
  3799. adc PsuedoRandomValueIncTable,x
  3800. sta powerZoneLSBValue_03
  3801. lda extraCandyPieces ; get number of extra candy pieces
  3802. cmp #31
  3803. bcc .setStartingEnergyToMax
  3804. sbc #31
  3805. lsr ; divide value by 2
  3806. tax
  3807. lda NextRoundEnergyValues,x
  3808. sta etEnergy
  3809. sta etEnergy+1
  3810. lda NextRoundScoreMSB,x
  3811. tax
  3812. ldy #$00
  3813. jsr IncrementScore
  3814. lda #31
  3815. sta extraCandyPieces
  3816. bne CheckForElliottToReviveET ; unconditional branch
  3817.  
  3818. .setStartingEnergyToMax
  3819. lda #MAX_ENERGY
  3820. sta etEnergy
  3821. sta etEnergy+1
  3822. bne CheckForElliottToReviveET ; unconditional branch
  3823.  
  3824. .branchToBANK0
  3825. jmp JumpToBank0
  3826.  
  3827. CheckForElliottToReviveET
  3828. bit playerState ; check player state
  3829. bpl JumpToBank0 ; branch if E.T. is not dead
  3830. bvs JumpToBank0 ; branch if Elliott coming to revive E.T.
  3831. lda #RETURN_HOME
  3832. sta fbiAttributes ; set human objects to return home
  3833. sta elliottAttributes
  3834. sta scientistAttributes
  3835. lda #$00
  3836. sta etNeckExtensionValues ; clear neck extension values
  3837. lda currentScreenId ; get the current screen id
  3838. cmp #ID_PIT
  3839. bne .setToSendElliottForET ; branch if E.T. not in a pit
  3840. lda etPitStatus ; get E.T. pit status values
  3841. and #IN_PIT_BOTTOM
  3842. bne .setToSendElliottForET ; branch if E.T. reached bottom of pit
  3843. lda #FALLING_IN_PIT
  3844. sta etPitStatus ; set status to show E.T. falling in a pit
  3845. ldx #<-1
  3846. stx currentObjectId
  3847. inx ; x = 0
  3848. stx currentSpriteHeight
  3849. .setToSendElliottForET
  3850. lda #ELLIOTT_REVIVE_ET
  3851. ora playerState
  3852. sta playerState
  3853. JumpToBank0
  3854. lda #<SetScreenIdFromStartingScreen
  3855. sta bankSwitchRoutinePtr
  3856. lda #>SetScreenIdFromStartingScreen
  3857. sta bankSwitchRoutinePtr+1
  3858. lda #LDA_ABS
  3859. sta displayKernelBankSwitch
  3860. lda #<BANK0STROBE
  3861. sta bankSwitchStrobe
  3862. lda #>BANK0STROBE
  3863. sta bankSwitchStrobe+1
  3864. lda #JMP_ABS
  3865. sta bankSwitchABSJmp
  3866. jmp.w displayKernelBankSwitch
  3867.  
  3868. IncrementScore
  3869. sed
  3870. sty pointsTensValue
  3871. clc
  3872. lda playerScore+2
  3873. adc pointsTensValue
  3874. sta playerScore+2
  3875. stx pointsHundredsValue
  3876. lda playerScore+1
  3877. adc pointsHundredsValue
  3878. sta playerScore+1
  3879. lda playerScore
  3880. adc #$00
  3881. sta playerScore
  3882. cld
  3883. Waste12Cycles
  3884. rts
  3885.  
  3886. SixDigitKernel
  3887. .sixDigitLoop
  3888. ldy loopCount ; 3
  3889. lda (graphicPointers),y ; 5
  3890. sta GRP0 ; 3
  3891. sta WSYNC
  3892. ;--------------------------------------
  3893. lda (graphicPointers+2),y ; 5
  3894. sta GRP1 ; 3 = @08
  3895. lda (graphicPointers+4),y ; 5
  3896. sta GRP0 ; 3 = @16
  3897. lda (graphicPointers+6),y ; 5
  3898. sta tempCharHolder ; 3
  3899. lda (graphicPointers+8),y ; 5
  3900. tax ; 2
  3901. lda (graphicPointers+10),y ; 5
  3902. tay ; 2
  3903. lda tempCharHolder ; 3
  3904. sta GRP1 ; 3 = @34
  3905. stx GRP0 ; 3 = @37
  3906. sty GRP1 ; 3 = @40
  3907. sty GRP0 ; 3 = @43
  3908. dec loopCount ; 5
  3909. bpl .sixDigitLoop ; 2≥
  3910. lda #0 ; 2
  3911. sta WSYNC
  3912. ;--------------------------------------
  3913. sta GRP0 ; 3 = @03
  3914. sta GRP1 ; 3 = @06
  3915. sta GRP0 ; 3 = @09
  3916. sta GRP1 ; 3 = @12
  3917. sta NUSIZ0 ; 3 = @15 set to show ONE_COPY of players
  3918. sta NUSIZ1 ; 3 = @18
  3919. sta VDELP0 ; 3 = @21 turn off vertical delay
  3920. sta VDELP1 ; 3 = @24
  3921. sta WSYNC
  3922. ;--------------------------------------
  3923. rts ; 6
  3924.  
  3925. DisplayKernel
  3926. StatusKernel
  3927. lda #THREE_MED_COPIES ; 2
  3928. sta NUSIZ1 ; 3
  3929. lda #DK_PINK + 2 ; 2
  3930. sta COLUBK ; 3
  3931. lda #ENABLE_TIA ; 2
  3932. sta WSYNC
  3933. ;--------------------------------------
  3934. sta VBLANK ; 3 enable TIA (D1 = 0)
  3935. sta HMCLR ; 3
  3936. sta CXCLR ; 3 clear all collisions
  3937. lda #>GameIcons ; 2
  3938. sta graphicPointers+1 ; 3
  3939. sta graphicPointers+3 ; 3
  3940. lda #>Telephone ; 2
  3941. sta graphicPointers+5 ; 3
  3942. sta WSYNC
  3943. ;--------------------------------------
  3944. ldx #NUM_PHONE_PIECES ; 2
  3945. bit h_phonePieceAttribute ; 3 check H phone piece value
  3946. bpl .checkForCarringSPiece ; 2≥ branch if E.T. not taken H piece
  3947. dex ; 2
  3948. .checkForCarringSPiece
  3949. bit s_phonePieceAttribute ; 3 check S phone piece value
  3950. bpl .checkForCarringWPiece ; 2≥ branch if E.T. not taken S piece
  3951. dex ; 2
  3952. .checkForCarringWPiece
  3953. bit w_phonePieceAttribute ; 3 check W phone piece value
  3954. bpl .setTelephoneIconLSB ; 2≥ branch if E.T. not taken W piece
  3955. dex ; 2
  3956. .setTelephoneIconLSB
  3957. lda TelephoneIconLSBPtrs,x ; 4
  3958. sta graphicPointers+4 ; 3
  3959. sta WSYNC
  3960. ;--------------------------------------
  3961. lda #$00 ; 2
  3962. ldy currentScreenId ; 3 get the current screen id
  3963. cpy #ID_ET_HOME ; 2
  3964. bcc .setupToDrawStatusIcons; 2≥
  3965. sta graphicPointers+2 ; 3
  3966. sta graphicPointers+4 ; 3
  3967. bne .setupToDrawGameSelection; 2≥
  3968. ldx #<EatCandyIcon_0 ; 2
  3969. lda collectedCandyScoring ; 3 get collected candy scoring value
  3970. ror ; 2 shift D0 to carry and branch if
  3971. bcc .setEatingCandyLSB ; 2≥ showing open eating candy animation
  3972. ldx #<EatCandyIcon_1 ; 2
  3973. .setEatingCandyLSB
  3974. stx graphicPointers ; 3
  3975. bne .setupToDrawStatusIcons; 3 unconditional branch
  3976.  
  3977. .setupToDrawGameSelection
  3978. lda #>NumberFonts ; 2
  3979. sta graphicPointers+1 ; 3
  3980. lda gameSelection ; 3 get the current game selection
  3981. asl ; 2 multiply game selection by 8 (i.e.
  3982. asl ; 2 height of digits)
  3983. asl ; 2
  3984. sta graphicPointers ; 3
  3985. .setupToDrawStatusIcons
  3986. sta WSYNC
  3987. ;--------------------------------------
  3988. bit mothershipStatus ; 3 check Mothership status
  3989. bpl .checkToDrawArtistInitials; 2≥ branch if Mothership not present
  3990. lda #$00 ; 2
  3991. sta graphicPointers+2 ; 3
  3992. sta graphicPointers+4 ; 3
  3993. .checkToDrawArtistInitials
  3994. lda artistInitialFlag ; 3
  3995. beq .prepareToDrawIndicators; 2≥
  3996. lda #<ArtistInitials ; 2
  3997. sta graphicPointers+2 ; 3
  3998. .prepareToDrawIndicators
  3999. lda #H_FONT - 1 ; 2
  4000. sta loopCount ; 3
  4001. .drawStatusKernelLoop
  4002. ldy loopCount ; 3
  4003. sta WSYNC
  4004. ;--------------------------------------
  4005. nop ; 2
  4006. nop ; 2
  4007. lda powerZoneColor ; 3 get power zone color
  4008. pha ; 3 push power zone color to stack
  4009. lda telephoneColor ; 3 get telephone color
  4010. sta COLUP1 ; 3 = @16 color telephone icon
  4011. lda (graphicPointers+4),y ; 5
  4012. sta GRP1 ; 3 = @24
  4013. lda (graphicPointers),y ; 5
  4014. tax ; 2
  4015. lda (graphicPointers+2),y ; 5
  4016. tay ; 2
  4017. pla ; 4 pull power zone color from stack
  4018. sta COLUP1 ; 3 = @45 color power zone icon
  4019. stx GRP1 ; 3 = @48
  4020. lda timerColor ; 3 get the timer color
  4021. sta COLUP1 ; 3 = @54 color timer icon
  4022. sty GRP1 ; 3 = @57
  4023. dec loopCount ; 5
  4024. bpl .drawStatusKernelLoop ; 2≥
  4025. sta WSYNC
  4026. ;--------------------------------------
  4027. lda #0 ; 2
  4028. sta GRP1 ; 3 = @05
  4029. sta NUSIZ1 ; 3 = @08
  4030. sta WSYNC
  4031. ;--------------------------------------
  4032. sta WSYNC
  4033. ;--------------------------------------
  4034. sta WSYNC
  4035. ;--------------------------------------
  4036. lda #BLACK ; 2
  4037. sta COLUBK ; 3 = @05
  4038. ldx #<RESP1 - RESP0 ; 2
  4039. sta WSYNC
  4040. ;--------------------------------------
  4041. nop ; 2
  4042. nop ; 2
  4043. lda etHMOVEValue ; 3
  4044. lda etHMOVEValue ; 3
  4045. sta HMP0,x ; 4 = @14
  4046. and #$0F ; 2
  4047. tay ; 2
  4048. .coarsePositionET
  4049. dey ; 2
  4050. bpl .coarsePositionET ; 2≥
  4051. sta RESP0,x ; 4
  4052. sta WSYNC
  4053. ;--------------------------------------
  4054. sta HMOVE ; 3
  4055. lda #MSBL_SIZE2 | PF_REFLECT; 2
  4056. ldx currentScreenId ; 3 get the current screen id
  4057. cpx #ID_WASHINGTON_DC ; 2
  4058. bne .setPlayfieldPriority ; 2≥
  4059. lda #MSBL_SIZE2 | PF_PRIORITY | PF_REFLECT; 2
  4060. .setPlayfieldPriority
  4061. sta CTRLPF ; 3
  4062. ldx #$FF ; 2
  4063. bit SWCHA ; 4 check joystick values
  4064. bpl .setETReflectState ; 2≥ branch if joystick pushed right
  4065. inx ; 2 x = 0
  4066. .setETReflectState
  4067. stx REFP1 ; 3
  4068. ldx currentObjectId ; 3 get the current object id
  4069. bmi .skipHumanReflection ; 2≥
  4070. bit etMotionValues ; 3 check E.T. motion values
  4071. bvs .skipHumanReflection ; 2≥ branch if E.T. carried by Scientist
  4072. ldy #$FF ; 2
  4073. lda humanAttributes,x ; 4 get human attribute value
  4074. bpl .turnToFaceET ; 2≥ branch if not returning home
  4075. lda HumanHorizReflectionTable,x; 4
  4076. bne .determineHumanReflection; 3 unconditional branch
  4077.  
  4078. .turnToFaceET
  4079. lda etHorizPos ; 3 get E.T.'s horizontal position
  4080. .determineHumanReflection
  4081. cmp currentObjectHorizPos ; 3
  4082. bcc .setHumanReflectState ; 2≥
  4083. iny ; 2
  4084. .setHumanReflectState
  4085. sty REFP0 ; 3
  4086. .skipHumanReflection
  4087. sta WSYNC
  4088. ;--------------------------------------
  4089. ldx currentScreenId ; 3 get the current screen id
  4090. cpx #ID_ET_HOME ; 2
  4091. bne .determineETColorFromEnergy; 2≥
  4092. bit etHomeElliottMovement ; 3 check Elliott movement value
  4093. bpl .moveElliottBehindHouse; 2≥ branch if Elliott moving left
  4094. lda #MSBL_SIZE2 | PF_REFLECT; 2
  4095. sta CTRLPF ; 3
  4096. bne .setCurrentObjectReflectState; 3 unconditional branch
  4097.  
  4098. .moveElliottBehindHouse
  4099. lda #MSBL_SIZE2 | PF_PRIORITY | PF_REFLECT; 2
  4100. sta CTRLPF ; 3
  4101. lda #$FF ; 2
  4102. .setCurrentObjectReflectState
  4103. sta REFP0 ; 3
  4104. .determineETColorFromEnergy
  4105. ldx #$00 ; 2
  4106. bit playerState ; 3 check current player state
  4107. bmi .setETColor ; 2≥ branch if E.T. is dead
  4108. lda etEnergy ; 3 get E.T. energy level
  4109. lsr ; 2 divide E.T. energy level by 32 to
  4110. lsr ; 2 get E.T. color value
  4111. lsr ; 2
  4112. lsr ; 2
  4113. lsr ; 2
  4114. tax ; 2
  4115. inx ; 2
  4116. .setETColor
  4117. lda ETColors,x ; 4
  4118. sta COLUP1 ; 3 set E.T. color based on current state
  4119. sta WSYNC
  4120. ;--------------------------------------
  4121. ldx currentScreenId ; 3 get the current screen id
  4122. lda PlayfieldColors,x ; 4
  4123. sta COLUPF ; 3 = @10
  4124. ldy #$FF ; 2
  4125. sty PF0 ; 3 = @15
  4126. sty PF1 ; 3 = @18
  4127. sty PF2 ; 3 = @21
  4128. lda BackgroundColors,x ; 4
  4129. sta COLUBK ; 3 = @28
  4130. lda #MSBL_SIZE4 ; 2
  4131. bit mothershipStatus ; 3 check Mothership status
  4132. bpl .setCurrentObjectSize ; 2≥ branch if Mothership not present
  4133. lda #MSBL_SIZE4 | DOUBLE_SIZE; 2 set Mothership to DOUBLE_SIZE
  4134. .setCurrentObjectSize
  4135. sta NUSIZ0 ; 3 = @40
  4136. lda #MSBL_SIZE4 ; 2
  4137. sta NUSIZ1 ; 3 = @45
  4138. sta WSYNC
  4139. ;--------------------------------------
  4140. sta WSYNC
  4141. ;--------------------------------------
  4142. sta WSYNC
  4143. ;--------------------------------------
  4144. ldy currentScreenId ; 3 get the current screen id
  4145. sta WSYNC
  4146. ;--------------------------------------
  4147. lda #$00 ; 2
  4148. sta PF1 ; 3 = @05
  4149. sta PF2 ; 3 = @08
  4150. ldx KernelJumpTableIndex,y ; 4
  4151. lda KernelJumpTable+1,x ; 4
  4152. pha ; 3
  4153. lda KernelJumpTable,x ; 4
  4154. pha ; 3
  4155. lda #0 ; 2
  4156. tax ; 2
  4157. tay ; 2
  4158. sta nextETGraphicData ; 3
  4159. sta nextObjectGraphicData ; 3
  4160. sta nextObjectColorData ; 3
  4161. rts ; 6
  4162.  
  4163. CheckForYarIndyOrHSWEasterEgg
  4164. lda flowerState ; get flower state
  4165. and #$F0
  4166. cmp #FLOWER_REVIVED | (1 * 16)
  4167. bne .doneEasterEggCheck ; branch if flower not revived
  4168. bit easterEggStatus
  4169. bmi .doneEasterEggCheck ; branch if check done this round
  4170. lda collectedCandyPieces ; get number of candy held by Elliott
  4171. cmp #7
  4172. bne .setEasterEggStepNotDone ; branch if not holding 7 pieces of candy
  4173. lda easterEggStatus ; get Easter Egg status
  4174. and #3
  4175. cmp #3
  4176. bne .checkIfETTookPhonePiece ; branch if first two steps not done
  4177. lda #2
  4178. .checkIfETTookPhonePiece
  4179. tax
  4180. lda phonePieceAttributes,x ; get phone piece attribute value
  4181. bpl .setEasterEggStepNotDone ; branch if E.T. not taken phone piece
  4182. ldx easterEggStatus ; get Easter Egg status
  4183. cpx #2
  4184. bcs .setEasterEggStepDone ; branch if at least two steps done
  4185. lda EasterEggSpriteValues,x
  4186. sta easterEggSpriteFlag
  4187. lda #50
  4188. sta currentObjectVertPos
  4189. .setEasterEggStepDone
  4190. sec
  4191. bcs .setEasterEggStatusFlags ; unconditional branch
  4192.  
  4193. .setEasterEggStepNotDone
  4194. clc
  4195. .setEasterEggStatusFlags
  4196. lda easterEggStatus ; get Easter Egg status
  4197. rol ; rotate carry flag into D0
  4198. ora #DONE_EASTER_EGG_CHECK
  4199. sta easterEggStatus ; show Easter Egg check done this round
  4200. and #DONE_EASTER_EGG_STEPS
  4201. cmp #DONE_EASTER_EGG_STEPS
  4202. bne .doneEasterEggCheck ; branch if all steps not done
  4203. lda #SHOW_HSW_INITIALS_VALUE ; set value to show HSW's initials :-)
  4204. sta programmerInitialFlag
  4205. .doneEasterEggCheck
  4206. rts
  4207.  
  4208. BOUNDARY 0
  4209.  
  4210. TitleETGraphics
  4211. TitleETGraphics_0
  4212. .byte $D0 ; |XX.X....|
  4213. .byte $00 ; |........|
  4214. .byte $D0 ; |XX.X....|
  4215. .byte $E0 ; |XXX.....|
  4216. .byte $10 ; |...X....|
  4217. .byte $E0 ; |XXX.....|
  4218. .byte $50 ; |.X.X....|
  4219. .byte $F0 ; |XXXX....|
  4220. .byte $40 ; |.X......|
  4221. .byte $F0 ; |XXXX....|
  4222. .byte $A0 ; |X.X.....|
  4223. .byte $D0 ; |XX.X....|
  4224. .byte $A8 ; |X.X.X...|
  4225. .byte $F4 ; |XXXX.X..|
  4226. .byte $C8 ; |XX..X...|
  4227. .byte $F0 ; |XXXX....|
  4228. .byte $A8 ; |X.X.X...|
  4229. .byte $D4 ; |XX.X.X..|
  4230. .byte $EC ; |XXX.XX..|
  4231. .byte $D8 ; |XX.XX...|
  4232. .byte $74 ; |.XXX.X..|
  4233. .byte $F8 ; |XXXXX...|
  4234. .byte $B4 ; |X.XX.X..|
  4235. .byte $F8 ; |XXXXX...|
  4236. .byte $F4 ; |XXXX.X..|
  4237. .byte $58 ; |.X.XX...|
  4238. .byte $F8 ; |XXXXX...|
  4239. .byte $D8 ; |XX.XX...|
  4240. .byte $D0 ; |XX.X....|
  4241. .byte $D0 ; |XX.X....|
  4242. .byte $A0 ; |X.X.....|
  4243. .byte $40 ; |.X......|
  4244. .byte $80 ; |X.......|
  4245. TitleETGraphics_1
  4246. .byte $00 ; |........|
  4247. .byte $00 ; |........|
  4248. .byte $00 ; |........|
  4249. .byte $00 ; |........|
  4250. .byte $00 ; |........|
  4251. .byte $00 ; |........|
  4252. .byte $00 ; |........|
  4253. .byte $00 ; |........|
  4254. .byte $00 ; |........|
  4255. .byte $00 ; |........|
  4256. .byte $00 ; |........|
  4257. .byte $00 ; |........|
  4258. .byte $00 ; |........|
  4259. .byte $00 ; |........|
  4260. .byte $00 ; |........|
  4261. .byte $00 ; |........|
  4262. .byte $00 ; |........|
  4263. .byte $00 ; |........|
  4264. .byte $01 ; |.......X|
  4265. .byte $01 ; |.......X|
  4266. .byte $03 ; |......XX|
  4267. .byte $02 ; |......X.|
  4268. .byte $07 ; |.....XXX|
  4269. .byte $05 ; |.....X.X|
  4270. .byte $07 ; |.....XXX|
  4271. .byte $0D ; |....XX.X|
  4272. .byte $0F ; |....XXXX|
  4273. .byte $1D ; |...XXX.X|
  4274. .byte $16 ; |...X.XX.|
  4275. .byte $1F ; |...XXXXX|
  4276. .byte $1B ; |...XX.XX|
  4277. .byte $1D ; |...XXX.X|
  4278. .byte $1E ; |...XXXX.|
  4279. .byte $0F ; |....XXXX|
  4280. .byte $07 ; |.....XXX|
  4281. .byte $07 ; |.....XXX|
  4282. .byte $07 ; |.....XXX|
  4283. .byte $03 ; |......XX|
  4284. .byte $01 ; |.......X|
  4285. .byte $00 ; |........|
  4286. TitleETGraphics_2
  4287. .byte $00 ; |........|
  4288. .byte $00 ; |........|
  4289. .byte $00 ; |........|
  4290. .byte $00 ; |........|
  4291. .byte $01 ; |.......X|
  4292. .byte $03 ; |......XX|
  4293. .byte $06 ; |.....XX.|
  4294. .byte $0D ; |....XX.X|
  4295. .byte $08 ; |....X...|
  4296. .byte $1B ; |...XX.XX|
  4297. .byte $1B ; |...XX.XX|
  4298. .byte $1F ; |...XXXXX|
  4299. .byte $0F ; |....XXXX|
  4300. .byte $2F ; |..X.XXXX|
  4301. .byte $1F ; |...XXXXX|
  4302. .byte $37 ; |..XX.XXX|
  4303. .byte $3F ; |..XXXXXX|
  4304. .byte $DB ; |XX.XX.XX|
  4305. .byte $7F ; |.XXXXXXX|
  4306. .byte $DD ; |XX.XXX.X|
  4307. .byte $6F ; |.XX.XXXX|
  4308. .byte $B5 ; |X.XX.X.X|
  4309. .byte $1B ; |...XX.XX|
  4310. .byte $1D ; |...XXX.X|
  4311. .byte $17 ; |...X.XXX|
  4312. .byte $3A ; |..XXX.X.|
  4313. .byte $1D ; |...XXX.X|
  4314. .byte $1A ; |...XX.X.|
  4315. .byte $B5 ; |X.XX.X.X|
  4316. .byte $5E ; |.X.XXXX.|
  4317. .byte $F5 ; |XXXX.X.X|
  4318. .byte $6B ; |.XX.X.XX|
  4319. .byte $A7 ; |X.X..XXX|
  4320. .byte $5F ; |.X.XXXXX|
  4321. .byte $BF ; |X.XXXXXX|
  4322. .byte $FF ; |XXXXXXXX|
  4323. .byte $FF ; |XXXXXXXX|
  4324. .byte $FF ; |XXXXXXXX|
  4325. .byte $FE ; |XXXXXXX.|
  4326. .byte $7B ; |.XXXX.XX|
  4327. TitleETGraphics_3
  4328. .byte $00 ; |........|
  4329. .byte $00 ; |........|
  4330. .byte $7F ; |.XXXXXXX|
  4331. .byte $C0 ; |XX......|
  4332. .byte $AA ; |X.X.X.X.|
  4333. .byte $7F ; |.XXXXXXX|
  4334. .byte $FF ; |XXXXXXXX|
  4335. .byte $EF ; |XXX.XXXX|
  4336. .byte $00 ; |........|
  4337. .byte $FF ; |XXXXXXXX|
  4338. .byte $FF ; |XXXXXXXX|
  4339. .byte $FF ; |XXXXXXXX|
  4340. .byte $DF ; |XX.XXXXX|
  4341. .byte $FF ; |XXXXXXXX|
  4342. .byte $FF ; |XXXXXXXX|
  4343. .byte $DF ; |XX.XXXXX|
  4344. .byte $FF ; |XXXXXXXX|
  4345. .byte $FF ; |XXXXXXXX|
  4346. .byte $DF ; |XX.XXXXX|
  4347. .byte $FF ; |XXXXXXXX|
  4348. .byte $FF ; |XXXXXXXX|
  4349. .byte $FD ; |XXXXXX.X|
  4350. .byte $27 ; |..X..XXX|
  4351. .byte $25 ; |..X..X.X|
  4352. .byte $FE ; |XXXXXXX.|
  4353. .byte $FB ; |XXXXX.XX|
  4354. .byte $FE ; |XXXXXXX.|
  4355. .byte $7B ; |.XXXX.XX|
  4356. .byte $D6 ; |XX.X.XX.|
  4357. .byte $BF ; |X.XXXXXX|
  4358. .byte $D7 ; |XX.X.XXX|
  4359. .byte $EF ; |XXX.XXXX|
  4360. .byte $D7 ; |XX.X.XXX|
  4361. .byte $FF ; |XXXXXXXX|
  4362. .byte $D7 ; |XX.X.XXX|
  4363. .byte $E7 ; |XXX..XXX|
  4364. .byte $D3 ; |XX.X..XX|
  4365. .byte $A1 ; |X.X....X|
  4366. .byte $80 ; |X.......|
  4367. .byte $00 ; |........|
  4368. TitleETGraphics_4
  4369. .byte $01 ; |.......X|
  4370. .byte $00 ; |........|
  4371. .byte $81 ; |X......X|
  4372. .byte $C1 ; |XX.....X|
  4373. .byte $61 ; |.XX....X|
  4374. .byte $30 ; |..XX....|
  4375. .byte $98 ; |X..XX...|
  4376. .byte $9E ; |X..XXXX.|
  4377. .byte $0F ; |....XXXX|
  4378. .byte $E7 ; |XXX..XXX|
  4379. .byte $F7 ; |XXXX.XXX|
  4380. .byte $FF ; |XXXXXXXX|
  4381. .byte $FF ; |XXXXXXXX|
  4382. .byte $ED ; |XXX.XX.X|
  4383. .byte $FA ; |XXXXX.X.|
  4384. .byte $F7 ; |XXXX.XXX|
  4385. .byte $EF ; |XXX.XXXX|
  4386. .byte $BF ; |X.XXXXXX|
  4387. .byte $FD ; |XXXXXX.X|
  4388. .byte $5A ; |.X.XX.X.|
  4389. .byte $FF ; |XXXXXXXX|
  4390. .byte $D5 ; |XX.X.X.X|
  4391. .byte $A2 ; |X.X...X.|
  4392. .byte $63 ; |.XX...XX|
  4393. .byte $E3 ; |XXX...XX|
  4394. .byte $67 ; |.XX..XXX|
  4395. .byte $E3 ; |XXX...XX|
  4396. .byte $A2 ; |X.X...X.|
  4397. .byte $D5 ; |XX.X.X.X|
  4398. .byte $7F ; |.XXXXXXX|
  4399. .byte $AA ; |X.X.X.X.|
  4400. .byte $D5 ; |XX.X.X.X|
  4401. .byte $FB ; |XXXXX.XX|
  4402. .byte $FF ; |XXXXXXXX|
  4403. .byte $FF ; |XXXXXXXX|
  4404. .byte $FF ; |XXXXXXXX|
  4405. .byte $FF ; |XXXXXXXX|
  4406. .byte $FF ; |XXXXXXXX|
  4407. .byte $FF ; |XXXXXXXX|
  4408. .byte $2A ; |..X.X.X.|
  4409. TitleETGraphics_5
  4410. .byte $FF ; |XXXXXXXX|
  4411. .byte $15 ; |...X.X.X|
  4412. .byte $FF ; |XXXXXXXX|
  4413. .byte $FF ; |XXXXXXXX|
  4414. .byte $4A ; |.X..X.X.|
  4415. .byte $BF ; |X.XXXXXX|
  4416. .byte $5F ; |.X.XXXXX|
  4417. .byte $2D ; |..X.XX.X|
  4418. .byte $57 ; |.X.X.XXX|
  4419. .byte $BB ; |X.XXX.XX|
  4420. .byte $DD ; |XX.XXX.X|
  4421. .byte $EE ; |XXX.XXX.|
  4422. .byte $FB ; |XXXXX.XX|
  4423. .byte $DD ; |XX.XXX.X|
  4424. .byte $EE ; |XXX.XXX.|
  4425. .byte $FF ; |XXXXXXXX|
  4426. .byte $57 ; |.X.X.XXX|
  4427. .byte $FF ; |XXXXXXXX|
  4428. .byte $BF ; |X.XXXXXX|
  4429. .byte $EB ; |XXX.X.XX|
  4430. .byte $B5 ; |X.XX.X.X|
  4431. .byte $DF ; |XX.XXXXX|
  4432. .byte $EA ; |XXX.X.X.|
  4433. .byte $FF ; |XXXXXXXX|
  4434. .byte $5A ; |.X.XX.X.|
  4435. .byte $FF ; |XXXXXXXX|
  4436. .byte $6D ; |.XX.XX.X|
  4437. .byte $F7 ; |XXXX.XXX|
  4438. .byte $BE ; |X.XXXXX.|
  4439. .byte $5F ; |.X.XXXXX|
  4440. .byte $B6 ; |X.XX.XX.|
  4441. .byte $7E ; |.XXXXXX.|
  4442. .byte $F6 ; |XXXX.XX.|
  4443. .byte $F5 ; |XXXX.X.X|
  4444. .byte $F4 ; |XXXX.X..|
  4445. .byte $E8 ; |XXX.X...|
  4446. .byte $D0 ; |XX.X....|
  4447. .byte $80 ; |X.......|
  4448. .byte $00 ; |........|
  4449. .byte $00 ; |........|
  4450.  
  4451. NextRoundScoreMSB
  4452. .byte $00,$10,$22,$34,$45,$63,$78,$99
  4453.  
  4454. NextRoundEnergyValues
  4455. .byte $99,$92,$84,$76,$68,$59,$51,$42
  4456.  
  4457. ETColors
  4458. .byte WHITE,DK_GREEN+14,DK_GREEN+12,DK_GREEN+10
  4459. .byte DK_GREEN+10,DK_GREEN+10,BLACK
  4460.  
  4461. WideDiamondPitGraphics
  4462. WideDiamondPitPF1Graphics
  4463. .byte $00 ; |........|
  4464. .byte $00 ; |........|
  4465. .byte $00 ; |........|
  4466. .byte $00 ; |........|
  4467. .byte $00 ; |........|
  4468. KernelJumpTableIndex
  4469. .byte $00 ; |........|
  4470. .byte $00 ; |........|
  4471. .byte $00 ; |........|
  4472. .byte $00 ; |........|
  4473. .byte $00 ; |........|
  4474. .byte $00 ; |........|
  4475. .byte $00 ; |........|
  4476. .byte $00 ; |........|
  4477. .byte $02 ; |......X.|
  4478. .byte $02 ; |......X.|
  4479. .byte $02 ; |......X.|
  4480. .byte $02 ; |......X.|
  4481. .byte $02 ; |......X.|
  4482. .byte $07 ; |.....XXX|
  4483. .byte $07 ; |.....XXX|
  4484. .byte $07 ; |.....XXX|
  4485. .byte $07 ; |.....XXX|
  4486. .byte $07 ; |.....XXX|
  4487. .byte $07 ; |.....XXX|
  4488. .byte $07 ; |.....XXX|
  4489. .byte $07 ; |.....XXX|
  4490. .byte $0F ; |....XXXX|
  4491. .byte $0F ; |....XXXX|
  4492. .byte $0F ; |....XXXX|
  4493. .byte $0F ; |....XXXX|
  4494. .byte $0F ; |....XXXX|
  4495. .byte $0F ; |....XXXX|
  4496. .byte $0F ; |....XXXX|
  4497. .byte $0F ; |....XXXX|
  4498. .byte $0F ; |....XXXX|
  4499. .byte $0F ; |....XXXX|
  4500. .byte $0F ; |....XXXX|
  4501. .byte $0F ; |....XXXX|
  4502. .byte $07 ; |.....XXX|
  4503. .byte $07 ; |.....XXX|
  4504. .byte $07 ; |.....XXX|
  4505. .byte $07 ; |.....XXX|
  4506. .byte $07 ; |.....XXX|
  4507. .byte $07 ; |.....XXX|
  4508. .byte $07 ; |.....XXX|
  4509. .byte $07 ; |.....XXX|
  4510. .byte $02 ; |......X.|
  4511. .byte $02 ; |......X.|
  4512. .byte $02 ; |......X.|
  4513. .byte $02 ; |......X.|
  4514. .byte $02 ; |......X.|
  4515. WideDiamondPitPF2Graphics
  4516. .byte $00 ; |........|
  4517. .byte $00 ; |........|
  4518. .byte $00 ; |........|
  4519. .byte $00 ; |........|
  4520. .byte $00 ; |........|
  4521. .byte $00 ; |........|
  4522. .byte $00 ; |........|
  4523. .byte $00 ; |........|
  4524. .byte $00 ; |........|
  4525. .byte $00 ; |........|
  4526. .byte $00 ; |........|
  4527. .byte $00 ; |........|
  4528. .byte $00 ; |........|
  4529. .byte $00 ; |........|
  4530. .byte $00 ; |........|
  4531. .byte $00 ; |........|
  4532. .byte $80 ; |X.......|
  4533. .byte $C0 ; |XX......|
  4534. .byte $E0 ; |XXX.....|
  4535. .byte $E0 ; |XXX.....|
  4536. .byte $E0 ; |XXX.....|
  4537. .byte $C0 ; |XX......|
  4538. .byte $80 ; |X.......|
  4539. .byte $00 ; |........|
  4540. .byte $00 ; |........|
  4541. .byte $00 ; |........|
  4542. .byte $01 ; |.......X|
  4543. .byte $01 ; |.......X|
  4544. .byte $01 ; |.......X|
  4545. .byte $01 ; |.......X|
  4546. .byte $01 ; |.......X|
  4547. .byte $01 ; |.......X|
  4548. .byte $01 ; |.......X|
  4549. .byte $01 ; |.......X|
  4550. .byte $01 ; |.......X|
  4551. .byte $01 ; |.......X|
  4552. .byte $01 ; |.......X|
  4553. .byte $01 ; |.......X|
  4554. .byte $00 ; |........|
  4555. .byte $00 ; |........|
  4556. .byte $00 ; |........|
  4557. .byte $80 ; |X.......|
  4558. .byte $C0 ; |XX......|
  4559. .byte $E0 ; |XXX.....|
  4560. .byte $E0 ; |XXX.....|
  4561. .byte $E0 ; |XXX.....|
  4562. .byte $C0 ; |XX......|
  4563. .byte $80 ; |X.......|
  4564. .byte $00 ; |........|
  4565. .byte $00 ; |........|
  4566. .byte $00 ; |........|
  4567. .byte $00 ; |........|
  4568. .byte $00 ; |........|
  4569. .byte $00 ; |........|
  4570. .byte $00 ; |........|
  4571. .byte $00 ; |........|
  4572. .byte $00 ; |........|
  4573. .byte $00 ; |........|
  4574. .byte $00 ; |........|
  4575. .byte $00 ; |........|
  4576. .byte $00 ; |........|
  4577. .byte $00 ; |........|
  4578. .byte $00 ; |........|
  4579. .byte $00 ; |........|
  4580.  
  4581. ForestGraphics
  4582. ForestPF1Graphics
  4583. .byte $AA ; |X.X.X.X.|
  4584. .byte $55 ; |.X.X.X.X|
  4585. .byte $AB ; |X.X.X.XX|
  4586. .byte $57 ; |.X.X.XXX|
  4587. .byte $A2 ; |X.X...X.|
  4588. .byte $C1 ; |XX.....X|
  4589. .byte $C0 ; |XX......|
  4590. .byte $55 ; |.X.X.X.X|
  4591. .byte $A2 ; |X.X...X.|
  4592. .byte $C1 ; |XX.....X|
  4593. .byte $C0 ; |XX......|
  4594. .byte $55 ; |.X.X.X.X|
  4595. .byte $A2 ; |X.X...X.|
  4596. .byte $C1 ; |XX.....X|
  4597. .byte $C0 ; |XX......|
  4598. .byte $55 ; |.X.X.X.X|
  4599. .byte $A2 ; |X.X...X.|
  4600. .byte $C1 ; |XX.....X|
  4601. .byte $D0 ; |XX.X....|
  4602. .byte $55 ; |.X.X.X.X|
  4603. .byte $BA ; |X.XXX.X.|
  4604. .byte $7D ; |.XXXXX.X|
  4605. .byte $FC ; |XXXXXX..|
  4606. .byte $55 ; |.X.X.X.X|
  4607. .byte $BA ; |X.XXX.X.|
  4608. .byte $7D ; |.XXXXX.X|
  4609. .byte $FE ; |XXXXXXX.|
  4610. .byte $54 ; |.X.X.X..|
  4611. .byte $38 ; |..XXX...|
  4612. .byte $7D ; |.XXXXX.X|
  4613. .byte $FE ; |XXXXXXX.|
  4614. .byte $54 ; |.X.X.X..|
  4615. .byte $38 ; |..XXX...|
  4616. .byte $7D ; |.XXXXX.X|
  4617. .byte $FE ; |XXXXXXX.|
  4618. .byte $54 ; |.X.X.X..|
  4619. .byte $38 ; |..XXX...|
  4620. .byte $55 ; |.X.X.X.X|
  4621. .byte $AA ; |X.X.X.X.|
  4622. .byte $55 ; |.X.X.X.X|
  4623. .byte $2B ; |..X.X.XX|
  4624. .byte $47 ; |.X...XXX|
  4625. .byte $83 ; |X.....XX|
  4626. .byte $01 ; |.......X|
  4627. .byte $AB ; |X.X.X.XX|
  4628. .byte $47 ; |.X...XXX|
  4629. .byte $83 ; |X.....XX|
  4630. .byte $01 ; |.......X|
  4631. .byte $AB ; |X.X.X.XX|
  4632. .byte $47 ; |.X...XXX|
  4633. .byte $83 ; |X.....XX|
  4634. .byte $01 ; |.......X|
  4635. .byte $AB ; |X.X.X.XX|
  4636. .byte $47 ; |.X...XXX|
  4637. .byte $83 ; |X.....XX|
  4638. .byte $01 ; |.......X|
  4639. .byte $AB ; |X.X.X.XX|
  4640. .byte $C5 ; |XX...X.X|
  4641. .byte $82 ; |X.....X.|
  4642. .byte $C1 ; |XX.....X|
  4643. .byte $EA ; |XXX.X.X.|
  4644. .byte $E5 ; |XXX..X.X|
  4645. .byte $AA ; |X.X.X.X.|
  4646. .byte $D5 ; |XX.X.X.X|
  4647. ForestPF2Graphics
  4648. .byte $55 ; |.X.X.X.X|
  4649. .byte $AB ; |X.X.X.XX|
  4650. .byte $57 ; |.X.X.XXX|
  4651. .byte $2F ; |..X.XXXX|
  4652. .byte $15 ; |...X.X.X|
  4653. .byte $0B ; |....X.XX|
  4654. .byte $55 ; |.X.X.X.X|
  4655. .byte $2A ; |..X.X.X.|
  4656. .byte $15 ; |...X.X.X|
  4657. .byte $0E ; |....XXX.|
  4658. .byte $5F ; |.X.XXXXX|
  4659. .byte $3F ; |..XXXXXX|
  4660. .byte $15 ; |...X.X.X|
  4661. .byte $0E ; |....XXX.|
  4662. .byte $5F ; |.X.XXXXX|
  4663. .byte $3F ; |..XXXXXX|
  4664. .byte $15 ; |...X.X.X|
  4665. .byte $0E ; |....XXX.|
  4666. .byte $5F ; |.X.XXXXX|
  4667. .byte $3F ; |..XXXXXX|
  4668. .byte $15 ; |...X.X.X|
  4669. .byte $0E ; |....XXX.|
  4670. .byte $5F ; |.X.XXXXX|
  4671. .byte $3F ; |..XXXXXX|
  4672. .byte $55 ; |.X.X.X.X|
  4673. .byte $AE ; |X.X.XXX.|
  4674. .byte $54 ; |.X.X.X..|
  4675. .byte $A8 ; |X.X.X...|
  4676. .byte $D0 ; |XX.X....|
  4677. .byte $EA ; |XXX.X.X.|
  4678. .byte $F4 ; |XXXX.X..|
  4679. .byte $A8 ; |X.X.X...|
  4680. .byte $D0 ; |XX.X....|
  4681. .byte $EA ; |XXX.X.X.|
  4682. .byte $F4 ; |XXXX.X..|
  4683. .byte $A8 ; |X.X.X...|
  4684. .byte $D0 ; |XX.X....|
  4685. .byte $EA ; |XXX.X.X.|
  4686. .byte $F4 ; |XXXX.X..|
  4687. .byte $A8 ; |X.X.X...|
  4688. .byte $D1 ; |XX.X...X|
  4689. .byte $EB ; |XXX.X.XX|
  4690. .byte $F7 ; |XXXX.XXX|
  4691. .byte $AA ; |X.X.X.X.|
  4692. .byte $D5 ; |XX.X.X.X|
  4693. .byte $EB ; |XXX.X.XX|
  4694. .byte $C7 ; |XX...XXX|
  4695. .byte $82 ; |X.....X.|
  4696. .byte $81 ; |X......X|
  4697. .byte $AB ; |X.X.X.XX|
  4698. .byte $47 ; |.X...XXX|
  4699. .byte $82 ; |X.....X.|
  4700. .byte $01 ; |.......X|
  4701. .byte $AB ; |X.X.X.XX|
  4702. .byte $47 ; |.X...XXX|
  4703. .byte $8A ; |X...X.X.|
  4704. .byte $1D ; |...XXX.X|
  4705. .byte $BE ; |X.XXXXX.|
  4706. .byte $7F ; |.XXXXXXX|
  4707. .byte $AA ; |X.X.X.X.|
  4708. .byte $1D ; |...XXX.X|
  4709. .byte $BE ; |X.XXXXX.|
  4710. .byte $7F ; |.XXXXXXX|
  4711. .byte $AA ; |X.X.X.X.|
  4712.  
  4713. KernelJumpTable
  4714. .word JumpIntoGameKernel-1
  4715. .word TitleScreenKernel-1
  4716.  
  4717. PsuedoRandomValueIncTable
  4718. .byte 115,13,91,213
  4719.  
  4720. BOUNDARY 0
  4721.  
  4722. ETSprites
  4723. ETWalkSprite_A0
  4724. .byte $FE ; |XXXXXXX.|
  4725. .byte $FF ; |XXXXXXXX|
  4726. .byte $C3 ; |XX....XX|
  4727. .byte $0F ; |....XXXX|
  4728. .byte $FF ; |XXXXXXXX|
  4729. .byte $3F ; |..XXXXXX|
  4730. .byte $2B ; |..X.X.XX|
  4731. .byte $E7 ; |XXX..XXX|
  4732. .byte $00 ; |........|
  4733.  
  4734. ETExtensionSprites_A
  4735. ETExtensionSprite_A0
  4736. .byte $FE ; |XXXXXXX.|
  4737. .byte $FF ; |XXXXXXXX|
  4738. .byte $C3 ; |XX....XX|
  4739. .byte $03 ; |......XX|
  4740. .byte $0F ; |....XXXX|
  4741. .byte $FF ; |XXXXXXXX|
  4742. .byte $3F ; |..XXXXXX|
  4743. .byte $2B ; |..X.X.XX|
  4744. .byte $E7 ; |XXX..XXX|
  4745. .byte $00 ; |........|
  4746. ETExtensionSprite_A1
  4747. .byte $FE ; |XXXXXXX.|
  4748. .byte $FF ; |XXXXXXXX|
  4749. .byte $C3 ; |XX....XX|
  4750. .byte $03 ; |......XX|
  4751. .byte $03 ; |......XX|
  4752. .byte $0F ; |....XXXX|
  4753. .byte $FF ; |XXXXXXXX|
  4754. .byte $3F ; |..XXXXXX|
  4755. .byte $2B ; |..X.X.XX|
  4756. .byte $E7 ; |XXX..XXX|
  4757. .byte $00 ; |........|
  4758. ETExtensionSprite_A2
  4759. .byte $FE ; |XXXXXXX.|
  4760. .byte $FF ; |XXXXXXXX|
  4761. .byte $C3 ; |XX....XX|
  4762. .byte $03 ; |......XX|
  4763. .byte $03 ; |......XX|
  4764. .byte $03 ; |......XX|
  4765. .byte $0F ; |....XXXX|
  4766. .byte $FF ; |XXXXXXXX|
  4767. .byte $3F ; |..XXXXXX|
  4768. .byte $2B ; |..X.X.XX|
  4769. .byte $E7 ; |XXX..XXX|
  4770. .byte $00 ; |........|
  4771. ETExtensionSprite_A3
  4772. .byte $FE ; |XXXXXXX.|
  4773. .byte $FF ; |XXXXXXXX|
  4774. .byte $03 ; |......XX|
  4775. .byte $03 ; |......XX|
  4776. .byte $03 ; |......XX|
  4777. .byte $03 ; |......XX|
  4778. .byte $03 ; |......XX|
  4779. .byte $0F ; |....XXXX|
  4780. .byte $FF ; |XXXXXXXX|
  4781. .byte $3F ; |..XXXXXX|
  4782. .byte $2B ; |..X.X.XX|
  4783. .byte $E7 ; |XXX..XXX|
  4784. .byte $00 ; |........|
  4785.  
  4786. ETWalkSprite_B0
  4787. .byte $BF ; |X.XXXXXX|
  4788. .byte $FF ; |XXXXXXXX|
  4789. .byte $03 ; |......XX|
  4790. .byte $1F ; |...XXXXX|
  4791. .byte $BF ; |X.XXXXXX|
  4792. .byte $3F ; |..XXXXXX|
  4793. .byte $63 ; |.XX...XX|
  4794. .byte $00 ; |........|
  4795. .byte $00 ; |........|
  4796.  
  4797. ETExtensionSprites_B
  4798. ETExtensionSprite_B0
  4799. .byte $BF ; |X.XXXXXX|
  4800. .byte $FF ; |XXXXXXXX|
  4801. .byte $03 ; |......XX|
  4802. .byte $03 ; |......XX|
  4803. .byte $1F ; |...XXXXX|
  4804. .byte $BF ; |X.XXXXXX|
  4805. .byte $3F ; |..XXXXXX|
  4806. .byte $63 ; |.XX...XX|
  4807. .byte $00 ; |........|
  4808. .byte $00 ; |........|
  4809. ETExtensionSprite_B1
  4810. .byte $BF ; |X.XXXXXX|
  4811. .byte $FF ; |XXXXXXXX|
  4812. .byte $03 ; |......XX|
  4813. .byte $03 ; |......XX|
  4814. .byte $03 ; |......XX|
  4815. .byte $1F ; |...XXXXX|
  4816. .byte $BF ; |X.XXXXXX|
  4817. .byte $3F ; |..XXXXXX|
  4818. .byte $63 ; |.XX...XX|
  4819. .byte $00 ; |........|
  4820. .byte $00 ; |........|
  4821. ETExtensionSprite_B2
  4822. .byte $BF ; |X.XXXXXX|
  4823. .byte $FF ; |XXXXXXXX|
  4824. .byte $03 ; |......XX|
  4825. .byte $03 ; |......XX|
  4826. .byte $03 ; |......XX|
  4827. .byte $03 ; |......XX|
  4828. .byte $1F ; |...XXXXX|
  4829. .byte $BF ; |X.XXXXXX|
  4830. .byte $3F ; |..XXXXXX|
  4831. .byte $63 ; |.XX...XX|
  4832. .byte $00 ; |........|
  4833. .byte $00 ; |........|
  4834. ETExtensionSprite_B3
  4835. .byte $BF ; |X.XXXXXX|
  4836. .byte $FF ; |XXXXXXXX|
  4837. .byte $03 ; |......XX|
  4838. .byte $03 ; |......XX|
  4839. .byte $03 ; |......XX|
  4840. .byte $03 ; |......XX|
  4841. .byte $03 ; |......XX|
  4842. .byte $1F ; |...XXXXX|
  4843. .byte $BF ; |X.XXXXXX|
  4844. .byte $3F ; |..XXXXXX|
  4845. .byte $63 ; |.XX...XX|
  4846. .byte $00 ; |........|
  4847. .byte $00 ; |........|
  4848.  
  4849. ETDead_0
  4850. .byte $E0 ; |XXX.....|
  4851. .byte $A2 ; |X.X...X.|
  4852. .byte $E7 ; |XXX..XXX|
  4853. .byte $EE ; |XXX.XXX.|
  4854. .byte $FB ; |XXXXX.XX|
  4855. .byte $00 ; |........|
  4856. ETDead_1
  4857. .byte $E0 ; |XXX.....|
  4858. .byte $E3 ; |XXX...XX|
  4859. .byte $EF ; |XXX.XXXX|
  4860. .byte $ED ; |XXX.XX.X|
  4861. .byte $FF ; |XXXXXXXX|
  4862. .byte $00 ; |........|
  4863.  
  4864. ETWalkSprite_A1
  4865. .byte $FE ; |XXXXXXX.|
  4866. .byte $FF ; |XXXXXXXX|
  4867. .byte $C3 ; |XX....XX|
  4868. .byte $0F ; |....XXXX|
  4869. .byte $FF ; |XXXXXXXX|
  4870. .byte $3F ; |..XXXXXX|
  4871. .byte $3F ; |..XXXXXX|
  4872. .byte $60 ; |.XX.....|
  4873. .byte $00 ; |........|
  4874. ETWalkSprite_B1
  4875. .byte $BF ; |X.XXXXXX|
  4876. .byte $FF ; |XXXXXXXX|
  4877. .byte $03 ; |......XX|
  4878. .byte $1F ; |...XXXXX|
  4879. .byte $BF ; |X.XXXXXX|
  4880. .byte $3F ; |..XXXXXX|
  4881. .byte $27 ; |..X..XXX|
  4882. .byte $E0 ; |XXX.....|
  4883. .byte $00 ; |........|
  4884. ETWalkSprite_A2
  4885. .byte $FE ; |XXXXXXX.|
  4886. .byte $FF ; |XXXXXXXX|
  4887. .byte $C3 ; |XX....XX|
  4888. .byte $0F ; |....XXXX|
  4889. .byte $FF ; |XXXXXXXX|
  4890. .byte $3F ; |..XXXXXX|
  4891. .byte $7E ; |.XXXXXX.|
  4892. .byte $03 ; |......XX|
  4893. .byte $00 ; |........|
  4894. ETWalkSprite_B2
  4895. .byte $BF ; |X.XXXXXX|
  4896. .byte $FF ; |XXXXXXXX|
  4897. .byte $03 ; |......XX|
  4898. .byte $1F ; |...XXXXX|
  4899. .byte $BF ; |X.XXXXXX|
  4900. .byte $3F ; |..XXXXXX|
  4901. .byte $E1 ; |XXX....X|
  4902. .byte $07 ; |.....XXX|
  4903. .byte $00 ; |........|
  4904.  
  4905. ETTitle_E
  4906. .byte $E0 ; |XXX.....|
  4907. .byte $F0 ; |XXXX....|
  4908. .byte $F8 ; |XXXXX...|
  4909. .byte $DC ; |XX.XXX..|
  4910. .byte $CE ; |XX..XXX.|
  4911. .byte $C6 ; |XX...XX.|
  4912. .byte $E0 ; |XXX.....|
  4913. .byte $F0 ; |XXXX....|
  4914. .byte $D8 ; |XX.XX...|
  4915. .byte $CC ; |XX..XX..|
  4916. .byte $C6 ; |XX...XX.|
  4917. .byte $E0 ; |XXX.....|
  4918. .byte $F0 ; |XXXX....|
  4919. .byte $78 ; |.XXXX...|
  4920. .byte $3C ; |..XXXX..|
  4921. .byte $1E ; |...XXXX.|
  4922.  
  4923. ETTitle_T
  4924. .byte $10 ; |...X....|
  4925. .byte $18 ; |...XX...|
  4926. .byte $18 ; |...XX...|
  4927. .byte $18 ; |...XX...|
  4928. .byte $18 ; |...XX...|
  4929. .byte $18 ; |...XX...|
  4930. .byte $18 ; |...XX...|
  4931. .byte $18 ; |...XX...|
  4932. .byte $18 ; |...XX...|
  4933. .byte $18 ; |...XX...|
  4934. .byte $18 ; |...XX...|
  4935. .byte $F8 ; |XXXXX...|
  4936. .byte $78 ; |.XXXX...|
  4937. .byte $3C ; |..XXXX..|
  4938. .byte $1E ; |...XXXX.|
  4939. .byte $0F ; |....XXXX|
  4940.  
  4941. FlowerSpritesA
  4942. Flower_A0
  4943. .byte $00 ; |........|
  4944. .byte $00 ; |........|
  4945. .byte $00 ; |........|
  4946. .byte $0A ; |....X.X.|
  4947. .byte $1A ; |...XX.X.|
  4948. .byte $76 ; |.XXX.XX.|
  4949. .byte $3A ; |..XXX.X.|
  4950. Flower_A1
  4951. .byte $00 ; |........|
  4952. .byte $00 ; |........|
  4953. .byte $1C ; |...XXX..|
  4954. .byte $1C ; |...XXX..|
  4955. .byte $20 ; |..X.....|
  4956. .byte $1C ; |...XXX..|
  4957. .byte $38 ; |..XXX...|
  4958. Flower_A2
  4959. .byte $00 ; |........|
  4960. .byte $14 ; |...X.X..|
  4961. .byte $1C ; |...XXX..|
  4962. .byte $10 ; |...X....|
  4963. .byte $1C ; |...XXX..|
  4964. .byte $10 ; |...X....|
  4965. .byte $18 ; |...XX...|
  4966. Flower_A3
  4967. .byte $14 ; |...X.X..|
  4968. .byte $1C ; |...XXX..|
  4969. .byte $14 ; |...X.X..|
  4970. .byte $08 ; |....X...|
  4971. .byte $0C ; |....XX..|
  4972. .byte $08 ; |....X...|
  4973. .byte $18 ; |...XX...|
  4974.  
  4975. FlowerSpritesB
  4976. Flower_B0
  4977. .byte $00 ; |........|
  4978. .byte $00 ; |........|
  4979. .byte $00 ; |........|
  4980. .byte $0D ; |....XX.X|
  4981. .byte $07 ; |.....XXX|
  4982. .byte $40 ; |.X......|
  4983. .byte $08 ; |....X...|
  4984. Flower_B1
  4985. .byte $00 ; |........|
  4986. .byte $00 ; |........|
  4987. .byte $2A ; |..X.X.X.|
  4988. .byte $0A ; |....X.X.|
  4989. .byte $20 ; |..X.....|
  4990. .byte $0A ; |....X.X.|
  4991. .byte $08 ; |....X...|
  4992. Flower_B2
  4993. .byte $00 ; |........|
  4994. .byte $2A ; |..X.X.X.|
  4995. .byte $2A ; |..X.X.X.|
  4996. .byte $10 ; |...X....|
  4997. .byte $12 ; |...X..X.|
  4998. .byte $28 ; |..X.X...|
  4999. .byte $08 ; |....X...|
  5000. Flower_B3
  5001. .byte $2A ; |..X.X.X.|
  5002. .byte $2A ; |..X.X.X.|
  5003. .byte $08 ; |....X...|
  5004. .byte $0A ; |....X.X.|
  5005. .byte $08 ; |....X...|
  5006. .byte $28 ; |..X.X...|
  5007. .byte $08 ; |....X...|
  5008.  
  5009. FlowerColors
  5010. .byte BROWN+14,BROWN+14,BROWN+12,ORANGE+10
  5011. .byte ORANGE+8,ORANGE+6,ORANGE+4
  5012.  
  5013. EasterEggSpriteValues
  5014. .byte SHOW_YAR_SPRITE, SHOW_INDY_SPRITE
  5015.  
  5016. BOUNDARY 0
  5017.  
  5018. NumberFonts
  5019. zero
  5020. .byte $FE ; |XXXXXXX.|
  5021. .byte $86 ; |X....XX.|
  5022. .byte $86 ; |X....XX.|
  5023. .byte $86 ; |X....XX.|
  5024. .byte $82 ; |X.....X.|
  5025. .byte $82 ; |X.....X.|
  5026. .byte $FE ; |XXXXXXX.|
  5027. .byte $00 ; |........|
  5028. one
  5029. .byte $18 ; |...XX...|
  5030. .byte $18 ; |...XX...|
  5031. .byte $18 ; |...XX...|
  5032. .byte $18 ; |...XX...|
  5033. .byte $08 ; |....X...|
  5034. .byte $08 ; |....X...|
  5035. .byte $08 ; |....X...|
  5036. .byte $00 ; |........|
  5037. two
  5038. .byte $FE ; |XXXXXXX.|
  5039. .byte $C0 ; |XX......|
  5040. .byte $C0 ; |XX......|
  5041. .byte $FE ; |XXXXXXX.|
  5042. .byte $02 ; |......X.|
  5043. .byte $82 ; |X.....X.|
  5044. .byte $FE ; |XXXXXXX.|
  5045. .byte $00 ; |........|
  5046. three
  5047. .byte $FE ; |XXXXXXX.|
  5048. .byte $86 ; |X....XX.|
  5049. .byte $06 ; |.....XX.|
  5050. .byte $7E ; |.XXXXXX.|
  5051. .byte $02 ; |......X.|
  5052. .byte $82 ; |X.....X.|
  5053. .byte $FE ; |XXXXXXX.|
  5054. .byte $00 ; |........|
  5055. four
  5056. .byte $06 ; |.....XX.|
  5057. .byte $06 ; |.....XX.|
  5058. .byte $FE ; |XXXXXXX.|
  5059. .byte $82 ; |X.....X.|
  5060. .byte $82 ; |X.....X.|
  5061. .byte $80 ; |X.......|
  5062. .byte $80 ; |X.......|
  5063. .byte $00 ; |........|
  5064. five
  5065. .byte $FE ; |XXXXXXX.|
  5066. .byte $86 ; |X....XX.|
  5067. .byte $06 ; |.....XX.|
  5068. .byte $FE ; |XXXXXXX.|
  5069. .byte $80 ; |X.......|
  5070. .byte $82 ; |X.....X.|
  5071. .byte $FE ; |XXXXXXX.|
  5072. .byte $00 ; |........|
  5073. six
  5074. .byte $FE ; |XXXXXXX.|
  5075. .byte $86 ; |X....XX.|
  5076. .byte $86 ; |X....XX.|
  5077. .byte $FE ; |XXXXXXX.|
  5078. .byte $80 ; |X.......|
  5079. .byte $88 ; |X...X...|
  5080. .byte $F8 ; |XXXXX...|
  5081. .byte $00 ; |........|
  5082. seven
  5083. .byte $06 ; |.....XX.|
  5084. .byte $06 ; |.....XX.|
  5085. .byte $06 ; |.....XX.|
  5086. .byte $06 ; |.....XX.|
  5087. .byte $02 ; |......X.|
  5088. .byte $02 ; |......X.|
  5089. .byte $FE ; |XXXXXXX.|
  5090. .byte $00 ; |........|
  5091. eight
  5092. .byte $FE ; |XXXXXXX.|
  5093. .byte $82 ; |X.....X.|
  5094. .byte $82 ; |X.....X.|
  5095. .byte $FE ; |XXXXXXX.|
  5096. .byte $44 ; |.X...X..|
  5097. .byte $44 ; |.X...X..|
  5098. .byte $7C ; |.XXXXX..|
  5099. .byte $00 ; |........|
  5100. nine
  5101. .byte $06 ; |.....XX.|
  5102. .byte $06 ; |.....XX.|
  5103. .byte $06 ; |.....XX.|
  5104. .byte $FE ; |XXXXXXX.|
  5105. .byte $82 ; |X.....X.|
  5106. .byte $82 ; |X.....X.|
  5107. .byte $FE ; |XXXXXXX.|
  5108. .byte $00 ; |........|
  5109. Blank
  5110. .byte $00 ; |........|
  5111. .byte $00 ; |........|
  5112. .byte $00 ; |........|
  5113. .byte $00 ; |........|
  5114. .byte $00 ; |........|
  5115. .byte $00 ; |........|
  5116. .byte $00 ; |........|
  5117. .byte $00 ; |........|
  5118.  
  5119. HSWInitials
  5120. .byte $07 ; |.....XXX|
  5121. .byte $01 ; |.......X|
  5122. .byte $57 ; |.X.X.XXX|
  5123. .byte $54 ; |.X.X.X..|
  5124. .byte $77 ; |.XXX.XXX|
  5125. .byte $50 ; |.X.X....|
  5126. .byte $50 ; |.X.X....|
  5127. .byte $00 ; |........|
  5128.  
  5129. .byte $07 ; |.....XXX|
  5130. .byte $55 ; |.X.X.X.X|
  5131. .byte $71 ; |.XXX...X|
  5132. .byte $73 ; |.XXX..XX|
  5133. .byte $51 ; |.X.X...X|
  5134. .byte $55 ; |.X.X.X.X|
  5135. .byte $57 ; |.X.X.XXX|
  5136. .byte $00 ; |........|
  5137.  
  5138. ElliottSprites
  5139. Elliott_0
  5140. .byte $10 ; |...X....|
  5141. .byte $38 ; |..XXX...|
  5142. .byte $18 ; |...XX...|
  5143. .byte $30 ; |..XX....|
  5144. .byte $7C ; |.XXXXX..|
  5145. .byte $D8 ; |XX.XX...|
  5146. .byte $38 ; |..XXX...|
  5147. .byte $38 ; |..XXX...|
  5148. .byte $EC ; |XXX.XX..|
  5149. .byte $82 ; |X.....X.|
  5150. .byte $84 ; |X....X..|
  5151. Elliott_1
  5152. .byte $10 ; |...X....|
  5153. .byte $38 ; |..XXX...|
  5154. .byte $18 ; |...XX...|
  5155. .byte $30 ; |..XX....|
  5156. .byte $78 ; |.XXXX...|
  5157. .byte $5C ; |.X.XXX..|
  5158. .byte $38 ; |..XXX...|
  5159. .byte $38 ; |..XXX...|
  5160. .byte $6C ; |.XX.XX..|
  5161. .byte $60 ; |.XX.....|
  5162. .byte $06 ; |.....XX.|
  5163. Elliott_2
  5164. .byte $00 ; |........|
  5165. .byte $38 ; |..XXX...|
  5166. .byte $38 ; |..XXX...|
  5167. .byte $00 ; |........|
  5168. .byte $78 ; |.XXXX...|
  5169. .byte $38 ; |..XXX...|
  5170. .byte $78 ; |.XXXX...|
  5171. .byte $18 ; |...XX...|
  5172. .byte $38 ; |..XXX...|
  5173. .byte $20 ; |..X.....|
  5174. .byte $38 ; |..XXX...|
  5175. Elliott_3
  5176. .byte $00 ; |........|
  5177. .byte $38 ; |..XXX...|
  5178. .byte $38 ; |..XXX...|
  5179. .byte $00 ; |........|
  5180. .byte $38 ; |..XXX...|
  5181. .byte $38 ; |..XXX...|
  5182. .byte $38 ; |..XXX...|
  5183. .byte $18 ; |...XX...|
  5184. .byte $30 ; |..XX....|
  5185. .byte $78 ; |.XXXX...|
  5186. .byte $00 ; |........|
  5187. Elliott_4
  5188. .byte $10 ; |...X....|
  5189. .byte $38 ; |..XXX...|
  5190. .byte $18 ; |...XX...|
  5191. .byte $30 ; |..XX....|
  5192. .byte $38 ; |..XXX...|
  5193. .byte $78 ; |.XXXX...|
  5194. .byte $38 ; |..XXX...|
  5195. .byte $38 ; |..XXX...|
  5196. .byte $68 ; |.XX.X...|
  5197. .byte $CC ; |XX..XX..|
  5198. .byte $00 ; |........|
  5199. Elliott_5
  5200. .byte $10 ; |...X....|
  5201. .byte $38 ; |..XXX...|
  5202. .byte $18 ; |...XX...|
  5203. .byte $30 ; |..XX....|
  5204. .byte $78 ; |.XXXX...|
  5205. .byte $DC ; |XX.XXX..|
  5206. .byte $38 ; |..XXX...|
  5207. .byte $18 ; |...XX...|
  5208. .byte $68 ; |.XX.X...|
  5209. .byte $CC ; |XX..XX..|
  5210.  
  5211. ElliottColors_A
  5212. .byte BLACK,BLACK,ORANGE_2+8,RED+10,RED+10,RED+10,LT_BLUE+10
  5213. .byte LT_BLUE+10,LT_BLUE+10,DK_GREEN_2+14,DK_GREEN_2+14
  5214.  
  5215. Elliott_6
  5216. .byte $38 ; |..XXX...|
  5217. .byte $38 ; |..XXX...|
  5218. .byte $00 ; |........|
  5219. .byte $78 ; |.XXXX...|
  5220. .byte $5C ; |.X.XXX..|
  5221. .byte $B8 ; |X.XXX...|
  5222. .byte $38 ; |..XXX...|
  5223. .byte $68 ; |.XX.X...|
  5224. .byte $CC ; |XX..XX..|
  5225. .byte $86 ; |X....XX.|
  5226. .byte $00 ; |........|
  5227. Elliott_7
  5228. .byte $38 ; |..XXX...|
  5229. .byte $38 ; |..XXX...|
  5230. .byte $00 ; |........|
  5231. .byte $78 ; |.XXXX...|
  5232. .byte $5C ; |.X.XXX..|
  5233. .byte $78 ; |.XXXX...|
  5234. .byte $18 ; |...XX...|
  5235. .byte $78 ; |.XXXX...|
  5236. .byte $60 ; |.XX.....|
  5237. .byte $06 ; |.....XX.|
  5238. .byte $00 ; |........|
  5239. Elliott_8
  5240. .byte $10 ; |...X....|
  5241. .byte $38 ; |..XXX...|
  5242. .byte $18 ; |...XX...|
  5243. .byte $38 ; |..XXX...|
  5244. .byte $78 ; |.XXXX...|
  5245. .byte $78 ; |.XXXX...|
  5246. .byte $38 ; |..XXX...|
  5247. .byte $38 ; |..XXX...|
  5248. .byte $28 ; |..X.X...|
  5249. .byte $38 ; |..XXX...|
  5250. .byte $00 ; |........|
  5251. Elliott_9
  5252. .byte $10 ; |...X....|
  5253. .byte $38 ; |..XXX...|
  5254. .byte $18 ; |...XX...|
  5255. .byte $30 ; |..XX....|
  5256. .byte $38 ; |..XXX...|
  5257. .byte $30 ; |..XX....|
  5258. .byte $38 ; |..XXX...|
  5259. .byte $18 ; |...XX...|
  5260. .byte $30 ; |..XX....|
  5261. .byte $60 ; |.XX.....|
  5262. .byte $00 ; |........|
  5263. Elliott_10
  5264. .byte $38 ; |..XXX...|
  5265. .byte $38 ; |..XXX...|
  5266. .byte $00 ; |........|
  5267. .byte $38 ; |..XXX...|
  5268. .byte $78 ; |.XXXX...|
  5269. .byte $38 ; |..XXX...|
  5270. .byte $18 ; |...XX...|
  5271. .byte $28 ; |..X.X...|
  5272. .byte $0C ; |....XX..|
  5273. .byte $C0 ; |XX......|
  5274. .byte $00 ; |........|
  5275. Elliott_11
  5276. .byte $38 ; |..XXX...|
  5277. .byte $38 ; |..XXX...|
  5278. .byte $00 ; |........|
  5279. .byte $78 ; |.XXXX...|
  5280. .byte $5C ; |.X.XXX..|
  5281. .byte $B8 ; |X.XXX...|
  5282. .byte $18 ; |...XX...|
  5283. .byte $30 ; |..XX....|
  5284. .byte $CC ; |XX..XX..|
  5285. .byte $CC ; |XX..XX..|
  5286.  
  5287. ElliottColors_B
  5288. .byte BLACK,ORANGE_2+8,RED+4,RED+4,RED+4,LT_BLUE+10,LT_BLUE+10
  5289. .byte LT_BLUE+10,LT_BLUE+10,DK_GREEN_2+14,DK_GREEN_2+14
  5290.  
  5291. FourDiamondPitGraphics
  5292. FourDiamondPitPF1Graphics
  5293. .byte $00 ; |........|
  5294. .byte $00 ; |........|
  5295. .byte $00 ; |........|
  5296. .byte $00 ; |........|
  5297. .byte $00 ; |........|
  5298. .byte $00 ; |........|
  5299. .byte $00 ; |........|
  5300. .byte $00 ; |........|
  5301. .byte $00 ; |........|
  5302. .byte $00 ; |........|
  5303. .byte $00 ; |........|
  5304. .byte $01 ; |.......X|
  5305. .byte $03 ; |......XX|
  5306. .byte $07 ; |.....XXX|
  5307. .byte $0F ; |....XXXX|
  5308. .byte $1F ; |...XXXXX|
  5309. .byte $1F ; |...XXXXX|
  5310. .byte $0F ; |....XXXX|
  5311. .byte $07 ; |.....XXX|
  5312. .byte $03 ; |......XX|
  5313. .byte $01 ; |.......X|
  5314. .byte $00 ; |........|
  5315. .byte $00 ; |........|
  5316. .byte $00 ; |........|
  5317. .byte $00 ; |........|
  5318. .byte $00 ; |........|
  5319. .byte $00 ; |........|
  5320. .byte $00 ; |........|
  5321. .byte $00 ; |........|
  5322. .byte $00 ; |........|
  5323. .byte $00 ; |........|
  5324. .byte $00 ; |........|
  5325. .byte $00 ; |........|
  5326. .byte $00 ; |........|
  5327. .byte $00 ; |........|
  5328. .byte $00 ; |........|
  5329. .byte $00 ; |........|
  5330. .byte $00 ; |........|
  5331. .byte $00 ; |........|
  5332. .byte $00 ; |........|
  5333. .byte $00 ; |........|
  5334. .byte $00 ; |........|
  5335. .byte $00 ; |........|
  5336. .byte $01 ; |.......X|
  5337. .byte $03 ; |......XX|
  5338. .byte $07 ; |.....XXX|
  5339. .byte $0F ; |....XXXX|
  5340. .byte $1F ; |...XXXXX|
  5341. .byte $1F ; |...XXXXX|
  5342. .byte $0F ; |....XXXX|
  5343. .byte $07 ; |.....XXX|
  5344. .byte $03 ; |......XX|
  5345. .byte $01 ; |.......X|
  5346. .byte $00 ; |........|
  5347. .byte $00 ; |........|
  5348. .byte $00 ; |........|
  5349.  
  5350. EightPitGraphics
  5351. .byte $00 ; |........|
  5352. .byte $00 ; |........|
  5353. .byte $00 ; |........|
  5354. .byte $00 ; |........|
  5355. .byte $00 ; |........|
  5356. .byte $00 ; |........|
  5357. .byte $00 ; |........|
  5358. .byte $00 ; |........|
  5359. .byte $C0 ; |XX......|
  5360. .byte $F0 ; |XXXX....|
  5361. .byte $F8 ; |XXXXX...|
  5362. .byte $F8 ; |XXXXX...|
  5363. .byte $F8 ; |XXXXX...|
  5364. .byte $E0 ; |XXX.....|
  5365. .byte $80 ; |X.......|
  5366. .byte $00 ; |........|
  5367. .byte $00 ; |........|
  5368. .byte $00 ; |........|
  5369. .byte $00 ; |........|
  5370. .byte $00 ; |........|
  5371. .byte $00 ; |........|
  5372. .byte $00 ; |........|
  5373. .byte $00 ; |........|
  5374. .byte $00 ; |........|
  5375. .byte $00 ; |........|
  5376. .byte $00 ; |........|
  5377. .byte $00 ; |........|
  5378. .byte $00 ; |........|
  5379. .byte $01 ; |.......X|
  5380. .byte $03 ; |......XX|
  5381. .byte $07 ; |.....XXX|
  5382. .byte $0F ; |....XXXX|
  5383. .byte $0F ; |....XXXX|
  5384. .byte $07 ; |.....XXX|
  5385. .byte $03 ; |......XX|
  5386. .byte $01 ; |.......X|
  5387. .byte $00 ; |........|
  5388. .byte $00 ; |........|
  5389. .byte $00 ; |........|
  5390. .byte $00 ; |........|
  5391. .byte $00 ; |........|
  5392. .byte $00 ; |........|
  5393. .byte $00 ; |........|
  5394. .byte $00 ; |........|
  5395. .byte $00 ; |........|
  5396. .byte $00 ; |........|
  5397. .byte $00 ; |........|
  5398. .byte $00 ; |........|
  5399. .byte $00 ; |........|
  5400. .byte $80 ; |X.......|
  5401. .byte $E0 ; |XXX.....|
  5402. .byte $F8 ; |XXXXX...|
  5403. .byte $F8 ; |XXXXX...|
  5404. .byte $F8 ; |XXXXX...|
  5405. .byte $F0 ; |XXXX....|
  5406. .byte $C0 ; |XX......|
  5407.  
  5408. ArrowPitGraphics
  5409. ArrowPitPF1Graphics
  5410. .byte $00 ; |........|
  5411. .byte $00 ; |........|
  5412. .byte $00 ; |........|
  5413. .byte $00 ; |........|
  5414. .byte $00 ; |........|
  5415. .byte $00 ; |........|
  5416. .byte $00 ; |........|
  5417. .byte $00 ; |........|
  5418. .byte $00 ; |........|
  5419. .byte $00 ; |........|
  5420. .byte $00 ; |........|
  5421. .byte $00 ; |........|
  5422. .byte $00 ; |........|
  5423. .byte $00 ; |........|
  5424. .byte $00 ; |........|
  5425. .byte $00 ; |........|
  5426. .byte $00 ; |........|
  5427. .byte $00 ; |........|
  5428. .byte $01 ; |.......X|
  5429. .byte $03 ; |......XX|
  5430. .byte $07 ; |.....XXX|
  5431. .byte $0F ; |....XXXX|
  5432. .byte $07 ; |.....XXX|
  5433. .byte $03 ; |......XX|
  5434. .byte $01 ; |.......X|
  5435. .byte $00 ; |........|
  5436. .byte $00 ; |........|
  5437. .byte $00 ; |........|
  5438. .byte $00 ; |........|
  5439. .byte $00 ; |........|
  5440. .byte $00 ; |........|
  5441. .byte $00 ; |........|
  5442. .byte $00 ; |........|
  5443. .byte $00 ; |........|
  5444. .byte $00 ; |........|
  5445. .byte $00 ; |........|
  5446. .byte $00 ; |........|
  5447. .byte $00 ; |........|
  5448. .byte $00 ; |........|
  5449. .byte $00 ; |........|
  5450. .byte $00 ; |........|
  5451. .byte $00 ; |........|
  5452. .byte $00 ; |........|
  5453. .byte $01 ; |.......X|
  5454. .byte $07 ; |.....XXX|
  5455. .byte $0F ; |....XXXX|
  5456. .byte $07 ; |.....XXX|
  5457. .byte $01 ; |.......X|
  5458. ArrowPitPF2Graphics
  5459. .byte $00 ; |........|
  5460. .byte $00 ; |........|
  5461. .byte $00 ; |........|
  5462. .byte $00 ; |........|
  5463. .byte $00 ; |........|
  5464. .byte $00 ; |........|
  5465. .byte $00 ; |........|
  5466. .byte $00 ; |........|
  5467. .byte $00 ; |........|
  5468. .byte $00 ; |........|
  5469. .byte $00 ; |........|
  5470. .byte $00 ; |........|
  5471. .byte $00 ; |........|
  5472. .byte $00 ; |........|
  5473. .byte $00 ; |........|
  5474. .byte $00 ; |........|
  5475. .byte $0F ; |....XXXX|
  5476. .byte $0F ; |....XXXX|
  5477. .byte $07 ; |.....XXX|
  5478. .byte $03 ; |......XX|
  5479. .byte $01 ; |.......X|
  5480. .byte $00 ; |........|
  5481. .byte $01 ; |.......X|
  5482. .byte $03 ; |......XX|
  5483. .byte $07 ; |.....XXX|
  5484. .byte $0F ; |....XXXX|
  5485. .byte $0F ; |....XXXX|
  5486. .byte $00 ; |........|
  5487. .byte $00 ; |........|
  5488. .byte $00 ; |........|
  5489. .byte $00 ; |........|
  5490. .byte $00 ; |........|
  5491. .byte $00 ; |........|
  5492. .byte $00 ; |........|
  5493. .byte $00 ; |........|
  5494. .byte $00 ; |........|
  5495. .byte $00 ; |........|
  5496. .byte $00 ; |........|
  5497. .byte $00 ; |........|
  5498. .byte $00 ; |........|
  5499. .byte $00 ; |........|
  5500. .byte $00 ; |........|
  5501. .byte $00 ; |........|
  5502. .byte $00 ; |........|
  5503. .byte $03 ; |......XX|
  5504. .byte $07 ; |.....XXX|
  5505. .byte $03 ; |......XX|
  5506. .byte $00 ; |........|
  5507. .byte $00 ; |........|
  5508. .byte $00 ; |........|
  5509. .byte $00 ; |........|
  5510. .byte $00 ; |........|
  5511. .byte $00 ; |........|
  5512. .byte $00 ; |........|
  5513. .byte $00 ; |........|
  5514. .byte $00 ; |........|
  5515. .byte $00 ; |........|
  5516. .byte $00 ; |........|
  5517. .byte $00 ; |........|
  5518. .byte $00 ; |........|
  5519. .byte $00 ; |........|
  5520. .byte $00 ; |........|
  5521. .byte $00 ; |........|
  5522. .byte $00 ; |........|
  5523. Telephone
  5524. .byte $3C ; |..XXXX..|
  5525. .byte $20 ; |..X.....|
  5526. .byte $3C ; |..XXXX..|
  5527. .byte $20 ; |..X.....|
  5528. .byte $3C ; |..XXXX..|
  5529. .byte $18 ; |...XX...|
  5530. .byte $DB ; |XX.XX.XX|
  5531. .byte $FF ; |XXXXXXXX|
  5532.  
  5533. TelephoneIconLSBPtrs
  5534. .byte <Telephone,<Telephone - 3,<Telephone - 5,<Telephone - 9
  5535.  
  5536. YarSprites
  5537. Yar_0
  5538. .byte $24 ; |..X..X..|
  5539. .byte $18 ; |...XX...|
  5540. .byte $24 ; |..X..X..|
  5541. .byte $24 ; |..X..X..|
  5542. .byte $7E ; |.XXXXXX.|
  5543. .byte $5A ; |.X.XX.X.|
  5544. .byte $DB ; |XX.XX.XX|
  5545. .byte $3C ; |..XXXX..|
  5546. Yar_1
  5547. .byte $24 ; |..X..X..|
  5548. .byte $99 ; |X..XX..X|
  5549. .byte $A5 ; |X.X..X.X|
  5550. .byte $E7 ; |XXX..XXX|
  5551. .byte $18 ; |...XX...|
  5552. .byte $18 ; |...XX...|
  5553. .byte $18 ; |...XX...|
  5554. .byte $3C ; |..XXXX..|
  5555.  
  5556. BOUNDARY 0
  5557.  
  5558. GameIcons
  5559. BlankIcon
  5560. .byte $00 ; |........|
  5561. .byte $00 ; |........|
  5562. .byte $00 ; |........|
  5563. .byte $00 ; |........|
  5564. .byte $00 ; |........|
  5565. .byte $00 ; |........|
  5566. .byte $00 ; |........|
  5567. .byte $00 ; |........|
  5568. WarpLeftIcon
  5569. .byte $18 ; |...XX...|
  5570. .byte $30 ; |..XX....|
  5571. .byte $60 ; |.XX.....|
  5572. .byte $FF ; |XXXXXXXX|
  5573. .byte $FF ; |XXXXXXXX|
  5574. .byte $60 ; |.XX.....|
  5575. .byte $30 ; |..XX....|
  5576. .byte $18 ; |...XX...|
  5577. WarpRightIcon
  5578. .byte $18 ; |...XX...|
  5579. .byte $0C ; |....XX..|
  5580. .byte $06 ; |.....XX.|
  5581. .byte $FF ; |XXXXXXXX|
  5582. .byte $FF ; |XXXXXXXX|
  5583. .byte $06 ; |.....XX.|
  5584. .byte $0C ; |....XX..|
  5585. WarpUpIcon
  5586. .byte $18 ; |...XX...|
  5587. .byte $18 ; |...XX...|
  5588. .byte $18 ; |...XX...|
  5589. .byte $18 ; |...XX...|
  5590. .byte $18 ; |...XX...|
  5591. .byte $DB ; |XX.XX.XX|
  5592. .byte $7E ; |.XXXXXX.|
  5593. .byte $3C ; |..XXXX..|
  5594. .byte $18 ; |...XX...|
  5595. WarpDownIcon
  5596. .byte $18 ; |...XX...|
  5597. .byte $3C ; |..XXXX..|
  5598. .byte $7E ; |.XXXXXX.|
  5599. .byte $DB ; |XX.XX.XX|
  5600. .byte $18 ; |...XX...|
  5601. .byte $18 ; |...XX...|
  5602. .byte $18 ; |...XX...|
  5603. .byte $18 ; |...XX...|
  5604. QuestionIcon
  5605. .byte $38 ; |..XXX...|
  5606. .byte $00 ; |........|
  5607. .byte $38 ; |..XXX...|
  5608. .byte $1C ; |...XXX..|
  5609. .byte $0E ; |....XXX.|
  5610. .byte $66 ; |.XX..XX.|
  5611. .byte $7E ; |.XXXXXX.|
  5612. .byte $3C ; |..XXXX..|
  5613. EatCandyIcon_0
  5614. .byte $00 ; |........|
  5615. .byte $7E ; |.XXXXXX.|
  5616. .byte $C3 ; |XX....XX|
  5617. .byte $99 ; |X..XX..X|
  5618. .byte $99 ; |X..XX..X|
  5619. .byte $C3 ; |XX....XX|
  5620. .byte $66 ; |.XX..XX.|
  5621. .byte $3C ; |..XXXX..|
  5622. WashingtonIcon
  5623. .byte $7F ; |.XXXXXXX|
  5624. .byte $7F ; |.XXXXXXX|
  5625. .byte $2A ; |..X.X.X.|
  5626. .byte $2A ; |..X.X.X.|
  5627. .byte $2A ; |..X.X.X.|
  5628. .byte $2A ; |..X.X.X.|
  5629. .byte $3E ; |..XXXXX.|
  5630. .byte $7F ; |.XXXXXXX|
  5631. CallElliottIcon
  5632. .byte $02 ; |......X.|
  5633. .byte $74 ; |.XXX.X..|
  5634. .byte $C0 ; |XX......|
  5635. .byte $F7 ; |XXXX.XXX|
  5636. .byte $D0 ; |XX.X....|
  5637. .byte $F4 ; |XXXX.X..|
  5638. .byte $62 ; |.XX...X.|
  5639. .byte $01 ; |.......X|
  5640. CallShipIcon
  5641. .byte $42 ; |.X....X.|
  5642. .byte $24 ; |..X..X..|
  5643. .byte $7E ; |.XXXXXX.|
  5644. .byte $BD ; |X.XXXX.X|
  5645. .byte $FF ; |XXXXXXXX|
  5646. .byte $5A ; |.X.XX.X.|
  5647. .byte $3C ; |..XXXX..|
  5648. .byte $24 ; |..X..X..|
  5649. LandingZoneIcon
  5650. .byte $00 ; |........|
  5651. .byte $7F ; |.XXXXXXX|
  5652. .byte $49 ; |.X..X..X|
  5653. .byte $5D ; |.X.XXX.X|
  5654. .byte $77 ; |.XXX.XXX|
  5655. .byte $5D ; |.X.XXX.X|
  5656. .byte $49 ; |.X..X..X|
  5657. .byte $7F ; |.XXXXXXX|
  5658. LevitateIcon
  5659. .byte $FF ; |XXXXXXXX|
  5660. .byte $00 ; |........|
  5661. .byte $18 ; |...XX...|
  5662. .byte $18 ; |...XX...|
  5663. .byte $18 ; |...XX...|
  5664. .byte $7E ; |.XXXXXX.|
  5665. .byte $3C ; |..XXXX..|
  5666. .byte $18 ; |...XX...|
  5667. ReviveFlowerIcon
  5668. .byte $00 ; |........|
  5669. .byte $3E ; |..XXXXX.|
  5670. .byte $63 ; |.XX...XX|
  5671. .byte $41 ; |.X.....X|
  5672. .byte $08 ; |....X...|
  5673. .byte $00 ; |........|
  5674. .byte $22 ; |..X...X.|
  5675. .byte $22 ; |..X...X.|
  5676.  
  5677. CountdownClockIcons
  5678. CountdownClock_0
  5679. .byte $00 ; |........|
  5680. .byte $00 ; |........|
  5681. .byte $00 ; |........|
  5682. .byte $00 ; |........|
  5683. .byte $00 ; |........|
  5684. .byte $10 ; |...X....|
  5685. .byte $30 ; |..XX....|
  5686. .byte $70 ; |.XXX....|
  5687. CountdownClock_1
  5688. .byte $00 ; |........|
  5689. .byte $00 ; |........|
  5690. .byte $00 ; |........|
  5691. .byte $00 ; |........|
  5692. .byte $E0 ; |XXX.....|
  5693. .byte $D0 ; |XX.X....|
  5694. .byte $B0 ; |X.XX....|
  5695. .byte $70 ; |.XXX....|
  5696. CountdownClock_2
  5697. .byte $00 ; |........|
  5698. .byte $80 ; |X.......|
  5699. .byte $C0 ; |XX......|
  5700. .byte $E0 ; |XXX.....|
  5701. .byte $E0 ; |XXX.....|
  5702. .byte $D0 ; |XX.X....|
  5703. .byte $B0 ; |X.XX....|
  5704. .byte $70 ; |.XXX....|
  5705. CountdownClock_3
  5706. .byte $70 ; |.XXX....|
  5707. .byte $B0 ; |X.XX....|
  5708. .byte $D0 ; |XX.X....|
  5709. .byte $E0 ; |XXX.....|
  5710. .byte $E0 ; |XXX.....|
  5711. .byte $D0 ; |XX.X....|
  5712. .byte $B0 ; |X.XX....|
  5713. .byte $70 ; |.XXX....|
  5714. CountdownClock_4
  5715. .byte $7E ; |.XXXXXX.|
  5716. .byte $BC ; |X.XXXX..|
  5717. .byte $D8 ; |XX.XX...|
  5718. .byte $E0 ; |XXX.....|
  5719. .byte $E0 ; |XXX.....|
  5720. .byte $D0 ; |XX.X....|
  5721. .byte $B0 ; |X.XX....|
  5722. .byte $70 ; |.XXX....|
  5723. CountdownClock_5
  5724. .byte $7E ; |.XXXXXX.|
  5725. .byte $BD ; |X.XXXX.X|
  5726. .byte $DB ; |XX.XX.XX|
  5727. .byte $E7 ; |XXX..XXX|
  5728. .byte $E0 ; |XXX.....|
  5729. .byte $D0 ; |XX.X....|
  5730. .byte $B0 ; |X.XX....|
  5731. .byte $70 ; |.XXX....|
  5732. CountdownClock_6
  5733. .byte $7E ; |.XXXXXX.|
  5734. .byte $BD ; |X.XXXX.X|
  5735. .byte $DB ; |XX.XX.XX|
  5736. .byte $E7 ; |XXX..XXX|
  5737. .byte $E7 ; |XXX..XXX|
  5738. .byte $D3 ; |XX.X..XX|
  5739. .byte $B1 ; |X.XX...X|
  5740. .byte $70 ; |.XXX....|
  5741. CountdownClock_7
  5742. .byte $7E ; |.XXXXXX.|
  5743. .byte $BD ; |X.XXXX.X|
  5744. .byte $DB ; |XX.XX.XX|
  5745. .byte $E7 ; |XXX..XXX|
  5746. .byte $E7 ; |XXX..XXX|
  5747. .byte $DB ; |XX.XX.XX|
  5748. .byte $BD ; |X.XXXX.X|
  5749. .byte $7E ; |.XXXXXX.|
  5750. EatCandyIcon_1
  5751. .byte $00 ; |........|
  5752. .byte $3C ; |..XXXX..|
  5753. .byte $7E ; |.XXXXXX.|
  5754. .byte $C3 ; |XX....XX|
  5755. .byte $7E ; |.XXXXXX.|
  5756. .byte $3C ; |..XXXX..|
  5757. .byte $18 ; |...XX...|
  5758. .byte $00 ; |........|
  5759.  
  5760. Copyright_0
  5761. .byte $79 ; |.XXXX..X|
  5762. .byte $85 ; |X....X.X|
  5763. .byte $B5 ; |X.XX.X.X|
  5764. .byte $A5 ; |X.X..X.X|
  5765. .byte $B5 ; |X.XX.X.X|
  5766. .byte $85 ; |X....X.X|
  5767. .byte $79 ; |.XXXX..X|
  5768. .byte $00 ; |........|
  5769. Copyright_1
  5770. .byte $17 ; |...X.XXX|
  5771. .byte $15 ; |...X.X.X|
  5772. .byte $15 ; |...X.X.X|
  5773. .byte $77 ; |.XXX.XXX|
  5774. .byte $55 ; |.X.X.X.X|
  5775. .byte $55 ; |.X.X.X.X|
  5776. .byte $77 ; |.XXX.XXX|
  5777. .byte $00 ; |........|
  5778. Copyright_2
  5779. .byte $71 ; |.XXX...X|
  5780. .byte $41 ; |.X.....X|
  5781. .byte $41 ; |.X.....X|
  5782. .byte $71 ; |.XXX...X|
  5783. .byte $11 ; |...X...X|
  5784. .byte $51 ; |.X.X...X|
  5785. .byte $70 ; |.XXX....|
  5786. .byte $00 ; |........|
  5787. Copyright_3
  5788. .byte $49 ; |.X..X..X|
  5789. .byte $49 ; |.X..X..X|
  5790. .byte $49 ; |.X..X..X|
  5791. .byte $C9 ; |XX..X..X|
  5792. .byte $49 ; |.X..X..X|
  5793. .byte $49 ; |.X..X..X|
  5794. .byte $BE ; |X.XXXXX.|
  5795. .byte $00 ; |........|
  5796. Copyright_4
  5797. .byte $55 ; |.X.X.X.X|
  5798. .byte $55 ; |.X.X.X.X|
  5799. .byte $55 ; |.X.X.X.X|
  5800. .byte $D9 ; |XX.XX..X|
  5801. .byte $55 ; |.X.X.X.X|
  5802. .byte $55 ; |.X.X.X.X|
  5803. .byte $99 ; |X..XX..X|
  5804. .byte $00 ; |........|
  5805.  
  5806. ArtistInitials
  5807. .byte $1E ; |...XXXX.|
  5808. .byte $1B ; |...XX.XX|
  5809. .byte $7B ; |.XXXX.XX|
  5810. .byte $DB ; |XX.XX.XX|
  5811. .byte $DB ; |XX.XX.XX|
  5812. .byte $1E ; |...XXXX.|
  5813. .byte $18 ; |...XX...|
  5814. .byte $18 ; |...XX...|
  5815.  
  5816. DetermineToShowArtistInitials
  5817. ldx #0
  5818. lda gameSelection ; get the current game selection
  5819. cmp currentScreenId ; compare with current screen id
  5820. bne .setArtistInitialFlag ; don't show "JD" initials if not the same
  5821. cmp collectedCandyPieces ; compare with candy pieces held by Elliott
  5822. bne .setArtistInitialFlag ; don't show "JD" initials if not the same
  5823. cmp currentObjectId
  5824. bne .setArtistInitialFlag
  5825. cmp #1 ; see if playing game selection 1
  5826. bne .setArtistInitialFlag ; don't show "JD" initials if not the same
  5827. lda heldCandyPieces ; get number of candy pieces held by E.T.
  5828. cmp #2 * 16 ; don't show "JD" initials if E.T. carrying
  5829. bcs .setArtistInitialFlag ; more than 1 piece of candy
  5830. dex ; x = -1
  5831. .setArtistInitialFlag
  5832. stx artistInitialFlag
  5833. rts
  5834.  
  5835. BOUNDARY 0
  5836.  
  5837. PitGraphics
  5838. PitPF1Graphics
  5839. .byte $00 ; |........|
  5840. .byte $00 ; |........|
  5841. .byte $00 ; |........|
  5842. .byte $00 ; |........|
  5843. .byte $00 ; |........|
  5844. .byte $00 ; |........|
  5845. .byte $00 ; |........|
  5846. .byte $80 ; |X.......|
  5847. .byte $80 ; |X.......|
  5848. .byte $80 ; |X.......|
  5849. .byte $80 ; |X.......|
  5850. .byte $80 ; |X.......|
  5851. .byte $C0 ; |XX......|
  5852. .byte $C0 ; |XX......|
  5853. .byte $C0 ; |XX......|
  5854. .byte $C0 ; |XX......|
  5855. .byte $C0 ; |XX......|
  5856. .byte $C0 ; |XX......|
  5857. .byte $C0 ; |XX......|
  5858. .byte $C0 ; |XX......|
  5859. .byte $C0 ; |XX......|
  5860. .byte $C0 ; |XX......|
  5861. .byte $C0 ; |XX......|
  5862. .byte $C0 ; |XX......|
  5863. .byte $C0 ; |XX......|
  5864. .byte $C0 ; |XX......|
  5865. .byte $C0 ; |XX......|
  5866. .byte $E0 ; |XXX.....|
  5867. .byte $E0 ; |XXX.....|
  5868. .byte $E0 ; |XXX.....|
  5869. .byte $E0 ; |XXX.....|
  5870. .byte $E0 ; |XXX.....|
  5871. .byte $E0 ; |XXX.....|
  5872. .byte $E0 ; |XXX.....|
  5873. .byte $E0 ; |XXX.....|
  5874. .byte $E0 ; |XXX.....|
  5875. .byte $E0 ; |XXX.....|
  5876. .byte $E0 ; |XXX.....|
  5877. .byte $E0 ; |XXX.....|
  5878. .byte $F0 ; |XXXX....|
  5879. .byte $F0 ; |XXXX....|
  5880. .byte $F0 ; |XXXX....|
  5881. .byte $F0 ; |XXXX....|
  5882. .byte $F0 ; |XXXX....|
  5883. .byte $F0 ; |XXXX....|
  5884. .byte $F0 ; |XXXX....|
  5885. .byte $F0 ; |XXXX....|
  5886. .byte $F8 ; |XXXXX...|
  5887.  
  5888. IF COMPILE_VERSION = NTSC
  5889.  
  5890. IndyColors
  5891.  
  5892. ENDIF
  5893.  
  5894. .byte NTSC_BROWN+8,NTSC_BROWN+8,NTSC_BROWN+8,NTSC_BROWN+12
  5895. .byte NTSC_BROWN+12,NTSC_BROWN+14,NTSC_BROWN+15,NTSC_BROWN+15
  5896. .byte NTSC_BROWN+15,NTSC_BROWN+15,NTSC_BROWN+15,NTSC_BROWN+15
  5897. .byte NTSC_BROWN+15,NTSC_BROWN+15,NTSC_BROWN+15,NTSC_BROWN+15
  5898.  
  5899. WashingtonDCGraphics
  5900. WashingtonPF2Graphics
  5901. .byte $00 ; |........|
  5902. .byte $00 ; |........|
  5903. .byte $00 ; |........|
  5904. .byte $00 ; |........|
  5905. .byte $00 ; |........|
  5906. .byte $00 ; |........|
  5907. .byte $00 ; |........|
  5908. .byte $00 ; |........|
  5909. .byte $00 ; |........|
  5910. .byte $1F ; |...XXXXX|
  5911. .byte $1F ; |...XXXXX|
  5912. .byte $00 ; |........|
  5913. .byte $1F ; |...XXXXX|
  5914. .byte $1F ; |...XXXXX|
  5915. .byte $04 ; |.....X..|
  5916. .byte $04 ; |.....X..|
  5917. .byte $04 ; |.....X..|
  5918. .byte $04 ; |.....X..|
  5919. .byte $04 ; |.....X..|
  5920. .byte $04 ; |.....X..|
  5921. .byte $04 ; |.....X..|
  5922. .byte $04 ; |.....X..|
  5923. .byte $04 ; |.....X..|
  5924. .byte $04 ; |.....X..|
  5925. .byte $04 ; |.....X..|
  5926. .byte $04 ; |.....X..|
  5927. .byte $0F ; |....XXXX|
  5928. .byte $1F ; |...XXXXX|
  5929. .byte $3F ; |..XXXXXX|
  5930. .byte $00 ; |........|
  5931. .byte $00 ; |........|
  5932. .byte $00 ; |........|
  5933. .byte $00 ; |........|
  5934. .byte $00 ; |........|
  5935. .byte $00 ; |........|
  5936. .byte $00 ; |........|
  5937. .byte $00 ; |........|
  5938. .byte $00 ; |........|
  5939. .byte $00 ; |........|
  5940. .byte $80 ; |X.......|
  5941. .byte $C0 ; |XX......|
  5942. .byte $E0 ; |XXX.....|
  5943. .byte $F0 ; |XXXX....|
  5944. .byte $F8 ; |XXXXX...|
  5945. .byte $FC ; |XXXXXX..|
  5946. .byte $F4 ; |XXXX.X..|
  5947. .byte $F0 ; |XXXX....|
  5948. .byte $F0 ; |XXXX....|
  5949. .byte $B0 ; |X.XX....|
  5950. .byte $B0 ; |X.XX....|
  5951. .byte $F0 ; |XXXX....|
  5952. .byte $B0 ; |X.XX....|
  5953. .byte $B0 ; |X.XX....|
  5954. .byte $F0 ; |XXXX....|
  5955. .byte $F0 ; |XXXX....|
  5956. .byte $F0 ; |XXXX....|
  5957. .byte $F0 ; |XXXX....|
  5958. WashingtonPF1Graphics
  5959. .byte $00 ; |........|
  5960. .byte $00 ; |........|
  5961. .byte $00 ; |........|
  5962. .byte $00 ; |........|
  5963. .byte $00 ; |........|
  5964. .byte $00 ; |........|
  5965. .byte $00 ; |........|
  5966. .byte $00 ; |........|
  5967. .byte $00 ; |........|
  5968. .byte $3F ; |..XXXXXX|
  5969. .byte $3F ; |..XXXXXX|
  5970. .byte $00 ; |........|
  5971. .byte $3F ; |..XXXXXX|
  5972. .byte $3F ; |..XXXXXX|
  5973. .byte $09 ; |....X..X|
  5974. .byte $09 ; |....X..X|
  5975. .byte $09 ; |....X..X|
  5976. .byte $09 ; |....X..X|
  5977. .byte $09 ; |....X..X|
  5978. .byte $09 ; |....X..X|
  5979. .byte $09 ; |....X..X|
  5980. .byte $09 ; |....X..X|
  5981. .byte $09 ; |....X..X|
  5982. .byte $09 ; |....X..X|
  5983. .byte $09 ; |....X..X|
  5984. .byte $09 ; |....X..X|
  5985. .byte $1F ; |...XXXXX|
  5986. .byte $3F ; |..XXXXXX|
  5987. .byte $7F ; |.XXXXXXX|
  5988. .byte $00 ; |........|
  5989. .byte $00 ; |........|
  5990. .byte $00 ; |........|
  5991. PitPF2Graphics
  5992. .byte $00 ; |........|
  5993. .byte $00 ; |........|
  5994. .byte $00 ; |........|
  5995. .byte $00 ; |........|
  5996. .byte $00 ; |........|
  5997. .byte $00 ; |........|
  5998. .byte $00 ; |........|
  5999. .byte $00 ; |........|
  6000. .byte $00 ; |........|
  6001. .byte $00 ; |........|
  6002. .byte $00 ; |........|
  6003. .byte $00 ; |........|
  6004. .byte $00 ; |........|
  6005. .byte $00 ; |........|
  6006. .byte $00 ; |........|
  6007. .byte $00 ; |........|
  6008. .byte $00 ; |........|
  6009. .byte $00 ; |........|
  6010. .byte $00 ; |........|
  6011. .byte $00 ; |........|
  6012. .byte $00 ; |........|
  6013. .byte $00 ; |........|
  6014. .byte $00 ; |........|
  6015. .byte $00 ; |........|
  6016. .byte $00 ; |........|
  6017. .byte $00 ; |........|
  6018. .byte $00 ; |........|
  6019. .byte $00 ; |........|
  6020. .byte $00 ; |........|
  6021. .byte $00 ; |........|
  6022. .byte $00 ; |........|
  6023. .byte $00 ; |........|
  6024. .byte $00 ; |........|
  6025. .byte $00 ; |........|
  6026. .byte $00 ; |........|
  6027. .byte $00 ; |........|
  6028. .byte $00 ; |........|
  6029. .byte $00 ; |........|
  6030. .byte $00 ; |........|
  6031. .byte $00 ; |........|
  6032. .byte $00 ; |........|
  6033. .byte $00 ; |........|
  6034. .byte $00 ; |........|
  6035. .byte $00 ; |........|
  6036. .byte $00 ; |........|
  6037. .byte $00 ; |........|
  6038. .byte $00 ; |........|
  6039. .byte $00 ; |........|
  6040. .byte $00 ; |........|
  6041. .byte $00 ; |........|
  6042. .byte $00 ; |........|
  6043. .byte $00 ; |........|
  6044. .byte $00 ; |........|
  6045. .byte $00 ; |........|
  6046. .byte $00 ; |........|
  6047. .byte $00 ; |........|
  6048.  
  6049. IF COMPILE_VERSION = NTSC
  6050.  
  6051. YarColor
  6052. .byte BROWN+15,BROWN+15,BROWN+15,BROWN+15
  6053. .byte BROWN+15,BROWN+15,BROWN+15,BROWN+15
  6054.  
  6055. ELSE
  6056.  
  6057. REPEAT 8
  6058.  
  6059. .byte -1
  6060.  
  6061. REPEND
  6062.  
  6063. ENDIF
  6064.  
  6065. PlayfieldColors
  6066. .byte GREEN_2,GREEN_2,GREEN_2,GREEN_2,GREEN_2
  6067. .byte BLACK+8,BLACK,DK_BLUE+2,BLACK
  6068.  
  6069. BackgroundColors
  6070. .byte DK_GREEN+4,DK_GREEN+4,DK_GREEN+4,DK_GREEN+4
  6071. .byte DK_GREEN+4,BLUE+4,BLACK+6,LT_BLUE,BLUE
  6072.  
  6073. CheckToFlyYarSprite
  6074. bit easterEggSpriteFlag ; check Easter Egg sprite flags
  6075. bpl .doneYarFlight ; branch if not showing special sprite
  6076. bvs .doneYarFlight ; branch if showing Indy sprite
  6077. ldx currentObjectVertPos ; get Yar's vertical position
  6078. bpl .moveYarUp
  6079. cpx #224
  6080. bcc .doneYarFlight
  6081. .moveYarUp
  6082. dec currentObjectVertPos
  6083. .doneYarFlight
  6084. rts
  6085.  
  6086. BOUNDARY 0
  6087.  
  6088. ScientistSprites
  6089. Scientist_0
  6090. .byte $1A ; |...XX.X.|
  6091. .byte $00 ; |........|
  6092. .byte $1C ; |...XXX..|
  6093. .byte $18 ; |...XX...|
  6094. .byte $3C ; |..XXXX..|
  6095. .byte $7C ; |.XXXXX..|
  6096. .byte $5E ; |.X.XXXX.|
  6097. .byte $16 ; |...X.XX.|
  6098. .byte $3C ; |..XXXX..|
  6099. .byte $7E ; |.XXXXXX.|
  6100. .byte $FE ; |XXXXXXX.|
  6101. .byte $FE ; |XXXXXXX.|
  6102. .byte $00 ; |........|
  6103. .byte $E7 ; |XXX..XXX|
  6104. Scientist_1
  6105. .byte $1A ; |...XX.X.|
  6106. .byte $00 ; |........|
  6107. .byte $1C ; |...XXX..|
  6108. .byte $18 ; |...XX...|
  6109. .byte $38 ; |..XXX...|
  6110. .byte $7C ; |.XXXXX..|
  6111. .byte $5C ; |.X.XXX..|
  6112. .byte $2E ; |..X.XXX.|
  6113. .byte $36 ; |..XX.XX.|
  6114. .byte $3C ; |..XXXX..|
  6115. .byte $7E ; |.XXXXXX.|
  6116. .byte $7E ; |.XXXXXX.|
  6117. .byte $00 ; |........|
  6118. .byte $7C ; |.XXXXX..|
  6119. Scientist_2
  6120. .byte $1A ; |...XX.X.|
  6121. .byte $00 ; |........|
  6122. .byte $1C ; |...XXX..|
  6123. .byte $18 ; |...XX...|
  6124. .byte $38 ; |..XXX...|
  6125. .byte $3C ; |..XXXX..|
  6126. .byte $2C ; |..X.XX..|
  6127. .byte $2C ; |..X.XX..|
  6128. .byte $3C ; |..XXXX..|
  6129. .byte $3C ; |..XXXX..|
  6130. .byte $3C ; |..XXXX..|
  6131. .byte $3C ; |..XXXX..|
  6132. .byte $00 ; |........|
  6133. .byte $3C ; |..XXXX..|
  6134. Scientist_3
  6135. .byte $1A ; |...XX.X.|
  6136. .byte $00 ; |........|
  6137. .byte $1C ; |...XXX..|
  6138. .byte $18 ; |...XX...|
  6139. .byte $38 ; |..XXX...|
  6140. .byte $7C ; |.XXXXX..|
  6141. .byte $7C ; |.XXXXX..|
  6142. .byte $6C ; |.XX.XX..|
  6143. .byte $38 ; |..XXX...|
  6144. .byte $3C ; |..XXXX..|
  6145. .byte $3C ; |..XXXX..|
  6146. .byte $3C ; |..XXXX..|
  6147. .byte $00 ; |........|
  6148. .byte $76 ; |.XXX.XX.|
  6149. Scientist_4
  6150. .byte $1A ; |...XX.X.|
  6151. .byte $00 ; |........|
  6152. .byte $1C ; |...XXX..|
  6153. .byte $18 ; |...XX...|
  6154. .byte $3C ; |..XXXX..|
  6155. .byte $7C ; |.XXXXX..|
  6156. .byte $5E ; |.X.XXXX.|
  6157. .byte $36 ; |..XX.XX.|
  6158. .byte $7C ; |.XXXXX..|
  6159. .byte $7C ; |.XXXXX..|
  6160. .byte $7C ; |.XXXXX..|
  6161. .byte $7C ; |.XXXXX..|
  6162. .byte $00 ; |........|
  6163. .byte $EE ; |XXX.XXX.|
  6164. Scientist_5
  6165. .byte $3E ; |..XXXXX.|
  6166. .byte $3C ; |..XXXX..|
  6167. .byte $1C ; |...XXX..|
  6168. .byte $38 ; |..XXX...|
  6169. .byte $7C ; |.XXXXX..|
  6170. .byte $7C ; |.XXXXX..|
  6171. .byte $2E ; |..X.XXX.|
  6172. .byte $3A ; |..XXX.X.|
  6173. .byte $3E ; |..XXXXX.|
  6174. .byte $7E ; |.XXXXXX.|
  6175. .byte $FE ; |XXXXXXX.|
  6176. .byte $FE ; |XXXXXXX.|
  6177. .byte $E6 ; |XXX..XX.|
  6178. .byte $C7 ; |XX...XXX|
  6179. Scientist_6
  6180. .byte $3E ; |..XXXXX.|
  6181. .byte $3C ; |..XXXX..|
  6182. .byte $1C ; |...XXX..|
  6183. .byte $38 ; |..XXX...|
  6184. .byte $7C ; |.XXXXX..|
  6185. .byte $7C ; |.XXXXX..|
  6186. .byte $7C ; |.XXXXX..|
  6187. .byte $3E ; |..XXXXX.|
  6188. .byte $3A ; |..XXX.X.|
  6189. .byte $7E ; |.XXXXXX.|
  6190. .byte $7E ; |.XXXXXX.|
  6191. .byte $7E ; |.XXXXXX.|
  6192. .byte $70 ; |.XXX....|
  6193. .byte $1C ; |...XXX..|
  6194. Scientist_7
  6195. .byte $3E ; |..XXXXX.|
  6196. .byte $3C ; |..XXXX..|
  6197. .byte $1C ; |...XXX..|
  6198. .byte $18 ; |...XX...|
  6199. .byte $38 ; |..XXX...|
  6200. .byte $3C ; |..XXXX..|
  6201. .byte $3C ; |..XXXX..|
  6202. .byte $3C ; |..XXXX..|
  6203. .byte $34 ; |..XX.X..|
  6204. .byte $38 ; |..XXX...|
  6205. .byte $3C ; |..XXXX..|
  6206. .byte $3C ; |..XXXX..|
  6207. .byte $3C ; |..XXXX..|
  6208. .byte $38 ; |..XXX...|
  6209. Scientist_8
  6210. .byte $3E ; |..XXXXX.|
  6211. .byte $3C ; |..XXXX..|
  6212. .byte $1C ; |...XXX..|
  6213. .byte $18 ; |...XX...|
  6214. .byte $7C ; |.XXXXX..|
  6215. .byte $7C ; |.XXXXX..|
  6216. .byte $5C ; |.X.XXX..|
  6217. .byte $34 ; |..XX.X..|
  6218. .byte $3C ; |..XXXX..|
  6219. .byte $3C ; |..XXXX..|
  6220. .byte $3C ; |..XXXX..|
  6221. .byte $3C ; |..XXXX..|
  6222. .byte $76 ; |.XXX.XX.|
  6223. .byte $70 ; |.XXX....|
  6224. Scientist_9
  6225. .byte $3E ; |..XXXXX.|
  6226. .byte $3C ; |..XXXX..|
  6227. .byte $1C ; |...XXX..|
  6228. .byte $38 ; |..XXX...|
  6229. .byte $7C ; |.XXXXX..|
  6230. .byte $7C ; |.XXXXX..|
  6231. .byte $6E ; |.XX.XXX.|
  6232. .byte $7A ; |.XXXX.X.|
  6233. .byte $7C ; |.XXXXX..|
  6234. .byte $7C ; |.XXXXX..|
  6235. .byte $7C ; |.XXXXX..|
  6236. .byte $7C ; |.XXXXX..|
  6237. .byte $EC ; |XXX.XX..|
  6238. .byte $CE ; |XX..XXX.|
  6239.  
  6240. ScientistColors_A
  6241. .byte LT_BLUE+8,RED_2+6,RED_2+6,RED_2+6,WHITE,WHITE-2,WHITE-4
  6242. .byte WHITE-4,WHITE-4,WHITE-4,WHITE-4,BLACK+8,BLACK,ORANGE+8
  6243. ScientistColors_B
  6244. .byte LT_BLUE+8,RED_2+6,RED_2+6,WHITE,WHITE-2,WHITE-4,WHITE-4
  6245. .byte WHITE-4,WHITE-4,WHITE-4,BLACK+8,BLACK+8,ORANGE+8,ORANGE+8
  6246.  
  6247. H_PhonePiece_0
  6248. .byte $90 ; |X..X....|
  6249. .byte $64 ; |.XX..X..|
  6250. .byte $3F ; |..XXXXXX|
  6251. .byte $64 ; |.XX..X..|
  6252. .byte $90 ; |X..X....|
  6253. H_PhonePiece_1
  6254. .byte $C8 ; |XX..X...|
  6255. .byte $32 ; |..XX..X.|
  6256. .byte $32 ; |..XX..X.|
  6257. .byte $C8 ; |XX..X...|
  6258. .byte $00 ; |........|
  6259.  
  6260. S_PhonePiece_0
  6261. .byte $1F ; |...XXXXX|
  6262. .byte $54 ; |.X.X.X..|
  6263. .byte $54 ; |.X.X.X..|
  6264. .byte $15 ; |...X.X.X|
  6265. .byte $7C ; |.XXXXX..|
  6266. S_PhonePiece_1
  6267. .byte $3E ; |..XXXXX.|
  6268. .byte $A8 ; |X.X.X...|
  6269. .byte $2A ; |..X.X.X.|
  6270. .byte $2A ; |..X.X.X.|
  6271. .byte $F8 ; |XXXXX...|
  6272.  
  6273. W_PhonePiece_0
  6274. .byte $3C ; |..XXXX..|
  6275. .byte $C0 ; |XX......|
  6276. .byte $AA ; |X.X.X.X.|
  6277. .byte $0E ; |....XXX.|
  6278. .byte $E0 ; |XXX.....|
  6279. W_PhonePiece_1
  6280. .byte $60 ; |.XX.....|
  6281. .byte $FE ; |XXXXXXX.|
  6282. .byte $FE ; |XXXXXXX.|
  6283. .byte $38 ; |..XXX...|
  6284. .byte $FF ; |XXXXXXXX|
  6285.  
  6286. PhonePieceColors_A
  6287. .byte BROWN+14,BROWN+10,BROWN+6,BROWN+4,BROWN+2
  6288. PhonePieceColors_B
  6289. .byte BROWN+12,BROWN+8,LT_BROWN_2+6,LT_BROWN_2+4,LT_BROWN_2+2
  6290.  
  6291. MotherShip
  6292. .byte $18 ; |...XX...|
  6293. .byte $3C ; |..XXXX..|
  6294. .byte $7E ; |.XXXXXX.|
  6295. .byte $FF ; |XXXXXXXX|
  6296. .byte $42 ; |.X....X.|
  6297. .byte $C3 ; |XX....XX|
  6298. .byte $42 ; |.X....X.|
  6299. .byte $C3 ; |XX....XX|
  6300. .byte $42 ; |.X....X.|
  6301. .byte $C3 ; |XX....XX|
  6302. .byte $42 ; |.X....X.|
  6303. .byte $C3 ; |XX....XX|
  6304. .byte $7E ; |.XXXXXX.|
  6305. .byte $5A ; |.X.XX.X.|
  6306. .byte $42 ; |.X....X.|
  6307. .byte $E7 ; |XXX..XXX|
  6308.  
  6309. MotherShipColors
  6310. .byte DK_PINK+8,DK_PINK+6,DK_PINK+4,DK_PINK+2,DK_PINK+4,DK_PINK+6,DK_PINK+8
  6311. .byte DK_PINK+6,DK_PINK+4,DK_PINK+2,DK_PINK+4,DK_PINK+6,DK_PINK+8,DK_PINK+6
  6312. .byte DK_PINK+4,DK_PINK+2,DK_PINK+4,DK_PINK+6,DK_PINK+8,DK_PINK+6,DK_PINK+4
  6313. .byte DK_PINK+2
  6314.  
  6315. IF COMPILE_VERSION = PAL
  6316.  
  6317. YarColor
  6318. IndyColors
  6319. .byte BROWN+12,BROWN+12,BROWN+12,BROWN+12,BROWN+12
  6320. .byte BROWN+12,BROWN+12,BROWN+12,BROWN+12,BROWN+12
  6321.  
  6322. ENDIF
  6323.  
  6324. BOUNDARY 0
  6325.  
  6326. ETHomePFGraphics
  6327. ETHomePF2Graphics
  6328. .byte $00 ; |........|
  6329. .byte $00 ; |........|
  6330. .byte $00 ; |........|
  6331. .byte $00 ; |........|
  6332. .byte $00 ; |........|
  6333. .byte $00 ; |........|
  6334. .byte $00 ; |........|
  6335. .byte $80 ; |X.......|
  6336. .byte $C0 ; |XX......|
  6337. .byte $E0 ; |XXX.....|
  6338. .byte $F0 ; |XXXX....|
  6339. .byte $F8 ; |XXXXX...|
  6340. .byte $FC ; |XXXXXX..|
  6341. .byte $F4 ; |XXXX.X..|
  6342. .byte $F0 ; |XXXX....|
  6343. .byte $F0 ; |XXXX....|
  6344. .byte $B0 ; |X.XX....|
  6345. .byte $B0 ; |X.XX....|
  6346. .byte $F0 ; |XXXX....|
  6347. .byte $B0 ; |X.XX....|
  6348. .byte $B0 ; |X.XX....|
  6349. .byte $F0 ; |XXXX....|
  6350. .byte $F0 ; |XXXX....|
  6351. .byte $F0 ; |XXXX....|
  6352. .byte $F0 ; |XXXX....|
  6353. ETHomePF1Graphics
  6354. .byte $00 ; |........|
  6355. .byte $00 ; |........|
  6356. .byte $00 ; |........|
  6357. .byte $00 ; |........|
  6358. .byte $00 ; |........|
  6359. .byte $00 ; |........|
  6360. .byte $00 ; |........|
  6361. .byte $00 ; |........|
  6362. .byte $00 ; |........|
  6363. .byte $00 ; |........|
  6364. .byte $00 ; |........|
  6365. .byte $00 ; |........|
  6366. .byte $00 ; |........|
  6367. .byte $00 ; |........|
  6368. .byte $00 ; |........|
  6369. .byte $00 ; |........|
  6370. .byte $00 ; |........|
  6371. .byte $00 ; |........|
  6372. .byte $00 ; |........|
  6373. .byte $00 ; |........|
  6374. .byte $00 ; |........|
  6375. .byte $00 ; |........|
  6376. .byte $00 ; |........|
  6377. .byte $00 ; |........|
  6378. .byte $00 ; |........|
  6379. .byte $00 ; |........|
  6380. .byte $00 ; |........|
  6381. .byte $00 ; |........|
  6382. .byte $00 ; |........|
  6383. .byte $00 ; |........|
  6384. .byte $00 ; |........|
  6385. .byte $00 ; |........|
  6386. .byte $00 ; |........|
  6387. .byte $00 ; |........|
  6388. .byte $00 ; |........|
  6389. .byte $00 ; |........|
  6390. .byte $00 ; |........|
  6391. .byte $00 ; |........|
  6392. .byte $00 ; |........|
  6393. .byte $00 ; |........|
  6394. .byte $00 ; |........|
  6395. .byte $00 ; |........|
  6396. .byte $00 ; |........|
  6397. .byte $00 ; |........|
  6398. .byte $00 ; |........|
  6399. .byte $00 ; |........|
  6400. .byte $00 ; |........|
  6401. .byte $00 ; |........|
  6402. .byte $00 ; |........|
  6403. .byte $00 ; |........|
  6404. .byte $00 ; |........|
  6405. .byte $00 ; |........|
  6406. .byte $00 ; |........|
  6407. .byte $00 ; |........|
  6408. .byte $00 ; |........|
  6409. .byte $00 ; |........|
  6410. .byte $00 ; |........|
  6411. .byte $00 ; |........|
  6412. .byte $00 ; |........|
  6413. .byte $00 ; |........|
  6414. .byte $00 ; |........|
  6415. .byte $00 ; |........|
  6416. .byte $00 ; |........|
  6417. .byte $00 ; |........|
  6418. .byte $00 ; |........|
  6419.  
  6420. FBIAgentSprites
  6421. FBIAgent_0
  6422. .byte $1C ; |...XXX..|
  6423. .byte $3E ; |..XXXXX.|
  6424. .byte $3C ; |..XXXX..|
  6425. .byte $1C ; |...XXX..|
  6426. .byte $6C ; |.XX.XX..|
  6427. .byte $78 ; |.XXXX...|
  6428. .byte $6E ; |.XX.XXX.|
  6429. .byte $7E ; |.XXXXXX.|
  6430. .byte $3E ; |..XXXXX.|
  6431. .byte $36 ; |..XX.XX.|
  6432. .byte $7E ; |.XXXXXX.|
  6433. .byte $FE ; |XXXXXXX.|
  6434. .byte $FE ; |XXXXXXX.|
  6435. .byte $E7 ; |XXX..XXX|
  6436. FBIAgent_1
  6437. .byte $38 ; |..XXX...|
  6438. .byte $7C ; |.XXXXX..|
  6439. .byte $78 ; |.XXXX...|
  6440. .byte $38 ; |..XXX...|
  6441. .byte $58 ; |.X.XX...|
  6442. .byte $70 ; |.XXX....|
  6443. .byte $7C ; |.XXXXX..|
  6444. .byte $6C ; |.XX.XX..|
  6445. .byte $7E ; |.XXXXXX.|
  6446. .byte $2E ; |..X.XXX.|
  6447. .byte $3E ; |..XXXXX.|
  6448. .byte $3E ; |..XXXXX.|
  6449. .byte $3E ; |..XXXXX.|
  6450. .byte $3E ; |..XXXXX.|
  6451. FBIAgent_2
  6452. .byte $38 ; |..XXX...|
  6453. .byte $7C ; |.XXXXX..|
  6454. .byte $78 ; |.XXXX...|
  6455. .byte $38 ; |..XXX...|
  6456. .byte $58 ; |.X.XX...|
  6457. .byte $F0 ; |XXXX....|
  6458. .byte $FC ; |XXXXXX..|
  6459. .byte $DC ; |XX.XXX..|
  6460. .byte $FC ; |XXXXXX..|
  6461. .byte $7C ; |.XXXXX..|
  6462. .byte $3C ; |..XXXX..|
  6463. .byte $3C ; |..XXXX..|
  6464. .byte $3C ; |..XXXX..|
  6465. .byte $3C ; |..XXXX..|
  6466. FBIAgent_3
  6467. .byte $1C ; |...XXX..|
  6468. .byte $3E ; |..XXXXX.|
  6469. .byte $3C ; |..XXXX..|
  6470. .byte $1C ; |...XXX..|
  6471. .byte $2C ; |..X.XX..|
  6472. .byte $78 ; |.XXXX...|
  6473. .byte $7E ; |.XXXXXX.|
  6474. .byte $6E ; |.XX.XXX.|
  6475. .byte $7E ; |.XXXXXX.|
  6476. .byte $36 ; |..XX.XX.|
  6477. .byte $7E ; |.XXXXXX.|
  6478. .byte $7E ; |.XXXXXX.|
  6479. .byte $7E ; |.XXXXXX.|
  6480. .byte $6E ; |.XX.XXX.|
  6481. FBIAgent_4
  6482. .byte $1C ; |...XXX..|
  6483. .byte $1C ; |...XXX..|
  6484. .byte $1C ; |...XXX..|
  6485. .byte $18 ; |...XX...|
  6486. .byte $76 ; |.XXX.XX.|
  6487. .byte $7E ; |.XXXXXX.|
  6488. .byte $76 ; |.XXX.XX.|
  6489. .byte $7C ; |.XXXXX..|
  6490. .byte $3A ; |..XXX.X.|
  6491. .byte $7E ; |.XXXXXX.|
  6492. .byte $FE ; |XXXXXXX.|
  6493. .byte $FE ; |XXXXXXX.|
  6494. .byte $C6 ; |XX...XX.|
  6495. .byte $E7 ; |XXX..XXX|
  6496. FBIAgent_5
  6497. .byte $38 ; |..XXX...|
  6498. .byte $38 ; |..XXX...|
  6499. .byte $38 ; |..XXX...|
  6500. .byte $30 ; |..XX....|
  6501. .byte $6C ; |.XX.XX..|
  6502. .byte $7C ; |.XXXXX..|
  6503. .byte $6C ; |.XX.XX..|
  6504. .byte $7C ; |.XXXXX..|
  6505. .byte $36 ; |..XX.XX.|
  6506. .byte $3E ; |..XXXXX.|
  6507. .byte $3E ; |..XXXXX.|
  6508. .byte $3E ; |..XXXXX.|
  6509. .byte $3C ; |..XXXX..|
  6510. .byte $3E ; |..XXXXX.|
  6511. FBIAgent_6
  6512. .byte $38 ; |..XXX...|
  6513. .byte $38 ; |..XXX...|
  6514. .byte $38 ; |..XXX...|
  6515. .byte $30 ; |..XX....|
  6516. .byte $EC ; |XXX.XX..|
  6517. .byte $FC ; |XXXXXX..|
  6518. .byte $FC ; |XXXXXX..|
  6519. .byte $FC ; |XXXXXX..|
  6520. .byte $FC ; |XXXXXX..|
  6521. .byte $1C ; |...XXX..|
  6522. .byte $3C ; |..XXXX..|
  6523. .byte $3C ; |..XXXX..|
  6524. .byte $38 ; |..XXX...|
  6525. .byte $3C ; |..XXXX..|
  6526. FBIAgent_7
  6527. .byte $1C ; |...XXX..|
  6528. .byte $1C ; |...XXX..|
  6529. .byte $1C ; |...XXX..|
  6530. .byte $18 ; |...XX...|
  6531. .byte $76 ; |.XXX.XX.|
  6532. .byte $7E ; |.XXXXXX.|
  6533. .byte $7E ; |.XXXXXX.|
  6534. .byte $74 ; |.XXX.X..|
  6535. .byte $7E ; |.XXXXXX.|
  6536. .byte $2E ; |..X.XXX.|
  6537. .byte $7E ; |.XXXXXX.|
  6538. .byte $7E ; |.XXXXXX.|
  6539. .byte $6C ; |.XX.XX..|
  6540. .byte $76 ; |.XXX.XX.|
  6541.  
  6542. FBIAgentColors_A
  6543. .byte LT_RED+8,LT_RED+8,RED_2+8,RED_2+8,LT_RED+10,LT_RED+10,LT_RED+10
  6544. .byte LT_RED+10,LT_RED+8,LT_RED+8,LT_RED+8,LT_RED+8,LT_RED+6,BLACK
  6545. FBIAgentColors_B
  6546. .byte LT_RED+8,BLACK,RED_2+8,LT_RED+10,LT_RED+10,LT_RED+10,LT_RED+10
  6547. .byte LT_RED+10,LT_RED+8,LT_RED+8,LT_RED+8,LT_RED+6,BLACK,BLACK
  6548.  
  6549. HumanHorizReflectionTable
  6550. .byte 28,60,94
  6551.  
  6552. IndySprite
  6553. .byte $18 ; |...XX...|
  6554. .byte $3C ; |..XXXX..|
  6555. .byte $00 ; |........|
  6556. .byte $18 ; |...XX...|
  6557. .byte $3C ; |..XXXX..|
  6558. .byte $5A ; |.X.XX.X.|
  6559. .byte $3C ; |..XXXX..|
  6560. .byte $18 ; |...XX...|
  6561. .byte $18 ; |...XX...|
  6562. .byte $3C ; |..XXXX..|
  6563.  
  6564. IF COMPILE_VERSION = NTSC
  6565.  
  6566. .org BANK1TOP + 4096 - 6, 0
  6567.  
  6568. ELSE
  6569.  
  6570. .org BANK1TOP + 4096 - 8, 0
  6571. .byte -1, 0
  6572.  
  6573. ENDIF
  6574.  
  6575. .word BANK1Start
  6576. .word BANK1Start
  6577. .word BANK1Start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement