| |
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.... |
| |
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.
|
| |
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. |
| |
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..
|
| |
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 |
| |
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.
|
| |
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 -'). |
| |
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. |
| |
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.
|
| |
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 ;) |
| |
ready.
Registered: Feb 2003 Posts: 441 |
|
Previous - 1 | 2 | 3 | 4 - Next |