14 February 2018, 19:16 | #2141 |
Registered User
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,365
|
You probably have to call IconControlA() with ICONCTRLA_GetImage2 just to generate the delayed image2 and the mask2, except for WB 3.0/3.1 where Blt(Mask)BitMapRastPort() is patched by icon.library to generate the true image just in time.
(On WB 3.5+ this is done automatically by a call to DrawIconState(). Or you could use my command NoDelayedImage2, but that would be a decision of the user, I think.) @Akira All clear signal: Don't worry about the delayed image2 or mask2. The delay is only activated for the Workbench task, not for other programs. My assembler code for converting an image structure in A0 into a 40 byte bitmap in A1, but this code may only work for color icons, because they always use real planes. For old-style images you also have to take PlanePick and PlaneOnOff into acount. Code:
preparebitmap ADDQ.W #4,A0 ; image width etc MOVEM.W (A0)+,D0-D1 ; width, height ADDQ.L #8,D0 ADDQ.L #7,D0 LSR.L #4,D0 ADD.L D0,D0 ; plane bytes/row MOVE.W D0,(A1)+ ; bytes/row MOVE.W D1,(A1)+ ; row count MULU.W D0,D1 ; total plane size MOVE.W (A0)+,D0 ; depth MOVEA.L (A0),A0 ; planar image data CMPI.W #8,D0 BLS.S .depthok MOVEQ #8,D0 ; limit to 8 planes .depthok MOVE.W D0,(A1)+ ; flags, depth CLR.W (A1) ; clear pad word !! ADDA.W #30,A1 CLR.L (A1) ; plane 7 CLR.L -(A1) ; plane 6 CLR.L -(A1) ; plane 5 CLR.L -(A1) ; plane 4 CLR.L -(A1) ; plane 3 CLR.L -(A1) ; plane 2 CLR.L -(A1) ; plane 1 CLR.L -(A1) ; plane 0 BRA.S .countdowndepth .nextpointer MOVE.L A0,(A1)+ ; image data offsets ADDA.L D1,A0 ; add planesize .countdowndepth DBRA D0,.nextpointer RTS Last edited by PeterK; 15 February 2018 at 00:21. |
21 February 2018, 00:58 | #2142 |
Banned
Join Date: Nov 2007
Location: Trondheim, Norway
Posts: 1,893
|
Looks to me that the new RAM: icon feature only works when RAM: is labeled "Ram Disk", I tend to name my RAM: something more Norwegian, so I am back to soft link
|
21 February 2018, 01:23 | #2143 | |
Registered User
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,365
|
Yes, I should have mentioned this in my readme:
Quote:
|
|
21 February 2018, 02:31 | #2144 |
Banned
Join Date: Nov 2007
Location: Trondheim, Norway
Posts: 1,893
|
I use a variety of names, in Norwegian typically "Minne", but even with English I tend to call it "Memory" rather than the long (and somewhat cumbersome) "Ram Disk". To be honest, I took it for granted that label was irrelevant, and the only thing mattering was device name RAM, and was a little baffled when I found out (SnoopDOS) that the label made a difference when trying to save position.
|
21 February 2018, 02:37 | #2145 |
Registered User
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,365
|
The problem is that it's not so easy to get the device name of a volume name. Or can you tell me how? Functions like NameFromLock() always return the volume name. "Memory:" could also be the label of a floppy disk and your floppy should not get a Ram Disk icon.
I really don't want to do something like this: http://www.amiga.org/forums/showthread.php?p=835753 Last edited by PeterK; 21 February 2018 at 03:30. |
21 February 2018, 03:51 | #2146 |
Banned
Join Date: Nov 2007
Location: Trondheim, Norway
Posts: 1,893
|
Yeah... well, I only have superficial knowledge about how things are meant to work, but I don't quite understand why labels are used at all in this context. Def_icons, from what I understand, should only relate to device drives, and not volume labels. RAM: can have tons of labels, but it will always be RAM:. Even if I relabel the RAM: drive during startup-sequence, ENV:Sys/def_RAM.info is still used, so _something_ knows that it still is RAM:
Btw, at some point I asked ThoR if he could implement handling of RAM:'s Disk.info in ram-handler (where I think it belongs), but he declined. |
21 February 2018, 17:25 | #2147 |
Registered User
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,294
|
How does the "which" command do this?
> which RAM: should return the volume name ... Many this could be used in SS to fill a ENV variable, that gets checked by the icon.library? |
21 February 2018, 18:30 | #2148 |
Registered User
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,365
|
Good idea, thank you Gorf!
I could make a Lock() on RAM: and then use NameFromLock() to get the volume name in the Init() part of icon.library. After storing that volume name I could compare it later with the path names for Disk.info instead of comparing with "ram " or "RamD". Nevertheless, I'm not sure anymore if I should support random volume names for RAM: like "Memory", because it makes the name comparisn even more complex since it would need exact compares to distinguish between "Memory" and "Memories" for example. I can not just test for "Memo". And I have to do these checks 3 5 times in my code. Too much extra code just for kolla ... Last edited by PeterK; 22 February 2018 at 20:59. |
21 February 2018, 21:39 | #2149 |
Registered User
Join Date: Dec 2007
Location: Szczecin/Poland
Posts: 424
|
I have ReLabel RAM: "RAM Disk" command in my Startup-Sequence - will this be compatible?
|
21 February 2018, 22:38 | #2150 |
Registered User
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,365
|
"Ram Disk" is already the default name for RAM:.
Do you relabel it to "RAM Disk" because you prefer RAM in capitals? However, all upper and lower case combinations are supported for "ram "......, only the first 4 characters are checked. |
22 February 2018, 14:21 | #2151 | |
Registered User
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,294
|
Quote:
But by just "allowing" a certain naming schema, you probably make users life hard in the future, once they have forgotten about this restriction and the OS allowing them to change the name to whatever. so maybe we can somehow reduce the number of checks in your code somehow? why do you need to check 3 times in the first place? Could in some cases the device name (RAM: ) be enough? Or could the OS somehow "warn" the library? Last edited by Gorf; 22 February 2018 at 17:39. |
|
22 February 2018, 14:26 | #2152 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,303
|
I'm using a virus tool called Safe that has an option to rename "Ram Disk:" to "Ram:". IMHO the only useful rename.
|
22 February 2018, 17:28 | #2153 |
Banned
Join Date: Nov 2007
Location: Trondheim, Norway
Posts: 1,893
|
I think symlink the cleanest way of doing this anyways, I don't quite grasp what process icon.library 46.4 is going through for saving ENVARC:Sys/def_RAM.info, but it seems complicated.
|
22 February 2018, 17:30 | #2154 |
Banned
Join Date: Nov 2007
Location: Trondheim, Norway
Posts: 1,893
|
|
22 February 2018, 17:56 | #2155 | ||||
Registered User
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,365
|
Quote:
Nothing will go wrong for those users who prefer to rename the volume to something unsupported. They just fall back to the OS standard. Quote:
Quote:
Quote:
Last edited by PeterK; 22 February 2018 at 21:01. |
||||
22 February 2018, 18:04 | #2156 | |
Registered User
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,365
|
Quote:
The symlink also has some disadvantages. It's not supported on all filesystems like amber-ram-handler, which I prefer to use. And it creates an ugly "Disk.info" directory entry even if RAM: has no icon yet. Some people don't like that. And the symlink won't update "ENV:Sys/def_RAM.info". Last edited by PeterK; 22 February 2018 at 18:25. |
|
22 February 2018, 19:07 | #2157 | ||
Registered User
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,294
|
Quote:
Quote:
|
||
22 February 2018, 19:15 | #2158 | |
Registered User
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,365
|
Quote:
Update: Just noticed that I even have 5 checks for RAM: in my library. I'm working on it now ... the problem is that these checks are all a bit different, no easy way to squeeze a subroutine out of their code. @Akira Any progress with your Blitz Basic project? How is it going? Last edited by PeterK; 22 February 2018 at 21:13. |
|
25 February 2018, 09:44 | #2159 |
Inviyya Dude!
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
|
First off, thanks for your work, Peter..
Now on to my total OS noob questions, which hopefully someone here can answer... 1) is the icon.library included in betterWB the one from PeterK? 2) how would I know if I run the one from PeterK? I tried to run it using the code supplied in Aminet: Code:
Version >NIL: icon.library 46 If WARN If EXISTS LIBS:workbench.library LoadResident >NIL: LIBS:workbench.library EndIf LoadResident >NIL: LIBS:icon.library REBOOT EndIf |
25 February 2018, 10:49 | #2160 |
Unregistered User
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 43
Posts: 4,190
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ClassicWB Full and icon.library 46.4 | Retroplay | project.ClassicWB | 8 | 05 August 2018 13:57 |
WB library conflict/versions | Amiga1992 | support.Apps | 3 | 22 July 2010 18:47 |
PNG Icon to Color Icon Converter? | Leandro Jardim | request.Apps | 1 | 24 May 2010 04:39 |
What's the latest version of icon.library for OS3.9? | NovaCoder | support.Apps | 3 | 30 June 2009 15:43 |
Requesting icon.library v44+... | nikvest | request.Other | 2 | 16 September 2007 01:58 |
|
|