Jump to content

xp bug :D


Stirling.

Recommended Posts

Not really a bug as much as a design feature. Can save memory by using a smaller container. The HUD exp is stored as a 16 bit integer. It'll reset every 216 or 65,535. If they would have used a 32 bit integer instead, it would reset at 232 or 4,294,967,295.

Link to comment
Share on other sites

  • Leader

Not really a bug as much as a design feature. Can save memory by using a smaller container. The HUD exp is stored as a 16 bit integer. It'll reset every 216 or 65,535. If they would have used a 32 bit integer instead, it would reset at 232 or 4,294,967,295.

I figured something like that.  The mystery to me is why it shows negative numbers for a while after it overflows the 64k.  2s-complement won't explain it, else they would need 4 bytes to express the 64k.  I suspect that whatever operator they used to increment the number uses an intermediate variable of more than 2 bytes which it perhaps then reduces to 2 bytes BCD for display.  The overflow bit is taken to be a negative sign.  

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.