Changeset 7258c6a in buchla-68k for ram/smscrl.c


Ignore:
Timestamp:
07/09/2017 04:45:34 PM (7 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
8618599
Parents:
0292fbb
Message:

Use standard integer types.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ram/smscrl.c

    r0292fbb r7258c6a  
    2525#define TOPSCAN         (NSCANS - 1)            /* top scan line */
    2626
    27 extern  short   cmtype;                         /* cursor type */
    28 extern  short   ctcsw;                          /* cursor status */
    29 extern  short   curslin;                        /* current sequence line */
    30 extern  short   cxrate;                         /* cursor X update rate */
    31 extern  short   cxval;                          /* cursor X location */
    32 extern  short   cyrate;                         /* cursor Y update rate */
    33 extern  short   cyval;                          /* cursor Y location */
    34 extern  short   ptecpos;                        /* current patch index */
    35 extern  short   pteset;                         /* ptebuf set flag */
    36 extern  short   sqdeflg;                        /* sequence data entry flag */
    37 extern  short   stccol;                         /* main cursor column */
    38 extern  short   submenu;                        /* submenu switch */
    39 extern  short   vtccol;                         /* submenu cursor column */
    40 extern  short   vtcrow;                         /* submenu cursor row */
    41 extern  short   vtxval;                         /* submenu cursor x value */
    42 extern  short   vtyval;                         /* subment cursor y value */
    43 
    44 extern  unsigned        *obj10;                 /* sequence status object pointer */
    45 
    46 extern  int     cg3[][256];                     /* character generator table */
    47 
    48 extern  char    ptdebuf[];                      /* patch data entry buffer */
    49 extern  char    sqdebuf[];                      /* sequence data entry buffer */
     27extern  int16_t cmtype;                         /* cursor type */
     28extern  int16_t ctcsw;                          /* cursor status */
     29extern  int16_t curslin;                        /* current sequence line */
     30extern  int16_t cxrate;                         /* cursor X update rate */
     31extern  int16_t cxval;                          /* cursor X location */
     32extern  int16_t cyrate;                         /* cursor Y update rate */
     33extern  int16_t cyval;                          /* cursor Y location */
     34extern  int16_t ptecpos;                        /* current patch index */
     35extern  int16_t pteset;                         /* ptebuf set flag */
     36extern  int16_t sqdeflg;                        /* sequence data entry flag */
     37extern  int16_t stccol;                         /* main cursor column */
     38extern  int16_t submenu;                        /* submenu switch */
     39extern  int16_t vtccol;                         /* submenu cursor column */
     40extern  int16_t vtcrow;                         /* submenu cursor row */
     41extern  int16_t vtxval;                         /* submenu cursor x value */
     42extern  int16_t vtyval;                         /* subment cursor y value */
     43
     44extern  uint16_t        *obj10;                 /* sequence status object pointer */
     45
     46extern  int16_t cg3[][256];                     /* character generator table */
     47
     48extern  int8_t  ptdebuf[];                      /* patch data entry buffer */
     49extern  int8_t  sqdebuf[];                      /* sequence data entry buffer */
    5050
    5151extern  struct patch    ptebuf;                 /* current patch image */
     
    5555extern  struct seqent   seqtab[];               /* sequence table */
    5656
    57 char    TheBuf[66];                             /* display build buffer */
    58 
    59 /*
    60 
    61 */
    62 
    63 char    *(*BakLine)(void);              /* next line backward function pointer */
    64 char    *(*FwdLine)(void);              /* next line forward function pointer */
    65 
    66 short   PdScDnF;                        /* scroll down flag */
    67 short   PdScUpF;                        /* scroll up flag */
    68 
    69 short   CurLine;                        /* top line being displayed */
    70 short   CurScan;                        /* current scan line */
    71 short   DupLine;                        /* write pointer for other page */
    72 short   ScrlObj;                        /* object descriptor table index */
    73 
    74 char    *LinePtr;                       /* line to scroll onto screen */
    75 
    76 unsigned short  LineAtr;                /* attribute for the new line */
    77 
    78 unsigned short  *LineBuf;               /* current display memory pointer */
    79 unsigned short  *OldLine;               /* old display memory pointer */
    80 unsigned short  *ScObAdr;               /* display memory base pointer */
    81 
    82 short   LineCon = SS_LEN * 3;           /* line offset constant */
    83 short   LineLen = SS_LEN;               /* length of a scrolled line */
    84 short   SmScLim = SS_LIM;               /* top line limit */
    85 short   SmScNsl = SS_NSL;               /* number of scrolled lines */
    86 short   SmScTop = SS_TOP;               /* total line count */
     57int8_t  TheBuf[66];                             /* display build buffer */
     58
     59/*
     60
     61*/
     62
     63int8_t  *(*BakLine)(void);              /* next line backward function pointer */
     64int8_t  *(*FwdLine)(void);              /* next line forward function pointer */
     65
     66int16_t PdScDnF;                        /* scroll down flag */
     67int16_t PdScUpF;                        /* scroll up flag */
     68
     69int16_t CurLine;                        /* top line being displayed */
     70int16_t CurScan;                        /* current scan line */
     71int16_t DupLine;                        /* write pointer for other page */
     72int16_t ScrlObj;                        /* object descriptor table index */
     73
     74int8_t  *LinePtr;                       /* line to scroll onto screen */
     75
     76uint16_t        LineAtr;                /* attribute for the new line */
     77
     78uint16_t        *LineBuf;               /* current display memory pointer */
     79uint16_t        *OldLine;               /* old display memory pointer */
     80uint16_t        *ScObAdr;               /* display memory base pointer */
     81
     82int16_t LineCon = SS_LEN * 3;           /* line offset constant */
     83int16_t LineLen = SS_LEN;               /* length of a scrolled line */
     84int16_t SmScLim = SS_LIM;               /* top line limit */
     85int16_t SmScNsl = SS_NSL;               /* number of scrolled lines */
     86int16_t SmScTop = SS_TOP;               /* total line count */
    8787
    8888/*
     
    9696*/
    9797
    98 char *LineFwd(void)
    99 {
    100         register short j, k;
     98int8_t *LineFwd(void)
     99{
     100        register int16_t j, k;
    101101
    102102        for (j = 0; j < 48; j++)
     
    107107
    108108        if (0 EQ ptecpos)
    109                 return((char *)NULL);
     109                return((int8_t *)NULL);
    110110
    111111        if (0 EQ (j = findnxt(ptecpos)))
    112                 return((char *)NULL);
     112                return((int8_t *)NULL);
    113113
    114114        ptecpos = j;
     
    146146*/
    147147
    148 char *LineBak(void)
    149 {
    150         register short j, k;
     148int8_t *LineBak(void)
     149{
     150        register int16_t j, k;
    151151
    152152        for (j = 0; j < 48; j++)
     
    157157
    158158        if (0 EQ ptecpos)
    159                 return((char *)NULL);
     159                return((int8_t *)NULL);
    160160
    161161        if (0 EQ (j = findprv(ptecpos)))
    162                 return((char *)NULL);
     162                return((int8_t *)NULL);
    163163
    164164        ptecpos = j;
     
    196196*/
    197197
    198 void WrVideo(short row, short col, char *str, unsigned short atr)
    199 {
    200         register char chr;
     198void WrVideo(int16_t row, int16_t col, int8_t *str, uint16_t atr)
     199{
     200        register int8_t chr;
    201201
    202202        if (v_regs[5] & 0x0180)
     
    222222*/
    223223
    224 void SetDTop(short row, short scan)
     224void SetDTop(int16_t row, int16_t scan)
    225225{
    226226        if (v_regs[5] & 0x0180)
    227227                vbank(0);
    228228
    229         LineBuf = (unsigned short *)((char *)ScObAdr + (row * LineCon));
     229        LineBuf = (uint16_t *)((int8_t *)ScObAdr + (row * LineCon));
    230230
    231231        if (OldLine NE LineBuf)
    232                 v_odtab[ScrlObj][2] = ((long)LineBuf >> 1) & 0xFFFF;
     232                v_odtab[ScrlObj][2] = ((int32_t)LineBuf >> 1) & 0xFFFF;
    233233
    234234        OldLine = LineBuf;
     
    247247*/
    248248
    249 void UpdVid(short row, short col, char *str, unsigned short atr)
     249void UpdVid(int16_t row, int16_t col, int8_t *str, uint16_t atr)
    250250{
    251251        WrVideo(CurLine + row, col, str, atr);
     
    274274void bgncm(void)
    275275{
    276         register short j;
     276        register int16_t j;
    277277
    278278        memcpyw(&ptebuf.defnum, &patches[ptecpos].defnum, 6);
     
    306306void stopcm(void)
    307307{
    308         register short i;
     308        register int16_t i;
    309309
    310310        if (PdScDnF)
     
    348348void stopsm(void)
    349349{
    350         register short i;
     350        register int16_t i;
    351351
    352352        if (PdScDnF)
     
    380380                if (CurScan EQ TOPSCAN) {       /* ready for a new line ? */
    381381
    382                         if ((char *)NULL NE (LinePtr = (*FwdLine)())) { /* get a line */
     382                        if ((int8_t *)NULL NE (LinePtr = (*FwdLine)())) {       /* get a line */
    383383
    384384                                if (CurLine EQ SmScLim) {       /* *** swap display pages *** */
     
    425425                if (CurScan EQ TOPSCAN) {       /* ready for a new line ? */
    426426
    427                         if ((char *)NULL NE (LinePtr = (*BakLine)())) { /* get a line */
     427                        if ((int8_t *)NULL NE (LinePtr = (*BakLine)())) {       /* get a line */
    428428
    429429                                if (CurLine EQ 0) {     /* *** swap display pages *** */
     
    476476void smxupd(void)
    477477{
    478         short oldcx;
     478        int16_t oldcx;
    479479
    480480        oldcx = cxval;
     
    539539*/
    540540
    541 void smy_up(short tag)
     541void smy_up(int16_t tag)
    542542{
    543543
     
    609609*/
    610610
    611 void sqy_up(short tag)
     611void sqy_up(int16_t tag)
    612612{
    613613        if (ctcsw)
Note: See TracChangeset for help on using the changeset viewer.