/*
   gfx.c
*/

cokerr Gfx_QueryVersion(char* query)  {
  Libcoke_SendStartcmd();
  Libcoke_SendByte(CMD_Gfx_QueryVersion);
  return (Libcoke_GetResponse(query));
}

cokerr Gfx_SetMode(cokebyte onoff)  {
  Libcoke_SendStartcmd();
  Libcoke_SendByte(CMD_Gfx_SetMode);
  Libcoke_SendByte(onoff);
  return (Libcoke_GetResponse(NULL));
}

cokerr Gfx_Clear()  {
  Libcoke_SendStartcmd();
  Libcoke_SendByte(CMD_Gfx_Clear);
  return (Libcoke_GetResponse(NULL));
}

cokerr Gfx_Dump(cokebyte* bitmap)  {
  Libcoke_SendStartcmd();
  Libcoke_SendByte(CMD_Gfx_Dump);
  Libcoke_SendBytearray(30,bitmap);
  return (Libcoke_GetResponse(NULL));
}

cokerr Gfx_DumpResource(cokebyte rezID)  {
  Libcoke_SendStartcmd();
  Libcoke_SendByte(CMD_Gfx_DumpResource);
  Libcoke_SendByte(rezID);
  return (Libcoke_GetResponse(NULL));
}

cokerr Gfx_Shift(cokebyte how)  {
  Libcoke_SendStartcmd();
  Libcoke_SendByte(CMD_Gfx_Shift);
  Libcoke_SendByte(how);
  return (Libcoke_GetResponse(NULL));
}

cokerr Gfx_ScrollStop()  {
  Libcoke_SendStartcmd();
  Libcoke_SendByte(CMD_Gfx_ScrollStop);
  return (Libcoke_GetResponse(NULL));
}

cokerr Gfx_ScrollSpeed(cokebyte speed)  {
  Libcoke_SendStartcmd();
  Libcoke_SendByte(CMD_Gfx_ScrollSpeed);
  Libcoke_SendByte(speed);
  return (Libcoke_GetResponse(NULL));
}

cokerr Gfx_ScrollStart(cokebyte how, cokeword duration)  {
  Libcoke_SendStartcmd();
  Libcoke_SendByte(CMD_Gfx_ScrollStart);
  Libcoke_SendByte(how);
  Libcoke_SendWord(duration);
  return (Libcoke_GetResponse(NULL));
}

cokerr Gfx_ScrollCstring(char* string)  {
  Libcoke_SendStartcmd();
  Libcoke_SendByte(CMD_Gfx_ScrollCstring);
  Libcoke_SendCstring(string);
  return (Libcoke_GetResponse(NULL));
}

cokerr Gfx_ScrollPstring(char* string)  {
  Libcoke_SendStartcmd();
  Libcoke_SendByte(CMD_Gfx_ScrollPstring);
  Libcoke_SendPstring(string);
  return (Libcoke_GetResponse(NULL));
}

cokerr Gfx_ScrollStringResource(cokebyte rezID)  {
  Libcoke_SendStartcmd();
  Libcoke_SendByte(CMD_Gfx_ScrollStringResource);
  Libcoke_SendByte(rezID);
  return (Libcoke_GetResponse(NULL));
}

cokerr Gfx_UseFontResource(cokebyte rezID)  {
  Libcoke_SendStartcmd();
  Libcoke_SendByte(CMD_Gfx_UseFontResource);
  Libcoke_SendByte(rezID);
  return (Libcoke_GetResponse(NULL));
}

cokerr Gfx_SetScrollRange(cokebyte firstcolumn, cokebyte length)  {
  Libcoke_SendStartcmd();
  Libcoke_SendByte(CMD_Gfx_SetScrollRange);
  Libcoke_SendByte(firstcolumn);
  Libcoke_SendByte(length);
  return (Libcoke_GetResponse(NULL));
}

