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 > Assembly and adding a Picture
2009-08-26 19:51
MisterMSK
Account closed

Registered: Jul 2009
Posts: 37
Assembly and adding a Picture

Hi All,

I have some assembly code written for ACME assembler. I was just curious how I would add a picture into the code. I got the pause down but I just need a picture to show. Doesn't matter what format. I assume I can change my picture to most formats specified.

This would be great if someone could let me know.

Thanks,
MisterMSK
 
... 21 posts hidden. Click here to view all posts....
 
2009-08-26 21:47
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
ACME:

*=address of pic
!bin "filename.prg",, $02
2009-08-27 03:39
TWW

Registered: Jul 2009
Posts: 545
And for actually showing the picture it depends totally wich format you are using.

But a Koala picture f.ex. is stored in video bank from $4000-8000.

It is a good format to get familiar with setting up gfx on the c64.

The bmp is from $6000 to $6e40 and immediately after you will find the char-colours and after that again you will find the $d800 colours.

which means you need to switch video bank ($dd00) and then set the correct video display ($d018) and then you need to copy the char colours into the video display you have selected in $d018. Lastly you need to copy the $d800 colours to....... $d800 :-)))))

alternatively you can transfer the bmp to $2000 - $3e40 and use $0400 and $d800 as normal.

You will find more about setting the video bank and $d018 in the programmers reference manual. And if I am not misstaken you will probably find 1000+ koala display routines on the net :) try a google!
2009-08-27 06:09
Angel of Death

Registered: Apr 2008
Posts: 211
hmmmm...
Why don't you do it the old-fashioned way? Steal the code!
Maybe from this one:
Hello!
(Please Jan. Don't shoot me. I'm just joking. Stealing is wrong!)

:))
2009-08-27 09:44
Mace

Registered: May 2002
Posts: 1799
Quoting TWW

But a Koala picture f.ex. is stored in video bank from $4000-8000.

That's totally untrue in any cross platform assembler, as you can load the binary at any location you wish.

Again, I'm not familiar with ACME, but in 64TASS you're able to even load a certain part of a binary.
This means you could load the bitmap, the chars and the colours at different locations, breaking up the Koala structure of the original binary.

Think outside the box ;-)
2009-08-27 10:43
linde

Registered: Jul 2006
Posts: 47
I put my pictures immediately after the code and move it where it should be using a loop to keep the size down a bit. My bsessive mind can't really stand having a bunch of empty space between the pic and code.

PS. not recommended if you're not using an assembler ;)
2009-08-27 13:37
enthusi

Registered: May 2004
Posts: 677
or do it the other way round - align the code to the gfx.
This way you save quite some memory to be overwritten:

*=$5c00

hirescolmap
.bin 8002,1000,"gfxfun/rooms2.ip64h"
.dsb 24,0
hiresbitmap
.bin 2,8000,"gfxfun/rooms2.ip64h"

code_start
	
init_gfx
	sei
	lda #$06
	sta $d020
	lda #%00000010
	sta $dd00
	lda $d011
	ora #%00111000	;enable hires + screen on
	sta $d011	
	lda #%01111000  
	sta  $d018


PS: ip64h is interpaint HiRes - gimp with cbmplugs is able to export to this format ;-)
PPS: you could also put the code inside the 24 byte gap between bitmap and colormap but well....
2009-08-27 13:50
Mace

Registered: May 2002
Posts: 1799
Quoting linde
My obsessive mind can't really stand having a bunch of empty space between the pic and code.

Funny.
The empty space between the code and the picture probably crunches better than the code to move the picture.
So in the end you're crunched file might be longer ;-)

So, yeah, what enthusi said.
2009-08-27 15:02
Skate

Registered: Jul 2003
Posts: 494
If you are using ACME, check this out. my library (sk8viclib) is exactly what you need.

http://www.akaydin.com/sk8lib/

in examples folder, there is an example called "vic+mem_example". this should help.

p.s: this library is not complete and not updated for a few years. but I'll finish and release it someday.


2009-08-27 19:16
TWW

Registered: Jul 2009
Posts: 545
Quoting tww

But a Koala picture f.ex. is stored in video bank from $4000-8000.

Quoting mace

That's totally untrue in any cross platform assembler, as you can load the binary at any location you wish.

Again, I'm not familiar with ACME, but in 64TASS you're able to even load a certain part of a binary.
This means you could load the bitmap, the chars and the colours at different locations, breaking up the Koala structure of the original binary.

Think outside the box ;-)


Uhm... a "KOALA" picture isn't in the $4000-8000 bank???

My statement stands true, I mentioned nothing about relocating. Any nimbwitt knows that everything can be relocated.

MisterMSK wanted someone to explain to him how to display a picture. You do this by teaching him how the format of the gfx works and how to set up $dd00/d018/d016/d011. then you can start relocating and customize as you wish after you get that part!

think standard format & learning ;-)
2009-08-27 22:10
Skate

Registered: Jul 2003
Posts: 494
@TWW: My library is a middle way solution. He can put his graphic datas to anywhere allowed in the memory without understanding how dd00/d018/d016/d011 works. Of course this is only good for the first step.
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
Alta
Alakran_64
Unicorn/TWA
iAN CooG/HVSC
sln.pixelrat
DeMOSic/MS^LSD^ONS
E$G/HF ⭐ 7
Guests online: 115
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
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 Diskmag Editors
1 Magic  (9.8)
2 hedning  (9.6)
3 Jazzcat  (9.5)
4 Elwix  (9.1)
5 Remix  (9.1)

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