English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General > Coders. Tutorials

 
 
Thread Tools
Old 28 April 2010, 12:13   #1
Asman
68k
 
Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 828
ASM: VERTB int and 16 colored sprites.

Hello,

I need some explanation about VERTB int + 16 colored sprites. I uploaded into zone two examples ( four files: 2 source + 2 binary ). the main difference between sources is hidden in two lines inside the VERTB routine.

Code:
		bsr	fill_sprites
		bsr	sprites_on
and

Code:
		bsr	sprites_on
		bsr	fill_sprites
But only second one works, mean there are four moving and blinking sprites on screen. I can't explain why when I launch vertb-spr16-bad then there is no sprites on screen. Any ideas are welcome ?

I tested on my A1200 blizzIV 030/50 32mb fast and on WinUae ( beta 20 or something ) I choosen a1200 configuration + cycle exact option.

edit:
vertb-spr16-bad.asm ( binary:vertb-spr16-bad ) - there is no sprites on screen
vertb-spr16-ok.asm ( binary: vertb-spr16-ok )- blinking and moving sprites on screen


Regards

Last edited by Asman; 28 April 2010 at 12:18. Reason: added some info about files
Asman is offline  
Old 28 April 2010, 12:37   #2
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Asman - I only quickly scanned the souce code but didn't run the .exe's

You have a vblank interrupt to keep things sync'd with the display but you are also waiting for vb in your main loop - I don't think you need to do both - in fact, I'm fairly sure when I've messed around with doing this in the past that it caused display problems...

Edit: Also - it looks like each interrupt you write the pointers to the sprite data into the copper list. Is this needed? If your sprites are animated then most likely yes but if not and you just want to move the sprites you shouldn't need to rewrite the sprite pointers into the copper list each frame. Obviously this won't cause any harm though...

Last edited by pmc; 28 April 2010 at 12:55. Reason: read the source better, it's a vblank interrupt - not copper interrupt!
pmc is offline  
Old 28 April 2010, 13:21   #3
Asman
68k
 
Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 828
Quote:
Originally Posted by pmc View Post
Asman - I only quickly scanned the souce code but didn't run the .exe's
thank you.

Quote:
You have a vblank interrupt to keep things sync'd with the display but you are also waiting for vb in your main loop - I don't think you need to do both - in fact, I'm fairly sure when I've messed around with doing this in the past that it caused display problems...
Yes I don't need to do both ( vertb + wait for vb in main loop ). But in other hand I do nothing special in main loop ( only wait for lmb ).

Quote:
Edit: Also - it looks like each interrupt you write the pointers to the sprite data into the copper list. Is this needed? If your sprites are animated then most likely yes but if not and you just want to move the sprites you shouldn't need to rewrite the sprite pointers into the copper list each frame. Obviously this won't cause any harm though...
Yes it's necessary to write the pointers to the sprite data into the copper list( animation ). As you know I'm working on psycheual and there I found that
problem. I just simplify to minimum the problem.

cheers.
Asman is offline  
Old 28 April 2010, 13:27   #4
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Quote:
Originally Posted by Asmna
Yes it's necessary to write the pointers to the sprite data into the copper list( animation ). As you know I'm working on psycheual and there I found that
problem. I just simplify to minimum the problem.
Ah, OK - animation. Yes, you will still need to write those pointers then.

Quote:
Originally Posted by Asman
Yes I don't need to do both ( vertb + wait for vb in main loop ). But in other hand I do nothing special in main loop ( only wait for lmb ).
Have you tried running with no main loop wait vb...?

Anyways, I'll shut up now - I don't think I've been too much help to you. No surprise really - you know what you're doing better than I do!
pmc is offline  
Old 28 April 2010, 13:36   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Working case runs sprite_on early enough, before copper has processed sprite pointer update moves, bad case updates them too late -> previous frame's sprite data is shown on screen (which is always sprite_off sprite data because sprite_off always runs early enough)
Toni Wilen is offline  
Old 28 April 2010, 14:18   #6
Asman
68k
 
Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 828
@Toni Wilen - now its so obvious. many thanks.
Asman is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Some sprites Frog project.Sprites 6 22 August 2022 20:01
asm game - how implement exit to OS via PORTS int Asman Coders. General 4 28 June 2011 11:07
ASM: false int vector ($60) Asman Coders. General 2 13 September 2010 09:22
Where are all the sprites? Gambit37 project.Sprites 8 14 October 2005 14:49
INT-2 modification on Cyberstorm boards? astuermer support.Hardware 2 06 October 2005 15:23

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 00:56.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.13686 seconds with 15 queries