~ubuntu-branches/ubuntu/maverick/vice/maverick

« back to all changes in this revision

Viewing changes to src/arch/os2/dialogs/menubar.c

  • Committer: Bazaar Package Importer
  • Author(s): Zed Pobre
  • Date: 2005-02-01 11:30:26 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050201113026-3eyakzsmmheclvjg
Tags: 1.16-1
* New upstream version
* Fixes crash on 64-bit architectures (closes: #287640)
* x128 working again (closes: #286767)
* Works fine with /dev/dsp in use (not in the main changelog, but tested
  on my local machine as working).  Presumably, this also takes care of
  the issue with dsp being held.  I'm not sure if this is because I'm
  testing it on a 2.6 kernel now -- if you are still having problems
  with /dev/dsp, please reopen the bugs. (closes: #152952, #207942)
* Don't kill Makefile.in on clean

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
#include "machine.h"         // machine_read/write_snapshot
54
54
#include "cmdline.h"         // cmdline_show_help, include resources.h
55
55
#include "vsyncapi.h"        // vsyncarch
56
 
#include "fliplist.h"        // flip_attach_head
 
56
#include "fliplist.h"        // fliplist_attach_head
57
57
#include "cartridge.h"       // CARTRIDGE_*
58
58
#include "resources.h"       // resource_value_t
59
59
#include "interrupt.h"       // interrupt_maincpu_trigger_trap
62
62
#include "video-resources.h" // VIDEO_RESOURCE_PAL_*
63
63
 
64
64
// --------------------------------------------------------------------------
 
65
//#define VIDEO_RESOURCE_PAL_MODE_BLUR  2
 
66
//#define VIDEO_RESOURCE_PAL_MODE_SHARP 1
 
67
//#define VIDEO_RESOURCE_PAL_MODE_FAST  0
 
68
// --------------------------------------------------------------------------
65
69
 
66
70
#ifdef __XCBM__
67
71
#include "cbm2mem.h"     // cbm2_set_model
88
92
static const char *DOUBLE_SIZE="ViciiDoubleSize";
89
93
static const char *DOUBLE_SCAN="ViciiDoubleScan";
90
94
static const char *DOUBLE_SCALE2X="ViciiScale2x";
 
95
static const char *EXTERNAL_PALETTE="ViciiExternalPalette";
91
96
#endif
92
97
 
93
98
#ifdef HAVE_VIC
95
100
static const char *DOUBLE_SIZE="VicDoubleSize";
96
101
static const char *DOUBLE_SCAN="VicDoubleScan";
97
102
static const char *DOUBLE_SCALE2X="VicScale2x";
 
103
static const char *EXTERNAL_PALETTE="VicExternalPalette";
98
104
#endif
99
105
 
100
106
#ifdef HAVE_TED
102
108
static const char *DOUBLE_SIZE="TedDoubleSize";
103
109
static const char *DOUBLE_SCAN="TedDoubleScan";
104
110
static const char *DOUBLE_SCALE2X="TedScale2x";
 
111
static const char *EXTERNAL_PALETTE="TedExternalPalette";
105
112
#endif
106
113
 
107
114
#if defined HAVE_CRTC && !defined __XCBM__
335
342
    case IDM_FLIPNEXT9:
336
343
    case IDM_FLIPPREV8:
337
344
    case IDM_FLIPPREV9:
338
 
        flip_attach_head((idm>>4)&0xf, idm&1);
 
345
        fliplist_attach_head((idm>>4)&0xf, idm&1);
339
346
        return;
340
347
 
341
348
    case IDM_DEFAULTCONFIG:
382
389
        return;
383
390
 
384
391
    case IDM_INTERNALPAL:
385
 
        toggle("ExternalPalette");
 
392
        toggle(EXTERNAL_PALETTE);
386
393
        return;
387
394
#ifdef HAVE_VIC_II
388
395
    case IDM_LUMINANCES:
393
400
        {
394
401
            long val1, val2;
395
402
            resources_get_value("PALEmulation", (void *)&val1);
396
 
            resources_get_value("PALMode", (void *)&val2);
 
403
            resources_get_value("PALMode",      (void *)&val2);
397
404
            if (!val1)
398
405
            {
399
 
#ifdef HAVE_TED
400
 
                resources_set_value("PALMode", (resource_value_t*)VIDEO_RESOURCE_PAL_MODE_SHARP);
401
 
#else
402
 
                resources_set_value("PALMode", (resource_value_t*)VIDEO_RESOURCE_PAL_MODE_FAST);
403
 
#endif
 
406
                resources_set_value("PALMode",      (resource_value_t*)VIDEO_RESOURCE_PAL_MODE_FAST);
404
407
                resources_set_value("PALEmulation", (resource_value_t*)1);
405
408
                return;
406
409
            }
408
411
            switch (val2)
409
412
            {
410
413
#ifndef HAVE_TED
411
 
            case VIDEO_RESOURCE_PAL_MODE_FAST:
412
 
                resources_set_value("PALMode", (resource_value_t*)VIDEO_RESOURCE_PAL_MODE_SHARP);
 
414
            case 0:
 
415
                resources_set_value("PALMode",      (resource_value_t*)VIDEO_RESOURCE_PAL_MODE_TRUE);
413
416
                resources_set_value("PALEmulation", (resource_value_t*)1);
414
417
                return;
415
418
#endif
416
 
            case VIDEO_RESOURCE_PAL_MODE_SHARP:
417
 
                resources_set_value("PALMode", (resource_value_t*)VIDEO_RESOURCE_PAL_MODE_BLUR);
418
 
                resources_set_value("PALEmulation", (resource_value_t*)1);
419
 
                return;
420
 
            case VIDEO_RESOURCE_PAL_MODE_BLUR:
 
419
            case 1:
 
420
                resources_set_value("PALMode",      (resource_value_t*)VIDEO_RESOURCE_PAL_MODE_FAST);
421
421
                resources_set_value("PALEmulation", (resource_value_t*)0);
422
422
                return;
423
423
            }
428
428
        return;
429
429
#ifndef HAVE_TED
430
430
    case IDM_PALFAST:
431
 
        resources_set_value("PALMode", (resource_value_t*)VIDEO_RESOURCE_PAL_MODE_FAST);
 
431
        resources_set_value("PALMode",      (resource_value_t*)VIDEO_RESOURCE_PAL_MODE_FAST);
432
432
        resources_set_value("PALEmulation", (resource_value_t*)1);
433
433
        return;
434
434
#endif
435
 
    case IDM_PALSHARP:
436
 
        resources_set_value("PALMode", (resource_value_t*)VIDEO_RESOURCE_PAL_MODE_SHARP);
437
 
        resources_set_value("PALEmulation", (resource_value_t*)1);
438
 
        return;
439
 
    case IDM_PALBLUR:
440
 
        resources_set_value("PALMode", (resource_value_t*)VIDEO_RESOURCE_PAL_MODE_BLUR);
 
435
    case IDM_PALON:
 
436
        resources_set_value("PALMode",      (resource_value_t*)VIDEO_RESOURCE_PAL_MODE_TRUE);
441
437
        resources_set_value("PALEmulation", (resource_value_t*)1);
442
438
        return;
443
439
        /*
529
525
    case IDM_REU:
530
526
        toggle("REU");
531
527
        return;
532
 
 
 
528
#ifdef HAVE_TFE
533
529
    case IDM_TFE:
534
530
        toggle("ETHERNET_ACTIVE");
535
531
        return;
536
 
 
 
532
#endif
537
533
    case IDM_REU128:
538
534
    case IDM_REU256:
539
535
    case IDM_REU512:
578
574
        set_printer_res("Printer%sDriver", (idm>>4)&0xf, (resource_value_t*)"mps803");
579
575
        return;
580
576
 
 
577
    case IDM_PRT4NL10:
 
578
    case IDM_PRT5NL10:
 
579
    case IDM_PRTUPNL10:
 
580
        set_printer_res("Printer%sDriver", (idm>>4)&0xf, (resource_value_t*)"nl10");
 
581
        return;
 
582
 
581
583
    case IDM_PRT4TXT:
582
584
    case IDM_PRT5TXT:
583
585
    case IDM_PRTUPTXT:
589
591
    case IDM_PRTUPGFX:
590
592
        set_printer_res("Printer%sOutput", (idm>>4)&0xf, (resource_value_t*)"graphics");
591
593
        return;
592
 
 
 
594
/*
 
595
    case IDM_PPB0:
 
596
    case IDM_PPB1:
 
597
    case IDM_PPB2:
 
598
    case IDM_PPB3:
 
599
        resources_set_value("PixelsPerBit", (resource_value_t*)(idm&3));
 
600
        return;
 
601
*/
593
602
#if defined __X128__ || defined __XVIC__
594
603
    case IDM_IEEE:
595
604
        toggle("IEEE488");
699
708
    case IDM_RESIDFAST:
700
709
    case IDM_RESIDINTERPOL:
701
710
    case IDM_RESIDRESAMPLE:
 
711
    case IDM_RESIDFASTRES:
702
712
        resources_set_value("SidResidSampling", (resource_value_t)(idm-IDM_RESIDFAST));
703
713
        return;
704
714
 
726
736
 
727
737
    case IDM_SC6581:
728
738
    case IDM_SC8580:
729
 
        resources_set_value("SidModel", (resource_value_t)(idm&1));
 
739
    case IDM_SC8580DB:
 
740
        resources_set_value("SidModel", (resource_value_t)(idm-IDM_SC6581));
730
741
        return;
731
742
#endif // __X64__ || __X128__ || __XCBM__
732
743
 
1062
1073
        WinEnableMenuItem(hwnd, IDM_LOGWIN,  hwndLog    !=NULLHANDLE);
1063
1074
        WinEnableMenuItem(hwnd, IDM_MONITOR, hwndMonitor!=NULLHANDLE);
1064
1075
#if defined __X64__ || defined __X128__
1065
 
        resources_get_value("ExternalPalette", (void *)&val);
 
1076
        resources_get_value(EXTERNAL_PALETTE, (void *)&val);
1066
1077
        WinEnableMenuItem(hwnd, IDM_COLOR, !val);
1067
1078
#endif
1068
1079
#ifdef __XCBM__
1069
1080
        {
1070
1081
            long val1, val2;
1071
 
            resources_get_value("ExternalPalette", (void *)&val1);
 
1082
            resources_get_value(EXTERNAL_PALETTE, (void *)&val1);
1072
1083
            resources_get_value("UseVicII", (void *)&val2);
1073
1084
            WinEnableMenuItem(hwnd, IDM_COLOR, !val && val2);
1074
1085
        }
1158
1169
        WinCheckRes(hwnd, IDM_IEEE,      "IEEE488");
1159
1170
#endif // __X128__ || __XVIC__
1160
1171
#if defined __X64__ || defined __X128__
 
1172
#ifdef HAVE_TFE
1161
1173
        WinCheckRes(hwnd, IDM_TFE, "ETHERNET_ACTIVE");
 
1174
#endif
1162
1175
        resources_get_value("REU", (void *)&val);
1163
1176
        WinCheckMenuItem(hwnd,  IDM_REU,     val);
1164
1177
        WinEnableMenuItem(hwnd, IDM_REUSIZE, val);
1198
1211
            get_printer_res("Printer%sDriver", num, (resource_value_t*)&txt);
1199
1212
            WinCheckMenuItem(hwnd, IDM_PRT4ASCII  | (num<<4), !strcasecmp(txt, "ascii"));
1200
1213
            WinCheckMenuItem(hwnd, IDM_PRT4MPS803 | (num<<4), !strcasecmp(txt, "mps803"));
 
1214
            WinCheckMenuItem(hwnd, IDM_PRT4NL10   | (num<<4), !strcasecmp(txt, "nl10"));
1201
1215
        }
1202
1216
 
1203
1217
    case IDM_PRT4OUT:
1287
1301
        WinCheckMenuItem (hwnd, IDM_RESIDFAST,     val==0);
1288
1302
        WinCheckMenuItem (hwnd, IDM_RESIDINTERPOL, val==1);
1289
1303
        WinCheckMenuItem (hwnd, IDM_RESIDRESAMPLE, val==2);
 
1304
        WinCheckMenuItem (hwnd, IDM_RESIDFASTRES,  val==3);
1290
1305
        WinEnableMenuItem(hwnd, IDM_RESIDBAND,     val==2);
1291
1306
        return;
1292
1307
 
1302
1317
#if defined __X64__ || defined __X128__ || defined __XCBM__
1303
1318
    case IDM_SIDCHIP:
1304
1319
        resources_get_value("SidModel", (void *)&val);
1305
 
        WinCheckMenuItem(hwnd, IDM_SC6581, !val);
1306
 
        WinCheckMenuItem(hwnd, IDM_SC8580,  val);
 
1320
        WinCheckMenuItem(hwnd, IDM_SC6581,   val==0);
 
1321
        WinCheckMenuItem(hwnd, IDM_SC8580,   val==1);
 
1322
        WinCheckMenuItem(hwnd, IDM_SC8580DB, val==2);
1307
1323
        return;
1308
1324
#endif // __X64__ || __X128__ || __XCBM__
1309
1325
    case IDM_SOUNDSYNC:
1359
1375
        {
1360
1376
            long val1, val2;
1361
1377
 
1362
 
            resources_get_value("PALEmulation", (void *)&val1);
1363
 
            resources_get_value("ExternalPalette", (void *)&val2);
 
1378
            resources_get_value("PALEmulation",   (void *)&val1);
 
1379
            resources_get_value(EXTERNAL_PALETTE, (void *)&val2);
1364
1380
            WinEnableMenuItem(hwnd, IDM_PALEMU,      !val2);
1365
1381
            WinEnableMenuItem(hwnd, IDM_INTERNALPAL, !val1);
1366
1382
            WinEnableMenuItem(hwnd, IDM_LUMINANCES,  !val2 || val1);
1376
1392
        long val1, val2;
1377
1393
 
1378
1394
        resources_get_value("PALEmulation", (void *)&val1);
1379
 
        resources_get_value("PALMode", (void *)&val2);
 
1395
        resources_get_value("PALMode",      (void *)&val2);
1380
1396
 
1381
 
        WinCheckMenuItem(hwnd, IDM_PALOFF,   !val1);
 
1397
        WinCheckMenuItem(hwnd, IDM_PALOFF,  !val1);
1382
1398
#ifndef HAVE_TED
1383
 
        WinCheckMenuItem(hwnd, IDM_PALFAST,  val1 && val2==VIDEO_RESOURCE_PAL_MODE_FAST);
 
1399
        WinCheckMenuItem(hwnd, IDM_PALFAST, val1 && val2==VIDEO_RESOURCE_PAL_MODE_FAST);
1384
1400
#endif
1385
 
        WinCheckMenuItem(hwnd, IDM_PALSHARP, val1 && val2==VIDEO_RESOURCE_PAL_MODE_SHARP);
1386
 
        WinCheckMenuItem(hwnd, IDM_PALBLUR,  val1 && val2==VIDEO_RESOURCE_PAL_MODE_BLUR);
 
1401
        WinCheckMenuItem(hwnd, IDM_PALON,   val1 && val2==VIDEO_RESOURCE_PAL_MODE_TRUE);
1387
1402
    }
1388
1403
    return;
1389
1404
#endif