BBCSDL and Crunch

Discussions related specifically to the Windows, Linux (86), Mac OS-X and Raspberry Pi editions of BB4W and BBCSDL
mavison
Posts: 34
Joined: Tue 03 Apr 2018, 17:27

BBCSDL and Crunch

Post by mavison »

Using BBCSDL v1.22a and the SDLIDE, when I 'compile' an application with none of the Crunch options selected, and Crunch embedded program not selected, on Windows10pro it creates a zip file of 1,903 KBytes.

If I select ALL the Crunch options, the zip file is 2,014 KBytes. Which puzzled me.

When I looked into the zips, the bbc files were seen to be the cause, although much smaller than the other dll, docx, exe and ttf files which had not had changed size. The 13 bbc files had all changed size - always larger, and sometimes by considerable amounts - eg from 5KB to 50KB

Looking at some bbc files it seems that the compressed ones have lots of other BASIC code (fom other parts of the application?) after the end of the real source file. Is this required, or rubbish? What should mark the end of a source file? There were often line numbers of 65535 in the middle of the crunched files.

Is Crunch working as designed, or is it my understanding that is wrong?
The only docs I can find refer to the BBC4WIN version, which is slightly different.
mavison
Posts: 34
Joined: Tue 03 Apr 2018, 17:27

Re: BBCSDL and Crunch

Post by mavison »

After more investigation, it is just the zips produced with 'Crunch Embedded' specified which are affected ... so I suspect it is my use of both INSTALL and REM!Embed which is causing my confusion. Further reading of the manual underway...
mavison
Posts: 34
Joined: Tue 03 Apr 2018, 17:27

Re: BBCSDL and Crunch

Post by mavison »

After much documentation reading and investigation my conclusions are:

My BBCSDL application has a main bbc file which uses 13 other bbc libraries, all referenced by INSTALL and REM!Embed in the main program - 10 from @dir$ and 3 from @lib$. This I think is correct.

When compiling on Win10pro, if Crunch Embedded is not selected, all the other crunch options seem to do what they should, but as expected only the main program being compiled is crunched.

However, when Crunch Embedded is selected, the other crunch options seem to have been applied to all 14 bbc files up to what appears to be the EOF marker (line number of xFFFF). But 13 of 14 files also have appended another 37KB to 50KB of code, which seems to start and end in the middle of other files. The only file which does not expand is dlglib, which shrinks from 50KB to 32KB (but it was the largest file, which may be a clue). The total (uncompressed) size of all the bbc files grows from 147KB to 575KB, which seems very wrong.

This looks rather like a possible bug to me, or have I done something wrong?