Pro-1000 API

Technical discussion for those interested in Supermodel development and Model 3 reverse engineering. Prospective contributors welcome.
Forum rules
Keep it classy!

  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!

Pro-1000 API

Postby Bart » Thu May 05, 2016 6:46 pm

Look what I got a hold of :)
Attachments
Real3DPro1K.jpg
Real3DPro1K.jpg (87.43 KiB) Viewed 10236 times
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: Pro-1000 API

Postby LsrgcBath » Thu May 05, 2016 7:32 pm

Look that, now things get serious.

Who did you have to kill or give money to get it?

I suppose now you two can unravel more clearly some of the best kept secrets of Model 3.

Can I now rely on Daytona USA 3 made by SMAM R & D Dept (aka Supermodel Amusement Machine Research and Development Department)?

From a practical way what can be done with the official API that can benefit the emulator?
User avatar
LsrgcBath
 
Posts: 130
Joined: Sat Jan 21, 2012 2:43 pm
Location: Brazil - Sao Paulo

Re: Pro-1000 API

Postby Bart » Thu May 05, 2016 8:13 pm

LsrgcBath wrote:Look that, now things get serious.

Who did you have to kill or give money to get it?


nightforce.jpg
nightforce.jpg (32.23 KiB) Viewed 10219 times


Are you sure you want to know?

From a practical way what can be done with the official API that can benefit the emulator?


It really depends. We are hoping that the polygon data was assembled on the PC in its final form and sent to the Pro-1000 via SCSI for display. If that's the case, then it should be possible to disassemble the C library files, where the location of each API function is clearly known, and see what bits are being set and so forth. If, however, the data is sent in some intermediate format and the Pro-1000 itself performs the final assembly, then this won't help very much. The SDK includes ROM files for the Pro-1000 firmware and when I looked at them in a hex editor, I immediately recognized it as PowerPC code! So the Model 3 was really just a slightly scaled down Pro-1000. Even the CPU board came from Lockheed Martin! Sega only contributed the sound hardware, drive boards, and the System 24 tile generator.
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: Pro-1000 API

Postby Bart » Thu May 05, 2016 8:14 pm

Maybe I'll write a Pro-1000 emulator someday and contribute it to MAME/MESS. There are some demos included with the SDK and I think it would be neat to get them running again.
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: Pro-1000 API

Postby Jiterdomer » Thu May 05, 2016 8:18 pm

Is it compatible with Windows 10 without a Virtual Machine? I hope this will work because this is going to help with Supermodel progress.
Feel the heartbeat of my machine through this tight seat. I feel every motion of my machine
Image
User avatar
Jiterdomer
 
Posts: 627
Joined: Mon Sep 26, 2011 6:37 pm
Location: Los Angeles, California

Re: Pro-1000 API

Postby Bart » Thu May 05, 2016 9:41 pm

Jiterdomer wrote:Is it compatible with Windows 10 without a Virtual Machine? I hope this will work because this is going to help with Supermodel progress.


Nope. It won't run on modern Windows. This stuff is ancient. But it should be possible to emulate the Pro-1000 in MESS or as part of some other x86 emulation package. If someone really wanted to go nuts, they might even be able to create a virtual SCSI driver for VMware that lets the virtual machine talk to a Pro-1000 emulator window running natively outside the VM.

The Pro-1000 is a souped-up version of Model 3 (or rather, Model 3 is a stripped down Pro-1000). This should help but before everyone gets too excited, there is still a lot of information missing. We now know the polygon header bits, for example, but that doesn't mean we know exactly how they are all supposed to function.
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: Pro-1000 API

Postby Bart » Thu May 05, 2016 9:45 pm

Hey Ian, I saved you some work and figured out the polygon header bits from the API header files :) We were right all along about many of them, including specular. A few are clearly not used in Model 3, such as the extra texture Y address bits (Pro-1000 supported more texture RAM). And translucency is a bit different. Looks like you nailed fixed shading and smooth shading,though!

Give this bad boy a spin:

Code: Select all
/*
 * Real3D Pro-1000 polygon header definition
 */

#include <cstdio>
#include <cstring>
#include <cstdint>

class PRO_MCW1
{
public:
  // header[5]:7-0
  unsigned long _y_memory_map_start           :  7 ; // 6-0
  unsigned long _x_memory_map_start_bit_0     :  1 ; // 7
   
  // header[4]:7-0
  unsigned long _x_memory_map_start_bits_6_1  :  6 ; // 5-0
  unsigned long _even_bank_select             :  1 ; // 6
  unsigned long _translator_map_select        :  1 ; // 7

  // header[3]:7-0
  unsigned long _map_size_y                   :  3 ; // 2-0
  unsigned long _map_size_x                   :  3 ; // 5-3
  unsigned long _y_wrap_smoothing             :  1 ; // 6
  unsigned long _x_wrap_smoothing             :  1 ; // 7
 
  // header[2]:7-0
  unsigned long _y_mirror                     :  1 ; // 0
  unsigned long _x_mirror                     :  1 ; // 1
  unsigned long _microtexture_min_lod         :  2 ; // 3-2
  unsigned long _microtexture_enable          :  1 ; // 4
  unsigned long _microtexture_map_select      :  3 ; // 7-5
} ;

class PRO_MCW2
{
public :
  // header[6]
  unsigned long _translucency_mode            :  3 ; // 2-0
  unsigned long _layered_polygon              :  1 ; // 3
  unsigned long _high_priority                :  1 ; // 4
  unsigned long _shininess                    :  2 ; // 6-5
  unsigned long _texture_mode                 :  3 ; // 9-7
  unsigned long _enable_texture_modulation    :  1 ; // 10
  unsigned long _light_modifier               :  5 ; // 15-11
  unsigned long _luminous_feature             :  1 ; // 16
  unsigned long _translucency_pattern_select  :  1 ; // 17
  unsigned long _polygon_translucency         :  6 ; // 23-18
  unsigned long _translator_map_offset        :  7 ; // 30-24
  unsigned long _contour_texture_enable       :  1 ; // 31
} ;

class PRO_HW_Polygon
{
public:
  // header[0]
  unsigned long _use_prev_vert0               :  1 ; // 0
  unsigned long _use_prev_vert1               :  1 ; // 1
  unsigned long _use_prev_vert2               :  1 ; // 2
  unsigned long _use_prev_vert3               :  1 ; // 3
  unsigned long _smoothing                    :  1 ; // 4
  unsigned long _polygon_is_points            :  1 ; // 5
  unsigned long _vertex_count                 :  1 ; // 6
  unsigned long _enable_specular              :  1 ; // 7
  unsigned long _discard_2                    :  1 ; // 8
  unsigned long _discard_1                    :  1 ; // 9
  unsigned long _node_id                      : 15 ; // 24-10
  unsigned long _clockwise_data               :  1 ; // 25
  unsigned long _specular                     :  6 ; // 31-26

  // header[1]
  unsigned long _no_los_return                :  1 ; // 0
  unsigned long _actual_color                 :  1 ; // 1
  unsigned long _last_polygon                 :  1 ; // 2
  unsigned long _smooth_shading               :  1 ; // 3
  unsigned long _double_sided                 :  1 ; // 4
  unsigned long _fixed_shading                :  1 ; // 5
  unsigned long _texture_address_scale        :  1 ; // 6
  unsigned long _edge_on_translucency         :  1 ; // 7
  unsigned long _normal_x                     : 24 ; // 31-8

  // header[2]
  unsigned long _mcw1_bits_24_31              :  8 ; // 7-0
  unsigned long _normal_y                     : 24 ; // 31-8

  // header[3]
  unsigned long _mcw1_bits_16_23              :  8 ; // 7-0
  unsigned long _normal_z                     : 24 ; // 31-8

  // header[4]
  unsigned long _mcw1_bits_8_15               :  8 ; // 7-0
  unsigned long _color                        : 24 ; // 31-8

  // header[5]
  unsigned long _mcw1_bits_0_7                :  8 ; // 7-0
  unsigned long _texture_np                   : 24 ; // 31-8
 
  // header[6]
  PRO_MCW2      _mcw2 ;
};

static_assert(sizeof(PRO_HW_Polygon) == 7*4, "Polygon header is not 7 words long");

int main()
{
  PRO_HW_Polygon p;
  memset(&p, 0, sizeof(p));
 
  // Test out some bits!
  p._enable_specular = 1;
  p._fixed_shading = 1;
  p._contour_texture_enable = 1;

  // Print them out as they would appear on Model 3
  uint32_t *data = reinterpret_cast<uint32_t *>(&p);
  for (int i = 0; i < 7; i++)
    printf("%d: %08x\n", i, data[i]);
  return 0;
}
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: Pro-1000 API

Postby Bart » Thu May 05, 2016 9:53 pm

These API headers are really interesting. In the culling node file, I even found a reference to Model 3 Step 2.0:

Code: Select all
#ifdef STEP2
      float           model_scale  ;
   
      unsigned        x_offset           :   7 ;
      unsigned        y_offset           :   7 ;
      unsigned        switch_bank        :   1 ;
      unsigned        texture_replace    :   1 ;
      unsigned        spare2             :  16 ;
#endif


Precisely the difference between Step 1.0 and Step 1.5+ scene graphs that we identified way back in 2003. Very cool to find it in the "official" API. Amazing how much of this was worked out from scratch by the Supermodel devs.

BTW, references to NEW_MODEL in the code are for a later, more powerful revision than Model 3 (i.e., the Pro-1000 itself) that featured full-fledged z and stencil buffers. In case you haven't dealt with bit fields before, note that they are ordered LSB to MSB, so you want to ignore the BIG_ENDIAN versions, even though they misleadingly look like they're in the right order.
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: Pro-1000 API

Postby Jiterdomer » Thu May 05, 2016 10:13 pm

Bart wrote:
Jiterdomer wrote:Is it compatible with Windows 10 without a Virtual Machine? I hope this will work because this is going to help with Supermodel progress.


Nope. It won't run on modern Windows. This stuff is ancient. But it should be possible to emulate the Pro-1000 in MESS or as part of some other x86 emulation package. If someone really wanted to go nuts, they might even be able to create a virtual SCSI driver for VMware that lets the virtual machine talk to a Pro-1000 emulator window running natively outside the VM.

The Pro-1000 is a souped-up version of Model 3 (or rather, Model 3 is a stripped down Pro-1000). This should help but before everyone gets too excited, there is still a lot of information missing. We now know the polygon header bits, for example, but that doesn't mean we know exactly how they are all supposed to function.


That's sounds cool it feels like we're making an HD remaster of Model 3 games! :D
Feel the heartbeat of my machine through this tight seat. I feel every motion of my machine
Image
User avatar
Jiterdomer
 
Posts: 627
Joined: Mon Sep 26, 2011 6:37 pm
Location: Los Angeles, California

Re: Pro-1000 API

Postby Ian » Thu May 05, 2016 11:53 pm

That's really an amazing find. Nice to know I was pretty much along the right lines :) some of those things would have been extremely hard to work out by guess work.
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Next

Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 1 guest

cron