home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Kyūkyoku!! X68000 Emulator
/
X68000Book.dat
/
mac
/
OLS
/
X68000
/
Ko-Window
/
kow142s.lzh
/
wsrv
/
put.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-02-27
|
2KB
|
76 lines
#include <stdio.h>
/* 1991 modified H.Ogasawara(COR.) */
#define AUTOGPOS 1
#include "super.h"
#include "clip.h"
#include "screen.h"
int Xlen, Ylen, GramH, BufH, GramTop, BufTop;
extern void GramPut1( void );
extern void GramPut2( void );
extern int GraphicMode;
#if AUTOGPOS
extern int GraphicHomeX, GraphicHomeY;
#endif
void
GramPut( clip, x1, y1, x2, y2, buf )
ClipClass *clip;
int x1, y1, x2, y2;
char *buf;
{
int mode;
ClipClass c1, c2;
/* âRâsü[ɵé╠ö═ê═ */
c1.clip.x1= x1;
c1.clip.y1= y1;
c1.clip.x2= x2;
c1.clip.y2= y2;
if( ClipOverlap( &c1, &c1, clip ) ){
/* âRâsü[î│é╠ö═ê═ */
c2.clip.x1= c1.clip.x1 - x1;
c2.clip.y1= c1.clip.y1 - y1;
c2.clip.x2= c1.clip.x2 - x1;
c2.clip.y2= c1.clip.y2 - y1;
BufH= x2 - x1 + 1;
Xlen= c2.clip.x2 - c2.clip.x1 + 1;
Ylen= c2.clip.y2 - c2.clip.y1 + 1;
switch( mode = GraphicMode ){
case 8: /* WindowAttrGraphic256 */
case 12: /* WindowAttrGraphic65536 */
GramH= 512 * 2;
#if AUTOGPOS
c1.clip.x1-= GraphicHomeX;
c1.clip.y1-= GraphicHomeY;
#endif
break;
case 4: /* WindowAttrGraphic16 */
GramH= 1024 * 2 ;
break;
default:
return;
}
GramTop= 0xC00000 + GramH * c1.clip.y1 + c1.clip.x1 * 2;
InSuper();
if( mode == 12 /* WindowAttrGraphic65536 */ ){
BufTop= (int)buf + BufH * 2 * c2.clip.y1 + c2.clip.x1 * 2 ;
GramPut2();
}else{
BufTop= (int)buf + BufH * c2.clip.y1 + c2.clip.x1 ;
GramPut1();
}
OutSuper();
}
}