Hello,
I'm going trough some XGCC demos.
I think I'm getting the point, but I wonder why sometime pointers are defined as volatile, other times as registers, other times both or neither of them.
For example pointer to Genesis's control and data registers.
This does a 32 bits write??
ulong *pw (this would do a 64 bit write)
ushort *pw (this would do a 16 bit write)
uchar *pw (this would do an 8 bit write)
Right??
and one last thing about VBlank... you're suppose to refresh VRAM during VBlank periods. In ASM you can measure that easily, but in C, you don't really know how much time is going to take your refreshing routine. I got problems with Master System because my routine took more time than a VBlank period. How can you handle this in C for Genesis??
Thank you.
I'm going trough some XGCC demos.
I think I'm getting the point, but I wonder why sometime pointers are defined as volatile, other times as registers, other times both or neither of them.
For example pointer to Genesis's control and data registers.
Code:
uint *pw
pw = (address of register)
*pw = (data to write)
This does a 32 bits write??
ulong *pw (this would do a 64 bit write)
ushort *pw (this would do a 16 bit write)
uchar *pw (this would do an 8 bit write)
Right??
and one last thing about VBlank... you're suppose to refresh VRAM during VBlank periods. In ASM you can measure that easily, but in C, you don't really know how much time is going to take your refreshing routine. I got problems with Master System because my routine took more time than a VBlank period. How can you handle this in C for Genesis??
Thank you.