On 11.11.2015 02:03, Harry Potter wrote:
> On Tuesday, November 10, 2015 at 5:49:02 PM UTC-5, Pekka Takala
> wrote:
>> I suggest that you do like this:
>>
>> -first load a program you are crunching testing. -Modify the
>> program so that it actually does not run the program - just change
>> it to make poke1,55 and then execute setnam, setlfs and load
>> routine with verify flag (c-flag) set. After all, you do _not_ need
>> to execute the actual program, just verifying it is enough. -Save
>> the name in the program as original.prg and then save the
>> _uncrunched_ program with EXACTLY that name. -Crunch the program
>> -Execute the sfx
>>
> So just add a ML VERIFY test code in the SFX after decompressing. I
> can do that! However, before creating an SFX, I want to use a raw
> method and compare the final output to the initial test file. I can
> use a batch file to extract the former from a disk image and use
> VBINDIFF to compare it to the initial input file as one already in
> the Windows file system. I just want a better way. :)
>
Ehm, do not add the code after decompressing. Do it to the /source data
program/, so that the code does just automatical verify instead of
executing the whole software. You then can test the ACTUAL code, and
still the sfx does its job. So if the sfx compress/decompress does not
work, then indeed the verify does not success - be the error in
anywhere. In pseudocode:
10 sys 2061 in basic
2061: poke1,55
callsub setlfs ;and set it
callsub setnam ;and set it
sec ;set carry
call load ; the rts of the load routine handles the rest
---- rest of the code snippet ----
the end
so when you execute the source program, it just verifies itself against
the disk
Another way to do this if your sfx supports basic programs:
10 verify"original",8
20 end
30 rem this is some shit
40 rem this is another shit
50 poke 53281,0:poke 53280,0
60 print"this is great shit"
Then save this as name "original". After that, you compress it. When sfx
executes the program, it just verifies itself against the disk. Remember
to save the sfx so that it is on another name, e.g origsfx.
FYI, I usually add this to my basic programs:
1 goto 5
2 a$="progname":open1,8,15,"s0"+as:close1:savea$,8:verifya$,8:end
5 rem
When the program is finalized, I remove lines 1, 2 and 5 and then do the
scratch + save + verify manually. This row prevents the infamous
save-with-replace bug of 1541 to make my disks corrupt. This also
catches if disk is full since verify does not then go through. Only
trouble with the code is that if power goes off before save is
finished.... but that is why I use multiple disks.
--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|