Needed because we're using true OS threading, so we can't do the normal JSystem heap changing on thread change.
Requires encapsulating it (removing the public static field)
uintptr_t == u32 == unsigned int on 32-bit MSVC since u32 was changed from unsigned long to unsigned int for TARGET_PC. Guard the uintptr_t overload to x64 only where uintptr_t != u32.
They store the data address in the same struct that's directly loaded from archive files. This means it's impossible to expand to 64-bit directly, and instead we need to allocate the data pointers in a separate array.
There are a few places where JASGlobalInstance have their sInstance storage implemented via template specialization. The problem is that these have no initializer, which means that they are not proper definitions (only declarations) in standards-compliant C++. MSVC and (evidently) MWCC accept this, but modern Clang and GCC do not and won't emit symbols.
I've added a macro that properly initializes these outside MWCC.
Also, JASGlobalInstance<JAUSectionHeap> was only being declared in each actor file that used it, which sounds incorrect? Not sure about this but I added it to m_Do_main too, again behind MWERKS check.
Major changes:
- Implement Big-Endian to Little-Endian byte-swapping for all RARC archive
types (JKRCompArchive, JKRMemArchive, JKRDvdArchive, JKRAramArchive)
- Implement DVD file I/O via DvdEmu (DVDOpen, DVDFastOpen, DVDReadPrio,
DVDReadAsyncPrio, DVDConvertPathToEntrynum)
- Fix YAZ0 decompression endianness in JKRDvdRipper, JKRDecomp, JKRAram,
and JKRDvdAramRipper (use JKRDecompExpandSize instead of direct header read)
- Emulate ARAM with 16MB malloc buffer and synchronous memcpy in ARQPostRequest
instead of hardware DMA transfers that hang on PC
- Add real OS threading implementation (OSContext, OSThread, OSMutex) using
native Windows threads with side-table pattern for GC struct compatibility
- Fix font endianness for JUTResFont and JUTCacheFont
- Redirect GXVert.h to Aurora's PC implementation to prevent FIFO writes to
the GameCube hardware address 0xCC008000
- Add Z-buffer texture format support (GX_TF_Z24X8, GX_TF_Z16, GX_TF_Z8)
in Aurora's texture converter
Stubbing out all OS* functions to stubs.cpp, these will likely have to
be replaced with the operating system's primitives for
locking/heaps/threads/etc.
Moved some generic globals into globals.cpp, not sure where they're
actually to be used.
Stub DSP functions
Stub JSUMemoryOutputStream, JORServer, Z2Audio
mDoExt stubs
add memcpy
add some more stubs, add extras c++ mangled functions
add extras.cpp
AR/AQ stubbing
stub DVD
stub CARD
more stubs, more extras
add missing mtx functions to dusk file
finish mtx
stub GX
KPAD and LC, also do pragma marks for better visualization
finish mtx, add a few more stubs
gf/wpad/vi
translate some matrix math from ppc to C
jorserver/debugpad/fap/dmsgobject
add m_Do_ext functions from debug block to separate file
make small janges to JSystem, does this need upstreaming
reorg DVD stubs
reorganize stubs by mark