20 April 2007, 13:30 | #41 |
Zone Friend
Join Date: Oct 2003
Location: France
Age: 51
Posts: 161
|
lsl and add are quicker than mulu. But you can also precalc your sintab if you have to mul *40 each time...
|
20 April 2007, 14:35 | #42 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Thanks for the confirmation. Yeah - I thought about precalculating the sine table values before but I didn't cos it seemed like cheating!
Instead I sat down with my calculator this morning and worked out a way to multiply by 40 using shifts and adds. Definitely going to keep precalcs in mind though - might edge me closer to getting a one pixel sine copy working... |
20 April 2007, 18:24 | #43 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Erm... Just checked out the two pixel version at home and it's not right - there's a glitch in the top right hand corner of the sine scroller. I didn't notice this on my laptop at work but I do notice it on my PC at home.
I even tried the two pixel version with a pre calc'd sine table but the glitch is still there! Aaaarrrghhh! I just can't seem to make the routine fast enough so that it looks right with anything other than a four pixel sine copy. Think it's gonna have to be double buffering or bust! |
20 April 2007, 20:32 | #44 | |
move.w #$4489,$dff07e
Join Date: Sep 2005
Location: Norfolk, UK
Age: 42
Posts: 2,351
|
Quote:
|
|
21 April 2007, 00:33 | #45 |
Zone Friend
Join Date: Oct 2003
Location: France
Age: 51
Posts: 161
|
yep, it's that I had said : all 1 or 2 pixels sinuscroll works with double or triple buffering
|
21 April 2007, 00:55 | #46 | |
Registered User
Join Date: Aug 2004
Location: Poland
Posts: 142
|
Quote:
Code:
@@ -330,6 +330,7 @@ and.w #%0000000000010000,intreqr(a5) ;did the copper cause the interrupt? beq interrupt_done ;nope, jump back out of my interrupt code move.w #%0000000000010000,intreq(a5) ;yep, clear the copper interrupt bit and continue with the interrupt code + move.w #$00f0,cust_regs+color00 clear_dis_scrn: btst #6,dmaconr(a5) ;blitter ready? @@ -547,6 +548,8 @@ rts interrupt_done: + move.w #$0f00,cust_regs+color00 + movem.l (sp)+,d0-d7/a0-a6 ;end of interrupt, restore registers move.l cop_int_address,-(sp) ;stick the return address on the stack rts ;and return to it @@ -1087,6 +1090,7 @@ dc.w $9d01,$ff00,color01,$0fa0 dc.w $9e01,$ff00,color01,$0fa0 dc.w $9f01,$ff00,color01,$0fa0 + dc.w intreq,$8010 ;triggers the copper interrupt dc.w $a001,$ff00,color01,$0f90 dc.w $a101,$ff00,color01,$0f90 dc.w $a201,$ff00,color01,$0f90 @@ -1129,7 +1133,8 @@ dc.w $c701,$ff00,color01,$0f00 dc.w $c801,$ff00,color00,$000f ;start of the second copper bar dc.w $ca01,$ff00,color00,$0000 ;end of the second copper bar - dc.w $ffdf,$fffe,intreq,$8010 ;triggers the copper interrupt + dc.w $ffdf,$fffe + dc.w $3001,$ff00,color00,$0fff ;end of the second copper bar dc.w $ffff,$fffe credits: dc.b "$VER: Sinescroll V2.12 with UltraEdit32 V13.00, assembled with Devpac V3.02 under WinUAE 1.4.1.0 April 2007)" |
|
21 April 2007, 01:43 | #47 | |
Registered User
Join Date: Aug 2004
Location: Poland
Posts: 142
|
Quote:
|
|
21 April 2007, 01:46 | #48 |
move.w #$4489,$dff07e
Join Date: Sep 2005
Location: Norfolk, UK
Age: 42
Posts: 2,351
|
I guess if you only needed a few more rasters you could get the Copper to trigger a Level3 INT before the VBlank... (As long as the display isn't still being drawn by the CPU).
|
21 April 2007, 16:43 | #49 |
TDI
Join Date: Feb 2007
Location: Blitter Town
Posts: 124
|
pmc: I've dropped my source into the zone. It's not double buffered and the sine is pre-calced but it might be worth a read. It took me a while to get it working so there're probably bugs.
|
21 April 2007, 18:14 | #50 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
@mushashi5150 & bobbybearing - As you can read below, it actually turns out that the routine not being double buffered isn't the problem. However, your advice has always been good advice so who am I to go against it? Double buffered it now is!
@AGN - Hmmm... good idea and something I hadn't thought of - if I need to, I can shift the start of the interrupt somewhere else other then the VBL... Regarding the sine table itself being a precalc - gimme a break, most of my hair's fallen out just getting this far!! @korruptor - thanks for posting your source, nice one. Bugs? Who's routines don't have bugs? As you can read below, certainly not mine! You got it working, that's the main thing... I lifted the double buffering code out of the sinescroller source on flashtro.com and implemented it into my routine. Double buffering isn't the problem. With or without the double buffering, there's still the glitch in the top right hand corner of the sinescroll display. Something else is wrong. Also, there's now a mismatch between the master and temporary sine pointers. If I disable sine, as per AGN's suggestion of sticking a 255 in at the second position in the sine table, weird things happen. I get a flat scroller for half of the screen and then it breaks into a random sine pattern for the other half. As far as I can tell, these problems have only occurred since the routine was converted to a two pixel sine copy. |
21 April 2007, 19:14 | #51 | |
move.w #$4489,$dff07e
Join Date: Sep 2005
Location: Norfolk, UK
Age: 42
Posts: 2,351
|
Quote:
|
|
21 April 2007, 19:59 | #52 | |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
Scratch the above, that was happening on the four pixel version too. I went right back to my original working four pixel routine. Then I added or changed everything that I've added or changed between that routine and the two pixel version, assembling and running after each change, including new things like adding double buffering. Everything works fine up to this point. The top right graphics glitch problem *only* happens when I then increase from four sine blits to eight for the two pixel copy in the sine blit loop... Very odd... |
|
21 April 2007, 21:24 | #53 | |||
Registered User
Join Date: Aug 2004
Location: Poland
Posts: 142
|
Quote:
Quote:
Quote:
Put code in zone. |
|||
22 April 2007, 00:51 | #54 |
Registered User
Join Date: Aug 2004
Location: Poland
Posts: 142
|
|
22 April 2007, 11:11 | #55 |
Zone Friend
Join Date: Oct 2003
Location: France
Age: 51
Posts: 161
|
without double buf, with winuae, perhaps check Immediate Blitter or cycle exact cpu-blitter
|
22 April 2007, 11:48 | #56 | |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
|
|
22 April 2007, 14:53 | #57 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Sine code has been changed now. Only one sine pointer is used. Instead, an offset value is added each iteration. Still not sure if this is *the* proper way to do it but it seems to work. Still got the top right graphics glitch. Anyways, new version posted to the zone...
|
22 April 2007, 15:02 | #58 |
Zone Friend
Join Date: Oct 2003
Location: France
Age: 51
Posts: 161
|
have no time atm, but great work!
|
22 April 2007, 15:24 | #59 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
@bobbybearing - no worries, man - and thanks.
@korruptor - had some time so checked out your source just now. Looks like it needs to be double buffered for running on 68000 - I get some flickering running it as if it's on an ECS A500+ under WinUAE - but with that amendment done it'll look great. Top man. Only other prob I had was that it didn't quit properly for me after I pressed the left mouse button... |
22 April 2007, 18:02 | #60 | ||
Registered User
Join Date: Aug 2004
Location: Poland
Posts: 142
|
Quote:
Code:
@@ -235,12 +235,12 @@ ** Equates - Library offsets ** execbase equ 4 -openlibrary: equ -552 -closelibrary: equ -414 -forbid: equ -132 -permit: equ -138 -sys_cop_offset: equ 38 -cop_int_vect: equ $6c +openlibrary equ -552 +closelibrary equ -414 +forbid equ -132 +permit equ -138 +sys_cop_offset equ 38 +cop_int_vect equ $6c ** Code ** @@ -431,7 +431,7 @@ sin_copy_setup: lea scroll_screen,a0 ;first word of the scrollplane as the source suba.w #2600,a6 ;first word of the displayed screen as the destination - moveq.b #19,d2 ;display is 320 bits wide, which is 40 bytes which, is 20 words. 20 words need to be blitted to complete one display. Set counter to number required minus one cos this is a dbra loop + moveq #19,d2 ;display is 320 bits wide, which is 40 bytes which, is 20 words. 20 words need to be blitted to complete one display. Set counter to number required minus one cos this is a dbra loop sin_blits: bsr get_offset ;first we need to use a sin value to offset where we start copying into the displayed screen Quote:
Code:
@@ -1035,6 +1035,7 @@ dc.w ddfstrt,$0038,ddfstop,$00d0 dc.w bpl1mod,$0000,bpl2mod,$0000 dc.w color00,$0000,color01,$0fff + dc.w $0101,$ff00 dc.w bpl1pth plane1_h: dc.w 0 ;where the screen bitmap address gets put dc.w bpl1ptl |
||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help with a sine effect | bobster | Coders. Tutorials | 16 | 17 October 2012 12:11 |
Sine scroller - dycp | blazeb | Coders. Asm / Hardware | 6 | 02 May 2012 10:08 |
Flickering sine scroller | pmc | Coders. Tutorials | 4 | 24 June 2009 09:19 |
Help with sine regression | Ed Cruse | Coders. General | 14 | 30 June 2008 01:15 |
|
|