Changes

1,829 bytes added ,  21:24, 10 November 2020
Line 56: Line 56:  
*** "06_UNSMJ3.002.lua": This is the "ROMPATCH" Lua file referenced by the .meta.
 
*** "06_UNSMJ3.002.lua": This is the "ROMPATCH" Lua file referenced by the .meta.
 
*** "07_UNSMJ3.002.ppl": This is the "PIPELINE" file referenced by the .meta.
 
*** "07_UNSMJ3.002.ppl": This is the "PIPELINE" file referenced by the .meta.
 +
 +
== Emulation Notes ==
 +
The generated-code runs from the main-thread. The following 4 threads are created:
 +
* Audio thread.
 +
* "g_trlRenderTaskThread". Calls funcptr/object-vfunc from a list of tasks (funcptr/object only used if set), where the tasks are sent by the main-thread. These tasks can be triggered by accessing various IO regs with Write32 (see below), etc.
 +
* A thread which basically does nothing, just uses a Semaphore and sleeps, while checking state.
 +
* An unknown thread.
 +
 +
 +
* <code>n64MemDefault{Read/Write}{bitsize}(...)</code>, where bitsize is {8, 16, 32, 64}: implements memory read/write, all read/written data is byte-swapped. First param is the u32 vaddr. For Write, the second param is the value. For Read, the returned u32 is the read value.
 +
* <code>n64MemDefaultReadSpecial{bitsize}(...)</code>, where bitsize is {8, 16, 32, 64}: same as <code>n64MemDefaultRead{bitsize}</code>, except this runs the additional Special functionality when accessing RAM.
 +
* <code>n64MemDefault{Read/Write}{bitsize}WithDestLog(...)</code>, where bitsize is {8, 16, 32, 64}: same as <code>n64MemDefault{Read/Write}{bitsize}</code>, except this calls an additional logging func when accessing RAM.
 +
 +
 +
* Read8/Write8 only implements access for RAM and SP_DMEM/SP_IMEM. 0 is returned for Read when the address is unrecognized.
 +
* Read16/Write16 only implements access for RAM. Read16WithDestLog/Write16WithDestLog will additionally call the logging func if the address is in the IO region (high byte is 0x04). 0 is returned for Read when the address is unrecognized.
 +
* Read32/Write32 implements RAM access and all supported non-RAM IO/memory access. 0 is returned for Read when the address is unrecognized.
 +
* Read64/Write64 are implemented the same as *16 above, except this is for 64bit.
    
== EmuSystemJITPlugin ==
 
== EmuSystemJITPlugin ==
Line 120: Line 138:  
| 0x6D8 || 0x8 || Funcptr: <code>n64CPUGetRegisterCP0(int)</code>
 
| 0x6D8 || 0x8 || Funcptr: <code>n64CPUGetRegisterCP0(int)</code>
 
|-
 
|-
| 0x6E0 || 0x20 || Funcptrs for reading data: <code>n64MemDefaultRead{bitsize}(unsigned int)</code>, where bitsize is {8, 16, 32, 64} (32 uses <code>n64MemDefaultRead32WithDestLog</code>).
+
| 0x6E0 || 0x20 || Funcptrs for reading data: <code>n64MemDefaultRead{bitsize}(unsigned int)</code>, where bitsize is {8, 16, 32, 64} (32 uses <code>n64MemDefaultRead32WithDestLog</code>). Unused by the plugin.
 
|-
 
|-
 
| 0x700 || 0x20 || Funcptrs for reading Special data: <code>n64MemDefaultReadSpecial{bitsize}(unsigned int)</code>, where bitsize is {8, 16, 32, 64}.
 
| 0x700 || 0x20 || Funcptrs for reading Special data: <code>n64MemDefaultReadSpecial{bitsize}(unsigned int)</code>, where bitsize is {8, 16, 32, 64}.
 
|-
 
|-
| 0x720 || 0x20 || Funcptrs for writing data: <code>n64MemDefaultWrite{bitsize}(unsigned int, ...)</code>, where bitsize is {8, 16, 32, 64} (32 uses <code>n64MemDefaultWrite32WithDestLog</code>).
+
| 0x720 || 0x20 || Funcptrs for writing data: <code>n64MemDefaultWrite{bitsize}(unsigned int, ...)</code>, where bitsize is {8, 16, 32, 64} (32 uses <code>n64MemDefaultWrite32WithDestLog</code>). Unused by the plugin.
 
|-
 
|-
 
| 0x740 || 0x20 || Funcptrs for reading data via the WithDestLog version: <code>n64MemDefaultRead{bitsize}WithDestLog(unsigned int)</code>, where bitsize is {8, 16, 32, 64}.
 
| 0x740 || 0x20 || Funcptrs for reading data via the WithDestLog version: <code>n64MemDefaultRead{bitsize}WithDestLog(unsigned int)</code>, where bitsize is {8, 16, 32, 64}.