01 March 2007, 09:33 | #1 |
CON: artist
Join Date: Feb 2006
Location: Poland
Age: 43
Posts: 1,250
|
A little proggie...
I know a couple of skilled or aspiring ASM coder dwell here so I've got a favor to aks . I want to include a simple gauge proggie in Hombre but all the ones I've found so far lack in features or simply refuse to work.
This little utility would:
for example: gauge -drive 0 -chip -date -time -w=0,0 -f=%cb,%d,%t,%s would open the window in the top-left corner, display the current track postion in DF0:, available chip memory, date and time like so 910123 bytes | 04-12-80 | 12:14 | 41 So if you wanna make one amiga user very happy... Please, pretty please |
18 April 2011, 18:30 | #2 |
CON: artist
Join Date: Feb 2006
Location: Poland
Age: 43
Posts: 1,250
|
*Bump*
The next version of Hombre is coming along nicely and something like described above would be great... anyone? |
19 April 2011, 11:52 | #3 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Displaying the track position could be a problem because the hardware itself doesn't tell the exact position, and IIRC access to the trackdisk.device is exclusive, but I could be wrong on that. At least I can't think of any neat method to get the track positions of the drives.
What was wrong with the existing utilities? Do you need some fancy displays or graphics for this? Just putting some text in a thin titlebar-sized window is not a problem. |
19 April 2011, 12:22 | #4 | |
CON: artist
Join Date: Feb 2006
Location: Poland
Age: 43
Posts: 1,250
|
Quote:
http://aminet.net/package/misc/fish/fish-0543 source in assembler included so have a look how he goes about it... (pretty sure not in a very system friendly way) I don't need anything fancy just what I've described in the first post. The problem right now is that you'd have to use two separate programs for it and none of the ones I found were small enough or didn't let you change the format of the display. As for now I use zshell's built in MemClock feature (displays free mem and time but disappears after you open a new window together with TD which only displays head positions for each drive). Any help would be greatly appreciated http://aminet.net/package/misc/fish/fish-0399 Here's another one by Olaf Barthel (c source included) |
|
19 April 2011, 20:50 | #5 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Thanks I'll take a look at how they read track positions.
|
20 April 2011, 16:09 | #6 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Here's a first version, only displaying time, date and amount of free memory for now.
I decided to move the text out of the title bar because changing the title causes flickering on 1.3, and drawing text in the title bar using other methods is error prone. And also because on 1.3 the gadgets use up a bit of space and you quickly fill the screen width when you start adding status items. Last edited by Leffmann; 12 May 2011 at 23:35. |
21 April 2011, 15:23 | #7 | |
CON: artist
Join Date: Feb 2006
Location: Poland
Age: 43
Posts: 1,250
|
Quote:
Works great! Last edited by TCD; 21 April 2011 at 17:36. Reason: Back to back posts merged. Use the edit function. |
|
21 April 2011, 15:57 | #8 |
Ya' like it Retr0?
Join Date: Jul 2005
Location: United Kingdom
Age: 49
Posts: 9,768
|
OOooOOOo
interesting =) |
21 April 2011, 20:42 | #9 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Just a small update, you can now format the status text freely. Will look into the diskdrive status next.
It uses the standard C formatting flags for time, which you can f.ex find here: http://www.cppreference.com/wiki/chrono/c/strftime and also %C for free chip memory, %F for fast and %T for total. gauge "Chip %C Fast %F | %X | %A %d-%b-%Y" gives full memory, time and date status f.ex. Last edited by Leffmann; 12 May 2011 at 23:35. |
21 April 2011, 22:20 | #10 |
CON: artist
Join Date: Feb 2006
Location: Poland
Age: 43
Posts: 1,250
|
@Leffmann
Looking good Thanks for taking the time to make it happen. It will be a great addition to the next version of Hombre. Here it is running with the following options: Code:
run gauge "Memory: %T bytes free | %H:%M | %d-%m-%Y" Some further suggestions: - maybe it could detach itself from the current CLI process (no need to run it) - an option to open it as a borderless/notitlebar/backdrop window (save an extra line of the text for another window). Of course this would come after the window position option... really happy with this Last edited by ppill; 22 April 2011 at 10:37. |
22 April 2011, 16:40 | #11 | |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Added diskdrive status on %0 through %3. It displays -- when a drive is either not available or has no disk inserted, and updates the status 10 times a second which should be enough. Test it to make sure it behaves like you expect it to. The command line is now gauge x y "formatting", but there are no sanity checks on that input yet.
Quote:
I agree the proper thing would be to have it detach itself from the CLI, but the AmigaOS APIs are horribly arcane and the code needed to detach from the CLI process is almost a small application in itself. If you already have the run command available in Hombre it would be great for now. Last edited by Leffmann; 12 May 2011 at 23:35. |
|
22 April 2011, 16:54 | #12 |
CON: artist
Join Date: Feb 2006
Location: Poland
Age: 43
Posts: 1,250
|
Transferring it right now
By sanity checks you mean that the position is not verified before opening the window (so you could end up trying to open a window outside of the display)? The 'run' bit as you said is a small detail. Nothing to worry about. Just a small question. Does it lock the CON: window it was started from? Do you have to provide 'run <NIL: >NIL: gauge...' redirections? I keep repeating myself... thanks! Just the backdrop/borderless thing and we're set Or maybe another small thing... free space on a volume/disk like %vdf0 %vSystem EDIT: It works! Just like it's supposed to And just another note... it seems to lock CON: for output... but again nothing to worry about as '>NIL:' will take care of that Last edited by ppill; 22 April 2011 at 17:04. |
22 April 2011, 17:07 | #13 | ||
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Quote:
Quote:
Ok, I'll look into that too. |
||
22 April 2011, 17:23 | #14 | |||
CON: artist
Join Date: Feb 2006
Location: Poland
Age: 43
Posts: 1,250
|
Quote:
Quote:
Have a look here: http://aminet.net/package/util/cli/RunBack Nothing major really as >NIL: suppresses that window lock. Quote:
|
|||
26 April 2011, 16:39 | #15 | |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Added volume sizes on %vvolume: and %Vvolume: which prints free space in bytes and in abbreviated form as 1.2M, 345K, 678 or a dash character if the volume is not available. For the diskdrives it currently only works properly if you have a disk already inserted and leave it there, but looking into fixing this next.
Memory flags changed to %fc %ff %ft to show number of free bytes or %Fc %Ff %Ft to use the abbreviated form. The abbreviated sizes are rounded down and count in amounts of 1000 and 1000000 bytes (as opposed to 1024 and 1048576). Quote:
Last edited by Leffmann; 12 May 2011 at 23:35. |
|
26 April 2011, 23:57 | #16 | ||
CON: artist
Join Date: Feb 2006
Location: Poland
Age: 43
Posts: 1,250
|
Quote:
Really cool feature there... the more choice the better. Maybe you could go full monty and add a percentage (free/full) display as well Quote:
Believe me, you're doing most of the hard work The whole detach thing is nothing to worry about. It's not really a case of good vs sloppy coding. Sometimes you want to know what a program returns to its standard output (errors, warnings, info on what the hell it's doing etc.). Dozens of programs have to be started that way, especially patches. It just bloats the executable with unnecessary code. What's the point anyway when you could add redirection or use programs like RunBack or AsyncRun... As always any updates appreciated |
||
29 April 2011, 16:22 | #17 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Moved the text into the title bar, and you can also specify -1 as X and/or Y window position to make it pop up at right side and bottom of the screen directly at startup, maybe you can test it and see if it looks and behaves like you expect. Diskdrive volume information still needs fixing.
Last edited by Leffmann; 12 May 2011 at 23:34. Reason: fixed another bug and uploaded new archive |
30 April 2011, 20:25 | #18 |
CON: artist
Join Date: Feb 2006
Location: Poland
Age: 43
Posts: 1,250
|
Will check it tonight (been busy with finishing up the next release of Hombre).
Thanks for sticking with it... keep 'em coming |
02 May 2011, 09:26 | #19 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
Code:
; Create task START move.l $4.w,a6 lea DOSname(pc),a1 moveq #0,d0 jsr -552(a6) ; OpenLibrary() lea DOSbase(pc),a0 move.l d0,(a0) beq.b .exit move.l d0,a6 lea TaskName(pc),a0 move.l a0,d1 ; name moveq #0,d2 ; priority lea START-4(pc),a1 move.l (a1),d3 ; seglist move.l d3,Segment-TaskName(a0) clr.l (a1) move.l #4096,d4 ; stack size jsr -138(a6) ; CreateProc moveq #0,d0 rts .exit rts DOSname dc.b "dos.library",0 TaskName dc.b "TestProc",0 CNOP 0,4 Segment dc.l 0 DOSbase dc.l 0 SECTION CODE,CODE TEST move.w #$f00,$dff180 btst #6,$bfe001 bne.b TEST move.l Segment,d1 beq.b .out move.l DOSbase,a6 jsr -156(a6) ; UnLoadSeg() move.l a6,a1 move.l $4.w,a6 jsr -414(a6) ; CloseLibrary() .out rts Last edited by StingRay; 02 May 2011 at 14:19. Reason: Corrected quote |
|
03 May 2011, 16:39 | #20 | |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Quote:
What I need to do now is find a way of seeing if a device or volume is available, without having AmigaDOS open the "Insert volume ..."-requester, that can also handle removable media like diskettes and PCMCIA devices properly. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Someone wrote a KGLoad type proggie.... | Bloodwych | Amiga scene | 22 | 12 August 2010 00:58 |
Looking for old comms proggie | bigmac | request.Apps | 2 | 28 January 2009 14:13 |
|
|