View Single Post
Old 03 August 2020, 09:00   #89
deimos
It's coming back!
 
deimos's Avatar
 
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
Quote:
Originally Posted by Nightfox View Post
I'm using this extension to code an Amiga app and I'm following the Amiga ROM Kernel Reference Manual to try to open a port so that I can use console.device. CreatePort() is what I need to use but apparently that is only available in a library called amiga.lib? Is there anyway of doing this via this vscode extension?
There are several amiga.libs that you might be able to build yourself, or just take the handful of functions you need from:

https://github.com/adtools/libnix/bl...c/CreatePort.c

Code:
struct MsgPort *CreatePort(CONST_STRPTR name,LONG pri)
{ APTR SysBase = *(APTR *)4L;
  struct MsgPort *port = NULL;
  UBYTE portsig;

  if ((BYTE)(portsig=AllocSignal(-1)) >= 0) {
    if (!(port=AllocMem(sizeof(*port),MEMF_CLEAR|MEMF_PUBLIC)))
      FreeSignal(portsig);
    else {
      port->mp_Node.ln_Type = NT_MSGPORT;
      port->mp_Node.ln_Pri  = pri;
      port->mp_Node.ln_Name = name;
      /* done via AllocMem
      port->mp_Flags        = PA_SIGNAL;
      */
      port->mp_SigBit       = portsig;
      port->mp_SigTask      = FindTask(NULL);
      NEWLIST(&port->mp_MsgList);
      if (port->mp_Node.ln_Name)
        AddPort(port);
    }
  }
  return port;
}
The bottom of this page https://github.com/adtools/libnix/tr...bdf3fab99cab61 has a list that might be worth looking at.
deimos is offline  
 
Page generated in 0.04493 seconds with 11 queries