Duke4.net Forums: Compiler bug? - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Compiler bug?

User is offline   Danukem 

  • Duke Plus Developer

#1

Apparently if you define a sound as having a number > 4095, you get a compiler error that you have exceeded 4096 sounds. I discovered this because I accidentally defined a sound with an extra digit:

define SQUISHED4 9899
definesound SQUISHED4 moresounds/squished4.ogg 0 128 16 0 0


So even though my project has < 1000 sounds, it wouldn't let me compile because of the particular number I picked. I imagine this could be very misleading if you were actually pretty close to the 4096 limit, but you had skipped some numbers when defining sounds. In that case you might think you had actually gone over the limit.
0

User is offline   Mere_Duke 

#2

I think there are some restrictions. 4096 sounds = 0..4095, and 4095 = 1111 1111 1111. It's a one-and-a-half bytes. I think the high-order part of that "half-byte" is used for something else (probably to store some flags). (It's all my imagination, but probably this is because DOS was an x16 OS, and "int" there meant "xxxx xxxx xxxx xxxx" and no more.)

P.S. I thought this restriction has gone long ago...

This post has been edited by Mere_Duke: 10 March 2018 - 03:06 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#3

View PostMere_Duke, on 10 March 2018 - 02:59 PM, said:

I think there are some restrictions. 4096 sounds = 0..4095, and 4095 = 1111 1111 1111. It's a one-and-a-half bytes. I think the high-order part of that "half-byte" is used for something else (probably to store some flags). (It's all my imagination, but probably this is because DOS was an x16 OS, and "int" there meant "xxxx xxxx xxxx xxxx" and no more.)

P.S. I thought this restriction has gone long ago...


Yes, but even if there's an internal numbering system that is limited in the way you describe, I would have thought that the numbers in CON would be converted to it, so that if there are 1000 distinct sounds defined, then the internal numbering doesn't go above 1000. I guess not.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#4

The game has to stick with the IDs you defined because of the hard-coded sounds.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #5

There is no bug here. The game provides you sound IDs 0 though 4095.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options