Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Removing the crosshairs in mame lightgun games  (Read 6818 times)

0 Members and 1 Guest are viewing this topic.

Magnet_Eye

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1011
  • Last login:May 11, 2020, 09:26:19 pm
  • Feel the heat?
    • Web Hosting deals for BYOAC Users!
Removing the crosshairs in mame lightgun games
« 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?

I offer discounted WEB HOSTING to BYOAC members! Only $2.49 a month for a FULL FEATURED account! www.cloud9media.com

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 11:01:57 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:Removing the crosshairs in mame lightgun games
« Reply #1 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. :)

Magnet_Eye

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1011
  • Last login:May 11, 2020, 09:26:19 pm
  • Feel the heat?
    • Web Hosting deals for BYOAC Users!
Re:Removing the crosshairs in mame lightgun games
« Reply #2 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.  ;)
I offer discounted WEB HOSTING to BYOAC members! Only $2.49 a month for a FULL FEATURED account! www.cloud9media.com

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 11:01:57 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:Removing the crosshairs in mame lightgun games
« Reply #3 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)

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 11:01:57 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:Removing the crosshairs in mame lightgun games
« Reply #4 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" },
« Last Edit: April 19, 2004, 03:45:45 am by Howard_Casto »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 11:01:57 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:Removing the crosshairs in mame lightgun games
« Reply #5 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.


TheGatesofBill

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 581
  • Last login:August 22, 2018, 09:07:04 am
Re:Removing the crosshairs in mame lightgun games
« Reply #6 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.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 11:01:57 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:Removing the crosshairs in mame lightgun games
« Reply #7 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.
« Last Edit: April 19, 2004, 03:46:21 am by Howard_Casto »

TheGatesofBill

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 581
  • Last login:August 22, 2018, 09:07:04 am
Re:Removing the crosshairs in mame lightgun games
« Reply #8 on: April 19, 2004, 03:48:57 pm »
Hmm... still doesn't compile.

Lilwolf

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4945
  • Last login:July 31, 2022, 10:26:34 pm
Re:Removing the crosshairs in mame lightgun games
« Reply #9 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.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 11:01:57 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:Removing the crosshairs in mame lightgun games
« Reply #10 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.  ;)