[Coco] Syscall to get the window screen and width

William Carlin whcarlinjr at gmail.com
Sat Mar 8 11:41:10 EST 2025


I believe you either reference STDOUT or open a path to STDOUT. Then use
that path number to do a SS.DevNm call. The device name will be returned in
a 32 byte buffer. Doesn't specify if the name will be null terminated or or
the last character of the name will have a high bit set to indicate string
termination.

SS.DevNm - Returns a device name

Function Code $0E

Entry Conditions
A path number
B $0E X address of 32-byte buffer for name

Exit Conditions
X address of buffer, name moved to buffer

Error Output
CC carry set on error
B error code, if any

On Sat, Mar 8, 2025 at 10:52 AM plt via Coco <coco at maltedmedia.com> wrote:

>
> The application I am running the users can run it on any windows /w1 /w2
> /w3 /w4 ect. So I do not know that the user is doing.
>
>
>
> On Sat, March 8, 2025 15:49, Wayne Campbell via Coco wrote:
> > You should already know which window you are using. Your code should be
> > reflecting which window you have currently selected. If you are not doing
> > that, then I don't know what to tell you.
> >
> > On Sat, Mar 8, 2025, 7:28 AM plt via Coco <coco at maltedmedia.com> wrote:
> >
> >
> >>
> >> In Basic09 is there a way to find the current window that your using?
> >>
> >>
> >> Thanks
> >>
> >>
> >> On Sat, March 8, 2025 15:11, Wayne Campbell via Coco wrote:
> >>
> >>> This should work, but I haven't tested it.
> >>>
> >>>
> >>>
> >>> TYPE REG=cc,a,b,dp:BYTE; x,y,u:INTEGER
> >>> DIM regs:REG \(* registers type
> >>> DIM callCode,path:BYTE
> >>> DIM erCode,cols,rows:INTEGER
> >>>
> >>>
> >>>
> >>> OPEN #path,"/w":READ \ (* open path to window - /w is next available
> >>> window, specify which device here callCode:=$8D \(* getstat call
> >>> regs.a:=path
> >>> regs.b:=$26
> >>> RUN SysCall(callCode,regs)
> >>> IF LAND(regs.cc,1)<>0 THEN \ (* Carry set on error
> >>> erCode:=regs.b \ (* Error code (if any)
> >>> (* handle error *)
> >>> ELSE
> >>> cols:=regs.x
> >>> rows:=regs.y
> >>> ENDIF
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> On Sat, Mar 8, 2025, 6:19 AM plt via Coco <coco at maltedmedia.com>
> >>> wrote:
> >>>
> >>>
> >>>
> >>>>
> >>>> I am not sure if this will the screen width and length but can you
> >>>> provide a example of how to do the system call and get the return
> >>>> results please?
> >>>>
> >>>> How can you get the current window if /w1 or /w2?
> >>>>
> >>>>
> >>>>
> >>>> Chapter 9. System Calls NitrOS-9 EOU Technical Reference Manual
> >>>> SS.ScSiz Returns the window or screen size
> >>>> Function Code $26
> >>>> Entry Conditions:
> >>>> A path number
> >>>> B $26
> >>>> Exit Conditions:
> >>>> X number of columns on screen/window
> >>>> Y number of rows on screen/window
> >>>> Error Output:
> >>>> CC carry set on error
> >>>> B error code, if any
> >>>>
> >>>>
> >>>>
> >>>> Chapter 9. System Calls NitrOS-9 EOU Technical Reference Manual
> >>>> SS.ScSiz Returns the window or screen size
> >>>> Function Code $26
> >>>> Entry Conditions:
> >>>> A path number
> >>>> B $26
> >>>> Exit Conditions:
> >>>> X number of columns on screen/window
> >>>> Y number of rows on screen/window
> >>>> Error Output:
> >>>> CC carry set on error
> >>>> B error code, if any
> >>>>
> >>>>
> >>>>
> >>>> Additional Information:
> >>>>
> >>>>
> >>>>
> >>>> • Use this call to determine the size of an output screen.
> >>>> The values
> >>>> returned depend on the on device in use: ◦ For non-VTIO
> >>>> devices, the call returns the COL and ROW values in the device
> >>>> descriptor.
> >> ◦
> >>
> >>>> For VTIO/CoVDG devices, the call returns the size of the window or
> >>>> screen in use by the specified device (32x16). ◦ For window
> >>>> devices, the call returns the size of the of the current working
> >>>> area of the window. • This call is handled by CoVDG,
> >>>> CoGrf/CoWin, SC6551,
> >>>> SC6850, S16550 (and
> >>>> any future serial port drivers).
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> Coco mailing list
> >>>> Coco at maltedmedia.com
> >>>> https://pairlist5.pair.net/mailman/listinfo/coco
> >>>>
> >>>>
> >>>>
> >>>
> >>> --
> >>> Coco mailing list
> >>> Coco at maltedmedia.com
> >>> https://pairlist5.pair.net/mailman/listinfo/coco
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >> --
> >> Coco mailing list
> >> Coco at maltedmedia.com
> >> https://pairlist5.pair.net/mailman/listinfo/coco
> >>
> >>
> >
> > --
> > Coco mailing list
> > Coco at maltedmedia.com
> > https://pairlist5.pair.net/mailman/listinfo/coco
> >
> >
>
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>


More information about the Coco mailing list