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: 5127
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
csabanw
Acidchild/Padua
Spinball/Excess
mutetus/Ald ^ Ons
hedning/G★P
rime/Fancy Rats
Guests online: 454
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Codeboys & Endians  (9.7)
4 Mojo  (9.6)
5 Coma Light 13  (9.6)
6 Edge of Disgrace  (9.6)
7 Signal Carnival  (9.6)
8 Wonderland XIV  (9.5)
9 Uncensored  (9.5)
10 Comaland 100%  (9.5)
Top onefile Demos
1 Nine  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.5)
6 Scan and Spin  (9.5)
7 Onscreen 5k  (9.5)
8 Grey  (9.5)
9 Dawnfall V1.1  (9.5)
10 Rainbow Connection  (9.5)
Top Groups
1 Artline Designs  (9.3)
2 Booze Design  (9.3)
3 Performers  (9.3)
4 Oxyron  (9.3)
5 Censor Design  (9.3)
Top Logo Graphicians
1 t0m3000  (10)
2 Sander  (9.8)
3 Shine  (9.5)
4 Mermaid  (9.5)
5 Pal  (9.4)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.034 sec.