X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=input%2Fcursor.c;fp=input%2Fcursor.c;h=c57b9d10f95b976342cd31ad61d4e28ca3a72895;hp=cb78d7349e395e5638beedbbe30ff0894b4486a5;hb=e328100eecae3adfce1c3b57364bee5d166217ef;hpb=f12b1f316ca070bda860108b4e3901628d1a8398 diff --git a/input/cursor.c b/input/cursor.c index cb78d73..c57b9d1 100644 --- a/input/cursor.c +++ b/input/cursor.c @@ -1,5 +1,20 @@ #include "share.h" +static uint8 GunSight[]={ + 0,0,0,0,0,0,1,0,0,0,0,0,0, + 0,0,0,0,0,0,2,0,0,0,0,0,0, + 0,0,0,0,0,0,1,0,0,0,0,0,0, + 0,0,0,0,0,0,2,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,3,0,0,0,0,0,0, + 1,2,1,2,0,3,3,3,0,2,1,2,1, + 0,0,0,0,0,0,3,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,2,0,0,0,0,0,0, + 0,0,0,0,0,0,1,0,0,0,0,0,0, + 0,0,0,0,0,0,2,0,0,0,0,0,0, + 0,0,0,0,0,0,1,0,0,0,0,0,0, +}; static uint8 FCEUcursor[11*19]= { 1,0,0,0,0,0,0,0,0,0,0, @@ -23,6 +38,32 @@ static uint8 FCEUcursor[11*19]= 0,0,0,0,0,0,0,1,1,0,0, }; +void FCEU_DrawGunSight(uint8 *buf, int xc, int yc) +{ + int x,y; + int c,d; + + for(y=0;y<13;y++) + for(x=0;x<13;x++) + { + uint8 a; + a=GunSight[y*13+x]; + if(a) + { + c=(yc+y-7); + d=(xc+x-7); + if(c>=0 && d>=0 && d<256 && c<240) + { + if(a==3) + buf[c*SCREEN_WIDTH+d+SCREEN_OFFS]=0xBF-(buf[c*SCREEN_WIDTH+d+SCREEN_OFFS]&0x3F); + else + buf[c*SCREEN_WIDTH+d+SCREEN_OFFS]=a-1; + } + } + } +} + + void FCEU_DrawCursor(uint8 *buf, int xc, int yc) { int x,y; @@ -39,7 +80,7 @@ void FCEU_DrawCursor(uint8 *buf, int xc, int yc) c=(yc+y); d=(xc+x); if(d<256 && c<240) - buf[c*272+d]=a+127; + buf[c*SCREEN_WIDTH+d+SCREEN_OFFS]=a+127; } } }