Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
1 user currently in Super Mario World hacking: labmaster | 3 guests
Acmlm's Board - I2 Archive - Super Mario World hacking - Tonight on "things that shouldn't be so flippin' complicated" | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 3953/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 03-28-05 03:04 PM Link | Quote
Spawning fireballs. How do you do it? All this is doing is setting X to one and playing fireball sounds:

LDX #1
LDA $1714 ;Check fireball 1
BEQ fireball
DEX
LDA $1713 ;Check 2
BNE end

fireball:
LDY #$20
STY $C100 ;Unused
LDA #5
STA $1713,X ;Enable fireball
LDA $96
STA $171D,X ;Y pos (low)
LDA $97
;CLC
;ADC $C100
STA $1731,X ;Y pos (high)
LDA $94
STA $173B,X ;X pos (low)
LDA $95
STA $1727,X ;X pos (high)
STZ $1745,X ;Y speed
LDA #6
STA $174F,X ;X speed
;LDA #6
STA $1DFC ;Sound
Kario

In Possession of a Stolen Shovel

Level: 65

Posts: 1601/2082
EXP: 2321379
For next: 14249

Since: 03-15-04
From: Texas... Yeehaw!

Since last post: 2 days
Last activity: 17 hours
Posted on 03-28-05 03:08 PM Link | Quote
You flippin took my word.

Good find btw.
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 3959/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 03-29-05 04:02 AM Link | Quote
Well, I found the game's fireball subroutine - $FEA8 (called from $D0AA when you shoot), but there's a bit of a problem. You have to JSR to it, which isn't exactly possible outside of bank 00. Anyone know how I can use it? Hopefully I can stick a small chunk of code in the bank to handle it, but maybe someone knows a better way...

Also anyone know how to move the sprite layer? I've got a level set up where Mario stays still and layer 2 moves; problem is, the sprites don't move with it because Mario's technically still in the same place.

[edit] Could you do 'JSR $1234' to jump to whatever address $1234 points to? I know some other instructions can do it... Also is it necessary to use JSL when calling code in RAM from bank 0?


(edited by HyperHacker on 03-28-05 06:05 PM)
(edited by HyperHacker on 03-28-05 06:13 PM)
HabsoluteFate

Red Paratroopa
Level: 23

Posts: 128/179
EXP: 58525
For next: 9198

Since: 03-15-04
From: Ottawa, Ontario, Canada

Since last post: 10 days
Last activity: 2 days
Posted on 03-29-05 04:25 AM Link | Quote
Originally posted by HyperHacker
Well, I found the game's fireball subroutine - $FEA8 (called from $D0AA when you shoot), but there's a bit of a problem. You have to JSR to it, which isn't exactly possible outside of bank 00. Anyone know how I can use it? Hopefully I can stick a small chunk of code in the bank to handle it, but maybe someone knows a better way...

Also anyone know how to move the sprite layer? I've got a level set up where Mario stays still and layer 2 moves; problem is, the sprites don't move with it because Mario's technically still in the same place.

[edit] Could you do 'JSR $1234' to jump to whatever address $1234 points to? I know some other instructions can do it... Also is it necessary to use JSL when calling code in RAM from bank 0?


The fireball sub routine is currently used by both Fire Mario and Yoshi. they jump into the sub routine at different locations. Here are some notes of mine when i was working on my new power up...i totally changed the design midway so the following code is rough notes:


$00/FEA8 22 EC F7 0F JSR $0FF7EC ; Jump to new fireball Sub Routine
$00/FEAC C9 00 CMP #$00 ; Compare Fireball are we done flag with 0
$00/FEAE D0 05 BNE $FEB5
$00/FEA0 60 RTS
$00/FEB1 EA NOP
$00/FEB2 EA NOP
$00/FEB3 EA NOP
$00/FEB4 EA NOP

$0F/F7EC A5 19 LDA $19
$0F/F7EE C9 03 CMP #$03
$0F/F7F0 D0 12 BNE $CapeFireMario
FireMario:
$0F/F7F2 A2 09 LDX #$09
Redo:
$0F/F7F4 BD 0B 17 LDA $170B,x
$0F/F7F7 F0 08 BEQ ExitMario
$0F/F7F9 CA DEX
$0F/F7FA E0 07 CPX #$07
$0F/F7FC D0 F6 BNE $F7F4 (Redo)
$0F/F7FE A9 00 LDA #$00 ; Flag that we are done
$0F/F800 6B RTL
ExitMario:
$0F/F801 A9 01 LDA #$01 ; Flag that we are not done
$0F/F803 6B RTL
CapeFireMario:
$0F/F804 A9 00 LDA #$00 ; Flag that we are done
$0F/F806 EA NOP ; Replace these 4 EAs with a Jump Long to Yoshi SubRoutine later on
$0F/F807 EA NOP
$0F/F808 EA NOP
$0F/F809 EA NOP
$0F/F80A 6B RTL ; Return

Makes "ThrowYoshiFireballs"
$02/A1A7 22 0B F8 0F JSR $0FF80B
$02/A1AB EA NOP
$0F/F80B BD 47 17 LDA $1747,x
$0F/F80E 29 80 AND #$80
$0F/F811 6B RTL

Seems to be Start of Sub Routine For Collision between thong/fireballs with enemies
$02/A0B3 DA PHX A:9F00 X:0005 Y:0000 P:envMXdiZc
Without this Yoshi's facial animation stops after shooting fireballs
$01/EFEE A9 2A LDA #$2A A:0003 X:0008 Y:00D0 P:envMXdiZC
This code seems to increase the fireball size:
$02/9F71 A5 14 LDA $14 [$00:0014] A:9F00 X:0007 Y:002B P:envMXdizc
This is the code that actually throws the fireballs
$02/A1A4 BC 53 A1 LDY $A153,x[$02:A15A] A:9F03 X:0007 Y:0000 P:envMXdizc



warning: This code probably does not work and probably isnt very efficient

Edit:
I'm going to introduce a program soon that will allow moving of entire sub routines from one location to another..which should make things easier...i needed something like that anyways for my power up stuff. the program will also allow import/export of ASM code that way you can export a block of code, make edits, and import that block of code (although since odds are it wouldnt fit in the original location you will have to move that code somewhere else)...i'll keep you guys posted once its completed and tested


(edited by HabsoluteFate on 03-28-05 06:28 PM)
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 3960/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 03-29-05 05:28 AM Link | Quote
Originally posted by HabsoluteFate
$00/FEA8 22 EC F7 0F JSR $0FF7EC ; Jump to new fireball Sub Routine

Erm, how are you doing that? You JSR to a different bank.
And of course, there doesn't seem to be one free byte in bank 0. Way to waste space, Nintendo!


(edited by HyperHacker on 03-28-05 07:28 PM)
HabsoluteFate

Red Paratroopa
Level: 23

Posts: 133/179
EXP: 58525
For next: 9198

Since: 03-15-04
From: Ottawa, Ontario, Canada

Since last post: 10 days
Last activity: 2 days
Posted on 03-29-05 06:56 PM Link | Quote
Originally posted by HyperHacker
Originally posted by HabsoluteFate
$00/FEA8 22 EC F7 0F JSR $0FF7EC ; Jump to new fireball Sub Routine

Erm, how are you doing that? You JSR to a different bank.
And of course, there doesn't seem to be one free byte in bank 0. Way to waste space, Nintendo!

Op Code 22 can be interpretted as either JSL or JSR as far as what i have read...
"The JSL instruction is an alias for JSR long."
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Super Mario World hacking - Tonight on "things that shouldn't be so flippin' complicated" | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.017 seconds.