I've noticed these looking at other people's source, and I've tried looking them up but I actually couldn't find much useful. I have thought about maybe going to another more general programming board, but then maybe something here was specifically important for Saturn, so I just thought I'd post here.
1. Why do I see "(void*)" in front of values and returned data passed to and from system functions? (one example being the Saturn's slPrint.) What exactly is a (void*)[value]? I know that void = ...no value, and I would interpret (something)[value] as a value cast, but I'm not sure why you'd cast as a value as something that doesn't have a value. I see this in functions and also when setting registers.
2. Why do you use Static and Volatile flags? If I'm right, I believe that they allow for values/functions to be declared at fixed points in memory that do not change. But I do not understand the difference between the two. It would make sense, with the Saturn's limited memory, to put something at a distinct point in memory, but I do not understand how these flags 1) allow you to place something at a specific point (how exactly do you control where it stays?) and 2) when would you want to use the flags? A lot of the code in examples or libraries here (I'm running through the Elbesem code as we speak) uses the flags for some variables (like, for example, counters for a while() loop) and not elsewhere.
If anyone could give me some advice regarding that, I'd be very helpful.
1. Why do I see "(void*)" in front of values and returned data passed to and from system functions? (one example being the Saturn's slPrint.) What exactly is a (void*)[value]? I know that void = ...no value, and I would interpret (something)[value] as a value cast, but I'm not sure why you'd cast as a value as something that doesn't have a value. I see this in functions and also when setting registers.
2. Why do you use Static and Volatile flags? If I'm right, I believe that they allow for values/functions to be declared at fixed points in memory that do not change. But I do not understand the difference between the two. It would make sense, with the Saturn's limited memory, to put something at a distinct point in memory, but I do not understand how these flags 1) allow you to place something at a specific point (how exactly do you control where it stays?) and 2) when would you want to use the flags? A lot of the code in examples or libraries here (I'm running through the Elbesem code as we speak) uses the flags for some variables (like, for example, counters for a while() loop) and not elsewhere.
If anyone could give me some advice regarding that, I'd be very helpful.