Jump to content

World Class Leaderboard for DOS compressed files


Recommended Posts

Good morning, meanwhile congratulations for all the hard work here in this community you have created, I apologize for the trouble.

I am Nicola, a computer enthusiast who together with other guys is trying to create a 360 degree editor of World Class Leaderboard Golf for DOS, by Carver Brothers.

I analyzed the audio files first and noticed that when they are in EDT or RS format they are simple 8 bit unsigned mono 8/16 KHz Little endian PCM samples, so few problems up to this point wanting to insert custom sounds.

The problems arise when I try to decipher the RSH format, the h at the bottom suggests Huffman for compression, and in fact spying the contents with a hex editor I notice a similar structure:

0400 signature
LB HB size WHOLE unpacked file (never more than 64k then)

Huffman tree
Typical example: 5001 EC01 B601 7201 AE00 A800 1400 0002 0402 0802 0C02 8801... with pattern xx01 xx01 xx01 xx00 xx00 xx02 ...

00 and 01 can be left or right in the Huffman tree, but 02??? Ternary structure???? How do I distinguish a leaf from a generic node?

Bitstream

Through Dosbox I was able to dump the unpacked versions into memory of all RSH files so I have the unpacked RS files, but I would not know how to create from my own PCM 8 bit unsigned mono 8/16 KHz sound file an RSH file containing a custom sound of my own, basically I did not understand and therefore did not recreate the compression algorithm. I am attaching a pair of RS/RSH files.

Going on to analyze the files, I noticed that some image files, TITLESCN.HUF, LDRBRD.HUF, GOLFER.HUF, the title screen, the high scores screen, and the golfer's sprite, respectively, are also compressed in the same way.

The LBM files, on the other hand, are simple files in uncompressed Amiga IFF format, and so we are able to open and edit them through Deluxe Paint, which has also been ported to Windows.

The .MST files of the courses are also compressed with the same algorithm, but they should also be a container for a whole series of files A01.BAS, A02.BAS, A03.BAS etc which in the old CGA only version are unpacked and not packed together unlike the final EGA/VGA version, this is the version we would like to customize with an editor.

By analyzing the individual BAS files of the CGA only version we have traced them back to a coherent internal structure and thus are able to decipher them and correctly draw the individual holes of the standard path. We currently use these individual BAS files from the CGA version to be able to create new holes; even the final version reads them from “loose,” not in the MST container.

Wanting to open the MST files of the expansion holes, however, we are still stuck with this (hypothetical but likely) tremendous Huffman algorithm for most of the data in this game.

All these considerations aside, the question is: can you help us in writing a script to be able to unpack and recompress these files? I am also attaching a compressed HUF, MST and a single BAS taken from the CGA version.

I hope you can help us, thanks in advance and if you even want to give us some hint for our purpose we would be infinitely grateful,

See you soon! Link: https://mega.nz/folder/crRywZ6K#Rpkxim1Yp-7VbR0278I7ZA

P.s.: further details: same RSH sounds and same compression tech is used in Echelon, same year, always coded by Access Software Carver bros. I've managed to decompress the exe which was compressed with SEA-AXE tech and the decoding routine seems this, captured in Dosbox debugger:
 

1291:00007827 BEA800              mov  si,00A8       
1291:0000782A 8A07                mov  al,[bx]                ds:[021B]=E5F4    
1291:0000782C 84C2                test dl,al                                    
1291:0000782E 7503                jne  00007833 ($+3)         (down)            
1291:00007830 AD                  lodsw                                         
1291:00007831 EB05                jmp  short 00007838 ($+5)   (down)            
1291:00007833 81C6A400            add  si,00A4                                  
1291:00007837 AD                  lodsw                                         
1291:00007838 D0CA                ror  dl,1                                     
1291:0000783A 83D300              adc  bx,0000                                  
1291:0000783D 3D0202              cmp  ax,0202                                  
1291:00007840 7207                jc   00007849 ($+7)         (no jmp)         
1291:00007842 2DFC01              sub  ax,01FC
1291:00007845 8BF0                mov  si,ax                                    
1291:00007847 EBE1                jmp  short 0000782A ($-1f)  (up)              
1291:00007849 2D0200              sub  ax,0002                                  
1291:0000784C D1E8                shr  ax,1                                     
1291:0000784E AA                  stosb       
1291:00007849 2D0200              sub  ax,0002                                  
1291:0000784C D1E8                shr  ax,1                                     
1291:0000784E AA                  stosb                                         
1291:0000784F E2D6                loop 00007827 ($-2a)                          
1291:00007851 1F                  pop  ds                                       
1291:00007852 BB85A6              mov  bx,A685  

 

Edited by tomnic
news
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...