Previous Thread
Next Thread
Print Thread
Page 1 of 5 1 2 3 4 5
#121012 06/13/22 10:13 PM
Joined: Feb 2014
Posts: 852
Likes: 48
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 852
Likes: 48
Hi guys,

I got interested in Atari Lemans and was reading the Service Manuals and wanted to see the track patterns in the roms:

After fiddling with lua for a bit I was able to see the track data and the car data in the rom.

I don't know why, but the track doesn't look right unless I remove the 7th horizontal byte.

Code

-- same code but spread out to multiple lines

function prtbyte(b) local i for i=7,0,-1 do if (b & (2^i)) ~= 0 then io.write("*") else io.write (" ") end end end
fnamestable = {"/mnt/z/mame/roms/lemans/005837.n5","/mnt/z/mame/roms/lemans/005838.n4","/mnt/z/mame/roms/lemans/005839.n6"} 
for fni,fn in pairs(fnamestable) do 
f = io.open(fn,"r") a = f:read("*a") 
for z = 0,0x7ff,0x200 do print(fn, z) 
for y=0,31 do for x=0,15 do 
adr = (x | (y<<4)) + z b = a:byte(1+adr) 
if x==0 then io.write("adr:"..string.format("%3x",adr)) end 
if x~=7 then prtbyte(b) end end print() end print(fn,z,"end") end end  
fn = "/mnt/z/mame/roms/lemans/005837.n5"
f = io.open(fn,"r") a = f:read("*a") 
for x = 0,31 do print(fn,x) for y=0,7 do 
adr = (y | (((x & 0x10)>>4) << 3) | ((x & 0xf)<<5)) | (2^9) | (2^10) 
io.write(string.format("%2x",adr).." ") b = a:byte(1+adr) prtbyte(b) 
adr = adr | (2^4) b= a:byte(1+adr) prtbyte(b) 
print("  "..string.format("%2x",adr)) end 
print("------") 
end 


-- same code as a single line

function prtbyte(b) local i for i=7,0,-1 do if (b & (2^i)) ~= 0 then io.write("*") else io.write (" ") end end end
 fnamestable = {"/mnt/z/mame/roms/lemans/005837.n5","/mnt/z/mame/roms/lemans/005838.n4","/mnt/z/mame/roms/lemans/005839.n6"} for fni,fn in pairs(fnamestable) do f = io.open(fn,"r") a = f:read("*a") for z = 0,0x7ff,0x200 do print(fn, z) for y=0,31 do for x=0,15 do adr = (x | (y<<4)) + z b = a:byte(1+adr) if x==0 then io.write("adr:"..string.format("%3x",adr)) end if x~=7 then prtbyte(b) end end print() end print(fn,z,"end") end end  fn = "/mnt/z/mame/roms/lemans/005837.n5" f = io.open(fn,"r") a = f:read("*a")  for x = 0,31 do print(fn,x) for y=0,7 do adr = (y | (((x & 0x10)>>4) << 3) | ((x & 0xf)<<5)) | (2^9) | (2^10) io.write(string.format("%2x",adr).." ") b = a:byte(1+adr) prtbyte(b) adr = adr | (2^4) b= a:byte(1+adr) prtbyte(b) print("  "..string.format("%2x",adr)) end print("------") end 
/mnt/z/mame/roms/lemans/005837.n5	0
adr:  0 *  **** *       * *     * *   * * *  *  **   *  ***  * *     ***  *  ***  *  * * *   * * **  * * **   ** **    **      
adr: 10**  ******  *** * ***** * **** ** ****  * * **  *  ***  *   * ** **** ** *****   ** **   * ***   * *** * * ****  *  *** 
adr: 20*   ****            * * * * * * * * * * * * * * * * * * * * * * * * * * * *                                             
adr: 30                  *                      ****  *                            *                                           
adr: 40                 *               ** ** * ****  *                              *                                         
adr: 50                 *                       ****  *                 ** ** *        *                                       
adr: 60                 *                       ****  * ** ** *                          *                                     
adr: 70                 *          * * * * * * * * * * * * * * * * * * * * * * *           *                                   
adr: 80                 *         *      ***  *           *   *                  *           *                                 
adr: 90                 *         *      ***  *            * *                     *           *                               
adr: a0                 *         *       * * * * * *       *       * * * *          *           *                             
adr: b0                 *         *                   *           *         *          *           *                           
adr: c0                 *         *                    *          *           *         **          *                          
adr: d0                  *         * * * * * * *         *        *            *        *  *        *                          
adr: e0                   *         *    *       *         * * * *      *      *        *   *       *                          
adr: f0                     *         * *          *                    *      *        **  *       *                          
adr:100                       * ** ** * *            *                 *       *        *   *       *                          
adr:110                       * ** ** * *      *       * * * * * * * *        * *        * *        *                          
adr:120                     *         *       *  *                           *   *      * **  *     *                          
adr:130                   *         *        *     *                       *       *    * **  *    *                           
adr:140                  *         *        * * * * * * * * * * * * * * * * * * * * * * * * * * * *                            
adr:150                 *         *       *                       **  * ** ** *                    *                           
adr:160                 *         *      *                        **  * ** ** *                     *                          
adr:170                 *         *      *     ********************************************         *                          
adr:180                 *         *           *    *  *                    *  *            *        *                          
adr:190                 *         *           *    *  *                    *  *            *        *                          
adr:1a0                 *          * * * * * * ********************************************         *                          
adr:1b0                 *               ***** *                                                     *                          
adr:1c0                 *               ***** *                                                     *                          
adr:1d0                 *               ***** *                                                     *                          
adr:1e0                  *              ***** *                                                    *                           
adr:1f0                    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *                             
/mnt/z/mame/roms/lemans/005837.n5	0	end
/mnt/z/mame/roms/lemans/005837.n5	512
adr:200 *  **** *       * *     * *   * * *  *  **   *  ***  * *     ***  *  ***  *  * * *   * * **  * * **   ** **    **      
adr:210**  ******  *** * ***** * **** ** ****  * * **  *  ***  *   * ** **** ** *****   ** **   * ***   * *** * * ****  *  *** 
adr:220*   ****            * * * * * * * * * * * * * * * * * * * * * * * * * *           * * * * *                             
adr:230                  *                              ****  *               *       *            *                           
adr:240                 *                               ****  *                *    *               *                          
adr:250                 *        * * * * * * * * * * * * * * * * * * * *        * *        *       *                           
adr:260                 *         *                 *                   *       *        *       *                             
adr:270                 *         *              *                       *             *       *                               
adr:280                  *       *            * ** ** *    * * * * *       *         *       * * * *                           
adr:290                   *     *          *           *             *       *     *       *        *                          
adr:2a0                  *       *      *           *                 **       * *       *          *                          
adr:2b0                 *         *  *           *         * * *      *  *       *                  *                          
adr:2c0                 *         **          *  ***  * *             *    *      *          *      *                          
adr:2d0                  *       *         *         *  ** ** *      *       *     *       * *      *                          
adr:2e0                   *     *        *        *         * * * * * * * * * *      * * *   *      *                          
adr:2f0                  *       *       *        *       *       *       **  * *     *      *      *                          
adr:300                 *         *       * *       *      *    *         **  *  *     *     *      *                          
adr:310                 *         *       *   *      *      *  *      * * *       *     * * *       *                          
adr:320                  *       *       *     *      *      **      *     *       *    * **  *     *                          
adr:330                   *     *       *     *      **      *      *       *       *   * **  *    *                           
adr:340                  *       *       *  *       * *      *      *        *        * * * * * * *                            
adr:350                 *         *       **      *   *             *         *                    *                           
adr:360                 *         *       *     *      *           *            *       ** ** *     *                          
adr:370                 *         *      *     ********************************************         *                          
adr:380                 *         *           *    *  *                    *  *            *        *                          
adr:390                 *         *           *    *  *                    *  *            *        *                          
adr:3a0                 *          * * * * * * ********************************************         *                          
adr:3b0                 *               ***** *                                                     *                          
adr:3c0                 *               ***** *                                                     *                          
adr:3d0                 *               ***** *                                                     *                          
adr:3e0                  *              ***** *                                                    *                           
adr:3f0                    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *                             
/mnt/z/mame/roms/lemans/005837.n5	512	end
/mnt/z/mame/roms/lemans/005837.n5	1024
/mnt/z/mame/roms/lemans/005837.n5	1024	end
/mnt/z/mame/roms/lemans/005837.n5	1536
/mnt/z/mame/roms/lemans/005837.n5	1536	end
/mnt/z/mame/roms/lemans/005838.n4	0
adr:  0 *  **** *       * *     * *   * * *  *  **   *  ***  * *     ***  *  ***  *  * * *   * * **  * * **   ** **    **      
adr: 10**  ******  *** * ***** * **** ** ****  * * **  *  ***  *   * ** **** ** *****   ** **   * ***   * *** * * ****  *  *** 
adr: 20*   ****            * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *                             
adr: 30                  *              * **  *                                  ***  *            *                           
adr: 40                 *               * **  *                                  ***  *             *                          
adr: 50                 *               * **  *                                  ***  *             *                          
adr: 60                 *               * **  *                                  ***  *             *                          
adr: 70                 *               * **  *                                  ***  *             *                          
adr: 80                 *               * * * * * * * * * * * * * * * * * * * * * * * *             *                          
adr: 90                 *              *                                               *            *                          
adr: a0                 *              *                                               *            *                          
adr: b0                 *              *                                               *            *                          
adr: c0                  *              *                                              *            *                          
adr: d0                   *              *                                             *            *                          
adr: e0                    *              *                                            *            *                          
adr: f0                     *              *********************************************            *                          
adr:100                      *             *       *  *            *  *                *            *                          
adr:110                      *  ****  *    *       *  *            *  *                *            *                          
adr:120                     *   ****  *    *********************************************            *                          
adr:130                    *    ****  *   *                                            *            *                          
adr:140                   *     ****  *  *                                            *   **  *    *                           
adr:150                  *      ****  * *                                            *    **  *   *                            
adr:160                 *              *                                            *     **  *  *                             
adr:170                 *              *                                           *      **  * *                              
adr:180                 *              *                                          *            *                               
adr:190                 *               * * * * * * * * * * * * * * * * * * * * *             *                                
adr:1a0                 *                                       ***** *                      *                                 
adr:1b0                 *                                       ***** *                     *                                  
adr:1c0                 *                                       ***** *                    *                                   
adr:1d0                 *                                       ***** *                   *                                    
adr:1e0                  *                                      ***** *                  *                                     
adr:1f0                    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *                                       
/mnt/z/mame/roms/lemans/005838.n4	0	end
/mnt/z/mame/roms/lemans/005838.n4	512
adr:200 *  **** *       * *     * *   * * *  *  **   *  ***  * *     ***  *  ***  *  * * *   * * **  * * **   ** **    **      
adr:210**  ******  *** * ***** * **** ** ****  * * **  *  ***  *   * ** **** ** *****   ** **   * ***   * *** * * ****  *  *** 
adr:220*   ****                * * * * * * * *                               * * * * * * *                                     
adr:230                      *          * **  * *                         *      ***  *    *                                   
adr:240                    *            * **  *   *                     *        ***  *      *                                 
adr:250                  *              * **  *     *                 *          ***  *        *                               
adr:260                 *               * **  *       *             *            ***  *          *                             
adr:270                 *               * **  *         *          *             ***  *           *                            
adr:280                 *                *                *       *             * * * *            *                           
adr:290                  *                 *                *    *            *         *           *                          
adr:2a0                    *                 *                *  *           *           *          *                          
adr:2b0                      *                 *               **            *           *          *                          
adr:2c0                        *                 *                           *           *          *                          
adr:2d0                          *                **                         *           *          *                          
adr:2e0                           *               *  *                      *            *          *                          
adr:2f0                          *                *    *                   *             *          *                          
adr:300                        *                 *       *                *              *          *                          
adr:310                      *  ****  *        *           * * * * * *  *                *          *                          
adr:320                    *    ****  *      *                                           *          *                          
adr:330                  *      ****  *    **********************************************           *                          
adr:340                 *       ****  *  *         *  *            *  *                *           *                           
adr:350                 *       ****  **           *  *            *  *               *   **  *   *                            
adr:360                 *              ***********************************************    **  *  *                             
adr:370                 *              *                                            *           *                              
adr:380                 *              *                                           *           *                               
adr:390                 *                * * * * * * * * * * * * * * * * * * * * *            *                                
adr:3a0                 *                                       ***** *                      *                                 
adr:3b0                 *                                       ***** *                     *                                  
adr:3c0                 *                                       ***** *                    *                                   
adr:3d0                 *                                       ***** *                   *                                    
adr:3e0                  *                                      ***** *                  *                                     
adr:3f0                    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *                                       
/mnt/z/mame/roms/lemans/005838.n4	512	end
/mnt/z/mame/roms/lemans/005838.n4	1024
adr:400 *  **** *       * *     * *   * * *  *  **   *  ***  * *     ***  *  ***  *  * * *   * * **  * * **   ** **    **      
adr:410**  ******  *** * ***** * **** ** ****  * * **  *  ***  *   * ** **** ** *****   ** **   * ***   * *** * * ****  *  *** 
adr:420*   ****            * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *                             
adr:430                  *                              ** ** *  ***  *                            *                           
adr:440                 *                               ** ** *  ***  *                             *                          
adr:450                 *                               ** ** *  ***  *                             *                          
adr:460                 *                               ** ** *  ***  *                             *                          
adr:470                 *               *********************************************               *                          
adr:480                 *             *    *  *                    *  *       *       *             *                          
adr:490                 *             *    *  *                    *  *               *             *                          
adr:4a0                 *       * **  * *********************************************               *                          
adr:4b0                 *       * **  *                         *                 *                *                           
adr:4c0                  *      * **  *                           *             *                 *                            
adr:4d0                   *     * **  *                             *         *   **  *   **  * *                              
adr:4e0                     *   * **  *                               *      *                *                                
adr:4f0                       * * **  *                                 *   *                *                                 
adr:500                          * * * * * * * * * * * * *                * *                *                                 
adr:510                       *                            *                *                  *                               
adr:520                     *                                *                *                  *                             
adr:530                    *                            ****  **               **                  *                           
adr:540                   *                             ****  *  *             *  *                 *                          
adr:550                  *                              ****  *                *    *               *                          
adr:560                 *                * * * * * * *  ****  *               *      *              *                          
adr:570                 *              *               *                     *        *             *                          
adr:580                 *              *                 *                 *         *              *                          
adr:590                 *                * * * * * * * * * * * * * * * * * * * * * *                *                          
adr:5a0                 *                                       ***** *         ** ** *             *                          
adr:5b0                 *                                       ***** *         ** ** *            *                           
adr:5c0                 *                                       ***** *                           *                            
adr:5d0                 *                                       ***** *                 ** ** * *                              
adr:5e0                  *                                      ***** *                       *                                
adr:5f0                    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *                                   
/mnt/z/mame/roms/lemans/005838.n4	1024	end
/mnt/z/mame/roms/lemans/005838.n4	1536
adr:600 *  **** *       * *     * *   * * *  *  **   *  ***  * *     ***  *  ***  *  * * *   * * **  * * **   ** **    **      
adr:610**  ******  *** * ***** * **** ** ****  * * **  *  ***  *   * ** **** ** *****   ** **   * ***   * *** * * ****  *  *** 
adr:620*   ****                 * * * * * * * * * * *               * * * * * * * * * * * * *                                  
adr:630                      *                         *         *                             *                               
adr:640                    *                             *     *                                 *                             
adr:650                  *                                 * *                                     *                           
adr:660                 *                                   *                                       *                          
adr:670                 *               * * *               *           * * * * * * * * *           *                          
adr:680                 *             *       *             *            ***  * *        *          *                          
adr:690                 *             *       *             *            ***  *   *      *          *                          
adr:6a0                 *             *       * ****  *     *            ***  *     *    *          *                          
adr:6b0                  *              *   *   ****  *    * *           ***  *       *  *          *                          
adr:6c0                   *     ** ** *   *     ****  *   *    * * * * *               * *          *                          
adr:6d0                    *    ** ** *         ****  * *                *              **          *                          
adr:6e0                      *  ** ** *               *                    *             *          *                          
adr:6f0                        *                    *                       *            *          *                          
adr:700                          *                *                          *           *          *                          
adr:710                        *                    *                        *           *          *                          
adr:720                      *                  * **  ** * * * * * * * * * *             *          *                          
adr:730                    *                    * **  *                                 *           *                          
adr:740                  *                *     * **  *                                *           *                           
adr:750                 *               *   *   * **  *                               *   **  *   *                            
adr:760                 *              *       *                ** ** *              *    **  *  *                             
adr:770                 *              **********************************************     **  * *                              
adr:780                 *              *           *  *            *  *            *           *                               
adr:790                 *               *          *  *            *  *          *            *                                
adr:7a0                 *                 **************************************             *                                 
adr:7b0                 *                               ***** *                             *                                  
adr:7c0                 *                               ***** *                            *                                   
adr:7d0                 *                               ***** *                           *                                    
adr:7e0                  *                              ***** *                          *                                     
adr:7f0                    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *                                       
/mnt/z/mame/roms/lemans/005838.n4	1536	end
/mnt/z/mame/roms/lemans/005839.n6	0
adr:  0 *  **** *       * *     * *   * * *  *  **   *  ***  * *     ***  *  ***  *  * * *   * * **  * * **   ** **    **      
adr: 10**  ******  *** * ***** * **** ** ****  * * **  *  ***  *   * ** **** ** *****   ** **   * ***   * *** * * ****  *  *** 
adr: 20*   ****            * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *                             
adr: 30                  *      ****  *                                                            *                           
adr: 40                 *       ****  *         ** ** *                                             *                          
adr: 50                 *       ****  *         ** ** *                                             *                          
adr: 60                 *       ****  *                                                             *                          
adr: 70                 *       ****  ***************************************************           *                          
adr: 80                 *            *     *  *           *         *      *  *          *          *                          
adr: 90                 *            *     *  *         *             *    *  *          *          *                          
adr: a0                 *            *******************               ******************           *                          
adr: b0                 *            *                *       **        *              *           *                           
adr: c0                 *            *              *        *  *        *            * * **  *   *                            
adr: d0                 *            * * * * * * *          *    *         * * * * * *  * **  * *                              
adr: e0                 *            *                    * * * * *                           *                                
adr: f0                 *            *                  *          *                        *                                  
adr:100                 *            *                * ** ** *     *                    * * * * *                             
adr:110                 *            *        * * * * *               * * * * * * * * *   **  *    *                           
adr:120                 *            *       *        *               *             *     **  *     *                          
adr:130                 *            *        *       *       *       *           *       **  *     *                          
adr:140                 *            *   ***  **      *       *       *         *         **  *     *                          
adr:150                 *            **  ***  * *     *       *       *       *           *         *                          
adr:160                 *            * *          * *         *         * * *           *  *        *                          
adr:170                 *            *  *                     *                       *    *        *                          
adr:180                 *            *   *                    *                     *     *         *                          
adr:190                 *            *     *                 * *                  *     *           *                          
adr:1a0                 *             * * * * * * * * * * * * * * * * * * * * * * * * *            *                           
adr:1b0                 *                       ***** *                                           *                            
adr:1c0                 *                       ***** *                                         *                              
adr:1d0                 *                       ***** *                                       *                                
adr:1e0                  *                      ***** *                                     *                                  
adr:1f0                    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *                                     
/mnt/z/mame/roms/lemans/005839.n6	0	end
/mnt/z/mame/roms/lemans/005839.n6	512
adr:200 *  **** *       * *     * *   * * *  *  **   *  ***  * *     ***  *  ***  *  * * *   * * **  * * **   ** **    **      
adr:210**  ******  *** * ***** * **** ** ****  * * **  *  ***  *   * ** **** ** *****   ** **   * ***   * *** * * ****  *  *** 
adr:220*   ****            * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *                             
adr:230                  *              ****  *        *          *                                *                           
adr:240                 *               ****  *         ** ** *      *                              *                          
adr:250                 *               ****  *          *     *                                    *                          
adr:260                 *               ****  *           *   *                                     *                          
adr:270                 *          * * * * * * * *         * *          * * * * * * * * * *         *                          
adr:280                 *         *      ***  *   *         *         *              *     *        *                          
adr:290                 *         *      ***  *    *        *       *                  *   *        *                          
adr:2a0                 **       **       *          *      *      *                    *  *        *                          
adr:2b0                 *         *        *          *           *                      * *        *                          
adr:2c0                 *         *         *           *         *          *           * *        *                          
adr:2d0                  *         *          *          *         *         *          *  *        *                          
adr:2e0                   *         *           *         *         *        *         *   *        *                          
adr:2f0                     *         *          *         *        *        *         *   *        *                          
adr:300                       * ** ** * *         *         *      *         *          *  *        *                          
adr:310                       * ** ** * *         * *         *  *          * *          **         *                          
adr:320                     *         *           *   *                    *   *        * **  *     *                          
adr:330                   *         *           *       *                *       *      * **  *    *                           
adr:340                  *         *          * * * * * * * * * * * * * * * * * * * * * * * * * * *                            
adr:350                 *         *         *                     **  * ** ** *                    *                           
adr:360                 *         *       *                       **  * ** ** *                     *                          
adr:370                 *         *      *     ********************************************         *                          
adr:380                 *         *           *    *  *                    *  *            *        *                          
adr:390                 *         *           *    *  *                    *  *            *        *                          
adr:3a0                 *          * * * * * * ********************************************         *                          
adr:3b0                 *               ***** *                                                     *                          
adr:3c0                 *               ***** *                                                     *                          
adr:3d0                 *               ***** *                                                     *                          
adr:3e0                  *              ***** *                                                    *                           
adr:3f0                    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *                             
/mnt/z/mame/roms/lemans/005839.n6	512	end
/mnt/z/mame/roms/lemans/005839.n6	1024
adr:400 *  **** *       * *     * *   * * *  *  **   *  ***  * *     ***  *  ***  *  * * *   * * **  * * **   ** **    **      
adr:410**  ******  *** * ***** * **** ** ****  * * **  *  ***  *   * ** **** ** *****   ** **   * ***   * *** * * ****  *  *** 
adr:420*   ****            * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *                                 
adr:430                  *              ****  *                                                *                               
adr:440                 *               ****  *                                                 *                              
adr:450                 *               ****  *                                                  *                             
adr:460                 *               ****  *                                                   *                            
adr:470                 *             * * * * * * * * * * * * * * * * * * * * * * * * * *          *                           
adr:480                 *           *                   * **  * ** ** *                   *         *                          
adr:490                 *           *           ** ** * * **  *                            *        *                          
adr:4a0                 *           *        * * * * * * * * * * * * * * * * * * * *        *       *                          
adr:4b0                 *           *       *                    ***  *              *              *                          
adr:4c0                 *           *       *                    ***  *              * *            *                          
adr:4d0                 *           **       *        * * * * * * * * * * *         * * *           *                          
adr:4e0                 *           * *       *      *  *                         *      *          *                          
adr:4f0                 *           *  *       *      **                        *         *        *                           
adr:500                 *           *   *      *      *      * * * * * * * * *    **  *    * * * *                             
adr:510                 *           *  *      *      *      *             *          **            *                           
adr:520                 *           * *      *      *      *           *          *    *            *                          
adr:530                 *           **      *      *      *         *          *         * *        *                          
adr:540                 *           *      *      *        * * * *          *               *       *                          
adr:550                 *           *     *      *                       *                  *       *                          
adr:560                 *           *           * *                   *                     *       *                          
adr:570                 *           *          **********************************************       *                          
adr:580                 *           *         *    *  *                    *  *     *       *       *                          
adr:590                 *           *         *    *  *                    *  *   *        *        *                          
adr:5a0                 *            * * * * * *******************************************         *                           
adr:5b0                 *                       ***** *                                           *                            
adr:5c0                 *                       ***** *                                         *                              
adr:5d0                 *                       ***** *                                       *                                
adr:5e0                  *                      ***** *                                     *                                  
adr:5f0                    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *                                     
/mnt/z/mame/roms/lemans/005839.n6	1024	end
/mnt/z/mame/roms/lemans/005839.n6	1536
adr:600 *  **** *       * *     * *   * * *  *  **   *  ***  * *     ***  *  ***  *  * * *   * * **  * * **   ** **    **      
adr:610**  ******  *** * ***** * **** ** ****  * * **  *  ***  *   * ** **** ** *****   ** **   * ***   * *** * * ****  *  *** 
adr:620*   ****            * * * * * * * * * * * * * * * * * * * * * * * * * *           * * * * *                             
adr:630                  *                                      ****  *       *       *            *                           
adr:640                 *                                       ****  *        *    *               *                          
adr:650                 *        * * * * * * * * * * * * * * * * * * * *       *  *        *       *                           
adr:660                 *         *                 *                          **        *       *                             
adr:670                 *         *              *                            *        *       *                               
adr:680                  *       *            * ** ** *   * * * * * * * * * *        *       * * * *                           
adr:690                   *     *          *           *                ** ** *    *       *        *                          
adr:6a0                  *       *      *           *                            *       *          *                          
adr:6b0                 *         *  *           *         * * * * * * * * * * * *       ***  *     *                          
adr:6c0                 *         **          * * **  * *                         *          *      *                          
adr:6d0                  *       *         *         *                             *       * *      *                          
adr:6e0                   *     *        *        *         * * * * * * * * * *      * * *   *      *                          
adr:6f0                  *       *       *        *       *       *       **  * *     *      *      *                          
adr:700                 *         *       * *       *      *    *         **  *  *     *     *      *                          
adr:710                 *         *       *   *      *      *  *      * * *       *     * * *       *                          
adr:720                  *       *       *     *      *      **      *     *       *                *                          
adr:730                   *     *       *     *      **      *      *       *       *   ** ** *    *                           
adr:740                  *       *       *  *       * *      *      *        *        * * * * * * *                            
adr:750                 *         *       **      *   *             *         *                    *                           
adr:760                 *         *       *     *      *           *            *       ** ** *     *                          
adr:770                 *         *      *     ********************************************         *                          
adr:780                 *         *           *    *  *                    *  *            *        *                          
adr:790                 *         *           *    *  *                    *  *            *        *                          
adr:7a0                 *          * * * * * * ********************************************         *                          
adr:7b0                 *               ***** *                                                     *                          
adr:7c0                 *               ***** *                                                     *                          
adr:7d0                 *               ***** *                                                     *                          
adr:7e0                  *              ***** *                                                    *                           
adr:7f0                    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *                             
/mnt/z/mame/roms/lemans/005839.n6	1536	end
/mnt/z/mame/roms/lemans/005837.n5	0
600        **         610
601 ***   ****   ***  611
602 ****************  612
603 ***   ****   ***  613
604       ****        614
605 ***   ****   ***  615
606 ****************  616
607 ***          ***  617
------
/mnt/z/mame/roms/lemans/005837.n5	1
620   **     *        630
621  ***    ***       631
622  **    ****   **  632
623        ***   ***  633
624 ***   ****   **   634
625 **   ****         635
626      ****   ***   636
627             **    637
------
/mnt/z/mame/roms/lemans/005837.n5	2
640    ***    ***     650
641   ***    ***      651
642         ****   *  652
643 ***    ****   **  653
644 **    ****   ***  654
645 *    ****         655
646            ***    656
647           ***     657
------
/mnt/z/mame/roms/lemans/005837.n5	3
660     **     **     670
661   ***    ***      671
662         ***       672
663 ***   ****    **  673
664 **   ****   ****  674
665     ****          675
666            **     676
667          ***      677
------
/mnt/z/mame/roms/lemans/005837.n5	4
680       ***         690
681     **      **    691
682          ****     692
683   **   *****      693
684 **   *****    **  694
685     ****    **    695
686          **       696
687        **         697
------
/mnt/z/mame/roms/lemans/005837.n5	5
6a0         **        6b0
6a1       ***     **  6b1
6a2   **      ****    6b2
6a3 ***    *****      6b3
6a4      *****    **  6b4
6a5     ****    ***   6b5
6a6          **       6b6
6a7        ***        6b7
------
/mnt/z/mame/roms/lemans/005837.n5	6
6c0      ******       6d0
6c1 ****              6d1
6c2 **         *****  6d2
6c3       ******      6d3
6c4     ******        6d4
6c5               **  6d5
6c6             ****  6d6
6c7      ******       6d7
------
/mnt/z/mame/roms/lemans/005837.n5	7
6e0 *****  *****      6f0
6e1 ****   ****       6f1
6e2   **     **       6f2
6e3   **************  6f3
6e4    **********     6f4
6e5     **     **     6f5
6e6     ****   ****   6f6
6e7    *****  ******  6f7

------
...etc from 16 to 31
------




Gran Trak 10 seems to have ta similar track format:


Code


function prtbyte(b) local i for i=7,0,-1 do if (b & (2^i)) ~= 0 then io.write("*") else io.write (" ") end end end
fnamestable = {"/mnt/z/mame/roms/gtrak10/gtrak10/074186.j5"} for fni,fn in pairs(fnamestable) do f = io.open(fn,"r") a = f:read("*a") for z = 0,0x7ff,0x200 do print(fn, z) for y=0,31 do for x=0,15 do adr = (x | (y<<4)) + z b = a:byte(1+adr) if x==0 then io.write("adr:"..string.format("%3x",adr)) end if x~=7 then prtbyte(b) end end print() end print(fn,z,"end") end end  for x = 0,31 do print(fnamestable[1],x) for y=0,7 do adr = (y | (((x & 0x10)>>4) << 3) | ((x & 0xf)<<5)) | (2^9) | (2^10) io.write(string.format("%2x",adr).." ") b = a:byte(1+adr) prtbyte(b) adr = adr | (2^4) b= a:byte(1+adr) prtbyte(b) print("  "..string.format("%2x",adr)) end print("------") end 
/mnt/z/mame/roms/gtrak10/gtrak10/074186.j5	0
adr:  0 *  **** *       * *     * *   * * *  *  **   *  ***  * *     ***  *  ***  *  * * *   * * **  * * **   ** **    **      
adr: 10**  ******  *** * ***** * **** ** ****  * * **  *  ***  *   * ** **** ** *****   ** **   * ***   * *** * * ****  *  *** 
adr: 20*   ****                                          * * * * * *                                                           
adr: 30                  ****************************  *             *  ****************************                           
adr: 40                 *          *  *              *                 *           *  *             *                          
adr: 50                 *          *  *             *                   *          *  *             *                          
adr: 60                  ***************************                     ***************************                           
adr: 70                     *                    * *          *          * *              **  *     *                          
adr: 80                   *                        *          *          *                **  *     *                          
adr: 90                  *                          *         *         *          * * * *          *                          
adr: a0                 *          * * * *           *        *  ***  **         *        *         *                          
adr: b0                 *         *     *           *         *       *         *         *         *                          
adr: c0                 *         *   * ****  *    *         **       **         *        *         *                          
adr: d0                 *         *  *  ****  *  *          * *       *  *          *     *         *                          
adr: e0                 *         * *   ****  **           * *        *    *           *  *         *                          
adr: f0                 *         **          *           *  *          * * * *          **         *                          
adr:100                 *         *          *          *     *                          **         *                          
adr:110                 *         *         *          *        *                       * *         *                          
adr:120                 *         *         *           * * * * * * * * * * * * * * * *   *         *                          
adr:130                 *         *         *                   * **  *                 * *         *                          
adr:140                 *         *          *                  * **  *                   *         *                          
adr:150                 *         **          *                 * **  *                   *         *                          
adr:160           *     *         * *           * * * * * * * * * * * * * * * * *         *         *                          
adr:170                 *         *  *                     ** *                           *         *                          
adr:180                 *         *   *                    ** *                           *         *                          
adr:190                 *         *     *                  ** *                          *          *                          
adr:1a0                 *          * * * * * * * * * * * * * * * * * * * * * * * * * * *            *                          
adr:1b0                 *               ***** *                                                     *                          
adr:1c0                 *               ***** *                                                     *                          
adr:1d0                 *               ***** *                                                     *                          
adr:1e0                  *              ***** *                                                    *                           
adr:1f0                    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *                             
/mnt/z/mame/roms/gtrak10/gtrak10/074186.j5	0	end
/mnt/z/mame/roms/gtrak10/gtrak10/074186.j5	512
adr:200 *  **** *       * *     * *   * * *  *  **   *  ***  * *     ***  *  ***  *  * * *   * * **  * * **   ** **    **      
adr:210**  ******  *** * ***** * **** ** ****  * * **  *  ***  *   * ** **** ** *****   ** **   * ***   * *** * * ****  *  *** 
adr:220*   ****            * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *                             
adr:230                  *                 ** * * **  *    ** *                                    *                           
adr:240                 *                  ** * * **  *    ** *                                     *                          
adr:250                 *                  ** * * **  *    ** *                                     *                          
adr:260                 *                  ** * * **  *    ** *                                     *                          
adr:270                 *      ******************* * * * * * * * * * * *******************          *                          
adr:280                 *     *    *  *           *                   *    *  *           *         *                          
adr:290                 *     *    *  *           *                   *    *  *  *        *         *                          
adr:2a0                 *     *********************        * *         ********************         *                          
adr:2b0                 *     *       *            *      **  **                      *   *         *                          
adr:2c0                 *     *      *               *    **  *  *                      * *         *                          
adr:2d0                 *      *    *                  *           * * * * * *           **         *                          
adr:2e0                 *       * *          * *         *                     *          *         *                          
adr:2f0                 **                  *    *         *                    *         *         *                          
adr:300 *               *  *               *       *         * * * * * *        *         *         *                          
adr:310                 *    * * * * * * *           *  ****  **       *        *         *         *                          
adr:320                 *  *       ** *    *           *         *    *        *         **         *                          
adr:330                 **                   *           *         * *        *         * *         *                          
adr:340                 *                     *            *        **       *         *  *         *                          
adr:350                 *          * *         *             *       *      *         *   *         *                          
adr:360           *     *        *     *         *            *       *     *         *   *         *                          
adr:370                 *       *       *          * * * * * *         *     *         *  *         *                          
adr:380                 *       *        *                             *      *         * *         *                          
adr:390                 *        *         *                           *       *         **         *                          
adr:3a0                 *          * * * * * * * * * * * * * * * * * *          *         *         *                          
adr:3b0                 *               ***** *                                 *        ***  *     *                          
adr:3c0                 *               ***** *                                 *        ***  *     *                          
adr:3d0                 *               ***** *                                 *        ***  *     *                          
adr:3e0                  *              ***** *                                * *       ***  *    *                           
adr:3f0                    * * * * * * * * * * * * * * * * * * * * * * * * * *     * * * * * * * *                             
/mnt/z/mame/roms/gtrak10/gtrak10/074186.j5	512	end
/mnt/z/mame/roms/gtrak10/gtrak10/074186.j5	1024

/mnt/z/mame/roms/gtrak10/gtrak10/074186.j5	1024	end
/mnt/z/mame/roms/gtrak10/gtrak10/074186.j5	1536

/mnt/z/mame/roms/gtrak10/gtrak10/074186.j5	1536	end
/mnt/z/mame/roms/gtrak10/gtrak10/074186.j5	0
600        **         610
601 ***   ****   ***  611
602 ****************  612
603 ***   ****   ***  613
604       ****        614
605 ***   ****   ***  615
606 ****************  616
607 ***          ***  617
------
------
etc
------

And the score data:

It has the score data that goes from 0 to 78 by twos.

Code
function prtbyte(b) local i for i=7,0,-1 do if (b & (2^i)) ~= 0 then io.write("*") else io.write (" ") end end end
for i=0,#a-1,4 do io.write(string.format("%2x",(i))..":"..string.format("%2x",a:byte(i+1)).." ") prtbyte(a:byte(i+1)) print() end


400: 0         
404: 7      ***
408: 5      * *
40c: 5      * *
410: 5      * *
414: 5      * *
418: 5      * *
41c: 7      ***
420: 0         
424: 7      ***
428: 5      * *
42c: 5      * *
430: 7      ***
434: 5      * *
438: 5      * *
43c: 7      ***
440: 0         
444:27   *  ***
448:25   *  * *
44c:25   *  * *
450:25   *  * *
454:25   *  * *
458:25   *  * *
45c:27   *  ***
460: 0         
464:27   *  ***
468:25   *  * *
46c:25   *  * *
470:27   *  ***
474:25   *  * *
478:25   *  * *
47c:27   *  ***
480: 0         
484:e7 ***  ***
488:25   *  * *
48c:25   *  * *
490:e5 ***  * *
494:85 *    * *
498:85 *    * *
49c:e7 ***  ***
4a0: 0         
4a4:e7 ***  ***
4a8:25   *  * *
4ac:25   *  * *
4b0:e7 ***  ***
4b4:85 *    * *
4b8:85 *    * *
4bc:e7 ***  ***
4c0: 0         
4c4:e7 ***  ***
4c8:25   *  * *
4cc:25   *  * *
4d0:e5 ***  * *
4d4:25   *  * *
4d8:25   *  * *
4dc:e7 ***  ***
4e0: 0         
4e4:e7 ***  ***
4e8:25   *  * *
4ec:25   *  * *
4f0:e7 ***  ***
4f4:25   *  * *
4f8:25   *  * *
4fc:e7 ***  ***
500: 0         
504:a7 * *  ***
508:a5 * *  * *
50c:a5 * *  * *
510:e5 ***  * *
514:25   *  * *
518:25   *  * *
51c:27   *  ***
520: 0         
524:a7 * *  ***
528:a5 * *  * *
52c:a5 * *  * *
530:e7 ***  ***
534:25   *  * *
538:25   *  * *
53c:27   *  ***
540: 0         
544:e7 ***  ***
548:85 *    * *
54c:85 *    * *
550:e5 ***  * *
554:25   *  * *
558:25   *  * *
55c:e7 ***  ***
560: 0         
564:e7 ***  ***
568:85 *    * *
56c:85 *    * *
570:e7 ***  ***
574:25   *  * *
578:25   *  * *
57c:e7 ***  ***
580: 0         
584:87 *    ***
588:85 *    * *
58c:85 *    * *
590:e5 ***  * *
594:a5 * *  * *
598:a5 * *  * *
59c:e7 ***  ***
5a0: 0         
5a4:87 *    ***
5a8:85 *    * *
5ac:85 *    * *
5b0:e7 ***  ***
5b4:a5 * *  * *
5b8:a5 * *  * *
5bc:e7 ***  ***
5c0: 0         
5c4:e7 ***  ***
5c8:25   *  * *
5cc:25   *  * *
5d0:25   *  * *
5d4:25   *  * *
5d8:25   *  * *
5dc:27   *  ***
5e0: 0         
5e4:e7 ***  ***
5e8:25   *  * *
5ec:25   *  * *
5f0:27   *  ***
5f4:25   *  * *
5f8:25   *  * *
5fc:27   *  ***


> for i=1,#a-1,4 do io.write(string.format("%2x",(i))..":"..string.format("%2x",a:byte(i+1)).." ") prtbyte(a:byte(i+1)) print() end

Displays the digits that end in 2

401: 0         
405: 7      ***
409: 1        *
40d: 1        *
411: 7      ***
415: 4      *  
419: 4      *  
41d: 7      ***
421:70  ***    
425:c7 **   ***
429:70  ***    
42d:c7 **   ***
431:e0 ***     
435:80 *       
439:e0 ***     
43d:86 *    ** 
441: 0         
445:27   *  ***
449:21   *    *
44d:21   *    *
451:27   *  ***
455:24   *  *  
459:24   *  *  
45d:27   *  ***
461:38   ***   
465: f     ****
469:18    **   
46d: 7      ***
471:70  ***    
475: 0         
479: 0         
47d: 0         
481: 0         
485:e7 ***  ***
489:21   *    *
48d:21   *    *
491:e7 ***  ***
495:84 *    *  
499:84 *    *  
49d:e7 ***  ***
etc

1 member likes this: =CO=Windler
Joined: Feb 2014
Posts: 852
Likes: 48
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 852
Likes: 48
So how does the track data work exactly?

There's special byte patterns that get interpreted as a finish line, a slick, a checkpoint and a score/time display.

We can see this better if we rewrite the prtbyte function to label the bits on the printout and to show byte boundaries:

Code
function prtbyte(b) local i for i=7,0,-1 do if (b & (2^i)) ~= 0 then io.write(i) else io.write (" ") end end io.write("|") end

fnamestable = {"/mnt/z/mame/roms/lemans/005837.n5","/mnt/z/mame/roms/lemans/005838.n4","/mnt/z/mame/roms/lemans/005839.n6"} for fni,fn in pairs(fnamestable) do f = io.open(fn,"r") a = f:read("*a") for z = 0,0x7ff,0x200 do print(fn, z) for y=0,31 do for x=0,15 do adr = (x | (y<<4)) + z b = a:byte(1+adr) if x==0 then io.write("adr:"..string.format("%3x",adr)) end if x~=7 then prtbyte(b) end end print() end print(fn,z,"end") end end  fn = "/mnt/z/mame/roms/lemans/005837.n5" f = io.open(fn,"r") a = f:read("*a")  for x = 0,31 do print(fn,x) for y=0,7 do adr = (y | (((x & 0x10)>>4) << 3) | ((x & 0xf)<<5)) | (2^9) | (2^10) io.write(string.format("%2x",adr).." ") b = a:byte(1+adr) prtbyte(b) adr = adr | (2^4) b= a:byte(1+adr) prtbyte(b) print("  "..string.format("%2x",adr)) end print("------") end




/mnt/z/mame/roms/lemans/005837.n5	0
adr:  0 6  3210| 6      | 6 4    | 6 4   0| 6 4  1 | 65   1 | 654  1 |7     10|7  4  10|7  4  1 |7 5   1 |7 54  1 |7 54   0|7 54    |76      |
adr: 1076  3210|76  321 |7 54321 |7 5432 0|7 5432  |7 5 32  |7  432  |7   3 10| 6543 10| 65432  | 65 32  | 6 432  | 6 432 0| 6 4321 | 6  321 |
adr: 207   3210|        |    3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5     |        |        |        |        |        |
adr: 30        |        |  5     |        |        | 6543  0|        |        |        |    3   |        |        |        |        |        |
adr: 40        |        | 6      |        | 65 32 0| 6543  0|        |        |        |      1 |        |        |        |        |        |
adr: 50        |        | 6      |        |        | 6543  0|        |        | 65 32 0|        |7       |        |        |        |        |
adr: 60        |        | 6      |        |        | 6543  0| 65 32 0|        |        |        |  5     |        |        |        |        |
adr: 70        |        | 6      |    3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7       |    3   |        |        |        |        |
adr: 80        |        | 6      |   4    |  543  0|        |   4   0|        |        |  5     |      1 |        |        |        |        |
adr: 90        |        | 6      |   4    |  543  0|        |    3 1 |        |        |    3   |        |7       |        |        |        |
adr: a0        |        | 6      |   4    |   4 2 0| 6 4 2  |     2  |     2 0| 6 4    |      1 |        |  5     |        |        |        |
adr: b0        |        | 6      |   4    |        |       0|        |   4    |     2  |        |7       |    3   |        |        |        |
adr: c0        |        | 6      |   4    |        |        |7       |   4    |       0|        | 65     |     2  |        |        |        |
adr: d0        |        |  5     |    3 1 |7 5 3 1 |7       |  5     |   4    |        |7       | 6  3   |     2  |        |        |        |
adr: e0        |        |   4    |     2  |  5     |  5     |    3 1 |7 5     | 6      |7       | 6   2  |     2  |        |        |        |
adr: f0        |        |     2  |       0| 6      |    3   |        |        | 6      |7       | 65  2  |     2  |        |        |        |
adr:100        |        |       0| 65 32 0| 6      |      1 |        |        |7       |7       | 6   2  |     2  |        |        |        |
adr:110        |        |       0| 65 32 0| 6      |7       |7 5 3 1 |7 5 3 1 |       0| 6      |  5 3   |     2  |        |        |        |
adr:120        |        |     2  |       0|       0|  5     |        |        |      1 |  5     | 6 43  0|     2  |        |        |        |
adr:130        |        |   4    |     2  |      1 |    3   |        |        |    3   |    3   | 6 43  0|    3   |        |        |        |
adr:140        |        |  5     |    3   |     2 0| 6 4 2 0| 6 4 2 0| 6 4 2 0| 6 4 2 0| 6 4 2 0| 6 4 2 0| 6 4    |        |        |        |
adr:150        |        | 6      |   4    |   4    |        |        |   43  0| 65 32 0|        |        |    3   |        |        |        |
adr:160        |        | 6      |   4    |  5     |        |        |   43  0| 65 32 0|        |        |     2  |        |        |        |
adr:170        |        | 6      |   4    |  5     |76543210|76543210|76543210|76543210|76543210|7654    |     2  |        |        |        |
adr:180        |        | 6      |   4    |       0|    3  0|        |        |    3  0|        |    3   |     2  |        |        |        |
adr:190        |        | 6      |   4    |       0|    3  0|        |        |    3  0|        |    3   |     2  |        |        |        |
adr:1a0        |        | 6      |    3 1 |7 5 3 1 |76543210|76543210|76543210|76543210|76543210|7654    |     2  |        |        |        |
adr:1b0        |        | 6      |        | 65432 0|        |        |        |        |        |        |     2  |        |        |        |
adr:1c0        |        | 6      |        | 65432 0|        |        |        |        |        |        |     2  |        |        |        |
adr:1d0        |        | 6      |        | 65432 0|        |        |        |        |        |        |     2  |        |        |        |
adr:1e0        |        |  5     |        | 65432 0|        |        |        |        |        |        |    3   |        |        |        |
adr:1f0        |        |    3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5     |        |        |        |
/mnt/z/mame/roms/lemans/005837.n5	0	end
[Linked Image from i.imgur.com]



So all data coming from the roms is inverted.
And different bit patterns will do different items:
Code
65 32 0 is a slick       pattern 01 (24)  not 2 4 reversed = not 4 2
65432 0 is finish line   pattern 00 (24)  not 2 not 4 reversed = 4 2
6543  0 is checkpoint   65 is checkpoint 1
6 43  0 is checkpoint   6  is checkpoint 2
 543  0 is checkpoint    5 is checkpoint 3
  43  0 is checkpoint      is checkpoint 4

checkpoint is pattern 10 (24) 2 not 4 reversed = 4 not 2 and 65 determine checkpoint number

   3  0 is score   pattern 11 (24) 2 4  reversed is not 4 not 2

=========================

0 3 not 1 is special data  (that is one of the finish,slick,checkpoint or score)

Bits 0 1 and 3 determine special data:

[Linked Image from i.imgur.com]

bits 2 and 4 get put into a 9321 decoder to determine the special item to display

bits 5 and 6 determine the checkpoint number

[Linked Image from i.imgur.com]

1 member likes this: exidyboy
Joined: Feb 2014
Posts: 852
Likes: 48
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 852
Likes: 48
One of the things that's been puzzling is that one page of the schematics in the Lemans manual is missing. There's 2 pages of sheets 1 and 2 but half of sheet 3 is missing.

Fortunately, the Gran Trak 10 manual has a very similar schematic that can fill in the missing page.

(The schematic says its size D so half must be missing)

[Linked Image from i.imgur.com]




Doing some research on Gran Trak 10 I came across this great write up on fixing a Gran Trak 10 by Ed Fries. It's a really fun read.

https://edfries.wordpress.com/2017/06/14/fixing-gran-trak-10/


My lua script output looks just like the GT10 rom decoding by Mike Salay and Tim Giddens.


The fixing gran trak 10 page has links to 3 different files that are very interesting (3 files, one for each word in "amazing things attached")

https://edfries.files.wordpress.com/2017/06/gt10_rom_memory_map.pdf
https://edfries.files.wordpress.com/2017/06/hybrid_schematics1.pdf
https://edfries.files.wordpress.com/2017/06/direction_coordinates.pdf

Joined: Feb 2014
Posts: 852
Likes: 48
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 852
Likes: 48
There's a couple more interesting pages on Ed Fries' site:

https://edfries.wordpress.com/2017/10/23/finding-the-first-videogame-rom/

https://edfries.wordpress.com/2017/03/22/chasing-the-first-arcade-easter-egg/


According to a forum post in 2013 by Stiletto at https://forums.arcade-museum.com/threads/old-rom-chips-need-replacing.177683/ ,
the rom in the Gran Trak 10 is a Mostek MK28000 PROM:

Quote
In case this comes up AGAIN, here is the preliminary datasheet for the Atari Le Mans PROM.

It's been identified through past Internet research as a Mostek MK28000 PROM (the same as in Tank / Tank II.)
313K mk28000p.pdf - http://www.sendspace.com/file/36nkqm

Also here are the databooks which contain it.
http://bitsavers.trailing-edge.com/pdf/mostek/_dataBooks/1977_Mostek_Memory_Products.pdf - 06-Aug-2013 14:47 17M
http://bitsavers.trailing-edge.com/...stek_Memory_Data_Book_and_Designers_Guide.pdf - 06-Aug-2013 18:07 38M

(these links are dead but it's there at bitsavers under Components)
http://bitsavers.trailing-edge.com/components/mostek/_dataBooks/

=================

Sometimes you can't figure out how things work unless you build a model. I couldn't quite see how the horizontal counter system worked in Lemans.

The manual lays it out, but that seems confusing.

[Linked Image from i.imgur.com]

So let's take the schematic and make a logisim model:

[Linked Image from i.imgur.com]

[Linked Image from i.imgur.com]

and what you see is that 512H isn't actually 512H but represents more of the "right half of the screen" since it gets set after the 0x1c2 clock and the counter gets reset but leaving the 512H bit making 0x200.
(In other words, the counter jumps from 0x1c2 to 0x200).
Once it hits 0x3c2 then it gets reset again back to 0x000, and then does HSYNC for 32 clocks.

This explains why the 7th row byte disappears in the racetrack. 512/64 = 8 for 8 bytes, but 0x1c2 / 64 = 7.03 so it jumps from 0x1c2 to 0x200 which skips that seventh byte.

2 members like this: Stiletto, exidyboy
Joined: Feb 2014
Posts: 852
Likes: 48
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 852
Likes: 48
Studying the ROM addressing is kinda overwhelming at first, but they've given a nice table in the manual to help out.

There's 6 groups given:

CAR = AB
SCORE = C
TIME = D
RACETRACK1 = E
RACETRACK2 = F
SPEED CODE = G


(I think B is supposed to be for a dual player version like Gran Trak 20, you see B mentioned on the schematics)
(E and F are pretty much the same thing, just differing by the TSA track select A)



[Linked Image from i.imgur.com]


[Linked Image from i.imgur.com]


[Linked Image from i.imgur.com]


Theres a bunch of 74153 multiplexers to choose the various inputs specific to each group. The lower 3 74153s handle A0 A1 A2 A3 and A5 A6. The upper 74153 does A7 and A8.

The lower group has ABCD coming in on select 1 and CDEF coming in on select 2.

If the bit on a select is 0 then choose the group items that aren't part of it (ie invert the set)
total set = ABCDEFG
so select1 = ABCD inverted select 1 is EFG
and select 2 = CDEF inverted select 2 = ABG


sel2 sel 1
11 = CD (select 1 = 1 ABCD select 2 = 1 CDEF, interesection is CD)
10 = EF (select 1 = 0 EFG select 2 = 1 CDEF, intersection is EF)
01 = AB (select1 = 1 ABCD select 2 = 0 ABG, intersection is AB)
00 = G (select1=0 EFG and select 2 = 0 ABG, intersection is G)

===================

The upper 74153 is a little different

select 1 is depends on 512H and also on LD1B (AB).
This has the effect of displaying the score on the left half of the screen and the time on the right half.
select 2 is not SCOREDISP (since SCOREDISP is basically CD) so select 2 is not CD = select 2 is ABEFG

11 = EFG (not LD1B = not AB = CDEFG, intersecting with ABEFG, result is EFG)
10 = AB (LD1B = AB intersecting with ABEFG, result is AB)
01 = D time (CD choosing either C or D depending on 512H)
00 = C score


The speed code is interesting because the speed data resides in the first 0x21 bytes of the track. byte 0 to 0x1f are speed codes for the 31 different directions and byte 0x20 is the stop code.
When the car has a "stop condition" 1STOP = 1 and address becomes 0x20 because the output strobe to the 74153 are shut off, so A0 to A4 is 0, while A5 is set to 1.

I think that the speed data is accessed during the VSYNC so the address bits A6 to A8 should be zero. There's no separate logic to gate off A6-A8 for speed code G since those bits 64V, 128V and 256V are expected to be zero during the VSYNC.

======================

so I think what happens is that on VSYNC, the horizontal and vertical motion counters get loaded with rom data from the SPEED G address.

on each HSYNC, the graphics for the car get loaded from the CAR A Address.

As the screen scans, the horizontal counters load the track data from the RACETRACK EF address.

Special codes in the racetrack data do things like SLICK (which requires no data) and SCOREDISP (which will read 8 bits to display from the SCORE C or TIME D address at the next fetch opportunity, so it actually displays in the next track byte after the code appears in the track)

The other special codes are CHECKPOINT 1-4 and FINISH LINE.

Joined: Feb 2014
Posts: 852
Likes: 48
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 852
Likes: 48
One of the things that was puzzling me was how the reset car position worked, why does it show up in the center of the track about line 0x1B0?

I looked at this and looked at it, and couldn't figure out how it gets put there.

If you look at a track, it shows up at offset 0x1b0 (since this track starts at 0x600, it is on the line 0x7b0) in the middle.
Code
/mnt/z/mame/roms/lemans/005839.n6	1536
adr:600 6  3210| 6      | 6 4    | 6 4   0| 6 4  1 | 65   1 | 654  1 |7     10|7  4  10|7  4  1 |7 5   1 |7 54  1 |7 54   0|7 54    |76      |
adr:61076  3210|76  321 |7 54321 |7 5432 0|7 5432  |7 5 32  |7  432  |7   3 10| 6543 10| 65432  | 65 32  | 6 432  | 6 432 0| 6 4321 | 6  321 |
adr:6207   3210|        |    3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |        |  5 3 1 |7 5     |        |        |        |
adr:630        |        |  5     |        |        |        |        | 6543  0|       0|       0|        |    3   |        |        |        |
adr:640        |        | 6      |        |        |        |        | 6543  0|        |7    2  |        |     2  |        |        |        |
adr:650        |        | 6      |  5 3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7       |7  4    |    3   |    3   |        |        |        |
adr:660        |        | 6      |   4    |        |     2  |        |        |        |76      |  5     |  5     |        |        |        |
adr:670        |        | 6      |   4    |        |  5     |        |        |       0|        |7       |7       |        |        |        |
adr:680        |        |  5     |  5     |       0| 65 32 0|   4 2 0| 6 4 2 0| 6 4 2  |      1 |      1 |7 5 3   |        |        |        |
adr:690        |        |   4    | 6      |    3   |        |7       |        | 65 32 0|    3   |    3   |     2  |        |        |        |
adr:6a0        |        |  5     |  5     | 6      |     2  |        |        |        |  5     |  5     |     2  |        |        |        |
adr:6b0        |        | 6      |   4  1 |        |  5     |    3 1 |7 5 3 1 |7 5 3 1 |7 5     |  543  0|     2  |        |        |        |
adr:6c0        |        | 6      |   43   |       0| 6 43  0| 6      |        |        |   4    |      1 |     2  |        |        |        |
adr:6d0        |        |  5     |  5     |    3   |      1 |        |        |        |    3   |    3 1 |     2  |        |        |        |
adr:6e0        |        |   4    | 6      |  5     |   4    |     2 0| 6 4 2 0| 6 4 2 0|      1 |7 5   1 |     2  |        |        |        |
adr:6f0        |        |  5     |  5     |  5     |   4    |   4    |   4    |   43  0| 6     0|      1 |     2  |        |        |        |
adr:700        |        | 6      |   4    |   4 2  |     2  |    3   | 6      |   43  0|  5     |7     1 |     2  |        |        |        |
adr:710        |        | 6      |   4    |   4   0|      1 |     2  |7      0| 6 4    |   4    | 6 4 2  |     2  |        |        |        |
adr:720        |        |  5     |  5     |  5     |7      0|      10|      1 |    3   |    3   |        |     2  |        |        |        |
adr:730        |        |   4    | 6      | 6     0|      10|      1 |     2  |     2  |     2  | 65 32 0|    3   |        |        |        |
adr:740        |        |  5     |  5     |  5  2  |     2 0|      1 |     2  |      1 |       0| 6 4 2 0| 6 4    |        |        |        |
adr:750        |        | 6      |   4    |   43   |   4   0|        |     2  |       0|        |        |    3   |        |        |        |
adr:760        |        | 6      |   4    |   4    | 6      |7       |    3   |        | 6      | 65 32 0|     2  |        |        |        |
adr:770        |        | 6      |   4    |  5     |76543210|76543210|76543210|76543210|76543210|7654    |     2  |        |        |        |
adr:780        |        | 6      |   4    |       0|    3  0|        |        |    3  0|        |    3   |     2  |        |        |        |
adr:790        |        | 6      |   4    |       0|    3  0|        |        |    3  0|        |    3   |     2  |        |        |        |
adr:7a0        |        | 6      |    3 1 |7 5 3 1 |76543210|76543210|76543210|76543210|76543210|7654    |     2  |        |        |        |
adr:7b0        |        | 6      |        | 65432 0|        |        |STARTPOS|        |        |        |     2  |        |        |        |
adr:7c0        |        | 6      |        | 65432 0|        |        |        |        |        |        |     2  |        |        |        |
adr:7d0        |        | 6      |        | 65432 0|        |        |        |        |        |        |     2  |        |        |        |
adr:7e0        |        |  5     |        | 65432 0|        |        |        |        |        |        |    3   |        |        |        |
adr:7f0        |        |    3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5 3 1 |7 5     |        |        |        |


Well, the vertical position counter is 12 bits (0-4096) and if we reset it to zero at the start of the frame, where will the car end up?

The screen is 521 lines so let's divide 4096 by 521.

so we divide it and we get 7.86 frames

> (4096 / 521)
7.8618042226488

multiply 7 * 521 = 3647

and subtract 4096 - 3647 = 449 which is 0x1c1 which is really close to 0x1b0. Maybe it's slightly different because of when the vertical blank hits.


===============================




[Linked Image from i.imgur.com]


Also I was trying to figure out how the 9314 worked (used to do checkpoints and scoring) and recreate it in Logisim, but it's got this weird symbol that looks like an AND gate but the inputs come into the side.

What does this mean?

edit: after a bunch of searching around, it's a wired and.

[Linked Image from i.imgur.com]

Last edited by Golden Child; 06/20/22 03:36 AM.
1 member likes this: robcfg
Joined: Feb 2014
Posts: 852
Likes: 48
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 852
Likes: 48
After building a circuit for the 9314, it makes it easy to see how the checkpoint system works.

Each point has to be hit in sequence and hitting the finish line resets it.

[Linked Image from i.imgur.com]
[Linked Image from i.imgur.com]
[Linked Image from i.imgur.com]

1 member likes this: robcfg
Joined: Feb 2014
Posts: 852
Likes: 48
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 852
Likes: 48
One of the things that had me puzzled was this circuit for the extended play. If you score a certain amount, you get a free game, but only one free game per credit.

[Linked Image from i.imgur.com][Linked Image from i.imgur.com]

[Linked Image from i.imgur.com]

so hitting free game signal (FGS) will cause both NAND SR latches to flip

but it doesn't look like anything actually changed because NOT EXTENDED PLAY seems to remain 1.

[Linked Image from i.imgur.com]


So I built the circuit in Lushprojects circuitjs and it becomes easy to see, when you hit FGS, it causes NOT EXTENDED PLAY to go momentarily to 0, then that 0 feeds back to the 7410 input, flipping the SR latch making the topmost input to the second stage 7410 a zero which makes NOT EXTENDED PLAY go back to 1.

[Linked Image from i.imgur.com]

If you look at the scope on the bottom, you can see the voltage drop down momentarily (the green line) to make a logic 0 and then go right back up.
It took me awhile to figure out how to add a scope to the bottom pane, add Voltmeter/Scope Probe, then right click on it and View in New Scope.


Circuitjs saves its circuits as text so you can select "Import from Text" and paste this in:

https://lushprojects.com/circuitjs/circuitjs.html

Code
$ 3 0.0000049999999999999996 1.0312258501325766 83 5 50 5e-11
151 464 288 704 288 0 2 0 5
151 464 368 704 368 0 2 5 5
151 720 320 1040 320 0 3 5 5
w 704 288 720 304 0
w 704 368 464 304 0
w 704 288 464 352 0
w 464 384 1040 384 0
L 720 320 464 448 0 1 false 5 0
L 720 336 416 528 0 0 false 5 0
L 464 272 384 208 0 1 false 5 0
O 1040 320 1200 288 0 0
M 1040 320 1184 352 0 2.5
r 1040 320 1040 384 0 100
c 1040 384 1040 432 0 1e-7 4.999999999999998 0.001
g 1040 432 1040 480 0 0
p 1040 384 1200 384 1 0 0
o 15 1 0 4098 5 0.1 0 1

So now after modeling the whole circuit I can see how it works:

[Linked Image from i.imgur.com]

Joined: Feb 2014
Posts: 852
Likes: 48
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 852
Likes: 48
[Linked Image from i.imgur.com]

Experimenting with the existing gran trak 10 driver to see what it does by enabling some of the "hacks".

I hacked on my bitmap printer device to make a little "scope" display to visualize the signal.

Using a NETDEV_ANALOG_CALLBACK_MEMBER I can get the value of an output.


I modeled it after the way it outputs the video to the fixed frequency monitor device.

It complained if I tried to set a duplicate of the VIDEO_OUT so I chose the COMP_SYNC signal.



Code
	NETLIST_CPU(config, "maincpu", GTRAK10_VIDCLOCK).set_source(netlist_gtrak10);

	BITMAP_PRINTER(config, m_bitmap_printer, 902, 521, 72, 72);  // do 72 dpi
	m_bitmap_printer->set_pf_stepper_ratio(1,1);  //
	m_bitmap_printer->set_cr_stepper_ratio(1,1);

	NETLIST_ANALOG_OUTPUT(config, "maincpu:vid0", 0).set_params("VIDEO_OUT", "fixfreq", FUNC(fixedfreq_device::update_composite_monochrome));

	NETLIST_ANALOG_OUTPUT(config, "maincpu:test1", 0).set_params("COMP_SYNC", "bmp", FUNC(bitmap_printer_device::update_test));


Adding the following to bitmap_printer_device.h:

Red = 0V, Green = 2.5V, Blue = 5V

Code
int m_testx = 0;
	int m_testy = 0;
	double m_test_last_time = 0.0;
	double m_test_xposd = 0.0;
	double m_test_horizscale = 1.0 / 14.318e6;  // single pixel
	int m_lastx = 0;
	int m_rowsize = 40;
	int m_rowgap = 40;

NETDEV_ANALOG_CALLBACK_MEMBER(update_test) 
{
	printf("UPDATE TEST: %f  data= %f\n", time.as_double(), data);

	double m_time_elapsed = time.as_double() - m_test_last_time;
	m_test_xposd += m_time_elapsed / m_test_horizscale;
	if (m_test_xposd >= m_paper_width)  
	{
		m_test_xposd = 0; m_lastx = 0;
		m_testy = m_testy + m_rowsize + m_rowgap;
		if (m_testy >= m_paper_height-m_rowsize - m_rowgap) m_testy = 0; 
	}
	m_testx = m_test_xposd;
	for (int x = m_lastx; x<= m_testx; x++)
	for (int y=m_testy; y < m_testy + m_rowsize + m_rowgap; y++) draw_pixel(x,y,0xffffff);
	for (int x = m_lastx; x<= m_testx; x++)
	{
		draw_pixel(x,m_testy  + m_rowsize - data * (m_rowsize / 5.0), 0);
		draw_pixel(x,m_testy  + m_rowsize - 0.0 * (m_rowsize / 5.0), 0xff0000);  // red
		draw_pixel(x,m_testy  + m_rowsize - 2.5 * (m_rowsize / 5.0), 0x00ff00);  // green
		draw_pixel(x,m_testy  + m_rowsize - 5.0 * (m_rowsize / 5.0), 0x0000ff);  // blue
	}
	m_test_last_time = time.as_double();
	m_lastx = m_testx;
}

Joined: Feb 2014
Posts: 852
Likes: 48
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 852
Likes: 48
After making some more analog outputs so I could see what's happening with gran trak 10:



Code
NETLIST_ANALOG_OUTPUT(config, "maincpu:data0", 0).set_params("DATA0", "bmp", FUNC(bitmap_printer_device::update_data0));
NETLIST_ANALOG_OUTPUT(config, "maincpu:data1", 0).set_params("DATA1", "bmp", FUNC(bitmap_printer_device::update_data1));
NETLIST_ANALOG_OUTPUT(config, "maincpu:data2", 0).set_params("DATA2", "bmp", FUNC(bitmap_printer_device::update_data2));
NETLIST_ANALOG_OUTPUT(config, "maincpu:data3", 0).set_params("DATA3", "bmp", FUNC(bitmap_printer_device::update_data3));
NETLIST_ANALOG_OUTPUT(config, "maincpu:data4", 0).set_params("DATA4", "bmp", FUNC(bitmap_printer_device::update_data4));
NETLIST_ANALOG_OUTPUT(config, "maincpu:data5", 0).set_params("DATA5", "bmp", FUNC(bitmap_printer_device::update_data5));
NETLIST_ANALOG_OUTPUT(config, "maincpu:data6", 0).set_params("DATA6", "bmp", FUNC(bitmap_printer_device::update_data6));
NETLIST_ANALOG_OUTPUT(config, "maincpu:data7", 0).set_params("DATA7", "bmp", FUNC(bitmap_printer_device::update_data7));

#define DEBUGNLAO(x,y) NETLIST_ANALOG_OUTPUT(config, "maincpu:"#x, 0).set_params(#y, "bmp", FUNC(bitmap_printer_device::update_##x));

DEBUGNLAO(a0,A0)
...
and then a corresponding printing routine:

Code
#define DEBUGITEM(x) NETDEV_ANALOG_CALLBACK_MEMBER(update_##x) {printf("UPDATE " #x ": %f  "#x"= %f\n",time.as_double(),data); }

DEBUGITEM(data0)
DEBUGITEM(data1)
DEBUGITEM(data2)
DEBUGITEM(data3)
DEBUGITEM(data4)
DEBUGITEM(data5)
DEBUGITEM(data6)
DEBUGITEM(data7)
DEBUGITEM(a0)
...

I could see that nld_tms4800 rom wasn't outputting any data,
so after fixing that

Code
			else
			{
//				unsigned d = 0x00;   // doesn't actually output any data setting d to zero
				unsigned d = m_last_data;
				for (std::size_t i=0; i<4; i++)
				{
					if (m_OE1())
						m_D[i].push((d >> i) & 1, delay);
					if (m_OE2())
						m_D[i+4].push((d >> (i+4)) & 1, delay);
				}
			}
		}

[Linked Image from i.imgur.com]

It looks a little bit recognizable. I'm really confused by fixfreq.cpp and how it handles the sync so I see about one frame of screen then nothing.

2 members like this: robcfg, wolfi
Page 1 of 5 1 2 3 4 5

Link Copied to Clipboard
Who's Online Now
2 members (Dam0, 1 invisible), 21 guests, and 3 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,100
Posts119,241
Members5,019
Most Online890
Jan 17th, 2020
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com