07 August 2012, 01:12 | #1 |
Registered User
|
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. |
07 August 2012, 08:37 | #2 |
gone
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. |
07 August 2012, 08:52 | #3 |
Registered User
|
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. |
07 August 2012, 13:15 | #4 |
Registered User
|
yes !! can display my own picture
i only converted it to 320x256 32 colors saved it raw + palete and that's it ! |
07 August 2012, 16:58 | #5 |
Registered User
|
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. |
07 August 2012, 17:54 | #6 |
move.l #$c0ff33,throat
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.
|
07 August 2012, 18:11 | #7 |
Registered User
|
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) |
07 August 2012, 18:21 | #8 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
Section Gfx,Data_c yourpic incbin "pic.raw" |
|
07 August 2012, 18:30 | #9 |
Registered User
|
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. |
08 August 2012, 00:48 | #10 |
Registered User
|
Found ! was only opened on a already open screen
Need to open my own Screen before... |
18 November 2018, 14:39 | #11 |
I Identify as an Ewok
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).
|
20 November 2018, 10:20 | #12 |
Registered User
|
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 (disk2.raw picture attached...) |
20 November 2018, 23:01 | #13 |
I Identify as an Ewok
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. |
21 November 2018, 09:18 | #14 |
Registered User
|
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 |
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 |
|
|