English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 07 August 2012, 01:12   #1
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
Simple way to display a pic with Asmpro ?

i'm trying to simply display a simple iff pic (320x256x8 colors) on a screen, and don't know how to do ...

What is the best way to display it ? intuition ? graphics.library ?

Asmpro is able to load the pic via inciff function, must reduce some typing i think..

i'm learning asm from the beginning with some books, i know how to open/close libraries.. but displaying a picture seems a bit more difficult for me

thx

Last edited by Foul; 07 August 2012 at 11:42.
Foul is offline  
Old 07 August 2012, 08:37   #2
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
I can't tell you about the way to display an .iff picture using system calls or libraries but I can help you with how to do it the direct hardware bashing way...

Pictures in .iff format have form headers that describe the image and palette and then the picture data itself is run length encoded.

Due to this, .iff pictures can't be directly displayed - they need to be manipulated a bit first by your code.

The best alternative is to convert your .iff picture into raw format first by using a graphics converter which will strip off the form header data and do the run length decoding for you. Try Kefrens IFF Converter or Piccon.

When you have your graphics in raw format, they can be displayed directly by correctly setting the bitplane pointers and colour palette in your code.

If you get stuck at this point, come back and ask and I can give you some hints about how to do it.
pmc is offline  
Old 07 August 2012, 08:52   #3
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
no prob to convert it to raw and his palette too .. i'm using ArtPRO et Agraconv

Thx

edit: i found a good exemple on Flashtro : http://flashtro.com/page.php?id=606

Will try to understand and use it

Last edited by Foul; 07 August 2012 at 11:50.
Foul is offline  
Old 07 August 2012, 13:15   #4
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
yes !! can display my own picture

i only converted it to 320x256 32 colors

saved it raw + palete and that's it !
Foul is offline  
Old 07 August 2012, 16:58   #5
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
another Prob, when i assemble + j .. everything is working...

i'm writing objet (wo) .. and if i launch it under workbench .. nothing

ps: not chip/fast related ?

Last edited by Foul; 07 August 2012 at 17:38.
Foul is offline  
Old 07 August 2012, 17:54   #6
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Do you run your code from a native screen? If not the code needs to handle this (LoadView/2xWaitTOF), otherwise you won't see anything.
StingRay is offline  
Old 07 August 2012, 18:11   #7
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
f**k.. i'm using RTG, one complete afternoon to search in the source what i'm doing wrong.

Best way to learn

thx

ps: last thing ..when i'm using Fast in my project .. my picture don't display .. if i use Chip, it's ok .. a way to correct that ? (when i say project, it's choosing chip/fast when launching AsmPro)
Foul is offline  
Old 07 August 2012, 18:21   #8
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by Foul View Post
ps: last thing ..when i'm using Fast in my project .. my picture don't display .. if i use Chip, it's ok .. a way to correct that ? (when i say project, it's choosing chip/fast when launching AsmPro)
Use the Section statement with extension _C to force data into chipmem. Like so:

Section Gfx,Data_c

yourpic incbin "pic.raw"
StingRay is offline  
Old 07 August 2012, 18:30   #9
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
Perfect !



edit : and no .. when i put the exe in my startup-sequence.. nothing is display when i click on WB, it's perfect...

Last edited by Foul; 07 August 2012 at 18:42.
Foul is offline  
Old 08 August 2012, 00:48   #10
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
Found ! was only opened on a already open screen

Need to open my own Screen before...
Foul is offline  
Old 18 November 2018, 14:39   #11
Steve
I Identify as an Ewok
 
Steve's Avatar
 
Join Date: Jul 2001
Location: North Lincolnshire
Age: 45
Posts: 2,356
Hi Foul. Do you still have your source code for this little project? Mind if I have a look at it as I'm trying to do something similar (load the king tut image from DPaint IV in 256 colours).
Steve is offline  
Old 20 November 2018, 10:20   #12
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
Of course , here it is :

Code:
;APS00000020000000200000002000000020000000200000002000000020000000200000002000000020
;AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
;A    SelectLauncher V0.1     A
;A    Copyright Foul 2012     A
;A Hello to AmigaImpact/EAB ! A
;AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

	Section GFX,Code_c

execbase = 4
openlib = -552
closelib = -414
openscreen = -198
closescreen = -66
execute = -222

run:
	btst	#6,$bfe001
	beq.b	main
	rts

main:
	jsr	openall
	jsr	loop
	jsr	closeall
	moveq	#5,d0
	rts

openall:	
	jsr	opendos
	jsr	openint
	jsr	openscr
	jsr	opengfx
	rts

closeall:
	jsr	closegfx
	jsr	closescr
	jsr	closeint
	jsr	closedos
	rts
	
openscr:
	move.l	intbase,a6
	lea	screen_defs,a0
	jsr	openscreen(a6)
	move.l	d0,screenhd
	rts

closescr:
	move.l	intbase,a6
	move.l	screenhd,a0
	jsr	closescreen(a6)
	rts

opendos:
	move.l	execbase,a6
	lea	dosname,a1
	moveq	#0,d0
	jsr	openlib(a6)
	move.l	d0,dosbase
	rts



closedos:
	move.l	execbase,a6
	move.l	dosbase,a1
	jsr	closelib(a6)
	rts

opengfx:
	move.l 	execbase,a6
	lea 	gfxlib,a1
	jsr 	openlib(a6)
	move.l 	d0,gfxbase
	lea 	picture,a0
	lea 	bplptr,a1
	moveq 	#5-1,d1
	
setbpls:
	move.l 	a0,d0
	move.w 	d0,6(a1)
	swap 	d0
	move.w 	d0,2(a1)
	add.l 	#(320/8)*256,a0
	addq.l 	#8,a1
	dbf 	d1,setbpls
	move.l 	#cop,$dff080
	rts

loop:
	move.b	$bfec01,d0
	ror.b	#1,d0
	not.b	d0
	move.b	d0,_KeyPressed	
	cmp.b	#$50,d0
	beq.b	f1
	cmp.b	#$51,d0
	beq.b	f2
	cmp.b	#$52,d0
	beq.w	f3
	cmp.b	#$53,d0
	beq.w	f4
	cmp.b	#$54,d0
	beq.w	f5
	cmp.b	#$55,0
	beq.w	f6
	btst	#2,$dff016
	bne.b	loop	
	moveq	#0,d0	
	rts
		
f1:
	jsr	closegfx
	jsr	closescr
	jsr	closeint
	move.l	#exef1,d1
	moveq	#0,d2
	moveq	#0,d3
	move.l	dosbase,a6
	jsr	execute(a6)
	jsr	closedos
	moveq	#0,d0
	rts
		
f2:
	jsr	closegfx
	jsr	closescr
	jsr	closeint
	move.l	#exef2,d1
	moveq	#0,d2
	moveq	#0,d3
	move.l	dosbase,a6
	jsr	execute(a6)
	jsr 	closedos
	moveq	#0,d0
	rts
		
f3:
	jsr	closegfx
	jsr	closescr
	jsr	closeint
	move.l	#exef3,d1
	moveq	#0,d2
	moveq	#0,d3
	move.l	dosbase,a6
	jsr	execute(a6)
	jsr	closedos
	moveq	#0,d0
	rts

f4:
	jsr	closegfx
	jsr	closescr
	jsr	closeint
	move.l	#exef4,d1
	moveq	#0,d2
	moveq	#0,d3
	move.l	dosbase,a6
	jsr	execute(a6)
	jsr	closedos
	moveq	#5,d0
	rts

f5:
	jsr	closegfx
	jsr	closescr
	jsr	closeint
	move.l	#exef5,d1
	moveq	#0,d2
	moveq	#0,d3
	move.l	dosbase,a6
	jsr	execute(a6)
	jsr	closedos
	moveq	#5,d0
	rts

f6:
	jsr	closegfx
	jsr	closescr
	jsr	closeint
	move.l	#exef6,d1
	moveq	#0,d2
	moveq	#0,d3
	move.l	dosbase,a6
	jsr	execute(a6)
	jsr	closedos
	moveq	#5,d0
	rts

closegfx:
	move.l 	gfxbase,a1
	move.l 	38(a1),$dff080
	jsr 	closelib(a6)
	moveq 	#0,d0
	rts

openint:
	move.l	execbase,a6
	lea	intname,a1
	moveq	#0,d0
	jsr	openlib(a6)
	move.l	d0,intbase
	rts

closeint:
	move.l	execbase,a6
	move.l	intbase,a1
	jsr	closelib(a6)
	rts

cop:		dc.w	$0106,$0000,$01fc,$0000		; AGA compatible
		dc.w	$008e,$2c81,$0090,$2cc1		; Setting up display,
		dc.w	$0092,$0038,$0094,$00d0		; modulo and so on
		dc.w	$0102,$0000,$0104,$0000
		dc.w	$0106,$0000,$0108,$0000
		dc.w	$010a,$0000
		dc.w	$0120,$0000,$0122,$0000		; Clear spriteptrs
		dc.w	$0124,$0000,$0126,$0000
		dc.w	$0128,$0000,$012a,$0000
		dc.w	$012c,$0000,$012e,$0000
		dc.w	$0130,$0000,$0132,$0000
		dc.w	$0134,$0000,$0136,$0000
		dc.w	$0138,$0000,$013a,$0000
		dc.w	$013c,$0000,$013e,$0000

		; Setting up the 32 colors
	
		dc.w $0180,$0000,$0182,$0111,$0184,$0112,$0186,$0222
		dc.w $0188,$0324,$018A,$0325,$018C,$0324,$018E,$0333
		dc.w $0190,$0426,$0192,$0444,$0194,$0435,$0196,$0537
		dc.w $0198,$0537,$019A,$0555,$019C,$0648,$019E,$0666
		dc.w $01A0,$0759,$01A2,$0768,$01A4,$0869,$01A6,$0869
		dc.w $01A8,$0888,$01AA,$098A,$01AC,$0922,$01AE,$097A
		dc.w $01B0,$0A9B,$01B2,$0AAA,$01B4,$0BAB,$01B6,$0B33
		dc.w $01B8,$0BBB,$01BA,$0C88,$01BC,$0CCC,$01BE,$0DDD

		dc.w	$0100,$5200
bplptr:		dc.w	$00e0,$0000,$00e2,$0000
		dc.w	$00e4,$0000,$00e6,$0000
		dc.w	$00e8,$0000,$00ea,$0000
		dc.w	$00ec,$0000,$00ee,$0000
		dc.w	$00f0,$0000,$00f2,$0000

		dc.w	$ffff,$fffe

gfxlib:		dc.b	"graphics.library",0,0
gfxbase:	dc.l	0
picture:	incbin	"Disk2.raw"
dosname:	dc.b	"dos.library",0
dosbase:	dc.l	0
intname:	dc.b	"intuition.library",0
intbase:	dc.l	0

even
screen_defs:
x_pos:		dc.w	0
y_pos:		dc.w	0
width:		dc.w	320
heigth:		dc.w	256
depth:		dc.w	3
detail_pen:	dc.b	0
block_pen:	dc.b	1
view_modes:	dc.w	2
fonts:		dc.l	0
title:		dc.b	"SelectLauncher",0
	even
gadgets:	dc.l	0
bitmaps:	dc.l	0
screenhd:	dc.l	0

exef1:		dc.b	"HD2:XCOPY/xcopy730.exe",0
exef2:		dc.b	"HD2:XCOPY/XCopyPro8.5",0
exef3:		dc.b	"HD2:XCOPY/XCopyProTNG",0
exef4:		dc.b	"C:TinyLauncher.exe",0
exef5:		dc.b	"C:WhichAmiga",0
exef6:		dc.b	"HD2:tsgui/tsgui",0

_KeyPressed:	dc.b	0
version:	dc.b	"$VER: SelectLauncher ("
		%getdate
		dc.b	") By Foul.",0
it was my fisrt ASM prog, just for testing , so very very very not optimised

(disk2.raw picture attached...)
Attached Files
File Type: zip Disk2.zip (4.1 KB, 114 views)
Foul is offline  
Old 20 November 2018, 23:01   #13
Steve
I Identify as an Ewok
 
Steve's Avatar
 
Join Date: Jul 2001
Location: North Lincolnshire
Age: 45
Posts: 2,356
That's great thanks.

What is all the XCopy/function key stuff about? Are you loading XCopy from the program? I could just remove all that function key stuff right?

Also do you think it would be a simple matter for me to convert it into an AGA picture viewer?

Thanks again.
Steve is offline  
Old 21 November 2018, 09:18   #14
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
it's just a little prog to boot on a picture et launch differents usefull proggies... you can modify the source as you want... no prob

Aga Picture Viewer : don"t know at all... i'm not good enough in asm to know if it's feasible
Foul 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
ASMPro info bar thingy bodhi Coders. Asm / Hardware 3 29 July 2013 10:43
AsmPro copse Coders. Asm / Hardware 4 25 April 2012 11:41
AsmPro sources question(s) Asman Coders. General 13 03 September 2010 12:21
AsmPro CmdrVimes Coders. General 5 01 September 2010 12:40
Why nobody continue Asmone/AsmPro development ? kamelito Amiga scene 16 25 March 2007 15:08

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 16:37.

Top

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