Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user eightbitswide ! (Registered 2024-12-24) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > I need help with packing
2006-01-03 15:25
ready.

Registered: Feb 2003
Posts: 441
I need help with packing

I'm working on a C64 project which requires a lot of loading from disk. I have already got easy with The Dreams fast loader. In order to decrease disk drive access I'm thinking about compressing the datas. I know there are some tools that can compress datas, but I've never worked with them. What I need is:
-a tool that can pack the original data into a file;
-the part of code to insert into my assembler routine, which can unpack the data to memory after loading.

Can anybody suggest me a good packing tool with instructions?

thanks, Ready.
 
... 28 posts hidden. Click here to view all posts....
 
2006-01-07 14:27
Slammer

Registered: Feb 2004
Posts: 416
Hmm. Sorry about the repetitions. Guess you shouldnt step back over the message with <- when you are done browsing :-(

Tlr: That is absolute a possibility. Or just make java execute a program on the hostmachine and read the resultfile afterwards. But java-cruncher is my first choise since its easier for the user to install: One file works on all systems, no recompiling etc.

2006-01-07 14:34
tlr

Registered: Sep 2003
Posts: 1790
Quote: Hmm. Sorry about the repetitions. Guess you shouldnt step back over the message with <- when you are done browsing :-(

Tlr: That is absolute a possibility. Or just make java execute a program on the hostmachine and read the resultfile afterwards. But java-cruncher is my first choise since its easier for the user to install: One file works on all systems, no recompiling etc.



I'll have to agree a bit with Ian here though.
I don't particulary like Java command-line utilities as they tend to provide a different interface at the prompt, and I don't find them easy to install.
Besides most systems except Windows have a c-compiler by default, so Ansi C should work fine. Not many systems have a Java-interpreter by default.

It should be said here though, that I'm a *nix kind of guy and use emacs, make and cvs for most of my code, so I don't bother compiling most of the tools.

Others might disagree. We all have different approaches. Some code straight into an ML-monitor aswell. :)

The pack-directive is a nice feature! :) Should make it real easy to do overlay-style programming of big programs.
2006-01-08 10:53
Slammer

Registered: Feb 2004
Posts: 416
Quote: I'll have to agree a bit with Ian here though.
I don't particulary like Java command-line utilities as they tend to provide a different interface at the prompt, and I don't find them easy to install.
Besides most systems except Windows have a c-compiler by default, so Ansi C should work fine. Not many systems have a Java-interpreter by default.

It should be said here though, that I'm a *nix kind of guy and use emacs, make and cvs for most of my code, so I don't bother compiling most of the tools.

Others might disagree. We all have different approaches. Some code straight into an ML-monitor aswell. :)

The pack-directive is a nice feature! :) Should make it real easy to do overlay-style programming of big programs.


Actually, I really like C/C++ and use it whenever it I shall do fast code. But Java has its advantages too. Its detection of indexing out of bounds, stacktraces, the uniform way they build their libraries, etc. and then environments like Idea and Eclipse beat those I have seen for C/C++.

The installation process for a java tool doesnt need to be difficult. For Kick Assembler there is no installation! Just download the jarfile and write:

java kickass.jar myProgram.asm

Thats all it takes..





2006-01-08 11:17
Krill

Registered: Apr 2002
Posts: 2980
slammer: what you described is easily done in ca65, too, since it can have overlapping segments easily. the rest (packing) can nicely be controlled with the makefile. any more features of kickass? :D
2006-01-08 12:07
tlr

Registered: Sep 2003
Posts: 1790
Quote:
The installation process for a java tool doesnt need to be difficult. For Kick Assembler there is no installation! Just download the jarfile and write:

java kickass.jar myProgram.asm


I don't have java on my development machine yet, so I'd have to install that first, but fine. You could do "alias kickass='java kickass.jar'" and then it would look like any other tool.

A suggestion about the .pack feature. Couldn't it be done such that you specify with a directive which physical command line should be run.
With this it could be used for any transformation, not just packing. e.g encryption, screen-code conversion, etc...
Also, with this you don't need to lock the user to only have the built in packer.
2006-01-08 15:41
Slammer

Registered: Feb 2004
Posts: 416
tlr: Good idea :-) Something like a .transform "comandline" {...}

Krill: Well, Guess its dangerous to reveal anything since it might stop the project cause of a low moral among the crew (alis me) and I dont know ca65 :-). But its has a nice scriptlanguage featuring types like: Strings, Booleans, Lists, Vectors and Matrixes. You have access to the entire java math library and to a vector library. Its handy for calculating data tables and unrolling loops. Then it has some nice features like when declaring a memoryblock you have the possibility of assigning a name, and automaticly have a memory map generated when assembling. And it has named multilabels so you can have more than just one (ie: 'bne !loop-' instead of 'bne -').
2006-01-08 17:04
Krill

Registered: Apr 2002
Posts: 2980
The transform feature is a nice idea. The label stuff however looks like local labels to me, something ca65 can do, too. the accessibility of the maths libraries is a nice feature, i currently use java and gnu octave for calculating tables and the like. but programs like octave, matlab and their script languages are much more powerful than what java offers. i certainly would not want to implement things like a polynomial finding algorithm in java, something i recently needed for packing some tables in my next 4k demo, so that they are represented by merely 26 bytes (5 float numbers for a 4th degree polynomial).
anyways, for generic tasks like generating sine or div lookup tables, that maths lib accessibility is a nice feature i miss in ca65.
but you should certainly take a look at ca65, it has some really nice features and is currently the most sophisticated c64 assembler in my eyes.
2006-01-15 19:50
ready.

Registered: Feb 2003
Posts: 441
Ok, I got the Exomizer 2.0 to work, it does a good job. I managed to load the packed file with The Dreams fast loader. There only one problem left: depacking. In the .zip file of Exomizer, there's also the code for the depacker: exodecrunch.s. I assembled it with 64tass. There is a part of code to add, according to the instructions:

get_crunched_byte
php
chr_byte lda $1000
inc chr_byte+1
bne hh1
inc chr_byte+2

hh1
plp
rts

The packed file starts at $1000.

When I run the file, after depacking $1f bytes, the routine stops with a jam instruction. Looking at the code of exodecrunch.s, I found it ends with a bcc:

.......
pla
tax
ldy zp_len_lo
bcc copy_start
;-------------------------------------------------------------------
; two small static tables (6 bytes)
;
tabl_bit:
.byte 2,4,4
..........

I'm afraid I'm missing something...can somebody help me, please? Maybe with an example code.

thanx, Ready.
2006-01-15 21:02
iAN CooG

Registered: May 2002
Posts: 3197
Use Endaddress of packed file not startaddress.
get_crunched_byte:
        lda _byte_lo
        bne _byte_skip_hi
        dec _byte_hi
_byte_skip_hi:
        dec _byte_lo
_byte_lo = * + 1
_byte_hi = * + 2
        lda $FFFF ;end_of_data
        rts

Anyway check PM ;)
2006-03-02 08:17
ready.

Registered: Feb 2003
Posts: 441
Previous - 1 | 2 | 3 | 4 - Next
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
Acidchild/Padua
Magic/Nah-Kolor
Brataccas/HF
Guests online: 83
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 X-Mas Demo 2024  (9.5)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

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