Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; SMW Bowser Bowling Ball (sprite A1), by imamelia ;; ;; This is a disassembly of sprite A1 in SMW, Bowser's bowling ball. ;; ;; Uses first extra bit: YES ;; ;; If the extra bit is set, the sprite will detect ground. If not, it will act like the ;; original and travel along hardcoded paths. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; defines and tables ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; !ExtraBit = $04 BowserBallXSpeed: db $10,$F0 BowserBallYSpeed: db $00,$00,$00,$00,$FE,$FC,$F8,$EC db $EC,$EC,$E8,$E4,$E0,$DC,$D8,$D4 db $D0,$CC,$C8 BowserBallDispX: db $F0,$00,$10,$F0,$00,$10,$F0,$00,$10,$00,$00,$F8 BowserBallDispY: db $E2,$E2,$E2,$F2,$F2,$F2,$02,$02,$02,$02,$02,$EA BowserBallTilemap: db $45,$47,$45,$65,$66,$65,$45,$47,$45,$39,$38,$63 BowserBallTileProp: db $0D,$0D,$4D,$0D,$0D,$4D,$8D,$8D,$CD,$0D,$0D,$0D BowserBallTileSize: db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$02 BowserBallDispX2: db $04,$0D,$10,$0D,$04,$FB,$F8,$FB BowserBallDispY2: db $00,$FD,$F4,$EB,$E8,$EB,$F4,$FD ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; init routine ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; print "INIT ",pc RTL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; main routine wrapper ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; print "MAIN ",pc PHB PHK PLB JSR BowserBallMain PLB RTL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; main routine ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; BowserBallMain: JSR BowserBallGFX ; LDA $9D ; if sprites are locked... BEQ + ; return JMP Return0 + JSR SubOffscreenX0 ; JSL $01A7DC ; JSL $018022 ; JSL $01801A ; LDA $1594,x ;\ Check proximity flag BEQ + ;/ LDA $AA,x ; if the sprite's Y speed CMP #$40 ; has not reached 40... BPL MaxSpeed ; CLC ; ADC #$03 ; make the sprite accelerate BRA StoreSpeed ; + JSR SubHorzPos LDA $0F ;\ If Mario not closer than 0x30 pixels horizontally, CLC ; | ADC #$30 ; | CMP #$60 ; | BCS SkipSpeedSet ;/ branch INC $1594,x ;\ Set proximity flag BRA SkipSpeedSet ;/ MaxSpeed: ; LDA #$40 ; StoreSpeed: ; STA $AA,x ; LDA $AA,x ; if the sprite speed is negative... BMI SkipSpeedSet ; LDA $14D4,x ; or its Y position high byte is negative... BMI SkipSpeedSet ; branch LDA $7FAB10,x ; AND #!ExtraBit ; if the extra bit is set... BNE DetectGround ; make the sprite detect ground like a normal sprite LDA $D8,x ; if not... CMP #$B0 ; check the sprite's Y position BCC SkipSpeedSet ; don't set its X speed if the sprite Y position is less than B0 LDA #$B0 ; if it is B0 or greater... STA $D8,x ; make it stay at B0 Continue: ; LDA $AA,x ; if the sprite Y speed CMP #$3E ; is less than 3E... BCC NoShake ; don't shake the ground LDY #$25 ; STY $1DFC ; play a sound effect LDY #$20 ; STY $1887 ; shake the ground NoShake: ; CMP #$08 ; if the sprite's Y speed is less than 08... BCC NoSound2 ; don't play the second sound effect LDA #$01 ; STA $1DF9 ; NoSound2: ; JSR HandleYSpeed ; LDA $B6,x ; if the sprite's X speed is nonzero... BNE SkipSpeedSet ; there is no need to set it again JSR SubHorzPos ; LDA BowserBallXSpeed,y ; STA $B6,x SkipSpeedSet: LDA $B6,x ; BEQ Return0 ; return if the sprite's X speed is zero BMI IncFrame ; increment the frame if the sprite's X speed is negative DEC $1570,x ; decrement the frame if the sprite's X speed is positive DEC $1570,x ; IncFrame: ; INC $1570,x ; Return0: ; RTS DetectGround: ; JSL $019138 ; interact with objects LDA $1588,x ; AND #$04 ; BEQ SkipSpeedSet ; BRA Continue ; HandleYSpeed: ; LDA $AA,x ; STZ $AA,x ; LSR ; LSR ; TAY ; LDA BowserBallYSpeed,y ; LDY $1588,x ; BMI Return1 ; STA $AA,x ; Return1: ; RTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; graphics routine ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; BowserBallGFX: JSR GetDrawInfo ; ;LDA #$70 ; ;STA $15EA,x ; PHX ; LDX #$0B ; 12 tiles to draw GFXLoop: ; LDA $00 ; CLC ; ADC BowserBallDispX,x ; STA $0300,y ; LDA $01 ; CLC ; ADC BowserBallDispY,x ; STA $0301,y ; LDA BowserBallTilemap,x ; STA $0302,y ; LDA BowserBallTileProp,x ; ORA $64 ; STA $0303,y ; PHY ; TYA ; LSR #2 ; TAY ; LDA BowserBallTileSize,x ; STA $0460,y ; PLY ; INY #4 ; DEX ; BPL GFXLoop ; PLX ; PHX ; LDY $15EA,x ; LDA $1570,x ; LSR #3 ; AND #$07 ; PHA ; TAX ; LDA $0304,y ; CLC ; ADC BowserBallDispX2,x ; STA $0304,y ; LDA $0305,y ; CLC ; ADC BowserBallDispY2,x ; STA $0305,y ; PLA ; CLC ; ADC #$02 ; AND #$07 ; TAX ; LDA $0308,y ; CLC ; ADC BowserBallDispX2,x ; STA $0308,y ; LDA $0309,y ; CLC ; ADC BowserBallDispY2,x ; STA $0309,y ; PLX ; LDA #$0B ; LDY #$FF ; JSL $81B7B3 ; RTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; subroutines ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Table1: db $0C,$1C Table2: db $01,$02 Table3: db $40,$B0 Table6: db $01,$FF Table4: db $30,$C0,$A0,$C0,$A0,$F0,$60,$90,$30,$C0,$A0,$80,$A0,$40,$60,$B0 Table5: db $01,$FF,$01,$FF,$01,$FF,$01,$FF,$01,$FF,$01,$FF,$01,$00,$01,$FF SubOffscreenX0: LDA #$00 ;BRA SubOffscreenMain ;SubOffscreenX1: ;LDA #$02 ;BRA SubOffscreenMain ;SubOffscreenX2: ;LDA #$04 ;BRA SubOffscreenMain ;SubOffscreenX3: ;LDA #$06 ;BRA SubOffscreenMain ;SubOffscreenX4: ;LDA #$08 ;BRA SubOffscreenMain ;SubOffscreenX5: ;LDA #$0A ;BRA SubOffscreenMain ;SubOffscreenX6: ;LDA #$0C ;BRA SubOffscreenMain ;SubOffscreenX7: ;LDA #$0E SubOffscreenMain: STA $03 JSR SubIsOffscreen BEQ Return2 LDA $5B LSR BCS VerticalLevel LDA $D8,x CLC ADC #$50 LDA $14D4,x ADC #$00 CMP #$02 BPL EraseSprite LDA $167A,x AND #$04 BNE Return2 LDA $13 AND #$01 ORA $03 STA $01 TAY LDA $1A CLC ADC Table4,y ROL $00 CMP $E4,x PHP LDA $1B LSR $00 ADC Table5,y PLP SBC $14E0,x STA $00 LSR $01 BCC Label20 EOR #$80 STA $00 Label20: LDA $00 BPL Return2 EraseSprite: LDA $14C8,x CMP #$08 BCC KillSprite LDY $161A,x CPY #$FF BEQ KillSprite LDA #$00 STA $1938,y KillSprite: STZ $14C8,x Return2: RTS VerticalLevel: LDA $167A,x AND #$04 BNE Return2 LDA $13 LSR BCS Return2 AND #$01 STA $01 TAY LDA $1C CLC ADC Table3,y ROL $00 CMP $D8,x PHP LDA $1D LSR $00 ADC Table6,y PLP SBC $14D4,x STA $00 LDY $02 BEQ Label22 EOR #$80 STA $00 Label22: LDA $00 BPL Return2 BMI EraseSprite SubIsOffscreen: LDA $15A0,x ORA $186C,x RTS GetDrawInfo: STZ $186C,x STZ $15A0,x LDA $E4,x CMP $1A LDA $14E0,x SBC $1B BEQ OnscreenX INC $15A0,x OnscreenX: LDA $14E0,x XBA LDA $E4,x REP #$20 SEC SBC $1A CLC ADC.w #$0040 CMP #$0180 SEP #$20 ROL A AND #$01 STA $15C4,x BNE Invalid LDY #$00 LDA $1662,x AND #$20 BEQ OnscreenLoop INY OnscreenLoop: LDA $D8,x CLC ADC Table1,y PHP CMP $1C ROL $00 PLP LDA $14D4,x ADC #$00 LSR $00 SBC $1D BEQ OnscreenY LDA $186C,x ORA Table2,y STA $186C,x OnscreenY: DEY BPL OnscreenLoop LDY $15EA,x LDA $E4,x SEC SBC $1A STA $00 LDA $D8,x SEC SBC $1C STA $01 RTS Invalid: PLA PLA RTS SubHorzPos: LDY #$00 LDA $94 SEC SBC $E4,x STA $0F LDA $95 SBC $14E0,x BPL $01 INY RTS
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
I made $15,000 in 2 days
CSS | 38 min ago | 0.23 KB
This summer smells like money
CSS | 39 min ago | 0.24 KB
API Glitch (Docs Leak)
CSS | 40 min ago | 0.24 KB
FB2600 User Handbook v0.91
1 hour ago | 6.06 KB
FB2600 Administrator & Moderator SOP
2 hours ago | 8.13 KB
Untitled
12 hours ago | 7.38 KB
c2l.puter.site
14 hours ago | 0.48 KB
Looksmaxxing
15 hours ago | 1.83 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!