Skip to content

Commit

Permalink
landmark commit Xkeeper0#3
Browse files Browse the repository at this point in the history
  • Loading branch information
pepperpow committed Jun 22, 2020
1 parent a25ef3b commit b2942cd
Show file tree
Hide file tree
Showing 17 changed files with 789 additions and 409 deletions.
Binary file modified smb2-custom.chr
Binary file not shown.
34 changes: 34 additions & 0 deletions src/extras/char-switch-overworld.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

HandlePlayer_ChangeChar: ; make this less dumb
LDA CharSelectAnytime
BEQ ++
LDA PlayerInAir
BNE +
LDA Player1JoypadHeld
AND #ControllerInput_Select
BEQ +
LDA Player1JoypadPress
AND #ControllerInput_Left
BEQ ++
- INC CurrentCharacter
JSR ChkToNextValidCharacter
BNE -
BEQ +
++
LDA Player1JoypadPress
AND #ControllerInput_Right
BEQ +
- DEC CurrentCharacter
JSR ChkToNextValidCharacter
BNE -
+
LDA CurrentCharacter
CMP PreviousCharacter
BEQ ++
STA PreviousCharacter
LDA PlayerCurrentSize
EOR #$1
STA PlayerCurrentSize
JSR CustomCopyChar
++
RTS
115 changes: 115 additions & 0 deletions src/extras/controller-2-3-debug.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@

; Copies all character stats to RAM for hot-swapping the current character
;
CopyCarryYOffsets:
LDX #(AreaMainRoutine - CarryYOffsets - 1)
CopyCarryYOffsets_Loop:
LDA CarryYOffsets, X
STA CarryYOffsetsRAM, X
DEX
BPL CopyCarryYOffsets_Loop

RTS

AreaDebugRoutine:
LDA CreateObjectType
BEQ AreaDebugRoutine_Exit

JSR DebugCreateObject

AreaDebugRoutine_Exit:
RTS

;
; Input
; CreateObjectType = object type
;
DebugCreateObject:
JSR CreateEnemy

BMI AreaDebugRoutine_Exit

LDX byte_RAM_0
LDA CreateObjectType
STA ObjectType, X
LDA ScreenBoundaryLeftLo
ADC #$80
STA ObjectXLo, X
LDA ScreenBoundaryLeftHi
ADC #$00
STA ObjectXHi, X
LDA ScreenYLo
STA ObjectYLo, X
LDA ScreenYHi
ADC #$00
STA ObjectYHi, X

JSR InitializeEnemy

LDA CreateObjectAttributes
BEQ DebugCreateObject_ClearObjectType

DebugCreateObject_ObjectCarried:
ROL CreateObjectAttributes
BCC DebugCreateObject_ObjectTimer

LDA #$01
STA HoldingItem
STA ObjectBeingCarriedTimer, X
STX ObjectBeingCarriedIndex

LDA #SoundEffect1_CherryGet
STA SoundEffectQueue1

DebugCreateObject_ObjectTimer:
ROL CreateObjectAttributes
BCC DebugCreateObject_ObjectBottomScreen

LDA #$FF
STA EnemyTimer, X

DebugCreateObject_ObjectBottomScreen:
ROL CreateObjectAttributes
BCC DebugCreateObject_Bit4

LDA ObjectYLo, X
CLC
ADC #$E0
STA ObjectYLo, X
LDA ObjectYHi, X
ADC #$00
STA ObjectYHi, X

DebugCreateObject_Bit4:
ROL CreateObjectAttributes
BCC DebugCreateObject_Bit3

DebugCreateObject_Bit3:
ROL CreateObjectAttributes
BCC DebugCreateObject_Bit2

DebugCreateObject_Bit2:
ROL CreateObjectAttributes
BCC DebugCreateObject_ObjectThrown

DebugCreateObject_ObjectThrown:
ROL CreateObjectAttributes
BCC DebugCreateObject_ObjectNoVelocityReset

LDA #$01
STA EnemyArray_42F, X

DebugCreateObject_ObjectNoVelocityReset:
ROL CreateObjectAttributes
BCS DebugCreateObject_ClearObjectType

LDA #$00
STA ObjectXVelocity, X
STA ObjectYVelocity, X

DebugCreateObject_ClearObjectType:
LDA #$00
STA CreateObjectType

DebugCreateObject_Exit:
RTS
5 changes: 5 additions & 0 deletions src/extras/custom-player-render.asm
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,11 @@ CharacterExtraSheets:
.db $3D
.db $3E
.db $3F
CharacterExtraSheetsSmall:
.db $80
.db $81
.db $82
.db $83
ExtraFramesOne:
.db $FB, $FB
.db $FB, $FB
Expand Down
66 changes: 9 additions & 57 deletions src/extras/flag-set.asm
Original file line number Diff line number Diff line change
@@ -1,49 +1,5 @@
; Flag Set
; Takes PTR,
Level_Bit_Flags = $7300
World_Bit_Flags = $73D2
Level_Count_Discovery = $73E0
Level_Count_MushCount = $73E1
Level_Count_Coins = $73E2
Level_Count_1ups = $73E3
Level_Count_SubspaceVisits = $73E4
Level_Count_Unlocks = $73E5
Level_Count_BigKill = $73E6
Level_Count_KillCnt = $73E6
Level_Count_LivesLost = $73E7
Level_Count_Crystals = $73E8
Level_Count_Cherries = $73E9
World_Count_Bosses = $73EF
CurrentLevelAreaIndex = $73F0
StatPrintOffset = $73F1
StatPrintCurOffset = $73F2
StatPrintDec = $73F3
StatPrintDecRow = $73F4

PlayerIndependentLives = $73F8
PlayerIndependentMaxHealth = $73FC

CustomBitFlag_Boss_Defeated = %00000010

CustomBitFlag_Visited = %00000001
CustomBitFlag_Mush1 = %00000010
CustomBitFlag_Mush2 = %00000100
CustomBitFlag_1up = %00001000
CustomBitFlag_Sub1 = %00010000
CustomBitFlag_Sub2 = %00100000
CustomBitFlag_Key = %01000000
CustomBitFlag_Crystal = %10000000

CustomCharFlag_Shrinking = %00000001
CustomCharFlag_Running = %00000010
CustomCharFlag_Fluttering = %00000100
CustomCharFlag_PeachWalk = %00001000
CustomCharFlag_WeaponCherry = %00010000
CustomCharFlag_StoreCherry = %00100000
CustomCharFlag_AirControl = %01000000
CustomCharFlag_WideSprite = %10000000

CustomCharFlag_StandStill = %00000001

DokiMode:
.db %0011 ;; doki
Expand Down Expand Up @@ -95,26 +51,16 @@ AccelReduction:
.db $0
.db $0
.db $0
GBreaker:
.db $0 ;; gbreak
DebugSet:
.db $1 ;; debug
ResetHealth:
.db $06 ;; reset health (after slots/boss)
StartHealth:
.db $08 ;; start health
MaxedHealth:
.db $ff ;; maxed health
IndependentLives:
.db $1 ;; elimination mode
.db $0 ;; elimination mode
IndependentPlayers:
.db $0 ;; powerups per player
CharSelectDeath:
.db $1 ;; select death (0, no select, 1, always select, 2, random select)
CharSelectAnytime:
.db $1 ;; select death
FluteVisit:
.db $0
BossMushroom:
.db $1 ;; select death
StartingInventory:
Expand All @@ -130,6 +76,10 @@ StartingInventory:
.db $0 ;; select death
.db $0 ;; select death
.db $0 ;; select death
StartingEquipment:
.db $0 ;; select death
.db $0 ;; select death
.db $0 ;; select death
StartingProjectile:
.db $0 ;; select death
.db $0 ;; select death
Expand All @@ -148,9 +98,11 @@ RescueCondition:
.db $0 ;; ok
WinLevel:
.db $FF ;; bosses
FreeHealth:
.db $00
ChampionChance:
.db $10
CharLockVar:
CharacterInitialLock:
.BYTE 0

BonusChanceText_PUSH_OTHER_BUTTON:
Expand Down Expand Up @@ -561,7 +513,7 @@ CharSelectInitialize:
LDA CharacterLock_Variable ; check lock var, if 0 load new var
CMP #$F
BNE +
LDA CharLockVar
LDA CharacterInitialLock
STA CharacterLock_Variable
+ RTS

Expand Down
13 changes: 7 additions & 6 deletions src/extras/health-revamp-3.asm
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ NewHealthRender:
PHA
LDA PlayerHealth
BEQ ++
; LDX ProjectileType
; LDA ProjectileTileHealth, X
; STA SpriteDMAArea + 1, Y
; PLA
; TAX
; JMP +++
LDA CherryCount
BEQ ++
LDA #$a1
STA SpriteDMAArea + 1, Y
PLA
TAX
JMP +++
++ PLA
TAX
DrawHealthPip:
Expand Down
53 changes: 53 additions & 0 deletions src/extras/jump-attack.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
JumpAttack:
LDA PlayerYVelocity
BMI +
CMP #$10
BCC +
JSR LoadFlagPlayer3
LDY CurrentCharacter
LDA ($c5), Y
AND #CustomBitFlag_BounceAll
BNE +ok
LDA ($c5), Y
AND #CustomBitFlag_BounceJump
BEQ +o
LDA PlayerAnimationFrame
CMP #SpriteAnimation_Jumping
BEQ +ok
JMP +
+o
LDA ($c5), Y
AND #CustomBitFlag_GroundPound
BEQ +o
LDA Player1JoypadHeld
AND #ControllerInput_Down
BEQ +
LDA CrushTimer
CMP #$08
BCS +ok
LDA #$0
STA CrushTimer
JMP +
+o
JMP +
+ok
LDA #$0
STA CrushTimer
LDA Player1JoypadHeld
AND #ControllerInput_A
BEQ ++
LDA #$A0
STA PlayerYVelocity
BNE +++
++ LDA #$C0
STA PlayerYVelocity
+++ LDX byte_RAM_12
INX
LDY #$14
JSR DamageEnemySingle
LDX byte_RAM_ED
PLA
PLA
RTS
+
RTS
Loading

0 comments on commit b2942cd

Please sign in to comment.