08 April 2009, 20:55 | #1 |
Registered User
Join Date: Apr 2009
Location: Bologna, Italy
Posts: 21
|
Problem with a terrible, simply effect!
Hi to all and sorry for my english!
I'm trying to learn Amiga Assembly following a tutorial and with a little help from WinUAE (I've got the real thing, an old Amiga 500 without any workbench with it so I cannot try with it). I want to load a raw image created wit Dpaint and converted in raw+colormap. Loading it is not a problem, I can display without problem. But I want to go further: I want to load the image from the 100-th row: in my program there is a subroutine that set the copper pointer to the bitplane and instead of load the base address of the pic I load #Baseaddress+40*100... After the incbin of my raw image I fill the memory with a great number of zeroes. Why if I try to run the program I found garbage under the image? I try with any configuration of WinUAE without success. I know that programming under an emulator is a pain in the ass but I have no choice... On this link I put the code and the data http://.com/files/21899412...mageloader.zip Thank you so much for any help!! |
08 April 2009, 21:07 | #2 |
noodle
Join Date: Jun 2007
Location: europe
Posts: 247
|
it's not a winuae problem.
you don't need to add dc.b 40*100 after the pic add at the end of the copperlist : dc.w $c807,$fffe,$100,0 just before : dc.w $fffff,$ffffe your pic have 256 lines. If you start at line 100, the size is 256-100=156. so, the end of the bitplan is $2c + 156 = $c8 at line $c8, stop the bitplan with register $100 set to 0 (p.s. : set the second modulo $10a. dc.w $10a,0. uncomment the line ) |
08 April 2009, 22:13 | #3 |
Registered User
Join Date: Apr 2009
Location: Bologna, Italy
Posts: 21
|
THANK YOU!! It works!
But I've got a second question... Why the garbage appear even if I put a lot of zero after the image? Where it come from? If I point at BASEADDRESS+40*100 I think that the copper read data from here, even the zeroes added after the image... I have try event to subtract 100 line from the base address (to start the top of the image 100 lines from the top of the screen) but the same garbage shows (there is a ds.b before the incbin now) Thanks again!! |
08 April 2009, 22:30 | #4 |
noodle
Join Date: Jun 2007
Location: europe
Posts: 247
|
the "garbage" is the second and third bitplan of your picture.
if you start at line 100 and don't stop at line 256, the copper continue to read the data : after the first bitplan, he read the second one. after the second bitplan, he read the third... |
08 April 2009, 22:48 | #5 |
Registered User
Join Date: Apr 2009
Location: Bologna, Italy
Posts: 21
|
Maybe I understand! I try to explain...
Scenario: RawImageBaseAddress: ds.b 40*100*3 ; I want to display 100
; empty lines before the image incbin "myimage.raw" The copper start to read from RawImageBaseAddress. He read 40*100*3 bytes and some byte from the first (or maybe the second) bitplane of the image causing the garbage. If I want to put 100 empty lines before the image with this horrible method I must put 100 zeroes in the raw file before the first bitplane and cancel 100 byte from the end of the bitplane and so on with the others. I've got the point? |
08 April 2009, 23:20 | #6 |
noodle
Join Date: Jun 2007
Location: europe
Posts: 247
|
if you want to display 100 empty lines before the image using this method (don't use this method !), don't display the picture in normal raw format : "40*256 bitplan1- 40*256 bitplan2-40*256 bitplan3".
Use the Raw Blitter/Interlaced : line1 bitplan1 line1 bitplan2 line1 bitplan3... line2 bitplan1 ... size of a line : 40*3. |
08 April 2009, 23:28 | #7 |
Registered User
Join Date: Apr 2009
Location: Bologna, Italy
Posts: 21
|
Thank you sooooo much!! Very useful tip...
|
09 April 2009, 03:26 | #8 |
A1200 040 SAM440EP 667
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
|
@Camionsauro
Is the tutorial you follow from Amiga Format? |
09 April 2009, 09:09 | #9 |
Registered User
Join Date: Apr 2009
Location: Bologna, Italy
Posts: 21
|
No, is an old italian tutorial...
|
09 April 2009, 09:25 | #10 |
Registered User
Join Date: Apr 2009
Location: Bologna, Italy
Posts: 21
|
@AlfaRomeo:
I look around for a page with this tutorial online but I've found the pdf only, not the code... Seems to be a good tutorial! |
12 April 2009, 22:22 | #11 |
A1200 040 SAM440EP 667
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
|
@Camionsauro
If it´s a good Assembly tutorial, why do you don´t upload it to the zone so everyone could learn? After all Italian language isn´t so different from Portuguese |
17 April 2009, 20:04 | #12 |
Registered User
Join Date: Apr 2009
Location: Bologna, Italy
Posts: 21
|
Sure! It's a txt formatted tutorial with examples. No data, images, sprite included... In the Zone! in a minute!
|
18 April 2009, 08:52 | #13 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
It'd be nice to see this translated to english (hint, hint)
|
19 April 2009, 08:53 | #14 |
A1200 040 SAM440EP 667
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
|
@Camionsauro
Thanks buddy, you´r the best |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Global effect CD32 rip problem | Vollldo | support.Games | 2 | 27 January 2012 12:33 |
Copper effect problem | Steve | support.WinUAE | 3 | 25 June 2011 14:05 |
Simply bootable floppy disk | JackTheKnife | New to Emulation or Amiga scene | 6 | 21 December 2008 00:38 |
Barbarian [psygnosis] Map -simply the best- | Carcharias | HOL contributions | 9 | 12 July 2004 23:47 |
One game I simply cannot get to run. | Fred the Fop | request.Old Rare Games | 10 | 23 February 2002 09:42 |
|
|