Displaying images
I have been messing around with 68k assembly for a few weeks, the next step I want to make is to display an image on the screen.
I am using workbench 3.1 and I am using os includes to do everything at the moment, and am not confindent enough in my asm skills to do otherwise just yet. Can anyone point me to any tutorials or post up some sample code that does this? Cheers :) |
Hello Tiddlypeeps :)
What does your code do so far...? Displaying a pic is nice and easy but I'm not personally sure how to go about showing the pic in an OS friendly way - is that what you're after? |
1 Attachment(s)
Here's an example which displays a 32 color picture. It's OS friendly, but it will pause the OS to poke the hardware directly.
Don't be alarmed by the amount of files and code, most of it is just library code for support, the actual picture showing part is in the showpic.s file. |
Quote:
You can get more control over individual optimization options with the Devpac-compatible OPT directive. I changed the doc to make that clearer in the next relase. ;) |
Hi Frank
Glad you told me. The behavior I wanted was to optimize .s and unspecified to the shortest, while leaving .b .w .l as they are since I explicitly say what size they are. I'll look into the OPT directive. |
Quote:
|
First sorry for hijack this thread ;)
I´m trying to display a pattern in a 1 bitplane screen with the following code found in Amiga Computing magazine but it results in screen garbage and not in a regular pattern as it should be. I already tried to find the bug but with no luck. Can someone point what´s wrong in the code that results in the garbage displayed on the screen, please? Code:
|
You're specifying a 256 lines tall display window, but only have 200 lines in your screen buffer. Write $F4C1 to DIWSTOP to shorten the window to 200 lines ($2C + 200 = $F4).
Also if you're on AGA then 32 or 64 bit bitplane fetch mode might be enabled and you need to adjust DDFSTRT and DDFSTOP accordingly, or you can write 0 to FMODE $DFF1FC to set it to 16 bit fetch mode. |
1 Attachment(s)
As Leffmann says, or you could change the line
scr dcb.b 8000,$55 to scr dcb.b 10240,$55 and get the attached when you run it (I still got some intermittent (sprite?) garbage though). |
Thanks for the help. Already understood the problem and fixed the code
|
Quote:
I usually start my copperlists with the following code: Code:
dc.w spr0pth,$0000,spr0ptl,$0000,spr1pth,$0000,spr1ptl,$0000 |
jman: doing this:
Code:
dc.w spr0pth,$0000,spr0ptl,$0000 When you have sprite DMA enabled, what you should really do instead for any sprites you're not using, is set their address pointers to point at a dummy null sprite: Code:
lea copper(pc),a0 |
Quote:
|
Quote:
Then you would also have to zero the SPRxDAT registers, IIRC. |
Or, you have to turn off sprite DMA during the VBLANK
|
Quote:
|
*slaps forehead*
I wasn't switching my sprites off at the right time. Had that random garbage thing coming up periodically for ages :D |
Quote:
And this casts a dark shadow over all I'm doing to prepare registers before triggering a copperlist. Using DC.W to set registers is not the same as using move.w in the main code body, I suppose now. Example: wrong: Code:
dc.w bplcon1,$0 Code:
move.w #$0,bplcon1 Hey thanks again, It's great to be on EAB! |
Quote:
Quote:
These instructions are not the same. dc.w bplcon1,0 is not the same as move.w $0,bplcon1. Correct would be move.w #$0,bplcon1. :) Quote:
|
Quote:
Code:
dc.w spr0pth,$0000 Code:
move.w #$0,spr0pth Quote:
Thanks! |
All times are GMT +2. The time now is 05:03. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.