Hi guys
Basic code
2042F180 00000008 <-- if up is pressed
42000000 90000000 <-- set pointer
043B519C 803F82C8 <-- set value
E0000000 80008000 <-- end
I want to write the above in ASM or do some sort of if else check, can someone help me out please?
Button Activator = 8042F180
ok, what I want to do is this (c#):
if (8042F180 == "00000008") { // if up is pressed
if (903B519C == "803F8278") { // if its default value
903B519C = "803F82C8";
} else if (903B519C == "803F83B8") { // if its last value
903B519C = "803F8278";
} else {
903B519C += 50; // add 50 to in between values
}
}
it basically loops through these values:
803F8278 <-- default
803F82C8 <-- first value
803F8318 <-- 803F82C8 +50
803F8368 <-- 803F8318 +50
803F83B8 <-- 803F8368 +50, go back to default
Thanks
:(
couldnt you just write multiple ifs?
Like if address = value do this
else if address does not = value do that
use if(equal)
or if(not equal)
Here's an example of whats needed to enable a change suit code for the lego batman game, you have to use multiple checks as both robin and batman use different addresses;
Example:
801B1DAC: lwz r0,508(r3) ; original instruction (opcode which reads active character block pointer)
b 0x817AA000 ; inserted instruction, jumps to subroutine
joker_load/value check
lis r11,-32701
lwz r11,-3712(r11)
cmpwi r11,8
bne- 0x817aa04c /end
char_check
lwz r12,4604(r3)
lwz r0,492(r3)
cmpwi r0,2
beq- 0x817aa030 /jump to robin_routine
batman_routine
lbz r11,-4(r12)
cmpwi r11,3
bge- 0x817aa044 /jump to subi
b 0x817aa03c /jump to addi
robin_routine
lbz r11,-4(r12) /suit_check
cmpwi r11,8
bge- 0x817aa044 /jump to subi
addi r12,r12,80
b 0x817aa048 /jump to stw
subi r12,r12,320
stw r12,4604(r3)
lwz r0,508(r3)
b 0x801b1db0
An alteration needs to be done to slow the execution rate down, but this is just an example;
Change Suit [Press Up]
077AA000 00000054
3D608043 816BF180
2C0B0008 40820040
818311FC 800301EC
2C000002 41820014
896CFFFC 2C0B0003
4080001C 48000010
896CFFFC 2C0B0008
4080000C 398C0050
48000008 398CFEC0
918311FC 800301FC
4AA07D60 00000000
041B1DAC 495F8254