home *** CD-ROM | disk | FTP | other *** search
/ Amiga Dream 59 / CDDream59.ISO / Amiga / Emulation / cp4.lha / cp4 / c2p_src / c2p_module.c < prev    next >
C/C++ Source or Header  |  1998-11-30  |  4KB  |  129 lines

  1. /* :ts=4                            c2p_module.c
  2.  *
  3.  *    cp4 - Commodore C+4 emulator
  4.  *    Copyright (C) 1998 Gßti Gergely
  5.  *
  6.  *    This program is free software; you can redistribute it and/or modify
  7.  *    it under the terms of the GNU General Public License as published by
  8.  *    the Free Software Foundation; either version 2 of the License, or
  9.  *    (at your option) any later version.
  10.  *
  11.  *    This program is distributed in the hope that it will be useful,
  12.  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  *    GNU General Public License for more details.
  15.  *
  16.  *    You should have received a copy of the GNU General Public License
  17.  *    along with this program; if not, write to the Free Software Foundation,
  18.  *    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19.  *
  20.  *    e-mail: gatig@dragon.klte.hu
  21.  */
  22. #ifndef C2P_MODULE_C
  23. #define C2P_MODULE_C
  24.  
  25. #ifndef C2P_MODULE_H
  26. #include "c2p_module.h"
  27. #endif
  28.  
  29. #include "macros.h"
  30.  
  31. #define SCRWIDTH    352
  32. #define SCRHEIGHT    283
  33. #define SCRSIZE        (SCRWIDTH*SCRHEIGHT)
  34. #define NUMSCR        3
  35. #define C2P_NOMSG    "\0"
  36. #define C2P_NOMEM    "Not Enough Memory"
  37. #define RET_ERROR    -2
  38. #define RET_NEWWIN    -1
  39. #define RET_OK        0
  40. #define RET_DEBUG    1
  41. #define RET_PREFS    2
  42. #define RET_RESET    3
  43. #define RET_HRESET    4
  44. #define RET_QUIT    5
  45.  
  46. char *SAVEDS minit(ULONG scrmode, ULONG overscan, unsigned char *linedeltatab);
  47. void SAVEDS mfree(void);
  48. int SAVEDS mdo(unsigned char *chunky,unsigned char *delta,int numscreen);
  49. int SAVEDS mdofull(unsigned char *chunky,int numscreen);
  50. int SAVEDS mdont(void);
  51. void SAVEDS msleep(void);
  52. void SAVEDS mawake(void);
  53.  
  54. static int SAVEDS idofull(unsigned char *chunky,unsigned char *delta,int numscreen);
  55. static int DummyGetOptionInt(char *name,int defval);
  56. static void DummyAddOptionInt(char *name,int value);
  57. static char *DummyGetOptionStr(char *name,char *defval);
  58. static void DummyAddOptionStr(char *name,char *value);
  59.  
  60. static struct c2pvec vec;
  61. #define C2P_VERSTAG " $VER: " ## C2P_NAME ## " " ## C2P_VERSION ## "." ## C2P_REVISION ## " " ## __DATE__ ## " (" ## __TIME__ ## ") cp4 VID by " ## C2P_AUTHOR
  62. static char c2p_VERSTAG[]=C2P_VERSTAG;
  63.  
  64. struct c2pvec SAVEDS *startup(void) {
  65. static char iVer[]=C2P_VERSION;
  66. static char iRev[]=C2P_REVISION;
  67. static char iNam[]=C2P_NAME;
  68. static char iAut[]=C2P_AUTHOR;
  69. static char iInf[]=C2P_INFO;
  70.     vec.c2p_init=minit;
  71.     vec.c2p_free=mfree;
  72.     vec.c2p_do=mdo;
  73.     vec.c2p_dofull=idofull;
  74.     vec.c2p_sleep=msleep;
  75.     vec.c2p_awake=mawake;
  76.     vec.c2p_Info=iInf;
  77.     vec.c2p_Author=iAut;
  78.     vec.c2p_Version=iVer;
  79.     vec.c2p_Revision=iRev;
  80.     vec.c2p_Name=iNam;
  81.     vec.c2p_Scr=NULL;
  82.     vec.c2p_Win=NULL;
  83.     vec.c2p_GetOptionInt=DummyGetOptionInt;
  84.     vec.c2p_AddOptionInt=DummyAddOptionInt;
  85.     vec.c2p_GetOptionStr=DummyGetOptionStr;
  86.     vec.c2p_AddOptionStr=DummyAddOptionStr;
  87.     vec.c2p_MsgList.lh_Head=(struct Node *)&vec.c2p_MsgList.lh_Tail;
  88.     vec.c2p_MsgList.lh_Tail=NULL;
  89.     vec.c2p_MsgList.lh_TailPred=(struct Node *)&vec.c2p_MsgList.lh_Head;
  90.     vec.c2p_MsgList.lh_Type=0;
  91. #ifdef C2P_BUFFERING
  92.     vec.c2p_Buffering=C2P_BUFFERING;
  93.     if(vec.c2p_Buffering<0||vec.c2p_Buffering>3) vec.c2p_Buffering=0;
  94. #else
  95.     vec.c2p_Buffering=0;
  96. #endif
  97.     vec.c2p_Speed=-1;
  98. #ifdef C2P_NOSPEED
  99.     vec.c2p_NoSpeed=1;
  100. #else
  101.     vec.c2p_NoSpeed=0;
  102. #endif
  103.     c2p_VERSTAG[0]='\0';
  104.     vec.c2p_dont=mdont;
  105.     return(&vec);
  106. } // startup
  107.  
  108. static int SAVEDS idofull(unsigned char *chunky,unsigned char *delta,int numscreen) {
  109.     return(mdofull(chunky,numscreen));
  110. } // idofull()
  111.  
  112. static int DummyGetOptionInt(char *name,int defval) {
  113.     return(-1);
  114. }
  115.  
  116. static void DummyAddOptionInt(char *name,int value) {
  117.     return;
  118. }
  119.  
  120. static char *DummyGetOptionStr(char *name,char *defval) {
  121.     return(NULL);
  122. }
  123.  
  124. static void DummyAddOptionStr(char *name,char *value) {
  125.     return;
  126. }
  127.  
  128. #endif
  129.