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 Pixeling > Using Ganged to split a koala image
2010-12-06 00:03
Lobogris
Account closed

Registered: Oct 2010
Posts: 22
Using Ganged to split a koala image

Hi I am trying to split a koala image with this nice tool.
AFAIK a koala pic has the following info:

2 bytes header ($6000)
8000 bytes bitmap data
1000 bytes screen ram data
1000 bytes color ram data
1 byte background color

Well ...

If I use the Ganged option to save only the bitmap data, and
8194 bytes is saved to the file, instead of the 8002 bytes
(2 bytes of the header) I think that Ganged is wrong here, thinking that bitmap data is 8K when is 8000 bytes.

The color and screem rams are saved as expected, not 1026 bytes (2 bytes for address header) and files have the correct size = 1002 bytes.

What I am missing here? Its an error, a bug?
Thanks.
2010-12-06 18:35
Fungus

Registered: Sep 2002
Posts: 624
seems like a bug, the bitmap should be 8002 bytes with the load address on the beginning.
2010-12-10 04:42
Lobogris
Account closed

Registered: Oct 2010
Posts: 22
ok, I did a tool to split correctly the data and added the bug comment in ganged.
My tool here: http://noname.c64.org/csdb/release/?id=96301&rss
2010-12-10 08:11
Mace

Registered: May 2002
Posts: 1799
As I posten in a comment to your release: why would you want to split the file?

I'm asking this because here, but also in my work, people often want to solve a problem by working out one solution that they came up with.
A lot of times however other people can come up with other solutions that are easier, cheaper, more flexible or otherwise better to be worked out.

What I want to say is: give us insight in the problem behind the problem and let us think outside your box :-)

(For instance, if you're using a cross platform tool to develop, often it can load various parts of a single file and thus split the file up while compiling.)
2010-12-10 09:38
iAN CooG

Registered: May 2002
Posts: 3136
Quote: As I posten in a comment to your release: why would you want to split the file?

I'm asking this because here, but also in my work, people often want to solve a problem by working out one solution that they came up with.
A lot of times however other people can come up with other solutions that are easier, cheaper, more flexible or otherwise better to be worked out.

What I want to say is: give us insight in the problem behind the problem and let us think outside your box :-)

(For instance, if you're using a cross platform tool to develop, often it can load various parts of a single file and thus split the file up while compiling.)


Because you have to move anyway color and screen manually to display a bitmap, many times you don't even have 10001 free contiguous bytes in memory so the optimal solution is to place the 8000 bytes of bitmap already where it should be, then place screen/color attribs where there is space. In my cracks for example you'll often see the bitmap at $e000, screen at $c400 and colors at $c800, which are the only part needed to be manually copied to $d800.
Splitting a koala with just an hexeditor is trivial once you know the layout, but if you really need to do it several times, a tool can be always handy, why not? =)
2010-12-10 11:33
Lobogris
Account closed

Registered: Oct 2010
Posts: 22
Quote: As I posten in a comment to your release: why would you want to split the file?

I'm asking this because here, but also in my work, people often want to solve a problem by working out one solution that they came up with.
A lot of times however other people can come up with other solutions that are easier, cheaper, more flexible or otherwise better to be worked out.

What I want to say is: give us insight in the problem behind the problem and let us think outside your box :-)

(For instance, if you're using a cross platform tool to develop, often it can load various parts of a single file and thus split the file up while compiling.)


@Mace I needed for coding purposes... I needed to allocate that parts in concrete memory addresses and not in the koala order. And, sometimes if you exomize a koala the buffer to depack needs to be small, and spliting the file into 3 parts is useful, if you have available in your program a small area for the depack buffer.

I made another loader that loads a full koala instead of a splited one, but I have a different memory map for that file, and the exomized image was considerably smaller than this bitmap, so the depack routine had no problems.
2010-12-10 16:58
TheRyk

Registered: Mar 2009
Posts: 2076
As I already mentioned in my comment to the tool, why not use VICE, LOAD "BLABLA.PRG" (<-- the Koala File) with ,8,1 (,1 is important to have it at the right address), then pushing Alt+M in VICE and then hacking something like:
S "BITMAP" 08 $6000 $XYZZ (the end value you desire) 
S "SCREEN" 08 $7F40 $XYZZ (the end value you desire) 
S "COLOUR" 08 $8328 $XYZZ (the end value you desire)

That's the way I always do it. A little complicated but I got used to it and it enables me to save some RAM if I just want a little multicolour logo and split a part of the screen in textmode anyway (e.g. for a scroller).
2010-12-10 17:05
Lobogris
Account closed

Registered: Oct 2010
Posts: 22
Quote: As I already mentioned in my comment to the tool, why not use VICE, LOAD "BLABLA.PRG" (<-- the Koala File) with ,8,1 (,1 is important to have it at the right address), then pushing Alt+M in VICE and then hacking something like:
S "BITMAP" 08 $6000 $XYZZ (the end value you desire) 
S "SCREEN" 08 $7F40 $XYZZ (the end value you desire) 
S "COLOUR" 08 $8328 $XYZZ (the end value you desire)

That's the way I always do it. A little complicated but I got used to it and it enables me to save some RAM if I just want a little multicolour logo and split a part of the screen in textmode anyway (e.g. for a scroller).


I hadn't figured that :D yeah the vice monitor will be very handy here.
But if you have a lot of images to process, you can avoid a lot of typing using simply a specialized tool...

But I take note of your comment.. using vice is a nice option too.
2010-12-10 17:07
TheRyk

Registered: Mar 2009
Posts: 2076
As hinted in my comment, I don't think that your approach is a bad idea at all, especially if you have greater amounts of pictures to split. Maybe you can make sth of my feedback/request for further versions.

Keep it up, Cheers, Ryk
2010-12-10 17:26
Lobogris
Account closed

Registered: Oct 2010
Posts: 22
I appreciate all your feedback and it will serve to enhance this version into a more flexible tool in the future. :) Anyway it was not my initial idea... my initial idea was I have this tool wich I builded from scratch seeing that it doesn't existed, and once done... I think... well someone will need this tool, so I will upload it to the csdb.
But seeing the great need in the community (I am greatly surprised) of this kind of tool, I consider upgrading further on this tool in the future ;)
2010-12-11 16:10
MagerValp

Registered: Dec 2001
Posts: 1058
Don't pretty much all assemblers support including just parts of a file?

.segment "BITMAP"
.include "picture.koa", 2, 8000

.segment "CHARS"
.include "picture.koa", 8002, 1000

.segment "COLORS"
.include "picture.koa", 9002, 1000

Only one file to keep in your source repository, directly editable, and no external tools needed to build.
 
... 3 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - 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
fredrikr
csabanw
HCL/Booze Design
radius75
d'Arc/Topaz Beerline
Exploding Fi../Techn..
Holy Moses/Role
Guests online: 184
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 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.8)
4 Acidchild  (9.7)
5 Starlight  (9.6)

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