Author Topic: SCI0: SCI0 Interpreter with added PKWare DCL Implode compression (comp_method=3)  (Read 3316 times)

0 Members and 7 Guests are viewing this topic.

Offline robbo007

Hi guys,
On my quest to save hard disk space for my project after many hours of pulling my hair out I've managed to get a working version of the SCI0 Interpreter with added PKWare DCL Implode compression (comp_method=3) and only using a 6kb of memory footprint. Maybe someone else could do this better using less memory?

### Memory footprint (decompressor in SCIV.EXE)

4096-byte dictionary window : 4096 bytes
Fixed decode tables         : ~1800 bytes (compile-time constants)
State overhead              :  ~200 bytes
TOTAL                       : ~6096 bytes (~6KB)

I've also written a makevols.exe that compresses each resource with DCL Implode. Both are attached if anyone wants to test them.







Offline lskovlun

How much of this memory footprint is in heap, and how much is in hunk?

Offline Kawa

How much of this memory footprint is in heap, and how much is in hunk?
I don't think I understand the question. The decompressor is not itself a resource, and once uncompressed for use the resources are as big as always. Right?

Offline lskovlun

How much of this memory footprint is in heap, and how much is in hunk?
I don't think I understand the question. The decompressor is not itself a resource, and once uncompressed for use the resources are as big as always. Right?
The buffers can be allocated near (= in the data segment, preventing that space from being used for the heap) or far (= hunk).

Offline robbo007

Hi guys,
The patch costs the game zero heap and about 6KB of hunk, which matches how Sierra's own SCI16 engine handles this (it keeps the whole DCL work buffer in a far hunk Handle with zero near-heap use).
Hope that helps.

Offline cosmicr

Pretty neat, what's the compression ratio like? Imagine if Police Quest 2 was on just one disk etc... that would have been a game changer (literally!) back in the day.

Are there any SCI0 games that push the limit of the hunk memory?

Offline lskovlun

They almost certainly would have on some configurations. I think most SCI0 games required only 512KB of conventional memory? Not everyone had 640KB. And then there's various TSRs.
In fact these games also technically required an 8MHz processor, but I found that they ran passably on our 4.77MHz machine.

Offline cosmicr

Yeah I could have sworn I played KQ4, PQ2 and CB on my Tandy 1000 with 256k ram. I might be misremembering.

Offline lskovlun

They had this feature where you could monitor how much hunk was used at any given time. There was also a minHunk= directive in resource.cfg, which was checked on startup. Do some thorough playtesting, and you'll know what to set that value to.

EDIT: but apparently not in SCI0. Sigh, it's been too long since I worked on this.
« Last Edit: July 14, 2026, 11:12:30 AM by lskovlun »

Offline robbo007

Pretty neat, what's the compression ratio like? Imagine if Police Quest 2 was on just one disk etc... that would have been a game changer (literally!) back in the day.

Are there any SCI0 games that push the limit of the hunk memory?

So here is a comparison with my game. Its at 7.66mb right now but I still have to add all the music resources. So I think I'll be hitting 9.5mb when finished. Way too big. LOL

Code: [Select]
┌──────────────────────────────────────────────────────────────┬────────────────────┬─────────────────────────┐
│                           Version                            │  Size (measured)   │         vs raw          │
├──────────────────────────────────────────────────────────────┼────────────────────┼─────────────────────────┤
│ Raw/uncompressed (game-o/RESOURCE.001)                       │ 7.66 MB (7.30 MiB) │ ?                       │
├──────────────────────────────────────────────────────────────┼────────────────────┼─────────────────────────┤
│ Original SCI0 LZW/Huffman (MAKEVOLS, doc figure)             │ ~5.20 MB           │ ~1.40:1 (28.6% smaller) │
├──────────────────────────────────────────────────────────────┼────────────────────┼─────────────────────────┤
│ New DCL Implode patch (compress/RESOURCE.001, current build) │ 3.91 MB (3.73 MiB) │ ~1.96:1 (48.9% smaller) │
└──────────────────────────────────────────────────────────────┴────────────────────┴─────────────────────────┘

I did achieve better compression using RAR on the raw/uncompressed resource file, but in my case I not only wanted to save space on floppy disks I also want to save space on the hard disk as some of the older systems have very small hard disks. So I think the payoff of loosing 5kb memory, less hard disk space and number of floppy disks is the "happy medium".



SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.065 seconds with 22 queries.