| |
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.
|
|
| |
Fungus
Registered: Sep 2002 Posts: 750 |
seems like a bug, the bitmap should be 8002 bytes with the load address on the beginning.
|
| |
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 |
| |
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.) |
| |
iAN CooG
Registered: May 2002 Posts: 3238 |
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? =) |
| |
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.
|
| |
TheRyk
Registered: Mar 2009 Posts: 2475 |
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). |
| |
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. |
| |
TheRyk
Registered: Mar 2009 Posts: 2475 |
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 |
| |
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 ;)
|
| |
MagerValp
Registered: Dec 2001 Posts: 1082 |
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 |