English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 08 April 2009, 20:55   #1
Camionsauro
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!!
Camionsauro is offline  
AdSense AdSense  
Old 08 April 2009, 21:07   #2
heavy
Registered User
 
Join Date: Jun 2007
Location: europe
Posts: 176
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 )
heavy is offline  
Old 08 April 2009, 22:13   #3
Camionsauro
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!!
Camionsauro is offline  
Old 08 April 2009, 22:30   #4
heavy
Registered User
 
Join Date: Jun 2007
Location: europe
Posts: 176
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...
heavy is offline  
Old 08 April 2009, 22:48   #5
Camionsauro
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?
Camionsauro is offline  
Old 08 April 2009, 23:20   #6
heavy
Registered User
 
Join Date: Jun 2007
Location: europe
Posts: 176
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.
heavy is offline  
Old 08 April 2009, 23:28   #7
Camionsauro
Registered User
 
Join Date: Apr 2009
Location: Bologna, Italy
Posts: 21
Thank you sooooo much!! Very useful tip...
Camionsauro is offline  
Old 09 April 2009, 03:26   #8
AlfaRomeo
A1200 040 SAM440EP 667
AlfaRomeo's Avatar
 
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 776
@Camionsauro

Is the tutorial you follow from Amiga Format?
AlfaRomeo is offline  
Old 09 April 2009, 09:09   #9
Camionsauro
Registered User
 
Join Date: Apr 2009
Location: Bologna, Italy
Posts: 21
No, is an old italian tutorial...
Camionsauro is offline  
Old 09 April 2009, 09:25   #10
Camionsauro
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!
Camionsauro is offline  
Old 12 April 2009, 22:22   #11
AlfaRomeo
A1200 040 SAM440EP 667
AlfaRomeo's Avatar
 
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 776
@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
AlfaRomeo is offline  
Old 17 April 2009, 20:04   #12
Camionsauro
Registered User
 
Join Date: Apr 2009
Location: Bologna, Italy
Posts: 21
Quote:
Originally Posted by AlfaRomeo View Post
@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
Sure! It's a txt formatted tutorial with examples. No data, images, sprite included... In the Zone! in a minute!
Camionsauro is offline  
Old 18 April 2009, 08:52   #13
BippyM
Global Moderator

BippyM's Avatar
 
Join Date: Nov 2001
Location: Nottingham, UK
Age: 42
Posts: 8,629
It'd be nice to see this translated to english (hint, hint)
BippyM is offline  
Old 19 April 2009, 08:53   #14
AlfaRomeo
A1200 040 SAM440EP 667
AlfaRomeo's Avatar
 
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 776
@Camionsauro
Thanks buddy, youīr the best
AlfaRomeo is offline  
AdSense AdSense  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:19.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Page generated in 0.35345 seconds with 12 queries