28 September 2022, 09:43 | #1 |
Registered User
Join Date: Mar 2021
Location: SWEDEN
Posts: 40
|
Output to CLI
I've read that "dos.lib" has a function to output text to CLI, but where can we find documentation or an example?
User starts demo from CLI.... CLI says: "Demo now loading..." But how to do it? |
28 September 2022, 10:25 | #2 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,451
|
dos/Printf() does that for you, from kick 2.0 onwards. Otherwise, for older kickstarts, you have to go through Output() to get the output handle, and Write() to send the characters manually, and you have to perform argument substitution manually as well.
|
28 September 2022, 10:31 | #3 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,089
|
If you like cryptic asm :P, example for KS1.x via _LVOutput() can be found here: http://eab.abime.net/showthread.php?t=106742&page=25
|
28 September 2022, 11:15 | #4 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,378
|
Easiest way is to open v36+ dos.library and call PutStr (unformatted) or VPrintf (formatted).
|
28 September 2022, 18:16 | #5 |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,288
|
If 1.X compatibility is required it's still not too bad. Outputting a simple string:
Code:
; a6=dos.library jsr _LVOOutput(a6) move.l d0,d1 ; console output handle move.l #msg,d2 move.l #msgend-msg,d3 jsr _LVOWrite(a6) ... msg: dc.b 'Demo now loading...' msgend: Code:
;d1=fmt,d2=args,a6=dos.library buffersize=80 Printf: movem.l d2-d3/a2-a4,-(sp) move.l a6,a4 move.l $4.w,a6 move.l d1,a0 move.l d2,a1 lea .storechar(pc),a2 lea -buffersize(a7),a7 move.l a7,a3 jsr _LVORawDoFmt(a6) move.l a3,d2 moveq #-1,d3 .strlen: tst.b (a3)+ dbeq d3,.strlen not.l d3 move.l a4,a6 jsr _LVOOutput(a6) move.l d0,d1 jsr _LVOWrite(a6) lea buffersize(a7),a7 movem.l (sp)+,d2-d3/a2-a4 rts .storechar: move.b d0,(a3)+ rts |
29 September 2022, 09:33 | #6 |
Registered User
Join Date: Mar 2021
Location: SWEDEN
Posts: 40
|
Thanks a lot everyone, we will try the Thomas solution, it seems to be the simplest... "dos/Printf()" ... "and for older kickstarts Output() to get the output handle, and Write()"
|
29 September 2022, 09:37 | #7 |
Registered User
Join Date: Mar 2021
Location: SWEDEN
Posts: 40
|
What variable (D0,D1,D2) do we pass to doslib Output(), to optain the handle of the CLI window? is that: move.b "CON:",0,0 .. or something else?
|
29 September 2022, 10:32 | #8 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,659
|
Output returns the current output handle for the process - it takes no input. If the process was started by a CLI, and the output wasn't redirected, you will get the handle of the console..
Last edited by hooverphonique; 29 September 2022 at 13:56. |
29 September 2022, 11:03 | #9 |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 5,130
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CLI help | npagonis73 | support.Other | 30 | 06 October 2020 18:12 |
for..each statement in CLI | pieter1976 | support.Other | 10 | 09 January 2020 22:15 |
CLI help | DeafDaz | request.Other | 3 | 10 August 2011 01:16 |
CLI Syntax | Greaser | New to Emulation or Amiga scene | 1 | 08 October 2006 10:14 |
|
|