Skip to content

Commit 47d7631

Browse files
authored
Match Renderer's Initialise & SetupMemoryPools and some more (#39)
1 parent dc30ca9 commit 47d7631

7 files changed

Lines changed: 791 additions & 172 deletions

File tree

data/mcswitch_functions.csv

Lines changed: 55 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -39371,7 +39371,7 @@ Address,Quality,Size,Name
3937139371
0x0000007100607250,U,000468,
3937239372
0x0000007100607424,U,001548,
3937339373
0x0000007100607a30,U,000004,
39374-
0x0000007100607a34,U,000016,
39374+
0x0000007100607a34,O,000016,_ZNK2nn6Result9IsSuccessEv
3937539375
0x0000007100607a44,U,000048,
3937639376
0x0000007100607a74,U,000616,
3937739377
0x0000007100607cdc,U,000056,
@@ -39763,10 +39763,10 @@ Address,Quality,Size,Name
3976339763
0x0000007100618dd0,U,000112,
3976439764
0x0000007100618e40,U,000008,
3976539765
0x0000007100618e48,U,000100,_ZN13BlockRenderer28tesselateInWorldFixedTextureEPK10BlockStateRK8BlockPosP18TextureAtlasSprite
39766-
0x0000007100618eac,U,001468,_ZN13BlockRenderer16tesselateInWorldEPK10BlockStateRK8BlockPosS2_NSt3__110shared_ptrI11BlockEntityEE
39766+
0x0000007100618eac,M,001468,_ZN13BlockRenderer16tesselateInWorldEPK10BlockStateRK8BlockPosS2_NSt3__110shared_ptrI11BlockEntityEE
3976739767
0x0000007100619468,U,000120,
3976839768
0x00000071006194e0,U,000020,_ZN13BufferBuilder15setMipmapEnableEb
39769-
0x00000071006194f4,U,000008,
39769+
0x00000071006194f4,O,000008,_ZN5Block15isMipmapEnabledEv
3977039770
0x00000071006194fc,U,000336,tesselateBlockInWorld__13BlockRendererFPC10BlockStateRC8BlockPosi
3977139771
0x000000710061964c,U,000532,tesselateTrapDoorInWorld__13BlockRendererFPC10BlockStateRC8BlockPos
3977239772
0x0000007100619860,U,000120,tesselateSlimeBlockInWorld__13BlockRendererFPC10BlockStateRC8BlockPos
@@ -46196,7 +46196,7 @@ Address,Quality,Size,Name
4619646196
0x0000007100794b6c,U,000012,
4619746197
0x0000007100794b78,U,000056,_ZN8Renderer14createInstanceEv
4619846198
0x0000007100794bb0,U,000004,_GLOBAL__sub_I_RendererCore.cpp
46199-
0x0000007100794bb4,U,000200,_ZN8RendererC1Ev
46199+
0x0000007100794bb4,O,000200,_ZN8RendererC1Ev
4620046200
0x0000007100794c7c,U,000020,_ZN9C4JRenderC1Ev
4620146201
0x0000007100794c90,U,000008,
4620246202
0x0000007100794c98,U,000296,
@@ -46207,24 +46207,24 @@ Address,Quality,Size,Name
4620746207
0x00000071007950c4,U,000148,
4620846208
0x0000007100795158,U,000012,
4620946209
0x0000007100795164,U,000268,
46210-
0x0000007100795270,U,000016,
46211-
0x0000007100795280,U,000016,
46212-
0x0000007100795290,U,000016,
46213-
0x00000071007952a0,U,000016,
46214-
0x00000071007952b0,U,000016,
46210+
0x0000007100795270,O,000016,_ZL27nvnBufferBuilderSetDefaultsP16NVNbufferBuilder
46211+
0x0000007100795280,O,000016,_ZL25nvnBufferBuilderSetDeviceP16NVNbufferBuilderP9NVNdevice
46212+
0x0000007100795290,O,000016,_ZL26nvnBufferBuilderSetStorageP16NVNbufferBuilderP13NVNmemoryPoollm
46213+
0x00000071007952a0,O,000016,_ZL19nvnBufferInitializeP9NVNbufferPK16NVNbufferBuilder
46214+
0x00000071007952b0,O,000016,_ZL12nvnBufferMapPK9NVNbuffer
4621546215
0x00000071007952c0,U,000016,
46216-
0x00000071007952d0,U,000016,
46216+
0x00000071007952d0,O,000016,_ZL19nvnBufferGetAddressPK9NVNbuffer
4621746217
0x00000071007952e0,U,000016,
4621846218
0x00000071007952f0,U,000028,
46219-
0x000000710079530c,U,000744,
46220-
0x00000071007955f4,U,000016,
46221-
0x0000007100795604,U,000792,
46219+
0x000000710079530c,U,000744,_ZN8Renderer11LoadShadersEv
46220+
0x00000071007955f4,O,000016,_ZL19nvnDeviceGetIntegerPK9NVNdevice13NVNdeviceInfoPi
46221+
0x0000007100795604,U,000792,_ZN8Renderer12SetupShadersEv
4622246222
0x000000710079591c,U,000016,
4622346223
0x000000710079592c,U,000020,
4622446224
0x0000007100795940,U,000016,
4622546225
0x0000007100795950,U,000040,Renderer::getContext
4622646226
0x0000007100795978,U,000048,
46227-
0x00000071007959a8,U,000524,
46227+
0x00000071007959a8,M,000524,_ZN8Renderer7ContextC1EPS_b
4622846228
0x0000007100795bb4,U,000004,
4622946229
0x0000007100795bb8,U,000016,
4623046230
0x0000007100795bc8,U,000016,
@@ -46233,41 +46233,42 @@ Address,Quality,Size,Name
4623346233
0x0000007100795c00,U,000016,
4623446234
0x0000007100795c10,U,000016,
4623546235
0x0000007100795c20,U,000016,
46236-
0x0000007100795c30,U,000008,_ZN8Renderer17InitialiseContextEv
46237-
0x0000007100795c38,U,000072,
46238-
0x0000007100795c80,U,003612,_ZN8Renderer10InitialiseEv
46239-
0x0000007100796a9c,U,000016,
46240-
0x0000007100796aac,U,000004,
46241-
0x0000007100796ab0,U,000004,
46242-
0x0000007100796ab4,U,000016,
46243-
0x0000007100796ac4,U,000020,
46244-
0x0000007100796ad8,U,000016,
46245-
0x0000007100796ae8,U,000020,
46246-
0x0000007100796afc,U,000016,
46247-
0x0000007100796b0c,U,000016,
46248-
0x0000007100796b1c,U,000016,
46249-
0x0000007100796b2c,U,000020,
46250-
0x0000007100796b40,U,000016,
46251-
0x0000007100796b50,U,000016,
46252-
0x0000007100796b60,U,000016,
46253-
0x0000007100796b70,U,000016,
46254-
0x0000007100796b80,U,000016,
46255-
0x0000007100796b90,U,000016,
46256-
0x0000007100796ba0,U,000016,
46257-
0x0000007100796bb0,U,000016,
46258-
0x0000007100796bc0,U,000016,
46259-
0x0000007100796bd0,U,000016,
46260-
0x0000007100796be0,U,000020,
46261-
0x0000007100796bf4,U,000016,
46262-
0x0000007100796c04,U,000016,
46263-
0x0000007100796c14,U,000016,
46264-
0x0000007100796c24,U,000016,
46265-
0x0000007100796c34,U,000016,
46266-
0x0000007100796c44,U,000016,
46267-
0x0000007100796c54,U,000016,
46268-
0x0000007100796c64,U,000016,
46269-
0x0000007100796c74,U,001512,
46270-
0x000000710079725c,U,000040,
46236+
0x0000007100795c30,O,000008,_ZN8Renderer17InitialiseContextEv
46237+
0x0000007100795c38,M,000072,_ZN8Renderer17InitialiseContextEb
46238+
0x0000007100795c80,O,000008,_ZN8Renderer10InitialiseEv
46239+
0x0000007100795c88,O,003604,_ZN8Renderer10InitialiseEb
46240+
0x0000007100796a9c,O,000016,_Z17gfx_aligned_allocmmPv
46241+
0x0000007100796aac,O,000004,_Z8gfx_freePvS_
46242+
0x0000007100796ab0,M,000004,_Z11gfx_reallocPvmS_
46243+
0x0000007100796ab4,O,000016,_ZL27nvnDeviceBuilderSetDefaultsP16NVNdeviceBuilder
46244+
0x0000007100796ac4,O,000020,_ZL24nvnDeviceBuilderSetFlagsP16NVNdeviceBuilderi
46245+
0x0000007100796ad8,O,000016,_ZL19nvnDeviceInitializeP9NVNdevicePK16NVNdeviceBuilder
46246+
0x0000007100796ae8,O,000020,_ZL28nvnDeviceSetWindowOriginModeP9NVNdevice19NVNwindowOriginMode
46247+
0x0000007100796afc,O,000016,_ZL17nvnSyncInitializeP7NVNsyncP9NVNdevice
46248+
0x0000007100796b0c,O,000016,_ZL24nvnQueueBuilderSetDeviceP15NVNqueueBuilderP9NVNdevice
46249+
0x0000007100796b1c,O,000016,_ZL26nvnQueueBuilderSetDefaultsP15NVNqueueBuilder
46250+
0x0000007100796b2c,O,000020,_ZL35nvnQueueBuilderSetComputeMemorySizeP15NVNqueueBuilderm
46251+
0x0000007100796b40,O,000016,_ZL35nvnQueueBuilderSetCommandMemorySizeP15NVNqueueBuilderm
46252+
0x0000007100796b50,O,000016,_ZL39nvnQueueBuilderSetCommandFlushThresholdP15NVNqueueBuilderm
46253+
0x0000007100796b60,O,000016,_ZL33nvnQueueBuilderGetQueueMemorySizePK15NVNqueueBuilder
46254+
0x0000007100796b70,O,000016,_ZL29nvnQueueBuilderSetQueueMemoryP15NVNqueueBuilderPvm
46255+
0x0000007100796b80,O,000016,_ZL18nvnQueueInitializeP8NVNqueuePK15NVNqueueBuilder
46256+
0x0000007100796b90,O,000016,_ZL26nvnCommandBufferInitializeP16NVNcommandBufferP9NVNdevice
46257+
0x0000007100796ba0,O,000016,_ZL26nvnTextureBuilderSetDeviceP17NVNtextureBuilderP9NVNdevice
46258+
0x0000007100796bb0,O,000016,_ZL28nvnTextureBuilderSetDefaultsP17NVNtextureBuilder
46259+
0x0000007100796bc0,O,000016,_ZL25nvnTextureBuilderSetFlagsP17NVNtextureBuilderi
46260+
0x0000007100796bd0,O,000016,_ZL26nvnTextureBuilderSetSize2DP17NVNtextureBuilderii
46261+
0x0000007100796be0,O,000020,_ZL26nvnTextureBuilderSetTargetP17NVNtextureBuilder16NVNtextureTarget
46262+
0x0000007100796bf4,O,000016,_ZL26nvnTextureBuilderSetFormatP17NVNtextureBuilder9NVNformat
46263+
0x0000007100796c04,O,000016,_ZL31nvnTextureBuilderGetStorageSizePK17NVNtextureBuilder
46264+
0x0000007100796c14,O,000016,_ZL36nvnTextureBuilderGetStorageAlignmentPK17NVNtextureBuilder
46265+
0x0000007100796c24,O,000016,_ZL24nvnTexturePoolInitializeP14NVNtexturePoolPK13NVNmemoryPoolli
46266+
0x0000007100796c34,O,000016,_ZL24nvnSamplerPoolInitializeP14NVNsamplerPoolPK13NVNmemoryPoolli
46267+
0x0000007100796c44,O,000016,_ZL27nvnWindowBuilderSetDefaultsP16NVNwindowBuilder
46268+
0x0000007100796c54,O,000016,_ZL25nvnWindowBuilderSetDeviceP16NVNwindowBuilderP9NVNdevice
46269+
0x0000007100796c64,O,000016,_ZL31nvnWindowBuilderSetNativeWindowP16NVNwindowBuilderPv
46270+
0x0000007100796c74,U,001512,_ZN8Renderer14sub_7100796C74Ev
46271+
0x000000710079725c,O,000040,_ZL16nvnWindowSetCropP9NVNwindowiiii
4627146272
0x0000007100797284,U,000016,
4627246273
0x0000007100797294,U,000016,
4627346274
0x00000071007972a4,U,000016,
@@ -46353,15 +46354,15 @@ Address,Quality,Size,Name
4635346354
0x0000007100798db0,U,000092,_ZN8Renderer9MatrixGetEi
4635446355
0x0000007100798e0c,U,000056,
4635546356
0x0000007100798e44,U,000164,_ZN8Renderer15Set_matrixDirtyEv
46356-
0x0000007100798ee8,U,000320,
46357+
0x0000007100798ee8,O,000320,_ZN8Renderer16SetupMemoryPoolsEv
4635746358
0x0000007100799028,U,000016,
4635846359
0x0000007100799038,U,000016,
4635946360
0x0000007100799048,U,000016,
4636046361
0x0000007100799058,U,000016,
4636146362
0x0000007100799068,U,000016,
46362-
0x0000007100799078,U,000068,
46363+
0x0000007100799078,U,000068,_ZN8Renderer14sub_7100799078Eimm
4636346364
0x00000071007990bc,U,000020,
46364-
0x00000071007990d0,U,000024,
46365+
0x00000071007990d0,O,000024,_ZN8Renderer23getNVNMemoryPoolByIndexEj
4636546366
0x00000071007990e8,U,000108,
4636646367
0x0000007100799154,U,000092,
4636746368
0x00000071007991b0,U,000016,
@@ -46920,7 +46921,7 @@ Address,Quality,Size,Name
4692046921
0x00000071007b6e88,O,000712,png_do_write_interlace
4692146922
0x00000071007b7150,O,003260,png_write_find_filter
4692246923
0x00000071007b7e0c,O,000108,png_write_filtered_row
46923-
0x00000071007b7e78,U,000120,
46924+
0x00000071007b7e78,U,000120,_ZN16class_71007B7E78C1Emi
4692446925
0x00000071007b7ef0,U,000044,
4692546926
0x00000071007b7f1c,U,000148,
4692646927
0x00000071007b7fb0,U,000368,
@@ -48351,7 +48352,7 @@ Address,Quality,Size,Name
4835148352
0x00000071007eb428,O,000008,zcfree
4835248353
0x00000071007eb430,U,000012,Libz_SigloMiddlewareInfo
4835348354
0x00000071007eb43c,U,002004,
48354-
0x00000071007ebc10,U,013384,nvnLoadCProcs
48355+
0x00000071007ebc10,O,013384,nvnLoadCProcs
4835548356
0x00000071007ef058,U,000068,
4835648357
0x00000071007ef09c,U,000024,
4835748358
0x00000071007ef0b4,U,000120,

src/Minecraft.Client/platform/NX/Platform.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,15 @@ void XMemDestroyCompressionContext(void* ctxt) {
4848
void XMemDestroyDecompressionContext(void* ctxt) {
4949
return;
5050
}
51+
52+
void* gfx_aligned_alloc(ulong a1, ulong a2, void*) {
53+
return aligned_alloc(a2, a1);
54+
}
55+
56+
void gfx_free(void* ptr, void*) {
57+
free(ptr);
58+
}
59+
60+
void* gfx_realloc(void* ptr, ulong size, void*) {
61+
realloc(ptr, size);
62+
}

src/Minecraft.Client/platform/NX/Platform.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This file contains all of the Switch implementations of Windows/XBOX functions
66
77
*/
88

9+
#include <cstdlib>
910
#include <nn/os.h>
1011

1112
typedef bool BOOL;
@@ -50,4 +51,8 @@ int TlsSetValue(unsigned int index, void* value);
5051

5152
int OpenDir(const char*, int*);
5253
int ReadDir(int*, struct FSDirEntry*); // TODO: what is FSDirEntry?
53-
int CloseDir(int*);
54+
int CloseDir(int*);
55+
56+
void* gfx_aligned_alloc(ulong a1, ulong a2, void*);
57+
void gfx_free(void* ptr, void*);
58+
void* gfx_realloc(void* ptr, ulong, void*);

0 commit comments

Comments
 (0)