[FE7] Is there an ASM that tests for gender?

I realize that there is a If Tactician Female ASM code, but is there an ASM that tests if an active unit is female(character byte 2, 0x40, I think) or male?
Actually, that makes me wonder as well. What does making a character a female do? Anything specific?

No idea whether such an ASM exists, although I shouldn’t think it’d be too hard to write one if you really need it. As to what it’s used for, I think it’s only for determining Aid for mounted units.

That would be nice if you could write it so that I could use it in future/current hacks, but I do not necessarily need it. But I mean, sure. I will use/take it if you make it.
K̶n̶o̶w̶i̶n̶g̶ ̶m̶y̶s̶e̶l̶f̶,̶ ̶i̶f̶ ̶i̶t̶ ̶d̶o̶e̶s̶ ̶g̶e̶t̶ ̶m̶a̶d̶e̶,̶ ̶I̶ ̶w̶i̶l̶l̶ ̶p̶r̶o̶b̶a̶b̶l̶y̶ ̶s̶p̶a̶m̶ ̶i̶t̶ ̶a̶ ̶b̶u̶n̶c̶h̶ ̶i̶n̶ ̶m̶y̶ ̶n̶e̶x̶t̶ ̶c̶h̶a̶p̶t̶e̶r̶.̶ ̶ ̶O̶r̶ ̶f̶i̶v̶e̶.̶

I’ve never actually done events, so I don’t know for sure how they work, but here’s basically what the code would look like:

ldr r0, CurrentCharPointer
ldr r0,[r0] //loads beginning of character struct in wram
ldr r0, [r0,#0x4] //load character data
ldr r0, [r0,#0x29] //load ability 2
mov r1,#0x40
and r0,r1 //this checks if bit 6 is set
cmp r0,#0x0 //if not set, leave as is, it's false
beq TheEnd
mov r0,#0x1 //otherwise, return true (not necessary, probably, since true is most likely "any non-zero number"
bx lr //go back
.long 0x03004690

Someone who actually events and knows how ASMC works should check this.

I actually have ASMC code in EN to test for the tactician’s gender, courtesy of @Nintenlord. I’ll go dig it up.

EDIT: Give this a shot (I’m like 90% sure this is the right code, anyways).

00 B5 06 48 00 F0 08 F8 00 06 00 28 01 D1 01 20 00 E0 00 20 02 BC 08 47 00 47 00 00 C9 A3 07 08

Paste it anywhere you’ve got some free space and call it with the offset+1. Mine’s at E01470, so I have to write the offset as E01471 in the event file.

Thanks, but I was hoping for an ASM that tests for an active unit’s gender/byte 0x40 of character ability 2. Do you have that somewhere handy?

Oops, my bad. I just read the topic title and was like “yes, I have that” lulz. Shoulda read more carefully.

I don’t have an ASMC on hand that tests specific characters, unfortunately. Since the character/class byte is static, I never really needed to specify females because you can usually refer to them by character ID. It might be useful if you wanted to refer to generic female enemies who use the same character ID as male units, but otherwise there probably isn’t much use to targeting that character/class byte. If I recall correctly, it applies the female aid stat calculation for female classes.

Well, for my current “hack,” I think more than half the army somehow became more than half females(mostly because my friend just wanted the women[well, kinda, but I did add some female characters, but I think he added more]), and even testing for the male characters would be kinda tedious and annoying for when there may eventually be something like 20-30 allies.
But hey, this is just me and my opinion.

H̶o̶w̶ ̶a̶b̶o̶u̶t̶ ̶s̶o̶m̶e̶ ̶g̶l̶a̶s̶s̶e̶s̶,̶ ̶A̶r̶c̶h̶?̶ ̶ ̶T̶o̶ ̶i̶m̶p̶r̶o̶v̶e̶ ̶t̶h̶a̶t̶ ̶e̶y̶e̶s̶i̶g̶h̶t̶ ̶o̶f̶ ̶y̶o̶u̶r̶s̶.̶ ̶ ̶H̶e̶r̶e̶,̶ ̶I̶ ̶e̶v̶e̶n̶ ̶u̶p̶d̶a̶t̶e̶d̶ ̶y̶o̶u̶r̶ ̶p̶r̶o̶f̶i̶l̶e̶ ̶p̶i̶c̶t̶u̶r̶e̶ ̶f̶o̶r̶ ̶y̶o̶u̶.̶ ̶ ̶P̶e̶r̶h̶a̶p̶s̶ ̶y̶o̶u̶ ̶c̶a̶n̶ ̶r̶e̶a̶d̶ ̶b̶e̶t̶t̶e̶r̶ ̶n̶o̶w̶ ̶t̶o̶o̶.̶ :smiling_imp:

Wait, you realize the strike-through portion is supposed to be like a joke, right? Not like some mean insult because I am a dick.
Y̶o̶u̶ ̶p̶r̶o̶b̶a̶b̶l̶y̶ ̶s̶t̶i̶l̶l̶ ̶t̶h̶i̶n̶k̶ ̶I̶ ̶a̶m̶,̶ ̶d̶o̶ ̶y̶o̶u̶ ̶n̶o̶t̶.̶.̶.̶?̶

1 Like

I feel like CC did something like this but it would essentially look like

bool ifFem(){
Unit** currentUnit = reinterpret_cast<Unit**>(0x3004690);
Unit* unit = *currentUnit;
return unit->getUnitAbilities() & (0x40 << 8);

which in raw hex looks like this courtesy of devkitPro

[spoiler=“Binary Output”]
04 4B 1B 68 5A 68 1B 68 90 6A 9B 6A 18 43 40 04 C0 0F 70 47 90 46 00 03

So you paste this somewhere and call it in your events. I’m not that good at events but I think you have to:

IFAT conID offsetofroutine | 1
//stuff to do if female

Yeah, it seems to be working, thanks! The code is IFAF for testing, but overall, the code seems to be working!