Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#19 xmame 0.66

v0.31
closed
i/o (10)
7
2003-03-24
2003-03-18
Anonymous
No

I just compiled the new xmame and it says invalid
brightnes whenever I run a game and gxmame crashes...

Maybe they have changed the option in xmame 0.66

Thanks for support

Discussion

  • Logged In: NO

    the -gamma-correction is also going to break gx

     
  • Logged In: NO

    gamma correction will not work correctly either

     
  • Logged In: YES
    user_id=240418

    I just emailed a patch to shadow_walker, hopefully he'll get
    it soon, but if you want it, here it is:

    diff -r src/gxmame.h src/gxmame.h
    337c337
    < guint brightness; /* Set the brightness (0-100%%)*/
    ---
    > gfloat brightness; /* Set the brightness (0-100%%)*/
    diff -r src/io.c src/io.c
    1280c1280
    < target->brightness = 100;
    ---
    > target->brightness = 1.0;
    1576c1576,1580
    < target->brightness = atoi( option_value[1]);
    ---
    > target->brightness = atof( option_value[1]);
    > if (target->brightness < 0.5)
    > target->brightness = 0.5;
    > else if (target->brightness > 2.0)
    > target->brightness = 1.0;
    2446c2450
    <
    g_snprintf(option_string,MAX_OPTION_STRING,"brightness=%i\n",target->brightness);
    ---
    >
    g_snprintf(option_string,MAX_OPTION_STRING,"brightness=%0.2f\n",target->brightness);
    diff -r src/options.c src/options.c
    503a504
    > GtkWidget *percent_label;
    709c710
    < brightness_hscale = gtk_hscale_new (GTK_ADJUSTMENT
    (gtk_adjustment_new (target->brightness, 0.5, 2.0, 0.01,
    0.01, 0)));
    ---
    > brightness_hscale = gtk_hscale_new (GTK_ADJUSTMENT
    (gtk_adjustment_new (target->brightness, 0, 100, 1, 1, 0)));
    716c717,724
    < gtk_scale_set_digits (GTK_SCALE (brightness_hscale), 2);
    ---
    > gtk_scale_set_digits (GTK_SCALE (brightness_hscale), 0);
    >
    > percent_label = gtk_label_new ("%");
    > gtk_widget_ref (percent_label);
    > gtk_object_set_data_full (GTK_OBJECT
    (properties_windows), "percent_label", percent_label,
    > (GtkDestroyNotify) gtk_widget_unref);
    > gtk_widget_show (percent_label);
    > gtk_box_pack_start (GTK_BOX (hbox7), percent_label,
    FALSE, FALSE, 0);
    5796,5797c5804,5805
    < "-brightness %0.2f "
    < "-gamma %f "
    ---
    > "-brightness %i "
    > "-gamma-correction %f "

     
  • Alex Butcher
    Alex Butcher
    2003-03-20

    Logged In: YES
    user_id=257968

    --- src/io.c.brightopt 2003-03-20 19:52:43.000000000 +0000
    +++ src/io.c 2003-03-20 19:53:41.000000000 +0000
    @@ -1277,7 +1277,7 @@
    target->autoframeskip = TRUE;
    target->maxautoframeskip = 8;
    target->frameskip = 0;
    - target->brightness = 100;
    + target->brightness = 1.00000;
    target->gamma_correction = 1.00000;
    target->norotate = FALSE;
    target->ror = FALSE;
    @@ -1573,7 +1573,7 @@
    target->frameskip = atoi( option_value[1]);
    } else if (!strcmp(option_value[0],"brightness"))
    {
    - target->brightness = atoi( option_value[1]);
    + target->brightness = atof( option_value[1]);
    } else if (!strcmp(option_value[0],"gamma_correction"))
    {
    target->gamma_correction = atof( option_value[1]);
    @@ -2443,7 +2443,7 @@
    fputs (option_string,options_file);

    g_snprintf(option_string,MAX_OPTION_STRING,"frameskip=%i\n",target->frameskip);
    fputs (option_string,options_file);
    -
    g_snprintf(option_string,MAX_OPTION_STRING,"brightness=%i\n",target->brightness);
    +
    g_snprintf(option_string,MAX_OPTION_STRING,"brightness=%.5f\n",target->brightness);
    fputs (option_string,options_file);

    g_snprintf(option_string,MAX_OPTION_STRING,"gamma_correction=%.5f\n",target->gamma_correction);
    fputs (option_string,options_file);
    --- src/options.c.brightopt 2003-03-20 19:22:42.000000000 +0000
    +++ src/options.c 2003-03-20 19:51:15.000000000 +0000
    @@ -700,28 +700,50 @@
    gtk_box_pack_start (GTK_BOX (correction_vbox),
    brightness_label, FALSE, FALSE, 0);
    gtk_misc_set_alignment (GTK_MISC (brightness_label), 0, 0.5);

    + brightness_hscale = gtk_hscale_new (GTK_ADJUSTMENT
    (gtk_adjustment_new (target->brightness, 0.5, 2, 0.05, 0.05,
    0)));
    + gtk_widget_ref (brightness_hscale);
    + gtk_object_set_data_full (GTK_OBJECT (properties_windows),
    "brightness_hscale", brightness_hscale,
    + (GtkDestroyNotify) gtk_widget_unref);
    + gtk_widget_show (brightness_hscale);
    + gtk_box_pack_start (GTK_BOX (correction_vbox),
    brightness_hscale, TRUE, TRUE, 0);
    + gtk_scale_set_value_pos (GTK_SCALE (brightness_hscale),
    GTK_POS_RIGHT);
    + gtk_scale_set_digits (GTK_SCALE (brightness_hscale), 2);
    +
    +/*
    + brightness_label = gtk_label_new (_("Brightness correction"));
    + gtk_widget_ref (brightness_label);
    + gtk_object_set_data_full (GTK_OBJECT (properties_windows),
    "brightness_label", brightness_label,
    + (GtkDestroyNotify) gtk_widget_unref);
    + gtk_widget_show (brightness_label);
    + gtk_box_pack_start (GTK_BOX (correction_vbox),
    brightness_label, FALSE, FALSE, 0);
    + gtk_misc_set_alignment (GTK_MISC (brightness_label), 0, 0.5);
    +
    hbox7 = gtk_hbox_new (FALSE, 0);
    gtk_widget_ref (hbox7);
    gtk_object_set_data_full (GTK_OBJECT (properties_windows),
    "hbox7", hbox7,
    (GtkDestroyNotify) gtk_widget_unref);
    gtk_widget_show (hbox7);
    gtk_box_pack_start (GTK_BOX (correction_vbox), hbox7,
    TRUE, TRUE, 0);
    + gtk_misc_set_alignment (GTK_MISC (hbox7), 0, 0.5);

    - brightness_hscale = gtk_hscale_new (GTK_ADJUSTMENT
    (gtk_adjustment_new (target->brightness, 0, 100, 1, 1, 0)));
    + brightness_hscale = gtk_hscale_new (GTK_ADJUSTMENT
    (gtk_adjustment_new (target->brightness, 0.5, 2, 0.05, 0.05,
    0)));
    gtk_widget_ref (brightness_hscale);
    gtk_object_set_data_full (GTK_OBJECT (properties_windows),
    "brightness_hscale", brightness_hscale,
    (GtkDestroyNotify) gtk_widget_unref);
    gtk_widget_show (brightness_hscale);
    gtk_box_pack_start (GTK_BOX (hbox7), brightness_hscale,
    TRUE, TRUE, 0);
    gtk_scale_set_value_pos (GTK_SCALE (brightness_hscale),
    GTK_POS_RIGHT);
    - gtk_scale_set_digits (GTK_SCALE (brightness_hscale), 0);
    + gtk_scale_set_digits (GTK_SCALE (brightness_hscale), 2);
    +*/

    +/*
    percent_label = gtk_label_new ("%");
    gtk_widget_ref (percent_label);
    gtk_object_set_data_full (GTK_OBJECT (properties_windows),
    "percent_label", percent_label,
    (GtkDestroyNotify) gtk_widget_unref);
    gtk_widget_show (percent_label);
    gtk_box_pack_start (GTK_BOX (hbox7), percent_label, FALSE,
    FALSE, 0);
    +*/

    diplay\_general\_vbox = gtk\_vbox\_new \(FALSE, 0\);
    gtk\_widget\_ref \(diplay\_general\_vbox\);
    

    @@ -5801,8 +5823,8 @@
    "-%sautoframeskip "
    "-maxautoframeskip %i "
    "-frameskip %i "
    - "-brightness %i "
    - "-gamma-correction %f "
    + "-brightness %f "
    + "-gamma %f "
    "%s " /* norotate */
    "%s " /* ror */
    "%s " /* rol */
    --- src/gxmame.h.brightopt 2003-03-20 19:31:07.000000000 +0000
    +++ src/gxmame.h 2003-03-20 19:31:18.000000000 +0000
    @@ -334,7 +334,7 @@
    gboolean autoframeskip; /* Enable/disable autoframeskip*/
    guint maxautoframeskip; /* Set highest allowed frameskip
    for autoframeskip*/
    guint frameskip; /* Set frameskip when not using
    autoframeskip (0 - 11)*/
    - guint brightness; /* Set the brightness (0-100%%)*/
    + gfloat brightness; /* Set the brightness (0-100%%)*/
    gfloat gamma_correction; /* Set the gamma-correction
    (0.5-2.0)*/
    gboolean norotate; /* Disable rotation*/
    gboolean ror; /* Rotate display 90 degrees rigth*/

     
  • Logged In: NO

    ISTR this is caused by having a brightness setting of 0.00.
    Set it to 1.00 and OK that change and things should be OK.

     
  • Logged In: NO

    yes gamma breaks it too

     
  • Logged In: YES
    user_id=507424

    This bug will be fixed in next release

     
    • labels: --> i/o
    • milestone: --> v0.31
    • priority: 5 --> 7
    • assigned_to: nobody --> shadow_walker
     
  • Logged In: NO

    You can temporarily fix this by commenting out lines 5804
    and 5805, and 5826 and 5827, in src/options.c. Those are
    the lines that generate the -brightness and
    -gamma-correction options that are output to the xmame
    command line. I did this since I never use those options,
    and now gxmame works with xmame 0.66

    Phil
    in_a_coma_dial_999@yahoo.com

     
  • Nevermind
    Nevermind
    2003-03-23

    Logged In: YES
    user_id=729045

    I can confirm that commenting lines 5804, 5805, 5826 and 5827 from options.c does the trick.
    Surprisingly enough, I lost the games count in the bottom right corner after recompiling, although I can't really imagine a relation with the source change. Maybe it's just a coincidence.

     
    • status: open --> closed