English Amiga Board


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

 
 
Thread Tools
Old 26 October 2011, 20:08   #21
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Whether you move a value to a register by using a dc.w as a copperlist move instruction or use a 68000 move.w instruction, you'll still be moving a value to the register - they both do the same thing.

The main point is, however you move the value $0000 to the sprite registers, that value will be treated as an address as those sprite registers are address pointers and therefore expect address values.

You can zero a non address register by moving zero to it but moving zero to an address register isn't zero-ing it, it's giving it address zero.

That was the point of my first post: when you can't zero an address register, like the sprite registers, instead give them a valid address but pointing to null data.

Oh, and - hey there back again Stinger.
pmc is offline  
Old 26 October 2011, 21:02   #22
jman
Registered User
 
Join Date: Nov 2010
Location: .
Posts: 351
Quote:
Originally Posted by pmc View Post
That was the point of my first post: when you can't zero an address register, like the sprite registers, instead give them a valid address but pointing to null data.
Ok, so it all boils down to the fact that address registers store memory addresses and data register, data. It doesn't make sense trying to assign a value to an address register.
jman is offline  
Old 31 October 2011, 20:27   #23
korruptor
TDI
 
korruptor's Avatar
 
Join Date: Feb 2007
Location: Blitter Town
Posts: 124
Quote:
Originally Posted by korruptor View Post
*slaps forehead*

I wasn't switching my sprites off at the right time. Had that random garbage thing coming up periodically for ages
Oh. It wasn't that. I wasn't pointing the extra AGA sprites anywhere. Doh.
korruptor is offline  
Old 01 November 2011, 18:36   #24
TheDarkCoder
Registered User
 
Join Date: Dec 2007
Location: Dark Kingdom
Posts: 213
Quote:
Originally Posted by korruptor View Post
Oh. It wasn't that. I wasn't pointing the extra AGA sprites anywhere. Doh.
extra aga sprites?

AFAIK AGA has the same 8 sprites DMA channel.
They can access memory 4x faster, so they can be 64 pixel wide, but you stll have to load 8 32 bit sprite pointers...

what do you mean?
TheDarkCoder is offline  
Old 01 November 2011, 20:38   #25
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
I'd assume he means the extra sprites that he's not using directly to display sprite data when he has sprite DMA enabled...?

That's just my guess though
pmc is offline  
Old 01 November 2011, 23:45   #26
korruptor
TDI
 
korruptor's Avatar
 
Join Date: Feb 2007
Location: Blitter Town
Posts: 124
Haha, no, it's worse than that, I thought there were only 8 on the 1200, so I was only clearing 4

I've that bug for about 18months, but it didn't show up on WinUAE all the time.

Edit: I'll learn to type.
korruptor is offline  
Old 09 March 2012, 22:46   #27
bobster
Registered User
 
Join Date: Feb 2012
Location: Sweden
Posts: 14
Quote:
Originally Posted by Leffmann View Post
Here's an example which displays a 32 color picture. It's OS friendly, but it will pause the OS to poke the hardware directly.

Don't be alarmed by the amount of files and code, most of it is just library code for support, the actual picture showing part is in the showpic.s file.
I tried to assembly this code in asm-one(winuae) but it complained about the cmove command. I also get som errors for line: move.w #bpl_5bpl | bpl_color, bplcon0(a6),"comma expected". Do i have the settings wrong for asmone or is the code targeted for another assembler?
I don't have to mention im a beginner do i
bobster is offline  
Old 09 March 2012, 23:52   #28
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Quote:
Originally Posted by bobster View Post
I tried to assembly this code in asm-one(winuae) but it complained about the cmove command. I also get som errors for line: move.w #bpl_5bpl | bpl_color, bplcon0(a6),"comma expected". Do i have the settings wrong for asmone or is the code targeted for another assembler?
I don't have to mention im a beginner do i

I believe cmove is used on later CPU's (eg. 68020) and are you sure there are no spaces between the pointers - that is the usual cause for "comma expected" errors. This is probably bad:

move.w #bpl_5bpl | bpl_color, bplcon0(a6)

but this (note no spaces between pointers) should work:

move.w #bpl_5bpl|bpl_color,bplcon0(a6)


Regards,
Lonewolf10
Lonewolf10 is offline  
Old 10 March 2012, 15:29   #29
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Yeah you have to remove spaces between operands in expressions for ASM-One and other Amiga assemblers, they are very strict about the syntax unfortunately.

"cmove" is just a macro for the Copper move-instruction, it sits in the macros.i file and is typed "CMove", so you have to disable case sensitivity in ASM-One.

I only use vasm myself, but I'll see if I can convert the code for you to use in ASM-One later.

EDIT: here's a version that works in ASM-One
Attached Files
File Type: lha showpic.lha (31.6 KB, 222 views)

Last edited by Leffmann; 10 March 2012 at 18:22.
Leffmann is offline  
Old 11 March 2012, 21:33   #30
bobster
Registered User
 
Join Date: Feb 2012
Location: Sweden
Posts: 14
Thanks for the new version, unfortunately i still got the same error, my asmone doesnt seeme to like the | very much, im using version 1.2 and assemble with the ucase=lcase option on. Maybe i should take a look att vasm instead. To bypass the "comma expected" problem i for convenience switched the line to: move.w #$5200,bplcon0(a6).
Now i got another error "illegal operator cpusha bc", is this also related to the cpu version?
bobster is offline  
Old 11 March 2012, 23:22   #31
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
I used ASM-One v1.48: http://www.theflamearrows.info/documents/ftp.html
Leffmann is offline  
Old 16 March 2012, 21:42   #32
bobster
Registered User
 
Join Date: Feb 2012
Location: Sweden
Posts: 14
Finally i got it working! I installed 1.48 and that did the trick, one weird thing though, i had to start asm from the cli, otherwise it hang when i executed the code. Now i can go on with what i first intended to do, a sinus effect by poking the bplcon1 with sinus values. Any advices are of course welcome.
bobster is offline  
Old 17 March 2012, 03:25   #33
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Quote:
Originally Posted by bobster View Post
Finally i got it working! I installed 1.48 and that did the trick, one weird thing though, i had to start asm from the cli, otherwise it hang when i executed the code. Now i can go on with what i first intended to do, a sinus effect by poking the bplcon1 with sinus values. Any advices are of course welcome.
Glad you got it working. The problem you're describing is an issue with ASM-One, you can work around it by leaving the line "jsr WBStartup" commented out while you're working and running your program from within ASM-One.
Leffmann is offline  
Old 17 March 2012, 19:49   #34
bobster
Registered User
 
Join Date: Feb 2012
Location: Sweden
Posts: 14
Another question, when assembling a program containing multipel source files, i pretty fast run out of workspace memory. Is it the right thing to do when loading all sources into workspace and assemble them one by one, or is there a better way?
bobster is offline  
Old 18 March 2012, 14:31   #35
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
ASM-One asks you how much workspace you need when you start it (unless you've edited the startup command in environment preferences). You can either add more with the =M command or just restart ASM-One, but you shouldn't need more than 50K for this little program. You also only have to load and assemble showpic.s, the main program, because it will include all other files it needs.
Leffmann is offline  
Old 19 March 2012, 20:40   #36
bobster
Registered User
 
Join Date: Feb 2012
Location: Sweden
Posts: 14
Quote:
Originally Posted by Leffmann View Post
ASM-One asks you how much workspace you need when you start it (unless you've edited the startup command in environment preferences). You can either add more with the =M command or just restart ASM-One, but you shouldn't need more than 50K for this little program. You also only have to load and assemble showpic.s, the main program, because it will include all other files it needs.
I was actually trying to build the Quartex remake from another thread, it has the setup code in source file instead of includes,i don't know whats the advantages or disadvantages of the different approaches.But somehow i guess they got to be linked togheter when building the exe.
bobster is offline  
Old 21 March 2012, 00:17   #37
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Putting all code in a single file (with or without include files, since they are effectively copy-pasted in place) eventually results in problems with duplicate symbols, lack of structure, poor code reuse, huge compile times, and you can only have one programmer since two or more can't work on the same file at the same time.

Ultimately it's not a viable way of writing software, but of course it works perfectly fine for small programs like these. I've just taken to always structuring things like this because I prefer it, even if I only write few and small programs.

I'll fix my Quartex cracktro remake to work with ASM-One and upload again.
Leffmann is offline  
Old 09 August 2012, 18:25   #38
Foul
Registered User
 
Foul's Avatar
 
Join Date: Jun 2009
Location: Perigueux/France
Age: 49
Posts: 1,516
Send a message via ICQ to Foul Send a message via MSN to Foul
Some Good tuto here : http://flashtro.com/list.php?c=crack8
Foul is offline  
Old 29 August 2012, 23:53   #39
AlfaRomeo
A1200 040 SAM440EP 667
 
AlfaRomeo's Avatar
 
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
Hi, so I can learn some bit more I´m trying to reutilize the code in the start of this thread (display 1 bitplane pattern in ECS) but converting it to AGA.
I added the AGA registers in fault but the screen keeps showing only a few raster lines as it should be and most part of the screen shows garbage.
I already tried to restart the sprite registers but with no luck.
What I´m making wrong?


Code:
                Section Screen,code_c
	
_LVOOpenLib	EQU	-552
_LVOCloseLib	EQU	-414

DiwStart	             EQU	$8E
DiwStop		EQU	$90
DDFStart	             EQU	$92
DDFStop		EQU	$94
BplCon0		EQU	$100
BplCon1		EQU	$102
BplCon2		EQU	$104
BplCon3		EQU	$106
BplCon4		EQU	$10C
Col0		EQU	$180
Col1		EQU	$182
BPL1PTH		EQU	$E0
BPL1PTL		EQU	$E2
FMode		EQU	$1FC
CopJmp1		EQU	$088

		move.l	#scr,d0	;Load address of our screen in d0
		move.w	d0,pl1l	;Load low scr addr in Copper list
		swap	d0	;Swap address in d0
		move.w	d0,pl1h	;Load high scr addr in Copper list
		
		move.l 	4.w,a6		;ExecBase
		move.l	#0,d0
		lea	GfxName,a1
		jsr	_LVOOpenLib(a6)	;Open GFX library
		move.l	d0,a1
		move.l	38(a1),WB	;Store WB Copper addr
		
		move.l	4.w,a6
		jsr	_LVOCloseLib(a6)	;Close GFX library
		
		move.l	#CopList,$DFF080	;Load Copper list in Copper
		
		
Loop:		btst	#6,$BFE001	;Test left mouse button
		bne	Loop		;If not pressed keep in loop
		
		move.l	WB,$DFF080	;Restore WB Copper
		rts
		
CopList:

		dc.w	DiwStart,$2c81	;Top left corner of the scr
		dc.w	DiwStop,$2cc1	;Bottom right corner, 256 lines
		dc.w	DDFStart,$38	;Data fetch start
		dc.w	DDFStop,$d0	;Data fetch stop
		dc.w	BplCon0,$1200	;Set 1 bitplane lo-res scr
		dc.w	BplCon1,$0	;No horizontal offset
		dc.w	BplCon2,$0
		dc.w	BplCon3,$0
		dc.w	BplCon4,$11	;XORed with 8 bitplane color
		dc.w	Col0,$0		;Black background color
		dc.w	Col1,$fff	             ;White foreground color
		dc.w	FMode,$0
;		dc.w	CopJmp1,$0



		dc.w	BPL1PTH		;Bitplane low high word	
pl1h
		dc.w	0
		dc.w	BPL1PTL		;Bitplane low word
pl1l
		dc.w	0
		dc.w	$FFFF,$FFFE	;End of copper list
		
WB		dc.l	0

scr		dcb.b	10240,$55	 ;10240 bytes
						
GfxName		dc.b	"graphics.library",0
AlfaRomeo is offline  
Old 30 August 2012, 04:19   #40
Codetapper
2 contact me: email only!
 
Codetapper's Avatar
 
Join Date: May 2001
Location: Auckland / New Zealand
Posts: 3,182
For one thing, you haven't set the modulo registers. Maybe they are defaulting to quite a high value, meaning it's skipping your 'scr' data and displaying whatever random junk is in memory past the GfxName label.

Add bpl1mod,0 and bpl2mod,0 to your copperlist and see if that helps.
Codetapper 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
Screen not displaying on 2.6.1 Amiga1992 support.WinUAE 4 25 August 2013 17:50
CDTV without picture displaying ?? haynor666 support.Hardware 34 18 February 2013 05:26
Displaying sprites Hewitson Coders. General 18 27 April 2011 16:35
displaying correct MagicWB-colors Bamiga2002 support.Apps 3 26 July 2010 11:06
New WinUAE's and screen displaying problem Sloppy Elf support.WinUAE 3 26 January 2007 14:18

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 07:10.

Top

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