Build Your Own Arcade Controls Forum

Main => Lightguns => Topic started by: Magnet_Eye on April 17, 2004, 09:28:11 pm

Title: Removing the crosshairs in mame lightgun games
Post by: Magnet_Eye on April 17, 2004, 09:28:11 pm
I know you can hit F1 to hide the crosshairs, but can you permanently hide them instead of having to hit F1 everytime?

Title: Re:Removing the crosshairs in mame lightgun games
Post by: Howard_Casto on April 18, 2004, 12:33:07 am
Not currently... but come to think of it, it would be easy to add a command line switch in mame.  I'll look into it. :)
Title: Re:Removing the crosshairs in mame lightgun games
Post by: Magnet_Eye on April 18, 2004, 04:04:11 am
Not currently... but come to think of it, it would be easy to add a command line switch in mame.  I'll look into it. :)


cool. let me know what you come up with.  ;)
Title: Re:Removing the crosshairs in mame lightgun games
Post by: Howard_Casto on April 19, 2004, 02:30:49 am
ok this should work, I haven't tested it yet as i'm waiting for the next official mame build before I recompile (hate dealing with diff files)
Title: Re:Removing the crosshairs in mame lightgun games
Post by: Howard_Casto on April 19, 2004, 02:31:31 am
if src/drawgfx.c:


change
===============================================
static int crosshair_enable=1;

void drawgfx_toggle_crosshair(void)
{
   crosshair_enable^=1;
}

void draw_crosshair(struct mame_bitmap *bitmap,int x,int y,const struct rectangle *clip)
{
   unsigned short black,white;
   int i;

   if (!crosshair_enable)
===============================================
to
===============================================
/* static int crosshair_enable=1; */

void drawgfx_toggle_crosshair(void)
{
   options.crosshairs^=1;
}

void draw_crosshair(struct mame_bitmap *bitmap,int x,int y,const struct rectangle *clip)
{
   unsigned short black,white;
   int i;

   if (!options.crosshairs)
================================================

 

In /src/windows/config.c:
Add

{ "crosshairs", "ch", rc_bool, &options.crosshairs, "0", 0, 0, NULL, "draw crosshairs for lightgun games" },
Title: Re:Removing the crosshairs in mame lightgun games
Post by: Howard_Casto on April 19, 2004, 02:42:26 am
to use it simply type:

crosshair/nocrosshair  ch/noch at the command prompt to set it



If anyone wants to try it feel free and post your results (i should be able to fix any glitches on paper)


Once the next official build comes out I'll go ahead and submit it to mame.  If nothing else, I'll have sirp add it to his hacks page so it can be added to noname mame and all the others.

Title: Re:Removing the crosshairs in mame lightgun games
Post by: TheGatesofBill on April 19, 2004, 02:55:30 am
if src/drawgfx.c:


change
===============================================
static int crosshair_enable=1;

void drawgfx_toggle_crosshair(void)
{
   crosshair_enable^=1;
}

void draw_crosshair(struct mame_bitmap *bitmap,int x,int y,const struct rectangle *clip)
{
   unsigned short black,white;
   int i;

   if (!crosshair_enable)
===============================================
to
===============================================
/* static int crosshair_enable=1; */

void drawgfx_toggle_crosshair(void)
{
   crosshair_enable^=1;
}

void draw_crosshair(struct mame_bitmap *bitmap,int x,int y,const struct rectangle *clip)
{
   unsigned short black,white;
   int i;

   if (!crosshair_enable)
================================================

In src/mame.h:
add

int   crosshairs;

In /src/windows/config.c:
Add

{ "crosshairs", "ch", rc_bool, &options.crosshairs, "0", 0, 0, NULL, "draw crosshairs for lightgun games" },
Okay, now it'll work. The "crosshair"s should have been "crosshair_enable"s.
Title: Re:Removing the crosshairs in mame lightgun games
Post by: Howard_Casto on April 19, 2004, 03:41:11 am
actually no, it should be crosshairs

if you notice the only instance of "crosshair_enable" in the original source is locally in drawgfx

I commented that out and replaced all instances with the global variable crosshairs, to match with the new command line switch



oops the wrong code was pasted in, sorry


on second glance, however i'm not actually passing the new switch to anything.... the easiest solution is to remove the new global "crosshairs" and instead read and write to options.crosshairs

The code posted above has been fixed in the original post.
Title: Re:Removing the crosshairs in mame lightgun games
Post by: TheGatesofBill on April 19, 2004, 03:48:57 pm
Hmm... still doesn't compile.
Title: Re:Removing the crosshairs in mame lightgun games
Post by: Lilwolf on April 19, 2004, 04:15:57 pm
btw..

wouldn't it be nice to have the player 1 and player 2 seperated?  

something I was always annoyed with.. but once you have a real gun (assuming actlabs guns are considered real)..  It doesn't matter.

but others might like it.
Title: Re:Removing the crosshairs in mame lightgun games
Post by: Howard_Casto on April 20, 2004, 07:43:28 pm
btw..

wouldn't it be nice to have the player 1 and player 2 seperated?  

something I was always annoyed with.. but once you have a real gun (assuming actlabs guns are considered real)..  It doesn't matter.

but others might like it.


It would, but the way drawcrosshairs is implemented you'd have to change the source to every single game that uses crosshairs.  So I'm not going to figure it out anyway.  ;)