News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

Changing the "Enemies Needed" for a single room

Started by RealRed, December 08, 2014, 04:44:25 PM

Previous topic - Next topic

RealRed

In order to save time/space, I have room headers with several rooms within them.
Problem is, I need a way to change the Enemies Needed in the enemy setup/enemies allowed so I can have multiple in a single room.
I've been told that BTS would be the best way to do this, but maybe there are other ways. That's up to you, I guess.
I need at least 4 different changed values.

Anyway, gfx/art is offered as per usual.

Jordan5

So I haven't done much ASMing lately, but I think these should (might) work.

Using BTS:

LoRom

org $9498AE      ;air fool x-ray of BTS $01
DW $B400

org $94B400     
LDA #$0001      ;load value of enemies needed for next room
STA $0E52       ;Store to number of enemies needed to clear room
RTS


Using Door Scroll Pointers:

Lorom

org $8FF000         ;free space in $8F
LDA #$0001      ;load value of enemies needed for next room
STA $0E52       ;Store to number of enemies needed to clear room
RTS

;Use F000 as your door scroll pointer

JAM

In addition to what Jordan5 said. There are an optimized code for a 4 different values:


Lorom
org $8FF000         ;free space in $8F
LDA #$0001      ;Value1
BRA End
LDA #$0002      ;Value1
BRA End
LDA #$0003      ;Value1
BRA End
LDA #$0004      ;Value1
:End
STA $0E52       ;Store to number of enemies needed to clear room
RTS


Set DoorScroll to $F000 to set value 1 (can be changed)
Set DoorScroll to $F005 to set value 2 (can be changed)
Set DoorScroll to $F00A to set value 3 (can be changed)
Set DoorScroll to $F00F to set value 4 (can be changed).

Just need to check if enemies are loaded before of after Door ASM code executes...

RealRed

Cool, door scrolls. here's an issue though... how would I incorporate these into an existing door scroll assembly?

Jordan5

Nice way of doing it Jam, I was also unsure if enemies needed was loaded after a door transition or not, which is why I provided the BTS too :^_^:

For adding it to door scrolls, just put the enemies needed code after the door scroll code and before the RTS, that should work.