View Single Post
Old 07 June 2011, 14:35   #9
h0ffman
Registered User
 
Join Date: Aug 2008
Location: Salisbury
Posts: 744
Just thought I'd put a quick update here, managed to crack it in the end...

Code:
ScopeInitFreq	lea	FreqTable+(scopebytewd*8*2),a0
		moveq	#1,d0 		; current period

.nextperiod	move.l	#35469/(scopebytewd*8),d6  ; the magic number!
		moveq	#0,d5

		move.w	#scopebytewd*8-1,d7

		moveq	#0,d2
		moveq	#0,d3
		
.test		add.l	d6,d5				
		move.l	d5,d1
		divu	d0,d1
		move.w	d1,d2
		sub.w	d3,d1
		move.w	d1,(a0)+		; store byte move size
		move.w	d2,d3
		
		dbra	d7,.test

		add.w	#1,d0
		cmp.w	#scopemaxperiod,d0
		blo.b	.nextperiod

		RTS
Simply re-do the calculation incrementing the seed each time. Also managed to get this plugged into the scope drawing routine. You can see it re-sizing the wave depending on the frequency of the sample !
h0ffman is offline  
 
Page generated in 0.04378 seconds with 11 queries