If you see value of BaseAddress as 0x00000000 that means you are compiling code as 32-bit. 32-bit code can have only 4GB of virtual space - 32-bit pointer can address bytes only from 0 to 2^32. 2 terabytes is 2*1024*1024*1024*1024 = 2^41. Taking lowest 32 bits from 2^41 gives you exactly 0:
| 2^41 = 100000000000000000000000000000000000000000
2^32 = 1000000000000000000000000000000
****************************** --> only these bits fit in 32-bit register
|
Casey is currently writing code with assumption you will be running it as 64-bit. It simplifies a lot of things during development. And that is reasonable assumption because any desktop CPU from last 10 years (or so) is 64-bit.
If you want to compile code as 32-bit, you'll need to adjust this part of code. If you are OK to loose live edit/reload feature you can simply set BaseAddress to 0. That is what game will pretty much do when it will be released (no reason to live edit code) - OS will choose whatever address is free.
Or you can try to find some address where virtual memory can be allocated. Try something from 0 to 2nd GB. Note that this range can be pretty fragmented - any system dll loaded will take space, any memory allocated by startup code for these dlls will take some space, memory allocated by C runtime will take space. Anything up from 2nd GB is reserved for kernel by default. There is linker flag that will reserve only range from 3rd to 4th GB leaving lowest 3GB for application. By default it is not enabled for 32-bit code:
https://msdn.microsoft.com/en-us/library/wz223b1z.aspx