Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
1 user currently in Rom Hacking: hukka | 2 guests
Acmlm's Board - I2 Archive - Rom Hacking - Sanity check - disassembled code
  
User name:
Password:
Reply:
 

UserPost
neviksti
Posts: 22/25
I believe there was a PC version of the "XBand" as well. I'm not sure what that file is, and I'm not sure how the PC version fit in with the other versions. (I think by then it was owned by MPlayer or something. So maybe it was completely different?)
Violent J
Posts: 482/749
On the topic of XBand, I got from a friend Doom95, and in it was a really odd file...XBand.ID...Anything it has to do with the same XBand we're talking about?
HyperLamer
Posts: 5770/8210
The code may not be executed from there, but maybe a jump further back in the routine could jump to it? Or maybe this code has just been 'disabled' for some reason, like Super Mario World's debugging functions (still intact, but never executed).
Omega45889
Posts: 289/335
Im not sure, i only have experience with x86 assembly. I could easily figure it out given notes, but i have great confidence in MoN. Im sure hes right.
MathOnNapkins
Posts: 2059/2189
I believe you are correct, and I had to go back to my own docs to check. CMP does unsigned subtraction: A - operand -> result. If(result < 0) clearcarry( );

This clearly will never happen if I understand this correctly. Could it be that the state of the carry flag before the CMP occurs has some bearing? For example, if you do ADC #$0000, if the carry flag is set it will add one to the result. But I really don't think that is the case for CMP. I will have to consult some other docs.

Edit: If you are right... then the compiler they wrote erroneously used BCC when it should have used BMI.
neviksti
Posts: 21/25
While looking in the XBand ROM I have seen lots of strange code as a result of the C compiler they used. Some of the stranger situations require several double takes before I can figure out what happenned.

However this time it is strange enough that I'm afraid I'm just having a brain fart and misunderstanding. Can someone confirm for me that yes indeed the code block I marked as "NEVER EXECUTED" will indeed always be skipped here?

C4/CE20:	A26D01  	LDX #$016D
C4/CE23: 224000E0 JSR $E00040 ; ?? routine $016D ??
C4/CE27: C90000 CMP #$0000
C4/CE2A: 9003 BCC $CE2F ; how can NotBorrow ever be clear when comparing to 0?
C4/CE2C: 820C00 BRL $CE3B
; { NEVER EXECUTED ??
C4/CE2F: A27C01 LDX #$017C
C4/CE32: 224000E0 JSR $E00040 ; ?? routine $017C ??
C4/CE36: 8501 STA $01
C4/CE38: 826404 BRL $D29F ; return
; }


If I am not insane, and it always skips it ... what the heck c code would compile to that?
The best guess I have is something like
if ( 0 > Routine016D(...) )
{
return Routine017C();
}

where Routine016D returns an unsigned int. But then what did the programmer mean for the code to accomplish?

Hopefully I am just missing something obvious.
Acmlm's Board - I2 Archive - Rom Hacking - Sanity check - disassembled code


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.004 seconds.