Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Starting BASIC programs from decompression routine
2004-09-10 09:39
Kabuto
Account closed

Registered: Sep 2004
Posts: 58
Starting BASIC programs from decompression routine

I've made just another packer for C64 :) it works fine with most machine code programs but not with BASIC programs.

In some other packer I've seen a sequence of 2*JSR and 1*JMP to the BASIC interpreter to set up some things but these don't work because my routine overwrites $0001-$0120 and $0300-$07FF so the BASIC interpreter reads unexpected values there and hangs.

Is there a simple way to restore information there without losing the BASIC program or control?
2004-09-10 10:53
Oswald

Registered: Apr 2002
Posts: 5017
check the kernal listings, find the basic reset subroutine..., also you must set some ptrs which point to the start end of the basic prg or smth like that.
2004-09-10 12:41
Graham
Account closed

Registered: Dec 2002
Posts: 990
you definitely need to initialize the zeropage and the vector tables. not only basic programs need them, also a lot of machine code programs use rom routines and they can heavily crash if some zeropage value is wrong. for example, clearing the screen with JSR $E544 etc.
2004-09-10 21:09
White Flame

Registered: Sep 2002
Posts: 136
Just copy $0000-$03ff out to $fb00 or something, and copy it back after the depack. I presume this is the code that you were looking at? It's what exomizer adds to the beginning of a compressed BASIC file, so that a jmp $0801 will run the BASIC program from ml.

0801: Entry00 lda#$1B
0803: sta $zTXTTAB (002B)
0805: lda#$08
0807: sta $002C
0809: lda#$F7
080B: sta $zVARTAB (002D)
080D: lda#$92
080F: sta $002E
0811: jsr $SA659 (A659)
0814: jsr $bLINKPRG (A533)
0817: jmp $bNEWSTT (A7AE)

081A: 00 43 50 01 00 43 50 B2 31 3A 57 41 B2 34 3A 46
082A: B2 34 3A 4D B2 34 30 3A 99 22 93 22 3B 00 8D 36
083A: 02 00 8D 36 35 37 3A 4F 42 24 28 38 33 29 B2 22
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
A3/AFL
Didi/Laxity
Oswald/Resource
TheRyk/MYD!
Courage
ϵʟʞ/ₐтₐ
WVL/Xenon
Sentinel/Excess/TREX
Guests online: 163
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.8)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Original Suppliers
1 Derbyshire Ram  (9.5)
2 Black Beard  (9.4)
3 hedning  (9.2)
4 Baracuda  (9.1)
5 Irata  (8.5)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.033 sec.