Page 1 of 7
Boot-up data transferred to Real3D

Posted:
Mon Aug 21, 2017 12:30 pm
by Bart
Thought this deserved a separate thread. I don't think I've found anything particularly interesting yet but I do now recall that some games set model references that appear to point to VROM during the first display frames but which may not be polygon data. There are a couple of spots in Legacy3D.cpp where I even explicitly test for these addresses.
Fighting Vipers 2 performs a very basic set up of culling RAM during the first frame. I will paste the viewport node and culling node it points to here. I print both the integer and float value for each word.
- Code: Select all
Viewport:
000000: 00000000 0.000000
000001: 01000000 0.000000
000002: 04800500 0.000000 <-- display list at 0x500
000003: 43fb4fc7 502.623260
000004: 00000000 0.000000
000005: bf64f92e -0.894427
000006: 3ee4f92e 0.447214
000007: 3f19999a 0.600000
000008: 3fb5fdbb 1.421806
000009: 3feed9e1 1.866024
00000a: 3f000000 0.500000
00000b: 3f000000 0.500000
00000c: 3ea9db1b 0.331750
00000d: 3f718087 0.943367
00000e: 3e8483f4 0.258819
00000f: 3f7746e9 0.965926
000010: 3ea9db1b 0.331750
000011: bf718087 -0.943367
000012: 3e8483f4 0.258819
000013: bf7746e9 -0.965926
000014: 060007bf 0.000000
000015: 00000000 0.000000
000016: 00802000 0.000000
000017: 00800100 0.000000
000018: 00000000 0.000000
000019: 00000000 0.000000
00001a: 00000000 0.000000
00001b: 00000003 0.000000
00001c: 00000000 0.000000
00001d: 00200600 0.000000
00001e: 002007c0 0.000000
00001f: 00000000 0.000000
000020: 00000000 0.000000
000021: 4e6e6b28 1000000000.000000
000022: 00000000 0.000000
000023: 3727c5ac 0.000010
000024: 00004c00 0.000000
000025: 00ffffab 0.000000
- Code: Select all
Display list:
000500: 02040000 0.000000 <-- culling node at 0x40000
000501: 00000000 0.000000
...
Culling node:
040000: 80000412 -0.000000
040001: 00000000 0.000000
040002: 00000000 0.000000
040003: 20000000 0.000000
040004: 00000000 0.000000
040005: 00000000 0.000000
040006: 00000000 0.000000
040007: 017fff00 0.000000 <-- VROM model at 0x7fff00 (0x1fffc00 in bytes)
040008: 01000000 0.000000
040009: eab8eab8 -111775389383496413841719296.000000
- Code: Select all
Data in VROM:
01fffc00h: 9E 28 FD A3 9E 37 08 3A 18 49 94 02 04 BF 39 08
01fffc10h: 2B 8E 02 99 84 77 81 81 0A 49 FF BF F7 3A 39 6C
01fffc20h: 07 3C 13 6C B7 77 05 08 00 86 F8 78 C7 A7 11 74
01fffc30h: 00 64 0D 63 08 6E 0F D3 B6 20 E7 06 6F 5A 11 AE
01fffc40h: 83 52 92 CC 64 19 FF 08 35 F9 2A 4C 74 69 01 B1
01fffc50h: F6 21 A6 70 F6 B5 EC 7C 80 61 F8 85 6A 05 8E CF
01fffc60h: 67 20 DE 7D CF DF 59 64 64 99 E8 3A 23 4E E3 8C
01fffc70h: 4D 81 27 00 53 4F AB 50 61 75 BD A1 7E 26 80 C7
01fffc80h: 51 A8 2A E0 67 38 0A 28 54 88 90 08 8C BF 1D 28
01fffc90h: DC 28 40 C8 0B D9 89 05 A3 E9 B7 37 56 C2 D1 C4
01fffca0h: 71 C8 DC F3 FA 94 25 82 10 1A D8 04 40 5F 33 68
01fffcb0h: 8D 49 70 68 00 CD A3 6A B1 FA 9B 0C F9 29 44 9F
01fffcc0h: 43 50 AA EB E2 77 4C 41 4A F9 10 D2 2B F6 46 08
01fffcd0h: 84 38 80 A8 24 22 7F 32 15 13 7F 08 28 48 12 1D
01fffce0h: 84 37 E5 6F F3 BC 32 D8 0B 9C 26 14 00 BE 57 4C
01fffcf0h: CE 60 05 30 8C 09 A6 0A 04 84 AD 08 FB 07 58 E8
I have a hard time distinguishing polygon data visually. Does this look like a mesh to you guys?
Re: Boot-up data transferred to Real3D

Posted:
Mon Aug 21, 2017 12:42 pm
by Bart
Right after this, the first texture data is written to the FIFO. It's the 0x80 format and the reason Supermodel was never catching it is that for some reason, I now look at (header>>24) & 0x0F rather than all 8 bits. Maybe 0x80 in the most significant byte is just a flag of some sort. In Fighting Vipers 2, it looks like nonsense: an incrementing 8-bit value (the full 32 bits are not written).
Here, the first word encodes the length and the second normally encodes the texture format plus the size. All fields are 0 except the highest bit:
- Code: Select all
0000: 0000080c
0004: 80000000
0008: 00000000
000c: 00000004
0010: 00000008
0014: 0000000c
0018: 00000010
001c: 00000014
0020: 00000018
0024: 0000001c
0028: 00000020
002c: 00000024
0030: 00000028
0034: 0000002c
0038: 00000030
003c: 00000034
0040: 00000038
0044: 0000003c
0048: 00000040
004c: 00000044
0050: 00000048
0054: 0000004c
0058: 00000050
005c: 00000054
0060: 00000058
0064: 0000005c
0068: 00000060
006c: 00000064
0070: 00000068
0074: 0000006c
0078: 00000070
007c: 00000074
0080: 00000078
0084: 0000007c
0088: 00000080
008c: 00000084
0090: 00000088
0094: 0000008c
0098: 00000090
009c: 00000094
00a0: 00000098
00a4: 0000009c
00a8: 000000a0
00ac: 000000a4
00b0: 000000a8
00b4: 000000ac
00b8: 000000b0
00bc: 000000b4
00c0: 000000b8
00c4: 000000bc
00c8: 000000c0
00cc: 000000c4
00d0: 000000c8
00d4: 000000cc
00d8: 000000d0
00dc: 000000d4
00e0: 000000d8
00e4: 000000dc
00e8: 000000e0
00ec: 000000e4
00f0: 000000e8
00f4: 000000ec
00f8: 000000f0
00fc: 000000f4
0100: 000000f8
0104: 000000fc
0108: 00000000
010c: 00000004
0110: 00000008
0114: 0000000c
0118: 00000010
011c: 00000014
0120: 00000018
0124: 0000001c
0128: 00000020
012c: 00000024
0130: 00000028
0134: 0000002c
0138: 00000030
013c: 00000034
0140: 00000038
0144: 0000003c
0148: 00000040
014c: 00000044
0150: 00000048
0154: 0000004c
0158: 00000050
015c: 00000054
0160: 00000058
0164: 0000005c
0168: 00000060
016c: 00000064
0170: 00000068
0174: 0000006c
0178: 00000070
017c: 00000074
0180: 00000078
0184: 0000007c
0188: 00000080
018c: 00000084
0190: 00000088
0194: 0000008c
0198: 00000090
019c: 00000094
01a0: 00000098
01a4: 0000009c
01a8: 000000a0
01ac: 000000a4
01b0: 000000a8
01b4: 000000ac
01b8: 000000b0
01bc: 000000b4
01c0: 000000b8
01c4: 000000bc
01c8: 000000c0
01cc: 000000c4
01d0: 000000c8
01d4: 000000cc
01d8: 000000d0
01dc: 000000d4
01e0: 000000d8
01e4: 000000dc
01e8: 000000e0
01ec: 000000e4
01f0: 000000e8
01f4: 000000ec
01f8: 000000f0
01fc: 000000f4
0200: 000000f8
0204: 000000fc
0208: 000000fc
020c: 000000f8
0210: 000000f4
0214: 000000f0
0218: 000000ec
021c: 000000e8
0220: 000000e4
0224: 000000e0
0228: 000000dc
022c: 000000d8
0230: 000000d4
0234: 000000d0
0238: 000000cc
023c: 000000c8
0240: 000000c4
0244: 000000c0
0248: 000000bc
024c: 000000b8
0250: 000000b4
0254: 000000b0
0258: 000000ac
025c: 000000a8
0260: 000000a4
0264: 000000a0
0268: 0000009c
026c: 00000098
0270: 00000094
0274: 00000090
0278: 0000008c
027c: 00000088
0280: 00000084
0284: 00000080
0288: 0000007c
028c: 00000078
0290: 00000074
0294: 00000070
0298: 0000006c
029c: 00000068
02a0: 00000064
02a4: 00000060
02a8: 0000005c
02ac: 00000058
02b0: 00000054
02b4: 00000050
02b8: 0000004c
02bc: 00000048
02c0: 00000044
02c4: 00000040
02c8: 0000003c
02cc: 00000038
02d0: 00000034
02d4: 00000030
02d8: 0000002c
02dc: 00000028
02e0: 00000024
02e4: 00000020
02e8: 0000001c
02ec: 00000018
02f0: 00000014
02f4: 00000010
02f8: 0000000c
02fc: 00000008
0300: 00000004
0304: 00000000
0308: 000000fc
030c: 000000f8
0310: 000000f4
0314: 000000f0
0318: 000000ec
031c: 000000e8
0320: 000000e4
0324: 000000e0
0328: 000000dc
032c: 000000d8
0330: 000000d4
0334: 000000d0
0338: 000000cc
033c: 000000c8
0340: 000000c4
0344: 000000c0
0348: 000000bc
034c: 000000b8
0350: 000000b4
0354: 000000b0
0358: 000000ac
035c: 000000a8
0360: 000000a4
0364: 000000a0
0368: 0000009c
036c: 00000098
0370: 00000094
0374: 00000090
0378: 0000008c
037c: 00000088
0380: 00000084
0384: 00000080
0388: 0000007c
038c: 00000078
0390: 00000074
0394: 00000070
0398: 0000006c
039c: 00000068
03a0: 00000064
03a4: 00000060
03a8: 0000005c
03ac: 00000058
03b0: 00000054
03b4: 00000050
03b8: 0000004c
03bc: 00000048
03c0: 00000044
03c4: 00000040
03c8: 0000003c
03cc: 00000038
03d0: 00000034
03d4: 00000030
03d8: 0000002c
03dc: 00000028
03e0: 00000024
03e4: 00000020
03e8: 0000001c
03ec: 00000018
03f0: 00000014
03f4: 00000010
03f8: 0000000c
03fc: 00000008
0400: 00000004
0404: 00000000
Re: Boot-up data transferred to Real3D

Posted:
Mon Aug 21, 2017 12:49 pm
by Bart
LA Machineguns writes something slightly more interesting. Note that the high bit is now set for each value and that they no longer always increment by 4. Looks like a calibration curve. Might be instructive to plot it vs. offset to see how much it deviates from linearity. The data appear to be organized as 4 64-entry tables.
- Code: Select all
Real3D DMA copy (PC=0000391C, LR=00003968): 0074A780 -> 94000000, 404
0000: 00000804
0004: 80000000
0008: 80000004
000c: 80000008
0010: 8000000c
0014: 80000010
0018: 80000014
001c: 80000018
0020: 8000001c
0024: 80000020
0028: 80000024
002c: 80000028
0030: 8000002c
0034: 80000030
0038: 80000034
003c: 80000038
0040: 8000003c
0044: 80000040
0048: 80000044
004c: 80000048
0050: 8000004c
0054: 80000050
0058: 80000055
005c: 80000059
0060: 8000005d
0064: 80000061
0068: 80000065
006c: 80000069
0070: 8000006d
0074: 80000071
0078: 80000075
007c: 80000079
0080: 8000007d
0084: 80000081
0088: 80000085
008c: 80000089
0090: 8000008d
0094: 80000091
0098: 80000095
009c: 80000099
00a0: 8000009d
00a4: 800000a1
00a8: 800000a5
00ac: 800000aa
00b0: 800000ae
00b4: 800000b2
00b8: 800000b6
00bc: 800000ba
00c0: 800000be
00c4: 800000c2
00c8: 800000c6
00cc: 800000ca
00d0: 800000ce
00d4: 800000d2
00d8: 800000d6
00dc: 800000da
00e0: 800000de
00e4: 800000e2
00e8: 800000e6
00ec: 800000ea
00f0: 800000ee
00f4: 800000f2
00f8: 800000f6
00fc: 800000fa
0100: 800000ff
0104: 80000000
0108: 80000004
010c: 80000008
0110: 8000000c
0114: 80000010
0118: 80000014
011c: 80000018
0120: 8000001c
0124: 80000020
0128: 80000024
012c: 80000028
0130: 8000002c
0134: 80000030
0138: 80000034
013c: 80000038
0140: 8000003c
0144: 80000040
0148: 80000044
014c: 80000048
0150: 8000004c
0154: 80000050
0158: 80000055
015c: 80000059
0160: 8000005d
0164: 80000061
0168: 80000065
016c: 80000069
0170: 8000006d
0174: 80000071
0178: 80000075
017c: 80000079
0180: 8000007d
0184: 80000081
0188: 80000085
018c: 80000089
0190: 8000008d
0194: 80000091
0198: 80000095
019c: 80000099
01a0: 8000009d
01a4: 800000a1
01a8: 800000a5
01ac: 800000aa
01b0: 800000ae
01b4: 800000b2
01b8: 800000b6
01bc: 800000ba
01c0: 800000be
01c4: 800000c2
01c8: 800000c6
01cc: 800000ca
01d0: 800000ce
01d4: 800000d2
01d8: 800000d6
01dc: 800000da
01e0: 800000de
01e4: 800000e2
01e8: 800000e6
01ec: 800000ea
01f0: 800000ee
01f4: 800000f2
01f8: 800000f6
01fc: 800000fa
0200: 800000ff
0204: 80000000
0208: 80000004
020c: 80000008
0210: 8000000c
0214: 80000010
0218: 80000014
021c: 80000018
0220: 8000001c
0224: 80000020
0228: 80000024
022c: 80000028
0230: 8000002c
0234: 80000030
0238: 80000034
023c: 80000038
0240: 8000003c
0244: 80000040
0248: 80000044
024c: 80000048
0250: 8000004c
0254: 80000050
0258: 80000055
025c: 80000059
0260: 8000005d
0264: 80000061
0268: 80000065
026c: 80000069
0270: 8000006d
0274: 80000071
0278: 80000075
027c: 80000079
0280: 8000007d
0284: 80000081
0288: 80000085
028c: 80000089
0290: 8000008d
0294: 80000091
0298: 80000095
029c: 80000099
02a0: 8000009d
02a4: 800000a1
02a8: 800000a5
02ac: 800000aa
02b0: 800000ae
02b4: 800000b2
02b8: 800000b6
02bc: 800000ba
02c0: 800000be
02c4: 800000c2
02c8: 800000c6
02cc: 800000ca
02d0: 800000ce
02d4: 800000d2
02d8: 800000d6
02dc: 800000da
02e0: 800000de
02e4: 800000e2
02e8: 800000e6
02ec: 800000ea
02f0: 800000ee
02f4: 800000f2
02f8: 800000f6
02fc: 800000fa
0300: 800000ff
0304: 80000000
0308: 80000004
030c: 80000008
0310: 8000000c
0314: 80000010
0318: 80000014
031c: 80000018
0320: 8000001c
0324: 80000020
0328: 80000024
032c: 80000028
0330: 8000002c
0334: 80000030
0338: 80000034
033c: 80000038
0340: 8000003c
0344: 80000040
0348: 80000044
034c: 80000048
0350: 8000004c
0354: 80000050
0358: 80000055
035c: 80000059
0360: 8000005d
0364: 80000061
0368: 80000065
036c: 80000069
0370: 8000006d
0374: 80000071
0378: 80000075
037c: 80000079
0380: 8000007d
0384: 80000081
0388: 80000085
038c: 80000089
0390: 8000008d
0394: 80000091
0398: 80000095
039c: 80000099
03a0: 8000009d
03a4: 800000a1
03a8: 800000a5
03ac: 800000aa
03b0: 800000ae
03b4: 800000b2
03b8: 800000b6
03bc: 800000ba
03c0: 800000be
03c4: 800000c2
03c8: 800000c6
03cc: 800000ca
03d0: 800000ce
03d4: 800000d2
03d8: 800000d6
03dc: 800000da
03e0: 800000de
03e4: 800000e2
03e8: 800000e6
03ec: 800000ea
03f0: 800000ee
03f4: 800000f2
03f8: 800000f6
03fc: 800000fa
0400: 800000ff
Re: Boot-up data transferred to Real3D

Posted:
Tue Aug 22, 2017 5:42 am
by Ian
Could be a gamma look up table?
I know the translator map table also writes to texture memory
It allocates a table of 256 entries
Re: Boot-up data transferred to Real3D

Posted:
Tue Aug 22, 2017 9:32 am
by Bart
256 entries is pretty small. It could easily be hiding under our noses as a normal texture, couldn't it?
Any chance this could be the translator map? I guess I ought to check Daytona 2, which would have a more distinctive set of values if this were really it.
Re: Boot-up data transferred to Real3D

Posted:
Tue Aug 22, 2017 9:40 am
by Ian
Honestly I've no clue what the translator map is even supposed to do
But as far as I can see it only effects textures anyway
Re: Boot-up data transferred to Real3D

Posted:
Wed Aug 23, 2017 9:59 am
by Bart
Something I didn't notice initially is that the last of these 4 tables has the values in descending order. Could this explain the color inversion in Daytona USA? Do the addresses line up in any way with the texture color indices + translator map bits? Daytona 2 uploads the exact same values as VON2 and Fighting Vipers 2.
Re: Boot-up data transferred to Real3D

Posted:
Wed Aug 23, 2017 2:13 pm
by Ian
Bart,
Virtua on seems to be changing the light model with different levels. I spent a few mins this evening debugging this thing and i noticed in between levels it writes to
void CReal3D::WriteTAP
Could there be data in here which configs the GPU ?
Re: Boot-up data transferred to Real3D

Posted:
Fri Aug 25, 2017 6:37 am
by Bart
Can't rule anything out, I suppose. I haven't really followed the lighting model discussions very well but are you guys sure the various differences and exceptions could not be explained by some sort of look-up tables internal to the Real3D being different? It seems highly unlikely that there would be config bits that switch between minor, fixed variations of a lighting model. Being able to modify some sort of internal color table makes more sense but even then, it's exceedingly bizarre that the developers at Sega would request the ability to do so given that the default lighting model already suits their purpose. The whole TAP functionality was probably never intended for anyone outside of Real3D themselves to mess with.
I'll have a look when I get some time this weekend to see what's being written. I don't know how many other games use the TAP after boot-up, so that will be worth investigating as well.
Out of curiosity, are the mis-colored elements in polygon RAM?
Re: Boot-up data transferred to Real3D

Posted:
Fri Aug 25, 2017 6:42 am
by Ian
No really the whole lighting model has been modified. It's only a minor change but it makes quite a profound difference to the final output colour
It's this in the shaders
// Optional clamping, value is allowed to be negative
if(sunClamp) {
sunFactor = max(sunFactor,0.0);
}
If the value is negative it literally subtracts from the ambient, making the scene darker.