Prevent Item Usage in Bullet Bill [Ro]
#1
Prevent Item Usage in Bullet Bill [Ro]

This code prevents using items in Bullet Bill. It's useful because in most packs, "No Bullet Icon" is present, allowing you to get items in Bullet, however, there are two problems with this:
  • It may be unfair at times and out of place. By preventing the usage, you can get items, but you cannot use them until the Bullet ends.
  • Using status items will just waste them, for example: Using a Star or a Mushroom will just do nothing and you'll lose your item. This is the main reason why I made this code

There are two versions of this code:

Code 1 prevents all item usage in Bullet.

Code 2 only prevent status items only (Mushroom, Golden, Star, Mega, Bullet), all other items are still usable. You can modify or add more items if you want, source is included.


Code 1 (Prevent all item usage in Bullet):

NTSC-U
0478EC38 3C600A0C

PAL
04797BB0 3C600A0C

NTSC-J
0479721C 3C600A0C

NTSC-K
04785F70 3C600A0C


Code 2 (Prevent status items only)

NTSC-U
C278EC38 00000008
3C60020C 4800000D
0405090A 0F0BFF00
7D6802A6 809D008C
898B0000 2C0C00FF
41820018 7C046000
4182000C 396B0001
4BFFFFE4 64630800
60000000 00000000

PAL
C2797BB0 00000008
3C60020C 4800000D
0405090A 0F0BFF00
7D6802A6 809D008C
898B0000 2C0C00FF
41820018 7C046000
4182000C 396B0001
4BFFFFE4 64630800
60000000 00000000
 
NTSC-J
C279721C 00000008
3C60020C 4800000D
0405090A 0F0BFF00
7D6802A6 809D008C
898B0000 2C0C00FF
41820018 7C046000
4182000C 396B0001
4BFFFFE4 64630800
60000000 00000000

NTSC-K
C2785F70 00000008
3C60020C 4800000D
0405090A 0F0BFF00
7D6802A6 809D008C
898B0000 2C0C00FF
41820018 7C046000
4182000C 396B0001
4BFFFFE4 64630800
60000000 00000000

Code:
Code 2 Source:
NTSC-U 8078EC38
PAL 80797BB0
NTSC-J 8079721C
NTSC-K 80785F70

lis r3, 0x20C # Original instruction

# Table of items that should not be usable in Bullet
bl itemTable
.long 0x0405090A # Mushroom, Triple Mushroom, Star, Golden
.long 0x0F0BFF00 # Bullet, Mega and end of table (0xFF). If you add more items, make sure to add 0xFF as the last one
itemTable:
mflr r11

loop:
lwz r4, 0x8C (r29)
lbz r12, 0 (r11)
cmpwi r12, 0xFF # Check if end of table and break
beq break

cmpw r4, r12 # Check if item trying to be used is in the table and if it is, prevent usage in Bullet and break
beq found

addi r11, r11, 1 # Increment table address to the next one and loop back
b loop

found:
oris r3, r3, 0x800 # Prevent item usage in Bullet

# Break out
break:

 
Code creator: Ro
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)