| |
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 |
|
| |
Mace
Registered: May 2002 Posts: 1799 |
I'm not familiar with the ACME assembler, but in general adding a picture comes down to inserting/binding a binary file of that picture as an external file into your code.
In 64TASS is would be something like:
*=$2000
.binary "my picture.prg",2
|
| |
SIDWAVE Account closed
Registered: Apr 2002 Posts: 2238 |
ACME:
*=address of pic
!bin "filename.prg",, $02 |
| |
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! |
| |
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!)
:)) |
| |
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 ;-) |
| |
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 ;) |
| |
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.... |
| |
Mace
Registered: May 2002 Posts: 1799 |
Quoting lindeMy 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. |
| |
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.
|
| |
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 ;-) |
... 21 posts hidden. Click here to view all posts.... |
Previous - 1 | 2 | 3 | 4 - Next |