From 4202bbc3b6a6c397ad409bfcc9f211f9cbe79ac8 Mon Sep 17 00:00:00 2001 From: Theron Spiegl Date: Wed, 8 Jan 2020 19:04:01 -0600 Subject: [PATCH] fixed mario pipe bug by fixing overflow in add_offset_to_pc(), fixed pushed address in BRK instruction, and cleaned up. --- README.md | 4 - SMBDIS.ASM | 16352 ----------------------------------------- dump | 3076 -------- src/audio.rs | 2 +- src/cpu/mod.rs | 111 +- src/cpu/opcodes.rs | 52 +- src/cpu/utility.rs | 12 +- src/main.rs | 90 +- verticalPipeEntryLog | 1200 --- 9 files changed, 75 insertions(+), 20824 deletions(-) delete mode 100644 SMBDIS.ASM delete mode 100644 dump delete mode 100644 verticalPipeEntryLog diff --git a/README.md b/README.md index d5c96fe..1346fac 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,10 @@ This is an NES emulator and a work in progress. The CPU and PPU work, though the - One dependency (SDL) -- One line of `unsafe` (`std::mem::transmute::() -> i8`) - - NTSC timing -(Warning: this pipe currently takes you to an empty room, it's not the only one, and I don't know why.) - ## Controls: ``` Button | Key diff --git a/SMBDIS.ASM b/SMBDIS.ASM deleted file mode 100644 index 7e8e977..0000000 --- a/SMBDIS.ASM +++ /dev/null @@ -1,16352 +0,0 @@ -;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY -;by doppelganger (doppelheathen@gmail.com) - -;This file is provided for your own use as-is. It will require the character rom data -;and an iNES file header to get it to work. - -;There are so many people I have to thank for this, that taking all the credit for -;myself would be an unforgivable act of arrogance. Without their help this would -;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into -;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no -;way I could have done this without your help), as well as the authors of x816 and SMB -;Utility, and the reverse-engineers who did the original Super Mario Bros. Hacking Project, -;which I compared notes with but did not copy from. Last but certainly not least, I thank -;Nintendo for creating this game and the NES, without which this disassembly would -;only be theory. - -;Assembles with x816. - -;------------------------------------------------------------------------------------- -;DEFINES - -;NES specific hardware defines - -PPU_CTRL_REG1 = $2000 -PPU_CTRL_REG2 = $2001 -PPU_STATUS = $2002 -PPU_SPR_ADDR = $2003 -PPU_SPR_DATA = $2004 -PPU_SCROLL_REG = $2005 -PPU_ADDRESS = $2006 -PPU_DATA = $2007 - -SND_REGISTER = $4000 -SND_SQUARE1_REG = $4000 -SND_SQUARE2_REG = $4004 -SND_TRIANGLE_REG = $4008 -SND_NOISE_REG = $400c -SND_DELTA_REG = $4010 -SND_MASTERCTRL_REG = $4015 - -SPR_DMA = $4014 -JOYPAD_PORT = $4016 -JOYPAD_PORT1 = $4016 -JOYPAD_PORT2 = $4017 - -; GAME SPECIFIC DEFINES - -ObjectOffset = $08 - -FrameCounter = $09 - -SavedJoypadBits = $06fc -SavedJoypad1Bits = $06fc -SavedJoypad2Bits = $06fd -JoypadBitMask = $074a -JoypadOverride = $0758 - -A_B_Buttons = $0a -PreviousA_B_Buttons = $0d -Up_Down_Buttons = $0b -Left_Right_Buttons = $0c - -GameEngineSubroutine = $0e - -Mirror_PPU_CTRL_REG1 = $0778 -Mirror_PPU_CTRL_REG2 = $0779 - -OperMode = $0770 -OperMode_Task = $0772 -ScreenRoutineTask = $073c - -GamePauseStatus = $0776 -GamePauseTimer = $0777 - -DemoAction = $0717 -DemoActionTimer = $0718 - -TimerControl = $0747 -IntervalTimerControl = $077f - -Timers = $0780 -SelectTimer = $0780 -PlayerAnimTimer = $0781 -JumpSwimTimer = $0782 -RunningTimer = $0783 -BlockBounceTimer = $0784 -SideCollisionTimer = $0785 -JumpspringTimer = $0786 -GameTimerCtrlTimer = $0787 -ClimbSideTimer = $0789 -EnemyFrameTimer = $078a -FrenzyEnemyTimer = $078f -BowserFireBreathTimer = $0790 -StompTimer = $0791 -AirBubbleTimer = $0792 -ScrollIntervalTimer = $0795 -EnemyIntervalTimer = $0796 -BrickCoinTimer = $079d -InjuryTimer = $079e -StarInvincibleTimer = $079f -ScreenTimer = $07a0 -WorldEndTimer = $07a1 -DemoTimer = $07a2 - -Sprite_Data = $0200 - -Sprite_Y_Position = $0200 -Sprite_Tilenumber = $0201 -Sprite_Attributes = $0202 -Sprite_X_Position = $0203 - -ScreenEdge_PageLoc = $071a -ScreenEdge_X_Pos = $071c -ScreenLeft_PageLoc = $071a -ScreenRight_PageLoc = $071b -ScreenLeft_X_Pos = $071c -ScreenRight_X_Pos = $071d - -PlayerFacingDir = $33 -DestinationPageLoc = $34 -VictoryWalkControl = $35 -ScrollFractional = $0768 -PrimaryMsgCounter = $0719 -SecondaryMsgCounter = $0749 - -HorizontalScroll = $073f -VerticalScroll = $0740 -ScrollLock = $0723 -ScrollThirtyTwo = $073d -Player_X_Scroll = $06ff -Player_Pos_ForScroll = $0755 -ScrollAmount = $0775 - -AreaData = $e7 -AreaDataLow = $e7 -AreaDataHigh = $e8 -EnemyData = $e9 -EnemyDataLow = $e9 -EnemyDataHigh = $ea - -AreaParserTaskNum = $071f -ColumnSets = $071e -CurrentPageLoc = $0725 -CurrentColumnPos = $0726 -BackloadingFlag = $0728 -BehindAreaParserFlag = $0729 -AreaObjectPageLoc = $072a -AreaObjectPageSel = $072b -AreaDataOffset = $072c -AreaObjOffsetBuffer = $072d -AreaObjectLength = $0730 -StaircaseControl = $0734 -AreaObjectHeight = $0735 -MushroomLedgeHalfLen = $0736 -EnemyDataOffset = $0739 -EnemyObjectPageLoc = $073a -EnemyObjectPageSel = $073b -MetatileBuffer = $06a1 -BlockBufferColumnPos = $06a0 -CurrentNTAddr_Low = $0721 -CurrentNTAddr_High = $0720 -AttributeBuffer = $03f9 - -LoopCommand = $0745 - -DisplayDigits = $07d7 -TopScoreDisplay = $07d7 -ScoreAndCoinDisplay = $07dd -PlayerScoreDisplay = $07dd -GameTimerDisplay = $07f8 -DigitModifier = $0134 - -VerticalFlipFlag = $0109 -FloateyNum_Control = $0110 -ShellChainCounter = $0125 -FloateyNum_Timer = $012c -FloateyNum_X_Pos = $0117 -FloateyNum_Y_Pos = $011e -FlagpoleFNum_Y_Pos = $010d -FlagpoleFNum_YMFDummy = $010e -FlagpoleScore = $010f -FlagpoleCollisionYPos = $070f -StompChainCounter = $0484 - -VRAM_Buffer1_Offset = $0300 -VRAM_Buffer1 = $0301 -VRAM_Buffer2_Offset = $0340 -VRAM_Buffer2 = $0341 -VRAM_Buffer_AddrCtrl = $0773 -Sprite0HitDetectFlag = $0722 -DisableScreenFlag = $0774 -DisableIntermediate = $0769 -ColorRotateOffset = $06d4 - -TerrainControl = $0727 -AreaStyle = $0733 -ForegroundScenery = $0741 -BackgroundScenery = $0742 -CloudTypeOverride = $0743 -BackgroundColorCtrl = $0744 -AreaType = $074e -AreaAddrsLOffset = $074f -AreaPointer = $0750 - -PlayerEntranceCtrl = $0710 -GameTimerSetting = $0715 -AltEntranceControl = $0752 -EntrancePage = $0751 -NumberOfPlayers = $077a -WarpZoneControl = $06d6 -ChangeAreaTimer = $06de - -MultiLoopCorrectCntr = $06d9 -MultiLoopPassCntr = $06da - -FetchNewGameTimerFlag = $0757 -GameTimerExpiredFlag = $0759 - -PrimaryHardMode = $076a -SecondaryHardMode = $06cc -WorldSelectNumber = $076b -WorldSelectEnableFlag = $07fc -ContinueWorld = $07fd - -CurrentPlayer = $0753 -PlayerSize = $0754 -PlayerStatus = $0756 - -OnscreenPlayerInfo = $075a -NumberofLives = $075a ;used by current player -HalfwayPage = $075b -LevelNumber = $075c ;the actual dash number -Hidden1UpFlag = $075d -CoinTally = $075e -WorldNumber = $075f -AreaNumber = $0760 ;internal number used to find areas - -CoinTallyFor1Ups = $0748 - -OffscreenPlayerInfo = $0761 -OffScr_NumberofLives = $0761 ;used by offscreen player -OffScr_HalfwayPage = $0762 -OffScr_LevelNumber = $0763 -OffScr_Hidden1UpFlag = $0764 -OffScr_CoinTally = $0765 -OffScr_WorldNumber = $0766 -OffScr_AreaNumber = $0767 - -BalPlatformAlignment = $03a0 -Platform_X_Scroll = $03a1 -PlatformCollisionFlag = $03a2 -YPlatformTopYPos = $0401 -YPlatformCenterYPos = $58 - -BrickCoinTimerFlag = $06bc -StarFlagTaskControl = $0746 - -PseudoRandomBitReg = $07a7 -WarmBootValidation = $07ff - -SprShuffleAmtOffset = $06e0 -SprShuffleAmt = $06e1 -SprDataOffset = $06e4 -Player_SprDataOffset = $06e4 -Enemy_SprDataOffset = $06e5 -Block_SprDataOffset = $06ec -Alt_SprDataOffset = $06ec -Bubble_SprDataOffset = $06ee -FBall_SprDataOffset = $06f1 -Misc_SprDataOffset = $06f3 -SprDataOffset_Ctrl = $03ee - -Player_State = $1d -Enemy_State = $1e -Fireball_State = $24 -Block_State = $26 -Misc_State = $2a - -Player_MovingDir = $45 -Enemy_MovingDir = $46 - -SprObject_X_Speed = $57 -Player_X_Speed = $57 -Enemy_X_Speed = $58 -Fireball_X_Speed = $5e -Block_X_Speed = $60 -Misc_X_Speed = $64 - -Jumpspring_FixedYPos = $58 -JumpspringAnimCtrl = $070e -JumpspringForce = $06db - -SprObject_PageLoc = $6d -Player_PageLoc = $6d -Enemy_PageLoc = $6e -Fireball_PageLoc = $74 -Block_PageLoc = $76 -Misc_PageLoc = $7a -Bubble_PageLoc = $83 - -SprObject_X_Position = $86 -Player_X_Position = $86 -Enemy_X_Position = $87 -Fireball_X_Position = $8d -Block_X_Position = $8f -Misc_X_Position = $93 -Bubble_X_Position = $9c - -SprObject_Y_Speed = $9f -Player_Y_Speed = $9f -Enemy_Y_Speed = $a0 -Fireball_Y_Speed = $a6 -Block_Y_Speed = $a8 -Misc_Y_Speed = $ac - -SprObject_Y_HighPos = $b5 -Player_Y_HighPos = $b5 -Enemy_Y_HighPos = $b6 -Fireball_Y_HighPos = $bc -Block_Y_HighPos = $be -Misc_Y_HighPos = $c2 -Bubble_Y_HighPos = $cb - -SprObject_Y_Position = $ce -Player_Y_Position = $ce -Enemy_Y_Position = $cf -Fireball_Y_Position = $d5 -Block_Y_Position = $d7 -Misc_Y_Position = $db -Bubble_Y_Position = $e4 - -SprObject_Rel_XPos = $03ad -Player_Rel_XPos = $03ad -Enemy_Rel_XPos = $03ae -Fireball_Rel_XPos = $03af -Bubble_Rel_XPos = $03b0 -Block_Rel_XPos = $03b1 -Misc_Rel_XPos = $03b3 - -SprObject_Rel_YPos = $03b8 -Player_Rel_YPos = $03b8 -Enemy_Rel_YPos = $03b9 -Fireball_Rel_YPos = $03ba -Bubble_Rel_YPos = $03bb -Block_Rel_YPos = $03bc -Misc_Rel_YPos = $03be - -SprObject_SprAttrib = $03c4 -Player_SprAttrib = $03c4 -Enemy_SprAttrib = $03c5 - -SprObject_X_MoveForce = $0400 -Enemy_X_MoveForce = $0401 - -SprObject_YMF_Dummy = $0416 -Player_YMF_Dummy = $0416 -Enemy_YMF_Dummy = $0417 -Bubble_YMF_Dummy = $042c - -SprObject_Y_MoveForce = $0433 -Player_Y_MoveForce = $0433 -Enemy_Y_MoveForce = $0434 -Block_Y_MoveForce = $043c - -DisableCollisionDet = $0716 -Player_CollisionBits = $0490 -Enemy_CollisionBits = $0491 - -SprObj_BoundBoxCtrl = $0499 -Player_BoundBoxCtrl = $0499 -Enemy_BoundBoxCtrl = $049a -Fireball_BoundBoxCtrl = $04a0 -Misc_BoundBoxCtrl = $04a2 - -EnemyFrenzyBuffer = $06cb -EnemyFrenzyQueue = $06cd -Enemy_Flag = $0f -Enemy_ID = $16 - -PlayerGfxOffset = $06d5 -Player_XSpeedAbsolute = $0700 -FrictionAdderHigh = $0701 -FrictionAdderLow = $0702 -RunningSpeed = $0703 -SwimmingFlag = $0704 -Player_X_MoveForce = $0705 -DiffToHaltJump = $0706 -JumpOrigin_Y_HighPos = $0707 -JumpOrigin_Y_Position = $0708 -VerticalForce = $0709 -VerticalForceDown = $070a -PlayerChangeSizeFlag = $070b -PlayerAnimTimerSet = $070c -PlayerAnimCtrl = $070d -DeathMusicLoaded = $0712 -FlagpoleSoundQueue = $0713 -CrouchingFlag = $0714 -MaximumLeftSpeed = $0450 -MaximumRightSpeed = $0456 - -SprObject_OffscrBits = $03d0 -Player_OffscreenBits = $03d0 -Enemy_OffscreenBits = $03d1 -FBall_OffscreenBits = $03d2 -Bubble_OffscreenBits = $03d3 -Block_OffscreenBits = $03d4 -Misc_OffscreenBits = $03d6 -EnemyOffscrBitsMasked = $03d8 - -Cannon_Offset = $046a -Cannon_PageLoc = $046b -Cannon_X_Position = $0471 -Cannon_Y_Position = $0477 -Cannon_Timer = $047d - -Whirlpool_Offset = $046a -Whirlpool_PageLoc = $046b -Whirlpool_LeftExtent = $0471 -Whirlpool_Length = $0477 -Whirlpool_Flag = $047d - -VineFlagOffset = $0398 -VineHeight = $0399 -VineObjOffset = $039a -VineStart_Y_Position = $039d - -Block_Orig_YPos = $03e4 -Block_BBuf_Low = $03e6 -Block_Metatile = $03e8 -Block_PageLoc2 = $03ea -Block_RepFlag = $03ec -Block_ResidualCounter = $03f0 -Block_Orig_XPos = $03f1 - -BoundingBox_UL_XPos = $04ac -BoundingBox_UL_YPos = $04ad -BoundingBox_DR_XPos = $04ae -BoundingBox_DR_YPos = $04af -BoundingBox_UL_Corner = $04ac -BoundingBox_LR_Corner = $04ae -EnemyBoundingBoxCoord = $04b0 - -PowerUpType = $39 - -FireballBouncingFlag = $3a -FireballCounter = $06ce -FireballThrowingTimer = $0711 - -HammerEnemyOffset = $06ae -JumpCoinMiscOffset = $06b7 - -Block_Buffer_1 = $0500 -Block_Buffer_2 = $05d0 - -HammerThrowingTimer = $03a2 -HammerBroJumpTimer = $3c -Misc_Collision_Flag = $06be - -RedPTroopaOrigXPos = $0401 -RedPTroopaCenterYPos = $58 - -XMovePrimaryCounter = $a0 -XMoveSecondaryCounter = $58 - -CheepCheepMoveMFlag = $58 -CheepCheepOrigYPos = $0434 -BitMFilter = $06dd - -LakituReappearTimer = $06d1 -LakituMoveSpeed = $58 -LakituMoveDirection = $a0 - -FirebarSpinState_Low = $58 -FirebarSpinState_High = $a0 -FirebarSpinSpeed = $0388 -FirebarSpinDirection = $34 - -DuplicateObj_Offset = $06cf -NumberofGroupEnemies = $06d3 - -BlooperMoveCounter = $a0 -BlooperMoveSpeed = $58 - -BowserBodyControls = $0363 -BowserFeetCounter = $0364 -BowserMovementSpeed = $0365 -BowserOrigXPos = $0366 -BowserFlameTimerCtrl = $0367 -BowserFront_Offset = $0368 -BridgeCollapseOffset = $0369 -BowserGfxFlag = $036a -BowserHitPoints = $0483 -MaxRangeFromOrigin = $06dc - -BowserFlamePRandomOfs = $0417 - -PiranhaPlantUpYPos = $0417 -PiranhaPlantDownYPos = $0434 -PiranhaPlant_Y_Speed = $58 -PiranhaPlant_MoveFlag = $a0 - -FireworksCounter = $06d7 -ExplosionGfxCounter = $58 -ExplosionTimerCounter = $a0 - -;sound related defines -Squ2_NoteLenBuffer = $07b3 -Squ2_NoteLenCounter = $07b4 -Squ2_EnvelopeDataCtrl = $07b5 -Squ1_NoteLenCounter = $07b6 -Squ1_EnvelopeDataCtrl = $07b7 -Tri_NoteLenBuffer = $07b8 -Tri_NoteLenCounter = $07b9 -Noise_BeatLenCounter = $07ba -Squ1_SfxLenCounter = $07bb -Squ2_SfxLenCounter = $07bd -Sfx_SecondaryCounter = $07be -Noise_SfxLenCounter = $07bf - -PauseSoundQueue = $fa -Square1SoundQueue = $ff -Square2SoundQueue = $fe -NoiseSoundQueue = $fd -AreaMusicQueue = $fb -EventMusicQueue = $fc - -Square1SoundBuffer = $f1 -Square2SoundBuffer = $f2 -NoiseSoundBuffer = $f3 -AreaMusicBuffer = $f4 -EventMusicBuffer = $07b1 -PauseSoundBuffer = $07b2 - -MusicData = $f5 -MusicDataLow = $f5 -MusicDataHigh = $f6 -MusicOffset_Square2 = $f7 -MusicOffset_Square1 = $f8 -MusicOffset_Triangle = $f9 -MusicOffset_Noise = $07b0 - -NoteLenLookupTblOfs = $f0 -DAC_Counter = $07c0 -NoiseDataLoopbackOfs = $07c1 -NoteLengthTblAdder = $07c4 -AreaMusicBuffer_Alt = $07c5 -PauseModeFlag = $07c6 -GroundMusicHeaderOfs = $07c7 -AltRegContentFlag = $07ca - -;------------------------------------------------------------------------------------- -;CONSTANTS - -;sound effects constants -Sfx_SmallJump = %10000000 -Sfx_Flagpole = %01000000 -Sfx_Fireball = %00100000 -Sfx_PipeDown_Injury = %00010000 -Sfx_EnemySmack = %00001000 -Sfx_EnemyStomp = %00000100 -Sfx_Bump = %00000010 -Sfx_BigJump = %00000001 - -Sfx_BowserFall = %10000000 -Sfx_ExtraLife = %01000000 -Sfx_PowerUpGrab = %00100000 -Sfx_TimerTick = %00010000 -Sfx_Blast = %00001000 -Sfx_GrowVine = %00000100 -Sfx_GrowPowerUp = %00000010 -Sfx_CoinGrab = %00000001 - -Sfx_BowserFlame = %00000010 -Sfx_BrickShatter = %00000001 - -;music constants -Silence = %10000000 - -StarPowerMusic = %01000000 -PipeIntroMusic = %00100000 -CloudMusic = %00010000 -CastleMusic = %00001000 -UndergroundMusic = %00000100 -WaterMusic = %00000010 -GroundMusic = %00000001 - -TimeRunningOutMusic = %01000000 -EndOfLevelMusic = %00100000 -AltGameOverMusic = %00010000 -EndOfCastleMusic = %00001000 -VictoryMusic = %00000100 -GameOverMusic = %00000010 -DeathMusic = %00000001 - -;enemy object constants -GreenKoopa = $00 -BuzzyBeetle = $02 -RedKoopa = $03 -HammerBro = $05 -Goomba = $06 -Bloober = $07 -BulletBill_FrenzyVar = $08 -GreyCheepCheep = $0a -RedCheepCheep = $0b -Podoboo = $0c -PiranhaPlant = $0d -GreenParatroopaJump = $0e -RedParatroopa = $0f -GreenParatroopaFly = $10 -Lakitu = $11 -Spiny = $12 -FlyCheepCheepFrenzy = $14 -FlyingCheepCheep = $14 -BowserFlame = $15 -Fireworks = $16 -BBill_CCheep_Frenzy = $17 -Stop_Frenzy = $18 -Bowser = $2d -PowerUpObject = $2e -VineObject = $2f -FlagpoleFlagObject = $30 -StarFlagObject = $31 -JumpspringObject = $32 -BulletBill_CannonVar = $33 -RetainerObject = $35 -TallEnemy = $09 - -;other constants -World1 = 0 -World2 = 1 -World3 = 2 -World4 = 3 -World5 = 4 -World6 = 5 -World7 = 6 -World8 = 7 -Level1 = 0 -Level2 = 1 -Level3 = 2 -Level4 = 3 - -WarmBootOffset = <$07d6 -ColdBootOffset = <$07fe -TitleScreenDataOffset = $1ec0 -SoundMemory = $07b0 -SwimTileRepOffset = PlayerGraphicsTable + $9e -MusicHeaderOffsetData = MusicHeaderData - 1 -MHD = MusicHeaderData - -A_Button = %10000000 -B_Button = %01000000 -Select_Button = %00100000 -Start_Button = %00010000 -Up_Dir = %00001000 -Down_Dir = %00000100 -Left_Dir = %00000010 -Right_Dir = %00000001 - -TitleScreenModeValue = 0 -GameModeValue = 1 -VictoryModeValue = 2 -GameOverModeValue = 3 - -;------------------------------------------------------------------------------------- -;DIRECTIVES - - .index 8 - .mem 8 - - .org $8000 - -;------------------------------------------------------------------------------------- - -Start: - sei ;pretty standard 6502 type init here - cld - lda #%00010000 ;init PPU control register 1 - sta PPU_CTRL_REG1 - ldx #$ff ;reset stack pointer - txs -VBlank1: lda PPU_STATUS ;wait two frames - bpl VBlank1 -VBlank2: lda PPU_STATUS - bpl VBlank2 - ldy #ColdBootOffset ;load default cold boot pointer - ldx #$05 ;this is where we check for a warm boot -WBootCheck: lda TopScoreDisplay,x ;check each score digit in the top score - cmp #10 ;to see if we have a valid digit - bcs ColdBoot ;if not, give up and proceed with cold boot - dex - bpl WBootCheck - lda WarmBootValidation ;second checkpoint, check to see if - cmp #$a5 ;another location has a specific value - bne ColdBoot - ldy #WarmBootOffset ;if passed both, load warm boot pointer -ColdBoot: jsr InitializeMemory ;clear memory using pointer in Y - sta SND_DELTA_REG+1 ;reset delta counter load register - sta OperMode ;reset primary mode of operation - lda #$a5 ;set warm boot flag - sta WarmBootValidation - sta PseudoRandomBitReg ;set seed for pseudorandom register - lda #%00001111 - sta SND_MASTERCTRL_REG ;enable all sound channels except dmc - lda #%00000110 - sta PPU_CTRL_REG2 ;turn off clipping for OAM and background - jsr MoveAllSpritesOffscreen - jsr InitializeNameTables ;initialize both name tables - inc DisableScreenFlag ;set flag to disable screen output - lda Mirror_PPU_CTRL_REG1 - ora #%10000000 ;enable NMIs - jsr WritePPUReg1 -EndlessLoop: jmp EndlessLoop ;endless loop, need I say more? - -;------------------------------------------------------------------------------------- -;$00 - vram buffer address table low, also used for pseudorandom bit -;$01 - vram buffer address table high - -VRAM_AddrTable_Low: - .db VRAM_Buffer1, >WaterPaletteData, >GroundPaletteData - .db >UndergroundPaletteData, >CastlePaletteData, >VRAM_Buffer1_Offset - .db >VRAM_Buffer2, >VRAM_Buffer2, >BowserPaletteData - .db >DaySnowPaletteData, >NightSnowPaletteData, >MushroomPaletteData - .db >MarioThanksMessage, >LuigiThanksMessage, >MushroomRetainerSaved - .db >PrincessSaved1, >PrincessSaved2, >WorldSelectMessage1 - .db >WorldSelectMessage2 - -VRAM_Buffer_Offset: - .db $09 - lda Enemy_State,x - cmp #$02 ;if enemy state defeated or otherwise - bcs FloateyPart ;$02 or greater, branch beyond this part -GetAltOffset: ldx SprDataOffset_Ctrl ;load some kind of control bit - ldy Alt_SprDataOffset,x ;get alternate OAM data offset - ldx ObjectOffset ;get enemy object offset again -FloateyPart: lda FloateyNum_Y_Pos,x ;get vertical coordinate for - cmp #$18 ;floatey number, if coordinate in the - bcc SetupNumSpr ;status bar, branch - sbc #$01 - sta FloateyNum_Y_Pos,x ;otherwise subtract one and store as new -SetupNumSpr: lda FloateyNum_Y_Pos,x ;get vertical coordinate - sbc #$08 ;subtract eight and dump into the - jsr DumpTwoSpr ;left and right sprite's Y coordinates - lda FloateyNum_X_Pos,x ;get horizontal coordinate - sta Sprite_X_Position,y ;store into X coordinate of left sprite - clc - adc #$08 ;add eight pixels and store into X - sta Sprite_X_Position+4,y ;coordinate of right sprite - lda #$02 - sta Sprite_Attributes,y ;set palette control in attribute bytes - sta Sprite_Attributes+4,y ;of left and right sprites - lda FloateyNum_Control,x - asl ;multiply our floatey number control by 2 - tax ;and use as offset for look-up table - lda FloateyNumTileData,x - sta Sprite_Tilenumber,y ;display first half of number of points - lda FloateyNumTileData+1,x - sta Sprite_Tilenumber+4,y ;display the second half - ldx ObjectOffset ;get enemy object offset and leave - rts - -;------------------------------------------------------------------------------------- - -ScreenRoutines: - lda ScreenRoutineTask ;run one of the following subroutines - jsr JumpEngine - - .dw InitScreen - .dw SetupIntermediate - .dw WriteTopStatusLine - .dw WriteBottomStatusLine - .dw DisplayTimeUp - .dw ResetSpritesAndScreenTimer - .dw DisplayIntermediate - .dw ResetSpritesAndScreenTimer - .dw AreaParserTaskControl - .dw GetAreaPalette - .dw GetBackgroundColor - .dw GetAlternatePalette1 - .dw DrawTitleScreen - .dw ClearBuffersDrawIcon - .dw WriteTopScore - -;------------------------------------------------------------------------------------- - -InitScreen: - jsr MoveAllSpritesOffscreen ;initialize all sprites including sprite #0 - jsr InitializeNameTables ;and erase both name and attribute tables - lda OperMode - beq NextSubtask ;if mode still 0, do not load - ldx #$03 ;into buffer pointer - jmp SetVRAMAddr_A - -;------------------------------------------------------------------------------------- - -SetupIntermediate: - lda BackgroundColorCtrl ;save current background color control - pha ;and player status to stack - lda PlayerStatus - pha - lda #$00 ;set background color to black - sta PlayerStatus ;and player status to not fiery - lda #$02 ;this is the ONLY time background color control - sta BackgroundColorCtrl ;is set to less than 4 - jsr GetPlayerColors - pla ;we only execute this routine for - sta PlayerStatus ;the intermediate lives display - pla ;and once we're done, we return bg - sta BackgroundColorCtrl ;color ctrl and player status from stack - jmp IncSubtask ;then move onto the next task - -;------------------------------------------------------------------------------------- - -AreaPalette: - .db $01, $02, $03, $04 - -GetAreaPalette: - ldy AreaType ;select appropriate palette to load - ldx AreaPalette,y ;based on area type -SetVRAMAddr_A: stx VRAM_Buffer_AddrCtrl ;store offset into buffer control -NextSubtask: jmp IncSubtask ;move onto next task - -;------------------------------------------------------------------------------------- -;$00 - used as temp counter in GetPlayerColors - -BGColorCtrl_Addr: - .db $00, $09, $0a, $04 - -BackgroundColors: - .db $22, $22, $0f, $0f ;used by area type if bg color ctrl not set - .db $0f, $22, $0f, $0f ;used by background color control if set - -PlayerColors: - .db $22, $16, $27, $18 ;mario's colors - .db $22, $30, $27, $19 ;luigi's colors - .db $22, $37, $27, $16 ;fiery (used by both) - -GetBackgroundColor: - ldy BackgroundColorCtrl ;check background color control - beq NoBGColor ;if not set, increment task and fetch palette - lda BGColorCtrl_Addr-4,y ;put appropriate palette into vram - sta VRAM_Buffer_AddrCtrl ;note that if set to 5-7, $0301 will not be read -NoBGColor: inc ScreenRoutineTask ;increment to next subtask and plod on through - -GetPlayerColors: - ldx VRAM_Buffer1_Offset ;get current buffer offset - ldy #$00 - lda CurrentPlayer ;check which player is on the screen - beq ChkFiery - ldy #$04 ;load offset for luigi -ChkFiery: lda PlayerStatus ;check player status - cmp #$02 - bne StartClrGet ;if fiery, load alternate offset for fiery player - ldy #$08 -StartClrGet: lda #$03 ;do four colors - sta $00 -ClrGetLoop: lda PlayerColors,y ;fetch player colors and store them - sta VRAM_Buffer1+3,x ;in the buffer - iny - inx - dec $00 - bpl ClrGetLoop - ldx VRAM_Buffer1_Offset ;load original offset from before - ldy BackgroundColorCtrl ;if this value is four or greater, it will be set - bne SetBGColor ;therefore use it as offset to background color - ldy AreaType ;otherwise use area type bits from area offset as offset -SetBGColor: lda BackgroundColors,y ;to background color instead - sta VRAM_Buffer1+3,x - lda #$3f ;set for sprite palette address - sta VRAM_Buffer1,x ;save to buffer - lda #$10 - sta VRAM_Buffer1+1,x - lda #$04 ;write length byte to buffer - sta VRAM_Buffer1+2,x - lda #$00 ;now the null terminator - sta VRAM_Buffer1+7,x - txa ;move the buffer pointer ahead 7 bytes - clc ;in case we want to write anything else later - adc #$07 -SetVRAMOffset: sta VRAM_Buffer1_Offset ;store as new vram buffer offset - rts - -;------------------------------------------------------------------------------------- - -GetAlternatePalette1: - lda AreaStyle ;check for mushroom level style - cmp #$01 - bne NoAltPal - lda #$0b ;if found, load appropriate palette -SetVRAMAddr_B: sta VRAM_Buffer_AddrCtrl -NoAltPal: jmp IncSubtask ;now onto the next task - -;------------------------------------------------------------------------------------- - -WriteTopStatusLine: - lda #$00 ;select main status bar - jsr WriteGameText ;output it - jmp IncSubtask ;onto the next task - -;------------------------------------------------------------------------------------- - -WriteBottomStatusLine: - jsr GetSBNybbles ;write player's score and coin tally to screen - ldx VRAM_Buffer1_Offset - lda #$20 ;write address for world-area number on screen - sta VRAM_Buffer1,x - lda #$73 - sta VRAM_Buffer1+1,x - lda #$03 ;write length for it - sta VRAM_Buffer1+2,x - ldy WorldNumber ;first the world number - iny - tya - sta VRAM_Buffer1+3,x - lda #$28 ;next the dash - sta VRAM_Buffer1+4,x - ldy LevelNumber ;next the level number - iny ;increment for proper number display - tya - sta VRAM_Buffer1+5,x - lda #$00 ;put null terminator on - sta VRAM_Buffer1+6,x - txa ;move the buffer offset up by 6 bytes - clc - adc #$06 - sta VRAM_Buffer1_Offset - jmp IncSubtask - -;------------------------------------------------------------------------------------- - -DisplayTimeUp: - lda GameTimerExpiredFlag ;if game timer not expired, increment task - beq NoTimeUp ;control 2 tasks forward, otherwise, stay here - lda #$00 - sta GameTimerExpiredFlag ;reset timer expiration flag - lda #$02 ;output time-up screen to buffer - jmp OutputInter -NoTimeUp: inc ScreenRoutineTask ;increment control task 2 tasks forward - jmp IncSubtask - -;------------------------------------------------------------------------------------- - -DisplayIntermediate: - lda OperMode ;check primary mode of operation - beq NoInter ;if in title screen mode, skip this - cmp #GameOverModeValue ;are we in game over mode? - beq GameOverInter ;if so, proceed to display game over screen - lda AltEntranceControl ;otherwise check for mode of alternate entry - bne NoInter ;and branch if found - ldy AreaType ;check if we are on castle level - cpy #$03 ;and if so, branch (possibly residual) - beq PlayerInter - lda DisableIntermediate ;if this flag is set, skip intermediate lives display - bne NoInter ;and jump to specific task, otherwise -PlayerInter: jsr DrawPlayer_Intermediate ;put player in appropriate place for - lda #$01 ;lives display, then output lives display to buffer -OutputInter: jsr WriteGameText - jsr ResetScreenTimer - lda #$00 - sta DisableScreenFlag ;reenable screen output - rts -GameOverInter: lda #$12 ;set screen timer - sta ScreenTimer - lda #$03 ;output game over screen to buffer - jsr WriteGameText - jmp IncModeTask_B -NoInter: lda #$08 ;set for specific task and leave - sta ScreenRoutineTask - rts - -;------------------------------------------------------------------------------------- - -AreaParserTaskControl: - inc DisableScreenFlag ;turn off screen -TaskLoop: jsr AreaParserTaskHandler ;render column set of current area - lda AreaParserTaskNum ;check number of tasks - bne TaskLoop ;if tasks still not all done, do another one - dec ColumnSets ;do we need to render more column sets? - bpl OutputCol - inc ScreenRoutineTask ;if not, move on to the next task -OutputCol: lda #$06 ;set vram buffer to output rendered column set - sta VRAM_Buffer_AddrCtrl ;on next NMI - rts - -;------------------------------------------------------------------------------------- - -;$00 - vram buffer address table low -;$01 - vram buffer address table high - -DrawTitleScreen: - lda OperMode ;are we in title screen mode? - bne IncModeTask_B ;if not, exit - lda #>TitleScreenDataOffset ;load address $1ec0 into - sta PPU_ADDRESS ;the vram address register - lda #Palette0_MTiles, >Palette1_MTiles, >Palette2_MTiles, >Palette3_MTiles - -Palette0_MTiles: - .db $24, $24, $24, $24 ;blank - .db $27, $27, $27, $27 ;black metatile - .db $24, $24, $24, $35 ;bush left - .db $36, $25, $37, $25 ;bush middle - .db $24, $38, $24, $24 ;bush right - .db $24, $30, $30, $26 ;mountain left - .db $26, $26, $34, $26 ;mountain left bottom/middle center - .db $24, $31, $24, $32 ;mountain middle top - .db $33, $26, $24, $33 ;mountain right - .db $34, $26, $26, $26 ;mountain right bottom - .db $26, $26, $26, $26 ;mountain middle bottom - .db $24, $c0, $24, $c0 ;bridge guardrail - .db $24, $7f, $7f, $24 ;chain - .db $b8, $ba, $b9, $bb ;tall tree top, top half - .db $b8, $bc, $b9, $bd ;short tree top - .db $ba, $bc, $bb, $bd ;tall tree top, bottom half - .db $60, $64, $61, $65 ;warp pipe end left, points up - .db $62, $66, $63, $67 ;warp pipe end right, points up - .db $60, $64, $61, $65 ;decoration pipe end left, points up - .db $62, $66, $63, $67 ;decoration pipe end right, points up - .db $68, $68, $69, $69 ;pipe shaft left - .db $26, $26, $6a, $6a ;pipe shaft right - .db $4b, $4c, $4d, $4e ;tree ledge left edge - .db $4d, $4f, $4d, $4f ;tree ledge middle - .db $4d, $4e, $50, $51 ;tree ledge right edge - .db $6b, $70, $2c, $2d ;mushroom left edge - .db $6c, $71, $6d, $72 ;mushroom middle - .db $6e, $73, $6f, $74 ;mushroom right edge - .db $86, $8a, $87, $8b ;sideways pipe end top - .db $88, $8c, $88, $8c ;sideways pipe shaft top - .db $89, $8d, $69, $69 ;sideways pipe joint top - .db $8e, $91, $8f, $92 ;sideways pipe end bottom - .db $26, $93, $26, $93 ;sideways pipe shaft bottom - .db $90, $94, $69, $69 ;sideways pipe joint bottom - .db $a4, $e9, $ea, $eb ;seaplant - .db $24, $24, $24, $24 ;blank, used on bricks or blocks that are hit - .db $24, $2f, $24, $3d ;flagpole ball - .db $a2, $a2, $a3, $a3 ;flagpole shaft - .db $24, $24, $24, $24 ;blank, used in conjunction with vines - -Palette1_MTiles: - .db $a2, $a2, $a3, $a3 ;vertical rope - .db $99, $24, $99, $24 ;horizontal rope - .db $24, $a2, $3e, $3f ;left pulley - .db $5b, $5c, $24, $a3 ;right pulley - .db $24, $24, $24, $24 ;blank used for balance rope - .db $9d, $47, $9e, $47 ;castle top - .db $47, $47, $27, $27 ;castle window left - .db $47, $47, $47, $47 ;castle brick wall - .db $27, $27, $47, $47 ;castle window right - .db $a9, $47, $aa, $47 ;castle top w/ brick - .db $9b, $27, $9c, $27 ;entrance top - .db $27, $27, $27, $27 ;entrance bottom - .db $52, $52, $52, $52 ;green ledge stump - .db $80, $a0, $81, $a1 ;fence - .db $be, $be, $bf, $bf ;tree trunk - .db $75, $ba, $76, $bb ;mushroom stump top - .db $ba, $ba, $bb, $bb ;mushroom stump bottom - .db $45, $47, $45, $47 ;breakable brick w/ line - .db $47, $47, $47, $47 ;breakable brick - .db $45, $47, $45, $47 ;breakable brick (not used) - .db $b4, $b6, $b5, $b7 ;cracked rock terrain - .db $45, $47, $45, $47 ;brick with line (power-up) - .db $45, $47, $45, $47 ;brick with line (vine) - .db $45, $47, $45, $47 ;brick with line (star) - .db $45, $47, $45, $47 ;brick with line (coins) - .db $45, $47, $45, $47 ;brick with line (1-up) - .db $47, $47, $47, $47 ;brick (power-up) - .db $47, $47, $47, $47 ;brick (vine) - .db $47, $47, $47, $47 ;brick (star) - .db $47, $47, $47, $47 ;brick (coins) - .db $47, $47, $47, $47 ;brick (1-up) - .db $24, $24, $24, $24 ;hidden block (1 coin) - .db $24, $24, $24, $24 ;hidden block (1-up) - .db $ab, $ac, $ad, $ae ;solid block (3-d block) - .db $5d, $5e, $5d, $5e ;solid block (white wall) - .db $c1, $24, $c1, $24 ;bridge - .db $c6, $c8, $c7, $c9 ;bullet bill cannon barrel - .db $ca, $cc, $cb, $cd ;bullet bill cannon top - .db $2a, $2a, $40, $40 ;bullet bill cannon bottom - .db $24, $24, $24, $24 ;blank used for jumpspring - .db $24, $47, $24, $47 ;half brick used for jumpspring - .db $82, $83, $84, $85 ;solid block (water level, green rock) - .db $24, $47, $24, $47 ;half brick (???) - .db $86, $8a, $87, $8b ;water pipe top - .db $8e, $91, $8f, $92 ;water pipe bottom - .db $24, $2f, $24, $3d ;flag ball (residual object) - -Palette2_MTiles: - .db $24, $24, $24, $35 ;cloud left - .db $36, $25, $37, $25 ;cloud middle - .db $24, $38, $24, $24 ;cloud right - .db $24, $24, $39, $24 ;cloud bottom left - .db $3a, $24, $3b, $24 ;cloud bottom middle - .db $3c, $24, $24, $24 ;cloud bottom right - .db $41, $26, $41, $26 ;water/lava top - .db $26, $26, $26, $26 ;water/lava - .db $b0, $b1, $b2, $b3 ;cloud level terrain - .db $77, $79, $77, $79 ;bowser's bridge - -Palette3_MTiles: - .db $53, $55, $54, $56 ;question block (coin) - .db $53, $55, $54, $56 ;question block (power-up) - .db $a5, $a7, $a6, $a8 ;coin - .db $c2, $c4, $c3, $c5 ;underwater coin - .db $57, $59, $58, $5a ;empty block - .db $7b, $7d, $7c, $7e ;axe - -;------------------------------------------------------------------------------------- -;VRAM BUFFER DATA FOR LOCATIONS IN PRG-ROM - -WaterPaletteData: - .db $3f, $00, $20 - .db $0f, $15, $12, $25 - .db $0f, $3a, $1a, $0f - .db $0f, $30, $12, $0f - .db $0f, $27, $12, $0f - .db $22, $16, $27, $18 - .db $0f, $10, $30, $27 - .db $0f, $16, $30, $27 - .db $0f, $0f, $30, $10 - .db $00 - -GroundPaletteData: - .db $3f, $00, $20 - .db $0f, $29, $1a, $0f - .db $0f, $36, $17, $0f - .db $0f, $30, $21, $0f - .db $0f, $27, $17, $0f - .db $0f, $16, $27, $18 - .db $0f, $1a, $30, $27 - .db $0f, $16, $30, $27 - .db $0f, $0f, $36, $17 - .db $00 - -UndergroundPaletteData: - .db $3f, $00, $20 - .db $0f, $29, $1a, $09 - .db $0f, $3c, $1c, $0f - .db $0f, $30, $21, $1c - .db $0f, $27, $17, $1c - .db $0f, $16, $27, $18 - .db $0f, $1c, $36, $17 - .db $0f, $16, $30, $27 - .db $0f, $0c, $3c, $1c - .db $00 - -CastlePaletteData: - .db $3f, $00, $20 - .db $0f, $30, $10, $00 - .db $0f, $30, $10, $00 - .db $0f, $30, $16, $00 - .db $0f, $27, $17, $00 - .db $0f, $16, $27, $18 - .db $0f, $1c, $36, $17 - .db $0f, $16, $30, $27 - .db $0f, $00, $30, $10 - .db $00 - -DaySnowPaletteData: - .db $3f, $00, $04 - .db $22, $30, $00, $10 - .db $00 - -NightSnowPaletteData: - .db $3f, $00, $04 - .db $0f, $30, $00, $10 - .db $00 - -MushroomPaletteData: - .db $3f, $00, $04 - .db $22, $27, $16, $0f - .db $00 - -BowserPaletteData: - .db $3f, $14, $04 - .db $0f, $1a, $30, $27 - .db $00 - -MarioThanksMessage: -;"THANK YOU MARIO!" - .db $25, $48, $10 - .db $1d, $11, $0a, $17, $14, $24 - .db $22, $18, $1e, $24 - .db $16, $0a, $1b, $12, $18, $2b - .db $00 - -LuigiThanksMessage: -;"THANK YOU LUIGI!" - .db $25, $48, $10 - .db $1d, $11, $0a, $17, $14, $24 - .db $22, $18, $1e, $24 - .db $15, $1e, $12, $10, $12, $2b - .db $00 - -MushroomRetainerSaved: -;"BUT OUR PRINCESS IS IN" - .db $25, $c5, $16 - .db $0b, $1e, $1d, $24, $18, $1e, $1b, $24 - .db $19, $1b, $12, $17, $0c, $0e, $1c, $1c, $24 - .db $12, $1c, $24, $12, $17 -;"ANOTHER CASTLE!" - .db $26, $05, $0f - .db $0a, $17, $18, $1d, $11, $0e, $1b, $24 - .db $0c, $0a, $1c, $1d, $15, $0e, $2b, $00 - -PrincessSaved1: -;"YOUR QUEST IS OVER." - .db $25, $a7, $13 - .db $22, $18, $1e, $1b, $24 - .db $1a, $1e, $0e, $1c, $1d, $24 - .db $12, $1c, $24, $18, $1f, $0e, $1b, $af - .db $00 - -PrincessSaved2: -;"WE PRESENT YOU A NEW QUEST." - .db $25, $e3, $1b - .db $20, $0e, $24 - .db $19, $1b, $0e, $1c, $0e, $17, $1d, $24 - .db $22, $18, $1e, $24, $0a, $24, $17, $0e, $20, $24 - .db $1a, $1e, $0e, $1c, $1d, $af - .db $00 - -WorldSelectMessage1: -;"PUSH BUTTON B" - .db $26, $4a, $0d - .db $19, $1e, $1c, $11, $24 - .db $0b, $1e, $1d, $1d, $18, $17, $24, $0b - .db $00 - -WorldSelectMessage2: -;"TO SELECT A WORLD" - .db $26, $88, $11 - .db $1d, $18, $24, $1c, $0e, $15, $0e, $0c, $1d, $24 - .db $0a, $24, $20, $18, $1b, $15, $0d - .db $00 - -;------------------------------------------------------------------------------------- -;$04 - address low to jump address -;$05 - address high to jump address -;$06 - jump address low -;$07 - jump address high - -JumpEngine: - asl ;shift bit from contents of A - tay - pla ;pull saved return address from stack - sta $04 ;save to indirect - pla - sta $05 - iny - lda ($04),y ;load pointer from indirect - sta $06 ;note that if an RTS is performed in next routine - iny ;it will return to the execution before the sub - lda ($04),y ;that called this routine - sta $07 - jmp ($06) ;jump to the address we loaded - -;------------------------------------------------------------------------------------- - -InitializeNameTables: - lda PPU_STATUS ;reset flip-flop - lda Mirror_PPU_CTRL_REG1 ;load mirror of ppu reg $2000 - ora #%00010000 ;set sprites for first 4k and background for second 4k - and #%11110000 ;clear rest of lower nybble, leave higher alone - jsr WritePPUReg1 - lda #$24 ;set vram address to start of name table 1 - jsr WriteNTAddr - lda #$20 ;and then set it to name table 0 -WriteNTAddr: sta PPU_ADDRESS - lda #$00 - sta PPU_ADDRESS - ldx #$04 ;clear name table with blank tile #24 - ldy #$c0 - lda #$24 -InitNTLoop: sta PPU_DATA ;count out exactly 768 tiles - dey - bne InitNTLoop - dex - bne InitNTLoop - ldy #64 ;now to clear the attribute table (with zero this time) - txa - sta VRAM_Buffer1_Offset ;init vram buffer 1 offset - sta VRAM_Buffer1 ;init vram buffer 1 -InitATLoop: sta PPU_DATA - dey - bne InitATLoop - sta HorizontalScroll ;reset scroll variables - sta VerticalScroll - jmp InitScroll ;initialize scroll registers to zero - -;------------------------------------------------------------------------------------- -;$00 - temp joypad bit - -ReadJoypads: - lda #$01 ;reset and clear strobe of joypad ports - sta JOYPAD_PORT - lsr - tax ;start with joypad 1's port - sta JOYPAD_PORT - jsr ReadPortBits - inx ;increment for joypad 2's port -ReadPortBits: ldy #$08 -PortLoop: pha ;push previous bit onto stack - lda JOYPAD_PORT,x ;read current bit on joypad port - sta $00 ;check d1 and d0 of port output - lsr ;this is necessary on the old - ora $00 ;famicom systems in japan - lsr - pla ;read bits from stack - rol ;rotate bit from carry flag - dey - bne PortLoop ;count down bits left - sta SavedJoypadBits,x ;save controller status here always - pha - and #%00110000 ;check for select or start - and JoypadBitMask,x ;if neither saved state nor current state - beq Save8Bits ;have any of these two set, branch - pla - and #%11001111 ;otherwise store without select - sta SavedJoypadBits,x ;or start bits and leave - rts -Save8Bits: pla - sta JoypadBitMask,x ;save with all bits in another place and leave - rts - -;------------------------------------------------------------------------------------- -;$00 - vram buffer address table low -;$01 - vram buffer address table high - -WriteBufferToScreen: - sta PPU_ADDRESS ;store high byte of vram address - iny - lda ($00),y ;load next byte (second) - sta PPU_ADDRESS ;store low byte of vram address - iny - lda ($00),y ;load next byte (third) - asl ;shift to left and save in stack - pha - lda Mirror_PPU_CTRL_REG1 ;load mirror of $2000, - ora #%00000100 ;set ppu to increment by 32 by default - bcs SetupWrites ;if d7 of third byte was clear, ppu will - and #%11111011 ;only increment by 1 -SetupWrites: jsr WritePPUReg1 ;write to register - pla ;pull from stack and shift to left again - asl - bcc GetLength ;if d6 of third byte was clear, do not repeat byte - ora #%00000010 ;otherwise set d1 and increment Y - iny -GetLength: lsr ;shift back to the right to get proper length - lsr ;note that d1 will now be in carry - tax -OutputToVRAM: bcs RepeatByte ;if carry set, repeat loading the same byte - iny ;otherwise increment Y to load next byte -RepeatByte: lda ($00),y ;load more data from buffer and write to vram - sta PPU_DATA - dex ;done writing? - bne OutputToVRAM - sec - tya - adc $00 ;add end length plus one to the indirect at $00 - sta $00 ;to allow this routine to read another set of updates - lda #$00 - adc $01 - sta $01 - lda #$3f ;sets vram address to $3f00 - sta PPU_ADDRESS - lda #$00 - sta PPU_ADDRESS - sta PPU_ADDRESS ;then reinitializes it for some reason - sta PPU_ADDRESS -UpdateScreen: ldx PPU_STATUS ;reset flip-flop - ldy #$00 ;load first byte from indirect as a pointer - lda ($00),y - bne WriteBufferToScreen ;if byte is zero we have no further updates to make here -InitScroll: sta PPU_SCROLL_REG ;store contents of A into scroll registers - sta PPU_SCROLL_REG ;and end whatever subroutine led us here - rts - -;------------------------------------------------------------------------------------- - -WritePPUReg1: - sta PPU_CTRL_REG1 ;write contents of A to PPU register 1 - sta Mirror_PPU_CTRL_REG1 ;and its mirror - rts - -;------------------------------------------------------------------------------------- -;$00 - used to store status bar nybbles -;$02 - used as temp vram offset -;$03 - used to store length of status bar number - -;status bar name table offset and length data -StatusBarData: - .db $f0, $06 ; top score display on title screen - .db $62, $06 ; player score - .db $62, $06 - .db $6d, $02 ; coin tally - .db $6d, $02 - .db $7a, $03 ; game timer - -StatusBarOffset: - .db $06, $0c, $12, $18, $1e, $24 - -PrintStatusBarNumbers: - sta $00 ;store player-specific offset - jsr OutputNumbers ;use first nybble to print the coin display - lda $00 ;move high nybble to low - lsr ;and print to score display - lsr - lsr - lsr - -OutputNumbers: - clc ;add 1 to low nybble - adc #$01 - and #%00001111 ;mask out high nybble - cmp #$06 - bcs ExitOutputN - pha ;save incremented value to stack for now and - asl ;shift to left and use as offset - tay - ldx VRAM_Buffer1_Offset ;get current buffer pointer - lda #$20 ;put at top of screen by default - cpy #$00 ;are we writing top score on title screen? - bne SetupNums - lda #$22 ;if so, put further down on the screen -SetupNums: sta VRAM_Buffer1,x - lda StatusBarData,y ;write low vram address and length of thing - sta VRAM_Buffer1+1,x ;we're printing to the buffer - lda StatusBarData+1,y - sta VRAM_Buffer1+2,x - sta $03 ;save length byte in counter - stx $02 ;and buffer pointer elsewhere for now - pla ;pull original incremented value from stack - tax - lda StatusBarOffset,x ;load offset to value we want to write - sec - sbc StatusBarData+1,y ;subtract from length byte we read before - tay ;use value as offset to display digits - ldx $02 -DigitPLoop: lda DisplayDigits,y ;write digits to the buffer - sta VRAM_Buffer1+3,x - inx - iny - dec $03 ;do this until all the digits are written - bne DigitPLoop - lda #$00 ;put null terminator at end - sta VRAM_Buffer1+3,x - inx ;increment buffer pointer by 3 - inx - inx - stx VRAM_Buffer1_Offset ;store it in case we want to use it again -ExitOutputN: rts - -;------------------------------------------------------------------------------------- - -DigitsMathRoutine: - lda OperMode ;check mode of operation - cmp #TitleScreenModeValue - beq EraseDMods ;if in title screen mode, branch to lock score - ldx #$05 -AddModLoop: lda DigitModifier,x ;load digit amount to increment - clc - adc DisplayDigits,y ;add to current digit - bmi BorrowOne ;if result is a negative number, branch to subtract - cmp #10 - bcs CarryOne ;if digit greater than $09, branch to add -StoreNewD: sta DisplayDigits,y ;store as new score or game timer digit - dey ;move onto next digits in score or game timer - dex ;and digit amounts to increment - bpl AddModLoop ;loop back if we're not done yet -EraseDMods: lda #$00 ;store zero here - ldx #$06 ;start with the last digit -EraseMLoop: sta DigitModifier-1,x ;initialize the digit amounts to increment - dex - bpl EraseMLoop ;do this until they're all reset, then leave - rts -BorrowOne: dec DigitModifier-1,x ;decrement the previous digit, then put $09 in - lda #$09 ;the game timer digit we're currently on to "borrow - bne StoreNewD ;the one", then do an unconditional branch back -CarryOne: sec ;subtract ten from our digit to make it a - sbc #10 ;proper BCD number, then increment the digit - inc DigitModifier-1,x ;preceding current digit to "carry the one" properly - jmp StoreNewD ;go back to just after we branched here - -;------------------------------------------------------------------------------------- - -UpdateTopScore: - ldx #$05 ;start with mario's score - jsr TopScoreCheck - ldx #$0b ;now do luigi's score - -TopScoreCheck: - ldy #$05 ;start with the lowest digit - sec -GetScoreDiff: lda PlayerScoreDisplay,x ;subtract each player digit from each high score digit - sbc TopScoreDisplay,y ;from lowest to highest, if any top score digit exceeds - dex ;any player digit, borrow will be set until a subsequent - dey ;subtraction clears it (player digit is higher than top) - bpl GetScoreDiff - bcc NoTopSc ;check to see if borrow is still set, if so, no new high score - inx ;increment X and Y once to the start of the score - iny -CopyScore: lda PlayerScoreDisplay,x ;store player's score digits into high score memory area - sta TopScoreDisplay,y - inx - iny - cpy #$06 ;do this until we have stored them all - bcc CopyScore -NoTopSc: rts - -;------------------------------------------------------------------------------------- - -DefaultSprOffsets: - .db $04, $30, $48, $60, $78, $90, $a8, $c0 - .db $d8, $e8, $24, $f8, $fc, $28, $2c - -Sprite0Data: - .db $18, $ff, $23, $58 - -;------------------------------------------------------------------------------------- - -InitializeGame: - ldy #$6f ;clear all memory as in initialization procedure, - jsr InitializeMemory ;but this time, clear only as far as $076f - ldy #$1f -ClrSndLoop: sta SoundMemory,y ;clear out memory used - dey ;by the sound engines - bpl ClrSndLoop - lda #$18 ;set demo timer - sta DemoTimer - jsr LoadAreaPointer - -InitializeArea: - ldy #$4b ;clear all memory again, only as far as $074b - jsr InitializeMemory ;this is only necessary if branching from - ldx #$21 - lda #$00 -ClrTimersLoop: sta Timers,x ;clear out memory between - dex ;$0780 and $07a1 - bpl ClrTimersLoop - lda HalfwayPage - ldy AltEntranceControl ;if AltEntranceControl not set, use halfway page, if any found - beq StartPage - lda EntrancePage ;otherwise use saved entry page number here -StartPage: sta ScreenLeft_PageLoc ;set as value here - sta CurrentPageLoc ;also set as current page - sta BackloadingFlag ;set flag here if halfway page or saved entry page number found - jsr GetScreenPosition ;get pixel coordinates for screen borders - ldy #$20 ;if on odd numbered page, use $2480 as start of rendering - and #%00000001 ;otherwise use $2080, this address used later as name table - beq SetInitNTHigh ;address for rendering of game area - ldy #$24 -SetInitNTHigh: sty CurrentNTAddr_High ;store name table address - ldy #$80 - sty CurrentNTAddr_Low - asl ;store LSB of page number in high nybble - asl ;of block buffer column position - asl - asl - sta BlockBufferColumnPos - dec AreaObjectLength ;set area object lengths for all empty - dec AreaObjectLength+1 - dec AreaObjectLength+2 - lda #$0b ;set value for renderer to update 12 column sets - sta ColumnSets ;12 column sets = 24 metatile columns = 1 1/2 screens - jsr GetAreaDataAddrs ;get enemy and level addresses and load header - lda PrimaryHardMode ;check to see if primary hard mode has been activated - bne SetSecHard ;if so, activate the secondary no matter where we're at - lda WorldNumber ;otherwise check world number - cmp #World5 ;if less than 5, do not activate secondary - bcc CheckHalfway - bne SetSecHard ;if not equal to, then world > 5, thus activate - lda LevelNumber ;otherwise, world 5, so check level number - cmp #Level3 ;if 1 or 2, do not set secondary hard mode flag - bcc CheckHalfway -SetSecHard: inc SecondaryHardMode ;set secondary hard mode flag for areas 5-3 and beyond -CheckHalfway: lda HalfwayPage - beq DoneInitArea - lda #$02 ;if halfway page set, overwrite start position from header - sta PlayerEntranceCtrl -DoneInitArea: lda #Silence ;silence music - sta AreaMusicQueue - lda #$01 ;disable screen output - sta DisableScreenFlag - inc OperMode_Task ;increment one of the modes - rts - -;------------------------------------------------------------------------------------- - -PrimaryGameSetup: - lda #$01 - sta FetchNewGameTimerFlag ;set flag to load game timer from header - sta PlayerSize ;set player's size to small - lda #$02 - sta NumberofLives ;give each player three lives - sta OffScr_NumberofLives - -SecondaryGameSetup: - lda #$00 - sta DisableScreenFlag ;enable screen output - tay -ClearVRLoop: sta VRAM_Buffer1-1,y ;clear buffer at $0300-$03ff - iny - bne ClearVRLoop - sta GameTimerExpiredFlag ;clear game timer exp flag - sta DisableIntermediate ;clear skip lives display flag - sta BackloadingFlag ;clear value here - lda #$ff - sta BalPlatformAlignment ;initialize balance platform assignment flag - lda ScreenLeft_PageLoc ;get left side page location - lsr Mirror_PPU_CTRL_REG1 ;shift LSB of ppu register #1 mirror out - and #$01 ;mask out all but LSB of page location - ror ;rotate LSB of page location into carry then onto mirror - rol Mirror_PPU_CTRL_REG1 ;this is to set the proper PPU name table - jsr GetAreaMusic ;load proper music into queue - lda #$38 ;load sprite shuffle amounts to be used later - sta SprShuffleAmt+2 - lda #$48 - sta SprShuffleAmt+1 - lda #$58 - sta SprShuffleAmt - ldx #$0e ;load default OAM offsets into $06e4-$06f2 -ShufAmtLoop: lda DefaultSprOffsets,x - sta SprDataOffset,x - dex ;do this until they're all set - bpl ShufAmtLoop - ldy #$03 ;set up sprite #0 -ISpr0Loop: lda Sprite0Data,y - sta Sprite_Data,y - dey - bpl ISpr0Loop - jsr DoNothing2 ;these jsrs doesn't do anything useful - jsr DoNothing1 - inc Sprite0HitDetectFlag ;set sprite #0 check flag - inc OperMode_Task ;increment to next task - rts - -;------------------------------------------------------------------------------------- - -;$06 - RAM address low -;$07 - RAM address high - -InitializeMemory: - ldx #$07 ;set initial high byte to $0700-$07ff - lda #$00 ;set initial low byte to start of page (at $00 of page) - sta $06 -InitPageLoop: stx $07 -InitByteLoop: cpx #$01 ;check to see if we're on the stack ($0100-$01ff) - bne InitByte ;if not, go ahead anyway - cpy #$60 ;otherwise, check to see if we're at $0160-$01ff - bcs SkipByte ;if so, skip write -InitByte: sta ($06),y ;otherwise, initialize byte with current low byte in Y -SkipByte: dey - cpy #$ff ;do this until all bytes in page have been erased - bne InitByteLoop - dex ;go onto the next page - bpl InitPageLoop ;do this until all pages of memory have been erased - rts - -;------------------------------------------------------------------------------------- - -MusicSelectData: - .db WaterMusic, GroundMusic, UndergroundMusic, CastleMusic - .db CloudMusic, PipeIntroMusic - -GetAreaMusic: - lda OperMode ;if in title screen mode, leave - beq ExitGetM - lda AltEntranceControl ;check for specific alternate mode of entry - cmp #$02 ;if found, branch without checking starting position - beq ChkAreaType ;from area object data header - ldy #$05 ;select music for pipe intro scene by default - lda PlayerEntranceCtrl ;check value from level header for certain values - cmp #$06 - beq StoreMusic ;load music for pipe intro scene if header - cmp #$07 ;start position either value $06 or $07 - beq StoreMusic -ChkAreaType: ldy AreaType ;load area type as offset for music bit - lda CloudTypeOverride - beq StoreMusic ;check for cloud type override - ldy #$04 ;select music for cloud type level if found -StoreMusic: lda MusicSelectData,y ;otherwise select appropriate music for level type - sta AreaMusicQueue ;store in queue and leave -ExitGetM: rts - -;------------------------------------------------------------------------------------- - -PlayerStarting_X_Pos: - .db $28, $18 - .db $38, $28 - -AltYPosOffset: - .db $08, $00 - -PlayerStarting_Y_Pos: - .db $00, $20, $b0, $50, $00, $00, $b0, $b0 - .db $f0 - -PlayerBGPriorityData: - .db $00, $20, $00, $00, $00, $00, $00, $00 - -GameTimerData: - .db $20 ;dummy byte, used as part of bg priority data - .db $04, $03, $02 - -Entrance_GameTimerSetup: - lda ScreenLeft_PageLoc ;set current page for area objects - sta Player_PageLoc ;as page location for player - lda #$28 ;store value here - sta VerticalForceDown ;for fractional movement downwards if necessary - lda #$01 ;set high byte of player position and - sta PlayerFacingDir ;set facing direction so that player faces right - sta Player_Y_HighPos - lda #$00 ;set player state to on the ground by default - sta Player_State - dec Player_CollisionBits ;initialize player's collision bits - ldy #$00 ;initialize halfway page - sty HalfwayPage - lda AreaType ;check area type - bne ChkStPos ;if water type, set swimming flag, otherwise do not set - iny -ChkStPos: sty SwimmingFlag - ldx PlayerEntranceCtrl ;get starting position loaded from header - ldy AltEntranceControl ;check alternate mode of entry flag for 0 or 1 - beq SetStPos - cpy #$01 - beq SetStPos - ldx AltYPosOffset-2,y ;if not 0 or 1, override $0710 with new offset in X -SetStPos: lda PlayerStarting_X_Pos,y ;load appropriate horizontal position - sta Player_X_Position ;and vertical positions for the player, using - lda PlayerStarting_Y_Pos,x ;AltEntranceControl as offset for horizontal and either $0710 - sta Player_Y_Position ;or value that overwrote $0710 as offset for vertical - lda PlayerBGPriorityData,x - sta Player_SprAttrib ;set player sprite attributes using offset in X - jsr GetPlayerColors ;get appropriate player palette - ldy GameTimerSetting ;get timer control value from header - beq ChkOverR ;if set to zero, branch (do not use dummy byte for this) - lda FetchNewGameTimerFlag ;do we need to set the game timer? if not, use - beq ChkOverR ;old game timer setting - lda GameTimerData,y ;if game timer is set and game timer flag is also set, - sta GameTimerDisplay ;use value of game timer control for first digit of game timer - lda #$01 - sta GameTimerDisplay+2 ;set last digit of game timer to 1 - lsr - sta GameTimerDisplay+1 ;set second digit of game timer - sta FetchNewGameTimerFlag ;clear flag for game timer reset - sta StarInvincibleTimer ;clear star mario timer -ChkOverR: ldy JoypadOverride ;if controller bits not set, branch to skip this part - beq ChkSwimE - lda #$03 ;set player state to climbing - sta Player_State - ldx #$00 ;set offset for first slot, for block object - jsr InitBlock_XY_Pos - lda #$f0 ;set vertical coordinate for block object - sta Block_Y_Position - ldx #$05 ;set offset in X for last enemy object buffer slot - ldy #$00 ;set offset in Y for object coordinates used earlier - jsr Setup_Vine ;do a sub to grow vine -ChkSwimE: ldy AreaType ;if level not water-type, - bne SetPESub ;skip this subroutine - jsr SetupBubble ;otherwise, execute sub to set up air bubbles -SetPESub: lda #$07 ;set to run player entrance subroutine - sta GameEngineSubroutine ;on the next frame of game engine - rts - -;------------------------------------------------------------------------------------- - -;page numbers are in order from -1 to -4 -HalfwayPageNybbles: - .db $56, $40 - .db $65, $70 - .db $66, $40 - .db $66, $40 - .db $66, $40 - .db $66, $60 - .db $65, $70 - .db $00, $00 - -PlayerLoseLife: - inc DisableScreenFlag ;disable screen and sprite 0 check - lda #$00 - sta Sprite0HitDetectFlag - lda #Silence ;silence music - sta EventMusicQueue - dec NumberofLives ;take one life from player - bpl StillInGame ;if player still has lives, branch - lda #$00 - sta OperMode_Task ;initialize mode task, - lda #GameOverModeValue ;switch to game over mode - sta OperMode ;and leave - rts -StillInGame: lda WorldNumber ;multiply world number by 2 and use - asl ;as offset - tax - lda LevelNumber ;if in area -3 or -4, increment - and #$02 ;offset by one byte, otherwise - beq GetHalfway ;leave offset alone - inx -GetHalfway: ldy HalfwayPageNybbles,x ;get halfway page number with offset - lda LevelNumber ;check area number's LSB - lsr - tya ;if in area -2 or -4, use lower nybble - bcs MaskHPNyb - lsr ;move higher nybble to lower if area - lsr ;number is -1 or -3 - lsr - lsr -MaskHPNyb: and #%00001111 ;mask out all but lower nybble - cmp ScreenLeft_PageLoc - beq SetHalfway ;left side of screen must be at the halfway page, - bcc SetHalfway ;otherwise player must start at the - lda #$00 ;beginning of the level -SetHalfway: sta HalfwayPage ;store as halfway page for player - jsr TransposePlayers ;switch players around if 2-player game - jmp ContinueGame ;continue the game - -;------------------------------------------------------------------------------------- - -GameOverMode: - lda OperMode_Task - jsr JumpEngine - - .dw SetupGameOver - .dw ScreenRoutines - .dw RunGameOver - -;------------------------------------------------------------------------------------- - -SetupGameOver: - lda #$00 ;reset screen routine task control for title screen, game, - sta ScreenRoutineTask ;and game over modes - sta Sprite0HitDetectFlag ;disable sprite 0 check - lda #GameOverMusic - sta EventMusicQueue ;put game over music in secondary queue - inc DisableScreenFlag ;disable screen output - inc OperMode_Task ;set secondary mode to 1 - rts - -;------------------------------------------------------------------------------------- - -RunGameOver: - lda #$00 ;reenable screen - sta DisableScreenFlag - lda SavedJoypad1Bits ;check controller for start pressed - and #Start_Button - bne TerminateGame - lda ScreenTimer ;if not pressed, wait for - bne GameIsOn ;screen timer to expire -TerminateGame: - lda #Silence ;silence music - sta EventMusicQueue - jsr TransposePlayers ;check if other player can keep - bcc ContinueGame ;going, and do so if possible - lda WorldNumber ;otherwise put world number of current - sta ContinueWorld ;player into secret continue function variable - lda #$00 - asl ;residual ASL instruction - sta OperMode_Task ;reset all modes to title screen and - sta ScreenTimer ;leave - sta OperMode - rts - -ContinueGame: - jsr LoadAreaPointer ;update level pointer with - lda #$01 ;actual world and area numbers, then - sta PlayerSize ;reset player's size, status, and - inc FetchNewGameTimerFlag ;set game timer flag to reload - lda #$00 ;game timer from header - sta TimerControl ;also set flag for timers to count again - sta PlayerStatus - sta GameEngineSubroutine ;reset task for game core - sta OperMode_Task ;set modes and leave - lda #$01 ;if in game over mode, switch back to - sta OperMode ;game mode, because game is still on -GameIsOn: rts - -TransposePlayers: - sec ;set carry flag by default to end game - lda NumberOfPlayers ;if only a 1 player game, leave - beq ExTrans - lda OffScr_NumberofLives ;does offscreen player have any lives left? - bmi ExTrans ;branch if not - lda CurrentPlayer ;invert bit to update - eor #%00000001 ;which player is on the screen - sta CurrentPlayer - ldx #$06 -TransLoop: lda OnscreenPlayerInfo,x ;transpose the information - pha ;of the onscreen player - lda OffscreenPlayerInfo,x ;with that of the offscreen player - sta OnscreenPlayerInfo,x - pla - sta OffscreenPlayerInfo,x - dex - bpl TransLoop - clc ;clear carry flag to get game going -ExTrans: rts - -;------------------------------------------------------------------------------------- - -DoNothing1: - lda #$ff ;this is residual code, this value is - sta $06c9 ;not used anywhere in the program -DoNothing2: - rts - -;------------------------------------------------------------------------------------- - -AreaParserTaskHandler: - ldy AreaParserTaskNum ;check number of tasks here - bne DoAPTasks ;if already set, go ahead - ldy #$08 - sty AreaParserTaskNum ;otherwise, set eight by default -DoAPTasks: dey - tya - jsr AreaParserTasks - dec AreaParserTaskNum ;if all tasks not complete do not - bne SkipATRender ;render attribute table yet - jsr RenderAttributeTables -SkipATRender: rts - -AreaParserTasks: - jsr JumpEngine - - .dw IncrementColumnPos - .dw RenderAreaGraphics - .dw RenderAreaGraphics - .dw AreaParserCore - .dw IncrementColumnPos - .dw RenderAreaGraphics - .dw RenderAreaGraphics - .dw AreaParserCore - -;------------------------------------------------------------------------------------- - -IncrementColumnPos: - inc CurrentColumnPos ;increment column where we're at - lda CurrentColumnPos - and #%00001111 ;mask out higher nybble - bne NoColWrap - sta CurrentColumnPos ;if no bits left set, wrap back to zero (0-f) - inc CurrentPageLoc ;and increment page number where we're at -NoColWrap: inc BlockBufferColumnPos ;increment column offset where we're at - lda BlockBufferColumnPos - and #%00011111 ;mask out all but 5 LSB (0-1f) - sta BlockBufferColumnPos ;and save - rts - -;------------------------------------------------------------------------------------- -;$00 - used as counter, store for low nybble for background, ceiling byte for terrain -;$01 - used to store floor byte for terrain -;$07 - used to store terrain metatile -;$06-$07 - used to store block buffer address - -BSceneDataOffsets: - .db $00, $30, $60 - -BackSceneryData: - .db $93, $00, $00, $11, $12, $12, $13, $00 ;clouds - .db $00, $51, $52, $53, $00, $00, $00, $00 - .db $00, $00, $01, $02, $02, $03, $00, $00 - .db $00, $00, $00, $00, $91, $92, $93, $00 - .db $00, $00, $00, $51, $52, $53, $41, $42 - .db $43, $00, $00, $00, $00, $00, $91, $92 - - .db $97, $87, $88, $89, $99, $00, $00, $00 ;mountains and bushes - .db $11, $12, $13, $a4, $a5, $a5, $a5, $a6 - .db $97, $98, $99, $01, $02, $03, $00, $a4 - .db $a5, $a6, $00, $11, $12, $12, $12, $13 - .db $00, $00, $00, $00, $01, $02, $02, $03 - .db $00, $a4, $a5, $a5, $a6, $00, $00, $00 - - .db $11, $12, $12, $13, $00, $00, $00, $00 ;trees and fences - .db $00, $00, $00, $9c, $00, $8b, $aa, $aa - .db $aa, $aa, $11, $12, $13, $8b, $00, $9c - .db $9c, $00, $00, $01, $02, $03, $11, $12 - .db $12, $13, $00, $00, $00, $00, $aa, $aa - .db $9c, $aa, $00, $8b, $00, $01, $02, $03 - -BackSceneryMetatiles: - .db $80, $83, $00 ;cloud left - .db $81, $84, $00 ;cloud middle - .db $82, $85, $00 ;cloud right - .db $02, $00, $00 ;bush left - .db $03, $00, $00 ;bush middle - .db $04, $00, $00 ;bush right - .db $00, $05, $06 ;mountain left - .db $07, $06, $0a ;mountain middle - .db $00, $08, $09 ;mountain right - .db $4d, $00, $00 ;fence - .db $0d, $0f, $4e ;tall tree - .db $0e, $4e, $4e ;short tree - -FSceneDataOffsets: - .db $00, $0d, $1a - -ForeSceneryData: - .db $86, $87, $87, $87, $87, $87, $87 ;in water - .db $87, $87, $87, $87, $69, $69 - - .db $00, $00, $00, $00, $00, $45, $47 ;wall - .db $47, $47, $47, $47, $00, $00 - - .db $00, $00, $00, $00, $00, $00, $00 ;over water - .db $00, $00, $00, $00, $86, $87 - -TerrainMetatiles: - .db $69, $54, $52, $62 - -TerrainRenderBits: - .db %00000000, %00000000 ;no ceiling or floor - .db %00000000, %00011000 ;no ceiling, floor 2 - .db %00000001, %00011000 ;ceiling 1, floor 2 - .db %00000111, %00011000 ;ceiling 3, floor 2 - .db %00001111, %00011000 ;ceiling 4, floor 2 - .db %11111111, %00011000 ;ceiling 8, floor 2 - .db %00000001, %00011111 ;ceiling 1, floor 5 - .db %00000111, %00011111 ;ceiling 3, floor 5 - .db %00001111, %00011111 ;ceiling 4, floor 5 - .db %10000001, %00011111 ;ceiling 1, floor 6 - .db %00000001, %00000000 ;ceiling 1, no floor - .db %10001111, %00011111 ;ceiling 4, floor 6 - .db %11110001, %00011111 ;ceiling 1, floor 9 - .db %11111001, %00011000 ;ceiling 1, middle 5, floor 2 - .db %11110001, %00011000 ;ceiling 1, middle 4, floor 2 - .db %11111111, %00011111 ;completely solid top to bottom - -AreaParserCore: - lda BackloadingFlag ;check to see if we are starting right of start - beq RenderSceneryTerrain ;if not, go ahead and render background, foreground and terrain - jsr ProcessAreaData ;otherwise skip ahead and load level data - -RenderSceneryTerrain: - ldx #$0c - lda #$00 -ClrMTBuf: sta MetatileBuffer,x ;clear out metatile buffer - dex - bpl ClrMTBuf - ldy BackgroundScenery ;do we need to render the background scenery? - beq RendFore ;if not, skip to check the foreground - lda CurrentPageLoc ;otherwise check for every third page -ThirdP: cmp #$03 - bmi RendBack ;if less than three we're there - sec - sbc #$03 ;if 3 or more, subtract 3 and - bpl ThirdP ;do an unconditional branch -RendBack: asl ;move results to higher nybble - asl - asl - asl - adc BSceneDataOffsets-1,y ;add to it offset loaded from here - adc CurrentColumnPos ;add to the result our current column position - tax - lda BackSceneryData,x ;load data from sum of offsets - beq RendFore ;if zero, no scenery for that part - pha - and #$0f ;save to stack and clear high nybble - sec - sbc #$01 ;subtract one (because low nybble is $01-$0c) - sta $00 ;save low nybble - asl ;multiply by three (shift to left and add result to old one) - adc $00 ;note that since d7 was nulled, the carry flag is always clear - tax ;save as offset for background scenery metatile data - pla ;get high nybble from stack, move low - lsr - lsr - lsr - lsr - tay ;use as second offset (used to determine height) - lda #$03 ;use previously saved memory location for counter - sta $00 -SceLoop1: lda BackSceneryMetatiles,x ;load metatile data from offset of (lsb - 1) * 3 - sta MetatileBuffer,y ;store into buffer from offset of (msb / 16) - inx - iny - cpy #$0b ;if at this location, leave loop - beq RendFore - dec $00 ;decrement until counter expires, barring exception - bne SceLoop1 -RendFore: ldx ForegroundScenery ;check for foreground data needed or not - beq RendTerr ;if not, skip this part - ldy FSceneDataOffsets-1,x ;load offset from location offset by header value, then - ldx #$00 ;reinit X -SceLoop2: lda ForeSceneryData,y ;load data until counter expires - beq NoFore ;do not store if zero found - sta MetatileBuffer,x -NoFore: iny - inx - cpx #$0d ;store up to end of metatile buffer - bne SceLoop2 -RendTerr: ldy AreaType ;check world type for water level - bne TerMTile ;if not water level, skip this part - lda WorldNumber ;check world number, if not world number eight - cmp #World8 ;then skip this part - bne TerMTile - lda #$62 ;if set as water level and world number eight, - jmp StoreMT ;use castle wall metatile as terrain type -TerMTile: lda TerrainMetatiles,y ;otherwise get appropriate metatile for area type - ldy CloudTypeOverride ;check for cloud type override - beq StoreMT ;if not set, keep value otherwise - lda #$88 ;use cloud block terrain -StoreMT: sta $07 ;store value here - ldx #$00 ;initialize X, use as metatile buffer offset - lda TerrainControl ;use yet another value from the header - asl ;multiply by 2 and use as yet another offset - tay -TerrLoop: lda TerrainRenderBits,y ;get one of the terrain rendering bit data - sta $00 - iny ;increment Y and use as offset next time around - sty $01 - lda CloudTypeOverride ;skip if value here is zero - beq NoCloud2 - cpx #$00 ;otherwise, check if we're doing the ceiling byte - beq NoCloud2 - lda $00 ;if not, mask out all but d3 - and #%00001000 - sta $00 -NoCloud2: ldy #$00 ;start at beginning of bitmasks -TerrBChk: lda Bitmasks,y ;load bitmask, then perform AND on contents of first byte - bit $00 - beq NextTBit ;if not set, skip this part (do not write terrain to buffer) - lda $07 - sta MetatileBuffer,x ;load terrain type metatile number and store into buffer here -NextTBit: inx ;continue until end of buffer - cpx #$0d - beq RendBBuf ;if we're at the end, break out of this loop - lda AreaType ;check world type for underground area - cmp #$02 - bne EndUChk ;if not underground, skip this part - cpx #$0b - bne EndUChk ;if we're at the bottom of the screen, override - lda #$54 ;old terrain type with ground level terrain type - sta $07 -EndUChk: iny ;increment bitmasks offset in Y - cpy #$08 - bne TerrBChk ;if not all bits checked, loop back - ldy $01 - bne TerrLoop ;unconditional branch, use Y to load next byte -RendBBuf: jsr ProcessAreaData ;do the area data loading routine now - lda BlockBufferColumnPos - jsr GetBlockBufferAddr ;get block buffer address from where we're at - ldx #$00 - ldy #$00 ;init index regs and start at beginning of smaller buffer -ChkMTLow: sty $00 - lda MetatileBuffer,x ;load stored metatile number - and #%11000000 ;mask out all but 2 MSB - asl - rol ;make %xx000000 into %000000xx - rol - tay ;use as offset in Y - lda MetatileBuffer,x ;reload original unmasked value here - cmp BlockBuffLowBounds,y ;check for certain values depending on bits set - bcs StrBlock ;if equal or greater, branch - lda #$00 ;if less, init value before storing -StrBlock: ldy $00 ;get offset for block buffer - sta ($06),y ;store value into block buffer - tya - clc ;add 16 (move down one row) to offset - adc #$10 - tay - inx ;increment column value - cpx #$0d - bcc ChkMTLow ;continue until we pass last row, then leave - rts - -;numbers lower than these with the same attribute bits -;will not be stored in the block buffer -BlockBuffLowBounds: - .db $10, $51, $88, $c0 - -;------------------------------------------------------------------------------------- -;$00 - used to store area object identifier -;$07 - used as adder to find proper area object code - -ProcessAreaData: - ldx #$02 ;start at the end of area object buffer -ProcADLoop: stx ObjectOffset - lda #$00 ;reset flag - sta BehindAreaParserFlag - ldy AreaDataOffset ;get offset of area data pointer - lda (AreaData),y ;get first byte of area object - cmp #$fd ;if end-of-area, skip all this crap - beq RdyDecode - lda AreaObjectLength,x ;check area object buffer flag - bpl RdyDecode ;if buffer not negative, branch, otherwise - iny - lda (AreaData),y ;get second byte of area object - asl ;check for page select bit (d7), branch if not set - bcc Chk1Row13 - lda AreaObjectPageSel ;check page select - bne Chk1Row13 - inc AreaObjectPageSel ;if not already set, set it now - inc AreaObjectPageLoc ;and increment page location -Chk1Row13: dey - lda (AreaData),y ;reread first byte of level object - and #$0f ;mask out high nybble - cmp #$0d ;row 13? - bne Chk1Row14 - iny ;if so, reread second byte of level object - lda (AreaData),y - dey ;decrement to get ready to read first byte - and #%01000000 ;check for d6 set (if not, object is page control) - bne CheckRear - lda AreaObjectPageSel ;if page select is set, do not reread - bne CheckRear - iny ;if d6 not set, reread second byte - lda (AreaData),y - and #%00011111 ;mask out all but 5 LSB and store in page control - sta AreaObjectPageLoc - inc AreaObjectPageSel ;increment page select - jmp NextAObj -Chk1Row14: cmp #$0e ;row 14? - bne CheckRear - lda BackloadingFlag ;check flag for saved page number and branch if set - bne RdyDecode ;to render the object (otherwise bg might not look right) -CheckRear: lda AreaObjectPageLoc ;check to see if current page of level object is - cmp CurrentPageLoc ;behind current page of renderer - bcc SetBehind ;if so branch -RdyDecode: jsr DecodeAreaData ;do sub and do not turn on flag - jmp ChkLength -SetBehind: inc BehindAreaParserFlag ;turn on flag if object is behind renderer -NextAObj: jsr IncAreaObjOffset ;increment buffer offset and move on -ChkLength: ldx ObjectOffset ;get buffer offset - lda AreaObjectLength,x ;check object length for anything stored here - bmi ProcLoopb ;if not, branch to handle loopback - dec AreaObjectLength,x ;otherwise decrement length or get rid of it -ProcLoopb: dex ;decrement buffer offset - bpl ProcADLoop ;and loopback unless exceeded buffer - lda BehindAreaParserFlag ;check for flag set if objects were behind renderer - bne ProcessAreaData ;branch if true to load more level data, otherwise - lda BackloadingFlag ;check for flag set if starting right of page $00 - bne ProcessAreaData ;branch if true to load more level data, otherwise leave -EndAParse: rts - -IncAreaObjOffset: - inc AreaDataOffset ;increment offset of level pointer - inc AreaDataOffset - lda #$00 ;reset page select - sta AreaObjectPageSel - rts - -DecodeAreaData: - lda AreaObjectLength,x ;check current buffer flag - bmi Chk1stB - ldy AreaObjOffsetBuffer,x ;if not, get offset from buffer -Chk1stB: ldx #$10 ;load offset of 16 for special row 15 - lda (AreaData),y ;get first byte of level object again - cmp #$fd - beq EndAParse ;if end of level, leave this routine - and #$0f ;otherwise, mask out low nybble - cmp #$0f ;row 15? - beq ChkRow14 ;if so, keep the offset of 16 - ldx #$08 ;otherwise load offset of 8 for special row 12 - cmp #$0c ;row 12? - beq ChkRow14 ;if so, keep the offset value of 8 - ldx #$00 ;otherwise nullify value by default -ChkRow14: stx $07 ;store whatever value we just loaded here - ldx ObjectOffset ;get object offset again - cmp #$0e ;row 14? - bne ChkRow13 - lda #$00 ;if so, load offset with $00 - sta $07 - lda #$2e ;and load A with another value - bne NormObj ;unconditional branch -ChkRow13: cmp #$0d ;row 13? - bne ChkSRows - lda #$22 ;if so, load offset with 34 - sta $07 - iny ;get next byte - lda (AreaData),y - and #%01000000 ;mask out all but d6 (page control obj bit) - beq LeavePar ;if d6 clear, branch to leave (we handled this earlier) - lda (AreaData),y ;otherwise, get byte again - and #%01111111 ;mask out d7 - cmp #$4b ;check for loop command in low nybble - bne Mask2MSB ;(plus d6 set for object other than page control) - inc LoopCommand ;if loop command, set loop command flag -Mask2MSB: and #%00111111 ;mask out d7 and d6 - jmp NormObj ;and jump -ChkSRows: cmp #$0c ;row 12-15? - bcs SpecObj - iny ;if not, get second byte of level object - lda (AreaData),y - and #%01110000 ;mask out all but d6-d4 - bne LrgObj ;if any bits set, branch to handle large object - lda #$16 - sta $07 ;otherwise set offset of 24 for small object - lda (AreaData),y ;reload second byte of level object - and #%00001111 ;mask out higher nybble and jump - jmp NormObj -LrgObj: sta $00 ;store value here (branch for large objects) - cmp #$70 ;check for vertical pipe object - bne NotWPipe - lda (AreaData),y ;if not, reload second byte - and #%00001000 ;mask out all but d3 (usage control bit) - beq NotWPipe ;if d3 clear, branch to get original value - lda #$00 ;otherwise, nullify value for warp pipe - sta $00 -NotWPipe: lda $00 ;get value and jump ahead - jmp MoveAOId -SpecObj: iny ;branch here for rows 12-15 - lda (AreaData),y - and #%01110000 ;get next byte and mask out all but d6-d4 -MoveAOId: lsr ;move d6-d4 to lower nybble - lsr - lsr - lsr -NormObj: sta $00 ;store value here (branch for small objects and rows 13 and 14) - lda AreaObjectLength,x ;is there something stored here already? - bpl RunAObj ;if so, branch to do its particular sub - lda AreaObjectPageLoc ;otherwise check to see if the object we've loaded is on the - cmp CurrentPageLoc ;same page as the renderer, and if so, branch - beq InitRear - ldy AreaDataOffset ;if not, get old offset of level pointer - lda (AreaData),y ;and reload first byte - and #%00001111 - cmp #$0e ;row 14? - bne LeavePar - lda BackloadingFlag ;if so, check backloading flag - bne StrAObj ;if set, branch to render object, else leave -LeavePar: rts -InitRear: lda BackloadingFlag ;check backloading flag to see if it's been initialized - beq BackColC ;branch to column-wise check - lda #$00 ;if not, initialize both backloading and - sta BackloadingFlag ;behind-renderer flags and leave - sta BehindAreaParserFlag - sta ObjectOffset -LoopCmdE: rts -BackColC: ldy AreaDataOffset ;get first byte again - lda (AreaData),y - and #%11110000 ;mask out low nybble and move high to low - lsr - lsr - lsr - lsr - cmp CurrentColumnPos ;is this where we're at? - bne LeavePar ;if not, branch to leave -StrAObj: lda AreaDataOffset ;if so, load area obj offset and store in buffer - sta AreaObjOffsetBuffer,x - jsr IncAreaObjOffset ;do sub to increment to next object data -RunAObj: lda $00 ;get stored value and add offset to it - clc ;then use the jump engine with current contents of A - adc $07 - jsr JumpEngine - -;large objects (rows $00-$0b or 00-11, d6-d4 set) - .dw VerticalPipe ;used by warp pipes - .dw AreaStyleObject - .dw RowOfBricks - .dw RowOfSolidBlocks - .dw RowOfCoins - .dw ColumnOfBricks - .dw ColumnOfSolidBlocks - .dw VerticalPipe ;used by decoration pipes - -;objects for special row $0c or 12 - .dw Hole_Empty - .dw PulleyRopeObject - .dw Bridge_High - .dw Bridge_Middle - .dw Bridge_Low - .dw Hole_Water - .dw QuestionBlockRow_High - .dw QuestionBlockRow_Low - -;objects for special row $0f or 15 - .dw EndlessRope - .dw BalancePlatRope - .dw CastleObject - .dw StaircaseObject - .dw ExitPipe - .dw FlagBalls_Residual - -;small objects (rows $00-$0b or 00-11, d6-d4 all clear) - .dw QuestionBlock ;power-up - .dw QuestionBlock ;coin - .dw QuestionBlock ;hidden, coin - .dw Hidden1UpBlock ;hidden, 1-up - .dw BrickWithItem ;brick, power-up - .dw BrickWithItem ;brick, vine - .dw BrickWithItem ;brick, star - .dw BrickWithCoins ;brick, coins - .dw BrickWithItem ;brick, 1-up - .dw WaterPipe - .dw EmptyBlock - .dw Jumpspring - -;objects for special row $0d or 13 (d6 set) - .dw IntroPipe - .dw FlagpoleObject - .dw AxeObj - .dw ChainObj - .dw CastleBridgeObj - .dw ScrollLockObject_Warp - .dw ScrollLockObject - .dw ScrollLockObject - .dw AreaFrenzy ;flying cheep-cheeps - .dw AreaFrenzy ;bullet bills or swimming cheep-cheeps - .dw AreaFrenzy ;stop frenzy - .dw LoopCmdE - -;object for special row $0e or 14 - .dw AlterAreaAttributes - -;------------------------------------------------------------------------------------- -;(these apply to all area object subroutines in this section unless otherwise stated) -;$00 - used to store offset used to find object code -;$07 - starts with adder from area parser, used to store row offset - -AlterAreaAttributes: - ldy AreaObjOffsetBuffer,x ;load offset for level object data saved in buffer - iny ;load second byte - lda (AreaData),y - pha ;save in stack for now - and #%01000000 - bne Alter2 ;branch if d6 is set - pla - pha ;pull and push offset to copy to A - and #%00001111 ;mask out high nybble and store as - sta TerrainControl ;new terrain height type bits - pla - and #%00110000 ;pull and mask out all but d5 and d4 - lsr ;move bits to lower nybble and store - lsr ;as new background scenery bits - lsr - lsr - sta BackgroundScenery ;then leave - rts -Alter2: pla - and #%00000111 ;mask out all but 3 LSB - cmp #$04 ;if four or greater, set color control bits - bcc SetFore ;and nullify foreground scenery bits - sta BackgroundColorCtrl - lda #$00 -SetFore: sta ForegroundScenery ;otherwise set new foreground scenery bits - rts - -;-------------------------------- - -ScrollLockObject_Warp: - ldx #$04 ;load value of 4 for game text routine as default - lda WorldNumber ;warp zone (4-3-2), then check world number - beq WarpNum - inx ;if world number > 1, increment for next warp zone (5) - ldy AreaType ;check area type - dey - bne WarpNum ;if ground area type, increment for last warp zone - inx ;(8-7-6) and move on -WarpNum: txa - sta WarpZoneControl ;store number here to be used by warp zone routine - jsr WriteGameText ;print text and warp zone numbers - lda #PiranhaPlant - jsr KillEnemies ;load identifier for piranha plants and do sub - -ScrollLockObject: - lda ScrollLock ;invert scroll lock to turn it on - eor #%00000001 - sta ScrollLock - rts - -;-------------------------------- -;$00 - used to store enemy identifier in KillEnemies - -KillEnemies: - sta $00 ;store identifier here - lda #$00 - ldx #$04 ;check for identifier in enemy object buffer -KillELoop: ldy Enemy_ID,x - cpy $00 ;if not found, branch - bne NoKillE - sta Enemy_Flag,x ;if found, deactivate enemy object flag -NoKillE: dex ;do this until all slots are checked - bpl KillELoop - rts - -;-------------------------------- - -FrenzyIDData: - .db FlyCheepCheepFrenzy, BBill_CCheep_Frenzy, Stop_Frenzy - -AreaFrenzy: ldx $00 ;use area object identifier bit as offset - lda FrenzyIDData-8,x ;note that it starts at 8, thus weird address here - ldy #$05 -FreCompLoop: dey ;check regular slots of enemy object buffer - bmi ExitAFrenzy ;if all slots checked and enemy object not found, branch to store - cmp Enemy_ID,y ;check for enemy object in buffer versus frenzy object - bne FreCompLoop - lda #$00 ;if enemy object already present, nullify queue and leave -ExitAFrenzy: sta EnemyFrenzyQueue ;store enemy into frenzy queue - rts - -;-------------------------------- -;$06 - used by MushroomLedge to store length - -AreaStyleObject: - lda AreaStyle ;load level object style and jump to the right sub - jsr JumpEngine - .dw TreeLedge ;also used for cloud type levels - .dw MushroomLedge - .dw BulletBillCannon - -TreeLedge: - jsr GetLrgObjAttrib ;get row and length of green ledge - lda AreaObjectLength,x ;check length counter for expiration - beq EndTreeL - bpl MidTreeL - tya - sta AreaObjectLength,x ;store lower nybble into buffer flag as length of ledge - lda CurrentPageLoc - ora CurrentColumnPos ;are we at the start of the level? - beq MidTreeL - lda #$16 ;render start of tree ledge - jmp NoUnder -MidTreeL: ldx $07 - lda #$17 ;render middle of tree ledge - sta MetatileBuffer,x ;note that this is also used if ledge position is - lda #$4c ;at the start of level for continuous effect - jmp AllUnder ;now render the part underneath -EndTreeL: lda #$18 ;render end of tree ledge - jmp NoUnder - -MushroomLedge: - jsr ChkLrgObjLength ;get shroom dimensions - sty $06 ;store length here for now - bcc EndMushL - lda AreaObjectLength,x ;divide length by 2 and store elsewhere - lsr - sta MushroomLedgeHalfLen,x - lda #$19 ;render start of mushroom - jmp NoUnder -EndMushL: lda #$1b ;if at the end, render end of mushroom - ldy AreaObjectLength,x - beq NoUnder - lda MushroomLedgeHalfLen,x ;get divided length and store where length - sta $06 ;was stored originally - ldx $07 - lda #$1a - sta MetatileBuffer,x ;render middle of mushroom - cpy $06 ;are we smack dab in the center? - bne MushLExit ;if not, branch to leave - inx - lda #$4f - sta MetatileBuffer,x ;render stem top of mushroom underneath the middle - lda #$50 -AllUnder: inx - ldy #$0f ;set $0f to render all way down - jmp RenderUnderPart ;now render the stem of mushroom -NoUnder: ldx $07 ;load row of ledge - ldy #$00 ;set 0 for no bottom on this part - jmp RenderUnderPart - -;-------------------------------- - -;tiles used by pulleys and rope object -PulleyRopeMetatiles: - .db $42, $41, $43 - -PulleyRopeObject: - jsr ChkLrgObjLength ;get length of pulley/rope object - ldy #$00 ;initialize metatile offset - bcs RenderPul ;if starting, render left pulley - iny - lda AreaObjectLength,x ;if not at the end, render rope - bne RenderPul - iny ;otherwise render right pulley -RenderPul: lda PulleyRopeMetatiles,y - sta MetatileBuffer ;render at the top of the screen -MushLExit: rts ;and leave - -;-------------------------------- -;$06 - used to store upper limit of rows for CastleObject - -CastleMetatiles: - .db $00, $45, $45, $45, $00 - .db $00, $48, $47, $46, $00 - .db $45, $49, $49, $49, $45 - .db $47, $47, $4a, $47, $47 - .db $47, $47, $4b, $47, $47 - .db $49, $49, $49, $49, $49 - .db $47, $4a, $47, $4a, $47 - .db $47, $4b, $47, $4b, $47 - .db $47, $47, $47, $47, $47 - .db $4a, $47, $4a, $47, $4a - .db $4b, $47, $4b, $47, $4b - -CastleObject: - jsr GetLrgObjAttrib ;save lower nybble as starting row - sty $07 ;if starting row is above $0a, game will crash!!! - ldy #$04 - jsr ChkLrgObjFixedLength ;load length of castle if not already loaded - txa - pha ;save obj buffer offset to stack - ldy AreaObjectLength,x ;use current length as offset for castle data - ldx $07 ;begin at starting row - lda #$0b - sta $06 ;load upper limit of number of rows to print -CRendLoop: lda CastleMetatiles,y ;load current byte using offset - sta MetatileBuffer,x - inx ;store in buffer and increment buffer offset - lda $06 - beq ChkCFloor ;have we reached upper limit yet? - iny ;if not, increment column-wise - iny ;to byte in next row - iny - iny - iny - dec $06 ;move closer to upper limit -ChkCFloor: cpx #$0b ;have we reached the row just before floor? - bne CRendLoop ;if not, go back and do another row - pla - tax ;get obj buffer offset from before - lda CurrentPageLoc - beq ExitCastle ;if we're at page 0, we do not need to do anything else - lda AreaObjectLength,x ;check length - cmp #$01 ;if length almost about to expire, put brick at floor - beq PlayerStop - ldy $07 ;check starting row for tall castle ($00) - bne NotTall - cmp #$03 ;if found, then check to see if we're at the second column - beq PlayerStop -NotTall: cmp #$02 ;if not tall castle, check to see if we're at the third column - bne ExitCastle ;if we aren't and the castle is tall, don't create flag yet - jsr GetAreaObjXPosition ;otherwise, obtain and save horizontal pixel coordinate - pha - jsr FindEmptyEnemySlot ;find an empty place on the enemy object buffer - pla - sta Enemy_X_Position,x ;then write horizontal coordinate for star flag - lda CurrentPageLoc - sta Enemy_PageLoc,x ;set page location for star flag - lda #$01 - sta Enemy_Y_HighPos,x ;set vertical high byte - sta Enemy_Flag,x ;set flag for buffer - lda #$90 - sta Enemy_Y_Position,x ;set vertical coordinate - lda #StarFlagObject ;set star flag value in buffer itself - sta Enemy_ID,x - rts -PlayerStop: ldy #$52 ;put brick at floor to stop player at end of level - sty MetatileBuffer+10 ;this is only done if we're on the second column -ExitCastle: rts - -;-------------------------------- - -WaterPipe: - jsr GetLrgObjAttrib ;get row and lower nybble - ldy AreaObjectLength,x ;get length (residual code, water pipe is 1 col thick) - ldx $07 ;get row - lda #$6b - sta MetatileBuffer,x ;draw something here and below it - lda #$6c - sta MetatileBuffer+1,x - rts - -;-------------------------------- -;$05 - used to store length of vertical shaft in RenderSidewaysPipe -;$06 - used to store leftover horizontal length in RenderSidewaysPipe -; and vertical length in VerticalPipe and GetPipeHeight - -IntroPipe: - ldy #$03 ;check if length set, if not set, set it - jsr ChkLrgObjFixedLength - ldy #$0a ;set fixed value and render the sideways part - jsr RenderSidewaysPipe - bcs NoBlankP ;if carry flag set, not time to draw vertical pipe part - ldx #$06 ;blank everything above the vertical pipe part -VPipeSectLoop: lda #$00 ;all the way to the top of the screen - sta MetatileBuffer,x ;because otherwise it will look like exit pipe - dex - bpl VPipeSectLoop - lda VerticalPipeData,y ;draw the end of the vertical pipe part - sta MetatileBuffer+7 -NoBlankP: rts - -SidePipeShaftData: - .db $15, $14 ;used to control whether or not vertical pipe shaft - .db $00, $00 ;is drawn, and if so, controls the metatile number -SidePipeTopPart: - .db $15, $1e ;top part of sideways part of pipe - .db $1d, $1c -SidePipeBottomPart: - .db $15, $21 ;bottom part of sideways part of pipe - .db $20, $1f - -ExitPipe: - ldy #$03 ;check if length set, if not set, set it - jsr ChkLrgObjFixedLength - jsr GetLrgObjAttrib ;get vertical length, then plow on through RenderSidewaysPipe - -RenderSidewaysPipe: - dey ;decrement twice to make room for shaft at bottom - dey ;and store here for now as vertical length - sty $05 - ldy AreaObjectLength,x ;get length left over and store here - sty $06 - ldx $05 ;get vertical length plus one, use as buffer offset - inx - lda SidePipeShaftData,y ;check for value $00 based on horizontal offset - cmp #$00 - beq DrawSidePart ;if found, do not draw the vertical pipe shaft - ldx #$00 - ldy $05 ;init buffer offset and get vertical length - jsr RenderUnderPart ;and render vertical shaft using tile number in A - clc ;clear carry flag to be used by IntroPipe -DrawSidePart: ldy $06 ;render side pipe part at the bottom - lda SidePipeTopPart,y - sta MetatileBuffer,x ;note that the pipe parts are stored - lda SidePipeBottomPart,y ;backwards horizontally - sta MetatileBuffer+1,x - rts - -VerticalPipeData: - .db $11, $10 ;used by pipes that lead somewhere - .db $15, $14 - .db $13, $12 ;used by decoration pipes - .db $15, $14 - -VerticalPipe: - jsr GetPipeHeight - lda $00 ;check to see if value was nullified earlier - beq WarpPipe ;(if d3, the usage control bit of second byte, was set) - iny - iny - iny - iny ;add four if usage control bit was not set -WarpPipe: tya ;save value in stack - pha - lda AreaNumber - ora WorldNumber ;if at world 1-1, do not add piranha plant ever - beq DrawPipe - ldy AreaObjectLength,x ;if on second column of pipe, branch - beq DrawPipe ;(because we only need to do this once) - jsr FindEmptyEnemySlot ;check for an empty moving data buffer space - bcs DrawPipe ;if not found, too many enemies, thus skip - jsr GetAreaObjXPosition ;get horizontal pixel coordinate - clc - adc #$08 ;add eight to put the piranha plant in the center - sta Enemy_X_Position,x ;store as enemy's horizontal coordinate - lda CurrentPageLoc ;add carry to current page number - adc #$00 - sta Enemy_PageLoc,x ;store as enemy's page coordinate - lda #$01 - sta Enemy_Y_HighPos,x - sta Enemy_Flag,x ;activate enemy flag - jsr GetAreaObjYPosition ;get piranha plant's vertical coordinate and store here - sta Enemy_Y_Position,x - lda #PiranhaPlant ;write piranha plant's value into buffer - sta Enemy_ID,x - jsr InitPiranhaPlant -DrawPipe: pla ;get value saved earlier and use as Y - tay - ldx $07 ;get buffer offset - lda VerticalPipeData,y ;draw the appropriate pipe with the Y we loaded earlier - sta MetatileBuffer,x ;render the top of the pipe - inx - lda VerticalPipeData+2,y ;render the rest of the pipe - ldy $06 ;subtract one from length and render the part underneath - dey - jmp RenderUnderPart - -GetPipeHeight: - ldy #$01 ;check for length loaded, if not, load - jsr ChkLrgObjFixedLength ;pipe length of 2 (horizontal) - jsr GetLrgObjAttrib - tya ;get saved lower nybble as height - and #$07 ;save only the three lower bits as - sta $06 ;vertical length, then load Y with - ldy AreaObjectLength,x ;length left over - rts - -FindEmptyEnemySlot: - ldx #$00 ;start at first enemy slot -EmptyChkLoop: clc ;clear carry flag by default - lda Enemy_Flag,x ;check enemy buffer for nonzero - beq ExitEmptyChk ;if zero, leave - inx - cpx #$05 ;if nonzero, check next value - bne EmptyChkLoop -ExitEmptyChk: rts ;if all values nonzero, carry flag is set - -;-------------------------------- - -Hole_Water: - jsr ChkLrgObjLength ;get low nybble and save as length - lda #$86 ;render waves - sta MetatileBuffer+10 - ldx #$0b - ldy #$01 ;now render the water underneath - lda #$87 - jmp RenderUnderPart - -;-------------------------------- - -QuestionBlockRow_High: - lda #$03 ;start on the fourth row - .db $2c ;BIT instruction opcode - -QuestionBlockRow_Low: - lda #$07 ;start on the eighth row - pha ;save whatever row to the stack for now - jsr ChkLrgObjLength ;get low nybble and save as length - pla - tax ;render question boxes with coins - lda #$c0 - sta MetatileBuffer,x - rts - -;-------------------------------- - -Bridge_High: - lda #$06 ;start on the seventh row from top of screen - .db $2c ;BIT instruction opcode - -Bridge_Middle: - lda #$07 ;start on the eighth row - .db $2c ;BIT instruction opcode - -Bridge_Low: - lda #$09 ;start on the tenth row - pha ;save whatever row to the stack for now - jsr ChkLrgObjLength ;get low nybble and save as length - pla - tax ;render bridge railing - lda #$0b - sta MetatileBuffer,x - inx - ldy #$00 ;now render the bridge itself - lda #$63 - jmp RenderUnderPart - -;-------------------------------- - -FlagBalls_Residual: - jsr GetLrgObjAttrib ;get low nybble from object byte - ldx #$02 ;render flag balls on third row from top - lda #$6d ;of screen downwards based on low nybble - jmp RenderUnderPart - -;-------------------------------- - -FlagpoleObject: - lda #$24 ;render flagpole ball on top - sta MetatileBuffer - ldx #$01 ;now render the flagpole shaft - ldy #$08 - lda #$25 - jsr RenderUnderPart - lda #$61 ;render solid block at the bottom - sta MetatileBuffer+10 - jsr GetAreaObjXPosition - sec ;get pixel coordinate of where the flagpole is, - sbc #$08 ;subtract eight pixels and use as horizontal - sta Enemy_X_Position+5 ;coordinate for the flag - lda CurrentPageLoc - sbc #$00 ;subtract borrow from page location and use as - sta Enemy_PageLoc+5 ;page location for the flag - lda #$30 - sta Enemy_Y_Position+5 ;set vertical coordinate for flag - lda #$b0 - sta FlagpoleFNum_Y_Pos ;set initial vertical coordinate for flagpole's floatey number - lda #FlagpoleFlagObject - sta Enemy_ID+5 ;set flag identifier, note that identifier and coordinates - inc Enemy_Flag+5 ;use last space in enemy object buffer - rts - -;-------------------------------- - -EndlessRope: - ldx #$00 ;render rope from the top to the bottom of screen - ldy #$0f - jmp DrawRope - -BalancePlatRope: - txa ;save object buffer offset for now - pha - ldx #$01 ;blank out all from second row to the bottom - ldy #$0f ;with blank used for balance platform rope - lda #$44 - jsr RenderUnderPart - pla ;get back object buffer offset - tax - jsr GetLrgObjAttrib ;get vertical length from lower nybble - ldx #$01 -DrawRope: lda #$40 ;render the actual rope - jmp RenderUnderPart - -;-------------------------------- - -CoinMetatileData: - .db $c3, $c2, $c2, $c2 - -RowOfCoins: - ldy AreaType ;get area type - lda CoinMetatileData,y ;load appropriate coin metatile - jmp GetRow - -;-------------------------------- - -C_ObjectRow: - .db $06, $07, $08 - -C_ObjectMetatile: - .db $c5, $0c, $89 - -CastleBridgeObj: - ldy #$0c ;load length of 13 columns - jsr ChkLrgObjFixedLength - jmp ChainObj - -AxeObj: - lda #$08 ;load bowser's palette into sprite portion of palette - sta VRAM_Buffer_AddrCtrl - -ChainObj: - ldy $00 ;get value loaded earlier from decoder - ldx C_ObjectRow-2,y ;get appropriate row and metatile for object - lda C_ObjectMetatile-2,y - jmp ColObj - -EmptyBlock: - jsr GetLrgObjAttrib ;get row location - ldx $07 - lda #$c4 -ColObj: ldy #$00 ;column length of 1 - jmp RenderUnderPart - -;-------------------------------- - -SolidBlockMetatiles: - .db $69, $61, $61, $62 - -BrickMetatiles: - .db $22, $51, $52, $52 - .db $88 ;used only by row of bricks object - -RowOfBricks: - ldy AreaType ;load area type obtained from area offset pointer - lda CloudTypeOverride ;check for cloud type override - beq DrawBricks - ldy #$04 ;if cloud type, override area type -DrawBricks: lda BrickMetatiles,y ;get appropriate metatile - jmp GetRow ;and go render it - -RowOfSolidBlocks: - ldy AreaType ;load area type obtained from area offset pointer - lda SolidBlockMetatiles,y ;get metatile -GetRow: pha ;store metatile here - jsr ChkLrgObjLength ;get row number, load length -DrawRow: ldx $07 - ldy #$00 ;set vertical height of 1 - pla - jmp RenderUnderPart ;render object - -ColumnOfBricks: - ldy AreaType ;load area type obtained from area offset - lda BrickMetatiles,y ;get metatile (no cloud override as for row) - jmp GetRow2 - -ColumnOfSolidBlocks: - ldy AreaType ;load area type obtained from area offset - lda SolidBlockMetatiles,y ;get metatile -GetRow2: pha ;save metatile to stack for now - jsr GetLrgObjAttrib ;get length and row - pla ;restore metatile - ldx $07 ;get starting row - jmp RenderUnderPart ;now render the column - -;-------------------------------- - -BulletBillCannon: - jsr GetLrgObjAttrib ;get row and length of bullet bill cannon - ldx $07 ;start at first row - lda #$64 ;render bullet bill cannon - sta MetatileBuffer,x - inx - dey ;done yet? - bmi SetupCannon - lda #$65 ;if not, render middle part - sta MetatileBuffer,x - inx - dey ;done yet? - bmi SetupCannon - lda #$66 ;if not, render bottom until length expires - jsr RenderUnderPart -SetupCannon: ldx Cannon_Offset ;get offset for data used by cannons and whirlpools - jsr GetAreaObjYPosition ;get proper vertical coordinate for cannon - sta Cannon_Y_Position,x ;and store it here - lda CurrentPageLoc - sta Cannon_PageLoc,x ;store page number for cannon here - jsr GetAreaObjXPosition ;get proper horizontal coordinate for cannon - sta Cannon_X_Position,x ;and store it here - inx - cpx #$06 ;increment and check offset - bcc StrCOffset ;if not yet reached sixth cannon, branch to save offset - ldx #$00 ;otherwise initialize it -StrCOffset: stx Cannon_Offset ;save new offset and leave - rts - -;-------------------------------- - -StaircaseHeightData: - .db $07, $07, $06, $05, $04, $03, $02, $01, $00 - -StaircaseRowData: - .db $03, $03, $04, $05, $06, $07, $08, $09, $0a - -StaircaseObject: - jsr ChkLrgObjLength ;check and load length - bcc NextStair ;if length already loaded, skip init part - lda #$09 ;start past the end for the bottom - sta StaircaseControl ;of the staircase -NextStair: dec StaircaseControl ;move onto next step (or first if starting) - ldy StaircaseControl - ldx StaircaseRowData,y ;get starting row and height to render - lda StaircaseHeightData,y - tay - lda #$61 ;now render solid block staircase - jmp RenderUnderPart - -;-------------------------------- - -Jumpspring: - jsr GetLrgObjAttrib - jsr FindEmptyEnemySlot ;find empty space in enemy object buffer - jsr GetAreaObjXPosition ;get horizontal coordinate for jumpspring - sta Enemy_X_Position,x ;and store - lda CurrentPageLoc ;store page location of jumpspring - sta Enemy_PageLoc,x - jsr GetAreaObjYPosition ;get vertical coordinate for jumpspring - sta Enemy_Y_Position,x ;and store - sta Jumpspring_FixedYPos,x ;store as permanent coordinate here - lda #JumpspringObject - sta Enemy_ID,x ;write jumpspring object to enemy object buffer - ldy #$01 - sty Enemy_Y_HighPos,x ;store vertical high byte - inc Enemy_Flag,x ;set flag for enemy object buffer - ldx $07 - lda #$67 ;draw metatiles in two rows where jumpspring is - sta MetatileBuffer,x - lda #$68 - sta MetatileBuffer+1,x - rts - -;-------------------------------- -;$07 - used to save ID of brick object - -Hidden1UpBlock: - lda Hidden1UpFlag ;if flag not set, do not render object - beq ExitDecBlock - lda #$00 ;if set, init for the next one - sta Hidden1UpFlag - jmp BrickWithItem ;jump to code shared with unbreakable bricks - -QuestionBlock: - jsr GetAreaObjectID ;get value from level decoder routine - jmp DrawQBlk ;go to render it - -BrickWithCoins: - lda #$00 ;initialize multi-coin timer flag - sta BrickCoinTimerFlag - -BrickWithItem: - jsr GetAreaObjectID ;save area object ID - sty $07 - lda #$00 ;load default adder for bricks with lines - ldy AreaType ;check level type for ground level - dey - beq BWithL ;if ground type, do not start with 5 - lda #$05 ;otherwise use adder for bricks without lines -BWithL: clc ;add object ID to adder - adc $07 - tay ;use as offset for metatile -DrawQBlk: lda BrickQBlockMetatiles,y ;get appropriate metatile for brick (question block - pha ;if branched to here from question block routine) - jsr GetLrgObjAttrib ;get row from location byte - jmp DrawRow ;now render the object - -GetAreaObjectID: - lda $00 ;get value saved from area parser routine - sec - sbc #$00 ;possibly residual code - tay ;save to Y -ExitDecBlock: rts - -;-------------------------------- - -HoleMetatiles: - .db $87, $00, $00, $00 - -Hole_Empty: - jsr ChkLrgObjLength ;get lower nybble and save as length - bcc NoWhirlP ;skip this part if length already loaded - lda AreaType ;check for water type level - bne NoWhirlP ;if not water type, skip this part - ldx Whirlpool_Offset ;get offset for data used by cannons and whirlpools - jsr GetAreaObjXPosition ;get proper vertical coordinate of where we're at - sec - sbc #$10 ;subtract 16 pixels - sta Whirlpool_LeftExtent,x ;store as left extent of whirlpool - lda CurrentPageLoc ;get page location of where we're at - sbc #$00 ;subtract borrow - sta Whirlpool_PageLoc,x ;save as page location of whirlpool - iny - iny ;increment length by 2 - tya - asl ;multiply by 16 to get size of whirlpool - asl ;note that whirlpool will always be - asl ;two blocks bigger than actual size of hole - asl ;and extend one block beyond each edge - sta Whirlpool_Length,x ;save size of whirlpool here - inx - cpx #$05 ;increment and check offset - bcc StrWOffset ;if not yet reached fifth whirlpool, branch to save offset - ldx #$00 ;otherwise initialize it -StrWOffset: stx Whirlpool_Offset ;save new offset here -NoWhirlP: ldx AreaType ;get appropriate metatile, then - lda HoleMetatiles,x ;render the hole proper - ldx #$08 - ldy #$0f ;start at ninth row and go to bottom, run RenderUnderPart - -;-------------------------------- - -RenderUnderPart: - sty AreaObjectHeight ;store vertical length to render - ldy MetatileBuffer,x ;check current spot to see if there's something - beq DrawThisRow ;we need to keep, if nothing, go ahead - cpy #$17 - beq WaitOneRow ;if middle part (tree ledge), wait until next row - cpy #$1a - beq WaitOneRow ;if middle part (mushroom ledge), wait until next row - cpy #$c0 - beq DrawThisRow ;if question block w/ coin, overwrite - cpy #$c0 - bcs WaitOneRow ;if any other metatile with palette 3, wait until next row - cpy #$54 - bne DrawThisRow ;if cracked rock terrain, overwrite - cmp #$50 - beq WaitOneRow ;if stem top of mushroom, wait until next row -DrawThisRow: sta MetatileBuffer,x ;render contents of A from routine that called this -WaitOneRow: inx - cpx #$0d ;stop rendering if we're at the bottom of the screen - bcs ExitUPartR - ldy AreaObjectHeight ;decrement, and stop rendering if there is no more length - dey - bpl RenderUnderPart -ExitUPartR: rts - -;-------------------------------- - -ChkLrgObjLength: - jsr GetLrgObjAttrib ;get row location and size (length if branched to from here) - -ChkLrgObjFixedLength: - lda AreaObjectLength,x ;check for set length counter - clc ;clear carry flag for not just starting - bpl LenSet ;if counter not set, load it, otherwise leave alone - tya ;save length into length counter - sta AreaObjectLength,x - sec ;set carry flag if just starting -LenSet: rts - - -GetLrgObjAttrib: - ldy AreaObjOffsetBuffer,x ;get offset saved from area obj decoding routine - lda (AreaData),y ;get first byte of level object - and #%00001111 - sta $07 ;save row location - iny - lda (AreaData),y ;get next byte, save lower nybble (length or height) - and #%00001111 ;as Y, then leave - tay - rts - -;-------------------------------- - -GetAreaObjXPosition: - lda CurrentColumnPos ;multiply current offset where we're at by 16 - asl ;to obtain horizontal pixel coordinate - asl - asl - asl - rts - -;-------------------------------- - -GetAreaObjYPosition: - lda $07 ;multiply value by 16 - asl - asl ;this will give us the proper vertical pixel coordinate - asl - asl - clc - adc #32 ;add 32 pixels for the status bar - rts - -;------------------------------------------------------------------------------------- -;$06-$07 - used to store block buffer address used as indirect - -BlockBufferAddr: - .db Block_Buffer_1, >Block_Buffer_2 - -GetBlockBufferAddr: - pha ;take value of A, save - lsr ;move high nybble to low - lsr - lsr - lsr - tay ;use nybble as pointer to high byte - lda BlockBufferAddr+2,y ;of indirect here - sta $07 - pla - and #%00001111 ;pull from stack, mask out high nybble - clc - adc BlockBufferAddr,y ;add to low byte - sta $06 ;store here and leave - rts - -;------------------------------------------------------------------------------------- - -;unused space - .db $ff, $ff - -;------------------------------------------------------------------------------------- - -AreaDataOfsLoopback: - .db $12, $36, $0e, $0e, $0e, $32, $32, $32, $0a, $26, $40 - -;------------------------------------------------------------------------------------- - -LoadAreaPointer: - jsr FindAreaPointer ;find it and store it here - sta AreaPointer -GetAreaType: and #%01100000 ;mask out all but d6 and d5 - asl - rol - rol - rol ;make %0xx00000 into %000000xx - sta AreaType ;save 2 MSB as area type - rts - -FindAreaPointer: - ldy WorldNumber ;load offset from world variable - lda WorldAddrOffsets,y - clc ;add area number used to find data - adc AreaNumber - tay - lda AreaAddrOffsets,y ;from there we have our area pointer - rts - - -GetAreaDataAddrs: - lda AreaPointer ;use 2 MSB for Y - jsr GetAreaType - tay - lda AreaPointer ;mask out all but 5 LSB - and #%00011111 - sta AreaAddrsLOffset ;save as low offset - lda EnemyAddrHOffsets,y ;load base value with 2 altered MSB, - clc ;then add base value to 5 LSB, result - adc AreaAddrsLOffset ;becomes offset for level data - tay - lda EnemyDataAddrLow,y ;use offset to load pointer - sta EnemyDataLow - lda EnemyDataAddrHigh,y - sta EnemyDataHigh - ldy AreaType ;use area type as offset - lda AreaDataHOffsets,y ;do the same thing but with different base value - clc - adc AreaAddrsLOffset - tay - lda AreaDataAddrLow,y ;use this offset to load another pointer - sta AreaDataLow - lda AreaDataAddrHigh,y - sta AreaDataHigh - ldy #$00 ;load first byte of header - lda (AreaData),y - pha ;save it to the stack for now - and #%00000111 ;save 3 LSB for foreground scenery or bg color control - cmp #$04 - bcc StoreFore - sta BackgroundColorCtrl ;if 4 or greater, save value here as bg color control - lda #$00 -StoreFore: sta ForegroundScenery ;if less, save value here as foreground scenery - pla ;pull byte from stack and push it back - pha - and #%00111000 ;save player entrance control bits - lsr ;shift bits over to LSBs - lsr - lsr - sta PlayerEntranceCtrl ;save value here as player entrance control - pla ;pull byte again but do not push it back - and #%11000000 ;save 2 MSB for game timer setting - clc - rol ;rotate bits over to LSBs - rol - rol - sta GameTimerSetting ;save value here as game timer setting - iny - lda (AreaData),y ;load second byte of header - pha ;save to stack - and #%00001111 ;mask out all but lower nybble - sta TerrainControl - pla ;pull and push byte to copy it to A - pha - and #%00110000 ;save 2 MSB for background scenery type - lsr - lsr ;shift bits to LSBs - lsr - lsr - sta BackgroundScenery ;save as background scenery - pla - and #%11000000 - clc - rol ;rotate bits over to LSBs - rol - rol - cmp #%00000011 ;if set to 3, store here - bne StoreStyle ;and nullify other value - sta CloudTypeOverride ;otherwise store value in other place - lda #$00 -StoreStyle: sta AreaStyle - lda AreaDataLow ;increment area data address by 2 bytes - clc - adc #$02 - sta AreaDataLow - lda AreaDataHigh - adc #$00 - sta AreaDataHigh - rts - -;------------------------------------------------------------------------------------- -;GAME LEVELS DATA - -WorldAddrOffsets: - .db World1Areas-AreaAddrOffsets, World2Areas-AreaAddrOffsets - .db World3Areas-AreaAddrOffsets, World4Areas-AreaAddrOffsets - .db World5Areas-AreaAddrOffsets, World6Areas-AreaAddrOffsets - .db World7Areas-AreaAddrOffsets, World8Areas-AreaAddrOffsets - -AreaAddrOffsets: -World1Areas: .db $25, $29, $c0, $26, $60 -World2Areas: .db $28, $29, $01, $27, $62 -World3Areas: .db $24, $35, $20, $63 -World4Areas: .db $22, $29, $41, $2c, $61 -World5Areas: .db $2a, $31, $26, $62 -World6Areas: .db $2e, $23, $2d, $60 -World7Areas: .db $33, $29, $01, $27, $64 -World8Areas: .db $30, $32, $21, $65 - -;bonus area data offsets, included here for comparison purposes -;underground bonus area - c2 -;cloud area 1 (day) - 2b -;cloud area 2 (night) - 34 -;water area (5-2/6-2) - 00 -;water area (8-4) - 02 -;warp zone area (4-2) - 2f - -EnemyAddrHOffsets: - .db $1f, $06, $1c, $00 - -EnemyDataAddrLow: - .db E_CastleArea1, >E_CastleArea2, >E_CastleArea3, >E_CastleArea4, >E_CastleArea5, >E_CastleArea6 - .db >E_GroundArea1, >E_GroundArea2, >E_GroundArea3, >E_GroundArea4, >E_GroundArea5, >E_GroundArea6 - .db >E_GroundArea7, >E_GroundArea8, >E_GroundArea9, >E_GroundArea10, >E_GroundArea11, >E_GroundArea12 - .db >E_GroundArea13, >E_GroundArea14, >E_GroundArea15, >E_GroundArea16, >E_GroundArea17, >E_GroundArea18 - .db >E_GroundArea19, >E_GroundArea20, >E_GroundArea21, >E_GroundArea22, >E_UndergroundArea1 - .db >E_UndergroundArea2, >E_UndergroundArea3, >E_WaterArea1, >E_WaterArea2, >E_WaterArea3 - -AreaDataHOffsets: - .db $00, $03, $19, $1c - -AreaDataAddrLow: - .db L_WaterArea1, >L_WaterArea2, >L_WaterArea3, >L_GroundArea1, >L_GroundArea2, >L_GroundArea3 - .db >L_GroundArea4, >L_GroundArea5, >L_GroundArea6, >L_GroundArea7, >L_GroundArea8, >L_GroundArea9 - .db >L_GroundArea10, >L_GroundArea11, >L_GroundArea12, >L_GroundArea13, >L_GroundArea14, >L_GroundArea15 - .db >L_GroundArea16, >L_GroundArea17, >L_GroundArea18, >L_GroundArea19, >L_GroundArea20, >L_GroundArea21 - .db >L_GroundArea22, >L_UndergroundArea1, >L_UndergroundArea2, >L_UndergroundArea3, >L_CastleArea1 - .db >L_CastleArea2, >L_CastleArea3, >L_CastleArea4, >L_CastleArea5, >L_CastleArea6 - -;ENEMY OBJECT DATA - -;level 1-4/6-4 -E_CastleArea1: - .db $76, $dd, $bb, $4c, $ea, $1d, $1b, $cc, $56, $5d - .db $16, $9d, $c6, $1d, $36, $9d, $c9, $1d, $04, $db - .db $49, $1d, $84, $1b, $c9, $5d, $88, $95, $0f, $08 - .db $30, $4c, $78, $2d, $a6, $28, $90, $b5 - .db $ff - -;level 4-4 -E_CastleArea2: - .db $0f, $03, $56, $1b, $c9, $1b, $0f, $07, $36, $1b - .db $aa, $1b, $48, $95, $0f, $0a, $2a, $1b, $5b, $0c - .db $78, $2d, $90, $b5 - .db $ff - -;level 2-4/5-4 -E_CastleArea3: - .db $0b, $8c, $4b, $4c, $77, $5f, $eb, $0c, $bd, $db - .db $19, $9d, $75, $1d, $7d, $5b, $d9, $1d, $3d, $dd - .db $99, $1d, $26, $9d, $5a, $2b, $8a, $2c, $ca, $1b - .db $20, $95, $7b, $5c, $db, $4c, $1b, $cc, $3b, $cc - .db $78, $2d, $a6, $28, $90, $b5 - .db $ff - -;level 3-4 -E_CastleArea4: - .db $0b, $8c, $3b, $1d, $8b, $1d, $ab, $0c, $db, $1d - .db $0f, $03, $65, $1d, $6b, $1b, $05, $9d, $0b, $1b - .db $05, $9b, $0b, $1d, $8b, $0c, $1b, $8c, $70, $15 - .db $7b, $0c, $db, $0c, $0f, $08, $78, $2d, $a6, $28 - .db $90, $b5 - .db $ff - -;level 7-4 -E_CastleArea5: - .db $27, $a9, $4b, $0c, $68, $29, $0f, $06, $77, $1b - .db $0f, $0b, $60, $15, $4b, $8c, $78, $2d, $90, $b5 - .db $ff - -;level 8-4 -E_CastleArea6: - .db $0f, $03, $8e, $65, $e1, $bb, $38, $6d, $a8, $3e, $e5, $e7 - .db $0f, $08, $0b, $02, $2b, $02, $5e, $65, $e1, $bb, $0e - .db $db, $0e, $bb, $8e, $db, $0e, $fe, $65, $ec, $0f, $0d - .db $4e, $65, $e1, $0f, $0e, $4e, $02, $e0, $0f, $10, $fe, $e5, $e1 - .db $1b, $85, $7b, $0c, $5b, $95, $78, $2d, $90, $b5 - .db $ff - -;level 3-3 -E_GroundArea1: - .db $a5, $86, $e4, $28, $18, $a8, $45, $83, $69, $03 - .db $c6, $29, $9b, $83, $16, $a4, $88, $24, $e9, $28 - .db $05, $a8, $7b, $28, $24, $8f, $c8, $03, $e8, $03 - .db $46, $a8, $85, $24, $c8, $24 - .db $ff - -;level 8-3 -E_GroundArea2: - .db $eb, $8e, $0f, $03, $fb, $05, $17, $85, $db, $8e - .db $0f, $07, $57, $05, $7b, $05, $9b, $80, $2b, $85 - .db $fb, $05, $0f, $0b, $1b, $05, $9b, $05 - .db $ff - -;level 4-1 -E_GroundArea3: - .db $2e, $c2, $66, $e2, $11, $0f, $07, $02, $11, $0f, $0c - .db $12, $11 - .db $ff - -;level 6-2 -E_GroundArea4: - .db $0e, $c2, $a8, $ab, $00, $bb, $8e, $6b, $82, $de, $00, $a0 - .db $33, $86, $43, $06, $3e, $b4, $a0, $cb, $02, $0f, $07 - .db $7e, $42, $a6, $83, $02, $0f, $0a, $3b, $02, $cb, $37 - .db $0f, $0c, $e3, $0e - .db $ff - -;level 3-1 -E_GroundArea5: - .db $9b, $8e, $ca, $0e, $ee, $42, $44, $5b, $86, $80, $b8 - .db $1b, $80, $50, $ba, $10, $b7, $5b, $00, $17, $85 - .db $4b, $05, $fe, $34, $40, $b7, $86, $c6, $06, $5b, $80 - .db $83, $00, $d0, $38, $5b, $8e, $8a, $0e, $a6, $00 - .db $bb, $0e, $c5, $80, $f3, $00 - .db $ff - -;level 1-1 -E_GroundArea6: - .db $1e, $c2, $00, $6b, $06, $8b, $86, $63, $b7, $0f, $05 - .db $03, $06, $23, $06, $4b, $b7, $bb, $00, $5b, $b7 - .db $fb, $37, $3b, $b7, $0f, $0b, $1b, $37 - .db $ff - -;level 1-3/5-3 -E_GroundArea7: - .db $2b, $d7, $e3, $03, $c2, $86, $e2, $06, $76, $a5 - .db $a3, $8f, $03, $86, $2b, $57, $68, $28, $e9, $28 - .db $e5, $83, $24, $8f, $36, $a8, $5b, $03 - .db $ff - -;level 2-3/7-3 -E_GroundArea8: - .db $0f, $02, $78, $40, $48, $ce, $f8, $c3, $f8, $c3 - .db $0f, $07, $7b, $43, $c6, $d0, $0f, $8a, $c8, $50 - .db $ff - -;level 2-1 -E_GroundArea9: - .db $85, $86, $0b, $80, $1b, $00, $db, $37, $77, $80 - .db $eb, $37, $fe, $2b, $20, $2b, $80, $7b, $38, $ab, $b8 - .db $77, $86, $fe, $42, $20, $49, $86, $8b, $06, $9b, $80 - .db $7b, $8e, $5b, $b7, $9b, $0e, $bb, $0e, $9b, $80 -;end of data terminator here is also used by pipe intro area -E_GroundArea10: - .db $ff - -;level 5-1 -E_GroundArea11: - .db $0b, $80, $60, $38, $10, $b8, $c0, $3b, $db, $8e - .db $40, $b8, $f0, $38, $7b, $8e, $a0, $b8, $c0, $b8 - .db $fb, $00, $a0, $b8, $30, $bb, $ee, $42, $88, $0f, $0b - .db $2b, $0e, $67, $0e - .db $ff - -;cloud level used in levels 2-1 and 5-2 -E_GroundArea12: - .db $0a, $aa, $0e, $28, $2a, $0e, $31, $88 - .db $ff - -;level 4-3 -E_GroundArea13: - .db $c7, $83, $d7, $03, $42, $8f, $7a, $03, $05, $a4 - .db $78, $24, $a6, $25, $e4, $25, $4b, $83, $e3, $03 - .db $05, $a4, $89, $24, $b5, $24, $09, $a4, $65, $24 - .db $c9, $24, $0f, $08, $85, $25 - .db $ff - -;level 6-3 -E_GroundArea14: - .db $cd, $a5, $b5, $a8, $07, $a8, $76, $28, $cc, $25 - .db $65, $a4, $a9, $24, $e5, $24, $19, $a4, $0f, $07 - .db $95, $28, $e6, $24, $19, $a4, $d7, $29, $16, $a9 - .db $58, $29, $97, $29 - .db $ff - -;level 6-1 -E_GroundArea15: - .db $0f, $02, $02, $11, $0f, $07, $02, $11 - .db $ff - -;warp zone area used in level 4-2 -E_GroundArea16: - .db $ff - -;level 8-1 -E_GroundArea17: - .db $2b, $82, $ab, $38, $de, $42, $e2, $1b, $b8, $eb - .db $3b, $db, $80, $8b, $b8, $1b, $82, $fb, $b8, $7b - .db $80, $fb, $3c, $5b, $bc, $7b, $b8, $1b, $8e, $cb - .db $0e, $1b, $8e, $0f, $0d, $2b, $3b, $bb, $b8, $eb, $82 - .db $4b, $b8, $bb, $38, $3b, $b7, $bb, $02, $0f, $13 - .db $1b, $00, $cb, $80, $6b, $bc - .db $ff - -;level 5-2 -E_GroundArea18: - .db $7b, $80, $ae, $00, $80, $8b, $8e, $e8, $05, $f9, $86 - .db $17, $86, $16, $85, $4e, $2b, $80, $ab, $8e, $87, $85 - .db $c3, $05, $8b, $82, $9b, $02, $ab, $02, $bb, $86 - .db $cb, $06, $d3, $03, $3b, $8e, $6b, $0e, $a7, $8e - .db $ff - -;level 8-2 -E_GroundArea19: - .db $29, $8e, $52, $11, $83, $0e, $0f, $03, $9b, $0e - .db $2b, $8e, $5b, $0e, $cb, $8e, $fb, $0e, $fb, $82 - .db $9b, $82, $bb, $02, $fe, $42, $e8, $bb, $8e, $0f, $0a - .db $ab, $0e, $cb, $0e, $f9, $0e, $88, $86, $a6, $06 - .db $db, $02, $b6, $8e - .db $ff - -;level 7-1 -E_GroundArea20: - .db $ab, $ce, $de, $42, $c0, $cb, $ce, $5b, $8e, $1b, $ce - .db $4b, $85, $67, $45, $0f, $07, $2b, $00, $7b, $85 - .db $97, $05, $0f, $0a, $92, $02 - .db $ff - -;cloud level used in levels 3-1 and 6-2 -E_GroundArea21: - .db $0a, $aa, $0e, $24, $4a, $1e, $23, $aa - .db $ff - -;level 3-2 -E_GroundArea22: - .db $1b, $80, $bb, $38, $4b, $bc, $eb, $3b, $0f, $04 - .db $2b, $00, $ab, $38, $eb, $00, $cb, $8e, $fb, $80 - .db $ab, $b8, $6b, $80, $fb, $3c, $9b, $bb, $5b, $bc - .db $fb, $00, $6b, $b8, $fb, $38 - .db $ff - -;level 1-2 -E_UndergroundArea1: - .db $0b, $86, $1a, $06, $db, $06, $de, $c2, $02, $f0, $3b - .db $bb, $80, $eb, $06, $0b, $86, $93, $06, $f0, $39 - .db $0f, $06, $60, $b8, $1b, $86, $a0, $b9, $b7, $27 - .db $bd, $27, $2b, $83, $a1, $26, $a9, $26, $ee, $25, $0b - .db $27, $b4 - .db $ff - -;level 4-2 -E_UndergroundArea2: - .db $0f, $02, $1e, $2f, $60, $e0, $3a, $a5, $a7, $db, $80 - .db $3b, $82, $8b, $02, $fe, $42, $68, $70, $bb, $25, $a7 - .db $2c, $27, $b2, $26, $b9, $26, $9b, $80, $a8, $82 - .db $b5, $27, $bc, $27, $b0, $bb, $3b, $82, $87, $34 - .db $ee, $25, $6b - .db $ff - -;underground bonus rooms area used in many levels -E_UndergroundArea3: - .db $1e, $a5, $0a, $2e, $28, $27, $2e, $33, $c7, $0f, $03, $1e, $40, $07 - .db $2e, $30, $e7, $0f, $05, $1e, $24, $44, $0f, $07, $1e, $22, $6a - .db $2e, $23, $ab, $0f, $09, $1e, $41, $68, $1e, $2a, $8a, $2e, $23, $a2 - .db $2e, $32, $ea - .db $ff - -;water area used in levels 5-2 and 6-2 -E_WaterArea1: - .db $3b, $87, $66, $27, $cc, $27, $ee, $31, $87, $ee, $23, $a7 - .db $3b, $87, $db, $07 - .db $ff - -;level 2-2/7-2 -E_WaterArea2: - .db $0f, $01, $2e, $25, $2b, $2e, $25, $4b, $4e, $25, $cb, $6b, $07 - .db $97, $47, $e9, $87, $47, $c7, $7a, $07, $d6, $c7 - .db $78, $07, $38, $87, $ab, $47, $e3, $07, $9b, $87 - .db $0f, $09, $68, $47, $db, $c7, $3b, $c7 - .db $ff - -;water area used in level 8-4 -E_WaterArea3: - .db $47, $9b, $cb, $07, $fa, $1d, $86, $9b, $3a, $87 - .db $56, $07, $88, $1b, $07, $9d, $2e, $65, $f0 - .db $ff - -;AREA OBJECT DATA - -;level 1-4/6-4 -L_CastleArea1: - .db $9b, $07 - .db $05, $32, $06, $33, $07, $34, $ce, $03, $dc, $51 - .db $ee, $07, $73, $e0, $74, $0a, $7e, $06, $9e, $0a - .db $ce, $06, $e4, $00, $e8, $0a, $fe, $0a, $2e, $89 - .db $4e, $0b, $54, $0a, $14, $8a, $c4, $0a, $34, $8a - .db $7e, $06, $c7, $0a, $01, $e0, $02, $0a, $47, $0a - .db $81, $60, $82, $0a, $c7, $0a, $0e, $87, $7e, $02 - .db $a7, $02, $b3, $02, $d7, $02, $e3, $02, $07, $82 - .db $13, $02, $3e, $06, $7e, $02, $ae, $07, $fe, $0a - .db $0d, $c4, $cd, $43, $ce, $09, $de, $0b, $dd, $42 - .db $fe, $02, $5d, $c7 - .db $fd - -;level 4-4 -L_CastleArea2: - .db $5b, $07 - .db $05, $32, $06, $33, $07, $34, $5e, $0a, $68, $64 - .db $98, $64, $a8, $64, $ce, $06, $fe, $02, $0d, $01 - .db $1e, $0e, $7e, $02, $94, $63, $b4, $63, $d4, $63 - .db $f4, $63, $14, $e3, $2e, $0e, $5e, $02, $64, $35 - .db $88, $72, $be, $0e, $0d, $04, $ae, $02, $ce, $08 - .db $cd, $4b, $fe, $02, $0d, $05, $68, $31, $7e, $0a - .db $96, $31, $a9, $63, $a8, $33, $d5, $30, $ee, $02 - .db $e6, $62, $f4, $61, $04, $b1, $08, $3f, $44, $33 - .db $94, $63, $a4, $31, $e4, $31, $04, $bf, $08, $3f - .db $04, $bf, $08, $3f, $cd, $4b, $03, $e4, $0e, $03 - .db $2e, $01, $7e, $06, $be, $02, $de, $06, $fe, $0a - .db $0d, $c4, $cd, $43, $ce, $09, $de, $0b, $dd, $42 - .db $fe, $02, $5d, $c7 - .db $fd - -;level 2-4/5-4 -L_CastleArea3: - .db $9b, $07 - .db $05, $32, $06, $33, $07, $34, $fe, $00, $27, $b1 - .db $65, $32, $75, $0a, $71, $00, $b7, $31, $08, $e4 - .db $18, $64, $1e, $04, $57, $3b, $bb, $0a, $17, $8a - .db $27, $3a, $73, $0a, $7b, $0a, $d7, $0a, $e7, $3a - .db $3b, $8a, $97, $0a, $fe, $08, $24, $8a, $2e, $00 - .db $3e, $40, $38, $64, $6f, $00, $9f, $00, $be, $43 - .db $c8, $0a, $c9, $63, $ce, $07, $fe, $07, $2e, $81 - .db $66, $42, $6a, $42, $79, $0a, $be, $00, $c8, $64 - .db $f8, $64, $08, $e4, $2e, $07, $7e, $03, $9e, $07 - .db $be, $03, $de, $07, $fe, $0a, $03, $a5, $0d, $44 - .db $cd, $43, $ce, $09, $dd, $42, $de, $0b, $fe, $02 - .db $5d, $c7 - .db $fd - -;level 3-4 -L_CastleArea4: - .db $9b, $07 - .db $05, $32, $06, $33, $07, $34, $fe, $06, $0c, $81 - .db $39, $0a, $5c, $01, $89, $0a, $ac, $01, $d9, $0a - .db $fc, $01, $2e, $83, $a7, $01, $b7, $00, $c7, $01 - .db $de, $0a, $fe, $02, $4e, $83, $5a, $32, $63, $0a - .db $69, $0a, $7e, $02, $ee, $03, $fa, $32, $03, $8a - .db $09, $0a, $1e, $02, $ee, $03, $fa, $32, $03, $8a - .db $09, $0a, $14, $42, $1e, $02, $7e, $0a, $9e, $07 - .db $fe, $0a, $2e, $86, $5e, $0a, $8e, $06, $be, $0a - .db $ee, $07, $3e, $83, $5e, $07, $fe, $0a, $0d, $c4 - .db $41, $52, $51, $52, $cd, $43, $ce, $09, $de, $0b - .db $dd, $42, $fe, $02, $5d, $c7 - .db $fd - -;level 7-4 -L_CastleArea5: - .db $5b, $07 - .db $05, $32, $06, $33, $07, $34, $fe, $0a, $ae, $86 - .db $be, $07, $fe, $02, $0d, $02, $27, $32, $46, $61 - .db $55, $62, $5e, $0e, $1e, $82, $68, $3c, $74, $3a - .db $7d, $4b, $5e, $8e, $7d, $4b, $7e, $82, $84, $62 - .db $94, $61, $a4, $31, $bd, $4b, $ce, $06, $fe, $02 - .db $0d, $06, $34, $31, $3e, $0a, $64, $32, $75, $0a - .db $7b, $61, $a4, $33, $ae, $02, $de, $0e, $3e, $82 - .db $64, $32, $78, $32, $b4, $36, $c8, $36, $dd, $4b - .db $44, $b2, $58, $32, $94, $63, $a4, $3e, $ba, $30 - .db $c9, $61, $ce, $06, $dd, $4b, $ce, $86, $dd, $4b - .db $fe, $02, $2e, $86, $5e, $02, $7e, $06, $fe, $02 - .db $1e, $86, $3e, $02, $5e, $06, $7e, $02, $9e, $06 - .db $fe, $0a, $0d, $c4, $cd, $43, $ce, $09, $de, $0b - .db $dd, $42, $fe, $02, $5d, $c7 - .db $fd - -;level 8-4 -L_CastleArea6: - .db $5b, $06 - .db $05, $32, $06, $33, $07, $34, $5e, $0a, $ae, $02 - .db $0d, $01, $39, $73, $0d, $03, $39, $7b, $4d, $4b - .db $de, $06, $1e, $8a, $ae, $06, $c4, $33, $16, $fe - .db $a5, $77, $fe, $02, $fe, $82, $0d, $07, $39, $73 - .db $a8, $74, $ed, $4b, $49, $fb, $e8, $74, $fe, $0a - .db $2e, $82, $67, $02, $84, $7a, $87, $31, $0d, $0b - .db $fe, $02, $0d, $0c, $39, $73, $5e, $06, $c6, $76 - .db $45, $ff, $be, $0a, $dd, $48, $fe, $06, $3d, $cb - .db $46, $7e, $ad, $4a, $fe, $82, $39, $f3, $a9, $7b - .db $4e, $8a, $9e, $07, $fe, $0a, $0d, $c4, $cd, $43 - .db $ce, $09, $de, $0b, $dd, $42, $fe, $02, $5d, $c7 - .db $fd - -;level 3-3 -L_GroundArea1: - .db $94, $11 - .db $0f, $26, $fe, $10, $28, $94, $65, $15, $eb, $12 - .db $fa, $41, $4a, $96, $54, $40, $a4, $42, $b7, $13 - .db $e9, $19, $f5, $15, $11, $80, $47, $42, $71, $13 - .db $80, $41, $15, $92, $1b, $1f, $24, $40, $55, $12 - .db $64, $40, $95, $12, $a4, $40, $d2, $12, $e1, $40 - .db $13, $c0, $2c, $17, $2f, $12, $49, $13, $83, $40 - .db $9f, $14, $a3, $40, $17, $92, $83, $13, $92, $41 - .db $b9, $14, $c5, $12, $c8, $40, $d4, $40, $4b, $92 - .db $78, $1b, $9c, $94, $9f, $11, $df, $14, $fe, $11 - .db $7d, $c1, $9e, $42, $cf, $20 - .db $fd - -;level 8-3 -L_GroundArea2: - .db $90, $b1 - .db $0f, $26, $29, $91, $7e, $42, $fe, $40, $28, $92 - .db $4e, $42, $2e, $c0, $57, $73, $c3, $25, $c7, $27 - .db $23, $84, $33, $20, $5c, $01, $77, $63, $88, $62 - .db $99, $61, $aa, $60, $bc, $01, $ee, $42, $4e, $c0 - .db $69, $11, $7e, $42, $de, $40, $f8, $62, $0e, $c2 - .db $ae, $40, $d7, $63, $e7, $63, $33, $a7, $37, $27 - .db $43, $04, $cc, $01, $e7, $73, $0c, $81, $3e, $42 - .db $0d, $0a, $5e, $40, $88, $72, $be, $42, $e7, $87 - .db $fe, $40, $39, $e1, $4e, $00, $69, $60, $87, $60 - .db $a5, $60, $c3, $31, $fe, $31, $6d, $c1, $be, $42 - .db $ef, $20 - .db $fd - -;level 4-1 -L_GroundArea3: - .db $52, $21 - .db $0f, $20, $6e, $40, $58, $f2, $93, $01, $97, $00 - .db $0c, $81, $97, $40, $a6, $41, $c7, $40, $0d, $04 - .db $03, $01, $07, $01, $23, $01, $27, $01, $ec, $03 - .db $ac, $f3, $c3, $03, $78, $e2, $94, $43, $47, $f3 - .db $74, $43, $47, $fb, $74, $43, $2c, $f1, $4c, $63 - .db $47, $00, $57, $21, $5c, $01, $7c, $72, $39, $f1 - .db $ec, $02, $4c, $81, $d8, $62, $ec, $01, $0d, $0d - .db $0f, $38, $c7, $07, $ed, $4a, $1d, $c1, $5f, $26 - .db $fd - -;level 6-2 -L_GroundArea4: - .db $54, $21 - .db $0f, $26, $a7, $22, $37, $fb, $73, $20, $83, $07 - .db $87, $02, $93, $20, $c7, $73, $04, $f1, $06, $31 - .db $39, $71, $59, $71, $e7, $73, $37, $a0, $47, $04 - .db $86, $7c, $e5, $71, $e7, $31, $33, $a4, $39, $71 - .db $a9, $71, $d3, $23, $08, $f2, $13, $05, $27, $02 - .db $49, $71, $75, $75, $e8, $72, $67, $f3, $99, $71 - .db $e7, $20, $f4, $72, $f7, $31, $17, $a0, $33, $20 - .db $39, $71, $73, $28, $bc, $05, $39, $f1, $79, $71 - .db $a6, $21, $c3, $06, $d3, $20, $dc, $00, $fc, $00 - .db $07, $a2, $13, $21, $5f, $32, $8c, $00, $98, $7a - .db $c7, $63, $d9, $61, $03, $a2, $07, $22, $74, $72 - .db $77, $31, $e7, $73, $39, $f1, $58, $72, $77, $73 - .db $d8, $72, $7f, $b1, $97, $73, $b6, $64, $c5, $65 - .db $d4, $66, $e3, $67, $f3, $67, $8d, $c1, $cf, $26 - .db $fd - -;level 3-1 -L_GroundArea5: - .db $52, $31 - .db $0f, $20, $6e, $66, $07, $81, $36, $01, $66, $00 - .db $a7, $22, $08, $f2, $67, $7b, $dc, $02, $98, $f2 - .db $d7, $20, $39, $f1, $9f, $33, $dc, $27, $dc, $57 - .db $23, $83, $57, $63, $6c, $51, $87, $63, $99, $61 - .db $a3, $06, $b3, $21, $77, $f3, $f3, $21, $f7, $2a - .db $13, $81, $23, $22, $53, $00, $63, $22, $e9, $0b - .db $0c, $83, $13, $21, $16, $22, $33, $05, $8f, $35 - .db $ec, $01, $63, $a0, $67, $20, $73, $01, $77, $01 - .db $83, $20, $87, $20, $b3, $20, $b7, $20, $c3, $01 - .db $c7, $00, $d3, $20, $d7, $20, $67, $a0, $77, $07 - .db $87, $22, $e8, $62, $f5, $65, $1c, $82, $7f, $38 - .db $8d, $c1, $cf, $26 - .db $fd - -;level 1-1 -L_GroundArea6: - .db $50, $21 - .db $07, $81, $47, $24, $57, $00, $63, $01, $77, $01 - .db $c9, $71, $68, $f2, $e7, $73, $97, $fb, $06, $83 - .db $5c, $01, $d7, $22, $e7, $00, $03, $a7, $6c, $02 - .db $b3, $22, $e3, $01, $e7, $07, $47, $a0, $57, $06 - .db $a7, $01, $d3, $00, $d7, $01, $07, $81, $67, $20 - .db $93, $22, $03, $a3, $1c, $61, $17, $21, $6f, $33 - .db $c7, $63, $d8, $62, $e9, $61, $fa, $60, $4f, $b3 - .db $87, $63, $9c, $01, $b7, $63, $c8, $62, $d9, $61 - .db $ea, $60, $39, $f1, $87, $21, $a7, $01, $b7, $20 - .db $39, $f1, $5f, $38, $6d, $c1, $af, $26 - .db $fd - -;level 1-3/5-3 -L_GroundArea7: - .db $90, $11 - .db $0f, $26, $fe, $10, $2a, $93, $87, $17, $a3, $14 - .db $b2, $42, $0a, $92, $19, $40, $36, $14, $50, $41 - .db $82, $16, $2b, $93, $24, $41, $bb, $14, $b8, $00 - .db $c2, $43, $c3, $13, $1b, $94, $67, $12, $c4, $15 - .db $53, $c1, $d2, $41, $12, $c1, $29, $13, $85, $17 - .db $1b, $92, $1a, $42, $47, $13, $83, $41, $a7, $13 - .db $0e, $91, $a7, $63, $b7, $63, $c5, $65, $d5, $65 - .db $dd, $4a, $e3, $67, $f3, $67, $8d, $c1, $ae, $42 - .db $df, $20 - .db $fd - -;level 2-3/7-3 -L_GroundArea8: - .db $90, $11 - .db $0f, $26, $6e, $10, $8b, $17, $af, $32, $d8, $62 - .db $e8, $62, $fc, $3f, $ad, $c8, $f8, $64, $0c, $be - .db $43, $43, $f8, $64, $0c, $bf, $73, $40, $84, $40 - .db $93, $40, $a4, $40, $b3, $40, $f8, $64, $48, $e4 - .db $5c, $39, $83, $40, $92, $41, $b3, $40, $f8, $64 - .db $48, $e4, $5c, $39, $f8, $64, $13, $c2, $37, $65 - .db $4c, $24, $63, $00, $97, $65, $c3, $42, $0b, $97 - .db $ac, $32, $f8, $64, $0c, $be, $53, $45, $9d, $48 - .db $f8, $64, $2a, $e2, $3c, $47, $56, $43, $ba, $62 - .db $f8, $64, $0c, $b7, $88, $64, $bc, $31, $d4, $45 - .db $fc, $31, $3c, $b1, $78, $64, $8c, $38, $0b, $9c - .db $1a, $33, $18, $61, $28, $61, $39, $60, $5d, $4a - .db $ee, $11, $0f, $b8, $1d, $c1, $3e, $42, $6f, $20 - .db $fd - -;level 2-1 -L_GroundArea9: - .db $52, $31 - .db $0f, $20, $6e, $40, $f7, $20, $07, $84, $17, $20 - .db $4f, $34, $c3, $03, $c7, $02, $d3, $22, $27, $e3 - .db $39, $61, $e7, $73, $5c, $e4, $57, $00, $6c, $73 - .db $47, $a0, $53, $06, $63, $22, $a7, $73, $fc, $73 - .db $13, $a1, $33, $05, $43, $21, $5c, $72, $c3, $23 - .db $cc, $03, $77, $fb, $ac, $02, $39, $f1, $a7, $73 - .db $d3, $04, $e8, $72, $e3, $22, $26, $f4, $bc, $02 - .db $8c, $81, $a8, $62, $17, $87, $43, $24, $a7, $01 - .db $c3, $04, $08, $f2, $97, $21, $a3, $02, $c9, $0b - .db $e1, $69, $f1, $69, $8d, $c1, $cf, $26 - .db $fd - -;pipe intro area -L_GroundArea10: - .db $38, $11 - .db $0f, $26, $ad, $40, $3d, $c7 - .db $fd - -;level 5-1 -L_GroundArea11: - .db $95, $b1 - .db $0f, $26, $0d, $02, $c8, $72, $1c, $81, $38, $72 - .db $0d, $05, $97, $34, $98, $62, $a3, $20, $b3, $06 - .db $c3, $20, $cc, $03, $f9, $91, $2c, $81, $48, $62 - .db $0d, $09, $37, $63, $47, $03, $57, $21, $8c, $02 - .db $c5, $79, $c7, $31, $f9, $11, $39, $f1, $a9, $11 - .db $6f, $b4, $d3, $65, $e3, $65, $7d, $c1, $bf, $26 - .db $fd - -;cloud level used in levels 2-1 and 5-2 -L_GroundArea12: - .db $00, $c1 - .db $4c, $00, $f4, $4f, $0d, $02, $02, $42, $43, $4f - .db $52, $c2, $de, $00, $5a, $c2, $4d, $c7 - .db $fd - -;level 4-3 -L_GroundArea13: - .db $90, $51 - .db $0f, $26, $ee, $10, $0b, $94, $33, $14, $42, $42 - .db $77, $16, $86, $44, $02, $92, $4a, $16, $69, $42 - .db $73, $14, $b0, $00, $c7, $12, $05, $c0, $1c, $17 - .db $1f, $11, $36, $12, $8f, $14, $91, $40, $1b, $94 - .db $35, $12, $34, $42, $60, $42, $61, $12, $87, $12 - .db $96, $40, $a3, $14, $1c, $98, $1f, $11, $47, $12 - .db $9f, $15, $cc, $15, $cf, $11, $05, $c0, $1f, $15 - .db $39, $12, $7c, $16, $7f, $11, $82, $40, $98, $12 - .db $df, $15, $16, $c4, $17, $14, $54, $12, $9b, $16 - .db $28, $94, $ce, $01, $3d, $c1, $5e, $42, $8f, $20 - .db $fd - -;level 6-3 -L_GroundArea14: - .db $97, $11 - .db $0f, $26, $fe, $10, $2b, $92, $57, $12, $8b, $12 - .db $c0, $41, $f7, $13, $5b, $92, $69, $0b, $bb, $12 - .db $b2, $46, $19, $93, $71, $00, $17, $94, $7c, $14 - .db $7f, $11, $93, $41, $bf, $15, $fc, $13, $ff, $11 - .db $2f, $95, $50, $42, $51, $12, $58, $14, $a6, $12 - .db $db, $12, $1b, $93, $46, $43, $7b, $12, $8d, $49 - .db $b7, $14, $1b, $94, $49, $0b, $bb, $12, $fc, $13 - .db $ff, $12, $03, $c1, $2f, $15, $43, $12, $4b, $13 - .db $77, $13, $9d, $4a, $15, $c1, $a1, $41, $c3, $12 - .db $fe, $01, $7d, $c1, $9e, $42, $cf, $20 - .db $fd - -;level 6-1 -L_GroundArea15: - .db $52, $21 - .db $0f, $20, $6e, $44, $0c, $f1, $4c, $01, $aa, $35 - .db $d9, $34, $ee, $20, $08, $b3, $37, $32, $43, $04 - .db $4e, $21, $53, $20, $7c, $01, $97, $21, $b7, $07 - .db $9c, $81, $e7, $42, $5f, $b3, $97, $63, $ac, $02 - .db $c5, $41, $49, $e0, $58, $61, $76, $64, $85, $65 - .db $94, $66, $a4, $22, $a6, $03, $c8, $22, $dc, $02 - .db $68, $f2, $96, $42, $13, $82, $17, $02, $af, $34 - .db $f6, $21, $fc, $06, $26, $80, $2a, $24, $36, $01 - .db $8c, $00, $ff, $35, $4e, $a0, $55, $21, $77, $20 - .db $87, $07, $89, $22, $ae, $21, $4c, $82, $9f, $34 - .db $ec, $01, $03, $e7, $13, $67, $8d, $4a, $ad, $41 - .db $0f, $a6 - .db $fd - -;warp zone area used in level 4-2 -L_GroundArea16: - .db $10, $51 - .db $4c, $00, $c7, $12, $c6, $42, $03, $92, $02, $42 - .db $29, $12, $63, $12, $62, $42, $69, $14, $a5, $12 - .db $a4, $42, $e2, $14, $e1, $44, $f8, $16, $37, $c1 - .db $8f, $38, $02, $bb, $28, $7a, $68, $7a, $a8, $7a - .db $e0, $6a, $f0, $6a, $6d, $c5 - .db $fd - -;level 8-1 -L_GroundArea17: - .db $92, $31 - .db $0f, $20, $6e, $40, $0d, $02, $37, $73, $ec, $00 - .db $0c, $80, $3c, $00, $6c, $00, $9c, $00, $06, $c0 - .db $c7, $73, $06, $83, $28, $72, $96, $40, $e7, $73 - .db $26, $c0, $87, $7b, $d2, $41, $39, $f1, $c8, $f2 - .db $97, $e3, $a3, $23, $e7, $02, $e3, $07, $f3, $22 - .db $37, $e3, $9c, $00, $bc, $00, $ec, $00, $0c, $80 - .db $3c, $00, $86, $21, $a6, $06, $b6, $24, $5c, $80 - .db $7c, $00, $9c, $00, $29, $e1, $dc, $05, $f6, $41 - .db $dc, $80, $e8, $72, $0c, $81, $27, $73, $4c, $01 - .db $66, $74, $0d, $11, $3f, $35, $b6, $41, $2c, $82 - .db $36, $40, $7c, $02, $86, $40, $f9, $61, $39, $e1 - .db $ac, $04, $c6, $41, $0c, $83, $16, $41, $88, $f2 - .db $39, $f1, $7c, $00, $89, $61, $9c, $00, $a7, $63 - .db $bc, $00, $c5, $65, $dc, $00, $e3, $67, $f3, $67 - .db $8d, $c1, $cf, $26 - .db $fd - -;level 5-2 -L_GroundArea18: - .db $55, $b1 - .db $0f, $26, $cf, $33, $07, $b2, $15, $11, $52, $42 - .db $99, $0b, $ac, $02, $d3, $24, $d6, $42, $d7, $25 - .db $23, $84, $cf, $33, $07, $e3, $19, $61, $78, $7a - .db $ef, $33, $2c, $81, $46, $64, $55, $65, $65, $65 - .db $ec, $74, $47, $82, $53, $05, $63, $21, $62, $41 - .db $96, $22, $9a, $41, $cc, $03, $b9, $91, $39, $f1 - .db $63, $26, $67, $27, $d3, $06, $fc, $01, $18, $e2 - .db $d9, $07, $e9, $04, $0c, $86, $37, $22, $93, $24 - .db $87, $84, $ac, $02, $c2, $41, $c3, $23, $d9, $71 - .db $fc, $01, $7f, $b1, $9c, $00, $a7, $63, $b6, $64 - .db $cc, $00, $d4, $66, $e3, $67, $f3, $67, $8d, $c1 - .db $cf, $26 - .db $fd - -;level 8-2 -L_GroundArea19: - .db $50, $b1 - .db $0f, $26, $fc, $00, $1f, $b3, $5c, $00, $65, $65 - .db $74, $66, $83, $67, $93, $67, $dc, $73, $4c, $80 - .db $b3, $20, $c9, $0b, $c3, $08, $d3, $2f, $dc, $00 - .db $2c, $80, $4c, $00, $8c, $00, $d3, $2e, $ed, $4a - .db $fc, $00, $d7, $a1, $ec, $01, $4c, $80, $59, $11 - .db $d8, $11, $da, $10, $37, $a0, $47, $04, $99, $11 - .db $e7, $21, $3a, $90, $67, $20, $76, $10, $77, $60 - .db $87, $07, $d8, $12, $39, $f1, $ac, $00, $e9, $71 - .db $0c, $80, $2c, $00, $4c, $05, $c7, $7b, $39, $f1 - .db $ec, $00, $f9, $11, $0c, $82, $6f, $34, $f8, $11 - .db $fa, $10, $7f, $b2, $ac, $00, $b6, $64, $cc, $01 - .db $e3, $67, $f3, $67, $8d, $c1, $cf, $26 - .db $fd - -;level 7-1 -L_GroundArea20: - .db $52, $b1 - .db $0f, $20, $6e, $45, $39, $91, $b3, $04, $c3, $21 - .db $c8, $11, $ca, $10, $49, $91, $7c, $73, $e8, $12 - .db $88, $91, $8a, $10, $e7, $21, $05, $91, $07, $30 - .db $17, $07, $27, $20, $49, $11, $9c, $01, $c8, $72 - .db $23, $a6, $27, $26, $d3, $03, $d8, $7a, $89, $91 - .db $d8, $72, $39, $f1, $a9, $11, $09, $f1, $63, $24 - .db $67, $24, $d8, $62, $28, $91, $2a, $10, $56, $21 - .db $70, $04, $79, $0b, $8c, $00, $94, $21, $9f, $35 - .db $2f, $b8, $3d, $c1, $7f, $26 - .db $fd - -;cloud level used in levels 3-1 and 6-2 -L_GroundArea21: - .db $06, $c1 - .db $4c, $00, $f4, $4f, $0d, $02, $06, $20, $24, $4f - .db $35, $a0, $36, $20, $53, $46, $d5, $20, $d6, $20 - .db $34, $a1, $73, $49, $74, $20, $94, $20, $b4, $20 - .db $d4, $20, $f4, $20, $2e, $80, $59, $42, $4d, $c7 - .db $fd - -;level 3-2 -L_GroundArea22: - .db $96, $31 - .db $0f, $26, $0d, $03, $1a, $60, $77, $42, $c4, $00 - .db $c8, $62, $b9, $e1, $d3, $06, $d7, $07, $f9, $61 - .db $0c, $81, $4e, $b1, $8e, $b1, $bc, $01, $e4, $50 - .db $e9, $61, $0c, $81, $0d, $0a, $84, $43, $98, $72 - .db $0d, $0c, $0f, $38, $1d, $c1, $5f, $26 - .db $fd - -;level 1-2 -L_UndergroundArea1: - .db $48, $0f - .db $0e, $01, $5e, $02, $a7, $00, $bc, $73, $1a, $e0 - .db $39, $61, $58, $62, $77, $63, $97, $63, $b8, $62 - .db $d6, $07, $f8, $62, $19, $e1, $75, $52, $86, $40 - .db $87, $50, $95, $52, $93, $43, $a5, $21, $c5, $52 - .db $d6, $40, $d7, $20, $e5, $06, $e6, $51, $3e, $8d - .db $5e, $03, $67, $52, $77, $52, $7e, $02, $9e, $03 - .db $a6, $43, $a7, $23, $de, $05, $fe, $02, $1e, $83 - .db $33, $54, $46, $40, $47, $21, $56, $04, $5e, $02 - .db $83, $54, $93, $52, $96, $07, $97, $50, $be, $03 - .db $c7, $23, $fe, $02, $0c, $82, $43, $45, $45, $24 - .db $46, $24, $90, $08, $95, $51, $78, $fa, $d7, $73 - .db $39, $f1, $8c, $01, $a8, $52, $b8, $52, $cc, $01 - .db $5f, $b3, $97, $63, $9e, $00, $0e, $81, $16, $24 - .db $66, $04, $8e, $00, $fe, $01, $08, $d2, $0e, $06 - .db $6f, $47, $9e, $0f, $0e, $82, $2d, $47, $28, $7a - .db $68, $7a, $a8, $7a, $ae, $01, $de, $0f, $6d, $c5 - .db $fd - -;level 4-2 -L_UndergroundArea2: - .db $48, $0f - .db $0e, $01, $5e, $02, $bc, $01, $fc, $01, $2c, $82 - .db $41, $52, $4e, $04, $67, $25, $68, $24, $69, $24 - .db $ba, $42, $c7, $04, $de, $0b, $b2, $87, $fe, $02 - .db $2c, $e1, $2c, $71, $67, $01, $77, $00, $87, $01 - .db $8e, $00, $ee, $01, $f6, $02, $03, $85, $05, $02 - .db $13, $21, $16, $02, $27, $02, $2e, $02, $88, $72 - .db $c7, $20, $d7, $07, $e4, $76, $07, $a0, $17, $06 - .db $48, $7a, $76, $20, $98, $72, $79, $e1, $88, $62 - .db $9c, $01, $b7, $73, $dc, $01, $f8, $62, $fe, $01 - .db $08, $e2, $0e, $00, $6e, $02, $73, $20, $77, $23 - .db $83, $04, $93, $20, $ae, $00, $fe, $0a, $0e, $82 - .db $39, $71, $a8, $72, $e7, $73, $0c, $81, $8f, $32 - .db $ae, $00, $fe, $04, $04, $d1, $17, $04, $26, $49 - .db $27, $29, $df, $33, $fe, $02, $44, $f6, $7c, $01 - .db $8e, $06, $bf, $47, $ee, $0f, $4d, $c7, $0e, $82 - .db $68, $7a, $ae, $01, $de, $0f, $6d, $c5 - .db $fd - -;underground bonus rooms area used in many levels -L_UndergroundArea3: - .db $48, $01 - .db $0e, $01, $00, $5a, $3e, $06, $45, $46, $47, $46 - .db $53, $44, $ae, $01, $df, $4a, $4d, $c7, $0e, $81 - .db $00, $5a, $2e, $04, $37, $28, $3a, $48, $46, $47 - .db $c7, $07, $ce, $0f, $df, $4a, $4d, $c7, $0e, $81 - .db $00, $5a, $33, $53, $43, $51, $46, $40, $47, $50 - .db $53, $04, $55, $40, $56, $50, $62, $43, $64, $40 - .db $65, $50, $71, $41, $73, $51, $83, $51, $94, $40 - .db $95, $50, $a3, $50, $a5, $40, $a6, $50, $b3, $51 - .db $b6, $40, $b7, $50, $c3, $53, $df, $4a, $4d, $c7 - .db $0e, $81, $00, $5a, $2e, $02, $36, $47, $37, $52 - .db $3a, $49, $47, $25, $a7, $52, $d7, $04, $df, $4a - .db $4d, $c7, $0e, $81, $00, $5a, $3e, $02, $44, $51 - .db $53, $44, $54, $44, $55, $24, $a1, $54, $ae, $01 - .db $b4, $21, $df, $4a, $e5, $07, $4d, $c7 - .db $fd - -;water area used in levels 5-2 and 6-2 -L_WaterArea1: - .db $41, $01 - .db $b4, $34, $c8, $52, $f2, $51, $47, $d3, $6c, $03 - .db $65, $49, $9e, $07, $be, $01, $cc, $03, $fe, $07 - .db $0d, $c9, $1e, $01, $6c, $01, $62, $35, $63, $53 - .db $8a, $41, $ac, $01, $b3, $53, $e9, $51, $26, $c3 - .db $27, $33, $63, $43, $64, $33, $ba, $60, $c9, $61 - .db $ce, $0b, $e5, $09, $ee, $0f, $7d, $ca, $7d, $47 - .db $fd - -;level 2-2/7-2 -L_WaterArea2: - .db $41, $01 - .db $b8, $52, $ea, $41, $27, $b2, $b3, $42, $16, $d4 - .db $4a, $42, $a5, $51, $a7, $31, $27, $d3, $08, $e2 - .db $16, $64, $2c, $04, $38, $42, $76, $64, $88, $62 - .db $de, $07, $fe, $01, $0d, $c9, $23, $32, $31, $51 - .db $98, $52, $0d, $c9, $59, $42, $63, $53, $67, $31 - .db $14, $c2, $36, $31, $87, $53, $17, $e3, $29, $61 - .db $30, $62, $3c, $08, $42, $37, $59, $40, $6a, $42 - .db $99, $40, $c9, $61, $d7, $63, $39, $d1, $58, $52 - .db $c3, $67, $d3, $31, $dc, $06, $f7, $42, $fa, $42 - .db $23, $b1, $43, $67, $c3, $34, $c7, $34, $d1, $51 - .db $43, $b3, $47, $33, $9a, $30, $a9, $61, $b8, $62 - .db $be, $0b, $d5, $09, $de, $0f, $0d, $ca, $7d, $47 - .db $fd - -;water area used in level 8-4 -L_WaterArea3: - .db $49, $0f - .db $1e, $01, $39, $73, $5e, $07, $ae, $0b, $1e, $82 - .db $6e, $88, $9e, $02, $0d, $04, $2e, $0b, $45, $09 - .db $4e, $0f, $ed, $47 - .db $fd - -;------------------------------------------------------------------------------------- - -;unused space - .db $ff - -;------------------------------------------------------------------------------------- - -;indirect jump routine called when -;$0770 is set to 1 -GameMode: - lda OperMode_Task - jsr JumpEngine - - .dw InitializeArea - .dw ScreenRoutines - .dw SecondaryGameSetup - .dw GameCoreRoutine - -;------------------------------------------------------------------------------------- - -GameCoreRoutine: - ldx CurrentPlayer ;get which player is on the screen - lda SavedJoypadBits,x ;use appropriate player's controller bits - sta SavedJoypadBits ;as the master controller bits - jsr GameRoutines ;execute one of many possible subs - lda OperMode_Task ;check major task of operating mode - cmp #$03 ;if we are supposed to be here, - bcs GameEngine ;branch to the game engine itself - rts - -GameEngine: - jsr ProcFireball_Bubble ;process fireballs and air bubbles - ldx #$00 -ProcELoop: stx ObjectOffset ;put incremented offset in X as enemy object offset - jsr EnemiesAndLoopsCore ;process enemy objects - jsr FloateyNumbersRoutine ;process floatey numbers - inx - cpx #$06 ;do these two subroutines until the whole buffer is done - bne ProcELoop - jsr GetPlayerOffscreenBits ;get offscreen bits for player object - jsr RelativePlayerPosition ;get relative coordinates for player object - jsr PlayerGfxHandler ;draw the player - jsr BlockObjMT_Updater ;replace block objects with metatiles if necessary - ldx #$01 - stx ObjectOffset ;set offset for second - jsr BlockObjectsCore ;process second block object - dex - stx ObjectOffset ;set offset for first - jsr BlockObjectsCore ;process first block object - jsr MiscObjectsCore ;process misc objects (hammer, jumping coins) - jsr ProcessCannons ;process bullet bill cannons - jsr ProcessWhirlpools ;process whirlpools - jsr FlagpoleRoutine ;process the flagpole - jsr RunGameTimer ;count down the game timer - jsr ColorRotation ;cycle one of the background colors - lda Player_Y_HighPos - cmp #$02 ;if player is below the screen, don't bother with the music - bpl NoChgMus - lda StarInvincibleTimer ;if star mario invincibility timer at zero, - beq ClrPlrPal ;skip this part - cmp #$04 - bne NoChgMus ;if not yet at a certain point, continue - lda IntervalTimerControl ;if interval timer not yet expired, - bne NoChgMus ;branch ahead, don't bother with the music - jsr GetAreaMusic ;to re-attain appropriate level music -NoChgMus: ldy StarInvincibleTimer ;get invincibility timer - lda FrameCounter ;get frame counter - cpy #$08 ;if timer still above certain point, - bcs CycleTwo ;branch to cycle player's palette quickly - lsr ;otherwise, divide by 8 to cycle every eighth frame - lsr -CycleTwo: lsr ;if branched here, divide by 2 to cycle every other frame - jsr CyclePlayerPalette ;do sub to cycle the palette (note: shares fire flower code) - jmp SaveAB ;then skip this sub to finish up the game engine -ClrPlrPal: jsr ResetPalStar ;do sub to clear player's palette bits in attributes -SaveAB: lda A_B_Buttons ;save current A and B button - sta PreviousA_B_Buttons ;into temp variable to be used on next frame - lda #$00 - sta Left_Right_Buttons ;nullify left and right buttons temp variable -UpdScrollVar: lda VRAM_Buffer_AddrCtrl - cmp #$06 ;if vram address controller set to 6 (one of two $0341s) - beq ExitEng ;then branch to leave - lda AreaParserTaskNum ;otherwise check number of tasks - bne RunParser - lda ScrollThirtyTwo ;get horizontal scroll in 0-31 or $00-$20 range - cmp #$20 ;check to see if exceeded $21 - bmi ExitEng ;branch to leave if not - lda ScrollThirtyTwo - sbc #$20 ;otherwise subtract $20 to set appropriately - sta ScrollThirtyTwo ;and store - lda #$00 ;reset vram buffer offset used in conjunction with - sta VRAM_Buffer2_Offset ;level graphics buffer at $0341-$035f -RunParser: jsr AreaParserTaskHandler ;update the name table with more level graphics -ExitEng: rts ;and after all that, we're finally done! - -;------------------------------------------------------------------------------------- - -ScrollHandler: - lda Player_X_Scroll ;load value saved here - clc - adc Platform_X_Scroll ;add value used by left/right platforms - sta Player_X_Scroll ;save as new value here to impose force on scroll - lda ScrollLock ;check scroll lock flag - bne InitScrlAmt ;skip a bunch of code here if set - lda Player_Pos_ForScroll - cmp #$50 ;check player's horizontal screen position - bcc InitScrlAmt ;if less than 80 pixels to the right, branch - lda SideCollisionTimer ;if timer related to player's side collision - bne InitScrlAmt ;not expired, branch - ldy Player_X_Scroll ;get value and decrement by one - dey ;if value originally set to zero or otherwise - bmi InitScrlAmt ;negative for left movement, branch - iny - cpy #$02 ;if value $01, branch and do not decrement - bcc ChkNearMid - dey ;otherwise decrement by one -ChkNearMid: lda Player_Pos_ForScroll - cmp #$70 ;check player's horizontal screen position - bcc ScrollScreen ;if less than 112 pixels to the right, branch - ldy Player_X_Scroll ;otherwise get original value undecremented - -ScrollScreen: - tya - sta ScrollAmount ;save value here - clc - adc ScrollThirtyTwo ;add to value already set here - sta ScrollThirtyTwo ;save as new value here - tya - clc - adc ScreenLeft_X_Pos ;add to left side coordinate - sta ScreenLeft_X_Pos ;save as new left side coordinate - sta HorizontalScroll ;save here also - lda ScreenLeft_PageLoc - adc #$00 ;add carry to page location for left - sta ScreenLeft_PageLoc ;side of the screen - and #$01 ;get LSB of page location - sta $00 ;save as temp variable for PPU register 1 mirror - lda Mirror_PPU_CTRL_REG1 ;get PPU register 1 mirror - and #%11111110 ;save all bits except d0 - ora $00 ;get saved bit here and save in PPU register 1 - sta Mirror_PPU_CTRL_REG1 ;mirror to be used to set name table later - jsr GetScreenPosition ;figure out where the right side is - lda #$08 - sta ScrollIntervalTimer ;set scroll timer (residual, not used elsewhere) - jmp ChkPOffscr ;skip this part -InitScrlAmt: lda #$00 - sta ScrollAmount ;initialize value here -ChkPOffscr: ldx #$00 ;set X for player offset - jsr GetXOffscreenBits ;get horizontal offscreen bits for player - sta $00 ;save them here - ldy #$00 ;load default offset (left side) - asl ;if d7 of offscreen bits are set, - bcs KeepOnscr ;branch with default offset - iny ;otherwise use different offset (right side) - lda $00 - and #%00100000 ;check offscreen bits for d5 set - beq InitPlatScrl ;if not set, branch ahead of this part -KeepOnscr: lda ScreenEdge_X_Pos,y ;get left or right side coordinate based on offset - sec - sbc X_SubtracterData,y ;subtract amount based on offset - sta Player_X_Position ;store as player position to prevent movement further - lda ScreenEdge_PageLoc,y ;get left or right page location based on offset - sbc #$00 ;subtract borrow - sta Player_PageLoc ;save as player's page location - lda Left_Right_Buttons ;check saved controller bits - cmp OffscrJoypadBitsData,y ;against bits based on offset - beq InitPlatScrl ;if not equal, branch - lda #$00 - sta Player_X_Speed ;otherwise nullify horizontal speed of player -InitPlatScrl: lda #$00 ;nullify platform force imposed on scroll - sta Platform_X_Scroll - rts - -X_SubtracterData: - .db $00, $10 - -OffscrJoypadBitsData: - .db $01, $02 - -;------------------------------------------------------------------------------------- - -GetScreenPosition: - lda ScreenLeft_X_Pos ;get coordinate of screen's left boundary - clc - adc #$ff ;add 255 pixels - sta ScreenRight_X_Pos ;store as coordinate of screen's right boundary - lda ScreenLeft_PageLoc ;get page number where left boundary is - adc #$00 ;add carry from before - sta ScreenRight_PageLoc ;store as page number where right boundary is - rts - -;------------------------------------------------------------------------------------- - -GameRoutines: - lda GameEngineSubroutine ;run routine based on number (a few of these routines are - jsr JumpEngine ;merely placeholders as conditions for other routines) - - .dw Entrance_GameTimerSetup - .dw Vine_AutoClimb - .dw SideExitPipeEntry - .dw VerticalPipeEntry - .dw FlagpoleSlide - .dw PlayerEndLevel - .dw PlayerLoseLife - .dw PlayerEntrance - .dw PlayerCtrlRoutine - .dw PlayerChangeSize - .dw PlayerInjuryBlink - .dw PlayerDeath - .dw PlayerFireFlower - -;------------------------------------------------------------------------------------- - -PlayerEntrance: - lda AltEntranceControl ;check for mode of alternate entry - cmp #$02 - beq EntrMode2 ;if found, branch to enter from pipe or with vine - lda #$00 - ldy Player_Y_Position ;if vertical position above a certain - cpy #$30 ;point, nullify controller bits and continue - bcc AutoControlPlayer ;with player movement code, do not return - lda PlayerEntranceCtrl ;check player entry bits from header - cmp #$06 - beq ChkBehPipe ;if set to 6 or 7, execute pipe intro code - cmp #$07 ;otherwise branch to normal entry - bne PlayerRdy -ChkBehPipe: lda Player_SprAttrib ;check for sprite attributes - bne IntroEntr ;branch if found - lda #$01 - jmp AutoControlPlayer ;force player to walk to the right -IntroEntr: jsr EnterSidePipe ;execute sub to move player to the right - dec ChangeAreaTimer ;decrement timer for change of area - bne ExitEntr ;branch to exit if not yet expired - inc DisableIntermediate ;set flag to skip world and lives display - jmp NextArea ;jump to increment to next area and set modes -EntrMode2: lda JoypadOverride ;if controller override bits set here, - bne VineEntr ;branch to enter with vine - lda #$ff ;otherwise, set value here then execute sub - jsr MovePlayerYAxis ;to move player upwards (note $ff = -1) - lda Player_Y_Position ;check to see if player is at a specific coordinate - cmp #$91 ;if player risen to a certain point (this requires pipes - bcc PlayerRdy ;to be at specific height to look/function right) branch - rts ;to the last part, otherwise leave -VineEntr: lda VineHeight - cmp #$60 ;check vine height - bne ExitEntr ;if vine not yet reached maximum height, branch to leave - lda Player_Y_Position ;get player's vertical coordinate - cmp #$99 ;check player's vertical coordinate against preset value - ldy #$00 ;load default values to be written to - lda #$01 ;this value moves player to the right off the vine - bcc OffVine ;if vertical coordinate < preset value, use defaults - lda #$03 - sta Player_State ;otherwise set player state to climbing - iny ;increment value in Y - lda #$08 ;set block in block buffer to cover hole, then - sta Block_Buffer_1+$b4 ;use same value to force player to climb -OffVine: sty DisableCollisionDet ;set collision detection disable flag - jsr AutoControlPlayer ;use contents of A to move player up or right, execute sub - lda Player_X_Position - cmp #$48 ;check player's horizontal position - bcc ExitEntr ;if not far enough to the right, branch to leave -PlayerRdy: lda #$08 ;set routine to be executed by game engine next frame - sta GameEngineSubroutine - lda #$01 ;set to face player to the right - sta PlayerFacingDir - lsr ;init A - sta AltEntranceControl ;init mode of entry - sta DisableCollisionDet ;init collision detection disable flag - sta JoypadOverride ;nullify controller override bits -ExitEntr: rts ;leave! - -;------------------------------------------------------------------------------------- -;$07 - used to hold upper limit of high byte when player falls down hole - -AutoControlPlayer: - sta SavedJoypadBits ;override controller bits with contents of A if executing here - -PlayerCtrlRoutine: - lda GameEngineSubroutine ;check task here - cmp #$0b ;if certain value is set, branch to skip controller bit loading - beq SizeChk - lda AreaType ;are we in a water type area? - bne SaveJoyp ;if not, branch - ldy Player_Y_HighPos - dey ;if not in vertical area between - bne DisJoyp ;status bar and bottom, branch - lda Player_Y_Position - cmp #$d0 ;if nearing the bottom of the screen or - bcc SaveJoyp ;not in the vertical area between status bar or bottom, -DisJoyp: lda #$00 ;disable controller bits - sta SavedJoypadBits -SaveJoyp: lda SavedJoypadBits ;otherwise store A and B buttons in $0a - and #%11000000 - sta A_B_Buttons - lda SavedJoypadBits ;store left and right buttons in $0c - and #%00000011 - sta Left_Right_Buttons - lda SavedJoypadBits ;store up and down buttons in $0b - and #%00001100 - sta Up_Down_Buttons - and #%00000100 ;check for pressing down - beq SizeChk ;if not, branch - lda Player_State ;check player's state - bne SizeChk ;if not on the ground, branch - ldy Left_Right_Buttons ;check left and right - beq SizeChk ;if neither pressed, branch - lda #$00 - sta Left_Right_Buttons ;if pressing down while on the ground, - sta Up_Down_Buttons ;nullify directional bits -SizeChk: jsr PlayerMovementSubs ;run movement subroutines - ldy #$01 ;is player small? - lda PlayerSize - bne ChkMoveDir - ldy #$00 ;check for if crouching - lda CrouchingFlag - beq ChkMoveDir ;if not, branch ahead - ldy #$02 ;if big and crouching, load y with 2 -ChkMoveDir: sty Player_BoundBoxCtrl ;set contents of Y as player's bounding box size control - lda #$01 ;set moving direction to right by default - ldy Player_X_Speed ;check player's horizontal speed - beq PlayerSubs ;if not moving at all horizontally, skip this part - bpl SetMoveDir ;if moving to the right, use default moving direction - asl ;otherwise change to move to the left -SetMoveDir: sta Player_MovingDir ;set moving direction -PlayerSubs: jsr ScrollHandler ;move the screen if necessary - jsr GetPlayerOffscreenBits ;get player's offscreen bits - jsr RelativePlayerPosition ;get coordinates relative to the screen - ldx #$00 ;set offset for player object - jsr BoundingBoxCore ;get player's bounding box coordinates - jsr PlayerBGCollision ;do collision detection and process - lda Player_Y_Position - cmp #$40 ;check to see if player is higher than 64th pixel - bcc PlayerHole ;if so, branch ahead - lda GameEngineSubroutine - cmp #$05 ;if running end-of-level routine, branch ahead - beq PlayerHole - cmp #$07 ;if running player entrance routine, branch ahead - beq PlayerHole - cmp #$04 ;if running routines $00-$03, branch ahead - bcc PlayerHole - lda Player_SprAttrib - and #%11011111 ;otherwise nullify player's - sta Player_SprAttrib ;background priority flag -PlayerHole: lda Player_Y_HighPos ;check player's vertical high byte - cmp #$02 ;for below the screen - bmi ExitCtrl ;branch to leave if not that far down - ldx #$01 - stx ScrollLock ;set scroll lock - ldy #$04 - sty $07 ;set value here - ldx #$00 ;use X as flag, and clear for cloud level - ldy GameTimerExpiredFlag ;check game timer expiration flag - bne HoleDie ;if set, branch - ldy CloudTypeOverride ;check for cloud type override - bne ChkHoleX ;skip to last part if found -HoleDie: inx ;set flag in X for player death - ldy GameEngineSubroutine - cpy #$0b ;check for some other routine running - beq ChkHoleX ;if so, branch ahead - ldy DeathMusicLoaded ;check value here - bne HoleBottom ;if already set, branch to next part - iny - sty EventMusicQueue ;otherwise play death music - sty DeathMusicLoaded ;and set value here -HoleBottom: ldy #$06 - sty $07 ;change value here -ChkHoleX: cmp $07 ;compare vertical high byte with value set here - bmi ExitCtrl ;if less, branch to leave - dex ;otherwise decrement flag in X - bmi CloudExit ;if flag was clear, branch to set modes and other values - ldy EventMusicBuffer ;check to see if music is still playing - bne ExitCtrl ;branch to leave if so - lda #$06 ;otherwise set to run lose life routine - sta GameEngineSubroutine ;on next frame -ExitCtrl: rts ;leave - -CloudExit: - lda #$00 - sta JoypadOverride ;clear controller override bits if any are set - jsr SetEntr ;do sub to set secondary mode - inc AltEntranceControl ;set mode of entry to 3 - rts - -;------------------------------------------------------------------------------------- - -Vine_AutoClimb: - lda Player_Y_HighPos ;check to see whether player reached position - bne AutoClimb ;above the status bar yet and if so, set modes - lda Player_Y_Position - cmp #$e4 - bcc SetEntr -AutoClimb: lda #%00001000 ;set controller bits override to up - sta JoypadOverride - ldy #$03 ;set player state to climbing - sty Player_State - jmp AutoControlPlayer -SetEntr: lda #$02 ;set starting position to override - sta AltEntranceControl - jmp ChgAreaMode ;set modes - -;------------------------------------------------------------------------------------- - -VerticalPipeEntry: - lda #$01 ;set 1 as movement amount - jsr MovePlayerYAxis ;do sub to move player downwards - jsr ScrollHandler ;do sub to scroll screen with saved force if necessary - ldy #$00 ;load default mode of entry - lda WarpZoneControl ;check warp zone control variable/flag - bne ChgAreaPipe ;if set, branch to use mode 0 - iny - lda AreaType ;check for castle level type - cmp #$03 - bne ChgAreaPipe ;if not castle type level, use mode 1 - iny - jmp ChgAreaPipe ;otherwise use mode 2 - -MovePlayerYAxis: - clc - adc Player_Y_Position ;add contents of A to player position - sta Player_Y_Position - rts - -;------------------------------------------------------------------------------------- - -SideExitPipeEntry: - jsr EnterSidePipe ;execute sub to move player to the right - ldy #$02 -ChgAreaPipe: dec ChangeAreaTimer ;decrement timer for change of area - bne ExitCAPipe - sty AltEntranceControl ;when timer expires set mode of alternate entry -ChgAreaMode: inc DisableScreenFlag ;set flag to disable screen output - lda #$00 - sta OperMode_Task ;set secondary mode of operation - sta Sprite0HitDetectFlag ;disable sprite 0 check -ExitCAPipe: rts ;leave - -EnterSidePipe: - lda #$08 ;set player's horizontal speed - sta Player_X_Speed - ldy #$01 ;set controller right button by default - lda Player_X_Position ;mask out higher nybble of player's - and #%00001111 ;horizontal position - bne RightPipe - sta Player_X_Speed ;if lower nybble = 0, set as horizontal speed - tay ;and nullify controller bit override here -RightPipe: tya ;use contents of Y to - jsr AutoControlPlayer ;execute player control routine with ctrl bits nulled - rts - -;------------------------------------------------------------------------------------- - -PlayerChangeSize: - lda TimerControl ;check master timer control - cmp #$f8 ;for specific moment in time - bne EndChgSize ;branch if before or after that point - jmp InitChangeSize ;otherwise run code to get growing/shrinking going -EndChgSize: cmp #$c4 ;check again for another specific moment - bne ExitChgSize ;and branch to leave if before or after that point - jsr DonePlayerTask ;otherwise do sub to init timer control and set routine -ExitChgSize: rts ;and then leave - -;------------------------------------------------------------------------------------- - -PlayerInjuryBlink: - lda TimerControl ;check master timer control - cmp #$f0 ;for specific moment in time - bcs ExitBlink ;branch if before that point - cmp #$c8 ;check again for another specific point - beq DonePlayerTask ;branch if at that point, and not before or after - jmp PlayerCtrlRoutine ;otherwise run player control routine -ExitBlink: bne ExitBoth ;do unconditional branch to leave - -InitChangeSize: - ldy PlayerChangeSizeFlag ;if growing/shrinking flag already set - bne ExitBoth ;then branch to leave - sty PlayerAnimCtrl ;otherwise initialize player's animation frame control - inc PlayerChangeSizeFlag ;set growing/shrinking flag - lda PlayerSize - eor #$01 ;invert player's size - sta PlayerSize -ExitBoth: rts ;leave - -;------------------------------------------------------------------------------------- -;$00 - used in CyclePlayerPalette to store current palette to cycle - -PlayerDeath: - lda TimerControl ;check master timer control - cmp #$f0 ;for specific moment in time - bcs ExitDeath ;branch to leave if before that point - jmp PlayerCtrlRoutine ;otherwise run player control routine - -DonePlayerTask: - lda #$00 - sta TimerControl ;initialize master timer control to continue timers - lda #$08 - sta GameEngineSubroutine ;set player control routine to run next frame - rts ;leave - -PlayerFireFlower: - lda TimerControl ;check master timer control - cmp #$c0 ;for specific moment in time - beq ResetPalFireFlower ;branch if at moment, not before or after - lda FrameCounter ;get frame counter - lsr - lsr ;divide by four to change every four frames - -CyclePlayerPalette: - and #$03 ;mask out all but d1-d0 (previously d3-d2) - sta $00 ;store result here to use as palette bits - lda Player_SprAttrib ;get player attributes - and #%11111100 ;save any other bits but palette bits - ora $00 ;add palette bits - sta Player_SprAttrib ;store as new player attributes - rts ;and leave - -ResetPalFireFlower: - jsr DonePlayerTask ;do sub to init timer control and run player control routine - -ResetPalStar: - lda Player_SprAttrib ;get player attributes - and #%11111100 ;mask out palette bits to force palette 0 - sta Player_SprAttrib ;store as new player attributes - rts ;and leave - -ExitDeath: - rts ;leave from death routine - -;------------------------------------------------------------------------------------- - -FlagpoleSlide: - lda Enemy_ID+5 ;check special use enemy slot - cmp #FlagpoleFlagObject ;for flagpole flag object - bne NoFPObj ;if not found, branch to something residual - lda FlagpoleSoundQueue ;load flagpole sound - sta Square1SoundQueue ;into square 1's sfx queue - lda #$00 - sta FlagpoleSoundQueue ;init flagpole sound queue - ldy Player_Y_Position - cpy #$9e ;check to see if player has slid down - bcs SlidePlayer ;far enough, and if so, branch with no controller bits set - lda #$04 ;otherwise force player to climb down (to slide) -SlidePlayer: jmp AutoControlPlayer ;jump to player control routine -NoFPObj: inc GameEngineSubroutine ;increment to next routine (this may - rts ;be residual code) - -;------------------------------------------------------------------------------------- - -Hidden1UpCoinAmts: - .db $15, $23, $16, $1b, $17, $18, $23, $63 - -PlayerEndLevel: - lda #$01 ;force player to walk to the right - jsr AutoControlPlayer - lda Player_Y_Position ;check player's vertical position - cmp #$ae - bcc ChkStop ;if player is not yet off the flagpole, skip this part - lda ScrollLock ;if scroll lock not set, branch ahead to next part - beq ChkStop ;because we only need to do this part once - lda #EndOfLevelMusic - sta EventMusicQueue ;load win level music in event music queue - lda #$00 - sta ScrollLock ;turn off scroll lock to skip this part later -ChkStop: lda Player_CollisionBits ;get player collision bits - lsr ;check for d0 set - bcs RdyNextA ;if d0 set, skip to next part - lda StarFlagTaskControl ;if star flag task control already set, - bne InCastle ;go ahead with the rest of the code - inc StarFlagTaskControl ;otherwise set task control now (this gets ball rolling!) -InCastle: lda #%00100000 ;set player's background priority bit to - sta Player_SprAttrib ;give illusion of being inside the castle -RdyNextA: lda StarFlagTaskControl - cmp #$05 ;if star flag task control not yet set - bne ExitNA ;beyond last valid task number, branch to leave - inc LevelNumber ;increment level number used for game logic - lda LevelNumber - cmp #$03 ;check to see if we have yet reached level -4 - bne NextArea ;and skip this last part here if not - ldy WorldNumber ;get world number as offset - lda CoinTallyFor1Ups ;check third area coin tally for bonus 1-ups - cmp Hidden1UpCoinAmts,y ;against minimum value, if player has not collected - bcc NextArea ;at least this number of coins, leave flag clear - inc Hidden1UpFlag ;otherwise set hidden 1-up box control flag -NextArea: inc AreaNumber ;increment area number used for address loader - jsr LoadAreaPointer ;get new level pointer - inc FetchNewGameTimerFlag ;set flag to load new game timer - jsr ChgAreaMode ;do sub to set secondary mode, disable screen and sprite 0 - sta HalfwayPage ;reset halfway page to 0 (beginning) - lda #Silence - sta EventMusicQueue ;silence music and leave -ExitNA: rts - -;------------------------------------------------------------------------------------- - -PlayerMovementSubs: - lda #$00 ;set A to init crouch flag by default - ldy PlayerSize ;is player small? - bne SetCrouch ;if so, branch - lda Player_State ;check state of player - bne ProcMove ;if not on the ground, branch - lda Up_Down_Buttons ;load controller bits for up and down - and #%00000100 ;single out bit for down button -SetCrouch: sta CrouchingFlag ;store value in crouch flag -ProcMove: jsr PlayerPhysicsSub ;run sub related to jumping and swimming - lda PlayerChangeSizeFlag ;if growing/shrinking flag set, - bne NoMoveSub ;branch to leave - lda Player_State - cmp #$03 ;get player state - beq MoveSubs ;if climbing, branch ahead, leave timer unset - ldy #$18 - sty ClimbSideTimer ;otherwise reset timer now -MoveSubs: jsr JumpEngine - - .dw OnGroundStateSub - .dw JumpSwimSub - .dw FallingSub - .dw ClimbingSub - -NoMoveSub: rts - -;------------------------------------------------------------------------------------- -;$00 - used by ClimbingSub to store high vertical adder - -OnGroundStateSub: - jsr GetPlayerAnimSpeed ;do a sub to set animation frame timing - lda Left_Right_Buttons - beq GndMove ;if left/right controller bits not set, skip instruction - sta PlayerFacingDir ;otherwise set new facing direction -GndMove: jsr ImposeFriction ;do a sub to impose friction on player's walk/run - jsr MovePlayerHorizontally ;do another sub to move player horizontally - sta Player_X_Scroll ;set returned value as player's movement speed for scroll - rts - -;-------------------------------- - -FallingSub: - lda VerticalForceDown - sta VerticalForce ;dump vertical movement force for falling into main one - jmp LRAir ;movement force, then skip ahead to process left/right movement - -;-------------------------------- - -JumpSwimSub: - ldy Player_Y_Speed ;if player's vertical speed zero - bpl DumpFall ;or moving downwards, branch to falling - lda A_B_Buttons - and #A_Button ;check to see if A button is being pressed - and PreviousA_B_Buttons ;and was pressed in previous frame - bne ProcSwim ;if so, branch elsewhere - lda JumpOrigin_Y_Position ;get vertical position player jumped from - sec - sbc Player_Y_Position ;subtract current from original vertical coordinate - cmp DiffToHaltJump ;compare to value set here to see if player is in mid-jump - bcc ProcSwim ;or just starting to jump, if just starting, skip ahead -DumpFall: lda VerticalForceDown ;otherwise dump falling into main fractional - sta VerticalForce -ProcSwim: lda SwimmingFlag ;if swimming flag not set, - beq LRAir ;branch ahead to last part - jsr GetPlayerAnimSpeed ;do a sub to get animation frame timing - lda Player_Y_Position - cmp #$14 ;check vertical position against preset value - bcs LRWater ;if not yet reached a certain position, branch ahead - lda #$18 - sta VerticalForce ;otherwise set fractional -LRWater: lda Left_Right_Buttons ;check left/right controller bits (check for swimming) - beq LRAir ;if not pressing any, skip - sta PlayerFacingDir ;otherwise set facing direction accordingly -LRAir: lda Left_Right_Buttons ;check left/right controller bits (check for jumping/falling) - beq JSMove ;if not pressing any, skip - jsr ImposeFriction ;otherwise process horizontal movement -JSMove: jsr MovePlayerHorizontally ;do a sub to move player horizontally - sta Player_X_Scroll ;set player's speed here, to be used for scroll later - lda GameEngineSubroutine - cmp #$0b ;check for specific routine selected - bne ExitMov1 ;branch if not set to run - lda #$28 - sta VerticalForce ;otherwise set fractional -ExitMov1: jmp MovePlayerVertically ;jump to move player vertically, then leave - -;-------------------------------- - -ClimbAdderLow: - .db $0e, $04, $fc, $f2 -ClimbAdderHigh: - .db $00, $00, $ff, $ff - -ClimbingSub: - lda Player_YMF_Dummy - clc ;add movement force to dummy variable - adc Player_Y_MoveForce ;save with carry - sta Player_YMF_Dummy - ldy #$00 ;set default adder here - lda Player_Y_Speed ;get player's vertical speed - bpl MoveOnVine ;if not moving upwards, branch - dey ;otherwise set adder to $ff -MoveOnVine: sty $00 ;store adder here - adc Player_Y_Position ;add carry to player's vertical position - sta Player_Y_Position ;and store to move player up or down - lda Player_Y_HighPos - adc $00 ;add carry to player's page location - sta Player_Y_HighPos ;and store - lda Left_Right_Buttons ;compare left/right controller bits - and Player_CollisionBits ;to collision flag - beq InitCSTimer ;if not set, skip to end - ldy ClimbSideTimer ;otherwise check timer - bne ExitCSub ;if timer not expired, branch to leave - ldy #$18 - sty ClimbSideTimer ;otherwise set timer now - ldx #$00 ;set default offset here - ldy PlayerFacingDir ;get facing direction - lsr ;move right button controller bit to carry - bcs ClimbFD ;if controller right pressed, branch ahead - inx - inx ;otherwise increment offset by 2 bytes -ClimbFD: dey ;check to see if facing right - beq CSetFDir ;if so, branch, do not increment - inx ;otherwise increment by 1 byte -CSetFDir: lda Player_X_Position - clc ;add or subtract from player's horizontal position - adc ClimbAdderLow,x ;using value here as adder and X as offset - sta Player_X_Position - lda Player_PageLoc ;add or subtract carry or borrow using value here - adc ClimbAdderHigh,x ;from the player's page location - sta Player_PageLoc - lda Left_Right_Buttons ;get left/right controller bits again - eor #%00000011 ;invert them and store them while player - sta PlayerFacingDir ;is on vine to face player in opposite direction -ExitCSub: rts ;then leave -InitCSTimer: sta ClimbSideTimer ;initialize timer here - rts - -;------------------------------------------------------------------------------------- -;$00 - used to store offset to friction data - -JumpMForceData: - .db $20, $20, $1e, $28, $28, $0d, $04 - -FallMForceData: - .db $70, $70, $60, $90, $90, $0a, $09 - -PlayerYSpdData: - .db $fc, $fc, $fc, $fb, $fb, $fe, $ff - -InitMForceData: - .db $00, $00, $00, $00, $00, $80, $00 - -MaxLeftXSpdData: - .db $d8, $e8, $f0 - -MaxRightXSpdData: - .db $28, $18, $10 - .db $0c ;used for pipe intros - -FrictionData: - .db $e4, $98, $d0 - -Climb_Y_SpeedData: - .db $00, $ff, $01 - -Climb_Y_MForceData: - .db $00, $20, $ff - -PlayerPhysicsSub: - lda Player_State ;check player state - cmp #$03 - bne CheckForJumping ;if not climbing, branch - ldy #$00 - lda Up_Down_Buttons ;get controller bits for up/down - and Player_CollisionBits ;check against player's collision detection bits - beq ProcClimb ;if not pressing up or down, branch - iny - and #%00001000 ;check for pressing up - bne ProcClimb - iny -ProcClimb: ldx Climb_Y_MForceData,y ;load value here - stx Player_Y_MoveForce ;store as vertical movement force - lda #$08 ;load default animation timing - ldx Climb_Y_SpeedData,y ;load some other value here - stx Player_Y_Speed ;store as vertical speed - bmi SetCAnim ;if climbing down, use default animation timing value - lsr ;otherwise divide timer setting by 2 -SetCAnim: sta PlayerAnimTimerSet ;store animation timer setting and leave - rts - -CheckForJumping: - lda JumpspringAnimCtrl ;if jumpspring animating, - bne NoJump ;skip ahead to something else - lda A_B_Buttons ;check for A button press - and #A_Button - beq NoJump ;if not, branch to something else - and PreviousA_B_Buttons ;if button not pressed in previous frame, branch - beq ProcJumping -NoJump: jmp X_Physics ;otherwise, jump to something else - -ProcJumping: - lda Player_State ;check player state - beq InitJS ;if on the ground, branch - lda SwimmingFlag ;if swimming flag not set, jump to do something else - beq NoJump ;to prevent midair jumping, otherwise continue - lda JumpSwimTimer ;if jump/swim timer nonzero, branch - bne InitJS - lda Player_Y_Speed ;check player's vertical speed - bpl InitJS ;if player's vertical speed motionless or down, branch - jmp X_Physics ;if timer at zero and player still rising, do not swim -InitJS: lda #$20 ;set jump/swim timer - sta JumpSwimTimer - ldy #$00 ;initialize vertical force and dummy variable - sty Player_YMF_Dummy - sty Player_Y_MoveForce - lda Player_Y_HighPos ;get vertical high and low bytes of jump origin - sta JumpOrigin_Y_HighPos ;and store them next to each other here - lda Player_Y_Position - sta JumpOrigin_Y_Position - lda #$01 ;set player state to jumping/swimming - sta Player_State - lda Player_XSpeedAbsolute ;check value related to walking/running speed - cmp #$09 - bcc ChkWtr ;branch if below certain values, increment Y - iny ;for each amount equal or exceeded - cmp #$10 - bcc ChkWtr - iny - cmp #$19 - bcc ChkWtr - iny - cmp #$1c - bcc ChkWtr ;note that for jumping, range is 0-4 for Y - iny -ChkWtr: lda #$01 ;set value here (apparently always set to 1) - sta DiffToHaltJump - lda SwimmingFlag ;if swimming flag disabled, branch - beq GetYPhy - ldy #$05 ;otherwise set Y to 5, range is 5-6 - lda Whirlpool_Flag ;if whirlpool flag not set, branch - beq GetYPhy - iny ;otherwise increment to 6 -GetYPhy: lda JumpMForceData,y ;store appropriate jump/swim - sta VerticalForce ;data here - lda FallMForceData,y - sta VerticalForceDown - lda InitMForceData,y - sta Player_Y_MoveForce - lda PlayerYSpdData,y - sta Player_Y_Speed - lda SwimmingFlag ;if swimming flag disabled, branch - beq PJumpSnd - lda #Sfx_EnemyStomp ;load swim/goomba stomp sound into - sta Square1SoundQueue ;square 1's sfx queue - lda Player_Y_Position - cmp #$14 ;check vertical low byte of player position - bcs X_Physics ;if below a certain point, branch - lda #$00 ;otherwise reset player's vertical speed - sta Player_Y_Speed ;and jump to something else to keep player - jmp X_Physics ;from swimming above water level -PJumpSnd: lda #Sfx_BigJump ;load big mario's jump sound by default - ldy PlayerSize ;is mario big? - beq SJumpSnd - lda #Sfx_SmallJump ;if not, load small mario's jump sound -SJumpSnd: sta Square1SoundQueue ;store appropriate jump sound in square 1 sfx queue -X_Physics: ldy #$00 - sty $00 ;init value here - lda Player_State ;if mario is on the ground, branch - beq ProcPRun - lda Player_XSpeedAbsolute ;check something that seems to be related - cmp #$19 ;to mario's speed - bcs GetXPhy ;if =>$19 branch here - bcc ChkRFast ;if not branch elsewhere -ProcPRun: iny ;if mario on the ground, increment Y - lda AreaType ;check area type - beq ChkRFast ;if water type, branch - dey ;decrement Y by default for non-water type area - lda Left_Right_Buttons ;get left/right controller bits - cmp Player_MovingDir ;check against moving direction - bne ChkRFast ;if controller bits <> moving direction, skip this part - lda A_B_Buttons ;check for b button pressed - and #B_Button - bne SetRTmr ;if pressed, skip ahead to set timer - lda RunningTimer ;check for running timer set - bne GetXPhy ;if set, branch -ChkRFast: iny ;if running timer not set or level type is water, - inc $00 ;increment Y again and temp variable in memory - lda RunningSpeed - bne FastXSp ;if running speed set here, branch - lda Player_XSpeedAbsolute - cmp #$21 ;otherwise check player's walking/running speed - bcc GetXPhy ;if less than a certain amount, branch ahead -FastXSp: inc $00 ;if running speed set or speed => $21 increment $00 - jmp GetXPhy ;and jump ahead -SetRTmr: lda #$0a ;if b button pressed, set running timer - sta RunningTimer -GetXPhy: lda MaxLeftXSpdData,y ;get maximum speed to the left - sta MaximumLeftSpeed - lda GameEngineSubroutine ;check for specific routine running - cmp #$07 ;(player entrance) - bne GetXPhy2 ;if not running, skip and use old value of Y - ldy #$03 ;otherwise set Y to 3 -GetXPhy2: lda MaxRightXSpdData,y ;get maximum speed to the right - sta MaximumRightSpeed - ldy $00 ;get other value in memory - lda FrictionData,y ;get value using value in memory as offset - sta FrictionAdderLow - lda #$00 - sta FrictionAdderHigh ;init something here - lda PlayerFacingDir - cmp Player_MovingDir ;check facing direction against moving direction - beq ExitPhy ;if the same, branch to leave - asl FrictionAdderLow ;otherwise shift d7 of friction adder low into carry - rol FrictionAdderHigh ;then rotate carry onto d0 of friction adder high -ExitPhy: rts ;and then leave - -;------------------------------------------------------------------------------------- - -PlayerAnimTmrData: - .db $02, $04, $07 - -GetPlayerAnimSpeed: - ldy #$00 ;initialize offset in Y - lda Player_XSpeedAbsolute ;check player's walking/running speed - cmp #$1c ;against preset amount - bcs SetRunSpd ;if greater than a certain amount, branch ahead - iny ;otherwise increment Y - cmp #$0e ;compare against lower amount - bcs ChkSkid ;if greater than this but not greater than first, skip increment - iny ;otherwise increment Y again -ChkSkid: lda SavedJoypadBits ;get controller bits - and #%01111111 ;mask out A button - beq SetAnimSpd ;if no other buttons pressed, branch ahead of all this - and #$03 ;mask out all others except left and right - cmp Player_MovingDir ;check against moving direction - bne ProcSkid ;if left/right controller bits <> moving direction, branch - lda #$00 ;otherwise set zero value here -SetRunSpd: sta RunningSpeed ;store zero or running speed here - jmp SetAnimSpd -ProcSkid: lda Player_XSpeedAbsolute ;check player's walking/running speed - cmp #$0b ;against one last amount - bcs SetAnimSpd ;if greater than this amount, branch - lda PlayerFacingDir - sta Player_MovingDir ;otherwise use facing direction to set moving direction - lda #$00 - sta Player_X_Speed ;nullify player's horizontal speed - sta Player_X_MoveForce ;and dummy variable for player -SetAnimSpd: lda PlayerAnimTmrData,y ;get animation timer setting using Y as offset - sta PlayerAnimTimerSet - rts - -;------------------------------------------------------------------------------------- - -ImposeFriction: - and Player_CollisionBits ;perform AND between left/right controller bits and collision flag - cmp #$00 ;then compare to zero (this instruction is redundant) - bne JoypFrict ;if any bits set, branch to next part - lda Player_X_Speed - beq SetAbsSpd ;if player has no horizontal speed, branch ahead to last part - bpl RghtFrict ;if player moving to the right, branch to slow - bmi LeftFrict ;otherwise logic dictates player moving left, branch to slow -JoypFrict: lsr ;put right controller bit into carry - bcc RghtFrict ;if left button pressed, carry = 0, thus branch -LeftFrict: lda Player_X_MoveForce ;load value set here - clc - adc FrictionAdderLow ;add to it another value set here - sta Player_X_MoveForce ;store here - lda Player_X_Speed - adc FrictionAdderHigh ;add value plus carry to horizontal speed - sta Player_X_Speed ;set as new horizontal speed - cmp MaximumRightSpeed ;compare against maximum value for right movement - bmi XSpdSign ;if horizontal speed greater negatively, branch - lda MaximumRightSpeed ;otherwise set preset value as horizontal speed - sta Player_X_Speed ;thus slowing the player's left movement down - jmp SetAbsSpd ;skip to the end -RghtFrict: lda Player_X_MoveForce ;load value set here - sec - sbc FrictionAdderLow ;subtract from it another value set here - sta Player_X_MoveForce ;store here - lda Player_X_Speed - sbc FrictionAdderHigh ;subtract value plus borrow from horizontal speed - sta Player_X_Speed ;set as new horizontal speed - cmp MaximumLeftSpeed ;compare against maximum value for left movement - bpl XSpdSign ;if horizontal speed greater positively, branch - lda MaximumLeftSpeed ;otherwise set preset value as horizontal speed - sta Player_X_Speed ;thus slowing the player's right movement down -XSpdSign: cmp #$00 ;if player not moving or moving to the right, - bpl SetAbsSpd ;branch and leave horizontal speed value unmodified - eor #$ff - clc ;otherwise get two's compliment to get absolute - adc #$01 ;unsigned walking/running speed -SetAbsSpd: sta Player_XSpeedAbsolute ;store walking/running speed here and leave - rts - -;------------------------------------------------------------------------------------- -;$00 - used to store downward movement force in FireballObjCore -;$02 - used to store maximum vertical speed in FireballObjCore -;$07 - used to store pseudorandom bit in BubbleCheck - -ProcFireball_Bubble: - lda PlayerStatus ;check player's status - cmp #$02 - bcc ProcAirBubbles ;if not fiery, branch - lda A_B_Buttons - and #B_Button ;check for b button pressed - beq ProcFireballs ;branch if not pressed - and PreviousA_B_Buttons - bne ProcFireballs ;if button pressed in previous frame, branch - lda FireballCounter ;load fireball counter - and #%00000001 ;get LSB and use as offset for buffer - tax - lda Fireball_State,x ;load fireball state - bne ProcFireballs ;if not inactive, branch - ldy Player_Y_HighPos ;if player too high or too low, branch - dey - bne ProcFireballs - lda CrouchingFlag ;if player crouching, branch - bne ProcFireballs - lda Player_State ;if player's state = climbing, branch - cmp #$03 - beq ProcFireballs - lda #Sfx_Fireball ;play fireball sound effect - sta Square1SoundQueue - lda #$02 ;load state - sta Fireball_State,x - ldy PlayerAnimTimerSet ;copy animation frame timer setting - sty FireballThrowingTimer ;into fireball throwing timer - dey - sty PlayerAnimTimer ;decrement and store in player's animation timer - inc FireballCounter ;increment fireball counter - -ProcFireballs: - ldx #$00 - jsr FireballObjCore ;process first fireball object - ldx #$01 - jsr FireballObjCore ;process second fireball object, then do air bubbles - -ProcAirBubbles: - lda AreaType ;if not water type level, skip the rest of this - bne BublExit - ldx #$02 ;otherwise load counter and use as offset -BublLoop: stx ObjectOffset ;store offset - jsr BubbleCheck ;check timers and coordinates, create air bubble - jsr RelativeBubblePosition ;get relative coordinates - jsr GetBubbleOffscreenBits ;get offscreen information - jsr DrawBubble ;draw the air bubble - dex - bpl BublLoop ;do this until all three are handled -BublExit: rts ;then leave - -FireballXSpdData: - .db $40, $c0 - -FireballObjCore: - stx ObjectOffset ;store offset as current object - lda Fireball_State,x ;check for d7 = 1 - asl - bcs FireballExplosion ;if so, branch to get relative coordinates and draw explosion - ldy Fireball_State,x ;if fireball inactive, branch to leave - beq NoFBall - dey ;if fireball state set to 1, skip this part and just run it - beq RunFB - lda Player_X_Position ;get player's horizontal position - adc #$04 ;add four pixels and store as fireball's horizontal position - sta Fireball_X_Position,x - lda Player_PageLoc ;get player's page location - adc #$00 ;add carry and store as fireball's page location - sta Fireball_PageLoc,x - lda Player_Y_Position ;get player's vertical position and store - sta Fireball_Y_Position,x - lda #$01 ;set high byte of vertical position - sta Fireball_Y_HighPos,x - ldy PlayerFacingDir ;get player's facing direction - dey ;decrement to use as offset here - lda FireballXSpdData,y ;set horizontal speed of fireball accordingly - sta Fireball_X_Speed,x - lda #$04 ;set vertical speed of fireball - sta Fireball_Y_Speed,x - lda #$07 - sta Fireball_BoundBoxCtrl,x ;set bounding box size control for fireball - dec Fireball_State,x ;decrement state to 1 to skip this part from now on -RunFB: txa ;add 7 to offset to use - clc ;as fireball offset for next routines - adc #$07 - tax - lda #$50 ;set downward movement force here - sta $00 - lda #$03 ;set maximum speed here - sta $02 - lda #$00 - jsr ImposeGravity ;do sub here to impose gravity on fireball and move vertically - jsr MoveObjectHorizontally ;do another sub to move it horizontally - ldx ObjectOffset ;return fireball offset to X - jsr RelativeFireballPosition ;get relative coordinates - jsr GetFireballOffscreenBits ;get offscreen information - jsr GetFireballBoundBox ;get bounding box coordinates - jsr FireballBGCollision ;do fireball to background collision detection - lda FBall_OffscreenBits ;get fireball offscreen bits - and #%11001100 ;mask out certain bits - bne EraseFB ;if any bits still set, branch to kill fireball - jsr FireballEnemyCollision ;do fireball to enemy collision detection and deal with collisions - jmp DrawFireball ;draw fireball appropriately and leave -EraseFB: lda #$00 ;erase fireball state - sta Fireball_State,x -NoFBall: rts ;leave - -FireballExplosion: - jsr RelativeFireballPosition - jmp DrawExplosion_Fireball - -BubbleCheck: - lda PseudoRandomBitReg+1,x ;get part of LSFR - and #$01 - sta $07 ;store pseudorandom bit here - lda Bubble_Y_Position,x ;get vertical coordinate for air bubble - cmp #$f8 ;if offscreen coordinate not set, - bne MoveBubl ;branch to move air bubble - lda AirBubbleTimer ;if air bubble timer not expired, - bne ExitBubl ;branch to leave, otherwise create new air bubble - -SetupBubble: - ldy #$00 ;load default value here - lda PlayerFacingDir ;get player's facing direction - lsr ;move d0 to carry - bcc PosBubl ;branch to use default value if facing left - ldy #$08 ;otherwise load alternate value here -PosBubl: tya ;use value loaded as adder - adc Player_X_Position ;add to player's horizontal position - sta Bubble_X_Position,x ;save as horizontal position for airbubble - lda Player_PageLoc - adc #$00 ;add carry to player's page location - sta Bubble_PageLoc,x ;save as page location for airbubble - lda Player_Y_Position - clc ;add eight pixels to player's vertical position - adc #$08 - sta Bubble_Y_Position,x ;save as vertical position for air bubble - lda #$01 - sta Bubble_Y_HighPos,x ;set vertical high byte for air bubble - ldy $07 ;get pseudorandom bit, use as offset - lda BubbleTimerData,y ;get data for air bubble timer - sta AirBubbleTimer ;set air bubble timer -MoveBubl: ldy $07 ;get pseudorandom bit again, use as offset - lda Bubble_YMF_Dummy,x - sec ;subtract pseudorandom amount from dummy variable - sbc Bubble_MForceData,y - sta Bubble_YMF_Dummy,x ;save dummy variable - lda Bubble_Y_Position,x - sbc #$00 ;subtract borrow from airbubble's vertical coordinate - cmp #$20 ;if below the status bar, - bcs Y_Bubl ;branch to go ahead and use to move air bubble upwards - lda #$f8 ;otherwise set offscreen coordinate -Y_Bubl: sta Bubble_Y_Position,x ;store as new vertical coordinate for air bubble -ExitBubl: rts ;leave - -Bubble_MForceData: - .db $ff, $50 - -BubbleTimerData: - .db $40, $20 - -;------------------------------------------------------------------------------------- - -RunGameTimer: - lda OperMode ;get primary mode of operation - beq ExGTimer ;branch to leave if in title screen mode - lda GameEngineSubroutine - cmp #$08 ;if routine number less than eight running, - bcc ExGTimer ;branch to leave - cmp #$0b ;if running death routine, - beq ExGTimer ;branch to leave - lda Player_Y_HighPos - cmp #$02 ;if player below the screen, - bcs ExGTimer ;branch to leave regardless of level type - lda GameTimerCtrlTimer ;if game timer control not yet expired, - bne ExGTimer ;branch to leave - lda GameTimerDisplay - ora GameTimerDisplay+1 ;otherwise check game timer digits - ora GameTimerDisplay+2 - beq TimeUpOn ;if game timer digits at 000, branch to time-up code - ldy GameTimerDisplay ;otherwise check first digit - dey ;if first digit not on 1, - bne ResGTCtrl ;branch to reset game timer control - lda GameTimerDisplay+1 ;otherwise check second and third digits - ora GameTimerDisplay+2 - bne ResGTCtrl ;if timer not at 100, branch to reset game timer control - lda #TimeRunningOutMusic - sta EventMusicQueue ;otherwise load time running out music -ResGTCtrl: lda #$18 ;reset game timer control - sta GameTimerCtrlTimer - ldy #$23 ;set offset for last digit - lda #$ff ;set value to decrement game timer digit - sta DigitModifier+5 - jsr DigitsMathRoutine ;do sub to decrement game timer slowly - lda #$a4 ;set status nybbles to update game timer display - jmp PrintStatusBarNumbers ;do sub to update the display -TimeUpOn: sta PlayerStatus ;init player status (note A will always be zero here) - jsr ForceInjury ;do sub to kill the player (note player is small here) - inc GameTimerExpiredFlag ;set game timer expiration flag -ExGTimer: rts ;leave - -;------------------------------------------------------------------------------------- - -WarpZoneObject: - lda ScrollLock ;check for scroll lock flag - beq ExGTimer ;branch if not set to leave - lda Player_Y_Position ;check to see if player's vertical coordinate has - and Player_Y_HighPos ;same bits set as in vertical high byte (why?) - bne ExGTimer ;if so, branch to leave - sta ScrollLock ;otherwise nullify scroll lock flag - inc WarpZoneControl ;increment warp zone flag to make warp pipes for warp zone - jmp EraseEnemyObject ;kill this object - -;------------------------------------------------------------------------------------- -;$00 - used in WhirlpoolActivate to store whirlpool length / 2, page location of center of whirlpool -;and also to store movement force exerted on player -;$01 - used in ProcessWhirlpools to store page location of right extent of whirlpool -;and in WhirlpoolActivate to store center of whirlpool -;$02 - used in ProcessWhirlpools to store right extent of whirlpool and in -;WhirlpoolActivate to store maximum vertical speed - -ProcessWhirlpools: - lda AreaType ;check for water type level - bne ExitWh ;branch to leave if not found - sta Whirlpool_Flag ;otherwise initialize whirlpool flag - lda TimerControl ;if master timer control set, - bne ExitWh ;branch to leave - ldy #$04 ;otherwise start with last whirlpool data -WhLoop: lda Whirlpool_LeftExtent,y ;get left extent of whirlpool - clc - adc Whirlpool_Length,y ;add length of whirlpool - sta $02 ;store result as right extent here - lda Whirlpool_PageLoc,y ;get page location - beq NextWh ;if none or page 0, branch to get next data - adc #$00 ;add carry - sta $01 ;store result as page location of right extent here - lda Player_X_Position ;get player's horizontal position - sec - sbc Whirlpool_LeftExtent,y ;subtract left extent - lda Player_PageLoc ;get player's page location - sbc Whirlpool_PageLoc,y ;subtract borrow - bmi NextWh ;if player too far left, branch to get next data - lda $02 ;otherwise get right extent - sec - sbc Player_X_Position ;subtract player's horizontal coordinate - lda $01 ;get right extent's page location - sbc Player_PageLoc ;subtract borrow - bpl WhirlpoolActivate ;if player within right extent, branch to whirlpool code -NextWh: dey ;move onto next whirlpool data - bpl WhLoop ;do this until all whirlpools are checked -ExitWh: rts ;leave - -WhirlpoolActivate: - lda Whirlpool_Length,y ;get length of whirlpool - lsr ;divide by 2 - sta $00 ;save here - lda Whirlpool_LeftExtent,y ;get left extent of whirlpool - clc - adc $00 ;add length divided by 2 - sta $01 ;save as center of whirlpool - lda Whirlpool_PageLoc,y ;get page location - adc #$00 ;add carry - sta $00 ;save as page location of whirlpool center - lda FrameCounter ;get frame counter - lsr ;shift d0 into carry (to run on every other frame) - bcc WhPull ;if d0 not set, branch to last part of code - lda $01 ;get center - sec - sbc Player_X_Position ;subtract player's horizontal coordinate - lda $00 ;get page location of center - sbc Player_PageLoc ;subtract borrow - bpl LeftWh ;if player to the left of center, branch - lda Player_X_Position ;otherwise slowly pull player left, towards the center - sec - sbc #$01 ;subtract one pixel - sta Player_X_Position ;set player's new horizontal coordinate - lda Player_PageLoc - sbc #$00 ;subtract borrow - jmp SetPWh ;jump to set player's new page location -LeftWh: lda Player_CollisionBits ;get player's collision bits - lsr ;shift d0 into carry - bcc WhPull ;if d0 not set, branch - lda Player_X_Position ;otherwise slowly pull player right, towards the center - clc - adc #$01 ;add one pixel - sta Player_X_Position ;set player's new horizontal coordinate - lda Player_PageLoc - adc #$00 ;add carry -SetPWh: sta Player_PageLoc ;set player's new page location -WhPull: lda #$10 - sta $00 ;set vertical movement force - lda #$01 - sta Whirlpool_Flag ;set whirlpool flag to be used later - sta $02 ;also set maximum vertical speed - lsr - tax ;set X for player offset - jmp ImposeGravity ;jump to put whirlpool effect on player vertically, do not return - -;------------------------------------------------------------------------------------- - -FlagpoleScoreMods: - .db $05, $02, $08, $04, $01 - -FlagpoleScoreDigits: - .db $03, $03, $04, $04, $04 - -FlagpoleRoutine: - ldx #$05 ;set enemy object offset - stx ObjectOffset ;to special use slot - lda Enemy_ID,x - cmp #FlagpoleFlagObject ;if flagpole flag not found, - bne ExitFlagP ;branch to leave - lda GameEngineSubroutine - cmp #$04 ;if flagpole slide routine not running, - bne SkipScore ;branch to near the end of code - lda Player_State - cmp #$03 ;if player state not climbing, - bne SkipScore ;branch to near the end of code - lda Enemy_Y_Position,x ;check flagpole flag's vertical coordinate - cmp #$aa ;if flagpole flag down to a certain point, - bcs GiveFPScr ;branch to end the level - lda Player_Y_Position ;check player's vertical coordinate - cmp #$a2 ;if player down to a certain point, - bcs GiveFPScr ;branch to end the level - lda Enemy_YMF_Dummy,x - adc #$ff ;add movement amount to dummy variable - sta Enemy_YMF_Dummy,x ;save dummy variable - lda Enemy_Y_Position,x ;get flag's vertical coordinate - adc #$01 ;add 1 plus carry to move flag, and - sta Enemy_Y_Position,x ;store vertical coordinate - lda FlagpoleFNum_YMFDummy - sec ;subtract movement amount from dummy variable - sbc #$ff - sta FlagpoleFNum_YMFDummy ;save dummy variable - lda FlagpoleFNum_Y_Pos - sbc #$01 ;subtract one plus borrow to move floatey number, - sta FlagpoleFNum_Y_Pos ;and store vertical coordinate here -SkipScore: jmp FPGfx ;jump to skip ahead and draw flag and floatey number -GiveFPScr: ldy FlagpoleScore ;get score offset from earlier (when player touched flagpole) - lda FlagpoleScoreMods,y ;get amount to award player points - ldx FlagpoleScoreDigits,y ;get digit with which to award points - sta DigitModifier,x ;store in digit modifier - jsr AddToScore ;do sub to award player points depending on height of collision - lda #$05 - sta GameEngineSubroutine ;set to run end-of-level subroutine on next frame -FPGfx: jsr GetEnemyOffscreenBits ;get offscreen information - jsr RelativeEnemyPosition ;get relative coordinates - jsr FlagpoleGfxHandler ;draw flagpole flag and floatey number -ExitFlagP: rts - -;------------------------------------------------------------------------------------- - -Jumpspring_Y_PosData: - .db $08, $10, $08, $00 - -JumpspringHandler: - jsr GetEnemyOffscreenBits ;get offscreen information - lda TimerControl ;check master timer control - bne DrawJSpr ;branch to last section if set - lda JumpspringAnimCtrl ;check jumpspring frame control - beq DrawJSpr ;branch to last section if not set - tay - dey ;subtract one from frame control, - tya ;the only way a poor nmos 6502 can - and #%00000010 ;mask out all but d1, original value still in Y - bne DownJSpr ;if set, branch to move player up - inc Player_Y_Position - inc Player_Y_Position ;move player's vertical position down two pixels - jmp PosJSpr ;skip to next part -DownJSpr: dec Player_Y_Position ;move player's vertical position up two pixels - dec Player_Y_Position -PosJSpr: lda Jumpspring_FixedYPos,x ;get permanent vertical position - clc - adc Jumpspring_Y_PosData,y ;add value using frame control as offset - sta Enemy_Y_Position,x ;store as new vertical position - cpy #$01 ;check frame control offset (second frame is $00) - bcc BounceJS ;if offset not yet at third frame ($01), skip to next part - lda A_B_Buttons - and #A_Button ;check saved controller bits for A button press - beq BounceJS ;skip to next part if A not pressed - and PreviousA_B_Buttons ;check for A button pressed in previous frame - bne BounceJS ;skip to next part if so - lda #$f4 - sta JumpspringForce ;otherwise write new jumpspring force here -BounceJS: cpy #$03 ;check frame control offset again - bne DrawJSpr ;skip to last part if not yet at fifth frame ($03) - lda JumpspringForce - sta Player_Y_Speed ;store jumpspring force as player's new vertical speed - lda #$00 - sta JumpspringAnimCtrl ;initialize jumpspring frame control -DrawJSpr: jsr RelativeEnemyPosition ;get jumpspring's relative coordinates - jsr EnemyGfxHandler ;draw jumpspring - jsr OffscreenBoundsCheck ;check to see if we need to kill it - lda JumpspringAnimCtrl ;if frame control at zero, don't bother - beq ExJSpring ;trying to animate it, just leave - lda JumpspringTimer - bne ExJSpring ;if jumpspring timer not expired yet, leave - lda #$04 - sta JumpspringTimer ;otherwise initialize jumpspring timer - inc JumpspringAnimCtrl ;increment frame control to animate jumpspring -ExJSpring: rts ;leave - -;------------------------------------------------------------------------------------- - -Setup_Vine: - lda #VineObject ;load identifier for vine object - sta Enemy_ID,x ;store in buffer - lda #$01 - sta Enemy_Flag,x ;set flag for enemy object buffer - lda Block_PageLoc,y - sta Enemy_PageLoc,x ;copy page location from previous object - lda Block_X_Position,y - sta Enemy_X_Position,x ;copy horizontal coordinate from previous object - lda Block_Y_Position,y - sta Enemy_Y_Position,x ;copy vertical coordinate from previous object - ldy VineFlagOffset ;load vine flag/offset to next available vine slot - bne NextVO ;if set at all, don't bother to store vertical - sta VineStart_Y_Position ;otherwise store vertical coordinate here -NextVO: txa ;store object offset to next available vine slot - sta VineObjOffset,y ;using vine flag as offset - inc VineFlagOffset ;increment vine flag offset - lda #Sfx_GrowVine - sta Square2SoundQueue ;load vine grow sound - rts - -;------------------------------------------------------------------------------------- -;$06-$07 - used as address to block buffer data -;$02 - used as vertical high nybble of block buffer offset - -VineHeightData: - .db $30, $60 - -VineObjectHandler: - cpx #$05 ;check enemy offset for special use slot - bne ExitVH ;if not in last slot, branch to leave - ldy VineFlagOffset - dey ;decrement vine flag in Y, use as offset - lda VineHeight - cmp VineHeightData,y ;if vine has reached certain height, - beq RunVSubs ;branch ahead to skip this part - lda FrameCounter ;get frame counter - lsr ;shift d1 into carry - lsr - bcc RunVSubs ;if d1 not set (2 frames every 4) skip this part - lda Enemy_Y_Position+5 - sbc #$01 ;subtract vertical position of vine - sta Enemy_Y_Position+5 ;one pixel every frame it's time - inc VineHeight ;increment vine height -RunVSubs: lda VineHeight ;if vine still very small, - cmp #$08 ;branch to leave - bcc ExitVH - jsr RelativeEnemyPosition ;get relative coordinates of vine, - jsr GetEnemyOffscreenBits ;and any offscreen bits - ldy #$00 ;initialize offset used in draw vine sub -VDrawLoop: jsr DrawVine ;draw vine - iny ;increment offset - cpy VineFlagOffset ;if offset in Y and offset here - bne VDrawLoop ;do not yet match, loop back to draw more vine - lda Enemy_OffscreenBits - and #%00001100 ;mask offscreen bits - beq WrCMTile ;if none of the saved offscreen bits set, skip ahead - dey ;otherwise decrement Y to get proper offset again -KillVine: ldx VineObjOffset,y ;get enemy object offset for this vine object - jsr EraseEnemyObject ;kill this vine object - dey ;decrement Y - bpl KillVine ;if any vine objects left, loop back to kill it - sta VineFlagOffset ;initialize vine flag/offset - sta VineHeight ;initialize vine height -WrCMTile: lda VineHeight ;check vine height - cmp #$20 ;if vine small (less than 32 pixels tall) - bcc ExitVH ;then branch ahead to leave - ldx #$06 ;set offset in X to last enemy slot - lda #$01 ;set A to obtain horizontal in $04, but we don't care - ldy #$1b ;set Y to offset to get block at ($04, $10) of coordinates - jsr BlockBufferCollision ;do a sub to get block buffer address set, return contents - ldy $02 - cpy #$d0 ;if vertical high nybble offset beyond extent of - bcs ExitVH ;current block buffer, branch to leave, do not write - lda ($06),y ;otherwise check contents of block buffer at - bne ExitVH ;current offset, if not empty, branch to leave - lda #$26 - sta ($06),y ;otherwise, write climbing metatile to block buffer -ExitVH: ldx ObjectOffset ;get enemy object offset and leave - rts - -;------------------------------------------------------------------------------------- - -CannonBitmasks: - .db %00001111, %00000111 - -ProcessCannons: - lda AreaType ;get area type - beq ExCannon ;if water type area, branch to leave - ldx #$02 -ThreeSChk: stx ObjectOffset ;start at third enemy slot - lda Enemy_Flag,x ;check enemy buffer flag - bne Chk_BB ;if set, branch to check enemy - lda PseudoRandomBitReg+1,x ;otherwise get part of LSFR - ldy SecondaryHardMode ;get secondary hard mode flag, use as offset - and CannonBitmasks,y ;mask out bits of LSFR as decided by flag - cmp #$06 ;check to see if lower nybble is above certain value - bcs Chk_BB ;if so, branch to check enemy - tay ;transfer masked contents of LSFR to Y as pseudorandom offset - lda Cannon_PageLoc,y ;get page location - beq Chk_BB ;if not set or on page 0, branch to check enemy - lda Cannon_Timer,y ;get cannon timer - beq FireCannon ;if expired, branch to fire cannon - sbc #$00 ;otherwise subtract borrow (note carry will always be clear here) - sta Cannon_Timer,y ;to count timer down - jmp Chk_BB ;then jump ahead to check enemy - -FireCannon: - lda TimerControl ;if master timer control set, - bne Chk_BB ;branch to check enemy - lda #$0e ;otherwise we start creating one - sta Cannon_Timer,y ;first, reset cannon timer - lda Cannon_PageLoc,y ;get page location of cannon - sta Enemy_PageLoc,x ;save as page location of bullet bill - lda Cannon_X_Position,y ;get horizontal coordinate of cannon - sta Enemy_X_Position,x ;save as horizontal coordinate of bullet bill - lda Cannon_Y_Position,y ;get vertical coordinate of cannon - sec - sbc #$08 ;subtract eight pixels (because enemies are 24 pixels tall) - sta Enemy_Y_Position,x ;save as vertical coordinate of bullet bill - lda #$01 - sta Enemy_Y_HighPos,x ;set vertical high byte of bullet bill - sta Enemy_Flag,x ;set buffer flag - lsr ;shift right once to init A - sta Enemy_State,x ;then initialize enemy's state - lda #$09 - sta Enemy_BoundBoxCtrl,x ;set bounding box size control for bullet bill - lda #BulletBill_CannonVar - sta Enemy_ID,x ;load identifier for bullet bill (cannon variant) - jmp Next3Slt ;move onto next slot -Chk_BB: lda Enemy_ID,x ;check enemy identifier for bullet bill (cannon variant) - cmp #BulletBill_CannonVar - bne Next3Slt ;if not found, branch to get next slot - jsr OffscreenBoundsCheck ;otherwise, check to see if it went offscreen - lda Enemy_Flag,x ;check enemy buffer flag - beq Next3Slt ;if not set, branch to get next slot - jsr GetEnemyOffscreenBits ;otherwise, get offscreen information - jsr BulletBillHandler ;then do sub to handle bullet bill -Next3Slt: dex ;move onto next slot - bpl ThreeSChk ;do this until first three slots are checked -ExCannon: rts ;then leave - -;-------------------------------- - -BulletBillXSpdData: - .db $18, $e8 - -BulletBillHandler: - lda TimerControl ;if master timer control set, - bne RunBBSubs ;branch to run subroutines except movement sub - lda Enemy_State,x - bne ChkDSte ;if bullet bill's state set, branch to check defeated state - lda Enemy_OffscreenBits ;otherwise load offscreen bits - and #%00001100 ;mask out bits - cmp #%00001100 ;check to see if all bits are set - beq KillBB ;if so, branch to kill this object - ldy #$01 ;set to move right by default - jsr PlayerEnemyDiff ;get horizontal difference between player and bullet bill - bmi SetupBB ;if enemy to the left of player, branch - iny ;otherwise increment to move left -SetupBB: sty Enemy_MovingDir,x ;set bullet bill's moving direction - dey ;decrement to use as offset - lda BulletBillXSpdData,y ;get horizontal speed based on moving direction - sta Enemy_X_Speed,x ;and store it - lda $00 ;get horizontal difference - adc #$28 ;add 40 pixels - cmp #$50 ;if less than a certain amount, player is too close - bcc KillBB ;to cannon either on left or right side, thus branch - lda #$01 - sta Enemy_State,x ;otherwise set bullet bill's state - lda #$0a - sta EnemyFrameTimer,x ;set enemy frame timer - lda #Sfx_Blast - sta Square2SoundQueue ;play fireworks/gunfire sound -ChkDSte: lda Enemy_State,x ;check enemy state for d5 set - and #%00100000 - beq BBFly ;if not set, skip to move horizontally - jsr MoveD_EnemyVertically ;otherwise do sub to move bullet bill vertically -BBFly: jsr MoveEnemyHorizontally ;do sub to move bullet bill horizontally -RunBBSubs: jsr GetEnemyOffscreenBits ;get offscreen information - jsr RelativeEnemyPosition ;get relative coordinates - jsr GetEnemyBoundBox ;get bounding box coordinates - jsr PlayerEnemyCollision ;handle player to enemy collisions - jmp EnemyGfxHandler ;draw the bullet bill and leave -KillBB: jsr EraseEnemyObject ;kill bullet bill and leave - rts - -;------------------------------------------------------------------------------------- - -HammerEnemyOfsData: - .db $04, $04, $04, $05, $05, $05 - .db $06, $06, $06 - -HammerXSpdData: - .db $10, $f0 - -SpawnHammerObj: - lda PseudoRandomBitReg+1 ;get pseudorandom bits from - and #%00000111 ;second part of LSFR - bne SetMOfs ;if any bits are set, branch and use as offset - lda PseudoRandomBitReg+1 - and #%00001000 ;get d3 from same part of LSFR -SetMOfs: tay ;use either d3 or d2-d0 for offset here - lda Misc_State,y ;if any values loaded in - bne NoHammer ;$2a-$32 where offset is then leave with carry clear - ldx HammerEnemyOfsData,y ;get offset of enemy slot to check using Y as offset - lda Enemy_Flag,x ;check enemy buffer flag at offset - bne NoHammer ;if buffer flag set, branch to leave with carry clear - ldx ObjectOffset ;get original enemy object offset - txa - sta HammerEnemyOffset,y ;save here - lda #$90 - sta Misc_State,y ;save hammer's state here - lda #$07 - sta Misc_BoundBoxCtrl,y ;set something else entirely, here - sec ;return with carry set - rts -NoHammer: ldx ObjectOffset ;get original enemy object offset - clc ;return with carry clear - rts - -;-------------------------------- -;$00 - used to set downward force -;$01 - used to set upward force (residual) -;$02 - used to set maximum speed - -ProcHammerObj: - lda TimerControl ;if master timer control set - bne RunHSubs ;skip all of this code and go to last subs at the end - lda Misc_State,x ;otherwise get hammer's state - and #%01111111 ;mask out d7 - ldy HammerEnemyOffset,x ;get enemy object offset that spawned this hammer - cmp #$02 ;check hammer's state - beq SetHSpd ;if currently at 2, branch - bcs SetHPos ;if greater than 2, branch elsewhere - txa - clc ;add 13 bytes to use - adc #$0d ;proper misc object - tax ;return offset to X - lda #$10 - sta $00 ;set downward movement force - lda #$0f - sta $01 ;set upward movement force (not used) - lda #$04 - sta $02 ;set maximum vertical speed - lda #$00 ;set A to impose gravity on hammer - jsr ImposeGravity ;do sub to impose gravity on hammer and move vertically - jsr MoveObjectHorizontally ;do sub to move it horizontally - ldx ObjectOffset ;get original misc object offset - jmp RunAllH ;branch to essential subroutines -SetHSpd: lda #$fe - sta Misc_Y_Speed,x ;set hammer's vertical speed - lda Enemy_State,y ;get enemy object state - and #%11110111 ;mask out d3 - sta Enemy_State,y ;store new state - ldx Enemy_MovingDir,y ;get enemy's moving direction - dex ;decrement to use as offset - lda HammerXSpdData,x ;get proper speed to use based on moving direction - ldx ObjectOffset ;reobtain hammer's buffer offset - sta Misc_X_Speed,x ;set hammer's horizontal speed -SetHPos: dec Misc_State,x ;decrement hammer's state - lda Enemy_X_Position,y ;get enemy's horizontal position - clc - adc #$02 ;set position 2 pixels to the right - sta Misc_X_Position,x ;store as hammer's horizontal position - lda Enemy_PageLoc,y ;get enemy's page location - adc #$00 ;add carry - sta Misc_PageLoc,x ;store as hammer's page location - lda Enemy_Y_Position,y ;get enemy's vertical position - sec - sbc #$0a ;move position 10 pixels upward - sta Misc_Y_Position,x ;store as hammer's vertical position - lda #$01 - sta Misc_Y_HighPos,x ;set hammer's vertical high byte - bne RunHSubs ;unconditional branch to skip first routine -RunAllH: jsr PlayerHammerCollision ;handle collisions -RunHSubs: jsr GetMiscOffscreenBits ;get offscreen information - jsr RelativeMiscPosition ;get relative coordinates - jsr GetMiscBoundBox ;get bounding box coordinates - jsr DrawHammer ;draw the hammer - rts ;and we are done here - -;------------------------------------------------------------------------------------- -;$02 - used to store vertical high nybble offset from block buffer routine -;$06 - used to store low byte of block buffer address - -CoinBlock: - jsr FindEmptyMiscSlot ;set offset for empty or last misc object buffer slot - lda Block_PageLoc,x ;get page location of block object - sta Misc_PageLoc,y ;store as page location of misc object - lda Block_X_Position,x ;get horizontal coordinate of block object - ora #$05 ;add 5 pixels - sta Misc_X_Position,y ;store as horizontal coordinate of misc object - lda Block_Y_Position,x ;get vertical coordinate of block object - sbc #$10 ;subtract 16 pixels - sta Misc_Y_Position,y ;store as vertical coordinate of misc object - jmp JCoinC ;jump to rest of code as applies to this misc object - -SetupJumpCoin: - jsr FindEmptyMiscSlot ;set offset for empty or last misc object buffer slot - lda Block_PageLoc2,x ;get page location saved earlier - sta Misc_PageLoc,y ;and save as page location for misc object - lda $06 ;get low byte of block buffer offset - asl - asl ;multiply by 16 to use lower nybble - asl - asl - ora #$05 ;add five pixels - sta Misc_X_Position,y ;save as horizontal coordinate for misc object - lda $02 ;get vertical high nybble offset from earlier - adc #$20 ;add 32 pixels for the status bar - sta Misc_Y_Position,y ;store as vertical coordinate -JCoinC: lda #$fb - sta Misc_Y_Speed,y ;set vertical speed - lda #$01 - sta Misc_Y_HighPos,y ;set vertical high byte - sta Misc_State,y ;set state for misc object - sta Square2SoundQueue ;load coin grab sound - stx ObjectOffset ;store current control bit as misc object offset - jsr GiveOneCoin ;update coin tally on the screen and coin amount variable - inc CoinTallyFor1Ups ;increment coin tally used to activate 1-up block flag - rts - -FindEmptyMiscSlot: - ldy #$08 ;start at end of misc objects buffer -FMiscLoop: lda Misc_State,y ;get misc object state - beq UseMiscS ;branch if none found to use current offset - dey ;decrement offset - cpy #$05 ;do this for three slots - bne FMiscLoop ;do this until all slots are checked - ldy #$08 ;if no empty slots found, use last slot -UseMiscS: sty JumpCoinMiscOffset ;store offset of misc object buffer here (residual) - rts - -;------------------------------------------------------------------------------------- - -MiscObjectsCore: - ldx #$08 ;set at end of misc object buffer -MiscLoop: stx ObjectOffset ;store misc object offset here - lda Misc_State,x ;check misc object state - beq MiscLoopBack ;branch to check next slot - asl ;otherwise shift d7 into carry - bcc ProcJumpCoin ;if d7 not set, jumping coin, thus skip to rest of code here - jsr ProcHammerObj ;otherwise go to process hammer, - jmp MiscLoopBack ;then check next slot - -;-------------------------------- -;$00 - used to set downward force -;$01 - used to set upward force (residual) -;$02 - used to set maximum speed - -ProcJumpCoin: - ldy Misc_State,x ;check misc object state - dey ;decrement to see if it's set to 1 - beq JCoinRun ;if so, branch to handle jumping coin - inc Misc_State,x ;otherwise increment state to either start off or as timer - lda Misc_X_Position,x ;get horizontal coordinate for misc object - clc ;whether its jumping coin (state 0 only) or floatey number - adc ScrollAmount ;add current scroll speed - sta Misc_X_Position,x ;store as new horizontal coordinate - lda Misc_PageLoc,x ;get page location - adc #$00 ;add carry - sta Misc_PageLoc,x ;store as new page location - lda Misc_State,x - cmp #$30 ;check state of object for preset value - bne RunJCSubs ;if not yet reached, branch to subroutines - lda #$00 - sta Misc_State,x ;otherwise nullify object state - jmp MiscLoopBack ;and move onto next slot -JCoinRun: txa - clc ;add 13 bytes to offset for next subroutine - adc #$0d - tax - lda #$50 ;set downward movement amount - sta $00 - lda #$06 ;set maximum vertical speed - sta $02 - lsr ;divide by 2 and set - sta $01 ;as upward movement amount (apparently residual) - lda #$00 ;set A to impose gravity on jumping coin - jsr ImposeGravity ;do sub to move coin vertically and impose gravity on it - ldx ObjectOffset ;get original misc object offset - lda Misc_Y_Speed,x ;check vertical speed - cmp #$05 - bne RunJCSubs ;if not moving downward fast enough, keep state as-is - inc Misc_State,x ;otherwise increment state to change to floatey number -RunJCSubs: jsr RelativeMiscPosition ;get relative coordinates - jsr GetMiscOffscreenBits ;get offscreen information - jsr GetMiscBoundBox ;get bounding box coordinates (why?) - jsr JCoinGfxHandler ;draw the coin or floatey number - -MiscLoopBack: - dex ;decrement misc object offset - bpl MiscLoop ;loop back until all misc objects handled - rts ;then leave - -;------------------------------------------------------------------------------------- - -CoinTallyOffsets: - .db $17, $1d - -ScoreOffsets: - .db $0b, $11 - -StatusBarNybbles: - .db $02, $13 - -GiveOneCoin: - lda #$01 ;set digit modifier to add 1 coin - sta DigitModifier+5 ;to the current player's coin tally - ldx CurrentPlayer ;get current player on the screen - ldy CoinTallyOffsets,x ;get offset for player's coin tally - jsr DigitsMathRoutine ;update the coin tally - inc CoinTally ;increment onscreen player's coin amount - lda CoinTally - cmp #100 ;does player have 100 coins yet? - bne CoinPoints ;if not, skip all of this - lda #$00 - sta CoinTally ;otherwise, reinitialize coin amount - inc NumberofLives ;give the player an extra life - lda #Sfx_ExtraLife - sta Square2SoundQueue ;play 1-up sound - -CoinPoints: - lda #$02 ;set digit modifier to award - sta DigitModifier+4 ;200 points to the player - -AddToScore: - ldx CurrentPlayer ;get current player - ldy ScoreOffsets,x ;get offset for player's score - jsr DigitsMathRoutine ;update the score internally with value in digit modifier - -GetSBNybbles: - ldy CurrentPlayer ;get current player - lda StatusBarNybbles,y ;get nybbles based on player, use to update score and coins - -UpdateNumber: - jsr PrintStatusBarNumbers ;print status bar numbers based on nybbles, whatever they be - ldy VRAM_Buffer1_Offset - lda VRAM_Buffer1-6,y ;check highest digit of score - bne NoZSup ;if zero, overwrite with space tile for zero suppression - lda #$24 - sta VRAM_Buffer1-6,y -NoZSup: ldx ObjectOffset ;get enemy object buffer offset - rts - -;------------------------------------------------------------------------------------- - -SetupPowerUp: - lda #PowerUpObject ;load power-up identifier into - sta Enemy_ID+5 ;special use slot of enemy object buffer - lda Block_PageLoc,x ;store page location of block object - sta Enemy_PageLoc+5 ;as page location of power-up object - lda Block_X_Position,x ;store horizontal coordinate of block object - sta Enemy_X_Position+5 ;as horizontal coordinate of power-up object - lda #$01 - sta Enemy_Y_HighPos+5 ;set vertical high byte of power-up object - lda Block_Y_Position,x ;get vertical coordinate of block object - sec - sbc #$08 ;subtract 8 pixels - sta Enemy_Y_Position+5 ;and use as vertical coordinate of power-up object -PwrUpJmp: lda #$01 ;this is a residual jump point in enemy object jump table - sta Enemy_State+5 ;set power-up object's state - sta Enemy_Flag+5 ;set buffer flag - lda #$03 - sta Enemy_BoundBoxCtrl+5 ;set bounding box size control for power-up object - lda PowerUpType - cmp #$02 ;check currently loaded power-up type - bcs PutBehind ;if star or 1-up, branch ahead - lda PlayerStatus ;otherwise check player's current status - cmp #$02 - bcc StrType ;if player not fiery, use status as power-up type - lsr ;otherwise shift right to force fire flower type -StrType: sta PowerUpType ;store type here -PutBehind: lda #%00100000 - sta Enemy_SprAttrib+5 ;set background priority bit - lda #Sfx_GrowPowerUp - sta Square2SoundQueue ;load power-up reveal sound and leave - rts - -;------------------------------------------------------------------------------------- - -PowerUpObjHandler: - ldx #$05 ;set object offset for last slot in enemy object buffer - stx ObjectOffset - lda Enemy_State+5 ;check power-up object's state - beq ExitPUp ;if not set, branch to leave - asl ;shift to check if d7 was set in object state - bcc GrowThePowerUp ;if not set, branch ahead to skip this part - lda TimerControl ;if master timer control set, - bne RunPUSubs ;branch ahead to enemy object routines - lda PowerUpType ;check power-up type - beq ShroomM ;if normal mushroom, branch ahead to move it - cmp #$03 - beq ShroomM ;if 1-up mushroom, branch ahead to move it - cmp #$02 - bne RunPUSubs ;if not star, branch elsewhere to skip movement - jsr MoveJumpingEnemy ;otherwise impose gravity on star power-up and make it jump - jsr EnemyJump ;note that green paratroopa shares the same code here - jmp RunPUSubs ;then jump to other power-up subroutines -ShroomM: jsr MoveNormalEnemy ;do sub to make mushrooms move - jsr EnemyToBGCollisionDet ;deal with collisions - jmp RunPUSubs ;run the other subroutines - -GrowThePowerUp: - lda FrameCounter ;get frame counter - and #$03 ;mask out all but 2 LSB - bne ChkPUSte ;if any bits set here, branch - dec Enemy_Y_Position+5 ;otherwise decrement vertical coordinate slowly - lda Enemy_State+5 ;load power-up object state - inc Enemy_State+5 ;increment state for next frame (to make power-up rise) - cmp #$11 ;if power-up object state not yet past 16th pixel, - bcc ChkPUSte ;branch ahead to last part here - lda #$10 - sta Enemy_X_Speed,x ;otherwise set horizontal speed - lda #%10000000 - sta Enemy_State+5 ;and then set d7 in power-up object's state - asl ;shift once to init A - sta Enemy_SprAttrib+5 ;initialize background priority bit set here - rol ;rotate A to set right moving direction - sta Enemy_MovingDir,x ;set moving direction -ChkPUSte: lda Enemy_State+5 ;check power-up object's state - cmp #$06 ;for if power-up has risen enough - bcc ExitPUp ;if not, don't even bother running these routines -RunPUSubs: jsr RelativeEnemyPosition ;get coordinates relative to screen - jsr GetEnemyOffscreenBits ;get offscreen bits - jsr GetEnemyBoundBox ;get bounding box coordinates - jsr DrawPowerUp ;draw the power-up object - jsr PlayerEnemyCollision ;check for collision with player - jsr OffscreenBoundsCheck ;check to see if it went offscreen -ExitPUp: rts ;and we're done - -;------------------------------------------------------------------------------------- -;These apply to all routines in this section unless otherwise noted: -;$00 - used to store metatile from block buffer routine -;$02 - used to store vertical high nybble offset from block buffer routine -;$05 - used to store metatile stored in A at beginning of PlayerHeadCollision -;$06-$07 - used as block buffer address indirect - -BlockYPosAdderData: - .db $04, $12 - -PlayerHeadCollision: - pha ;store metatile number to stack - lda #$11 ;load unbreakable block object state by default - ldx SprDataOffset_Ctrl ;load offset control bit here - ldy PlayerSize ;check player's size - bne DBlockSte ;if small, branch - lda #$12 ;otherwise load breakable block object state -DBlockSte: sta Block_State,x ;store into block object buffer - jsr DestroyBlockMetatile ;store blank metatile in vram buffer to write to name table - ldx SprDataOffset_Ctrl ;load offset control bit - lda $02 ;get vertical high nybble offset used in block buffer routine - sta Block_Orig_YPos,x ;set as vertical coordinate for block object - tay - lda $06 ;get low byte of block buffer address used in same routine - sta Block_BBuf_Low,x ;save as offset here to be used later - lda ($06),y ;get contents of block buffer at old address at $06, $07 - jsr BlockBumpedChk ;do a sub to check which block player bumped head on - sta $00 ;store metatile here - ldy PlayerSize ;check player's size - bne ChkBrick ;if small, use metatile itself as contents of A - tya ;otherwise init A (note: big = 0) -ChkBrick: bcc PutMTileB ;if no match was found in previous sub, skip ahead - ldy #$11 ;otherwise load unbreakable state into block object buffer - sty Block_State,x ;note this applies to both player sizes - lda #$c4 ;load empty block metatile into A for now - ldy $00 ;get metatile from before - cpy #$58 ;is it brick with coins (with line)? - beq StartBTmr ;if so, branch - cpy #$5d ;is it brick with coins (without line)? - bne PutMTileB ;if not, branch ahead to store empty block metatile -StartBTmr: lda BrickCoinTimerFlag ;check brick coin timer flag - bne ContBTmr ;if set, timer expired or counting down, thus branch - lda #$0b - sta BrickCoinTimer ;if not set, set brick coin timer - inc BrickCoinTimerFlag ;and set flag linked to it -ContBTmr: lda BrickCoinTimer ;check brick coin timer - bne PutOldMT ;if not yet expired, branch to use current metatile - ldy #$c4 ;otherwise use empty block metatile -PutOldMT: tya ;put metatile into A -PutMTileB: sta Block_Metatile,x ;store whatever metatile be appropriate here - jsr InitBlock_XY_Pos ;get block object horizontal coordinates saved - ldy $02 ;get vertical high nybble offset - lda #$23 - sta ($06),y ;write blank metatile $23 to block buffer - lda #$10 - sta BlockBounceTimer ;set block bounce timer - pla ;pull original metatile from stack - sta $05 ;and save here - ldy #$00 ;set default offset - lda CrouchingFlag ;is player crouching? - bne SmallBP ;if so, branch to increment offset - lda PlayerSize ;is player big? - beq BigBP ;if so, branch to use default offset -SmallBP: iny ;increment for small or big and crouching -BigBP: lda Player_Y_Position ;get player's vertical coordinate - clc - adc BlockYPosAdderData,y ;add value determined by size - and #$f0 ;mask out low nybble to get 16-pixel correspondence - sta Block_Y_Position,x ;save as vertical coordinate for block object - ldy Block_State,x ;get block object state - cpy #$11 - beq Unbreak ;if set to value loaded for unbreakable, branch - jsr BrickShatter ;execute code for breakable brick - jmp InvOBit ;skip subroutine to do last part of code here -Unbreak: jsr BumpBlock ;execute code for unbreakable brick or question block -InvOBit: lda SprDataOffset_Ctrl ;invert control bit used by block objects - eor #$01 ;and floatey numbers - sta SprDataOffset_Ctrl - rts ;leave! - -;-------------------------------- - -InitBlock_XY_Pos: - lda Player_X_Position ;get player's horizontal coordinate - clc - adc #$08 ;add eight pixels - and #$f0 ;mask out low nybble to give 16-pixel correspondence - sta Block_X_Position,x ;save as horizontal coordinate for block object - lda Player_PageLoc - adc #$00 ;add carry to page location of player - sta Block_PageLoc,x ;save as page location of block object - sta Block_PageLoc2,x ;save elsewhere to be used later - lda Player_Y_HighPos - sta Block_Y_HighPos,x ;save vertical high byte of player into - rts ;vertical high byte of block object and leave - -;-------------------------------- - -BumpBlock: - jsr CheckTopOfBlock ;check to see if there's a coin directly above this block - lda #Sfx_Bump - sta Square1SoundQueue ;play bump sound - lda #$00 - sta Block_X_Speed,x ;initialize horizontal speed for block object - sta Block_Y_MoveForce,x ;init fractional movement force - sta Player_Y_Speed ;init player's vertical speed - lda #$fe - sta Block_Y_Speed,x ;set vertical speed for block object - lda $05 ;get original metatile from stack - jsr BlockBumpedChk ;do a sub to check which block player bumped head on - bcc ExitBlockChk ;if no match was found, branch to leave - tya ;move block number to A - cmp #$09 ;if block number was within 0-8 range, - bcc BlockCode ;branch to use current number - sbc #$05 ;otherwise subtract 5 for second set to get proper number -BlockCode: jsr JumpEngine ;run appropriate subroutine depending on block number - - .dw MushFlowerBlock - .dw CoinBlock - .dw CoinBlock - .dw ExtraLifeMushBlock - .dw MushFlowerBlock - .dw VineBlock - .dw StarBlock - .dw CoinBlock - .dw ExtraLifeMushBlock - -;-------------------------------- - -MushFlowerBlock: - lda #$00 ;load mushroom/fire flower into power-up type - .db $2c ;BIT instruction opcode - -StarBlock: - lda #$02 ;load star into power-up type - .db $2c ;BIT instruction opcode - -ExtraLifeMushBlock: - lda #$03 ;load 1-up mushroom into power-up type - sta $39 ;store correct power-up type - jmp SetupPowerUp - -VineBlock: - ldx #$05 ;load last slot for enemy object buffer - ldy SprDataOffset_Ctrl ;get control bit - jsr Setup_Vine ;set up vine object - -ExitBlockChk: - rts ;leave - -;-------------------------------- - -BrickQBlockMetatiles: - .db $c1, $c0, $5f, $60 ;used by question blocks - - ;these two sets are functionally identical, but look different - .db $55, $56, $57, $58, $59 ;used by ground level types - .db $5a, $5b, $5c, $5d, $5e ;used by other level types - -BlockBumpedChk: - ldy #$0d ;start at end of metatile data -BumpChkLoop: cmp BrickQBlockMetatiles,y ;check to see if current metatile matches - beq MatchBump ;metatile found in block buffer, branch if so - dey ;otherwise move onto next metatile - bpl BumpChkLoop ;do this until all metatiles are checked - clc ;if none match, return with carry clear -MatchBump: rts ;note carry is set if found match - -;-------------------------------- - -BrickShatter: - jsr CheckTopOfBlock ;check to see if there's a coin directly above this block - lda #Sfx_BrickShatter - sta Block_RepFlag,x ;set flag for block object to immediately replace metatile - sta NoiseSoundQueue ;load brick shatter sound - jsr SpawnBrickChunks ;create brick chunk objects - lda #$fe - sta Player_Y_Speed ;set vertical speed for player - lda #$05 - sta DigitModifier+5 ;set digit modifier to give player 50 points - jsr AddToScore ;do sub to update the score - ldx SprDataOffset_Ctrl ;load control bit and leave - rts - -;-------------------------------- - -CheckTopOfBlock: - ldx SprDataOffset_Ctrl ;load control bit - ldy $02 ;get vertical high nybble offset used in block buffer - beq TopEx ;branch to leave if set to zero, because we're at the top - tya ;otherwise set to A - sec - sbc #$10 ;subtract $10 to move up one row in the block buffer - sta $02 ;store as new vertical high nybble offset - tay - lda ($06),y ;get contents of block buffer in same column, one row up - cmp #$c2 ;is it a coin? (not underwater) - bne TopEx ;if not, branch to leave - lda #$00 - sta ($06),y ;otherwise put blank metatile where coin was - jsr RemoveCoin_Axe ;write blank metatile to vram buffer - ldx SprDataOffset_Ctrl ;get control bit - jsr SetupJumpCoin ;create jumping coin object and update coin variables -TopEx: rts ;leave! - -;-------------------------------- - -SpawnBrickChunks: - lda Block_X_Position,x ;set horizontal coordinate of block object - sta Block_Orig_XPos,x ;as original horizontal coordinate here - lda #$f0 - sta Block_X_Speed,x ;set horizontal speed for brick chunk objects - sta Block_X_Speed+2,x - lda #$fa - sta Block_Y_Speed,x ;set vertical speed for one - lda #$fc - sta Block_Y_Speed+2,x ;set lower vertical speed for the other - lda #$00 - sta Block_Y_MoveForce,x ;init fractional movement force for both - sta Block_Y_MoveForce+2,x - lda Block_PageLoc,x - sta Block_PageLoc+2,x ;copy page location - lda Block_X_Position,x - sta Block_X_Position+2,x ;copy horizontal coordinate - lda Block_Y_Position,x - clc ;add 8 pixels to vertical coordinate - adc #$08 ;and save as vertical coordinate for one of them - sta Block_Y_Position+2,x - lda #$fa - sta Block_Y_Speed,x ;set vertical speed...again??? (redundant) - rts - -;------------------------------------------------------------------------------------- - -BlockObjectsCore: - lda Block_State,x ;get state of block object - beq UpdSte ;if not set, branch to leave - and #$0f ;mask out high nybble - pha ;push to stack - tay ;put in Y for now - txa - clc - adc #$09 ;add 9 bytes to offset (note two block objects are created - tax ;when using brick chunks, but only one offset for both) - dey ;decrement Y to check for solid block state - beq BouncingBlockHandler ;branch if found, otherwise continue for brick chunks - jsr ImposeGravityBlock ;do sub to impose gravity on one block object object - jsr MoveObjectHorizontally ;do another sub to move horizontally - txa - clc ;move onto next block object - adc #$02 - tax - jsr ImposeGravityBlock ;do sub to impose gravity on other block object - jsr MoveObjectHorizontally ;do another sub to move horizontally - ldx ObjectOffset ;get block object offset used for both - jsr RelativeBlockPosition ;get relative coordinates - jsr GetBlockOffscreenBits ;get offscreen information - jsr DrawBrickChunks ;draw the brick chunks - pla ;get lower nybble of saved state - ldy Block_Y_HighPos,x ;check vertical high byte of block object - beq UpdSte ;if above the screen, branch to kill it - pha ;otherwise save state back into stack - lda #$f0 - cmp Block_Y_Position+2,x ;check to see if bottom block object went - bcs ChkTop ;to the bottom of the screen, and branch if not - sta Block_Y_Position+2,x ;otherwise set offscreen coordinate -ChkTop: lda Block_Y_Position,x ;get top block object's vertical coordinate - cmp #$f0 ;see if it went to the bottom of the screen - pla ;pull block object state from stack - bcc UpdSte ;if not, branch to save state - bcs KillBlock ;otherwise do unconditional branch to kill it - -BouncingBlockHandler: - jsr ImposeGravityBlock ;do sub to impose gravity on block object - ldx ObjectOffset ;get block object offset - jsr RelativeBlockPosition ;get relative coordinates - jsr GetBlockOffscreenBits ;get offscreen information - jsr DrawBlock ;draw the block - lda Block_Y_Position,x ;get vertical coordinate - and #$0f ;mask out high nybble - cmp #$05 ;check to see if low nybble wrapped around - pla ;pull state from stack - bcs UpdSte ;if still above amount, not time to kill block yet, thus branch - lda #$01 - sta Block_RepFlag,x ;otherwise set flag to replace metatile -KillBlock: lda #$00 ;if branched here, nullify object state -UpdSte: sta Block_State,x ;store contents of A in block object state - rts - -;------------------------------------------------------------------------------------- -;$02 - used to store offset to block buffer -;$06-$07 - used to store block buffer address - -BlockObjMT_Updater: - ldx #$01 ;set offset to start with second block object -UpdateLoop: stx ObjectOffset ;set offset here - lda VRAM_Buffer1 ;if vram buffer already being used here, - bne NextBUpd ;branch to move onto next block object - lda Block_RepFlag,x ;if flag for block object already clear, - beq NextBUpd ;branch to move onto next block object - lda Block_BBuf_Low,x ;get low byte of block buffer - sta $06 ;store into block buffer address - lda #$05 - sta $07 ;set high byte of block buffer address - lda Block_Orig_YPos,x ;get original vertical coordinate of block object - sta $02 ;store here and use as offset to block buffer - tay - lda Block_Metatile,x ;get metatile to be written - sta ($06),y ;write it to the block buffer - jsr ReplaceBlockMetatile ;do sub to replace metatile where block object is - lda #$00 - sta Block_RepFlag,x ;clear block object flag -NextBUpd: dex ;decrement block object offset - bpl UpdateLoop ;do this until both block objects are dealt with - rts ;then leave - -;------------------------------------------------------------------------------------- -;$00 - used to store high nybble of horizontal speed as adder -;$01 - used to store low nybble of horizontal speed -;$02 - used to store adder to page location - -MoveEnemyHorizontally: - inx ;increment offset for enemy offset - jsr MoveObjectHorizontally ;position object horizontally according to - ldx ObjectOffset ;counters, return with saved value in A, - rts ;put enemy offset back in X and leave - -MovePlayerHorizontally: - lda JumpspringAnimCtrl ;if jumpspring currently animating, - bne ExXMove ;branch to leave - tax ;otherwise set zero for offset to use player's stuff - -MoveObjectHorizontally: - lda SprObject_X_Speed,x ;get currently saved value (horizontal - asl ;speed, secondary counter, whatever) - asl ;and move low nybble to high - asl - asl - sta $01 ;store result here - lda SprObject_X_Speed,x ;get saved value again - lsr ;move high nybble to low - lsr - lsr - lsr - cmp #$08 ;if < 8, branch, do not change - bcc SaveXSpd - ora #%11110000 ;otherwise alter high nybble -SaveXSpd: sta $00 ;save result here - ldy #$00 ;load default Y value here - cmp #$00 ;if result positive, leave Y alone - bpl UseAdder - dey ;otherwise decrement Y -UseAdder: sty $02 ;save Y here - lda SprObject_X_MoveForce,x ;get whatever number's here - clc - adc $01 ;add low nybble moved to high - sta SprObject_X_MoveForce,x ;store result here - lda #$00 ;init A - rol ;rotate carry into d0 - pha ;push onto stack - ror ;rotate d0 back onto carry - lda SprObject_X_Position,x - adc $00 ;add carry plus saved value (high nybble moved to low - sta SprObject_X_Position,x ;plus $f0 if necessary) to object's horizontal position - lda SprObject_PageLoc,x - adc $02 ;add carry plus other saved value to the - sta SprObject_PageLoc,x ;object's page location and save - pla - clc ;pull old carry from stack and add - adc $00 ;to high nybble moved to low -ExXMove: rts ;and leave - -;------------------------------------------------------------------------------------- -;$00 - used for downward force -;$01 - used for upward force -;$02 - used for maximum vertical speed - -MovePlayerVertically: - ldx #$00 ;set X for player offset - lda TimerControl - bne NoJSChk ;if master timer control set, branch ahead - lda JumpspringAnimCtrl ;otherwise check to see if jumpspring is animating - bne ExXMove ;branch to leave if so -NoJSChk: lda VerticalForce ;dump vertical force - sta $00 - lda #$04 ;set maximum vertical speed here - jmp ImposeGravitySprObj ;then jump to move player vertically - -;-------------------------------- - -MoveD_EnemyVertically: - ldy #$3d ;set quick movement amount downwards - lda Enemy_State,x ;then check enemy state - cmp #$05 ;if not set to unique state for spiny's egg, go ahead - bne ContVMove ;and use, otherwise set different movement amount, continue on - -MoveFallingPlatform: - ldy #$20 ;set movement amount -ContVMove: jmp SetHiMax ;jump to skip the rest of this - -;-------------------------------- - -MoveRedPTroopaDown: - ldy #$00 ;set Y to move downwards - jmp MoveRedPTroopa ;skip to movement routine - -MoveRedPTroopaUp: - ldy #$01 ;set Y to move upwards - -MoveRedPTroopa: - inx ;increment X for enemy offset - lda #$03 - sta $00 ;set downward movement amount here - lda #$06 - sta $01 ;set upward movement amount here - lda #$02 - sta $02 ;set maximum speed here - tya ;set movement direction in A, and - jmp RedPTroopaGrav ;jump to move this thing - -;-------------------------------- - -MoveDropPlatform: - ldy #$7f ;set movement amount for drop platform - bne SetMdMax ;skip ahead of other value set here - -MoveEnemySlowVert: - ldy #$0f ;set movement amount for bowser/other objects -SetMdMax: lda #$02 ;set maximum speed in A - bne SetXMoveAmt ;unconditional branch - -;-------------------------------- - -MoveJ_EnemyVertically: - ldy #$1c ;set movement amount for podoboo/other objects -SetHiMax: lda #$03 ;set maximum speed in A -SetXMoveAmt: sty $00 ;set movement amount here - inx ;increment X for enemy offset - jsr ImposeGravitySprObj ;do a sub to move enemy object downwards - ldx ObjectOffset ;get enemy object buffer offset and leave - rts - -;-------------------------------- - -MaxSpdBlockData: - .db $06, $08 - -ResidualGravityCode: - ldy #$00 ;this part appears to be residual, - .db $2c ;no code branches or jumps to it... - -ImposeGravityBlock: - ldy #$01 ;set offset for maximum speed - lda #$50 ;set movement amount here - sta $00 - lda MaxSpdBlockData,y ;get maximum speed - -ImposeGravitySprObj: - sta $02 ;set maximum speed here - lda #$00 ;set value to move downwards - jmp ImposeGravity ;jump to the code that actually moves it - -;-------------------------------- - -MovePlatformDown: - lda #$00 ;save value to stack (if branching here, execute next - .db $2c ;part as BIT instruction) - -MovePlatformUp: - lda #$01 ;save value to stack - pha - ldy Enemy_ID,x ;get enemy object identifier - inx ;increment offset for enemy object - lda #$05 ;load default value here - cpy #$29 ;residual comparison, object #29 never executes - bne SetDplSpd ;this code, thus unconditional branch here - lda #$09 ;residual code -SetDplSpd: sta $00 ;save downward movement amount here - lda #$0a ;save upward movement amount here - sta $01 - lda #$03 ;save maximum vertical speed here - sta $02 - pla ;get value from stack - tay ;use as Y, then move onto code shared by red koopa - -RedPTroopaGrav: - jsr ImposeGravity ;do a sub to move object gradually - ldx ObjectOffset ;get enemy object offset and leave - rts - -;------------------------------------------------------------------------------------- -;$00 - used for downward force -;$01 - used for upward force -;$07 - used as adder for vertical position - -ImposeGravity: - pha ;push value to stack - lda SprObject_YMF_Dummy,x - clc ;add value in movement force to contents of dummy variable - adc SprObject_Y_MoveForce,x - sta SprObject_YMF_Dummy,x - ldy #$00 ;set Y to zero by default - lda SprObject_Y_Speed,x ;get current vertical speed - bpl AlterYP ;if currently moving downwards, do not decrement Y - dey ;otherwise decrement Y -AlterYP: sty $07 ;store Y here - adc SprObject_Y_Position,x ;add vertical position to vertical speed plus carry - sta SprObject_Y_Position,x ;store as new vertical position - lda SprObject_Y_HighPos,x - adc $07 ;add carry plus contents of $07 to vertical high byte - sta SprObject_Y_HighPos,x ;store as new vertical high byte - lda SprObject_Y_MoveForce,x - clc - adc $00 ;add downward movement amount to contents of $0433 - sta SprObject_Y_MoveForce,x - lda SprObject_Y_Speed,x ;add carry to vertical speed and store - adc #$00 - sta SprObject_Y_Speed,x - cmp $02 ;compare to maximum speed - bmi ChkUpM ;if less than preset value, skip this part - lda SprObject_Y_MoveForce,x - cmp #$80 ;if less positively than preset maximum, skip this part - bcc ChkUpM - lda $02 - sta SprObject_Y_Speed,x ;keep vertical speed within maximum value - lda #$00 - sta SprObject_Y_MoveForce,x ;clear fractional -ChkUpM: pla ;get value from stack - beq ExVMove ;if set to zero, branch to leave - lda $02 - eor #%11111111 ;otherwise get two's compliment of maximum speed - tay - iny - sty $07 ;store two's compliment here - lda SprObject_Y_MoveForce,x - sec ;subtract upward movement amount from contents - sbc $01 ;of movement force, note that $01 is twice as large as $00, - sta SprObject_Y_MoveForce,x ;thus it effectively undoes add we did earlier - lda SprObject_Y_Speed,x - sbc #$00 ;subtract borrow from vertical speed and store - sta SprObject_Y_Speed,x - cmp $07 ;compare vertical speed to two's compliment - bpl ExVMove ;if less negatively than preset maximum, skip this part - lda SprObject_Y_MoveForce,x - cmp #$80 ;check if fractional part is above certain amount, - bcs ExVMove ;and if so, branch to leave - lda $07 - sta SprObject_Y_Speed,x ;keep vertical speed within maximum value - lda #$ff - sta SprObject_Y_MoveForce,x ;clear fractional -ExVMove: rts ;leave! - -;------------------------------------------------------------------------------------- - -EnemiesAndLoopsCore: - lda Enemy_Flag,x ;check data here for MSB set - pha ;save in stack - asl - bcs ChkBowserF ;if MSB set in enemy flag, branch ahead of jumps - pla ;get from stack - beq ChkAreaTsk ;if data zero, branch - jmp RunEnemyObjectsCore ;otherwise, jump to run enemy subroutines -ChkAreaTsk: lda AreaParserTaskNum ;check number of tasks to perform - and #$07 - cmp #$07 ;if at a specific task, jump and leave - beq ExitELCore - jmp ProcLoopCommand ;otherwise, jump to process loop command/load enemies -ChkBowserF: pla ;get data from stack - and #%00001111 ;mask out high nybble - tay - lda Enemy_Flag,y ;use as pointer and load same place with different offset - bne ExitELCore - sta Enemy_Flag,x ;if second enemy flag not set, also clear first one -ExitELCore: rts - -;-------------------------------- - -;loop command data -LoopCmdWorldNumber: - .db $03, $03, $06, $06, $06, $06, $06, $06, $07, $07, $07 - -LoopCmdPageNumber: - .db $05, $09, $04, $05, $06, $08, $09, $0a, $06, $0b, $10 - -LoopCmdYPosition: - .db $40, $b0, $b0, $80, $40, $40, $80, $40, $f0, $f0, $f0 - -ExecGameLoopback: - lda Player_PageLoc ;send player back four pages - sec - sbc #$04 - sta Player_PageLoc - lda CurrentPageLoc ;send current page back four pages - sec - sbc #$04 - sta CurrentPageLoc - lda ScreenLeft_PageLoc ;subtract four from page location - sec ;of screen's left border - sbc #$04 - sta ScreenLeft_PageLoc - lda ScreenRight_PageLoc ;do the same for the page location - sec ;of screen's right border - sbc #$04 - sta ScreenRight_PageLoc - lda AreaObjectPageLoc ;subtract four from page control - sec ;for area objects - sbc #$04 - sta AreaObjectPageLoc - lda #$00 ;initialize page select for both - sta EnemyObjectPageSel ;area and enemy objects - sta AreaObjectPageSel - sta EnemyDataOffset ;initialize enemy object data offset - sta EnemyObjectPageLoc ;and enemy object page control - lda AreaDataOfsLoopback,y ;adjust area object offset based on - sta AreaDataOffset ;which loop command we encountered - rts - -ProcLoopCommand: - lda LoopCommand ;check if loop command was found - beq ChkEnemyFrenzy - lda CurrentColumnPos ;check to see if we're still on the first page - bne ChkEnemyFrenzy ;if not, do not loop yet - ldy #$0b ;start at the end of each set of loop data -FindLoop: dey - bmi ChkEnemyFrenzy ;if all data is checked and not match, do not loop - lda WorldNumber ;check to see if one of the world numbers - cmp LoopCmdWorldNumber,y ;matches our current world number - bne FindLoop - lda CurrentPageLoc ;check to see if one of the page numbers - cmp LoopCmdPageNumber,y ;matches the page we're currently on - bne FindLoop - lda Player_Y_Position ;check to see if the player is at the correct position - cmp LoopCmdYPosition,y ;if not, branch to check for world 7 - bne WrongChk - lda Player_State ;check to see if the player is - cmp #$00 ;on solid ground (i.e. not jumping or falling) - bne WrongChk ;if not, player fails to pass loop, and loopback - lda WorldNumber ;are we in world 7? (check performed on correct - cmp #World7 ;vertical position and on solid ground) - bne InitMLp ;if not, initialize flags used there, otherwise - inc MultiLoopCorrectCntr ;increment counter for correct progression -IncMLoop: inc MultiLoopPassCntr ;increment master multi-part counter - lda MultiLoopPassCntr ;have we done all three parts? - cmp #$03 - bne InitLCmd ;if not, skip this part - lda MultiLoopCorrectCntr ;if so, have we done them all correctly? - cmp #$03 - beq InitMLp ;if so, branch past unnecessary check here - bne DoLpBack ;unconditional branch if previous branch fails -WrongChk: lda WorldNumber ;are we in world 7? (check performed on - cmp #World7 ;incorrect vertical position or not on solid ground) - beq IncMLoop -DoLpBack: jsr ExecGameLoopback ;if player is not in right place, loop back - jsr KillAllEnemies -InitMLp: lda #$00 ;initialize counters used for multi-part loop commands - sta MultiLoopPassCntr - sta MultiLoopCorrectCntr -InitLCmd: lda #$00 ;initialize loop command flag - sta LoopCommand - -;-------------------------------- - -ChkEnemyFrenzy: - lda EnemyFrenzyQueue ;check for enemy object in frenzy queue - beq ProcessEnemyData ;if not, skip this part - sta Enemy_ID,x ;store as enemy object identifier here - lda #$01 - sta Enemy_Flag,x ;activate enemy object flag - lda #$00 - sta Enemy_State,x ;initialize state and frenzy queue - sta EnemyFrenzyQueue - jmp InitEnemyObject ;and then jump to deal with this enemy - -;-------------------------------- -;$06 - used to hold page location of extended right boundary -;$07 - used to hold high nybble of position of extended right boundary - -ProcessEnemyData: - ldy EnemyDataOffset ;get offset of enemy object data - lda (EnemyData),y ;load first byte - cmp #$ff ;check for EOD terminator - bne CheckEndofBuffer - jmp CheckFrenzyBuffer ;if found, jump to check frenzy buffer, otherwise - -CheckEndofBuffer: - and #%00001111 ;check for special row $0e - cmp #$0e - beq CheckRightBounds ;if found, branch, otherwise - cpx #$05 ;check for end of buffer - bcc CheckRightBounds ;if not at end of buffer, branch - iny - lda (EnemyData),y ;check for specific value here - and #%00111111 ;not sure what this was intended for, exactly - cmp #$2e ;this part is quite possibly residual code - beq CheckRightBounds ;but it has the effect of keeping enemies out of - rts ;the sixth slot - -CheckRightBounds: - lda ScreenRight_X_Pos ;add 48 to pixel coordinate of right boundary - clc - adc #$30 - and #%11110000 ;store high nybble - sta $07 - lda ScreenRight_PageLoc ;add carry to page location of right boundary - adc #$00 - sta $06 ;store page location + carry - ldy EnemyDataOffset - iny - lda (EnemyData),y ;if MSB of enemy object is clear, branch to check for row $0f - asl - bcc CheckPageCtrlRow - lda EnemyObjectPageSel ;if page select already set, do not set again - bne CheckPageCtrlRow - inc EnemyObjectPageSel ;otherwise, if MSB is set, set page select - inc EnemyObjectPageLoc ;and increment page control - -CheckPageCtrlRow: - dey - lda (EnemyData),y ;reread first byte - and #$0f - cmp #$0f ;check for special row $0f - bne PositionEnemyObj ;if not found, branch to position enemy object - lda EnemyObjectPageSel ;if page select set, - bne PositionEnemyObj ;branch without reading second byte - iny - lda (EnemyData),y ;otherwise, get second byte, mask out 2 MSB - and #%00111111 - sta EnemyObjectPageLoc ;store as page control for enemy object data - inc EnemyDataOffset ;increment enemy object data offset 2 bytes - inc EnemyDataOffset - inc EnemyObjectPageSel ;set page select for enemy object data and - jmp ProcLoopCommand ;jump back to process loop commands again - -PositionEnemyObj: - lda EnemyObjectPageLoc ;store page control as page location - sta Enemy_PageLoc,x ;for enemy object - lda (EnemyData),y ;get first byte of enemy object - and #%11110000 - sta Enemy_X_Position,x ;store column position - cmp ScreenRight_X_Pos ;check column position against right boundary - lda Enemy_PageLoc,x ;without subtracting, then subtract borrow - sbc ScreenRight_PageLoc ;from page location - bcs CheckRightExtBounds ;if enemy object beyond or at boundary, branch - lda (EnemyData),y - and #%00001111 ;check for special row $0e - cmp #$0e ;if found, jump elsewhere - beq ParseRow0e - jmp CheckThreeBytes ;if not found, unconditional jump - -CheckRightExtBounds: - lda $07 ;check right boundary + 48 against - cmp Enemy_X_Position,x ;column position without subtracting, - lda $06 ;then subtract borrow from page control temp - sbc Enemy_PageLoc,x ;plus carry - bcc CheckFrenzyBuffer ;if enemy object beyond extended boundary, branch - lda #$01 ;store value in vertical high byte - sta Enemy_Y_HighPos,x - lda (EnemyData),y ;get first byte again - asl ;multiply by four to get the vertical - asl ;coordinate - asl - asl - sta Enemy_Y_Position,x - cmp #$e0 ;do one last check for special row $0e - beq ParseRow0e ;(necessary if branched to $c1cb) - iny - lda (EnemyData),y ;get second byte of object - and #%01000000 ;check to see if hard mode bit is set - beq CheckForEnemyGroup ;if not, branch to check for group enemy objects - lda SecondaryHardMode ;if set, check to see if secondary hard mode flag - beq Inc2B ;is on, and if not, branch to skip this object completely - -CheckForEnemyGroup: - lda (EnemyData),y ;get second byte and mask out 2 MSB - and #%00111111 - cmp #$37 ;check for value below $37 - bcc BuzzyBeetleMutate - cmp #$3f ;if $37 or greater, check for value - bcc DoGroup ;below $3f, branch if below $3f - -BuzzyBeetleMutate: - cmp #Goomba ;if below $37, check for goomba - bne StrID ;value ($3f or more always fails) - ldy PrimaryHardMode ;check if primary hard mode flag is set - beq StrID ;and if so, change goomba to buzzy beetle - lda #BuzzyBeetle -StrID: sta Enemy_ID,x ;store enemy object number into buffer - lda #$01 - sta Enemy_Flag,x ;set flag for enemy in buffer - jsr InitEnemyObject - lda Enemy_Flag,x ;check to see if flag is set - bne Inc2B ;if not, leave, otherwise branch - rts - -CheckFrenzyBuffer: - lda EnemyFrenzyBuffer ;if enemy object stored in frenzy buffer - bne StrFre ;then branch ahead to store in enemy object buffer - lda VineFlagOffset ;otherwise check vine flag offset - cmp #$01 - bne ExEPar ;if other value <> 1, leave - lda #VineObject ;otherwise put vine in enemy identifier -StrFre: sta Enemy_ID,x ;store contents of frenzy buffer into enemy identifier value - -InitEnemyObject: - lda #$00 ;initialize enemy state - sta Enemy_State,x - jsr CheckpointEnemyID ;jump ahead to run jump engine and subroutines -ExEPar: rts ;then leave - -DoGroup: - jmp HandleGroupEnemies ;handle enemy group objects - -ParseRow0e: - iny ;increment Y to load third byte of object - iny - lda (EnemyData),y - lsr ;move 3 MSB to the bottom, effectively - lsr ;making %xxx00000 into %00000xxx - lsr - lsr - lsr - cmp WorldNumber ;is it the same world number as we're on? - bne NotUse ;if not, do not use (this allows multiple uses - dey ;of the same area, like the underground bonus areas) - lda (EnemyData),y ;otherwise, get second byte and use as offset - sta AreaPointer ;to addresses for level and enemy object data - iny - lda (EnemyData),y ;get third byte again, and this time mask out - and #%00011111 ;the 3 MSB from before, save as page number to be - sta EntrancePage ;used upon entry to area, if area is entered -NotUse: jmp Inc3B - -CheckThreeBytes: - ldy EnemyDataOffset ;load current offset for enemy object data - lda (EnemyData),y ;get first byte - and #%00001111 ;check for special row $0e - cmp #$0e - bne Inc2B -Inc3B: inc EnemyDataOffset ;if row = $0e, increment three bytes -Inc2B: inc EnemyDataOffset ;otherwise increment two bytes - inc EnemyDataOffset - lda #$00 ;init page select for enemy objects - sta EnemyObjectPageSel - ldx ObjectOffset ;reload current offset in enemy buffers - rts ;and leave - -CheckpointEnemyID: - lda Enemy_ID,x - cmp #$15 ;check enemy object identifier for $15 or greater - bcs InitEnemyRoutines ;and branch straight to the jump engine if found - tay ;save identifier in Y register for now - lda Enemy_Y_Position,x - adc #$08 ;add eight pixels to what will eventually be the - sta Enemy_Y_Position,x ;enemy object's vertical coordinate ($00-$14 only) - lda #$01 - sta EnemyOffscrBitsMasked,x ;set offscreen masked bit - tya ;get identifier back and use as offset for jump engine - -InitEnemyRoutines: - jsr JumpEngine - -;jump engine table for newly loaded enemy objects - - .dw InitNormalEnemy ;for objects $00-$0f - .dw InitNormalEnemy - .dw InitNormalEnemy - .dw InitRedKoopa - .dw NoInitCode - .dw InitHammerBro - .dw InitGoomba - .dw InitBloober - .dw InitBulletBill - .dw NoInitCode - .dw InitCheepCheep - .dw InitCheepCheep - .dw InitPodoboo - .dw InitPiranhaPlant - .dw InitJumpGPTroopa - .dw InitRedPTroopa - - .dw InitHorizFlySwimEnemy ;for objects $10-$1f - .dw InitLakitu - .dw InitEnemyFrenzy - .dw NoInitCode - .dw InitEnemyFrenzy - .dw InitEnemyFrenzy - .dw InitEnemyFrenzy - .dw InitEnemyFrenzy - .dw EndFrenzy - .dw NoInitCode - .dw NoInitCode - .dw InitShortFirebar - .dw InitShortFirebar - .dw InitShortFirebar - .dw InitShortFirebar - .dw InitLongFirebar - - .dw NoInitCode ;for objects $20-$2f - .dw NoInitCode - .dw NoInitCode - .dw NoInitCode - .dw InitBalPlatform - .dw InitVertPlatform - .dw LargeLiftUp - .dw LargeLiftDown - .dw InitHoriPlatform - .dw InitDropPlatform - .dw InitHoriPlatform - .dw PlatLiftUp - .dw PlatLiftDown - .dw InitBowser - .dw PwrUpJmp ;possibly dummy value - .dw Setup_Vine - - .dw NoInitCode ;for objects $30-$36 - .dw NoInitCode - .dw NoInitCode - .dw NoInitCode - .dw NoInitCode - .dw InitRetainerObj - .dw EndOfEnemyInitCode - -;------------------------------------------------------------------------------------- - -NoInitCode: - rts ;this executed when enemy object has no init code - -;-------------------------------- - -InitGoomba: - jsr InitNormalEnemy ;set appropriate horizontal speed - jmp SmallBBox ;set $09 as bounding box control, set other values - -;-------------------------------- - -InitPodoboo: - lda #$02 ;set enemy position to below - sta Enemy_Y_HighPos,x ;the bottom of the screen - sta Enemy_Y_Position,x - lsr - sta EnemyIntervalTimer,x ;set timer for enemy - lsr - sta Enemy_State,x ;initialize enemy state, then jump to use - jmp SmallBBox ;$09 as bounding box size and set other things - -;-------------------------------- - -InitRetainerObj: - lda #$b8 ;set fixed vertical position for - sta Enemy_Y_Position,x ;princess/mushroom retainer object - rts - -;-------------------------------- - -NormalXSpdData: - .db $f8, $f4 - -InitNormalEnemy: - ldy #$01 ;load offset of 1 by default - lda PrimaryHardMode ;check for primary hard mode flag set - bne GetESpd - dey ;if not set, decrement offset -GetESpd: lda NormalXSpdData,y ;get appropriate horizontal speed -SetESpd: sta Enemy_X_Speed,x ;store as speed for enemy object - jmp TallBBox ;branch to set bounding box control and other data - -;-------------------------------- - -InitRedKoopa: - jsr InitNormalEnemy ;load appropriate horizontal speed - lda #$01 ;set enemy state for red koopa troopa $03 - sta Enemy_State,x - rts - -;-------------------------------- - -HBroWalkingTimerData: - .db $80, $50 - -InitHammerBro: - lda #$00 ;init horizontal speed and timer used by hammer bro - sta HammerThrowingTimer,x ;apparently to time hammer throwing - sta Enemy_X_Speed,x - ldy SecondaryHardMode ;get secondary hard mode flag - lda HBroWalkingTimerData,y - sta EnemyIntervalTimer,x ;set value as delay for hammer bro to walk left - lda #$0b ;set specific value for bounding box size control - jmp SetBBox - -;-------------------------------- - -InitHorizFlySwimEnemy: - lda #$00 ;initialize horizontal speed - jmp SetESpd - -;-------------------------------- - -InitBloober: - lda #$00 ;initialize horizontal speed - sta BlooperMoveSpeed,x -SmallBBox: lda #$09 ;set specific bounding box size control - bne SetBBox ;unconditional branch - -;-------------------------------- - -InitRedPTroopa: - ldy #$30 ;load central position adder for 48 pixels down - lda Enemy_Y_Position,x ;set vertical coordinate into location to - sta RedPTroopaOrigXPos,x ;be used as original vertical coordinate - bpl GetCent ;if vertical coordinate < $80 - ldy #$e0 ;if => $80, load position adder for 32 pixels up -GetCent: tya ;send central position adder to A - adc Enemy_Y_Position,x ;add to current vertical coordinate - sta RedPTroopaCenterYPos,x ;store as central vertical coordinate -TallBBox: lda #$03 ;set specific bounding box size control -SetBBox: sta Enemy_BoundBoxCtrl,x ;set bounding box control here - lda #$02 ;set moving direction for left - sta Enemy_MovingDir,x -InitVStf: lda #$00 ;initialize vertical speed - sta Enemy_Y_Speed,x ;and movement force - sta Enemy_Y_MoveForce,x - rts - -;-------------------------------- - -InitBulletBill: - lda #$02 ;set moving direction for left - sta Enemy_MovingDir,x - lda #$09 ;set bounding box control for $09 - sta Enemy_BoundBoxCtrl,x - rts - -;-------------------------------- - -InitCheepCheep: - jsr SmallBBox ;set vertical bounding box, speed, init others - lda PseudoRandomBitReg,x ;check one portion of LSFR - and #%00010000 ;get d4 from it - sta CheepCheepMoveMFlag,x ;save as movement flag of some sort - lda Enemy_Y_Position,x - sta CheepCheepOrigYPos,x ;save original vertical coordinate here - rts - -;-------------------------------- - -InitLakitu: - lda EnemyFrenzyBuffer ;check to see if an enemy is already in - bne KillLakitu ;the frenzy buffer, and branch to kill lakitu if so - -SetupLakitu: - lda #$00 ;erase counter for lakitu's reappearance - sta LakituReappearTimer - jsr InitHorizFlySwimEnemy ;set $03 as bounding box, set other attributes - jmp TallBBox2 ;set $03 as bounding box again (not necessary) and leave - -KillLakitu: - jmp EraseEnemyObject - -;-------------------------------- -;$01-$03 - used to hold pseudorandom difference adjusters - -PRDiffAdjustData: - .db $26, $2c, $32, $38 - .db $20, $22, $24, $26 - .db $13, $14, $15, $16 - -LakituAndSpinyHandler: - lda FrenzyEnemyTimer ;if timer here not expired, leave - bne ExLSHand - cpx #$05 ;if we are on the special use slot, leave - bcs ExLSHand - lda #$80 ;set timer - sta FrenzyEnemyTimer - ldy #$04 ;start with the last enemy slot -ChkLak: lda Enemy_ID,y ;check all enemy slots to see - cmp #Lakitu ;if lakitu is on one of them - beq CreateSpiny ;if so, branch out of this loop - dey ;otherwise check another slot - bpl ChkLak ;loop until all slots are checked - inc LakituReappearTimer ;increment reappearance timer - lda LakituReappearTimer - cmp #$07 ;check to see if we're up to a certain value yet - bcc ExLSHand ;if not, leave - ldx #$04 ;start with the last enemy slot again -ChkNoEn: lda Enemy_Flag,x ;check enemy buffer flag for non-active enemy slot - beq CreateL ;branch out of loop if found - dex ;otherwise check next slot - bpl ChkNoEn ;branch until all slots are checked - bmi RetEOfs ;if no empty slots were found, branch to leave -CreateL: lda #$00 ;initialize enemy state - sta Enemy_State,x - lda #Lakitu ;create lakitu enemy object - sta Enemy_ID,x - jsr SetupLakitu ;do a sub to set up lakitu - lda #$20 - jsr PutAtRightExtent ;finish setting up lakitu -RetEOfs: ldx ObjectOffset ;get enemy object buffer offset again and leave -ExLSHand: rts - -;-------------------------------- - -CreateSpiny: - lda Player_Y_Position ;if player above a certain point, branch to leave - cmp #$2c - bcc ExLSHand - lda Enemy_State,y ;if lakitu is not in normal state, branch to leave - bne ExLSHand - lda Enemy_PageLoc,y ;store horizontal coordinates (high and low) of lakitu - sta Enemy_PageLoc,x ;into the coordinates of the spiny we're going to create - lda Enemy_X_Position,y - sta Enemy_X_Position,x - lda #$01 ;put spiny within vertical screen unit - sta Enemy_Y_HighPos,x - lda Enemy_Y_Position,y ;put spiny eight pixels above where lakitu is - sec - sbc #$08 - sta Enemy_Y_Position,x - lda PseudoRandomBitReg,x ;get 2 LSB of LSFR and save to Y - and #%00000011 - tay - ldx #$02 -DifLoop: lda PRDiffAdjustData,y ;get three values and save them - sta $01,x ;to $01-$03 - iny - iny ;increment Y four bytes for each value - iny - iny - dex ;decrement X for each one - bpl DifLoop ;loop until all three are written - ldx ObjectOffset ;get enemy object buffer offset - jsr PlayerLakituDiff ;move enemy, change direction, get value - difference - ldy Player_X_Speed ;check player's horizontal speed - cpy #$08 - bcs SetSpSpd ;if moving faster than a certain amount, branch elsewhere - tay ;otherwise save value in A to Y for now - lda PseudoRandomBitReg+1,x - and #%00000011 ;get one of the LSFR parts and save the 2 LSB - beq UsePosv ;branch if neither bits are set - tya - eor #%11111111 ;otherwise get two's compliment of Y - tay - iny -UsePosv: tya ;put value from A in Y back to A (they will be lost anyway) -SetSpSpd: jsr SmallBBox ;set bounding box control, init attributes, lose contents of A - ldy #$02 - sta Enemy_X_Speed,x ;set horizontal speed to zero because previous contents - cmp #$00 ;of A were lost...branch here will never be taken for - bmi SpinyRte ;the same reason - dey -SpinyRte: sty Enemy_MovingDir,x ;set moving direction to the right - lda #$fd - sta Enemy_Y_Speed,x ;set vertical speed to move upwards - lda #$01 - sta Enemy_Flag,x ;enable enemy object by setting flag - lda #$05 - sta Enemy_State,x ;put spiny in egg state and leave -ChpChpEx: rts - -;-------------------------------- - -FirebarSpinSpdData: - .db $28, $38, $28, $38, $28 - -FirebarSpinDirData: - .db $00, $00, $10, $10, $00 - -InitLongFirebar: - jsr DuplicateEnemyObj ;create enemy object for long firebar - -InitShortFirebar: - lda #$00 ;initialize low byte of spin state - sta FirebarSpinState_Low,x - lda Enemy_ID,x ;subtract $1b from enemy identifier - sec ;to get proper offset for firebar data - sbc #$1b - tay - lda FirebarSpinSpdData,y ;get spinning speed of firebar - sta FirebarSpinSpeed,x - lda FirebarSpinDirData,y ;get spinning direction of firebar - sta FirebarSpinDirection,x - lda Enemy_Y_Position,x - clc ;add four pixels to vertical coordinate - adc #$04 - sta Enemy_Y_Position,x - lda Enemy_X_Position,x - clc ;add four pixels to horizontal coordinate - adc #$04 - sta Enemy_X_Position,x - lda Enemy_PageLoc,x - adc #$00 ;add carry to page location - sta Enemy_PageLoc,x - jmp TallBBox2 ;set bounding box control (not used) and leave - -;-------------------------------- -;$00-$01 - used to hold pseudorandom bits - -FlyCCXPositionData: - .db $80, $30, $40, $80 - .db $30, $50, $50, $70 - .db $20, $40, $80, $a0 - .db $70, $40, $90, $68 - -FlyCCXSpeedData: - .db $0e, $05, $06, $0e - .db $1c, $20, $10, $0c - .db $1e, $22, $18, $14 - -FlyCCTimerData: - .db $10, $60, $20, $48 - -InitFlyingCheepCheep: - lda FrenzyEnemyTimer ;if timer here not expired yet, branch to leave - bne ChpChpEx - jsr SmallBBox ;jump to set bounding box size $09 and init other values - lda PseudoRandomBitReg+1,x - and #%00000011 ;set pseudorandom offset here - tay - lda FlyCCTimerData,y ;load timer with pseudorandom offset - sta FrenzyEnemyTimer - ldy #$03 ;load Y with default value - lda SecondaryHardMode - beq MaxCC ;if secondary hard mode flag not set, do not increment Y - iny ;otherwise, increment Y to allow as many as four onscreen -MaxCC: sty $00 ;store whatever pseudorandom bits are in Y - cpx $00 ;compare enemy object buffer offset with Y - bcs ChpChpEx ;if X => Y, branch to leave - lda PseudoRandomBitReg,x - and #%00000011 ;get last two bits of LSFR, first part - sta $00 ;and store in two places - sta $01 - lda #$fb ;set vertical speed for cheep-cheep - sta Enemy_Y_Speed,x - lda #$00 ;load default value - ldy Player_X_Speed ;check player's horizontal speed - beq GSeed ;if player not moving left or right, skip this part - lda #$04 - cpy #$19 ;if moving to the right but not very quickly, - bcc GSeed ;do not change A - asl ;otherwise, multiply A by 2 -GSeed: pha ;save to stack - clc - adc $00 ;add to last two bits of LSFR we saved earlier - sta $00 ;save it there - lda PseudoRandomBitReg+1,x - and #%00000011 ;if neither of the last two bits of second LSFR set, - beq RSeed ;skip this part and save contents of $00 - lda PseudoRandomBitReg+2,x - and #%00001111 ;otherwise overwrite with lower nybble of - sta $00 ;third LSFR part -RSeed: pla ;get value from stack we saved earlier - clc - adc $01 ;add to last two bits of LSFR we saved in other place - tay ;use as pseudorandom offset here - lda FlyCCXSpeedData,y ;get horizontal speed using pseudorandom offset - sta Enemy_X_Speed,x - lda #$01 ;set to move towards the right - sta Enemy_MovingDir,x - lda Player_X_Speed ;if player moving left or right, branch ahead of this part - bne D2XPos1 - ldy $00 ;get first LSFR or third LSFR lower nybble - tya ;and check for d1 set - and #%00000010 - beq D2XPos1 ;if d1 not set, branch - lda Enemy_X_Speed,x - eor #$ff ;if d1 set, change horizontal speed - clc ;into two's compliment, thus moving in the opposite - adc #$01 ;direction - sta Enemy_X_Speed,x - inc Enemy_MovingDir,x ;increment to move towards the left -D2XPos1: tya ;get first LSFR or third LSFR lower nybble again - and #%00000010 - beq D2XPos2 ;check for d1 set again, branch again if not set - lda Player_X_Position ;get player's horizontal position - clc - adc FlyCCXPositionData,y ;if d1 set, add value obtained from pseudorandom offset - sta Enemy_X_Position,x ;and save as enemy's horizontal position - lda Player_PageLoc ;get player's page location - adc #$00 ;add carry and jump past this part - jmp FinCCSt -D2XPos2: lda Player_X_Position ;get player's horizontal position - sec - sbc FlyCCXPositionData,y ;if d1 not set, subtract value obtained from pseudorandom - sta Enemy_X_Position,x ;offset and save as enemy's horizontal position - lda Player_PageLoc ;get player's page location - sbc #$00 ;subtract borrow -FinCCSt: sta Enemy_PageLoc,x ;save as enemy's page location - lda #$01 - sta Enemy_Flag,x ;set enemy's buffer flag - sta Enemy_Y_HighPos,x ;set enemy's high vertical byte - lda #$f8 - sta Enemy_Y_Position,x ;put enemy below the screen, and we are done - rts - -;-------------------------------- - -InitBowser: - jsr DuplicateEnemyObj ;jump to create another bowser object - stx BowserFront_Offset ;save offset of first here - lda #$00 - sta BowserBodyControls ;initialize bowser's body controls - sta BridgeCollapseOffset ;and bridge collapse offset - lda Enemy_X_Position,x - sta BowserOrigXPos ;store original horizontal position here - lda #$df - sta BowserFireBreathTimer ;store something here - sta Enemy_MovingDir,x ;and in moving direction - lda #$20 - sta BowserFeetCounter ;set bowser's feet timer and in enemy timer - sta EnemyFrameTimer,x - lda #$05 - sta BowserHitPoints ;give bowser 5 hit points - lsr - sta BowserMovementSpeed ;set default movement speed here - rts - -;-------------------------------- - -DuplicateEnemyObj: - ldy #$ff ;start at beginning of enemy slots -FSLoop: iny ;increment one slot - lda Enemy_Flag,y ;check enemy buffer flag for empty slot - bne FSLoop ;if set, branch and keep checking - sty DuplicateObj_Offset ;otherwise set offset here - txa ;transfer original enemy buffer offset - ora #%10000000 ;store with d7 set as flag in new enemy - sta Enemy_Flag,y ;slot as well as enemy offset - lda Enemy_PageLoc,x - sta Enemy_PageLoc,y ;copy page location and horizontal coordinates - lda Enemy_X_Position,x ;from original enemy to new enemy - sta Enemy_X_Position,y - lda #$01 - sta Enemy_Flag,x ;set flag as normal for original enemy - sta Enemy_Y_HighPos,y ;set high vertical byte for new enemy - lda Enemy_Y_Position,x - sta Enemy_Y_Position,y ;copy vertical coordinate from original to new -FlmEx: rts ;and then leave - -;-------------------------------- - -FlameYPosData: - .db $90, $80, $70, $90 - -FlameYMFAdderData: - .db $ff, $01 - -InitBowserFlame: - lda FrenzyEnemyTimer ;if timer not expired yet, branch to leave - bne FlmEx - sta Enemy_Y_MoveForce,x ;reset something here - lda NoiseSoundQueue - ora #Sfx_BowserFlame ;load bowser's flame sound into queue - sta NoiseSoundQueue - ldy BowserFront_Offset ;get bowser's buffer offset - lda Enemy_ID,y ;check for bowser - cmp #Bowser - beq SpawnFromMouth ;branch if found - jsr SetFlameTimer ;get timer data based on flame counter - clc - adc #$20 ;add 32 frames by default - ldy SecondaryHardMode - beq SetFrT ;if secondary mode flag not set, use as timer setting - sec - sbc #$10 ;otherwise subtract 16 frames for secondary hard mode -SetFrT: sta FrenzyEnemyTimer ;set timer accordingly - lda PseudoRandomBitReg,x - and #%00000011 ;get 2 LSB from first part of LSFR - sta BowserFlamePRandomOfs,x ;set here - tay ;use as offset - lda FlameYPosData,y ;load vertical position based on pseudorandom offset - -PutAtRightExtent: - sta Enemy_Y_Position,x ;set vertical position - lda ScreenRight_X_Pos - clc - adc #$20 ;place enemy 32 pixels beyond right side of screen - sta Enemy_X_Position,x - lda ScreenRight_PageLoc - adc #$00 ;add carry - sta Enemy_PageLoc,x - jmp FinishFlame ;skip this part to finish setting values - -SpawnFromMouth: - lda Enemy_X_Position,y ;get bowser's horizontal position - sec - sbc #$0e ;subtract 14 pixels - sta Enemy_X_Position,x ;save as flame's horizontal position - lda Enemy_PageLoc,y - sta Enemy_PageLoc,x ;copy page location from bowser to flame - lda Enemy_Y_Position,y - clc ;add 8 pixels to bowser's vertical position - adc #$08 - sta Enemy_Y_Position,x ;save as flame's vertical position - lda PseudoRandomBitReg,x - and #%00000011 ;get 2 LSB from first part of LSFR - sta Enemy_YMF_Dummy,x ;save here - tay ;use as offset - lda FlameYPosData,y ;get value here using bits as offset - ldy #$00 ;load default offset - cmp Enemy_Y_Position,x ;compare value to flame's current vertical position - bcc SetMF ;if less, do not increment offset - iny ;otherwise increment now -SetMF: lda FlameYMFAdderData,y ;get value here and save - sta Enemy_Y_MoveForce,x ;to vertical movement force - lda #$00 - sta EnemyFrenzyBuffer ;clear enemy frenzy buffer - -FinishFlame: - lda #$08 ;set $08 for bounding box control - sta Enemy_BoundBoxCtrl,x - lda #$01 ;set high byte of vertical and - sta Enemy_Y_HighPos,x ;enemy buffer flag - sta Enemy_Flag,x - lsr - sta Enemy_X_MoveForce,x ;initialize horizontal movement force, and - sta Enemy_State,x ;enemy state - rts - -;-------------------------------- - -FireworksXPosData: - .db $00, $30, $60, $60, $00, $20 - -FireworksYPosData: - .db $60, $40, $70, $40, $60, $30 - -InitFireworks: - lda FrenzyEnemyTimer ;if timer not expired yet, branch to leave - bne ExitFWk - lda #$20 ;otherwise reset timer - sta FrenzyEnemyTimer - dec FireworksCounter ;decrement for each explosion - ldy #$06 ;start at last slot -StarFChk: dey - lda Enemy_ID,y ;check for presence of star flag object - cmp #StarFlagObject ;if there isn't a star flag object, - bne StarFChk ;routine goes into infinite loop = crash - lda Enemy_X_Position,y - sec ;get horizontal coordinate of star flag object, then - sbc #$30 ;subtract 48 pixels from it and save to - pha ;the stack - lda Enemy_PageLoc,y - sbc #$00 ;subtract the carry from the page location - sta $00 ;of the star flag object - lda FireworksCounter ;get fireworks counter - clc - adc Enemy_State,y ;add state of star flag object (possibly not necessary) - tay ;use as offset - pla ;get saved horizontal coordinate of star flag - 48 pixels - clc - adc FireworksXPosData,y ;add number based on offset of fireworks counter - sta Enemy_X_Position,x ;store as the fireworks object horizontal coordinate - lda $00 - adc #$00 ;add carry and store as page location for - sta Enemy_PageLoc,x ;the fireworks object - lda FireworksYPosData,y ;get vertical position using same offset - sta Enemy_Y_Position,x ;and store as vertical coordinate for fireworks object - lda #$01 - sta Enemy_Y_HighPos,x ;store in vertical high byte - sta Enemy_Flag,x ;and activate enemy buffer flag - lsr - sta ExplosionGfxCounter,x ;initialize explosion counter - lda #$08 - sta ExplosionTimerCounter,x ;set explosion timing counter -ExitFWk: rts - -;-------------------------------- - -Bitmasks: - .db %00000001, %00000010, %00000100, %00001000, %00010000, %00100000, %01000000, %10000000 - -Enemy17YPosData: - .db $40, $30, $90, $50, $20, $60, $a0, $70 - -SwimCC_IDData: - .db $0a, $0b - -BulletBillCheepCheep: - lda FrenzyEnemyTimer ;if timer not expired yet, branch to leave - bne ExF17 - lda AreaType ;are we in a water-type level? - bne DoBulletBills ;if not, branch elsewhere - cpx #$03 ;are we past third enemy slot? - bcs ExF17 ;if so, branch to leave - ldy #$00 ;load default offset - lda PseudoRandomBitReg,x - cmp #$aa ;check first part of LSFR against preset value - bcc ChkW2 ;if less than preset, do not increment offset - iny ;otherwise increment -ChkW2: lda WorldNumber ;check world number - cmp #World2 - beq Get17ID ;if we're on world 2, do not increment offset - iny ;otherwise increment -Get17ID: tya - and #%00000001 ;mask out all but last bit of offset - tay - lda SwimCC_IDData,y ;load identifier for cheep-cheeps -Set17ID: sta Enemy_ID,x ;store whatever's in A as enemy identifier - lda BitMFilter - cmp #$ff ;if not all bits set, skip init part and compare bits - bne GetRBit - lda #$00 ;initialize vertical position filter - sta BitMFilter -GetRBit: lda PseudoRandomBitReg,x ;get first part of LSFR - and #%00000111 ;mask out all but 3 LSB -ChkRBit: tay ;use as offset - lda Bitmasks,y ;load bitmask - bit BitMFilter ;perform AND on filter without changing it - beq AddFBit - iny ;increment offset - tya - and #%00000111 ;mask out all but 3 LSB thus keeping it 0-7 - jmp ChkRBit ;do another check -AddFBit: ora BitMFilter ;add bit to already set bits in filter - sta BitMFilter ;and store - lda Enemy17YPosData,y ;load vertical position using offset - jsr PutAtRightExtent ;set vertical position and other values - sta Enemy_YMF_Dummy,x ;initialize dummy variable - lda #$20 ;set timer - sta FrenzyEnemyTimer - jmp CheckpointEnemyID ;process our new enemy object - -DoBulletBills: - ldy #$ff ;start at beginning of enemy slots -BB_SLoop: iny ;move onto the next slot - cpy #$05 ;branch to play sound if we've done all slots - bcs FireBulletBill - lda Enemy_Flag,y ;if enemy buffer flag not set, - beq BB_SLoop ;loop back and check another slot - lda Enemy_ID,y - cmp #BulletBill_FrenzyVar ;check enemy identifier for - bne BB_SLoop ;bullet bill object (frenzy variant) -ExF17: rts ;if found, leave - -FireBulletBill: - lda Square2SoundQueue - ora #Sfx_Blast ;play fireworks/gunfire sound - sta Square2SoundQueue - lda #BulletBill_FrenzyVar ;load identifier for bullet bill object - bne Set17ID ;unconditional branch - -;-------------------------------- -;$00 - used to store Y position of group enemies -;$01 - used to store enemy ID -;$02 - used to store page location of right side of screen -;$03 - used to store X position of right side of screen - -HandleGroupEnemies: - ldy #$00 ;load value for green koopa troopa - sec - sbc #$37 ;subtract $37 from second byte read - pha ;save result in stack for now - cmp #$04 ;was byte in $3b-$3e range? - bcs SnglID ;if so, branch - pha ;save another copy to stack - ldy #Goomba ;load value for goomba enemy - lda PrimaryHardMode ;if primary hard mode flag not set, - beq PullID ;branch, otherwise change to value - ldy #BuzzyBeetle ;for buzzy beetle -PullID: pla ;get second copy from stack -SnglID: sty $01 ;save enemy id here - ldy #$b0 ;load default y coordinate - and #$02 ;check to see if d1 was set - beq SetYGp ;if so, move y coordinate up, - ldy #$70 ;otherwise branch and use default -SetYGp: sty $00 ;save y coordinate here - lda ScreenRight_PageLoc ;get page number of right edge of screen - sta $02 ;save here - lda ScreenRight_X_Pos ;get pixel coordinate of right edge - sta $03 ;save here - ldy #$02 ;load two enemies by default - pla ;get first copy from stack - lsr ;check to see if d0 was set - bcc CntGrp ;if not, use default value - iny ;otherwise increment to three enemies -CntGrp: sty NumberofGroupEnemies ;save number of enemies here -GrLoop: ldx #$ff ;start at beginning of enemy buffers -GSltLp: inx ;increment and branch if past - cpx #$05 ;end of buffers - bcs NextED - lda Enemy_Flag,x ;check to see if enemy is already - bne GSltLp ;stored in buffer, and branch if so - lda $01 - sta Enemy_ID,x ;store enemy object identifier - lda $02 - sta Enemy_PageLoc,x ;store page location for enemy object - lda $03 - sta Enemy_X_Position,x ;store x coordinate for enemy object - clc - adc #$18 ;add 24 pixels for next enemy - sta $03 - lda $02 ;add carry to page location for - adc #$00 ;next enemy - sta $02 - lda $00 ;store y coordinate for enemy object - sta Enemy_Y_Position,x - lda #$01 ;activate flag for buffer, and - sta Enemy_Y_HighPos,x ;put enemy within the screen vertically - sta Enemy_Flag,x - jsr CheckpointEnemyID ;process each enemy object separately - dec NumberofGroupEnemies ;do this until we run out of enemy objects - bne GrLoop -NextED: jmp Inc2B ;jump to increment data offset and leave - -;-------------------------------- - -InitPiranhaPlant: - lda #$01 ;set initial speed - sta PiranhaPlant_Y_Speed,x - lsr - sta Enemy_State,x ;initialize enemy state and what would normally - sta PiranhaPlant_MoveFlag,x ;be used as vertical speed, but not in this case - lda Enemy_Y_Position,x - sta PiranhaPlantDownYPos,x ;save original vertical coordinate here - sec - sbc #$18 - sta PiranhaPlantUpYPos,x ;save original vertical coordinate - 24 pixels here - lda #$09 - jmp SetBBox2 ;set specific value for bounding box control - -;-------------------------------- - -InitEnemyFrenzy: - lda Enemy_ID,x ;load enemy identifier - sta EnemyFrenzyBuffer ;save in enemy frenzy buffer - sec - sbc #$12 ;subtract 12 and use as offset for jump engine - jsr JumpEngine - -;frenzy object jump table - .dw LakituAndSpinyHandler - .dw NoFrenzyCode - .dw InitFlyingCheepCheep - .dw InitBowserFlame - .dw InitFireworks - .dw BulletBillCheepCheep - -;-------------------------------- - -NoFrenzyCode: - rts - -;-------------------------------- - -EndFrenzy: - ldy #$05 ;start at last slot -LakituChk: lda Enemy_ID,y ;check enemy identifiers - cmp #Lakitu ;for lakitu - bne NextFSlot - lda #$01 ;if found, set state - sta Enemy_State,y -NextFSlot: dey ;move onto the next slot - bpl LakituChk ;do this until all slots are checked - lda #$00 - sta EnemyFrenzyBuffer ;empty enemy frenzy buffer - sta Enemy_Flag,x ;disable enemy buffer flag for this object - rts - -;-------------------------------- - -InitJumpGPTroopa: - lda #$02 ;set for movement to the left - sta Enemy_MovingDir,x - lda #$f8 ;set horizontal speed - sta Enemy_X_Speed,x -TallBBox2: lda #$03 ;set specific value for bounding box control -SetBBox2: sta Enemy_BoundBoxCtrl,x ;set bounding box control then leave - rts - -;-------------------------------- - -InitBalPlatform: - dec Enemy_Y_Position,x ;raise vertical position by two pixels - dec Enemy_Y_Position,x - ldy SecondaryHardMode ;if secondary hard mode flag not set, - bne AlignP ;branch ahead - ldy #$02 ;otherwise set value here - jsr PosPlatform ;do a sub to add or subtract pixels -AlignP: ldy #$ff ;set default value here for now - lda BalPlatformAlignment ;get current balance platform alignment - sta Enemy_State,x ;set platform alignment to object state here - bpl SetBPA ;if old alignment $ff, put $ff as alignment for negative - txa ;if old contents already $ff, put - tay ;object offset as alignment to make next positive -SetBPA: sty BalPlatformAlignment ;store whatever value's in Y here - lda #$00 - sta Enemy_MovingDir,x ;init moving direction - tay ;init Y - jsr PosPlatform ;do a sub to add 8 pixels, then run shared code here - -;-------------------------------- - -InitDropPlatform: - lda #$ff - sta PlatformCollisionFlag,x ;set some value here - jmp CommonPlatCode ;then jump ahead to execute more code - -;-------------------------------- - -InitHoriPlatform: - lda #$00 - sta XMoveSecondaryCounter,x ;init one of the moving counters - jmp CommonPlatCode ;jump ahead to execute more code - -;-------------------------------- - -InitVertPlatform: - ldy #$40 ;set default value here - lda Enemy_Y_Position,x ;check vertical position - bpl SetYO ;if above a certain point, skip this part - eor #$ff - clc ;otherwise get two's compliment - adc #$01 - ldy #$c0 ;get alternate value to add to vertical position -SetYO: sta YPlatformTopYPos,x ;save as top vertical position - tya - clc ;load value from earlier, add number of pixels - adc Enemy_Y_Position,x ;to vertical position - sta YPlatformCenterYPos,x ;save result as central vertical position - -;-------------------------------- - -CommonPlatCode: - jsr InitVStf ;do a sub to init certain other values -SPBBox: lda #$05 ;set default bounding box size control - ldy AreaType - cpy #$03 ;check for castle-type level - beq CasPBB ;use default value if found - ldy SecondaryHardMode ;otherwise check for secondary hard mode flag - bne CasPBB ;if set, use default value - lda #$06 ;use alternate value if not castle or secondary not set -CasPBB: sta Enemy_BoundBoxCtrl,x ;set bounding box size control here and leave - rts - -;-------------------------------- - -LargeLiftUp: - jsr PlatLiftUp ;execute code for platforms going up - jmp LargeLiftBBox ;overwrite bounding box for large platforms - -LargeLiftDown: - jsr PlatLiftDown ;execute code for platforms going down - -LargeLiftBBox: - jmp SPBBox ;jump to overwrite bounding box size control - -;-------------------------------- - -PlatLiftUp: - lda #$10 ;set movement amount here - sta Enemy_Y_MoveForce,x - lda #$ff ;set moving speed for platforms going up - sta Enemy_Y_Speed,x - jmp CommonSmallLift ;skip ahead to part we should be executing - -;-------------------------------- - -PlatLiftDown: - lda #$f0 ;set movement amount here - sta Enemy_Y_MoveForce,x - lda #$00 ;set moving speed for platforms going down - sta Enemy_Y_Speed,x - -;-------------------------------- - -CommonSmallLift: - ldy #$01 - jsr PosPlatform ;do a sub to add 12 pixels due to preset value - lda #$04 - sta Enemy_BoundBoxCtrl,x ;set bounding box control for small platforms - rts - -;-------------------------------- - -PlatPosDataLow: - .db $08,$0c,$f8 - -PlatPosDataHigh: - .db $00,$00,$ff - -PosPlatform: - lda Enemy_X_Position,x ;get horizontal coordinate - clc - adc PlatPosDataLow,y ;add or subtract pixels depending on offset - sta Enemy_X_Position,x ;store as new horizontal coordinate - lda Enemy_PageLoc,x - adc PlatPosDataHigh,y ;add or subtract page location depending on offset - sta Enemy_PageLoc,x ;store as new page location - rts ;and go back - -;-------------------------------- - -EndOfEnemyInitCode: - rts - -;------------------------------------------------------------------------------------- - -RunEnemyObjectsCore: - ldx ObjectOffset ;get offset for enemy object buffer - lda #$00 ;load value 0 for jump engine by default - ldy Enemy_ID,x - cpy #$15 ;if enemy object < $15, use default value - bcc JmpEO - tya ;otherwise subtract $14 from the value and use - sbc #$14 ;as value for jump engine -JmpEO: jsr JumpEngine - - .dw RunNormalEnemies ;for objects $00-$14 - - .dw RunBowserFlame ;for objects $15-$1f - .dw RunFireworks - .dw NoRunCode - .dw NoRunCode - .dw NoRunCode - .dw NoRunCode - .dw RunFirebarObj - .dw RunFirebarObj - .dw RunFirebarObj - .dw RunFirebarObj - .dw RunFirebarObj - - .dw RunFirebarObj ;for objects $20-$2f - .dw RunFirebarObj - .dw RunFirebarObj - .dw NoRunCode - .dw RunLargePlatform - .dw RunLargePlatform - .dw RunLargePlatform - .dw RunLargePlatform - .dw RunLargePlatform - .dw RunLargePlatform - .dw RunLargePlatform - .dw RunSmallPlatform - .dw RunSmallPlatform - .dw RunBowser - .dw PowerUpObjHandler - .dw VineObjectHandler - - .dw NoRunCode ;for objects $30-$35 - .dw RunStarFlagObj - .dw JumpspringHandler - .dw NoRunCode - .dw WarpZoneObject - .dw RunRetainerObj - -;-------------------------------- - -NoRunCode: - rts - -;-------------------------------- - -RunRetainerObj: - jsr GetEnemyOffscreenBits - jsr RelativeEnemyPosition - jmp EnemyGfxHandler - -;-------------------------------- - -RunNormalEnemies: - lda #$00 ;init sprite attributes - sta Enemy_SprAttrib,x - jsr GetEnemyOffscreenBits - jsr RelativeEnemyPosition - jsr EnemyGfxHandler - jsr GetEnemyBoundBox - jsr EnemyToBGCollisionDet - jsr EnemiesCollision - jsr PlayerEnemyCollision - ldy TimerControl ;if master timer control set, skip to last routine - bne SkipMove - jsr EnemyMovementSubs -SkipMove: jmp OffscreenBoundsCheck - -EnemyMovementSubs: - lda Enemy_ID,x - jsr JumpEngine - - .dw MoveNormalEnemy ;only objects $00-$14 use this table - .dw MoveNormalEnemy - .dw MoveNormalEnemy - .dw MoveNormalEnemy - .dw MoveNormalEnemy - .dw ProcHammerBro - .dw MoveNormalEnemy - .dw MoveBloober - .dw MoveBulletBill - .dw NoMoveCode - .dw MoveSwimmingCheepCheep - .dw MoveSwimmingCheepCheep - .dw MovePodoboo - .dw MovePiranhaPlant - .dw MoveJumpingEnemy - .dw ProcMoveRedPTroopa - .dw MoveFlyGreenPTroopa - .dw MoveLakitu - .dw MoveNormalEnemy - .dw NoMoveCode ;dummy - .dw MoveFlyingCheepCheep - -;-------------------------------- - -NoMoveCode: - rts - -;-------------------------------- - -RunBowserFlame: - jsr ProcBowserFlame - jsr GetEnemyOffscreenBits - jsr RelativeEnemyPosition - jsr GetEnemyBoundBox - jsr PlayerEnemyCollision - jmp OffscreenBoundsCheck - -;-------------------------------- - -RunFirebarObj: - jsr ProcFirebar - jmp OffscreenBoundsCheck - -;-------------------------------- - -RunSmallPlatform: - jsr GetEnemyOffscreenBits - jsr RelativeEnemyPosition - jsr SmallPlatformBoundBox - jsr SmallPlatformCollision - jsr RelativeEnemyPosition - jsr DrawSmallPlatform - jsr MoveSmallPlatform - jmp OffscreenBoundsCheck - -;-------------------------------- - -RunLargePlatform: - jsr GetEnemyOffscreenBits - jsr RelativeEnemyPosition - jsr LargePlatformBoundBox - jsr LargePlatformCollision - lda TimerControl ;if master timer control set, - bne SkipPT ;skip subroutine tree - jsr LargePlatformSubroutines -SkipPT: jsr RelativeEnemyPosition - jsr DrawLargePlatform - jmp OffscreenBoundsCheck - -;-------------------------------- - -LargePlatformSubroutines: - lda Enemy_ID,x ;subtract $24 to get proper offset for jump table - sec - sbc #$24 - jsr JumpEngine - - .dw BalancePlatform ;table used by objects $24-$2a - .dw YMovingPlatform - .dw MoveLargeLiftPlat - .dw MoveLargeLiftPlat - .dw XMovingPlatform - .dw DropPlatform - .dw RightPlatform - -;------------------------------------------------------------------------------------- - -EraseEnemyObject: - lda #$00 ;clear all enemy object variables - sta Enemy_Flag,x - sta Enemy_ID,x - sta Enemy_State,x - sta FloateyNum_Control,x - sta EnemyIntervalTimer,x - sta ShellChainCounter,x - sta Enemy_SprAttrib,x - sta EnemyFrameTimer,x - rts - -;------------------------------------------------------------------------------------- - -MovePodoboo: - lda EnemyIntervalTimer,x ;check enemy timer - bne PdbM ;branch to move enemy if not expired - jsr InitPodoboo ;otherwise set up podoboo again - lda PseudoRandomBitReg+1,x ;get part of LSFR - ora #%10000000 ;set d7 - sta Enemy_Y_MoveForce,x ;store as movement force - and #%00001111 ;mask out high nybble - ora #$06 ;set for at least six intervals - sta EnemyIntervalTimer,x ;store as new enemy timer - lda #$f9 - sta Enemy_Y_Speed,x ;set vertical speed to move podoboo upwards -PdbM: jmp MoveJ_EnemyVertically ;branch to impose gravity on podoboo - -;-------------------------------- -;$00 - used in HammerBroJumpCode as bitmask - -HammerThrowTmrData: - .db $30, $1c - -XSpeedAdderData: - .db $00, $e8, $00, $18 - -RevivedXSpeed: - .db $08, $f8, $0c, $f4 - -ProcHammerBro: - lda Enemy_State,x ;check hammer bro's enemy state for d5 set - and #%00100000 - beq ChkJH ;if not set, go ahead with code - jmp MoveDefeatedEnemy ;otherwise jump to something else -ChkJH: lda HammerBroJumpTimer,x ;check jump timer - beq HammerBroJumpCode ;if expired, branch to jump - dec HammerBroJumpTimer,x ;otherwise decrement jump timer - lda Enemy_OffscreenBits - and #%00001100 ;check offscreen bits - bne MoveHammerBroXDir ;if hammer bro a little offscreen, skip to movement code - lda HammerThrowingTimer,x ;check hammer throwing timer - bne DecHT ;if not expired, skip ahead, do not throw hammer - ldy SecondaryHardMode ;otherwise get secondary hard mode flag - lda HammerThrowTmrData,y ;get timer data using flag as offset - sta HammerThrowingTimer,x ;set as new timer - jsr SpawnHammerObj ;do a sub here to spawn hammer object - bcc DecHT ;if carry clear, hammer not spawned, skip to decrement timer - lda Enemy_State,x - ora #%00001000 ;set d3 in enemy state for hammer throw - sta Enemy_State,x - jmp MoveHammerBroXDir ;jump to move hammer bro -DecHT: dec HammerThrowingTimer,x ;decrement timer - jmp MoveHammerBroXDir ;jump to move hammer bro - -HammerBroJumpLData: - .db $20, $37 - -HammerBroJumpCode: - lda Enemy_State,x ;get hammer bro's enemy state - and #%00000111 ;mask out all but 3 LSB - cmp #$01 ;check for d0 set (for jumping) - beq MoveHammerBroXDir ;if set, branch ahead to moving code - lda #$00 ;load default value here - sta $00 ;save into temp variable for now - ldy #$fa ;set default vertical speed - lda Enemy_Y_Position,x ;check hammer bro's vertical coordinate - bmi SetHJ ;if on the bottom half of the screen, use current speed - ldy #$fd ;otherwise set alternate vertical speed - cmp #$70 ;check to see if hammer bro is above the middle of screen - inc $00 ;increment preset value to $01 - bcc SetHJ ;if above the middle of the screen, use current speed and $01 - dec $00 ;otherwise return value to $00 - lda PseudoRandomBitReg+1,x ;get part of LSFR, mask out all but LSB - and #$01 - bne SetHJ ;if d0 of LSFR set, branch and use current speed and $00 - ldy #$fa ;otherwise reset to default vertical speed -SetHJ: sty Enemy_Y_Speed,x ;set vertical speed for jumping - lda Enemy_State,x ;set d0 in enemy state for jumping - ora #$01 - sta Enemy_State,x - lda $00 ;load preset value here to use as bitmask - and PseudoRandomBitReg+2,x ;and do bit-wise comparison with part of LSFR - tay ;then use as offset - lda SecondaryHardMode ;check secondary hard mode flag - bne HJump - tay ;if secondary hard mode flag clear, set offset to 0 -HJump: lda HammerBroJumpLData,y ;get jump length timer data using offset from before - sta EnemyFrameTimer,x ;save in enemy timer - lda PseudoRandomBitReg+1,x - ora #%11000000 ;get contents of part of LSFR, set d7 and d6, then - sta HammerBroJumpTimer,x ;store in jump timer - -MoveHammerBroXDir: - ldy #$fc ;move hammer bro a little to the left - lda FrameCounter - and #%01000000 ;change hammer bro's direction every 64 frames - bne Shimmy - ldy #$04 ;if d6 set in counter, move him a little to the right -Shimmy: sty Enemy_X_Speed,x ;store horizontal speed - ldy #$01 ;set to face right by default - jsr PlayerEnemyDiff ;get horizontal difference between player and hammer bro - bmi SetShim ;if enemy to the left of player, skip this part - iny ;set to face left - lda EnemyIntervalTimer,x ;check walking timer - bne SetShim ;if not yet expired, skip to set moving direction - lda #$f8 - sta Enemy_X_Speed,x ;otherwise, make the hammer bro walk left towards player -SetShim: sty Enemy_MovingDir,x ;set moving direction - -MoveNormalEnemy: - ldy #$00 ;init Y to leave horizontal movement as-is - lda Enemy_State,x - and #%01000000 ;check enemy state for d6 set, if set skip - bne FallE ;to move enemy vertically, then horizontally if necessary - lda Enemy_State,x - asl ;check enemy state for d7 set - bcs SteadM ;if set, branch to move enemy horizontally - lda Enemy_State,x - and #%00100000 ;check enemy state for d5 set - bne MoveDefeatedEnemy ;if set, branch to move defeated enemy object - lda Enemy_State,x - and #%00000111 ;check d2-d0 of enemy state for any set bits - beq SteadM ;if enemy in normal state, branch to move enemy horizontally - cmp #$05 - beq FallE ;if enemy in state used by spiny's egg, go ahead here - cmp #$03 - bcs ReviveStunned ;if enemy in states $03 or $04, skip ahead to yet another part -FallE: jsr MoveD_EnemyVertically ;do a sub here to move enemy downwards - ldy #$00 - lda Enemy_State,x ;check for enemy state $02 - cmp #$02 - beq MEHor ;if found, branch to move enemy horizontally - and #%01000000 ;check for d6 set - beq SteadM ;if not set, branch to something else - lda Enemy_ID,x - cmp #PowerUpObject ;check for power-up object - beq SteadM - bne SlowM ;if any other object where d6 set, jump to set Y -MEHor: jmp MoveEnemyHorizontally ;jump here to move enemy horizontally for <> $2e and d6 set - -SlowM: ldy #$01 ;if branched here, increment Y to slow horizontal movement -SteadM: lda Enemy_X_Speed,x ;get current horizontal speed - pha ;save to stack - bpl AddHS ;if not moving or moving right, skip, leave Y alone - iny - iny ;otherwise increment Y to next data -AddHS: clc - adc XSpeedAdderData,y ;add value here to slow enemy down if necessary - sta Enemy_X_Speed,x ;save as horizontal speed temporarily - jsr MoveEnemyHorizontally ;then do a sub to move horizontally - pla - sta Enemy_X_Speed,x ;get old horizontal speed from stack and return to - rts ;original memory location, then leave - -ReviveStunned: - lda EnemyIntervalTimer,x ;if enemy timer not expired yet, - bne ChkKillGoomba ;skip ahead to something else - sta Enemy_State,x ;otherwise initialize enemy state to normal - lda FrameCounter - and #$01 ;get d0 of frame counter - tay ;use as Y and increment for movement direction - iny - sty Enemy_MovingDir,x ;store as pseudorandom movement direction - dey ;decrement for use as pointer - lda PrimaryHardMode ;check primary hard mode flag - beq SetRSpd ;if not set, use pointer as-is - iny - iny ;otherwise increment 2 bytes to next data -SetRSpd: lda RevivedXSpeed,y ;load and store new horizontal speed - sta Enemy_X_Speed,x ;and leave - rts - -MoveDefeatedEnemy: - jsr MoveD_EnemyVertically ;execute sub to move defeated enemy downwards - jmp MoveEnemyHorizontally ;now move defeated enemy horizontally - -ChkKillGoomba: - cmp #$0e ;check to see if enemy timer has reached - bne NKGmba ;a certain point, and branch to leave if not - lda Enemy_ID,x - cmp #Goomba ;check for goomba object - bne NKGmba ;branch if not found - jsr EraseEnemyObject ;otherwise, kill this goomba object -NKGmba: rts ;leave! - -;-------------------------------- - -MoveJumpingEnemy: - jsr MoveJ_EnemyVertically ;do a sub to impose gravity on green paratroopa - jmp MoveEnemyHorizontally ;jump to move enemy horizontally - -;-------------------------------- - -ProcMoveRedPTroopa: - lda Enemy_Y_Speed,x - ora Enemy_Y_MoveForce,x ;check for any vertical force or speed - bne MoveRedPTUpOrDown ;branch if any found - sta Enemy_YMF_Dummy,x ;initialize something here - lda Enemy_Y_Position,x ;check current vs. original vertical coordinate - cmp RedPTroopaOrigXPos,x - bcs MoveRedPTUpOrDown ;if current => original, skip ahead to more code - lda FrameCounter ;get frame counter - and #%00000111 ;mask out all but 3 LSB - bne NoIncPT ;if any bits set, branch to leave - inc Enemy_Y_Position,x ;otherwise increment red paratroopa's vertical position -NoIncPT: rts ;leave - -MoveRedPTUpOrDown: - lda Enemy_Y_Position,x ;check current vs. central vertical coordinate - cmp RedPTroopaCenterYPos,x - bcc MovPTDwn ;if current < central, jump to move downwards - jmp MoveRedPTroopaUp ;otherwise jump to move upwards -MovPTDwn: jmp MoveRedPTroopaDown ;move downwards - -;-------------------------------- -;$00 - used to store adder for movement, also used as adder for platform -;$01 - used to store maximum value for secondary counter - -MoveFlyGreenPTroopa: - jsr XMoveCntr_GreenPTroopa ;do sub to increment primary and secondary counters - jsr MoveWithXMCntrs ;do sub to move green paratroopa accordingly, and horizontally - ldy #$01 ;set Y to move green paratroopa down - lda FrameCounter - and #%00000011 ;check frame counter 2 LSB for any bits set - bne NoMGPT ;branch to leave if set to move up/down every fourth frame - lda FrameCounter - and #%01000000 ;check frame counter for d6 set - bne YSway ;branch to move green paratroopa down if set - ldy #$ff ;otherwise set Y to move green paratroopa up -YSway: sty $00 ;store adder here - lda Enemy_Y_Position,x - clc ;add or subtract from vertical position - adc $00 ;to give green paratroopa a wavy flight - sta Enemy_Y_Position,x -NoMGPT: rts ;leave! - -XMoveCntr_GreenPTroopa: - lda #$13 ;load preset maximum value for secondary counter - -XMoveCntr_Platform: - sta $01 ;store value here - lda FrameCounter - and #%00000011 ;branch to leave if not on - bne NoIncXM ;every fourth frame - ldy XMoveSecondaryCounter,x ;get secondary counter - lda XMovePrimaryCounter,x ;get primary counter - lsr - bcs DecSeXM ;if d0 of primary counter set, branch elsewhere - cpy $01 ;compare secondary counter to preset maximum value - beq IncPXM ;if equal, branch ahead of this part - inc XMoveSecondaryCounter,x ;increment secondary counter and leave -NoIncXM: rts -IncPXM: inc XMovePrimaryCounter,x ;increment primary counter and leave - rts -DecSeXM: tya ;put secondary counter in A - beq IncPXM ;if secondary counter at zero, branch back - dec XMoveSecondaryCounter,x ;otherwise decrement secondary counter and leave - rts - -MoveWithXMCntrs: - lda XMoveSecondaryCounter,x ;save secondary counter to stack - pha - ldy #$01 ;set value here by default - lda XMovePrimaryCounter,x - and #%00000010 ;if d1 of primary counter is - bne XMRight ;set, branch ahead of this part here - lda XMoveSecondaryCounter,x - eor #$ff ;otherwise change secondary - clc ;counter to two's compliment - adc #$01 - sta XMoveSecondaryCounter,x - ldy #$02 ;load alternate value here -XMRight: sty Enemy_MovingDir,x ;store as moving direction - jsr MoveEnemyHorizontally - sta $00 ;save value obtained from sub here - pla ;get secondary counter from stack - sta XMoveSecondaryCounter,x ;and return to original place - rts - -;-------------------------------- - -BlooberBitmasks: - .db %00111111, %00000011 - -MoveBloober: - lda Enemy_State,x - and #%00100000 ;check enemy state for d5 set - bne MoveDefeatedBloober ;branch if set to move defeated bloober - ldy SecondaryHardMode ;use secondary hard mode flag as offset - lda PseudoRandomBitReg+1,x ;get LSFR - and BlooberBitmasks,y ;mask out bits in LSFR using bitmask loaded with offset - bne BlooberSwim ;if any bits set, skip ahead to make swim - txa - lsr ;check to see if on second or fourth slot (1 or 3) - bcc FBLeft ;if not, branch to figure out moving direction - ldy Player_MovingDir ;otherwise, load player's moving direction and - bcs SBMDir ;do an unconditional branch to set -FBLeft: ldy #$02 ;set left moving direction by default - jsr PlayerEnemyDiff ;get horizontal difference between player and bloober - bpl SBMDir ;if enemy to the right of player, keep left - dey ;otherwise decrement to set right moving direction -SBMDir: sty Enemy_MovingDir,x ;set moving direction of bloober, then continue on here - -BlooberSwim: - jsr ProcSwimmingB ;execute sub to make bloober swim characteristically - lda Enemy_Y_Position,x ;get vertical coordinate - sec - sbc Enemy_Y_MoveForce,x ;subtract movement force - cmp #$20 ;check to see if position is above edge of status bar - bcc SwimX ;if so, don't do it - sta Enemy_Y_Position,x ;otherwise, set new vertical position, make bloober swim -SwimX: ldy Enemy_MovingDir,x ;check moving direction - dey - bne LeftSwim ;if moving to the left, branch to second part - lda Enemy_X_Position,x - clc ;add movement speed to horizontal coordinate - adc BlooperMoveSpeed,x - sta Enemy_X_Position,x ;store result as new horizontal coordinate - lda Enemy_PageLoc,x - adc #$00 ;add carry to page location - sta Enemy_PageLoc,x ;store as new page location and leave - rts - -LeftSwim: - lda Enemy_X_Position,x - sec ;subtract movement speed from horizontal coordinate - sbc BlooperMoveSpeed,x - sta Enemy_X_Position,x ;store result as new horizontal coordinate - lda Enemy_PageLoc,x - sbc #$00 ;subtract borrow from page location - sta Enemy_PageLoc,x ;store as new page location and leave - rts - -MoveDefeatedBloober: - jmp MoveEnemySlowVert ;jump to move defeated bloober downwards - -ProcSwimmingB: - lda BlooperMoveCounter,x ;get enemy's movement counter - and #%00000010 ;check for d1 set - bne ChkForFloatdown ;branch if set - lda FrameCounter - and #%00000111 ;get 3 LSB of frame counter - pha ;and save it to the stack - lda BlooperMoveCounter,x ;get enemy's movement counter - lsr ;check for d0 set - bcs SlowSwim ;branch if set - pla ;pull 3 LSB of frame counter from the stack - bne BSwimE ;branch to leave, execute code only every eighth frame - lda Enemy_Y_MoveForce,x - clc ;add to movement force to speed up swim - adc #$01 - sta Enemy_Y_MoveForce,x ;set movement force - sta BlooperMoveSpeed,x ;set as movement speed - cmp #$02 - bne BSwimE ;if certain horizontal speed, branch to leave - inc BlooperMoveCounter,x ;otherwise increment movement counter -BSwimE: rts - -SlowSwim: - pla ;pull 3 LSB of frame counter from the stack - bne NoSSw ;branch to leave, execute code only every eighth frame - lda Enemy_Y_MoveForce,x - sec ;subtract from movement force to slow swim - sbc #$01 - sta Enemy_Y_MoveForce,x ;set movement force - sta BlooperMoveSpeed,x ;set as movement speed - bne NoSSw ;if any speed, branch to leave - inc BlooperMoveCounter,x ;otherwise increment movement counter - lda #$02 - sta EnemyIntervalTimer,x ;set enemy's timer -NoSSw: rts ;leave - -ChkForFloatdown: - lda EnemyIntervalTimer,x ;get enemy timer - beq ChkNearPlayer ;branch if expired - -Floatdown: - lda FrameCounter ;get frame counter - lsr ;check for d0 set - bcs NoFD ;branch to leave on every other frame - inc Enemy_Y_Position,x ;otherwise increment vertical coordinate -NoFD: rts ;leave - -ChkNearPlayer: - lda Enemy_Y_Position,x ;get vertical coordinate - adc #$10 ;add sixteen pixels - cmp Player_Y_Position ;compare result with player's vertical coordinate - bcc Floatdown ;if modified vertical less than player's, branch - lda #$00 - sta BlooperMoveCounter,x ;otherwise nullify movement counter - rts - -;-------------------------------- - -MoveBulletBill: - lda Enemy_State,x ;check bullet bill's enemy object state for d5 set - and #%00100000 - beq NotDefB ;if not set, continue with movement code - jmp MoveJ_EnemyVertically ;otherwise jump to move defeated bullet bill downwards -NotDefB: lda #$e8 ;set bullet bill's horizontal speed - sta Enemy_X_Speed,x ;and move it accordingly (note: this bullet bill - jmp MoveEnemyHorizontally ;object occurs in frenzy object $17, not from cannons) - -;-------------------------------- -;$02 - used to hold preset values -;$03 - used to hold enemy state - -SwimCCXMoveData: - .db $40, $80 - .db $04, $04 ;residual data, not used - -MoveSwimmingCheepCheep: - lda Enemy_State,x ;check cheep-cheep's enemy object state - and #%00100000 ;for d5 set - beq CCSwim ;if not set, continue with movement code - jmp MoveEnemySlowVert ;otherwise jump to move defeated cheep-cheep downwards -CCSwim: sta $03 ;save enemy state in $03 - lda Enemy_ID,x ;get enemy identifier - sec - sbc #$0a ;subtract ten for cheep-cheep identifiers - tay ;use as offset - lda SwimCCXMoveData,y ;load value here - sta $02 - lda Enemy_X_MoveForce,x ;load horizontal force - sec - sbc $02 ;subtract preset value from horizontal force - sta Enemy_X_MoveForce,x ;store as new horizontal force - lda Enemy_X_Position,x ;get horizontal coordinate - sbc #$00 ;subtract borrow (thus moving it slowly) - sta Enemy_X_Position,x ;and save as new horizontal coordinate - lda Enemy_PageLoc,x - sbc #$00 ;subtract borrow again, this time from the - sta Enemy_PageLoc,x ;page location, then save - lda #$20 - sta $02 ;save new value here - cpx #$02 ;check enemy object offset - bcc ExSwCC ;if in first or second slot, branch to leave - lda CheepCheepMoveMFlag,x ;check movement flag - cmp #$10 ;if movement speed set to $00, - bcc CCSwimUpwards ;branch to move upwards - lda Enemy_YMF_Dummy,x - clc - adc $02 ;add preset value to dummy variable to get carry - sta Enemy_YMF_Dummy,x ;and save dummy - lda Enemy_Y_Position,x ;get vertical coordinate - adc $03 ;add carry to it plus enemy state to slowly move it downwards - sta Enemy_Y_Position,x ;save as new vertical coordinate - lda Enemy_Y_HighPos,x - adc #$00 ;add carry to page location and - jmp ChkSwimYPos ;jump to end of movement code - -CCSwimUpwards: - lda Enemy_YMF_Dummy,x - sec - sbc $02 ;subtract preset value to dummy variable to get borrow - sta Enemy_YMF_Dummy,x ;and save dummy - lda Enemy_Y_Position,x ;get vertical coordinate - sbc $03 ;subtract borrow to it plus enemy state to slowly move it upwards - sta Enemy_Y_Position,x ;save as new vertical coordinate - lda Enemy_Y_HighPos,x - sbc #$00 ;subtract borrow from page location - -ChkSwimYPos: - sta Enemy_Y_HighPos,x ;save new page location here - ldy #$00 ;load movement speed to upwards by default - lda Enemy_Y_Position,x ;get vertical coordinate - sec - sbc CheepCheepOrigYPos,x ;subtract original coordinate from current - bpl YPDiff ;if result positive, skip to next part - ldy #$10 ;otherwise load movement speed to downwards - eor #$ff - clc ;get two's compliment of result - adc #$01 ;to obtain total difference of original vs. current -YPDiff: cmp #$0f ;if difference between original vs. current vertical - bcc ExSwCC ;coordinates < 15 pixels, leave movement speed alone - tya - sta CheepCheepMoveMFlag,x ;otherwise change movement speed -ExSwCC: rts ;leave - -;-------------------------------- -;$00 - used as counter for firebar parts -;$01 - used for oscillated high byte of spin state or to hold horizontal adder -;$02 - used for oscillated high byte of spin state or to hold vertical adder -;$03 - used for mirror data -;$04 - used to store player's sprite 1 X coordinate -;$05 - used to evaluate mirror data -;$06 - used to store either screen X coordinate or sprite data offset -;$07 - used to store screen Y coordinate -;$ed - used to hold maximum length of firebar -;$ef - used to hold high byte of spinstate - -;horizontal adder is at first byte + high byte of spinstate, -;vertical adder is same + 8 bytes, two's compliment -;if greater than $08 for proper oscillation -FirebarPosLookupTbl: - .db $00, $01, $03, $04, $05, $06, $07, $07, $08 - .db $00, $03, $06, $09, $0b, $0d, $0e, $0f, $10 - .db $00, $04, $09, $0d, $10, $13, $16, $17, $18 - .db $00, $06, $0c, $12, $16, $1a, $1d, $1f, $20 - .db $00, $07, $0f, $16, $1c, $21, $25, $27, $28 - .db $00, $09, $12, $1b, $21, $27, $2c, $2f, $30 - .db $00, $0b, $15, $1f, $27, $2e, $33, $37, $38 - .db $00, $0c, $18, $24, $2d, $35, $3b, $3e, $40 - .db $00, $0e, $1b, $28, $32, $3b, $42, $46, $48 - .db $00, $0f, $1f, $2d, $38, $42, $4a, $4e, $50 - .db $00, $11, $22, $31, $3e, $49, $51, $56, $58 - -FirebarMirrorData: - .db $01, $03, $02, $00 - -FirebarTblOffsets: - .db $00, $09, $12, $1b, $24, $2d - .db $36, $3f, $48, $51, $5a, $63 - -FirebarYPos: - .db $0c, $18 - -ProcFirebar: - jsr GetEnemyOffscreenBits ;get offscreen information - lda Enemy_OffscreenBits ;check for d3 set - and #%00001000 ;if so, branch to leave - bne SkipFBar - lda TimerControl ;if master timer control set, branch - bne SusFbar ;ahead of this part - lda FirebarSpinSpeed,x ;load spinning speed of firebar - jsr FirebarSpin ;modify current spinstate - and #%00011111 ;mask out all but 5 LSB - sta FirebarSpinState_High,x ;and store as new high byte of spinstate -SusFbar: lda FirebarSpinState_High,x ;get high byte of spinstate - ldy Enemy_ID,x ;check enemy identifier - cpy #$1f - bcc SetupGFB ;if < $1f (long firebar), branch - cmp #$08 ;check high byte of spinstate - beq SkpFSte ;if eight, branch to change - cmp #$18 - bne SetupGFB ;if not at twenty-four branch to not change -SkpFSte: clc - adc #$01 ;add one to spinning thing to avoid horizontal state - sta FirebarSpinState_High,x -SetupGFB: sta $ef ;save high byte of spinning thing, modified or otherwise - jsr RelativeEnemyPosition ;get relative coordinates to screen - jsr GetFirebarPosition ;do a sub here (residual, too early to be used now) - ldy Enemy_SprDataOffset,x ;get OAM data offset - lda Enemy_Rel_YPos ;get relative vertical coordinate - sta Sprite_Y_Position,y ;store as Y in OAM data - sta $07 ;also save here - lda Enemy_Rel_XPos ;get relative horizontal coordinate - sta Sprite_X_Position,y ;store as X in OAM data - sta $06 ;also save here - lda #$01 - sta $00 ;set $01 value here (not necessary) - jsr FirebarCollision ;draw fireball part and do collision detection - ldy #$05 ;load value for short firebars by default - lda Enemy_ID,x - cmp #$1f ;are we doing a long firebar? - bcc SetMFbar ;no, branch then - ldy #$0b ;otherwise load value for long firebars -SetMFbar: sty $ed ;store maximum value for length of firebars - lda #$00 - sta $00 ;initialize counter here -DrawFbar: lda $ef ;load high byte of spinstate - jsr GetFirebarPosition ;get fireball position data depending on firebar part - jsr DrawFirebar_Collision ;position it properly, draw it and do collision detection - lda $00 ;check which firebar part - cmp #$04 - bne NextFbar - ldy DuplicateObj_Offset ;if we arrive at fifth firebar part, - lda Enemy_SprDataOffset,y ;get offset from long firebar and load OAM data offset - sta $06 ;using long firebar offset, then store as new one here -NextFbar: inc $00 ;move onto the next firebar part - lda $00 - cmp $ed ;if we end up at the maximum part, go on and leave - bcc DrawFbar ;otherwise go back and do another -SkipFBar: rts - -DrawFirebar_Collision: - lda $03 ;store mirror data elsewhere - sta $05 - ldy $06 ;load OAM data offset for firebar - lda $01 ;load horizontal adder we got from position loader - lsr $05 ;shift LSB of mirror data - bcs AddHA ;if carry was set, skip this part - eor #$ff - adc #$01 ;otherwise get two's compliment of horizontal adder -AddHA: clc ;add horizontal coordinate relative to screen to - adc Enemy_Rel_XPos ;horizontal adder, modified or otherwise - sta Sprite_X_Position,y ;store as X coordinate here - sta $06 ;store here for now, note offset is saved in Y still - cmp Enemy_Rel_XPos ;compare X coordinate of sprite to original X of firebar - bcs SubtR1 ;if sprite coordinate => original coordinate, branch - lda Enemy_Rel_XPos - sec ;otherwise subtract sprite X from the - sbc $06 ;original one and skip this part - jmp ChkFOfs -SubtR1: sec ;subtract original X from the - sbc Enemy_Rel_XPos ;current sprite X -ChkFOfs: cmp #$59 ;if difference of coordinates within a certain range, - bcc VAHandl ;continue by handling vertical adder - lda #$f8 ;otherwise, load offscreen Y coordinate - bne SetVFbr ;and unconditionally branch to move sprite offscreen -VAHandl: lda Enemy_Rel_YPos ;if vertical relative coordinate offscreen, - cmp #$f8 ;skip ahead of this part and write into sprite Y coordinate - beq SetVFbr - lda $02 ;load vertical adder we got from position loader - lsr $05 ;shift LSB of mirror data one more time - bcs AddVA ;if carry was set, skip this part - eor #$ff - adc #$01 ;otherwise get two's compliment of second part -AddVA: clc ;add vertical coordinate relative to screen to - adc Enemy_Rel_YPos ;the second data, modified or otherwise -SetVFbr: sta Sprite_Y_Position,y ;store as Y coordinate here - sta $07 ;also store here for now - -FirebarCollision: - jsr DrawFirebar ;run sub here to draw current tile of firebar - tya ;return OAM data offset and save - pha ;to the stack for now - lda StarInvincibleTimer ;if star mario invincibility timer - ora TimerControl ;or master timer controls set - bne NoColFB ;then skip all of this - sta $05 ;otherwise initialize counter - ldy Player_Y_HighPos - dey ;if player's vertical high byte offscreen, - bne NoColFB ;skip all of this - ldy Player_Y_Position ;get player's vertical position - lda PlayerSize ;get player's size - bne AdjSm ;if player small, branch to alter variables - lda CrouchingFlag - beq BigJp ;if player big and not crouching, jump ahead -AdjSm: inc $05 ;if small or big but crouching, execute this part - inc $05 ;first increment our counter twice (setting $02 as flag) - tya - clc ;then add 24 pixels to the player's - adc #$18 ;vertical coordinate - tay -BigJp: tya ;get vertical coordinate, altered or otherwise, from Y -FBCLoop: sec ;subtract vertical position of firebar - sbc $07 ;from the vertical coordinate of the player - bpl ChkVFBD ;if player lower on the screen than firebar, - eor #$ff ;skip two's compliment part - clc ;otherwise get two's compliment - adc #$01 -ChkVFBD: cmp #$08 ;if difference => 8 pixels, skip ahead of this part - bcs Chk2Ofs - lda $06 ;if firebar on far right on the screen, skip this, - cmp #$f0 ;because, really, what's the point? - bcs Chk2Ofs - lda Sprite_X_Position+4 ;get OAM X coordinate for sprite #1 - clc - adc #$04 ;add four pixels - sta $04 ;store here - sec ;subtract horizontal coordinate of firebar - sbc $06 ;from the X coordinate of player's sprite 1 - bpl ChkFBCl ;if modded X coordinate to the right of firebar - eor #$ff ;skip two's compliment part - clc ;otherwise get two's compliment - adc #$01 -ChkFBCl: cmp #$08 ;if difference < 8 pixels, collision, thus branch - bcc ChgSDir ;to process -Chk2Ofs: lda $05 ;if value of $02 was set earlier for whatever reason, - cmp #$02 ;branch to increment OAM offset and leave, no collision - beq NoColFB - ldy $05 ;otherwise get temp here and use as offset - lda Player_Y_Position - clc - adc FirebarYPos,y ;add value loaded with offset to player's vertical coordinate - inc $05 ;then increment temp and jump back - jmp FBCLoop -ChgSDir: ldx #$01 ;set movement direction by default - lda $04 ;if OAM X coordinate of player's sprite 1 - cmp $06 ;is greater than horizontal coordinate of firebar - bcs SetSDir ;then do not alter movement direction - inx ;otherwise increment it -SetSDir: stx Enemy_MovingDir ;store movement direction here - ldx #$00 - lda $00 ;save value written to $00 to stack - pha - jsr InjurePlayer ;perform sub to hurt or kill player - pla - sta $00 ;get value of $00 from stack -NoColFB: pla ;get OAM data offset - clc ;add four to it and save - adc #$04 - sta $06 - ldx ObjectOffset ;get enemy object buffer offset and leave - rts - -GetFirebarPosition: - pha ;save high byte of spinstate to the stack - and #%00001111 ;mask out low nybble - cmp #$09 - bcc GetHAdder ;if lower than $09, branch ahead - eor #%00001111 ;otherwise get two's compliment to oscillate - clc - adc #$01 -GetHAdder: sta $01 ;store result, modified or not, here - ldy $00 ;load number of firebar ball where we're at - lda FirebarTblOffsets,y ;load offset to firebar position data - clc - adc $01 ;add oscillated high byte of spinstate - tay ;to offset here and use as new offset - lda FirebarPosLookupTbl,y ;get data here and store as horizontal adder - sta $01 - pla ;pull whatever was in A from the stack - pha ;save it again because we still need it - clc - adc #$08 ;add eight this time, to get vertical adder - and #%00001111 ;mask out high nybble - cmp #$09 ;if lower than $09, branch ahead - bcc GetVAdder - eor #%00001111 ;otherwise get two's compliment - clc - adc #$01 -GetVAdder: sta $02 ;store result here - ldy $00 - lda FirebarTblOffsets,y ;load offset to firebar position data again - clc - adc $02 ;this time add value in $02 to offset here and use as offset - tay - lda FirebarPosLookupTbl,y ;get data here and store as vertica adder - sta $02 - pla ;pull out whatever was in A one last time - lsr ;divide by eight or shift three to the right - lsr - lsr - tay ;use as offset - lda FirebarMirrorData,y ;load mirroring data here - sta $03 ;store - rts - -;-------------------------------- - -PRandomSubtracter: - .db $f8, $a0, $70, $bd, $00 - -FlyCCBPriority: - .db $20, $20, $20, $00, $00 - -MoveFlyingCheepCheep: - lda Enemy_State,x ;check cheep-cheep's enemy state - and #%00100000 ;for d5 set - beq FlyCC ;branch to continue code if not set - lda #$00 - sta Enemy_SprAttrib,x ;otherwise clear sprite attributes - jmp MoveJ_EnemyVertically ;and jump to move defeated cheep-cheep downwards -FlyCC: jsr MoveEnemyHorizontally ;move cheep-cheep horizontally based on speed and force - ldy #$0d ;set vertical movement amount - lda #$05 ;set maximum speed - jsr SetXMoveAmt ;branch to impose gravity on flying cheep-cheep - lda Enemy_Y_MoveForce,x - lsr ;get vertical movement force and - lsr ;move high nybble to low - lsr - lsr - tay ;save as offset (note this tends to go into reach of code) - lda Enemy_Y_Position,x ;get vertical position - sec ;subtract pseudorandom value based on offset from position - sbc PRandomSubtracter,y - bpl AddCCF ;if result within top half of screen, skip this part - eor #$ff - clc ;otherwise get two's compliment - adc #$01 -AddCCF: cmp #$08 ;if result or two's compliment greater than eight, - bcs BPGet ;skip to the end without changing movement force - lda Enemy_Y_MoveForce,x - clc - adc #$10 ;otherwise add to it - sta Enemy_Y_MoveForce,x - lsr ;move high nybble to low again - lsr - lsr - lsr - tay -BPGet: lda FlyCCBPriority,y ;load bg priority data and store (this is very likely - sta Enemy_SprAttrib,x ;broken or residual code, value is overwritten before - rts ;drawing it next frame), then leave - -;-------------------------------- -;$00 - used to hold horizontal difference -;$01-$03 - used to hold difference adjusters - -LakituDiffAdj: - .db $15, $30, $40 - -MoveLakitu: - lda Enemy_State,x ;check lakitu's enemy state - and #%00100000 ;for d5 set - beq ChkLS ;if not set, continue with code - jmp MoveD_EnemyVertically ;otherwise jump to move defeated lakitu downwards -ChkLS: lda Enemy_State,x ;if lakitu's enemy state not set at all, - beq Fr12S ;go ahead and continue with code - lda #$00 - sta LakituMoveDirection,x ;otherwise initialize moving direction to move to left - sta EnemyFrenzyBuffer ;initialize frenzy buffer - lda #$10 - bne SetLSpd ;load horizontal speed and do unconditional branch -Fr12S: lda #Spiny - sta EnemyFrenzyBuffer ;set spiny identifier in frenzy buffer - ldy #$02 -LdLDa: lda LakituDiffAdj,y ;load values - sta $0001,y ;store in zero page - dey - bpl LdLDa ;do this until all values are stired - jsr PlayerLakituDiff ;execute sub to set speed and create spinys -SetLSpd: sta LakituMoveSpeed,x ;set movement speed returned from sub - ldy #$01 ;set moving direction to right by default - lda LakituMoveDirection,x - and #$01 ;get LSB of moving direction - bne SetLMov ;if set, branch to the end to use moving direction - lda LakituMoveSpeed,x - eor #$ff ;get two's compliment of moving speed - clc - adc #$01 - sta LakituMoveSpeed,x ;store as new moving speed - iny ;increment moving direction to left -SetLMov: sty Enemy_MovingDir,x ;store moving direction - jmp MoveEnemyHorizontally ;move lakitu horizontally - -PlayerLakituDiff: - ldy #$00 ;set Y for default value - jsr PlayerEnemyDiff ;get horizontal difference between enemy and player - bpl ChkLakDif ;branch if enemy is to the right of the player - iny ;increment Y for left of player - lda $00 - eor #$ff ;get two's compliment of low byte of horizontal difference - clc - adc #$01 ;store two's compliment as horizontal difference - sta $00 -ChkLakDif: lda $00 ;get low byte of horizontal difference - cmp #$3c ;if within a certain distance of player, branch - bcc ChkPSpeed - lda #$3c ;otherwise set maximum distance - sta $00 - lda Enemy_ID,x ;check if lakitu is in our current enemy slot - cmp #Lakitu - bne ChkPSpeed ;if not, branch elsewhere - tya ;compare contents of Y, now in A - cmp LakituMoveDirection,x ;to what is being used as horizontal movement direction - beq ChkPSpeed ;if moving toward the player, branch, do not alter - lda LakituMoveDirection,x ;if moving to the left beyond maximum distance, - beq SetLMovD ;branch and alter without delay - dec LakituMoveSpeed,x ;decrement horizontal speed - lda LakituMoveSpeed,x ;if horizontal speed not yet at zero, branch to leave - bne ExMoveLak -SetLMovD: tya ;set horizontal direction depending on horizontal - sta LakituMoveDirection,x ;difference between enemy and player if necessary -ChkPSpeed: lda $00 - and #%00111100 ;mask out all but four bits in the middle - lsr ;divide masked difference by four - lsr - sta $00 ;store as new value - ldy #$00 ;init offset - lda Player_X_Speed - beq SubDifAdj ;if player not moving horizontally, branch - lda ScrollAmount - beq SubDifAdj ;if scroll speed not set, branch to same place - iny ;otherwise increment offset - lda Player_X_Speed - cmp #$19 ;if player not running, branch - bcc ChkSpinyO - lda ScrollAmount - cmp #$02 ;if scroll speed below a certain amount, branch - bcc ChkSpinyO ;to same place - iny ;otherwise increment once more -ChkSpinyO: lda Enemy_ID,x ;check for spiny object - cmp #Spiny - bne ChkEmySpd ;branch if not found - lda Player_X_Speed ;if player not moving, skip this part - bne SubDifAdj -ChkEmySpd: lda Enemy_Y_Speed,x ;check vertical speed - bne SubDifAdj ;branch if nonzero - ldy #$00 ;otherwise reinit offset -SubDifAdj: lda $0001,y ;get one of three saved values from earlier - ldy $00 ;get saved horizontal difference -SPixelLak: sec ;subtract one for each pixel of horizontal difference - sbc #$01 ;from one of three saved values - dey - bpl SPixelLak ;branch until all pixels are subtracted, to adjust difference -ExMoveLak: rts ;leave!!! - -;------------------------------------------------------------------------------------- -;$04-$05 - used to store name table address in little endian order - -BridgeCollapseData: - .db $1a ;axe - .db $58 ;chain - .db $98, $96, $94, $92, $90, $8e, $8c ;bridge - .db $8a, $88, $86, $84, $82, $80 - -BridgeCollapse: - ldx BowserFront_Offset ;get enemy offset for bowser - lda Enemy_ID,x ;check enemy object identifier for bowser - cmp #Bowser ;if not found, branch ahead, - bne SetM2 ;metatile removal not necessary - stx ObjectOffset ;store as enemy offset here - lda Enemy_State,x ;if bowser in normal state, skip all of this - beq RemoveBridge - and #%01000000 ;if bowser's state has d6 clear, skip to silence music - beq SetM2 - lda Enemy_Y_Position,x ;check bowser's vertical coordinate - cmp #$e0 ;if bowser not yet low enough, skip this part ahead - bcc MoveD_Bowser -SetM2: lda #Silence ;silence music - sta EventMusicQueue - inc OperMode_Task ;move onto next secondary mode in autoctrl mode - jmp KillAllEnemies ;jump to empty all enemy slots and then leave - -MoveD_Bowser: - jsr MoveEnemySlowVert ;do a sub to move bowser downwards - jmp BowserGfxHandler ;jump to draw bowser's front and rear, then leave - -RemoveBridge: - dec BowserFeetCounter ;decrement timer to control bowser's feet - bne NoBFall ;if not expired, skip all of this - lda #$04 - sta BowserFeetCounter ;otherwise, set timer now - lda BowserBodyControls - eor #$01 ;invert bit to control bowser's feet - sta BowserBodyControls - lda #$22 ;put high byte of name table address here for now - sta $05 - ldy BridgeCollapseOffset ;get bridge collapse offset here - lda BridgeCollapseData,y ;load low byte of name table address and store here - sta $04 - ldy VRAM_Buffer1_Offset ;increment vram buffer offset - iny - ldx #$0c ;set offset for tile data for sub to draw blank metatile - jsr RemBridge ;do sub here to remove bowser's bridge metatiles - ldx ObjectOffset ;get enemy offset - jsr MoveVOffset ;set new vram buffer offset - lda #Sfx_Blast ;load the fireworks/gunfire sound into the square 2 sfx - sta Square2SoundQueue ;queue while at the same time loading the brick - lda #Sfx_BrickShatter ;shatter sound into the noise sfx queue thus - sta NoiseSoundQueue ;producing the unique sound of the bridge collapsing - inc BridgeCollapseOffset ;increment bridge collapse offset - lda BridgeCollapseOffset - cmp #$0f ;if bridge collapse offset has not yet reached - bne NoBFall ;the end, go ahead and skip this part - jsr InitVStf ;initialize whatever vertical speed bowser has - lda #%01000000 - sta Enemy_State,x ;set bowser's state to one of defeated states (d6 set) - lda #Sfx_BowserFall - sta Square2SoundQueue ;play bowser defeat sound -NoBFall: jmp BowserGfxHandler ;jump to code that draws bowser - -;-------------------------------- - -PRandomRange: - .db $21, $41, $11, $31 - -RunBowser: - lda Enemy_State,x ;if d5 in enemy state is not set - and #%00100000 ;then branch elsewhere to run bowser - beq BowserControl - lda Enemy_Y_Position,x ;otherwise check vertical position - cmp #$e0 ;if above a certain point, branch to move defeated bowser - bcc MoveD_Bowser ;otherwise proceed to KillAllEnemies - -KillAllEnemies: - ldx #$04 ;start with last enemy slot -KillLoop: jsr EraseEnemyObject ;branch to kill enemy objects - dex ;move onto next enemy slot - bpl KillLoop ;do this until all slots are emptied - sta EnemyFrenzyBuffer ;empty frenzy buffer - ldx ObjectOffset ;get enemy object offset and leave - rts - -BowserControl: - lda #$00 - sta EnemyFrenzyBuffer ;empty frenzy buffer - lda TimerControl ;if master timer control not set, - beq ChkMouth ;skip jump and execute code here - jmp SkipToFB ;otherwise, jump over a bunch of code -ChkMouth: lda BowserBodyControls ;check bowser's mouth - bpl FeetTmr ;if bit clear, go ahead with code here - jmp HammerChk ;otherwise skip a whole section starting here -FeetTmr: dec BowserFeetCounter ;decrement timer to control bowser's feet - bne ResetMDr ;if not expired, skip this part - lda #$20 ;otherwise, reset timer - sta BowserFeetCounter - lda BowserBodyControls ;and invert bit used - eor #%00000001 ;to control bowser's feet - sta BowserBodyControls -ResetMDr: lda FrameCounter ;check frame counter - and #%00001111 ;if not on every sixteenth frame, skip - bne B_FaceP ;ahead to continue code - lda #$02 ;otherwise reset moving/facing direction every - sta Enemy_MovingDir,x ;sixteen frames -B_FaceP: lda EnemyFrameTimer,x ;if timer set here expired, - beq GetPRCmp ;branch to next section - jsr PlayerEnemyDiff ;get horizontal difference between player and bowser, - bpl GetPRCmp ;and branch if bowser to the right of the player - lda #$01 - sta Enemy_MovingDir,x ;set bowser to move and face to the right - lda #$02 - sta BowserMovementSpeed ;set movement speed - lda #$20 - sta EnemyFrameTimer,x ;set timer here - sta BowserFireBreathTimer ;set timer used for bowser's flame - lda Enemy_X_Position,x - cmp #$c8 ;if bowser to the right past a certain point, - bcs HammerChk ;skip ahead to some other section -GetPRCmp: lda FrameCounter ;get frame counter - and #%00000011 - bne HammerChk ;execute this code every fourth frame, otherwise branch - lda Enemy_X_Position,x - cmp BowserOrigXPos ;if bowser not at original horizontal position, - bne GetDToO ;branch to skip this part - lda PseudoRandomBitReg,x - and #%00000011 ;get pseudorandom offset - tay - lda PRandomRange,y ;load value using pseudorandom offset - sta MaxRangeFromOrigin ;and store here -GetDToO: lda Enemy_X_Position,x - clc ;add movement speed to bowser's horizontal - adc BowserMovementSpeed ;coordinate and save as new horizontal position - sta Enemy_X_Position,x - ldy Enemy_MovingDir,x - cpy #$01 ;if bowser moving and facing to the right, skip ahead - beq HammerChk - ldy #$ff ;set default movement speed here (move left) - sec ;get difference of current vs. original - sbc BowserOrigXPos ;horizontal position - bpl CompDToO ;if current position to the right of original, skip ahead - eor #$ff - clc ;get two's compliment - adc #$01 - ldy #$01 ;set alternate movement speed here (move right) -CompDToO: cmp MaxRangeFromOrigin ;compare difference with pseudorandom value - bcc HammerChk ;if difference < pseudorandom value, leave speed alone - sty BowserMovementSpeed ;otherwise change bowser's movement speed -HammerChk: lda EnemyFrameTimer,x ;if timer set here not expired yet, skip ahead to - bne MakeBJump ;some other section of code - jsr MoveEnemySlowVert ;otherwise start by moving bowser downwards - lda WorldNumber ;check world number - cmp #World6 - bcc SetHmrTmr ;if world 1-5, skip this part (not time to throw hammers yet) - lda FrameCounter - and #%00000011 ;check to see if it's time to execute sub - bne SetHmrTmr ;if not, skip sub, otherwise - jsr SpawnHammerObj ;execute sub on every fourth frame to spawn misc object (hammer) -SetHmrTmr: lda Enemy_Y_Position,x ;get current vertical position - cmp #$80 ;if still above a certain point - bcc ChkFireB ;then skip to world number check for flames - lda PseudoRandomBitReg,x - and #%00000011 ;get pseudorandom offset - tay - lda PRandomRange,y ;get value using pseudorandom offset - sta EnemyFrameTimer,x ;set for timer here -SkipToFB: jmp ChkFireB ;jump to execute flames code -MakeBJump: cmp #$01 ;if timer not yet about to expire, - bne ChkFireB ;skip ahead to next part - dec Enemy_Y_Position,x ;otherwise decrement vertical coordinate - jsr InitVStf ;initialize movement amount - lda #$fe - sta Enemy_Y_Speed,x ;set vertical speed to move bowser upwards -ChkFireB: lda WorldNumber ;check world number here - cmp #World8 ;world 8? - beq SpawnFBr ;if so, execute this part here - cmp #World6 ;world 6-7? - bcs BowserGfxHandler ;if so, skip this part here -SpawnFBr: lda BowserFireBreathTimer ;check timer here - bne BowserGfxHandler ;if not expired yet, skip all of this - lda #$20 - sta BowserFireBreathTimer ;set timer here - lda BowserBodyControls - eor #%10000000 ;invert bowser's mouth bit to open - sta BowserBodyControls ;and close bowser's mouth - bmi ChkFireB ;if bowser's mouth open, loop back - jsr SetFlameTimer ;get timing for bowser's flame - ldy SecondaryHardMode - beq SetFBTmr ;if secondary hard mode flag not set, skip this - sec - sbc #$10 ;otherwise subtract from value in A -SetFBTmr: sta BowserFireBreathTimer ;set value as timer here - lda #BowserFlame ;put bowser's flame identifier - sta EnemyFrenzyBuffer ;in enemy frenzy buffer - -;-------------------------------- - -BowserGfxHandler: - jsr ProcessBowserHalf ;do a sub here to process bowser's front - ldy #$10 ;load default value here to position bowser's rear - lda Enemy_MovingDir,x ;check moving direction - lsr - bcc CopyFToR ;if moving left, use default - ldy #$f0 ;otherwise load alternate positioning value here -CopyFToR: tya ;move bowser's rear object position value to A - clc - adc Enemy_X_Position,x ;add to bowser's front object horizontal coordinate - ldy DuplicateObj_Offset ;get bowser's rear object offset - sta Enemy_X_Position,y ;store A as bowser's rear horizontal coordinate - lda Enemy_Y_Position,x - clc ;add eight pixels to bowser's front object - adc #$08 ;vertical coordinate and store as vertical coordinate - sta Enemy_Y_Position,y ;for bowser's rear - lda Enemy_State,x - sta Enemy_State,y ;copy enemy state directly from front to rear - lda Enemy_MovingDir,x - sta Enemy_MovingDir,y ;copy moving direction also - lda ObjectOffset ;save enemy object offset of front to stack - pha - ldx DuplicateObj_Offset ;put enemy object offset of rear as current - stx ObjectOffset - lda #Bowser ;set bowser's enemy identifier - sta Enemy_ID,x ;store in bowser's rear object - jsr ProcessBowserHalf ;do a sub here to process bowser's rear - pla - sta ObjectOffset ;get original enemy object offset - tax - lda #$00 ;nullify bowser's front/rear graphics flag - sta BowserGfxFlag -ExBGfxH: rts ;leave! - -ProcessBowserHalf: - inc BowserGfxFlag ;increment bowser's graphics flag, then run subroutines - jsr RunRetainerObj ;to get offscreen bits, relative position and draw bowser (finally!) - lda Enemy_State,x - bne ExBGfxH ;if either enemy object not in normal state, branch to leave - lda #$0a - sta Enemy_BoundBoxCtrl,x ;set bounding box size control - jsr GetEnemyBoundBox ;get bounding box coordinates - jmp PlayerEnemyCollision ;do player-to-enemy collision detection - -;------------------------------------------------------------------------------------- -;$00 - used to hold movement force and tile number -;$01 - used to hold sprite attribute data - -FlameTimerData: - .db $bf, $40, $bf, $bf, $bf, $40, $40, $bf - -SetFlameTimer: - ldy BowserFlameTimerCtrl ;load counter as offset - inc BowserFlameTimerCtrl ;increment - lda BowserFlameTimerCtrl ;mask out all but 3 LSB - and #%00000111 ;to keep in range of 0-7 - sta BowserFlameTimerCtrl - lda FlameTimerData,y ;load value to be used then leave -ExFl: rts - -ProcBowserFlame: - lda TimerControl ;if master timer control flag set, - bne SetGfxF ;skip all of this - lda #$40 ;load default movement force - ldy SecondaryHardMode - beq SFlmX ;if secondary hard mode flag not set, use default - lda #$60 ;otherwise load alternate movement force to go faster -SFlmX: sta $00 ;store value here - lda Enemy_X_MoveForce,x - sec ;subtract value from movement force - sbc $00 - sta Enemy_X_MoveForce,x ;save new value - lda Enemy_X_Position,x - sbc #$01 ;subtract one from horizontal position to move - sta Enemy_X_Position,x ;to the left - lda Enemy_PageLoc,x - sbc #$00 ;subtract borrow from page location - sta Enemy_PageLoc,x - ldy BowserFlamePRandomOfs,x ;get some value here and use as offset - lda Enemy_Y_Position,x ;load vertical coordinate - cmp FlameYPosData,y ;compare against coordinate data using $0417,x as offset - beq SetGfxF ;if equal, branch and do not modify coordinate - clc - adc Enemy_Y_MoveForce,x ;otherwise add value here to coordinate and store - sta Enemy_Y_Position,x ;as new vertical coordinate -SetGfxF: jsr RelativeEnemyPosition ;get new relative coordinates - lda Enemy_State,x ;if bowser's flame not in normal state, - bne ExFl ;branch to leave - lda #$51 ;otherwise, continue - sta $00 ;write first tile number - ldy #$02 ;load attributes without vertical flip by default - lda FrameCounter - and #%00000010 ;invert vertical flip bit every 2 frames - beq FlmeAt ;if d1 not set, write default value - ldy #$82 ;otherwise write value with vertical flip bit set -FlmeAt: sty $01 ;set bowser's flame sprite attributes here - ldy Enemy_SprDataOffset,x ;get OAM data offset - ldx #$00 - -DrawFlameLoop: - lda Enemy_Rel_YPos ;get Y relative coordinate of current enemy object - sta Sprite_Y_Position,y ;write into Y coordinate of OAM data - lda $00 - sta Sprite_Tilenumber,y ;write current tile number into OAM data - inc $00 ;increment tile number to draw more bowser's flame - lda $01 - sta Sprite_Attributes,y ;write saved attributes into OAM data - lda Enemy_Rel_XPos - sta Sprite_X_Position,y ;write X relative coordinate of current enemy object - clc - adc #$08 - sta Enemy_Rel_XPos ;then add eight to it and store - iny - iny - iny - iny ;increment Y four times to move onto the next OAM - inx ;move onto the next OAM, and branch if three - cpx #$03 ;have not yet been done - bcc DrawFlameLoop - ldx ObjectOffset ;reload original enemy offset - jsr GetEnemyOffscreenBits ;get offscreen information - ldy Enemy_SprDataOffset,x ;get OAM data offset - lda Enemy_OffscreenBits ;get enemy object offscreen bits - lsr ;move d0 to carry and result to stack - pha - bcc M3FOfs ;branch if carry not set - lda #$f8 ;otherwise move sprite offscreen, this part likely - sta Sprite_Y_Position+12,y ;residual since flame is only made of three sprites -M3FOfs: pla ;get bits from stack - lsr ;move d1 to carry and move bits back to stack - pha - bcc M2FOfs ;branch if carry not set again - lda #$f8 ;otherwise move third sprite offscreen - sta Sprite_Y_Position+8,y -M2FOfs: pla ;get bits from stack again - lsr ;move d2 to carry and move bits back to stack again - pha - bcc M1FOfs ;branch if carry not set yet again - lda #$f8 ;otherwise move second sprite offscreen - sta Sprite_Y_Position+4,y -M1FOfs: pla ;get bits from stack one last time - lsr ;move d3 to carry - bcc ExFlmeD ;branch if carry not set one last time - lda #$f8 - sta Sprite_Y_Position,y ;otherwise move first sprite offscreen -ExFlmeD: rts ;leave - -;-------------------------------- - -RunFireworks: - dec ExplosionTimerCounter,x ;decrement explosion timing counter here - bne SetupExpl ;if not expired, skip this part - lda #$08 - sta ExplosionTimerCounter,x ;reset counter - inc ExplosionGfxCounter,x ;increment explosion graphics counter - lda ExplosionGfxCounter,x - cmp #$03 ;check explosion graphics counter - bcs FireworksSoundScore ;if at a certain point, branch to kill this object -SetupExpl: jsr RelativeEnemyPosition ;get relative coordinates of explosion - lda Enemy_Rel_YPos ;copy relative coordinates - sta Fireball_Rel_YPos ;from the enemy object to the fireball object - lda Enemy_Rel_XPos ;first vertical, then horizontal - sta Fireball_Rel_XPos - ldy Enemy_SprDataOffset,x ;get OAM data offset - lda ExplosionGfxCounter,x ;get explosion graphics counter - jsr DrawExplosion_Fireworks ;do a sub to draw the explosion then leave - rts - -FireworksSoundScore: - lda #$00 ;disable enemy buffer flag - sta Enemy_Flag,x - lda #Sfx_Blast ;play fireworks/gunfire sound - sta Square2SoundQueue - lda #$05 ;set part of score modifier for 500 points - sta DigitModifier+4 - jmp EndAreaPoints ;jump to award points accordingly then leave - -;-------------------------------- - -StarFlagYPosAdder: - .db $00, $00, $08, $08 - -StarFlagXPosAdder: - .db $00, $08, $00, $08 - -StarFlagTileData: - .db $54, $55, $56, $57 - -RunStarFlagObj: - lda #$00 ;initialize enemy frenzy buffer - sta EnemyFrenzyBuffer - lda StarFlagTaskControl ;check star flag object task number here - cmp #$05 ;if greater than 5, branch to exit - bcs StarFlagExit - jsr JumpEngine ;otherwise jump to appropriate sub - - .dw StarFlagExit - .dw GameTimerFireworks - .dw AwardGameTimerPoints - .dw RaiseFlagSetoffFWorks - .dw DelayToAreaEnd - -GameTimerFireworks: - ldy #$05 ;set default state for star flag object - lda GameTimerDisplay+2 ;get game timer's last digit - cmp #$01 - beq SetFWC ;if last digit of game timer set to 1, skip ahead - ldy #$03 ;otherwise load new value for state - cmp #$03 - beq SetFWC ;if last digit of game timer set to 3, skip ahead - ldy #$00 ;otherwise load one more potential value for state - cmp #$06 - beq SetFWC ;if last digit of game timer set to 6, skip ahead - lda #$ff ;otherwise set value for no fireworks -SetFWC: sta FireworksCounter ;set fireworks counter here - sty Enemy_State,x ;set whatever state we have in star flag object - -IncrementSFTask1: - inc StarFlagTaskControl ;increment star flag object task number - -StarFlagExit: - rts ;leave - -AwardGameTimerPoints: - lda GameTimerDisplay ;check all game timer digits for any intervals left - ora GameTimerDisplay+1 - ora GameTimerDisplay+2 - beq IncrementSFTask1 ;if no time left on game timer at all, branch to next task - lda FrameCounter - and #%00000100 ;check frame counter for d2 set (skip ahead - beq NoTTick ;for four frames every four frames) branch if not set - lda #Sfx_TimerTick - sta Square2SoundQueue ;load timer tick sound -NoTTick: ldy #$23 ;set offset here to subtract from game timer's last digit - lda #$ff ;set adder here to $ff, or -1, to subtract one - sta DigitModifier+5 ;from the last digit of the game timer - jsr DigitsMathRoutine ;subtract digit - lda #$05 ;set now to add 50 points - sta DigitModifier+5 ;per game timer interval subtracted - -EndAreaPoints: - ldy #$0b ;load offset for mario's score by default - lda CurrentPlayer ;check player on the screen - beq ELPGive ;if mario, do not change - ldy #$11 ;otherwise load offset for luigi's score -ELPGive: jsr DigitsMathRoutine ;award 50 points per game timer interval - lda CurrentPlayer ;get player on the screen (or 500 points per - asl ;fireworks explosion if branched here from there) - asl ;shift to high nybble - asl - asl - ora #%00000100 ;add four to set nybble for game timer - jmp UpdateNumber ;jump to print the new score and game timer - -RaiseFlagSetoffFWorks: - lda Enemy_Y_Position,x ;check star flag's vertical position - cmp #$72 ;against preset value - bcc SetoffF ;if star flag higher vertically, branch to other code - dec Enemy_Y_Position,x ;otherwise, raise star flag by one pixel - jmp DrawStarFlag ;and skip this part here -SetoffF: lda FireworksCounter ;check fireworks counter - beq DrawFlagSetTimer ;if no fireworks left to go off, skip this part - bmi DrawFlagSetTimer ;if no fireworks set to go off, skip this part - lda #Fireworks - sta EnemyFrenzyBuffer ;otherwise set fireworks object in frenzy queue - -DrawStarFlag: - jsr RelativeEnemyPosition ;get relative coordinates of star flag - ldy Enemy_SprDataOffset,x ;get OAM data offset - ldx #$03 ;do four sprites -DSFLoop: lda Enemy_Rel_YPos ;get relative vertical coordinate - clc - adc StarFlagYPosAdder,x ;add Y coordinate adder data - sta Sprite_Y_Position,y ;store as Y coordinate - lda StarFlagTileData,x ;get tile number - sta Sprite_Tilenumber,y ;store as tile number - lda #$22 ;set palette and background priority bits - sta Sprite_Attributes,y ;store as attributes - lda Enemy_Rel_XPos ;get relative horizontal coordinate - clc - adc StarFlagXPosAdder,x ;add X coordinate adder data - sta Sprite_X_Position,y ;store as X coordinate - iny - iny ;increment OAM data offset four bytes - iny ;for next sprite - iny - dex ;move onto next sprite - bpl DSFLoop ;do this until all sprites are done - ldx ObjectOffset ;get enemy object offset and leave - rts - -DrawFlagSetTimer: - jsr DrawStarFlag ;do sub to draw star flag - lda #$06 - sta EnemyIntervalTimer,x ;set interval timer here - -IncrementSFTask2: - inc StarFlagTaskControl ;move onto next task - rts - -DelayToAreaEnd: - jsr DrawStarFlag ;do sub to draw star flag - lda EnemyIntervalTimer,x ;if interval timer set in previous task - bne StarFlagExit2 ;not yet expired, branch to leave - lda EventMusicBuffer ;if event music buffer empty, - beq IncrementSFTask2 ;branch to increment task - -StarFlagExit2: - rts ;otherwise leave - -;-------------------------------- -;$00 - used to store horizontal difference between player and piranha plant - -MovePiranhaPlant: - lda Enemy_State,x ;check enemy state - bne PutinPipe ;if set at all, branch to leave - lda EnemyFrameTimer,x ;check enemy's timer here - bne PutinPipe ;branch to end if not yet expired - lda PiranhaPlant_MoveFlag,x ;check movement flag - bne SetupToMovePPlant ;if moving, skip to part ahead - lda PiranhaPlant_Y_Speed,x ;if currently rising, branch - bmi ReversePlantSpeed ;to move enemy upwards out of pipe - jsr PlayerEnemyDiff ;get horizontal difference between player and - bpl ChkPlayerNearPipe ;piranha plant, and branch if enemy to right of player - lda $00 ;otherwise get saved horizontal difference - eor #$ff - clc ;and change to two's compliment - adc #$01 - sta $00 ;save as new horizontal difference - -ChkPlayerNearPipe: - lda $00 ;get saved horizontal difference - cmp #$21 - bcc PutinPipe ;if player within a certain distance, branch to leave - -ReversePlantSpeed: - lda PiranhaPlant_Y_Speed,x ;get vertical speed - eor #$ff - clc ;change to two's compliment - adc #$01 - sta PiranhaPlant_Y_Speed,x ;save as new vertical speed - inc PiranhaPlant_MoveFlag,x ;increment to set movement flag - -SetupToMovePPlant: - lda PiranhaPlantDownYPos,x ;get original vertical coordinate (lowest point) - ldy PiranhaPlant_Y_Speed,x ;get vertical speed - bpl RiseFallPiranhaPlant ;branch if moving downwards - lda PiranhaPlantUpYPos,x ;otherwise get other vertical coordinate (highest point) - -RiseFallPiranhaPlant: - sta $00 ;save vertical coordinate here - lda FrameCounter ;get frame counter - lsr - bcc PutinPipe ;branch to leave if d0 set (execute code every other frame) - lda TimerControl ;get master timer control - bne PutinPipe ;branch to leave if set (likely not necessary) - lda Enemy_Y_Position,x ;get current vertical coordinate - clc - adc PiranhaPlant_Y_Speed,x ;add vertical speed to move up or down - sta Enemy_Y_Position,x ;save as new vertical coordinate - cmp $00 ;compare against low or high coordinate - bne PutinPipe ;branch to leave if not yet reached - lda #$00 - sta PiranhaPlant_MoveFlag,x ;otherwise clear movement flag - lda #$40 - sta EnemyFrameTimer,x ;set timer to delay piranha plant movement - -PutinPipe: - lda #%00100000 ;set background priority bit in sprite - sta Enemy_SprAttrib,x ;attributes to give illusion of being inside pipe - rts ;then leave - -;------------------------------------------------------------------------------------- -;$07 - spinning speed - -FirebarSpin: - sta $07 ;save spinning speed here - lda FirebarSpinDirection,x ;check spinning direction - bne SpinCounterClockwise ;if moving counter-clockwise, branch to other part - ldy #$18 ;possibly residual ldy - lda FirebarSpinState_Low,x - clc ;add spinning speed to what would normally be - adc $07 ;the horizontal speed - sta FirebarSpinState_Low,x - lda FirebarSpinState_High,x ;add carry to what would normally be the vertical speed - adc #$00 - rts - -SpinCounterClockwise: - ldy #$08 ;possibly residual ldy - lda FirebarSpinState_Low,x - sec ;subtract spinning speed to what would normally be - sbc $07 ;the horizontal speed - sta FirebarSpinState_Low,x - lda FirebarSpinState_High,x ;add carry to what would normally be the vertical speed - sbc #$00 - rts - -;------------------------------------------------------------------------------------- -;$00 - used to hold collision flag, Y movement force + 5 or low byte of name table for rope -;$01 - used to hold high byte of name table for rope -;$02 - used to hold page location of rope - -BalancePlatform: - lda Enemy_Y_HighPos,x ;check high byte of vertical position - cmp #$03 - bne DoBPl - jmp EraseEnemyObject ;if far below screen, kill the object -DoBPl: lda Enemy_State,x ;get object's state (set to $ff or other platform offset) - bpl CheckBalPlatform ;if doing other balance platform, branch to leave - rts - -CheckBalPlatform: - tay ;save offset from state as Y - lda PlatformCollisionFlag,x ;get collision flag of platform - sta $00 ;store here - lda Enemy_MovingDir,x ;get moving direction - beq ChkForFall - jmp PlatformFall ;if set, jump here - -ChkForFall: - lda #$2d ;check if platform is above a certain point - cmp Enemy_Y_Position,x - bcc ChkOtherForFall ;if not, branch elsewhere - cpy $00 ;if collision flag is set to same value as - beq MakePlatformFall ;enemy state, branch to make platforms fall - clc - adc #$02 ;otherwise add 2 pixels to vertical position - sta Enemy_Y_Position,x ;of current platform and branch elsewhere - jmp StopPlatforms ;to make platforms stop - -MakePlatformFall: - jmp InitPlatformFall ;make platforms fall - -ChkOtherForFall: - cmp Enemy_Y_Position,y ;check if other platform is above a certain point - bcc ChkToMoveBalPlat ;if not, branch elsewhere - cpx $00 ;if collision flag is set to same value as - beq MakePlatformFall ;enemy state, branch to make platforms fall - clc - adc #$02 ;otherwise add 2 pixels to vertical position - sta Enemy_Y_Position,y ;of other platform and branch elsewhere - jmp StopPlatforms ;jump to stop movement and do not return - -ChkToMoveBalPlat: - lda Enemy_Y_Position,x ;save vertical position to stack - pha - lda PlatformCollisionFlag,x ;get collision flag - bpl ColFlg ;branch if collision - lda Enemy_Y_MoveForce,x - clc ;add $05 to contents of moveforce, whatever they be - adc #$05 - sta $00 ;store here - lda Enemy_Y_Speed,x - adc #$00 ;add carry to vertical speed - bmi PlatDn ;branch if moving downwards - bne PlatUp ;branch elsewhere if moving upwards - lda $00 - cmp #$0b ;check if there's still a little force left - bcc PlatSt ;if not enough, branch to stop movement - bcs PlatUp ;otherwise keep branch to move upwards -ColFlg: cmp ObjectOffset ;if collision flag matches - beq PlatDn ;current enemy object offset, branch -PlatUp: jsr MovePlatformUp ;do a sub to move upwards - jmp DoOtherPlatform ;jump ahead to remaining code -PlatSt: jsr StopPlatforms ;do a sub to stop movement - jmp DoOtherPlatform ;jump ahead to remaining code -PlatDn: jsr MovePlatformDown ;do a sub to move downwards - -DoOtherPlatform: - ldy Enemy_State,x ;get offset of other platform - pla ;get old vertical coordinate from stack - sec - sbc Enemy_Y_Position,x ;get difference of old vs. new coordinate - clc - adc Enemy_Y_Position,y ;add difference to vertical coordinate of other - sta Enemy_Y_Position,y ;platform to move it in the opposite direction - lda PlatformCollisionFlag,x ;if no collision, skip this part here - bmi DrawEraseRope - tax ;put offset which collision occurred here - jsr PositionPlayerOnVPlat ;and use it to position player accordingly - -DrawEraseRope: - ldy ObjectOffset ;get enemy object offset - lda Enemy_Y_Speed,y ;check to see if current platform is - ora Enemy_Y_MoveForce,y ;moving at all - beq ExitRp ;if not, skip all of this and branch to leave - ldx VRAM_Buffer1_Offset ;get vram buffer offset - cpx #$20 ;if offset beyond a certain point, go ahead - bcs ExitRp ;and skip this, branch to leave - lda Enemy_Y_Speed,y - pha ;save two copies of vertical speed to stack - pha - jsr SetupPlatformRope ;do a sub to figure out where to put new bg tiles - lda $01 ;write name table address to vram buffer - sta VRAM_Buffer1,x ;first the high byte, then the low - lda $00 - sta VRAM_Buffer1+1,x - lda #$02 ;set length for 2 bytes - sta VRAM_Buffer1+2,x - lda Enemy_Y_Speed,y ;if platform moving upwards, branch - bmi EraseR1 ;to do something else - lda #$a2 - sta VRAM_Buffer1+3,x ;otherwise put tile numbers for left - lda #$a3 ;and right sides of rope in vram buffer - sta VRAM_Buffer1+4,x - jmp OtherRope ;jump to skip this part -EraseR1: lda #$24 ;put blank tiles in vram buffer - sta VRAM_Buffer1+3,x ;to erase rope - sta VRAM_Buffer1+4,x - -OtherRope: - lda Enemy_State,y ;get offset of other platform from state - tay ;use as Y here - pla ;pull second copy of vertical speed from stack - eor #$ff ;invert bits to reverse speed - jsr SetupPlatformRope ;do sub again to figure out where to put bg tiles - lda $01 ;write name table address to vram buffer - sta VRAM_Buffer1+5,x ;this time we're doing putting tiles for - lda $00 ;the other platform - sta VRAM_Buffer1+6,x - lda #$02 - sta VRAM_Buffer1+7,x ;set length again for 2 bytes - pla ;pull first copy of vertical speed from stack - bpl EraseR2 ;if moving upwards (note inversion earlier), skip this - lda #$a2 - sta VRAM_Buffer1+8,x ;otherwise put tile numbers for left - lda #$a3 ;and right sides of rope in vram - sta VRAM_Buffer1+9,x ;transfer buffer - jmp EndRp ;jump to skip this part -EraseR2: lda #$24 ;put blank tiles in vram buffer - sta VRAM_Buffer1+8,x ;to erase rope - sta VRAM_Buffer1+9,x -EndRp: lda #$00 ;put null terminator at the end - sta VRAM_Buffer1+10,x - lda VRAM_Buffer1_Offset ;add ten bytes to the vram buffer offset - clc ;and store - adc #10 - sta VRAM_Buffer1_Offset -ExitRp: ldx ObjectOffset ;get enemy object buffer offset and leave - rts - -SetupPlatformRope: - pha ;save second/third copy to stack - lda Enemy_X_Position,y ;get horizontal coordinate - clc - adc #$08 ;add eight pixels - ldx SecondaryHardMode ;if secondary hard mode flag set, - bne GetLRp ;use coordinate as-is - clc - adc #$10 ;otherwise add sixteen more pixels -GetLRp: pha ;save modified horizontal coordinate to stack - lda Enemy_PageLoc,y - adc #$00 ;add carry to page location - sta $02 ;and save here - pla ;pull modified horizontal coordinate - and #%11110000 ;from the stack, mask out low nybble - lsr ;and shift three bits to the right - lsr - lsr - sta $00 ;store result here as part of name table low byte - ldx Enemy_Y_Position,y ;get vertical coordinate - pla ;get second/third copy of vertical speed from stack - bpl GetHRp ;skip this part if moving downwards or not at all - txa - clc - adc #$08 ;add eight to vertical coordinate and - tax ;save as X -GetHRp: txa ;move vertical coordinate to A - ldx VRAM_Buffer1_Offset ;get vram buffer offset - asl - rol ;rotate d7 to d0 and d6 into carry - pha ;save modified vertical coordinate to stack - rol ;rotate carry to d0, thus d7 and d6 are at 2 LSB - and #%00000011 ;mask out all bits but d7 and d6, then set - ora #%00100000 ;d5 to get appropriate high byte of name table - sta $01 ;address, then store - lda $02 ;get saved page location from earlier - and #$01 ;mask out all but LSB - asl - asl ;shift twice to the left and save with the - ora $01 ;rest of the bits of the high byte, to get - sta $01 ;the proper name table and the right place on it - pla ;get modified vertical coordinate from stack - and #%11100000 ;mask out low nybble and LSB of high nybble - clc - adc $00 ;add to horizontal part saved here - sta $00 ;save as name table low byte - lda Enemy_Y_Position,y - cmp #$e8 ;if vertical position not below the - bcc ExPRp ;bottom of the screen, we're done, branch to leave - lda $00 - and #%10111111 ;mask out d6 of low byte of name table address - sta $00 -ExPRp: rts ;leave! - -InitPlatformFall: - tya ;move offset of other platform from Y to X - tax - jsr GetEnemyOffscreenBits ;get offscreen bits - lda #$06 - jsr SetupFloateyNumber ;award 1000 points to player - lda Player_Rel_XPos - sta FloateyNum_X_Pos,x ;put floatey number coordinates where player is - lda Player_Y_Position - sta FloateyNum_Y_Pos,x - lda #$01 ;set moving direction as flag for - sta Enemy_MovingDir,x ;falling platforms - -StopPlatforms: - jsr InitVStf ;initialize vertical speed and low byte - sta Enemy_Y_Speed,y ;for both platforms and leave - sta Enemy_Y_MoveForce,y - rts - -PlatformFall: - tya ;save offset for other platform to stack - pha - jsr MoveFallingPlatform ;make current platform fall - pla - tax ;pull offset from stack and save to X - jsr MoveFallingPlatform ;make other platform fall - ldx ObjectOffset - lda PlatformCollisionFlag,x ;if player not standing on either platform, - bmi ExPF ;skip this part - tax ;transfer collision flag offset as offset to X - jsr PositionPlayerOnVPlat ;and position player appropriately -ExPF: ldx ObjectOffset ;get enemy object buffer offset and leave - rts - -;-------------------------------- - -YMovingPlatform: - lda Enemy_Y_Speed,x ;if platform moving up or down, skip ahead to - ora Enemy_Y_MoveForce,x ;check on other position - bne ChkYCenterPos - sta Enemy_YMF_Dummy,x ;initialize dummy variable - lda Enemy_Y_Position,x - cmp YPlatformTopYPos,x ;if current vertical position => top position, branch - bcs ChkYCenterPos ;ahead of all this - lda FrameCounter - and #%00000111 ;check for every eighth frame - bne SkipIY - inc Enemy_Y_Position,x ;increase vertical position every eighth frame -SkipIY: jmp ChkYPCollision ;skip ahead to last part - -ChkYCenterPos: - lda Enemy_Y_Position,x ;if current vertical position < central position, branch - cmp YPlatformCenterYPos,x ;to slow ascent/move downwards - bcc YMDown - jsr MovePlatformUp ;otherwise start slowing descent/moving upwards - jmp ChkYPCollision -YMDown: jsr MovePlatformDown ;start slowing ascent/moving downwards - -ChkYPCollision: - lda PlatformCollisionFlag,x ;if collision flag not set here, branch - bmi ExYPl ;to leave - jsr PositionPlayerOnVPlat ;otherwise position player appropriately -ExYPl: rts ;leave - -;-------------------------------- -;$00 - used as adder to position player hotizontally - -XMovingPlatform: - lda #$0e ;load preset maximum value for secondary counter - jsr XMoveCntr_Platform ;do a sub to increment counters for movement - jsr MoveWithXMCntrs ;do a sub to move platform accordingly, and return value - lda PlatformCollisionFlag,x ;if no collision with player, - bmi ExXMP ;branch ahead to leave - -PositionPlayerOnHPlat: - lda Player_X_Position - clc ;add saved value from second subroutine to - adc $00 ;current player's position to position - sta Player_X_Position ;player accordingly in horizontal position - lda Player_PageLoc ;get player's page location - ldy $00 ;check to see if saved value here is positive or negative - bmi PPHSubt ;if negative, branch to subtract - adc #$00 ;otherwise add carry to page location - jmp SetPVar ;jump to skip subtraction -PPHSubt: sbc #$00 ;subtract borrow from page location -SetPVar: sta Player_PageLoc ;save result to player's page location - sty Platform_X_Scroll ;put saved value from second sub here to be used later - jsr PositionPlayerOnVPlat ;position player vertically and appropriately -ExXMP: rts ;and we are done here - -;-------------------------------- - -DropPlatform: - lda PlatformCollisionFlag,x ;if no collision between platform and player - bmi ExDPl ;occurred, just leave without moving anything - jsr MoveDropPlatform ;otherwise do a sub to move platform down very quickly - jsr PositionPlayerOnVPlat ;do a sub to position player appropriately -ExDPl: rts ;leave - -;-------------------------------- -;$00 - residual value from sub - -RightPlatform: - jsr MoveEnemyHorizontally ;move platform with current horizontal speed, if any - sta $00 ;store saved value here (residual code) - lda PlatformCollisionFlag,x ;check collision flag, if no collision between player - bmi ExRPl ;and platform, branch ahead, leave speed unaltered - lda #$10 - sta Enemy_X_Speed,x ;otherwise set new speed (gets moving if motionless) - jsr PositionPlayerOnHPlat ;use saved value from earlier sub to position player -ExRPl: rts ;then leave - -;-------------------------------- - -MoveLargeLiftPlat: - jsr MoveLiftPlatforms ;execute common to all large and small lift platforms - jmp ChkYPCollision ;branch to position player correctly - -MoveSmallPlatform: - jsr MoveLiftPlatforms ;execute common to all large and small lift platforms - jmp ChkSmallPlatCollision ;branch to position player correctly - -MoveLiftPlatforms: - lda TimerControl ;if master timer control set, skip all of this - bne ExLiftP ;and branch to leave - lda Enemy_YMF_Dummy,x - clc ;add contents of movement amount to whatever's here - adc Enemy_Y_MoveForce,x - sta Enemy_YMF_Dummy,x - lda Enemy_Y_Position,x ;add whatever vertical speed is set to current - adc Enemy_Y_Speed,x ;vertical position plus carry to move up or down - sta Enemy_Y_Position,x ;and then leave - rts - -ChkSmallPlatCollision: - lda PlatformCollisionFlag,x ;get bounding box counter saved in collision flag - beq ExLiftP ;if none found, leave player position alone - jsr PositionPlayerOnS_Plat ;use to position player correctly -ExLiftP: rts ;then leave - -;------------------------------------------------------------------------------------- -;$00 - page location of extended left boundary -;$01 - extended left boundary position -;$02 - page location of extended right boundary -;$03 - extended right boundary position - -OffscreenBoundsCheck: - lda Enemy_ID,x ;check for cheep-cheep object - cmp #FlyingCheepCheep ;branch to leave if found - beq ExScrnBd - lda ScreenLeft_X_Pos ;get horizontal coordinate for left side of screen - ldy Enemy_ID,x - cpy #HammerBro ;check for hammer bro object - beq LimitB - cpy #PiranhaPlant ;check for piranha plant object - bne ExtendLB ;these two will be erased sooner than others if too far left -LimitB: adc #$38 ;add 56 pixels to coordinate if hammer bro or piranha plant -ExtendLB: sbc #$48 ;subtract 72 pixels regardless of enemy object - sta $01 ;store result here - lda ScreenLeft_PageLoc - sbc #$00 ;subtract borrow from page location of left side - sta $00 ;store result here - lda ScreenRight_X_Pos ;add 72 pixels to the right side horizontal coordinate - adc #$48 - sta $03 ;store result here - lda ScreenRight_PageLoc - adc #$00 ;then add the carry to the page location - sta $02 ;and store result here - lda Enemy_X_Position,x ;compare horizontal coordinate of the enemy object - cmp $01 ;to modified horizontal left edge coordinate to get carry - lda Enemy_PageLoc,x - sbc $00 ;then subtract it from the page coordinate of the enemy object - bmi TooFar ;if enemy object is too far left, branch to erase it - lda Enemy_X_Position,x ;compare horizontal coordinate of the enemy object - cmp $03 ;to modified horizontal right edge coordinate to get carry - lda Enemy_PageLoc,x - sbc $02 ;then subtract it from the page coordinate of the enemy object - bmi ExScrnBd ;if enemy object is on the screen, leave, do not erase enemy - lda Enemy_State,x ;if at this point, enemy is offscreen to the right, so check - cmp #HammerBro ;if in state used by spiny's egg, do not erase - beq ExScrnBd - cpy #PiranhaPlant ;if piranha plant, do not erase - beq ExScrnBd - cpy #FlagpoleFlagObject ;if flagpole flag, do not erase - beq ExScrnBd - cpy #StarFlagObject ;if star flag, do not erase - beq ExScrnBd - cpy #JumpspringObject ;if jumpspring, do not erase - beq ExScrnBd ;erase all others too far to the right -TooFar: jsr EraseEnemyObject ;erase object if necessary -ExScrnBd: rts ;leave - -;------------------------------------------------------------------------------------- - -;some unused space - .db $ff, $ff, $ff - -;------------------------------------------------------------------------------------- -;$01 - enemy buffer offset - -FireballEnemyCollision: - lda Fireball_State,x ;check to see if fireball state is set at all - beq ExitFBallEnemy ;branch to leave if not - asl - bcs ExitFBallEnemy ;branch to leave also if d7 in state is set - lda FrameCounter - lsr ;get LSB of frame counter - bcs ExitFBallEnemy ;branch to leave if set (do routine every other frame) - txa - asl ;multiply fireball offset by four - asl - clc - adc #$1c ;then add $1c or 28 bytes to it - tay ;to use fireball's bounding box coordinates - ldx #$04 - -FireballEnemyCDLoop: - stx $01 ;store enemy object offset here - tya - pha ;push fireball offset to the stack - lda Enemy_State,x - and #%00100000 ;check to see if d5 is set in enemy state - bne NoFToECol ;if so, skip to next enemy slot - lda Enemy_Flag,x ;check to see if buffer flag is set - beq NoFToECol ;if not, skip to next enemy slot - lda Enemy_ID,x ;check enemy identifier - cmp #$24 - bcc GoombaDie ;if < $24, branch to check further - cmp #$2b - bcc NoFToECol ;if in range $24-$2a, skip to next enemy slot -GoombaDie: cmp #Goomba ;check for goomba identifier - bne NotGoomba ;if not found, continue with code - lda Enemy_State,x ;otherwise check for defeated state - cmp #$02 ;if stomped or otherwise defeated, - bcs NoFToECol ;skip to next enemy slot -NotGoomba: lda EnemyOffscrBitsMasked,x ;if any masked offscreen bits set, - bne NoFToECol ;skip to next enemy slot - txa - asl ;otherwise multiply enemy offset by four - asl - clc - adc #$04 ;add 4 bytes to it - tax ;to use enemy's bounding box coordinates - jsr SprObjectCollisionCore ;do fireball-to-enemy collision detection - ldx ObjectOffset ;return fireball's original offset - bcc NoFToECol ;if carry clear, no collision, thus do next enemy slot - lda #%10000000 - sta Fireball_State,x ;set d7 in enemy state - ldx $01 ;get enemy offset - jsr HandleEnemyFBallCol ;jump to handle fireball to enemy collision -NoFToECol: pla ;pull fireball offset from stack - tay ;put it in Y - ldx $01 ;get enemy object offset - dex ;decrement it - bpl FireballEnemyCDLoop ;loop back until collision detection done on all enemies - -ExitFBallEnemy: - ldx ObjectOffset ;get original fireball offset and leave - rts - -BowserIdentities: - .db Goomba, GreenKoopa, BuzzyBeetle, Spiny, Lakitu, Bloober, HammerBro, Bowser - -HandleEnemyFBallCol: - jsr RelativeEnemyPosition ;get relative coordinate of enemy - ldx $01 ;get current enemy object offset - lda Enemy_Flag,x ;check buffer flag for d7 set - bpl ChkBuzzyBeetle ;branch if not set to continue - and #%00001111 ;otherwise mask out high nybble and - tax ;use low nybble as enemy offset - lda Enemy_ID,x - cmp #Bowser ;check enemy identifier for bowser - beq HurtBowser ;branch if found - ldx $01 ;otherwise retrieve current enemy offset - -ChkBuzzyBeetle: - lda Enemy_ID,x - cmp #BuzzyBeetle ;check for buzzy beetle - beq ExHCF ;branch if found to leave (buzzy beetles fireproof) - cmp #Bowser ;check for bowser one more time (necessary if d7 of flag was clear) - bne ChkOtherEnemies ;if not found, branch to check other enemies - -HurtBowser: - dec BowserHitPoints ;decrement bowser's hit points - bne ExHCF ;if bowser still has hit points, branch to leave - jsr InitVStf ;otherwise do sub to init vertical speed and movement force - sta Enemy_X_Speed,x ;initialize horizontal speed - sta EnemyFrenzyBuffer ;init enemy frenzy buffer - lda #$fe - sta Enemy_Y_Speed,x ;set vertical speed to make defeated bowser jump a little - ldy WorldNumber ;use world number as offset - lda BowserIdentities,y ;get enemy identifier to replace bowser with - sta Enemy_ID,x ;set as new enemy identifier - lda #$20 ;set A to use starting value for state - cpy #$03 ;check to see if using offset of 3 or more - bcs SetDBSte ;branch if so - ora #$03 ;otherwise add 3 to enemy state -SetDBSte: sta Enemy_State,x ;set defeated enemy state - lda #Sfx_BowserFall - sta Square2SoundQueue ;load bowser defeat sound - ldx $01 ;get enemy offset - lda #$09 ;award 5000 points to player for defeating bowser - bne EnemySmackScore ;unconditional branch to award points - -ChkOtherEnemies: - cmp #BulletBill_FrenzyVar - beq ExHCF ;branch to leave if bullet bill (frenzy variant) - cmp #Podoboo - beq ExHCF ;branch to leave if podoboo - cmp #$15 - bcs ExHCF ;branch to leave if identifier => $15 - -ShellOrBlockDefeat: - lda Enemy_ID,x ;check for piranha plant - cmp #PiranhaPlant - bne StnE ;branch if not found - lda Enemy_Y_Position,x - adc #$18 ;add 24 pixels to enemy object's vertical position - sta Enemy_Y_Position,x -StnE: jsr ChkToStunEnemies ;do yet another sub - lda Enemy_State,x - and #%00011111 ;mask out 2 MSB of enemy object's state - ora #%00100000 ;set d5 to defeat enemy and save as new state - sta Enemy_State,x - lda #$02 ;award 200 points by default - ldy Enemy_ID,x ;check for hammer bro - cpy #HammerBro - bne GoombaPoints ;branch if not found - lda #$06 ;award 1000 points for hammer bro - -GoombaPoints: - cpy #Goomba ;check for goomba - bne EnemySmackScore ;branch if not found - lda #$01 ;award 100 points for goomba - -EnemySmackScore: - jsr SetupFloateyNumber ;update necessary score variables - lda #Sfx_EnemySmack ;play smack enemy sound - sta Square1SoundQueue -ExHCF: rts ;and now let's leave - -;------------------------------------------------------------------------------------- - -PlayerHammerCollision: - lda FrameCounter ;get frame counter - lsr ;shift d0 into carry - bcc ExPHC ;branch to leave if d0 not set to execute every other frame - lda TimerControl ;if either master timer control - ora Misc_OffscreenBits ;or any offscreen bits for hammer are set, - bne ExPHC ;branch to leave - txa - asl ;multiply misc object offset by four - asl - clc - adc #$24 ;add 36 or $24 bytes to get proper offset - tay ;for misc object bounding box coordinates - jsr PlayerCollisionCore ;do player-to-hammer collision detection - ldx ObjectOffset ;get misc object offset - bcc ClHCol ;if no collision, then branch - lda Misc_Collision_Flag,x ;otherwise read collision flag - bne ExPHC ;if collision flag already set, branch to leave - lda #$01 - sta Misc_Collision_Flag,x ;otherwise set collision flag now - lda Misc_X_Speed,x - eor #$ff ;get two's compliment of - clc ;hammer's horizontal speed - adc #$01 - sta Misc_X_Speed,x ;set to send hammer flying the opposite direction - lda StarInvincibleTimer ;if star mario invincibility timer set, - bne ExPHC ;branch to leave - jmp InjurePlayer ;otherwise jump to hurt player, do not return -ClHCol: lda #$00 ;clear collision flag - sta Misc_Collision_Flag,x -ExPHC: rts - -;------------------------------------------------------------------------------------- - -HandlePowerUpCollision: - jsr EraseEnemyObject ;erase the power-up object - lda #$06 - jsr SetupFloateyNumber ;award 1000 points to player by default - lda #Sfx_PowerUpGrab - sta Square2SoundQueue ;play the power-up sound - lda PowerUpType ;check power-up type - cmp #$02 - bcc Shroom_Flower_PUp ;if mushroom or fire flower, branch - cmp #$03 - beq SetFor1Up ;if 1-up mushroom, branch - lda #$23 ;otherwise set star mario invincibility - sta StarInvincibleTimer ;timer, and load the star mario music - lda #StarPowerMusic ;into the area music queue, then leave - sta AreaMusicQueue - rts - -Shroom_Flower_PUp: - lda PlayerStatus ;if player status = small, branch - beq UpToSuper - cmp #$01 ;if player status not super, leave - bne NoPUp - ldx ObjectOffset ;get enemy offset, not necessary - lda #$02 ;set player status to fiery - sta PlayerStatus - jsr GetPlayerColors ;run sub to change colors of player - ldx ObjectOffset ;get enemy offset again, and again not necessary - lda #$0c ;set value to be used by subroutine tree (fiery) - jmp UpToFiery ;jump to set values accordingly - -SetFor1Up: - lda #$0b ;change 1000 points into 1-up instead - sta FloateyNum_Control,x ;and then leave - rts - -UpToSuper: - lda #$01 ;set player status to super - sta PlayerStatus - lda #$09 ;set value to be used by subroutine tree (super) - -UpToFiery: - ldy #$00 ;set value to be used as new player state - jsr SetPRout ;set values to stop certain things in motion -NoPUp: rts - -;-------------------------------- - -ResidualXSpdData: - .db $18, $e8 - -KickedShellXSpdData: - .db $30, $d0 - -DemotedKoopaXSpdData: - .db $08, $f8 - -PlayerEnemyCollision: - lda FrameCounter ;check counter for d0 set - lsr - bcs NoPUp ;if set, branch to leave - jsr CheckPlayerVertical ;if player object is completely offscreen or - bcs NoPECol ;if down past 224th pixel row, branch to leave - lda EnemyOffscrBitsMasked,x ;if current enemy is offscreen by any amount, - bne NoPECol ;go ahead and branch to leave - lda GameEngineSubroutine - cmp #$08 ;if not set to run player control routine - bne NoPECol ;on next frame, branch to leave - lda Enemy_State,x - and #%00100000 ;if enemy state has d5 set, branch to leave - bne NoPECol - jsr GetEnemyBoundBoxOfs ;get bounding box offset for current enemy object - jsr PlayerCollisionCore ;do collision detection on player vs. enemy - ldx ObjectOffset ;get enemy object buffer offset - bcs CheckForPUpCollision ;if collision, branch past this part here - lda Enemy_CollisionBits,x - and #%11111110 ;otherwise, clear d0 of current enemy object's - sta Enemy_CollisionBits,x ;collision bit -NoPECol: rts - -CheckForPUpCollision: - ldy Enemy_ID,x - cpy #PowerUpObject ;check for power-up object - bne EColl ;if not found, branch to next part - jmp HandlePowerUpCollision ;otherwise, unconditional jump backwards -EColl: lda StarInvincibleTimer ;if star mario invincibility timer expired, - beq HandlePECollisions ;perform task here, otherwise kill enemy like - jmp ShellOrBlockDefeat ;hit with a shell, or from beneath - -KickedShellPtsData: - .db $0a, $06, $04 - -HandlePECollisions: - lda Enemy_CollisionBits,x ;check enemy collision bits for d0 set - and #%00000001 ;or for being offscreen at all - ora EnemyOffscrBitsMasked,x - bne ExPEC ;branch to leave if either is true - lda #$01 - ora Enemy_CollisionBits,x ;otherwise set d0 now - sta Enemy_CollisionBits,x - cpy #Spiny ;branch if spiny - beq ChkForPlayerInjury - cpy #PiranhaPlant ;branch if piranha plant - beq InjurePlayer - cpy #Podoboo ;branch if podoboo - beq InjurePlayer - cpy #BulletBill_CannonVar ;branch if bullet bill - beq ChkForPlayerInjury - cpy #$15 ;branch if object => $15 - bcs InjurePlayer - lda AreaType ;branch if water type level - beq InjurePlayer - lda Enemy_State,x ;branch if d7 of enemy state was set - asl - bcs ChkForPlayerInjury - lda Enemy_State,x ;mask out all but 3 LSB of enemy state - and #%00000111 - cmp #$02 ;branch if enemy is in normal or falling state - bcc ChkForPlayerInjury - lda Enemy_ID,x ;branch to leave if goomba in defeated state - cmp #Goomba - beq ExPEC - lda #Sfx_EnemySmack ;play smack enemy sound - sta Square1SoundQueue - lda Enemy_State,x ;set d7 in enemy state, thus become moving shell - ora #%10000000 - sta Enemy_State,x - jsr EnemyFacePlayer ;set moving direction and get offset - lda KickedShellXSpdData,y ;load and set horizontal speed data with offset - sta Enemy_X_Speed,x - lda #$03 ;add three to whatever the stomp counter contains - clc ;to give points for kicking the shell - adc StompChainCounter - ldy EnemyIntervalTimer,x ;check shell enemy's timer - cpy #$03 ;if above a certain point, branch using the points - bcs KSPts ;data obtained from the stomp counter + 3 - lda KickedShellPtsData,y ;otherwise, set points based on proximity to timer expiration -KSPts: jsr SetupFloateyNumber ;set values for floatey number now -ExPEC: rts ;leave!!! - -ChkForPlayerInjury: - lda Player_Y_Speed ;check player's vertical speed - bmi ChkInj ;perform procedure below if player moving upwards - bne EnemyStomped ;or not at all, and branch elsewhere if moving downwards -ChkInj: lda Enemy_ID,x ;branch if enemy object < $07 - cmp #Bloober - bcc ChkETmrs - lda Player_Y_Position ;add 12 pixels to player's vertical position - clc - adc #$0c - cmp Enemy_Y_Position,x ;compare modified player's position to enemy's position - bcc EnemyStomped ;branch if this player's position above (less than) enemy's -ChkETmrs: lda StompTimer ;check stomp timer - bne EnemyStomped ;branch if set - lda InjuryTimer ;check to see if injured invincibility timer still - bne ExInjColRoutines ;counting down, and branch elsewhere to leave if so - lda Player_Rel_XPos - cmp Enemy_Rel_XPos ;if player's relative position to the left of enemy's - bcc TInjE ;relative position, branch here - jmp ChkEnemyFaceRight ;otherwise do a jump here -TInjE: lda Enemy_MovingDir,x ;if enemy moving towards the left, - cmp #$01 ;branch, otherwise do a jump here - bne InjurePlayer ;to turn the enemy around - jmp LInj - -InjurePlayer: - lda InjuryTimer ;check again to see if injured invincibility timer is - bne ExInjColRoutines ;at zero, and branch to leave if so - -ForceInjury: - ldx PlayerStatus ;check player's status - beq KillPlayer ;branch if small - sta PlayerStatus ;otherwise set player's status to small - lda #$08 - sta InjuryTimer ;set injured invincibility timer - asl - sta Square1SoundQueue ;play pipedown/injury sound - jsr GetPlayerColors ;change player's palette if necessary - lda #$0a ;set subroutine to run on next frame -SetKRout: ldy #$01 ;set new player state -SetPRout: sta GameEngineSubroutine ;load new value to run subroutine on next frame - sty Player_State ;store new player state - ldy #$ff - sty TimerControl ;set master timer control flag to halt timers - iny - sty ScrollAmount ;initialize scroll speed - -ExInjColRoutines: - ldx ObjectOffset ;get enemy offset and leave - rts - -KillPlayer: - stx Player_X_Speed ;halt player's horizontal movement by initializing speed - inx - stx EventMusicQueue ;set event music queue to death music - lda #$fc - sta Player_Y_Speed ;set new vertical speed - lda #$0b ;set subroutine to run on next frame - bne SetKRout ;branch to set player's state and other things - -StompedEnemyPtsData: - .db $02, $06, $05, $06 - -EnemyStomped: - lda Enemy_ID,x ;check for spiny, branch to hurt player - cmp #Spiny ;if found - beq InjurePlayer - lda #Sfx_EnemyStomp ;otherwise play stomp/swim sound - sta Square1SoundQueue - lda Enemy_ID,x - ldy #$00 ;initialize points data offset for stomped enemies - cmp #FlyingCheepCheep ;branch for cheep-cheep - beq EnemyStompedPts - cmp #BulletBill_FrenzyVar ;branch for either bullet bill object - beq EnemyStompedPts - cmp #BulletBill_CannonVar - beq EnemyStompedPts - cmp #Podoboo ;branch for podoboo (this branch is logically impossible - beq EnemyStompedPts ;for cpu to take due to earlier checking of podoboo) - iny ;increment points data offset - cmp #HammerBro ;branch for hammer bro - beq EnemyStompedPts - iny ;increment points data offset - cmp #Lakitu ;branch for lakitu - beq EnemyStompedPts - iny ;increment points data offset - cmp #Bloober ;branch if NOT bloober - bne ChkForDemoteKoopa - -EnemyStompedPts: - lda StompedEnemyPtsData,y ;load points data using offset in Y - jsr SetupFloateyNumber ;run sub to set floatey number controls - lda Enemy_MovingDir,x - pha ;save enemy movement direction to stack - jsr SetStun ;run sub to kill enemy - pla - sta Enemy_MovingDir,x ;return enemy movement direction from stack - lda #%00100000 - sta Enemy_State,x ;set d5 in enemy state - jsr InitVStf ;nullify vertical speed, physics-related thing, - sta Enemy_X_Speed,x ;and horizontal speed - lda #$fd ;set player's vertical speed, to give bounce - sta Player_Y_Speed - rts - -ChkForDemoteKoopa: - cmp #$09 ;branch elsewhere if enemy object < $09 - bcc HandleStompedShellE - and #%00000001 ;demote koopa paratroopas to ordinary troopas - sta Enemy_ID,x - ldy #$00 ;return enemy to normal state - sty Enemy_State,x - lda #$03 ;award 400 points to the player - jsr SetupFloateyNumber - jsr InitVStf ;nullify physics-related thing and vertical speed - jsr EnemyFacePlayer ;turn enemy around if necessary - lda DemotedKoopaXSpdData,y - sta Enemy_X_Speed,x ;set appropriate moving speed based on direction - jmp SBnce ;then move onto something else - -RevivalRateData: - .db $10, $0b - -HandleStompedShellE: - lda #$04 ;set defeated state for enemy - sta Enemy_State,x - inc StompChainCounter ;increment the stomp counter - lda StompChainCounter ;add whatever is in the stomp counter - clc ;to whatever is in the stomp timer - adc StompTimer - jsr SetupFloateyNumber ;award points accordingly - inc StompTimer ;increment stomp timer of some sort - ldy PrimaryHardMode ;check primary hard mode flag - lda RevivalRateData,y ;load timer setting according to flag - sta EnemyIntervalTimer,x ;set as enemy timer to revive stomped enemy -SBnce: lda #$fc ;set player's vertical speed for bounce - sta Player_Y_Speed ;and then leave!!! - rts - -ChkEnemyFaceRight: - lda Enemy_MovingDir,x ;check to see if enemy is moving to the right - cmp #$01 - bne LInj ;if not, branch - jmp InjurePlayer ;otherwise go back to hurt player -LInj: jsr EnemyTurnAround ;turn the enemy around, if necessary - jmp InjurePlayer ;go back to hurt player - - -EnemyFacePlayer: - ldy #$01 ;set to move right by default - jsr PlayerEnemyDiff ;get horizontal difference between player and enemy - bpl SFcRt ;if enemy is to the right of player, do not increment - iny ;otherwise, increment to set to move to the left -SFcRt: sty Enemy_MovingDir,x ;set moving direction here - dey ;then decrement to use as a proper offset - rts - -SetupFloateyNumber: - sta FloateyNum_Control,x ;set number of points control for floatey numbers - lda #$30 - sta FloateyNum_Timer,x ;set timer for floatey numbers - lda Enemy_Y_Position,x - sta FloateyNum_Y_Pos,x ;set vertical coordinate - lda Enemy_Rel_XPos - sta FloateyNum_X_Pos,x ;set horizontal coordinate and leave -ExSFN: rts - -;------------------------------------------------------------------------------------- -;$01 - used to hold enemy offset for second enemy - -SetBitsMask: - .db %10000000, %01000000, %00100000, %00010000, %00001000, %00000100, %00000010 - -ClearBitsMask: - .db %01111111, %10111111, %11011111, %11101111, %11110111, %11111011, %11111101 - -EnemiesCollision: - lda FrameCounter ;check counter for d0 set - lsr - bcc ExSFN ;if d0 not set, leave - lda AreaType - beq ExSFN ;if water area type, leave - lda Enemy_ID,x - cmp #$15 ;if enemy object => $15, branch to leave - bcs ExitECRoutine - cmp #Lakitu ;if lakitu, branch to leave - beq ExitECRoutine - cmp #PiranhaPlant ;if piranha plant, branch to leave - beq ExitECRoutine - lda EnemyOffscrBitsMasked,x ;if masked offscreen bits nonzero, branch to leave - bne ExitECRoutine - jsr GetEnemyBoundBoxOfs ;otherwise, do sub, get appropriate bounding box offset for - dex ;first enemy we're going to compare, then decrement for second - bmi ExitECRoutine ;branch to leave if there are no other enemies -ECLoop: stx $01 ;save enemy object buffer offset for second enemy here - tya ;save first enemy's bounding box offset to stack - pha - lda Enemy_Flag,x ;check enemy object enable flag - beq ReadyNextEnemy ;branch if flag not set - lda Enemy_ID,x - cmp #$15 ;check for enemy object => $15 - bcs ReadyNextEnemy ;branch if true - cmp #Lakitu - beq ReadyNextEnemy ;branch if enemy object is lakitu - cmp #PiranhaPlant - beq ReadyNextEnemy ;branch if enemy object is piranha plant - lda EnemyOffscrBitsMasked,x - bne ReadyNextEnemy ;branch if masked offscreen bits set - txa ;get second enemy object's bounding box offset - asl ;multiply by four, then add four - asl - clc - adc #$04 - tax ;use as new contents of X - jsr SprObjectCollisionCore ;do collision detection using the two enemies here - ldx ObjectOffset ;use first enemy offset for X - ldy $01 ;use second enemy offset for Y - bcc NoEnemyCollision ;if carry clear, no collision, branch ahead of this - lda Enemy_State,x - ora Enemy_State,y ;check both enemy states for d7 set - and #%10000000 - bne YesEC ;branch if at least one of them is set - lda Enemy_CollisionBits,y ;load first enemy's collision-related bits - and SetBitsMask,x ;check to see if bit connected to second enemy is - bne ReadyNextEnemy ;already set, and move onto next enemy slot if set - lda Enemy_CollisionBits,y - ora SetBitsMask,x ;if the bit is not set, set it now - sta Enemy_CollisionBits,y -YesEC: jsr ProcEnemyCollisions ;react according to the nature of collision - jmp ReadyNextEnemy ;move onto next enemy slot - -NoEnemyCollision: - lda Enemy_CollisionBits,y ;load first enemy's collision-related bits - and ClearBitsMask,x ;clear bit connected to second enemy - sta Enemy_CollisionBits,y ;then move onto next enemy slot - -ReadyNextEnemy: - pla ;get first enemy's bounding box offset from the stack - tay ;use as Y again - ldx $01 ;get and decrement second enemy's object buffer offset - dex - bpl ECLoop ;loop until all enemy slots have been checked - -ExitECRoutine: - ldx ObjectOffset ;get enemy object buffer offset - rts ;leave - -ProcEnemyCollisions: - lda Enemy_State,y ;check both enemy states for d5 set - ora Enemy_State,x - and #%00100000 ;if d5 is set in either state, or both, branch - bne ExitProcessEColl ;to leave and do nothing else at this point - lda Enemy_State,x - cmp #$06 ;if second enemy state < $06, branch elsewhere - bcc ProcSecondEnemyColl - lda Enemy_ID,x ;check second enemy identifier for hammer bro - cmp #HammerBro ;if hammer bro found in alt state, branch to leave - beq ExitProcessEColl - lda Enemy_State,y ;check first enemy state for d7 set - asl - bcc ShellCollisions ;branch if d7 is clear - lda #$06 - jsr SetupFloateyNumber ;award 1000 points for killing enemy - jsr ShellOrBlockDefeat ;then kill enemy, then load - ldy $01 ;original offset of second enemy - -ShellCollisions: - tya ;move Y to X - tax - jsr ShellOrBlockDefeat ;kill second enemy - ldx ObjectOffset - lda ShellChainCounter,x ;get chain counter for shell - clc - adc #$04 ;add four to get appropriate point offset - ldx $01 - jsr SetupFloateyNumber ;award appropriate number of points for second enemy - ldx ObjectOffset ;load original offset of first enemy - inc ShellChainCounter,x ;increment chain counter for additional enemies - -ExitProcessEColl: - rts ;leave!!! - -ProcSecondEnemyColl: - lda Enemy_State,y ;if first enemy state < $06, branch elsewhere - cmp #$06 - bcc MoveEOfs - lda Enemy_ID,y ;check first enemy identifier for hammer bro - cmp #HammerBro ;if hammer bro found in alt state, branch to leave - beq ExitProcessEColl - jsr ShellOrBlockDefeat ;otherwise, kill first enemy - ldy $01 - lda ShellChainCounter,y ;get chain counter for shell - clc - adc #$04 ;add four to get appropriate point offset - ldx ObjectOffset - jsr SetupFloateyNumber ;award appropriate number of points for first enemy - ldx $01 ;load original offset of second enemy - inc ShellChainCounter,x ;increment chain counter for additional enemies - rts ;leave!!! - -MoveEOfs: - tya ;move Y ($01) to X - tax - jsr EnemyTurnAround ;do the sub here using value from $01 - ldx ObjectOffset ;then do it again using value from $08 - -EnemyTurnAround: - lda Enemy_ID,x ;check for specific enemies - cmp #PiranhaPlant - beq ExTA ;if piranha plant, leave - cmp #Lakitu - beq ExTA ;if lakitu, leave - cmp #HammerBro - beq ExTA ;if hammer bro, leave - cmp #Spiny - beq RXSpd ;if spiny, turn it around - cmp #GreenParatroopaJump - beq RXSpd ;if green paratroopa, turn it around - cmp #$07 - bcs ExTA ;if any OTHER enemy object => $07, leave -RXSpd: lda Enemy_X_Speed,x ;load horizontal speed - eor #$ff ;get two's compliment for horizontal speed - tay - iny - sty Enemy_X_Speed,x ;store as new horizontal speed - lda Enemy_MovingDir,x - eor #%00000011 ;invert moving direction and store, then leave - sta Enemy_MovingDir,x ;thus effectively turning the enemy around -ExTA: rts ;leave!!! - -;------------------------------------------------------------------------------------- -;$00 - vertical position of platform - -LargePlatformCollision: - lda #$ff ;save value here - sta PlatformCollisionFlag,x - lda TimerControl ;check master timer control - bne ExLPC ;if set, branch to leave - lda Enemy_State,x ;if d7 set in object state, - bmi ExLPC ;branch to leave - lda Enemy_ID,x - cmp #$24 ;check enemy object identifier for - bne ChkForPlayerC_LargeP ;balance platform, branch if not found - lda Enemy_State,x - tax ;set state as enemy offset here - jsr ChkForPlayerC_LargeP ;perform code with state offset, then original offset, in X - -ChkForPlayerC_LargeP: - jsr CheckPlayerVertical ;figure out if player is below a certain point - bcs ExLPC ;or offscreen, branch to leave if true - txa - jsr GetEnemyBoundBoxOfsArg ;get bounding box offset in Y - lda Enemy_Y_Position,x ;store vertical coordinate in - sta $00 ;temp variable for now - txa ;send offset we're on to the stack - pha - jsr PlayerCollisionCore ;do player-to-platform collision detection - pla ;retrieve offset from the stack - tax - bcc ExLPC ;if no collision, branch to leave - jsr ProcLPlatCollisions ;otherwise collision, perform sub -ExLPC: ldx ObjectOffset ;get enemy object buffer offset and leave - rts - -;-------------------------------- -;$00 - counter for bounding boxes - -SmallPlatformCollision: - lda TimerControl ;if master timer control set, - bne ExSPC ;branch to leave - sta PlatformCollisionFlag,x ;otherwise initialize collision flag - jsr CheckPlayerVertical ;do a sub to see if player is below a certain point - bcs ExSPC ;or entirely offscreen, and branch to leave if true - lda #$02 - sta $00 ;load counter here for 2 bounding boxes - -ChkSmallPlatLoop: - ldx ObjectOffset ;get enemy object offset - jsr GetEnemyBoundBoxOfs ;get bounding box offset in Y - and #%00000010 ;if d1 of offscreen lower nybble bits was set - bne ExSPC ;then branch to leave - lda BoundingBox_UL_YPos,y ;check top of platform's bounding box for being - cmp #$20 ;above a specific point - bcc MoveBoundBox ;if so, branch, don't do collision detection - jsr PlayerCollisionCore ;otherwise, perform player-to-platform collision detection - bcs ProcSPlatCollisions ;skip ahead if collision - -MoveBoundBox: - lda BoundingBox_UL_YPos,y ;move bounding box vertical coordinates - clc ;128 pixels downwards - adc #$80 - sta BoundingBox_UL_YPos,y - lda BoundingBox_DR_YPos,y - clc - adc #$80 - sta BoundingBox_DR_YPos,y - dec $00 ;decrement counter we set earlier - bne ChkSmallPlatLoop ;loop back until both bounding boxes are checked -ExSPC: ldx ObjectOffset ;get enemy object buffer offset, then leave - rts - -;-------------------------------- - -ProcSPlatCollisions: - ldx ObjectOffset ;return enemy object buffer offset to X, then continue - -ProcLPlatCollisions: - lda BoundingBox_DR_YPos,y ;get difference by subtracting the top - sec ;of the player's bounding box from the bottom - sbc BoundingBox_UL_YPos ;of the platform's bounding box - cmp #$04 ;if difference too large or negative, - bcs ChkForTopCollision ;branch, do not alter vertical speed of player - lda Player_Y_Speed ;check to see if player's vertical speed is moving down - bpl ChkForTopCollision ;if so, don't mess with it - lda #$01 ;otherwise, set vertical - sta Player_Y_Speed ;speed of player to kill jump - -ChkForTopCollision: - lda BoundingBox_DR_YPos ;get difference by subtracting the top - sec ;of the platform's bounding box from the bottom - sbc BoundingBox_UL_YPos,y ;of the player's bounding box - cmp #$06 - bcs PlatformSideCollisions ;if difference not close enough, skip all of this - lda Player_Y_Speed - bmi PlatformSideCollisions ;if player's vertical speed moving upwards, skip this - lda $00 ;get saved bounding box counter from earlier - ldy Enemy_ID,x - cpy #$2b ;if either of the two small platform objects are found, - beq SetCollisionFlag ;regardless of which one, branch to use bounding box counter - cpy #$2c ;as contents of collision flag - beq SetCollisionFlag - txa ;otherwise use enemy object buffer offset - -SetCollisionFlag: - ldx ObjectOffset ;get enemy object buffer offset - sta PlatformCollisionFlag,x ;save either bounding box counter or enemy offset here - lda #$00 - sta Player_State ;set player state to normal then leave - rts - -PlatformSideCollisions: - lda #$01 ;set value here to indicate possible horizontal - sta $00 ;collision on left side of platform - lda BoundingBox_DR_XPos ;get difference by subtracting platform's left edge - sec ;from player's right edge - sbc BoundingBox_UL_XPos,y - cmp #$08 ;if difference close enough, skip all of this - bcc SideC - inc $00 ;otherwise increment value set here for right side collision - lda BoundingBox_DR_XPos,y ;get difference by subtracting player's left edge - clc ;from platform's right edge - sbc BoundingBox_UL_XPos - cmp #$09 ;if difference not close enough, skip subroutine - bcs NoSideC ;and instead branch to leave (no collision) -SideC: jsr ImpedePlayerMove ;deal with horizontal collision -NoSideC: ldx ObjectOffset ;return with enemy object buffer offset - rts - -;------------------------------------------------------------------------------------- - -PlayerPosSPlatData: - .db $80, $00 - -PositionPlayerOnS_Plat: - tay ;use bounding box counter saved in collision flag - lda Enemy_Y_Position,x ;for offset - clc ;add positioning data using offset to the vertical - adc PlayerPosSPlatData-1,y ;coordinate - .db $2c ;BIT instruction opcode - -PositionPlayerOnVPlat: - lda Enemy_Y_Position,x ;get vertical coordinate - ldy GameEngineSubroutine - cpy #$0b ;if certain routine being executed on this frame, - beq ExPlPos ;skip all of this - ldy Enemy_Y_HighPos,x - cpy #$01 ;if vertical high byte offscreen, skip this - bne ExPlPos - sec ;subtract 32 pixels from vertical coordinate - sbc #$20 ;for the player object's height - sta Player_Y_Position ;save as player's new vertical coordinate - tya - sbc #$00 ;subtract borrow and store as player's - sta Player_Y_HighPos ;new vertical high byte - lda #$00 - sta Player_Y_Speed ;initialize vertical speed and low byte of force - sta Player_Y_MoveForce ;and then leave -ExPlPos: rts - -;------------------------------------------------------------------------------------- - -CheckPlayerVertical: - lda Player_OffscreenBits ;if player object is completely offscreen - cmp #$f0 ;vertically, leave this routine - bcs ExCPV - ldy Player_Y_HighPos ;if player high vertical byte is not - dey ;within the screen, leave this routine - bne ExCPV - lda Player_Y_Position ;if on the screen, check to see how far down - cmp #$d0 ;the player is vertically -ExCPV: rts - -;------------------------------------------------------------------------------------- - -GetEnemyBoundBoxOfs: - lda ObjectOffset ;get enemy object buffer offset - -GetEnemyBoundBoxOfsArg: - asl ;multiply A by four, then add four - asl ;to skip player's bounding box - clc - adc #$04 - tay ;send to Y - lda Enemy_OffscreenBits ;get offscreen bits for enemy object - and #%00001111 ;save low nybble - cmp #%00001111 ;check for all bits set - rts - -;------------------------------------------------------------------------------------- -;$00-$01 - used to hold many values, essentially temp variables -;$04 - holds lower nybble of vertical coordinate from block buffer routine -;$eb - used to hold block buffer adder - -PlayerBGUpperExtent: - .db $20, $10 - -PlayerBGCollision: - lda DisableCollisionDet ;if collision detection disabled flag set, - bne ExPBGCol ;branch to leave - lda GameEngineSubroutine - cmp #$0b ;if running routine #11 or $0b - beq ExPBGCol ;branch to leave - cmp #$04 - bcc ExPBGCol ;if running routines $00-$03 branch to leave - lda #$01 ;load default player state for swimming - ldy SwimmingFlag ;if swimming flag set, - bne SetPSte ;branch ahead to set default state - lda Player_State ;if player in normal state, - beq SetFallS ;branch to set default state for falling - cmp #$03 - bne ChkOnScr ;if in any other state besides climbing, skip to next part -SetFallS: lda #$02 ;load default player state for falling -SetPSte: sta Player_State ;set whatever player state is appropriate -ChkOnScr: lda Player_Y_HighPos - cmp #$01 ;check player's vertical high byte for still on the screen - bne ExPBGCol ;branch to leave if not - lda #$ff - sta Player_CollisionBits ;initialize player's collision flag - lda Player_Y_Position - cmp #$cf ;check player's vertical coordinate - bcc ChkCollSize ;if not too close to the bottom of screen, continue -ExPBGCol: rts ;otherwise leave - -ChkCollSize: - ldy #$02 ;load default offset - lda CrouchingFlag - bne GBBAdr ;if player crouching, skip ahead - lda PlayerSize - bne GBBAdr ;if player small, skip ahead - dey ;otherwise decrement offset for big player not crouching - lda SwimmingFlag - bne GBBAdr ;if swimming flag set, skip ahead - dey ;otherwise decrement offset -GBBAdr: lda BlockBufferAdderData,y ;get value using offset - sta $eb ;store value here - tay ;put value into Y, as offset for block buffer routine - ldx PlayerSize ;get player's size as offset - lda CrouchingFlag - beq HeadChk ;if player not crouching, branch ahead - inx ;otherwise increment size as offset -HeadChk: lda Player_Y_Position ;get player's vertical coordinate - cmp PlayerBGUpperExtent,x ;compare with upper extent value based on offset - bcc DoFootCheck ;if player is too high, skip this part - jsr BlockBufferColli_Head ;do player-to-bg collision detection on top of - beq DoFootCheck ;player, and branch if nothing above player's head - jsr CheckForCoinMTiles ;check to see if player touched coin with their head - bcs AwardTouchedCoin ;if so, branch to some other part of code - ldy Player_Y_Speed ;check player's vertical speed - bpl DoFootCheck ;if player not moving upwards, branch elsewhere - ldy $04 ;check lower nybble of vertical coordinate returned - cpy #$04 ;from collision detection routine - bcc DoFootCheck ;if low nybble < 4, branch - jsr CheckForSolidMTiles ;check to see what player's head bumped on - bcs SolidOrClimb ;if player collided with solid metatile, branch - ldy AreaType ;otherwise check area type - beq NYSpd ;if water level, branch ahead - ldy BlockBounceTimer ;if block bounce timer not expired, - bne NYSpd ;branch ahead, do not process collision - jsr PlayerHeadCollision ;otherwise do a sub to process collision - jmp DoFootCheck ;jump ahead to skip these other parts here - -SolidOrClimb: - cmp #$26 ;if climbing metatile, - beq NYSpd ;branch ahead and do not play sound - lda #Sfx_Bump - sta Square1SoundQueue ;otherwise load bump sound -NYSpd: lda #$01 ;set player's vertical speed to nullify - sta Player_Y_Speed ;jump or swim - -DoFootCheck: - ldy $eb ;get block buffer adder offset - lda Player_Y_Position - cmp #$cf ;check to see how low player is - bcs DoPlayerSideCheck ;if player is too far down on screen, skip all of this - jsr BlockBufferColli_Feet ;do player-to-bg collision detection on bottom left of player - jsr CheckForCoinMTiles ;check to see if player touched coin with their left foot - bcs AwardTouchedCoin ;if so, branch to some other part of code - pha ;save bottom left metatile to stack - jsr BlockBufferColli_Feet ;do player-to-bg collision detection on bottom right of player - sta $00 ;save bottom right metatile here - pla - sta $01 ;pull bottom left metatile and save here - bne ChkFootMTile ;if anything here, skip this part - lda $00 ;otherwise check for anything in bottom right metatile - beq DoPlayerSideCheck ;and skip ahead if not - jsr CheckForCoinMTiles ;check to see if player touched coin with their right foot - bcc ChkFootMTile ;if not, skip unconditional jump and continue code - -AwardTouchedCoin: - jmp HandleCoinMetatile ;follow the code to erase coin and award to player 1 coin - -ChkFootMTile: - jsr CheckForClimbMTiles ;check to see if player landed on climbable metatiles - bcs DoPlayerSideCheck ;if so, branch - ldy Player_Y_Speed ;check player's vertical speed - bmi DoPlayerSideCheck ;if player moving upwards, branch - cmp #$c5 - bne ContChk ;if player did not touch axe, skip ahead - jmp HandleAxeMetatile ;otherwise jump to set modes of operation -ContChk: jsr ChkInvisibleMTiles ;do sub to check for hidden coin or 1-up blocks - beq DoPlayerSideCheck ;if either found, branch - ldy JumpspringAnimCtrl ;if jumpspring animating right now, - bne InitSteP ;branch ahead - ldy $04 ;check lower nybble of vertical coordinate returned - cpy #$05 ;from collision detection routine - bcc LandPlyr ;if lower nybble < 5, branch - lda Player_MovingDir - sta $00 ;use player's moving direction as temp variable - jmp ImpedePlayerMove ;jump to impede player's movement in that direction -LandPlyr: jsr ChkForLandJumpSpring ;do sub to check for jumpspring metatiles and deal with it - lda #$f0 - and Player_Y_Position ;mask out lower nybble of player's vertical position - sta Player_Y_Position ;and store as new vertical position to land player properly - jsr HandlePipeEntry ;do sub to process potential pipe entry - lda #$00 - sta Player_Y_Speed ;initialize vertical speed and fractional - sta Player_Y_MoveForce ;movement force to stop player's vertical movement - sta StompChainCounter ;initialize enemy stomp counter -InitSteP: lda #$00 - sta Player_State ;set player's state to normal - -DoPlayerSideCheck: - ldy $eb ;get block buffer adder offset - iny - iny ;increment offset 2 bytes to use adders for side collisions - lda #$02 ;set value here to be used as counter - sta $00 - -SideCheckLoop: - iny ;move onto the next one - sty $eb ;store it - lda Player_Y_Position - cmp #$20 ;check player's vertical position - bcc BHalf ;if player is in status bar area, branch ahead to skip this part - cmp #$e4 - bcs ExSCH ;branch to leave if player is too far down - jsr BlockBufferColli_Side ;do player-to-bg collision detection on one half of player - beq BHalf ;branch ahead if nothing found - cmp #$1c ;otherwise check for pipe metatiles - beq BHalf ;if collided with sideways pipe (top), branch ahead - cmp #$6b - beq BHalf ;if collided with water pipe (top), branch ahead - jsr CheckForClimbMTiles ;do sub to see if player bumped into anything climbable - bcc CheckSideMTiles ;if not, branch to alternate section of code -BHalf: ldy $eb ;load block adder offset - iny ;increment it - lda Player_Y_Position ;get player's vertical position - cmp #$08 - bcc ExSCH ;if too high, branch to leave - cmp #$d0 - bcs ExSCH ;if too low, branch to leave - jsr BlockBufferColli_Side ;do player-to-bg collision detection on other half of player - bne CheckSideMTiles ;if something found, branch - dec $00 ;otherwise decrement counter - bne SideCheckLoop ;run code until both sides of player are checked -ExSCH: rts ;leave - -CheckSideMTiles: - jsr ChkInvisibleMTiles ;check for hidden or coin 1-up blocks - beq ExCSM ;branch to leave if either found - jsr CheckForClimbMTiles ;check for climbable metatiles - bcc ContSChk ;if not found, skip and continue with code - jmp HandleClimbing ;otherwise jump to handle climbing -ContSChk: jsr CheckForCoinMTiles ;check to see if player touched coin - bcs HandleCoinMetatile ;if so, execute code to erase coin and award to player 1 coin - jsr ChkJumpspringMetatiles ;check for jumpspring metatiles - bcc ChkPBtm ;if not found, branch ahead to continue cude - lda JumpspringAnimCtrl ;otherwise check jumpspring animation control - bne ExCSM ;branch to leave if set - jmp StopPlayerMove ;otherwise jump to impede player's movement -ChkPBtm: ldy Player_State ;get player's state - cpy #$00 ;check for player's state set to normal - bne StopPlayerMove ;if not, branch to impede player's movement - ldy PlayerFacingDir ;get player's facing direction - dey - bne StopPlayerMove ;if facing left, branch to impede movement - cmp #$6c ;otherwise check for pipe metatiles - beq PipeDwnS ;if collided with sideways pipe (bottom), branch - cmp #$1f ;if collided with water pipe (bottom), continue - bne StopPlayerMove ;otherwise branch to impede player's movement -PipeDwnS: lda Player_SprAttrib ;check player's attributes - bne PlyrPipe ;if already set, branch, do not play sound again - ldy #Sfx_PipeDown_Injury - sty Square1SoundQueue ;otherwise load pipedown/injury sound -PlyrPipe: ora #%00100000 - sta Player_SprAttrib ;set background priority bit in player attributes - lda Player_X_Position - and #%00001111 ;get lower nybble of player's horizontal coordinate - beq ChkGERtn ;if at zero, branch ahead to skip this part - ldy #$00 ;set default offset for timer setting data - lda ScreenLeft_PageLoc ;load page location for left side of screen - beq SetCATmr ;if at page zero, use default offset - iny ;otherwise increment offset -SetCATmr: lda AreaChangeTimerData,y ;set timer for change of area as appropriate - sta ChangeAreaTimer -ChkGERtn: lda GameEngineSubroutine ;get number of game engine routine running - cmp #$07 - beq ExCSM ;if running player entrance routine or - cmp #$08 ;player control routine, go ahead and branch to leave - bne ExCSM - lda #$02 - sta GameEngineSubroutine ;otherwise set sideways pipe entry routine to run - rts ;and leave - -;-------------------------------- -;$02 - high nybble of vertical coordinate from block buffer -;$04 - low nybble of horizontal coordinate from block buffer -;$06-$07 - block buffer address - -StopPlayerMove: - jsr ImpedePlayerMove ;stop player's movement -ExCSM: rts ;leave - -AreaChangeTimerData: - .db $a0, $34 - -HandleCoinMetatile: - jsr ErACM ;do sub to erase coin metatile from block buffer - inc CoinTallyFor1Ups ;increment coin tally used for 1-up blocks - jmp GiveOneCoin ;update coin amount and tally on the screen - -HandleAxeMetatile: - lda #$00 - sta OperMode_Task ;reset secondary mode - lda #$02 - sta OperMode ;set primary mode to autoctrl mode - lda #$18 - sta Player_X_Speed ;set horizontal speed and continue to erase axe metatile -ErACM: ldy $02 ;load vertical high nybble offset for block buffer - lda #$00 ;load blank metatile - sta ($06),y ;store to remove old contents from block buffer - jmp RemoveCoin_Axe ;update the screen accordingly - -;-------------------------------- -;$02 - high nybble of vertical coordinate from block buffer -;$04 - low nybble of horizontal coordinate from block buffer -;$06-$07 - block buffer address - -ClimbXPosAdder: - .db $f9, $07 - -ClimbPLocAdder: - .db $ff, $00 - -FlagpoleYPosData: - .db $18, $22, $50, $68, $90 - -HandleClimbing: - ldy $04 ;check low nybble of horizontal coordinate returned from - cpy #$06 ;collision detection routine against certain values, this - bcc ExHC ;makes actual physical part of vine or flagpole thinner - cpy #$0a ;than 16 pixels - bcc ChkForFlagpole -ExHC: rts ;leave if too far left or too far right - -ChkForFlagpole: - cmp #$24 ;check climbing metatiles - beq FlagpoleCollision ;branch if flagpole ball found - cmp #$25 - bne VineCollision ;branch to alternate code if flagpole shaft not found - -FlagpoleCollision: - lda GameEngineSubroutine - cmp #$05 ;check for end-of-level routine running - beq PutPlayerOnVine ;if running, branch to end of climbing code - lda #$01 - sta PlayerFacingDir ;set player's facing direction to right - inc ScrollLock ;set scroll lock flag - lda GameEngineSubroutine - cmp #$04 ;check for flagpole slide routine running - beq RunFR ;if running, branch to end of flagpole code here - lda #BulletBill_CannonVar ;load identifier for bullet bills (cannon variant) - jsr KillEnemies ;get rid of them - lda #Silence - sta EventMusicQueue ;silence music - lsr - sta FlagpoleSoundQueue ;load flagpole sound into flagpole sound queue - ldx #$04 ;start at end of vertical coordinate data - lda Player_Y_Position - sta FlagpoleCollisionYPos ;store player's vertical coordinate here to be used later - -ChkFlagpoleYPosLoop: - cmp FlagpoleYPosData,x ;compare with current vertical coordinate data - bcs MtchF ;if player's => current, branch to use current offset - dex ;otherwise decrement offset to use - bne ChkFlagpoleYPosLoop ;do this until all data is checked (use last one if all checked) -MtchF: stx FlagpoleScore ;store offset here to be used later -RunFR: lda #$04 - sta GameEngineSubroutine ;set value to run flagpole slide routine - jmp PutPlayerOnVine ;jump to end of climbing code - -VineCollision: - cmp #$26 ;check for climbing metatile used on vines - bne PutPlayerOnVine - lda Player_Y_Position ;check player's vertical coordinate - cmp #$20 ;for being in status bar area - bcs PutPlayerOnVine ;branch if not that far up - lda #$01 - sta GameEngineSubroutine ;otherwise set to run autoclimb routine next frame - -PutPlayerOnVine: - lda #$03 ;set player state to climbing - sta Player_State - lda #$00 ;nullify player's horizontal speed - sta Player_X_Speed ;and fractional horizontal movement force - sta Player_X_MoveForce - lda Player_X_Position ;get player's horizontal coordinate - sec - sbc ScreenLeft_X_Pos ;subtract from left side horizontal coordinate - cmp #$10 - bcs SetVXPl ;if 16 or more pixels difference, do not alter facing direction - lda #$02 - sta PlayerFacingDir ;otherwise force player to face left -SetVXPl: ldy PlayerFacingDir ;get current facing direction, use as offset - lda $06 ;get low byte of block buffer address - asl - asl ;move low nybble to high - asl - asl - clc - adc ClimbXPosAdder-1,y ;add pixels depending on facing direction - sta Player_X_Position ;store as player's horizontal coordinate - lda $06 ;get low byte of block buffer address again - bne ExPVne ;if not zero, branch - lda ScreenRight_PageLoc ;load page location of right side of screen - clc - adc ClimbPLocAdder-1,y ;add depending on facing location - sta Player_PageLoc ;store as player's page location -ExPVne: rts ;finally, we're done! - -;-------------------------------- - -ChkInvisibleMTiles: - cmp #$5f ;check for hidden coin block - beq ExCInvT ;branch to leave if found - cmp #$60 ;check for hidden 1-up block -ExCInvT: rts ;leave with zero flag set if either found - -;-------------------------------- -;$00-$01 - used to hold bottom right and bottom left metatiles (in that order) -;$00 - used as flag by ImpedePlayerMove to restrict specific movement - -ChkForLandJumpSpring: - jsr ChkJumpspringMetatiles ;do sub to check if player landed on jumpspring - bcc ExCJSp ;if carry not set, jumpspring not found, therefore leave - lda #$70 - sta VerticalForce ;otherwise set vertical movement force for player - lda #$f9 - sta JumpspringForce ;set default jumpspring force - lda #$03 - sta JumpspringTimer ;set jumpspring timer to be used later - lsr - sta JumpspringAnimCtrl ;set jumpspring animation control to start animating -ExCJSp: rts ;and leave - -ChkJumpspringMetatiles: - cmp #$67 ;check for top jumpspring metatile - beq JSFnd ;branch to set carry if found - cmp #$68 ;check for bottom jumpspring metatile - clc ;clear carry flag - bne NoJSFnd ;branch to use cleared carry if not found -JSFnd: sec ;set carry if found -NoJSFnd: rts ;leave - -HandlePipeEntry: - lda Up_Down_Buttons ;check saved controller bits from earlier - and #%00000100 ;for pressing down - beq ExPipeE ;if not pressing down, branch to leave - lda $00 - cmp #$11 ;check right foot metatile for warp pipe right metatile - bne ExPipeE ;branch to leave if not found - lda $01 - cmp #$10 ;check left foot metatile for warp pipe left metatile - bne ExPipeE ;branch to leave if not found - lda #$30 - sta ChangeAreaTimer ;set timer for change of area - lda #$03 - sta GameEngineSubroutine ;set to run vertical pipe entry routine on next frame - lda #Sfx_PipeDown_Injury - sta Square1SoundQueue ;load pipedown/injury sound - lda #%00100000 - sta Player_SprAttrib ;set background priority bit in player's attributes - lda WarpZoneControl ;check warp zone control - beq ExPipeE ;branch to leave if none found - and #%00000011 ;mask out all but 2 LSB - asl - asl ;multiply by four - tax ;save as offset to warp zone numbers (starts at left pipe) - lda Player_X_Position ;get player's horizontal position - cmp #$60 - bcc GetWNum ;if player at left, not near middle, use offset and skip ahead - inx ;otherwise increment for middle pipe - cmp #$a0 - bcc GetWNum ;if player at middle, but not too far right, use offset and skip - inx ;otherwise increment for last pipe -GetWNum: ldy WarpZoneNumbers,x ;get warp zone numbers - dey ;decrement for use as world number - sty WorldNumber ;store as world number and offset - ldx WorldAddrOffsets,y ;get offset to where this world's area offsets are - lda AreaAddrOffsets,x ;get area offset based on world offset - sta AreaPointer ;store area offset here to be used to change areas - lda #Silence - sta EventMusicQueue ;silence music - lda #$00 - sta EntrancePage ;initialize starting page number - sta AreaNumber ;initialize area number used for area address offset - sta LevelNumber ;initialize level number used for world display - sta AltEntranceControl ;initialize mode of entry - inc Hidden1UpFlag ;set flag for hidden 1-up blocks - inc FetchNewGameTimerFlag ;set flag to load new game timer -ExPipeE: rts ;leave!!! - -ImpedePlayerMove: - lda #$00 ;initialize value here - ldy Player_X_Speed ;get player's horizontal speed - ldx $00 ;check value set earlier for - dex ;left side collision - bne RImpd ;if right side collision, skip this part - inx ;return value to X - cpy #$00 ;if player moving to the left, - bmi ExIPM ;branch to invert bit and leave - lda #$ff ;otherwise load A with value to be used later - jmp NXSpd ;and jump to affect movement -RImpd: ldx #$02 ;return $02 to X - cpy #$01 ;if player moving to the right, - bpl ExIPM ;branch to invert bit and leave - lda #$01 ;otherwise load A with value to be used here -NXSpd: ldy #$10 - sty SideCollisionTimer ;set timer of some sort - ldy #$00 - sty Player_X_Speed ;nullify player's horizontal speed - cmp #$00 ;if value set in A not set to $ff, - bpl PlatF ;branch ahead, do not decrement Y - dey ;otherwise decrement Y now -PlatF: sty $00 ;store Y as high bits of horizontal adder - clc - adc Player_X_Position ;add contents of A to player's horizontal - sta Player_X_Position ;position to move player left or right - lda Player_PageLoc - adc $00 ;add high bits and carry to - sta Player_PageLoc ;page location if necessary -ExIPM: txa ;invert contents of X - eor #$ff - and Player_CollisionBits ;mask out bit that was set here - sta Player_CollisionBits ;store to clear bit - rts - -;-------------------------------- - -SolidMTileUpperExt: - .db $10, $61, $88, $c4 - -CheckForSolidMTiles: - jsr GetMTileAttrib ;find appropriate offset based on metatile's 2 MSB - cmp SolidMTileUpperExt,x ;compare current metatile with solid metatiles - rts - -ClimbMTileUpperExt: - .db $24, $6d, $8a, $c6 - -CheckForClimbMTiles: - jsr GetMTileAttrib ;find appropriate offset based on metatile's 2 MSB - cmp ClimbMTileUpperExt,x ;compare current metatile with climbable metatiles - rts - -CheckForCoinMTiles: - cmp #$c2 ;check for regular coin - beq CoinSd ;branch if found - cmp #$c3 ;check for underwater coin - beq CoinSd ;branch if found - clc ;otherwise clear carry and leave - rts -CoinSd: lda #Sfx_CoinGrab - sta Square2SoundQueue ;load coin grab sound and leave - rts - -GetMTileAttrib: - tay ;save metatile value into Y - and #%11000000 ;mask out all but 2 MSB - asl - rol ;shift and rotate d7-d6 to d1-d0 - rol - tax ;use as offset for metatile data - tya ;get original metatile value back -ExEBG: rts ;leave - -;------------------------------------------------------------------------------------- -;$06-$07 - address from block buffer routine - -EnemyBGCStateData: - .db $01, $01, $02, $02, $02, $05 - -EnemyBGCXSpdData: - .db $10, $f0 - -EnemyToBGCollisionDet: - lda Enemy_State,x ;check enemy state for d6 set - and #%00100000 - bne ExEBG ;if set, branch to leave - jsr SubtEnemyYPos ;otherwise, do a subroutine here - bcc ExEBG ;if enemy vertical coord + 62 < 68, branch to leave - ldy Enemy_ID,x - cpy #Spiny ;if enemy object is not spiny, branch elsewhere - bne DoIDCheckBGColl - lda Enemy_Y_Position,x - cmp #$25 ;if enemy vertical coordinate < 36 branch to leave - bcc ExEBG - -DoIDCheckBGColl: - cpy #GreenParatroopaJump ;check for some other enemy object - bne HBChk ;branch if not found - jmp EnemyJump ;otherwise jump elsewhere -HBChk: cpy #HammerBro ;check for hammer bro - bne CInvu ;branch if not found - jmp HammerBroBGColl ;otherwise jump elsewhere -CInvu: cpy #Spiny ;if enemy object is spiny, branch - beq YesIn - cpy #PowerUpObject ;if special power-up object, branch - beq YesIn - cpy #$07 ;if enemy object =>$07, branch to leave - bcs ExEBGChk -YesIn: jsr ChkUnderEnemy ;if enemy object < $07, or = $12 or $2e, do this sub - bne HandleEToBGCollision ;if block underneath enemy, branch - -NoEToBGCollision: - jmp ChkForRedKoopa ;otherwise skip and do something else - -;-------------------------------- -;$02 - vertical coordinate from block buffer routine - -HandleEToBGCollision: - jsr ChkForNonSolids ;if something is underneath enemy, find out what - beq NoEToBGCollision ;if blank $26, coins, or hidden blocks, jump, enemy falls through - cmp #$23 - bne LandEnemyProperly ;check for blank metatile $23 and branch if not found - ldy $02 ;get vertical coordinate used to find block - lda #$00 ;store default blank metatile in that spot so we won't - sta ($06),y ;trigger this routine accidentally again - lda Enemy_ID,x - cmp #$15 ;if enemy object => $15, branch ahead - bcs ChkToStunEnemies - cmp #Goomba ;if enemy object not goomba, branch ahead of this routine - bne GiveOEPoints - jsr KillEnemyAboveBlock ;if enemy object IS goomba, do this sub - -GiveOEPoints: - lda #$01 ;award 100 points for hitting block beneath enemy - jsr SetupFloateyNumber - -ChkToStunEnemies: - cmp #$09 ;perform many comparisons on enemy object identifier - bcc SetStun - cmp #$11 ;if the enemy object identifier is equal to the values - bcs SetStun ;$09, $0e, $0f or $10, it will be modified, and not - cmp #$0a ;modified if not any of those values, note that piranha plant will - bcc Demote ;always fail this test because A will still have vertical - cmp #PiranhaPlant ;coordinate from previous addition, also these comparisons - bcc SetStun ;are only necessary if branching from $d7a1 -Demote: and #%00000001 ;erase all but LSB, essentially turning enemy object - sta Enemy_ID,x ;into green or red koopa troopa to demote them -SetStun: lda Enemy_State,x ;load enemy state - and #%11110000 ;save high nybble - ora #%00000010 - sta Enemy_State,x ;set d1 of enemy state - dec Enemy_Y_Position,x - dec Enemy_Y_Position,x ;subtract two pixels from enemy's vertical position - lda Enemy_ID,x - cmp #Bloober ;check for bloober object - beq SetWYSpd - lda #$fd ;set default vertical speed - ldy AreaType - bne SetNotW ;if area type not water, set as speed, otherwise -SetWYSpd: lda #$ff ;change the vertical speed -SetNotW: sta Enemy_Y_Speed,x ;set vertical speed now - ldy #$01 - jsr PlayerEnemyDiff ;get horizontal difference between player and enemy object - bpl ChkBBill ;branch if enemy is to the right of player - iny ;increment Y if not -ChkBBill: lda Enemy_ID,x - cmp #BulletBill_CannonVar ;check for bullet bill (cannon variant) - beq NoCDirF - cmp #BulletBill_FrenzyVar ;check for bullet bill (frenzy variant) - beq NoCDirF ;branch if either found, direction does not change - sty Enemy_MovingDir,x ;store as moving direction -NoCDirF: dey ;decrement and use as offset - lda EnemyBGCXSpdData,y ;get proper horizontal speed - sta Enemy_X_Speed,x ;and store, then leave -ExEBGChk: rts - -;-------------------------------- -;$04 - low nybble of vertical coordinate from block buffer routine - -LandEnemyProperly: - lda $04 ;check lower nybble of vertical coordinate saved earlier - sec - sbc #$08 ;subtract eight pixels - cmp #$05 ;used to determine whether enemy landed from falling - bcs ChkForRedKoopa ;branch if lower nybble in range of $0d-$0f before subtract - lda Enemy_State,x - and #%01000000 ;branch if d6 in enemy state is set - bne LandEnemyInitState - lda Enemy_State,x - asl ;branch if d7 in enemy state is not set - bcc ChkLandedEnemyState -SChkA: jmp DoEnemySideCheck ;if lower nybble < $0d, d7 set but d6 not set, jump here - -ChkLandedEnemyState: - lda Enemy_State,x ;if enemy in normal state, branch back to jump here - beq SChkA - cmp #$05 ;if in state used by spiny's egg - beq ProcEnemyDirection ;then branch elsewhere - cmp #$03 ;if already in state used by koopas and buzzy beetles - bcs ExSteChk ;or in higher numbered state, branch to leave - lda Enemy_State,x ;load enemy state again (why?) - cmp #$02 ;if not in $02 state (used by koopas and buzzy beetles) - bne ProcEnemyDirection ;then branch elsewhere - lda #$10 ;load default timer here - ldy Enemy_ID,x ;check enemy identifier for spiny - cpy #Spiny - bne SetForStn ;branch if not found - lda #$00 ;set timer for $00 if spiny -SetForStn: sta EnemyIntervalTimer,x ;set timer here - lda #$03 ;set state here, apparently used to render - sta Enemy_State,x ;upside-down koopas and buzzy beetles - jsr EnemyLanding ;then land it properly -ExSteChk: rts ;then leave - -ProcEnemyDirection: - lda Enemy_ID,x ;check enemy identifier for goomba - cmp #Goomba ;branch if found - beq LandEnemyInitState - cmp #Spiny ;check for spiny - bne InvtD ;branch if not found - lda #$01 - sta Enemy_MovingDir,x ;send enemy moving to the right by default - lda #$08 - sta Enemy_X_Speed,x ;set horizontal speed accordingly - lda FrameCounter - and #%00000111 ;if timed appropriately, spiny will skip over - beq LandEnemyInitState ;trying to face the player -InvtD: ldy #$01 ;load 1 for enemy to face the left (inverted here) - jsr PlayerEnemyDiff ;get horizontal difference between player and enemy - bpl CNwCDir ;if enemy to the right of player, branch - iny ;if to the left, increment by one for enemy to face right (inverted) -CNwCDir: tya - cmp Enemy_MovingDir,x ;compare direction in A with current direction in memory - bne LandEnemyInitState - jsr ChkForBump_HammerBroJ ;if equal, not facing in correct dir, do sub to turn around - -LandEnemyInitState: - jsr EnemyLanding ;land enemy properly - lda Enemy_State,x - and #%10000000 ;if d7 of enemy state is set, branch - bne NMovShellFallBit - lda #$00 ;otherwise initialize enemy state and leave - sta Enemy_State,x ;note this will also turn spiny's egg into spiny - rts - -NMovShellFallBit: - lda Enemy_State,x ;nullify d6 of enemy state, save other bits - and #%10111111 ;and store, then leave - sta Enemy_State,x - rts - -;-------------------------------- - -ChkForRedKoopa: - lda Enemy_ID,x ;check for red koopa troopa $03 - cmp #RedKoopa - bne Chk2MSBSt ;branch if not found - lda Enemy_State,x - beq ChkForBump_HammerBroJ ;if enemy found and in normal state, branch -Chk2MSBSt: lda Enemy_State,x ;save enemy state into Y - tay - asl ;check for d7 set - bcc GetSteFromD ;branch if not set - lda Enemy_State,x - ora #%01000000 ;set d6 - jmp SetD6Ste ;jump ahead of this part -GetSteFromD: lda EnemyBGCStateData,y ;load new enemy state with old as offset -SetD6Ste: sta Enemy_State,x ;set as new state - -;-------------------------------- -;$00 - used to store bitmask (not used but initialized here) -;$eb - used in DoEnemySideCheck as counter and to compare moving directions - -DoEnemySideCheck: - lda Enemy_Y_Position,x ;if enemy within status bar, branch to leave - cmp #$20 ;because there's nothing there that impedes movement - bcc ExESdeC - ldy #$16 ;start by finding block to the left of enemy ($00,$14) - lda #$02 ;set value here in what is also used as - sta $eb ;OAM data offset -SdeCLoop: lda $eb ;check value - cmp Enemy_MovingDir,x ;compare value against moving direction - bne NextSdeC ;branch if different and do not seek block there - lda #$01 ;set flag in A for save horizontal coordinate - jsr BlockBufferChk_Enemy ;find block to left or right of enemy object - beq NextSdeC ;if nothing found, branch - jsr ChkForNonSolids ;check for non-solid blocks - bne ChkForBump_HammerBroJ ;branch if not found -NextSdeC: dec $eb ;move to the next direction - iny - cpy #$18 ;increment Y, loop only if Y < $18, thus we check - bcc SdeCLoop ;enemy ($00, $14) and ($10, $14) pixel coordinates -ExESdeC: rts - -ChkForBump_HammerBroJ: - cpx #$05 ;check if we're on the special use slot - beq NoBump ;and if so, branch ahead and do not play sound - lda Enemy_State,x ;if enemy state d7 not set, branch - asl ;ahead and do not play sound - bcc NoBump - lda #Sfx_Bump ;otherwise, play bump sound - sta Square1SoundQueue ;sound will never be played if branching from ChkForRedKoopa -NoBump: lda Enemy_ID,x ;check for hammer bro - cmp #$05 - bne InvEnemyDir ;branch if not found - lda #$00 - sta $00 ;initialize value here for bitmask - ldy #$fa ;load default vertical speed for jumping - jmp SetHJ ;jump to code that makes hammer bro jump - -InvEnemyDir: - jmp RXSpd ;jump to turn the enemy around - -;-------------------------------- -;$00 - used to hold horizontal difference between player and enemy - -PlayerEnemyDiff: - lda Enemy_X_Position,x ;get distance between enemy object's - sec ;horizontal coordinate and the player's - sbc Player_X_Position ;horizontal coordinate - sta $00 ;and store here - lda Enemy_PageLoc,x - sbc Player_PageLoc ;subtract borrow, then leave - rts - -;-------------------------------- - -EnemyLanding: - jsr InitVStf ;do something here to vertical speed and something else - lda Enemy_Y_Position,x - and #%11110000 ;save high nybble of vertical coordinate, and - ora #%00001000 ;set d3, then store, probably used to set enemy object - sta Enemy_Y_Position,x ;neatly on whatever it's landing on - rts - -SubtEnemyYPos: - lda Enemy_Y_Position,x ;add 62 pixels to enemy object's - clc ;vertical coordinate - adc #$3e - cmp #$44 ;compare against a certain range - rts ;and leave with flags set for conditional branch - -EnemyJump: - jsr SubtEnemyYPos ;do a sub here - bcc DoSide ;if enemy vertical coord + 62 < 68, branch to leave - lda Enemy_Y_Speed,x - clc ;add two to vertical speed - adc #$02 - cmp #$03 ;if green paratroopa not falling, branch ahead - bcc DoSide - jsr ChkUnderEnemy ;otherwise, check to see if green paratroopa is - beq DoSide ;standing on anything, then branch to same place if not - jsr ChkForNonSolids ;check for non-solid blocks - beq DoSide ;branch if found - jsr EnemyLanding ;change vertical coordinate and speed - lda #$fd - sta Enemy_Y_Speed,x ;make the paratroopa jump again -DoSide: jmp DoEnemySideCheck ;check for horizontal blockage, then leave - -;-------------------------------- - -HammerBroBGColl: - jsr ChkUnderEnemy ;check to see if hammer bro is standing on anything - beq NoUnderHammerBro - cmp #$23 ;check for blank metatile $23 and branch if not found - bne UnderHammerBro - -KillEnemyAboveBlock: - jsr ShellOrBlockDefeat ;do this sub to kill enemy - lda #$fc ;alter vertical speed of enemy and leave - sta Enemy_Y_Speed,x - rts - -UnderHammerBro: - lda EnemyFrameTimer,x ;check timer used by hammer bro - bne NoUnderHammerBro ;branch if not expired - lda Enemy_State,x - and #%10001000 ;save d7 and d3 from enemy state, nullify other bits - sta Enemy_State,x ;and store - jsr EnemyLanding ;modify vertical coordinate, speed and something else - jmp DoEnemySideCheck ;then check for horizontal blockage and leave - -NoUnderHammerBro: - lda Enemy_State,x ;if hammer bro is not standing on anything, set d0 - ora #$01 ;in the enemy state to indicate jumping or falling, then leave - sta Enemy_State,x - rts - -ChkUnderEnemy: - lda #$00 ;set flag in A for save vertical coordinate - ldy #$15 ;set Y to check the bottom middle (8,18) of enemy object - jmp BlockBufferChk_Enemy ;hop to it! - -ChkForNonSolids: - cmp #$26 ;blank metatile used for vines? - beq NSFnd - cmp #$c2 ;regular coin? - beq NSFnd - cmp #$c3 ;underwater coin? - beq NSFnd - cmp #$5f ;hidden coin block? - beq NSFnd - cmp #$60 ;hidden 1-up block? -NSFnd: rts - -;------------------------------------------------------------------------------------- - -FireballBGCollision: - lda Fireball_Y_Position,x ;check fireball's vertical coordinate - cmp #$18 - bcc ClearBounceFlag ;if within the status bar area of the screen, branch ahead - jsr BlockBufferChk_FBall ;do fireball to background collision detection on bottom of it - beq ClearBounceFlag ;if nothing underneath fireball, branch - jsr ChkForNonSolids ;check for non-solid metatiles - beq ClearBounceFlag ;branch if any found - lda Fireball_Y_Speed,x ;if fireball's vertical speed set to move upwards, - bmi InitFireballExplode ;branch to set exploding bit in fireball's state - lda FireballBouncingFlag,x ;if bouncing flag already set, - bne InitFireballExplode ;branch to set exploding bit in fireball's state - lda #$fd - sta Fireball_Y_Speed,x ;otherwise set vertical speed to move upwards (give it bounce) - lda #$01 - sta FireballBouncingFlag,x ;set bouncing flag - lda Fireball_Y_Position,x - and #$f8 ;modify vertical coordinate to land it properly - sta Fireball_Y_Position,x ;store as new vertical coordinate - rts ;leave - -ClearBounceFlag: - lda #$00 - sta FireballBouncingFlag,x ;clear bouncing flag by default - rts ;leave - -InitFireballExplode: - lda #$80 - sta Fireball_State,x ;set exploding flag in fireball's state - lda #Sfx_Bump - sta Square1SoundQueue ;load bump sound - rts ;leave - -;------------------------------------------------------------------------------------- -;$00 - used to hold one of bitmasks, or offset -;$01 - used for relative X coordinate, also used to store middle screen page location -;$02 - used for relative Y coordinate, also used to store middle screen coordinate - -;this data added to relative coordinates of sprite objects -;stored in order: left edge, top edge, right edge, bottom edge -BoundBoxCtrlData: - .db $02, $08, $0e, $20 - .db $03, $14, $0d, $20 - .db $02, $14, $0e, $20 - .db $02, $09, $0e, $15 - .db $00, $00, $18, $06 - .db $00, $00, $20, $0d - .db $00, $00, $30, $0d - .db $00, $00, $08, $08 - .db $06, $04, $0a, $08 - .db $03, $0e, $0d, $14 - .db $00, $02, $10, $15 - .db $04, $04, $0c, $1c - -GetFireballBoundBox: - txa ;add seven bytes to offset - clc ;to use in routines as offset for fireball - adc #$07 - tax - ldy #$02 ;set offset for relative coordinates - bne FBallB ;unconditional branch - -GetMiscBoundBox: - txa ;add nine bytes to offset - clc ;to use in routines as offset for misc object - adc #$09 - tax - ldy #$06 ;set offset for relative coordinates -FBallB: jsr BoundingBoxCore ;get bounding box coordinates - jmp CheckRightScreenBBox ;jump to handle any offscreen coordinates - -GetEnemyBoundBox: - ldy #$48 ;store bitmask here for now - sty $00 - ldy #$44 ;store another bitmask here for now and jump - jmp GetMaskedOffScrBits - -SmallPlatformBoundBox: - ldy #$08 ;store bitmask here for now - sty $00 - ldy #$04 ;store another bitmask here for now - -GetMaskedOffScrBits: - lda Enemy_X_Position,x ;get enemy object position relative - sec ;to the left side of the screen - sbc ScreenLeft_X_Pos - sta $01 ;store here - lda Enemy_PageLoc,x ;subtract borrow from current page location - sbc ScreenLeft_PageLoc ;of left side - bmi CMBits ;if enemy object is beyond left edge, branch - ora $01 - beq CMBits ;if precisely at the left edge, branch - ldy $00 ;if to the right of left edge, use value in $00 for A -CMBits: tya ;otherwise use contents of Y - and Enemy_OffscreenBits ;preserve bitwise whatever's in here - sta EnemyOffscrBitsMasked,x ;save masked offscreen bits here - bne MoveBoundBoxOffscreen ;if anything set here, branch - jmp SetupEOffsetFBBox ;otherwise, do something else - -LargePlatformBoundBox: - inx ;increment X to get the proper offset - jsr GetXOffscreenBits ;then jump directly to the sub for horizontal offscreen bits - dex ;decrement to return to original offset - cmp #$fe ;if completely offscreen, branch to put entire bounding - bcs MoveBoundBoxOffscreen ;box offscreen, otherwise start getting coordinates - -SetupEOffsetFBBox: - txa ;add 1 to offset to properly address - clc ;the enemy object memory locations - adc #$01 - tax - ldy #$01 ;load 1 as offset here, same reason - jsr BoundingBoxCore ;do a sub to get the coordinates of the bounding box - jmp CheckRightScreenBBox ;jump to handle offscreen coordinates of bounding box - -MoveBoundBoxOffscreen: - txa ;multiply offset by 4 - asl - asl - tay ;use as offset here - lda #$ff - sta EnemyBoundingBoxCoord,y ;load value into four locations here and leave - sta EnemyBoundingBoxCoord+1,y - sta EnemyBoundingBoxCoord+2,y - sta EnemyBoundingBoxCoord+3,y - rts - -BoundingBoxCore: - stx $00 ;save offset here - lda SprObject_Rel_YPos,y ;store object coordinates relative to screen - sta $02 ;vertically and horizontally, respectively - lda SprObject_Rel_XPos,y - sta $01 - txa ;multiply offset by four and save to stack - asl - asl - pha - tay ;use as offset for Y, X is left alone - lda SprObj_BoundBoxCtrl,x ;load value here to be used as offset for X - asl ;multiply that by four and use as X - asl - tax - lda $01 ;add the first number in the bounding box data to the - clc ;relative horizontal coordinate using enemy object offset - adc BoundBoxCtrlData,x ;and store somewhere using same offset * 4 - sta BoundingBox_UL_Corner,y ;store here - lda $01 - clc - adc BoundBoxCtrlData+2,x ;add the third number in the bounding box data to the - sta BoundingBox_LR_Corner,y ;relative horizontal coordinate and store - inx ;increment both offsets - iny - lda $02 ;add the second number to the relative vertical coordinate - clc ;using incremented offset and store using the other - adc BoundBoxCtrlData,x ;incremented offset - sta BoundingBox_UL_Corner,y - lda $02 - clc - adc BoundBoxCtrlData+2,x ;add the fourth number to the relative vertical coordinate - sta BoundingBox_LR_Corner,y ;and store - pla ;get original offset loaded into $00 * y from stack - tay ;use as Y - ldx $00 ;get original offset and use as X again - rts - -CheckRightScreenBBox: - lda ScreenLeft_X_Pos ;add 128 pixels to left side of screen - clc ;and store as horizontal coordinate of middle - adc #$80 - sta $02 - lda ScreenLeft_PageLoc ;add carry to page location of left side of screen - adc #$00 ;and store as page location of middle - sta $01 - lda SprObject_X_Position,x ;get horizontal coordinate - cmp $02 ;compare against middle horizontal coordinate - lda SprObject_PageLoc,x ;get page location - sbc $01 ;subtract from middle page location - bcc CheckLeftScreenBBox ;if object is on the left side of the screen, branch - lda BoundingBox_DR_XPos,y ;check right-side edge of bounding box for offscreen - bmi NoOfs ;coordinates, branch if still on the screen - lda #$ff ;load offscreen value here to use on one or both horizontal sides - ldx BoundingBox_UL_XPos,y ;check left-side edge of bounding box for offscreen - bmi SORte ;coordinates, and branch if still on the screen - sta BoundingBox_UL_XPos,y ;store offscreen value for left side -SORte: sta BoundingBox_DR_XPos,y ;store offscreen value for right side -NoOfs: ldx ObjectOffset ;get object offset and leave - rts - -CheckLeftScreenBBox: - lda BoundingBox_UL_XPos,y ;check left-side edge of bounding box for offscreen - bpl NoOfs2 ;coordinates, and branch if still on the screen - cmp #$a0 ;check to see if left-side edge is in the middle of the - bcc NoOfs2 ;screen or really offscreen, and branch if still on - lda #$00 - ldx BoundingBox_DR_XPos,y ;check right-side edge of bounding box for offscreen - bpl SOLft ;coordinates, branch if still onscreen - sta BoundingBox_DR_XPos,y ;store offscreen value for right side -SOLft: sta BoundingBox_UL_XPos,y ;store offscreen value for left side -NoOfs2: ldx ObjectOffset ;get object offset and leave - rts - -;------------------------------------------------------------------------------------- -;$06 - second object's offset -;$07 - counter - -PlayerCollisionCore: - ldx #$00 ;initialize X to use player's bounding box for comparison - -SprObjectCollisionCore: - sty $06 ;save contents of Y here - lda #$01 - sta $07 ;save value 1 here as counter, compare horizontal coordinates first - -CollisionCoreLoop: - lda BoundingBox_UL_Corner,y ;compare left/top coordinates - cmp BoundingBox_UL_Corner,x ;of first and second objects' bounding boxes - bcs FirstBoxGreater ;if first left/top => second, branch - cmp BoundingBox_LR_Corner,x ;otherwise compare to right/bottom of second - bcc SecondBoxVerticalChk ;if first left/top < second right/bottom, branch elsewhere - beq CollisionFound ;if somehow equal, collision, thus branch - lda BoundingBox_LR_Corner,y ;if somehow greater, check to see if bottom of - cmp BoundingBox_UL_Corner,y ;first object's bounding box is greater than its top - bcc CollisionFound ;if somehow less, vertical wrap collision, thus branch - cmp BoundingBox_UL_Corner,x ;otherwise compare bottom of first bounding box to the top - bcs CollisionFound ;of second box, and if equal or greater, collision, thus branch - ldy $06 ;otherwise return with carry clear and Y = $0006 - rts ;note horizontal wrapping never occurs - -SecondBoxVerticalChk: - lda BoundingBox_LR_Corner,x ;check to see if the vertical bottom of the box - cmp BoundingBox_UL_Corner,x ;is greater than the vertical top - bcc CollisionFound ;if somehow less, vertical wrap collision, thus branch - lda BoundingBox_LR_Corner,y ;otherwise compare horizontal right or vertical bottom - cmp BoundingBox_UL_Corner,x ;of first box with horizontal left or vertical top of second box - bcs CollisionFound ;if equal or greater, collision, thus branch - ldy $06 ;otherwise return with carry clear and Y = $0006 - rts - -FirstBoxGreater: - cmp BoundingBox_UL_Corner,x ;compare first and second box horizontal left/vertical top again - beq CollisionFound ;if first coordinate = second, collision, thus branch - cmp BoundingBox_LR_Corner,x ;if not, compare with second object right or bottom edge - bcc CollisionFound ;if left/top of first less than or equal to right/bottom of second - beq CollisionFound ;then collision, thus branch - cmp BoundingBox_LR_Corner,y ;otherwise check to see if top of first box is greater than bottom - bcc NoCollisionFound ;if less than or equal, no collision, branch to end - beq NoCollisionFound - lda BoundingBox_LR_Corner,y ;otherwise compare bottom of first to top of second - cmp BoundingBox_UL_Corner,x ;if bottom of first is greater than top of second, vertical wrap - bcs CollisionFound ;collision, and branch, otherwise, proceed onwards here - -NoCollisionFound: - clc ;clear carry, then load value set earlier, then leave - ldy $06 ;like previous ones, if horizontal coordinates do not collide, we do - rts ;not bother checking vertical ones, because what's the point? - -CollisionFound: - inx ;increment offsets on both objects to check - iny ;the vertical coordinates - dec $07 ;decrement counter to reflect this - bpl CollisionCoreLoop ;if counter not expired, branch to loop - sec ;otherwise we already did both sets, therefore collision, so set carry - ldy $06 ;load original value set here earlier, then leave - rts - -;------------------------------------------------------------------------------------- -;$02 - modified y coordinate -;$03 - stores metatile involved in block buffer collisions -;$04 - comes in with offset to block buffer adder data, goes out with low nybble x/y coordinate -;$05 - modified x coordinate -;$06-$07 - block buffer address - -BlockBufferChk_Enemy: - pha ;save contents of A to stack - txa - clc ;add 1 to X to run sub with enemy offset in mind - adc #$01 - tax - pla ;pull A from stack and jump elsewhere - jmp BBChk_E - -ResidualMiscObjectCode: - txa - clc ;supposedly used once to set offset for - adc #$0d ;miscellaneous objects - tax - ldy #$1b ;supposedly used once to set offset for block buffer data - jmp ResJmpM ;probably used in early stages to do misc to bg collision detection - -BlockBufferChk_FBall: - ldy #$1a ;set offset for block buffer adder data - txa - clc - adc #$07 ;add seven bytes to use - tax -ResJmpM: lda #$00 ;set A to return vertical coordinate -BBChk_E: jsr BlockBufferCollision ;do collision detection subroutine for sprite object - ldx ObjectOffset ;get object offset - cmp #$00 ;check to see if object bumped into anything - rts - -BlockBufferAdderData: - .db $00, $07, $0e - -BlockBuffer_X_Adder: - .db $08, $03, $0c, $02, $02, $0d, $0d, $08 - .db $03, $0c, $02, $02, $0d, $0d, $08, $03 - .db $0c, $02, $02, $0d, $0d, $08, $00, $10 - .db $04, $14, $04, $04 - -BlockBuffer_Y_Adder: - .db $04, $20, $20, $08, $18, $08, $18, $02 - .db $20, $20, $08, $18, $08, $18, $12, $20 - .db $20, $18, $18, $18, $18, $18, $14, $14 - .db $06, $06, $08, $10 - -BlockBufferColli_Feet: - iny ;if branched here, increment to next set of adders - -BlockBufferColli_Head: - lda #$00 ;set flag to return vertical coordinate - .db $2c ;BIT instruction opcode - -BlockBufferColli_Side: - lda #$01 ;set flag to return horizontal coordinate - ldx #$00 ;set offset for player object - -BlockBufferCollision: - pha ;save contents of A to stack - sty $04 ;save contents of Y here - lda BlockBuffer_X_Adder,y ;add horizontal coordinate - clc ;of object to value obtained using Y as offset - adc SprObject_X_Position,x - sta $05 ;store here - lda SprObject_PageLoc,x - adc #$00 ;add carry to page location - and #$01 ;get LSB, mask out all other bits - lsr ;move to carry - ora $05 ;get stored value - ror ;rotate carry to MSB of A - lsr ;and effectively move high nybble to - lsr ;lower, LSB which became MSB will be - lsr ;d4 at this point - jsr GetBlockBufferAddr ;get address of block buffer into $06, $07 - ldy $04 ;get old contents of Y - lda SprObject_Y_Position,x ;get vertical coordinate of object - clc - adc BlockBuffer_Y_Adder,y ;add it to value obtained using Y as offset - and #%11110000 ;mask out low nybble - sec - sbc #$20 ;subtract 32 pixels for the status bar - sta $02 ;store result here - tay ;use as offset for block buffer - lda ($06),y ;check current content of block buffer - sta $03 ;and store here - ldy $04 ;get old contents of Y again - pla ;pull A from stack - bne RetXC ;if A = 1, branch - lda SprObject_Y_Position,x ;if A = 0, load vertical coordinate - jmp RetYC ;and jump -RetXC: lda SprObject_X_Position,x ;otherwise load horizontal coordinate -RetYC: and #%00001111 ;and mask out high nybble - sta $04 ;store masked out result here - lda $03 ;get saved content of block buffer - rts ;and leave - -;------------------------------------------------------------------------------------- - -;unused byte - .db $ff - -;------------------------------------------------------------------------------------- -;$00 - offset to vine Y coordinate adder -;$02 - offset to sprite data - -VineYPosAdder: - .db $00, $30 - -DrawVine: - sty $00 ;save offset here - lda Enemy_Rel_YPos ;get relative vertical coordinate - clc - adc VineYPosAdder,y ;add value using offset in Y to get value - ldx VineObjOffset,y ;get offset to vine - ldy Enemy_SprDataOffset,x ;get sprite data offset - sty $02 ;store sprite data offset here - jsr SixSpriteStacker ;stack six sprites on top of each other vertically - lda Enemy_Rel_XPos ;get relative horizontal coordinate - sta Sprite_X_Position,y ;store in first, third and fifth sprites - sta Sprite_X_Position+8,y - sta Sprite_X_Position+16,y - clc - adc #$06 ;add six pixels to second, fourth and sixth sprites - sta Sprite_X_Position+4,y ;to give characteristic staggered vine shape to - sta Sprite_X_Position+12,y ;our vertical stack of sprites - sta Sprite_X_Position+20,y - lda #%00100001 ;set bg priority and palette attribute bits - sta Sprite_Attributes,y ;set in first, third and fifth sprites - sta Sprite_Attributes+8,y - sta Sprite_Attributes+16,y - ora #%01000000 ;additionally, set horizontal flip bit - sta Sprite_Attributes+4,y ;for second, fourth and sixth sprites - sta Sprite_Attributes+12,y - sta Sprite_Attributes+20,y - ldx #$05 ;set tiles for six sprites -VineTL: lda #$e1 ;set tile number for sprite - sta Sprite_Tilenumber,y - iny ;move offset to next sprite data - iny - iny - iny - dex ;move onto next sprite - bpl VineTL ;loop until all sprites are done - ldy $02 ;get original offset - lda $00 ;get offset to vine adding data - bne SkpVTop ;if offset not zero, skip this part - lda #$e0 - sta Sprite_Tilenumber,y ;set other tile number for top of vine -SkpVTop: ldx #$00 ;start with the first sprite again -ChkFTop: lda VineStart_Y_Position ;get original starting vertical coordinate - sec - sbc Sprite_Y_Position,y ;subtract top-most sprite's Y coordinate - cmp #$64 ;if two coordinates are less than 100/$64 pixels - bcc NextVSp ;apart, skip this to leave sprite alone - lda #$f8 - sta Sprite_Y_Position,y ;otherwise move sprite offscreen -NextVSp: iny ;move offset to next OAM data - iny - iny - iny - inx ;move onto next sprite - cpx #$06 ;do this until all sprites are checked - bne ChkFTop - ldy $00 ;return offset set earlier - rts - -SixSpriteStacker: - ldx #$06 ;do six sprites -StkLp: sta Sprite_Data,y ;store X or Y coordinate into OAM data - clc - adc #$08 ;add eight pixels - iny - iny ;move offset four bytes forward - iny - iny - dex ;do another sprite - bne StkLp ;do this until all sprites are done - ldy $02 ;get saved OAM data offset and leave - rts - -;------------------------------------------------------------------------------------- - -FirstSprXPos: - .db $04, $00, $04, $00 - -FirstSprYPos: - .db $00, $04, $00, $04 - -SecondSprXPos: - .db $00, $08, $00, $08 - -SecondSprYPos: - .db $08, $00, $08, $00 - -FirstSprTilenum: - .db $80, $82, $81, $83 - -SecondSprTilenum: - .db $81, $83, $80, $82 - -HammerSprAttrib: - .db $03, $03, $c3, $c3 - -DrawHammer: - ldy Misc_SprDataOffset,x ;get misc object OAM data offset - lda TimerControl - bne ForceHPose ;if master timer control set, skip this part - lda Misc_State,x ;otherwise get hammer's state - and #%01111111 ;mask out d7 - cmp #$01 ;check to see if set to 1 yet - beq GetHPose ;if so, branch -ForceHPose: ldx #$00 ;reset offset here - beq RenderH ;do unconditional branch to rendering part -GetHPose: lda FrameCounter ;get frame counter - lsr ;move d3-d2 to d1-d0 - lsr - and #%00000011 ;mask out all but d1-d0 (changes every four frames) - tax ;use as timing offset -RenderH: lda Misc_Rel_YPos ;get relative vertical coordinate - clc - adc FirstSprYPos,x ;add first sprite vertical adder based on offset - sta Sprite_Y_Position,y ;store as sprite Y coordinate for first sprite - clc - adc SecondSprYPos,x ;add second sprite vertical adder based on offset - sta Sprite_Y_Position+4,y ;store as sprite Y coordinate for second sprite - lda Misc_Rel_XPos ;get relative horizontal coordinate - clc - adc FirstSprXPos,x ;add first sprite horizontal adder based on offset - sta Sprite_X_Position,y ;store as sprite X coordinate for first sprite - clc - adc SecondSprXPos,x ;add second sprite horizontal adder based on offset - sta Sprite_X_Position+4,y ;store as sprite X coordinate for second sprite - lda FirstSprTilenum,x - sta Sprite_Tilenumber,y ;get and store tile number of first sprite - lda SecondSprTilenum,x - sta Sprite_Tilenumber+4,y ;get and store tile number of second sprite - lda HammerSprAttrib,x - sta Sprite_Attributes,y ;get and store attribute bytes for both - sta Sprite_Attributes+4,y ;note in this case they use the same data - ldx ObjectOffset ;get misc object offset - lda Misc_OffscreenBits - and #%11111100 ;check offscreen bits - beq NoHOffscr ;if all bits clear, leave object alone - lda #$00 - sta Misc_State,x ;otherwise nullify misc object state - lda #$f8 - jsr DumpTwoSpr ;do sub to move hammer sprites offscreen -NoHOffscr: rts ;leave - -;------------------------------------------------------------------------------------- -;$00-$01 - used to hold tile numbers ($01 addressed in draw floatey number part) -;$02 - used to hold Y coordinate for floatey number -;$03 - residual byte used for flip (but value set here affects nothing) -;$04 - attribute byte for floatey number -;$05 - used as X coordinate for floatey number - -FlagpoleScoreNumTiles: - .db $f9, $50 - .db $f7, $50 - .db $fa, $fb - .db $f8, $fb - .db $f6, $fb - -FlagpoleGfxHandler: - ldy Enemy_SprDataOffset,x ;get sprite data offset for flagpole flag - lda Enemy_Rel_XPos ;get relative horizontal coordinate - sta Sprite_X_Position,y ;store as X coordinate for first sprite - clc - adc #$08 ;add eight pixels and store - sta Sprite_X_Position+4,y ;as X coordinate for second and third sprites - sta Sprite_X_Position+8,y - clc - adc #$0c ;add twelve more pixels and - sta $05 ;store here to be used later by floatey number - lda Enemy_Y_Position,x ;get vertical coordinate - jsr DumpTwoSpr ;and do sub to dump into first and second sprites - adc #$08 ;add eight pixels - sta Sprite_Y_Position+8,y ;and store into third sprite - lda FlagpoleFNum_Y_Pos ;get vertical coordinate for floatey number - sta $02 ;store it here - lda #$01 - sta $03 ;set value for flip which will not be used, and - sta $04 ;attribute byte for floatey number - sta Sprite_Attributes,y ;set attribute bytes for all three sprites - sta Sprite_Attributes+4,y - sta Sprite_Attributes+8,y - lda #$7e - sta Sprite_Tilenumber,y ;put triangle shaped tile - sta Sprite_Tilenumber+8,y ;into first and third sprites - lda #$7f - sta Sprite_Tilenumber+4,y ;put skull tile into second sprite - lda FlagpoleCollisionYPos ;get vertical coordinate at time of collision - beq ChkFlagOffscreen ;if zero, branch ahead - tya - clc ;add 12 bytes to sprite data offset - adc #$0c - tay ;put back in Y - lda FlagpoleScore ;get offset used to award points for touching flagpole - asl ;multiply by 2 to get proper offset here - tax - lda FlagpoleScoreNumTiles,x ;get appropriate tile data - sta $00 - lda FlagpoleScoreNumTiles+1,x - jsr DrawOneSpriteRow ;use it to render floatey number - -ChkFlagOffscreen: - ldx ObjectOffset ;get object offset for flag - ldy Enemy_SprDataOffset,x ;get OAM data offset - lda Enemy_OffscreenBits ;get offscreen bits - and #%00001110 ;mask out all but d3-d1 - beq ExitDumpSpr ;if none of these bits set, branch to leave - -;------------------------------------------------------------------------------------- - -MoveSixSpritesOffscreen: - lda #$f8 ;set offscreen coordinate if jumping here - -DumpSixSpr: - sta Sprite_Data+20,y ;dump A contents - sta Sprite_Data+16,y ;into third row sprites - -DumpFourSpr: - sta Sprite_Data+12,y ;into second row sprites - -DumpThreeSpr: - sta Sprite_Data+8,y - -DumpTwoSpr: - sta Sprite_Data+4,y ;and into first row sprites - sta Sprite_Data,y - -ExitDumpSpr: - rts - -;------------------------------------------------------------------------------------- - -DrawLargePlatform: - ldy Enemy_SprDataOffset,x ;get OAM data offset - sty $02 ;store here - iny ;add 3 to it for offset - iny ;to X coordinate - iny - lda Enemy_Rel_XPos ;get horizontal relative coordinate - jsr SixSpriteStacker ;store X coordinates using A as base, stack horizontally - ldx ObjectOffset - lda Enemy_Y_Position,x ;get vertical coordinate - jsr DumpFourSpr ;dump into first four sprites as Y coordinate - ldy AreaType - cpy #$03 ;check for castle-type level - beq ShrinkPlatform - ldy SecondaryHardMode ;check for secondary hard mode flag set - beq SetLast2Platform ;branch if not set elsewhere - -ShrinkPlatform: - lda #$f8 ;load offscreen coordinate if flag set or castle-type level - -SetLast2Platform: - ldy Enemy_SprDataOffset,x ;get OAM data offset - sta Sprite_Y_Position+16,y ;store vertical coordinate or offscreen - sta Sprite_Y_Position+20,y ;coordinate into last two sprites as Y coordinate - lda #$5b ;load default tile for platform (girder) - ldx CloudTypeOverride - beq SetPlatformTilenum ;if cloud level override flag not set, use - lda #$75 ;otherwise load other tile for platform (puff) - -SetPlatformTilenum: - ldx ObjectOffset ;get enemy object buffer offset - iny ;increment Y for tile offset - jsr DumpSixSpr ;dump tile number into all six sprites - lda #$02 ;set palette controls - iny ;increment Y for sprite attributes - jsr DumpSixSpr ;dump attributes into all six sprites - inx ;increment X for enemy objects - jsr GetXOffscreenBits ;get offscreen bits again - dex - ldy Enemy_SprDataOffset,x ;get OAM data offset - asl ;rotate d7 into carry, save remaining - pha ;bits to the stack - bcc SChk2 - lda #$f8 ;if d7 was set, move first sprite offscreen - sta Sprite_Y_Position,y -SChk2: pla ;get bits from stack - asl ;rotate d6 into carry - pha ;save to stack - bcc SChk3 - lda #$f8 ;if d6 was set, move second sprite offscreen - sta Sprite_Y_Position+4,y -SChk3: pla ;get bits from stack - asl ;rotate d5 into carry - pha ;save to stack - bcc SChk4 - lda #$f8 ;if d5 was set, move third sprite offscreen - sta Sprite_Y_Position+8,y -SChk4: pla ;get bits from stack - asl ;rotate d4 into carry - pha ;save to stack - bcc SChk5 - lda #$f8 ;if d4 was set, move fourth sprite offscreen - sta Sprite_Y_Position+12,y -SChk5: pla ;get bits from stack - asl ;rotate d3 into carry - pha ;save to stack - bcc SChk6 - lda #$f8 ;if d3 was set, move fifth sprite offscreen - sta Sprite_Y_Position+16,y -SChk6: pla ;get bits from stack - asl ;rotate d2 into carry - bcc SLChk ;save to stack - lda #$f8 - sta Sprite_Y_Position+20,y ;if d2 was set, move sixth sprite offscreen -SLChk: lda Enemy_OffscreenBits ;check d7 of offscreen bits - asl ;and if d7 is not set, skip sub - bcc ExDLPl - jsr MoveSixSpritesOffscreen ;otherwise branch to move all sprites offscreen -ExDLPl: rts - -;------------------------------------------------------------------------------------- - -DrawFloateyNumber_Coin: - lda FrameCounter ;get frame counter - lsr ;divide by 2 - bcs NotRsNum ;branch if d0 not set to raise number every other frame - dec Misc_Y_Position,x ;otherwise, decrement vertical coordinate -NotRsNum: lda Misc_Y_Position,x ;get vertical coordinate - jsr DumpTwoSpr ;dump into both sprites - lda Misc_Rel_XPos ;get relative horizontal coordinate - sta Sprite_X_Position,y ;store as X coordinate for first sprite - clc - adc #$08 ;add eight pixels - sta Sprite_X_Position+4,y ;store as X coordinate for second sprite - lda #$02 - sta Sprite_Attributes,y ;store attribute byte in both sprites - sta Sprite_Attributes+4,y - lda #$f7 - sta Sprite_Tilenumber,y ;put tile numbers into both sprites - lda #$fb ;that resemble "200" - sta Sprite_Tilenumber+4,y - jmp ExJCGfx ;then jump to leave (why not an rts here instead?) - -JumpingCoinTiles: - .db $60, $61, $62, $63 - -JCoinGfxHandler: - ldy Misc_SprDataOffset,x ;get coin/floatey number's OAM data offset - lda Misc_State,x ;get state of misc object - cmp #$02 ;if 2 or greater, - bcs DrawFloateyNumber_Coin ;branch to draw floatey number - lda Misc_Y_Position,x ;store vertical coordinate as - sta Sprite_Y_Position,y ;Y coordinate for first sprite - clc - adc #$08 ;add eight pixels - sta Sprite_Y_Position+4,y ;store as Y coordinate for second sprite - lda Misc_Rel_XPos ;get relative horizontal coordinate - sta Sprite_X_Position,y - sta Sprite_X_Position+4,y ;store as X coordinate for first and second sprites - lda FrameCounter ;get frame counter - lsr ;divide by 2 to alter every other frame - and #%00000011 ;mask out d2-d1 - tax ;use as graphical offset - lda JumpingCoinTiles,x ;load tile number - iny ;increment OAM data offset to write tile numbers - jsr DumpTwoSpr ;do sub to dump tile number into both sprites - dey ;decrement to get old offset - lda #$02 - sta Sprite_Attributes,y ;set attribute byte in first sprite - lda #$82 - sta Sprite_Attributes+4,y ;set attribute byte with vertical flip in second sprite - ldx ObjectOffset ;get misc object offset -ExJCGfx: rts ;leave - -;------------------------------------------------------------------------------------- -;$00-$01 - used to hold tiles for drawing the power-up, $00 also used to hold power-up type -;$02 - used to hold bottom row Y position -;$03 - used to hold flip control (not used here) -;$04 - used to hold sprite attributes -;$05 - used to hold X position -;$07 - counter - -;tiles arranged in top left, right, bottom left, right order -PowerUpGfxTable: - .db $76, $77, $78, $79 ;regular mushroom - .db $d6, $d6, $d9, $d9 ;fire flower - .db $8d, $8d, $e4, $e4 ;star - .db $76, $77, $78, $79 ;1-up mushroom - -PowerUpAttributes: - .db $02, $01, $02, $01 - -DrawPowerUp: - ldy Enemy_SprDataOffset+5 ;get power-up's sprite data offset - lda Enemy_Rel_YPos ;get relative vertical coordinate - clc - adc #$08 ;add eight pixels - sta $02 ;store result here - lda Enemy_Rel_XPos ;get relative horizontal coordinate - sta $05 ;store here - ldx PowerUpType ;get power-up type - lda PowerUpAttributes,x ;get attribute data for power-up type - ora Enemy_SprAttrib+5 ;add background priority bit if set - sta $04 ;store attributes here - txa - pha ;save power-up type to the stack - asl - asl ;multiply by four to get proper offset - tax ;use as X - lda #$01 - sta $07 ;set counter here to draw two rows of sprite object - sta $03 ;init d1 of flip control - -PUpDrawLoop: - lda PowerUpGfxTable,x ;load left tile of power-up object - sta $00 - lda PowerUpGfxTable+1,x ;load right tile - jsr DrawOneSpriteRow ;branch to draw one row of our power-up object - dec $07 ;decrement counter - bpl PUpDrawLoop ;branch until two rows are drawn - ldy Enemy_SprDataOffset+5 ;get sprite data offset again - pla ;pull saved power-up type from the stack - beq PUpOfs ;if regular mushroom, branch, do not change colors or flip - cmp #$03 - beq PUpOfs ;if 1-up mushroom, branch, do not change colors or flip - sta $00 ;store power-up type here now - lda FrameCounter ;get frame counter - lsr ;divide by 2 to change colors every two frames - and #%00000011 ;mask out all but d1 and d0 (previously d2 and d1) - ora Enemy_SprAttrib+5 ;add background priority bit if any set - sta Sprite_Attributes,y ;set as new palette bits for top left and - sta Sprite_Attributes+4,y ;top right sprites for fire flower and star - ldx $00 - dex ;check power-up type for fire flower - beq FlipPUpRightSide ;if found, skip this part - sta Sprite_Attributes+8,y ;otherwise set new palette bits for bottom left - sta Sprite_Attributes+12,y ;and bottom right sprites as well for star only - -FlipPUpRightSide: - lda Sprite_Attributes+4,y - ora #%01000000 ;set horizontal flip bit for top right sprite - sta Sprite_Attributes+4,y - lda Sprite_Attributes+12,y - ora #%01000000 ;set horizontal flip bit for bottom right sprite - sta Sprite_Attributes+12,y ;note these are only done for fire flower and star power-ups -PUpOfs: jmp SprObjectOffscrChk ;jump to check to see if power-up is offscreen at all, then leave - -;------------------------------------------------------------------------------------- -;$00-$01 - used in DrawEnemyObjRow to hold sprite tile numbers -;$02 - used to store Y position -;$03 - used to store moving direction, used to flip enemies horizontally -;$04 - used to store enemy's sprite attributes -;$05 - used to store X position -;$eb - used to hold sprite data offset -;$ec - used to hold either altered enemy state or special value used in gfx handler as condition -;$ed - used to hold enemy state from buffer -;$ef - used to hold enemy code used in gfx handler (may or may not resemble Enemy_ID values) - -;tiles arranged in top left, right, middle left, right, bottom left, right order -EnemyGraphicsTable: - .db $fc, $fc, $aa, $ab, $ac, $ad ;buzzy beetle frame 1 - .db $fc, $fc, $ae, $af, $b0, $b1 ; frame 2 - .db $fc, $a5, $a6, $a7, $a8, $a9 ;koopa troopa frame 1 - .db $fc, $a0, $a1, $a2, $a3, $a4 ; frame 2 - .db $69, $a5, $6a, $a7, $a8, $a9 ;koopa paratroopa frame 1 - .db $6b, $a0, $6c, $a2, $a3, $a4 ; frame 2 - .db $fc, $fc, $96, $97, $98, $99 ;spiny frame 1 - .db $fc, $fc, $9a, $9b, $9c, $9d ; frame 2 - .db $fc, $fc, $8f, $8e, $8e, $8f ;spiny's egg frame 1 - .db $fc, $fc, $95, $94, $94, $95 ; frame 2 - .db $fc, $fc, $dc, $dc, $df, $df ;bloober frame 1 - .db $dc, $dc, $dd, $dd, $de, $de ; frame 2 - .db $fc, $fc, $b2, $b3, $b4, $b5 ;cheep-cheep frame 1 - .db $fc, $fc, $b6, $b3, $b7, $b5 ; frame 2 - .db $fc, $fc, $70, $71, $72, $73 ;goomba - .db $fc, $fc, $6e, $6e, $6f, $6f ;koopa shell frame 1 (upside-down) - .db $fc, $fc, $6d, $6d, $6f, $6f ; frame 2 - .db $fc, $fc, $6f, $6f, $6e, $6e ;koopa shell frame 1 (rightsideup) - .db $fc, $fc, $6f, $6f, $6d, $6d ; frame 2 - .db $fc, $fc, $f4, $f4, $f5, $f5 ;buzzy beetle shell frame 1 (rightsideup) - .db $fc, $fc, $f4, $f4, $f5, $f5 ; frame 2 - .db $fc, $fc, $f5, $f5, $f4, $f4 ;buzzy beetle shell frame 1 (upside-down) - .db $fc, $fc, $f5, $f5, $f4, $f4 ; frame 2 - .db $fc, $fc, $fc, $fc, $ef, $ef ;defeated goomba - .db $b9, $b8, $bb, $ba, $bc, $bc ;lakitu frame 1 - .db $fc, $fc, $bd, $bd, $bc, $bc ; frame 2 - .db $7a, $7b, $da, $db, $d8, $d8 ;princess - .db $cd, $cd, $ce, $ce, $cf, $cf ;mushroom retainer - .db $7d, $7c, $d1, $8c, $d3, $d2 ;hammer bro frame 1 - .db $7d, $7c, $89, $88, $8b, $8a ; frame 2 - .db $d5, $d4, $e3, $e2, $d3, $d2 ; frame 3 - .db $d5, $d4, $e3, $e2, $8b, $8a ; frame 4 - .db $e5, $e5, $e6, $e6, $eb, $eb ;piranha plant frame 1 - .db $ec, $ec, $ed, $ed, $ee, $ee ; frame 2 - .db $fc, $fc, $d0, $d0, $d7, $d7 ;podoboo - .db $bf, $be, $c1, $c0, $c2, $fc ;bowser front frame 1 - .db $c4, $c3, $c6, $c5, $c8, $c7 ;bowser rear frame 1 - .db $bf, $be, $ca, $c9, $c2, $fc ; front frame 2 - .db $c4, $c3, $c6, $c5, $cc, $cb ; rear frame 2 - .db $fc, $fc, $e8, $e7, $ea, $e9 ;bullet bill - .db $f2, $f2, $f3, $f3, $f2, $f2 ;jumpspring frame 1 - .db $f1, $f1, $f1, $f1, $fc, $fc ; frame 2 - .db $f0, $f0, $fc, $fc, $fc, $fc ; frame 3 - -EnemyGfxTableOffsets: - .db $0c, $0c, $00, $0c, $0c, $a8, $54, $3c - .db $ea, $18, $48, $48, $cc, $c0, $18, $18 - .db $18, $90, $24, $ff, $48, $9c, $d2, $d8 - .db $f0, $f6, $fc - -EnemyAttributeData: - .db $01, $02, $03, $02, $01, $01, $03, $03 - .db $03, $01, $01, $02, $02, $21, $01, $02 - .db $01, $01, $02, $ff, $02, $02, $01, $01 - .db $02, $02, $02 - -EnemyAnimTimingBMask: - .db $08, $18 - -JumpspringFrameOffsets: - .db $18, $19, $1a, $19, $18 - -EnemyGfxHandler: - lda Enemy_Y_Position,x ;get enemy object vertical position - sta $02 - lda Enemy_Rel_XPos ;get enemy object horizontal position - sta $05 ;relative to screen - ldy Enemy_SprDataOffset,x - sty $eb ;get sprite data offset - lda #$00 - sta VerticalFlipFlag ;initialize vertical flip flag by default - lda Enemy_MovingDir,x - sta $03 ;get enemy object moving direction - lda Enemy_SprAttrib,x - sta $04 ;get enemy object sprite attributes - lda Enemy_ID,x - cmp #PiranhaPlant ;is enemy object piranha plant? - bne CheckForRetainerObj ;if not, branch - ldy PiranhaPlant_Y_Speed,x - bmi CheckForRetainerObj ;if piranha plant moving upwards, branch - ldy EnemyFrameTimer,x - beq CheckForRetainerObj ;if timer for movement expired, branch - rts ;if all conditions fail, leave - -CheckForRetainerObj: - lda Enemy_State,x ;store enemy state - sta $ed - and #%00011111 ;nullify all but 5 LSB and use as Y - tay - lda Enemy_ID,x ;check for mushroom retainer/princess object - cmp #RetainerObject - bne CheckForBulletBillCV ;if not found, branch - ldy #$00 ;if found, nullify saved state in Y - lda #$01 ;set value that will not be used - sta $03 - lda #$15 ;set value $15 as code for mushroom retainer/princess object - -CheckForBulletBillCV: - cmp #BulletBill_CannonVar ;otherwise check for bullet bill object - bne CheckForJumpspring ;if not found, branch again - dec $02 ;decrement saved vertical position - lda #$03 - ldy EnemyFrameTimer,x ;get timer for enemy object - beq SBBAt ;if expired, do not set priority bit - ora #%00100000 ;otherwise do so -SBBAt: sta $04 ;set new sprite attributes - ldy #$00 ;nullify saved enemy state both in Y and in - sty $ed ;memory location here - lda #$08 ;set specific value to unconditionally branch once - -CheckForJumpspring: - cmp #JumpspringObject ;check for jumpspring object - bne CheckForPodoboo - ldy #$03 ;set enemy state -2 MSB here for jumpspring object - ldx JumpspringAnimCtrl ;get current frame number for jumpspring object - lda JumpspringFrameOffsets,x ;load data using frame number as offset - -CheckForPodoboo: - sta $ef ;store saved enemy object value here - sty $ec ;and Y here (enemy state -2 MSB if not changed) - ldx ObjectOffset ;get enemy object offset - cmp #$0c ;check for podoboo object - bne CheckBowserGfxFlag ;branch if not found - lda Enemy_Y_Speed,x ;if moving upwards, branch - bmi CheckBowserGfxFlag - inc VerticalFlipFlag ;otherwise, set flag for vertical flip - -CheckBowserGfxFlag: - lda BowserGfxFlag ;if not drawing bowser at all, skip to something else - beq CheckForGoomba - ldy #$16 ;if set to 1, draw bowser's front - cmp #$01 - beq SBwsrGfxOfs - iny ;otherwise draw bowser's rear -SBwsrGfxOfs: sty $ef - -CheckForGoomba: - ldy $ef ;check value for goomba object - cpy #Goomba - bne CheckBowserFront ;branch if not found - lda Enemy_State,x - cmp #$02 ;check for defeated state - bcc GmbaAnim ;if not defeated, go ahead and animate - ldx #$04 ;if defeated, write new value here - stx $ec -GmbaAnim: and #%00100000 ;check for d5 set in enemy object state - ora TimerControl ;or timer disable flag set - bne CheckBowserFront ;if either condition true, do not animate goomba - lda FrameCounter - and #%00001000 ;check for every eighth frame - bne CheckBowserFront - lda $03 - eor #%00000011 ;invert bits to flip horizontally every eight frames - sta $03 ;leave alone otherwise - -CheckBowserFront: - lda EnemyAttributeData,y ;load sprite attribute using enemy object - ora $04 ;as offset, and add to bits already loaded - sta $04 - lda EnemyGfxTableOffsets,y ;load value based on enemy object as offset - tax ;save as X - ldy $ec ;get previously saved value - lda BowserGfxFlag - beq CheckForSpiny ;if not drawing bowser object at all, skip all of this - cmp #$01 - bne CheckBowserRear ;if not drawing front part, branch to draw the rear part - lda BowserBodyControls ;check bowser's body control bits - bpl ChkFrontSte ;branch if d7 not set (control's bowser's mouth) - ldx #$de ;otherwise load offset for second frame -ChkFrontSte: lda $ed ;check saved enemy state - and #%00100000 ;if bowser not defeated, do not set flag - beq DrawBowser - -FlipBowserOver: - stx VerticalFlipFlag ;set vertical flip flag to nonzero - -DrawBowser: - jmp DrawEnemyObject ;draw bowser's graphics now - -CheckBowserRear: - lda BowserBodyControls ;check bowser's body control bits - and #$01 - beq ChkRearSte ;branch if d0 not set (control's bowser's feet) - ldx #$e4 ;otherwise load offset for second frame -ChkRearSte: lda $ed ;check saved enemy state - and #%00100000 ;if bowser not defeated, do not set flag - beq DrawBowser - lda $02 ;subtract 16 pixels from - sec ;saved vertical coordinate - sbc #$10 - sta $02 - jmp FlipBowserOver ;jump to set vertical flip flag - -CheckForSpiny: - cpx #$24 ;check if value loaded is for spiny - bne CheckForLakitu ;if not found, branch - cpy #$05 ;if enemy state set to $05, do this, - bne NotEgg ;otherwise branch - ldx #$30 ;set to spiny egg offset - lda #$02 - sta $03 ;set enemy direction to reverse sprites horizontally - lda #$05 - sta $ec ;set enemy state -NotEgg: jmp CheckForHammerBro ;skip a big chunk of this if we found spiny but not in egg - -CheckForLakitu: - cpx #$90 ;check value for lakitu's offset loaded - bne CheckUpsideDownShell ;branch if not loaded - lda $ed - and #%00100000 ;check for d5 set in enemy state - bne NoLAFr ;branch if set - lda FrenzyEnemyTimer - cmp #$10 ;check timer to see if we've reached a certain range - bcs NoLAFr ;branch if not - ldx #$96 ;if d6 not set and timer in range, load alt frame for lakitu -NoLAFr: jmp CheckDefeatedState ;skip this next part if we found lakitu but alt frame not needed - -CheckUpsideDownShell: - lda $ef ;check for enemy object => $04 - cmp #$04 - bcs CheckRightSideUpShell ;branch if true - cpy #$02 - bcc CheckRightSideUpShell ;branch if enemy state < $02 - ldx #$5a ;set for upside-down koopa shell by default - ldy $ef - cpy #BuzzyBeetle ;check for buzzy beetle object - bne CheckRightSideUpShell - ldx #$7e ;set for upside-down buzzy beetle shell if found - inc $02 ;increment vertical position by one pixel - -CheckRightSideUpShell: - lda $ec ;check for value set here - cmp #$04 ;if enemy state < $02, do not change to shell, if - bne CheckForHammerBro ;enemy state => $02 but not = $04, leave shell upside-down - ldx #$72 ;set right-side up buzzy beetle shell by default - inc $02 ;increment saved vertical position by one pixel - ldy $ef - cpy #BuzzyBeetle ;check for buzzy beetle object - beq CheckForDefdGoomba ;branch if found - ldx #$66 ;change to right-side up koopa shell if not found - inc $02 ;and increment saved vertical position again - -CheckForDefdGoomba: - cpy #Goomba ;check for goomba object (necessary if previously - bne CheckForHammerBro ;failed buzzy beetle object test) - ldx #$54 ;load for regular goomba - lda $ed ;note that this only gets performed if enemy state => $02 - and #%00100000 ;check saved enemy state for d5 set - bne CheckForHammerBro ;branch if set - ldx #$8a ;load offset for defeated goomba - dec $02 ;set different value and decrement saved vertical position - -CheckForHammerBro: - ldy ObjectOffset - lda $ef ;check for hammer bro object - cmp #HammerBro - bne CheckForBloober ;branch if not found - lda $ed - beq CheckToAnimateEnemy ;branch if not in normal enemy state - and #%00001000 - beq CheckDefeatedState ;if d3 not set, branch further away - ldx #$b4 ;otherwise load offset for different frame - bne CheckToAnimateEnemy ;unconditional branch - -CheckForBloober: - cpx #$48 ;check for cheep-cheep offset loaded - beq CheckToAnimateEnemy ;branch if found - lda EnemyIntervalTimer,y - cmp #$05 - bcs CheckDefeatedState ;branch if some timer is above a certain point - cpx #$3c ;check for bloober offset loaded - bne CheckToAnimateEnemy ;branch if not found this time - cmp #$01 - beq CheckDefeatedState ;branch if timer is set to certain point - inc $02 ;increment saved vertical coordinate three pixels - inc $02 - inc $02 - jmp CheckAnimationStop ;and do something else - -CheckToAnimateEnemy: - lda $ef ;check for specific enemy objects - cmp #Goomba - beq CheckDefeatedState ;branch if goomba - cmp #$08 - beq CheckDefeatedState ;branch if bullet bill (note both variants use $08 here) - cmp #Podoboo - beq CheckDefeatedState ;branch if podoboo - cmp #$18 ;branch if => $18 - bcs CheckDefeatedState - ldy #$00 - cmp #$15 ;check for mushroom retainer/princess object - bne CheckForSecondFrame ;which uses different code here, branch if not found - iny ;residual instruction - lda WorldNumber ;are we on world 8? - cmp #World8 - bcs CheckDefeatedState ;if so, leave the offset alone (use princess) - ldx #$a2 ;otherwise, set for mushroom retainer object instead - lda #$03 ;set alternate state here - sta $ec - bne CheckDefeatedState ;unconditional branch - -CheckForSecondFrame: - lda FrameCounter ;load frame counter - and EnemyAnimTimingBMask,y ;mask it (partly residual, one byte not ever used) - bne CheckDefeatedState ;branch if timing is off - -CheckAnimationStop: - lda $ed ;check saved enemy state - and #%10100000 ;for d7 or d5, or check for timers stopped - ora TimerControl - bne CheckDefeatedState ;if either condition true, branch - txa - clc - adc #$06 ;add $06 to current enemy offset - tax ;to animate various enemy objects - -CheckDefeatedState: - lda $ed ;check saved enemy state - and #%00100000 ;for d5 set - beq DrawEnemyObject ;branch if not set - lda $ef - cmp #$04 ;check for saved enemy object => $04 - bcc DrawEnemyObject ;branch if less - ldy #$01 - sty VerticalFlipFlag ;set vertical flip flag - dey - sty $ec ;init saved value here - -DrawEnemyObject: - ldy $eb ;load sprite data offset - jsr DrawEnemyObjRow ;draw six tiles of data - jsr DrawEnemyObjRow ;into sprite data - jsr DrawEnemyObjRow - ldx ObjectOffset ;get enemy object offset - ldy Enemy_SprDataOffset,x ;get sprite data offset - lda $ef - cmp #$08 ;get saved enemy object and check - bne CheckForVerticalFlip ;for bullet bill, branch if not found - -SkipToOffScrChk: - jmp SprObjectOffscrChk ;jump if found - -CheckForVerticalFlip: - lda VerticalFlipFlag ;check if vertical flip flag is set here - beq CheckForESymmetry ;branch if not - lda Sprite_Attributes,y ;get attributes of first sprite we dealt with - ora #%10000000 ;set bit for vertical flip - iny - iny ;increment two bytes so that we store the vertical flip - jsr DumpSixSpr ;in attribute bytes of enemy obj sprite data - dey - dey ;now go back to the Y coordinate offset - tya - tax ;give offset to X - lda $ef - cmp #HammerBro ;check saved enemy object for hammer bro - beq FlipEnemyVertically - cmp #Lakitu ;check saved enemy object for lakitu - beq FlipEnemyVertically ;branch for hammer bro or lakitu - cmp #$15 - bcs FlipEnemyVertically ;also branch if enemy object => $15 - txa - clc - adc #$08 ;if not selected objects or => $15, set - tax ;offset in X for next row - -FlipEnemyVertically: - lda Sprite_Tilenumber,x ;load first or second row tiles - pha ;and save tiles to the stack - lda Sprite_Tilenumber+4,x - pha - lda Sprite_Tilenumber+16,y ;exchange third row tiles - sta Sprite_Tilenumber,x ;with first or second row tiles - lda Sprite_Tilenumber+20,y - sta Sprite_Tilenumber+4,x - pla ;pull first or second row tiles from stack - sta Sprite_Tilenumber+20,y ;and save in third row - pla - sta Sprite_Tilenumber+16,y - -CheckForESymmetry: - lda BowserGfxFlag ;are we drawing bowser at all? - bne SkipToOffScrChk ;branch if so - lda $ef - ldx $ec ;get alternate enemy state - cmp #$05 ;check for hammer bro object - bne ContES - jmp SprObjectOffscrChk ;jump if found -ContES: cmp #Bloober ;check for bloober object - beq MirrorEnemyGfx - cmp #PiranhaPlant ;check for piranha plant object - beq MirrorEnemyGfx - cmp #Podoboo ;check for podoboo object - beq MirrorEnemyGfx ;branch if either of three are found - cmp #Spiny ;check for spiny object - bne ESRtnr ;branch closer if not found - cpx #$05 ;check spiny's state - bne CheckToMirrorLakitu ;branch if not an egg, otherwise -ESRtnr: cmp #$15 ;check for princess/mushroom retainer object - bne SpnySC - lda #$42 ;set horizontal flip on bottom right sprite - sta Sprite_Attributes+20,y ;note that palette bits were already set earlier -SpnySC: cpx #$02 ;if alternate enemy state set to 1 or 0, branch - bcc CheckToMirrorLakitu - -MirrorEnemyGfx: - lda BowserGfxFlag ;if enemy object is bowser, skip all of this - bne CheckToMirrorLakitu - lda Sprite_Attributes,y ;load attribute bits of first sprite - and #%10100011 - sta Sprite_Attributes,y ;save vertical flip, priority, and palette bits - sta Sprite_Attributes+8,y ;in left sprite column of enemy object OAM data - sta Sprite_Attributes+16,y - ora #%01000000 ;set horizontal flip - cpx #$05 ;check for state used by spiny's egg - bne EggExc ;if alternate state not set to $05, branch - ora #%10000000 ;otherwise set vertical flip -EggExc: sta Sprite_Attributes+4,y ;set bits of right sprite column - sta Sprite_Attributes+12,y ;of enemy object sprite data - sta Sprite_Attributes+20,y - cpx #$04 ;check alternate enemy state - bne CheckToMirrorLakitu ;branch if not $04 - lda Sprite_Attributes+8,y ;get second row left sprite attributes - ora #%10000000 - sta Sprite_Attributes+8,y ;store bits with vertical flip in - sta Sprite_Attributes+16,y ;second and third row left sprites - ora #%01000000 - sta Sprite_Attributes+12,y ;store with horizontal and vertical flip in - sta Sprite_Attributes+20,y ;second and third row right sprites - -CheckToMirrorLakitu: - lda $ef ;check for lakitu enemy object - cmp #Lakitu - bne CheckToMirrorJSpring ;branch if not found - lda VerticalFlipFlag - bne NVFLak ;branch if vertical flip flag not set - lda Sprite_Attributes+16,y ;save vertical flip and palette bits - and #%10000001 ;in third row left sprite - sta Sprite_Attributes+16,y - lda Sprite_Attributes+20,y ;set horizontal flip and palette bits - ora #%01000001 ;in third row right sprite - sta Sprite_Attributes+20,y - ldx FrenzyEnemyTimer ;check timer - cpx #$10 - bcs SprObjectOffscrChk ;branch if timer has not reached a certain range - sta Sprite_Attributes+12,y ;otherwise set same for second row right sprite - and #%10000001 - sta Sprite_Attributes+8,y ;preserve vertical flip and palette bits for left sprite - bcc SprObjectOffscrChk ;unconditional branch -NVFLak: lda Sprite_Attributes,y ;get first row left sprite attributes - and #%10000001 - sta Sprite_Attributes,y ;save vertical flip and palette bits - lda Sprite_Attributes+4,y ;get first row right sprite attributes - ora #%01000001 ;set horizontal flip and palette bits - sta Sprite_Attributes+4,y ;note that vertical flip is left as-is - -CheckToMirrorJSpring: - lda $ef ;check for jumpspring object (any frame) - cmp #$18 - bcc SprObjectOffscrChk ;branch if not jumpspring object at all - lda #$82 - sta Sprite_Attributes+8,y ;set vertical flip and palette bits of - sta Sprite_Attributes+16,y ;second and third row left sprites - ora #%01000000 - sta Sprite_Attributes+12,y ;set, in addition to those, horizontal flip - sta Sprite_Attributes+20,y ;for second and third row right sprites - -SprObjectOffscrChk: - ldx ObjectOffset ;get enemy buffer offset - lda Enemy_OffscreenBits ;check offscreen information - lsr - lsr ;shift three times to the right - lsr ;which puts d2 into carry - pha ;save to stack - bcc LcChk ;branch if not set - lda #$04 ;set for right column sprites - jsr MoveESprColOffscreen ;and move them offscreen -LcChk: pla ;get from stack - lsr ;move d3 to carry - pha ;save to stack - bcc Row3C ;branch if not set - lda #$00 ;set for left column sprites, - jsr MoveESprColOffscreen ;move them offscreen -Row3C: pla ;get from stack again - lsr ;move d5 to carry this time - lsr - pha ;save to stack again - bcc Row23C ;branch if carry not set - lda #$10 ;set for third row of sprites - jsr MoveESprRowOffscreen ;and move them offscreen -Row23C: pla ;get from stack - lsr ;move d6 into carry - pha ;save to stack - bcc AllRowC - lda #$08 ;set for second and third rows - jsr MoveESprRowOffscreen ;move them offscreen -AllRowC: pla ;get from stack once more - lsr ;move d7 into carry - bcc ExEGHandler - jsr MoveESprRowOffscreen ;move all sprites offscreen (A should be 0 by now) - lda Enemy_ID,x - cmp #Podoboo ;check enemy identifier for podoboo - beq ExEGHandler ;skip this part if found, we do not want to erase podoboo! - lda Enemy_Y_HighPos,x ;check high byte of vertical position - cmp #$02 ;if not yet past the bottom of the screen, branch - bne ExEGHandler - jsr EraseEnemyObject ;what it says - -ExEGHandler: - rts - -DrawEnemyObjRow: - lda EnemyGraphicsTable,x ;load two tiles of enemy graphics - sta $00 - lda EnemyGraphicsTable+1,x - -DrawOneSpriteRow: - sta $01 - jmp DrawSpriteObject ;draw them - -MoveESprRowOffscreen: - clc ;add A to enemy object OAM data offset - adc Enemy_SprDataOffset,x - tay ;use as offset - lda #$f8 - jmp DumpTwoSpr ;move first row of sprites offscreen - -MoveESprColOffscreen: - clc ;add A to enemy object OAM data offset - adc Enemy_SprDataOffset,x - tay ;use as offset - jsr MoveColOffscreen ;move first and second row sprites in column offscreen - sta Sprite_Data+16,y ;move third row sprite in column offscreen - rts - -;------------------------------------------------------------------------------------- -;$00-$01 - tile numbers -;$02 - relative Y position -;$03 - horizontal flip flag (not used here) -;$04 - attributes -;$05 - relative X position - -DefaultBlockObjTiles: - .db $85, $85, $86, $86 ;brick w/ line (these are sprite tiles, not BG!) - -DrawBlock: - lda Block_Rel_YPos ;get relative vertical coordinate of block object - sta $02 ;store here - lda Block_Rel_XPos ;get relative horizontal coordinate of block object - sta $05 ;store here - lda #$03 - sta $04 ;set attribute byte here - lsr - sta $03 ;set horizontal flip bit here (will not be used) - ldy Block_SprDataOffset,x ;get sprite data offset - ldx #$00 ;reset X for use as offset to tile data -DBlkLoop: lda DefaultBlockObjTiles,x ;get left tile number - sta $00 ;set here - lda DefaultBlockObjTiles+1,x ;get right tile number - jsr DrawOneSpriteRow ;do sub to write tile numbers to first row of sprites - cpx #$04 ;check incremented offset - bne DBlkLoop ;and loop back until all four sprites are done - ldx ObjectOffset ;get block object offset - ldy Block_SprDataOffset,x ;get sprite data offset - lda AreaType - cmp #$01 ;check for ground level type area - beq ChkRep ;if found, branch to next part - lda #$86 - sta Sprite_Tilenumber,y ;otherwise remove brick tiles with lines - sta Sprite_Tilenumber+4,y ;and replace then with lineless brick tiles -ChkRep: lda Block_Metatile,x ;check replacement metatile - cmp #$c4 ;if not used block metatile, then - bne BlkOffscr ;branch ahead to use current graphics - lda #$87 ;set A for used block tile - iny ;increment Y to write to tile bytes - jsr DumpFourSpr ;do sub to dump into all four sprites - dey ;return Y to original offset - lda #$03 ;set palette bits - ldx AreaType - dex ;check for ground level type area again - beq SetBFlip ;if found, use current palette bits - lsr ;otherwise set to $01 -SetBFlip: ldx ObjectOffset ;put block object offset back in X - sta Sprite_Attributes,y ;store attribute byte as-is in first sprite - ora #%01000000 - sta Sprite_Attributes+4,y ;set horizontal flip bit for second sprite - ora #%10000000 - sta Sprite_Attributes+12,y ;set both flip bits for fourth sprite - and #%10000011 - sta Sprite_Attributes+8,y ;set vertical flip bit for third sprite -BlkOffscr: lda Block_OffscreenBits ;get offscreen bits for block object - pha ;save to stack - and #%00000100 ;check to see if d2 in offscreen bits are set - beq PullOfsB ;if not set, branch, otherwise move sprites offscreen - lda #$f8 ;move offscreen two OAMs - sta Sprite_Y_Position+4,y ;on the right side - sta Sprite_Y_Position+12,y -PullOfsB: pla ;pull offscreen bits from stack -ChkLeftCo: and #%00001000 ;check to see if d3 in offscreen bits are set - beq ExDBlk ;if not set, branch, otherwise move sprites offscreen - -MoveColOffscreen: - lda #$f8 ;move offscreen two OAMs - sta Sprite_Y_Position,y ;on the left side (or two rows of enemy on either side - sta Sprite_Y_Position+8,y ;if branched here from enemy graphics handler) -ExDBlk: rts - -;------------------------------------------------------------------------------------- -;$00 - used to hold palette bits for attribute byte or relative X position - -DrawBrickChunks: - lda #$02 ;set palette bits here - sta $00 - lda #$75 ;set tile number for ball (something residual, likely) - ldy GameEngineSubroutine - cpy #$05 ;if end-of-level routine running, - beq DChunks ;use palette and tile number assigned - lda #$03 ;otherwise set different palette bits - sta $00 - lda #$84 ;and set tile number for brick chunks -DChunks: ldy Block_SprDataOffset,x ;get OAM data offset - iny ;increment to start with tile bytes in OAM - jsr DumpFourSpr ;do sub to dump tile number into all four sprites - lda FrameCounter ;get frame counter - asl - asl - asl ;move low nybble to high - asl - and #$c0 ;get what was originally d3-d2 of low nybble - ora $00 ;add palette bits - iny ;increment offset for attribute bytes - jsr DumpFourSpr ;do sub to dump attribute data into all four sprites - dey - dey ;decrement offset to Y coordinate - lda Block_Rel_YPos ;get first block object's relative vertical coordinate - jsr DumpTwoSpr ;do sub to dump current Y coordinate into two sprites - lda Block_Rel_XPos ;get first block object's relative horizontal coordinate - sta Sprite_X_Position,y ;save into X coordinate of first sprite - lda Block_Orig_XPos,x ;get original horizontal coordinate - sec - sbc ScreenLeft_X_Pos ;subtract coordinate of left side from original coordinate - sta $00 ;store result as relative horizontal coordinate of original - sec - sbc Block_Rel_XPos ;get difference of relative positions of original - current - adc $00 ;add original relative position to result - adc #$06 ;plus 6 pixels to position second brick chunk correctly - sta Sprite_X_Position+4,y ;save into X coordinate of second sprite - lda Block_Rel_YPos+1 ;get second block object's relative vertical coordinate - sta Sprite_Y_Position+8,y - sta Sprite_Y_Position+12,y ;dump into Y coordinates of third and fourth sprites - lda Block_Rel_XPos+1 ;get second block object's relative horizontal coordinate - sta Sprite_X_Position+8,y ;save into X coordinate of third sprite - lda $00 ;use original relative horizontal position - sec - sbc Block_Rel_XPos+1 ;get difference of relative positions of original - current - adc $00 ;add original relative position to result - adc #$06 ;plus 6 pixels to position fourth brick chunk correctly - sta Sprite_X_Position+12,y ;save into X coordinate of fourth sprite - lda Block_OffscreenBits ;get offscreen bits for block object - jsr ChkLeftCo ;do sub to move left half of sprites offscreen if necessary - lda Block_OffscreenBits ;get offscreen bits again - asl ;shift d7 into carry - bcc ChnkOfs ;if d7 not set, branch to last part - lda #$f8 - jsr DumpTwoSpr ;otherwise move top sprites offscreen -ChnkOfs: lda $00 ;if relative position on left side of screen, - bpl ExBCDr ;go ahead and leave - lda Sprite_X_Position,y ;otherwise compare left-side X coordinate - cmp Sprite_X_Position+4,y ;to right-side X coordinate - bcc ExBCDr ;branch to leave if less - lda #$f8 ;otherwise move right half of sprites offscreen - sta Sprite_Y_Position+4,y - sta Sprite_Y_Position+12,y -ExBCDr: rts ;leave - -;------------------------------------------------------------------------------------- - -DrawFireball: - ldy FBall_SprDataOffset,x ;get fireball's sprite data offset - lda Fireball_Rel_YPos ;get relative vertical coordinate - sta Sprite_Y_Position,y ;store as sprite Y coordinate - lda Fireball_Rel_XPos ;get relative horizontal coordinate - sta Sprite_X_Position,y ;store as sprite X coordinate, then do shared code - -DrawFirebar: - lda FrameCounter ;get frame counter - lsr ;divide by four - lsr - pha ;save result to stack - and #$01 ;mask out all but last bit - eor #$64 ;set either tile $64 or $65 as fireball tile - sta Sprite_Tilenumber,y ;thus tile changes every four frames - pla ;get from stack - lsr ;divide by four again - lsr - lda #$02 ;load value $02 to set palette in attrib byte - bcc FireA ;if last bit shifted out was not set, skip this - ora #%11000000 ;otherwise flip both ways every eight frames -FireA: sta Sprite_Attributes,y ;store attribute byte and leave - rts - -;------------------------------------------------------------------------------------- - -ExplosionTiles: - .db $68, $67, $66 - -DrawExplosion_Fireball: - ldy Alt_SprDataOffset,x ;get OAM data offset of alternate sort for fireball's explosion - lda Fireball_State,x ;load fireball state - inc Fireball_State,x ;increment state for next frame - lsr ;divide by 2 - and #%00000111 ;mask out all but d3-d1 - cmp #$03 ;check to see if time to kill fireball - bcs KillFireBall ;branch if so, otherwise continue to draw explosion - -DrawExplosion_Fireworks: - tax ;use whatever's in A for offset - lda ExplosionTiles,x ;get tile number using offset - iny ;increment Y (contains sprite data offset) - jsr DumpFourSpr ;and dump into tile number part of sprite data - dey ;decrement Y so we have the proper offset again - ldx ObjectOffset ;return enemy object buffer offset to X - lda Fireball_Rel_YPos ;get relative vertical coordinate - sec ;subtract four pixels vertically - sbc #$04 ;for first and third sprites - sta Sprite_Y_Position,y - sta Sprite_Y_Position+8,y - clc ;add eight pixels vertically - adc #$08 ;for second and fourth sprites - sta Sprite_Y_Position+4,y - sta Sprite_Y_Position+12,y - lda Fireball_Rel_XPos ;get relative horizontal coordinate - sec ;subtract four pixels horizontally - sbc #$04 ;for first and second sprites - sta Sprite_X_Position,y - sta Sprite_X_Position+4,y - clc ;add eight pixels horizontally - adc #$08 ;for third and fourth sprites - sta Sprite_X_Position+8,y - sta Sprite_X_Position+12,y - lda #$02 ;set palette attributes for all sprites, but - sta Sprite_Attributes,y ;set no flip at all for first sprite - lda #$82 - sta Sprite_Attributes+4,y ;set vertical flip for second sprite - lda #$42 - sta Sprite_Attributes+8,y ;set horizontal flip for third sprite - lda #$c2 - sta Sprite_Attributes+12,y ;set both flips for fourth sprite - rts ;we are done - -KillFireBall: - lda #$00 ;clear fireball state to kill it - sta Fireball_State,x - rts - -;------------------------------------------------------------------------------------- - -DrawSmallPlatform: - ldy Enemy_SprDataOffset,x ;get OAM data offset - lda #$5b ;load tile number for small platforms - iny ;increment offset for tile numbers - jsr DumpSixSpr ;dump tile number into all six sprites - iny ;increment offset for attributes - lda #$02 ;load palette controls - jsr DumpSixSpr ;dump attributes into all six sprites - dey ;decrement for original offset - dey - lda Enemy_Rel_XPos ;get relative horizontal coordinate - sta Sprite_X_Position,y - sta Sprite_X_Position+12,y ;dump as X coordinate into first and fourth sprites - clc - adc #$08 ;add eight pixels - sta Sprite_X_Position+4,y ;dump into second and fifth sprites - sta Sprite_X_Position+16,y - clc - adc #$08 ;add eight more pixels - sta Sprite_X_Position+8,y ;dump into third and sixth sprites - sta Sprite_X_Position+20,y - lda Enemy_Y_Position,x ;get vertical coordinate - tax - pha ;save to stack - cpx #$20 ;if vertical coordinate below status bar, - bcs TopSP ;do not mess with it - lda #$f8 ;otherwise move first three sprites offscreen -TopSP: jsr DumpThreeSpr ;dump vertical coordinate into Y coordinates - pla ;pull from stack - clc - adc #$80 ;add 128 pixels - tax - cpx #$20 ;if below status bar (taking wrap into account) - bcs BotSP ;then do not change altered coordinate - lda #$f8 ;otherwise move last three sprites offscreen -BotSP: sta Sprite_Y_Position+12,y ;dump vertical coordinate + 128 pixels - sta Sprite_Y_Position+16,y ;into Y coordinates - sta Sprite_Y_Position+20,y - lda Enemy_OffscreenBits ;get offscreen bits - pha ;save to stack - and #%00001000 ;check d3 - beq SOfs - lda #$f8 ;if d3 was set, move first and - sta Sprite_Y_Position,y ;fourth sprites offscreen - sta Sprite_Y_Position+12,y -SOfs: pla ;move out and back into stack - pha - and #%00000100 ;check d2 - beq SOfs2 - lda #$f8 ;if d2 was set, move second and - sta Sprite_Y_Position+4,y ;fifth sprites offscreen - sta Sprite_Y_Position+16,y -SOfs2: pla ;get from stack - and #%00000010 ;check d1 - beq ExSPl - lda #$f8 ;if d1 was set, move third and - sta Sprite_Y_Position+8,y ;sixth sprites offscreen - sta Sprite_Y_Position+20,y -ExSPl: ldx ObjectOffset ;get enemy object offset and leave - rts - -;------------------------------------------------------------------------------------- - -DrawBubble: - ldy Player_Y_HighPos ;if player's vertical high position - dey ;not within screen, skip all of this - bne ExDBub - lda Bubble_OffscreenBits ;check air bubble's offscreen bits - and #%00001000 - bne ExDBub ;if bit set, branch to leave - ldy Bubble_SprDataOffset,x ;get air bubble's OAM data offset - lda Bubble_Rel_XPos ;get relative horizontal coordinate - sta Sprite_X_Position,y ;store as X coordinate here - lda Bubble_Rel_YPos ;get relative vertical coordinate - sta Sprite_Y_Position,y ;store as Y coordinate here - lda #$74 - sta Sprite_Tilenumber,y ;put air bubble tile into OAM data - lda #$02 - sta Sprite_Attributes,y ;set attribute byte -ExDBub: rts ;leave - -;------------------------------------------------------------------------------------- -;$00 - used to store player's vertical offscreen bits - -PlayerGfxTblOffsets: - .db $20, $28, $c8, $18, $00, $40, $50, $58 - .db $80, $88, $b8, $78, $60, $a0, $b0, $b8 - -;tiles arranged in order, 2 tiles per row, top to bottom - -PlayerGraphicsTable: -;big player table - .db $00, $01, $02, $03, $04, $05, $06, $07 ;walking frame 1 - .db $08, $09, $0a, $0b, $0c, $0d, $0e, $0f ; frame 2 - .db $10, $11, $12, $13, $14, $15, $16, $17 ; frame 3 - .db $18, $19, $1a, $1b, $1c, $1d, $1e, $1f ;skidding - .db $20, $21, $22, $23, $24, $25, $26, $27 ;jumping - .db $08, $09, $28, $29, $2a, $2b, $2c, $2d ;swimming frame 1 - .db $08, $09, $0a, $0b, $0c, $30, $2c, $2d ; frame 2 - .db $08, $09, $0a, $0b, $2e, $2f, $2c, $2d ; frame 3 - .db $08, $09, $28, $29, $2a, $2b, $5c, $5d ;climbing frame 1 - .db $08, $09, $0a, $0b, $0c, $0d, $5e, $5f ; frame 2 - .db $fc, $fc, $08, $09, $58, $59, $5a, $5a ;crouching - .db $08, $09, $28, $29, $2a, $2b, $0e, $0f ;fireball throwing - -;small player table - .db $fc, $fc, $fc, $fc, $32, $33, $34, $35 ;walking frame 1 - .db $fc, $fc, $fc, $fc, $36, $37, $38, $39 ; frame 2 - .db $fc, $fc, $fc, $fc, $3a, $37, $3b, $3c ; frame 3 - .db $fc, $fc, $fc, $fc, $3d, $3e, $3f, $40 ;skidding - .db $fc, $fc, $fc, $fc, $32, $41, $42, $43 ;jumping - .db $fc, $fc, $fc, $fc, $32, $33, $44, $45 ;swimming frame 1 - .db $fc, $fc, $fc, $fc, $32, $33, $44, $47 ; frame 2 - .db $fc, $fc, $fc, $fc, $32, $33, $48, $49 ; frame 3 - .db $fc, $fc, $fc, $fc, $32, $33, $90, $91 ;climbing frame 1 - .db $fc, $fc, $fc, $fc, $3a, $37, $92, $93 ; frame 2 - .db $fc, $fc, $fc, $fc, $9e, $9e, $9f, $9f ;killed - -;used by both player sizes - .db $fc, $fc, $fc, $fc, $3a, $37, $4f, $4f ;small player standing - .db $fc, $fc, $00, $01, $4c, $4d, $4e, $4e ;intermediate grow frame - .db $00, $01, $4c, $4d, $4a, $4a, $4b, $4b ;big player standing - -SwimKickTileNum: - .db $31, $46 - -PlayerGfxHandler: - lda InjuryTimer ;if player's injured invincibility timer - beq CntPl ;not set, skip checkpoint and continue code - lda FrameCounter - lsr ;otherwise check frame counter and branch - bcs ExPGH ;to leave on every other frame (when d0 is set) -CntPl: lda GameEngineSubroutine ;if executing specific game engine routine, - cmp #$0b ;branch ahead to some other part - beq PlayerKilled - lda PlayerChangeSizeFlag ;if grow/shrink flag set - bne DoChangeSize ;then branch to some other code - ldy SwimmingFlag ;if swimming flag set, branch to - beq FindPlayerAction ;different part, do not return - lda Player_State - cmp #$00 ;if player status normal, - beq FindPlayerAction ;branch and do not return - jsr FindPlayerAction ;otherwise jump and return - lda FrameCounter - and #%00000100 ;check frame counter for d2 set (8 frames every - bne ExPGH ;eighth frame), and branch if set to leave - tax ;initialize X to zero - ldy Player_SprDataOffset ;get player sprite data offset - lda PlayerFacingDir ;get player's facing direction - lsr - bcs SwimKT ;if player facing to the right, use current offset - iny - iny ;otherwise move to next OAM data - iny - iny -SwimKT: lda PlayerSize ;check player's size - beq BigKTS ;if big, use first tile - lda Sprite_Tilenumber+24,y ;check tile number of seventh/eighth sprite - cmp SwimTileRepOffset ;against tile number in player graphics table - beq ExPGH ;if spr7/spr8 tile number = value, branch to leave - inx ;otherwise increment X for second tile -BigKTS: lda SwimKickTileNum,x ;overwrite tile number in sprite 7/8 - sta Sprite_Tilenumber+24,y ;to animate player's feet when swimming -ExPGH: rts ;then leave - -FindPlayerAction: - jsr ProcessPlayerAction ;find proper offset to graphics table by player's actions - jmp PlayerGfxProcessing ;draw player, then process for fireball throwing - -DoChangeSize: - jsr HandleChangeSize ;find proper offset to graphics table for grow/shrink - jmp PlayerGfxProcessing ;draw player, then process for fireball throwing - -PlayerKilled: - ldy #$0e ;load offset for player killed - lda PlayerGfxTblOffsets,y ;get offset to graphics table - -PlayerGfxProcessing: - sta PlayerGfxOffset ;store offset to graphics table here - lda #$04 - jsr RenderPlayerSub ;draw player based on offset loaded - jsr ChkForPlayerAttrib ;set horizontal flip bits as necessary - lda FireballThrowingTimer - beq PlayerOffscreenChk ;if fireball throw timer not set, skip to the end - ldy #$00 ;set value to initialize by default - lda PlayerAnimTimer ;get animation frame timer - cmp FireballThrowingTimer ;compare to fireball throw timer - sty FireballThrowingTimer ;initialize fireball throw timer - bcs PlayerOffscreenChk ;if animation frame timer => fireball throw timer skip to end - sta FireballThrowingTimer ;otherwise store animation timer into fireball throw timer - ldy #$07 ;load offset for throwing - lda PlayerGfxTblOffsets,y ;get offset to graphics table - sta PlayerGfxOffset ;store it for use later - ldy #$04 ;set to update four sprite rows by default - lda Player_X_Speed - ora Left_Right_Buttons ;check for horizontal speed or left/right button press - beq SUpdR ;if no speed or button press, branch using set value in Y - dey ;otherwise set to update only three sprite rows -SUpdR: tya ;save in A for use - jsr RenderPlayerSub ;in sub, draw player object again - -PlayerOffscreenChk: - lda Player_OffscreenBits ;get player's offscreen bits - lsr - lsr ;move vertical bits to low nybble - lsr - lsr - sta $00 ;store here - ldx #$03 ;check all four rows of player sprites - lda Player_SprDataOffset ;get player's sprite data offset - clc - adc #$18 ;add 24 bytes to start at bottom row - tay ;set as offset here -PROfsLoop: lda #$f8 ;load offscreen Y coordinate just in case - lsr $00 ;shift bit into carry - bcc NPROffscr ;if bit not set, skip, do not move sprites - jsr DumpTwoSpr ;otherwise dump offscreen Y coordinate into sprite data -NPROffscr: tya - sec ;subtract eight bytes to do - sbc #$08 ;next row up - tay - dex ;decrement row counter - bpl PROfsLoop ;do this until all sprite rows are checked - rts ;then we are done! - -;------------------------------------------------------------------------------------- - -IntermediatePlayerData: - .db $58, $01, $00, $60, $ff, $04 - -DrawPlayer_Intermediate: - ldx #$05 ;store data into zero page memory -PIntLoop: lda IntermediatePlayerData,x ;load data to display player as he always - sta $02,x ;appears on world/lives display - dex - bpl PIntLoop ;do this until all data is loaded - ldx #$b8 ;load offset for small standing - ldy #$04 ;load sprite data offset - jsr DrawPlayerLoop ;draw player accordingly - lda Sprite_Attributes+36 ;get empty sprite attributes - ora #%01000000 ;set horizontal flip bit for bottom-right sprite - sta Sprite_Attributes+32 ;store and leave - rts - -;------------------------------------------------------------------------------------- -;$00-$01 - used to hold tile numbers, $00 also used to hold upper extent of animation frames -;$02 - vertical position -;$03 - facing direction, used as horizontal flip control -;$04 - attributes -;$05 - horizontal position -;$07 - number of rows to draw -;these also used in IntermediatePlayerData - -RenderPlayerSub: - sta $07 ;store number of rows of sprites to draw - lda Player_Rel_XPos - sta Player_Pos_ForScroll ;store player's relative horizontal position - sta $05 ;store it here also - lda Player_Rel_YPos - sta $02 ;store player's vertical position - lda PlayerFacingDir - sta $03 ;store player's facing direction - lda Player_SprAttrib - sta $04 ;store player's sprite attributes - ldx PlayerGfxOffset ;load graphics table offset - ldy Player_SprDataOffset ;get player's sprite data offset - -DrawPlayerLoop: - lda PlayerGraphicsTable,x ;load player's left side - sta $00 - lda PlayerGraphicsTable+1,x ;now load right side - jsr DrawOneSpriteRow - dec $07 ;decrement rows of sprites to draw - bne DrawPlayerLoop ;do this until all rows are drawn - rts - -ProcessPlayerAction: - lda Player_State ;get player's state - cmp #$03 - beq ActionClimbing ;if climbing, branch here - cmp #$02 - beq ActionFalling ;if falling, branch here - cmp #$01 - bne ProcOnGroundActs ;if not jumping, branch here - lda SwimmingFlag - bne ActionSwimming ;if swimming flag set, branch elsewhere - ldy #$06 ;load offset for crouching - lda CrouchingFlag ;get crouching flag - bne NonAnimatedActs ;if set, branch to get offset for graphics table - ldy #$00 ;otherwise load offset for jumping - jmp NonAnimatedActs ;go to get offset to graphics table - -ProcOnGroundActs: - ldy #$06 ;load offset for crouching - lda CrouchingFlag ;get crouching flag - bne NonAnimatedActs ;if set, branch to get offset for graphics table - ldy #$02 ;load offset for standing - lda Player_X_Speed ;check player's horizontal speed - ora Left_Right_Buttons ;and left/right controller bits - beq NonAnimatedActs ;if no speed or buttons pressed, use standing offset - lda Player_XSpeedAbsolute ;load walking/running speed - cmp #$09 - bcc ActionWalkRun ;if less than a certain amount, branch, too slow to skid - lda Player_MovingDir ;otherwise check to see if moving direction - and PlayerFacingDir ;and facing direction are the same - bne ActionWalkRun ;if moving direction = facing direction, branch, don't skid - iny ;otherwise increment to skid offset ($03) - -NonAnimatedActs: - jsr GetGfxOffsetAdder ;do a sub here to get offset adder for graphics table - lda #$00 - sta PlayerAnimCtrl ;initialize animation frame control - lda PlayerGfxTblOffsets,y ;load offset to graphics table using size as offset - rts - -ActionFalling: - ldy #$04 ;load offset for walking/running - jsr GetGfxOffsetAdder ;get offset to graphics table - jmp GetCurrentAnimOffset ;execute instructions for falling state - -ActionWalkRun: - ldy #$04 ;load offset for walking/running - jsr GetGfxOffsetAdder ;get offset to graphics table - jmp FourFrameExtent ;execute instructions for normal state - -ActionClimbing: - ldy #$05 ;load offset for climbing - lda Player_Y_Speed ;check player's vertical speed - beq NonAnimatedActs ;if no speed, branch, use offset as-is - jsr GetGfxOffsetAdder ;otherwise get offset for graphics table - jmp ThreeFrameExtent ;then skip ahead to more code - -ActionSwimming: - ldy #$01 ;load offset for swimming - jsr GetGfxOffsetAdder - lda JumpSwimTimer ;check jump/swim timer - ora PlayerAnimCtrl ;and animation frame control - bne FourFrameExtent ;if any one of these set, branch ahead - lda A_B_Buttons - asl ;check for A button pressed - bcs FourFrameExtent ;branch to same place if A button pressed - -GetCurrentAnimOffset: - lda PlayerAnimCtrl ;get animation frame control - jmp GetOffsetFromAnimCtrl ;jump to get proper offset to graphics table - -FourFrameExtent: - lda #$03 ;load upper extent for frame control - jmp AnimationControl ;jump to get offset and animate player object - -ThreeFrameExtent: - lda #$02 ;load upper extent for frame control for climbing - -AnimationControl: - sta $00 ;store upper extent here - jsr GetCurrentAnimOffset ;get proper offset to graphics table - pha ;save offset to stack - lda PlayerAnimTimer ;load animation frame timer - bne ExAnimC ;branch if not expired - lda PlayerAnimTimerSet ;get animation frame timer amount - sta PlayerAnimTimer ;and set timer accordingly - lda PlayerAnimCtrl - clc ;add one to animation frame control - adc #$01 - cmp $00 ;compare to upper extent - bcc SetAnimC ;if frame control + 1 < upper extent, use as next - lda #$00 ;otherwise initialize frame control -SetAnimC: sta PlayerAnimCtrl ;store as new animation frame control -ExAnimC: pla ;get offset to graphics table from stack and leave - rts - -GetGfxOffsetAdder: - lda PlayerSize ;get player's size - beq SzOfs ;if player big, use current offset as-is - tya ;for big player - clc ;otherwise add eight bytes to offset - adc #$08 ;for small player - tay -SzOfs: rts ;go back - -ChangeSizeOffsetAdder: - .db $00, $01, $00, $01, $00, $01, $02, $00, $01, $02 - .db $02, $00, $02, $00, $02, $00, $02, $00, $02, $00 - -HandleChangeSize: - ldy PlayerAnimCtrl ;get animation frame control - lda FrameCounter - and #%00000011 ;get frame counter and execute this code every - bne GorSLog ;fourth frame, otherwise branch ahead - iny ;increment frame control - cpy #$0a ;check for preset upper extent - bcc CSzNext ;if not there yet, skip ahead to use - ldy #$00 ;otherwise initialize both grow/shrink flag - sty PlayerChangeSizeFlag ;and animation frame control -CSzNext: sty PlayerAnimCtrl ;store proper frame control -GorSLog: lda PlayerSize ;get player's size - bne ShrinkPlayer ;if player small, skip ahead to next part - lda ChangeSizeOffsetAdder,y ;get offset adder based on frame control as offset - ldy #$0f ;load offset for player growing - -GetOffsetFromAnimCtrl: - asl ;multiply animation frame control - asl ;by eight to get proper amount - asl ;to add to our offset - adc PlayerGfxTblOffsets,y ;add to offset to graphics table - rts ;and return with result in A - -ShrinkPlayer: - tya ;add ten bytes to frame control as offset - clc - adc #$0a ;this thing apparently uses two of the swimming frames - tax ;to draw the player shrinking - ldy #$09 ;load offset for small player swimming - lda ChangeSizeOffsetAdder,x ;get what would normally be offset adder - bne ShrPlF ;and branch to use offset if nonzero - ldy #$01 ;otherwise load offset for big player swimming -ShrPlF: lda PlayerGfxTblOffsets,y ;get offset to graphics table based on offset loaded - rts ;and leave - -ChkForPlayerAttrib: - ldy Player_SprDataOffset ;get sprite data offset - lda GameEngineSubroutine - cmp #$0b ;if executing specific game engine routine, - beq KilledAtt ;branch to change third and fourth row OAM attributes - lda PlayerGfxOffset ;get graphics table offset - cmp #$50 - beq C_S_IGAtt ;if crouch offset, either standing offset, - cmp #$b8 ;or intermediate growing offset, - beq C_S_IGAtt ;go ahead and execute code to change - cmp #$c0 ;fourth row OAM attributes only - beq C_S_IGAtt - cmp #$c8 - bne ExPlyrAt ;if none of these, branch to leave -KilledAtt: lda Sprite_Attributes+16,y - and #%00111111 ;mask out horizontal and vertical flip bits - sta Sprite_Attributes+16,y ;for third row sprites and save - lda Sprite_Attributes+20,y - and #%00111111 - ora #%01000000 ;set horizontal flip bit for second - sta Sprite_Attributes+20,y ;sprite in the third row -C_S_IGAtt: lda Sprite_Attributes+24,y - and #%00111111 ;mask out horizontal and vertical flip bits - sta Sprite_Attributes+24,y ;for fourth row sprites and save - lda Sprite_Attributes+28,y - and #%00111111 - ora #%01000000 ;set horizontal flip bit for second - sta Sprite_Attributes+28,y ;sprite in the fourth row -ExPlyrAt: rts ;leave - -;------------------------------------------------------------------------------------- -;$00 - used in adding to get proper offset - -RelativePlayerPosition: - ldx #$00 ;set offsets for relative cooordinates - ldy #$00 ;routine to correspond to player object - jmp RelWOfs ;get the coordinates - -RelativeBubblePosition: - ldy #$01 ;set for air bubble offsets - jsr GetProperObjOffset ;modify X to get proper air bubble offset - ldy #$03 - jmp RelWOfs ;get the coordinates - -RelativeFireballPosition: - ldy #$00 ;set for fireball offsets - jsr GetProperObjOffset ;modify X to get proper fireball offset - ldy #$02 -RelWOfs: jsr GetObjRelativePosition ;get the coordinates - ldx ObjectOffset ;return original offset - rts ;leave - -RelativeMiscPosition: - ldy #$02 ;set for misc object offsets - jsr GetProperObjOffset ;modify X to get proper misc object offset - ldy #$06 - jmp RelWOfs ;get the coordinates - -RelativeEnemyPosition: - lda #$01 ;get coordinates of enemy object - ldy #$01 ;relative to the screen - jmp VariableObjOfsRelPos - -RelativeBlockPosition: - lda #$09 ;get coordinates of one block object - ldy #$04 ;relative to the screen - jsr VariableObjOfsRelPos - inx ;adjust offset for other block object if any - inx - lda #$09 - iny ;adjust other and get coordinates for other one - -VariableObjOfsRelPos: - stx $00 ;store value to add to A here - clc - adc $00 ;add A to value stored - tax ;use as enemy offset - jsr GetObjRelativePosition - ldx ObjectOffset ;reload old object offset and leave - rts - -GetObjRelativePosition: - lda SprObject_Y_Position,x ;load vertical coordinate low - sta SprObject_Rel_YPos,y ;store here - lda SprObject_X_Position,x ;load horizontal coordinate - sec ;subtract left edge coordinate - sbc ScreenLeft_X_Pos - sta SprObject_Rel_XPos,y ;store result here - rts - -;------------------------------------------------------------------------------------- -;$00 - used as temp variable to hold offscreen bits - -GetPlayerOffscreenBits: - ldx #$00 ;set offsets for player-specific variables - ldy #$00 ;and get offscreen information about player - jmp GetOffScreenBitsSet - -GetFireballOffscreenBits: - ldy #$00 ;set for fireball offsets - jsr GetProperObjOffset ;modify X to get proper fireball offset - ldy #$02 ;set other offset for fireball's offscreen bits - jmp GetOffScreenBitsSet ;and get offscreen information about fireball - -GetBubbleOffscreenBits: - ldy #$01 ;set for air bubble offsets - jsr GetProperObjOffset ;modify X to get proper air bubble offset - ldy #$03 ;set other offset for airbubble's offscreen bits - jmp GetOffScreenBitsSet ;and get offscreen information about air bubble - -GetMiscOffscreenBits: - ldy #$02 ;set for misc object offsets - jsr GetProperObjOffset ;modify X to get proper misc object offset - ldy #$06 ;set other offset for misc object's offscreen bits - jmp GetOffScreenBitsSet ;and get offscreen information about misc object - -ObjOffsetData: - .db $07, $16, $0d - -GetProperObjOffset: - txa ;move offset to A - clc - adc ObjOffsetData,y ;add amount of bytes to offset depending on setting in Y - tax ;put back in X and leave - rts - -GetEnemyOffscreenBits: - lda #$01 ;set A to add 1 byte in order to get enemy offset - ldy #$01 ;set Y to put offscreen bits in Enemy_OffscreenBits - jmp SetOffscrBitsOffset - -GetBlockOffscreenBits: - lda #$09 ;set A to add 9 bytes in order to get block obj offset - ldy #$04 ;set Y to put offscreen bits in Block_OffscreenBits - -SetOffscrBitsOffset: - stx $00 - clc ;add contents of X to A to get - adc $00 ;appropriate offset, then give back to X - tax - -GetOffScreenBitsSet: - tya ;save offscreen bits offset to stack for now - pha - jsr RunOffscrBitsSubs - asl ;move low nybble to high nybble - asl - asl - asl - ora $00 ;mask together with previously saved low nybble - sta $00 ;store both here - pla ;get offscreen bits offset from stack - tay - lda $00 ;get value here and store elsewhere - sta SprObject_OffscrBits,y - ldx ObjectOffset - rts - -RunOffscrBitsSubs: - jsr GetXOffscreenBits ;do subroutine here - lsr ;move high nybble to low - lsr - lsr - lsr - sta $00 ;store here - jmp GetYOffscreenBits - -;-------------------------------- -;(these apply to these three subsections) -;$04 - used to store proper offset -;$05 - used as adder in DividePDiff -;$06 - used to store preset value used to compare to pixel difference in $07 -;$07 - used to store difference between coordinates of object and screen edges - -XOffscreenBitsData: - .db $7f, $3f, $1f, $0f, $07, $03, $01, $00 - .db $80, $c0, $e0, $f0, $f8, $fc, $fe, $ff - -DefaultXOnscreenOfs: - .db $07, $0f, $07 - -GetXOffscreenBits: - stx $04 ;save position in buffer to here - ldy #$01 ;start with right side of screen -XOfsLoop: lda ScreenEdge_X_Pos,y ;get pixel coordinate of edge - sec ;get difference between pixel coordinate of edge - sbc SprObject_X_Position,x ;and pixel coordinate of object position - sta $07 ;store here - lda ScreenEdge_PageLoc,y ;get page location of edge - sbc SprObject_PageLoc,x ;subtract from page location of object position - ldx DefaultXOnscreenOfs,y ;load offset value here - cmp #$00 - bmi XLdBData ;if beyond right edge or in front of left edge, branch - ldx DefaultXOnscreenOfs+1,y ;if not, load alternate offset value here - cmp #$01 - bpl XLdBData ;if one page or more to the left of either edge, branch - lda #$38 ;if no branching, load value here and store - sta $06 - lda #$08 ;load some other value and execute subroutine - jsr DividePDiff -XLdBData: lda XOffscreenBitsData,x ;get bits here - ldx $04 ;reobtain position in buffer - cmp #$00 ;if bits not zero, branch to leave - bne ExXOfsBS - dey ;otherwise, do left side of screen now - bpl XOfsLoop ;branch if not already done with left side -ExXOfsBS: rts - -;-------------------------------- - -YOffscreenBitsData: - .db $00, $08, $0c, $0e - .db $0f, $07, $03, $01 - .db $00 - -DefaultYOnscreenOfs: - .db $04, $00, $04 - -HighPosUnitData: - .db $ff, $00 - -GetYOffscreenBits: - stx $04 ;save position in buffer to here - ldy #$01 ;start with top of screen -YOfsLoop: lda HighPosUnitData,y ;load coordinate for edge of vertical unit - sec - sbc SprObject_Y_Position,x ;subtract from vertical coordinate of object - sta $07 ;store here - lda #$01 ;subtract one from vertical high byte of object - sbc SprObject_Y_HighPos,x - ldx DefaultYOnscreenOfs,y ;load offset value here - cmp #$00 - bmi YLdBData ;if under top of the screen or beyond bottom, branch - ldx DefaultYOnscreenOfs+1,y ;if not, load alternate offset value here - cmp #$01 - bpl YLdBData ;if one vertical unit or more above the screen, branch - lda #$20 ;if no branching, load value here and store - sta $06 - lda #$04 ;load some other value and execute subroutine - jsr DividePDiff -YLdBData: lda YOffscreenBitsData,x ;get offscreen data bits using offset - ldx $04 ;reobtain position in buffer - cmp #$00 - bne ExYOfsBS ;if bits not zero, branch to leave - dey ;otherwise, do bottom of the screen now - bpl YOfsLoop -ExYOfsBS: rts - -;-------------------------------- - -DividePDiff: - sta $05 ;store current value in A here - lda $07 ;get pixel difference - cmp $06 ;compare to preset value - bcs ExDivPD ;if pixel difference >= preset value, branch - lsr ;divide by eight - lsr - lsr - and #$07 ;mask out all but 3 LSB - cpy #$01 ;right side of the screen or top? - bcs SetOscrO ;if so, branch, use difference / 8 as offset - adc $05 ;if not, add value to difference / 8 -SetOscrO: tax ;use as offset -ExDivPD: rts ;leave - -;------------------------------------------------------------------------------------- -;$00-$01 - tile numbers -;$02 - Y coordinate -;$03 - flip control -;$04 - sprite attributes -;$05 - X coordinate - -DrawSpriteObject: - lda $03 ;get saved flip control bits - lsr - lsr ;move d1 into carry - lda $00 - bcc NoHFlip ;if d1 not set, branch - sta Sprite_Tilenumber+4,y ;store first tile into second sprite - lda $01 ;and second into first sprite - sta Sprite_Tilenumber,y - lda #$40 ;activate horizontal flip OAM attribute - bne SetHFAt ;and unconditionally branch -NoHFlip: sta Sprite_Tilenumber,y ;store first tile into first sprite - lda $01 ;and second into second sprite - sta Sprite_Tilenumber+4,y - lda #$00 ;clear bit for horizontal flip -SetHFAt: ora $04 ;add other OAM attributes if necessary - sta Sprite_Attributes,y ;store sprite attributes - sta Sprite_Attributes+4,y - lda $02 ;now the y coordinates - sta Sprite_Y_Position,y ;note because they are - sta Sprite_Y_Position+4,y ;side by side, they are the same - lda $05 - sta Sprite_X_Position,y ;store x coordinate, then - clc ;add 8 pixels and store another to - adc #$08 ;put them side by side - sta Sprite_X_Position+4,y - lda $02 ;add eight pixels to the next y - clc ;coordinate - adc #$08 - sta $02 - tya ;add eight to the offset in Y to - clc ;move to the next two sprites - adc #$08 - tay - inx ;increment offset to return it to the - inx ;routine that called this subroutine - rts - -;------------------------------------------------------------------------------------- - -;unused space - .db $ff, $ff, $ff, $ff, $ff, $ff - -;------------------------------------------------------------------------------------- - -SoundEngine: - lda OperMode ;are we in title screen mode? - bne SndOn - sta SND_MASTERCTRL_REG ;if so, disable sound and leave - rts -SndOn: lda #$ff - sta JOYPAD_PORT2 ;disable irqs and set frame counter mode??? - lda #$0f - sta SND_MASTERCTRL_REG ;enable first four channels - lda PauseModeFlag ;is sound already in pause mode? - bne InPause - lda PauseSoundQueue ;if not, check pause sfx queue - cmp #$01 - bne RunSoundSubroutines ;if queue is empty, skip pause mode routine -InPause: lda PauseSoundBuffer ;check pause sfx buffer - bne ContPau - lda PauseSoundQueue ;check pause queue - beq SkipSoundSubroutines - sta PauseSoundBuffer ;if queue full, store in buffer and activate - sta PauseModeFlag ;pause mode to interrupt game sounds - lda #$00 ;disable sound and clear sfx buffers - sta SND_MASTERCTRL_REG - sta Square1SoundBuffer - sta Square2SoundBuffer - sta NoiseSoundBuffer - lda #$0f - sta SND_MASTERCTRL_REG ;enable sound again - lda #$2a ;store length of sound in pause counter - sta Squ1_SfxLenCounter -PTone1F: lda #$44 ;play first tone - bne PTRegC ;unconditional branch -ContPau: lda Squ1_SfxLenCounter ;check pause length left - cmp #$24 ;time to play second? - beq PTone2F - cmp #$1e ;time to play first again? - beq PTone1F - cmp #$18 ;time to play second again? - bne DecPauC ;only load regs during times, otherwise skip -PTone2F: lda #$64 ;store reg contents and play the pause sfx -PTRegC: ldx #$84 - ldy #$7f - jsr PlaySqu1Sfx -DecPauC: dec Squ1_SfxLenCounter ;decrement pause sfx counter - bne SkipSoundSubroutines - lda #$00 ;disable sound if in pause mode and - sta SND_MASTERCTRL_REG ;not currently playing the pause sfx - lda PauseSoundBuffer ;if no longer playing pause sfx, check to see - cmp #$02 ;if we need to be playing sound again - bne SkipPIn - lda #$00 ;clear pause mode to allow game sounds again - sta PauseModeFlag -SkipPIn: lda #$00 ;clear pause sfx buffer - sta PauseSoundBuffer - beq SkipSoundSubroutines - -RunSoundSubroutines: - jsr Square1SfxHandler ;play sfx on square channel 1 - jsr Square2SfxHandler ; '' '' '' square channel 2 - jsr NoiseSfxHandler ; '' '' '' noise channel - jsr MusicHandler ;play music on all channels - lda #$00 ;clear the music queues - sta AreaMusicQueue - sta EventMusicQueue - -SkipSoundSubroutines: - lda #$00 ;clear the sound effects queues - sta Square1SoundQueue - sta Square2SoundQueue - sta NoiseSoundQueue - sta PauseSoundQueue - ldy DAC_Counter ;load some sort of counter - lda AreaMusicBuffer - and #%00000011 ;check for specific music - beq NoIncDAC - inc DAC_Counter ;increment and check counter - cpy #$30 - bcc StrWave ;if not there yet, just store it -NoIncDAC: tya - beq StrWave ;if we are at zero, do not decrement - dec DAC_Counter ;decrement counter -StrWave: sty SND_DELTA_REG+1 ;store into DMC load register (??) - rts ;we are done here - -;-------------------------------- - -Dump_Squ1_Regs: - sty SND_SQUARE1_REG+1 ;dump the contents of X and Y into square 1's control regs - stx SND_SQUARE1_REG - rts - -PlaySqu1Sfx: - jsr Dump_Squ1_Regs ;do sub to set ctrl regs for square 1, then set frequency regs - -SetFreq_Squ1: - ldx #$00 ;set frequency reg offset for square 1 sound channel - -Dump_Freq_Regs: - tay - lda FreqRegLookupTbl+1,y ;use previous contents of A for sound reg offset - beq NoTone ;if zero, then do not load - sta SND_REGISTER+2,x ;first byte goes into LSB of frequency divider - lda FreqRegLookupTbl,y ;second byte goes into 3 MSB plus extra bit for - ora #%00001000 ;length counter - sta SND_REGISTER+3,x -NoTone: rts - -Dump_Sq2_Regs: - stx SND_SQUARE2_REG ;dump the contents of X and Y into square 2's control regs - sty SND_SQUARE2_REG+1 - rts - -PlaySqu2Sfx: - jsr Dump_Sq2_Regs ;do sub to set ctrl regs for square 2, then set frequency regs - -SetFreq_Squ2: - ldx #$04 ;set frequency reg offset for square 2 sound channel - bne Dump_Freq_Regs ;unconditional branch - -SetFreq_Tri: - ldx #$08 ;set frequency reg offset for triangle sound channel - bne Dump_Freq_Regs ;unconditional branch - -;-------------------------------- - -SwimStompEnvelopeData: - .db $9f, $9b, $98, $96, $95, $94, $92, $90 - .db $90, $9a, $97, $95, $93, $92 - -PlayFlagpoleSlide: - lda #$40 ;store length of flagpole sound - sta Squ1_SfxLenCounter - lda #$62 ;load part of reg contents for flagpole sound - jsr SetFreq_Squ1 - ldx #$99 ;now load the rest - bne FPS2nd - -PlaySmallJump: - lda #$26 ;branch here for small mario jumping sound - bne JumpRegContents - -PlayBigJump: - lda #$18 ;branch here for big mario jumping sound - -JumpRegContents: - ldx #$82 ;note that small and big jump borrow each others' reg contents - ldy #$a7 ;anyway, this loads the first part of mario's jumping sound - jsr PlaySqu1Sfx - lda #$28 ;store length of sfx for both jumping sounds - sta Squ1_SfxLenCounter ;then continue on here - -ContinueSndJump: - lda Squ1_SfxLenCounter ;jumping sounds seem to be composed of three parts - cmp #$25 ;check for time to play second part yet - bne N2Prt - ldx #$5f ;load second part - ldy #$f6 - bne DmpJpFPS ;unconditional branch -N2Prt: cmp #$20 ;check for third part - bne DecJpFPS - ldx #$48 ;load third part -FPS2nd: ldy #$bc ;the flagpole slide sound shares part of third part -DmpJpFPS: jsr Dump_Squ1_Regs - bne DecJpFPS ;unconditional branch outta here - -PlayFireballThrow: - lda #$05 - ldy #$99 ;load reg contents for fireball throw sound - bne Fthrow ;unconditional branch - -PlayBump: - lda #$0a ;load length of sfx and reg contents for bump sound - ldy #$93 -Fthrow: ldx #$9e ;the fireball sound shares reg contents with the bump sound - sta Squ1_SfxLenCounter - lda #$0c ;load offset for bump sound - jsr PlaySqu1Sfx - -ContinueBumpThrow: - lda Squ1_SfxLenCounter ;check for second part of bump sound - cmp #$06 - bne DecJpFPS - lda #$bb ;load second part directly - sta SND_SQUARE1_REG+1 -DecJpFPS: bne BranchToDecLength1 ;unconditional branch - - -Square1SfxHandler: - ldy Square1SoundQueue ;check for sfx in queue - beq CheckSfx1Buffer - sty Square1SoundBuffer ;if found, put in buffer - bmi PlaySmallJump ;small jump - lsr Square1SoundQueue - bcs PlayBigJump ;big jump - lsr Square1SoundQueue - bcs PlayBump ;bump - lsr Square1SoundQueue - bcs PlaySwimStomp ;swim/stomp - lsr Square1SoundQueue - bcs PlaySmackEnemy ;smack enemy - lsr Square1SoundQueue - bcs PlayPipeDownInj ;pipedown/injury - lsr Square1SoundQueue - bcs PlayFireballThrow ;fireball throw - lsr Square1SoundQueue - bcs PlayFlagpoleSlide ;slide flagpole - -CheckSfx1Buffer: - lda Square1SoundBuffer ;check for sfx in buffer - beq ExS1H ;if not found, exit sub - bmi ContinueSndJump ;small mario jump - lsr - bcs ContinueSndJump ;big mario jump - lsr - bcs ContinueBumpThrow ;bump - lsr - bcs ContinueSwimStomp ;swim/stomp - lsr - bcs ContinueSmackEnemy ;smack enemy - lsr - bcs ContinuePipeDownInj ;pipedown/injury - lsr - bcs ContinueBumpThrow ;fireball throw - lsr - bcs DecrementSfx1Length ;slide flagpole -ExS1H: rts - -PlaySwimStomp: - lda #$0e ;store length of swim/stomp sound - sta Squ1_SfxLenCounter - ldy #$9c ;store reg contents for swim/stomp sound - ldx #$9e - lda #$26 - jsr PlaySqu1Sfx - -ContinueSwimStomp: - ldy Squ1_SfxLenCounter ;look up reg contents in data section based on - lda SwimStompEnvelopeData-1,y ;length of sound left, used to control sound's - sta SND_SQUARE1_REG ;envelope - cpy #$06 - bne BranchToDecLength1 - lda #$9e ;when the length counts down to a certain point, put this - sta SND_SQUARE1_REG+2 ;directly into the LSB of square 1's frequency divider - -BranchToDecLength1: - bne DecrementSfx1Length ;unconditional branch (regardless of how we got here) - -PlaySmackEnemy: - lda #$0e ;store length of smack enemy sound - ldy #$cb - ldx #$9f - sta Squ1_SfxLenCounter - lda #$28 ;store reg contents for smack enemy sound - jsr PlaySqu1Sfx - bne DecrementSfx1Length ;unconditional branch - -ContinueSmackEnemy: - ldy Squ1_SfxLenCounter ;check about halfway through - cpy #$08 - bne SmSpc - lda #$a0 ;if we're at the about-halfway point, make the second tone - sta SND_SQUARE1_REG+2 ;in the smack enemy sound - lda #$9f - bne SmTick -SmSpc: lda #$90 ;this creates spaces in the sound, giving it its distinct noise -SmTick: sta SND_SQUARE1_REG - -DecrementSfx1Length: - dec Squ1_SfxLenCounter ;decrement length of sfx - bne ExSfx1 - -StopSquare1Sfx: - ldx #$00 ;if end of sfx reached, clear buffer - stx $f1 ;and stop making the sfx - ldx #$0e - stx SND_MASTERCTRL_REG - ldx #$0f - stx SND_MASTERCTRL_REG -ExSfx1: rts - -PlayPipeDownInj: - lda #$2f ;load length of pipedown sound - sta Squ1_SfxLenCounter - -ContinuePipeDownInj: - lda Squ1_SfxLenCounter ;some bitwise logic, forces the regs - lsr ;to be written to only during six specific times - bcs NoPDwnL ;during which d3 must be set and d1-0 must be clear - lsr - bcs NoPDwnL - and #%00000010 - beq NoPDwnL - ldy #$91 ;and this is where it actually gets written in - ldx #$9a - lda #$44 - jsr PlaySqu1Sfx -NoPDwnL: jmp DecrementSfx1Length - -;-------------------------------- - -ExtraLifeFreqData: - .db $58, $02, $54, $56, $4e, $44 - -PowerUpGrabFreqData: - .db $4c, $52, $4c, $48, $3e, $36, $3e, $36, $30 - .db $28, $4a, $50, $4a, $64, $3c, $32, $3c, $32 - .db $2c, $24, $3a, $64, $3a, $34, $2c, $22, $2c - -;residual frequency data - .db $22, $1c, $14 - -PUp_VGrow_FreqData: - .db $14, $04, $22, $24, $16, $04, $24, $26 ;used by both - .db $18, $04, $26, $28, $1a, $04, $28, $2a - .db $1c, $04, $2a, $2c, $1e, $04, $2c, $2e ;used by vinegrow - .db $20, $04, $2e, $30, $22, $04, $30, $32 - -PlayCoinGrab: - lda #$35 ;load length of coin grab sound - ldx #$8d ;and part of reg contents - bne CGrab_TTickRegL - -PlayTimerTick: - lda #$06 ;load length of timer tick sound - ldx #$98 ;and part of reg contents - -CGrab_TTickRegL: - sta Squ2_SfxLenCounter - ldy #$7f ;load the rest of reg contents - lda #$42 ;of coin grab and timer tick sound - jsr PlaySqu2Sfx - -ContinueCGrabTTick: - lda Squ2_SfxLenCounter ;check for time to play second tone yet - cmp #$30 ;timer tick sound also executes this, not sure why - bne N2Tone - lda #$54 ;if so, load the tone directly into the reg - sta SND_SQUARE2_REG+2 -N2Tone: bne DecrementSfx2Length - -PlayBlast: - lda #$20 ;load length of fireworks/gunfire sound - sta Squ2_SfxLenCounter - ldy #$94 ;load reg contents of fireworks/gunfire sound - lda #$5e - bne SBlasJ - -ContinueBlast: - lda Squ2_SfxLenCounter ;check for time to play second part - cmp #$18 - bne DecrementSfx2Length - ldy #$93 ;load second part reg contents then - lda #$18 -SBlasJ: bne BlstSJp ;unconditional branch to load rest of reg contents - -PlayPowerUpGrab: - lda #$36 ;load length of power-up grab sound - sta Squ2_SfxLenCounter - -ContinuePowerUpGrab: - lda Squ2_SfxLenCounter ;load frequency reg based on length left over - lsr ;divide by 2 - bcs DecrementSfx2Length ;alter frequency every other frame - tay - lda PowerUpGrabFreqData-1,y ;use length left over / 2 for frequency offset - ldx #$5d ;store reg contents of power-up grab sound - ldy #$7f - -LoadSqu2Regs: - jsr PlaySqu2Sfx - -DecrementSfx2Length: - dec Squ2_SfxLenCounter ;decrement length of sfx - bne ExSfx2 - -EmptySfx2Buffer: - ldx #$00 ;initialize square 2's sound effects buffer - stx Square2SoundBuffer - -StopSquare2Sfx: - ldx #$0d ;stop playing the sfx - stx SND_MASTERCTRL_REG - ldx #$0f - stx SND_MASTERCTRL_REG -ExSfx2: rts - -Square2SfxHandler: - lda Square2SoundBuffer ;special handling for the 1-up sound to keep it - and #Sfx_ExtraLife ;from being interrupted by other sounds on square 2 - bne ContinueExtraLife - ldy Square2SoundQueue ;check for sfx in queue - beq CheckSfx2Buffer - sty Square2SoundBuffer ;if found, put in buffer and check for the following - bmi PlayBowserFall ;bowser fall - lsr Square2SoundQueue - bcs PlayCoinGrab ;coin grab - lsr Square2SoundQueue - bcs PlayGrowPowerUp ;power-up reveal - lsr Square2SoundQueue - bcs PlayGrowVine ;vine grow - lsr Square2SoundQueue - bcs PlayBlast ;fireworks/gunfire - lsr Square2SoundQueue - bcs PlayTimerTick ;timer tick - lsr Square2SoundQueue - bcs PlayPowerUpGrab ;power-up grab - lsr Square2SoundQueue - bcs PlayExtraLife ;1-up - -CheckSfx2Buffer: - lda Square2SoundBuffer ;check for sfx in buffer - beq ExS2H ;if not found, exit sub - bmi ContinueBowserFall ;bowser fall - lsr - bcs Cont_CGrab_TTick ;coin grab - lsr - bcs ContinueGrowItems ;power-up reveal - lsr - bcs ContinueGrowItems ;vine grow - lsr - bcs ContinueBlast ;fireworks/gunfire - lsr - bcs Cont_CGrab_TTick ;timer tick - lsr - bcs ContinuePowerUpGrab ;power-up grab - lsr - bcs ContinueExtraLife ;1-up -ExS2H: rts - -Cont_CGrab_TTick: - jmp ContinueCGrabTTick - -JumpToDecLength2: - jmp DecrementSfx2Length - -PlayBowserFall: - lda #$38 ;load length of bowser defeat sound - sta Squ2_SfxLenCounter - ldy #$c4 ;load contents of reg for bowser defeat sound - lda #$18 -BlstSJp: bne PBFRegs - -ContinueBowserFall: - lda Squ2_SfxLenCounter ;check for almost near the end - cmp #$08 - bne DecrementSfx2Length - ldy #$a4 ;if so, load the rest of reg contents for bowser defeat sound - lda #$5a -PBFRegs: ldx #$9f ;the fireworks/gunfire sound shares part of reg contents here -EL_LRegs: bne LoadSqu2Regs ;this is an unconditional branch outta here - -PlayExtraLife: - lda #$30 ;load length of 1-up sound - sta Squ2_SfxLenCounter - -ContinueExtraLife: - lda Squ2_SfxLenCounter - ldx #$03 ;load new tones only every eight frames -DivLLoop: lsr - bcs JumpToDecLength2 ;if any bits set here, branch to dec the length - dex - bne DivLLoop ;do this until all bits checked, if none set, continue - tay - lda ExtraLifeFreqData-1,y ;load our reg contents - ldx #$82 - ldy #$7f - bne EL_LRegs ;unconditional branch - -PlayGrowPowerUp: - lda #$10 ;load length of power-up reveal sound - bne GrowItemRegs - -PlayGrowVine: - lda #$20 ;load length of vine grow sound - -GrowItemRegs: - sta Squ2_SfxLenCounter - lda #$7f ;load contents of reg for both sounds directly - sta SND_SQUARE2_REG+1 - lda #$00 ;start secondary counter for both sounds - sta Sfx_SecondaryCounter - -ContinueGrowItems: - inc Sfx_SecondaryCounter ;increment secondary counter for both sounds - lda Sfx_SecondaryCounter ;this sound doesn't decrement the usual counter - lsr ;divide by 2 to get the offset - tay - cpy Squ2_SfxLenCounter ;have we reached the end yet? - beq StopGrowItems ;if so, branch to jump, and stop playing sounds - lda #$9d ;load contents of other reg directly - sta SND_SQUARE2_REG - lda PUp_VGrow_FreqData,y ;use secondary counter / 2 as offset for frequency regs - jsr SetFreq_Squ2 - rts - -StopGrowItems: - jmp EmptySfx2Buffer ;branch to stop playing sounds - -;-------------------------------- - -BrickShatterFreqData: - .db $01, $0e, $0e, $0d, $0b, $06, $0c, $0f - .db $0a, $09, $03, $0d, $08, $0d, $06, $0c - -PlayBrickShatter: - lda #$20 ;load length of brick shatter sound - sta Noise_SfxLenCounter - -ContinueBrickShatter: - lda Noise_SfxLenCounter - lsr ;divide by 2 and check for bit set to use offset - bcc DecrementSfx3Length - tay - ldx BrickShatterFreqData,y ;load reg contents of brick shatter sound - lda BrickShatterEnvData,y - -PlayNoiseSfx: - sta SND_NOISE_REG ;play the sfx - stx SND_NOISE_REG+2 - lda #$18 - sta SND_NOISE_REG+3 - -DecrementSfx3Length: - dec Noise_SfxLenCounter ;decrement length of sfx - bne ExSfx3 - lda #$f0 ;if done, stop playing the sfx - sta SND_NOISE_REG - lda #$00 - sta NoiseSoundBuffer -ExSfx3: rts - -NoiseSfxHandler: - ldy NoiseSoundQueue ;check for sfx in queue - beq CheckNoiseBuffer - sty NoiseSoundBuffer ;if found, put in buffer - lsr NoiseSoundQueue - bcs PlayBrickShatter ;brick shatter - lsr NoiseSoundQueue - bcs PlayBowserFlame ;bowser flame - -CheckNoiseBuffer: - lda NoiseSoundBuffer ;check for sfx in buffer - beq ExNH ;if not found, exit sub - lsr - bcs ContinueBrickShatter ;brick shatter - lsr - bcs ContinueBowserFlame ;bowser flame -ExNH: rts - -PlayBowserFlame: - lda #$40 ;load length of bowser flame sound - sta Noise_SfxLenCounter - -ContinueBowserFlame: - lda Noise_SfxLenCounter - lsr - tay - ldx #$0f ;load reg contents of bowser flame sound - lda BowserFlameEnvData-1,y - bne PlayNoiseSfx ;unconditional branch here - -;-------------------------------- - -ContinueMusic: - jmp HandleSquare2Music ;if we have music, start with square 2 channel - -MusicHandler: - lda EventMusicQueue ;check event music queue - bne LoadEventMusic - lda AreaMusicQueue ;check area music queue - bne LoadAreaMusic - lda EventMusicBuffer ;check both buffers - ora AreaMusicBuffer - bne ContinueMusic - rts ;no music, then leave - -LoadEventMusic: - sta EventMusicBuffer ;copy event music queue contents to buffer - cmp #DeathMusic ;is it death music? - bne NoStopSfx ;if not, jump elsewhere - jsr StopSquare1Sfx ;stop sfx in square 1 and 2 - jsr StopSquare2Sfx ;but clear only square 1's sfx buffer -NoStopSfx: ldx AreaMusicBuffer - stx AreaMusicBuffer_Alt ;save current area music buffer to be re-obtained later - ldy #$00 - sty NoteLengthTblAdder ;default value for additional length byte offset - sty AreaMusicBuffer ;clear area music buffer - cmp #TimeRunningOutMusic ;is it time running out music? - bne FindEventMusicHeader - ldx #$08 ;load offset to be added to length byte of header - stx NoteLengthTblAdder - bne FindEventMusicHeader ;unconditional branch - -LoadAreaMusic: - cmp #$04 ;is it underground music? - bne NoStop1 ;no, do not stop square 1 sfx - jsr StopSquare1Sfx -NoStop1: ldy #$10 ;start counter used only by ground level music -GMLoopB: sty GroundMusicHeaderOfs - -HandleAreaMusicLoopB: - ldy #$00 ;clear event music buffer - sty EventMusicBuffer - sta AreaMusicBuffer ;copy area music queue contents to buffer - cmp #$01 ;is it ground level music? - bne FindAreaMusicHeader - inc GroundMusicHeaderOfs ;increment but only if playing ground level music - ldy GroundMusicHeaderOfs ;is it time to loopback ground level music? - cpy #$32 - bne LoadHeader ;branch ahead with alternate offset - ldy #$11 - bne GMLoopB ;unconditional branch - -FindAreaMusicHeader: - ldy #$08 ;load Y for offset of area music - sty MusicOffset_Square2 ;residual instruction here - -FindEventMusicHeader: - iny ;increment Y pointer based on previously loaded queue contents - lsr ;bit shift and increment until we find a set bit for music - bcc FindEventMusicHeader - -LoadHeader: - lda MusicHeaderOffsetData,y ;load offset for header - tay - lda MusicHeaderData,y ;now load the header - sta NoteLenLookupTblOfs - lda MusicHeaderData+1,y - sta MusicDataLow - lda MusicHeaderData+2,y - sta MusicDataHigh - lda MusicHeaderData+3,y - sta MusicOffset_Triangle - lda MusicHeaderData+4,y - sta MusicOffset_Square1 - lda MusicHeaderData+5,y - sta MusicOffset_Noise - sta NoiseDataLoopbackOfs - lda #$01 ;initialize music note counters - sta Squ2_NoteLenCounter - sta Squ1_NoteLenCounter - sta Tri_NoteLenCounter - sta Noise_BeatLenCounter - lda #$00 ;initialize music data offset for square 2 - sta MusicOffset_Square2 - sta AltRegContentFlag ;initialize alternate control reg data used by square 1 - lda #$0b ;disable triangle channel and reenable it - sta SND_MASTERCTRL_REG - lda #$0f - sta SND_MASTERCTRL_REG - -HandleSquare2Music: - dec Squ2_NoteLenCounter ;decrement square 2 note length - bne MiscSqu2MusicTasks ;is it time for more data? if not, branch to end tasks - ldy MusicOffset_Square2 ;increment square 2 music offset and fetch data - inc MusicOffset_Square2 - lda (MusicData),y - beq EndOfMusicData ;if zero, the data is a null terminator - bpl Squ2NoteHandler ;if non-negative, data is a note - bne Squ2LengthHandler ;otherwise it is length data - -EndOfMusicData: - lda EventMusicBuffer ;check secondary buffer for time running out music - cmp #TimeRunningOutMusic - bne NotTRO - lda AreaMusicBuffer_Alt ;load previously saved contents of primary buffer - bne MusicLoopBack ;and start playing the song again if there is one -NotTRO: and #VictoryMusic ;check for victory music (the only secondary that loops) - bne VictoryMLoopBack - lda AreaMusicBuffer ;check primary buffer for any music except pipe intro - and #%01011111 - bne MusicLoopBack ;if any area music except pipe intro, music loops - lda #$00 ;clear primary and secondary buffers and initialize - sta AreaMusicBuffer ;control regs of square and triangle channels - sta EventMusicBuffer - sta SND_TRIANGLE_REG - lda #$90 - sta SND_SQUARE1_REG - sta SND_SQUARE2_REG - rts - -MusicLoopBack: - jmp HandleAreaMusicLoopB - -VictoryMLoopBack: - jmp LoadEventMusic - -Squ2LengthHandler: - jsr ProcessLengthData ;store length of note - sta Squ2_NoteLenBuffer - ldy MusicOffset_Square2 ;fetch another byte (MUST NOT BE LENGTH BYTE!) - inc MusicOffset_Square2 - lda (MusicData),y - -Squ2NoteHandler: - ldx Square2SoundBuffer ;is there a sound playing on this channel? - bne SkipFqL1 - jsr SetFreq_Squ2 ;no, then play the note - beq Rest ;check to see if note is rest - jsr LoadControlRegs ;if not, load control regs for square 2 -Rest: sta Squ2_EnvelopeDataCtrl ;save contents of A - jsr Dump_Sq2_Regs ;dump X and Y into square 2 control regs -SkipFqL1: lda Squ2_NoteLenBuffer ;save length in square 2 note counter - sta Squ2_NoteLenCounter - -MiscSqu2MusicTasks: - lda Square2SoundBuffer ;is there a sound playing on square 2? - bne HandleSquare1Music - lda EventMusicBuffer ;check for death music or d4 set on secondary buffer - and #%10010001 ;note that regs for death music or d4 are loaded by default - bne HandleSquare1Music - ldy Squ2_EnvelopeDataCtrl ;check for contents saved from LoadControlRegs - beq NoDecEnv1 - dec Squ2_EnvelopeDataCtrl ;decrement unless already zero -NoDecEnv1: jsr LoadEnvelopeData ;do a load of envelope data to replace default - sta SND_SQUARE2_REG ;based on offset set by first load unless playing - ldx #$7f ;death music or d4 set on secondary buffer - stx SND_SQUARE2_REG+1 - -HandleSquare1Music: - ldy MusicOffset_Square1 ;is there a nonzero offset here? - beq HandleTriangleMusic ;if not, skip ahead to the triangle channel - dec Squ1_NoteLenCounter ;decrement square 1 note length - bne MiscSqu1MusicTasks ;is it time for more data? - -FetchSqu1MusicData: - ldy MusicOffset_Square1 ;increment square 1 music offset and fetch data - inc MusicOffset_Square1 - lda (MusicData),y - bne Squ1NoteHandler ;if nonzero, then skip this part - lda #$83 - sta SND_SQUARE1_REG ;store some data into control regs for square 1 - lda #$94 ;and fetch another byte of data, used to give - sta SND_SQUARE1_REG+1 ;death music its unique sound - sta AltRegContentFlag - bne FetchSqu1MusicData ;unconditional branch - -Squ1NoteHandler: - jsr AlternateLengthHandler - sta Squ1_NoteLenCounter ;save contents of A in square 1 note counter - ldy Square1SoundBuffer ;is there a sound playing on square 1? - bne HandleTriangleMusic - txa - and #%00111110 ;change saved data to appropriate note format - jsr SetFreq_Squ1 ;play the note - beq SkipCtrlL - jsr LoadControlRegs -SkipCtrlL: sta Squ1_EnvelopeDataCtrl ;save envelope offset - jsr Dump_Squ1_Regs - -MiscSqu1MusicTasks: - lda Square1SoundBuffer ;is there a sound playing on square 1? - bne HandleTriangleMusic - lda EventMusicBuffer ;check for death music or d4 set on secondary buffer - and #%10010001 - bne DeathMAltReg - ldy Squ1_EnvelopeDataCtrl ;check saved envelope offset - beq NoDecEnv2 - dec Squ1_EnvelopeDataCtrl ;decrement unless already zero -NoDecEnv2: jsr LoadEnvelopeData ;do a load of envelope data - sta SND_SQUARE1_REG ;based on offset set by first load -DeathMAltReg: lda AltRegContentFlag ;check for alternate control reg data - bne DoAltLoad - lda #$7f ;load this value if zero, the alternate value -DoAltLoad: sta SND_SQUARE1_REG+1 ;if nonzero, and let's move on - -HandleTriangleMusic: - lda MusicOffset_Triangle - dec Tri_NoteLenCounter ;decrement triangle note length - bne HandleNoiseMusic ;is it time for more data? - ldy MusicOffset_Triangle ;increment square 1 music offset and fetch data - inc MusicOffset_Triangle - lda (MusicData),y - beq LoadTriCtrlReg ;if zero, skip all this and move on to noise - bpl TriNoteHandler ;if non-negative, data is note - jsr ProcessLengthData ;otherwise, it is length data - sta Tri_NoteLenBuffer ;save contents of A - lda #$1f - sta SND_TRIANGLE_REG ;load some default data for triangle control reg - ldy MusicOffset_Triangle ;fetch another byte - inc MusicOffset_Triangle - lda (MusicData),y - beq LoadTriCtrlReg ;check once more for nonzero data - -TriNoteHandler: - jsr SetFreq_Tri - ldx Tri_NoteLenBuffer ;save length in triangle note counter - stx Tri_NoteLenCounter - lda EventMusicBuffer - and #%01101110 ;check for death music or d4 set on secondary buffer - bne NotDOrD4 ;if playing any other secondary, skip primary buffer check - lda AreaMusicBuffer ;check primary buffer for water or castle level music - and #%00001010 - beq HandleNoiseMusic ;if playing any other primary, or death or d4, go on to noise routine -NotDOrD4: txa ;if playing water or castle music or any secondary - cmp #$12 ;besides death music or d4 set, check length of note - bcs LongN - lda EventMusicBuffer ;check for win castle music again if not playing a long note - and #EndOfCastleMusic - beq MediN - lda #$0f ;load value $0f if playing the win castle music and playing a short - bne LoadTriCtrlReg ;note, load value $1f if playing water or castle level music or any -MediN: lda #$1f ;secondary besides death and d4 except win castle or win castle and playing - bne LoadTriCtrlReg ;a short note, and load value $ff if playing a long note on water, castle -LongN: lda #$ff ;or any secondary (including win castle) except death and d4 - -LoadTriCtrlReg: - sta SND_TRIANGLE_REG ;save final contents of A into control reg for triangle - -HandleNoiseMusic: - lda AreaMusicBuffer ;check if playing underground or castle music - and #%11110011 - beq ExitMusicHandler ;if so, skip the noise routine - dec Noise_BeatLenCounter ;decrement noise beat length - bne ExitMusicHandler ;is it time for more data? - -FetchNoiseBeatData: - ldy MusicOffset_Noise ;increment noise beat offset and fetch data - inc MusicOffset_Noise - lda (MusicData),y ;get noise beat data, if nonzero, branch to handle - bne NoiseBeatHandler - lda NoiseDataLoopbackOfs ;if data is zero, reload original noise beat offset - sta MusicOffset_Noise ;and loopback next time around - bne FetchNoiseBeatData ;unconditional branch - -NoiseBeatHandler: - jsr AlternateLengthHandler - sta Noise_BeatLenCounter ;store length in noise beat counter - txa - and #%00111110 ;reload data and erase length bits - beq SilentBeat ;if no beat data, silence - cmp #$30 ;check the beat data and play the appropriate - beq LongBeat ;noise accordingly - cmp #$20 - beq StrongBeat - and #%00010000 - beq SilentBeat - lda #$1c ;short beat data - ldx #$03 - ldy #$18 - bne PlayBeat - -StrongBeat: - lda #$1c ;strong beat data - ldx #$0c - ldy #$18 - bne PlayBeat - -LongBeat: - lda #$1c ;long beat data - ldx #$03 - ldy #$58 - bne PlayBeat - -SilentBeat: - lda #$10 ;silence - -PlayBeat: - sta SND_NOISE_REG ;load beat data into noise regs - stx SND_NOISE_REG+2 - sty SND_NOISE_REG+3 - -ExitMusicHandler: - rts - -AlternateLengthHandler: - tax ;save a copy of original byte into X - ror ;save LSB from original byte into carry - txa ;reload original byte and rotate three times - rol ;turning xx00000x into 00000xxx, with the - rol ;bit in carry as the MSB here - rol - -ProcessLengthData: - and #%00000111 ;clear all but the three LSBs - clc - adc $f0 ;add offset loaded from first header byte - adc NoteLengthTblAdder ;add extra if time running out music - tay - lda MusicLengthLookupTbl,y ;load length - rts - -LoadControlRegs: - lda EventMusicBuffer ;check secondary buffer for win castle music - and #EndOfCastleMusic - beq NotECstlM - lda #$04 ;this value is only used for win castle music - bne AllMus ;unconditional branch -NotECstlM: lda AreaMusicBuffer - and #%01111101 ;check primary buffer for water music - beq WaterMus - lda #$08 ;this is the default value for all other music - bne AllMus -WaterMus: lda #$28 ;this value is used for water music and all other event music -AllMus: ldx #$82 ;load contents of other sound regs for square 2 - ldy #$7f - rts - -LoadEnvelopeData: - lda EventMusicBuffer ;check secondary buffer for win castle music - and #EndOfCastleMusic - beq LoadUsualEnvData - lda EndOfCastleMusicEnvData,y ;load data from offset for win castle music - rts - -LoadUsualEnvData: - lda AreaMusicBuffer ;check primary buffer for water music - and #%01111101 - beq LoadWaterEventMusEnvData - lda AreaMusicEnvData,y ;load default data from offset for all other music - rts - -LoadWaterEventMusEnvData: - lda WaterEventMusEnvData,y ;load data from offset for water music and all other event music - rts - -;-------------------------------- - -;music header offsets - -MusicHeaderData: - .db DeathMusHdr-MHD ;event music - .db GameOverMusHdr-MHD - .db VictoryMusHdr-MHD - .db WinCastleMusHdr-MHD - .db GameOverMusHdr-MHD - .db EndOfLevelMusHdr-MHD - .db TimeRunningOutHdr-MHD - .db SilenceHdr-MHD - - .db GroundLevelPart1Hdr-MHD ;area music - .db WaterMusHdr-MHD - .db UndergroundMusHdr-MHD - .db CastleMusHdr-MHD - .db Star_CloudHdr-MHD - .db GroundLevelLeadInHdr-MHD - .db Star_CloudHdr-MHD - .db SilenceHdr-MHD - - .db GroundLevelLeadInHdr-MHD ;ground level music layout - .db GroundLevelPart1Hdr-MHD, GroundLevelPart1Hdr-MHD - .db GroundLevelPart2AHdr-MHD, GroundLevelPart2BHdr-MHD, GroundLevelPart2AHdr-MHD, GroundLevelPart2CHdr-MHD - .db GroundLevelPart2AHdr-MHD, GroundLevelPart2BHdr-MHD, GroundLevelPart2AHdr-MHD, GroundLevelPart2CHdr-MHD - .db GroundLevelPart3AHdr-MHD, GroundLevelPart3BHdr-MHD, GroundLevelPart3AHdr-MHD, GroundLevelLeadInHdr-MHD - .db GroundLevelPart1Hdr-MHD, GroundLevelPart1Hdr-MHD - .db GroundLevelPart4AHdr-MHD, GroundLevelPart4BHdr-MHD, GroundLevelPart4AHdr-MHD, GroundLevelPart4CHdr-MHD - .db GroundLevelPart4AHdr-MHD, GroundLevelPart4BHdr-MHD, GroundLevelPart4AHdr-MHD, GroundLevelPart4CHdr-MHD - .db GroundLevelPart3AHdr-MHD, GroundLevelPart3BHdr-MHD, GroundLevelPart3AHdr-MHD, GroundLevelLeadInHdr-MHD - .db GroundLevelPart4AHdr-MHD, GroundLevelPart4BHdr-MHD, GroundLevelPart4AHdr-MHD, GroundLevelPart4CHdr-MHD - -;music headers -;header format is as follows: -;1 byte - length byte offset -;2 bytes - music data address -;1 byte - triangle data offset -;1 byte - square 1 data offset -;1 byte - noise data offset (not used by secondary music) - -TimeRunningOutHdr: .db $08, TimeRunOutMusData, $27, $18 -Star_CloudHdr: .db $20, Star_CloudMData, $2e, $1a, $40 -EndOfLevelMusHdr: .db $20, WinLevelMusData, $3d, $21 -ResidualHeaderData: .db $20, $c4, $fc, $3f, $1d -UndergroundMusHdr: .db $18, UndergroundMusData, $00, $00 -SilenceHdr: .db $08, SilenceData, $00 -CastleMusHdr: .db $00, CastleMusData, $93, $62 -VictoryMusHdr: .db $10, VictoryMusData, $24, $14 -GameOverMusHdr: .db $18, GameOverMusData, $1e, $14 -WaterMusHdr: .db $08, WaterMusData, $a0, $70, $68 -WinCastleMusHdr: .db $08, EndOfCastleMusData, $4c, $24 -GroundLevelPart1Hdr: .db $18, GroundM_P1Data, $2d, $1c, $b8 -GroundLevelPart2AHdr: .db $18, GroundM_P2AData, $20, $12, $70 -GroundLevelPart2BHdr: .db $18, GroundM_P2BData, $1b, $10, $44 -GroundLevelPart2CHdr: .db $18, GroundM_P2CData, $11, $0a, $1c -GroundLevelPart3AHdr: .db $18, GroundM_P3AData, $2d, $10, $58 -GroundLevelPart3BHdr: .db $18, GroundM_P3BData, $14, $0d, $3f -GroundLevelLeadInHdr: .db $18, GroundMLdInData, $15, $0d, $21 -GroundLevelPart4AHdr: .db $18, GroundM_P4AData, $18, $10, $7a -GroundLevelPart4BHdr: .db $18, GroundM_P4BData, $19, $0f, $54 -GroundLevelPart4CHdr: .db $18, GroundM_P4CData, $1e, $12, $2b -DeathMusHdr: .db $18, DeathMusData, $1e, $0f, $2d - -;-------------------------------- - -;MUSIC DATA -;square 2/triangle format -;d7 - length byte flag (0-note, 1-length) -;if d7 is set to 0 and d6-d0 is nonzero: -;d6-d0 - note offset in frequency look-up table (must be even) -;if d7 is set to 1: -;d6-d3 - unused -;d2-d0 - length offset in length look-up table -;value of $00 in square 2 data is used as null terminator, affects all sound channels -;value of $00 in triangle data causes routine to skip note - -;square 1 format -;d7-d6, d0 - length offset in length look-up table (bit order is d0,d7,d6) -;d5-d1 - note offset in frequency look-up table -;value of $00 in square 1 data is flag alternate control reg data to be loaded - -;noise format -;d7-d6, d0 - length offset in length look-up table (bit order is d0,d7,d6) -;d5-d4 - beat type (0 - rest, 1 - short, 2 - strong, 3 - long) -;d3-d1 - unused -;value of $00 in noise data is used as null terminator, affects only noise - -;all music data is organized into sections (unless otherwise stated): -;square 2, square 1, triangle, noise - -Star_CloudMData: - .db $84, $2c, $2c, $2c, $82, $04, $2c, $04, $85, $2c, $84, $2c, $2c - .db $2a, $2a, $2a, $82, $04, $2a, $04, $85, $2a, $84, $2a, $2a, $00 - - .db $1f, $1f, $1f, $98, $1f, $1f, $98, $9e, $98, $1f - .db $1d, $1d, $1d, $94, $1d, $1d, $94, $9c, $94, $1d - - .db $86, $18, $85, $26, $30, $84, $04, $26, $30 - .db $86, $14, $85, $22, $2c, $84, $04, $22, $2c - - .db $21, $d0, $c4, $d0, $31, $d0, $c4, $d0, $00 - -GroundM_P1Data: - .db $85, $2c, $22, $1c, $84, $26, $2a, $82, $28, $26, $04 - .db $87, $22, $34, $3a, $82, $40, $04, $36, $84, $3a, $34 - .db $82, $2c, $30, $85, $2a - -SilenceData: - .db $00 - - .db $5d, $55, $4d, $15, $19, $96, $15, $d5, $e3, $eb - .db $2d, $a6, $2b, $27, $9c, $9e, $59 - - .db $85, $22, $1c, $14, $84, $1e, $22, $82, $20, $1e, $04, $87 - .db $1c, $2c, $34, $82, $36, $04, $30, $34, $04, $2c, $04, $26 - .db $2a, $85, $22 - -GroundM_P2AData: - .db $84, $04, $82, $3a, $38, $36, $32, $04, $34 - .db $04, $24, $26, $2c, $04, $26, $2c, $30, $00 - - .db $05, $b4, $b2, $b0, $2b, $ac, $84 - .db $9c, $9e, $a2, $84, $94, $9c, $9e - - .db $85, $14, $22, $84, $2c, $85, $1e - .db $82, $2c, $84, $2c, $1e - -GroundM_P2BData: - .db $84, $04, $82, $3a, $38, $36, $32, $04, $34 - .db $04, $64, $04, $64, $86, $64, $00 - - .db $05, $b4, $b2, $b0, $2b, $ac, $84 - .db $37, $b6, $b6, $45 - - .db $85, $14, $1c, $82, $22, $84, $2c - .db $4e, $82, $4e, $84, $4e, $22 - -GroundM_P2CData: - .db $84, $04, $85, $32, $85, $30, $86, $2c, $04, $00 - - .db $05, $a4, $05, $9e, $05, $9d, $85 - - .db $84, $14, $85, $24, $28, $2c, $82 - .db $22, $84, $22, $14 - - .db $21, $d0, $c4, $d0, $31, $d0, $c4, $d0, $00 - -GroundM_P3AData: - .db $82, $2c, $84, $2c, $2c, $82, $2c, $30 - .db $04, $34, $2c, $04, $26, $86, $22, $00 - - .db $a4, $25, $25, $a4, $29, $a2, $1d, $9c, $95 - -GroundM_P3BData: - .db $82, $2c, $2c, $04, $2c, $04, $2c, $30, $85, $34, $04, $04, $00 - - .db $a4, $25, $25, $a4, $a8, $63, $04 - -;triangle data used by both sections of third part - .db $85, $0e, $1a, $84, $24, $85, $22, $14, $84, $0c - -GroundMLdInData: - .db $82, $34, $84, $34, $34, $82, $2c, $84, $34, $86, $3a, $04, $00 - - .db $a0, $21, $21, $a0, $21, $2b, $05, $a3 - - .db $82, $18, $84, $18, $18, $82, $18, $18, $04, $86, $3a, $22 - -;noise data used by lead-in and third part sections - .db $31, $90, $31, $90, $31, $71, $31, $90, $90, $90, $00 - -GroundM_P4AData: - .db $82, $34, $84, $2c, $85, $22, $84, $24 - .db $82, $26, $36, $04, $36, $86, $26, $00 - - .db $ac, $27, $5d, $1d, $9e, $2d, $ac, $9f - - .db $85, $14, $82, $20, $84, $22, $2c - .db $1e, $1e, $82, $2c, $2c, $1e, $04 - -GroundM_P4BData: - .db $87, $2a, $40, $40, $40, $3a, $36 - .db $82, $34, $2c, $04, $26, $86, $22, $00 - - .db $e3, $f7, $f7, $f7, $f5, $f1, $ac, $27, $9e, $9d - - .db $85, $18, $82, $1e, $84, $22, $2a - .db $22, $22, $82, $2c, $2c, $22, $04 - -DeathMusData: - .db $86, $04 ;death music share data with fourth part c of ground level music - -GroundM_P4CData: - .db $82, $2a, $36, $04, $36, $87, $36, $34, $30, $86, $2c, $04, $00 - - .db $00, $68, $6a, $6c, $45 ;death music only - - .db $a2, $31, $b0, $f1, $ed, $eb, $a2, $1d, $9c, $95 - - .db $86, $04 ;death music only - - .db $85, $22, $82, $22, $87, $22, $26, $2a, $84, $2c, $22, $86, $14 - -;noise data used by fourth part sections - .db $51, $90, $31, $11, $00 - -CastleMusData: - .db $80, $22, $28, $22, $26, $22, $24, $22, $26 - .db $22, $28, $22, $2a, $22, $28, $22, $26 - .db $22, $28, $22, $26, $22, $24, $22, $26 - .db $22, $28, $22, $2a, $22, $28, $22, $26 - .db $20, $26, $20, $24, $20, $26, $20, $28 - .db $20, $26, $20, $28, $20, $26, $20, $24 - .db $20, $26, $20, $24, $20, $26, $20, $28 - .db $20, $26, $20, $28, $20, $26, $20, $24 - .db $28, $30, $28, $32, $28, $30, $28, $2e - .db $28, $30, $28, $2e, $28, $2c, $28, $2e - .db $28, $30, $28, $32, $28, $30, $28, $2e - .db $28, $30, $28, $2e, $28, $2c, $28, $2e, $00 - - .db $04, $70, $6e, $6c, $6e, $70, $72, $70, $6e - .db $70, $6e, $6c, $6e, $70, $72, $70, $6e - .db $6e, $6c, $6e, $70, $6e, $70, $6e, $6c - .db $6e, $6c, $6e, $70, $6e, $70, $6e, $6c - .db $76, $78, $76, $74, $76, $74, $72, $74 - .db $76, $78, $76, $74, $76, $74, $72, $74 - - .db $84, $1a, $83, $18, $20, $84, $1e, $83, $1c, $28 - .db $26, $1c, $1a, $1c - -GameOverMusData: - .db $82, $2c, $04, $04, $22, $04, $04, $84, $1c, $87 - .db $26, $2a, $26, $84, $24, $28, $24, $80, $22, $00 - - .db $9c, $05, $94, $05, $0d, $9f, $1e, $9c, $98, $9d - - .db $82, $22, $04, $04, $1c, $04, $04, $84, $14 - .db $86, $1e, $80, $16, $80, $14 - -TimeRunOutMusData: - .db $81, $1c, $30, $04, $30, $30, $04, $1e, $32, $04, $32, $32 - .db $04, $20, $34, $04, $34, $34, $04, $36, $04, $84, $36, $00 - - .db $46, $a4, $64, $a4, $48, $a6, $66, $a6, $4a, $a8, $68, $a8 - .db $6a, $44, $2b - - .db $81, $2a, $42, $04, $42, $42, $04, $2c, $64, $04, $64, $64 - .db $04, $2e, $46, $04, $46, $46, $04, $22, $04, $84, $22 - -WinLevelMusData: - .db $87, $04, $06, $0c, $14, $1c, $22, $86, $2c, $22 - .db $87, $04, $60, $0e, $14, $1a, $24, $86, $2c, $24 - .db $87, $04, $08, $10, $18, $1e, $28, $86, $30, $30 - .db $80, $64, $00 - - .db $cd, $d5, $dd, $e3, $ed, $f5, $bb, $b5, $cf, $d5 - .db $db, $e5, $ed, $f3, $bd, $b3, $d1, $d9, $df, $e9 - .db $f1, $f7, $bf, $ff, $ff, $ff, $34 - .db $00 ;unused byte - - .db $86, $04, $87, $14, $1c, $22, $86, $34, $84, $2c - .db $04, $04, $04, $87, $14, $1a, $24, $86, $32, $84 - .db $2c, $04, $86, $04, $87, $18, $1e, $28, $86, $36 - .db $87, $30, $30, $30, $80, $2c - -;square 2 and triangle use the same data, square 1 is unused -UndergroundMusData: - .db $82, $14, $2c, $62, $26, $10, $28, $80, $04 - .db $82, $14, $2c, $62, $26, $10, $28, $80, $04 - .db $82, $08, $1e, $5e, $18, $60, $1a, $80, $04 - .db $82, $08, $1e, $5e, $18, $60, $1a, $86, $04 - .db $83, $1a, $18, $16, $84, $14, $1a, $18, $0e, $0c - .db $16, $83, $14, $20, $1e, $1c, $28, $26, $87 - .db $24, $1a, $12, $10, $62, $0e, $80, $04, $04 - .db $00 - -;noise data directly follows square 2 here unlike in other songs -WaterMusData: - .db $82, $18, $1c, $20, $22, $26, $28 - .db $81, $2a, $2a, $2a, $04, $2a, $04, $83, $2a, $82, $22 - .db $86, $34, $32, $34, $81, $04, $22, $26, $2a, $2c, $30 - .db $86, $34, $83, $32, $82, $36, $84, $34, $85, $04, $81, $22 - .db $86, $30, $2e, $30, $81, $04, $22, $26, $2a, $2c, $2e - .db $86, $30, $83, $22, $82, $36, $84, $34, $85, $04, $81, $22 - .db $86, $3a, $3a, $3a, $82, $3a, $81, $40, $82, $04, $81, $3a - .db $86, $36, $36, $36, $82, $36, $81, $3a, $82, $04, $81, $36 - .db $86, $34, $82, $26, $2a, $36 - .db $81, $34, $34, $85, $34, $81, $2a, $86, $2c, $00 - - .db $84, $90, $b0, $84, $50, $50, $b0, $00 - - .db $98, $96, $94, $92, $94, $96, $58, $58, $58, $44 - .db $5c, $44, $9f, $a3, $a1, $a3, $85, $a3, $e0, $a6 - .db $23, $c4, $9f, $9d, $9f, $85, $9f, $d2, $a6, $23 - .db $c4, $b5, $b1, $af, $85, $b1, $af, $ad, $85, $95 - .db $9e, $a2, $aa, $6a, $6a, $6b, $5e, $9d - - .db $84, $04, $04, $82, $22, $86, $22 - .db $82, $14, $22, $2c, $12, $22, $2a, $14, $22, $2c - .db $1c, $22, $2c, $14, $22, $2c, $12, $22, $2a, $14 - .db $22, $2c, $1c, $22, $2c, $18, $22, $2a, $16, $20 - .db $28, $18, $22, $2a, $12, $22, $2a, $18, $22, $2a - .db $12, $22, $2a, $14, $22, $2c, $0c, $22, $2c, $14, $22, $34, $12 - .db $22, $30, $10, $22, $2e, $16, $22, $34, $18, $26 - .db $36, $16, $26, $36, $14, $26, $36, $12, $22, $36 - .db $5c, $22, $34, $0c, $22, $22, $81, $1e, $1e, $85, $1e - .db $81, $12, $86, $14 - -EndOfCastleMusData: - .db $81, $2c, $22, $1c, $2c, $22, $1c, $85, $2c, $04 - .db $81, $2e, $24, $1e, $2e, $24, $1e, $85, $2e, $04 - .db $81, $32, $28, $22, $32, $28, $22, $85, $32 - .db $87, $36, $36, $36, $84, $3a, $00 - - .db $5c, $54, $4c, $5c, $54, $4c - .db $5c, $1c, $1c, $5c, $5c, $5c, $5c - .db $5e, $56, $4e, $5e, $56, $4e - .db $5e, $1e, $1e, $5e, $5e, $5e, $5e - .db $62, $5a, $50, $62, $5a, $50 - .db $62, $22, $22, $62, $e7, $e7, $e7, $2b - - .db $86, $14, $81, $14, $80, $14, $14, $81, $14, $14, $14, $14 - .db $86, $16, $81, $16, $80, $16, $16, $81, $16, $16, $16, $16 - .db $81, $28, $22, $1a, $28, $22, $1a, $28, $80, $28, $28 - .db $81, $28, $87, $2c, $2c, $2c, $84, $30 - -VictoryMusData: - .db $83, $04, $84, $0c, $83, $62, $10, $84, $12 - .db $83, $1c, $22, $1e, $22, $26, $18, $1e, $04, $1c, $00 - - .db $e3, $e1, $e3, $1d, $de, $e0, $23 - .db $ec, $75, $74, $f0, $f4, $f6, $ea, $31, $2d - - .db $83, $12, $14, $04, $18, $1a, $1c, $14 - .db $26, $22, $1e, $1c, $18, $1e, $22, $0c, $14 - -;unused space - .db $ff, $ff, $ff - -FreqRegLookupTbl: - .db $00, $88, $00, $2f, $00, $00 - .db $02, $a6, $02, $80, $02, $5c, $02, $3a - .db $02, $1a, $01, $df, $01, $c4, $01, $ab - .db $01, $93, $01, $7c, $01, $67, $01, $53 - .db $01, $40, $01, $2e, $01, $1d, $01, $0d - .db $00, $fe, $00, $ef, $00, $e2, $00, $d5 - .db $00, $c9, $00, $be, $00, $b3, $00, $a9 - .db $00, $a0, $00, $97, $00, $8e, $00, $86 - .db $00, $77, $00, $7e, $00, $71, $00, $54 - .db $00, $64, $00, $5f, $00, $59, $00, $50 - .db $00, $47, $00, $43, $00, $3b, $00, $35 - .db $00, $2a, $00, $23, $04, $75, $03, $57 - .db $02, $f9, $02, $cf, $01, $fc, $00, $6a - -MusicLengthLookupTbl: - .db $05, $0a, $14, $28, $50, $1e, $3c, $02 - .db $04, $08, $10, $20, $40, $18, $30, $0c - .db $03, $06, $0c, $18, $30, $12, $24, $08 - .db $36, $03, $09, $06, $12, $1b, $24, $0c - .db $24, $02, $06, $04, $0c, $12, $18, $08 - .db $12, $01, $03, $02, $06, $09, $0c, $04 - -EndOfCastleMusicEnvData: - .db $98, $99, $9a, $9b - -AreaMusicEnvData: - .db $90, $94, $94, $95, $95, $96, $97, $98 - -WaterEventMusEnvData: - .db $90, $91, $92, $92, $93, $93, $93, $94 - .db $94, $94, $94, $94, $94, $95, $95, $95 - .db $95, $95, $95, $96, $96, $96, $96, $96 - .db $96, $96, $96, $96, $96, $96, $96, $96 - .db $96, $96, $96, $96, $95, $95, $94, $93 - -BowserFlameEnvData: - .db $15, $16, $16, $17, $17, $18, $19, $19 - .db $1a, $1a, $1c, $1d, $1d, $1e, $1e, $1f - .db $1f, $1f, $1f, $1e, $1d, $1c, $1e, $1f - .db $1f, $1e, $1d, $1c, $1a, $18, $16, $14 - -BrickShatterEnvData: - .db $15, $16, $16, $17, $17, $18, $19, $19 - .db $1a, $1a, $1c, $1d, $1d, $1e, $1e, $1f - -;------------------------------------------------------------------------------------- -;INTERRUPT VECTORS - - .dw NonMaskableInterrupt - .dw Start - .dw $fff0 ;unused \ No newline at end of file diff --git a/dump b/dump deleted file mode 100644 index a1fad44..0000000 --- a/dump +++ /dev/null @@ -1,3076 +0,0 @@ - -0x0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x00A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x00B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x00C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x00D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x00E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x00F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x01A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x01B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x01C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x01D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x01E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x01F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0250: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0260: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0270: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0290: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x02A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x02B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x02C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x02D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x02E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x02F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0320: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0330: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0340: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0350: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0360: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x03A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x03B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x03C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x03D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x03E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x03F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0410: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0420: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0430: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0450: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0460: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0490: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x04A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x04B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x04C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x04D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x04E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x04F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0520: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0530: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0540: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0560: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0570: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0590: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x05A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x05B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x05C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x05D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x05E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x05F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0610: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0620: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0630: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0640: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0650: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0660: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0670: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0690: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x06A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x06B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x06C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x06D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x06E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x06F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0710: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0720: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0730: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0740: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0750: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0760: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0770: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0790: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x07A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x07B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x07C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x07D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x07E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x07F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0810: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0820: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0830: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0840: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0850: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0860: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0870: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0890: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x08A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x08B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x08C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x08D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x08E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x08F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0910: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0920: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0930: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0940: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0950: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0960: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0970: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0990: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x09A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x09B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x09C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x09D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x09E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x09F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0A00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0A10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0A20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0A30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0A40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0A50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0A60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0A70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0A80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0A90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0AA0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0AB0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0AC0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0AD0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0AE0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0AF0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0B00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0B10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0B20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0B30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0B40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0B50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0B60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0B70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0B80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0B90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0BA0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0BB0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0BC0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0BD0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0BE0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0BF0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0C00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0C10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0C20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0C30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0C40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0C50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0C60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0C70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0C80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0C90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0CA0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0CB0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0CC0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0CD0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0CE0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0CF0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0D00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0D10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0D20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0D30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0D40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0D50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0D60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0D70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0D80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0D90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0DA0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0DB0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0DC0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0DD0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0DE0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0DF0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0E00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0E10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0E20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0E30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0E40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0E50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0E60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0E70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0E80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0E90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0EA0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0EB0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0EC0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0ED0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0EE0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0EF0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0F00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0F10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0F20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0F30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0F40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0F50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0F60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0F70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0F80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0F90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0FA0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0FB0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0FC0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0FD0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0FE0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x0FF0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x10A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x10B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x10C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x10D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x10E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x10F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x11A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x11B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x11C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x11D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x11E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x11F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1250: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1260: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1270: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1290: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x12A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x12B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x12C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x12D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x12E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x12F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1320: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1330: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1340: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1350: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1360: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x13A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x13B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x13C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x13D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x13E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x13F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1410: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1420: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1430: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1450: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1460: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1490: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x14A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x14B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x14C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x14D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x14E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x14F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1520: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1530: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1540: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1560: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1570: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1590: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x15A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x15B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x15C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x15D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x15E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x15F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1610: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1620: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1630: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1640: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1650: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1660: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1670: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1690: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x16A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x16B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x16C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x16D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x16E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x16F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1710: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1720: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1730: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1740: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1750: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1760: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1770: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1790: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x17A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x17B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x17C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x17D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x17E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x17F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1810: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1820: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1830: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1840: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1850: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1860: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1870: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1890: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x18A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x18B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x18C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x18D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x18E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x18F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1910: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1920: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1930: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1940: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1950: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1960: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1970: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1990: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x19A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x19B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x19C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x19D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x19E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x19F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1A00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1A10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1A20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1A30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1A40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1A50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1A60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1A70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1A80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1A90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1AA0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1AB0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1AC0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1AD0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1AE0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1AF0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1B00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1B10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1B20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1B30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1B40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1B50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1B60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1B70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1B80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1B90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1BA0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1BB0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1BC0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1BD0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1BE0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1BF0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1C00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1C10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1C20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1C30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1C40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1C50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1C60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1C70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1C80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1C90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1CA0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1CB0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1CC0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1CD0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1CE0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1CF0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1D00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1D10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1D20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1D30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1D40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1D50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1D60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1D70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1D80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1D90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1DA0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1DB0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1DC0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1DD0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1DE0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1DF0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1E00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1E10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1E20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1E30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1E40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1E50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1E60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1E70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1E80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1E90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1EA0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1EB0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1EC0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1ED0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1EE0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1EF0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1F00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1F10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1F20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1F30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1F40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1F50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1F60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1F70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1F80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1F90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1FA0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1FB0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1FC0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1FD0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1FE0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x1FF0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x2000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 -0x2010: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2020: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2030: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2040: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2050: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2060: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2070: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2080: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2090: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x20A0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x20B0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x20C0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x20D0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x20E0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x20F0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2100: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2110: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2120: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2130: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2140: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2150: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2160: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2170: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2180: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2190: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x21A0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x21B0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x21C0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x21D0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x21E0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x21F0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2200: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2210: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2220: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2230: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2240: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2250: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2260: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2270: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2280: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2290: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x22A0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x22B0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x22C0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x22D0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x22E0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x22F0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2300: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2310: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2320: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2330: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2340: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2350: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2360: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2370: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2380: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2390: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x23A0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x23B0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x23C0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x23D0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x23E0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x23F0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2400: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2410: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2420: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2430: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2440: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2450: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2460: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2470: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2480: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2490: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x24A0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x24B0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x24C0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x24D0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x24E0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x24F0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2500: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2510: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2520: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2530: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2540: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2550: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2560: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2570: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2580: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2590: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x25A0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x25B0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x25C0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x25D0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x25E0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x25F0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2600: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2610: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2620: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2630: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2640: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2650: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2660: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2670: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2680: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2690: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x26A0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x26B0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x26C0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x26D0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x26E0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x26F0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2700: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2710: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2720: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2730: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2740: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2750: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2760: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2770: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2780: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2790: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x27A0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x27B0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x27C0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x27D0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x27E0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x27F0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2800: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2810: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2820: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2830: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2840: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2850: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2860: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2870: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2880: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2890: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x28A0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x28B0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x28C0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x28D0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x28E0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x28F0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2900: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2910: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2920: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2930: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2940: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2950: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2960: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2970: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2980: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2990: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x29A0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x29B0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x29C0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x29D0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x29E0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x29F0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2A00: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2A10: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2A20: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2A30: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2A40: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2A50: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2A60: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2A70: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2A80: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2A90: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2AA0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2AB0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2AC0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2AD0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2AE0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2AF0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2B00: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2B10: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2B20: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2B30: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2B40: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2B50: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2B60: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2B70: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2B80: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2B90: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2BA0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2BB0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2BC0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2BD0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2BE0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2BF0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2C00: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2C10: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2C20: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2C30: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2C40: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2C50: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2C60: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2C70: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2C80: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2C90: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2CA0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2CB0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2CC0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2CD0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2CE0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2CF0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2D00: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2D10: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2D20: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2D30: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2D40: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2D50: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2D60: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2D70: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2D80: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2D90: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2DA0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2DB0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2DC0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2DD0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2DE0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2DF0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2E00: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2E10: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2E20: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2E30: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2E40: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2E50: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2E60: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2E70: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2E80: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2E90: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2EA0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2EB0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2EC0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2ED0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2EE0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2EF0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2F00: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2F10: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2F20: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2F30: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2F40: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2F50: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2F60: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2F70: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2F80: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2F90: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2FA0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2FB0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2FC0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2FD0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2FE0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x2FF0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3000: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3010: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3020: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3030: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3040: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3050: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3060: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3070: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3080: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3090: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x30A0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x30B0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x30C0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x30D0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x30E0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x30F0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3100: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3110: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3120: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3130: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3140: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3150: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3160: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3170: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3180: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3190: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x31A0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x31B0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x31C0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x31D0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x31E0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x31F0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3200: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3210: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3220: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3230: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3240: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3250: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3260: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3270: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3280: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3290: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x32A0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x32B0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x32C0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x32D0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x32E0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x32F0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3300: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3310: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3320: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3330: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3340: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3350: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3360: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3370: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3380: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3390: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x33A0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x33B0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x33C0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x33D0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x33E0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x33F0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3400: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3410: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3420: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3430: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3440: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3450: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3460: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3470: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3480: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3490: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x34A0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x34B0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x34C0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x34D0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x34E0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x34F0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3500: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3510: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3520: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3530: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3540: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3550: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3560: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3570: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3580: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3590: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x35A0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x35B0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x35C0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x35D0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x35E0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x35F0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3600: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3610: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3620: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3630: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3640: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3650: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3660: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3670: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3680: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3690: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x36A0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x36B0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x36C0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x36D0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x36E0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x36F0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3700: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3710: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3720: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3730: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3740: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3750: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3760: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3770: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3780: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3790: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x37A0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x37B0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x37C0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x37D0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x37E0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x37F0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3800: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3810: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3820: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3830: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3840: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3850: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3860: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3870: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3880: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3890: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x38A0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x38B0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x38C0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x38D0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x38E0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x38F0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3900: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3910: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3920: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3930: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3940: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3950: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3960: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3970: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3980: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3990: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x39A0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x39B0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x39C0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x39D0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x39E0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x39F0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3A00: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3A10: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3A20: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3A30: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3A40: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3A50: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3A60: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3A70: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3A80: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3A90: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3AA0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3AB0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3AC0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3AD0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3AE0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3AF0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3B00: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3B10: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3B20: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3B30: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3B40: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3B50: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3B60: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3B70: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3B80: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3B90: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3BA0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3BB0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3BC0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3BD0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3BE0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3BF0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3C00: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3C10: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3C20: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3C30: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3C40: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3C50: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3C60: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3C70: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3C80: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3C90: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3CA0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3CB0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3CC0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3CD0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3CE0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3CF0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3D00: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3D10: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3D20: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3D30: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3D40: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3D50: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3D60: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3D70: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3D80: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3D90: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3DA0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3DB0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3DC0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3DD0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3DE0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3DF0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3E00: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3E10: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3E20: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3E30: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3E40: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3E50: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3E60: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3E70: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3E80: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3E90: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3EA0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3EB0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3EC0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3ED0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3EE0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3EF0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3F00: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3F10: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3F20: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3F30: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3F40: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3F50: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3F60: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3F70: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3F80: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3F90: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3FA0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3FB0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3FC0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3FD0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3FE0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x3FF0: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x4000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x4010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -========================= -0x8000: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x8010: 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 03 -0x8020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x8030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x8040: 78 D8 A9 10 8D 00 20 A2 FF 9A AD 02 20 10 FB AD -0x8050: 02 20 10 FB A0 FE A2 05 BD D7 07 C9 0A B0 0C CA -0x8060: 10 F6 AD FF 07 C9 A5 D0 02 A0 D6 20 CC 90 8D 11 -0x8070: 40 8D 70 07 A9 A5 8D FF 07 8D A7 07 A9 0F 8D 15 -0x8080: 40 A9 06 8D 01 20 20 20 82 20 19 8E EE 74 07 AD -0x8090: 78 07 09 80 20 ED 8E 4C 57 80 01 A4 C8 EC 10 00 -0x80A0: 41 41 4C 34 3C 44 54 68 7C A8 BF DE EF 03 8C 8C -0x80B0: 8C 8D 03 03 03 8D 8D 8D 8D 8D 8D 8D 8D 8D 8D 8D -0x80C0: 00 40 AD 78 07 29 7F 8D 78 07 29 7E 8D 00 20 AD -0x80D0: 79 07 29 E6 AC 74 07 D0 05 AD 79 07 09 1E 8D 79 -0x80E0: 07 29 E7 8D 01 20 AE 02 20 A9 00 20 E6 8E 8D 03 -0x80F0: 20 A9 02 8D 14 40 AE 73 07 BD 5A 80 85 00 BD 6D -0x8100: 80 85 01 20 DD 8E A0 00 AE 73 07 E0 06 D0 01 C8 -0x8110: BE 80 80 A9 00 9D 00 03 9D 01 03 8D 73 07 AD 79 -0x8120: 07 8D 01 20 20 D0 F2 20 5C 8E 20 82 81 20 97 8F -0x8130: AD 76 07 4A B0 25 AD 47 07 F0 05 CE 47 07 D0 19 -0x8140: A2 14 CE 7F 07 10 07 A9 14 8D 7F 07 A2 23 BD 80 -0x8150: 07 F0 03 DE 80 07 CA 10 F5 E6 09 A2 00 A0 07 AD -0x8160: A7 07 29 02 85 00 AD A8 07 29 02 45 00 18 F0 01 -0x8170: 38 7E A7 07 E8 88 D0 F9 AD 22 07 F0 1F AD 02 20 -0x8180: 29 40 D0 F9 AD 76 07 4A B0 06 20 23 82 20 C6 81 -0x8190: AD 02 20 29 40 F0 F9 A0 14 88 D0 FD AD 3F 07 8D -0x81A0: 05 20 AD 40 07 8D 05 20 AD 78 07 48 8D 00 20 AD -0x81B0: 76 07 4A B0 03 20 12 82 AD 02 20 68 09 80 8D 00 -0x81C0: 20 40 AD 70 07 C9 02 F0 0B C9 01 D0 38 AD 72 07 -0x81D0: C9 03 D0 31 AD 77 07 F0 04 CE 77 07 60 AD FC 06 -0x81E0: 29 10 F0 19 AD 76 07 29 80 D0 1A A9 2B 8D 77 07 -0x81F0: AD 76 07 A8 C8 84 FA 49 01 09 80 D0 05 AD 76 07 -0x8200: 29 7F 8D 76 07 60 AC 4E 07 A9 28 85 00 A2 0E BD -0x8210: E4 06 C5 00 90 0F AC E0 06 18 79 E1 06 90 03 18 -0x8220: 65 00 9D E4 06 CA 10 E7 AE E0 06 E8 E0 03 D0 02 -0x8230: A2 00 8E E0 06 A2 08 A0 02 B9 E9 06 9D F1 06 18 -0x8240: 69 08 9D F2 06 18 69 08 9D F3 06 CA CA CA 88 10 -0x8250: E8 60 AD 70 07 20 04 8E 31 82 DC AE 8B 83 18 92 -0x8260: A0 00 2C A0 04 A9 F8 99 00 02 C8 C8 C8 C8 D0 F7 -0x8270: 60 AD 72 07 20 04 8E CF 8F 67 85 61 90 45 82 04 -0x8280: 20 73 01 00 00 A0 00 AD FC 06 0D FD 06 C9 10 F0 -0x8290: 04 C9 90 D0 03 4C D8 82 C9 20 F0 1A AE A2 07 D0 -0x82A0: 0B 8D 80 07 20 6B 83 B0 60 4C C0 82 AE FC 07 F0 -0x82B0: 4A C9 40 D0 46 C8 AD A2 07 F0 4E A9 18 8D A2 07 -0x82C0: AD 80 07 D0 36 A9 10 8D 80 07 C0 01 F0 0E AD 7A -0x82D0: 07 49 01 8D 7A 07 20 25 83 4C BB 82 AE 6B 07 E8 -0x82E0: 8A 29 07 8D 6B 07 20 0E 83 BD 3F 82 9D 00 03 E8 -0x82F0: E0 06 30 F5 AC 5F 07 C8 8C 04 03 A9 00 8D FC 06 -0x8300: 20 EA AE A5 0E C9 06 D0 44 A9 00 8D 70 07 8D 72 -0x8310: 07 8D 22 07 EE 74 07 60 AC A2 07 F0 EC 0A 90 06 -0x8320: AD FD 07 20 0E 83 20 03 9C EE 5D 07 EE 64 07 EE -0x8330: 57 07 EE 70 07 AD FC 07 8D 6A 07 A9 00 8D 72 07 -0x8340: 8D A2 07 A2 17 A9 00 9D DD 07 CA 10 FA 60 8D 5F -0x8350: 07 8D 66 07 A2 00 8E 60 07 8E 67 07 60 07 22 49 -0x8360: 83 CE 24 24 00 A0 07 B9 1D 83 99 00 03 88 10 F7 -0x8370: AD 7A 07 F0 0A A9 24 8D 04 03 A9 CE 8D 06 03 60 -0x8380: 01 80 02 81 41 80 01 42 C2 02 80 41 C1 41 C1 01 -0x8390: C1 01 02 80 00 9B 10 18 05 2C 20 24 15 5A 10 20 -0x83A0: 28 30 20 10 80 20 30 30 01 FF 00 AE 17 07 AD 18 -0x83B0: 07 D0 0D E8 EE 17 07 38 BD 54 83 8D 18 07 F0 0A -0x83C0: BD 3F 83 8D FC 06 CE 18 07 18 60 20 A0 83 AD 72 -0x83D0: 07 F0 07 A2 00 86 08 20 47 C0 20 2A F1 4C E9 EE -0x83E0: AD 72 07 20 04 8E EC CF B0 83 BD 83 F6 83 61 84 -0x83F0: AE 1B 07 E8 86 34 A9 08 85 FC 4C 4E 87 A0 00 84 -0x8400: 35 A5 6D C5 34 D0 06 A5 86 C9 60 B0 03 E6 35 C8 -0x8410: 98 20 E6 B0 AD 1A 07 C5 34 F0 16 AD 68 07 18 69 -0x8420: 80 8D 68 07 A9 01 69 00 A8 20 C4 AF 20 6F AF E6 -0x8430: 35 A5 35 F0 68 60 AD 49 07 D0 48 AD 19 07 F0 18 -0x8440: C9 09 B0 3F AC 5F 07 C0 07 D0 09 C9 03 90 34 E9 -0x8450: 01 4C 18 84 C9 02 90 2B A8 D0 08 AD 53 07 F0 14 -0x8460: C8 D0 11 C8 AD 5F 07 C9 07 F0 09 88 C0 04 B0 26 -0x8470: C0 03 B0 0F C0 03 D0 04 A9 04 85 FC 98 18 69 0C -0x8480: 8D 73 07 AD 49 07 18 69 04 8D 49 07 AD 19 07 69 -0x8490: 00 8D 19 07 C9 07 90 08 A9 06 8D A1 07 EE 72 07 -0x84A0: 60 AD A1 07 D0 20 AC 5F 07 C0 07 B0 1A A9 00 8D -0x84B0: 60 07 8D 5C 07 8D 72 07 EE 5F 07 20 03 9C EE 57 -0x84C0: 07 A9 01 8D 70 07 60 AD FC 06 0D FD 06 29 40 F0 -0x84D0: 0D A9 01 8D FC 07 A9 FF 8D 5A 07 20 48 92 60 FF -0x84E0: FF F6 FB F7 FB F8 FB F9 FB FA FB F6 50 F7 50 F8 -0x84F0: 50 F9 50 FA 50 FD FE FF 41 42 44 45 48 31 32 34 -0x8500: 35 38 00 BD 10 01 F0 BE C9 0B 90 05 A9 0B 9D 10 -0x8510: 01 A8 BD 2C 01 D0 04 9D 10 01 60 DE 2C 01 C9 2B -0x8520: D0 1E C0 0B D0 07 EE 5A 07 A9 40 85 FE B9 B7 84 -0x8530: 4A 4A 4A 4A AA B9 B7 84 29 0F 9D 34 01 20 27 BC -0x8540: BC E5 06 B5 16 C9 12 F0 22 C9 0D F0 1E C9 05 F0 -0x8550: 12 C9 0A F0 16 C9 0B F0 12 C9 09 B0 06 B5 1E C9 -0x8560: 02 B0 08 AE EE 03 BC EC 06 A6 08 BD 1E 01 C9 18 -0x8570: 90 05 E9 01 9D 1E 01 BD 1E 01 E9 08 20 C1 E5 BD -0x8580: 17 01 99 03 02 18 69 08 99 07 02 A9 02 99 02 02 -0x8590: 99 06 02 BD 10 01 0A AA BD 9F 84 99 01 02 BD A0 -0x85A0: 84 99 05 02 A6 08 60 AD 3C 07 20 04 8E 8B 85 9B -0x85B0: 85 52 86 5A 86 93 86 9D 88 A8 86 9D 88 E6 86 BF -0x85C0: 85 E3 85 43 86 FF 86 32 87 49 87 20 20 82 20 19 -0x85D0: 8E AD 70 07 F0 32 A2 03 4C C5 85 AD 44 07 48 AD -0x85E0: 56 07 48 A9 00 8D 56 07 A9 02 8D 44 07 20 F1 85 -0x85F0: 68 8D 56 07 68 8D 44 07 4C 45 87 01 02 03 04 AC -0x8600: 4E 07 BE BB 85 8E 73 07 4C 45 87 00 09 0A 04 22 -0x8610: 22 0F 0F 0F 22 0F 0F 22 16 27 18 22 30 27 19 22 -0x8620: 37 27 16 AC 44 07 F0 06 B9 C7 85 8D 73 07 EE 3C -0x8630: 07 AE 00 03 A0 00 AD 53 07 F0 02 A0 04 AD 56 07 -0x8640: C9 02 D0 02 A0 08 A9 03 85 00 B9 D7 85 9D 04 03 -0x8650: C8 E8 C6 00 10 F4 AE 00 03 AC 44 07 D0 03 AC 4E -0x8660: 07 B9 CF 85 9D 04 03 A9 3F 9D 01 03 A9 10 9D 02 -0x8670: 03 A9 04 9D 03 03 A9 00 9D 08 03 8A 18 69 07 8D -0x8680: 00 03 60 AD 33 07 C9 01 D0 05 A9 0B 8D 73 07 4C -0x8690: 45 87 A9 00 20 08 88 4C 45 87 20 30 BC AE 00 03 -0x86A0: A9 20 9D 01 03 A9 73 9D 02 03 A9 03 9D 03 03 AC -0x86B0: 5F 07 C8 98 9D 04 03 A9 28 9D 05 03 AC 5C 07 C8 -0x86C0: 98 9D 06 03 A9 00 9D 07 03 8A 18 69 06 8D 00 03 -0x86D0: 4C 45 87 AD 59 07 F0 0A A9 00 8D 59 07 A9 02 4C -0x86E0: C7 86 EE 3C 07 4C 45 87 AD 70 07 F0 33 C9 03 F0 -0x86F0: 22 AD 52 07 D0 2A AC 4E 07 C0 03 F0 05 AD 69 07 -0x8700: D0 1E 20 A4 EF A9 01 20 08 88 20 A5 88 A9 00 8D -0x8710: 74 07 60 A9 12 8D A0 07 A9 03 20 08 88 4C 4E 87 -0x8720: A9 08 8D 3C 07 60 EE 74 07 20 B0 92 AD 1F 07 D0 -0x8730: F8 CE 1E 07 10 03 EE 3C 07 A9 06 8D 73 07 60 AD -0x8740: 70 07 D0 4A A9 1E 8D 06 20 A9 C0 8D 06 20 A9 03 -0x8750: 85 01 A0 00 84 00 AD 07 20 AD 07 20 91 00 C8 D0 -0x8760: 02 E6 01 A5 01 C9 04 D0 F0 C0 3A 90 EC A9 05 4C -0x8770: 4C 86 AD 70 07 D0 17 A2 00 9D 00 03 9D 00 04 CA -0x8780: D0 F7 20 25 83 EE 3C 07 60 A9 FA 20 36 BC EE 72 -0x8790: 07 60 20 43 05 16 0A 1B 12 18 20 52 0B 20 18 1B -0x87A0: 15 0D 24 24 1D 12 16 0E 20 68 05 00 24 24 2E 29 -0x87B0: 23 C0 7F AA 23 C2 01 EA FF 21 CD 07 24 24 29 24 -0x87C0: 24 24 24 21 4B 09 20 18 1B 15 0D 24 24 28 24 22 -0x87D0: 0C 47 24 23 DC 01 BA FF 21 CD 05 16 0A 1B 12 18 -0x87E0: 22 0C 07 1D 12 16 0E 24 1E 19 FF 21 CD 05 16 0A -0x87F0: 1B 12 18 22 0B 09 10 0A 16 0E 24 18 1F 0E 1B FF -0x8800: 25 84 15 20 0E 15 0C 18 16 0E 24 1D 18 24 20 0A -0x8810: 1B 19 24 23 18 17 0E 2B 26 25 01 24 26 2D 01 24 -0x8820: 26 35 01 24 27 D9 46 AA 27 E1 45 AA FF 15 1E 12 -0x8830: 10 12 04 03 02 00 24 05 24 00 08 07 06 00 00 00 -0x8840: 27 27 46 4E 59 61 6E 6E 48 0A A8 C0 04 90 0C C0 -0x8850: 08 90 02 A0 08 AD 7A 07 D0 01 C8 BE FE 87 A0 00 -0x8860: BD 52 87 C9 FF F0 07 99 01 03 E8 C8 D0 F2 A9 00 -0x8870: 99 01 03 68 AA C9 04 B0 49 CA D0 23 AD 5A 07 18 -0x8880: 69 01 C9 0A 90 07 E9 0A A0 9F 8C 08 03 8D 09 03 -0x8890: AC 5F 07 C8 8C 14 03 AC 5C 07 C8 8C 16 03 60 AD -0x88A0: 7A 07 F0 1D AD 53 07 CA D0 09 AC 70 07 C0 03 F0 -0x88B0: 02 49 01 4A 90 0B A0 04 B9 ED 87 99 04 03 88 10 -0x88C0: F7 60 E9 04 0A 0A AA A0 00 BD F2 87 99 1C 03 E8 -0x88D0: C8 C8 C8 C8 C0 0C 90 F1 A9 2C 4C 3F 86 AD A0 07 -0x88E0: D0 0B 20 20 82 A9 07 8D A0 07 EE 3C 07 60 AD 26 -0x88F0: 07 29 01 85 05 AC 40 03 84 00 AD 21 07 99 42 03 -0x8900: AD 20 07 99 41 03 A9 9A 99 43 03 A9 00 85 04 AA -0x8910: 86 01 BD A1 06 29 C0 85 03 0A 2A 2A A8 B9 08 8B -0x8920: 85 06 B9 0C 8B 85 07 BD A1 06 0A 0A 85 02 AD 1F -0x8930: 07 29 01 49 01 0A 65 02 A8 A6 00 B1 06 9D 44 03 -0x8940: C8 B1 06 9D 45 03 A4 04 A5 05 D0 0E A5 01 4A B0 -0x8950: 19 26 03 26 03 26 03 4C 30 89 A5 01 4A B0 0F 46 -0x8960: 03 46 03 46 03 46 03 4C 30 89 46 03 46 03 E6 04 -0x8970: B9 F9 03 05 03 99 F9 03 E6 00 E6 00 A6 01 E8 E0 -0x8980: 0D 90 8D A4 00 C8 C8 C8 A9 00 99 41 03 8C 40 03 -0x8990: EE 21 07 AD 21 07 29 1F D0 0D A9 80 8D 21 07 AD -0x89A0: 20 07 49 04 8D 20 07 4C BD 89 AD 21 07 29 1F 38 -0x89B0: E9 04 29 1F 85 01 AD 20 07 B0 02 49 04 29 04 09 -0x89C0: 23 85 00 A5 01 4A 4A 69 C0 85 01 A2 00 AC 40 03 -0x89D0: A5 00 99 41 03 A5 01 18 69 08 99 42 03 85 01 BD -0x89E0: F9 03 99 44 03 A9 01 99 43 03 4A 9D F9 03 C8 C8 -0x89F0: C8 C8 E8 E0 07 90 D9 99 41 03 8C 40 03 A9 06 8D -0x8A00: 73 07 60 27 27 27 17 07 17 3F 0C 04 FF FF FF FF -0x8A10: 00 0F 07 12 0F 0F 07 17 0F 0F 07 17 1C 0F 07 17 -0x8A20: 00 A5 09 29 07 D0 51 AE 00 03 E0 31 B0 4A A8 B9 -0x8A30: C9 89 9D 01 03 E8 C8 C0 08 90 F4 AE 00 03 A9 03 -0x8A40: 85 00 AD 4E 07 0A 0A A8 B9 D1 89 9D 04 03 C8 E8 -0x8A50: C6 00 10 F4 AE 00 03 AC D4 06 B9 C3 89 9D 05 03 -0x8A60: AD 00 03 18 69 07 8D 00 03 EE D4 06 AD D4 06 C9 -0x8A70: 06 90 05 A9 00 8D D4 06 60 45 45 47 47 47 47 47 -0x8A80: 47 57 58 59 5A 24 24 24 24 26 26 26 26 A0 41 A9 -0x8A90: 03 AE 4E 07 D0 02 A9 04 20 97 8A A9 06 8D 73 07 -0x8AA0: 60 20 6D 8A EE F0 03 DE EC 03 60 A9 00 A0 03 C9 -0x8AB0: 00 F0 14 A0 00 C9 58 F0 0E C9 51 F0 0A C8 C9 5D -0x8AC0: F0 05 C9 52 F0 01 C8 98 AC 00 03 C8 20 97 8A 88 -0x8AD0: 98 18 69 0A 4C 3F 86 86 00 84 01 0A 0A AA A0 20 -0x8AE0: A5 06 C9 D0 90 02 A0 24 84 03 29 0F 0A 85 04 A9 -0x8AF0: 00 85 05 A5 02 18 69 20 0A 26 05 0A 26 05 65 04 -0x8B00: 85 04 A5 05 69 00 18 65 03 85 05 A4 01 BD 39 8A -0x8B10: 99 03 03 BD 3A 8A 99 04 03 BD 3B 8A 99 08 03 BD -0x8B20: 3C 8A 99 09 03 A5 04 99 01 03 18 69 20 99 06 03 -0x8B30: A5 05 99 00 03 99 05 03 A9 02 99 02 03 99 07 03 -0x8B40: A9 00 99 0A 03 A6 00 60 10 AC 64 8C 8B 8B 8C 8C -0x8B50: 24 24 24 24 27 27 27 27 24 24 24 35 36 25 37 25 -0x8B60: 24 38 24 24 24 30 30 26 26 26 34 26 24 31 24 32 -0x8B70: 33 26 24 33 34 26 26 26 26 26 26 26 24 C0 24 C0 -0x8B80: 24 7F 7F 24 B8 BA B9 BB B8 BC B9 BD BA BC BB BD -0x8B90: 60 64 61 65 62 66 63 67 60 64 61 65 62 66 63 67 -0x8BA0: 68 68 69 69 26 26 6A 6A 4B 4C 4D 4E 4D 4F 4D 4F -0x8BB0: 4D 4E 50 51 6B 70 2C 2D 6C 71 6D 72 6E 73 6F 74 -0x8BC0: 86 8A 87 8B 88 8C 88 8C 89 8D 69 69 8E 91 8F 92 -0x8BD0: 26 93 26 93 90 94 69 69 A4 E9 EA EB 24 24 24 24 -0x8BE0: 24 2F 24 3D A2 A2 A3 A3 24 24 24 24 A2 A2 A3 A3 -0x8BF0: 99 24 99 24 24 A2 3E 3F 5B 5C 24 A3 24 24 24 24 -0x8C00: 9D 47 9E 47 47 47 27 27 47 47 47 47 27 27 47 47 -0x8C10: A9 47 AA 47 9B 27 9C 27 27 27 27 27 52 52 52 52 -0x8C20: 80 A0 81 A1 BE BE BF BF 75 BA 76 BB BA BA BB BB -0x8C30: 45 47 45 47 47 47 47 47 45 47 45 47 B4 B6 B5 B7 -0x8C40: 45 47 45 47 45 47 45 47 45 47 45 47 45 47 45 47 -0x8C50: 45 47 45 47 47 47 47 47 47 47 47 47 47 47 47 47 -0x8C60: 47 47 47 47 47 47 47 47 24 24 24 24 24 24 24 24 -0x8C70: AB AC AD AE 5D 5E 5D 5E C1 24 C1 24 C6 C8 C7 C9 -0x8C80: CA CC CB CD 2A 2A 40 40 24 24 24 24 24 47 24 47 -0x8C90: 82 83 84 85 24 47 24 47 86 8A 87 8B 8E 91 8F 92 -0x8CA0: 24 2F 24 3D 24 24 24 35 36 25 37 25 24 38 24 24 -0x8CB0: 24 24 39 24 3A 24 3B 24 3C 24 24 24 41 26 41 26 -0x8CC0: 26 26 26 26 B0 B1 B2 B3 77 79 77 79 53 55 54 56 -0x8CD0: 53 55 54 56 A5 A7 A6 A8 C2 C4 C3 C5 57 59 58 5A -0x8CE0: 7B 7D 7C 7E 3F 00 20 0F 15 12 25 0F 3A 1A 0F 0F -0x8CF0: 30 12 0F 0F 27 12 0F 22 16 27 18 0F 10 30 27 0F -0x8D00: 16 30 27 0F 0F 30 10 00 3F 00 20 0F 29 1A 0F 0F -0x8D10: 36 17 0F 0F 30 21 0F 0F 27 17 0F 0F 16 27 18 0F -0x8D20: 1A 30 27 0F 16 30 27 0F 0F 36 17 00 3F 00 20 0F -0x8D30: 29 1A 09 0F 3C 1C 0F 0F 30 21 1C 0F 27 17 1C 0F -0x8D40: 16 27 18 0F 1C 36 17 0F 16 30 27 0F 0C 3C 1C 00 -0x8D50: 3F 00 20 0F 30 10 00 0F 30 10 00 0F 30 16 00 0F -0x8D60: 27 17 00 0F 16 27 18 0F 1C 36 17 0F 16 30 27 0F -0x8D70: 00 30 10 00 3F 00 04 22 30 00 10 00 3F 00 04 0F -0x8D80: 30 00 10 00 3F 00 04 22 27 16 0F 00 3F 14 04 0F -0x8D90: 1A 30 27 00 25 48 10 1D 11 0A 17 14 24 22 18 1E -0x8DA0: 24 16 0A 1B 12 18 2B 00 25 48 10 1D 11 0A 17 14 -0x8DB0: 24 22 18 1E 24 15 1E 12 10 12 2B 00 25 C5 16 0B -0x8DC0: 1E 1D 24 18 1E 1B 24 19 1B 12 17 0C 0E 1C 1C 24 -0x8DD0: 12 1C 24 12 17 26 05 0F 0A 17 18 1D 11 0E 1B 24 -0x8DE0: 0C 0A 1C 1D 15 0E 2B 00 25 A7 13 22 18 1E 1B 24 -0x8DF0: 1A 1E 0E 1C 1D 24 12 1C 24 18 1F 0E 1B AF 00 25 -0x8E00: E3 1B 20 0E 24 19 1B 0E 1C 0E 17 1D 24 22 18 1E -0x8E10: 24 0A 24 17 0E 20 24 1A 1E 0E 1C 1D AF 00 26 4A -0x8E20: 0D 19 1E 1C 11 24 0B 1E 1D 1D 18 17 24 0B 00 26 -0x8E30: 88 11 1D 18 24 1C 0E 15 0E 0C 1D 24 0A 24 20 18 -0x8E40: 1B 15 0D 00 0A A8 68 85 04 68 85 05 C8 B1 04 85 -0x8E50: 06 C8 B1 04 85 07 6C 06 00 AD 02 20 AD 78 07 09 -0x8E60: 10 29 F0 20 ED 8E A9 24 20 2D 8E A9 20 8D 06 20 -0x8E70: A9 00 8D 06 20 A2 04 A0 C0 A9 24 8D 07 20 88 D0 -0x8E80: FA CA D0 F7 A0 40 8A 8D 00 03 8D 01 03 8D 07 20 -0x8E90: 88 D0 FA 8D 3F 07 8D 40 07 4C E6 8E A9 01 8D 16 -0x8EA0: 40 4A AA 8D 16 40 20 6A 8E E8 A0 08 48 BD 16 40 -0x8EB0: 85 00 4A 05 00 4A 68 2A 88 D0 F1 9D FC 06 48 29 -0x8EC0: 30 3D 4A 07 F0 07 68 29 CF 9D FC 06 60 68 9D 4A -0x8ED0: 07 60 8D 06 20 C8 B1 00 8D 06 20 C8 B1 00 0A 48 -0x8EE0: AD 78 07 09 04 B0 02 29 FB 20 ED 8E 68 0A 90 03 -0x8EF0: 09 02 C8 4A 4A AA B0 01 C8 B1 00 8D 07 20 CA D0 -0x8F00: F5 38 98 65 00 85 00 A9 00 65 01 85 01 A9 3F 8D -0x8F10: 06 20 A9 00 8D 06 20 8D 06 20 8D 06 20 AE 02 20 -0x8F20: A0 00 B1 00 D0 AC 8D 05 20 8D 05 20 60 8D 00 20 -0x8F30: 8D 78 07 60 F0 06 62 06 62 06 6D 02 6D 02 7A 03 -0x8F40: 06 0C 12 18 1E 24 85 00 20 11 8F A5 00 4A 4A 4A -0x8F50: 4A 18 69 01 29 0F C9 06 B0 44 48 0A A8 AE 00 03 -0x8F60: A9 20 C0 00 D0 02 A9 22 9D 01 03 B9 F4 8E 9D 02 -0x8F70: 03 B9 F5 8E 9D 03 03 85 03 86 02 68 AA BD 00 8F -0x8F80: 38 F9 F5 8E A8 A6 02 B9 D7 07 9D 04 03 E8 C8 C6 -0x8F90: 03 D0 F4 A9 00 9D 04 03 E8 E8 E8 8E 00 03 60 AD -0x8FA0: 70 07 C9 00 F0 16 A2 05 BD 34 01 18 79 D7 07 30 -0x8FB0: 16 C9 0A B0 19 99 D7 07 88 CA 10 EC A9 00 A2 06 -0x8FC0: 9D 33 01 CA 10 FA 60 DE 33 01 A9 09 D0 E7 38 E9 -0x8FD0: 0A FE 33 01 4C 75 8F A2 05 20 9E 8F A2 0B A0 05 -0x8FE0: 38 BD DD 07 F9 D7 07 CA 88 10 F6 90 0E E8 C8 BD -0x8FF0: DD 07 99 D7 07 E8 C8 C0 06 90 F4 60 04 30 48 60 -0x9000: 78 90 A8 C0 D8 E8 24 F8 FC 28 2C 18 FF 23 58 A0 -0x9010: 6F 20 CC 90 A0 1F 99 B0 07 88 10 FA A9 18 8D A2 -0x9020: 07 20 03 9C A0 4B 20 CC 90 A2 21 A9 00 9D 80 07 -0x9030: CA 10 FA AD 5B 07 AC 52 07 F0 03 AD 51 07 8D 1A -0x9040: 07 8D 25 07 8D 28 07 20 38 B0 A0 20 29 01 F0 02 -0x9050: A0 24 8C 20 07 A0 80 8C 21 07 0A 0A 0A 0A 8D A0 -0x9060: 06 CE 30 07 CE 31 07 CE 32 07 A9 0B 8D 1E 07 20 -0x9070: 22 9C AD 6A 07 D0 10 AD 5F 07 C9 04 90 0C D0 07 -0x9080: AD 5C 07 C9 02 90 03 EE CC 06 AD 5B 07 F0 05 A9 -0x9090: 02 8D 10 07 A9 80 85 FB A9 01 8D 74 07 EE 72 07 -0x90A0: 60 A9 01 8D 57 07 8D 54 07 A9 02 8D 5A 07 8D 61 -0x90B0: 07 A9 00 8D 74 07 A8 99 00 03 C8 D0 FA 8D 59 07 -0x90C0: 8D 69 07 8D 28 07 A9 FF 8D A0 03 AD 1A 07 4E 78 -0x90D0: 07 29 01 6A 2E 78 07 20 ED 90 A9 38 8D E3 06 A9 -0x90E0: 48 8D E2 06 A9 58 8D E1 06 A2 0E BD BC 8F 9D E4 -0x90F0: 06 CA 10 F7 A0 03 B9 CB 8F 99 00 02 88 10 F7 20 -0x9100: AF 92 20 AA 92 EE 22 07 EE 72 07 60 A2 07 A9 00 -0x9110: 85 06 86 07 E0 01 D0 04 C0 60 B0 02 91 06 88 C0 -0x9120: FF D0 F1 CA 10 EC 60 02 01 04 08 10 20 AD 70 07 -0x9130: F0 23 AD 52 07 C9 02 F0 0D A0 05 AD 10 07 C9 06 -0x9140: F0 0E C9 07 F0 0A AC 4E 07 AD 43 07 F0 02 A0 04 -0x9150: B9 E7 90 85 FB 60 28 18 38 28 08 00 00 20 B0 50 -0x9160: 00 00 B0 B0 F0 00 20 00 00 00 00 00 00 20 04 03 -0x9170: 02 AD 1A 07 85 6D A9 28 8D 0A 07 A9 01 85 33 85 -0x9180: B5 A9 00 85 1D CE 90 04 A0 00 8C 5B 07 AD 4E 07 -0x9190: D0 01 C8 8C 04 07 AE 10 07 AC 52 07 F0 07 C0 01 -0x91A0: F0 03 BE 18 91 B9 16 91 85 86 BD 1C 91 85 CE BD -0x91B0: 25 91 8D C4 03 20 F1 85 AC 15 07 F0 1A AD 57 07 -0x91C0: F0 15 B9 2D 91 8D F8 07 A9 01 8D FA 07 4A 8D F9 -0x91D0: 07 8D 57 07 8D 9F 07 AC 58 07 F0 14 A9 03 85 1D -0x91E0: A2 00 20 84 BD A9 F0 85 D7 A2 05 A0 00 20 1E B9 -0x91F0: AC 4E 07 D0 03 20 0B B7 A9 07 85 0E 60 56 40 65 -0x9200: 70 66 40 66 40 66 40 66 60 65 70 00 00 EE 74 07 -0x9210: A9 00 8D 22 07 A9 80 85 FC CE 5A 07 10 0B A9 00 -0x9220: 8D 72 07 A9 03 8D 70 07 60 AD 5F 07 0A AA AD 5C -0x9230: 07 29 02 F0 01 E8 BC BD 91 AD 5C 07 4A 98 B0 04 -0x9240: 4A 4A 4A 4A 29 0F CD 1A 07 F0 04 90 02 A9 00 8D -0x9250: 5B 07 20 82 92 4C 64 92 AD 72 07 20 04 8E 24 92 -0x9260: 67 85 37 92 A9 00 8D 3C 07 8D 22 07 A9 02 85 FC -0x9270: EE 74 07 EE 72 07 60 A9 00 8D 74 07 AD FC 06 29 -0x9280: 10 D0 05 AD A0 07 D0 39 A9 80 85 FC 20 82 92 90 -0x9290: 13 AD 5F 07 8D FD 07 A9 00 0A 8D 72 07 8D A0 07 -0x92A0: 8D 70 07 60 20 03 9C A9 01 8D 54 07 EE 57 07 A9 -0x92B0: 00 8D 47 07 8D 56 07 85 0E 8D 72 07 A9 01 8D 70 -0x92C0: 07 60 38 AD 7A 07 F0 21 AD 61 07 30 1C AD 53 07 -0x92D0: 49 01 8D 53 07 A2 06 BD 5A 07 48 BD 61 07 9D 5A -0x92E0: 07 68 9D 61 07 CA 10 EF 18 60 A9 FF 8D C9 06 60 -0x92F0: AC 1F 07 D0 05 A0 08 8C 1F 07 88 98 20 C8 92 CE -0x9300: 1F 07 D0 03 20 6A 89 60 20 04 8E DB 92 AE 88 AE -0x9310: 88 FC 93 DB 92 AE 88 AE 88 FC 93 EE 26 07 AD 26 -0x9320: 07 29 0F D0 06 8D 26 07 EE 25 07 EE A0 06 AD A0 -0x9330: 06 29 1F 8D A0 06 60 00 30 60 93 00 00 11 12 12 -0x9340: 13 00 00 51 52 53 00 00 00 00 00 00 01 02 02 03 -0x9350: 00 00 00 00 00 00 91 92 93 00 00 00 00 51 52 53 -0x9360: 41 42 43 00 00 00 00 00 91 92 97 87 88 89 99 00 -0x9370: 00 00 11 12 13 A4 A5 A5 A5 A6 97 98 99 01 02 03 -0x9380: 00 A4 A5 A6 00 11 12 12 12 13 00 00 00 00 01 02 -0x9390: 02 03 00 A4 A5 A5 A6 00 00 00 11 12 12 13 00 00 -0x93A0: 00 00 00 00 00 9C 00 8B AA AA AA AA 11 12 13 8B -0x93B0: 00 9C 9C 00 00 01 02 03 11 12 12 13 00 00 00 00 -0x93C0: AA AA 9C AA 00 8B 00 01 02 03 80 83 00 81 84 00 -0x93D0: 82 85 00 02 00 00 03 00 00 04 00 00 00 05 06 07 -0x93E0: 06 0A 00 08 09 4D 00 00 0D 0F 4E 0E 4E 4E 00 0D -0x93F0: 1A 86 87 87 87 87 87 87 87 87 87 87 69 69 00 00 -0x9400: 00 00 00 45 47 47 47 47 47 00 00 00 00 00 00 00 -0x9410: 00 00 00 00 00 00 86 87 69 54 52 62 00 00 00 18 -0x9420: 01 18 07 18 0F 18 FF 18 01 1F 07 1F 0F 1F 81 1F -0x9430: 01 00 8F 1F F1 1F F9 18 F1 18 FF 1F AD 28 07 F0 -0x9440: 03 20 08 95 A2 0C A9 00 9D A1 06 CA 10 FA AC 42 -0x9450: 07 F0 42 AD 25 07 C9 03 30 05 38 E9 03 10 F7 0A -0x9460: 0A 0A 0A 79 F6 92 6D 26 07 AA BD FA 92 F0 26 48 -0x9470: 29 0F 38 E9 01 85 00 0A 65 00 AA 68 4A 4A 4A 4A -0x9480: A8 A9 03 85 00 BD 8A 93 99 A1 06 E8 C8 C0 0B F0 -0x9490: 04 C6 00 D0 F0 AE 41 07 F0 13 BC AD 93 A2 00 B9 -0x94A0: B1 93 F0 03 9D A1 06 C8 E8 E0 0D D0 F2 AC 4E 07 -0x94B0: D0 0C AD 5F 07 C9 07 D0 05 A9 62 4C 88 94 B9 D8 -0x94C0: 93 AC 43 07 F0 02 A9 88 85 07 A2 00 AD 27 07 0A -0x94D0: A8 B9 DC 93 85 00 C8 84 01 AD 43 07 F0 0A E0 00 -0x94E0: F0 06 A5 00 29 08 85 00 A0 00 B9 8A C6 24 00 F0 -0x94F0: 05 A5 07 9D A1 06 E8 E0 0D F0 18 AD 4E 07 C9 02 -0x9500: D0 08 E0 0B D0 04 A9 54 85 07 C8 C0 08 D0 DB A4 -0x9510: 01 D0 BE 20 08 95 AD A0 06 20 E1 9B A2 00 A0 00 -0x9520: 84 00 BD A1 06 29 C0 0A 2A 2A A8 BD A1 06 D9 04 -0x9530: 95 B0 02 A9 00 A4 00 91 06 98 18 69 10 A8 E8 E0 -0x9540: 0D 90 DD 60 10 51 88 C0 A2 02 86 08 A9 00 8D 29 -0x9550: 07 AC 2C 07 B1 E7 C9 FD F0 4B BD 30 07 10 46 C8 -0x9560: B1 E7 0A 90 0B AD 2B 07 D0 06 EE 2B 07 EE 2A 07 -0x9570: 88 B1 E7 29 0F C9 0D D0 1B C8 B1 E7 88 29 40 D0 -0x9580: 1C AD 2B 07 D0 17 C8 B1 E7 29 1F 8D 2A 07 EE 2B -0x9590: 07 4C 6E 95 C9 0E D0 05 AD 28 07 D0 08 AD 2A 07 -0x95A0: CD 25 07 90 06 20 95 95 4C 71 95 EE 29 07 20 89 -0x95B0: 95 A6 08 BD 30 07 30 03 DE 30 07 CA 10 8C AD 29 -0x95C0: 07 D0 85 AD 28 07 D0 80 60 EE 2C 07 EE 2C 07 A9 -0x95D0: 00 8D 2B 07 60 BD 30 07 30 03 BC 2D 07 A2 10 B1 -0x95E0: E7 C9 FD F0 E3 29 0F C9 0F F0 08 A2 08 C9 0C F0 -0x95F0: 02 A2 00 86 07 A6 08 C9 0E D0 08 A9 00 85 07 A9 -0x9600: 2E D0 53 C9 0D D0 1B A9 22 85 07 C8 B1 E7 29 40 -0x9610: F0 63 B1 E7 29 7F C9 4B D0 03 EE 45 07 29 3F 4C -0x9620: 16 96 C9 0C B0 27 C8 B1 E7 29 70 D0 0B A9 16 85 -0x9630: 07 B1 E7 29 0F 4C 16 96 85 00 C9 70 D0 0A B1 E7 -0x9640: 29 08 F0 04 A9 00 85 00 A5 00 4C 12 96 C8 B1 E7 -0x9650: 29 70 4A 4A 4A 4A 85 00 BD 30 07 10 42 AD 2A 07 -0x9660: CD 25 07 F0 11 AC 2C 07 B1 E7 29 0F C9 0E D0 05 -0x9670: AD 28 07 D0 21 60 AD 28 07 F0 0B A9 00 8D 28 07 -0x9680: 8D 29 07 85 08 60 AC 2C 07 B1 E7 29 F0 4A 4A 4A -0x9690: 4A CD 26 07 D0 DF AD 2C 07 9D 2D 07 20 89 95 A5 -0x96A0: 00 18 65 07 20 04 8E E5 98 40 97 2E 9A 3E 9A F2 -0x96B0: 99 50 9A 59 9A E5 98 41 9B BA 97 79 99 7C 99 7F -0x96C0: 99 57 99 68 99 6B 99 D0 99 D7 99 06 98 B7 9A AB -0x96D0: 98 94 99 0E 9B 0E 9B 0E 9B 01 9B 19 9B 19 9B 19 -0x96E0: 9B 14 9B 19 9B 6F 98 19 9A D3 9A 82 98 9E 99 09 -0x96F0: 9A 0E 9A 01 9A F2 96 0D 97 0D 97 2B 97 2B 97 2B -0x9700: 97 45 96 C5 96 BC 2D 07 C8 B1 E7 48 29 40 D0 12 -0x9710: 68 48 29 0F 8D 27 07 68 29 30 4A 4A 4A 4A 8D 42 -0x9720: 07 60 68 29 07 C9 04 90 05 8D 44 07 A9 00 8D 41 -0x9730: 07 60 A2 04 AD 5F 07 F0 08 E8 AC 4E 07 88 D0 01 -0x9740: E8 8A 8D D6 06 20 08 88 A9 0D 20 16 97 AD 23 07 -0x9750: 49 01 8D 23 07 60 85 00 A9 00 A2 04 B4 16 C4 00 -0x9760: D0 02 95 0F CA 10 F5 60 14 17 18 A6 00 BD 20 97 -0x9770: A0 05 88 30 07 D9 16 00 D0 F8 A9 00 8D CD 06 60 -0x9780: AD 33 07 20 04 8E 4C 97 78 97 69 9A 20 BB 9B BD -0x9790: 30 07 F0 1F 10 11 98 9D 30 07 AD 25 07 0D 26 07 -0x97A0: F0 05 A9 16 4C B0 97 A6 07 A9 17 9D A1 06 A9 4C -0x97B0: 4C AA 97 A9 18 4C B0 97 20 AC 9B 84 06 90 0C BD -0x97C0: 30 07 4A 9D 36 07 A9 19 4C B0 97 A9 1B BC 30 07 -0x97D0: F0 1E BD 36 07 85 06 A6 07 A9 1A 9D A1 06 C4 06 -0x97E0: D0 2C E8 A9 4F 9D A1 06 A9 50 E8 A0 0F 4C 7D 9B -0x97F0: A6 07 A0 00 4C 7D 9B 42 41 43 20 AC 9B A0 00 B0 -0x9800: 07 C8 BD 30 07 D0 01 C8 B9 B7 97 8D A1 06 60 00 -0x9810: 45 45 45 00 00 48 47 46 00 45 49 49 49 45 47 47 -0x9820: 4A 47 47 47 47 4B 47 47 49 49 49 49 49 47 4A 47 -0x9830: 4A 47 47 4B 47 4B 47 47 47 47 47 47 4A 47 4A 47 -0x9840: 4A 4B 47 4B 47 4B 20 BB 9B 84 07 A0 04 20 AF 9B -0x9850: 8A 48 BC 30 07 A6 07 A9 0B 85 06 B9 CF 97 9D A1 -0x9860: 06 E8 A5 06 F0 07 C8 C8 C8 C8 C8 C6 06 E0 0B D0 -0x9870: EA 68 AA AD 25 07 F0 36 BD 30 07 C9 01 F0 2A A4 -0x9880: 07 D0 04 C9 03 F0 22 C9 02 D0 23 20 CB 9B 48 20 -0x9890: 4A 99 68 95 87 AD 25 07 95 6E A9 01 95 B6 95 0F -0x98A0: A9 90 95 CF A9 31 95 16 60 A0 52 8C AB 06 60 20 -0x98B0: BB 9B BC 30 07 A6 07 A9 6B 9D A1 06 A9 6C 9D A2 -0x98C0: 06 60 A0 03 20 AF 9B A0 0A 20 B3 98 B0 10 A2 06 -0x98D0: A9 00 9D A1 06 CA 10 F8 B9 DD 98 8D A8 06 60 15 -0x98E0: 14 00 00 15 1E 1D 1C 15 21 20 1F A0 03 20 AF 9B -0x98F0: 20 BB 9B 88 88 84 05 BC 30 07 84 06 A6 05 E8 B9 -0x9900: 9F 98 C9 00 F0 08 A2 00 A4 05 20 7D 9B 18 A4 06 -0x9910: B9 A3 98 9D A1 06 B9 A7 98 9D A2 06 60 11 10 15 -0x9920: 14 13 12 15 14 20 39 99 A5 00 F0 04 C8 C8 C8 C8 -0x9930: 98 48 AD 60 07 0D 5F 07 F0 2B BC 30 07 F0 26 20 -0x9940: 4A 99 B0 21 20 CB 9B 18 69 08 95 87 AD 25 07 69 -0x9950: 00 95 6E A9 01 95 B6 95 0F 20 D3 9B 95 CF A9 0D -0x9960: 95 16 20 87 C7 68 A8 A6 07 B9 DD 98 9D A1 06 E8 -0x9970: B9 DF 98 A4 06 88 4C 7D 9B A0 01 20 AF 9B 20 BB -0x9980: 9B 98 29 07 85 06 BC 30 07 60 A2 00 18 B5 0F F0 -0x9990: 05 E8 E0 05 D0 F6 60 20 AC 9B A9 86 8D AB 06 A2 -0x99A0: 0B A0 01 A9 87 4C 7D 9B A9 03 2C A9 07 48 20 AC -0x99B0: 9B 68 AA A9 C0 9D A1 06 60 A9 06 2C A9 07 2C A9 -0x99C0: 09 48 20 AC 9B 68 AA A9 0B 9D A1 06 E8 A0 00 A9 -0x99D0: 63 4C 7D 9B 20 BB 9B A2 02 A9 6D 4C 7D 9B A9 24 -0x99E0: 8D A1 06 A2 01 A0 08 A9 25 20 7D 9B A9 61 8D AB -0x99F0: 06 20 CB 9B 38 E9 08 85 8C AD 25 07 E9 00 85 73 -0x9A00: A9 30 85 D4 A9 B0 8D 0D 01 A9 30 85 1B E6 14 60 -0x9A10: A2 00 A0 0F 4C E9 99 8A 48 A2 01 A0 0F A9 44 20 -0x9A20: 7D 9B 68 AA 20 BB 9B A2 01 A9 40 4C 7D 9B C3 C2 -0x9A30: C2 C2 AC 4E 07 B9 EE 99 4C 44 9A 06 07 08 C5 0C -0x9A40: 89 A0 0C 20 AF 9B 4C 0E 9A A9 08 8D 73 07 A4 00 -0x9A50: BE F9 99 B9 FC 99 4C 20 9A 20 BB 9B A6 07 A9 C4 -0x9A60: A0 00 4C 7D 9B 69 61 61 62 22 51 52 52 88 AC 4E -0x9A70: 07 AD 43 07 F0 02 A0 04 B9 29 9A 4C 44 9A AC 4E -0x9A80: 07 B9 25 9A 48 20 AC 9B A6 07 A0 00 68 4C 7D 9B -0x9A90: AC 4E 07 B9 29 9A 4C 5F 9A AC 4E 07 B9 25 9A 48 -0x9AA0: 20 BB 9B 68 A6 07 4C 7D 9B 20 BB 9B A6 07 A9 64 -0x9AB0: 9D A1 06 E8 88 30 0E A9 65 9D A1 06 E8 88 30 05 -0x9AC0: A9 66 20 7D 9B AE 6A 04 20 D3 9B 9D 77 04 AD 25 -0x9AD0: 07 9D 6B 04 20 CB 9B 9D 71 04 E8 E0 06 90 02 A2 -0x9AE0: 00 8E 6A 04 60 07 07 06 05 04 03 02 01 00 03 03 -0x9AF0: 04 05 06 07 08 09 0A 20 AC 9B 90 05 A9 09 8D 34 -0x9B00: 07 CE 34 07 AC 34 07 BE AE 9A B9 A5 9A A8 A9 61 -0x9B10: 4C 7D 9B 20 BB 9B 20 4A 99 20 CB 9B 95 87 AD 25 -0x9B20: 07 95 6E 20 D3 9B 95 CF 95 58 A9 32 95 16 A0 01 -0x9B30: 94 B6 F6 0F A6 07 A9 67 9D A1 06 A9 68 9D A2 06 -0x9B40: 60 AD 5D 07 F0 36 A9 00 8D 5D 07 4C 19 9B 20 36 -0x9B50: 9B 4C 2C 9B A9 00 8D BC 06 20 36 9B 84 07 A9 00 -0x9B60: AC 4E 07 88 F0 02 A9 05 18 65 07 A8 B9 E8 BD 48 -0x9B70: 20 BB 9B 4C 48 9A A5 00 38 E9 00 A8 60 87 00 00 -0x9B80: 00 20 AC 9B 90 2D AD 4E 07 D0 28 AE 6A 04 20 CB -0x9B90: 9B 38 E9 10 9D 71 04 AD 25 07 E9 00 9D 6B 04 C8 -0x9BA0: C8 98 0A 0A 0A 0A 9D 77 04 E8 E0 05 90 02 A2 00 -0x9BB0: 8E 6A 04 AE 4E 07 BD 3D 9B A2 08 A0 0F 8C 35 07 -0x9BC0: BC A1 06 F0 18 C0 17 F0 17 C0 1A F0 13 C0 C0 F0 -0x9BD0: 0C C0 C0 B0 0B C0 54 D0 04 C9 50 F0 03 9D A1 06 -0x9BE0: E8 E0 0D B0 06 AC 35 07 88 10 D2 60 20 BB 9B BD -0x9BF0: 30 07 18 10 05 98 9D 30 07 38 60 BC 2D 07 B1 E7 -0x9C00: 29 0F 85 07 C8 B1 E7 29 0F A8 60 AD 26 07 0A 0A -0x9C10: 0A 0A 60 A5 07 0A 0A 0A 0A 18 69 20 60 00 D0 05 -0x9C20: 05 48 4A 4A 4A 4A A8 B9 DF 9B 85 07 68 29 0F 18 -0x9C30: 79 DD 9B 85 06 60 FF FF 12 36 0E 0E 0E 32 32 32 -0x9C40: 0A 26 40 20 13 9C 8D 50 07 29 60 0A 2A 2A 2A 8D -0x9C50: 4E 07 60 AC 5F 07 B9 B4 9C 18 6D 60 07 A8 B9 BC -0x9C60: 9C 60 AD 50 07 20 09 9C A8 AD 50 07 29 1F 8D 4F -0x9C70: 07 B9 E0 9C 18 6D 4F 07 A8 B9 E4 9C 85 E9 B9 06 -0x9C80: 9D 85 EA AC 4E 07 B9 28 9D 18 6D 4F 07 A8 B9 2C -0x9C90: 9D 85 E7 B9 4E 9D 85 E8 A0 00 B1 E7 48 29 07 C9 -0x9CA0: 04 90 05 8D 44 07 A9 00 8D 41 07 68 48 29 38 4A -0x9CB0: 4A 4A 8D 10 07 68 29 C0 18 2A 2A 2A 8D 15 07 C8 -0x9CC0: B1 E7 48 29 0F 8D 27 07 68 48 29 30 4A 4A 4A 4A -0x9CD0: 8D 42 07 68 29 C0 18 2A 2A 2A C9 03 D0 05 8D 43 -0x9CE0: 07 A9 00 8D 33 07 A5 E7 18 69 02 85 E7 A5 E8 69 -0x9CF0: 00 85 E8 60 00 05 0A 0E 13 17 1B 20 25 29 C0 26 -0x9D00: 60 28 29 01 27 62 24 35 20 63 22 29 41 2C 61 2A -0x9D10: 31 26 62 2E 23 2D 60 33 29 01 27 64 30 32 21 65 -0x9D20: 1F 06 1C 00 70 97 B0 DF 0A 1F 59 7E 9B A9 D0 01 -0x9D30: 1F 3C 51 7B 7C A0 A9 CE F1 FA FB 35 60 8E AA B3 -0x9D40: D8 05 33 60 71 9B 9D 9D 9D 9D 9E 9E 9E 9E 9E 9E -0x9D50: 9E 9F 9F 9F 9F 9F 9F 9F 9F 9F 9F 9F 9F A0 A0 A0 -0x9D60: A0 A0 A0 A1 A1 A1 A1 A1 00 03 19 1C 06 45 C0 6B -0x9D70: CE 37 8A 19 8E F3 48 CD 32 3B 7A 8F F6 5B CE FF -0x9D80: 92 05 7E D7 02 35 D8 79 AF 10 8F 02 6F FA AE AE -0x9D90: AE A4 A4 A5 A5 A6 A6 A6 A7 A7 A8 A8 A8 A8 A8 A9 -0x9DA0: A9 A9 AA AB AB AB AC AC AC AD A1 A2 A2 A3 A3 A3 -0x9DB0: 76 DD BB 4C EA 1D 1B CC 56 5D 16 9D C6 1D 36 9D -0x9DC0: C9 1D 04 DB 49 1D 84 1B C9 5D 88 95 0F 08 30 4C -0x9DD0: 78 2D A6 28 90 B5 FF 0F 03 56 1B C9 1B 0F 07 36 -0x9DE0: 1B AA 1B 48 95 0F 0A 2A 1B 5B 0C 78 2D 90 B5 FF -0x9DF0: 0B 8C 4B 4C 77 5F EB 0C BD DB 19 9D 75 1D 7D 5B -0x9E00: D9 1D 3D DD 99 1D 26 9D 5A 2B 8A 2C CA 1B 20 95 -0x9E10: 7B 5C DB 4C 1B CC 3B CC 78 2D A6 28 90 B5 FF 0B -0x9E20: 8C 3B 1D 8B 1D AB 0C DB 1D 0F 03 65 1D 6B 1B 05 -0x9E30: 9D 0B 1B 05 9B 0B 1D 8B 0C 1B 8C 70 15 7B 0C DB -0x9E40: 0C 0F 08 78 2D A6 28 90 B5 FF 27 A9 4B 0C 68 29 -0x9E50: 0F 06 77 1B 0F 0B 60 15 4B 8C 78 2D 90 B5 FF 0F -0x9E60: 03 8E 65 E1 BB 38 6D A8 3E E5 E7 0F 08 0B 02 2B -0x9E70: 02 5E 65 E1 BB 0E DB 0E BB 8E DB 0E FE 65 EC 0F -0x9E80: 0D 4E 65 E1 0F 0E 4E 02 E0 0F 10 FE E5 E1 1B 85 -0x9E90: 7B 0C 5B 95 78 2D 90 B5 FF A5 86 E4 28 18 A8 45 -0x9EA0: 83 69 03 C6 29 9B 83 16 A4 88 24 E9 28 05 A8 7B -0x9EB0: 28 24 8F C8 03 E8 03 46 A8 85 24 C8 24 FF EB 8E -0x9EC0: 0F 03 FB 05 17 85 DB 8E 0F 07 57 05 7B 05 9B 80 -0x9ED0: 2B 85 FB 05 0F 0B 1B 05 9B 05 FF 2E C2 66 E2 11 -0x9EE0: 0F 07 02 11 0F 0C 12 11 FF 0E C2 A8 AB 00 BB 8E -0x9EF0: 6B 82 DE 00 A0 33 86 43 06 3E B4 A0 CB 02 0F 07 -0x9F00: 7E 42 A6 83 02 0F 0A 3B 02 CB 37 0F 0C E3 0E FF -0x9F10: 9B 8E CA 0E EE 42 44 5B 86 80 B8 1B 80 50 BA 10 -0x9F20: B7 5B 00 17 85 4B 05 FE 34 40 B7 86 C6 06 5B 80 -0x9F30: 83 00 D0 38 5B 8E 8A 0E A6 00 BB 0E C5 80 F3 00 -0x9F40: FF 1E C2 00 6B 06 8B 86 63 B7 0F 05 03 06 23 06 -0x9F50: 4B B7 BB 00 5B B7 FB 37 3B B7 0F 0B 1B 37 FF 2B -0x9F60: D7 E3 03 C2 86 E2 06 76 A5 A3 8F 03 86 2B 57 68 -0x9F70: 28 E9 28 E5 83 24 8F 36 A8 5B 03 FF 0F 02 78 40 -0x9F80: 48 CE F8 C3 F8 C3 0F 07 7B 43 C6 D0 0F 8A C8 50 -0x9F90: FF 85 86 0B 80 1B 00 DB 37 77 80 EB 37 FE 2B 20 -0x9FA0: 2B 80 7B 38 AB B8 77 86 FE 42 20 49 86 8B 06 9B -0x9FB0: 80 7B 8E 5B B7 9B 0E BB 0E 9B 80 FF 0B 80 60 38 -0x9FC0: 10 B8 C0 3B DB 8E 40 B8 F0 38 7B 8E A0 B8 C0 B8 -0x9FD0: FB 00 A0 B8 30 BB EE 42 88 0F 0B 2B 0E 67 0E FF -0x9FE0: 0A AA 0E 28 2A 0E 31 88 FF C7 83 D7 03 42 8F 7A -0x9FF0: 03 05 A4 78 24 A6 25 E4 25 4B 83 E3 03 05 A4 89 -0xA000: 24 B5 24 09 A4 65 24 C9 24 0F 08 85 25 FF CD A5 -0xA010: B5 A8 07 A8 76 28 CC 25 65 A4 A9 24 E5 24 19 A4 -0xA020: 0F 07 95 28 E6 24 19 A4 D7 29 16 A9 58 29 97 29 -0xA030: FF 0F 02 02 11 0F 07 02 11 FF FF 2B 82 AB 38 DE -0xA040: 42 E2 1B B8 EB 3B DB 80 8B B8 1B 82 FB B8 7B 80 -0xA050: FB 3C 5B BC 7B B8 1B 8E CB 0E 1B 8E 0F 0D 2B 3B -0xA060: BB B8 EB 82 4B B8 BB 38 3B B7 BB 02 0F 13 1B 00 -0xA070: CB 80 6B BC FF 7B 80 AE 00 80 8B 8E E8 05 F9 86 -0xA080: 17 86 16 85 4E 2B 80 AB 8E 87 85 C3 05 8B 82 9B -0xA090: 02 AB 02 BB 86 CB 06 D3 03 3B 8E 6B 0E A7 8E FF -0xA0A0: 29 8E 52 11 83 0E 0F 03 9B 0E 2B 8E 5B 0E CB 8E -0xA0B0: FB 0E FB 82 9B 82 BB 02 FE 42 E8 BB 8E 0F 0A AB -0xA0C0: 0E CB 0E F9 0E 88 86 A6 06 DB 02 B6 8E FF AB CE -0xA0D0: DE 42 C0 CB CE 5B 8E 1B CE 4B 85 67 45 0F 07 2B -0xA0E0: 00 7B 85 97 05 0F 0A 92 02 FF 0A AA 0E 24 4A 1E -0xA0F0: 23 AA FF 1B 80 BB 38 4B BC EB 3B 0F 04 2B 00 AB -0xA100: 38 EB 00 CB 8E FB 80 AB B8 6B 80 FB 3C 9B BB 5B -0xA110: BC FB 00 6B B8 FB 38 FF 0B 86 1A 06 DB 06 DE C2 -0xA120: 02 F0 3B BB 80 EB 06 0B 86 93 06 F0 39 0F 06 60 -0xA130: B8 1B 86 A0 B9 B7 27 BD 27 2B 83 A1 26 A9 26 EE -0xA140: 25 0B 27 B4 FF 0F 02 1E 2F 60 E0 3A A5 A7 DB 80 -0xA150: 3B 82 8B 02 FE 42 68 70 BB 25 A7 2C 27 B2 26 B9 -0xA160: 26 9B 80 A8 82 B5 27 BC 27 B0 BB 3B 82 87 34 EE -0xA170: 25 6B FF 1E A5 0A 2E 28 27 2E 33 C7 0F 03 1E 40 -0xA180: 07 2E 30 E7 0F 05 1E 24 44 0F 07 1E 22 6A 2E 23 -0xA190: AB 0F 09 1E 41 68 1E 2A 8A 2E 23 A2 2E 32 EA FF -0xA1A0: 3B 87 66 27 CC 27 EE 31 87 EE 23 A7 3B 87 DB 07 -0xA1B0: FF 0F 01 2E 25 2B 2E 25 4B 4E 25 CB 6B 07 97 47 -0xA1C0: E9 87 47 C7 7A 07 D6 C7 78 07 38 87 AB 47 E3 07 -0xA1D0: 9B 87 0F 09 68 47 DB C7 3B C7 FF 47 9B CB 07 FA -0xA1E0: 1D 86 9B 3A 87 56 07 88 1B 07 9D 2E 65 F0 FF 9B -0xA1F0: 07 05 32 06 33 07 34 CE 03 DC 51 EE 07 73 E0 74 -0xA200: 0A 7E 06 9E 0A CE 06 E4 00 E8 0A FE 0A 2E 89 4E -0xA210: 0B 54 0A 14 8A C4 0A 34 8A 7E 06 C7 0A 01 E0 02 -0xA220: 0A 47 0A 81 60 82 0A C7 0A 0E 87 7E 02 A7 02 B3 -0xA230: 02 D7 02 E3 02 07 82 13 02 3E 06 7E 02 AE 07 FE -0xA240: 0A 0D C4 CD 43 CE 09 DE 0B DD 42 FE 02 5D C7 FD -0xA250: 5B 07 05 32 06 33 07 34 5E 0A 68 64 98 64 A8 64 -0xA260: CE 06 FE 02 0D 01 1E 0E 7E 02 94 63 B4 63 D4 63 -0xA270: F4 63 14 E3 2E 0E 5E 02 64 35 88 72 BE 0E 0D 04 -0xA280: AE 02 CE 08 CD 4B FE 02 0D 05 68 31 7E 0A 96 31 -0xA290: A9 63 A8 33 D5 30 EE 02 E6 62 F4 61 04 B1 08 3F -0xA2A0: 44 33 94 63 A4 31 E4 31 04 BF 08 3F 04 BF 08 3F -0xA2B0: CD 4B 03 E4 0E 03 2E 01 7E 06 BE 02 DE 06 FE 0A -0xA2C0: 0D C4 CD 43 CE 09 DE 0B DD 42 FE 02 5D C7 FD 9B -0xA2D0: 07 05 32 06 33 07 34 FE 00 27 B1 65 32 75 0A 71 -0xA2E0: 00 B7 31 08 E4 18 64 1E 04 57 3B BB 0A 17 8A 27 -0xA2F0: 3A 73 0A 7B 0A D7 0A E7 3A 3B 8A 97 0A FE 08 24 -0xA300: 8A 2E 00 3E 40 38 64 6F 00 9F 00 BE 43 C8 0A C9 -0xA310: 63 CE 07 FE 07 2E 81 66 42 6A 42 79 0A BE 00 C8 -0xA320: 64 F8 64 08 E4 2E 07 7E 03 9E 07 BE 03 DE 07 FE -0xA330: 0A 03 A5 0D 44 CD 43 CE 09 DD 42 DE 0B FE 02 5D -0xA340: C7 FD 9B 07 05 32 06 33 07 34 FE 06 0C 81 39 0A -0xA350: 5C 01 89 0A AC 01 D9 0A FC 01 2E 83 A7 01 B7 00 -0xA360: C7 01 DE 0A FE 02 4E 83 5A 32 63 0A 69 0A 7E 02 -0xA370: EE 03 FA 32 03 8A 09 0A 1E 02 EE 03 FA 32 03 8A -0xA380: 09 0A 14 42 1E 02 7E 0A 9E 07 FE 0A 2E 86 5E 0A -0xA390: 8E 06 BE 0A EE 07 3E 83 5E 07 FE 0A 0D C4 41 52 -0xA3A0: 51 52 CD 43 CE 09 DE 0B DD 42 FE 02 5D C7 FD 5B -0xA3B0: 07 05 32 06 33 07 34 FE 0A AE 86 BE 07 FE 02 0D -0xA3C0: 02 27 32 46 61 55 62 5E 0E 1E 82 68 3C 74 3A 7D -0xA3D0: 4B 5E 8E 7D 4B 7E 82 84 62 94 61 A4 31 BD 4B CE -0xA3E0: 06 FE 02 0D 06 34 31 3E 0A 64 32 75 0A 7B 61 A4 -0xA3F0: 33 AE 02 DE 0E 3E 82 64 32 78 32 B4 36 C8 36 DD -0xA400: 4B 44 B2 58 32 94 63 A4 3E BA 30 C9 61 CE 06 DD -0xA410: 4B CE 86 DD 4B FE 02 2E 86 5E 02 7E 06 FE 02 1E -0xA420: 86 3E 02 5E 06 7E 02 9E 06 FE 0A 0D C4 CD 43 CE -0xA430: 09 DE 0B DD 42 FE 02 5D C7 FD 5B 06 05 32 06 33 -0xA440: 07 34 5E 0A AE 02 0D 01 39 73 0D 03 39 7B 4D 4B -0xA450: DE 06 1E 8A AE 06 C4 33 16 FE A5 77 FE 02 FE 82 -0xA460: 0D 07 39 73 A8 74 ED 4B 49 FB E8 74 FE 0A 2E 82 -0xA470: 67 02 84 7A 87 31 0D 0B FE 02 0D 0C 39 73 5E 06 -0xA480: C6 76 45 FF BE 0A DD 48 FE 06 3D CB 46 7E AD 4A -0xA490: FE 82 39 F3 A9 7B 4E 8A 9E 07 FE 0A 0D C4 CD 43 -0xA4A0: CE 09 DE 0B DD 42 FE 02 5D C7 FD 94 11 0F 26 FE -0xA4B0: 10 28 94 65 15 EB 12 FA 41 4A 96 54 40 A4 42 B7 -0xA4C0: 13 E9 19 F5 15 11 80 47 42 71 13 80 41 15 92 1B -0xA4D0: 1F 24 40 55 12 64 40 95 12 A4 40 D2 12 E1 40 13 -0xA4E0: C0 2C 17 2F 12 49 13 83 40 9F 14 A3 40 17 92 83 -0xA4F0: 13 92 41 B9 14 C5 12 C8 40 D4 40 4B 92 78 1B 9C -0xA500: 94 9F 11 DF 14 FE 11 7D C1 9E 42 CF 20 FD 90 B1 -0xA510: 0F 26 29 91 7E 42 FE 40 28 92 4E 42 2E C0 57 73 -0xA520: C3 25 C7 27 23 84 33 20 5C 01 77 63 88 62 99 61 -0xA530: AA 60 BC 01 EE 42 4E C0 69 11 7E 42 DE 40 F8 62 -0xA540: 0E C2 AE 40 D7 63 E7 63 33 A7 37 27 43 04 CC 01 -0xA550: E7 73 0C 81 3E 42 0D 0A 5E 40 88 72 BE 42 E7 87 -0xA560: FE 40 39 E1 4E 00 69 60 87 60 A5 60 C3 31 FE 31 -0xA570: 6D C1 BE 42 EF 20 FD 52 21 0F 20 6E 40 58 F2 93 -0xA580: 01 97 00 0C 81 97 40 A6 41 C7 40 0D 04 03 01 07 -0xA590: 01 23 01 27 01 EC 03 AC F3 C3 03 78 E2 94 43 47 -0xA5A0: F3 74 43 47 FB 74 43 2C F1 4C 63 47 00 57 21 5C -0xA5B0: 01 7C 72 39 F1 EC 02 4C 81 D8 62 EC 01 0D 0D 0F -0xA5C0: 38 C7 07 ED 4A 1D C1 5F 26 FD 54 21 0F 26 A7 22 -0xA5D0: 37 FB 73 20 83 07 87 02 93 20 C7 73 04 F1 06 31 -0xA5E0: 39 71 59 71 E7 73 37 A0 47 04 86 7C E5 71 E7 31 -0xA5F0: 33 A4 39 71 A9 71 D3 23 08 F2 13 05 27 02 49 71 -0xA600: 75 75 E8 72 67 F3 99 71 E7 20 F4 72 F7 31 17 A0 -0xA610: 33 20 39 71 73 28 BC 05 39 F1 79 71 A6 21 C3 06 -0xA620: D3 20 DC 00 FC 00 07 A2 13 21 5F 32 8C 00 98 7A -0xA630: C7 63 D9 61 03 A2 07 22 74 72 77 31 E7 73 39 F1 -0xA640: 58 72 77 73 D8 72 7F B1 97 73 B6 64 C5 65 D4 66 -0xA650: E3 67 F3 67 8D C1 CF 26 FD 52 31 0F 20 6E 66 07 -0xA660: 81 36 01 66 00 A7 22 08 F2 67 7B DC 02 98 F2 D7 -0xA670: 20 39 F1 9F 33 DC 27 DC 57 23 83 57 63 6C 51 87 -0xA680: 63 99 61 A3 06 B3 21 77 F3 F3 21 F7 2A 13 81 23 -0xA690: 22 53 00 63 22 E9 0B 0C 83 13 21 16 22 33 05 8F -0xA6A0: 35 EC 01 63 A0 67 20 73 01 77 01 83 20 87 20 B3 -0xA6B0: 20 B7 20 C3 01 C7 00 D3 20 D7 20 67 A0 77 07 87 -0xA6C0: 22 E8 62 F5 65 1C 82 7F 38 8D C1 CF 26 FD 50 21 -0xA6D0: 07 81 47 24 57 00 63 01 77 01 C9 71 68 F2 E7 73 -0xA6E0: 97 FB 06 83 5C 01 D7 22 E7 00 03 A7 6C 02 B3 22 -0xA6F0: E3 01 E7 07 47 A0 57 06 A7 01 D3 00 D7 01 07 81 -0xA700: 67 20 93 22 03 A3 1C 61 17 21 6F 33 C7 63 D8 62 -0xA710: E9 61 FA 60 4F B3 87 63 9C 01 B7 63 C8 62 D9 61 -0xA720: EA 60 39 F1 87 21 A7 01 B7 20 39 F1 5F 38 6D C1 -0xA730: AF 26 FD 90 11 0F 26 FE 10 2A 93 87 17 A3 14 B2 -0xA740: 42 0A 92 19 40 36 14 50 41 82 16 2B 93 24 41 BB -0xA750: 14 B8 00 C2 43 C3 13 1B 94 67 12 C4 15 53 C1 D2 -0xA760: 41 12 C1 29 13 85 17 1B 92 1A 42 47 13 83 41 A7 -0xA770: 13 0E 91 A7 63 B7 63 C5 65 D5 65 DD 4A E3 67 F3 -0xA780: 67 8D C1 AE 42 DF 20 FD 90 11 0F 26 6E 10 8B 17 -0xA790: AF 32 D8 62 E8 62 FC 3F AD C8 F8 64 0C BE 43 43 -0xA7A0: F8 64 0C BF 73 40 84 40 93 40 A4 40 B3 40 F8 64 -0xA7B0: 48 E4 5C 39 83 40 92 41 B3 40 F8 64 48 E4 5C 39 -0xA7C0: F8 64 13 C2 37 65 4C 24 63 00 97 65 C3 42 0B 97 -0xA7D0: AC 32 F8 64 0C BE 53 45 9D 48 F8 64 2A E2 3C 47 -0xA7E0: 56 43 BA 62 F8 64 0C B7 88 64 BC 31 D4 45 FC 31 -0xA7F0: 3C B1 78 64 8C 38 0B 9C 1A 33 18 61 28 61 39 60 -0xA800: 5D 4A EE 11 0F B8 1D C1 3E 42 6F 20 FD 52 31 0F -0xA810: 20 6E 40 F7 20 07 84 17 20 4F 34 C3 03 C7 02 D3 -0xA820: 22 27 E3 39 61 E7 73 5C E4 57 00 6C 73 47 A0 53 -0xA830: 06 63 22 A7 73 FC 73 13 A1 33 05 43 21 5C 72 C3 -0xA840: 23 CC 03 77 FB AC 02 39 F1 A7 73 D3 04 E8 72 E3 -0xA850: 22 26 F4 BC 02 8C 81 A8 62 17 87 43 24 A7 01 C3 -0xA860: 04 08 F2 97 21 A3 02 C9 0B E1 69 F1 69 8D C1 CF -0xA870: 26 FD 38 11 0F 26 AD 40 3D C7 FD 95 B1 0F 26 0D -0xA880: 02 C8 72 1C 81 38 72 0D 05 97 34 98 62 A3 20 B3 -0xA890: 06 C3 20 CC 03 F9 91 2C 81 48 62 0D 09 37 63 47 -0xA8A0: 03 57 21 8C 02 C5 79 C7 31 F9 11 39 F1 A9 11 6F -0xA8B0: B4 D3 65 E3 65 7D C1 BF 26 FD 00 C1 4C 00 F4 4F -0xA8C0: 0D 02 02 42 43 4F 52 C2 DE 00 5A C2 4D C7 FD 90 -0xA8D0: 51 0F 26 EE 10 0B 94 33 14 42 42 77 16 86 44 02 -0xA8E0: 92 4A 16 69 42 73 14 B0 00 C7 12 05 C0 1C 17 1F -0xA8F0: 11 36 12 8F 14 91 40 1B 94 35 12 34 42 60 42 61 -0xA900: 12 87 12 96 40 A3 14 1C 98 1F 11 47 12 9F 15 CC -0xA910: 15 CF 11 05 C0 1F 15 39 12 7C 16 7F 11 82 40 98 -0xA920: 12 DF 15 16 C4 17 14 54 12 9B 16 28 94 CE 01 3D -0xA930: C1 5E 42 8F 20 FD 97 11 0F 26 FE 10 2B 92 57 12 -0xA940: 8B 12 C0 41 F7 13 5B 92 69 0B BB 12 B2 46 19 93 -0xA950: 71 00 17 94 7C 14 7F 11 93 41 BF 15 FC 13 FF 11 -0xA960: 2F 95 50 42 51 12 58 14 A6 12 DB 12 1B 93 46 43 -0xA970: 7B 12 8D 49 B7 14 1B 94 49 0B BB 12 FC 13 FF 12 -0xA980: 03 C1 2F 15 43 12 4B 13 77 13 9D 4A 15 C1 A1 41 -0xA990: C3 12 FE 01 7D C1 9E 42 CF 20 FD 52 21 0F 20 6E -0xA9A0: 44 0C F1 4C 01 AA 35 D9 34 EE 20 08 B3 37 32 43 -0xA9B0: 04 4E 21 53 20 7C 01 97 21 B7 07 9C 81 E7 42 5F -0xA9C0: B3 97 63 AC 02 C5 41 49 E0 58 61 76 64 85 65 94 -0xA9D0: 66 A4 22 A6 03 C8 22 DC 02 68 F2 96 42 13 82 17 -0xA9E0: 02 AF 34 F6 21 FC 06 26 80 2A 24 36 01 8C 00 FF -0xA9F0: 35 4E A0 55 21 77 20 87 07 89 22 AE 21 4C 82 9F -0xAA00: 34 EC 01 03 E7 13 67 8D 4A AD 41 0F A6 FD 10 51 -0xAA10: 4C 00 C7 12 C6 42 03 92 02 42 29 12 63 12 62 42 -0xAA20: 69 14 A5 12 A4 42 E2 14 E1 44 F8 16 37 C1 8F 38 -0xAA30: 02 BB 28 7A 68 7A A8 7A E0 6A F0 6A 6D C5 FD 92 -0xAA40: 31 0F 20 6E 40 0D 02 37 73 EC 00 0C 80 3C 00 6C -0xAA50: 00 9C 00 06 C0 C7 73 06 83 28 72 96 40 E7 73 26 -0xAA60: C0 87 7B D2 41 39 F1 C8 F2 97 E3 A3 23 E7 02 E3 -0xAA70: 07 F3 22 37 E3 9C 00 BC 00 EC 00 0C 80 3C 00 86 -0xAA80: 21 A6 06 B6 24 5C 80 7C 00 9C 00 29 E1 DC 05 F6 -0xAA90: 41 DC 80 E8 72 0C 81 27 73 4C 01 66 74 0D 11 3F -0xAAA0: 35 B6 41 2C 82 36 40 7C 02 86 40 F9 61 39 E1 AC -0xAAB0: 04 C6 41 0C 83 16 41 88 F2 39 F1 7C 00 89 61 9C -0xAAC0: 00 A7 63 BC 00 C5 65 DC 00 E3 67 F3 67 8D C1 CF -0xAAD0: 26 FD 55 B1 0F 26 CF 33 07 B2 15 11 52 42 99 0B -0xAAE0: AC 02 D3 24 D6 42 D7 25 23 84 CF 33 07 E3 19 61 -0xAAF0: 78 7A EF 33 2C 81 46 64 55 65 65 65 EC 74 47 82 -0xAB00: 53 05 63 21 62 41 96 22 9A 41 CC 03 B9 91 39 F1 -0xAB10: 63 26 67 27 D3 06 FC 01 18 E2 D9 07 E9 04 0C 86 -0xAB20: 37 22 93 24 87 84 AC 02 C2 41 C3 23 D9 71 FC 01 -0xAB30: 7F B1 9C 00 A7 63 B6 64 CC 00 D4 66 E3 67 F3 67 -0xAB40: 8D C1 CF 26 FD 50 B1 0F 26 FC 00 1F B3 5C 00 65 -0xAB50: 65 74 66 83 67 93 67 DC 73 4C 80 B3 20 C9 0B C3 -0xAB60: 08 D3 2F DC 00 2C 80 4C 00 8C 00 D3 2E ED 4A FC -0xAB70: 00 D7 A1 EC 01 4C 80 59 11 D8 11 DA 10 37 A0 47 -0xAB80: 04 99 11 E7 21 3A 90 67 20 76 10 77 60 87 07 D8 -0xAB90: 12 39 F1 AC 00 E9 71 0C 80 2C 00 4C 05 C7 7B 39 -0xABA0: F1 EC 00 F9 11 0C 82 6F 34 F8 11 FA 10 7F B2 AC -0xABB0: 00 B6 64 CC 01 E3 67 F3 67 8D C1 CF 26 FD 52 B1 -0xABC0: 0F 20 6E 45 39 91 B3 04 C3 21 C8 11 CA 10 49 91 -0xABD0: 7C 73 E8 12 88 91 8A 10 E7 21 05 91 07 30 17 07 -0xABE0: 27 20 49 11 9C 01 C8 72 23 A6 27 26 D3 03 D8 7A -0xABF0: 89 91 D8 72 39 F1 A9 11 09 F1 63 24 67 24 D8 62 -0xAC00: 28 91 2A 10 56 21 70 04 79 0B 8C 00 94 21 9F 35 -0xAC10: 2F B8 3D C1 7F 26 FD 06 C1 4C 00 F4 4F 0D 02 06 -0xAC20: 20 24 4F 35 A0 36 20 53 46 D5 20 D6 20 34 A1 73 -0xAC30: 49 74 20 94 20 B4 20 D4 20 F4 20 2E 80 59 42 4D -0xAC40: C7 FD 96 31 0F 26 0D 03 1A 60 77 42 C4 00 C8 62 -0xAC50: B9 E1 D3 06 D7 07 F9 61 0C 81 4E B1 8E B1 BC 01 -0xAC60: E4 50 E9 61 0C 81 0D 0A 84 43 98 72 0D 0C 0F 38 -0xAC70: 1D C1 5F 26 FD 48 0F 0E 01 5E 02 A7 00 BC 73 1A -0xAC80: E0 39 61 58 62 77 63 97 63 B8 62 D6 07 F8 62 19 -0xAC90: E1 75 52 86 40 87 50 95 52 93 43 A5 21 C5 52 D6 -0xACA0: 40 D7 20 E5 06 E6 51 3E 8D 5E 03 67 52 77 52 7E -0xACB0: 02 9E 03 A6 43 A7 23 DE 05 FE 02 1E 83 33 54 46 -0xACC0: 40 47 21 56 04 5E 02 83 54 93 52 96 07 97 50 BE -0xACD0: 03 C7 23 FE 02 0C 82 43 45 45 24 46 24 90 08 95 -0xACE0: 51 78 FA D7 73 39 F1 8C 01 A8 52 B8 52 CC 01 5F -0xACF0: B3 97 63 9E 00 0E 81 16 24 66 04 8E 00 FE 01 08 -0xAD00: D2 0E 06 6F 47 9E 0F 0E 82 2D 47 28 7A 68 7A A8 -0xAD10: 7A AE 01 DE 0F 6D C5 FD 48 0F 0E 01 5E 02 BC 01 -0xAD20: FC 01 2C 82 41 52 4E 04 67 25 68 24 69 24 BA 42 -0xAD30: C7 04 DE 0B B2 87 FE 02 2C E1 2C 71 67 01 77 00 -0xAD40: 87 01 8E 00 EE 01 F6 02 03 85 05 02 13 21 16 02 -0xAD50: 27 02 2E 02 88 72 C7 20 D7 07 E4 76 07 A0 17 06 -0xAD60: 48 7A 76 20 98 72 79 E1 88 62 9C 01 B7 73 DC 01 -0xAD70: F8 62 FE 01 08 E2 0E 00 6E 02 73 20 77 23 83 04 -0xAD80: 93 20 AE 00 FE 0A 0E 82 39 71 A8 72 E7 73 0C 81 -0xAD90: 8F 32 AE 00 FE 04 04 D1 17 04 26 49 27 29 DF 33 -0xADA0: FE 02 44 F6 7C 01 8E 06 BF 47 EE 0F 4D C7 0E 82 -0xADB0: 68 7A AE 01 DE 0F 6D C5 FD 48 01 0E 01 00 5A 3E -0xADC0: 06 45 46 47 46 53 44 AE 01 DF 4A 4D C7 0E 81 00 -0xADD0: 5A 2E 04 37 28 3A 48 46 47 C7 07 CE 0F DF 4A 4D -0xADE0: C7 0E 81 00 5A 33 53 43 51 46 40 47 50 53 04 55 -0xADF0: 40 56 50 62 43 64 40 65 50 71 41 73 51 83 51 94 -0xAE00: 40 95 50 A3 50 A5 40 A6 50 B3 51 B6 40 B7 50 C3 -0xAE10: 53 DF 4A 4D C7 0E 81 00 5A 2E 02 36 47 37 52 3A -0xAE20: 49 47 25 A7 52 D7 04 DF 4A 4D C7 0E 81 00 5A 3E -0xAE30: 02 44 51 53 44 54 44 55 24 A1 54 AE 01 B4 21 DF -0xAE40: 4A E5 07 4D C7 FD 41 01 B4 34 C8 52 F2 51 47 D3 -0xAE50: 6C 03 65 49 9E 07 BE 01 CC 03 FE 07 0D C9 1E 01 -0xAE60: 6C 01 62 35 63 53 8A 41 AC 01 B3 53 E9 51 26 C3 -0xAE70: 27 33 63 43 64 33 BA 60 C9 61 CE 0B E5 09 EE 0F -0xAE80: 7D CA 7D 47 FD 41 01 B8 52 EA 41 27 B2 B3 42 16 -0xAE90: D4 4A 42 A5 51 A7 31 27 D3 08 E2 16 64 2C 04 38 -0xAEA0: 42 76 64 88 62 DE 07 FE 01 0D C9 23 32 31 51 98 -0xAEB0: 52 0D C9 59 42 63 53 67 31 14 C2 36 31 87 53 17 -0xAEC0: E3 29 61 30 62 3C 08 42 37 59 40 6A 42 99 40 C9 -0xAED0: 61 D7 63 39 D1 58 52 C3 67 D3 31 DC 06 F7 42 FA -0xAEE0: 42 23 B1 43 67 C3 34 C7 34 D1 51 43 B3 47 33 9A -0xAEF0: 30 A9 61 B8 62 BE 0B D5 09 DE 0F 0D CA 7D 47 FD -0xAF00: 49 0F 1E 01 39 73 5E 07 AE 0B 1E 82 6E 88 9E 02 -0xAF10: 0D 04 2E 0B 45 09 4E 0F ED 47 FD FF AD 72 07 20 -0xAF20: 04 8E E4 8F 67 85 71 90 EA AE AE 53 07 BD FC 06 -0xAF30: 8D FC 06 20 4A B0 AD 72 07 C9 03 B0 01 60 20 24 -0xAF40: B6 A2 00 86 08 20 47 C0 20 C3 84 E8 E0 06 D0 F3 -0xAF50: 20 80 F1 20 2A F1 20 E9 EE 20 D4 BE A2 01 86 08 -0xAF60: 20 70 BE CA 86 08 20 70 BE 20 96 BB 20 BC B9 20 -0xAF70: B8 B7 20 55 B8 20 4F B7 20 E1 89 A5 B5 C9 02 10 -0xAF80: 11 AD 9F 07 F0 1E C9 04 D0 08 AD 7F 07 D0 03 20 -0xAF90: ED 90 AC 9F 07 A5 09 C0 08 B0 02 4A 4A 4A 20 88 -0xAFA0: B2 4C 67 AF 20 9A B2 A5 0A 85 0D A9 00 85 0C AD -0xAFB0: 73 07 C9 06 F0 1C AD 1F 07 D0 14 AD 3D 07 C9 20 -0xAFC0: 30 10 AD 3D 07 E9 20 8D 3D 07 A9 00 8D 40 03 20 -0xAFD0: B0 92 60 AD FF 06 18 6D A1 03 8D FF 06 AD 23 07 -0xAFE0: D0 59 AD 55 07 C9 50 90 52 AD 85 07 D0 4D AC FF -0xAFF0: 06 88 30 47 C8 C0 02 90 01 88 AD 55 07 C9 70 90 -0xB000: 03 AC FF 06 98 8D 75 07 18 6D 3D 07 8D 3D 07 98 -0xB010: 18 6D 1C 07 8D 1C 07 8D 3F 07 AD 1A 07 69 00 8D -0xB020: 1A 07 29 01 85 00 AD 78 07 29 FE 05 00 8D 78 07 -0xB030: 20 38 B0 A9 08 8D 95 07 4C 00 B0 A9 00 8D 75 07 -0xB040: A2 00 20 F6 F1 85 00 A0 00 0A B0 07 C8 A5 00 29 -0xB050: 20 F0 1B B9 1C 07 38 F9 34 B0 85 86 B9 1A 07 E9 -0xB060: 00 85 6D A5 0C D9 36 B0 F0 04 A9 00 85 57 A9 00 -0xB070: 8D A1 03 60 00 10 01 02 AD 1C 07 18 69 FF 8D 1D -0xB080: 07 AD 1A 07 69 00 8D 1B 07 60 A5 0E 20 04 8E 31 -0xB090: 91 C7 B1 06 B2 E5 B1 A4 B2 CA B2 CD 91 69 B0 E9 -0xB0A0: B0 33 B2 45 B2 69 B2 7D B2 AD 52 07 C9 02 F0 2B -0xB0B0: A9 00 A4 CE C0 30 90 6E AD 10 07 C9 06 F0 04 C9 -0xB0C0: 07 D0 50 AD C4 03 D0 05 A9 01 4C E6 B0 20 1F B2 -0xB0D0: CE DE 06 D0 50 EE 69 07 4C 15 B3 AD 58 07 D0 0C -0xB0E0: A9 FF 20 00 B2 A5 CE C9 91 90 28 60 AD 99 03 C9 -0xB0F0: 60 D0 32 A5 CE C9 99 A0 00 A9 01 90 0A A9 03 85 -0xB100: 1D C8 A9 08 8D B4 05 8C 16 07 20 E6 B0 A5 86 C9 -0xB110: 48 90 12 A9 08 85 0E A9 01 85 33 4A 8D 52 07 8D -0xB120: 16 07 8D 58 07 60 8D FC 06 A5 0E C9 0B F0 3C AD -0xB130: 4E 07 D0 10 A4 B5 88 D0 06 A5 CE C9 D0 90 05 A9 -0xB140: 00 8D FC 06 AD FC 06 29 C0 85 0A AD FC 06 29 03 -0xB150: 85 0C AD FC 06 29 0C 85 0B 29 04 F0 0E A5 1D D0 -0xB160: 0A A4 0C F0 06 A9 00 85 0C 85 0B 20 29 B3 A0 01 -0xB170: AD 54 07 D0 09 A0 00 AD 14 07 F0 02 A0 02 8C 99 -0xB180: 04 A9 01 A4 57 F0 05 10 01 0A 85 45 20 93 AF 20 -0xB190: 80 F1 20 2A F1 A2 00 20 9C E2 20 64 DC A5 CE C9 -0xB1A0: 40 90 16 A5 0E C9 05 F0 10 C9 07 F0 0C C9 04 90 -0xB1B0: 08 AD C4 03 29 DF 8D C4 03 A5 B5 C9 02 30 3B A2 -0xB1C0: 01 8E 23 07 A0 04 84 07 A2 00 AC 59 07 D0 05 AC -0xB1D0: 43 07 D0 16 E8 A4 0E C0 0B F0 0F AC 12 07 D0 06 -0xB1E0: C8 84 FC 8C 12 07 A0 06 84 07 C5 07 30 0C CA 30 -0xB1F0: 0A AC B1 07 D0 04 A9 06 85 0E 60 A9 00 8D 58 07 -0xB200: 20 DD B1 EE 52 07 60 A5 B5 D0 06 A5 CE C9 E4 90 -0xB210: 0C A9 08 8D 58 07 A0 03 84 1D 4C E6 B0 A9 02 8D -0xB220: 52 07 4C 13 B2 A9 01 20 00 B2 20 93 AF A0 00 AD <- this AD == LDA to $06D6, this is where VerticalPipeEntry checks WarpZoneControl -0xB230: D6 06 D0 17 C8 AD 4E 07 C9 03 D0 0F C8 4C 0B B2 -0xB240: 18 65 CE 85 CE 60 20 1F B2 A0 02 CE DE 06 D0 0E -0xB250: 8C 52 07 EE 74 07 A9 00 8D 72 07 8D 22 07 60 A9 -0xB260: 08 85 57 A0 01 A5 86 29 0F D0 03 85 57 A8 98 20 -0xB270: E6 B0 60 AD 47 07 C9 F8 D0 03 4C 55 B2 C9 C4 D0 -0xB280: 03 20 73 B2 60 AD 47 07 C9 F0 B0 07 C9 C8 F0 23 -0xB290: 4C E9 B0 D0 13 AC 0B 07 D0 0E 8C 0D 07 EE 0B 07 -0xB2A0: AD 54 07 49 01 8D 54 07 60 AD 47 07 C9 F0 B0 33 -0xB2B0: 4C E9 B0 A9 00 8D 47 07 A9 08 85 0E 60 AD 47 07 -0xB2C0: C9 C0 F0 13 A5 09 4A 4A 29 03 85 00 AD C4 03 29 -0xB2D0: FC 05 00 8D C4 03 60 20 73 B2 AD C4 03 29 FC 8D -0xB2E0: C4 03 60 60 A5 1B C9 30 D0 15 AD 13 07 85 FF A9 -0xB2F0: 00 8D 13 07 A4 CE C0 9E B0 02 A9 04 4C E6 B0 E6 -0xB300: 0E 60 15 23 16 1B 17 18 23 63 A9 01 20 E6 B0 A5 -0xB310: CE C9 AE 90 0E AD 23 07 F0 09 A9 20 85 FC A9 00 -0xB320: 8D 23 07 AD 90 04 4A B0 0D AD 46 07 D0 03 EE 46 -0xB330: 07 A9 20 8D C4 03 AD 46 07 C9 05 D0 2B EE 5C 07 -0xB340: AD 5C 07 C9 03 D0 0E AC 5F 07 AD 48 07 D9 C2 B2 -0xB350: 90 03 EE 5D 07 EE 60 07 20 03 9C EE 57 07 20 13 -0xB360: B2 8D 5B 07 A9 80 85 FC 60 A9 00 AC 54 07 D0 08 -0xB370: A5 1D D0 07 A5 0B 29 04 8D 14 07 20 50 B4 AD 0B -0xB380: 07 D0 16 A5 1D C9 03 F0 05 A0 18 8C 89 07 20 04 -0xB390: 8E 5A B3 76 B3 6D B3 CF B3 60 20 8F B5 A5 0C F0 -0xB3A0: 02 85 33 20 CC B5 20 09 BF 8D FF 06 60 AD 0A 07 -0xB3B0: 8D 09 07 4C AC B3 A4 9F 10 13 A5 0A 29 80 25 0D -0xB3C0: D0 11 AD 08 07 38 E5 CE CD 06 07 90 06 AD 0A 07 -0xB3D0: 8D 09 07 AD 04 07 F0 14 20 8F B5 A5 CE C9 14 B0 -0xB3E0: 05 A9 18 8D 09 07 A5 0C F0 02 85 33 A5 0C F0 03 -0xB3F0: 20 CC B5 20 09 BF 8D FF 06 A5 0E C9 0B D0 05 A9 -0xB400: 28 8D 09 07 4C 4D BF 0E 04 FC F2 00 00 FF FF AD -0xB410: 16 04 18 6D 33 04 8D 16 04 A0 00 A5 9F 10 01 88 -0xB420: 84 00 65 CE 85 CE A5 B5 65 00 85 B5 A5 0C 2D 90 -0xB430: 04 F0 2D AC 89 07 D0 27 A0 18 8C 89 07 A2 00 A4 -0xB440: 33 4A B0 02 E8 E8 88 F0 01 E8 A5 86 18 7D C7 B3 -0xB450: 85 86 A5 6D 7D CB B3 85 6D A5 0C 49 03 85 33 60 -0xB460: 8D 89 07 60 20 20 1E 28 28 0D 04 70 70 60 90 90 -0xB470: 0A 09 FC FC FC FB FB FE FF 00 00 00 00 00 80 00 -0xB480: D8 E8 F0 28 18 10 0C E4 98 D0 00 FF 01 00 20 FF -0xB490: A5 1D C9 03 D0 23 A0 00 A5 0B 2D 90 04 F0 06 C8 -0xB4A0: 29 08 D0 01 C8 BE 4D B4 8E 33 04 A9 08 BE 4A B4 -0xB4B0: 86 9F 30 01 4A 8D 0C 07 60 AD 0E 07 D0 0A A5 0A -0xB4C0: 29 80 F0 04 25 0D F0 03 4C 1C B5 A5 1D F0 11 AD -0xB4D0: 04 07 F0 F4 AD 82 07 D0 07 A5 9F 10 03 4C 1C B5 -0xB4E0: A9 20 8D 82 07 A0 00 8C 16 04 8C 33 04 A5 B5 8D -0xB4F0: 07 07 A5 CE 8D 08 07 A9 01 85 1D AD 00 07 C9 09 -0xB500: 90 10 C8 C9 10 90 0B C8 C9 19 90 06 C8 C9 1C 90 -0xB510: 01 C8 A9 01 8D 06 07 AD 04 07 F0 08 A0 05 AD 7D -0xB520: 04 F0 01 C8 B9 24 B4 8D 09 07 B9 2B B4 8D 0A 07 -0xB530: B9 39 B4 8D 33 04 B9 32 B4 85 9F AD 04 07 F0 11 -0xB540: A9 04 85 FF A5 CE C9 14 B0 12 A9 00 85 9F 4C 1C -0xB550: B5 A9 01 AC 54 07 F0 02 A9 80 85 FF A0 00 84 00 -0xB560: A5 1D F0 09 AD 00 07 C9 19 B0 33 90 18 C8 AD 4E -0xB570: 07 F0 12 88 A5 0C C5 45 D0 0B A5 0A 29 40 D0 19 -0xB580: AD 83 07 D0 19 C8 E6 00 AD 03 07 D0 07 AD 00 07 -0xB590: C9 21 90 0A E6 00 4C 5E B5 A9 0A 8D 83 07 B9 40 -0xB5A0: B4 8D 50 04 A5 0E C9 07 D0 02 A0 03 B9 43 B4 8D -0xB5B0: 56 04 A4 00 B9 47 B4 8D 02 07 A9 00 8D 01 07 A5 -0xB5C0: 33 C5 45 F0 06 0E 02 07 2E 01 07 60 02 04 07 A0 -0xB5D0: 00 AD 00 07 C9 1C B0 15 C8 C9 0E B0 01 C8 AD FC -0xB5E0: 06 29 7F F0 20 29 03 C5 45 D0 08 A9 00 8D 03 07 -0xB5F0: 4C C5 B5 AD 00 07 C9 0B B0 0B A5 33 85 45 A9 00 -0xB600: 85 57 8D 05 07 B9 8C B5 8D 0C 07 60 2D 90 04 C9 -0xB610: 00 D0 08 A5 57 F0 49 10 23 30 03 4A 90 1E AD 05 -0xB620: 07 18 6D 02 07 8D 05 07 A5 57 6D 01 07 85 57 CD -0xB630: 56 04 30 23 AD 56 04 85 57 4C 20 B6 AD 05 07 38 -0xB640: ED 02 07 8D 05 07 A5 57 ED 01 07 85 57 CD 50 04 -0xB650: 10 05 AD 50 04 85 57 C9 00 10 05 49 FF 18 69 01 -0xB660: 8D 00 07 60 AD 56 07 C9 02 90 43 A5 0A 29 40 F0 -0xB670: 33 25 0D D0 2F AD CE 06 29 01 AA B5 24 D0 25 A4 -0xB680: B5 88 D0 20 AD 14 07 D0 1B A5 1D C9 03 F0 15 A9 -0xB690: 20 85 FF A9 02 95 24 AC 0C 07 8C 11 07 88 8C 81 -0xB6A0: 07 EE CE 06 A2 00 20 89 B6 A2 01 20 89 B6 AD 4E -0xB6B0: 07 D0 13 A2 02 86 08 20 F9 B6 20 31 F1 20 91 F1 -0xB6C0: 20 E1 ED CA 10 EF 60 40 C0 86 08 B5 24 0A B0 63 -0xB6D0: B4 24 F0 5E 88 F0 27 A5 86 69 04 95 8D A5 6D 69 -0xB6E0: 00 95 74 A5 CE 95 D5 A9 01 95 BC A4 33 88 B9 87 -0xB6F0: B6 95 5E A9 04 95 A6 A9 07 9D A0 04 D6 24 8A 18 -0xB700: 69 07 AA A9 50 85 00 A9 03 85 02 A9 00 20 D7 BF -0xB710: 20 0F BF A6 08 20 3B F1 20 87 F1 20 2D E2 20 C8 -0xB720: E1 AD D2 03 29 CC D0 06 20 D9 D6 4C DE EC A9 00 -0xB730: 95 24 60 20 3B F1 4C 09 ED BD A8 07 29 01 85 07 -0xB740: B5 E4 C9 F8 D0 2C AD 92 07 D0 3F A0 00 A5 33 4A -0xB750: 90 02 A0 08 98 65 86 95 9C A5 6D 69 00 95 83 A5 -0xB760: CE 18 69 08 95 E4 A9 01 95 CB A4 07 B9 4D B7 8D -0xB770: 92 07 A4 07 BD 2C 04 38 F9 4B B7 9D 2C 04 B5 E4 -0xB780: E9 00 C9 20 B0 02 A9 F8 95 E4 60 FF 50 40 20 AD -0xB790: 70 07 F0 4F A5 0E C9 08 90 49 C9 0B F0 45 A5 B5 -0xB7A0: C9 02 B0 3F AD 87 07 D0 3A AD F8 07 0D F9 07 0D -0xB7B0: FA 07 F0 26 AC F8 07 88 D0 0C AD F9 07 0D FA 07 -0xB7C0: D0 04 A9 40 85 FC A9 18 8D 87 07 A0 23 A9 FF 8D -0xB7D0: 39 01 20 5F 8F A9 A4 4C 06 8F 8D 56 07 20 31 D9 -0xB7E0: EE 59 07 60 AD 23 07 F0 FA A5 CE 25 B5 D0 F4 8D -0xB7F0: 23 07 EE D6 06 4C 98 C9 AD 4E 07 D0 37 8D 7D 04 -0xB800: AD 47 07 D0 2F A0 04 B9 71 04 18 79 77 04 85 02 -0xB810: B9 6B 04 F0 1C 69 00 85 01 A5 86 38 F9 71 04 A5 -0xB820: 6D F9 6B 04 30 0B A5 02 38 E5 86 A5 01 E5 6D 10 -0xB830: 04 88 10 D3 60 B9 77 04 4A 85 00 B9 71 04 18 65 -0xB840: 00 85 01 B9 6B 04 69 00 85 00 A5 09 4A 90 2C A5 -0xB850: 01 38 E5 86 A5 00 E5 6D 10 0E A5 86 38 E9 01 85 -0xB860: 86 A5 6D E9 00 4C 39 B8 AD 90 04 4A 90 0D A5 86 -0xB870: 18 69 01 85 86 A5 6D 69 00 85 6D A9 10 85 00 A9 -0xB880: 01 8D 7D 04 85 02 4A AA 4C D7 BF 05 02 08 04 01 -0xB890: 03 03 04 04 04 A2 05 86 08 B5 16 C9 30 D0 56 A5 -0xB8A0: 0E C9 04 D0 31 A5 1D C9 03 D0 2B B5 CF C9 AA B0 -0xB8B0: 28 A5 CE C9 A2 B0 22 BD 17 04 69 FF 9D 17 04 B5 -0xB8C0: CF 69 01 95 CF AD 0E 01 38 E9 FF 8D 0E 01 AD 0D -0xB8D0: 01 E9 01 8D 0D 01 4C AC B8 AC 0F 01 B9 4B B8 BE -0xB8E0: 50 B8 9D 34 01 20 27 BC A9 05 85 0E 20 AF F1 20 -0xB8F0: 52 F1 20 4B E5 60 08 10 08 00 20 AF F1 AD 47 07 -0xB900: D0 40 AD 0E 07 F0 3B A8 88 98 29 02 D0 07 E6 CE -0xB910: E6 CE 4C D9 B8 C6 CE C6 CE B5 58 18 79 B6 B8 95 -0xB920: CF C0 01 90 0F A5 0A 29 80 F0 09 25 0D D0 05 A9 -0xB930: F4 8D DB 06 C0 03 D0 0A AD DB 06 85 9F A9 00 8D -0xB940: 0E 07 20 52 F1 20 7D E8 20 7A D6 AD 0E 07 F0 0D -0xB950: AD 86 07 D0 08 A9 04 8D 86 07 EE 0E 07 60 A9 2F -0xB960: 95 16 A9 01 95 0F B9 76 00 95 6E B9 8F 00 95 87 -0xB970: B9 D7 00 95 CF AC 98 03 D0 03 8D 9D 03 8A 99 9A -0xB980: 03 EE 98 03 A9 04 85 FE 60 30 60 E0 05 D0 68 AC -0xB990: 98 03 88 AD 99 03 D9 49 B9 F0 0F A5 09 4A 4A 90 -0xB9A0: 09 A5 D4 E9 01 85 D4 EE 99 03 AD 99 03 C9 08 90 -0xB9B0: 46 20 52 F1 20 AF F1 A0 00 20 35 E4 C8 CC 98 03 -0xB9C0: D0 F7 AD D1 03 29 0C F0 10 88 BE 9A 03 20 98 C9 -0xB9D0: 88 10 F7 8D 98 03 8D 99 03 AD 99 03 C9 20 90 17 -0xB9E0: A2 06 A9 01 A0 1B 20 F0 E3 A4 02 C0 D0 B0 08 B1 -0xB9F0: 06 D0 04 A9 26 91 06 A6 08 60 0F 07 AD 4E 07 F0 -0xBA00: 6F A2 02 86 08 B5 0F D0 51 BD A8 07 AC CC 06 39 -0xBA10: BA B9 C9 06 B0 44 A8 B9 6B 04 F0 3E B9 7D 04 F0 -0xBA20: 08 E9 00 99 7D 04 4C 1A BA AD 47 07 D0 2C A9 0E -0xBA30: 99 7D 04 B9 6B 04 95 6E B9 71 04 95 87 B9 77 04 -0xBA40: 38 E9 08 95 CF A9 01 95 B6 95 0F 4A 95 1E A9 09 -0xBA50: 9D 9A 04 A9 33 95 16 4C 2D BA B5 16 C9 33 D0 0D -0xBA60: 20 7A D6 B5 0F F0 06 20 AF F1 20 33 BA CA 10 93 -0xBA70: 60 18 E8 AD 47 07 D0 3E B5 1E D0 2E AD D1 03 29 -0xBA80: 0C C9 0C F0 40 A0 01 20 43 E1 30 01 C8 94 46 88 -0xBA90: B9 31 BA 95 58 A5 00 69 28 C9 50 90 28 A9 01 95 -0xBAA0: 1E A9 0A 9D 8A 07 A9 08 85 FE B5 1E 29 20 F0 03 -0xBAB0: 20 63 BF 20 02 BF 20 AF F1 20 52 F1 20 43 E2 20 -0xBAC0: 53 D8 4C 7D E8 20 98 C9 60 04 04 04 05 05 05 06 -0xBAD0: 06 06 10 F0 AD A8 07 29 07 D0 05 AD A8 07 29 08 -0xBAE0: A8 B9 2A 00 D0 19 BE 89 BA B5 0F D0 12 A6 08 8A -0xBAF0: 99 AE 06 A9 90 99 2A 00 A9 07 99 A2 04 38 60 A6 -0xBB00: 08 18 60 AD 47 07 D0 63 B5 2A 29 7F BC AE 06 C9 -0xBB10: 02 F0 20 B0 34 8A 18 69 0D AA A9 10 85 00 A9 0F -0xBB20: 85 01 A9 04 85 02 A9 00 20 D7 BF 20 0F BF A6 08 -0xBB30: 4C 28 BB A9 FE 95 AC B9 1E 00 29 F7 99 1E 00 B6 -0xBB40: 46 CA BD 92 BA A6 08 95 64 D6 2A B9 87 00 18 69 -0xBB50: 02 95 93 B9 6E 00 69 00 95 7A B9 CF 00 38 E9 0A -0xBB60: 95 DB A9 01 95 C2 D0 03 20 C4 D7 20 9B F1 20 48 -0xBB70: F1 20 36 E2 20 DC E4 60 20 84 BB B5 76 99 7A 00 -0xBB80: B5 8F 09 05 99 93 00 B5 D7 E9 10 99 DB 00 4C 6C -0xBB90: BB 20 84 BB BD EA 03 99 7A 00 A5 06 0A 0A 0A 0A -0xBBA0: 09 05 99 93 00 A5 02 69 20 99 DB 00 A9 FB 99 AC -0xBBB0: 00 A9 01 99 C2 00 99 2A 00 85 FE 86 08 20 FE BB -0xBBC0: EE 48 07 60 A0 08 B9 2A 00 F0 07 88 C0 05 D0 F6 -0xBBD0: A0 08 8C B7 06 60 A2 08 86 08 B5 2A F0 56 0A 90 -0xBBE0: 06 20 C3 BA 4C F4 BB B4 2A 88 F0 1D F6 2A B5 93 -0xBBF0: 18 6D 75 07 95 93 B5 7A 69 00 95 7A B5 2A C9 30 -0xBC00: D0 26 A9 00 95 2A 4C F4 BB 8A 18 69 0D AA A9 50 -0xBC10: 85 00 A9 06 85 02 4A 85 01 A9 00 20 D7 BF A6 08 -0xBC20: B5 AC C9 05 D0 02 F6 2A 20 48 F1 20 9B F1 20 36 -0xBC30: E2 20 86 E6 CA 10 A1 60 17 1D 0B 11 02 13 A9 01 -0xBC40: 8D 39 01 AE 53 07 BC F8 BB 20 5F 8F EE 5E 07 AD -0xBC50: 5E 07 C9 64 D0 0C A9 00 8D 5E 07 EE 5A 07 A9 40 -0xBC60: 85 FE A9 02 8D 38 01 AE 53 07 BC FA BB 20 5F 8F -0xBC70: AC 53 07 B9 FC BB 20 06 8F AC 00 03 B9 FB 02 D0 -0xBC80: 05 A9 24 99 FB 02 A6 08 60 A9 2E 85 1B B5 76 85 -0xBC90: 73 B5 8F 85 8C A9 01 85 BB B5 D7 38 E9 08 85 D4 -0xBCA0: A9 01 85 23 85 14 A9 03 8D 9F 04 A5 39 C9 02 B0 -0xBCB0: 0A AD 56 07 C9 02 90 01 4A 85 39 A9 20 8D CA 03 -0xBCC0: A9 02 85 FE 60 A2 05 86 08 A5 23 F0 5D 0A 90 23 -0xBCD0: AD 47 07 D0 43 A5 39 F0 11 C9 03 F0 0D C9 02 D0 -0xBCE0: 37 20 F9 CA 20 63 E1 4C D8 BC 20 77 CA 20 C1 DF -0xBCF0: 4C D8 BC A5 09 29 03 D0 19 C6 D4 A5 23 E6 23 C9 -0xBD00: 11 90 0F A9 10 95 58 A9 80 85 23 0A 8D CA 03 2A -0xBD10: 95 46 A5 23 C9 06 90 12 20 52 F1 20 AF F1 20 43 -0xBD20: E2 20 D2 E6 20 53 D8 20 7A D6 60 04 12 48 A9 11 -0xBD30: AE EE 03 AC 54 07 D0 02 A9 12 95 26 20 6B 8A AE -0xBD40: EE 03 A5 02 9D E4 03 A8 A5 06 9D E6 03 B1 06 20 -0xBD50: F6 BD 85 00 AC 54 07 D0 01 98 90 25 A0 11 94 26 -0xBD60: A9 C4 A4 00 C0 58 F0 04 C0 5D D0 15 AD BC 06 D0 -0xBD70: 08 A9 0B 8D 9D 07 EE BC 06 AD 9D 07 D0 02 A0 C4 -0xBD80: 98 9D E8 03 20 84 BD A4 02 A9 23 91 06 A9 10 8D -0xBD90: 84 07 68 85 05 A0 00 AD 14 07 D0 05 AD 54 07 F0 -0xBDA0: 01 C8 A5 CE 18 79 EB BC 29 F0 95 D7 B4 26 C0 11 -0xBDB0: F0 06 20 02 BE 4C 7B BD 20 9B BD AD EE 03 49 01 -0xBDC0: 8D EE 03 60 A5 86 18 69 08 29 F0 95 8F A5 6D 69 -0xBDD0: 00 95 76 9D EA 03 A5 B5 95 BE 60 20 1F BE A9 02 -0xBDE0: 85 FF A9 00 95 60 9D 3C 04 85 9F A9 FE 95 A8 A5 -0xBDF0: 05 20 F6 BD 90 31 98 C9 09 90 02 E9 05 20 04 8E -0xBE00: D2 BD 38 BB 38 BB D8 BD D2 BD DF BD D5 BD 38 BB -0xBE10: D8 BD A9 00 2C A9 02 2C A9 03 85 39 4C 49 BC A2 -0xBE20: 05 AC EE 03 20 1E B9 60 C1 C0 5F 60 55 56 57 58 -0xBE30: 59 5A 5B 5C 5D 5E A0 0D D9 E8 BD F0 04 88 10 F8 -0xBE40: 18 60 20 1F BE A9 01 9D EC 03 85 FD 20 41 BE A9 -0xBE50: FE 85 9F A9 05 8D 39 01 20 27 BC AE EE 03 60 AE -0xBE60: EE 03 A4 02 F0 1A 98 38 E9 10 85 02 A8 B1 06 C9 -0xBE70: C2 D0 0D A9 00 91 06 20 4D 8A AE EE 03 20 51 BB -0xBE80: 60 B5 8F 9D F1 03 A9 F0 95 60 95 62 A9 FA 95 A8 -0xBE90: A9 FC 95 AA A9 00 9D 3C 04 9D 3E 04 B5 76 95 78 -0xBEA0: B5 8F 95 91 B5 D7 18 69 08 95 D9 A9 FA 95 A8 60 -0xBEB0: B5 26 F0 5D 29 0F 48 A8 8A 18 69 09 AA 88 F0 33 -0xBEC0: 20 A4 BF 20 0F BF 8A 18 69 02 AA 20 A4 BF 20 0F -0xBED0: BF A6 08 20 59 F1 20 B6 F1 20 53 EC 68 B4 BE F0 -0xBEE0: 30 48 A9 F0 D5 D9 B0 02 95 D9 B5 D7 C9 F0 68 90 -0xBEF0: 20 B0 1C 20 A4 BF A6 08 20 59 F1 20 B6 F1 20 D1 -0xBF00: EB B5 D7 29 0F C9 05 68 B0 07 A9 01 9D EC 03 A9 -0xBF10: 00 95 26 60 A2 01 86 08 AD 01 03 D0 21 BD EC 03 -0xBF20: F0 1C BD E6 03 85 06 A9 05 85 07 BD E4 03 85 02 -0xBF30: A8 BD E8 03 91 06 20 61 8A A9 00 9D EC 03 CA 10 -0xBF40: D5 60 E8 20 0F BF A6 08 60 AD 0E 07 D0 3E AA B5 -0xBF50: 57 0A 0A 0A 0A 85 01 B5 57 4A 4A 4A 4A C9 08 90 -0xBF60: 02 09 F0 85 00 A0 00 C9 00 10 01 88 84 02 BD 00 -0xBF70: 04 18 65 01 9D 00 04 A9 00 2A 48 6A B5 86 65 00 -0xBF80: 95 86 B5 6D 65 02 95 6D 68 18 65 00 60 A2 00 AD -0xBF90: 47 07 D0 05 AD 0E 07 D0 F3 AD 09 07 85 00 A9 04 -0xBFA0: 4C AD BF A0 3D B5 1E C9 05 D0 02 A0 20 4C 94 BF -0xBFB0: A0 00 4C 77 BF A0 01 E8 A9 03 85 00 A9 06 85 01 -0xBFC0: A9 02 85 02 98 4C D1 BF A0 7F D0 02 A0 0F A9 02 -0xBFD0: D0 04 A0 1C A9 03 84 00 E8 20 AD BF A6 08 60 06 -0xBFE0: 08 A0 00 2C A0 01 A9 50 85 00 B9 9F BF 85 02 A9 -0xBFF0: 00 4C D7 BF A9 00 2C A9 01 48 B4 16 E8 A9 05 C0 -0xC000: 29 D0 02 A9 09 85 00 A9 0A 85 01 A9 03 85 02 68 -0xC010: A8 20 D7 BF A6 08 60 48 BD 16 04 18 7D 33 04 9D -0xC020: 16 04 A0 00 B5 9F 10 01 88 84 07 75 CE 95 CE B5 -0xC030: B5 65 07 95 B5 BD 33 04 18 65 00 9D 33 04 B5 9F -0xC040: 69 00 95 9F C5 02 30 10 BD 33 04 C9 80 90 09 A5 -0xC050: 02 95 9F A9 00 9D 33 04 68 F0 2B A5 02 49 FF A8 -0xC060: C8 84 07 BD 33 04 38 E5 01 9D 33 04 B5 9F E9 00 -0xC070: 95 9F C5 07 10 10 BD 33 04 C9 80 B0 09 A5 07 95 -0xC080: 9F A9 FF 9D 33 04 60 B5 0F 48 0A B0 12 68 F0 03 -0xC090: 4C 82 C8 AD 1F 07 29 07 C9 07 F0 0E 4C CC C0 68 -0xC0A0: 29 0F A8 B9 0F 00 D0 02 95 0F 60 03 03 06 06 06 -0xC0B0: 06 06 06 07 07 07 05 09 04 05 06 08 09 0A 06 0B -0xC0C0: 10 40 B0 B0 80 40 40 80 40 F0 F0 F0 A5 6D 38 E9 -0xC0D0: 04 85 6D AD 25 07 38 E9 04 8D 25 07 AD 1A 07 38 -0xC0E0: E9 04 8D 1A 07 AD 1B 07 38 E9 04 8D 1B 07 AD 2A -0xC0F0: 07 38 E9 04 8D 2A 07 A9 00 8D 3B 07 8D 2B 07 8D -0xC100: 39 07 8D 3A 07 B9 F8 9B 8D 2C 07 60 AD 45 07 F0 -0xC110: 5E AD 26 07 D0 59 A0 0B 88 30 54 AD 5F 07 D9 6B -0xC120: C0 D0 F5 AD 25 07 D9 76 C0 D0 ED A5 CE D9 81 C0 -0xC130: D0 23 A5 1D C9 00 D0 1D AD 5F 07 C9 06 D0 23 EE -0xC140: D9 06 EE DA 06 AD DA 06 C9 03 D0 1E AD D9 06 C9 -0xC150: 03 F0 0F D0 07 AD 5F 07 C9 06 F0 E6 20 8C C0 20 -0xC160: 71 D0 A9 00 8D DA 06 8D D9 06 A9 00 8D 45 07 AD -0xC170: CD 06 F0 10 95 16 A9 01 95 0F A9 00 95 1E 8D CD -0xC180: 06 4C 26 C2 AC 39 07 B1 E9 C9 FF D0 03 4C 16 C2 -0xC190: 29 0F C9 0E F0 0E E0 05 90 0A C8 B1 E9 29 3F C9 -0xC1A0: 2E F0 01 60 AD 1D 07 18 69 30 29 F0 85 07 AD 1B -0xC1B0: 07 69 00 85 06 AC 39 07 C8 B1 E9 0A 90 0B AD 3B -0xC1C0: 07 D0 06 EE 3B 07 EE 3A 07 88 B1 E9 29 0F C9 0F -0xC1D0: D0 19 AD 3B 07 D0 14 C8 B1 E9 29 3F 8D 3A 07 EE -0xC1E0: 39 07 EE 39 07 EE 3B 07 4C CC C0 AD 3A 07 95 6E -0xC1F0: B1 E9 29 F0 95 87 CD 1D 07 B5 6E ED 1B 07 B0 0B -0xC200: B1 E9 29 0F C9 0E F0 69 4C 50 C2 A5 07 D5 87 A5 -0xC210: 06 F5 6E 90 41 A9 01 95 B6 B1 E9 0A 0A 0A 0A 95 -0xC220: CF C9 E0 F0 4C C8 B1 E9 29 40 F0 05 AD CC 06 F0 -0xC230: 6D B1 E9 29 3F C9 37 90 04 C9 3F 90 31 C9 06 D0 -0xC240: 07 AC 6A 07 F0 02 A9 02 95 16 A9 01 95 0F 20 26 -0xC250: C2 B5 0F D0 49 60 AD CB 06 D0 09 AD 98 03 C9 01 -0xC260: D0 0B A9 2F 95 16 A9 00 95 1E 20 6C C2 60 4C 1B -0xC270: C7 C8 C8 B1 E9 4A 4A 4A 4A 4A CD 5F 07 D0 0E 88 -0xC280: B1 E9 8D 50 07 C8 B1 E9 29 1F 8D 51 07 4C 5B C2 -0xC290: AC 39 07 B1 E9 29 0F C9 0E D0 03 EE 39 07 EE 39 -0xC2A0: 07 EE 39 07 A9 00 8D 3B 07 A6 08 60 B5 16 C9 15 -0xC2B0: B0 0D A8 B5 CF 69 08 95 CF A9 01 9D D8 03 98 20 -0xC2C0: 04 8E 0E C3 0E C3 0E C3 1E C3 F0 C2 28 C3 F1 C2 -0xC2D0: 42 C3 6B C3 F0 C2 75 C3 75 C3 F7 C2 87 C7 D1 C7 -0xC2E0: 4A C3 3D C3 85 C3 A0 C7 F0 C2 A0 C7 A0 C7 A0 C7 -0xC2F0: A0 C7 B8 C7 F0 C2 F0 C2 5C C4 5C C4 5C C4 5C C4 -0xC300: 59 C4 F0 C2 F0 C2 F0 C2 F0 C2 DF C7 12 C8 3F C8 -0xC310: 45 C8 0B C8 03 C8 0B C8 4B C8 57 C8 49 C5 60 BC -0xC320: 1E B9 F0 C2 F0 C2 F0 C2 F0 C2 F0 C2 07 C3 81 C8 -0xC330: 60 20 0E C3 4C 46 C3 A9 02 95 B6 95 CF 4A 9D 96 -0xC340: 07 4A 95 1E 4C 46 C3 A9 B8 95 CF 60 F8 F4 A0 01 -0xC350: AD 6A 07 D0 01 88 B9 0C C3 95 58 4C 5A C3 20 0E -0xC360: C3 A9 01 95 1E 60 80 50 A9 00 9D A2 03 95 58 AC -0xC370: CC 06 B9 26 C3 9D 96 07 A9 0B 4C 5C C3 A9 00 4C -0xC380: 19 C3 A9 00 95 58 A9 09 D0 12 A0 30 B5 CF 9D 01 -0xC390: 04 10 02 A0 E0 98 75 CF 95 58 A9 03 9D 9A 04 A9 -0xC3A0: 02 95 46 A9 00 95 A0 9D 34 04 60 A9 02 95 46 A9 -0xC3B0: 09 9D 9A 04 60 20 46 C3 BD A7 07 29 10 95 58 B5 -0xC3C0: CF 9D 34 04 60 AD CB 06 D0 0B A9 00 8D D1 06 20 -0xC3D0: 3D C3 4C D9 C7 4C 98 C9 26 2C 32 38 20 22 24 26 -0xC3E0: 13 14 15 16 AD 8F 07 D0 3C E0 05 B0 38 A9 80 8D -0xC3F0: 8F 07 A0 04 B9 16 00 C9 11 F0 2B 88 10 F6 EE D1 -0xC400: 06 AD D1 06 C9 07 90 1D A2 04 B5 0F F0 05 CA 10 -0xC410: F9 30 10 A9 00 95 1E A9 11 95 16 20 8A C3 A9 20 -0xC420: 20 D8 C5 A6 08 60 A5 CE C9 2C 90 F9 B9 1E 00 D0 -0xC430: F4 B9 6E 00 95 6E B9 87 00 95 87 A9 01 95 B6 B9 -0xC440: CF 00 38 E9 08 95 CF BD A7 07 29 03 A8 A2 02 B9 -0xC450: 98 C3 95 01 C8 C8 C8 C8 CA 10 F4 A6 08 20 6C CF -0xC460: A4 57 C0 08 B0 0E A8 BD A8 07 29 03 F0 05 98 49 -0xC470: FF A8 C8 98 20 46 C3 A0 02 95 58 C9 00 30 01 88 -0xC480: 94 46 A9 FD 95 A0 A9 01 95 0F A9 05 95 1E 60 28 -0xC490: 38 28 38 28 00 00 10 10 00 20 75 C5 A9 00 95 58 -0xC4A0: B5 16 38 E9 1B A8 B9 4F C4 9D 88 03 B9 54 C4 95 -0xC4B0: 34 B5 CF 18 69 04 95 CF B5 87 18 69 04 95 87 B5 -0xC4C0: 6E 69 00 95 6E 4C D9 C7 80 30 40 80 30 50 50 70 -0xC4D0: 20 40 80 A0 70 40 90 68 0E 05 06 0E 1C 20 10 0C -0xC4E0: 1E 22 18 14 10 60 20 48 AD 8F 07 D0 A1 20 46 C3 -0xC4F0: BD A8 07 29 03 A8 B9 A4 C4 8D 8F 07 A0 03 AD CC -0xC500: 06 F0 01 C8 84 00 E4 00 B0 84 BD A7 07 29 03 85 -0xC510: 00 85 01 A9 FB 95 A0 A9 00 A4 57 F0 07 A9 04 C0 -0xC520: 19 90 01 0A 48 18 65 00 85 00 BD A8 07 29 03 F0 -0xC530: 07 BD A9 07 29 0F 85 00 68 18 65 01 A8 B9 98 C4 -0xC540: 95 58 A9 01 95 46 A5 57 D0 12 A4 00 98 29 02 F0 -0xC550: 0B B5 58 49 FF 18 69 01 95 58 F6 46 98 29 02 F0 -0xC560: 0F A5 86 18 79 88 C4 95 87 A5 6D 69 00 4C 3C C5 -0xC570: A5 86 38 F9 88 C4 95 87 A5 6D E9 00 95 6E A9 01 -0xC580: 95 0F 95 B6 A9 F8 95 CF 60 20 75 C5 8E 68 03 A9 -0xC590: 00 8D 63 03 8D 69 03 B5 87 8D 66 03 A9 DF 8D 90 -0xC5A0: 07 95 46 A9 20 8D 64 03 9D 8A 07 A9 05 8D 83 04 -0xC5B0: 4A 8D 65 03 60 A0 FF C8 B9 0F 00 D0 FA 8C CF 06 -0xC5C0: 8A 09 80 99 0F 00 B5 6E 99 6E 00 B5 87 99 87 00 -0xC5D0: A9 01 95 0F 99 B6 00 B5 CF 99 CF 00 60 90 80 70 -0xC5E0: 90 FF 01 AD 8F 07 D0 F4 9D 34 04 A5 FD 09 02 85 -0xC5F0: FD AC 68 03 B9 16 00 C9 2D F0 31 20 D9 D1 18 69 -0xC600: 20 AC CC 06 F0 03 38 E9 10 8D 8F 07 BD A7 07 29 -0xC610: 03 9D 17 04 A8 B9 9D C5 95 CF AD 1D 07 18 69 20 -0xC620: 95 87 AD 1B 07 69 00 95 6E 4C 1F C6 B9 87 00 38 -0xC630: E9 0E 95 87 B9 6E 00 95 6E B9 CF 00 18 69 08 95 -0xC640: CF BD A7 07 29 03 9D 17 04 A8 B9 9D C5 A0 00 D5 -0xC650: CF 90 01 C8 B9 A1 C5 9D 34 04 A9 00 8D CB 06 A9 -0xC660: 08 9D 9A 04 A9 01 95 B6 95 0F 4A 9D 01 04 95 1E -0xC670: 60 00 30 60 60 00 20 60 40 70 40 60 30 AD 8F 07 -0xC680: D0 47 A9 20 8D 8F 07 CE D7 06 A0 06 88 B9 16 00 -0xC690: C9 31 D0 F8 B9 87 00 38 E9 30 48 B9 6E 00 E9 00 -0xC6A0: 85 00 AD D7 06 18 79 1E 00 A8 68 18 79 31 C6 95 -0xC6B0: 87 A5 00 69 00 95 6E B9 37 C6 95 CF A9 01 95 B6 -0xC6C0: 95 0F 4A 95 58 A9 08 95 A0 60 01 02 04 08 10 20 -0xC6D0: 40 80 40 30 90 50 20 60 A0 70 0A 0B AD 8F 07 D0 -0xC6E0: 6F AD 4E 07 D0 57 E0 03 B0 66 A0 00 BD A7 07 C9 -0xC6F0: AA 90 01 C8 AD 5F 07 C9 01 F0 01 C8 98 29 01 A8 -0xC700: B9 9A C6 95 16 AD DD 06 C9 FF D0 05 A9 00 8D DD -0xC710: 06 BD A7 07 29 07 A8 B9 8A C6 2C DD 06 F0 07 C8 -0xC720: 98 29 07 4C D6 C6 0D DD 06 8D DD 06 B9 92 C6 20 -0xC730: D8 C5 9D 17 04 A9 20 8D 8F 07 4C 6C C2 A0 FF C8 -0xC740: C0 05 B0 0D B9 0F 00 F0 F6 B9 16 00 C9 08 D0 EF -0xC750: 60 A5 FE 09 08 85 FE A9 08 D0 A8 A0 00 38 E9 37 -0xC760: 48 C9 04 B0 0B 48 A0 06 AD 6A 07 F0 02 A0 02 68 -0xC770: 84 01 A0 B0 29 02 F0 02 A0 70 84 00 AD 1B 07 85 -0xC780: 02 AD 1D 07 85 03 A0 02 68 4A 90 01 C8 8C D3 06 -0xC790: A2 FF E8 E0 05 B0 2D B5 0F D0 F7 A5 01 95 16 A5 -0xC7A0: 02 95 6E A5 03 95 87 18 69 18 85 03 A5 02 69 00 -0xC7B0: 85 02 A5 00 95 CF A9 01 95 B6 95 0F 20 6C C2 CE -0xC7C0: D3 06 D0 CC 4C 5E C2 A9 01 95 58 4A 95 1E 95 A0 -0xC7D0: B5 CF 9D 34 04 38 E9 18 9D 17 04 A9 09 4C DB C7 -0xC7E0: B5 16 8D CB 06 38 E9 12 20 04 8E A4 C3 B7 C7 A8 -0xC7F0: C4 A3 C5 3D C6 9C C6 60 A0 05 B9 16 00 C9 11 D0 -0xC800: 05 A9 01 99 1E 00 88 10 F1 A9 00 8D CB 06 95 0F -0xC810: 60 A9 02 95 46 A9 F8 95 58 A9 03 9D 9A 04 60 D6 -0xC820: CF D6 CF AC CC 06 D0 05 A0 02 20 71 C8 A0 FF AD -0xC830: A0 03 95 1E 10 02 8A A8 8C A0 03 A9 00 95 46 A8 -0xC840: 20 71 C8 A9 FF 9D A2 03 4C 28 C8 A9 00 95 58 4C -0xC850: 28 C8 A0 40 B5 CF 10 07 49 FF 18 69 01 A0 C0 9D -0xC860: 01 04 98 18 75 CF 95 58 20 63 C3 A9 05 AC 4E 07 -0xC870: C0 03 F0 07 AC CC 06 D0 02 A9 06 9D 9A 04 60 20 -0xC880: 4B C8 4C 48 C8 20 57 C8 4C 2B C8 A9 10 9D 34 04 -0xC890: A9 FF 95 A0 4C 60 C8 A9 F0 9D 34 04 A9 00 95 A0 -0xC8A0: A0 01 20 71 C8 A9 04 9D 9A 04 60 08 0C F8 00 00 -0xC8B0: FF B5 87 18 79 6B C8 95 87 B5 6E 79 6E C8 95 6E -0xC8C0: 60 60 A6 08 A9 00 B4 16 C0 15 90 03 98 E9 14 20 -0xC8D0: 04 8E E0 C8 35 C9 95 D2 D6 C8 D6 C8 D6 C8 D6 C8 -0xC8E0: 47 C9 47 C9 47 C9 47 C9 47 C9 47 C9 47 C9 47 C9 -0xC8F0: D6 C8 65 C9 65 C9 65 C9 65 C9 65 C9 65 C9 65 C9 -0xC900: 4D C9 4D C9 65 D0 85 BC 4B B9 D6 C8 D9 D2 BA B8 -0xC910: D6 C8 A4 B7 D7 C8 60 20 AF F1 20 52 F1 4C 7D E8 -0xC920: A9 00 9D C5 03 20 AF F1 20 52 F1 20 7D E8 20 43 -0xC930: E2 20 C1 DF 20 33 DA 20 53 D8 AC 47 07 D0 03 20 -0xC940: 05 C9 4C 7A D6 B5 16 20 04 8E 77 CA 77 CA 77 CA -0xC950: 77 CA 77 CA D8 C9 77 CA 89 CB 36 CC 34 C9 4A CC -0xC960: 4A CC B0 C9 B0 D3 F9 CA FF CA 25 CB 28 CF 77 CA -0xC970: 34 C9 DF CE 60 20 EB D1 20 AF F1 20 52 F1 20 43 -0xC980: E2 20 53 D8 4C 7A D6 20 3C CD 4C 7A D6 20 AF F1 -0xC990: 20 52 F1 20 4C E2 20 7B DB 20 52 F1 20 66 ED 20 -0xC9A0: 55 D6 4C 7A D6 20 AF F1 20 52 F1 20 73 E2 20 45 -0xC9B0: DB AD 47 07 D0 03 20 82 C9 20 52 F1 20 C8 E5 4C -0xC9C0: 7A D6 B5 16 38 E9 24 20 04 8E 32 D4 D3 D5 4F D6 -0xC9D0: 4F D6 07 D6 31 D6 3D D6 A9 00 95 0F 95 16 95 1E -0xC9E0: 9D 10 01 9D 96 07 9D 25 01 9D C5 03 9D 8A 07 60 -0xC9F0: BD 96 07 D0 16 20 F7 C2 BD A8 07 09 80 9D 34 04 -0xCA00: 29 0F 09 06 9D 96 07 A9 F9 95 A0 4C 92 BF 30 1C -0xCA10: 00 E8 00 18 08 F8 0C F4 B5 1E 29 20 F0 03 4C E5 -0xCA20: CA B5 3C F0 2D D6 3C AD D1 03 29 0C D0 6A BD A2 -0xCA30: 03 D0 17 AC CC 06 B9 CE C9 9D A2 03 20 94 BA 90 -0xCA40: 09 B5 1E 09 08 95 1E 4C 58 CA DE A2 03 4C 58 CA -0xCA50: 20 37 B5 1E 29 07 C9 01 F0 3E A9 00 85 00 A0 FA -0xCA60: B5 CF 30 13 A0 FD C9 70 E6 00 90 0B C6 00 BD A8 -0xCA70: 07 29 01 D0 02 A0 FA 94 A0 B5 1E 09 01 95 1E A5 -0xCA80: 00 3D A9 07 A8 AD CC 06 D0 01 A8 B9 10 CA 9D 8A -0xCA90: 07 BD A8 07 09 C0 95 3C A0 FC A5 09 29 40 D0 02 -0xCAA0: A0 04 94 58 A0 01 20 43 E1 30 0A C8 BD 96 07 D0 -0xCAB0: 04 A9 F8 95 58 94 46 A0 00 B5 1E 29 40 D0 19 B5 -0xCAC0: 1E 0A B0 30 B5 1E 29 20 D0 5B B5 1E 29 07 F0 24 -0xCAD0: C9 05 F0 04 C9 03 B0 30 20 63 BF A0 00 B5 1E C9 -0xCAE0: 02 F0 0C 29 40 F0 0D B5 16 C9 2E F0 07 D0 03 4C -0xCAF0: 02 BF A0 01 B5 58 48 10 02 C8 C8 18 79 D0 C9 95 -0xCB00: 58 20 02 BF 68 95 58 60 BD 96 07 D0 1E 95 1E A5 -0xCB10: 09 29 01 A8 C8 94 46 88 AD 6A 07 F0 02 C8 C8 B9 -0xCB20: D4 C9 95 58 60 20 63 BF 4C 02 BF C9 0E D0 09 B5 -0xCB30: 16 C9 06 D0 03 20 98 C9 60 20 92 BF 4C 02 BF B5 -0xCB40: A0 1D 34 04 D0 13 9D 17 04 B5 CF DD 01 04 B0 09 -0xCB50: A5 09 29 07 D0 02 F6 CF 60 B5 CF D5 58 90 03 4C -0xCB60: 75 BF 4C 70 BF 20 45 CB 20 66 CB A0 01 A5 09 29 -0xCB70: 03 D0 11 A5 09 29 40 D0 02 A0 FF 84 00 B5 CF 18 -0xCB80: 65 00 95 CF 60 A9 13 85 01 A5 09 29 03 D0 0D B4 -0xCB90: 58 B5 A0 4A B0 0A C4 01 F0 03 F6 58 60 F6 A0 60 -0xCBA0: 98 F0 FA D6 58 60 B5 58 48 A0 01 B5 A0 29 02 D0 -0xCBB0: 0B B5 58 49 FF 18 69 01 95 58 A0 02 94 46 20 02 -0xCBC0: BF 85 00 68 95 58 60 3F 03 B5 1E 29 20 D0 4D AC -0xCBD0: CC 06 BD A8 07 39 87 CB D0 12 8A 4A 90 04 A4 45 -0xCBE0: B0 08 A0 02 20 43 E1 10 01 88 94 46 20 DF CB B5 -0xCBF0: CF 38 FD 34 04 C9 20 90 02 95 CF B4 46 88 D0 0E -0xCC00: B5 87 18 75 58 95 87 B5 6E 69 00 95 6E 60 B5 87 -0xCC10: 38 F5 58 95 87 B5 6E E9 00 95 6E 60 4C 8C BF B5 -0xCC20: A0 29 02 D0 37 A5 09 29 07 48 B5 A0 4A B0 15 68 -0xCC30: D0 11 BD 34 04 18 69 01 9D 34 04 95 58 C9 02 D0 -0xCC40: 02 F6 A0 60 68 D0 14 BD 34 04 38 E9 01 9D 34 04 -0xCC50: 95 58 D0 07 F6 A0 A9 02 9D 96 07 60 BD 96 07 F0 -0xCC60: 08 A5 09 4A B0 02 F6 CF 60 B5 CF 69 10 C5 CE 90 -0xCC70: F0 A9 00 95 A0 60 B5 1E 29 20 F0 03 4C 92 BF A9 -0xCC80: E8 95 58 4C 02 BF 40 80 04 04 B5 1E 29 20 F0 03 -0xCC90: 4C 8C BF 85 03 B5 16 38 E9 0A A8 B9 46 CC 85 02 -0xCCA0: BD 01 04 38 E5 02 9D 01 04 B5 87 E9 00 95 87 B5 -0xCCB0: 6E E9 00 95 6E A9 20 85 02 E0 02 90 49 B5 58 C9 -0xCCC0: 10 90 16 BD 17 04 18 65 02 9D 17 04 B5 CF 65 03 -0xCCD0: 95 CF B5 B6 69 00 4C AC CC BD 17 04 38 E5 02 9D -0xCCE0: 17 04 B5 CF E5 03 95 CF B5 B6 E9 00 95 B6 A0 00 -0xCCF0: B5 CF 38 FD 34 04 10 07 A0 10 49 FF 18 69 01 C9 -0xCD00: 0F 90 03 98 95 58 60 00 01 03 04 05 06 07 07 08 -0xCD10: 00 03 06 09 0B 0D 0E 0F 10 00 04 09 0D 10 13 16 -0xCD20: 17 18 00 06 0C 12 16 1A 1D 1F 20 00 07 0F 16 1C -0xCD30: 21 25 27 28 00 09 12 1B 21 27 2C 2F 30 00 0B 15 -0xCD40: 1F 27 2E 33 37 38 00 0C 18 24 2D 35 3B 3E 40 00 -0xCD50: 0E 1B 28 32 3B 42 46 48 00 0F 1F 2D 38 42 4A 4E -0xCD60: 50 00 11 22 31 3E 49 51 56 58 01 03 02 00 00 09 -0xCD70: 12 1B 24 2D 36 3F 48 51 5A 63 0C 18 20 AF F1 AD -0xCD80: D1 03 29 08 D0 74 AD 47 07 D0 0A BD 88 03 20 10 -0xCD90: D4 29 1F 95 A0 B5 A0 B4 16 C0 1F 90 0D C9 08 F0 -0xCDA0: 04 C9 18 D0 05 18 69 01 95 A0 85 EF 20 52 F1 20 -0xCDB0: 8E CE BC E5 06 AD B9 03 99 00 02 85 07 AD AE 03 -0xCDC0: 99 03 02 85 06 A9 01 85 00 20 08 CE A0 05 B5 16 -0xCDD0: C9 1F 90 02 A0 0B 84 ED A9 00 85 00 A5 EF 20 8E -0xCDE0: CE 20 BB CD A5 00 C9 04 D0 08 AC CF 06 B9 E5 06 -0xCDF0: 85 06 E6 00 A5 00 C5 ED 90 E2 60 A5 03 85 05 A4 -0xCE00: 06 A5 01 46 05 B0 04 49 FF 69 01 18 6D AE 03 99 -0xCE10: 03 02 85 06 CD AE 03 B0 09 AD AE 03 38 E5 06 4C -0xCE20: E6 CD 38 ED AE 03 C9 59 90 04 A9 F8 D0 15 AD B9 -0xCE30: 03 C9 F8 F0 0E A5 02 46 05 B0 04 49 FF 69 01 18 -0xCE40: 6D B9 03 99 00 02 85 07 20 ED EC 98 48 AD 9F 07 -0xCE50: 0D 47 07 D0 70 85 05 A4 B5 88 D0 69 A4 CE AD 54 -0xCE60: 07 D0 05 AD 14 07 F0 09 E6 05 E6 05 98 18 69 18 -0xCE70: A8 98 38 E5 07 10 05 49 FF 18 69 01 C9 08 B0 1C -0xCE80: A5 06 C9 F0 B0 16 AD 07 02 18 69 04 85 04 38 E5 -0xCE90: 06 10 05 49 FF 18 69 01 C9 08 90 13 A5 05 C9 02 -0xCEA0: F0 23 A4 05 A5 CE 18 79 3A CD E6 05 4C 32 CE A2 -0xCEB0: 01 A5 04 C5 06 B0 01 E8 86 46 A2 00 A5 00 48 20 -0xCEC0: 2C D9 68 85 00 68 18 69 04 85 06 A6 08 60 48 29 -0xCED0: 0F C9 09 90 05 49 0F 18 69 01 85 01 A4 00 B9 2E -0xCEE0: CD 18 65 01 A8 B9 C7 CC 85 01 68 48 18 69 08 29 -0xCEF0: 0F C9 09 90 05 49 0F 18 69 01 85 02 A4 00 B9 2E -0xCF00: CD 18 65 02 A8 B9 C7 CC 85 02 68 4A 4A 4A A8 B9 -0xCF10: 2A CD 85 03 60 F8 A0 70 BD 00 20 20 20 00 00 B5 -0xCF20: 1E 29 20 F0 08 A9 00 9D C5 03 4C 92 BF 20 02 BF -0xCF30: A0 0D A9 05 20 96 BF BD 34 04 4A 4A 4A 4A A8 B5 -0xCF40: CF 38 F9 D5 CE 10 05 49 FF 18 69 01 C9 08 B0 0E -0xCF50: BD 34 04 18 69 10 9D 34 04 4A 4A 4A 4A A8 B9 DA -0xCF60: CE 9D C5 03 60 15 30 40 B5 1E 29 20 F0 03 4C 63 -0xCF70: BF B5 1E F0 0B A9 00 95 A0 8D CB 06 A9 10 D0 13 -0xCF80: A9 12 8D CB 06 A0 02 B9 25 CF 99 01 00 88 10 F7 -0xCF90: 20 6C CF 95 58 A0 01 B5 A0 29 01 D0 0A B5 58 49 -0xCFA0: FF 18 69 01 95 58 C8 94 46 4C 02 BF A0 00 20 43 -0xCFB0: E1 10 0A C8 A5 00 49 FF 18 69 01 85 00 A5 00 C9 -0xCFC0: 3C 90 1C A9 3C 85 00 B5 16 C9 11 D0 12 98 D5 A0 -0xCFD0: F0 0D B5 A0 F0 06 D6 58 B5 58 D0 40 98 95 A0 A5 -0xCFE0: 00 29 3C 4A 4A 85 00 A0 00 A5 57 F0 24 AD 75 07 -0xCFF0: F0 1F C8 A5 57 C9 19 90 08 AD 75 07 C9 02 90 01 -0xD000: C8 B5 16 C9 12 D0 04 A5 57 D0 06 B5 A0 D0 02 A0 -0xD010: 00 B9 01 00 A4 00 38 E9 01 88 10 FA 60 1A 58 98 -0xD020: 96 94 92 90 8E 8C 8A 88 86 84 82 80 AE 68 03 B5 -0xD030: 16 C9 2D D0 10 86 08 B5 1E F0 1A 29 40 F0 06 B5 -0xD040: CF C9 E0 90 0A A9 80 85 FC EE 72 07 4C 71 D0 20 -0xD050: 8C BF 4C 7B D1 CE 64 03 D0 44 A9 04 8D 64 03 AD -0xD060: 63 03 49 01 8D 63 03 A9 22 85 05 AC 69 03 B9 DD -0xD070: CF 85 04 AC 00 03 C8 A2 0C 20 CD 8A A6 08 20 8F -0xD080: 8A A9 08 85 FE A9 01 85 FD EE 69 03 AD 69 03 C9 -0xD090: 0F D0 0B 20 63 C3 A9 40 95 1E A9 80 85 FE 4C 7B -0xD0A0: D1 21 41 11 31 B5 1E 29 20 F0 14 B5 CF C9 E0 90 -0xD0B0: 9E A2 04 20 98 C9 CA 10 FA 8D CB 06 A6 08 60 A9 -0xD0C0: 00 8D CB 06 AD 47 07 F0 03 4C 39 D1 AD 63 03 10 -0xD0D0: 03 4C 0F D1 CE 64 03 D0 0D A9 20 8D 64 03 AD 63 -0xD0E0: 03 49 01 8D 63 03 A5 09 29 0F D0 04 A9 02 95 46 -0xD0F0: BD 8A 07 F0 1C 20 43 E1 10 17 A9 01 95 46 A9 02 -0xD100: 8D 65 03 A9 20 9D 8A 07 8D 90 07 B5 87 C9 C8 B0 -0xD110: 3E A5 09 29 03 D0 38 B5 87 CD 66 03 D0 0C BD A7 -0xD120: 07 29 03 A8 B9 61 D0 8D DC 06 B5 87 18 6D 65 03 -0xD130: 95 87 B4 46 C0 01 F0 17 A0 FF 38 ED 66 03 10 07 -0xD140: 49 FF 18 69 01 A0 01 CD DC 06 90 03 8C 65 03 BD -0xD150: 8A 07 D0 28 20 8C BF AD 5F 07 C9 05 90 09 A5 09 -0xD160: 29 03 D0 03 20 94 BA B5 CF C9 80 90 1C BD A7 07 -0xD170: 29 03 A8 B9 61 D0 9D 8A 07 4C 49 D1 C9 01 D0 09 -0xD180: D6 CF 20 63 C3 A9 FE 95 A0 AD 5F 07 C9 07 F0 04 -0xD190: C9 05 B0 27 AD 90 07 D0 22 A9 20 8D 90 07 AD 63 -0xD1A0: 03 49 80 8D 63 03 30 E1 20 D9 D1 AC CC 06 F0 03 -0xD1B0: 38 E9 10 8D 90 07 A9 15 8D CB 06 20 BC D1 A0 10 -0xD1C0: B5 46 4A 90 02 A0 F0 98 18 75 87 AC CF 06 99 87 -0xD1D0: 00 B5 CF 18 69 08 99 CF 00 B5 1E 99 1E 00 B5 46 -0xD1E0: 99 46 00 A5 08 48 AE CF 06 86 08 A9 2D 95 16 20 -0xD1F0: BC D1 68 85 08 AA A9 00 8D 6A 03 60 EE 6A 03 20 -0xD200: D7 C8 B5 1E D0 F5 A9 0A 9D 9A 04 20 43 E2 4C 53 -0xD210: D8 BF 40 BF BF BF 40 40 BF AC 67 03 EE 67 03 AD -0xD220: 67 03 29 07 8D 67 03 B9 D1 D1 60 AD 47 07 D0 30 -0xD230: A9 40 AC CC 06 F0 02 A9 60 85 00 BD 01 04 38 E5 -0xD240: 00 9D 01 04 B5 87 E9 01 95 87 B5 6E E9 00 95 6E -0xD250: BC 17 04 B5 CF D9 9D C5 F0 06 18 7D 34 04 95 CF -0xD260: 20 52 F1 B5 1E D0 C3 A9 51 85 00 A0 02 A5 09 29 -0xD270: 02 F0 02 A0 82 84 01 BC E5 06 A2 00 AD B9 03 99 -0xD280: 00 02 A5 00 99 01 02 E6 00 A5 01 99 02 02 AD AE -0xD290: 03 99 03 02 18 69 08 8D AE 03 C8 C8 C8 C8 E8 E0 -0xD2A0: 03 90 D9 A6 08 20 AF F1 BC E5 06 AD D1 03 4A 48 -0xD2B0: 90 05 A9 F8 99 0C 02 68 4A 48 90 05 A9 F8 99 08 -0xD2C0: 02 68 4A 48 90 05 A9 F8 99 04 02 68 4A 90 05 A9 -0xD2D0: F8 99 00 02 60 D6 A0 D0 0C A9 08 95 A0 F6 58 B5 -0xD2E0: 58 C9 03 B0 18 20 52 F1 AD B9 03 8D BA 03 AD AE -0xD2F0: 03 8D AF 03 BC E5 06 B5 58 20 17 ED 60 A9 00 95 -0xD300: 0F A9 08 85 FE A9 05 8D 38 01 4C 36 D3 00 00 08 -0xD310: 08 00 08 00 08 54 55 56 57 A9 00 8D CB 06 AD 46 -0xD320: 07 C9 05 B0 2C 20 04 8E 11 D3 F2 D2 12 D3 4E D3 -0xD330: A2 D3 A0 05 AD FA 07 C9 01 F0 0E A0 03 C9 03 F0 -0xD340: 08 A0 00 C9 06 F0 02 A9 FF 8D D7 06 94 1E EE 46 -0xD350: 07 60 AD F8 07 0D F9 07 0D FA 07 F0 F1 A5 09 29 -0xD360: 04 F0 04 A9 10 85 FE A0 23 A9 FF 8D 39 01 20 5F -0xD370: 8F A9 05 8D 39 01 A0 0B AD 53 07 F0 02 A0 11 20 -0xD380: 5F 8F AD 53 07 0A 0A 0A 0A 09 04 4C 36 BC B5 CF -0xD390: C9 72 90 05 D6 CF 4C 65 D3 AD D7 06 F0 38 30 36 -0xD3A0: A9 16 8D CB 06 20 52 F1 BC E5 06 A2 03 AD B9 03 -0xD3B0: 18 7D CD D2 99 00 02 BD D5 D2 99 01 02 A9 22 99 -0xD3C0: 02 02 AD AE 03 18 7D D1 D2 99 03 02 C8 C8 C8 C8 -0xD3D0: CA 10 DA A6 08 60 20 65 D3 A9 06 9D 96 07 EE 46 -0xD3E0: 07 60 20 65 D3 BD 96 07 D0 05 AD B1 07 F0 EF 60 -0xD3F0: B5 1E D0 56 BD 8A 07 D0 51 B5 A0 D0 23 B5 58 30 -0xD400: 14 20 43 E1 10 09 A5 00 49 FF 18 69 01 85 00 A5 -0xD410: 00 C9 21 90 35 B5 58 49 FF 18 69 01 95 58 F6 A0 -0xD420: BD 34 04 B4 58 10 03 BD 17 04 85 00 A5 09 4A 90 -0xD430: 19 AD 47 07 D0 14 B5 CF 18 75 58 95 CF C5 00 D0 -0xD440: 09 A9 00 95 A0 A9 40 9D 8A 07 A9 20 9D C5 03 60 -0xD450: 85 07 B5 34 D0 0E A0 18 B5 58 18 65 07 95 58 B5 -0xD460: A0 69 00 60 A0 08 B5 58 38 E5 07 95 58 B5 A0 E9 -0xD470: 00 60 B5 B6 C9 03 D0 03 4C 98 C9 B5 1E 10 01 60 -0xD480: A8 BD A2 03 85 00 B5 46 F0 03 4C BB D5 A9 2D D5 -0xD490: CF 90 0F C4 00 F0 08 18 69 02 95 CF 4C B1 D5 4C -0xD4A0: 98 D5 D9 CF 00 90 0D E4 00 F0 F4 18 69 02 99 CF -0xD4B0: 00 4C B1 D5 B5 CF 48 BD A2 03 10 18 BD 34 04 18 -0xD4C0: 69 05 85 00 B5 A0 69 00 30 1A D0 0C A5 00 C9 0B -0xD4D0: 90 0C B0 04 C5 08 F0 0C 20 B7 BF 4C A7 D4 20 B1 -0xD4E0: D5 4C A7 D4 20 B4 BF B4 1E 68 38 F5 CF 18 79 CF -0xD4F0: 00 99 CF 00 BD A2 03 30 04 AA 20 21 DC A4 08 B9 -0xD500: A0 00 19 34 04 F0 77 AE 00 03 E0 20 B0 70 B9 A0 -0xD510: 00 48 48 20 41 D5 A5 01 9D 01 03 A5 00 9D 02 03 -0xD520: A9 02 9D 03 03 B9 A0 00 30 0D A9 A2 9D 04 03 A9 -0xD530: A3 9D 05 03 4C FF D4 A9 24 9D 04 03 9D 05 03 B9 -0xD540: 1E 00 A8 68 49 FF 20 41 D5 A5 01 9D 06 03 A5 00 -0xD550: 9D 07 03 A9 02 9D 08 03 68 10 0D A9 A2 9D 09 03 -0xD560: A9 A3 9D 0A 03 4C 30 D5 A9 24 9D 09 03 9D 0A 03 -0xD570: A9 00 9D 0B 03 AD 00 03 18 69 0A 8D 00 03 A6 08 -0xD580: 60 48 B9 87 00 18 69 08 AE CC 06 D0 03 18 69 10 -0xD590: 48 B9 6E 00 69 00 85 02 68 29 F0 4A 4A 4A 85 00 -0xD5A0: B6 CF 68 10 05 8A 18 69 08 AA 8A AE 00 03 0A 2A -0xD5B0: 48 2A 29 03 09 20 85 01 A5 02 29 01 0A 0A 05 01 -0xD5C0: 85 01 68 29 E0 18 65 00 85 00 B9 CF 00 C9 E8 90 -0xD5D0: 06 A5 00 29 BF 85 00 60 98 AA 20 AF F1 A9 06 20 -0xD5E0: 11 DA AD AD 03 9D 17 01 A5 CE 9D 1E 01 A9 01 95 -0xD5F0: 46 20 63 C3 99 A0 00 99 34 04 60 98 48 20 6B BF -0xD600: 68 AA 20 6B BF A6 08 BD A2 03 30 04 AA 20 21 DC -0xD610: A6 08 60 B5 A0 1D 34 04 D0 15 9D 17 04 B5 CF DD -0xD620: 01 04 B0 0B A5 09 29 07 D0 02 F6 CF 4C FE D5 B5 -0xD630: CF D5 58 90 06 20 B7 BF 4C FE D5 20 B4 BF BD A2 -0xD640: 03 30 03 20 21 DC 60 A9 0E 20 47 CB 20 66 CB BD -0xD650: A2 03 30 1C A5 86 18 65 00 85 86 A5 6D A4 00 30 -0xD660: 05 69 00 4C 28 D6 E9 00 85 6D 8C A1 03 20 21 DC -0xD670: 60 BD A2 03 30 06 20 88 BF 20 21 DC 60 20 02 BF -0xD680: 85 00 BD A2 03 30 07 A9 10 95 58 20 14 D6 60 20 -0xD690: 5B D6 4C FE D5 20 5B D6 4C 71 D6 AD 47 07 D0 19 -0xD6A0: BD 17 04 18 7D 34 04 9D 17 04 B5 CF 75 A0 95 CF -0xD6B0: 60 BD A2 03 F0 03 20 19 DC 60 B5 16 C9 14 F0 55 -0xD6C0: AD 1C 07 B4 16 C0 05 F0 04 C0 0D D0 02 69 38 E9 -0xD6D0: 48 85 01 AD 1A 07 E9 00 85 00 AD 1D 07 69 48 85 -0xD6E0: 03 AD 1B 07 69 00 85 02 B5 87 C5 01 B5 6E E5 00 -0xD6F0: 30 20 B5 87 C5 03 B5 6E E5 02 30 19 B5 1E C9 05 -0xD700: F0 13 C0 0D F0 0F C0 30 F0 0B C0 31 F0 07 C0 32 -0xD710: F0 03 20 98 C9 60 FF FF FF B5 24 F0 56 0A B0 53 -0xD720: A5 09 4A B0 4E 8A 0A 0A 18 69 1C A8 A2 04 86 01 -0xD730: 98 48 B5 1E 29 20 D0 34 B5 0F F0 30 B5 16 C9 24 -0xD740: 90 04 C9 2B 90 26 C9 06 D0 06 B5 1E C9 02 B0 1C -0xD750: BD D8 03 D0 17 8A 0A 0A 18 69 04 AA 20 27 E3 A6 -0xD760: 08 90 09 A9 80 95 24 A6 01 20 3E D7 68 A8 A6 01 -0xD770: CA 10 BB A6 08 60 06 00 02 12 11 07 05 2D 20 52 -0xD780: F1 A6 01 B5 0F 10 0B 29 0F AA B5 16 C9 2D F0 0C -0xD790: A6 01 B5 16 C9 02 F0 6B C9 2D D0 2D CE 83 04 D0 -0xD7A0: 62 20 63 C3 95 58 8D CB 06 A9 FE 95 A0 AC 5F 07 -0xD7B0: B9 36 D7 95 16 A9 20 C0 03 B0 02 09 03 95 1E A9 -0xD7C0: 80 85 FE A6 01 A9 09 D0 33 C9 08 F0 36 C9 0C F0 -0xD7D0: 32 C9 15 B0 2E B5 16 C9 0D D0 06 B5 CF 69 18 95 -0xD7E0: CF 20 1B E0 B5 1E 29 1F 09 20 95 1E A9 02 B4 16 -0xD7F0: C0 05 D0 02 A9 06 C0 06 D0 02 A9 01 20 11 DA A9 -0xD800: 08 85 FF 60 A5 09 4A 90 36 AD 47 07 0D D6 03 D0 -0xD810: 2E 8A 0A 0A 18 69 24 A8 20 25 E3 A6 08 90 1B BD -0xD820: BE 06 D0 1B A9 01 9D BE 06 B5 64 49 FF 18 69 01 -0xD830: 95 64 AD 9F 07 D0 08 4C 2C D9 A9 00 9D BE 06 60 -0xD840: 20 98 C9 A9 06 20 11 DA A9 20 85 FE A5 39 C9 02 -0xD850: 90 0E C9 03 F0 24 A9 23 8D 9F 07 A9 40 85 FB 60 -0xD860: AD 56 07 F0 1B C9 01 D0 23 A6 08 A9 02 8D 56 07 -0xD870: 20 F1 85 A6 08 A9 0C 4C 47 D8 A9 0B 9D 10 01 60 -0xD880: A9 01 8D 56 07 A9 09 A0 00 20 48 D9 60 18 E8 30 -0xD890: D0 08 F8 A5 09 4A B0 F4 20 41 DC B0 23 BD D8 03 -0xD8A0: D0 1E A5 0E C9 08 D0 18 B5 1E 29 20 D0 12 20 52 -0xD8B0: DC 20 25 E3 A6 08 B0 09 BD 91 04 29 FE 9D 91 04 -0xD8C0: 60 B4 16 C0 2E D0 03 4C 00 D8 AD 9F 07 F0 06 4C -0xD8D0: 95 D7 0A 06 04 BD 91 04 29 01 1D D8 03 D0 59 A9 -0xD8E0: 01 1D 91 04 9D 91 04 C0 12 F0 4E C0 0D F0 7D C0 -0xD8F0: 0C F0 79 C0 33 F0 42 C0 15 B0 71 AD 4E 07 F0 6C -0xD900: B5 1E 0A B0 34 B5 1E 29 07 C9 02 90 2C B5 16 C9 -0xD910: 06 F0 25 A9 08 85 FF B5 1E 09 80 95 1E 20 05 DA -0xD920: B9 4F D8 95 58 A9 03 18 6D 84 04 BC 96 07 C0 03 -0xD930: B0 03 B9 92 D8 20 11 DA 60 A5 9F 30 02 D0 6A B5 -0xD940: 16 C9 07 90 09 A5 CE 18 69 0C D5 CF 90 5B AD 91 -0xD950: 07 D0 56 AD 9E 07 D0 3D AD AD 03 CD AE 03 90 03 -0xD960: 4C F6 D9 B5 46 C9 01 D0 03 4C FF D9 AD 9E 07 D0 -0xD970: 24 AE 56 07 F0 22 8D 56 07 A9 08 8D 9E 07 0A 85 -0xD980: FF 20 F1 85 A9 0A A0 01 85 0E 84 1D A0 FF 8C 47 -0xD990: 07 C8 8C 75 07 A6 08 60 86 57 E8 86 FC A9 FC 85 -0xD9A0: 9F A9 0B D0 E1 02 06 05 06 B5 16 C9 12 F0 BD A9 -0xD9B0: 04 85 FF B5 16 A0 00 C9 14 F0 1B C9 08 F0 17 C9 -0xD9C0: 33 F0 13 C9 0C F0 0F C8 C9 05 F0 0A C8 C9 11 F0 -0xD9D0: 05 C8 C9 07 D0 1D B9 65 D9 20 11 DA B5 46 48 20 -0xD9E0: 2F E0 68 95 46 A9 20 95 1E 20 63 C3 95 58 A9 FD -0xD9F0: 85 9F 60 C9 09 90 1D 29 01 95 16 A0 00 94 1E A9 -0xDA00: 03 20 11 DA 20 63 C3 20 05 DA B9 51 D8 95 58 4C -0xDA10: F1 D9 10 0B A9 04 95 1E EE 84 04 AD 84 04 18 6D -0xDA20: 91 07 20 11 DA EE 91 07 AC 6A 07 B9 D2 D9 9D 96 -0xDA30: 07 A9 FC 85 9F 60 B5 46 C9 01 D0 03 4C 2C D9 20 -0xDA40: 1C DB 4C 2C D9 A0 01 20 43 E1 10 01 C8 94 46 88 -0xDA50: 60 9D 10 01 A9 30 9D 2C 01 B5 CF 9D 1E 01 AD AE -0xDA60: 03 9D 17 01 60 80 40 20 10 08 04 02 7F BF DF EF -0xDA70: F7 FB FD A5 09 4A 90 EC AD 4E 07 F0 E7 B5 16 C9 -0xDA80: 15 B0 6E C9 11 F0 6A C9 0D F0 66 BD D8 03 D0 61 -0xDA90: 20 52 DC CA 30 5B 86 01 98 48 B5 0F F0 4C B5 16 -0xDAA0: C9 15 B0 46 C9 11 F0 42 C9 0D F0 3E BD D8 03 D0 -0xDAB0: 39 8A 0A 0A 18 69 04 AA 20 27 E3 A6 08 A4 01 90 -0xDAC0: 20 B5 1E 19 1E 00 29 80 D0 11 B9 91 04 3D 25 DA -0xDAD0: D0 18 B9 91 04 1D 25 DA 99 91 04 20 B4 DA 4C AA -0xDAE0: DA B9 91 04 3D 2C DA 99 91 04 68 A8 A6 01 CA 10 -0xDAF0: A5 A6 08 60 B9 1E 00 15 1E 29 20 D0 33 B5 1E C9 -0xDB00: 06 90 2E B5 16 C9 05 F0 27 B9 1E 00 0A 90 0A A9 -0xDB10: 06 20 11 DA 20 95 D7 A4 01 98 AA 20 95 D7 A6 08 -0xDB20: BD 25 01 18 69 04 A6 01 20 11 DA A6 08 FE 25 01 -0xDB30: 60 B9 1E 00 C9 06 90 1D B9 16 00 C9 05 F0 F1 20 -0xDB40: 95 D7 A4 01 B9 25 01 18 69 04 A6 08 20 11 DA A6 -0xDB50: 01 FE 25 01 60 98 AA 20 1C DB A6 08 B5 16 C9 0D -0xDB60: F0 22 C9 11 F0 1E C9 05 F0 1A C9 12 F0 08 C9 0E -0xDB70: F0 04 C9 07 B0 0E B5 58 49 FF A8 C8 94 58 B5 46 -0xDB80: 49 03 95 46 60 A9 FF 9D A2 03 AD 47 07 D0 29 B5 -0xDB90: 1E 30 25 B5 16 C9 24 D0 06 B5 1E AA 20 5F DB 20 -0xDBA0: 41 DC B0 14 8A 20 54 DC B5 CF 85 00 8A 48 20 25 -0xDBB0: E3 68 AA 90 03 20 BC DB A6 08 60 AD 47 07 D0 37 -0xDBC0: 9D A2 03 20 41 DC B0 2F A9 02 85 00 A6 08 20 52 -0xDBD0: DC 29 02 D0 22 B9 AD 04 C9 20 90 05 20 25 E3 B0 -0xDBE0: 19 B9 AD 04 18 69 80 99 AD 04 B9 AF 04 18 69 80 -0xDBF0: 99 AF 04 C6 00 D0 D5 A6 08 60 A6 08 B9 AF 04 38 -0xDC00: ED AD 04 C9 04 B0 08 A5 9F 10 04 A9 01 85 9F AD -0xDC10: AF 04 38 F9 AD 04 C9 06 B0 1B A5 9F 30 17 A5 00 -0xDC20: B4 16 C0 2B F0 05 C0 2C F0 01 8A A6 08 9D A2 03 -0xDC30: A9 00 85 1D 60 A9 01 85 00 AD AE 04 38 F9 AC 04 -0xDC40: C9 08 90 0D E6 00 B9 AE 04 18 ED AC 04 C9 09 B0 -0xDC50: 03 20 4B DF A6 08 60 80 00 A8 B5 CF 18 79 16 DC -0xDC60: 2C B5 CF A4 0E C0 0B F0 17 B4 B6 C0 01 D0 11 38 -0xDC70: E9 20 85 CE 98 E9 00 85 B5 A9 00 85 9F 8D 33 04 -0xDC80: 60 AD D0 03 C9 F0 B0 09 A4 B5 88 D0 04 A5 CE C9 -0xDC90: D0 60 A5 08 0A 0A 18 69 04 A8 AD D1 03 29 0F C9 -0xDCA0: 0F 60 20 10 AD 16 07 D0 2E A5 0E C9 0B F0 28 C9 -0xDCB0: 04 90 24 A9 01 AC 04 07 D0 0A A5 1D F0 04 C9 03 -0xDCC0: D0 04 A9 02 85 1D A5 B5 C9 01 D0 0B A9 FF 8D 90 -0xDCD0: 04 A5 CE C9 CF 90 01 60 A0 02 AD 14 07 D0 0C AD -0xDCE0: 54 07 D0 07 88 AD 04 07 D0 01 88 B9 AD E3 85 EB -0xDCF0: A8 AE 54 07 AD 14 07 F0 01 E8 A5 CE DD 62 DC 90 -0xDD00: 35 20 E9 E3 F0 30 20 A1 DF B0 4F A4 9F 10 27 A4 -0xDD10: 04 C0 04 90 21 20 8F DF B0 10 AC 4E 07 F0 13 AC -0xDD20: 84 07 D0 0E 20 ED BC 4C F6 DC C9 26 F0 04 A9 02 -0xDD30: 85 FF A9 01 85 9F A4 EB A5 CE C9 CF B0 60 20 E8 -0xDD40: E3 20 A1 DF B0 14 48 20 E8 E3 85 00 68 85 01 D0 -0xDD50: 0C A5 00 F0 49 20 A1 DF 90 03 4C 05 DE 20 9A DF -0xDD60: B0 3C A4 9F 30 38 C9 C5 D0 03 4C 0E DE 20 BD DE -0xDD70: F0 2C AC 0E 07 D0 23 A4 04 C0 05 90 07 A5 45 85 -0xDD80: 00 4C 4B DF 20 C4 DE A9 F0 25 CE 85 CE 20 E8 DE -0xDD90: A9 00 85 9F 8D 33 04 8D 84 04 A9 00 85 1D A4 EB -0xDDA0: C8 C8 A9 02 85 00 C8 84 EB A5 CE C9 20 90 16 C9 -0xDDB0: E4 B0 28 20 EC E3 F0 0D C9 1C F0 09 C9 6B F0 05 -0xDDC0: 20 9A DF 90 17 A4 EB C8 A5 CE C9 08 90 0D C9 D0 -0xDDD0: B0 09 20 EC E3 D0 05 C6 00 D0 CB 60 20 BD DE F0 -0xDDE0: 61 20 9A DF 90 03 4C 2E DE 20 A1 DF B0 57 20 DD -0xDDF0: DE 90 08 AD 0E 07 D0 4A 4C FF DD A4 1D C0 00 D0 -0xDE00: 3E A4 33 88 D0 39 C9 6C F0 04 C9 1F D0 31 AD C4 -0xDE10: 03 D0 04 A0 10 84 FF 09 20 8D C4 03 A5 86 29 0F -0xDE20: F0 0E A0 00 AD 1A 07 F0 01 C8 B9 03 DE 8D DE 06 -0xDE30: A5 0E C9 07 F0 0C C9 08 D0 08 A9 02 85 0E 60 20 -0xDE40: 4B DF 60 A0 34 20 1C DE EE 48 07 4C FE BB A9 00 -0xDE50: 8D 72 07 A9 02 8D 70 07 A9 18 85 57 A4 02 A9 00 -0xDE60: 91 06 4C 4D 8A F9 07 FF 00 18 22 50 68 90 A4 04 -0xDE70: C0 06 90 04 C0 0A 90 01 60 C9 24 F0 04 C9 25 D0 -0xDE80: 39 A5 0E C9 05 F0 41 A9 01 85 33 EE 23 07 A5 0E -0xDE90: C9 04 F0 1F A9 33 20 16 97 A9 80 85 FC 4A 8D 13 -0xDEA0: 07 A2 04 A5 CE 8D 0F 07 DD 29 DE B0 03 CA D0 F8 -0xDEB0: 8E 0F 01 A9 04 85 0E 4C 88 DE C9 26 D0 0A A5 CE -0xDEC0: C9 20 B0 04 A9 01 85 0E A9 03 85 1D A9 00 85 57 -0xDED0: 8D 05 07 A5 86 38 ED 1C 07 C9 10 B0 04 A9 02 85 -0xDEE0: 33 A4 33 A5 06 0A 0A 0A 0A 18 79 24 DE 85 86 A5 -0xDEF0: 06 D0 09 AD 1B 07 18 79 26 DE 85 6D 60 C9 5F F0 -0xDF00: 02 C9 60 60 20 DD DE 90 13 A9 70 8D 09 07 A9 F9 -0xDF10: 8D DB 06 A9 03 8D 86 07 4A 8D 0E 07 60 C9 67 F0 -0xDF20: 05 C9 68 18 D0 01 38 60 A5 0B 29 04 F0 5C A5 00 -0xDF30: C9 11 D0 56 A5 01 C9 10 D0 50 A9 30 8D DE 06 A9 -0xDF40: 03 85 0E A9 10 85 FF A9 20 8D C4 03 AD D6 06 F0 -0xDF50: 39 29 03 0A 0A AA A5 86 C9 60 90 06 E8 C9 A0 90 -0xDF60: 01 E8 BC F2 87 88 8C 5F 07 BE B4 9C BD BC 9C 8D -0xDF70: 50 07 A9 80 85 FC A9 00 8D 51 07 8D 60 07 8D 5C -0xDF80: 07 8D 52 07 EE 5D 07 EE 57 07 60 A9 00 A4 57 A6 -0xDF90: 00 CA D0 0A E8 C0 00 30 28 A9 FF 4C 66 DF A2 02 -0xDFA0: C0 01 10 1D A9 01 A0 10 8C 85 07 A0 00 84 57 C9 -0xDFB0: 00 10 01 88 84 00 18 65 86 85 86 A5 6D 65 00 85 -0xDFC0: 6D 8A 49 FF 2D 90 04 8D 90 04 60 10 61 88 C4 20 -0xDFD0: B0 DF DD 8B DF 60 24 6D 8A C6 20 B0 DF DD 96 DF -0xDFE0: 60 C9 C2 F0 06 C9 C3 F0 02 18 60 A9 01 85 FE 60 -0xDFF0: A8 29 C0 0A 2A 2A AA 98 60 01 01 02 02 02 05 10 -0xE000: F0 B5 1E 29 20 D0 F1 20 5B E1 90 EC B4 16 C0 12 -0xE010: D0 06 B5 CF C9 25 90 E0 C0 0E D0 03 4C 63 E1 C0 -0xE020: 05 D0 03 4C 85 E1 C0 12 F0 08 C0 2E F0 04 C0 07 -0xE030: B0 74 20 AE E1 D0 03 4C E2 E0 20 B5 E1 F0 F8 C9 -0xE040: 23 D0 64 A4 02 A9 00 91 06 B5 16 C9 15 B0 0C C9 -0xE050: 06 D0 03 20 8E E1 A9 01 20 11 DA C9 09 90 10 C9 -0xE060: 11 B0 0C C9 0A 90 04 C9 0D 90 04 29 01 95 16 B5 -0xE070: 1E 29 F0 09 02 95 1E D6 CF D6 CF B5 16 C9 07 F0 -0xE080: 07 A9 FD AC 4E 07 D0 02 A9 FF 95 A0 A0 01 20 43 -0xE090: E1 10 01 C8 B5 16 C9 33 F0 06 C9 08 F0 02 94 46 -0xE0A0: 88 B9 BF DF 95 58 60 A5 04 38 E9 08 C9 05 B0 72 -0xE0B0: B5 1E 29 40 D0 57 B5 1E 0A 90 03 4C FE E0 B5 1E -0xE0C0: F0 F9 C9 05 F0 1F C9 03 B0 1A B5 1E C9 02 D0 15 -0xE0D0: A9 10 B4 16 C0 12 D0 02 A9 00 9D 96 07 A9 03 95 -0xE0E0: 1E 20 4F E1 60 B5 16 C9 06 F0 22 C9 12 D0 0E A9 -0xE0F0: 01 95 46 A9 08 95 58 A5 09 29 07 F0 10 A0 01 20 -0xE100: 43 E1 10 01 C8 98 D5 46 D0 03 20 24 E1 20 4F E1 -0xE110: B5 1E 29 80 D0 05 A9 00 95 1E 60 B5 1E 29 BF 95 -0xE120: 1E 60 B5 16 C9 03 D0 04 B5 1E F0 38 B5 1E A8 0A -0xE130: 90 07 B5 1E 09 40 4C FC E0 B9 B9 DF 95 1E B5 CF -0xE140: C9 20 90 1F A0 16 A9 02 85 EB A5 EB D5 46 D0 0C -0xE150: A9 01 20 88 E3 F0 05 20 B5 E1 D0 08 C6 EB C8 C0 -0xE160: 18 90 E7 60 E0 05 F0 09 B5 1E 0A 90 04 A9 02 85 -0xE170: FF B5 16 C9 05 D0 09 A9 00 85 00 A0 FA 4C 37 CA -0xE180: 4C 36 DB B5 87 38 E5 86 85 00 B5 6E E5 6D 60 20 -0xE190: 63 C3 B5 CF 29 F0 09 08 95 CF 60 B5 CF 18 69 3E -0xE1A0: C9 44 60 20 5B E1 90 1A B5 A0 18 69 02 C9 03 90 -0xE1B0: 11 20 AE E1 F0 0C 20 B5 E1 F0 07 20 4F E1 A9 FD -0xE1C0: 95 A0 4C FE E0 20 AE E1 F0 1D C9 23 D0 08 20 95 -0xE1D0: D7 A9 FC 95 A0 60 BD 8A 07 D0 0C B5 1E 29 88 95 -0xE1E0: 1E 20 4F E1 4C FE E0 B5 1E 09 01 95 1E 60 A9 00 -0xE1F0: A0 15 4C 88 E3 C9 26 F0 0E C9 C2 F0 0A C9 C3 F0 -0xE200: 06 C9 5F F0 02 C9 60 60 B5 D5 C9 18 90 21 20 9C -0xE210: E3 F0 1C 20 B5 E1 F0 17 B5 A6 30 18 B5 3A D0 14 -0xE220: A9 FD 95 A6 A9 01 95 3A B5 D5 29 F8 95 D5 60 A9 -0xE230: 00 95 3A 60 A9 80 95 24 A9 02 85 FF 60 02 08 0E -0xE240: 20 03 14 0D 20 02 14 0E 20 02 09 0E 15 00 00 18 -0xE250: 06 00 00 20 0D 00 00 30 0D 00 00 08 08 06 04 0A -0xE260: 08 03 0E 0D 14 00 02 10 15 04 04 0C 1C 8A 18 69 -0xE270: 07 AA A0 02 D0 07 8A 18 69 09 AA A0 06 20 9C E2 -0xE280: 4C DE E2 A0 48 84 00 A0 44 4C 52 E2 A0 08 84 00 -0xE290: A0 04 B5 87 38 ED 1C 07 85 01 B5 6E ED 1A 07 30 -0xE2A0: 06 05 01 F0 02 A4 00 98 2D D1 03 9D D8 03 D0 19 -0xE2B0: 4C 7C E2 E8 20 F6 F1 CA C9 FE B0 0D 8A 18 69 01 -0xE2C0: AA A0 01 20 9C E2 4C DE E2 8A 0A 0A A8 A9 FF 99 -0xE2D0: B0 04 99 B1 04 99 B2 04 99 B3 04 60 86 00 B9 B8 -0xE2E0: 03 85 02 B9 AD 03 85 01 8A 0A 0A 48 A8 BD 99 04 -0xE2F0: 0A 0A AA A5 01 18 7D FD E1 99 AC 04 A5 01 18 7D -0xE300: FF E1 99 AE 04 E8 C8 A5 02 18 7D FD E1 99 AC 04 -0xE310: A5 02 18 7D FF E1 99 AE 04 68 A8 A6 00 60 AD 1C -0xE320: 07 18 69 80 85 02 AD 1A 07 69 00 85 01 B5 86 C5 -0xE330: 02 B5 6D E5 01 90 15 B9 AE 04 30 0D A9 FF BE AC -0xE340: 04 30 03 99 AC 04 99 AE 04 A6 08 60 B9 AC 04 10 -0xE350: 11 C9 A0 90 0D A9 00 BE AE 04 10 03 99 AE 04 99 -0xE360: AC 04 A6 08 60 A2 00 84 06 A9 01 85 07 B9 AC 04 -0xE370: DD AC 04 B0 2A DD AE 04 90 12 F0 42 B9 AE 04 D9 -0xE380: AC 04 90 3A DD AC 04 B0 35 A4 06 60 BD AE 04 DD -0xE390: AC 04 90 2A B9 AE 04 DD AC 04 B0 22 A4 06 60 DD -0xE3A0: AC 04 F0 1A DD AE 04 90 15 F0 13 D9 AE 04 90 0A -0xE3B0: F0 08 B9 AE 04 DD AC 04 B0 04 18 A4 06 60 E8 C8 -0xE3C0: C6 07 10 A9 38 A4 06 60 48 8A 18 69 01 AA 68 4C -0xE3D0: A5 E3 8A 18 69 0D AA A0 1B 4C A3 E3 A0 1A 8A 18 -0xE3E0: 69 07 AA A9 00 20 F0 E3 A6 08 C9 00 60 00 07 0E -0xE3F0: 08 03 0C 02 02 0D 0D 08 03 0C 02 02 0D 0D 08 03 -0xE400: 0C 02 02 0D 0D 08 00 10 04 14 04 04 04 20 20 08 -0xE410: 18 08 18 02 20 20 08 18 08 18 12 20 20 18 18 18 -0xE420: 18 18 14 14 06 06 08 10 C8 A9 00 2C A9 01 A2 00 -0xE430: 48 84 04 B9 B0 E3 18 75 86 85 05 B5 6D 69 00 29 -0xE440: 01 4A 05 05 6A 4A 4A 4A 20 E1 9B A4 04 B5 CE 18 -0xE450: 79 CC E3 29 F0 38 E9 20 85 02 A8 B1 06 85 03 A4 -0xE460: 04 68 D0 05 B5 CE 4C 2B E4 B5 86 29 0F 85 04 A5 -0xE470: 03 60 FF 00 30 84 00 AD B9 03 18 79 33 E4 BE 9A -0xE480: 03 BC E5 06 84 02 20 AE E4 AD AE 03 99 03 02 99 -0xE490: 0B 02 99 13 02 18 69 06 99 07 02 99 0F 02 99 17 -0xE4A0: 02 A9 21 99 02 02 99 0A 02 99 12 02 09 40 99 06 -0xE4B0: 02 99 0E 02 99 16 02 A2 05 A9 E1 99 01 02 C8 C8 -0xE4C0: C8 C8 CA 10 F4 A4 02 A5 00 D0 05 A9 E0 99 01 02 -0xE4D0: A2 00 AD 9D 03 38 F9 00 02 C9 64 90 05 A9 F8 99 -0xE4E0: 00 02 C8 C8 C8 C8 E8 E0 06 D0 E7 A4 00 60 A2 06 -0xE4F0: 99 00 02 18 69 08 C8 C8 C8 C8 CA D0 F3 A4 02 60 -0xE500: 04 00 04 00 00 04 00 04 00 08 00 08 08 00 08 00 -0xE510: 80 82 81 83 81 83 80 82 03 03 C3 C3 BC F3 06 AD -0xE520: 47 07 D0 08 B5 2A 29 7F C9 01 F0 04 A2 00 F0 07 -0xE530: A5 09 4A 4A 29 03 AA AD BE 03 18 7D C4 E4 99 00 -0xE540: 02 18 7D CC E4 99 04 02 AD B3 03 18 7D C0 E4 99 -0xE550: 03 02 18 7D C8 E4 99 07 02 BD D0 E4 99 01 02 BD -0xE560: D4 E4 99 05 02 BD D8 E4 99 02 02 99 06 02 A6 08 -0xE570: AD D6 03 29 FC F0 09 A9 00 95 2A A9 F8 20 C1 E5 -0xE580: 60 F9 50 F7 50 FA FB F8 FB F6 FB BC E5 06 AD AE -0xE590: 03 99 03 02 18 69 08 99 07 02 99 0B 02 18 69 0C -0xE5A0: 85 05 B5 CF 20 C1 E5 69 08 99 08 02 AD 0D 01 85 -0xE5B0: 02 A9 01 85 03 85 04 99 02 02 99 06 02 99 0A 02 -0xE5C0: A9 7E 99 01 02 99 09 02 A9 7F 99 05 02 AD 0F 07 -0xE5D0: F0 15 98 18 69 0C A8 AD 0F 01 0A AA BD 41 E5 85 -0xE5E0: 00 BD 42 E5 20 B2 EB A6 08 BC E5 06 AD D1 03 29 -0xE5F0: 0E F0 14 A9 F8 99 14 02 99 10 02 99 0C 02 99 08 -0xE600: 02 99 04 02 99 00 02 60 BC E5 06 84 02 C8 C8 C8 -0xE610: AD AE 03 20 AE E4 A6 08 B5 CF 20 BB E5 AC 4E 07 -0xE620: C0 03 F0 05 AC CC 06 F0 02 A9 F8 BC E5 06 99 10 -0xE630: 02 99 14 02 A9 5B AE 43 07 F0 02 A9 75 A6 08 C8 -0xE640: 20 B5 E5 A9 02 C8 20 B5 E5 E8 20 F6 F1 CA BC E5 -0xE650: 06 0A 48 90 05 A9 F8 99 00 02 68 0A 48 90 05 A9 -0xE660: F8 99 04 02 68 0A 48 90 05 A9 F8 99 08 02 68 0A -0xE670: 48 90 05 A9 F8 99 0C 02 68 0A 48 90 05 A9 F8 99 -0xE680: 10 02 68 0A 90 05 A9 F8 99 14 02 AD D1 03 0A 90 -0xE690: 03 20 B3 E5 60 A5 09 4A B0 02 D6 DB B5 DB 20 C1 -0xE6A0: E5 AD B3 03 99 03 02 18 69 08 99 07 02 A9 02 99 -0xE6B0: 02 02 99 06 02 A9 F7 99 01 02 A9 FB 99 05 02 4C -0xE6C0: BD E6 60 61 62 63 BC F3 06 B5 2A C9 02 B0 C6 B5 -0xE6D0: DB 99 00 02 18 69 08 99 04 02 AD B3 03 99 03 02 -0xE6E0: 99 07 02 A5 09 4A 29 03 AA BD 82 E6 C8 20 C1 E5 -0xE6F0: 88 A9 02 99 02 02 A9 82 99 06 02 A6 08 60 76 77 -0xE700: 78 79 D6 D6 D9 D9 8D 8D E4 E4 76 77 78 79 02 01 -0xE710: 02 01 AC EA 06 AD B9 03 18 69 08 85 02 AD AE 03 -0xE720: 85 05 A6 39 BD CE E6 0D CA 03 85 04 8A 48 0A 0A -0xE730: AA A9 01 85 07 85 03 BD BE E6 85 00 BD BF E6 20 -0xE740: B2 EB C6 07 10 F1 AC EA 06 68 F0 2F C9 03 F0 2B -0xE750: 85 00 A5 09 4A 29 03 0D CA 03 99 02 02 99 06 02 -0xE760: A6 00 CA F0 06 99 0A 02 99 0E 02 B9 06 02 09 40 -0xE770: 99 06 02 B9 0E 02 09 40 99 0E 02 4C 64 EB FC FC -0xE780: AA AB AC AD FC FC AE AF B0 B1 FC A5 A6 A7 A8 A9 -0xE790: FC A0 A1 A2 A3 A4 69 A5 6A A7 A8 A9 6B A0 6C A2 -0xE7A0: A3 A4 FC FC 96 97 98 99 FC FC 9A 9B 9C 9D FC FC -0xE7B0: 8F 8E 8E 8F FC FC 95 94 94 95 FC FC DC DC DF DF -0xE7C0: DC DC DD DD DE DE FC FC B2 B3 B4 B5 FC FC B6 B3 -0xE7D0: B7 B5 FC FC 70 71 72 73 FC FC 6E 6E 6F 6F FC FC -0xE7E0: 6D 6D 6F 6F FC FC 6F 6F 6E 6E FC FC 6F 6F 6D 6D -0xE7F0: FC FC F4 F4 F5 F5 FC FC F4 F4 F5 F5 FC FC F5 F5 -0xE800: F4 F4 FC FC F5 F5 F4 F4 FC FC FC FC EF EF B9 B8 -0xE810: BB BA BC BC FC FC BD BD BC BC 7A 7B DA DB D8 D8 -0xE820: CD CD CE CE CF CF 7D 7C D1 8C D3 D2 7D 7C 89 88 -0xE830: 8B 8A D5 D4 E3 E2 D3 D2 D5 D4 E3 E2 8B 8A E5 E5 -0xE840: E6 E6 EB EB EC EC ED ED EE EE FC FC D0 D0 D7 D7 -0xE850: BF BE C1 C0 C2 FC C4 C3 C6 C5 C8 C7 BF BE CA C9 -0xE860: C2 FC C4 C3 C6 C5 CC CB FC FC E8 E7 EA E9 F2 F2 -0xE870: F3 F3 F2 F2 F1 F1 F1 F1 FC FC F0 F0 FC FC FC FC -0xE880: 0C 0C 00 0C 0C A8 54 3C EA 18 48 48 CC C0 18 18 -0xE890: 18 90 24 FF 48 9C D2 D8 F0 F6 FC 01 02 03 02 01 -0xE8A0: 01 03 03 03 01 01 02 02 21 01 02 01 01 02 FF 02 -0xE8B0: 02 01 01 02 02 02 08 18 18 19 1A 19 18 B5 CF 85 -0xE8C0: 02 AD AE 03 85 05 BC E5 06 84 EB A9 00 8D 09 01 -0xE8D0: B5 46 85 03 BD C5 03 85 04 B5 16 C9 0D D0 0A B4 -0xE8E0: 58 30 06 BC 8A 07 F0 01 60 B5 1E 85 ED 29 1F A8 -0xE8F0: B5 16 C9 35 D0 08 A0 00 A9 01 85 03 A9 15 C9 33 -0xE900: D0 13 C6 02 A9 03 BC 8A 07 F0 02 09 20 85 04 A0 -0xE910: 00 84 ED A9 08 C9 32 D0 08 A0 03 AE 0E 07 BD 78 -0xE920: E8 85 EF 84 EC A6 08 C9 0C D0 07 B5 A0 30 03 EE -0xE930: 09 01 AD 6A 03 F0 09 A0 16 C9 01 F0 01 C8 84 EF -0xE940: A4 EF C0 06 D0 1D B5 1E C9 02 90 04 A2 04 86 EC -0xE950: 29 20 0D 47 07 D0 0C A5 09 29 08 D0 06 A5 03 49 -0xE960: 03 85 03 B9 5B E8 05 04 85 04 B9 40 E8 AA A4 EC -0xE970: AD 6A 03 F0 30 C9 01 D0 13 AD 63 03 10 02 A2 DE -0xE980: A5 ED 29 20 F0 03 8E 09 01 4C 4B EA AD 63 03 29 -0xE990: 01 F0 02 A2 E4 A5 ED 29 20 F0 EE A5 02 38 E9 10 -0xE9A0: 85 02 4C 46 E9 E0 24 D0 11 C0 05 D0 0A A2 30 A9 -0xE9B0: 02 85 03 A9 05 85 EC 4C CA E9 E0 90 D0 12 A5 ED -0xE9C0: 29 20 D0 09 AD 8F 07 C9 10 B0 02 A2 96 4C 37 EA -0xE9D0: A5 EF C9 04 B0 10 C0 02 90 0C A2 5A A4 EF C0 02 -0xE9E0: D0 04 A2 7E E6 02 A5 EC C9 04 D0 1E A2 72 E6 02 -0xE9F0: A4 EF C0 02 F0 04 A2 66 E6 02 C0 06 D0 0C A2 54 -0xEA00: A5 ED 29 20 D0 04 A2 8A C6 02 A4 08 A5 EF C9 05 -0xEA10: D0 0C A5 ED F0 24 29 08 F0 5D A2 B4 D0 1C E0 48 -0xEA20: F0 18 B9 96 07 C9 05 B0 4E E0 3C D0 0D C9 01 F0 -0xEA30: 46 E6 02 E6 02 E6 02 4C 29 EA A5 EF C9 06 F0 37 -0xEA40: C9 08 F0 33 C9 0C F0 2F C9 18 B0 2B A0 00 C9 15 -0xEA50: D0 10 C8 AD 5F 07 C9 07 B0 1D A2 A2 A9 03 85 EC -0xEA60: D0 15 A5 09 39 76 E8 D0 0E A5 ED 29 A0 0D 47 07 -0xEA70: D0 05 8A 18 69 06 AA A5 ED 29 20 F0 0E A5 EF C9 -0xEA80: 04 90 08 A0 01 8C 09 01 88 84 EC A4 EB 20 AA EB -0xEA90: 20 AA EB 20 AA EB A6 08 BC E5 06 A5 EF C9 08 D0 -0xEAA0: 03 4C 64 EB AD 09 01 F0 3D B9 02 02 09 80 C8 C8 -0xEAB0: 20 B5 E5 88 88 98 AA A5 EF C9 05 F0 0D C9 11 F0 -0xEAC0: 09 C9 15 B0 05 8A 18 69 08 AA BD 01 02 48 BD 05 -0xEAD0: 02 48 B9 11 02 9D 01 02 B9 15 02 9D 05 02 68 99 -0xEAE0: 15 02 68 99 11 02 AD 6A 03 D0 B6 A5 EF A6 EC C9 -0xEAF0: 05 D0 03 4C 64 EB C9 07 F0 1D C9 0D F0 19 C9 0C -0xEB00: F0 15 C9 12 D0 04 E0 05 D0 48 C9 15 D0 05 A9 42 -0xEB10: 99 16 02 E0 02 90 3B AD 6A 03 D0 36 B9 02 02 29 -0xEB20: A3 99 02 02 99 0A 02 99 12 02 09 40 E0 05 D0 02 -0xEB30: 09 80 99 06 02 99 0E 02 99 16 02 E0 04 D0 13 B9 -0xEB40: 0A 02 09 80 99 0A 02 99 12 02 09 40 99 0E 02 99 -0xEB50: 16 02 A5 EF C9 11 D0 36 AD 09 01 D0 21 B9 12 02 -0xEB60: 29 81 99 12 02 B9 16 02 09 41 99 16 02 AE 8F 07 -0xEB70: E0 10 B0 30 99 0E 02 29 81 99 0A 02 90 26 B9 02 -0xEB80: 02 29 81 99 02 02 B9 06 02 09 41 99 06 02 A5 EF -0xEB90: C9 18 90 10 A9 82 99 0A 02 99 12 02 09 40 99 0E -0xEBA0: 02 99 16 02 A6 08 AD D1 03 4A 4A 4A 48 90 05 A9 -0xEBB0: 04 20 C1 EB 68 4A 48 90 05 A9 00 20 C1 EB 68 4A -0xEBC0: 4A 48 90 05 A9 10 20 B7 EB 68 4A 48 90 05 A9 08 -0xEBD0: 20 B7 EB 68 4A 90 12 20 B7 EB B5 16 C9 0C F0 09 -0xEBE0: B5 B6 C9 02 D0 03 20 98 C9 60 BD 3E E7 85 00 BD -0xEBF0: 3F E7 85 01 4C 82 F2 18 7D E5 06 A8 A9 F8 4C C1 -0xEC00: E5 18 7D E5 06 A8 20 4A EC 99 10 02 60 85 85 86 -0xEC10: 86 AD BC 03 85 02 AD B1 03 85 05 A9 03 85 04 4A -0xEC20: 85 03 BC EC 06 A2 00 BD CD EB 85 00 BD CE EB 20 -0xEC30: B2 EB E0 04 D0 F1 A6 08 BC EC 06 AD 4E 07 C9 01 -0xEC40: F0 08 A9 86 99 01 02 99 05 02 BD E8 03 C9 C4 D0 -0xEC50: 24 A9 87 C8 20 BB E5 88 A9 03 AE 4E 07 CA F0 01 -0xEC60: 4A A6 08 99 02 02 09 40 99 06 02 09 80 99 0E 02 -0xEC70: 29 83 99 0A 02 AD D4 03 48 29 04 F0 08 A9 F8 99 -0xEC80: 04 02 99 0C 02 68 29 08 F0 08 A9 F8 99 00 02 99 -0xEC90: 08 02 60 A9 02 85 00 A9 75 A4 0E C0 05 F0 06 A9 -0xECA0: 03 85 00 A9 84 BC EC 06 C8 20 BB E5 A5 09 0A 0A -0xECB0: 0A 0A 29 C0 05 00 C8 20 BB E5 88 88 AD BC 03 20 -0xECC0: C1 E5 AD B1 03 99 03 02 BD F1 03 38 ED 1C 07 85 -0xECD0: 00 38 ED B1 03 65 00 69 06 99 07 02 AD BD 03 99 -0xECE0: 08 02 99 0C 02 AD B2 03 99 0B 02 A5 00 38 ED B2 -0xECF0: 03 65 00 69 06 99 0F 02 AD D4 03 20 46 EC AD D4 -0xED00: 03 0A 90 05 A9 F8 20 C1 E5 A5 00 10 10 B9 03 02 -0xED10: D9 07 02 90 08 A9 F8 99 04 02 99 0C 02 60 BC F1 -0xED20: 06 AD BA 03 99 00 02 AD AF 03 99 03 02 A5 09 4A -0xED30: 4A 48 29 01 49 64 99 01 02 68 4A 4A A9 02 90 02 -0xED40: 09 C0 99 02 02 60 68 67 66 BC EC 06 B5 24 F6 24 -0xED50: 4A 29 07 C9 03 B0 4A AA BD 06 ED C8 20 BB E5 88 -0xED60: A6 08 AD BA 03 38 E9 04 99 00 02 99 08 02 18 69 -0xED70: 08 99 04 02 99 0C 02 AD AF 03 38 E9 04 99 03 02 -0xED80: 99 07 02 18 69 08 99 0B 02 99 0F 02 A9 02 99 02 -0xED90: 02 A9 82 99 06 02 A9 42 99 0A 02 A9 C2 99 0E 02 -0xEDA0: 60 A9 00 95 24 60 BC E5 06 A9 5B C8 20 B5 E5 C8 -0xEDB0: A9 02 20 B5 E5 88 88 AD AE 03 99 03 02 99 0F 02 -0xEDC0: 18 69 08 99 07 02 99 13 02 18 69 08 99 0B 02 99 -0xEDD0: 17 02 B5 CF AA 48 E0 20 B0 02 A9 F8 20 BE E5 68 -0xEDE0: 18 69 80 AA E0 20 B0 02 A9 F8 99 0C 02 99 10 02 -0xEDF0: 99 14 02 AD D1 03 48 29 08 F0 08 A9 F8 99 00 02 -0xEE00: 99 0C 02 68 48 29 04 F0 08 A9 F8 99 04 02 99 10 -0xEE10: 02 68 29 02 F0 08 A9 F8 99 08 02 99 14 02 A6 08 -0xEE20: 60 A4 B5 88 D0 20 AD D3 03 29 08 D0 19 BC EE 06 -0xEE30: AD B0 03 99 03 02 AD BB 03 99 00 02 A9 74 99 01 -0xEE40: 02 A9 02 99 02 02 60 20 28 C8 18 00 40 50 58 80 -0xEE50: 88 B8 78 60 A0 B0 B8 00 01 02 03 04 05 06 07 08 -0xEE60: 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 -0xEE70: 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 08 -0xEE80: 09 28 29 2A 2B 2C 2D 08 09 0A 0B 0C 30 2C 2D 08 -0xEE90: 09 0A 0B 2E 2F 2C 2D 08 09 28 29 2A 2B 5C 5D 08 -0xEEA0: 09 0A 0B 0C 0D 5E 5F FC FC 08 09 58 59 5A 5A 08 -0xEEB0: 09 28 29 2A 2B 0E 0F FC FC FC FC 32 33 34 35 FC -0xEEC0: FC FC FC 36 37 38 39 FC FC FC FC 3A 37 3B 3C FC -0xEED0: FC FC FC 3D 3E 3F 40 FC FC FC FC 32 41 42 43 FC -0xEEE0: FC FC FC 32 33 44 45 FC FC FC FC 32 33 44 47 FC -0xEEF0: FC FC FC 32 33 48 49 FC FC FC FC 32 33 90 91 FC -0xEF00: FC FC FC 3A 37 92 93 FC FC FC FC 9E 9E 9F 9F FC -0xEF10: FC FC FC 3A 37 4F 4F FC FC 00 01 4C 4D 4E 4E 00 -0xEF20: 01 4C 4D 4A 4A 4B 4B 31 46 AD 9E 07 F0 05 A5 09 -0xEF30: 4A B0 40 A5 0E C9 0B F0 47 AD 0B 07 D0 3C AC 04 -0xEF40: 07 F0 31 A5 1D C9 00 F0 2B 20 34 EF A5 09 29 04 -0xEF50: D0 21 AA AC E4 06 A5 33 4A B0 04 C8 C8 C8 C8 AD -0xEF60: 54 07 F0 09 B9 19 02 CD B5 EE F0 07 E8 BD E7 EE -0xEF70: 99 19 02 60 20 EC EF 4C 45 EF 20 B0 F0 4C 45 EF -0xEF80: A0 0E B9 07 EE 8D D5 06 A9 04 20 BE EF 20 E9 F0 -0xEF90: AD 11 07 F0 25 A0 00 AD 81 07 CD 11 07 8C 11 07 -0xEFA0: B0 18 8D 11 07 A0 07 B9 07 EE 8D D5 06 A0 04 A5 -0xEFB0: 57 05 0C F0 01 88 98 20 BE EF AD D0 03 4A 4A 4A -0xEFC0: 4A 85 00 A2 03 AD E4 06 18 69 18 A8 A9 F8 46 00 -0xEFD0: 90 03 20 C1 E5 98 38 E9 08 A8 CA 10 EF 60 58 01 -0xEFE0: 00 60 FF 04 A2 05 BD 9E EF 95 02 CA 10 F8 A2 B8 -0xEFF0: A0 04 20 DC EF AD 26 02 09 40 8D 22 02 60 85 07 -0xF000: AD AD 03 8D 55 07 85 05 AD B8 03 85 02 A5 33 85 -0xF010: 03 AD C4 03 85 04 AE D5 06 AC E4 06 BD 17 EE 85 -0xF020: 00 BD 18 EE 20 B2 EB C6 07 D0 F1 60 A5 1D C9 03 -0xF030: F0 52 C9 02 F0 3E C9 01 D0 11 AD 04 07 D0 51 A0 -0xF040: 06 AD 14 07 D0 22 A0 00 4C 28 F0 A0 06 AD 14 07 -0xF050: D0 16 A0 02 A5 57 05 0C F0 0E AD 00 07 C9 09 90 -0xF060: 1B A5 45 25 33 D0 15 C8 20 91 F0 A9 00 8D 0D 07 -0xF070: B9 07 EE 60 A0 04 20 91 F0 4C 62 F0 A0 04 20 91 -0xF080: F0 4C 68 F0 A0 05 A5 9F F0 DE 20 91 F0 4C 6D F0 -0xF090: A0 01 20 91 F0 AD 82 07 0D 0D 07 D0 0B A5 0A 0A -0xF0A0: B0 06 AD 0D 07 4C D0 F0 A9 03 4C 6F F0 A9 02 85 -0xF0B0: 00 20 62 F0 48 AD 81 07 D0 15 AD 0C 07 8D 81 07 -0xF0C0: AD 0D 07 18 69 01 C5 00 90 02 A9 00 8D 0D 07 68 -0xF0D0: 60 AD 54 07 F0 05 98 18 69 08 A8 60 00 01 00 01 -0xF0E0: 00 01 02 00 01 02 02 00 02 00 02 00 02 00 02 00 -0xF0F0: AC 0D 07 A5 09 29 03 D0 0D C8 C0 0A 90 05 A0 00 -0xF100: 8C 0B 07 8C 0D 07 AD 54 07 D0 0C B9 9C F0 A0 0F -0xF110: 0A 0A 0A 79 07 EE 60 98 18 69 0A AA A0 09 BD 9C -0xF120: F0 D0 02 A0 01 B9 07 EE 60 AC E4 06 A5 0E C9 0B -0xF130: F0 13 AD D5 06 C9 50 F0 1E C9 B8 F0 1A C9 C0 F0 -0xF140: 16 C9 C8 D0 24 B9 12 02 29 3F 99 12 02 B9 16 02 -0xF150: 29 3F 09 40 99 16 02 B9 1A 02 29 3F 99 1A 02 B9 -0xF160: 1E 02 29 3F 09 40 99 1E 02 60 A2 00 A0 00 4C 42 -0xF170: F1 A0 01 20 A8 F1 A0 03 4C 42 F1 A0 00 20 A8 F1 -0xF180: A0 02 20 71 F1 A6 08 60 A0 02 20 A8 F1 A0 06 4C -0xF190: 42 F1 A9 01 A0 01 4C 65 F1 A9 09 A0 04 20 65 F1 -0xF1A0: E8 E8 A9 09 C8 86 00 18 65 00 AA 20 71 F1 A6 08 -0xF1B0: 60 B5 CE 99 B8 03 B5 86 38 ED 1C 07 99 AD 03 60 -0xF1C0: A2 00 A0 00 4C C0 F1 A0 00 20 A8 F1 A0 02 4C C0 -0xF1D0: F1 A0 01 20 A8 F1 A0 03 4C C0 F1 A0 02 20 A8 F1 -0xF1E0: A0 06 4C C0 F1 07 16 0D 8A 18 79 A5 F1 AA 60 A9 -0xF1F0: 01 A0 01 4C BA F1 A9 09 A0 04 86 00 18 65 00 AA -0xF200: 98 48 20 D7 F1 0A 0A 0A 0A 05 00 85 00 68 A8 A5 -0xF210: 00 99 D0 03 A6 08 60 20 F6 F1 4A 4A 4A 4A 85 00 -0xF220: 4C 39 F2 7F 3F 1F 0F 07 03 01 00 80 C0 E0 F0 F8 -0xF230: FC FE FF 07 0F 07 86 04 A0 01 B9 1C 07 38 F5 86 -0xF240: 85 07 B9 1A 07 F5 6D BE F3 F1 C9 00 30 10 BE F4 -0xF250: F1 C9 01 10 09 A9 38 85 06 A9 08 20 6D F2 BD E3 -0xF260: F1 A6 04 C9 00 D0 03 88 10 D0 60 00 08 0C 0E 0F -0xF270: 07 03 01 00 04 00 04 FF 00 86 04 A0 01 B9 37 F2 -0xF280: 38 F5 CE 85 07 A9 01 F5 B5 BE 34 F2 C9 00 30 10 -0xF290: BE 35 F2 C9 01 10 09 A9 20 85 06 A9 04 20 6D F2 -0xF2A0: BD 2B F2 A6 04 C9 00 D0 03 88 10 D1 60 85 05 A5 -0xF2B0: 07 C5 06 B0 0C 4A 4A 4A 29 07 C0 01 B0 02 65 05 -0xF2C0: AA 60 A5 03 4A 4A A5 00 90 0C 99 05 02 A5 01 99 -0xF2D0: 01 02 A9 40 D0 0A 99 01 02 A5 01 99 05 02 A9 00 -0xF2E0: 05 04 99 02 02 99 06 02 A5 02 99 00 02 99 04 02 -0xF2F0: A5 05 99 03 02 18 69 08 99 07 02 A5 02 18 69 08 -0xF300: 85 02 98 18 69 08 A8 E8 E8 60 FF FF FF FF FF FF -0xF310: AD 70 07 D0 04 8D 15 40 60 A9 FF 8D 17 40 A9 0F -0xF320: 8D 15 40 AD C6 07 D0 06 A5 FA C9 01 D0 5D AD B2 -0xF330: 07 D0 23 A5 FA F0 66 8D B2 07 8D C6 07 A9 00 8D -0xF340: 15 40 85 F1 85 F2 85 F3 A9 0F 8D 15 40 A9 2A 8D -0xF350: BB 07 A9 44 D0 11 AD BB 07 C9 24 F0 08 C9 1E F0 -0xF360: F1 C9 18 D0 09 A9 64 A2 84 A0 7F 20 88 F3 CE BB -0xF370: 07 D0 2A A9 00 8D 15 40 AD B2 07 C9 02 D0 05 A9 -0xF380: 00 8D C6 07 A9 00 8D B2 07 F0 12 20 1B F4 20 7C -0xF390: F5 20 67 F6 20 94 F6 A9 00 85 FB 85 FC A9 00 85 -0xF3A0: FF 85 FE 85 FD 85 FA AC C0 07 A5 F4 29 03 F0 07 -0xF3B0: EE C0 07 C0 30 90 06 98 F0 03 CE C0 07 8C 11 40 -0xF3C0: 60 8C 01 40 8E 00 40 60 20 81 F3 A2 00 A8 B9 01 -0xF3D0: FF F0 0B 9D 02 40 B9 00 FF 09 08 9D 03 40 60 8E -0xF3E0: 04 40 8C 05 40 60 20 9F F3 A2 04 D0 E0 A2 08 D0 -0xF3F0: DC 9F 9B 98 96 95 94 92 90 90 9A 97 95 93 92 A9 -0xF400: 40 8D BB 07 A9 62 20 8B F3 A2 99 D0 25 A9 26 D0 -0xF410: 02 A9 18 A2 82 A0 A7 20 88 F3 A9 28 8D BB 07 AD -0xF420: BB 07 C9 25 D0 06 A2 5F A0 F6 D0 08 C9 20 D0 29 -0xF430: A2 48 A0 BC 20 81 F3 D0 20 A9 05 A0 99 D0 04 A9 -0xF440: 0A A0 93 A2 9E 8D BB 07 A9 0C 20 88 F3 AD BB 07 -0xF450: C9 06 D0 05 A9 BB 8D 01 40 D0 60 A4 FF F0 20 84 -0xF460: F1 30 AA 46 FF B0 AA 46 FF B0 D4 46 FF B0 2C 46 -0xF470: FF B0 4A 46 FF B0 7F 46 FF B0 BE 46 FF B0 80 A5 -0xF480: F1 F0 17 30 9A 4A B0 97 4A B0 C2 4A B0 1B 4A B0 -0xF490: 3C 4A B0 67 4A B0 B6 4A B0 48 60 A9 0E 8D BB 07 -0xF4A0: A0 9C A2 9E A9 26 20 88 F3 AC BB 07 B9 B0 F3 8D -0xF4B0: 00 40 C0 06 D0 05 A9 9E 8D 02 40 D0 25 A9 0E A0 -0xF4C0: CB A2 9F 8D BB 07 A9 28 20 88 F3 D0 15 AC BB 07 -0xF4D0: C0 08 D0 09 A9 A0 8D 02 40 A9 9F D0 02 A9 90 8D -0xF4E0: 00 40 CE BB 07 D0 0E A2 00 86 F1 A2 0E 8E 15 40 -0xF4F0: A2 0F 8E 15 40 60 A9 2F 8D BB 07 AD BB 07 4A B0 -0xF500: 10 4A B0 0D 29 02 F0 09 A0 91 A2 9A A9 44 20 88 -0xF510: F3 4C A2 F4 58 02 54 56 4E 44 4C 52 4C 48 3E 36 -0xF520: 3E 36 30 28 4A 50 4A 64 3C 32 3C 32 2C 24 3A 64 -0xF530: 3A 34 2C 22 2C 22 1C 14 14 04 22 24 16 04 24 26 -0xF540: 18 04 26 28 1A 04 28 2A 1C 04 2A 2C 1E 04 2C 2E -0xF550: 20 04 2E 30 22 04 30 32 A9 35 A2 8D D0 04 A9 06 -0xF560: A2 98 8D BD 07 A0 7F A9 42 20 A6 F3 AD BD 07 C9 -0xF570: 30 D0 05 A9 54 8D 06 40 D0 2E A9 20 8D BD 07 A0 -0xF580: 94 A9 5E D0 0B AD BD 07 C9 18 D0 1C A0 93 A9 18 -0xF590: D0 7F A9 36 8D BD 07 AD BD 07 4A B0 0B A8 B9 D9 -0xF5A0: F4 A2 5D A0 7F 20 A6 F3 CE BD 07 D0 0E A2 00 86 -0xF5B0: F2 A2 0D 8E 15 40 A2 0F 8E 15 40 60 A5 F2 29 40 -0xF5C0: D0 65 A4 FE F0 20 84 F2 30 3E 46 FE B0 8A 46 FE -0xF5D0: B0 6A 46 FE B0 6A 46 FE B0 A0 46 FE B0 80 46 FE -0xF5E0: B0 B0 46 FE B0 3C A5 F2 F0 17 30 27 4A B0 13 4A -0xF5F0: B0 5D 4A B0 5A 4A B0 8D 4A B0 07 4A B0 99 4A B0 -0xF600: 26 60 4C 2C F5 4C 68 F5 A9 38 8D BD 07 A0 C4 A9 -0xF610: 18 D0 0B AD BD 07 C9 08 D0 8E A0 A4 A9 5A A2 9F -0xF620: D0 83 A9 30 8D BD 07 AD BD 07 A2 03 4A B0 D6 CA -0xF630: D0 FA A8 B9 D3 F4 A2 82 A0 7F D0 E4 A9 10 D0 02 -0xF640: A9 20 8D BD 07 A9 7F 8D 05 40 A9 00 8D BE 07 EE -0xF650: BE 07 AD BE 07 4A A8 CC BD 07 F0 0C A9 9D 8D 04 -0xF660: 40 B9 F8 F4 20 A9 F3 60 4C 6D F5 01 0E 0E 0D 0B -0xF670: 06 0C 0F 0A 09 03 0D 08 0D 06 0C A9 20 8D BF 07 -0xF680: AD BF 07 4A 90 12 A8 BE 2B F6 B9 EA FF 8D 0C 40 -0xF690: 8E 0E 40 A9 18 8D 0F 40 CE BF 07 D0 09 A9 F0 8D -0xF6A0: 0C 40 A9 00 85 F3 60 A4 FD F0 0A 84 F3 46 FD B0 -0xF6B0: CA 46 FD B0 0B A5 F3 F0 06 4A B0 C4 4A B0 06 60 -0xF6C0: A9 40 8D BF 07 AD BF 07 4A A8 A2 0F B9 C9 FF D0 -0xF6D0: BC 4C 3A F7 A5 FC D0 0C A5 FB D0 2C AD B1 07 05 -0xF6E0: F4 D0 EE 60 8D B1 07 C9 01 D0 06 20 A7 F4 20 71 -0xF6F0: F5 A6 F4 8E C5 07 A0 00 8C C4 07 84 F4 C9 40 D0 -0xF700: 30 A2 08 8E C4 07 D0 29 C9 04 D0 03 20 A7 F4 A0 -0xF710: 10 8C C7 07 A0 00 8C B1 07 85 F4 C9 01 D0 0E EE -0xF720: C7 07 AC C7 07 C0 32 D0 0C A0 11 D0 E4 A0 08 84 -0xF730: F7 C8 4A 90 FC B9 0C F9 A8 B9 0D F9 85 F0 B9 0E -0xF740: F9 85 F5 B9 0F F9 85 F6 B9 10 F9 85 F9 B9 11 F9 -0xF750: 85 F8 B9 12 F9 8D B0 07 8D C1 07 A9 01 8D B4 07 -0xF760: 8D B6 07 8D B9 07 8D BA 07 A9 00 85 F7 8D CA 07 -0xF770: A9 0B 8D 15 40 A9 0F 8D 15 40 CE B4 07 D0 5F A4 -0xF780: F7 E6 F7 B1 F5 F0 04 10 3D D0 2F AD B1 07 C9 40 -0xF790: D0 05 AD C5 07 D0 1D 29 04 D0 1C A5 F4 29 5F D0 -0xF7A0: 13 A9 00 85 F4 8D B1 07 8D 08 40 A9 90 8D 00 40 -0xF7B0: 8D 04 40 60 4C D4 F6 4C A4 F6 20 CB F8 8D B3 07 -0xF7C0: A4 F7 E6 F7 B1 F5 A6 F2 D0 0E 20 A9 F3 F0 03 20 -0xF7D0: D8 F8 8D B5 07 20 9F F3 AD B3 07 8D B4 07 A5 F2 -0xF7E0: D0 1A AD B1 07 29 91 D0 13 AC B5 07 F0 03 CE B5 -0xF7F0: 07 20 F4 F8 8D 04 40 A2 7F 8E 05 40 A4 F8 F0 5A -0xF800: CE B6 07 D0 32 A4 F8 E6 F8 B1 F5 D0 0F A9 83 8D -0xF810: 00 40 A9 94 8D 01 40 8D CA 07 D0 E9 20 C5 F8 8D -0xF820: B6 07 A4 F1 D0 34 8A 29 3E 20 8B F3 F0 03 20 D8 -0xF830: F8 8D B7 07 20 81 F3 A5 F1 D0 1F AD B1 07 29 91 -0xF840: D0 0E AC B7 07 F0 03 CE B7 07 20 F4 F8 8D 00 40 -0xF850: AD CA 07 D0 02 A9 7F 8D 01 40 A5 F9 CE B9 07 D0 -0xF860: 4C A4 F9 E6 F9 B1 F5 F0 41 10 13 20 CB F8 8D B8 -0xF870: 07 A9 1F 8D 08 40 A4 F9 E6 F9 B1 F5 F0 2C 20 AD -0xF880: F3 AE B8 07 8E B9 07 AD B1 07 29 6E D0 06 A5 F4 -0xF890: 29 0A F0 19 8A C9 12 B0 0F AD B1 07 29 08 F0 04 -0xF8A0: A9 0F D0 06 A9 1F D0 02 A9 FF 8D 08 40 A5 F4 29 -0xF8B0: F3 F0 51 CE BA 07 D0 4C AC B0 07 EE B0 07 B1 F5 -0xF8C0: D0 08 AD C1 07 8D B0 07 D0 EE 20 C5 F8 8D BA 07 -0xF8D0: 8A 29 3E F0 24 C9 30 F0 18 C9 20 F0 0C 29 10 F0 -0xF8E0: 18 A9 1C A2 03 A0 18 D0 12 A9 1C A2 0C A0 18 D0 -0xF8F0: 0A A9 1C A2 03 A0 58 D0 02 A9 10 8D 0C 40 8E 0E -0xF900: 40 8C 0F 40 60 AA 6A 8A 2A 2A 2A 29 07 18 65 F0 -0xF910: 6D C4 07 A8 B9 66 FF 60 AD B1 07 29 08 F0 04 A9 -0xF920: 04 D0 0C A5 F4 29 7D F0 04 A9 08 D0 02 A9 28 A2 -0xF930: 82 A0 7F 60 AD B1 07 29 08 F0 04 B9 96 FF 60 A5 -0xF940: F4 29 7D F0 04 B9 9A FF 60 B9 A2 FF 60 A5 59 54 -0xF950: 64 59 3C 31 4B 69 5E 46 4F 36 8D 36 4B 8D 69 69 -0xF960: 6F 75 6F 7B 6F 75 6F 7B 81 87 81 8D 69 69 93 99 -0xF970: 93 9F 93 99 93 9F 81 87 81 8D 93 99 93 9F 08 72 -0xF980: FC 27 18 20 B8 F9 2E 1A 40 20 B0 FC 3D 21 20 C4 -0xF990: FC 3F 1D 18 11 FD 00 00 08 1C FA 00 00 A4 FB 93 -0xF9A0: 62 10 C8 FE 24 14 18 45 FC 1E 14 08 52 FD A0 70 -0xF9B0: 68 08 51 FE 4C 24 18 01 FA 2D 1C B8 18 49 FA 20 -0xF9C0: 12 70 18 75 FA 1B 10 44 18 9D FA 11 0A 1C 18 C2 -0xF9D0: FA 2D 10 58 18 DB FA 14 0D 3F 18 F9 FA 15 0D 21 -0xF9E0: 18 25 FB 18 10 7A 18 4B FB 19 0F 54 18 74 FB 1E -0xF9F0: 12 2B 18 72 FB 1E 0F 2D 84 2C 2C 2C 82 04 2C 04 -0xFA00: 85 2C 84 2C 2C 2A 2A 2A 82 04 2A 04 85 2A 84 2A -0xFA10: 2A 00 1F 1F 1F 98 1F 1F 98 9E 98 1F 1D 1D 1D 94 -0xFA20: 1D 1D 94 9C 94 1D 86 18 85 26 30 84 04 26 30 86 -0xFA30: 14 85 22 2C 84 04 22 2C 21 D0 C4 D0 31 D0 C4 D0 -0xFA40: 00 85 2C 22 1C 84 26 2A 82 28 26 04 87 22 34 3A -0xFA50: 82 40 04 36 84 3A 34 82 2C 30 85 2A 00 5D 55 4D -0xFA60: 15 19 96 15 D5 E3 EB 2D A6 2B 27 9C 9E 59 85 22 -0xFA70: 1C 14 84 1E 22 82 20 1E 04 87 1C 2C 34 82 36 04 -0xFA80: 30 34 04 2C 04 26 2A 85 22 84 04 82 3A 38 36 32 -0xFA90: 04 34 04 24 26 2C 04 26 2C 30 00 05 B4 B2 B0 2B -0xFAA0: AC 84 9C 9E A2 84 94 9C 9E 85 14 22 84 2C 85 1E -0xFAB0: 82 2C 84 2C 1E 84 04 82 3A 38 36 32 04 34 04 64 -0xFAC0: 04 64 86 64 00 05 B4 B2 B0 2B AC 84 37 B6 B6 45 -0xFAD0: 85 14 1C 82 22 84 2C 4E 82 4E 84 4E 22 84 04 85 -0xFAE0: 32 85 30 86 2C 04 00 05 A4 05 9E 05 9D 85 84 14 -0xFAF0: 85 24 28 2C 82 22 84 22 14 21 D0 C4 D0 31 D0 C4 -0xFB00: D0 00 82 2C 84 2C 2C 82 2C 30 04 34 2C 04 26 86 -0xFB10: 22 00 A4 25 25 A4 29 A2 1D 9C 95 82 2C 2C 04 2C -0xFB20: 04 2C 30 85 34 04 04 00 A4 25 25 A4 A8 63 04 85 -0xFB30: 0E 1A 84 24 85 22 14 84 0C 82 34 84 34 34 82 2C -0xFB40: 84 34 86 3A 04 00 A0 21 21 A0 21 2B 05 A3 82 18 -0xFB50: 84 18 18 82 18 18 04 86 3A 22 31 90 31 90 31 71 -0xFB60: 31 90 90 90 00 82 34 84 2C 85 22 84 24 82 26 36 -0xFB70: 04 36 86 26 00 AC 27 5D 1D 9E 2D AC 9F 85 14 82 -0xFB80: 20 84 22 2C 1E 1E 82 2C 2C 1E 04 87 2A 40 40 40 -0xFB90: 3A 36 82 34 2C 04 26 86 22 00 E3 F7 F7 F7 F5 F1 -0xFBA0: AC 27 9E 9D 85 18 82 1E 84 22 2A 22 22 82 2C 2C -0xFBB0: 22 04 86 04 82 2A 36 04 36 87 36 34 30 86 2C 04 -0xFBC0: 00 00 68 6A 6C 45 A2 31 B0 F1 ED EB A2 1D 9C 95 -0xFBD0: 86 04 85 22 82 22 87 22 26 2A 84 2C 22 86 14 51 -0xFBE0: 90 31 11 00 80 22 28 22 26 22 24 22 26 22 28 22 -0xFBF0: 2A 22 28 22 26 22 28 22 26 22 24 22 26 22 28 22 -0xFC00: 2A 22 28 22 26 20 26 20 24 20 26 20 28 20 26 20 -0xFC10: 28 20 26 20 24 20 26 20 24 20 26 20 28 20 26 20 -0xFC20: 28 20 26 20 24 28 30 28 32 28 30 28 2E 28 30 28 -0xFC30: 2E 28 2C 28 2E 28 30 28 32 28 30 28 2E 28 30 28 -0xFC40: 2E 28 2C 28 2E 00 04 70 6E 6C 6E 70 72 70 6E 70 -0xFC50: 6E 6C 6E 70 72 70 6E 6E 6C 6E 70 6E 70 6E 6C 6E -0xFC60: 6C 6E 70 6E 70 6E 6C 76 78 76 74 76 74 72 74 76 -0xFC70: 78 76 74 76 74 72 74 84 1A 83 18 20 84 1E 83 1C -0xFC80: 28 26 1C 1A 1C 82 2C 04 04 22 04 04 84 1C 87 26 -0xFC90: 2A 26 84 24 28 24 80 22 00 9C 05 94 05 0D 9F 1E -0xFCA0: 9C 98 9D 82 22 04 04 1C 04 04 84 14 86 1E 80 16 -0xFCB0: 80 14 81 1C 30 04 30 30 04 1E 32 04 32 32 04 20 -0xFCC0: 34 04 34 34 04 36 04 84 36 00 46 A4 64 A4 48 A6 -0xFCD0: 66 A6 4A A8 68 A8 6A 44 2B 81 2A 42 04 42 42 04 -0xFCE0: 2C 64 04 64 64 04 2E 46 04 46 46 04 22 04 84 22 -0xFCF0: 87 04 06 0C 14 1C 22 86 2C 22 87 04 60 0E 14 1A -0xFD00: 24 86 2C 24 87 04 08 10 18 1E 28 86 30 30 80 64 -0xFD10: 00 CD D5 DD E3 ED F5 BB B5 CF D5 DB E5 ED F3 BD -0xFD20: B3 D1 D9 DF E9 F1 F7 BF FF FF FF 34 00 86 04 87 -0xFD30: 14 1C 22 86 34 84 2C 04 04 04 87 14 1A 24 86 32 -0xFD40: 84 2C 04 86 04 87 18 1E 28 86 36 87 30 30 30 80 -0xFD50: 2C 82 14 2C 62 26 10 28 80 04 82 14 2C 62 26 10 -0xFD60: 28 80 04 82 08 1E 5E 18 60 1A 80 04 82 08 1E 5E -0xFD70: 18 60 1A 86 04 83 1A 18 16 84 14 1A 18 0E 0C 16 -0xFD80: 83 14 20 1E 1C 28 26 87 24 1A 12 10 62 0E 80 04 -0xFD90: 04 00 82 18 1C 20 22 26 28 81 2A 2A 2A 04 2A 04 -0xFDA0: 83 2A 82 22 86 34 32 34 81 04 22 26 2A 2C 30 86 -0xFDB0: 34 83 32 82 36 84 34 85 04 81 22 86 30 2E 30 81 -0xFDC0: 04 22 26 2A 2C 2E 86 30 83 22 82 36 84 34 85 04 -0xFDD0: 81 22 86 3A 3A 3A 82 3A 81 40 82 04 81 3A 86 36 -0xFDE0: 36 36 82 36 81 3A 82 04 81 36 86 34 82 26 2A 36 -0xFDF0: 81 34 34 85 34 81 2A 86 2C 00 84 90 B0 84 50 50 -0xFE00: B0 00 98 96 94 92 94 96 58 58 58 44 5C 44 9F A3 -0xFE10: A1 A3 85 A3 E0 A6 23 C4 9F 9D 9F 85 9F D2 A6 23 -0xFE20: C4 B5 B1 AF 85 B1 AF AD 85 95 9E A2 AA 6A 6A 6B -0xFE30: 5E 9D 84 04 04 82 22 86 22 82 14 22 2C 12 22 2A -0xFE40: 14 22 2C 1C 22 2C 14 22 2C 12 22 2A 14 22 2C 1C -0xFE50: 22 2C 18 22 2A 16 20 28 18 22 2A 12 22 2A 18 22 -0xFE60: 2A 12 22 2A 14 22 2C 0C 22 2C 14 22 34 12 22 30 -0xFE70: 10 22 2E 16 22 34 18 26 36 16 26 36 14 26 36 12 -0xFE80: 22 36 5C 22 34 0C 22 22 81 1E 1E 85 1E 81 12 86 -0xFE90: 14 81 2C 22 1C 2C 22 1C 85 2C 04 81 2E 24 1E 2E -0xFEA0: 24 1E 85 2E 04 81 32 28 22 32 28 22 85 32 87 36 -0xFEB0: 36 36 84 3A 00 5C 54 4C 5C 54 4C 5C 1C 1C 5C 5C -0xFEC0: 5C 5C 5E 56 4E 5E 56 4E 5E 1E 1E 5E 5E 5E 5E 62 -0xFED0: 5A 50 62 5A 50 62 22 22 62 E7 E7 E7 2B 86 14 81 -0xFEE0: 14 80 14 14 81 14 14 14 14 86 16 81 16 80 16 16 -0xFEF0: 81 16 16 16 16 81 28 22 1A 28 22 1A 28 80 28 28 -0xFF00: 81 28 87 2C 2C 2C 84 30 83 04 84 0C 83 62 10 84 -0xFF10: 12 83 1C 22 1E 22 26 18 1E 04 1C 00 E3 E1 E3 1D -0xFF20: DE E0 23 EC 75 74 F0 F4 F6 EA 31 2D 83 12 14 04 -0xFF30: 18 1A 1C 14 26 22 1E 1C 18 1E 22 0C 14 FF FF FF -0xFF40: 00 88 00 2F 00 00 02 A6 02 80 02 5C 02 3A 02 1A -0xFF50: 01 DF 01 C4 01 AB 01 93 01 7C 01 67 01 53 01 40 -0xFF60: 01 2E 01 1D 01 0D 00 FE 00 EF 00 E2 00 D5 00 C9 -0xFF70: 00 BE 00 B3 00 A9 00 A0 00 97 00 8E 00 86 00 77 -0xFF80: 00 7E 00 71 00 54 00 64 00 5F 00 59 00 50 00 47 -0xFF90: 00 43 00 3B 00 35 00 2A 00 23 04 75 03 57 02 F9 -0xFFA0: 02 CF 01 FC 00 6A 05 0A 14 28 50 1E 3C 02 04 08 -0xFFB0: 10 20 40 18 30 0C 03 06 0C 18 30 12 24 08 36 03 -0xFFC0: 09 06 12 1B 24 0C 24 02 06 04 0C 12 18 08 12 01 -0xFFD0: 03 02 06 09 0C 04 98 99 9A 9B 90 94 94 95 95 96 -0xFFE0: 97 98 90 91 92 92 93 93 93 94 94 94 94 94 94 95 -0xFFF0: 95 95 95 95 95 96 96 96 96 96 96 96 96 96 96 diff --git a/src/audio.rs b/src/audio.rs index 1fde837..b3e0946 100644 --- a/src/audio.rs +++ b/src/audio.rs @@ -1,6 +1,6 @@ extern crate sdl2; -use sdl2::audio::{AudioCallback, AudioSpecDesired}; +use sdl2::audio::AudioSpecDesired; pub fn initialize(context: &sdl2::Sdl) -> Result, String> { let audio_subsystem = context.audio()?; diff --git a/src/cpu/mod.rs b/src/cpu/mod.rs index c6773ba..02b50d6 100644 --- a/src/cpu/mod.rs +++ b/src/cpu/mod.rs @@ -83,8 +83,6 @@ pub struct Cpu { pub strobe: u8, pub button_states: u8, // Player 1 controller button_number: u8, - - more: usize, } impl Cpu { @@ -104,7 +102,6 @@ impl Cpu { strobe: 0, button_states: 0, button_number: 0, - more: 0, opcode_table: vec![ // 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F /*00*/ Cpu::brk, Cpu::ora, Cpu::bad, Cpu::slo, Cpu::nop, Cpu::ora, Cpu::asl, Cpu::slo, Cpu::php, Cpu::ora, Cpu::asl, Cpu::nop, Cpu::nop, Cpu::ora, Cpu::asl, Cpu::slo, /*00*/ @@ -172,46 +169,9 @@ impl Cpu { // get addressing mode let mode = self.mode_table[opcode].clone(); - let (address_func, num_bytes) = mode.get(); + let (address_func, _num_bytes) = mode.get(); let address = address_func(self); - - // debugging - // assert!(self.memory_at(0xAD79, 141) == UNDERGROUND_LEVEL.to_vec() && self.memory_at(0xA133, 45) == UNDERGROUND_ENEMIES.to_vec()); - // let pc = self.PC; - // if address == 0x06D6 { - // // let mem = self.memory_at(0xAD79, 141); - // // println!("memory at 0xAD79: {:02X?}", mem); - // println!("===========================\n0x{:04X} {:?}", address, mode); - // if self.more == 0 { - // self.more += 24; - // } - // } - // if pc == 0xB1E5 { - // println!("==========================="); - // if self.more == 0 { - // self.more += 24; - // } - // } - // if self.more > 0 { - // let operands = match num_bytes { - // 1 => " ".to_string(), - // 2 => format!("{:02X} ", self.read(pc + 1)), - // 3 => format!("{:02X} {:02X}", self.read(pc + 1), self.read(pc+2)), - // _ => "error".to_string(), - // }; - // print!("{:04X} {:02X} {} {} A:{:02X} X:{:02X} Y:{:02X} P:{:02X} SP:{:02X}", - // pc, self.read(pc), operands, OPCODE_DISPLAY_NAMES[opcode], - // self.A, self.X, self.Y, self.P, self.S, - // ); - // // let mut zpg = Vec::::new(); - // // for i in 0..32 { - // // zpg.push(self.read(i)); - // // } - // // print!(" zpg: {:x?}", zpg); - // print!("\n"); - // self.more -= 1; - // } - + // self._debug(_num_bytes, opcode); // advance program counter according to how many bytes that instruction operated on self.advance_pc(mode); // look up instruction in table and execute @@ -221,14 +181,6 @@ impl Cpu { self.clock - clock } - pub fn memory_at(&mut self, address: usize, amount: usize) -> Vec { - let mut ret = vec![]; - for i in 0..amount { - ret.push(self.read(address+i)); - } - ret - } - // memory interface pub fn read(&mut self, address: usize) -> u8 { let val = match address { @@ -249,23 +201,6 @@ impl Cpu { // memory interface fn write(&mut self, address: usize, val: u8) { - // if address == 0x06D6 { - // println!("writing 0x{:02X} to 0x{:04X}", val, address); - // } - - let vars = vec![ - ("PlayerEntranceCtrl", 0x0710), - ("AltEntranceControl", 0x0752), - ("EntrancePage", 0x0751), - ("AreaPointer", 0x0750), - ("AreaAddrsLOffset", 0x074f), - ]; - for i in vars.iter() { - if i.1 == address { - println!("writing 0x{:02X} to {}", val, i.0); - } - } - match address { 0x0000..=0x1FFF => self.mem[address % 0x0800] = val, 0x2000..=0x3FFF => self.write_ppu_reg(address % 8, val), @@ -336,8 +271,28 @@ impl Cpu { } } -} + fn _debug(&mut self, num_bytes: usize, opcode: usize) { + let pc = self.PC; + let operands = match num_bytes { + 1 => " ".to_string(), + 2 => format!("{:02X} ", self.read(pc + 1)), + 3 => format!("{:02X} {:02X}", self.read(pc + 1), self.read(pc+2)), + _ => "error".to_string(), + }; + println!("{:04X} {:02X} {} {} A:{:02X} X:{:02X} Y:{:02X} P:{:02X} SP:{:02X}", + pc, self.read(pc), operands, _OPCODE_DISPLAY_NAMES[opcode], + self.A, self.X, self.Y, self.P, self.S, + ); + } + pub fn _memory_at(&mut self, address: usize, amount: usize) -> Vec { + let mut ret = vec![]; + for i in 0..amount { + ret.push(self.read(address+i)); + } + ret + } +} /* Address range Size Device @@ -353,7 +308,7 @@ $4020-$FFFF $BFE0 Cartridge space: PRG ROM, PRG RAM, and mapper registers (See */ // For debug output -const OPCODE_DISPLAY_NAMES: [&str; 256] = [ +const _OPCODE_DISPLAY_NAMES: [&str; 256] = [ "BRK", "ORA", "BAD", "SLO", "NOP", "ORA", "ASL", "SLO", "PHP", "ORA", "ASL", "ANC", "NOP", "ORA", "ASL", "SLO", "BPL", "ORA", "BAD", "SLO", "NOP", "ORA", "ASL", "SLO", @@ -387,21 +342,3 @@ const OPCODE_DISPLAY_NAMES: [&str; 256] = [ "BEQ", "SBC", "BAD", "ISC", "NOP", "SBC", "INC", "ISC", "SED", "SBC", "NOP", "ISC", "NOP", "SBC", "INC", "ISC", ]; - -// const UNDERGROUND_LEVEL: [u8; 141] = [ -// 0x48, 0x01, 0x0e, 0x01, 0x00, 0x5a, 0x3e, 0x06, 0x45, 0x46, 0x47, 0x46, 0x53, 0x44, 0xae, 0x01, -// 0xdf, 0x4a, 0x4d, 0xc7, 0x0e, 0x81, 0x00, 0x5a, 0x2e, 0x04, 0x37, 0x28, 0x3a, 0x48, 0x46, 0x47, -// 0xc7, 0x07, 0xce, 0x0f, 0xdf, 0x4a, 0x4d, 0xc7, 0x0e, 0x81, 0x00, 0x5a, 0x33, 0x53, 0x43, 0x51, -// 0x46, 0x40, 0x47, 0x50, 0x53, 0x04, 0x55, 0x40, 0x56, 0x50, 0x62, 0x43, 0x64, 0x40, 0x65, 0x50, -// 0x71, 0x41, 0x73, 0x51, 0x83, 0x51, 0x94, 0x40, 0x95, 0x50, 0xa3, 0x50, 0xa5, 0x40, 0xa6, 0x50, -// 0xb3, 0x51, 0xb6, 0x40, 0xb7, 0x50, 0xc3, 0x53, 0xdf, 0x4a, 0x4d, 0xc7, 0x0e, 0x81, 0x00, 0x5a, -// 0x2e, 0x02, 0x36, 0x47, 0x37, 0x52, 0x3a, 0x49, 0x47, 0x25, 0xa7, 0x52, 0xd7, 0x04, 0xdf, 0x4a, -// 0x4d, 0xc7, 0x0e, 0x81, 0x00, 0x5a, 0x3e, 0x02, 0x44, 0x51, 0x53, 0x44, 0x54, 0x44, 0x55, 0x24, -// 0xa1, 0x54, 0xae, 0x01, 0xb4, 0x21, 0xdf, 0x4a, 0xe5, 0x07, 0x4d, 0xc7, 0xfd, -// ]; - -// const UNDERGROUND_ENEMIES: [u8; 45] = [ -// 0x1e, 0xa5, 0x0a, 0x2e, 0x28, 0x27, 0x2e, 0x33, 0xc7, 0x0f, 0x03, 0x1e, 0x40, 0x07, 0x2e, 0x30, -// 0xe7, 0x0f, 0x05, 0x1e, 0x24, 0x44, 0x0f, 0x07, 0x1e, 0x22, 0x6a, 0x2e, 0x23, 0xab, 0x0f, 0x09, -// 0x1e, 0x41, 0x68, 0x1e, 0x2a, 0x8a, 0x2e, 0x23, 0xa2, 0x2e, 0x32, 0xea, 0xff, -// ]; diff --git a/src/cpu/opcodes.rs b/src/cpu/opcodes.rs index 076dbd3..2674c83 100644 --- a/src/cpu/opcodes.rs +++ b/src/cpu/opcodes.rs @@ -119,8 +119,19 @@ impl super::Cpu { } pub fn brk(&mut self, _address: usize, _mode: Mode) { - self.push((self.PC >> 8) as u8); // push high byte - self.push((self.PC & 0xFF) as u8); // push low byte + // instr_test-v5/rom_singles/15-brk.nes and instr_test-v5/rom_singles/16-special.nes: + // using self.PC + 1 in these next two lines allows these tests to pass. + // I'm not sure why that's necessary as implied addressing mode is only supposed to consume 1 byte, + // but the error message from 16-special.nes said "BRK should push address BRK + 2" + + // Aha! From http://nesdev.com/the%20%27B%27%20flag%20&%20BRK%20instruction.txt: + // Regardless of what ANY 6502 documentation says, BRK is a 2 byte opcode. The + // first is #$00, and the second is a padding byte. This explains why interrupt + // routines called by BRK always return 2 bytes after the actual BRK opcode, + // and not just 1. + + self.push(((self.PC + 1) >> 8) as u8); // push high byte + self.push(((self.PC + 1) & 0xFF) as u8); // push low byte self.push(self.P | 0b00110000); // push status register with break bits set self.P |= INTERRUPT_DISABLE_FLAG; // set interrupt disable flag self.PC = ((self.read(IRQ_VECTOR + 1) as usize) << 8) // set program counter to IRQ/BRK vector, taking high byte @@ -326,24 +337,25 @@ impl super::Cpu { pub fn plp(&mut self, _address: usize, _mode: Mode) { self.clock += 2; - let status = self.pop(); - // for each bit in the popped status, if it's 1, - // set that bit of self.P to 1. if it's 0, set that - // bit of self.P to 0. - for i in 0..=7 { - if i == 4 || i == 5 { - continue; // ignore B flags - } - let bit = if status & (1 << i) == 0 {0} else {1}; - if bit != 0 { - self.P |= 1 << i; - } else { - self.P &= 0xFF - (1 << i); - } - } - - self.P |= 1 << 5; // turn on bit 5 - self.P &= 0xFF - (1 << 4); // and turn off bit 4 because god knows why + self.P = self.pop(); + // TODO: figure out exactly what's supposed to happen here + // let status = self.pop(); + // // for each bit in the popped status, if it's 1, + // // set that bit of self.P to 1. if it's 0, set that + // // bit of self.P to 0. + // for i in 0..=7 { + // if i == 4 || i == 5 { + // continue; // ignore B flags + // } + // let bit = if status & (1 << i) == 0 {0} else {1}; + // if bit != 0 { + // self.P |= 1 << i; + // } else { + // self.P &= 0xFF - (1 << i); + // } + // } + // self.P |= 1 << 5; // turn on bit 5 + // self.P &= 0xFF - (1 << 4); // and turn off bit 4 because god knows why } pub fn rla(&mut self, _address: usize, _mode: Mode) { diff --git a/src/cpu/utility.rs b/src/cpu/utility.rs index 7d37d76..a716043 100644 --- a/src/cpu/utility.rs +++ b/src/cpu/utility.rs @@ -27,8 +27,10 @@ impl super::Cpu { self.PC += decoded_offset; }, false => { - let decoded_offset = (-offset) as usize; - self.PC -= decoded_offset; + // instr_test-v5/rom_singles/11-stack.nes: + // letting decoded_offset be (-offset) as usize was allowing for overflow if offset was -128/0b10000000 + let decoded_offset = (-offset) as u8; + self.PC -= decoded_offset as usize; }, } } @@ -46,7 +48,7 @@ impl super::Cpu { } pub fn branch(&mut self, unsigned_offset: u8) { - let offset: i8 = u8_to_i8(unsigned_offset); + let offset = unsigned_offset as i8; self.clock += 1; let old_addr = self.PC; self.add_offset_to_pc(offset); @@ -93,7 +95,3 @@ impl super::Cpu { } } - -pub fn u8_to_i8(offset: u8) -> i8 { - unsafe { std::mem::transmute(offset) } -} diff --git a/src/main.rs b/src/main.rs index 90cc9ef..bc072b7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,28 +50,6 @@ fn main() -> Result<(), String> { let mut fps = 0; let mut sps = 0; - // TODO: remove - // check for location of VerticalPipeEntry - // println!("verticalPipeEntry: {:02X?}", cpu.memory_at(0xB225, 512)); - // why not just dump all memory? - // let mut mem = cpu.memory_at(0, 0x4020); - // let mut mem2 = cpu.memory_at(0x8000, 0xFFFF-0x8000); - // mem.append(&mut mem2); - // let mut line = 0; - // for i in 0..0x4020 { - // if i % 0x10 == 0 { - // print!("\n0x{:04X}: ", i); - // } - // print!("{:02X} ", mem[i]); - // } - // println!("\n========================="); - // for i in 0x8000..=0xFFFF { - // if i % 0x10 == 0 { - // print!("\n0x{:04X}: ", i); - // } - // print!("{:02X} ", mem[i-0x4020]); - // } - // PROFILER.lock().unwrap().start("./main.profile").unwrap(); 'running: loop { // step CPU: perform 1 cpu instruction, getting back number of clock cycles it took @@ -130,11 +108,11 @@ fn main() -> Result<(), String> { // calculate fps let now = Instant::now(); if now > fps_timer + Duration::from_secs(1) { - // println!("fps: {}", fps); + println!("fps: {}", fps); fps = 0; fps_timer = now; - // println!("samples per second: {}", sps); + println!("samples per second: {}", sps); sps = 0; } @@ -144,12 +122,12 @@ fn main() -> Result<(), String> { } /* + TODO: +- common mappers - DMC audio channel, high- and low-pass filters, refactor envelope - name audio variables (dividers, counters, etc.) more consistently -- common mappers - battery-backed RAM solution -- fix mysterious Mario pipe non-locations - GUI? drag and drop ROMs? - reset function - save/load/pause functionality @@ -161,56 +139,14 @@ The SDL audio device samples/outputs at 44,100Hz, so as long as the APU queues u But it's not doing so evenly. If PPU runs faster than 60Hz, audio will get skipped, and if slower, audio will pop/have gaps. Need to probably lock everything to the APU but worried about checking time that often. Can do for some division of 44_100. -Nowhere room debugging: -Do we want to detect every time WarpZoneControl is accessed and log a buffer before and after it? -Or is the problem not with loading WZC but writing it? Good and bad logs match when entering the pipe. -The subroutine that accesses $06D6 is HandlePipeEntry. That's only called by ChkFootMTile->DoFootCheck->ChkCollSize->PlayerBGCollision->PlayerCtrlRoutine. -PlayerCtrlRoutine is called by PlayerInjuryBlink and PlayerDeath, and all three of those are called by GameRoutines engine. -So the normal physics loop checks for pipe entry every so often. So need to find out how HandlePipeEntry determines where to send you, -and what puts you in the room. +Failed tests from instr_test-v5/rom_singles/: +3, immediate, Failed. Just unofficial instructions? + 0B AAC #n + 2B AAC #n + 4B ASR #n + 6B ARR #n + AB ATX #n + CB AXS #n +7, abs_xy, 'illegal opcode using abs x: 9c' -Functions that write to WarpZoneControl: -WarpZoneObject<-RunEnemyObjectsCore<-EnemiesAndLoopsCore<-VictoryMode/GameEngine -ScrollLockObject_Warp<-DecodeAreaData<-ProcessAreaData<- - -Is ParseRow0e a clue? - -I think L_UndergroundArea3 is the data for the coin rooms. Need to verify that it's loaded properly. -It's at 0x2D89 in the ROM, so 0x2D79 without header. Which means it's in PRG ROM, because it's within the first 0x4000, -in the first PRG chunk/vec given to CPU by cartridge. Because it's NROM, that will be mapped starting at $8000, -so its position in memory should be 0x8000 + 0x2D79 = 0xAD79. - -L_UndergroundArea3 is indeed at 0xAD79 and correct in both good emulator and mine. So need to detect its use? Verified that -it's not changed, neither is E_UndergroundArea3 which is at $A133. WarpZoneControl is also set properly: 0 for a while, then -1 when running over exit in 2-1 to Warp Zone, then 4 once dropped down into the WarpZone. 0 when going into any coin rooms. - -HandlePipeEntry queues VerticalPipeEntry: - sta GameEngineSubroutine ;set to run vertical pipe entry routine on next frame -Then it checks WarpZoneControl and branches to rts if : - lda WarpZoneControl ;check warp zone control - beq ExPipeE ;branch to leave if none found - [...] - ExPipeE: rts ;leave!!! -So the problem may be in VerticalPipeEntry. Need to hook it. It starts with lda #$01, so looking for lda in immediate mode, which is 0xA9 -followed by jsr then followed by a two byte absolute address we don't know, so 0x20 ?? ??, then jsr another function, so same thing, -then ldy #$00, which is 0xA0 0x00... so now we can grep the rom file for its address and compare to good emulator. - grep -A10 "a9 *01 *20 *.. *.. *20 *.. *.. *a0" - 000031f0 52 07 4c 13 b2 a9 01 20 00 b2 20 93 af a0 00 ad |R.L.... .. .....| -VerticalPipeEntry is at $31F5 in the ROM, so at $B205 in the running emulator. Now need to confirm that and then log starting there. -No, had to do a full memory dump to find out that it's at $B225... Anyway, can now hook there. But hook was wrong. And hooking for address == $06D6 -shows the program counter at 0xB1EF, meaning I was right that the routine's address is 0xB1E5... So my dump was wrong? Or routines move around? Doesn't make sense. -Anyway, hook PC == $B1E5. - -Ok, so, comparing logs with the good emulator down the WORKING pipe in 1-1 shows a divergence in behavior based on loading value 0x6E from $0755 into the accumulator, -and comparing that to 0x50. What's at $0755? Player_Pos_ForScroll, which is just Mario's horizontal position on screen. -And that's the only difference, over and over, so doesn't really matter. -Now need to see what's different when we drop into the bad room. 1200 lines in log from one pipe, -25 lines each (24 and a separator) so 48 iterations of VerticalPipeEntry per pipe. -But logs for VerticalPipeEntry for the bad room also seem to match the good emulator except for the Player_Pos_ForScroll... -Other suspicious variables: -PlayerEntranceCtrl -AltEntranceControl -EntrancePage -AreaPointer -AreaAddrsLOffset */ diff --git a/verticalPipeEntryLog b/verticalPipeEntryLog deleted file mode 100644 index 404fe59..0000000 --- a/verticalPipeEntryLog +++ /dev/null @@ -1,1200 +0,0 @@ -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:71 X:00 Y:08 P:24 SP:F5 -B205 60 RTS A:71 X:00 Y:08 P:24 SP:F5 -B1EA 20 93 AF JSR A:71 X:00 Y:08 P:24 SP:F7 -AF93 AD FF 06 LDA A:71 X:00 Y:08 P:24 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:72 X:00 Y:08 P:24 SP:F5 -B205 60 RTS A:72 X:00 Y:08 P:24 SP:F5 -B1EA 20 93 AF JSR A:72 X:00 Y:08 P:24 SP:F7 -AF93 AD FF 06 LDA A:72 X:00 Y:08 P:24 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:73 X:00 Y:08 P:24 SP:F5 -B205 60 RTS A:73 X:00 Y:08 P:24 SP:F5 -B1EA 20 93 AF JSR A:73 X:00 Y:08 P:24 SP:F7 -AF93 AD FF 06 LDA A:73 X:00 Y:08 P:24 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:74 X:00 Y:08 P:24 SP:F5 -B205 60 RTS A:74 X:00 Y:08 P:24 SP:F5 -B1EA 20 93 AF JSR A:74 X:00 Y:08 P:24 SP:F7 -AF93 AD FF 06 LDA A:74 X:00 Y:08 P:24 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:75 X:00 Y:08 P:24 SP:F5 -B205 60 RTS A:75 X:00 Y:08 P:24 SP:F5 -B1EA 20 93 AF JSR A:75 X:00 Y:08 P:24 SP:F7 -AF93 AD FF 06 LDA A:75 X:00 Y:08 P:24 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:76 X:00 Y:08 P:24 SP:F5 -B205 60 RTS A:76 X:00 Y:08 P:24 SP:F5 -B1EA 20 93 AF JSR A:76 X:00 Y:08 P:24 SP:F7 -AF93 AD FF 06 LDA A:76 X:00 Y:08 P:24 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:77 X:00 Y:08 P:24 SP:F5 -B205 60 RTS A:77 X:00 Y:08 P:24 SP:F5 -B1EA 20 93 AF JSR A:77 X:00 Y:08 P:24 SP:F7 -AF93 AD FF 06 LDA A:77 X:00 Y:08 P:24 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:78 X:00 Y:08 P:24 SP:F5 -B205 60 RTS A:78 X:00 Y:08 P:24 SP:F5 -B1EA 20 93 AF JSR A:78 X:00 Y:08 P:24 SP:F7 -AF93 AD FF 06 LDA A:78 X:00 Y:08 P:24 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:79 X:00 Y:08 P:24 SP:F5 -B205 60 RTS A:79 X:00 Y:08 P:24 SP:F5 -B1EA 20 93 AF JSR A:79 X:00 Y:08 P:24 SP:F7 -AF93 AD FF 06 LDA A:79 X:00 Y:08 P:24 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:7A X:00 Y:08 P:24 SP:F5 -B205 60 RTS A:7A X:00 Y:08 P:24 SP:F5 -B1EA 20 93 AF JSR A:7A X:00 Y:08 P:24 SP:F7 -AF93 AD FF 06 LDA A:7A X:00 Y:08 P:24 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:7B X:00 Y:08 P:24 SP:F5 -B205 60 RTS A:7B X:00 Y:08 P:24 SP:F5 -B1EA 20 93 AF JSR A:7B X:00 Y:08 P:24 SP:F7 -AF93 AD FF 06 LDA A:7B X:00 Y:08 P:24 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:7C X:00 Y:08 P:24 SP:F5 -B205 60 RTS A:7C X:00 Y:08 P:24 SP:F5 -B1EA 20 93 AF JSR A:7C X:00 Y:08 P:24 SP:F7 -AF93 AD FF 06 LDA A:7C X:00 Y:08 P:24 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:7D X:00 Y:08 P:24 SP:F5 -B205 60 RTS A:7D X:00 Y:08 P:24 SP:F5 -B1EA 20 93 AF JSR A:7D X:00 Y:08 P:24 SP:F7 -AF93 AD FF 06 LDA A:7D X:00 Y:08 P:24 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:7E X:00 Y:08 P:24 SP:F5 -B205 60 RTS A:7E X:00 Y:08 P:24 SP:F5 -B1EA 20 93 AF JSR A:7E X:00 Y:08 P:24 SP:F7 -AF93 AD FF 06 LDA A:7E X:00 Y:08 P:24 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:7F X:00 Y:08 P:24 SP:F5 -B205 60 RTS A:7F X:00 Y:08 P:24 SP:F5 -B1EA 20 93 AF JSR A:7F X:00 Y:08 P:24 SP:F7 -AF93 AD FF 06 LDA A:7F X:00 Y:08 P:24 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:80 X:00 Y:08 P:E4 SP:F5 -B205 60 RTS A:80 X:00 Y:08 P:E4 SP:F5 -B1EA 20 93 AF JSR A:80 X:00 Y:08 P:E4 SP:F7 -AF93 AD FF 06 LDA A:80 X:00 Y:08 P:E4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:66 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:66 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:81 X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:81 X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:81 X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:81 X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:82 X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:82 X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:82 X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:82 X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:83 X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:83 X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:83 X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:83 X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:84 X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:84 X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:84 X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:84 X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:85 X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:85 X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:85 X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:85 X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:86 X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:86 X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:86 X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:86 X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:87 X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:87 X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:87 X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:87 X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:88 X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:88 X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:88 X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:88 X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:89 X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:89 X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:89 X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:89 X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:8A X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:8A X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:8A X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:8A X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:8B X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:8B X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:8B X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:8B X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:8C X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:8C X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:8C X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:8C X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:8D X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:8D X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:8D X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:8D X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:8E X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:8E X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:8E X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:8E X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:8F X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:8F X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:8F X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:8F X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:90 X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:90 X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:90 X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:90 X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:91 X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:91 X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:91 X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:91 X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:92 X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:92 X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:92 X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:92 X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:93 X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:93 X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:93 X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:93 X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:94 X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:94 X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:94 X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:94 X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:95 X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:95 X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:95 X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:95 X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:96 X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:96 X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:96 X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:96 X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:97 X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:97 X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:97 X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:97 X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:98 X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:98 X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:98 X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:98 X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:99 X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:99 X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:99 X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:99 X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:9A X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:9A X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:9A X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:9A X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:9B X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:9B X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:9B X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:9B X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:9C X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:9C X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:9C X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:9C X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:9D X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:9D X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:9D X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:9D X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:9E X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:9E X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:9E X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:9E X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:9F X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:9F X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:9F X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:9F X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5 -=========================== -B1E5 A9 01 LDA A:B1 X:00 Y:08 P:A4 SP:F7 -B1E7 20 00 B2 JSR A:01 X:00 Y:08 P:24 SP:F7 -B200 18 CLC A:01 X:00 Y:08 P:24 SP:F5 -B201 65 CE ADC A:01 X:00 Y:08 P:24 SP:F5 -B203 85 CE STA A:A0 X:00 Y:08 P:A4 SP:F5 -B205 60 RTS A:A0 X:00 Y:08 P:A4 SP:F5 -B1EA 20 93 AF JSR A:A0 X:00 Y:08 P:A4 SP:F7 -AF93 AD FF 06 LDA A:A0 X:00 Y:08 P:A4 SP:F5 -AF96 18 CLC A:00 X:00 Y:08 P:26 SP:F5 -AF97 6D A1 03 ADC A:00 X:00 Y:08 P:26 SP:F5 -AF9A 8D FF 06 STA A:00 X:00 Y:08 P:26 SP:F5 -AF9D AD 23 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA0 D0 59 BNE A:00 X:00 Y:08 P:26 SP:F5 -AFA2 AD 55 07 LDA A:00 X:00 Y:08 P:26 SP:F5 -AFA5 C9 50 CMP A:5D X:00 Y:08 P:24 SP:F5 -AFA7 90 52 BCC A:5D X:00 Y:08 P:25 SP:F5 -AFA9 AD 85 07 LDA A:5D X:00 Y:08 P:25 SP:F5 -AFAC D0 4D BNE A:00 X:00 Y:08 P:27 SP:F5 -AFAE AC FF 06 LDY A:00 X:00 Y:08 P:27 SP:F5 -AFB1 88 DEY A:00 X:00 Y:00 P:27 SP:F5 -AFB2 30 47 BMI A:00 X:00 Y:FF P:A5 SP:F5 -AFFB A9 00 LDA A:00 X:00 Y:FF P:A5 SP:F5 -AFFD 8D 75 07 STA A:00 X:00 Y:FF P:27 SP:F5 -B000 A2 00 LDX A:00 X:00 Y:FF P:27 SP:F5