Small bugs in latest WIP about TG3k

Found a bug? Please report it, but remember to follow the bug reporting guidelines.
Missing a sane feature? Let us know!
But please do NOT request ports to other systems.

Moderator: ZSNES Mods

Locked
simon5
New Member
Posts: 6
Joined: Tue May 17, 2005 5:15 am

Small bugs in latest WIP about TG3k

Post by simon5 »

Hi,

I played TG3k about 3 hours to beat the game at the easy difficulty level.
I noticed a small bug.

It's when the track split in two and when the track come back together.
In several TG3k tracks, there's one alternate longer road with bonuses or the main road which is shorter.

When the track split up and when it comes back together, the graphics are really bad, you can still play the game but it's a bit disconcerting. In the real game, these are nicely rendered to look like a normal road fork.

Also, some tracks have fog, the fog is really white. I don't remember enough the game to know if it's normal, but I think it's a bug. The fog should be in grey tones a bit like in TG2.

If you want more information about these bugs, please tell me.
I also want to congratulate you, because this is the SNES game I was waiting for. The best racing game on SNES IMHO.

Simon
TG3k rules, so ZSNES rules!
simon5
New Member
Posts: 6
Joined: Tue May 17, 2005 5:15 am

Post by simon5 »

NSRT v3.3 RC2 - Nach's SNES ROM Tools

---------------------Internal ROM Info----------------------
File: Top Gear 3000 (US).smc
Name: TOP GEAR 3000 Company: Kemco
Header: GD3 Bank: LoROM
Interleaved: No SRAM: 0 Kb
Type: DSP-4 ROM: 8 Mb
Country: USA Video: NTSC
ROM Speed: 120ns (FastROM) Revision: 1.0
Checksum: Good 0x5327 CRC32: A20BE998
--------------------------Database--------------------------
Name: Top Gear 3000
Country: USA Revision: 1.0
Port 1: Gamepad Port 2: Gamepad
Genre 1: Racing Genre 2: Arcade
TG3k rules, so ZSNES rules!
snkcube
Hero of Time
Posts: 2646
Joined: Fri Jul 30, 2004 2:49 am
Location: In front of the monitor
Contact:

Post by snkcube »

I think the devs know about the graphics problem.
Try out CCleaner and other free software at Piriform
Image
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Now they do.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
simon5
New Member
Posts: 6
Joined: Tue May 17, 2005 5:15 am

Post by simon5 »

I sent two savestates to grinvader and to ipher gmail account.

There's some screenshots...

Fog and fork graphical glitches
Image

Fog and fork graphical glitches from another angle
Image

Fog graphical glitch
Image

Fog graphical glitch from another angle
Image

Fork graphical glitch
Image

Fork graphical glitch from another angle
Image

Fork graphical glitch from another angle again
Image

I hope it will help you a bit, I don't care much about the fog because I'm not 100% sure it's a bug, but if you can correct the fork, it would be great!

Thanks,
Simon

P.S. For people who likes to play this game, use a nitro just before the finish line to get a 30000 bonus. If you hit nothing besides cars in the race, you'll get a 40000 bonus. If you hit no cars in the race, you'll get another bonus. Bonuses ARE cumulative hehe! There's two other bonuses but I don't know how to get them yet.
TG3k rules, so ZSNES rules!
adventure_of_link
Locksmith of Hyrule
Posts: 3634
Joined: Sun Aug 08, 2004 7:49 am
Location: 255.255.255.255
Contact:

Post by adventure_of_link »

Simon: I believe there's another bonus in stake for you if you finish the race while staying on the track, without going off it.
<Nach> so why don't the two of you get your own room and leave us alone with this stupidity of yours?
NSRT here.
simon5
New Member
Posts: 6
Joined: Tue May 17, 2005 5:15 am

Post by simon5 »

You're right.

Only Bonus I don't know how to get is the Bonus B.
Bonus A = 30000 nitro at the finish line
Bonus B = ?
Bonus C = 70000 hit no cars during the race
Bonus D = 40000 hit nothing besides cars
Bonus E = 20000 never go into the grass

I guess that a perfect race will give you about 300000 credits so you can buy all equipment rather quickly!
TG3k rules, so ZSNES rules!
simon5
New Member
Posts: 6
Joined: Tue May 17, 2005 5:15 am

Post by simon5 »

I beaten the game at Easy, Medium and Hard.

I noticed no more bugs besides road forks and the fog.

Everything seems to work perfectly, Boost, Jump, Attractor, Warp, Infra-Red...
TG3k rules, so ZSNES rules!
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Thanks for all the testing.

My only hope is that our anonymous contributor sees this and contributes fixes.

Once all is good, I'll try to finalize things with cleanup, and bring save related things up to date.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Dreamer_Nom
Rookie
Posts: 12
Joined: Sun Sep 05, 2004 1:06 am

Post by Dreamer_Nom »

Thanks for all the testing.
Double thanks too.
My only hope is that our anonymous contributor sees this and contributes fixes.

Code: Select all

GNU Diff unified format:

--- old_dsp4emu.c	Sat Jun 11 12:56:38 2005
+++ dsp4emu.c	Wed Dec 28 19:58:02 2005
@@ -97,6 +97,9 @@
 int16 view_yofs2;           // future viewer y-vertical scroll
 int16 view_yofsenv;         // y-scroll shaping factor
 
+int16 view_turnoff_x;				// road turnoff data
+int16 view_turnoff_dx;			// road turnoff delta factor
+
 
 // drawing area
 
@@ -310,6 +313,9 @@
   view_xofs1 = world_x >> 16;
   view_yofs1 = world_yofs;
 
+	view_turnoff_x = 0;
+	view_turnoff_dx = 0;
+
   // first raster line
   poly_raster[0][0] = poly_bottom[0][0];
 
@@ -320,7 +326,7 @@
 
     // perspective projection of world (x,y,scroll) points
     // based on the current projection lines
-    view_x2 = ((world_x + world_xenv) >> 16) * distance >> 15;
+		view_x2 = ( ( ( world_x + world_xenv ) >> 16 ) * distance >> 15 ) + ( view_turnoff_x * distance >> 15 );
     view_y2 = (world_y >> 16) * distance >> 15;
     view_xofs2 = view_x2;
     view_yofs2 = (world_yofs * distance >> 15) + poly_bottom[0][0] - view_y2;
@@ -388,7 +394,7 @@
       // rasterize line
       for (lcv = 0; lcv < segments; lcv++)
       {
-        // 1. HDMA memory pointer
+        // 1. HDMA memory pointer (bg1)
         // 2. vertical scroll offset ($210E)
         // 3. horizontal scroll offset ($210D)
 
@@ -396,7 +402,6 @@
         DSP4_WRITE_WORD((y_scroll + 0x8000) >> 16);
         DSP4_WRITE_WORD((x_scroll + 0x8000) >> 16);
 
-
         // update memory address
         poly_ptr[0][0] -= 4;
 
@@ -423,6 +428,9 @@
     world_x += (world_dx + world_xenv);
     world_y += world_dy;
 
+		// update road turnoff position
+		view_turnoff_x += view_turnoff_dx;
+
     ////////////////////////////////////////////////////
     // command check
 
@@ -435,37 +443,25 @@
     if (distance == -0x8000)
       break;
 
-    if ((uint16) distance == 0x8001)
-    {
-      /*
-      (code)
-      308000 W: 01
-      308001 W: 80
-      308000 W: E4
-      308001 W: 0B
-      308000 W: 5C
-      308001 W: A0
-      308000 W: 38
-      308001 W: FD
-      (normal)
-      308000 W: 07
-      308001 W: 0B
-      308000 W: 00
-      308001 W: 00
-      308000 W: 00
-      308001 W: 01
-      308000 W: 00
-      308001 W: 00
-        */
-
-      DSP4.in_count = 6;
-      DSP4_WAIT(2) resume2 : distance = DSP4_READ_WORD();
-      DSP4_READ_WORD();
-      DSP4_READ_WORD();
-
-      DSP4.in_count = 2;
-      DSP4_WAIT(1)
-    }
+		// road turnoff
+		if( (uint16) distance == 0x8001 ) {
+			DSP4.in_count = 6;
+			DSP4_WAIT(2) resume2:
+
+			distance = DSP4_READ_WORD();
+			view_turnoff_x = DSP4_READ_WORD();
+			view_turnoff_dx = DSP4_READ_WORD();
+
+			// factor in new changes
+			view_x1 += ( view_turnoff_x * distance >> 15 );
+			view_xofs1 += ( view_turnoff_x * distance >> 15 );
+
+			// update stepping values
+			view_turnoff_x += view_turnoff_dx;
+
+			DSP4.in_count = 2;
+			DSP4_WAIT(1)
+		}
 
     // already have 2 bytes read
     DSP4.in_count = 6;
@@ -631,9 +627,9 @@
       // rasterize line
       for (lcv = 0; lcv < segments; lcv++)
       {
-        // 1. HDMA memory pointer
-        // 2. vertical scroll offset ($210E)
-        // 3. horizontal scroll offset ($210D)
+        // 1. HDMA memory pointer (bg2)
+        // 2. vertical scroll offset ($2110)
+        // 3. horizontal scroll offset ($210F)
 
         DSP4_WRITE_WORD(poly_ptr[0][0]);
         DSP4_WRITE_WORD((y_scroll + 0x8000) >> 16);
@@ -871,6 +867,7 @@
       int32 left_inc, right_inc;
       int16 x1_final, x2_final;
       int16 env[2][2];
+			int16 poly;
 
       // SR = 0x00
 
@@ -902,6 +899,9 @@
       // tell user how many raster structures to read in
       DSP4_WRITE_WORD(segments);
 
+			// normal parameters
+			poly = polygon;
+
       /////////////////////////////////////////////////////
 
       // scan next command if no SR check needed
@@ -909,17 +909,22 @@
       {
         int32 win_left, win_right;
 
+				// road turnoff selection
+				if( (uint16) envelope[ polygon ][ 0 ] == (uint16) 0xc001 )
+					poly = 1;
+				else if( envelope[ polygon ][ 1 ] == 0x3fff )
+					poly = 1;
 
         ///////////////////////////////////////////////
         // left side of polygon
 
         // perspective correction on additional shaping parameters
-        env[0][0] = envelope[polygon][0] * poly_plane[polygon] >> 15;
+        env[0][0] = envelope[polygon][0] * poly_plane[poly] >> 15;
         env[0][1] = envelope[polygon][0] * distance >> 15;
 
         // project new shapes (left side)
-        x1_final = view_x[polygon] + env[0][0];
-        x2_final = poly_start[polygon] + env[0][1];
+        x1_final = view_x[poly] + env[0][0];
+        x2_final = poly_start[poly] + env[0][1];
 
         // interpolate between projected points with shaping
         left_inc = (x2_final - x1_final) * DSP4_Inverse(segments) << 1;
@@ -930,12 +935,12 @@
         // right side of polygon
 
         // perspective correction on additional shaping parameters
-        env[1][0] = envelope[polygon][1] * poly_plane[polygon] >> 15;
+        env[1][0] = envelope[polygon][1] * poly_plane[poly] >> 15;
         env[1][1] = envelope[polygon][1] * distance >> 15;
 
         // project new shapes (right side)
-        x1_final = view_x[polygon] + env[1][0];
-        x2_final = poly_start[polygon] + env[1][1];
+        x1_final = view_x[poly] + env[1][0];
+        x2_final = poly_start[poly] + env[1][1];
 
         // interpolate between projected points with shaping
         right_inc = (x2_final - x1_final) * DSP4_Inverse(segments) << 1;
@@ -945,8 +950,8 @@
         ///////////////////////////////////////////////
         // update each point on the line
 
-        win_left = SEX16(poly_cx[polygon][0] - poly_start[polygon] + env[0][0]);
-        win_right = SEX16(poly_cx[polygon][1] - poly_start[polygon] + env[1][0]);
+        win_left = SEX16(poly_cx[polygon][0] - poly_start[poly] + env[0][0]);
+        win_right = SEX16(poly_cx[polygon][1] - poly_start[poly] + env[1][0]);
 
         // update distance drawn into world
         poly_plane[polygon] = distance;
@@ -993,7 +998,7 @@
       // Post-update
 
       // new projection spot to continue rasterizing from
-      poly_start[polygon] = view_x[polygon];
+      poly_start[polygon] = view_x[poly];
     } // end polygon rasterizer
   }
   while (1);
@@ -1612,6 +1617,9 @@
   view_xofs1 = world_x >> 16;
   view_yofs1 = world_yofs;
 
+	view_turnoff_x = 0;
+	view_turnoff_dx = 0;
+
   // first raster line
   poly_raster[0][0] = poly_bottom[0][0];
 
@@ -1623,7 +1631,7 @@
 
     // perspective projection of world (x,y,scroll) points
     // based on the current projection lines
-    view_x2 = ((world_x + world_xenv) >> 16) * distance >> 15;
+		view_x2 = ( ( ( world_x + world_xenv ) >> 16 ) * distance >> 15 ) + ( view_turnoff_x * distance >> 15 );
     view_y2 = (world_y >> 16) * distance >> 15;
     view_xofs2 = view_x2;
     view_yofs2 = (world_yofs * distance >> 15) + poly_bottom[0][0] - view_y2;
@@ -1724,7 +1732,7 @@
       // rasterize line
       for (lcv = 0; lcv < segments; lcv++)
       {
-        // 1. HDMA memory pointer
+        // 1. HDMA memory pointer (bg1)
         // 2. vertical scroll offset ($210E)
         // 3. horizontal scroll offset ($210D)
 
@@ -1758,49 +1766,40 @@
     world_x += (world_dx + world_xenv);
     world_y += world_dy;
 
+		// update road turnoff position
+		view_turnoff_x += view_turnoff_dx;
+
     ////////////////////////////////////////////////////
     // command check
 
     // scan next command
     DSP4.in_count = 2;
-    DSP4_WAIT(2) resume2 :
+    DSP4_WAIT(2) resume2:
 
     // check for termination
     distance = DSP4_READ_WORD();
     if (distance == -0x8000)
       break;
 
-    if ((uint16) distance == 0x8001)
-    {
-      /*
-      (code)
-      308000 W: 01
-      308001 W: 80
-      308000 W: E4
-      308001 W: 0B
-      308000 W: 5C
-      308001 W: A0
-      308000 W: 38
-      308001 W: FD
-      (normal)
-      308000 W: 07
-      308001 W: 0B
-      308000 W: 00
-      308001 W: 00
-      308000 W: 00
-      308001 W: 01
-      308000 W: 00
-      308001 W: 00
-        */
-
-      DSP4.in_count = 6;
-      DSP4_WAIT(3) resume3 : distance = DSP4_READ_WORD();
-      DSP4_READ_WORD();
-      DSP4_READ_WORD();
-
-      DSP4.in_count = 2;
-      DSP4_WAIT(2)
-    }
+		// road splice
+		if( (uint16) distance == 0x8001 ) {
+			DSP4.in_count = 6;
+			DSP4_WAIT(3) resume3:
+
+			distance = DSP4_READ_WORD();
+			view_turnoff_x = DSP4_READ_WORD();
+			view_turnoff_dx = DSP4_READ_WORD();
+
+			// factor in new changes
+			view_x1 += ( view_turnoff_x * distance >> 15 );
+			view_xofs1 += ( view_turnoff_x * distance >> 15 );
+
+			// update stepping values
+			view_turnoff_x += view_turnoff_dx;
+
+			DSP4.in_count = 2;
+			DSP4_WAIT(1)
+		}
 
     // already have 2 bytes in queue
     DSP4.in_count = 6;
@@ -1975,9 +1974,9 @@
       // rasterize line
       for (lcv = 0; lcv < segments; lcv++)
       {
-        // 1. HDMA memory pointer
-        // 2. vertical scroll offset ($210E)
-        // 3. horizontal scroll offset ($210D)
+        // 1. HDMA memory pointer (bg2)
+        // 2. vertical scroll offset ($2110)
+        // 3. horizontal scroll offset ($210F)
 
         DSP4_WRITE_WORD(poly_ptr[0][0]);
         DSP4_WRITE_WORD((y_scroll + 0x8000) >> 16);
@@ -2170,7 +2169,7 @@
       case 0x0006:
         DSP4_OP06(); break;
 
-      // single-player track fork projection
+      // single-player track turnoff projection
       case 0x0007:
         DSP4_OP07(); break;
 
@@ -2226,7 +2225,7 @@
       case 0x000F:
         DSP4_OP0F(); break;
 
-      // single-player track fork projection with lighting
+      // single-player track turnoff projection with lighting
       case 0x0010:
         DSP4_OP10(); break;
The above code will render the turnoffs (forks) about 90% on the practical side. Some road glitches will still be noticeable on the ramps for the main turns (~5 raster lines). And the vehicles will temporarily disappear when taking a ramp for the offroads (~5 frames).

These problems are minor but the road textures do show up from limited testing -- much more visually pleasing. They are too complex to figure out atm. Maybe a few years. :lol:

The fog is not rendered by the dsp chip above the track (~95% sure). HDMA is used in blitting the background texture above the horizon level but that's the limit of my knowledge.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Dreamer_Nom: Thanks for for the fix, I'll commit it as soon as a get a chance.
Could you do me a favor and pass me your e-mail address, so I can notify you if anything else pops up?


Edit: I just tried it, and played a bit, and I got the game stuck into an infinite loop! Not good :(
I could setup a ZSNES movie for it if you want.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
simon5
New Member
Posts: 6
Joined: Tue May 17, 2005 5:15 am

Post by simon5 »

Hi,

I was wondering if there has been any progress ?

Thanks !
TG3k rules, so ZSNES rules!
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Try v1.51
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Locked