Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,484,410
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 04-26-24 01:25 AM
Guest: Register | Login

0 users currently in ROM Hacking | 2 guests

Main - ROM Hacking - Multi-Directional Fireball Throwing New thread | New reply


RetroRain
Posted on 04-19-08 07:22 PM Link | Quote | ID: 82087


Fuzz Ball
Level: 66

Posts: 81/994
EXP: 2438109
Next: 23742

Since: 09-30-07

Last post: 1934 days
Last view: 957 days
I want to add a new feature to Dark Mario; Multi-Directional Fireball Throwing, similar to what Bass does in Megaman & Bass. I was wondering if I could get some tips or advice on what do. Here is my take on it:

1. We need to find the code that is executed when you have firepower and press the button to shoot a fireball.

Nothing that the Trace Logger couldn't do.

$AB68:A5 D8 LDA $D8 = #$00
$AB6A:0D 45 05 ORA $0545 = #$00
$AB6D: D0 09 BNE $AB78
$AB6F:A5 02 LDA $02 = #$00
$AB71:C9 28 CMP #$28
$AB73:30 03 BMI $AB78
$AB78:A0 28 LDY #$28
$AB7A:AD DD 03 LDA $03DD = #$00
$AB7D:C9 7F CMP #$7F
$AB7F: D0 02 BNE $AB83
(10 lines skipped)
$ABA2:C8 INY
$ABA3:C8 INY
$ABA4:C8 INY
$ABA5:C8 INY
(2029 lines skipped)
$A265:20 AF A2 JSR $A2AF

Go down more in the log

$A2AF:A2 01 LDX #$01
$A2B1: BD E1 7C LDA $7CE1,X @ $7CE2 = #$00
$A2B4:F0 04 BEQ $A2BA
$A2BA:AD F1 04 LDA $04F1 = #$00
$A2BD:09 20 ORA #$20
$A2BF:8D F1 04 STA $04F1 = #$00
$A2C2:A9 0B LDA #$0B
$A2C4:8D 13 05 STA $0513 = #$00

I have noticed by doing a write to $513, that a different bank is switched in temporarily, to handle the fireball routine code.

2. Pseudo-code.

- Check to make sure Up or Down is being held.
- Branch to proper location depending on which is being held down.
- Fire ball goes up/down (I don't know how to do this)
- Otherwise Fireball goes normally like it always does.

3. Technical Pseudo-code.

LDA $17 ; Select RAM Address 17 (Buttons held down)
CMP #$08 ; Compare it to 08 (Up)
BEQ ; If true, branch to an area where I can carry out my code
CMP #$04 ; Compare it to 04 (Down)
BEQ ; If true, branch to an area where I can carry out my code
- Otherwise Regular Fireball code here -

I don't know how to carry out the direction of the fireball (Up/Down)

I might have to figure most of this out on my own, but if you have any better Pseudo-code, or any tips on how to go about this, I would appreciate it. Thanks.

____________________
My YouTube Channel

Main - ROM Hacking - Multi-Directional Fireball Throwing New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.017 seconds. (339KB of memory used)
MySQL - queries: 37, rows: 57/58, time: 0.015 seconds.