diff -NaHudr snes9x-1.43-src/0snes9x.rc snx/0snes9x.rc --- snes9x-1.43-src/0snes9x.rc 2004-12-31 00:15:55.000000000 +0200 +++ snx/0snes9x.rc 1970-01-01 02:00:00.000000000 +0200 @@ -1,1329 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" -#include "language.h" -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Cursor -// - -IDC_CURSOR_SCOPE CURSOR DISCARDABLE "nodrop.cur" - -///////////////////////////////////////////////////////////////////////////// -// -// Accelerator -// - -IDR_SNES9X_ACCELERATORS ACCELERATORS DISCARDABLE -BEGIN - "0", ID_SOUND_NOSOUND, ASCII, ALT, NOINVERT - "1", ID_SOUND_8000HZ, ASCII, ALT, NOINVERT - "2", ID_SOUND_11025HZ, ASCII, ALT, NOINVERT - "3", ID_SOUND_16000HZ, ASCII, ALT, NOINVERT - "4", ID_SOUND_22050HZ, ASCII, ALT, NOINVERT - "5", ID_SOUND_30000HZ, ASCII, ALT, NOINVERT - "6", ID_SOUND_32000HZ, ASCII, ALT, NOINVERT - "7", ID_SOUND_35000HZ, ASCII, ALT, NOINVERT - "8", ID_SOUND_44100HZ, ASCII, ALT, NOINVERT - "9", ID_SOUND_48000HZ, ASCII, ALT, NOINVERT - "A", ID_CHEAT_SEARCH, VIRTKEY, ALT, NOINVERT - "E", ID_CHEAT_ENTER, VIRTKEY, ALT, NOINVERT - "O", ID_FILE_OPEN, VIRTKEY, CONTROL, NOINVERT - "R", ID_SOUND_REVERSE_STEREO, VIRTKEY, ALT, NOINVERT - "T", ID_SOUND_OPTIONS, VIRTKEY, ALT, NOINVERT - VK_DELETE, ID_WINDOW_STRETCH, VIRTKEY, ALT, NOINVERT - VK_DELETE, ID_TURBO_R, VIRTKEY, SHIFT, NOINVERT - VK_END, ID_TURBO_B, VIRTKEY, SHIFT, NOINVERT - VK_F12, ID_SCREENSHOT, VIRTKEY, NOINVERT - VK_F5, ID_OPTIONS_DISPLAY, VIRTKEY, ALT, NOINVERT - VK_F7, ID_OPTIONS_JOYPAD, VIRTKEY, ALT, NOINVERT - VK_F8, ID_OPTIONS_SETTINGS, VIRTKEY, ALT, NOINVERT - VK_HOME, ID_TURBO_Y, VIRTKEY, SHIFT, NOINVERT - VK_INSERT, ID_TURBO_L, VIRTKEY, SHIFT, NOINVERT - VK_NEXT, ID_TURBO_A, VIRTKEY, SHIFT, NOINVERT - VK_PRIOR, ID_TURBO_X, VIRTKEY, SHIFT, NOINVERT - VK_RETURN, ID_WINDOW_FULLSCREEN, VIRTKEY, ALT, NOINVERT - "[", ID_SOUND_INTERPOLATED, ASCII, ALT, NOINVERT - "]", ID_SOUND_SYNC, ASCII, ALT, NOINVERT - "{", ID_TURBO_SELECT, ASCII, NOINVERT - "}", ID_TURBO_START, ASCII, NOINVERT -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_SOUND_OPTS DIALOGEX 0, 0, 352, 202 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_VISIBLE | - WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU -CAPTION "Sound Settings" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - GROUPBOX "Sound Quality",IDC_STATIC,7,7,168,167,0, - WS_EX_TRANSPARENT - GROUPBOX "Sound Emulation",IDC_STATIC,177,7,168,167,0, - WS_EX_TRANSPARENT - DEFPUSHBUTTON "&OK",IDOK,229,178,56,16 - COMBOBOX IDC_DRIVER,65,24,106,60,CBS_DROPDOWN | WS_VSCROLL | - WS_TABSTOP - LTEXT "Sound Driver:",IDC_STATIC,13,25,49,11 - COMBOBOX IDC_BUFLEN,65,72,106,101,CBS_DROPDOWN | WS_VSCROLL | - WS_TABSTOP - LTEXT "&Buffer Length:",IDC_STATIC,13,74,49,11 - COMBOBOX IDC_RATE,65,40,106,171,CBS_DROPDOWN | WS_VSCROLL | - WS_TABSTOP - LTEXT "&Playback Rate:",IDC_STATIC,13,41,49,11 - COMBOBOX IDC_MIX,65,56,106,154,CBS_DROPDOWN | WS_VSCROLL | - WS_TABSTOP - LTEXT "Mix Interval:",IDC_STATIC,13,57,49,11 - CONTROL "&16 Bit playback",IDC_16BIT,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,13,92,158,10 - CONTROL "&Stereo",IDC_STEREO,"Button",BS_AUTOCHECKBOX | - BS_NOTIFY | WS_TABSTOP,13,108,158,10 - CONTROL "&Reverse Stereo",IDC_REV_STEREO,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,13,124,158,10 - CONTROL "Gaussian &Interpolation of Sample Data", - IDC_LINEAR_INTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 13,140,158,10 - CONTROL "&Generate sample data in sync with sound CPU", - IDC_SYNC_TO_SOUND_CPU,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,13,156,158,10 - CONTROL "&Volume envelope height reading",IDC_ENVX,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,183,23,141,12 - CONTROL "&Echo Effects",IDC_ECHO,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,183,40,141,12 - CONTROL "&Cache decoded samples",IDC_CACHING,"Button", - BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,183,57,141,12 - CONTROL "M&aster volume control",IDC_MASTER_VOL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,183,74,141,12 - CONTROL "Enable sound CP&U emulation",IDC_SPC700ON,"Button", - BS_AUTOCHECKBOX | BS_NOTIFY | WS_TABSTOP,183,125,141,12 - CONTROL "Anti-Resonance's sample &decoding method",IDC_ANTIRES, - "Button",BS_AUTOCHECKBOX | BS_NOTIFY | WS_TABSTOP,183, - 108,157,12 - CONTROL "&Mute sound",IDC_MUTE,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,183,91,141,12 - COMBOBOX IDC_SKIP_TYPE,249,151,94,59,CBS_DROPDOWN | WS_VSCROLL | - WS_TABSTOP - LTEXT "CPU &wait skip style",IDC_STATIC,183,151,64,13 - PUSHBUTTON "&Cancel",IDCANCEL,289,178,56,16 -END - -IDD_SPC7110_CACHE DIALOG DISCARDABLE 0, 0, 185, 92 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_VISIBLE | - WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU -CAPTION "SPC7110 Pack Configuration" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "OK",IDOK,138,48,40,16 - PUSHBUTTON "Cancel",IDCANCEL,138,68,40,16 - CONTROL "Load All Data into RAM",IDC_SPC7110_ALL,"Button", - BS_AUTORADIOBUTTON,7,7,92,13 - CONTROL "Load Some Data into RAM",IDC_SPC7110_SOME,"Button", - BS_AUTORADIOBUTTON,7,26,101,13 - CONTROL "Read all data from file",IDC_SPC7110_FILE,"Button", - BS_AUTORADIOBUTTON,7,48,104,13 - EDITTEXT IDC_CACHE_MB,112,26,40,13,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "Spin1",IDC_SPIN_CACHE,"msctls_updown32",UDS_SETBUDDYINT | - UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | - UDS_NOTHOUSANDS,146,26,11,13 -END - -IDD_7110_RTC DIALOG DISCARDABLE 0, 0, 302, 148 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_CAPTION | - WS_SYSMENU -CAPTION "SPC7110 RTC Control" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "OK",IDOK,192,127,50,14 - PUSHBUTTON "Cancel",IDCANCEL,245,127,50,14 - GROUPBOX "RTC Control Registers",IDC_STATIC,7,49,288,71 - CONTROL "30 ADJ",IDC_RTC_D8,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,70,62,53,10 - CONTROL "IRQ-F",IDC_RTC_D4,"Button",BS_AUTOCHECKBOX | - WS_DISABLED | WS_TABSTOP,127,62,53,10 - CONTROL "CAL / HW",IDC_RTC_D2,"Button",BS_AUTOCHECKBOX | - WS_DISABLED | WS_TABSTOP,184,62,53,10 - CONTROL "HOLD",IDC_RTC_D1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 242,62,45,10 - CONTROL "T1",IDC_RTC_E8,"Button",BS_AUTOCHECKBOX | WS_DISABLED | - WS_TABSTOP,70,80,25,10 - CONTROL "T0",IDC_RTC_E4,"Button",BS_AUTOCHECKBOX | WS_DISABLED | - WS_TABSTOP,127,80,25,10 - CONTROL "INT/STND",IDC_RTC_E2,"Button",BS_AUTOCHECKBOX | - WS_DISABLED | WS_TABSTOP,184,80,51,10 - CONTROL "MASK",IDC_RTC_E1,"Button",BS_AUTOCHECKBOX | WS_DISABLED | - WS_TABSTOP,242,80,36,10 - CONTROL "TEST",IDC_RTC_F8,"Button",BS_AUTOCHECKBOX | WS_DISABLED | - WS_TABSTOP,70,98,35,10 - CONTROL "24/12",IDC_RTC_F4,"Button",BS_AUTOCHECKBOX | - WS_DISABLED | WS_TABSTOP,127,98,35,10 - CONTROL "STOP",IDC_RTC_F2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 184,98,35,10 - CONTROL "RESET",IDC_RTC_F1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 242,98,40,10 - LTEXT "Register 0xD",IDC_STATIC,13,62,43,8 - LTEXT "Register 0xE",IDC_STATIC,13,80,41,8 - LTEXT "Register 0xF",IDC_STATIC,13,98,42,8 - CONTROL "Slider1",IDC_DAY,"msctls_trackbar32",TBS_BOTH | - TBS_NOTICKS | WS_TABSTOP,59,20,45,8 - CONTROL "Slider2",IDC_YEAR,"msctls_trackbar32",TBS_BOTH | - TBS_NOTICKS | WS_TABSTOP,106,20,42,8 - LTEXT "1",IDC_LBLDAY,74,28,18,8 - CONTROL "Slider1",IDC_MONTH,"msctls_trackbar32",TBS_BOTH | - TBS_NOTICKS | WS_TABSTOP,7,20,51,8 - CONTROL "Slider2",IDC_HOUR,"msctls_trackbar32",TBS_BOTH | - TBS_NOTICKS | WS_TABSTOP,160,20,42,8 - CONTROL "Slider2",IDC_MINUTE,"msctls_trackbar32",TBS_BOTH | - TBS_NOTICKS | WS_TABSTOP,203,20,42,8 - CONTROL "Slider2",IDC_SECOND,"msctls_trackbar32",TBS_BOTH | - TBS_NOTICKS | WS_TABSTOP,246,20,42,8 - LTEXT "1",IDC_LBLMONTH,20,28,26,8 - LTEXT "1995",IDC_LBLYEAR,116,28,27,8 - LTEXT "Month",IDC_STATIC,20,7,21,8 - LTEXT "Day",IDC_STATIC,71,7,14,8 - LTEXT "Year",IDC_STATIC,117,7,16,8 - LTEXT "Hour",IDC_STATIC,172,7,16,8 - LTEXT "Minute",IDC_STATIC,210,7,22,8 - LTEXT "Second",IDC_STATIC,252,7,26,8 - LTEXT "0",IDC_LBLHOUR,173,29,19,8 - LTEXT "0",IDC_LBLMINUTE,219,29,17,8 - LTEXT "0",IDC_LBLSECOND,257,28,18,8 -END - -IDD_ROM_INFO DIALOG DISCARDABLE 0, 0, 233, 185 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_CLIPCHILDREN | - WS_CAPTION | WS_SYSMENU -CAPTION "Rom Info" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "OK",IDOK,85,164,50,14 - EDITTEXT IDC_ROM_DATA,7,7,219,146,ES_MULTILINE | ES_READONLY - LTEXT "",IDC_WARNINGS,7,145,219,15,SS_CENTERIMAGE -END - -IDD_ABOUT DIALOGEX 0, 0, 232, 181 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_CLIPCHILDREN | - WS_CAPTION | WS_SYSMENU -CAPTION "APP - About Dialog" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,90,160,50,14 - EDITTEXT IDC_DISCLAIMER,7,7,218,148,ES_MULTILINE | ES_NOHIDESEL | - ES_READONLY,WS_EX_STATICEDGE -END - -IDD_EMU_SETTINGS DIALOG DISCARDABLE 0, 0, 320, 113 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_CLIPCHILDREN | - WS_CAPTION | WS_SYSMENU -CAPTION "APP - Emulator Settings" -FONT 8, "MS Sans Serif" -BEGIN - EDITTEXT IDC_FREEZE_FOLDER,91,6,163,14,ES_AUTOHSCROLL - PUSHBUTTON "&Browse...",IDC_BROWSE,264,5,48,14 - EDITTEXT IDC_AUTO_SAVE_DELAY,91,25,49,14,ES_AUTOHSCROLL | - ES_NUMBER - CONTROL "Spin2",IDC_SRAM_SPIN,"msctls_updown32",UDS_SETBUDDYINT | - UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,302,29,11, - 13 - EDITTEXT IDC_MAX_SKIP,91,44,49,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "Spin3",IDC_SPIN_MAX_SKIP,"msctls_updown32", - UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | - UDS_ARROWKEYS,298,48,11,13 - EDITTEXT IDC_TURBO_SKIP,91,63,49,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "Spin4",IDC_SPIN_TURBO_SKIP,"msctls_updown32", - UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | - UDS_ARROWKEYS,296,72,11,13 - CONTROL "Toggled Turbo Mode",IDC_TOGGLE_TURBO,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,91,82,88,12 - PUSHBUTTON "&OK",IDOK,215,92,46,14 - DEFPUSHBUTTON "&Cancel",IDCANCEL,267,92,46,14 - RTEXT "Freeze Folder Directory",IDC_LABEL_FREEZE,7,7,76,14, - SS_CENTERIMAGE - RTEXT "Auto-Save S-RAM",IDC_LABEL_ASRAM,19,25,64,14, - SS_CENTERIMAGE - RTEXT "Skip at most",IDC_LABEL_SMAX,38,44,45,14,SS_CENTERIMAGE - RTEXT "Skip rendering",IDC_LABEL_STURBO,32,63,51,14, - SS_CENTERIMAGE - LTEXT "seconds after last change (0 disables auto-save)", - IDC_LABEL_ASRAM_TEXT,146,25,161,14,SS_CENTERIMAGE - LTEXT "frames in auto-frame rate mode",IDC_LABEL_SMAX_TEXT,146, - 44,138,14,SS_CENTERIMAGE - LTEXT "frames in Turbo mode",IDC_LABEL_STURBO_TEXT,146,63,92, - 14,SS_CENTERIMAGE -END - -IDD_OPEN_ROM DIALOGEX 0, 0, 416, 223 -STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | - WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | - WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU -CAPTION "Open ROM" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - CONTROL "Tree1",IDC_ROM_DIR,"SysTreeView32",TVS_HASBUTTONS | - TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | - TVS_SHOWSELALWAYS | TVS_NOTOOLTIPS | WS_BORDER | - WS_TABSTOP,4,4,164,192,WS_EX_CLIENTEDGE - CONTROL "List1",IDC_ROMLIST,"SysListView32",LVS_REPORT | - LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | - LVS_OWNERDATA | WS_TABSTOP,171,4,239,192, - WS_EX_CLIENTEDGE - COMBOBOX IDC_MEM_TYPE,5,208,66,57,CBS_DROPDOWN | WS_TABSTOP - COMBOBOX IDC_INTERLEAVE,85,208,89,64,CBS_DROPDOWN | WS_TABSTOP - COMBOBOX IDC_VIDEO_MODE,182,208,58,61,CBS_DROPDOWN | WS_TABSTOP - COMBOBOX IDC_HEADER,246,208,73,44,CBS_DROPDOWN | WS_TABSTOP - DEFPUSHBUTTON "&Open ROM",IDOK,325,205,44,15 - PUSHBUTTON "&Cancel",IDCANCEL,370,205,44,15 - LTEXT "Interleave Mode:",IDC_STATIC,85,196,69,8,NOT WS_GROUP - LTEXT "Memory Type:",IDC_STATIC,5,196,58,11,NOT WS_GROUP - LTEXT "Video System:",IDC_STATIC,181,196,54,8,NOT WS_GROUP - LTEXT "Header:",IDC_STATIC,246,196,54,8,NOT WS_GROUP -END - -IDD_GFX_PACK DIALOG DISCARDABLE 0, 0, 219, 260 -STYLE DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_VISIBLE | - WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "Graphics Pack Configuration" -FONT 8, "MS Sans Serif" -BEGIN - EDITTEXT IDC_STAR_OCEAN,1,20,170,13,ES_AUTOHSCROLL - LTEXT "Star Ocean",IDC_STATIC,1,6,80,12 - PUSHBUTTON "Browse...",IDC_SO_BROWSE,173,18,45,14 - EDITTEXT IDC_FEOEZ,1,49,171,13,ES_AUTOHSCROLL - LTEXT "Far East of Eden Zero",IDC_STATIC,1,36,80,12 - PUSHBUTTON "Browse...",IDC_FEOEZ_BROWSE,173,47,45,14 - EDITTEXT IDC_MDH,1,78,170,13,ES_AUTOHSCROLL - LTEXT "Momotaro Densetsu Happy",IDC_STATIC,1,65,114,12 - PUSHBUTTON "Browse...",IDC_MDH_BROWSE,173,76,45,14 - EDITTEXT IDC_SPL4,1,106,170,13,ES_AUTOHSCROLL - LTEXT "Super Power League 4",IDC_STATIC,1,94,80,12 - PUSHBUTTON "Browse...",IDC_SPL4_BROWSE,173,105,45,14 - EDITTEXT IDC_SJNS,1,135,170,13,ES_AUTOHSCROLL - LTEXT "Far East of Eden Zero - Shounen Jump no Shou", - IDC_STATIC,1,122,166,12 - PUSHBUTTON "Browse...",IDC_FEOEZ_SJNS_BROWSE,173,134,45,14 - EDITTEXT IDC_SFA2,1,164,170,13,ES_AUTOHSCROLL - LTEXT "Street Fighter Alpha 2 (US)",IDC_STATIC,1,151,104,12 - PUSHBUTTON "Browse...",IDC_SFA2_BROWSE,173,164,45,14 - EDITTEXT IDC_SFA2E,1,193,170,13,ES_AUTOHSCROLL - LTEXT "Street Fighter Alpha 2 (E)",IDC_STATIC,1,180,80,12 - PUSHBUTTON "Browse...",IDC_SFA2E_BROWSE,173,193,45,14 - EDITTEXT IDC_SFZ2,1,225,170,13,ES_AUTOHSCROLL - LTEXT "Street Fighter Zero 2",IDC_STATIC,1,212,80,12 - PUSHBUTTON "Browse...",IDC_SFZ2_BROWSE,173,225,45,14 - PUSHBUTTON "OK",IDOK,133,244,40,14 - PUSHBUTTON "Cancel",IDCANCEL,178,244,40,14 -END - -IDD_NPOPTIONS DIALOGEX 0, 0, 187, 161 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_CLIPCHILDREN | - WS_CAPTION -CAPTION "Netplay Options" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - GROUPBOX "Port Settings",IDC_PORTNUMBLOCK,5,5,180,25,0, - WS_EX_TRANSPARENT - RTEXT "Socket Port Number",IDC_LABEL_PORTNUM,10,15,85,10, - SS_CENTERIMAGE - EDITTEXT IDC_PORTNUMBERA,100,15,25,12,ES_RIGHT | ES_AUTOHSCROLL - GROUPBOX "Client Settings",IDC_CLIENTSETTINGSBLOCK,5,35,180,40,0, - WS_EX_TRANSPARENT - RTEXT "Ask Server to Pause when",IDC_LABEL_PAUSEINTERVAL,10,45, - 85,10,SS_CENTERIMAGE - EDITTEXT IDC_PAUSEINTERVAL,100,45,30,12,ES_RIGHT | ES_AUTOHSCROLL - CONTROL "Spin1",IDC_PAUSESPIN,"msctls_updown32",UDS_SETBUDDYINT | - UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | - UDS_NOTHOUSANDS | WS_TABSTOP,120,45,10,12 - LTEXT "frames behind",IDC_LABEL_PAUSEINTERVAL_TEXT,135,45,45, - 12,SS_CENTERIMAGE - RTEXT "Maximum Frame Rate Skip",IDC_LABEL_MAXSKIP,10,60,85,10, - SS_CENTERIMAGE - EDITTEXT IDC_MAXSKIP,100,60,30,12,ES_RIGHT | ES_AUTOHSCROLL - CONTROL "Spin2",IDC_MAXSPIN,"msctls_updown32",UDS_SETBUDDYINT | - UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | - UDS_NOTHOUSANDS | WS_TABSTOP,120,60,10,12 - GROUPBOX "Server Settings",IDC_SERVERSETTINGSBLOCK,5,80,180,60,0, - WS_EX_TRANSPARENT - CONTROL "Send ROM Image to Client on Connect",IDC_SENDROM,"Button", - BS_AUTOCHECKBOX | BS_LEFT | BS_VCENTER | WS_TABSTOP,10, - 105,173,15 - CONTROL "Act as Server",IDC_ACTASSERVER,"Button",BS_AUTOCHECKBOX | - BS_LEFT | BS_VCENTER | WS_TABSTOP,10,120,174,15 - DEFPUSHBUTTON "OK",IDOK,80,145,50,14 - PUSHBUTTON "Cancel",IDCANCEL,135,145,50,14 - CONTROL "Sync By Reset",IDC_SYNCBYRESET,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,10,90,174,15 -END - -IDD_NEWDISPLAY DIALOGEX 0, 0, 337, 175 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_CLIPCHILDREN | - WS_CAPTION -CAPTION "Display Settings" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,5,160,50,14 - PUSHBUTTON "Cancel",IDCANCEL,60,160,50,14 - PUSHBUTTON "Test Mode",IDC_TESTMODE,290,140,39,14 - PUSHBUTTON "Set Mode",IDC_SETDMODE,290,160,39,14 - CONTROL "List1",IDC_VIDMODELIST,"SysListView32",LVS_REPORT | - WS_BORDER | WS_TABSTOP,185,15,145,120 - GROUPBOX "General",IDC_STATIC,3,5,82,55,0,WS_EX_TRANSPARENT - CONTROL "Show Frame Rate",IDC_SHOWFPS,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,35,73,10 - CONTROL "Stretch Image",IDC_STRETCH,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,45,60,10 - CONTROL "Full Screen",IDC_FULLSCREEN,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,15,51,10 - CONTROL "Bi-Linear Mode 7",IDC_BILINEARMD7,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,5,25,69,10 - GROUPBOX "SNES Image",IDC_STATIC,95,5,75,55,0,WS_EX_TRANSPARENT - CONTROL "Render 16-bit",IDC_RENDER16BIT,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,100,15,59,10 - CONTROL "Transparency",IDC_TRANS,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,100,25,59,10 - CONTROL "Hi Res",IDC_HIRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 100,35,37,10 - GROUPBOX "Output Image Processing",IDC_STATIC,0,60,170,30,0, - WS_EX_TRANSPARENT - COMBOBOX IDC_FILTERBOX,5,70,160,90,CBS_DROPDOWN | WS_VSCROLL | - WS_TABSTOP - CONTROL "Automatic Frame Skipping",IDC_AUTOFRAME,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,5,95,98,10 - CONTROL "Use Frame Rate Limiter",IDC_LIMITFRAMES,"Button", - BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,5,105,89,10 - GROUPBOX "Fixed Frame Skipping Rate",IDC_STATIC,0,115,170,40,0, - WS_EX_TRANSPARENT - CONTROL "Slider2",IDC_FRAMERATESKIPSLIDER,"msctls_trackbar32", - TBS_AUTOTICKS | WS_TABSTOP,7,134,160,19 - GROUPBOX "Display Settings",IDC_STATIC,180,5,155,170,0, - WS_EX_TRANSPARENT - CONTROL "Enable Double Buffering",IDC_DBLBUFFER,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,185,140,93,10 - LTEXT "Current Mode: 1024x1024x16",IDC_CURRMODE,185,155,94,8 - LTEXT "0",IDC_STATIC,14,126,11,8 - RTEXT "9",IDC_STATIC,148,126,11,8 -END - -IDD_CHEATER DIALOGEX 0, 0, 262, 218 -STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | - WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | - WS_SYSMENU -CAPTION "Cheat Entry and Editor" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - CONTROL "List1",IDC_CHEAT_LIST,"SysListView32",LVS_REPORT | - LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | - WS_BORDER | WS_TABSTOP,5,5,200,125,WS_EX_CLIENTEDGE - PUSHBUTTON "&Add",IDC_ADD_CHEAT,215,5,40,15,WS_DISABLED - PUSHBUTTON "&Delete",IDC_DELETE_CHEAT,215,25,40,15,WS_DISABLED - PUSHBUTTON "&Update",IDC_UPDATE_CHEAT,215,45,40,15,WS_DISABLED - PUSHBUTTON "C&lear",IDC_CLEAR_CHEATS,215,65,40,15 - EDITTEXT IDC_CHEAT_CODE,86,134,118,15,ES_UPPERCASE | - ES_AUTOHSCROLL - EDITTEXT IDC_CHEAT_DESCRIPTION,85,154,119,15,ES_AUTOHSCROLL - EDITTEXT IDC_CHEAT_ADDRESS,85,175,44,15,ES_UPPERCASE | - ES_AUTOHSCROLL - EDITTEXT IDC_CHEAT_BYTE,215,175,26,15,ES_UPPERCASE | - ES_AUTOHSCROLL - PUSHBUTTON "&OK",IDOK,93,196,50,15 - PUSHBUTTON "&Cancel",IDCANCEL,151,196,50,15 - RTEXT "Enter Cheat Code:",IDC_LABEL_CHEAT_CODE,23,134,59,15, - SS_CENTERIMAGE - RTEXT "Cheat Description",IDC_LABEL_CHEAT_DESCRIPTION,19,154, - 61,15,SS_CENTERIMAGE - RTEXT "Cheat Address (hex)",IDC_LABEL_CHEAT_ADDRESS,18,175,64, - 15,SS_CENTERIMAGE - RTEXT "New Value (dec or hex)",IDC_LABEL_CHEAT_BYTE,134,175,74, - 15,SS_CENTERIMAGE -END - -IDD_NETPLAYPROGRESS DIALOG DISCARDABLE 0, 0, 186, 61 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Dialog" -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "Static",IDC_STATIC,5,0,160,20 - CONTROL "Progress1",IDC_NPPROGRESS,"msctls_progress32",WS_BORDER, - 5,30,160,25 -END - -IDD_INPUTCONFIG DIALOGEX 0, 0, 299, 127 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_CLIPCHILDREN | - WS_CAPTION -CAPTION "Input Config" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - COMBOBOX IDC_JPCOMBO,0,0,70,60,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "Disabled",IDC_JPTOGGLE,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,75,2,42,10 - CONTROL "WOG!",IDC_UP,"InputCustom",WS_TABSTOP,30,20,71,12, - WS_EX_CLIENTEDGE - CONTROL "",IDC_LEFT,"InputCustom",WS_TABSTOP,30,33,71,12, - WS_EX_CLIENTEDGE - CONTROL "",IDC_DOWN,"InputCustom",WS_TABSTOP,30,46,71,12, - WS_EX_CLIENTEDGE - CONTROL "",IDC_RIGHT,"InputCustom",WS_TABSTOP,30,59,71,12, - WS_EX_CLIENTEDGE - CONTROL "",IDC_B,"InputCustom",WS_TABSTOP,30,72,71,12, - WS_EX_CLIENTEDGE - CONTROL "",IDC_A,"InputCustom",WS_TABSTOP,30,85,71,12, - WS_EX_CLIENTEDGE - CONTROL "",IDC_Y,"InputCustom",WS_TABSTOP,30,98,71,12, - WS_EX_CLIENTEDGE - CONTROL "",IDC_X,"InputCustom",WS_TABSTOP,30,111,71,12, - WS_EX_CLIENTEDGE - CONTROL " ",IDC_START,"InputCustom",WS_TABSTOP,142,20,71,12, - WS_EX_CLIENTEDGE - CONTROL " ",IDC_SELECT,"InputCustom",WS_TABSTOP,142,33,71,12, - WS_EX_CLIENTEDGE - CONTROL " ",IDC_L,"InputCustom",WS_TABSTOP,142,46,71,12, - WS_EX_CLIENTEDGE - CONTROL " ",IDC_R,"InputCustom",WS_TABSTOP,142,59,71,12, - WS_EX_CLIENTEDGE - CONTROL " ",IDC_UPLEFT,"InputCustom",WS_DISABLED | WS_TABSTOP, - 142,72,71,12,WS_EX_CLIENTEDGE - CONTROL " ",IDC_UPRIGHT,"InputCustom",WS_DISABLED | WS_TABSTOP, - 142,85,71,12,WS_EX_CLIENTEDGE - CONTROL " ",IDC_DWNRIGHT,"InputCustom",WS_DISABLED | WS_TABSTOP, - 142,98,71,12,WS_EX_CLIENTEDGE - CONTROL " ",IDC_DWNLEFT,"InputCustom",WS_DISABLED | WS_TABSTOP, - 142,111,71,12,WS_EX_CLIENTEDGE - PUSHBUTTON "Toggle Diagonals",IDC_DIAGTOGGLE,216,95,80,15 - PUSHBUTTON "Cancel",IDCANCEL,216,111,39,14 - PUSHBUTTON "OK",IDOK,256,111,40,14 - LTEXT "Blue means the current key/button is already mapped; Red means its in use by windows or is in use by Snes9x", - IDC_LABEL_BLUE,120,0,179,19 - RTEXT "UP",IDC_LABEL_UP,2,23,24,8 - RTEXT "DILDO",IDC_LABEL_RIGHT,2,62,23,8 - RTEXT "LEFT",IDC_LABEL_LEFT,2,36,24,8 - RTEXT "DOWN",IDC_LABEL_DOWN,2,49,24,8 - RTEXT "A",IDC_LABEL_A,2,87,24,8 - RTEXT "X",IDC_LABEL_X,2,114,24,8 - RTEXT "B",IDC_LABEL_B,2,75,24,8 - RTEXT "Y",IDC_LABEL_Y,2,101,24,8 - RTEXT "L",IDC_LABEL_L,115,48,24,8 - RTEXT "START",IDC_LABEL_START,115,22,24,8 - RTEXT "R",IDC_LABEL_R,115,61,24,8 - RTEXT "SELECT",IDC_LABEL_SELECT,111,35,28,8 - RTEXT "UP LEFT",IDC_LABEL_UPLEFT,109,75,30,8 - RTEXT "DN RIGHT",IDC_LABEL_DOWNRIGHT,103,101,36,8 - RTEXT "UP RIGHT",IDC_LABEL_UPRIGHT,103,88,36,8 - RTEXT "DN LEFT",IDC_LABEL_DOWNLEFT,108,114,31,8 - CONTROL 133,IDC_STATIC,"Static",SS_BITMAP,215,20,80,74 -END - -IDD_CHEAT_SEARCH DIALOGEX 0, 0, 273, 271 -STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | WS_VISIBLE | - WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU -CAPTION "Cheat Search" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "&OK",IDOK,161,250,50,14 - PUSHBUTTON "&Cancel",IDCANCEL,216,250,50,14 - CONTROL "List1",IDC_ADDYS,"SysListView32",LVS_REPORT | - LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_OWNERDATA | - WS_BORDER | WS_TABSTOP,7,7,201,152,WS_EX_CLIENTEDGE - PUSHBUTTON "&Search",IDC_C_SEARCH,214,7,52,16 - PUSHBUTTON "&Add Cheat",IDC_C_ADD,214,29,52,16,WS_DISABLED - PUSHBUTTON "&Reset",IDC_C_RESET,214,51,52,16 - CONTROL "1 byte",IDC_1_BYTE,"Button",BS_AUTORADIOBUTTON | - WS_GROUP | WS_TABSTOP,211,172,42,11 - CONTROL "2 bytes",IDC_2_BYTE,"Button",BS_AUTORADIOBUTTON,211,185, - 42,11 - CONTROL "3 bytes",IDC_3_BYTE,"Button",BS_AUTORADIOBUTTON,211,198, - 42,11 - CONTROL "4 bytes",IDC_4_BYTE,"Button",BS_AUTORADIOBUTTON,211,211, - 42,11 - GROUPBOX "Data Size",IDC_STATIC,204,162,54,66,0,WS_EX_TRANSPARENT - GROUPBOX "Comparison Type",IDC_STATIC,7,162,114,78,0, - WS_EX_TRANSPARENT - CONTROL "< (Less Than)",IDC_LESS_THAN,"Button", - BS_AUTORADIOBUTTON | WS_GROUP,13,170,90,11 - CONTROL "> (Greater Than)",IDC_GREATER_THAN,"Button", - BS_AUTORADIOBUTTON,13,181,90,11 - CONTROL "<= (Less Than or Equal to)",IDC_LESS_THAN_EQUAL,"Button", - BS_AUTORADIOBUTTON,13,192,106,11 - CONTROL ">= (Greater than or Equal To)",IDC_GREATER_THAN_EQUAL, - "Button",BS_AUTORADIOBUTTON,13,203,105,11 - CONTROL "= (Equal To)",IDC_EQUAL,"Button",BS_AUTORADIOBUTTON,13, - 214,90,11 - CONTROL "!= (Not Equal To)",IDC_NOT_EQUAL,"Button", - BS_AUTORADIOBUTTON,13,225,90,11 - GROUPBOX "Data Type",IDC_STATIC,125,197,75,40,0,WS_EX_TRANSPARENT - GROUPBOX "Compare To",IDC_STATIC,125,162,75,32,0, - WS_EX_TRANSPARENT - CONTROL "Previous Value",IDC_PREV,"Button",BS_AUTORADIOBUTTON | - WS_GROUP,129,171,67,10 - CONTROL "Entered Value",IDC_ENTERED,"Button",BS_AUTORADIOBUTTON, - 129,182,67,10 - CONTROL "Unsigned (>=0)",IDC_UNSIGNED,"Button", - BS_AUTORADIOBUTTON | WS_GROUP,129,205,67,10 - CONTROL "Signed (+/-)",IDC_SIGNED,"Button",BS_AUTORADIOBUTTON, - 129,215,67,10 - CONTROL "Hexadecimal",IDC_HEX,"Button",BS_AUTORADIOBUTTON,129, - 225,67,10 - EDITTEXT IDC_VALUE_ENTER,72,250,83,12,ES_UPPERCASE | - ES_AUTOHSCROLL | WS_DISABLED - RTEXT "Enter a Value:",IDC_ENTER_LABEL,7,250,54,12, - SS_CENTERIMAGE | WS_DISABLED -END - -IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 271, 68 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Dialog" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "OK",IDOK,221,52,50,14 - PUSHBUTTON "Cancel",IDCANCEL,169,52,50,14 - COMBOBOX IDC_COMBO1,25,7,188,12,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP -END - -IDD_CHEAT_FROM_SEARCH DIALOG DISCARDABLE 0, 0, 187, 143 -STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | - WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | - WS_SYSMENU -CAPTION "Cheat Details" -FONT 8, "MS Sans Serif" -BEGIN - PUSHBUTTON "&OK",IDOK,85,123,45,13 - PUSHBUTTON "&Cancel",IDCANCEL,135,123,45,13 - EDITTEXT IDC_NC_ADDRESS,79,7,101,12,ES_AUTOHSCROLL - EDITTEXT IDC_NC_CURRVAL,79,31,101,12,ES_AUTOHSCROLL - EDITTEXT IDC_NC_PREVVAL,79,55,101,12,ES_AUTOHSCROLL - EDITTEXT IDC_NC_NEWVAL,79,79,101,12,ES_AUTOHSCROLL - EDITTEXT IDC_NC_DESC,79,103,101,12,ES_AUTOHSCROLL - RTEXT "Address",IDC_STATIC,7,7,70,12,SS_CENTERIMAGE - RTEXT "Current Value",IDC_STATIC,7,31,70,12,SS_CENTERIMAGE - RTEXT "Previous Value",IDC_STATIC,7,55,70,12,SS_CENTERIMAGE - RTEXT "New Value",IDC_STATIC,7,79,70,12,SS_CENTERIMAGE - RTEXT "Description",IDC_STATIC,7,103,70,12,SS_CENTERIMAGE -END - -IDD_OPENMOVIE DIALOG DISCARDABLE 0, 0, 303, 214 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Play Movie" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "OK",IDOK,187,193,50,14 - PUSHBUTTON "Cancel",IDCANCEL,246,193,50,14 - EDITTEXT IDC_MOVIE_PATH,7,18,230,13,ES_AUTOHSCROLL - LTEXT "Movie File",IDC_STATIC,7,7,33,8 - PUSHBUTTON "&Browse...",IDC_BROWSE_MOVIE,248,17,48,14 - GROUPBOX "Record Options",IDC_STATIC,7,129,91,54 - CONTROL "Record from now",IDC_RECORD_NOW,"Button", - BS_AUTORADIOBUTTON | WS_DISABLED | WS_GROUP | WS_TABSTOP, - 14,144,70,10 - CONTROL "Record from reset",IDC_RECORD_RESET,"Button", - BS_AUTORADIOBUTTON | WS_DISABLED | WS_TABSTOP,14,154,72, - 10 - CONTROL "Joypad 1",IDC_JOY1,"Button",BS_AUTOCHECKBOX | - WS_DISABLED | WS_TABSTOP,127,144,45,10 - CONTROL "Joypad 3",IDC_JOY3,"Button",BS_AUTOCHECKBOX | - WS_DISABLED | WS_TABSTOP,127,164,45,10 - CONTROL "Joypad 2",IDC_JOY2,"Button",BS_AUTOCHECKBOX | - WS_DISABLED | WS_TABSTOP,127,154,45,10 - CONTROL "Joypad 4",IDC_JOY4,"Button",BS_AUTOCHECKBOX | - WS_DISABLED | WS_TABSTOP,181,144,45,10 - CONTROL "Joypad 5",IDC_JOY5,"Button",BS_AUTOCHECKBOX | - WS_DISABLED | WS_TABSTOP,181,154,45,10 - GROUPBOX "Record Controllers",IDC_STATIC,118,129,120,54 - LTEXT "Recording Date:",IDC_STATIC,15,51,53,8 - LTEXT "Length:",IDC_STATIC,43,60,25,8 - LTEXT "Frames:",IDC_STATIC,43,69,26,8 - LTEXT "Re-record Count:",IDC_STATIC,13,78,55,8 - LTEXT "DATE",IDC_MOVIE_DATE,71,51,81,8 - LTEXT "LENGTH",IDC_MOVIE_LENGTH,71,60,81,8 - LTEXT "FRAMES",IDC_MOVIE_FRAMES,71,69,81,8 - LTEXT "RERECORD",IDC_MOVIE_RERECORD,71,78,81,8 - LTEXT "Author Info:",IDC_STATIC,30,95,38,8 - CONTROL "Open Read-Only",IDC_READONLY,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,7,35,69,10 - LTEXT "Static",IDC_MOVIE_METADATA,70,95,226,21,WS_BORDER -END - -IDD_CREATEMOVIE DIALOGEX 0, 0, 303, 150 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Record Movie" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,187,129,50,14 - PUSHBUTTON "Cancel",IDCANCEL,246,129,50,14 - EDITTEXT IDC_MOVIE_PATH,7,18,230,13,ES_AUTOHSCROLL - LTEXT "Movie File",IDC_STATIC,7,7,33,8 - PUSHBUTTON "&Browse...",IDC_BROWSE_MOVIE,248,17,48,14 - GROUPBOX "Record Options",IDC_STATIC,7,44,91,51 - CONTROL "Record from now",IDC_RECORD_NOW,"Button", - BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,14,57,70,10 - CONTROL "Record from reset",IDC_RECORD_RESET,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,14,68,72,10 - CONTROL "Joypad 1",IDC_JOY1,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,127,57,45,10 - CONTROL "Joypad 3",IDC_JOY3,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,127,79,45,10 - CONTROL "Joypad 2",IDC_JOY2,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,127,68,45,10 - CONTROL "Joypad 4",IDC_JOY4,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,181,57,45,10 - CONTROL "Joypad 5",IDC_JOY5,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,181,68,45,10 - GROUPBOX "Record Controllers",IDC_STATIC,118,44,120,51 - EDITTEXT IDC_MOVIE_METADATA,67,105,229,14,ES_AUTOHSCROLL - LTEXT "Author Info:",IDC_STATIC,18,108,43,8,0,WS_EX_RIGHT -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog Info -// - -IDD_SOUND_OPTS DLGINIT -BEGIN - IDC_DRIVER, 0x403, 19, 0 -0x6e53, 0x7365, 0x7839, 0x4420, 0x7269, 0x6365, 0x5374, 0x756f, 0x646e, -"\000" - IDC_DRIVER, 0x403, 17, 0 -0x4d46, 0x444f, 0x4420, 0x7269, 0x6365, 0x5374, 0x756f, 0x646e, "\000" - IDC_DRIVER, 0x403, 24, 0 -0x4d46, 0x444f, 0x5720, 0x6e69, 0x6f64, 0x7377, 0x4d20, 0x6c75, 0x6974, -0x656d, 0x6964, 0x0061, - IDC_DRIVER, 0x403, 9, 0 -0x4d46, 0x444f, 0x4120, 0x4433, "\000" - IDC_BUFLEN, 0x403, 6, 0 -0x3031, 0x6d20, 0x0073, - IDC_BUFLEN, 0x403, 6, 0 -0x3032, 0x6d20, 0x0073, - IDC_BUFLEN, 0x403, 6, 0 -0x3034, 0x6d20, 0x0073, - IDC_BUFLEN, 0x403, 6, 0 -0x3038, 0x6d20, 0x0073, - IDC_BUFLEN, 0x403, 7, 0 -0x3631, 0x2030, 0x736d, "\000" - IDC_BUFLEN, 0x403, 7, 0 -0x3233, 0x2030, 0x736d, "\000" - IDC_BUFLEN, 0x403, 7, 0 -0x3436, 0x2030, 0x736d, "\000" - IDC_RATE, 0x403, 11, 0 -0x4e3c, 0x206f, 0x6f53, 0x6e75, 0x3e64, "\000" - IDC_RATE, 0x403, 8, 0 -0x2038, 0x2020, 0x484b, 0x007a, - IDC_RATE, 0x403, 7, 0 -0x3131, 0x4b20, 0x7a48, "\000" - IDC_RATE, 0x403, 7, 0 -0x3631, 0x4b20, 0x7a48, "\000" - IDC_RATE, 0x403, 7, 0 -0x3232, 0x4b20, 0x7a48, "\000" - IDC_RATE, 0x403, 7, 0 -0x3033, 0x4b20, 0x7a48, "\000" - IDC_RATE, 0x403, 7, 0 -0x3533, 0x4b20, 0x7a48, "\000" - IDC_RATE, 0x403, 7, 0 -0x3434, 0x4b20, 0x7a48, "\000" - IDC_RATE, 0x403, 7, 0 -0x3834, 0x4b20, 0x7a48, "\000" - IDC_MIX, 0x403, 6, 0 -0x3031, 0x6d20, 0x0073, - IDC_MIX, 0x403, 6, 0 -0x3032, 0x6d20, 0x0073, - IDC_MIX, 0x403, 6, 0 -0x3033, 0x6d20, 0x0073, - IDC_MIX, 0x403, 6, 0 -0x3034, 0x6d20, 0x0073, - IDC_MIX, 0x403, 6, 0 -0x3035, 0x6d20, 0x0073, - IDC_MIX, 0x403, 6, 0 -0x3036, 0x6d20, 0x0073, - IDC_MIX, 0x403, 6, 0 -0x3037, 0x6d20, 0x0073, - IDC_MIX, 0x403, 6, 0 -0x3038, 0x6d20, 0x0073, - IDC_MIX, 0x403, 6, 0 -0x3039, 0x6d20, 0x0073, - IDC_MIX, 0x403, 7, 0 -0x3031, 0x2030, 0x736d, "\000" - IDC_MIX, 0x403, 7, 0 -0x3131, 0x2030, 0x736d, "\000" - IDC_MIX, 0x403, 7, 0 -0x3231, 0x2030, 0x736d, "\000" - IDC_MIX, 0x403, 7, 0 -0x3331, 0x2030, 0x736d, "\000" - IDC_MIX, 0x403, 7, 0 -0x3431, 0x2030, 0x736d, "\000" - IDC_MIX, 0x403, 7, 0 -0x3531, 0x2030, 0x736d, "\000" - IDC_SKIP_TYPE, 0x403, 15, 0 -0x6b53, 0x7069, 0x6d20, 0x7465, 0x6f68, 0x2064, 0x3123, "\000" - IDC_SKIP_TYPE, 0x403, 15, 0 -0x6b53, 0x7069, 0x6d20, 0x7465, 0x6f68, 0x2064, 0x3223, "\000" - IDC_SKIP_TYPE, 0x403, 15, 0 -0x6b53, 0x7069, 0x6d20, 0x7465, 0x6f68, 0x2064, 0x3323, "\000" - IDC_SKIP_TYPE, 0x403, 15, 0 -0x6b53, 0x7069, 0x6d20, 0x7465, 0x6f68, 0x2064, 0x3423, "\000" - IDC_SKIP_TYPE, 0x403, 15, 0 -0x6b53, 0x7069, 0x6d20, 0x7465, 0x6f68, 0x2064, 0x3523, "\000" - 0 -END - -IDD_INPUTCONFIG DLGINIT -BEGIN - IDC_JPCOMBO, 0x403, 10, 0 -0x6f4a, 0x7079, 0x6461, 0x2320, 0x0031, - IDC_JPCOMBO, 0x403, 10, 0 -0x6f4a, 0x7079, 0x6461, 0x2320, 0x0032, - IDC_JPCOMBO, 0x403, 10, 0 -0x6f4a, 0x7079, 0x6461, 0x2320, 0x0033, - IDC_JPCOMBO, 0x403, 10, 0 -0x6f4a, 0x7079, 0x6461, 0x2320, 0x0034, - IDC_JPCOMBO, 0x403, 10, 0 -0x6f4a, 0x7079, 0x6461, 0x2320, 0x0035, - 0 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_SOUND_OPTS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 345 - TOPMARGIN, 7 - BOTTOMMARGIN, 194 - END - - IDD_SPC7110_CACHE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 178 - TOPMARGIN, 7 - BOTTOMMARGIN, 85 - END - - IDD_ROM_INFO, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 226 - TOPMARGIN, 7 - BOTTOMMARGIN, 178 - END - - IDD_ABOUT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 225 - TOPMARGIN, 7 - BOTTOMMARGIN, 174 - END - - IDD_EMU_SETTINGS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 313 - BOTTOMMARGIN, 106 - END - - IDD_OPEN_ROM, DIALOG - BEGIN - LEFTMARGIN, 3 - RIGHTMARGIN, 410 - TOPMARGIN, 3 - BOTTOMMARGIN, 221 - END - - IDD_GFX_PACK, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 212 - TOPMARGIN, 7 - BOTTOMMARGIN, 253 - END - - IDD_NEWDISPLAY, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 330 - TOPMARGIN, 7 - BOTTOMMARGIN, 168 - END - - IDD_CHEATER, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 255 - TOPMARGIN, 7 - BOTTOMMARGIN, 211 - END - - IDD_NETPLAYPROGRESS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 179 - TOPMARGIN, 7 - BOTTOMMARGIN, 54 - END - - IDD_INPUTCONFIG, DIALOG - BEGIN - RIGHTMARGIN, 290 - VERTGUIDE, 72 - VERTGUIDE, 92 - BOTTOMMARGIN, 126 - HORZGUIDE, 122 - END - - IDD_CHEAT_SEARCH, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 266 - TOPMARGIN, 7 - BOTTOMMARGIN, 264 - END - - IDD_DIALOG1, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 264 - TOPMARGIN, 7 - BOTTOMMARGIN, 61 - END - - IDD_CHEAT_FROM_SEARCH, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 180 - TOPMARGIN, 7 - BOTTOMMARGIN, 136 - END - - IDD_OPENMOVIE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 296 - TOPMARGIN, 7 - BOTTOMMARGIN, 207 - HORZGUIDE, 31 - HORZGUIDE, 51 - HORZGUIDE, 116 - HORZGUIDE, 129 - HORZGUIDE, 183 - END - - IDD_CREATEMOVIE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 296 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - HORZGUIDE, 31 - HORZGUIDE, 44 - HORZGUIDE, 95 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_ICON1 ICON DISCARDABLE "icon1.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_OPENFOLDER BITMAP DISCARDABLE "openfold.bmp" -IDB_CLOSEDFOLDER BITMAP DISCARDABLE "closedfold.bmp" -IDB_CDDRIVE BITMAP DISCARDABLE "cdd.bmp" -IDB_NETDRIVE BITMAP DISCARDABLE "nd.bmp" -IDB_HARDDRIVE BITMAP DISCARDABLE "hd.bmp" -IDB_PAD BITMAP DISCARDABLE "pad.bmp" -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// Dutch (Netherlands) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NLD) -#ifdef _WIN32 -LANGUAGE LANG_DUTCH, SUBLANG_DUTCH -#pragma code_page(1252) -#endif //_WIN32 - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,4,0,0 - PRODUCTVERSION 1,4,0,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "080904b0" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "Gary Henderson\0" - VALUE "FileDescription", "Snes9XW\0" - VALUE "FileVersion", "1.40\0" - VALUE "InternalName", "Snes9X\0" - VALUE "LegalCopyright", "Copyright © 1996-2001\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "Snes9XW.exe\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "Snes9X SNES Emulator\0" - VALUE "ProductVersion", "1.40\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x809, 1200 - END -END - -#endif // !_MAC - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "#include ""language.h""\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_MENU_NL MENU DISCARDABLE -BEGIN - POPUP "&Bestand" - BEGIN - MENUITEM "&Openen", ID_FILE_OPEN - MENUITEM SEPARATOR - MENUITEM "&Sluiten", ID_FILE_EXIT - END - POPUP "&Opties" - BEGIN - MENUITEM "Joypad configuratie", ID_OPTIONS_JOYPAD - END - POPUP "&Geluid" - BEGIN - POPUP "&8-Bit" - BEGIN - MENUITEM "8000 Hz, mono", ID_SOUND_8BIT8000HZMONO - MENUITEM "8000 Hz, stereo", ID_SOUND_8BIT8000HZSTEREO - - MENUITEM "11025 Hz, mono", ID_SOUND_8BIT11025HZMONO - MENUITEM "11025 Hz, stereo", ID_SOUND_8BIT11025HZSTEREO - - MENUITEM "22050 Hz, mono", ID_SOUND_8BIT22050HZMONO - MENUITEM "22050 Hz, stereo", ID_SOUND_8BIT22050HZSTEREO - - MENUITEM "44100 Hz, mono", ID_SOUND_8BIT44100HZMONO - MENUITEM "44100 Hz, stereo", ID_SOUND_8BIT44100HZSTEREO - - END - POPUP "&16-Bit" - BEGIN - MENUITEM "8000 Hz, mono", ID_SOUND_16BIT8000HZMONO - MENUITEM "8000 Hz, stereo", ID_SOUND_16BIT8000HZSTEREO - - MENUITEM "11025 Hz, mono", ID_SOUND_16BIT11025HZMONO - - MENUITEM "11025 Hz, stereo", ID_SOUND_16BIT11025HZSTEREO - - MENUITEM "22050 Hz, mono", ID_SOUND_16BIT22050HZMONO - - MENUITEM "22050 Hz, stereo", ID_SOUND_16BIT22050HZSTEREO - - MENUITEM "44100 Hz, mono", ID_SOUND_16BIT44100HZMONO - - MENUITEM "44100 Hz, stereo", ID_SOUND_16BIT44100HZSTEREO - - END - MENUITEM SEPARATOR - MENUITEM "&Geen Geluid", ID_SOUND_NOSOUND - END - POPUP "&Venster" - BEGIN - POPUP "&Taal" - BEGIN - MENUITEM "&English", ID_LANGUAGE_ENGLISH - MENUITEM "&Nederlands", ID_LANGUAGE_NEDERLANDS - , CHECKED - END - MENUITEM SEPARATOR - MENUITEM "&Verberg menubalk\tESC", ID_WINDOW_HIDEMENUBAR - END -END - -#endif // Dutch (Netherlands) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (U.K.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_NETCONNECT DIALOG DISCARDABLE 0, 0, 227, 61 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_CLIPCHILDREN | - WS_CAPTION -CAPTION "Connect to Server" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "&OK",IDOK,120,45,50,14 - PUSHBUTTON "Canccel",IDCANCEL,175,45,50,14 - RTEXT "Server Address",IDC_LABEL_SERVERADDY,5,5,50,14, - SS_CENTERIMAGE - PUSHBUTTON "Clear History",IDC_CLEARHISTORY,175,5,50,14 - RTEXT "Port Number",IDC_LABEL_PORTNUM,5,25,50,14, - SS_CENTERIMAGE - EDITTEXT IDC_PORTNUMBER,60,25,25,14,ES_AUTOHSCROLL - COMBOBOX IDC_HOSTNAME,60,5,110,40,CBS_DROPDOWN | WS_VSCROLL | - WS_TABSTOP -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_MENU_US MENU DISCARDABLE -BEGIN - POPUP "&File" - BEGIN - MENUITEM "L&oad Game...\tCtrl+O", ID_FILE_OPEN - POPUP "Recent &Games" - BEGIN - MENUITEM "Dummy", ID_RECENT_DUMMY - , INACTIVE - END - POPUP "&Save Game Position" - BEGIN - MENUITEM "Slot #1\tShift+F1", ID_FILE_SAVE1, GRAYED - MENUITEM "Slot #2\tShift+F2", ID_FILE_SAVE2, GRAYED - MENUITEM "Slot #3\tShift+F3", ID_FILE_SAVE3, GRAYED - MENUITEM "Slot #4\tShift+F4", ID_FILE_SAVE4, GRAYED - MENUITEM "Slot #5\tShift+F5", ID_FILE_SAVE5, GRAYED - MENUITEM "Slot #6\tShift+F6", ID_FILE_SAVE6, GRAYED - MENUITEM "Slot #7\tShift+F7", ID_FILE_SAVE7, GRAYED - MENUITEM "Slot #8\tShift+F8", ID_FILE_SAVE8, GRAYED - MENUITEM "Slot #9\tShift+F9", ID_FILE_SAVE9, GRAYED - END - POPUP "&Load Game Position" - BEGIN - MENUITEM "Slot #1\tF1", ID_FILE_LOAD1, GRAYED - MENUITEM "Slot #2\tF2", ID_FILE_LOAD2, GRAYED - MENUITEM "Slot #3\tF3", ID_FILE_LOAD3, GRAYED - MENUITEM "Slot #4\tF4", ID_FILE_LOAD4, GRAYED - MENUITEM "Slot #5\tF5", ID_FILE_LOAD5, GRAYED - MENUITEM "Slot #6\tF6", ID_FILE_LOAD6, GRAYED - MENUITEM "Slot #7\tF7", ID_FILE_LOAD7, GRAYED - MENUITEM "Slot #8\tF8", ID_FILE_LOAD8, GRAYED - MENUITEM "Slot #9\tF9", ID_FILE_LOAD9, GRAYED - END - MENUITEM SEPARATOR - MENUITEM "S&ave SPC Data", ID_FILE_SAVE_SPC_DATA - , GRAYED - MENUITEM "Sa&ve S-RAM Data", ID_FILE_SAVE_SRAM_DATA - , GRAYED - MENUITEM "Save SPC&7110 log", IDM_LOG_7110, GRAYED - MENUITEM "ROM Information...", IDM_ROM_INFO, GRAYED - MENUITEM SEPARATOR - MENUITEM "Movie Play...", ID_FILE_MOVIE_PLAY, GRAYED - MENUITEM "Movie Record...", ID_FILE_MOVIE_RECORD, GRAYED - MENUITEM "Movie Stop", ID_FILE_MOVIE_STOP, GRAYED - MENUITEM SEPARATOR - MENUITEM "Record AVI...", ID_FILE_WRITE_AVI, GRAYED - MENUITEM "Stop AVI Recording", ID_FILE_STOP_AVI, GRAYED - MENUITEM SEPARATOR - MENUITEM "&Reset Game", ID_FILE_RESET, GRAYED - MENUITEM "&Pause\tPause", ID_FILE_PAUSE, GRAYED - MENUITEM "E&xit\tAlt+F4", ID_FILE_EXIT - END - POPUP "&Options" - BEGIN - MENUITEM "&Display Configuration...\tAlt+F5", ID_OPTIONS_DISPLAY - MENUITEM "&Settings...\tAlt+F8", ID_OPTIONS_SETTINGS - MENUITEM "SPC7110 Cache Settings...", IDM_7110_CACHE - MENUITEM "GFX Pack Configuration...", IDM_GFX_PACKS - END - POPUP "&Input" - BEGIN - MENUITEM "&Joypad configuration...\tAlt+F7", ID_OPTIONS_JOYPAD - MENUITEM "Enable Multitap 5", IDM_ENABLE_MULTITAP - MENUITEM "Enable Mouse", IDM_MOUSE_TOGGLE - MENUITEM "Enable Superscope", IDM_SCOPE_TOGGLE - MENUITEM "Enable Justifiers", IDM_JUSTIFIER - END - POPUP "&Sound" - BEGIN - POPUP "&Playback Rate" - BEGIN - MENUITEM "&No Sound\tAlt+0", ID_SOUND_NOSOUND, GRAYED - MENUITEM "8KHz\tAlt+1", ID_SOUND_8000HZ, GRAYED - MENUITEM "11KHz\tAlt+2", ID_SOUND_11025HZ, GRAYED - MENUITEM "16KHz\tAlt+3", ID_SOUND_16000HZ, GRAYED - MENUITEM "22KHz\tAlt+4", ID_SOUND_22050HZ, GRAYED - MENUITEM "30KHz\tAlt+5", ID_SOUND_30000HZ, GRAYED - MENUITEM "32KHz\tAlt+6", ID_SOUND_32000HZ, GRAYED - MENUITEM "35KHz\tAlt+7", ID_SOUND_35000HZ, GRAYED - MENUITEM "44KHz\tAlt+8", ID_SOUND_44100HZ, GRAYED - MENUITEM "48KHz\tAlt+9", ID_SOUND_48000HZ, GRAYED - END - POPUP "&Buffer Length" - BEGIN - MENUITEM "&10ms", ID_SOUND_25MS, GRAYED - MENUITEM "&20ms", ID_SOUND_50MS, GRAYED - MENUITEM "&40ms", ID_SOUND_100MS, GRAYED - MENUITEM "&80ms", ID_SOUND_200MS, GRAYED - MENUITEM "1&60ms", ID_SOUND_500MS, GRAYED - MENUITEM "&320ms", ID_SOUND_1S, GRAYED - MENUITEM "64&0ms", ID_SOUND_2S, GRAYED - END - MENUITEM "&16-Bit Sound", ID_SOUND_16BIT - MENUITEM "&Stereo", ID_SOUND_STEREO - MENUITEM "&Reverse Stereo\tAlt+R", ID_SOUND_REVERSE_STEREO - MENUITEM SEPARATOR - MENUITEM "Catch-up Sample Generation", IDM_CATCH_UP_SOUND - MENUITEM "&Interpolated\tAlt+[", ID_SOUND_INTERPOLATED - MENUITEM "S&ync Sound\tAlt+]", ID_SOUND_SYNC - MENUITEM "&Settings...\tAlt+T", ID_SOUND_OPTIONS - END - POPUP "&Window" - BEGIN - POPUP "&Language" - BEGIN - MENUITEM "&English", ID_LANGUAGE_ENGLISH - , CHECKED - MENUITEM "&Nederlands", ID_LANGUAGE_NEDERLANDS - , GRAYED - END - MENUITEM SEPARATOR - MENUITEM "&Hide menubar\tESC", ID_WINDOW_HIDEMENUBAR - MENUITEM "&Full Screen\tAlt+Return", ID_WINDOW_FULLSCREEN - MENUITEM "&Stretch Image\tAlt+Del", ID_WINDOW_STRETCH - END - POPUP "&Cheat" - BEGIN - MENUITEM "&Game Genie, Pro-Action Replay Codes\tAlt+E", - ID_CHEAT_ENTER, GRAYED - MENUITEM "&Search for New Cheats\tAlt+A", ID_CHEAT_SEARCH, GRAYED - MENUITEM "&Apply Cheats", ID_CHEAT_APPLY - , CHECKED, GRAYED - MENUITEM "Set SPC7110 RTC", IDM_7110_RTC, GRAYED - END - POPUP "&Netplay", GRAYED - BEGIN - MENUITEM "&Connect to Server...", ID_NETPLAY_CONNECT - MENUITEM "&Disconnect from Server", ID_NETPLAY_DISCONNECT - MENUITEM SEPARATOR - MENUITEM "&Act as Server", ID_NETPLAY_SERVER - MENUITEM "&Re-sync all Clients Using Freeze File Now", - ID_NETPLAY_SYNC - MENUITEM "&Send ROM Image to Clients Now", ID_NETPLAY_ROM - MENUITEM "S&end ROM Image to Clients", ID_NETPLAY_SEND_ROM_ON_CONNECT - - MENUITEM "S&ync Using Reset Game", ID_NETPLAY_SYNC_BY_RESET - , CHECKED - MENUITEM SEPARATOR - MENUITEM "&Options...", ID_NETPLAY_OPTIONS - END - POPUP "&Help" - BEGIN - MENUITEM "&About...", ID_HELP_ABOUT - END -END - -#endif // English (U.K.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff -NaHudr snes9x-1.43-src/2xSaImmx.asm snx/2xSaImmx.asm --- snes9x-1.43-src/2xSaImmx.asm 1970-01-01 02:00:00.000000000 +0200 +++ snx/2xSaImmx.asm 2005-03-20 23:46:35.000000000 +0200 @@ -0,0 +1,1359 @@ +;/*---------------------------------------------------------------------* +; * The following (piece of) code, (part of) the 2xSaI engine, * +; * copyright (c) 1999 by Derek Liauw Kie Fa. * +; * Non-Commercial use of the engine is allowed and is encouraged, * +; * provided that appropriate credit be given and that this copyright * +; * notice will not be removed under any circumstance. * +; * You may freely modify this code, but I request * +; * that any improvements to the engine be submitted to me, so * +; * that I can implement these improvements in newer versions of * +; * the engine. * +; * If you need more information, have any comments or suggestions, * +; * you can e-mail me. My e-mail: derek-liauw@usa.net. * +; *---------------------------------------------------------------------*/ + +;---------------------- +; 2xSaI version 0.59 WIP, soon to become version 0.60 +;---------------------- + + BITS 32 +%ifdef __DJGPP__ + GLOBAL __2xSaILine + GLOBAL __2xSaISuperEagleLine + GLOBAL _Init_2xSaIMMX +%else + GLOBAL __2xSaILine + GLOBAL __2xSaISuperEagleLine + GLOBAL _Init_2xSaIMMX +%endif + SECTION .text ALIGN = 32 + +%ifdef __DJGPP__ +;EXTERN_C void _2xSaILine (uint8 *srcPtr, uint32 srcPitch, uint32 width, +; uint8 *dstPtr, uint32 dstPitch, uint16 dstSegment); +%else +;EXTERN_C void _2xSaILine (uint8 *srcPtr, uint32 srcPitch, uint32 width, +; uint8 *dstPtr, uint32 dstPitch); +%endif + +srcPtr equ 8 +deltaPtr equ 12 +srcPitch equ 16 +width equ 20 +dstOffset equ 24 +dstPitch equ 28 +dstSegment equ 32 + + + + +colorB0 equ -2 +colorB1 equ 0 +colorB2 equ 2 +colorB3 equ 4 + +color7 equ -2 +color8 equ 0 +color9 equ 2 + +color4 equ -2 +color5 equ 0 +color6 equ 2 +colorS2 equ 4 + +color1 equ -2 +color2 equ 0 +color3 equ 2 +colorS1 equ 4 + +colorA0 equ -2 +colorA1 equ 0 +colorA2 equ 2 +colorA3 equ 4 + + +%ifdef __DJGPP__ +__2xSaISuperEagleLine: +%else +__2xSaISuperEagleLine: +%endif +; Store some stuff + push ebp + mov ebp, esp + pushad + +; Prepare the destination +%ifdef __DJGPP__ + ; Set the selector + mov eax, [ebp+dstSegment] + mov fs, ax +%endif + mov edx, [ebp+dstOffset] ; edx points to the screen +; Prepare the source + ; eax points to colorA + mov eax, [ebp+srcPtr] + mov ebx, [ebp+srcPitch] + mov ecx, [ebp+width] + ; eax now points to colorB1 + sub eax, ebx + +; Main Loop +.Loop: push ecx + + ;-----Check Delta------------------ + mov ecx, [ebp+deltaPtr] + + movq mm0, [eax+colorB0] + movq mm1, [eax+colorB3] + movq mm2, [eax+ebx+color4] + movq mm3, [eax+ebx+colorS2] + movq mm4, [eax+ebx+ebx+color1] + movq mm5, [eax+ebx+ebx+colorS1] + push eax + add eax, ebx + movq mm6, [eax+ebx+ebx+colorA0] + movq mm7, [eax+ebx+ebx+colorA3] + pop eax + + pcmpeqw mm0, [ecx+2+colorB0] + pcmpeqw mm1, [ecx+2+colorB3] + pcmpeqw mm2, [ecx+ebx+2+color4] + pcmpeqw mm3, [ecx+ebx+2+colorS2] + pcmpeqw mm4, [ecx+ebx+ebx+2+color1] + pcmpeqw mm5, [ecx+ebx+ebx+2+colorS1] + add ecx, ebx + pcmpeqw mm6, [ecx+ebx+ebx+2+colorA0] + pcmpeqw mm7, [ecx+ebx+ebx+2+colorA3] + sub ecx, ebx + + + pand mm0, mm1 + pand mm2, mm3 + pand mm4, mm5 + pand mm6, mm7 + pand mm0, mm2 + pand mm4, mm6 + pxor mm7, mm7 + pand mm0, mm4 + movq mm6, [eax+colorB0] + pcmpeqw mm7, mm0 + + movq [ecx+2+colorB0], mm6 + + packsswb mm7, mm7 + movd ecx, mm7 + test ecx, ecx + jz near .SKIP_PROCESS + + ;End Delta + + ;--------------------------------- + movq mm0, [eax+ebx+color5] + movq mm1, [eax+ebx+color6] + movq mm2, mm0 + movq mm3, mm1 + movq mm4, mm0 + movq mm5, mm1 + + pand mm0, [colorMask] + pand mm1, [colorMask] + + psrlw mm0, 1 + psrlw mm1, 1 + + pand mm3, [lowPixelMask] + paddw mm0, mm1 + + pand mm3, mm2 + paddw mm0, mm3 ;mm0 contains the interpolated values + movq [I56Pixel], mm0 + movq mm7, mm0 + + ;------------------- + movq mm0, mm7 + movq mm1, mm4 ;5,5,5,6 + movq mm2, mm0 + movq mm3, mm1 + + pand mm0, [colorMask] + pand mm1, [colorMask] + + psrlw mm0, 1 + psrlw mm1, 1 + + pand mm3, [lowPixelMask] + paddw mm0, mm1 + + pand mm3, mm2 + paddw mm0, mm3 ;mm0 contains the interpolated values + movq [product1a], mm0 + ;-------------------- + + movq mm0, mm7 + movq mm1, mm5 ;6,6,6,5 + movq mm2, mm0 + movq mm3, mm1 + + pand mm0, [colorMask] + pand mm1, [colorMask] + + psrlw mm0, 1 + psrlw mm1, 1 + + pand mm3, [lowPixelMask] + paddw mm0, mm1 + + pand mm3, mm2 + paddw mm0, mm3 + movq [product1b], mm0 + + ;------------------------- + ;------------------------- + movq mm0, [eax+ebx+ebx+color2] + movq mm1, [eax+ebx+ebx+color3] + movq mm2, mm0 + movq mm3, mm1 + movq mm4, mm0 + movq mm5, mm1 + + pand mm0, [colorMask] + pand mm1, [colorMask] + + psrlw mm0, 1 + psrlw mm1, 1 + + pand mm3, [lowPixelMask] + paddw mm0, mm1 + + pand mm3, mm2 + paddw mm0, mm3 + movq [I23Pixel], mm0 + movq mm7, mm0 + + ;--------------------- + movq mm0, mm7 + movq mm1, mm4 ;2,2,2,3 + movq mm2, mm0 + movq mm3, mm1 + + pand mm0, [colorMask] + pand mm1, [colorMask] + + psrlw mm0, 1 + psrlw mm1, 1 + + pand mm3, [lowPixelMask] + paddw mm0, mm1 + + pand mm3, mm2 + paddw mm0, mm3 + movq [product2a], mm0 + + ;---------------------- + movq mm0, mm7 + movq mm1, mm5 ;3,3,3,2 + movq mm2, mm0 + movq mm3, mm1 + + pand mm0, [colorMask] + pand mm1, [colorMask] + + psrlw mm0, 1 + psrlw mm1, 1 + + pand mm3, [lowPixelMask] + paddw mm0, mm1 + + pand mm3, mm2 + paddw mm0, mm3 + movq [product2b], mm0 + + + ;//////////////////////////////// + ; Decide which "branch" to take + ;-------------------------------- + movq mm4, [eax+ebx+color5] + movq mm5, [eax+ebx+color6] + movq mm6, [eax+ebx+ebx+color3] + movq mm7, [eax+ebx+ebx+color2] + + pxor mm3, mm3 + movq mm0, mm4 + movq mm1, mm5 + + pcmpeqw mm0, mm6 + pcmpeqw mm1, mm7 + pcmpeqw mm1, mm3 + pand mm0, mm1 + movq [Mask35], mm0 + + movq mm0, [eax+ebx+ebx+colorS1] + movq mm1, [eax+ebx+color4] + push eax + add eax, ebx + movq mm2, [eax+ebx+ebx+colorA2] + pop eax + movq mm3, [eax+colorB1] + pcmpeqw mm0, mm4 + pcmpeqw mm1, mm4 + pcmpeqw mm2, mm4 + pcmpeqw mm3, mm4 + pand mm0, mm1 + pand mm2, mm3 + por mm0, mm2 + pand mm0, [Mask35] + movq [Mask35b], mm0 + + ;----------- + pxor mm3, mm3 + movq mm0, mm4 + movq mm1, mm5 + + pcmpeqw mm0, mm6 + pcmpeqw mm1, mm7 + pcmpeqw mm0, mm3 + pand mm0, mm1 + movq [Mask26], mm0 + + movq mm0, [eax+ebx+ebx+color1] + movq mm1, [eax+ebx+colorS2] + push eax + add eax, ebx + movq mm2, [eax+ebx+ebx+colorA1] + pop eax + movq mm3, [eax+colorB2] + pcmpeqw mm0, mm5 + pcmpeqw mm1, mm5 + pcmpeqw mm2, mm5 + pcmpeqw mm3, mm5 + pand mm0, mm1 + pand mm2, mm3 + por mm0, mm2 + pand mm0, [Mask26] + movq [Mask26b], mm0 + + ;-------------------- + movq mm0, mm4 + movq mm1, mm5 + movq mm2, mm0 + + pcmpeqw mm2, mm1 + pcmpeqw mm0, mm6 + pcmpeqw mm1, mm7 + pand mm0, mm1 + pand mm2, mm0 + pxor mm0, mm2 + movq mm7, mm0 + + ;------------------ + packsswb mm7, mm7 + movd ecx, mm7 + test ecx, ecx + jz near .SKIP_GUESS + +;--------------------------------------------- +; Map of the pixels: I|E F|J +; G|A B|K +; H|C D|L +; M|N O|P + movq mm6, mm0 + movq mm4, [eax+ebx+color5] + movq mm5, [eax+ebx+color6] + pxor mm7, mm7 + pand mm6, [ONE] + + movq mm0, [eax+colorB1] + movq mm1, [eax+ebx+color4] + movq mm2, mm0 + movq mm3, mm1 + pcmpeqw mm0, mm4 + pcmpeqw mm1, mm4 + pcmpeqw mm2, mm5 + pcmpeqw mm3, mm5 + pand mm0, mm6 + pand mm1, mm6 + pand mm2, mm6 + pand mm3, mm6 + paddw mm0, mm1 + paddw mm2, mm3 + + pxor mm3, mm3 + pcmpgtw mm0, mm6 + pcmpgtw mm2, mm6 + pcmpeqw mm0, mm3 + pcmpeqw mm2, mm3 + pand mm0, mm6 + pand mm2, mm6 + paddw mm7, mm0 + psubw mm7, mm2 + + movq mm0, [eax+colorB2] + movq mm1, [eax+ebx+colorS2] + movq mm2, mm0 + movq mm3, mm1 + pcmpeqw mm0, mm4 + pcmpeqw mm1, mm4 + pcmpeqw mm2, mm5 + pcmpeqw mm3, mm5 + pand mm0, mm6 + pand mm1, mm6 + pand mm2, mm6 + pand mm3, mm6 + paddw mm0, mm1 + paddw mm2, mm3 + + pxor mm3, mm3 + pcmpgtw mm0, mm6 + pcmpgtw mm2, mm6 + pcmpeqw mm0, mm3 + pcmpeqw mm2, mm3 + pand mm0, mm6 + pand mm2, mm6 + paddw mm7, mm0 + psubw mm7, mm2 + + push eax + add eax, ebx + movq mm0, [eax+ebx+color1] + movq mm1, [eax+ebx+ebx+colorA1] + movq mm2, mm0 + movq mm3, mm1 + pcmpeqw mm0, mm4 + pcmpeqw mm1, mm4 + pcmpeqw mm2, mm5 + pcmpeqw mm3, mm5 + pand mm0, mm6 + pand mm1, mm6 + pand mm2, mm6 + pand mm3, mm6 + paddw mm0, mm1 + paddw mm2, mm3 + + pxor mm3, mm3 + pcmpgtw mm0, mm6 + pcmpgtw mm2, mm6 + pcmpeqw mm0, mm3 + pcmpeqw mm2, mm3 + pand mm0, mm6 + pand mm2, mm6 + paddw mm7, mm0 + psubw mm7, mm2 + + movq mm0, [eax+ebx+colorS1] + movq mm1, [eax+ebx+ebx+colorA2] + movq mm2, mm0 + movq mm3, mm1 + pcmpeqw mm0, mm4 + pcmpeqw mm1, mm4 + pcmpeqw mm2, mm5 + pcmpeqw mm3, mm5 + pand mm0, mm6 + pand mm1, mm6 + pand mm2, mm6 + pand mm3, mm6 + paddw mm0, mm1 + paddw mm2, mm3 + + pxor mm3, mm3 + pcmpgtw mm0, mm6 + pcmpgtw mm2, mm6 + pcmpeqw mm0, mm3 + pcmpeqw mm2, mm3 + pand mm0, mm6 + pand mm2, mm6 + paddw mm7, mm0 + psubw mm7, mm2 + + pop eax + movq mm1, mm7 + pxor mm0, mm0 + pcmpgtw mm7, mm0 + pcmpgtw mm0, mm1 + + por mm7, [Mask35] + por mm1, [Mask26] + movq [Mask35], mm7 + movq [Mask26], mm1 + +.SKIP_GUESS: + ;Start the ASSEMBLY !!! + + movq mm4, [Mask35] + movq mm5, [Mask26] + movq mm6, [Mask35b] + movq mm7, [Mask26b] + + movq mm0, [eax+ebx+color5] + movq mm1, [eax+ebx+color6] + movq mm2, [eax+ebx+ebx+color2] + movq mm3, [eax+ebx+ebx+color3] + pcmpeqw mm0, mm2 + pcmpeqw mm1, mm3 + movq mm2, mm4 + movq mm3, mm5 + por mm0, mm1 + por mm2, mm3 + pand mm2, mm0 + pxor mm0, mm2 + movq mm3, mm0 + + movq mm2, mm0 + pxor mm0, mm0 + por mm2, mm4 + pxor mm4, mm6 + por mm2, mm5 + pxor mm5, mm7 + pcmpeqw mm2, mm0 + ;---------------- + + movq mm0, [eax+ebx+color5] + movq mm1, mm3 + por mm1, mm4 + por mm1, mm6 + pand mm0, mm1 + movq mm1, mm5 + pand mm1, [I56Pixel] + por mm0, mm1 + movq mm1, mm7 + pand mm1, [product1b] + por mm0, mm1 + movq mm1, mm2 + pand mm1, [product1a] + por mm0, mm1 + movq [final1a], mm0 + + movq mm0, [eax+ebx+color6] + movq mm1, mm3 + por mm1, mm5 + por mm1, mm7 + pand mm0, mm1 + movq mm1, mm4 + pand mm1, [I56Pixel] + por mm0, mm1 + movq mm1, mm6 + pand mm1, [product1a] + por mm0, mm1 + movq mm1, mm2 + pand mm1, [product1b] + por mm0, mm1 + movq [final1b], mm0 + + movq mm0, [eax+ebx+ebx+color2] + movq mm1, mm3 + por mm1, mm5 + por mm1, mm7 + pand mm0, mm1 + movq mm1, mm4 + pand mm1, [I23Pixel] + por mm0, mm1 + movq mm1, mm6 + pand mm1, [product2b] + por mm0, mm1 + movq mm1, mm2 + pand mm1, [product2a] + por mm0, mm1 + movq [final2a], mm0 + + movq mm0, [eax+ebx+ebx+color3] + movq mm1, mm3 + por mm1, mm4 + por mm1, mm6 + pand mm0, mm1 + movq mm1, mm5 + pand mm1, [I23Pixel] + por mm0, mm1 + movq mm1, mm7 + pand mm1, [product2a] + por mm0, mm1 + movq mm1, mm2 + pand mm1, [product2b] + por mm0, mm1 + movq [final2b], mm0 + + + movq mm0, [final1a] + movq mm2, [final1b] + movq mm1, mm0 + movq mm4, [final2a] + movq mm6, [final2b] + movq mm5, mm4 + punpcklwd mm0, mm2 + punpckhwd mm1, mm2 + punpcklwd mm4, mm6 + punpckhwd mm5, mm6 + + + + +%ifdef __DJGPP__ + movq [fs:edx], mm0 + movq [fs:edx+8], mm1 + push edx + add edx, [ebp+dstPitch] + movq [fs:edx], mm4 + movq [fs:edx+8], mm5 + pop edx +%else + movq [edx], mm0 + movq [edx+8], mm1 + push edx + add edx, [ebp+dstPitch] + movq [edx], mm4 + movq [edx+8], mm5 + pop edx +%endif +.SKIP_PROCESS: + mov ecx, [ebp+deltaPtr] + add ecx, 8 + mov [ebp+deltaPtr], ecx + add edx, 16 + add eax, 8 + + pop ecx + sub ecx, 4 + cmp ecx, 0 + jg near .Loop + +; Restore some stuff + popad + mov esp, ebp + pop ebp + emms + ret + + +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- + + +;This is version 0.50 +colorI equ -2 +colorE equ 0 +colorF equ 2 +colorJ equ 4 + +colorG equ -2 +colorA equ 0 +colorB equ 2 +colorK equ 4 + +colorH equ -2 +colorC equ 0 +colorD equ 2 +colorL equ 4 + +colorM equ -2 +colorN equ 0 +colorO equ 2 +colorP equ 4 + +%ifdef __DJGPP__ +__2xSaILine: +%else +__2xSaILine: +%endif +; Store some stuff + push ebp + mov ebp, esp + pushad + +; Prepare the destination +%ifdef __DJGPP__ + ; Set the selector + mov eax, [ebp+dstSegment] + mov fs, ax +%endif + mov edx, [ebp+dstOffset] ; edx points to the screen +; Prepare the source + ; eax points to colorA + mov eax, [ebp+srcPtr] + mov ebx, [ebp+srcPitch] + mov ecx, [ebp+width] + ; eax now points to colorE + sub eax, ebx + + +; Main Loop +.Loop: push ecx + + ;-----Check Delta------------------ + mov ecx, [ebp+deltaPtr] + + movq mm0, [eax+colorI] + movq mm1, [eax+colorJ] + movq mm2, [eax+ebx+colorG] + movq mm3, [eax+ebx+colorK] + movq mm4, [eax+ebx+ebx+colorH] + movq mm5, [eax+ebx+ebx+colorL] + push eax + add eax, ebx + movq mm6, [eax+ebx+ebx+colorM] + movq mm7, [eax+ebx+ebx+colorP] + pop eax + + pcmpeqw mm0, [ecx+2+colorI] + pcmpeqw mm1, [ecx+2+colorK] + pcmpeqw mm2, [ecx+ebx+2+colorG] + pcmpeqw mm3, [ecx+ebx+2+colorK] + pcmpeqw mm4, [ecx+ebx+ebx+2+colorH] + pcmpeqw mm5, [ecx+ebx+ebx+2+colorL] + add ecx, ebx + pcmpeqw mm6, [ecx+ebx+ebx+2+colorM] + pcmpeqw mm7, [ecx+ebx+ebx+2+colorP] + sub ecx, ebx + + + pand mm0, mm1 + pand mm2, mm3 + pand mm4, mm5 + pand mm6, mm7 + pand mm0, mm2 + pand mm4, mm6 + pxor mm7, mm7 + pand mm0, mm4 + movq mm6, [eax+colorI] + pcmpeqw mm7, mm0 + + movq [ecx+2+colorI], mm6 + + packsswb mm7, mm7 + movd ecx, mm7 + test ecx, ecx + jz near .SKIP_PROCESS + + ;End Delta + + ;--------------------------------- + + +;1 + ;if ((colorA == colorD) && (colorB != colorC) && (colorA == colorE) && (colorB == colorL) + movq mm0, [eax+ebx+colorA] ;mm0 and mm1 contain colorA + movq mm2, [eax+ebx+colorB] ;mm2 and mm3 contain colorB + + movq mm1, mm0 + movq mm3, mm2 + + pcmpeqw mm0, [eax+ebx+ebx+colorD] + pcmpeqw mm1, [eax+colorE] + pcmpeqw mm2, [eax+ebx+ebx+colorL] + pcmpeqw mm3, [eax+ebx+ebx+colorC] + + pand mm0, mm1 + pxor mm1, mm1 + pand mm0, mm2 + pcmpeqw mm3, mm1 + pand mm0, mm3 ;result in mm0 + + ;if ((colorA == colorC) && (colorB != colorE) && (colorA == colorF) && (colorB == colorJ) + movq mm4, [eax+ebx+colorA] ;mm4 and mm5 contain colorA + movq mm6, [eax+ebx+colorB] ;mm6 and mm7 contain colorB + movq mm5, mm4 + movq mm7, mm6 + + pcmpeqw mm4, [eax+ebx+ebx+colorC] + pcmpeqw mm5, [eax+colorF] + pcmpeqw mm6, [eax+colorJ] + pcmpeqw mm7, [eax+colorE] + + pand mm4, mm5 + pxor mm5, mm5 + pand mm4, mm6 + pcmpeqw mm7, mm5 + pand mm4, mm7 ;result in mm4 + + por mm0, mm4 ;combine the masks + movq [Mask1], mm0 + + ;-------------------------------------------- + +;2 + ;if ((colorB == colorC) && (colorA != colorD) && (colorB == colorF) && (colorA == colorH) + movq mm0, [eax+ebx+colorB] ;mm0 and mm1 contain colorB + movq mm2, [eax+ebx+colorA] ;mm2 and mm3 contain colorA + movq mm1, mm0 + movq mm3, mm2 + + pcmpeqw mm0, [eax+ebx+ebx+colorC] + pcmpeqw mm1, [eax+colorF] + pcmpeqw mm2, [eax+ebx+ebx+colorH] + pcmpeqw mm3, [eax+ebx+ebx+colorD] + + pand mm0, mm1 + pxor mm1, mm1 + pand mm0, mm2 + pcmpeqw mm3, mm1 + pand mm0, mm3 ;result in mm0 + + ;if ((colorB == colorE) && (colorB == colorD) && (colorA != colorF) && (colorA == colorI) + movq mm4, [eax+ebx+colorB] ;mm4 and mm5 contain colorB + movq mm6, [eax+ebx+colorA] ;mm6 and mm7 contain colorA + movq mm5, mm4 + movq mm7, mm6 + + pcmpeqw mm4, [eax+ebx+ebx+colorD] + pcmpeqw mm5, [eax+colorE] + pcmpeqw mm6, [eax+colorI] + pcmpeqw mm7, [eax+colorF] + + pand mm4, mm5 + pxor mm5, mm5 + pand mm4, mm6 + pcmpeqw mm7, mm5 + pand mm4, mm7 ;result in mm4 + + por mm0, mm4 ;combine the masks + movq [Mask2], mm0 + + +;interpolate colorA and colorB + movq mm0, [eax+ebx+colorA] + movq mm1, [eax+ebx+colorB] + + movq mm2, mm0 + movq mm3, mm1 + + pand mm0, [colorMask] + pand mm1, [colorMask] + + psrlw mm0, 1 + psrlw mm1, 1 + + pand mm3, [lowPixelMask] + paddw mm0, mm1 + + pand mm3, mm2 + paddw mm0, mm3 ;mm0 contains the interpolated values + + ;assemble the pixels + movq mm1, [eax+ebx+colorA] + movq mm2, [eax+ebx+colorB] + + movq mm3, [Mask1] + movq mm5, mm1 + movq mm4, [Mask2] + movq mm6, mm1 + + pand mm1, mm3 + por mm3, mm4 + pxor mm7, mm7 + pand mm2, mm4 + + pcmpeqw mm3, mm7 + por mm1, mm2 + pand mm0, mm3 + + por mm0, mm1 + + punpcklwd mm5, mm0 + punpckhwd mm6, mm0 + +%ifdef __DJGPP__ + movq [fs:edx], mm5 + movq [fs:edx+8], mm6 +%else + movq [edx], mm5 + movq [edx+8], mm6 +%endif + +;------------------------------------------------ +; Create the Nextline +;------------------------------------------------ +;3 ;if ((colorA == colorD) && (colorB != colorC) && (colorA == colorG) && (colorC == colorO) + movq mm0, [eax+ebx+colorA] ;mm0 and mm1 contain colorA + movq mm2, [eax+ebx+ebx+colorC] ;mm2 and mm3 contain colorC + movq mm1, mm0 + movq mm3, mm2 + + push eax + add eax, ebx + pcmpeqw mm0, [eax+ebx+colorD] + pcmpeqw mm1, [eax+colorG] + pcmpeqw mm2, [eax+ebx+ebx+colorO] + pcmpeqw mm3, [eax+colorB] + pop eax + + pand mm0, mm1 + pxor mm1, mm1 + pand mm0, mm2 + pcmpeqw mm3, mm1 + pand mm0, mm3 ;result in mm0 + + ;if ((colorA == colorB) && (colorG != colorC) && (colorA == colorH) && (colorC == colorM) + movq mm4, [eax+ebx+colorA] ;mm4 and mm5 contain colorA + movq mm6, [eax+ebx+ebx+colorC] ;mm6 and mm7 contain colorC + movq mm5, mm4 + movq mm7, mm6 + + push eax + add eax, ebx + pcmpeqw mm4, [eax+ebx+colorH] + pcmpeqw mm5, [eax+colorB] + pcmpeqw mm6, [eax+ebx+ebx+colorM] + pcmpeqw mm7, [eax+colorG] + pop eax + + pand mm4, mm5 + pxor mm5, mm5 + pand mm4, mm6 + pcmpeqw mm7, mm5 + pand mm4, mm7 ;result in mm4 + + por mm0, mm4 ;combine the masks + movq [Mask1], mm0 + ;-------------------------------------------- + +;4 + ;if ((colorB == colorC) && (colorA != colorD) && (colorC == colorH) && (colorA == colorF) + movq mm0, [eax+ebx+ebx+colorC] ;mm0 and mm1 contain colorC + movq mm2, [eax+ebx+colorA] ;mm2 and mm3 contain colorA + movq mm1, mm0 + movq mm3, mm2 + + pcmpeqw mm0, [eax+ebx+colorB] + pcmpeqw mm1, [eax+ebx+ebx+colorH] + pcmpeqw mm2, [eax+colorF] + pcmpeqw mm3, [eax+ebx+ebx+colorD] + + pand mm0, mm1 + pxor mm1, mm1 + pand mm0, mm2 + pcmpeqw mm3, mm1 + pand mm0, mm3 ;result in mm0 + + ;if ((colorC == colorG) && (colorC == colorD) && (colorA != colorH) && (colorA == colorI) + movq mm4, [eax+ebx+ebx+colorC] ;mm4 and mm5 contain colorC + movq mm6, [eax+ebx+colorA] ;mm6 and mm7 contain colorA + movq mm5, mm4 + movq mm7, mm6 + + pcmpeqw mm4, [eax+ebx+ebx+colorD] + pcmpeqw mm5, [eax+ebx+colorG] + pcmpeqw mm6, [eax+colorI] + pcmpeqw mm7, [eax+ebx+ebx+colorH] + + pand mm4, mm5 + pxor mm5, mm5 + pand mm4, mm6 + pcmpeqw mm7, mm5 + pand mm4, mm7 ;result in mm4 + + por mm0, mm4 ;combine the masks + movq [Mask2], mm0 + ;---------------------------------------------- + +;interpolate colorA and colorC + movq mm0, [eax+ebx+colorA] + movq mm1, [eax+ebx+ebx+colorC] + + movq mm2, mm0 + movq mm3, mm1 + + pand mm0, [colorMask] + pand mm1, [colorMask] + + psrlw mm0, 1 + psrlw mm1, 1 + + pand mm3, [lowPixelMask] + paddw mm0, mm1 + + pand mm3, mm2 + paddw mm0, mm3 ;mm0 contains the interpolated values + ;------------- + + ;assemble the pixels + movq mm1, [eax+ebx+colorA] + movq mm2, [eax+ebx+ebx+colorC] + + movq mm3, [Mask1] + movq mm4, [Mask2] + + pand mm1, mm3 + pand mm2, mm4 + + por mm3, mm4 + pxor mm7, mm7 + por mm1, mm2 + + pcmpeqw mm3, mm7 + pand mm0, mm3 + por mm0, mm1 + movq [ACPixel], mm0 + +;//////////////////////////////// +; Decide which "branch" to take +;-------------------------------- + movq mm0, [eax+ebx+colorA] + movq mm1, [eax+ebx+colorB] + movq mm6, mm0 + movq mm7, mm1 + pcmpeqw mm0, [eax+ebx+ebx+colorD] + pcmpeqw mm1, [eax+ebx+ebx+colorC] + pcmpeqw mm6, mm7 + + movq mm2, mm0 + movq mm3, mm0 + + pand mm0, mm1 ;colorA == colorD && colorB == colorC + pxor mm7, mm7 + + pcmpeqw mm2, mm7 + pand mm6, mm0 + pand mm2, mm1 ;colorA != colorD && colorB == colorC + + pcmpeqw mm1, mm7 + + pand mm1, mm3 ;colorA == colorD && colorB != colorC + pxor mm0, mm6 + por mm1, mm6 + movq mm7, mm0 + movq [Mask2], mm2 + packsswb mm7, mm7 + movq [Mask1], mm1 + + movd ecx, mm7 + test ecx, ecx + jz near .SKIP_GUESS + +;--------------------------------------------- +; Map of the pixels: I|E F|J +; G|A B|K +; H|C D|L +; M|N O|P + movq mm6, mm0 + movq mm4, [eax+ebx+colorA] + movq mm5, [eax+ebx+colorB] + pxor mm7, mm7 + pand mm6, [ONE] + + movq mm0, [eax+colorE] + movq mm1, [eax+ebx+colorG] + movq mm2, mm0 + movq mm3, mm1 + pcmpeqw mm0, mm4 + pcmpeqw mm1, mm4 + pcmpeqw mm2, mm5 + pcmpeqw mm3, mm5 + pand mm0, mm6 + pand mm1, mm6 + pand mm2, mm6 + pand mm3, mm6 + paddw mm0, mm1 + paddw mm2, mm3 + + pxor mm3, mm3 + pcmpgtw mm0, mm6 + pcmpgtw mm2, mm6 + pcmpeqw mm0, mm3 + pcmpeqw mm2, mm3 + pand mm0, mm6 + pand mm2, mm6 + paddw mm7, mm0 + psubw mm7, mm2 + + movq mm0, [eax+colorF] + movq mm1, [eax+ebx+colorK] + movq mm2, mm0 + movq mm3, mm1 + pcmpeqw mm0, mm4 + pcmpeqw mm1, mm4 + pcmpeqw mm2, mm5 + pcmpeqw mm3, mm5 + pand mm0, mm6 + pand mm1, mm6 + pand mm2, mm6 + pand mm3, mm6 + paddw mm0, mm1 + paddw mm2, mm3 + + pxor mm3, mm3 + pcmpgtw mm0, mm6 + pcmpgtw mm2, mm6 + pcmpeqw mm0, mm3 + pcmpeqw mm2, mm3 + pand mm0, mm6 + pand mm2, mm6 + paddw mm7, mm0 + psubw mm7, mm2 + + push eax + add eax, ebx + movq mm0, [eax+ebx+colorH] + movq mm1, [eax+ebx+ebx+colorN] + movq mm2, mm0 + movq mm3, mm1 + pcmpeqw mm0, mm4 + pcmpeqw mm1, mm4 + pcmpeqw mm2, mm5 + pcmpeqw mm3, mm5 + pand mm0, mm6 + pand mm1, mm6 + pand mm2, mm6 + pand mm3, mm6 + paddw mm0, mm1 + paddw mm2, mm3 + + pxor mm3, mm3 + pcmpgtw mm0, mm6 + pcmpgtw mm2, mm6 + pcmpeqw mm0, mm3 + pcmpeqw mm2, mm3 + pand mm0, mm6 + pand mm2, mm6 + paddw mm7, mm0 + psubw mm7, mm2 + + movq mm0, [eax+ebx+colorL] + movq mm1, [eax+ebx+ebx+colorO] + movq mm2, mm0 + movq mm3, mm1 + pcmpeqw mm0, mm4 + pcmpeqw mm1, mm4 + pcmpeqw mm2, mm5 + pcmpeqw mm3, mm5 + pand mm0, mm6 + pand mm1, mm6 + pand mm2, mm6 + pand mm3, mm6 + paddw mm0, mm1 + paddw mm2, mm3 + + pxor mm3, mm3 + pcmpgtw mm0, mm6 + pcmpgtw mm2, mm6 + pcmpeqw mm0, mm3 + pcmpeqw mm2, mm3 + pand mm0, mm6 + pand mm2, mm6 + paddw mm7, mm0 + psubw mm7, mm2 + + pop eax + movq mm1, mm7 + pxor mm0, mm0 + pcmpgtw mm7, mm0 + pcmpgtw mm0, mm1 + + por mm7, [Mask1] + por mm1, [Mask2] + movq [Mask1], mm7 + movq [Mask2], mm1 + +.SKIP_GUESS: + ;---------------------------- + ;interpolate A, B, C and D + movq mm0, [eax+ebx+colorA] + movq mm1, [eax+ebx+colorB] + movq mm4, mm0 + movq mm2, [eax+ebx+ebx+colorC] + movq mm5, mm1 + movq mm3, [qcolorMask] + movq mm6, mm2 + movq mm7, [qlowpixelMask] + + pand mm0, mm3 + pand mm1, mm3 + pand mm2, mm3 + pand mm3, [eax+ebx+ebx+colorD] + + psrlw mm0, 2 + pand mm4, mm7 + psrlw mm1, 2 + pand mm5, mm7 + psrlw mm2, 2 + pand mm6, mm7 + psrlw mm3, 2 + pand mm7, [eax+ebx+ebx+colorD] + + paddw mm0, mm1 + paddw mm2, mm3 + + paddw mm4, mm5 + paddw mm6, mm7 + + paddw mm4, mm6 + paddw mm0, mm2 + psrlw mm4, 2 + pand mm4, [qlowpixelMask] + paddw mm0, mm4 ;mm0 contains the interpolated value of A, B, C and D + +;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ + ;assemble the pixels + movq mm1, [Mask1] + movq mm2, [Mask2] + movq mm4, [eax+ebx+colorA] + movq mm5, [eax+ebx+colorB] + pand mm4, mm1 + pand mm5, mm2 + + pxor mm7, mm7 + por mm1, mm2 + por mm4, mm5 + pcmpeqw mm1, mm7 + pand mm0, mm1 + por mm4, mm0 ;mm4 contains the diagonal pixels + + movq mm0, [ACPixel] + movq mm1, mm0 + punpcklwd mm0, mm4 + punpckhwd mm1, mm4 + + push edx + add edx, [ebp+dstPitch] + +%ifdef __DJGPP__ + movq [fs:edx], mm0 + movq [fs:edx+8], mm1 +%else + movq [edx], mm0 + movq [edx+8], mm1 +%endif + pop edx + +.SKIP_PROCESS: + mov ecx, [ebp+deltaPtr] + add ecx, 8 + mov [ebp+deltaPtr], ecx + add edx, 16 + add eax, 8 + + pop ecx + sub ecx, 4 + cmp ecx, 0 + jg near .Loop + +; Restore some stuff + popad + mov esp, ebp + pop ebp + emms + ret + +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- + +%ifdef __DJGPP__ +_Init_2xSaIMMX: +%else +_Init_2xSaIMMX: +%endif +; Store some stuff + push ebp + mov ebp, esp + push edx + + +;Damn thing doesn't work +; mov eax,1 +; cpuid +; test edx, 0x00800000 ;test bit 23 +; jz end2 ;bit not set => no MMX detected + + mov eax, [ebp+8] ;PixelFormat + cmp eax, 555 + jz Bits555 + cmp eax, 565 + jz Bits565 +end2: + mov eax, 1 + jmp end +Bits555: + mov edx, 0x7BDE7BDE + mov eax, colorMask + mov [eax], edx + mov [eax+4], edx + mov edx, 0x04210421 + mov eax, lowPixelMask + mov [eax], edx + mov [eax+4], edx + mov edx, 0x739C739C + mov eax, qcolorMask + mov [eax], edx + mov [eax+4], edx + mov edx, 0x0C630C63 + mov eax, qlowpixelMask + mov [eax], edx + mov [eax+4], edx + mov eax, 0 + jmp end +Bits565: + mov edx, 0xF7DEF7DE + mov eax, colorMask + mov [eax], edx + mov [eax+4], edx + mov edx, 0x08210821 + mov eax, lowPixelMask + mov [eax], edx + mov [eax+4], edx + mov edx, 0xE79CE79C + mov eax, qcolorMask + mov [eax], edx + mov [eax+4], edx + mov edx, 0x18631863 + mov eax, qlowpixelMask + mov [eax], edx + mov [eax+4], edx + mov eax, 0 + jmp end +end: + pop edx + mov esp, ebp + pop ebp + ret + + +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- + + SECTION .data ALIGN = 32 +;Some constants +colorMask dd 0xF7DEF7DE,0xF7DEF7DE +lowPixelMask dd 0x08210821,0x08210821 + +qcolorMask dd 0xE79CE79C,0xE79CE79C +qlowpixelMask dd 0x18631863,0x18631863 + +darkenMask dd 0xC718C718,0xC718C718 +GreenMask dd 0x07E007E0,0x07E007E0 +RedBlueMask dd 0xF81FF81F,0xF81FF81F + +FALSE dd 0x00000000,0x00000000 +TRUE dd 0xffffffff,0xffffffff +ONE dd 0x00010001,0x00010001 + + + SECTION .bss ALIGN = 32 +ACPixel resb 8 +Mask1 resb 8 +Mask2 resb 8 + +I56Pixel resb 8 +I23Pixel resb 8 +Mask26 resb 8 +Mask35 resb 8 +Mask26b resb 8 +Mask35b resb 8 +product1a resb 8 +product1b resb 8 +product2a resb 8 +product2b resb 8 +final1a resb 8 +final1b resb 8 +final2a resb 8 +final2b resb 8 diff -NaHudr snes9x-1.43-src/AVIOutput.h snx/AVIOutput.h --- snes9x-1.43-src/AVIOutput.h 2004-12-31 00:15:55.000000000 +0200 +++ snx/AVIOutput.h 2005-04-09 00:59:23.000000000 +0300 @@ -126,4 +126,4 @@ } #endif -#endif /* __AVIOUTPUT_H_ */ \ No newline at end of file +#endif /* __AVIOUTPUT_H_ */ diff -NaHudr snes9x-1.43-src/directx.cpp snx/directx.cpp --- snes9x-1.43-src/directx.cpp 2004-12-31 00:15:55.000000000 +0200 +++ snx/directx.cpp 2005-04-09 00:59:23.000000000 +0300 @@ -192,32 +192,36 @@ return (false); } } - dErr = lpDS->SetCooperativeLevel (GUI.hWnd, DSSCL_PRIORITY); + dErr = lpDS->SetCooperativeLevel (GUI.hWnd, DSSCL_PRIORITY | DSSCL_EXCLUSIVE); if (dErr != DS_OK) { - if (lpDS -> SetCooperativeLevel (GUI.hWnd, DSSCL_NORMAL) != DS_OK) - { - lpDS -> Release(); - lpDS = NULL; + dErr = lpDS->SetCooperativeLevel (GUI.hWnd, DSSCL_PRIORITY); + if (dErr != DS_OK) + { + if (lpDS -> SetCooperativeLevel (GUI.hWnd, DSSCL_NORMAL) != DS_OK) + { + lpDS -> Release(); + lpDS = NULL; - DSAvailable = false; - } - if (DSAvailable) - MessageBox (GUI.hWnd, TEXT("\ -Unable to set DirectSound's priority cooperative level.\n\ -Another application is dicating the sound playback rate,\n\ -sample size and mono/stereo setting."), - TEXT("Snes9X - Unable to Set DirectSound priority"), - MB_OK | MB_ICONWARNING); - else - MessageBox (GUI.hWnd, TEXT("\ -Unable to set any DirectSound cooperative level. You will\n\ -not be able to hear any sound effects or music while playing.\n\n\ -It is usually caused by another application that has already\n\ -opened DirectSound in exclusive mode."), - TEXT("Snes9X - Unable to DirectSound"), - MB_OK | MB_ICONWARNING); - } + DSAvailable = false; + } + if (DSAvailable) + MessageBox (GUI.hWnd, TEXT("\ + Unable to set DirectSound's priority cooperative level.\n\ + Another application is dicating the sound playback rate,\n\ + sample size and mono/stereo setting."), + TEXT("Snes9X - Unable to Set DirectSound priority"), + MB_OK | MB_ICONWARNING); + else + MessageBox (GUI.hWnd, TEXT("\ + Unable to set any DirectSound cooperative level. You will\n\ + not be able to hear any sound effects or music while playing.\n\n\ + It is usually caused by another application that has already\n\ + opened DirectSound in exclusive mode."), + TEXT("Snes9X - Unable to DirectSound"), + MB_OK | MB_ICONWARNING); + } + } #ifdef FMOD_SUPPORT } #endif @@ -370,14 +374,14 @@ ZeroMemory (&ddsd, sizeof (ddsd)); ddsd.dwSize = sizeof (ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; - if(GUI.VideoMemory) + ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; + if(GUI.VideoMemory) { - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY; - } - else - { - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; + ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY; + } + else + { + ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; } ddsd.dwWidth = SNES_WIDTH * 2; ddsd.dwHeight = SNES_HEIGHT_EXTENDED * 2; @@ -512,9 +516,10 @@ #endif F_CALLBACKAPI FMODStreamCallback (FSOUND_STREAM *stream, void *buff, int len, void *param) { - bool8 mute = DirectX.IdleCount >= GUI.PausedFramesBeforeMutingSound; + bool8 mute = DirectX.IdleCount >= GUI.PausedFramesBeforeMutingSound; if (mute || Settings.ForcedPause || - Settings.Paused || Settings.StopEmulation) + (Settings.Paused && (Settings.FAMute || !Settings.FrameAdvance && !(DirectX.IdleCount < 8))) // gives frame advance sound + || Settings.StopEmulation || GUI.AVIOut) { ZeroMemory (buff, len); } diff -NaHudr snes9x-1.43-src/faqs.txt snx/faqs.txt --- snes9x-1.43-src/faqs.txt 2004-12-31 00:15:55.000000000 +0200 +++ snx/faqs.txt 2005-04-09 00:59:23.000000000 +0300 @@ -1,304 +1,211 @@ -Le FAQ De Snes9x - -Wassail, -This is the much anticipated and highly informative Frequently Asked Questions article, -which contains, believe it or not, Frequently Asked Questions! This time around we have -also included Frequently Answered Answers! I shall be your host on this gleeful sojourn -through a text document where anything can, but probably won't, happen. On our first -section of this mystical journey you shall see various frequently asked questions, as -well as their answers! - -Amendments: -By popular demand the FAQ is now sorted in some form of coherent order, and has little -liney things, which are supposedly neat. - -The majority of the things in this FAQ are based off the Windows port of Snes9x. While some -of the information is relevant to most, or all, ports, no gaurantees are made that what is -said will be accurate for all versions. Note that there is a section for the various official -ports in chapter 4. - - -________________________________________________________________________ - -Chapter 1: - -Emulator Specific Questions - Or - It's Not The Size Of An Emulator That Counts; It's How You Use It. - -Q: When is the next version (of Snes9x) coming out? - A: Chances are it will be coming out when enough changes have been made to suitably -make a release. You can generally guesstimate the release date by paying attention to -the Developers forum at snes9x.com. - -Q: Why do my games run too fast? - A: Through proper nutrition and training an increase in abilities is often found. It is -possible that certain ROMs, whilst training for the annual Rohm race, surpassed a sane -limit. Generally not allowing them to run will cause atrophy, making them somewhat -slower. Seriously though, try using the + and/or - keys to adjust the emulated speed. If -you are feeling lucky, you might also wish to try holding down Shift, and pressing the + -and/or - keys. In the display settings make sure the "Use Frame Limiter" and "Automatic -Frame Skipping" boxes are checked. - -Q: Why doesn't Snes9x support transparencies? - A: It does! Make sure the "Transparency" box is checked in the settings menu. - -Q: I recently purchased a game pad controller. Will it work on Snes9x? - A: More than likely yes. Any USB compatable controller will work. Generally this -means any controller made within the past 7 years or so. If you are having problems -consider updating drivers and recalibrating your controller. - -Q: In Snes9x my game pad is having trouble inputting any diagonal directions on the D-Pad. -How can I fix this? - A: While setting up your controller functions in Snes9x, make sure you do not setup the -diagonal buttons; leave them blank. Ye olde Snes only had 4 buttons on the D-Pad: Up, down, -left and right. By pressing two directions you would go in the appropriate diagonal direction -(game specific, of course). If you have accidently set a value in the diagonal boxes already -either select them one at a time and hit "Escape", or press the "toggle diagonals" button. - -Q: Soooooooo... Why the heck do you have diagonals in the controller setup anyway? - A: Simple really. Some people enjoy using the keyboard, or have no other choice. -In the next chapter the topic of keyboard input limitations will be addressed. Being able to -input the diagonals can help hinder that occurrence. It can also make keyboard usage a bit easier... -assigning the directional controls to the number pad for instance. - -Q: I gotsid me a translation patch (.ips) for my game. Now what do I do so I can use it? - A: Make sure both your ROM image and .ips file are in the same folder. Finally make sure -they have the exact same name (minus file extensions, of course). As an example "Pie.smc" -should have "Pie.ips" and "Super_Pie3(E).smc" should have "Super_Pie3(E).ips". Now open up -Snes9x, load your ROM and voila! It should be noted that IPS patches are almost always designed -for use with a specific dump of a ROM. If you are positive you are using it correctly, but it -still does not work, consider trying a ROM from a different source. - -Q: I had a bad checksummed game that didn't work so I adjusted the header, but it still -doesn't work :( Why? - A: It should be noted that while it is possible to plop a ROM into Snestool, or several other -programs, and adjust the header size to be the same as a proper "good checksum" ROM,this merely -mimics the appearance of a good ROM. Any problems still found within its evil will remain. -One could compare it to covering up a circumorbital haematoma with a paper bag. - - -________________________________________________________________________ - -Chapter 2: - -Game Specific Questions - Or - How I learned To Stop Worrying And Love The ROM - -Q: What's da dilly-o wit' dem Graphics packs, foo? - A: Some games contain processors that are difficult to completely emulate due to their -compression schemes. Through various means something called a "graphics pack" has been -created that will allow you to view the graphics in these games despite the compression. -Most graphic packs are rather large in file size, since they contain all the uncompressed -graphics in a game. The games that require graphics packs are: - -Far East of Eden Zero (J) -Far East of Eden Zero: Shounen Jump No Shou (J) -Momatarou Dentetsu Happy (J) -Super Power League 4 (J) - -After many hours of work one of the two aformentioned chips has been emulated more efficiently. -SNES games using the "S-DD1" chip can now run without a graphics pack. While there are some pros -and cons to either choice, I recommend not using a graphics pack as they are large and may not -be complete. It can be much slower without one, however, should yOu feel speed is more important -than accuracy. The exact ROMs that can now run without graphics packs are: - -Star Ocean (J) -Street Fighter Alpha 2 (E) -Street Fighter Alpha 2 (U) -Street Fighter Zero 2 (J) - -Q: Why doesn't game X work? - A: There are three possible answers to this question, depending on the scenario. Answer -one is that it does work, but your ROM dump is incorrect (this MAY be fixed by reattaching -your cartridge to your copier and redumping). Answer two is that we have found a solution -to the problem, but have not yet implemented a fix. Answer three, a subsidiary of answer two, -is that we do NOT know what is wrong with it, and as such have not yet implemented a fix. - -Q: Why doesn't Snes9x display SD3/Secret of Mana/other hi-res games properly? - A: Some games had resolution changes at certain parts during the game that affect the pixel -size of what is shown on screen. Due to the way this is handled some games require specific -options to keep "right". First, make sure that Hi-res support is selected in the option menus, -That option can slow down performance on slower machines, which is why it may be off by default. -Second, it is recommended your filter option is set to "normal," as oppossed to "none." Some of -the other filtering modes may work without problems, but I have not tested them to be sure. -Note: In the event the "hi-res" option is greyed out, make sure your display resolution is at -least 512 x 480. - -Q: Why can't I press many buttons at once? Especially in that Chrono Trigger game. - A: Most standard keyboards (There are a few exceptions, though only a few) can only -output so much data to the compter at a time. As such your computer is often unable to -carry-out the instructions you have given it. There are solutions abound, of course, -and here they are now: Lovely recommendation one is to rearrange the keymapping in Snes9x -so that all the necessary buttons are on a single keystroke... That way you can press 1 key -and have it do all the actions. The draw back to this is that if you set "a" to jump -and shoot you will be unable to jump without shooting, or shoot without jumping, until -you change it back. The super sexy recommendation number 2 is to set the ctrl and alt -keys to some of the necessary buttons. The draw back to this is that often these buttons -can cause problems if used in tandum with other keys, due to Windows shortcuts. You may, -for instance, be using alt to jump and while in midair hit f4 to load a savestate... -That will close the program, which is bad. Finally, and the method I personally recommend, -is to purchase a gamepad. The draw backs to this are that it requires time and money. - -Q: I'm all like "Hey, Yoshi's Island" and it's all like "error" and I'm all like "Ooooh, no -Yoshi's Island" but my friend is like "Yay, Yoshi's Island." Why? - A: Try selecting "mode 2" from the interleave dropdown box in the "open" menu before -loading said ROM Image. - - -________________________________________________________________________ - -Chapter 3: -All About Netplay - Or - More Slow Than A Quadriplegic Ninja Turtle, But Only Half As Entertaining - -Q: Snes9x netplay sucks, can I make it better? - A: Yes, yes you can! Snes9x is open source so all you need to make netplay better is -advanced programming knowledge and a will to improve upon the Snes9x code. At present -time Snes9x is more for LANplay, best used in a small network of local computers. I -recommend Zsnes (www.zsnes.com) and zbattle (www.zbattle.net) for your random chaotic -netplay needs. - -Q: I am using a Windows port of Snes9x. My friend is using a Mac. Can we netplay? - A: Yes... Just not with each other. Snes9x, at this time, does not support cross-platform -netplay. Or good netplay. - -Q: Yea who don know dat but when i do what do afta y find som1 - (now that I have someone to play with, what do I do?) - A: An excellent... ...question. I couldn't have worded it better myself. Despite my -sarcasm however I must cringe at the fact I can actually understand it enough to answer. -The answer depends on if you are acting as the server/host or the client. If you are the -host you must first find your IP Address and give it to the person you intend to play online -with. Next open Snes9x, load the ROM you wish to netplay, and then from the netplay menu, -select "Act as server." Then you wait until the client connects... Now, if you are the client, -first receive the IP address from the host, open Snes9x, and open the ROM you wish to netplay. -Select "connect to server" from the netplay menu, and fill out the necessary information. -Server address should contain the IP Address of the host. After that is done click "Connect." -Assuming both parties have done their role correctly, a netplay match should soon start. - -Q: How do I chat with my partner during netplay? - A: I personally recommend yelling really loudly, but the telephone is also a somewhat -plausible answer I suppose. Seriously. - -Q: Can I play with more than 2 players? - A: Indeed you can. Basically the same steps to starting a multiplayer game apply, however -there are a few important differences. Obviously the game you wish to multiplay in must support -three or more players. I may add a list of these games at a later date. Now then, make sure that -you, as well as everyone intending to play, has selected the "enable multitap 5" option from the -input menu. If you don't do this it just won't work. - - -________________________________________________________________________ - -Chapter 4: -Mac, And Linux Specific Questions - Or - Don't Buy Into The Paneful Propaganda - -Q: My buddy, whose soul has been lost to M$, says he can run games like Doom and -Starfox2, but Snes9x on my Mac has all sorts of problems when running them. What I -do? - A: The PC version of Snes9x partially uses x86 asm code in place of the C code used on -the Mac, which might cause a difference in compatibility. As of now I believe both ports can -all run the same things. If you find one that runs on the PC version, but not the MAC please -let us know. - -Q: On my Mac the damnable games refuse to do anything, even though I'm pressing keys. Why? - A: This problem is caused by a bug found within OSX 10.2.x. In this bug the authentication -dialog turns off GetKeys() (the function that reads keyboard state) when a user enters his -password, and doesn't turn it back on. This bug has been fixed in 10.3.x. - -Q: On my Mac everything is fine when I play the game, however the next time I play, my save data -is not there. Why? - A: First, check to see if the .SRM file is still on your hard drive. If it is then make sure -you have set where Snes9x checks for files in the "file" tab, in the preferences section. If the -.SRM cannot be found then most likely you are trying to save files into a locked volume, such as -a cd drive, or read-only folder. This will fail. Check the file saving preferences and adjust where -the files are saving. - -Q: Can I change the keybindings on Linux? - A: From what I've been told the keymap is hardcoded to the source, making changing them rather -difficult. The only way to change them, for now, would be to edit and recompile the source, which -from what I've been told isn't something everyone can do. - - -________________________________________________________________________ - -Chapter 5: -Miscellaneous Questions - Or - Q-Bert Is My Only Friend - -Q: Is it legal?! - A: This has been asked time and again, and the answer is yes. Developing, -downloading, or using the emulator, Snes9x, is completely legal. Downloading games, -called ROMS, however is not. If you own the original cartridge of a game, you are still -not entitled to download the ROM image of that game. You may create a single backup -image of your own cartridge via proper hardware, but it must be YOUR cartridge and is -only usable in place of the original... so only one may be active at any time. Many sites -claim that you may legally download ROMs for up to 24 hours before they must be -deleted. This is also wrong; you can't legally download these for "trial" purposes. You -can't download ROMs for educational purposes either. If you wish to use Super Nintendo -Entertainment System games for educational purposes, contact your closest Nintendo -Outlet and discuss educational programming with them. Finally, a small number of -ROMs are labeled "(PD)". This means public domain, and these games are not under -copyright. As such they are legal to download at your hearts content. These include -programs created by internet users such as yourself for use in Super Nintendo emulators. -As of this time there are no commercial videogames in the public domain. - -Q: My friend, Tibby, says that you are wrong and that game companies don't care if you -download games! - A: Whilst not actually a question, and more of a statement, I am afraid Tibby is -incorrect. Feel free to peruse the various legal documentation sprawled throughout the -World Wide Web or your local constituency. As for the blatant generalization that -companies do not care; At least one does, and truthfully many more do as well, as such -the statement is obviously a fallacy. For those who think it is not fair, or shouldn't be the -way it is... perhaps not, though as holders of a copyright it is up to Nintendo to decide -how and when their products are distributed. - -Q: I just purchased your fine program off eBay for $19.89, but my friend says I can -download it for free. Can you guys give me my money back? - A: Okay, this question hasn't actually been asked, however our free downloadable -program does seem to get sold on eBay more often than it should, which is to say at all. -We cannot reimburse anyone who was unlucky enough to be scammed into purchasing -Snes9x, just as McDonalds cannot reimburse you if you purchased 100 Happy Meals -from a random stranger and he gave you a frozen fish. If you find yourself in this -situation... Purchasing Snes9x, not frozen fish... Please take the time to inform eBay via -their heavily disguised investigations department, and leave any negative feedback that -you wish. It would also be appreciated by the Snes9x team if you could mention where -and when this happened so that we can take measures to stop it from happening again. -While the fact we aren't making money from the program in no way bothers us (It is -freeware after all), that some grubby bastards are does. - -Q: So err, where exactly do I contact y'all, eh? - A: The most convenient way to contact us would be via www.snes9x.com. There is a -forum that is checked at least 12 times a day by regulars, and at least a few of us can -actually give some advice. E-mail is also a possibility, though it is much slower, and -you'll hafta find the e-mail addresses on your own. Be sure to read the FAQ and Read me -before posting, as things already answered many a time will probably result in random -insults or heavy sarcasm. - - -________________________________________________________________________ - -Chapter 6: -The Conclusion - Or - That Block Of Words And Various Punctuation Symbols At The End Of The Document That Isn't - Totally Dissimilar To Something That May, Or May Not, Be Considered A Conclusion Given The - Contents Held Within The Paragraph(s) It Contains - -I hope you enjoyed this jaunt through the magical land of FAQs. Much has been said but, -obviously, there is still room to grow and expand. Should you feel you have a question worthy -of this vast tome of knowledge please leave it in the "board feedback" section of the Snes9x Forum. -I have been your host and shall return again next time with an even greater FAQ. - -I would like to take the time to thank the vast plethora of people who have helped me conjur this -machination of goodness. However, in the annals of time I have probably forgotten many of those -who have given me advice, defintions, technologial information and cookies. It would be unfair -to only mention the small portion of names I remember from an excessivley long and ever-expanding -list. As such, I won't. Toodles. - -Knowledge is power; Learn it well +Le FAQ de Snes9x + +Wassail, +This is the much anticipated and highly informative Frequently Asked Questions article, +which contains, believe it or not, Frequently Asked Questions as well as Frequently +Answered Answers! I shall be your host on this gleeful sojourn through a text document, +where anything can, but probably won't, happen. + +By popular demand the FAQ is now sorted in some form of coherent order, and has little +liney things, which are supposedly neat. + +On our first section of this mystical journey you shall see various frequently asked +questions, as well as their answers! + +________________________________________________________________________ + +Chapter 1: +Emulator Specific Questions + Or +It's Not the Size of an Emulator That Counts; It's How You Use it. + +Q: When is the next version (of Snes9x) coming out? + A: Chances are it will be coming out when enough changes have been made to suitably +make a release. You can generally guesstimate the release date by paying attention to the +Developers forum at snes9x.com. + +Q: Why doesn't Snes9x have feature X? + A: There is no feature X, it is only an illusion... A trick of the mind, if you will. + +Q: Why do my games run too fast? + A: Through proper nutrition and training an increase in abilities is often found. It is +possible that certain ROMs, whilst training for the annual Rohm race, surpassed a sane +limit. Generally not allowing them to run will cause atrophy, making them somewhat +slower. Seriously though, try using the + and/or - keys to adjust the emulated speed. If +you are feeling lucky, you might also wish to try holding down Shift, and pressing the + +and/or - keys. + +Q: Why doesn't Snes9x support transparencies? + A: It does!!!! + +Q: I recently purchased a game pad controller. Will it work on Snes9x? + A: More than likely yes. Some Gravis Game pads seem to have more trouble than most +however. Consider updating drivers and recalibrating your controller if it does not work. + +Q: Why can't I run forward while jumping and shooting? + A: Lack of cognitive exercise can often affect brain patterns, resulting in an inability to +multitask. An example would be an inability to rub ones tummy whilst patting ones +head. Occasionally the cognitive abilities can atrophy so much that you are unable to run +and jump whilst carrying firearms. Alternatively, all keyboards can only input so much +data to the CPU at a time. Depending on the brand and placement of the keys, this +number can vary, however three keys does seem to be a standard limit. There are +multiple solutions to this problem. Obtaining a game pad of some form is the most +highly suggested method, as playing the Snes with a keyboard was not one of the greatest +videogame ideas of the last century. You can also try to reassign buttons to keys that +allow more input; Ctrl and Alt for example. The final method is to assign multiple tasks +to a single key, though this can be frustrating in near-all instances. As an example you +could configure the spacebar to jump AND shoot, however the drawback is that you +would not be able to jump without shooting, or shoot without jumping. + +________________________________________________________________________ + +Chapter 2: +Game Specific Questions + Or +How I learned To Stop Worrying and Love the ROM + +Q: Why doesn't Star Ocean/SFA 2 work? + A: These games contained a rare processor with a rather nasty compression scheme, +making it hard to properly crack. It is possible to play these on Snes9x, though you need +to obtain the aptly named "graphics packs" which contain the uncompressed graphics of +the two games. After you have obtained these you can fiddle with setting them up, which +is explained in the read me, and then you too can play your emulated copy of the games +you no doubt own. + +Q: Heeeeeey, Star Ocean is working, and I don't have this graphics pack thing you are +talking about. + A: Yes, last time I mentioned it contained a processor that was difficult to completely +emulate due to its compression scheme. Through vast work our crack team has bested the +little bugger and now you can reap the benefits. What this means is that games with said +processing unit, the s-dd1, can now run without graphics packs. You can still use the +graphics packs if you would like to, and it may increase speed and playability of said +games. Snes9x will, by default, run these games without using the graphic packs but you +can change this in the options menu. The exact ROMs that can now run without graphics +packs are Star Ocean (J), Street Fighter Alpha 2 (E), Street Fighter Alpha 2 (U) and Street +Fighter Zero 2 (J) + +Q: Why doesn't MegaManX2 and/or 3 work? + A: With the present state of economy it is often hard for valuable tradesmen to find +long-standing jobs. As such, it is possible that it proves even more difficult for the +aforementioned games. More than likely it does work, however depending on your +operating system, it may not yet be implemented. If this is the case, upgrade your OS or, +alternatively, bribe your port maintainer to implement the code. + +Q: Why doesn't game X work? + A: There are three possible answers to this question, depending on the scenario. Answer +one is that it does work, but your ROM dump is incorrect (this MAY be fixed by re +attaching your cartridge to your copier and redumping). Answer two is that we have +found a solution to the problem, but have not yet implemented a fix. Answer three, a +subsidiary of answer two, is that we do NOT know what is wrong with it, and as such +have not yet implemented a fix. + +Q: Why doesn't Snes9x display SD3/Secret of Mana/other hi-res game? + A: To answer this one must first understand what hi-res games are. There are games +that used higher resolution than the Super Nintendo standard. You can easily activate the +Hi-res mode by configuring it in the settings panel. This may slow down game speed on +some lower-end computers, which is why it is an optional feature. + +Q: In some games, including Seiken Densetsu 3, the text and options screen seems +stretched and distorted. How do I stop this? + A: First, make sure you have Hi-res enabled in the display screen. Also make sure your +image filter is not set to "NONE." If you find the Hi-res checkbox is unselectable, +increase your resolution in the Snes9x display options to at least 512 x 480. + +Q: I'm all like "Hey, Yoshi's Island" and it's all like "error" and I'm all like "Ooooh, no +Yoshi's Island" but my friend is like "Yay, Yoshi's Island." Why? + A: Try selecting "mode 2" from the interleave dropdown box in the "open" menu before +loading said ROM Image. + +________________________________________________________________________ + +Chapter 3: +All About Netplay + Or +More Slow Than a Quadriplegic Ninja Turtle, But Only Half as Entertaining + +Q: Snes9x netplay sucks, can I make it better? + A: Yes you can! Snes9x is open source so all you need to make netplay better is +advanced programming knowledge and a will to improve upon the Snes9x code.At +present time Snes9x is more for LANplay, best used in a small network of local +computers. I recommend Zsnes (www.zsnes.com) and zbattle (www.zbattle.net) for your +random chaotic netplay needs. + +Q: I am using a Windows port of Snes9x. My friend is using a Mac. Can we netplay? + A: Yes... Just not with each other. Snes9x, at this time, does not support cross-platform +netplay. Or good netplay. + +________________________________________________________________________ + +Chapter 4: +Mac, Linux & Dreamcast Specific Questions + Or +Don't Buy into the Paneful Propaganda + +Q: My buddy, whose soul has been lost to M$, says he can run games like Doom and +Starfox2, but Snes9x on my Mac has all sorts of problems when running them. What I +do? + A: The aforementioned games, as well as a few others, use a special chip called the +Super FX. To emulate this chip the Windows port uses an i386 assembler core, while the +Mac uses a c++ core. Full support for the Super FX chip has not yet been implemented +due to the differences in coding. + +________________________________________________________________________ + +Chapter 5: +Miscellaneous Questions + Or +Q-Bert Is My Only Friend + +Q: Is it legal?! + A: This has been asked time and again, and the answer is yes. Developing, +downloading, or using the emulator, Snes9x, is completely legal. Downloading games, +called ROMS, however is not. If you own the original cartridge of a game, you are still +not entitled to download the ROM image of that game. You may create a single backup +image of your own cartridge via proper hardware, but it must be YOUR cartridge and is +only usable in place of the original... so only one may be active at any time. Many sites +claim that you may legally download ROMs for up to 24 hours before they must be +deleted. This is also wrong; you can't legally download these for "trial" purposes. You +can't download ROMs for educational purposes either. If you wish to use Super Nintendo +Entertainment System games for educational purposes, contact your closest Nintendo +Outlet and discuss educational programming with them. Finally, a small number of +ROMs are labeled "(PD)". This means public domain, and these games are not under +copyright. As such they are legal to download at your hearts content. These include +programs created by internet users such as yourself for use in Super Nintendo emulators. +As of this time there are no commercial videogames in the public domain. + +Q: My friend, Tibby, says that you are wrong and that game companies don't care if you +download games! + A: Whilst not actually a question, and more of a statement, I am afraid Tibby is +incorrect. Feel free to peruse the various legal documentation sprawled throughout the +World Wide Web or your local constituency. As for the blatant generalization that +companies do not care; At least one does, and truthfully many more do as well, as such +the statement is obviously a fallacy. For those who think it is not fair, or shouldn't be the +way it is... perhaps not, though as holders of a copyright it is up to Nintendo to decide +how and when their products are distributed. + +Q: I just purchased your fine program off eBay for $19.89, but my friend says I can +download it for free. Can you guys give me my money back? + A: Okay, this question hasn't actually been asked, however our free downloadable +program does seem to get sold on eBay more often than it should, which is to say at all. +We cannot reimburse anyone who was unlucky enough to be scammed into purchasing +Snes9x, just as McDonalds cannot reimburse you if you purchased 100 Happy Meals +from a random stranger and he gave you a frozen fish. If you find yourself in this +situation... Purchasing Snes9x, not frozen fish... Please take the time to inform eBay via +their heavily disguised investigations department, and leave any negative feedback that +you wish. It would also be appreciated by the Snes9x team if you could mention where +and when this happened so that we can take measures to stop it from happening again. +While the fact we aren't making money from the program in no way bothers us (It is +freeware after all), that some grubby bastards are does. + +Q: So err, where exactly do I contact y'all, eh? + A: The most convenient way to contact us would be via www.snes9x.com. There is a +forum that is checked at least 12 times a day by regulars, and at least a few of us can +actually give some advice. E-mail is also a possibility, though it is much slower, and +you'll hafta find the e-mail addresses on your own. Be sure to read the FAQ and Read me +before posting, as things already answered many a time will probably result in random +insults or heavy sarcasm. + +Q: Is Maria S. Kendora available? + A: No, at present time she is happily involved with a very nice man, and as such is not +accepting proposals unless you are rich, handsome AND live in the southern peninsula of +France, next to Andorra. diff -NaHudr snes9x-1.43-src/how2compile.txt snx/how2compile.txt --- snes9x-1.43-src/how2compile.txt 2004-12-31 00:15:55.000000000 +0200 +++ snx/how2compile.txt 2005-04-09 00:59:23.000000000 +0300 @@ -1,7 +1,10 @@ Various software and tools are required to compile Snes9x on Windows: -- Microsoft Visual C++ 6.0 SP5 with the latest Platform SDK to compile all the - C++ source code.. +- Microsoft Visual C++ 6.0 to compile all the C++ source code except for some + parts of the GUI. + +- Borland C++ Builder v3 or V4 to compile the remaining GUI items. If you don't + want to update those three GUI portions then it is not required. - gcc(optional) - I use version 2.95.2. Used to assemble various CPU i386 asm cores that I wrote. Available as part of Cygwin - a UNIX-like environment diff -NaHudr snes9x-1.43-src/info.txt snx/info.txt --- snes9x-1.43-src/info.txt 1970-01-01 02:00:00.000000000 +0200 +++ snx/info.txt 2005-04-09 00:59:23.000000000 +0300 @@ -0,0 +1,55 @@ +Snes9x 1.43 improvement v6 + +Newest change(s) in this version: +* Terranigma desync bug fixed (incorporated into Fake Mute option) (nitsuja) +* Added "Clear SRAM" option to recording dialog, so you can make sure you're starting from a totally clean state. (nitsuja) +* Added alternate save state system (increment/decrement/save/load current slot, as new hotkeys). (nitsuja) +* Made "save screenshot" a customizable hotkey. (nitsuja) +* Moved frame counter display to not overwrite other messages, changed messages and message timings a bit. (nitsuja) + +General: +* Made "Pause When Inactive" an option in the Settings dialog, so you can turn it off if you want Snes9x to keep playing games when it isn't the active window. If you also want sound to play while it's inactive, you can set Sound Driver to "FMOD DirectSound" in the Sound Settings menu. (nitsuja) + +Input-Related: +* Customizable hotkeys (nitsuja) +* The option to allow left+right and up+down to be pressed has been added. (nitsuja) +* Option to display pressed input buttons (credit to Bisqwit) +* Removed 1-frame lag from the input that's displayed. (nitsuja) +* Added ability to toggle a button on or lock it on autofire using modifiers or a per-controller toggle switch. Very useful for getting around the maximum limit of keys your keyboard lets you hold at once, and also for relieving you from having to hold a button for extended periods of time. +* Fixed joypad dialog and added turbo buttons (nitsuja) +* Made "fast-forward" and "show input" customizable hotkeys, so input can now be shown while playing. (nitsuja) + +Graphics-Related: +* Made black bar at bottom of game optional (nitsuja) +* Added a display option to maintain correct aspect ratio. (nitsuja) +* Enabled the GUI option to use video memory and bilinear-filter any mode, not just OpenGL + +Sound-Related: +* Gave frame advance sound (optional) (nitsuja) + +Movie-Related: +* Zelda desync bug fixed! (credit to FabianX) +* OotW/PoP2 sound desync bug fixed (Fake Mute desync workaround option) (credit to Bisqwit) +* Movie length limit fixed (credit to Bisqwit and DeHackEd) +* Movie play and record dialogs contain relevant sync-related emulator options. (nitsuja) +* An option to switch between WIP and Final timing has been added, so you can record for the version of your choice and play back either type of movie. (nitsuja) +* Incorporated important sync settings being saved into movies upon record and re-record, and loaded from them on playback. (Currently, you must click Browse... and select the movie for it to load the sync settings.) This does not interfere with official version compatibility going in either direction, at least not with the 1.43 Final or WIP. (nitsuja) +* Changed it so left+right does not even get recorded into the movie if the left+right option is not enabled. (Snes9x used to always record both directions into the movie even when it ignored one of them.) (nitsuja) +* Changed default to read-only for playing movies, since more people seem to prefer that being the default. (nitsuja) +* The ROM's CRC32 and name are now stored in recorded movie files, and displayed along with your current ROM upon loading. Old movies that are modified using this version will have the new information inserted into the movie using the current ROM. Backward compatibility is still maintained. (nitsuja) + +Movie Compatibility -- Because there is now an option to switch between timing modes: +* This version can play all movies made with either the Final or the WIP, with the right settings on. +* This version can make movies for either the Final or the WIP, whichever is desired. + +Known Issues / things to watch out for: +* If you do not record a movie with the WIP1 timing, you may get occasional desyncs while recording, because this is how the official Snes9x 1.43 Final version behaves. +* Some games (such as Terranigma) desync when you play them at too high a speed (such as with fast-forward) due to unknown reasons. +* Some games (such as Super Bomberman 2 and Mortal Kombat II) require Volume Height Envelope Reading to be OFF to record reliably. +* Some games (such as Nosferatu) still rely on specific sound settings (such as a certain KHz rate, etc.) to play back reliably. +* Movies will still desync if you play them without letting the game emulate for at least 10 seconds to "warm up" first. +* Turning on Left+Right/Up+Down may cause movies that were made without this option to desync. +* If you turn on Left+Right/Up+Down, no *official* version of the Snes9x emulator will be able to play back the movie that's generated. +* If a movie of a game that was affected by the sound desync bug (such as Out of this World) is recorded with this emulator, it can also be played back in this version, but if you want to play it back with an official version you'll have to set the sound playback rate to when playing it. +* The input that is displayed is not updated between frames; you have to advance at least one frame to see the new input you're entering be displayed. +* Key conflict catching is not very comprehensive and can also catches things that are no longer conflicts (in which case, just ignore the color). diff -NaHudr snes9x-1.43-src/InputCustom.cpp snx/InputCustom.cpp --- snes9x-1.43-src/InputCustom.cpp 2004-12-31 00:15:55.000000000 +0200 +++ snx/InputCustom.cpp 2005-04-09 00:59:23.000000000 +0300 @@ -1,691 +1,1027 @@ -#define STRICT -#include -#include -#include -#include -#include "InputCustom.h" -#include "wsnes9x.h" -#include "language.h" - -static TCHAR szClassName[] = _T("InputCustom"); - -LRESULT CALLBACK InputCustomWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); -typedef struct -{ - COLORREF crForeGnd; // Foreground text colour - COLORREF crBackGnd; // Background text colour - HFONT hFont; // The font - HWND hwnd; // The control's window handle -} InputCust; - - -extern SJoyState JoystickF [16]; - -HWND funky; -WPARAM tid; - - -void JoystickChanged( short ID, short Movement) -{ - WORD JoyKey; - - JoyKey = 0x8000; - JoyKey |= (WORD)(ID << 8); - JoyKey |= Movement; - SendMessage(funky,WM_USER+45,JoyKey,0); - KillTimer(funky,tid); - - -} - -int FunkyNormalize(int cur, int min, int max) -{ - int Result = 0; - - if ((max - min) == 0) - - return (Result); - - Result = cur - min; - Result = (Result * 200) / (max - min); - Result -= 100; - - return Result; -} - - -void CheckAxis (short joy, short control, int val, - int min, int max, - bool &first, bool &second) -{ - - - - if (FunkyNormalize (val, min, max) < -S9X_JOY_NEUTRAL) - - { - second = false; - if (!first) - { - JoystickChanged (joy, control); - first = true; - - } - } - else - first = false; - - if (FunkyNormalize (val, min, max) > S9X_JOY_NEUTRAL) - { - first = false; - if (!second) - { - JoystickChanged (joy, (short) (control + 1)); - second = true; - } - } - else - second = false; -} - -void FunkyJoyStickTimer() -{ - JOYINFOEX jie; - - for (short C = 0; C != 16; C ++) - { - - jie.dwSize = sizeof( jie); - jie.dwFlags = JOY_RETURNALL; - - if (joyGetPosEx (JOYSTICKID1 + C, &jie) != JOYERR_NOERROR) - continue; - - CheckAxis (C, 0, jie.dwXpos, - JoystickF[C].Caps.wXmin, JoystickF[C].Caps.wXmax, - JoystickF[C].Left, JoystickF[C].Right); - CheckAxis (C, 2, jie.dwYpos, - JoystickF[C].Caps.wYmin, JoystickF[C].Caps.wYmax, - JoystickF[C].Up, JoystickF[C].Down); - if(JoystickF[C].Caps.wCaps & JOYCAPS_HASZ) - { - CheckAxis (C, 41, jie.dwZpos, - JoystickF[C].Caps.wZmin, JoystickF[C].Caps.wZmax, - JoystickF[C].ZUp, JoystickF[C].ZDown); - } - if(JoystickF[C].Caps.wCaps & JOYCAPS_HASR) - { - CheckAxis (C, 43, jie.dwRpos, - JoystickF[C].Caps.wRmin, JoystickF[C].Caps.wRmax, - JoystickF[C].RUp, JoystickF[C].RDown); - } - if(JoystickF[C].Caps.wCaps & JOYCAPS_HASU) - { - CheckAxis (C, 45, jie.dwUpos, - JoystickF[C].Caps.wUmin, JoystickF[C].Caps.wUmax, - JoystickF[C].UUp, JoystickF[C].UDown); - } - if(JoystickF[C].Caps.wCaps & JOYCAPS_HASV) - { - CheckAxis (C, 47, jie.dwVpos, - JoystickF[C].Caps.wVmin, JoystickF[C].Caps.wVmax, - JoystickF[C].VUp, JoystickF[C].VDown); - } - - switch (jie.dwPOV) - { - case JOY_POVBACKWARD: - if( !JoystickF[C].PovDown) - { JoystickChanged( C, 7); } - - JoystickF[C].PovDown = true; - JoystickF[C].PovUp = false; - JoystickF[C].PovLeft = false; - JoystickF[C].PovRight = false; - JoystickF[C].PovDnLeft = false; - JoystickF[C].PovDnRight = false; - JoystickF[C].PovUpLeft = false; - JoystickF[C].PovUpRight = false; - break; - case 4500: - if( !JoystickF[C].PovUpRight) - { JoystickChanged( C, 52); } - JoystickF[C].PovDown = false; - JoystickF[C].PovUp = false; - JoystickF[C].PovLeft = false; - JoystickF[C].PovRight = false; - JoystickF[C].PovDnLeft = false; - JoystickF[C].PovDnRight = false; - JoystickF[C].PovUpLeft = false; - JoystickF[C].PovUpRight = true; - break; - case 13500: - if( !JoystickF[C].PovDnRight) - { JoystickChanged( C, 50); } - JoystickF[C].PovDown = false; - JoystickF[C].PovUp = false; - JoystickF[C].PovLeft = false; - JoystickF[C].PovRight = false; - JoystickF[C].PovDnLeft = false; - JoystickF[C].PovDnRight = true; - JoystickF[C].PovUpLeft = false; - JoystickF[C].PovUpRight = false; - break; - case 22500: - if( !JoystickF[C].PovDnLeft) - { JoystickChanged( C, 49); } - JoystickF[C].PovDown = false; - JoystickF[C].PovUp = false; - JoystickF[C].PovLeft = false; - JoystickF[C].PovRight = false; - JoystickF[C].PovDnLeft = true; - JoystickF[C].PovDnRight = false; - JoystickF[C].PovUpLeft = false; - JoystickF[C].PovUpRight = false; - break; - case 31500: - if( !JoystickF[C].PovUpLeft) - { JoystickChanged( C, 51); } - JoystickF[C].PovDown = false; - JoystickF[C].PovUp = false; - JoystickF[C].PovLeft = false; - JoystickF[C].PovRight = false; - JoystickF[C].PovDnLeft = false; - JoystickF[C].PovDnRight = false; - JoystickF[C].PovUpLeft = true; - JoystickF[C].PovUpRight = false; - break; - - case JOY_POVFORWARD: - if( !JoystickF[C].PovUp) - { JoystickChanged( C, 6); } - - JoystickF[C].PovDown = false; - JoystickF[C].PovUp = true; - JoystickF[C].PovLeft = false; - JoystickF[C].PovRight = false; - JoystickF[C].PovDnLeft = false; - JoystickF[C].PovDnRight = false; - JoystickF[C].PovUpLeft = false; - JoystickF[C].PovUpRight = false; - break; - - case JOY_POVLEFT: - if( !JoystickF[C].PovLeft) - { JoystickChanged( C, 4); } - - JoystickF[C].PovDown = false; - JoystickF[C].PovUp = false; - JoystickF[C].PovLeft = true; - JoystickF[C].PovRight = false; - JoystickF[C].PovDnLeft = false; - JoystickF[C].PovDnRight = false; - JoystickF[C].PovUpLeft = false; - JoystickF[C].PovUpRight = false; - break; - - case JOY_POVRIGHT: - if( !JoystickF[C].PovRight) - { JoystickChanged( C, 5); } - - JoystickF[C].PovDown = false; - JoystickF[C].PovUp = false; - JoystickF[C].PovLeft = false; - JoystickF[C].PovRight = true; - JoystickF[C].PovDnLeft = false; - JoystickF[C].PovDnRight = false; - JoystickF[C].PovUpLeft = false; - JoystickF[C].PovUpRight = false; - break; - - default: - JoystickF[C].PovDown = false; - JoystickF[C].PovUp = false; - JoystickF[C].PovLeft = false; - JoystickF[C].PovRight = false; - JoystickF[C].PovDnLeft = false; - JoystickF[C].PovDnRight = false; - JoystickF[C].PovUpLeft = false; - JoystickF[C].PovUpRight = false; - break; - } - - for( short B = 0; B != 32; B ++, jie.dwButtons >>= 1) - if( (jie.dwButtons&1)) - { - if( !JoystickF[C].Button[B]) - { - JoystickChanged( C, (short)(8+B)); - JoystickF[C].Button[B] = true; - } - } - else - { JoystickF[C].Button[B] = false; } - - } - - - - - -} -void TranslateKey(WORD keyz,char *out) -{ - char temp[100]; - if(keyz&0x8000) - { - sprintf(out,GAMEDEVICE_JOYNUMPREFIX,((keyz>>8)&0xF)); - switch(keyz&0xFF) - { - case 0: strncat(out,GAMEDEVICE_XNEG,4); break; - case 1: strncat(out,GAMEDEVICE_XPOS,5); break; - case 2: strncat(out,GAMEDEVICE_YPOS,2); break; - case 3: strncat(out,GAMEDEVICE_YNEG,4); break; - case 4: strncat(out,GAMEDEVICE_POVLEFT,8); break; - case 5: strncat(out,GAMEDEVICE_POVRIGHT,9); break; - case 6: strncat(out,GAMEDEVICE_POVUP,6); break; - case 7: strncat(out,GAMEDEVICE_POVDOWN,8); break; - case 49: strncat(out,GAMEDEVICE_POVDNLEFT,11); break; - case 50: strncat(out,GAMEDEVICE_POVDNRIGHT,12); break; - case 51: strncat(out,GAMEDEVICE_POVUPLEFT,11); break; - case 52: strncat(out,GAMEDEVICE_POVUPRIGHT,12); break; - case 41: strncat(out,GAMEDEVICE_ZPOS,4); break; - case 42: strncat(out,GAMEDEVICE_ZNEG,6); break; - case 43: strncat(out,GAMEDEVICE_RPOS,4); break; - case 44: strncat(out,GAMEDEVICE_RNEG,6); break; - case 45: strncat(out,GAMEDEVICE_UPOS,4); break; - case 46: strncat(out,GAMEDEVICE_UNEG,6); break; - case 47: strncat(out,GAMEDEVICE_VPOS,4); break; - case 48: strncat(out,GAMEDEVICE_VNEG,6); break; - default: - if ((keyz & 0xff) > 40) - { - sprintf(temp,GAMEDEVICE_JOYBUTPREFIX,keyz&0xFF); - strncat(out,temp,strlen(temp)); - break; - } - - sprintf(temp,GAMEDEVICE_BUTTON,(keyz&0xFF)-8); - strncat(out,temp,strlen(temp)); - break; - - } - return; - } - sprintf(out,GAMEDEVICE_KEY,keyz); - if((keyz>='0' && keyz<='9')||(keyz>='A' &&keyz<='Z')) - { - sprintf(out,"%c",keyz); - return; - } - if( keyz >= VK_NUMPAD0 && keyz <= VK_NUMPAD9) - { - - sprintf(out,GAMEDEVICE_NUMPADPREFIX,'0'+(keyz-VK_NUMPAD0)); - - return ; - } - switch(keyz) - { - case 0: sprintf(out,GAMEDEVICE_DISABLED); break; - case VK_TAB: sprintf(out,GAMEDEVICE_VK_TAB); break; - case VK_BACK: sprintf(out,GAMEDEVICE_VK_BACK); break; - case VK_CLEAR: sprintf(out,GAMEDEVICE_VK_CLEAR); break; - case VK_RETURN: sprintf(out,GAMEDEVICE_VK_RETURN); break; - case VK_LSHIFT: sprintf(out,GAMEDEVICE_VK_LSHIFT); break; - case VK_RSHIFT: sprintf(out,GAMEDEVICE_VK_RSHIFT); break; - case VK_LCONTROL: sprintf(out,GAMEDEVICE_VK_LCONTROL); break; - case VK_RCONTROL: sprintf(out,GAMEDEVICE_VK_RCONTROL); break; - case VK_LMENU: sprintf(out,GAMEDEVICE_VK_LMENU); break; - case VK_RMENU: sprintf(out,GAMEDEVICE_VK_RMENU); break; - case VK_PAUSE: sprintf(out,GAMEDEVICE_VK_PAUSE); break; - case VK_CAPITAL: sprintf(out,GAMEDEVICE_VK_CAPITAL); break; - case VK_ESCAPE: sprintf(out,GAMEDEVICE_VK_ESCAPE); break; - case VK_SPACE: sprintf(out,GAMEDEVICE_VK_SPACE); break; - case VK_PRIOR: sprintf(out,GAMEDEVICE_VK_PRIOR); break; - case VK_NEXT: sprintf(out,GAMEDEVICE_VK_NEXT); break; - case VK_HOME: sprintf(out,GAMEDEVICE_VK_HOME); break; - case VK_END: sprintf(out,GAMEDEVICE_VK_END); break; - case VK_LEFT: sprintf(out,GAMEDEVICE_VK_LEFT ); break; - case VK_RIGHT: sprintf(out,GAMEDEVICE_VK_RIGHT); break; - case VK_UP: sprintf(out,GAMEDEVICE_VK_UP); break; - case VK_DOWN: sprintf(out,GAMEDEVICE_VK_DOWN); break; - case VK_SELECT: sprintf(out,GAMEDEVICE_VK_SELECT); break; - case VK_PRINT: sprintf(out,GAMEDEVICE_VK_PRINT); break; - case VK_EXECUTE: sprintf(out,GAMEDEVICE_VK_EXECUTE); break; - case VK_SNAPSHOT: sprintf(out,GAMEDEVICE_VK_SNAPSHOT); break; - case VK_INSERT: sprintf(out,GAMEDEVICE_VK_INSERT); break; - case VK_DELETE: sprintf(out,GAMEDEVICE_VK_DELETE); break; - case VK_HELP: sprintf(out,GAMEDEVICE_VK_HELP); break; - case VK_LWIN: sprintf(out,GAMEDEVICE_VK_LWIN); break; - case VK_RWIN: sprintf(out,GAMEDEVICE_VK_RWIN); break; - case VK_APPS: sprintf(out,GAMEDEVICE_VK_APPS); break; - case VK_MULTIPLY: sprintf(out,GAMEDEVICE_VK_MULTIPLY); break; - case VK_ADD: sprintf(out,GAMEDEVICE_VK_ADD); break; - case VK_SEPARATOR: sprintf(out,GAMEDEVICE_VK_SEPARATOR); break; - case VK_OEM_1: sprintf(out,GAMEDEVICE_VK_OEM_1); break; - case VK_OEM_7: sprintf(out,GAMEDEVICE_VK_OEM_7); break; - case VK_OEM_COMMA: sprintf(out,GAMEDEVICE_VK_OEM_COMMA );break; - case VK_OEM_PERIOD: sprintf(out,GAMEDEVICE_VK_OEM_PERIOD);break; - case VK_SUBTRACT: sprintf(out,GAMEDEVICE_VK_SUBTRACT); break; - case VK_DECIMAL: sprintf(out,GAMEDEVICE_VK_DECIMAL); break; - case VK_DIVIDE: sprintf(out,GAMEDEVICE_VK_DIVIDE); break; - case VK_NUMLOCK: sprintf(out,GAMEDEVICE_VK_NUMLOCK); break; - case VK_SCROLL: sprintf(out,GAMEDEVICE_VK_SCROLL); break; - - - - } - - return ; - - - -} -COLORREF CheckKey( WORD Key) -{ - COLORREF red,blue,white; - red =RGB(255,0,0); - blue = RGB(0,0,255); - white = RGB(255,255,255); - // Check for windows keys - if( Key == VK_MENU || Key == VK_CAPITAL || Key == VK_LWIN || - Key == VK_RWIN || Key == VK_APPS) - { - //return 1; - return red; - } - - // Check for Snes9X keys - if ((Key >= VK_F1 && Key <= VK_F9) || Key == VK_F12 || Key == VK_TAB || - Key == VK_OEM_MINUS || Key == VK_OEM_PLUS || Key == VK_OEM_3 || (Key >= 0x30 && Key <= 0x39)) - { - return red; - } - - // Check for duplicate keys - int Found = 0; - for( int J = 0; J != 5; J++) - { - - - - //if( J == OldJoypad) - //{ continue; } - - if( Key == Joypad[J].Left) - { Found ++; } - if( Key == Joypad[J].Left_Up) - { Found ++; } - if( Key == Joypad[J].Left_Down) - { Found ++; } - if( Key == Joypad[J].Right) - { Found ++; } - if( Key == Joypad[J].Right_Up) - { Found ++; } - if( Key == Joypad[J].Right_Down) - { Found ++; } - if( Key == Joypad[J].Up) - { Found ++; } - if( Key == Joypad[J].Down) - { Found ++; } - if( Key == Joypad[J].Start) - { Found ++; } - if( Key == Joypad[J].Select) - { Found ++; } - if( Key == Joypad[J].A) - { Found ++; } - if( Key == Joypad[J].B) - { Found ++; } - if( Key == Joypad[J].X) - { Found ++; } - if( Key == Joypad[J].Y) - { Found ++; } - if( Key == Joypad[J].L) - { Found ++; } - if( Key == Joypad[J].R) - { Found ++; } - } - - - - - if( Found > 1) - { - return blue; - } - - return white; -} -void InitInputCustomControl() -{ - - WNDCLASSEX wc; - - wc.cbSize = sizeof(wc); - wc.lpszClassName = szClassName; - wc.hInstance = GetModuleHandle(0); - wc.lpfnWndProc = InputCustomWndProc; - wc.hCursor = LoadCursor (NULL, IDC_ARROW); - wc.hIcon = 0; - wc.lpszMenuName = 0; - wc.hbrBackground = (HBRUSH)GetSysColorBrush(COLOR_BTNFACE); - wc.style = 0; - wc.cbClsExtra = 0; - wc.cbWndExtra = sizeof(InputCust *); - wc.hIconSm = 0; - - - RegisterClassEx(&wc); - -} -HWND CreateInputCustom(HWND hwndParent) -{ - HWND hwndCtrl; - - hwndCtrl = CreateWindowEx( - WS_EX_CLIENTEDGE, // give it a standard border - szClassName, - _T("A custom control"), - WS_VISIBLE | WS_CHILD, - 0, 0, 100, 100, - hwndParent, - NULL, GetModuleHandle(0), NULL - ); - - return hwndCtrl; -} -static InputCust * GetInputCustom(HWND hwnd) -{ - return (InputCust *)GetWindowLong(hwnd, 0); -} - -void SetInputCustom(HWND hwnd, InputCust *icp) -{ - SetWindowLong(hwnd, 0, (LONG)icp); -} - -LRESULT InputCustom_OnPaint(InputCust *ccp, WPARAM wParam, LPARAM lParam) -{ - HDC hdc; - PAINTSTRUCT ps; - HANDLE hOldFont; - TCHAR szText[200]; - RECT rect; - SIZE sz; - int x,y; - - // Get a device context for this window - hdc = BeginPaint(ccp->hwnd, &ps); - - // Set the font we are going to use - hOldFont = SelectObject(hdc, ccp->hFont); - - // Set the text colours - SetTextColor(hdc, ccp->crForeGnd); - SetBkColor (hdc, ccp->crBackGnd); - - // Find the text to draw - GetWindowText(ccp->hwnd, szText, sizeof(szText)); - - // Work out where to draw - GetClientRect(ccp->hwnd, &rect); - - - // Find out how big the text will be - GetTextExtentPoint32(hdc, szText, lstrlen(szText), &sz); - - // Center the text - x = (rect.right - sz.cx) / 2; - y = (rect.bottom - sz.cy) / 2; - - // Draw the text - ExtTextOut(hdc, x, y, ETO_OPAQUE, &rect, szText, lstrlen(szText), 0); - - // Restore the old font when we have finished - SelectObject(hdc, hOldFont); - - // Release the device context - EndPaint(ccp->hwnd, &ps); - - return 0; -} - -static LRESULT CALLBACK InputCustomWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - // retrieve the custom structure POINTER for THIS window - InputCust *icp = GetInputCustom(hwnd); - HWND pappy = (HWND__ *)GetWindowLongPtr(hwnd,GWL_HWNDPARENT); - funky= hwnd; - - char temp[100]; - COLORREF col; - switch(msg) - { - case WM_GETDLGCODE: - return DLGC_WANTARROWS|DLGC_WANTALLKEYS|DLGC_WANTCHARS; - break; - - - case WM_NCCREATE: - - // Allocate a new CustCtrl structure for this window. - icp = (InputCust *) malloc( sizeof(InputCust) ); - - // Failed to allocate, stop window creation. - if(icp == NULL) return FALSE; - - // Initialize the CustCtrl structure. - icp->hwnd = hwnd; - icp->crForeGnd = GetSysColor(COLOR_WINDOWTEXT); - icp->crBackGnd = GetSysColor(COLOR_WINDOW); - icp->hFont = (HFONT__ *) GetStockObject(DEFAULT_GUI_FONT); - - // Assign the window text specified in the call to CreateWindow. - SetWindowText(hwnd, ((CREATESTRUCT *)lParam)->lpszName); - - // Attach custom structure to this window. - SetInputCustom(hwnd, icp); - - InvalidateRect(icp->hwnd, NULL, FALSE); - UpdateWindow(icp->hwnd); - return true; - - // Continue with window creation. - return TRUE; - - // Clean up when the window is destroyed. - case WM_NCDESTROY: - free(icp); - break; - case WM_PAINT: - return InputCustom_OnPaint(icp,wParam,lParam); - break; - case WM_ERASEBKGND: - return 1; - case WM_USER+45: - case WM_KEYDOWN: - TranslateKey(wParam,temp); - col = CheckKey(wParam); - - icp->crForeGnd = ((~col) & 0x00ffffff); - icp->crBackGnd = col; - SetWindowText(hwnd,temp); - InvalidateRect(icp->hwnd, NULL, FALSE); - UpdateWindow(icp->hwnd); - SendMessage(pappy,WM_USER+43,wParam,(LPARAM)hwnd); - - break; - case WM_USER+44: - - TranslateKey(wParam,temp); - if(IsWindowEnabled(hwnd)) - { - col = CheckKey(wParam); - } - else - { - col = RGB( 192,192,192); - } - icp->crForeGnd = ((~col) & 0x00ffffff); - icp->crBackGnd = col; - SetWindowText(hwnd,temp); - InvalidateRect(icp->hwnd, NULL, FALSE); - UpdateWindow(icp->hwnd); - - break; - - case WM_SETFOCUS: - { - col = RGB( 0,255,0); - icp->crForeGnd = ((~col) & 0x00ffffff); - icp->crBackGnd = col; - InvalidateRect(icp->hwnd, NULL, FALSE); - UpdateWindow(icp->hwnd); - tid = wParam; - - - SetTimer(hwnd,tid,125,NULL); - - - break; - } - case WM_KILLFOCUS: - { - /*col = RGB( 255,255,255); - icp->crForeGnd = ((~col) & 0x00ffffff); - icp->crBackGnd = col; - InvalidateRect(icp->hwnd, NULL, FALSE); - UpdateWindow(icp->hwnd);*/ - break; - } - - case WM_TIMER: - FunkyJoyStickTimer(); - break; - case WM_LBUTTONDOWN: - SetFocus(hwnd); - break; - case WM_ENABLE: - COLORREF col; - if(wParam) - { - col = RGB( 255,255,255); - icp->crForeGnd = ((~col) & 0x00ffffff); - icp->crBackGnd = col; - } - else - { - col = RGB( 192,192,192); - icp->crForeGnd = ((~col) & 0x00ffffff); - icp->crBackGnd = col; - } - InvalidateRect(icp->hwnd, NULL, FALSE); - UpdateWindow(icp->hwnd); - return true; - default: - break; - } - - return DefWindowProc(hwnd, msg, wParam, lParam); -} \ No newline at end of file +#define STRICT +#include +#include +#include +#include +#include "InputCustom.h" +#include "wsnes9x.h" +#include "language.h" + +static TCHAR szClassName[] = _T("InputCustom"); +static TCHAR szHotkeysClassName[] = _T("InputCustomHot"); + +LRESULT CALLBACK InputCustomWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); +LRESULT CALLBACK CharInputCustomWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + + +extern SJoyState JoystickF [16]; + +HWND funky; +WPARAM tid; + + +void JoystickChanged( short ID, short Movement) +{ + WORD JoyKey; + + JoyKey = 0x8000; + JoyKey |= (WORD)(ID << 8); + JoyKey |= Movement; + SendMessage(funky,WM_USER+45,JoyKey,0); + KillTimer(funky,tid); + + +} + +int FunkyNormalize(int cur, int min, int max) +{ + int Result = 0; + + if ((max - min) == 0) + + return (Result); + + Result = cur - min; + Result = (Result * 200) / (max - min); + Result -= 100; + + return Result; +} + + +void CheckAxis (short joy, short control, int val, + int min, int max, + bool &first, bool &second) +{ + + + + if (FunkyNormalize (val, min, max) < -S9X_JOY_NEUTRAL) + + { + second = false; + if (!first) + { + JoystickChanged (joy, control); + first = true; + + } + } + else + first = false; + + if (FunkyNormalize (val, min, max) > S9X_JOY_NEUTRAL) + { + first = false; + if (!second) + { + JoystickChanged (joy, (short) (control + 1)); + second = true; + } + } + else + second = false; +} + +void FunkyJoyStickTimer() +{ + JOYINFOEX jie; + + for (short C = 0; C != 16; C ++) + { + + jie.dwSize = sizeof( jie); + jie.dwFlags = JOY_RETURNALL; + + if (joyGetPosEx (JOYSTICKID1 + C, &jie) != JOYERR_NOERROR) + continue; + + CheckAxis (C, 0, jie.dwXpos, + JoystickF[C].Caps.wXmin, JoystickF[C].Caps.wXmax, + JoystickF[C].Left, JoystickF[C].Right); + CheckAxis (C, 2, jie.dwYpos, + JoystickF[C].Caps.wYmin, JoystickF[C].Caps.wYmax, + JoystickF[C].Up, JoystickF[C].Down); + if(JoystickF[C].Caps.wCaps & JOYCAPS_HASZ) + { + CheckAxis (C, 41, jie.dwZpos, + JoystickF[C].Caps.wZmin, JoystickF[C].Caps.wZmax, + JoystickF[C].ZUp, JoystickF[C].ZDown); + } + if(JoystickF[C].Caps.wCaps & JOYCAPS_HASR) + { + CheckAxis (C, 43, jie.dwRpos, + JoystickF[C].Caps.wRmin, JoystickF[C].Caps.wRmax, + JoystickF[C].RUp, JoystickF[C].RDown); + } + if(JoystickF[C].Caps.wCaps & JOYCAPS_HASU) + { + CheckAxis (C, 45, jie.dwUpos, + JoystickF[C].Caps.wUmin, JoystickF[C].Caps.wUmax, + JoystickF[C].UUp, JoystickF[C].UDown); + } + if(JoystickF[C].Caps.wCaps & JOYCAPS_HASV) + { + CheckAxis (C, 47, jie.dwVpos, + JoystickF[C].Caps.wVmin, JoystickF[C].Caps.wVmax, + JoystickF[C].VUp, JoystickF[C].VDown); + } + + switch (jie.dwPOV) + { + case JOY_POVBACKWARD: + if( !JoystickF[C].PovDown) + { JoystickChanged( C, 7); } + + JoystickF[C].PovDown = true; + JoystickF[C].PovUp = false; + JoystickF[C].PovLeft = false; + JoystickF[C].PovRight = false; + JoystickF[C].PovDnLeft = false; + JoystickF[C].PovDnRight = false; + JoystickF[C].PovUpLeft = false; + JoystickF[C].PovUpRight = false; + break; + case 4500: + if( !JoystickF[C].PovUpRight) + { JoystickChanged( C, 52); } + JoystickF[C].PovDown = false; + JoystickF[C].PovUp = false; + JoystickF[C].PovLeft = false; + JoystickF[C].PovRight = false; + JoystickF[C].PovDnLeft = false; + JoystickF[C].PovDnRight = false; + JoystickF[C].PovUpLeft = false; + JoystickF[C].PovUpRight = true; + break; + case 13500: + if( !JoystickF[C].PovDnRight) + { JoystickChanged( C, 50); } + JoystickF[C].PovDown = false; + JoystickF[C].PovUp = false; + JoystickF[C].PovLeft = false; + JoystickF[C].PovRight = false; + JoystickF[C].PovDnLeft = false; + JoystickF[C].PovDnRight = true; + JoystickF[C].PovUpLeft = false; + JoystickF[C].PovUpRight = false; + break; + case 22500: + if( !JoystickF[C].PovDnLeft) + { JoystickChanged( C, 49); } + JoystickF[C].PovDown = false; + JoystickF[C].PovUp = false; + JoystickF[C].PovLeft = false; + JoystickF[C].PovRight = false; + JoystickF[C].PovDnLeft = true; + JoystickF[C].PovDnRight = false; + JoystickF[C].PovUpLeft = false; + JoystickF[C].PovUpRight = false; + break; + case 31500: + if( !JoystickF[C].PovUpLeft) + { JoystickChanged( C, 51); } + JoystickF[C].PovDown = false; + JoystickF[C].PovUp = false; + JoystickF[C].PovLeft = false; + JoystickF[C].PovRight = false; + JoystickF[C].PovDnLeft = false; + JoystickF[C].PovDnRight = false; + JoystickF[C].PovUpLeft = true; + JoystickF[C].PovUpRight = false; + break; + + case JOY_POVFORWARD: + if( !JoystickF[C].PovUp) + { JoystickChanged( C, 6); } + + JoystickF[C].PovDown = false; + JoystickF[C].PovUp = true; + JoystickF[C].PovLeft = false; + JoystickF[C].PovRight = false; + JoystickF[C].PovDnLeft = false; + JoystickF[C].PovDnRight = false; + JoystickF[C].PovUpLeft = false; + JoystickF[C].PovUpRight = false; + break; + + case JOY_POVLEFT: + if( !JoystickF[C].PovLeft) + { JoystickChanged( C, 4); } + + JoystickF[C].PovDown = false; + JoystickF[C].PovUp = false; + JoystickF[C].PovLeft = true; + JoystickF[C].PovRight = false; + JoystickF[C].PovDnLeft = false; + JoystickF[C].PovDnRight = false; + JoystickF[C].PovUpLeft = false; + JoystickF[C].PovUpRight = false; + break; + + case JOY_POVRIGHT: + if( !JoystickF[C].PovRight) + { JoystickChanged( C, 5); } + + JoystickF[C].PovDown = false; + JoystickF[C].PovUp = false; + JoystickF[C].PovLeft = false; + JoystickF[C].PovRight = true; + JoystickF[C].PovDnLeft = false; + JoystickF[C].PovDnRight = false; + JoystickF[C].PovUpLeft = false; + JoystickF[C].PovUpRight = false; + break; + + default: + JoystickF[C].PovDown = false; + JoystickF[C].PovUp = false; + JoystickF[C].PovLeft = false; + JoystickF[C].PovRight = false; + JoystickF[C].PovDnLeft = false; + JoystickF[C].PovDnRight = false; + JoystickF[C].PovUpLeft = false; + JoystickF[C].PovUpRight = false; + break; + } + + for( short B = 0; B != 32; B ++, jie.dwButtons >>= 1) + if( (jie.dwButtons&1)) + { + if( !JoystickF[C].Button[B]) + { + JoystickChanged( C, (short)(8+B)); + JoystickF[C].Button[B] = true; + } + } + else + { JoystickF[C].Button[B] = false; } + + } + + + + + +} + +void TranslateKey(WORD keyz,char *out) +{ +// sprintf(out,"%d",keyz); +// return; + + char temp[100]; + if(keyz&0x8000) + { + sprintf(out,GAMEDEVICE_JOYNUMPREFIX,((keyz>>8)&0xF)); + switch(keyz&0xFF) + { + case 0: strncat(out,GAMEDEVICE_XNEG,4); break; + case 1: strncat(out,GAMEDEVICE_XPOS,5); break; + case 2: strncat(out,GAMEDEVICE_YPOS,2); break; + case 3: strncat(out,GAMEDEVICE_YNEG,4); break; + case 4: strncat(out,GAMEDEVICE_POVLEFT,8); break; + case 5: strncat(out,GAMEDEVICE_POVRIGHT,9); break; + case 6: strncat(out,GAMEDEVICE_POVUP,6); break; + case 7: strncat(out,GAMEDEVICE_POVDOWN,8); break; + case 49: strncat(out,GAMEDEVICE_POVDNLEFT,11); break; + case 50: strncat(out,GAMEDEVICE_POVDNRIGHT,12); break; + case 51: strncat(out,GAMEDEVICE_POVUPLEFT,11); break; + case 52: strncat(out,GAMEDEVICE_POVUPRIGHT,12); break; + case 41: strncat(out,GAMEDEVICE_ZPOS,4); break; + case 42: strncat(out,GAMEDEVICE_ZNEG,6); break; + case 43: strncat(out,GAMEDEVICE_RPOS,4); break; + case 44: strncat(out,GAMEDEVICE_RNEG,6); break; + case 45: strncat(out,GAMEDEVICE_UPOS,4); break; + case 46: strncat(out,GAMEDEVICE_UNEG,6); break; + case 47: strncat(out,GAMEDEVICE_VPOS,4); break; + case 48: strncat(out,GAMEDEVICE_VNEG,6); break; + default: + if ((keyz & 0xff) > 40) + { + sprintf(temp,GAMEDEVICE_JOYBUTPREFIX,keyz&0xFF); + strncat(out,temp,strlen(temp)); + break; + } + + sprintf(temp,GAMEDEVICE_BUTTON,(keyz&0xFF)-8); + strncat(out,temp,strlen(temp)); + break; + + } + return; + } + sprintf(out,GAMEDEVICE_KEY,keyz); + if((keyz>='0' && keyz<='9')||(keyz>='A' &&keyz<='Z')) + { + sprintf(out,"%c",keyz); + return; + } + if( keyz >= VK_NUMPAD0 && keyz <= VK_NUMPAD9) + { + + sprintf(out,GAMEDEVICE_NUMPADPREFIX,'0'+(keyz-VK_NUMPAD0)); + + return ; + } + switch(keyz) + { + case 0: sprintf(out,GAMEDEVICE_DISABLED); break; + case VK_TAB: sprintf(out,GAMEDEVICE_VK_TAB); break; + case VK_BACK: sprintf(out,GAMEDEVICE_VK_BACK); break; + case VK_CLEAR: sprintf(out,GAMEDEVICE_VK_CLEAR); break; + case VK_RETURN: sprintf(out,GAMEDEVICE_VK_RETURN); break; + case VK_LSHIFT: sprintf(out,GAMEDEVICE_VK_LSHIFT); break; + case VK_RSHIFT: sprintf(out,GAMEDEVICE_VK_RSHIFT); break; + case VK_LCONTROL: sprintf(out,GAMEDEVICE_VK_LCONTROL); break; + case VK_RCONTROL: sprintf(out,GAMEDEVICE_VK_RCONTROL); break; + case VK_LMENU: sprintf(out,GAMEDEVICE_VK_LMENU); break; + case VK_RMENU: sprintf(out,GAMEDEVICE_VK_RMENU); break; + case 3: sprintf(out,GAMEDEVICE_VK_PAUSE); break; + case VK_PAUSE: sprintf(out,GAMEDEVICE_VK_PAUSE); break; + case VK_CAPITAL: sprintf(out,GAMEDEVICE_VK_CAPITAL); break; + case VK_ESCAPE: sprintf(out,GAMEDEVICE_VK_ESCAPE); break; + case VK_SPACE: sprintf(out,GAMEDEVICE_VK_SPACE); break; + case VK_PRIOR: sprintf(out,GAMEDEVICE_VK_PRIOR); break; + case VK_NEXT: sprintf(out,GAMEDEVICE_VK_NEXT); break; + case VK_HOME: sprintf(out,GAMEDEVICE_VK_HOME); break; + case VK_END: sprintf(out,GAMEDEVICE_VK_END); break; + case VK_LEFT: sprintf(out,GAMEDEVICE_VK_LEFT ); break; + case VK_RIGHT: sprintf(out,GAMEDEVICE_VK_RIGHT); break; + case VK_UP: sprintf(out,GAMEDEVICE_VK_UP); break; + case VK_DOWN: sprintf(out,GAMEDEVICE_VK_DOWN); break; + case VK_SELECT: sprintf(out,GAMEDEVICE_VK_SELECT); break; + case VK_PRINT: sprintf(out,GAMEDEVICE_VK_PRINT); break; + case VK_EXECUTE: sprintf(out,GAMEDEVICE_VK_EXECUTE); break; + case VK_SNAPSHOT: sprintf(out,GAMEDEVICE_VK_SNAPSHOT); break; + case VK_INSERT: sprintf(out,GAMEDEVICE_VK_INSERT); break; + case VK_DELETE: sprintf(out,GAMEDEVICE_VK_DELETE); break; + case VK_HELP: sprintf(out,GAMEDEVICE_VK_HELP); break; + case VK_LWIN: sprintf(out,GAMEDEVICE_VK_LWIN); break; + case VK_RWIN: sprintf(out,GAMEDEVICE_VK_RWIN); break; + case VK_APPS: sprintf(out,GAMEDEVICE_VK_APPS); break; + case VK_MULTIPLY: sprintf(out,GAMEDEVICE_VK_MULTIPLY); break; + case VK_ADD: sprintf(out,GAMEDEVICE_VK_ADD); break; + case VK_SEPARATOR: sprintf(out,GAMEDEVICE_VK_SEPARATOR); break; + case VK_OEM_1: sprintf(out,GAMEDEVICE_VK_OEM_1); break; + case VK_OEM_7: sprintf(out,GAMEDEVICE_VK_OEM_7); break; + case VK_OEM_COMMA: sprintf(out,GAMEDEVICE_VK_OEM_COMMA );break; + case VK_OEM_PERIOD: sprintf(out,GAMEDEVICE_VK_OEM_PERIOD);break; + case VK_SUBTRACT: sprintf(out,GAMEDEVICE_VK_SUBTRACT); break; + case VK_DECIMAL: sprintf(out,GAMEDEVICE_VK_DECIMAL); break; + case VK_DIVIDE: sprintf(out,GAMEDEVICE_VK_DIVIDE); break; + case VK_NUMLOCK: sprintf(out,GAMEDEVICE_VK_NUMLOCK); break; + case VK_SCROLL: sprintf(out,GAMEDEVICE_VK_SCROLL); break; + case 189: sprintf(out,"-"); break; + case 187: sprintf(out,"="); break; + case 16: sprintf(out,"Shift"); break; + case 17: sprintf(out,"Control"); break; + case 18: sprintf(out,"Alt"); break; + case 219: sprintf(out,"["); break; + case 221: sprintf(out,"]"); break; + case 220: sprintf(out,"\\"); break; + case 191: sprintf(out,"/"); break; + case 192: sprintf(out,"`"); break; + case 112: sprintf(out,"F1"); break; + case 113: sprintf(out,"F2"); break; + case 114: sprintf(out,"F3"); break; + case 115: sprintf(out,"F4"); break; + case 116: sprintf(out,"F5"); break; + case 117: sprintf(out,"F6"); break; + case 118: sprintf(out,"F7"); break; + case 119: sprintf(out,"F8"); break; + case 120: sprintf(out,"F9"); break; + case 121: sprintf(out,"F10"); break; + case 122: sprintf(out,"F11"); break; + case 123: sprintf(out,"F12"); break; + } + + return ; + + + +} +COLORREF CheckKey( WORD Key, int conflictMinHitNum) +{ + COLORREF red,blue,white; + red =RGB(255,0,0); + blue = RGB(0,0,255); + white = RGB(255,255,255); + // Check for windows keys + if( Key == VK_MENU || Key == VK_CAPITAL || Key == VK_LWIN || + Key == VK_RWIN || Key == VK_APPS) + { + //return 1; + return red; + } + + // Check for Snes9X keys + if ((Key >= VK_F1 && Key <= VK_F9) || Key == VK_F12 || Key == VK_TAB || + Key == VK_OEM_MINUS || Key == VK_OEM_PLUS || Key == VK_OEM_3 || (Key >= 0x30 && Key <= 0x39)) + { + return red; + } + + // Check for duplicate keys + int Found = 0; + for( int J = 0; J != 5; J++) + { +// if( J == OldJoypad) + if(!Joypad[J].Enabled) + { continue; } + + if( Key == 0 || Key == 27) // don't complain about multiple keys being set to 'disabled' + { continue; } + + if( Key == Joypad[J].Left) + { Found ++; } + if( Key == Joypad[J].Left_Up) + { Found ++; } + if( Key == Joypad[J].Left_Down) + { Found ++; } + if( Key == Joypad[J].Right) + { Found ++; } + if( Key == Joypad[J].Right_Up) + { Found ++; } + if( Key == Joypad[J].Right_Down) + { Found ++; } + if( Key == Joypad[J].Up) + { Found ++; } + if( Key == Joypad[J].Down) + { Found ++; } + if( Key == Joypad[J].Start) + { Found ++; } + if( Key == Joypad[J].Select) + { Found ++; } + if( Key == Joypad[J].A) + { Found ++; } + if( Key == Joypad[J].B) + { Found ++; } + if( Key == Joypad[J].X) + { Found ++; } + if( Key == Joypad[J].Y) + { Found ++; } + if( Key == Joypad[J].L) + { Found ++; } + if( Key == Joypad[J].R) + { Found ++; } + } + + + + + if( Found > conflictMinHitNum) + { + return blue; + } + + return white; +} +void InitInputCustomControl() +{ + + WNDCLASSEX wc; + + wc.cbSize = sizeof(wc); + wc.lpszClassName = szClassName; + wc.hInstance = GetModuleHandle(0); + wc.lpfnWndProc = InputCustomWndProc; + wc.hCursor = LoadCursor (NULL, IDC_ARROW); + wc.hIcon = 0; + wc.lpszMenuName = 0; + wc.hbrBackground = (HBRUSH)GetSysColorBrush(COLOR_BTNFACE); + wc.style = 0; + wc.cbClsExtra = 0; + wc.cbWndExtra = sizeof(InputCust *); + wc.hIconSm = 0; + + + RegisterClassEx(&wc); + +} +void InitKeyCustomControl() +{ + + WNDCLASSEX wc; + + wc.cbSize = sizeof(wc); + wc.lpszClassName = szHotkeysClassName; + wc.hInstance = GetModuleHandle(0); + wc.lpfnWndProc = CharInputCustomWndProc; + wc.hCursor = LoadCursor (NULL, IDC_ARROW); + wc.hIcon = 0; + wc.lpszMenuName = 0; + wc.hbrBackground = (HBRUSH)GetSysColorBrush(COLOR_BTNFACE); + wc.style = 0; + wc.cbClsExtra = 0; + wc.cbWndExtra = sizeof(InputCust *); + wc.hIconSm = 0; + + + RegisterClassEx(&wc); + +} +HWND CreateInputCustom(HWND hwndParent) +{ + HWND hwndCtrl; + + hwndCtrl = CreateWindowEx( + WS_EX_CLIENTEDGE, // give it a standard border + szClassName, + _T("A custom control"), + WS_VISIBLE | WS_CHILD, + 0, 0, 100, 100, + hwndParent, + NULL, GetModuleHandle(0), NULL + ); + + return hwndCtrl; +} +InputCust * GetInputCustom(HWND hwnd) +{ + return (InputCust *)GetWindowLong(hwnd, 0); +} + +void SetInputCustom(HWND hwnd, InputCust *icp) +{ + SetWindowLong(hwnd, 0, (LONG)icp); +} + +LRESULT InputCustom_OnPaint(InputCust *ccp, WPARAM wParam, LPARAM lParam) +{ + HDC hdc; + PAINTSTRUCT ps; + HANDLE hOldFont; + TCHAR szText[200]; + RECT rect; + SIZE sz; + int x,y; + + // Get a device context for this window + hdc = BeginPaint(ccp->hwnd, &ps); + + // Set the font we are going to use + hOldFont = SelectObject(hdc, ccp->hFont); + + // Set the text colours + SetTextColor(hdc, ccp->crForeGnd); + SetBkColor (hdc, ccp->crBackGnd); + + // Find the text to draw + GetWindowText(ccp->hwnd, szText, sizeof(szText)); + + // Work out where to draw + GetClientRect(ccp->hwnd, &rect); + + + // Find out how big the text will be + GetTextExtentPoint32(hdc, szText, lstrlen(szText), &sz); + + // Center the text + x = (rect.right - sz.cx) / 2; + y = (rect.bottom - sz.cy) / 2; + + // Draw the text + ExtTextOut(hdc, x, y, ETO_OPAQUE, &rect, szText, lstrlen(szText), 0); + + // Restore the old font when we have finished + SelectObject(hdc, hOldFont); + + // Release the device context + EndPaint(ccp->hwnd, &ps); + + return 0; +} + +static LRESULT CALLBACK InputCustomWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + // retrieve the custom structure POINTER for THIS window + InputCust *icp = GetInputCustom(hwnd); + HWND pappy = (HWND__ *)GetWindowLongPtr(hwnd,GWL_HWNDPARENT); + funky= hwnd; + + char temp[100]; + COLORREF col; + switch(msg) + { + + case WM_GETDLGCODE: + return DLGC_WANTARROWS|DLGC_WANTALLKEYS|DLGC_WANTCHARS; + break; + + + case WM_NCCREATE: + + // Allocate a new CustCtrl structure for this window. + icp = (InputCust *) malloc( sizeof(InputCust) ); + + // Failed to allocate, stop window creation. + if(icp == NULL) return FALSE; + + // Initialize the CustCtrl structure. + icp->hwnd = hwnd; + icp->crForeGnd = GetSysColor(COLOR_WINDOWTEXT); + icp->crBackGnd = GetSysColor(COLOR_WINDOW); + icp->hFont = (HFONT__ *) GetStockObject(DEFAULT_GUI_FONT); + + // Assign the window text specified in the call to CreateWindow. + SetWindowText(hwnd, ((CREATESTRUCT *)lParam)->lpszName); + + // Attach custom structure to this window. + SetInputCustom(hwnd, icp); + + InvalidateRect(icp->hwnd, NULL, FALSE); + UpdateWindow(icp->hwnd); + return true; + + // Continue with window creation. + return TRUE; + + // Clean up when the window is destroyed. + case WM_NCDESTROY: + free(icp); + break; + case WM_PAINT: + return InputCustom_OnPaint(icp,wParam,lParam); + break; + case WM_ERASEBKGND: + return 1; + case WM_USER+45: + case WM_KEYDOWN: + TranslateKey(wParam,temp); + col = CheckKey(wParam); + + icp->crForeGnd = ((~col) & 0x00ffffff); + icp->crBackGnd = col; + SetWindowText(hwnd,temp); + InvalidateRect(icp->hwnd, NULL, FALSE); + UpdateWindow(icp->hwnd); + SendMessage(pappy,WM_USER+43,wParam,(LPARAM)hwnd); + + break; + case WM_USER+44: + + TranslateKey(wParam,temp); + if(IsWindowEnabled(hwnd)) + { + col = CheckKey(wParam); + } + else + { + col = RGB( 192,192,192); + } + icp->crForeGnd = ((~col) & 0x00ffffff); + icp->crBackGnd = col; + SetWindowText(hwnd,temp); + InvalidateRect(icp->hwnd, NULL, FALSE); + UpdateWindow(icp->hwnd); + + break; + + case WM_SETFOCUS: + { + col = RGB( 0,255,0); + icp->crForeGnd = ((~col) & 0x00ffffff); + icp->crBackGnd = col; + InvalidateRect(icp->hwnd, NULL, FALSE); + UpdateWindow(icp->hwnd); + tid = wParam; + + + SetTimer(hwnd,tid,125,NULL); + + + break; + } + case WM_KILLFOCUS: + { + /*col = RGB( 255,255,255); + icp->crForeGnd = ((~col) & 0x00ffffff); + icp->crBackGnd = col; + InvalidateRect(icp->hwnd, NULL, FALSE); + UpdateWindow(icp->hwnd);*/ + break; + } + + case WM_TIMER: + FunkyJoyStickTimer(); + break; + case WM_LBUTTONDOWN: + SetFocus(hwnd); + break; + case WM_ENABLE: + COLORREF col; + if(wParam) + { + col = RGB( 255,255,255); + icp->crForeGnd = ((~col) & 0x00ffffff); + icp->crBackGnd = col; + } + else + { + col = RGB( 192,192,192); + icp->crForeGnd = ((~col) & 0x00ffffff); + icp->crBackGnd = col; + } + InvalidateRect(icp->hwnd, NULL, FALSE); + UpdateWindow(icp->hwnd); + return true; + default: + break; + } + + return DefWindowProc(hwnd, msg, wParam, lParam); +} + +static bool keyPressLock = false; + +static LRESULT CALLBACK CharInputCustomWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + // retrieve the custom structure POINTER for THIS window + InputCust *icp = GetInputCustom(hwnd); + HWND pappy = (HWND__ *)GetWindowLongPtr(hwnd,GWL_HWNDPARENT); + funky= hwnd; + + char temp[100]; + COLORREF col; + switch(msg) + { + + case WM_GETDLGCODE: + return DLGC_WANTARROWS|DLGC_WANTALLKEYS|DLGC_WANTCHARS; + break; + + + case WM_NCCREATE: + + // Allocate a new CustCtrl structure for this window. + icp = (InputCust *) malloc( sizeof(InputCust) ); + + // Failed to allocate, stop window creation. + if(icp == NULL) return FALSE; + + // Initialize the CustCtrl structure. + icp->hwnd = hwnd; + icp->crForeGnd = GetSysColor(COLOR_WINDOWTEXT); + icp->crBackGnd = GetSysColor(COLOR_WINDOW); + icp->hFont = (HFONT__ *) GetStockObject(DEFAULT_GUI_FONT); + + // Assign the window text specified in the call to CreateWindow. + SetWindowText(hwnd, ((CREATESTRUCT *)lParam)->lpszName); + + // Attach custom structure to this window. + SetInputCustom(hwnd, icp); + + InvalidateRect(icp->hwnd, NULL, FALSE); + UpdateWindow(icp->hwnd); + + keyPressLock = false; + + // Continue with window creation. + return TRUE; + + // Clean up when the window is destroyed. + case WM_NCDESTROY: + free(icp); + break; + case WM_PAINT: + return InputCustom_OnPaint(icp,wParam,lParam); + break; + case WM_ERASEBKGND: + return 1; +/* + case WM_KEYUP: + { + int count = 0; + for(int i=0;i<256;i++) + if(GetAsyncKeyState(i)) + count++; + + if(count < 2) + { + int p = count; + } + if(count < 1) + { + int p = count; + } + + TranslateKey(wParam,temp); + col = CheckKey(wParam); + + icp->crForeGnd = ((~col) & 0x00ffffff); + icp->crBackGnd = col; + SetWindowText(hwnd,temp); + InvalidateRect(icp->hwnd, NULL, FALSE); + UpdateWindow(icp->hwnd); + SendMessage(pappy,WM_USER+43,wParam,(LPARAM)hwnd); + } + break; +*/ + case WM_SYSKEYDOWN: + case WM_KEYDOWN: + + { + int count = 0; + for(int i=2;i<256;i++) + { + if(i >= VK_LSHIFT && i <= VK_RMENU) + continue; + if(GetAsyncKeyState(i)) + count++; + } + + if(count <= 1) + { + keyPressLock = false; + } + } + + // no break + + case WM_USER+45: +// case WM_CHAR: + { + + if(wParam == VK_SHIFT || wParam == VK_MENU || wParam == VK_CONTROL) + break; + + if(wParam == VK_ESCAPE) + { + TranslateKey(wParam,temp); + } + else + { + char * temp2 = temp; + + sprintf(temp2, ""); + if(GetAsyncKeyState(VK_CONTROL)) + sprintf(temp2,"Ctrl + "), temp2 += strlen("Ctrl + "); + if(GetAsyncKeyState(VK_MENU)) + sprintf(temp2,"Alt + "), temp2 += strlen("Alt + "); + if(GetAsyncKeyState(VK_SHIFT)) + sprintf(temp2,"Shift + "), temp2 += strlen("Shift + "); + + TranslateKey(wParam,temp2); + } + + col = CheckKey(wParam,0); + if(col == RGB(255,0,0)) // un-redify + col = RGB(255,255,255); + + icp->crForeGnd = ((~col) & 0x00ffffff); + icp->crBackGnd = col; + SetWindowText(hwnd,temp); + InvalidateRect(icp->hwnd, NULL, FALSE); + UpdateWindow(icp->hwnd); + SendMessage(pappy,WM_USER+43,wParam,(LPARAM)hwnd); + + keyPressLock = true; + + } + break; + case WM_SYSKEYUP: + case WM_KEYUP: + if(!keyPressLock) + { + int count = 0; + for(int i=2;i<256;i++) + { + if(i >= VK_LSHIFT && i <= VK_RMENU) + continue; + if(GetAsyncKeyState(i)) + count++; + } + + if(count <= 1) + { + if(wParam == VK_SHIFT || wParam == VK_MENU || wParam == VK_CONTROL) + { + if(wParam == VK_SHIFT) + { + sprintf(temp, "Shift"); + } + if(wParam == VK_MENU) + { + sprintf(temp, "Alt"); + } + if(wParam == VK_CONTROL) + { + sprintf(temp, "Control"); + } + col = CheckKey(wParam,0); + if(col == RGB(255,0,0)) // un-redify + col = RGB(255,255,255); + if(col == RGB(255,255,255)) // tint green + col = RGB(192,255,192); + + icp->crForeGnd = ((~col) & 0x00ffffff); + icp->crBackGnd = col; + SetWindowText(hwnd,temp); + InvalidateRect(icp->hwnd, NULL, FALSE); + UpdateWindow(icp->hwnd); + SendMessage(pappy,WM_USER+43,wParam,(LPARAM)hwnd); + } + } + } + break; + case WM_USER+44: + + { + if(wParam == VK_SHIFT) + sprintf(temp, "Shift"); + else if(wParam == VK_MENU) + sprintf(temp, "Alt"); + else if(wParam == VK_CONTROL) + sprintf(temp, "Control"); + else if(wParam == VK_ESCAPE || wParam == 0) + TranslateKey(wParam,temp); + else + { + + char * temp2 = temp; + + sprintf(temp2, ""); + if(lParam & CUSTKEY_CTRL_MASK) + sprintf(temp2,"Ctrl + "), temp2 += strlen("Ctrl + "); + if(lParam & CUSTKEY_ALT_MASK) + sprintf(temp2,"Alt + "), temp2 += strlen("Alt + "); + if(lParam & CUSTKEY_SHIFT_MASK) + sprintf(temp2,"Shift + "), temp2 += strlen("Shift + "); + + TranslateKey(wParam,temp2); + } + + if(IsWindowEnabled(hwnd)) + { + col = CheckKey(wParam,0); + if(col == RGB(255,0,0)) // un-redify + col = RGB(255,255,255); + } + else + { + col = RGB( 192,192,192); + } + icp->crForeGnd = ((~col) & 0x00ffffff); + icp->crBackGnd = col; + SetWindowText(hwnd,temp); + InvalidateRect(icp->hwnd, NULL, FALSE); + UpdateWindow(icp->hwnd); + } + break; + + case WM_SETFOCUS: + { + col = RGB( 0,255,0); + icp->crForeGnd = ((~col) & 0x00ffffff); + icp->crBackGnd = col; + InvalidateRect(icp->hwnd, NULL, FALSE); + UpdateWindow(icp->hwnd); + tid = wParam; + + + SetTimer(hwnd,tid,125,NULL); + + + break; + } + case WM_KILLFOCUS: + { + /*col = RGB( 255,255,255); + icp->crForeGnd = ((~col) & 0x00ffffff); + icp->crBackGnd = col; + InvalidateRect(icp->hwnd, NULL, FALSE); + UpdateWindow(icp->hwnd);*/ + break; + } + + case WM_TIMER: + FunkyJoyStickTimer(); + break; + case WM_LBUTTONDOWN: + SetFocus(hwnd); + break; + case WM_ENABLE: + COLORREF col; + if(wParam) + { + col = RGB( 255,255,255); + icp->crForeGnd = ((~col) & 0x00ffffff); + icp->crBackGnd = col; + } + else + { + col = RGB( 192,192,192); + icp->crForeGnd = ((~col) & 0x00ffffff); + icp->crBackGnd = col; + } + InvalidateRect(icp->hwnd, NULL, FALSE); + UpdateWindow(icp->hwnd); + return true; + default: + break; + } + + return DefWindowProc(hwnd, msg, wParam, lParam); +} + diff -NaHudr snes9x-1.43-src/InputCustom.h snx/InputCustom.h --- snes9x-1.43-src/InputCustom.h 2004-12-31 00:15:55.000000000 +0200 +++ snx/InputCustom.h 2005-04-09 00:59:23.000000000 +0300 @@ -1,15 +1,28 @@ -#ifndef CUSTCTRL_INCLUDED -#define CUSTCTRL_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - -void InitInputCustomControl(void); -HWND CreateInputCustom(HWND hwndParent); - -#ifdef __cplusplus -} -#endif - -#endif \ No newline at end of file +#ifndef CUSTCTRL_INCLUDED +#define CUSTCTRL_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +void InitInputCustomControl(void); +HWND CreateInputCustom(HWND hwndParent); +void InitKeyCustomControl(void); +HWND CreateKeyCustom(HWND hwndParent); + +typedef struct +{ + COLORREF crForeGnd; // Foreground text colour + COLORREF crBackGnd; // Background text colour + HFONT hFont; // The font + HWND hwnd; // The control's window handle +} InputCust; +COLORREF CheckKey( WORD Key, int conflictMinHitNum = 1); +InputCust * GetInputCustom(HWND hwnd); + + +#ifdef __cplusplus +} +#endif + +#endif diff -NaHudr snes9x-1.43-src/language.h snx/language.h --- snes9x-1.43-src/language.h 2004-12-31 00:15:55.000000000 +0200 +++ snx/language.h 2005-04-09 00:59:23.000000000 +0300 @@ -1,328 +1,336 @@ -/******************************************************************************* - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - - (c) Copyright 1996 - 2002 Gary Henderson (gary.henderson@ntlworld.com) and - Jerremy Koot (jkoot@snes9x.com) - - (c) Copyright 2001 - 2004 John Weidman (jweidman@slip.net) - - (c) Copyright 2002 - 2004 Brad Jorsch (anomie@users.sourceforge.net), - funkyass (funkyass@spam.shaw.ca), - Joel Yliluoma (http://iki.fi/bisqwit/) - Kris Bleakley (codeviolation@hotmail.com), - Matthew Kendora, - Nach (n-a-c-h@users.sourceforge.net), - Peter Bortas (peter@bortas.org) and - zones (kasumitokoduck@yahoo.com) - - C4 x86 assembler and some C emulation code - (c) Copyright 2000 - 2003 zsKnight (zsknight@zsnes.com), - _Demo_ (_demo_@zsnes.com), and Nach - - C4 C++ code - (c) Copyright 2003 Brad Jorsch - - DSP-1 emulator code - (c) Copyright 1998 - 2004 Ivar (ivar@snes9x.com), _Demo_, Gary Henderson, - John Weidman, neviksti (neviksti@hotmail.com), - Kris Bleakley, Andreas Naive - - DSP-2 emulator code - (c) Copyright 2003 Kris Bleakley, John Weidman, neviksti, Matthew Kendora, and - Lord Nightmare (lord_nightmare@users.sourceforge.net - - OBC1 emulator code - (c) Copyright 2001 - 2004 zsKnight, pagefault (pagefault@zsnes.com) and - Kris Bleakley - Ported from x86 assembler to C by sanmaiwashi - - SPC7110 and RTC C++ emulator code - (c) Copyright 2002 Matthew Kendora with research by - zsKnight, John Weidman, and Dark Force - - S-DD1 C emulator code - (c) Copyright 2003 Brad Jorsch with research by - Andreas Naive and John Weidman - - S-RTC C emulator code - (c) Copyright 2001 John Weidman - - ST010 C++ emulator code - (c) Copyright 2003 Feather, Kris Bleakley, John Weidman and Matthew Kendora - - Super FX x86 assembler emulator code - (c) Copyright 1998 - 2003 zsKnight, _Demo_, and pagefault - - Super FX C emulator code - (c) Copyright 1997 - 1999 Ivar, Gary Henderson and John Weidman - - - SH assembler code partly based on x86 assembler code - (c) Copyright 2002 - 2004 Marcus Comstedt (marcus@mc.pp.se) - - - Specific ports contains the works of other authors. See headers in - individual files. - - Snes9x homepage: http://www.snes9x.com - - Permission to use, copy, modify and distribute Snes9x in both binary and - source form, for non-commercial purposes, is hereby granted without fee, - providing that this license information and copyright notice appear with - all copies and any derived work. - - This software is provided 'as-is', without any express or implied - warranty. In no event shall the authors be held liable for any damages - arising from the use of this software. - - Snes9x is freeware for PERSONAL USE only. Commercial users should - seek permission of the copyright holders first. Commercial use includes - charging money for Snes9x or software derived from Snes9x. - - The copyright holders request that bug fixes and improvements to the code - should be forwarded to them so everyone can benefit from the modifications - in future versions. - - Super NES and Super Nintendo Entertainment System are trademarks of - Nintendo Co., Limited and its subsidiary companies. -*******************************************************************************/ - -/* This is where all the GUI text strings will eventually end up */ - -#define WINDOW_TITLE "Snes9X v%s for Windows" - -#define MY_REG_KEY "Software\\Emulators\\Snes9X" - -#define REG_KEY_VER "1.31" - -#define DISCLAIMER_TEXT "Snes9X v%s for Windows.\r\n" \ - "(c) Copyright 1996 - 2002 Gary Henderson and Jerremy Koot.\r\n" \ - "(c) Copyright 2001- 2004 John Weidman.\r\n" \ - "(c) Copyright 2002 - 2004 blip, Brad Jorsch, funkyass, Joel Yliluoma, Kris Bleakley, Matthew Kendora, Nach, Peter Bortas, zones.\r\n\r\n" \ - "Snes9X is a Super Nintendo Entertainment System\r\n" \ - "emulator that allows you to play most games designed\r\n" \ - "for the SNES on your PC.\r\n\r\n" \ - "Please visit http://www.snes9x.com for\r\n" \ - "up-to-the-minute information and help on Snes9X.\r\n\r\n" \ - "Nintendo is a trade mark." - - -#define APP_NAME "Snes9x" -/* possible global strings */ -#define SNES9X_INFO "Snes9x: Information" -#define SNES9X_WARN "Snes9x: WARNING!" -#define SNES9X_DXS "Snes9X: DirectSound" -#define SNES9X_SNDQ "Snes9X: Sound CPU Question" -#define SNES9X_NP_ERROR "Snes9X: NetPlay Error" -#define BUTTON_OK "&OK" -#define BUTTON_CANCEL "&Cancel" - -/* Gamepad Dialog Strings */ -#define INPUTCONFIG_TITLE "Input Configuration" -#define INPUTCONFIG_JPTOGGLE "Enable" -#define INPUTCONFIG_DIAGTOGGLE "Toggle Diagonals" -/* #define INPUTCONFIG_OK "&OK" */ -/* #define INPUTCONFIG_CANCEL "&Cancel" */ -#define INPUTCONFIG_JPCOMBO "Joypad #%d" -#define INPUTCONFIG_LABEL_UP "Up" -#define INPUTCONFIG_LABEL_DOWN "Down" -#define INPUTCONFIG_LABEL_LEFT "Left" -#define INPUTCONFIG_LABEL_RIGHT "Right" -#define INPUTCONFIG_LABEL_A "A" -#define INPUTCONFIG_LABEL_B "B" -#define INPUTCONFIG_LABEL_X "X" -#define INPUTCONFIG_LABEL_Y "Y" -#define INPUTCONFIG_LABEL_L "L" -#define INPUTCONFIG_LABEL_R "R" -#define INPUTCONFIG_LABEL_START "Start" -#define INPUTCONFIG_LABEL_SELECT "Select" -#define INPUTCONFIG_LABEL_UPLEFT "Up Left" -#define INPUTCONFIG_LABEL_UPRIGHT "Up Right" -#define INPUTCONFIG_LABEL_DOWNRIGHT "Down Right" -#define INPUTCONFIG_LABEL_DOWNLEFT "Down Left" -#define INPUTCONFIG_LABEL_BLUE "Blue means the current key/button is already mapped; Red means it's a Snes9x/Windows reserved key." - -/* gaming buttons and axises */ -#define GAMEDEVICE_JOYNUMPREFIX "(J%d)" -#define GAMEDEVICE_JOYBUTPREFIX "#[%d]" -#define GAMEDEVICE_XNEG "Left" -#define GAMEDEVICE_XPOS "Right" -#define GAMEDEVICE_YPOS "Up" -#define GAMEDEVICE_YNEG "Down" -#define GAMEDEVICE_POVLEFT "POV Left" -#define GAMEDEVICE_POVRIGHT "POV Right" -#define GAMEDEVICE_POVUP "POV Up" -#define GAMEDEVICE_POVDOWN "POV Down" -#define GAMEDEVICE_POVDNLEFT "POV Dn Left" -#define GAMEDEVICE_POVDNRIGHT "POV Dn Right" -#define GAMEDEVICE_POVUPLEFT "POV Up Left" -#define GAMEDEVICE_POVUPRIGHT "POV Up Right" -#define GAMEDEVICE_ZPOS "Z Up" -#define GAMEDEVICE_ZNEG "Z Down" -#define GAMEDEVICE_RPOS "R Up" -#define GAMEDEVICE_RNEG "R Down" -#define GAMEDEVICE_UPOS "U Up" -#define GAMEDEVICE_UNEG "U Down" -#define GAMEDEVICE_VPOS "V Up" -#define GAMEDEVICE_VNEG "V Down" -#define GAMEDEVICE_BUTTON "Button %d" - -/* gaming general */ -#define GAMEDEVICE_DISABLED "Disabled" - -/* gaming keys */ -#define GAMEDEVICE_KEY "#%d" -#define GAMEDEVICE_NUMPADPREFIX "Numpad-%c" -#define GAMEDEVICE_VK_TAB "Tab" -#define GAMEDEVICE_VK_BACK "Backspace" -#define GAMEDEVICE_VK_CLEAR "Delete" -#define GAMEDEVICE_VK_RETURN "Enter" -#define GAMEDEVICE_VK_LSHIFT "LShift" -#define GAMEDEVICE_VK_RSHIFT "RShift" -#define GAMEDEVICE_VK_LCONTROL "LCTRL" -#define GAMEDEVICE_VK_RCONTROL "RCTRL" -#define GAMEDEVICE_VK_LMENU "LAlt" -#define GAMEDEVICE_VK_RMENU "RAlt" -#define GAMEDEVICE_VK_PAUSE "Pause" -#define GAMEDEVICE_VK_CAPITAL "Capslock" -#define GAMEDEVICE_VK_ESCAPE "Disabled" -#define GAMEDEVICE_VK_SPACE "Space" -#define GAMEDEVICE_VK_PRIOR "PgUp" -#define GAMEDEVICE_VK_NEXT "PgDn" -#define GAMEDEVICE_VK_HOME "Home" -#define GAMEDEVICE_VK_END "End" -#define GAMEDEVICE_VK_LEFT "Left" -#define GAMEDEVICE_VK_RIGHT "Right" -#define GAMEDEVICE_VK_UP "Up" -#define GAMEDEVICE_VK_DOWN "Down" -#define GAMEDEVICE_VK_SELECT "Select" -#define GAMEDEVICE_VK_PRINT "Print" -#define GAMEDEVICE_VK_EXECUTE "Execute" -#define GAMEDEVICE_VK_SNAPSHOT "SnapShot" -#define GAMEDEVICE_VK_INSERT "Insert" -#define GAMEDEVICE_VK_DELETE "Delete" -#define GAMEDEVICE_VK_HELP "Help" -#define GAMEDEVICE_VK_LWIN "LWinKey" -#define GAMEDEVICE_VK_RWIN "RWinKey" -#define GAMEDEVICE_VK_APPS "AppKey" -#define GAMEDEVICE_VK_MULTIPLY "Numpad *" -#define GAMEDEVICE_VK_ADD "Numpad +" -#define GAMEDEVICE_VK_SEPARATOR "\\" -#define GAMEDEVICE_VK_OEM_1 "Semi-Colon" -#define GAMEDEVICE_VK_OEM_7 "Apostrophe" -#define GAMEDEVICE_VK_OEM_COMMA "Comma" -#define GAMEDEVICE_VK_OEM_PERIOD "Period" -#define GAMEDEVICE_VK_SUBTRACT "Numpad -" -#define GAMEDEVICE_VK_DECIMAL "Numpad ." -#define GAMEDEVICE_VK_DIVIDE "Numpad /" -#define GAMEDEVICE_VK_NUMLOCK "Num-lock" -#define GAMEDEVICE_VK_SCROLL "Scroll-lock" - -/* evil things I found in WinProc */ - -#define WINPROC_TURBOMODE_ON "Turbo Mode Activated" -#define WINPROC_TURBOMODE_OFF "Turbo Mode Deactivated" -#define WINPROC_TURBOMODE_TEXT "Turbo Mode" -#define WINPROC_HDMA_TEXT "HDMA emulation" -#define WINPROC_BG1 "BG#1" /* Background Layers */ -#define WINPROC_BG2 "BG#2" -#define WINPROC_BG3 "BG#3" -#define WINPROC_BG4 "BG#4" -#define WINPROC_SPRITES "Sprites" -#define WINPROC_PADSWAP "Joypad swapping" -#define WINPROC_CONTROLERS0 "Multiplayer 5 on #0" -#define WINPROC_CONTROLERS1 "Joypad on #0" -#define WINPROC_CONTROLERS2 "Mouse on #1" -#define WINPROC_CONTROLERS3 "Mouse on #0" -#define WINPROC_CONTROLERS4 "Superscope on #1" -#define WINPROC_CONTROLERS5 "Justifier 1 on #1" -#define WINPROC_CONTROLERS6 "Justifier 2 on #1" -#define WINPROC_BGHACK "Background layering hack" -#define WINPROC_MODE7INTER "Mode 7 Interpolation" -#define WINPROC_TRANSPARENCY "Transparency effects" -#define WINPROC_CLIPWIN "Graphic clip windows" -#define WINPROC_PAUSE "Pause" -#define WINPROC_EMUFRAMETIME "Emulated frame time: %dms" -#define WINPROC_AUTOSKIP "Auto Frame Skip" -#define WINPROC_FRAMESKIP "Frame skip: %d" -#define WINPROC_TURBO_R_ON "Turbo R Activated" -#define WINPROC_TURBO_R_OFF "Turbo R Deactivated" -#define WINPROC_TURBO_L_ON "Turbo L Activated" -#define WINPROC_TURBO_L_OFF "Turbo L Deactivated" -#define WINPROC_TURBO_X_ON "Turbo X Activated" -#define WINPROC_TURBO_X_OFF "Turbo X Deactivated" -#define WINPROC_TURBO_Y_ON "Turbo Y Activated" -#define WINPROC_TURBO_Y_OFF "Turbo Y Deactivated" -#define WINPROC_TURBO_A_ON "Turbo A Activated" -#define WINPROC_TURBO_A_OFF "Turbo A Deactivated" -#define WINPROC_TURBO_B_ON "Turbo B Activated" -#define WINPROC_TURBO_B_OFF "Turbo B Deactivated" -#define WINPROC_TURBO_SEL_ON "Turbo Select Activated" -#define WINPROC_TURBO_SEL_OFF "Turbo Select Deactivated" -#define WINPROC_TURBO_START_ON "Turbo Start Activated" -#define WINPROC_TURBO_START_OFF "Turbo Start Deactivated" -#define WINPROC_FILTER_RESTART "You will need to restart Snes9x before the output image\nprocessing option change will take effect." -#define WINPROC_DISCONNECT "Disconnect from the NetPlay server first." -#define WINPROC_NET_RESTART "Your game will be reset after the ROM has been sent due to\nyour 'Sync Using Reset Game' setting.\n\n" -#define WINPROC_INTERPOLATED_SND "Interpolated sound" -#define WINPROC_SYNC_SND "Sync sound" -#define WINPROC_SND_OFF "Disabling the sound CPU emulation will help to improve\nemulation speed but you will not hear any sound effects\nor music. If you later want to re-enable the sound CPU\nemulation you will need to reset your game before it will\ntake effect.\n\nAre you sure this is what you want?" -#define WINPROC_SND_RESTART "You will need to reset your game or load another one\nbefore enabling the sound CPU will take effect." - -/* Emulator Settings */ - -#define EMUSET_TITLE "Emulation Settings" -#define EMUSET_LABEL_FREEZE "Freeze Folder Directory" -#define EMUSET_BROWSE "&Browse..." -#define EMUSET_LABEL_ASRAM "Auto-Save S-RAM" -#define EMUSET_LABEL_ASRAM_TEXT "seconds after last change (0 disables auto-save)" -#define EMUSET_LABEL_SMAX "Skip at most" -#define EMUSET_LABEL_SMAX_TEXT "frames in auto-frame rate mode" -#define EMUSET_LABEL_STURBO "Skip Rendering" -#define EMUSET_LABEL_STURBO_TEXT "frames in Turbo mode" -#define EMUSET_TOGGLE_TURBO "Tab Toggles Turbo" - -/* Netplay Options */ - -#define NPOPT_TITLE "Netplay Options" -#define NPOPT_LABEL_PORTNUM "Socket Port Number" -#define NPOPT_LABEL_PAUSEINTERVAL "Ask Server to Pause when" -#define NPOPT_LABEL_PAUSEINTERVAL_TEXT "frames behind" -#define NPOPT_LABEL_MAXSKIP "Maximum Frame Rate Skip" -#define NPOPT_SYNCBYRESET "Sync By Reset" -#define NPOPT_SENDROM "Send ROM Image to Client on Connect" -#define NPOPT_ACTASSERVER "Act As Server" -#define NPOPT_PORTNUMBLOCK "Port Settings" -#define NPOPT_CLIENTSETTINGSBLOCK "Client Settings" -#define NPOPT_SERVERSETTINGSBLOCK "Server Settings" - -/* Netplay Connect */ - - -#define NPCON_TITLE "Connect to Server" -#define NPCON_LABEL_SERVERADDY "Server Address" -#define NPCON_LABEL_PORTNUM "Port Number" -#define NPCON_CLEARHISTORY "Clear History" - - -/* Movie Messages */ - -#define MOVIE_INFO_REPLAY "Movie replay" -#define MOVIE_INFO_RECORD "Movie record" -#define MOVIE_INFO_RERECORD "Movie re-record" -#define MOVIE_INFO_REWIND "Movie rewind" -#define MOVIE_INFO_STOP "Movie stop" -#define MOVIE_INFO_END "Movie end" -#define MOVIE_INFO_RECORDING_ENABLED "Recording enabled" -#define MOVIE_INFO_RECORDING_DISABLED "Recording disabled" -#define MOVIE_ERR_SNAPSHOT_WRONG_MOVIE "Snapshot not from this movie" -#define MOVIE_ERR_SNAPSHOT_NOT_MOVIE "Not a movie snapshot" -#define MOVIE_ERR_COULD_NOT_OPEN "Could not open movie file." -#define MOVIE_ERR_NOT_FOUND "File not found." -#define MOVIE_ERR_WRONG_FORMAT "File is wrong format." -#define MOVIE_ERR_WRONG_VERSION "File is wrong version." - - -/* AVI Messages */ - -#define AVI_CONFIGURATION_CHANGED "AVI recording stopped (configuration settings changed)." +/******************************************************************************* + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + + (c) Copyright 1996 - 2002 Gary Henderson (gary.henderson@ntlworld.com) and + Jerremy Koot (jkoot@snes9x.com) + + (c) Copyright 2001 - 2004 John Weidman (jweidman@slip.net) + + (c) Copyright 2002 - 2004 Brad Jorsch (anomie@users.sourceforge.net), + funkyass (funkyass@spam.shaw.ca), + Joel Yliluoma (http://iki.fi/bisqwit/) + Kris Bleakley (codeviolation@hotmail.com), + Matthew Kendora, + Nach (n-a-c-h@users.sourceforge.net), + Peter Bortas (peter@bortas.org) and + zones (kasumitokoduck@yahoo.com) + + C4 x86 assembler and some C emulation code + (c) Copyright 2000 - 2003 zsKnight (zsknight@zsnes.com), + _Demo_ (_demo_@zsnes.com), and Nach + + C4 C++ code + (c) Copyright 2003 Brad Jorsch + + DSP-1 emulator code + (c) Copyright 1998 - 2004 Ivar (ivar@snes9x.com), _Demo_, Gary Henderson, + John Weidman, neviksti (neviksti@hotmail.com), + Kris Bleakley, Andreas Naive + + DSP-2 emulator code + (c) Copyright 2003 Kris Bleakley, John Weidman, neviksti, Matthew Kendora, and + Lord Nightmare (lord_nightmare@users.sourceforge.net + + OBC1 emulator code + (c) Copyright 2001 - 2004 zsKnight, pagefault (pagefault@zsnes.com) and + Kris Bleakley + Ported from x86 assembler to C by sanmaiwashi + + SPC7110 and RTC C++ emulator code + (c) Copyright 2002 Matthew Kendora with research by + zsKnight, John Weidman, and Dark Force + + S-DD1 C emulator code + (c) Copyright 2003 Brad Jorsch with research by + Andreas Naive and John Weidman + + S-RTC C emulator code + (c) Copyright 2001 John Weidman + + ST010 C++ emulator code + (c) Copyright 2003 Feather, Kris Bleakley, John Weidman and Matthew Kendora + + Super FX x86 assembler emulator code + (c) Copyright 1998 - 2003 zsKnight, _Demo_, and pagefault + + Super FX C emulator code + (c) Copyright 1997 - 1999 Ivar, Gary Henderson and John Weidman + + + SH assembler code partly based on x86 assembler code + (c) Copyright 2002 - 2004 Marcus Comstedt (marcus@mc.pp.se) + + + Specific ports contains the works of other authors. See headers in + individual files. + + Snes9x homepage: http://www.snes9x.com + + Permission to use, copy, modify and distribute Snes9x in both binary and + source form, for non-commercial purposes, is hereby granted without fee, + providing that this license information and copyright notice appear with + all copies and any derived work. + + This software is provided 'as-is', without any express or implied + warranty. In no event shall the authors be held liable for any damages + arising from the use of this software. + + Snes9x is freeware for PERSONAL USE only. Commercial users should + seek permission of the copyright holders first. Commercial use includes + charging money for Snes9x or software derived from Snes9x. + + The copyright holders request that bug fixes and improvements to the code + should be forwarded to them so everyone can benefit from the modifications + in future versions. + + Super NES and Super Nintendo Entertainment System are trademarks of + Nintendo Co., Limited and its subsidiary companies. +*******************************************************************************/ + +/* This is where all the GUI text strings will eventually end up */ + +#define WINDOW_TITLE "Snes9X v%s for Windows" + +#define MY_REG_KEY "Software\\Emulators\\Snes9X" + +#define REG_KEY_VER "1.31" + +#define DISCLAIMER_TEXT "Snes9X v%s for Windows.\r\n" \ + "(c) Copyright 1996 - 2002 Gary Henderson and Jerremy Koot.\r\n" \ + "(c) Copyright 2001- 2004 John Weidman.\r\n" \ + "(c) Copyright 2002 - 2004 blip, Brad Jorsch, funkyass, Joel Yliluoma, Kris Bleakley, Matthew Kendora, Nach, Peter Bortas, zones.\r\n\r\n" \ + "Snes9X is a Super Nintendo Entertainment System\r\n" \ + "emulator that allows you to play most games designed\r\n" \ + "for the SNES on your PC.\r\n\r\n" \ + "Please visit http://www.snes9x.com for\r\n" \ + "up-to-the-minute information and help on Snes9X.\r\n\r\n" \ + "Nintendo is a trade mark." + + +#define APP_NAME "Snes9x" +// possible global strings +#define SNES9X_INFO "Snes9x: Information" +#define SNES9X_WARN "Snes9x: WARNING!" +#define SNES9X_DXS "Snes9X: DirectSound" +#define SNES9X_SNDQ "Snes9X: Sound CPU Question" +#define SNES9X_NP_ERROR "Snes9X: NetPlay Error" +#define BUTTON_OK "&OK" +#define BUTTON_CANCEL "&Cancel" + +// Gamepad Dialog Strings +#define INPUTCONFIG_TITLE "Input Configuration" +#define INPUTCONFIG_JPTOGGLE "Enabled" +#define INPUTCONFIG_DIAGTOGGLE "Toggle Diagonals" +//#define INPUTCONFIG_OK "&OK" +//#define INPUTCONFIG_CANCEL "&Cancel" +#define INPUTCONFIG_JPCOMBO "Joypad #%d" +#define INPUTCONFIG_LABEL_UP "Up" +#define INPUTCONFIG_LABEL_DOWN "Down" +#define INPUTCONFIG_LABEL_LEFT "Left" +#define INPUTCONFIG_LABEL_RIGHT "Right" +#define INPUTCONFIG_LABEL_A "A" +#define INPUTCONFIG_LABEL_B "B" +#define INPUTCONFIG_LABEL_X "X" +#define INPUTCONFIG_LABEL_Y "Y" +#define INPUTCONFIG_LABEL_L "L" +#define INPUTCONFIG_LABEL_R "R" +#define INPUTCONFIG_LABEL_START "Start" +#define INPUTCONFIG_LABEL_SELECT "Select" +#define INPUTCONFIG_LABEL_UPLEFT "Up Left" +#define INPUTCONFIG_LABEL_UPRIGHT "Up Right" +#define INPUTCONFIG_LABEL_DOWNRIGHT "Dn Right" +#define INPUTCONFIG_LABEL_DOWNLEFT "Dn Left" +#define INPUTCONFIG_LABEL_BLUE "Blue means the button is already mapped;\nRed means it's used by windows or Snes9x" + +// gaming buttons and axises +#define GAMEDEVICE_JOYNUMPREFIX "(J%d)" +#define GAMEDEVICE_JOYBUTPREFIX "#[%d]" +#define GAMEDEVICE_XNEG "Left" +#define GAMEDEVICE_XPOS "Right" +#define GAMEDEVICE_YPOS "Up" +#define GAMEDEVICE_YNEG "Down" +#define GAMEDEVICE_POVLEFT "POV Left" +#define GAMEDEVICE_POVRIGHT "POV Right" +#define GAMEDEVICE_POVUP "POV Up" +#define GAMEDEVICE_POVDOWN "POV Down" +#define GAMEDEVICE_POVDNLEFT "POV Dn Left" +#define GAMEDEVICE_POVDNRIGHT "POV Dn Right" +#define GAMEDEVICE_POVUPLEFT "POV Up Left" +#define GAMEDEVICE_POVUPRIGHT "POV Up Right" +#define GAMEDEVICE_ZPOS "Z Up" +#define GAMEDEVICE_ZNEG "Z Down" +#define GAMEDEVICE_RPOS "R Up" +#define GAMEDEVICE_RNEG "R Down" +#define GAMEDEVICE_UPOS "U Up" +#define GAMEDEVICE_UNEG "U Down" +#define GAMEDEVICE_VPOS "V Up" +#define GAMEDEVICE_VNEG "V Down" +#define GAMEDEVICE_BUTTON "Button %d" + +//gaming general +#define GAMEDEVICE_DISABLED "Disabled" + +//gaming keys +#define GAMEDEVICE_KEY "#%d" +#define GAMEDEVICE_NUMPADPREFIX "Numpad-%c" +#define GAMEDEVICE_VK_TAB "Tab" +#define GAMEDEVICE_VK_BACK "Backspace" +#define GAMEDEVICE_VK_CLEAR "Delete" +#define GAMEDEVICE_VK_RETURN "Enter" +#define GAMEDEVICE_VK_LSHIFT "LShift" +#define GAMEDEVICE_VK_RSHIFT "RShift" +#define GAMEDEVICE_VK_LCONTROL "LCTRL" +#define GAMEDEVICE_VK_RCONTROL "RCTRL" +#define GAMEDEVICE_VK_LMENU "LAlt" +#define GAMEDEVICE_VK_RMENU "RAlt" +#define GAMEDEVICE_VK_PAUSE "Pause" +#define GAMEDEVICE_VK_CAPITAL "Capslock" +#define GAMEDEVICE_VK_ESCAPE "Disabled" +#define GAMEDEVICE_VK_SPACE "Space" +#define GAMEDEVICE_VK_PRIOR "PgUp" +#define GAMEDEVICE_VK_NEXT "PgDn" +#define GAMEDEVICE_VK_HOME "Home" +#define GAMEDEVICE_VK_END "End" +#define GAMEDEVICE_VK_LEFT "Left" +#define GAMEDEVICE_VK_RIGHT "Right" +#define GAMEDEVICE_VK_UP "Up" +#define GAMEDEVICE_VK_DOWN "Down" +#define GAMEDEVICE_VK_SELECT "Select" +#define GAMEDEVICE_VK_PRINT "Print" +#define GAMEDEVICE_VK_EXECUTE "Execute" +#define GAMEDEVICE_VK_SNAPSHOT "SnapShot" +#define GAMEDEVICE_VK_INSERT "Insert" +#define GAMEDEVICE_VK_DELETE "Delete" +#define GAMEDEVICE_VK_HELP "Help" +#define GAMEDEVICE_VK_LWIN "LWinKey" +#define GAMEDEVICE_VK_RWIN "RWinKey" +#define GAMEDEVICE_VK_APPS "AppKey" +#define GAMEDEVICE_VK_MULTIPLY "Numpad *" +#define GAMEDEVICE_VK_ADD "Numpad +" +#define GAMEDEVICE_VK_SEPARATOR "\\" +#define GAMEDEVICE_VK_OEM_1 "Semi-Colon" +#define GAMEDEVICE_VK_OEM_7 "Apostrophe" +#define GAMEDEVICE_VK_OEM_COMMA "Comma" +#define GAMEDEVICE_VK_OEM_PERIOD "Period" +#define GAMEDEVICE_VK_SUBTRACT "Numpad -" +#define GAMEDEVICE_VK_DECIMAL "Numpad ." +#define GAMEDEVICE_VK_DIVIDE "Numpad /" +#define GAMEDEVICE_VK_NUMLOCK "Num-lock" +#define GAMEDEVICE_VK_SCROLL "Scroll-lock" + +//evil things I found in WinProc + +#define WINPROC_TURBOMODE_ON "Fast-Forward Activated" +#define WINPROC_TURBOMODE_OFF "Fast-Forward Deactivated" +#define WINPROC_TURBOMODE_TEXT "Fast-Forward" +#define WINPROC_HDMA_TEXT "HDMA emulation" +#define WINPROC_BG1 "BG#1" //Background Layers +#define WINPROC_BG2 "BG#2" +#define WINPROC_BG3 "BG#3" +#define WINPROC_BG4 "BG#4" +#define WINPROC_SPRITES "Sprites" +#define WINPROC_PADSWAP "Joypad swapping" +#define WINPROC_CONTROLERS0 "Multiplayer 5 on #0" +#define WINPROC_CONTROLERS1 "Joypad on #0" +#define WINPROC_CONTROLERS2 "Mouse on #1" +#define WINPROC_CONTROLERS3 "Mouse on #0" +#define WINPROC_CONTROLERS4 "Superscope on #1" +#define WINPROC_CONTROLERS5 "Justifier 1 on #1" +#define WINPROC_CONTROLERS6 "Justifier 2 on #1" +#define WINPROC_BGHACK "Background layering hack" +#define WINPROC_MODE7INTER "Mode 7 Interpolation" +#define WINPROC_TRANSPARENCY "Transparency effects" +#define WINPROC_CLIPWIN "Graphic clip windows" +#define WINPROC_PAUSE "Pause" +#define WINPROC_EMUFRAMETIME "Emulated frame time: %dms" +#define WINPROC_AUTOSKIP "Auto Frame Skip" +#define WINPROC_FRAMESKIP "Frame skip: %d" +#define WINPROC_TURBO_R_ON "Turbo R Activated" +#define WINPROC_TURBO_R_OFF "Turbo R Deactivated" +#define WINPROC_TURBO_L_ON "Turbo L Activated" +#define WINPROC_TURBO_L_OFF "Turbo L Deactivated" +#define WINPROC_TURBO_X_ON "Turbo X Activated" +#define WINPROC_TURBO_X_OFF "Turbo X Deactivated" +#define WINPROC_TURBO_Y_ON "Turbo Y Activated" +#define WINPROC_TURBO_Y_OFF "Turbo Y Deactivated" +#define WINPROC_TURBO_A_ON "Turbo A Activated" +#define WINPROC_TURBO_A_OFF "Turbo A Deactivated" +#define WINPROC_TURBO_B_ON "Turbo B Activated" +#define WINPROC_TURBO_B_OFF "Turbo B Deactivated" +#define WINPROC_TURBO_SEL_ON "Turbo Select Activated" +#define WINPROC_TURBO_SEL_OFF "Turbo Select Deactivated" +#define WINPROC_TURBO_START_ON "Turbo Start Activated" +#define WINPROC_TURBO_START_OFF "Turbo Start Deactivated" +#define WINPROC_FILTER_RESTART "You will need to restart Snes9x before the output image\nprocessing option change will take effect." +#define WINPROC_DISCONNECT "Disconnect from the NetPlay server first." +#define WINPROC_NET_RESTART "Your game will be reset after the ROM has been sent due to\nyour 'Sync Using Reset Game' setting.\n\n" +#define WINPROC_INTERPOLATED_SND "Interpolated sound" +#define WINPROC_SYNC_SND "Sync sound" +#define WINPROC_SND_OFF "Disabling the sound CPU emulation will help to improve\nemulation speed but you will not hear any sound effects\nor music. If you later want to re-enable the sound CPU\nemulation you will need to reset your game before it will\ntake effect.\n\nAre you sure this is what you want?" +#define WINPROC_SND_RESTART "You will need to reset your game or load another one\nbefore enabling the sound CPU will take effect." + +//Emulator Settings + +#define EMUSET_TITLE "Emulation Settings" +#define EMUSET_LABEL_FREEZE "Save Folder Directory" +#define EMUSET_BROWSE "&Browse..." +#define EMUSET_LABEL_ASRAM "Auto-Save S-RAM" +#define EMUSET_LABEL_ASRAM_TEXT "seconds after last change (0 disables auto-save)" +#define EMUSET_LABEL_SMAX "Skip at most" +#define EMUSET_LABEL_SMAX_TEXT "frames in auto-frame rate mode" +#define EMUSET_LABEL_STURBO "Skip Rendering" +#define EMUSET_LABEL_STURBO_TEXT "frames in fast-forward mode" +#define EMUSET_TOGGLE_TURBO "Toggled fast-forward mode" + +//Netplay Options + +#define NPOPT_TITLE "Netplay Options" +#define NPOPT_LABEL_PORTNUM "Socket Port Number" +#define NPOPT_LABEL_PAUSEINTERVAL "Ask Server to Pause when" +#define NPOPT_LABEL_PAUSEINTERVAL_TEXT "frames behind" +#define NPOPT_LABEL_MAXSKIP "Maximum Frame Rate Skip" +#define NPOPT_SYNCBYRESET "Sync By Reset" +#define NPOPT_SENDROM "Send ROM Image to Client on Connect" +#define NPOPT_ACTASSERVER "Act As Server" +#define NPOPT_PORTNUMBLOCK "Port Settings" +#define NPOPT_CLIENTSETTINGSBLOCK "Client Settings" +#define NPOPT_SERVERSETTINGSBLOCK "Server Settings" + +//Netplay Connect + + +#define NPCON_TITLE "Connect to Server" +#define NPCON_LABEL_SERVERADDY "Server Address" +#define NPCON_LABEL_PORTNUM "Port Number" +#define NPCON_CLEARHISTORY "Clear History" + + +//Movie Messages + +#define MOVIE_INFO_REPLAY "Movie replay" +#define MOVIE_INFO_RECORD "Movie record" +#define MOVIE_INFO_RERECORD "Movie re-record" +#define MOVIE_INFO_REWIND "Movie rewind" +#define MOVIE_INFO_STOP "Movie stop" +#define MOVIE_INFO_END "Movie end" +#define MOVIE_INFO_RECORDING_ENABLED "Recording enabled" +#define MOVIE_INFO_RECORDING_DISABLED "Recording disabled" +#define MOVIE_ERR_SNAPSHOT_WRONG_MOVIE "Snapshot not from this movie" +#define MOVIE_ERR_SNAPSHOT_NOT_MOVIE "Not a movie snapshot" +#define MOVIE_ERR_COULD_NOT_OPEN "Could not open movie file." +#define MOVIE_ERR_NOT_FOUND "File not found." +#define MOVIE_ERR_WRONG_FORMAT "File is wrong format." +#define MOVIE_ERR_WRONG_VERSION "File is wrong version." + +// Whoops! +#define FREEZE_INFO_WRONG_FORMAT "File not in Snes9x freeze format" +#define FREEZE_INFO_WRONG_VERSION "Incompatable Snes9x freeze file format version" +#define FREEZE_ERR_WRONG_FORMAT "File not in Snes9x freeze format" +#define FREEZE_ERR_WRONG_VERSION "Incompatable Snes9x freeze file format version" +#define FREEZE_ERR_NOT_FOUND "ROM image \"%s\" for freeze file not found" +#define FREEZE_INFO_LOADED "Loaded %s" +#define FREEZE_ERR_WRONG_ROM_NAME "Current loaded ROM image doesn't match that required by freeze-game file." + +// AVI Messages + +#define AVI_CONFIGURATION_CHANGED "AVI recording stopped (configuration settings changed)." diff -NaHudr snes9x-1.43-src/license.txt snx/license.txt --- snes9x-1.43-src/license.txt 2004-12-31 00:15:55.000000000 +0200 +++ snx/license.txt 2005-04-09 00:59:23.000000000 +0300 @@ -18,4 +18,4 @@ in future versions. Super NES and Super Nintendo Entertainment System are trademarks of -Nintendo Co., Limited and its subsidiary companies. \ No newline at end of file +Nintendo Co., Limited and its subsidiary companies. diff -NaHudr snes9x-1.43-src/offsets.h snx/offsets.h --- snes9x-1.43-src/offsets.h 1970-01-01 02:00:00.000000000 +0200 +++ snx/offsets.h 2005-04-09 00:59:23.000000000 +0300 @@ -0,0 +1,275 @@ +#define Flags CPU + 0 +#define BranchSkip CPU + 4 +#define NMIActive CPU + 5 +#define IRQActive CPU + 6 +#define WaitingForInterrupt CPU + 7 +#define InDMA CPU + 8 +#define WhichEvent CPU + 9 +#define PCS CPU + 12 +#define PCBase CPU + 16 +#define PCAtOpcodeStart CPU + 20 +#define WaitAddress CPU + 24 +#define WaitCounter CPU + 28 +#define Cycles CPU + 32 +#define NextEvent CPU + 36 +#define V_Counter CPU + 40 +#define MemSpeed CPU + 44 +#define MemSpeedx2 CPU + 48 +#define FastROMSpeed CPU + 52 +#define AutoSaveTimer CPU + 56 +#define SRAMModified CPU + 60 +#define NMITriggerPoint CPU + 64 +#define TriedInterleavedMode2 CPU + 69 +#define BRKTriggered CPU + 68 +#define NMICycleCount CPU + 72 +#define IRQCycleCount CPU + 76 +#define PB Registers + 0 +#define DB Registers + 1 +#define PP Registers + 2 +#define PL Registers + 2 +#define PH PL + 1 +#define AA Registers + 4 +#define AL Registers + 4 +#define AH AL + 1 +#define DD Registers + 6 +#define DL Registers + 6 +#define DH DL + 1 +#define SS Registers + 8 +#define SL Registers + 8 +#define SH SL + 1 +#define XX Registers + 10 +#define XL Registers + 10 +#define XH XL + 1 +#define YY Registers + 12 +#define YL Registers + 12 +#define YH YL + 1 +#define PCR Registers + 14 +#define RAM Memory + 0 +#define ROM Memory + 4 +#define VRAM Memory + 8 +#define SRAM Memory + 12 +#define BWRAM Memory + 16 +#define FillRAM Memory + 20 +#define C4RAM Memory + 24 +#define HiROM Memory + 28 +#define LoROM Memory + 29 +#define SRAMMask Memory + 32 +#define SRAMSize Memory + 36 +#define Map Memory + 40 +#define WriteMap Memory + 16424 +#define MemorySpeed Memory + 32808 +#define BlockIsRAM Memory + 36904 +#define BlockIsROM Memory + 41000 +#define ROMFilename Memory + 53368 +#define APUPCS IAPU + 0 +#define APURAM IAPU + 4 +#define APUExecuting IAPU + 12 +#define APUDirectPage IAPU + 8 +#define APUBit IAPU + 13 +#define APUAddress IAPU + 16 +#define APUWaitAddress1 IAPU + 20 +#define APUWaitAddress2 IAPU + 24 +#define APUWaitCounter IAPU + 28 +#define APUShadowRAM IAPU + 32 +#define APUCachedSamples IAPU + 36 +#define APU_Carry IAPU + 40 +#define APU_Zero IAPU + 41 +#define APU_Overflow IAPU + 42 +#define APUTimerErrorCounter IAPU + 44 +#define NextAPUTimerPos IAPU + 48 +#define APUCycles APU + 0 +#define APUShowROM APU + 4 +#define APUFlags APU + 5 +#define APUKeyedChannels APU + 6 +#define APUOutPorts APU + 7 +#define APUDSP APU + 11 +#define APUExtraRAM APU + 139 +#define APUTimer APU + 204 +#define APUTimerTarget APU + 210 +#define APUTimerEnabled APU + 216 +#define TimerValueWritten APU + 219 +#define CPUSpeed ICPU + 0 +#define CPUOpcodes ICPU + 4 +#define _Carry ICPU + 8 +#define _Zero ICPU + 9 +#define _Negative ICPU + 10 +#define _Overflow ICPU + 11 +#define ShiftedDB ICPU + 20 +#define ShiftedPB ICPU + 16 +#define CPUExecuting ICPU + 12 +#define Scanline ICPU + 28 +#define Frame ICPU + 24 +#define APUEnabled Settings + 0 +#define Shutdown Settings + 1 +#define SoundSkipMethod Settings + 2 +#define H_Max Settings + 4 +#define HBlankStart Settings + 8 +#define CyclesPercentage Settings + 12 +#define DisableIRQ Settings + 16 +#define Paused Settings + 17 +#define PAL Settings + 31 +#define SoundSync Settings + 108 +#define SA1Enabled Settings + 82 +#define SuperFXEnabled Settings + 80 +#define UseWIPAPUTiming Settings + 117 +#define ApuP APURegisters + 0 +#define ApuYA APURegisters + 2 +#define ApuA APURegisters + 2 +#define ApuY APURegisters + 3 +#define ApuX APURegisters + 4 +#define ApuS APURegisters + 5 +#define ApuPC APURegisters + 6 +#define APUPCR APURegisters + 6 +#define BGMode PPU + 0 +#define BG3Priority PPU + 1 +#define Brightness PPU + 2 +#define GHight PPU + 4 +#define GInc PPU + 5 +#define GAddress PPU + 6 +#define GMask1 PPU + 8 +#define GFullGraphicCount PPU + 10 +#define GShift PPU + 12 +#define CGFLIP PPU + 62 +#define CGDATA PPU + 64 +#define FirstSprite PPU + 576 +#define LastSprite PPU + 577 +#define OBJ PPU + 578 +#define OAMPriorityRotation PPU + 2114 +#define OAMAddr PPU + 2116 +#define OAMFlip PPU + 2119 +#define OAMTileAddress PPU + 2120 +#define IRQVBeamPos PPU + 2122 +#define IRQHBeamPos PPU + 2124 +#define VBeamPosLatched PPU + 2126 +#define HBeamPosLatched PPU + 2128 +#define HBeamFlip PPU + 2130 +#define VBeamFlip PPU + 2131 +#define HVBeamCounterLatched PPU + 2132 +#define MatrixA PPU + 2134 +#define MatrixB PPU + 2136 +#define MatrixC PPU + 2138 +#define MatrixD PPU + 2140 +#define CentreX PPU + 2142 +#define CentreY PPU + 2144 +#define Joypad1ButtonReadPos PPU + 2146 +#define Joypad2ButtonReadPos PPU + 2147 +#define CGADD PPU + 2148 +#define FixedColourGreen PPU + 2150 +#define FixedColourRed PPU + 2149 +#define FixedColourBlue PPU + 2151 +#define SavedOAMAddr PPU + 2152 +#define ScreenHeight PPU + 2154 +#define WRAM PPU + 2156 +#define BG_Forced PPU + 2160 +#define ForcedBlanking PPU + 2161 +#define OBJThroughMain PPU + 2162 +#define OBJThroughSub PPU + 2163 +#define OBJSizeSelect PPU + 2164 +#define OBJNameBase PPU + 2166 +#define OAMReadFlip PPU + 2169 +#define OAMData PPU + 2170 +#define VTimerEnabled PPU + 2714 +#define HTimerEnabled PPU + 2715 +#define HTimerPosition PPU + 2716 +#define Mosaic PPU + 2718 +#define BGMosaic PPU + 2719 +#define Mode7HFlip PPU + 2723 +#define Mode7VFlip PPU + 2724 +#define Mode7Repeat PPU + 2725 +#define Window1Left PPU + 2726 +#define Window1Right PPU + 2727 +#define Window2Left PPU + 2728 +#define Window2Right PPU + 2729 +#define ClipWindowOverlapLogic PPU + 2736 +#define ClipWindow1Enable PPU + 2742 +#define ClipWindow2Enable PPU + 2748 +#define ClipWindow1Inside PPU + 2754 +#define ClipWindow2Inside PPU + 2760 +#define RecomputeClipWindows PPU + 2766 +#define CGFLIPRead PPU + 2767 +#define OBJNameSelect PPU + 2768 +#define Need16x8Mulitply PPU + 2770 +#define Joypad3ButtonReadPos PPU + 2771 +#define MouseSpeed PPU + 2772 +#define RangeTimeOver PPU + 2118 +#define ColorsChanged IPPU + 0 +#define HDMA IPPU + 1 +#define HDMAStarted IPPU + 2 +#define MaxBrightness IPPU + 3 +#define LatchedBlanking IPPU + 4 +#define OBJChanged IPPU + 5 +#define RenderThisFrame IPPU + 6 +#define SkippedFrames IPPU + 20 +#define FrameSkip IPPU + 24 +#define TileCache IPPU + 28 +#define TileCached IPPU + 40 +#define VRAMReadBuffer IPPU + 52 +#define Interlace IPPU + 55 +#define DoubleWidthPixels IPPU + 57 +#define RenderedScreenHeight IPPU + 60 +#define RenderedScreenWidth IPPU + 64 +#define Red IPPU + 68 +#define Green IPPU + 1092 +#define Blue IPPU + 2116 +#define XB IPPU + 3140 +#define ScreenColors IPPU + 3144 +#define PreviousLine IPPU + 3656 +#define CurrentLine IPPU + 3660 +#define Joypads IPPU + 3668 +#define SuperScope IPPU + 3688 +#define Mouse IPPU + 3692 +#define PrevMouseX IPPU + 3700 +#define PrevMouseY IPPU + 3708 +#define Clip IPPU + 3716 +#define SA1Opcodes SA1 + 0 +#define SA1_Carry SA1 + 4 +#define SA1_Zero SA1 + 5 +#define SA1_Negative SA1 + 6 +#define SA1_Overflow SA1 + 7 +#define SA1CPUExecuting SA1 + 8 +#define SA1ShiftedPB SA1 + 12 +#define SA1ShiftedDB SA1 + 16 +#define SA1Flags SA1 + 20 +#define SA1Executing SA1 + 24 +#define SA1NMIActive SA1 + 25 +#define SA1IRQActive SA1 + 26 +#define SA1WaitingForInterrupt SA1 + 27 +#define SA1PCS SA1 + 32 +#define SA1PCBase SA1 + 36 +#define SA1PCAtOpcodeStart SA1 + 44 +#define SA1WaitAddress SA1 + 48 +#define SA1WaitCounter SA1 + 52 +#define SA1WaitByteAddress1 SA1 + 56 +#define SA1WaitByteAddress2 SA1 + 60 +#define SA1BWRAM SA1 + 40 +#define SA1Map SA1 + 64 +#define SA1WriteMap SA1 + 16448 +#define SA1op1 SA1 + 32832 +#define SA1op2 SA1 + 32834 +#define SA1arithmetic_op SA1 + 32836 +#define SA1sum SA1 + 32840 +#define SA1overflow SA1 + 32848 +#define VirtualBitmapFormat SA1 + 32849 +#define SA1_in_char_dma SA1 + 32850 +#define SA1variable_bit_pos SA1 + 32851 +#define SA1PB SA1Registers + 0 +#define SA1DB SA1Registers + 1 +#define SA1PP SA1Registers + 2 +#define SA1PL SA1Registers + 2 +#define SA1PH SA1PL + 1 +#define SA1AA SA1Registers + 4 +#define SA1AL SA1Registers + 4 +#define SA1AH SA1AL + 1 +#define SA1DD SA1Registers + 6 +#define SA1DL SA1Registers + 6 +#define SA1DH SA1DL + 1 +#define SA1SS SA1Registers + 8 +#define SA1SL SA1Registers + 8 +#define SA1SH SA1SL + 1 +#define SA1XX SA1Registers + 10 +#define SA1XL SA1Registers + 10 +#define SA1XH SA1XL + 1 +#define SA1YY SA1Registers + 12 +#define SA1YL SA1Registers + 12 +#define SA1YH SA1YL + 1 +#define SA1PCR SA1Registers + 14 diff -NaHudr snes9x-1.43-src/readme.txt snx/readme.txt --- snes9x-1.43-src/readme.txt 2004-12-31 00:15:55.000000000 +0200 +++ snx/readme.txt 2005-04-09 00:59:23.000000000 +0300 @@ -1,865 +1,877 @@ -Snes9x: The Portable Super Nintendo Entertainment System Emulator -================================================================= -Files included in the Snes9x archive: -Snes9x.exe, readme.txt, license.txt fmod.dll faqs.txt changes.txt - -v1.43 01-Jan-2005 -================= - -Home page: http://www.snes9x.com - -Contents -======== -Changes Since Last Release -Introduction -What You Will Need -Getting Started -Keyboard Controls -Joystick support -Game Saving -Netplay Support -Movie Support -Cheat Support -What's Emulated? -What's Not? -Super FX -S-DD1 and SPC7110 -S-RTC -SA-1 -C4 -3dfx Support -Problems With ROMs -Sound Problems -Converting ROM Images -Speeding up the Emulation -Getting Help -Credits - -Changes Since Last Release -========================== - -Check the CHANGES file for a complete history of Snes9x changes between -versions. - -Introduction -============ - -Snes9x is a portable, freeware Super Nintendo Entertainment System (SNES) -emulator. It basically allows you to play most games designed for the SNES -and Super Famicom Nintendo game systems on your PC or Workstation. The games -include some real gems that were only ever released in Japan. - -The original Snes9x project was founded by Gary Henderson and Jerremy Koot as -a collaboration of their earlier attempts at SNES emulation (snes96 and snes97) -Over the years the project has grown and has collected some of the greatest -talent in the emulation community (at least of the SNES variety) some of which -have been listed in the credits section, others have helped but have been loss -in the course of time. - -"Why emulate the SNES?" - -Well, there are many reasons for this. The main reason is for nostalgia purposes. -It's a hard find in this day and age to get a SNES and games for it. Plus many -of us over the course of time have lost our beloved consoles (may they R.I.P) but -still have our original carts. With no other means to play them, we turn to -emulators. Besides this there are many conveniences of doing this on the -computer instead of dragging out your old system. - -Advantages consist of: -- ability to save in any location of the game, despite how the game was designed - it's amazingly useful when you don't want to redo the same level over and over. -- built-in peripherals. This is anything from multi-taps, to super scopes, to - cheat devices. -- ability to rip sprites and music for your own personal use -- easier to organize and no stacks of cartridges that scare off non-nerdish women. -- filters can be used to enhance graphics on old games. - -As with all things there are disadvantages though: -- If you have an ancient PC (pre-Pentium 2) you aren't likely to get a playable - experience. -- some games are still unemulated (though this a very tiny minority) -- the emulator can be difficult for new users to configure (please read "getting - started" section below for info) - - -What You Will Need -================== - -A windows 9x/2k based machine for this port -DirectX 6.1b or later -133mhz processor BARE MINIMUM (1ghz+ rec for best settings) -16MB ram BARE MINIMUM (128megs+ rec for graphic pack games) -Any directsound capable sound card - -Certain games use added hardware which will REQUIRE a faster pc. Again, the -specs listed above the BARE MINIMUM to use snes9x in any playable form. Most -people will not even find that playable. It is recommended that you get a semi- -modern PC with a 600mhz Pentium 3/celeron/duron/athlon processor if you want -good results. A 1 GHz is recommended for those that want a near perfect -experience. Also 64MB of ram is highly suggested with the possibility of more -being needed if you play a game that requires graphic packs. - - -Software --------- -Access to SNES ROM images in *.smc, *.sfc, *.fig or *.1, *.2, or sf32xxxa, -sf32xxxb, etc., format otherwise you will have nothing to run! - -Some home-brewed ROM images can be downloaded from http://www.zophar.com. To -find commercial games, you could try a web search engine and some imaginative -use of search strings. Please note, it is illegal in most countries to have -commercial ROM images without also owning the actual SNES ROM cartridge. - -Getting Started -=============== - -Launch Snes9x using the Windows explorer to locate the directory where you -un-zipped the snes9x.exe and the fmod.dll files and double-click on -the snes9x.exe executable. You could create a shortcut to Snes9x and drag -that icon out onto your desktop. - -Loading Games -------------- -Use the Open option from the File menu to open the ROM load dialog. The dialog -allows you to browse your computer to locate the directory where you have -stored your SNES games. Single-click and then press Load to load and start the -game. - -SNES Rom images come in lots of different formats. Predominately you will be -playing ROMs that are still zipped. Snes9x supports zipped ROMs as long as there -is only 1 per zip file. Other formats are listed above in the "software" section. - -Game colour System ------------------- - -Snes9x displays the ROM information when a ROM is first loaded. Depending on the -colours used you can tell whether or not a ROM is a good working ROM, or if -it's been altered or is corrupted. - --White means the ROM should be a perfect working copy --Green means the ROM is mode 1 interleaved --Cyan means the ROM is mode 2 interleaved --Yellow means the ROM has probably been altered. Either it's a translation, - PD ROM, hacked, or possibly a bad ROM. It may also be an overdumped ROM. --Red means the ROM the ROM is definitely hacked and that a new version should be -found. some ROM Tools such as NSRT can also fix these ROMs. - -When asking for help on the Snes9x forums, please list the colour and CRC32 -that is displayed. This will help to find out what the problem is. - -These colours do NOT signify whether a game will work or not. It is just a means -for reference so we can understand what may or may not be a problem. If the -name is red search the internet for a program called NSRT (At present time this -can be found at http://nsrt.edgeemu.com) which may be able to fix it. Most -often the problem with games that don't work it's because they are corrupt or -are a bad dump and should be redownloaded. - -SNES Joypad Emulation ---------------------- -The default key mapping for joy-pad 1 is: - -'up arrow' Up direction -'down arrow' Down direction -'left arrow' Left direction -'right arrow' Right direction -'a' TL button -'z' TR button -'s' X button -'x' Y button -'d' A button -'c' B button -'return' Start button -'space' Select button - -The real SNES allowed up to five joy-pads to be plugged in at once via a -special adapter. Having five people crowd around the keyboard would not be -much fun, and anyway, all keyboards have a limit on the number of keys that -can be pressed simultaneously and still be detected correctly; much better to -use multiple joysticks or Netplay. - -Joystick Support -================ - -Configure and calibrate your joystick/joy-pad using Windows joystick applet in -the control panel BEFORE starting Snes9X, then use Snes9X's joy-pad config -dialog available from the Options menu to map your joystick/joy-pad's buttons -to the emulated SNES joy-pad(s) buttons. See 'Keyboard/Joystick Config' above -for details. - -Keyboard/Joystick Config ------------------------- - -Add support for your joystick and calibrate it using Windows' joystick applet -from the Windows control panel before starting Snes9x, then use Joy-pad -Configuration dialog in Snes9x to customize the keyboard/joystick to SNES -joy-pad mappings. The dialog is easy to use: select which SNES joy-pad you are -configuring using the combo box (#1 to #5). Make sure that you click the -"enabled" box on that controller or snes9x won't recognize a controller being -plugged in. Click on the text box next to 'UP' and then press the key on the -keyboard or button on your joystick that you would like to perform the UP action. -The focus will automatically move on to the 'RIGHT' text box, press the key or -joystick button that you want to perform the RIGHT action, and so on until -you've customized all the SNES joy-pad buttons. - -Use of diagonals should only be used by keyboard users who are having problems -pressing more then one or 2 buttons at a time. First you must hit "toggle -diagonals" so that you are able to change them. - -If you want to play a game that uses the multitap, you must first enable it in -the input menu. - -Alternate Controllers -===================== - -Many users have had trouble getting the alternate controllers such as the -Superscope working correctly. Due to the way these games use the controller -port, some games have issues with them. As Snes9x was designed, it was at one -time necessary to add a hack to disable problem devices. As of Snes9x 1.40, the -devices are unavailable for selection by default. This created a somewhat odd -method of activating the special controllers. Here is how you manage: - -First, select the optional controller you want enabled from the Input menu. -The controller is now selectable by pressing '7'. -Load your game and select the controller using 7. If the game does not pick up -the controller, reset the game. At some point, this will probably be rewritten. -We do not know when this will occur. - - -Additional Keyboard Controls -============================ - -While the emulator is running: - -'Escape' Show/hide the menu-bar. - -'Pause' Pause the emulator - -Alt+'Return' Toggle between full-screen and windowed mode. - -'`' Superscope turbo button. - -'~' Superscope pause button. - -'Tab' Turbo mode (fast forward) - for skipping long intros. - -'0' Toggle H-DMA emulation on/off. - -'1' Toggle background 1 on/off. - -'2' Toggle background 2 on/off. - -'3' Toggle background 3 on/off. - -'4' Toggle background 4 on/off. - -'5' Toggle sprites on/off - -'6' Toggle swapping of joy-pad one and two around - -'7' Rotate between Multi-player 5, mouse on port 1, - mouse on port 2 and SuperScope emulation. (need to enable - special controllers in the menu first) - -'8' Toggle background layer priorities for backgrounds - involved in sub-screen addition/subtraction. - -'9' Toggle transparency effects on and off - only if - 16-bit or higher screen mode selected. - -Shift+'9' Toggle mode 7 bi-linear filtering on and off. - -'Backspace' Toggle emulation of graphics window effects on/off. - -Shift+'F1-F9 ' Save a freeze game file. - -'F1-F9' Load a freeze game file, restoring a game to an - exact position. - - -Shift+'+' Increase emulated frame time by 1ms - slowing down - the game. (auto-frame skip only) - -Shift+'-' Decrease emulated frame time by 1ms - speeding up the - game. (auto-frame skip only) - -Shift+'insert' Toggles turbo on the 'L' button. Note: toggles for all - controllers - -Shift+'delete' Toggles turbo on the 'R' button... - -Shift+'[' Toggles turbo on the 'select' button... - -Shift+']' Toggles turbo on the 'start' button... - -Shift+'home' Toggles turbo on the 'Y' button... - -Shift+'pageup' Toggles turbo on the 'X' button... - -Shift+'end' Toggles turbo on the 'B' button... - -Shift+'pagedown' Toggles turbo on the 'A' button... - - -'+' Increase frame rendering skip rate, making the screen - updates more jerky but speeding up the game. - -'-' Decrease frame rendering skip rate, making the game - update more smoothly, but potentially slowing down the - game. Repeatedly pressing the key will eventually - switch to auto-frame skip rate where the rate is - dynamically adjusted to keep a constant game play - speed. - -'.' Toggles movie recording on/off. - -'F12' Takes a screenshot - -Several of the menu items also have keyboard accelerators; browse the menus -to see what they are. - - -Game Saving -=========== - -Many SNES games could take a very long time to complete from start to finish so -they allowed your progress to be saved into RAM fitted inside the game pack; -the RAM contents were backed up by a battery when the SNES was switched off or -the game removed. Snes9x simulates this by saving the contents of the emulated -battery-backed RAM into a file (*.srm) when you load a new game or exit Snes9x. -The file is then automatically re-loaded the next time you play the game. - -Snes9x also provides freeze-files; these are files that save a game's -position at any point in the game, not just at predefined places chosen by -the game's designers - ideal for saving your game just before a tricky bit! -Snes9x provides 9 save slots; during a game, press Shift + F1 to F9 to save a -game, and just F1 to F9 to load it again later. - -Freeze game files and Save-RAM (S-RAM) save files are normally written to and -read from the folder where the ROM image was located, but sometimes this is not -desirable or possible, especially if it’s a CD-ROM, which is of course is -usually read-only! You can change the folder where Snes9X saves and loads S-RAM -and freeze-files using the Settings Dialog, available from the Options menu. - -Snes9x uses its own unique format for freeze-files, as does ZSNES, but Snes9x -can also load ZSNES format freeze-files. Just copy the ZSNES freeze files into -your save directory and, if the native format Snes9x freeze file doesn't exist -(.00X where X is a digit), Snes9x will try to load the -corresponding ZSNES freeze file instead (.zsX where X is a 't' -or a digit). When you freeze a game position after loading a ZSNES format -freeze file, Snes9x will save it in native Snes9x format. - -Netplay Support -=============== -Netplay Support is disabled in this release - -Movie Support -============= - -This feature allows you to record your actions while playing a game. This can be -used for your own personal playback or to show other people that you can do -something without them having to be around when you did it. These can be saved -and shared on the internet with ease as they are comparatively small. - -To use, simply click file and click on movie. Click the record button. Here you -can decide when to start recording. If you want to record from the very start -of a game,click on record from reset. If you want to start recording from where -you are alreadyin a game click the record from now. You can also choose which -controllers to record. If you are playing by yourself leave joypad 1 as the -only one selected. The more controllers you choose to record the larger the -file size will be. - -To play back a movie you recorded simple click file, movie, play and select the -file to play. Make sure the movie was recorded with the same ROM that you have -loaded" - -If you make a mistake while recording a movie, there is a movie rerecord -function. Simply create a save state anytime while recording. If you want to -re-record simply load the save state and it will bring up the message -"movie re-record". Loading any save state while a movie is playing or recording -will cause this to happen. If you want to watch a video with no chance to -accidentally alter it check "open as read only" when you go to play it. - - -Cheat Support -============= - -Use the Cheat Code Entry and Editor dialog from the Cheats menu to enter -Game Genie or Pro-Action Reply cheat codes. Cheat codes allow you to, -surprisingly, cheat at games; they might give you more lives, infinite health, -enable special powers normally only activated when a special item is found, -etc. - -Many existing Game Genie and Pro-Action Reply codes can be found at: -http://vgstrategies.about.com/library/ggn/bl_ggnsnes.htm?once=true& - -Type in a Game Genie or Pro-Action Reply code into the "Enter Cheat Code" text -edit box and press . Be sure to include the '-' when typing in a Game -Genie code. You can then type in an optional short description as a reminder -to yourself of what function the cheat performs. Press again or click -the Add button to add the cheat to the list. - -Note that the Add button remains insensitive while "Enter Cheat Code" text -edit box is empty or contains an invalid code. The cheat code is always -translated into an address and value pair and displayed in the cheat list as -such. - -Beware of cheat codes designed for a ROM from a different region compared to -the one you are playing or for a different version of the ROM; the source of -the cheats should tell you which region and for which version of the game they -were designed for. If you use a code designed for a different region or version -of your game, the game might crash or do other weird things. - -It is also possible to enter cheats as an address and value pair; some users -have requested this functionality. Type in the address into the "Address" -text edit box then type the value into the "Value" text edit box. The value is -normally entered in decimal, but if you prefix the value with a '$' or append -an 'h' then you can enter the value in hex. - -Double-clicking on an cheat line from the list in the dialog or clicking on -the "En" column toggles an individual cheat on and off. All cheats can be -switched on and off by checking and unchecking the "Apply cheats" item from -the Cheat menu. - -Selecting a cheat from the list causes its details to be filled into the text -edit boxes in the dialog box; the details can then be edited and the Change -button pressed to commit the edits. Note that the "Enter Cheat Code" text edit -box always redisplays the cheat code as a Pro-Action Replay code regardless of -whether you originally entered it as a Game Genie or Pro-Action Replay code. - -Selecting a cheat from the list then pressing the Delete button permanently -removes that cheat. - -Cheats are saved in .cht files stored in the Freeze File Directory and are -automatically loaded the next time a game with the same filename is loaded. -The format for the .cht files is the same format as used by the other excellent -SNES emulator, ZSNES. - -Snes9X also allows new cheats to be found using the Search for New Cheats -dialog, again available from the Cheats menu. The easiest way to describe the -dialog is to walk through an example. - -Cheat Search Example --------------------- -Let’s give ourselves infinite health and lives on Ocean's Addams Family -platform game: - -Load up the game; keep pressing the start button (Return key by default) to -skip past the title screens until you actually start playing the game. You'll -notice the game starts with 2 health hearts and 5 lives. Remember that -information, it will come in useful later. - -Launch the cheat search dialog for the first time; Alt+A is its accelerator. -Press the Reset button just in case you've used the dialog before, leave the -Search Type and Data Size radio boxes at their default values and press OK. - -Play the game for a while until you loose a life by just keep walking into -baddies, when the game restarts and the life counter displays 4, launch the -cheat search dialog again but this time press the Search button rather than -Reset. The number of items in the list will reduce, each line shows a memory -location, its current value and its previous value; what we're looking for is -the memory location where the game stores its life counter. - -Look at address line 7E00AC, its current value is 4 and its previous value was -5. Didn't we start with 5 lives? Looks interesting... - -Note that some games store the current life counter as displayed on the screen, -while others store current number of lives minus 1. Looks like Addams Family -stores the actual life count as displayed on the screen. - -Just to make sure you've found the correct location, press OK on the dialog, -and play the game until you loose another life. Launch the search dialog again -after the life counter on screen has been updated and press the Search -button. Now there are even fewer items in the list, but 7E00AC is there again, -this time the current value is 3 and the previous value was 4. Looks very much -like we've found the correct location. - -Now that we're happy we've found the correct location, click on the 7E00AC -address line in the list and then press the Add Cheat button. Another dialog, -Cheat Details, will be displayed. Type in a new value of say 5, this will be -number of lives that will be displayed by the lives counter. Don't be greedy; -some games display a junk life counter or might even crash if you enter a -value that's too high; Snes9X keeps the value constant anyway, so even if you -do loose a life and life counter goes down by one, less than 20ms later, -Snes9X resets the counter back to the value you chose! - -If the memory location you add a cheat on proves to be wrong, just go to the -Cheat Code Editor dialog and delete the incorrect entry. - -Now let’s try and find the Addams Family health counter. While two hearts are -displayed on the screen, visit the cheat search dialog and press the Reset -button followed by OK. Play the game until you loose a heart by touching a -baddie, then visit the cheat search dialog again. - -Press the Search button to update the list with all memory locations that have -gone down in value since the last dialog visit. We're going to have to try and -find the heart memory location now because there were only two hearts to start -with. - -Look at address line 7E00C3, its current value is 1 and its previous value was -2. Scrolling through the list doesn't reveal any other likely memory locations, -so let’s try our luck. Click on the 7E00C3 line, press the Add Cheat button and -type in a new value of say 4 into the dialog that appears and press OK. Press -OK on the Search for New Cheats dialog to return to the game. - -At first sight it looks like 7E00C3 wasn't the correct memory location because -the number of hearts displayed on screen hasn't gone up, but fear not, some -games don't continually update health and life displays until they think they -need to. Crash into another baddie - instead of dying, the number of hearts -displayed jumps up to 4! We've found the correct location after all! - -Now every time you play Addams Family you'll have infinite lives and health. -Have fun finding cheats for other games. - -What's Emulated? -=============== -- The 65c816 main CPU. -- The Sony SPC700 sound CPU. -- SNES variable length machine cycles. -- 8 channel DMA and H-DMA (raster effects). -- All background modes, 0 to 7. -- Sound DSP, with eight 16-bit, stereo channels, compressed samples, hardware - attack-decay-sustain-release volume processing, echo, pitch modulation - and digital FIR sound filter. -- 8x8, 16x8 and 16x16 tile sizes, flipped in either direction. -- 32x32, 32x64, 64x32 and 64x64 screen tile sizes. -- H-IRQ, V-IRQ and NMI. -- Mode 7 screen rotation, scaling and screen flipping. -- Vertical offset-per-tile in modes 2, and 4. -- Horizontal offset-per-tile in modes 2, 4 and 6. -- 256x224, 256x239, 512x224, 512x239, 512x448 and 512x478 SNES screen - resolutions. -- Sub-screen and fixed colour blending effects. -- Mosaic effect. -- Single and dual graphic clip windows, with all four logic combination modes. -- Colour blending effects only inside or outside a window. -- 128 8x8, 16x16, 32x32 or 64x64 sprites, flipped in either direction. -- SNES palette changes during frame (15/16-bit internal rendering only). -- Direct colour mode - uses tile and palette-group data directly as RGB value. -- Super FX, a 21/10MHz RISC CPU found in the cartridge of several games. -- S-DD1, a data decompression chip used only in Star Ocean and Street Fighter 2 - Alpha. The compression algorithm is integrated into Snes9x, but you may still - use the old graphics pack cheat as a speed boost. -- SPC7110, similar in use to S-DD1, but the algorithm is still unknown. -- S-RTC, a real-time clock chip. Dai Kaijyu Monogatari II is the only game - that uses it. -- SA-1, a faster version of CPU found in the main SNES unit together with some - custom game-accelerator hardware. -- C4, a custom Capcom chip used only in Megaman X2 and X3. It’s a sprite scaler/ - rotator/line drawer/simple maths co-processor chip used to enhance some - in-game effects. -- OBC1 is a sprite management chip. Metal combat is the only game to use this. -- Greater DSP-1 support, enough that all games should load, but some may have - graphical glitches. -- DSP-2 support. Only used in Dungeon Master -- DSP-4 partial support. Top Gear 3000 goes in game but still very glitchy -- SNES mouse. -- SuperScope (light gun) emulated using computer mouse. -- Multi-player 5 - allowing up to five people to play games simultaneously on - games that support that many players. -- Game-Genie and Action Replay cheat codes. -- Multiple ROM image formats, with or without a 512 byte copier header. -- Single or split images, compressed using zip and gzip, and interleaved in one - of two ways. -- Auto S-RAM (battery backed RAM) loading and saving. -- Freeze-game support, now portable between different Snes9x ports. -- Interpolated sound. -- Justifier support. Konami's Justifier is similar to the Super Scope and used - in Lethal Enforcers -- Seta-10 CPU (ST010). This is used F1 Race of Champions 2 - -What's Not? -========== -- DSP-1 support not complete, enough to play Mario Kart, Pilotwings and many - others. All DSP-1 games should boot, but may display graphical errors. -- Any other odd chips that manufactures sometimes placed inside the - cartridge to enhance games and as a nice side-effect, also act as an - anti-piracy measure. (DSP-3, DSP-4, SETA 11 and SETA 18, as examples) -- Pseudo hi-res. mode - SNES hardware uses interpolation to give apparent - increase in horizontal resolution, which is only partially emulated. -- Mosaic effect on mode 7. -- A couple of SPC700 instructions that I can't work exactly out what they - should do. -- Fixed colour and mosaic effects in SNES hi-res. (512x448) modes. -- Offset-per-tile in mode 6. Luckily I haven't found a game that uses it, yet. -- The expansion slot found in many carts. - -Super FX -======== -The Super FX is a 10.5/21MHz RISC CPU developed by Argonaut Software used as a -game enhancer by several game tiles. Support is still a little buggy but most -games work very well, if a little slowly. Released SNES Super FX games included -Yoshi's Island (best single-player game on SNES, if you like platform games), -Doom, Winter Gold, Dirt Trax FX, StarFox, Stunt Race FX and Vortex. If you're -lucky, you might find a copy of the unreleased Starfox 2 image floating around, -but its sound code is corrupt and you'll need to disable sound CPU emulation to -play it. (NOTE: A new version of Starfox 2 was recently released that is closer -to being a complete ROM. It is mostly playable in the emulator but due to it -being an incomplete game it does have many errors. This is not the fault of -the emulator) - -Lots of Super FX ROM images available are in an odd, interleaved format that I -haven't worked out an easy way to auto-detect. If Snes9x detects that a -Super FX game crashes (by executing a BRK instruction), it automatically -assumes the ROM is in this odd format and de-mangles the ROM and tries to run -it again. If your ROM image isn't working, you could try selecting the -Interleave mode 2 option on the ROM load dialog before loading the game to help -out Snes9x. - -S-DD1 and SPC7110 -===== -The S-DD1 is a custom data decompression chip that can decompress data in real- -time as the SNES DMA's data from the ROM to RAM. Only two games are known to -use the chip: Star Ocean and Street Fighter Alpha 2. - -SPC7110 is a compression and memory mapping chip. It provides a few extra -features, as well. It functions as an RTC interface, and has a multiply/divide -unit that has more precision than the SNES. The SPC7110 is found only in 4 -games: Super Power League 4, Far East of Eden Zero, Far East of Eden Zero - -Shounen Jump no Shou, and Momotaro Densetsu Happy. - -These chips use some unknown compression algorithms, so to actually support the -games using these, pre-decompressed graphics packs must be downloaded from the -web, unpacked, and the resultant folder can be selected from the Snes9x options --> GFX Pack Configuration. As of Snes9x 1.42, the S-DD1 can be used without the -graphics packs. - -To use the graphics packs for the S-DD1, as of 1.42 and later, you MUST tell -Snes9x where the pack is located. If you do not, it will use on-the-fly -decompression. On the other hand, to use on-the-fly decompression, make sure the -game's pack entry is blank. - -The SPC7110 still uses packs at all times, and if no pack is defined, it will -search the locations just like ZSNES. - -SA-1 -==== -The SA-1 is a fast, custom 65c816 8/16-bit processor, the same as inside the -SNES itself, but clocked at 10MHz compared to a maximum of 3.58MHz for the CPU -inside the SNES. - -The SA-1 isn't just a CPU; it also contains some extra circuits developed by -Nintendo which includes some very fast RAM, a memory mapper, DMA and, several -real-time timers. - -Snes9X includes emulation of most features of the SA-1, enough to play all SA-1 -games I've located so far, these include Mario RPG, Kirby Superstar and -Parodius 3. - -C4 -== - -The C4 is custom Capcom chip used only in the Megaman X2 and Megaman X3 games. -It can scale and rotate images, draw line-vector objects and do some simple -maths to rotate them. - -Snes9x's C4 emulation is a direct copy of the ZSNES C4 emulation; Intel-based -ports even make use of ZSNES code. Without zsKnight's hard work, Snes9x would -not have C4 emulation. Many thanks go to him. - - -Problems With ROMs -================== - -If the emulator just displays a black screen for over 10 seconds after you've -loaded a ROM image, then one of the following could be true: - -1) You just loaded some random ROM image you've downloaded from the Internet - and it isn't even a SNES game or you only downloaded part of the image. - Snes9x only emulates games designed for the Super NES, not NES, or - Master System, or Game Boy, or . -2) If it's a Super FX game, chances are it's in interleaved2 format, try - switching to "Interleaved mode 2" on the ROM load dialog before loading the - game. -3) Someone has edited the Nintendo ROM information area inside the ROM image - and Snes9x can't work out what format ROM image is in. Try playing - around with the ROM format options on the ROM load dialog. -4) The ROM image is corrupt. If you're loading from CD, I know it might - sound silly, but is the CD dirty? Clean, un-hacked ROM images will display - [checksum ok] when first loaded, corrupt or hacked ROMs display - [bad checksum]. -5) The original SNES ROM cartridge had additional hardware inside that is not - emulated yet and might never be. -6) You might be using a file that is compressed in a way Snes9x does not - understand. - -The following ROMs are known to currently not to work with any version of Snes9x: -- Top Gear 3000/Planets Champ TG 3000 - DSP-4 -- SD Gundam GX - DSP-3 -- Hayazashi Nidan Morita Shougi - Seta 11 -- Hayazashi Nidan Morita Shougi 2 - Seta 18 - -Sound Problems -============== - -No sound coming from any SNES game using Snes9x? Could be any or all of -these: - -- If all sound menu options are grayed out, or an error dialog about Snes9x not - being able to initialize DirectSound is displayed - then DirectSound could - not initialize itself. Make sure DirectX 6 or above is installed and your - sound card is supported by DirectX. - - Installing the latest drivers for your sound card might help. Another - Windows application might have opened DirectSound in exclusive mode or - opened the Windows WAVE device - WinAmp uses the Windows WAVE device by - default - in which case you will need to stop that application and then - restart Snes9x. It is possible to switch WinAmp to use DirectSound, in - which case both Snes9x and WinAmp output can be heard at the same time. - - If your sound card isn't supported by DirectX very well (or not at all) you - will have to use FMOD's WAVE output option; but WAVE output introduces a - 0.15s delay between Snes9x generating sample data and you hearing it. - Select FMOD's WAVE output by choosing the "FMOD Windows Multimedia" sound - driver option from the Sound Settings dialog. - -- The sound card's volume level might be set too low. Snes9x doesn't alter the - card's master volume level so you might need to adjust it using the sound - card's mixer/volume controls usually available from the task bar or start - menu. -- Make sure your speakers and turned on, plugged in and the volume controls are - set to a suitable level. -- You've turned off sound CPU emulation, clicked the Mute button in the - sound settings dialog, or set the playback rate to "". - -General sound problems: -- A continuous, crackling sound or buzz can be heard. - - First make sure it is happening in all games - Snes9x still does have one or - two sound emulation bugs that cause the odd pop, crackle and buzz in a few - games. - - Once you're happy that it is not just the game you're playing, set the - playback rate in the Sound Settings dialog to 32KHz, and uncheck "Stereo" and - "16bit playback". Next set both sound buffer length and mix values to 10ms, - then try slowly increasing both values until clear sound can be heard. The - ideal is that the mix interval and sound buffer length values should be as - small as possible. The mix interval value must always be smaller than the - sound buffer length otherwise sound data will be lost. - - If your sound card requires larger values, above, say, 40ms, then it might - also be necessary to enable the "Generate sample data in sync with sound CPU" - option to maintain accurate sound emulation. - - If all else fails, try selecting the "FMOD Window Multimedia" sound driver - option and live with the 0.15s lagged sound that is unavoidable when using - the older Windows WAVE sound API. - - Once you have clear sound, set the playback rate, 16bit sound and stereo - settings to quality you would like - it might be necessary to tweak the - sound buffer length and mix interval values again. - -- Sound the lagged/delayed compared to on-screen action. If you're using the - "FMOD Windows Multimedia" sound driver then delayed sound is unavoidable; - otherwise your sound buffer length/mix interval settings are too large - if - you can, reduce their values. -- Sound quality is poor on all games. You might have a noisy sound card - (usually cheaper sound cards), turning on 16-bit, interpolated sound, - sync-sound and/or increasing the playback rate might help. -- Sound seems to have gaps. Using larger sound buffer or mix interval values - can cause this; reduce them if you can, or click on the "Generate sample data - in sync with sound CPU" option. -- Sound is awful in all games. You might have selected a playback rate/stereo/ - 8-bit/16-bit combination that your sound card can't cope with. Try setting - 8-bit (uncheck the 16bit playback option), mono (uncheck the Stereo option) - 22KHz from the sound menu and if that cures the problem, try other - combinations until you find the best setting that works on your sound card. - -If all else fails, try posting a message describing your problem and -requesting help on the Snes9X message board at the Snes9X web site, -http://www.snes9x.com/ - -Converting ROM Images -===================== - -If you have a ROM image in several pieces, simply rename them so their -filename extensions are numbered: e.g. game.1, game.2, etc. Then, when -loading the ROM image, just specify the name of the first part; the remaining -parts will be loaded automatically. - -If they are already in the form sf32xxxa, sf32xxxb, etc., you don't even have -to rename them; just choose the name of the first part from the ROM load -dialog, as above. - -If you want the ROM to be 1 piece instead of many, you can use tools such as -SNESTool to remerge the files into one file. - -Emulation speed -=============== - -Emulating an SNES is very processor intensive, with its two or sometimes three -CPUs, an 8 channel digital sound processor with real-time sound sample -decompression and stereo sound, two custom graphics processors, etc. - -If you only have a minimum level machine, you will need to stick to using only -8-bit graphics and minimal or no sound. Disabling the joystick support will also -help. - -Full-screen mode is generally faster than windowed mode. - -Enabling one of the output image processing modes from the Display Config -dialog can slow down overall emulation speed greatly depending on the type of -game and video RAM speed. Enabling the stretch image option further reduces -emulation speed. - -If you want the SNES image to fill your computer screen and want maximum speed, -use the 3dfx bi-linear option if you have a Voodoo 3dfx card, or select output -image mode as none and check the full-screen and stretch image options. - -Lowering the sound playback rate, selecting 8-bit mono sound or turning off -interpolated or sync-sound modes, or turning off sound CPU emulation altogether -will also help boost emulation speed. - -Credits -------- - -- Jerremy Koot for all his hard work on previous versions of Snes96, Snes97 - and Snes9x. -- Ivar for the original Super FX C emulation, DSP-1 emulation work and - information on both chips. -- zsKnight and _Demo_ for the Intel Super FX assembler, DSP-1 and C4 emulation - code. -- zsKnight and _Demo_ for all the other ideas and code I've nicked off them; - they've nicked lots of my ideas and information too! -- John Weidman and Darkforce for the S-RTC emulation information and code. -- Kreed for his excellent image enhancer routines. -- Nose000 for code changes to support various Japanese SNES games. -- Neill Corlett for the IPS patching support code. -- DiskDude's SNES Kart v1.6 document for the Game Genie(TM) and Pro-Action - Replay cheat system information. -- Lord ESNES for some nice chats and generally useful stuff. -- Lee Hyde (lee@jlp1.demon.co.uk) for his quest for sound information and - the Windows 95 icon. -- Shawn Hargreaves for the rather good Allegro 3.0 DOS library. -- Robert Grubbs for the SideWinder information - although I didn't use his - actual driver in the end. -- Steve Snake for his insights into SNES sound sample decompression. -- Vojtech Pavlik for the Linux joystick driver patches. -- Maciej Babinski for the basics of Linux's DGA X server extensions. -- Alexander Larsson for the GGI Linux port code. -- Harald Fielker for the original sound interpolation code (never used directly - due to problems). -- Takehiro TOMINAGA for many speed up suggestions and bug fixes. -- Predicador for the Windows icon. -- Lindsey Dubb for the mode 7 bi-linear filter code and the improved - colour addition and subtraction code. -- Anti Resonance for his super-human efforts to help get his fast sound CPU - core and sound DSP core working in Snes9x. -- pagefault, TRAC, Dark Force, and others who have donated ideas and/or code - to the project. - -Nintendo is a trademark. -Super NES, SuperScope and Super FX are trademarks of Nintendo. -Sun, Solaris and Sparc are all trademarks of Sun Microsystems, Inc. -Game Genie is a trademark of Lewis Galoob Toys, Inc. -MS-DOS and Windows 95 are trademarks of Microsoft Corp. -Intel, Pentium and MMX are all trademarks of Intel Corp. -Sony is a trademark of Sony Corp. -UNIX is a registered trademark of X/Open. -Glide is a trademark of 3Dfx Interactive, inc. -Linux is a registered trademark of Linus Torvalds. - ------------------------------------------------------------------------------- -Gary Henderson -gary@snes9x.com - -Updated most recently by: funkyass +Snes9x: The Portable Super Nintendo Entertainment System Emulator +================================================================= +v1.42 4-Dec-2003 +================= + +Home page: http://www.snes9x.com + +Contents +======== +Changes Since Last Release +Introduction +What's Emulated +What's Not +What You Will Need +Getting Started +Game colour System +Keyboard Controls +Joystick Support +Game Saving +Netplay Support +Cheat Support +Super FX +S-DD1 and SPC7110 +S-RTC +SA-1 +C4 +3dfx Support +Problems With ROMs +Sound Problems +Converting ROM Images +Speeding up the Emulation +Getting Help +Credits + +Changes Since Last Release +========================== + +Check the CHANGES file for a complete history of Snes9x changes between +versions. + +Introduction +============ + +Snes9x is a portable, freeware Super Nintendo Entertainment System (SNES) +emulator. It basically allows you to play most games designed for the SNES +and Super Famicom Nintendo game systems on your PC or Workstation. The games +include some real gems that were only ever released in Japan. + +Snes9x is the result of well over six years worth of part-time hacking, +coding, recoding, debugging, etc. Snes9x is coded in C++, with three assembler +CPU emulation cores on the i386 Linux, DOS and Windows ports. + +Snes9x is better than a real SNES: +o Freeze a game at any position, then restore the game to that exact spot at + a later date - ideal for saving a game just before a difficult bit. +o Built-in cheat cartridge. +o Built-in peripheral emulation. The SNES mouse, Multi-player 5 and SuperScope + external add-ons are all emulated, they cost extra money with a real SNES. +o Stereo sound - yes I know the SNES produced stereo sound, but who actually + paid the inflated price for the special lead just so you could hear it? +o No more cartridge contact cleaning! +o Some SNES hardware features that be turned on and off during game play, + games might be using one of these features to deliberately make a section + of the game more difficult. Easy, just turn the feature off! +o Networked game play on some ports. +o Speed up or slow down SNES games. +o Save screen shots to impress(?!) your friends. ('F12') +o No unsightly stacks of cartridges. + +Snes9x is worse than a real SNES: +o Unless your computer is very fast (Pentium II+), some games just can't + hit every frame being rendered and the emulator starts to skip the drawing + of some frames to keep the emulator running at a constant speed - to you + it appears as if the graphics aren't moving as smoothly as they could. +o Not all games work; bugs and missing features cause some games to fail to + work or renders them un-playable. +o You have to wait for your computer to boot before you can play games, + no waiting on the real SNES! +o The SNES has an analogue low-pass sound filter that give a nice bass to + all the sounds and music - Snes9x doesn't emulate this. If you have + a posh sound card, you could try fiddling with it mixer controls to produce + a similar effect. Turning on interpolated sound helps a lot. + +What's Emulated +=============== +- The 65c816 main CPU. +- The Sony SPC700 sound CPU. +- SNES variable length machine cycles. +- 8 channel DMA and H-DMA (raster effects). +- All background modes, 0 to 7. +- Sound DSP, with eight 16-bit, stereo channels, compressed samples, hardware + attack-decay-sustain-release volume processing, echo, pitch modulation + and digital FIR sound filter. +- 8x8, 16x8 and 16x16 tile sizes, flipped in either direction. +- 32x32, 32x64, 64x32 and 64x64 screen tile sizes. +- H-IRQ, V-IRQ and NMI. +- Mode 7 screen rotation, scaling and screen flipping. +- Vertical offset-per-tile in modes 2, and 4. +- Horizontal offset-per-tile in modes 2, 4 and 6. +- 256x224, 256x239, 512x224, 512x239, 512x448 and 512x478 SNES screen + resolutions. +- Sub-screen and fixed colour blending effects. +- Mosaic effect. +- Single and dual graphic clip windows, with all four logic combination modes. +- Colour blending effects only inside or outside a window. +- 128 8x8, 16x16, 32x32 or 64x64 sprites, flipped in either direction. +- SNES palette changes during frame (15/16-bit internal rendering only). +- Direct colour mode - uses tile and palette-group data directly as RGB value. +- Super FX, a 21/10MHz RISC CPU found in the cartridge of several games. +- S-DD1, a data decompression chip used only in Star Ocean and Street Fighter 2 + Alpha. The compression algorithm is integrated into Snes9x, but you may still + use the old graphics pack cheat as a speed boost. +- SPC7110, similar in use to S-DD1, but the algorithm is still unknown. +- S-RTC, a real-time clock chip. Dai Kaijyu Monogatari II is the only game + that uses it. +- SA-1, a faster version of CPU found in the main SNES unit together with some + custom game-accelerator hardware. +- C4, a custom Capcom chip used only in Megaman X2 and X3. Its a sprite scaler/ + rotator/line drawer/simple maths co-processor chip used to enhance some + in-game effects. +- OBC1 is a sprite management chip. Metal combat is the only game to use this. +- Greater DSP-1 support, enough that all games should load, but some may have + graphical glitches. +- DSP-2 support. Only used in Dungeon Master +- SNES mouse. +- SuperScope (light gun) emulated using computer mouse. +- Multi-player 5 - allowing up to five people to play games simultaneously on + games that support that many players. +- Game-Genie and Action Replay cheat codes. +- Multiple ROM image formats, with or without a 512 byte copier header. +- Single or split images, compressed using zip and gzip, and interleaved in one of two + ways. +- Auto S-RAM (battery backed RAM) loading and saving. +- Freeze-game support, now portable between different Snes9x ports. +- Interpolated sound. + +What's Not +========== +- Only partial DSP-1 support, enough to play Mario Kart, Pilotwings and many + others. All DSP-1 games should boot, but may display graphical errors. +- Any other odd chips that manufactures sometimes placed inside the + cartridge to enhance games and as a nice side-effect, also act as an + anti-piracy measure. (Examples: DSP-X, Seta, etc) +- Pseudo hi-res. mode - SNES hardware uses interpolation to give apparent + increase in horizontal resolution, which is only partially emulated. +- Mosaic effect on mode 7. +- A couple of SPC700 instructions that I can't work exactly out what they + should do. +- Fixed colour and mosaic effects in SNES hi-res. (512x448) modes. +- Offset-per-tile in mode 6. Luckily I haven't found a game that uses it, yet. +- The expansion slot found in many carts. + +What You Will Need +================== + +Windows 95, 98, NT, ME, 2K, or XP with at least DirectX 6 and OpenGL installed +running on a modern, fast (e.g. Pentium 200 or higher) computer with at least +32Mb of RAM. Some games require another CPU to be emulated and/or make heavy use +of colour translucency effects, so an even faster computer may be required to +get an acceptable frame rate. + +If you're running the original version of Windows 95 you will need to download +Microsoft's OpenGL upgrade kit from there web site; they keep moving the exact +location, but last time I looked I found it by using the following method: +http://www.microsoft.com -> support -> Product support options -> +download centre -> keyword search: OpenGL, product: Windows 95; the OpenGL +DLL install package was the first option in the list after pressing Find It! + +If you want SNES sound emulation, you'll need a DirectSound compatible sound +card - virtually all modern PCI sound cards are DirectSound compatible - or +use FMOD's older Windows WAVE sound driver. + +Snes9x's full-screen mode uses DirectDraw to switch to the required resolution +and depth, but if you intend to use the Windowed mode, for maximum emulation +speed you should have your desktop depth set to 256 colours if translucency +emulation and 16-bit rendering are switched off and not required, or hi-colour +mode (32768/65536 colours) if translucency effects are required. + +If you have a Voodoo 3dfx card, Snes9x can use this hardware to stretch and +smooth the relatively lo-resolution SNES image to fill your computer screen. +Newer nvidia cards can do the same trick, just select stretch image option. +There is also an OpenGL display output mode that can stretch and smooth +the SNES image. If your OpenGL hardware supports 16-bit textures (most do), +OpenGL mode is as fast, or faster than Voodoo 3dfx mode. + +Software +-------- +Access to SNES ROM images in *.smc, *.sfc, *.fig or *.1, *.2, or sf32xxxa, +sf32xxxb, etc., format otherwise you will have nothing to run! + +Some home-brewed ROM images can be downloaded from http://www.zophar.com. To +find commercial games, you could try a web search engine and some imaginative +use of search strings. Please note, it is illegal in most countries to have +commercial ROM images without also owning the actual SNES ROM cartridge. + +Getting Started +=============== + +Launch Snes9x from the Windows Start menu if you used the package install +method; alternatively use Windows explorer to locate the directory where you +un-zipped the snes9x.exe and the fmod.dll files and double-click on +the snes9x.exe executable. You could create a shortcut to Snes9x and drag +that icon out onto your desktop. + +Loading Games +------------- +Use the Open option from the File menu to open the ROM load dialog. The dialog +allows you to browse your computer to locate the directory where you have +stored your SNES games. Single-click and then press Load to load and start the +game. + +SNES ROM images come in lots of different formats, depending on the copier +device that was originally used to create the image amongst other things. +Sometimes Snes9x has trouble auto-detecting the exact ROM format. Try playing +around with the values of the combo boxes in the ROM load dialog if the game +doesn't appear to work after its been loaded. In particular, games that use +the Super FX RISC processor seem to be mostly in an odd interleaved format +that Snes9x has trouble auto-detecting; try selecting 'Interleave mode 2' from +the load ROM dialog if you have a Super FX game that isn't working. + +Game colour System +========================== + +Snes9x displays the rom information when a rom is first loaded. Depending on the +colours used you can tell whether or not a rom is a good working rom, or if it's been +altered or is corrupted. + +-White means the rom should be a perfect working copy +-Green means the rom is mode 1 interleaved +-Cyan means the rom is mode 2 interleaved +-yellow means the rom has probably been altered. Either it's a translation, PD rom, hacked, + or possibly a bad rom. It may also be an overdumped ROM. +-red means the rom the rom is definately hacked and that a new version should be found. + some ROM Tools such as NSRT can also fix these ROMs. + +When asking for help on the Snes9x forums, please list the colour and CRC32 that is displayed. +This will help to find out what the problem is. + +SNES Joypad Emulation +--------------------- +On a real SNES, players controlled games using an 8-button digital joy-pad; on +Snes9x you can use your computer's keyboard (the default) or any joystick +or controller device supported by Window's DirectInput. The default key +mapping for joy-pad 1 is: + +'up arrow' Up direction +'down arrow' Down direction +'left arrow' Left direction +'right arrow' Right direction +'a' TL button +'z' TR button +'s' X button +'x' Y button +'d' A button +'c' B button +'return' Start button +'space' Select button + +The real SNES allowed up to five joy-pads to be plugged in at once via a +special adapter, although there are only a few games that actually supported +that many players. Having five people crowd around the keyboard would not be +much fun, and anyway, all keyboards have a limit on the number of keys that +can be pressed simultaneously and still be detected correctly; much better to +use multiple joysticks or NetPlay. + +Keyboard/Joystick Config +------------------------ + +Add support for your joystick and calibrate it using Windows' joystick applet +from the Windows control panel before starting Snes9x, then use Joy-pad +Configuration dialog in Snes9x to customise the keyboard/joystick to SNES +joy-pad mappings. The dialog is easy to use: select which SNES joy-pad you are +configuring using the combo box (#1 to #5), click on the text box next to 'UP' +and then press the key on the keyboard or button on your joystick that you would +like to perform the UP action. The focus will automatically move on to the 'RIGHT' + text box, press the key or joystick button that you want to perform the RIGHT +action, and so on until you've customised all the SNES joy-pad buttons. + +If you're using the keyboard, you might want to also program four keys for +diagonal movement - I'm told it helps with beat-em-up type games. Click on the +each of the blue-coloured diagonal text boxes in turn and press a key on the +keyboard you would like to perform the action. Using the numeric keypad for +direction keys might be useful in this case. + +If you are using a joypad you do NOT UNDER ANY CIRCUMSTANCES SET ANYTHING +FOR DIAGONAL. That is strictly a keyboard issue. + +Alternate Controllers +===================== + +Many users have had trouble getting the alternate controllers such as the +Superscope working correctly. Due to the way these games use the controller +port, some games have issues with them. As Snes9x was designed, it was at one +time necessary to add a hack to disable problem devices. As of Snes9x 1.40, the +devices are unavailable for selection by default. This created a somewhat odd +method of activating the special controllers. Here is how you manage: + +First, select the optional controller you want enabled from the Input menu. +The controller is now selectable by pressing '7'. +Load your game and select the controller using 7. If the game does not pick +up the controller, reset the game. At some point, this will probably be rewritten. +We do not know when this will occur. + + +Additional Keyboard Controls +============================ + +While the emulator is running: +'Escape' Show/hide the menu-bar. +'Pause' Pause the emulator + +Alt+'Return' Toggle between full-screen and windowed mode. + +'`' Superscope turbo button. +'~' Superscope pause button. + +'Tab' Turbo mode (fast forward) - for skipping long intros. + +'0' Toggle H-DMA emulation on/off. +'1' Toggle background 1 on/off. +'2' Toggle background 2 on/off. +'3' Toggle background 3 on/off. +'4' Toggle background 4 on/off. +'5' Toggle sprites on/off +'6' Toggle swapping of joy-pad one and two around +'7' Rotate between Multi-player 5, mouse on port 1, + mouse on port 2 and SuperScope emulation. (need to enable + special controllers in the menu first) +'8' Toggle background layer priorities for backgrounds + involved in sub-screen addition/subtraction. +'9' Toggle transparency effects on and off - only if + 16-bit or higher screen mode selected. +Shift+'9' Toogle mode 7 bi-linear filtering on and off. +'Backspace' Toggle emulation of graphics window effects on/off. + +Shift+'F1-F9 ' Save a freeze game file. +'F1-F9' Load a freeze game file, restoring a game to an + exact position. + + +Shift+'+' Increase emulated frame time by 1ms - slowing down + the game. (auto-frame skip only) +Shift+'-' Decrease emulated frame time by 1ms - speeding up the + game. (auto-frame skip only) + +Shift+'insert' Toggles turbo on the 'L' button. Note: toggles for all controllers +Shift+'delete' Toggles turbo on the 'R' button... +Shift+'[' Toggles turbo on the 'select' button... +Shift+']' +Shift+'home' Toggles turbo on the 'Y' button... +Shift+'pageup' Toggles turbo on the 'X' button... +Shift+'end' Toggles turbo on the 'B' button... +Shift+'pagedown' Toggles turbo on the 'A' button... + + +'+' Increase frame rendering skip rate, making the screen + updates more jerky but speeding up the game. +'-' Decrease frame rendering skip rate, making the game + update more smoothly, but potentially slowing down the + game. Repeatedly pressing the key will eventually + switch to auto-frame skip rate where the rate is + dynamically adjusted to keep a constant game play + speed. + +'F12' Takes a screenshot + +Several of the menu items also have keyboard accelerators; browse the menus +to see what they are. + +Joystick Support +================ + +Configure and calibrate your joystick/joy-pad using Windows joystick applet in +the control panel BEFORE starting Snes9X, then use Snes9X's joy-pad config +dialog available from the Options menu to map your joystick/joy-pad's buttons +to the emulated SNES joy-pad(s) buttons. See 'Keyboard/Joystick Config' above +for details. + +Game Saving +=========== + +Many SNES games could take a very long time to complete from start to finish so +they allowed your progressed to be saved into RAM fitted inside the game pack; +the RAM contents were backed up by a battery when the SNES was switched off or +the game removed. Snes9x simulates this by saving the contents of the emulated +battery-backed RAM into a file when you load a new game or exit Snes9x. The +file is then automatically re-loaded the next time you play the game. + +Snes9x also provides freeze-files; these are files that saves a game's +position at any point in the game, not just at predefined places chosen by +the game's designers - ideal for saving your game just before a tricky bit! +Snes9x provides 9 save slots; during a game, press Shift + F1 to F9 to save a +game, and just F1 to F9 to load it again later. + +Freeze game files and Save-RAM (S-RAM) save files are normally written to and +read from the folder where the ROM image was located, but sometimes this is not +desirable or possible, especially if its a CD-ROM, which is of course +read-only! You can change the folder where Snes9X saves and loads S-RAM and +freeze-files using the Settings Dialog, available from the Options menu. + +Snes9x uses its own unique format for freeze-files, as does ZSNES, but Snes9x +can also load ZSNES format freeze-files. Just copy the ZSNES freeze files into +your save directory and, if the native format Snes9x freeze file doesn't exist +(.00X where X is a digit), Snes9x will try to load the +corresponding ZSNES freeze file instead (.zsX where X is a 't' +or a digit). When you freeze a game position after loading a ZSNES format +freeze file, Snes9x will save it in native Snes9x format. + +Netplay Support +=============== + +This support should currently be considered beta. Netplay support allows +up to five players to sit in front of different computers and simultaneously +play the same game, or just watch someone else play a game. All the computers +have to be connected to a network that allows TCP/IP traffic to flow between +them; this includes a local Ethernet-style network, a modem connection to +another machine, a Windows direct-cable connection, or, if you're lucky and +have short ping times, the Internet. + +Its currently easier if you use Snes9x in windowed mode while using Netplay, +mainly because Netplay currently displays status information in the window's +title bar, and it might be necessary to setup a separate chat application so +you can talk to the other players when deciding what game to play next. + +One machine has to act as a server which other players (client sessions) +connect to. The 'master' player, player 1, uses the server machine; the master +decides what game to play. The server machine should be selected to be the +fastest machine on the fastest connection in the group taking part due to the +extra functions it has to perform. + +Load up a game, then select the 'Act as server' option from the Netplay menu +to become a Netplay server; the 'network', in whatever form it takes, will +need to be initialised, if necessary, before you do this. Then just wait for +other players to connect... + +Clients connect to the server using the 'Connect to server...' dialog, again +available from the Netplay menu. Type in the IP address or host name of the +machine running the Snes9x server session and press OK. The first remote client +to connect will become player 2, and so on. Start Menu->Run->winipcfg will tell +you your current IP address, but note that most dial-up ISPs will allocate you +a new IP address each time you dial in. + +If the server has the 'Send ROM Image to Client' option checked, it will send +the client a copy of the game it is currently playing; don't enable this option +when using a slow network - sending 4Mbytes+ to several clients will takes ages +when using a modem! If the option is not checked the server will request the +client loads up the correct game first before joining the game. + +Once the client has got a copy of the game the server is playing, the server +will then either send it S-RAM data and reset all players' games if the +'Sync Using Reset Game' option is checked, or send it a freeze file to get the +new client in sync with the other player's progress in a game. + +If the master player loads a different game, the server will either +automatically send remote clients a copy, or request that they load the game. +If the master player loads a freeze file, the server will automatically send +that to remote clients as well. + +Client sessions must be able to keep up with the server at all times - if they +can't, either because the machine is just too slow, or its busy, the games +will get out of sync and it will be impossible to successfully play a +multi-player game... + +...To make sure this doesn't happen, don't move the Snes9x window unnecessarily +and don't use Ctlt+Alt+Del to display the task manager while playing. Also stop +any unnecessary applications and as many background tasks as possible. Even +something as simple as a text editor might periodically write unsaved data to +the disk, stealing CPU time away from Snes9x causing it to skip a frame or +delay a sound effect; not a problem for most games, but the Bomberman series +(the best multi-player games on the SNES) sync the game to sound samples +finishing. Turning off 'Volume envelope height reading' from the Sound Options +dialog might help with this problem. + +Cheat Support +============= + +Use the Cheat Code Entry and Editor dialog from the Cheats menu to enter +Game Genie or Pro-Action Reply cheat codes. Cheat codes allow you to, +surprisingly, cheat at games; they might give you more lives, infinite health, +enable special powers normally only activated when a special item is found, +etc. + +Many existing Game Genie and Pro-Action Reply codes can be found at: +http://vgstrategies.about.com/library/ggn/bl_ggnsnes.htm?once=true& + +Type in a Game Genie or Pro-Action Reply code into the "Enter Cheat Code" text +edit box and press . Be sure to include the '-' when typing in a Game +Genie code. You can then type in an optional short description as a reminder +to yourself what function the cheat performs. Press again or click the +Add button to add the cheat to the list. + +Note that the Add button remains insensitive while "Enter Cheat Code" text +edit box is empty or contains an invalid code. The cheat code is always +translated into an address and value pair and displayed in the cheat list as +such. + +Beware of cheat codes designed for a ROM from a different region compared to +the one you are playing or for a different version of the ROM; the source of +the cheats should tell you which region and for which version of the game they +were designed for. If you use a code designed for a different region or version +of your game, the game might crash or do other weird things. + +It is also possible to enter cheats as an address and value pair; some users +have requested this functionality. Type in the address into the "Address" +text edit box then type the value into the "Value" text edit box. The value is +normally entered in decimal, but if you prefix the value with a '$' or append +a 'h' then you can enter the value in hex. + +Double-clicking on an cheat line from the list in the dialog or clicking on +the "En" column, toggles a individual cheat on and off. All cheats can be +switched on and off by checking and unchecking the "Apply cheats" item from +the Cheat menu. + +Selecting a cheat from the list causes its details to be filled into the text +edit boxes in the dialog box; the details can then be edited and the Change +button pressed to commit the edits. Note that the "Enter Cheat Code" text edit +box always redisplays the cheat code as a Pro-Action Replay code regardless of +whether you originally entered it as a Game Genie or Pro-Action Replay code. + +Selecting a cheat from the list then pressing the Delete button permanently +removes that cheat. + +Cheats are saved in .cht files stored in the Freeze File Directory and are +automatically loaded the next time a game with the same filename is loaded. +The format for the .cht files is the same format as used by the other excellent +SNES emulator, ZSNES. + +Snes9X also allows new cheats to be found using the Search for New Cheats +dialog, again available from the Cheats menu. The easiest way to describe the +dialog is to walk through an example. + +Cheat Search Example +-------------------- +Lets give ourselves infinite health and lives on Ocean's Addams Family +platform game: + +Load up the game, keep pressing the start button (Return key by default) to +skip past the title screens until you actually start playing the game. You'll +notice the game starts with 2 health hearts and 5 lives. Remember that +information, it will come in useful later. + +Launch the cheat search dialog for the first time, Alt+A is its accelerator. +Press the Reset button just in case you've used the dialog before, leave the +Search Type and Data Size radio boxes at their default values and press OK. + +Play the game for a while until you loose a life by just keep walking into +baddies, when the game restarts and the life counter displays 4, launch the +cheat search dialog again but this time press the Search button rather than +Reset. The number of items in the list will reduce, each line shows a memory +location, its current value and its previous value; what we're looking for is +the memory location where the game stores its life counter. + +Look at address line 7E00AC, its current value is 4 and its previous value was +5. Didn't we start with 5 lives? Looks interesting... + +Note that some games store the current life counter as displayed on the screen, +while others store current number of lives minus 1. Looks like Addams Family +stores the actual life count as displayed on the screen. + +Just to make sure you've found the correct location, press OK on the dialog, +and play the game until you loose another life. Launch the search dialog again +after the life counter on screen has been updated and press the Search +button. Now there's even fewer items in the list, but 7E00AC is there again, +this time the current value is 3 and the previous value was 4. Looks very much +like we've found the correct location. + +Now that we're happy we've found the correct location, click on the 7E00AC +address line in the list and then press the Add Cheat button. Another dialog, +Cheat Details, will be displayed. Type in a new value of say 5, this will be +number of lives that will be displayed by the lives counter. Don't be greedy; +some games display a junk life counter or might even crash if you enter a +value that's too high; Snes9X keeps the value constant anyway, so even if you +do loose a life and life counter goes down by one, less than 20ms later, +Snes9X resets the counter back to the value you chose! + +If the memory location you add a cheat on proves to be wrong, just go to the +Cheat Code Editor dialog and delete the incorrect entry. + +Now lets try and find the Addams Family health counter. While two hearts are +displayed on the screen, visit the cheat search dialog and press the Reset +button followed by OK. Play the game until you loose a heart by touching a +baddie, then visit the cheat search dialog again. + +Press the Search button to update the list with all memory locations that have +gone down in value since the last dialog visit. We're going to have to try and +find the heart memory location now because there were only two hearts to start +with. + +Look at address line 7E00C3, its current value is 1 and its previous value was +2. Scrolling through the list doesn't reveal any other likely memory locations, +so lets try our luck. Click on the 7E00C3 line, press the Add Cheat button and +type in a new value of say 4 into the dialog that appears and press OK. Press +OK on the Search for New Cheats dialog to return to the game. + +At first sight it looks like 7E00C3 wasn't the correct memory location because +the number of hearts displayed on screen hasn't gone up, but fear not, some +games don't continually update health and life displays until they think they +need to. Crash into another baddie - instead of dying, the number of hearts +displayed jumps up to 4! We've found the correct location after all! + +Now every time you play Addams Family you'll have infinite lives and health. +Have fun finding cheats for other games. + +Super FX +======== +The Super FX is a 10.5/21MHz RISC CPU developed by Argonaut Software used as a +game enhancer by several game tiles. Support is still a little buggy but most +games work very well, if a little slowly. Released SNES Super FX games included +Yoshi's Island (best single-player game on SNES, if you like platform games), +Doom, Winter Gold, Dirt Trax FX, StarFox, Stunt Race FX and Vortex. If you're +lucky, you might find a copy of the unreleased Starfox 2 image floating around, +but its sound code is corrupt and you'll need to disable sound CPU emulation to +play it. (NOTE: A new version of Starfox 2 was recently released that is closer to +being a complete rom. It is mostly playable in the emulator but due to it being an +incomplete game it does have many errors. This is not the fault of the emulator) + +Lots of Super FX ROM images available are in an odd, interleaved format that I +haven't worked out an easy way to auto-detect. If Snes9x detects that a +Super FX game crashes (by executing a BRK instruction), it automatically +assumes the ROM is in this odd format and de-mangles the ROM and tries to run +it again. If your ROM image isn't working, you could try selecting the +Interleave mode 2 option on the ROM load dialog before loading the game to help +out Snes9x. + +S-DD1 and SPC7110 +===== +The S-DD1 is a custom data decompression chip that can decompress data in real- +time as the SNES DMA's data from the ROM to RAM. Only two games are known to +use the chip: Star Ocean and Street Fighter Alpha 2. + +SPC7110 is a compression and memory mapping chip. it provides a few extra features, +as well. It functions as an RTC interface, and has a multiply/divide unit that has more +precision than the SNES.The SPC7110 is found only in 4 games: Super Power League +4, Far East of Eden Zero, Far East of Eden Zero - Shounen Jump no Shou, and +Momotaro Densetsu Happy. + +These chips use some unknown compression algorithms, so to actually support the +games using these, pre-decompressed graphics packs must be downloaded from +http://www.dejap.com, unpacked, and the resultant folder can be selected from the +Snes9x options -> GFX Pack Configuration. As of Snes9x 1.42, the S-DD1 can be used +without the graphics packs. + +To use the graphics packs for the S-DD1, as of 1.42, you MUST tell Snes9x where the +pack is located. If you do not, it will use on-the-fly decompression. On the other hand, +to use on-the-fly decompression, make sure the game's pack entry is blank. + +The SPC7110 still uses packs at all times, and if no pack is defined, it will search the +locations just like ZSNES. + +SA-1 +==== +The SA-1 is a fast, custom 65c816 8/16-bit processor, the same as inside the +SNES itself, but clocked at 10MHz compared to a maximum of 3.58MHz for the CPU +inside the SNES. + +The SA-1 isn't just a CPU, it also contains some extra circuits developed by +Nintendo which includes some very fast RAM, a memory mapper, DMA and, several +real-time timers. + +Snes9X includes emulation of most features of the SA-1, enough to play all SA-1 +games I've located so far, these include Mario RPG, Kirby Superstar and +Parodius 3. + +C4 +== + +The C4 is custom Capcom chip used only in the Megaman X2 and Megaman X3 games. +It can scale and rotate images, draw line-vector objects and do some simple +maths to rotate them. + +Snes9x's C4 emulation is a direct copy of the ZSNES C4 emulation; Intel-based +ports even make use of ZSNES code. Without zsKnight's hard work, Snes9x would +not have C4 emulation. Many thanks go to him. + + +Problems With ROMs +================== + +If the emulator just displays a black screen for over 10 seconds after you've +loaded a ROM image, then one of the following could be true: + +1) You just loaded some random ROM image you've downloaded from the Internet + and it isn't even a SNES game or you only downloaded part of the image. + Snes9x only emulates games designed for the Super NES, not NES, or + Master System, or Game Boy, or . +2) If its a Super FX game, chances are its in interleaved2 format, try + switching to "Interleaved mode 2" on the ROM load dialog before loading the + game. +3) Someone has edited the Nintendo ROM information area inside the ROM image + and Snes9x can't work out what format ROM image is in. Try playing + around with the ROM format options on the ROM load dialog. +4) The ROM image is corrupt. If you're loading from CD, I know it might + sound silly, but is the CD dirty? Clean, un-hacked ROM images will display + [checksum ok] when first loaded, corrupt or hacked ROMs display + [bad checksum]. +5) The original SNES ROM cartridge had additional hardware inside that is not + emulated yet and might never be. +6) You might be using a file that is compressed in a way Snes9x does not understand. + +The following ROMs are known to currently not to work with any version of Snes9x: +- All games that use later versions of the DSP-1 (besides DSP-2) chip (e.g. SD Gundam GX, + Topgear 3000) +- Exhaust Heat2/F1 ROC II (custom co-processor) +- A pair of Shogi games released by Seta, which also use custom coprocessors + +Sound Problems +============== + +No sound coming from any SNES game using Snes9x? Could be any or all of +these: + +- If all sound menu options are greyed out, or an error dialog about Snes9x not + being able to initialise DirectSound is displayed - then DirectSound could + not initialise itself. Make sure DirectX 6 or above is installed and your + sound card is supported by DirectX. + + Installing the latest drivers for your sound card might help. Another + Windows application might have opened DirectSound in exclusive mode or + opened the Windows WAVE device - WinAmp uses the Windows WAVE device by + default - in which case you will need to stop that application and then + restart Snes9x. It is possible to switch WinAmp to use DirectSound, in + which case both Snes9x and WinAmp output can be heard at the same time. + + If your sound card isn't supported by DirectX very well (or not at all) you + will have to use FMOD's WAVE output option; but WAVE output introduces a + 0.15s delay between Snes9x generating sample data and you hearing it. + Select FMOD's WAVE output by choosing the "FMOD Windows Multimedia" sound + driver option from the Sound Settings dialog. + +- The sound card's volume level might be set too low. Snes9x doesn't alter the + card's master volume level so you might need to adjust it using the sound + card's mixer/volume controls usually available from the task bar or start + menu. +- Make sure your speakers and turned on, plugged in and the volume controls are + set to a suitable level. +- You've turned off sound CPU emulation, clicked the Mute button in the + sound settings dialog, or set the playback rate to "". + +General sound problems: +- A continuous, crackling sound or buzz can be heard. + + First make sure it is happening in all games - Snes9x still does have one or + two sound emulation bugs that cause the odd pop, crackle and buzz in a few + games. + + Once you're happy that it is not just the game you're playing, set the + playback rate in the Sound Settings dialog to 22KHz, and uncheck "Stereo" and + "16bit playback". Next set both sound buffer length and mix values to 10ms, + then try slowly increasing both values until clear sound can be heard. The + ideal is that the mix interval and sound buffer length values should be as + small as possible. The mix interval value must always be smaller than the + sound buffer length otherwise sound data will be lost. + + If your sound card requires larger values, above, say, 40ms, then it might + also be necessary to enable the "Generate sample data in sync with sound CPU" + option to maintain accurate sound emulation. + + If all else fails, try selecting the "FMOD Window Multimedia" sound driver + option and live with the 0.15s lagged sound that is unavoidable when using + the older Windows WAVE sound API. + + Once you have clear sound, set the playback rate, 16bit sound and stereo + settings to quality you would like - it might be necessary to tweak the + sound buffer length and mix interval values again. + +- Sound the lagged/delayed compared to on-screen action. If you're using the + "FMOD Windows Multimedia" sound driver then delayed sound is unavoidable; + otherwise your sound buffer length/mix interval settings are too large - if + you can, reduce their values. +- Sound quality is poor on all games. You might have a noisy sound card + (usually cheaper sound cards), turning on 16-bit, interpolated sound, + sync-sound and/or increasing the playback rate might help. +- Sound seems to have gaps. Using larger sound buffer or mix interval values + can cause this; reduce them if you can, or click on the "Generate sample data + in sync with sound CPU" option. +- Sound is awful in all games. You might have selected a playback rate/stereo/ + 8-bit/16-bit combination that your sound card can't cope with. Try setting + 8-bit (uncheck the 16bit playback option), mono (uncheck the Stereo option) + 22KHz from the sound menu and if that cures the problem, try other + combinations until you find the best setting that works on your sound card. + +If all else fails, try posting a message describing your problem and +requesting help on the Snes9X message board at the Snes9X web site, +http://www.snes9x.com/ + +Converting ROM Images +===================== + +If you have a ROM image in several pieces, simply rename them so their +filename extensions are numbered: e.g. game.1, game.2, etc. Then, when +loading the ROM image, just specify the name of the first part; the remaining +parts will be loaded automatically. + +If they are already in the form sf32xxxa, sf32xxxb, etc., you don't even have +to rename them; just choose the name of the first part from the ROM load +dialog, as above. + +Emulation speed +=============== + +Emulating an SNES is very processor intensive, with its two or sometimes three +CPUs, an 8 channel digital sound processor with real-time sound sample +decompression and stereo sound, two custom graphics processors, etc. + +If you only have a 486 machine, you will need to stick to using only 8-bit +graphics and minimal or no sound. Disabling the joystick support will also +help. + +Full-screen mode is generally faster than windowed mode. + +Enabling one of the output image processing modes from the Display Config +dialog can slow down overall emulation speed greatly depending on the type of +game and video RAM speed. Enabling the stretch image option further reduces +emulation speed. + +If you want the SNES image to fill your computer screen and want maximum speed, +use the 3dfx bi-linear option if you have a Voodoo 3dfx card, or select output +image mode as none and check the full-screen and stretch image options. + +Lowering the sound playback rate, selecting 8-bit mono sound or turning off +interpolated or sync-sound modes, or turning off sound CPU emulation altogether +will also help boost emulation speed. + +Credits +------- + +- Jerremy Koot for all his hard work on previous versions of Snes96, Snes97 + and Snes9x. +- Ivar for the original Super FX C emulation, DSP-1 emulation work and + information on both chips. +- zsKnight and _Demo_ for the Intel Super FX assembler, DSP-1 and C4 emulation + code. +- zsKnight and _Demo_ for all the other ideas and code I've nicked off them; + they've nicked lots of my ideas and information too! +- John Weidman and Darkforce for the S-RTC emulation information and code. +- Kreed for his excellent image enhancer routines. +- Nose000 for code changes to support various Japanese SNES games. +- Neill Corlett for the IPS patching support code. +- DiskDude's SNES Kart v1.6 document for the Game Genie(TM) and Pro-Action + Replay cheat system information. +- Lord ESNES for some nice chats and generally useful stuff. +- Lee Hyde (lee@jlp1.demon.co.uk) for his quest for sound information and + the Windows 95 icon. +- Shawn Hargreaves for the rather good Allegro 3.0 DOS library. +- Robert Grubbs for the SideWinder information - although I didn't use his + actual driver in the end. +- Steve Snake for his insights into SNES sound sample decompression. +- Vojtech Pavlik for the Linux joystick driver patches. +- Maciej Babinski for the basics of Linux's DGA X server extensions. +- Alexander Larsson for the GGI Linux port code. +- Harald Fielker for the original sound interpolation code (never used directly + due to problems). +- Takehiro TOMINAGA for many speed up suggestions and bug fixes. +- Predicador for the Windows icon. +- Lindsey Dubb for the mode 7 bi-linear filter code and the improved + colour addition and subtraction code. +- Anti Resonance for his super-human efforts to help get his fast sound CPU + core and sound DSP core working in Snes9x. +- pagefault, TRAC, Dark Force, and others who have donated ideas and/or code + to the project. + +Nintendo is a trademark. +Super NES, SuperScope and Super FX are a trademarks of Nintendo. +Sun, Solaris and Sparc are all trademarks of Sun Microsystems, Inc. +Game Genie is a trademark of Lewis Galoob Toys, Inc. +MS-DOS and Windows 95 are trademarks of Microsoft Corp. +Intel, Pentium and MMX are all trademarks of Intel Corp. +Sony is a trademark of Sony Corp. +UNIX is a registered trademark of X/Open. +Glide is a trademark of 3Dfx Interactive, inc. +Linux is a registred trademark of Linus Torvalds. + +------------------------------------------------------------------------------ +Gary Henderson +gary@snes9x.com + +Updated most recently by: Matthew Kendora \ No newline at end of file diff -NaHudr snes9x-1.43-src/readme.unix snx/readme.unix --- snes9x-1.43-src/readme.unix 2004-12-31 00:15:55.000000000 +0200 +++ snx/readme.unix 2005-03-20 23:46:32.000000000 +0200 @@ -406,9 +406,6 @@ Turn off joystick, SideWinder and GrIP detection (joystick polling on the PC slows the emulator down). - -version - Print the Snes9X version and the exit. - For example, to start a game called "mario", with sound, and transparency effects, type: @@ -504,17 +501,17 @@ 6. Joystick Support - The Linux port makes use of the v1.x joystick kernel drivers - written by Vojtech Pavlik (vojtech@ucw.cz) to allow the use of a - wide variety of different joystick/joypad types to control SNES - games. + The Linux port makes use of the v1.x joystick kernel drivers + written by Vojtech Pavlik (vojtech@ucw.cz) to allow the use of a + wide variety of different joystick/joypad types to control SNES + games. - If you are still using the older versions of the drivers, you can - download the latest driver version from - http://atrey.karlin.mff.cuni.cz/~vojtech/joystick/ + If you are still using the older versions of the drivers, you can + download the latest driver version from + http://atrey.karlin.mff.cuni.cz/~vojtech/joystick/ - Refer to the documentation that comes with the drivers to enable - support for your type of joystick/pad in Snes9x. + Refer to the documentation that comes with the drivers to enable + support for your type of joystick/pad in Snes9x. 7. Game Saving diff -NaHudr snes9x-1.43-src/render.cpp snx/render.cpp --- snes9x-1.43-src/render.cpp 2004-12-31 00:15:55.000000000 +0200 +++ snx/render.cpp 2005-04-09 00:59:23.000000000 +0300 @@ -244,7 +244,7 @@ rect->left = (Dst.Width - Src.Width) >> 1; rect->right = rect->left + Src.Width; rect->top = (Dst.Height - Src.Height) >> 1; - rect->bottom = rect->top + Src.Height; + rect->bottom = rect->top + Src.Height - (Settings.HeightExtend?0:15); lpDst = Dst.Surface; lpDst += rect->top * Dst.Pitch + rect->left; @@ -268,7 +268,7 @@ rect->left = (Dst.Width - 512) >> 1; rect->right = rect->left + 512; rect->top = (Dst.Height - Src.Height * 2) >> 1; - rect->bottom = rect->top + Src.Height * 2; + rect->bottom = rect->top + Src.Height * 2 - (Settings.HeightExtend?0:30); lpSrc = Src.Surface; lpDst = Dst.Surface; @@ -314,7 +314,7 @@ rect->left = (Dst.Width - Src.Width) >> 1; rect->right = rect->left + Src.Width; rect->top = (Dst.Height - Src.Height) >> 1; - rect->bottom = rect->top + Src.Height; + rect->bottom = rect->top + Src.Height - (Settings.HeightExtend?16:0); lpSrc = Src.Surface; lpDst = Dst.Surface; @@ -341,7 +341,7 @@ rect->left = (Dst.Width - Src.Width * 2) >> 1; rect->right = rect->left + Src.Width * 2; rect->top = (Dst.Height - Src.Height * 2) >> 1; - rect->bottom = rect->top + Src.Height * 2; + rect->bottom = rect->top + Src.Height * 2 - (Settings.HeightExtend?0:30); lpSrc = Src.Surface; lpDst = Dst.Surface; @@ -418,7 +418,7 @@ rect->left = (Dst.Width - Src.Width * 2) >> 1; rect->right = rect->left + Src.Width * 2; rect->top = (Dst.Height - Src.Height * 2) >> 1; - rect->bottom = rect->top + Src.Height * 2; + rect->bottom = rect->top + Src.Height * 2 - (Settings.HeightExtend?0:32); lpSrc = Src.Surface; lpDst = Dst.Surface; @@ -455,7 +455,7 @@ rect->left = (Dst.Width - Src.Width * 2) >> 1; rect->right = rect->left + Src.Width * 2; rect->top = (Dst.Height - Src.Height * 2) >> 1; - rect->bottom = rect->top + Src.Height * 2; + rect->bottom = rect->top + Src.Height * 2 - (Settings.HeightExtend?0:32); lpSrc = Src.Surface; lpDst = Dst.Surface; @@ -491,7 +491,7 @@ rect->left = (Dst.Width - Src.Width * 2) >> 1; rect->right = rect->left + Src.Width * 2; rect->top = (Dst.Height - Src.Height * 2) >> 1; - rect->bottom = rect->top + Src.Height * 2; + rect->bottom = rect->top + Src.Height * 2 - (Settings.HeightExtend?0:32); lpSrc = Src.Surface; lpDst = Dst.Surface; @@ -528,7 +528,7 @@ rect->left = (Dst.Width - 512) >> 1; rect->right = rect->left + 512; rect->top = (Dst.Height - height * 2) >> 1; - rect->bottom = rect->top + height * 2; + rect->bottom = rect->top + height * 2 - (Settings.HeightExtend?0:30); dstPtr += rect->top * Dst.Pitch + rect->left * 2; nextLine = dstPtr + dstPitch; @@ -1208,11 +1208,43 @@ RECT r; GetClientRect (GUI.hWnd, &r); - + + OffsetRect(&r, -r.left, -r.top); + + if(Settings.AspectRatio) + { + int width = r.right - r.left; + int height = r.bottom - r.top; + + int oldWidth = SNES_WIDTH; + int oldHeight = Settings.HeightExtend ? SNES_HEIGHT_EXTENDED : SNES_HEIGHT; + int newWidth, newHeight; + + if(oldWidth * height > oldHeight * width) + { + newWidth = oldWidth*width/oldWidth; + newHeight = oldHeight*width/oldWidth; + } + else + { + newWidth = oldWidth*height/oldHeight; + newHeight = oldHeight*height/oldHeight; + } + int xOffset = (width - newWidth)/2; + int yOffset = (height - newHeight)/2; + + r.right = r.left + newWidth; + r.bottom = r.top + newHeight; + + OffsetRect(&r, xOffset, yOffset); + } + width = r.right - r.left; height = r.bottom - r.top; - glViewport (0, 0, width, height); + glViewport (r.left, r.top, width, height); + +/// glViewport (r.left, r.top, r.right, r.bottom); glMatrixMode (GL_PROJECTION); glLoadIdentity (); @@ -1233,7 +1265,8 @@ else texture_size = OpenGL.texture_size; - uint32 pheight = Src.Height % texture_size; + uint32 srcheight = Src.Height - (Settings.HeightExtend?0:15); + uint32 pheight = (srcheight) % texture_size; if (pheight == 0) pheight = texture_size; @@ -1244,8 +1277,13 @@ zrot += 0.4f; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); } + else + { + if(Settings.AspectRatio /*|| !GUI.Stretch*/) + glClear(GL_COLOR_BUFFER_BIT); + } - for (int starty = Src.Height - pheight; starty >= 0; + for (int starty = (srcheight) - pheight; starty >= 0; startl += pheight, pheight = texture_size, starty -= texture_size) { for (int startx = 0; startx < (int) swidth; startx += texture_size) @@ -1255,9 +1293,9 @@ pwidth = texture_size; float fx1 = (float) startx / Src.Width; - float fy1 = (float) starty / Src.Height; + float fy1 = (float) starty / (srcheight); float fx2 = fx1 + (float) pwidth / Src.Width; - float fy2 = fy1 + (float) (pheight+1) / Src.Height; + float fy2 = fy1 + (float) (pheight+1) / (srcheight); if (!OpenGL.packed_pixels_extension_present) { diff -NaHudr snes9x-1.43-src/resource.h snx/resource.h --- snes9x-1.43-src/resource.h 2004-12-31 00:15:55.000000000 +0200 +++ snx/resource.h 2005-04-09 00:59:23.000000000 +0300 @@ -1,393 +1,472 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by 0snes9X.rc -// -#define IDR_MENU_US 101 -#define IDC_CURSOR_SCOPE 101 -#define IDD_SPC7110_CACHE 101 -#define IDI_ICON1 101 -#define IDR_MENU_NL 102 -#define IDC_CURSOR_BLANK 102 -#define IDD_SOUND_OPTS 102 -#define IDR_SNES9X_ACCELERATORS 103 -#define IDD_7110_RTC 103 -#define IDD_ROM_INFO 104 -#define IDD_ABOUT 105 -#define IDD_EMU_SETTINGS 106 -#define IDD_OPEN_ROM 107 -#define IDD_GFX_PACK 108 -#define IDD_NETCONNECT 109 -#define IDD_NPOPTIONS 110 -#define IDB_OPENFOLDER 111 -#define IDD_CHEATER 111 -#define IDB_CLOSEDFOLDER 112 -#define IDB_CDDRIVE 113 -#define IDB_NETDRIVE 114 -#define IDB_HARDDRIVE 115 -#define IDD_NEWDISPLAY 123 -#define IDD_NETPLAYPROGRESS 124 -#define IDD_INPUTCONFIG 125 -#define IDB_JOYPAD 127 -#define IDD_CHEAT_SEARCH 129 -#define IDD_DIALOG1 130 -#define IDD_CHEAT_FROM_SEARCH 131 -#define IDB_PAD 133 -#define IDD_OPENMOVIE 134 -#define IDD_CREATEMOVIE 135 -#define IDC_DRIVER 1001 -#define IDC_BUFLEN 1002 -#define IDC_RATE 1003 -#define IDC_MIX 1004 -#define IDC_16BIT 1005 -#define IDC_STEREO 1006 -#define IDC_REV_STEREO 1007 -#define IDC_LINEAR_INTER 1008 -#define IDC_SYNC_TO_SOUND_CPU 1009 -#define IDC_ENVX 1010 -#define IDC_ECHO 1011 -#define IDC_CACHING 1012 -#define IDC_MASTER_VOL 1013 -#define IDC_SPC700ON 1014 -#define IDC_ANTIRES 1015 -#define IDC_MUTE 1016 -#define IDC_SKIP_TYPE 1017 -#define IDC_SCROLLBAR1 1018 -#define IDC_VRAM_DISPLAY 1019 -#define IDC_ADDRESS 1020 -#define IDC_SPC7110_ALL 1021 -#define IDC_SPC7110_SOME 1022 -#define IDC_SPC7110_FILE 1023 -#define IDC_RTC_D8 1024 -#define IDC_RTC_D4 1025 -#define IDC_RTC_D2 1026 -#define IDC_RTC_D1 1027 -#define IDC_RTC_E8 1028 -#define IDC_RTC_E4 1029 -#define IDC_RTC_E2 1030 -#define IDC_RTC_E1 1031 -#define IDC_RTC_F8 1032 -#define IDC_RTC_F4 1033 -#define IDC_RTC_F2 1034 -#define IDC_RTC_F1 1035 -#define IDC_DAY 1036 -#define IDC_YEAR 1037 -#define IDC_MONTH 1038 -#define IDC_HOUR 1039 -#define IDC_MINUTE 1040 -#define IDC_SECOND 1041 -#define IDC_LBLMONTH 1042 -#define IDC_LBLYEAR 1043 -#define IDC_LBLDAY 1044 -#define IDC_LBLHOUR 1045 -#define IDC_LBLMINUTE 1046 -#define IDC_LBLSECOND 1047 -#define IDC_CACHE_MB 1048 -#define IDC_SPIN_CACHE 1049 -#define IDC_ROM_DATA 1051 -#define IDC_WARNINGS 1052 -#define IDC_DISCLAIMER 1053 -#define IDC_FREEZE_FOLDER 1054 -#define IDC_BROWSE 1055 -#define IDC_CANCEL 1056 -#define IDC_AUTO_SAVE_DELAY 1057 -#define IDC_MAX_SKIP 1058 -#define IDC_TURBO_SKIP 1059 -#define IDC_TOGGLE_TURBO 1060 -#define IDC_SRAM_SPIN 1061 -#define IDC_SPIN_MAX_SKIP 1062 -#define IDC_SPIN_TURBO_SKIP 1063 -#define IDC_ROM_DIR 1064 -#define IDC_INTERLEAVE 1065 -#define IDC_VIDEO_MODE 1066 -#define IDC_HEADER 1067 -#define IDC_ROMLIST 1068 -#define IDC_MEM_TYPE 1069 -#define IDC_STAR_OCEAN 1070 -#define IDC_SO_BROWSE 1071 -#define IDC_FEOEZ 1072 -#define IDC_FEOEZ_BROWSE 1073 -#define IDC_MDH 1074 -#define IDC_MDH_BROWSE 1075 -#define IDC_SPL4 1076 -#define IDC_SPL4_BROWSE 1077 -#define IDC_SJNS 1078 -#define IDC_FEOEZ_SJNS_BROWSE 1079 -#define IDC_SFA2 1080 -#define IDC_SFA2_BROWSE 1081 -#define IDC_SFA2E 1082 -#define IDC_SFA2E_BROWSE 1083 -#define IDC_SFZ2 1084 -#define IDC_SFZ2_BROWSE 1085 -#define IDC_HOSTNAME 1086 -#define IDC_PORTNUMBER 1087 -#define IDC_CLEARHISTORY 1088 -#define IDC_STATIC2 1089 -#define IDC_EDIT1 1090 -#define IDC_UP 1090 -#define IDC_VALUE_ENTER 1090 -#define IDC_MOVIE_METADATA 1090 -#define IDC_PAUSEINTERVAL 1091 -#define IDC_UPRIGHT 1091 -#define IDC_MAXSKIP 1092 -#define IDC_PAUSESPIN 1093 -#define IDC_DWNRIGHT 1093 -#define IDC_SYNCBYRESET 1094 -#define IDC_DOWN 1094 -#define IDC_SENDROM 1095 -#define IDC_DWNLEFT 1095 -#define IDC_ACTASSERVER 1096 -#define IDC_LEFT 1096 -#define IDC_MAXSPIN 1097 -#define IDC_UPLEFT 1097 -#define IDC_SELECT 1098 -#define IDC_PORTNUMBERA 1099 -#define IDC_START 1099 -#define IDC_TESTMODE 1100 -#define IDC_L 1100 -#define IDC_VIDEOLIST 1101 -#define IDC_R 1101 -#define IDC_SELECT2 1101 -#define IDC_VIDMODELIST 1102 -#define IDC_Y 1102 -#define IDC_SETDMODE 1103 -#define IDC_B 1103 -#define IDC_A 1104 -#define IDC_X 1105 -#define IDC_RIGHT 1106 -#define IDC_SHOWFPS 1108 -#define IDC_STRETCH 1109 -#define IDC_FULLSCREEN 1110 -#define IDC_BILINEARMD7 1111 -#define IDC_RENDER16BIT 1112 -#define IDC_TRANS 1113 -#define IDC_HIRES 1114 -#define IDC_CHEAT_CODE 1115 -#define IDC_FILTERBOX 1116 -#define IDC_AUTOFRAME 1117 -#define IDC_LIMITFRAMES 1118 -#define IDC_FRAMERATESKIPSLIDER 1120 -#define IDC_TOGGLE 1121 -#define IDC_DBLBUFFER 1122 -#define IDC_CURRMODE 1123 -#define IDC_DELETE_CHEAT 1124 -#define IDC_NPPROGRESS 1124 -#define IDC_VIDEOCARD 1124 -#define IDC_UPDATE_CHEAT 1125 -#define IDC_JPCOMBO 1125 -#define IDC_CLEAR_CHEATS 1126 -#define IDC_JPTOGGLE 1126 -#define IDC_CHEAT_DESCRIPTION 1127 -#define IDC_KEYBOARD 1127 -#define IDC_CHEAT_ADDRESS 1128 -#define IDC_CHEAT_BYTE 1129 -#define IDC_ADD_CHEAT 1130 -#define IDC_CHEAT_LIST 1131 -#define IDC_PICTURE 1132 -#define IDC_ADDYS 1133 -#define IDC_OK 1134 -#define IDC_C_SEARCH 1134 -#define IDC_RED 1135 -#define IDC_C_ADD 1135 -#define IDC_BLUE 1136 -#define IDC_C_RESET 1136 -#define IDC_LABEL_BLUE 1136 -#define IDC_1_BYTE 1137 -#define IDC_2_BYTE 1138 -#define IDC_3_BYTE 1139 -#define IDC_4_BYTE 1140 -#define IDC_LESS_THAN 1141 -#define IDC_GREATER_THAN 1142 -#define IDC_LESS_THAN_EQUAL 1143 -#define IDC_GREATER_THAN_EQUAL 1144 -#define IDC_EQUAL 1145 -#define IDC_NOT_EQUAL 1146 -#define IDC_PREV 1147 -#define IDC_ENTERED 1148 -#define IDC_UNSIGNED 1149 -#define IDC_SIGNED 1150 -#define IDC_HEX 1151 -#define IDC_ENTER_LABEL 1152 -#define IDC_DIAGTOGGLE 1153 -#define IDC_UNDO 1154 -#define IDC_COMBO1 1155 -#define IDC_NC_ADDRESS 1156 -#define IDC_NC_CURRVAL 1157 -#define IDC_NC_PREVVAL 1158 -#define IDC_NC_NEWVAL 1159 -#define IDC_NC_DESC 1160 -#define IDC_LABEL_UP 1161 -#define IDC_LABEL_LEFT 1162 -#define IDC_LABEL_DOWN 1163 -#define IDC_LABEL_RIGHT 1164 -#define IDC_LABEL_B 1165 -#define IDC_LABEL_A 1166 -#define IDC_LABEL_Y 1167 -#define IDC_LABEL_X 1168 -#define IDC_LABEL_START 1169 -#define IDC_LABEL_SELECT 1170 -#define IDC_LABEL_L 1171 -#define IDC_LABEL_R 1172 -#define IDC_LABEL_UPLEFT 1173 -#define IDC_LABEL_UPRIGHT 1174 -#define IDC_LABEL_DOWNRIGHT 1175 -#define IDC_LABEL_DOWNLEFT 1176 -#define IDC_LABEL_FREEZE 1177 -#define IDC_LABEL_ASRAM 1178 -#define IDC_LABEL_SMAX 1179 -#define IDC_LABEL_STURBO 1180 -#define IDC_LABEL_ASRAM_TEXT 1181 -#define IDC_LABEL_SMAX_TEXT 1182 -#define IDC_LABEL_STURBO_TEXT 1183 -#define IDC_PORTNUMBLOCK 1184 -#define IDC_CLIENTSETTINGSBLOCK 1185 -#define IDC_SERVERSETTINGSBLOCK 1186 -#define IDC_LABEL_PORTNUM 1187 -#define IDC_LABEL_PAUSEINTERVAL 1188 -#define IDC_LABEL_PAUSEINTERVAL_TEXT 1189 -#define IDC_LABEL_MAXSKIP 1190 -#define IDC_LABEL_CHEAT_CODE 1191 -#define IDC_LABEL_CHEAT_DESCRIPTION 1192 -#define IDC_LABEL_CHEAT_ADDRESS 1193 -#define IDC_LABEL_CHEAT_BYTE 1194 -#define IDC_LABEL_SERVERADDY 1195 -#define IDC_RECORD_NOW 1201 -#define IDC_RECORD_RESET 1202 -#define IDC_JOY1 1203 -#define IDC_JOY2 1204 -#define IDC_JOY3 1205 -#define IDC_JOY4 1206 -#define IDC_JOY5 1207 -#define IDC_MOVIE_PATH 1208 -#define IDC_BROWSE_MOVIE 1209 -#define IDC_MOVIE_DATE 1210 -#define IDC_MOVIE_LENGTH 1211 -#define IDC_MOVIE_FRAMES 1212 -#define IDC_MOVIE_RERECORD 1213 -#define IDC_READONLY 1218 -#define ID_FILE_EXIT 40001 -#define ID_LANGUAGE_ENGLISH 40002 -#define ID_LANGUAGE_NEDERLANDS 40003 -#define ID_WINDOW_HIDEMENUBAR 40004 -#define ID_SOUND_8BIT8000HZMONO 40005 -#define ID_SOUND_8BIT11025HZMONO 40006 -#define ID_SOUND_8BIT22050HZMONO 40007 -#define ID_SOUND_8BIT44100HZMONO 40008 -#define ID_SOUND_16BIT8000HZMONO 40009 -#define ID_SOUND_16BIT11025HZMONO 40010 -#define ID_SOUND_16BIT22050HZMONO 40011 -#define ID_SOUND_16BIT44100HZMONO 40012 -#define ID_SOUND_8BIT8000HZSTEREO 40013 -#define ID_SOUND_8BIT11025HZSTEREO 40014 -#define ID_SOUND_8BIT22050HZSTEREO 40015 -#define ID_SOUND_8BIT44100HZSTEREO 40016 -#define ID_SOUND_16BIT8000HZSTEREO 40017 -#define ID_SOUND_16BIT11025HZSTEREO 40018 -#define ID_SOUND_16BIT22050HZSTEREO 40019 -#define ID_SOUND_16BIT44100HZSTEREO 40020 -#define ID_SOUND_NOSOUND 40021 -#define ID_OPTIONS_JOYPAD 40022 -#define ID_WINDOW_SHOWFPS 40023 -#define ID_OPTIONS_DISPLAY 40024 -#define ID_FILE_RESET 40025 -#define ID_FILE_PAUSE 40026 -#define ID_SOUND_INTERPOLATED 40027 -#define ID_SOUND_SYNC 40028 -#define ID_WINDOW_FULLSCREEN 40029 -#define ID_SOUND_16BIT 40030 -#define ID_SOUND_STEREO 40031 -#define ID_WINDOW_STRETCH 40032 -#define ID_SOUND_8000HZ 40033 -#define ID_SOUND_11025HZ 40034 -#define ID_SOUND_22050HZ 40035 -#define ID_SOUND_44100HZ 40036 -#define ID_SOUND_30000HZ 40037 -#define ID_SOUND_50MS 40038 -#define ID_SOUND_100MS 40039 -#define ID_SOUND_200MS 40040 -#define ID_SOUND_500MS 40041 -#define ID_SOUND_1S 40042 -#define ID_SOUND_25MS 40043 -#define ID_SOUND_2S 40044 -#define ID_FILE_SAVE1 40045 -#define ID_FILE_SAVE2 40046 -#define ID_FILE_SAVE3 40047 -#define ID_FILE_SAVE4 40048 -#define ID_FILE_SAVE5 40049 -#define ID_FILE_SAVE6 40050 -#define ID_FILE_SAVE7 40051 -#define ID_FILE_SAVE8 40052 -#define ID_FILE_SAVE9 40053 -#define ID_FILE_LOAD1 40054 -#define ID_FILE_LOAD2 40055 -#define ID_FILE_LOAD3 40056 -#define ID_FILE_LOAD4 40057 -#define ID_FILE_LOAD5 40058 -#define ID_FILE_LOAD6 40059 -#define ID_FILE_LOAD7 40060 -#define ID_FILE_LOAD8 40061 -#define ID_FILE_LOAD9 40062 -#define ID_CHEAT_ENTER 40063 -#define ID_CHEAT_SEARCH 40064 -#define ID_CHEAT_APPLY 40065 -#define ID_FILE_SAVE_SPC_DATA 40066 -#define ID_HELP_ABOUT 40067 -#define ID_SOUND_OPTIONS 40068 -#define ID_OPTIONS_EMULATION 40069 -#define ID_OPTIONS_SETTINGS 40070 -#define ID_DEBUG_TRACE 40071 -#define ID_DEBUG_TRACE_SPC 40072 -#define ID_DEBUG_TRACE_SA1 40073 -#define ID_DEBUG_TRACE_DSP1 40074 -#define ID_DEBUG_FRAME_ADVANCE 40075 -#define ID_DEBUG_SNES_STATUS 40076 -#define ID_NETPLAY_SERVER 40077 -#define ID_NETPLAY_CONNECT 40078 -#define ID_NETPLAY_DISCONNECT 40079 -#define ID_NETPLAY_OPTIONS 40080 -#define ID_NETPLAY_ROM 40081 -#define ID_NETPLAY_SYNC 40082 -#define ID_NETPLAY_SEND_ROM_ON_CONNECT 40083 -#define ID_NETPLAY_SYNC_BY_RESET 40084 -#define ID_SOUND_48000HZ 40085 -#define ID_SOUND_16000HZ 40086 -#define ID_SOUND_35000HZ 40087 -#define ID_SOUND_REVERSE_STEREO 40088 -#define ID_FILE_SAVE_SRAM_DATA 40089 -#define ID_RECENT_DUMMY 40090 -#define IDM_LOG_7110 40091 -#define IDM_7110_RTC 40092 -#define IDM_7110_CACHE 40093 -#define IDM_ROM_INFO 40094 -#define ID_SOUND_32000HZ 40095 -#define ID_TURBO_START 40096 -#define ID_TURBO_SELECT 40097 -#define ID_TURBO_L 40098 -#define ID_TURBO_R 40099 -#define ID_TURBO_Y 40100 -#define ID_TURBO_X 40101 -#define ID_TURBO_B 40102 -#define ID_TURBO_A 40103 -#define IDM_ENABLE_MULTITAP 40104 -#define IDM_MOUSE_TOGGLE 40105 -#define IDM_SCOPE_TOGGLE 40106 -#define IDM_CATCH_UP_SOUND 40107 -#define IDM_GFX_PACKS 40108 -#define IDM_JUSTIFIER 40109 -#define ID_SCREENSHOT 40110 -#define ID_FILE_MOVIE_PLAY 40113 -#define ID_FILE_MOVIE_STOP 40114 -#define ID_FILE_MOVIE_RECORD 40115 -#define ID_FILE_MOVIE_ENABLERECORDING 40116 -#define ID_FILE_WRITE_AVI 40116 -#define ID_FILE_STOP_AVI 40117 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 135 -#define _APS_NEXT_COMMAND_VALUE 40118 -#define _APS_NEXT_CONTROL_VALUE 1198 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by snes9x.rc +// +#define IDR_RT_MANIFEST2 1 +#define IDR_MENU_US 101 +#define IDC_CURSOR_SCOPE 101 +#define IDD_SPC7110_CACHE 101 +#define IDI_ICON1 101 +#define IDR_MENU_NL 102 +#define IDC_CURSOR_BLANK 102 +#define IDD_SOUND_OPTS 102 +#define IDR_SNES9X_ACCELERATORS 103 +#define IDD_7110_RTC 103 +#define IDD_ROM_INFO 104 +#define IDD_ABOUT 105 +#define IDD_EMU_SETTINGS 106 +#define IDD_OPEN_ROM 107 +#define IDD_GFX_PACK 108 +#define IDD_NETCONNECT 109 +#define IDD_NPOPTIONS 110 +#define IDB_OPENFOLDER 111 +#define IDD_CHEATER 111 +#define IDB_CLOSEDFOLDER 112 +#define IDB_CDDRIVE 113 +#define IDB_NETDRIVE 114 +#define IDB_HARDDRIVE 115 +#define IDD_NEWDISPLAY 123 +#define IDD_NETPLAYPROGRESS 124 +#define IDD_INPUTCONFIG 125 +#define IDB_JOYPAD 127 +#define IDD_CHEAT_SEARCH 129 +#define IDD_DIALOG1 130 +#define IDD_CHEAT_FROM_SEARCH 131 +#define IDB_PAD 133 +#define IDD_OPENMOVIE 134 +#define IDD_CREATEMOVIE 135 +#define IDD_KEYCUSTOM 136 +#define IDC_DRIVER 1001 +#define IDC_BUFLEN 1002 +#define IDC_RATE 1003 +#define IDC_MIX 1004 +#define IDC_16BIT 1005 +#define IDC_STEREO 1006 +#define IDC_REV_STEREO 1007 +#define IDC_LINEAR_INTER 1008 +#define IDC_SYNC_TO_SOUND_CPU 1009 +#define IDC_ENVX 1010 +#define IDC_ECHO 1011 +#define IDC_CLEARSRAM 1011 +#define IDC_CACHING 1012 +#define IDC_MASTER_VOL 1013 +#define IDC_SPC700ON 1014 +#define IDC_ANTIRES 1015 +#define IDC_MUTE 1016 +#define IDC_SKIP_TYPE 1017 +#define IDC_SCROLLBAR1 1018 +#define IDC_FMUT 1018 +#define IDC_VRAM_DISPLAY 1019 +#define IDC_WIP1 1019 +#define IDC_ADDRESS 1020 +#define IDC_FAMT 1020 +#define IDC_SPC7110_ALL 1021 +#define IDC_SPC7110_SOME 1022 +#define IDC_SPC7110_FILE 1023 +#define IDC_RTC_D8 1024 +#define IDC_RTC_D4 1025 +#define IDC_RTC_D2 1026 +#define IDC_RTC_D1 1027 +#define IDC_RTC_E8 1028 +#define IDC_RTC_E4 1029 +#define IDC_RTC_E2 1030 +#define IDC_RTC_E1 1031 +#define IDC_RTC_F8 1032 +#define IDC_RTC_F4 1033 +#define IDC_RTC_F2 1034 +#define IDC_RTC_F1 1035 +#define IDC_DAY 1036 +#define IDC_YEAR 1037 +#define IDC_MONTH 1038 +#define IDC_HOUR 1039 +#define IDC_MINUTE 1040 +#define IDC_SECOND 1041 +#define IDC_LBLMONTH 1042 +#define IDC_LBLYEAR 1043 +#define IDC_LBLDAY 1044 +#define IDC_LBLHOUR 1045 +#define IDC_LBLMINUTE 1046 +#define IDC_LBLSECOND 1047 +#define IDC_CACHE_MB 1048 +#define IDC_SPIN_CACHE 1049 +#define IDC_ROM_DATA 1051 +#define IDC_WARNINGS 1052 +#define IDC_DISCLAIMER 1053 +#define IDC_FREEZE_FOLDER 1054 +#define IDC_BROWSE 1055 +#define IDC_CANCEL 1056 +#define IDC_AUTO_SAVE_DELAY 1057 +#define IDC_MAX_SKIP 1058 +#define IDC_TURBO_SKIP 1059 +#define IDC_TOGGLE_TURBO 1060 +#define IDC_SRAM_SPIN 1061 +#define IDC_SPIN_MAX_SKIP 1062 +#define IDC_SPIN_TURBO_SKIP 1063 +#define IDC_ROM_DIR 1064 +#define IDC_INACTIVE_PAUSE 1064 +#define IDC_INTERLEAVE 1065 +#define IDC_VIDEO_MODE 1066 +#define IDC_HEADER 1067 +#define IDC_ROMLIST 1068 +#define IDC_MEM_TYPE 1069 +#define IDC_STAR_OCEAN 1070 +#define IDC_SO_BROWSE 1071 +#define IDC_FEOEZ 1072 +#define IDC_FEOEZ_BROWSE 1073 +#define IDC_MDH 1074 +#define IDC_MDH_BROWSE 1075 +#define IDC_SPL4 1076 +#define IDC_SPL4_BROWSE 1077 +#define IDC_SJNS 1078 +#define IDC_FEOEZ_SJNS_BROWSE 1079 +#define IDC_SFA2 1080 +#define IDC_SFA2_BROWSE 1081 +#define IDC_SFA2E 1082 +#define IDC_SFA2E_BROWSE 1083 +#define IDC_SFZ2 1084 +#define IDC_SFZ2_BROWSE 1085 +#define IDC_HOSTNAME 1086 +#define IDC_PORTNUMBER 1087 +#define IDC_CLEARHISTORY 1088 +#define IDC_STATIC2 1089 +#define IDC_EDIT1 1090 +#define IDC_UP 1090 +#define IDC_VALUE_ENTER 1090 +#define IDC_MOVIE_METADATA 1090 +#define IDC_PAUSEINTERVAL 1091 +#define IDC_UPRIGHT 1091 +#define IDC_MAXSKIP 1092 +#define IDC_PAUSESPIN 1093 +#define IDC_DWNRIGHT 1093 +#define IDC_SYNCBYRESET 1094 +#define IDC_DOWN 1094 +#define IDC_SENDROM 1095 +#define IDC_DWNLEFT 1095 +#define IDC_ACTASSERVER 1096 +#define IDC_LEFT 1096 +#define IDC_MAXSPIN 1097 +#define IDC_UPLEFT 1097 +#define IDC_SELECT 1098 +#define IDC_PORTNUMBERA 1099 +#define IDC_START 1099 +#define IDC_TESTMODE 1100 +#define IDC_L 1100 +#define IDC_VIDEOLIST 1101 +#define IDC_R 1101 +#define IDC_SELECT2 1101 +#define IDC_VIDMODELIST 1102 +#define IDC_Y 1102 +#define IDC_SETDMODE 1103 +#define IDC_B 1103 +#define IDC_A 1104 +#define IDC_X 1105 +#define IDC_RIGHT 1106 +#define IDC_SHOWFPS 1108 +#define IDC_STRETCH 1109 +#define IDC_FULLSCREEN 1110 +#define IDC_BILINEARMD7 1111 +#define IDC_RENDER16BIT 1112 +#define IDC_TRANS 1113 +#define IDC_HIRES 1114 +#define IDC_CHEAT_CODE 1115 +#define IDC_FILTERBOX 1116 +#define IDC_AUTOFRAME 1117 +#define IDC_LIMITFRAMES 1118 +#define IDC_FRAMERATESKIPSLIDER 1120 +#define IDC_TOGGLE 1121 +#define IDC_DBLBUFFER 1122 +#define IDC_CURRMODE 1123 +#define IDC_DELETE_CHEAT 1124 +#define IDC_NPPROGRESS 1124 +#define IDC_VIDEOCARD 1124 +#define IDC_UPDATE_CHEAT 1125 +#define IDC_JPCOMBO 1125 +#define IDC_CLEAR_CHEATS 1126 +#define IDC_JPTOGGLE 1126 +#define IDC_CHEAT_DESCRIPTION 1127 +#define IDC_KEYBOARD 1127 +#define IDC_ALLOWLEFTRIGHT 1127 +#define IDC_CHEAT_ADDRESS 1128 +#define IDC_TOGL 1128 +#define IDC_CHEAT_BYTE 1129 +#define IDC_ADD_CHEAT 1130 +#define IDC_CHEAT_LIST 1131 +#define IDC_PICTURE 1132 +#define IDC_ADDYS 1133 +#define IDC_OK 1134 +#define IDC_C_SEARCH 1134 +#define IDC_RED 1135 +#define IDC_C_ADD 1135 +#define IDC_BLUE 1136 +#define IDC_C_RESET 1136 +#define IDC_LABEL_BLUE 1136 +#define IDC_1_BYTE 1137 +#define IDC_2_BYTE 1138 +#define IDC_3_BYTE 1139 +#define IDC_4_BYTE 1140 +#define IDC_LESS_THAN 1141 +#define IDC_GREATER_THAN 1142 +#define IDC_LESS_THAN_EQUAL 1143 +#define IDC_GREATER_THAN_EQUAL 1144 +#define IDC_EQUAL 1145 +#define IDC_NOT_EQUAL 1146 +#define IDC_PREV 1147 +#define IDC_ENTERED 1148 +#define IDC_UNSIGNED 1149 +#define IDC_SIGNED 1150 +#define IDC_HEX 1151 +#define IDC_ENTER_LABEL 1152 +#define IDC_DIAGTOGGLE 1153 +#define IDC_UNDO 1154 +#define IDC_COMBO1 1155 +#define IDC_NC_ADDRESS 1156 +#define IDC_NC_CURRVAL 1157 +#define IDC_NC_PREVVAL 1158 +#define IDC_NC_NEWVAL 1159 +#define IDC_NC_DESC 1160 +#define IDC_LABEL_UP 1161 +#define IDC_LABEL_LEFT 1162 +#define IDC_LABEL_DOWN 1163 +#define IDC_LABEL_RIGHT 1164 +#define IDC_LABEL_B 1165 +#define IDC_LABEL_A 1166 +#define IDC_LABEL_Y 1167 +#define IDC_LABEL_RIGHT2 1167 +#define IDC_LABEL_X 1168 +#define IDC_LABEL_START 1169 +#define IDC_LABEL_SELECT 1170 +#define IDC_LABEL_L 1171 +#define IDC_LABEL_R 1172 +#define IDC_LABEL_UPLEFT 1173 +#define IDC_LABEL_R2 1173 +#define IDC_LABEL_UPRIGHT 1174 +#define IDC_LABEL_R3 1174 +#define IDC_LABEL_DOWNRIGHT 1175 +#define IDC_LABEL_DOWNLEFT 1176 +#define IDC_LABEL_FREEZE 1177 +#define IDC_LABEL_ASRAM 1178 +#define IDC_LABEL_SMAX 1179 +#define IDC_LABEL_STURBO 1180 +#define IDC_LABEL_ASRAM_TEXT 1181 +#define IDC_LABEL_UP2 1181 +#define IDC_LABEL_SMAX_TEXT 1182 +#define IDC_LABEL_UP3 1182 +#define IDC_LABEL_STURBO_TEXT 1183 +#define IDC_LABEL_UP4 1183 +#define IDC_PORTNUMBLOCK 1184 +#define IDC_LABEL_UP5 1184 +#define IDC_CLIENTSETTINGSBLOCK 1185 +#define IDC_LABEL_UP6 1185 +#define IDC_SERVERSETTINGSBLOCK 1186 +#define IDC_LABEL_UP7 1186 +#define IDC_LABEL_PORTNUM 1187 +#define IDC_LABEL_UP8 1187 +#define IDC_LABEL_PAUSEINTERVAL 1188 +#define IDC_LABEL_UP9 1188 +#define IDC_LABEL_PAUSEINTERVAL_TEXT 1189 +#define IDC_LABEL_UP10 1189 +#define IDC_LABEL_MAXSKIP 1190 +#define IDC_LABEL_UP11 1190 +#define IDC_LABEL_CHEAT_CODE 1191 +#define IDC_LABEL_UP12 1191 +#define IDC_LABEL_CHEAT_DESCRIPTION 1192 +#define IDC_LABEL_UP13 1192 +#define IDC_LABEL_CHEAT_ADDRESS 1193 +#define IDC_LABEL_UP14 1193 +#define IDC_LABEL_CHEAT_BYTE 1194 +#define IDC_LABEL_UP15 1194 +#define IDC_LABEL_SERVERADDY 1195 +#define IDC_LABEL_UP16 1195 +#define IDC_LABEL_UP17 1196 +#define IDC_LABEL_UP18 1197 +#define IDC_HEIGHT_EXTEND 1198 +#define IDC_LABEL_UP19 1198 +#define IDC_SPEEDDOWN 1199 +#define IDC_ASPECT 1199 +#define IDC_PAUSE 1200 +#define IDC_RECORD_NOW 1201 +#define IDC_FRAMEADVANCE 1201 +#define IDC_RECORD_RESET 1202 +#define IDC_SKIPUP 1202 +#define IDC_JOY1 1203 +#define IDC_SKIPDOWN 1203 +#define IDC_JOY2 1204 +#define IDC_SPEEDUP 1204 +#define IDC_JOY3 1205 +#define IDC_SCOPETURBO 1205 +#define IDC_JOY4 1206 +#define IDC_SCOPEPAUSE 1206 +#define IDC_JOY5 1207 +#define IDC_FRAMECOUNT 1207 +#define IDC_MOVIE_PATH 1208 +#define IDC_SAVE1 1208 +#define IDC_BROWSE_MOVIE 1209 +#define IDC_SAVE2 1209 +#define IDC_MOVIE_DATE 1210 +#define IDC_SAVE3 1210 +#define IDC_MOVIE_LENGTH 1211 +#define IDC_SAVE4 1211 +#define IDC_MOVIE_FRAMES 1212 +#define IDC_SAVE5 1212 +#define IDC_MOVIE_RERECORD 1213 +#define IDC_SAVE6 1213 +#define IDC_SAVE7 1214 +#define IDC_SAVE8 1215 +#define IDC_LOADEDFROMMOVIE 1215 +#define IDC_SAVE9 1216 +#define IDC_MOVIEROMINFO 1216 +#define IDC_SAVE10 1217 +#define IDC_CURRENTROMINFO 1217 +#define IDC_READONLY 1218 +#define IDC_SAVE11 1219 +#define IDC_DISPLAY_INPUT 1220 +#define IDC_SAVE12 1220 +#define IDC_SAVE13 1221 +#define IDC_SAVE14 1222 +#define IDC_SAVE15 1223 +#define IDC_SAVE16 1224 +#define IDC_SAVE17 1225 +#define IDC_SAVE18 1226 +#define IDC_SAVE19 1227 +#define IDC_SAVE20 1228 +#define IDC_LABEL_UP20 1229 +#define IDC_LABEL_UP21 1230 +#define IDC_FASTFORWARD 1231 +#define IDC_SHOWPRESSED 1232 +#define IDC_SCREENSHOT 1233 +#define IDC_LABEL_UP22 1234 +#define IDC_SLOTMINUS 1235 +#define IDC_LABEL_UP23 1236 +#define IDC_SLOTPLUS 1237 +#define IDC_LABEL_UP24 1238 +#define IDC_SLOTSAVE 1239 +#define IDC_LABEL_UP25 1240 +#define IDC_SLOTLOAD 1241 +#define ID_FILE_EXIT 40001 +#define ID_LANGUAGE_ENGLISH 40002 +#define ID_LANGUAGE_NEDERLANDS 40003 +#define ID_WINDOW_HIDEMENUBAR 40004 +#define ID_SOUND_8BIT8000HZMONO 40005 +#define ID_SOUND_8BIT11025HZMONO 40006 +#define ID_SOUND_8BIT22050HZMONO 40007 +#define ID_SOUND_8BIT44100HZMONO 40008 +#define ID_SOUND_16BIT8000HZMONO 40009 +#define ID_SOUND_16BIT11025HZMONO 40010 +#define ID_SOUND_16BIT22050HZMONO 40011 +#define ID_SOUND_16BIT44100HZMONO 40012 +#define ID_SOUND_8BIT8000HZSTEREO 40013 +#define ID_SOUND_8BIT11025HZSTEREO 40014 +#define ID_SOUND_8BIT22050HZSTEREO 40015 +#define ID_SOUND_8BIT44100HZSTEREO 40016 +#define ID_SOUND_16BIT8000HZSTEREO 40017 +#define ID_SOUND_16BIT11025HZSTEREO 40018 +#define ID_SOUND_16BIT22050HZSTEREO 40019 +#define ID_SOUND_16BIT44100HZSTEREO 40020 +#define ID_SOUND_NOSOUND 40021 +#define ID_OPTIONS_JOYPAD 40022 +#define ID_WINDOW_SHOWFPS 40023 +#define ID_OPTIONS_DISPLAY 40024 +#define ID_FILE_RESET 40025 +#define ID_FILE_PAUSE 40026 +#define ID_SOUND_INTERPOLATED 40027 +#define ID_SOUND_SYNC 40028 +#define ID_WINDOW_FULLSCREEN 40029 +#define ID_SOUND_16BIT 40030 +#define ID_SOUND_STEREO 40031 +#define ID_WINDOW_STRETCH 40032 +#define ID_SOUND_8000HZ 40033 +#define ID_SOUND_11025HZ 40034 +#define ID_SOUND_22050HZ 40035 +#define ID_SOUND_44100HZ 40036 +#define ID_SOUND_30000HZ 40037 +#define ID_SOUND_50MS 40038 +#define ID_SOUND_100MS 40039 +#define ID_SOUND_200MS 40040 +#define ID_SOUND_500MS 40041 +#define ID_SOUND_1S 40042 +#define ID_SOUND_25MS 40043 +#define ID_SOUND_2S 40044 +#define ID_FILE_SAVE1 40045 +#define ID_FILE_SAVE2 40046 +#define ID_FILE_SAVE3 40047 +#define ID_FILE_SAVE4 40048 +#define ID_FILE_SAVE5 40049 +#define ID_FILE_SAVE6 40050 +#define ID_FILE_SAVE7 40051 +#define ID_FILE_SAVE8 40052 +#define ID_FILE_SAVE9 40053 +#define ID_FILE_LOAD1 40054 +#define ID_FILE_LOAD2 40055 +#define ID_FILE_LOAD3 40056 +#define ID_FILE_LOAD4 40057 +#define ID_FILE_LOAD5 40058 +#define ID_FILE_LOAD6 40059 +#define ID_FILE_LOAD7 40060 +#define ID_FILE_LOAD8 40061 +#define ID_FILE_LOAD9 40062 +#define ID_CHEAT_ENTER 40063 +#define ID_CHEAT_SEARCH 40064 +#define ID_CHEAT_APPLY 40065 +#define ID_FILE_SAVE_SPC_DATA 40066 +#define ID_HELP_ABOUT 40067 +#define ID_SOUND_OPTIONS 40068 +#define ID_OPTIONS_EMULATION 40069 +#define ID_OPTIONS_SETTINGS 40070 +#define ID_DEBUG_TRACE 40071 +#define ID_DEBUG_TRACE_SPC 40072 +#define ID_DEBUG_TRACE_SA1 40073 +#define ID_DEBUG_TRACE_DSP1 40074 +#define ID_DEBUG_FRAME_ADVANCE 40075 +#define ID_DEBUG_SNES_STATUS 40076 +#define ID_NETPLAY_SERVER 40077 +#define ID_NETPLAY_CONNECT 40078 +#define ID_NETPLAY_DISCONNECT 40079 +#define ID_NETPLAY_OPTIONS 40080 +#define ID_NETPLAY_ROM 40081 +#define ID_NETPLAY_SYNC 40082 +#define ID_NETPLAY_SEND_ROM_ON_CONNECT 40083 +#define ID_NETPLAY_SYNC_BY_RESET 40084 +#define ID_SOUND_48000HZ 40085 +#define ID_SOUND_16000HZ 40086 +#define ID_SOUND_35000HZ 40087 +#define ID_SOUND_REVERSE_STEREO 40088 +#define ID_FILE_SAVE_SRAM_DATA 40089 +#define ID_RECENT_DUMMY 40090 +#define IDM_LOG_7110 40091 +#define IDM_7110_RTC 40092 +#define IDM_7110_CACHE 40093 +#define IDM_ROM_INFO 40094 +#define ID_SOUND_32000HZ 40095 +#define ID_TURBO_START 40096 +#define ID_TURBO_SELECT 40097 +#define ID_TURBO_L 40098 +#define ID_TURBO_R 40099 +#define ID_TURBO_Y 40100 +#define ID_TURBO_X 40101 +#define ID_TURBO_B 40102 +#define ID_TURBO_A 40103 +#define IDM_ENABLE_MULTITAP 40104 +#define IDM_MOUSE_TOGGLE 40105 +#define IDM_SCOPE_TOGGLE 40106 +#define IDM_CATCH_UP_SOUND 40107 +#define IDM_GFX_PACKS 40108 +#define IDM_JUSTIFIER 40109 +#define ID_SCREENSHOT 40110 +#define ID_FILE_MOVIE_PLAY 40113 +#define ID_FILE_MOVIE_STOP 40114 +#define ID_FILE_MOVIE_RECORD 40115 +#define ID_FILE_MOVIE_ENABLERECORDING 40116 +#define ID_FILE_WRITE_AVI 40116 +#define ID_FILE_STOP_AVI 40117 +#define ID_OPTIONS_KEYCUSTOM 40118 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 141 +#define _APS_NEXT_COMMAND_VALUE 40119 +#define _APS_NEXT_CONTROL_VALUE 1216 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff -NaHudr snes9x-1.43-src/rt_manif.bin snx/rt_manif.bin --- snes9x-1.43-src/rt_manif.bin 1970-01-01 02:00:00.000000000 +0200 +++ snx/rt_manif.bin 2005-03-20 23:46:36.000000000 +0200 @@ -0,0 +1,22 @@ + + + + Snes9x + + + + + + \ No newline at end of file diff -NaHudr snes9x-1.43-src/snes9x/apu.cpp snx/snes9x/apu.cpp --- snes9x-1.43-src/snes9x/apu.cpp 2004-12-31 00:15:47.000000000 +0200 +++ snx/snes9x/apu.cpp 2007-07-01 22:01:19.000000000 +0300 @@ -444,7 +444,7 @@ S9xTraceSoundDSP ("%d,", c); #endif // Pac-In-Time requires that channels can be key-on - // regardeless of their current state. + // regardless of their current state. if((APU.DSP [APU_KOFF] & mask) ==0) { KeyOnPrev&=~mask; @@ -915,8 +915,12 @@ } } + void S9xUpdateAPUTimer (void) { + if(Settings.UseWIPAPUTiming) + return; + while (CPU.Cycles * 10000L >= IAPU.NextAPUTimerPos) //if (CPU.Cycles * 10000L >= IAPU.NextAPUTimerPos) { @@ -992,10 +996,18 @@ case APU_OUTX + 0x50: case APU_OUTX + 0x60: case APU_OUTX + 0x70: - if (SoundData.channels [reg >> 4].state == SOUND_SILENT) + if(Settings.FakeMuteFix) + { + // fixes Terranigma return (0); - return ((SoundData.channels [reg >> 4].sample >> 8) | - (SoundData.channels [reg >> 4].sample & 0xff)); + } + else + { + if (SoundData.channels [reg >> 4].state == SOUND_SILENT) + return (0); + return ((SoundData.channels [reg >> 4].sample >> 8) | + (SoundData.channels [reg >> 4].sample & 0xff)); + } case APU_ENVX + 0x00: case APU_ENVX + 0x10: diff -NaHudr snes9x-1.43-src/snes9x/cheats2.cpp snx/snes9x/cheats2.cpp --- snes9x-1.43-src/snes9x/cheats2.cpp 2004-12-31 00:15:45.000000000 +0200 +++ snx/snes9x/cheats2.cpp 2007-07-28 22:24:14.000000000 +0300 @@ -105,6 +105,9 @@ void S9xAddCheat (bool8 enable, bool8 save_current_value, uint32 address, uint8 byte) { + fprintf(stderr, "add cheat code: %06X,%02X,%d,%d\n", + address, byte,enable,save_current_value); + if (Cheat.num_cheats < sizeof (Cheat.c) / sizeof (Cheat. c [0])) { Cheat.c [Cheat.num_cheats].address = address; @@ -175,6 +178,7 @@ void S9xApplyCheat (uint32 which1) { uint32 address = Cheat.c [which1].address; +// if(address == 0x7E0BBC) return; if (!Cheat.c [which1].saved) Cheat.c [which1].saved_byte = S9xGetByte (address); diff -NaHudr snes9x-1.43-src/snes9x/configure snx/snes9x/configure --- snes9x-1.43-src/snes9x/configure 2004-12-31 00:15:48.000000000 +0200 +++ snx/snes9x/configure 2008-02-20 15:09:21.402845108 +0200 @@ -1,63 +1,719 @@ #! /bin/sh - -# From configure.in Id: configure.in +# From configure.in Id: configure.in. # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# Generated by GNU Autoconf 2.61. # +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## -# Defaults: -ac_help= +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + +exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help - --with(out)-debug Leave debug information in the final binary (default: without)" -ac_help="$ac_help - --with-mcpu Use the specified value for the -mcpu flag (default: auto)" -ac_help="$ac_help - --with(out)-glide Use 3Dfx glide for output (default: without)" -ac_help="$ac_help - --with(out)-opengl Use OpenGL for output (default: without)" -ac_help="$ac_help - --with(out)-aido Use a shared memory area for output (default: without)" -ac_help="$ac_help - --with(out)-assembler Use assembler cores if available (default: with)" -ac_help="$ac_help - --with(out)-joystick Enable joystick support if available (default: with)" -ac_help="$ac_help - --with(out)-debugger Enable debugger (default: without)" -ac_help="$ac_help - --with(out)-dreamcast Build for Dreamcast (default: without)" -ac_help="$ac_help - --with(out)-sdd1-decomp Use SDD1 decompression (default: with)" -ac_help="$ac_help - --with(out)-jma Enable JMA archive decompression (default: without)" -ac_help="$ac_help - --with(out)-maxcount Enable maxcount debugger (default: without)" -ac_help="$ac_help - --with(out)-newblend New colour blender (default: without)" -ac_help="$ac_help - --with(out)-zlib Support gzip decompression" -ac_help="$ac_help - --with(out)-screenshot Screenshot support through libpng if available (default: with)" -ac_help="$ac_help - --with-x use the X Window System" -ac_help="$ac_help - --with(out)-extensions Use DGA- and vidmode-extensions for X11 if avilable (default: with)" -ac_help="$ac_help - --with(out)-sound Enable sound if available (default: with)" +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="snes9x.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +CXX +CXXFLAGS +ac_ct_CXX +prog_nasm +CXXCPP +GREP +EGREP +XMKMF +OPTIMIZE +RTTIFLAG +ZSNESFX +ZSNESC4 +ASMCPU +ASMKREED +SDD1_DECOMP +SPC700ASM +I386SPC +THREAD_SOUND +SYSLIBS +CPUINC +SYSDEFINES +JOYDEFINES +X_INCLUDES +BUILDDIR +NASM +GLIDE +OPENGL +AIDO +DREAMCAST +JMA +LIBOBJS +LTLIBOBJS' +ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CXX +CXXFLAGS +CCC +CXXCPP +XMKMF' + # Initialize some variables set by options. +ac_init_help= +ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. -build=NONE -cache_file=./config.cache +cache_file=/dev/null exec_prefix=NONE -host=NONE no_create= -nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE @@ -66,94 +722,117 @@ silent= site= srcdir= -target=NONE verbose= x_includes=NONE x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do - # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. - case "$ac_option" in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; + bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) - ac_prev=build ;; + ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; + build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; + cache_file=$ac_optarg ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$ac_optarg'" ;; + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -162,116 +841,77 @@ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; + exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; -host | --host | --hos | --ho) - ac_prev=host ;; + ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; + includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; + infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; + libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; + mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) + | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ @@ -285,26 +925,26 @@ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; + oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; + prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; + program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; + program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ @@ -321,7 +961,17 @@ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) @@ -331,7 +981,7 @@ ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; + sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ @@ -342,58 +992,53 @@ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; + sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; + site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; + srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; + sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; + ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; + target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -404,372 +1049,1476 @@ ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; + x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; + x_libraries=$ac_optarg ;; - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } fi -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +done -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi fi -exec 5>./config.log -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done +test "$silent" = yes && exec 6>/dev/null -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=snes9x.h # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +X features: + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with(out)-debug Leave debug information in the final binary (default: without) + --with-mcpu Use the specified value for the -mcpu flag (default: auto) + --with(out)-glide Use 3Dfx glide for output (default: without) + --with(out)-opengl Use OpenGL for output (default: without) + --with(out)-aido Use a shared memory area for output (default: without) + --with(out)-assembler Use assembler cores if available (default: with) + --with(out)-joystick Enable joystick support if available (default: with) + --with(out)-debugger Enable debugger (default: without) + --with(out)-dreamcast Build for Dreamcast (default: without) + --with(out)-sdd1-decomp Use SDD1 decompression (default: with) + --with(out)-jma Enable JMA archive decompression (default: without) + --with(out)-maxcount Enable maxcount debugger (default: without) + --with(out)-newblend New colour blender (default: without) + --with(out)-zlib Support gzip decompression + --with(out)-screenshot Screenshot support through libpng if available (default: with) + --with-x use the X Window System + --with(out)-extensions Use DGA- and vidmode-extensions for X11 if avilable (default: with) + --with(out)-sound Enable sound if available (default: with) + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP C++ preprocessor + XMKMF Path to xmkmf, Makefile generator for X Window System + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.61 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.61. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi else - echo "creating cache $cache_file" - > $cache_file + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file fi +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + + + + + + + + + + + + + + + + + ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - ac_n= ac_c='\c' ac_t= + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi - -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:569: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$ac_t""no" 1>&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + + fi +fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:599: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift - if test $# -gt 0; then + if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$ac_t""no" 1>&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:650: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$ac_t""no" 1>&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - ;; - esac + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:682: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross + test -n "$ac_ct_CC" && break +done -cat > conftest.$ac_ext << EOF + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi -#line 693 "configure" -#include "confdefs.h" +fi -main(){return(0);} -EOF -if { (eval echo configure:698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext + +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no else - ac_cv_prog_cc_cross=yes + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi fi +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +rm -f conftest$ac_cv_exeext +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:724: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:729: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.c <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me #endif -EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:738: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes else - ac_cv_prog_gcc=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 +int +main () +{ -if test $ac_cv_prog_gcc = yes; then - GCC=yes + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes else - GCC= -fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:757: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - ac_cv_prog_cc_g=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -rm -f conftest* +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" + CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" @@ -783,136 +2532,472 @@ CFLAGS= fi fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} -for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do -# Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:793: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CXX="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + fi fi -CXX="$ac_cv_prog_CXX" +CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - echo "$ac_t""$CXX" 1>&6 + { echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6; } else - echo "$ac_t""no" 1>&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -test -n "$CXX" && break -done -test -n "$CXX" || CXX="gcc" - -echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:825: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -ac_ext=C -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cxx_cross +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi -cat > conftest.$ac_ext << EOF -#line 836 "configure" -#include "confdefs.h" + test -n "$ac_ct_CXX" && break +done -int main(){return(0);} -EOF -if { (eval echo configure:841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cxx_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cxx_cross=no + if test "x$ac_ct_CXX" = x; then + CXX="g++" else - ac_cv_prog_cxx_cross=yes + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cxx_works=no fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross -echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6 -if test $ac_cv_prog_cxx_works = no; then - { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } + fi fi -echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:867: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 -cross_compiling=$ac_cv_prog_cxx_cross +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } -echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:872: checking whether we are using GNU C++" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.C <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me #endif -EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:881: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gxx=yes + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes else - ac_cv_prog_gxx=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + fi +{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -echo "$ac_t""$ac_cv_prog_gxx" 1>&6 +int +main () +{ -if test $ac_cv_prog_gxx = yes; then - GXX=yes + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cxx_g=yes else - GXX= -fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -ac_test_CXXFLAGS="${CXXFLAGS+set}" -ac_save_CXXFLAGS="$CXXFLAGS" -CXXFLAGS= -echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:900: checking whether ${CXX-g++} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + CXXFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : else - echo 'void f(){}' > conftest.cc -if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else - ac_cv_prog_cxx_g=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -rm -f conftest* +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS="$ac_save_CXXFLAGS" + CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" @@ -926,33 +3011,41 @@ CXXFLAGS= fi fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=C -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cxx_cross +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu #FIXME: Warn about glide, opengl and aido mutually exclusivity. #FIXME: Make svgalib build part of this and clean up the Makefile - -echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:949: checking for size_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + +{ echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include @@ -964,34 +3057,56 @@ -int main() { +int +main () +{ size_t tmp; -; return 0; } -EOF -if { (eval echo configure:974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_size_t=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_type_size_t=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_size_t=no fi -rm -f conftest* + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_type_size_t = no; then - cat >> confdefs.h <<\EOF + cat >>confdefs.h <<\_ACEOF #define size_t unsigned long -EOF +_ACEOF - echo "$ac_t""no" 1>&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } else - echo "$ac_t""yes" 1>&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } fi @@ -1024,19 +3139,23 @@ *) oldsrcdir="$srcdir" srcdir="`cd \"$srcdir\";pwd`" - echo "configure: warning: + { echo "$as_me:$LINENO: WARNING: Converted $oldsrcdir to $srcdir, -If this does not work, please use an absolute path to the configure script. -" 1>&2 +If this does not work, please use an absolute path to the configure script. +" >&5 +echo "$as_me: WARNING: +Converted $oldsrcdir to $srcdir, +If this does not work, please use an absolute path to the configure script. +" >&2;} ;; esac -# Check whether --with-debug or --without-debug was given. + +# Check whether --with-debug was given. if test "${with_debug+set}" = set; then - withval="$with_debug" - : + withval=$with_debug; else with_debug=no fi @@ -1046,45 +3165,70 @@ RTTIFLAG="" if test yes = "$with_debug" ; then - - echo $ac_n "checking -g""... $ac_c" 1>&6 -echo "configure:1052: checking -g" >&5 - if eval "test \"`echo '$''{'snes9x_cv_option_debuginfo'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + { echo "$as_me:$LINENO: checking -g" >&5 +echo $ECHO_N "checking -g... $ECHO_C" >&6; } + if test "${snes9x_cv_option_debuginfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + OLD_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$OLD_CXXFLAGS -g" old_ac_link="$ac_link" ac_link="$old_ac_link 2>conftezt.out.2" if test "$cross_compiling" = yes; then - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -; return 0; } -EOF -if { (eval echo configure:1071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then snes9x_cv_option_debuginfo=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_option_debuginfo=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + snes9x_cv_option_debuginfo=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int foo; int main(int argc, char **argv) @@ -1095,20 +3239,41 @@ if (argc > 0) argc = 0; return argc; } - -EOF -if { (eval echo configure:1101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then snes9x_cv_option_debuginfo=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - snes9x_cv_option_debuginfo=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +snes9x_cv_option_debuginfo=no fi -rm -fr conftest* +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + CXXFLAGS="$OLD_CXXFLAGS" ac_link="$old_ac_link" if grep -i 'unrecognized option' /dev/null; then @@ -1122,7 +3287,7 @@ elif grep -i 'optimizer bugs' /dev/null; then # gcc/FreeBSD-4.6/alpha says the following regarding -O2: # - # cc1: warning: + # cc1: warning: # *** # *** The -O2 flag TRIGGERS KNOWN OPTIMIZER BUGS ON THIS PLATFORM # *** @@ -1139,7 +3304,7 @@ snes9x_cv_option_debuginfo=no else :; fi # rm conftezt.out.2 - + fi @@ -1150,19 +3315,21 @@ CXXFLAGS="$CXXFLAGS -g" ;; esac - echo "$ac_t""yes" 1>&6 - + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else - echo "$ac_t""no" 1>&6 - + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi fi -# Check whether --with-mcpu or --without-mcpu was given. + +# Check whether --with-mcpu was given. if test "${with_mcpu+set}" = set; then - withval="$with_mcpu" - : + withval=$with_mcpu; else with_mcpu=auto fi @@ -1173,45 +3340,70 @@ if test no = "$with_march" ; then if test auto = "$with_mcpu" ; then - - echo $ac_n "checking -mcpu=ultrasparc""... $ac_c" 1>&6 -echo "configure:1179: checking -mcpu=ultrasparc" >&5 - if eval "test \"`echo '$''{'snes9x_cv_option_ultrasparc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + { echo "$as_me:$LINENO: checking -mcpu=ultrasparc" >&5 +echo $ECHO_N "checking -mcpu=ultrasparc... $ECHO_C" >&6; } + if test "${snes9x_cv_option_ultrasparc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + OLD_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$OLD_CXXFLAGS -mcpu=ultrasparc" old_ac_link="$ac_link" ac_link="$old_ac_link 2>conftezt.out.2" if test "$cross_compiling" = yes; then - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -; return 0; } -EOF -if { (eval echo configure:1198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then snes9x_cv_option_ultrasparc=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_option_ultrasparc=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + snes9x_cv_option_ultrasparc=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int foo; int main(int argc, char **argv) @@ -1222,20 +3414,41 @@ if (argc > 0) argc = 0; return argc; } - -EOF -if { (eval echo configure:1228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then snes9x_cv_option_ultrasparc=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - snes9x_cv_option_ultrasparc=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +snes9x_cv_option_ultrasparc=no fi -rm -fr conftest* +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + CXXFLAGS="$OLD_CXXFLAGS" ac_link="$old_ac_link" if grep -i 'unrecognized option' /dev/null; then @@ -1249,7 +3462,7 @@ elif grep -i 'optimizer bugs' /dev/null; then # gcc/FreeBSD-4.6/alpha says the following regarding -O2: # - # cc1: warning: + # cc1: warning: # *** # *** The -O2 flag TRIGGERS KNOWN OPTIMIZER BUGS ON THIS PLATFORM # *** @@ -1266,7 +3479,7 @@ snes9x_cv_option_ultrasparc=no else :; fi # rm conftezt.out.2 - + fi @@ -1277,50 +3490,77 @@ CXXFLAGS="$CXXFLAGS -mcpu=ultrasparc" ;; esac - echo "$ac_t""yes" 1>&6 - + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else - echo "$ac_t""no" 1>&6 - - - echo $ac_n "checking -mcpu=supersparc""... $ac_c" 1>&6 -echo "configure:1288: checking -mcpu=supersparc" >&5 - if eval "test \"`echo '$''{'snes9x_cv_option_supersparc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + + + { echo "$as_me:$LINENO: checking -mcpu=supersparc" >&5 +echo $ECHO_N "checking -mcpu=supersparc... $ECHO_C" >&6; } + if test "${snes9x_cv_option_supersparc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + OLD_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$OLD_CXXFLAGS -mcpu=supersparc" old_ac_link="$ac_link" ac_link="$old_ac_link 2>conftezt.out.2" if test "$cross_compiling" = yes; then - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -; return 0; } -EOF -if { (eval echo configure:1307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then snes9x_cv_option_supersparc=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_option_supersparc=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + snes9x_cv_option_supersparc=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int foo; int main(int argc, char **argv) @@ -1331,20 +3571,41 @@ if (argc > 0) argc = 0; return argc; } - -EOF -if { (eval echo configure:1337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then snes9x_cv_option_supersparc=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - snes9x_cv_option_supersparc=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +snes9x_cv_option_supersparc=no fi -rm -fr conftest* +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + CXXFLAGS="$OLD_CXXFLAGS" ac_link="$old_ac_link" if grep -i 'unrecognized option' /dev/null; then @@ -1358,7 +3619,7 @@ elif grep -i 'optimizer bugs' /dev/null; then # gcc/FreeBSD-4.6/alpha says the following regarding -O2: # - # cc1: warning: + # cc1: warning: # *** # *** The -O2 flag TRIGGERS KNOWN OPTIMIZER BUGS ON THIS PLATFORM # *** @@ -1375,7 +3636,7 @@ snes9x_cv_option_supersparc=no else :; fi # rm conftezt.out.2 - + fi @@ -1386,56 +3647,83 @@ CXXFLAGS="$CXXFLAGS -mcpu=supersparc" ;; esac - echo "$ac_t""yes" 1>&6 - + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else - echo "$ac_t""no" 1>&6 - + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi - + fi elif test no != "$with_mcpu" ; then - - echo $ac_n "checking -mcpu=$with_mcpu""... $ac_c" 1>&6 -echo "configure:1403: checking -mcpu=$with_mcpu" >&5 - if eval "test \"`echo '$''{'snes9x_cv_option_custom_mcpu'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + + { echo "$as_me:$LINENO: checking -mcpu=$with_mcpu" >&5 +echo $ECHO_N "checking -mcpu=$with_mcpu... $ECHO_C" >&6; } + if test "${snes9x_cv_option_custom_mcpu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + OLD_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$OLD_CXXFLAGS -mcpu=$with_mcpu" old_ac_link="$ac_link" ac_link="$old_ac_link 2>conftezt.out.2" if test "$cross_compiling" = yes; then - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -; return 0; } -EOF -if { (eval echo configure:1422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then snes9x_cv_option_custom_mcpu=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_option_custom_mcpu=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + snes9x_cv_option_custom_mcpu=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int foo; int main(int argc, char **argv) @@ -1446,20 +3734,41 @@ if (argc > 0) argc = 0; return argc; } - -EOF -if { (eval echo configure:1452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then snes9x_cv_option_custom_mcpu=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - snes9x_cv_option_custom_mcpu=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +snes9x_cv_option_custom_mcpu=no fi -rm -fr conftest* +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + CXXFLAGS="$OLD_CXXFLAGS" ac_link="$old_ac_link" if grep -i 'unrecognized option' /dev/null; then @@ -1473,7 +3782,7 @@ elif grep -i 'optimizer bugs' /dev/null; then # gcc/FreeBSD-4.6/alpha says the following regarding -O2: # - # cc1: warning: + # cc1: warning: # *** # *** The -O2 flag TRIGGERS KNOWN OPTIMIZER BUGS ON THIS PLATFORM # *** @@ -1490,7 +3799,7 @@ snes9x_cv_option_custom_mcpu=no else :; fi # rm conftezt.out.2 - + fi @@ -1501,60 +3810,92 @@ CXXFLAGS="$CXXFLAGS -mcpu=$with_mcpu" ;; esac - echo "$ac_t""yes" 1>&6 - + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else - echo "$ac_t""no" 1>&6 - { echo "configure: error: Please specify a working value for --with-mcpu, or use --with-mcpu=auto" 1>&2; exit 1; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + { { echo "$as_me:$LINENO: error: Please specify a working value for --with-mcpu, or use --with-mcpu=auto" >&5 +echo "$as_me: error: Please specify a working value for --with-mcpu, or use --with-mcpu=auto" >&2;} + { (exit 1); exit 1; }; } fi unset snes9x_cv_option_custom_mcpu fi else if test auto != "$with_mcpu" ; then - echo "configure: warning: --with(out)-mcpu ignored because --with-march specified" 1>&2 + { echo "$as_me:$LINENO: WARNING: --with(out)-mcpu ignored because --with-march specified" >&5 +echo "$as_me: WARNING: --with(out)-mcpu ignored because --with-march specified" >&2;} fi - echo "configure: warning: You specified --with-march. I hope you know what you're doing, since" 1>&2 - echo "configure: warning: *** MISUSING THIS OPTION WILL CAUSE SNES9X TO CRASH! ***" 1>&2 - - echo $ac_n "checking -march=$with_march""... $ac_c" 1>&6 -echo "configure:1522: checking -march=$with_march" >&5 - if eval "test \"`echo '$''{'snes9x_cv_option_custom_march'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + { echo "$as_me:$LINENO: WARNING: You specified --with-march. I hope you know what you're doing, since" >&5 +echo "$as_me: WARNING: You specified --with-march. I hope you know what you're doing, since" >&2;} + { echo "$as_me:$LINENO: WARNING: *** MISUSING THIS OPTION WILL CAUSE SNES9X TO CRASH! ***" >&5 +echo "$as_me: WARNING: *** MISUSING THIS OPTION WILL CAUSE SNES9X TO CRASH! ***" >&2;} + + { echo "$as_me:$LINENO: checking -march=$with_march" >&5 +echo $ECHO_N "checking -march=$with_march... $ECHO_C" >&6; } + if test "${snes9x_cv_option_custom_march+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + OLD_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$OLD_CXXFLAGS -march=$with_march" old_ac_link="$ac_link" ac_link="$old_ac_link 2>conftezt.out.2" if test "$cross_compiling" = yes; then - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -; return 0; } -EOF -if { (eval echo configure:1541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then snes9x_cv_option_custom_march=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_option_custom_march=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + snes9x_cv_option_custom_march=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int foo; int main(int argc, char **argv) @@ -1565,20 +3906,41 @@ if (argc > 0) argc = 0; return argc; } - -EOF -if { (eval echo configure:1571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then snes9x_cv_option_custom_march=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - snes9x_cv_option_custom_march=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +snes9x_cv_option_custom_march=no fi -rm -fr conftest* +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + CXXFLAGS="$OLD_CXXFLAGS" ac_link="$old_ac_link" if grep -i 'unrecognized option' /dev/null; then @@ -1592,7 +3954,7 @@ elif grep -i 'optimizer bugs' /dev/null; then # gcc/FreeBSD-4.6/alpha says the following regarding -O2: # - # cc1: warning: + # cc1: warning: # *** # *** The -O2 flag TRIGGERS KNOWN OPTIMIZER BUGS ON THIS PLATFORM # *** @@ -1609,7 +3971,7 @@ snes9x_cv_option_custom_march=no else :; fi # rm conftezt.out.2 - + fi @@ -1620,55 +3982,84 @@ CXXFLAGS="$CXXFLAGS -march=$with_march" ;; esac - echo "$ac_t""yes" 1>&6 - + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else - echo "$ac_t""no" 1>&6 - { echo "configure: error: Please specify a working value for --with-march, or use --without-march" 1>&2; exit 1; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + { { echo "$as_me:$LINENO: error: Please specify a working value for --with-march, or use --without-march" >&5 +echo "$as_me: error: Please specify a working value for --with-march, or use --without-march" >&2;} + { (exit 1); exit 1; }; } fi unset snes9x_cv_option_custom_march fi - echo $ac_n "checking -O2""... $ac_c" 1>&6 -echo "configure:1636: checking -O2" >&5 - if eval "test \"`echo '$''{'snes9x_cv_option_o2'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + { echo "$as_me:$LINENO: checking -O2" >&5 +echo $ECHO_N "checking -O2... $ECHO_C" >&6; } + if test "${snes9x_cv_option_o2+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + OLD_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$OLD_CXXFLAGS -O2" old_ac_link="$ac_link" ac_link="$old_ac_link 2>conftezt.out.2" if test "$cross_compiling" = yes; then - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -; return 0; } -EOF -if { (eval echo configure:1655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then snes9x_cv_option_o2=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_option_o2=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + snes9x_cv_option_o2=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int foo; int main(int argc, char **argv) @@ -1679,20 +4070,41 @@ if (argc > 0) argc = 0; return argc; } - -EOF -if { (eval echo configure:1685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then snes9x_cv_option_o2=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - snes9x_cv_option_o2=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +snes9x_cv_option_o2=no fi -rm -fr conftest* +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + CXXFLAGS="$OLD_CXXFLAGS" ac_link="$old_ac_link" if grep -i 'unrecognized option' /dev/null; then @@ -1706,7 +4118,7 @@ elif grep -i 'optimizer bugs' /dev/null; then # gcc/FreeBSD-4.6/alpha says the following regarding -O2: # - # cc1: warning: + # cc1: warning: # *** # *** The -O2 flag TRIGGERS KNOWN OPTIMIZER BUGS ON THIS PLATFORM # *** @@ -1723,7 +4135,7 @@ snes9x_cv_option_o2=no else :; fi # rm conftezt.out.2 - + fi @@ -1734,50 +4146,77 @@ CXXFLAGS="$CXXFLAGS -O2" ;; esac - echo "$ac_t""yes" 1>&6 - + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else - echo "$ac_t""no" 1>&6 - - - echo $ac_n "checking -O1""... $ac_c" 1>&6 -echo "configure:1745: checking -O1" >&5 - if eval "test \"`echo '$''{'snes9x_cv_option_o1'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + + + { echo "$as_me:$LINENO: checking -O1" >&5 +echo $ECHO_N "checking -O1... $ECHO_C" >&6; } + if test "${snes9x_cv_option_o1+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + OLD_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$OLD_CXXFLAGS -O1" old_ac_link="$ac_link" ac_link="$old_ac_link 2>conftezt.out.2" if test "$cross_compiling" = yes; then - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -; return 0; } -EOF -if { (eval echo configure:1764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then snes9x_cv_option_o1=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_option_o1=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + snes9x_cv_option_o1=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int foo; int main(int argc, char **argv) @@ -1788,20 +4227,41 @@ if (argc > 0) argc = 0; return argc; } - -EOF -if { (eval echo configure:1794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then snes9x_cv_option_o1=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - snes9x_cv_option_o1=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +snes9x_cv_option_o1=no fi -rm -fr conftest* +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + CXXFLAGS="$OLD_CXXFLAGS" ac_link="$old_ac_link" if grep -i 'unrecognized option' /dev/null; then @@ -1815,7 +4275,7 @@ elif grep -i 'optimizer bugs' /dev/null; then # gcc/FreeBSD-4.6/alpha says the following regarding -O2: # - # cc1: warning: + # cc1: warning: # *** # *** The -O2 flag TRIGGERS KNOWN OPTIMIZER BUGS ON THIS PLATFORM # *** @@ -1832,7 +4292,7 @@ snes9x_cv_option_o1=no else :; fi # rm conftezt.out.2 - + fi @@ -1843,11 +4303,13 @@ CXXFLAGS="$CXXFLAGS -O1" ;; esac - echo "$ac_t""yes" 1>&6 - + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else - echo "$ac_t""no" 1>&6 - + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi @@ -1855,44 +4317,69 @@ - echo $ac_n "checking -fomit-frame-pointer""... $ac_c" 1>&6 -echo "configure:1860: checking -fomit-frame-pointer" >&5 - if eval "test \"`echo '$''{'snes9x_cv_option_omit_frame_pointer'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + { echo "$as_me:$LINENO: checking -fomit-frame-pointer" >&5 +echo $ECHO_N "checking -fomit-frame-pointer... $ECHO_C" >&6; } + if test "${snes9x_cv_option_omit_frame_pointer+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + OLD_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$OLD_CXXFLAGS -fomit-frame-pointer" old_ac_link="$ac_link" ac_link="$old_ac_link 2>conftezt.out.2" if test "$cross_compiling" = yes; then - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -; return 0; } -EOF -if { (eval echo configure:1879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then snes9x_cv_option_omit_frame_pointer=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_option_omit_frame_pointer=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + snes9x_cv_option_omit_frame_pointer=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int foo; int main(int argc, char **argv) @@ -1903,20 +4390,41 @@ if (argc > 0) argc = 0; return argc; } - -EOF -if { (eval echo configure:1909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then snes9x_cv_option_omit_frame_pointer=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - snes9x_cv_option_omit_frame_pointer=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +snes9x_cv_option_omit_frame_pointer=no fi -rm -fr conftest* +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + CXXFLAGS="$OLD_CXXFLAGS" ac_link="$old_ac_link" if grep -i 'unrecognized option' /dev/null; then @@ -1930,7 +4438,7 @@ elif grep -i 'optimizer bugs' /dev/null; then # gcc/FreeBSD-4.6/alpha says the following regarding -O2: # - # cc1: warning: + # cc1: warning: # *** # *** The -O2 flag TRIGGERS KNOWN OPTIMIZER BUGS ON THIS PLATFORM # *** @@ -1947,7 +4455,7 @@ snes9x_cv_option_omit_frame_pointer=no else :; fi # rm conftezt.out.2 - + fi @@ -1958,163 +4466,80 @@ CXXFLAGS="$CXXFLAGS -fomit-frame-pointer" ;; esac - echo "$ac_t""yes" 1>&6 - + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else - echo "$ac_t""no" 1>&6 - + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi +#AC_SYS_COMPILER_FLAG(-fno-exceptions, no_exceptions, OPTIMIZE) - echo $ac_n "checking -fno-exceptions""... $ac_c" 1>&6 -echo "configure:1971: checking -fno-exceptions" >&5 - if eval "test \"`echo '$''{'snes9x_cv_option_no_exceptions'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + { echo "$as_me:$LINENO: checking -Wall" >&5 +echo $ECHO_N "checking -Wall... $ECHO_C" >&6; } + if test "${snes9x_cv_option_Wall+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + OLD_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$OLD_CXXFLAGS -fno-exceptions" + CXXFLAGS="$OLD_CXXFLAGS -Wall" old_ac_link="$ac_link" ac_link="$old_ac_link 2>conftezt.out.2" if test "$cross_compiling" = yes; then - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -; return 0; } -EOF -if { (eval echo configure:1990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - snes9x_cv_option_no_exceptions=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_option_no_exceptions=no -fi -rm -f conftest* - -else - cat > conftest.$ac_ext < 0) argc = 0; - return argc; - } - -EOF -if { (eval echo configure:2020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - snes9x_cv_option_no_exceptions=yes + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + snes9x_cv_option_Wall=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - snes9x_cv_option_no_exceptions=no -fi -rm -fr conftest* -fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - CXXFLAGS="$OLD_CXXFLAGS" - ac_link="$old_ac_link" - if grep -i 'unrecognized option' /dev/null; then - snes9x_cv_option_no_exceptions=no - elif grep -i 'unknown option' /dev/null; then - # cc/HPUX says the following regarding -q64: - # - # cc: warning 422: Unknown option "6" ignored. - # cc: warning 422: Unknown option "4" ignored. - snes9x_cv_option_no_exceptions=no - elif grep -i 'optimizer bugs' /dev/null; then - # gcc/FreeBSD-4.6/alpha says the following regarding -O2: - # - # cc1: warning: - # *** - # *** The -O2 flag TRIGGERS KNOWN OPTIMIZER BUGS ON THIS PLATFORM - # *** - snes9x_cv_option_no_exceptions=no - elif grep -i 'not found' /dev/null; then - # cc/AIX says the following regarding +O3: - # - # cc: 1501-228 input file +O3 not found - snes9x_cv_option_no_exceptions=no - elif grep -i 'ignored' /dev/null; then - # gcc/AIX says the following regarding -fpic: - # - # cc1: warning: -fpic ignored (all code is position independent) - snes9x_cv_option_no_exceptions=no - else :; fi -# rm conftezt.out.2 - + snes9x_cv_option_Wall=no fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext - if test x"$snes9x_cv_option_no_exceptions" = "xyes" ; then - OPTIMIZE="$OPTIMIZE -fno-exceptions" - case "OPTIMIZE" in - OPTIMIZE) - CXXFLAGS="$CXXFLAGS -fno-exceptions" - ;; - esac - echo "$ac_t""yes" 1>&6 - - else - echo "$ac_t""no" 1>&6 - - fi - - - echo $ac_n "checking -Wall""... $ac_c" 1>&6 -echo "configure:2082: checking -Wall" >&5 - if eval "test \"`echo '$''{'snes9x_cv_option_Wall'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - - OLD_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$OLD_CXXFLAGS -Wall" - old_ac_link="$ac_link" - ac_link="$old_ac_link 2>conftezt.out.2" - if test "$cross_compiling" = yes; then - - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - snes9x_cv_option_Wall=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_option_Wall=no -fi -rm -f conftest* - else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int foo; int main(int argc, char **argv) @@ -2125,20 +4550,41 @@ if (argc > 0) argc = 0; return argc; } - -EOF -if { (eval echo configure:2131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then snes9x_cv_option_Wall=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - snes9x_cv_option_Wall=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +snes9x_cv_option_Wall=no fi -rm -fr conftest* +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + CXXFLAGS="$OLD_CXXFLAGS" ac_link="$old_ac_link" if grep -i 'unrecognized option' /dev/null; then @@ -2152,7 +4598,7 @@ elif grep -i 'optimizer bugs' /dev/null; then # gcc/FreeBSD-4.6/alpha says the following regarding -O2: # - # cc1: warning: + # cc1: warning: # *** # *** The -O2 flag TRIGGERS KNOWN OPTIMIZER BUGS ON THIS PLATFORM # *** @@ -2169,7 +4615,7 @@ snes9x_cv_option_Wall=no else :; fi # rm conftezt.out.2 - + fi @@ -2180,52 +4626,79 @@ CXXFLAGS="$CXXFLAGS -Wall" ;; esac - echo "$ac_t""yes" 1>&6 - + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else - echo "$ac_t""no" 1>&6 - + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi - echo $ac_n "checking -W""... $ac_c" 1>&6 -echo "configure:2193: checking -W" >&5 - if eval "test \"`echo '$''{'snes9x_cv_option_W'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + { echo "$as_me:$LINENO: checking -W" >&5 +echo $ECHO_N "checking -W... $ECHO_C" >&6; } + if test "${snes9x_cv_option_W+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + OLD_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$OLD_CXXFLAGS -W" old_ac_link="$ac_link" ac_link="$old_ac_link 2>conftezt.out.2" if test "$cross_compiling" = yes; then - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -; return 0; } -EOF -if { (eval echo configure:2212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then snes9x_cv_option_W=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_option_W=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + snes9x_cv_option_W=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int foo; int main(int argc, char **argv) @@ -2236,20 +4709,41 @@ if (argc > 0) argc = 0; return argc; } - -EOF -if { (eval echo configure:2242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then snes9x_cv_option_W=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - snes9x_cv_option_W=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +snes9x_cv_option_W=no fi -rm -fr conftest* +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + CXXFLAGS="$OLD_CXXFLAGS" ac_link="$old_ac_link" if grep -i 'unrecognized option' /dev/null; then @@ -2263,7 +4757,7 @@ elif grep -i 'optimizer bugs' /dev/null; then # gcc/FreeBSD-4.6/alpha says the following regarding -O2: # - # cc1: warning: + # cc1: warning: # *** # *** The -O2 flag TRIGGERS KNOWN OPTIMIZER BUGS ON THIS PLATFORM # *** @@ -2280,7 +4774,7 @@ snes9x_cv_option_W=no else :; fi # rm conftezt.out.2 - + fi @@ -2291,163 +4785,80 @@ CXXFLAGS="$CXXFLAGS -W" ;; esac - echo "$ac_t""yes" 1>&6 - + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else - echo "$ac_t""no" 1>&6 - + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi +#AC_SYS_COMPILER_FLAG(-pedantic, pedantic, OPTIMIZE) - echo $ac_n "checking -pedantic""... $ac_c" 1>&6 -echo "configure:2304: checking -pedantic" >&5 - if eval "test \"`echo '$''{'snes9x_cv_option_pedantic'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + { echo "$as_me:$LINENO: checking -Wno-unused-parameter" >&5 +echo $ECHO_N "checking -Wno-unused-parameter... $ECHO_C" >&6; } + if test "${snes9x_cv_option_Wno_unused_parameter+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + OLD_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$OLD_CXXFLAGS -pedantic" + CXXFLAGS="$OLD_CXXFLAGS -Wno-unused-parameter" old_ac_link="$ac_link" ac_link="$old_ac_link 2>conftezt.out.2" if test "$cross_compiling" = yes; then - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -; return 0; } -EOF -if { (eval echo configure:2323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - snes9x_cv_option_pedantic=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_option_pedantic=no -fi -rm -f conftest* - -else - cat > conftest.$ac_ext < 0) argc = 0; - return argc; - } - -EOF -if { (eval echo configure:2353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - snes9x_cv_option_pedantic=yes + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + snes9x_cv_option_Wno_unused_parameter=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - snes9x_cv_option_pedantic=no -fi -rm -fr conftest* -fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - CXXFLAGS="$OLD_CXXFLAGS" - ac_link="$old_ac_link" - if grep -i 'unrecognized option' /dev/null; then - snes9x_cv_option_pedantic=no - elif grep -i 'unknown option' /dev/null; then - # cc/HPUX says the following regarding -q64: - # - # cc: warning 422: Unknown option "6" ignored. - # cc: warning 422: Unknown option "4" ignored. - snes9x_cv_option_pedantic=no - elif grep -i 'optimizer bugs' /dev/null; then - # gcc/FreeBSD-4.6/alpha says the following regarding -O2: - # - # cc1: warning: - # *** - # *** The -O2 flag TRIGGERS KNOWN OPTIMIZER BUGS ON THIS PLATFORM - # *** - snes9x_cv_option_pedantic=no - elif grep -i 'not found' /dev/null; then - # cc/AIX says the following regarding +O3: - # - # cc: 1501-228 input file +O3 not found - snes9x_cv_option_pedantic=no - elif grep -i 'ignored' /dev/null; then - # gcc/AIX says the following regarding -fpic: - # - # cc1: warning: -fpic ignored (all code is position independent) - snes9x_cv_option_pedantic=no - else :; fi -# rm conftezt.out.2 - + snes9x_cv_option_Wno_unused_parameter=no fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext - if test x"$snes9x_cv_option_pedantic" = "xyes" ; then - OPTIMIZE="$OPTIMIZE -pedantic" - case "OPTIMIZE" in - OPTIMIZE) - CXXFLAGS="$CXXFLAGS -pedantic" - ;; - esac - echo "$ac_t""yes" 1>&6 - - else - echo "$ac_t""no" 1>&6 - - fi - - - echo $ac_n "checking -Wno-unused-parameter""... $ac_c" 1>&6 -echo "configure:2415: checking -Wno-unused-parameter" >&5 - if eval "test \"`echo '$''{'snes9x_cv_option_Wno_unused_parameter'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 else - - OLD_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$OLD_CXXFLAGS -Wno-unused-parameter" - old_ac_link="$ac_link" - ac_link="$old_ac_link 2>conftezt.out.2" - if test "$cross_compiling" = yes; then - - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - snes9x_cv_option_Wno_unused_parameter=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_option_Wno_unused_parameter=no -fi -rm -f conftest* - -else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int foo; int main(int argc, char **argv) @@ -2458,20 +4869,41 @@ if (argc > 0) argc = 0; return argc; } - -EOF -if { (eval echo configure:2464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then snes9x_cv_option_Wno_unused_parameter=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - snes9x_cv_option_Wno_unused_parameter=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +snes9x_cv_option_Wno_unused_parameter=no fi -rm -fr conftest* +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + CXXFLAGS="$OLD_CXXFLAGS" ac_link="$old_ac_link" if grep -i 'unrecognized option' /dev/null; then @@ -2485,7 +4917,7 @@ elif grep -i 'optimizer bugs' /dev/null; then # gcc/FreeBSD-4.6/alpha says the following regarding -O2: # - # cc1: warning: + # cc1: warning: # *** # *** The -O2 flag TRIGGERS KNOWN OPTIMIZER BUGS ON THIS PLATFORM # *** @@ -2502,7 +4934,7 @@ snes9x_cv_option_Wno_unused_parameter=no else :; fi # rm conftezt.out.2 - + fi @@ -2513,52 +4945,79 @@ CXXFLAGS="$CXXFLAGS -Wno-unused-parameter" ;; esac - echo "$ac_t""yes" 1>&6 - + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else - echo "$ac_t""no" 1>&6 - + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi - echo $ac_n "checking -pipe""... $ac_c" 1>&6 -echo "configure:2526: checking -pipe" >&5 - if eval "test \"`echo '$''{'snes9x_cv_option_pipe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + { echo "$as_me:$LINENO: checking -pipe" >&5 +echo $ECHO_N "checking -pipe... $ECHO_C" >&6; } + if test "${snes9x_cv_option_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + OLD_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$OLD_CXXFLAGS -pipe" old_ac_link="$ac_link" ac_link="$old_ac_link 2>conftezt.out.2" if test "$cross_compiling" = yes; then - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -; return 0; } -EOF -if { (eval echo configure:2545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then snes9x_cv_option_pipe=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_option_pipe=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + snes9x_cv_option_pipe=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int foo; int main(int argc, char **argv) @@ -2569,20 +5028,41 @@ if (argc > 0) argc = 0; return argc; } - -EOF -if { (eval echo configure:2575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then snes9x_cv_option_pipe=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - snes9x_cv_option_pipe=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +snes9x_cv_option_pipe=no fi -rm -fr conftest* +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + CXXFLAGS="$OLD_CXXFLAGS" ac_link="$old_ac_link" if grep -i 'unrecognized option' /dev/null; then @@ -2596,7 +5076,7 @@ elif grep -i 'optimizer bugs' /dev/null; then # gcc/FreeBSD-4.6/alpha says the following regarding -O2: # - # cc1: warning: + # cc1: warning: # *** # *** The -O2 flag TRIGGERS KNOWN OPTIMIZER BUGS ON THIS PLATFORM # *** @@ -2613,7 +5093,7 @@ snes9x_cv_option_pipe=no else :; fi # rm conftezt.out.2 - + fi @@ -2624,52 +5104,79 @@ CXXFLAGS="$CXXFLAGS -pipe" ;; esac - echo "$ac_t""yes" 1>&6 - + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else - echo "$ac_t""no" 1>&6 - + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi - echo $ac_n "checking -fno-rtti""... $ac_c" 1>&6 -echo "configure:2637: checking -fno-rtti" >&5 - if eval "test \"`echo '$''{'snes9x_cv_option_no_rtti'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + { echo "$as_me:$LINENO: checking -fno-rtti" >&5 +echo $ECHO_N "checking -fno-rtti... $ECHO_C" >&6; } + if test "${snes9x_cv_option_no_rtti+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + OLD_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$OLD_CXXFLAGS -fno-rtti" old_ac_link="$ac_link" ac_link="$old_ac_link 2>conftezt.out.2" if test "$cross_compiling" = yes; then - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -; return 0; } -EOF -if { (eval echo configure:2656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then snes9x_cv_option_no_rtti=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_option_no_rtti=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + snes9x_cv_option_no_rtti=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int foo; int main(int argc, char **argv) @@ -2680,20 +5187,41 @@ if (argc > 0) argc = 0; return argc; } - -EOF -if { (eval echo configure:2686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then snes9x_cv_option_no_rtti=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - snes9x_cv_option_no_rtti=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +snes9x_cv_option_no_rtti=no fi -rm -fr conftest* +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + CXXFLAGS="$OLD_CXXFLAGS" ac_link="$old_ac_link" if grep -i 'unrecognized option' /dev/null; then @@ -2707,7 +5235,7 @@ elif grep -i 'optimizer bugs' /dev/null; then # gcc/FreeBSD-4.6/alpha says the following regarding -O2: # - # cc1: warning: + # cc1: warning: # *** # *** The -O2 flag TRIGGERS KNOWN OPTIMIZER BUGS ON THIS PLATFORM # *** @@ -2724,7 +5252,7 @@ snes9x_cv_option_no_rtti=no else :; fi # rm conftezt.out.2 - + fi @@ -2735,11 +5263,13 @@ CXXFLAGS="$CXXFLAGS -fno-rtti" ;; esac - echo "$ac_t""yes" 1>&6 - + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else - echo "$ac_t""no" 1>&6 - + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi @@ -2747,47 +5277,74 @@ with_extra_opt=no fi if test no != "$with_extra_opt" ; then - echo "configure: warning: You specified --with-extra-opt. I hope you know what you're doing, since" 1>&2 - echo "configure: warning: *** MISUSING THIS OPTION WILL CAUSE SNES9X TO CRASH! ***" 1>&2 - - echo $ac_n "checking $with_extra_opt""... $ac_c" 1>&6 -echo "configure:2755: checking $with_extra_opt" >&5 - if eval "test \"`echo '$''{'snes9x_cv_option_custom_opt'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + { echo "$as_me:$LINENO: WARNING: You specified --with-extra-opt. I hope you know what you're doing, since" >&5 +echo "$as_me: WARNING: You specified --with-extra-opt. I hope you know what you're doing, since" >&2;} + { echo "$as_me:$LINENO: WARNING: *** MISUSING THIS OPTION WILL CAUSE SNES9X TO CRASH! ***" >&5 +echo "$as_me: WARNING: *** MISUSING THIS OPTION WILL CAUSE SNES9X TO CRASH! ***" >&2;} + + { echo "$as_me:$LINENO: checking $with_extra_opt" >&5 +echo $ECHO_N "checking $with_extra_opt... $ECHO_C" >&6; } + if test "${snes9x_cv_option_custom_opt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + OLD_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$OLD_CXXFLAGS $with_extra_opt" old_ac_link="$ac_link" ac_link="$old_ac_link 2>conftezt.out.2" if test "$cross_compiling" = yes; then - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -; return 0; } -EOF -if { (eval echo configure:2774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then snes9x_cv_option_custom_opt=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_option_custom_opt=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + snes9x_cv_option_custom_opt=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ int foo; int main(int argc, char **argv) @@ -2798,20 +5355,41 @@ if (argc > 0) argc = 0; return argc; } - -EOF -if { (eval echo configure:2804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then snes9x_cv_option_custom_opt=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - snes9x_cv_option_custom_opt=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +snes9x_cv_option_custom_opt=no fi -rm -fr conftest* +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + CXXFLAGS="$OLD_CXXFLAGS" ac_link="$old_ac_link" if grep -i 'unrecognized option' /dev/null; then @@ -2825,7 +5403,7 @@ elif grep -i 'optimizer bugs' /dev/null; then # gcc/FreeBSD-4.6/alpha says the following regarding -O2: # - # cc1: warning: + # cc1: warning: # *** # *** The -O2 flag TRIGGERS KNOWN OPTIMIZER BUGS ON THIS PLATFORM # *** @@ -2842,7 +5420,7 @@ snes9x_cv_option_custom_opt=no else :; fi # rm conftezt.out.2 - + fi @@ -2853,11 +5431,15 @@ CXXFLAGS="$CXXFLAGS $with_extra_opt" ;; esac - echo "$ac_t""yes" 1>&6 - + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else - echo "$ac_t""no" 1>&6 - { echo "configure: error: Please specify a working value for --with-extra-opt, or use --without-extra-opt" 1>&2; exit 1; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + { { echo "$as_me:$LINENO: error: Please specify a working value for --with-extra-opt, or use --without-extra-opt" >&5 +echo "$as_me: error: Please specify a working value for --with-extra-opt, or use --without-extra-opt" >&2;} + { (exit 1); exit 1; }; } fi unset snes9x_cv_option_custom_opt @@ -2880,26 +5462,26 @@ NASM='not_found' -# Check whether --with-glide or --without-glide was given. + +# Check whether --with-glide was given. if test "${with_glide+set}" = set; then - withval="$with_glide" - : + withval=$with_glide; else with_glide=no fi -# Check whether --with-opengl or --without-opengl was given. + +# Check whether --with-opengl was given. if test "${with_opengl+set}" = set; then - withval="$with_opengl" - : + withval=$with_opengl; else with_opengl=no fi -# Check whether --with-aido or --without-aido was given. + +# Check whether --with-aido was given. if test "${with_aido+set}" = set; then - withval="$with_aido" - : + withval=$with_aido; else with_aido=no fi @@ -2926,15 +5508,18 @@ -echo $ac_n "checking if the CPU is IA32""... $ac_c" 1>&6 -echo "configure:2931: checking if the CPU is IA32" >&5 -if eval "test \"`echo '$''{'snes9x_cv_i386_cpu'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +{ echo "$as_me:$LINENO: checking if the CPU is IA32" >&5 +echo $ECHO_N "checking if the CPU is IA32... $ECHO_C" >&6; } +if test "${snes9x_cv_i386_cpu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #if (defined (__i386__) || defined (__i486__) ||\ defined (__i586__) || defined (__WIN32__) || defined (__DJGPP)) @@ -2942,132 +5527,225 @@ #else #error Not i386. #endif - -int main() { -; return 0; } -EOF -if { (eval echo configure:2951: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then snes9x_cv_i386_cpu=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_i386_cpu=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + snes9x_cv_i386_cpu=no fi -rm -f conftest* + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$snes9x_cv_i386_cpu" 1>&6 +{ echo "$as_me:$LINENO: result: $snes9x_cv_i386_cpu" >&5 +echo "${ECHO_T}$snes9x_cv_i386_cpu" >&6; } -echo $ac_n "checking if the OS is Linux""... $ac_c" 1>&6 -echo "configure:2966: checking if the OS is Linux" >&5 -if eval "test \"`echo '$''{'snes9x_cv_linux_os'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +{ echo "$as_me:$LINENO: checking if the OS is Linux" >&5 +echo $ECHO_N "checking if the OS is Linux... $ECHO_C" >&6; } +if test "${snes9x_cv_linux_os+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #ifdef __linux /* */ #else #error Not Linux. #endif - -int main() { -; return 0; } -EOF -if { (eval echo configure:2985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then snes9x_cv_linux_os=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_linux_os=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + snes9x_cv_linux_os=no fi -rm -f conftest* + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$snes9x_cv_linux_os" 1>&6 +{ echo "$as_me:$LINENO: result: $snes9x_cv_linux_os" >&5 +echo "${ECHO_T}$snes9x_cv_linux_os" >&6; } -echo $ac_n "checking if the OS is HP-UX""... $ac_c" 1>&6 -echo "configure:3000: checking if the OS is HP-UX" >&5 -if eval "test \"`echo '$''{'snes9x_cv_hpux_os'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +{ echo "$as_me:$LINENO: checking if the OS is HP-UX" >&5 +echo $ECHO_N "checking if the OS is HP-UX... $ECHO_C" >&6; } +if test "${snes9x_cv_hpux_os+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #ifdef __hpux /* */ #else #error Not Hpux. #endif - -int main() { -; return 0; } -EOF -if { (eval echo configure:3019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then snes9x_cv_hpux_os=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_hpux_os=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + snes9x_cv_hpux_os=no fi -rm -f conftest* + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$snes9x_cv_hpux_os" 1>&6 +{ echo "$as_me:$LINENO: result: $snes9x_cv_hpux_os" >&5 +echo "${ECHO_T}$snes9x_cv_hpux_os" >&6; } -echo $ac_n "checking if the OS is MS Windows""... $ac_c" 1>&6 -echo "configure:3034: checking if the OS is MS Windows" >&5 -if eval "test \"`echo '$''{'snes9x_cv_win32_os'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +{ echo "$as_me:$LINENO: checking if the OS is MS Windows" >&5 +echo $ECHO_N "checking if the OS is MS Windows... $ECHO_C" >&6; } +if test "${snes9x_cv_win32_os+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #if defined (__WIN32__) /* */ #else #error Not win32. #endif - -int main() { -; return 0; } -EOF -if { (eval echo configure:3053: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then snes9x_cv_win32_os=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_win32_os=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + snes9x_cv_win32_os=no fi -rm -f conftest* + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$snes9x_cv_win32_os" 1>&6 +{ echo "$as_me:$LINENO: result: $snes9x_cv_win32_os" >&5 +echo "${ECHO_T}$snes9x_cv_win32_os" >&6; } -# Check whether --with-assembler or --without-assembler was given. + +# Check whether --with-assembler was given. if test "${with_assembler+set}" = set; then - withval="$with_assembler" - : + withval=$with_assembler; else with_assembler=yes fi @@ -3076,8 +5754,8 @@ if test yes = "$with_assembler"; then if test yes = "$snes9x_cv_win32_os"; then NASM='rntcl' - - + + cat >snes9x_using_asm_cores.feature <&6 -echo "configure:3090: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_prog_nasm'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_prog_nasm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$prog_nasm" in - /*) + case $prog_nasm in + [\\/]* | ?:[\\/]*) ac_cv_path_prog_nasm="$prog_nasm" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_prog_nasm="$prog_nasm" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_prog_nasm="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_prog_nasm="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + test -z "$ac_cv_path_prog_nasm" && ac_cv_path_prog_nasm="no" ;; esac fi -prog_nasm="$ac_cv_path_prog_nasm" +prog_nasm=$ac_cv_path_prog_nasm if test -n "$prog_nasm"; then - echo "$ac_t""$prog_nasm" 1>&6 + { echo "$as_me:$LINENO: result: $prog_nasm" >&5 +echo "${ECHO_T}$prog_nasm" >&6; } else - echo "$ac_t""no" 1>&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + if test "x$ac_cv_path_prog_nasm" = "xno"; then if test yes = "$snes9x_cv_i386_cpu"; then - echo "configure: warning: No nasm found. Will build without assembler optimizations." 1>&2 - - + { echo "$as_me:$LINENO: WARNING: No nasm found. Will build without assembler optimizations." >&5 +echo "$as_me: WARNING: No nasm found. Will build without assembler optimizations." >&2;} + + cat >snes9x_using_asm_cores.feature <snes9x_using_asm_cores.feature <snes9x_using_asm_cores.feature <snes9x_using_asm_cores.feature <snes9x_Gz.feature <&6 -echo "configure:3289: checking how to run the C++ preprocessor" >&5 + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } if test -z "$CXXCPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_ext=C -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cxx_cross - CXXCPP="${CXX-g++} -E" - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3307: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CXXCPP=/lib/cpp + ac_cv_header_stdc=no fi rm -f conftest* - ac_cv_prog_CXXCPP="$CXXCPP" -ac_ext=C -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cxx_cross + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no fi +rm -f conftest* + fi -CXXCPP="$ac_cv_prog_CXXCPP" -echo "$ac_t""$CXXCPP" 1>&6 -for ac_hdr in zlib.h +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3335: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" fi -rm -f conftest* + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in zlib.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else - echo "$ac_t""no" 1>&6 + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + done if test $ac_cv_header_zlib_h = yes ; then - echo $ac_n "checking if zlib.h is new enough""... $ac_c" 1>&6 -echo "configure:3373: checking if zlib.h is new enough" >&5 - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking if zlib.h is new enough... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include - -int main() { + +int +main () +{ int foo = (int)(Z_NO_COMPRESSION | Z_VERSION_ERROR); - -; return 0; } -EOF -if { (eval echo configure:3386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - echo "$ac_t""yes" 1>&6 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - echo "$ac_t""no" 1>&6; ac_cv_header_zlib_h=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; }; ac_cv_header_zlib_h=no fi -rm -f conftest* - - +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + + + cat >snes9x_Gz.feature <&6 -echo "configure:3408: checking for __vtbl__9type_info in -lCsup" >&5 -ac_lib_var=`echo Csup'_'__vtbl__9type_info | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + +{ echo "$as_me:$LINENO: checking for __vtbl__9type_info in -lCsup" >&5 +echo $ECHO_N "checking for __vtbl__9type_info in -lCsup... $ECHO_C" >&6; } +if test "${ac_cv_lib_Csup___vtbl__9type_info+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lCsup $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char __vtbl__9type_info(); - -int main() { -__vtbl__9type_info() -; return 0; } -EOF -if { (eval echo configure:3430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" +char __vtbl__9type_info (); +int +main () +{ +return __vtbl__9type_info (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_Csup___vtbl__9type_info=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_Csup___vtbl__9type_info=no fi -rm -f conftest* -LIBS="$ac_save_LIBS" +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo Csup | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_cv_lib_Csup___vtbl__9type_info" >&6; } +if test $ac_cv_lib_Csup___vtbl__9type_info = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCSUP 1 +_ACEOF LIBS="-lCsup $LIBS" -else - echo "$ac_t""no" 1>&6 fi if test "$ac_cv_lib_Csup___vtbl__9type_info" = "yes" ; then :; else - echo $ac_n "checking for __vtbl__9type_info in -lC""... $ac_c" 1>&6 -echo "configure:3459: checking for __vtbl__9type_info in -lC" >&5 -ac_lib_var=`echo C'_'__vtbl__9type_info | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + +{ echo "$as_me:$LINENO: checking for __vtbl__9type_info in -lC" >&5 +echo $ECHO_N "checking for __vtbl__9type_info in -lC... $ECHO_C" >&6; } +if test "${ac_cv_lib_C___vtbl__9type_info+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lC $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char __vtbl__9type_info(); - -int main() { -__vtbl__9type_info() -; return 0; } -EOF -if { (eval echo configure:3481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" +char __vtbl__9type_info (); +int +main () +{ +return __vtbl__9type_info (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_C___vtbl__9type_info=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_C___vtbl__9type_info=no fi -rm -f conftest* -LIBS="$ac_save_LIBS" +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo C | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_cv_lib_C___vtbl__9type_info" >&6; } +if test $ac_cv_lib_C___vtbl__9type_info = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBC 1 +_ACEOF LIBS="-lC $LIBS" -else - echo "$ac_t""no" 1>&6 fi fi - echo $ac_n "checking for __T_9__nothrow in -lCsup""... $ac_c" 1>&6 -echo "configure:3510: checking for __T_9__nothrow in -lCsup" >&5 -ac_lib_var=`echo Csup'_'__T_9__nothrow | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + +{ echo "$as_me:$LINENO: checking for __T_9__nothrow in -lCsup" >&5 +echo $ECHO_N "checking for __T_9__nothrow in -lCsup... $ECHO_C" >&6; } +if test "${ac_cv_lib_Csup___T_9__nothrow+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lCsup $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char __T_9__nothrow(); - -int main() { -__T_9__nothrow() -; return 0; } -EOF -if { (eval echo configure:3532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" +char __T_9__nothrow (); +int +main () +{ +return __T_9__nothrow (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_Csup___T_9__nothrow=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_Csup___T_9__nothrow=no fi -rm -f conftest* -LIBS="$ac_save_LIBS" +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo Csup | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_cv_lib_Csup___T_9__nothrow" >&6; } +if test $ac_cv_lib_Csup___T_9__nothrow = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCSUP 1 +_ACEOF LIBS="-lCsup $LIBS" -else - echo "$ac_t""no" 1>&6 fi - for ac_func in __vtbl__9type_info + +for ac_func in __vtbl__9type_info do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3562: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); -int main() { +#undef $ac_func +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -$ac_func(); #endif -; return 0; } -EOF -if { (eval echo configure:3593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" fi -rm -f conftest* + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 fi done - for ac_func in __T_9__nothrow + +for ac_func in __T_9__nothrow do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3620: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); -int main() { +#undef $ac_func +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -$ac_func(); #endif -; return 0; } -EOF -if { (eval echo configure:3651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" fi -rm -f conftest* + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 fi done fi # AC_CHECK_GZ(z,[AC_CHECK_GZ(gz,[ ac_cv_lib_z_main=no ] ) ]) - echo $ac_n "checking for gzread in -lz""... $ac_c" 1>&6 -echo "configure:3679: checking for gzread in -lz" >&5 -ac_lib_var=`echo z'_'gzread | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + { echo "$as_me:$LINENO: checking for gzread in -lz" >&5 +echo $ECHO_N "checking for gzread in -lz... $ECHO_C" >&6; } +if test "${ac_cv_lib_z_gzread+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gzread(); - -int main() { -gzread() -; return 0; } -EOF -if { (eval echo configure:3701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" +char gzread (); +int +main () +{ +return gzread (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_z_gzread=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_z_gzread=no fi -rm -f conftest* -LIBS="$ac_save_LIBS" +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - +{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzread" >&5 +echo "${ECHO_T}$ac_cv_lib_z_gzread" >&6; } +if test $ac_cv_lib_z_gzread = yes; then + SYSDEFINES="$SYSDEFINES"' -DZLIB' SYSLIBS="$SYSLIBS -lz" - - + + cat >snes9x_Gz.feature <&6 - - + + cat >snes9x_Gz.feature <&6 -echo "configure:3755: checking for png_jmpbuf in -lpng" >&5 -ac_lib_var=`echo png'_'png_jmpbuf | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + { echo "$as_me:$LINENO: checking for png_jmpbuf in -lpng" >&5 +echo $ECHO_N "checking for png_jmpbuf in -lpng... $ECHO_C" >&6; } +if test "${ac_cv_lib_png_png_jmpbuf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lpng -lz -lm $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char png_jmpbuf(); - -int main() { -png_jmpbuf() -; return 0; } -EOF -if { (eval echo configure:3777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" +char png_jmpbuf (); +int +main () +{ +return png_jmpbuf (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_png_png_jmpbuf=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_png_png_jmpbuf=no fi -rm -f conftest* -LIBS="$ac_save_LIBS" +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - +{ echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_jmpbuf" >&5 +echo "${ECHO_T}$ac_cv_lib_png_png_jmpbuf" >&6; } +if test $ac_cv_lib_png_png_jmpbuf = yes; then + SYSDEFINES="$SYSDEFINES"' -DHAVE_LIBPNG' SYSLIBS="$SYSLIBS -lpng" - -else - echo "$ac_t""no" 1>&6 + fi fi -echo $ac_n "checking for mkstemp""... $ac_c" 1>&6 -echo "configure:3805: checking for mkstemp" >&5 -if eval "test \"`echo '$''{'ac_cv_func_mkstemp'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +{ echo "$as_me:$LINENO: checking for mkstemp" >&5 +echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6; } +if test "${ac_cv_func_mkstemp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define mkstemp to an innocuous variant, in case declares mkstemp. + For example, HP-UX 11i declares gettimeofday. */ +#define mkstemp innocuous_mkstemp + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char mkstemp(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" + which can conflict with char mkstemp (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char mkstemp(); -int main() { +#undef mkstemp +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char mkstemp (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_mkstemp) || defined (__stub___mkstemp) +#if defined __stub_mkstemp || defined __stub___mkstemp choke me -#else -mkstemp(); #endif -; return 0; } -EOF -if { (eval echo configure:3836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_mkstemp=yes" +int +main () +{ +return mkstemp (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_mkstemp=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_mkstemp=no" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_mkstemp=no fi -rm -f conftest* + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_mkstemp" >&5 +echo "${ECHO_T}$ac_cv_func_mkstemp" >&6; } +if test $ac_cv_func_mkstemp = yes; then -if eval "test \"`echo '$ac_cv_func_'mkstemp`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SYSDEFINES="$SYSDEFINES"' -DHAVE_MKSTEMP' -else - echo "$ac_t""no" 1>&6 fi -# If we find X, set shell vars x_includes and x_libraries to the -# paths, otherwise set no_x=yes. -# Uses ac_ vars as temps to allow command line to override cache and checks. -# --without-x overrides everything else, but does not touch the cache. -echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:3865: checking for X" >&5 +{ echo "$as_me:$LINENO: checking for X" >&5 +echo $ECHO_N "checking for X... $ECHO_C" >&6; } -# Check whether --with-x or --without-x was given. + +# Check whether --with-x was given. if test "${with_x+set}" = set; then - withval="$with_x" - : + withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. @@ -3874,224 +7484,234 @@ # The user explicitly disabled X. have_x=disabled else - if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then - # Both variables are already set. - have_x=yes - else -if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + case $x_includes,$x_libraries in #( + *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5 +echo "$as_me: error: Cannot use X directory names containing '" >&2;} + { (exit 1); exit 1; }; };; #( + *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. -ac_x_includes=NO ac_x_libraries=NO -rm -fr conftestdir -if mkdir conftestdir; then - cd conftestdir - # Make sure to not put "make" in the Imakefile rules, since we grep it out. - cat > Imakefile <<'EOF' -acfindx: - @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' -EOF - if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then +ac_x_includes=no ac_x_libraries=no +rm -f -r conftest.dir +if mkdir conftest.dir; then + cd conftest.dir + cat >Imakefile <<'_ACEOF' +incroot: + @echo incroot='${INCROOT}' +usrlibdir: + @echo usrlibdir='${USRLIBDIR}' +libdir: + @echo libdir='${LIBDIR}' +_ACEOF + if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. - eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` + for ac_var in incroot usrlibdir libdir; do + eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" + done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl; do - if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && - test -f $ac_im_libdir/libX11.$ac_extension; then - ac_im_usrlibdir=$ac_im_libdir; break + if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && + test -f "$ac_im_libdir/libX11.$ac_extension"; then + ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. - case "$ac_im_incroot" in - /usr/include) ;; - *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;; + case $ac_im_incroot in + /usr/include) ac_x_includes= ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac - case "$ac_im_usrlibdir" in + case $ac_im_usrlibdir in /usr/lib | /lib) ;; - *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. - rm -fr conftestdir + rm -f -r conftest.dir fi -if test "$ac_x_includes" = NO; then - # Guess where to find include files, by looking for this one X11 .h file. - test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h +# Standard set of common directories for X headers. +# Check X11 before X11Rn because it is often a symlink to the current release. +ac_x_header_dirs=' +/usr/X11/include +/usr/X11R6/include +/usr/X11R5/include +/usr/X11R4/include + +/usr/include/X11 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 + +/usr/local/X11/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include + +/usr/local/include/X11 +/usr/local/include/X11R6 +/usr/local/include/X11R5 +/usr/local/include/X11R4 + +/usr/X386/include +/usr/x386/include +/usr/XFree86/include/X11 + +/usr/include +/usr/local/include +/usr/unsupported/include +/usr/athena/include +/usr/local/x11r5/include +/usr/lpp/Xamples/include + +/usr/openwin/include +/usr/openwin/share/include' +if test "$ac_x_includes" = no; then + # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3932: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then # We can compile using X headers with no special include directory. ac_x_includes= else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - # Look for the header file in a standard set of common directories. -# Check X11 before X11Rn because it is often a symlink to the current release. - for ac_dir in \ - /usr/X11/include \ - /usr/X11R6/include \ - /usr/X11R5/include \ - /usr/X11R4/include \ - \ - /usr/include/X11 \ - /usr/include/X11R6 \ - /usr/include/X11R5 \ - /usr/include/X11R4 \ - \ - /usr/local/X11/include \ - /usr/local/X11R6/include \ - /usr/local/X11R5/include \ - /usr/local/X11R4/include \ - \ - /usr/local/include/X11 \ - /usr/local/include/X11R6 \ - /usr/local/include/X11R5 \ - /usr/local/include/X11R4 \ - \ - /usr/X386/include \ - /usr/x386/include \ - /usr/XFree86/include/X11 \ - \ - /usr/include \ - /usr/local/include \ - /usr/unsupported/include \ - /usr/athena/include \ - /usr/local/x11r5/include \ - /usr/lpp/Xamples/include \ - \ - /usr/openwin/include \ - /usr/openwin/share/include \ - ; \ - do - if test -r "$ac_dir/$x_direct_test_include"; then - ac_x_includes=$ac_dir - break - fi - done -fi -rm -f conftest* -fi # $ac_x_includes = NO + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -if test "$ac_x_libraries" = NO; then - # Check for the libraries. + for ac_dir in $ac_x_header_dirs; do + if test -r "$ac_dir/X11/Xlib.h"; then + ac_x_includes=$ac_dir + break + fi +done +fi - test -z "$x_direct_test_library" && x_direct_test_library=Xt - test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc +rm -f conftest.err conftest.$ac_ext +fi # $ac_x_includes = no +if test "$ac_x_libraries" = no; then + # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. - ac_save_LIBS="$LIBS" - LIBS="-l$x_direct_test_library $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - LIBS="$ac_save_LIBS" + ac_save_LIBS=$LIBS + LIBS="-lX11 $LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +XrmInitialize () + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - LIBS="$ac_save_LIBS" -# First see if replacing the include by lib works. -# Check X11 before X11Rn because it is often a symlink to the current release. -for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ - /usr/X11/lib \ - /usr/X11R6/lib \ - /usr/X11R5/lib \ - /usr/X11R4/lib \ - \ - /usr/lib/X11 \ - /usr/lib/X11R6 \ - /usr/lib/X11R5 \ - /usr/lib/X11R4 \ - \ - /usr/local/X11/lib \ - /usr/local/X11R6/lib \ - /usr/local/X11R5/lib \ - /usr/local/X11R4/lib \ - \ - /usr/local/lib/X11 \ - /usr/local/lib/X11R6 \ - /usr/local/lib/X11R5 \ - /usr/local/lib/X11R4 \ - \ - /usr/X386/lib \ - /usr/x386/lib \ - /usr/XFree86/lib/X11 \ - \ - /usr/lib \ - /usr/local/lib \ - /usr/unsupported/lib \ - /usr/athena/lib \ - /usr/local/x11r5/lib \ - /usr/lpp/Xamples/lib \ - /lib/usr/lib/X11 \ - \ - /usr/openwin/lib \ - /usr/openwin/share/lib \ - ; \ + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + LIBS=$ac_save_LIBS +for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do + # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl; do - if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then + if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi -rm -f conftest* -fi # $ac_x_libraries = NO -if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then - # Didn't find X anywhere. Cache the known absence of X. - ac_cv_have_x="have_x=no" -else - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" -fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no + +case $ac_x_includes,$ac_x_libraries in #( + no,* | *,no | *\'*) + # Didn't find X, or a directory has "'" in its name. + ac_cv_have_x="have_x=no";; #( + *) + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$ac_x_includes'\ + ac_x_libraries='$ac_x_libraries'" +esac fi - fi +;; #( + *) have_x=yes;; + esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then - echo "$ac_t""$have_x" 1>&6 + { echo "$as_me:$LINENO: result: $have_x" >&5 +echo "${ECHO_T}$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$x_includes ac_x_libraries=$x_libraries" - echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6 + ac_cv_have_x="have_x=yes\ + ac_x_includes='$x_includes'\ + ac_x_libraries='$x_libraries'" + { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 +echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; } fi if test xyes = x$no_x ; then - echo "configure: warning: X is normally required to build on Unix." 1>&2 + { echo "$as_me:$LINENO: WARNING: X is normally required to build on Unix." >&5 +echo "$as_me: WARNING: X is normally required to build on Unix." >&2;} else X_LDFLAGS="-L$x_libraries" X_LIBS="-lX11 -lXext" @@ -4108,128 +7728,174 @@ -# Check whether --with-extensions or --without-extensions was given. + +# Check whether --with-extensions was given. if test "${with_extensions+set}" = set; then - withval="$with_extensions" - : + withval=$with_extensions; else with_extensions=yes fi if test yes = $with_extensions ; then - echo $ac_n "checking for XF86DGAQueryExtension in -lXxf86dga""... $ac_c" 1>&6 -echo "configure:4123: checking for XF86DGAQueryExtension in -lXxf86dga" >&5 -ac_lib_var=`echo Xxf86dga'_'XF86DGAQueryExtension | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + { echo "$as_me:$LINENO: checking for XF86DGAQueryExtension in -lXxf86dga" >&5 +echo $ECHO_N "checking for XF86DGAQueryExtension in -lXxf86dga... $ECHO_C" >&6; } +if test "${ac_cv_lib_Xxf86dga_XF86DGAQueryExtension+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lXxf86dga $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char XF86DGAQueryExtension(); - -int main() { -XF86DGAQueryExtension() -; return 0; } -EOF -if { (eval echo configure:4145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" +char XF86DGAQueryExtension (); +int +main () +{ +return XF86DGAQueryExtension (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_Xxf86dga_XF86DGAQueryExtension=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_Xxf86dga_XF86DGAQueryExtension=no fi -rm -f conftest* -LIBS="$ac_save_LIBS" +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - - echo $ac_n "checking for XF86VidModeQueryVersion in -lXxf86vm""... $ac_c" 1>&6 -echo "configure:4162: checking for XF86VidModeQueryVersion in -lXxf86vm" >&5 -ac_lib_var=`echo Xxf86vm'_'XF86VidModeQueryVersion | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xxf86dga_XF86DGAQueryExtension" >&5 +echo "${ECHO_T}$ac_cv_lib_Xxf86dga_XF86DGAQueryExtension" >&6; } +if test $ac_cv_lib_Xxf86dga_XF86DGAQueryExtension = yes; then + + { echo "$as_me:$LINENO: checking for XF86VidModeQueryVersion in -lXxf86vm" >&5 +echo $ECHO_N "checking for XF86VidModeQueryVersion in -lXxf86vm... $ECHO_C" >&6; } +if test "${ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lXxf86vm $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char XF86VidModeQueryVersion(); - -int main() { -XF86VidModeQueryVersion() -; return 0; } -EOF -if { (eval echo configure:4184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" +char XF86VidModeQueryVersion (); +int +main () +{ +return XF86VidModeQueryVersion (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion=no fi -rm -f conftest* -LIBS="$ac_save_LIBS" +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - +{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion" >&5 +echo "${ECHO_T}$ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion" >&6; } +if test $ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion = yes; then + SYSDEFINES="$SYSDEFINES"' -DUSE_DGA_EXTENSION -DUSE_VIDMODE_EXTENSION' SYSLIBS="$SYSLIBS"' -lXxf86dga -lXxf86vm' - - + + cat >snes9x_DGA,_vidmode.feature <&6 - - + + cat >snes9x_DGA,_vidmode.feature <&6 - - + + cat >snes9x_DGA,_vidmode.feature <snes9x_DGA,_vidmode.feature <&6 -echo "configure:4249: checking for strings.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test "${ac_cv_header_strings_h+set}" = set; then + { echo "$as_me:$LINENO: checking for strings.h" >&5 +echo $ECHO_N "checking for strings.h... $ECHO_C" >&6; } +if test "${ac_cv_header_strings_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_strings_h" >&5 +echo "${ECHO_T}$ac_cv_header_strings_h" >&6; } else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking strings.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default #include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no fi -rm -f conftest* + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking strings.h presence" >&5 +echo $ECHO_N "checking strings.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - - SYSDEFINES="$SYSDEFINES"' -DHAVE_STRINGS_H' +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: strings.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: strings.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: strings.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: strings.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: strings.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: strings.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: strings.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: strings.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: strings.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: strings.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: strings.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: strings.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: strings.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: strings.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: strings.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: strings.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for strings.h" >&5 +echo $ECHO_N "checking for strings.h... $ECHO_C" >&6; } +if test "${ac_cv_header_strings_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_t""no" 1>&6 + ac_cv_header_strings_h=$ac_header_preproc fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_strings_h" >&5 +echo "${ECHO_T}$ac_cv_header_strings_h" >&6; } +fi +if test $ac_cv_header_strings_h = yes; then -ac_safe=`echo "sys/ioctl.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for sys/ioctl.h""... $ac_c" 1>&6 -echo "configure:4285: checking for sys/ioctl.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + SYSDEFINES="$SYSDEFINES"' -DHAVE_STRINGS_H' + +fi + + + +if test "${ac_cv_header_sys_ioctl_h+set}" = set; then + { echo "$as_me:$LINENO: checking for sys/ioctl.h" >&5 +echo $ECHO_N "checking for sys/ioctl.h... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_ioctl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_ioctl_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_ioctl_h" >&6; } else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking sys/ioctl.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default #include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4295: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no fi -rm -f conftest* + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking sys/ioctl.h presence" >&5 +echo $ECHO_N "checking sys/ioctl.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - - SYSDEFINES="$SYSDEFINES"' -DHAVE_SYS_IOCTL_H' +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sys/ioctl.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sys/ioctl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/ioctl.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sys/ioctl.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sys/ioctl.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sys/ioctl.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/ioctl.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/ioctl.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/ioctl.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sys/ioctl.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/ioctl.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sys/ioctl.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/ioctl.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/ioctl.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/ioctl.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sys/ioctl.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for sys/ioctl.h" >&5 +echo $ECHO_N "checking for sys/ioctl.h... $ECHO_C" >&6; } +if test "${ac_cv_header_sys_ioctl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_t""no" 1>&6 + ac_cv_header_sys_ioctl_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_ioctl_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_ioctl_h" >&6; } + fi +if test $ac_cv_header_sys_ioctl_h = yes; then + SYSDEFINES="$SYSDEFINES"' -DHAVE_SYS_IOCTL_H' -for ac_hdr in unistd.h sys/socket.h winsock.h winsock2.h WS2tcpip.h +fi + + + + + + + + +for ac_header in unistd.h sys/socket.h winsock.h winsock2.h WS2tcpip.h do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4323: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4333: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no fi -rm -f conftest* + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_t""no" 1>&6 + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi + done -echo $ac_n "checking for the type of the last argument to accept""... $ac_c" 1>&6 -echo "configure:4363: checking for the type of the last argument to accept" >&5 -if eval "test \"`echo '$''{'snes9x_cv_accept_size_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +{ echo "$as_me:$LINENO: checking for the type of the last argument to accept" >&5 +echo $ECHO_N "checking for the type of the last argument to accept... $ECHO_C" >&6; } +if test "${snes9x_cv_accept_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + for t in socklen_t size_t int; do - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #ifndef _LARGEFILE_SOURCE # define _FILE_OFFSET_BITS 64 @@ -4400,27 +8367,49 @@ /* Here is the actual test: */ int accept(int, struct sockaddr *, $t *); - -int main() { + +int +main () +{ /* EMPTY */ - -; return 0; } -EOF -if { (eval echo configure:4411: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + snes9x_cv_accept_size_t=$t break - + else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - - cat > conftest.$ac_ext <&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #ifndef _LARGEFILE_SOURCE # define _FILE_OFFSET_BITS 64 @@ -4453,34 +8442,60 @@ /* Here is the actual test: */ SOCKET accept(SOCKET, struct sockaddr *, $t *); - -int main() { + +int +main () +{ /* EMPTY */ - -; return 0; } -EOF -if { (eval echo configure:4464: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + snes9x_cv_accept_size_t=$t break - + else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi -rm -f conftest* + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done if test "x$snes9x_cv_accept_size_t" = "x"; then # Check if it could be a Psocklen_t # Psocklen_t is a stupid typedef of socklen_t *. - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #ifndef _LARGEFILE_SOURCE # define _FILE_OFFSET_BITS 64 @@ -4513,164 +8528,331 @@ /* Here is the actual test: */ int accept(int, struct sockaddr *, Psocklen_t); - -int main() { + +int +main () +{ /* EMPTY */ - -; return 0; } -EOF -if { (eval echo configure:4524: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + snes9x_cv_accept_size_t=socklen_t - + else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # FIXME: Should probably have a warning here. # FIXME: Should we check if socklen_t exists, and use that? snes9x_cv_accept_size_t=int - + fi -rm -f conftest* + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi -echo "$ac_t""$snes9x_cv_accept_size_t *" 1>&6 -cat >> confdefs.h <&5 +echo "${ECHO_T}$snes9x_cv_accept_size_t *" >&6; } +cat >>confdefs.h <<_ACEOF #define ACCEPT_SIZE_T $snes9x_cv_accept_size_t -EOF +_ACEOF SYSDEFINES="$SYSDEFINES ""'"-DACCEPT_SIZE_T=$snes9x_cv_accept_size_t"'" -echo $ac_n "checking if _XOPEN_SOURCE_EXTENDED is defined""... $ac_c" 1>&6 -echo "configure:4555: checking if _XOPEN_SOURCE_EXTENDED is defined" >&5 -if eval "test \"`echo '$''{'snes9x_cv_xopen_source_extended'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +{ echo "$as_me:$LINENO: checking if _XOPEN_SOURCE_EXTENDED is defined" >&5 +echo $ECHO_N "checking if _XOPEN_SOURCE_EXTENDED is defined... $ECHO_C" >&6; } +if test "${snes9x_cv_xopen_source_extended+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #ifdef _XOPEN_SOURCE_EXTENDED /* */ #else #error _XOPEN_SOURCE_EXTENDED not defined. #endif - -int main() { -; return 0; } -EOF -if { (eval echo configure:4574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then snes9x_cv_xopen_source_extended=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_xopen_source_extended=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + snes9x_cv_xopen_source_extended=no fi -rm -f conftest* + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$snes9x_cv_xopen_source_extended" 1>&6 +{ echo "$as_me:$LINENO: result: $snes9x_cv_xopen_source_extended" >&5 +echo "${ECHO_T}$snes9x_cv_xopen_source_extended" >&6; } if test no = $snes9x_cv_xopen_source_extended -a \ yes = $snes9x_cv_hpux_os ; then SYSDEFINES="$SYSDEFINES"' -D_XOPEN_SOURCE_EXTENDED' -echo "$ac_t""Defining _XOPEN_SOURCE_EXTENDED since HP-UX needs it." 1>&6 +{ echo "$as_me:$LINENO: result: Defining _XOPEN_SOURCE_EXTENDED since HP-UX needs it." >&5 +echo "${ECHO_T}Defining _XOPEN_SOURCE_EXTENDED since HP-UX needs it." >&6; } fi THREAD_SOUND='#THREAD_SOUND=1' -ac_safe=`echo "pthread.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for pthread.h""... $ac_c" 1>&6 -echo "configure:4598: checking for pthread.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test "${ac_cv_header_pthread_h+set}" = set; then + { echo "$as_me:$LINENO: checking for pthread.h" >&5 +echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } +if test "${ac_cv_header_pthread_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default #include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4608: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no fi -rm -f conftest* + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking pthread.h presence" >&5 +echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - - THREAD_SOUND='THREAD_SOUND=1' +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for pthread.h" >&5 +echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } +if test "${ac_cv_header_pthread_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_t""no" 1>&6 + ac_cv_header_pthread_h=$ac_header_preproc fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } +fi +if test $ac_cv_header_pthread_h = yes; then -# Check whether --with-sound or --without-sound was given. + THREAD_SOUND='THREAD_SOUND=1' + +fi + + + + +# Check whether --with-sound was given. if test "${with_sound+set}" = set; then - withval="$with_sound" - : + withval=$with_sound; else with_sound=yes fi if test yes = "$with_sound" ; then - echo $ac_n "checking if sound is supported on this platform""... $ac_c" 1>&6 -echo "configure:4643: checking if sound is supported on this platform" >&5 - if eval "test \"`echo '$''{'snes9x_cv_sound'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + { echo "$as_me:$LINENO: checking if sound is supported on this platform" >&5 +echo $ECHO_N "checking if sound is supported on this platform... $ECHO_C" >&6; } + if test "${snes9x_cv_sound+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #if defined(__linux) || defined(__sun) || defined(__sgi) /* */ #else #error No sound for this platform #endif - -int main() { -; return 0; } -EOF -if { (eval echo configure:4662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then snes9x_cv_sound=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - snes9x_cv_sound=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + snes9x_cv_sound=no fi -rm -f conftest* + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - echo "$ac_t""$snes9x_cv_sound" 1>&6 + { echo "$as_me:$LINENO: result: $snes9x_cv_sound" >&5 +echo "${ECHO_T}$snes9x_cv_sound" >&6; } else snes9x_cv_sound=no fi @@ -4681,109 +8863,151 @@ fi -echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:4686: checking for gethostbyname in -lnsl" >&5 -ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + +{ echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 +echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; } +if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname(); - -int main() { -gethostbyname() -; return 0; } -EOF -if { (eval echo configure:4708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_nsl_gethostbyname=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_nsl_gethostbyname=no fi -rm -f conftest* -LIBS="$ac_save_LIBS" +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; } +if test $ac_cv_lib_nsl_gethostbyname = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBNSL 1 +_ACEOF LIBS="-lnsl $LIBS" -else - echo "$ac_t""no" 1>&6 fi -echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:4736: checking for socket in -lsocket" >&5 -ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + +{ echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 +echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6; } +if test "${ac_cv_lib_socket_socket+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char socket(); - -int main() { -socket() -; return 0; } -EOF -if { (eval echo configure:4758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" +char socket (); +int +main () +{ +return socket (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_socket_socket=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_socket_socket=no fi -rm -f conftest* -LIBS="$ac_save_LIBS" +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6; } +if test $ac_cv_lib_socket_socket = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSOCKET 1 +_ACEOF LIBS="-lsocket $LIBS" -else - echo "$ac_t""no" 1>&6 fi SYSLIBS="$SYSLIBS $LIBS" - + BASEDIR=`(cd $srcdir/.. ; pwd)` BUILDDIR=`pwd` @@ -4839,280 +9063,1038 @@ cat config.info -trap '' 1 2 15 -cat > confcache <<\EOF +ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. # -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. # -EOF +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. -cat > conftest.defs <<\EOF -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g -s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g -s%\[%\\&%g -s%\]%\\&%g -s%\$%$$%g -EOF -DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` -rm -f conftest.defs +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS <&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. # Run this file to recreate the current configuration. -# This directory was configured as follows, -# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# $0 $ac_configure_args -# # Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. +# configure, is in config.log if it exists. -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF -ac_given_srcdir=$srcdir +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## -trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS </dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac -# Protect against being on the right side of a sed subst in config.status. -sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; - s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@CC@%$CC%g -s%@CXX@%$CXX%g -s%@prog_nasm@%$prog_nasm%g -s%@CXXCPP@%$CXXCPP%g -s%@OPTIMIZE@%$OPTIMIZE%g -s%@RTTIFLAG@%$RTTIFLAG%g -s%@ZSNESFX@%$ZSNESFX%g -s%@ZSNESC4@%$ZSNESC4%g -s%@ASMCPU@%$ASMCPU%g -s%@ASMKREED@%$ASMKREED%g -s%@SDD1_DECOMP@%$SDD1_DECOMP%g -s%@SPC700ASM@%$SPC700ASM%g -s%@I386SPC@%$I386SPC%g -s%@THREAD_SOUND@%$THREAD_SOUND%g -s%@SYSLIBS@%$SYSLIBS%g -s%@CPUINC@%$CPUINC%g -s%@SYSDEFINES@%$SYSDEFINES%g -s%@JOYDEFINES@%$JOYDEFINES%g -s%@X_INCLUDES@%$X_INCLUDES%g -s%@BUILDDIR@%$BUILDDIR%g -s%@NASM@%$NASM%g -s%@GLIDE@%$GLIDE%g -s%@OPENGL@%$OPENGL%g -s%@AIDO@%$AIDO%g -s%@DREAMCAST@%$DREAMCAST%g -s%@JMA@%$JMA%g +fi -CEOF -EOF -cat >> $CONFIG_STATUS <<\EOF -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file + PATH_SEPARATOR=: fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false fi -EOF -cat >> $CONFIG_STATUS </dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi -CONFIG_FILES=\${CONFIG_FILES-"Makefile"} -EOF -cat >> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.61. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# Files that config.status was made for. +config_files="$ac_config_files" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2006 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; esac - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + # This is an error. + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# +# Set up the sed scripts for CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +CXX!$CXX$ac_delim +CXXFLAGS!$CXXFLAGS$ac_delim +ac_ct_CXX!$ac_ct_CXX$ac_delim +prog_nasm!$prog_nasm$ac_delim +CXXCPP!$CXXCPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +XMKMF!$XMKMF$ac_delim +OPTIMIZE!$OPTIMIZE$ac_delim +RTTIFLAG!$RTTIFLAG$ac_delim +ZSNESFX!$ZSNESFX$ac_delim +ZSNESC4!$ZSNESC4$ac_delim +ASMCPU!$ASMCPU$ac_delim +ASMKREED!$ASMKREED$ac_delim +SDD1_DECOMP!$SDD1_DECOMP$ac_delim +SPC700ASM!$SPC700ASM$ac_delim +I386SPC!$I386SPC$ac_delim +THREAD_SOUND!$THREAD_SOUND$ac_delim +SYSLIBS!$SYSLIBS$ac_delim +CPUINC!$CPUINC$ac_delim +SYSDEFINES!$SYSDEFINES$ac_delim +JOYDEFINES!$JOYDEFINES$ac_delim +X_INCLUDES!$X_INCLUDES$ac_delim +BUILDDIR!$BUILDDIR$ac_delim +NASM!$NASM$ac_delim +GLIDE!$GLIDE$ac_delim +OPENGL!$OPENGL$ac_delim +AIDO!$AIDO$ac_delim +DREAMCAST!$DREAMCAST$ac_delim +JMA!$JMA$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 76; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } else - ac_dir_suffix= ac_dots= + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi +done - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; esac - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -exit 0 -EOF + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac + ;; + + + + esac + +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi diff -NaHudr snes9x-1.43-src/snes9x/configure.in snx/snes9x/configure.in --- snes9x-1.43-src/snes9x/configure.in 2004-12-31 00:15:45.000000000 +0200 +++ snx/snes9x/configure.in 2008-02-20 15:09:18.142789436 +0200 @@ -223,10 +223,10 @@ ]) AC_SYS_COMPILER_FLAG(-fomit-frame-pointer, omit_frame_pointer, OPTIMIZE) -AC_SYS_COMPILER_FLAG(-fno-exceptions, no_exceptions, OPTIMIZE) +#AC_SYS_COMPILER_FLAG(-fno-exceptions, no_exceptions, OPTIMIZE) AC_SYS_COMPILER_FLAG(-Wall, Wall, OPTIMIZE) AC_SYS_COMPILER_FLAG(-W, W, OPTIMIZE) -AC_SYS_COMPILER_FLAG(-pedantic, pedantic, OPTIMIZE) +#AC_SYS_COMPILER_FLAG(-pedantic, pedantic, OPTIMIZE) dnl FIXME: Most of these should be fixed, but several are part of the API. AC_SYS_COMPILER_FLAG(-Wno-unused-parameter, Wno_unused_parameter, OPTIMIZE) AC_SYS_COMPILER_FLAG(-pipe, pipe, OPTIMIZE) diff -NaHudr snes9x-1.43-src/snes9x/cpu.cpp snx/snes9x/cpu.cpp --- snes9x-1.43-src/snes9x/cpu.cpp 2004-12-31 00:15:47.000000000 +0200 +++ snx/snes9x/cpu.cpp 2007-07-28 22:24:38.000000000 +0300 @@ -102,6 +102,7 @@ #include "spc7110.h" #include "obc1.h" +#include "logger.h" #ifndef ZSNES_FX #include "fxemu.h" @@ -118,7 +119,7 @@ void S9xResetCPU () { Registers.PB = 0; - Registers.PC = S9xGetWord (0xFFFC); + Registers.PC = S9xGetWord (0xFFFC, false); Registers.D.W = 0; Registers.DB = 0; Registers.SH = 1; @@ -175,6 +176,7 @@ void S9xReset (void) { + ResetLogger(); if (Settings.SuperFX) S9xResetSuperFX (); diff -NaHudr snes9x-1.43-src/snes9x/cpuexec.cpp snx/snes9x/cpuexec.cpp --- snes9x-1.43-src/snes9x/cpuexec.cpp 2004-12-31 00:15:45.000000000 +0200 +++ snx/snes9x/cpuexec.cpp 2007-07-28 22:19:50.000000000 +0300 @@ -268,6 +268,7 @@ #endif CPU.Cycles -= Settings.H_Max; + IAPU.NextAPUTimerPos -= (Settings.H_Max * 10000L); if (IAPU.APUExecuting) { @@ -345,7 +346,13 @@ } if (CPU.V_Counter == PPU.ScreenHeight + 3) - S9xUpdateJoypads (); + S9xUpdateJoypadMemory(); + + // separated from S9xUpdateJoypadMemory because the +3 was causing keypresses to be displayed 1 frame behind, + // but just removing the +3 always would cause some games (Pocky & Rocky) to fail to get input. + // (with this change, games emulate identically to before, only the keypress GUI display timing is better) + if (CPU.V_Counter == PPU.ScreenHeight) + S9xUpdateJoypadButtons(); if (CPU.V_Counter == FIRST_VISIBLE_LINE) { @@ -358,8 +365,65 @@ { RenderLine (CPU.V_Counter - FIRST_VISIBLE_LINE); } + + if(Settings.UseWIPAPUTiming) + { + + // Use TimerErrorCounter to skip update of SPC700 timers once + // every 128 updates. Needed because this section of code is called + // once every emulated 63.5 microseconds, which coresponds to + // 15.750KHz, but the SPC700 timers need to be updated at multiples + // of 8KHz, hence the error correction. + // IAPU.TimerErrorCounter++; + // if (IAPU.TimerErrorCounter >= ) + // IAPU.TimerErrorCounter = 0; + // else + { + if (APU.TimerEnabled [2]) + { + APU.Timer [2] += 4; + while (APU.Timer [2] >= APU.TimerTarget [2]) + { + IAPU.RAM [0xff] = (IAPU.RAM [0xff] + 1) & 0xf; + APU.Timer [2] -= APU.TimerTarget [2]; + #ifdef SPC700_SHUTDOWN + IAPU.WaitCounter++; + IAPU.APUExecuting = TRUE; + #endif + } + } + if (CPU.V_Counter & 1) + { + if (APU.TimerEnabled [0]) + { + APU.Timer [0]++; + if (APU.Timer [0] >= APU.TimerTarget [0]) + { + IAPU.RAM [0xfd] = (IAPU.RAM [0xfd] + 1) & 0xf; + APU.Timer [0] = 0; + #ifdef SPC700_SHUTDOWN + IAPU.WaitCounter++; + IAPU.APUExecuting = TRUE; + #endif + } + } + if (APU.TimerEnabled [1]) + { + APU.Timer [1]++; + if (APU.Timer [1] >= APU.TimerTarget [1]) + { + IAPU.RAM [0xfe] = (IAPU.RAM [0xfe] + 1) & 0xf; + APU.Timer [1] = 0; + #ifdef SPC700_SHUTDOWN + IAPU.WaitCounter++; + IAPU.APUExecuting = TRUE; + #endif + } + } + } + } + } break; - case HTIMER_BEFORE_EVENT: case HTIMER_AFTER_EVENT: if (PPU.HTimerEnabled && diff -NaHudr snes9x-1.43-src/snes9x/display.h snx/snes9x/display.h --- snes9x-1.43-src/snes9x/display.h 2004-12-31 00:15:45.000000000 +0200 +++ snx/snes9x/display.h 2005-04-09 00:59:27.000000000 +0300 @@ -107,7 +107,7 @@ void S9xDeinitDisplay (); void S9xInitInputDevices (); void S9xSetTitle (const char *title); -void S9xProcessEvents (bool8 block); +///void S9xProcessEvents (bool8 block); void S9xPutImage (int width, int height); void S9xParseDisplayArg (char **argv, int &index, int argc); void S9xToggleSoundChannel (int channel); diff -NaHudr snes9x-1.43-src/snes9x/dsp1.cpp snx/snes9x/dsp1.cpp --- snes9x-1.43-src/snes9x/dsp1.cpp 2004-12-31 00:15:45.000000000 +0200 +++ snx/snes9x/dsp1.cpp 2005-04-09 00:59:26.000000000 +0300 @@ -1023,147 +1023,147 @@ DSP4.in_index++; } - if (!DSP4.waiting4command && DSP4.in_count==DSP4.in_index) - { - //DSP4.parameters [DSP4.in_index] |= (byte << 8); - // Actually execute the command - DSP4.waiting4command = TRUE; - DSP4.out_index = 0; - DSP4.in_index=0; - switch (DSP4.command) - { - // 16-bit multiplication - case 0x0000: - { - int16 multiplier, multiplicand; - int product; - - multiplier = DSP4_READ_WORD(0); - multiplicand = DSP4_READ_WORD(2); - - DSP4_Multiply(multiplicand,multiplier,product); - - DSP4.out_count = 4; - DSP4_WRITE_WORD(0,product); - DSP4_WRITE_WORD(2,product>>16); - } - break; - - // unknown: horizontal mapping command - case 0x0011: - { - int16 a,b,c,d,m; - - a = DSP4_READ_WORD(6); - b = DSP4_READ_WORD(4); - c = DSP4_READ_WORD(2); - d = DSP4_READ_WORD(0); - - DSP4_UnknownOP11(a,b,c,d,m); - - DSP4.out_count = 2; - DSP4_WRITE_WORD(0,m); - break; - } - - // track projection - case 0x0001: DSP4_Op01(); break; - - // track projection (pass 2) - case 0x0007: DSP4_Op07(); break; - - // zone projections (fuel/repair/lap/teleport/...) - case 0x0008: DSP4_Op08(); break; - - // sprite transformation - case 0x0009: DSP4_Op09(); break; - - // fast track projection - case 0x000D: DSP4_Op0D(); break; - - // single-player selection - case 0x0003: DSP4_Op03(); break; - - // clear OAM - case 0x0005: - { - op06_index = 0; - op06_offset = 0; - for( int lcv=0; lcv<32; lcv++ ) - op06_OAM[lcv] = 0; - break; - } - - // multi-player selection - case 0x000E: DSP4_Op0E(); break; - -#undef PRINT - - // transfer OAM - case 0x0006: - { - DSP4.out_count = 32; - for( int lcv=0; lcv<32; lcv++ ) - DSP4.output[lcv] = op06_OAM[lcv]; - } - break; - - // unknown - case 0x000A: - { - int16 in1a = DSP4_READ_WORD(0); - int16 in2a = DSP4_READ_WORD(2); - int16 in3a = DSP4_READ_WORD(4); - int16 out1a,out2a,out3a,out4a; - - // NOTE: Snes9x only! - // For some odd reason, the input nybbles are reversed - - DSP4_Op0A(in2a,out1a,out2a,out3a,out4a); - - DSP4.out_count=8; - - // Hack: Reverse the outputs for now to compensate - // Otherwise the AI gets really flaky - DSP4_WRITE_WORD(0,out2a); - DSP4_WRITE_WORD(2,out1a); - DSP4_WRITE_WORD(4,out4a); - DSP4_WRITE_WORD(6,out3a); - } - break; - - // set OAM - case 0x000B: - { - int16 sp_x = DSP4_READ_WORD(0); - int16 sp_y = DSP4_READ_WORD(2); - int16 oam = DSP4_READ_WORD(4); - - if ((sp_y < 0) || ((sp_y & 0x01ff) < 0x00eb)) - { - short Row = (sp_y >> 3) & 0x1f; - - if (RowCount[Row] < MaxTilesPerRow) - { - RowCount[Row]++; - - // yield OAM output - DSP4.out_count = 6; - DSP4_WRITE_WORD(0,1); - - // pack OAM data: x,y,name,attr - DSP4.output[2] = sp_x & 0xff; - DSP4.output[3] = sp_y & 0xff; - DSP4_WRITE_WORD(4,oam); - - // OAM: size,msb data - DSP4_Op06(0,0); - } - } - } - break; - - default: break; + if (!DSP4.waiting4command && DSP4.in_count==DSP4.in_index) + { + //DSP4.parameters [DSP4.in_index] |= (byte << 8); + // Actually execute the command + DSP4.waiting4command = TRUE; + DSP4.out_index = 0; + DSP4.in_index=0; + switch (DSP4.command) + { + // 16-bit multiplication + case 0x0000: + { + int16 multiplier, multiplicand; + int product; + + multiplier = DSP4_READ_WORD(0); + multiplicand = DSP4_READ_WORD(2); + + DSP4_Multiply(multiplicand,multiplier,product); + + DSP4.out_count = 4; + DSP4_WRITE_WORD(0,product); + DSP4_WRITE_WORD(2,product>>16); + } + break; + + // unknown: horizontal mapping command + case 0x0011: + { + int16 a,b,c,d,m; + + a = DSP4_READ_WORD(6); + b = DSP4_READ_WORD(4); + c = DSP4_READ_WORD(2); + d = DSP4_READ_WORD(0); + + DSP4_UnknownOP11(a,b,c,d,m); + + DSP4.out_count = 2; + DSP4_WRITE_WORD(0,m); + break; + } + + // track projection + case 0x0001: DSP4_Op01(); break; + + // track projection (pass 2) + case 0x0007: DSP4_Op07(); break; + + // zone projections (fuel/repair/lap/teleport/...) + case 0x0008: DSP4_Op08(); break; + + // sprite transformation + case 0x0009: DSP4_Op09(); break; + + // fast track projection + case 0x000D: DSP4_Op0D(); break; + + // single-player selection + case 0x0003: DSP4_Op03(); break; + + // clear OAM + case 0x0005: + { + op06_index = 0; + op06_offset = 0; + for( int lcv=0; lcv<32; lcv++ ) + op06_OAM[lcv] = 0; + break; + } + + // multi-player selection + case 0x000E: DSP4_Op0E(); break; + +#undef PRINT + + // transfer OAM + case 0x0006: + { + DSP4.out_count = 32; + for( int lcv=0; lcv<32; lcv++ ) + DSP4.output[lcv] = op06_OAM[lcv]; + } + break; + + // unknown + case 0x000A: + { + int16 in1a = DSP4_READ_WORD(0); + int16 in2a = DSP4_READ_WORD(2); + int16 in3a = DSP4_READ_WORD(4); + int16 out1a,out2a,out3a,out4a; + + // NOTE: Snes9x only! + // For some odd reason, the input nybbles are reversed + + DSP4_Op0A(in2a,out1a,out2a,out3a,out4a); + + DSP4.out_count=8; + + // Hack: Reverse the outputs for now to compensate + // Otherwise the AI gets really flaky + DSP4_WRITE_WORD(0,out2a); + DSP4_WRITE_WORD(2,out1a); + DSP4_WRITE_WORD(4,out4a); + DSP4_WRITE_WORD(6,out3a); + } + break; + + // set OAM + case 0x000B: + { + int16 sp_x = DSP4_READ_WORD(0); + int16 sp_y = DSP4_READ_WORD(2); + int16 oam = DSP4_READ_WORD(4); + + if ((sp_y < 0) || ((sp_y & 0x01ff) < 0x00eb)) + { + short Row = (sp_y >> 3) & 0x1f; + + if (RowCount[Row] < MaxTilesPerRow) + { + RowCount[Row]++; + + // yield OAM output + DSP4.out_count = 6; + DSP4_WRITE_WORD(0,1); + + // pack OAM data: x,y,name,attr + DSP4.output[2] = sp_x & 0xff; + DSP4.output[3] = sp_y & 0xff; + DSP4_WRITE_WORD(4,oam); + + // OAM: size,msb data + DSP4_Op06(0,0); + } + } + } + break; + + default: break; } } } @@ -1192,3 +1192,4 @@ return t; } + diff -NaHudr snes9x-1.43-src/snes9x/dsp1.h snx/snes9x/dsp1.h --- snes9x-1.43-src/snes9x/dsp1.h 2004-12-31 00:15:45.000000000 +0200 +++ snx/snes9x/dsp1.h 2007-07-01 21:55:10.000000000 +0300 @@ -87,44 +87,46 @@ Nintendo Co., Limited and its subsidiary companies. *******************************************************************************/ -#ifndef _DSP1_H_ -#define _DSP1_H_ - -extern void (*SetDSP)(uint8, uint16); -extern uint8 (*GetDSP)(uint16); - -void DSP1SetByte(uint8 byte, uint16 address); -uint8 DSP1GetByte(uint16 address); - -void DSP2SetByte(uint8 byte, uint16 address); -uint8 DSP2GetByte(uint16 address); - -void DSP3SetByte(uint8 byte, uint16 address); -uint8 DSP3GetByte(uint16 address); -void DSP3_Reset(); - -void DSP4SetByte(uint8 byte, uint16 address); -uint8 DSP4GetByte(uint16 address); - -struct SDSP1 { - uint8 version; - bool8 waiting4command; - bool8 first_parameter; - uint8 command; - uint32 in_count; - uint32 in_index; - uint32 out_count; - uint32 out_index; - uint8 parameters [512]; - uint8 output [512]; -}; - -START_EXTERN_C -void S9xResetDSP1 (); -uint8 S9xGetDSP (uint16 Address); -void S9xSetDSP (uint8 Byte, uint16 Address); -END_EXTERN_C - -extern struct SDSP1 DSP1; - -#endif +#ifndef _DSP1_H_ +#define _DSP1_H_ + +extern void (*SetDSP)(uint8, uint16); +extern uint8 (*GetDSP)(uint16); + +void DSP1SetByte(uint8 byte, uint16 address); +uint8 DSP1GetByte(uint16 address); + +void DSP2SetByte(uint8 byte, uint16 address); +uint8 DSP2GetByte(uint16 address); + +void DSP3SetByte(uint8 byte, uint16 address); +uint8 DSP3GetByte(uint16 address); +void DSP3_Reset(); + +void DSP4SetByte(uint8 byte, uint16 address); +uint8 DSP4GetByte(uint16 address); + +struct SDSP1 { + uint8 version; + bool8 waiting4command; + bool8 first_parameter; + uint8 command; + uint32 in_count; + uint32 in_index; + uint32 out_count; + uint32 out_index; + uint8 parameters [512]; + uint8 output [512]; +}; + +START_EXTERN_C +void S9xResetDSP1 (); +uint8 S9xGetDSP (uint16 Address); +void S9xSetDSP (uint8 Byte, uint16 Address); + +extern struct SDSP1 DSP1; + +END_EXTERN_C + +#endif + diff -NaHudr snes9x-1.43-src/snes9x/dsp3emu.cpp snx/snes9x/dsp3emu.cpp --- snes9x-1.43-src/snes9x/dsp3emu.cpp 2004-12-31 00:15:45.000000000 +0200 +++ snx/snes9x/dsp3emu.cpp 2005-04-09 00:59:26.000000000 +0300 @@ -85,644 +85,644 @@ Super NES and Super Nintendo Entertainment System are trademarks of Nintendo Co., Limited and its subsidiary companies. -*******************************************************************************/ - -uint16 DSP3_DataROM[1024] = { - 0x8000, 0x4000, 0x2000, 0x1000, 0x0800, 0x0400, 0x0200, 0x0100, - 0x0080, 0x0040, 0x0020, 0x0010, 0x0008, 0x0004, 0x0002, 0x0001, - 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, - 0x0000, 0x000f, 0x0400, 0x0200, 0x0140, 0x0400, 0x0200, 0x0040, - 0x007d, 0x007e, 0x007e, 0x007b, 0x007c, 0x007d, 0x007b, 0x007c, - 0x0002, 0x0020, 0x0030, 0x0000, 0x000d, 0x0019, 0x0026, 0x0032, - 0x003e, 0x004a, 0x0056, 0x0062, 0x006d, 0x0079, 0x0084, 0x008e, - 0x0098, 0x00a2, 0x00ac, 0x00b5, 0x00be, 0x00c6, 0x00ce, 0x00d5, - 0x00dc, 0x00e2, 0x00e7, 0x00ec, 0x00f1, 0x00f5, 0x00f8, 0x00fb, - 0x00fd, 0x00ff, 0x0100, 0x0100, 0x0100, 0x00ff, 0x00fd, 0x00fb, - 0x00f8, 0x00f5, 0x00f1, 0x00ed, 0x00e7, 0x00e2, 0x00dc, 0x00d5, - 0x00ce, 0x00c6, 0x00be, 0x00b5, 0x00ac, 0x00a2, 0x0099, 0x008e, - 0x0084, 0x0079, 0x006e, 0x0062, 0x0056, 0x004a, 0x003e, 0x0032, - 0x0026, 0x0019, 0x000d, 0x0000, 0xfff3, 0xffe7, 0xffdb, 0xffce, - 0xffc2, 0xffb6, 0xffaa, 0xff9e, 0xff93, 0xff87, 0xff7d, 0xff72, - 0xff68, 0xff5e, 0xff54, 0xff4b, 0xff42, 0xff3a, 0xff32, 0xff2b, - 0xff25, 0xff1e, 0xff19, 0xff14, 0xff0f, 0xff0b, 0xff08, 0xff05, - 0xff03, 0xff01, 0xff00, 0xff00, 0xff00, 0xff01, 0xff03, 0xff05, - 0xff08, 0xff0b, 0xff0f, 0xff13, 0xff18, 0xff1e, 0xff24, 0xff2b, - 0xff32, 0xff3a, 0xff42, 0xff4b, 0xff54, 0xff5d, 0xff67, 0xff72, - 0xff7c, 0xff87, 0xff92, 0xff9e, 0xffa9, 0xffb5, 0xffc2, 0xffce, - 0xffda, 0xffe7, 0xfff3, 0x002b, 0x007f, 0x0020, 0x00ff, 0xff00, - 0xffbe, 0x0000, 0x0044, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xffc1, 0x0001, 0x0002, 0x0045, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0xffc5, 0x0003, 0x0004, 0x0005, 0x0047, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xffca, 0x0006, 0x0007, 0x0008, - 0x0009, 0x004a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0xffd0, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x004e, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xffd7, 0x000f, 0x0010, 0x0011, - 0x0012, 0x0013, 0x0014, 0x0053, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0xffdf, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, - 0x0059, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xffe8, 0x001c, 0x001d, 0x001e, - 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0060, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0xfff2, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, - 0x002b, 0x002c, 0x0068, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xfffd, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0071, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0xffc7, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, - 0x003e, 0x003f, 0x0040, 0x0041, 0x007b, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xffd4, 0x0000, 0x0001, 0x0002, - 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, - 0x000b, 0x0044, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0xffe2, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, - 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0050, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xfff1, 0x0019, 0x001a, 0x001b, - 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, - 0x0024, 0x0025, 0x0026, 0x005d, 0x0000, 0x0000, 0x0000, 0x0000, - 0xffcb, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, - 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, - 0x006b, 0x0000, 0x0000, 0x0000, 0xffdc, 0x0000, 0x0001, 0x0002, - 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, - 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0044, 0x0000, 0x0000, - 0xffee, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, - 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, - 0x001f, 0x0020, 0x0054, 0x0000, 0xffee, 0x0021, 0x0022, 0x0023, - 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, - 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0065, - 0xffbe, 0x0000, 0xfeac, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xffc1, 0x0001, 0x0002, 0xfead, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0xffc5, 0x0003, 0x0004, 0x0005, 0xfeaf, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xffca, 0x0006, 0x0007, 0x0008, - 0x0009, 0xfeb2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0xffd0, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0xfeb6, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xffd7, 0x000f, 0x0010, 0x0011, - 0x0012, 0x0013, 0x0014, 0xfebb, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0xffdf, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, - 0xfec1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xffe8, 0x001c, 0x001d, 0x001e, - 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0xfec8, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0xfff2, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, - 0x002b, 0x002c, 0xfed0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xfffd, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0xfed9, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0xffc7, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, - 0x003e, 0x003f, 0x0040, 0x0041, 0xfee3, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xffd4, 0x0000, 0x0001, 0x0002, - 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, - 0x000b, 0xfeac, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0xffe2, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, - 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0xfeb8, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xfff1, 0x0019, 0x001a, 0x001b, - 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, - 0x0024, 0x0025, 0x0026, 0xfec5, 0x0000, 0x0000, 0x0000, 0x0000, - 0xffcb, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, - 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, - 0xfed3, 0x0000, 0x0000, 0x0000, 0xffdc, 0x0000, 0x0001, 0x0002, - 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, - 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0xfeac, 0x0000, 0x0000, - 0xffee, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, - 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, - 0x001f, 0x0020, 0xfebc, 0x0000, 0xffee, 0x0021, 0x0022, 0x0023, - 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, - 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0xfecd, - 0x0154, 0x0218, 0x0110, 0x00b0, 0x00cc, 0x00b0, 0x0088, 0x00b0, - 0x0044, 0x00b0, 0x0000, 0x00b0, 0x00fe, 0xff07, 0x0002, 0x00ff, - 0x00f8, 0x0007, 0x00fe, 0x00ee, 0x07ff, 0x0200, 0x00ef, 0xf800, - 0x0700, 0x00ee, 0xffff, 0xffff, 0xffff, 0x0000, 0x0000, 0x0001, - 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, - 0xffff, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, - 0x0000, 0xffff, 0xffff, 0x0000, 0xffff, 0x0001, 0x0000, 0x0001, - 0x0001, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0x0000, - 0xffff, 0x0001, 0x0000, 0x0001, 0x0001, 0x0000, 0x0000, 0xffff, - 0xffff, 0xffff, 0x0000, 0x0000, 0x0000, 0x0044, 0x0088, 0x00cc, - 0x0110, 0x0154, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff -}; - -#ifdef __WIN32__ - void (__cdecl *SetDSP3)(void); -#else - void (*SetDSP3)(void); -#endif - -uint16 DSP3_DR; -uint16 DSP3_SR; -uint16 DSP3_MemoryIndex; - -void DSP3_MemorySize() -{ - DSP3_DR = 0x0300; - SetDSP3 = &DSP3_Reset; -} - -void DSP3_TestMemory() -{ - DSP3_DR = 0x0000; - SetDSP3 = &DSP3_Reset; -} - -void DSP3_DumpDataROM() -{ - DSP3_DR = DSP3_DataROM[DSP3_MemoryIndex++]; - if (DSP3_MemoryIndex == 1024) - SetDSP3 = &DSP3_Reset; -} - -void DSP3_MemoryDump() -{ - DSP3_MemoryIndex = 0; - SetDSP3 = &DSP3_DumpDataROM; - DSP3_DumpDataROM(); -} - -int16 DSP3_WinLo; -int16 DSP3_WinHi; - -void DSP3_OP06() -{ - DSP3_WinLo = (uint8)(DSP3_DR); - DSP3_WinHi = (uint8)(DSP3_DR >> 8); - DSP3_Reset(); -} - -void DSP3_OP03() -{ - int16 Lo = (uint8)(DSP3_DR); - int16 Hi = (uint8)(DSP3_DR >> 8); - int16 Ofs = (DSP3_WinLo * Hi << 1) + (Lo << 1); - DSP3_DR = Ofs >> 1; - SetDSP3 = &DSP3_Reset; -} - -int16 DSP3_AddLo; -int16 DSP3_AddHi; - -void DSP3_OP07_B() -{ - int16 Ofs = (DSP3_WinLo * DSP3_AddHi << 1) + (DSP3_AddLo << 1); - DSP3_DR = Ofs >> 1; - SetDSP3 = &DSP3_Reset; -} - -void DSP3_OP07_A() -{ - int16 Lo = (uint8)(DSP3_DR); - int16 Hi = (uint8)(DSP3_DR >> 8); - - if (Lo & 1) Hi += (DSP3_AddLo & 1); - - DSP3_AddLo += Lo; - DSP3_AddHi += Hi; - - if (DSP3_AddLo < 0) - DSP3_AddLo += DSP3_WinLo; - else - if (DSP3_AddLo >= DSP3_WinLo) - DSP3_AddLo -= DSP3_WinLo; - - if (DSP3_AddHi < 0) - DSP3_AddHi += DSP3_WinHi; - else - if (DSP3_AddHi >= DSP3_WinHi) - DSP3_AddHi -= DSP3_WinHi; - - DSP3_DR = DSP3_AddLo | (DSP3_AddHi << 8) | ((DSP3_AddHi >> 8) & 0xff); - SetDSP3 = &DSP3_OP07_B; -} - -void DSP3_OP07() -{ - uint32 dataOfs = ((DSP3_DR << 1) + 0x03b2) & 0x03ff; - - DSP3_AddHi = DSP3_DataROM[dataOfs]; - DSP3_AddLo = DSP3_DataROM[dataOfs + 1]; - - SetDSP3 = &DSP3_OP07_A; - DSP3_SR = 0x0080; -} - -uint16 DSP3_Codewords; -uint16 DSP3_Outwords; -uint16 DSP3_Symbol; -uint16 DSP3_BitCount; -uint16 DSP3_Index; -uint16 DSP3_Codes[512]; -uint16 DSP3_BitsLeft; -uint16 DSP3_ReqBits; -uint16 DSP3_ReqData; -uint16 DSP3_BitCommand; -uint8 DSP3_BaseLength; -uint16 DSP3_BaseCodes; -uint16 DSP3_BaseCode; -uint8 DSP3_CodeLengths[8]; -uint16 DSP3_CodeOffsets[8]; -uint16 DSP3_LZCode; -uint8 DSP3_LZLength; - -uint16 DSP3_X; -uint16 DSP3_Y; - -void DSP3_Coordinate() -{ - DSP3_Index++; - - switch (DSP3_Index) - { - case 3: - { - if (DSP3_DR == 0xffff) - DSP3_Reset(); - break; - } - case 4: - { - DSP3_X = DSP3_DR; - break; - } - case 5: - { - DSP3_Y = DSP3_DR; - DSP3_DR = 1; - break; - } - case 6: - { - DSP3_DR = DSP3_X; - break; - } - case 7: - { - DSP3_DR = DSP3_Y; - DSP3_Index = 0; - break; - } - } -} - -uint8 DSP3_Bitmap[8]; -uint8 DSP3_Bitplane[8]; -uint16 DSP3_BMIndex; -uint16 DSP3_BPIndex; -uint16 DSP3_Count; - -void DSP3_Convert_A() -{ - if (DSP3_BMIndex < 8) - { - DSP3_Bitmap[DSP3_BMIndex++] = (uint8) (DSP3_DR); - DSP3_Bitmap[DSP3_BMIndex++] = (uint8) (DSP3_DR >> 8); - - if (DSP3_BMIndex == 8) - { - for (short i=0; i < 8; i++) - for (short j=0; j < 8; j++) - { - DSP3_Bitplane[j] <<= 1; - DSP3_Bitplane[j] |= (DSP3_Bitmap[i] >> j) & 1; - } - - DSP3_BPIndex = 0; - DSP3_Count--; - } - } - - if (DSP3_BMIndex == 8) - { - if (DSP3_BPIndex == 8) - { - if (!DSP3_Count) DSP3_Reset(); - DSP3_BMIndex = 0; - } - else - { - DSP3_DR = DSP3_Bitplane[DSP3_BPIndex++]; - DSP3_DR |= DSP3_Bitplane[DSP3_BPIndex++] << 8; - } - } -} - -void DSP3_Convert() -{ - DSP3_Count = DSP3_DR; - DSP3_BMIndex = 0; - SetDSP3 = &DSP3_Convert_A; -} - -bool DSP3_GetBits(uint8 Count) -{ - if (!DSP3_BitsLeft) - { - DSP3_BitsLeft = Count; - DSP3_ReqBits = 0; - } - - do { - if (!DSP3_BitCount) - { - DSP3_SR = 0xC0; - return false; - } - - DSP3_ReqBits <<= 1; - if (DSP3_ReqData & 0x8000) DSP3_ReqBits++; - DSP3_ReqData <<= 1; - - DSP3_BitCount--; - DSP3_BitsLeft--; - - } while (DSP3_BitsLeft); - - return true; -} - -void DSP3_Decode_Data() -{ - if (!DSP3_BitCount) - { - if (DSP3_SR & 0x40) - { - DSP3_ReqData = DSP3_DR; - DSP3_BitCount += 16; - } - else - { - DSP3_SR = 0xC0; - return; - } - } - - if (DSP3_LZCode == 1) - { - if (!DSP3_GetBits(1)) - return; - - if (DSP3_ReqBits) - DSP3_LZLength = 12; - else - DSP3_LZLength = 8; - - DSP3_LZCode++; - } - - if (DSP3_LZCode == 2) - { - if (!DSP3_GetBits(DSP3_LZLength)) - return; - - DSP3_LZCode = 0; - DSP3_Outwords--; - if (!DSP3_Outwords) SetDSP3 = &DSP3_Reset; - - DSP3_SR = 0x80; - DSP3_DR = DSP3_ReqBits; - return; - } - - if (DSP3_BaseCode == 0xffff) - { - if (!DSP3_GetBits(DSP3_BaseLength)) - return; - - DSP3_BaseCode = DSP3_ReqBits; - } - - if (!DSP3_GetBits(DSP3_CodeLengths[DSP3_BaseCode])) - return; - - DSP3_Symbol = DSP3_Codes[DSP3_CodeOffsets[DSP3_BaseCode] + DSP3_ReqBits]; - DSP3_BaseCode = 0xffff; - - if (DSP3_Symbol & 0xff00) - { - DSP3_Symbol += 0x7f02; - DSP3_LZCode++; - } - else - { - DSP3_Outwords--; - if (!DSP3_Outwords) - SetDSP3 = &DSP3_Reset; - } - - DSP3_SR = 0x80; - DSP3_DR = DSP3_Symbol; -} - -void DSP3_Decode_Tree() -{ - if (!DSP3_BitCount) - { - DSP3_ReqData = DSP3_DR; - DSP3_BitCount += 16; - } - - if (!DSP3_BaseCodes) - { - DSP3_GetBits(1); - if (DSP3_ReqBits) - { - DSP3_BaseLength = 3; - DSP3_BaseCodes = 8; - } - else - { - DSP3_BaseLength = 2; - DSP3_BaseCodes = 4; - } - } - - while (DSP3_BaseCodes) - { - if (!DSP3_GetBits(3)) - return; - - DSP3_ReqBits++; - - DSP3_CodeLengths[DSP3_Index] = (uint8) DSP3_ReqBits; - DSP3_CodeOffsets[DSP3_Index] = DSP3_Symbol; - DSP3_Index++; - - DSP3_Symbol += 1 << DSP3_ReqBits; - DSP3_BaseCodes--; - } - - DSP3_BaseCode = 0xffff; - DSP3_LZCode = 0; - - SetDSP3 = &DSP3_Decode_Data; - if (DSP3_BitCount) DSP3_Decode_Data(); -} - -void DSP3_Decode_Symbols() -{ - DSP3_ReqData = DSP3_DR; - DSP3_BitCount += 16; - - do { - - if (DSP3_BitCommand == 0xffff) - { - if (!DSP3_GetBits(2)) return; - DSP3_BitCommand = DSP3_ReqBits; - } - - switch (DSP3_BitCommand) - { - case 0: - { - if (!DSP3_GetBits(9)) return; - DSP3_Symbol = DSP3_ReqBits; - break; - } - case 1: - { - DSP3_Symbol++; - break; - } - case 2: - { - if (!DSP3_GetBits(1)) return; - DSP3_Symbol += 2 + DSP3_ReqBits; - break; - } - case 3: - { - if (!DSP3_GetBits(4)) return; - DSP3_Symbol += 4 + DSP3_ReqBits; - break; - } - } - - DSP3_BitCommand = 0xffff; - - DSP3_Codes[DSP3_Index++] = DSP3_Symbol; - DSP3_Codewords--; - - } while (DSP3_Codewords); - - DSP3_Index = 0; - DSP3_Symbol = 0; - DSP3_BaseCodes = 0; - - SetDSP3 = &DSP3_Decode_Tree; - if (DSP3_BitCount) DSP3_Decode_Tree(); -} - -void DSP3_Decode_A() -{ - DSP3_Outwords = DSP3_DR; - SetDSP3 = &DSP3_Decode_Symbols; - DSP3_BitCount = 0; - DSP3_BitsLeft = 0; - DSP3_Symbol = 0; - DSP3_Index = 0; - DSP3_BitCommand = 0xffff; - DSP3_SR = 0xC0; -} - -void DSP3_Decode() -{ - DSP3_Codewords = DSP3_DR; - SetDSP3 = &DSP3_Decode_A; -} - -void DSP3_Command() -{ - if (DSP3_DR < 0x40) - { - switch (DSP3_DR) - { - case 0x02: SetDSP3 = &DSP3_Coordinate; break; - case 0x03: SetDSP3 = &DSP3_OP03; break; - case 0x06: SetDSP3 = &DSP3_OP06; break; - case 0x07: SetDSP3 = &DSP3_OP07; return; - case 0x0f: SetDSP3 = &DSP3_TestMemory; break; - case 0x18: SetDSP3 = &DSP3_Convert; break; - case 0x1f: SetDSP3 = &DSP3_MemoryDump; break; - case 0x2f: SetDSP3 = &DSP3_MemorySize; break; - case 0x38: SetDSP3 = &DSP3_Decode; break; - } - DSP3_SR = 0x0080; - DSP3_Index = 0; - } -} - -void DSP3_Reset() -{ - DSP3_DR = 0x0080; - DSP3_SR = 0x0084; - SetDSP3 = &DSP3_Command; -} - -void DSP3SetByte(uint8 byte, uint16 address) -{ - if ((address & 0xC000) == 0x8000) - { - if (DSP3_SR & 0x04) - { - DSP3_DR = (DSP3_DR & 0xff00) + byte; - (*SetDSP3)(); - } - else - { - DSP3_SR ^= 0x10; - - if (DSP3_SR & 0x10) - DSP3_DR = (DSP3_DR & 0xff00) + byte; - else - { - DSP3_DR = (DSP3_DR & 0x00ff) + (byte << 8); - (*SetDSP3)(); - } - } - } -} - -uint8 DSP3GetByte(uint16 address) -{ - if ((address & 0xC000) == 0x8000) - { - uint8 byte; - - if (DSP3_SR & 0x04) - { - byte = (uint8) DSP3_DR; - (*SetDSP3)(); - } - else - { - DSP3_SR ^= 0x10; - - if (DSP3_SR & 0x10) - byte = (uint8) (DSP3_DR); - else - { - byte = (uint8) (DSP3_DR >> 8); - (*SetDSP3)(); - } - } - - return byte; - } - - return (uint8) DSP3_SR; -} \ No newline at end of file +*******************************************************************************/ + +uint16 DSP3_DataROM[1024] = { + 0x8000, 0x4000, 0x2000, 0x1000, 0x0800, 0x0400, 0x0200, 0x0100, + 0x0080, 0x0040, 0x0020, 0x0010, 0x0008, 0x0004, 0x0002, 0x0001, + 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, + 0x0000, 0x000f, 0x0400, 0x0200, 0x0140, 0x0400, 0x0200, 0x0040, + 0x007d, 0x007e, 0x007e, 0x007b, 0x007c, 0x007d, 0x007b, 0x007c, + 0x0002, 0x0020, 0x0030, 0x0000, 0x000d, 0x0019, 0x0026, 0x0032, + 0x003e, 0x004a, 0x0056, 0x0062, 0x006d, 0x0079, 0x0084, 0x008e, + 0x0098, 0x00a2, 0x00ac, 0x00b5, 0x00be, 0x00c6, 0x00ce, 0x00d5, + 0x00dc, 0x00e2, 0x00e7, 0x00ec, 0x00f1, 0x00f5, 0x00f8, 0x00fb, + 0x00fd, 0x00ff, 0x0100, 0x0100, 0x0100, 0x00ff, 0x00fd, 0x00fb, + 0x00f8, 0x00f5, 0x00f1, 0x00ed, 0x00e7, 0x00e2, 0x00dc, 0x00d5, + 0x00ce, 0x00c6, 0x00be, 0x00b5, 0x00ac, 0x00a2, 0x0099, 0x008e, + 0x0084, 0x0079, 0x006e, 0x0062, 0x0056, 0x004a, 0x003e, 0x0032, + 0x0026, 0x0019, 0x000d, 0x0000, 0xfff3, 0xffe7, 0xffdb, 0xffce, + 0xffc2, 0xffb6, 0xffaa, 0xff9e, 0xff93, 0xff87, 0xff7d, 0xff72, + 0xff68, 0xff5e, 0xff54, 0xff4b, 0xff42, 0xff3a, 0xff32, 0xff2b, + 0xff25, 0xff1e, 0xff19, 0xff14, 0xff0f, 0xff0b, 0xff08, 0xff05, + 0xff03, 0xff01, 0xff00, 0xff00, 0xff00, 0xff01, 0xff03, 0xff05, + 0xff08, 0xff0b, 0xff0f, 0xff13, 0xff18, 0xff1e, 0xff24, 0xff2b, + 0xff32, 0xff3a, 0xff42, 0xff4b, 0xff54, 0xff5d, 0xff67, 0xff72, + 0xff7c, 0xff87, 0xff92, 0xff9e, 0xffa9, 0xffb5, 0xffc2, 0xffce, + 0xffda, 0xffe7, 0xfff3, 0x002b, 0x007f, 0x0020, 0x00ff, 0xff00, + 0xffbe, 0x0000, 0x0044, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xffc1, 0x0001, 0x0002, 0x0045, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0xffc5, 0x0003, 0x0004, 0x0005, 0x0047, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xffca, 0x0006, 0x0007, 0x0008, + 0x0009, 0x004a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0xffd0, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x004e, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xffd7, 0x000f, 0x0010, 0x0011, + 0x0012, 0x0013, 0x0014, 0x0053, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0xffdf, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, + 0x0059, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xffe8, 0x001c, 0x001d, 0x001e, + 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0060, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0xfff2, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, + 0x002b, 0x002c, 0x0068, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xfffd, 0x002d, 0x002e, 0x002f, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0071, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0xffc7, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, + 0x003e, 0x003f, 0x0040, 0x0041, 0x007b, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xffd4, 0x0000, 0x0001, 0x0002, + 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, + 0x000b, 0x0044, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0xffe2, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, + 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0050, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xfff1, 0x0019, 0x001a, 0x001b, + 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, + 0x0024, 0x0025, 0x0026, 0x005d, 0x0000, 0x0000, 0x0000, 0x0000, + 0xffcb, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, + 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, + 0x006b, 0x0000, 0x0000, 0x0000, 0xffdc, 0x0000, 0x0001, 0x0002, + 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, + 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0044, 0x0000, 0x0000, + 0xffee, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, + 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, + 0x001f, 0x0020, 0x0054, 0x0000, 0xffee, 0x0021, 0x0022, 0x0023, + 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, + 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0065, + 0xffbe, 0x0000, 0xfeac, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xffc1, 0x0001, 0x0002, 0xfead, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0xffc5, 0x0003, 0x0004, 0x0005, 0xfeaf, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xffca, 0x0006, 0x0007, 0x0008, + 0x0009, 0xfeb2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0xffd0, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0xfeb6, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xffd7, 0x000f, 0x0010, 0x0011, + 0x0012, 0x0013, 0x0014, 0xfebb, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0xffdf, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, + 0xfec1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xffe8, 0x001c, 0x001d, 0x001e, + 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0xfec8, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0xfff2, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, + 0x002b, 0x002c, 0xfed0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xfffd, 0x002d, 0x002e, 0x002f, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0xfed9, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0xffc7, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, + 0x003e, 0x003f, 0x0040, 0x0041, 0xfee3, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xffd4, 0x0000, 0x0001, 0x0002, + 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, + 0x000b, 0xfeac, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0xffe2, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, + 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0xfeb8, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xfff1, 0x0019, 0x001a, 0x001b, + 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, + 0x0024, 0x0025, 0x0026, 0xfec5, 0x0000, 0x0000, 0x0000, 0x0000, + 0xffcb, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, + 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, + 0xfed3, 0x0000, 0x0000, 0x0000, 0xffdc, 0x0000, 0x0001, 0x0002, + 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, + 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0xfeac, 0x0000, 0x0000, + 0xffee, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, + 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, + 0x001f, 0x0020, 0xfebc, 0x0000, 0xffee, 0x0021, 0x0022, 0x0023, + 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, + 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0xfecd, + 0x0154, 0x0218, 0x0110, 0x00b0, 0x00cc, 0x00b0, 0x0088, 0x00b0, + 0x0044, 0x00b0, 0x0000, 0x00b0, 0x00fe, 0xff07, 0x0002, 0x00ff, + 0x00f8, 0x0007, 0x00fe, 0x00ee, 0x07ff, 0x0200, 0x00ef, 0xf800, + 0x0700, 0x00ee, 0xffff, 0xffff, 0xffff, 0x0000, 0x0000, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, + 0xffff, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, + 0x0000, 0xffff, 0xffff, 0x0000, 0xffff, 0x0001, 0x0000, 0x0001, + 0x0001, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0x0000, + 0xffff, 0x0001, 0x0000, 0x0001, 0x0001, 0x0000, 0x0000, 0xffff, + 0xffff, 0xffff, 0x0000, 0x0000, 0x0000, 0x0044, 0x0088, 0x00cc, + 0x0110, 0x0154, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff +}; + +#ifdef __WIN32__ + void (__cdecl *SetDSP3)(void); +#else + void (*SetDSP3)(void); +#endif + +uint16 DSP3_DR; +uint16 DSP3_SR; +uint16 DSP3_MemoryIndex; + +void DSP3_MemorySize() +{ + DSP3_DR = 0x0300; + SetDSP3 = &DSP3_Reset; +} + +void DSP3_TestMemory() +{ + DSP3_DR = 0x0000; + SetDSP3 = &DSP3_Reset; +} + +void DSP3_DumpDataROM() +{ + DSP3_DR = DSP3_DataROM[DSP3_MemoryIndex++]; + if (DSP3_MemoryIndex == 1024) + SetDSP3 = &DSP3_Reset; +} + +void DSP3_MemoryDump() +{ + DSP3_MemoryIndex = 0; + SetDSP3 = &DSP3_DumpDataROM; + DSP3_DumpDataROM(); +} + +int16 DSP3_WinLo; +int16 DSP3_WinHi; + +void DSP3_OP06() +{ + DSP3_WinLo = (uint8)(DSP3_DR); + DSP3_WinHi = (uint8)(DSP3_DR >> 8); + DSP3_Reset(); +} + +void DSP3_OP03() +{ + int16 Lo = (uint8)(DSP3_DR); + int16 Hi = (uint8)(DSP3_DR >> 8); + int16 Ofs = (DSP3_WinLo * Hi << 1) + (Lo << 1); + DSP3_DR = Ofs >> 1; + SetDSP3 = &DSP3_Reset; +} + +int16 DSP3_AddLo; +int16 DSP3_AddHi; + +void DSP3_OP07_B() +{ + int16 Ofs = (DSP3_WinLo * DSP3_AddHi << 1) + (DSP3_AddLo << 1); + DSP3_DR = Ofs >> 1; + SetDSP3 = &DSP3_Reset; +} + +void DSP3_OP07_A() +{ + int16 Lo = (uint8)(DSP3_DR); + int16 Hi = (uint8)(DSP3_DR >> 8); + + if (Lo & 1) Hi += (DSP3_AddLo & 1); + + DSP3_AddLo += Lo; + DSP3_AddHi += Hi; + + if (DSP3_AddLo < 0) + DSP3_AddLo += DSP3_WinLo; + else + if (DSP3_AddLo >= DSP3_WinLo) + DSP3_AddLo -= DSP3_WinLo; + + if (DSP3_AddHi < 0) + DSP3_AddHi += DSP3_WinHi; + else + if (DSP3_AddHi >= DSP3_WinHi) + DSP3_AddHi -= DSP3_WinHi; + + DSP3_DR = DSP3_AddLo | (DSP3_AddHi << 8) | ((DSP3_AddHi >> 8) & 0xff); + SetDSP3 = &DSP3_OP07_B; +} + +void DSP3_OP07() +{ + uint32 dataOfs = ((DSP3_DR << 1) + 0x03b2) & 0x03ff; + + DSP3_AddHi = DSP3_DataROM[dataOfs]; + DSP3_AddLo = DSP3_DataROM[dataOfs + 1]; + + SetDSP3 = &DSP3_OP07_A; + DSP3_SR = 0x0080; +} + +uint16 DSP3_Codewords; +uint16 DSP3_Outwords; +uint16 DSP3_Symbol; +uint16 DSP3_BitCount; +uint16 DSP3_Index; +uint16 DSP3_Codes[512]; +uint16 DSP3_BitsLeft; +uint16 DSP3_ReqBits; +uint16 DSP3_ReqData; +uint16 DSP3_BitCommand; +uint8 DSP3_BaseLength; +uint16 DSP3_BaseCodes; +uint16 DSP3_BaseCode; +uint8 DSP3_CodeLengths[8]; +uint16 DSP3_CodeOffsets[8]; +uint16 DSP3_LZCode; +uint8 DSP3_LZLength; + +uint16 DSP3_X; +uint16 DSP3_Y; + +void DSP3_Coordinate() +{ + DSP3_Index++; + + switch (DSP3_Index) + { + case 3: + { + if (DSP3_DR == 0xffff) + DSP3_Reset(); + break; + } + case 4: + { + DSP3_X = DSP3_DR; + break; + } + case 5: + { + DSP3_Y = DSP3_DR; + DSP3_DR = 1; + break; + } + case 6: + { + DSP3_DR = DSP3_X; + break; + } + case 7: + { + DSP3_DR = DSP3_Y; + DSP3_Index = 0; + break; + } + } +} + +uint8 DSP3_Bitmap[8]; +uint8 DSP3_Bitplane[8]; +uint16 DSP3_BMIndex; +uint16 DSP3_BPIndex; +uint16 DSP3_Count; + +void DSP3_Convert_A() +{ + if (DSP3_BMIndex < 8) + { + DSP3_Bitmap[DSP3_BMIndex++] = (uint8) (DSP3_DR); + DSP3_Bitmap[DSP3_BMIndex++] = (uint8) (DSP3_DR >> 8); + + if (DSP3_BMIndex == 8) + { + for (short i=0; i < 8; i++) + for (short j=0; j < 8; j++) + { + DSP3_Bitplane[j] <<= 1; + DSP3_Bitplane[j] |= (DSP3_Bitmap[i] >> j) & 1; + } + + DSP3_BPIndex = 0; + DSP3_Count--; + } + } + + if (DSP3_BMIndex == 8) + { + if (DSP3_BPIndex == 8) + { + if (!DSP3_Count) DSP3_Reset(); + DSP3_BMIndex = 0; + } + else + { + DSP3_DR = DSP3_Bitplane[DSP3_BPIndex++]; + DSP3_DR |= DSP3_Bitplane[DSP3_BPIndex++] << 8; + } + } +} + +void DSP3_Convert() +{ + DSP3_Count = DSP3_DR; + DSP3_BMIndex = 0; + SetDSP3 = &DSP3_Convert_A; +} + +bool DSP3_GetBits(uint8 Count) +{ + if (!DSP3_BitsLeft) + { + DSP3_BitsLeft = Count; + DSP3_ReqBits = 0; + } + + do { + if (!DSP3_BitCount) + { + DSP3_SR = 0xC0; + return false; + } + + DSP3_ReqBits <<= 1; + if (DSP3_ReqData & 0x8000) DSP3_ReqBits++; + DSP3_ReqData <<= 1; + + DSP3_BitCount--; + DSP3_BitsLeft--; + + } while (DSP3_BitsLeft); + + return true; +} + +void DSP3_Decode_Data() +{ + if (!DSP3_BitCount) + { + if (DSP3_SR & 0x40) + { + DSP3_ReqData = DSP3_DR; + DSP3_BitCount += 16; + } + else + { + DSP3_SR = 0xC0; + return; + } + } + + if (DSP3_LZCode == 1) + { + if (!DSP3_GetBits(1)) + return; + + if (DSP3_ReqBits) + DSP3_LZLength = 12; + else + DSP3_LZLength = 8; + + DSP3_LZCode++; + } + + if (DSP3_LZCode == 2) + { + if (!DSP3_GetBits(DSP3_LZLength)) + return; + + DSP3_LZCode = 0; + DSP3_Outwords--; + if (!DSP3_Outwords) SetDSP3 = &DSP3_Reset; + + DSP3_SR = 0x80; + DSP3_DR = DSP3_ReqBits; + return; + } + + if (DSP3_BaseCode == 0xffff) + { + if (!DSP3_GetBits(DSP3_BaseLength)) + return; + + DSP3_BaseCode = DSP3_ReqBits; + } + + if (!DSP3_GetBits(DSP3_CodeLengths[DSP3_BaseCode])) + return; + + DSP3_Symbol = DSP3_Codes[DSP3_CodeOffsets[DSP3_BaseCode] + DSP3_ReqBits]; + DSP3_BaseCode = 0xffff; + + if (DSP3_Symbol & 0xff00) + { + DSP3_Symbol += 0x7f02; + DSP3_LZCode++; + } + else + { + DSP3_Outwords--; + if (!DSP3_Outwords) + SetDSP3 = &DSP3_Reset; + } + + DSP3_SR = 0x80; + DSP3_DR = DSP3_Symbol; +} + +void DSP3_Decode_Tree() +{ + if (!DSP3_BitCount) + { + DSP3_ReqData = DSP3_DR; + DSP3_BitCount += 16; + } + + if (!DSP3_BaseCodes) + { + DSP3_GetBits(1); + if (DSP3_ReqBits) + { + DSP3_BaseLength = 3; + DSP3_BaseCodes = 8; + } + else + { + DSP3_BaseLength = 2; + DSP3_BaseCodes = 4; + } + } + + while (DSP3_BaseCodes) + { + if (!DSP3_GetBits(3)) + return; + + DSP3_ReqBits++; + + DSP3_CodeLengths[DSP3_Index] = (uint8) DSP3_ReqBits; + DSP3_CodeOffsets[DSP3_Index] = DSP3_Symbol; + DSP3_Index++; + + DSP3_Symbol += 1 << DSP3_ReqBits; + DSP3_BaseCodes--; + } + + DSP3_BaseCode = 0xffff; + DSP3_LZCode = 0; + + SetDSP3 = &DSP3_Decode_Data; + if (DSP3_BitCount) DSP3_Decode_Data(); +} + +void DSP3_Decode_Symbols() +{ + DSP3_ReqData = DSP3_DR; + DSP3_BitCount += 16; + + do { + + if (DSP3_BitCommand == 0xffff) + { + if (!DSP3_GetBits(2)) return; + DSP3_BitCommand = DSP3_ReqBits; + } + + switch (DSP3_BitCommand) + { + case 0: + { + if (!DSP3_GetBits(9)) return; + DSP3_Symbol = DSP3_ReqBits; + break; + } + case 1: + { + DSP3_Symbol++; + break; + } + case 2: + { + if (!DSP3_GetBits(1)) return; + DSP3_Symbol += 2 + DSP3_ReqBits; + break; + } + case 3: + { + if (!DSP3_GetBits(4)) return; + DSP3_Symbol += 4 + DSP3_ReqBits; + break; + } + } + + DSP3_BitCommand = 0xffff; + + DSP3_Codes[DSP3_Index++] = DSP3_Symbol; + DSP3_Codewords--; + + } while (DSP3_Codewords); + + DSP3_Index = 0; + DSP3_Symbol = 0; + DSP3_BaseCodes = 0; + + SetDSP3 = &DSP3_Decode_Tree; + if (DSP3_BitCount) DSP3_Decode_Tree(); +} + +void DSP3_Decode_A() +{ + DSP3_Outwords = DSP3_DR; + SetDSP3 = &DSP3_Decode_Symbols; + DSP3_BitCount = 0; + DSP3_BitsLeft = 0; + DSP3_Symbol = 0; + DSP3_Index = 0; + DSP3_BitCommand = 0xffff; + DSP3_SR = 0xC0; +} + +void DSP3_Decode() +{ + DSP3_Codewords = DSP3_DR; + SetDSP3 = &DSP3_Decode_A; +} + +void DSP3_Command() +{ + if (DSP3_DR < 0x40) + { + switch (DSP3_DR) + { + case 0x02: SetDSP3 = &DSP3_Coordinate; break; + case 0x03: SetDSP3 = &DSP3_OP03; break; + case 0x06: SetDSP3 = &DSP3_OP06; break; + case 0x07: SetDSP3 = &DSP3_OP07; return; + case 0x0f: SetDSP3 = &DSP3_TestMemory; break; + case 0x18: SetDSP3 = &DSP3_Convert; break; + case 0x1f: SetDSP3 = &DSP3_MemoryDump; break; + case 0x2f: SetDSP3 = &DSP3_MemorySize; break; + case 0x38: SetDSP3 = &DSP3_Decode; break; + } + DSP3_SR = 0x0080; + DSP3_Index = 0; + } +} + +void DSP3_Reset() +{ + DSP3_DR = 0x0080; + DSP3_SR = 0x0084; + SetDSP3 = &DSP3_Command; +} + +void DSP3SetByte(uint8 byte, uint16 address) +{ + if ((address & 0xC000) == 0x8000) + { + if (DSP3_SR & 0x04) + { + DSP3_DR = (DSP3_DR & 0xff00) + byte; + (*SetDSP3)(); + } + else + { + DSP3_SR ^= 0x10; + + if (DSP3_SR & 0x10) + DSP3_DR = (DSP3_DR & 0xff00) + byte; + else + { + DSP3_DR = (DSP3_DR & 0x00ff) + (byte << 8); + (*SetDSP3)(); + } + } + } +} + +uint8 DSP3GetByte(uint16 address) +{ + if ((address & 0xC000) == 0x8000) + { + uint8 byte; + + if (DSP3_SR & 0x04) + { + byte = (uint8) DSP3_DR; + (*SetDSP3)(); + } + else + { + DSP3_SR ^= 0x10; + + if (DSP3_SR & 0x10) + byte = (uint8) (DSP3_DR); + else + { + byte = (uint8) (DSP3_DR >> 8); + (*SetDSP3)(); + } + } + + return byte; + } + + return (uint8) DSP3_SR; +} diff -NaHudr snes9x-1.43-src/snes9x/dsp4emu.cpp snx/snes9x/dsp4emu.cpp --- snes9x-1.43-src/snes9x/dsp4emu.cpp 2004-12-31 00:15:47.000000000 +0200 +++ snx/snes9x/dsp4emu.cpp 2005-04-09 00:59:26.000000000 +0300 @@ -85,1502 +85,1503 @@ Super NES and Super Nintendo Entertainment System are trademarks of Nintendo Co., Limited and its subsidiary companies. -*******************************************************************************/ - -// Due recognition and credit are given on Overload's DSP website. -// Thank those contributors for their hard work on this chip. - -#include "dsp4.h" - -#define DSP4_READ_WORD(x) \ - READ_WORD(DSP4.parameters+x) - -#define DSP4_WRITE_WORD(x,d) \ - WRITE_WORD(DSP4.output+x,d); - -// used to wait for dsp i/o -#define DSP4_WAIT(x) \ - DSP4_Logic = x; return; - -////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////// - -void DSP4_Multiply(short Multiplicand, short Multiplier, int &Product) -{ - Product = (Multiplicand * Multiplier << 1) >> 1; -} - -void DSP4_UnknownOP11(short A, short B, short C, short D, short &M) -{ - // 0x155 = 341 = Horizontal Width of the Screen - M = ((A * 0x0155 >> 2) & 0xf000) | ((B * 0x0155 >> 6) & 0x0f00) | - ((C * 0x0155 >> 10) & 0x00f0) | ((D * 0x0155 >> 14) & 0x000f); -} - -const unsigned short Op0A_Values[16] = { - 0x0000, 0x0030, 0x0060, 0x0090, 0x00c0, 0x00f0, 0x0120, 0x0150, - 0xfe80, 0xfeb0, 0xfee0, 0xff10, 0xff40, 0xff70, 0xffa0, 0xffd0 -}; - -void DSP4_Op0A(short n2, short &o1, short &o2, short &o3, short &o4) -{ - o4 = Op0A_Values[(n2 & 0x000f)]; - o3 = Op0A_Values[(n2 & 0x00f0) >> 4]; - o2 = Op0A_Values[(n2 & 0x0f00) >> 8]; - o1 = Op0A_Values[(n2 & 0xf000) >> 12]; -} - -////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////// - -#if OP==0x0009 -#define PRINT -#endif - -void DSP4_Op03() -{ -#ifdef PRINT - printf("Op03\n"); -#endif - - MaxTilesPerRow = 33; - - for (int i=0; i < 32; i++) - RowCount[i] = 0; - - // reset op09 data - op09_mode = 0; -} - -void DSP4_Op0E() -{ -#ifdef PRINT - printf("Op0E\n"); -#endif - - MaxTilesPerRow = 16; - - for (int i=0; i < 32; i++) - RowCount[i] = 0; - - // reset op09 data - op09_mode = 1; -} - -#undef PRINT - -void DSP4_Op06(bool8 size, bool8 msb) -{ - // save post-oam table data for future retrieval - op06_OAM[op06_index] |= (msb<<(op06_offset+0)); - op06_OAM[op06_index] |= (size<<(op06_offset+1)); - op06_offset += 2; - - if(op06_offset==8) - { - // move to next byte in buffer - op06_offset=0; - op06_index++; - } -} - -#if OP==0x0001 -#define PRINT -#endif - -void DSP4_Op01() -{ - uint16 command; - - DSP4.waiting4command = FALSE; - - // op flow control - switch(DSP4_Logic) { - case 1: goto resume1; break; - case 2: goto resume2; break; - } - - //////////////////////////////////////////////////// - // process initial inputs - - // sort inputs - // 0x00 = DSP4_READ_WORD(0x00); - project_focaly = DSP4_READ_WORD(0x02); - raster = DSP4_READ_WORD(0x04); - viewport_top = DSP4_READ_WORD(0x06); - project_y = DSP4_READ_WORD(0x08); - viewport_bottom = DSP4_READ_WORD(0x0a); - project_x1low = DSP4_READ_WORD(0x0c); - project_focalx = DSP4_READ_WORD(0x0e); - project_centerx = DSP4_READ_WORD(0x10); - project_ptr = DSP4_READ_WORD(0x12); - // (envelope?) 0xc0 = DSP4_READ_WORD(0x14); - project_pitchylow = DSP4_READ_WORD(0x16); - project_pitchy = DSP4_READ_WORD(0x18); - project_pitchxlow = DSP4_READ_WORD(0x1a); - project_pitchx = DSP4_READ_WORD(0x1c); - far_plane = DSP4_READ_WORD(0x1e); - // ? = DSP4_READ_WORD(0x20); - project_y1low = DSP4_READ_WORD(0x22); - - // pre-compute - view_plane = PLANE_START; - - // find starting projection points - project_x1 = project_focalx; - project_y -= viewport_bottom; - - // multi-op storage - multi_index1 = 0; - multi_index2 = 0; - - // debug - block=0; - - //////////////////////////////////////////////////// - // command check - - do { - // scan next command - DSP4.in_count = 2; - - DSP4_WAIT(1) resume1: - - // inspect input - command = DSP4_READ_WORD(0); - - // check for termination - if(command == 0x8000) break; - - // already have 2 bytes in queue - DSP4.in_index = 2; - DSP4.in_count = 8; - - DSP4_WAIT(2) resume2: - - //////////////////////////////////////////////////// - // process one iteration of projection - - // inspect inputs - int16 plane = DSP4_READ_WORD(0); - int16 index, lcv; - int16 py_dy=0, px_dx=0; - int16 y_out, x_out; - int16 envelope = DSP4_READ_WORD(6); - int16 project_x; - - // ignore invalid data - if((uint16) plane == 0x8001) continue; - - // one-time init - if(far_plane) - { - // setup final parameters - project_focalx += plane; - project_x1 = project_focalx; - project_y1 = project_focaly; - plane = far_plane; - far_plane = 0; - - // track occlusion - multi_farplane[1] = plane; - multi_raster[1] = viewport_bottom; - } - - // use proportional triangles to project new coords - project_x2 = project_focalx * plane / view_plane; - project_y2 = project_focaly * plane / view_plane; - - // quadratic regression (rough) - if(project_focaly>=-0x0f) - py_dy = project_focaly * project_focaly * -0.20533553 - - 1.08330005 * project_focaly - 69.61094639; - else - py_dy = project_focaly * project_focaly * -0.000657035759 - - 1.07629051 * project_focaly - 65.69315963; - - // approximate # of raster lines - segments = abs(project_y2-project_y1); - - // prevent overdraw - if(project_y2>=raster) segments=0; - else raster=project_y2; - - // don't draw outside the window - if(project_y20) - { - // interpolate between projected points - px_dx = ((project_x2-project_x1)<<8)/segments; - } - - // debug - ++block; -#ifdef PRINT - printf("(line %d) Op01 check %02X, plane %04X, focal_y %04X, y2 %04X, y1 %04X\n",c,(uint16)segments,(uint16)(plane),(uint16)project_focaly,(uint16)project_y2,(uint16)project_y1); -#endif - - // prepare output - DSP4.out_count=8+2+6*segments; - - // pre-block data - DSP4_WRITE_WORD(0,project_focalx); - DSP4_WRITE_WORD(2,project_x2); - DSP4_WRITE_WORD(4,project_focaly); - DSP4_WRITE_WORD(6,project_y2); - DSP4_WRITE_WORD(8,segments); - -#if 0 - DSP4_WRITE_WORD(0,-1); - DSP4_WRITE_WORD(2,-1); - DSP4_WRITE_WORD(4,-1); - DSP4_WRITE_WORD(6,-1); - DSP4_WRITE_WORD(8,-1); -#endif - - index=10; - - project_x = project_centerx + project_x1; - - // iterate through each point - for( lcv=0; lcv>8); - x_out = project_x+((px_dx*lcv)>>8); - - // factor in dynamic track changes - y_out += envelope; - -#if 0 - project_ptr=-1; - y_out=-1; - //x_out=-1; -#endif - - // data - DSP4_WRITE_WORD(index+0,project_ptr); - DSP4_WRITE_WORD(index+2,y_out); - DSP4_WRITE_WORD(index+4,x_out); - index += 6; - - // post-update - project_ptr -= 4; - } - - // post-update - project_y += ((py_dy*lcv)>>8); - - // new positions - if(segments>0) - { - project_x1 = project_x2; - project_y1 = project_y2; - - // storage of focals for op07 - multi_focaly[multi_index2++] = project_focaly; - - // track occlusion: can't see anything below it - multi_farplane[1] = plane; - multi_raster[1] -= segments; - } - - // update projection points - project_pitchy += (int8)DSP4.parameters[3]; - project_pitchx += (int8)DSP4.parameters[5]; - - project_focaly += project_pitchy; - project_focalx += project_pitchx; - } while (1); - - // terminate op - DSP4.waiting4command = TRUE; - DSP4.out_count = 0; -} - -#undef PRINT - -#if OP==0x0007 -#define PRINT -#endif - -void DSP4_Op07() -{ - uint16 command; - - DSP4.waiting4command = FALSE; - - // op flow control - switch(DSP4_Logic) { - case 1: goto resume1; break; - case 2: goto resume2; break; - } - - //////////////////////////////////////////////////// - // sort inputs - - // 0x00 = DSP4_READ_WORD(0x00); - project_focaly = DSP4_READ_WORD(0x02); - raster = DSP4_READ_WORD(0x04); - viewport_top = DSP4_READ_WORD(0x06); - project_y = DSP4_READ_WORD(0x08); - viewport_bottom = DSP4_READ_WORD(0x0a); - project_x1low = DSP4_READ_WORD(0x0c); - project_x1 = DSP4_READ_WORD(0x0e); - project_centerx = DSP4_READ_WORD(0x10); - project_ptr = DSP4_READ_WORD(0x12); - // (envelope?) 0xc0 = DSP4_READ_WORD(0x14); - - // pre-compute - view_plane = PLANE_START; - - // find projection targets - project_y1 = project_focaly; - project_y -= viewport_bottom; - - // multi-op storage - multi_index2 = 0; - - // debug - block=0; - -#ifdef PRINT - printf("(line %d) Op07 data %04X\n",c,(uint16)project_y1); -#endif - - //////////////////////////////////////////////////// - // command check - - do { - // scan next command - DSP4.in_count = 2; - - DSP4_WAIT(1) resume1: - - // inspect input - command = DSP4_READ_WORD(0); - - // check for opcode termination - if(command == 0x8000) break; - - // already have 2 bytes in queue - DSP4.in_index = 2; - DSP4.in_count = 12; - - DSP4_WAIT(2) resume2: - - //////////////////////////////////////////////////// - // process one loop of projection - - int16 plane; - int16 index,lcv; - int16 y_out,x_out; - int16 py_dy=0,px_dx=0; - int16 project_x; - - // debug - ++block; - - // inspect inputs - plane = DSP4_READ_WORD(0); - project_y2 = DSP4_READ_WORD(2); - // ? = DSP4_READ_WORD(4); - project_x2 = DSP4_READ_WORD(6); - int16 envelope = DSP4_READ_WORD(8); - - // ignore invalid data - if((uint16) plane == 0x8001) continue; - - // multi-op storage - project_focaly = multi_focaly[multi_index2]; - - // quadratic regression (rough) - if(project_focaly>=-0x0f) - py_dy = project_focaly * project_focaly * -0.20533553 - - 1.08330005 * project_focaly - 69.61094639; - else - py_dy = project_focaly * project_focaly * -0.000657035759 - - 1.07629051 * project_focaly - 65.69315963; - - // approximate # of raster lines - segments = abs(project_y2-project_y1); - - // prevent overdraw - if(project_y2>=raster) segments=0; - else raster=project_y2; - - // don't draw outside the window - if(project_y20) - { - // interpolate between projected points - px_dx = ((project_x2-project_x1)<<8)/segments; - } - -#ifdef PRINT - printf("(line %d) Op07 block %d, loc %04X, out %02X, project_x2 %04X\n",c,block,plane,segments,(uint16)project_x2); -#endif - - // prepare pre-output - DSP4.out_count=4+2+6*segments; - - DSP4_WRITE_WORD(0,project_x2); - DSP4_WRITE_WORD(2,project_y2); - DSP4_WRITE_WORD(4,segments); - -#if 0 - DSP4_WRITE_WORD(0,-1); - DSP4_WRITE_WORD(2,-1); - DSP4_WRITE_WORD(4,-1); -#endif - - index=6; - - project_x = project_centerx + project_x1; - - for( lcv=0; lcv>8); - x_out = project_x+((px_dx*lcv)>>8); - - // factor in dynamic track changes - y_out += envelope; - -#if 0 - project_ptr = -1; - //y_out = -1; - x_out = -1; -#endif - - // data - DSP4_WRITE_WORD(index+0,project_ptr); - DSP4_WRITE_WORD(index+2,y_out); - DSP4_WRITE_WORD(index+4,x_out); - index += 6; - - // post-update - project_ptr -= 4; - } - - // update internal variables - project_y += ((py_dy*lcv)>>8); - - // new positions - if(segments>0) - { - project_x1 = project_x2; - project_y1 = project_y2; - - // multi-op storage - multi_index2++; - } - } while(1); - - DSP4.waiting4command = TRUE; - DSP4.out_count = 0; -} - -#undef PRINT - -#if OP==0x0008 -#define PRINT -#endif - -void DSP4_Op08() -{ - uint16 command; - - DSP4.waiting4command = FALSE; - - // op flow control - switch(DSP4_Logic) { - case 1: goto resume1; break; - case 2: goto resume2; break; - } - - //////////////////////////////////////////////////// - // process initial inputs - - // clip values - path_clipRight[0] = DSP4_READ_WORD(0x00); - path_clipRight[1] = DSP4_READ_WORD(0x02); - path_clipRight[2] = DSP4_READ_WORD(0x04); - path_clipRight[3] = DSP4_READ_WORD(0x06); - - path_clipLeft[0] = DSP4_READ_WORD(0x08); - path_clipLeft[1] = DSP4_READ_WORD(0x0a); - path_clipLeft[2] = DSP4_READ_WORD(0x0c); - path_clipLeft[3] = DSP4_READ_WORD(0x0e); - - // unknown (constant) - // unknown (constant) - - // path positions - path_pos[0] = DSP4_READ_WORD(0x20); - path_pos[1] = DSP4_READ_WORD(0x22); - path_pos[2] = DSP4_READ_WORD(0x24); - path_pos[3] = DSP4_READ_WORD(0x26); - - // data locations - path_ptr[0] = DSP4_READ_WORD(0x28); - path_ptr[1] = DSP4_READ_WORD(0x2a); - path_ptr[2] = DSP4_READ_WORD(0x2c); - path_ptr[3] = DSP4_READ_WORD(0x2e); - - // project_y1 lines - path_raster[0] = DSP4_READ_WORD(0x30); - path_raster[1] = DSP4_READ_WORD(0x32); - path_raster[2] = DSP4_READ_WORD(0x34); - path_raster[3] = DSP4_READ_WORD(0x36); - - // viewport_top - path_top[0] = DSP4_READ_WORD(0x38); - path_top[1] = DSP4_READ_WORD(0x3a); - path_top[2] = DSP4_READ_WORD(0x3c); - path_top[3] = DSP4_READ_WORD(0x3e); - - // unknown (constants) - - view_plane = PLANE_START; - - // debug - block=0; - - //////////////////////////////////////////////////// - // command check - - do { - // scan next command - DSP4.in_count = 2; - - DSP4_WAIT(1) resume1: - - // inspect input - command = DSP4_READ_WORD(0); - - // terminate op - if(command == 0x8000) break; - - // already have 2 bytes in queue - DSP4.in_index = 2; - DSP4.in_count = 18; - - DSP4_WAIT(2) resume2: - - //////////////////////////////////////////////////// - // projection begins - - // debug - ++block; - - // used in envelope shaping - int16 x1_final; - int16 x2_final; - - // look at guidelines - int16 plane = DSP4_READ_WORD(0x00); - int16 x_left = DSP4_READ_WORD(0x02); - int16 y_left = DSP4_READ_WORD(0x04); - int16 x_right = DSP4_READ_WORD(0x06); - int16 y_right = DSP4_READ_WORD(0x08); - - // envelope guidelines (one frame only) - int16 envelope1 = DSP4_READ_WORD(0x0a); - int16 envelope2 = DSP4_READ_WORD(0x0c); - int16 envelope3 = DSP4_READ_WORD(0x0e); - int16 envelope4 = DSP4_READ_WORD(0x10); - - // ignore invalid data - if((uint16) plane == 0x8001) continue; - - // first init - if(plane == 0x7fff) - { - int pos1,pos2; - - // initialize projection - path_x[0] = x_left; - path_x[1] = x_right; - - path_y[0] = y_left; - path_y[1] = y_right; - - // update coordinates - path_pos[0]-=x_left; - path_pos[1]-=x_left; - path_pos[2]-=x_right; - path_pos[3]-=x_right; - - pos1 = path_pos[0]+envelope1; - pos2 = path_pos[1]+envelope2; - - // clip offscreen data - if(pos1path_clipRight[0]) pos1 = path_clipRight[0]; - if(pos2path_clipRight[1]) pos2 = path_clipRight[1]; - -#if 0 - pos1=-1; - //pos2=-1; -#endif - - path_plane[0] = plane; - path_plane[1] = plane; - - // initial output - DSP4.out_count = 2; - DSP4.output[0]=pos1&0xFF; - DSP4.output[1]=pos2&0xFF; - -#ifdef PRINT - printf("(line %d) Op08 x_left %04X\n",c,(uint16)x_left); -#endif - } - // proceed with projection - else - { - int16 index=0, lcv; - int16 left_inc=0,right_inc=0; - int16 dx1,dx2,dx3,dx4; - - // # segments to traverse - segments = abs(y_left - path_y[0]); - - // prevent overdraw - if(y_left>=path_raster[0]) segments=0; - else path_raster[0]=y_left; - - // don't draw outside the window - if(path_raster[0]0) - { - // use previous data - dx1 = (envelope1 * path_plane[0] / view_plane); - dx2 = (envelope2 * path_plane[0] / view_plane); - - // use temporary envelope pitch (this frame only) - dx3 = (envelope1 * plane / view_plane); - dx4 = (envelope2 * plane / view_plane); - - // project new shapes (left side) - x1_final = x_left+dx1; - x2_final = path_x[0]+dx3; - - // interpolate between projected points with shaping - left_inc = ((x2_final-x1_final)<<8)/segments; - - // project new shapes (right side) - x1_final = x_left+dx2; - x2_final = path_x[0]+dx4; - - // interpolate between projected points with shaping - right_inc = ((x2_final-x1_final)<<8)/segments; - - path_plane[0] = plane; - } - -#ifdef PRINT - printf("(line %d) Op08 block %d, out %02X, raster %02X\n",c,block,segments,(uint16)y_left); -#endif - - // zone 1 - DSP4.out_count = (2+4*segments); - DSP4_WRITE_WORD(index,segments); index+=2; - - for( lcv=1; lcv<=segments; lcv++ ) - { - int16 pos1,pos2; - - // pre-compute - pos1 = path_pos[0]+((left_inc*lcv)>>8)+dx1; - pos2 = path_pos[1]+((right_inc*lcv)>>8)+dx2; - - // clip offscreen data - if(pos1path_clipRight[0]) pos1 = path_clipRight[0]; - if(pos2path_clipRight[1]) pos2 = path_clipRight[1]; - -#if 0 - if(pos1==0x00ff) pos1=0; - if(pos2==0x00ff) pos2=0; - path_ptr[0] = -1; - pos1 = -1; - pos2 = -1; -#endif - - // data - DSP4_WRITE_WORD(index,path_ptr[0]); index+=2; - DSP4.output[index++]=pos1&0xFF; - DSP4.output[index++]=pos2&0xFF; - - // post-update - path_ptr[0] -= 4; - path_ptr[1] -= 4; - } - lcv--; - - if(segments>0) - { - // project points w/out the envelopes - int16 inc = ((path_x[0]-x_left)<<8)/segments; - - // post-store - path_pos[0] += ((inc*lcv)>>8); - path_pos[1] += ((inc*lcv)>>8); - - path_x[0] = x_left; - path_y[0] = y_left; - } - - ////////////////////////////////////////////// - // zone 2 - segments = abs(y_right - path_y[1]); - - // prevent overdraw - if(y_right>=path_raster[2]) segments=0; - else path_raster[2]=y_right; - - // don't draw outside the window - if(path_raster[2]0) - { - // use previous data - dx1 = (envelope1 * path_plane[1] / view_plane); - dx2 = (envelope2 * path_plane[1] / view_plane); - - // use temporary envelope pitch (this frame only) - dx3 = (envelope1 * plane / view_plane); - dx4 = (envelope2 * plane / view_plane); - - // project new shapes (left side) - x1_final = x_left+dx1; - x2_final = path_x[1]+dx3; - - // interpolate between projected points with shaping - left_inc = ((x2_final-x1_final)<<8)/segments; - - // project new shapes (right side) - x1_final = x_left+dx2; - x2_final = path_x[1]+dx4; - - // interpolate between projected points with shaping - right_inc = ((x2_final-x1_final)<<8)/segments; - - path_plane[1] = plane; - } - - // write out results - DSP4.out_count += (2+4*segments); - DSP4_WRITE_WORD(index,segments); index+=2; - - for( lcv=1; lcv<=segments; lcv++ ) - { - int16 pos1,pos2; - - // pre-compute - pos1 = path_pos[2]+((left_inc*lcv)>>8)+dx1; - pos2 = path_pos[3]+((right_inc*lcv)>>8)+dx2; - - // clip offscreen data - if(pos1path_clipRight[2]) pos1 = path_clipRight[2]; - if(pos2path_clipRight[3]) pos2 = path_clipRight[3]; - -#if 0 - if(pos1==0x00ff) pos1=0; - if(pos2==0x00ff) pos2=0; - path_ptr[2] = -1; - //pos1 = -1; - pos2 = -1; -#endif - - // data - DSP4_WRITE_WORD(index,path_ptr[2]); index+=2; - DSP4.output[index++]=pos1&0xFF; - DSP4.output[index++]=pos2&0xFF; - - // post-update - path_ptr[2] -= 4; - path_ptr[3] -= 4; - } - lcv--; - - if(segments>0) - { - // project points w/out the envelopes - int16 inc = ((path_x[1]-x_right)<<8)/segments; - - // post-store - path_pos[2] += ((inc*lcv)>>8); - path_pos[3] += ((inc*lcv)>>8); - - path_x[1] = x_right; - path_y[1] = y_right; - } - } - } while(1); - - DSP4.waiting4command = TRUE; - DSP4.out_count = 2; - DSP4_WRITE_WORD(0,0); -} - -#undef PRINT - -#if OP==0x000D -#define PRINT -#endif - -void DSP4_Op0D() -{ - uint16 command; - - DSP4.waiting4command = FALSE; - - // op flow control - switch(DSP4_Logic) { - case 1: goto resume1; break; - case 2: goto resume2; break; - } - - //////////////////////////////////////////////////// - // process initial inputs - - // sort inputs - // 0x00 = DSP4_READ_WORD(0x00); - project_focaly = DSP4_READ_WORD(0x02); - raster = DSP4_READ_WORD(0x04); - viewport_top = DSP4_READ_WORD(0x06); - project_y = DSP4_READ_WORD(0x08); - viewport_bottom = DSP4_READ_WORD(0x0a); - project_x1low = DSP4_READ_WORD(0x0c); - project_x1 = DSP4_READ_WORD(0x0e); - project_focalx = DSP4_READ_WORD(0x0e); - project_centerx = DSP4_READ_WORD(0x10); - project_ptr = DSP4_READ_WORD(0x12); - // 0xc0 = DSP4_READ_WORD(0x14); - project_pitchylow = DSP4_READ_WORD(0x16); - project_pitchy = DSP4_READ_WORD(0x18); - project_pitchxlow = DSP4_READ_WORD(0x1a); - project_pitchx = DSP4_READ_WORD(0x1c); - far_plane = DSP4_READ_WORD(0x1e); - // ? = DSP4_READ_WORD(0x20); - - // multi-op storage - multi_index1++; - multi_index1%=4; - - // remap 0D->09 window data ahead of time - // index starts at 1-3,0 - // - // Op0D: BL,TL,BR,TR - // Op09: TL,TR,BL,BR (1,2,3,0) - switch(multi_index1) - { - case 1: multi_index2=3; break; - case 2: multi_index2=1; break; - case 3: multi_index2=0; break; - case 0: multi_index2=2; break; - } - - // pre-compute - view_plane = PLANE_START; - - // figure out projection data - project_y -= viewport_bottom; - - // debug - block=0; - - //////////////////////////////////////////////////// - // command check - - do { - // scan next command - DSP4.in_count = 2; - - DSP4_WAIT(1) resume1: - - // inspect input - command = DSP4_READ_WORD(0); - - // terminate op - if(command == 0x8000) break; - - // already have 2 bytes in queue - DSP4.in_index = 2; - DSP4.in_count = 8; - - DSP4_WAIT(2) resume2: - - //////////////////////////////////////////////////// - // project section of the track - - // inspect inputs - int16 plane = DSP4_READ_WORD(0); - int16 index, lcv; - int16 py_dy=0, px_dx=0; - int16 y_out, x_out; - int16 envelope = DSP4_READ_WORD(6); - int16 project_x; - - // ignore invalid data - if((uint16) plane == 0x8001) continue; - - // one-time init - if(far_plane) - { - // setup final data - // low16=plane - project_x1 = project_focalx; - project_y1 = project_focaly; - plane = far_plane; - far_plane = 0; - - // track occlusion - multi_farplane[multi_index2] = plane; - multi_raster[multi_index2] = viewport_bottom; - } - - // use proportional triangles to project new coords - project_x2 = project_focalx * plane / view_plane; - project_y2 = project_focaly * plane / view_plane; - - // quadratic regression (rough) - if(project_focaly>=-0x0f) - py_dy = project_focaly * project_focaly * -0.20533553 - - 1.08330005 * project_focaly - 69.61094639; - else - py_dy = project_focaly * project_focaly * -0.000657035759 - - 1.07629051 * project_focaly - 65.69315963; - - // approximate # of raster lines - segments = abs(project_y2-project_y1); - - // prevent overdraw - if(project_y2>=raster) segments=0; - else raster=project_y2; - - // don't draw outside the window - if(project_y20) - { - // interpolate between projected points - px_dx = ((project_x2-project_x1)<<8)/segments; - } - - // debug - ++block; - -#ifdef PRINT - printf("(line %d) Op0D check %02X, plane %04X\n",c,(uint16)segments,(uint16)(plane)); -#endif - - // prepare output - DSP4.out_count=8+2+6*segments; - - DSP4_WRITE_WORD(0,project_focalx); - DSP4_WRITE_WORD(2,project_x2); - DSP4_WRITE_WORD(4,project_focaly); - DSP4_WRITE_WORD(6,project_y2); - DSP4_WRITE_WORD(8,segments); -#if 0 - DSP4_WRITE_WORD(0,-1); - DSP4_WRITE_WORD(2,-1); - DSP4_WRITE_WORD(4,-1); - //DSP4_WRITE_WORD(6,-1); - DSP4_WRITE_WORD(8,-1); -#endif - - index=10; - - project_x = project_centerx + project_x1; - - // iterate through each point - for( lcv=0; lcv>8); - x_out = project_x+((px_dx*lcv)>>8); - - // factor in dynamic track changes - y_out += envelope; - -#if 0 - project_ptr=-1; - y_out=-1; - x_out=-1; -#endif - - // data - DSP4_WRITE_WORD(index+0,project_ptr); - DSP4_WRITE_WORD(index+2,y_out); - DSP4_WRITE_WORD(index+4,x_out); - index += 6; - - // post-update - project_ptr -= 4; - } - - // post-update - project_y += ((py_dy*lcv)>>8); - - if(segments > 0) - { - project_x1 = project_x2; - project_y1 = project_y2; - - // track occlusion: can't see anything below it - multi_farplane[multi_index2] = plane; - multi_raster[multi_index2] -= segments; - } - - // update focal projection points - project_pitchy += (int8)DSP4.parameters[3]; - project_pitchx += (int8)DSP4.parameters[5]; - - project_focaly += project_pitchy; - project_focalx += project_pitchx; - } while(1); - - DSP4.waiting4command = TRUE; - DSP4.out_count = 0; -} - -#undef PRINT - -#if OP==0x0009 -#define PRINT -#endif - -#if OP==0x0006 -#define PRINT -#endif - -void DSP4_Op09() -{ - uint16 command; - - DSP4.waiting4command = FALSE; - - // op flow control - switch(DSP4_Logic) { - case 1: goto resume1; break; - case 2: goto resume2; break; - case 3: goto resume3; break; - case 4: goto resume4; break; - case 5: goto resume5; break; - case 6: goto resume6; break; - case 7: goto resume7; break; - } - - //////////////////////////////////////////////////// - // process initial inputs - - // debug - block=0; - - // grab screen information - view_plane = PLANE_START; - center_x = DSP4_READ_WORD(0x00); - center_y = DSP4_READ_WORD(0x02); - // 0x00 = DSP4_READ_WORD(0x04); - viewport_left = DSP4_READ_WORD(0x06); - viewport_right = DSP4_READ_WORD(0x08); - viewport_top = DSP4_READ_WORD(0x0a); - viewport_bottom = DSP4_READ_WORD(0x0c); - -#ifdef PRINT2 - printf("Window: (%04X,%04X) (%04X,%04X)\n", - viewport_left,viewport_right,viewport_top,viewport_bottom); -#endif - - // cycle through viewport window data - multi_index1++; - multi_index1%=4; - - goto no_sprite; - - do { - //////////////////////////////////////////////////// - // check for new sprites - - do { - uint16 second; - - DSP4.in_count = 4; - DSP4.in_index = 2; - - DSP4_WAIT(1) resume1: - - // try to classify sprite - second = DSP4_READ_WORD(2); - - // op termination - if(second == 0x8000) goto terminate; - - second >>= 8; - sprite_type = 0; - - // vehicle sprite - if(second == 0x90) - { - sprite_type = 1; - break; - } - // terrain sprite - else if(second != 0) - { - sprite_type = 2; - break; - } - -no_sprite: - // no sprite. try again - - DSP4.in_count = 2; - - DSP4_WAIT(2) resume2: - ; - } while (1); - - //////////////////////////////////////////////////// - // process projection information - -sprite_found: - // vehicle sprite - if(sprite_type == 1) - { - int16 plane; - int16 car_left, car_right, car_left_a; - int16 focal_back, focal_front; - uint8 distance, id; - - // we already have 4 bytes we want - DSP4.in_count = 6+12; - DSP4.in_index = 4; - - DSP4_WAIT(3) resume3: - - // filter inputs - project_y1 = DSP4_READ_WORD(0x00); - // 0x9000 = DSP4_READ_WORD(0x02); - id = DSP4.parameters[0x04]; - distance = DSP4.parameters[0x05]; - focal_back = DSP4_READ_WORD(0x06); - focal_front = DSP4_READ_WORD(0x08); - car_left_a = DSP4_READ_WORD(0x0a); - car_left = DSP4_READ_WORD(0x0c); - plane = DSP4_READ_WORD(0x0e); - car_right = DSP4_READ_WORD(0x10); - - // calculate car's x-center - project_focalx = car_right-car_left; - - // determine how far into the screen to project - project_focaly = focal_back; - project_x = project_focalx * plane / view_plane; - segments = 0x33 - project_focaly * plane / view_plane; - far_plane = plane; - - // prepare memory - sprite_x = center_x+project_x; - sprite_y = viewport_bottom-segments; - far_plane = plane; - - // debug - ++block; -#ifdef PRINT - printf("(line %d) Op09 vehicle block %d, Loop %04X\n",c,block,(uint16)project_y1); - //printf("%04X %04X %04X %04X / ",focal_back,focal_front,car_left_a,car_left); - //printf("%02X %02X ", distance, id); -#endif - - // make the car's x-center available - DSP4.out_count = 2; - DSP4_WRITE_WORD(0,project_focalx); - -#if 0 - DSP4_WRITE_WORD(0,-1); -#endif - - // grab a few remaining vehicle values - DSP4.in_count = 4; - - DSP4_WAIT(4) resume4: - - // store final values - int height = DSP4_READ_WORD(0); - sprite_offset = DSP4_READ_WORD(2); - - // vertical lift factor - sprite_y += height; - -#ifdef PRINT_09 - printf("%04X\n",sprite_offset); -#endif - } - // terrain sprite - else if(sprite_type == 2) - { - int16 plane; - - // we already have 4 bytes we want - DSP4.in_count = 6+6+2; - DSP4.in_index = 4; - - DSP4_WAIT(5) resume5: - - // sort loop inputs - project_y1 = DSP4_READ_WORD(0x00); - plane = DSP4_READ_WORD(0x02); - project_centerx = DSP4_READ_WORD(0x04); - //project_y1 = DSP4_READ_WORD(0x06); - project_focalx = DSP4_READ_WORD(0x08); - project_focaly = DSP4_READ_WORD(0x0a); - sprite_offset = DSP4_READ_WORD(0x0c); - - // determine distances into virtual world - segments = 0x33 - project_y1; - project_x = project_focalx * plane / view_plane; - project_y = project_focaly * plane / view_plane; - - // prepare memory - sprite_x = center_x+project_x-project_centerx; - sprite_y = viewport_bottom-segments+project_y; - far_plane = plane; - - // debug - ++block; -#ifdef PRINT - printf("(line %d) Op09 terrain block %d, Loop %04X\n",c,block,(uint16)project_y1); -#endif - } - - // default sprite size: 16x16 - sprite_size = 1; - - //////////////////////////////////////////////////// - // convert tile data to OAM - - do { - DSP4.in_count = 2; - - DSP4_WAIT(6) resume6: - - command = DSP4_READ_WORD(0); - - // opcode termination - if(command == 0x8000) goto terminate; - - // toggle sprite size - if(command == 0x0000) - { - sprite_size = !sprite_size; -#ifdef PRINT - //printf("TOGGLE=%02X\n",(uint8)sprite_size); -#endif - continue; - } - - // new sprite information - command >>= 8; - if(command != 0x20 && command != 0x40 && - command != 0x60 && command != 0xa0 && - command != 0xc0 && command != 0xe0) - break; - - DSP4.in_count = 6; - DSP4.in_index = 2; - - DSP4_WAIT(7) resume7: - - ///////////////////////////////////// - // process tile data - - bool8 clip; - int16 sp_x, sp_y, sp_oam, sp_msb; - int16 sp_dx, sp_dy; - int16 expand = sprite_size ? 15:7; - - // sprite deltas - sp_dy = DSP4_READ_WORD(2); - sp_dx = DSP4_READ_WORD(4); - - // update coordinates - sp_y = sprite_y + sp_dy; - sp_x = sprite_x + sp_dx; - - // reject points outside the clipping window - clip = FALSE; - - // window clipping - if(sp_x < viewport_left-expand || sp_x > viewport_right) clip=TRUE; - if(sp_y < viewport_top || sp_y > viewport_bottom) clip=TRUE; - - // track occlusion: - // clip any tiles that are below the road - if(far_plane <= multi_farplane[multi_index1] && - (sp_y>>3) >= (multi_raster[multi_index1]>>3)) clip=TRUE; - - // tile limitations - if ((sp_y >= -expand) && ((sp_y < 0) || ((sp_y & 0x01ff) < 0x00eb)) && !clip) - { - short Row = (sp_y >> 3) & 0x1f; - - if(!sprite_size) - { - // 1x1 tile - if (RowCount[Row] < MaxTilesPerRow) - RowCount[Row]++; - else - clip=TRUE; - } - else - { - // 2x2 tile - if ((RowCount[Row+0]+1 < MaxTilesPerRow) && - (RowCount[Row+1]+1 < MaxTilesPerRow)) - { - RowCount[Row+0]+=2; - RowCount[Row+1]+=2; - } - else - clip=TRUE; - } - } - -#ifdef PRINT - printf("(line %d) %04X, %04X, %04X / %04X %04X\n",line, - (uint16)sp_x,(uint16)sp_y,(uint16)far_plane,(uint16)multi_farplane[multi_index1],(uint16)multi_raster[multi_index1]); -#endif - - // don't draw offscreen coordinates - DSP4.out_count = 0; - if(!clip) - { - int16 out_index = 0; - int16 offset = DSP4_READ_WORD(0); - - // update sprite nametable/attribute information - sp_oam = sprite_offset + offset; - sp_msb = (sp_x<0 || sp_x>255); - -#ifdef PRINT2 - printf("(line %d) %04X, %04X, %04X, %04X, %04X\n",line, - (uint16)sp_oam,(uint16)sprite_offset,(uint16)offset, - (uint16)sp_x,(uint16)sp_y); -#endif - - // emit transparency information - if( - (sprite_offset&0x08) && - ((sprite_type==1 && sp_y>=0xcc) || - (sprite_type==2 && sp_y>=0xbb)) - ) - { - DSP4.out_count = 6; - - // one block of OAM data - DSP4_WRITE_WORD(0,1); - - // OAM: x,y,tile,no attr - DSP4.output[2] = sp_x&0xFF; - DSP4.output[3] = (sp_y+6)&0xFF; - DSP4_WRITE_WORD(4,0xEE); - - out_index = 6; - - // OAM: size,msb data - DSP4_Op06(sprite_size,sp_msb); - -#if 0 - //DSP4_WRITE_WORD(0,-1); - DSP4_WRITE_WORD(2,-1); - DSP4_WRITE_WORD(4,-1); -#endif - } - - // normal data - DSP4.out_count += 8; - - // one block of OAM data - DSP4_WRITE_WORD(out_index+0,1); - - // OAM: x,y,tile,attr - DSP4.output[out_index+2] = sp_x&0xFF; - DSP4.output[out_index+3] = sp_y&0xFF; - DSP4_WRITE_WORD(out_index+4,sp_oam); - - // no following OAM data - DSP4_WRITE_WORD(out_index+6,0); - - // OAM: size,msb data - DSP4_Op06(sprite_size,sp_msb); - -#if 0 - //DSP4_WRITE_WORD(out_index+0,-1); - DSP4_WRITE_WORD(out_index+2,-1); - DSP4_WRITE_WORD(out_index+4,-1); -#endif - } - - // no sprite information - if(DSP4.out_count == 0) - { - DSP4.out_count = 2; - DSP4_WRITE_WORD(0,0); - } - } while (1); - - ///////////////////////////////////// - // special cases: plane == 0x0000 - - // special vehicle case - if(command == 0x90) - { - sprite_type = 1; - - // shift bytes - DSP4.parameters[2] = DSP4.parameters[0]; - DSP4.parameters[3] = DSP4.parameters[1]; - DSP4.parameters[0] = 0; - DSP4.parameters[1] = 0; - - goto sprite_found; - } - // special terrain case - else if(command != 0x00 && command != 0xff) - { - sprite_type = 2; - - // shift bytes - DSP4.parameters[2] = DSP4.parameters[0]; - DSP4.parameters[3] = DSP4.parameters[1]; - DSP4.parameters[0] = 0; - DSP4.parameters[1] = 0; - - goto sprite_found; - } - } while (1); - -terminate: - DSP4.waiting4command = TRUE; - DSP4.out_count=0; -} - -#undef PRINT +*******************************************************************************/ + +// Due recognition and credit are given on Overload's DSP website. +// Thank those contributors for their hard work on this chip. + +#include "dsp4.h" + +#define DSP4_READ_WORD(x) \ + READ_WORD(DSP4.parameters+x) + +#define DSP4_WRITE_WORD(x,d) \ + WRITE_WORD(DSP4.output+x,d); + +// used to wait for dsp i/o +#define DSP4_WAIT(x) \ + DSP4_Logic = x; return; + +////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////// + +void DSP4_Multiply(short Multiplicand, short Multiplier, int &Product) +{ + Product = (Multiplicand * Multiplier << 1) >> 1; +} + +void DSP4_UnknownOP11(short A, short B, short C, short D, short &M) +{ + // 0x155 = 341 = Horizontal Width of the Screen + M = ((A * 0x0155 >> 2) & 0xf000) | ((B * 0x0155 >> 6) & 0x0f00) | + ((C * 0x0155 >> 10) & 0x00f0) | ((D * 0x0155 >> 14) & 0x000f); +} + +const unsigned short Op0A_Values[16] = { + 0x0000, 0x0030, 0x0060, 0x0090, 0x00c0, 0x00f0, 0x0120, 0x0150, + 0xfe80, 0xfeb0, 0xfee0, 0xff10, 0xff40, 0xff70, 0xffa0, 0xffd0 +}; + +void DSP4_Op0A(short n2, short &o1, short &o2, short &o3, short &o4) +{ + o4 = Op0A_Values[(n2 & 0x000f)]; + o3 = Op0A_Values[(n2 & 0x00f0) >> 4]; + o2 = Op0A_Values[(n2 & 0x0f00) >> 8]; + o1 = Op0A_Values[(n2 & 0xf000) >> 12]; +} + +////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////// + +#if OP==0x0009 +#define PRINT +#endif + +void DSP4_Op03() +{ +#ifdef PRINT + printf("Op03\n"); +#endif + + MaxTilesPerRow = 33; + + for (int i=0; i < 32; i++) + RowCount[i] = 0; + + // reset op09 data + op09_mode = 0; +} + +void DSP4_Op0E() +{ +#ifdef PRINT + printf("Op0E\n"); +#endif + + MaxTilesPerRow = 16; + + for (int i=0; i < 32; i++) + RowCount[i] = 0; + + // reset op09 data + op09_mode = 1; +} + +#undef PRINT + +void DSP4_Op06(bool8 size, bool8 msb) +{ + // save post-oam table data for future retrieval + op06_OAM[op06_index] |= (msb<<(op06_offset+0)); + op06_OAM[op06_index] |= (size<<(op06_offset+1)); + op06_offset += 2; + + if(op06_offset==8) + { + // move to next byte in buffer + op06_offset=0; + op06_index++; + } +} + +#if OP==0x0001 +#define PRINT +#endif + +void DSP4_Op01() +{ + uint16 command; + + DSP4.waiting4command = FALSE; + + // op flow control + switch(DSP4_Logic) { + case 1: goto resume1; break; + case 2: goto resume2; break; + } + + //////////////////////////////////////////////////// + // process initial inputs + + // sort inputs + // 0x00 = DSP4_READ_WORD(0x00); + project_focaly = DSP4_READ_WORD(0x02); + raster = DSP4_READ_WORD(0x04); + viewport_top = DSP4_READ_WORD(0x06); + project_y = DSP4_READ_WORD(0x08); + viewport_bottom = DSP4_READ_WORD(0x0a); + project_x1low = DSP4_READ_WORD(0x0c); + project_focalx = DSP4_READ_WORD(0x0e); + project_centerx = DSP4_READ_WORD(0x10); + project_ptr = DSP4_READ_WORD(0x12); + // (envelope?) 0xc0 = DSP4_READ_WORD(0x14); + project_pitchylow = DSP4_READ_WORD(0x16); + project_pitchy = DSP4_READ_WORD(0x18); + project_pitchxlow = DSP4_READ_WORD(0x1a); + project_pitchx = DSP4_READ_WORD(0x1c); + far_plane = DSP4_READ_WORD(0x1e); + // ? = DSP4_READ_WORD(0x20); + project_y1low = DSP4_READ_WORD(0x22); + + // pre-compute + view_plane = PLANE_START; + + // find starting projection points + project_x1 = project_focalx; + project_y -= viewport_bottom; + + // multi-op storage + multi_index1 = 0; + multi_index2 = 0; + + // debug + block=0; + + //////////////////////////////////////////////////// + // command check + + do { + // scan next command + DSP4.in_count = 2; + + DSP4_WAIT(1) resume1: + + // inspect input + command = DSP4_READ_WORD(0); + + // check for termination + if(command == 0x8000) break; + + // already have 2 bytes in queue + DSP4.in_index = 2; + DSP4.in_count = 8; + + DSP4_WAIT(2) resume2: + + //////////////////////////////////////////////////// + // process one iteration of projection + + // inspect inputs + int16 plane = DSP4_READ_WORD(0); + int16 index, lcv; + int16 py_dy=0, px_dx=0; + int16 y_out, x_out; + int16 envelope = DSP4_READ_WORD(6); + int16 project_x; + + // ignore invalid data + if((uint16) plane == 0x8001) continue; + + // one-time init + if(far_plane) + { + // setup final parameters + project_focalx += plane; + project_x1 = project_focalx; + project_y1 = project_focaly; + plane = far_plane; + far_plane = 0; + + // track occlusion + multi_farplane[1] = plane; + multi_raster[1] = viewport_bottom; + } + + // use proportional triangles to project new coords + project_x2 = project_focalx * plane / view_plane; + project_y2 = project_focaly * plane / view_plane; + + // quadratic regression (rough) + if(project_focaly>=-0x0f) + py_dy = project_focaly * project_focaly * -0.20533553 + - 1.08330005 * project_focaly - 69.61094639; + else + py_dy = project_focaly * project_focaly * -0.000657035759 + - 1.07629051 * project_focaly - 65.69315963; + + // approximate # of raster lines + segments = abs(project_y2-project_y1); + + // prevent overdraw + if(project_y2>=raster) segments=0; + else raster=project_y2; + + // don't draw outside the window + if(project_y20) + { + // interpolate between projected points + px_dx = ((project_x2-project_x1)<<8)/segments; + } + + // debug + ++block; +#ifdef PRINT + printf("(line %d) Op01 check %02X, plane %04X, focal_y %04X, y2 %04X, y1 %04X\n",c,(uint16)segments,(uint16)(plane),(uint16)project_focaly,(uint16)project_y2,(uint16)project_y1); +#endif + + // prepare output + DSP4.out_count=8+2+6*segments; + + // pre-block data + DSP4_WRITE_WORD(0,project_focalx); + DSP4_WRITE_WORD(2,project_x2); + DSP4_WRITE_WORD(4,project_focaly); + DSP4_WRITE_WORD(6,project_y2); + DSP4_WRITE_WORD(8,segments); + +#if 0 + DSP4_WRITE_WORD(0,-1); + DSP4_WRITE_WORD(2,-1); + DSP4_WRITE_WORD(4,-1); + DSP4_WRITE_WORD(6,-1); + DSP4_WRITE_WORD(8,-1); +#endif + + index=10; + + project_x = project_centerx + project_x1; + + // iterate through each point + for( lcv=0; lcv>8); + x_out = project_x+((px_dx*lcv)>>8); + + // factor in dynamic track changes + y_out += envelope; + +#if 0 + project_ptr=-1; + y_out=-1; + //x_out=-1; +#endif + + // data + DSP4_WRITE_WORD(index+0,project_ptr); + DSP4_WRITE_WORD(index+2,y_out); + DSP4_WRITE_WORD(index+4,x_out); + index += 6; + + // post-update + project_ptr -= 4; + } + + // post-update + project_y += ((py_dy*lcv)>>8); + + // new positions + if(segments>0) + { + project_x1 = project_x2; + project_y1 = project_y2; + + // storage of focals for op07 + multi_focaly[multi_index2++] = project_focaly; + + // track occlusion: can't see anything below it + multi_farplane[1] = plane; + multi_raster[1] -= segments; + } + + // update projection points + project_pitchy += (int8)DSP4.parameters[3]; + project_pitchx += (int8)DSP4.parameters[5]; + + project_focaly += project_pitchy; + project_focalx += project_pitchx; + } while (1); + + // terminate op + DSP4.waiting4command = TRUE; + DSP4.out_count = 0; +} + +#undef PRINT + +#if OP==0x0007 +#define PRINT +#endif + +void DSP4_Op07() +{ + uint16 command; + + DSP4.waiting4command = FALSE; + + // op flow control + switch(DSP4_Logic) { + case 1: goto resume1; break; + case 2: goto resume2; break; + } + + //////////////////////////////////////////////////// + // sort inputs + + // 0x00 = DSP4_READ_WORD(0x00); + project_focaly = DSP4_READ_WORD(0x02); + raster = DSP4_READ_WORD(0x04); + viewport_top = DSP4_READ_WORD(0x06); + project_y = DSP4_READ_WORD(0x08); + viewport_bottom = DSP4_READ_WORD(0x0a); + project_x1low = DSP4_READ_WORD(0x0c); + project_x1 = DSP4_READ_WORD(0x0e); + project_centerx = DSP4_READ_WORD(0x10); + project_ptr = DSP4_READ_WORD(0x12); + // (envelope?) 0xc0 = DSP4_READ_WORD(0x14); + + // pre-compute + view_plane = PLANE_START; + + // find projection targets + project_y1 = project_focaly; + project_y -= viewport_bottom; + + // multi-op storage + multi_index2 = 0; + + // debug + block=0; + +#ifdef PRINT + printf("(line %d) Op07 data %04X\n",c,(uint16)project_y1); +#endif + + //////////////////////////////////////////////////// + // command check + + do { + // scan next command + DSP4.in_count = 2; + + DSP4_WAIT(1) resume1: + + // inspect input + command = DSP4_READ_WORD(0); + + // check for opcode termination + if(command == 0x8000) break; + + // already have 2 bytes in queue + DSP4.in_index = 2; + DSP4.in_count = 12; + + DSP4_WAIT(2) resume2: + + //////////////////////////////////////////////////// + // process one loop of projection + + int16 plane; + int16 index,lcv; + int16 y_out,x_out; + int16 py_dy=0,px_dx=0; + int16 project_x; + + // debug + ++block; + + // inspect inputs + plane = DSP4_READ_WORD(0); + project_y2 = DSP4_READ_WORD(2); + // ? = DSP4_READ_WORD(4); + project_x2 = DSP4_READ_WORD(6); + int16 envelope = DSP4_READ_WORD(8); + + // ignore invalid data + if((uint16) plane == 0x8001) continue; + + // multi-op storage + project_focaly = multi_focaly[multi_index2]; + + // quadratic regression (rough) + if(project_focaly>=-0x0f) + py_dy = project_focaly * project_focaly * -0.20533553 + - 1.08330005 * project_focaly - 69.61094639; + else + py_dy = project_focaly * project_focaly * -0.000657035759 + - 1.07629051 * project_focaly - 65.69315963; + + // approximate # of raster lines + segments = abs(project_y2-project_y1); + + // prevent overdraw + if(project_y2>=raster) segments=0; + else raster=project_y2; + + // don't draw outside the window + if(project_y20) + { + // interpolate between projected points + px_dx = ((project_x2-project_x1)<<8)/segments; + } + +#ifdef PRINT + printf("(line %d) Op07 block %d, loc %04X, out %02X, project_x2 %04X\n",c,block,plane,segments,(uint16)project_x2); +#endif + + // prepare pre-output + DSP4.out_count=4+2+6*segments; + + DSP4_WRITE_WORD(0,project_x2); + DSP4_WRITE_WORD(2,project_y2); + DSP4_WRITE_WORD(4,segments); + +#if 0 + DSP4_WRITE_WORD(0,-1); + DSP4_WRITE_WORD(2,-1); + DSP4_WRITE_WORD(4,-1); +#endif + + index=6; + + project_x = project_centerx + project_x1; + + for( lcv=0; lcv>8); + x_out = project_x+((px_dx*lcv)>>8); + + // factor in dynamic track changes + y_out += envelope; + +#if 0 + project_ptr = -1; + //y_out = -1; + x_out = -1; +#endif + + // data + DSP4_WRITE_WORD(index+0,project_ptr); + DSP4_WRITE_WORD(index+2,y_out); + DSP4_WRITE_WORD(index+4,x_out); + index += 6; + + // post-update + project_ptr -= 4; + } + + // update internal variables + project_y += ((py_dy*lcv)>>8); + + // new positions + if(segments>0) + { + project_x1 = project_x2; + project_y1 = project_y2; + + // multi-op storage + multi_index2++; + } + } while(1); + + DSP4.waiting4command = TRUE; + DSP4.out_count = 0; +} + +#undef PRINT + +#if OP==0x0008 +#define PRINT +#endif + +void DSP4_Op08() +{ + uint16 command; + + DSP4.waiting4command = FALSE; + + // op flow control + switch(DSP4_Logic) { + case 1: goto resume1; break; + case 2: goto resume2; break; + } + + //////////////////////////////////////////////////// + // process initial inputs + + // clip values + path_clipRight[0] = DSP4_READ_WORD(0x00); + path_clipRight[1] = DSP4_READ_WORD(0x02); + path_clipRight[2] = DSP4_READ_WORD(0x04); + path_clipRight[3] = DSP4_READ_WORD(0x06); + + path_clipLeft[0] = DSP4_READ_WORD(0x08); + path_clipLeft[1] = DSP4_READ_WORD(0x0a); + path_clipLeft[2] = DSP4_READ_WORD(0x0c); + path_clipLeft[3] = DSP4_READ_WORD(0x0e); + + // unknown (constant) + // unknown (constant) + + // path positions + path_pos[0] = DSP4_READ_WORD(0x20); + path_pos[1] = DSP4_READ_WORD(0x22); + path_pos[2] = DSP4_READ_WORD(0x24); + path_pos[3] = DSP4_READ_WORD(0x26); + + // data locations + path_ptr[0] = DSP4_READ_WORD(0x28); + path_ptr[1] = DSP4_READ_WORD(0x2a); + path_ptr[2] = DSP4_READ_WORD(0x2c); + path_ptr[3] = DSP4_READ_WORD(0x2e); + + // project_y1 lines + path_raster[0] = DSP4_READ_WORD(0x30); + path_raster[1] = DSP4_READ_WORD(0x32); + path_raster[2] = DSP4_READ_WORD(0x34); + path_raster[3] = DSP4_READ_WORD(0x36); + + // viewport_top + path_top[0] = DSP4_READ_WORD(0x38); + path_top[1] = DSP4_READ_WORD(0x3a); + path_top[2] = DSP4_READ_WORD(0x3c); + path_top[3] = DSP4_READ_WORD(0x3e); + + // unknown (constants) + + view_plane = PLANE_START; + + // debug + block=0; + + //////////////////////////////////////////////////// + // command check + + do { + // scan next command + DSP4.in_count = 2; + + DSP4_WAIT(1) resume1: + + // inspect input + command = DSP4_READ_WORD(0); + + // terminate op + if(command == 0x8000) break; + + // already have 2 bytes in queue + DSP4.in_index = 2; + DSP4.in_count = 18; + + DSP4_WAIT(2) resume2: + + //////////////////////////////////////////////////// + // projection begins + + // debug + ++block; + + // used in envelope shaping + int16 x1_final; + int16 x2_final; + + // look at guidelines + int16 plane = DSP4_READ_WORD(0x00); + int16 x_left = DSP4_READ_WORD(0x02); + int16 y_left = DSP4_READ_WORD(0x04); + int16 x_right = DSP4_READ_WORD(0x06); + int16 y_right = DSP4_READ_WORD(0x08); + + // envelope guidelines (one frame only) + int16 envelope1 = DSP4_READ_WORD(0x0a); + int16 envelope2 = DSP4_READ_WORD(0x0c); + int16 envelope3 = DSP4_READ_WORD(0x0e); + int16 envelope4 = DSP4_READ_WORD(0x10); + + // ignore invalid data + if((uint16) plane == 0x8001) continue; + + // first init + if(plane == 0x7fff) + { + int pos1,pos2; + + // initialize projection + path_x[0] = x_left; + path_x[1] = x_right; + + path_y[0] = y_left; + path_y[1] = y_right; + + // update coordinates + path_pos[0]-=x_left; + path_pos[1]-=x_left; + path_pos[2]-=x_right; + path_pos[3]-=x_right; + + pos1 = path_pos[0]+envelope1; + pos2 = path_pos[1]+envelope2; + + // clip offscreen data + if(pos1path_clipRight[0]) pos1 = path_clipRight[0]; + if(pos2path_clipRight[1]) pos2 = path_clipRight[1]; + +#if 0 + pos1=-1; + //pos2=-1; +#endif + + path_plane[0] = plane; + path_plane[1] = plane; + + // initial output + DSP4.out_count = 2; + DSP4.output[0]=pos1&0xFF; + DSP4.output[1]=pos2&0xFF; + +#ifdef PRINT + printf("(line %d) Op08 x_left %04X\n",c,(uint16)x_left); +#endif + } + // proceed with projection + else + { + int16 index=0, lcv; + int16 left_inc=0,right_inc=0; + int16 dx1,dx2,dx3,dx4; + + // # segments to traverse + segments = abs(y_left - path_y[0]); + + // prevent overdraw + if(y_left>=path_raster[0]) segments=0; + else path_raster[0]=y_left; + + // don't draw outside the window + if(path_raster[0]0) + { + // use previous data + dx1 = (envelope1 * path_plane[0] / view_plane); + dx2 = (envelope2 * path_plane[0] / view_plane); + + // use temporary envelope pitch (this frame only) + dx3 = (envelope1 * plane / view_plane); + dx4 = (envelope2 * plane / view_plane); + + // project new shapes (left side) + x1_final = x_left+dx1; + x2_final = path_x[0]+dx3; + + // interpolate between projected points with shaping + left_inc = ((x2_final-x1_final)<<8)/segments; + + // project new shapes (right side) + x1_final = x_left+dx2; + x2_final = path_x[0]+dx4; + + // interpolate between projected points with shaping + right_inc = ((x2_final-x1_final)<<8)/segments; + + path_plane[0] = plane; + } + +#ifdef PRINT + printf("(line %d) Op08 block %d, out %02X, raster %02X\n",c,block,segments,(uint16)y_left); +#endif + + // zone 1 + DSP4.out_count = (2+4*segments); + DSP4_WRITE_WORD(index,segments); index+=2; + + for( lcv=1; lcv<=segments; lcv++ ) + { + int16 pos1,pos2; + + // pre-compute + pos1 = path_pos[0]+((left_inc*lcv)>>8)+dx1; + pos2 = path_pos[1]+((right_inc*lcv)>>8)+dx2; + + // clip offscreen data + if(pos1path_clipRight[0]) pos1 = path_clipRight[0]; + if(pos2path_clipRight[1]) pos2 = path_clipRight[1]; + +#if 0 + if(pos1==0x00ff) pos1=0; + if(pos2==0x00ff) pos2=0; + path_ptr[0] = -1; + pos1 = -1; + pos2 = -1; +#endif + + // data + DSP4_WRITE_WORD(index,path_ptr[0]); index+=2; + DSP4.output[index++]=pos1&0xFF; + DSP4.output[index++]=pos2&0xFF; + + // post-update + path_ptr[0] -= 4; + path_ptr[1] -= 4; + } + lcv--; + + if(segments>0) + { + // project points w/out the envelopes + int16 inc = ((path_x[0]-x_left)<<8)/segments; + + // post-store + path_pos[0] += ((inc*lcv)>>8); + path_pos[1] += ((inc*lcv)>>8); + + path_x[0] = x_left; + path_y[0] = y_left; + } + + ////////////////////////////////////////////// + // zone 2 + segments = abs(y_right - path_y[1]); + + // prevent overdraw + if(y_right>=path_raster[2]) segments=0; + else path_raster[2]=y_right; + + // don't draw outside the window + if(path_raster[2]0) + { + // use previous data + dx1 = (envelope1 * path_plane[1] / view_plane); + dx2 = (envelope2 * path_plane[1] / view_plane); + + // use temporary envelope pitch (this frame only) + dx3 = (envelope1 * plane / view_plane); + dx4 = (envelope2 * plane / view_plane); + + // project new shapes (left side) + x1_final = x_left+dx1; + x2_final = path_x[1]+dx3; + + // interpolate between projected points with shaping + left_inc = ((x2_final-x1_final)<<8)/segments; + + // project new shapes (right side) + x1_final = x_left+dx2; + x2_final = path_x[1]+dx4; + + // interpolate between projected points with shaping + right_inc = ((x2_final-x1_final)<<8)/segments; + + path_plane[1] = plane; + } + + // write out results + DSP4.out_count += (2+4*segments); + DSP4_WRITE_WORD(index,segments); index+=2; + + for( lcv=1; lcv<=segments; lcv++ ) + { + int16 pos1,pos2; + + // pre-compute + pos1 = path_pos[2]+((left_inc*lcv)>>8)+dx1; + pos2 = path_pos[3]+((right_inc*lcv)>>8)+dx2; + + // clip offscreen data + if(pos1path_clipRight[2]) pos1 = path_clipRight[2]; + if(pos2path_clipRight[3]) pos2 = path_clipRight[3]; + +#if 0 + if(pos1==0x00ff) pos1=0; + if(pos2==0x00ff) pos2=0; + path_ptr[2] = -1; + //pos1 = -1; + pos2 = -1; +#endif + + // data + DSP4_WRITE_WORD(index,path_ptr[2]); index+=2; + DSP4.output[index++]=pos1&0xFF; + DSP4.output[index++]=pos2&0xFF; + + // post-update + path_ptr[2] -= 4; + path_ptr[3] -= 4; + } + lcv--; + + if(segments>0) + { + // project points w/out the envelopes + int16 inc = ((path_x[1]-x_right)<<8)/segments; + + // post-store + path_pos[2] += ((inc*lcv)>>8); + path_pos[3] += ((inc*lcv)>>8); + + path_x[1] = x_right; + path_y[1] = y_right; + } + } + } while(1); + + DSP4.waiting4command = TRUE; + DSP4.out_count = 2; + DSP4_WRITE_WORD(0,0); +} + +#undef PRINT + +#if OP==0x000D +#define PRINT +#endif + +void DSP4_Op0D() +{ + uint16 command; + + DSP4.waiting4command = FALSE; + + // op flow control + switch(DSP4_Logic) { + case 1: goto resume1; break; + case 2: goto resume2; break; + } + + //////////////////////////////////////////////////// + // process initial inputs + + // sort inputs + // 0x00 = DSP4_READ_WORD(0x00); + project_focaly = DSP4_READ_WORD(0x02); + raster = DSP4_READ_WORD(0x04); + viewport_top = DSP4_READ_WORD(0x06); + project_y = DSP4_READ_WORD(0x08); + viewport_bottom = DSP4_READ_WORD(0x0a); + project_x1low = DSP4_READ_WORD(0x0c); + project_x1 = DSP4_READ_WORD(0x0e); + project_focalx = DSP4_READ_WORD(0x0e); + project_centerx = DSP4_READ_WORD(0x10); + project_ptr = DSP4_READ_WORD(0x12); + // 0xc0 = DSP4_READ_WORD(0x14); + project_pitchylow = DSP4_READ_WORD(0x16); + project_pitchy = DSP4_READ_WORD(0x18); + project_pitchxlow = DSP4_READ_WORD(0x1a); + project_pitchx = DSP4_READ_WORD(0x1c); + far_plane = DSP4_READ_WORD(0x1e); + // ? = DSP4_READ_WORD(0x20); + + // multi-op storage + multi_index1++; + multi_index1%=4; + + // remap 0D->09 window data ahead of time + // index starts at 1-3,0 + // + // Op0D: BL,TL,BR,TR + // Op09: TL,TR,BL,BR (1,2,3,0) + switch(multi_index1) + { + case 1: multi_index2=3; break; + case 2: multi_index2=1; break; + case 3: multi_index2=0; break; + case 0: multi_index2=2; break; + } + + // pre-compute + view_plane = PLANE_START; + + // figure out projection data + project_y -= viewport_bottom; + + // debug + block=0; + + //////////////////////////////////////////////////// + // command check + + do { + // scan next command + DSP4.in_count = 2; + + DSP4_WAIT(1) resume1: + + // inspect input + command = DSP4_READ_WORD(0); + + // terminate op + if(command == 0x8000) break; + + // already have 2 bytes in queue + DSP4.in_index = 2; + DSP4.in_count = 8; + + DSP4_WAIT(2) resume2: + + //////////////////////////////////////////////////// + // project section of the track + + // inspect inputs + int16 plane = DSP4_READ_WORD(0); + int16 index, lcv; + int16 py_dy=0, px_dx=0; + int16 y_out, x_out; + int16 envelope = DSP4_READ_WORD(6); + int16 project_x; + + // ignore invalid data + if((uint16) plane == 0x8001) continue; + + // one-time init + if(far_plane) + { + // setup final data + // low16=plane + project_x1 = project_focalx; + project_y1 = project_focaly; + plane = far_plane; + far_plane = 0; + + // track occlusion + multi_farplane[multi_index2] = plane; + multi_raster[multi_index2] = viewport_bottom; + } + + // use proportional triangles to project new coords + project_x2 = project_focalx * plane / view_plane; + project_y2 = project_focaly * plane / view_plane; + + // quadratic regression (rough) + if(project_focaly>=-0x0f) + py_dy = project_focaly * project_focaly * -0.20533553 + - 1.08330005 * project_focaly - 69.61094639; + else + py_dy = project_focaly * project_focaly * -0.000657035759 + - 1.07629051 * project_focaly - 65.69315963; + + // approximate # of raster lines + segments = abs(project_y2-project_y1); + + // prevent overdraw + if(project_y2>=raster) segments=0; + else raster=project_y2; + + // don't draw outside the window + if(project_y20) + { + // interpolate between projected points + px_dx = ((project_x2-project_x1)<<8)/segments; + } + + // debug + ++block; + +#ifdef PRINT + printf("(line %d) Op0D check %02X, plane %04X\n",c,(uint16)segments,(uint16)(plane)); +#endif + + // prepare output + DSP4.out_count=8+2+6*segments; + + DSP4_WRITE_WORD(0,project_focalx); + DSP4_WRITE_WORD(2,project_x2); + DSP4_WRITE_WORD(4,project_focaly); + DSP4_WRITE_WORD(6,project_y2); + DSP4_WRITE_WORD(8,segments); +#if 0 + DSP4_WRITE_WORD(0,-1); + DSP4_WRITE_WORD(2,-1); + DSP4_WRITE_WORD(4,-1); + //DSP4_WRITE_WORD(6,-1); + DSP4_WRITE_WORD(8,-1); +#endif + + index=10; + + project_x = project_centerx + project_x1; + + // iterate through each point + for( lcv=0; lcv>8); + x_out = project_x+((px_dx*lcv)>>8); + + // factor in dynamic track changes + y_out += envelope; + +#if 0 + project_ptr=-1; + y_out=-1; + x_out=-1; +#endif + + // data + DSP4_WRITE_WORD(index+0,project_ptr); + DSP4_WRITE_WORD(index+2,y_out); + DSP4_WRITE_WORD(index+4,x_out); + index += 6; + + // post-update + project_ptr -= 4; + } + + // post-update + project_y += ((py_dy*lcv)>>8); + + if(segments > 0) + { + project_x1 = project_x2; + project_y1 = project_y2; + + // track occlusion: can't see anything below it + multi_farplane[multi_index2] = plane; + multi_raster[multi_index2] -= segments; + } + + // update focal projection points + project_pitchy += (int8)DSP4.parameters[3]; + project_pitchx += (int8)DSP4.parameters[5]; + + project_focaly += project_pitchy; + project_focalx += project_pitchx; + } while(1); + + DSP4.waiting4command = TRUE; + DSP4.out_count = 0; +} + +#undef PRINT + +#if OP==0x0009 +#define PRINT +#endif + +#if OP==0x0006 +#define PRINT +#endif + +void DSP4_Op09() +{ + uint16 command; + + DSP4.waiting4command = FALSE; + + // op flow control + switch(DSP4_Logic) { + case 1: goto resume1; break; + case 2: goto resume2; break; + case 3: goto resume3; break; + case 4: goto resume4; break; + case 5: goto resume5; break; + case 6: goto resume6; break; + case 7: goto resume7; break; + } + + //////////////////////////////////////////////////// + // process initial inputs + + // debug + block=0; + + // grab screen information + view_plane = PLANE_START; + center_x = DSP4_READ_WORD(0x00); + center_y = DSP4_READ_WORD(0x02); + // 0x00 = DSP4_READ_WORD(0x04); + viewport_left = DSP4_READ_WORD(0x06); + viewport_right = DSP4_READ_WORD(0x08); + viewport_top = DSP4_READ_WORD(0x0a); + viewport_bottom = DSP4_READ_WORD(0x0c); + +#ifdef PRINT2 + printf("Window: (%04X,%04X) (%04X,%04X)\n", + viewport_left,viewport_right,viewport_top,viewport_bottom); +#endif + + // cycle through viewport window data + multi_index1++; + multi_index1%=4; + + goto no_sprite; + + do { + //////////////////////////////////////////////////// + // check for new sprites + + do { + uint16 second; + + DSP4.in_count = 4; + DSP4.in_index = 2; + + DSP4_WAIT(1) resume1: + + // try to classify sprite + second = DSP4_READ_WORD(2); + + // op termination + if(second == 0x8000) goto terminate; + + second >>= 8; + sprite_type = 0; + + // vehicle sprite + if(second == 0x90) + { + sprite_type = 1; + break; + } + // terrain sprite + else if(second != 0) + { + sprite_type = 2; + break; + } + +no_sprite: + // no sprite. try again + + DSP4.in_count = 2; + + DSP4_WAIT(2) resume2: + ; + } while (1); + + //////////////////////////////////////////////////// + // process projection information + +sprite_found: + // vehicle sprite + if(sprite_type == 1) + { + int16 plane; + int16 car_left, car_right, car_left_a; + int16 focal_back, focal_front; + uint8 distance, id; + + // we already have 4 bytes we want + DSP4.in_count = 6+12; + DSP4.in_index = 4; + + DSP4_WAIT(3) resume3: + + // filter inputs + project_y1 = DSP4_READ_WORD(0x00); + // 0x9000 = DSP4_READ_WORD(0x02); + id = DSP4.parameters[0x04]; + distance = DSP4.parameters[0x05]; + focal_back = DSP4_READ_WORD(0x06); + focal_front = DSP4_READ_WORD(0x08); + car_left_a = DSP4_READ_WORD(0x0a); + car_left = DSP4_READ_WORD(0x0c); + plane = DSP4_READ_WORD(0x0e); + car_right = DSP4_READ_WORD(0x10); + + // calculate car's x-center + project_focalx = car_right-car_left; + + // determine how far into the screen to project + project_focaly = focal_back; + project_x = project_focalx * plane / view_plane; + segments = 0x33 - project_focaly * plane / view_plane; + far_plane = plane; + + // prepare memory + sprite_x = center_x+project_x; + sprite_y = viewport_bottom-segments; + far_plane = plane; + + // debug + ++block; +#ifdef PRINT + printf("(line %d) Op09 vehicle block %d, Loop %04X\n",c,block,(uint16)project_y1); + //printf("%04X %04X %04X %04X / ",focal_back,focal_front,car_left_a,car_left); + //printf("%02X %02X ", distance, id); +#endif + + // make the car's x-center available + DSP4.out_count = 2; + DSP4_WRITE_WORD(0,project_focalx); + +#if 0 + DSP4_WRITE_WORD(0,-1); +#endif + + // grab a few remaining vehicle values + DSP4.in_count = 4; + + DSP4_WAIT(4) resume4: + + // store final values + int height = DSP4_READ_WORD(0); + sprite_offset = DSP4_READ_WORD(2); + + // vertical lift factor + sprite_y += height; + +#ifdef PRINT_09 + printf("%04X\n",sprite_offset); +#endif + } + // terrain sprite + else if(sprite_type == 2) + { + int16 plane; + + // we already have 4 bytes we want + DSP4.in_count = 6+6+2; + DSP4.in_index = 4; + + DSP4_WAIT(5) resume5: + + // sort loop inputs + project_y1 = DSP4_READ_WORD(0x00); + plane = DSP4_READ_WORD(0x02); + project_centerx = DSP4_READ_WORD(0x04); + //project_y1 = DSP4_READ_WORD(0x06); + project_focalx = DSP4_READ_WORD(0x08); + project_focaly = DSP4_READ_WORD(0x0a); + sprite_offset = DSP4_READ_WORD(0x0c); + + // determine distances into virtual world + segments = 0x33 - project_y1; + project_x = project_focalx * plane / view_plane; + project_y = project_focaly * plane / view_plane; + + // prepare memory + sprite_x = center_x+project_x-project_centerx; + sprite_y = viewport_bottom-segments+project_y; + far_plane = plane; + + // debug + ++block; +#ifdef PRINT + printf("(line %d) Op09 terrain block %d, Loop %04X\n",c,block,(uint16)project_y1); +#endif + } + + // default sprite size: 16x16 + sprite_size = 1; + + //////////////////////////////////////////////////// + // convert tile data to OAM + + do { + DSP4.in_count = 2; + + DSP4_WAIT(6) resume6: + + command = DSP4_READ_WORD(0); + + // opcode termination + if(command == 0x8000) goto terminate; + + // toggle sprite size + if(command == 0x0000) + { + sprite_size = !sprite_size; +#ifdef PRINT + //printf("TOGGLE=%02X\n",(uint8)sprite_size); +#endif + continue; + } + + // new sprite information + command >>= 8; + if(command != 0x20 && command != 0x40 && + command != 0x60 && command != 0xa0 && + command != 0xc0 && command != 0xe0) + break; + + DSP4.in_count = 6; + DSP4.in_index = 2; + + DSP4_WAIT(7) resume7: + + ///////////////////////////////////// + // process tile data + + bool8 clip; + int16 sp_x, sp_y, sp_oam, sp_msb; + int16 sp_dx, sp_dy; + int16 expand = sprite_size ? 15:7; + + // sprite deltas + sp_dy = DSP4_READ_WORD(2); + sp_dx = DSP4_READ_WORD(4); + + // update coordinates + sp_y = sprite_y + sp_dy; + sp_x = sprite_x + sp_dx; + + // reject points outside the clipping window + clip = FALSE; + + // window clipping + if(sp_x < viewport_left-expand || sp_x > viewport_right) clip=TRUE; + if(sp_y < viewport_top || sp_y > viewport_bottom) clip=TRUE; + + // track occlusion: + // clip any tiles that are below the road + if(far_plane <= multi_farplane[multi_index1] && + (sp_y>>3) >= (multi_raster[multi_index1]>>3)) clip=TRUE; + + // tile limitations + if ((sp_y >= -expand) && ((sp_y < 0) || ((sp_y & 0x01ff) < 0x00eb)) && !clip) + { + short Row = (sp_y >> 3) & 0x1f; + + if(!sprite_size) + { + // 1x1 tile + if (RowCount[Row] < MaxTilesPerRow) + RowCount[Row]++; + else + clip=TRUE; + } + else + { + // 2x2 tile + if ((RowCount[Row+0]+1 < MaxTilesPerRow) && + (RowCount[Row+1]+1 < MaxTilesPerRow)) + { + RowCount[Row+0]+=2; + RowCount[Row+1]+=2; + } + else + clip=TRUE; + } + } + +#ifdef PRINT + printf("(line %d) %04X, %04X, %04X / %04X %04X\n",line, + (uint16)sp_x,(uint16)sp_y,(uint16)far_plane,(uint16)multi_farplane[multi_index1],(uint16)multi_raster[multi_index1]); +#endif + + // don't draw offscreen coordinates + DSP4.out_count = 0; + if(!clip) + { + int16 out_index = 0; + int16 offset = DSP4_READ_WORD(0); + + // update sprite nametable/attribute information + sp_oam = sprite_offset + offset; + sp_msb = (sp_x<0 || sp_x>255); + +#ifdef PRINT2 + printf("(line %d) %04X, %04X, %04X, %04X, %04X\n",line, + (uint16)sp_oam,(uint16)sprite_offset,(uint16)offset, + (uint16)sp_x,(uint16)sp_y); +#endif + + // emit transparency information + if( + (sprite_offset&0x08) && + ((sprite_type==1 && sp_y>=0xcc) || + (sprite_type==2 && sp_y>=0xbb)) + ) + { + DSP4.out_count = 6; + + // one block of OAM data + DSP4_WRITE_WORD(0,1); + + // OAM: x,y,tile,no attr + DSP4.output[2] = sp_x&0xFF; + DSP4.output[3] = (sp_y+6)&0xFF; + DSP4_WRITE_WORD(4,0xEE); + + out_index = 6; + + // OAM: size,msb data + DSP4_Op06(sprite_size,sp_msb); + +#if 0 + //DSP4_WRITE_WORD(0,-1); + DSP4_WRITE_WORD(2,-1); + DSP4_WRITE_WORD(4,-1); +#endif + } + + // normal data + DSP4.out_count += 8; + + // one block of OAM data + DSP4_WRITE_WORD(out_index+0,1); + + // OAM: x,y,tile,attr + DSP4.output[out_index+2] = sp_x&0xFF; + DSP4.output[out_index+3] = sp_y&0xFF; + DSP4_WRITE_WORD(out_index+4,sp_oam); + + // no following OAM data + DSP4_WRITE_WORD(out_index+6,0); + + // OAM: size,msb data + DSP4_Op06(sprite_size,sp_msb); + +#if 0 + //DSP4_WRITE_WORD(out_index+0,-1); + DSP4_WRITE_WORD(out_index+2,-1); + DSP4_WRITE_WORD(out_index+4,-1); +#endif + } + + // no sprite information + if(DSP4.out_count == 0) + { + DSP4.out_count = 2; + DSP4_WRITE_WORD(0,0); + } + } while (1); + + ///////////////////////////////////// + // special cases: plane == 0x0000 + + // special vehicle case + if(command == 0x90) + { + sprite_type = 1; + + // shift bytes + DSP4.parameters[2] = DSP4.parameters[0]; + DSP4.parameters[3] = DSP4.parameters[1]; + DSP4.parameters[0] = 0; + DSP4.parameters[1] = 0; + + goto sprite_found; + } + // special terrain case + else if(command != 0x00 && command != 0xff) + { + sprite_type = 2; + + // shift bytes + DSP4.parameters[2] = DSP4.parameters[0]; + DSP4.parameters[3] = DSP4.parameters[1]; + DSP4.parameters[0] = 0; + DSP4.parameters[1] = 0; + + goto sprite_found; + } + } while (1); + +terminate: + DSP4.waiting4command = TRUE; + DSP4.out_count=0; +} + +#undef PRINT + diff -NaHudr snes9x-1.43-src/snes9x/dsp4.h snx/snes9x/dsp4.h --- snes9x-1.43-src/snes9x/dsp4.h 2004-12-31 00:15:47.000000000 +0200 +++ snx/snes9x/dsp4.h 2005-04-09 00:59:27.000000000 +0300 @@ -1,83 +1,83 @@ -// debug -int block; // current block number -extern int c; - -// op control -int8 DSP4_Logic; // controls op flow - -// projection format -const int16 PLANE_START = 0x7fff; // starting distance - -int16 view_plane; // viewer location -int16 far_plane; // next milestone into screen -int16 segments; // # raster segments to draw -int16 raster; // current raster line - -int16 project_x; // current x-position -int16 project_y; // current y-position - -int16 project_centerx; // x-target of projection -int16 project_centery; // y-target of projection - -int16 project_x1; // current x-distance -int16 project_x1low; // lower 16-bits -int16 project_y1; // current y-distance -int16 project_y1low; // lower 16-bits - -int16 project_x2; // next projected x-distance -int16 project_y2; // next projected y-distance - -int16 project_pitchx; // delta center -int16 project_pitchxlow; // lower 16-bits -int16 project_pitchy; // delta center -int16 project_pitchylow; // lower 16-bits - -int16 project_focalx; // x-point of projection at viewer plane -int16 project_focaly; // y-point of projection at viewer plane - -int16 project_ptr; // data structure pointer - -// render window -int16 center_x; // x-center of viewport -int16 center_y; // y-center of viewport -int16 viewport_left; // x-left of viewport -int16 viewport_right; // x-right of viewport -int16 viewport_top; // y-top of viewport -int16 viewport_bottom; // y-bottom of viewport - -// sprite structure -int16 sprite_x; // projected x-pos of sprite -int16 sprite_y; // projected y-pos of sprite -int16 sprite_offset; // data pointer offset -int8 sprite_type; // vehicle, terrain -bool8 sprite_size; // sprite size: 8x8 or 16x16 - -// path strips -int16 path_clipRight[4]; // value to clip to for x>b -int16 path_clipLeft[4]; // value to clip to for xb +int16 path_clipLeft[4]; // value to clip to for x> MEMMAP_SHIFT) & MEMMAP_MASK]; - if(!CPU.InDMA) +if (!free) if(!CPU.InDMA) CPU.Cycles += Memory.MemorySpeed [block]; if (GetAddress >= (uint8 *) CMemory::MAP_LAST) { #ifdef CPU_SHUTDOWN - if (Memory.BlockIsRAM [block]) +if (!free) if (Memory.BlockIsRAM [block]) CPU.WaitAddress = CPU.PCAtOpcodeStart; #endif return (*(GetAddress + (Address & 0xffff))); } - switch ((int) GetAddress) + switch ((long) GetAddress) { case CMemory::MAP_PPU: return (S9xGetPPU (Address & 0xffff)); @@ -194,24 +194,24 @@ } } -INLINE uint16 S9xGetWord (uint32 Address) +INLINE uint16 S9xGetWord (uint32 Address, bool free) { if ((Address & 0x0fff) == 0x0fff) { - OpenBus=S9xGetByte (Address); - return (OpenBus | (S9xGetByte (Address + 1) << 8)); + if (!free)OpenBus=S9xGetByte (Address,free); + return (OpenBus | (S9xGetByte (Address + 1, free) << 8)); } int block; uint8 *GetAddress = Memory.Map [block = (Address >> MEMMAP_SHIFT) & MEMMAP_MASK]; - if(!CPU.InDMA) +if (!free) if(!CPU.InDMA) CPU.Cycles += (Memory.MemorySpeed [block]<<1); if (GetAddress >= (uint8 *) CMemory::MAP_LAST) { #ifdef CPU_SHUTDOWN - if (Memory.BlockIsRAM [block]) +if (!free) if (Memory.BlockIsRAM [block]) CPU.WaitAddress = CPU.PCAtOpcodeStart; #endif #ifdef FAST_LSB_WORD_ACCESS @@ -222,7 +222,7 @@ #endif } - switch ((int) GetAddress) + switch ((long) GetAddress) { case CMemory::MAP_PPU: return (S9xGetPPU (Address & 0xffff) | @@ -346,7 +346,7 @@ return; } - switch ((int) SetAddress) + switch ((long) SetAddress) { case CMemory::MAP_PPU: S9xSetPPU (Byte, Address & 0xffff); @@ -479,7 +479,7 @@ return; } - switch ((int) SetAddress) + switch ((long) SetAddress) { case CMemory::MAP_PPU: S9xSetPPU ((uint8) Word, Address & 0xffff); @@ -600,7 +600,7 @@ { return s7r.bank50; } - switch ((int) GetAddress) + switch ((long) GetAddress) { case CMemory::MAP_SPC7110_DRAM: #ifdef SPC7110_DEBUG @@ -666,7 +666,7 @@ if(Settings.SPC7110&&((Address&0x7FFFFF)==0x4800)) return s7r.bank50; - switch ((int) GetAddress) + switch ((long) GetAddress) { case CMemory::MAP_SPC7110_DRAM: #ifdef SPC7110_DEBUG @@ -726,7 +726,7 @@ return; } - switch ((int) GetAddress) + switch ((long) GetAddress) { case CMemory::MAP_PPU: CPU.PCBase = Memory.FillRAM; diff -NaHudr snes9x-1.43-src/snes9x/gfx.cpp snx/snes9x/gfx.cpp --- snes9x-1.43-src/snes9x/gfx.cpp 2004-12-31 00:15:47.000000000 +0200 +++ snx/snes9x/gfx.cpp 2007-07-02 04:17:49.000000000 +0300 @@ -97,14 +97,17 @@ #include "apu.h" #include "cheats.h" #include "screenshot.h" +#include "movie.h" #define M7 19 #define M8 19 void output_png(); void ComputeClipWindows (); +static void S9xDisplayPressedKeys (); static void S9xDisplayFrameRate (); -static void S9xDisplayString (const char *string); +static void S9xDisplayString (const char *string, int linesFromBottom=5, bool allowWrap=true); + extern uint8 BitShifts[8][4]; extern uint8 TileShifts[8][4]; @@ -377,6 +380,8 @@ if (Settings.Transparency) Settings.SixteenBit = TRUE; + ZeroMemory(GFX.LastScreen, MAX_SNES_WIDTH * MAX_SNES_HEIGHT * 4); + IPPU.DirectColourMapsNeedRebuild = TRUE; GFX.PixSize = 1; if (Settings.SixteenBit) @@ -597,8 +602,8 @@ void S9xStartScreenRefresh () { - if (GFX.InfoStringTimeout > 0 && --GFX.InfoStringTimeout == 0) - GFX.InfoString = NULL; + if (GFX.InfoStringTimeout > 0 && --GFX.InfoStringTimeout == 0) + GFX.InfoString = NULL; if (IPPU.RenderThisFrame) { @@ -749,6 +754,105 @@ } } +bool watchesCleared=false; +void S9xDisplayWatchedAddresses () +{ +/* + if(!watchesCleared) + { + for(int i = 0 ; i < 12 ; i++) + watches[i].on = false; + watchesCleared = true; + } + + for(int i = 0 ; i < 12 ; i++) + { + if(!watches[i].on) + break; + + uint32 address = watches[i].address; + uint32 displayNumber = 0; + + int block = (address >> MEMMAP_SHIFT) & MEMMAP_MASK; + uint8 *ptr = Memory.Map [block]; + + extern struct SCheatData Cheat; + for(int r=0;r> 4) * font_height; int offset = (((c & 0x7f) - 32) & 15) * font_width; + + if(fore < 0) fore = Settings.SixteenBit ? Settings.DisplayColor : 255; + if(shadow < 0) shadow = BLACK; + if (Settings.SixteenBit) { int h, w, rws; @@ -3415,11 +3557,16 @@ *s= BUILD_PIXEL(0,31,31); else *s = 0xffff; */ - *s=Settings.DisplayColor; + *s = COLOR_ADD(COLOR_SUB(*s, sub), fore); } else if (p == '.') - *s = BLACK; + *s = COLOR_ADD(COLOR_SUB(*s, sub), shadow); + else if(bg_or_space >= 0 || bg_or_other >= 0) + { + *s = COLOR_ADD(COLOR_SUB(*s, sub), + (c==' ' ? bg_or_space : bg_or_other)); + } } } } @@ -3435,63 +3582,140 @@ uint8 p = font [line][offset + w]; if (p == '#') - *s = 255; + *s = fore; else if (p == '.') - *s = BLACK; - } + *s = shadow; + else if(bg_or_space >= 0 || bg_or_other >= 0) + { + *s = c==' ' ? bg_or_space : bg_or_other; + } + } } } } +// input display +static void S9xDisplayPressedKeys () +{ + int activeCount = 0; + int enabledCount = 0; + { + for(int J = 0; J < 5; J++) + { + if((IPPU.Joypads[J] & 0xffff) != 0) + activeCount++; + + if(S9xMovieActive() && S9xMovieControllers() & (1<','<','v','^','S','s','Y','B'}; + const static int KeyOrder[]={8,10,7,9, 0, 6,14,13,5, 1, 4,3, 2, 11,12}; // < ^ > v A B Y X L R S s + char string[255]; + int len; + + sprintf(string, enabledCount>1?"P%d: ":" ",J+1); + + int i; + for (i=0; i < 15; i++) + { + int j = KeyOrder[i]; + int mask = (1 << (j+1)); + string[strlen("P?: ")+i]= + !none && ((IPPU.Joypads[J] & mask)!=0 || (IPPU.Joypads[J/*+5*/] & mask)!=0) + ? KeyMap[j] : ' '; + } + + len=strlen(string); + + for (i = 0; i < len; i++) + { + int fore = 0x7FFF; + int bg = 0x3EF; + + if(i < 3) { fore = 0x3EF; bg = 0x0007; } + + DisplayChar (Screen, string[i], + 0x2104, + fore, // fore + 0x01EF, // shadow + 0x0007, // bg_or_space + bg // bg_or_other + ); + Screen += (font_width - 1) * (Settings.SixteenBit ? 2 : 1); + } + } + } +} + static void S9xDisplayFrameRate () { - uint8 *Screen = GFX.Screen + 2 + - (IPPU.RenderedScreenHeight - font_height - 1) * GFX.Pitch2; - char string [10]; + uint8 *Screen = GFX.Screen // text draw position, starting on the screen + + (1 + IPPU.RenderedScreenWidth - font_height*5) // with this much horizontal offset + * (Settings.SixteenBit ? 2 : 1) + + (IPPU.RenderedScreenHeight - font_height - 1) // and this much vertical offset + * GFX.Pitch2; + char string[10]; int len = 5; - sprintf (string, "%02d/%02d", IPPU.DisplayedRenderedFrameCount, - (int) Memory.ROMFramesPerSecond); + sprintf(string, "%02d/%02d", IPPU.DisplayedRenderedFrameCount, (int)Memory.ROMFramesPerSecond); int i; for (i = 0; i < len; i++) { - DisplayChar (Screen, string [i]); - Screen += Settings.SixteenBit ? (font_width - 1) * sizeof (uint16) : - (font_width - 1); + DisplayChar (Screen, string[i]); + Screen += Settings.SixteenBit ? (font_width-1)*sizeof(uint16) : (font_width-1); } } -static void S9xDisplayString (const char *string) +static void S9xDisplayString (const char *string, int linesFromBottom, bool allowWrap) { - uint8 *Screen = GFX.Screen + 2 + - (IPPU.RenderedScreenHeight - font_height * 5) * GFX.Pitch2; - int len = strlen (string); - int max_chars = IPPU.RenderedScreenWidth / (font_width - 1); + uint8 *Screen = GFX.Screen // text draw position, starting on the screen + + 1 // with this much horizontal offset + * (Settings.SixteenBit ? 2 : 1) + + (IPPU.RenderedScreenHeight - font_height * linesFromBottom) // and this much vertical offset + * GFX.Pitch2; + + int len = strlen(string); + int max_chars = IPPU.RenderedScreenWidth / (font_width-1); int char_count = 0; - int i; - for (i = 0; i < len; i++, char_count++) + for(int i = 0 ; i < len ; i++, char_count++) { - if (char_count >= max_chars || string [i] < 32) - { - Screen -= Settings.SixteenBit ? - (font_width - 1) * sizeof (uint16) * max_chars : - (font_width - 1) * max_chars; - Screen += font_height * GFX.Pitch; - if (Screen >= GFX.Screen + GFX.Pitch * IPPU.RenderedScreenHeight) - break; - char_count -= max_chars; - } - if (string [i] < 32) - continue; - DisplayChar (Screen, string [i]); - Screen += Settings.SixteenBit ? (font_width - 1) * sizeof (uint16) : - (font_width - 1); + if(char_count >= max_chars || string[i] < 32) + { + if(!allowWrap) + break; + + Screen -= Settings.SixteenBit ? (font_width-1)*sizeof(uint16)*max_chars : (font_width-1)*max_chars; + Screen += font_height * GFX.Pitch; + if(Screen >= GFX.Screen + GFX.Pitch * IPPU.RenderedScreenHeight) + break; + + char_count -= max_chars; + } + + if(string[i] < 32) + continue; + + DisplayChar(Screen, string[i]); + Screen += Settings.SixteenBit ? (font_width-1)*sizeof(uint16) : (font_width-1); } } + + void S9xUpdateScreen () { int32 x2 = 1; diff -NaHudr snes9x-1.43-src/snes9x/gfx.h snx/snes9x/gfx.h --- snes9x-1.43-src/snes9x/gfx.h 2004-12-31 00:15:47.000000000 +0200 +++ snx/snes9x/gfx.h 2007-02-03 22:52:42.000000000 +0200 @@ -93,6 +93,9 @@ #include "port.h" #include "snes9x.h" +#define MAX_SNES_WIDTH 512 +#define MAX_SNES_HEIGHT 478 + struct SGFX{ // Initialize these variables uint8 *Screen; @@ -150,6 +153,11 @@ uint32 (*BuildPixel2) (uint32 R, uint32 G, uint32 B); void (*DecomposePixel) (uint32 Pixel, uint32 &R, uint32 &G, uint32 &B); #endif + + bool8 FrameDisplay; + char FrameDisplayString[256]; + + uint8 LastScreen [MAX_SNES_WIDTH * MAX_SNES_HEIGHT * 4]; }; struct SLineData { diff -NaHudr snes9x-1.43-src/snes9x/globals.cpp snx/snes9x/globals.cpp --- snes9x-1.43-src/snes9x/globals.cpp 2004-12-31 00:15:45.000000000 +0200 +++ snx/snes9x/globals.cpp 2007-07-28 23:31:00.000000000 +0300 @@ -105,31 +105,31 @@ #include "spc7110.h" START_EXTERN_C -char String[513]; +char String[513] = {}; -struct Missing missing; +struct Missing missing = {}; -struct SICPU ICPU; +struct SICPU ICPU = {}; -struct SCPUState CPU; +struct SCPUState CPU = {}; -struct SRegisters Registers; +struct SRegisters Registers = {}; -struct SAPU APU; +struct SAPU APU = {}; -struct SIAPU IAPU; +struct SIAPU IAPU = {}; -struct SAPURegisters APURegisters; +struct SAPURegisters APURegisters = {}; -struct SSettings Settings; +struct SSettings Settings = {}; -struct SDSP1 DSP1; +struct SDSP1 DSP1 = {}; -struct SSA1Registers SA1Registers; +struct SSA1Registers SA1Registers = {}; -struct SSA1 SA1; +struct SSA1 SA1 = {}; -SSoundData SoundData; +SSoundData SoundData = {}; SnesModel M1SNES={1,3,2}; SnesModel M2SNES={2,4,3}; diff -NaHudr snes9x-1.43-src/snes9x/i386/cpuexec.S snx/snes9x/i386/cpuexec.S --- snes9x-1.43-src/snes9x/i386/cpuexec.S 2004-12-31 00:15:44.000000000 +0200 +++ snx/snes9x/i386/cpuexec.S 2007-07-28 22:22:17.000000000 +0300 @@ -434,11 +434,19 @@ .L165: xorl %eax, %eax movw ScreenHeight,%ax - addl $3,%eax + addl $3,%eax // the +3 was causing keypresses to be displayed 1 frame behind + addl $0,%eax cmpl V_Counter,%eax jne .NoJoypadUpdate - ccall S9xUpdateJoypads + ccall S9xUpdateJoypadMemory .NoJoypadUpdate: + xorl %eax, %eax + movw ScreenHeight,%ax + addl $0,%eax + cmpl V_Counter,%eax + jne .NoJoypadUpdate2 + ccall S9xUpdateJoypadButtons +.NoJoypadUpdate2: movl V_Counter,%eax cmpl $1,%eax jne .L177 @@ -471,7 +479,8 @@ jz .reschedule #endif -#if 0 + testb $0xff, UseWIPAPUTiming + jz .nowiptiming movb APUTimerEnabled + 2,%cl testb %cl,%cl je .L179 @@ -534,7 +543,7 @@ movw $0,APUTimer + 2 movb $1,APUExecuting movl %edx,APUWaitCounter -#endif +.nowiptiming: jmp .reschedule .htimer_trigger: cmpb $0, HTimerEnabled diff -NaHudr snes9x-1.43-src/snes9x/jma/7z.h snx/snes9x/jma/7z.h --- snes9x-1.43-src/snes9x/jma/7z.h 2004-12-31 00:15:49.000000000 +0200 +++ snx/snes9x/jma/7z.h 2005-03-21 14:00:47.000000000 +0200 @@ -1,5 +1,5 @@ /* -Copyright (C) 2004 NSRT Team ( http://nsrt.edgeemu.com ) +Copyright (C) 2005 NSRT Team ( http://nsrt.edgeemu.com ) Copyright (C) 2002 Andrea Mazzoleni ( http://advancemame.sf.net ) This library is free software; you can redistribute it and/or @@ -20,6 +20,9 @@ #ifndef __7Z_H #define __7Z_H +#include "iiostrm.h" + +bool decompress_lzma_7z(ISequentialInStream& in, unsigned in_size, ISequentialOutStream& out, unsigned out_size) throw (); bool decompress_lzma_7z(const unsigned char* in_data, unsigned in_size, unsigned char* out_data, unsigned out_size) throw (); #endif diff -NaHudr snes9x-1.43-src/snes9x/jma/7zlzma.cpp snx/snes9x/jma/7zlzma.cpp --- snes9x-1.43-src/snes9x/jma/7zlzma.cpp 2004-12-31 00:15:49.000000000 +0200 +++ snx/snes9x/jma/7zlzma.cpp 2005-03-21 14:00:47.000000000 +0200 @@ -1,4 +1,5 @@ /* +Copyright (C) 2005 NSRT Team ( http://nsrt.edgeemu.com ) Copyright (C) 2002 Andrea Mazzoleni ( http://advancemame.sf.net ) This library is free software; you can redistribute it and/or @@ -20,27 +21,31 @@ #include "lzmadec.h" -bool decompress_lzma_7z(const unsigned char* in_data, unsigned in_size, unsigned char* out_data, unsigned out_size) throw () { - try { +bool decompress_lzma_7z(ISequentialInStream& in, unsigned in_size, ISequentialOutStream& out, unsigned out_size) throw () +{ + try + { NCompress::NLZMA::CDecoder cc; - ISequentialInStream in(reinterpret_cast(in_data), in_size); - ISequentialOutStream out(reinterpret_cast(out_data), out_size); - UINT64 in_size_l = in_size; UINT64 out_size_l = out_size; - if (cc.ReadCoderProperties(&in) != S_OK) - return false; + if (cc.ReadCoderProperties(&in) != S_OK) { return(false); } + if (cc.Code(&in, &out, &in_size_l, &out_size_l) != S_OK) { return(false); } + if (out.size_get() != out_size || out.overflow_get()) { return(false); } - if (cc.Code(&in, &out, &in_size_l, &out_size_l) != S_OK) - return false; + return(true); + } + catch (...) + { + return(false); + } +} - if (out.size_get() != out_size || out.overflow_get()) - return false; +bool decompress_lzma_7z(const unsigned char* in_data, unsigned int in_size, unsigned char* out_data, unsigned int out_size) throw () +{ + ISequentialInStream_Array in(reinterpret_cast(in_data), in_size); + ISequentialOutStream_Array out(reinterpret_cast(out_data), out_size); - return true; - } catch (...) { - return false; - } + return(decompress_lzma_7z(in, in_size, out, out_size)); } diff -NaHudr snes9x-1.43-src/snes9x/jma/iiostrm.cpp snx/snes9x/jma/iiostrm.cpp --- snes9x-1.43-src/snes9x/jma/iiostrm.cpp 2004-12-31 00:15:49.000000000 +0200 +++ snx/snes9x/jma/iiostrm.cpp 2005-03-21 14:00:47.000000000 +0200 @@ -1,4 +1,5 @@ /* +Copyright (C) 2005 NSRT Team ( http://nsrt.edgeemu.com ) Copyright (C) 2002 Andrea Mazzoleni ( http://advancemame.sf.net ) Copyright (C) 2001-4 Igor Pavlov ( http://www.7-zip.org ) @@ -19,19 +20,26 @@ #include "portable.h" #include "iiostrm.h" +#include "crc32.h" -HRESULT ISequentialInStream::Read(void *aData, UINT32 aSize, UINT32* aProcessedSize) { +HRESULT ISequentialInStream_Array::Read(void *aData, UINT32 aSize, UINT32 *aProcessedSize) +{ if (aSize > size) + { aSize = size; + } + *aProcessedSize = aSize; memcpy(aData, data, aSize); size -= aSize; data += aSize; - return S_OK; + return(S_OK); } -HRESULT ISequentialOutStream::Write(const void *aData, UINT32 aSize, UINT32* aProcessedSize) { - if (aSize > size) { +HRESULT ISequentialOutStream_Array::Write(const void *aData, UINT32 aSize, UINT32 *aProcessedSize) +{ + if (aSize > size) + { overflow = true; aSize = size; } @@ -40,5 +48,85 @@ size -= aSize; data += aSize; total += aSize; - return S_OK; + return(S_OK); +} + +HRESULT ISequentialInStream_String::Read(void *aData, UINT32 aSize, UINT32 *aProcessedSize) +{ + if (aSize > data.size()) + { + aSize = data.size(); + } + + *aProcessedSize = aSize; + memcpy(aData, data.c_str(), aSize); + data.erase(0, aSize); + return(S_OK); +} + +HRESULT ISequentialOutStream_String::Write(const void *aData, UINT32 aSize, UINT32 *aProcessedSize) +{ + *aProcessedSize = aSize; + data.append((const char *)aData, aSize); + total += aSize; + return(S_OK); +} + +HRESULT ISequentialInStream_Istream::Read(void *aData, UINT32 aSize, UINT32 *aProcessedSize) +{ + data.read((char *)aData, aSize); + *aProcessedSize = data.gcount(); + return(S_OK); +} + +HRESULT ISequentialOutStream_Ostream::Write(const void *aData, UINT32 aSize, UINT32 *aProcessedSize) +{ + *aProcessedSize = aSize; + data.write((char *)aData, aSize); + total += aSize; + return(S_OK); +} + + + +HRESULT ISequentialInStreamCRC32_Array::Read(void *aData, UINT32 aSize, UINT32 *aProcessedSize) +{ + ISequentialInStream_Array::Read(aData, aSize, aProcessedSize); + crc32 = CRC32lib::CRC32((const unsigned char *)aData, *aProcessedSize, ~crc32); + return(S_OK); +} + +HRESULT ISequentialOutStreamCRC32_Array::Write(const void *aData, UINT32 aSize, UINT32 *aProcessedSize) +{ + ISequentialOutStream_Array::Write(aData, aSize, aProcessedSize); + crc32 = CRC32lib::CRC32((const unsigned char *)aData, *aProcessedSize, ~crc32); + return(S_OK); +} + +HRESULT ISequentialInStreamCRC32_String::Read(void *aData, UINT32 aSize, UINT32 *aProcessedSize) +{ + ISequentialInStream_String::Read(aData, aSize, aProcessedSize); + crc32 = CRC32lib::CRC32((const unsigned char *)aData, *aProcessedSize, ~crc32); + return(S_OK); +} + +HRESULT ISequentialOutStreamCRC32_String::Write(const void *aData, UINT32 aSize, UINT32 *aProcessedSize) +{ + ISequentialOutStream_String::Write(aData, aSize, aProcessedSize); + crc32 = CRC32lib::CRC32((const unsigned char *)aData, *aProcessedSize, ~crc32); + return(S_OK); +} + +HRESULT ISequentialInStreamCRC32_Istream::Read(void *aData, UINT32 aSize, UINT32 *aProcessedSize) +{ + ISequentialInStream_Istream::Read(aData, aSize, aProcessedSize); + crc32 = CRC32lib::CRC32((const unsigned char *)aData, *aProcessedSize, ~crc32); + return(S_OK); +} + +HRESULT ISequentialOutStreamCRC32_Ostream::Write(const void *aData, UINT32 aSize, UINT32 *aProcessedSize) +{ + ISequentialOutStream_Ostream::Write(aData, aSize, aProcessedSize); + crc32 = CRC32lib::CRC32((const unsigned char *)aData, *aProcessedSize, ~crc32); + return(S_OK); } diff -NaHudr snes9x-1.43-src/snes9x/jma/iiostrm.h snx/snes9x/jma/iiostrm.h --- snes9x-1.43-src/snes9x/jma/iiostrm.h 2004-12-31 00:15:49.000000000 +0200 +++ snx/snes9x/jma/iiostrm.h 2005-03-21 14:00:47.000000000 +0200 @@ -1,4 +1,5 @@ /* +Copyright (C) 2005 NSRT Team ( http://nsrt.edgeemu.com ) Copyright (C) 2002 Andrea Mazzoleni ( http://advancemame.sf.net ) Copyright (C) 2001-4 Igor Pavlov ( http://www.7-zip.org ) @@ -20,29 +21,167 @@ #ifndef __IINOUTSTREAMS_H #define __IINOUTSTREAMS_H +#include + +#if (((defined(_MSC_VER) && _MSC_VER >= 1300)) || defined(__MINGW32__)) + // both MINGW and VS.NET use fstream instead of fstream.h which is deprecated + #include + using namespace std; +#else + // for VC++ 6 + #include +#endif + #include "portable.h" + class ISequentialInStream { +public: + virtual HRESULT Read(void *, UINT32, UINT32 *) = 0; +}; + + +class ISequentialInStream_Array : public ISequentialInStream +{ const char* data; - unsigned size; + unsigned int size; public: - ISequentialInStream(const char* Adata, unsigned Asize) : data(Adata), size(Asize) { } + ISequentialInStream_Array(const char *Adata, unsigned Asize) : data(Adata), size(Asize) { } HRESULT Read(void *aData, UINT32 aSize, UINT32 *aProcessedSize); }; +class ISequentialInStream_String : public ISequentialInStream +{ + std::string& data; +public: + ISequentialInStream_String(std::string& Adata) : data(Adata) { } + + HRESULT Read(void *aData, UINT32 aSize, UINT32 *aProcessedSize); +}; + +class ISequentialInStream_Istream : public ISequentialInStream +{ + std::istream& data; +public: + ISequentialInStream_Istream(std::istream& Adata) : data(Adata) { } + + HRESULT Read(void *aData, UINT32 aSize, UINT32 *aProcessedSize); +}; + + + class ISequentialOutStream { +public: + virtual bool overflow_get() const = 0; + virtual unsigned int size_get() const = 0; + + virtual HRESULT Write(const void *, UINT32, UINT32 *) = 0; +}; + + +class ISequentialOutStream_Array : public ISequentialOutStream +{ char* data; - unsigned size; + unsigned int size; bool overflow; - unsigned total; + unsigned int total; public: - ISequentialOutStream(char* Adata, unsigned Asize) : data(Adata), size(Asize), overflow(false), total(0) { } + ISequentialOutStream_Array(char *Adata, unsigned Asize) : data(Adata), size(Asize), overflow(false), total(0) { } - bool overflow_get() const { return overflow; } - unsigned size_get() const { return total; } + bool overflow_get() const { return(overflow); } + unsigned int size_get() const { return(total); } + + HRESULT Write(const void *aData, UINT32 aSize, UINT32 *aProcessedSize); +}; + +class ISequentialOutStream_String : public ISequentialOutStream +{ + std::string& data; + unsigned int total; +public: + ISequentialOutStream_String(std::string& Adata) : data(Adata), total(0) { } + + bool overflow_get() const { return(false); } + unsigned int size_get() const { return(total); } + + HRESULT Write(const void *aData, UINT32 aSize, UINT32 *aProcessedSize); +}; + + +class ISequentialOutStream_Ostream : public ISequentialOutStream +{ + std::ostream& data; + unsigned int total; +public: + ISequentialOutStream_Ostream(std::ostream& Adata) : data(Adata), total(0) { } + + bool overflow_get() const { return(false); } + unsigned int size_get() const { return(total); } + + HRESULT Write(const void *aData, UINT32 aSize, UINT32 *aProcessedSize); +}; + + + +class ISequentialStreamCRC32 +{ +protected: + unsigned int crc32; +public: + ISequentialStreamCRC32() : crc32(0) {} + unsigned int crc32_get() const { return(crc32); } +}; + + +class ISequentialInStreamCRC32_Array : public ISequentialInStream_Array, public ISequentialStreamCRC32 +{ +public: + ISequentialInStreamCRC32_Array(const char *Adata, unsigned Asize) : ISequentialInStream_Array(Adata, Asize) { } + + HRESULT Read(void *aData, UINT32 aSize, UINT32 *aProcessedSize); +}; + +class ISequentialInStreamCRC32_String : public ISequentialInStream_String, public ISequentialStreamCRC32 +{ +public: + ISequentialInStreamCRC32_String(std::string& Adata) : ISequentialInStream_String(Adata) { } + + HRESULT Read(void *aData, UINT32 aSize, UINT32 *aProcessedSize); +}; + +class ISequentialInStreamCRC32_Istream : public ISequentialInStream_Istream, public ISequentialStreamCRC32 +{ +public: + ISequentialInStreamCRC32_Istream(std::istream& Adata) : ISequentialInStream_Istream(Adata) { } + + HRESULT Read(void *aData, UINT32 aSize, UINT32 *aProcessedSize); +}; + + +class ISequentialOutStreamCRC32_Array : public ISequentialOutStream_Array, public ISequentialStreamCRC32 +{ +public: + ISequentialOutStreamCRC32_Array(char *Adata, unsigned Asize) : ISequentialOutStream_Array(Adata, Asize) { } + + HRESULT Write(const void *aData, UINT32 aSize, UINT32 *aProcessedSize); +}; + +class ISequentialOutStreamCRC32_String : public ISequentialOutStream_String, public ISequentialStreamCRC32 +{ +public: + ISequentialOutStreamCRC32_String(std::string& Adata) : ISequentialOutStream_String(Adata) { } + + HRESULT Write(const void *aData, UINT32 aSize, UINT32 *aProcessedSize); +}; + + +class ISequentialOutStreamCRC32_Ostream : public ISequentialOutStream_Ostream, public ISequentialStreamCRC32 +{ +public: + ISequentialOutStreamCRC32_Ostream(std::ostream& Adata) : ISequentialOutStream_Ostream(Adata) { } HRESULT Write(const void *aData, UINT32 aSize, UINT32 *aProcessedSize); }; diff -NaHudr snes9x-1.43-src/snes9x/jma/inbyte.cpp snx/snes9x/jma/inbyte.cpp --- snes9x-1.43-src/snes9x/jma/inbyte.cpp 2004-12-31 00:15:49.000000000 +0200 +++ snx/snes9x/jma/inbyte.cpp 2005-03-21 14:00:47.000000000 +0200 @@ -1,4 +1,5 @@ /* +Copyright (C) 2005 NSRT Team ( http://nsrt.edgeemu.com ) Copyright (C) 2002 Andrea Mazzoleni ( http://advancemame.sf.net ) Copyright (C) 2001-4 Igor Pavlov ( http://www.7-zip.org ) diff -NaHudr snes9x-1.43-src/snes9x/jma/jma.cpp snx/snes9x/jma/jma.cpp --- snes9x-1.43-src/snes9x/jma/jma.cpp 2004-12-31 00:15:49.000000000 +0200 +++ snx/snes9x/jma/jma.cpp 2005-03-21 14:00:47.000000000 +0200 @@ -1,95 +1,23 @@ -/******************************************************************************* - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - - (c) Copyright 1996 - 2002 Gary Henderson (gary.henderson@ntlworld.com) and - Jerremy Koot (jkoot@snes9x.com) - - (c) Copyright 2001 - 2004 John Weidman (jweidman@slip.net) - - (c) Copyright 2002 - 2004 Brad Jorsch (anomie@users.sourceforge.net), - funkyass (funkyass@spam.shaw.ca), - Joel Yliluoma (http://iki.fi/bisqwit/) - Kris Bleakley (codeviolation@hotmail.com), - Matthew Kendora, - Nach (n-a-c-h@users.sourceforge.net), - Peter Bortas (peter@bortas.org) and - zones (kasumitokoduck@yahoo.com) - - C4 x86 assembler and some C emulation code - (c) Copyright 2000 - 2003 zsKnight (zsknight@zsnes.com), - _Demo_ (_demo_@zsnes.com), and Nach - - C4 C++ code - (c) Copyright 2003 Brad Jorsch - - DSP-1 emulator code - (c) Copyright 1998 - 2004 Ivar (ivar@snes9x.com), _Demo_, Gary Henderson, - John Weidman, neviksti (neviksti@hotmail.com), - Kris Bleakley, Andreas Naive - - DSP-2 emulator code - (c) Copyright 2003 Kris Bleakley, John Weidman, neviksti, Matthew Kendora, and - Lord Nightmare (lord_nightmare@users.sourceforge.net - - OBC1 emulator code - (c) Copyright 2001 - 2004 zsKnight, pagefault (pagefault@zsnes.com) and - Kris Bleakley - Ported from x86 assembler to C by sanmaiwashi - - SPC7110 and RTC C++ emulator code - (c) Copyright 2002 Matthew Kendora with research by - zsKnight, John Weidman, and Dark Force - - S-DD1 C emulator code - (c) Copyright 2003 Brad Jorsch with research by - Andreas Naive and John Weidman - - S-RTC C emulator code - (c) Copyright 2001 John Weidman - - ST010 C++ emulator code - (c) Copyright 2003 Feather, Kris Bleakley, John Weidman and Matthew Kendora - - Super FX x86 assembler emulator code - (c) Copyright 1998 - 2003 zsKnight, _Demo_, and pagefault - - Super FX C emulator code - (c) Copyright 1997 - 1999 Ivar, Gary Henderson and John Weidman - - - SH assembler code partly based on x86 assembler code - (c) Copyright 2002 - 2004 Marcus Comstedt (marcus@mc.pp.se) - - JMA compressed file support - (c) Copyright 2004 NSRT Team (http://nsrt.edgeemu.com) - - Specific ports contains the works of other authors. See headers in - individual files. - - Snes9x homepage: http://www.snes9x.com - - Permission to use, copy, modify and distribute Snes9x in both binary and - source form, for non-commercial purposes, is hereby granted without fee, - providing that this license information and copyright notice appear with - all copies and any derived work. - - This software is provided 'as-is', without any express or implied - warranty. In no event shall the authors be held liable for any damages - arising from the use of this software. - - Snes9x is freeware for PERSONAL USE only. Commercial users should - seek permission of the copyright holders first. Commercial use includes - charging money for Snes9x or software derived from Snes9x. +/* +Copyright (C) 2005 NSRT Team ( http://nsrt.edgeemu.com ) - The copyright holders request that bug fixes and improvements to the code - should be forwarded to them so everyone can benefit from the modifications - in future versions. +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later +version. - Super NES and Super Nintendo Entertainment System are trademarks of - Nintendo Co., Limited and its subsidiary companies. -*******************************************************************************/ +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +#include #include "jma.h" using namespace std; @@ -101,7 +29,7 @@ { const char jma_magic[] = { 'J', 'M', 'A', 0, 'N' }; const unsigned int jma_header_length = 5; - const unsigned char jma_version = 0; + const unsigned char jma_version = 1; const unsigned int jma_version_length = 1; const unsigned int jma_total_header_length = jma_header_length + jma_version_length + UINT_SIZE; @@ -145,9 +73,46 @@ //Seek to before file block so we can read the file block stream.seekg(-((int)file_block_size+UINT_SIZE),ios::end); + //This is needed if the file block is compressed + stringstream decompressed_file_block; + //Pointer to where to read file block from (file or decompressed buffer) + istream *file_block_stream; + + //Setup file info buffer and byte to read with jma_file_info file_info; char byte; + stream.get(byte); + if (!byte) //If file block is compressed + { + //Compressed size isn't counting the byte we just read or the UINT for compressed size + size_t compressed_size = file_block_size - (1+UINT_SIZE); + + //Read decompressed size / true file block size + stream.read((char *)uint_buffer, UINT_SIZE); + file_block_size = charp_to_uint(uint_buffer); + + //Setup access methods for decompression + ISequentialInStream_Istream compressed_data(stream); + ISequentialOutStream_Ostream decompressed_data(decompressed_file_block); + + //Decompress the data + if (!decompress_lzma_7z(compressed_data, compressed_size, decompressed_data, file_block_size)) + { + throw(JMA_DECOMPRESS_FAILED); + } + + //Go to beginning, setup pointer to buffer + decompressed_file_block.seekg(0, ios::beg); + file_block_stream = &decompressed_file_block; + } + else + { + stream.putback(byte); //Putback byte, byte is part of filename, not compressed indicator + file_block_stream = &stream; + } + + //Minimum file name length is 2 bytes, a char and a null //Minimum comment length is 1 byte, a null //There are currently 2 UINTs and 2 USHORTs per file @@ -156,11 +121,11 @@ //First stored in the file block is the file name null terminated file_info.name = ""; - stream.get(byte); + file_block_stream->get(byte); while (byte) { file_info.name += byte; - stream.get(byte); + file_block_stream->get(byte); } //There must be a file name or the file is bad @@ -172,27 +137,27 @@ //Same trick as above for the comment file_info.comment = ""; - stream.get(byte); + file_block_stream->get(byte); while (byte) { file_info.comment += byte; - stream.get(byte); + file_block_stream->get(byte); } //Next is a UINT representing the file's size - stream.read((char *)uint_buffer, UINT_SIZE); + file_block_stream->read((char *)uint_buffer, UINT_SIZE); file_info.size = charp_to_uint(uint_buffer); //Followed by CRC32 - stream.read((char *)uint_buffer, UINT_SIZE); + file_block_stream->read((char *)uint_buffer, UINT_SIZE); file_info.crc32 = charp_to_uint(uint_buffer); //Special USHORT representation of file's date - stream.read((char *)ushort_buffer, USHORT_SIZE); + file_block_stream->read((char *)ushort_buffer, USHORT_SIZE); file_info.date = charp_to_ushort(ushort_buffer); //Special USHORT representation of file's time - stream.read((char *)ushort_buffer, USHORT_SIZE); + file_block_stream->read((char *)ushort_buffer, USHORT_SIZE); file_info.time = charp_to_ushort(ushort_buffer); file_info.buffer = 0; //Pointing to null till we decompress files @@ -212,7 +177,7 @@ compressed_buffer = 0; stream.open(compressed_file_name, ios::in | ios::binary); - if (!stream) + if (!stream.is_open()) { throw(JMA_NO_OPEN); } @@ -227,7 +192,7 @@ //Not the cleanest code but logical stream.read((char *)header, 5); - if (*header == 0) //Version 0 + if (*header <= jma_version) { chunk_size = charp_to_uint(header+1); //Chunk size is a UINT that follows version # retrieve_file_block(); @@ -241,7 +206,7 @@ //Destructor only has to close the stream if neccesary jma_open::~jma_open() { - if (stream) + if (stream.is_open()) { stream.close(); } @@ -270,11 +235,14 @@ void jma_open::chunk_seek(unsigned int chunk_num) throw(jma_errors) { //Check the stream is open - if (!stream) + if (!stream.is_open()) { throw(JMA_NO_OPEN); } + //Clear possible errors so the seek will work + stream.clear(); + //Move forward over header stream.seekg(jma_total_header_length, ios::beg); @@ -295,7 +263,7 @@ vector jma_open::get_all_files(unsigned char *buffer) throw(jma_errors) { //If there's no stream we can't read from it, so exit - if (!stream) + if (!stream.is_open()) { throw(JMA_NO_OPEN); } @@ -352,16 +320,35 @@ throw(JMA_DECOMPRESS_FAILED); } delete[] compressed_buffer; + + if (remaining_size <= chunk_size) //If we just decompressed the remainder + { + break; + } } } else //Solidly compressed JMA { unsigned char int4_buffer[UINT_SIZE]; - //read the size of the compressed data + //Read the size of the compressed data stream.read((char *)int4_buffer, UINT_SIZE); size_t compressed_size = charp_to_uint(int4_buffer); + //Get decompressed size + size_t size = get_total_size(files); + + //Setup access methods for decompression + ISequentialInStream_Istream compressed_data(stream); + ISequentialOutStream_Array decompressed_data(reinterpret_cast(decompressed_buffer), size); + + //Decompress the data + if (!decompress_lzma_7z(compressed_data, compressed_size, decompressed_data, size)) + { + throw(JMA_DECOMPRESS_FAILED); + } + + /* //Allocate memory of the right size to hold the compressed data in the JMA try { @@ -386,13 +373,14 @@ throw(JMA_BAD_FILE); } - //decompress the data + //Decompress the data if (!decompress_lzma_7z(compressed_buffer, compressed_size, decompressed_buffer, size)) { delete[] compressed_buffer; throw(JMA_DECOMPRESS_FAILED); } delete[] compressed_buffer; + */ } vector file_pointers; @@ -413,7 +401,7 @@ //Extracts the file with a given name found in the archive to the given buffer void jma_open::extract_file(string& name, unsigned char *buffer) throw(jma_errors) { - if (!stream) + if (!stream.is_open()) { throw(JMA_NO_OPEN); } @@ -495,15 +483,13 @@ delete[] comp_buffer; throw(JMA_DECOMPRESS_FAILED); } - else - { - size_t copy_amount = our_file_size-i > chunk_size ? chunk_size : our_file_size-i; - copy_amount -= first_chunk_offset; + + size_t copy_amount = our_file_size-i > chunk_size-first_chunk_offset ? chunk_size-first_chunk_offset : our_file_size-i; + memcpy(buffer+i, decomp_buffer+first_chunk_offset, copy_amount); - first_chunk_offset = 0; + first_chunk_offset = 0; //Set to zero since this is only for the first iteration i += copy_amount; } - } delete[] comp_buffer; } else //Solid JMA @@ -526,6 +512,42 @@ } } + bool jma_open::is_solid() + { + return(chunk_size ? false : true); + } + + const char *jma_error_text(jma_errors error) + { + switch (error) + { + case JMA_NO_CREATE: + return("JMA could not be created"); + + case JMA_NO_MEM_ALLOC: + return("Memory for JMA could be allocated"); + + case JMA_NO_OPEN: + return("JMA could not be opened"); + + case JMA_BAD_FILE: + return("Invalid/Corrupt JMA"); + + case JMA_UNSUPPORTED_VERSION: + return("JMA version not supported"); + + case JMA_COMPRESS_FAILED: + return("JMA compression failed"); + + case JMA_DECOMPRESS_FAILED: + return("JMA decompression failed"); + + case JMA_FILE_NOT_FOUND: + return("File not found in JMA"); + } + return("Unknown error"); + } + } diff -NaHudr snes9x-1.43-src/snes9x/jma/jma.h snx/snes9x/jma/jma.h --- snes9x-1.43-src/snes9x/jma/jma.h 2004-12-31 00:15:49.000000000 +0200 +++ snx/snes9x/jma/jma.h 2005-03-21 14:00:47.000000000 +0200 @@ -1,103 +1,38 @@ -/******************************************************************************* - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - - (c) Copyright 1996 - 2002 Gary Henderson (gary.henderson@ntlworld.com) and - Jerremy Koot (jkoot@snes9x.com) - - (c) Copyright 2001 - 2004 John Weidman (jweidman@slip.net) - - (c) Copyright 2002 - 2004 Brad Jorsch (anomie@users.sourceforge.net), - funkyass (funkyass@spam.shaw.ca), - Joel Yliluoma (http://iki.fi/bisqwit/) - Kris Bleakley (codeviolation@hotmail.com), - Matthew Kendora, - Nach (n-a-c-h@users.sourceforge.net), - Peter Bortas (peter@bortas.org) and - zones (kasumitokoduck@yahoo.com) - - C4 x86 assembler and some C emulation code - (c) Copyright 2000 - 2003 zsKnight (zsknight@zsnes.com), - _Demo_ (_demo_@zsnes.com), and Nach - - C4 C++ code - (c) Copyright 2003 Brad Jorsch - - DSP-1 emulator code - (c) Copyright 1998 - 2004 Ivar (ivar@snes9x.com), _Demo_, Gary Henderson, - John Weidman, neviksti (neviksti@hotmail.com), - Kris Bleakley, Andreas Naive - - DSP-2 emulator code - (c) Copyright 2003 Kris Bleakley, John Weidman, neviksti, Matthew Kendora, and - Lord Nightmare (lord_nightmare@users.sourceforge.net - - OBC1 emulator code - (c) Copyright 2001 - 2004 zsKnight, pagefault (pagefault@zsnes.com) and - Kris Bleakley - Ported from x86 assembler to C by sanmaiwashi - - SPC7110 and RTC C++ emulator code - (c) Copyright 2002 Matthew Kendora with research by - zsKnight, John Weidman, and Dark Force - - S-DD1 C emulator code - (c) Copyright 2003 Brad Jorsch with research by - Andreas Naive and John Weidman - - S-RTC C emulator code - (c) Copyright 2001 John Weidman - - ST010 C++ emulator code - (c) Copyright 2003 Feather, Kris Bleakley, John Weidman and Matthew Kendora - - Super FX x86 assembler emulator code - (c) Copyright 1998 - 2003 zsKnight, _Demo_, and pagefault - - Super FX C emulator code - (c) Copyright 1997 - 1999 Ivar, Gary Henderson and John Weidman - - - SH assembler code partly based on x86 assembler code - (c) Copyright 2002 - 2004 Marcus Comstedt (marcus@mc.pp.se) - - JMA compressed file support - (c) Copyright 2004 NSRT Team (http://nsrt.edgeemu.com) - - Specific ports contains the works of other authors. See headers in - individual files. - - Snes9x homepage: http://www.snes9x.com - - Permission to use, copy, modify and distribute Snes9x in both binary and - source form, for non-commercial purposes, is hereby granted without fee, - providing that this license information and copyright notice appear with - all copies and any derived work. - - This software is provided 'as-is', without any express or implied - warranty. In no event shall the authors be held liable for any damages - arising from the use of this software. - - Snes9x is freeware for PERSONAL USE only. Commercial users should - seek permission of the copyright holders first. Commercial use includes - charging money for Snes9x or software derived from Snes9x. +/* +Copyright (C) 2005 NSRT Team ( http://nsrt.edgeemu.com ) - The copyright holders request that bug fixes and improvements to the code - should be forwarded to them so everyone can benefit from the modifications - in future versions. +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later +version. - Super NES and Super Nintendo Entertainment System are trademarks of - Nintendo Co., Limited and its subsidiary companies. -*******************************************************************************/ +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ #ifndef JMA_H #define JMA_H #include -#include #include #include +#if (((defined(_MSC_VER) && _MSC_VER >= 1300)) || defined(__MINGW32__)) + // both MINGW and VS.NET use fstream instead of fstream.h which is deprecated + #include + using namespace std; +#else + // for VC++ 6 + #include +#endif + namespace JMA { enum jma_errors { JMA_NO_CREATE, JMA_NO_MEM_ALLOC, JMA_NO_OPEN, JMA_BAD_FILE, @@ -145,6 +80,7 @@ std::vector get_files_info(); std::vector get_all_files(unsigned char *) throw(jma_errors); void extract_file(std::string& name, unsigned char *) throw(jma_errors); + bool is_solid(); private: std::ifstream stream; @@ -157,5 +93,6 @@ void retrieve_file_block() throw(jma_errors); }; + const char *jma_error_text(jma_errors); } #endif diff -NaHudr snes9x-1.43-src/snes9x/jma/lencoder.h snx/snes9x/jma/lencoder.h --- snes9x-1.43-src/snes9x/jma/lencoder.h 2004-12-31 00:15:49.000000000 +0200 +++ snx/snes9x/jma/lencoder.h 2005-03-21 14:00:47.000000000 +0200 @@ -1,4 +1,5 @@ /* +Copyright (C) 2005 NSRT Team ( http://nsrt.edgeemu.com ) Copyright (C) 2002 Andrea Mazzoleni ( http://advancemame.sf.net ) Copyright (C) 2001-4 Igor Pavlov ( http://www.7-zip.org ) diff -NaHudr snes9x-1.43-src/snes9x/jma/lzmadec.cpp snx/snes9x/jma/lzmadec.cpp --- snes9x-1.43-src/snes9x/jma/lzmadec.cpp 2004-12-31 00:15:49.000000000 +0200 +++ snx/snes9x/jma/lzmadec.cpp 2005-03-21 14:00:47.000000000 +0200 @@ -1,5 +1,5 @@ /* -Copyright (C) 2004 NSRT Team ( http://nsrt.edgeemu.com ) +Copyright (C) 2005 NSRT Team ( http://nsrt.edgeemu.com ) Copyright (C) 2002 Andrea Mazzoleni ( http://advancemame.sf.net ) Copyright (C) 2001-4 Igor Pavlov ( http://www.7-zip.org ) diff -NaHudr snes9x-1.43-src/snes9x/jma/lzma.h snx/snes9x/jma/lzma.h --- snes9x-1.43-src/snes9x/jma/lzma.h 2004-12-31 00:15:49.000000000 +0200 +++ snx/snes9x/jma/lzma.h 2005-03-21 14:00:47.000000000 +0200 @@ -1,4 +1,5 @@ /* +Copyright (C) 2005 NSRT Team ( http://nsrt.edgeemu.com ) Copyright (C) 2002 Andrea Mazzoleni ( http://advancemame.sf.net ) Copyright (C) 2001-4 Igor Pavlov ( http://www.7-zip.org ) diff -NaHudr snes9x-1.43-src/snes9x/jma/portable.h snx/snes9x/jma/portable.h --- snes9x-1.43-src/snes9x/jma/portable.h 2004-12-31 00:15:49.000000000 +0200 +++ snx/snes9x/jma/portable.h 2005-03-21 14:00:47.000000000 +0200 @@ -2,22 +2,22 @@ Copyright (C) 2004 NSRT Team ( http://nsrt.edgeemu.com ) Copyright (C) 2002 Andrea Mazzoleni ( http://advancemame.sf.net ) -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later +version. -This library is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - #ifndef __PORTABLE_H #define __PORTABLE_H @@ -29,9 +29,8 @@ typedef unsigned short UINT16; typedef long INT32; typedef unsigned long UINT32; -typedef INT32 INT64; -typedef UINT32 UINT64; - +typedef long long INT64; +typedef unsigned long long UINT64; typedef UINT8 BYTE; typedef UINT16 WORD; diff -NaHudr snes9x-1.43-src/snes9x/jma/s9x-jma.cpp snx/snes9x/jma/s9x-jma.cpp --- snes9x-1.43-src/snes9x/jma/s9x-jma.cpp 2004-12-31 00:15:49.000000000 +0200 +++ snx/snes9x/jma/s9x-jma.cpp 2005-03-20 23:46:22.000000000 +0200 @@ -1,134 +1,134 @@ -/******************************************************************************* - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - - (c) Copyright 1996 - 2002 Gary Henderson (gary.henderson@ntlworld.com) and - Jerremy Koot (jkoot@snes9x.com) - - (c) Copyright 2001 - 2004 John Weidman (jweidman@slip.net) - - (c) Copyright 2002 - 2004 Brad Jorsch (anomie@users.sourceforge.net), - funkyass (funkyass@spam.shaw.ca), - Joel Yliluoma (http://iki.fi/bisqwit/) - Kris Bleakley (codeviolation@hotmail.com), - Matthew Kendora, - Nach (n-a-c-h@users.sourceforge.net), - Peter Bortas (peter@bortas.org) and - zones (kasumitokoduck@yahoo.com) - - C4 x86 assembler and some C emulation code - (c) Copyright 2000 - 2003 zsKnight (zsknight@zsnes.com), - _Demo_ (_demo_@zsnes.com), and Nach - - C4 C++ code - (c) Copyright 2003 Brad Jorsch - - DSP-1 emulator code - (c) Copyright 1998 - 2004 Ivar (ivar@snes9x.com), _Demo_, Gary Henderson, - John Weidman, neviksti (neviksti@hotmail.com), - Kris Bleakley, Andreas Naive - - DSP-2 emulator code - (c) Copyright 2003 Kris Bleakley, John Weidman, neviksti, Matthew Kendora, and - Lord Nightmare (lord_nightmare@users.sourceforge.net - - OBC1 emulator code - (c) Copyright 2001 - 2004 zsKnight, pagefault (pagefault@zsnes.com) and - Kris Bleakley - Ported from x86 assembler to C by sanmaiwashi - - SPC7110 and RTC C++ emulator code - (c) Copyright 2002 Matthew Kendora with research by - zsKnight, John Weidman, and Dark Force - - S-DD1 C emulator code - (c) Copyright 2003 Brad Jorsch with research by - Andreas Naive and John Weidman - - S-RTC C emulator code - (c) Copyright 2001 John Weidman - - ST010 C++ emulator code - (c) Copyright 2003 Feather, Kris Bleakley, John Weidman and Matthew Kendora - - Super FX x86 assembler emulator code - (c) Copyright 1998 - 2003 zsKnight, _Demo_, and pagefault - - Super FX C emulator code - (c) Copyright 1997 - 1999 Ivar, Gary Henderson and John Weidman - - - SH assembler code partly based on x86 assembler code - (c) Copyright 2002 - 2004 Marcus Comstedt (marcus@mc.pp.se) - - JMA compressed file support - (c) Copyright 2004 NSRT Team (http://nsrt.edgeemu.com) - - Specific ports contains the works of other authors. See headers in - individual files. - - Snes9x homepage: http://www.snes9x.com - - Permission to use, copy, modify and distribute Snes9x in both binary and - source form, for non-commercial purposes, is hereby granted without fee, - providing that this license information and copyright notice appear with - all copies and any derived work. - - This software is provided 'as-is', without any express or implied - warranty. In no event shall the authors be held liable for any damages - arising from the use of this software. - - Snes9x is freeware for PERSONAL USE only. Commercial users should - seek permission of the copyright holders first. Commercial use includes - charging money for Snes9x or software derived from Snes9x. - - The copyright holders request that bug fixes and improvements to the code - should be forwarded to them so everyone can benefit from the modifications - in future versions. - - Super NES and Super Nintendo Entertainment System are trademarks of - Nintendo Co., Limited and its subsidiary companies. -*******************************************************************************/ - -#include "../memmap.h" - -#include -using namespace std; - -#include "s9x-jma.h" -#include "jma.h" - -size_t load_jma_file(const char *filename, unsigned char *buffer) -{ - try - { - JMA::jma_open JMAFile(filename); - vector file_info = JMAFile.get_files_info(); - - string our_file_name; - size_t our_file_size = 0; - - for (vector::iterator i = file_info.begin(); i != file_info.end(); i++) - { - //Check for valid ROM based on size - if ((i->size <= CMemory::MAX_ROM_SIZE+512) && (i->size > our_file_size)) - { - our_file_name = i->name; - our_file_size = i->size; - } - } - - if (!our_file_size) - { - return(0); - } - - JMAFile.extract_file(our_file_name, buffer); - - return(our_file_size); - } - catch (JMA::jma_errors jma_error) - { - return(0); - } -} - +/******************************************************************************* + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + + (c) Copyright 1996 - 2002 Gary Henderson (gary.henderson@ntlworld.com) and + Jerremy Koot (jkoot@snes9x.com) + + (c) Copyright 2001 - 2004 John Weidman (jweidman@slip.net) + + (c) Copyright 2002 - 2004 Brad Jorsch (anomie@users.sourceforge.net), + funkyass (funkyass@spam.shaw.ca), + Joel Yliluoma (http://iki.fi/bisqwit/) + Kris Bleakley (codeviolation@hotmail.com), + Matthew Kendora, + Nach (n-a-c-h@users.sourceforge.net), + Peter Bortas (peter@bortas.org) and + zones (kasumitokoduck@yahoo.com) + + C4 x86 assembler and some C emulation code + (c) Copyright 2000 - 2003 zsKnight (zsknight@zsnes.com), + _Demo_ (_demo_@zsnes.com), and Nach + + C4 C++ code + (c) Copyright 2003 Brad Jorsch + + DSP-1 emulator code + (c) Copyright 1998 - 2004 Ivar (ivar@snes9x.com), _Demo_, Gary Henderson, + John Weidman, neviksti (neviksti@hotmail.com), + Kris Bleakley, Andreas Naive + + DSP-2 emulator code + (c) Copyright 2003 Kris Bleakley, John Weidman, neviksti, Matthew Kendora, and + Lord Nightmare (lord_nightmare@users.sourceforge.net + + OBC1 emulator code + (c) Copyright 2001 - 2004 zsKnight, pagefault (pagefault@zsnes.com) and + Kris Bleakley + Ported from x86 assembler to C by sanmaiwashi + + SPC7110 and RTC C++ emulator code + (c) Copyright 2002 Matthew Kendora with research by + zsKnight, John Weidman, and Dark Force + + S-DD1 C emulator code + (c) Copyright 2003 Brad Jorsch with research by + Andreas Naive and John Weidman + + S-RTC C emulator code + (c) Copyright 2001 John Weidman + + ST010 C++ emulator code + (c) Copyright 2003 Feather, Kris Bleakley, John Weidman and Matthew Kendora + + Super FX x86 assembler emulator code + (c) Copyright 1998 - 2003 zsKnight, _Demo_, and pagefault + + Super FX C emulator code + (c) Copyright 1997 - 1999 Ivar, Gary Henderson and John Weidman + + + SH assembler code partly based on x86 assembler code + (c) Copyright 2002 - 2004 Marcus Comstedt (marcus@mc.pp.se) + + JMA compressed file support + (c) Copyright 2004 NSRT Team (http://nsrt.edgeemu.com) + + Specific ports contains the works of other authors. See headers in + individual files. + + Snes9x homepage: http://www.snes9x.com + + Permission to use, copy, modify and distribute Snes9x in both binary and + source form, for non-commercial purposes, is hereby granted without fee, + providing that this license information and copyright notice appear with + all copies and any derived work. + + This software is provided 'as-is', without any express or implied + warranty. In no event shall the authors be held liable for any damages + arising from the use of this software. + + Snes9x is freeware for PERSONAL USE only. Commercial users should + seek permission of the copyright holders first. Commercial use includes + charging money for Snes9x or software derived from Snes9x. + + The copyright holders request that bug fixes and improvements to the code + should be forwarded to them so everyone can benefit from the modifications + in future versions. + + Super NES and Super Nintendo Entertainment System are trademarks of + Nintendo Co., Limited and its subsidiary companies. +*******************************************************************************/ + +#include "../memmap.h" + +#include +using namespace std; + +#include "s9x-jma.h" +#include "jma.h" + +size_t load_jma_file(const char *filename, unsigned char *buffer) +{ + try + { + JMA::jma_open JMAFile(filename); + vector file_info = JMAFile.get_files_info(); + + string our_file_name; + size_t our_file_size = 0; + + for (vector::iterator i = file_info.begin(); i != file_info.end(); i++) + { + //Check for valid ROM based on size + if ((i->size <= CMemory::MAX_ROM_SIZE+512) && (i->size > our_file_size)) + { + our_file_name = i->name; + our_file_size = i->size; + } + } + + if (!our_file_size) + { + return(0); + } + + JMAFile.extract_file(our_file_name, buffer); + + return(our_file_size); + } + catch (JMA::jma_errors jma_error) + { + return(0); + } +} + diff -NaHudr snes9x-1.43-src/snes9x/logger.cpp snx/snes9x/logger.cpp --- snes9x-1.43-src/snes9x/logger.cpp 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/logger.cpp 2006-02-23 10:45:38.000000000 +0200 @@ -0,0 +1,123 @@ +#include +#include +#include "logger.h" +#include "snes9x.h" +#include "soundux.h" +#include "ppu.h" +#include "movie.h" + +int dumpstreams = 0; +int maxframes = -1; +int ignoreframes = 0; + +static int resetno = 0; +static int framecounter = 0; + +static int drift = 0; + +FILE *video=NULL, *audio=NULL; +char autodemo[128] = ""; + +void ResetLogger() +{ + char buffer[256*224*4]; + + if (!dumpstreams) + return; + + framecounter = 0; + drift=0; + + if (video) + fclose(video); + if (audio) + fclose(audio); + + sprintf(buffer, "videostream%d.dat", resetno); + video = fopen(buffer, "wb"); + if (!video) + { + printf("Opening %s failed. Logging cancelled.\n", buffer); + return; + } + + sprintf(buffer, "audiostream%d.dat", resetno); + audio = fopen(buffer, "wb"); + if (!audio) + { + printf("Opening %s failed. Logging cancelled.\n", buffer); + fclose(video); + return; + } + + char *logo = getenv("LOGO"); + if (!logo) + logo = "logo.dat"; + FILE *l = fopen(logo, "rb"); + if (l) + { + const int soundsize = (so.sixteen_bit ? 2 : 1)*(so.stereo?2:1)*so.playback_rate * Settings.FrameTime / 1000000; + printf("Soundsize: %d\n", soundsize); + while (!feof(l)) + { + if (fread(buffer, 1024,224, l) != 224) + break; + VideoLogger(buffer, 256, 224, 24); + memset(buffer, 0, soundsize); + AudioLogger(buffer, soundsize); + } + fclose(l); + } + resetno++; +} + + +void VideoLogger(void *pixels, int width, int height, int depth) +{ + int fc = S9xMovieGetFrameCounter(); + if (fc > 0) + framecounter = fc; + else + framecounter++; + + if (video) + { + fwrite(pixels, 256*4, 224, video); + fflush(video); + fflush(audio); + drift++; + + if (maxframes > 0 && __builtin_expect(framecounter >= maxframes, 0)) + { + printf("-maxframes hit\ndrift:%d\n",drift); + S9xExit(); + } + + } + + if (Settings.DisplayPressedKeys) + { + fprintf(stderr, "%d %s %s %s %s %s %s %c%c%c%c%c%c \r", framecounter, + IPPU.Joypads[0] & SNES_START_MASK ? "Start" : "_____", + IPPU.Joypads[0] & SNES_SELECT_MASK ? "Select" : "______", + IPPU.Joypads[0] & SNES_UP_MASK ? "Up" : "__", + IPPU.Joypads[0] & SNES_DOWN_MASK ? "Down" : "____", + IPPU.Joypads[0] & SNES_LEFT_MASK ? "Left" : "____", + IPPU.Joypads[0] & SNES_RIGHT_MASK ? "Right" : "_____", + IPPU.Joypads[0] & SNES_A_MASK ? 'A':'_', + IPPU.Joypads[0] & SNES_B_MASK ? 'B':'_', + IPPU.Joypads[0] & SNES_X_MASK ? 'X':'_', + IPPU.Joypads[0] & SNES_Y_MASK ? 'Y':'_', + IPPU.Joypads[0] & SNES_TL_MASK ? 'L':'_', + IPPU.Joypads[0] & SNES_TR_MASK ? 'R':'_'); + + } +} + + +void AudioLogger(void *samples, int length) +{ + if (audio) + fwrite(samples, 1, length, audio); + drift--; +} diff -NaHudr snes9x-1.43-src/snes9x/logger.h snx/snes9x/logger.h --- snes9x-1.43-src/snes9x/logger.h 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/logger.h 2006-02-23 10:45:09.000000000 +0200 @@ -0,0 +1,10 @@ +extern int dumpstreams; +extern char autodemo[128]; +extern int ignoreframes; +extern int maxframes; +extern int logger_pivot; + + +void ResetLogger(); +void VideoLogger(void *pixels, int width, int height, int depth); +void AudioLogger(void *samples, int length); diff -NaHudr snes9x-1.43-src/snes9x/Makefile.in snx/snes9x/Makefile.in --- snes9x-1.43-src/snes9x/Makefile.in 2004-12-31 00:15:44.000000000 +0200 +++ snx/snes9x/Makefile.in 2008-02-20 15:07:56.005386739 +0200 @@ -117,7 +117,7 @@ cpu.o sa1.o debug.o sdd1.o tile.o srtc.o gfx.o memmap.o clip.o \ dsp1.o ppu.o dma.o snes9x.o data.o globals.o \ $(SPC7110OBJ) $(OBC1OBJ) $(SETAOBJ) $(KREEDOBJ) $(SDD1OBJ) \ - $(CHEATOBJ) $(PLATFORMOBJ) $(SNAPOBJ) $(SCREENSHOTOBJ) $(MOVIEOBJ) + $(CHEATOBJ) $(PLATFORMOBJ) $(SNAPOBJ) $(SCREENSHOTOBJ) $(MOVIEOBJ) logger.o ifdef NETPLAY OBJECTS += netplay.o server.o @@ -136,6 +136,14 @@ JMADEFINES=-DJMA_SUPPORT -fexceptions endif +OBJECTS += unix/tiletracker.o +OBJECTS += unix/beauty.o +OBJECTS += unix/nesvideos-piece.o +OBJECTS += unix/rgbtorgb.o +OBJECTS += ntsc/snes_ntsc.o +EXTRALIBS += -lgd -ldl -lpng +# -lXau -lXdmcp + ifdef THREAD_SOUND CPUDEFINES += -DUSE_THREADS EXTRALIBS += -lpthread @@ -183,7 +191,7 @@ INCLUDES += -I$(srcdir) -I$(srcdir)/unzip @CPUINC@ ifdef DREAMCAST -OPTIMISE=-O4 -ffreestanding -ffast-math -fschedule-insns2 -fomit-frame-pointer -fno-inline-functions -fno-defer-pop -fforce-addr -fstrict-aliasing -funroll-loops -fdelete-null-pointer-checks -fno-exceptions +OPTIMISE=-O4 -ffreestanding -ffast-math -fschedule-insns2 -fomit-frame-pointer -fno-inline-functions -fno-defer-pop -fforce-addr -fstrict-aliasing -funroll-loops -fdelete-null-pointer-checks CPUFLAGS=-ml -m4-single-only else OPTIMISE = @OPTIMIZE@ @@ -216,6 +224,7 @@ #-DCPU_SHUTDOWN #-DSPC700_SHUTDOWN +OPTIMISE += -mmmx CCFLAGS = $(OPTIMISE) $(CPUFLAGS) $(INCLUDES) $(DEFS) CFLAGS=$(CCFLAGS) @@ -282,6 +291,9 @@ .cpp.o: $(CCC) $(INCLUDES) -c $(CCFLAGS) $(srcdir)/$*.cpp -o $@ +.cc.o: + $(CCC) $(INCLUDES) -c $(CCFLAGS) $(srcdir)/$*.cc -o $@ + .c.o: $(CC) $(INCLUDES) -c $(CCFLAGS) $(srcdir)/$*.c -o $@ diff -NaHudr snes9x-1.43-src/snes9x/makefile.mgw snx/snes9x/makefile.mgw --- snes9x-1.43-src/snes9x/makefile.mgw 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/makefile.mgw 2005-03-21 14:00:47.000000000 +0200 @@ -0,0 +1,245 @@ +ZSNESFX=1 +ZSNESC4=1 +ASMCPU=1 +#SPC700ASM=1 +#NETPLAY=1 +UNZIP=1 +JMA=1 +#GLIDE=1 +OPENGL=1 +ASMKREED=1 +SDD1_DECOMP=1 +#SDD1_VERIFY=0 +CHEATS=1 +2XSAI=1 +SCREENSHOTS=1 + +ifdef ZSNESFX + FXOBJ=i386/fxemu2b.o i386/fxemu2.o i386/fxemu2c.o i386/fxtable.o \ + i386/sfxproc.o i386/ZSNES.O + FXDEFINES=-DZSNES_FX -DEXECUTE_SUPERFX_PER_LINE + FXDEPENDS=zsnes_fx + FXNO_DEPENDS=c_fx +else + FXOBJ=fxinst.o fxemu.o fxdbg.o + FXDEFINES=-DEXECUTE_SUPERFX_PER_LINE + FXDEPENDS=c_fx + FXNO_DEPENDS=zsnes_fx +endif + +ifdef ZSNESC4 + C4OBJ=i386/C4.O i386/zsnesc4.o c4.o + C4DEFINES=-DZSNES_C4 + C4DEPENDS=zsnes_c4 + C4NO_DEPENDS=c_c4 +else + C4OBJ=c4.o c4emu.o + C4DEFINES= + C4DEPENDS=c_c4 + C4NO_DEPENDS=zsnes_c4 +endif + +ifdef SPC700ASM + SOUNDOBJ=spctool/spc700.o spctool/dsp.o spctool.o spctool/soundmod.o spc.o + SOUNDDEFINES=-DSPCTOOL +else + SOUNDOBJ=spc700.o soundux.o apu.o i386/SPC.O + SOUNDDEFINES=-DSPC700_C +endif + +ifdef ASMCPU + CPUOBJ=i386/cpuops.o i386/cpuexec.o i386/sa1ops.o +else + CPUOBJ=cpuops.o cpuexec.o sa1cpu.o +endif + +PLATFORMOBJ=win32.o ../directx.o ../render.o ../wsnes9x.o \ + ../auxmath.o ../AVIOutput.o ../InputCustom.o ../0snes9x.o \ + +ifdef CHEATS + CHEATOBJ=cheats.o cheats2.o +endif + +SNAPOBJ=snaporig.o snapshot.o +MOVIEOBJ=movie.o + +ifdef SCREENSHOTS + SCREENSHOTOBJ=screenshot.o + SHOTDEFINES=-DHAVE_LIBPNG + LDLIBS=-lpng +endif + +ifdef 2XSAI + ifdef ASMKREED + KREEDOBJ=i386/2XSAIMMX.O i386/bilinear.o 2xsai.o + KREEDDEFINES=-DMMX + else + KREEDOBJ=2xsai.o + endif +endif + +ifdef SDD1_DECOMP + SDD1OBJ=sdd1emu.o + ifdef SDD1_VERIFY + SDD1DEFINES=-DSDD1_DECOMP -DSDD1_VERIFY + else + SDD1DEFINES=-DSDD1_DECOMP + endif +endif + +SPC7110OBJ=spc7110.o +OBC1OBJ=obc1.o +SETAOBJ=seta.o seta010.o seta011.o seta018.o + +OBJECTS=$(CPUOBJ) $(SOUNDOBJ) apudebug.o $(FXOBJ) $(C4OBJ) \ + cpu.o sa1.o debug.o sdd1.o tile.o srtc.o gfx.o memmap.o clip.o \ + dsp1.o ppu.o dma.o snes9x.o data.o globals.o \ + $(SPC7110OBJ) $(OBC1OBJ) $(SETAOBJ) $(KREEDOBJ) $(SDD1OBJ) \ + $(CHEATOBJ) $(PLATFORMOBJ) $(SNAPOBJ) $(SCREENSHOTOBJ) $(MOVIEOBJ) + +ifdef NETPLAY + OBJECTS+=netplay.o server.o + NETPLAYDEFINES=-DNETPLAY_SUPPORT +endif + +ifdef UNZIP + OBJECTS+=loadzip.o unzip/unzip.o unzip/explode.o unzip/unreduce.o unzip/unshrink.o + UNZIPDEFINES=-DUNZIP_SUPPORT +endif + +ifdef JMA +OBJECTS+=jma/s9x-jma.o jma/7zlzma.o jma/crc32.o jma/iiostrm.o jma/inbyte.o \ + jma/jma.o jma/lzma.o jma/lzmadec.o jma/winout.o +JMADEFINES=-DJMA_SUPPORT -fexceptions +endif + +ifdef GLIDE + GLIDEDEFINES=-DUSE_GLIDE + GLIDELIBS=-lglide2x + GLIDEDEPENDS=use_glide + GLIDENO_DEPENDS=no_glide +else + GLIDEDEPENDS=no_glide + GLIDENO_DEPENDS=use_glide +endif + +ifdef OPENGL + OPENGLDEFINES=-DUSE_OPENGL + OPENGLLIBS=-lglu32 -lopengl32 + OPENGLDEPENDS=use_opengl + OPENGLNO_DEPENDS=no_opengl +else + OPENGLDEPENDS=no_opengl + OPENGLNO_DEPENDS=use_opengl +endif + +JOYDEFINES=-DJOYSTICK_SUPPORT + +AUDIODEFINES=-DFMOD_SUPPORT +SOUNDENGINE=-lfmod -lmingw32 + +CCC=c++ +CC=gcc +GASM=c++ +NASM=nasmw + +INCLUDES=-I. -Ii386 -Iunzip -I/mingw/include/FMOD +LDLIBS+=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -lcomctl32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -ladvapi32 -lwsock32 -lwinmm -lddraw -ldsound -ldxguid -lvfw32 -lz + +OPTIMISE=-O1 -mtune=pentium -fomit-frame-pointer -fno-exceptions -Wno-unused-parameter -mwindows + +CCFLAGS= \ + -DZLIB \ + -DVAR_CYCLES \ + -DCPU_SHUTDOWN \ + -DSPC700_SHUTDOWN \ + -DSDD1_DECOMP \ + -DHAVE_STRINGS_H \ + -DOLD_COLOUR_BLENDING \ + -DCORRECT_VRAM_READS \ + -DJP_FIX \ + -D__WIN32__ \ + $(FXDEFINES) \ + $(C4DEFINES) \ + $(SOUNDDEFINES) \ + $(NETPLAYDEFINES) \ + $(UNZIPDEFINES) \ + $(JMADEFINES) \ + $(GLIDEDEFINES) \ + $(OPENGLDEFINES) \ + $(SHOTDEFINES) \ + $(KREEDDEFINES) \ + $(SDD1DEFINES) \ + $(JOYDEFINES) \ + $(AUDIODEFINES) + +CFLAGS=$(CCFLAGS) + +.SUFFIXES: .o .cpp .c .cc .h .m .i .S .asm .obj .O .CPP .C .ASM + +all: offsets.exe snes9x.exe + +$(FXDEPENDS): + cp offsets.exe $(FXDEPENDS) + rm -f $(FXNO_DEPENDS) + +$(C4DEPENDS): + cp offsets.exe $(C4DEPENDS) + rm -f $(C4_NODEPENDS) + +offsets.exe: offsets.o + $(CCC) $(INCLUDES) -o $@ offsets.o + offsets.exe > i386/offsets.h + +../0snes9x.o: ../0snes9x.rc ../resource.h + windres --use-temp-file -I../ -o ../0snes9x.o ../0snes9x.rc + +snes9x.exe: $(OBJECTS) $(MINGWOBJECTS) + $(CCC) $(INCLUDES) -Wl,--subsystem,windows -o $@ -s $(OBJECTS) $(LDLIBS) $(SOUNDENGINE) $(OPENGLLIBS) + +cpu.o: + $(CCC) $(INCLUDES) -c $(OPTIMISE) $(CCFLAGS) cpu.cpp -o $@ + +sa1cpu.o: + $(CCC) $(INCLUDES) -c $(OPTIMISE) $(CCFLAGS) sa1cpu.cpp -o $@ + +.cpp.o: + $(CCC) $(INCLUDES) -c $(OPTIMISE) $(CCFLAGS) $*.cpp -o $@ + +.c.o: + $(CC) $(INCLUDES) -c $(OPTIMISE) $(CFLAGS) $*.c -o $@ + +.cpp.S: + $(GASM) $(INCLUDES) -S $(OPTIMISE) $(CCFLAGS) $*.cpp -o $@ + +.cpp.i: + $(GASM) $(INCLUDES) -E $(OPTIMISE) $(CCFLAGS) $*.cpp -o $@ + +.S.o: + $(GASM) $(INCLUDES) -c -D__DJGCC -x assembler-with-cpp $(OPTIMISE) $(CCFLAGS) $*.S -o $@ + +.S.i: + $(GASM) $(INCLUDES) -c -E $(OPTIMISE) $(CCFLAGS) $*.S -o $@ + +.asm.o: + $(NASM) -d__DJGPP__=1 -f win32 $(FXDEFINES) -i . -i i386 -o $@ $*.asm + +.obj.o: + cp $*.obj $*.o + +.CPP.O: + $(CCC) $(INCLUDES) -c $(OPTIMISE) $(CCFLAGS) $*.CPP -o $@ + +.C.O: + $(CC) $(INCLUDES) -c $(OPTIMISE) $(CFLAGS) $*.C -o $@ + +.ASM.O: + $(NASM) -d__DJGPP__=1 -f win32 $(FXDEFINES) -i . -i i386 -o $@ $*.ASM -o $@ + +clean: + rm -f $(FXDEPENDS) $(C4DEPENDS) $(FXNO_DEPENDS) $(C4NO_DEPENDS) + rm -f $(OBJECTS) *.o i386/*.o i386/offsets.h offsets.o + rm -f snes9x.exe offsets.exe + +compress: + upx snes9x.exe diff -NaHudr snes9x-1.43-src/snes9x/memmap.cpp snx/snes9x/memmap.cpp --- snes9x-1.43-src/snes9x/memmap.cpp 2004-12-31 00:15:47.000000000 +0200 +++ snx/snes9x/memmap.cpp 2005-12-17 22:01:01.000000000 +0200 @@ -388,10 +388,10 @@ for (int i = 0; i < len; i++) { - if (s [i] >= 32 && s [i] < 127) + //if (s [i] >= 32 && s [i] < 127) safe [i] = s[i]; - else - safe [i] = '?'; + //else + // safe [i] = '?'; } safe [len] = 0; return (safe); @@ -1679,6 +1679,9 @@ bool8 CMemory::SaveSRAM (const char *filename) { +/// if(!CPU.SRAMModified) +/// return TRUE; + if(Settings.SuperFX && Memory.ROMType < 0x15) return TRUE; if(Settings.SA1 && Memory.ROMType == 0x34) diff -NaHudr snes9x-1.43-src/snes9x/memmap.h snx/snes9x/memmap.h --- snes9x-1.43-src/snes9x/memmap.h 2004-12-31 00:15:47.000000000 +0200 +++ snx/snes9x/memmap.h 2007-07-28 22:27:40.000000000 +0300 @@ -276,8 +276,8 @@ void S9xAutoSaveSRAM (); #ifdef NO_INLINE_SET_GET -uint8 S9xGetByte (uint32 Address); -uint16 S9xGetWord (uint32 Address); +uint8 S9xGetByte (uint32 Address, bool free=false); +uint16 S9xGetWord (uint32 Address, bool free=false); void S9xSetByte (uint8 Byte, uint32 Address); void S9xSetWord (uint16 Byte, uint32 Address); void S9xSetPCBase (uint32 Address); diff -NaHudr snes9x-1.43-src/snes9x/movie.cpp snx/snes9x/movie.cpp --- snes9x-1.43-src/snes9x/movie.cpp 2004-12-31 00:15:47.000000000 +0200 +++ snx/snes9x/movie.cpp 2007-08-07 14:05:10.000000000 +0300 @@ -117,6 +117,7 @@ #define SMV_MAGIC 0x1a564d53 // SMV0x1a #define SMV_VERSION 1 #define SMV_HEADER_SIZE 32 +#define SMV_EXTRAROMINFO_SIZE (2+sizeof(uint32)+sizeof(char)*23+1) #define CONTROLLER_DATA_SIZE 2 #define BUFFER_GROWTH_SIZE 4096 @@ -140,13 +141,17 @@ uint32 RerecordCount; uint8 ControllersMask; uint8 Opts; + uint8 SyncFlags; bool8 ReadOnly; uint32 BytesPerFrame; uint8* InputBuffer; uint32 InputBufferSize; uint8* InputBufferPtr; - bool8 FrameDisplay; - char FrameDisplayString[256]; +/// bool8 FrameDisplay; +/// char FrameDisplayString[256]; + + uint32 ROMCRC32; + char ROMName [23]; } Movie; /* @@ -241,10 +246,38 @@ movie->ControllersMask=*ptr++; movie->Opts=*ptr++; - ptr += 2; + ptr ++; // reserved byte + movie->SyncFlags=*ptr++; // previously reserved byte movie->SaveStateOffset=Read32(ptr); movie->ControllerDataOffset=Read32(ptr); + + return SUCCESS; +} + +static int read_movie_extrarominfo(FILE* fd, SMovie* movie) +{ + if((movie->SyncFlags & MOVIE_SYNC_HASROMINFO) != 0) + { + fseek(fd, movie->SaveStateOffset - SMV_EXTRAROMINFO_SIZE, SEEK_SET); + + uint8 extraRomInfo[SMV_EXTRAROMINFO_SIZE]; + if(fread(extraRomInfo, 1, SMV_EXTRAROMINFO_SIZE, fd) != SMV_EXTRAROMINFO_SIZE) + return WRONG_FORMAT; + + const uint8* ptr=extraRomInfo; + + ptr ++; // zero byte + ptr ++; // zero byte + ptr ++; // zero byte + movie->ROMCRC32=Read32(ptr); + strncpy(movie->ROMName,(const char*)ptr,23); ptr += 23; + } + else + { + movie->ROMCRC32=Memory.ROMCRC32; + strncpy(movie->ROMName,(const char*)Memory.ROMName,23); + } return SUCCESS; } @@ -262,7 +295,8 @@ *ptr++=movie->ControllersMask; *ptr++=movie->Opts; - *ptr++=0; + *ptr++=0; // reserved byte + *ptr++=movie->SyncFlags; // previously reserved byte *ptr++=0; Write32(movie->SaveStateOffset, ptr); @@ -271,8 +305,52 @@ fwrite(header, 1, SMV_HEADER_SIZE, fd); } +static void write_movie_extrarominfo(FILE* fd, const SMovie* movie) +{ + if((movie->SyncFlags & MOVIE_SYNC_HASROMINFO) != 0) // should be true... + { + uint8 extraRomInfo [SMV_EXTRAROMINFO_SIZE]; + uint8* ptr = extraRomInfo; + + *ptr++=0; // zero byte + *ptr++=0; // zero byte + *ptr++=0; // zero byte + Write32(movie->ROMCRC32, ptr); + strncpy((char*)ptr,movie->ROMName,23); ptr += 23; + + fwrite(extraRomInfo, 1, SMV_EXTRAROMINFO_SIZE, fd); + } +} + static void flush_movie() { + if((Movie.SyncFlags & MOVIE_SYNC_HASROMINFO) == 0) // if we have to insert the ROM info into a movie made by a previous version + { + fseek(Movie.File, 0, SEEK_END); + long oldFileSize = (uint32)ftell(Movie.File); + + // copy whole movie into temporary memory + char * tempFile = (char*)malloc(sizeof(char)*oldFileSize); + fseek(Movie.File, 0, SEEK_SET); + fread(tempFile, 1, oldFileSize, Movie.File); + + // write back part of the movie offset by SMV_EXTRAROMINFO_SIZE + fseek(Movie.File, Movie.SaveStateOffset + SMV_EXTRAROMINFO_SIZE, SEEK_SET); + fwrite(tempFile + Movie.SaveStateOffset, 1, oldFileSize - Movie.SaveStateOffset, Movie.File); + + // free the temporary movie in memory + free(tempFile); + + // update flags and offset amounts + Movie.SyncFlags |= MOVIE_SYNC_HASROMINFO; + Movie.SaveStateOffset += SMV_EXTRAROMINFO_SIZE; + Movie.ControllerDataOffset += SMV_EXTRAROMINFO_SIZE; + + // write the extra rom info into the newly inserted space in the file between the metadata and the save data + fseek(Movie.File, Movie.SaveStateOffset - SMV_EXTRAROMINFO_SIZE, SEEK_SET); + write_movie_extrarominfo(Movie.File, &Movie); + } + fseek(Movie.File, 0, SEEK_SET); write_movie_header(Movie.File, &Movie); fseek(Movie.File, Movie.ControllerDataOffset, SEEK_SET); @@ -319,6 +397,27 @@ static void read_frame_controller_data() { int i; + + // one frame of all 1 bits = reset code + if(Movie.InputBufferPtr[0] == 0xFF) + { + bool reset = true; + for(i=1; i<(int)Movie.BytesPerFrame; i++) + { + if(Movie.InputBufferPtr[i] != 0xFF) + { + reset = false; + break; + } + } + if(reset) + { + Movie.InputBufferPtr += Movie.BytesPerFrame; + S9xSoftReset(); + return; + } + } + for(i=0; i<5; ++i) { if(Movie.ControllersMask & (1< %d\n", n); + result=(n == 0x20000) ? SUCCESS : WRONG_FORMAT; +// result = SUCCESS; } else { result=S9xUnfreezeFromStream(stream); } CLOSE_STREAM(stream); + + if((Movie.SyncFlags & MOVIE_SYNC_HASROMINFO) != 0) + { + fprintf(stderr, "Desired options:\n"); + fprintf(stderr, "\t-wip: %s\n", (Movie.SyncFlags & MOVIE_SYNC_WIP1TIMING) ? "Yes":"No"); + fprintf(stderr, "\t-upanddown: %s\n", (Movie.SyncFlags & MOVIE_SYNC_LEFTRIGHT) ? "Yes":"No"); + fprintf(stderr, "\tVOLUMEENVX: %s\n", (Movie.SyncFlags & MOVIE_SYNC_VOLUMEENVX) ? "Yes":"No"); + fprintf(stderr, "\t-fakemute: %s\n", (Movie.SyncFlags & MOVIE_SYNC_FAKEMUTE) ? "Yes":"No"); + fprintf(stderr, "\tsync sound: %s\n", (Movie.SyncFlags & MOVIE_SYNC_SYNCSOUND)? "Yes":"No"); + + Settings.DisallowLeftRight = !(Movie.SyncFlags & MOVIE_SYNC_LEFTRIGHT); + Settings.UseWIPAPUTiming = !!(Movie.SyncFlags & MOVIE_SYNC_WIP1TIMING); + // Settings.SoundEnvelopeHeightReading = !!(Movie.SyncFlags & MOVIE_SYNC_VOLUMEENVX); + } + if(result!=SUCCESS) { + fprintf(stderr, "Didn't manage to unfreeze\n"); return result; } if(!(fd=fopen(filename, read_only ? "rb" : "rb+"))) + { + perror(filename); return FILE_NOT_FOUND; + } if(fseek(fd, Movie.ControllerDataOffset, SEEK_SET)) + { + perror(filename); return WRONG_FORMAT; + } // read controller data Movie.File=fd; @@ -424,15 +561,18 @@ Movie.ReadOnly=read_only; change_state(MOVIE_STATE_PLAY); - S9xMessage(S9X_INFO, S9X_MOVIE_INFO, MOVIE_INFO_REPLAY); + S9xMessage(S9X_INFO, S9X_MOVIE_INFO, ""); + fprintf(stderr, "%s\n", MOVIE_INFO_REPLAY); return SUCCESS; } -int S9xMovieCreate (const char* filename, uint8 controllers_mask, uint8 opts, const wchar_t* metadata, int metadata_length) +int S9xMovieCreate (const char* filename, uint8 controllers_mask, uint8 opts, uint8 syncFlags, const wchar_t* metadata, int metadata_length) { FILE* fd; STREAM stream; int fn; + + syncFlags |= MOVIE_SYNC_HASROMINFO; if(controllers_mask==0) return WRONG_FORMAT; @@ -451,10 +591,11 @@ Movie.MovieId=(uint32)time(NULL); Movie.RerecordCount=0; Movie.MaxFrame=0; - Movie.SaveStateOffset=SMV_HEADER_SIZE+(sizeof(uint16)*metadata_length); + Movie.SaveStateOffset=SMV_HEADER_SIZE+(sizeof(uint16)*metadata_length) + SMV_EXTRAROMINFO_SIZE; Movie.ControllerDataOffset=0; Movie.ControllersMask=controllers_mask; Movie.Opts=opts; + Movie.SyncFlags=syncFlags; if(Settings.PAL) { Movie.Opts |= MOVIE_OPT_PAL; @@ -464,8 +605,14 @@ Movie.Opts &= ~MOVIE_OPT_PAL; } + // extra rom info + Movie.ROMCRC32 = Memory.ROMCRC32; + strncpy(Movie.ROMName, Memory.ROMName, 23); + + write_movie_header(fd, &Movie); + // convert wchar_t metadata string/array to a uint16 array if(metadata_length>0) { @@ -482,11 +629,14 @@ fwrite(meta_buf, sizeof(uint16), metadata_length, fd); } + write_movie_extrarominfo(fd, &Movie); + // write snapshot + fflush(fd); fn=dup(fileno(fd)); fclose(fd); - // lseek(fn, Movie.SaveStateOffset, SEEK_SET); + lseek(fn, Movie.SaveStateOffset, SEEK_SET); if(!(stream=REOPEN_STREAM(fn, "ab"))) return FILE_NOT_FOUND; @@ -524,6 +674,22 @@ return SUCCESS; } +void S9xMovieUpdateOnReset () +{ + switch(Movie.State) + { + case MOVIE_STATE_RECORD: + { + reserve_buffer_space((uint32)((Movie.InputBufferPtr+Movie.BytesPerFrame)-Movie.InputBuffer)); + memset(Movie.InputBufferPtr, 0xFF, Movie.BytesPerFrame); + Movie.InputBufferPtr += Movie.BytesPerFrame; + Movie.MaxFrame = ++Movie.CurrentFrame; + fwrite((Movie.InputBufferPtr - Movie.BytesPerFrame), 1, Movie.BytesPerFrame, Movie.File); + } + break; + } +} + void S9xMovieUpdate () { switch(Movie.State) @@ -537,10 +703,10 @@ } else { - if(Movie.FrameDisplay) + if(GFX.FrameDisplay) { - sprintf(Movie.FrameDisplayString, "Playing frame: %d", Movie.CurrentFrame); - S9xMessage (S9X_INFO, S9X_MOVIE_INFO, Movie.FrameDisplayString); + sprintf(GFX.FrameDisplayString, "Playing frame: %d / %d", Movie.CurrentFrame, Movie.MaxFrame); +/// S9xMessage (S9X_INFO, S9X_MOVIE_INFO, GFX.FrameDisplayString); } read_frame_controller_data(); ++Movie.CurrentFrame; @@ -549,10 +715,10 @@ case MOVIE_STATE_RECORD: { - if(Movie.FrameDisplay) + if(GFX.FrameDisplay) { - sprintf(Movie.FrameDisplayString, "Recording frame: %d", Movie.CurrentFrame); - S9xMessage (S9X_INFO, S9X_MOVIE_INFO, Movie.FrameDisplayString); + sprintf(GFX.FrameDisplayString, "Recording frame: %d", Movie.CurrentFrame); +/// S9xMessage (S9X_INFO, S9X_MOVIE_INFO, GFX.FrameDisplayString); } write_frame_controller_data(); ++Movie.CurrentFrame; @@ -595,6 +761,7 @@ info->LengthFrames=local_movie.MaxFrame; info->RerecordCount=local_movie.RerecordCount; info->Opts=local_movie.Opts; + info->SyncFlags=local_movie.SyncFlags; info->ControllersMask=local_movie.ControllersMask; if(local_movie.SaveStateOffset > SMV_HEADER_SIZE) @@ -602,7 +769,9 @@ uint8 meta_buf[MOVIE_MAX_METADATA * sizeof(uint16)]; int i; - metadata_length=((int)local_movie.SaveStateOffset-SMV_HEADER_SIZE)/sizeof(uint16); + int curRomInfoSize = (local_movie.SyncFlags & MOVIE_SYNC_HASROMINFO) != 0 ? SMV_EXTRAROMINFO_SIZE : 0; + + metadata_length=((int)local_movie.SaveStateOffset-SMV_HEADER_SIZE-curRomInfoSize)/sizeof(uint16); metadata_length=(metadata_length>=MOVIE_MAX_METADATA) ? MOVIE_MAX_METADATA-1 : metadata_length; metadata_length=(int)fread(meta_buf, sizeof(uint16), metadata_length, fd); @@ -618,6 +787,11 @@ info->Metadata[0]='\0'; } + read_movie_extrarominfo(fd, &local_movie); + + info->ROMCRC32=local_movie.ROMCRC32; + strncpy(info->ROMName,local_movie.ROMName,23); + fclose(fd); if(access(filename, W_OK)) @@ -630,6 +804,19 @@ { return (Movie.State!=MOVIE_STATE_NONE); } +bool8 S9xMoviePlaying () +{ + return (Movie.State==MOVIE_STATE_PLAY); +} +bool8 S9xMovieRecording () +{ + return (Movie.State==MOVIE_STATE_RECORD); +} + +uint8 S9xMovieControllers () +{ + return Movie.ControllersMask; +} bool8 S9xMovieReadOnly () { @@ -663,26 +850,45 @@ return Movie.CurrentFrame; } +void S9xMovieToggleRecState() +{ + Movie.ReadOnly=!Movie.ReadOnly; + + if (Movie.ReadOnly) + S9xMessage(S9X_INFO, S9X_MOVIE_INFO, "Movie is now read-only."); + else + S9xMessage(S9X_INFO, S9X_MOVIE_INFO, "Movie is now read+write."); +} + void S9xMovieToggleFrameDisplay () { - Movie.FrameDisplay = !Movie.FrameDisplay; - if(!Movie.FrameDisplay) + GFX.FrameDisplay = !GFX.FrameDisplay; + + if(GFX.FrameDisplay) { - GFX.InfoStringTimeout = 1; + char buf[512]; + sprintf(buf, "Frame %d / %d\n", Movie.CurrentFrame , Movie.MaxFrame); + S9xMessage(S9X_INFO, S9X_MOVIE_INFO, buf); } +/// if(!GFX.FrameDisplay) +/// GFX.InfoStringTimeout = 1; +/* if(GFX.FrameDisplay) + S9xMessage(S9X_INFO, S9X_MOVIE_INFO, "Frame count display enabled."); + else + S9xMessage(S9X_INFO, S9X_MOVIE_INFO, "Frame count display disabled.");*/ } void S9xMovieFreeze (uint8** buf, uint32* size) { + *buf = NULL; + *size = 0; + // sanity check if(!S9xMovieActive()) { return; } - *buf = NULL; - *size = 0; - // compute size needed for the buffer uint32 size_needed = 4*3; // room for MovieId, CurrentFrame, and MaxFrame size_needed += (uint32)(Movie.BytesPerFrame * (Movie.MaxFrame+1)); @@ -725,6 +931,7 @@ current_frame > max_frame || space_needed > size) { + S9xMessage(S9X_INFO, S9X_MOVIE_INFO, "Invalid movie snapshot."); return false; } @@ -734,16 +941,27 @@ // and make it the input data for the current movie, then continue // writing new input data at the currentframe pointer change_state(MOVIE_STATE_RECORD); - S9xMessage(S9X_INFO, S9X_MOVIE_INFO, MOVIE_INFO_RERECORD); +/// S9xMessage(S9X_INFO, S9X_MOVIE_INFO, MOVIE_INFO_RERECORD); Movie.CurrentFrame = current_frame; Movie.MaxFrame = max_frame; ++Movie.RerecordCount; + // when re-recording, update the sync info in the movie to the new settings as of the last re-record. + bool hadRomInfo = (Movie.SyncFlags & MOVIE_SYNC_HASROMINFO) != 0; + Movie.SyncFlags = MOVIE_SYNC_DATA_EXISTS | (hadRomInfo ? MOVIE_SYNC_HASROMINFO : 0); + if(Settings.UseWIPAPUTiming) Movie.SyncFlags |= MOVIE_SYNC_WIP1TIMING; + if(!Settings.DisallowLeftRight) Movie.SyncFlags |= MOVIE_SYNC_LEFTRIGHT; + if(Settings.SoundEnvelopeHeightReading) Movie.SyncFlags |= MOVIE_SYNC_VOLUMEENVX; + if(Settings.FakeMuteFix) Movie.SyncFlags |= MOVIE_SYNC_FAKEMUTE; + if(Settings.SoundSync) Movie.SyncFlags |= MOVIE_SYNC_SYNCSOUND; + reserve_buffer_space(space_needed); memcpy(Movie.InputBuffer, ptr, space_needed); flush_movie(); fseek(Movie.File, Movie.ControllerDataOffset+(Movie.BytesPerFrame * (Movie.CurrentFrame+1)), SEEK_SET); + +/// Settings.DisplayPressedKeys = false; } else { @@ -757,11 +975,12 @@ // the end of the input data, so check for that here if(current_frame > Movie.MaxFrame) { + S9xMessage(S9X_INFO, S9X_MOVIE_INFO, "Can't load; save past movie."); return false; } change_state(MOVIE_STATE_PLAY); - S9xMessage(S9X_INFO, S9X_MOVIE_INFO, MOVIE_INFO_REWIND); +/// S9xMessage(S9X_INFO, S9X_MOVIE_INFO, MOVIE_INFO_REWIND); Movie.CurrentFrame = current_frame; } diff -NaHudr snes9x-1.43-src/snes9x/movie.h snx/snes9x/movie.h --- snes9x-1.43-src/snes9x/movie.h 2004-12-31 00:15:47.000000000 +0200 +++ snx/snes9x/movie.h 2007-08-07 14:05:11.000000000 +0300 @@ -107,6 +107,14 @@ #define MOVIE_OPT_PAL (1<<1) #define MOVIE_MAX_METADATA 512 +#define MOVIE_SYNC_DATA_EXISTS (0x01) +#define MOVIE_SYNC_WIP1TIMING (0x02) +#define MOVIE_SYNC_LEFTRIGHT (0x04) +#define MOVIE_SYNC_VOLUMEENVX (0x08) +#define MOVIE_SYNC_FAKEMUTE (0x10) +#define MOVIE_SYNC_SYNCSOUND (0x20) +#define MOVIE_SYNC_HASROMINFO (0x40) + START_EXTERN_C struct MovieInfo { @@ -117,24 +125,33 @@ uint8 Opts; uint8 ControllersMask; bool8 ReadOnly; + uint8 SyncFlags; + + uint32 ROMCRC32; + char ROMName [23]; }; // methods used by the user-interface code int S9xMovieOpen (const char* filename, bool8 read_only); -int S9xMovieCreate (const char* filename, uint8 controllers_mask, uint8 opts, const wchar_t* metadata, int metadata_length); +int S9xMovieCreate (const char* filename, uint8 controllers_mask, uint8 opts, uint8 syncFlags, const wchar_t* metadata, int metadata_length); int S9xMovieGetInfo (const char* filename, struct MovieInfo* info); void S9xMovieStop (bool8 suppress_message); +void S9xMovieToggleRecState (); void S9xMovieToggleFrameDisplay (); // methods used by the emulation void S9xMovieInit (); void S9xMovieUpdate (); +void S9xMovieUpdateOnReset (); //bool8 S9xMovieRewind (uint32 at_frame); void S9xMovieFreeze (uint8** buf, uint32* size); bool8 S9xMovieUnfreeze (const uint8* buf, uint32 size); // accessor functions bool8 S9xMovieActive (); +bool8 S9xMoviePlaying (); +bool8 S9xMovieRecording (); +uint8 S9xMovieControllers (); // the following accessors return 0/false if !S9xMovieActive() bool8 S9xMovieReadOnly (); uint32 S9xMovieGetId (); diff -NaHudr snes9x-1.43-src/snes9x/ntsc/benchmark.c snx/snes9x/ntsc/benchmark.c --- snes9x-1.43-src/snes9x/ntsc/benchmark.c 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/benchmark.c 2007-01-06 07:09:38.000000000 +0200 @@ -0,0 +1,96 @@ +/* Measures performance of blitter, useful for improving a custom blitter. +NOTE: This assumes that the process is getting 100% CPU time; you might need to +arrange for this or else the performance will be reported lower than it really is. */ + +#include "snes_ntsc.h" + +#include +#include +#include + +enum { time_hires = 0 }; /* change to 1 to time hires mode */ + +enum { in_width = 256 * 2 }; +enum { in_height = 223 }; + +enum { out_width = SNES_NTSC_OUT_WIDTH( in_width ) }; +enum { out_height = in_height }; + +struct data_t +{ + snes_ntsc_t ntsc; + unsigned short in [ in_height] [ in_width]; + unsigned short out [out_height] [out_width]; +}; + +static int time_blitter( void ); + +int main() +{ + struct data_t* data = (struct data_t*) malloc( sizeof *data ); + if ( data ) + { + clock_t start; + + /* fill with random pixel data */ + int y; + for ( y = 0; y < in_height; y++ ) + { + int x; + for ( x = 0; x < in_width; x++ ) + data->in [y] [x] = (rand() >> 4 & 0x1F) * 64; + } + + /* time initialization */ + start = clock(); + for ( y = 10; y--; ) + snes_ntsc_init( &data->ntsc, 0 ); + printf( "Init time: %.2f seconds\n", + (double) (clock() - start) / (CLOCKS_PER_SEC * 10) ); + + /* measure frame rate */ + while ( time_blitter() ) + { + if ( time_hires ) + snes_ntsc_blit_hires( &data->ntsc, data->in [0], in_width, 0, + in_width, in_height, data->out [0], sizeof data->out [0] ); + else + snes_ntsc_blit( &data->ntsc, data->in [0], in_width, 0, + in_width / 2, in_height, data->out [0], sizeof data->out [0] ); + } + + free( data ); + } + + getchar(); + return 0; +} + +static int time_blitter( void ) +{ + int const duration = 4; /* seconds */ + static clock_t end_time; + static int count; + if ( !count ) + { + clock_t time = clock(); + while ( clock() == time ) { } + if ( clock() - time > CLOCKS_PER_SEC ) + { + /* clock increments less-often than once every second */ + printf( "Insufficient time resolution\n" ); + return 0; + } + end_time = clock() + CLOCKS_PER_SEC * duration; + } + else if ( clock() >= end_time ) + { + int rate = count / duration; + printf( "Performance: %d frames per second, which would use %d%% CPU at 60 FPS\n", + rate, 60 * 100 / rate ); + return 0; + } + count++; + + return 1; +} diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/filter.cpp snx/snes9x/ntsc/byuu/filter.cpp --- snes9x-1.43-src/snes9x/ntsc/byuu/filter.cpp 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/filter.cpp 2007-02-04 01:16:19.000000000 +0200 @@ -0,0 +1,8 @@ +#include "../port.h" + +#include "video_colortable.cpp" +#include "video_normalize.cpp" +#include "filter_direct.cpp" +#include "filter_ntsc.cpp" +#include "filter_hq2x.cpp" +#include "filter_scale2x.cpp" diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/filter.cpp~ snx/snes9x/ntsc/byuu/filter.cpp~ --- snes9x-1.43-src/snes9x/ntsc/byuu/filter.cpp~ 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/filter.cpp~ 2007-02-04 01:16:19.000000000 +0200 @@ -0,0 +1,8 @@ +#include "../snes9x.h" + +#include "video_colortable.cpp" +#include "video_normalize.cpp" +#include "filter_direct.cpp" +#include "filter_ntsc.cpp" +#include "filter_hq2x.cpp" +#include "filter_scale2x.cpp" diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/filter_direct.cpp snx/snes9x/ntsc/byuu/filter_direct.cpp --- snes9x-1.43-src/snes9x/ntsc/byuu/filter_direct.cpp 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/filter_direct.cpp 2006-08-01 22:28:26.000000000 +0300 @@ -0,0 +1,27 @@ +void DirectVideoFilter::run( +uint32 *colortbl, uint16 *data, uint32 width, uint32 height, uint32 pitch, +uint16 *output, uint32 max_width, uint32 max_height, uint32 output_pitch, +uint32 req_width, uint32 req_height, uint &result_width, uint &result_height, +uint16 *scanline_widths +) { + pitch >>= 1; + output_pitch >>= 1; + + for(int y = 0; y < height; y++) { + if(width == 512 && scanline_widths[y] == 256) { + for(int x = 0; x < 256; x++) { + *output++ = colortbl[*data]; + *output++ = colortbl[*data++]; + } + data += 256; + } else { + for(int x = 0; x < width; x++) { + *output++ = colortbl[*data++]; + } + } + data += pitch - width; + output += output_pitch - width; + } + result_width = width; + result_height = height; +} diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/filter_direct.h snx/snes9x/ntsc/byuu/filter_direct.h --- snes9x-1.43-src/snes9x/ntsc/byuu/filter_direct.h 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/filter_direct.h 2006-08-01 22:27:50.000000000 +0300 @@ -0,0 +1,6 @@ +class DirectVideoFilter : public VideoFilter { +public: + void run(uint32 *colortbl, uint16 *data, uint32 width, uint32 height, uint32 pitch, + uint16 *output, uint32 max_width, uint32 max_height, uint32 output_pitch, + uint32 req_width, uint32 req_height, uint &result_width, uint &result_height, uint16 *scanline_widths = 0); +}; diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/filter.h snx/snes9x/ntsc/byuu/filter.h --- snes9x-1.43-src/snes9x/ntsc/byuu/filter.h 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/filter.h 2007-02-04 01:17:08.000000000 +0200 @@ -0,0 +1,37 @@ +#include "../port.h" + +enum { + VIDEOFILTER_DIRECT, + VIDEOFILTER_NTSC, + VIDEOFILTER_HQ2X, + VIDEOFILTER_SCALE2X +}; + +//all video filters must derive from this class +class VideoFilter { +public: +/*[run] + * uint32 *colortbl - Color lookup table to convert BGR555 to current pixel format + * uint16 *data - Input data buffer (always in system memory) + * uint32 width - Input width (always 256 or 512) + * uint32 height - Input height (<=240 = progressive, >240 = interlace) + * uint32 pitch - Input data buffer bytes per scanline (always 1024) + * uint16 *output - Output data buffer (sometimes in video memory, never read from here!) + * uint32 max_width - Output data buffer width limit (do not write past buffer) + * uint32 max_height - Output data buffer height limit (do not write past buffer) + * uint32 output_pitch - Output data buffer bytes per scanline + * uint32 req_width - Requested output width (can be ignored if filter resizes to fixed size) + * uint32 req_height - Requested output height (can be ignored if filter resizes to fixed size) + * uint32 &result_width - Actual rendered width by filter (input is undefined, write only) + * uint32 &result_height - Actual rendered height by filter (input is undefined, write only) + */ + virtual void run(uint32 *colortbl, uint16 *data, uint32 width, uint32 height, uint32 pitch, + uint16 *output, uint32 max_width, uint32 max_height, uint32 output_pitch, + uint32 req_width, uint32 req_height, uint &result_width, uint &result_height, uint16 *scanline_widths = 0) = 0; + virtual ~VideoFilter() {} +}; + +#include "filter_direct.h" +#include "filter_ntsc.h" +#include "filter_hq2x.h" +#include "filter_scale2x.h" diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/filter.h~ snx/snes9x/ntsc/byuu/filter.h~ --- snes9x-1.43-src/snes9x/ntsc/byuu/filter.h~ 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/filter.h~ 2007-02-04 01:17:08.000000000 +0200 @@ -0,0 +1,35 @@ +enum { + VIDEOFILTER_DIRECT, + VIDEOFILTER_NTSC, + VIDEOFILTER_HQ2X, + VIDEOFILTER_SCALE2X +}; + +//all video filters must derive from this class +class VideoFilter { +public: +/*[run] + * uint32 *colortbl - Color lookup table to convert BGR555 to current pixel format + * uint16 *data - Input data buffer (always in system memory) + * uint32 width - Input width (always 256 or 512) + * uint32 height - Input height (<=240 = progressive, >240 = interlace) + * uint32 pitch - Input data buffer bytes per scanline (always 1024) + * uint16 *output - Output data buffer (sometimes in video memory, never read from here!) + * uint32 max_width - Output data buffer width limit (do not write past buffer) + * uint32 max_height - Output data buffer height limit (do not write past buffer) + * uint32 output_pitch - Output data buffer bytes per scanline + * uint32 req_width - Requested output width (can be ignored if filter resizes to fixed size) + * uint32 req_height - Requested output height (can be ignored if filter resizes to fixed size) + * uint32 &result_width - Actual rendered width by filter (input is undefined, write only) + * uint32 &result_height - Actual rendered height by filter (input is undefined, write only) + */ + virtual void run(uint32 *colortbl, uint16 *data, uint32 width, uint32 height, uint32 pitch, + uint16 *output, uint32 max_width, uint32 max_height, uint32 output_pitch, + uint32 req_width, uint32 req_height, uint &result_width, uint &result_height, uint16 *scanline_widths = 0) = 0; + virtual ~VideoFilter() {} +}; + +#include "filter_direct.h" +#include "filter_ntsc.h" +#include "filter_hq2x.h" +#include "filter_scale2x.h" diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/filter_hq2x.cpp snx/snes9x/ntsc/byuu/filter_hq2x.cpp --- snes9x-1.43-src/snes9x/ntsc/byuu/filter_hq2x.cpp 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/filter_hq2x.cpp 2006-08-01 22:28:38.000000000 +0300 @@ -0,0 +1,180 @@ +/***** + * HQ2x Algorithm (C) 2003 Maxim Stepin + * License: LGPL + * + * Optimizations (C) 2006 Shay Green, byuu + *****/ + +#define diff(x, y) ((yuvtable[x] - yuvtable[y] + diff_offset) & diff_mask) +#define hdiff(x, y) ((x - yuvtable[y]) & diff_mask) +#define expand_rgb(n) { n |= n << 16; n &= 0x03e07c1f; } +#define pack_rgb(n) { n &= 0x03e07c1f; n |= n >> 16; } + +static uint16 blend1(uint32 c1, uint32 c2) { + expand_rgb(c1); + expand_rgb(c2); + c1 = (c1 * 3 + c2) >> 2; + pack_rgb(c1); + return c1; +} + +static uint16 blend2(uint32 c1, uint32 c2, uint32 c3) { +//c1 = (c1 * 2 + c2 + c3) >> 2; + c2 = (c2 + c3 - ((c2 ^ c3) & 0x0421)) >> 1; + c1 = (c1 + c2 - ((c1 ^ c2) & 0x0421)) >> 1; + return c1; +} + +static uint16 blend6(uint32 c1, uint32 c2, uint32 c3) { + expand_rgb(c1); + expand_rgb(c2); + expand_rgb(c3); + c1 = (c1 * 5 + c2 * 2 + c3) >> 3; + pack_rgb(c1); + return c1; +} + +static uint16 blend7(uint32 c1, uint32 c2, uint32 c3) { + expand_rgb(c1); + expand_rgb(c2); + expand_rgb(c3); + c1 = (c1 * 6 + c2 + c3) >> 3; + pack_rgb(c1); + return c1; +} + +static uint16 blend9(uint32 c1, uint32 c2, uint32 c3) { + expand_rgb(c1); + expand_rgb(c2); + expand_rgb(c3); + c1 = (c1 * 2 + (c2 + c3) * 3) >> 3; + pack_rgb(c1); + return c1; +} + +static uint16 blend10(uint32 c1, uint32 c2, uint32 c3) { + expand_rgb(c1); + expand_rgb(c2); + expand_rgb(c3); + c1 = (c1 * 14 + c2 + c3) >> 4; + pack_rgb(c1); + return c1; +} + +void HQ2xVideoFilter::run( +uint32 *colortbl, uint16 *data, uint32 width, uint32 height, uint32 pitch, +uint16 *output, uint32 max_width, uint32 max_height, uint32 output_pitch, +uint32 req_width, uint32 req_height, uint &result_width, uint &result_height, +uint16 *scanline_widths +) { + pitch >>= 1; + output_pitch >>= 1; + + if(width == 256 && height <= 240) { + lores_progressive(colortbl, data, height, pitch, output, output_pitch); + result_width = 512; + result_height = height * 2; + return; + } + + for(int y = 0; y < height; y++) { + if(width == 512 && scanline_widths[y] == 256) { + for(int x = 0; x < 256; x++) { + *output++ = colortbl[*data]; + *output++ = colortbl[*data++]; + } + data += 256; + } else { + for(int x = 0; x < width; x++) { + *output++ = colortbl[*data++]; + } + } + data += pitch - width; + output += output_pitch - width; + } + result_width = width; + result_height = height; +} + +void HQ2xVideoFilter::lores_progressive( +uint32 *colortbl, uint16 *data, uint32 height, uint32 pitch, +uint16 *output, uint32 output_pitch +) { +uint16 *out0 = (uint16*)(output); +uint16 *out1 = (uint16*)(output + output_pitch); +#define W1 data[-1 - (SNES::VIDEOPITCH_LORES >> 1)] +#define W2 data[ 0 - (SNES::VIDEOPITCH_LORES >> 1)] +#define W3 data[+1 - (SNES::VIDEOPITCH_LORES >> 1)] +#define W4 data[-1] +#define W5 data[ 0] +#define W6 data[+1] +#define W7 data[-1 + (SNES::VIDEOPITCH_LORES >> 1)] +#define W8 data[ 0 + (SNES::VIDEOPITCH_LORES >> 1)] +#define W9 data[+1 + (SNES::VIDEOPITCH_LORES >> 1)] + + data += pitch; + memset(out0, 0, 1024); out0 += output_pitch << 1; + memset(out1, 0, 1024); out1 += output_pitch << 1; + + for(int y = height - 2; y; --y) { + data++; + *(uint32*)out0 = 0; out0 += 2; + *(uint32*)out1 = 0; out1 += 2; + + int32 pattern = diff(W5, W4) ? 0x10 : 0x00; + for(int x = 256 - 2; x; --x) { + uint32 center = yuvtable[W5] + diff_offset; + //W4 for pixel x+1 is the same as W6 for pixel x + pattern = (pattern & 0x10) >> 1; + pattern |= hdiff(center, W1) ? 0x01 : 0x00; + pattern |= hdiff(center, W2) ? 0x02 : 0x00; + pattern |= hdiff(center, W3) ? 0x04 : 0x00; + //pattern |= hdiff(center, W4) ? 0x08 : 0x00; + pattern |= hdiff(center, W6) ? 0x10 : 0x00; + pattern |= hdiff(center, W7) ? 0x20 : 0x00; + pattern |= hdiff(center, W8) ? 0x40 : 0x00; + pattern |= hdiff(center, W9) ? 0x80 : 0x00; + + switch(pattern) { + #include "filter_hq2x_lookuptbl.h" + } + + data++; + out0 += 2; + out1 += 2; + } + + data++; + *(uint32*)out0 = 0; out0 += 2; + *(uint32*)out1 = 0; out1 += 2; + + data += pitch - 256; + out0 += output_pitch + output_pitch - 512; + out1 += output_pitch + output_pitch - 512; + } + + memset(out0, 0, 1024); + memset(out1, 0, 1024); +} + +HQ2xVideoFilter::HQ2xVideoFilter() { + for(int i = 0; i < 32768; i++) { + int ir = (i) & 0x1f; + int ig = (i >> 5) & 0x1f; + int ib = (i >> 10) & 0x1f; + + //bgr555->bgr888 + double r = (ir << 3) | (ir >> 2); + double g = (ig << 3) | (ig >> 2); + double b = (ib << 3) | (ib >> 2); + + //bgr888->yuv888 + double y = (r + g + b) * (0.25f * (63.5f / 48.0f)); + double u = ((r - b) * 0.25f + 128.0f) * (7.5f / 7.0f); + double v = ((g * 2.0f - r - b) * 0.125f + 128.0f) * (7.5f / 6.0f); + yuvtable[i] = (int(y) << 21) + (int(u) << 11) + (int(v)); + } + + diff_offset = (0x440 << 21) + (0x207 << 11) + 0x407; + diff_mask = (0x380 << 21) + (0x1f0 << 11) + 0x3f0; +} diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/filter_hq2x.h snx/snes9x/ntsc/byuu/filter_hq2x.h --- snes9x-1.43-src/snes9x/ntsc/byuu/filter_hq2x.h 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/filter_hq2x.h 2006-08-01 22:27:58.000000000 +0300 @@ -0,0 +1,13 @@ +class HQ2xVideoFilter : public VideoFilter { +public: +uint32 yuvtable[32768]; +uint32 diff_offset, diff_mask; + void run(uint32 *colortbl, uint16 *data, uint32 width, uint32 height, uint32 pitch, + uint16 *output, uint32 max_width, uint32 max_height, uint32 output_pitch, + uint32 req_width, uint32 req_height, uint &result_width, uint &result_height, uint16 *scanline_widths = 0); + + void lores_progressive(uint32 *colortbl, uint16 *data, uint32 height, uint32 pitch, + uint16 *output, uint32 output_pitch); + + HQ2xVideoFilter(); +}; diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/filter_hq2x_lookuptbl.h snx/snes9x/ntsc/byuu/filter_hq2x_lookuptbl.h --- snes9x-1.43-src/snes9x/ntsc/byuu/filter_hq2x_lookuptbl.h 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/filter_hq2x_lookuptbl.h 2006-03-09 02:17:18.000000000 +0200 @@ -0,0 +1,2683 @@ +#define p00(__color) *(out0 + 0) = (colortbl[__color]) +#define p01(__color) *(out0 + 1) = (colortbl[__color]) +#define p10(__color) *(out1 + 0) = (colortbl[__color]) +#define p11(__color) *(out1 + 1) = (colortbl[__color]) + +#define PIXEL00_0 p00( W5); +#define PIXEL00_10 p00(blend1 (W5, W1)); +#define PIXEL00_11 p00(blend1 (W5, W4)); +#define PIXEL00_12 p00(blend1 (W5, W2)); +#define PIXEL00_20 p00(blend2 (W5, W4, W2)); +#define PIXEL00_21 p00(blend2 (W5, W1, W2)); +#define PIXEL00_22 p00(blend2 (W5, W1, W4)); +#define PIXEL00_60 p00(blend6 (W5, W2, W4)); +#define PIXEL00_61 p00(blend6 (W5, W4, W2)); +#define PIXEL00_70 p00(blend7 (W5, W4, W2)); +#define PIXEL00_90 p00(blend9 (W5, W4, W2)); +#define PIXEL00_100 p00(blend10(W5, W4, W2)); + +#define PIXEL01_0 p01( W5); +#define PIXEL01_10 p01(blend1 (W5, W3)); +#define PIXEL01_11 p01(blend1 (W5, W2)); +#define PIXEL01_12 p01(blend1 (W5, W6)); +#define PIXEL01_20 p01(blend2 (W5, W2, W6)); +#define PIXEL01_21 p01(blend2 (W5, W3, W6)); +#define PIXEL01_22 p01(blend2 (W5, W3, W2)); +#define PIXEL01_60 p01(blend6 (W5, W6, W2)); +#define PIXEL01_61 p01(blend6 (W5, W2, W6)); +#define PIXEL01_70 p01(blend7 (W5, W2, W6)); +#define PIXEL01_90 p01(blend9 (W5, W2, W6)); +#define PIXEL01_100 p01(blend10(W5, W2, W6)); + +#define PIXEL10_0 p10( W5); +#define PIXEL10_10 p10(blend1 (W5, W7)); +#define PIXEL10_11 p10(blend1 (W5, W8)); +#define PIXEL10_12 p10(blend1 (W5, W4)); +#define PIXEL10_20 p10(blend2 (W5, W8, W4)); +#define PIXEL10_21 p10(blend2 (W5, W7, W4)); +#define PIXEL10_22 p10(blend2 (W5, W7, W8)); +#define PIXEL10_60 p10(blend6 (W5, W4, W8)); +#define PIXEL10_61 p10(blend6 (W5, W8, W4)); +#define PIXEL10_70 p10(blend7 (W5, W8, W4)); +#define PIXEL10_90 p10(blend9 (W5, W8, W4)); +#define PIXEL10_100 p10(blend10(W5, W8, W4)); + +#define PIXEL11_0 p11( W5); +#define PIXEL11_10 p11(blend1 (W5, W9)); +#define PIXEL11_11 p11(blend1 (W5, W6)); +#define PIXEL11_12 p11(blend1 (W5, W8)); +#define PIXEL11_20 p11(blend2 (W5, W6, W8)); +#define PIXEL11_21 p11(blend2 (W5, W9, W8)); +#define PIXEL11_22 p11(blend2 (W5, W9, W6)); +#define PIXEL11_60 p11(blend6 (W5, W8, W6)); +#define PIXEL11_61 p11(blend6 (W5, W6, W8)); +#define PIXEL11_70 p11(blend7 (W5, W6, W8)); +#define PIXEL11_90 p11(blend9 (W5, W6, W8)); +#define PIXEL11_100 p11(blend10(W5, W6, W8)); + + case 0: + case 1: + case 4: + case 32: + case 128: + case 5: + case 132: + case 160: + case 33: + case 129: + case 36: + case 133: + case 164: + case 161: + case 37: + case 165: { + PIXEL00_20 + PIXEL01_20 + PIXEL10_20 + PIXEL11_20 + } break; + + case 2: + case 34: + case 130: + case 162: { + PIXEL00_22 + PIXEL01_21 + PIXEL10_20 + PIXEL11_20 + } break; + + case 16: + case 17: + case 48: + case 49: { + PIXEL00_20 + PIXEL01_22 + PIXEL10_20 + PIXEL11_21 + } break; + + case 64: + case 65: + case 68: + case 69: { + PIXEL00_20 + PIXEL01_20 + PIXEL10_21 + PIXEL11_22 + } break; + + case 8: + case 12: + case 136: + case 140: { + PIXEL00_21 + PIXEL01_20 + PIXEL10_22 + PIXEL11_20 + } break; + + case 3: + case 35: + case 131: + case 163: { + PIXEL00_11 + PIXEL01_21 + PIXEL10_20 + PIXEL11_20 + } break; + + case 6: + case 38: + case 134: + case 166: { + PIXEL00_22 + PIXEL01_12 + PIXEL10_20 + PIXEL11_20 + } break; + + case 20: + case 21: + case 52: + case 53: { + PIXEL00_20 + PIXEL01_11 + PIXEL10_20 + PIXEL11_21 + } break; + + case 144: + case 145: + case 176: + case 177: { + PIXEL00_20 + PIXEL01_22 + PIXEL10_20 + PIXEL11_12 + } break; + + case 192: + case 193: + case 196: + case 197: { + PIXEL00_20 + PIXEL01_20 + PIXEL10_21 + PIXEL11_11 + } break; + + case 96: + case 97: + case 100: + case 101: { + PIXEL00_20 + PIXEL01_20 + PIXEL10_12 + PIXEL11_22 + } break; + + case 40: + case 44: + case 168: + case 172: { + PIXEL00_21 + PIXEL01_20 + PIXEL10_11 + PIXEL11_20 + } break; + + case 9: + case 13: + case 137: + case 141: { + PIXEL00_12 + PIXEL01_20 + PIXEL10_22 + PIXEL11_20 + } break; + + case 18: + case 50: + { + PIXEL00_22 + if (diff(W2, W6)) + { + PIXEL01_10 + } + else + { + PIXEL01_20 + } + PIXEL10_20 + PIXEL11_21 + break; + } + case 80: + case 81: + { + PIXEL00_20 + PIXEL01_22 + PIXEL10_21 + if (diff(W6, W8)) + { + PIXEL11_10 + } + else + { + PIXEL11_20 + } + break; + } + case 72: + case 76: + { + PIXEL00_21 + PIXEL01_20 + if (diff(W8, W4)) + { + PIXEL10_10 + } + else + { + PIXEL10_20 + } + PIXEL11_22 + break; + } + case 10: + case 138: + { + if (diff(W4, W2)) + { + PIXEL00_10 + } + else + { + PIXEL00_20 + } + PIXEL01_21 + PIXEL10_22 + PIXEL11_20 + break; + } + case 66: + { + PIXEL00_22 + PIXEL01_21 + PIXEL10_21 + PIXEL11_22 + break; + } + case 24: + { + PIXEL00_21 + PIXEL01_22 + PIXEL10_22 + PIXEL11_21 + break; + } + case 7: + case 39: + case 135: + { + PIXEL00_11 + PIXEL01_12 + PIXEL10_20 + PIXEL11_20 + break; + } + case 148: + case 149: + case 180: + { + PIXEL00_20 + PIXEL01_11 + PIXEL10_20 + PIXEL11_12 + break; + } + case 224: + case 228: + case 225: + { + PIXEL00_20 + PIXEL01_20 + PIXEL10_12 + PIXEL11_11 + break; + } + case 41: + case 169: + case 45: + { + PIXEL00_12 + PIXEL01_20 + PIXEL10_11 + PIXEL11_20 + break; + } + case 22: + case 54: + { + PIXEL00_22 + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_20 + PIXEL11_21 + break; + } + case 208: + case 209: + { + PIXEL00_20 + PIXEL01_22 + PIXEL10_21 + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 104: + case 108: + { + PIXEL00_21 + PIXEL01_20 + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_22 + break; + } + case 11: + case 139: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_21 + PIXEL10_22 + PIXEL11_20 + break; + } + case 19: + case 51: + { + if (diff(W2, W6)) + { + PIXEL00_11 + PIXEL01_10 + } + else + { + PIXEL00_60 + PIXEL01_90 + } + PIXEL10_20 + PIXEL11_21 + break; + } + case 146: + case 178: + { + PIXEL00_22 + if (diff(W2, W6)) + { + PIXEL01_10 + PIXEL11_12 + } + else + { + PIXEL01_90 + PIXEL11_61 + } + PIXEL10_20 + break; + } + case 84: + case 85: + { + PIXEL00_20 + if (diff(W6, W8)) + { + PIXEL01_11 + PIXEL11_10 + } + else + { + PIXEL01_60 + PIXEL11_90 + } + PIXEL10_21 + break; + } + case 112: + case 113: + { + PIXEL00_20 + PIXEL01_22 + if (diff(W6, W8)) + { + PIXEL10_12 + PIXEL11_10 + } + else + { + PIXEL10_61 + PIXEL11_90 + } + break; + } + case 200: + case 204: + { + PIXEL00_21 + PIXEL01_20 + if (diff(W8, W4)) + { + PIXEL10_10 + PIXEL11_11 + } + else + { + PIXEL10_90 + PIXEL11_60 + } + break; + } + case 73: + case 77: + { + if (diff(W8, W4)) + { + PIXEL00_12 + PIXEL10_10 + } + else + { + PIXEL00_61 + PIXEL10_90 + } + PIXEL01_20 + PIXEL11_22 + break; + } + case 42: + case 170: + { + if (diff(W4, W2)) + { + PIXEL00_10 + PIXEL10_11 + } + else + { + PIXEL00_90 + PIXEL10_60 + } + PIXEL01_21 + PIXEL11_20 + break; + } + case 14: + case 142: + { + if (diff(W4, W2)) + { + PIXEL00_10 + PIXEL01_12 + } + else + { + PIXEL00_90 + PIXEL01_61 + } + PIXEL10_22 + PIXEL11_20 + break; + } + case 67: + { + PIXEL00_11 + PIXEL01_21 + PIXEL10_21 + PIXEL11_22 + break; + } + case 70: + { + PIXEL00_22 + PIXEL01_12 + PIXEL10_21 + PIXEL11_22 + break; + } + case 28: + { + PIXEL00_21 + PIXEL01_11 + PIXEL10_22 + PIXEL11_21 + break; + } + case 152: + { + PIXEL00_21 + PIXEL01_22 + PIXEL10_22 + PIXEL11_12 + break; + } + case 194: + { + PIXEL00_22 + PIXEL01_21 + PIXEL10_21 + PIXEL11_11 + break; + } + case 98: + { + PIXEL00_22 + PIXEL01_21 + PIXEL10_12 + PIXEL11_22 + break; + } + case 56: + { + PIXEL00_21 + PIXEL01_22 + PIXEL10_11 + PIXEL11_21 + break; + } + case 25: + { + PIXEL00_12 + PIXEL01_22 + PIXEL10_22 + PIXEL11_21 + break; + } + case 26: + case 31: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_22 + PIXEL11_21 + break; + } + case 82: + case 214: + { + PIXEL00_22 + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_21 + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 88: + case 248: + { + PIXEL00_21 + PIXEL01_22 + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 74: + case 107: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_21 + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_22 + break; + } + case 27: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_10 + PIXEL10_22 + PIXEL11_21 + break; + } + case 86: + { + PIXEL00_22 + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_21 + PIXEL11_10 + break; + } + case 216: + { + PIXEL00_21 + PIXEL01_22 + PIXEL10_10 + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 106: + { + PIXEL00_10 + PIXEL01_21 + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_22 + break; + } + case 30: + { + PIXEL00_10 + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_22 + PIXEL11_21 + break; + } + case 210: + { + PIXEL00_22 + PIXEL01_10 + PIXEL10_21 + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 120: + { + PIXEL00_21 + PIXEL01_22 + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_10 + break; + } + case 75: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_21 + PIXEL10_10 + PIXEL11_22 + break; + } + case 29: + { + PIXEL00_12 + PIXEL01_11 + PIXEL10_22 + PIXEL11_21 + break; + } + case 198: + { + PIXEL00_22 + PIXEL01_12 + PIXEL10_21 + PIXEL11_11 + break; + } + case 184: + { + PIXEL00_21 + PIXEL01_22 + PIXEL10_11 + PIXEL11_12 + break; + } + case 99: + { + PIXEL00_11 + PIXEL01_21 + PIXEL10_12 + PIXEL11_22 + break; + } + case 57: + { + PIXEL00_12 + PIXEL01_22 + PIXEL10_11 + PIXEL11_21 + break; + } + case 71: + { + PIXEL00_11 + PIXEL01_12 + PIXEL10_21 + PIXEL11_22 + break; + } + case 156: + { + PIXEL00_21 + PIXEL01_11 + PIXEL10_22 + PIXEL11_12 + break; + } + case 226: + { + PIXEL00_22 + PIXEL01_21 + PIXEL10_12 + PIXEL11_11 + break; + } + case 60: + { + PIXEL00_21 + PIXEL01_11 + PIXEL10_11 + PIXEL11_21 + break; + } + case 195: + { + PIXEL00_11 + PIXEL01_21 + PIXEL10_21 + PIXEL11_11 + break; + } + case 102: + { + PIXEL00_22 + PIXEL01_12 + PIXEL10_12 + PIXEL11_22 + break; + } + case 153: + { + PIXEL00_12 + PIXEL01_22 + PIXEL10_22 + PIXEL11_12 + break; + } + case 58: + { + if (diff(W4, W2)) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + if (diff(W2, W6)) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + PIXEL10_11 + PIXEL11_21 + break; + } + case 83: + { + PIXEL00_11 + if (diff(W2, W6)) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + PIXEL10_21 + if (diff(W6, W8)) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 92: + { + PIXEL00_21 + PIXEL01_11 + if (diff(W8, W4)) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + if (diff(W6, W8)) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 202: + { + if (diff(W4, W2)) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + PIXEL01_21 + if (diff(W8, W4)) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + PIXEL11_11 + break; + } + case 78: + { + if (diff(W4, W2)) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + PIXEL01_12 + if (diff(W8, W4)) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + PIXEL11_22 + break; + } + case 154: + { + if (diff(W4, W2)) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + if (diff(W2, W6)) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + PIXEL10_22 + PIXEL11_12 + break; + } + case 114: + { + PIXEL00_22 + if (diff(W2, W6)) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + PIXEL10_12 + if (diff(W6, W8)) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 89: + { + PIXEL00_12 + PIXEL01_22 + if (diff(W8, W4)) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + if (diff(W6, W8)) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 90: + { + if (diff(W4, W2)) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + if (diff(W2, W6)) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + if (diff(W8, W4)) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + if (diff(W6, W8)) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 55: + case 23: + { + if (diff(W2, W6)) + { + PIXEL00_11 + PIXEL01_0 + } + else + { + PIXEL00_60 + PIXEL01_90 + } + PIXEL10_20 + PIXEL11_21 + break; + } + case 182: + case 150: + { + PIXEL00_22 + if (diff(W2, W6)) + { + PIXEL01_0 + PIXEL11_12 + } + else + { + PIXEL01_90 + PIXEL11_61 + } + PIXEL10_20 + break; + } + case 213: + case 212: + { + PIXEL00_20 + if (diff(W6, W8)) + { + PIXEL01_11 + PIXEL11_0 + } + else + { + PIXEL01_60 + PIXEL11_90 + } + PIXEL10_21 + break; + } + case 241: + case 240: + { + PIXEL00_20 + PIXEL01_22 + if (diff(W6, W8)) + { + PIXEL10_12 + PIXEL11_0 + } + else + { + PIXEL10_61 + PIXEL11_90 + } + break; + } + case 236: + case 232: + { + PIXEL00_21 + PIXEL01_20 + if (diff(W8, W4)) + { + PIXEL10_0 + PIXEL11_11 + } + else + { + PIXEL10_90 + PIXEL11_60 + } + break; + } + case 109: + case 105: + { + if (diff(W8, W4)) + { + PIXEL00_12 + PIXEL10_0 + } + else + { + PIXEL00_61 + PIXEL10_90 + } + PIXEL01_20 + PIXEL11_22 + break; + } + case 171: + case 43: + { + if (diff(W4, W2)) + { + PIXEL00_0 + PIXEL10_11 + } + else + { + PIXEL00_90 + PIXEL10_60 + } + PIXEL01_21 + PIXEL11_20 + break; + } + case 143: + case 15: + { + if (diff(W4, W2)) + { + PIXEL00_0 + PIXEL01_12 + } + else + { + PIXEL00_90 + PIXEL01_61 + } + PIXEL10_22 + PIXEL11_20 + break; + } + case 124: + { + PIXEL00_21 + PIXEL01_11 + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_10 + break; + } + case 203: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_21 + PIXEL10_10 + PIXEL11_11 + break; + } + case 62: + { + PIXEL00_10 + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_11 + PIXEL11_21 + break; + } + case 211: + { + PIXEL00_11 + PIXEL01_10 + PIXEL10_21 + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 118: + { + PIXEL00_22 + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_12 + PIXEL11_10 + break; + } + case 217: + { + PIXEL00_12 + PIXEL01_22 + PIXEL10_10 + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 110: + { + PIXEL00_10 + PIXEL01_12 + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_22 + break; + } + case 155: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_10 + PIXEL10_22 + PIXEL11_12 + break; + } + case 188: + { + PIXEL00_21 + PIXEL01_11 + PIXEL10_11 + PIXEL11_12 + break; + } + case 185: + { + PIXEL00_12 + PIXEL01_22 + PIXEL10_11 + PIXEL11_12 + break; + } + case 61: + { + PIXEL00_12 + PIXEL01_11 + PIXEL10_11 + PIXEL11_21 + break; + } + case 157: + { + PIXEL00_12 + PIXEL01_11 + PIXEL10_22 + PIXEL11_12 + break; + } + case 103: + { + PIXEL00_11 + PIXEL01_12 + PIXEL10_12 + PIXEL11_22 + break; + } + case 227: + { + PIXEL00_11 + PIXEL01_21 + PIXEL10_12 + PIXEL11_11 + break; + } + case 230: + { + PIXEL00_22 + PIXEL01_12 + PIXEL10_12 + PIXEL11_11 + break; + } + case 199: + { + PIXEL00_11 + PIXEL01_12 + PIXEL10_21 + PIXEL11_11 + break; + } + case 220: + { + PIXEL00_21 + PIXEL01_11 + if (diff(W8, W4)) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 158: + { + if (diff(W4, W2)) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_22 + PIXEL11_12 + break; + } + case 234: + { + if (diff(W4, W2)) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + PIXEL01_21 + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_11 + break; + } + case 242: + { + PIXEL00_22 + if (diff(W2, W6)) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + PIXEL10_12 + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 59: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + if (diff(W2, W6)) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + PIXEL10_11 + PIXEL11_21 + break; + } + case 121: + { + PIXEL00_12 + PIXEL01_22 + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + if (diff(W6, W8)) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 87: + { + PIXEL00_11 + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_21 + if (diff(W6, W8)) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 79: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_12 + if (diff(W8, W4)) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + PIXEL11_22 + break; + } + case 122: + { + if (diff(W4, W2)) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + if (diff(W2, W6)) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + if (diff(W6, W8)) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 94: + { + if (diff(W4, W2)) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + if (diff(W8, W4)) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + if (diff(W6, W8)) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 218: + { + if (diff(W4, W2)) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + if (diff(W2, W6)) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + if (diff(W8, W4)) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 91: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + if (diff(W2, W6)) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + if (diff(W8, W4)) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + if (diff(W6, W8)) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 229: + { + PIXEL00_20 + PIXEL01_20 + PIXEL10_12 + PIXEL11_11 + break; + } + case 167: + { + PIXEL00_11 + PIXEL01_12 + PIXEL10_20 + PIXEL11_20 + break; + } + case 173: + { + PIXEL00_12 + PIXEL01_20 + PIXEL10_11 + PIXEL11_20 + break; + } + case 181: + { + PIXEL00_20 + PIXEL01_11 + PIXEL10_20 + PIXEL11_12 + break; + } + case 186: + { + if (diff(W4, W2)) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + if (diff(W2, W6)) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + PIXEL10_11 + PIXEL11_12 + break; + } + case 115: + { + PIXEL00_11 + if (diff(W2, W6)) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + PIXEL10_12 + if (diff(W6, W8)) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 93: + { + PIXEL00_12 + PIXEL01_11 + if (diff(W8, W4)) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + if (diff(W6, W8)) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 206: + { + if (diff(W4, W2)) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + PIXEL01_12 + if (diff(W8, W4)) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + PIXEL11_11 + break; + } + case 205: + case 201: + { + PIXEL00_12 + PIXEL01_20 + if (diff(W8, W4)) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + PIXEL11_11 + break; + } + case 174: + case 46: + { + if (diff(W4, W2)) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + PIXEL01_12 + PIXEL10_11 + PIXEL11_20 + break; + } + case 179: + case 147: + { + PIXEL00_11 + if (diff(W2, W6)) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + PIXEL10_20 + PIXEL11_12 + break; + } + case 117: + case 116: + { + PIXEL00_20 + PIXEL01_11 + PIXEL10_12 + if (diff(W6, W8)) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 189: + { + PIXEL00_12 + PIXEL01_11 + PIXEL10_11 + PIXEL11_12 + break; + } + case 231: + { + PIXEL00_11 + PIXEL01_12 + PIXEL10_12 + PIXEL11_11 + break; + } + case 126: + { + PIXEL00_10 + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_10 + break; + } + case 219: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_10 + PIXEL10_10 + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 125: + { + if (diff(W8, W4)) + { + PIXEL00_12 + PIXEL10_0 + } + else + { + PIXEL00_61 + PIXEL10_90 + } + PIXEL01_11 + PIXEL11_10 + break; + } + case 221: + { + PIXEL00_12 + if (diff(W6, W8)) + { + PIXEL01_11 + PIXEL11_0 + } + else + { + PIXEL01_60 + PIXEL11_90 + } + PIXEL10_10 + break; + } + case 207: + { + if (diff(W4, W2)) + { + PIXEL00_0 + PIXEL01_12 + } + else + { + PIXEL00_90 + PIXEL01_61 + } + PIXEL10_10 + PIXEL11_11 + break; + } + case 238: + { + PIXEL00_10 + PIXEL01_12 + if (diff(W8, W4)) + { + PIXEL10_0 + PIXEL11_11 + } + else + { + PIXEL10_90 + PIXEL11_60 + } + break; + } + case 190: + { + PIXEL00_10 + if (diff(W2, W6)) + { + PIXEL01_0 + PIXEL11_12 + } + else + { + PIXEL01_90 + PIXEL11_61 + } + PIXEL10_11 + break; + } + case 187: + { + if (diff(W4, W2)) + { + PIXEL00_0 + PIXEL10_11 + } + else + { + PIXEL00_90 + PIXEL10_60 + } + PIXEL01_10 + PIXEL11_12 + break; + } + case 243: + { + PIXEL00_11 + PIXEL01_10 + if (diff(W6, W8)) + { + PIXEL10_12 + PIXEL11_0 + } + else + { + PIXEL10_61 + PIXEL11_90 + } + break; + } + case 119: + { + if (diff(W2, W6)) + { + PIXEL00_11 + PIXEL01_0 + } + else + { + PIXEL00_60 + PIXEL01_90 + } + PIXEL10_12 + PIXEL11_10 + break; + } + case 237: + case 233: + { + PIXEL00_12 + PIXEL01_20 + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_100 + } + PIXEL11_11 + break; + } + case 175: + case 47: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_100 + } + PIXEL01_12 + PIXEL10_11 + PIXEL11_20 + break; + } + case 183: + case 151: + { + PIXEL00_11 + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_100 + } + PIXEL10_20 + PIXEL11_12 + break; + } + case 245: + case 244: + { + PIXEL00_20 + PIXEL01_11 + PIXEL10_12 + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_100 + } + break; + } + case 250: + { + PIXEL00_10 + PIXEL01_10 + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 123: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_10 + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_10 + break; + } + case 95: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_10 + PIXEL11_10 + break; + } + case 222: + { + PIXEL00_10 + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_10 + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 252: + { + PIXEL00_21 + PIXEL01_11 + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_100 + } + break; + } + case 249: + { + PIXEL00_12 + PIXEL01_22 + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_100 + } + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 235: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_21 + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_100 + } + PIXEL11_11 + break; + } + case 111: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_100 + } + PIXEL01_12 + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_22 + break; + } + case 63: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_100 + } + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_11 + PIXEL11_21 + break; + } + case 159: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_100 + } + PIXEL10_22 + PIXEL11_12 + break; + } + case 215: + { + PIXEL00_11 + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_100 + } + PIXEL10_21 + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 246: + { + PIXEL00_22 + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_12 + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_100 + } + break; + } + case 254: + { + PIXEL00_10 + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_100 + } + break; + } + case 253: + { + PIXEL00_12 + PIXEL01_11 + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_100 + } + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_100 + } + break; + } + case 251: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_10 + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_100 + } + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 239: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_100 + } + PIXEL01_12 + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_100 + } + PIXEL11_11 + break; + } + case 127: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_100 + } + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_10 + break; + } + case 191: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_100 + } + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_100 + } + PIXEL10_11 + PIXEL11_12 + break; + } + case 223: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_100 + } + PIXEL10_10 + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 247: + { + PIXEL00_11 + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_100 + } + PIXEL10_12 + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_100 + } + break; + } + case 255: + { + if (diff(W4, W2)) + { + PIXEL00_0 + } + else + { + PIXEL00_100 + } + if (diff(W2, W6)) + { + PIXEL01_0 + } + else + { + PIXEL01_100 + } + if (diff(W8, W4)) + { + PIXEL10_0 + } + else + { + PIXEL10_100 + } + if (diff(W6, W8)) + { + PIXEL11_0 + } + else + { + PIXEL11_100 + } + break; + } diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/filter_ntsc_core.cpp snx/snes9x/ntsc/byuu/filter_ntsc_core.cpp --- snes9x-1.43-src/snes9x/ntsc/byuu/filter_ntsc_core.cpp 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/filter_ntsc_core.cpp 2007-02-04 01:51:23.000000000 +0200 @@ -0,0 +1,598 @@ +/* snes_ntsc 0.2.1. http://www.slack.net/~ant/ */ + +/* compilable in C or C++; just change the file extension */ + +//#include "snes_ntsc.h" + +#include +#include + +/* Based on algorithm by NewRisingSun */ +/* Copyright (C) 2006 Shay Green. This module is free software; you +can redistribute it and/or modify it under the terms of the GNU Lesser +General Public License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. This +module is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for +more details. You should have received a copy of the GNU Lesser General +Public License along with this module; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +enum { disable_correction = 0 }; /* for debugging */ + +/* macro constants are used instead of enum in some places to work around compiler bug */ + +/* half normal range to allow for doubled hires pixels */ +#define rgb_unit 0x80 + +/* begin mostly common NES/SNES/SMS code */ + +snes_ntsc_setup_t const snes_ntsc_monochrome = { 0,-1, 0, 0,.2, 0,.2,-.2,-.2,-1, 0, 1, 0, 0 }; +snes_ntsc_setup_t const snes_ntsc_composite = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }; +snes_ntsc_setup_t const snes_ntsc_svideo = { 0, 0, 0, 0,.2, 0,.2, -1, -1, 0, 0, 1, 0, 0 }; +snes_ntsc_setup_t const snes_ntsc_rgb = { 0, 0, 0, 0,.2, 0,.7, -1, -1,-1, 0, 1, 0, 0 }; + +enum { alignment_count = 3 }; /* different pixel alignments with respect to yiq quads */ + +enum { kernel_half = 16 }; +enum { kernel_size = kernel_half * 2 + 1 }; +#define rescale_in 8 +enum { rescale_out = 7 }; + +struct ntsc_impl_t +{ + float to_rgb [snes_ntsc_burst_count] [6]; + float brightness; + float contrast; + float artifacts; + float fringing; + float hue_warping; + float kernel [rescale_out * kernel_size * 2]; +}; + +#define PI 3.14159265358979323846f + +static void init_ntsc_impl( struct ntsc_impl_t* impl, snes_ntsc_setup_t const* setup ) +{ + float kernels [kernel_size * 2]; + + impl->brightness = (float) setup->brightness * (0.4f * rgb_unit); + impl->contrast = (float) setup->contrast * 0.4f + 1.0f; + impl->hue_warping = (float) setup->hue_warping; + + impl->artifacts = (float) setup->artifacts; + if ( impl->artifacts > 0 ) + impl->artifacts *= 0.5f; + impl->artifacts += 1.0f; + + impl->fringing = (float) setup->fringing; + if ( impl->fringing > 0 ) + impl->fringing *= 0.5f; + impl->fringing += 1.0f; + + /* generate luma (y) filter using sinc kernel */ + { + /* sinc with rolloff (dsf) */ + /* double precision avoids instability */ + double const rolloff = 1 + setup->sharpness * 0.004; + double const maxh = 256; + double const pow_a_n = pow( rolloff, maxh ); + float sum; + int i; + /* quadratic mapping to reduce negative (blurring) range */ + double to_angle = setup->resolution + 1; + to_angle = PI / maxh * 0.20 * (to_angle * to_angle + 1); + + kernels [kernel_size * 3 / 2] = (float) maxh; + for ( i = 0; i < kernel_half * 2 + 1; i++ ) + { + int x = i - kernel_half; + double angle = x * to_angle; + /* instability occurs at center point with rolloff very close to 1.0 */ + if ( x || pow_a_n > 1.01 || pow_a_n < 0.99 ) + { + double rolloff_cos_a = rolloff * cos( angle ); + double num = 1 - rolloff_cos_a - + pow_a_n * cos( maxh * angle ) + + pow_a_n * rolloff * cos( (maxh - 1) * angle ); + double den = 1 - rolloff_cos_a - rolloff_cos_a + rolloff * rolloff; + double dsf = num / den; + kernels [kernel_size * 3 / 2 - kernel_half + i] = (float) dsf; + } + } + + /* apply blackman window and find sum */ + sum = 0; + for ( i = 0; i < kernel_half * 2 + 1; i++ ) + { + float x = PI * 2 / (kernel_half * 2) * i; + float blackman = 0.42f - 0.5f * (float) cos( x ) + 0.08f * (float) cos( x * 2 ); + sum += (kernels [kernel_size * 3 / 2 - kernel_half + i] *= blackman); + } + + /* normalize kernel */ + sum = 1.0f / sum; + for ( i = 0; i < kernel_half * 2 + 1; i++ ) + { + int x = kernel_size * 3 / 2 - kernel_half + i; + kernels [x] *= sum; + assert( kernels [x] == kernels [x] ); /* catch numerical instability */ + } + } + + /* generate chroma (iq) filter using gaussian kernel */ + { + float const cutoff_factor = -0.03125f; + float cutoff = (float) setup->bleed; + int i; + + if ( cutoff < 0 ) + { + /* keep extreme value accessible only near upper end of scale (1.0) */ + cutoff *= cutoff; + cutoff *= cutoff; + cutoff *= cutoff; + cutoff *= -30.0f / 0.65f; + } + cutoff = cutoff_factor - 0.65f * cutoff_factor * cutoff; + + for ( i = -kernel_half; i <= kernel_half; i++ ) + kernels [kernel_size / 2 + i] = (float) exp( i * i * cutoff ); + + /* normalize even and odd phases separately */ + for ( i = 0; i < 2; i++ ) + { + float sum = 0; + int x; + for ( x = i; x < kernel_size; x += 2 ) + sum += kernels [x]; + + sum = 1.0f / sum; + for ( x = i; x < kernel_size; x += 2 ) + { + kernels [x] *= sum; + assert( kernels [x] == kernels [x] ); /* catch numerical instability */ + } + } + } + + /* generate linear rescale kernels */ + { + int i; + for ( i = 0; i < rescale_out; i++ ) + { + float* out = &impl->kernel [i * kernel_size * 2]; + float second = 1.0f / rescale_in * (i + 1); + float first = 1.0f - second; + int x; + *out++ = kernels [0] * first; + for ( x = 1; x < kernel_size * 2; x++ ) + *out++ = kernels [x] * first + kernels [x - 1] * second; + } + } + + /* setup decoder matricies */ + { + static float const default_decoder [6] = + { 0.956f, 0.621f, -0.272f, -0.647f, -1.105f, 1.702f }; + float hue = (float) setup->hue * PI; + float sat = (float) setup->saturation + 1.0f; + float const* decoder = setup->decoder_matrix; + int i; + if ( !decoder ) + decoder = default_decoder; + else + hue += PI / 180 * 15; + + for ( i = 0; i < snes_ntsc_burst_count; i++ ) + { + float s = (float) sin( hue ) * sat; + float c = (float) cos( hue ) * sat; + float const* in = decoder; + float* out = impl->to_rgb [i]; + int n; + for ( n = 3; n; --n ) + { + float i = *in++; + float q = *in++; + *out++ = i * c - q * s; + *out++ = i * s + q * c; + } + hue -= PI / 180 * 120; + } + } +} + +/* kernel generation */ + +enum { rgb_kernel_size = snes_ntsc_burst_size / alignment_count }; + +static float const rgb_offset = rgb_unit * 2 + 0.5f; +static ntsc_rgb_t const ntsc_rgb_bias = rgb_unit * 2 * ntsc_rgb_builder; + +#define TO_RGB( y, i, q, to_rgb ) ( \ + ((int) (y + to_rgb [0] * i + to_rgb [1] * q) << 21) +\ + ((int) (y + to_rgb [2] * i + to_rgb [3] * q) << 11) +\ + ((int) (y + to_rgb [4] * i + to_rgb [5] * q) << 1)\ +) + +typedef struct pixel_info_t +{ + int offset; + float negate; + float kernel [4]; +} pixel_info_t; + +#define PIXEL_OFFSET_( ntsc, scaled ) \ + (kernel_size / 2 + ntsc + (scaled != 0) + (rescale_out - scaled) % rescale_out + \ + (kernel_size * 2 * scaled)) + +#define PIXEL_OFFSET( ntsc, scaled ) \ + PIXEL_OFFSET_( ((ntsc) - (scaled) / rescale_out * rescale_in),\ + (((scaled) + rescale_out * 10) % rescale_out) ),\ + (1.0f - (((ntsc) + 100) & 2)) + +/* Generate pixel at all burst phases and column alignments */ +static void gen_kernel( struct ntsc_impl_t* impl, float y, float i, float q, ntsc_rgb_t* out ) +{ + /* generate for each scanline burst phase */ + float const* to_rgb = impl->to_rgb [0]; + do + { + static pixel_info_t const pixels [alignment_count] = { + { PIXEL_OFFSET( -4, -9 ), { 1.0000f, 1.0000f, .6667f, .0000f } }, + { PIXEL_OFFSET( -2, -7 ), { .3333f, 1.0000f, 1.0000f, .3333f } }, + { PIXEL_OFFSET( 0, -5 ), { .0000f, .6667f, 1.0000f, 1.0000f } }, + }; + + /* Encode yiq into *two* composite signals (to allow control over artifacting). + Convolve these with kernels which: filter respective components, apply + sharpening, and rescale horizontally. Convert resulting yiq to rgb and pack + into integer. */ + pixel_info_t const* pixel = pixels; + do + { + /* negate is -1 when composite starts at odd multiple of 2 */ + float const yy = y * impl->fringing * pixel->negate; + float const ic0 = (i + yy) * pixel->kernel [0]; + float const qc1 = (q + yy) * pixel->kernel [1]; + float const ic2 = (i - yy) * pixel->kernel [2]; + float const qc3 = (q - yy) * pixel->kernel [3]; + + float const factor = impl->artifacts * pixel->negate; + float const ii = i * factor; + float const yc0 = (y + ii) * pixel->kernel [0]; + float const yc2 = (y - ii) * pixel->kernel [2]; + + float const qq = q * factor; + float const yc1 = (y + qq) * pixel->kernel [1]; + float const yc3 = (y - qq) * pixel->kernel [3]; + + float const* k = &impl->kernel [pixel->offset]; + int n; + for ( n = rgb_kernel_size; n; --n ) + { + float i = k[0]*ic0 + k[2]*ic2; + float q = k[1]*qc1 + k[3]*qc3; + float y = k[kernel_size+0]*yc0 + k[kernel_size+1]*yc1 + + k[kernel_size+2]*yc2 + k[kernel_size+3]*yc3 + rgb_offset; + if ( k >= &impl->kernel [kernel_size * 2 * (rescale_out - 1)] ) + k -= kernel_size * 2 * (rescale_out - 1) + 2; + else + k += kernel_size * 2 - 1; + *out++ = TO_RGB( y, i, q, to_rgb ) - ntsc_rgb_bias; + } + } + while ( pixel++ < &pixels [alignment_count - 1] ); + + to_rgb += 6; + + /* rotate -120 degrees */ + { + float const sin_b = -0.866025f; + float const cos_b = -0.5f; + float t; + t = i * cos_b - q * sin_b; + q = i * sin_b + q * cos_b; + i = t; + } + } + while ( to_rgb < impl->to_rgb [snes_ntsc_burst_count] ); +} + +static void merge_fields( ntsc_rgb_t* io ) +{ + int n; + for ( n = snes_ntsc_burst_size; n; --n ) + { + ntsc_rgb_t p0 = io [snes_ntsc_burst_size * 0] + ntsc_rgb_bias; + ntsc_rgb_t p1 = io [snes_ntsc_burst_size * 1] + ntsc_rgb_bias; + ntsc_rgb_t p2 = io [snes_ntsc_burst_size * 2] + ntsc_rgb_bias; + /* merge fields without losing precision */ + io [snes_ntsc_burst_size * 0] = + ((p0 + p1 - ((p0 ^ p1) & ntsc_rgb_builder)) >> 1) - ntsc_rgb_bias; + io [snes_ntsc_burst_size * 1] = + ((p1 + p2 - ((p1 ^ p2) & ntsc_rgb_builder)) >> 1) - ntsc_rgb_bias; + io [snes_ntsc_burst_size * 2] = + ((p2 + p0 - ((p2 ^ p0) & ntsc_rgb_builder)) >> 1) - ntsc_rgb_bias; + ++io; + } +} + +static void correct_errors( ntsc_rgb_t color, ntsc_rgb_t* out ) +{ + int burst; + for ( burst = 0; burst < snes_ntsc_burst_count; burst++ ) + { + int i; + for ( i = 0; i < rgb_kernel_size / 2; i++ ) + { + ntsc_rgb_t error = color - + out [i ] - + out [i + 3 +28] - + out [i + 5 +14] - + out [i + 7 ] - + out [(i+10)%14+28] - + out [(i+12)%14+14]; + + /* distribute error among four kernels */ + ntsc_rgb_t fourth = (error + 2 * ntsc_rgb_builder) >> 2; + fourth &= (ntsc_rgb_bias >> 1) - ntsc_rgb_builder; + fourth -= ntsc_rgb_bias >> 2; + if ( disable_correction ) { out [i] += ntsc_rgb_bias; continue; } + out [i + 3 +28] += fourth; + out [i + 5 +14] += fourth; + out [i + 7 ] += fourth; + out [i ] += error - (fourth * 3); + } + out += alignment_count * rgb_kernel_size; + } +} +/* end common code */ + +void snes_ntsc_init( snes_ntsc_t* ntsc, snes_ntsc_setup_t const* setup ) +{ + float to_float [32]; + int entry; + struct ntsc_impl_t impl; + if ( !setup ) + setup = &snes_ntsc_composite; + init_ntsc_impl( &impl, setup ); + + { + double gamma = 1 - setup->gamma * (setup->gamma > 0 ? 0.5f : 1.5f); + int i; + for ( i = 0; i < 32; i++ ) + to_float [i] = (float) pow( (1 / 31.0) * i, gamma ) * rgb_unit; + } + + for ( entry = 0; entry < snes_ntsc_color_count; entry++ ) + { + /* Reduce number of significant bits of source color. Clearing the + low bits of R and B were least notictable. Modifying green was too + noticeable. */ + int ir = entry >> 8 & 0x1E; + int ig = entry >> 4 & 0x1F; + int ib = entry << 1 & 0x1E; + + if ( setup->bsnes_colortbl ) + { + int bgr15 = (ib << 10) | (ig << 5) | ir; + unsigned long rgb16 = setup->bsnes_colortbl [bgr15]; + ir = rgb16 >> 11 & 0x1E; + ig = rgb16 >> 6 & 0x1F; + ib = rgb16 & 0x1E; + } + + { + float r = to_float [ir]; + float g = to_float [ig]; + float b = to_float [ib]; + + float y = r * 0.299f + g * 0.587f + b * 0.114f; + float i = r * 0.596f - g * 0.275f - b * 0.321f; + float q = r * 0.212f - g * 0.523f + b * 0.311f; + + float iq = i * q; + if ( impl.hue_warping && q && iq <= 0 ) + { + float factor = (iq * impl.hue_warping) / (i * i + q * q); + i -= i * factor; + q += q * factor; + } + + y = y * impl.contrast + impl.brightness; + + { + float yy = y + rgb_offset; + ntsc_rgb_t rgb = TO_RGB( yy, i, q, impl.to_rgb [0] ); + ntsc_rgb_t* out = ntsc->table [entry]; + + gen_kernel( &impl, y, i, q, out ); + + if ( setup->merge_fields ) + merge_fields( out ); + + correct_errors( rgb, out ); + } + } + } +} + +/* Disable 'restrict' keyword by default. If your compiler supports it, put + + #define restrict restrict + +somewhere in a config header, or the equivalent in the command-line: + + -Drestrict=restrict + +If your compiler supports a non-standard version, like __restrict, do this: + + #define restrict __restrict + +Enabling this if your compiler supports it will allow better optimization. */ +#ifndef restrict + #define restrict +#endif + +/* Default to 16-bit RGB input and output */ +#ifndef SNES_NTSC_IN_FORMAT + #define SNES_NTSC_IN_FORMAT SNES_NTSC_RGB16 +#endif + +#ifndef SNES_NTSC_OUT_DEPTH + #define SNES_NTSC_OUT_DEPTH 16 +#endif + +#include + +#if SNES_NTSC_OUT_DEPTH > 16 + #if UINT_MAX == 0xFFFFFFFF + typedef unsigned int snes_ntsc_out_t; + #elif ULONG_MAX == 0xFFFFFFFF + typedef unsigned long snes_ntsc_out_t; + #else + #error "Need 32-bit int type" + #endif +#else + #if USHRT_MAX == 0xFFFF + typedef unsigned short snes_ntsc_out_t; + #else + #error "Need 16-bit int type" + #endif +#endif + +/* useful if you have a linker which doesn't remove unused code from executable */ +#ifndef SNES_NTSC_NO_BLITTERS + +/* Use this as a starting point for writing your own blitter. To allow easy upgrades +to new versions of this library, put your blitter in a separate source file rather +than modifying this one directly. */ + +void snes_ntsc_blit( snes_ntsc_t const* ntsc, unsigned short const* snes_in, + long in_row_width, int burst_phase, int in_width, int in_height, + void* rgb_out, long out_pitch ) +{ + int chunk_count = (in_width - 1) / snes_ntsc_in_chunk; + for ( ; in_height; --in_height ) + { + /* begin row and read first input pixel */ + unsigned short const* line_in = snes_in; + SNES_NTSC_LORES_ROW( ntsc, burst_phase, + snes_ntsc_black, snes_ntsc_black, *line_in++ ); + snes_ntsc_out_t* restrict line_out = (snes_ntsc_out_t*) rgb_out; + int n; + + /* blit main chunks, each using 3 input pixels to generate 7 output pixels */ + for ( n = chunk_count; n; --n ) + { + /* order of input and output pixels must not be altered */ + SNES_NTSC_PIXEL_IN( 0, line_in [0] ); + SNES_NTSC_LORES_OUT( 0, line_out [0], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_LORES_OUT( 1, line_out [1], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 1, line_in [1] ); + SNES_NTSC_LORES_OUT( 2, line_out [2], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_LORES_OUT( 3, line_out [3], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 2, line_in [2] ); + SNES_NTSC_LORES_OUT( 4, line_out [4], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_LORES_OUT( 5, line_out [5], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_LORES_OUT( 6, line_out [6], SNES_NTSC_OUT_DEPTH ); + + line_in += 3; + line_out += 7; + } + + /* you can eliminate the need for the final chunk below by padding + input with three extra black pixels at the end of each row */ + + /* finish final pixels without starting any new ones */ + SNES_NTSC_PIXEL_IN( 0, snes_ntsc_black ); + SNES_NTSC_LORES_OUT( 0, line_out [0], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_LORES_OUT( 1, line_out [1], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 1, snes_ntsc_black ); + SNES_NTSC_LORES_OUT( 2, line_out [2], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_LORES_OUT( 3, line_out [3], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 2, snes_ntsc_black ); + SNES_NTSC_LORES_OUT( 4, line_out [4], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_LORES_OUT( 5, line_out [5], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_LORES_OUT( 6, line_out [6], SNES_NTSC_OUT_DEPTH ); + + /* advance burst phase and line pointers */ + burst_phase = (burst_phase + 1) % snes_ntsc_burst_count; + snes_in += in_row_width; + rgb_out = (char*) rgb_out + out_pitch; + } +} + +void snes_ntsc_blit_hires( snes_ntsc_t const* ntsc, unsigned short const* snes_in, + long in_row_width, int burst_phase, int in_width, int in_height, + void* rgb_out, long out_pitch ) +{ + int chunk_count = (in_width - 2) / (snes_ntsc_in_chunk * 2); + for ( ; in_height; --in_height ) + { + unsigned short const* line_in = snes_in; + SNES_NTSC_HIRES_ROW( ntsc, burst_phase, + snes_ntsc_black, snes_ntsc_black, snes_ntsc_black, line_in [0], line_in [1] ); + snes_ntsc_out_t* restrict line_out = (snes_ntsc_out_t*) rgb_out; + int n; + line_in += 2; + + for ( n = chunk_count; n; --n ) + { + SNES_NTSC_PIXEL_IN( 0, line_in [0] ); + SNES_NTSC_HIRES_OUT( 0, line_out [0], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 1, line_in [1] ); + SNES_NTSC_HIRES_OUT( 1, line_out [1], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 2, line_in [2] ); + SNES_NTSC_HIRES_OUT( 2, line_out [2], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 3, line_in [3] ); + SNES_NTSC_HIRES_OUT( 3, line_out [3], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 4, line_in [4] ); + SNES_NTSC_HIRES_OUT( 4, line_out [4], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 5, line_in [5] ); + SNES_NTSC_HIRES_OUT( 5, line_out [5], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_HIRES_OUT( 6, line_out [6], SNES_NTSC_OUT_DEPTH ); + + line_in += 6; + line_out += 7; + } + + SNES_NTSC_PIXEL_IN( 0, snes_ntsc_black ); + SNES_NTSC_HIRES_OUT( 0, line_out [0], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 1, snes_ntsc_black ); + SNES_NTSC_HIRES_OUT( 1, line_out [1], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 2, snes_ntsc_black ); + SNES_NTSC_HIRES_OUT( 2, line_out [2], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 3, snes_ntsc_black ); + SNES_NTSC_HIRES_OUT( 3, line_out [3], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 4, snes_ntsc_black ); + SNES_NTSC_HIRES_OUT( 4, line_out [4], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 5, snes_ntsc_black ); + SNES_NTSC_HIRES_OUT( 5, line_out [5], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_HIRES_OUT( 6, line_out [6], SNES_NTSC_OUT_DEPTH ); + + burst_phase = (burst_phase + 1) % snes_ntsc_burst_count; + snes_in += in_row_width; + rgb_out = (char*) rgb_out + out_pitch; + } +} + +#endif + diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/filter_ntsc_core.cpp~ snx/snes9x/ntsc/byuu/filter_ntsc_core.cpp~ --- snes9x-1.43-src/snes9x/ntsc/byuu/filter_ntsc_core.cpp~ 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/filter_ntsc_core.cpp~ 2007-02-04 01:50:50.000000000 +0200 @@ -0,0 +1,598 @@ +/* snes_ntsc 0.2.1. http://www.slack.net/~ant/ */ + +/* compilable in C or C++; just change the file extension */ + +//#include "snes_ntsc.h" + +#include +#include + +/* Based on algorithm by NewRisingSun */ +/* Copyright (C) 2006 Shay Green. This module is free software; you +can redistribute it and/or modify it under the terms of the GNU Lesser +General Public License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. This +module is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for +more details. You should have received a copy of the GNU Lesser General +Public License along with this module; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +enum { disable_correction = 0 }; /* for debugging */ + +/* macro constants are used instead of enum in some places to work around compiler bug */ + +/* half normal range to allow for doubled hires pixels */ +#define rgb_unit 0x80 + +/* begin mostly common NES/SNES/SMS code */ + +snes_ntsc_setup_t const snes_ntsc_monochrome = { 0,-1, 0, 0,.2, 0,.2,-.2,-.2,-1, 0, 1, 0, 0 }; +snes_ntsc_setup_t const snes_ntsc_composite = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }; +snes_ntsc_setup_t const snes_ntsc_svideo = { 0, 0, 0, 0,.2, 0,.2, -1, -1, 0, 0, 1, 0, 0 }; +snes_ntsc_setup_t const snes_ntsc_rgb = { 0, 0, 0, 0,.2, 0,.7, -1, -1,-1, 0, 1, 0, 0 }; + +enum { alignment_count = 3 }; /* different pixel alignments with respect to yiq quads */ + +enum { kernel_half = 16 }; +enum { kernel_size = kernel_half * 2 + 1 }; +#define rescale_in 8 +enum { rescale_out = 7 }; + +struct ntsc_impl_t +{ + float to_rgb [snes_ntsc_burst_count] [6]; + float brightness; + float contrast; + float artifacts; + float fringing; + float hue_warping; + float kernel [rescale_out * kernel_size * 2]; +}; + +#define PI 3.14159265358979323846f + +static void init_ntsc_impl( struct ntsc_impl_t* impl, snes_ntsc_setup_t const* setup ) +{ + float kernels [kernel_size * 2]; + + impl->brightness = (float) setup->brightness * (0.4f * rgb_unit); + impl->contrast = (float) setup->contrast * 0.4f + 1.0f; + impl->hue_warping = (float) setup->hue_warping; + + impl->artifacts = (float) setup->artifacts; + if ( impl->artifacts > 0 ) + impl->artifacts *= 0.5f; + impl->artifacts += 1.0f; + + impl->fringing = (float) setup->fringing; + if ( impl->fringing > 0 ) + impl->fringing *= 0.5f; + impl->fringing += 1.0f; + + /* generate luma (y) filter using sinc kernel */ + { + /* sinc with rolloff (dsf) */ + /* double precision avoids instability */ + double const rolloff = 1 + setup->sharpness * 0.004; + double const maxh = 256; + double const pow_a_n = pow( rolloff, maxh ); + float sum; + int i; + /* quadratic mapping to reduce negative (blurring) range */ + double to_angle = setup->resolution + 1; + to_angle = PI / maxh * 0.20 * (to_angle * to_angle + 1); + + kernels [kernel_size * 3 / 2] = (float) maxh; + for ( i = 0; i < kernel_half * 2 + 1; i++ ) + { + int x = i - kernel_half; + double angle = x * to_angle; + /* instability occurs at center point with rolloff very close to 1.0 */ + if ( x || pow_a_n > 1.01 || pow_a_n < 0.99 ) + { + double rolloff_cos_a = rolloff * cos( angle ); + double num = 1 - rolloff_cos_a - + pow_a_n * cos( maxh * angle ) + + pow_a_n * rolloff * cos( (maxh - 1) * angle ); + double den = 1 - rolloff_cos_a - rolloff_cos_a + rolloff * rolloff; + double dsf = num / den; + kernels [kernel_size * 3 / 2 - kernel_half + i] = (float) dsf; + } + } + + /* apply blackman window and find sum */ + sum = 0; + for ( i = 0; i < kernel_half * 2 + 1; i++ ) + { + float x = PI * 2 / (kernel_half * 2) * i; + float blackman = 0.42f - 0.5f * (float) cos( x ) + 0.08f * (float) cos( x * 2 ); + sum += (kernels [kernel_size * 3 / 2 - kernel_half + i] *= blackman); + } + + /* normalize kernel */ + sum = 1.0f / sum; + for ( i = 0; i < kernel_half * 2 + 1; i++ ) + { + int x = kernel_size * 3 / 2 - kernel_half + i; + kernels [x] *= sum; + assert( kernels [x] == kernels [x] ); /* catch numerical instability */ + } + } + + /* generate chroma (iq) filter using gaussian kernel */ + { + float const cutoff_factor = -0.03125f; + float cutoff = (float) setup->bleed; + int i; + + if ( cutoff < 0 ) + { + /* keep extreme value accessible only near upper end of scale (1.0) */ + cutoff *= cutoff; + cutoff *= cutoff; + cutoff *= cutoff; + cutoff *= -30.0f / 0.65f; + } + cutoff = cutoff_factor - 0.65f * cutoff_factor * cutoff; + + for ( i = -kernel_half; i <= kernel_half; i++ ) + kernels [kernel_size / 2 + i] = (float) exp( i * i * cutoff ); + + /* normalize even and odd phases separately */ + for ( i = 0; i < 2; i++ ) + { + float sum = 0; + int x; + for ( x = i; x < kernel_size; x += 2 ) + sum += kernels [x]; + + sum = 1.0f / sum; + for ( x = i; x < kernel_size; x += 2 ) + { + kernels [x] *= sum; + assert( kernels [x] == kernels [x] ); /* catch numerical instability */ + } + } + } + + /* generate linear rescale kernels */ + { + int i; + for ( i = 0; i < rescale_out; i++ ) + { + float* out = &impl->kernel [i * kernel_size * 2]; + float second = 1.0f / rescale_in * (i + 1); + float first = 1.0f - second; + int x; + *out++ = kernels [0] * first; + for ( x = 1; x < kernel_size * 2; x++ ) + *out++ = kernels [x] * first + kernels [x - 1] * second; + } + } + + /* setup decoder matricies */ + { + static float const default_decoder [6] = + { 0.956f, 0.621f, -0.272f, -0.647f, -1.105f, 1.702f }; + float hue = (float) setup->hue * PI; + float sat = (float) setup->saturation + 1.0f; + float const* decoder = setup->decoder_matrix; + int i; + if ( !decoder ) + decoder = default_decoder; + else + hue += PI / 180 * 15; + + for ( i = 0; i < snes_ntsc_burst_count; i++ ) + { + float s = (float) sin( hue ) * sat; + float c = (float) cos( hue ) * sat; + float const* in = decoder; + float* out = impl->to_rgb [i]; + int n; + for ( n = 3; n; --n ) + { + float i = *in++; + float q = *in++; + *out++ = i * c - q * s; + *out++ = i * s + q * c; + } + hue -= PI / 180 * 120; + } + } +} + +/* kernel generation */ + +enum { rgb_kernel_size = snes_ntsc_burst_size / alignment_count }; + +static float const rgb_offset = rgb_unit * 2 + 0.5f; +static ntsc_rgb_t const ntsc_rgb_bias = rgb_unit * 2 * ntsc_rgb_builder; + +#define TO_RGB( y, i, q, to_rgb ) ( \ + ((int) (y + to_rgb [0] * i + to_rgb [1] * q) << 21) +\ + ((int) (y + to_rgb [2] * i + to_rgb [3] * q) << 11) +\ + ((int) (y + to_rgb [4] * i + to_rgb [5] * q) << 1)\ +) + +typedef struct pixel_info_t +{ + int offset; + float negate; + float kernel [4]; +} pixel_info_t; + +#define PIXEL_OFFSET_( ntsc, scaled ) \ + (kernel_size / 2 + ntsc + (scaled != 0) + (rescale_out - scaled) % rescale_out + \ + (kernel_size * 2 * scaled)) + +#define PIXEL_OFFSET( ntsc, scaled ) \ + PIXEL_OFFSET_( ((ntsc) - (scaled) / rescale_out * rescale_in),\ + (((scaled) + rescale_out * 10) % rescale_out) ),\ + (1.0f - (((ntsc) + 100) & 2)) + +/* Generate pixel at all burst phases and column alignments */ +static void gen_kernel( struct ntsc_impl_t* impl, float y, float i, float q, ntsc_rgb_t* out ) +{ + /* generate for each scanline burst phase */ + float const* to_rgb = impl->to_rgb [0]; + do + { + static pixel_info_t const pixels [alignment_count] = { + { PIXEL_OFFSET( -4, -9 ), { 1.0000f, 1.0000f, .6667f, .0000f } }, + { PIXEL_OFFSET( -2, -7 ), { .3333f, 1.0000f, 1.0000f, .3333f } }, + { PIXEL_OFFSET( 0, -5 ), { .0000f, .6667f, 1.0000f, 1.0000f } }, + }; + + /* Encode yiq into *two* composite signals (to allow control over artifacting). + Convolve these with kernels which: filter respective components, apply + sharpening, and rescale horizontally. Convert resulting yiq to rgb and pack + into integer. */ + pixel_info_t const* pixel = pixels; + do + { + /* negate is -1 when composite starts at odd multiple of 2 */ + float const yy = y * impl->fringing * pixel->negate; + float const ic0 = (i + yy) * pixel->kernel [0]; + float const qc1 = (q + yy) * pixel->kernel [1]; + float const ic2 = (i - yy) * pixel->kernel [2]; + float const qc3 = (q - yy) * pixel->kernel [3]; + + float const factor = impl->artifacts * pixel->negate; + float const ii = i * factor; + float const yc0 = (y + ii) * pixel->kernel [0]; + float const yc2 = (y - ii) * pixel->kernel [2]; + + float const qq = q * factor; + float const yc1 = (y + qq) * pixel->kernel [1]; + float const yc3 = (y - qq) * pixel->kernel [3]; + + float const* k = &impl->kernel [pixel->offset]; + int n; + for ( n = rgb_kernel_size; n; --n ) + { + float i = k[0]*ic0 + k[2]*ic2; + float q = k[1]*qc1 + k[3]*qc3; + float y = k[kernel_size+0]*yc0 + k[kernel_size+1]*yc1 + + k[kernel_size+2]*yc2 + k[kernel_size+3]*yc3 + rgb_offset; + if ( k >= &impl->kernel [kernel_size * 2 * (rescale_out - 1)] ) + k -= kernel_size * 2 * (rescale_out - 1) + 2; + else + k += kernel_size * 2 - 1; + *out++ = TO_RGB( y, i, q, to_rgb ) - ntsc_rgb_bias; + } + } + while ( pixel++ < &pixels [alignment_count - 1] ); + + to_rgb += 6; + + /* rotate -120 degrees */ + { + float const sin_b = -0.866025f; + float const cos_b = -0.5f; + float t; + t = i * cos_b - q * sin_b; + q = i * sin_b + q * cos_b; + i = t; + } + } + while ( to_rgb < impl->to_rgb [snes_ntsc_burst_count] ); +} + +static void merge_fields( ntsc_rgb_t* io ) +{ + int n; + for ( n = snes_ntsc_burst_size; n; --n ) + { + ntsc_rgb_t p0 = io [snes_ntsc_burst_size * 0] + ntsc_rgb_bias; + ntsc_rgb_t p1 = io [snes_ntsc_burst_size * 1] + ntsc_rgb_bias; + ntsc_rgb_t p2 = io [snes_ntsc_burst_size * 2] + ntsc_rgb_bias; + /* merge fields without losing precision */ + io [snes_ntsc_burst_size * 0] = + ((p0 + p1 - ((p0 ^ p1) & ntsc_rgb_builder)) >> 1) - ntsc_rgb_bias; + io [snes_ntsc_burst_size * 1] = + ((p1 + p2 - ((p1 ^ p2) & ntsc_rgb_builder)) >> 1) - ntsc_rgb_bias; + io [snes_ntsc_burst_size * 2] = + ((p2 + p0 - ((p2 ^ p0) & ntsc_rgb_builder)) >> 1) - ntsc_rgb_bias; + ++io; + } +} + +static void correct_errors( ntsc_rgb_t color, ntsc_rgb_t* out ) +{ + int burst; + for ( burst = 0; burst < snes_ntsc_burst_count; burst++ ) + { + int i; + for ( i = 0; i < rgb_kernel_size / 2; i++ ) + { + ntsc_rgb_t error = color - + out [i ] - + out [i + 3 +28] - + out [i + 5 +14] - + out [i + 7 ] - + out [(i+10)%14+28] - + out [(i+12)%14+14]; + + /* distribute error among four kernels */ + ntsc_rgb_t fourth = (error + 2 * ntsc_rgb_builder) >> 2; + fourth &= (ntsc_rgb_bias >> 1) - ntsc_rgb_builder; + fourth -= ntsc_rgb_bias >> 2; + if ( disable_correction ) { out [i] += ntsc_rgb_bias; continue; } + out [i + 3 +28] += fourth; + out [i + 5 +14] += fourth; + out [i + 7 ] += fourth; + out [i ] += error - (fourth * 3); + } + out += alignment_count * rgb_kernel_size; + } +} +/* end common code */ + +void snes_ntsc_init( snes_ntsc_t* ntsc, snes_ntsc_setup_t const* setup ) +{ + float to_float [32]; + int entry; + struct ntsc_impl_t impl; + if ( !setup ) + setup = &snes_ntsc_composite; + init_ntsc_impl( &impl, setup ); + + { + double gamma = 1 - setup->gamma * (setup->gamma > 0 ? 0.5f : 1.5f); + int i; + for ( i = 0; i < 32; i++ ) + to_float [i] = (float) pow( (1 / 31.0) * i, gamma ) * rgb_unit; + } + + for ( entry = 0; entry < snes_ntsc_color_count; entry++ ) + { + /* Reduce number of significant bits of source color. Clearing the + low bits of R and B were least notictable. Modifying green was too + noticeable. */ + int ir = entry >> 8 & 0x1E; + int ig = entry >> 4 & 0x1F; + int ib = entry << 1 & 0x1E; + + if ( setup->bsnes_colortbl ) + { + int bgr15 = (ib << 10) | (ig << 5) | ir; + unsigned long rgb16 = setup->bsnes_colortbl [bgr15]; + ir = rgb16 >> 11 & 0x1E; + ig = rgb16 >> 6 & 0x1F; + ib = rgb16 & 0x1E; + } + + { + float r = to_float [ir]; + float g = to_float [ig]; + float b = to_float [ib]; + + float y = r * 0.299f + g * 0.587f + b * 0.114f; + float i = r * 0.596f - g * 0.275f - b * 0.321f; + float q = r * 0.212f - g * 0.523f + b * 0.311f; + + float iq = i * q; + if ( impl.hue_warping && q && iq <= 0 ) + { + float factor = (iq * impl.hue_warping) / (i * i + q * q); + i -= i * factor; + q += q * factor; + } + + y = y * impl.contrast + impl.brightness; + + { + float yy = y + rgb_offset; + ntsc_rgb_t rgb = TO_RGB( yy, i, q, impl.to_rgb [0] ); + ntsc_rgb_t* out = ntsc->table [entry]; + + gen_kernel( &impl, y, i, q, out ); + + if ( setup->merge_fields ) + merge_fields( out ); + + correct_errors( rgb, out ); + } + } + } +} + +/* Disable 'restrict' keyword by default. If your compiler supports it, put + + #define restrict restrict + +somewhere in a config header, or the equivalent in the command-line: + + -Drestrict=restrict + +If your compiler supports a non-standard version, like __restrict, do this: + + #define restrict __restrict + +Enabling this if your compiler supports it will allow better optimization. */ +#ifndef restrict + #define restrict +#endif + +/* Default to 16-bit RGB input and output */ +#ifndef SNES_NTSC_IN_FORMAT + #define SNES_NTSC_IN_FORMAT SNES_NTSC_RGB16 +#endif + +#ifndef SNES_NTSC_OUT_DEPTH + #define SNES_NTSC_OUT_DEPTH 16 +#endif + +#include + +#if SNES_NTSC_OUT_DEPTH > 16 + #if UINT_MAX == 0xFFFFFFFF + typedef unsigned int snes_ntsc_out_t; + #elif ULONG_MAX == 0xFFFFFFFF + typedef unsigned long snes_ntsc_out_t; + #else + #error "Need 32-bit int type" + #endif +#else + #if USHRT_MAX == 0xFFFF + typedef unsigned short snes_ntsc_out_t; + #else + #error "Need 16-bit int type" + #endif +#endif + +/* useful if you have a linker which doesn't remove unused code from executable */ +#ifndef SNES_NTSC_NO_BLITTERS + +/* Use this as a starting point for writing your own blitter. To allow easy upgrades +to new versions of this library, put your blitter in a separate source file rather +than modifying this one directly. */ + +void snes_ntsc_blit( snes_ntsc_t const* ntsc, unsigned short const* snes_in, + long in_row_width, int burst_phase, int in_width, int in_height, + void* rgb_out, long out_pitch ) +{ + int chunk_count = (in_width - 1) / snes_ntsc_in_chunk; + for ( ; in_height; --in_height ) + { + /* begin row and read first input pixel */ + unsigned short const* line_in = snes_in; + SNES_NTSC_LORES_ROW( ntsc, burst_phase, + snes_ntsc_black, snes_ntsc_black, *line_in++ ); + snes_ntsc_out_t* restrict line_out = (snes_ntsc_out_t*) rgb_out; + int n; + + /* blit main chunks, each using 3 input pixels to generate 7 output pixels */ + for ( n = chunk_count; n; --n ) + { + /* order of input and output pixels must not be altered */ + SNES_NTSC_PIXEL_IN( 0, line_in [0] ); + SNES_NTSC_LORES_OUT( 0, line_out [0], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_LORES_OUT( 1, line_out [1], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 1, line_in [1] ); + SNES_NTSC_LORES_OUT( 2, line_out [2], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_LORES_OUT( 3, line_out [3], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 2, line_in [2] ); + SNES_NTSC_LORES_OUT( 4, line_out [4], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_LORES_OUT( 5, line_out [5], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_LORES_OUT( 6, line_out [6], SNES_NTSC_OUT_DEPTH ); + + line_in += 3; + line_out += 7; + } + + /* you can eliminate the need for the final chunk below by padding + input with three extra black pixels at the end of each row */ + + /* finish final pixels without starting any new ones */ + SNES_NTSC_PIXEL_IN( 0, snes_ntsc_black ); + SNES_NTSC_LORES_OUT( 0, line_out [0], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_LORES_OUT( 1, line_out [1], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 1, snes_ntsc_black ); + SNES_NTSC_LORES_OUT( 2, line_out [2], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_LORES_OUT( 3, line_out [3], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 2, snes_ntsc_black ); + SNES_NTSC_LORES_OUT( 4, line_out [4], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_LORES_OUT( 5, line_out [5], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_LORES_OUT( 6, line_out [6], SNES_NTSC_OUT_DEPTH ); + + /* advance burst phase and line pointers */ + burst_phase = (burst_phase + 1) % snes_ntsc_burst_count; + snes_in += in_row_width; + rgb_out = (char*) rgb_out + out_pitch; + } +} + +void snes_ntsc_blit_hires( snes_ntsc_t const* ntsc, unsigned short const* snes_in, + long in_row_width, int burst_phase, int in_width, int in_height, + void* rgb_out, long out_pitch ) +{ + int chunk_count = (in_width - 2) / (snes_ntsc_in_chunk * 2); + for ( ; in_height; --in_height ) + { + unsigned short const* line_in = snes_in; + SNES_NTSC_HIRES_ROW( ntsc, burst_phase, + snes_ntsc_black, snes_ntsc_black, snes_ntsc_black, line_in [0], line_in [1] ); + snes_ntsc_out_t* restrict line_out = (snes_ntsc_out_t*) rgb_out; + int n; + line_in += 2; + + for ( n = chunk_count; n; --n ) + { + SNES_NTSC_PIXEL_IN( 0, line_in [0] ); + SNES_NTSC_HIRES_OUT( 0, line_out [0], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 1, line_in [1] ); + SNES_NTSC_HIRES_OUT( 1, line_out [1], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 2, line_in [2] ); + SNES_NTSC_HIRES_OUT( 2, line_out [2], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 3, line_in [3] ); + SNES_NTSC_HIRES_OUT( 3, line_out [3], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 4, line_in [4] ); + SNES_NTSC_HIRES_OUT( 4, line_out [4], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 5, line_in [5] ); + SNES_NTSC_HIRES_OUT( 5, line_out [5], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_HIRES_OUT( 6, line_out [6], SNES_NTSC_OUT_DEPTH ); + + line_in += 6; + line_out += 7; + } + + SNES_NTSC_PIXEL_IN( 0, snes_ntsc_black ); + SNES_NTSC_HIRES_OUT( 0, line_out [0], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 1, snes_ntsc_black ); + SNES_NTSC_HIRES_OUT( 1, line_out [1], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 2, snes_ntsc_black ); + SNES_NTSC_HIRES_OUT( 2, line_out [2], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 3, snes_ntsc_black ); + SNES_NTSC_HIRES_OUT( 3, line_out [3], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 4, snes_ntsc_black ); + SNES_NTSC_HIRES_OUT( 4, line_out [4], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_PIXEL_IN( 5, snes_ntsc_black ); + SNES_NTSC_HIRES_OUT( 5, line_out [5], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_HIRES_OUT( 6, line_out [6], SNES_NTSC_OUT_DEPTH ); + + burst_phase = (burst_phase + 1) % snes_ntsc_burst_count; + snes_in += in_row_width; + rgb_out = (char*) rgb_out + out_pitch; + } +} + +#endif + diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/filter_ntsc_core.h snx/snes9x/ntsc/byuu/filter_ntsc_core.h --- snes9x-1.43-src/snes9x/ntsc/byuu/filter_ntsc_core.h 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/filter_ntsc_core.h 2007-02-04 01:57:42.000000000 +0200 @@ -0,0 +1,195 @@ +/* SNES NTSC composite video to RGB emulator/blitter */ + +/* snes_ntsc 0.2.1 */ + +#ifndef SNES_NTSC_H +#define SNES_NTSC_H + +/* Image parameters, ranging from -1.0 to 1.0 */ +typedef struct snes_ntsc_setup_t +{ + /* Basic parameters */ + double hue; /* -1 = -180 degrees, +1 = +180 degrees */ + double saturation; /* -1 = grayscale, +1 = oversaturated colors */ + double contrast; + double brightness; + double sharpness; /* edge contrast enhancement/blurring */ + + /* Advanced parameters */ + double gamma; + double resolution; /* image resolution */ + double artifacts; /* artifacts caused by color changes */ + double fringing; /* color artifacts caused by brightness changes */ + double bleed; /* color bleed (color resolution reduction) */ + double hue_warping;/* -1 = expand purple & green, +1 = expand orange & cyan */ + int merge_fields; /* if 1, merges even and odd fields together to reduce flicker */ + float const* decoder_matrix; /* optional RGB decoder matrix, 6 elements */ + + unsigned long const* bsnes_colortbl; /* temporary feature for bsnes only; set to 0 */ +} snes_ntsc_setup_t; + +/* Video format presets */ +extern snes_ntsc_setup_t const snes_ntsc_composite; /* color bleeding + artifacts */ +extern snes_ntsc_setup_t const snes_ntsc_svideo; /* color bleeding only */ +extern snes_ntsc_setup_t const snes_ntsc_rgb; /* crisp image */ +extern snes_ntsc_setup_t const snes_ntsc_monochrome;/* desaturated + artifacts */ + +/* Initialize and adjust parameters. Can be called multiple times on the same +snes_ntsc_t object. Caller must allocate memory for snes_ntsc_t. Can pass 0 +for either parameter. */ +typedef struct snes_ntsc_t snes_ntsc_t; +void snes_ntsc_init( snes_ntsc_t*, snes_ntsc_setup_t const* setup ); + +/* Blit one or more rows of pixels. Input pixel format is set by SNES_NTSC_IN_FORMAT +and output RGB depth is set by NES_NTSC_OUT_DEPTH. Both default to 16-bit RGB. +In_row_width is the number of pixels to get to the next input row. Out_pitch +is the number of *bytes* to get to the next output row. */ +void snes_ntsc_blit( snes_ntsc_t const*, unsigned short const* snes_in, + long in_row_width, int burst_phase, int in_width, int in_height, + void* rgb_out, long out_pitch ); + +void snes_ntsc_blit_hires( snes_ntsc_t const*, unsigned short const* snes_in, + long in_row_width, int burst_phase, int in_width, int in_height, + void* rgb_out, long out_pitch ); + +/* Number of output pixels written by low-res blitter for given input width. Width +might be rounded down slightly; use SNES_NTSC_IN_WIDTH() on result to find rounded +value. Guaranteed not to round 256 down at all. */ +#define SNES_NTSC_OUT_WIDTH( in_width ) \ + (((in_width) - 1) / snes_ntsc_in_chunk * snes_ntsc_out_chunk + snes_ntsc_out_chunk) + +/* Number of low-res input pixels that will fit within given output width. Might be +rounded down slightly; use SNES_NTSC_OUT_WIDTH() on result to find rounded +value. */ +#define SNES_NTSC_IN_WIDTH( out_width ) \ + ((out_width) / snes_ntsc_out_chunk * snes_ntsc_in_chunk - snes_ntsc_in_chunk + 1) + + +/* Interface for user-defined custom blitters */ + +enum { snes_ntsc_in_chunk = 3 }; /* number of snes pixels read per chunk */ +enum { snes_ntsc_out_chunk = 7 }; /* number of output pixels generated per chunk */ +enum { snes_ntsc_black = 0 }; /* palette index for black */ +enum { snes_ntsc_burst_count = 3 }; /* burst phase cycles through 0, 1, and 2 */ + +/* Begin outputting row and start three pixels. First pixel will be cut off a bit. +Use snes_ntsc_black for unused pixels. Declares variables, so must be before first +statement in a block (unless you're using C++). */ +#define SNES_NTSC_LORES_ROW( ntsc, burst, pixel0, pixel1, pixel2 ) \ + char const* ktable = (char*) (ntsc)->table + burst * (snes_ntsc_burst_size * sizeof (ntsc_rgb_t));\ + int const snes_pixel0_ = (pixel0);\ + ntsc_rgb_t const* kernel0 = SNES_NTSC_IN_FORMAT( snes_pixel0_ );\ + int const snes_pixel1_ = (pixel1);\ + ntsc_rgb_t const* kernel1 = SNES_NTSC_IN_FORMAT( snes_pixel1_ );\ + int const snes_pixel2_ = (pixel2);\ + ntsc_rgb_t const* kernel2 = SNES_NTSC_IN_FORMAT( snes_pixel2_ );\ + ntsc_rgb_t const* kernelx0;\ + ntsc_rgb_t const* kernelx1 = kernel0;\ + ntsc_rgb_t const* kernelx2 = kernel0 + +/* Begin input pixel */ +#define SNES_NTSC_PIXEL_IN( in_index, color_in ) {\ + unsigned n;\ + kernelx##in_index = kernel##in_index;\ + kernel##in_index = (n = (color_in), SNES_NTSC_IN_FORMAT( n ));\ +} + +/* Generate output pixel. Bits can be 24, 16, 15, or 32 (treated as 24): +24: RRRRRRRR GGGGGGGG BBBBBBBB +16: RRRRRGGG GGGBBBBB +15: RRRRRGG GGGBBBBB + 0: xxxRRRRR RRRxxGGG GGGGGxxB BBBBBBBx (raw format; x = junk bits) */ +#define SNES_NTSC_LORES_OUT( x, rgb_out, bits ) {\ + ntsc_rgb_t raw =\ + kernel0 [x ] + kernel1 [(x+12)%7+14] + kernel2 [(x+10)%7+28] +\ + kernelx0 [(x+7)%14] + kernelx1 [(x+ 5)%7+21] + kernelx2 [(x+ 3)%7+35];\ + SNES_NTSC_CLAMP_( raw, 1 );\ + SNES_NTSC_OUT_( rgb_out, (bits), raw, 1 );\ +} + +/* Hires equivalents */ +#define SNES_NTSC_HIRES_ROW( ntsc, burst, pixel1, pixel2, pixel3, pixel4, pixel5 ) \ + char const* ktable = (char*) (ntsc)->table + burst * (snes_ntsc_burst_size * sizeof (ntsc_rgb_t));\ + int const snes_pixel1_ = (pixel1);\ + ntsc_rgb_t const* kernel1 = SNES_NTSC_IN_FORMAT( snes_pixel1_ );\ + int const snes_pixel2_ = (pixel2);\ + ntsc_rgb_t const* kernel2 = SNES_NTSC_IN_FORMAT( snes_pixel2_ );\ + int const snes_pixel3_ = (pixel3);\ + ntsc_rgb_t const* kernel3 = SNES_NTSC_IN_FORMAT( snes_pixel3_ );\ + int const snes_pixel4_ = (pixel4);\ + ntsc_rgb_t const* kernel4 = SNES_NTSC_IN_FORMAT( snes_pixel4_ );\ + int const snes_pixel5_ = (pixel5);\ + ntsc_rgb_t const* kernel5 = SNES_NTSC_IN_FORMAT( snes_pixel5_ );\ + ntsc_rgb_t const* kernel0 = kernel1;\ + ntsc_rgb_t const* kernelx0;\ + ntsc_rgb_t const* kernelx1 = kernel1;\ + ntsc_rgb_t const* kernelx2 = kernel1;\ + ntsc_rgb_t const* kernelx3 = kernel1;\ + ntsc_rgb_t const* kernelx4 = kernel1;\ + ntsc_rgb_t const* kernelx5 = kernel1 + +#define SNES_NTSC_HIRES_OUT( x, rgb_out, bits ) {\ + ntsc_rgb_t raw =\ + kernel0 [ x ] + kernel2 [(x+5)%7+14] + kernel4 [(x+3)%7+28] +\ + kernelx0 [(x+7)%7+7] + kernelx2 [(x+5)%7+21] + kernelx4 [(x+3)%7+35] +\ + kernel1 [(x+6)%7 ] + kernel3 [(x+4)%7+14] + kernel5 [(x+2)%7+28] +\ + kernelx1 [(x+6)%7+7] + kernelx3 [(x+4)%7+21] + kernelx5 [(x+2)%7+35];\ + SNES_NTSC_CLAMP_( raw, 0 );\ + SNES_NTSC_OUT_( rgb_out, (bits), raw, 0 );\ +} + + +/* private */ + +enum { snes_ntsc_entry_size = 128 }; +enum { snes_ntsc_color_count = 0x2000 }; +typedef unsigned long ntsc_rgb_t; +struct snes_ntsc_t +{ + ntsc_rgb_t table [snes_ntsc_color_count] [snes_ntsc_entry_size]; +}; +enum { snes_ntsc_burst_size = snes_ntsc_entry_size / snes_ntsc_burst_count }; + +enum { ntsc_rgb_builder = (1L << 21) | (1 << 11) | (1 << 1) }; +enum { snes_ntsc_clamp_mask = ntsc_rgb_builder * 3 / 2 }; +enum { snes_ntsc_clamp_add = ntsc_rgb_builder * 0x101 }; + +#include "../pixform.h" + +#define SNES_NTSC_RGB16( n ) \ + (ntsc_rgb_t*) (ktable + ((n & 0x001E) | (n >> 1 & 0x03E0) | (n >> 2 & 0x3C00)) * \ + (snes_ntsc_entry_size / 2 * sizeof (ntsc_rgb_t))) + +#define SNES_NTSC_BGR15( n ) \ + (ntsc_rgb_t*) (ktable + ((n << 9 & 0x3C00) | (n & 0x03E0) | (n >> 10 & 0x001E)) * \ + (snes_ntsc_entry_size / 2 * sizeof (ntsc_rgb_t))) + +#define SNES_NTSC_CLAMP_( io, shift ) {\ + ntsc_rgb_t sub = io >> (9-shift) & snes_ntsc_clamp_mask;\ + ntsc_rgb_t clamp = snes_ntsc_clamp_add - sub;\ + io |= clamp;\ + clamp -= sub;\ + io &= clamp;\ +} + +#define SNES_NTSC_OUT_( rgb_out, bits, raw, x ) {\ + rgb_out = BUILD_PIXEL( \ + (((raw>>(5-x))&0xFF0000)*(MAX_RED+1)/0x100), \ + (((raw>>(3-x))&0xFF00)*(MAX_GREEN+1)/0x100), \ + (((raw>>(1-x))&0xFF)*(MAX_BLUE+1)/0x100) \ + ); } /* + + if ( bits == 16 )\ + rgb_out = (raw>>(13-x)& 0xF800)|(raw>>(8-x)&0x07E0)|(raw>>(4-x)&0x001F);\ + if ( bits == 24 || bits == 32 )\ + rgb_out = (raw>>(5-x)&0xFF0000)|(raw>>(3-x)&0xFF00)|(raw>>(1-x)&0xFF);\ + if ( bits == 15 )\ + rgb_out = (raw>>(14-x)& 0x7C00)|(raw>>(9-x)&0x03E0)|(raw>>(4-x)&0x001F);\ + if ( bits == 14 )\ + rgb_out = (raw>>(24-x)& 0x001F)|(raw>>(9-x)&0x03E0)|(raw<<(6+x)&0x7C00);\ + if ( bits == 0 )\ + rgb_out = raw << x;\ +} */ + +#endif + diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/filter_ntsc_core.h~ snx/snes9x/ntsc/byuu/filter_ntsc_core.h~ --- snes9x-1.43-src/snes9x/ntsc/byuu/filter_ntsc_core.h~ 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/filter_ntsc_core.h~ 2007-02-04 01:51:23.000000000 +0200 @@ -0,0 +1,187 @@ +/* SNES NTSC composite video to RGB emulator/blitter */ + +/* snes_ntsc 0.2.1 */ + +#ifndef SNES_NTSC_H +#define SNES_NTSC_H + +/* Image parameters, ranging from -1.0 to 1.0 */ +typedef struct snes_ntsc_setup_t +{ + /* Basic parameters */ + double hue; /* -1 = -180 degrees, +1 = +180 degrees */ + double saturation; /* -1 = grayscale, +1 = oversaturated colors */ + double contrast; + double brightness; + double sharpness; /* edge contrast enhancement/blurring */ + + /* Advanced parameters */ + double gamma; + double resolution; /* image resolution */ + double artifacts; /* artifacts caused by color changes */ + double fringing; /* color artifacts caused by brightness changes */ + double bleed; /* color bleed (color resolution reduction) */ + double hue_warping;/* -1 = expand purple & green, +1 = expand orange & cyan */ + int merge_fields; /* if 1, merges even and odd fields together to reduce flicker */ + float const* decoder_matrix; /* optional RGB decoder matrix, 6 elements */ + + unsigned long const* bsnes_colortbl; /* temporary feature for bsnes only; set to 0 */ +} snes_ntsc_setup_t; + +/* Video format presets */ +extern snes_ntsc_setup_t const snes_ntsc_composite; /* color bleeding + artifacts */ +extern snes_ntsc_setup_t const snes_ntsc_svideo; /* color bleeding only */ +extern snes_ntsc_setup_t const snes_ntsc_rgb; /* crisp image */ +extern snes_ntsc_setup_t const snes_ntsc_monochrome;/* desaturated + artifacts */ + +/* Initialize and adjust parameters. Can be called multiple times on the same +snes_ntsc_t object. Caller must allocate memory for snes_ntsc_t. Can pass 0 +for either parameter. */ +typedef struct snes_ntsc_t snes_ntsc_t; +void snes_ntsc_init( snes_ntsc_t*, snes_ntsc_setup_t const* setup ); + +/* Blit one or more rows of pixels. Input pixel format is set by SNES_NTSC_IN_FORMAT +and output RGB depth is set by NES_NTSC_OUT_DEPTH. Both default to 16-bit RGB. +In_row_width is the number of pixels to get to the next input row. Out_pitch +is the number of *bytes* to get to the next output row. */ +void snes_ntsc_blit( snes_ntsc_t const*, unsigned short const* snes_in, + long in_row_width, int burst_phase, int in_width, int in_height, + void* rgb_out, long out_pitch ); + +void snes_ntsc_blit_hires( snes_ntsc_t const*, unsigned short const* snes_in, + long in_row_width, int burst_phase, int in_width, int in_height, + void* rgb_out, long out_pitch ); + +/* Number of output pixels written by low-res blitter for given input width. Width +might be rounded down slightly; use SNES_NTSC_IN_WIDTH() on result to find rounded +value. Guaranteed not to round 256 down at all. */ +#define SNES_NTSC_OUT_WIDTH( in_width ) \ + (((in_width) - 1) / snes_ntsc_in_chunk * snes_ntsc_out_chunk + snes_ntsc_out_chunk) + +/* Number of low-res input pixels that will fit within given output width. Might be +rounded down slightly; use SNES_NTSC_OUT_WIDTH() on result to find rounded +value. */ +#define SNES_NTSC_IN_WIDTH( out_width ) \ + ((out_width) / snes_ntsc_out_chunk * snes_ntsc_in_chunk - snes_ntsc_in_chunk + 1) + + +/* Interface for user-defined custom blitters */ + +enum { snes_ntsc_in_chunk = 3 }; /* number of snes pixels read per chunk */ +enum { snes_ntsc_out_chunk = 7 }; /* number of output pixels generated per chunk */ +enum { snes_ntsc_black = 0 }; /* palette index for black */ +enum { snes_ntsc_burst_count = 3 }; /* burst phase cycles through 0, 1, and 2 */ + +/* Begin outputting row and start three pixels. First pixel will be cut off a bit. +Use snes_ntsc_black for unused pixels. Declares variables, so must be before first +statement in a block (unless you're using C++). */ +#define SNES_NTSC_LORES_ROW( ntsc, burst, pixel0, pixel1, pixel2 ) \ + char const* ktable = (char*) (ntsc)->table + burst * (snes_ntsc_burst_size * sizeof (ntsc_rgb_t));\ + int const snes_pixel0_ = (pixel0);\ + ntsc_rgb_t const* kernel0 = SNES_NTSC_IN_FORMAT( snes_pixel0_ );\ + int const snes_pixel1_ = (pixel1);\ + ntsc_rgb_t const* kernel1 = SNES_NTSC_IN_FORMAT( snes_pixel1_ );\ + int const snes_pixel2_ = (pixel2);\ + ntsc_rgb_t const* kernel2 = SNES_NTSC_IN_FORMAT( snes_pixel2_ );\ + ntsc_rgb_t const* kernelx0;\ + ntsc_rgb_t const* kernelx1 = kernel0;\ + ntsc_rgb_t const* kernelx2 = kernel0 + +/* Begin input pixel */ +#define SNES_NTSC_PIXEL_IN( in_index, color_in ) {\ + unsigned n;\ + kernelx##in_index = kernel##in_index;\ + kernel##in_index = (n = (color_in), SNES_NTSC_IN_FORMAT( n ));\ +} + +/* Generate output pixel. Bits can be 24, 16, 15, or 32 (treated as 24): +24: RRRRRRRR GGGGGGGG BBBBBBBB +16: RRRRRGGG GGGBBBBB +15: RRRRRGG GGGBBBBB + 0: xxxRRRRR RRRxxGGG GGGGGxxB BBBBBBBx (raw format; x = junk bits) */ +#define SNES_NTSC_LORES_OUT( x, rgb_out, bits ) {\ + ntsc_rgb_t raw =\ + kernel0 [x ] + kernel1 [(x+12)%7+14] + kernel2 [(x+10)%7+28] +\ + kernelx0 [(x+7)%14] + kernelx1 [(x+ 5)%7+21] + kernelx2 [(x+ 3)%7+35];\ + SNES_NTSC_CLAMP_( raw, 1 );\ + SNES_NTSC_OUT_( rgb_out, (bits), raw, 1 );\ +} + +/* Hires equivalents */ +#define SNES_NTSC_HIRES_ROW( ntsc, burst, pixel1, pixel2, pixel3, pixel4, pixel5 ) \ + char const* ktable = (char*) (ntsc)->table + burst * (snes_ntsc_burst_size * sizeof (ntsc_rgb_t));\ + int const snes_pixel1_ = (pixel1);\ + ntsc_rgb_t const* kernel1 = SNES_NTSC_IN_FORMAT( snes_pixel1_ );\ + int const snes_pixel2_ = (pixel2);\ + ntsc_rgb_t const* kernel2 = SNES_NTSC_IN_FORMAT( snes_pixel2_ );\ + int const snes_pixel3_ = (pixel3);\ + ntsc_rgb_t const* kernel3 = SNES_NTSC_IN_FORMAT( snes_pixel3_ );\ + int const snes_pixel4_ = (pixel4);\ + ntsc_rgb_t const* kernel4 = SNES_NTSC_IN_FORMAT( snes_pixel4_ );\ + int const snes_pixel5_ = (pixel5);\ + ntsc_rgb_t const* kernel5 = SNES_NTSC_IN_FORMAT( snes_pixel5_ );\ + ntsc_rgb_t const* kernel0 = kernel1;\ + ntsc_rgb_t const* kernelx0;\ + ntsc_rgb_t const* kernelx1 = kernel1;\ + ntsc_rgb_t const* kernelx2 = kernel1;\ + ntsc_rgb_t const* kernelx3 = kernel1;\ + ntsc_rgb_t const* kernelx4 = kernel1;\ + ntsc_rgb_t const* kernelx5 = kernel1 + +#define SNES_NTSC_HIRES_OUT( x, rgb_out, bits ) {\ + ntsc_rgb_t raw =\ + kernel0 [ x ] + kernel2 [(x+5)%7+14] + kernel4 [(x+3)%7+28] +\ + kernelx0 [(x+7)%7+7] + kernelx2 [(x+5)%7+21] + kernelx4 [(x+3)%7+35] +\ + kernel1 [(x+6)%7 ] + kernel3 [(x+4)%7+14] + kernel5 [(x+2)%7+28] +\ + kernelx1 [(x+6)%7+7] + kernelx3 [(x+4)%7+21] + kernelx5 [(x+2)%7+35];\ + SNES_NTSC_CLAMP_( raw, 0 );\ + SNES_NTSC_OUT_( rgb_out, (bits), raw, 0 );\ +} + + +/* private */ + +enum { snes_ntsc_entry_size = 128 }; +enum { snes_ntsc_color_count = 0x2000 }; +typedef unsigned long ntsc_rgb_t; +struct snes_ntsc_t +{ + ntsc_rgb_t table [snes_ntsc_color_count] [snes_ntsc_entry_size]; +}; +enum { snes_ntsc_burst_size = snes_ntsc_entry_size / snes_ntsc_burst_count }; + +enum { ntsc_rgb_builder = (1L << 21) | (1 << 11) | (1 << 1) }; +enum { snes_ntsc_clamp_mask = ntsc_rgb_builder * 3 / 2 }; +enum { snes_ntsc_clamp_add = ntsc_rgb_builder * 0x101 }; + +#define SNES_NTSC_RGB16( n ) \ + (ntsc_rgb_t*) (ktable + ((n & 0x001E) | (n >> 1 & 0x03E0) | (n >> 2 & 0x3C00)) * \ + (snes_ntsc_entry_size / 2 * sizeof (ntsc_rgb_t))) + +#define SNES_NTSC_BGR15( n ) \ + (ntsc_rgb_t*) (ktable + ((n << 9 & 0x3C00) | (n & 0x03E0) | (n >> 10 & 0x001E)) * \ + (snes_ntsc_entry_size / 2 * sizeof (ntsc_rgb_t))) + +#define SNES_NTSC_CLAMP_( io, shift ) {\ + ntsc_rgb_t sub = io >> (9-shift) & snes_ntsc_clamp_mask;\ + ntsc_rgb_t clamp = snes_ntsc_clamp_add - sub;\ + io |= clamp;\ + clamp -= sub;\ + io &= clamp;\ +} + +#define SNES_NTSC_OUT_( rgb_out, bits, raw, x ) {\ + if ( bits == 16 )\ + rgb_out = (raw>>(13-x)& 0xF800)|(raw>>(8-x)&0x07E0)|(raw>>(4-x)&0x001F);\ + if ( bits == 24 || bits == 32 )\ + rgb_out = (raw>>(5-x)&0xFF0000)|(raw>>(3-x)&0xFF00)|(raw>>(1-x)&0xFF);\ + if ( bits == 15 )\ + rgb_out = (raw>>(14-x)& 0x7C00)|(raw>>(9-x)&0x03E0)|(raw>>(4-x)&0x001F);\ + if ( bits == 14 )\ + rgb_out = (raw>>(24-x)& 0x001F)|(raw>>(9-x)&0x03E0)|(raw<<(6+x)&0x7C00);\ + if ( bits == 0 )\ + rgb_out = raw << x;\ +} + +#endif + diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/filter_ntsc.cpp snx/snes9x/ntsc/byuu/filter_ntsc.cpp --- snes9x-1.43-src/snes9x/ntsc/byuu/filter_ntsc.cpp 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/filter_ntsc.cpp 2007-02-04 01:25:03.000000000 +0200 @@ -0,0 +1,87 @@ +#include +#include "filter.h" + +#define SNES_NTSC_IN_FORMAT SNES_NTSC_BGR15 +#include "filter_ntsc_core.cpp" + +NtscVideoFilter::NtscVideoFilter() { + ntsc = 0; + +//to do: defer initialization? + adjust(0, 0, 0, 0, 0, true, 0); +} + +NtscVideoFilter::~NtscVideoFilter() { + if(ntsc) {free(ntsc);ntsc=0; } +} + +void NtscVideoFilter::adjust(float hue, float saturation, float contrast, +float brightness, float sharpness, bool merge_fields, uint32 *colortbl) { +static snes_ntsc_setup_t defaults; +snes_ntsc_setup_t setup = defaults; + setup.hue = hue; + setup.saturation = saturation; + setup.contrast = contrast; + setup.brightness = brightness; + setup.sharpness = sharpness; + setup.resolution = sharpness; + setup.merge_fields = merge_fields; + setup.bsnes_colortbl = (unsigned long const*)colortbl; + + if(!ntsc) { + ntsc = (snes_ntsc_t*)malloc(sizeof *ntsc); + if(!ntsc) { + return; //to do: report out of memory error + } + } + + burst = 0; + burst_toggle = (merge_fields ? 0 : 1); // don't toggle burst when fields are merged + snes_ntsc_init(ntsc, &setup); +} + +void NtscVideoFilter::run( +uint32 *colortbl, uint16 *data, uint32 width, uint32 height, uint32 pitch, +uint16 *output, uint32 max_width, uint32 max_height, uint32 output_pitch, +uint32 req_width, uint32 req_height, uint &result_width, uint &result_height, +uint16 *scanline_widths) +{ + if(!ntsc)return; + +int const out_width = SNES_NTSC_OUT_WIDTH(256); +int const out_height = height; + result_width = out_width; + result_height = out_height; + burst ^= burst_toggle; + + if(!scanline_widths) { + if(width == 256) { + snes_ntsc_blit(ntsc, data, (pitch >> 1), burst, out_width, out_height, output, output_pitch); + } else { + snes_ntsc_blit_hires(ntsc, data, (pitch >> 1), burst, out_width, out_height, output, output_pitch); + } + } else { + //blit multiple scanlines of same width, rather than one at a time + int run_start = 0; + int run_width = scanline_widths[0]; + int line = 0; + + while(1) { + if(run_width != scanline_widths[line] || line >= out_height) { + uint16 const *in = (uint16*)((uint8*)data + pitch * run_start); + uint16 *out = (uint16*)((uint8*)output + output_pitch * run_start); + int height = line - run_start; + int line_burst = (burst + run_start) % 3; + if(run_width == 256) { + snes_ntsc_blit(ntsc, in, (pitch >> 1), line_burst, out_width, height, out, output_pitch); + } else { + snes_ntsc_blit_hires(ntsc, in, (pitch >> 1), line_burst, out_width, height, out, output_pitch); + } + if(line >= out_height)break; + run_width = scanline_widths[line]; + run_start = line; + } + line++; + } + } +} diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/filter_ntsc.cpp~ snx/snes9x/ntsc/byuu/filter_ntsc.cpp~ --- snes9x-1.43-src/snes9x/ntsc/byuu/filter_ntsc.cpp~ 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/filter_ntsc.cpp~ 2007-02-04 01:24:32.000000000 +0200 @@ -0,0 +1,86 @@ +#include "filter.h" + +#define SNES_NTSC_IN_FORMAT SNES_NTSC_BGR15 +#include "filter_ntsc_core.cpp" + +NtscVideoFilter::NtscVideoFilter() { + ntsc = 0; + +//to do: defer initialization? + adjust(0, 0, 0, 0, 0, true, 0); +} + +NtscVideoFilter::~NtscVideoFilter() { + if(ntsc) {free(ntsc);ntsc=0; } +} + +void NtscVideoFilter::adjust(float hue, float saturation, float contrast, +float brightness, float sharpness, bool merge_fields, uint32 *colortbl) { +static snes_ntsc_setup_t defaults; +snes_ntsc_setup_t setup = defaults; + setup.hue = hue; + setup.saturation = saturation; + setup.contrast = contrast; + setup.brightness = brightness; + setup.sharpness = sharpness; + setup.resolution = sharpness; + setup.merge_fields = merge_fields; + setup.bsnes_colortbl = colortbl; + + if(!ntsc) { + ntsc = (snes_ntsc_t*)malloc(sizeof *ntsc); + if(!ntsc) { + return; //to do: report out of memory error + } + } + + burst = 0; + burst_toggle = (merge_fields ? 0 : 1); // don't toggle burst when fields are merged + snes_ntsc_init(ntsc, &setup); +} + +void NtscVideoFilter::run( +uint32 *colortbl, uint16 *data, uint32 width, uint32 height, uint32 pitch, +uint16 *output, uint32 max_width, uint32 max_height, uint32 output_pitch, +uint32 req_width, uint32 req_height, uint &result_width, uint &result_height, +uint16 *scanline_widths) +{ + if(!ntsc)return; + +int const out_width = SNES_NTSC_OUT_WIDTH(256); +int const out_height = height; + result_width = out_width; + result_height = out_height; + burst ^= burst_toggle; + + if(!scanline_widths) { + if(width == 256) { + snes_ntsc_blit(ntsc, data, (pitch >> 1), burst, out_width, out_height, output, output_pitch); + } else { + snes_ntsc_blit_hires(ntsc, data, (pitch >> 1), burst, out_width, out_height, output, output_pitch); + } + } else { + //blit multiple scanlines of same width, rather than one at a time + int run_start = 0; + int run_width = scanline_widths[0]; + int line = 0; + + while(1) { + if(run_width != scanline_widths[line] || line >= out_height) { + uint16 const *in = (uint16*)((uint8*)data + pitch * run_start); + uint16 *out = (uint16*)((uint8*)output + output_pitch * run_start); + int height = line - run_start; + int line_burst = (burst + run_start) % 3; + if(run_width == 256) { + snes_ntsc_blit(ntsc, in, (pitch >> 1), line_burst, out_width, height, out, output_pitch); + } else { + snes_ntsc_blit_hires(ntsc, in, (pitch >> 1), line_burst, out_width, height, out, output_pitch); + } + if(line >= out_height)break; + run_width = scanline_widths[line]; + run_start = line; + } + line++; + } + } +} diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/filter_ntsc.h snx/snes9x/ntsc/byuu/filter_ntsc.h --- snes9x-1.43-src/snes9x/ntsc/byuu/filter_ntsc.h 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/filter_ntsc.h 2007-02-04 01:29:28.000000000 +0200 @@ -0,0 +1,24 @@ +#include "filter_ntsc_core.h" + +class NtscVideoFilter : public VideoFilter { +private: +struct snes_ntsc_t *ntsc; +int burst, burst_toggle; + +public: +// - Use 0 for any parameter to use default value +// - Colortbl must map to 16-bit RGB + void adjust(float hue, float saturation, float contrast, float brightness, + float sharpness, bool merge_fields, uint32 *colortbl); + +// - Output is currently always 16-bit RGB +// - Scanline_widths [i] contains the number of source pixels for scanline i, +// where 0 < i < height + void run(uint32 *colortbl, uint16 *data, uint32 width, uint32 height, uint32 pitch, + uint16 *output, uint32 max_width, uint32 max_height, uint32 output_pitch, + uint32 req_width, uint32 req_height, uint &result_width, uint &result_height, + uint16 *scanline_widths = 0); + + NtscVideoFilter(); + ~NtscVideoFilter(); +}; diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/filter_ntsc.h~ snx/snes9x/ntsc/byuu/filter_ntsc.h~ --- snes9x-1.43-src/snes9x/ntsc/byuu/filter_ntsc.h~ 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/filter_ntsc.h~ 2007-02-04 01:29:28.000000000 +0200 @@ -0,0 +1,24 @@ +#include "filter_ntsc_core.h" + +class NtscVideoFilter : public VideoFilter { +private: +struct snes_ntsc_t *ntsc; +int burst, burst_toggle; + +public: +// - Use 0 for any parameter to use default value +// - Colortbl must map to 16-bit RGB + void adjust(float hue, float saturation, float contrast, float brightness, + float sharpness, bool merge_fields, uint32 *colortbl); + +// - Output is currently always 16-bit RGB +// - Scanline_widths [i] contains the number of source pixels for scanline i, +// where 0 < i < height + void run(uint32 *colortbl, uint16 *data, uint32 width, uint32 height, uint32 pitch, + uint16 *output, uint32 max_width, uint32 max_height, uint32 output_pitch, + uint32 req_width, uint32 req_height, uint &result_width, uint &result_height, + uint16 *scanline_widths = 0); + + NtscVideoFilter(); + ~NtscVideoFilter(); +}; diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/filter_ntsc.o snx/snes9x/ntsc/byuu/filter_ntsc.o --- snes9x-1.43-src/snes9x/ntsc/byuu/filter_ntsc.o 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/filter_ntsc.o 2007-02-04 01:51:04.000000000 +0200 @@ -0,0 +1,248 @@ +ELFXy4(+(UWVSƒìD‹D$XÙD$\ØHT‰D$$¨ŒÙ\$Ù@PƒÀHÙ|$B‰$Ù\$·D$Bf f‰D$@‹T$$¿@ÙÙ\$ ÙBÙ\$ÙBÙ\$ÙB Ù\$ÙBÙ\$ÙBÙ\$ ÙG¾ÙD$ØÉ‹‹T$X‹\$hÙGÙD$`L‚\ØÂØÉÙ\$(ÙG ÙD$dØÃØÉÙ\$,ÙGÙD$`ØäØÉÙ\$0ÙGÙÌØl$dØÌÙ\$4ÙÌØL$ÙD$`ØÉÙD$\ØÁÞÌÙËÙ\$8ÙD$\ÞãÙÊÞÌÙD$dÞÊÙD$\ØÂÞÉÙD$\ÞâÙÉÞÊë{é8ÙD$ ØËØÁÙD$ØËÞÁÙl$@Û\$<Ùl$BÙD$ØË‹T$<ÁâØÁÙD$ØËÞÁÙl$@Û\$<Ùl$BÙÊØL$‹D$<Áà ÞÂÂØL$ ÞÁÙl$@Û\$<Ùl$B‹D$<„Bþ÷߉ƒÃNt`ÙD$(9éØ ÙD$0ØIÞÁÙD$,ØIÙD$4ØI ÞÁÙD$8؉„ÙÃ؉ˆÞÁÙÅ؉ŒÞÁÙÄ؉ÞÁ؃0ÿÿÿÁé+ÿÿÿÝØÝØÝ؃ǃD$h8ÿˆ‚uþÿÿƒD$$‹$9D$$s9ÙD$`Ø ÙD$dØ Ù ØL$`ÙØL$dÞÁÙ\$dÞÁÙ\$`éüýÿÿƒÄD[^_]Ãt&UWVS»VUUUƒì(‹L$L‹t$PI‰È÷ë‰ÈÁø)Â…ö‰T$„x‹D$DÀ‰$t&¼'‹L$H‹T$<‹t$T‰‹L$@‰D$‹\$·‰Ð‰ÑÁà áà%< È‹L$Áú +ƒâ ÐÁà؅ɉD$„‹t$‹T$@‹L$‹D$‹\$T‰÷‰õ‰T$‰L$ ‰t$$‰D$ë‹T$‹t$‹|$ ‰T$ ‹L$·Q‰Ð‰ÑÁà áà%<Áê + È‹OLƒâ ЋT$ÁàЉD$‹D$‹P|‹EhÊ‹L$‹F‹L$$˜¸ +( ‰ÑÁéá 0)È Â)È!‰щÐÁé Áèá|%à Á‹D$Áêƒâ Ñ‹€‹GPf‰ ‹L$‹El‹i‹L$$‹F è‹©œè‹l$¸ +( ‰ÑÁéá 0)È Â)È!‰щÐÁé Áèá|%à Á‹D$Áêƒâ Ñf‰K·P‰Ð‰ÑÁà áà%<Áê + È‹L$ƒâ ÐÁàè‹‘„‰D$ ‹D$‹H‹GTÊ‹L$ ‹F$‹i8‹L$$è‹© è¸ +( ‰ÑÁéá 0)È Â)È!‰щÐÁé Áèá|%àÁê Áƒâ Ñf‰K‹D$‹L$‹ˆ‹A ‹L$ ‹GX‹i<‹L$$‹F(è‹©¤è‹l$¸ +( ‰ÑÁéá 0)È Â)È!‰щÐÁé Áèá|%à Á‹D$Áêƒâ Ñf‰K·P‰Ð‰ÑÁà áà%<Áê + ȃâ ЋW\Áàè‹Hp‰D$Ê‹L$ ‹A@‹L$‹i‹N,èÈ‹L$ ‹©Œè¸ +( ‰ÑÁéá 0)È Â)È!‰щÐÁé Áèá|%à Á‹D$Áêƒâ Ñ‹W`f‰K‹HtÊ‹L$ ‹AD‹L$‹i‹N0èÈ‹L$ ‹©è¸ +( ‰ÑÁéá 0)È Â)È!‰щÐÁé Áèá|%àÁê Áƒâ Ñf‰K +‹D$‹WdƒD$‹HxÊ‹L$ ‹AH‹L$‹i‹L$ è‹n4‹±”è‰ýð¸ +( ‰ÑÁéá 0)È Â)È!‰щÐÁé Áèá|%àÁê Á‹D$ ƒâ Ñf‰K ƒÃÿL$‰D$$…düÿÿ‹T$‰û‹D$‹t$T‹|$ ÒÁà)ÐÆ‹L$‹D$ ‹Q|‹HL‹ChÊ‹L$‹A‹L$‹)‹˜è‹klȸ +( ‰ÑÁéá 0)È Â)È!‰щÐÁé Áèá|%àÁê Á‹D$ƒâ Ñf‰‹L$ ‹€‹AP‹L$‹A ê‹L$‹Y‹œØȸ +( ‰ÑÁéá 0)È Â)È!‰щÐÁé Áèá|%àÁê Á‹D$ƒâ Ñf‰N‹L$‹„‹A‹L$‹D$ ‹hT‹A$‹L$ê‹Y8‹ Øȸ +( ‰ÑÁéá 0)È Â)È!‰щÐÁé Áèá|%àÁê Áƒâ Ñf‰N‹D$‹L$‹ˆ‹A ‹L$‹D$ ‹hX‹A(‹L$ê‹Y<‹¤Øȸ +( ‰ÑÁéá 0)È Â)È!‰щÐÁé Áèá|%àÁê Á‹D$ ƒâ Ñf‰N‹L$‹P\‹Ap‹i‹A@‹L$è‹y,‹L$ø‹™ŒØ¸ +( ‰ÑÁéá 0)È Â)È!‰щÐÁé Áèá|%àÁê Á‹D$ ƒâ Ñf‰N‹L$‹P`‹At‹i‹AD‹L$è‹y0‹L$ø‹™Ø¸ +( ‰ÑÁéá 0)È Â)È!‰щÐÁé Áèá|%àÁê Áƒâ Ñf‰N +‹L$‹D$ ‹i‹Pd‹Ax‹AH‹L$è‹y4‹L$ø‹™”ظ +( ‰ÑÁéá 0)È Â)È!‰щÐÁé Áèá|%àÁê Áƒâ ÑÿL$Pf‰N t2‹\$HºVUUUC‰Ø‰Ù÷êÁù)Ê‹L$XR)Ó‹$T$@L$T‰\$HéœøÿÿƒÄ([^_]ËD$‰Ã‰Ç‰D$‰D$ é¶üÿÿ´&¼'UWVS»«ªª*ƒì\‹Œ$€ƒé‰È÷ë‰È‹Œ$„Áø)…ɉT$„© ‹D$xÀ‰D$‰ö‹L$|‹t$p‹|$‰Æ‹´$ˆ‰D$ ‹D$t‹l$ ‰t$4·‰Ð‰ÑÁà áà%<Áú + È‹L$tƒâ ЋT$ ÁàзQ‰D$‰Ð‰ÑÁà áà%<Áú + ȃâ ÐÁàè…ÿ‰D$„ ‹L$ ‹T$t‹t$‹D$‹œ$ˆ‰Í‰Ï‰T$<‰L$D‰L$T‰t$X‰L$$‰L$(‰L$H‰L$L‰L$P‰D$8ë$‹T$@‹L$‹D$‹l$‹|$ ‰T$D‰L$T‰D$X‰t$‹L$<‹t$ ·Q‰Ð‰ÑÁà áà%<Áê + ȃâ ÐÁàð‹t$‰D$ ‹D$T‹V|‹HL‹t$DÊ‹L$(‹Ah‹F‹D$‹Hx‹GÊ‹L$H‹qdò‹t$ ‹È‹L$L‹±˜ð‹uHð‹t$$‹N4È‹L$P‹±”ð‹t$<¸ +( ‰ÑÁé á 0)È Â)È!‰щÐÁéÁè á|%àÁê Áƒâ Ñf‰ ·V‹t$(‰Ð‰ÑÁà áà%<Áê + È‹L$Tƒâ ЋT$ ÁàЉD$@‹D$‹€‹AP‹Fl‹t$H‹D$@‹Ê‹L$‹A|‹L$ ‹Fh‹q‹G ð‹t$L‹ŽœÈ‹MLÈ‹L$D‹qð‹t$P‹Ž˜È¸ +( ‰ÑÁé á 0)È Â)È!‰щÐÁéÁè á|%àÁê Áƒâ Ñf‰K‹D$<‹t$ ·P‰Ð‰ÑÁà áà%<Áê + È‹L$ƒâ ЋT$ ÁàЋ‘„‰D$‹F‹t$‹D$T‹HTÊ‹L$@‹A‹†€‹D$H‹Hl‹G$Ê‹L$‹q8ð‹t$L‹Ž È‹MPÈ‹L$D‹q ð‹t$P‹Žœ‹t$ ȸ +( ‰ÑÁé á 0)È Â)È!‰щÐÁéÁè á|%à Á‹D$<Áêƒâ Ñf‰K·P +‰Ð‰ÑÁà áà%<Áê + È‹L$ƒâ ЋT$ ÁàЋ‘ˆ‰D$‹F ‹t$‹D$T‹HXÊ‹L$@‹A‹L$‹†„‹q<‹ET‹G(ð‹t$L‹Ž¤È‹L$‹q8ð‹t$D‹N$È‹L$P‹± ð¸ +( ‰ÑÁé á 0)È Â)È!‰щÐÁéÁè á|%à ÁÁêƒâ Ñf‰K‹t$<·V ‹t$@‰Ð‰ÑÁà áà%<Áê + ȃâ ЋT$ ÁàЉD$‹D$T‹L$‹P\‹Ap‹F ‹uX‹D$‹ˆˆÊ‹L$ò‹t$ ‹A@‹NÈ‹O,È‹L$X‹±Œð‹t$‹N<È‹L$D‹q(ð‹t$P‹Ž¤‹t$ ȸ +( ‰ÑÁé á 0)È Â)È!‰щÐÁéÁè á|%à Á‹D$<Áêƒâ Ñf‰K·P‰Ð‰ÑÁà áà%<Áê + È‹L$Tƒâ ÐÁàÆ‹D$‹Q`‹HtÊ‹L$@‹A‹Np‹E\Ê‹L$‹AD‹L$ A‹O0È‹L$X‹L$A@‹L$DA,‹L$Œ¸ +( ‰ÑÁé á 0)È Â)È!‰щÐÁéá|Áè %àÁê Áƒâ Ñf‰K +‹D$T‹L$ƒD$< ‹Pd‹Ax‰l$H‹D$@‹H‹E`Ê‹NtÊ‹L$‹AH‹L$ A‹O4È‹L$X‹¹”‹L$ø‹yD‹L$Dø‹y0‹L$ø‹¹ø¸ +( ‰ÑÁé á 0)È Â)È!‰щÐÁéÁè á|%à Á‹D$Áêƒâ Ñ‹T$Xf‰K ‹L$TƒÃ‰D$P‹D$D‰T$L‰L$(‰D$$ÿL$8…úÿÿ‹T$‹D$‹¼$ˆ‹L$DÒÁà)ЋT$Xø‹|$T‰D$4‹D$‰t$‰T$,‰D$0‹T$ ‹t$‹D$‹‹V|‹pL‹Ghò‹t$@‹F‹D$‹px‹Edò‹t$ ‰ØF‹t$,†˜‹t$FH‹q4‹L$0ð‹±”ð‹t$4¸ +( ‰ÑÁé á 0)È Â)È!‰щÐÁéÁè á|%àÁê Á‹D$ ƒâ Ñ‹T$f‰‹t$‹H‹‚€‹VP‹wl‹}hÐðËD$‹P|‰ÈÓ‹T$ û‹r ‹T$ð‹t$,‹¾œ‹rL‹T$0øð‹t$@‹~‹²˜øð‹t$4ø +( ‰ÚÁê â 0)Ð Ã)Ð!ÉډØÁêÁè â|%àÁë ƒã Úf‰V‹D$ ‹T$‹X‹º„‹T$‹p8‰Øø‹zTøÁ‹D$‹€‹ElÑ‹T$ Á‰ð‹z$‹T$,ø‹ª ‹T$è‹zP‹T$@ø‹j ‹T$0苺œøÁ¸ +( ‰ÊÁê â 0)Ð Á)Ð!Á‰Ê‰ÈÁêÁè â|%àÁé ‹D$ ƒá Ê‹L$4‹x $ >  I&I : ; I : ; : ; I8 + + : ; I8 +  : ; I !I/!I/  : ; : ;I : ; I8 +2  : ; I8 +2 .? 4 < I4 I.? : ; ‡@< .? : ; ‡@L M +< .? : ; < .? : ; L <  I8 +4  II.: ; @ : ; I +!: ; I +": ; I#4: ; I +$ U%4: ; I& U'4: ;I +(4: ;I +)4: ;I* +4: ;I,4: ;I-.? : ;‡@@.: ;I +/4: ;I0 1.G@2I4 3: ; I44: ; I54: ; I6.G 7I4 8.1@ +91 +:.1@;1<1X Y =1>4: ; I?4: ; I +@4I4  +A.: ; B: ;IC D: ;IE1X YF41G1X YH41I.G: ; J9: ; K4: ; I? < L4: ; I<  +M4: ; I< N4G +O4G +P4G`™á˜intb˜FK«$]bœ²M“Hjç™Û–K¶š€Yd + hue €# +B €# +ü€# +k€# +-€# +%€#( +J€#0 +0€#8 +€#@ +t€#H +‡€#P +Ý$#X +:‡#\ +À™#`ì’4ŸpY¯(º Ø@” +Ç•ã#R’p úØ 9ÿ9Ö qª”, +ó-q# +k.’#H +ü/’#L +00’#P +1’#T +‡2’#X +•3‡#\ ‡’99 ˜’ 9ÍÏmÝ +ÅÞ$# +Žß’# +•àÏ# ß’9má˜ÍK%%%#]ï#ù$#ˆ$# Tõûôÿõ’’’’’ õrun/Úöõ ¤¤¤¤¤¤¤¤ õ½öõ$ïŸ %â*#UŸ6mŸ6<Órun%6 ¤¤¤¤¤¤¤¤+%6$ºööT¤™Ž*$0%B%ÇíK Ïí‘!yí’‘!ií’‘!qí’‘ "outíQ#óð‡‘L$%¬ý p& 'yy['ic0‘P'qc1‘T'ic2‘X'qc3‘\(\'ii['yc0 ‘`'yc2 +b'qq ['yc1 a'yc3`'k‡Q)n$ƒ$¾@'i’^'q’_'y’]*î +C+à%+Á&,t'’#kó¿@Øß-ª žÜrP +–.]ܪ ‘.DÜ@‘.^Ü+‘. Ü$‘ .kÜ$‘.:Ü$‘.ËÜŒ‘.?Ü+‘($Þ$‘H&`+7â@(oãW‘L+8ãR/ ãµ æ+¥ãR/(ãµ /ãR//0ãµ X+Iãµ /Rãµ x/vãµ ¬/fåÀ Ö'næ$‘X$”ˆ)nì +$® )rawíØ*Üw)subíØ0/ˆíØC$öÈ)rawîØV$ ø)nði*< ãû)subîØ|/ˆîØ$V ()rawñØ¢*„ }•)subñØÀ/ˆñØÓ$ž H)rawòØæ$¶ h)nô*ä î)subòØ/ˆòØ*$þ ˜)rawõØ=*, +™)subõØP/ˆõØc$F +È)rawöØv*t +ë)subö؉/ˆöØœ$Ž +è)raw÷د*¼ +\t)sub÷ØØ/ˆ÷Øë$Ö +)rawØþ$ð +0)rawØ* ø)subØ//ˆØB*L ay)subØU/ˆØh$f X)rawØ{*” Òê)subØ™/ˆØ¬$Ø p)rawØ¿0C[)subØÒ/ˆØå$ò ˆ)raw +Øø* ­Å)sub +Ø/ˆ +Ø)$: ¨)raw Ø<*h  / )sub ØZ/ˆ Øm&À)raw Ø€0 ™ )sub Øž/ˆ ر° ¯» Øê-U +,Ä.]ª ‘.D@‘.^+‘. $‘ .k$‘.:$‘.ËŒ‘.?+‘($$‘˜&Ø+7@(oW‘œ+¥R/(µ +R/0µ 5+¸R/µ V/¾Rv/‰µ ‰/ÔRª/‘µ Ó/ µ þ+Iµ /Rµ )/vµ T/µ /[µ ©/dµ Ê/fÀ ê'n $‘H$Á)n% $Û)raw&Ø$ó8)n(/*!ò + )sub&ØB/ˆ&ØU$;`)raw)Øh*iÃ Û )sub)؆/ˆ)Ø™$€)n+¬$›¨)raw,Ø¿$µà)raw/ØÒ*ã¡ ¹ )sub,Øå/ˆ,Øø$û)n. *)w)sub/Ø /ˆ/Ø1 $A0)n1D $[H)raw2ØW $sp)n4j *¡Rj)sub2Ø} /ˆ2Ø $»˜)raw5Ø£ *é()sub5ØÁ /ˆ5ØÔ $°)raw6Øç *1¶Î)sub6Ø +/ˆ6Ø +$uà)raw=Ø+ +0¹Ñ)sub=ØI +/ˆ=Ø\ +$)raw@Øo +*½]u)sub@Ø‚ +/ˆ@Ø• +$ )rawCب +0)subCØ» +/ˆCØÎ +$@)rawFØá +$E`)subFØÿ +/ˆFØ $_x)rawIØ% $y )rawLØC $£È)subIØV /ˆIØi *Ñê)subLØ| /ˆLØ &à)rawMØ¢ &ø)subMØÀ /ˆMØÓ 1Ž0Œæ 2ûŽ7 / ‘3â/W 3ö/¤w 3Â/¤Ð 3²/¤ð 3]/ /¤‘ •/¤‘ 3z/¤0 ý/¤‘( ¡/¤‘,3É/“P 3Ò/˜{ 3ç/Ô 4/3R44R0¹ä%LA$ô % B$%¸C$0&5inGC5outHW%ÂI$u%9J$ˆõ£™6ÇÓ7ûÇ78R68é¨t9²‘8¨ t9²‘6% 7ûŽ78R:Y¿¦;Ò<¨´º=²O8ÀÚý3Ï8N3D8›#æ:‘Ø}$û(%ÒNô4½O%P5sumQ’85iR$Z%TT€¤$P>xZ$% [€Æ$¥p?hue³’a5sat´’è% +5i¶$(&?s¾’`?c¿’_5inÀ‡;5outÁ$Y5nÂ$w*ã'£%z_€•>num`€>denc€>dsfd€$°?xm’]4n’$Ð>xv$$gè4¹~%_’·5i€$Ù&?sum’’\5x“$ *¾R»5i¢$A0R²5out¥$_#d¦’]#I§’^>x¨$*â=a?iÅ’]?qÆ’^#$±•ä@Óª +¤ ’9A€’ApÝ0Bio0,n2$C,p05Ø,p16Ø,p27ØAÈÎCDÌCØBoutC+ùE$C,iH$C+êKØ+TØ-øEbvàý!}.]bø‘.Db‘(dþ‘è~/e$Î(Ïf‘Ôo$[ /%l€ã)im$ø$ß8)irw$ )igx$))iby$G*»«Ë+÷}$/N~pe&P'r…’^'g†’a'b‡’b,y‰’'iŠ’`'q‹’_'iq’[$Jh'yy˜’])rgb™Øx)outšE’*` Û Ÿ=7FB¶0` Ï FMËFXÞFcñGpÛ ‘!¡=‰=}F•&H¢0à r!F­F¹70Â!á!(’]¯ ’91µT"ì"J2ûŽk!hue’‘ B’‘ ü’‘ k’‘ -’‘3Ý¡  ‘#D¤‘ˆ#ð +IÌB 7ûÇ6áõ7ûŽ:ÿÌð"5#×9Ö‘:Ì@#…#÷9Ö‘:Q#¿#;C<¨´#º#=²:…À#÷#n;š<¨ä#ê#=² •’9… ªb9;š ¿ß9¯J$::Kk +K7! +KÍ" +K¬ +L­Ó@€CMúÔ»  NÎNÛNèNõO@€CP +1û +/home/bisqwit/src/snes9x/snes9x-improvement7-src-dehacked/snes9x/ntsc/home/bisqwit/src/snes9x/snes9x-improvement7-src-dehacked/snes9x/ntsc/../usr/include/sysfilter_ntsc_core.cppfilter_ntsc.cppfilter.hfilter_ntsc_core.hfilter_ntsc.hport.htypes.h ìtGoq›MÓe29qUcr›qrG€ââÿHdÔd€ ·fvr;K'ªñ.fcý9lU#·PU7:%®ÅIS;HF¸*H1cS9E,zGËz+MAÔ8RF€Œ:ÕE1E¹œFœbHc0E1E¹â8V8HTF€8HcrqUr$+r6Go9)*86F€]DmhD]FŽfSf-GSG0+HFV¨‘V.$IS;ðpV*H6cM·…zGo¹EUz+Mo-FHaE<HFdFHFœFÔbH\D3E¹œFÔbH›€F)cE3E¹œFœ‘mUmcGmƒGmGmGGj9V•DXD<D6J LDä60RžŽMŽ3qMG5+HpVà‘PŒ|+qPådJD,); cg€I)I)VFHþ‚<ržrÅ©xc<xc‚DfqS<dqSGH8d+qc(c›×ŽÆe:þŽ:þŽ+qUËÿ$y©KV.ðÅŽïgJvgZ& +9Æ=m!m=m3‘Žün Í‚Ò¿XòHŠ;)x›ƒ5/,p”' RF:VIW*yád¸8t(tfŸ,ñ™sƒ,dÔÎyqž«á 5,,,/©«ï ãf6. ·mHHI5:8;*:;JÆ,*;88:>rrtª¬)H2ƒHlg‰KQt€j|r;—',dadgDf;Žt9*·tUgŽVW,HHŠJnŠ©©3kÓÔdU©§}ÓeSsÃUs¾ryqªªªªtI4L'K3Œsâw©¸*:f='œt+Ü=QK'dt&ãGH8d+qcaGH8d+qc @€C¿Ð³]?г]¿ÍÌLBÍÌÌ>?€C|Ù ;ÛI>¿= +×> +×£=Š8Âff¦<=>ÛI@’ +†>’ +@?À?Cu“?ÍÌŒ¾Z¤¾‡Y>Tã¿d;Ÿ>‡™>¢E?Õxé=@€C‹D$Çéüÿÿÿ‹D$ÇÃ/home/bisqwit/src/snes9x/snes9x-improvement7-src-dehacked/snes9x/ntsc/filter_ntsc_core.cppkernels [x] == kernels [x]ü©ñÒMbp?)\Âõ(ð?®Gáz®ï?p@ào@„B!„ ?ð?ð¿š™™™™™É?š™™™™™É?š™™™™™É¿š™™™™™É¿ð¿š™™™™™É?š™™™™™É?ð¿ð¿š™™™™™É?ffffffæ?ð¿ð¿ð¿j¼t?Ûù?–C‹¾Ë¡%¿¤p¿#ÛÙ?void init_ntsc_impl(ntsc_impl_t*, const snes_ntsc_setup_t*)a€?€?€?Ú¬*?€¿L¦ª>€?€?L¦ª>š€?Ú¬*?€?€?ÿÿÿÿ| ˆ$KAA AACXƒ†‡…$PÁAA AAƒ†‡…H<$ + AA AAƒ†‡…Hp$0\AA AAC\ƒ†‡…  /ACƒ$ÀAA AAFàƒ†‡…$àAA AAF€ƒ†‡…"ìFL‡TƒO†ð"EC0@#EC0#/ACƒÀ#7ACƒttt ttKtØ?‘?GS?IW?HVPQtQRtRSt STtT\t\ +t<…é‘`éûVTV…û‘Pû¾W´íRÇÒRü  +R……‘d… +‘TýÊUX²U²éS + +S…¾‘h¾W + +W…éVù²Sºù Vü  +V(KRw‹R~‘Q|“Pã÷R&QRêýQèÿP}‘R‘ÆR„—Q‚™PîR1R1PRõQó +P•Rˆ›Q†PëÿRòQðPR\pRp°RcvQaxPø R @RauRÿQýPh{Qf}PÒæRæRÙìQ×îPCWRJ]QH_P­ÁRÁóR´ÇQ²ÉP + R+ ` R 1 Q 3 P • Rô ü Rˆ › Q† P +! +t! +" +t" +# +t # +$ +t$ +, +t, +,tð^ +^ +‘P^ +,‘T^ +^ +‘ ^ +,‘d^ + ‘¤ U +³ +R^ +^ +‘h^ +,‘¨¼ +õ +RVZR,R^ +2 ‘¬2 ^ VN^V^ + ‘° 2 WF ”W^ +1‘´1©Q ,Q^ +B‘¸BW ,W^ +V‘XVáU,U^ +^ +‘\^ +,‘¼^ +^ +‘`^ +,‘@^ + ‘D dSb ’ Rò  R0 X Rù Q÷  PÃ × R× + RÊ Ý QÈ ß P + . R¡ µ Rw‹R¨ » Q¦ ½ Pä R~‘Q|“PºÞRRfR•ÁRYlQWnP$R$[R*Q,P¶ÊRÊõR½ÐQ»ÒP¹ÍRÍøRÀÓQ¾ÕP]qSdwRbyPQ +RP¯ÂSÂ÷SµÈRŸÊPYkQk—QêþS^qRWsPñRïPQ·Qƒ–R{˜P01t12t23t 34t47t7ŒtÜ0–‘–Œ‘`0–‘–Œ‘\0–‘ –½Q½ì‘ ìQD‘ D]Q]Œ‘ 0–‘–Œ‘X0–‘–Œ‘T0–‘–Œ‘P0–‘$–Œ‘L0–‘0– P Œ‘00–‘4–¿R¿ì‘4ìüRüD‘4DHRHŒ‘40–‘8–Œ‘H¿R¡RÈ;Sƒ­SÁéVÎì‘hζWäêWÎëU)OP¡ÕP‘t‘”t”¿t¥‘¥¾S¾¿‘ÀÁtÁÂtÂÃt ÃÄtÄÊtÊÚtàÀ;‘;:W:R‘R„W„†‘†ÚWÀ;‘;5U5R‘RáUᆑ†ÐUÐÚ‘Ÿ±‘}¿Ú‘}À±‘˜}¿Ú‘˜}Ù±‘¸}¿Ú‘¸}ÛKSK¢R††S†±R¿¿S¿ÐRر‘À}¿Ú‘À}󱑠}¿Ú‘ }܆‘´}ÐÚ‘´}á…UÐÚUÿƒV P)†P R'†R Q.†Q󱑨}¿Ú‘¨}¯†‘¼}ÐÚ‘¼}¢ÛSÛéQ'SRdQÙÛPÛøR'PRqR[SÐÚSd RÐÚRàátáâtâãt ãätäêtêý!t€€á!‘¤oFá!‘¨o5–S‹9 Q®!á!QÃR®!á!R“¸PÂ'P¸ÂP€á!‘°o€R UR à W®!á!U€á!‘´oV è SV ð QV ì V€á!‘¸o€–SÛ ª!SZ!g!P""t"ì"t"œ"‘œ"É"VÉ"×"‘×"ì"V"œ"‘œ"Â"SÂ"×"‘×"ì"Sð"ó"tó"5#t0@#C#tC#…#t0#‘#t‘#”#t”#¿#t#¥#‘¥#¾#S¾#¿#‘À#Á#tÁ#Ä#tÄ#÷#tÀ#Õ#‘Õ#ò#Sò#÷#‘Òdsnes_ntsc_blitÆ snes_ntsc_blit_hiresNtscVideoFilter::runÌVideoFilter::~VideoFilteréVideoFilter::~VideoFilter%NtscVideoFilter::~NtscVideoFilterÈsnes_ntsc_initNtscVideoFilter::adjustáNtscVideoFilter::NtscVideoFilterÿNtscVideoFilter::NtscVideoFilterNtscVideoFilter::~NtscVideoFilterQNtscVideoFilter::~NtscVideoFilter$snes_ntsc_composite/snes_ntsc_svideo:snes_ntsc_rgbEsnes_ntsc_monochrome,÷#  +C ëðè?q‚è|¸ ü  + ô ¼ À ?BT?B»¾ª²T¦¦ª"á¾Ý²»ÝáQUAK"==AU¸KQ¸è!-ìèìX\PU-M!MP¿Ã´¼\°UX°´Ã&¼¿&-’›XŽ2VÇñ.6ô*ñô— 6“*.“—   uy‚uyãì‚ßßãìR R ¸ ¼ À T +·,Äý¾ÂV ƒ ‡ ‹ ƒ ‡ ð , ‹ ì ì ð O a 4 K , 0 0 4 a þ K O þ  9 = % 3  !   Ô à Ð = ™ 3 9 ! % ™ ² û ÿ Ð Ô ÿ à û ²º¾çº¾…‘NçJJN°º‘¬…¬°ºKKSõùéñbåX^Vëøûïôëïû˜ôø˜5EI9B59IéBEšŸ³Æé5‘›\Œ9Y59›)Œ‘Y\RW\o)·¾Âv{”郡ä|Š¿yŽó¨Î£ÐÚ»{q{hâ3>E4;PqŠ¿yR¿ÐÛ R€ò!ý!€‘!Â!á!Ë‘!Â!á!`k›‘!~ƒqzÛ {!†!‘!_ZN11VideoFilter3runEPjPtjjjS1_jjjjjRjS2_S1_sharpnesssnes_ntsc_svideoshort intntsc_rgb_toutputsecondbrightnesskernelx2snes_ntsc_out_tkernelx3unsigned intsnes_pixel1_pitchline~NtscVideoFiltercorrect_errorsmerge_fieldserrordefaultsburst_ZN15NtscVideoFilter6adjustEfffffbPjdefault_decoderfloatin_heightsetupresolutionsnes_ntsc_blit_hireslong long unsigned intkernel3kernel4kernel5GNU C++ 4.1.1 (Gentoo 4.1.1-r3)cutoff_factorgen_kernelresult_heightsin_bkernelsdecoderwidthcontrastpow_a_nburst_phaseout_heightchunk_countartifactsdecoder_matrixkernelx0kernelx1kernelx4kernelx5pixel_info_trolloff_cos_aburst_togglekernelcharreq_heightsnes_ntsc_monochromecos_btablesnes_ntsc_rgbuint16datascanline_widthsbgr15req_widthentrymax_widthlong long intgamma~VideoFiltersnes_pixel0_snes_ntsc_initboolsnes_ntsc_setup_tsnes_ntsc_compositeto_floatclampnegatemax_heightrun_widthntsc_impl_tuint32maxhheightresult_widthlong double_vptr.VideoFilteradjustthissnes_pixel2_anglefringing_Z20snes_ntsc_blit_hiresPK11snes_ntsc_tPKtliiiPvlrgb16to_anglentsclong intpixels_Z14snes_ntsc_blitPK11snes_ntsc_tPKtliiiPvlsnes_ntsc_blitrgb_offsetsnes_pixel3_offsetcolorrolloff_ZN15NtscVideoFilter3runEPjPtjjjS1_jjjjjRjS2_S1_colortblsnes_ntsc_tkernel0kernel1kernel2__in_chrgsaturationlong unsigned intcutoffline_outktable_Z14snes_ntsc_initP11snes_ntsc_tPK17snes_ntsc_setup_tpixelunsigned charbsnes_colortblimplsnes_pixel5_/home/bisqwit/src/snes9x/snes9x-improvement7-src-dehacked/snes9x/ntsc/filter_ntsc.cppline_inout_pitchfirstinit_ntsc_implin_row_widthin_widthbleedoutput_pitchhue_warpingsigned charVideoFiltershort unsigned intsnes_pixel4_rgb_out__PRETTY_FUNCTION__uintdoubleto_rgbntsc_rgb_biasfactorblackmanfourthNtscVideoFilterout_widthline_burstsnes_inrun_startGCC: (GNU) 4.1.1 (Gentoo 4.1.1-r3).symtab.strtab.shstrtab.rel.text.data.bss.debug_abbrev.rel.debug_info.rel.debug_line.rodata.cst4.rel.text._ZN11VideoFilterD0Ev.rel.text._ZN11VideoFilterD1Ev.rodata.str1.4.rodata.str1.1.rodata.cst8.rodata.rel.rodata._ZTV15NtscVideoFilter.rel.rodata._ZTV11VideoFilter.rel.debug_frame.rel.debug_loc.rel.debug_pubnames.rel.debug_aranges.rel.debug_ranges.debug_str.comment.note.GNU-stack.group™4)&™<))™D)+™L)'`÷# À‡°)%X$+`$d 0`$Br(d> pŠÈ) +RÖE/N 8) ^K„oKk P)Ž K Š `)©2¬K[¸2LÇ(L8Ô`Lˆ àèNÜ h)Oþ €) O´ ˜à)1ÈPÅ- xž0)@fÖ< ¨´)Tch0P °´ )!g“h¨c д  )#u0;pV€‘w$‰µwµw €*# „­ñÿ  + K3@H^À”<áä*d!#%'&ZPÁ† + ¸0\é"þ! ",/E![`dhmr€…ເdÏ"ìôûð"E@#E4#/MÀ#7fd{dŒ€dšfilter_ntsc.cpp_Z10gen_kernelP11ntsc_impl_tfffPm_ZZ10gen_kernelP11ntsc_impl_tfffPmE6pixels_Z14init_ntsc_implP11ntsc_impl_tPK17snes_ntsc_setup_t_ZZ14init_ntsc_implP11ntsc_impl_tPK17snes_ntsc_setup_tE19__PRETTY_FUNCTION___ZZ14init_ntsc_implP11ntsc_impl_tPK17snes_ntsc_setup_tE15default_decoder_ZZN15NtscVideoFilter6adjustEfffffbPjE8defaults_Z14snes_ntsc_blitPK11snes_ntsc_tPKtliiiPvl_Z20snes_ntsc_blit_hiresPK11snes_ntsc_tPKtliiiPvl_ZN15NtscVideoFilter3runEPjPtjjjS1_jjjjjRjS2_S1__ZN11VideoFilterD0Ev_ZTV11VideoFilter_ZdlPv_ZN11VideoFilterD1Ev_ZN15NtscVideoFilterD1Ev_ZTV15NtscVideoFilterfreepowcoscosfexpf__assert_failsinf_Z14snes_ntsc_initP11snes_ntsc_tPK17snes_ntsc_setup_tsnes_ntsc_composite_ZN15NtscVideoFilter6adjustEfffffbPjmemcpymalloc_ZN15NtscVideoFilterC1Ev_ZN15NtscVideoFilterC2Ev_ZN15NtscVideoFilterD2Ev_ZN15NtscVideoFilterD0Evsnes_ntsc_monochromesnes_ntsc_svideosnes_ntsc_rgb__cxa_pure_virtualDÍò *n$Ù#+©,¶'ë=s¡­-Íõ+.MU.ex.²ë÷/ý/™¤Ç0,6 IN1]Îù 2 /s‹ ¨­1ÇÑ->W_-mäìöZm…Ÿâ!4ô!"D"6·"3ß"7û"+-#5P#+}#5#+©#,¶#'Í#+Ù#,æ#'@$ˆ#ó#( ,3:Lcjqx†š¥´ÊØæô,:HVdr“¥°¿ÊÙû+9GUc¥³Áàëû.BZ`›û *6H[yÕLRVZ_› ²·ÁÆŠ•ÃÇÌØïû$(,05DSbq€ž­¼ÁÍÜèóø$/4@KP[`k™©³·ÇÌ×áñû   ' , 7 A Q [ _ o t  ‰ ™ £ ± » ¿ Ï Ô ß é ù  + + + +' +1 +A +K +O +_ +d +o +y +‰ +“ +— +§ +¬ +· +Á +Ñ +Û +ë +õ +ù +   # ' 7 < G Q a k o  „  ™ © ® ²  Ç Ò Ý í ÷ û    % 5 ? C S X c i y ~ ‚ ’ — ¢ Ì Ó × Û ß ä ó    / > M \ l q }  ™ ¤ © µ À Å Ñ Ü á ì ñ ü  !,1=HMX]hmx}ˆ˜®¼ÆÖàîøü &6@DTYdn|†– °º¾ÎÓÞèö$.<FV`nx|Œ‘œ¦¶ÀÄÔÙäîþ !,6FKO_dozŠ”˜¨­¸ÂÒ×Ûëðû 05@JZdt~Ž“ž¨¬¼ÁÌÒâç÷ü %.3AKPZ_inx}‡Œš¨²·ÅÓÝâìñû ).8=GLZinx}‡³½Õ Ù ò ö .26?HL^dhlq{€Š¢§±¶ÁËÚçìö">CMZ_ƒ’Ÿª®³½èø +5BGalp}‚†•š§ÃÇãïôÿ/u~–®ºÎÕÙÝáæõ$8=HV`o~–šŸ«¶¼5ESWhmqzƒŒ—›±¶ÀÄÍÖàäé$-@N\jx‚‡•¤°Â×êîò &*.7@DZ^bktxÏÜéö+46=A>L<@ Q `' ('% *;? )&@Dhl”¸¼ ÈÌ ØÜðô@D`dtxˆŒ ¤ $(04<@QU]aptƒ‡–š¢¦®²º¾ÆÊÒÖæêòöý /3:>EIX\dhx|ƒ‡Ž’™¬°¸¼ÃÇÖÚáåìð÷û +!04CGVZim|€“¢¦­±ÀÄÓ×æêñõ*.=APTcgvz‰œ ¯³º¾ÅÉØÜëïþ   /3BFUYhl{†Š™¬°¿ÃÒÖåéøü)-<@GKZ^mq€„‹ž¢±µÄÈÐÔÜàèìôø!%59BFVZcgvz‰•™ª®µ¹ÀÄÓ×àäëïþ )-6:AETXaelpƒ‹–š©­µ¹ÊÎÖÚêîöú   /3BFUYhlsw†Š™¬°¿ÃÒÖåéøü   " 1 5 D H W [ j n }   ” £ § ® ² Á Å Ô Ø ç ë ò ö  + + + ++ +/ +6 +: +I +M +\ +` +o +s +‚ +† +• +™ +¨ +¬ +» +¿ +Î +Ò +á +å +ì +ð +ÿ +   % ) 0 4 C G V Z i m | €  “ ¢ ¦ ­ ± À Ä Ó × æ ê ò ö þ   +    " & 7 ; C G W [ c g w { ƒ ‡ Ž ’ š ž ¥ © ± µ ¼ À Ð Ô Ü à ð ô ü      0 4 < @ P T \ ` g k {  ‡ ‹ ’ – ž ¢ © ­ µ ¹ À Ä Ô Ø à ä ô ø ÿ !04CGW[bfuyˆŒ“—¦ª²¶¾ÂÒÖÞâéíý  !%-19=NRZ^eiqu|€ˆŒ›Ÿ§«²¶¾ÂÉÍÕÙàäôø#'8<EIZ^eipt{†Š‘•¤¨±µÆÊÓ×èìõù +(,;?FJY]dhw{‚†•™¢¦·»ÄÈÙÝäèïóúþ #'.2AELP_cjn}‰•™¡¥­±¹½ÎÒãçøü )-48GKRVeix|‘˜œ£§¶ºËÏÞâñõ$(7;JNVZkow{‚†Ž’¡¥­±¸¼ÄÈ×Ûãç÷û#'/3CGOSZ^nrz~†Ššž¦ª±µ    $(,04@DHLPT`dhlptx|ˆŒ” ¤¨¬°´¸¼ÈÌÐÔØÜàäèìøü (,048<HLPTX\hlptx|€„ˆŒ˜œ ¤¨¬°´¸¼ÈÌÐÔØÜèìðôøü $048<@DHLX\`dptx|ˆŒ”˜œ¨¬°´ÀÄÈÌØÜàäèìðô  $(,8<@DHLPT`dhlpt€„ˆŒ”˜œ¨¬°´¸¼ÀÄÈÌÐÔàäèìðôøü  $048<HLPTX\`dptx|€„ˆŒ˜œ ¤°´¸¼ÀÄÈÌÐÔàäèìðô  $(,04@DHLPT`dhlx|€„ˆŒ” ¤¨¬°´¸¼ÈÌÐÔàäèìøü(,048<@DPTX\`dptx|€„”˜œ ¤°´¸¼ÀÄÐÔØÜèìðô  $(,8<@DPTX\hlptx|€„”˜œ \ No newline at end of file diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/filter_scale2x.cpp snx/snes9x/ntsc/byuu/filter_scale2x.cpp --- snes9x-1.43-src/snes9x/ntsc/byuu/filter_scale2x.cpp 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/filter_scale2x.cpp 2006-08-01 22:28:50.000000000 +0300 @@ -0,0 +1,64 @@ +void Scale2xVideoFilter::run( +uint32 *colortbl, uint16 *data, uint32 width, uint32 height, uint32 pitch, +uint16 *output, uint32 max_width, uint32 max_height, uint32 output_pitch, +uint32 req_width, uint32 req_height, uint &result_width, uint &result_height, +uint16 *scanline_widths +) { + pitch >>= 1; + output_pitch >>= 1; + if(width == 256 && height <= 240) { + lores_progressive(colortbl, data, height, pitch, output, output_pitch); + result_width = 512; + result_height = height * 2; + } else { + int w = (width <= max_width) ? width : max_width; + int h = (height <= max_height) ? height : max_height; + for(int y = 0; y < h; y++) { + for(int x = 0; x < w; x++) { + *output++ = colortbl[*data++]; + } + data += pitch - w; + output += output_pitch - w; + } + result_width = width; + result_height = height; + } +} + +void Scale2xVideoFilter::lores_progressive( +uint32 *colortbl, uint16 *data, uint32 height, uint32 pitch, +uint16 *output, uint32 output_pitch +) { +uint16 A, B, C, D, P; +int32 prevline, nextline; +//.A. ->.AA. +//BpC ->BppC +//.D. ->BppC +// ->.DD. + for(int y = 0; y < height; y++) { + prevline = (y > 0) ? -pitch : 0; + nextline = (y < height - 1) ? pitch : 0; + for(int x = 0; x < 256; x++) { + A = *(data + prevline); + B = (x > 0) ? *(data - 1) : *data; + C = (x < 255) ? *(data + 1) : *data; + D = *(data + nextline); + P = colortbl[*(data)]; + if(A != D && B != C) { + *(output) = A == B ? colortbl[A] : P; + *(output + 1) = A == C ? colortbl[A] : P; + *(output + output_pitch) = D == B ? colortbl[D] : P; + *(output + output_pitch + 1) = D == C ? colortbl[D] : P; + } else { + *(output) = P; + *(output + 1) = P; + *(output + output_pitch) = P; + *(output + output_pitch + 1) = P; + } + data++; + output += 2; + } + data += pitch - 256; + output += output_pitch + output_pitch - 512; + } +} diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/filter_scale2x.h snx/snes9x/ntsc/byuu/filter_scale2x.h --- snes9x-1.43-src/snes9x/ntsc/byuu/filter_scale2x.h 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/filter_scale2x.h 2006-08-01 22:28:18.000000000 +0300 @@ -0,0 +1,9 @@ +class Scale2xVideoFilter : public VideoFilter { +public: + void run(uint32 *colortbl, uint16 *data, uint32 width, uint32 height, uint32 pitch, + uint16 *output, uint32 max_width, uint32 max_height, uint32 output_pitch, + uint32 req_width, uint32 req_height, uint &result_width, uint &result_height, uint16 *scanline_widths = 0); + + void lores_progressive(uint32 *colortbl, uint16 *data, uint32 height, uint32 pitch, + uint16 *output, uint32 output_pitch); +}; diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/video_colortable.cpp snx/snes9x/ntsc/byuu/video_colortable.cpp --- snes9x-1.43-src/snes9x/ntsc/byuu/video_colortable.cpp 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/video_colortable.cpp 2006-06-30 02:59:10.000000000 +0300 @@ -0,0 +1,102 @@ +const uint8 SNES::gamma_ramp_table[32] = { + 0x00, 0x01, 0x03, 0x06, 0x0a, 0x0f, 0x15, 0x1c, + 0x24, 0x2d, 0x37, 0x42, 0x4e, 0x5b, 0x69, 0x78, + 0x88, 0x90, 0x98, 0xa0, 0xa8, 0xb0, 0xb8, 0xc0, + 0xc8, 0xd0, 0xd8, 0xe0, 0xe8, 0xf0, 0xf8, 0xff +}; + +void SNES::contrast_adjust(int32 &input) { +double lmin, lmax; + lmin = 0.0 - double(int32(config::snes.contrast)); + lmax = 255.0 + double(int32(config::snes.contrast)); +int32 result = int32(lmin + double(input) * ((lmax - lmin) / 256.0)); + input = minmax<0, 255>(result); +} + +void SNES::brightness_adjust(int32 &input) { +int32 result; + result = input + int32(config::snes.brightness); + input = minmax<0, 255>(result); +} + +void SNES::gamma_adjust(int32 &input) { +int32 result; + result = int32(pow((double(input + 1) / 256.0), double(config::snes.gamma) / 100.0) * 256.0); + input = minmax<0, 255>(result); +} + +void SNES::update_color_lookup_table() { +int32 l, r, g, b; +double kr = 0.2126, kb = 0.0722, kg = (1.0 - kr - kb); //luminance +uint32 col; + for(int i = 0; i < 32768; i++) { + //bgr555->rgb888 + col = ((i & 0x001f) << 19) | ((i & 0x001c) << 14) | + ((i & 0x03e0) << 6) | ((i & 0x0380) << 1) | + ((i & 0x7c00) >> 7) | ((i & 0x7000) >> 12); + + r = (col >> 16) & 0xff; + g = (col >> 8) & 0xff; + b = (col ) & 0xff; + + if(bool(config::snes.gamma_ramp) == true) { + r = gamma_ramp_table[r >> 3]; + g = gamma_ramp_table[g >> 3]; + b = gamma_ramp_table[b >> 3]; + } + + contrast_adjust(r); brightness_adjust(r); gamma_adjust(r); + contrast_adjust(g); brightness_adjust(g); gamma_adjust(g); + contrast_adjust(b); brightness_adjust(b); gamma_adjust(b); + + if(bool(config::snes.sepia) == true) { + l = int32(double(r) * kr + double(g) * kg + double(b) * kb); + l = (l > 255) ? 255 : (l < 0) ? 0 : l; + r = int32(double(l) * (1.0 + 0.300)); + g = int32(double(l) * (1.0 - 0.055)); + b = int32(double(l) * (1.0 - 0.225)); + r = minmax<0, 255>(r); + g = minmax<0, 255>(g); + b = minmax<0, 255>(b); + } + + if(bool(config::snes.grayscale) == true) { + l = int32(double(r) * kr + double(g) * kg + double(b) * kb); + l = minmax<0, 255>(l); + r = g = b = l; + } + + if(bool(config::snes.invert) == true) { + r ^= 0xff; + g ^= 0xff; + b ^= 0xff; + } + + switch(video.pixel_format) { + case PIXELFORMAT_RGB444: + r >>= 4; + g >>= 4; + b >>= 4; + color_lookup_table[i] = (r << 8) | (g << 4) | (b); + break; + case PIXELFORMAT_RGB555: + r >>= 3; + g >>= 3; + b >>= 3; + color_lookup_table[i] = (r << 10) | (g << 5) | (b); + break; + case PIXELFORMAT_RGB565: + r >>= 3; + g >>= 2; + b >>= 3; + color_lookup_table[i] = (r << 11) | (g << 5) | (b); + break; + case PIXELFORMAT_RGB888: + color_lookup_table[i] = (r << 16) | (g << 8) | (b); + break; + default: + color_lookup_table[i] = uint(-1); + break; + } + } +} diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/video.cpp snx/snes9x/ntsc/byuu/video.cpp --- snes9x-1.43-src/snes9x/ntsc/byuu/video.cpp 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/video.cpp 2006-11-17 05:06:30.000000000 +0200 @@ -0,0 +1,109 @@ +#include "filter.cpp" + +void SNES::set_video_format(uint filter, uint video_standard, uint pixel_format) { +//only make changes at the start of a new frame + video_format.filter = filter; + video_format.video_standard = video_standard; + video_format.pixel_format = pixel_format; + video_format.modified = true; +} + +/***** + * Internal function called at the start of each frame. + * Use SNES::set_video_format to modify these options. + *****/ +void SNES::update_video_format() { + if(video_format.modified == false)return; + video_format.modified = false; + + video.filter = video_format.filter; + SafeDelete(video_filter); + switch(video.filter) { + default: + case VIDEOFILTER_DIRECT: video_filter = new DirectVideoFilter(); break; + case VIDEOFILTER_NTSC: video_filter = new NtscVideoFilter(); break; + case VIDEOFILTER_HQ2X: video_filter = new HQ2xVideoFilter(); break; + case VIDEOFILTER_SCALE2X: video_filter = new Scale2xVideoFilter(); break; + } + + video.video_standard = video_format.video_standard; + video.pixel_format = video_format.pixel_format; + update_color_lookup_table(); +} + +void SNES::get_video_info(video_info *info) { + info->filter = video.filter; + info->video_standard = video.video_standard; + info->pixel_format = video.pixel_format; + info->width = video.width; + info->height = video.height; +} + +void SNES::video_update() { + if(r_ppu->renderer_enabled()) { + update_video_format(); + + video.ppu_data = (uint16*)r_ppu->output; +// video_normalize(); + + switch(video.video_standard) { + default: + case VIDEOSTANDARD_NTSC: + video.raster_width = 256; + video.raster_height = 224; + video.ppu_data += (int(r_cpu->overscan()) << 13) + 1024; + break; + case VIDEOSTANDARD_PAL: + video.raster_width = 256; + video.raster_height = 239; + video.ppu_data += 1024; + break; + } + + if(video.frame_hires) { video.raster_width <<= 1; } + if(video.frame_interlace) { video.raster_height <<= 1; } + + if(snesinterface.video_lock(video.data, video.pitch) == true) { + video_filter->run(color_lookup_table, video.ppu_data, + video.raster_width, video.raster_height, + video.raster_height <= 240 ? 2048 : 1024, + video.data, 512, 480, video.pitch, + 512, 480, video.width, video.height, + video.raster_height <= 240 ? (pline_width + 1) : (iline_width + 2)); + snesinterface.video_unlock(); + } + } + + snesinterface.video_refresh(); + + video.frame_hires = false; + video.frame_interlace = false; +} + +void SNES::video_scanline() { +int y = r_cpu->vcounter(); +int o = (video.video_standard == VIDEOSTANDARD_NTSC) ? (int(r_cpu->overscan()) << 3) : 0; + if(y <= (0 + o) || y >= (225 + o))return; + y -= o; + +PPU::scanline_info si; + r_ppu->get_scanline_info(&si); + + pline_width[y] = iline_width[y * 2 + int(r_cpu->interlace_field())] = + (si.hires == false) ? 256 : 512; + video.frame_hires |= si.hires; + video.frame_interlace |= si.interlace; +} + +void SNES::video_init() { + for(int i = 0; i < 240; i++)pline_width[i] = 256; + for(int i = 0; i < 480; i++)iline_width[i] = 256; + video.frame_hires = false; + video.frame_interlace = false; + + video.raster_data = (uint16*)malloc(512 * 480 * sizeof(uint16)); + memset(video.raster_data, 0, 512 * 480 * sizeof(uint16)); + video_filter = 0; + set_video_format(VIDEOFILTER_DIRECT, VIDEOSTANDARD_NTSC, PIXELFORMAT_RGB565); + update_video_format(); +} diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/video.h snx/snes9x/ntsc/byuu/video.h --- snes9x-1.43-src/snes9x/ntsc/byuu/video.h 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/video.h 2006-11-17 05:06:40.000000000 +0200 @@ -0,0 +1,60 @@ +enum { + VIDEOSTANDARD_NTSC, + VIDEOSTANDARD_PAL, +}; + +enum { + PIXELFORMAT_RGB444, + PIXELFORMAT_RGB555, + PIXELFORMAT_RGB565, + PIXELFORMAT_RGB888, +}; + +enum { + VIDEOPITCH_LORES = 2048, + VIDEOPITCH_HIRES = 1024, +}; + +VideoFilter *video_filter; + +static const uint8 gamma_ramp_table[32]; +uint32 color_lookup_table[32768]; + +struct { + uint16 *data, *raster_data, *ppu_data; + uint raster_width, raster_height; + uint width, height; + uint filter, video_standard, pixel_format; + uint pitch; + + bool frame_hires, frame_interlace; +} video; + +struct { + bool modified; + uint filter, video_standard, pixel_format; +} video_format; + +uint16 pline_width[240], iline_width[480]; + +struct video_info { + uint filter, video_standard, pixel_format, width, height; +}; + + void contrast_adjust(int32 &input); + void brightness_adjust(int32 &input); + void gamma_adjust(int32 &input); +//public functions + void update_color_lookup_table(); + + void set_video_format(uint filter, uint video_standard, uint pixel_format); + void get_video_info(video_info *info); + +//private functions +private: + void update_video_format(); + void video_normalize(); + void video_update(); + void video_scanline(); + void video_init(); +public: diff -NaHudr snes9x-1.43-src/snes9x/ntsc/byuu/video_normalize.cpp snx/snes9x/ntsc/byuu/video_normalize.cpp --- snes9x-1.43-src/snes9x/ntsc/byuu/video_normalize.cpp 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/byuu/video_normalize.cpp 2006-03-01 00:01:18.000000000 +0200 @@ -0,0 +1,150 @@ +void SNES::video_normalize() { +} + +/* +void SNES::video_normalize_256x223() { +uint16 *src = video.ppu_data + 1024; +uint16 *dest = video.raster_data; + for(int y = 1; y < 224; y++) { + if(video_frame[y].hires == false) { + for(int x = 0; x < 256; x++) { + *dest++ = *src++; + } + src += 768; + } else { + for(int x = 0; x < 256; x++) { + *dest++ = *src; + src += 2; + } + } + dest += 256; + } +} + +void SNES::video_normalize_512x223() { +uint16 *src = video.ppu_data + 1024; +uint16 *dest = video.raster_data; + for(int y = 1; y < 224; y++) { + if(video_frame[y].hires == false) { + for(int x = 0; x < 256; x++) { + *dest++ = *src; + *dest++ = *src++; + } + src += 768; + } else { + for(int x = 0; x < 512; x++) { + *dest++ = *src++; + } + src += 512; + } + } +} + +void SNES::video_normalize_256x446() { +uint16 *src = video.ppu_data + 1024; +uint16 *dest = video.raster_data; +bool field = !r_cpu->interlace_field(); + for(int y = 1; y < 224; y++) { + if(video_frame[y].interlace == false) { + if(video_frame[y].hires == false) { + for(int x = 0; x < 256; x++) { + *dest++ = *(src + x); + } + dest += 256; + for(int x = 0; x < 256; x++) { + *dest++ = *(src + x); + } + dest += 256; + } else { + for(int x = 0; x < 256; x++) { + *dest++ = *(src + (x << 1)); + } + dest += 256; + for(int x = 0; x < 256; x++) { + *dest++ = *(src + (x << 1)); + } + dest += 256; + } + src += 1024; + } else { + if(field) { + dest += 512; + src += 512; + } + + if(video_frame[y].hires == false) { + for(int x = 0; x < 256; x++) { + *dest++ = *src++; + } + src += 256; + } else { + for(int x = 0; x < 256; x++) { + *dest++ = *src; + src += 2; + } + } + dest += 256; + + if(!field) { + dest += 512; + src += 512; + } + } + } +} + +void SNES::video_normalize_512x446() { +uint16 *src = video.ppu_data + 1024; +uint16 *dest = video.raster_data; +bool field = !r_cpu->interlace_field(); + for(int y = 1; y < 224; y++) { + if(video_frame[y].interlace == false) { + if(video_frame[y].hires == false) { + for(int x = 0; x < 256; x++) { + *dest++ = *(src + x); + *dest++ = *(src + x); + } + dest += 512; + for(int x = 0; x < 256; x++) { + *dest++ = *(src + x); + *dest++ = *(src + x); + } + dest += 512; + } else { + for(int x = 0; x < 512; x++) { + *dest++ = *(src + x); + } + dest += 512; + for(int x = 0; x < 512; x++) { + *dest++ = *(src + x); + } + dest += 512; + } + src += 1024; + } else { + if(field) { + dest += 512; + src += 512; + } + + if(video_frame[y].hires == false) { + for(int x = 0; x < 256; x++) { + *dest++ = *(src + x); + *dest++ = *(src + x); + } + src += 512; + } else { + for(int x = 0; x < 512; x++) { + *dest++ = *src++; + } + } + dest += 512; + + if(!field) { + dest += 512; + src += 512; + } + } + } +} +*/ diff -NaHudr snes9x-1.43-src/snes9x/ntsc/changes.txt snx/snes9x/ntsc/changes.txt --- snes9x-1.43-src/snes9x/ntsc/changes.txt 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/changes.txt 2007-01-08 13:57:48.000000000 +0200 @@ -0,0 +1,71 @@ +snes_ntsc Change Log +-------------------- + +snes_ntsc 0.2.2 +--------------- +- Moved configuration options to snes_ntsc_config.h, making it easier to +manage + +- Greatly clarified and improved demo to read any uncompressed BMP image +and write filtered image when done + +- Improved gamma to be properly applied to each RGB channel, and changed +default to compensate for difference between PC monitor and TV gamma + +- Improved contrast to be properly applied to each RGB channel rather +than just luma + +- Removed hue_warping for now, due to its obscurity + +- Improved floating point calculations in library to be more stable and +not need double precision, which was causing problems with the sharpness +control on Windows when the DirectX libraries changed the FPU to single +precision mode + +- Added extern "C" to header, allowing use in C++ without having to +rename the source file + +- Made internal changes to factor out code common from all my NTSC +filter libraries, greatly simplifying things for me + + +snes_ntsc 0.2.1 +--------------- +- Significantly improved NTSC signal processing to give clearer image +and better sharpness control + +- Added parameters for resolution, color bleed, and artifacts + +- Added presets for composite video, S-video, RGB, and monochrome + +- Halved initialization time + +- Added ability to write custom blitters + +- Changed interface to blitters significantly, requiring changes to your +code. They have a simpler interface and don't do any line doubling (use +a custom blitter for this). + +- Added ability to change input and output pixel formats of blitters + +- Improved demo with more controls and interpolation and darkening of +scanlines rather than duplicating them + +- Improved documentation + + +snes_ntsc 0.1.1 +--------------- +- Changed snes_ntsc_blit() to rescale image horizontally and do line +doubling + +- Added hue warping + +- Changed input pixel format from 15-bit BGR to 16-bit RGB + +- Fixed color speckling in solid areas + + +snes_ntsc 0.1.0 +--------------- +- First release diff -NaHudr snes9x-1.43-src/snes9x/ntsc/demo.c snx/snes9x/ntsc/demo.c --- snes9x-1.43-src/snes9x/ntsc/demo.c 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/demo.c 2007-01-09 06:43:34.000000000 +0200 @@ -0,0 +1,85 @@ +/* Displays and saves NTSC filtered image. Mouse controls sharpness and gamma. +Defaults to using "test.bmp" for input and "filtered.bmp" for output. Input +image must be an uncompressed BMP. + +Usage: demo [in.bmp [out.bmp]] + +Space Toggle field merging +C Composite video quality +S S-video quality +R RGB video quality +M Monochrome video quality +D Toggle between standard and Sony decoder matrix +*/ + +#include "snes_ntsc.h" + +#include "demo_impl.h" + +int main( int argc, char** argv ) +{ + image_t image; + int sony_decoder = 0; + int merge_fields = 1; + int burst_phase = 0; + snes_ntsc_setup_t setup = snes_ntsc_composite; + + snes_ntsc_t* ntsc = (snes_ntsc_t*) malloc( sizeof (snes_ntsc_t) ); + if ( !ntsc ) + fatal_error( "Out of memory" ); + snes_ntsc_init( ntsc, &setup ); + + load_bmp( &image, (argc > 1 ? argv [1] : "test.bmp"), 0 ); + init_window( SNES_NTSC_OUT_WIDTH( image.width ), image.height * 2 ); + + while ( read_input() ) + { + lock_pixels(); + + burst_phase ^= 1; + if ( setup.merge_fields ) + burst_phase = 0; + + snes_ntsc_blit( ntsc, image.rgb_16, image.row_width, burst_phase, + image.width, image.height, output_pixels, output_pitch ); + + double_output_height(); + display_output(); + + switch ( key_pressed ) + { + case ' ': merge_fields = !merge_fields; break; + case 'c': setup = snes_ntsc_composite; break; + case 's': setup = snes_ntsc_svideo; break; + case 'r': setup = snes_ntsc_rgb; break; + case 'm': setup = snes_ntsc_monochrome; break; + case 'd': sony_decoder = !sony_decoder; break; + } + + if ( key_pressed || mouse_moved ) + { + setup.merge_fields = merge_fields; + + /* available parameters: hue, saturation, contrast, brightness, + sharpness, gamma, bleed, resolution, artifacts, fringing */ + setup.sharpness = mouse_x; + setup.gamma = mouse_y; + + setup.decoder_matrix = 0; + if ( sony_decoder ) + { + /* Sony CXA2025AS US */ + static float matrix [6] = { 1.630, 0.317, -0.378, -0.466, -1.089, 1.677 }; + setup.decoder_matrix = matrix; + } + + snes_ntsc_init( ntsc, &setup ); + } + } + + save_bmp( argc > 2 ? argv [2] : "filtered.bmp" ); + + free( ntsc ); + + return 0; +} diff -NaHudr snes9x-1.43-src/snes9x/ntsc/demo_impl.h snx/snes9x/ntsc/demo_impl.h --- snes9x-1.43-src/snes9x/ntsc/demo_impl.h 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/demo_impl.h 2007-01-09 06:42:56.000000000 +0200 @@ -0,0 +1,190 @@ +/* Simple shell used by demos. Uses SDL multimedia library. */ + +#include +#include +#include +#include "SDL.h" + +/* Image loader */ +typedef struct image_t +{ + unsigned char const* byte_pixels;/* 8-bit pixels */ + unsigned short const* rgb_16; /* 16-bit pixels */ + int width; + int height; + int row_width; /* number of pixels to get to next row (may be greater than width) */ +} image_t; +/* if no palette, loads as 16-bit RGB */ +void load_bmp( image_t* out, const char* path, SDL_Color palette [256] ); +void save_bmp( const char* path ); +void init_window( int width, int height ); +int read_input( void ); +void lock_pixels( void ); +void double_output_height( void ); +void display_output( void ); +void fatal_error( const char* str ); + +static unsigned char* output_pixels; /* 16-bit RGB */ +static long output_pitch; +static float mouse_x, mouse_y; /* -1.0 to 1.0 */ +static int mouse_moved; +static int key_pressed; + +/* implementation */ + +static SDL_Rect rect; +static SDL_Surface* screen; +static SDL_Surface* surface; +static unsigned long next_time; + +void fatal_error( const char* str ) +{ + fprintf( stderr, "Error: %s\n", str ); + exit( EXIT_FAILURE ); +} + +static void init_sdl_( void ) +{ + static int initialized; + if ( !initialized ) + { + if ( SDL_Init( SDL_INIT_VIDEO ) < 0 ) + fatal_error( "SDL initialization failed" ); + atexit( SDL_Quit ); + } +} + +void init_window( int width, int height ) +{ + rect.w = width; + rect.h = height; + + init_sdl_(); + + screen = SDL_SetVideoMode( width, height, 0, 0 ); + surface = SDL_CreateRGBSurface( SDL_SWSURFACE, width, height, 16, 0, 0, 0, 0 ); + if ( !screen || !surface ) + fatal_error( "SDL initialization failed" ); + + SDL_WM_SetCaption( "NTSC Filter Demo", "NTSC Filter Demo" ); +} + +int read_input( void ) +{ + SDL_Event e; + + /* limit to 60 calls per second */ + unsigned long start = SDL_GetTicks(); + if ( start < next_time && next_time - start > 10 ) + SDL_Delay( next_time - start ); + while ( SDL_GetTicks() < next_time ) { } + next_time = start + 1000 / 60; + + mouse_moved = 0; + key_pressed = 0; + + while ( SDL_PollEvent( &e ) ) + { + if ( e.type == SDL_MOUSEBUTTONDOWN || e.type == SDL_QUIT ) + return 0; + + if ( e.type == SDL_KEYDOWN ) + { + if ( e.key.keysym.sym == SDLK_ESCAPE || e.key.keysym.sym == SDLK_q ) + return 0; + key_pressed = e.key.keysym.sym; + } + + if ( e.type == SDL_MOUSEMOTION ) + { + int x, y; + SDL_GetMouseState( &x, &y ); + mouse_moved = 1; + mouse_x = x / (float) (SDL_GetVideoSurface()->w - 1) * 2 - 1; + mouse_y = (1 - y / (float) (SDL_GetVideoSurface()->h - 1)) * 2 - 1; + } + } + return 1; +} + +void lock_pixels( void ) +{ + if ( SDL_LockSurface( surface ) < 0 ) + fatal_error( "Couldn't lock surface" ); + SDL_FillRect( surface, 0, 0 ); + output_pitch = surface->pitch; + output_pixels = (unsigned char*) surface->pixels; +} + +void double_output_height( void ) +{ + int y; + for ( y = surface->h / 2; --y >= 0; ) + { + unsigned char const* in = output_pixels + y * output_pitch; + unsigned char* out = output_pixels + y * 2 * output_pitch; + int n; + for ( n = surface->w; n; --n ) + { + unsigned prev = *(unsigned short*) in; + unsigned next = *(unsigned short*) (in + output_pitch); + /* mix 16-bit rgb without losing low bits */ + unsigned mixed = prev + next + ((prev ^ next) & 0x0821); + /* darken by 12% */ + *(unsigned short*) out = prev; + *(unsigned short*) (out + output_pitch) = (mixed >> 1) - (mixed >> 4 & 0x18E3); + in += 2; + out += 2; + } + } +} + +void display_output( void ) +{ + SDL_UnlockSurface( surface ); + if ( SDL_BlitSurface( surface, &rect, screen, &rect ) < 0 || SDL_Flip( screen ) < 0 ) + fatal_error( "SDL blit failed" ); +} + +void load_bmp( image_t* out, const char* path, SDL_Color palette [256] ) +{ + SDL_PixelFormat fmt = { 0 }; /* clear fields */ + SDL_Palette pal = { 0 }; + SDL_Surface* bmp; + SDL_Surface* conv; + + init_sdl_(); + bmp = SDL_LoadBMP( path ); + if ( !bmp ) + fatal_error( "Couldn't load BMP" ); + + fmt.BitsPerPixel = 16; + fmt.BytesPerPixel = 2; + if ( palette ) + { + pal.ncolors = 256; + pal.colors = palette; + fmt.palette = &pal; + fmt.BitsPerPixel = 8; + fmt.BytesPerPixel = 1; + } + conv = SDL_ConvertSurface( bmp, &fmt, SDL_SWSURFACE ); + if ( !conv ) + fatal_error( "Couldn't convert BMP" ); + SDL_FreeSurface( bmp ); + + if ( SDL_LockSurface( conv ) < 0 ) + fatal_error( "Couldn't lock surface" ); + + out->byte_pixels = (unsigned char *) conv->pixels; + out->rgb_16 = (unsigned short*) conv->pixels; + out->width = conv->w; + out->height = conv->h; + out->row_width = conv->pitch / fmt.BytesPerPixel; +} + +void save_bmp( const char* path ) +{ + if ( SDL_SaveBMP( surface, path ) ) + fatal_error( "Couldn't save BMP" ); +} diff -NaHudr snes9x-1.43-src/snes9x/ntsc/license.txt snx/snes9x/ntsc/license.txt --- snes9x-1.43-src/snes9x/ntsc/license.txt 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/license.txt 2005-05-13 13:01:12.000000000 +0300 @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff -NaHudr snes9x-1.43-src/snes9x/ntsc/readme.txt snx/snes9x/ntsc/readme.txt --- snes9x-1.43-src/snes9x/ntsc/readme.txt 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/readme.txt 2007-01-08 15:17:34.000000000 +0200 @@ -0,0 +1,61 @@ +snes_ntsc 0.2.2: SNES NTSC Video Filter +--------------------------------------- +This library filters a Super NES image to match what a TV would show, +allowing an authentic image in an emulator. It uses a highly optimized +algorithm to perform the same signal processing as an NTSC decoder in a +TV, giving very similar pixel artifacts and color bleeding. The usual +picture controls can be adjusted: hue, saturation, contrast, brightness, +and sharpness. Additionally, the amount of NTSC chroma and luma +artifacts can be reduced, allowing an image that corresponds to +composite video (artifacts), S-video (color bleeding only), RGB (clean +pixels), or anywhere inbetween. + +The output is scaled to the proper horizontal width, leaving it up the +emulator to simply double the height. An optional even/odd field merging +feature is provided to reduce flicker when the host display's refresh +rate isn't 60 Hz. Specialized blitters can be easily written using a +special interface, allowing customization of input and output pixel +formats, optimization for the host platform, and efficient scanline +doubling. + +Blitting a 256x240 source image to a 602x240 pixel 16-bit RGB memory +buffer at 60 frames per second uses 8% CPU on a 2.0 GHz Athlon 3500+ and +40% CPU on a 10-year-old 400 MHz G3 PowerMac. The library requires 4MB +of memory. + +Author : Shay Green +Website : http://www.slack.net/~ant/ +Forum : http://groups.google.com/group/blargg-sound-libs +License : GNU Lesser General Public License (LGPL) +Language: C or C++ + + +Getting Started +--------------- +Build a program from demo.c, snes_ntsc.c, and the SDL multimedia library +(see http://libsdl.org/). Run it with "test.bmp" in the same directory +and it should show the filtered image. See demo.c for more. + +See snes_ntsc.txt for documentation and snes_ntsc.h for reference. Post to +the discussion forum for assistance. + + +Files +----- +readme.txt Essential information +snes_ntsc.txt Library documentation +changes.txt Changes made since previous releases +license.txt GNU Lesser General Public License + +benchmark.c Measures frame rate and processor usage of library +demo.c Displays and saves NTSC filtered image +demo_impl.h Internal routines used by demo +test.bmp Test image for demo + +snes_ntsc_config.h Library configuration (modify as needed) +snes_ntsc.h Library header and source +snes_ntsc.c +snes_ntsc_impl.h + +-- +Shay Green diff -NaHudr snes9x-1.43-src/snes9x/ntsc/snes_ntsc-0.2.2.zip snx/snes9x/ntsc/snes_ntsc-0.2.2.zip --- snes9x-1.43-src/snes9x/ntsc/snes_ntsc-0.2.2.zip 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/snes_ntsc-0.2.2.zip 2007-01-09 15:50:56.000000000 +0200 @@ -0,0 +1,122 @@ +PKNo(6snes_ntsc-0.2.2/PK39&6SÀdDçÈsnes_ntsc-0.2.2/benchmark.cVÛnã6}¶¿bš" ÉqâKÓ<¬c¿¤Yì¢mÔ^ô! E¢"¢Tïbÿ½gHK²ÒÖ0,h†s9‡gHOFô»ˆM­…¡g¡³J—±JU=ÒZ¡ÇT‘ÕÁG²|ÖÕ‹TOSR[•Í²³áÍíæú=mri(6¦.‘Ñæ±Å D%‚ïIXË fÓé1]Ý}&+K± ]US)ŸrKJˆ”l5ŒµŽÕ“pu-gÅSFpÂ^¯[Yô(H‹çJ[ÕVpL¬HZ˜ã¢Ø¡ô&ÃáR%E +:2J˜HY“œåGöKcÓB>žå«¾MV}÷Í–¡PuI_Ž(—Ìä’¦ômA 7ÉàÐ ?n ù5e…$£I.U´•©Í‰>ÿù‚F4G’w.˜çžÿÄ®ÆWÕÖDzo}s½Žn6ë«èöó&úóÓ/›A—<ä¸.¬É¹ìò»ÄÆê:±”Æ6ŽìðëpÐrYâÇb8¨•‘O +t›´#Ñ}—æ/MÕ‡­æÚtß5ðà^ÚÕ¾…ØÊ9¬gv¯³€^*™Rˆì*c©‚;ìµ0Lî%iµ¢szGÓ×Ù‡º8ç¬ßšÞ‘H)­Œ ùüVÊ÷ì0"ÄýîgÜþéé—ï”À‰zçÛa˲w±Ï²€Ž>a‰«úžŽÏæ‘T*5©£±ƒ¤UýXˆ‚}e:õ|‡4¡àê·Û«_×ÑÝõÑúúŠFè$DNéO.Êt \:¶Â£Ùæ²ôu¶|û­îÆ•‡À\ˆw½×1?}·{Ø@ã>­©Ûë& +úva{åõ­Õ€·ÿèå{»‡óï褓L¦…ðCÁfXaÄùCM;‘hak­hŠ‰ý¿u3Ê>À`kíå·¤s>(e¸ ÜgjP¨4r—Dëñyje›¹ýÁ½½\:u§ŒFmË¥_â8:Ÿ¬•¢÷­¨¯ÃNG“‘_‹~-Jí¡×Üi•Y¡üTñ %^„Þí!:„½1u–ÉD"Ü„fv0'~?Z¦›Íi8éàÑÉÛ>G-Ë~ïÜåÙC¸Z¶äî¹s[„ Nì9féÚ¾k/`žíÔÍ ÿ±Ç9&ä´­ê"åÿXuìo|ü)¸˜Ò‡»u{pÅ1ŒnƧ¨É†Þ!÷\O''xiÕ7cõýPK8o(6^©@º snes_ntsc-0.2.2/changes.txt•UMo7½ Øÿ0È¥ " q€ö^+ˆ . Ûý¸wv—5—ÜòÊòëû†\IŽ¬K|%røæÍÌ{dt]ŠšÖƒr=Óï¾ogþšE³8FX}\}|ˆºñÏÜ’ö®3}*ïÈOò/Ròt€x¬!«aI£z2®'“ˆU4×,FåTÏÈ +ÌëÀ*Ùi«‚é ð•kÉŒS(ÉZ½`#Jvv”öØä±{us‹Ð‚%§¶Á$¦ÎØÄ»e‡¶;j½›ó}Ù#÷j•@o˜°4q 5M° ¾z »ë+Òèžc»,ÄtieÛ,ZîT¶I"…»¨$·Ôš®C~§ÐiËH»¦Ñ;“°+ ÕìGFûƦ búR„) šEÂoú7ã°Í{à; îùq«Â„A‚Îo—Ôf@“"ùMÔ­Ûðé¬WIMÞ¸DZY­ªã6Ž¬Ùv•-ê L1©e©±Y8ŸÈ±ŒÐgYÄÌ´‰8¼ÄH ÊتÌ%2"fŒ´5i 4jc‡17‹Òo jûÛ¸Öocj ûd›þ™ÉŽû •ÝÏ· +=Ia1ÿ°mg=üÚ¶毌£7ë7?@l0pkýVèåÈRñúýûBÐçDƒzÆN‘3f­F®¬}ºHp†¿Ž +º²3·b–Ni‘ƒ@i Ö?J^wôÇÃýºYT9 \R_-ƒ²F£Û>cïˆÔ¯}yÖÑ÷¦wpV€ו̀ï…3–4ÆP‹¥Þ<ƒ«eÀéh=Q:X§FóÐ^6yR}BXå {›“(Ñ+ ½TŸ©Œ´(~€#œÊéb:ÅïϦe¿¤û‹úEìQ1ÐO¯4tžÅoÊJqF4ÊšoõKfüN +jc¬I"ëù>Ñp†²Áªp¯±ëª²:Z3B(¾lë•þ—M@_ +`ç3|+³_ÑÃÀ;Q¬S§Êáˆ,µÈöSÂg¹­q\m%˜os”!œð”&‰*â»Õùêf.È3å$9D‹òu2_ÙÊñQÉåÐTþååÕ\ìP¼¿x¨J~òõ¶¨¨ðÄ|m¢5REœ/0*÷W›¡g]﬎§ ½Î#»T@_küò¬Æ£:>ORÐÛwõYËóS1ø`¾¡ øo7w½ôºYì›}he½Vi¾VO5qÚÆjëËŸ/6x¯®ï$õå/òKÔZOF|;!N¬Ÿ$ŸÜ:p‰Cà=Wô‡WEW´ʃSEÿPKq5)6ÔOÜÂÍssnes_ntsc-0.2.2/demo.c…VkoÛ6ýlýŠheCUlwsºÙÐ&ÃÖi‡:Á™@K”D„U’²ã¥ùï»|Ø’ldH¼/sH^úx —L5œl:EVTÁ§ëÅäŒk*i¬"áJ´ŠB*j-W J"›š*—Wª"qpIsÒr­@ h« jªt¼¬š!äB«›VÛŒá¶~ç­Fo MP`? U«4,)¦@[§¢j$~A}¸ú=‚…1§ÑJÀ-«M)¸Å2æåî. I)\‹¢à)QžAEeЂ p×VŠi ++–Q_[™Þ ï_¼Ù·ñö/¿~8ȸòž+Q‹´”¢:,yi¼;<ÈK¯)­AiT„ÈÌ +³õ¥"£*¢%{ÆÇAð«SÞf† +eOj­Ò¸öíF†„U ·vVkLguæÈ" ÅIÍ`£à1X‘íæø Ǫ@²pg6²a¨•P¡yêÍËV*4%QÔïà%Šê¶Áêö‰ÞΓn5Çø~†ƒyblØ7Ž ç" A±¿©È÷¼#,h„#cAfƒAN4á •RȆŸqÑaV…ÉÍÐÆwXÍth?Á+udaqA²WR¯¬>„FFø ¦ð³ñvz§½E>Š`b³MÑdÍêL¬CX|úe‘˜M•|¾¹Nþøxyý[è·ÕšeºLsÃ’²¢Ô0†™Ç°.§ÈLRÄbwO82‘# +rŸ4ìršèÞýéøËÍ’“Æ‹û“huÌŸ/Ó©³ä[u¶e±L¦óÝH¬K"ê/…È”ô(îŒü^÷è{C–°å’‰vÉiâ}.ÓÍ\Ïò®yµ6ùHöžnß),ËG'5_ÃëÓÃ¥|ÔŸÁµ¾?ë2RÌøüB¾TÒÌ +ìs6¹-!,=;Ôø 2÷œFÙ£„ˆ #6³}.%oªÌ$ÌNR/oß“Îc$\Ń™eY4—M¥JÓ€¤×¤D~§Àì×ý~gžFJìG®Öt3 +‰¸C7ZÀžNAçù!Q• ·D8›K‹‘*詿΃٬ +ÇæcŸà=´F®*"’™o¯´L•9±¥íxGq)*#ª'Ò–Âai9®Æ2.Ñv–³l´àw8Íe¥ãõRÎ[ Y¡‹F˦yX)¤V·Ý¡* J„©x=r·W¤?ðÕhó$]õ†êÓ€‡$…„bÄÕ~Þr¹Æ¿^‘:œÇÛáˆÜ‰9_àé‡^5-*RU·#4?ø_“]êÍÉ,F rM¶5 éŸØ›ä·p«™nC/¶nðóùÝèìÝùÅýí€ÈÏY\y¥%®?Ò›¬-äyR|aûâ/ÊS ýb±orÉ×  *ìsðÌÓ :?\³{Ë:$Z«ÃS³)· ø…ÏÝ-A ¼Lñ>Î…TÔgÄðµm¢ã¡k/Ø‘™3†à ›z-ÏDC­õžBFí&—Ÿ„Ë£ËÈå–1c”›¬ƒ_å™Ùj£s¢&ªÛ”‚¥‘>ïoÏÞ šU˜î†J³|O¾|Á£†BXÿ"•:2þù’"9±gćÒÕÝð„ Ÿå)¥­æš®š¦MýI#9ø\YB7ù"j.t˜cûÕ3À%ífgEÞ(¸Xš´½çòN8‰•&Àpßæ½Â¶· ‹–è³®.2B9å˜_Ö)B]xH €ËæJì‰=×k9áÈèïÂJ§Ãö™ +¶0` C´l´d”²Å›È÷Uº,¶ C¥âmœÉ0¦Sqy}?ßßÝ]_^¾BT>ÞŸß©QÑr‡ÊZm3؇Á/Bâd/“»ô—¬‚6þŒô‡Ñ`xòîf“/‹üIXÛåè×tIä¯Ä{y}w~]p“êã~¥ÐÍŽ]R҇텂¹½Òó¢²Ým‰õÛf©c¤Á,eÚ:íÐF«¿@¥tqU`ûx(¬`uA\}Š§P26~Ó\u©¥Ö꼩ò‰z~Šœ&f¢®O“hî»áwR¡¦ÒzÚÚ§£,*Ìšâ™ËŽRV_2¾ñ”rQ>ß¹†¡_½p䡆Rmï$ŠóªhÜC®÷{¬ÕZ±>õ’i–Í÷SAÓºìæ.àvÊ׉ª¶b¿ ¸¿®¬¼ ñ`Ü ‹î.z`ÁÛ0+ßÜšâ²;VùšŒÄ ‚Ë%ÕÚ,i!ÄÝ’Gªìiâbi.TtãÆÙ"=È¡¼$àcÁÀÒ7îÜiQ§hçv•e|X–Zÿ¡Ö ¶Í:ËÎá~7³åÚñéM¦»ÿÆ@®{K~h¥¸)ˆT¢ÒÒnõûÔ‰­ÂòåK÷pð½ö…ÒqÄöÕ3@²Å³¾%¬_f×®ûÐßØ`½B ûBV%0tèÑ4w?³ÔISSµ›/f–Ðœî1 ŽëÔõÿÿÒ‘ÇyCu}Å KmÌÜyV×gÇç袉à¾Kb4áeŠ“_máY…Dž=n¸NAÒïéøòÆR~.9xužAA/½Í „ö1 +ú†Ç*2x¼e^TsjÂXIs“N,Û¡CY£†|õ 1¥¥ + +`³cšºîÇ¡f¬ûÑí©3€r”ÞñÈ㬸(£¨$è6Ë—ÅB¢HûµL92O–ªD”`шb¼pÈ(„ÿr¨3¢ÕÏ¿&X?&ØNCÁg‡„ÑÑ_0úIuòAñ‚Žº>3£c$)SŸ2e¦—2³o +L}îí±µ}£nü§÷Ê‘=„ ÒŸÏ +#ôJ:¸Ù3²ø7PK&h­2…¤}ûõ#‹K¬NzÎE|Š\&'¿í²8—W€ѳcú³uéÆ.sîUà¶ð-é©6ù» +ëìöµZìç4ËЭV – JÊÁÛšämq®ƒÃT,÷ ¥ÒB¶ùQ\&;ŒšþD-»ÙÜ0Ý­ªªoàé‘øfGq2ôE±Ãî¶Tú%R¬Lߺ ÌíS(SØÆpÈ&ÀJÙÁëL®"~”¨¨¸^¶1§¥¨ÅÃW´OÞýÄØÌضmŠ zZ53lxa&=Í+ìCð’]ØpÄVI–ªÝau”¦Êí\T áBÐDt:žBDN8 ´äÊÄà#¼fº¶ÁÿÀÀE¶_b¿Â‘ÁÃÃ7 +ÌäxU'E'œË#ž)‡›w:|Õ= V,¸¥/Q"ÃVøç>­H2 (#ó-þž0ÉÕöynå°èCx M´…mbH0H4ÇbP^ä/ZnHӌݧ ®ÀI–¦Kû–²‚Xªß €¯èõXCŠeŽ±dü9¶\¢j–5’5!¨ûi\­£¹rQ~ail/}ŠÉå6;¨‘ Õ”=uŠ˜kR`´ª*n<ÅŠ¨¤9àÌÒ²ûŠ3øߢLk ÇãD¡ä -²[âÅ¿HÀÊáѵìÃACê‚á#íÛA7‡)g'¸ òºˆ5’ÿW$•`ÕÎô]\pXõëžÚ_ˆÉßQéf:Þú2Ò+@ ]~8 ®û-Ÿ rc¸ÔlÑ—I ‚ô˜Öûš´”~น§¸¢É­|‹ÔiÔU†‹|@Ž¨4XGm¿C¶ˆ˜“Q¿F‹´D.„ÖÁ1'ˆbA ¸@äF§y¤Œ +|bì"åüz2çîNlÁÇ3ѨiºàRgºgR´£/ÁÚ¦TÜ ¯Ð Çñb/ÀDr—ËKqIà‰¤Ø½ðبAÿK.G03r·Ü evLýçžzpKLkF‘Ÿ,"GªßCÛÿZÌwÈö²A/ÍSšŠ5ÁVÛO䢮3 <֤œ‚mJŽêùEd¨x&-ruŒ‹¾žÃ³%6Êó²S®å +¤¸­,—Í)žÆIãD+LYÓTKH+.À?( ­!àÅò€o;©œË6Ïõ‘ò†ðÊgÊÈÄžÞ]ŒDXäh[xCÂïhl¬ É«\„íHN4êŠU—>áã<äµ¾¿Nóýo‘Ÿ7èD£î8ƒ]Û¯7_;a2à4[°ÃxXß97"Êz˜g[P„˜ £~E^k˜GõTÛhÒÁ¦? 4!Wrtœ‘Tå>WoÙAVŠ•Ì ï§>Û!>ÙÑ w±¢ÛºLi«$¤–@@C,âR_ÎÙ_˜a+(Áà‘»˜q…¸À5ü9~©®oðd’ŠzN’œÆúŒFÚçšš¢Æu°Á’šUkˆ¨qMØlEáçTW•˜>5ûKÇ©¬SÁë‡D´]4̽ö¦yWɨ¯¡À7¦ï# :™}¼Æ7o£«Û›·Ó‡éíÍ}ôîv†ï>MoÞ¢·Óû‡ÙôÍ#¿’oßNßM¯Æü@Oí‡Kq?=‹Ž×àæÉ›þ%ËÉm3á¡ZÅë EÍbÆFLv!Ó·pNqˆu],1ÓÒL|¦ÿ‹ÁÔGX4>h’Þ,O` Ù[ÆDZ[±Rõ+BxNo@|À8«›?»ÀL`dœE‰—Ë’—Ôg±ÏœàGgž³¶IÌcs»0¿2ÐlµÏ5ûäoä|c.Ù‰s +„b¡´ðKþ”äŒd³CÓå•qòa$‡ÔŸ Õ5š)¶¦PŠª³¦,xÁÈÙкÉb_‹ÚlHïÙµmg¤Ù‘fY ˆkz”(Pà "ÚfY<~TN7ˆî‹*jmŠ&ظòµ_O >¸,¯K »²øù'SŽšÃ™P‘ÁŽGÁ[]Ð<•¢t˜Ö#CÁW˜0H#è«p®!¹¸Ô¼81ÅA°eFJ*³#ý:Èš†ðüÔGšKâjd0®èu8 ¼WŸÁ¾Ï½DgMŒÎ./ô`ÏîC.ùŒ§o4PËì&Ó5ºÞšv—AšµTZ¼P4­Õˆ7ƒ1KêµRغ”xe9|å«5¾7¦;:*Ù¾’ÃŽQ;[¤JV’Jx‡ÔÇ+œ¡B˜¬t „1;)¹š!s/™ —*m‡ÊÖ©±¾û͘†«¸ÈA‚Ó†¬E&É¡Kj¥•*çµd¥dN¶b©G‚@€O,€ƒ,ª BÓ, ûÜa`KlùÜM²”蟠w{ ø‡‘â$d-\´I H0I?iÞ)­%i…ÊÎ[KŸ§À]‚ÿˉ¯sV:¾‚‡˜_Δµžmª†¿`šA#ù µå>‰jì$gЂw.çè¿rû +ö½7á’§Êÿ^^j<>|KM¹³“ï°ðQf«f)‡*ÄUÄPGI÷Û‘‹Ó–¡È$TÞÁÿ.öU¦ˆÄ; Û•dz|²£ «6 ‚äc¾Ø{,«^·¡E§[q}*öuô9IvTH`//™6OC!Uþ8«&à +Lý W–yŒ$NõÀ»”Œ5Œë€ÊŠ|-ZÍëþ wîh¬†¦…ŸAÞms=&ª3­"hË”1&¶„|±3QÇhOóÈJM~³BÚJ-VvyÚWžg,y.Pme`•c&Ë ‹$R‰/ö•¨\Eºï¸^7êîÈ›U2i,èX"g¸Gѽmñ%H3‡ÐwX‘[Ñ\É6I¤!Â6R% ?þ'9ü_P?ùè@V·— +$ÉV’)èù —núü"T¡±jªÈ ¦©nœ‘ÈÝâxTTµ„d}=¸e€åÂz@ŽUm”GeÑE%ÄŒMk¨šs!¢DF “r€åÀJuaÁ ݃èˆAÀbyM%Ã/X…<¨qvìÐôʼ—'<¦pįÃ*âóÎ՞Σڟ8oº’}…)P¸²ÇdÔ°|ÔoølWÚi¬ Ã(oÍQ()3POÅgZ¢šCÍÂ#“E±Äê€dY`a£ôŽ Žu ­¾è8Êž2Á W .§«&±êû28·é’ˆ>Ýd‘–b6í·:Qÿ%TTt!%¤˜d|-N–|@  ½L8À5ø¤âúÒœõL¯Az„á0—‰»fy9/Ú©|G-® NYèhQ‡›"ÓhÀ8¥Ýd +Ò?¿ã5ÒôÜá(¬ÅÕ5!ÿ[R2:AqÐQš‡ˆZ”¦Ke<;uMdãSJÔ;A²çh½&µ ² yu/øûQP¡“#ÄkÉ9ºÀϬÙ~kEp¨†BJ˜Þܤ9àAáÌK@9üB"hvÂ^ÿ18‚ÅŽ´U‘k1i«Îó¥I C“xÙ]KÀJs‡FœÇRª"ØŽ +C£Ç&Θ‚üv¯UñM6~ÐÉ |¡iu8›é¬#¹ú8ì=Ã6IüŠÁ[°oX˜¦’„GãIÓŠεâþA÷åÁrͼˋ(zKµé¼’ܺ3ÌOtZ¸ò¤tÑÀ-ÂÙ É2Ä’3ZçæÔBŠ,‹ 2Ï$¸PÜlHõÍänåf³Œ1ý¼Òj–E Ô]Ý™¢¦VÊ/ÛhŽu¡Q*ix3^õ»™áÔ¼%s—*tíC{ +5K0àO_ Á{Ê v1”h¨°?ËÕ©ìú0çÕP±î2ßKRŸz §ã¤*z)½Š$Z:,-¬…†FÀG². Æ¿”ÚY¸”ë—yò¢ÿ !mๆÊo7Óýí(R1=·¨b‹j–Õ*¹áI­MW=›ˆx{~èYCmékw¬1X³OhDÑä¿Jf˜^ÅÉeà×|OcWïn4ü•-‘+€MËŘŽ›Ò!rB‰Ôz];J ™:)ò³8àp +Pº)‹y ÿ|›œÒ™€Þniæ¼Îó^ðÅ}w²wzFrŽÕr›4e«¨)¨JK§ +`סv/ Âဣ0‘ +¡ÐéÈ‹qW·t “5…î–Ö®|Šó˶549¸þ“¯àÜ£ ‘µiQƒAà}Õíài«™f?Š;;wLÝÌÎÅÈ<01a}4õLÛÅÅBÄ%Ð(¤ˆ»4q +íGÉw$æëSœ»«ÁoX¡ÙLõ*ê'ÛXº2׶·IbÐJR)f¬Ruô»'Þ‘‡ªã’¾qd8ø2ã4´+½Æ|ØQÈã#ËóÏ$ÜРÔHRŒqHáX0Ö’pe{'EÙœÀ.¡·Ú»„ Pï,cÚnS+â#‡¯+Š)®Ï¬N­«)ù¼Ù-§¡ù|ŸšÉNÒJT¬‚Xa¡E½—Þ­ÅKsÇvÛÈRÕ$¡õ)‹ªñAšƒØD(ž3Æà‡‘0ÒÁ ü™¯ëÍ…êðN^ßPTÙyŸ7ŠÝÉŽ-­v-aT¥C/qX¸]­ÃÌ—±â¤³«E¥CW¢:þÁ®FvK´žqF£æÁESŒ\j¹iqNIÁWS²?‚Æ9øÿè¾CÒAò³G7ÇÛk‚ñBiɘ}™–œzúÒøÛyµ?†™ê\$»FË…÷:ÔÛð¤\£ƒ7?¿WkKÏŸ6H;óÓ Á)<êøŒTæÚyZ[¦~S¤‹næÛŸ‰»jØnGé–DùƒyWÒ–X<Ëe,ÁD|I.¬A ñwTS's\ÎâOý¤}(y„[½”·,”šH¹MÖ7/~)ö»ö{š”s™#E½e€ÚÙ•p_ÄåèzÐm‚\ì¹{åiî“Ç´ƒ¢ªz¥ªfðjõnÝNw #ØĶùè4rÅÃêýIe| bÚËǶGwa7FÌ©Ô”®=µ*!c øí-©_Š z{ ½ç>9-@ü%—glØzÀÃ:DNãD@qñš?uÔbÛ­rêEÀô„zÔ'CÏAM¾®£ jÕÝ_i«uqÑ»KV©ëò>vw‰ZºÇdÓm)ì´­‘û•Ioи)a¡ +…ÑîßcîÐ? ÅöbÕhj¨¬€•æ~Kn¡põ$Ohê%Æã᪛[ø»MI7Û.`BgdØCsáË‹F‘î‘ÚrŸ + Úíô¬is#iµmö‹Ë™÷¦\8a"-z®z›÷¡ôôñ÷r£pmu-'«í{\™è@«’DkÞhwÅÒuzZ-!îµqxxÞÒ$FÝr×ý},Çê¡xø7³­§{&ÝB”(âÑu(B áw†šv¼.µ +‘ï†y!ú§ffÉ“¿™`«Š)–H^Ç…"èi%kÚEð£±{ª>¯Y^Ž—»I¼Ôlk…Ø1¼ë6ù“2t­[8ÍÊÔñÈ ]ÊUYóBÚ|½då&DƒWÀsÞb+Bj×ZýW=ÿõT‡‚9•îÐY_NsèÖ:¤9–øðè'|¶:­­X˜ u"áP–-[T¶bX§°~w×Ù @ ¶ ×ÚF`R1F²ã1±Óìm“Ö“ÀF/-×R¥õ½ŽrÙ@a󦙪k§Š&J¸´n^–ˆ«pg!xµÐMnäét ¤, ~ka(Æ?´]çØ*™æt‡dmj~$sÔ-‚ºpéß|[¤Ôëx×gàwÃÙ­dµ}v&Ç^Ì/ð§•ØáG«ƒ p«nºœWXŽÄ;•NêÆK–|ðmê>]u$DòâSš3ll8èx[6Êî“H܇ÛýåÚw0öSïËÂùâÏÅ×üq¿9·®Ð/(F§fuãD#Ö>o·ócöŽtrØ–»Þùmi}ï3u"ífÓÔû“±á±­úíñ>UðE] +Os1_m>“ç:ÔñzáAÚÉS“!/¡ãÉd– GbÛÏ¿{ÉÁ6¬ ¦®þDMˈæe‹’œ 4lq™)v({ü!Z)q±{q+7¼¯±Å<Ç}Ü×·âÒÔÝNܧ"UîUO1Þ#]àn¨Ê‰ó§>ã^¬8†e0c®VÁøALµ·ñVõƒA+ü³b ýP?ø×MR×&A à‘£Ñq~¨( +‡‚õ>Eø—÷ª5¶Ã­)ï£üEŽÖUU¼c Ë©[N17ø ¢¬µòÑ6åøF„]ßX³{S4|ûþ˜ÜéâW4~Ý:F¸Ç;ù+õöÛoƒÔ>wkåc3TǶÔê·Â,Ë(Q¼BXî釲8 é 7vƒì“têØ&ÎI´7W¾PÕ»Ÿ˜s`µ[Ñ]ŠvÒÒ™½hÀËÑXKŠ‡“ +èÏ©2)¢+Üß +=wzÖô{áZeý^ãþºI2&:$…"Uä*¨  =_mÁ W²[7öe“ÐYPöI¾hϵ¤YjkXèv=:Ÿ3õŸ +˜6û}{r¿Á‘G´WãON ¸­Y¾³ ± ùö ŠN›#í¡/שI'$ü}:$6ôukyå M횇³¹z—l]*L~Ò~¢uØjú¦VL† P¹¸WÄGl<Æ@b!ÀG k—ÒŽar «¯ÙÜ9çý:Ôþ …ú~-˜÷qb¨f¼/êÌ!(¯™™¶Úá)œfØ52»»ì¯-Øïly»‹ûý²Èy +î!BŠ=¾dê`IñZ¯ât†A?邪´|k®×ªÙ7+ÕYo-Öê3yxSÈÊB™{†êÙzæ Eò$#y»gÊd³4Ç'zQ^¾¢ì5ÌZâè·ªqOzíÕ }T²Iêì•þäëb˜R»Õ¨íÄô®PS”%÷Ð.›qüµZ»ëH~ƒü€ƒ_'Ì°í6ô¤Z» WM9ÚŠOª¡Ãf _¬ôÒšÛz·•êØ.¼kÅÎOwºd_Ñ°êMW}Aƒâ­OG¶·"¸„D#¡Ûm"W’X·tµ–NôŠSÇûÇKúé'_³Áüí;ÖvS¸völb˜b7³ÿ• ‚Gšnibø'Ñ`ꊰ\¶^…Jní`cPÿÜnbO&œ®Üáfà@s¢ª"ÈŒežË0ÃÝ`çîm2×rδ곸顺`Í«±)}ýãÎ+´âÛ´=d—ʆ…é ©ÒÐËj6o8P[ å,´£Ø|‹3Üâ³—"”-îxÃetÒæt^(ÉÈG½µÜq»Jø¸£·ÿÐ[®t€°yï¨Cß=A=g‚ÂX÷wàá]ö?QY5[v›Ò">¿0j·[×Tsû©½Sі鮞©:A`U“¦-ñvJ¢uõ+ƒÁöÕk9ÿvÄÞœn­÷NöqdÜëèYŸI èUb9B9 òM\újìp@›G½@B –Í<® ©¡¬T$˧æS>Ò­··Ç¤ äd†=}Ü~ªÕ¼”maNŠ\ÅÂjw‰œ0GœÀ—Ç on£_ƳÙøæá“©9ô¥¾™\ï'ÑÇ Þy3Ï>EÓ{÷¤ÈÛèÝl2‰nßEWƳ÷“ÇÍ&hÃÇFš0ìV~žüçÃäæ!ºÃ£$Ó‡€{ó)ßÝúøÍ5†áãÿy5¹{ˆ~ù0¹‰n ÿ—)ºsÂô&úe6}ÀË%(¯˜Ì¦ï?½y;Š&SBêw³É=I€½M?ç ¾œÞ\]?¾•wTÞÄÍíÀcoöp+Ôl°Á':\áãdvõ?ŽßL¯§X”/¯¼›>Ü` !ßXq¿z¼c7w³»ÛûÉe¤dP}6½ÿ{4¾wÄýÇãØA"…äãø抧¥x„ã”-GŸnYÁÞ¯ß6 #ÄšDo'ï&WÓŸ'#ŽÄ:÷E©~ÿ Tº¾Žn&W@™ÓðÍÏÓ+¡Ålr7žÎ"yff6#˜ÛgK¼ÕÈ|“ŸÉ 7טÿxœÎŽq¡ŒßÏ&BRLŒ° ¬“êqÁsä‹ÀŸÀO·xDþ“>oƒÓUFÁÂþœ{`à >¿¹%!Þðk"TH•á€Gõvüqü~rßà.î^åÁ=Ê»ÉÕá÷`BœùuD½Â[<Ø6>À·J4ƱXÒŽ.‚@ +×ݳ`u~Ö>Öó°zŸ£ëÛ{²Vy–ü‰í`ôp0›Ü€h"\ã««ÇÙøËÉàsÿÑ›ÞÈÑ'ˆlOgop ±A‰ñôúq¦ìÈȵoï&„©\ŽåþöÝdbr1Vˆ¦ï Ž¯>Ø!lëü>Œï0Æßþ<…º…î€æTéÂa80bšº‹ø6‰ï>ˆ¤†Ñý#ydZ‰1Ã\Ëô>Ðgà‡Ÿ¨‘oà$]»j$×pé÷F Þ^Ššoô6_äÖ"²Yy#M¯õ5ÞÂsvÊBF>€ª ;[Ä4öp1 µƒ…k‰þV ˜ÚÉÔðh¾æ9B¿°WÎCÒÎÃôça.v¤wÈòXŸƒ,V}åà wÁÈR ÍuF|Ó+Ö‚uðãÂuµ¢ópßT îU¼Eùu˜¾u£«Ú +[ ¾±Ú»ôQiUóÜŠ“ø”R߸VÖSK€ØÓÂÖ'Qk׋ÒáÌ»+gÒB͉r_IÂ8¬®53ÿ­nSmý_âû+NW „š@…ïà\Æ[|]EpIbÁYßQÔ7Nþ&À:¿½ã¯ìÌù– L1Çìoni‰²ÃÌm|M.ï±ùìßÛ5ûðøù†éùȘû+Éá¿/“D©T?¹.ôò%yâÈKµ5?øµô÷ D¿A!‡>U/3ÿóÙ†ï rîEòYŸVæíóêÂ÷bÿ Ñ tEšäC¼@û“±á_µÃn_ŠÞz8@³ùßð«ˆ`ÊÑüÊ_IôƹoFü}8UêÄø̧iĸþN6àÞdµ¼Ã¿â[üïÿPK1z(6„O½4õ snes_ntsc-0.2.2/readme.txtV]oÔF}·äÿp…T‘ˆ]甆ª* ° %(b}D³öµ=Åžqç#ËæßÞsÇû•ö:Rïç9çÞ‰7ì¿šàKšgÅÙ-?¾]ÒÇ»å}Ñ[z§»À.Ϧÿïɳ»V{êôÊ)·¡:y{R´Œ;’àºW S°Ô«P¶´nUÀ÷»/´¶±«È·v=É3Õuv­MCÊŠ¡et¹õÕFN¹ +Öô!Pô,YZݴ݆ìt¯¸’8u:´½dD µuø³eòªÇ/ÝÕÑàlÉÞ§t±G*.mÅ.¥C__&Ôè{±¹g´æ‘¡SŽý;R.èZ•A¼+*mg­:æ +öÝ!_ôQuy6è2DÇ01ÁÙÎS‰t+&Uý}àê‚ÚÈT+´5“ÑTù0¡•CÁ TAÈXÊ ò^ÐëªÒbà6“Ô¡êm4l=¶S¶Îö*Õ×ÅíjÞ×ช%W:GXB!ᬩ<Ð̳Òöƒõ:0Ý'­œì#žNh9Ý>ƒ¬é6øüiq‰O+“g Bñ2›uËNH^qX3›"ÏòL´1 1äåKÕq…¤OaO´Õ‚ç@>׺ +í„=ñ¥¡ALól'ø +ƒÄRÙˆâR¤–_`i ¡Lâ{63[UÐ2Cž=»1ó¬f%D¢)½¦‚¶RÝéòŠB/f m} Jû¡S›§f5 ló $K ó4Ы9½(h9p©U'òj:`€ö ±ò%¯Ž8Ž’Í3?ú4Xƒ>â°„®,¦!© j€`ìMø£#ë0’~’zß;àôЪb6Iî\׺ԘL!ÄtÚà„&Ò&Ö.¥üT"½|õýì|NÞFWòa (´}&_¶ƒôüÕt¥C’GϽu›<[ź”*!T;Ì- ÇçRGÿ×_èêö3Ä%©Š9-Þ?ÐëÐv8xñr>&õæÙùüÈìù|ºa妬žÏçt—Å ºµkv7ªLS»_dŽÿŽÚ!ÑùÍežÙz[\êò5Ö@",ÏVmháÔüÖ¬°šæ¦Wº+0*¿çÙŸ¼Jã‚!a¸˜ÍÖëuá;U~+ ‡ÙeÂ,ÏÞY{¢ƒUãl|ÑXÛt,¡Æ“Ù˜a +HM5E¥>Ï®uÉÆK†ÅÇÏtÍ lØA·BMI;›“ëÅíõ)|”i"踠+™À«gÏòL~<’· ˜kÙ¥ÿÙõ—Q<%Ѐc{ª€LQNhµàEàO*Z¾¹&Œ ô…m vðæÙ‰gÞµ+T]a]3;-èS42Àkìpz؇bÕO âïÀL’VG¬}»¿KÄl{q5ê3†lcIß ’•r~¨;|éseËØCæã@HŠƒM+2ÎoJ„¾Åœ¤íˆ¼2ð?¿£Ø'c…”X@ãŽep·Õ±ªzNÉ÷Ï[ï‘œðqL2Ï—º}®GLWeÝ‚föâ^g¸‰+¹ Q¨ä{m£l¨ÛFêêF½{þ\]Ò× +ˆ´½rßóî¹AЈA™dý ¢»+ðD/«ÁÖql™zô¼W©éP÷ˆ(·Ü¿˜}¿Ê¢S»çƒlIÙ혢 !rʲÝ$MäÙNeÇùîp6Æ·†G |Å.ªuƒ,Æ£í=N'½­t½‘ÿ0 3®‹Ó#÷Cu÷–A‹“·[óؾ…Bøê݈&Á`æ ÂhˆYŠ‚¡|°CѤÇ`VplŸB1p#ºý™›$ÛTƒqîð‘'fþ@„$Ç‚¤'Cuóéò†.D‰°ðIø"´=ºžõ=ס ×~$ÈŽhÊ3ÑX ¨ÿ¨Pç¬DW+»Âmé~“„ zX¸a„{ªWÌx¥DžAP«hKÖ<¤`Ê°Ô}$Ï–ÐP#ã}æûN·-\_ISda®çQ_Ð,Ùg8ék»÷ùê¦G­Ëo…¯­N§uÙûÖ§ Š{¡å¸“©çB,6Âk¬ñ—³Îégð·NÚíÞ7Vú¼Ý»<ëv çWjÑu«ÓkŸÞ\´:t}Ó¹¾êžU¨+Ä’Q飕oBQi»^T¡oÁŒ"èå hlß 8Ôî=´²É ¦¬ÓzÑ…Ô_^àÔ&HC§Iîü@ôºjkiÚ¾S1hß‹í÷`ò®3œ»CÈ>÷‚ 4è$ˆ$ØéK‹juÓ¬•ÍFͤ›nK…~ðV$äljIìÅ$Íç'8ã0˜:¢T3ʦ¿øTêé¯ròkb&&ÓSóî“iñ~cé Ÿø+¾VztïD@¸Ré9Ý©lò龜£>¯“~˜HÏY¦ðn †®ÏÁàŽü‰ð¥åÀ·’)¥? £d–¯9%‘c{‚ËÕõ>GáÓÃ×af¡PºCÛ‘‘5q ™•Ú0%C×á£hËÄH¬p¤'k<T› … ¬¾+£Ä‡TÝÁéð8’à B¡9âXÆ>½àAªA€ã pˆ\hKS÷WáEˆÅTæÈžLl+rÿ%´ÌF}e†¶8)$iºŒ3ÉDZù˜ÞÓ<´"¬B-¢`¸a°Â¡1úvÉ'wìÞÂÖºnÿãìº:?ïžõŠTÞƒgÿL%ƒ~À³ü©•‡éÉXàh;Ô}U¸€Pøøn5X€ò¾ç®Z¼x,J‹à0‹¤-‘Õîøu"‘°¾‹Ð‡ †®ðQq1œ-¹Cn@¥¶ë"ìüfa‹]V$ŸŽt@*Ç4A¡rÙçX·–„дvºCh‡jw´GŒ5WÁÌU0óEX}¬¾ «îh Àí^Fi•ñ$ÈÇSäsW•Ä*¸WiTØÂU,b{»¬l™ÔøŒK´½dÊþÌõpbJ%:>&ÐË Êäw™o²ø:jü Æ‹¯gÄ×Y| 5þã׊ßÝu|?ž#Ì BXQZ" ƒ0\ÚòF>æà†uAŸÃ娛ùÎ)w@ÄZ_Xá8صªTaw—áŒÏ’R”šT .ÖíÖåCv+¨»¢»kÖK?›{»æÞÂdMMÖßß-wéùÒ»}§ÁóÉO2¸ÉØín¯Ó>¹éYgÎU§Õ øÞ”¿‘J˜÷© Ú=ÊU“e+$^SîÊäRß•w±OøÛ ÕUdu›:MŸ¬8©4õ´1fÙÀqºæ»!¼ô§ Åõ舶Wô`׊m3ØHÖÄta+» àŠT>ÎÎÆ‹%¤´þч#TdÚÞN(IñÓÖjYº YqPêm©(‹‡²ÅWJ¡LÓuÀýÐ ¨#3G?›ôEÈ#G°;tãBªæÐw;qšªÐ©'lV»AAM;üA'ô Ђ-Âá p¥[¡/êÑ‚¡#~PA÷¡¢¸„⊳–wúñ–Ž¹~nSíWó¬™PGYꞦž§Ô~JýðÌ ŸwpC¹uÙëžZ'jxzuqÕé\€¼à¥¾²¥Úºì{ÊÊvz™þ(4÷±Rëñ:H\ÿÆ͈oö1ÆxÍLjàV›Ï€yØê5n•Ô; d#h~•ø’ÄÄQ–H±bb?%ª+‹|b+îÀ É>C/ÀƒQÈ ªVF–žºuC­¾VpŒ²ýþ +Ž¾æ˜s="eôO°v>X½+ë[ûïE¬o`2 ÅA% ‹-*7ƒ€-&¢ŒtÑp8ø P2òé!çºuú7%%•=_qea8R©¨|¬¢šnU”齄ç¶$E¤šé’ÒLÃká@—”ÃV¶CsØr-ã-ÎÉOqElã±=ß—WÖ H{gn.Íö½…4gÓ4ÙÎ…´/­^LÓ­¡"c+ ¬w dž>{q…œŽíH(àW3¤wcÁo0 U£uER‰¡ï•ÎxžËñÌÿ® ŸµD•¹¨.T Kñ¦»9_+uz“dÀÕÄ£«z–9Ò[m.0žœ}oçêkQia»Êóò»ƒrsi­ÅÒEÚIÖ,iwÎ!lè +~™áH­œÃâ2W)±e’}ÝÅÂuú›÷2Ú°ù^†M£ªCTUÐvPÉÂ3Ï5“™NñÔçG‰´?Ðù{n0YÕ&k«vžlü¶v§6¿æÌ€÷1ŒMwάIL·>ž]÷>?6³hs-ú9å͵ʛk•¯g—¯¿VùFÝx“òõµÊ××*¿—]~ïµÊïgÑû¯EdÑ/n=Ùwž 5› yæ0éMuëƒg{¼¡ä/ÛË<õ?º¹SÌËn©ê3Šš+Ý,*_Ê7(Z_©èF¸Qnød +'çìí.WªŸ3ž?Eƹzªbt¡ž2!Îç,ÏÛa’á™y^)Óg¨|q·ÔK­?r‰¯s‰/æk<í€ô[úÏí†úü„†½P_d2ï~‹.!ÏAXu£ \Gýßg‚Ë,¾úœŠPÃ7o rÞY•p—â>W Ÿ´—=W ŸÉߤ@c­gø¿µ({kØ[£@¾D¼Iýµ +ì?«ÀëÊL¿q§sð|§óÆnæåãµyKòʳ´y_ñòÁyÃjW¬¶yÏ´÷Üj/‰7¬¶¿rµÍâ?ÿ#6Zñ«³ÿPKL3)6ªoË +… +†#snes_ntsc-0.2.2/snes_ntsc.hÍZmSÛHþŒ~EWR·+m$Ù²T„ª¶¹ÔU.¥’¥±=‰,ùôbIþûuÏHÙ’ï½:q,Ít?ótO¿ŒììnÃÇËÓpyóñn¹Ï"˜ð e1lïjÎ&!Kœ0M<0{vϦá—|úl"RtÞi/q€‡li C/È|/*Ç‹Â Ÿöf/hzB0Žã-‚,¡·¶År\;„'/àA{ÉBŸO‹¹;e°pcwÎP"é@ì†SNaGsèZ=Òð£o¼4sà!AáÅ­d,dÝ… ……éŒ%<7ôi" |ˆÙÜÅÙ‰Ëãà’Ô h K³˜Á-®Ê£0é‘ ÒûCî(g^ +ʼ„¥ÙÂIµm Y» ÷j¬IuË2BželÅ E»â?&øl3äK¯ÝQ£K‰‹ÄÜI*„iìÞ'ž‹³ºÙ3!Bò…4óÁ‹‚¹è6 +ÔñpkÒØMÒQ‘ïÆß jˆPŠQÀ§³t ‡ëã˜ÆÑÉèÏ$37^H}`þT±ÎÜÐcsÜ»ÝqÅ1î¾P®~ãßÒ¬¿ÆÛSw>wÉ°†mV;5s…ZÌ’(È*gsj°.êÆ)Ÿ¸^*­P·à¹Y‚ Ç÷r ÀCƒ¦Ë{:!«ð¯Ü)׊ |݃oæF F‚.ou¼ô3®¤Á˜70gñ”9ο°‚OÀêÐ8­ÄnY(R'ò}R˜}S†Iã…DDcî}—¥dkDnJ›™¤ÛÌ^ä³Ø™»iÌsáÐh ([¯ÏËyó؈OŠ Ï„OC´&ˆÂi‰:i(ÌKÇ@ÍB?ò2Ò$w`r;“@~6“v$*Í_eŒb\è&&W••©©%W‡z…›/¢„§l´âzŠ×r37MDm;ÚÂà~#´x:&¨-æÉBFôF(ó(Œ¼–_6Ú¥=­*ÌŠ•²€‡<ånÀÿ`²èºþ·,Ái•®=8qC3 ò @y¤|Áœò9*a bxA‚ÒZÅYEãoÌK…2‚a:\~zÿžö§xT+<^¹—®GÚmÄýÚGúzíÃ>;kÜ„Óâ Tg¢§’ Ù<Š±xDw80ÏY€Ö_„‹,•weøñ„`(ÝU_½¸tή®?¼¹ÑDf)jI³Hg­*WŸnœ·§¿ß¼ëÁq„2h¿‹Î s¯;æB¿§]„rrî¸/p„»Ãl>f±¢I:S‘FršåÈRGÕ\e©³à©7ÓúÛãû”%Û-dD…°½»êúq°äúÂÃå,{榘“œ:ÚÖ–(¼fYïÐ?Yœ Õ™›01€o9]ÝÍXA|¶sƉS–œ¨4”v¸±3ãX;þy—‘yYnP± å>ßÅãÒø–^›1@'@£{$%v$2Fº¾ºY žhpœ>¢I}šênj#Änaìì9úž¶fß)Éj—*L»‡N®Þ_]#Š.ï#OŽÒM)gYì9D΋äH–’ÏœžVäyÎ`îá{ˆo¼îÛ §1)å&8mtèPdþ¦Ùƒß z]/8/^p\¼@?èâ:µšµ§tV”I߅ΰ»×:ÃR§©´¢3¬t­:BPêõRçøüº!>ßÊý(Žt††vBžçRßy.hÒ+ÏKsÐ¥rõ5F0‚ö¡1úØhßwdL­¡ÜÏê täö7„kà´+à¶ÛýŽS~³d[Jñ<ÖöÝÏÅ5^®&æj ŸýâsP|ÿW‰ª+:’¸ƒ ty)ÄW0*¶¸_(‚] -ôšN ü3HØŠ„ý4 {Sö³Hô‰þÓ$ú›’è?‹Ä@‘Àq…”›bjŸ¦öq¦ò¤B²­Úø@!õ‡KH–\d§êœúrx°Êi(Çí6N–DZåÔ—H NC‰Tp-Ÿ&Þ¿ù𻣠vÀ”Üì6ºÚ]t²Rö§|lXÄØcRÖzNÆÎßËŠ~–}€çä¦Pqð.ÅÌÜ6M%«¯€–¿D\ €‘Öò ÑC3NdßùÒ¾ìWšh’þ:ÒáÖ>uØnìîšgDk?X{ª´„ÅcÝŠª“~/{¨®‡ð :Ì4­S~Þ%Çú§¦³ÅXÿÄ4 z¤€*hR·ë¾F›x†²†րׯáUÉ®dÜ4À2+Kÿu Ä7³ó9>‡÷»Gûâèƒ_a{q´tLÚôiàôòæúo"Ð x²%™ª%™Ïi(-–Ðå¼ÿÀáH­úß< ©U×þÍ=Ôܤ‡š* ֜ϛgódÆ'é]l¥‰©>bÙ«Ã.&ÌGÛX¥¡ 4Û˜-'úOöŒÂ¢ÇúFÓþ¢s¨\—}Ëg< šð¥ëÖ{*¶%ªƒE×VýÚ0Z@ðùÇJä7?z;ü6ô©|¬pñw´ÇÌÜ2-Ðt…$S®ðÈ º§¿êêB«Þ/­ö´…­˜E”6ú]Z”x?¥(ÝJîamú5ýSü“ßG4JáC­>H!Ëø|ùR(W¹UÜ+ % KåêÊ謔‰bÞPQ–Ó/$np‡?·Ã,Ž€å[Ð×YÊ;ø[ò8vãûzü=# óÂ4ŽmFQñ”³%_!KT)YŽŽt«ßÍ jbgØè~”Ã4Šmÿ´68(MëÌ­.aàÇê®o¯[p(AÎÎL³¾`_ «A«l.g ×Z4(,Ú?©c½*È÷Ÿm‘5X·„-—Š-ñúµ¾·ƒƒ’Ls suR¢z‘S¨´ÿ'—Ÿåÿl)?ÿ PK¶z(6 (ªž 7snes_ntsc-0.2.2/snes_ntsc.txt•YkÛF–ý¼ø +f-Åj¹ÛŽ½3Éf1±“x ØŽ‘vÌ,Y’ÊM±4¬bËʇýí{νER²{±3q`KdÕ}ßsŠ­‹7mŠ•¹\>^>þÚ\¿ýáÚ¼}ýÂüêk̾I®+‹‹ø®OÛÐR[{4/;çZóŸ›Uc»ÍæÏ›õͲ +»ÿ*‹ßÜ*úäpr›ÒþëG‡Ã26¶º]¶.=úÛ¦Geñcèú1Ó©Mú}\nBØ4Ž¤ôÉ#åpCßÖ_Ųxí+×FrxùöóÚÅè:óÒµ®³yׯ_™áÌìõËw¯ç¸cÛMo7îkóÂ@–ÿütçº;ïe1éú>˜½ëÖ¡Û©ÉÖb,ßnøØÅdlÓ„ÊBÇÛ…îhpÔX3ý&™°úàªT¶­M…ã'/}ëÓl¾0iëÚOß­¾3i ,FæKó×ÐãB{?Ac!W{4Éï T[hìŒßAé²ØÛÎîÅ%µ~~4µ[Û¾I‹Ï¹wÎÖÑPòCGF³÷]oÍÕ³‹•Oæç—Ï—æ‡ÚCÁévÚµß,·s¨èÉ^Qónc²÷d÷7”ßËÁI^Ñx匭?ô1¹ZÛw.º!;‡Ïá1]Ó eÀÙ‰?> s}¡(ôB.ïBªmvniÞ„˜„ʺ 6ÁÊûà[èug›ª|Úµ›\¨ÖæâjyIEñ϶.¦…Ïl³4ï·0ºœ!'éc€UàªÐž(©¾3îcê¼7»¸bŒ>¼šSÞ²@¤(œxìw×·¡oêöAâc8‘®Ûµ ÖB΀¨†F3ÛØn% Nœ/͵KTÔìpÑï›S[S#0óÝ +O×}™Ö9FyŽvæ`Ë&&fDÜÛÊ1¸| mWGæ +8Ln§E}ËÙšW` eÕ|ɬû¦9š>ÚUãfV®š$ +]+„hV¨É£whÙW¦´ÊC¢£àä5‰ \5,ßSì­íöb‰xÚ34}ò¡=5ËÖÞá ßùÆÂ4ë5R;.ÍÏãY#q6¯:÷CÒ@J˜|ä±C¤@;×"A*E4WC˜ª,|[!ù"½ƒlJ‰Ñå«­ÙÙ[9Žw8ÛùÍVãf¤¾ë’_[ˆ´tY˜]Ë_|èÛÛ/Œ§8ÄÑé’Æ.¸5¡ dÚTr«»435ÚÅkLµÆ%ѧqZ›T£ÝÒÌ^âÜÀ‡®Ì3I”ò5¥ '±d³h6+’e5ËBEëÁ¸±ïD´kÌÄzMФ)?e½xb:ªªïÎl30Rk pÆŽ«<Á«ij°’SÐÜ,(®©GèDiŽ'’Ô«jú”Sl óâò2‘â!êâ(jrg»£pP=*¸Åµô^MaFº;˜á¶…ì*ôILóoŸë+ÿ~ƒWòÁ|{b’Ø¿1¾DžKqÉõøËGÕå”Îßf£ÜŒHø“²iøqaþ]ùÍ¿9-V×0Çi™’¦%ÛÌXB˜ ÿSzäJ‘$"Ï̳ë!è +ë€ïb(‰5~‰TÒ©Ý°í¸ùé—÷7¿½úþý_fRNÞ¼z;¾ØÙª n"I–ÅÊ¥»3ßîû$7aq~<ø:m™¡6Xï‰"}$zP9÷Ñ2§ë²€/%ù˜†CVòñÓg9IÇAá^Áåä,ÀS*ˆ¦!"kjJé7$§»p¢I‘™ä* áô¹!̳¯.ÍÜd>ߎ,4ð> Eˆ—Î¥`âLv‘,ŽêÜv4 bï@ã–…Ô¥ŠÉ°ÐºÎìøGïXèóÙÀ´` ƒø¾_8»,îQã^#‚×R›Ÿ¨x„6ç ÊxäÀ΀Ì20Š´¸”Û°ç=óåÝÖR€³æKçÛ›=ßNå—?ës¢ÑÎ&†£oû¦!×$B¨[Bk»Í˸¿ðÂ\áëWrë¼Ð{pX7<¸B€š´$§ji^­YZ7î&£›¨­•D›Eç Ú!GPÂÛ½K„¢‹K–s‹’4]'=Z{¦«KÖ“ Ò^²½S‚!H=èœbô½=|hE«‰• Lý¾f‘DŸ˜:Ë©^Õ76šÙ顇̈¹ùƒy’K0¿Ãñq( ähǦïÏàÿÍÖ<~ò§ùg©}æg¸* èK:t«ßˆÔRš“AÌO°¹W]~* öÆ——yÊá3|e£G‰f`7ÉcÄ#eqÅS§¢J÷>^"äó»`ÏSg6þÚÌ®ÌCÊ &4ßÒãߥDU;·AUmX8´®•Åi@ U;§Ñ1oe*+‹O“¨F÷×Ø£«,53¦” q= qglx8¨zÚ(#ÜŠ <”½ å/ö{g;¼e€‹{e|Ø1thž€°í÷÷¤Næ¦uËQ}+4¥(nª¶b‰mà×ÐzPyáK·FC¼•³¼;1-'¨VŽ¤vNÏîøz®îbHàÖˆñÖï÷¹·ÈèÀìå×løè´‹‡4M=•V8„øÍú»‚Ú¸¬>–BkÓ‚¡b ödïõÄ ÷hºd9Û Š¡Ÿ†¶%!³§'‚NC' Ϲfˆ>æ]ì5"!mÕïàK²®8†Â1ã°°@¹êRÅ^KüQ +‡ +Ða$xä|:‚×XfmϼA{ ªë°25¹Eãl9 ”înU2W¯g!ÇäÖ¾MÑy#™Ež°s«¶âZ-$;×O@UÒ@RöÔahþÑ{Ô(—ŽíÃäI¤¶3£ÅËâ“”ØRNDÿ1Ï㤠s¡Òâ Ï ŽUô5\(Å|œã0ÀQþCŽ€ì£q>güúæ$ò!(äšÂŠ,šmr˜&Êë¼I}d®ô;X/g!»eM[H¿àÓxí8J™a¢„BæLñç ç¾ {^“¯m‰•kRÜ°¹(a­_…ìžmý`Ë3¢“·ÅVMƒœj$NiíéZ¡æ„7Ìžy`•×Â1ù½ áVSuÓYß%cEHµÿ`SªÑõm+[¯ï68º¸/Wý”¢Ð¼vv„î!˜*Gçä.lå𢇽²Ç;ˆ|ÌS]\…]) =y &ó¿ IG*9IëH:ßo½ÿ»éÈu÷_ê¼f}+Uª°ÎýeqÞ`Ì+”Žþ‹‰^Ù8Ý© š‹Ú OŸƒÏ=»á²ÈëGéÒóÄŠÞrè–jM5£Ò-Á'lǵƒ.‹“n?¬<ë2ÆKò0>™ fWOÑð=[0Òž<¾X± `•7_ˆ?.‘÷U¦=BˆÄœm­èf›aq½e¬w=ñ&B©‚™Ì¨@Ýwü_¦¢ÿ†ƒ–®è«SñäŸå–"Ð8¼"¢ ¦–~ò°,†±X¾®ó Ä…݃y{*Áíw\oê´©çâ¹È ËÜÌpÚ qäZŸÈX1 º +ID «vÕ¢žº÷ùjf–Ëå ¸ˆí†ipþûòï'_®þnæ(øRŒë¡×£®p +Ä~jîÑz&Ï#Êú—¡—Fz2ÏPó‰›4qïCsh?`œvþwÆdŽÈSÉNýÀ›Du¡džüR„®vÚÿ*´Û©;T¸!O _SþyU¶s¶yI6­7h¿:ÿZÂ2Œçœ½ÀÓ?^#–ô&S‰35߉¼ôìòñg‹‡_ÏvJqjtïpYÖÃ$' +±ãAA¾s2ƒ·±Ø·´>(ý…©ÆœÖ_^I!pN G€Ô©BÇÚö|%3l•4-®ž ?ÿ˜ÙW¥åY˜§úyô0_•…|]a0×ðãe}¤×øý°þæ9|õæ¹úAÒ/H¦e™ÊZ¿m«¢¶Z½â. ûÙJÔÄñSø2ìAÑ>ßÙš¡…!Çä{dóíŽÃwŠ÷Ö~öœò¯ûVðEºl†=në–¢!¹Qz°`š‡´Éí…='P”_™H‹²rf`.©Gäžþz¥«XH+4ˆ$9±bíîH¤ß)\ÃÿDH•¦­PmìFB}yªÎ‘ÁüØ9ÿÁÌ@%…½·2s`o.—_`eÊ™Eï{šK”ë7×æ]ÓÃ@ù °Œ~Óúµ‡³¸ßHO‚þ#Ï1õ‰Hñlºµ 4·SÅVǾÇâƒÈt&ÑÞnr›ýM~ÌÆd¼›ëœ?0Qû[Ô¡fByzÕ”Åÿ÷ÓõÿPKkW%6grïª"snes_ntsc-0.2.2/snes_ntsc_config.h’AOÛ@…ïþOâBZ8õ@B¨Ô%î¡'kíÌÚ£®w#ï.Áÿ¾ã¸ ª€„díafß7ûžçü 3g5W±%.ZÕv(:4nǺc[!Ôì¡ÙÎΓ䄵ݑÆv5ßæ«l;ËgëÕâ~™ß%'RgKoµ³pm£œ†w±- {~"ã{êkåý*_¬7?n²j›åtrÕ“>v}ºÜL.{z/Éj‚vƸCoIiMe@bÙ„OlQZ8kºk(”Ñ×¼”Ke“ZÙ!‘ ãvz”” ~ü)6í’F:I*0 snes_ntsc-0.2.2/snes_ntsc_impl.h­Z}SÛHÒÿŠ¹ÝºœüŠeÇ„¬CªKê!Àsw©lJ%Ëc¬Š,Iøvó|öûõ¼i$’ÛçaÃ"Ít÷t÷ôôÛh¿Å²˜g^œgë÷ø-ó|ýËþþýý}/‹üàK/æùþÿúq¾ÏZûPN’Õ*‰Y¸ZG|ÅãÜÏC¼& v1½>a‹0Êyš àŸÃ8ˆ6sÎ^ùYÆÓ¼·|m­ü|‰Es½MÃÛeÎœ“&ôûìzéoÙ»”ó¸Ç¦Ë0c«d¾‰8ÃÓ£,Kù½Ÿò1Û&›FàÇ,åó0ËÓp¶É–3?žï')á…‹- lâ9OY¾ä ,®2ð,^Þ]Ü°sN6Þñ˜§~Ä®6³( Øyð8ãÌÏØšF²%Ÿ³ÙV`½%&®%xK@\hbÌxˆù´ñj Í z®ZIÓë0°åø9qž²dMhM°»e‘ŸƒC‰©änrñÀE ŠËdÍñZï>Œ"6ãl“ñÅ&ê0@²žMß_ÞLÙñÅÇÆ?'“ã‹éÇ1 óe‚Yþ• :b7C…0)6{K8œ¼üñ›³ó³éGbúíÙôâôúºñörÂŽÙÕñdzvrs~&–¯hΖþWŽ xø\ù,HÖÄÓÓ¤f¿¢$¾BÁ˜Î˜… 'y‡Ý§a6“'7²Ó8‹ƒ^‡\€øñ—*¿Î oÃh¿’$í°7I–œ}8fýëö»î°ï²›ëcyæ|Æœýzv}üæüÔ;¹œLNO¦g—¬Y²É»:ÓpxdÞûܽŒ†£Ã—/^ÃÃç :P ~~óáØ;¹™^¾}ÛØSˆö æ~ãgÃò Ò­¿Zù^þ›8Ås«ðéíÌ›…yf Í;¬Âúi.ü ϼ•ÿ`ÊÃ̱^Ã9k1·7Z4«¤ißâ_‰’•„ô›¢3¨¹žþ꽿!e_üzFº6”êSËx¾Y³¦QA±iü!÷æ6§cûVx^xÑh³ò™³mªÈàƒí ¹E‡¼à¬XbXúå4‰"˜>sæÙ¢)@J.5- ÚsÄTS +Û}-ýtM†ÁZfªßëã +8‹%HÔ'Öɽç{1æ>8zÕŽDlXÙfE/a ³KQî6þ<¥ÍðzM2ç ¥ ›€³˜ßbÌ™E›”L´ÉBn¹´8Špâªòa“hC1ˆÎ­WÀR|ØüÂÛ®ŸF tË,B„„<ø÷ˆ5 Awð+ñ1ƒˆ8þ&‚Îx,Ò?Úh (adÇý1þ¼Úå30ÑnÃ2÷hó¥îÄ©èÚÐàI+DKø`ñ-¦ÁJˆ]ógaRjp1Ì7Œ­/™¥P[DI&¼ÛëƒoÁ, üñ‡1×Z‹5:°§^YÖõòÐ%Y„0šc½šG'ÛgGúÝÚÌ8J°æ؄߶ݭÐè†~ Jjß5AÖ®B?Æ#»°ÌÔÙÁNǻة½·õ{±T‰L†+dÛ'’4õ´¹•mäC  Óµt?„¾5ä¯<~8sіͨDYù16?ž'÷”ò³éÀÊǃ°Ò?a´F¬qì<;,ÒhXX±a‰–é=@’ ¶#´}äµëSDVìd¿ ñß*±ud„ +ÅÅIºò# +$KMt HÞîÿvȈK! ì˜ÖKïÉ‚ÑaöôÑQéµ)|TàçÁ’LŽ§!BŸí( ™”ü[%dË4¡ ÞU¢Ö­¿É²ÐK‘«:‚MNçÒ$…¨]Š<î`´ÐÑBƒÔýú,â|^Š# é‘4Æ+Ö/t¹Oi _Sš¢ÐVî×AŠ%1N@Ì}p¿^CDg*‘DÀìeS9=IÔ+ŸÆv°;ìK é÷F mWZÜŠjº +x•ñ–E»de]Ë>„Á•RQmix21iú…ÚùÚ(·Ä¯â²9®ŸYû¤¾ùœ­—~Æ3ìÙÚ'k‰¶„¼ÁN_¡ý9 xRÈ2üñç•}@0@G|@”ô‰/Yº €ßÚ!ý¯H .;pÿ'®ðÔôÎ]coB ‡ýD¹â/¿Å?Ñ. +µ9ª­¸BÑ¥¿.@¦SpwÖJtÄw®Õ¯­ðãÔIºJòÒùÓi·A ÀéxáLî9U7j;A[gà­åÝÒ’Ql‚4ÞµxH‡µ«44Ý‚¨ +PÌØü£†ýò0q¯Ÿ%óæU®[_¶JÀ HÆ«ø `w¤ kS—]œj2xøˆj?%IÑÀ!¿ÆšÕ4©höË)(»/“h6«%º˜Øîp84A¡] ÐÙµªÉW"4ò‚âêäoÆ– aÓˆ‘ƒ‘"qŒ“¬û@ Tz³ŠVV( ýX™uh ŽZŽ*…ÊYi««×eâ¦ÚåÂH6ÄÛg•¬t¹ÙÑA ÁÕ,mÙ/pQW»™V{¿5ܤ¾îBT¶§eø:Òðš²`ôal\†/%ƒYuÓc]¡?ѤUY’è»YÂÕ۲ݪ¼¦ªdl¶èaìFi¯H+V]°¢L«ƒÕ¸l‰šX›LŽâ\Ñ'•øóD‡×Š¦ET´TT¤C¼*L‰jp…·Â¸ÝÛ£w¥Ñ"Ë Y71wMfº‰I“Rõ°¬¶Ï Y¼tô3K¹ÿEÂYÍÖ -VŠÈ‡ýÁHÆâÑBe›mwЇð·¸wÉLzY[Z%œ” ìën¯paÒ€K1“wo¼é¥÷‘–Nq6; =ÞmR6™ƒî¬³¥N›Âµ ^¾¤ZÕ¹•¯£Ãâu&_]÷ù¢Ù!œÐ½<€»28ƒ#¼œáÀU8f w`ÃC{¡ øßÍBpN@|«^µ45üE“¾#äRâ¤Äâu ººMßÿLîÈpiàN°vûΠŠ3,pvÁ?¯Â|Yœ«ã“ÿ!aÌn€q¡›W¨±\ö#ž]ñ<“ÏæFD$1V¶ª–. +QàÝƸ¦®Ý‡¨ëŸŽéÊ¥e¥sfF8y»®@Öá– ãE".BÄ¹Ô šÓ²hÌ@ÚBçì›A"‚ÓÉÙ››é©ÁE`ð¶N¿¿°/P…À?¾*¥ŒUÝ,ðuh¾$O&ˆ±öãÅI“½~ K&* +ëÐ4û4éÂwãÚXÝBæ‚¢%•+Fg;Gƒ£a¡Ê‹å4Ý7 æ›Ê‰ËuúÕñùé +»¼A>.NHy $ilSÖÆaeH¢tçÅ!A²fk‘¿ZZjF€\ãkV¾[öNÎ?\yŽê0çu‹OöK9ú⊱´6 +V…'´æÀî÷€] xð=`FÀªÉ1Ã…›Ì/é£á9ÌâÓMžQ³0—·PBŸ€p<ŸÎžxy¥eÊáÑß×é™kùÇþ²< +WØñ9Éj6”LÆûõôjú^xÄ©Š›ë÷“©÷áø_tµÙx‹,§«z£ù Ù·]‚‘IåãB”Ÿ¥ÿtû|ÐîÂD(ˆæËO†Yé2ÔÂg•uY[ÐÙ½4‘9¿¼x÷ctèèa8xLõ÷?PK@?&6âæSWœ6ãsnes_ntsc-0.2.2/test.bmpí½sÛ8Æ©Û¢hY¶bËJ²‰í`fÿ‚+3W¥¹™-Sn™2å–[¦¼òÊ+S^™2å–)Ýmf®¹rKw¹_|E€ ¾„"™|e +¢$Bø=>%Jþû?~þo&âçƒ,û‰ß˜dÙŸ"9â{bç¼à¿Snß¾}Ë>ýše}|›­þv—½¿»ÏîïïáÁ°}‚í>ûüùŸÙ—/³¯_?g÷ý/{ÿËiöå?ï³7oÞdÿþýu–ýOû#Ë>ÞÝñ§gŸ¿Üg«÷°½…<~SÙdð¼ðàOŸ²7pßêÝoÙÛý‘ýòùkvÿáCv÷î]v÷úuöëÇOÙcŒ±`cTñr¨û/_vÿ%î‹[ãþÐöE vÿÅc }|9îëd`ûØ/ŽûƒßÒ¸?ücŒ1N~Æõÿ¸þüþ¸þrü(BÝÚÿýãáás€U<ˆýJÿ(Ž~þü9ä òÙÿ}Ø*üëÆ>;;ƒD>û¿Ï7.@Øúÿ9-CÞÚÿ}~ƒØú÷ì!ÆÈ/À&¯cŸ=¸àè.ÐeÁgËØx%®ÏÎ VžXÁ‹ž1ƒ0É[* (¾™Ù,6˜ò?!ÿ«W¯6ø{€Îã?U€“¾ óK&?š¿ƒKäß)ß³þGþ‚É0ó0Û’?‘tþë_àŸÊ‡Æâ/DûO,@×þ/˜¿˜Jÿíb¾jÛ‡"kþï/€Íß>î×üð`÷r-û² ³ò$µ‰Ç?Ù¬>ðL»÷¡˜ðj’ÿû `·ÿ`þ)@õxªÂ/\ûà½äß1®Ú‡@lÿâ"ÛÀRiÁ|©z¹¦ù_=¶*òûÖÿØþåeÊ„Yp%ímO[ùóg 6ì†mµ ØúøQÆ_WÔƒ3oŠüMà)_ò³í6lÿaë_ôâ^s2á%>3m¦~AžËëž8IÅ_àøx0xqW +¯ Ó6þ§ºùo{&ÈÂ×ÿ–ÿSÎ/H'ŽT¾O[ÚÿSÁ}ss Í?ár˜>þÛþOƒCJÒÀ¯Zþõõ ·Ÿ: šq*/åiY–#Ê(~Ûÿ"4àUû¯YóxIÄ?ønþP +Óÿbxàe?»åuÿø{@hàÜú¿0ý¯ý8´™_Vþ[m?]ä÷û±þïì? +PñÛõÿææÊÞW PÎïÜúßö?* +ä·èþ`þÓG @~¿ÿqëËÿY\L ×þ‹´âü÷¯ÿûòš€«>ÓøtºùïÎþ£Žà Ÿúh|ºÚ¿? ÿ{ãgœÒþÞõ?nýOõb5Æã) €½¾!èÜúŸâ?òÛ}?K$€ßÿ¸õ?Ñÿ‰ÉÏWþ°åIj@ôüÏ¿þ¥ùÏ翦···,Wü׬ß÷Íù‰ŸîÿÄæg7›üý +àÄúŸæ¿|½¢.»Ë~Ñþo›øOi$ÿ'1u†Í/ noøO©˜þ›å‰ã·ýo¦/Q€ºÿfy¨ëÿ&ü™ûRÉ^ñKDz{c  Ný7ËC]ÿGºlúÏ áüè\I Íâúßæú¶0»(¢çJ°f|ºè¿ÔõCí÷ó›ƒ@Î/6ÿ~QÐùØüÔõ¿e¿wýg `ûoãpúß÷ø? ã·G¾h´Y—ÿ´õW~{ÌÏŸIÀá?uý?‰À˜}T +4Œü•ùý `óÓÖÿ]ùý +œ¢ùý ÐÀO]ÿO"°?kP`³á÷*€ÍO]ÿOìˆáùA±lxI߯DþÐõ_œÿâÂq[à1h!›ŸºþŸ4F?æWVѺr$ xü÷ÇqØgåÎ(‰ï™å¡­ÿ“ðCÞmþ÷+@µþß¾ÿ²1ØѺ‚,Oz€´þ§ðËÞÀŽö÷Ê“ž ¯ÿéü¶ûmþ÷,iýOàw ž÷ÊÞ¯I@[ÿÓùíÚïáïY€ õÿýŸùø©0&X¤õßÆç%×ÈOò’×üÏYèïþ§æg„È늟"€ÆéFÿü{Éý/Lü\Ÿ®ùI|-òƒa¿~ü7ðŸñ o(~‚üR€°ß H?þuügâÝqP ×üÝ@ü3[ö{†ÿIæ¿õÖ¥>©¾?ÔMo „‚?"¶²þÛìý—’néößQß @¨=ûïWÐeõ§È*þ®|v‡ÿÓá„ÇüY~ÅC#%ìüûò§läIùÎ0jôßÁâ_åûñÕÙq¬…?è=AoÏÏÔ$  ç·ý+¶è „OÑ÷ ®DÕk ìMQ‰¿)€ÂWüÿaÅÒõ2mÁ—ü€yy Ýà2gN~¿¼í/©Ä×tö’ ðŸ±õz}yÀ\üAo‹Ë¯ëšp| «ÿ@ß9ŠYkõgÀ¿>„€[~g'ˆ=¿!€ÂGºùµŸO[X¯þÑz€+@\ün°çWûjÇz'´“ÿ$üY«ÿ^à­Ÿ²Õt…r"ÔÈï`³çW÷h|S€.þÃK¥€›¯ð¹ÿìJNƒW0hâw +PëùÕ}ß ÚÿÞù1N¿>±.àé+>°$W¬‘ßñMfß Cÿß/>æ¿ã9ÿá|>WüË\\/›ùm¨ð›(£ûÿdÕŸ§???Ÿƒñ~~[ÄG4¾SØù_Ïøè?7è¡ÕŸÏ%ÿR\-íÀ±ø†¿MÈù|èþ>ËËÕ•`wòÛh|SïQ  ÷¢W|l‡À¯ðáïjµ’ð9+Í"5¯m|ìù$(ÃüÑ™¾uü?üóù%—`•ç\€<_Öæ@îå0Ÿ4Ú¡f}¡˜ÝAú÷0ÿùùz ÿ¡ä£¿p•Ïýp|k%àiûþ!1åû?öúOÄÅžäø…^ûà•Ÿ×2 ŸÆŸþóÌ_Ò>§f+ÎgAxm@üñŸ®µúKþ'Od5¸Š`ôoôAÔñwÇÏ8‡Aÿ‚ÓÃT‚K¶\Uþû[«Mƒwü÷Íÿ`èŸ_\róŸð¸,dÓ÷ `Oƒ*|:ÿ4ùçèž þ‹œ ~ˆ®hü}ò +ˆ¶¡ú=Š +ŸÎ?ÛšÿÓ¹˜ùƒÐï‘Pøtþíù¯Añ¿ÿoóû@"¾?€ þ>Œÿ˜¿à\áÇ(PûÚ$âïËø€ùŒúþW|ßßÿü×Ì_¼ýs°ÁóýñÛ„ Ž¿Kþ·†•ÿñbãÁà勉›æ‚w/Ö˜ÄóË*6^À½ÏþÇ>ꌇì?>¿í|ƒ÷6søûýo=ß`§ýŸA4ûûýoÿù½ÝõùlÿññŽþ£»ëÿL„•¿g¾ùyd±›þ#Ÿ‘¿—?öóèé`ýWÇÓù-|ºÈgåß³ÿ³^ýïŸßÊ¿gÿg÷¿Çþÿ˜î¿=þYùÇÿÛà¯Wÿ~+@aå;þ{ð©üVõïµvóªÏ;ø¿ôùo{õ§¯€Œüã׋íø;ë?†í?Éÿ^Ö¿tüv$#/?áûÿEñRð×ó÷?¹û÷àªÿðpßÔó÷ówÿ>Dਪx)øëùwòñsüÑütü +ÊßÉtŸ.€Í­3 ?æÆOü>BÑÑY¼D`þ~~ê÷¦‘üt|åÇïä?ÇOXèøí\FþÔùŸ?"ù±xiÀü;ùŸœŸŽd>üný?ß/€.^¿£ÿéùéøÈvlá×òï6ÿ#àûùUéÒ(`Ñw›ÿwÇ÷ ù÷œXÃ[ô×ñýü“q¬¢Ãb‘ð}„NoLRÙÿàxü¶ÿi ç”ö|‡Îï?_ Q1ÊÝäß’ÿ(9ŸÔŸ'+H¹“üéýG†ë? +@Í#ùçÅ)£Ü=þ­T` þ£Ô ’Ÿ/°×A?_`ƒ~¾À@ø1¶^ýwŒÿùO?_`€ü§úÓÏ"ÿƒ©þôó.ÿZ?ý|‡,ÀCǧŸ/0H‚Ϭ>Òÿ`cÃÁÿ¡1˜<_`pø(€¦¿Ñúå}‚~øæùòÞê£Ä•Ñc;ŸþH%ú¸v~VŒ»ë©D¥¡Š¾k#ÁŸ3±©ÿÓ»M€G|Ããª0Šƒ "G‘kÿ8F$Uê,®ÊJ¦V–—'måwçÜ“y·ð‹°Ž›È×Õ©Åwãq’’ÚÖRÜ\×UVýÂÕµ¸†O?Žï:ËSç‡M$õŸû­êS7Úê¿Ì¨ò_âšü4ÿ[ñE4Wmȯ +,ÿà¦Å¿é9¼Ý|¬¹z¹:?±ý»ñUèã|üìñãÇLÜ„û ~£ÝOZÛ?–O$š[×Ú‚þ%Ø<sðçùc9ò›¯ØÿWcÿ¿y>ž"¿9l~ÕNõ5òÿq_%ðW¥bsÈè—•ã5òÁÆ“C2?–C]9æþ\=âÏ…þªTo¸æatTÝ’¿þUüø«RcjØå°ûÑðCÛ¿"< þê¾,cMøû¿Ã#›ßWjÔ>b9ìùdž1üjÓŽ³ú–² ?€W€ªú·ó‹«æîß.âã¼ |ü«Ì‡c€_$) â÷ÏTÀã°º»VîšïÚ¿wþáç×õ^Ü4ùÅ•Ÿ?tþ{w»çÿüo¡þ»Ö-á㿪òLÝ׺¾çïÿüë&§pw?¶Ÿ®y‹NG@ýL=¤è´ÊÐ;þù׿X¶¶õ/¾vÈhßÿ°ïîû_úC}ÿs2Plü!~þQ{Êà>ÿšŒ1ÆcŒ1ÆcŒ±ø?PKNo(6íAsnes_ntsc-0.2.2/PK39&6SÀdDçȤ.snes_ntsc-0.2.2/benchmark.cPK8o(6^©@º ¤Nsnes_ntsc-0.2.2/changes.txtPKq5)6ÔOÜÂÍs¤Asnes_ntsc-0.2.2/demo.cPK\5)6ÍE*U›;¤B snes_ntsc-0.2.2/demo_impl.hPK&h­2…¤}ûõ#)6í’F:I*0 ¤—`snes_ntsc-0.2.2/snes_ntsc_impl.hPK@?&6âæSWœ6ã¤qsnes_ntsc-0.2.2/test.bmpPK ¯ð \ No newline at end of file diff -NaHudr snes9x-1.43-src/snes9x/ntsc/snes_ntsc.c snx/snes9x/ntsc/snes_ntsc.c --- snes9x-1.43-src/snes9x/ntsc/snes_ntsc.c 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/snes_ntsc.c 2007-01-08 13:40:46.000000000 +0200 @@ -0,0 +1,251 @@ +/* snes_ntsc 0.2.2. http://www.slack.net/~ant/ */ + +#include "snes_ntsc.h" + +/* Copyright (C) 2006-2007 Shay Green. This module is free software; you +can redistribute it and/or modify it under the terms of the GNU Lesser +General Public License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. This +module is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +details. You should have received a copy of the GNU Lesser General Public +License along with this module; if not, write to the Free Software Foundation, +Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ + +snes_ntsc_setup_t const snes_ntsc_monochrome = { 0,-1, 0, 0,.2, 0,.2,-.2,-.2,-1, 1, 0, 0 }; +snes_ntsc_setup_t const snes_ntsc_composite = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 }; +snes_ntsc_setup_t const snes_ntsc_svideo = { 0, 0, 0, 0,.2, 0,.2, -1, -1, 0, 1, 0, 0 }; +snes_ntsc_setup_t const snes_ntsc_rgb = { 0, 0, 0, 0,.2, 0,.7, -1, -1,-1, 1, 0, 0 }; + +#define alignment_count 3 +#define burst_count 3 +#define rescale_in 8 +#define rescale_out 7 + +#define artifacts_mid 1.0f +#define fringing_mid 1.0f +#define std_decoder_hue 0 + +#define rgb_bits 7 /* half normal range to allow for doubled hires pixels */ +#define gamma_size 32 + +#include "snes_ntsc_impl.h" + +/* 3 input pixels -> 8 composite samples */ +pixel_info_t const snes_ntsc_pixels [alignment_count] = { + { PIXEL_OFFSET( -4, -9 ), { 1, 1, .6667f, 0 } }, + { PIXEL_OFFSET( -2, -7 ), { .3333f, 1, 1, .3333f } }, + { PIXEL_OFFSET( 0, -5 ), { 0, .6667f, 1, 1 } }, +}; + +static void merge_kernel_fields( snes_ntsc_rgb_t* io ) +{ + int n; + for ( n = burst_size; n; --n ) + { + snes_ntsc_rgb_t p0 = io [burst_size * 0] + rgb_bias; + snes_ntsc_rgb_t p1 = io [burst_size * 1] + rgb_bias; + snes_ntsc_rgb_t p2 = io [burst_size * 2] + rgb_bias; + /* merge colors without losing precision */ + io [burst_size * 0] = + ((p0 + p1 - ((p0 ^ p1) & snes_ntsc_rgb_builder)) >> 1) - rgb_bias; + io [burst_size * 1] = + ((p1 + p2 - ((p1 ^ p2) & snes_ntsc_rgb_builder)) >> 1) - rgb_bias; + io [burst_size * 2] = + ((p2 + p0 - ((p2 ^ p0) & snes_ntsc_rgb_builder)) >> 1) - rgb_bias; + ++io; + } +} + +static void correct_errors( snes_ntsc_rgb_t color, snes_ntsc_rgb_t* out ) +{ + int n; + for ( n = burst_count; n; --n ) + { + unsigned i; + for ( i = 0; i < rgb_kernel_size / 2; i++ ) + { + snes_ntsc_rgb_t error = color - + out [i ] - out [(i+12)%14+14] - out [(i+10)%14+28] - + out [i + 7] - out [i + 5 +14] - out [i + 3 +28]; + DISTRIBUTE_ERROR( i+3+28, i+5+14, i+7 ); + } + out += alignment_count * rgb_kernel_size; + } +} + +void snes_ntsc_init( snes_ntsc_t* ntsc, snes_ntsc_setup_t const* setup ) +{ + int merge_fields; + int entry; + init_t impl; + if ( !setup ) + setup = &snes_ntsc_composite; + init( &impl, setup ); + + merge_fields = setup->merge_fields; + if ( setup->artifacts <= -1 && setup->fringing <= -1 ) + merge_fields = 1; + + for ( entry = 0; entry < snes_ntsc_palette_size; entry++ ) + { + /* Reduce number of significant bits of source color. Clearing the + low bits of R and B were least notictable. Modifying green was too + noticeable. */ + int ir = entry >> 8 & 0x1E; + int ig = entry >> 4 & 0x1F; + int ib = entry << 1 & 0x1E; + + #if SNES_NTSC_BSNES_COLORTBL + if ( setup->bsnes_colortbl ) + { + int bgr15 = (ib << 10) | (ig << 5) | ir; + unsigned long rgb16 = setup->bsnes_colortbl [bgr15]; + ir = rgb16 >> 11 & 0x1E; + ig = rgb16 >> 6 & 0x1F; + ib = rgb16 & 0x1E; + } + #endif + + { + float rr = impl.to_float [ir]; + float gg = impl.to_float [ig]; + float bb = impl.to_float [ib]; + + float y, i, q = RGB_TO_YIQ( rr, gg, bb, y, i ); + + int r, g, b = YIQ_TO_RGB( y, i, q, impl.to_rgb, int, r, g ); + snes_ntsc_rgb_t rgb = PACK_RGB( r, g, b ); + + snes_ntsc_rgb_t* out = ntsc->table [entry]; + gen_kernel( &impl, y, i, q, out ); + if ( merge_fields ) + merge_kernel_fields( out ); + correct_errors( rgb, out ); + } + } +} + +#ifndef SNES_NTSC_NO_BLITTERS + +void snes_ntsc_blit( snes_ntsc_t const* ntsc, SNES_NTSC_IN_T const* input, long in_row_width, + int burst_phase, int in_width, int in_height, void* rgb_out, long out_pitch ) +{ + int chunk_count = (in_width - 1) / snes_ntsc_in_chunk; + for ( ; in_height; --in_height ) + { + SNES_NTSC_IN_T const* line_in = input; + SNES_NTSC_BEGIN_ROW( ntsc, burst_phase, + snes_ntsc_black, snes_ntsc_black, SNES_NTSC_ADJ_IN( *line_in ) ); + snes_ntsc_out_t* restrict line_out = (snes_ntsc_out_t*) rgb_out; + int n; + ++line_in; + + for ( n = chunk_count; n; --n ) + { + /* order of input and output pixels must not be altered */ + SNES_NTSC_COLOR_IN( 0, SNES_NTSC_ADJ_IN( line_in [0] ) ); + SNES_NTSC_RGB_OUT( 0, line_out [0], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_RGB_OUT( 1, line_out [1], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_COLOR_IN( 1, SNES_NTSC_ADJ_IN( line_in [1] ) ); + SNES_NTSC_RGB_OUT( 2, line_out [2], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_RGB_OUT( 3, line_out [3], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_COLOR_IN( 2, SNES_NTSC_ADJ_IN( line_in [2] ) ); + SNES_NTSC_RGB_OUT( 4, line_out [4], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_RGB_OUT( 5, line_out [5], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_RGB_OUT( 6, line_out [6], SNES_NTSC_OUT_DEPTH ); + + line_in += 3; + line_out += 7; + } + + /* finish final pixels */ + SNES_NTSC_COLOR_IN( 0, snes_ntsc_black ); + SNES_NTSC_RGB_OUT( 0, line_out [0], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_RGB_OUT( 1, line_out [1], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_COLOR_IN( 1, snes_ntsc_black ); + SNES_NTSC_RGB_OUT( 2, line_out [2], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_RGB_OUT( 3, line_out [3], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_COLOR_IN( 2, snes_ntsc_black ); + SNES_NTSC_RGB_OUT( 4, line_out [4], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_RGB_OUT( 5, line_out [5], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_RGB_OUT( 6, line_out [6], SNES_NTSC_OUT_DEPTH ); + + burst_phase = (burst_phase + 1) % snes_ntsc_burst_count; + input += in_row_width; + rgb_out = (char*) rgb_out + out_pitch; + } +} + +void snes_ntsc_blit_hires( snes_ntsc_t const* ntsc, SNES_NTSC_IN_T const* input, long in_row_width, + int burst_phase, int in_width, int in_height, void* rgb_out, long out_pitch ) +{ + int chunk_count = (in_width - 2) / (snes_ntsc_in_chunk * 2); + for ( ; in_height; --in_height ) + { + SNES_NTSC_IN_T const* line_in = input; + SNES_NTSC_HIRES_ROW( ntsc, burst_phase, + snes_ntsc_black, snes_ntsc_black, snes_ntsc_black, + SNES_NTSC_ADJ_IN( line_in [0] ), + SNES_NTSC_ADJ_IN( line_in [1] ) ); + snes_ntsc_out_t* restrict line_out = (snes_ntsc_out_t*) rgb_out; + int n; + line_in += 2; + + for ( n = chunk_count; n; --n ) + { + /* twice as many input pixels per chunk */ + SNES_NTSC_COLOR_IN( 0, SNES_NTSC_ADJ_IN( line_in [0] ) ); + SNES_NTSC_HIRES_OUT( 0, line_out [0], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_COLOR_IN( 1, SNES_NTSC_ADJ_IN( line_in [1] ) ); + SNES_NTSC_HIRES_OUT( 1, line_out [1], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_COLOR_IN( 2, SNES_NTSC_ADJ_IN( line_in [2] ) ); + SNES_NTSC_HIRES_OUT( 2, line_out [2], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_COLOR_IN( 3, SNES_NTSC_ADJ_IN( line_in [3] ) ); + SNES_NTSC_HIRES_OUT( 3, line_out [3], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_COLOR_IN( 4, SNES_NTSC_ADJ_IN( line_in [4] ) ); + SNES_NTSC_HIRES_OUT( 4, line_out [4], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_COLOR_IN( 5, SNES_NTSC_ADJ_IN( line_in [5] ) ); + SNES_NTSC_HIRES_OUT( 5, line_out [5], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_HIRES_OUT( 6, line_out [6], SNES_NTSC_OUT_DEPTH ); + + line_in += 6; + line_out += 7; + } + + SNES_NTSC_COLOR_IN( 0, snes_ntsc_black ); + SNES_NTSC_HIRES_OUT( 0, line_out [0], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_COLOR_IN( 1, snes_ntsc_black ); + SNES_NTSC_HIRES_OUT( 1, line_out [1], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_COLOR_IN( 2, snes_ntsc_black ); + SNES_NTSC_HIRES_OUT( 2, line_out [2], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_COLOR_IN( 3, snes_ntsc_black ); + SNES_NTSC_HIRES_OUT( 3, line_out [3], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_COLOR_IN( 4, snes_ntsc_black ); + SNES_NTSC_HIRES_OUT( 4, line_out [4], SNES_NTSC_OUT_DEPTH ); + + SNES_NTSC_COLOR_IN( 5, snes_ntsc_black ); + SNES_NTSC_HIRES_OUT( 5, line_out [5], SNES_NTSC_OUT_DEPTH ); + SNES_NTSC_HIRES_OUT( 6, line_out [6], SNES_NTSC_OUT_DEPTH ); + + burst_phase = (burst_phase + 1) % snes_ntsc_burst_count; + input += in_row_width; + rgb_out = (char*) rgb_out + out_pitch; + } +} + +#endif diff -NaHudr snes9x-1.43-src/snes9x/ntsc/snes_ntsc_config.h snx/snes9x/ntsc/snes_ntsc_config.h --- snes9x-1.43-src/snes9x/ntsc/snes_ntsc_config.h 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/snes_ntsc_config.h 2007-01-05 10:59:22.000000000 +0200 @@ -0,0 +1,26 @@ +/* Configure library by modifying this file */ + +#ifndef SNES_NTSC_CONFIG_H +#define SNES_NTSC_CONFIG_H + +/* Format of source pixels */ +#define SNES_NTSC_IN_FORMAT SNES_NTSC_RGB16 +/* #define SNES_NTSC_IN_FORMAT SNES_NTSC_BGR15 */ + +/* The following affect the built-in blitter only; a custom blitter can +handle things however it wants. */ + +/* Bits per pixel of output. Can be 15, 16, 32, or 24 (same as 32). */ +#define SNES_NTSC_OUT_DEPTH 16 + +/* Type of input pixel values */ +#define SNES_NTSC_IN_T unsigned short + +/* Each raw pixel input value is passed through this. You might want to mask +the pixel index if you use the high bits as flags, etc. */ +#define SNES_NTSC_ADJ_IN( in ) in + +/* For each pixel, this is the basic operation: +output_color = SNES_NTSC_ADJ_IN( SNES_NTSC_IN_T ) */ + +#endif diff -NaHudr snes9x-1.43-src/snes9x/ntsc/snes_ntsc.h snx/snes9x/ntsc/snes_ntsc.h --- snes9x-1.43-src/snes9x/ntsc/snes_ntsc.h 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/snes_ntsc.h 2007-01-09 06:26:24.000000000 +0200 @@ -0,0 +1,206 @@ +/* SNES NTSC video filter */ + +/* snes_ntsc 0.2.2 */ +#ifndef SNES_NTSC_H +#define SNES_NTSC_H + +#include "snes_ntsc_config.h" + +#ifdef __cplusplus + extern "C" { +#endif + +/* Image parameters, ranging from -1.0 to 1.0. Actual internal values shown +in parenthesis and should remain fairly stable in future versions. */ +typedef struct snes_ntsc_setup_t +{ + /* Basic parameters */ + double hue; /* -1 = -180 degrees +1 = +180 degrees */ + double saturation; /* -1 = grayscale (0.0) +1 = oversaturated colors (2.0) */ + double contrast; /* -1 = dark (0.5) +1 = light (1.5) */ + double brightness; /* -1 = dark (0.5) +1 = light (1.5) */ + double sharpness; /* edge contrast enhancement/blurring */ + + /* Advanced parameters */ + double gamma; /* -1 = dark (1.5) +1 = light (0.5) */ + double resolution; /* image resolution */ + double artifacts; /* artifacts caused by color changes */ + double fringing; /* color artifacts caused by brightness changes */ + double bleed; /* color bleed (color resolution reduction) */ + int merge_fields; /* if 1, merges even and odd fields together to reduce flicker */ + float const* decoder_matrix; /* optional RGB decoder matrix, 6 elements */ + + unsigned long const* bsnes_colortbl; /* undocumented; set to 0 */ +} snes_ntsc_setup_t; + +/* Video format presets */ +extern snes_ntsc_setup_t const snes_ntsc_composite; /* color bleeding + artifacts */ +extern snes_ntsc_setup_t const snes_ntsc_svideo; /* color bleeding only */ +extern snes_ntsc_setup_t const snes_ntsc_rgb; /* crisp image */ +extern snes_ntsc_setup_t const snes_ntsc_monochrome;/* desaturated + artifacts */ + +/* Initializes and adjusts parameters. Can be called multiple times on the same +snes_ntsc_t object. Can pass NULL for either parameter. */ +typedef struct snes_ntsc_t snes_ntsc_t; +void snes_ntsc_init( snes_ntsc_t* ntsc, snes_ntsc_setup_t const* setup ); + +/* Filters one or more rows of pixels. Input pixel format is set by SNES_NTSC_IN_FORMAT +and output RGB depth is set by SNES_NTSC_OUT_DEPTH. Both default to 16-bit RGB. +In_row_width is the number of pixels to get to the next input row. Out_pitch +is the number of *bytes* to get to the next output row. */ +void snes_ntsc_blit( snes_ntsc_t const* ntsc, SNES_NTSC_IN_T const* input, + long in_row_width, int burst_phase, int in_width, int in_height, + void* rgb_out, long out_pitch ); + +void snes_ntsc_blit_hires( snes_ntsc_t const* ntsc, SNES_NTSC_IN_T const* input, + long in_row_width, int burst_phase, int in_width, int in_height, + void* rgb_out, long out_pitch ); + +/* Number of output pixels written by low-res blitter for given input width. Width +might be rounded down slightly; use SNES_NTSC_IN_WIDTH() on result to find rounded +value. Guaranteed not to round 256 down at all. */ +#define SNES_NTSC_OUT_WIDTH( in_width ) \ + ((((in_width) - 1) / snes_ntsc_in_chunk + 1) * snes_ntsc_out_chunk) + +/* Number of low-res input pixels that will fit within given output width. Might be +rounded down slightly; use SNES_NTSC_OUT_WIDTH() on result to find rounded +value. */ +#define SNES_NTSC_IN_WIDTH( out_width ) \ + (((out_width) / snes_ntsc_out_chunk - 1) * snes_ntsc_in_chunk + 1) + + +/* Interface for user-defined custom blitters */ + +enum { snes_ntsc_in_chunk = 3 }; /* number of input pixels read per chunk */ +enum { snes_ntsc_out_chunk = 7 }; /* number of output pixels generated per chunk */ +enum { snes_ntsc_black = 0 }; /* palette index for black */ +enum { snes_ntsc_burst_count = 3 }; /* burst phase cycles through 0, 1, and 2 */ + +/* Begins outputting row and starts three pixels. First pixel will be cut off a bit. +Use snes_ntsc_black for unused pixels. Declares variables, so must be before first +statement in a block (unless you're using C++). */ +#define SNES_NTSC_BEGIN_ROW( ntsc, burst, pixel0, pixel1, pixel2 ) \ + char const* ktable = \ + (char const*) (ntsc)->table + burst * (snes_ntsc_burst_size * sizeof (snes_ntsc_rgb_t));\ + SNES_NTSC_BEGIN_ROW_6_( pixel0, pixel1, pixel2, SNES_NTSC_IN_FORMAT, ktable ) + +/* Begins input pixel */ +#define SNES_NTSC_COLOR_IN( index, color ) \ + SNES_NTSC_COLOR_IN_( index, color, SNES_NTSC_IN_FORMAT, ktable ) + +/* Generates output pixel. Bits can be 24, 16, 15, 14, 32 (treated as 24), or 0: +24: RRRRRRRR GGGGGGGG BBBBBBBB (8-8-8 RGB) +16: RRRRRGGG GGGBBBBB (5-6-5 RGB) +15: RRRRRGG GGGBBBBB (5-5-5 RGB) +14: BBBBBGG GGGRRRRR (5-5-5 BGR, native SNES format) + 0: xxxRRRRR RRRxxGGG GGGGGxxB BBBBBBBx (native internal format; x = junk bits) */ +#define SNES_NTSC_RGB_OUT( index, rgb_out, bits ) \ + SNES_NTSC_RGB_OUT_14_( index, rgb_out, bits, 1 ) + +/* Hires equivalents */ +#define SNES_NTSC_HIRES_ROW( ntsc, burst, pixel1, pixel2, pixel3, pixel4, pixel5 ) \ + char const* ktable = \ + (char const*) (ntsc)->table + burst * (snes_ntsc_burst_size * sizeof (snes_ntsc_rgb_t));\ + unsigned const snes_ntsc_pixel1_ = (pixel1);\ + snes_ntsc_rgb_t const* kernel1 = SNES_NTSC_IN_FORMAT( ktable, snes_ntsc_pixel1_ );\ + unsigned const snes_ntsc_pixel2_ = (pixel2);\ + snes_ntsc_rgb_t const* kernel2 = SNES_NTSC_IN_FORMAT( ktable, snes_ntsc_pixel2_ );\ + unsigned const snes_ntsc_pixel3_ = (pixel3);\ + snes_ntsc_rgb_t const* kernel3 = SNES_NTSC_IN_FORMAT( ktable, snes_ntsc_pixel3_ );\ + unsigned const snes_ntsc_pixel4_ = (pixel4);\ + snes_ntsc_rgb_t const* kernel4 = SNES_NTSC_IN_FORMAT( ktable, snes_ntsc_pixel4_ );\ + unsigned const snes_ntsc_pixel5_ = (pixel5);\ + snes_ntsc_rgb_t const* kernel5 = SNES_NTSC_IN_FORMAT( ktable, snes_ntsc_pixel5_ );\ + snes_ntsc_rgb_t const* kernel0 = kernel1;\ + snes_ntsc_rgb_t const* kernelx0;\ + snes_ntsc_rgb_t const* kernelx1 = kernel1;\ + snes_ntsc_rgb_t const* kernelx2 = kernel1;\ + snes_ntsc_rgb_t const* kernelx3 = kernel1;\ + snes_ntsc_rgb_t const* kernelx4 = kernel1;\ + snes_ntsc_rgb_t const* kernelx5 = kernel1 + +#define SNES_NTSC_HIRES_OUT( x, rgb_out, bits ) {\ + snes_ntsc_rgb_t raw_ =\ + kernel0 [ x ] + kernel2 [(x+5)%7+14] + kernel4 [(x+3)%7+28] +\ + kernelx0 [(x+7)%7+7] + kernelx2 [(x+5)%7+21] + kernelx4 [(x+3)%7+35] +\ + kernel1 [(x+6)%7 ] + kernel3 [(x+4)%7+14] + kernel5 [(x+2)%7+28] +\ + kernelx1 [(x+6)%7+7] + kernelx3 [(x+4)%7+21] + kernelx5 [(x+2)%7+35];\ + SNES_NTSC_CLAMP_( raw_, 0 );\ + SNES_NTSC_RGB_OUT_( rgb_out, (bits), 0 );\ +} + + +/* private */ +enum { snes_ntsc_entry_size = 128 }; +enum { snes_ntsc_palette_size = 0x2000 }; +typedef unsigned long snes_ntsc_rgb_t; +struct snes_ntsc_t { + snes_ntsc_rgb_t table [snes_ntsc_palette_size] [snes_ntsc_entry_size]; +}; +enum { snes_ntsc_burst_size = snes_ntsc_entry_size / snes_ntsc_burst_count }; + +#define SNES_NTSC_RGB16( ktable, n ) \ + (snes_ntsc_rgb_t const*) (ktable + ((n & 0x001E) | (n >> 1 & 0x03E0) | (n >> 2 & 0x3C00)) * \ + (snes_ntsc_entry_size / 2 * sizeof (snes_ntsc_rgb_t))) + +#define SNES_NTSC_BGR15( ktable, n ) \ + (snes_ntsc_rgb_t const*) (ktable + ((n << 9 & 0x3C00) | (n & 0x03E0) | (n >> 10 & 0x001E)) * \ + (snes_ntsc_entry_size / 2 * sizeof (snes_ntsc_rgb_t))) + +/* common 3->7 ntsc macros */ +#define SNES_NTSC_BEGIN_ROW_6_( pixel0, pixel1, pixel2, ENTRY, table ) \ + unsigned const snes_ntsc_pixel0_ = (pixel0);\ + snes_ntsc_rgb_t const* kernel0 = ENTRY( table, snes_ntsc_pixel0_ );\ + unsigned const snes_ntsc_pixel1_ = (pixel1);\ + snes_ntsc_rgb_t const* kernel1 = ENTRY( table, snes_ntsc_pixel1_ );\ + unsigned const snes_ntsc_pixel2_ = (pixel2);\ + snes_ntsc_rgb_t const* kernel2 = ENTRY( table, snes_ntsc_pixel2_ );\ + snes_ntsc_rgb_t const* kernelx0;\ + snes_ntsc_rgb_t const* kernelx1 = kernel0;\ + snes_ntsc_rgb_t const* kernelx2 = kernel0 + +#define SNES_NTSC_RGB_OUT_14_( x, rgb_out, bits, shift ) {\ + snes_ntsc_rgb_t raw_ =\ + kernel0 [x ] + kernel1 [(x+12)%7+14] + kernel2 [(x+10)%7+28] +\ + kernelx0 [(x+7)%14] + kernelx1 [(x+ 5)%7+21] + kernelx2 [(x+ 3)%7+35];\ + SNES_NTSC_CLAMP_( raw_, shift );\ + SNES_NTSC_RGB_OUT_( rgb_out, bits, shift );\ +} + +/* common ntsc macros */ +#define snes_ntsc_rgb_builder ((1L << 21) | (1 << 11) | (1 << 1)) +#define snes_ntsc_clamp_mask (snes_ntsc_rgb_builder * 3 / 2) +#define snes_ntsc_clamp_add (snes_ntsc_rgb_builder * 0x101) +#define SNES_NTSC_CLAMP_( io, shift ) {\ + snes_ntsc_rgb_t sub = (io) >> (9-(shift)) & snes_ntsc_clamp_mask;\ + snes_ntsc_rgb_t clamp = snes_ntsc_clamp_add - sub;\ + io |= clamp;\ + clamp -= sub;\ + io &= clamp;\ +} + +#define SNES_NTSC_COLOR_IN_( index, color, ENTRY, table ) {\ + unsigned color_;\ + kernelx##index = kernel##index;\ + kernel##index = (color_ = (color), ENTRY( table, color_ ));\ +} + +/* x is always zero except in snes_ntsc library */ +#define SNES_NTSC_RGB_OUT_( rgb_out, bits, x ) {\ + if ( bits == 16 )\ + rgb_out = (raw_>>(13-x)& 0xF800)|(raw_>>(8-x)&0x07E0)|(raw_>>(4-x)&0x001F);\ + if ( bits == 24 || bits == 32 )\ + rgb_out = (raw_>>(5-x)&0xFF0000)|(raw_>>(3-x)&0xFF00)|(raw_>>(1-x)&0xFF);\ + if ( bits == 15 )\ + rgb_out = (raw_>>(14-x)& 0x7C00)|(raw_>>(9-x)&0x03E0)|(raw_>>(4-x)&0x001F);\ + if ( bits == 14 )\ + rgb_out = (raw_>>(24-x)& 0x001F)|(raw_>>(9-x)&0x03E0)|(raw_<<(6+x)&0x7C00);\ + if ( bits == 0 )\ + rgb_out = raw_ << x;\ +} + +#ifdef __cplusplus + } +#endif + +#endif diff -NaHudr snes9x-1.43-src/snes9x/ntsc/snes_ntsc_impl.h snx/snes9x/ntsc/snes_ntsc_impl.h --- snes9x-1.43-src/snes9x/ntsc/snes_ntsc_impl.h 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/snes_ntsc_impl.h 2007-01-09 07:49:02.000000000 +0200 @@ -0,0 +1,439 @@ +/* snes_ntsc 0.2.2. http://www.slack.net/~ant/ */ + +/* Common implementation of NTSC filters */ + +#include +#include + +/* Copyright (C) 2006 Shay Green. This module is free software; you +can redistribute it and/or modify it under the terms of the GNU Lesser +General Public License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. This +module is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +details. You should have received a copy of the GNU Lesser General Public +License along with this module; if not, write to the Free Software Foundation, +Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ + +#define DISABLE_CORRECTION 0 + +#undef PI +#define PI 3.14159265358979323846f + +#ifndef LUMA_CUTOFF + #define LUMA_CUTOFF 0.20 +#endif +#ifndef gamma_size + #define gamma_size 1 +#endif +#ifndef rgb_bits + #define rgb_bits 8 +#endif +#ifndef artifacts_max + #define artifacts_max (artifacts_mid * 1.5f) +#endif +#ifndef fringing_max + #define fringing_max (fringing_mid * 2) +#endif +#ifndef STD_HUE_CONDITION + #define STD_HUE_CONDITION( setup ) 1 +#endif + +#define ext_decoder_hue (std_decoder_hue + 15) +#define rgb_unit (1 << rgb_bits) +#define rgb_offset (rgb_unit * 2 + 0.5f) + +enum { burst_size = snes_ntsc_entry_size / burst_count }; +enum { kernel_half = 16 }; +enum { kernel_size = kernel_half * 2 + 1 }; + +typedef struct init_t +{ + float to_rgb [burst_count * 6]; + float to_float [gamma_size]; + float contrast; + float brightness; + float artifacts; + float fringing; + float kernel [rescale_out * kernel_size * 2]; +} init_t; + +#define ROTATE_IQ( i, q, sin_b, cos_b ) {\ + float t;\ + t = i * cos_b - q * sin_b;\ + q = i * sin_b + q * cos_b;\ + i = t;\ +} + +static void init_filters( init_t* impl, snes_ntsc_setup_t const* setup ) +{ +#if rescale_out > 1 + float kernels [kernel_size * 2]; +#else + float* const kernels = impl->kernel; +#endif + + /* generate luma (y) filter using sinc kernel */ + { + /* sinc with rolloff (dsf) */ + float const rolloff = 1 + (float) setup->sharpness * (float) 0.032; + float const maxh = 32; + float const pow_a_n = (float) pow( rolloff, maxh ); + float sum; + int i; + /* quadratic mapping to reduce negative (blurring) range */ + float to_angle = (float) setup->resolution + 1; + to_angle = PI / maxh * (float) LUMA_CUTOFF * (to_angle * to_angle + 1); + + kernels [kernel_size * 3 / 2] = maxh; /* default center value */ + for ( i = 0; i < kernel_half * 2 + 1; i++ ) + { + int x = i - kernel_half; + float angle = x * to_angle; + /* instability occurs at center point with rolloff very close to 1.0 */ + if ( x || pow_a_n > (float) 1.056 || pow_a_n < (float) 0.981 ) + { + float rolloff_cos_a = rolloff * (float) cos( angle ); + float num = 1 - rolloff_cos_a - + pow_a_n * (float) cos( maxh * angle ) + + pow_a_n * rolloff * (float) cos( (maxh - 1) * angle ); + float den = 1 - rolloff_cos_a - rolloff_cos_a + rolloff * rolloff; + float dsf = num / den; + kernels [kernel_size * 3 / 2 - kernel_half + i] = dsf - (float) 0.5; + } + } + + /* apply blackman window and find sum */ + sum = 0; + for ( i = 0; i < kernel_half * 2 + 1; i++ ) + { + float x = PI * 2 / (kernel_half * 2) * i; + float blackman = 0.42f - 0.5f * (float) cos( x ) + 0.08f * (float) cos( x * 2 ); + sum += (kernels [kernel_size * 3 / 2 - kernel_half + i] *= blackman); + } + + /* normalize kernel */ + sum = 1.0f / sum; + for ( i = 0; i < kernel_half * 2 + 1; i++ ) + { + int x = kernel_size * 3 / 2 - kernel_half + i; + kernels [x] *= sum; + assert( kernels [x] == kernels [x] ); /* catch numerical instability */ + } + } + + /* generate chroma (iq) filter using gaussian kernel */ + { + float const cutoff_factor = -0.03125f; + float cutoff = (float) setup->bleed; + int i; + + if ( cutoff < 0 ) + { + /* keep extreme value accessible only near upper end of scale (1.0) */ + cutoff *= cutoff; + cutoff *= cutoff; + cutoff *= cutoff; + cutoff *= -30.0f / 0.65f; + } + cutoff = cutoff_factor - 0.65f * cutoff_factor * cutoff; + + for ( i = -kernel_half; i <= kernel_half; i++ ) + kernels [kernel_size / 2 + i] = (float) exp( i * i * cutoff ); + + /* normalize even and odd phases separately */ + for ( i = 0; i < 2; i++ ) + { + float sum = 0; + int x; + for ( x = i; x < kernel_size; x += 2 ) + sum += kernels [x]; + + sum = 1.0f / sum; + for ( x = i; x < kernel_size; x += 2 ) + { + kernels [x] *= sum; + assert( kernels [x] == kernels [x] ); /* catch numerical instability */ + } + } + } + + /* + printf( "luma:\n" ); + for ( i = kernel_size; i < kernel_size * 2; i++ ) + printf( "%f\n", kernels [i] ); + printf( "chroma:\n" ); + for ( i = 0; i < kernel_size; i++ ) + printf( "%f\n", kernels [i] ); + */ + + /* generate linear rescale kernels */ + #if rescale_out > 1 + { + float weight = 1.0f; + float* out = impl->kernel; + int n = rescale_out; + do + { + float remain = 0; + int i; + weight -= 1.0f / rescale_in; + for ( i = 0; i < kernel_size * 2; i++ ) + { + float cur = kernels [i]; + float m = cur * weight; + *out++ = m + remain; + remain = cur - m; + } + } + while ( --n ); + } + #endif +} + +static float const default_decoder [6] = + { 0.956f, 0.621f, -0.272f, -0.647f, -1.105f, 1.702f }; + +static void init( init_t* impl, snes_ntsc_setup_t const* setup ) +{ + impl->brightness = (float) setup->brightness * (0.5f * rgb_unit) + rgb_offset; + impl->contrast = (float) setup->contrast * (0.5f * rgb_unit) + rgb_unit; + #ifdef default_palette_contrast + if ( !setup->palette ) + impl->contrast *= default_palette_contrast; + #endif + + impl->artifacts = (float) setup->artifacts; + if ( impl->artifacts > 0 ) + impl->artifacts *= artifacts_max - artifacts_mid; + impl->artifacts = impl->artifacts * artifacts_mid + artifacts_mid; + + impl->fringing = (float) setup->fringing; + if ( impl->fringing > 0 ) + impl->fringing *= fringing_max - fringing_mid; + impl->fringing = impl->fringing * fringing_mid + fringing_mid; + + init_filters( impl, setup ); + + /* generate gamma table */ + if ( gamma_size > 1 ) + { + float const to_float = 1.0f / (gamma_size - (gamma_size > 1)); + float const gamma = 1.1333f - (float) setup->gamma * 0.5f; + /* match common PC's 2.2 gamma to TV's 2.65 gamma */ + int i; + for ( i = 0; i < gamma_size; i++ ) + impl->to_float [i] = + (float) pow( i * to_float, gamma ) * impl->contrast + impl->brightness; + } + + /* setup decoder matricies */ + { + float hue = (float) setup->hue * PI + PI / 180 * ext_decoder_hue; + float sat = (float) setup->saturation + 1; + float const* decoder = setup->decoder_matrix; + if ( !decoder ) + { + decoder = default_decoder; + if ( STD_HUE_CONDITION( setup ) ) + hue += PI / 180 * (std_decoder_hue - ext_decoder_hue); + } + + { + float s = (float) sin( hue ) * sat; + float c = (float) cos( hue ) * sat; + float* out = impl->to_rgb; + int n; + + n = burst_count; + do + { + float const* in = decoder; + int n = 3; + do + { + float i = *in++; + float q = *in++; + *out++ = i * c - q * s; + *out++ = i * s + q * c; + } + while ( --n ); + if ( burst_count <= 1 ) + break; + ROTATE_IQ( s, c, 0.866025f, -0.5f ); /* +120 degrees */ + } + while ( --n ); + } + } +} + +/* kernel generation */ + +#define RGB_TO_YIQ( r, g, b, y, i ) (\ + (y = (r) * 0.299f + (g) * 0.587f + (b) * 0.114f),\ + (i = (r) * 0.596f - (g) * 0.275f - (b) * 0.321f),\ + ((r) * 0.212f - (g) * 0.523f + (b) * 0.311f)\ +) + +#define YIQ_TO_RGB( y, i, q, to_rgb, type, r, g ) (\ + r = (type) (y + to_rgb [0] * i + to_rgb [1] * q),\ + g = (type) (y + to_rgb [2] * i + to_rgb [3] * q),\ + (type) (y + to_rgb [4] * i + to_rgb [5] * q)\ +) + +#define PACK_RGB( r, g, b ) ((r) << 21 | (g) << 11 | (b) << 1) + +enum { rgb_kernel_size = burst_size / alignment_count }; +enum { rgb_bias = rgb_unit * 2 * snes_ntsc_rgb_builder }; + +typedef struct pixel_info_t +{ + int offset; + float negate; + float kernel [4]; +} pixel_info_t; + +#if rescale_in > 1 + #define PIXEL_OFFSET_( ntsc, scaled ) \ + (kernel_size / 2 + ntsc + (scaled != 0) + (rescale_out - scaled) % rescale_out + \ + (kernel_size * 2 * scaled)) + + #define PIXEL_OFFSET( ntsc, scaled ) \ + PIXEL_OFFSET_( ((ntsc) - (scaled) / rescale_out * rescale_in),\ + (((scaled) + rescale_out * 10) % rescale_out) ),\ + (1.0f - (((ntsc) + 100) & 2)) +#else + #define PIXEL_OFFSET( ntsc, scaled ) \ + (kernel_size / 2 + (ntsc) - (scaled)),\ + (1.0f - (((ntsc) + 100) & 2)) +#endif + +extern pixel_info_t const snes_ntsc_pixels [alignment_count]; + +/* Generate pixel at all burst phases and column alignments */ +static void gen_kernel( init_t* impl, float y, float i, float q, snes_ntsc_rgb_t* out ) +{ + /* generate for each scanline burst phase */ + float const* to_rgb = impl->to_rgb; + int burst_remain = burst_count; + y -= rgb_offset; + do + { + /* Encode yiq into *two* composite signals (to allow control over artifacting). + Convolve these with kernels which: filter respective components, apply + sharpening, and rescale horizontally. Convert resulting yiq to rgb and pack + into integer. Based on algorithm by NewRisingSun. */ + pixel_info_t const* pixel = snes_ntsc_pixels; + int alignment_remain = alignment_count; + do + { + /* negate is -1 when composite starts at odd multiple of 2 */ + float const yy = y * impl->fringing * pixel->negate; + float const ic0 = (i + yy) * pixel->kernel [0]; + float const qc1 = (q + yy) * pixel->kernel [1]; + float const ic2 = (i - yy) * pixel->kernel [2]; + float const qc3 = (q - yy) * pixel->kernel [3]; + + float const factor = impl->artifacts * pixel->negate; + float const ii = i * factor; + float const yc0 = (y + ii) * pixel->kernel [0]; + float const yc2 = (y - ii) * pixel->kernel [2]; + + float const qq = q * factor; + float const yc1 = (y + qq) * pixel->kernel [1]; + float const yc3 = (y - qq) * pixel->kernel [3]; + + float const* k = &impl->kernel [pixel->offset]; + int n; + ++pixel; + for ( n = rgb_kernel_size; n; --n ) + { + float i = k[0]*ic0 + k[2]*ic2; + float q = k[1]*qc1 + k[3]*qc3; + float y = k[kernel_size+0]*yc0 + k[kernel_size+1]*yc1 + + k[kernel_size+2]*yc2 + k[kernel_size+3]*yc3 + rgb_offset; + if ( rescale_out <= 1 ) + k--; + else if ( k < &impl->kernel [kernel_size * 2 * (rescale_out - 1)] ) + k += kernel_size * 2 - 1; + else + k -= kernel_size * 2 * (rescale_out - 1) + 2; + { + int r, g, b = YIQ_TO_RGB( y, i, q, to_rgb, int, r, g ); + *out++ = PACK_RGB( r, g, b ) - rgb_bias; + } + } + } + while ( alignment_count > 1 && --alignment_remain ); + + if ( burst_count <= 1 ) + break; + + to_rgb += 6; + + ROTATE_IQ( i, q, -0.866025f, -0.5f ); /* -120 degrees */ + } + while ( --burst_remain ); +} + +static void correct_errors( snes_ntsc_rgb_t color, snes_ntsc_rgb_t* out ); + +#if DISABLE_CORRECTION + #define CORRECT_ERROR( a ) { out [i] += rgb_bias; } + #define DISTRIBUTE_ERROR( a, b, c ) { out [i] += rgb_bias; } +#else + #define CORRECT_ERROR( a ) { out [a] += error; } + #define DISTRIBUTE_ERROR( a, b, c ) {\ + snes_ntsc_rgb_t fourth = (error + 2 * snes_ntsc_rgb_builder) >> 2;\ + fourth &= (rgb_bias >> 1) - snes_ntsc_rgb_builder;\ + fourth -= rgb_bias >> 2;\ + out [a] += fourth;\ + out [b] += fourth;\ + out [c] += fourth;\ + out [i] += error - (fourth * 3);\ + } +#endif + +#define RGB_PALETTE_OUT( rgb, out_ )\ +{\ + unsigned char* out = (out_);\ + snes_ntsc_rgb_t clamped = (rgb);\ + SNES_NTSC_CLAMP_( clamped, (8 - rgb_bits) );\ + out [0] = (unsigned char) (clamped >> 21);\ + out [1] = (unsigned char) (clamped >> 11);\ + out [2] = (unsigned char) (clamped >> 1);\ +} + +/* blitter related */ + +#ifndef restrict + #if defined (__GNUC__) + #define restrict __restrict__ + #elif defined (_MSC_VER) && _MSC_VER > 1300 + #define restrict __restrict + #else + /* no support for restricted pointers */ + #define restrict + #endif +#endif + +#include + +#if SNES_NTSC_OUT_DEPTH <= 16 + #if USHRT_MAX == 0xFFFF + typedef unsigned short snes_ntsc_out_t; + #else + #error "Need 16-bit int type" + #endif + +#else + #if UINT_MAX == 0xFFFFFFFF + typedef unsigned int snes_ntsc_out_t; + #elif ULONG_MAX == 0xFFFFFFFF + typedef unsigned long snes_ntsc_out_t; + #else + #error "Need 32-bit int type" + #endif + +#endif diff -NaHudr snes9x-1.43-src/snes9x/ntsc/snes_ntsc.txt snx/snes9x/ntsc/snes_ntsc.txt --- snes9x-1.43-src/snes9x/ntsc/snes_ntsc.txt 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/snes_ntsc.txt 2007-01-08 15:21:44.000000000 +0200 @@ -0,0 +1,169 @@ +snes_ntsc 0.2.2: SNES NTSC Video Filter +--------------------------------------- +Author : Shay Green +Website : http://www.slack.net/~ant/ +Forum : http://groups.google.com/group/blargg-sound-libs +License : GNU Lesser General Public License (LGPL) +Language: C or C++ + + +Overview +-------- +To perform NTSC filtering, first allocate memory for a snes_ntsc_t object +and call snes_ntsc_init(), then call snes_ntsc_blit() to perform +filtering. You can call snes_ntsc_init() at any time to change image +parameters. + +By default, snes_ntsc_blit() reads and writes pixels in 16-bit RGB. Edit +snes_ntsc_config.h to change this. + + +Image Parameters +---------------- +Many image parameters can be adjusted and presets are provided for +composite video, S-video, RGB, and monochrome. Most are floating-point +values with a general range of -1.0 to 1.0, where 0 is normal. The +ranges are adjusted so that one parameter at an extreme (-1 or +1) and +the rest at zero shouldn't result in any internal overflow (garbage +pixels). Setting multiple parameters to their extreme can produce +garbage. Put another way, the state space defined by all parameters +within the range -1 to +1 is not fully usable, but some extreme corners +are very useful so I don't want to reduce the parameter ranges. + +The sharpness and resolution parameters have similar effects. Resolution +affects how crisp pixels are. Sharpness merely enhances the edges by +increasing contrast, which makes things brighter at the edges. Artifacts +sets how much "junk" is around the edges where colors and brightness +change in the image, where -1 completely eliminates them. (Color) bleed +affects how much colors blend together and the artifact colors at the +edges of pixels surrounded by black. (Color) fringing affects how much +color fringing occurs around the edges of bright objects, especially +white text on a black background. + +When using custom settings, initialize your snes_ntsc_setup_t using one +of the standard setups before customizing it. This will ensure that all +fields are properly initialized, including any added in future releases +of the library that your current code can't even know about. + + snes_ntsc_setup_t setup; + setup = snes_ntsc_composite; /* do this first */ + setup.sharpness = custom_sharpness; + snes_ntsc_init( ntsc, &setup ); + + +Image Size +---------- +For proper aspect ratio, the image generated by the library must be +doubled vertically. + +Use the SNES_NTSC_OUT_WIDTH() and SNES_NTSC_IN_WIDTH() macros to convert +between input and output widths that the blitter uses. For example, if +you are blitting an image 256 pixels wide, use SNES_NTSC_OUT_WIDTH( 256 ) +to find out how many output pixels are written per row. Another example, +use SNES_NTSC_IN_WIDTH( 640 ) to find how many input pixels will fit +within 640 output pixels. The blitter rounds the input width down in +some cases, so the requested width might not be possible. Use +SNES_NTSC_IN_WIDTH( SNES_NTSC_OUT_WIDTH( in_width ) ) to find what a given +in_width would be rounded down to. + + +Burst Phase +----------- +The burst_phase parameter to snes_ntsc_blit() should generally toggle +values between frames, i.e. 0 on first call to snes_ntsc_blit(), 1 on +second call, 0 on third call, 1 on fourth, etc. If merge_fields is +enabled (see below), you should always pass 0. Read further for more +detailed operation. + +If you're using snes_ntsc_blit() to do partial screen updates, +burst_phase should be calculated as (burst_phase + row) % 3, where row +is the starting row (0 through 239). For example, if burst_phase is 1 +for the current frame and you make two calls to snes_ntsc_blit() to blit +rows 0 to 100, then rows 101 to 239, for the first call you should pass +1 for burst_phase, and for the second call you should pass 0 for +burst_phase: (1 + 101) % 3 = 0. Do the same regardless of the +merge_fields setting. + + +Flickering +---------- +The displayed image toggles between two different pixel artifact +patterns at a steady rate, making it appear stable. For an emulator to +duplicate this effect, its frame rate must match the host monitor's +refresh rate, it must be synchronizing to the refresh (vsync), and it +must not be skipping any frames. If any of these don't hold, the image +will probably flicker much more than it would on a TV. It is important +that you play around with these factors to get a good feel for the +issue, and document it clearly for end-users, otherwise they will have +difficulty getting an authentic image. + +The library includes a partial workaround for this issue, for the cases +where all the conditions can't be met. When merge_fields is set to 1, +snes_ntsc_blit() does the equivalent of blitting the image twice with the +two different phases and then mixes them together, but without any +performance impact. The result is similar to what you'd see if the +monitor's refresh rate were the same as the emulator's. It does reduce +the shimmer effect when scrolling, so it's not a complete solution to +the refresh rate issue. + +The merge_fields option is also useful when taking a screenshot. If you +capture without merge_fields set to 1, you'll only get the even or odd +artifacts, which will make the image look more grainy than when the +emulator is running. Again, play around with this to get an idea of the +difference. It might be best to simply allow the user to choose when to +enable this option. + +Note that when you have merge_fields set to 1, you should always pass 0 +for the burst_phase parameter to snes_ntsc_blit() (unless doing partial +screen updates). If you don't, you'll still get some flicker. + + +Custom Blitter +-------------- +You can write your own blitter, allowing customization of how input +pixels are obtained, the format of output pixels (15, 16, or 32-bit +RGB), optimizations for your platform, and additional effects like +efficient scanline doubling during blitting. + +Macros are included in snes_ntsc.h for writing your blitter so that your +code can be carried over without changes to improved versions of the +library. The default blitter at the end of snes_ntsc.c shows how to use +the macros. Contact me for further assistance. + +The SNES_NTSC_BEGIN_ROW macro allows starting up to three pixels. The +first pixel is cut off; its use is in specifying a background color +other than black for the sliver on the left edge. The next two pixels +can be used to handle the extra one or two pixels not handled by the +main chunks of three pixels. For example if you want to blit 257 input +pixels on a row (for whatever odd reason), you would start the first two +with SNES_NTSC_BEGIN_ROW( ... snes_ntsc_black, line_in [0], line_in [1] ), +then do the remaining 255 in chunks of three (255 is divisible by 3). + + +Limitations +----------- +The library's horizontal rescaling is too wide by about 3% in order to +allow a much more optimal implementation. This means that a 256 pixel +wide input image should appear as 581 output pixels, but with this +library appears as 602 output pixels. TV aspect ratios probably vary by +this much anyway. If you really need unscaled output, contact me and +I'll see about adding it. + +Input pixels are converted to 13-bit RGB (4 bits red, 5 bits green, 4 +bits blue) to reduce memory usage from 16MB to 4MB. This reduction can +cause slight banding in some smooth gradients. Contact me if you'd like +this reduction made optional. + + +Thanks +------ +Thanks to NewRisingSun for his original code and explanations of NTSC, +which was a starting point for me learning about NTSC video and +decoding. Thanks to the Nesdev forum for feedback and encouragement. +Thanks to Martin Freij (Nestopia author) and Charles MacDonald (SMS Plus +author) for significant ongoing testing and feedback as the library has +improved. Thanks to byuu (bsnes author) and pagefault (ZSNES team) for +feedback about the SNES version. + +-- +Shay Green diff -NaHudr snes9x-1.43-src/snes9x/ntsc/test.bmp snx/snes9x/ntsc/test.bmp --- snes9x-1.43-src/snes9x/ntsc/test.bmp 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/ntsc/test.bmp 2007-01-06 07:58:00.000000000 +0200 @@ -0,0 +1,1892 @@ +BM6ã6(ßß  ÿÿÿ¸`ð¨X8ØpØøøøøˆ¸øÀÀÐШààÀøðèpPаpHHH €@€È¨ØØøÀÐøpøXˆx¸@ˆø(¸HxhxX˜ÈPÀàøˆˆØhhØ@@`¨¸%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                                                                                                                                                                                                                                                                                                                                                                                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %     %     %  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %$% % %%% %% %$$$% % %%% %% %$$$%% %%% %%    %$%% %%% %%      %% %% %%% %%     + % % % %%% %%     +% $$% % %%% %%   + +% $$$$$$%%% % %%% %% + %$$$$$$% % %%% %% + + %%%$$%% % %%% %%   + + + %%%%%% %%%%%%%%%%%%%%% %%% %%     + + + + +%%%%%% %%%%"% %%% %%      + + + + +%%%%%%%%%%%%% %%%%%%% %%% %%      + + + + + + + %%%%%%%%% %% %% %%%% %%% %%      + + + + + + + %%%%%%%%%%%% %%% %%%%%%%%%% %%% %%   + + + + + + + + %%%%%%%% %% %%!""#%"%% %%% %% + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %%!!"%%%%% %%%   %% + + + + + + + + + + %%%%%%%!%% %%%    %% + + + + + + + + %%#"#%"!!%% %%%    %%    + + + + + + + + + %%!!"#%!%% %%%    %%      + + + + + + + + %%%%""!%%%% %%%    %%     + + + + + + + +  %%"%%%%% %%%    %%     + + + + + + + + %%""%%% %%%    %%   + + + + + + + + %""%%%% %%%    %% + + + + + + + %""%%%% %%%    %% + + + + + + + + %%""%%% %%%    %%   + + + + + + +  %%%%%"#%% %%%    %%     + + + + + + + +  %%%"#%% %%%    %%      + + + + + + +  %%%%%%"#%% %%%    %%      + + + + + + + +  %###%%"!%% %%%    %%      + + + + + + +  %""""%%"!%% %%%   %%   + + + + + + + +  %!!""#%%%#"!%% %%%   %% + + + + + + +  + + + + + + + + + + + + + + + + + + + + + + + + + + %!!!!""##%%#""!%% %%%  + + + + + + + + + + + + + + + + %% + + + + + + + +  + + %%%!!!"""###"!!%% %%%  %% + + + + + + +  + %%!!!!"%%%#!%% %%%  %%    + + + + + + + +  + %%!!!%%#"% % %%%  %%      + + + + + + +  + %%!!%%%"% % %%%  %%     + + + + + + + +  %%%%%!%  % %%%  %%     + + + + + + +  + %%%%!%  % %%%  %%   + + + + + + + +  %%!%  % %%%  %% + + + + + + +  %%%!% % %%%  %% + + + + + + + +  %%%%%% % %%%  %%   + + + + + + +   % %%%  %%     + + + + + + + +   % %%% %%      + + + + + + +  +  % %%% %%      + + + + + + + +  +  % %%% %%      + + + + + + +  + + +  % %%% %%   + + + + + + + +  + + + + + + % %%% %% + + + + + + +  + + + + + + + + + + + + + + + + + + + + + + + + + + % %%% %% + + + + + + + +  + + % %%% %% + + + + + + +  + % %%%%%    + + + + + + + +  + % %%%%%      + + + + + + +  + % %%%%%     + + + + + + + +  % %%%%%%%     + + + + + + +  + % %%%%%%%   + + + + + + + +  % %%%%%%%%% + + + + + + +  %%%% %%% % %%%%%%%% + + + + + + + +  %% %% % %%%%%%%%%%%%%% + + + + + + +  %%%% % %%%%%%%%%%%%%%%%%%%%%%%%% + + + + + + + +  %%%%%%% % %%%%%%%%%%%%%%%%%%%%%%% + + + + + + +  %%%%%% % %%%%%%% + + + + + + + +  %%%%%% % %%%%%%% + + + + + + +  %%%%%%% % %%%%%%%% + + + + + + + +  %%%%%% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + + + + +  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +%%% % %%%%%   + + + + + + + +  + + + + + + + + + + +%%%%%%%%  % %%%%   + + + + + + +  + + + + + + + +%%%%%%%%%%  % %%%%   + + + + + + + +  + + + + + + + + +%%%%%%%  % %%%%   + + + + + + +  + + + + + + +%%%%%%  % %%%%   + + + + + + + +  + + + + + +%%%%%%%%  % %%%%   + + + + + + + + + + + + + + + +%%% %%%  % %%%%   + + + + + + + + + + + + + +%%%%% % %%%%   + + + + + + + + + + +%%%%% % %%%%   + + + + + + + + + + + + %%%%% % %%% %   + + + + + + +  + + +  %%%% % %%% %   + + + + + + + +  + + + +%%%% % %%% %   + + + + + + +  + + + %% % %%% %   + + + + + + + +  + + + + +% % %%% %   + + + + + + +  + + + +%%  %%%%%   + + + + + + + +  + + + + + +% %%%%%  + + + + + + +  + + + + +%%% %%%%  %  + + + + + + + +  + + + + + + +%%%%%%%% %%% %%%%  %  + + + + + + +  + + + + +%%%%%%%% %% %%%%  %  + + + + + + + +  + + + + +%%%%%%%%%%% %%%  %  + + + + + + +  + + + %%%%% %%  %  + + + + + + + +  + + + +%%% %% %  %  + + + + + + + +  + + + %%% %  %  + + + + + + + +  + + + + +%%%% %  %  + + + + + + +  + + + +%%% % %  + + + + + + + +  + + + + + +%%%%%% % %  + + + + + + +  + + + + + +%%%%%%% % %  + + + + + + + +  + + + + + + + %%%% % %  + + + + + + +  + + + + + + +  +  %%  + + + + + + + +  + + + + + + + +  +  %%  + + + + + + +  + + + + + + +  + + +  %%  + + + + + + + +  + + + + + + + + + + + + + + %%  + + + + + + +  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +  + + + + + + + +  + + + + + + + + + + + + + + + + + +  + + + + + + +  + + + + + + + + + + + + + + +  + + + + + + + +  + + + + + + + + + + + + + + + + +  + + + + + + +  + + + + + + + + + + + + + + +  + + + + + + + +  + + + + + + + + + + + + + + + +   + + + + + + +  + + + + + + + + + + + + + + +  + + + + + + + +  + + + + + + + + + + + + + + + +   + + + + + + +  + + + + + + +  + + + + + + +   + + + + + + +  + + + + + + +  + + + + + + + +   + + + + + + +  + + + + + + +  + + + + + + +   + + + + + +  + + + + + +  + + + + + + + +   + + + + + +  + + + + + +  + + + + + + +   + + + + + + +  + + + + + + +  + + + + + + + +   + + + + + +  + + + + + +  + + + + + + +   + + + + + + +  + + + + + + +  + + + + + + + +   + + + + + + +  + + + + + + +  + + + + + + +  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +  + + + + +  + + + + +  + + + + + + + +  + + + +  + + + + + + +  + + + + + + +  + + + + + + +  + +  + + + + + +  + + + + + +  + + + + + + + +  + +  + + + + + +  + + + + + +  + + + + + + +  + +  + + + + +  + + + + +  + + + + + + + +    + + + + +  + + + + +  + + + + + + + + +  + + + + +  + + + + +  + + + + + + + +   + + + + +  + + + + +  + + + + + + +   + + + +  + + + +  + + + + + + + +   + + + +  + + + +  + + + + + + +    + + +  + + + +  + + + + + + + +    +  + + +  + + + + + + +     + +  + + + + + + + +     + +  + + + + + + +     + + + + + + + +    + + + + + + +   + + + + + + + +   + + + + + + +   + + + + + + + +   + + + + + + +   + + + + + + + +   + + + + + + +   + + + + + + + +   + + + + + + +   + + + + + + +   + + + + + + +   + + + + + +  + + + + + +  + + + + + + +  + + + + + +  + + + + + + +  + + + + + + +  + + + + +  + + + + + + +  + + + + + +  + + + + + +  + + + + +  + + + + +  + + + + +  + + + + +  + + + + %%%%%%%%%%%%%%%%%% + + + + %%%% + + + + %% + + + %% + + %%%%%%%%%%%%%%%%%% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ No newline at end of file diff -NaHudr snes9x-1.43-src/snes9x/offsets snx/snes9x/offsets --- snes9x-1.43-src/snes9x/offsets 2004-12-31 00:15:48.000000000 +0200 +++ snx/snes9x/offsets 2008-02-20 15:06:45.548183511 +0200 @@ -1,321 +1,309 @@ -ELF ƒ4óÿÿ¸‰D$¸Ž­‰D$¡Xщ$èóÿÿ1À¹`»‰D$¡XщL$‰$èóÿÿ¸ »º‰D$¡XщT$‰$èäòÿÿ¸‰D$¸À»‰D$¡Xщ$èÅòÿÿ¸‰D$¸§­‰D$¡Xщ$è¦òÿÿ¸¹¼‰D$¡XщL$‰$è‡òÿÿ¸@¼º ‰D$¡XщT$‰$èhòÿÿ¸‰D$¸€¼‰D$¡Xщ$èIòÿÿ¸‰D$¸Ä­‰D$¡Xщ$è*òÿÿ¸¹â­‰D$¡XщL$‰$è òÿÿ¸À¼ºl‰D$¡XщT$‰$èìñÿÿ¸R‰D$¸½‰D$¡Xщ$èÍñÿÿ¸P‰D$¸@½‰D$¡Xщ$è®ñÿÿ1À¹€½‰D$¡XщL$‰$è’ñÿÿ¸ ½º‰D$¡XщT$‰$èsñÿÿ¸‰D$¸à½‰D$¡Xщ$èTñÿÿ¸‰D$¸¾‰D$¡Xщ$è5ñÿÿ¸¹ ¾‰D$¡XщL$‰$èñÿÿ¸@¾º‰D$¡XщT$‰$è÷ðÿÿ¸‰D$¸`¾‰D$¡Xщ$èØðÿÿ¸‰D$¸ ¾‰D$¡Xщ$è¹ðÿÿ1À¹ý­‰D$¡XщL$‰$èðÿÿ¸®º‰D$¡XщT$‰$è~ðÿÿ¸‰D$¸4®‰D$¡Xщ$è_ðÿÿ¸‰D$¸Q®‰D$¡Xщ$è@ðÿÿ¸¹j®‰D$¡XщL$‰$è!ðÿÿ¸®º‰D$¡XщT$‰$èðÿÿ¸‰D$¸œ®‰D$¡Xщ$èãïÿÿ¸ -‰D$¸à¾‰D$¡Xщ$èÄïÿÿ¸ ¹µ®‰D$¡XщL$‰$è¥ïÿÿ¸Î®º>‰D$¡XщT$‰$è†ïÿÿ¸@‰D$¸ç®‰D$¡Xщ$ègïÿÿ¸@‰D$¸¯‰D$¡Xщ$èHïÿÿ¸A¹¯‰D$¡XщL$‰$è)ïÿÿ¸;¯ºB‰D$¡XщT$‰$è -ïÿÿ¸B‰D$¸ ¿‰D$¡Xщ$èëîÿÿ¸D‰D$¸Q¯‰D$¡Xщ$èÌîÿÿ¸G¹k¯‰D$¡XщL$‰$è­îÿÿ¸`¿ºH‰D$¡XщT$‰$èŽîÿÿ¸J‰D$¸…¯‰D$¡Xщ$èoîÿÿ¸L‰D$¸£¯‰D$¡Xщ$èPîÿÿ¸N¹ ¿‰D$¡XщL$‰$è1îÿÿ¸à¿ºP‰D$¡XщT$‰$èîÿÿ¸R‰D$¸Á¯‰D$¡Xщ$èóíÿÿ¸S‰D$¸Ý¯‰D$¡Xщ$èÔíÿÿ¸T¹ À‰D$¡XщL$‰$èµíÿÿ¸ù¯ºV‰D$¡XщT$‰$è–íÿÿ¸X‰D$¸°‰D$¡Xщ$èwíÿÿ¸Z‰D$¸-°‰D$¡Xщ$èXíÿÿ¸\¹G°‰D$¡XщL$‰$è9íÿÿ¸a°º^‰D$¡XщT$‰$èíÿÿ¸`‰D$¸{°‰D$¡Xщ$èûìÿÿ¸b‰D$¸`À‰D$¡Xщ$èÜìÿÿ¸c¹ À‰D$¡XщL$‰$è½ìÿÿ¸•°ºd‰D$¡XщT$‰$èžìÿÿ¸f‰D$¸àÀ‰D$¡Xщ$èìÿÿ¸e‰D$¸ Á‰D$¡Xщ$è`ìÿÿ¸g¹`Á‰D$¡XщL$‰$èAìÿÿ¸ Áºh‰D$¡XщT$‰$è"ìÿÿ¸j‰D$¸ÀÁ‰D$¡Xщ$èìÿÿ¸l‰D$¸­°‰D$¡Xщ$èäëÿÿ¸p¹Ä°‰D$¡XщL$‰$èÅëÿÿ¸àÁºq‰D$¡XщT$‰$è¦ëÿÿ¸r‰D$¸ ‰D$¡Xщ$è‡ëÿÿ¸s‰D$¸`‰D$¡Xщ$èhëÿÿ¸t¹€Â‰D$¡XщL$‰$èIëÿÿ¸à°ºv‰D$¡XщT$‰$è*ëÿÿ¸y‰D$¸þ°‰D$¡Xщ$è ëÿÿ¸z‰D$¸±‰D$¡Xщ$èìêÿÿ¸š -¹ Â‰D$¡XщL$‰$èÍêÿÿ¸Àº› -‰D$¡XщT$‰$è®êÿÿ¸œ -‰D$¸à‰D$¡Xщ$èêÿÿ¸ž -‰D$¸6±‰D$¡Xщ$èpêÿÿ¸Ÿ -¹O±‰D$¡XщL$‰$èQêÿÿ¸j±º£ -‰D$¡XщT$‰$è2êÿÿ¸¤ -‰D$¸‡±‰D$¡Xщ$èêÿÿ¸¥ -‰D$¸¤±‰D$¡Xщ$èôéÿÿ¸¦ -¹Â±‰D$¡XщL$‰$èÕéÿÿ¸ ú§ -‰D$¡XщT$‰$è¶éÿÿ¸¨ -‰D$¸à±‰D$¡Xщ$è—éÿÿ¸© -‰D$¸@ÉD$¡Xщ$èxéÿÿ¸° -¹`ÉD$¡XщL$‰$èYéÿÿ¸ Ãº¶ -‰D$¡XщT$‰$è:éÿÿ¸¼ -‰D$¸àÉD$¡Xщ$èéÿÿ¸Â -‰D$¸ ĉD$¡Xщ$èüèÿÿ¸È -¹`ĉD$¡XщL$‰$èÝèÿÿ¸ ÄºÎ -‰D$¡XщT$‰$è¾èÿÿ¸Ï -‰D$¸þ±‰D$¡Xщ$èŸèÿÿ¸Ð -‰D$¸àĉD$¡Xщ$è€èÿÿ¸Ò -¹Å‰D$¡XщL$‰$èaèÿÿ¸@ÅºÓ -‰D$¡XщT$‰$èBèÿÿ¸Ô -‰D$¸²‰D$¡Xщ$è#èÿÿ¸F‰D$¸€Å‰D$¡Xщ$èèÿÿ1À¹ Å‰D$¡XщL$‰$èèçÿÿ¸8²º‰D$¡XщT$‰$èÉçÿÿ¸‰D$¸àʼnD$¡Xщ$èªçÿÿ¸‰D$¸Æ‰D$¡Xщ$è‹çÿÿ¸¹@ƉD$¡XщL$‰$èlçÿÿ¸P²º‰D$¡XщT$‰$èMçÿÿ¸‰D$¸€Æ‰D$¡Xщ$è.çÿÿ¸‰D$¸ÀƉD$¡Xщ$èçÿÿ¸¹n²‰D$¡XщL$‰$èðæÿÿ¸‹²º‰D$¡XщT$‰$èÑæÿÿ¸(‰D$¸¨²‰D$¡Xщ$è²æÿÿ¸4‰D$¸Ç‰D$¡Xщ$è“æÿÿ¸6¹Æ²‰D$¡XщL$‰$ètæÿÿ¸@Ǻ8‰D$¡XщT$‰$èUæÿÿ¸<‰D$¸€Ç‰D$¡Xщ$è6æÿÿ¸@‰D$¸ÀljD$¡Xщ$èæÿÿ¸D¹ã²‰D$¡XщL$‰$èøåÿÿ¸ú²ºD‰D$¡XщT$‰$èÙåÿÿ¸D‰D$¸³‰D$¡Xщ$èºåÿÿ¸D ‰D$¸+³‰D$¡Xщ$è›åÿÿ¸H ¹È‰D$¡XщL$‰$è|åÿÿ¸ ȺH‰D$¡XщT$‰$è]åÿÿ¸L‰D$¸@ȉD$¡Xщ$è>åÿÿ¸T‰D$¸A³‰D$¡Xщ$èåÿÿ¸h¹\³‰D$¡XщL$‰$èåÿÿ¸z³ºl‰D$¡XщT$‰$èáäÿÿ¸t‰D$¸“³‰D$¡Xщ$èÂäÿÿ¸|‰D$¸±³‰D$¡Xщ$è£äÿÿ¸„¹Ï³‰D$¡XщL$‰$è„äÿÿ¸ç³1Ò‰D$¡XщT$‰$èhäÿÿ¸‰D$¸´‰D$¡Xщ$èIäÿÿ¸‰D$¸ ´‰D$¡Xщ$è*äÿÿ¸¹`ȉD$¡XщL$‰$è äÿÿ¸€Èº‰D$¡XщT$‰$èìãÿÿ¸‰D$¸ È‰D$¡Xщ$èÍãÿÿ¸ ‰D$¸àȉD$¡Xщ$è®ãÿÿ¸¹É‰D$¡XщL$‰$èãÿÿ¸;´º‰D$¡XщT$‰$èpãÿÿ¸‰D$¸ ɉD$¡Xщ$èQãÿÿ¸‰D$¸@ɉD$¡Xщ$è2ãÿÿ¸¹`ɉD$¡XщL$‰$èãÿÿ¸€Éº‰D$¡XщT$‰$èôâÿÿ¸ ‰D$¸V´‰D$¡Xщ$èÕâÿÿ¸$‰D$¸o´‰D$¡Xщ$è¶âÿÿ¸,¹ÀɉD$¡XщL$‰$è—âÿÿ¸Êº0‰D$¡XщT$‰$èxâÿÿ¸4‰D$¸@ʉD$¡Xщ$èYâÿÿ¸8‰D$¸€Ê‰D$¡Xщ$è:âÿÿ¸<¹ÀʉD$¡XщL$‰$èâÿÿ¸‹´º(‰D$¡XщT$‰$èüáÿÿ¸@‰D$¸¦´‰D$¡Xщ$èÝáÿÿ¸@@‰D$¸¿´‰D$¡Xщ$è¾áÿÿ¸@€¹Ý´‰D$¡XщL$‰$èŸáÿÿ¸ö´ºB€‰D$¡XщT$‰$è€áÿÿ¸D€‰D$¸Ë‰D$¡Xщ$èaáÿÿ¸H€‰D$¸µ‰D$¡Xщ$èBáÿÿ¸P€¹(µ‰D$¡XщL$‰$è#áÿÿ¸@˺Q€‰D$¡XщT$‰$èáÿÿ¸R€‰D$¸€Ë‰D$¡Xщ$èåàÿÿ¸S€‰D$¸ÀˉD$¡Xщ$èÆàÿÿ1À¹Ì‰D$¡XщL$‰$èªàÿÿ¸@̺‰D$¡XщT$‰$è‹àÿÿ¸‰D$¸€Ì‰D$¡Xщ$èlàÿÿ¸‰D$¸À̉D$¡Xщ$èMàÿÿ¸Fµ‰D$¡Xщ$è7àÿÿ¡XѺ͹‰T$‰L$‰$èàÿÿ¸‰D$¸@͉D$¡Xщ$èùßÿÿ¸_µ‰D$¡Xщ$èãßÿÿ¸‰D$¸€Í‰D$¡Xщ$èÄßÿÿ¸¹À͉D$¡XщL$‰$è¥ßÿÿ¡XѺxµ‰T$‰$èßÿÿ¸‰D$¸Î‰D$¡Xщ$èpßÿÿ¸‰D$¸@ΉD$¡Xщ$èQßÿÿ¸‘µ‰D$¡Xщ$è;ßÿÿ¸ -¹€Î‰D$¡XщL$‰$èßÿÿ¸Àκ -‰D$¡XщT$‰$èýÞÿÿ¸ªµ‰D$¡Xщ$èçÞÿÿ¸ ‰D$¸Ï‰D$¡Xщ$èÈÞÿÿ¸ ‰D$¸@ωD$¡Xщ$è©Þÿÿ¡Xѹõ‰L$‰$è“Þÿÿ¸€Ïº‰D$¡XщT$‰$ètÞÿÿÉ1ÀÃU‰åWV1öSƒì è Ã,,è)Þÿÿ“ÄþÿÿƒÄþÿÿ)ÂÁú9Ös‰×´&¼'ÿ”³ÄþÿÿF9þrôƒÄ [^_]ö¿U‰åƒì‰$èBÃÎ+‰t$ƒÄþÿÿ“Äþÿÿ)ÐÁø…Àpÿuè[‹$‹t$‰ì]Ãÿ”³Äþÿÿ‰ðN…Àuòëà‹$ÃU‰åSƒì»(Ñ¡(уøÿtv¼'ƒëÿЋƒøÿuôX[]ÃU‰åSè[ÃC+RèêÝÿÿ‹]üÉÃ#define Flags CPU + %d -#define BranchSkip CPU + %d -#define NMIActive CPU + %d -#define IRQActive CPU + %d -#define InDMA CPU + %d -#define WhichEvent CPU + %d -#define PCS CPU + %d -#define PCBase CPU + %d -#define WaitAddress CPU + %d -#define WaitCounter CPU + %d -#define Cycles CPU + %d -#define NextEvent CPU + %d -#define V_Counter CPU + %d -#define MemSpeed CPU + %d -#define MemSpeedx2 CPU + %d -#define PB Registers + %d -#define DB Registers + %d -#define PP Registers + %d -#define PL Registers + %d +ELFÀƒ4àQ4 (44€4€  TTT€€,I,IôNôÞôÞ(4Oßßèèhhh QåtdRåtdôNôÞôÞ  €e(/lib/ld-linux.so.2GNU # )Œ­KãÀ$  z¹k}r$d àUè¦libstdc++.so.6_Jv_RegisterClasses__gmon_start__libm.so.6libgcc_s.so.1libc.so.6_IO_stdin_usedstdoutfwritefprintf__libc_start_mainGLIBC_2.0Kii Œðß àààà àU‰åƒìèèØè3#ÉÃÿ5øßÿ%üßÿ%àhéàÿÿÿÿ%àhéÐÿÿÿÿ%àhéÀÿÿÿÿ% àhé°ÿÿÿ1í^‰áƒäðPTRh ¦h0¦QVhp„è¯ÿÿÿôU‰åSƒìè[Ã\‹“üÿÿÿ…ÒtèzÿÿÿX[ÉÃU‰åƒì€=$àt ëƒÀ£àÿÒ¡à‹…ÒuëÆ$àÉÃU‰åƒì¡ß…Àt¸…Àt Ç$ßÿÐÉÃL$ƒäðÿqü1ÀQƒì‰D$¸ì¦‰D$¡ à‰$èÿÿÿ¹§¸‰L$‰D$¡ à‰$è÷þÿÿº¸#§‰T$‰D$¡ à‰$èØþÿÿ¸‰D$¸@§‰D$¡ à‰$è¹þÿÿ¸‰D$¸´‰D$¡ à‰$èšþÿÿ¹]§¸‰L$‰D$¡ à‰$è{þÿÿº ¸v§‰T$‰D$¡ à‰$è\þÿÿ¸ ‰D$¸”§‰D$¡ à‰$è=þÿÿ¸‰D$¸«§‰D$¡ à‰$èþÿÿ¹,´¸‰L$‰D$¡ à‰$èÿýÿÿº¸P´‰T$‰D$¡ à‰$èàýÿÿ¸‰D$¸p´‰D$¡ à‰$èÁýÿÿ¸ ‰D$¸Å§‰D$¡ à‰$è¢ýÿÿ¹ß§¸$‰L$‰D$¡ à‰$èƒýÿÿº(¸ü§‰T$‰D$¡ à‰$èdýÿÿ¸,‰D$¸¨‰D$¡ à‰$èEýÿÿ¸0‰D$¸5¨‰D$¡ à‰$è&ýÿÿ¹´¸4‰L$‰D$¡ à‰$èýÿÿº8¸°´‰T$‰D$¡ à‰$èèüÿÿ¸<‰D$¸Ô´‰D$¡ à‰$èÉüÿÿ¸@‰D$¸ô´‰D$¡ à‰$èªüÿÿ¹µ¸E‰L$‰D$¡ à‰$è‹üÿÿºD¸Dµ‰T$‰D$¡ à‰$èlüÿÿ¸H‰D$¸dµ‰D$¡ à‰$èMüÿÿ¸L‰D$¸ˆµ‰D$¡ à‰$è.üÿÿ¹S¨1À‰L$‰D$¡ à‰$èüÿÿº¸o¨‰T$‰D$¡ à‰$èóûÿÿ¸‰D$¸‹¨‰D$¡ à‰$èÔûÿÿ¸‰D$¸§¨‰D$¡ à‰$èµûÿÿ¡ ้L$Ç$è‰D$ ¸‰D$è~ûÿÿº¸Ö¨‰T$‰D$¡ à‰$èoûÿÿ¸‰D$¸ò¨‰D$¡ à‰$èPûÿÿ¡ àÇ$©‰D$ ¸‰D$¸‰D$èûÿÿ¹!©¸‰L$‰D$¡ à‰$è +ûÿÿº¸=©‰T$‰D$¡ à‰$èëúÿÿ¡ àÇ$Y©‰D$ ¸‰D$¸‰D$è´úÿÿ¸‰D$¸l©‰D$¡ à‰$è¥úÿÿ¹ˆ©¸‰L$‰D$¡ à‰$è†úÿÿ¡ ຉT$Ç$¤©‰D$ ¸‰D$èOúÿÿ¸ +‰D$¸·©‰D$¡ à‰$è@úÿÿ¸ +‰D$¸Ó©‰D$¡ à‰$è!úÿÿ¡ ้L$Ç$爫D$ ¸‰D$èêùÿÿº ¸ª‰T$‰D$¡ à‰$èÛùÿÿ¸ ‰D$¸ª‰D$¡ à‰$è¼ùÿÿ¡ àÇ$:ª‰D$ ¸‰D$¸‰D$è…ùÿÿ¹Mª¸‰L$‰D$¡ à‰$èvùÿÿ1Ò¸jª‰T$‰D$¡ à‰$èZùÿÿ¸‰D$¸„ª‰D$¡ à‰$è;ùÿÿ¸‰D$¸žª‰D$¡ à‰$èùÿÿ¹¹ª¸ ‰L$‰D$¡ à‰$èýøÿÿº¸Ôª‰T$‰D$¡ à‰$èÞøÿÿ¸‰D$¸ðª‰D$¡ à‰$è¿øÿÿ¸‰D$¸«‰D$¡ à‰$è øÿÿ¹*«¸‰L$‰D$¡ à‰$èøÿÿº¸F«‰T$‰D$¡ à‰$èbøÿÿ¸ ‰D$¸¬µ‰D$¡ à‰$èCøÿÿ¸$‰D$¸Ìµ‰D$¡ à‰$è$øÿÿ¹b«¸(‰L$‰D$¡ à‰$èøÿÿº(@¸ìµ‰T$‰D$¡ à‰$èæ÷ÿÿ¸(€‰D$¸ ¶‰D$¡ à‰$èÇ÷ÿÿ¸(‰D$¸0¶‰D$¡ à‰$è¨÷ÿÿ¹T¶¸( ‰L$‰D$¡ à‰$è‰÷ÿÿºxиx¶‰T$‰D$¡ à‰$èj÷ÿÿ1À‰D$¸|«‰D$¡ à‰$èN÷ÿÿ¸‰D$¸—«‰D$¡ à‰$è/÷ÿÿ¹œ¶¸ ‰L$‰D$¡ à‰$è÷ÿÿº¸À¶‰T$‰D$¡ à‰$èñöÿÿ¸ ‰D$¸²«‰D$¡ à‰$èÒöÿÿ¸‰D$¸ä¶‰D$¡ à‰$è³öÿÿ¹·¸‰L$‰D$¡ à‰$è”öÿÿº¸(·‰T$‰D$¡ à‰$èuöÿÿ¸‰D$¸L·‰D$¡ à‰$èVöÿÿ¸ ‰D$¸p·‰D$¡ à‰$è7öÿÿ¹”·¸$‰L$‰D$¡ à‰$èöÿÿº(¸Í«‰T$‰D$¡ à‰$èùõÿÿ¸)‰D$¸ë«‰D$¡ à‰$èÚõÿÿ¸*‰D$¸¼·‰D$¡ à‰$è»õÿÿ¹à·¸,‰L$‰D$¡ à‰$èœõÿÿº0¸ ¸‰T$‰D$¡ à‰$è}õÿÿ1À‰D$¸¬‰D$¡ à‰$èaõÿÿ¸‰D$¸%¬‰D$¡ à‰$èBõÿÿ¹C¬¸‰L$‰D$¡ à‰$è#õÿÿº¸0¸‰T$‰D$¡ à‰$èõÿÿ¸‰D$¸T¸‰D$¡ à‰$èåôÿÿ¸ ‰D$¸_¬‰D$¡ à‰$èÆôÿÿ¹t¸¸‹‰L$‰D$¡ à‰$è§ôÿÿºÌ¸y¬‰T$‰D$¡ à‰$èˆôÿÿ¸Ò‰D$¸”¸‰D$¡ à‰$èiôÿÿ¸Ø‰D$¸¸¸‰D$¡ à‰$èJôÿÿ¹Ü¸¸Û‰L$‰D$¡ à‰$è+ôÿÿ1Ò¸•¬‰T$‰D$¡ à‰$èôÿÿ¸‰D$¸¹‰D$¡ à‰$èðóÿÿ¸‰D$¸²¬‰D$¡ à‰$èÑóÿÿ¹Í¬¸ ‰L$‰D$¡ à‰$è²óÿÿº +¸ç¬‰T$‰D$¡ à‰$è“óÿÿ¸ ‰D$¸­‰D$¡ à‰$ètóÿÿ¸‰D$¸#­‰D$¡ à‰$èUóÿÿ¹A­¸‰L$‰D$¡ à‰$è6óÿÿº ¸$¹‰T$‰D$¡ à‰$èóÿÿ¸‰D$¸_­‰D$¡ à‰$èøòÿÿ¸‰D$¸|­‰D$¡ à‰$èÙòÿÿ¹H¹1À‰L$‰D$¡ à‰$è½òÿÿº¸l¹‰T$‰D$¡ à‰$èžòÿÿ¸‰D$¸¹‰D$¡ à‰$èòÿÿ¸‰D$¸–­‰D$¡ à‰$è`òÿÿ¹¸¹¸‰L$‰D$¡ à‰$èAòÿÿº ¸Ü¹‰T$‰D$¡ à‰$è"òÿÿ¸‰D$¸º‰D$¡ à‰$èòÿÿ¸‰D$¸,º‰D$¡ à‰$èäñÿÿ¹´­¸‰L$‰D$¡ à‰$èÅñÿÿºl¸Lº‰T$‰D$¡ à‰$è¦ñÿÿ¸R‰D$¸pº‰D$¡ à‰$è‡ñÿÿ¸P‰D$¸”º‰D$¡ à‰$èhñÿÿ¹¼º¸u‰L$‰D$¡ à‰$èIñÿÿ1Ҹ争T$‰D$¡ à‰$è-ñÿÿ¸‰D$¸»‰D$¡ à‰$èñÿÿ¸‰D$¸,»‰D$¡ à‰$èïðÿÿ¹P»¸‰L$‰D$¡ à‰$èÐðÿÿº¸t»‰T$‰D$¡ à‰$è±ðÿÿ¸‰D$¸˜»‰D$¡ à‰$è’ðÿÿ¸‰D$¸¼»‰D$¡ à‰$èsðÿÿ¹à»¸‰L$‰D$¡ à‰$èTðÿÿ1ҸЭ‰T$‰D$¡ à‰$è8ðÿÿ¸‰D$¸¼‰D$¡ à‰$èðÿÿ¸‰D$¸ê­‰D$¡ à‰$èúïÿÿ¹®¸‰L$‰D$¡ à‰$èÛïÿÿº¸"®‰T$‰D$¡ à‰$è¼ïÿÿ¸‰D$¸:®‰D$¡ à‰$èïÿÿ¸‰D$¸V®‰D$¡ à‰$è~ïÿÿ¹$¼¸ +‰L$‰D$¡ à‰$è_ïÿÿº ¸p®‰T$‰D$¡ à‰$è@ïÿÿ¸>‰D$¸Š®‰D$¡ à‰$è!ïÿÿ¸@‰D$¸¤®‰D$¡ à‰$èïÿÿ¹L¼¸@‰L$‰D$¡ à‰$èãîÿÿºA¸¾®‰T$‰D$¡ à‰$èÄîÿÿ¸B‰D$¸Ü®‰D$¡ à‰$è¥îÿÿ¸B‰D$¸l¼‰D$¡ à‰$è†îÿÿ¹ó®¸D‰L$‰D$¡ à‰$ègîÿÿºG¸¯‰T$‰D$¡ à‰$èHîÿÿ¸H‰D$¸”¼‰D$¡ à‰$è)îÿÿ¸J‰D$¸¸¼‰D$¡ à‰$è +îÿÿ¹Ø¼¸L‰L$‰D$¡ à‰$èëíÿÿºN¸ø¼‰T$‰D$¡ à‰$èÌíÿÿ¸P‰D$¸½‰D$¡ à‰$è­íÿÿ¸R‰D$¸)¯‰D$¡ à‰$èŽíÿÿ¹F¯¸S‰L$‰D$¡ à‰$èoíÿÿºT¸@½‰T$‰D$¡ à‰$èPíÿÿ¸V‰D$¸c¯‰D$¡ à‰$è1íÿÿ¸X‰D$¸~¯‰D$¡ à‰$èíÿÿ¹™¯¸Z‰L$‰D$¡ à‰$èóìÿÿº\¸´¯‰T$‰D$¡ à‰$èÔìÿÿ¸^‰D$¸Ï¯‰D$¡ à‰$èµìÿÿ¸`‰D$¸ê¯‰D$¡ à‰$è–ìÿÿ¹h½¸b‰L$‰D$¡ à‰$èwìÿÿºc¸½‰T$‰D$¡ à‰$èXìÿÿ¸d‰D$¸°‰D$¡ à‰$è9ìÿÿ¸f‰D$¸¸½‰D$¡ à‰$èìÿÿ¹Ü½¸e‰L$‰D$¡ à‰$èûëÿÿºg¸¾‰T$‰D$¡ à‰$èÜëÿÿ¸h‰D$¸$¾‰D$¡ à‰$è½ëÿÿ¸j‰D$¸D¾‰D$¡ à‰$èžëÿÿ¹°¸l‰L$‰D$¡ à‰$èëÿÿºp¸6°‰T$‰D$¡ à‰$è`ëÿÿ¸q‰D$¸d¾‰D$¡ à‰$èAëÿÿ¸r‰D$¸ˆ¾‰D$¡ à‰$è"ëÿÿ¹¬¾¸s‰L$‰D$¡ à‰$èëÿÿºt¸Ð¾‰T$‰D$¡ à‰$èäêÿÿ¸v‰D$¸ô¾‰D$¡ à‰$èÅêÿÿ¸y‰D$¸¿‰D$¡ à‰$è¦êÿÿ¹S°¸z‰L$‰D$¡ à‰$è‡êÿÿºš +¸4¿‰T$‰D$¡ à‰$èhêÿÿ¸› +‰D$¸X¿‰D$¡ à‰$èIêÿÿ¸œ +‰D$¸|¿‰D$¡ à‰$è*êÿÿ¹n°¸ž +‰L$‰D$¡ à‰$è êÿÿºŸ +¸ˆ°‰T$‰D$¡ à‰$èìéÿÿ¸£ +‰D$¸¤°‰D$¡ à‰$èÍéÿÿ¸¤ +‰D$¸Â°‰D$¡ à‰$è®éÿÿ¹ ¿¸¥ +‰L$‰D$¡ à‰$èéÿÿº¦ +¸À¿‰T$‰D$¡ à‰$èpéÿÿ¸§ +‰D$¸à¿‰D$¡ à‰$èQéÿÿ¸¨ +‰D$¸À‰D$¡ à‰$è2éÿÿ¹ À¸© +‰L$‰D$¡ à‰$èéÿÿº° +¸@À‰T$‰D$¡ à‰$èôèÿÿ¸¶ +‰D$¸lÀ‰D$¡ à‰$èÕèÿÿ¸¼ +‰D$¸”À‰D$¡ à‰$è¶èÿÿ¹¼À¸Â +‰L$‰D$¡ à‰$è—èÿÿºÈ +¸äÀ‰T$‰D$¡ à‰$èxèÿÿ¸Î +‰D$¸ Á‰D$¡ à‰$èYèÿÿ¸Ï +‰D$¸à°‰D$¡ à‰$è:èÿÿ¹4Á¸Ð +‰L$‰D$¡ à‰$èèÿÿºÒ +¸XÁ‰T$‰D$¡ à‰$èüçÿÿ¸Ó +‰D$¸|Á‰D$¡ à‰$èÝçÿÿ¸Ô +‰D$¸þ°‰D$¡ à‰$è¾çÿÿ¹¤Á¸F‰L$‰D$¡ à‰$èŸçÿÿ1Ò¸ÈÁ‰T$‰D$¡ à‰$èƒçÿÿ¸‰D$¸±‰D$¡ à‰$èdçÿÿ¸‰D$¸ìÁ‰D$¡ à‰$èEçÿÿ¹ ¸‰L$‰D$¡ à‰$è&çÿÿº¸0‰T$‰D$¡ à‰$èçÿÿ¸‰D$¸T‰D$¡ à‰$èèæÿÿ¸‰D$¸t‰D$¡ à‰$èÉæÿÿ¹˜Â¸‰L$‰D$¡ à‰$èªæÿÿº¸5±‰T$‰D$¡ à‰$è‹æÿÿ¸‰D$¸S±‰D$¡ à‰$èlæÿÿ¸(‰D$¸¼Â‰D$¡ à‰$èMæÿÿ¹Ü¸4‰L$‰D$¡ à‰$è.æÿÿº6¸q±‰T$‰D$¡ à‰$èæÿÿ¸8‰D$¸Ã‰D$¡ à‰$èðåÿÿ¸<‰D$¸(ÉD$¡ à‰$èÑåÿÿ¹Tø@‰L$‰D$¡ à‰$è²åÿÿºD¸±‰T$‰D$¡ à‰$è“åÿÿ¸D‰D$¸§±‰D$¡ à‰$ètåÿÿ¸D‰D$¸Á±‰D$¡ à‰$èUåÿÿ¹Ú±¸D ‰L$‰D$¡ à‰$è6åÿÿºH ¸|ÉT$‰D$¡ à‰$èåÿÿ¸H‰D$¸ Ã‰D$¡ à‰$èøäÿÿ¸L‰D$¸ÄÉD$¡ à‰$èÙäÿÿ¹ñ±¸T‰L$‰D$¡ à‰$èºäÿÿºh¸äÉT$‰D$¡ à‰$è›äÿÿ¸l‰D$¸ ²‰D$¡ à‰$è|äÿÿ¸t‰D$¸Ä‰D$¡ à‰$è]äÿÿ¹$ĸ|‰L$‰D$¡ à‰$è>äÿÿº„¸'²‰T$‰D$¡ à‰$èäÿÿ1À‰D$¸@²‰D$¡ à‰$èäÿÿ¸‰D$¸^²‰D$¡ à‰$èäãÿÿ¹{²¸‰L$‰D$¡ à‰$èÅãÿÿº¸DĉT$‰D$¡ à‰$è¦ãÿÿ¸‰D$¸dĉD$¡ à‰$è‡ãÿÿ¸‰D$¸„ĉD$¡ à‰$èhãÿÿ¹¨Ä¸ ‰L$‰D$¡ à‰$èIãÿÿº¸ÈĉT$‰D$¡ à‰$è*ãÿÿ¸‰D$¸—²‰D$¡ à‰$è ãÿÿ¸‰D$¸èĉD$¡ à‰$èìâÿÿ¹Å¸‰L$‰D$¡ à‰$èÍâÿÿº¸(ʼnT$‰D$¡ à‰$è®âÿÿ¸‰D$¸HʼnD$¡ à‰$èâÿÿ¸ ‰D$¸³²‰D$¡ à‰$èpâÿÿ¹Í²¸$‰L$‰D$¡ à‰$èQâÿÿº,¸tʼnT$‰D$¡ à‰$è2âÿÿ¸0‰D$¸œÅ‰D$¡ à‰$èâÿÿ¸4‰D$¸ÀʼnD$¡ à‰$èôáÿÿ¹äŸ8‰L$‰D$¡ à‰$èÕáÿÿº<¸ ƉT$‰D$¡ à‰$è¶áÿÿ¸(‰D$¸ê²‰D$¡ à‰$è—áÿÿ¸@‰D$¸³‰D$¡ à‰$èxáÿÿ¹4Ƹ@@‰L$‰D$¡ à‰$èYáÿÿº@€¸ ³‰T$‰D$¡ à‰$è:áÿÿ¸B€‰D$¸:³‰D$¡ à‰$èáÿÿ¸D€‰D$¸TƉD$¡ à‰$èüàÿÿ¹T³¸H€‰L$‰D$¡ à‰$èÝàÿÿºP€¸xƉT$‰D$¡ à‰$è¾àÿÿ¸Q€‰D$¸˜Æ‰D$¡ à‰$èŸàÿÿ¸R€‰D$¸ÀƉD$¡ à‰$è€àÿÿ¹äƸS€‰L$‰D$¡ à‰$èaàÿÿ1Ò¸ ljT$‰D$¡ à‰$èEàÿÿ¸‰D$¸0ljD$¡ à‰$è&àÿÿ¸‰D$¸TljD$¡ à‰$èàÿÿ¹xǸ‰L$‰D$¡ à‰$èèßÿÿ¡ ຉT$Ç$n³‰D$ ¸‰D$è±ßÿÿ¸‰D$¸œÇ‰D$¡ à‰$è¢ßÿÿ¸‰D$¸ÀljD$¡ à‰$èƒßÿÿ¡ ้L$Ç$‡³‰D$ ¸‰D$èLßÿÿº¸äljT$‰D$¡ à‰$è=ßÿÿ¸‰D$¸È‰D$¡ à‰$èßÿÿ¡ àÇ$ ³‰D$ ¸‰D$¸‰D$èçÞÿÿ¹,ȸ‰L$‰D$¡ à‰$èØÞÿÿº¸PȉT$‰D$¡ à‰$è¹Þÿÿ¡ àÇ$¹³‰D$ ¸‰D$¸‰D$è‚Þÿÿ¸ +‰D$¸tȉD$¡ à‰$èsÞÿÿ¹˜È¸ +‰L$‰D$¡ à‰$èTÞÿÿ¡ ຉT$Ç$Ò³‰D$ ¸‰D$èÞÿÿ¸ ‰D$¸¼È‰D$¡ à‰$èÞÿÿ¸ ‰D$¸àȉD$¡ à‰$èïÝÿÿ¡ ้L$Ç$볉D$ ¸‰D$è¸Ýÿÿº¸É‰T$‰D$¡ à‰$è©ÝÿÿƒÄ1ÀYaüÃU‰å]Ãt&¼'U‰åWVSè\ù9ƒìèÝÿÿƒÿÿÿ“ÿÿÿ)ÐÁø‰Eðt01ÿ‰Ö¶¼'‹EG‰D$‹E ‰D$‹E‰$ÿƒÆ9}ðuáƒÄ[^_]Ë$ÃU‰åS»ôÞƒì¡ôÞƒøÿt ƒëÿЋƒøÿuôƒÄ[ÉÃU‰åSƒìè[à 9è0ÝÿÿY[ÉÃ#define Flags CPU + %ld +#define BranchSkip CPU + %ld +#define NMIActive CPU + %ld +#define IRQActive CPU + %ld +#define InDMA CPU + %ld +#define WhichEvent CPU + %ld +#define PCS CPU + %ld +#define PCBase CPU + %ld +#define Cycles CPU + %ld +#define NextEvent CPU + %ld +#define V_Counter CPU + %ld +#define MemSpeed CPU + %ld +#define MemSpeedx2 CPU + %ld +#define PB Registers + %ld +#define DB Registers + %ld +#define PP Registers + %ld +#define PL Registers + %ld #define PH PL + 1 -#define AA Registers + %d -#define AL Registers + %d +#define AA Registers + %ld +#define AL Registers + %ld #define AH AL + 1 -#define DD Registers + %d -#define DL Registers + %d +#define DD Registers + %ld +#define DL Registers + %ld #define DH DL + 1 -#define SS Registers + %d -#define SL Registers + %d +#define SS Registers + %ld +#define SL Registers + %ld #define SH SL + 1 -#define XX Registers + %d -#define XL Registers + %d +#define XX Registers + %ld +#define XL Registers + %ld #define XH XL + 1 -#define YY Registers + %d -#define YL Registers + %d +#define YY Registers + %ld +#define YL Registers + %ld #define YH YL + 1 -#define PCR Registers + %d -#define RAM Memory + %d -#define ROM Memory + %d -#define VRAM Memory + %d -#define SRAM Memory + %d -#define BWRAM Memory + %d -#define FillRAM Memory + %d -#define C4RAM Memory + %d -#define HiROM Memory + %d -#define LoROM Memory + %d -#define SRAMMask Memory + %d -#define SRAMSize Memory + %d -#define Map Memory + %d -#define WriteMap Memory + %d -#define APUPCS IAPU + %d -#define APURAM IAPU + %d -#define APUBit IAPU + %d -#define APUAddress IAPU + %d -#define APU_Carry IAPU + %d -#define APU_Zero IAPU + %d -#define APUCycles APU + %d -#define APUShowROM APU + %d -#define APUFlags APU + %d -#define APUOutPorts APU + %d -#define APUDSP APU + %d -#define APUExtraRAM APU + %d -#define APUTimer APU + %d -#define CPUSpeed ICPU + %d -#define CPUOpcodes ICPU + %d -#define _Carry ICPU + %d -#define _Zero ICPU + %d -#define _Negative ICPU + %d -#define _Overflow ICPU + %d -#define ShiftedDB ICPU + %d -#define ShiftedPB ICPU + %d -#define Scanline ICPU + %d -#define Frame ICPU + %d -#define H_Max Settings + %d -#define Paused Settings + %d -#define PAL Settings + %d -#define BGMode PPU + %d -#define BG3Priority PPU + %d -#define Brightness PPU + %d -#define GHight PPU + %d -#define GInc PPU + %d -#define GAddress PPU + %d -#define GMask1 PPU + %d -#define GShift PPU + %d -#define CGFLIP PPU + %d -#define CGDATA PPU + %d -#define FirstSprite PPU + %d -#define LastSprite PPU + %d -#define OBJ PPU + %d -#define OAMAddr PPU + %d -#define OAMFlip PPU + %d -#define IRQVBeamPos PPU + %d -#define IRQHBeamPos PPU + %d -#define HBeamFlip PPU + %d -#define VBeamFlip PPU + %d -#define MatrixA PPU + %d -#define MatrixB PPU + %d -#define MatrixC PPU + %d -#define MatrixD PPU + %d -#define CentreX PPU + %d -#define CentreY PPU + %d -#define CGADD PPU + %d -#define WRAM PPU + %d -#define BG_Forced PPU + %d -#define OBJNameBase PPU + %d -#define OAMReadFlip PPU + %d -#define OAMData PPU + %d -#define Mosaic PPU + %d -#define BGMosaic PPU + %d -#define Mode7HFlip PPU + %d -#define Mode7VFlip PPU + %d -#define Mode7Repeat PPU + %d -#define Window1Left PPU + %d -#define Window2Left PPU + %d -#define CGFLIPRead PPU + %d -#define MouseSpeed PPU + %d -#define HDMA IPPU + %d -#define OBJChanged IPPU + %d -#define FrameSkip IPPU + %d -#define TileCache IPPU + %d -#define TileCached IPPU + %d -#define Interlace IPPU + %d -#define Red IPPU + %d -#define Green IPPU + %d -#define Blue IPPU + %d -#define XB IPPU + %d -#define Joypads IPPU + %d -#define SuperScope IPPU + %d -#define Mouse IPPU + %d -#define PrevMouseX IPPU + %d -#define PrevMouseY IPPU + %d -#define Clip IPPU + %d -#define SA1Opcodes SA1 + %d -#define SA1_Carry SA1 + %d -#define SA1_Zero SA1 + %d -#define SA1Flags SA1 + %d -#define SA1PCS SA1 + %d -#define SA1PCBase SA1 + %d -#define SA1BWRAM SA1 + %d -#define SA1Map SA1 + %d -#define SA1WriteMap SA1 + %d -#define SA1op1 SA1 + %d -#define SA1op2 SA1 + %d -#define SA1sum SA1 + %d -#define SA1overflow SA1 + %d +#define PCR Registers + %ld +#define RAM Memory + %ld +#define ROM Memory + %ld +#define VRAM Memory + %ld +#define SRAM Memory + %ld +#define BWRAM Memory + %ld +#define FillRAM Memory + %ld +#define C4RAM Memory + %ld +#define HiROM Memory + %ld +#define LoROM Memory + %ld +#define Map Memory + %ld +#define APUPCS IAPU + %ld +#define APURAM IAPU + %ld +#define APUBit IAPU + %ld +#define APU_Carry IAPU + %ld +#define APU_Zero IAPU + %ld +#define APUCycles APU + %ld +#define APUShowROM APU + %ld +#define APUFlags APU + %ld +#define APUDSP APU + %ld +#define APUTimer APU + %ld +#define CPUSpeed ICPU + %ld +#define _Carry ICPU + %ld +#define _Zero ICPU + %ld +#define _Negative ICPU + %ld +#define _Overflow ICPU + %ld +#define ShiftedDB ICPU + %ld +#define ShiftedPB ICPU + %ld +#define Scanline ICPU + %ld +#define Frame ICPU + %ld +#define H_Max Settings + %ld +#define PAL Settings + %ld +#define BGMode PPU + %ld +#define Brightness PPU + %ld +#define GHight PPU + %ld +#define GInc PPU + %ld +#define GAddress PPU + %ld +#define GMask1 PPU + %ld +#define GShift PPU + %ld +#define CGFLIP PPU + %ld +#define CGDATA PPU + %ld +#define LastSprite PPU + %ld +#define OBJ PPU + %ld +#define OAMAddr PPU + %ld +#define OAMFlip PPU + %ld +#define HBeamFlip PPU + %ld +#define VBeamFlip PPU + %ld +#define MatrixA PPU + %ld +#define MatrixB PPU + %ld +#define MatrixC PPU + %ld +#define MatrixD PPU + %ld +#define CentreX PPU + %ld +#define CentreY PPU + %ld +#define CGADD PPU + %ld +#define WRAM PPU + %ld +#define BG_Forced PPU + %ld +#define OAMData PPU + %ld +#define Mosaic PPU + %ld +#define BGMosaic PPU + %ld +#define Mode7HFlip PPU + %ld +#define Mode7VFlip PPU + %ld +#define CGFLIPRead PPU + %ld +#define MouseSpeed PPU + %ld +#define HDMA IPPU + %ld +#define FrameSkip IPPU + %ld +#define TileCache IPPU + %ld +#define Interlace IPPU + %ld +#define Red IPPU + %ld +#define Green IPPU + %ld +#define Blue IPPU + %ld +#define XB IPPU + %ld +#define Joypads IPPU + %ld +#define Mouse IPPU + %ld +#define Clip IPPU + %ld +#define SA1Opcodes SA1 + %ld +#define SA1_Carry SA1 + %ld +#define SA1_Zero SA1 + %ld +#define SA1Flags SA1 + %ld +#define SA1PCS SA1 + %ld +#define SA1PCBase SA1 + %ld +#define SA1BWRAM SA1 + %ld +#define SA1Map SA1 + %ld +#define SA1op1 SA1 + %ld +#define SA1op2 SA1 + %ld +#define SA1sum SA1 + %ld #define SA1PH SA1PL + 1 #define SA1AH SA1AL + 1 #define SA1DH SA1DL + 1 #define SA1SH SA1SL + 1 #define SA1XH SA1XL + 1 #define SA1YH SA1YL + 1 -#define WaitingForInterrupt CPU + %d -#define PCAtOpcodeStart CPU + %d -#define FastROMSpeed CPU + %d -#define AutoSaveTimer CPU + %d -#define SRAMModified CPU + %d -#define NMITriggerPoint CPU + %d -#define TriedInterleavedMode2 CPU + %d -#define BRKTriggered CPU + %d -#define NMICycleCount CPU + %d -#define IRQCycleCount CPU + %d -#define MemorySpeed Memory + %d -#define BlockIsRAM Memory + %d -#define BlockIsROM Memory + %d -#define ROMFilename Memory + %d -#define APUExecuting IAPU + %d -#define APUDirectPage IAPU + %d -#define APUWaitAddress1 IAPU + %d -#define APUWaitAddress2 IAPU + %d -#define APUWaitCounter IAPU + %d -#define APUShadowRAM IAPU + %d -#define APUCachedSamples IAPU + %d -#define APU_Overflow IAPU + %d -#define APUTimerErrorCounter IAPU + %d -#define APUKeyedChannels APU + %d -#define APUTimerTarget APU + %d -#define APUTimerEnabled APU + %d -#define TimerValueWritten APU + %d -#define CPUExecuting ICPU + %d -#define APUEnabled Settings + %d -#define Shutdown Settings + %d -#define SoundSkipMethod Settings + %d -#define HBlankStart Settings + %d -#define CyclesPercentage Settings + %d -#define DisableIRQ Settings + %d -#define SoundSync Settings + %d -#define SA1Enabled Settings + %d -#define SuperFXEnabled Settings + %d -#define ApuP APURegisters + %d -#define ApuYA APURegisters + %d -#define ApuA APURegisters + %d -#define ApuY APURegisters + %d -#define ApuX APURegisters + %d -#define ApuS APURegisters + %d -#define ApuPC APURegisters + %d -#define APUPCR APURegisters + %d -#define GFullGraphicCount PPU + %d -#define OAMPriorityRotation PPU + %d -#define OAMTileAddress PPU + %d -#define VBeamPosLatched PPU + %d -#define HBeamPosLatched PPU + %d -#define HVBeamCounterLatched PPU + %d -#define Joypad1ButtonReadPos PPU + %d -#define Joypad2ButtonReadPos PPU + %d -#define FixedColourGreen PPU + %d -#define FixedColourRed PPU + %d -#define FixedColourBlue PPU + %d -#define SavedOAMAddr PPU + %d -#define ScreenHeight PPU + %d -#define ForcedBlanking PPU + %d -#define OBJThroughMain PPU + %d -#define OBJThroughSub PPU + %d -#define OBJSizeSelect PPU + %d -#define VTimerEnabled PPU + %d -#define HTimerEnabled PPU + %d -#define HTimerPosition PPU + %d -#define Window1Right PPU + %d -#define Window2Right PPU + %d -#define ClipWindowOverlapLogic PPU + %d -#define ClipWindow1Enable PPU + %d -#define ClipWindow2Enable PPU + %d -#define ClipWindow1Inside PPU + %d -#define ClipWindow2Inside PPU + %d -#define RecomputeClipWindows PPU + %d -#define OBJNameSelect PPU + %d -#define Need16x8Mulitply PPU + %d -#define Joypad3ButtonReadPos PPU + %d -#define RangeTimeOver PPU + %d -#define ColorsChanged IPPU + %d -#define HDMAStarted IPPU + %d -#define MaxBrightness IPPU + %d -#define LatchedBlanking IPPU + %d -#define RenderThisFrame IPPU + %d -#define SkippedFrames IPPU + %d -#define FirstVRAMRead IPPU + %d -#define DoubleWidthPixels IPPU + %d -#define RenderedScreenHeight IPPU + %d -#define RenderedScreenWidth IPPU + %d -#define ScreenColors IPPU + %d -#define PreviousLine IPPU + %d -#define CurrentLine IPPU + %d -#define SA1_Negative SA1 + %d -#define SA1_Overflow SA1 + %d -#define SA1CPUExecuting SA1 + %d -#define SA1ShiftedPB SA1 + %d -#define SA1ShiftedDB SA1 + %d -#define SA1Executing SA1 + %d -#define SA1NMIActive SA1 + %d -#define SA1IRQActive SA1 + %d -#define SA1WaitingForInterrupt SA1 + %d -#define SA1PCAtOpcodeStart SA1 + %d -#define SA1WaitAddress SA1 + %d -#define SA1WaitCounter SA1 + %d -#define SA1WaitByteAddress1 SA1 + %d -#define SA1WaitByteAddress2 SA1 + %d -#define SA1arithmetic_op SA1 + %d -#define VirtualBitmapFormat SA1 + %d -#define SA1_in_char_dma SA1 + %d -#define SA1variable_bit_pos SA1 + %d -#define SA1PB SA1Registers + %d -#define SA1DB SA1Registers + %d -#define SA1PP SA1Registers + %d -#define SA1PL SA1Registers + %d -#define SA1AA SA1Registers + %d -#define SA1AL SA1Registers + %d -#define SA1DD SA1Registers + %d -#define SA1DL SA1Registers + %d -#define SA1SS SA1Registers + %d -#define SA1SL SA1Registers + %d -#define SA1XX SA1Registers + %d -#define SA1XL SA1Registers + %d -#define SA1YY SA1Registers + %d -#define SA1YL SA1Registers + %d -#define SA1PCR SA1Registers + %d -;dÌ´ÿÿ„4ÑzP||ƒ ˆ p„Œ A…D HR` Dƒ ð¥h‚œ -¯ <Ñ,ƒƒþÿÿoÜ‚ÿÿÿoðÿÿoÌ‚ÿÿÿÿÿÿÿÿHÐrƒ‚ƒ’ƒGCC: (GNU) 3.3.5 (Debian 1:3.3.5-1)GCC: (GNU) 3.3.5 (Debian 1:3.3.5-1)GCC: (GNU) 3.3.4 (Debian 1:3.3.4-13)GCC: (GNU) 3.3.4 (Debian 1:3.3.4-13)GCC: (GNU) 3.3.5 (Debian 1:3.3.5-1)GCC: (GNU) 3.3.4 (Debian 1:3.3.4-13)GCC: (GNU) 3.3.5 (Debian 1:3.3.5-1) ƒ",K ð¥Dƒ ă"$H -¦Yƒ!¯œ„_IO_stdin_used« ƒƒ../sysdeps/i386/elf/start.S/home/gotom/debian/glibc/cvs/build.local/glibc_2.3.2.ds1-18.test3/glibc-2.3.2.ds1/build-tree/glibc-2.3.2/csuGNU AS 2.15€˜qăă=ÒÕ0³"B¢ #T¯$0»%q®Ÿ(ƒ¤i)BÕ* NÏ+T,½int-0g2Ú`ã3쩲;Úá<ìXˆìÀ‰0Š0‹q•ŒìÓ0ËŽ0"aeÚ˜‘½•’Í’•#¥½¥³Ä’~'“am”q\•ìî–0 —a°˜0‡™a¨›½Õœa½ - ½ñ£½Í¦ah«a·¬Ú²¯qÄ°ìD³qY´ì*¶½ÌºhÜ»© 󶼺 À«|¿½[Â0 -ŸEa -Úb0 S vQé ÈR$À¥ITªN½#âSõ#öT$y æV#8I#•T©#æ!h#8"I#‰#„ ù&-ÓqõÍ·gß 8§AsH R½R7ºÀË×½½ X7"<?/u¦#Cvç#½x½#zº# Ù{º#Ç}#‰~Ý#8#W€$# ‹„½#$þ…½#(>†½#,ᇽ#0ûŠ½#4¯Œ…#8 =º1$@ “Ñ# -”Ñ#˜½#ƒœ½#   ½#4¢¬#8£I#a§š# À ÆB Ñ B %Kè îéRB@N $½RìO/ 5ARXL R…½R7…ÀºÀË× ]’ ˜¼½…ÀÀÑÑCaÇ Íç½çò× íÀ ø ç!d  $½$ç …ìe5 ;G…šnBajA#Mk‡#Ÿl*#¯m…# :nš# Gs   Ié‚­ê®%#Q¯R#¯°é#ø=¥•± ².,4 2²#¯3=# M,5 /² 4 Q5.ó7 8½À9T¿:0ü–$¦½ù5/home/gotom/debian/glibc/cvs/build.local/glibc_2.3.2.ds1-18.test3/glibc-2.3.2.ds1/build-tree/i386-libc/csu/crti.S/home/gotom/debian/glibc/cvs/build.local/glibc_2.3.2.ds1-18.test3/glibc-2.3.2.ds1/build-tree/glibc-2.3.2/csuGNU AS 2.15€ù(/home/gotom/debian/glibc/cvs/build.local/glibc_2.3.2.ds1-18.test3/glibc-2.3.2.ds1/build-tree/i386-libc/csu/crtn.S/home/gotom/debian/glibc/cvs/build.local/glibc_2.3.2.ds1-18.test3/glibc-2.3.2.ds1/build-tree/glibc-2.3.2/csuGNU AS 2.15€%% : ; I$ > $ >  : ;  : ; I8 -I!I/  I -: ;I  : ; : ; I  : ; ( ' II : ; &I'  < !I4: ; I?  -%%S/û -../sysdeps/i386/elfstart.S ƒ.01:"VWYXû -Àºû -/usr/lib/gcc-lib/i486-linux/3.3.5/include../sysdeps/generic/bits../wcsmbs../sysdeps/gnu../iconvinit.cstddef.htypes.hwchar.h_G_config.hgconv.hÎ…û -/home/gotom/debian/glibc/cvs/build.local/glibc_2.3.2.ds1-18.test3/glibc-2.3.2.ds1/build-tree/i386-libc/csucrti.Sð¥2,WdDƒ",:ă ,Wdd,,-:¬…û -/home/gotom/debian/glibc/cvs/build.local/glibc_2.3.2.ds1-18.test3/glibc-2.3.2.ds1/build-tree/i386-libc/csucrtn.S¦:Yƒ _G_int32_t__time_t__GCONV_INCOMPLETE_INPUT__GCONV_OK__state__gconv_init_fct_G_iconv_t__rlim64_t__GCONV_ILLEGAL_DESCRIPTOR__gconv_infoshort unsigned intunsigned char__useconds_t__counter__fct__val__GCONV_NOCONV__value__nsteps_G_int16_t__max_needed_from__gconv_btowc_fct__off_t__ssize_t__statepinit.c__fsfilcnt_t__steps__fsfilcnt64_t__blkcnt_t__gconv_loaded_object_G_fpos64_t__gconv_t__trans_end_fct__u_int__GCONV_ILLEGAL_INPUT__blksize_t__to_name__uint64_t__id_t__GCONV_EMPTY_INPUT__cd__ino_t/home/gotom/debian/glibc/cvs/build.local/glibc_2.3.2.ds1-18.test3/glibc-2.3.2.ds1/build-tree/glibc-2.3.2/csu__invocation_counter__pid_t__u_short__count__quad_t__u_long__fsid_t__GCONV_FULL_OUTPUT__max_needed_to__timer_t__stateful__uint32_t__key_t__u_char__gconv_step__shlib_handle__min_needed_toshort int__dev_tlong long int__gconv_trans_dataGNU C 3.3.5 (Debian 1:3.3.5-1)__outbuflong long unsigned int__uid_t__wchb__uint16_twint_t__u_quad_t__gconv_trans_end_fct__flags__outbufend__combined__gconv_trans_init_fct__init_fct__modname__trans_context_fct__trans_fct__rlim_t__wch__intptr_t__suseconds_t__ino64_twchar_t__GCONV_IS_LAST__blkcnt64_t__fsblkcnt64_t__mode_t__qaddr_t__pos__gconv_end_fct_IO_stdin_used__internal_use__GCONV_NODB__clock_t__gconv_step_data__gconv_trans_query_fct__socklen_t__int64_t__GCONV_NOMEM__off64_t__btowc_fct_G_fpos_t__int8_t__daddr_t__fsblkcnt_t_G_uint32_t__nlink_t__swblk_t__GCONV_INTERNAL_ERROR__mbstate_t__gid_t__clockid_t__int32_t__gconv_trans_context_fct__next__GCONV_IGNORE_ERRORS__end_fct__trans__uint8_t__gconv_fct__from_name__min_needed_from__gconv_trans_fct__data__caddr_t_G_uint16_t__loff_t__int16_t.symtab.strtab.shstrtab.interp.note.ABI-tag.hash.dynsym.dynstr.gnu.version.gnu.version_r.rel.dyn.rel.plt.init.text.fini.rodata.eh_frame_hdr.data.eh_frame.dynamic.ctors.dtors.jcr.got.bss.comment.debug_aranges.debug_pubnames.debug_info.debug_abbrev.debug_line.debug_str44#HH 1hh47 œœ€?‚¯GÿÿÿoÌ‚ÌTþÿÿoÜ‚Ü@c ƒl ,ƒ, uDƒDp\ƒ\@{ ƒ P"ð¥ð%‡ ¦ &‚) ¤Ï¤OÐP £ Ð P<­HÐHPà¶(Ñ(Q½0Ñ0QÄ8Ñ8QÉ<Ñ/home/gotom/debian/glibc/cvs/build.local/glibc_2.3.2.ds1-18.test3/glibc-2.3.2.ds1/build-tree/i386-libc/config.habi-note.S/home/gotom/debian/glibc/cvs/build.local/glibc_2.3.2.ds1-18.test3/glibc-2.3.2.ds1/build-tree/i386-libc/csu/abi-tag.hinit.c/home/gotom/debian/glibc/cvs/build.local/glibc_2.3.2.ds1-18.test3/glibc-2.3.2.ds1/build-tree/i386-libc/csu/crti.S/home/gotom/debian/glibc/cvs/build.local/glibc_2.3.2.ds1-18.test3/glibc-2.3.2.ds1/build-tree/i386-libc/csu/defs.hinitfini.ccall_gmon_startcrtstuff.c__CTOR_LIST____DTOR_LIST____JCR_LIST__p.0completed.1__do_global_dtors_auxframe_dummy__CTOR_END____DTOR_END____FRAME_END____JCR_END____do_global_ctors_aux/home/gotom/debian/glibc/cvs/build.local/glibc_2.3.2.ds1-18.test3/glibc-2.3.2.ds1/build-tree/i386-libc/csu/crtn.Soffsets.cpp_DYNAMIC_fp_hwfprintf@@GLIBC_2.0__fini_array_end__dso_handle__libc_csu_fini_initstdout@@GLIBC_2.0_start__fini_array_start__libc_csu_init__gxx_personality_v0@@CXXABI_1.2__bss_startmain__libc_start_main@@GLIBC_2.0__init_array_enddata_start_fini_edata__i686.get_pc_thunk.bx_GLOBAL_OFFSET_TABLE__end__init_array_start_IO_stdin_used__data_start_Jv_RegisterClasses__gmon_start__ \ No newline at end of file +#define WaitingForInterrupt CPU + %ld +#define PCAtOpcodeStart CPU + %ld +#define WaitAddress CPU + %ld +#define WaitCounter CPU + %ld +#define FastROMSpeed CPU + %ld +#define AutoSaveTimer CPU + %ld +#define SRAMModified CPU + %ld +#define NMITriggerPoint CPU + %ld +#define TriedInterleavedMode2 CPU + %ld +#define BRKTriggered CPU + %ld +#define NMICycleCount CPU + %ld +#define IRQCycleCount CPU + %ld +#define SRAMMask Memory + %ld +#define SRAMSize Memory + %ld +#define WriteMap Memory + %ld +#define MemorySpeed Memory + %ld +#define BlockIsRAM Memory + %ld +#define BlockIsROM Memory + %ld +#define ROMFilename Memory + %ld +#define APUExecuting IAPU + %ld +#define APUDirectPage IAPU + %ld +#define APUAddress IAPU + %ld +#define APUWaitAddress1 IAPU + %ld +#define APUWaitAddress2 IAPU + %ld +#define APUWaitCounter IAPU + %ld +#define APUShadowRAM IAPU + %ld +#define APUCachedSamples IAPU + %ld +#define APU_Overflow IAPU + %ld +#define APUTimerErrorCounter IAPU + %ld +#define NextAPUTimerPos IAPU + %ld +#define APUKeyedChannels APU + %ld +#define APUOutPorts APU + %ld +#define APUExtraRAM APU + %ld +#define APUTimerTarget APU + %ld +#define APUTimerEnabled APU + %ld +#define TimerValueWritten APU + %ld +#define CPUOpcodes ICPU + %ld +#define CPUExecuting ICPU + %ld +#define APUEnabled Settings + %ld +#define Shutdown Settings + %ld +#define SoundSkipMethod Settings + %ld +#define HBlankStart Settings + %ld +#define CyclesPercentage Settings + %ld +#define DisableIRQ Settings + %ld +#define Paused Settings + %ld +#define SoundSync Settings + %ld +#define SA1Enabled Settings + %ld +#define SuperFXEnabled Settings + %ld +#define UseWIPAPUTiming Settings + %ld +#define ApuP APURegisters + %ld +#define ApuYA APURegisters + %ld +#define ApuA APURegisters + %ld +#define ApuY APURegisters + %ld +#define ApuX APURegisters + %ld +#define ApuS APURegisters + %ld +#define ApuPC APURegisters + %ld +#define APUPCR APURegisters + %ld +#define BG3Priority PPU + %ld +#define GFullGraphicCount PPU + %ld +#define FirstSprite PPU + %ld +#define OAMPriorityRotation PPU + %ld +#define OAMTileAddress PPU + %ld +#define IRQVBeamPos PPU + %ld +#define IRQHBeamPos PPU + %ld +#define VBeamPosLatched PPU + %ld +#define HBeamPosLatched PPU + %ld +#define HVBeamCounterLatched PPU + %ld +#define Joypad1ButtonReadPos PPU + %ld +#define Joypad2ButtonReadPos PPU + %ld +#define FixedColourGreen PPU + %ld +#define FixedColourRed PPU + %ld +#define FixedColourBlue PPU + %ld +#define SavedOAMAddr PPU + %ld +#define ScreenHeight PPU + %ld +#define ForcedBlanking PPU + %ld +#define OBJThroughMain PPU + %ld +#define OBJThroughSub PPU + %ld +#define OBJSizeSelect PPU + %ld +#define OBJNameBase PPU + %ld +#define OAMReadFlip PPU + %ld +#define VTimerEnabled PPU + %ld +#define HTimerEnabled PPU + %ld +#define HTimerPosition PPU + %ld +#define Mode7Repeat PPU + %ld +#define Window1Left PPU + %ld +#define Window1Right PPU + %ld +#define Window2Left PPU + %ld +#define Window2Right PPU + %ld +#define ClipWindowOverlapLogic PPU + %ld +#define ClipWindow1Enable PPU + %ld +#define ClipWindow2Enable PPU + %ld +#define ClipWindow1Inside PPU + %ld +#define ClipWindow2Inside PPU + %ld +#define RecomputeClipWindows PPU + %ld +#define OBJNameSelect PPU + %ld +#define Need16x8Mulitply PPU + %ld +#define Joypad3ButtonReadPos PPU + %ld +#define RangeTimeOver PPU + %ld +#define ColorsChanged IPPU + %ld +#define HDMAStarted IPPU + %ld +#define MaxBrightness IPPU + %ld +#define LatchedBlanking IPPU + %ld +#define OBJChanged IPPU + %ld +#define RenderThisFrame IPPU + %ld +#define SkippedFrames IPPU + %ld +#define TileCached IPPU + %ld +#define FirstVRAMRead IPPU + %ld +#define DoubleWidthPixels IPPU + %ld +#define RenderedScreenHeight IPPU + %ld +#define RenderedScreenWidth IPPU + %ld +#define ScreenColors IPPU + %ld +#define PreviousLine IPPU + %ld +#define CurrentLine IPPU + %ld +#define SuperScope IPPU + %ld +#define PrevMouseX IPPU + %ld +#define PrevMouseY IPPU + %ld +#define SA1_Negative SA1 + %ld +#define SA1_Overflow SA1 + %ld +#define SA1CPUExecuting SA1 + %ld +#define SA1ShiftedPB SA1 + %ld +#define SA1ShiftedDB SA1 + %ld +#define SA1Executing SA1 + %ld +#define SA1NMIActive SA1 + %ld +#define SA1IRQActive SA1 + %ld +#define SA1WaitingForInterrupt SA1 + %ld +#define SA1PCAtOpcodeStart SA1 + %ld +#define SA1WaitAddress SA1 + %ld +#define SA1WaitCounter SA1 + %ld +#define SA1WaitByteAddress1 SA1 + %ld +#define SA1WaitByteAddress2 SA1 + %ld +#define SA1WriteMap SA1 + %ld +#define SA1arithmetic_op SA1 + %ld +#define SA1overflow SA1 + %ld +#define VirtualBitmapFormat SA1 + %ld +#define SA1_in_char_dma SA1 + %ld +#define SA1variable_bit_pos SA1 + %ld +#define SA1PB SA1Registers + %ld +#define SA1DB SA1Registers + %ld +#define SA1PP SA1Registers + %ld +#define SA1PL SA1Registers + %ld +#define SA1AA SA1Registers + %ld +#define SA1AL SA1Registers + %ld +#define SA1DD SA1Registers + %ld +#define SA1DL SA1Registers + %ld +#define SA1SS SA1Registers + %ld +#define SA1SL SA1Registers + %ld +#define SA1XX SA1Registers + %ld +#define SA1XL SA1Registers + %ld +#define SA1YY SA1Registers + %ld +#define SA1YL SA1Registers + %ld +#define SA1PCR SA1Registers + %ld +ÿÿÿÿÿÿÿÿ3=K Xƒ Ȧˆõþÿo¼`‚à +– ôß 8ƒ(ƒþÿÿoƒÿÿÿoðÿÿoö‚߆ƒ–ƒ¦ƒ¶ƒßGCC: (GNU) 4.1.2 (Gentoo 4.1.2)GCC: (GNU) 4.1.2 (Gentoo 4.1.2)GCC: (GNU) 4.1.2 (Gentoo 4.1.2)GCC: (GNU) 4.1.2 (Gentoo 4.1.2)GCC: (GNU) 4.1.2 (Gentoo 4.1.2)GCC: (GNU) 4.1.2 (Gentoo 4.1.2)GCC: (GNU) 4.1.2 (Gentoo 4.1.2).symtab.strtab.shstrtab.interp.note.ABI-tag.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rel.dyn.rel.plt.init.text.fini.rodata.eh_frame.ctors.dtors.jcr.dynamic.got.got.plt.data.bss.commentTT#hh 5ˆˆ41öÿÿo¼¼$; àà€C`‚`–Kÿÿÿoö‚öXþÿÿoƒ g (ƒ(p 8ƒ8  yXƒXtpƒpPÀƒÀ#…ȦÈ&‹ä¦ä&D"“(É(IôÞôN¤üÞüN«ßO°ßOè¹ðßðO¾ôßôOÇàP Í àP ÒPçQÛhV - ˆZThˆ¼à`‚ö‚ƒ(ƒ 8ƒ +Xƒ pƒ Àƒ Ȧä¦(ÉôÞüÞßßðßôßà àñÿ ôÞüÞ(ß5$àDàK„ a@„ ñÿmøÞz߇(É•ß¡ ¦ ·ñÿÃôßÙôÞêôÞýßà  ¦ !Àƒ ( 7 Kä¦RȦX¹u覄à‘àž0¦g ®}À$Óàñÿß(àñÿä àöàñÿý—¦ p„¡! Xƒ crtstuff.c__CTOR_LIST____DTOR_LIST____JCR_LIST__completed.5887p.5885__do_global_dtors_auxframe_dummy__CTOR_END____DTOR_END____FRAME_END____JCR_END____do_global_ctors_auxoffsets.cpp_GLOBAL_OFFSET_TABLE___init_array_end__init_array_start_DYNAMICdata_start__libc_csu_fini_start__gmon_start___Jv_RegisterClasses_fp_hw_fini__libc_start_main@@GLIBC_2.0_IO_stdin_used__data_start__dso_handle__libc_csu_initfwrite@@GLIBC_2.0fprintf@@GLIBC_2.0__bss_start_endstdout@@GLIBC_2.0_edata__i686.get_pc_thunk.bxmain_init \ No newline at end of file diff -NaHudr snes9x-1.43-src/snes9x/offsets.cpp snx/snes9x/offsets.cpp --- snes9x-1.43-src/snes9x/offsets.cpp 2004-12-31 00:15:47.000000000 +0200 +++ snx/snes9x/offsets.cpp 2007-09-01 19:24:26.000000000 +0300 @@ -100,30 +100,30 @@ #endif #define OFFSET(N,F) \ -fprintf (S9xSTREAM, "#define " #N " CPU + %d\n", (int) &((struct SCPUState *) 0)->F); +fprintf (S9xSTREAM, "#define " #N " CPU + %ld\n", (long) &((struct SCPUState *) 0)->F); #define OFFSET2(N,F) \ -fprintf (S9xSTREAM, "#define " #N " Registers + %d\n", (int) &((struct SRegisters *) 0)->F); +fprintf (S9xSTREAM, "#define " #N " Registers + %ld\n", (long) &((struct SRegisters *) 0)->F); #define OFFSET3(F) \ -fprintf (S9xSTREAM, "#define " #F " Memory + %d\n", (int) &((class CMemory *) 0)->F); +fprintf (S9xSTREAM, "#define " #F " Memory + %ld\n", (long) &((class CMemory *) 0)->F); #define OFFSET4(N,F) \ -fprintf (S9xSTREAM, "#define " #N " APU + %d\n", (int) &((struct SAPU *) 0)->F); +fprintf (S9xSTREAM, "#define " #N " APU + %ld\n", (long) &((struct SAPU *) 0)->F); #define OFFSET5(N,F) \ -fprintf (S9xSTREAM, "#define " #N " IAPU + %d\n", (int) &((struct SIAPU *) 0)->F); +fprintf (S9xSTREAM, "#define " #N " IAPU + %ld\n", (long) &((struct SIAPU *) 0)->F); #define OFFSET6(N,F) \ -fprintf (S9xSTREAM, "#define " #N " ICPU + %d\n", (int) &((struct SICPU *) 0)->F); +fprintf (S9xSTREAM, "#define " #N " ICPU + %ld\n", (long) &((struct SICPU *) 0)->F); #define OFFSET7(N,F) \ -fprintf (S9xSTREAM, "#define " #N " Settings + %d\n", (int) &((struct SSettings *) 0)->F); +fprintf (S9xSTREAM, "#define " #N " Settings + %ld\n", (long) &((struct SSettings *) 0)->F); #define OFFSET8(N, F) \ -fprintf (S9xSTREAM, "#define " #N " APURegisters + %d\n", (int) &((struct SAPURegisters *) 0)->F); +fprintf (S9xSTREAM, "#define " #N " APURegisters + %ld\n", (long) &((struct SAPURegisters *) 0)->F); #define OFFSET9(N, F) \ -fprintf (S9xSTREAM, "#define " #N " PPU + %d\n", (int) &((struct SPPU *) 0)->F); +fprintf (S9xSTREAM, "#define " #N " PPU + %ld\n", (long) &((struct SPPU *) 0)->F); #define OFFSET10(N, F) \ -fprintf (S9xSTREAM, "#define " #N " IPPU + %d\n", (int) &((struct InternalPPU *) 0)->F); +fprintf (S9xSTREAM, "#define " #N " IPPU + %ld\n", (long) &((struct InternalPPU *) 0)->F); #define OFFSET11(N, F) \ -fprintf (S9xSTREAM, "#define " #N " SA1 + %d\n", (int) &((struct SSA1 *) 0)->F); +fprintf (S9xSTREAM, "#define " #N " SA1 + %ld\n", (long) &((struct SSA1 *) 0)->F); #define OFFSET12(N, F) \ -fprintf (S9xSTREAM, "#define " #N " SA1Registers + %d\n", (int) &((struct SSA1Registers *) 0)->F); +fprintf (S9xSTREAM, "#define " #N " SA1Registers + %ld\n", (long) &((struct SSA1Registers *) 0)->F); int main (int /*argc*/, char ** /*argv*/) { @@ -209,7 +209,7 @@ OFFSET5(APU_Overflow,_Overflow) OFFSET5(APUTimerErrorCounter,TimerErrorCounter) OFFSET5(NextAPUTimerPos,NextAPUTimerPos) - + OFFSET4(APUCycles,Cycles) OFFSET4(APUShowROM,ShowROM) OFFSET4(APUFlags,Flags) @@ -246,6 +246,7 @@ OFFSET7(SoundSync,SoundSync) OFFSET7(SA1Enabled,SA1) OFFSET7(SuperFXEnabled,SuperFX) + OFFSET7(UseWIPAPUTiming,UseWIPAPUTiming) OFFSET8(ApuP,P) OFFSET8(ApuYA,YA.W) diff -NaHudr snes9x-1.43-src/snes9x/port.h snx/snes9x/port.h --- snes9x-1.43-src/snes9x/port.h 2004-12-31 00:15:47.000000000 +0200 +++ snx/snes9x/port.h 2005-04-09 00:59:27.000000000 +0300 @@ -158,6 +158,10 @@ typedef long long int64; #else /* __WIN32__ */ +#ifdef __MINGW32__ +typedef long int32; +#endif + # ifdef __BORLANDC__ # include # else diff -NaHudr snes9x-1.43-src/snes9x/ppu.cpp snx/snes9x/ppu.cpp --- snes9x-1.43-src/snes9x/ppu.cpp 2004-12-31 00:15:47.000000000 +0200 +++ snx/snes9x/ppu.cpp 2007-07-28 22:10:40.000000000 +0300 @@ -103,6 +103,8 @@ #include "spc7110.h" #include "movie.h" +#include "unix/tiletracker.hh" + #ifndef ZSNES_FX #include "fxemu.h" #include "fxinst.h" @@ -414,36 +416,42 @@ PPU.BG[0].HOffset = (Byte<<8) | PPU.BGnxOFSbyte; PPU.BGnxOFSbyte = Byte; // fprintf(stderr, "%02x to %04x (PPU.BG[0].HOffset = %04x %d)\n", Byte, Address, PPU.BG[0].HOffset, CPU.V_Counter); +// TILE_SaveScroll(PPU.BG[0].HOffset, PPU.BG[0].VOffset, CPU.V_Counter); break; case 0x210E: PPU.BG[0].VOffset = (Byte<<8) | PPU.BGnxOFSbyte; PPU.BGnxOFSbyte = Byte; // fprintf(stderr, "%02x to %04x (PPU.BG[0].VOffset = %04x %d)\n", Byte, Address, PPU.BG[0].VOffset, CPU.V_Counter); +// TILE_SaveScroll(PPU.BG[0].HOffset, PPU.BG[0].VOffset, CPU.V_Counter); break; case 0x210F: PPU.BG[1].HOffset = (Byte<<8) | PPU.BGnxOFSbyte; PPU.BGnxOFSbyte = Byte; // fprintf(stderr, "%02x to %04x (PPU.BG[1].HOffset = %04x %d)\n", Byte, Address, PPU.BG[1].HOffset, CPU.V_Counter); +// /* TILE MAYHEM */ PPU.BG[1].HOffset=PPU.BG[0].HOffset; PPU.BG[1].VOffset=PPU.BG[0].VOffset; break; case 0x2110: PPU.BG[1].VOffset = (Byte<<8) | PPU.BGnxOFSbyte; PPU.BGnxOFSbyte = Byte; // fprintf(stderr, "%02x to %04x (PPU.BG[1].VOffset = %04x %d)\n", Byte, Address, PPU.BG[1].VOffset, CPU.V_Counter); +// /* TILE MAYHEM */ PPU.BG[1].HOffset=PPU.BG[0].HOffset; PPU.BG[1].VOffset=PPU.BG[0].VOffset; break; case 0x2111: PPU.BG[2].HOffset = (Byte<<8) | PPU.BGnxOFSbyte; PPU.BGnxOFSbyte = Byte; // fprintf(stderr, "%02x to %04x (PPU.BG[2].HOffset = %04x %d)\n", Byte, Address, PPU.BG[2].HOffset, CPU.V_Counter); +// /* TILE MAYHEM */ PPU.BG[2].HOffset=PPU.BG[0].HOffset; PPU.BG[2].VOffset=PPU.BG[0].VOffset; break; case 0x2112: PPU.BG[2].VOffset = (Byte<<8) | PPU.BGnxOFSbyte; PPU.BGnxOFSbyte = Byte; // fprintf(stderr, "%02x to %04x (PPU.BG[2].VOffset = %04x %d)\n", Byte, Address, PPU.BG[2].VOffset, CPU.V_Counter); +// /* TILE MAYHEM */ PPU.BG[2].HOffset=PPU.BG[0].HOffset; PPU.BG[2].VOffset=PPU.BG[0].VOffset; break; case 0x2113: @@ -3040,7 +3048,7 @@ } } -void S9xUpdateJoypads () +void S9xUpdateJoypadButtons () { int i; @@ -3051,14 +3059,17 @@ S9xMovieUpdate(); - for (i = 0; i < 5; i++) + if(Settings.DisallowLeftRight) { - if (IPPU.Joypads [i] & SNES_LEFT_MASK) - IPPU.Joypads [i] &= ~SNES_RIGHT_MASK; - if (IPPU.Joypads [i] & SNES_UP_MASK) - IPPU.Joypads [i] &= ~SNES_DOWN_MASK; + for (i = 0; i < 5; i++) + { + if (IPPU.Joypads [i] & SNES_LEFT_MASK) + IPPU.Joypads [i] &= ~SNES_RIGHT_MASK; + if (IPPU.Joypads [i] & SNES_UP_MASK) + IPPU.Joypads [i] &= ~SNES_DOWN_MASK; + } } - + // BJ: This is correct behavior AFAICT (used to be Touhaiden hack) if (IPPU.Controller == SNES_JOYPAD || IPPU.Controller == SNES_MULTIPLAYER5) { @@ -3068,6 +3079,11 @@ IPPU.Joypads [i] |= 0xffff0000; } } +} + +void S9xUpdateJoypadMemory () +{ + int i; // Read mouse position if enabled if (Settings.MouseMaster) @@ -3297,3 +3313,14 @@ } #endif +extern "C" void S9xUpdateJoypads() +{ + if (CPU.V_Counter == PPU.ScreenHeight + 3) + S9xUpdateJoypadMemory(); + + // separated from S9xUpdateJoypadMemory because the +3 was causing keypresses to be displayed 1 frame behind, + // but just removing the +3 always would cause some games (Pocky & Rocky) to fail to get input. + // (with this change, games emulate identically to before, only the keypress GUI display timing is better) + if (CPU.V_Counter == PPU.ScreenHeight) + S9xUpdateJoypadButtons(); +} diff -NaHudr snes9x-1.43-src/snes9x/ppu.h snx/snes9x/ppu.h --- snes9x-1.43-src/snes9x/ppu.h 2004-12-31 00:15:47.000000000 +0200 +++ snx/snes9x/ppu.h 2007-07-01 21:55:55.000000000 +0300 @@ -264,6 +264,7 @@ uint8 MouseSpeed[2]; // XXX Do these need to be added to snapshot.cpp? + // answer: yes, some games (such as Zelda 3) use them uint16 OAMWriteRegister; uint8 BGnxOFSbyte; uint8 OpenBus1; @@ -303,7 +304,8 @@ void S9xResetPPU (); void S9xSoftResetPPU (); void S9xFixColourBrightness (); -void S9xUpdateJoypads (); +void S9xUpdateJoypadButtons (); +void S9xUpdateJoypadMemory (); void S9xProcessMouse(int which1); void S9xSuperFXExec (); @@ -321,10 +323,6 @@ extern struct SPPU PPU; extern struct SDMA DMA [8]; extern struct InternalPPU IPPU; -END_EXTERN_C - -#include "gfx.h" -#include "memmap.h" typedef struct{ uint8 _5C77; @@ -335,6 +333,10 @@ extern SnesModel* Model; extern SnesModel M1SNES; extern SnesModel M2SNES; +END_EXTERN_C + +#include "gfx.h" +#include "memmap.h" #define MAX_5C77_VERSION 0x01 #define MAX_5C78_VERSION 0x03 diff -NaHudr snes9x-1.43-src/snes9x/rgbtorgb.s snx/snes9x/rgbtorgb.s --- snes9x-1.43-src/snes9x/rgbtorgb.s 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/rgbtorgb.s 2008-02-18 22:34:28.064889000 +0200 @@ -0,0 +1 @@ + .file "rgbtorgb.cc" diff -NaHudr snes9x-1.43-src/snes9x/sa1.cpp snx/snes9x/sa1.cpp --- snes9x-1.43-src/snes9x/sa1.cpp 2004-12-31 00:15:47.000000000 +0200 +++ snx/snes9x/sa1.cpp 2007-09-01 19:29:08.000000000 +0300 @@ -201,7 +201,7 @@ if (GetAddress >= (uint8 *) CMemory::MAP_LAST) return (*(GetAddress + (address & 0xffff))); - switch ((int) GetAddress) + switch ((long) GetAddress) { case CMemory::MAP_PPU: return (S9xGetSA1 (address & 0xffff)); @@ -248,7 +248,7 @@ return; } - switch ((int) Setaddress) + switch ((long) Setaddress) { case CMemory::MAP_PPU: S9xSetSA1 (byte, address & 0xffff); @@ -310,7 +310,7 @@ return; } - switch ((int) GetAddress) + switch ((long) GetAddress) { case CMemory::MAP_PPU: SA1.PCBase = Memory.FillRAM - 0x2000; diff -NaHudr snes9x-1.43-src/snes9x/screenshot.cpp snx/snes9x/screenshot.cpp --- snes9x-1.43-src/snes9x/screenshot.cpp 2004-12-31 00:15:45.000000000 +0200 +++ snx/snes9x/screenshot.cpp 2007-07-01 21:36:59.000000000 +0300 @@ -112,7 +112,10 @@ #include "ppu.h" #include "screenshot.h" -bool8 S9xDoScreenshot(int width, int height){ +bool8 S9xDoScreenshot(int width, int height, const char* filename) +{ + S9xSetInfoString("Failed to take screenshot."); // gets overwritten upon success + #ifdef HAVE_LIBPNG FILE *fp; png_structp png_ptr; @@ -121,7 +124,10 @@ png_color pngpal[256]; int imgwidth; int imgheight; - const char *fname=S9xGetFilenameInc(".png"); + + const char* fname = filename; + + if(!fname) fname = S9xGetFilenameInc(".png"); Settings.TakeScreenshot=FALSE; @@ -226,7 +232,15 @@ fclose(fp); fprintf(stderr, "%s saved.\n", fname); - return TRUE; + + { + static char str [64]; + sprintf(str, "Saved screenshot %s", fname + strlen(fname)-7); + str[strlen(str)-3] = '\0'; + S9xSetInfoString(str); + } + + return TRUE; #else perror("Screenshot support not available (libpng was not found at build time)"); return FALSE; diff -NaHudr snes9x-1.43-src/snes9x/screenshot.h snx/snes9x/screenshot.h --- snes9x-1.43-src/snes9x/screenshot.h 2004-12-31 00:15:45.000000000 +0200 +++ snx/snes9x/screenshot.h 2007-07-01 21:36:08.000000000 +0300 @@ -90,7 +90,7 @@ #ifndef SCREENSHOT_H #define SCREENSHOT_H -bool8 S9xDoScreenshot(int width, int height); +bool8 S9xDoScreenshot(int width, int height, const char* filename = 0); #endif diff -NaHudr snes9x-1.43-src/snes9x/server.cpp snx/snes9x/server.cpp --- snes9x-1.43-src/snes9x/server.cpp 2004-12-31 00:15:47.000000000 +0200 +++ snx/snes9x/server.cpp 2007-09-01 19:34:43.000000000 +0300 @@ -762,7 +762,7 @@ Sleep (0); #endif - if (success && !Settings.Paused && !Settings.StopEmulation && + if (success && !(Settings.Paused && !Settings.FrameAdvance) && !Settings.StopEmulation && !Settings.ForcedPause && !NPServer.Paused) { S9xNPSendHeartBeat (); @@ -820,9 +820,9 @@ S9xNPSendROMImageToAllClients (); break; case NP_SERVER_SYNC_CLIENT: - NPServer.Clients [(int) task_data].Ready = FALSE; + NPServer.Clients [(long) task_data].Ready = FALSE; S9xNPRecomputePause (); - S9xNPSyncClient ((int) task_data); + S9xNPSyncClient ((long) task_data); break; case NP_SERVER_SYNC_ALL: S9xNPSyncClients (); @@ -855,10 +855,10 @@ } break; case NP_SERVER_SEND_SRAM: - NPServer.Clients [(int) task_data].Ready = FALSE; + NPServer.Clients [(long) task_data].Ready = FALSE; S9xNPRecomputePause (); S9xNPWaitForEmulationToComplete (); - S9xNPSendSRAMToClient ((int) task_data); + S9xNPSendSRAMToClient ((long) task_data); break; case NP_SERVER_SEND_SRAM_ALL: @@ -1226,7 +1226,7 @@ while (!NetPlay.PendingWait4Sync && NetPlay.Connected && !Settings.ForcedPause && !Settings.StopEmulation && - !Settings.Paused) + !(Settings.Paused && !Settings.FrameAdvance)) { #ifdef __WIN32__ Sleep (40); diff -NaHudr snes9x-1.43-src/snes9x/sh/asmstruc.h snx/snes9x/sh/asmstruc.h --- snes9x-1.43-src/snes9x/sh/asmstruc.h 2004-12-31 00:15:46.000000000 +0200 +++ snx/snes9x/sh/asmstruc.h 2005-03-21 14:00:47.000000000 +0200 @@ -113,7 +113,8 @@ #define S9xAPUOPrint _S9xAPUOPrint #define S9xSuperFXExec _S9xSuperFXExec #define S9xGenerateSound _S9xGenerateSound -#define S9xUpdateJoypads _S9xUpdateJoypads +#define S9xUpdateJoypadButtons _S9xUpdateJoypadButtons +#define S9xUpdateJoypadMemory _S9xUpdateJoypadMemory #define S9xMainLoop _S9xMainLoop #define RenderLine _RenderLine #define S9xSetIRQ _S9xSetIRQ diff -NaHudr snes9x-1.43-src/snes9x/sh/README.txt snx/snes9x/sh/README.txt --- snes9x-1.43-src/snes9x/sh/README.txt 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/sh/README.txt 2005-03-20 23:46:21.000000000 +0200 @@ -0,0 +1,6 @@ +SH assembler is used on Dreamcast. The Dreamcast/DreamSNES target is +currently not completely (or even half way) merged with Snes9X +mainland. These files are still useful to other emulator authors that +know what they are doing though. + +/Peter diff -NaHudr snes9x-1.43-src/snes9x/snapshot.cpp snx/snes9x/snapshot.cpp --- snes9x-1.43-src/snes9x/snapshot.cpp 2004-12-31 00:15:45.000000000 +0200 +++ snx/snes9x/snapshot.cpp 2007-08-16 23:22:13.000000000 +0300 @@ -114,6 +114,7 @@ #include "sdd1.h" #include "spc7110.h" #include "movie.h" +#include "dsp1.h" extern uint8 *SRAM; @@ -170,6 +171,7 @@ {OFFSET (MemSpeed), 4, INT_V}, {OFFSET (MemSpeedx2), 4, INT_V}, {OFFSET (FastROMSpeed), 4, INT_V} +// {OFFSET (WaitCounter), 4, INT_V} }; #undef OFFSET @@ -316,8 +318,11 @@ {OFFSET (Need16x8Mulitply), 1, INT_V}, {OFFSET (BGMosaic), 4, uint8_ARRAY_V}, {OFFSET (OAMData), 512 + 32, uint8_ARRAY_V}, - {OFFSET (Need16x8Mulitply), 1, INT_V}, - {OFFSET (MouseSpeed), 2, uint8_ARRAY_V} + {OFFSET (MouseSpeed), 2, uint8_ARRAY_V}, + {OFFSET (OAMWriteRegister), 2, INT_V}, // ZELDA FIX + {OFFSET (BGnxOFSbyte), 1, INT_V}, // ZELDA FIX + {OFFSET (OpenBus1), 1, INT_V}, // ZELDA FIX + {OFFSET (OpenBus2), 1, INT_V} // ZELDA FIX }; #undef OFFSET @@ -454,6 +459,22 @@ }; #undef OFFSET +#define OFFSET(f) Offset(f,struct SDSP1 *) + +static FreezeData SnapDSP1 [] = { + {OFFSET (version), 1, INT_V}, + {OFFSET (waiting4command), 1, INT_V}, + {OFFSET (first_parameter), 1, INT_V}, + {OFFSET (command), 1, INT_V}, + {OFFSET (in_count), 4, INT_V}, + {OFFSET (in_index), 4, INT_V}, + {OFFSET (out_count), 4, INT_V}, + {OFFSET (out_index), 4, INT_V}, + {OFFSET (parameters), 512, uint8_ARRAY_V}, + {OFFSET (output), 512, uint8_ARRAY_V} +}; + +#undef OFFSET #define OFFSET(f) Offset(f,struct SPC7110EmuVars *) static FreezeData SnapSPC7110 [] = { @@ -522,6 +543,25 @@ {OFFSET (last_used),4,INT_V} }; +#undef OFFSET +#define OFFSET(f) Offset(f,struct SGFX *) + +static FreezeData SnapGFX [] = { + {OFFSET (FrameDisplayString), 256, uint8_ARRAY_V}, + {OFFSET (LastScreen), MAX_SNES_WIDTH * MAX_SNES_HEIGHT * 4, uint8_ARRAY_V} // GFX.LastScreen +}; + +#undef OFFSET +#define OFFSET(f) Offset(f,struct InternalPPU *) + +static FreezeData SnapIPPU [] = { + {OFFSET (Joypads), 5, uint32_ARRAY_V}, + {OFFSET (SuperScope),4,INT_V}, + {OFFSET (Mouse), 2, uint32_ARRAY_V}, + {OFFSET (PrevMouseX), 2, uint32_ARRAY_V}, + {OFFSET (PrevMouseY), 2, uint32_ARRAY_V} +}; + static char ROMFilename [_MAX_PATH]; //static char SnapshotFilename [_MAX_PATH]; @@ -546,7 +586,15 @@ bool8 S9xFreezeGame (const char *filename) { - STREAM stream = NULL; +#ifdef WIN32 + if(GUI.VideoMemory) // video memory is too slow to backup every frame so only do it on save + { + for (uint32 y = 0; y < (uint32)IPPU.RenderedScreenHeight; y++) + memcpy(GFX.LastScreen + y * GFX.RealPitch, GFX.Screen + y * GFX.RealPitch, GFX.RealPitch); + } +#endif + + STREAM stream = NULL; if (S9xOpenSnapshotFile (filename, FALSE, &stream)) { @@ -555,8 +603,10 @@ if(S9xMovieActive()) { - sprintf(String, "Movie snapshot %s", S9xBasename (filename)); + const char * name = S9xBasename (filename); + sprintf(String, "Movie snapshot %s", name + (strlen(name) - 3)); S9xMessage (S9X_INFO, S9X_FREEZE_FILE_INFO, String); + GFX.InfoStringTimeout /= 4; } else { @@ -574,6 +624,7 @@ return (S9xUnfreezeGame (filename)); } +bool unfreezified = false; bool8 S9xUnfreezeGame (const char *filename) { if (S9xLoadOrigSnapshot (filename)) @@ -591,12 +642,10 @@ switch (result) { case WRONG_FORMAT: - S9xMessage (S9X_ERROR, S9X_WRONG_FORMAT, - "File not in Snes9x freeze format"); + S9xMessage (S9X_ERROR, S9X_WRONG_FORMAT, FREEZE_ERR_WRONG_FORMAT); break; case WRONG_VERSION: - S9xMessage (S9X_ERROR, S9X_WRONG_VERSION, - "Incompatable Snes9x freeze file format version"); + S9xMessage (S9X_ERROR, S9X_WRONG_VERSION, FREEZE_ERR_WRONG_VERSION); break; case WRONG_MOVIE_SNAPSHOT: S9xMessage (S9X_ERROR, S9X_WRONG_MOVIE_SNAPSHOT, MOVIE_ERR_SNAPSHOT_WRONG_MOVIE); @@ -606,8 +655,7 @@ break; default: case FILE_NOT_FOUND: - sprintf (String, "ROM image \"%s\" for freeze file not found", - ROMFilename); + sprintf (String, FREEZE_ERR_NOT_FOUND, ROMFilename); S9xMessage (S9X_ERROR, S9X_ROM_NOT_FOUND, String); break; } @@ -615,15 +663,34 @@ return (FALSE); } - if(!S9xMovieActive()) + unfreezified = true; + + if(S9xMovieActive()) { - sprintf(String, "Loaded %s", S9xBasename (filename)); + const char * name = S9xBasename (filename); + if(S9xMovieReadOnly()) + sprintf(String, MOVIE_INFO_REWIND " %s", name + (strlen(name) - 3)); + else + sprintf(String, MOVIE_INFO_RERECORD " %s", name + (strlen(name) - 3)); + S9xMessage (S9X_INFO, S9X_FREEZE_FILE_INFO, String); + GFX.InfoStringTimeout /= 4; + } + else + { + sprintf(String, FREEZE_INFO_LOADED, S9xBasename(filename)); S9xMessage (S9X_INFO, S9X_FREEZE_FILE_INFO, String); } S9xCloseSnapshotFile (snapshot); return (TRUE); } + + { + const char * name = S9xBasename (filename); + sprintf(String, "Save file 00%s does not exist.", name + (strlen(name) - 1)); + S9xMessage (S9X_INFO, S9X_FREEZE_FILE_INFO, String); + } + return (FALSE); } @@ -705,6 +772,14 @@ } } + if(Settings.DSP1Master) + { + FreezeStruct (stream, "DSP", &DSP1, SnapDSP1, COUNT (SnapDSP1)); + } + + FreezeStruct (stream, "IPU", &IPPU, SnapIPPU, COUNT (SnapIPPU)); + FreezeStruct (stream, "GFX", &GFX, SnapGFX, COUNT (SnapGFX)); + S9xSetSoundMute (FALSE); #ifdef ZSNES_FX if (Settings.SuperFX) @@ -733,8 +808,7 @@ if (strcasecmp (rom_filename, Memory.ROMFilename) != 0 && strcasecmp (S9xBasename (rom_filename), S9xBasename (Memory.ROMFilename)) != 0) { - S9xMessage (S9X_WARNING, S9X_FREEZE_ROM_NAME, - "Current loaded ROM image doesn't match that required by freeze-game file."); + S9xMessage (S9X_WARNING, S9X_FREEZE_ROM_NAME, FREEZE_ERR_WRONG_ROM_NAME); } // ## begin load ## @@ -755,6 +829,9 @@ uint8* local_spc = NULL; uint8* local_spc_rtc = NULL; uint8* local_movie_data = NULL; + uint8* local_dsp1 = NULL; + uint8* local_ippu = NULL; + uint8* local_gfx = NULL; do { @@ -800,28 +877,55 @@ break; } - if (S9xMovieActive ()) +// if (S9xMovieActive ()) // can't check here or it screws up the save alignment after this { SnapshotMovieInfo mi; if ((result = UnfreezeStruct (stream, "MOV", &mi, SnapMovie, COUNT(SnapMovie))) != SUCCESS) { - result = NOT_A_MOVIE_SNAPSHOT; - break; + if (S9xMovieActive ()) + { + result = NOT_A_MOVIE_SNAPSHOT; + break; + } + mi.MovieInputDataSize = 0; } + + fprintf(stderr, "Movie Data Input Size: %u\n", + mi.MovieInputDataSize); if ((result = UnfreezeBlockCopy (stream, "MID", &local_movie_data, mi.MovieInputDataSize)) != SUCCESS) { - result = NOT_A_MOVIE_SNAPSHOT; - break; + if (S9xMovieActive ()) + { + result = NOT_A_MOVIE_SNAPSHOT; + break; + } } if (!S9xMovieUnfreeze(local_movie_data, mi.MovieInputDataSize)) { - result = WRONG_MOVIE_SNAPSHOT; - break; + if (S9xMovieActive ()) + { + result = WRONG_MOVIE_SNAPSHOT; + break; + } } } + if ((result = UnfreezeStructCopy (stream, "DSP", &local_dsp1, SnapDSP1, COUNT(SnapDSP1))) != SUCCESS) + { +// if(Settings.DSP1Master) +// break; + } + + if ((result = UnfreezeStructCopy (stream, "IPU", &local_ippu, SnapIPPU, COUNT(SnapIPPU))) != SUCCESS) + { + } + + if ((result = UnfreezeStructCopy (stream, "GFX", &local_gfx, SnapGFX, COUNT(SnapGFX))) != SUCCESS) + { + } + result=SUCCESS; } while(false); @@ -831,6 +935,7 @@ { uint32 old_flags = CPU.Flags; uint32 sa1_old_flags = SA1.Flags; + S9xReset (); S9xSetSoundMute (TRUE); @@ -854,6 +959,10 @@ UnfreezeStructFromCopy (&SA1, SnapSA1, COUNT (SnapSA1), local_sa1); UnfreezeStructFromCopy (&SA1Registers, SnapSA1Registers, COUNT (SnapSA1Registers), local_sa1_registers); } + if(local_dsp1) + { + UnfreezeStructFromCopy (&DSP1, SnapDSP1, COUNT (SnapDSP1), local_dsp1); + } if(local_spc) { UnfreezeStructFromCopy (&s7r, SnapSPC7110, COUNT (SnapSPC7110), local_spc); @@ -862,6 +971,24 @@ { UnfreezeStructFromCopy (&rtc_f9, SnapS7RTC, COUNT (SnapS7RTC), local_spc_rtc); } + if(local_ippu) + { + UnfreezeStructFromCopy (&IPPU, SnapIPPU, COUNT (SnapIPPU), local_ippu); + } + if(local_gfx) + { + UnfreezeStructFromCopy (&GFX, SnapGFX, COUNT (SnapGFX), local_gfx); + } + else + { +#ifdef WIN32 + if(GUI.VideoMemory) + { + for (uint32 y = 0; y < (uint32)IPPU.RenderedScreenHeight; y++) + memset(GFX.LastScreen + y * GFX.RealPitch, 0, GFX.RealPitch); + } +#endif + } Memory.FixROMSpeed (); CPU.Flags |= old_flags & (DEBUG_MODE_FLAG | TRACE_FLAG | @@ -871,7 +998,7 @@ IPPU.OBJChanged = TRUE; CPU.InDMA = FALSE; S9xFixColourBrightness (); - IPPU.RenderThisFrame = FALSE; + IPPU.RenderThisFrame = TRUE; // was FALSE because some games glitch out for 1 frame after loading, but for most games it's more useful to see that frame if (local_apu) { @@ -930,7 +1057,8 @@ S9xSRTCPostLoadState (); if (Settings.SDD1) S9xSDD1PostLoadState (); - + + // XXX is this correct? maybe it causes occasional desyncs when recording? IAPU.NextAPUTimerPos = CPU.Cycles * 10000L; IAPU.APUTimerCounter = 0; } @@ -952,6 +1080,9 @@ if (local_spc) delete [] local_spc; if (local_spc_rtc) delete [] local_spc_rtc; if (local_movie_data) delete [] local_movie_data; + if (local_dsp1) delete [] local_dsp1; + if (local_ippu) delete [] local_ippu; + if (local_gfx) delete [] local_gfx; return (result); } @@ -990,6 +1121,8 @@ uint16 word; uint32 dword; int64 qword; + + memset(block, 0, len); // Build the block ready to be streamed out for (i = 0; i < num_fields; i++) @@ -1058,11 +1191,24 @@ void FreezeBlock (STREAM stream, char *name, uint8 *block, int size) { - char buffer [512]; - sprintf (buffer, "%s:%06d:", name, size); - WRITE_STREAM (buffer, strlen (buffer), stream); + char buffer [512] = {0}; + + if(size <= 999999) + sprintf (buffer, "%s:%06d:", name, size); + else + { + sprintf (buffer, "%s:------:", name); + buffer[6] = (unsigned char)((unsigned)size >> 24); + buffer[7] = (unsigned char)((unsigned)size >> 16); + buffer[8] = (unsigned char)((unsigned)size >> 8); + buffer[9] = (unsigned char)((unsigned)size >> 0); + } + buffer[11] = 0; + + //fprintf(stderr, "writing %s\n", buffer); fflush(stderr); + + WRITE_STREAM (buffer, 11, stream); WRITE_STREAM (block, size, stream); - } int UnfreezeStruct (STREAM stream, char *name, void *base, FreezeData *fields, @@ -1090,7 +1236,7 @@ if ((result = UnfreezeBlock (stream, name, block, len)) != SUCCESS) { - delete block; + delete[] block; return (result); } @@ -1165,13 +1311,32 @@ int len = 0; int rem = 0; int rew_len; - if (READ_STREAM (buffer, 11, stream) != 11 || - strncmp (buffer, name, 3) != 0 || buffer [3] != ':' || - (len = atoi (&buffer [4])) == 0) +// if (READ_STREAM (buffer, 11, stream) != 11 || +// strncmp (buffer, name, 3) != 0 || buffer [3] != ':' || +// (len = atoi (&buffer [4])) == 0) + buffer[11] = 0; + if (READ_STREAM (buffer, 11, stream) != 11 + || strncmp (buffer, name, 3) != 0 + || buffer [3] != ':') { + err: + fprintf(stderr, "Found '%.11s', expected %s(%d)\n", buffer, name, size); REVERT_STREAM(stream, FIND_STREAM(stream)-11, 0); return (WRONG_FORMAT); } + if(buffer[4] == '-') + { + len = (((unsigned char)buffer[6]) << 24) + | (((unsigned char)buffer[7]) << 16) + | (((unsigned char)buffer[8]) << 8) + | (((unsigned char)buffer[9]) << 0); + } + else + { + len = atoi(buffer+4); + } + //fprintf(stderr, "Found '%.11s', ok (len %d, expect %d)\n", buffer, len, size); + if(len <= 0) goto err; if (len > size) { @@ -1301,9 +1466,9 @@ bool8 S9xSPCDump (const char *filename) { static uint8 header [] = { - 'S', 'N', 'E', 'S', '-', 'S', 'P', 'C', '7', '0', '0', ' ', - 'S', 'o', 'u', 'n', 'd', ' ', 'F', 'i', 'l', 'e', ' ', - 'D', 'a', 't', 'a', ' ', 'v', '0', '.', '3', '0', 26, 26, 26 + 'S','N','E','S','-','S','P','C','7','0','0',' ', + 'S','o','u','n','d',' ','F','i','l','e',' ', + 'D','a','t','a',' ','v','0','.','3','0',26,26,26 }; static uint8 version = { 0x1e diff -NaHudr snes9x-1.43-src/snes9x/snes9x.cpp snx/snes9x/snes9x.cpp --- snes9x-1.43-src/snes9x/snes9x.cpp 2004-12-31 00:15:47.000000000 +0200 +++ snx/snes9x/snes9x.cpp 2007-07-02 00:16:12.000000000 +0300 @@ -96,6 +96,8 @@ #include "memmap.h" #include "display.h" #include "cheats.h" +#include "logger.h" +#include "unix/nesvideos-piece.hh" #ifdef DEBUGGER extern FILE *trace; @@ -115,7 +117,7 @@ -hirom or -fh or -hr Force Hi-ROM memory map, useful for hacked ROM images.\n"); S9xMessage (S9X_INFO, S9X_USAGE, "\ -lorom or -fl or -lr Force Lo-ROM memory map, useful for hacked ROM images.\n"); - //FIXME: -old bsolete? + //FIXME: -old obsolete? S9xMessage (S9X_INFO, S9X_USAGE, "\ -old or -o Enable old-style SNES joypad emulation\n"); //FIXME: -noold obsolete? @@ -211,6 +213,35 @@ #endif S9xMessage (S9X_INFO, S9X_USAGE, "\ +-displayframerate or -dfr Display frame rate\n"); + S9xMessage (S9X_INFO, S9X_USAGE, "\ +-keypress Show keys pressed to stdout (along with frame\n\ + counter (only reliable during movie rec/play))"); + S9xMessage (S9X_INFO, S9X_USAGE, "\ +-wip Play/record movies as snes9x 1.43-WIP (aka. dev1)"); + S9xMessage (S9X_INFO, S9X_USAGE, "\ +-upanddown Override protection from pressing UP and DOWN\n\ + at the same time. Same for LEFT and RIGHT"); + S9xMessage (S9X_INFO, S9X_USAGE, "\ +-mute Disable audio output. Sound is still emulated."); + S9xMessage (S9X_INFO, S9X_USAGE, "\ +-fakemute Emulate as though -nosound were given, but you still\n\ + get sound output (if incorrect)"); + S9xMessage (S9X_INFO, S9X_USAGE, "\ +-maxframes X Exit after playing X frames. Only works for movies"); + S9xMessage (S9X_INFO, S9X_USAGE, "\ +-ignoreframes X Number of frames to ignore from start of movie. (For AVI)"); + S9xMessage (S9X_INFO, S9X_USAGE, "\ +-autodemo filename.smv Load movie filename.smv (read-only) at start."); + S9xMessage (S9X_INFO, S9X_USAGE, "\ +-oldturbo Turbo button renders all frames."); + S9xMessage (S9X_INFO, S9X_USAGE, "\ +-dumpstreams Save audio and video (raw) to audiostreamX.dat and\n\ + videostreamX.dat, where X increments on each CPU\n\ + reset. -autodemo will start with X=1"); + + + S9xMessage (S9X_INFO, S9X_USAGE, "\ \nROM image needs to be in Super MagiCom (*.smc), Super FamiCom (*.sfc),\n\ *.fig, or split (*.1, *.2, or sf32527a, sf32527b, etc) format and can be\n\ compressed with gzip or compress.\n"); @@ -693,6 +724,8 @@ printf("Snes9X " VERSION "\n"); exit(0); } + + #endif #ifdef STORM else if (strcasecmp(argv[i],"-nosecondjoy")==0){secondjoy=0;} @@ -708,7 +741,39 @@ } } #endif - + // DeHackEd's modifications + else if (strcasecmp(argv[i], "-wip") == 0) + Settings.UseWIPAPUTiming = 1; + else if (strcasecmp(argv[i], "-upanddown") == 0) + Settings.DisallowLeftRight = 0; + else if (strcasecmp(argv[i], "-keypress") == 0) + Settings.DisplayPressedKeys = 1; + else if (strcasecmp(argv[i], "-mute") == 0) + Settings.Mute = 1; + else if (strcasecmp(argv[i], "-fakemute") == 0) + Settings.FakeMuteFix = 1; + else if (strcasecmp(argv[i], "-maxframes") == 0) + maxframes = atoi(argv[++i]); + else if (strcasecmp(argv[i], "-ignoreframes") == 0) + ignoreframes = atoi(argv[++i]); + else if (strcasecmp(argv[i], "-autodemo") == 0) + strncpy(autodemo, argv[++i], 120); + else if (strcasecmp(argv[i], "-oldturbo") == 0) + Settings.TurboSkipFrames = 0; + else if (strcasecmp(argv[i], "-dumpstreams") == 0) + dumpstreams = 1; + else if (strcasecmp(argv[i], "-videologcmd") == 0) + { + NESVideoSetVideoCmd(argv[++i]); + LoggingEnabled=1; + Settings.TurboMode = TRUE; + } + else if (strcasecmp(argv[i], "-beauty") == 0) + { + extern int do_beauty_analysis; + do_beauty_analysis = atoi(argv[++i]); + if(do_beauty_analysis) Settings.TurboMode = TRUE; + } else S9xParseArg (argv, i, argc); } diff -NaHudr snes9x-1.43-src/snes9x/snes9x_DGA,_vidmode.feature snx/snes9x/snes9x_DGA,_vidmode.feature --- snes9x-1.43-src/snes9x/snes9x_DGA,_vidmode.feature 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/snes9x_DGA,_vidmode.feature 2008-02-20 15:09:30.042992658 +0200 @@ -0,0 +1 @@ +DGA, vidmode........ yes diff -NaHudr snes9x-1.43-src/snes9x/snes9x_Gz.feature snx/snes9x/snes9x_Gz.feature --- snes9x-1.43-src/snes9x/snes9x_Gz.feature 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/snes9x_Gz.feature 2008-02-20 15:09:28.278962533 +0200 @@ -0,0 +1 @@ +Gz.................. yes diff -NaHudr snes9x-1.43-src/snes9x/snes9x.h snx/snes9x/snes9x.h --- snes9x-1.43-src/snes9x/snes9x.h 2004-12-31 00:15:47.000000000 +0200 +++ snx/snes9x/snes9x.h 2007-02-03 22:47:42.000000000 +0200 @@ -89,7 +89,7 @@ #ifndef _SNES9X_H_ #define _SNES9X_H_ -#define VERSION "1.43" +#define VERSION "1.43+ v9" #include #include @@ -272,6 +272,7 @@ /* Joystick options */ bool8 SwapJoypads; bool8 JoystickEnabled; + bool8 DisallowLeftRight; /* ROM timing options (see also H_Max above) */ bool8 ForcePAL; @@ -333,18 +334,23 @@ bool8 DisableSampleCaching; bool8 DisableMasterVolume; bool8 SoundSync; + bool8 FakeMuteFix; bool8 InterpolatedSound; bool8 ThreadSound; bool8 Mute; + bool8 FAMute; bool8 NextAPUEnabled; uint8 AltSampleDecode; bool8 FixFrequency; + bool8 UseWIPAPUTiming; /* Graphics options */ bool8 SixteenBit; bool8 Transparency; bool8 SupportHiRes; bool8 Mode7Interpolate; + bool8 HeightExtend; + bool8 AspectRatio; /* SNES graphics options */ bool8 BGLayering; @@ -353,6 +359,7 @@ bool8 ForceNoTransparency; bool8 DisableHDMA; bool8 DisplayFrameRate; + bool8 DisplayPressedKeys; bool8 DisableRangeTimeOver; /* XXX: unused */ /* Others */ @@ -390,6 +397,8 @@ #ifdef DEBUG_MAXCOUNT unsigned int MaxCount; #endif + + int CurrentSaveSlot; }; struct SSNESGameFixes diff -NaHudr snes9x-1.43-src/snes9x/snes9x_using_asm_cores.feature snx/snes9x/snes9x_using_asm_cores.feature --- snes9x-1.43-src/snes9x/snes9x_using_asm_cores.feature 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/snes9x_using_asm_cores.feature 2008-02-20 15:09:25.226910413 +0200 @@ -0,0 +1 @@ +using asm cores..... yes diff -NaHudr snes9x-1.43-src/snes9x/soundux.cpp snx/snes9x/soundux.cpp --- snes9x-1.43-src/snes9x/soundux.cpp 2004-12-31 00:15:44.000000000 +0200 +++ snx/snes9x/soundux.cpp 2005-04-09 00:59:27.000000000 +0300 @@ -156,6 +156,9 @@ extern "C" void DecodeBlockAsm (int8 *, int16 *, int32 *, int32 *); extern "C" void DecodeBlockAsm2 (int8 *, int16 *, int32 *, int32 *); +int FakeMute = 1; +int DoFakeMute = 0; + // F is channel's current frequency and M is the 16-bit modulation waveform // from the previous channel multiplied by the current envelope volume level. #define PITCH_MOD(F,M) ((F) * ((((unsigned long) (M)) + 0x800000) >> 16) >> 7) @@ -174,10 +177,12 @@ { ch->state = SOUND_SILENT; ch->mode = MODE_NONE; + if(!DoFakeMute || !Settings.FakeMuteFix) { APU.DSP [APU_ENDX] |= 1 << i; APU.DSP [APU_KON] &= ~(1 << i); APU.DSP [APU_KOFF] &= ~(1 << i); APU.KeyedChannels &= ~(1 << i); + } } #ifdef __DJGPP END_OF_FUNCTION (S9xAPUSetEndOfSample) @@ -185,7 +190,9 @@ void S9xAPUSetEndX (int ch) { + if(!DoFakeMute || !Settings.FakeMuteFix) { APU.DSP [APU_ENDX] |= 1 << ch; + } } #ifdef __DJGPP END_OF_FUNCTION (S9xAPUSetEndX) @@ -865,6 +872,8 @@ int pitch_mod = SoundData.pitch_mod & ~APU.DSP[APU_NON]; + DoFakeMute=FakeMute; + for (uint32 J = 0; J < NUM_CHANNELS; J++) { int32 VL, VR; @@ -1148,6 +1157,7 @@ } stereo_exit: ; } + DoFakeMute=0; } #ifdef __DJGPP @@ -1160,6 +1170,8 @@ int pitch_mod = SoundData.pitch_mod & (~APU.DSP[APU_NON]); + DoFakeMute=FakeMute; + for (uint32 J = 0; J < NUM_CHANNELS; J++) { Channel *ch = &SoundData.channels[J]; @@ -1433,6 +1445,7 @@ } mono_exit: ; } + DoFakeMute=0; } #ifdef __DJGPP END_OF_FUNCTION(MixMono); diff -NaHudr snes9x-1.43-src/snes9x/spc700.cpp snx/snes9x/spc700.cpp --- snes9x-1.43-src/snes9x/spc700.cpp 2004-12-31 00:15:45.000000000 +0200 +++ snx/snes9x/spc700.cpp 2006-09-30 23:25:18.000000000 +0300 @@ -131,7 +131,7 @@ { \ if (!ICPU.CPUExecuting) \ { \ - APU.Cycles = CPU.Cycles = CPU.NextEvent; \ + APU.Cycles = CPU.Cycles = CPU.NextEvent; \ S9xUpdateAPUTimer(); \ } \ else \ @@ -899,6 +899,7 @@ // SLEEP // XXX: sleep // STOP ("SLEEP"); + fprintf(stderr, "ApuEF\n"); IAPU.APUExecuting = FALSE; IAPU.PC++; } @@ -907,6 +908,7 @@ { // STOP // STOP ("STOP"); + fprintf(stderr, "ApuFF\n"); IAPU.APUExecuting = FALSE; IAPU.PC++; } diff -NaHudr snes9x-1.43-src/snes9x/TAGS snx/snes9x/TAGS --- snes9x-1.43-src/snes9x/TAGS 2004-12-31 00:15:48.000000000 +0200 +++ snx/snes9x/TAGS 2005-03-20 23:46:31.000000000 +0200 @@ -1,2221 +1,2221 @@ - -dsp1emu.c,7108 -#define __OPT__36,1055 -#define __OPT06__37,1071 -FILE * LogFile 41,1108 -void Log_Message 43,1132 -void Start_Log 57,1361 -void Stop_Log 67,1518 -const unsigned short DSP1ROM[78,1621 -#define INCR 212,10344 -#define Angle(Angle213,10362 -#define Cos(Cos214,10411 -#define Sin(Sin215,10450 -#define PI 219,10516 -double CosTable2[220,10561 -double SinTable2[221,10585 -double Atan(224,10611 -short C4WFXVal;237,10976 -short C4WFYVal;238,10992 -short C4WFZVal;239,11008 -short C4WFX2Val;240,11024 -short C4WFY2Val;241,11041 -short C4WFDist;242,11058 -short C4WFScale;243,11074 -double tanval;244,11091 -double c4x,245,11106 -double c4x,c4y,245,11106 -double c4x,c4y,c4z;245,11106 -double c4x2,246,11126 -double c4x2,c4y2,246,11126 -double c4x2,c4y2,c4z2;246,11126 -void C4TransfWireFrame(248,11150 -void C4TransfWireFrame2(274,11787 -void C4CalcWireFrame(300,12386 -short C41FXVal;320,12841 -short C41FYVal;321,12857 -short C41FAngleRes;322,12873 -short C41FDist;323,12893 -short C41FDistVal;324,12909 -void C4Op1F(326,12929 -void C4Op15(341,13258 -void C4Op0D(348,13400 -void InitDSP(362,13899 -short Op00Multiplicand;377,14130 -short Op00Multiplier;378,14154 -short Op00Result;379,14176 -void DSPOp00(381,14195 -short Op20Multiplicand;390,14392 -short Op20Multiplier;391,14416 -short Op20Result;392,14438 -void DSPOp20(394,14457 -signed short Op10Coefficient;404,14671 -signed short Op10Exponent;405,14701 -signed short Op10CoefficientR;406,14728 -signed short Op10ExponentR;407,14759 -void DSP1_Inverse(409,14788 -void DSPOp10(458,15785 -short Op04Angle;466,16027 -short Op04Radius;467,16044 -short Op04Sin;468,16062 -short Op04Cos;469,16077 -const short DSP1_MulTable[471,16093 -const short DSP1_SinTable[505,18498 -short DSP1_Sin(539,20903 -short DSP1_Cos(550,21175 -void DSP1_Normalize(561,21444 -void DSP1_NormalizeDouble(585,21768 -short DSP1_Truncate(636,22493 -void DSPOp04(646,22683 -short Op0CA;652,22805 -short Op0CX1;653,22818 -short Op0CY1;654,22832 -short Op0CX2;655,22846 -short Op0CY2;656,22860 -void DSPOp0C(658,22875 -short CentreX;664,23053 -short CentreY;665,23068 -short VOffset;666,23083 -short VPlane_C;668,23099 -short VPlane_E;669,23115 -short SinAas;672,23161 -short CosAas;673,23175 -short SinAzs;674,23189 -short CosAzs;675,23203 -short SinAZS;678,23242 -short CosAZS;679,23257 -short SecAZS_C1;680,23271 -short SecAZS_E1;681,23288 -short SecAZS_C2;682,23305 -short SecAZS_E2;683,23322 -const short MaxAZS_Exp[685,23340 -void DSP1_Parameter(690,23505 -void DSP1_Raster(773,25447 -short Op02FX;798,25903 -short Op02FY;799,25917 -short Op02FZ;800,25931 -short Op02LFE;801,25945 -short Op02LES;802,25960 -short Op02AAS;803,25975 -short Op02AZS;804,25990 -short Op02VOF;805,26005 -short Op02VVA;806,26020 -short Op02CX;807,26035 -short Op02CY;808,26049 -void DSPOp02(810,26064 -short Op0AVS;815,26199 -short Op0AA;816,26213 -short Op0AB;817,26226 -short Op0AC;818,26239 -short Op0AD;819,26252 -void DSPOp0A(821,26266 -short Op06X;827,26351 -short Op06Y;828,26364 -short Op06Z;829,26377 -short Op06H;830,26390 -short Op06V;831,26403 -unsigned short Op06S;832,26416 -double ObjPX;834,26439 -double ObjPY;835,26453 -double ObjPZ;836,26467 -double ObjPX1;837,26481 -double ObjPY1;838,26496 -double ObjPZ1;839,26511 -double ObjPX2;840,26526 -double ObjPY2;841,26541 -double ObjPZ2;842,26556 -double DivideOp06;843,26571 -int Temp;844,26590 -int tanval2;845,26600 -void DSPOp06(848,26631 -void DSPOp06(906,28027 -short matrixC[965,29447 -short matrixB[966,29468 -short matrixA[967,29489 -short Op01m;969,29511 -short Op01Zr;970,29524 -short Op01Xr;971,29538 -short Op01Yr;972,29552 -short Op11m;973,29566 -short Op11Zr;974,29579 -short Op11Xr;975,29593 -short Op11Yr;976,29607 -short Op21m;977,29621 -short Op21Zr;978,29634 -short Op21Xr;979,29648 -short Op21Yr;980,29662 -void DSPOp01(982,29677 -void DSPOp11(1006,30621 -void DSPOp21(1030,31565 -short Op0DX;1054,32509 -short Op0DY;1055,32522 -short Op0DZ;1056,32535 -short Op0DF;1057,32548 -short Op0DL;1058,32561 -short Op0DU;1059,32574 -short Op1DX;1060,32587 -short Op1DY;1061,32600 -short Op1DZ;1062,32613 -short Op1DF;1063,32626 -short Op1DL;1064,32639 -short Op1DU;1065,32652 -short Op2DX;1066,32665 -short Op2DY;1067,32678 -short Op2DZ;1068,32691 -short Op2DF;1069,32704 -short Op2DL;1070,32717 -short Op2DU;1071,32730 -void DSPOp0D(1073,32744 -void DSPOp1D(1084,33203 -void DSPOp2D(1095,33659 -short Op03F;1106,34115 -short Op03L;1107,34128 -short Op03U;1108,34141 -short Op03X;1109,34154 -short Op03Y;1110,34167 -short Op03Z;1111,34180 -short Op13F;1112,34193 -short Op13L;1113,34206 -short Op13U;1114,34219 -short Op13X;1115,34232 -short Op13Y;1116,34245 -short Op13Z;1117,34258 -short Op23F;1118,34271 -short Op23L;1119,34284 -short Op23U;1120,34297 -short Op23X;1121,34310 -short Op23Y;1122,34323 -short Op23Z;1123,34336 -void DSPOp03(1125,34350 -void DSPOp13(1136,34806 -void DSPOp23(1147,35262 -short Op14Zr;1158,35718 -short Op14Xr;1159,35732 -short Op14Yr;1160,35746 -short Op14U;1161,35760 -short Op14F;1162,35773 -short Op14L;1163,35786 -short Op14Zrr;1164,35799 -short Op14Xrr;1165,35814 -short Op14Yrr;1166,35829 -void DSPOp14(1168,35845 -void DSP1_Target(1200,36572 -short Op0EH;1229,37075 -short Op0EV;1230,37088 -short Op0EX;1231,37101 -short Op0EY;1232,37114 -void DSPOp0E(1234,37128 -short Op0BX;1239,37192 -short Op0BY;1240,37205 -short Op0BZ;1241,37218 -short Op0BS;1242,37231 -short Op1BX;1243,37244 -short Op1BY;1244,37257 -short Op1BZ;1245,37270 -short Op1BS;1246,37283 -short Op2BX;1247,37296 -short Op2BY;1248,37309 -short Op2BZ;1249,37322 -short Op2BS;1250,37335 -void DSPOp0B(1252,37349 -void DSPOp1B(1261,37510 -void DSPOp2B(1271,37874 -short Op08X,1280,38035 -short Op08X,Op08Y,1280,38035 -short Op08X,Op08Y,Op08Z,1280,38035 -short Op08X,Op08Y,Op08Z,Op08Ll,1280,38035 -short Op08X,Op08Y,Op08Z,Op08Ll,Op08Lh;1280,38035 -void DSPOp08(1282,38075 -short Op18X,1294,38376 -short Op18X,Op18Y,1294,38376 -short Op18X,Op18Y,Op18Z,1294,38376 -short Op18X,Op18Y,Op18Z,Op18R,1294,38376 -short Op18X,Op18Y,Op18Z,Op18R,Op18D;1294,38376 -void DSPOp18(1296,38414 -short Op38X,1305,38630 -short Op38X,Op38Y,1305,38630 -short Op38X,Op38Y,Op38Z,1305,38630 -short Op38X,Op38Y,Op38Z,Op38R,1305,38630 -short Op38X,Op38Y,Op38Z,Op38R,Op38D;1305,38630 -void DSPOp38(1307,38668 -short Op28X;1317,38896 -short Op28Y;1318,38909 -short Op28Z;1319,38922 -short Op28R;1320,38935 -void DSPOp28(1322,38949 -short Op1CX,1348,39493 -short Op1CX,Op1CY,1348,39493 -short Op1CX,Op1CY,Op1CZ;1348,39493 -short Op1CXBR,1349,39518 -short Op1CXBR,Op1CYBR,1349,39518 -short Op1CXBR,Op1CYBR,Op1CZBR,1349,39518 -short Op1CXBR,Op1CYBR,Op1CZBR,Op1CXAR,1349,39518 -short Op1CXBR,Op1CYBR,Op1CZBR,Op1CXAR,Op1CYAR,1349,39518 -short Op1CXBR,Op1CYBR,Op1CZBR,Op1CXAR,Op1CYAR,Op1CZAR;1349,39518 -short Op1CX1;1350,39573 -short Op1CY1;1351,39587 -short Op1CZ1;1352,39601 -short Op1CX2;1353,39615 -short Op1CY2;1354,39629 -short Op1CZ2;1355,39643 -void DSPOp1C(1357,39658 -unsigned short Op0FRamsize;1379,40455 -unsigned short Op0FPass;1380,40483 -void DSPOp0F(1382,40509 -short Op2FUnknown;1391,40636 -short Op2FSize;1392,40655 -void DSPOp2F(1394,40672 - -dsp2emu.c,439 -uint16 DSP2Op09Word1=91,3608 -uint16 DSP2Op09Word2=92,3632 -bool DSP2Op05HasLen=93,3656 -int DSP2Op05Len=94,3683 -bool DSP2Op06HasLen=95,3702 -int DSP2Op06Len=96,3729 -uint8 DSP2Op05Transparent=97,3748 -void DSP2_Op05 99,3778 -void DSP2_Op01 145,4917 -void DSP2_Op06 205,6224 -bool DSP2Op0DHasLen=219,6440 -int DSP2Op0DOutLen=220,6467 -int DSP2Op0DInLen=221,6489 -void DSP2_Op0D(227,6601 -void DSP2_Op0D(256,7429 -void DSP2_Op0D(304,8967 - -3d.h,89 -#define _3D_H_91,3622 -} OpenGLData;OpenGLData115,4152 -} GlideData;GlideData140,4612 - -65c816.h,1740 -#define _65c816_h_91,3626 -#define AL 93,3646 -#define AH 94,3663 -#define XL 95,3680 -#define XH 96,3697 -#define YL 97,3714 -#define YH 98,3731 -#define SL 99,3748 -#define SH 100,3765 -#define DL 101,3782 -#define DH 102,3799 -#define PL 103,3816 -#define PH 104,3833 -#define Carry 106,3851 -#define Zero 107,3873 -#define IRQ 108,3895 -#define Decimal 109,3917 -#define IndexFlag 110,3939 -#define MemoryFlag 111,3961 -#define Overflow 112,3983 -#define Negative 113,4005 -#define Emulation 114,4027 -#define ClearCarry(ClearCarry116,4050 -#define SetCarry(SetCarry117,4089 -#define SetZero(SetZero118,4126 -#define ClearZero(ClearZero119,4161 -#define SetIRQ(SetIRQ120,4198 -#define ClearIRQ(ClearIRQ121,4237 -#define SetDecimal(SetDecimal122,4279 -#define ClearDecimal(ClearDecimal123,4326 -#define SetIndex(SetIndex124,4376 -#define ClearIndex(ClearIndex125,4423 -#define SetMemory(SetMemory126,4473 -#define ClearMemory(ClearMemory127,4522 -#define SetOverflow(SetOverflow128,4574 -#define ClearOverflow(ClearOverflow129,4617 -#define SetNegative(SetNegative130,4662 -#define ClearNegative(ClearNegative131,4708 -#define CheckZero(CheckZero133,4754 -#define CheckCarry(CheckCarry134,4792 -#define CheckIRQ(CheckIRQ135,4827 -#define CheckDecimal(CheckDecimal136,4867 -#define CheckIndex(CheckIndex137,4915 -#define CheckMemory(CheckMemory138,4963 -#define CheckOverflow(CheckOverflow139,5013 -#define CheckNegative(CheckNegative140,5054 -#define CheckEmulation(CheckEmulation141,5102 -#define ClearFlags(ClearFlags143,5156 -#define SetFlags(SetFlags144,5202 -#define CheckFlag(CheckFlag145,5248 -} pair;pair155,5410 -struct SRegisters{SRegisters157,5419 -EXTERN_C struct SRegisters Registers;169,5571 - -apu.h,1275 -#define _apu_h_91,3623 -struct SIAPUSIAPU95,3661 -struct SAPUSAPU119,4133 -EXTERN_C struct SAPU APU;134,4421 -EXTERN_C struct SIAPU IAPU;135,4447 -STATIC inline void S9xAPUUnpackStatus(139,4568 -STATIC inline void S9xAPUPackStatus(146,4791 -#define APU_VOL_LEFT 174,5663 -#define APU_VOL_RIGHT 175,5689 -#define APU_P_LOW 176,5716 -#define APU_P_HIGH 177,5739 -#define APU_SRCN 178,5763 -#define APU_ADSR1 179,5785 -#define APU_ADSR2 180,5808 -#define APU_GAIN 181,5831 -#define APU_ENVX 182,5853 -#define APU_OUTX 183,5875 -#define APU_MVOL_LEFT 185,5898 -#define APU_MVOL_RIGHT 186,5925 -#define APU_EVOL_LEFT 187,5953 -#define APU_EVOL_RIGHT 188,5980 -#define APU_KON 189,6008 -#define APU_KOFF 190,6029 -#define APU_FLG 191,6051 -#define APU_ENDX 192,6072 -#define APU_EFB 194,6095 -#define APU_PMON 195,6116 -#define APU_NON 196,6138 -#define APU_EON 197,6159 -#define APU_DIR 198,6180 -#define APU_ESA 199,6201 -#define APU_EDL 200,6222 -#define APU_C0 202,6244 -#define APU_C1 203,6264 -#define APU_C2 204,6284 -#define APU_C3 205,6304 -#define APU_C4 206,6324 -#define APU_C5 207,6344 -#define APU_C6 208,6364 -#define APU_C7 209,6384 -#define APU_SOFT_RESET 211,6405 -#define APU_MUTE 212,6433 -#define APU_ECHO_DISABLED 213,6455 -#define FREQUENCY_MASK 215,6487 - -apumem.h,177 -#define _apumemory_h_91,3629 -INLINE uint8 S9xAPUGetByteZ 98,3723 -INLINE void S9xAPUSetByteZ 130,4392 -INLINE uint8 S9xAPUGetByte 159,4984 -INLINE void S9xAPUSetByte 192,5656 - -c4.h,23 -#define _C4_H_90,3621 - -cheats.h,704 -#define _CHEATS_H_90,3625 -struct SCheatSCheat92,3645 -#define MAX_CHEATS 102,3791 -struct SCheatDataSCheatData104,3814 - S9X_LESS_THAN,121,4213 - S9X_LESS_THAN, S9X_GREATER_THAN,121,4213 - S9X_LESS_THAN, S9X_GREATER_THAN, S9X_LESS_THAN_OR_EQUAL,121,4213 - S9X_GREATER_THAN_OR_EQUAL,122,4274 - S9X_GREATER_THAN_OR_EQUAL, S9X_EQUAL,122,4274 - S9X_GREATER_THAN_OR_EQUAL, S9X_EQUAL, S9X_NOT_EQUAL122,4274 -} S9xCheatComparisonType;S9xCheatComparisonType123,4330 - S9X_8_BITS,127,4372 - S9X_8_BITS, S9X_16_BITS,127,4372 - S9X_8_BITS, S9X_16_BITS, S9X_24_BITS,127,4372 - S9X_8_BITS, S9X_16_BITS, S9X_24_BITS, S9X_32_BITS127,4372 -} S9xCheatDataSize;S9xCheatDataSize128,4426 - -copyright.h,0 - -cpuaddr.h,1199 -#define _CPUADDR_H_91,3627 -EXTERN_C long OpAddress;93,3648 - NONE 96,3689 - READ 97,3703 - WRITE 98,3717 - MODIFY 99,3732 - JUMP 100,3748 -} AccessMode;AccessMode101,3761 -STATIC inline void Immediate8 103,3776 -STATIC inline void Immediate16 109,3894 -STATIC inline void Relative 115,4016 -STATIC inline void RelativeLong 124,4212 -STATIC inline void AbsoluteIndexedIndirect 139,4544 -STATIC inline void AbsoluteIndirectLong 155,4998 -STATIC inline void AbsoluteIndirect 175,5488 -STATIC inline void Absolute 193,5898 -STATIC inline void AbsoluteLong 207,6221 -STATIC inline void Direct(221,6566 -STATIC inline void DirectIndirectIndexed 231,6812 -STATIC inline void DirectIndirectIndexedLong 248,7292 -STATIC inline void DirectIndexedIndirect(264,7775 -STATIC inline void DirectIndexedX 284,8232 -STATIC inline void DirectIndexedY 302,8612 -STATIC inline void AbsoluteIndexedX 319,8991 -STATIC inline void AbsoluteIndexedY 336,9461 -STATIC inline void AbsoluteLongIndexedX 353,9921 -STATIC inline void DirectIndirect 367,10319 -STATIC inline void DirectIndirectLong 381,10685 -STATIC inline void StackRelative 396,11126 -STATIC inline void StackRelativeIndirectIndexed 406,11355 - -cpuexec.h,359 -#define _CPUEXEC_H_91,3627 -#define DO_HBLANK_CHECK(DO_HBLANK_CHECK96,3705 -struct SOpcodes SOpcodes100,3800 -struct SICPUSICPU108,3914 -STATIC inline void S9xUnpackStatus(141,4640 -STATIC inline void S9xPackStatus(149,4870 -STATIC inline void CLEAR_IRQ_SOURCE 156,5085 -STATIC inline void S9xFixCycles 163,5220 -STATIC inline void S9xReschedule 194,5630 - -cpumacro.h,2229 -#define _CPUMACRO_H_91,3628 -STATIC inline void SetZN16 93,3650 -STATIC inline void SetZN8 99,3766 -STATIC inline void ADC8 105,3860 -STATIC inline void ADC16 162,4730 -STATIC inline void AND16 238,5920 -STATIC inline void AND8 244,6027 -STATIC inline void A_ASL16 250,6130 -STATIC inline void A_ASL8 260,6321 -STATIC inline void ASL16 270,6508 -STATIC inline void ASL8 284,6828 -STATIC inline void BIT16 296,7063 -STATIC inline void BIT8 304,7270 -STATIC inline void CMP16 312,7447 -STATIC inline void CMP8 320,7611 -STATIC inline void CMX16 328,7773 -STATIC inline void CMX8 336,7937 -STATIC inline void CMY16 344,8099 -STATIC inline void CMY8 352,8263 -STATIC inline void A_DEC16 360,8425 -STATIC inline void A_DEC8 373,8622 -STATIC inline void DEC16 386,8815 -STATIC inline void DEC8 402,9137 -STATIC inline void EOR16 416,9376 -STATIC inline void EOR8 422,9483 -STATIC inline void A_INC16 428,9586 -STATIC inline void A_INC8 441,9783 -STATIC inline void INC16 454,9976 -STATIC inline void INC8 470,10298 -STATIC inline void LDA16 484,10537 -STATIC inline void LDA8 490,10643 -STATIC inline void LDX16 496,10745 -STATIC inline void LDX8 502,10851 -STATIC inline void LDY16 508,10953 -STATIC inline void LDY8 514,11059 -STATIC inline void A_LSR16 520,11161 -STATIC inline void A_LSR8 530,11342 -STATIC inline void LSR16 540,11519 -STATIC inline void LSR8 554,11829 -STATIC inline void ORA16 566,12054 -STATIC inline void ORA8 572,12161 -STATIC inline void A_ROL16 578,12264 -STATIC inline void A_ROL8 589,12510 -STATIC inline void ROL16 602,12772 -STATIC inline void ROL8 617,13140 -STATIC inline void A_ROR16 630,13420 -STATIC inline void A_ROR8 643,13705 -STATIC inline void ROR16 655,13973 -STATIC inline void ROR8 670,14363 -STATIC inline void SBC16 683,14659 -STATIC inline void SBC8 753,15816 -STATIC inline void STA16 804,16686 -STATIC inline void STA8 809,16762 -STATIC inline void STX16 814,16836 -STATIC inline void STX8 819,16912 -STATIC inline void STY16 824,16986 -STATIC inline void STY8 829,17062 -STATIC inline void STZ16 834,17136 -STATIC inline void STZ8 839,17200 -STATIC inline void TSB16 844,17263 -STATIC inline void TSB8 857,17580 -STATIC inline void TRB16 868,17805 -STATIC inline void TRB8 881,18123 - -cpuops.h,72 -#define _CPUOPS_H_91,3626 -#define CHECK_FOR_IRQ(CHECK_FOR_IRQ95,3692 - -debug.h,67 -#define _DEBUG_H_91,3625 -struct SBreakPoint{SBreakPoint100,3770 - -display.h,28 -#define _DISPLAY_H_91,3627 - -dma.h,24 -#define _DMA_H_91,3623 - -dsp1.h,54 -#define _DSP1_H_91,3625 -struct SDSP1 SDSP1109,4085 - -dsp4.h,1454 -int block;2,10 -int8 DSP4_Logic;6,85 -const int16 PLANE_START 9,151 -int16 view_plane;11,209 -int16 far_plane;12,251 -int16 segments;13,303 -int16 raster;14,354 -int16 project_x;16,400 -int16 project_y;17,444 -int16 project_centerx;19,490 -int16 project_centery;20,541 -int16 project_x1;22,594 -int16 project_x1low;23,639 -int16 project_y1;24,680 -int16 project_y1low;25,725 -int16 project_x2;27,768 -int16 project_y2;28,820 -int16 project_pitchx;30,874 -int16 project_pitchxlow;31,915 -int16 project_pitchy;32,958 -int16 project_pitchylow;33,999 -int16 project_focalx;35,1044 -int16 project_focaly;36,1110 -int16 project_ptr;38,1178 -int16 center_x;41,1247 -int16 center_y;42,1293 -int16 viewport_left;43,1339 -int16 viewport_right;44,1385 -int16 viewport_top;45,1433 -int16 viewport_bottom;46,1478 -int16 sprite_x;49,1550 -int16 sprite_y;50,1601 -int16 sprite_offset;51,1652 -int8 sprite_type;52,1699 -bool8 sprite_size;53,1742 -int16 path_clipRight[56,1812 -int16 path_clipLeft[57,1867 -int16 path_pos[58,1922 -int16 path_ptr[59,1970 -int16 path_raster[60,2021 -int16 path_top[61,2065 -int16 path_y[63,2107 -int16 path_x[64,2152 -int16 path_plane[65,2193 -int16 multi_index1;68,2262 -int16 multi_index2;69,2304 -bool8 op09_mode;70,2346 -int16 multi_focaly[73,2407 -int16 multi_farplane[74,2452 -int16 multi_raster[75,2506 -int8 op06_OAM[78,2568 -int8 op06_index;79,2615 -int8 op06_offset;80,2662 -short MaxTilesPerRow 82,2713 -short RowCount[83,2740 - -font.h,94 -static char *font[89,3606 -static int font_width 146,10762 -static int font_height 147,10789 - -fxemu.h,630 -#define _FXEMU_H_ 90,3624 -#define snes9x_types_defined94,3714 -typedef unsigned char uint8;uint896,3744 -typedef unsigned short uint16;uint1697,3773 -typedef unsigned int uint32;uint3298,3804 -typedef unsigned char bool8;bool899,3833 -typedef signed char int8;int8100,3862 -typedef short int16;int16101,3888 -typedef int int32;int32102,3909 -#define TRUE 106,3949 -#define FALSE 110,3986 -struct FxInit_sFxInit_s114,4094 -#define FX_FLAG_ADDRESS_CHECKING 164,5601 -#define FX_FLAG_ROM_BUFFER 165,5639 -#define FX_BREAKPOINT 168,5739 -#define FX_ERROR_ILLEGAL_ADDRESS 169,5766 -#define OPCODE_BYTES(OPCODE_BYTES172,5849 - -fxinst.h,2821 -#define _FXINST_H_ 90,3625 -#define FX_RAM_BANKS 211,7076 -struct FxRegs_sFxRegs_s219,7260 -#define FxRegs_s_null 286,9947 -#define GSU_R0 295,10337 -#define GSU_R1 296,10358 -#define GSU_R2 297,10379 -#define GSU_R3 298,10400 -#define GSU_R4 299,10421 -#define GSU_R5 300,10442 -#define GSU_R6 301,10463 -#define GSU_R7 302,10484 -#define GSU_R8 303,10505 -#define GSU_R9 304,10526 -#define GSU_R10 305,10547 -#define GSU_R11 306,10569 -#define GSU_R12 307,10591 -#define GSU_R13 308,10613 -#define GSU_R14 309,10635 -#define GSU_R15 310,10657 -#define GSU_SFR 311,10679 -#define GSU_BRAMR 312,10701 -#define GSU_PBR 313,10725 -#define GSU_ROMBR 314,10747 -#define GSU_CFGR 315,10771 -#define GSU_SCBR 316,10794 -#define GSU_CLSR 317,10817 -#define GSU_SCMR 318,10840 -#define GSU_VCR 319,10863 -#define GSU_RAMBR 320,10885 -#define GSU_CBR 321,10909 -#define GSU_CACHERAM 322,10931 -#define FLG_Z 325,10975 -#define FLG_CY 326,10996 -#define FLG_S 327,11018 -#define FLG_OV 328,11039 -#define FLG_G 329,11061 -#define FLG_R 330,11082 -#define FLG_ALT1 331,11103 -#define FLG_ALT2 332,11127 -#define FLG_IL 333,11151 -#define FLG_IH 334,11174 -#define FLG_B 335,11197 -#define FLG_IRQ 336,11219 -#define TF(TF339,11260 -#define CF(CF340,11302 -#define SF(SF341,11346 -#define TS(TS344,11441 -#define ALT0 347,11566 -#define ALT1 348,11602 -#define ALT2 349,11637 -#define ALT3 350,11672 -#define SEX16(SEX16353,11749 -#define SEX8(SEX8354,11788 -#define USEX16(USEX16357,11870 -#define USEX8(USEX8358,11912 -#define SUSEX16(SUSEX16360,11953 -#define TSZ(TSZ363,12029 -#define CLRFLAGS 366,12111 -#define RAM(RAM369,12234 -#define ROM(ROM372,12307 -#define PIPE 375,12397 -#define PRGBANK(PRGBANK378,12467 -#define FETCHPIPE 382,12549 -#define FETCHPIPE 384,12642 -#define ABS(ABS388,12703 -#define SREG 391,12765 -#define DREG 394,12827 -#define READR14399,12901 -#define TESTR14402,12951 -#define READR14 407,12990 -#define TESTR14 410,13060 -#define R0 415,13142 -#define R1 416,13166 -#define R2 417,13190 -#define R3 418,13214 -#define R4 419,13238 -#define R5 420,13262 -#define R6 421,13286 -#define R7 422,13310 -#define R8 423,13334 -#define R9 424,13358 -#define R10 425,13382 -#define R11 426,13408 -#define R12 427,13434 -#define R13 428,13460 -#define R14 429,13486 -#define R15 430,13512 -#define SFR 431,13538 -#define PBR 432,13565 -#define ROMBR 433,13593 -#define RAMBR 434,13623 -#define CBR 435,13653 -#define SCBR 436,13683 -#define SCMR 437,13729 -#define COLR 438,13775 -#define POR 439,13802 -#define BRAMR 440,13833 -#define VCR 441,13881 -#define CFGR 442,13925 -#define CLSR 443,13971 -#define FX_STEP 446,14091 -#define FX_FUNCTION_RUN 449,14220 -#define FX_FUNCTION_RUN_TO_BREAKPOINT 450,14248 -#define FX_FUNCTION_STEP_OVER 451,14288 -#define BRANCH_DELAY_RELATIVE472,15061 - -getset.h,281 -#define _GETSET_H_91,3626 -INLINE uint8 S9xGetByte 106,3816 -INLINE uint16 S9xGetWord 197,6063 -INLINE void S9xSetByte 320,9837 -INLINE void S9xSetWord 436,12378 -INLINE uint8 *GetBasePointer 594,16671 -INLINE uint8 *S9xGetMemPointer 660,18406 -INLINE void S9xSetPCBase 714,20029 - -gfx.h,1072 -#define _GFX_H_91,3623 -struct SGFX{SGFX96,3679 -struct SLineData SLineData155,5280 -#define H_FLIP 162,5364 -#define V_FLIP 163,5386 -#define BLANK_TILE 164,5408 -struct SBGSBG166,5430 -struct SLineMatrixDataSLineMatrixData184,5726 -#define SWAP_DWORD(SWAP_DWORD208,6279 -#define READ_2BYTES(READ_2BYTES212,6448 -#define WRITE_2BYTES(WRITE_2BYTES213,6489 -#define READ_2BYTES(READ_2BYTES216,6561 -#define WRITE_2BYTES(WRITE_2BYTES217,6631 -#define READ_2BYTES(READ_2BYTES220,6745 -#define WRITE_2BYTES(WRITE_2BYTES221,6815 -#define SUB_SCREEN_DEPTH 226,6940 -#define MAIN_SCREEN_DEPTH 227,6967 -#define COLOR_ADD(COLOR_ADD230,7030 -#define COLOR_ADD(COLOR_ADD235,7196 -#define COLOR_ADD1_2(COLOR_ADD1_2242,7412 -#define COLOR_SUB(COLOR_SUB248,7635 -#define COLOR_SUB(COLOR_SUB252,7792 -inline uint16 COLOR_SUB(259,8038 -#define COLOR_SUB1_2(COLOR_SUB1_2279,8422 -typedef void (*NormalTileRenderer)NormalTileRenderer283,8542 -typedef void (*ClippedTileRenderer)ClippedTileRenderer285,8652 -typedef void (*LargePixelRenderer)LargePixelRenderer288,8805 - -memmap.h,2552 -#define _memmap_h_91,3626 -#define READ_WORD(READ_WORD96,3695 -#define READ_DWORD(READ_DWORD97,3734 -#define WRITE_WORD(WRITE_WORD98,3774 -#define WRITE_DWORD(WRITE_DWORD99,3823 -#define READ_3WORD(READ_3WORD101,3874 -#define WRITE_3WORD(WRITE_3WORD102,3927 -#define READ_WORD(READ_WORD107,4062 -#define READ_DWORD(READ_DWORD109,4140 -#define WRITE_WORD(WRITE_WORD113,4302 -#define WRITE_DWORD(WRITE_DWORD115,4408 -#define WRITE_3WORD(WRITE_3WORD119,4676 -#define READ_3WORD(READ_3WORD122,4873 -#define MEMMAP_BLOCK_SIZE 127,5030 -#define MEMMAP_NUM_BLOCKS 128,5065 -#define MEMMAP_BLOCKS_PER_BANK 129,5123 -#define MEMMAP_SHIFT 130,5184 -#define MEMMAP_MASK 131,5208 -#define MEMMAP_MAX_SDD1_LOGGED_ENTRIES 132,5252 -#define NOPE 135,5329 -#define YEAH 136,5344 -#define BIGFIRST 137,5359 -#define SMALLFIRST 138,5378 -enum file_formats file_formats141,5423 -enum file_formats { FILE_ZIP,141,5423 -enum file_formats { FILE_ZIP, FILE_RAR,141,5423 -enum file_formats { FILE_ZIP, FILE_RAR, FILE_JMA,141,5423 -enum file_formats { FILE_ZIP, FILE_RAR, FILE_JMA, FILE_DEFAULT 141,5423 -class CMemory CMemory143,5490 - MAP_PPU,CMemory::MAP_PPU198,6999 - MAP_PPU, MAP_CPU,CMemory::MAP_CPU198,6999 - MAP_PPU, MAP_CPU, MAP_DSP,CMemory::MAP_DSP198,6999 - MAP_PPU, MAP_CPU, MAP_DSP, MAP_LOROM_SRAM,CMemory::MAP_LOROM_SRAM198,6999 - MAP_PPU, MAP_CPU, MAP_DSP, MAP_LOROM_SRAM, MAP_HIROM_SRAM,CMemory::MAP_HIROM_SRAM198,6999 - MAP_NONE,CMemory::MAP_NONE199,7059 - MAP_NONE, MAP_DEBUG,CMemory::MAP_DEBUG199,7059 - MAP_NONE, MAP_DEBUG, MAP_C4,CMemory::MAP_C4199,7059 - MAP_NONE, MAP_DEBUG, MAP_C4, MAP_BWRAM,CMemory::MAP_BWRAM199,7059 - MAP_NONE, MAP_DEBUG, MAP_C4, MAP_BWRAM, MAP_BWRAM_BITMAP,CMemory::MAP_BWRAM_BITMAP199,7059 - MAP_BWRAM_BITMAP2,CMemory::MAP_BWRAM_BITMAP2200,7118 - MAP_BWRAM_BITMAP2, MAP_SA1RAM,CMemory::MAP_SA1RAM200,7118 - MAP_BWRAM_BITMAP2, MAP_SA1RAM, MAP_SPC7110_ROM,CMemory::MAP_SPC7110_ROM200,7118 - MAP_BWRAM_BITMAP2, MAP_SA1RAM, MAP_SPC7110_ROM, MAP_SPC7110_DRAM,CMemory::MAP_SPC7110_DRAM200,7118 - MAP_RONLY_SRAM,CMemory::MAP_RONLY_SRAM201,7185 - MAP_RONLY_SRAM, MAP_OBC_RAM,CMemory::MAP_OBC_RAM201,7185 - MAP_RONLY_SRAM, MAP_OBC_RAM, MAP_SETA_DSP,CMemory::MAP_SETA_DSP201,7185 - MAP_RONLY_SRAM, MAP_OBC_RAM, MAP_SETA_DSP, MAP_SETA_RISC,CMemory::MAP_SETA_RISC201,7185 - MAP_RONLY_SRAM, MAP_OBC_RAM, MAP_SETA_DSP, MAP_SETA_RISC, MAP_LASTCMemory::MAP_LAST201,7185 - enum { MAX_ROM_SIZE CMemory::MAX_ROM_SIZE203,7260 - enum { MAX_ROM_SIZE = 0x800000 CMemory::x800000203,7260 -#define INLINE 291,9341 - -messages.h,1138 -#define _messages_h_91,3628 - S9X_TRACE,95,3707 - S9X_DEBUG,96,3722 - S9X_WARNING,97,3737 - S9X_INFO,98,3754 - S9X_ERROR,99,3768 - S9X_FATAL_ERROR100,3783 - S9X_ROM_INFO,105,3847 - S9X_HEADERS_INFO,106,3865 - S9X_ROM_CONFUSING_FORMAT_INFO,107,3887 - S9X_ROM_INTERLEAVED_INFO,108,3922 - S9X_SOUND_DEVICE_OPEN_FAILED,109,3952 - S9X_APU_STOPPED,110,3986 - S9X_USAGE,111,4007 - S9X_GAME_GENIE_CODE_ERROR,112,4022 - S9X_ACTION_REPLY_CODE_ERROR,113,4053 - S9X_GOLD_FINGER_CODE_ERROR,114,4086 - S9X_DEBUG_OUTPUT,115,4118 - S9X_DMA_TRACE,116,4140 - S9X_HDMA_TRACE,117,4159 - S9X_WRONG_FORMAT,118,4179 - S9X_WRONG_VERSION,119,4201 - S9X_ROM_NOT_FOUND,120,4224 - S9X_FREEZE_FILE_NOT_FOUND,121,4247 - S9X_PPU_TRACE,122,4278 - S9X_TRACE_DSP1,123,4297 - S9X_FREEZE_ROM_NAME,124,4317 - S9X_HEADER_WARNING,125,4342 - S9X_NETPLAY_NOT_SERVER,126,4366 - S9X_FREEZE_FILE_INFO,127,4394 - S9X_TURBO_MODE,128,4420 - S9X_SOUND_NOT_BUILT,129,4440 - S9X_MOVIE_INFO,130,4465 - S9X_WRONG_MOVIE_SNAPSHOT,131,4482 - S9X_NOT_A_MOVIE_SNAPSHOT,132,4509 - S9X_AVI_INFO133,4536 - -missing.h,127 -#define _MISSING_H_91,3627 -struct HDMAHDMA93,3648 -struct MissingMissing106,3908 -EXTERN_C struct Missing missing;162,5179 - -movie.h,341 -#define _MOVIE_H_92,3682 -# define SUCCESS 99,3775 -# define WRONG_FORMAT 100,3795 -# define WRONG_VERSION 101,3823 -# define FILE_NOT_FOUND 102,3852 -#define MOVIE_OPT_FROM_SNAPSHOT 105,3890 -#define MOVIE_OPT_FROM_RESET 106,3924 -#define MOVIE_OPT_PAL 107,3960 -#define MOVIE_MAX_METADATA 108,3999 -struct MovieInfoMovieInfo111,4047 - -netplay.h,1648 -#define _NETPLAY_H_91,3627 -#define NP_VERSION 110,3927 -#define NP_JOYPAD_HIST_SIZE 111,3949 -#define NP_DEFAULT_PORT 112,3981 -#define NP_MAX_CLIENTS 114,4011 -#define NP_SERV_MAGIC 116,4037 -#define NP_CLNT_MAGIC 117,4063 -#define NP_CLNT_HELLO 119,4090 -#define NP_CLNT_JOYPAD 120,4114 -#define NP_CLNT_RESET 121,4139 -#define NP_CLNT_PAUSE 122,4163 -#define NP_CLNT_LOAD_ROM 123,4187 -#define NP_CLNT_ROM_IMAGE 124,4214 -#define NP_CLNT_FREEZE_FILE 125,4242 -#define NP_CLNT_SRAM_DATA 126,4272 -#define NP_CLNT_READY 127,4300 -#define NP_CLNT_LOADED_ROM 128,4324 -#define NP_CLNT_RECEIVED_ROM_IMAGE 129,4353 -#define NP_CLNT_WAITING_FOR_ROM_IMAGE 130,4391 -#define NP_SERV_HELLO 132,4433 -#define NP_SERV_JOYPAD 133,4457 -#define NP_SERV_RESET 134,4482 -#define NP_SERV_PAUSE 135,4506 -#define NP_SERV_LOAD_ROM 136,4530 -#define NP_SERV_ROM_IMAGE 137,4557 -#define NP_SERV_FREEZE_FILE 138,4585 -#define NP_SERV_SRAM_DATA 139,4615 -#define NP_SERV_READY 140,4643 -struct SNPClientSNPClient142,4668 - NP_SERVER_SEND_ROM_IMAGE,157,4956 - NP_SERVER_SYNC_ALL,158,4986 - NP_SERVER_SYNC_CLIENT,159,5010 - NP_SERVER_SEND_FREEZE_FILE_ALL,160,5037 - NP_SERVER_SEND_ROM_LOAD_REQUEST_ALL,161,5073 - NP_SERVER_RESET_ALL,162,5114 - NP_SERVER_SEND_SRAM_ALL,163,5139 - NP_SERVER_SEND_SRAM164,5168 -#define NP_MAX_TASKS 167,5196 -struct NPServerTaskNPServerTask169,5221 -struct SNPServerSNPServer175,5281 -#define NP_MAX_ACTION_LEN 193,5708 -struct SNetPlaySNetPlay195,5739 -extern "C" struct SNetPlay NetPlay;228,6721 -#define WRITE_LONG(WRITE_LONG236,6852 -#define READ_LONG(READ_LONG243,7026 -#define S9xGetMilliTime 280,8281 - -obc1.h,25 -#define _OBC1_H_91,3624 - -pixform.h,7535 -#define _PIXFORM_H_91,3627 -enum { RGB565,95,3673 -enum { RGB565, RGB555,95,3673 -enum { RGB565, RGB555, BGR565,95,3673 -enum { RGB565, RGB555, BGR565, BGR555,95,3673 -enum { RGB565, RGB555, BGR565, BGR555, GBR565,95,3673 -enum { RGB565, RGB555, BGR565, BGR555, GBR565, GBR555,95,3673 -enum { RGB565, RGB555, BGR565, BGR555, GBR565, GBR555, RGB5551 95,3673 -#define BUILD_PIXEL(BUILD_PIXEL97,3740 -#define BUILD_PIXEL2(BUILD_PIXEL298,3797 -#define DECOMPOSE_PIXEL(DECOMPOSE_PIXEL99,3856 -#define BUILD_PIXEL_RGB565(BUILD_PIXEL_RGB565127,4671 -#define BUILD_PIXEL2_RGB565(BUILD_PIXEL2_RGB565128,4756 -#define DECOMPOSE_PIXEL_RGB565(DECOMPOSE_PIXEL_RGB565129,4842 -#define SPARE_RGB_BIT_MASK_RGB565 130,4953 -#define MAX_RED_RGB565 132,4997 -#define MAX_GREEN_RGB565 133,5026 -#define MAX_BLUE_RGB565 134,5056 -#define RED_LOW_BIT_MASK_RGB565 135,5086 -#define GREEN_LOW_BIT_MASK_RGB565 136,5127 -#define BLUE_LOW_BIT_MASK_RGB565 137,5168 -#define RED_HI_BIT_MASK_RGB565 138,5209 -#define GREEN_HI_BIT_MASK_RGB565 139,5250 -#define BLUE_HI_BIT_MASK_RGB565 140,5291 -#define FIRST_COLOR_MASK_RGB565 141,5332 -#define SECOND_COLOR_MASK_RGB565 142,5373 -#define THIRD_COLOR_MASK_RGB565 143,5414 -#define ALPHA_BITS_MASK_RGB565 144,5455 -#define BUILD_PIXEL_RGB555(BUILD_PIXEL_RGB555147,5518 -#define BUILD_PIXEL2_RGB555(BUILD_PIXEL2_RGB555148,5603 -#define DECOMPOSE_PIXEL_RGB555(DECOMPOSE_PIXEL_RGB555149,5689 -#define SPARE_RGB_BIT_MASK_RGB555 150,5800 -#define MAX_RED_RGB555 152,5845 -#define MAX_GREEN_RGB555 153,5874 -#define MAX_BLUE_RGB555 154,5904 -#define RED_LOW_BIT_MASK_RGB555 155,5934 -#define GREEN_LOW_BIT_MASK_RGB555 156,5975 -#define BLUE_LOW_BIT_MASK_RGB555 157,6016 -#define RED_HI_BIT_MASK_RGB555 158,6057 -#define GREEN_HI_BIT_MASK_RGB555 159,6098 -#define BLUE_HI_BIT_MASK_RGB555 160,6139 -#define FIRST_COLOR_MASK_RGB555 161,6180 -#define SECOND_COLOR_MASK_RGB555 162,6221 -#define THIRD_COLOR_MASK_RGB555 163,6262 -#define ALPHA_BITS_MASK_RGB555 164,6303 -#define BUILD_PIXEL_BGR565(BUILD_PIXEL_BGR565167,6365 -#define BUILD_PIXEL2_BGR565(BUILD_PIXEL2_BGR565168,6450 -#define DECOMPOSE_PIXEL_BGR565(DECOMPOSE_PIXEL_BGR565169,6536 -#define SPARE_RGB_BIT_MASK_BGR565 170,6647 -#define MAX_RED_BGR565 172,6691 -#define MAX_GREEN_BGR565 173,6720 -#define MAX_BLUE_BGR565 174,6750 -#define RED_LOW_BIT_MASK_BGR565 175,6780 -#define GREEN_LOW_BIT_MASK_BGR565 176,6821 -#define BLUE_LOW_BIT_MASK_BGR565 177,6862 -#define RED_HI_BIT_MASK_BGR565 178,6903 -#define GREEN_HI_BIT_MASK_BGR565 179,6944 -#define BLUE_HI_BIT_MASK_BGR565 180,6985 -#define FIRST_COLOR_MASK_BGR565 181,7026 -#define SECOND_COLOR_MASK_BGR565 182,7067 -#define THIRD_COLOR_MASK_BGR565 183,7108 -#define ALPHA_BITS_MASK_BGR565 184,7149 -#define BUILD_PIXEL_BGR555(BUILD_PIXEL_BGR555187,7211 -#define BUILD_PIXEL2_BGR555(BUILD_PIXEL2_BGR555188,7296 -#define DECOMPOSE_PIXEL_BGR555(DECOMPOSE_PIXEL_BGR555189,7382 -#define SPARE_RGB_BIT_MASK_BGR555 190,7493 -#define MAX_RED_BGR555 192,7538 -#define MAX_GREEN_BGR555 193,7567 -#define MAX_BLUE_BGR555 194,7597 -#define RED_LOW_BIT_MASK_BGR555 195,7627 -#define GREEN_LOW_BIT_MASK_BGR555 196,7668 -#define BLUE_LOW_BIT_MASK_BGR555 197,7709 -#define RED_HI_BIT_MASK_BGR555 198,7750 -#define GREEN_HI_BIT_MASK_BGR555 199,7791 -#define BLUE_HI_BIT_MASK_BGR555 200,7832 -#define FIRST_COLOR_MASK_BGR555 201,7873 -#define SECOND_COLOR_MASK_BGR555 202,7914 -#define THIRD_COLOR_MASK_BGR555 203,7955 -#define ALPHA_BITS_MASK_BGR555 204,7996 -#define BUILD_PIXEL_GBR565(BUILD_PIXEL_GBR565207,8058 -#define BUILD_PIXEL2_GBR565(BUILD_PIXEL2_GBR565208,8143 -#define DECOMPOSE_PIXEL_GBR565(DECOMPOSE_PIXEL_GBR565209,8229 -#define SPARE_RGB_BIT_MASK_GBR565 210,8340 -#define MAX_RED_GBR565 212,8384 -#define MAX_BLUE_GBR565 213,8421 -#define MAX_GREEN_GBR565 214,8458 -#define RED_LOW_BIT_MASK_GBR565 215,8495 -#define BLUE_LOW_BIT_MASK_GBR565 216,8536 -#define GREEN_LOW_BIT_MASK_GBR565 217,8577 -#define RED_HI_BIT_MASK_GBR565 218,8618 -#define BLUE_HI_BIT_MASK_GBR565 219,8659 -#define GREEN_HI_BIT_MASK_GBR565 220,8700 -#define FIRST_COLOR_MASK_GBR565 221,8741 -#define SECOND_COLOR_MASK_GBR565 222,8782 -#define THIRD_COLOR_MASK_GBR565 223,8823 -#define ALPHA_BITS_MASK_GBR565 224,8864 -#define BUILD_PIXEL_GBR555(BUILD_PIXEL_GBR555227,8926 -#define BUILD_PIXEL2_GBR555(BUILD_PIXEL2_GBR555228,9011 -#define DECOMPOSE_PIXEL_GBR555(DECOMPOSE_PIXEL_GBR555229,9097 -#define SPARE_RGB_BIT_MASK_GBR555 230,9208 -#define MAX_RED_GBR555 232,9253 -#define MAX_BLUE_GBR555 233,9290 -#define MAX_GREEN_GBR555 234,9327 -#define RED_LOW_BIT_MASK_GBR555 235,9364 -#define BLUE_LOW_BIT_MASK_GBR555 236,9405 -#define GREEN_LOW_BIT_MASK_GBR555 237,9446 -#define RED_HI_BIT_MASK_GBR555 238,9487 -#define BLUE_HI_BIT_MASK_GBR555 239,9528 -#define GREEN_HI_BIT_MASK_GBR555 240,9569 -#define FIRST_COLOR_MASK_GBR555 241,9610 -#define SECOND_COLOR_MASK_GBR555 242,9651 -#define THIRD_COLOR_MASK_GBR555 243,9692 -#define ALPHA_BITS_MASK_GBR555 244,9733 -#define BUILD_PIXEL_RGB5551(BUILD_PIXEL_RGB5551247,9796 -#define BUILD_PIXEL2_RGB5551(BUILD_PIXEL2_RGB5551248,9893 -#define DECOMPOSE_PIXEL_RGB5551(DECOMPOSE_PIXEL_RGB5551249,9991 -#define SPARE_RGB_BIT_MASK_RGB5551 250,10110 -#define MAX_RED_RGB5551 252,10150 -#define MAX_GREEN_RGB5551 253,10181 -#define MAX_BLUE_RGB5551 254,10213 -#define RED_LOW_BIT_MASK_RGB5551 255,10244 -#define GREEN_LOW_BIT_MASK_RGB5551 256,10286 -#define BLUE_LOW_BIT_MASK_RGB5551 257,10328 -#define RED_HI_BIT_MASK_RGB5551 258,10370 -#define GREEN_HI_BIT_MASK_RGB5551 259,10412 -#define BLUE_HI_BIT_MASK_RGB5551 260,10454 -#define FIRST_COLOR_MASK_RGB5551 261,10496 -#define SECOND_COLOR_MASK_RGB5551 262,10538 -#define THIRD_COLOR_MASK_RGB5551 263,10580 -#define ALPHA_BITS_MASK_RGB5551 264,10622 -#define CONCAT(CONCAT267,10690 -#define BUILD_PIXEL_D(BUILD_PIXEL_D271,10866 -#define BUILD_PIXEL2_D(BUILD_PIXEL2_D272,10928 -#define DECOMPOSE_PIXEL_D(DECOMPOSE_PIXEL_D273,10992 -#define BUILD_PIXEL(BUILD_PIXEL275,11071 -#define BUILD_PIXEL2(BUILD_PIXEL2276,11132 -#define DECOMPOSE_PIXEL(DECOMPOSE_PIXEL277,11195 -#define MAX_RED_D(MAX_RED_D279,11273 -#define MAX_BLUE_D(MAX_BLUE_D280,11314 -#define MAX_GREEN_D(MAX_GREEN_D281,11357 -#define RED_LOW_BIT_MASK_D(RED_LOW_BIT_MASK_D282,11402 -#define BLUE_LOW_BIT_MASK_D(BLUE_LOW_BIT_MASK_D283,11460 -#define GREEN_LOW_BIT_MASK_D(GREEN_LOW_BIT_MASK_D284,11520 -#define RED_HI_BIT_MASK_D(RED_HI_BIT_MASK_D285,11582 -#define BLUE_HI_BIT_MASK_D(BLUE_HI_BIT_MASK_D286,11638 -#define GREEN_HI_BIT_MASK_D(GREEN_HI_BIT_MASK_D287,11696 -#define FIRST_COLOR_MASK_D(FIRST_COLOR_MASK_D288,11756 -#define SECOND_COLOR_MASK_D(SECOND_COLOR_MASK_D289,11816 -#define THIRD_COLOR_MASK_D(THIRD_COLOR_MASK_D290,11877 -#define ALPHA_BITS_MASK_D(ALPHA_BITS_MASK_D291,11937 -#define MAX_RED 293,11997 -#define MAX_BLUE 294,12039 -#define MAX_GREEN 295,12082 -#define RED_LOW_BIT_MASK 296,12127 -#define BLUE_LOW_BIT_MASK 297,12185 -#define GREEN_LOW_BIT_MASK 298,12251 -#define RED_HI_BIT_MASK 299,12318 -#define BLUE_HI_BIT_MASK 300,12382 -#define GREEN_HI_BIT_MASK 301,12447 -#define FIRST_COLOR_MASK 302,12513 -#define SECOND_COLOR_MASK 303,12578 -#define THIRD_COLOR_MASK 304,12644 -#define ALPHA_BITS_MASK 305,12709 -#define GREEN_HI_BIT 307,12774 -#define RGB_LOW_BITS_MASK 308,12821 -#define RGB_HI_BITS_MASK 310,12915 -#define RGB_HI_BITS_MASKx2 312,13006 -#define RGB_REMOVE_LOW_BITS_MASK 314,13107 -#define FIRST_THIRD_COLOR_MASK 315,13161 -#define TWO_LOW_BITS_MASK 316,13230 -#define HIGH_BITS_SHIFTED_TWO_MASK 317,13303 - -port.h,2226 -#define _PORT_H_91,3624 -#define ACCEPT_SIZE_T 105,3824 -#define ACCEPT_SIZE_T 107,3856 -#define GFX_MULTI_FORMAT114,3964 -#define ZLIB119,4053 -#define EXECUTE_SUPERFX_PER_LINE120,4066 -#define SOUND121,4099 -#define VAR_CYCLES122,4113 -#define CPU_SHUTDOWN123,4132 -#define SPC700_SHUTDOWN124,4153 -#define PIXEL_FORMAT 125,4177 -#define CHECK_SOUND(CHECK_SOUND126,4205 -#define M_PI 127,4227 -#define USE_X86_ASM139,4530 -#define snes9x_types_defined143,4587 -typedef unsigned char bool8;bool8145,4617 -typedef unsigned char uint8;uint8149,4745 -typedef unsigned short uint16;uint16150,4774 -typedef signed char int8;int8151,4805 -typedef short int16;int16152,4831 -typedef int int32;int32153,4852 -typedef unsigned int uint32;uint32154,4871 -typedef long long int64;int64158,4979 -typedef unsigned char uint8;uint8165,5081 -typedef unsigned short uint16;uint16166,5110 -typedef signed char int8;int8167,5141 -typedef short int16;int16168,5167 -typedef long int32;int32172,5246 -# define PLAT_SOUND_BUFFER 174,5267 -# define RIGHTSHIFT_IS_SAR175,5308 -typedef unsigned int uint32;uint32178,5346 -typedef __int64 int64;int64182,5404 -#define TRUE 191,5522 -#define FALSE 195,5559 -#define EXTERN_C199,5596 -#define START_EXTERN_C200,5613 -#define END_EXTERN_C201,5636 -#define EXTERN_C 204,5711 -#define START_EXTERN_C 205,5739 -#define END_EXTERN_C 206,5775 -#define EXTERN_C 208,5804 -#define START_EXTERN_C209,5828 -#define END_EXTERN_C210,5851 -#define PATH_MAX 217,5923 -#define _MAX_DIR 220,5953 -#define _MAX_DRIVE 221,5979 -#define _MAX_FNAME 222,6000 -#define _MAX_EXT 223,6028 -#define _MAX_PATH 224,6054 -#define ZeroMemory(ZeroMemory226,6082 -#define strcasecmp 233,6337 -#define strncasecmp 234,6364 -EXTERN_C int soundsignal;240,6450 -#define CHECK_SOUND 243,6559 -#define CHECK_SOUND(CHECK_SOUND245,6667 -#define SLASH_STR 249,6712 -#define SLASH_CHAR 250,6735 -#define SLASH_STR 252,6765 -#define SLASH_CHAR 253,6787 -#define SIG_PF 265,7055 -#define LSB_FIRST270,7205 -#define FAST_LSB_WORD_ACCESS271,7223 -#define MSB_FIRST273,7258 -#define TITLE 277,7297 -#define TITLE 281,7352 -#define TITLE 285,7404 -#define STATIC289,7448 -#define strncasecmp 290,7463 -#define STATIC 292,7498 - -ppu.h,1330 -#define _PPU_H_91,3623 -#define FIRST_VISIBLE_LINE 93,3640 -#define TILE_2BIT 98,3723 -#define TILE_4BIT 99,3743 -#define TILE_8BIT 100,3763 -#define MAX_2BIT_TILES 102,3784 -#define MAX_4BIT_TILES 103,3812 -#define MAX_8BIT_TILES 104,3840 -#define PPU_H_BEAM_IRQ_SOURCE 106,3869 -#define PPU_V_BEAM_IRQ_SOURCE 107,3908 -#define GSU_IRQ_SOURCE 108,3947 -#define SA1_IRQ_SOURCE 109,3980 -#define SA1_DMA_IRQ_SOURCE 110,4013 -struct ClipData ClipData112,4050 -struct InternalPPU InternalPPU118,4146 -struct SOBJSOBJ161,5187 -struct SPPU SPPU173,5350 -#define CLIP_OR 273,7516 -#define CLIP_AND 274,7534 -#define CLIP_XOR 275,7553 -#define CLIP_XNOR 276,7572 -struct SDMA SDMA278,7593 -} SnesModel;SnesModel333,8762 -#define MAX_5C77_VERSION 339,8852 -#define MAX_5C78_VERSION 340,8882 -#define MAX_5A22_VERSION 341,8912 -STATIC inline uint8 REGISTER_4212(343,8943 -STATIC inline void FLUSH_REDRAW 357,9335 -STATIC inline void REGISTER_2104 363,9443 -STATIC inline void REGISTER_2118 450,12342 -STATIC inline void REGISTER_2118_tile 483,13260 -STATIC inline void REGISTER_2118_linear 499,13832 -STATIC inline void REGISTER_2119 511,14242 -STATIC inline void REGISTER_2119_tile 544,15175 -STATIC inline void REGISTER_2119_linear 559,15745 -STATIC inline void REGISTER_2122(571,16160 -STATIC inline void REGISTER_2180(618,17448 - -sa1.h,902 -#define _sa1_h_91,3623 -struct SSA1Registers SSA1Registers95,3661 -struct SSA1 SSA1107,3826 -#define SA1CheckZero(SA1CheckZero146,4745 -#define SA1CheckCarry(SA1CheckCarry147,4785 -#define SA1CheckIRQ(SA1CheckIRQ148,4822 -#define SA1CheckDecimal(SA1CheckDecimal149,4868 -#define SA1CheckIndex(SA1CheckIndex150,4922 -#define SA1CheckMemory(SA1CheckMemory151,4976 -#define SA1CheckOverflow(SA1CheckOverflow152,5032 -#define SA1CheckNegative(SA1CheckNegative153,5075 -#define SA1CheckEmulation(SA1CheckEmulation154,5125 -#define SA1ClearFlags(SA1ClearFlags156,5185 -#define SA1SetFlags(SA1SetFlags157,5237 -#define SA1CheckFlag(SA1CheckFlag158,5289 -#define SNES_IRQ_SOURCE 183,5966 -#define TIMER_IRQ_SOURCE 184,6003 -#define DMA_IRQ_SOURCE 185,6040 -STATIC inline void S9xSA1UnpackStatus(187,6077 -STATIC inline void S9xSA1PackStatus(195,6318 -STATIC inline void S9xSA1FixCycles 202,6541 - -sar.h,185 -#define _SAR_H_91,3623 -#define SAR(SAR104,3792 -static inline int8 SAR(107,3828 -static inline int16 SAR(114,3976 -static inline int32 SAR(121,4128 -static inline int64 SAR(128,4280 - -screenshot.h,29 -#define SCREENSHOT_H91,3628 - -sdd1.h,25 -#define _SDD1_H_91,3624 - -sdd1emu.h,26 -#define SDD1EMU_H90,3624 - -seta.h,378 -#define _seta_h92,3639 -#define ST_010 96,3675 -#define ST_011 97,3695 -#define ST_018 98,3715 -typedef struct SETA_ST010_STRUCTSETA_ST010_STRUCT117,4154 -} ST010_Regs;ST010_Regs124,4294 -typedef struct SETA_ST011_STRUCTSETA_ST011_STRUCT126,4309 -} ST011_Regs;ST011_Regs137,4519 -typedef struct SETA_ST018_STRUCTSETA_ST018_STRUCT139,4534 -} ST018_Regs;ST018_Regs152,4779 - -snaporig.h,597 -#define _SNAPORIG_H_90,3627 -#define ORIG_SNAPSHOT_MAGIC 92,3649 -#define ORIG_SNAPSHOT_VERSION 93,3688 -struct SOrigCPUState{SOrigCPUState97,3781 -struct SOrigAPUSOrigAPU127,4467 -} OrigYAndA;OrigYAndA150,4881 -struct SOrigAPURegisters{SOrigAPURegisters152,4895 -#define ORIG_MAX_BUFFER_SIZE 160,5001 -#define NUM_CHANNELS 161,5041 -} OrigChannel;OrigChannel195,5853 -} SOrigSoundData;SOrigSoundData213,6309 -struct SOrigOBJSOrigOBJ215,6328 -struct SOrigPPU SOrigPPU229,6530 -struct SOrigDMA SOrigDMA332,8740 -} OrigPair;OrigPair364,9323 -struct SOrigRegisters{SOrigRegisters366,9336 - -snapshot.h,293 -#define _SNAPSHOT_H_90,3627 -#define SNAPSHOT_MAGIC 95,3689 -#define SNAPSHOT_VERSION 96,3723 -#define SUCCESS 98,3751 -#define WRONG_FORMAT 99,3769 -#define WRONG_VERSION 100,3795 -#define FILE_NOT_FOUND 101,3822 -#define WRONG_MOVIE_SNAPSHOT 102,3850 -#define NOT_A_MOVIE_SNAPSHOT 103,3884 - -snes9x.h,3003 -#define _SNES9X_H_90,3625 -#define VERSION 92,3645 -#define GFX_MULTI_FORMAT109,3928 -#define ROM_NAME_LEN 112,3961 -#define STREAM 118,4041 -#define READ_STREAM(READ_STREAM119,4063 -#define WRITE_STREAM(WRITE_STREAM120,4105 -#define OPEN_STREAM(OPEN_STREAM121,4149 -#define REOPEN_STREAM(REOPEN_STREAM122,4187 -#define FIND_STREAM(FIND_STREAM123,4228 -#define REVERT_STREAM(REVERT_STREAM124,4261 -#define CLOSE_STREAM(CLOSE_STREAM125,4305 -#define STREAM 127,4347 -#define READ_STREAM(READ_STREAM128,4369 -#define WRITE_STREAM(WRITE_STREAM129,4412 -#define OPEN_STREAM(OPEN_STREAM130,4457 -#define REOPEN_STREAM(REOPEN_STREAM131,4494 -#define FIND_STREAM(FIND_STREAM132,4534 -#define REVERT_STREAM(REVERT_STREAM133,4566 -#define CLOSE_STREAM(CLOSE_STREAM134,4609 -#define SNES_WIDTH 139,4688 -#define SNES_HEIGHT 140,4712 -#define SNES_HEIGHT_EXTENDED 141,4737 -#define IMAGE_WIDTH 142,4770 -#define IMAGE_HEIGHT 143,4845 -#define SNES_MAX_NTSC_VCOUNTER 145,4942 -#define SNES_MAX_PAL_VCOUNTER 146,4978 -#define SNES_HCOUNTER_MAX 147,5014 -#define SPC700_TO_65C816_RATIO 148,5044 -#define AUTO_FRAMERATE 149,5077 -#define SNES_SCANLINE_TIME 163,5582 -#define SNES_CLOCK_SPEED 164,5621 -#define SNES_CLOCK_LEN 166,5657 -#define SNES_CYCLES_PER_SCANLINE 168,5706 -#define SNES_APUTIMER2_CYCLEx10000 170,5801 -#define ONE_CYCLE 172,5931 -#define SLOW_ONE_CYCLE 173,5951 -#define TWO_CYCLES 174,5976 -#define SNES_TR_MASK 177,6000 -#define SNES_TL_MASK 178,6034 -#define SNES_X_MASK 179,6068 -#define SNES_A_MASK 180,6101 -#define SNES_RIGHT_MASK 181,6134 -#define SNES_LEFT_MASK 182,6171 -#define SNES_DOWN_MASK 183,6207 -#define SNES_UP_MASK 184,6244 -#define SNES_START_MASK 185,6279 -#define SNES_SELECT_MASK 186,6317 -#define SNES_Y_MASK 187,6355 -#define SNES_B_MASK 188,6389 - SNES_MULTIPLAYER5,191,6431 - SNES_JOYPAD,192,6454 - SNES_MOUSE_SWAPPED,193,6471 - SNES_MOUSE,194,6495 - SNES_SUPERSCOPE,195,6511 - SNES_JUSTIFIER,196,6532 - SNES_JUSTIFIER_2,197,6549 - SNES_MAX_CONTROLLER_OPTIONS198,6568 -#define DEBUG_MODE_FLAG 201,6604 -#define TRACE_FLAG 202,6641 -#define SINGLE_STEP_FLAG 203,6671 -#define BREAK_FLAG 204,6708 -#define SCAN_KEYS_FLAG 205,6738 -#define SAVE_SNAPSHOT_FLAG 206,6774 -#define DELAYED_NMI_FLAG 207,6811 -#define NMI_FLAG 208,6848 -#define PROCESS_SOUND_FLAG 209,6876 -#define FRAME_ADVANCE_FLAG 210,6913 -#define DELAYED_NMI_FLAG2 211,6950 -#define IRQ_PENDING_FLAG 212,6988 -struct SCPUState{SCPUState214,7027 -#define HBLANK_START_EVENT 245,7719 -#define HBLANK_END_EVENT 246,7748 -#define HTIMER_BEFORE_EVENT 247,7775 -#define HTIMER_AFTER_EVENT 248,7805 -#define NO_EVENT 249,7834 -struct SSettings{SSettings251,7854 -struct SSNESGameFixesSSNESGameFixes395,11244 - PAUSE_NETPLAY_CONNECT 417,11722 - PAUSE_TOGGLE_FULL_SCREEN 418,11760 - PAUSE_EXIT 419,11801 - PAUSE_MENU 420,11828 - PAUSE_INACTIVE_WINDOW 421,11855 - PAUSE_WINDOW_ICONISED 422,11893 - PAUSE_RESTORE_GUI 423,11931 - PAUSE_FREEZE_FILE 424,11965 - -soundux.h,1791 -#define _SOUND_H_90,3624 -enum { SOUND_SAMPLE 92,3643 -enum { SOUND_SAMPLE = 0, SOUND_NOISE,92,3643 -enum { SOUND_SAMPLE = 0, SOUND_NOISE, SOUND_EXTRA_NOISE,92,3643 -enum { SOUND_SAMPLE = 0, SOUND_NOISE, SOUND_EXTRA_NOISE, SOUND_MUTE 92,3643 -enum { SOUND_SILENT,93,3714 -enum { SOUND_SILENT, SOUND_ATTACK,93,3714 -enum { SOUND_SILENT, SOUND_ATTACK, SOUND_DECAY,93,3714 -enum { SOUND_SILENT, SOUND_ATTACK, SOUND_DECAY, SOUND_SUSTAIN,93,3714 - SOUND_RELEASE,94,3777 - SOUND_RELEASE, SOUND_GAIN,94,3777 - SOUND_RELEASE, SOUND_GAIN, SOUND_INCREASE_LINEAR,94,3777 - SOUND_INCREASE_BENT_LINE,95,3834 - SOUND_INCREASE_BENT_LINE, SOUND_DECREASE_LINEAR,95,3834 - SOUND_DECREASE_EXPONENTIAL}96,3890 -enum { MODE_NONE 98,3927 -enum { MODE_NONE = SOUND_SILENT,98,3927 -enum { MODE_NONE = SOUND_SILENT, MODE_ADSR,98,3927 -enum { MODE_NONE = SOUND_SILENT, MODE_ADSR, MODE_RELEASE 98,3927 -enum { MODE_NONE = SOUND_SILENT, MODE_ADSR, MODE_RELEASE = SOUND_RELEASE,98,3927 - MODE_GAIN,99,4001 - MODE_GAIN, MODE_INCREASE_LINEAR,99,4001 - MODE_GAIN, MODE_INCREASE_LINEAR, MODE_INCREASE_BENT_LINE,99,4001 - MODE_DECREASE_LINEAR,100,4066 - MODE_DECREASE_LINEAR, MODE_DECREASE_EXPONENTIAL}100,4066 -#define MAX_ENVELOPE_HEIGHT 102,4124 -#define ENVELOPE_SHIFT 103,4156 -#define MAX_VOLUME 104,4181 -#define VOLUME_SHIFT 105,4204 -#define VOL_DIV 106,4227 -#define SOUND_DECODE_LENGTH 107,4247 -#define NUM_CHANNELS 109,4279 -#define SOUND_BUFFER_SIZE 110,4305 -#define MAX_BUFFER_SIZE 111,4343 -#define SOUND_BUFFER_SIZE_MASK 112,4385 -#define SOUND_BUFS 114,4441 -} SoundStatus;SoundStatus140,4916 -EXTERN_C volatile SoundStatus so;142,4932 -} Channel;Channel183,5966 -} SSoundData;SSoundData205,6508 -EXTERN_C SSoundData SoundData;207,6523 - -spc700.h,1770 -#define _SPC700_H_90,3625 -#define NO_CHANNEL_STRUCT93,3660 -#define Carry 99,3777 -#define Zero 100,3799 -#define Interrupt 101,3821 -#define HalfCarry 102,3843 -#define BreakFlag 103,3865 -#define DirectPageFlag 104,3887 -#define Overflow 105,3913 -#define Negative 106,3935 -#define APUClearCarry(APUClearCarry108,3958 -#define APUSetCarry(APUSetCarry109,4000 -#define APUSetInterrupt(APUSetInterrupt110,4040 -#define APUClearInterrupt(APUClearInterrupt111,4096 -#define APUSetHalfCarry(APUSetHalfCarry112,4155 -#define APUClearHalfCarry(APUClearHalfCarry113,4211 -#define APUSetBreak(APUSetBreak114,4270 -#define APUClearBreak(APUClearBreak115,4322 -#define APUSetDirectPage(APUSetDirectPage116,4377 -#define APUClearDirectPage(APUClearDirectPage117,4439 -#define APUSetOverflow(APUSetOverflow118,4504 -#define APUClearOverflow(APUClearOverflow119,4550 -#define APUCheckZero(APUCheckZero121,4599 -#define APUCheckCarry(APUCheckCarry122,4640 -#define APUCheckInterrupt(APUCheckInterrupt123,4678 -#define APUCheckHalfCarry(APUCheckHalfCarry124,4735 -#define APUCheckBreak(APUCheckBreak125,4792 -#define APUCheckDirectPage(APUCheckDirectPage126,4845 -#define APUCheckOverflow(APUCheckOverflow127,4908 -#define APUCheckNegative(APUCheckNegative128,4952 -#define APUClearFlags(APUClearFlags130,5000 -#define APUSetFlags(APUSetFlags131,5050 -#define APUCheckFlag(APUCheckFlag132,5100 -} YAndA;YAndA142,5271 -struct SAPURegisters{SAPURegisters144,5281 -EXTERN_C struct SAPURegisters APURegisters;152,5379 -#define ONE_APU_CYCLE 156,5481 -#define ONE_APU_CYCLE_HUMAN 160,5608 -#define APU_EXECUTE(APU_EXECUTE167,5715 -#define APU_EXECUTE1(APU_EXECUTE1180,5909 -#define APU_EXECUTE1(APU_EXECUTE1188,6080 -#define APU_EXECUTE(APU_EXECUTE195,6201 - -spc7110.h,223 -#define _spc7110_h90,3625 -#define DECOMP_BUFFER_SIZE 93,3663 -typedef struct SPC7110RTCSPC7110RTC123,4428 -} S7RTC;S7RTC130,4541 -typedef struct SPC7110EmuVarsSPC7110EmuVars132,4551 -} SPC7110Regs;SPC7110Regs187,5818 - -srtc.h,314 -#define _srtc_h_90,3623 -#define MAX_RTC_INDEX 94,3660 -#define MODE_READ 96,3693 -#define MODE_LOAD_RTC 97,3723 -#define MODE_COMMAND 98,3753 -#define MODE_COMMAND_DONE 99,3783 -#define COMMAND_LOAD_RTC 101,3814 -#define COMMAND_CLEAR_RTC 102,3844 -} SRTC_DATA;SRTC_DATA142,4710 -#define SRTC_SRAM_PAD 154,4976 - -tile.h,1326 -#define _TILE_H_90,3623 -#define TILE_AssignPixel(TILE_AssignPixel92,3641 -#define TILE_SetPixel(TILE_SetPixel94,3712 -#define TILE_SetPixel16(TILE_SetPixel1695,3801 -#define TILE_AddPixel16(TILE_AddPixel1697,3883 -#define TILE_AddFPixel16(TILE_AddFPixel1698,4000 -#define TILE_AddPixel16Half(TILE_AddPixel16Half99,4113 -#define TILE_AddFPixel16Half(TILE_AddFPixel16Half100,4241 -#define TILE_SubPixel16(TILE_SubPixel16102,4366 -#define TILE_SubFPixel16(TILE_SubFPixel16103,4483 -#define TILE_SubPixel16Half(TILE_SubPixel16Half104,4596 -#define TILE_SubFPixel16Half(TILE_SubFPixel16Half105,4724 -#define TILE_Select3(TILE_Select3107,4849 -#define TILE_Select2(TILE_Select2115,5096 -#define TILE_SelectAddPixel16(TILE_SelectAddPixel16122,5281 -#define TILE_SelectAddPixel16Half(TILE_SelectAddPixel16Half123,5372 -#define TILE_SelectSubPixel16(TILE_SelectSubPixel16124,5467 -#define TILE_SelectSubPixel16Half(TILE_SelectSubPixel16Half125,5558 -#define TILE_SelectFAddPixel16Half(TILE_SelectFAddPixel16Half127,5654 -#define TILE_SelectFSubPixel16Half(TILE_SelectFSubPixel16Half128,5738 -#define TILE_PREAMBLE 132,5846 -#define RENDER_TILE(RENDER_TILE160,6686 -#define TILE_CLIP_PREAMBLE 208,7810 -#define RENDER_CLIPPED_TILE(RENDER_CLIPPED_TILE235,8278 -#define RENDER_TILE_LARGE(RENDER_TILE_LARGE287,9666 - -unix/config.c,1218 -#define MIN(MIN120,4464 -typedef struct CONFIG_ENTRYCONFIG_ENTRY123,4513 -} CONFIG_ENTRY;CONFIG_ENTRY128,4728 -typedef struct CONFIGCONFIG131,4746 -} CONFIG;CONFIG136,4975 -#define MAX_CONFIGS 139,4987 -static CONFIG *config[141,5014 -static CONFIG *config_override 142,5079 -char *get_filename(146,5179 -long file_size 158,5397 -static void destroy_config(179,5714 -static void config_cleanup(239,6677 -static void init_config(265,7224 -static int get_line(326,8570 -static void set_config(387,9808 -static void load_config_file(441,10881 -void set_config_file(466,11428 -void set_config_data(477,11633 -void override_config_file(487,11835 -void override_config_data(498,12056 -void push_config_state(508,12244 -void pop_config_state(526,12525 -static void prettify_section_name(544,12820 -static CONFIG_ENTRY *find_config_string(566,13163 -char *get_config_string(608,13972 -int get_config_int(630,14373 -int get_config_hex(645,14642 -float get_config_float(665,15005 -char **get_config_argv(680,15278 - #define MAX_ARGV 682,15341 -static CONFIG_ENTRY *insert_variable(723,16028 -void set_config_string(758,16653 -void set_config_int(839,18330 -void set_config_hex(851,18563 -void set_config_float(867,18871 - -unix/aido.h,25 -#define _AIDO_H_90,3623 - -unix/snes9x_gui.h,64 -#define SNES9X_GUI_H90,3627 -class Snes9xGUI:Snes9xGUI97,3710 - -unix/x11.h,52 -#define _x11_h_90,3622 -} GUIData;GUIData159,5023 - -unzip/explode.c,831 -# define WSIZE 75,4017 -struct huft huft80,4174 -UWORD cplen2[124,6002 -UWORD cplen3[128,6293 -UWORD extra[132,6585 -UWORD cpdist4[136,6819 -UWORD cpdist8[142,7244 -#define NEXTBYTE 164,8115 -#define NEEDBITS(NEEDBITS165,8165 -#define DUMPBITS(DUMPBITS166,8231 -UWORD mask_bits[169,8281 -union work area;174,8453 -ULONG crc32val;175,8528 -ush bytebuf;176,8544 -ULONG bitbuf;177,8557 -int bits_left;178,8571 -boolean zipeof;179,8586 -int get_tree(181,8603 -int explode_lit8(213,9668 -int explode_lit4(335,13397 -int explode_nolit8(457,17125 -int explode_nolit4(570,20510 -int explode 683,23894 -int ReadByte(811,27677 -#define BMAX 852,28918 -#define N_MAX 853,28996 -unsigned hufts;855,29062 -int huft_build(858,29113 -int huft_free(1051,36013 -void flush(1071,36459 -void flush_stack(1084,36935 -int FillBitBuffer(1101,37511 - -unzip/unreduce.c,300 -#define DLE 20,607 -typedef byte f_array[f_array22,627 - f_array *followers;35,1000 - f_array *followers 37,1057 -byte Slen[40,1119 -int factor;41,1135 -int L_table[43,1148 -int D_shift[46,1194 -int D_mask[48,1239 -int B_table[51,1284 -void unReduce(76,2174 -static void LoadFollowers(206,5624 - -unzip/unshrink.c,309 -#define INIT_BITS 19,508 -#define FIRST_ENT 20,534 -#define CLEAR 21,562 -#define GetCode(GetCode22,590 -int codesize,26,669 -int codesize, maxcode,26,669 -int codesize, maxcode, maxcodemax,26,669 -int codesize, maxcode, maxcodemax, free_ent;26,669 -void unShrink(35,803 -static void partial_clear(151,3535 - -unzip/unzip.c,1011 -const char unz_copyright[26,390 -unzlocal_getByte 42,787 -unzlocal_getShort 65,1209 -unzlocal_getLong 86,1552 -strcmpcasenosensitive_internal 117,2103 -#define CASESENSITIVITYDEFAULTVALUE 140,2567 -#define CASESENSITIVITYDEFAULTVALUE 142,2611 -#define STRCMPCASENOSENTIVEFUNCTION 146,2693 -unzStringFileNameCompare 158,3124 -#define BUFREADCOMMENT 169,3438 -unzlocal_SearchCentralDir 176,3583 -unzOpen 238,5233 -unzClose 341,8055 -unzGetGlobalInfo 363,8482 -unzlocal_DosDateToTmuDate 378,8783 - local int unzlocal_GetCurrentFileInfoInternal 406,9645 -unzGetCurrentFileInfo 566,14262 -unzGoToFirstFile 587,14860 -unzGoToNextFile 610,15500 -unzLocateFile 642,16466 -unzlocal_CheckCurrentFileCoherencyHeader 695,17781 -unzOpenCurrentFile 786,20472 -file_in_zip_read_info_s *pfile_in_zip_read_info 898,24010 -unz_s *pUnzip 899,24066 -unzReadCurrentFile 901,24108 -unztell 1056,28648 -unzeof 1076,29086 -unzGetLocalExtrafield 1108,29971 -unzCloseCurrentFile 1156,31173 -unzGetGlobalComment 1196,32231 - -unzip/unz.h,8414 -# define UNIX25,827 -# define __TURBOC__33,1066 -# define MSDOS34,1087 -# define MSDOS37,1192 -# define PROTO46,1520 -# define MODERN48,1547 -# define PROTO52,1655 -# define MODERN54,1682 -# define PROTO58,1779 -# define MODERN60,1806 -# define BSD70,2074 -# define TERMIO76,2264 -# define ZMEM82,2393 -# define NO_PARAM_H99,2914 -# define DECLARE_ERRNO 116,3313 - typedef size_t extent;extent140,4236 - typedef unsigned int extent;extent145,4349 -# define void 146,4381 -# define BSIZE 174,5244 -# define BSIZE 176,5294 -# define NO_MKDIR 182,5461 -# define BSIZE 195,5764 -# define strchr 199,5876 -# define strrchr 200,5902 -# define DOS_OS2208,6155 -# define MSC 217,6805 -# define DOS_OS2224,7103 -# define S_IFMT 225,7121 -# define timezone 226,7145 -# define DOS_OS2230,7201 -# define __32BIT__231,7219 -# define far236,7309 -# define DOS_OS2240,7346 -# define __32BIT__241,7364 -# define far242,7384 -# define DOS_OS2 246,7500 -# define isupper(isupper264,8274 -# define tolower(tolower265,8328 -# define DOS_OS2279,8690 -# define getch(getch280,8710 -# define _MAX_PATH 292,9127 -# define UNIX 293,9193 -# define RETURN 294,9273 -# define RETURN 297,9388 -# define RETURN(RETURN299,9456 -# define O_RDONLY 309,9817 -# define O_WRONLY 310,9841 -# define O_RDWR 311,9865 -# define SHORT_NAMES320,10162 -# define tzset 321,10190 -# define DOS_VMS330,10453 -# define MACOS338,10694 -# define __STDC__ 340,10785 -# define __STDC__ 344,11036 -# define MACOS350,11201 -# define CtoPstr 356,11332 -# define PtoCstr 357,11357 -# define open(open364,11449 -# define close 365,11502 -# define read 366,11527 -# define write 367,11550 -# define lseek 368,11575 -# define creat(creat369,11600 -# define stat(stat370,11676 -# define isascii(isascii373,11747 -typedef struct _ZipExtraHdr _ZipExtraHdr378,11833 -} ZIP_EXTRA_HEADER;ZIP_EXTRA_HEADER381,11957 -typedef struct _MacInfoMin _MacInfoMin383,11978 -} MACINFOMIN;MACINFOMIN393,12430 -typedef struct _MacInfo _MacInfo395,12495 -} MACINFO;MACINFO406,12991 -# define extract_or_test_files 418,13373 -# define extract_or_test_member 419,13425 -# define mkdir(mkdir424,13565 -# define EBCDIC 425,13631 -# define WSIZE 437,13766 -#define DIR_BLKSIZ 440,13917 -# define INBUFSIZ 443,14076 -# define FILNAMSIZ 456,14420 -# define FILNAMSIZ 458,14481 -# define PATH_MAX 463,14633 -# define PATH_MAX 466,14754 -# define PATH_MAX 468,14803 -#define OUTBUFSIZ 473,14907 -#define ZSUFX 475,14943 -#define CENTRAL_HDR_SIG 476,14976 -#define LOCAL_HDR_SIG 477,15053 -#define END_CENTRAL_SIG 478,15129 -#define EXTD_LOCAL_SIG 479,15207 -#define SKIP 481,15274 -#define DISPLAY 482,15348 -#define FILENAME 483,15376 -#define EXTRA_FIELD 484,15404 -#define DOES_NOT_EXIST 486,15433 -#define EXISTS_AND_OLDER 487,15506 -#define EXISTS_AND_NEWER 488,15534 -#define DOS_OS2_FAT_ 490,15563 -#define AMIGA_ 491,15636 -#define VMS_ 492,15664 -#define UNIX_ 493,15736 -#define VM_CMS_ 494,15811 -#define ATARI_ 495,15887 -#define OS2_HPFS_ 496,15936 -#define MAC_ 497,15964 -#define Z_SYSTEM_ 498,15992 -#define CPM_ 499,16020 -#define NUM_HOSTS 501,16121 -#define STORED 503,16184 -#define SHRUNK 504,16241 -#define REDUCED1 505,16269 -#define REDUCED2 506,16297 -#define REDUCED3 507,16325 -#define REDUCED4 508,16353 -#define IMPLODED 509,16381 -#define TOKENIZED 510,16409 -#define DEFLATED 511,16437 -#define NUM_METHODS 512,16465 -#define DF_MDY 515,16607 -#define DF_DMY 516,16676 -#define DF_YMD 517,16754 -#define UNZIP_VERSION 519,16831 -#define VMS_VERSION 520,16896 -#define LREC_SIZE 527,17344 -#define CREC_SIZE 528,17417 -#define ECREC_SIZE 529,17490 -#define MAX_BITS 531,17564 -#define HSIZE 532,17630 -#define LF 534,17703 -#define CR 535,17781 -#define CTRLZ 536,17859 -# define ascii_to_native(ascii_to_native539,17951 -# define NATIVE 540,17994 -# define FFLUSH 544,18039 -# define FFLUSH 546,18095 -# define ENV_UNZIP 550,18161 -# define ENV_ZIPINFO 551,18238 -# define ENV_UNZIP 553,18294 -# define ENV_ZIPINFO 554,18326 -# define PWLEN 558,18392 -# define DECRYPT(DECRYPT559,18419 -# define QCOND 563,18542 -# define QCOND 565,18669 -# define TRUE 569,18769 -# define FALSE 572,18836 -# define SEEK_SET 576,18944 -# define SEEK_CUR 577,19022 -# define SEEK_END 578,19044 -# define S_IRWXU 582,19090 -# define S_IRUSR 583,19160 -# define S_IWUSR 584,19225 -# define S_IXUSR 585,19291 -# define S_IRWXG 586,19359 -# define S_IRGRP 587,19429 -# define S_IWGRP 588,19494 -# define S_IXGRP 589,19560 -# define S_IRWXO 590,19628 -# define S_IROTH 591,19698 -# define S_IWOTH 592,19763 -# define S_IXOTH 593,19829 -# define S_IFBLK 598,20069 -# define S_IFIFO 601,20183 -# define S_IFLNK 604,20283 -# define S_IFSOCK 607,20393 -# define S_ISUID 610,20471 -# define S_ISGID 613,20567 -# define S_ISVTX 616,20664 -# define S_ENFMT 619,20765 - typedef unsigned char byte;byte632,21008 -typedef char boolean;boolean635,21106 -typedef long longint;longint636,21141 -typedef unsigned short UWORD;UWORD637,21176 -typedef unsigned long ULONG;ULONG638,21209 -typedef unsigned char uch;uch639,21242 -typedef unsigned short ush;ush640,21273 -typedef unsigned long ulg;ulg641,21304 -typedef struct min_info min_info643,21336 -} min_info;min_info654,21872 -typedef struct VMStimbuf VMStimbuf656,21885 -} VMStimbuf;VMStimbuf659,22009 - typedef byte local_byte_hdr[local_byte_hdr666,22309 -# define L_VERSION_NEEDED_TO_EXTRACT_0 667,22356 -# define L_VERSION_NEEDED_TO_EXTRACT_1 668,22406 -# define L_GENERAL_PURPOSE_BIT_FLAG 669,22456 -# define L_COMPRESSION_METHOD 670,22506 -# define L_LAST_MOD_FILE_TIME 671,22556 -# define L_LAST_MOD_FILE_DATE 672,22606 -# define L_CRC32 673,22656 -# define L_COMPRESSED_SIZE 674,22707 -# define L_UNCOMPRESSED_SIZE 675,22758 -# define L_FILENAME_LENGTH 676,22809 -# define L_EXTRA_FIELD_LENGTH 677,22860 - typedef byte cdir_byte_hdr[cdir_byte_hdr679,22912 -# define C_VERSION_MADE_BY_0 680,22958 -# define C_VERSION_MADE_BY_1 681,23008 -# define C_VERSION_NEEDED_TO_EXTRACT_0 682,23058 -# define C_VERSION_NEEDED_TO_EXTRACT_1 683,23108 -# define C_GENERAL_PURPOSE_BIT_FLAG 684,23158 -# define C_COMPRESSION_METHOD 685,23208 -# define C_LAST_MOD_FILE_TIME 686,23258 -# define C_LAST_MOD_FILE_DATE 687,23308 -# define C_CRC32 688,23359 -# define C_COMPRESSED_SIZE 689,23410 -# define C_UNCOMPRESSED_SIZE 690,23461 -# define C_FILENAME_LENGTH 691,23512 -# define C_EXTRA_FIELD_LENGTH 692,23563 -# define C_FILE_COMMENT_LENGTH 693,23614 -# define C_DISK_NUMBER_START 694,23665 -# define C_INTERNAL_FILE_ATTRIBUTES 695,23716 -# define C_EXTERNAL_FILE_ATTRIBUTES 696,23767 -# define C_RELATIVE_OFFSET_LOCAL_HEADER 697,23818 - typedef byte ec_byte_rec[ec_byte_rec699,23870 -# define NUMBER_THIS_DISK 701,23990 -# define NUM_DISK_WITH_START_CENTRAL_DIR 702,24040 -# define NUM_ENTRIES_CENTRL_DIR_THS_DISK 703,24090 -# define TOTAL_ENTRIES_CENTRAL_DIR 704,24140 -# define SIZE_CENTRAL_DIRECTORY 705,24191 -# define OFFSET_START_CENTRAL_DIRECTORY 706,24242 -# define ZIPFILE_COMMENT_LENGTH 707,24293 - typedef struct local_file_header local_file_header710,24346 - } local_file_hdr;local_file_hdr721,24737 - typedef struct central_directory_file_header central_directory_file_header723,24759 - } cdir_file_hdr;cdir_file_hdr740,25371 - typedef struct end_central_dir_record end_central_dir_record742,25392 - } ecdir_rec;ecdir_rec750,25746 -# define __ 761,25863 -# define MAX(MAX784,26512 -# define MIN(MIN788,26577 -#define LSEEK(LSEEK792,26631 -#define SKIP_(SKIP_834,28430 -#define READBIT(READBIT853,28971 -#define PEEKBIT(PEEKBIT869,29345 -#define NUKE_CRs(NUKE_CRs873,29479 -#define TOLOWER(TOLOWER896,30178 -# define ascii_to_native(ascii_to_native927,31296 -# define A_TO_N(A_TO_N928,31331 -# define NATIVE 931,31377 -# define A_TO_N(A_TO_N933,31424 - union work work964,32485 - union work work973,32665 -# define prefix_of 984,33002 -# define suffix_of 985,33044 -# define stack 986,33086 -# define slide 987,33120 - -unzip/unzip.h,1007 -#define _unz_H42,1738 -typedef struct TagunzFile__ TagunzFile__55,1995 -typedef struct TagunzFile__ { int unused; } unzFile__;unzFile__55,1995 -typedef unzFile__ *unzFile;unzFile56,2051 -typedef voidp unzFile;unzFile58,2085 -#define UNZ_OK 62,2117 -#define UNZ_END_OF_LIST_OF_FILE 63,2169 -#define UNZ_ERRNO 64,2208 -#define UNZ_EOF 65,2250 -#define UNZ_PARAMERROR 66,2286 -#define UNZ_BADZIPFILE 67,2333 -#define UNZ_INTERNALERROR 68,2380 -#define UNZ_CRCERROR 69,2427 -#define UNZ_STORED 71,2475 -#define UNZ_SHRUNK 72,2536 -#define UNZ_REDUCED1 73,2568 -#define UNZ_REDUCED2 74,2600 -#define UNZ_REDUCED3 75,2632 -#define UNZ_REDUCED4 76,2664 -#define UNZ_IMPLODED 77,2696 -#define UNZ_TOKENIZED 78,2728 -#define UNZ_DEFLATED 79,2760 -typedef struct tm_unz_s tm_unz_s82,2829 -} tm_unz;tm_unz90,3215 -typedef struct unz_global_info_sunz_global_info_s94,3344 -} unz_global_info;unz_global_info99,3558 -typedef struct unz_file_info_sunz_file_info_s103,3647 -} unz_file_info;unz_file_info122,4797 - -unzip/unzipP.h,609 -#define _UNZIPP_H_2,19 -#define local 7,73 -#define CASESENSITIVITYDEFAULT_NO15,296 -#define UNZ_BUFSIZE 20,359 -#define UNZ_MAXFILENAMEINZIP 24,424 -#define ALLOC(ALLOC28,481 -#define TRYFREE(TRYFREE31,539 -#define SIZECENTRALDIRITEM 34,584 -#define SIZEZIPLOCALHEADER 35,618 -#define SEEK_CUR 41,751 -#define SEEK_END 45,798 -#define SEEK_SET 49,845 -typedef struct unz_file_info_internal_sunz_file_info_internal_s53,951 -} unz_file_info_internal;unz_file_info_internal57,1083 -} file_in_zip_read_info_s;file_in_zip_read_info_s91,2450 -} unz_s;unz_s122,3668 - -jma/7zlzma.cpp,32 -bool decompress_lzma_7z(23,812 - -jma/crc32.cpp,81 -namespace CRC32libCRC32lib22,746 - unsigned int CRC32(CRC32lib::CRC3272,4053 - -jma/iiostrm.cpp,87 -HRESULT ISequentialInStream::Read(23,875 -HRESULT ISequentialOutStream::Write(33,1101 - -jma/inbyte.cpp,173 -namespace NStream{NStream22,852 -CInByte::CInByte(NStream::CInByte::CInByte24,872 -CInByte::~CInByte(31,1003 -void CInByte::Init(36,1053 -bool CInByte::ReadBlock(45,1239 - -jma/jma.cpp,589 -namespace JMAJMA100,3792 - time_t uint_to_time(JMA::uint_to_time109,4144 - void jma_open::retrieve_file_block(JMA::jma_open::retrieve_file_block125,4629 - jma_open::jma_open(JMA::jma_open::jma_open209,7357 - jma_open::~jma_open(JMA::jma_open::~jma_open242,8197 - vector jma_open::get_files_info(JMA::jma_open::get_files_info251,8350 - void jma_open::chunk_seek(JMA::jma_open::chunk_seek270,8923 - vector jma_open::get_all_files(JMA::jma_open::get_all_files295,9583 - void jma_open::extract_file(JMA::jma_open::extract_file414,13399 - -jma/lzma.cpp,224 -namespace NCompress NCompress22,850 -namespace NLZMA NCompress::NLZMA23,872 -static class CConstInitNCompress::NLZMA::CConstInit27,930 - CConstInit(NCompress::NLZMA::CConstInit::CConstInit30,964 -} g_ConstInit;40,1165 - -jma/lzmadec.cpp,556 -#define RETURN_E_OUTOFMEMORY_IF_FALSE(RETURN_E_OUTOFMEMORY_IF_FALSE24,932 -namespace NCompress NCompress26,1010 -namespace NLZMA NCompress::NLZMA27,1032 -HRESULT CDecoder::SetDictionarySize(NCompress::NLZMA::CDecoder::SetDictionarySize29,1051 -HRESULT CDecoder::SetLiteralProperties(44,1448 -HRESULT CDecoder::SetPosBitsProperties(55,1752 -CDecoder::CDecoder(66,2087 -HRESULT CDecoder::Create(72,2157 -HRESULT CDecoder::Init(83,2365 -HRESULT CDecoder::CodeReal(122,3225 -HRESULT CDecoder::Code(255,7814 -HRESULT CDecoder::ReadCoderProperties(266,8117 - -jma/s9x-jma.cpp,31 -size_t load_jma_file(100,3896 - -jma/winout.cpp,281 -namespace NStream NStream22,852 -namespace NWindow NStream::NWindow23,872 -void COut::Create(NStream::NWindow::COut::Create25,893 -COut::~COut(40,1381 -void COut::SetWindowSize(45,1421 -void COut::Init(51,1567 -HRESULT COut::Flush(65,1798 -void COut::MoveBlockBackward(80,2138 - -jma/7z.h,54 -#define __7Z_H21,845 -bool decompress_lzma_7z(23,861 - -jma/aribitcd.h,217 -#define __COMPRESSION_BITCODER_H2,33 -class CBitModelCBitModel18,349 - void UpdateModel(UpdateModel22,399 - void Init(Init34,802 -class CBitDecoder:CBitDecoder38,888 - UINT32 Decode(CBitDecoder::Decode41,948 - -jma/ariconst.h,187 -#define __ARICONST_H21,852 -typedef NCompression::NArithmetic::CRangeDecoder CMyRangeDecoder;CMyRangeDecoder26,898 -template class CMyBitDecoder:CMyBitDecoder27,964 - -jma/ariprice.h,38 -#define __COMPRESSION_ARIPRICE_H2,33 - -jma/btreecd.h,804 -#define __BITTREECODER_H21,856 -template CMyBitDecoder2;CMyBitDecoder231,1022 -class CDecoderCDecoder33,1088 - HRESULT Flush(Flush65,2284 - -jma/portable.h,1046 -#define __PORTABLE_H22,852 -typedef signed char INT8;INT826,895 -typedef unsigned char UINT8;UINT827,921 -typedef short INT16;INT1628,950 -typedef unsigned short UINT16;UINT1629,971 -typedef long INT32;INT3230,1002 -typedef unsigned long UINT32;UINT3231,1022 -typedef INT32 INT64;INT6432,1052 -typedef UINT32 UINT64;UINT6433,1073 -typedef UINT8 BYTE;BYTE36,1098 -typedef UINT16 WORD;WORD37,1118 -typedef UINT32 DWORD;DWORD38,1139 -typedef unsigned UINT_PTR;UINT_PTR40,1162 -typedef int BOOL;BOOL42,1190 -#define FALSE 43,1208 -#define TRUE 44,1224 -#define HRESULT 46,1240 -#define S_OK 47,1260 -#define E_INVALIDARG 48,1275 -#define E_OUTOFMEMORY 49,1299 -#define E_FAIL 50,1324 -#define E_INTERNAL_ERROR 51,1342 -#define E_INVALIDDATA 52,1370 -template inline T MyMin(54,1396 -template inline T MyMax(58,1468 -#define RETURN_IF_NOT_S_OK(RETURN_IF_NOT_S_OK62,1540 -#define UINT_SIZE 65,1644 -#define USHORT_SIZE 66,1666 -inline unsigned int charp_to_uint(69,1742 -inline unsigned short charp_to_ushort(79,2062 - -jma/rcdefs.h,190 -#define __RCDEFS_H21,850 -#define RC_INIT_VAR 26,915 -#define RC_FLUSH_VAR 30,1062 -#define RC_NORMALIZE 34,1192 -#define RC_GETBIT2(RC_GETBIT240,1482 -#define RC_GETBIT(RC_GETBIT59,2732 - -jma/rngcoder.h,364 -#define __COMPRESSION_RANGECODER_H21,866 -class CRangeDecoderCRangeDecoder31,1050 - void Normalize(Normalize38,1161 - void Init(Init47,1308 - UINT32 GetThreshold(GetThreshold56,1512 - void Decode(Decode61,1602 - UINT32 DecodeDirectBits(DecodeDirectBits88,2267 - UINT32 DecodeBit(DecodeBit120,2976 - UINT64 GetProcessedSize(GetProcessedSize139,3339 - -jma/s9x-jma.h,0 - -jma/winout.h,345 -#define __STREAM_WINDOWOUT_H21,860 -class COutCOut33,1222 - COut(COut50,1518 - UINT32 GetCurPos(GetCurPos59,1807 - const BYTE *GetPointerToCurrentPos(GetPointerToCurrentPos60,1852 - void CopyBackBlock(CopyBackBlock62,1927 - void PutOneByte(PutOneByte73,2182 - BYTE GetOneByte(GetOneByte80,2310 - BYTE *GetBuffer(GetBuffer85,2397 + +dsp1emu.c,7108 +#define __OPT__36,1055 +#define __OPT06__37,1071 +FILE * LogFile 41,1108 +void Log_Message 43,1132 +void Start_Log 57,1361 +void Stop_Log 67,1518 +const unsigned short DSP1ROM[78,1621 +#define INCR 212,10344 +#define Angle(Angle213,10362 +#define Cos(Cos214,10411 +#define Sin(Sin215,10450 +#define PI 219,10516 +double CosTable2[220,10561 +double SinTable2[221,10585 +double Atan(224,10611 +short C4WFXVal;237,10976 +short C4WFYVal;238,10992 +short C4WFZVal;239,11008 +short C4WFX2Val;240,11024 +short C4WFY2Val;241,11041 +short C4WFDist;242,11058 +short C4WFScale;243,11074 +double tanval;244,11091 +double c4x,245,11106 +double c4x,c4y,245,11106 +double c4x,c4y,c4z;245,11106 +double c4x2,246,11126 +double c4x2,c4y2,246,11126 +double c4x2,c4y2,c4z2;246,11126 +void C4TransfWireFrame(248,11150 +void C4TransfWireFrame2(274,11787 +void C4CalcWireFrame(300,12386 +short C41FXVal;320,12841 +short C41FYVal;321,12857 +short C41FAngleRes;322,12873 +short C41FDist;323,12893 +short C41FDistVal;324,12909 +void C4Op1F(326,12929 +void C4Op15(341,13258 +void C4Op0D(348,13400 +void InitDSP(362,13899 +short Op00Multiplicand;377,14130 +short Op00Multiplier;378,14154 +short Op00Result;379,14176 +void DSPOp00(381,14195 +short Op20Multiplicand;390,14392 +short Op20Multiplier;391,14416 +short Op20Result;392,14438 +void DSPOp20(394,14457 +signed short Op10Coefficient;404,14671 +signed short Op10Exponent;405,14701 +signed short Op10CoefficientR;406,14728 +signed short Op10ExponentR;407,14759 +void DSP1_Inverse(409,14788 +void DSPOp10(458,15785 +short Op04Angle;466,16027 +short Op04Radius;467,16044 +short Op04Sin;468,16062 +short Op04Cos;469,16077 +const short DSP1_MulTable[471,16093 +const short DSP1_SinTable[505,18498 +short DSP1_Sin(539,20903 +short DSP1_Cos(550,21175 +void DSP1_Normalize(561,21444 +void DSP1_NormalizeDouble(585,21768 +short DSP1_Truncate(636,22493 +void DSPOp04(646,22683 +short Op0CA;652,22805 +short Op0CX1;653,22818 +short Op0CY1;654,22832 +short Op0CX2;655,22846 +short Op0CY2;656,22860 +void DSPOp0C(658,22875 +short CentreX;664,23053 +short CentreY;665,23068 +short VOffset;666,23083 +short VPlane_C;668,23099 +short VPlane_E;669,23115 +short SinAas;672,23161 +short CosAas;673,23175 +short SinAzs;674,23189 +short CosAzs;675,23203 +short SinAZS;678,23242 +short CosAZS;679,23257 +short SecAZS_C1;680,23271 +short SecAZS_E1;681,23288 +short SecAZS_C2;682,23305 +short SecAZS_E2;683,23322 +const short MaxAZS_Exp[685,23340 +void DSP1_Parameter(690,23505 +void DSP1_Raster(773,25447 +short Op02FX;798,25903 +short Op02FY;799,25917 +short Op02FZ;800,25931 +short Op02LFE;801,25945 +short Op02LES;802,25960 +short Op02AAS;803,25975 +short Op02AZS;804,25990 +short Op02VOF;805,26005 +short Op02VVA;806,26020 +short Op02CX;807,26035 +short Op02CY;808,26049 +void DSPOp02(810,26064 +short Op0AVS;815,26199 +short Op0AA;816,26213 +short Op0AB;817,26226 +short Op0AC;818,26239 +short Op0AD;819,26252 +void DSPOp0A(821,26266 +short Op06X;827,26351 +short Op06Y;828,26364 +short Op06Z;829,26377 +short Op06H;830,26390 +short Op06V;831,26403 +unsigned short Op06S;832,26416 +double ObjPX;834,26439 +double ObjPY;835,26453 +double ObjPZ;836,26467 +double ObjPX1;837,26481 +double ObjPY1;838,26496 +double ObjPZ1;839,26511 +double ObjPX2;840,26526 +double ObjPY2;841,26541 +double ObjPZ2;842,26556 +double DivideOp06;843,26571 +int Temp;844,26590 +int tanval2;845,26600 +void DSPOp06(848,26631 +void DSPOp06(906,28027 +short matrixC[965,29447 +short matrixB[966,29468 +short matrixA[967,29489 +short Op01m;969,29511 +short Op01Zr;970,29524 +short Op01Xr;971,29538 +short Op01Yr;972,29552 +short Op11m;973,29566 +short Op11Zr;974,29579 +short Op11Xr;975,29593 +short Op11Yr;976,29607 +short Op21m;977,29621 +short Op21Zr;978,29634 +short Op21Xr;979,29648 +short Op21Yr;980,29662 +void DSPOp01(982,29677 +void DSPOp11(1006,30621 +void DSPOp21(1030,31565 +short Op0DX;1054,32509 +short Op0DY;1055,32522 +short Op0DZ;1056,32535 +short Op0DF;1057,32548 +short Op0DL;1058,32561 +short Op0DU;1059,32574 +short Op1DX;1060,32587 +short Op1DY;1061,32600 +short Op1DZ;1062,32613 +short Op1DF;1063,32626 +short Op1DL;1064,32639 +short Op1DU;1065,32652 +short Op2DX;1066,32665 +short Op2DY;1067,32678 +short Op2DZ;1068,32691 +short Op2DF;1069,32704 +short Op2DL;1070,32717 +short Op2DU;1071,32730 +void DSPOp0D(1073,32744 +void DSPOp1D(1084,33203 +void DSPOp2D(1095,33659 +short Op03F;1106,34115 +short Op03L;1107,34128 +short Op03U;1108,34141 +short Op03X;1109,34154 +short Op03Y;1110,34167 +short Op03Z;1111,34180 +short Op13F;1112,34193 +short Op13L;1113,34206 +short Op13U;1114,34219 +short Op13X;1115,34232 +short Op13Y;1116,34245 +short Op13Z;1117,34258 +short Op23F;1118,34271 +short Op23L;1119,34284 +short Op23U;1120,34297 +short Op23X;1121,34310 +short Op23Y;1122,34323 +short Op23Z;1123,34336 +void DSPOp03(1125,34350 +void DSPOp13(1136,34806 +void DSPOp23(1147,35262 +short Op14Zr;1158,35718 +short Op14Xr;1159,35732 +short Op14Yr;1160,35746 +short Op14U;1161,35760 +short Op14F;1162,35773 +short Op14L;1163,35786 +short Op14Zrr;1164,35799 +short Op14Xrr;1165,35814 +short Op14Yrr;1166,35829 +void DSPOp14(1168,35845 +void DSP1_Target(1200,36572 +short Op0EH;1229,37075 +short Op0EV;1230,37088 +short Op0EX;1231,37101 +short Op0EY;1232,37114 +void DSPOp0E(1234,37128 +short Op0BX;1239,37192 +short Op0BY;1240,37205 +short Op0BZ;1241,37218 +short Op0BS;1242,37231 +short Op1BX;1243,37244 +short Op1BY;1244,37257 +short Op1BZ;1245,37270 +short Op1BS;1246,37283 +short Op2BX;1247,37296 +short Op2BY;1248,37309 +short Op2BZ;1249,37322 +short Op2BS;1250,37335 +void DSPOp0B(1252,37349 +void DSPOp1B(1261,37510 +void DSPOp2B(1271,37874 +short Op08X,1280,38035 +short Op08X,Op08Y,1280,38035 +short Op08X,Op08Y,Op08Z,1280,38035 +short Op08X,Op08Y,Op08Z,Op08Ll,1280,38035 +short Op08X,Op08Y,Op08Z,Op08Ll,Op08Lh;1280,38035 +void DSPOp08(1282,38075 +short Op18X,1294,38376 +short Op18X,Op18Y,1294,38376 +short Op18X,Op18Y,Op18Z,1294,38376 +short Op18X,Op18Y,Op18Z,Op18R,1294,38376 +short Op18X,Op18Y,Op18Z,Op18R,Op18D;1294,38376 +void DSPOp18(1296,38414 +short Op38X,1305,38630 +short Op38X,Op38Y,1305,38630 +short Op38X,Op38Y,Op38Z,1305,38630 +short Op38X,Op38Y,Op38Z,Op38R,1305,38630 +short Op38X,Op38Y,Op38Z,Op38R,Op38D;1305,38630 +void DSPOp38(1307,38668 +short Op28X;1317,38896 +short Op28Y;1318,38909 +short Op28Z;1319,38922 +short Op28R;1320,38935 +void DSPOp28(1322,38949 +short Op1CX,1348,39493 +short Op1CX,Op1CY,1348,39493 +short Op1CX,Op1CY,Op1CZ;1348,39493 +short Op1CXBR,1349,39518 +short Op1CXBR,Op1CYBR,1349,39518 +short Op1CXBR,Op1CYBR,Op1CZBR,1349,39518 +short Op1CXBR,Op1CYBR,Op1CZBR,Op1CXAR,1349,39518 +short Op1CXBR,Op1CYBR,Op1CZBR,Op1CXAR,Op1CYAR,1349,39518 +short Op1CXBR,Op1CYBR,Op1CZBR,Op1CXAR,Op1CYAR,Op1CZAR;1349,39518 +short Op1CX1;1350,39573 +short Op1CY1;1351,39587 +short Op1CZ1;1352,39601 +short Op1CX2;1353,39615 +short Op1CY2;1354,39629 +short Op1CZ2;1355,39643 +void DSPOp1C(1357,39658 +unsigned short Op0FRamsize;1379,40455 +unsigned short Op0FPass;1380,40483 +void DSPOp0F(1382,40509 +short Op2FUnknown;1391,40636 +short Op2FSize;1392,40655 +void DSPOp2F(1394,40672 + +dsp2emu.c,439 +uint16 DSP2Op09Word1=91,3608 +uint16 DSP2Op09Word2=92,3632 +bool DSP2Op05HasLen=93,3656 +int DSP2Op05Len=94,3683 +bool DSP2Op06HasLen=95,3702 +int DSP2Op06Len=96,3729 +uint8 DSP2Op05Transparent=97,3748 +void DSP2_Op05 99,3778 +void DSP2_Op01 145,4917 +void DSP2_Op06 205,6224 +bool DSP2Op0DHasLen=219,6440 +int DSP2Op0DOutLen=220,6467 +int DSP2Op0DInLen=221,6489 +void DSP2_Op0D(227,6601 +void DSP2_Op0D(256,7429 +void DSP2_Op0D(304,8967 + +3d.h,89 +#define _3D_H_91,3622 +} OpenGLData;OpenGLData115,4152 +} GlideData;GlideData140,4612 + +65c816.h,1740 +#define _65c816_h_91,3626 +#define AL 93,3646 +#define AH 94,3663 +#define XL 95,3680 +#define XH 96,3697 +#define YL 97,3714 +#define YH 98,3731 +#define SL 99,3748 +#define SH 100,3765 +#define DL 101,3782 +#define DH 102,3799 +#define PL 103,3816 +#define PH 104,3833 +#define Carry 106,3851 +#define Zero 107,3873 +#define IRQ 108,3895 +#define Decimal 109,3917 +#define IndexFlag 110,3939 +#define MemoryFlag 111,3961 +#define Overflow 112,3983 +#define Negative 113,4005 +#define Emulation 114,4027 +#define ClearCarry(ClearCarry116,4050 +#define SetCarry(SetCarry117,4089 +#define SetZero(SetZero118,4126 +#define ClearZero(ClearZero119,4161 +#define SetIRQ(SetIRQ120,4198 +#define ClearIRQ(ClearIRQ121,4237 +#define SetDecimal(SetDecimal122,4279 +#define ClearDecimal(ClearDecimal123,4326 +#define SetIndex(SetIndex124,4376 +#define ClearIndex(ClearIndex125,4423 +#define SetMemory(SetMemory126,4473 +#define ClearMemory(ClearMemory127,4522 +#define SetOverflow(SetOverflow128,4574 +#define ClearOverflow(ClearOverflow129,4617 +#define SetNegative(SetNegative130,4662 +#define ClearNegative(ClearNegative131,4708 +#define CheckZero(CheckZero133,4754 +#define CheckCarry(CheckCarry134,4792 +#define CheckIRQ(CheckIRQ135,4827 +#define CheckDecimal(CheckDecimal136,4867 +#define CheckIndex(CheckIndex137,4915 +#define CheckMemory(CheckMemory138,4963 +#define CheckOverflow(CheckOverflow139,5013 +#define CheckNegative(CheckNegative140,5054 +#define CheckEmulation(CheckEmulation141,5102 +#define ClearFlags(ClearFlags143,5156 +#define SetFlags(SetFlags144,5202 +#define CheckFlag(CheckFlag145,5248 +} pair;pair155,5410 +struct SRegisters{SRegisters157,5419 +EXTERN_C struct SRegisters Registers;169,5571 + +apu.h,1275 +#define _apu_h_91,3623 +struct SIAPUSIAPU95,3661 +struct SAPUSAPU119,4133 +EXTERN_C struct SAPU APU;134,4421 +EXTERN_C struct SIAPU IAPU;135,4447 +STATIC inline void S9xAPUUnpackStatus(139,4568 +STATIC inline void S9xAPUPackStatus(146,4791 +#define APU_VOL_LEFT 174,5663 +#define APU_VOL_RIGHT 175,5689 +#define APU_P_LOW 176,5716 +#define APU_P_HIGH 177,5739 +#define APU_SRCN 178,5763 +#define APU_ADSR1 179,5785 +#define APU_ADSR2 180,5808 +#define APU_GAIN 181,5831 +#define APU_ENVX 182,5853 +#define APU_OUTX 183,5875 +#define APU_MVOL_LEFT 185,5898 +#define APU_MVOL_RIGHT 186,5925 +#define APU_EVOL_LEFT 187,5953 +#define APU_EVOL_RIGHT 188,5980 +#define APU_KON 189,6008 +#define APU_KOFF 190,6029 +#define APU_FLG 191,6051 +#define APU_ENDX 192,6072 +#define APU_EFB 194,6095 +#define APU_PMON 195,6116 +#define APU_NON 196,6138 +#define APU_EON 197,6159 +#define APU_DIR 198,6180 +#define APU_ESA 199,6201 +#define APU_EDL 200,6222 +#define APU_C0 202,6244 +#define APU_C1 203,6264 +#define APU_C2 204,6284 +#define APU_C3 205,6304 +#define APU_C4 206,6324 +#define APU_C5 207,6344 +#define APU_C6 208,6364 +#define APU_C7 209,6384 +#define APU_SOFT_RESET 211,6405 +#define APU_MUTE 212,6433 +#define APU_ECHO_DISABLED 213,6455 +#define FREQUENCY_MASK 215,6487 + +apumem.h,177 +#define _apumemory_h_91,3629 +INLINE uint8 S9xAPUGetByteZ 98,3723 +INLINE void S9xAPUSetByteZ 130,4392 +INLINE uint8 S9xAPUGetByte 159,4984 +INLINE void S9xAPUSetByte 192,5656 + +c4.h,23 +#define _C4_H_90,3621 + +cheats.h,704 +#define _CHEATS_H_90,3625 +struct SCheatSCheat92,3645 +#define MAX_CHEATS 102,3791 +struct SCheatDataSCheatData104,3814 + S9X_LESS_THAN,121,4213 + S9X_LESS_THAN, S9X_GREATER_THAN,121,4213 + S9X_LESS_THAN, S9X_GREATER_THAN, S9X_LESS_THAN_OR_EQUAL,121,4213 + S9X_GREATER_THAN_OR_EQUAL,122,4274 + S9X_GREATER_THAN_OR_EQUAL, S9X_EQUAL,122,4274 + S9X_GREATER_THAN_OR_EQUAL, S9X_EQUAL, S9X_NOT_EQUAL122,4274 +} S9xCheatComparisonType;S9xCheatComparisonType123,4330 + S9X_8_BITS,127,4372 + S9X_8_BITS, S9X_16_BITS,127,4372 + S9X_8_BITS, S9X_16_BITS, S9X_24_BITS,127,4372 + S9X_8_BITS, S9X_16_BITS, S9X_24_BITS, S9X_32_BITS127,4372 +} S9xCheatDataSize;S9xCheatDataSize128,4426 + +copyright.h,0 + +cpuaddr.h,1199 +#define _CPUADDR_H_91,3627 +EXTERN_C long OpAddress;93,3648 + NONE 96,3689 + READ 97,3703 + WRITE 98,3717 + MODIFY 99,3732 + JUMP 100,3748 +} AccessMode;AccessMode101,3761 +STATIC inline void Immediate8 103,3776 +STATIC inline void Immediate16 109,3894 +STATIC inline void Relative 115,4016 +STATIC inline void RelativeLong 124,4212 +STATIC inline void AbsoluteIndexedIndirect 139,4544 +STATIC inline void AbsoluteIndirectLong 155,4998 +STATIC inline void AbsoluteIndirect 175,5488 +STATIC inline void Absolute 193,5898 +STATIC inline void AbsoluteLong 207,6221 +STATIC inline void Direct(221,6566 +STATIC inline void DirectIndirectIndexed 231,6812 +STATIC inline void DirectIndirectIndexedLong 248,7292 +STATIC inline void DirectIndexedIndirect(264,7775 +STATIC inline void DirectIndexedX 284,8232 +STATIC inline void DirectIndexedY 302,8612 +STATIC inline void AbsoluteIndexedX 319,8991 +STATIC inline void AbsoluteIndexedY 336,9461 +STATIC inline void AbsoluteLongIndexedX 353,9921 +STATIC inline void DirectIndirect 367,10319 +STATIC inline void DirectIndirectLong 381,10685 +STATIC inline void StackRelative 396,11126 +STATIC inline void StackRelativeIndirectIndexed 406,11355 + +cpuexec.h,359 +#define _CPUEXEC_H_91,3627 +#define DO_HBLANK_CHECK(DO_HBLANK_CHECK96,3705 +struct SOpcodes SOpcodes100,3800 +struct SICPUSICPU108,3914 +STATIC inline void S9xUnpackStatus(141,4640 +STATIC inline void S9xPackStatus(149,4870 +STATIC inline void CLEAR_IRQ_SOURCE 156,5085 +STATIC inline void S9xFixCycles 163,5220 +STATIC inline void S9xReschedule 194,5630 + +cpumacro.h,2229 +#define _CPUMACRO_H_91,3628 +STATIC inline void SetZN16 93,3650 +STATIC inline void SetZN8 99,3766 +STATIC inline void ADC8 105,3860 +STATIC inline void ADC16 162,4730 +STATIC inline void AND16 238,5920 +STATIC inline void AND8 244,6027 +STATIC inline void A_ASL16 250,6130 +STATIC inline void A_ASL8 260,6321 +STATIC inline void ASL16 270,6508 +STATIC inline void ASL8 284,6828 +STATIC inline void BIT16 296,7063 +STATIC inline void BIT8 304,7270 +STATIC inline void CMP16 312,7447 +STATIC inline void CMP8 320,7611 +STATIC inline void CMX16 328,7773 +STATIC inline void CMX8 336,7937 +STATIC inline void CMY16 344,8099 +STATIC inline void CMY8 352,8263 +STATIC inline void A_DEC16 360,8425 +STATIC inline void A_DEC8 373,8622 +STATIC inline void DEC16 386,8815 +STATIC inline void DEC8 402,9137 +STATIC inline void EOR16 416,9376 +STATIC inline void EOR8 422,9483 +STATIC inline void A_INC16 428,9586 +STATIC inline void A_INC8 441,9783 +STATIC inline void INC16 454,9976 +STATIC inline void INC8 470,10298 +STATIC inline void LDA16 484,10537 +STATIC inline void LDA8 490,10643 +STATIC inline void LDX16 496,10745 +STATIC inline void LDX8 502,10851 +STATIC inline void LDY16 508,10953 +STATIC inline void LDY8 514,11059 +STATIC inline void A_LSR16 520,11161 +STATIC inline void A_LSR8 530,11342 +STATIC inline void LSR16 540,11519 +STATIC inline void LSR8 554,11829 +STATIC inline void ORA16 566,12054 +STATIC inline void ORA8 572,12161 +STATIC inline void A_ROL16 578,12264 +STATIC inline void A_ROL8 589,12510 +STATIC inline void ROL16 602,12772 +STATIC inline void ROL8 617,13140 +STATIC inline void A_ROR16 630,13420 +STATIC inline void A_ROR8 643,13705 +STATIC inline void ROR16 655,13973 +STATIC inline void ROR8 670,14363 +STATIC inline void SBC16 683,14659 +STATIC inline void SBC8 753,15816 +STATIC inline void STA16 804,16686 +STATIC inline void STA8 809,16762 +STATIC inline void STX16 814,16836 +STATIC inline void STX8 819,16912 +STATIC inline void STY16 824,16986 +STATIC inline void STY8 829,17062 +STATIC inline void STZ16 834,17136 +STATIC inline void STZ8 839,17200 +STATIC inline void TSB16 844,17263 +STATIC inline void TSB8 857,17580 +STATIC inline void TRB16 868,17805 +STATIC inline void TRB8 881,18123 + +cpuops.h,72 +#define _CPUOPS_H_91,3626 +#define CHECK_FOR_IRQ(CHECK_FOR_IRQ95,3692 + +debug.h,67 +#define _DEBUG_H_91,3625 +struct SBreakPoint{SBreakPoint100,3770 + +display.h,28 +#define _DISPLAY_H_91,3627 + +dma.h,24 +#define _DMA_H_91,3623 + +dsp1.h,54 +#define _DSP1_H_91,3625 +struct SDSP1 SDSP1109,4085 + +dsp4.h,1454 +int block;2,10 +int8 DSP4_Logic;6,85 +const int16 PLANE_START 9,151 +int16 view_plane;11,209 +int16 far_plane;12,251 +int16 segments;13,303 +int16 raster;14,354 +int16 project_x;16,400 +int16 project_y;17,444 +int16 project_centerx;19,490 +int16 project_centery;20,541 +int16 project_x1;22,594 +int16 project_x1low;23,639 +int16 project_y1;24,680 +int16 project_y1low;25,725 +int16 project_x2;27,768 +int16 project_y2;28,820 +int16 project_pitchx;30,874 +int16 project_pitchxlow;31,915 +int16 project_pitchy;32,958 +int16 project_pitchylow;33,999 +int16 project_focalx;35,1044 +int16 project_focaly;36,1110 +int16 project_ptr;38,1178 +int16 center_x;41,1247 +int16 center_y;42,1293 +int16 viewport_left;43,1339 +int16 viewport_right;44,1385 +int16 viewport_top;45,1433 +int16 viewport_bottom;46,1478 +int16 sprite_x;49,1550 +int16 sprite_y;50,1601 +int16 sprite_offset;51,1652 +int8 sprite_type;52,1699 +bool8 sprite_size;53,1742 +int16 path_clipRight[56,1812 +int16 path_clipLeft[57,1867 +int16 path_pos[58,1922 +int16 path_ptr[59,1970 +int16 path_raster[60,2021 +int16 path_top[61,2065 +int16 path_y[63,2107 +int16 path_x[64,2152 +int16 path_plane[65,2193 +int16 multi_index1;68,2262 +int16 multi_index2;69,2304 +bool8 op09_mode;70,2346 +int16 multi_focaly[73,2407 +int16 multi_farplane[74,2452 +int16 multi_raster[75,2506 +int8 op06_OAM[78,2568 +int8 op06_index;79,2615 +int8 op06_offset;80,2662 +short MaxTilesPerRow 82,2713 +short RowCount[83,2740 + +font.h,94 +static char *font[89,3606 +static int font_width 146,10762 +static int font_height 147,10789 + +fxemu.h,630 +#define _FXEMU_H_ 90,3624 +#define snes9x_types_defined94,3714 +typedef unsigned char uint8;uint896,3744 +typedef unsigned short uint16;uint1697,3773 +typedef unsigned int uint32;uint3298,3804 +typedef unsigned char bool8;bool899,3833 +typedef signed char int8;int8100,3862 +typedef short int16;int16101,3888 +typedef int int32;int32102,3909 +#define TRUE 106,3949 +#define FALSE 110,3986 +struct FxInit_sFxInit_s114,4094 +#define FX_FLAG_ADDRESS_CHECKING 164,5601 +#define FX_FLAG_ROM_BUFFER 165,5639 +#define FX_BREAKPOINT 168,5739 +#define FX_ERROR_ILLEGAL_ADDRESS 169,5766 +#define OPCODE_BYTES(OPCODE_BYTES172,5849 + +fxinst.h,2821 +#define _FXINST_H_ 90,3625 +#define FX_RAM_BANKS 211,7076 +struct FxRegs_sFxRegs_s219,7260 +#define FxRegs_s_null 286,9947 +#define GSU_R0 295,10337 +#define GSU_R1 296,10358 +#define GSU_R2 297,10379 +#define GSU_R3 298,10400 +#define GSU_R4 299,10421 +#define GSU_R5 300,10442 +#define GSU_R6 301,10463 +#define GSU_R7 302,10484 +#define GSU_R8 303,10505 +#define GSU_R9 304,10526 +#define GSU_R10 305,10547 +#define GSU_R11 306,10569 +#define GSU_R12 307,10591 +#define GSU_R13 308,10613 +#define GSU_R14 309,10635 +#define GSU_R15 310,10657 +#define GSU_SFR 311,10679 +#define GSU_BRAMR 312,10701 +#define GSU_PBR 313,10725 +#define GSU_ROMBR 314,10747 +#define GSU_CFGR 315,10771 +#define GSU_SCBR 316,10794 +#define GSU_CLSR 317,10817 +#define GSU_SCMR 318,10840 +#define GSU_VCR 319,10863 +#define GSU_RAMBR 320,10885 +#define GSU_CBR 321,10909 +#define GSU_CACHERAM 322,10931 +#define FLG_Z 325,10975 +#define FLG_CY 326,10996 +#define FLG_S 327,11018 +#define FLG_OV 328,11039 +#define FLG_G 329,11061 +#define FLG_R 330,11082 +#define FLG_ALT1 331,11103 +#define FLG_ALT2 332,11127 +#define FLG_IL 333,11151 +#define FLG_IH 334,11174 +#define FLG_B 335,11197 +#define FLG_IRQ 336,11219 +#define TF(TF339,11260 +#define CF(CF340,11302 +#define SF(SF341,11346 +#define TS(TS344,11441 +#define ALT0 347,11566 +#define ALT1 348,11602 +#define ALT2 349,11637 +#define ALT3 350,11672 +#define SEX16(SEX16353,11749 +#define SEX8(SEX8354,11788 +#define USEX16(USEX16357,11870 +#define USEX8(USEX8358,11912 +#define SUSEX16(SUSEX16360,11953 +#define TSZ(TSZ363,12029 +#define CLRFLAGS 366,12111 +#define RAM(RAM369,12234 +#define ROM(ROM372,12307 +#define PIPE 375,12397 +#define PRGBANK(PRGBANK378,12467 +#define FETCHPIPE 382,12549 +#define FETCHPIPE 384,12642 +#define ABS(ABS388,12703 +#define SREG 391,12765 +#define DREG 394,12827 +#define READR14399,12901 +#define TESTR14402,12951 +#define READR14 407,12990 +#define TESTR14 410,13060 +#define R0 415,13142 +#define R1 416,13166 +#define R2 417,13190 +#define R3 418,13214 +#define R4 419,13238 +#define R5 420,13262 +#define R6 421,13286 +#define R7 422,13310 +#define R8 423,13334 +#define R9 424,13358 +#define R10 425,13382 +#define R11 426,13408 +#define R12 427,13434 +#define R13 428,13460 +#define R14 429,13486 +#define R15 430,13512 +#define SFR 431,13538 +#define PBR 432,13565 +#define ROMBR 433,13593 +#define RAMBR 434,13623 +#define CBR 435,13653 +#define SCBR 436,13683 +#define SCMR 437,13729 +#define COLR 438,13775 +#define POR 439,13802 +#define BRAMR 440,13833 +#define VCR 441,13881 +#define CFGR 442,13925 +#define CLSR 443,13971 +#define FX_STEP 446,14091 +#define FX_FUNCTION_RUN 449,14220 +#define FX_FUNCTION_RUN_TO_BREAKPOINT 450,14248 +#define FX_FUNCTION_STEP_OVER 451,14288 +#define BRANCH_DELAY_RELATIVE472,15061 + +getset.h,281 +#define _GETSET_H_91,3626 +INLINE uint8 S9xGetByte 106,3816 +INLINE uint16 S9xGetWord 197,6063 +INLINE void S9xSetByte 320,9837 +INLINE void S9xSetWord 436,12378 +INLINE uint8 *GetBasePointer 594,16671 +INLINE uint8 *S9xGetMemPointer 660,18406 +INLINE void S9xSetPCBase 714,20029 + +gfx.h,1072 +#define _GFX_H_91,3623 +struct SGFX{SGFX96,3679 +struct SLineData SLineData155,5280 +#define H_FLIP 162,5364 +#define V_FLIP 163,5386 +#define BLANK_TILE 164,5408 +struct SBGSBG166,5430 +struct SLineMatrixDataSLineMatrixData184,5726 +#define SWAP_DWORD(SWAP_DWORD208,6279 +#define READ_2BYTES(READ_2BYTES212,6448 +#define WRITE_2BYTES(WRITE_2BYTES213,6489 +#define READ_2BYTES(READ_2BYTES216,6561 +#define WRITE_2BYTES(WRITE_2BYTES217,6631 +#define READ_2BYTES(READ_2BYTES220,6745 +#define WRITE_2BYTES(WRITE_2BYTES221,6815 +#define SUB_SCREEN_DEPTH 226,6940 +#define MAIN_SCREEN_DEPTH 227,6967 +#define COLOR_ADD(COLOR_ADD230,7030 +#define COLOR_ADD(COLOR_ADD235,7196 +#define COLOR_ADD1_2(COLOR_ADD1_2242,7412 +#define COLOR_SUB(COLOR_SUB248,7635 +#define COLOR_SUB(COLOR_SUB252,7792 +inline uint16 COLOR_SUB(259,8038 +#define COLOR_SUB1_2(COLOR_SUB1_2279,8422 +typedef void (*NormalTileRenderer)NormalTileRenderer283,8542 +typedef void (*ClippedTileRenderer)ClippedTileRenderer285,8652 +typedef void (*LargePixelRenderer)LargePixelRenderer288,8805 + +memmap.h,2552 +#define _memmap_h_91,3626 +#define READ_WORD(READ_WORD96,3695 +#define READ_DWORD(READ_DWORD97,3734 +#define WRITE_WORD(WRITE_WORD98,3774 +#define WRITE_DWORD(WRITE_DWORD99,3823 +#define READ_3WORD(READ_3WORD101,3874 +#define WRITE_3WORD(WRITE_3WORD102,3927 +#define READ_WORD(READ_WORD107,4062 +#define READ_DWORD(READ_DWORD109,4140 +#define WRITE_WORD(WRITE_WORD113,4302 +#define WRITE_DWORD(WRITE_DWORD115,4408 +#define WRITE_3WORD(WRITE_3WORD119,4676 +#define READ_3WORD(READ_3WORD122,4873 +#define MEMMAP_BLOCK_SIZE 127,5030 +#define MEMMAP_NUM_BLOCKS 128,5065 +#define MEMMAP_BLOCKS_PER_BANK 129,5123 +#define MEMMAP_SHIFT 130,5184 +#define MEMMAP_MASK 131,5208 +#define MEMMAP_MAX_SDD1_LOGGED_ENTRIES 132,5252 +#define NOPE 135,5329 +#define YEAH 136,5344 +#define BIGFIRST 137,5359 +#define SMALLFIRST 138,5378 +enum file_formats file_formats141,5423 +enum file_formats { FILE_ZIP,141,5423 +enum file_formats { FILE_ZIP, FILE_RAR,141,5423 +enum file_formats { FILE_ZIP, FILE_RAR, FILE_JMA,141,5423 +enum file_formats { FILE_ZIP, FILE_RAR, FILE_JMA, FILE_DEFAULT 141,5423 +class CMemory CMemory143,5490 + MAP_PPU,CMemory::MAP_PPU198,6999 + MAP_PPU, MAP_CPU,CMemory::MAP_CPU198,6999 + MAP_PPU, MAP_CPU, MAP_DSP,CMemory::MAP_DSP198,6999 + MAP_PPU, MAP_CPU, MAP_DSP, MAP_LOROM_SRAM,CMemory::MAP_LOROM_SRAM198,6999 + MAP_PPU, MAP_CPU, MAP_DSP, MAP_LOROM_SRAM, MAP_HIROM_SRAM,CMemory::MAP_HIROM_SRAM198,6999 + MAP_NONE,CMemory::MAP_NONE199,7059 + MAP_NONE, MAP_DEBUG,CMemory::MAP_DEBUG199,7059 + MAP_NONE, MAP_DEBUG, MAP_C4,CMemory::MAP_C4199,7059 + MAP_NONE, MAP_DEBUG, MAP_C4, MAP_BWRAM,CMemory::MAP_BWRAM199,7059 + MAP_NONE, MAP_DEBUG, MAP_C4, MAP_BWRAM, MAP_BWRAM_BITMAP,CMemory::MAP_BWRAM_BITMAP199,7059 + MAP_BWRAM_BITMAP2,CMemory::MAP_BWRAM_BITMAP2200,7118 + MAP_BWRAM_BITMAP2, MAP_SA1RAM,CMemory::MAP_SA1RAM200,7118 + MAP_BWRAM_BITMAP2, MAP_SA1RAM, MAP_SPC7110_ROM,CMemory::MAP_SPC7110_ROM200,7118 + MAP_BWRAM_BITMAP2, MAP_SA1RAM, MAP_SPC7110_ROM, MAP_SPC7110_DRAM,CMemory::MAP_SPC7110_DRAM200,7118 + MAP_RONLY_SRAM,CMemory::MAP_RONLY_SRAM201,7185 + MAP_RONLY_SRAM, MAP_OBC_RAM,CMemory::MAP_OBC_RAM201,7185 + MAP_RONLY_SRAM, MAP_OBC_RAM, MAP_SETA_DSP,CMemory::MAP_SETA_DSP201,7185 + MAP_RONLY_SRAM, MAP_OBC_RAM, MAP_SETA_DSP, MAP_SETA_RISC,CMemory::MAP_SETA_RISC201,7185 + MAP_RONLY_SRAM, MAP_OBC_RAM, MAP_SETA_DSP, MAP_SETA_RISC, MAP_LASTCMemory::MAP_LAST201,7185 + enum { MAX_ROM_SIZE CMemory::MAX_ROM_SIZE203,7260 + enum { MAX_ROM_SIZE = 0x800000 CMemory::x800000203,7260 +#define INLINE 291,9341 + +messages.h,1138 +#define _messages_h_91,3628 + S9X_TRACE,95,3707 + S9X_DEBUG,96,3722 + S9X_WARNING,97,3737 + S9X_INFO,98,3754 + S9X_ERROR,99,3768 + S9X_FATAL_ERROR100,3783 + S9X_ROM_INFO,105,3847 + S9X_HEADERS_INFO,106,3865 + S9X_ROM_CONFUSING_FORMAT_INFO,107,3887 + S9X_ROM_INTERLEAVED_INFO,108,3922 + S9X_SOUND_DEVICE_OPEN_FAILED,109,3952 + S9X_APU_STOPPED,110,3986 + S9X_USAGE,111,4007 + S9X_GAME_GENIE_CODE_ERROR,112,4022 + S9X_ACTION_REPLY_CODE_ERROR,113,4053 + S9X_GOLD_FINGER_CODE_ERROR,114,4086 + S9X_DEBUG_OUTPUT,115,4118 + S9X_DMA_TRACE,116,4140 + S9X_HDMA_TRACE,117,4159 + S9X_WRONG_FORMAT,118,4179 + S9X_WRONG_VERSION,119,4201 + S9X_ROM_NOT_FOUND,120,4224 + S9X_FREEZE_FILE_NOT_FOUND,121,4247 + S9X_PPU_TRACE,122,4278 + S9X_TRACE_DSP1,123,4297 + S9X_FREEZE_ROM_NAME,124,4317 + S9X_HEADER_WARNING,125,4342 + S9X_NETPLAY_NOT_SERVER,126,4366 + S9X_FREEZE_FILE_INFO,127,4394 + S9X_TURBO_MODE,128,4420 + S9X_SOUND_NOT_BUILT,129,4440 + S9X_MOVIE_INFO,130,4465 + S9X_WRONG_MOVIE_SNAPSHOT,131,4482 + S9X_NOT_A_MOVIE_SNAPSHOT,132,4509 + S9X_AVI_INFO133,4536 + +missing.h,127 +#define _MISSING_H_91,3627 +struct HDMAHDMA93,3648 +struct MissingMissing106,3908 +EXTERN_C struct Missing missing;162,5179 + +movie.h,341 +#define _MOVIE_H_92,3682 +# define SUCCESS 99,3775 +# define WRONG_FORMAT 100,3795 +# define WRONG_VERSION 101,3823 +# define FILE_NOT_FOUND 102,3852 +#define MOVIE_OPT_FROM_SNAPSHOT 105,3890 +#define MOVIE_OPT_FROM_RESET 106,3924 +#define MOVIE_OPT_PAL 107,3960 +#define MOVIE_MAX_METADATA 108,3999 +struct MovieInfoMovieInfo111,4047 + +netplay.h,1648 +#define _NETPLAY_H_91,3627 +#define NP_VERSION 110,3927 +#define NP_JOYPAD_HIST_SIZE 111,3949 +#define NP_DEFAULT_PORT 112,3981 +#define NP_MAX_CLIENTS 114,4011 +#define NP_SERV_MAGIC 116,4037 +#define NP_CLNT_MAGIC 117,4063 +#define NP_CLNT_HELLO 119,4090 +#define NP_CLNT_JOYPAD 120,4114 +#define NP_CLNT_RESET 121,4139 +#define NP_CLNT_PAUSE 122,4163 +#define NP_CLNT_LOAD_ROM 123,4187 +#define NP_CLNT_ROM_IMAGE 124,4214 +#define NP_CLNT_FREEZE_FILE 125,4242 +#define NP_CLNT_SRAM_DATA 126,4272 +#define NP_CLNT_READY 127,4300 +#define NP_CLNT_LOADED_ROM 128,4324 +#define NP_CLNT_RECEIVED_ROM_IMAGE 129,4353 +#define NP_CLNT_WAITING_FOR_ROM_IMAGE 130,4391 +#define NP_SERV_HELLO 132,4433 +#define NP_SERV_JOYPAD 133,4457 +#define NP_SERV_RESET 134,4482 +#define NP_SERV_PAUSE 135,4506 +#define NP_SERV_LOAD_ROM 136,4530 +#define NP_SERV_ROM_IMAGE 137,4557 +#define NP_SERV_FREEZE_FILE 138,4585 +#define NP_SERV_SRAM_DATA 139,4615 +#define NP_SERV_READY 140,4643 +struct SNPClientSNPClient142,4668 + NP_SERVER_SEND_ROM_IMAGE,157,4956 + NP_SERVER_SYNC_ALL,158,4986 + NP_SERVER_SYNC_CLIENT,159,5010 + NP_SERVER_SEND_FREEZE_FILE_ALL,160,5037 + NP_SERVER_SEND_ROM_LOAD_REQUEST_ALL,161,5073 + NP_SERVER_RESET_ALL,162,5114 + NP_SERVER_SEND_SRAM_ALL,163,5139 + NP_SERVER_SEND_SRAM164,5168 +#define NP_MAX_TASKS 167,5196 +struct NPServerTaskNPServerTask169,5221 +struct SNPServerSNPServer175,5281 +#define NP_MAX_ACTION_LEN 193,5708 +struct SNetPlaySNetPlay195,5739 +extern "C" struct SNetPlay NetPlay;228,6721 +#define WRITE_LONG(WRITE_LONG236,6852 +#define READ_LONG(READ_LONG243,7026 +#define S9xGetMilliTime 280,8281 + +obc1.h,25 +#define _OBC1_H_91,3624 + +pixform.h,7535 +#define _PIXFORM_H_91,3627 +enum { RGB565,95,3673 +enum { RGB565, RGB555,95,3673 +enum { RGB565, RGB555, BGR565,95,3673 +enum { RGB565, RGB555, BGR565, BGR555,95,3673 +enum { RGB565, RGB555, BGR565, BGR555, GBR565,95,3673 +enum { RGB565, RGB555, BGR565, BGR555, GBR565, GBR555,95,3673 +enum { RGB565, RGB555, BGR565, BGR555, GBR565, GBR555, RGB5551 95,3673 +#define BUILD_PIXEL(BUILD_PIXEL97,3740 +#define BUILD_PIXEL2(BUILD_PIXEL298,3797 +#define DECOMPOSE_PIXEL(DECOMPOSE_PIXEL99,3856 +#define BUILD_PIXEL_RGB565(BUILD_PIXEL_RGB565127,4671 +#define BUILD_PIXEL2_RGB565(BUILD_PIXEL2_RGB565128,4756 +#define DECOMPOSE_PIXEL_RGB565(DECOMPOSE_PIXEL_RGB565129,4842 +#define SPARE_RGB_BIT_MASK_RGB565 130,4953 +#define MAX_RED_RGB565 132,4997 +#define MAX_GREEN_RGB565 133,5026 +#define MAX_BLUE_RGB565 134,5056 +#define RED_LOW_BIT_MASK_RGB565 135,5086 +#define GREEN_LOW_BIT_MASK_RGB565 136,5127 +#define BLUE_LOW_BIT_MASK_RGB565 137,5168 +#define RED_HI_BIT_MASK_RGB565 138,5209 +#define GREEN_HI_BIT_MASK_RGB565 139,5250 +#define BLUE_HI_BIT_MASK_RGB565 140,5291 +#define FIRST_COLOR_MASK_RGB565 141,5332 +#define SECOND_COLOR_MASK_RGB565 142,5373 +#define THIRD_COLOR_MASK_RGB565 143,5414 +#define ALPHA_BITS_MASK_RGB565 144,5455 +#define BUILD_PIXEL_RGB555(BUILD_PIXEL_RGB555147,5518 +#define BUILD_PIXEL2_RGB555(BUILD_PIXEL2_RGB555148,5603 +#define DECOMPOSE_PIXEL_RGB555(DECOMPOSE_PIXEL_RGB555149,5689 +#define SPARE_RGB_BIT_MASK_RGB555 150,5800 +#define MAX_RED_RGB555 152,5845 +#define MAX_GREEN_RGB555 153,5874 +#define MAX_BLUE_RGB555 154,5904 +#define RED_LOW_BIT_MASK_RGB555 155,5934 +#define GREEN_LOW_BIT_MASK_RGB555 156,5975 +#define BLUE_LOW_BIT_MASK_RGB555 157,6016 +#define RED_HI_BIT_MASK_RGB555 158,6057 +#define GREEN_HI_BIT_MASK_RGB555 159,6098 +#define BLUE_HI_BIT_MASK_RGB555 160,6139 +#define FIRST_COLOR_MASK_RGB555 161,6180 +#define SECOND_COLOR_MASK_RGB555 162,6221 +#define THIRD_COLOR_MASK_RGB555 163,6262 +#define ALPHA_BITS_MASK_RGB555 164,6303 +#define BUILD_PIXEL_BGR565(BUILD_PIXEL_BGR565167,6365 +#define BUILD_PIXEL2_BGR565(BUILD_PIXEL2_BGR565168,6450 +#define DECOMPOSE_PIXEL_BGR565(DECOMPOSE_PIXEL_BGR565169,6536 +#define SPARE_RGB_BIT_MASK_BGR565 170,6647 +#define MAX_RED_BGR565 172,6691 +#define MAX_GREEN_BGR565 173,6720 +#define MAX_BLUE_BGR565 174,6750 +#define RED_LOW_BIT_MASK_BGR565 175,6780 +#define GREEN_LOW_BIT_MASK_BGR565 176,6821 +#define BLUE_LOW_BIT_MASK_BGR565 177,6862 +#define RED_HI_BIT_MASK_BGR565 178,6903 +#define GREEN_HI_BIT_MASK_BGR565 179,6944 +#define BLUE_HI_BIT_MASK_BGR565 180,6985 +#define FIRST_COLOR_MASK_BGR565 181,7026 +#define SECOND_COLOR_MASK_BGR565 182,7067 +#define THIRD_COLOR_MASK_BGR565 183,7108 +#define ALPHA_BITS_MASK_BGR565 184,7149 +#define BUILD_PIXEL_BGR555(BUILD_PIXEL_BGR555187,7211 +#define BUILD_PIXEL2_BGR555(BUILD_PIXEL2_BGR555188,7296 +#define DECOMPOSE_PIXEL_BGR555(DECOMPOSE_PIXEL_BGR555189,7382 +#define SPARE_RGB_BIT_MASK_BGR555 190,7493 +#define MAX_RED_BGR555 192,7538 +#define MAX_GREEN_BGR555 193,7567 +#define MAX_BLUE_BGR555 194,7597 +#define RED_LOW_BIT_MASK_BGR555 195,7627 +#define GREEN_LOW_BIT_MASK_BGR555 196,7668 +#define BLUE_LOW_BIT_MASK_BGR555 197,7709 +#define RED_HI_BIT_MASK_BGR555 198,7750 +#define GREEN_HI_BIT_MASK_BGR555 199,7791 +#define BLUE_HI_BIT_MASK_BGR555 200,7832 +#define FIRST_COLOR_MASK_BGR555 201,7873 +#define SECOND_COLOR_MASK_BGR555 202,7914 +#define THIRD_COLOR_MASK_BGR555 203,7955 +#define ALPHA_BITS_MASK_BGR555 204,7996 +#define BUILD_PIXEL_GBR565(BUILD_PIXEL_GBR565207,8058 +#define BUILD_PIXEL2_GBR565(BUILD_PIXEL2_GBR565208,8143 +#define DECOMPOSE_PIXEL_GBR565(DECOMPOSE_PIXEL_GBR565209,8229 +#define SPARE_RGB_BIT_MASK_GBR565 210,8340 +#define MAX_RED_GBR565 212,8384 +#define MAX_BLUE_GBR565 213,8421 +#define MAX_GREEN_GBR565 214,8458 +#define RED_LOW_BIT_MASK_GBR565 215,8495 +#define BLUE_LOW_BIT_MASK_GBR565 216,8536 +#define GREEN_LOW_BIT_MASK_GBR565 217,8577 +#define RED_HI_BIT_MASK_GBR565 218,8618 +#define BLUE_HI_BIT_MASK_GBR565 219,8659 +#define GREEN_HI_BIT_MASK_GBR565 220,8700 +#define FIRST_COLOR_MASK_GBR565 221,8741 +#define SECOND_COLOR_MASK_GBR565 222,8782 +#define THIRD_COLOR_MASK_GBR565 223,8823 +#define ALPHA_BITS_MASK_GBR565 224,8864 +#define BUILD_PIXEL_GBR555(BUILD_PIXEL_GBR555227,8926 +#define BUILD_PIXEL2_GBR555(BUILD_PIXEL2_GBR555228,9011 +#define DECOMPOSE_PIXEL_GBR555(DECOMPOSE_PIXEL_GBR555229,9097 +#define SPARE_RGB_BIT_MASK_GBR555 230,9208 +#define MAX_RED_GBR555 232,9253 +#define MAX_BLUE_GBR555 233,9290 +#define MAX_GREEN_GBR555 234,9327 +#define RED_LOW_BIT_MASK_GBR555 235,9364 +#define BLUE_LOW_BIT_MASK_GBR555 236,9405 +#define GREEN_LOW_BIT_MASK_GBR555 237,9446 +#define RED_HI_BIT_MASK_GBR555 238,9487 +#define BLUE_HI_BIT_MASK_GBR555 239,9528 +#define GREEN_HI_BIT_MASK_GBR555 240,9569 +#define FIRST_COLOR_MASK_GBR555 241,9610 +#define SECOND_COLOR_MASK_GBR555 242,9651 +#define THIRD_COLOR_MASK_GBR555 243,9692 +#define ALPHA_BITS_MASK_GBR555 244,9733 +#define BUILD_PIXEL_RGB5551(BUILD_PIXEL_RGB5551247,9796 +#define BUILD_PIXEL2_RGB5551(BUILD_PIXEL2_RGB5551248,9893 +#define DECOMPOSE_PIXEL_RGB5551(DECOMPOSE_PIXEL_RGB5551249,9991 +#define SPARE_RGB_BIT_MASK_RGB5551 250,10110 +#define MAX_RED_RGB5551 252,10150 +#define MAX_GREEN_RGB5551 253,10181 +#define MAX_BLUE_RGB5551 254,10213 +#define RED_LOW_BIT_MASK_RGB5551 255,10244 +#define GREEN_LOW_BIT_MASK_RGB5551 256,10286 +#define BLUE_LOW_BIT_MASK_RGB5551 257,10328 +#define RED_HI_BIT_MASK_RGB5551 258,10370 +#define GREEN_HI_BIT_MASK_RGB5551 259,10412 +#define BLUE_HI_BIT_MASK_RGB5551 260,10454 +#define FIRST_COLOR_MASK_RGB5551 261,10496 +#define SECOND_COLOR_MASK_RGB5551 262,10538 +#define THIRD_COLOR_MASK_RGB5551 263,10580 +#define ALPHA_BITS_MASK_RGB5551 264,10622 +#define CONCAT(CONCAT267,10690 +#define BUILD_PIXEL_D(BUILD_PIXEL_D271,10866 +#define BUILD_PIXEL2_D(BUILD_PIXEL2_D272,10928 +#define DECOMPOSE_PIXEL_D(DECOMPOSE_PIXEL_D273,10992 +#define BUILD_PIXEL(BUILD_PIXEL275,11071 +#define BUILD_PIXEL2(BUILD_PIXEL2276,11132 +#define DECOMPOSE_PIXEL(DECOMPOSE_PIXEL277,11195 +#define MAX_RED_D(MAX_RED_D279,11273 +#define MAX_BLUE_D(MAX_BLUE_D280,11314 +#define MAX_GREEN_D(MAX_GREEN_D281,11357 +#define RED_LOW_BIT_MASK_D(RED_LOW_BIT_MASK_D282,11402 +#define BLUE_LOW_BIT_MASK_D(BLUE_LOW_BIT_MASK_D283,11460 +#define GREEN_LOW_BIT_MASK_D(GREEN_LOW_BIT_MASK_D284,11520 +#define RED_HI_BIT_MASK_D(RED_HI_BIT_MASK_D285,11582 +#define BLUE_HI_BIT_MASK_D(BLUE_HI_BIT_MASK_D286,11638 +#define GREEN_HI_BIT_MASK_D(GREEN_HI_BIT_MASK_D287,11696 +#define FIRST_COLOR_MASK_D(FIRST_COLOR_MASK_D288,11756 +#define SECOND_COLOR_MASK_D(SECOND_COLOR_MASK_D289,11816 +#define THIRD_COLOR_MASK_D(THIRD_COLOR_MASK_D290,11877 +#define ALPHA_BITS_MASK_D(ALPHA_BITS_MASK_D291,11937 +#define MAX_RED 293,11997 +#define MAX_BLUE 294,12039 +#define MAX_GREEN 295,12082 +#define RED_LOW_BIT_MASK 296,12127 +#define BLUE_LOW_BIT_MASK 297,12185 +#define GREEN_LOW_BIT_MASK 298,12251 +#define RED_HI_BIT_MASK 299,12318 +#define BLUE_HI_BIT_MASK 300,12382 +#define GREEN_HI_BIT_MASK 301,12447 +#define FIRST_COLOR_MASK 302,12513 +#define SECOND_COLOR_MASK 303,12578 +#define THIRD_COLOR_MASK 304,12644 +#define ALPHA_BITS_MASK 305,12709 +#define GREEN_HI_BIT 307,12774 +#define RGB_LOW_BITS_MASK 308,12821 +#define RGB_HI_BITS_MASK 310,12915 +#define RGB_HI_BITS_MASKx2 312,13006 +#define RGB_REMOVE_LOW_BITS_MASK 314,13107 +#define FIRST_THIRD_COLOR_MASK 315,13161 +#define TWO_LOW_BITS_MASK 316,13230 +#define HIGH_BITS_SHIFTED_TWO_MASK 317,13303 + +port.h,2226 +#define _PORT_H_91,3624 +#define ACCEPT_SIZE_T 105,3824 +#define ACCEPT_SIZE_T 107,3856 +#define GFX_MULTI_FORMAT114,3964 +#define ZLIB119,4053 +#define EXECUTE_SUPERFX_PER_LINE120,4066 +#define SOUND121,4099 +#define VAR_CYCLES122,4113 +#define CPU_SHUTDOWN123,4132 +#define SPC700_SHUTDOWN124,4153 +#define PIXEL_FORMAT 125,4177 +#define CHECK_SOUND(CHECK_SOUND126,4205 +#define M_PI 127,4227 +#define USE_X86_ASM139,4530 +#define snes9x_types_defined143,4587 +typedef unsigned char bool8;bool8145,4617 +typedef unsigned char uint8;uint8149,4745 +typedef unsigned short uint16;uint16150,4774 +typedef signed char int8;int8151,4805 +typedef short int16;int16152,4831 +typedef int int32;int32153,4852 +typedef unsigned int uint32;uint32154,4871 +typedef long long int64;int64158,4979 +typedef unsigned char uint8;uint8165,5081 +typedef unsigned short uint16;uint16166,5110 +typedef signed char int8;int8167,5141 +typedef short int16;int16168,5167 +typedef long int32;int32172,5246 +# define PLAT_SOUND_BUFFER 174,5267 +# define RIGHTSHIFT_IS_SAR175,5308 +typedef unsigned int uint32;uint32178,5346 +typedef __int64 int64;int64182,5404 +#define TRUE 191,5522 +#define FALSE 195,5559 +#define EXTERN_C199,5596 +#define START_EXTERN_C200,5613 +#define END_EXTERN_C201,5636 +#define EXTERN_C 204,5711 +#define START_EXTERN_C 205,5739 +#define END_EXTERN_C 206,5775 +#define EXTERN_C 208,5804 +#define START_EXTERN_C209,5828 +#define END_EXTERN_C210,5851 +#define PATH_MAX 217,5923 +#define _MAX_DIR 220,5953 +#define _MAX_DRIVE 221,5979 +#define _MAX_FNAME 222,6000 +#define _MAX_EXT 223,6028 +#define _MAX_PATH 224,6054 +#define ZeroMemory(ZeroMemory226,6082 +#define strcasecmp 233,6337 +#define strncasecmp 234,6364 +EXTERN_C int soundsignal;240,6450 +#define CHECK_SOUND 243,6559 +#define CHECK_SOUND(CHECK_SOUND245,6667 +#define SLASH_STR 249,6712 +#define SLASH_CHAR 250,6735 +#define SLASH_STR 252,6765 +#define SLASH_CHAR 253,6787 +#define SIG_PF 265,7055 +#define LSB_FIRST270,7205 +#define FAST_LSB_WORD_ACCESS271,7223 +#define MSB_FIRST273,7258 +#define TITLE 277,7297 +#define TITLE 281,7352 +#define TITLE 285,7404 +#define STATIC289,7448 +#define strncasecmp 290,7463 +#define STATIC 292,7498 + +ppu.h,1330 +#define _PPU_H_91,3623 +#define FIRST_VISIBLE_LINE 93,3640 +#define TILE_2BIT 98,3723 +#define TILE_4BIT 99,3743 +#define TILE_8BIT 100,3763 +#define MAX_2BIT_TILES 102,3784 +#define MAX_4BIT_TILES 103,3812 +#define MAX_8BIT_TILES 104,3840 +#define PPU_H_BEAM_IRQ_SOURCE 106,3869 +#define PPU_V_BEAM_IRQ_SOURCE 107,3908 +#define GSU_IRQ_SOURCE 108,3947 +#define SA1_IRQ_SOURCE 109,3980 +#define SA1_DMA_IRQ_SOURCE 110,4013 +struct ClipData ClipData112,4050 +struct InternalPPU InternalPPU118,4146 +struct SOBJSOBJ161,5187 +struct SPPU SPPU173,5350 +#define CLIP_OR 273,7516 +#define CLIP_AND 274,7534 +#define CLIP_XOR 275,7553 +#define CLIP_XNOR 276,7572 +struct SDMA SDMA278,7593 +} SnesModel;SnesModel333,8762 +#define MAX_5C77_VERSION 339,8852 +#define MAX_5C78_VERSION 340,8882 +#define MAX_5A22_VERSION 341,8912 +STATIC inline uint8 REGISTER_4212(343,8943 +STATIC inline void FLUSH_REDRAW 357,9335 +STATIC inline void REGISTER_2104 363,9443 +STATIC inline void REGISTER_2118 450,12342 +STATIC inline void REGISTER_2118_tile 483,13260 +STATIC inline void REGISTER_2118_linear 499,13832 +STATIC inline void REGISTER_2119 511,14242 +STATIC inline void REGISTER_2119_tile 544,15175 +STATIC inline void REGISTER_2119_linear 559,15745 +STATIC inline void REGISTER_2122(571,16160 +STATIC inline void REGISTER_2180(618,17448 + +sa1.h,902 +#define _sa1_h_91,3623 +struct SSA1Registers SSA1Registers95,3661 +struct SSA1 SSA1107,3826 +#define SA1CheckZero(SA1CheckZero146,4745 +#define SA1CheckCarry(SA1CheckCarry147,4785 +#define SA1CheckIRQ(SA1CheckIRQ148,4822 +#define SA1CheckDecimal(SA1CheckDecimal149,4868 +#define SA1CheckIndex(SA1CheckIndex150,4922 +#define SA1CheckMemory(SA1CheckMemory151,4976 +#define SA1CheckOverflow(SA1CheckOverflow152,5032 +#define SA1CheckNegative(SA1CheckNegative153,5075 +#define SA1CheckEmulation(SA1CheckEmulation154,5125 +#define SA1ClearFlags(SA1ClearFlags156,5185 +#define SA1SetFlags(SA1SetFlags157,5237 +#define SA1CheckFlag(SA1CheckFlag158,5289 +#define SNES_IRQ_SOURCE 183,5966 +#define TIMER_IRQ_SOURCE 184,6003 +#define DMA_IRQ_SOURCE 185,6040 +STATIC inline void S9xSA1UnpackStatus(187,6077 +STATIC inline void S9xSA1PackStatus(195,6318 +STATIC inline void S9xSA1FixCycles 202,6541 + +sar.h,185 +#define _SAR_H_91,3623 +#define SAR(SAR104,3792 +static inline int8 SAR(107,3828 +static inline int16 SAR(114,3976 +static inline int32 SAR(121,4128 +static inline int64 SAR(128,4280 + +screenshot.h,29 +#define SCREENSHOT_H91,3628 + +sdd1.h,25 +#define _SDD1_H_91,3624 + +sdd1emu.h,26 +#define SDD1EMU_H90,3624 + +seta.h,378 +#define _seta_h92,3639 +#define ST_010 96,3675 +#define ST_011 97,3695 +#define ST_018 98,3715 +typedef struct SETA_ST010_STRUCTSETA_ST010_STRUCT117,4154 +} ST010_Regs;ST010_Regs124,4294 +typedef struct SETA_ST011_STRUCTSETA_ST011_STRUCT126,4309 +} ST011_Regs;ST011_Regs137,4519 +typedef struct SETA_ST018_STRUCTSETA_ST018_STRUCT139,4534 +} ST018_Regs;ST018_Regs152,4779 + +snaporig.h,597 +#define _SNAPORIG_H_90,3627 +#define ORIG_SNAPSHOT_MAGIC 92,3649 +#define ORIG_SNAPSHOT_VERSION 93,3688 +struct SOrigCPUState{SOrigCPUState97,3781 +struct SOrigAPUSOrigAPU127,4467 +} OrigYAndA;OrigYAndA150,4881 +struct SOrigAPURegisters{SOrigAPURegisters152,4895 +#define ORIG_MAX_BUFFER_SIZE 160,5001 +#define NUM_CHANNELS 161,5041 +} OrigChannel;OrigChannel195,5853 +} SOrigSoundData;SOrigSoundData213,6309 +struct SOrigOBJSOrigOBJ215,6328 +struct SOrigPPU SOrigPPU229,6530 +struct SOrigDMA SOrigDMA332,8740 +} OrigPair;OrigPair364,9323 +struct SOrigRegisters{SOrigRegisters366,9336 + +snapshot.h,293 +#define _SNAPSHOT_H_90,3627 +#define SNAPSHOT_MAGIC 95,3689 +#define SNAPSHOT_VERSION 96,3723 +#define SUCCESS 98,3751 +#define WRONG_FORMAT 99,3769 +#define WRONG_VERSION 100,3795 +#define FILE_NOT_FOUND 101,3822 +#define WRONG_MOVIE_SNAPSHOT 102,3850 +#define NOT_A_MOVIE_SNAPSHOT 103,3884 + +snes9x.h,3003 +#define _SNES9X_H_90,3625 +#define VERSION 92,3645 +#define GFX_MULTI_FORMAT109,3928 +#define ROM_NAME_LEN 112,3961 +#define STREAM 118,4041 +#define READ_STREAM(READ_STREAM119,4063 +#define WRITE_STREAM(WRITE_STREAM120,4105 +#define OPEN_STREAM(OPEN_STREAM121,4149 +#define REOPEN_STREAM(REOPEN_STREAM122,4187 +#define FIND_STREAM(FIND_STREAM123,4228 +#define REVERT_STREAM(REVERT_STREAM124,4261 +#define CLOSE_STREAM(CLOSE_STREAM125,4305 +#define STREAM 127,4347 +#define READ_STREAM(READ_STREAM128,4369 +#define WRITE_STREAM(WRITE_STREAM129,4412 +#define OPEN_STREAM(OPEN_STREAM130,4457 +#define REOPEN_STREAM(REOPEN_STREAM131,4494 +#define FIND_STREAM(FIND_STREAM132,4534 +#define REVERT_STREAM(REVERT_STREAM133,4566 +#define CLOSE_STREAM(CLOSE_STREAM134,4609 +#define SNES_WIDTH 139,4688 +#define SNES_HEIGHT 140,4712 +#define SNES_HEIGHT_EXTENDED 141,4737 +#define IMAGE_WIDTH 142,4770 +#define IMAGE_HEIGHT 143,4845 +#define SNES_MAX_NTSC_VCOUNTER 145,4942 +#define SNES_MAX_PAL_VCOUNTER 146,4978 +#define SNES_HCOUNTER_MAX 147,5014 +#define SPC700_TO_65C816_RATIO 148,5044 +#define AUTO_FRAMERATE 149,5077 +#define SNES_SCANLINE_TIME 163,5582 +#define SNES_CLOCK_SPEED 164,5621 +#define SNES_CLOCK_LEN 166,5657 +#define SNES_CYCLES_PER_SCANLINE 168,5706 +#define SNES_APUTIMER2_CYCLEx10000 170,5801 +#define ONE_CYCLE 172,5931 +#define SLOW_ONE_CYCLE 173,5951 +#define TWO_CYCLES 174,5976 +#define SNES_TR_MASK 177,6000 +#define SNES_TL_MASK 178,6034 +#define SNES_X_MASK 179,6068 +#define SNES_A_MASK 180,6101 +#define SNES_RIGHT_MASK 181,6134 +#define SNES_LEFT_MASK 182,6171 +#define SNES_DOWN_MASK 183,6207 +#define SNES_UP_MASK 184,6244 +#define SNES_START_MASK 185,6279 +#define SNES_SELECT_MASK 186,6317 +#define SNES_Y_MASK 187,6355 +#define SNES_B_MASK 188,6389 + SNES_MULTIPLAYER5,191,6431 + SNES_JOYPAD,192,6454 + SNES_MOUSE_SWAPPED,193,6471 + SNES_MOUSE,194,6495 + SNES_SUPERSCOPE,195,6511 + SNES_JUSTIFIER,196,6532 + SNES_JUSTIFIER_2,197,6549 + SNES_MAX_CONTROLLER_OPTIONS198,6568 +#define DEBUG_MODE_FLAG 201,6604 +#define TRACE_FLAG 202,6641 +#define SINGLE_STEP_FLAG 203,6671 +#define BREAK_FLAG 204,6708 +#define SCAN_KEYS_FLAG 205,6738 +#define SAVE_SNAPSHOT_FLAG 206,6774 +#define DELAYED_NMI_FLAG 207,6811 +#define NMI_FLAG 208,6848 +#define PROCESS_SOUND_FLAG 209,6876 +#define FRAME_ADVANCE_FLAG 210,6913 +#define DELAYED_NMI_FLAG2 211,6950 +#define IRQ_PENDING_FLAG 212,6988 +struct SCPUState{SCPUState214,7027 +#define HBLANK_START_EVENT 245,7719 +#define HBLANK_END_EVENT 246,7748 +#define HTIMER_BEFORE_EVENT 247,7775 +#define HTIMER_AFTER_EVENT 248,7805 +#define NO_EVENT 249,7834 +struct SSettings{SSettings251,7854 +struct SSNESGameFixesSSNESGameFixes395,11244 + PAUSE_NETPLAY_CONNECT 417,11722 + PAUSE_TOGGLE_FULL_SCREEN 418,11760 + PAUSE_EXIT 419,11801 + PAUSE_MENU 420,11828 + PAUSE_INACTIVE_WINDOW 421,11855 + PAUSE_WINDOW_ICONISED 422,11893 + PAUSE_RESTORE_GUI 423,11931 + PAUSE_FREEZE_FILE 424,11965 + +soundux.h,1791 +#define _SOUND_H_90,3624 +enum { SOUND_SAMPLE 92,3643 +enum { SOUND_SAMPLE = 0, SOUND_NOISE,92,3643 +enum { SOUND_SAMPLE = 0, SOUND_NOISE, SOUND_EXTRA_NOISE,92,3643 +enum { SOUND_SAMPLE = 0, SOUND_NOISE, SOUND_EXTRA_NOISE, SOUND_MUTE 92,3643 +enum { SOUND_SILENT,93,3714 +enum { SOUND_SILENT, SOUND_ATTACK,93,3714 +enum { SOUND_SILENT, SOUND_ATTACK, SOUND_DECAY,93,3714 +enum { SOUND_SILENT, SOUND_ATTACK, SOUND_DECAY, SOUND_SUSTAIN,93,3714 + SOUND_RELEASE,94,3777 + SOUND_RELEASE, SOUND_GAIN,94,3777 + SOUND_RELEASE, SOUND_GAIN, SOUND_INCREASE_LINEAR,94,3777 + SOUND_INCREASE_BENT_LINE,95,3834 + SOUND_INCREASE_BENT_LINE, SOUND_DECREASE_LINEAR,95,3834 + SOUND_DECREASE_EXPONENTIAL}96,3890 +enum { MODE_NONE 98,3927 +enum { MODE_NONE = SOUND_SILENT,98,3927 +enum { MODE_NONE = SOUND_SILENT, MODE_ADSR,98,3927 +enum { MODE_NONE = SOUND_SILENT, MODE_ADSR, MODE_RELEASE 98,3927 +enum { MODE_NONE = SOUND_SILENT, MODE_ADSR, MODE_RELEASE = SOUND_RELEASE,98,3927 + MODE_GAIN,99,4001 + MODE_GAIN, MODE_INCREASE_LINEAR,99,4001 + MODE_GAIN, MODE_INCREASE_LINEAR, MODE_INCREASE_BENT_LINE,99,4001 + MODE_DECREASE_LINEAR,100,4066 + MODE_DECREASE_LINEAR, MODE_DECREASE_EXPONENTIAL}100,4066 +#define MAX_ENVELOPE_HEIGHT 102,4124 +#define ENVELOPE_SHIFT 103,4156 +#define MAX_VOLUME 104,4181 +#define VOLUME_SHIFT 105,4204 +#define VOL_DIV 106,4227 +#define SOUND_DECODE_LENGTH 107,4247 +#define NUM_CHANNELS 109,4279 +#define SOUND_BUFFER_SIZE 110,4305 +#define MAX_BUFFER_SIZE 111,4343 +#define SOUND_BUFFER_SIZE_MASK 112,4385 +#define SOUND_BUFS 114,4441 +} SoundStatus;SoundStatus140,4916 +EXTERN_C volatile SoundStatus so;142,4932 +} Channel;Channel183,5966 +} SSoundData;SSoundData205,6508 +EXTERN_C SSoundData SoundData;207,6523 + +spc700.h,1770 +#define _SPC700_H_90,3625 +#define NO_CHANNEL_STRUCT93,3660 +#define Carry 99,3777 +#define Zero 100,3799 +#define Interrupt 101,3821 +#define HalfCarry 102,3843 +#define BreakFlag 103,3865 +#define DirectPageFlag 104,3887 +#define Overflow 105,3913 +#define Negative 106,3935 +#define APUClearCarry(APUClearCarry108,3958 +#define APUSetCarry(APUSetCarry109,4000 +#define APUSetInterrupt(APUSetInterrupt110,4040 +#define APUClearInterrupt(APUClearInterrupt111,4096 +#define APUSetHalfCarry(APUSetHalfCarry112,4155 +#define APUClearHalfCarry(APUClearHalfCarry113,4211 +#define APUSetBreak(APUSetBreak114,4270 +#define APUClearBreak(APUClearBreak115,4322 +#define APUSetDirectPage(APUSetDirectPage116,4377 +#define APUClearDirectPage(APUClearDirectPage117,4439 +#define APUSetOverflow(APUSetOverflow118,4504 +#define APUClearOverflow(APUClearOverflow119,4550 +#define APUCheckZero(APUCheckZero121,4599 +#define APUCheckCarry(APUCheckCarry122,4640 +#define APUCheckInterrupt(APUCheckInterrupt123,4678 +#define APUCheckHalfCarry(APUCheckHalfCarry124,4735 +#define APUCheckBreak(APUCheckBreak125,4792 +#define APUCheckDirectPage(APUCheckDirectPage126,4845 +#define APUCheckOverflow(APUCheckOverflow127,4908 +#define APUCheckNegative(APUCheckNegative128,4952 +#define APUClearFlags(APUClearFlags130,5000 +#define APUSetFlags(APUSetFlags131,5050 +#define APUCheckFlag(APUCheckFlag132,5100 +} YAndA;YAndA142,5271 +struct SAPURegisters{SAPURegisters144,5281 +EXTERN_C struct SAPURegisters APURegisters;152,5379 +#define ONE_APU_CYCLE 156,5481 +#define ONE_APU_CYCLE_HUMAN 160,5608 +#define APU_EXECUTE(APU_EXECUTE167,5715 +#define APU_EXECUTE1(APU_EXECUTE1180,5909 +#define APU_EXECUTE1(APU_EXECUTE1188,6080 +#define APU_EXECUTE(APU_EXECUTE195,6201 + +spc7110.h,223 +#define _spc7110_h90,3625 +#define DECOMP_BUFFER_SIZE 93,3663 +typedef struct SPC7110RTCSPC7110RTC123,4428 +} S7RTC;S7RTC130,4541 +typedef struct SPC7110EmuVarsSPC7110EmuVars132,4551 +} SPC7110Regs;SPC7110Regs187,5818 + +srtc.h,314 +#define _srtc_h_90,3623 +#define MAX_RTC_INDEX 94,3660 +#define MODE_READ 96,3693 +#define MODE_LOAD_RTC 97,3723 +#define MODE_COMMAND 98,3753 +#define MODE_COMMAND_DONE 99,3783 +#define COMMAND_LOAD_RTC 101,3814 +#define COMMAND_CLEAR_RTC 102,3844 +} SRTC_DATA;SRTC_DATA142,4710 +#define SRTC_SRAM_PAD 154,4976 + +tile.h,1326 +#define _TILE_H_90,3623 +#define TILE_AssignPixel(TILE_AssignPixel92,3641 +#define TILE_SetPixel(TILE_SetPixel94,3712 +#define TILE_SetPixel16(TILE_SetPixel1695,3801 +#define TILE_AddPixel16(TILE_AddPixel1697,3883 +#define TILE_AddFPixel16(TILE_AddFPixel1698,4000 +#define TILE_AddPixel16Half(TILE_AddPixel16Half99,4113 +#define TILE_AddFPixel16Half(TILE_AddFPixel16Half100,4241 +#define TILE_SubPixel16(TILE_SubPixel16102,4366 +#define TILE_SubFPixel16(TILE_SubFPixel16103,4483 +#define TILE_SubPixel16Half(TILE_SubPixel16Half104,4596 +#define TILE_SubFPixel16Half(TILE_SubFPixel16Half105,4724 +#define TILE_Select3(TILE_Select3107,4849 +#define TILE_Select2(TILE_Select2115,5096 +#define TILE_SelectAddPixel16(TILE_SelectAddPixel16122,5281 +#define TILE_SelectAddPixel16Half(TILE_SelectAddPixel16Half123,5372 +#define TILE_SelectSubPixel16(TILE_SelectSubPixel16124,5467 +#define TILE_SelectSubPixel16Half(TILE_SelectSubPixel16Half125,5558 +#define TILE_SelectFAddPixel16Half(TILE_SelectFAddPixel16Half127,5654 +#define TILE_SelectFSubPixel16Half(TILE_SelectFSubPixel16Half128,5738 +#define TILE_PREAMBLE 132,5846 +#define RENDER_TILE(RENDER_TILE160,6686 +#define TILE_CLIP_PREAMBLE 208,7810 +#define RENDER_CLIPPED_TILE(RENDER_CLIPPED_TILE235,8278 +#define RENDER_TILE_LARGE(RENDER_TILE_LARGE287,9666 + +unix/config.c,1218 +#define MIN(MIN120,4464 +typedef struct CONFIG_ENTRYCONFIG_ENTRY123,4513 +} CONFIG_ENTRY;CONFIG_ENTRY128,4728 +typedef struct CONFIGCONFIG131,4746 +} CONFIG;CONFIG136,4975 +#define MAX_CONFIGS 139,4987 +static CONFIG *config[141,5014 +static CONFIG *config_override 142,5079 +char *get_filename(146,5179 +long file_size 158,5397 +static void destroy_config(179,5714 +static void config_cleanup(239,6677 +static void init_config(265,7224 +static int get_line(326,8570 +static void set_config(387,9808 +static void load_config_file(441,10881 +void set_config_file(466,11428 +void set_config_data(477,11633 +void override_config_file(487,11835 +void override_config_data(498,12056 +void push_config_state(508,12244 +void pop_config_state(526,12525 +static void prettify_section_name(544,12820 +static CONFIG_ENTRY *find_config_string(566,13163 +char *get_config_string(608,13972 +int get_config_int(630,14373 +int get_config_hex(645,14642 +float get_config_float(665,15005 +char **get_config_argv(680,15278 + #define MAX_ARGV 682,15341 +static CONFIG_ENTRY *insert_variable(723,16028 +void set_config_string(758,16653 +void set_config_int(839,18330 +void set_config_hex(851,18563 +void set_config_float(867,18871 + +unix/aido.h,25 +#define _AIDO_H_90,3623 + +unix/snes9x_gui.h,64 +#define SNES9X_GUI_H90,3627 +class Snes9xGUI:Snes9xGUI97,3710 + +unix/x11.h,52 +#define _x11_h_90,3622 +} GUIData;GUIData159,5023 + +unzip/explode.c,831 +# define WSIZE 75,4017 +struct huft huft80,4174 +UWORD cplen2[124,6002 +UWORD cplen3[128,6293 +UWORD extra[132,6585 +UWORD cpdist4[136,6819 +UWORD cpdist8[142,7244 +#define NEXTBYTE 164,8115 +#define NEEDBITS(NEEDBITS165,8165 +#define DUMPBITS(DUMPBITS166,8231 +UWORD mask_bits[169,8281 +union work area;174,8453 +ULONG crc32val;175,8528 +ush bytebuf;176,8544 +ULONG bitbuf;177,8557 +int bits_left;178,8571 +boolean zipeof;179,8586 +int get_tree(181,8603 +int explode_lit8(213,9668 +int explode_lit4(335,13397 +int explode_nolit8(457,17125 +int explode_nolit4(570,20510 +int explode 683,23894 +int ReadByte(811,27677 +#define BMAX 852,28918 +#define N_MAX 853,28996 +unsigned hufts;855,29062 +int huft_build(858,29113 +int huft_free(1051,36013 +void flush(1071,36459 +void flush_stack(1084,36935 +int FillBitBuffer(1101,37511 + +unzip/unreduce.c,300 +#define DLE 20,607 +typedef byte f_array[f_array22,627 + f_array *followers;35,1000 + f_array *followers 37,1057 +byte Slen[40,1119 +int factor;41,1135 +int L_table[43,1148 +int D_shift[46,1194 +int D_mask[48,1239 +int B_table[51,1284 +void unReduce(76,2174 +static void LoadFollowers(206,5624 + +unzip/unshrink.c,309 +#define INIT_BITS 19,508 +#define FIRST_ENT 20,534 +#define CLEAR 21,562 +#define GetCode(GetCode22,590 +int codesize,26,669 +int codesize, maxcode,26,669 +int codesize, maxcode, maxcodemax,26,669 +int codesize, maxcode, maxcodemax, free_ent;26,669 +void unShrink(35,803 +static void partial_clear(151,3535 + +unzip/unzip.c,1011 +const char unz_copyright[26,390 +unzlocal_getByte 42,787 +unzlocal_getShort 65,1209 +unzlocal_getLong 86,1552 +strcmpcasenosensitive_internal 117,2103 +#define CASESENSITIVITYDEFAULTVALUE 140,2567 +#define CASESENSITIVITYDEFAULTVALUE 142,2611 +#define STRCMPCASENOSENTIVEFUNCTION 146,2693 +unzStringFileNameCompare 158,3124 +#define BUFREADCOMMENT 169,3438 +unzlocal_SearchCentralDir 176,3583 +unzOpen 238,5233 +unzClose 341,8055 +unzGetGlobalInfo 363,8482 +unzlocal_DosDateToTmuDate 378,8783 + local int unzlocal_GetCurrentFileInfoInternal 406,9645 +unzGetCurrentFileInfo 566,14262 +unzGoToFirstFile 587,14860 +unzGoToNextFile 610,15500 +unzLocateFile 642,16466 +unzlocal_CheckCurrentFileCoherencyHeader 695,17781 +unzOpenCurrentFile 786,20472 +file_in_zip_read_info_s *pfile_in_zip_read_info 898,24010 +unz_s *pUnzip 899,24066 +unzReadCurrentFile 901,24108 +unztell 1056,28648 +unzeof 1076,29086 +unzGetLocalExtrafield 1108,29971 +unzCloseCurrentFile 1156,31173 +unzGetGlobalComment 1196,32231 + +unzip/unz.h,8414 +# define UNIX25,827 +# define __TURBOC__33,1066 +# define MSDOS34,1087 +# define MSDOS37,1192 +# define PROTO46,1520 +# define MODERN48,1547 +# define PROTO52,1655 +# define MODERN54,1682 +# define PROTO58,1779 +# define MODERN60,1806 +# define BSD70,2074 +# define TERMIO76,2264 +# define ZMEM82,2393 +# define NO_PARAM_H99,2914 +# define DECLARE_ERRNO 116,3313 + typedef size_t extent;extent140,4236 + typedef unsigned int extent;extent145,4349 +# define void 146,4381 +# define BSIZE 174,5244 +# define BSIZE 176,5294 +# define NO_MKDIR 182,5461 +# define BSIZE 195,5764 +# define strchr 199,5876 +# define strrchr 200,5902 +# define DOS_OS2208,6155 +# define MSC 217,6805 +# define DOS_OS2224,7103 +# define S_IFMT 225,7121 +# define timezone 226,7145 +# define DOS_OS2230,7201 +# define __32BIT__231,7219 +# define far236,7309 +# define DOS_OS2240,7346 +# define __32BIT__241,7364 +# define far242,7384 +# define DOS_OS2 246,7500 +# define isupper(isupper264,8274 +# define tolower(tolower265,8328 +# define DOS_OS2279,8690 +# define getch(getch280,8710 +# define _MAX_PATH 292,9127 +# define UNIX 293,9193 +# define RETURN 294,9273 +# define RETURN 297,9388 +# define RETURN(RETURN299,9456 +# define O_RDONLY 309,9817 +# define O_WRONLY 310,9841 +# define O_RDWR 311,9865 +# define SHORT_NAMES320,10162 +# define tzset 321,10190 +# define DOS_VMS330,10453 +# define MACOS338,10694 +# define __STDC__ 340,10785 +# define __STDC__ 344,11036 +# define MACOS350,11201 +# define CtoPstr 356,11332 +# define PtoCstr 357,11357 +# define open(open364,11449 +# define close 365,11502 +# define read 366,11527 +# define write 367,11550 +# define lseek 368,11575 +# define creat(creat369,11600 +# define stat(stat370,11676 +# define isascii(isascii373,11747 +typedef struct _ZipExtraHdr _ZipExtraHdr378,11833 +} ZIP_EXTRA_HEADER;ZIP_EXTRA_HEADER381,11957 +typedef struct _MacInfoMin _MacInfoMin383,11978 +} MACINFOMIN;MACINFOMIN393,12430 +typedef struct _MacInfo _MacInfo395,12495 +} MACINFO;MACINFO406,12991 +# define extract_or_test_files 418,13373 +# define extract_or_test_member 419,13425 +# define mkdir(mkdir424,13565 +# define EBCDIC 425,13631 +# define WSIZE 437,13766 +#define DIR_BLKSIZ 440,13917 +# define INBUFSIZ 443,14076 +# define FILNAMSIZ 456,14420 +# define FILNAMSIZ 458,14481 +# define PATH_MAX 463,14633 +# define PATH_MAX 466,14754 +# define PATH_MAX 468,14803 +#define OUTBUFSIZ 473,14907 +#define ZSUFX 475,14943 +#define CENTRAL_HDR_SIG 476,14976 +#define LOCAL_HDR_SIG 477,15053 +#define END_CENTRAL_SIG 478,15129 +#define EXTD_LOCAL_SIG 479,15207 +#define SKIP 481,15274 +#define DISPLAY 482,15348 +#define FILENAME 483,15376 +#define EXTRA_FIELD 484,15404 +#define DOES_NOT_EXIST 486,15433 +#define EXISTS_AND_OLDER 487,15506 +#define EXISTS_AND_NEWER 488,15534 +#define DOS_OS2_FAT_ 490,15563 +#define AMIGA_ 491,15636 +#define VMS_ 492,15664 +#define UNIX_ 493,15736 +#define VM_CMS_ 494,15811 +#define ATARI_ 495,15887 +#define OS2_HPFS_ 496,15936 +#define MAC_ 497,15964 +#define Z_SYSTEM_ 498,15992 +#define CPM_ 499,16020 +#define NUM_HOSTS 501,16121 +#define STORED 503,16184 +#define SHRUNK 504,16241 +#define REDUCED1 505,16269 +#define REDUCED2 506,16297 +#define REDUCED3 507,16325 +#define REDUCED4 508,16353 +#define IMPLODED 509,16381 +#define TOKENIZED 510,16409 +#define DEFLATED 511,16437 +#define NUM_METHODS 512,16465 +#define DF_MDY 515,16607 +#define DF_DMY 516,16676 +#define DF_YMD 517,16754 +#define UNZIP_VERSION 519,16831 +#define VMS_VERSION 520,16896 +#define LREC_SIZE 527,17344 +#define CREC_SIZE 528,17417 +#define ECREC_SIZE 529,17490 +#define MAX_BITS 531,17564 +#define HSIZE 532,17630 +#define LF 534,17703 +#define CR 535,17781 +#define CTRLZ 536,17859 +# define ascii_to_native(ascii_to_native539,17951 +# define NATIVE 540,17994 +# define FFLUSH 544,18039 +# define FFLUSH 546,18095 +# define ENV_UNZIP 550,18161 +# define ENV_ZIPINFO 551,18238 +# define ENV_UNZIP 553,18294 +# define ENV_ZIPINFO 554,18326 +# define PWLEN 558,18392 +# define DECRYPT(DECRYPT559,18419 +# define QCOND 563,18542 +# define QCOND 565,18669 +# define TRUE 569,18769 +# define FALSE 572,18836 +# define SEEK_SET 576,18944 +# define SEEK_CUR 577,19022 +# define SEEK_END 578,19044 +# define S_IRWXU 582,19090 +# define S_IRUSR 583,19160 +# define S_IWUSR 584,19225 +# define S_IXUSR 585,19291 +# define S_IRWXG 586,19359 +# define S_IRGRP 587,19429 +# define S_IWGRP 588,19494 +# define S_IXGRP 589,19560 +# define S_IRWXO 590,19628 +# define S_IROTH 591,19698 +# define S_IWOTH 592,19763 +# define S_IXOTH 593,19829 +# define S_IFBLK 598,20069 +# define S_IFIFO 601,20183 +# define S_IFLNK 604,20283 +# define S_IFSOCK 607,20393 +# define S_ISUID 610,20471 +# define S_ISGID 613,20567 +# define S_ISVTX 616,20664 +# define S_ENFMT 619,20765 + typedef unsigned char byte;byte632,21008 +typedef char boolean;boolean635,21106 +typedef long longint;longint636,21141 +typedef unsigned short UWORD;UWORD637,21176 +typedef unsigned long ULONG;ULONG638,21209 +typedef unsigned char uch;uch639,21242 +typedef unsigned short ush;ush640,21273 +typedef unsigned long ulg;ulg641,21304 +typedef struct min_info min_info643,21336 +} min_info;min_info654,21872 +typedef struct VMStimbuf VMStimbuf656,21885 +} VMStimbuf;VMStimbuf659,22009 + typedef byte local_byte_hdr[local_byte_hdr666,22309 +# define L_VERSION_NEEDED_TO_EXTRACT_0 667,22356 +# define L_VERSION_NEEDED_TO_EXTRACT_1 668,22406 +# define L_GENERAL_PURPOSE_BIT_FLAG 669,22456 +# define L_COMPRESSION_METHOD 670,22506 +# define L_LAST_MOD_FILE_TIME 671,22556 +# define L_LAST_MOD_FILE_DATE 672,22606 +# define L_CRC32 673,22656 +# define L_COMPRESSED_SIZE 674,22707 +# define L_UNCOMPRESSED_SIZE 675,22758 +# define L_FILENAME_LENGTH 676,22809 +# define L_EXTRA_FIELD_LENGTH 677,22860 + typedef byte cdir_byte_hdr[cdir_byte_hdr679,22912 +# define C_VERSION_MADE_BY_0 680,22958 +# define C_VERSION_MADE_BY_1 681,23008 +# define C_VERSION_NEEDED_TO_EXTRACT_0 682,23058 +# define C_VERSION_NEEDED_TO_EXTRACT_1 683,23108 +# define C_GENERAL_PURPOSE_BIT_FLAG 684,23158 +# define C_COMPRESSION_METHOD 685,23208 +# define C_LAST_MOD_FILE_TIME 686,23258 +# define C_LAST_MOD_FILE_DATE 687,23308 +# define C_CRC32 688,23359 +# define C_COMPRESSED_SIZE 689,23410 +# define C_UNCOMPRESSED_SIZE 690,23461 +# define C_FILENAME_LENGTH 691,23512 +# define C_EXTRA_FIELD_LENGTH 692,23563 +# define C_FILE_COMMENT_LENGTH 693,23614 +# define C_DISK_NUMBER_START 694,23665 +# define C_INTERNAL_FILE_ATTRIBUTES 695,23716 +# define C_EXTERNAL_FILE_ATTRIBUTES 696,23767 +# define C_RELATIVE_OFFSET_LOCAL_HEADER 697,23818 + typedef byte ec_byte_rec[ec_byte_rec699,23870 +# define NUMBER_THIS_DISK 701,23990 +# define NUM_DISK_WITH_START_CENTRAL_DIR 702,24040 +# define NUM_ENTRIES_CENTRL_DIR_THS_DISK 703,24090 +# define TOTAL_ENTRIES_CENTRAL_DIR 704,24140 +# define SIZE_CENTRAL_DIRECTORY 705,24191 +# define OFFSET_START_CENTRAL_DIRECTORY 706,24242 +# define ZIPFILE_COMMENT_LENGTH 707,24293 + typedef struct local_file_header local_file_header710,24346 + } local_file_hdr;local_file_hdr721,24737 + typedef struct central_directory_file_header central_directory_file_header723,24759 + } cdir_file_hdr;cdir_file_hdr740,25371 + typedef struct end_central_dir_record end_central_dir_record742,25392 + } ecdir_rec;ecdir_rec750,25746 +# define __ 761,25863 +# define MAX(MAX784,26512 +# define MIN(MIN788,26577 +#define LSEEK(LSEEK792,26631 +#define SKIP_(SKIP_834,28430 +#define READBIT(READBIT853,28971 +#define PEEKBIT(PEEKBIT869,29345 +#define NUKE_CRs(NUKE_CRs873,29479 +#define TOLOWER(TOLOWER896,30178 +# define ascii_to_native(ascii_to_native927,31296 +# define A_TO_N(A_TO_N928,31331 +# define NATIVE 931,31377 +# define A_TO_N(A_TO_N933,31424 + union work work964,32485 + union work work973,32665 +# define prefix_of 984,33002 +# define suffix_of 985,33044 +# define stack 986,33086 +# define slide 987,33120 + +unzip/unzip.h,1007 +#define _unz_H42,1738 +typedef struct TagunzFile__ TagunzFile__55,1995 +typedef struct TagunzFile__ { int unused; } unzFile__;unzFile__55,1995 +typedef unzFile__ *unzFile;unzFile56,2051 +typedef voidp unzFile;unzFile58,2085 +#define UNZ_OK 62,2117 +#define UNZ_END_OF_LIST_OF_FILE 63,2169 +#define UNZ_ERRNO 64,2208 +#define UNZ_EOF 65,2250 +#define UNZ_PARAMERROR 66,2286 +#define UNZ_BADZIPFILE 67,2333 +#define UNZ_INTERNALERROR 68,2380 +#define UNZ_CRCERROR 69,2427 +#define UNZ_STORED 71,2475 +#define UNZ_SHRUNK 72,2536 +#define UNZ_REDUCED1 73,2568 +#define UNZ_REDUCED2 74,2600 +#define UNZ_REDUCED3 75,2632 +#define UNZ_REDUCED4 76,2664 +#define UNZ_IMPLODED 77,2696 +#define UNZ_TOKENIZED 78,2728 +#define UNZ_DEFLATED 79,2760 +typedef struct tm_unz_s tm_unz_s82,2829 +} tm_unz;tm_unz90,3215 +typedef struct unz_global_info_sunz_global_info_s94,3344 +} unz_global_info;unz_global_info99,3558 +typedef struct unz_file_info_sunz_file_info_s103,3647 +} unz_file_info;unz_file_info122,4797 + +unzip/unzipP.h,609 +#define _UNZIPP_H_2,19 +#define local 7,73 +#define CASESENSITIVITYDEFAULT_NO15,296 +#define UNZ_BUFSIZE 20,359 +#define UNZ_MAXFILENAMEINZIP 24,424 +#define ALLOC(ALLOC28,481 +#define TRYFREE(TRYFREE31,539 +#define SIZECENTRALDIRITEM 34,584 +#define SIZEZIPLOCALHEADER 35,618 +#define SEEK_CUR 41,751 +#define SEEK_END 45,798 +#define SEEK_SET 49,845 +typedef struct unz_file_info_internal_sunz_file_info_internal_s53,951 +} unz_file_info_internal;unz_file_info_internal57,1083 +} file_in_zip_read_info_s;file_in_zip_read_info_s91,2450 +} unz_s;unz_s122,3668 + +jma/7zlzma.cpp,32 +bool decompress_lzma_7z(23,812 + +jma/crc32.cpp,81 +namespace CRC32libCRC32lib22,746 + unsigned int CRC32(CRC32lib::CRC3272,4053 + +jma/iiostrm.cpp,87 +HRESULT ISequentialInStream::Read(23,875 +HRESULT ISequentialOutStream::Write(33,1101 + +jma/inbyte.cpp,173 +namespace NStream{NStream22,852 +CInByte::CInByte(NStream::CInByte::CInByte24,872 +CInByte::~CInByte(31,1003 +void CInByte::Init(36,1053 +bool CInByte::ReadBlock(45,1239 + +jma/jma.cpp,589 +namespace JMAJMA100,3792 + time_t uint_to_time(JMA::uint_to_time109,4144 + void jma_open::retrieve_file_block(JMA::jma_open::retrieve_file_block125,4629 + jma_open::jma_open(JMA::jma_open::jma_open209,7357 + jma_open::~jma_open(JMA::jma_open::~jma_open242,8197 + vector jma_open::get_files_info(JMA::jma_open::get_files_info251,8350 + void jma_open::chunk_seek(JMA::jma_open::chunk_seek270,8923 + vector jma_open::get_all_files(JMA::jma_open::get_all_files295,9583 + void jma_open::extract_file(JMA::jma_open::extract_file414,13399 + +jma/lzma.cpp,224 +namespace NCompress NCompress22,850 +namespace NLZMA NCompress::NLZMA23,872 +static class CConstInitNCompress::NLZMA::CConstInit27,930 + CConstInit(NCompress::NLZMA::CConstInit::CConstInit30,964 +} g_ConstInit;40,1165 + +jma/lzmadec.cpp,556 +#define RETURN_E_OUTOFMEMORY_IF_FALSE(RETURN_E_OUTOFMEMORY_IF_FALSE24,932 +namespace NCompress NCompress26,1010 +namespace NLZMA NCompress::NLZMA27,1032 +HRESULT CDecoder::SetDictionarySize(NCompress::NLZMA::CDecoder::SetDictionarySize29,1051 +HRESULT CDecoder::SetLiteralProperties(44,1448 +HRESULT CDecoder::SetPosBitsProperties(55,1752 +CDecoder::CDecoder(66,2087 +HRESULT CDecoder::Create(72,2157 +HRESULT CDecoder::Init(83,2365 +HRESULT CDecoder::CodeReal(122,3225 +HRESULT CDecoder::Code(255,7814 +HRESULT CDecoder::ReadCoderProperties(266,8117 + +jma/s9x-jma.cpp,31 +size_t load_jma_file(100,3896 + +jma/winout.cpp,281 +namespace NStream NStream22,852 +namespace NWindow NStream::NWindow23,872 +void COut::Create(NStream::NWindow::COut::Create25,893 +COut::~COut(40,1381 +void COut::SetWindowSize(45,1421 +void COut::Init(51,1567 +HRESULT COut::Flush(65,1798 +void COut::MoveBlockBackward(80,2138 + +jma/7z.h,54 +#define __7Z_H21,845 +bool decompress_lzma_7z(23,861 + +jma/aribitcd.h,217 +#define __COMPRESSION_BITCODER_H2,33 +class CBitModelCBitModel18,349 + void UpdateModel(UpdateModel22,399 + void Init(Init34,802 +class CBitDecoder:CBitDecoder38,888 + UINT32 Decode(CBitDecoder::Decode41,948 + +jma/ariconst.h,187 +#define __ARICONST_H21,852 +typedef NCompression::NArithmetic::CRangeDecoder CMyRangeDecoder;CMyRangeDecoder26,898 +template class CMyBitDecoder:CMyBitDecoder27,964 + +jma/ariprice.h,38 +#define __COMPRESSION_ARIPRICE_H2,33 + +jma/btreecd.h,804 +#define __BITTREECODER_H21,856 +template CMyBitDecoder2;CMyBitDecoder231,1022 +class CDecoderCDecoder33,1088 + HRESULT Flush(Flush65,2284 + +jma/portable.h,1046 +#define __PORTABLE_H22,852 +typedef signed char INT8;INT826,895 +typedef unsigned char UINT8;UINT827,921 +typedef short INT16;INT1628,950 +typedef unsigned short UINT16;UINT1629,971 +typedef long INT32;INT3230,1002 +typedef unsigned long UINT32;UINT3231,1022 +typedef INT32 INT64;INT6432,1052 +typedef UINT32 UINT64;UINT6433,1073 +typedef UINT8 BYTE;BYTE36,1098 +typedef UINT16 WORD;WORD37,1118 +typedef UINT32 DWORD;DWORD38,1139 +typedef unsigned UINT_PTR;UINT_PTR40,1162 +typedef int BOOL;BOOL42,1190 +#define FALSE 43,1208 +#define TRUE 44,1224 +#define HRESULT 46,1240 +#define S_OK 47,1260 +#define E_INVALIDARG 48,1275 +#define E_OUTOFMEMORY 49,1299 +#define E_FAIL 50,1324 +#define E_INTERNAL_ERROR 51,1342 +#define E_INVALIDDATA 52,1370 +template inline T MyMin(54,1396 +template inline T MyMax(58,1468 +#define RETURN_IF_NOT_S_OK(RETURN_IF_NOT_S_OK62,1540 +#define UINT_SIZE 65,1644 +#define USHORT_SIZE 66,1666 +inline unsigned int charp_to_uint(69,1742 +inline unsigned short charp_to_ushort(79,2062 + +jma/rcdefs.h,190 +#define __RCDEFS_H21,850 +#define RC_INIT_VAR 26,915 +#define RC_FLUSH_VAR 30,1062 +#define RC_NORMALIZE 34,1192 +#define RC_GETBIT2(RC_GETBIT240,1482 +#define RC_GETBIT(RC_GETBIT59,2732 + +jma/rngcoder.h,364 +#define __COMPRESSION_RANGECODER_H21,866 +class CRangeDecoderCRangeDecoder31,1050 + void Normalize(Normalize38,1161 + void Init(Init47,1308 + UINT32 GetThreshold(GetThreshold56,1512 + void Decode(Decode61,1602 + UINT32 DecodeDirectBits(DecodeDirectBits88,2267 + UINT32 DecodeBit(DecodeBit120,2976 + UINT64 GetProcessedSize(GetProcessedSize139,3339 + +jma/s9x-jma.h,0 + +jma/winout.h,345 +#define __STREAM_WINDOWOUT_H21,860 +class COutCOut33,1222 + COut(COut50,1518 + UINT32 GetCurPos(GetCurPos59,1807 + const BYTE *GetPointerToCurrentPos(GetPointerToCurrentPos60,1852 + void CopyBackBlock(CopyBackBlock62,1927 + void PutOneByte(PutOneByte73,2182 + BYTE GetOneByte(GetOneByte80,2310 + BYTE *GetBuffer(GetBuffer85,2397 diff -NaHudr snes9x-1.43-src/snes9x/unix/beauty.cc snx/snes9x/unix/beauty.cc --- snes9x-1.43-src/snes9x/unix/beauty.cc 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/unix/beauty.cc 2007-09-02 00:20:11.000000000 +0300 @@ -0,0 +1,540 @@ +#include +#include +#include + +#include +#include + +#include + +#include "../gfx.h" +#include "../movie.h" +#include "../screenshot.h" +#include "../snapshot.h" +#include "../ppu.h" + +#include "beauty.hh" +#include "coroutine.h" + +typedef std::complex complex; + +int do_beauty_analysis = 0; + +/* Analyzes beauty in the given SNES screenshot. + */ + +static const unsigned short* xbuf = 0; +static unsigned width; + +static int skippattern(int p) +{ + return 1 + ((p/7)%3); +} +/* Calculate average tint in given section of the screen. */ +static complex GetAverageTint(int x0,int y0, int x1,int y1) +{ + double avg_i = 0, avg_q = 0, avg_y = 0; + double count = 0; + + for(int y=y0; y<=y1; y+=skippattern(x0+y)) + for(int x=x0; x<=x1; x+=skippattern(y+x)) + { + unsigned short pix = xbuf[x + y * width]; + unsigned rr = (pix>>11)&31; + unsigned gg = (pix>>5)&63; + unsigned bb = pix&31; + + double r = rr / 31.0; + double g = gg / 63.0; + double b = bb / 31.0; + + double y = 0.299 * r + 0.587 * g + 0.114 * b; + double i = 0.5957 * r - 0.2744 * g - 0.3212 * b; + double q = 0.2114 * r - 0.5226 * g + 0.3111 * b; + + double pow = 1; + + avg_i += i*y; + avg_q += q*y; + avg_y += y; + + count += pow; + } + + avg_i /= count; + avg_q /= count; + avg_y /= count; + + complex res(avg_i, avg_q); res *= 100; + + double y = std::abs(res); + if(y >= 0.0) res *= std::log(1 + y) / (1 + y); + return res; + + //return complex ( atan2(avg_i, avg_q) , std::log(1 + avg_y)); +} + +struct region +{ + int x0,x1, y0,y1; + + complex tint; + + int sprite_jitter; +}; +static bool SOBJcompare(const SOBJ& a, const SOBJ& b) +{ + return std::memcmp(&a, &b, sizeof(a)) < 0; +} +static double CalculateBeauty(unsigned w,unsigned h) +{ + std::vector regions; + regions.reserve(4*3); + for(unsigned x=0; x<4; ++x) + for(unsigned y=0; y<3; ++y) + { + region tmp; + tmp.tint=0; + tmp.sprite_jitter=0; + tmp.x0 = x*w/4; + tmp.x1 = (x+1)*w/4; + tmp.y0 = y*h/3; + tmp.y1 = (y+1)*h/3; + regions.push_back(tmp); + } +/* + regions[5] = + { + // corners: nw, ne, sw, se, middle + { w*0 /99,w*50/99, h*0 /99,h*50/99, 0, 0 }, + { w*50/99,w*99/99, h*0 /99,h*50/99, 0, 0 }, + { w*0 /99,w*50/99, h*50/99,h*99/99, 0, 0 }, + { w*50/99,w*99/99, h*50/99,h*99/99, 0, 0 }, + { w*33/99,w*55/99, h*33/99,h*55/99, 0, 0 } + }; +*/ + + static SOBJ old_sprites[128]; + SOBJ new_sprites[128]; + std::memcpy(&new_sprites, PPU.OBJ, sizeof(new_sprites)); + + std::sort(new_sprites, new_sprites+128, SOBJcompare); + + for(unsigned b=0; b<128; ++b) + { + SOBJ& spr = new_sprites[b]; + SOBJ& old = old_sprites[b]; + + /* If the sprite appears to have moved, compensate for scrolling and try again */ + if(spr.HPos != old.HPos || spr.VPos != old.VPos) + { + //spr.x -= ScrollPointers[spr.y]; + //spr.y -= VScroll; + } + + if(std::memcmp(&spr, &old, sizeof(spr)) != 0) + { + old = spr; + + int x = spr.HPos, y = spr.VPos & 0xFF; + + if(x == -256) x = 256; + if(x <= - GFX.OBJWidths[b] || x > 256) continue; + if(y >= 239) continue; + + int width=8, height=8; + switch(PPU.OBJSizeSelect) + { + case 0: width=height= (spr.Size ? 16 : 8); break; + case 1: width=height= (spr.Size ? 32 : 8); break; + case 2: width=height= (spr.Size ? 64 : 8); break; + case 3: width=height= (spr.Size ? 32 :16); break; + case 4: width=height= (spr.Size ? 64 :16); break; + default: + case 5: width=height= (spr.Size ? 64 :32); break; + case 6: width= (spr.Size ? 32 :16); + height= (spr.Size ? 64 :32); break; + case 7: width= (spr.Size ? 32 :16); + height= (spr.Size ? 32 :32); break; + } + + for(unsigned a=0; a< regions.size(); ++a) + { + /* Check if this sprite affects this region */ + region& reg = regions[a]; + + if(x+width >= reg.x0 && x < reg.x1 + && y+height >= reg.y0 && y < reg.y1) + { + reg.sprite_jitter += 1; + if(spr.HPos != old.HPos || spr.VPos != old.VPos) + reg.sprite_jitter += 2; + } + } + } + } + + double totaltint = 0; + for(unsigned a=0; a< regions.size(); ++a) + { + region& reg = regions[a]; + reg.tint = GetAverageTint(reg.x0, reg.y0, reg.x1, reg.y1); + totaltint += std::abs(reg.tint); + } + totaltint /= regions.size(); + + /* + PLAN + + Analyze five sections of this screen. + + - Each four quarters of the screen + - And the middle (slightly larger than a quarter?) + + Analyze: + - Average tint + - Amount of motion (ignore global motion) + + Value: + - Non-bleak tints + - Different tint in each section of screen + - Motion appears in at least two different sections of screen + + */ + + if(do_beauty_analysis >= 3) + { + fprintf(stderr, "analysis: "); + for(unsigned a=0; a< regions.size(); ++a) + { + region& reg = regions[a]; + fprintf(stderr, "(%3.1f<%+3.1f)(%2d) ", + std::abs(reg.tint), + std::arg(reg.tint), + reg.sprite_jitter); + } + fprintf(stderr, "\n"); + } + +/* + complex t = regions[0].tint + regions[1].tint + regions[2].tint + regions[3].tint; + t /= 4; +*/ + + double interestingness = 0; + + if(totaltint >= 0.1) + { + for(unsigned a=0; a Data; + + void Create() + { + FILE*fp = tmpfile(); + fflush(fp); + { + int d = dup(fileno(fp)); + lseek(d, 0, SEEK_SET); + STREAM tmp = REOPEN_STREAM(d, "wb"); + S9xFreezeToStream(tmp); + CLOSE_STREAM(tmp); + } + rewind(fp); + + fseek(fp,0,SEEK_END); + long pos = ftell(fp); + fprintf(stderr, "savestate %ld bytes\n", pos); + fflush(stderr); + rewind(fp); + + SaveState result; + Data.resize(pos); + fread(&Data[0], 1, pos, fp); + fclose(fp); + } + void Load() + { + FILE*fp = tmpfile(); + fwrite(&Data[0], 1, Data.size(), fp); + fflush(fp); + rewind(fp); + int d = dup(fileno(fp)); + fclose(fp); + + lseek(d, 0, SEEK_SET); + STREAM tmp = REOPEN_STREAM(d, "rb"); + int i = S9xUnfreezeFromStream(tmp); + fprintf(stderr, "Unfreeze: %d\n", i); fflush(stderr); + CLOSE_STREAM(tmp); + } +}; + +static std::vector interestingness_map; +static std::map some_savestates; +static std::vector review_results; + +static bool LocateBeauty(unsigned frameno) +{ + scrBegin; + if(true) /* scope */ + { + std::map::iterator + i = some_savestates.lower_bound(frameno); + + for(;;) + { + if(i != some_savestates.end()) + { + if(i->first <= frameno) + { + unsigned framecount = S9xMovieGetFrameCounter(); + + if(framecount > frameno || i->first > framecount) + { + fprintf(stderr, "Aiming for frame %u, loading one that gives %u hopefully\n", + frameno, i->first); + i->second.Load(); + } + else + { + fprintf(stderr, "Aiming for frame %u. Playing from %d\n", + frameno, framecount); + } + + fflush(stderr); + break; + } + } + if(i == some_savestates.begin()) break; + --i; + } + } + + while(S9xMovieGetFrameCounter() < frameno) + { + // fprintf(stderr, "Frame %u\n", S9xMovieGetFrameCounter()); + // fflush(stderr); + // Settings.FrameAdvance = 1; + scrReturn(false); + } + scrFinish(true); +} + +extern "C" void CloseStuff(int signum); + +#include +static void CreatePNG(const char* beauty_fn) +{ + FILE*fp = fopen(beauty_fn, "wb"); + if(!fp) { perror(beauty_fn); return; } + + unsigned width=256, height=224; + + // xbuf, width, height + gdImagePtr im = gdImageCreateTrueColor(width,height); + for(unsigned y=0; y>11)&31)*256/32; + unsigned gg = ((pix>>5)&63)*256/64; + unsigned bb = (pix&31)*256/32; + gdImageSetPixel(im, x,y, (rr<<16)|(gg<<8)|(bb<<0)); + } + + gdImagePng(im, fp); + gdImageDestroy(im); + fclose(fp); +} + +static void CaptureBeauty() +{ + scrBegin; + static unsigned a; + for(a = 0; a < review_results.size(); ++a) + { + fprintf(stderr, "Capturing beauty %u at frame %u\n", a, review_results[a]); + fflush(stderr); + + while(!LocateBeauty(review_results[a]-1)) + { + scrReturnV; + } + + /* capture it */ + + char beauty_fn[64]; + sprintf(beauty_fn, "beauty_%u.png", a); + fprintf(stderr, "- Capturing %s, have frame %u now\n", beauty_fn, + S9xMovieGetFrameCounter()); + fflush(stderr); + + CreatePNG(beauty_fn); + } + + /* all beauties have been analyzed, end stuff now */ + fprintf(stderr, "Done with all beauties\n"); + + S9xExit(); + scrFinishV; +} + +struct section + { unsigned sect; double value; + bool operator< (const section& sect) const + { return value > sect.value; } + bool operator== (const section& sect) const + { return value == sect.value; } + }; + + +static void ReviewBeauty() +{ + const unsigned framecount = S9xMovieGetFrameCounter(); + const unsigned num_sections = 20;std::max( + std::min(50, (int)(framecount / 60)), + // not more than 50 + // not more than one per each second of movie + (int)(framecount / 600) + // but still at least one per each 10 seconds of movie + ); + const unsigned num_results = 20;std::min( + std::min(20, (int)( framecount / (3600/5) ) ), + // not more than 15 + // not more than 5 per each minute of movie + (int)(num_sections)); + + std::vector
sects(num_sections); + + for(unsigned a=0; a sects[sect].value) sects[sect].value = val; + } + + std::sort(sects.begin(), sects.end()); + + for(unsigned a=0; a= 2) + { + std::printf( + "Beauty %u: %g\n", framecount, interestingness); + std::fflush(stdout); + } + + if(interestingness_map.size() <= framecount) + interestingness_map.resize(framecount+1); + interestingness_map[framecount] = interestingness; + + static unsigned maxframe = ~0; + if(maxframe == (unsigned)~0) + { + const char* env = getenv("MAXFRAMES"); + maxframe = env ? atoi(env) : 0; + } + + finished_recording = framecount == maxframe-2; + + if(!finished_recording) + { + return; + } + + //Settings.Paused = 1; + } +} + +void Beauty_INPUT() +{ + if(!do_beauty_analysis) return; + + if(!finished_recording) /* Record interestingness */ + { + static unsigned lastcount=0; + const unsigned framecount = S9xMovieGetFrameCounter(); + if(framecount != 0 && (framecount == 1 || !(framecount % 100)) + && framecount != lastcount) + { + fprintf(stderr, "Creating savestate @ %u\n", framecount); + fflush(stderr); + some_savestates[framecount].Create(); + lastcount = framecount; + } + return; + } + + /* Analyze interestingness */ + if(review_results.empty()) + ReviewBeauty(); + + CaptureBeauty(); +} diff -NaHudr snes9x-1.43-src/snes9x/unix/beauty.hh snx/snes9x/unix/beauty.hh --- snes9x-1.43-src/snes9x/unix/beauty.hh 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/unix/beauty.hh 2008-02-18 22:45:39.548160000 +0200 @@ -0,0 +1,3 @@ +extern int do_beauty_analysis; +extern void Beauty_VIS(const unsigned short* Xbuf, unsigned w, unsigned h); +extern void Beauty_INPUT(); diff -NaHudr snes9x-1.43-src/snes9x/unix/coroutine.h snx/snes9x/unix/coroutine.h --- snes9x-1.43-src/snes9x/unix/coroutine.h 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/unix/coroutine.h 2007-11-23 10:24:25.046571000 +0200 @@ -0,0 +1,249 @@ +/* coroutine.h + * + * Coroutine mechanics, implemented on top of standard ANSI C. See + * http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html for + * a full discussion of the theory behind this. + * + * To use these macros to define a coroutine, you need to write a + * function that looks something like this. + * + * [Simple version using static variables (scr macros)] + * int ascending (void) { + * static int i; + * + * scrBegin; + * for (i=0; i<10; i++) { + * scrReturn(i); + * } + * scrFinish(-1); + * } + * + * [Re-entrant version using an explicit context structure (ccr macros)] + * int ascending (ccrContParam) { + * ccrBeginContext; + * int i; + * ccrEndContext(foo); + * + * ccrBegin(foo); + * for (foo->i=0; foo->i<10; foo->i++) { + * ccrReturn(foo->i); + * } + * ccrFinish(-1); + * } + * + * In the static version, you need only surround the function body + * with `scrBegin' and `scrFinish', and then you can do `scrReturn' + * within the function and on the next call control will resume + * just after the scrReturn statement. Any local variables you need + * to be persistent across an `scrReturn' must be declared static. + * + * In the re-entrant version, you need to declare your persistent + * variables between `ccrBeginContext' and `ccrEndContext'. These + * will be members of a structure whose name you specify in the + * parameter to `ccrEndContext'. + * + * The re-entrant macros will malloc() the state structure on first + * call, and free() it when `ccrFinish' is reached. If you want to + * abort in the middle, you can use `ccrStop' to free the state + * structure immediately (equivalent to an explicit return() in a + * caller-type routine). + * + * A coroutine returning void type may call `ccrReturnV', + * `ccrFinishV' and `ccrStopV', or `scrReturnV', to avoid having to + * specify an empty parameter to the ordinary return macros. + * + * Ground rules: + * - never put `ccrReturn' or `scrReturn' within an explicit `switch'. + * - never put two `ccrReturn' or `scrReturn' statements on the same + * source line. + * + * The caller of a static coroutine calls it just as if it were an + * ordinary function: + * + * void main(void) { + * int i; + * do { + * i = ascending(); + * printf("got number %d\n", i); + * } while (i != -1); + * } + * + * The caller of a re-entrant coroutine must provide a context + * variable: + * + * void main(void) { + * ccrContext z = 0; + * do { + * printf("got number %d\n", ascending (&z)); + * } while (z); + * } + * + * Note that the context variable is set back to zero when the + * coroutine terminates (by crStop, or by control reaching + * crFinish). This can make the re-entrant coroutines more useful + * than the static ones, because you can tell when they have + * finished. + * + * If you need to dispose of a crContext when it is non-zero (that + * is, if you want to stop calling a coroutine without suffering a + * memory leak), the caller should call `ccrAbort(ctx)' where `ctx' + * is the context variable. + * + * This mechanism could have been better implemented using GNU C + * and its ability to store pointers to labels, but sadly this is + * not part of the ANSI C standard and so the mechanism is done by + * case statements instead. That's why you can't put a crReturn() + * inside a switch() statement. + */ + +/* + * coroutine.h is copyright 1995,2000 Simon Tatham. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $Id: coroutine.h 6386 2005-10-12 09:13:42Z simon $ + */ + +#ifndef COROUTINE_H +#define COROUTINE_H + +//#include + +#ifdef __GNUC__ +//# define COROUTINES_USE_LABELGOTO +#endif + +/* + * `scr' macros for static coroutines. + */ + +/* 0 is faster, but 1 enables debugging */ + +#ifdef __cplusplus +# define scrPreamble try { +# define scrPostmble } catch(...) { scrLine=0; throw; } +# define ccrAlloc(x) new ccrContextTag +# define ccrFree(p) delete p +# define ccrPreamble try { +# define ccrPostmble } catch(...) { ccrFree( (ccrContextTag*) ccrParam); *ccrParam=0; throw; } +#else +# define scrPreamble +# define scrPostmble +# define ccrAlloc(x) malloc(sizeof(*x)) +# define ccrFree(p) free(p) +# define ccrPreamble +# define ccrPostmble +#endif + +#ifndef COROUTINES_USE_LABELGOTO + +/* debugging compatible, but allows only one scrReturn per line */ + +#define scrBegin static int scrLine = 0; scrPreamble switch(scrLine) { case 0:; +#define scrFinish(z) } scrPostmble scrLine=0; return (z) +#define scrFinishV } scrPostmble scrLine=0; return + +#define scrReturnCode(code) \ + do {\ + scrLine=__LINE__;\ + code; case __LINE__:;\ + } while (0) +#define scrCallBegin() do { scrLine=__LINE__;case __LINE__:; } while(0) + +#else + +/* faster, gcc-only */ + +#define scrBegin static void*scrLabel=0; scrPreamble \ + {if(scrLabel)goto *scrLabel;} +#define scrFinish(z) scrPostmble scrLabel=0; return (z) +#define scrFinishV scrPostmble scrLabel=0; return + +#define scrReturnCode(code) \ + do { __label__ scrAnchor; scrLabel = &&scrAnchor; \ + code; scrAnchor: ; } while(0) + +#define scrCallBegin() do { __label__ scrAnchor; scrLabel = &&scrAnchor; scrAnchor: ; } while(0) + +#endif + +#define scrReturn(z) scrReturnCode(return(z)) +#define scrReturnV scrReturnCode(return) +/* NOTE: scrThrow does not work together with scrPreamble+scrPostmble! */ +#define scrThrow(z) scrReturnCode(throw z) + + +/* + * `ccr' macros for re-entrant coroutines. + */ + +#define ccrContParam void **ccrParam + +#ifndef COROUTINES_USE_LABELGOTO + +/* debugging compatible, but allows only one ccrReturn per line */ + +#define ccrBeginContext struct ccrContextTag { int ccrLine +#define ccrEndContext(x) } *x = (ccrContextTag*)*ccrParam + +#define ccrBegin(x) if(!x) {x=ccrAlloc(x); *ccrParam=(void*)x; x->ccrLine=0;}\ + ccrPreamble if (x) switch(x->ccrLine) { case 0:; + +#define ccrReturnCode(code) \ + do {\ + ((struct ccrContextTag *)*ccrParam)->ccrLine=__LINE__;\ + code; case __LINE__:;\ + } while (0) +#else + +/* faster, gcc-only */ + +#define ccrBeginContext struct ccrContextTag { void* ccrLabel +#define ccrEndContext(x) } *x = (ccrContextTag*)*ccrParam + +#define ccrBegin(x) if(!x) {x=ccrAlloc(x); *ccrParam=(void*)x; x->ccrLabel=0;}\ + ccrPreamble if (x && x->ccrLabel) goto* x->ccrLabel; + +#define ccrReturnCode(code) \ + do {\ + __label__ ccrAnchor; \ + ((struct ccrContextTag *)*ccrParam)->ccrLabel=&&ccrAnchor; \ + code; ccrAnchor:; \ + } while (0) + +#endif + +#define ccrReturn(z) ccrReturnCode(return z) +#define ccrReturnV ccrReturnCode(return) +/* NOTE: ccrThrow does not work together with ccrPreamble+ccrPostmble! */ +#define ccrThrow(z) ccrReturnCode(throw z) + +#define ccrFinish(z) } ccrPostmble ccrFree( (ccrContextTag*) *ccrParam); *ccrParam=0; return (z) +#define ccrFinishV } ccrPostmble ccrFree( (ccrContextTag*) *ccrParam); *ccrParam=0; return + +#define ccrStop(z) do{ ccrFree( (ccrContextTag*) *ccrParam); *ccrParam=0; return (z); }while(0) +#define ccrStopV do{ ccrFree( (ccrContextTag*) *ccrParam); *ccrParam=0; return; }while(0) + +#define ccrContext void * +#define ccrAbort(ctx) do { ccrFree (/*FIXME,type?*/ctx); ctx = 0; } while (0) + +#endif /* COROUTINE_H */ diff -NaHudr snes9x-1.43-src/snes9x/unix/crc32.c snx/snes9x/unix/crc32.c --- snes9x-1.43-src/snes9x/unix/crc32.c 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/unix/crc32.c 2005-09-04 22:01:39.000000000 +0300 @@ -0,0 +1,311 @@ +/* crc32.c -- compute the CRC-32 of a data stream + * Copyright (C) 1995-2003 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + * + * Thanks to Rodney Brown for his contribution of faster + * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing + * tables for updating the shift register in one step with three exclusive-ors + * instead of four steps with four exclusive-ors. This results about a factor + * of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3. + */ + +/* @(#) $Id$ */ + +#ifdef MAKECRCH +# include +# ifndef DYNAMIC_CRC_TABLE +# define DYNAMIC_CRC_TABLE +# endif /* !DYNAMIC_CRC_TABLE */ +#endif /* MAKECRCH */ + +//#include "zutil.h" /* for STDC and FAR definitions */ + +#define local static + +/* Find a four-byte integer type for crc32_little() and crc32_big(). */ +#ifndef NOBYFOUR +# ifdef STDC /* need ANSI C limits.h to determine sizes */ +# include +# define BYFOUR +# if (UINT_MAX == 0xffffffffUL) + typedef unsigned int u4; +# else +# if (ULONG_MAX == 0xffffffffUL) + typedef unsigned long u4; +# else +# if (USHRT_MAX == 0xffffffffUL) + typedef unsigned short u4; +# else +# undef BYFOUR /* can't find a four-byte integer type! */ +# endif +# endif +# endif +# endif /* STDC */ +#endif /* !NOBYFOUR */ + +/* Definitions for doing the crc four data bytes at a time. */ +#ifdef BYFOUR +# define REV(w) (((w)>>24)+(((w)>>8)&0xff00)+ \ + (((w)&0xff00)<<8)+(((w)&0xff)<<24)) + local unsigned long crc32_little OF((unsigned long, + const unsigned char FAR *, unsigned)); + local unsigned long crc32_big OF((unsigned long, + const unsigned char FAR *, unsigned)); +# define TBLS 8 +#else +# define TBLS 1 +#endif /* BYFOUR */ + +#ifdef DYNAMIC_CRC_TABLE + +local int crc_table_empty = 1; +local unsigned long FAR crc_table[TBLS][256]; +local void make_crc_table OF((void)); +#ifdef MAKECRCH + local void write_table OF((FILE *, const unsigned long FAR *)); +#endif /* MAKECRCH */ + +/* + Generate tables for a byte-wise 32-bit CRC calculation on the polynomial: + x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. + + Polynomials over GF(2) are represented in binary, one bit per coefficient, + with the lowest powers in the most significant bit. Then adding polynomials + is just exclusive-or, and multiplying a polynomial by x is a right shift by + one. If we call the above polynomial p, and represent a byte as the + polynomial q, also with the lowest power in the most significant bit (so the + byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, + where a mod b means the remainder after dividing a by b. + + This calculation is done using the shift-register method of multiplying and + taking the remainder. The register is initialized to zero, and for each + incoming bit, x^32 is added mod p to the register if the bit is a one (where + x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by + x (which is shifting right by one and adding x^32 mod p if the bit shifted + out is a one). We start with the highest power (least significant bit) of + q and repeat for all eight bits of q. + + The first table is simply the CRC of all possible eight bit values. This is + all the information needed to generate CRCs on data a byte at a time for all + combinations of CRC register values and incoming bytes. The remaining tables + allow for word-at-a-time CRC calculation for both big-endian and little- + endian machines, where a word is four bytes. +*/ +local void make_crc_table() +{ + unsigned long c; + int n, k; + unsigned long poly; /* polynomial exclusive-or pattern */ + /* terms of polynomial defining this crc (except x^32): */ + static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; + + /* make exclusive-or pattern from polynomial (0xedb88320UL) */ + poly = 0UL; + for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++) + poly |= 1UL << (31 - p[n]); + + /* generate a crc for every 8-bit value */ + for (n = 0; n < 256; n++) { + c = (unsigned long)n; + for (k = 0; k < 8; k++) + c = c & 1 ? poly ^ (c >> 1) : c >> 1; + crc_table[0][n] = c; + } + +#ifdef BYFOUR + /* generate crc for each value followed by one, two, and three zeros, and + then the byte reversal of those as well as the first table */ + for (n = 0; n < 256; n++) { + c = crc_table[0][n]; + crc_table[4][n] = REV(c); + for (k = 1; k < 4; k++) { + c = crc_table[0][c & 0xff] ^ (c >> 8); + crc_table[k][n] = c; + crc_table[k + 4][n] = REV(c); + } + } +#endif /* BYFOUR */ + + crc_table_empty = 0; + +#ifdef MAKECRCH + /* write out CRC tables to crc32.h */ + { + FILE *out; + + out = fopen("crc32.h", "w"); + if (out == NULL) return; + fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n"); + fprintf(out, " * Generated automatically by crc32.c\n */\n\n"); + fprintf(out, "local const unsigned long FAR "); + fprintf(out, "crc_table[TBLS][256] =\n{\n {\n"); + write_table(out, crc_table[0]); +# ifdef BYFOUR + fprintf(out, "#ifdef BYFOUR\n"); + for (k = 1; k < 8; k++) { + fprintf(out, " },\n {\n"); + write_table(out, crc_table[k]); + } + fprintf(out, "#endif\n"); +# endif /* BYFOUR */ + fprintf(out, " }\n};\n"); + fclose(out); + } +#endif /* MAKECRCH */ +} + +#ifdef MAKECRCH +local void write_table(out, table) + FILE *out; + const unsigned long FAR *table; +{ + int n; + + for (n = 0; n < 256; n++) + fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ", table[n], + n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", ")); +} +#endif /* MAKECRCH */ + +#else /* !DYNAMIC_CRC_TABLE */ +/* ======================================================================== + * Tables of CRC-32s of all single-byte values, made by make_crc_table(). + */ +#include "crc32.h" +#endif /* DYNAMIC_CRC_TABLE */ + +/* ========================================================================= + * This function can be used by asm versions of crc32() + */ +const unsigned long FAR * ZEXPORT get_crc_table() +{ +#ifdef DYNAMIC_CRC_TABLE + if (crc_table_empty) make_crc_table(); +#endif /* DYNAMIC_CRC_TABLE */ + return (const unsigned long FAR *)crc_table; +} + +/* ========================================================================= */ +#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8) +#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1 + +/* ========================================================================= */ +unsigned long ZEXPORT crc32(crc, buf, len) + unsigned long crc; + const unsigned char FAR *buf; + unsigned len; +{ + if (buf == Z_NULL) return 0UL; + +#ifdef DYNAMIC_CRC_TABLE + if (crc_table_empty) + make_crc_table(); +#endif /* DYNAMIC_CRC_TABLE */ + +#ifdef BYFOUR + if (sizeof(void *) == sizeof(ptrdiff_t)) { + u4 endian; + + endian = 1; + if (*((unsigned char *)(&endian))) + return crc32_little(crc, buf, len); + else + return crc32_big(crc, buf, len); + } +#endif /* BYFOUR */ + crc = crc ^ 0xffffffffUL; + while (len >= 8) { + DO8; + len -= 8; + } + if (len) do { + DO1; + } while (--len); + return crc ^ 0xffffffffUL; +} + +#ifdef BYFOUR + +/* ========================================================================= */ +#define DOLIT4 c ^= *buf4++; \ + c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \ + crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24] +#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4 + +/* ========================================================================= */ +local unsigned long crc32_little(crc, buf, len) + unsigned long crc; + const unsigned char FAR *buf; + unsigned len; +{ + register u4 c; + register const u4 FAR *buf4; + + c = (u4)crc; + c = ~c; + while (len && ((ptrdiff_t)buf & 3)) { + c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); + len--; + } + + buf4 = (const u4 FAR *)buf; + while (len >= 32) { + DOLIT32; + len -= 32; + } + while (len >= 4) { + DOLIT4; + len -= 4; + } + buf = (const unsigned char FAR *)buf4; + + if (len) do { + c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); + } while (--len); + c = ~c; + return (unsigned long)c; +} + +/* ========================================================================= */ +#define DOBIG4 c ^= *++buf4; \ + c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \ + crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24] +#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4 + +/* ========================================================================= */ +local unsigned long crc32_big(crc, buf, len) + unsigned long crc; + const unsigned char FAR *buf; + unsigned len; +{ + register u4 c; + register const u4 FAR *buf4; + + c = REV((u4)crc); + c = ~c; + while (len && ((ptrdiff_t)buf & 3)) { + c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); + len--; + } + + buf4 = (const u4 FAR *)buf; + buf4--; + while (len >= 32) { + DOBIG32; + len -= 32; + } + while (len >= 4) { + DOBIG4; + len -= 4; + } + buf4++; + buf = (const unsigned char FAR *)buf4; + + if (len) do { + c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); + } while (--len); + c = ~c; + return (unsigned long)(REV(c)); +} + +#endif /* BYFOUR */ diff -NaHudr snes9x-1.43-src/snes9x/unix/hash.hh snx/snes9x/unix/hash.hh --- snes9x-1.43-src/snes9x/unix/hash.hh 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/unix/hash.hh 2008-01-18 18:30:42.763871000 +0200 @@ -0,0 +1,112 @@ +#ifndef bqtHashHH +#define bqtHashHH + +/* Set to 0 if you have compilation problems + * with hash_set or hash_map + */ +#ifndef USE_HASHMAP +#define USE_HASHMAP 1 +#endif + + +#if USE_HASHMAP + +#include +#include + +#include +#include +using namespace __gnu_cxx; + +using std::basic_string; + +struct BitSwapHashFon +{ + size_t operator() (unsigned n) const + { + unsigned rot = n&31; + return (n << rot) | (n >> (32-rot)); + } +}; + +namespace __gnu_cxx +{ + template + struct hash > + { + size_t operator() (const basic_string &s) const + { + unsigned h=0; + for(unsigned a=0,b=s.size(); a struct hash + { + size_t operator() (const std::wstring &s) const + { + unsigned h=0; + for(unsigned a=0,b=s.size(); a struct hash + { + size_t operator() (wchar_t n) const + { + /* Since values of n<128 are the most common, + * values of n<256 the second common + * and big values of n are rare, we rotate some + * bits to make the distribution more even. + * Multiplying n by 33818641 (a prime near 2^32/127) scales + * the numbers nicely to fit the whole range and keeps the + * distribution about even. + */ + return (n * 33818641UL); + } + }; + template<> struct hash + { + size_t operator() (unsigned long long n) const + { + return (n * 33818641UL); + } + }; + + template struct hash > + { + size_t operator() (const std::pair& p) const + { + return hash() (p.first) + ^ hash() (p.second); + } + }; +} + +#else + +#include +#include + +#define hash_map std::map +#define hash_multimap std::multimap +#define hash_set std::set +#define hash_multiset std::multiset + +#endif // USE_HASHMAP + +#endif // bqtHashHH diff -NaHudr snes9x-1.43-src/snes9x/unix/nesvideos-piece.cc snx/snes9x/unix/nesvideos-piece.cc --- snes9x-1.43-src/snes9x/unix/nesvideos-piece.cc 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/unix/nesvideos-piece.cc 2008-02-18 22:56:18.990892000 +0200 @@ -0,0 +1,870 @@ +#define THREAD_SAFETY + +#include +#include +#include +#include +#include +#include + +#include // mknod, unlink, write +#include +#include // S_IFIFO +#include // fcntl +#include // poll +#include // setenv +#include // strrchr +#include +#include + +#include + +#ifdef THREAD_SAFETY +# include +#endif + +/* Note: This module assumes everyone uses BGR16 as display depth */ + +//#define LOGO_LENGTH_HEADER (1.2) +//#define LOGO_LENGTH_OVERLAP (10.0-LOGO_LENGTH_HEADER) +//#define LOGO_LENGTH_HEADER (1.1) +#define LOGO_LENGTH_OVERLAP (6.3-LOGO_LENGTH_HEADER) +//#define LOGO_LENGTH_HEADER (1.4) +//#define LOGO_LENGTH_OVERLAP (0) +#define LOGO_LENGTH_HEADER (0) + +static std::string VIDEO_CMD = ""; +/* +-rawvideo on:fps=60:format=0x42475220:w=256:h=224:size=$[1024*224] +-audiofile "+AUDIO_FN+" +*/ +static std::string AUDIO_FN = "s.log"; + +static bool Terminate=false; +static unsigned videonumber = 0; + +#ifdef THREAD_SAFETY +static pthread_mutex_t APIlock = PTHREAD_MUTEX_INITIALIZER; +#endif + +static unsigned NonblockWrite(FILE* fp, const unsigned char*buf, unsigned length) +{ + Retry: + int result = write(fileno(fp), buf, length); + if(result == -1 && errno==EAGAIN) + { + return 0; + } + if(result == -1 && errno==EINTR) goto Retry; + if(result == -1) + { + perror("write"); + Terminate=true; + return 0; + } + return result; +} +static int WaitUntilOneIsWritable(FILE*f1, FILE*f2) +{ + struct pollfd po[2] = { {fileno(f1),POLLOUT,0}, {fileno(f2),POLLOUT,0} }; + poll(po, 2, -1); + return ((po[0].revents & POLLOUT) ? 1 : 0) + | ((po[1].revents & POLLOUT) ? 2 : 0); +} + +#define BGR32 0x42475220 // BGR32 fourcc +#define BGR24 0x42475218 // BGR24 fourcc +#define BGR16 0x42475210 // BGR16 fourcc +#define BGR15 0x4247520F // BGR15 fourcc +#define I420 0x30323449 // I420 fourcc + +static unsigned USE_FOURCC = BGR16; +static unsigned INPUT_BPP = 16; + +#define u32(n) (n)&255,((n)>>8)&255,((n)>>16)&255,((n)>>24)&255 +#define u16(n) (n)&255,((n)>>8)&255 +#define s4(s) s[0],s[1],s[2],s[3] + +static const unsigned FPS_SCALE = 0x1000000; + +static struct Construct +{ + Construct() + { + char Buf[4096]; + getcwd(Buf,sizeof(Buf)); + Buf[sizeof(Buf)-1]=0; + AUDIO_FN = Buf + std::string("/") + AUDIO_FN; + } +} Construct; + +class AVI +{ + FILE* vidfp; + FILE* audfp; + + bool KnowVideo; + unsigned vid_width; + unsigned vid_height; + unsigned vid_fps_scaled; + std::list > VideoBuffer; + unsigned VidBufSize; + + bool KnowAudio; + unsigned aud_rate; + unsigned aud_chans; + unsigned aud_bits; + std::list > AudioBuffer; + unsigned AudBufSize; + +public: + AVI() : + vidfp(NULL), + audfp(NULL), + KnowVideo(false), VidBufSize(0), + KnowAudio(false), AudBufSize(0) + { + } + ~AVI() + { + while(VidBufSize && AudBufSize) + { + CheckFlushing(); + } + if(audfp) fclose(audfp); + if(vidfp) pclose(vidfp); + unlink(AUDIO_FN.c_str()); + } + + void Audio(unsigned r,unsigned b,unsigned c, + const unsigned char*d, unsigned nsamples) + { + if(Terminate) return; + if(!KnowAudio) + { + aud_rate = r; + aud_chans = c; + aud_bits = b; + KnowAudio = true; + } + CheckFlushing(); + + unsigned bytes = nsamples * aud_chans * (aud_bits / 8); + + unsigned wrote = 0; + if(KnowVideo && AudioBuffer.empty()) + { + //fprintf(stderr, "Writing %u of %s from %p to %p\t", bytes, "aud", (void*)d, (void*)audfp); + wrote = NonblockWrite(audfp, d, bytes); + //fprintf(stderr, "Wrote %u\n", wrote); + } + if(wrote < bytes) + { + unsigned remain = bytes-wrote; + //fprintf(stderr, "Buffering %u of %s (%p..%p)\n", remain, "aud", d+wrote, d+bytes); + AudioBuffer.push_back(std::vector(d+wrote, d+bytes)); + AudBufSize += remain; + } + CheckFlushing(); + } + void Video(unsigned w,unsigned h,unsigned f, const unsigned char*d) + { + if(Terminate) return; + if(!KnowVideo) + { + vid_width = w; + vid_height = h; + vid_fps_scaled = f; + KnowVideo = true; + } + CheckFlushing(); + + unsigned bpp = INPUT_BPP; if(bpp == 15) bpp = 16; + unsigned bytes = vid_width * vid_height * bpp / 8; + + //std::vector tmp(bytes, 'k'); + //d = &tmp[0]; + + unsigned wrote = 0; + if(KnowAudio && VideoBuffer.empty()) + { + CheckBegin(); + //fprintf(stderr, "Writing %u of %s from %p to %p\t", bytes, "vid", (void*)d, (void*)vidfp); + wrote = NonblockWrite(vidfp, d, bytes); + //fprintf(stderr, "Wrote %u\n", wrote); + } + + if(wrote < bytes) + { + unsigned remain = bytes-wrote; + //fprintf(stderr, "Buffering %u of %s (%p..%p)\n", remain, "vid", d+wrote, d+bytes); + + VideoBuffer.push_back(std::vector(d+wrote, d+bytes)); + VidBufSize += remain; + } + CheckFlushing(); + } + +private: + /* fp is passed as a reference because it may be NULL + * prior to calling, and this function changes it. */ + template + void FlushBufferSome(BufType& List, unsigned& Size, FILE*& fp, const char* what) + { + what=what; + + Retry: + if(List.empty() || Terminate) return; + + typename BufType::iterator i = List.begin(); + std::vector& buf = *i; + + if(buf.empty()) + { + List.erase(i); + goto Retry; + } + + unsigned bytes = buf.size(); + + CheckBegin(); + //fprintf(stderr, "Writing %u of %s from %p to %p\t", bytes, what, (void*)&buf[0], (void*)fp); + + unsigned ate = NonblockWrite(fp, &buf[0], bytes); + + //fprintf(stderr, "Wrote %u\n", ate); + + buf.erase(buf.begin(), buf.begin()+ate); + + Size -= ate; + + if(buf.empty()) + { + List.erase(i); + } + } + + void CheckFlushing() + { + //AudioBuffer.clear(); + //VideoBuffer.clear(); + + if(KnowAudio && KnowVideo && !Terminate) + { + if(!AudioBuffer.empty() && !VideoBuffer.empty()) + { + do { + /* vidfp = &1, audfp = &2 */ + int attempt = WaitUntilOneIsWritable(vidfp, audfp); + + if(attempt <= 0) break; /* Some kind of error can cause this */ + + // Flush Video + if(attempt&1) FlushBufferSome(VideoBuffer, VidBufSize, vidfp, "vid"); + + // Flush Audio + if(attempt&2) FlushBufferSome(AudioBuffer, AudBufSize, audfp, "aud"); + } while (!AudioBuffer.empty() && !VideoBuffer.empty()); + } + else + { + FlushBufferSome(VideoBuffer, VidBufSize, vidfp, "vid"); + FlushBufferSome(AudioBuffer, AudBufSize, audfp, "aud"); + } + /* + fprintf(stderr, "Buffer Sizes: Audio %u(%u) video %u(%u)\n", + (unsigned)AudioBuffer.size(), AudBufSize, + (unsigned)VideoBuffer.size(), VidBufSize); + */ + } + } + std::string GetMEncoderRawvideoParam() const + { + char Buf[512]; + unsigned bpp = INPUT_BPP; if(bpp == 15) bpp = 16; + sprintf(Buf, "fps=%g:format=0x%04X:w=%u:h=%u:size=%u", + vid_fps_scaled / (double)FPS_SCALE, + USE_FOURCC, + vid_width, + vid_height, + vid_width*vid_height * bpp/8); + return Buf; + } + std::string GetMEncoderRawaudioParam() const + { + char Buf[512]; + sprintf(Buf, "channels=%u:rate=%u:samplesize=%u:bitrate=%u", + aud_chans, + aud_rate, + aud_bits/8, + aud_rate*aud_chans*(aud_bits/8) ); + return Buf; + } + std::string GetMEncoderCommand() const + { + std::string mandatory = "-audiofile " + AUDIO_FN + + " -audio-demuxer rawaudio" + + " -demuxer rawvideo" + + " -rawvideo " + GetMEncoderRawvideoParam() + + " -rawaudio " + GetMEncoderRawaudioParam() + ; + std::string cmd = VIDEO_CMD; + + std::string::size_type p = cmd.find("NESV""SETTINGS"); + if(p != cmd.npos) + cmd = cmd.replace(p, 4+8, mandatory); + else + fprintf(stderr, "Warning: NESVSETTINGS not found in videocmd\n"); + + char videonumstr[64]; + sprintf(videonumstr, "%u", videonumber); + + for(;;) + { + p = cmd.find("VIDEO""NUMBER"); + if(p == cmd.npos) break; + cmd = cmd.replace(p, 5+6, videonumstr); + } + + fprintf(stderr, "Launch: %s\n", cmd.c_str()); fflush(stderr); + + return cmd; + } + + void CheckBegin() + { + if(!audfp) + { + unlink(AUDIO_FN.c_str()); + mknod(AUDIO_FN.c_str(), S_IFIFO|0666, 0); + } + + if(!vidfp) + { + /* Note: popen does not accept b/t in mode param */ + setenv("LD_PRELOAD", "", 1); + vidfp = popen(GetMEncoderCommand().c_str(), "w"); + if(!vidfp) + { + perror("Launch failed"); + } + else + { + fcntl(fileno(vidfp), F_SETFL, O_WRONLY | O_NONBLOCK); + } + } + + if(!audfp) + { + Retry: + audfp = fopen(AUDIO_FN.c_str(), "wb"); + + if(!audfp) + { + perror(AUDIO_FN.c_str()); + if(errno == ESTALE) goto Retry; + } + else + { + fcntl(fileno(audfp), F_SETFL, O_WRONLY | O_NONBLOCK); + } + } + } +}; + +static AVI* AVI = 0; + +namespace LogoInfo +{ + unsigned width; + unsigned height; +} + +#include "quantize.hh" +#include "rgbtorgb.hh" + +extern "C" +{ + int LoggingEnabled = 0; /* 0=no, 1=yes, 2=recording! */ + + const char* NESVideoGetVideoCmd() + { + return VIDEO_CMD.c_str(); + } + void NESVideoSetVideoCmd(const char *cmd) + { +#ifdef THREAD_SAFETY + struct ScopedLock + { ScopedLock() { + pthread_mutex_lock(&APIlock); + //fprintf(stderr, "audio start\n"); fflush(stderr); + } + ~ScopedLock() { + //fprintf(stderr, "audio end\n"); fflush(stderr); + pthread_mutex_unlock(&APIlock); } + } ScopedLock; +#endif + + VIDEO_CMD = cmd; + } + + static class AVI& GetAVIptr() + { + if(!AVI) + { + fprintf(stderr, "Starting new AVI (num %u)\n", videonumber); + AVI = new class AVI; + } + return *AVI; + } + + void NESVideoNextAVI() + { +#ifdef THREAD_SAFETY + struct ScopedLock + { ScopedLock() { + pthread_mutex_lock(&APIlock); + //fprintf(stderr, "audio start\n"); fflush(stderr); + } + ~ScopedLock() { + //fprintf(stderr, "audio end\n"); fflush(stderr); + pthread_mutex_unlock(&APIlock); } + } ScopedLock; +#endif + + if(AVI) + { + fprintf(stderr, "Closing AVI (next will be started)\n"); + delete AVI; + AVI = 0; + ++videonumber; + } + } + + static void Overlay32With32(unsigned char* target, const unsigned char* source, int alpha) + { + target[0] += ((int)(source[0] - target[0])) * alpha / 255; + target[1] += ((int)(source[1] - target[1])) * alpha / 255; + target[2] += ((int)(source[2] - target[2])) * alpha / 255; + } + + static void OverlayLogoFrom(const char* fn, std::vector& data) + { + FILE*fp = fopen(fn, "rb"); + if(!fp) perror(fn); + if(!fp) return; /* Silently ignore missing frames */ + + gdImagePtr im = gdImageCreateFromPng(fp); + if(!gdImageTrueColor(im)) + { + fprintf(stderr, "'%s': Only true color images are supported\n", fn); + goto CloseIm; + } + {/*scope begin*/ + + unsigned new_width = gdImageSX(im); + unsigned new_height= gdImageSY(im); + + if(new_width != LogoInfo::width + || new_height != LogoInfo::height) + { + if(new_height < LogoInfo::height || new_height > LogoInfo::height+20) + fprintf(stderr, "'%s': ERROR, expected %dx%d, got %dx%d\n", fn, + LogoInfo::width, LogoInfo::height, + new_width, new_height); + } + + for(unsigned y=0; y > files; + if(files.empty()) /* Cache the list of logo files. */ + { + static const char GlobPat[] = "logo_*_*_f*.png"; + glob_t globdata; + globdata.gl_offs = 0; + fprintf(stderr, "Loading list of usable logo animation files in %s...\n", avdir.c_str()); + int globres = glob( (avdir + GlobPat).c_str(), GLOB_NOSORT, NULL, &globdata); + if(globres == 0) + { + for(size_t n=0; n >::const_iterator + i = files.find(frameno); + if(i != files.end()) + { + std::string best; + int bestdist = -1; + + const std::vector& fnames = i->second; + for(size_t b=fnames.size(), a=0; a= 0) want = avdir + best; + } + } + return want; + } + + static const std::vector NVConvert24To16Frame + (const std::vector& logodata) + { + std::vector result(LogoInfo::width * LogoInfo::height * 2); + Convert24To16Frame(&logodata[0], &result[0], LogoInfo::width * LogoInfo::height, LogoInfo::width); + return result; + } + static const std::vector NVConvert24To15Frame + (const std::vector& logodata) + { + std::vector result(LogoInfo::width * LogoInfo::height * 2); + Convert24To15Frame(&logodata[0], &result[0], LogoInfo::width * LogoInfo::height, LogoInfo::width); + return result; + } + + static const std::vector NVConvert24To_I420Frame + (const std::vector& logodata) + { + std::vector result(LogoInfo::width * LogoInfo::height * 3 / 2); + Convert24To_I420Frame(&logodata[0], &result[0], LogoInfo::width * LogoInfo::height, LogoInfo::width); + return result; + } + + static const std::vector NVConvert16To24Frame + (const void* data, unsigned npixels) + { + std::vector logodata(npixels*3); /* filled with black. */ + Convert16To24Frame(data, &logodata[0], npixels); + return logodata; + } + + static const std::vector NVConvert15To24Frame + (const void* data, unsigned npixels) + { + std::vector logodata(npixels*3); /* filled with black. */ + Convert15To24Frame(data, &logodata[0], npixels); + return logodata; + } + + static const std::vector NVConvert_I420To24Frame + (const void* data, unsigned npixels) + { + std::vector logodata(npixels*3); /* filled with black. */ + Convert_I420To24Frame(data, &logodata[0], npixels, LogoInfo::width); + return logodata; + } + + static void SubstituteWithBlackIfNeeded(const void*& data) + { + /* If the first frames of the animation consist of a + * single color (such as gray for NES), replace them + * with black to avoid ugly backgrounds on logo animations + */ + + static bool Deviate = false; + static short* Replacement = 0; + static unsigned wid=0, hei=0; + if(Deviate) + { + if(Replacement) { delete[] Replacement; Replacement=0; } + return; + } + + unsigned dim = LogoInfo::width * LogoInfo::height; + const short* p = (const short*)data; + for(unsigned a=0; a VideoBuf; + VideoBuf.resize(width*height * 3); + + Convert32To24Frame(data, &VideoBuf[0], width*height); + data = (void*)&VideoBuf[0]; + } + + if(bpp) INPUT_BPP = bpp; + + switch(INPUT_BPP) + { + case 32: USE_FOURCC = BGR32; break; + case 24: USE_FOURCC = BGR24; break; + case 16: USE_FOURCC = BGR16; break; + case 15: USE_FOURCC = BGR15; break; + case 12: USE_FOURCC = I420; break; + } + //USE_FOURCC = BGR24; // FIXME TEMPORARY + + const int LogoFramesHeader = (int)( (LOGO_LENGTH_HEADER * fps_scaled) / (1 << 24) ); + const int LogoFramesOverlap = (int)( (LOGO_LENGTH_OVERLAP * fps_scaled) / (1 << 24) ); + + LogoInfo::width = width; + LogoInfo::height = height; + + if(INPUT_BPP == 16 || INPUT_BPP == 15) + { + SubstituteWithBlackIfNeeded(data); + } + else if(INPUT_BPP != 24 && INPUT_BPP != 12) + { + fprintf(stderr, "NESVIDEOS_PIECE only supports 16 and 24 bpp, you gave %u bpp\n", + bpp); + return; + } + + static bool LogoHeaderPartSent = false; + if(!LogoHeaderPartSent) + { + /* Send animation frames that do not involve source video? */ + LogoHeaderPartSent=true; + + if(LogoFramesHeader > 0) + { + for(int frame = 0; frame < LogoFramesHeader; ++frame) + { + std::vector logodata(width*height*3); /* filled with black. */ + + std::string fn = GetLogoFileName(frame); + /*fprintf(stderr, "wid=%d(%d), hei=%d(%d),fn=%s\n", + width, LogoInfo::width, + height, LogoInfo::height, + fn.c_str());*/ + OverlayLogoFrom(fn.c_str(), logodata); + + //INPUT_BPP = 24; USE_FOURCC = BGR24; // FIXME TEMPORARY + + if(INPUT_BPP == 16) + { + std::vector result = NVConvert24To16Frame(logodata); + GetAVIptr().Video(width,height,fps_scaled, &result[0]); + } + else if(INPUT_BPP == 15) + { + std::vector result = NVConvert24To15Frame(logodata); + GetAVIptr().Video(width,height,fps_scaled, &result[0]); + } + else if(INPUT_BPP == 12) + { + std::vector result = NVConvert24To_I420Frame(logodata); + GetAVIptr().Video(width,height,fps_scaled, &result[0]); + } + else + { + GetAVIptr().Video(width,height,fps_scaled, &logodata[0]); + } + } + } + } + + static int LogoOverlapSent = 0; + if(LogoOverlapSent < LogoFramesOverlap) + { + /* Send animation frames that mix source and animation? */ + + std::string fn = GetLogoFileName(LogoOverlapSent + LogoFramesHeader); + /* + fprintf(stderr, "wid=%d(%d), hei=%d(%d),fn=%s\n", + width, LogoInfo::width, + height, LogoInfo::height, + fn.c_str());*/ + + std::vector logodata; + if(INPUT_BPP == 16) + { + logodata = NVConvert16To24Frame(data, width*height); + } + else if(INPUT_BPP == 15) + { + logodata = NVConvert15To24Frame(data, width*height); + } + else if(INPUT_BPP == 12) + { + logodata = NVConvert_I420To24Frame(data, width*height); + } + else + { + logodata.resize(width*height*3); /* filled with black. */ + memcpy(&logodata[0], data, width*height*3); + } + + OverlayLogoFrom(fn.c_str(), logodata); + +// INPUT_BPP = 24; USE_FOURCC = BGR24; // FIXME TEMPORARY + + if(INPUT_BPP == 16) + { + std::vector result = NVConvert24To16Frame(logodata); + GetAVIptr().Video(width,height,fps_scaled, &result[0]); + } + else if(INPUT_BPP == 15) + { + std::vector result = NVConvert24To15Frame(logodata); + GetAVIptr().Video(width,height,fps_scaled, &result[0]); + } + else if(INPUT_BPP == 12) + { + std::vector result = NVConvert24To_I420Frame(logodata); + GetAVIptr().Video(width,height,fps_scaled, &result[0]); + } + else + { + GetAVIptr().Video(width,height,fps_scaled, &logodata[0]); + } + + ++LogoOverlapSent; + return; + } + + GetAVIptr().Video(width,height,fps_scaled, (const unsigned char*) data); + } + + void NESVideoLoggingAudio + (const void*data, + unsigned rate, unsigned bits, unsigned chans, + unsigned nsamples) + { + if(LoggingEnabled < 2) return; + +#ifdef THREAD_SAFETY + struct ScopedLock + { ScopedLock() { + pthread_mutex_lock(&APIlock); + //fprintf(stderr, "audio start\n"); fflush(stderr); + } + ~ScopedLock() { + //fprintf(stderr, "audio end\n"); fflush(stderr); + pthread_mutex_unlock(&APIlock); } + } ScopedLock; +#endif + + static bool LogoHeaderPartSent = false; + if(!LogoHeaderPartSent && LOGO_LENGTH_HEADER > 0) + { + LogoHeaderPartSent=true; + + double HdrLength = LOGO_LENGTH_HEADER; // N64 workaround + + const long n = (long)(rate * HdrLength)/* + - (rate * 0.11)*/; + + if(n > 0) { + unsigned bytes = n*chans*(bits/8); + unsigned char* buf = (unsigned char*)malloc(bytes); + if(buf) + { + memset(buf,0,bytes); + GetAVIptr().Audio(rate,bits,chans, buf, n); + free(buf); + } } + } + + /* + fprintf(stderr, "Writing %u samples (%u bits, %u chans, %u rate)\n", + nsamples, bits, chans, rate);*/ + + /* + static FILE*fp = fopen("audiodump.wav", "wb"); + fwrite(data, 1, nsamples*(bits/8)*chans, fp); + fflush(fp);*/ + + GetAVIptr().Audio(rate,bits,chans, (const unsigned char*) data, nsamples); + } +} /* extern "C" */ diff -NaHudr snes9x-1.43-src/snes9x/unix/nesvideos-piece.hh snx/snes9x/unix/nesvideos-piece.hh --- snes9x-1.43-src/snes9x/unix/nesvideos-piece.hh 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/unix/nesvideos-piece.hh 2008-02-03 16:57:50.354469000 +0200 @@ -0,0 +1,46 @@ +#ifndef NESVPIECEhh +#define NESVPIECEhh + +#define NESVIDEOS_LOGGING 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* Is video logging enabled? 0=no, 1=yes, 2=active. Default value: 0 */ +extern int LoggingEnabled; + +/* Get and set the video recording command (shell command) */ +extern const char* NESVideoGetVideoCmd(void); +extern void NESVideoSetVideoCmd(const char *cmd); + +/* Save 1 frame of video. (Assumed to be 16-bit RGB) */ +/* FPS is scaled by 24 bits (*0x1000000) */ +/* Does not do anything if LoggingEnabled<2. */ +extern void NESVideoLoggingVideo + (const void*data, unsigned width, unsigned height, + unsigned fps_scaled, + unsigned bpp); + +/* Save N bytes of audio. bytes_per_second is required on the first call. */ +/* Does not do anything if LoggingEnabled<2. */ +/* The interval of calling this function is not important, as long as all the audio + * data is eventually written without too big delay (5 seconds is too big) + * This function may be called multiple times per video frame, or once per a few video + * frames, or anything in between. Just that all audio data must be written exactly once, + * and in order. */ +extern void NESVideoLoggingAudio + (const void*data, + unsigned rate, unsigned bits, unsigned chans, + unsigned nsamples); +/* nsamples*chans*(bits/8) = bytes in *data. */ + +/* Requests current AVI to be closed and new be started */ +/* Use when encoding parameters have changed */ +extern void NESVideoNextAVI(); + +#ifdef __cplusplus +} +#endif + +#endif diff -NaHudr snes9x-1.43-src/snes9x/unix/quantize.hh snx/snes9x/unix/quantize.hh --- snes9x-1.43-src/snes9x/unix/quantize.hh 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/unix/quantize.hh 2008-02-06 22:05:09.470769000 +0200 @@ -0,0 +1,184 @@ +/* + Ordered dithering methods provided for: + 8x8 (Quantize8x8) + 4x4 (Quantize4x4) + 3x3 (Quantize3x3) + 4x2 (Quantize4x2) + 3x2 (Quantize3x2) + 2x2 (Quantize2x2) + The functions are: + + template + int QuantizeFunc(size_t quant_pos, double value) + + - Quantizes value, assumed to be in range 0..in_max, to range 0..m + - quant_pos tells the coordinate into the dithering matrix + + template + int QuantizeFunc(size_t quant_pos, unsigned value) + + - Quantizes value, assumed to be in range 0..in_max, to range 0..m + - quant_pos tells the coordinate into the dithering matrix + + Copyright (C) 1992,2008 Joel Yliluoma (http://iki.fi/bisqwit/) +*/ + +#define OrderedDitherDecl(n) \ + static const double flts[n]; \ + static const int ints[n]; \ + enum { mul = n+1, \ + maxin = in_max, \ + even = !(maxin % mul), \ + intmul = even ? 1 : mul }; + +#define d(n) (n)/double(mul) - 0.5 +#define i(n) even ? (n*in_max/mul - (int)in_max/2) \ + : (n*in_max - (int)mul*in_max/2) + +template +struct QuantizeNoDither +{ + int res; + template + QuantizeNoDither(IntType v) : res(v * m / in_max) { } + operator int() const { return res; } +}; + +template +struct QuantizeFuncBase: private Base +{ + int res; + + QuantizeFuncBase(size_t quant_pos, double v) : res(0) + { + if(v > 0.0) + { + const double dither_threshold = Base::flts[quant_pos]; + res = (int)(v * (m / double(Base::maxin)) + dither_threshold); + if(res > m) res = m; + } + } + + QuantizeFuncBase(size_t quant_pos, unsigned char v) : res(v) + { + if(m == Base::maxin) return; + if(m < Base::maxin) + { + // With dithering + const int dither_threshold = Base::ints[quant_pos]; + const int intmul = Base::intmul; + res = (res * (m * intmul) + dither_threshold) / (Base::maxin * intmul); + } + else + { + // Without dithering + res = QuantizeNoDither (res); + } + } +}; + +#define QuantizeFuncDecl(name, base) \ + template \ + struct name: private QuantizeFuncBase > \ + { \ + typedef QuantizeFuncBase > Base; \ + template name(A a, B b) : Base(a, b) { } \ + operator int() const { return Base::res; } \ + } + +/******* Quantizing with 8x8 ordered dithering ********/ +template struct OrderedDither_8x8 { OrderedDitherDecl(8*8) }; + template + const double OrderedDither_8x8::flts[] /* A table for 8x8 ordered dithering */ + = { d(1 ), d(49), d(13), d(61), d( 4), d(52), d(16), d(64), + d(33), d(17), d(45), d(29), d(36), d(20), d(48), d(32), + d(9 ), d(57), d( 5), d(53), d(12), d(60), d( 8), d(56), + d(41), d(25), d(37), d(21), d(44), d(28), d(40), d(24), + d(3 ), d(51), d(15), d(63), d( 2), d(50), d(14), d(62), + d(35), d(19), d(47), d(31), d(34), d(18), d(46), d(30), + d(11), d(59), d( 7), d(55), d(10), d(58), d( 6), d(54), + d(43), d(27), d(39), d(23), d(42), d(26), d(38), d(22) }; + template + const int OrderedDither_8x8::ints[] + = { i(1 ), i(49), i(13), i(61), i( 4), i(52), i(16), i(64), + i(33), i(17), i(45), i(29), i(36), i(20), i(48), i(32), + i(9 ), i(57), i( 5), i(53), i(12), i(60), i( 8), i(56), + i(41), i(25), i(37), i(21), i(44), i(28), i(40), i(24), + i(3 ), i(51), i(15), i(63), i( 2), i(50), i(14), i(62), + i(35), i(19), i(47), i(31), i(34), i(18), i(46), i(30), + i(11), i(59), i( 7), i(55), i(10), i(58), i( 6), i(54), + i(43), i(27), i(39), i(23), i(42), i(26), i(38), i(22) }; +QuantizeFuncDecl(Quantize8x8, OrderedDither_8x8); + + +/******* Quantizing with 4x4 ordered dithering ********/ +template struct OrderedDither_4x4 { OrderedDitherDecl(4*4) }; + template + const double OrderedDither_4x4::flts[] /* A table for 4x4 ordered dithering */ + = { d( 1), d( 9), d( 3), d(11), + d(13), d( 5), d(15), d( 7), + d( 4), d(12), d( 2), d(10), + d(16), d( 8), d(14), d( 6) }; + template + const int OrderedDither_4x4::ints[] + = { i( 1), i( 9), i( 3), i(11), + i(13), i( 5), i(15), i( 7), + i( 4), i(12), i( 2), i(10), + i(16), i( 8), i(14), i( 6) }; +QuantizeFuncDecl(Quantize4x4, OrderedDither_4x4); + +/******* Quantizing with 3x3 ordered dithering ********/ +template struct OrderedDither_3x3 { OrderedDitherDecl(3*3) }; + template + const double OrderedDither_3x3::flts[] /* A table for 3x3 ordered dithering */ + = { d(1), d(7), d(3), + d(6), d(4), d(9), + d(8), d(2), d(5) }; + template + const int OrderedDither_3x3::ints[] + = { i(1), i(7), i(3), + i(6), i(4), i(9), + i(8), i(2), i(5) }; +QuantizeFuncDecl(Quantize3x3, OrderedDither_3x3); + +/******* Quantizing with 4x2 ordered dithering ********/ +template struct OrderedDither_4x2 { OrderedDitherDecl(4*2) }; + template + const double OrderedDither_4x2::flts[] /* A table for 4x2 ordered dithering */ + = { d(1), d(5), d(2), d(6), + d(7), d(3), d(8), d(4) }; + template + const int OrderedDither_4x2::ints[] + = { i(1), i(5), i(2), i(6), + i(7), i(3), i(8), i(4) }; +QuantizeFuncDecl(Quantize4x2, OrderedDither_4x2); + +/******* Quantizing with 3x2 ordered dithering ********/ +template struct OrderedDither_3x2 { OrderedDitherDecl(3*2) }; + template + const double OrderedDither_3x2::flts[] /* A table for 3x2 ordered dithering */ + = { d(1), d(5), d(3), + d(4), d(2), d(6) }; + template + const int OrderedDither_3x2::ints[] + = { i(1), i(5), i(3), + i(4), i(2), i(6) }; +QuantizeFuncDecl(Quantize3x2, OrderedDither_3x2); + +/******* Quantizing with 2x2 ordered dithering ********/ +template struct OrderedDither_2x2 { OrderedDitherDecl(2*2) }; + template + const double OrderedDither_2x2::flts[] /* A table for 2x2 ordered dithering */ + = { d(1), d(4), + d(3), d(2) }; + template + const int OrderedDither_2x2::ints[] + = { i(1), i(4), + i(3), i(2) }; +QuantizeFuncDecl(Quantize2x2, OrderedDither_2x2); + + +#undef OrderedDitherDecl +#undef QuantizeFuncDecl +#undef i +#undef d diff -NaHudr snes9x-1.43-src/snes9x/unix/rgbtorgb.cc snx/snes9x/unix/rgbtorgb.cc --- snes9x-1.43-src/snes9x/unix/rgbtorgb.cc 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/unix/rgbtorgb.cc 2008-02-18 23:02:53.581518000 +0200 @@ -0,0 +1,786 @@ +#include +#include // for size_t +#include +#include + +typedef uint_least64_t uint64_t; + +#include "quantize.hh" +#include "rgbtorgb.hh" +#include "simd.hh" + +static const uint64_t zero64 __attribute__((aligned(8))) = 0ULL; +static const uint64_t mask24l __attribute__((aligned(8))) = 0x0000000000FFFFFFULL; +static const uint64_t mask24h __attribute__((aligned(8))) = 0x0000FFFFFF000000ULL; +static const uint64_t mask24hh __attribute__((aligned(8))) = 0xffff000000000000ULL; +static const uint64_t mask24hhh __attribute__((aligned(8))) = 0xffffffff00000000ULL; +static const uint64_t mask24hhhh __attribute__((aligned(8))) = 0xffffffffffff0000ULL; + +static const uint64_t mask64h __attribute__((aligned(8))) = 0xFF00FF00FF00FF00ULL; +static const uint64_t mask64l __attribute__((aligned(8))) = 0x00FF00FF00FF00FFULL; +static const uint64_t mask64hw __attribute__((aligned(8))) = 0xFFFF0000FFFF0000ULL; +static const uint64_t mask64lw __attribute__((aligned(8))) = 0x0000FFFF0000FFFFULL; +static const uint64_t mask64hd __attribute__((aligned(8))) = 0xFFFFFFFF00000000ULL; +static const uint64_t mask64ld __attribute__((aligned(8))) = 0x00000000FFFFFFFFULL; + +#define RGB2YUV_SHIFT 16 +/* Note: With shift 8, it only uses U,V range 18..239. + * With just 9 bits, it would use whole 16..240 as it should. + */ +#if 1 + +static const int RY = ((int)(( 65.738/256.0)*(1< +static inline void Convert32To24_32bytes(c64 w0, c64 w1, c64 w2, c64 w3, unsigned char* dest) +{ + c64 r0 = (w0 & mask24l) | ((w0 >> 8) & mask24h); /* bbbaaa */ + c64 r1 = (w1 & mask24l) | ((w1 >> 8) & mask24h); /* dddccc */ + c64 r2 = (w2 & mask24l) | ((w2 >> 8) & mask24h); /* fffeee */ + c64 r3 = (w3 & mask24l) | ((w3 >> 8) & mask24h); /* hhhggg */ + + /* ccbbbaaa */ + ((r0 ) | ((r1 << 48) & mask24hh)).Put(dest+0); + /* feeedddc */ + ((r1 >> 16) | ((r2 << 32) & mask24hhh)).Put(dest+8); + /* hhhgggff */ + ((r2 >> 32) | ((r3 << 16) & mask24hhhh)).Put(dest+16); +} + +#if defined(__x86_64) || defined(USE_MMX) +static void Convert32To24_32bytes(const unsigned char* src, + unsigned char* dest) +{ + c64 w0; w0.Get(src+0); + c64 w1; w1.Get(src+8); + c64 w2; w2.Get(src+16); + c64 w3; w3.Get(src+24); + Convert32To24_32bytes(w0,w1,w2,w3, dest); +} +#endif + +void Convert32To24Frame(const void* data, unsigned char* dest, unsigned npixels) +{ + const unsigned char* src = (const unsigned char*)data; + + #if defined(__x86_64) || defined(USE_MMX) + while(npixels >= 8) + { + Convert32To24_32bytes(src, dest); + src += 4*8; + dest += 3*8; + npixels -= 8; + } + #ifdef USE_MMX + _mm_empty(); + #endif + #endif + + for(unsigned pos=0; pos +struct Bits16const +{ + static const uint64_t value; +}; +template +const uint64_t Bits16const::value = + (( ((uint64_t)(unsigned short) basevalue_lo) << 0) + | ( ((uint64_t)(unsigned short) basevalue_hi) << 16) + | ( ((uint64_t)(unsigned short) basevalue_lo) << 32) + | ( ((uint64_t)(unsigned short) basevalue_hi) << 48)); + +template +struct Bits32const +{ + static const uint64_t value; +}; +template +const uint64_t Bits32const::value = + (( ((uint64_t)(unsigned int) basevalue_lo) << 0) + | ( ((uint64_t)(unsigned int) basevalue_hi) << 32)); + +template +struct Bits8const +{ + static const uint64_t value = + ((basevalue_lo << 0) + | (basevalue_hi << 8) + | (basevalue_lo << 16) + | (basevalue_hi << 24) + | (basevalue_lo << 32) + | (basevalue_hi << 40) + | (basevalue_lo << 48) + | (basevalue_hi << 56)); +}; + + +template +struct MaskBconst +{ + static const uint64_t basevalue_lo = (1 << lowbitcount) - 1; + static const uint64_t basevalue_hi = (1 << highbitcount) - 1; + static const uint64_t value = Bits8const::value << leftshift; +}; + +template +struct Convert_2byte_consts +{ + static const uint64_t mask_lo;// = MaskBconst::value; + static const uint64_t mask_hi;// = MaskBconst::value; + static const uint64_t mask_frac;// = MaskBconst<8-bits,8-bits, 0>::value; +}; +template +const uint64_t Convert_2byte_consts::mask_lo = MaskBconst::value; +template +const uint64_t Convert_2byte_consts::mask_hi = MaskBconst::value; +template +const uint64_t Convert_2byte_consts::mask_frac = MaskBconst<8-bits, 8-bits, 0>::value; + +template +struct Convert_2byte_helper +{ + c64 lo, hi; + + Convert_2byte_helper(c64 p4a, c64 p4b) + { + const uint64_t& mask_lo = Convert_2byte_consts::mask_lo; + const uint64_t& mask_hi = Convert_2byte_consts::mask_hi; + const uint64_t& mask_frac = Convert_2byte_consts::mask_frac; + + /* STEP 1: SEPARATE THE PIXELS INTO RED, GREEN AND BLUE COMPONENTS */ + + /* 000BBBBB 000bbbbb 000BBBBB 000bbbbb 000BBBBB 000bbbbb 000BBBBB 000bbbbb */ + c64 s5 = ((p4a >> offs) & mask_lo) | ((p4b << (8-offs)) & mask_hi); + + /* STEP 2: SCALE THE COLOR COMPONENTS TO 256 RANGE */ + + /* BBBBB000 bbbbb000 BBBBB000 bbbbb000 BBBBB000 bbbbb000 BBBBB000 bbbbb000 */ + /* 00000BBB 00000bbb 00000BBB 00000bbb 00000BBB 00000bbb 00000BBB 00000bbb */ + c64 v8 = (s5 << (8-bits)) | ((s5 >> (bits-(8-bits))) & mask_frac); + /* v8: + * + * BBBBBBBB bbbbbbbb BBBBBBBB bbbbbbbb BBBBBBBB bbbbbbbb BBBBBBBB bbbbbbbb * + */ + + /* STEP 3: DEINTERLACE THE PIXELS */ + lo = (v8 ) & mask64l; + hi = (v8 >> 8) & mask64l; + } +}; + +/* +template +static void Convert_2byte_to_24Common(const unsigned char* src, unsigned char* dest) + __attribute((noinline)); +*/ +template +static void Convert_2byte_to_24or32Common(const unsigned char* src, unsigned char* dest) +{ + c64 p4a; p4a.Get(src+0); // four pixels + c64 p4b; p4b.Get(src+8); // another four pixels + + /* in: In both registers: */ + + Convert_2byte_helper r(p4a,p4b); + Convert_2byte_helper b(p4a,p4b); + Convert_2byte_helper g(p4a,p4b); + + /* STEP 4: CONVERT PIXELS INTO RGB32 */ + + /* Now we have: + * b.lo = 0j0g0d0a + * g.lo = 0k0h0e0b + * r.lo = 0l0i0f0c + * b.hi = 0J0G0D0A + * g.hi = 0K0H0E0B + * r.hi = 0L0I0F0C + * We want: + * w1 = 0fed0cba + * w2 = 0lkj0ihg + * w3 = 0FED0CBA + * w4 = 0LKJ0IHG + */ + +#if 0 && defined(__MMX__) /* FIXME why is this 0&&? */ + // punpcklbw 0k0h0e0b, 0j0g0d0a -> 00ed00ba + // punpcklwd 0l0i0f0c, ________ -> 0f__0c__ + c64 w1 = r.lo.unpacklwd(zero64) | g.lo.unpacklbw(b.lo); // pix 0,1 + // punpckhbw 0k0h0e0b, 0j0g0d0a -> 00kj00hg + // punpckhwd 0l0i0f0c, ________ -> 0l__0i__ + c64 w2 = r.lo.unpackhwd(zero64) | g.lo.unpackhbw(b.lo); // pix 2,3 + + c64 w3 = r.hi.unpacklwd(zero64) | g.hi.unpacklbw(b.hi); // pix 4,5 + c64 w4 = r.hi.unpackhwd(zero64) | g.hi.unpackhbw(b.hi); // pix 6,7 + #ifndef USE_MMX + _mm_empty(); + #endif +#else + /* With 64-bit registers, this code is greatly simpler than + * the emulation of unpack opcodes. However, when the + * unpack opcodes is available, using them is shorter. + * Which way is faster? FIXME: Find out + */ + + // mask64lw: 00**00** + // mask64hw: **00**00 + // b.lo & mask64lw: 000g000a + // g.lo & mask64lw: 000h000b + // r.lo & mask64lw: 000i000c + // b.lo & mask64hw: 0j000d00 + // g.lo & mask64hw: 0k000e00 + // r.lo & mask64hw: 0l000f00 + + c64 tlo1 = ((b.lo & mask64lw) ) | ((g.lo & mask64lw) << 8) | ((r.lo & mask64lw) << 16); + c64 tlo2 = ((b.lo & mask64hw) >>16) | ((g.lo & mask64hw) >> 8) | ((r.lo & mask64hw) ); + + c64 thi1 = ((b.hi & mask64lw) ) | ((g.hi & mask64lw) << 8) | ((r.hi & mask64lw) << 16); + c64 thi2 = ((b.hi & mask64hw) >>16) | ((g.hi & mask64hw) >> 8) | ((r.hi & mask64hw) ); + /* + * tlo1 = 0ihg0cba + * tlo2 = 0lkj0fed + * thi1 = 0IHG0CBA + * thi2 = 0LKJ0FED + * mask64ld = 0000**** + * mask64hd = ****0000 + */ + + c64 w1 = (tlo1 & mask64ld) | ((tlo2 & mask64ld) << 32); // 00000cba | 00000fed = 0fed0bca + c64 w2 = (tlo2 & mask64hd) | ((tlo1 & mask64hd) >> 32); // 0lkj0000 | 0ihg0000 = 0lkj0ihg + + c64 w3 = (thi1 & mask64ld) | ((thi2 & mask64ld) << 32); + c64 w4 = (thi2 & mask64hd) | ((thi1 & mask64hd) >> 32); +#endif + + if(rgb24) + { + /* STEP 5A: CONVERT PIXELS INTO RGB24 */ + Convert32To24_32bytes(w1,w2,w3,w4, dest); + } + else + { + /* STEP 5B: STORE RGB32 */ + w1.Put(dest+0); + w2.Put(dest+8); + w3.Put(dest+16); + w4.Put(dest+24); + } + + /* + punpcklbw ____ABCD, ____abcd = AaBbCcDd + punpcklwd ____ABCD, ____abcd = ABabCDcd + punpckldq ____ABCD, ____abcd = ABCDabcd + + punpckhbw ABCD____, abcd____ = AaBbCcDd + punpckhwd ABCD____, abcd____ = ABabCDcd + punpckhdq ABCD____, abcd____ = ABCDabcd + */ +} + +void Convert15To24Frame(const void* data, unsigned char* dest, unsigned npixels, bool swap_red_blue) +{ + const unsigned char* src = (const unsigned char*)data; + + if(swap_red_blue) + for(; npixels >= 8; src += 8*2, dest += 8*3, npixels -= 8) + Convert_2byte_to_24or32Common<0,5, 5,5, 10,5, true> (src, dest); + else + for(; npixels >= 8; src += 8*2, dest += 8*3, npixels -= 8) + Convert_2byte_to_24or32Common<10,5, 5,5, 0,5, true> (src, dest); + + #ifdef USE_MMX + _mm_empty(); + #endif + for(unsigned a=0; a= 8; src += 8*2, dest += 8*3, npixels -= 8) + Convert_2byte_to_24or32Common<0,5, 5,6, 11,5, true> (src, dest); + else + for(; npixels >= 8; src += 8*2, dest += 8*3, npixels -= 8) + Convert_2byte_to_24or32Common<11,5, 5,6, 0,5, true> (src, dest); + + #ifdef USE_MMX + _mm_empty(); + #endif + for(unsigned a=0; a= 8; src += 8*2, dest += 8*4, npixels -= 8) + Convert_2byte_to_24or32Common<0,5, 5,5, 10,5, false> (src, dest); + else + for(; npixels >= 8; src += 8*2, dest += 8*4, npixels -= 8) + Convert_2byte_to_24or32Common<10,5, 5,5, 0,5, false> (src, dest); + + #ifdef USE_MMX + _mm_empty(); + #endif + for(unsigned a=0; a= 8; src += 8*2, dest += 8*4, npixels -= 8) + Convert_2byte_to_24or32Common<0,5, 5,6, 11,5, false> (src, dest); + else + for(; npixels >= 8; src += 8*2, dest += 8*4, npixels -= 8) + Convert_2byte_to_24or32Common<11,5, 5,6, 0,5, false> (src, dest); + + #ifdef USE_MMX + _mm_empty(); + #endif + for(unsigned a=0; a(o16, rgbdata[2]) << 0) + | (Quantize4x4<63>(o16, rgbdata[1]) << 5) + | (Quantize4x4<31>(o16, rgbdata[0]) << 11); +} +static inline unsigned Build15(unsigned x,unsigned y, const unsigned char* rgbdata) +{ + unsigned o16 = (x + 4*y) % 16; + return (Quantize4x4<31>(o16, rgbdata[2]) << 0) + | (Quantize4x4<31>(o16, rgbdata[1]) << 5) + | (Quantize4x4<31>(o16, rgbdata[0]) << 10); +} + +void Convert24To16Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width) +{ + const unsigned char* logodata = (const unsigned char*) data; + unsigned short* result = (unsigned short*) dest; + unsigned x=0,y=0; + for(unsigned pos=0; pos= width) { x=0; ++y; } + } +} + +void Convert24To15Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width) +{ + const unsigned char* logodata = (const unsigned char*) data; + unsigned short* result = (unsigned short*) dest; + unsigned x=0,y=0; + for(unsigned pos=0; pos= width) { x=0; ++y; } + } +} + +template +void Convert_4byte_To_I420Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width) +{ + const unsigned char* src = (const unsigned char*) data; + unsigned height = npixels / width; + unsigned pos = 0; + unsigned ypos = 0; + unsigned vpos = npixels; + unsigned upos = vpos + npixels / 4; + unsigned stride = width*PixStride; + + /* This function is based on code from x264 svn version 711 */ + /* TODO: Apply MMX optimization */ + + for(unsigned y=0; y> RGB2YUV_SHIFT); // y + } + + dest[upos++] = (U_ADD + ((RU * c[0] + GU * c[1] + BU * c[2]) >> (RGB2YUV_SHIFT+2)) ); + dest[vpos++] = (V_ADD + ((RV * c[0] + GV * c[1] + BV * c[2]) >> (RGB2YUV_SHIFT+2)) ); + + ypos += 2; + } + pos += stride; + ypos += width; + } +} + +template +void Convert_2byte_To_I420Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width) +{ + const unsigned PixStride = 2; + const unsigned char* src = (const unsigned char*) data; + unsigned height = npixels / width; + unsigned pos = 0; + unsigned ypos = 0; + unsigned vpos = npixels; + unsigned upos = vpos + npixels / 4; + unsigned stride = width*PixStride; + + /* This function is based on code from x264 svn version 711 */ + /* TODO: Apply MMX optimization */ + + for(unsigned y=0; y + (src+pos, Rgb2byteBuf[0][0]); + + Convert_2byte_to_24or32Common + + (src+pos+stride, Rgb2byteBuf[1][0]); + + pos += 16; + + for(int x8 = 0; x8 < 8; x8 += 2) + { + int c[3]; + /* TODO: Some faster means than using pointers */ + unsigned char* rgb[4] = + { + Rgb2byteBuf[0][x8+0], + Rgb2byteBuf[0][x8+1], + Rgb2byteBuf[1][x8+0], + Rgb2byteBuf[1][x8+1] + }; + + for(int m=0; m<3; ++m) c[m] = 0; + for(int n=0; n<4; ++n) + for(int m=0; m<3; ++m) + c[m] += rgb[n][m]; + + unsigned destpos[4] = { ypos, ypos+1, ypos+width, ypos+width+1 }; + for(int n=0; n<4; ++n) + { + dest[destpos[n]] + = Y_ADD + ((RY * rgb[n][0] + + GY * rgb[n][1] + + BY * rgb[n][2] + ) >> RGB2YUV_SHIFT); // y + } + + /*c[0] /= 4; c[1] /= 4; c[2] /= 4;*/ + // Note: +2 is because c[] contains 4 values + dest[upos++] = U_ADD + ((RU * c[0] + GU * c[1] + BU * c[2]) >> (RGB2YUV_SHIFT+2)); + dest[vpos++] = V_ADD + ((RV * c[0] + GV * c[1] + BV * c[2]) >> (RGB2YUV_SHIFT+2)); + + ypos += 2; + } + } + pos += stride; + ypos += width; + } + + #ifdef USE_MMX + /* because of Convert_2byte_to_24or32Common() */ + _mm_empty(); + #endif +} + +void Convert_I420To24Frame(const void* data, unsigned char* dest, + unsigned npixels, unsigned width, bool swap_red_blue) +{ + const unsigned char* src = (const unsigned char*) data; + unsigned height = npixels / width; + unsigned pos = 0; + unsigned ypos = 0; + unsigned vpos = npixels; + unsigned upos = vpos + npixels / 4; + + #ifdef __MMX__ + c64_MMX rgb[4], yy[4]; + #endif + + /* + Y input: 16..235 + U input: 16..240 + V input: 16..240 + + */ + + #pragma omp parallel for + for(unsigned y=0; y::value) + .shl16(16 - YUV2RGB_SHIFT); // shift them so that *13bitconst results in upper 16 bits having the actual value + c64_MMX vvq = c64_MMX(zero64) + .unpacklbw(tmp_v) + .sub16(Bits16const::value) + .shl16(16 - YUV2RGB_SHIFT); // shift them so that *13bitconst results in upper 16 bits having the actual value + + const short* uu = (const short*)&uuq; + const short* vv = (const short*)&vvq; + #if 1 + c64_MMX vmul; vmul.Init16(VR, VG, 0, 0); // R,G,B,0 * vmul = V + c64_MMX umul; umul.Init16(0, UG, UB, 0); // R,G,B,0 * umul = U + #else + // pmaddw does: A,B,C,D and E,F,G,H, A*E + B*F, C*G + D*H + + // we do: R= VR*v + 0*u, G= VG*v + UG*u + // B= 0*v + UB*u, 0*0 + 0*0 + c64_MMX vumul1; vumul1.Init16(VR, 0, VG, UG); + c64_MMX vumul2; vumul2.Init16(0, UB, 0, 0); + #endif + + /* c64_MMX rgb[4]; // four sets of 4*int16, each representing 1 rgb value */ + for(int n=0; n<4; ++n) + { + #if 1 + /* vv is shifted by 3 bits, vmul is shifted by 13 bits + * 16 bits in total, so mul16hi gets the 16-bit downscaled part */ + c64_MMX v; v.Init16(vv[n]); + c64_MMX u; u.Init16(uu[n]); + rgb[n] = v.mul16hi(vmul).add16( + u.mul16hi(umul) ); + #else + c64_MMX vuvu; vuvu.Init16(vv[n], uu[n], vv[n], uu[n]); + c64_MMX madd1 = _mm_madd_pi16(vumul1.value, vuvu.value); + c64_MMX madd2 = _mm_madd_pi16(vumul2.value, vuvu.value); + rgb[n] = madd1.sar32(YUV2RGB_SHIFT) + .conv_s32_s16( + madd2.sar32(YUV2RGB_SHIFT)); + #endif + } + + /* rgb[0] : U,V increment of RGB32 for x0,y0 - x1,y1 + * rgb[1] : U,V increment of RGB32 for x2,y0 - x3,y1 + * rgb[2] : U,V increment of RGB32 for x4,y0 - x5,y1 + * rgb[3] : U,V increment of RGB32 for x6,y0 - x7,y1 + */ + + unsigned yyoffs[4] = { ypos, ypos+1, ypos+width, ypos+width+1 }; + /* c64_MMX yy[4]; // four sets of 4*int16, each representing four Y values */ + for(int n=0; n<4; ++n) + { + c64_MMX luma; luma.Init16( + src[yyoffs[0]+n*2], + src[yyoffs[1]+n*2], + src[yyoffs[2]+n*2], + src[yyoffs[3]+n*2] + ); + luma = luma.sub16(Bits16const::value); + luma = luma.shl16(16 - YUV2RGB_SHIFT); + yy[n] = luma.mul16hi(Bits16const::value); + } + const short* const yyval = (const short*) &yy[0].value; + /* + values in order: + x0y0 x1y0 x0y1 x1y1 + x2y0 x3y0 x2y1 x3y1 + x4y0 x5y0 x4y1 x5y1 + x6y0 x7y0 x6y1 x7y1 + */ + int tmppos = pos; + for(int ny = 0; ny < 4; ny += 2) + { + /* Note: We must use 16-bit pixels here instead of 8-bit, + * because the rgb+Y addition can overflow. conv_s16_u8() + * does the necessary clamping, which would not be done + * if the values were 8-bit. + */ + // 8 pixels for one scanline, repeated twice + /* Note: C++ has no named constructors, so we + * use statement blocks here as substitutes. + */ + c64_MMX r0 + = rgb[0].add16( ({ c64_MMX tmp; tmp.Init16(yyval[ny+0]); tmp; }) ) + .conv_s16_u8( + rgb[0].add16( ({ c64_MMX tmp; tmp.Init16(yyval[ny+1]); tmp; }) )); + c64_MMX r1 + = rgb[1].add16( ({ c64_MMX tmp; tmp.Init16(yyval[ny+4]); tmp; }) ) + .conv_s16_u8( + rgb[1].add16( ({ c64_MMX tmp; tmp.Init16(yyval[ny+5]); tmp; }) )); + c64_MMX r2 + = rgb[2].add16( ({ c64_MMX tmp; tmp.Init16(yyval[ny+8]); tmp; }) ) + .conv_s16_u8( + rgb[2].add16( ({ c64_MMX tmp; tmp.Init16(yyval[ny+9]); tmp; }) )); + c64_MMX r3 + = rgb[3].add16( ({ c64_MMX tmp; tmp.Init16(yyval[ny+12]); tmp; }) ) + .conv_s16_u8( + rgb[3].add16( ({ c64_MMX tmp; tmp.Init16(yyval[ny+13]); tmp; }) )); + + Convert32To24_32bytes(r0,r1,r2,r3, &dest[tmppos]); + tmppos += width*3; // next line + } + upos += 4; + vpos += 4; + ypos += 8; // eight bytes for this line (and eight from next too) + pos += 8*3; // eight triplets generated on this line + x += 8; // eight yy values used on this line + #else /* non-MMX */ + int u = src[upos] - U_ADD; + int v = src[vpos] - V_ADD; + + int rgb[3] = + { + (VR * v ) >> (YUV2RGB_SHIFT), + (VG * v + UG * u) >> (YUV2RGB_SHIFT), + ( + UB * u) >> (YUV2RGB_SHIFT) + }; + + unsigned incr[4] = {0,1,width,width+1}; + + for(unsigned r=0; r<4; ++r) + for(unsigned doffs=pos + incr[r]*3, yoffs=ypos + incr[r], + yy = (Y_REV * (src[yoffs] - Y_ADD)) >> YUV2RGB_SHIFT, + n=0; n<3; ++n) + dest[doffs+n] = c64::clamp_u8(rgb[n] + (int)yy); + + upos += 1; + vpos += 1; + ypos += 2; // two bytes for this line (two from next line) + pos += 2*3; // two triplets generated on this line + x += 2; // two yy values used on this line + #endif + } + ypos += width; + pos += 3*width; + } + #ifdef __MMX__ + _mm_empty(); + #endif +} + +void Convert24To_I420Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width) +{ + Convert_4byte_To_I420Frame<3>(data,dest,npixels,width); +} +void Convert32To_I420Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width) +{ + Convert_4byte_To_I420Frame<4>(data,dest,npixels,width); +} +void Convert15To_I420Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width) +{ + Convert_2byte_To_I420Frame<10,5, 5,5, 0,5>(data,dest,npixels,width); +} +void Convert16To_I420Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width) +{ + Convert_2byte_To_I420Frame<11,5, 5,6, 0,5>(data,dest,npixels,width); +} diff -NaHudr snes9x-1.43-src/snes9x/unix/rgbtorgb.hh snx/snes9x/unix/rgbtorgb.hh --- snes9x-1.43-src/snes9x/unix/rgbtorgb.hh 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/unix/rgbtorgb.hh 2008-02-18 22:55:25.037986000 +0200 @@ -0,0 +1,42 @@ +#ifdef __cplusplus +extern "C" { + #define defaulttrue =true +#else + #define defaulttrue + #define bool int +#endif + +void Convert32To24Frame(const void* data, unsigned char* dest, unsigned npixels) + __attribute__((noinline)); + +void Convert15To24Frame(const void* data, unsigned char* dest, unsigned npixels, bool swap_red_blue defaulttrue) + __attribute__((noinline)); + +void Convert16To24Frame(const void* data, unsigned char* dest, unsigned npixels, bool swap_red_blue defaulttrue) + __attribute__((noinline)); + +void Convert15To32Frame(const void* data, unsigned char* dest, unsigned npixels, bool swap_red_blue defaulttrue) + __attribute__((noinline)); + +void Convert16To32Frame(const void* data, unsigned char* dest, unsigned npixels, bool swap_red_blue defaulttrue) + __attribute__((noinline)); + +void Convert_I420To24Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width, bool swap_red_blue defaulttrue) + __attribute__((noinline)); + +void Convert24To16Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width); + +void Convert24To15Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width); + +void Convert15To_I420Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width); +void Convert16To_I420Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width); +void Convert24To_I420Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width); +void Convert32To_I420Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width); + +#ifdef __cplusplus +} + #undef defaulttrue +#else + #undef defaulttrue + #undef bool +#endif diff -NaHudr snes9x-1.43-src/snes9x/unix/simd.hh snx/snes9x/unix/simd.hh --- snes9x-1.43-src/snes9x/unix/simd.hh 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/unix/simd.hh 2008-02-18 04:56:08.371971000 +0200 @@ -0,0 +1,286 @@ +#if defined(__MMX__) && !defined(__x86_64) +#define USE_MMX +#endif +#if defined(__SSE__) +#define USE_SSE +#endif + +#ifdef __MMX__ +#include +#endif +#ifdef __SSE__ +#include + #ifdef __ICC + typedef __m128 __v4sf; + #endif +#endif + +struct c64_common +{ + static signed char clamp_s8(int_fast64_t v) + { return v<-128 ? -128 : (v > 127 ? 127 : v); } + static unsigned char clamp_u8(int_fast64_t v) + { return v<0 ? 0 : (v > 255 ? 255 : v); } + static short clamp_s16(int_fast64_t v) + { return v<-32768 ? -32768 : (v > 32767 ? 32767 : v); } + + static inline uint_fast64_t expand32_8(uint_fast32_t a) + { + // 0000abcd -> 0a0b0c0d + typedef uint_fast64_t v; + return (a&0xFFU) + | ((a&0xFF00U)<<8) // base: 8+8 = 16 + | ((v)(a&0xFF0000U)<<16) // base: 16+16 = 32 + | ((v)(a&0xFF000000UL)<<24); // base: 24+24 = 48 + } + static inline uint_fast64_t expand32_16(uint_fast32_t a) + { + // 0000abcd -> 00ab00cd + typedef uint_fast64_t v; + return (a&0xFFFFU) + | ((v)(a&0xFFFF0000UL)<<16); // base: 16+16 = 32 + } +}; + +#ifdef __MMX__ +/* 64-bit integers that use MMX / 3Dnow operations where relevant */ +struct c64_MMX: public c64_common +{ + typedef c64_MMX c64; + + __m64 value; + + inline c64_MMX() { } + inline c64_MMX(__m64 v) : value(v) { } + inline c64_MMX(const uint64_t& v) : value( *(const __m64*)& v) { } + + inline c64 operator<< (int b) const { if(b < 0) return *this >> -b; return shl64(b); } + inline c64 operator>> (int b) const { if(b < 0) return *this << -b; return shr64(b); } + c64& operator<<= (int n) { return *this = shl64(n); } + c64& operator>>= (int n) { return *this = shr64(n); } + + c64 conv_s16_u8() const { return conv_s16_u8(*this); } + c64 conv_s16_s8() const { return conv_s16_s8(*this); } + + void Get(const unsigned char* p) { value = *(const __m64*)p; } + void Put( unsigned char* p)const { *(__m64*)p = value; } + + void Init16(short a,short b,short c, short d) + { value = _mm_setr_pi16(a,b,c,d); } + void Init16(short a) + { value = _mm_set1_pi16(a); } + + void GetD(const unsigned char* p) { value = *(const __m64*)p; } + + c64& operator&= (const c64& b) { value=_mm_and_si64(value,b.value); return *this; } + c64& operator|= (const c64& b) { value=_mm_or_si64(value,b.value); return *this; } + c64& operator^= (const c64& b) { value=_mm_xor_si64(value,b.value); return *this; } + + /* psllqi: p = packed + s = shift + r = right, l = left + l = shift in zero, a = shift in sign bit + q = 64-bit, d = 32-bit, w = 16-bit + [i = immed amount] + */ + c64 operator& (const c64& b) const { return c64(_mm_and_si64(value,b.value)); } + c64 operator| (const c64& b) const { return c64(_mm_or_si64(value,b.value)); } + c64 operator^ (const c64& b) const { return c64(_mm_xor_si64(value,b.value)); } + + c64 shl64(int b) const { return _mm_slli_si64(value, b); } + c64 shr64(int b) const { return _mm_srli_si64(value, b); } + c64 shl16(int b) const { return _mm_slli_pi16(value, b); } + c64 shr16(int b) const { return _mm_srli_pi16(value, b); } + c64 sar32(int b) const { return _mm_srai_pi32(value, b); } + c64 sar16(int b) const { return _mm_srai_pi16(value, b); } + c64 add32(const c64& b) const { return _mm_add_pi32(value, b.value); } + c64 add16(const c64& b) const { return _mm_add_pi16(value, b.value); } + c64 sub32(const c64& b) const { return _mm_sub_pi32(value, b.value); } + c64 sub16(const c64& b) const { return _mm_sub_pi16(value, b.value); } + c64 mul16(const c64& b) const { return _mm_mullo_pi16(value, b.value); } + c64 mul16hi(const c64& b) const { return _mm_mulhi_pi16(value, b.value); } + //c64 mul32(const c64& b) const { return _mm_mullo_pi32(value, b.value); } + c64 add8(const c64& b) const { return _mm_add_pi8(value, b.value); } + c64 sub8(const c64& b) const { return _mm_sub_pi8(value, b.value); } + + c64 unpacklbw(const c64& b) const { return _mm_unpacklo_pi8(b.value,value); } + c64 unpacklwd(const c64& b) const { return _mm_unpacklo_pi16(b.value,value); } + c64 unpackhbw(const c64& b) const { return _mm_unpackhi_pi8(b.value,value); } + c64 unpackhwd(const c64& b) const { return _mm_unpackhi_pi16(b.value,value); } + c64 unpackldq(const c64& b) const { return _mm_unpacklo_pi32(b.value,value); } + c64 unpackldq() const { return _mm_unpacklo_pi32(value,value); } + + c64 operator& (const uint64_t& v) { return c64(_mm_and_si64(value, *(const __m64*)& v)); } + + c64 conv_s32_s16(const c64& b) const { return _mm_packs_pi32(value, b.value); } + c64 conv_s16_u8(const c64& b) const { return _mm_packs_pu16(value, b.value); } + c64 conv_s16_s8(const c64& b) const { return _mm_packs_pi16(value, b.value); } +}; +#endif + +struct c64_nonMMX: public c64_common +{ + typedef c64_nonMMX c64; + + uint_least64_t value; + + inline c64_nonMMX() { } + inline c64_nonMMX(uint64_t v) : value(v) { } + + c64 operator<< (int b) const { if(b < 0) return *this >> -b; return shl64(b); } + c64 operator>> (int b) const { if(b < 0) return *this << -b; return shr64(b); } + c64& operator<<= (int n) { return *this = shl64(n); } + c64& operator>>= (int n) { return *this = shr64(n); } + + c64 conv_s16_u8() const { return conv_s16_u8(*this); } + c64 conv_s16_s8() const { return conv_s16_s8(*this); } + + void Init16(short a,short b,short c, short d) + { uint_fast64_t aa = (unsigned short)a, + bb = (unsigned short)b, + cc = (unsigned short)c, + dd = (unsigned short)d; + value = aa | (bb << 16) | (cc << 32) | (dd << 48); } + void Init16(short a) + { Init16(a,a,a,a); } + void Init8(unsigned char a,unsigned char b,unsigned char c,unsigned char d, + unsigned char e,unsigned char f,unsigned char g,unsigned char h) + { + value = ((uint_fast64_t)(a | (b << 8) | (c << 16) | (d << 24))) + | (((uint_fast64_t)e) << 32) + | (((uint_fast64_t)f) << 40) + | (((uint_fast64_t)g) << 48) + | (((uint_fast64_t)h) << 56); + } + + void Get(const unsigned char* p) { value = *(const uint_least64_t*)p; } + void Put( unsigned char* p)const { *(uint_least64_t*)p = value; } + + c64& operator&= (const c64& b) { value&=b.value; return *this; } + c64& operator|= (const c64& b) { value|=b.value; return *this; } + c64& operator^= (const c64& b) { value^=b.value; return *this; } + c64 operator& (const c64& b) const { return value & b.value; } + c64 operator| (const c64& b) const { return value | b.value; } + c64 operator^ (const c64& b) const { return value ^ b.value; } + + c64 operator& (uint_fast64_t b) const { return value & b; } + + #define usimdsim(type, count, op) \ + type* p = (type*)&res.value; \ + for(int n=0; n> b; } + c64 shl16(int b) const { c64 res = *this; usimdsim(short, 2, <<); return res; } + c64 shr16(int b) const { c64 res = *this; usimdsim(unsigned short, 2, >>); return res; } + c64 sar32(int b) const { c64 res = *this; usimdsim(int, 2, >>); return res; } + c64 sar16(int b) const { c64 res = *this; usimdsim(short, 2, >>); return res; } + + c64 add16(const c64& b) const { c64 res = *this; simdsim(short, 4, +); return res; } + c64 sub16(const c64& b) const { c64 res = *this; simdsim(short, 4, -); return res; } + c64 add32(const c64& b) const { c64 res = *this; simdsim(int, 2, +); return res; } + c64 sub32(const c64& b) const { c64 res = *this; simdsim(int, 2, -); return res; } + c64 mul16(const c64& b) const { c64 res = *this; simdsim(short, 4, *); return res; } + c64 mul16hi(const c64& b) const { c64 res = *this; simdsim(short, 4, *) >> 16; return res; } + c64 add8(const c64& b) const { c64 res = *this; simdsim(unsigned char, 8, +); return res; } + c64 sub8(const c64& b) const { c64 res = *this; simdsim(unsigned char, 8, -); return res; } + + #undef simdsim + #undef usimdsim + + c64 conv_s32_s16(const c64& b) const + { + c64 res; res. + Init16(clamp_s16(value & 0xFFFFFFFFU), + clamp_s16(value >> 32), + clamp_s16(b.value & 0xFFFFFFFFU), + clamp_s16(b.value >> 32)); + return res; + } + c64 conv_s16_u8(const c64& b) const + { + c64 res; res. + Init8(clamp_u8(value & 0xFFFF), + clamp_u8((value >> 16) & 0xFFFF), + clamp_u8((value >> 32) & 0xFFFF), + clamp_u8((value >> 48) & 0xFFFF), + clamp_u8(b.value & 0xFFFF), + clamp_u8((b.value >> 16) & 0xFFFF), + clamp_u8((b.value >> 32) & 0xFFFF), + clamp_u8((b.value >> 48) & 0xFFFF)); + return res; + } + c64 conv_s16_s8(const c64& b) const + { + c64 res; res. + Init8(clamp_s8(value & 0xFFFF), + clamp_s8((value >> 16) & 0xFFFF), + clamp_s8((value >> 32) & 0xFFFF), + clamp_s8((value >> 48) & 0xFFFF), + clamp_s8(b.value & 0xFFFF), + clamp_s8((b.value >> 16) & 0xFFFF), + clamp_s8((b.value >> 32) & 0xFFFF), + clamp_s8((b.value >> 48) & 0xFFFF)); + return res; + } + + /* TODO: Verify that these are correct (though they should never be used anyway) */ + c64 unpacklbw(const c64& p) const + { + #if defined(__MMX__) + /* ICC says [error: cast to type "__m64" is not allowed], + * so we cannot use this code on ICC. Fine for GCC. */ + return (uint_least64_t)_m_punpcklbw(*(__m64*)&p.value, *(__m64*)&value); + #else + uint_fast64_t a=value, b=p.value; + return expand32_8(a) | (expand32_8(b) << 8); + #endif + } + c64 unpackhbw(const c64& p) const + { + #if defined(__MMX__) + return (uint_least64_t)_m_punpckhbw(*(__m64*)&p.value, *(__m64*)&value); + #else + uint_fast64_t a=value, b=p.value; + return expand32_8(a>>32) | (expand32_8(b>>32) << 8); + #endif + } + c64 unpacklwd(const c64& p) const + { + #if defined(__MMX__) + return (uint_least64_t)_m_punpcklwd(*(__m64*)&p.value, *(__m64*)&value); + #else + uint_fast64_t a=value, b=p.value; + return expand32_16(a) | (expand32_16(b) << 16); + #endif + } + c64 unpackhwd(const c64& p) const + { + #if defined(__MMX__) + return (uint_least64_t)_m_punpckhwd(*(__m64*)&p.value, *(__m64*)&value); + #else + uint_fast64_t a=value, b=p.value; + return expand32_16(a>>32) | (expand32_16(b>>32) << 16); + #endif + } + c64 unpackldq() const { return unpackldq(*this); } + c64 unpackldq(const c64& p) const + { + #if defined(__MMX__) + return (uint_least64_t)_m_punpckldq(*(__m64*)&p.value, *(__m64*)&value); + #else + return value | (p.value << 32); + #endif + } +}; + +#ifdef USE_MMX +typedef c64_MMX c64; +#else +typedef c64_nonMMX c64; +#endif diff -NaHudr snes9x-1.43-src/snes9x/unix/tiletracker.cc snx/snes9x/unix/tiletracker.cc --- snes9x-1.43-src/snes9x/unix/tiletracker.cc 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/unix/tiletracker.cc 2006-03-02 22:21:52.000000000 +0200 @@ -0,0 +1,608 @@ +#include "tiletracker.hh" + +#if NESVIDEOS_TRACKING + +#include +#include +#include + +#include "uncertainpixel.hh" + +typedef unsigned int uint32 ; +typedef unsigned char uint8 ; +typedef unsigned short uint16; + +#if PIXEL_METHOD==PIXEL_METHOD_CHANGELOG || PIXEL_METHOD==PIXEL_METHOD_LOOPINGLOG +unsigned CurrentTimer = 0; +unsigned SequenceBegin = 0; +struct ScrollingPosition +{ + unsigned org_x, org_y; + unsigned max_x, max_y; +}; +static std::vector scrolls; + +#endif + +class TILE_Tracker +{ + /* In this tracker, alpha = visibility. 0=transparent */ + + int org_x, org_y; + + int xmin,ymin; + int xmax,ymax; + bool first; + + unsigned count; + + int get_min_y() const { return ymin; } + int get_max_y() const { return ymax; } + int get_min_x() const { return xmin; } + int get_max_x() const { return xmax; } + + typedef std::vector vectype; + typedef std::map xmaptype; + typedef std::map ymaptype; + ymaptype screens; + + const std::vector LoadScreen(int ox,int oy, unsigned sx,unsigned sy) + { + // Create the result vector filled with default pixel value + std::vector result(sy*sx, DefaultPixel); + + const int xbegin = ox; + const int xend = ox+sx-1; + + const int xscreen_begin = xbegin/256; + const int xscreen_end = xend /256; + + const int ybegin = oy; + const int yend = oy+sy-1; + + const int yscreen_begin = ybegin/256; + const int yscreen_end = yend /256; + +/* + fprintf(stderr, "Loading screens x(%d..%d)y(%d..%d)\n", + xscreen_begin,xscreen_end, + yscreen_begin,yscreen_end); +*/ + + // Load each cube that falls into the requested region + + unsigned targetpos=0; + unsigned this_cube_ystart = oy&255; + for(int yscreen=yscreen_begin; yscreen<=yscreen_end; ++yscreen) + { + xmaptype& xmap = screens[yscreen]; + + unsigned this_cube_yend = yscreen==yscreen_end ? ((oy+sy-1)&255) : 255; + + unsigned this_cube_xstart = ox&255; + for(int xscreen=xscreen_begin; xscreen<=xscreen_end; ++xscreen) + { + unsigned this_cube_xend = xscreen==xscreen_end ? ((ox+sx-1)&255) : 255; +/* + fprintf(stderr, " Cube(%u,%u)-(%u,%u)\n", + this_cube_xstart,this_cube_xend, + this_cube_ystart,this_cube_yend); +*/ + const vectype& cube = xmap[xscreen]; + /* If this screen is not yet initialized, we'll skip over + * it, since there's no real reason to initialize it at + * this point. */ + if(!cube.empty()) + { + /* Load this particular cube */ + for(unsigned yp=this_cube_ystart, y=0; yp<=this_cube_yend; ++y, ++yp) + { + unsigned srcp = 256*yp + this_cube_xstart - this_cube_xstart; + unsigned destp = sx*y + targetpos - this_cube_xstart; + for(unsigned xp=this_cube_xstart; xp<=this_cube_xend; ++xp) + result[destp + xp] = cube[srcp + xp]; + } + } + + unsigned this_cube_xsize = (this_cube_xend-this_cube_xstart)+1; + + targetpos+= this_cube_xsize; + + this_cube_xstart=0; + } + + unsigned this_cube_ysize = (this_cube_yend-this_cube_ystart)+1; + + targetpos += sx * (this_cube_ysize-1); + + this_cube_ystart=0; + } + + return result; + } + + void PutScreen(const uint16*const input, int ox,int oy, unsigned sx,unsigned sy) + { + /* Nearly the same as LoadScreen. */ + + const int xbegin = ox; + const int xend = ox+sx-1; + + const int xscreen_begin = xbegin/256; + const int xscreen_end = xend /256; + + const int ybegin = oy; + const int yend = oy+sy-1; + + const int yscreen_begin = ybegin/256; + const int yscreen_end = yend /256; + +/* + fprintf(stderr, "Writing screens x(%d..%d)y(%d..%d)\n", + xscreen_begin,xscreen_end, + yscreen_begin,yscreen_end); +*/ + unsigned targetpos=0; + unsigned this_cube_ystart = oy&255; + for(int yscreen=yscreen_begin; yscreen<=yscreen_end; ++yscreen) + { + xmaptype& xmap = screens[yscreen]; + + unsigned this_cube_yend = yscreen==yscreen_end ? ((oy+sy-1)&255) : 255; + + unsigned this_cube_xstart = ox&255; + for(int xscreen=xscreen_begin; xscreen<=xscreen_end; ++xscreen) + { + unsigned this_cube_xend = xscreen==xscreen_end ? ((ox+sx-1)&255) : 255; + + vectype& cube = xmap[xscreen]; + /* If this screen is not yet initialized, we'll initialize it */ + if(cube.empty()) cube.resize(256*256); + +/* + fprintf(stderr, " Cube(%u,%u)-(%u,%u)\n", + this_cube_xstart,this_cube_xend, + this_cube_ystart,this_cube_yend); +*/ + /* Write this particular cube */ + for(unsigned yp=this_cube_ystart, y=0; yp<=this_cube_yend; ++y, ++yp) + for(unsigned xp=this_cube_xstart, x=0; xp<=this_cube_xend; ++x, ++xp) + { + uint16 pix16 = input[targetpos + x + y*sx]; + unsigned r = (pix16 >> (11-3)) & 0xF8; + unsigned g = (pix16 >> (5-2)) & 0xFC; + unsigned b = (pix16 << -(0-3)) & 0xF8; + cube[xp + 256*yp].set(r,g,b); + } + + unsigned this_cube_xsize = (this_cube_xend-this_cube_xstart)+1; + + targetpos+= this_cube_xsize; + + this_cube_xstart=0; + } + + unsigned this_cube_ysize = (this_cube_yend-this_cube_ystart)+1; + + targetpos += sx * (this_cube_ysize-1); + + this_cube_ystart=0; + } + } +public: + TILE_Tracker() : count(0) + { + Reset(); + } + + ~TILE_Tracker() + { + } + +#if PIXEL_METHOD==PIXEL_METHOD_CHANGELOG + std::vector LastScreen; + std::string LastFilename; + + bool veq(const std::vector& a, const std::vector& b) const + { + if(a.size() != b.size()) return false; + return memcmp(&a[0], &b[0], a.size()*sizeof(a[0])) == 0; + } +#endif + + void Cleanup() + { + fprintf(stderr, "Compressing...\n"); + for(ymaptype::iterator y=screens.begin(); y!=screens.end(); ++y) + { + xmaptype& xmap = y->second; + for(xmaptype::iterator x=xmap.begin(); x!=xmap.end(); ++x) + { + vectype& vec = x->second; + for(unsigned a=0; a= LoopLength) SavedTimer = LoopLength; +# endif + for(CurrentTimer=0; CurrentTimer screen = LoadScreen(xmi,ymi, wid,hei); +#if PIXEL_METHOD==PIXEL_METHOD_CHANGELOG + if(veq(screen, LastScreen) && !LastFilename.empty()) + { + fprintf(stderr, "->link (%u,%u)\n", screen.size(), LastScreen.size()); + std::string cmd = "ln "+LastFilename+" "+Filename; + system(cmd.c_str()); + LastScreen = screen; + LastFilename = Filename; + return; + } + LastScreen = screen; + LastFilename = Filename; +#endif + + gdImagePtr im = gdImageCreateTrueColor(wid,hei); + + for(unsigned p=0, y=0; y> 24) & 0xFF, + (pix32 >> 16) & 0xFF, + (pix32 >> 8) & 0xFF + )*/; + gdImageSetPixel(im, x,y, pix); + } + + FILE* fp = fopen(Filename, "wb"); + gdImagePngEx(im, fp, 1); + fclose(fp); + gdImageDestroy(im); + } + + void Reset() + { +#if PIXEL_METHOD==PIXEL_METHOD_CHANGELOG || PIXEL_METHOD==PIXEL_METHOD_LOOPINGLOG + SequenceBegin += CurrentTimer; + CurrentTimer = 0; +#endif + + fprintf(stderr, " Resetting\n"); + screens.clear(); + org_x = 0x40000000; + org_y = 0x40000000; + xmin=xmax=org_x; + ymin=ymax=org_y; + first = true; + } + + void FitScreen(const uint16* buf, + unsigned max_x, + unsigned max_y, + int offs_x, int offs_y, bool suspect) + { +#if !(PIXEL_METHOD==PIXEL_METHOD_CHANGELOG || PIXEL_METHOD==PIXEL_METHOD_LOOPINGLOG) +/* + static unsigned framecounter=0; + if(++framecounter == 600) { Save(); framecounter=0; } +*/ +#endif + + if(offs_x != 0 || offs_y != 0) + { + fprintf(stderr, " Motion(%d,%d), Origo(%d,%d)\n", offs_x,offs_y, org_x,org_y); + } + + org_x += offs_x; org_y += offs_y; + + if(suspect) + { + std::vector oldbuf = LoadScreen(org_x,org_y, max_x,max_y); + unsigned diff = 0; + for(unsigned a=0; a> (11-3)) & 0xF8; + unsigned g = (pix16 >> (5-2)) & 0xFC; + unsigned b = (pix16 << -(0-3)) & 0xF8; + unsigned oldr = ((pix >> 16) & 0xFF); + unsigned oldg = ((pix >> 8) & 0xFF); + unsigned oldb = ((pix >> 0) & 0xFF); + int rdiff = (int)(r-oldr); if(rdiff < 0)rdiff=-rdiff; + int gdiff = (int)(g-oldg); if(gdiff < 0)gdiff=-gdiff; + int bdiff = (int)(b-oldb); if(bdiff < 0)bdiff=-bdiff; + unsigned absdiff = rdiff+gdiff+bdiff; + diff += absdiff; + } + + if(diff > oldbuf.size() * 128) + { +#if 0 + /* Castlevania hack */ + static int org_diff = -180; + org_y += org_diff; + org_diff = -org_diff; +#else +#if 1 + SaveAndReset(); +#endif +#endif + } + } + + if(first || org_x < xmin) xmin = org_x; + if(first || org_y < ymin) ymin = org_y; + int xtmp = org_x+max_x; if(first || xtmp > xmax) xmax=xtmp; + int ytmp = org_y+max_y; if(first || ytmp > ymax) ymax=ytmp; + first=false; + +#if 0 + /* If the image geometry would exceed some bounds */ + if(xmax-xmin > 800 || ymax-ymin > 800) + { + SaveAndReset(); + first=true; + } +#endif + + PutScreen(buf, org_x,org_y, max_x,max_y); +#if PIXEL_METHOD==PIXEL_METHOD_CHANGELOG || PIXEL_METHOD==PIXEL_METHOD_LOOPINGLOG + ScrollingPosition s; + s.org_x = org_x; + s.org_y = org_y; + s.max_x = max_x; + s.max_y = max_y; + scrolls.push_back(s); + + ++CurrentTimer; +#endif + } +} TILE_Tracker; + +extern "C" { /******* PPU variables: **/ + +/* 0..7. Finetuning the scrolling. */ +unsigned NTAWrites=0; +static unsigned VScroll=0; +static unsigned HScroll=0; +static const unsigned MinScanLine = 0; +static const unsigned MaxScanLine = 272; +static unsigned ScrollPointers[MaxScanLine] = { 0 }; +static unsigned PrevScrollingDefault = 0; +void TILE_SaveScroll(unsigned H, unsigned V, int scanline) +{ +/* + printf("[%3d] %u,%u\n", scanline, H,V); + fflush(stdout); +*/ + if(scanline < 0 || scanline >= (int)MaxScanLine) return; + + unsigned code = H*4000+V; + ScrollPointers[scanline] = code + 1; +} +static void GetScroll(unsigned& First, unsigned& Last) +{ + std::map ScrollUsages; + // Take the most common value that appeared during the frame. + + // snes9x: take the first value and duplicate it to the frame. + for(unsigned a=0; a max) { max = usage; result = value; } + } + PrevScrollingDefault = prev; + + // Find the region that has this scrolling value, stored in "result". + int state=0; + for(unsigned a=MinScanLine; a < MaxScanLine && state < 2; ++a) + { + unsigned value = ScrollPointers[a]; + if(value == 0) continue; + --value; + switch(state) + { + case 0: if(value == result) { First = a; state = 1; } break; + case 1: if(value != result) { Last =a-1; state = 2; } break; + } + } + + VScroll = result % 4000; + HScroll = result / 4000; + + fprintf(stderr, "%u-%u: %u,%u\n", First,Last, HScroll,VScroll); + + if(First > 0 && First < 8) + { + //fprintf(stderr, "First < 8 !\n"); + + VScroll = (VScroll + 240 - First) % 240; + + First = 0; + } + + for(unsigned a=MinScanLine; a> (11-3)) & 0xF8; + unsigned g = (pix16 >> (5-2)) & 0xFC; + unsigned b = (pix16 << -(0-3)) & 0xF8; + unsigned pix32 = gdTrueColor(r,g,b); + gdImageSetPixel(im, x,y, pix32); + } + + char Filename[512]; + static unsigned count=0; + sprintf(Filename, "tile-%04u.png", count++); + + FILE* fp = fopen(Filename, "wb"); + gdImagePngEx(im, fp, 1); + fclose(fp); + gdImageDestroy(im); + return; +#endif + + unsigned FirstLine = 0; + unsigned LastLine = height-1; + + GetScroll(FirstLine,LastLine); + + //LastLine -= 10*8; + + //if(LastLine >= height) LastLine=height-1; + //FirstLine=0; + //LastLine =height-1; + + LastLine=194-16; + FirstLine=0; + + static unsigned PrevV; + static unsigned PrevH; + static bool first=true; + if(first) { PrevV=VScroll; PrevH=HScroll; first=false; } + + fprintf(stderr, "Firstline %u,%u\n", FirstLine,LastLine); + + //VScroll += FirstLine; + + int vdiff = (VScroll+240-PrevV)%240; PrevV=VScroll; + int hdiff = (HScroll+256-PrevH)%256; PrevH=HScroll; + + if(hdiff >= 128) hdiff -= 256; + if(vdiff >= 120) vdiff -= 240; + + //long absdiff2 = (hdiff*hdiff) + (vdiff*vdiff); + + bool suspect = false; + if(/*absdiff2 > 20*20 || */NTAWrites > 100) + { + // suspect = true; + } + +/* + if(NTAWrites != 0) + fprintf(stderr, "%ld NTA writes\n", NTAWrites); +*/ + TILE_Tracker.FitScreen + ( + buf + FirstLine*width, + width, LastLine-FirstLine+1, + hdiff, vdiff, suspect + ); + NTAWrites = 0; +} + +void TILE_ForceSave() +{ + TILE_Tracker.SaveAndReset(); +} + + + +} + +#else +extern "C" { +void TILE_ForceSave() { } +void TILE_SaveScroll(unsigned H, unsigned V, int scanline) { } +void TILE_TrackFrame(const void*data, unsigned width, unsigned height) { } +} + +#endif diff -NaHudr snes9x-1.43-src/snes9x/unix/tiletracker.hh snx/snes9x/unix/tiletracker.hh --- snes9x-1.43-src/snes9x/unix/tiletracker.hh 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/unix/tiletracker.hh 2006-03-03 20:15:35.000000000 +0200 @@ -0,0 +1,19 @@ +//#define NESVIDEOS_TRACKING 1 + +#ifdef __cplusplus +extern "C" { +#endif +extern void TILE_TrackFrame(const void*data, unsigned width, unsigned height); +extern void TILE_ForceSave(); +extern void TILE_SaveScroll(unsigned H, unsigned V, int scanline); + + +#ifdef NESVIDEOS_TRACKING +# define TILE_ClearScroll(H,V) H=V=0 +#else +# define TILE_ClearScroll(H,V) +#endif + +#ifdef __cplusplus +} +#endif diff -NaHudr snes9x-1.43-src/snes9x/unix/uncertainpixel.hh snx/snes9x/unix/uncertainpixel.hh --- snes9x-1.43-src/snes9x/unix/uncertainpixel.hh 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/unix/uncertainpixel.hh 2008-02-06 13:00:28.817884000 +0200 @@ -0,0 +1,536 @@ +typedef unsigned int uint32 ; +typedef unsigned char uint8 ; +typedef unsigned short uint16; + +#define PIXEL_METHOD_AVERAGE 0 +#define PIXEL_METHOD_MOST_USED 1 +#define PIXEL_METHOD_MOST_USED16 2 +#define PIXEL_METHOD_CHANGELOG 3 +#define PIXEL_METHOD_LOOPINGLOG 4 +#define PIXEL_METHOD_LAST 5 + +#define PIXEL_METHOD PIXEL_METHOD_CHANGELOG +//#define PIXEL_METHOD PIXEL_METHOD_MOST_USED16 +//#define PIXEL_METHOD PIXEL_METHOD_AVERAGE +//#define PIXEL_METHOD PIXEL_METHOD_LOOPINGLOG + +#if PIXEL_METHOD==PIXEL_METHOD_LOOPINGLOG +static const unsigned LoopLength = 90; +#endif + +/* undef or define. */ +#define CHANGELOG_GUESS_OUTSIDES + +static const uint32 DefaultPixel = 0x404041; + +#include +#include +#include + +#if 1 +#define VecType std::vector +#else +template +class VecType +{ +public: + typedef T* iterator; + typedef const T* const_iterator; + typedef T& reference; + typedef const T& const_reference; + +public: + VecType() : data(0),len(0) { } + ~VecType() { if(len) delete[] data; } + + void reserve(unsigned) { } /* ignore */ + + VecType(const VecType& b) : len(b.len) + { + if(len) + { + data = new T[len]; + std::copy(b.begin(),b.end(), data); + } + } + VecType& operator= (const VecType& b) + { + if(&b == this) return *this; + if(len) { delete[] data; if(!b.len) { len=0; data=0; return *this; } } + len = b.len; + data = new T[len]; + std::copy(b.begin(),b.end(), data); + return *this; + } +public: + reference operator[] (unsigned ind) { return data[ind]; } + iterator begin() { return data; } + iterator end() { return data+len; } + const_iterator begin() const { return data; } + const_iterator end() const { return data+len; } + unsigned size() const { return len; } + iterator insert(iterator pos, T value) + { + if(!len) { data = new T[1]; *data = value; return data; } + + T* newdata = new T[len+1]; + unsigned diff = pos-data; + std::copy(data,pos, newdata); + newdata[diff] = value; + std::copy(pos, data+len, newdata+diff+1); + delete[] data; + data = newdata; + ++len; + return newdata + diff; + } +private: + T* data; + unsigned len; +}; +#endif + +template +class MapType +{ +public: + typedef K key_type; + typedef V mapped_type; + typedef std::pair value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; +private: + typedef VecType rep; + rep data; + +public: + MapType() { } + + typedef typename rep::iterator iterator; + typedef typename rep::const_iterator const_iterator; + + const_iterator begin() const { return data.begin(); } + const_iterator end() const { return data.end(); } + iterator begin() { return data.begin(); } + iterator end() { return data.end(); } + + void clear() + { + std::_Destroy(&data); + std::_Construct(&data); + } + + iterator lower_bound(K key) + { + iterator first = begin(), last = end(); + unsigned limit; + while(__builtin_expect((limit=last-first) > 0, 1)) + { + iterator middle = first + (limit>>1); + if(middle->first < key) + first = middle+1; + else + last = middle; + } + return first; + } + V& operator[] (K key) + { + iterator i = lower_bound(key); + if(i == end() || i->first > key) + { + i = data.insert(i, value_type(key, V())); + } + return i->second; + } +}; + +class MostUsedPixel +{ + typedef MapType vmap; + vmap values; + unsigned pix; + unsigned short max; + //bool final; +public: + MostUsedPixel() : pix(DefaultPixel),max(0) //, final(false) + { + } + void set(unsigned R,unsigned G,unsigned B) + { + //if(final) return; + uint32 p = (((R) << 16) + ((G) << 8) + (B)); + set_p(p); + } + void set_p(uint32 p) + { + unsigned short v = ++values[p]; + if(v > max) { max = v; pix = p; } + //if(v > 300) { final=true; values.clear(); } + } + uint32 value_ignore(uint32 ignore) const + { + if(pix != ignore) return pix; + unsigned max2 = 0; + uint32 result = DefaultPixel; + for(vmap::const_iterator i = values.begin(); i != values.end(); ++i) + { + if(i->first != ignore) + { + unsigned v = i->second; + if(v > max2) { max2 = v; result = i->first; } + } + } + return result; + } + operator uint32() const { return pix; } + void Compress() + { + values.clear(); + } + void CompressButIgnore(uint32 ignore) + { + pix = value_ignore(ignore); + values.clear(); + } +}; + +class AveragePixel +{ + unsigned r,g,b; + unsigned n; + unsigned pix; +public: + AveragePixel() : r(0),g(0),b(0),n(0), pix(DefaultPixel) + { + } + void set(unsigned R,unsigned G,unsigned B) + { + r+=R; g+=G; b+=B; + ++n; + + pix = (((r/n) << 16) + ((g/n) << 8) + (b/n)); + } + operator uint32() const { return pix; } + void Compress() + { + } +}; + +class LastPixel +{ + unsigned pix; +public: + LastPixel() : pix(DefaultPixel) + { + } + void set(unsigned R,unsigned G,unsigned B) + { + set_p(((R) << 16) + ((G) << 8) + B); + } + void set_p(uint32 p) + { + pix = p; + } + operator uint32() const { return pix; } + void Compress() + { + } +}; + +#if PIXEL_METHOD==PIXEL_METHOD_AVERAGE +typedef AveragePixel UncertainPixel; +#endif + +#if PIXEL_METHOD==PIXEL_METHOD_MOST_USED +typedef MostUsedPixel UncertainPixel; +#endif + +#if PIXEL_METHOD==PIXEL_METHOD_MOST_USED16 +class UncertainPixel +{ + static const unsigned BUFFER_SIZE = 16; + + // Read the first BUFFER_SIZE amount of pixels into this buffer. + // The last item is reused as a place for the current most common pixel. + unsigned pixels[BUFFER_SIZE]; + + // Index to the current unused place in the buffer: + unsigned pixelIndex; + + public: + UncertainPixel(): pixelIndex(0) + { + // By default the color of the current most common pixel is black: + pixels[BUFFER_SIZE-1] = 0; + } + + void set(unsigned r, unsigned g, unsigned b) + { + // If we have already read BUFFER_SIZE pixels, ignore the rest: + if(pixelIndex == BUFFER_SIZE) return; + + const unsigned newPixel = (r<<16) | (g<<8) | b; + + // Insert the new pixel into its sorted place: + unsigned i = pixelIndex; + while(i > 0 && pixels[i-1] > newPixel) + { + pixels[i] = pixels[i-1]; + --i; + } + pixels[i] = newPixel; + ++pixelIndex; + + // Count the most used pixel and put it to end of the buffer: + unsigned currentMaxCount = 0, mostUsedPixel = 0; + for(i = 0; i < pixelIndex;) + { + unsigned currentPixel = pixels[i], count = 1; + while(++i < pixelIndex && pixels[i] == currentPixel) + ++count; + if(count > currentMaxCount) + { + mostUsedPixel = currentPixel; + currentMaxCount = count; + } + } + pixels[BUFFER_SIZE-1] = mostUsedPixel; + } + + operator uint32() const + { + return pixels[BUFFER_SIZE-1]; + } + + void Compress() + { + } +}; +#endif + +#if PIXEL_METHOD==PIXEL_METHOD_CHANGELOG +#include +#include +# include "hash.hh" +extern unsigned CurrentTimer; +class UncertainPixel +{ + struct historyitem + { + unsigned moment; + unsigned pixel; + public: + historyitem() { } + + // Because std::upper_bound doesn't allow searching by types + // other than what the container has, here are utility functions + // to handle this container as if it only contained the "moment" value. + // Conveniently, it allows also the insertion of the "first moment" pixel. + historyitem(unsigned time) : moment(time) { } + bool operator< (const historyitem& b) const { return moment < b.moment; } + }; + + std::vector history; + unsigned lastpixel; + unsigned lastmoment; + +#ifdef CHANGELOG_GUESS_OUTSIDES + bool FirstMomentIsVague; + MostUsedPixel first_moment; +#endif + +#if 0 + MapType minvalues; +#endif +public: + UncertainPixel() : lastpixel(DefaultPixel), lastmoment(0) +#ifdef CHANGELOG_GUESS_OUTSIDES + , FirstMomentIsVague(true) +#endif + { + } + void set(unsigned R,unsigned G,unsigned B) + { + unsigned p = (((R) << 16) + ((G) << 8) + (B)); + + if(CurrentTimer == 0) + { + // Ignore first frame. It's gray. + return; + } + +#if 0 + ++minvalues[p]; +#endif + + // Store the value into the history. + // (But only if it's different than previous value.) + if(lastpixel != p || history.empty()) + { + lastpixel = p; + + if(CurrentTimer == 0) + { + // The value of the pixel at first moment is precisely known. +#ifdef CHANGELOG_GUESS_OUTSIDES + FirstMomentIsVague = false; +#endif + } + else if(history.empty()) + { + // The value of the pixel at the first moment is not precisely known. +#ifdef CHANGELOG_GUESS_OUTSIDES + FirstMomentIsVague = true; + history.push_back(historyitem(0)); +#endif + } + + historyitem item; + item.pixel = p; + item.moment = CurrentTimer; + + history.push_back(item); + } +#ifdef CHANGELOG_GUESS_OUTSIDES + if(FirstMomentIsVague) UpdateFirstMoment(p); +#endif + lastmoment = CurrentTimer; + } + + operator uint32() const + { +#if 0 + /* Return the rarest of the last N values. */ + unsigned tmpmin = lastmoment; + unsigned retval = Find(0); + for(MapType::const_iterator + i = minvalues.begin(); + i != minvalues.end(); + ++i) + { + if(i->second <= tmpmin) { tmpmin = i->second; retval = i->first; } + } + return retval; +#else + return Find(CurrentTimer); +#endif + } + + void Compress() + { +#ifdef CHANGELOG_GUESS_OUTSIDES + first_moment.Compress(); +#endif + } + +private: + uint32 Find(unsigned time) const + { + // Find the pixel value that was present at the given time. + /* + map::lower_bound: + Returns an iterator pointing to first element >= key, or end(). + map::upper_bound: + Returns an iterator pointing to the first element > key, or end(). + + What we want is an iterator pointing + to the last element that is <= key. + */ + std::vector::const_iterator + i = std::upper_bound(history.begin(), history.end(), historyitem(time)); + + /* Pre-begin value: reasonable default */ + if(i == history.begin()) + { +#ifdef CHANGELOG_GUESS_OUTSIDES + return lastpixel; +#else + return DefaultPixel; +#endif + } + +#if 1 + /* Post-end value: Special handling */ + if(i == history.end()) + { + /* If the last value is somewhat behind the chosen moment, + * take the reasonable default instead */ + if(lastmoment+0 < time) + { +#ifdef CHANGELOG_GUESS_OUTSIDES + return history[0].pixel; +#else + return DefaultPixel; +#endif + } + } +#endif + + /* Anything else. Take the value. */ + --i; + return i->pixel; + } + +private: +#ifdef CHANGELOG_GUESS_OUTSIDES + void UpdateFirstMoment(uint32 p) + { + // Updates the value of the pixel at the first moment to the value + // that has appeared the most. + first_moment.set_p(p); + history[0].pixel = first_moment; + } +#endif +}; +#endif + +#if PIXEL_METHOD==PIXEL_METHOD_LOOPINGLOG +#include +#include +# include "hash.hh" +extern unsigned CurrentTimer; +class UncertainPixel +{ + MostUsedPixel most_used; + + LastPixel history[LoopLength]; +public: + UncertainPixel() + { + } + void set(unsigned R,unsigned G,unsigned B) + { + uint32 p = (((R) << 16) + ((G) << 8) + (B)); + if(CurrentTimer == 0) + { + // Ignore first frame. It's gray. + return; + } + most_used.set_p(p); + + unsigned offs = CurrentTimer % LoopLength; + if(history[offs] == DefaultPixel || p != most_used) + history[offs].set_p(p); + } + operator uint32() const + { + unsigned offs = CurrentTimer % LoopLength; + uint32 result = history[offs];//.value_ignore(most_used); + if(result == DefaultPixel) return most_used; + return result; + } + + void Compress() + { + most_used.Compress(); + //for(unsigned a=0; a= limit; - if(IPPU.RenderThisFrame) - { - IPPU.SkippedFrames = 0; - } - else - { - /* If we were behind the schedule, check how much it is */ - if(timercmp(&next1, &now, <)) - { - unsigned lag = - (now.tv_sec - next1.tv_sec) * 1000000 - + now.tv_usec - next1.tv_usec; - if(lag >= 1000000) - { - /* More than a second behind means probably - * pause. The next line prevents the magic - * fast-forward effect. - */ - next1 = now; - } - } - } + + + + + if (FromPause) + { + next1 = now; + FromPause = 0; + } + else + { + // Unforseen events, such as SIGSTOP, severe system lag, etc + unsigned lag = (now.tv_sec - next1.tv_sec) * 1000000 + now.tv_usec - next1.tv_usec; + + // I'm using 0.25 of a second instead of 1.00 +// if (lag >= 250000) +// next1 = now; + + } +// IPPU.RenderThisFrame = ++IPPU.SkippedFrames >= limit; +// if(IPPU.RenderThisFrame) +// { +// IPPU.SkippedFrames = 0; +// } +// else +// { +// /* If we were behind the schedule, check how much it is */ +// if(timercmp(&next1, &now, <)) +// { +// unsigned lag = +// (now.tv_sec - next1.tv_sec) * 1000000 +// + now.tv_usec - next1.tv_usec; +// if(lag >= 1000000) +// { +// /* More than a second behind means probably +// * pause. The next line prevents the magic +// * fast-forward effect. +// */ +// next1 = now; +// } +// } +// } /* Delay until we're completed this frame */ @@ -1661,8 +1717,30 @@ { /* Linux version (OSS) */ int J, K; + - if ((so.sound_fd = open ("/dev/dsp", O_WRONLY)) < 0) + if (Settings.Mute) + { + + // Do all sound setup without opening /dev/dsp + so.sixteen_bit = true; + so.stereo = true; + so.playback_rate = Rates[mode & 0x07]; + S9xSetPlaybackRate (so.playback_rate); + + if (buffer_size == 0) + buffer_size = BufferSizes [mode & 7]; + + if (buffer_size > MAX_BUFFER_SIZE / 4) + buffer_size = MAX_BUFFER_SIZE / 4; + if (so.sixteen_bit) + buffer_size *= 2; + if (so.stereo) + buffer_size *= 2; + return TRUE; + } + + if ((so.sound_fd = open ("/dev/dsp", O_NONBLOCK|O_WRONLY)) < 0) { perror ("/dev/dsp"); return (FALSE); @@ -1811,10 +1889,30 @@ #endif #if !defined(NOSOUND) && (defined (__linux) || defined (__sun)) +static unsigned GetFrameSoundSize() +{ +#if 1 + return so.playback_rate * Settings.FrameTime / 1000000; +#else + const double FPS = 1000000.0 / Settings.FrameTime; + const double Todo = so.playback_rate / FPS; + static double Over=0; + unsigned result = (unsigned) Todo; + Over += Todo-result; + unsigned IntOver = (unsigned)Over; + result += IntOver; + Over -= IntOver; + fprintf(stderr, "[%u]", result); fflush(stderr); + return result; +#endif +} + + void S9xGenerateSound () { /* Linux and Sun versions */ +/* Mass comment-out! int bytes_so_far = so.sixteen_bit ? (so.samples_mixed_so_far << 1) : so.samples_mixed_so_far; if (Settings.SoundSync == 2) @@ -1893,6 +1991,39 @@ S9xProcessSound (NULL); pending_signal = FALSE; } + + */ + uint8 Buf[262144]; + unsigned N = GetFrameSoundSize(); + if (so.stereo) N *= 2; + S9xMixSamplesO(Buf, N, 0); + + if(ignoreframes == 0) + { + //fprintf(stderr, "playback rate %d\n", so.playback_rate); + NESVideoLoggingAudio(Buf, + so.playback_rate, so.sixteen_bit?16:8, so.stereo?2:1, + N / (so.stereo ? 2 : 1)); + } + + if (so.sixteen_bit) N *= 2; + + if (!Settings.Mute) + { + if(Settings.TurboMode) + { + fcntl(so.sound_fd, F_SETFL, + fcntl(so.sound_fd, F_GETFL) | O_NONBLOCK); + } + else + { + fcntl(so.sound_fd, F_SETFL, + fcntl(so.sound_fd, F_GETFL) & ~O_NONBLOCK); + } + write(so.sound_fd, Buf, N); + } + + AudioLogger(Buf, N); } void *S9xProcessSound (void *) @@ -1901,7 +2032,8 @@ /* If threads in use, this is to loop indefinitely */ /* If not, this will be called by timer */ - + S9xGenerateSound(); + return NULL; #ifdef __linux audio_buf_info info; @@ -1972,6 +2104,16 @@ block_generate_sound = TRUE; + if(LoggingEnabled || do_beauty_analysis) + { + /* When recording AVI, we handle the audio in unix/x11.cpp + * in a non-blocking mode for both accuracy and speed. + */ +# ifdef USE_THREADS + if(Settings.ThreadSound)sleep(1); +# endif + goto DoneLogging; + } /* If we need more audio samples */ if (so.samples_mixed_so_far < sample_count) { @@ -2019,7 +2161,8 @@ } if(I == 0) break; - I = write (so.sound_fd, (char *) Buf + byte_offset, I); + if (!Settings.Mute) + I = write (so.sound_fd, (char *) Buf + byte_offset, I); if (I > 0) { bytes_to_write -= I; @@ -2031,6 +2174,7 @@ } /* All data sent. */ } +DoneLogging: so.samples_mixed_so_far -= sample_count; @@ -2039,7 +2183,7 @@ #endif #ifdef __sun - if (!Settings.ThreadSound) + if (!Settings.ThreadSound && !Settings.Mute) write (so.sound_fd, NULL, 0); #endif diff -NaHudr snes9x-1.43-src/snes9x/unix/x11.cpp snx/snes9x/unix/x11.cpp --- snes9x-1.43-src/snes9x/unix/x11.cpp 2004-12-31 00:15:47.000000000 +0200 +++ snx/snes9x/unix/x11.cpp 2008-02-18 22:45:25.275920000 +0200 @@ -108,6 +108,17 @@ #include "soundux.h" #include "x11.h" #include "spc7110.h" +#include "logger.h" + +#include + +#include "nesvideos-piece.hh" +#include "rgbtorgb.hh" + +#include "tiletracker.hh" +#include "beauty.hh" + +#include "ntsc/snes_ntsc.h" #if 0 #define QT_CLEAN_NAMESPACE @@ -120,12 +131,16 @@ #include #include +//#undef MITSHM /* REMOTE WORKING // BISQWIT */ +//#undef USE_GLIDE + #ifdef USE_GLIDE bool8 S9xGlideEnable (bool8); void S9xGlidePutImage (int, int); void S9xSwitchToGlideMode (bool8); #endif + #ifdef USE_AIDO #include "aido.h" #endif @@ -144,6 +159,9 @@ #define SELECT_BROKEN_FOR_SIGNALS #endif +extern int FromPause; +extern int do_beauty_analysis; + #ifdef USE_DGA_EXTENSION #include @@ -227,6 +245,8 @@ void S9xDeinitDisplay () { + TILE_ForceSave(); + #ifdef USE_GLIDE S9xGlideEnable (FALSE); #elif USE_AIDO @@ -290,6 +310,14 @@ GUI.window_width = IMAGE_WIDTH; GUI.window_height = IMAGE_HEIGHT; + if(GUI.interpolate == 6) + { + fprintf(stderr, "width was %u\n", GUI.window_width); + GUI.window_width = SNES_NTSC_OUT_WIDTH(256); + while(GUI.window_width%16) ++GUI.window_width; + fprintf(stderr, "width became %u\n", GUI.window_width); + } + #ifdef USE_OPENGL // XXX: Settings.OpenGLEnable = TRUE; @@ -496,7 +524,7 @@ delete[] color_diff; XSetWindowAttributes attrib; - + attrib.background_pixel = BlackPixelOfScreen (GUI.screen); GUI.window = XCreateWindow (GUI.display, RootWindowOfScreen (GUI.screen), (WidthOfScreen(GUI.screen) - GUI.window_width) / 2, @@ -623,7 +651,7 @@ image_height = 239 * 2; GUI.image_needs_scaling = (GUI.window_width != 512 || GUI.window_height != 239 * 2) && - GUI.interpolate != 5; + GUI.interpolate < 5; } else { @@ -819,7 +847,7 @@ if (GUI.delta_screen) memset (GUI.delta_screen, 0xff, GFX.Pitch * h); if (GUI.interpolated_screen) - ZeroMemory (GUI.interpolated_screen, 512 * 478 * 2); + ZeroMemory (GUI.interpolated_screen, GUI.window_width * 478 * 2); if (Settings.SixteenBit && GUI.interpolate) { // Offset the rendering of the SNES image by at least one pixel because @@ -1004,8 +1032,11 @@ WRITE_MOVIE_ASK, LOAD_MOVIE_ASK, STOP_MOVIE, - - FUNC_LAST = STOP_MOVIE /* update this to match the last token */ + SELECT_SAVE_NUM, + READONLY_MOVIE_TOGGLE, + FRAMEADVANCE, + DISP_KEYS, + FUNC_LAST = DISP_KEYS /* update this to match the last token */ }; static const char* GetFuncName(functiontype func) { @@ -1044,6 +1075,10 @@ case WRITE_MOVIE_ASK: return "WRITE_MOVIE_ASK"; case LOAD_MOVIE_ASK: return "LOAD_MOVIE_ASK"; case STOP_MOVIE: return "STOP_MOVIE"; + case SELECT_SAVE_NUM: return "SELECT_SAVE_NUM"; + case READONLY_MOVIE_TOGGLE: return "READONLY_MOVIE_TOGGLE"; + case FRAMEADVANCE: return "FRAMEADVANCE"; + case DISP_KEYS: return "DISP_KEYS"; default: return "unknown"; } } @@ -1059,12 +1094,9 @@ unsigned param; bool inited; int sym; const char *prefix; - private: - /* ensure nobody uses the assignment operator on us */ - void operator=(const Keyfunction& b); public: - Keyfunction(): func(FUNC_NONE), inited(false) {} - Keyfunction(functiontype f,unsigned p): func(f),param(p), inited(true) {} + Keyfunction(): func(FUNC_NONE), param(), inited(false), sym(),prefix() {} + Keyfunction(functiontype f,unsigned p): func(f),param(p), inited(true),sym(),prefix() {} void Assign(const Keyfunction& b) { if(inited) @@ -1170,6 +1202,37 @@ /* Contruct the keyboard setup upon program start. */ KeyboardSetup() { +#if 1 + // player 1: tr,tl, x,a + Define(PLAYING_KEY, 0x00000010, XK_z); + Define(PLAYING_KEY, 0x00000020, XK_c); + Define(PLAYING_KEY, 0x00000040, XK_a); + Define(PLAYING_KEY, 0x00000080, XK_d); + // player 1: right,left,down,up + Define(PLAYING_KEY, 0x00000100, XK_Right); + Define(PLAYING_KEY, 0x00000200, XK_Left); + Define(PLAYING_KEY, 0x00000400, XK_Down); + Define(PLAYING_KEY, 0x00000800, XK_Up); + // player 1: start,select, y,b + Define(PLAYING_KEY, 0x00001000, XK_p); + Define(PLAYING_KEY, 0x00002000, XK_h); + Define(PLAYING_KEY, 0x00004000, XK_w); + Define(PLAYING_KEY, 0x00008000, XK_x); + + Define(WRITE_SAVE_NUM, (unsigned)-1, XK_s); + Define(LOAD_SAVE_NUM, (unsigned)-1, XK_f); + Define(SELECT_SAVE_NUM, 1, Alt(XK_1)); + Define(SELECT_SAVE_NUM, 2, Alt(XK_2)); + Define(SELECT_SAVE_NUM, 3, Alt(XK_3)); + Define(SELECT_SAVE_NUM, 4, Alt(XK_4)); + Define(SELECT_SAVE_NUM, 5, Alt(XK_5)); + Define(SELECT_SAVE_NUM, 6, Alt(XK_6)); + Define(SELECT_SAVE_NUM, 7, Alt(XK_7)); + Define(SELECT_SAVE_NUM, 8, Alt(XK_8)); + Define(SELECT_SAVE_NUM, 9, Alt(XK_9)); + Define(SELECT_SAVE_NUM,10, Alt(XK_0)); + Define(FRAMEADVANCE, 0, XK_asciitilde, XK_apostrophe); +#else // player 1: tr,tl, x,a Define(PLAYING_KEY, 0x00000010, XK_z, XK_w, XK_b); Define(PLAYING_KEY, 0x00000020, XK_a, XK_q, XK_v); @@ -1185,6 +1248,8 @@ Define(PLAYING_KEY, 0x00002000, XK_space); Define(PLAYING_KEY, 0x00004000, XK_x, XK_r, XK_comma); Define(PLAYING_KEY, 0x00008000, XK_y, XK_c); + Define(FRAMEADVANCE, 0, XK_backslash, XK_bracketleft, XK_bracketright); +#endif // player 2: tr,tl, x,a Define(PLAYING_KEY, 0x00100000, XK_Delete); Define(PLAYING_KEY, 0x00200000, XK_Insert); @@ -1249,8 +1314,12 @@ Define(FRAMETIME_DEC, 0, Shift(XK_minus)); Define(FRAMESKIP_INC, 0, XK_equal, XK_plus); Define(FRAMESKIP_DEC, 0, XK_minus); +#if 1 // pause + Define(PAUSE, 0, XK_Return, XK_Pause, XK_Break); +#else Define(PAUSE, 0, XK_Pause, XK_Break, XK_Scroll_Lock); +#endif // misc functions Define(DGA_FULLSCREEN, 0, Alt(XK_Return)); Define(SCREENSHOT, 0, XK_Print); @@ -1262,8 +1331,11 @@ Define(TOGGLE_TRANSP, 0, XK_9); Define(TOGGLE_CLIPWIN, 0, XK_BackSpace); Define(TOGGLE_CONTROLLER, 0, XK_7); - Define(TOGGLE_INTERPSOUND, 0, XK_bracketleft, Alt(XK_8)); - Define(TOGGLE_SYNCSOUND, 0, XK_bracketright, Alt(XK_9)); +// I'm claiming these in the name of Frame Advance +// Define(TOGGLE_INTERPSOUND, 0, XK_bracketleft, Alt(XK_8)); +// Define(TOGGLE_SYNCSOUND, 0, XK_bracketright, Alt(XK_9)); + Define(TOGGLE_INTERPSOUND, 0, Alt(XK_8)); + Define(TOGGLE_SYNCSOUND, 0, Alt(XK_9)); Define(TOGGLE_MODE7INTERP, 0, Shift(XK_9)); Define(TURBO_ENABLE, 0, XK_Tab); Define(SUPERSCOPE_TURBO, 0, XK_grave, XK_asciitilde, XK_numbersign); @@ -1274,7 +1346,9 @@ Define(WRITE_MOVIE_ASK, 0, Shift(XK_1)); Define(LOAD_MOVIE_ASK, 0, Shift(XK_2)); Define(STOP_MOVIE, 0, Shift(XK_3)); + Define(READONLY_MOVIE_TOGGLE,0,Shift(XK_4)); + Define(DISP_KEYS, 0, XK_comma); VerifySetup(); } public: @@ -1304,6 +1378,55 @@ } } KBSetup; +static unsigned QuicksaveNumber = 1; +static void S9xSelectQuicksaveNumber(unsigned n) +{ + QuicksaveNumber = n; + sprintf (GUI.info_string, "Quicksave slot %u selected", n); + S9xInfoMessage (GUI.info_string); +} + +static int AutoLoadSlot = -1; +static void LoadStateFromSlot(int slot) +{ + char def [PATH_MAX]; + char filename [PATH_MAX]; + char drive [_MAX_DRIVE]; + char dir [_MAX_DIR]; + char ext [_MAX_EXT]; + + _splitpath (Memory.ROMFilename, drive, dir, def, ext); + sprintf (filename, "%s%s%s.%03d", + S9xGetSnapshotDirectory (), SLASH_STR, def, + slot); + if (S9xUnfreezeGame (filename)) + { + sprintf (GUI.info_string, "%s.%03d loaded", def, slot); + S9xInfoMessage (GUI.info_string); + } + else + { + static char *digits = "t123456789"; + _splitpath (Memory.ROMFilename, drive, dir, def, ext); + sprintf (filename, "%s%s%s.zs%c", + S9xGetSnapshotDirectory (), SLASH_STR, + def, digits [slot]); + if (S9xUnfreezeGame (filename)) + { + sprintf (GUI.info_string, "Loaded ZSNES freeze file %s.zs%c", + def, digits [slot]); + S9xInfoMessage (GUI.info_string); + } + else + { + sprintf (GUI.info_string, "Freeze file %u not found", + slot); + S9xMessage (S9X_ERROR, S9X_FREEZE_FILE_NOT_FOUND, + GUI.info_string); + } + } +} + void S9xProcessEvents (bool8 block) { #ifdef USE_AIDO @@ -1314,6 +1437,27 @@ } #endif + if (autodemo[0]) + { + S9xMovieOpen(autodemo, true); + printf("Autodemo loading.\n"); + autodemo[0] = 0; + if(S9xMovieActive() && LoggingEnabled) + LoggingEnabled=2; /* recording! */ + } + if(AutoLoadSlot >= 0) + { + LoadStateFromSlot(AutoLoadSlot); + AutoLoadSlot=-1; + } + + if(do_beauty_analysis) + { + register uint16 *s = (uint16 *) (GFX.Screen); + Beauty_VIS(s, IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight); + } + Beauty_INPUT(); + while (block || CheckForPendingXEvents (GUI.display)) { XEvent event; @@ -1378,7 +1522,9 @@ case KeyboardSetup::WRITE_SAVE_NUM: { if(event.type != KeyPress) break; - if(func.param > 999) break; + unsigned slot = func.param; + if(slot == (unsigned)-1) slot = QuicksaveNumber; + if(slot > 999) break; char def [PATH_MAX]; char filename [PATH_MAX]; @@ -1389,8 +1535,8 @@ _splitpath (Memory.ROMFilename, drive, dir, def, ext); sprintf (filename, "%s%s%s.%03d", S9xGetSnapshotDirectory (), SLASH_STR, def, - func.param); - sprintf (GUI.info_string, "%s.%03d saved", def, func.param); + slot); + sprintf (GUI.info_string, "%s.%03d saved", def, slot); S9xInfoMessage (GUI.info_string); S9xFreezeGame (filename); break; @@ -1402,47 +1548,21 @@ S9xFreezeGame (S9xChooseFilename (FALSE)); break; } + case KeyboardSetup::SELECT_SAVE_NUM: + { + if(event.type != KeyPress) break; + + S9xSelectQuicksaveNumber(func.param); + break; + } case KeyboardSetup::LOAD_SAVE_NUM: { if(event.type != KeyPress) break; - if(func.param > 999) break; + unsigned slot = func.param; + if(slot == (unsigned)-1) slot = QuicksaveNumber; + if(slot > 999) break; - char def [PATH_MAX]; - char filename [PATH_MAX]; - char drive [_MAX_DRIVE]; - char dir [_MAX_DIR]; - char ext [_MAX_EXT]; - - _splitpath (Memory.ROMFilename, drive, dir, def, ext); - sprintf (filename, "%s%s%s.%03d", - S9xGetSnapshotDirectory (), SLASH_STR, def, - func.param); - if (S9xUnfreezeGame (filename)) - { - sprintf (GUI.info_string, "%s.%03d loaded", def, func.param); - S9xInfoMessage (GUI.info_string); - } - else - { - static char *digits = "t123456789"; - _splitpath (Memory.ROMFilename, drive, dir, def, ext); - sprintf (filename, "%s%s%s.zs%c", - S9xGetSnapshotDirectory (), SLASH_STR, - def, digits [func.param]); - if (S9xUnfreezeGame (filename)) - { - sprintf (GUI.info_string, "Loaded ZSNES freeze file %s.zs%c", - def, digits [func.param]); - S9xInfoMessage (GUI.info_string); - } - else - { - sprintf (GUI.info_string, "Freeze file %u not found", - func.param); - S9xMessage (S9X_ERROR, S9X_FREEZE_FILE_NOT_FOUND, - GUI.info_string); - } - } + LoadStateFromSlot(slot); break; } case KeyboardSetup::LOAD_SAVE_ASK: @@ -1571,6 +1691,7 @@ if(event.type != KeyPress) break; Settings.Paused ^= 1; + FromPause = 1; S9xDisplayStateChange ("Pause", Settings.Paused); break; @@ -1698,6 +1819,7 @@ case KeyboardSetup::TURBO_ENABLE: { Settings.TurboMode = event.type == KeyPress; + FromPause = 1; break; } case KeyboardSetup::SUPERSCOPE_TURBO: @@ -1730,15 +1852,45 @@ } case KeyboardSetup::WRITE_MOVIE_ASK: { - if(event.type != KeyPress) break; + char temp[128]; + if(event.type != KeyPress) break; + FromPause = 1; + int Reset = 0; + + resetq: + printf("From reset? (yes/no/cancel): "); + fflush(stdout); + + fgets(temp, 127, stdin); + if (temp[0] == 'y' || temp[0] == 'Y') + Reset = 1; + else if (temp[0] == 'n' || temp[0] == 'N') + Reset = 0; + else if (temp[0] == 'c' || temp[0] == 'C') + break; + else + goto resetq; + + int numplayers; + playersq: + printf("Number of players (1/2/3/4/5/cancel): "); + fflush(stdout); + fgets(temp, 127, stdin); + if (temp[0] == 'c' || temp[0] == 'C') + break; + else + numplayers = atoi(temp); + if (numplayers < 1 || numplayers > 5) + goto playersq; + wchar_t name[MOVIE_MAX_METADATA] = {0}; if(S9xMovieActive()) S9xMovieStop(FALSE); S9xMovieCreate(S9xChooseMovieFilename(FALSE), - 0x1F, - //MOVIE_OPT_FROM_SNAPSHOT + (1 << numplayers)-1 , + (!Reset) ? MOVIE_OPT_FROM_SNAPSHOT : MOVIE_OPT_FROM_RESET - , + , 0, name,0); break; } @@ -1748,6 +1900,8 @@ if(S9xMovieActive()) S9xMovieStop(FALSE); S9xMovieOpen(S9xChooseMovieFilename(TRUE), FALSE); + if(S9xMovieActive() && LoggingEnabled) + LoggingEnabled=2; /* recording! */ break; } case KeyboardSetup::STOP_MOVIE: @@ -1757,7 +1911,25 @@ if(S9xMovieActive()) S9xMovieStop(FALSE); break; } - + case KeyboardSetup::READONLY_MOVIE_TOGGLE: + { + // I'll get to it later + break; + + } + case KeyboardSetup::FRAMEADVANCE: + { + if (event.type != KeyPress) break; + Settings.FrameAdvance=1; + break; + } + case KeyboardSetup::DISP_KEYS: + { + if (event.type != KeyPress) break; + Settings.DisplayPressedKeys ^= 1; + S9xMovieToggleFrameDisplay (); + break; + } /* Do not put a "default" case here, or you'll * miss the compiler warning about unhandled * enumeration values @@ -1807,8 +1979,13 @@ } } -void S9xPutImage (int snes_width, int snes_height) +static int FrameSizeX, FrameSizeY; + +void S9xPutImage (const int snes_width, const int snes_height) { + FrameSizeX = snes_width; + FrameSizeY = snes_height; + #ifdef USE_GLIDE if (Settings.GlideEnable) S9xGlidePutImage (snes_width, snes_height); @@ -1825,15 +2002,13 @@ { bool8 done = FALSE; - int width, height, cheight; - - width = snes_width; - height = snes_height; - cheight = (height>SNES_HEIGHT_EXTENDED)?SNES_HEIGHT_EXTENDED*2:SNES_HEIGHT_EXTENDED; + int width = snes_width; + int height = snes_height; + int cheight = (height>SNES_HEIGHT_EXTENDED)?SNES_HEIGHT_EXTENDED*2:SNES_HEIGHT_EXTENDED; if (GUI.interpolate && Settings.SixteenBit) { - if (snes_width == 512 && snes_height > 240 && GUI.interpolate != 5) + if (snes_width >= 512 && snes_height > 240 && GUI.interpolate < 5) { GUI.output_screen = GFX.Screen; GUI.output_pitch = GFX.Pitch; @@ -1866,7 +2041,7 @@ } else { - if (GUI.interpolate != 5) + if (GUI.interpolate < 5) { width = 512; if (snes_height < 240) @@ -1930,7 +2105,49 @@ { memset (GUI.delta_screen, 255, GFX.Pitch * snes_height); } + if(GUI.interpolate == 6 || GUI.interpolate == 7) + { + GUI.image_needs_scaling = false; + width = GUI.window_width; + GUI.output_pitch = width*2; + height = snes_height; + } TVMode (snes_width, snes_height); + if(GUI.interpolate == 7) + { + for(unsigned y=0; y0; ) + { + const unsigned char* src = + &((const unsigned char*)GUI.output_screen)[y*GUI.output_pitch]; + unsigned char* dest = + &((unsigned char*)GUI.output_screen)[(y*2)*GUI.output_pitch]; + memcpy(dest+GUI.output_pitch, src, GUI.output_pitch); + memcpy(dest, src, GUI.output_pitch); + } + height*=2; + } + } } } else @@ -1952,6 +2169,8 @@ GUI.box.y = (GUI.window_height - cheight) / 2; } } + + TILE_TrackFrame(GUI.output_screen, width,height); if ((Settings.SixteenBit && GUI.depth != 15 && GUI.depth != 16) || (!Settings.SixteenBit && (!GUI.pseudo || GUI.depth != 8)) || @@ -1994,6 +2213,64 @@ break; } } + + if(LoggingEnabled) + { + if(LoggingEnabled >= 2) + { + if(maxframes > 0) + { + if(--maxframes <= 0) S9xExit(); + } + if(ignoreframes > 0) + { + --ignoreframes; + if(!(ignoreframes%100)) fprintf(stderr,"\rignoreframes=%-10d%s", ignoreframes, Settings.TurboMode?"[TURBO]":" "); + return; + } + } + +/* + fprintf(stderr, "snes(%u,%u)gui(%u,%u),wh(%u,%u)\n", + snes_width,snes_height, + GUI.window_width, + GUI.window_height, + width,height); +*/ + //unsigned scale = 1;//GUI.interpolate ? 2 : 1; + + switch(GUI.depth) + { + case 24: + case 32: + { + std::vector result(width*height*3/2); + Convert32To_I420Frame(GUI.image_date, &result[0], width*height, width); + NESVideoLoggingVideo(&result[0],width,height, 16777216000000ULL / Settings.FrameTime, 12); + break; + } + case 15: + { + std::vector result(width*height*3/2); + Convert15To_I420Frame(GUI.image_date, &result[0], width*height, width); + NESVideoLoggingVideo(&result[0],width,height, 16777216000000ULL / Settings.FrameTime, 12); + break; + } + case 16: + { + std::vector result(width*height*3/2); + Convert16To_I420Frame(GUI.image_date, &result[0], width*height, width); + NESVideoLoggingVideo(&result[0],width,height, 16777216000000ULL / Settings.FrameTime, 12); + break; + } + default: + NESVideoLoggingVideo(GUI.image_date, + width,height, + 16777216000000ULL / Settings.FrameTime, + GUI.depth==24 ? 32 : GUI.depth); + } + } + if (GUI.image_needs_scaling) { GUI.box.width = GUI.window_width; @@ -2040,17 +2317,23 @@ } else #endif + + //fprintf(stderr, "xputimage begin\n"); fflush(stderr); XPutImage (GUI.display, GUI.window, GUI.gc, GUI.image, 0, 0, GUI.box.x, GUI.box.y, GUI.box.width, GUI.box.height); + //fprintf(stderr, "xputimage done\n"); fflush(stderr); + //XFlush (GUI.display); #ifdef USE_DGA_EXTENSION } #endif GUI.last_snes_width = snes_width; GUI.last_snes_height = snes_height; + VideoLogger(GUI.image_date, snes_width, snes_height, GUI.depth); +#if 1 if (GUI.box.x != GUI.old_box.x || GUI.box.y != GUI.old_box.y || GUI.box.width != GUI.old_box.width || GUI.box.height != GUI.old_box.height) { @@ -2084,6 +2367,7 @@ XDestroyRegion (old_box); GUI.old_box = GUI.box; } +#endif Window root, child; int root_x, root_y; @@ -2092,8 +2376,14 @@ // Use QueryPointer to sync X server and as a side effect also gets // current pointer position for SNES mouse emulation. + //fprintf(stderr, "xflush begin\n"); fflush(stderr); +#if 0 XQueryPointer (GUI.display, GUI.window, &root, &child, &root_x, &root_y, &x, &y, &mask); +#else + XFlush(GUI.display); +#endif + //fprintf(stderr, "xflush done\n"); fflush(stderr); if (IPPU.Controller == SNES_SUPERSCOPE) { @@ -2211,6 +2501,8 @@ { static char path [PATH_MAX]; char buffer [PATH_MAX]; + + FromPause = 1; XAutoRepeatOn (GUI.display); @@ -2849,6 +3141,12 @@ } #endif //XAutoRepeatOff (GUI.display); + + /* set some reasonable defaults */ + Settings.InterpolatedSound = 1; + Settings.SkipFrames = 1; + Settings.Mode7Interpolate = 1; + so.sound_switch = 0xFF; } void S9xParseDisplayArg (char **argv, int &ind, int) @@ -2858,15 +3156,8 @@ Settings.SixteenBit = TRUE; Settings.SupportHiRes = TRUE; Settings.ForceTransparency = TRUE; - switch (argv[ind][2]) - { - case 0: GUI.interpolate = TRUE; break; - case '1': GUI.interpolate = TRUE; break; - case '2': GUI.interpolate = 2; break; - case '3': GUI.interpolate = 3; break; - case '4': GUI.interpolate = 4; break; - case '5': GUI.interpolate = 5; break; - } + GUI.interpolate = atoi(argv[ind]+2); + if(!GUI.interpolate) GUI.interpolate = TRUE; } else if (strncasecmp (argv [ind], "-GUI.interpolate", 12) == 0) @@ -2885,6 +3176,11 @@ } } else + if (strcasecmp (argv [ind], "-state") == 0) + { + AutoLoadSlot = atoi(argv[++ind]); + } + else if (strcasecmp (argv [ind], "-scale") == 0 || strcasecmp (argv [ind], "-sc") == 0) { @@ -2932,8 +3228,17 @@ void TVMode (int width, int height) { - switch (width != 256 && GUI.interpolate != 5 ? 1 : GUI.interpolate) + /* + fprintf(stderr, "fsize=(%u,%u), pitch=%d, widthheight=(%u,%u) pitch(%d)\n", + FrameSizeX,FrameSizeY, GFX.Pitch, + width,height, (int)GUI.output_pitch); +*/ + switch (width != 256 && GUI.interpolate < 5 ? 1 : GUI.interpolate) { + default: + fprintf(stderr, "Unknown -y setting: %d, 1 assumed\n", (int)GUI.interpolate); + GUI.interpolate=1; goto opt1; + case 2: Super2xSaI (GFX.Screen, GFX.Pitch, GUI.delta_screen, GUI.output_screen, GUI.output_pitch, width, height); @@ -2958,7 +3263,43 @@ Scale_2xSaI (GFX.Screen, GFX.Pitch, GUI.delta_screen, GUI.output_screen, GUI.output_pitch, GUI.window_width, GUI.window_height, width, height); break; - case 1: + case 7: + { + break; + } + case 6: + { + static snes_ntsc_t ntsc; + static bool inited=false; + static snes_ntsc_setup_t setup; + if(!inited) + { + setup = snes_ntsc_rgb;//composite;//svideo; + /* + setup.sharpness = 0.1; + setup.resolution = 0; + setup.fringing = 1; + setup.bleed = 0; + */ + setup.merge_fields = 1; + + snes_ntsc_init(&ntsc, &setup); + inited=true; + } + + static bool burst=false; if(!setup.merge_fields) burst^=1; + (FrameSizeX==256 + ? snes_ntsc_blit + : snes_ntsc_blit_hires) (&ntsc, (const unsigned short*)GFX.Screen, + GFX.Pitch/2, + burst, + FrameSizeX, FrameSizeY, + (void*)GUI.output_screen, + GUI.output_pitch + ); + break; + } + case 1: opt1: { uint8 *nextLine, *srcPtr, *deltaPtr, *finish; uint8 *dstPtr; diff -NaHudr snes9x-1.43-src/snes9x/unzip/crc32.h snx/snes9x/unzip/crc32.h --- snes9x-1.43-src/snes9x/unzip/crc32.h 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x/unzip/crc32.h 2005-03-20 23:46:28.000000000 +0200 @@ -0,0 +1,441 @@ +/* crc32.h -- tables for rapid CRC calculation + * Generated automatically by crc32.c + */ + +local const unsigned long FAR crc_table[TBLS][256] = +{ + { + 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL, + 0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL, + 0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL, + 0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL, + 0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL, + 0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL, + 0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL, + 0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL, + 0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL, + 0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL, + 0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL, + 0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL, + 0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL, + 0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL, + 0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL, + 0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL, + 0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL, + 0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL, + 0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL, + 0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL, + 0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL, + 0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL, + 0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL, + 0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL, + 0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL, + 0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL, + 0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL, + 0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL, + 0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL, + 0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL, + 0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL, + 0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL, + 0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL, + 0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL, + 0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL, + 0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL, + 0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL, + 0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL, + 0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL, + 0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL, + 0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL, + 0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL, + 0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL, + 0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL, + 0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL, + 0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL, + 0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL, + 0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL, + 0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL, + 0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL, + 0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL, + 0x2d02ef8dUL +#ifdef BYFOUR + }, + { + 0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL, + 0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL, + 0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL, + 0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL, + 0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL, + 0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL, + 0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL, + 0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL, + 0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL, + 0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL, + 0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL, + 0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL, + 0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL, + 0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL, + 0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL, + 0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL, + 0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL, + 0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL, + 0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL, + 0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL, + 0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL, + 0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL, + 0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL, + 0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL, + 0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL, + 0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL, + 0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL, + 0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL, + 0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL, + 0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL, + 0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL, + 0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL, + 0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL, + 0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL, + 0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL, + 0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL, + 0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL, + 0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL, + 0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL, + 0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL, + 0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL, + 0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL, + 0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL, + 0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL, + 0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL, + 0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL, + 0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL, + 0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL, + 0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL, + 0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL, + 0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL, + 0x9324fd72UL + }, + { + 0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL, + 0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL, + 0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL, + 0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL, + 0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL, + 0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL, + 0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL, + 0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL, + 0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL, + 0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL, + 0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL, + 0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL, + 0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL, + 0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL, + 0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL, + 0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL, + 0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL, + 0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL, + 0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL, + 0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL, + 0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL, + 0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL, + 0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL, + 0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL, + 0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL, + 0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL, + 0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL, + 0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL, + 0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL, + 0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL, + 0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL, + 0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL, + 0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL, + 0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL, + 0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL, + 0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL, + 0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL, + 0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL, + 0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL, + 0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL, + 0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL, + 0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL, + 0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL, + 0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL, + 0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL, + 0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL, + 0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL, + 0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL, + 0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL, + 0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL, + 0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL, + 0xbe9834edUL + }, + { + 0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL, + 0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL, + 0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL, + 0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL, + 0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL, + 0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL, + 0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL, + 0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL, + 0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL, + 0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL, + 0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL, + 0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL, + 0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL, + 0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL, + 0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL, + 0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL, + 0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL, + 0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL, + 0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL, + 0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL, + 0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL, + 0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL, + 0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL, + 0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL, + 0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL, + 0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL, + 0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL, + 0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL, + 0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL, + 0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL, + 0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL, + 0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL, + 0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL, + 0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL, + 0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL, + 0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL, + 0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL, + 0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL, + 0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL, + 0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL, + 0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL, + 0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL, + 0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL, + 0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL, + 0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL, + 0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL, + 0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL, + 0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL, + 0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL, + 0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL, + 0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL, + 0xde0506f1UL + }, + { + 0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL, + 0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL, + 0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL, + 0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL, + 0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL, + 0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL, + 0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL, + 0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL, + 0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL, + 0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL, + 0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL, + 0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL, + 0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL, + 0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL, + 0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL, + 0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL, + 0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL, + 0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL, + 0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL, + 0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL, + 0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL, + 0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL, + 0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL, + 0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL, + 0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL, + 0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL, + 0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL, + 0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL, + 0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL, + 0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL, + 0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL, + 0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL, + 0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL, + 0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL, + 0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL, + 0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL, + 0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL, + 0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL, + 0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL, + 0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL, + 0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL, + 0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL, + 0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL, + 0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL, + 0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL, + 0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL, + 0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL, + 0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL, + 0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL, + 0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL, + 0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL, + 0x8def022dUL + }, + { + 0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL, + 0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL, + 0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL, + 0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL, + 0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL, + 0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL, + 0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL, + 0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL, + 0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL, + 0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL, + 0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL, + 0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL, + 0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL, + 0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL, + 0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL, + 0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL, + 0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL, + 0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL, + 0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL, + 0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL, + 0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL, + 0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL, + 0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL, + 0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL, + 0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL, + 0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL, + 0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL, + 0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL, + 0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL, + 0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL, + 0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL, + 0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL, + 0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL, + 0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL, + 0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL, + 0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL, + 0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL, + 0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL, + 0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL, + 0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL, + 0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL, + 0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL, + 0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL, + 0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL, + 0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL, + 0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL, + 0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL, + 0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL, + 0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL, + 0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL, + 0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL, + 0x72fd2493UL + }, + { + 0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL, + 0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL, + 0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL, + 0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL, + 0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL, + 0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL, + 0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL, + 0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL, + 0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL, + 0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL, + 0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL, + 0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL, + 0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL, + 0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL, + 0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL, + 0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL, + 0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL, + 0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL, + 0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL, + 0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL, + 0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL, + 0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL, + 0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL, + 0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL, + 0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL, + 0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL, + 0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL, + 0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL, + 0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL, + 0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL, + 0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL, + 0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL, + 0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL, + 0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL, + 0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL, + 0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL, + 0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL, + 0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL, + 0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL, + 0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL, + 0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL, + 0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL, + 0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL, + 0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL, + 0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL, + 0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL, + 0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL, + 0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL, + 0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL, + 0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL, + 0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL, + 0xed3498beUL + }, + { + 0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL, + 0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL, + 0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL, + 0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL, + 0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL, + 0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL, + 0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL, + 0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL, + 0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL, + 0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL, + 0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL, + 0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL, + 0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL, + 0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL, + 0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL, + 0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL, + 0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL, + 0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL, + 0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL, + 0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL, + 0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL, + 0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL, + 0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL, + 0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL, + 0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL, + 0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL, + 0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL, + 0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL, + 0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL, + 0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL, + 0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL, + 0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL, + 0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL, + 0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL, + 0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL, + 0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL, + 0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL, + 0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL, + 0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL, + 0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL, + 0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL, + 0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL, + 0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL, + 0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL, + 0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL, + 0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL, + 0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL, + 0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL, + 0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL, + 0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL, + 0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL, + 0xf10605deUL +#endif + } +}; diff -NaHudr snes9x-1.43-src/snes9x/win32.cpp snx/snes9x/win32.cpp --- snes9x-1.43-src/snes9x/win32.cpp 2004-12-31 00:15:47.000000000 +0200 +++ snx/snes9x/win32.cpp 2005-04-09 00:59:27.000000000 +0300 @@ -100,7 +100,7 @@ #include "soundux.h" #include "netplay.h" #include "movie.h" -#include "..\AVIOutput.h" +#include "..\AVIOutput.h" #include "..\language.h" #include @@ -138,7 +138,7 @@ void DoAVIClose(int reason); static void DoAVIVideoFrame(SSurface* source_surface, int width, int height, bool8 sixteen_bit); -static void S9xWinScanJoypads (); +void S9xWinScanJoypads (); typedef struct { @@ -607,7 +607,8 @@ return; if( mute || Settings.ForcedPause || - Settings.Paused || Settings.StopEmulation || GUI.AVIOut) + Settings.Paused && (Settings.FAMute || !(Settings.FrameAdvance) && !(DirectX.IdleCount < 8)) // gives frame advance sound + || Settings.StopEmulation || GUI.AVIOut) { if (so.sixteen_bit) { @@ -737,6 +738,15 @@ void S9xSyncSpeed( void) { +/* if (Settings.FrameAdvance) + { + CHECK_SOUND(); S9xProcessEvents(FALSE); + IPPU.RenderThisFrame=TRUE; + IPPU.SkippedFrames = 0; + Settings.FrameAdvance--; + return; + } +*/ #ifdef NETPLAY_SUPPORT if (Settings.NetPlay) { @@ -835,36 +845,36 @@ } else { - if (IPPU.SkippedFrames < Settings.AutoMaxSkipFrames) - { - IPPU.SkippedFrames++; - IPPU.RenderThisFrame = FALSE; - } - else - { - IPPU.RenderThisFrame = TRUE; - IPPU.SkippedFrames = 0; - } + if (IPPU.SkippedFrames < Settings.AutoMaxSkipFrames) + { + IPPU.SkippedFrames++; + IPPU.RenderThisFrame = FALSE; + } + else + { + IPPU.RenderThisFrame = TRUE; + IPPU.SkippedFrames = 0; + } } } else { - uint32 SkipFrames; - if(Settings.TurboMode) - SkipFrames = Settings.TurboSkipFrames; - else - SkipFrames = (Settings.SkipFrames == AUTO_FRAMERATE) ? 0 : Settings.SkipFrames; - if (++IPPU.FrameSkip >= SkipFrames) - { - IPPU.FrameSkip = 0; - IPPU.SkippedFrames = 0; - IPPU.RenderThisFrame = TRUE; - } - else - { - IPPU.SkippedFrames++; - IPPU.RenderThisFrame = FALSE; - } + uint32 SkipFrames; + if(Settings.TurboMode) + SkipFrames = Settings.TurboSkipFrames; + else + SkipFrames = (Settings.SkipFrames == AUTO_FRAMERATE) ? 0 : Settings.SkipFrames; + if (++IPPU.FrameSkip >= SkipFrames) + { + IPPU.FrameSkip = 0; + IPPU.SkippedFrames = 0; + IPPU.RenderThisFrame = TRUE; + } + else + { + IPPU.SkippedFrames++; + IPPU.RenderThisFrame = FALSE; + } } } @@ -897,6 +907,9 @@ bool S9xGetState (WORD KeyIdent) { + if(KeyIdent == 0 || KeyIdent == VK_ESCAPE) // if it's the 'disabled' key, it's never pressed + return true; + if (KeyIdent & 0x8000) { int j = (KeyIdent >> 8) & 15; @@ -970,7 +983,7 @@ second = false; } -static void S9xWinScanJoypads () +void S9xWinScanJoypads () { uint8 PadState[2]; JOYINFOEX jie; @@ -1111,49 +1124,91 @@ } } + for (int J = 0; J < 5; J++) { if (Joypad [J].Enabled) { - PadState[0] = 0; - PadState[0] |= !S9xGetState (Joypad[J].R) ? 16 : 0; - PadState[0] |= !S9xGetState (Joypad[J].L) ? 32 : 0; - PadState[0] |= !S9xGetState (Joypad[J].X) ? 64 : 0; - PadState[0] |= !S9xGetState (Joypad[J].A) ? 128 : 0; - - PadState[1] = 0; - PadState[1] |= !S9xGetState (Joypad[J].Right) ? 1 : 0; - PadState[1] |= !S9xGetState (Joypad[J].Right_Up) ? 1 + 8 : 0; - PadState[1] |= !S9xGetState (Joypad[J].Right_Down)? 1 + 4 : 0; - PadState[1] |= !S9xGetState (Joypad[J].Left) ? 2 : 0; - PadState[1] |= !S9xGetState (Joypad[J].Left_Up)? 2 + 8 : 0; - PadState[1] |= !S9xGetState (Joypad[J].Left_Down)? 2 + 4 : 0; - PadState[1] |= !S9xGetState (Joypad[J].Down) ? 4 : 0; - PadState[1] |= !S9xGetState (Joypad[J].Up) ? 8 : 0; - PadState[1] |= !S9xGetState (Joypad[J].Start) ? 16 : 0; - PadState[1] |= !S9xGetState (Joypad[J].Select) ? 32 : 0; - PadState[1] |= !S9xGetState (Joypad[J].Y) ? 64 : 0; - PadState[1] |= !S9xGetState (Joypad[J].B) ? 128 : 0; + // toggle checks + { + PadState[0] = 0; + PadState[0] |= ToggleJoypadStorage[J].R||TurboToggleJoypadStorage[J].R ? 16 : 0; + PadState[0] |= ToggleJoypadStorage[J].L||TurboToggleJoypadStorage[J].L ? 32 : 0; + PadState[0] |= ToggleJoypadStorage[J].X||TurboToggleJoypadStorage[J].X ? 64 : 0; + PadState[0] |= ToggleJoypadStorage[J].A||TurboToggleJoypadStorage[J].A ? 128 : 0; + + PadState[1] = 0; + PadState[1] |= ToggleJoypadStorage[J].Right ? 1 : 0; +/// PadState[1] |= false ? 1 + 8 : 0; +/// PadState[1] |= false ? 1 + 4 : 0; + PadState[1] |= ToggleJoypadStorage[J].Left ? 2 : 0; +/// PadState[1] |= false ? 2 + 8 : 0; +/// PadState[1] |= false ? 2 + 4 : 0; + PadState[1] |= ToggleJoypadStorage[J].Down ? 4 : 0; + PadState[1] |= ToggleJoypadStorage[J].Up ? 8 : 0; + PadState[1] |= ToggleJoypadStorage[J].Start||TurboToggleJoypadStorage[J].Start ? 16 : 0; + PadState[1] |= ToggleJoypadStorage[J].Select||TurboToggleJoypadStorage[J].Select ? 32 : 0; + PadState[1] |= ToggleJoypadStorage[J].Y||TurboToggleJoypadStorage[J].Y ? 64 : 0; + PadState[1] |= ToggleJoypadStorage[J].B||TurboToggleJoypadStorage[J].B ? 128 : 0; + } + // togglify + if(S9xGetState(Joypad[J+5].Left)) + { +/// PadState[0] = 0; + PadState[0] |= (!S9xGetState(Joypad[J].R)||!S9xGetState(Joypad[J+5].R)) ? 16 : 0; + PadState[0] |= (!S9xGetState(Joypad[J].L)||!S9xGetState(Joypad[J+5].L)) ? 32 : 0; + PadState[0] |= (!S9xGetState(Joypad[J].X)||!S9xGetState(Joypad[J+5].X)) ? 64 : 0; + PadState[0] |= (!S9xGetState(Joypad[J].A)||!S9xGetState(Joypad[J+5].A)) ? 128 : 0; + +/// PadState[1] = 0; + PadState[1] |= (!S9xGetState(Joypad[J].Right)) ? 1 : 0; + PadState[1] |= (!S9xGetState(Joypad[J].Right_Up)) ? 1 + 8 : 0; + PadState[1] |= (!S9xGetState(Joypad[J].Right_Down)) ? 1 + 4 : 0; + PadState[1] |= (!S9xGetState(Joypad[J].Left)) ? 2 : 0; + PadState[1] |= (!S9xGetState(Joypad[J].Left_Up)) ? 2 + 8 : 0; + PadState[1] |= (!S9xGetState(Joypad[J].Left_Down)) ? 2 + 4 : 0; + PadState[1] |= (!S9xGetState(Joypad[J].Down)) ? 4 : 0; + PadState[1] |= (!S9xGetState(Joypad[J].Up)) ? 8 : 0; + PadState[1] |= (!S9xGetState(Joypad[J].Start)||!S9xGetState(Joypad[J+5].Start)) ? 16 : 0; + PadState[1] |= (!S9xGetState(Joypad[J].Select)||!S9xGetState(Joypad[J+5].Select)) ? 32 : 0; + PadState[1] |= (!S9xGetState(Joypad[J].Y)||!S9xGetState(Joypad[J+5].Y)) ? 64 : 0; + PadState[1] |= (!S9xGetState(Joypad[J].B)||!S9xGetState(Joypad[J+5].B)) ? 128 : 0; + } + + bool turbofy = !S9xGetState(Joypad[J+5].Up); // All Mod for turbo //handle turbo case! - if((GUI.TurboMask&TURBO_A_MASK)&&(PadState[0]&128)) - PadState[0]^=(joypads[J]&128); - if((GUI.TurboMask&TURBO_B_MASK)&&(PadState[1]&128)) - PadState[1]^=((joypads[J]&(128<<8))>>8); - if((GUI.TurboMask&TURBO_Y_MASK)&&(PadState[1]&64)) - PadState[1]^=((joypads[J]&(64<<8))>>8); - if((GUI.TurboMask&TURBO_X_MASK)&&(PadState[0]&64)) - PadState[0]^=(joypads[J]&64); - if((GUI.TurboMask&TURBO_L_MASK)&&(PadState[0]&32)) - PadState[0]^=(joypads[J]&32); - if((GUI.TurboMask&TURBO_R_MASK)&&(PadState[0]&16)) - PadState[0]^=(joypads[J]&16); - if((GUI.TurboMask&TURBO_SEL_MASK)&&(PadState[1]&32)) - PadState[1]^=((joypads[J]&(32<<8))>>8); - if((GUI.TurboMask&TURBO_STA_MASK)&&(PadState[1]&16)) - PadState[1]^=((joypads[J]&(16<<8))>>8); + if(turbofy || ((GUI.TurboMask&TURBO_A_MASK))&&(PadState[0]&128) || !S9xGetState(Joypad[J+5].A )) PadState[0]^=(joypads[J]&128); + if(turbofy || ((GUI.TurboMask&TURBO_B_MASK))&&(PadState[1]&128) || !S9xGetState(Joypad[J+5].B )) PadState[1]^=((joypads[J]&(128<<8))>>8); + if(turbofy || ((GUI.TurboMask&TURBO_Y_MASK))&&(PadState[1]&64) || !S9xGetState(Joypad[J+5].Y )) PadState[1]^=((joypads[J]&(64<<8))>>8); + if(turbofy || ((GUI.TurboMask&TURBO_X_MASK))&&(PadState[0]&64) || !S9xGetState(Joypad[J+5].X )) PadState[0]^=(joypads[J]&64); + if(turbofy || ((GUI.TurboMask&TURBO_L_MASK))&&(PadState[0]&32) || !S9xGetState(Joypad[J+5].L )) PadState[0]^=(joypads[J]&32); + if(turbofy || ((GUI.TurboMask&TURBO_R_MASK))&&(PadState[0]&16) || !S9xGetState(Joypad[J+5].R )) PadState[0]^=(joypads[J]&16); + if(turbofy || ((GUI.TurboMask&TURBO_STA_MASK))&&(PadState[1]&16) || !S9xGetState(Joypad[J+5].Start )) PadState[1]^=((joypads[J]&(16<<8))>>8); + if(turbofy || ((GUI.TurboMask&TURBO_SEL_MASK))&&(PadState[1]&32) || !S9xGetState(Joypad[J+5].Select)) PadState[1]^=((joypads[J]&(32<<8))>>8); + + if(TurboToggleJoypadStorage[J].A ) PadState[0]^=(joypads[J]&128); + if(TurboToggleJoypadStorage[J].B ) PadState[1]^=((joypads[J]&(128<<8))>>8); + if(TurboToggleJoypadStorage[J].Y ) PadState[1]^=((joypads[J]&(64<<8))>>8); + if(TurboToggleJoypadStorage[J].X ) PadState[0]^=(joypads[J]&64); + if(TurboToggleJoypadStorage[J].L ) PadState[0]^=(joypads[J]&32); + if(TurboToggleJoypadStorage[J].R ) PadState[0]^=(joypads[J]&16); + if(TurboToggleJoypadStorage[J].Start ) PadState[1]^=((joypads[J]&(16<<8))>>8); + if(TurboToggleJoypadStorage[J].Select) PadState[1]^=((joypads[J]&(32<<8))>>8); //end turbo case... + + // enforce left+right/up+down disallowance here to + // avoid recording unused l+r/u+d that will cause desyncs + // when played back with l+r/u+d is allowed + if(Settings.DisallowLeftRight) + { + if((PadState[1] & 2) != 0) + PadState[1] &= ~(1); + if((PadState[1] & 8) != 0) + PadState[1] &= ~(4); + } + joypads [J] = PadState [0] | (PadState [1] << 8) | 0x80000000; } else @@ -1357,9 +1412,9 @@ lpDDSurface2 = DirectX.lpDDSOffScreen2; PrimarySurfaceLockFailed = true; srcRect.top = 0; - srcRect.bottom = Height; + srcRect.bottom = Height - (Settings.HeightExtend?0:15); srcRect.left = 0; - srcRect.right = Width; + srcRect.right = Width; } else { @@ -1442,14 +1497,45 @@ ClientToScreen (GUI.hWnd, &p); GetClientRect (GUI.hWnd, &dstRect); - OffsetRect(&dstRect, p.x, p.y); - */ - p.x = p.y = 0; - ClientToScreen (GUI.hWnd, &p); - GetClientRect (GUI.hWnd, &dstRect); - dstRect.bottom = int(double(dstRect.bottom) * double(239.0 / 240.0)); OffsetRect(&dstRect, p.x, p.y); - } + */ + p.x = p.y = 0; + ClientToScreen (GUI.hWnd, &p); + GetClientRect (GUI.hWnd, &dstRect); +// dstRect.bottom = int(double(dstRect.bottom) * double(239.0 / 240.0)); + + if(Settings.AspectRatio) + { + int width = dstRect.right - dstRect.left; + int height = dstRect.bottom - dstRect.top; + + int oldWidth = SNES_WIDTH; + int oldHeight = Settings.HeightExtend ? SNES_HEIGHT_EXTENDED : SNES_HEIGHT; + int newWidth, newHeight; + + if(oldWidth * height > oldHeight * width) + { + newWidth = oldWidth*width/oldWidth; + newHeight = oldHeight*width/oldWidth; + } + else + { + newWidth = oldWidth*height/oldHeight; + newHeight = oldHeight*height/oldHeight; + } + int xOffset = (width - newWidth)/2; + int yOffset = (height - newHeight)/2; + + dstRect.right = dstRect.left + newWidth; + dstRect.bottom = dstRect.top + newHeight; + + OffsetRect(&dstRect, p.x + xOffset, p.y + yOffset); + } + else + { + OffsetRect(&dstRect, p.x, p.y); + } + } else { GetClientRect (GUI.hWnd, &dstRect); @@ -1463,7 +1549,7 @@ height *= 2; } p.x = ((dstRect.right - dstRect.left) - width) >> 1; - p.y = ((dstRect.bottom - dstRect.top) - height) >> 1; + p.y = ((dstRect.bottom - dstRect.top) - height) >> 1; ClientToScreen (GUI.hWnd, &p); dstRect.top = p.y; @@ -2340,7 +2426,7 @@ // create new writer AVICreate(&GUI.AVIOut); - int framerate = (Settings.PAL) ? 50 : 60; + int framerate = Memory.ROMFramesPerSecond; int frameskip = Settings.SkipFrames; if(frameskip == 0 || frameskip == AUTO_FRAMERATE) frameskip = 1; diff -NaHudr snes9x-1.43-src/snes9x/xenofarm_gdb_cmd snx/snes9x/xenofarm_gdb_cmd --- snes9x-1.43-src/snes9x/xenofarm_gdb_cmd 2004-12-31 00:15:45.000000000 +0200 +++ snx/snes9x/xenofarm_gdb_cmd 2005-03-20 23:46:31.000000000 +0200 @@ -1,14 +1,14 @@ -echo \nActive threads\n -info threads -echo \nBacktrace\n -bt -echo \nSource code for frame 0\n -list -echo \nDisassembly of frame 0\n -disassemble -echo \nSource code for frame 1\n -up -list -echo \nDisassembly of frame 1\n -disassemble -echo \nEnd of core inspection\n\n\n\n +echo \nActive threads\n +info threads +echo \nBacktrace\n +bt +echo \nSource code for frame 0\n +list +echo \nDisassembly of frame 0\n +disassemble +echo \nSource code for frame 1\n +up +list +echo \nDisassembly of frame 1\n +disassemble +echo \nEnd of core inspection\n\n\n\n diff -NaHudr snes9x-1.43-src/snes9x/xenofarm.sh snx/snes9x/xenofarm.sh --- snes9x-1.43-src/snes9x/xenofarm.sh 2004-12-31 00:15:44.000000000 +0200 +++ snx/snes9x/xenofarm.sh 2005-03-20 23:46:31.000000000 +0200 @@ -1,113 +1,113 @@ -#! /bin/sh - -# This script is part of the automated Xenofarm testing testing. For -# more information about Xenofarm see http://www.lysator.liu.se/xenofarm/ - -# $Id: xenofarm.sh,v 1.6 2003/11/09 14:02:39 pbortas Exp $ -# This file scripts the xenofarm actions and creates a result package -# to send back. - -#FIXME: snes9x doesn't really need MAKE_FLAGS. Clean out later. - -BUILDDIR=. -#OS=`uname -s -r -m|sed \"s/ /-/g\"|tr \"[A-Z]\" \"[a-z]\"|tr \"/()\" \"___\"` -#BUILDDIR=build/$(OS) -MAKE=${MAKE-make} -PATH=$PATH:/usr/ccs/bin -export PATH - -log() { - echo $1 | tee -a build/xenofarm/mainlog.txt -} - -log_start() { - log "BEGIN $1" - TZ=GMT date >> build/xenofarm/mainlog.txt -} - -log_end() { - LASTERR=$1 - if [ "$1" = "0" ] ; then - log "PASS" - else - log "FAIL" - fi - TZ=GMT date >> build/xenofarm/mainlog.txt -} - -xenofarm_build() { - log_start compile - "`pwd`/configure" >> build/xenofarm/compilelog.txt 2>&1 && - $MAKE $MAKE_FLAGS >> build/xenofarm/compilelog.txt 2>&1 - log_end $? - [ $LASTERR = 0 ] || return 1 -} - -xenofarm_post_build() { - log_start verify - $MAKE $MAKE_FLAGS verify > build/xenofarm/verifylog.txt 2>&1 - log_end $? - [ $LASTERR = 0 ] || return 1 - - log_start binrelease - $MAKE $MAKE_FLAGS bin-release > build/xenofarm/binreleaselog.txt 2>&1 - log_end $? - [ $LASTERR = 0 ] || return 1 -} - -fail_builddir() { - echo "FATAL: Failed to create build directory!" - exit 1 -} - -# main code - -test -d build || mkdir build 2>&1 && -rm -rf build/xenofarm 2>&1 && -mkdir build/xenofarm 2>&1 || fail_builddir - -LC_CTYPE=C -export LC_CTYPE -log "FORMAT 2" - -log_start build -xenofarm_build -log_end $? - -if [ $LASTERR = 0 ]; then - log_start post_build - xenofarm_post_build - log_end $? - else : -fi - -log_start response_assembly - # Basic stuff - cp ../buildid.txt build/xenofarm/ - # Configuration - cp "$BUILDDIR/config.info" build/xenofarm/configinfo.txt 2>/dev/null || /bin/true - ( - cd "$BUILDDIR" - test -f config.log && cat config.log - for f in `find . -name config.log -type f`; do - echo - echo '###################################################' - echo '##' `dirname "$f"` - echo - cat "$f" - done - ) > build/xenofarm/configlogs.txt - cp "$BUILDDIR/config.cache" build/xenofarm/configcache.txt 2>/dev/null || /bin/true; - # Core files - find . -name "core" -exec \ - gdb --batch --nx --command=bin/xenofarm_gdb_cmd "$BUILDDIR/pike" {} >> \ - build/xenofarm/_core.txt ";" - find . -name "*.core" -exec \ - gdb --batch --nx --command=bin/xenofarm_gdb_cmd "$BUILDDIR/pike" {} >> \ - build/xenofarm/_core.txt ";" - find . -name "core.*" -exec \ - gdb --batch --nx --command=bin/xenofarm_gdb_cmd "$BUILDDIR/pike" {} >> \ - build/xenofarm/_core.txt ";" -log_end $? - -log "END" +#! /bin/sh + +# This script is part of the automated Xenofarm testing testing. For +# more information about Xenofarm see http://www.lysator.liu.se/xenofarm/ + +# $Id: xenofarm.sh,v 1.6 2003/11/09 14:02:39 pbortas Exp $ +# This file scripts the xenofarm actions and creates a result package +# to send back. + +#FIXME: snes9x doesn't really need MAKE_FLAGS. Clean out later. + +BUILDDIR=. +#OS=`uname -s -r -m|sed \"s/ /-/g\"|tr \"[A-Z]\" \"[a-z]\"|tr \"/()\" \"___\"` +#BUILDDIR=build/$(OS) +MAKE=${MAKE-make} +PATH=$PATH:/usr/ccs/bin +export PATH + +log() { + echo $1 | tee -a build/xenofarm/mainlog.txt +} + +log_start() { + log "BEGIN $1" + TZ=GMT date >> build/xenofarm/mainlog.txt +} + +log_end() { + LASTERR=$1 + if [ "$1" = "0" ] ; then + log "PASS" + else + log "FAIL" + fi + TZ=GMT date >> build/xenofarm/mainlog.txt +} + +xenofarm_build() { + log_start compile + "`pwd`/configure" >> build/xenofarm/compilelog.txt 2>&1 && + $MAKE $MAKE_FLAGS >> build/xenofarm/compilelog.txt 2>&1 + log_end $? + [ $LASTERR = 0 ] || return 1 +} + +xenofarm_post_build() { + log_start verify + $MAKE $MAKE_FLAGS verify > build/xenofarm/verifylog.txt 2>&1 + log_end $? + [ $LASTERR = 0 ] || return 1 + + log_start binrelease + $MAKE $MAKE_FLAGS bin-release > build/xenofarm/binreleaselog.txt 2>&1 + log_end $? + [ $LASTERR = 0 ] || return 1 +} + +fail_builddir() { + echo "FATAL: Failed to create build directory!" + exit 1 +} + +# main code + +test -d build || mkdir build 2>&1 && +rm -rf build/xenofarm 2>&1 && +mkdir build/xenofarm 2>&1 || fail_builddir + +LC_CTYPE=C +export LC_CTYPE +log "FORMAT 2" + +log_start build +xenofarm_build +log_end $? + +if [ $LASTERR = 0 ]; then + log_start post_build + xenofarm_post_build + log_end $? + else : +fi + +log_start response_assembly + # Basic stuff + cp ../buildid.txt build/xenofarm/ + # Configuration + cp "$BUILDDIR/config.info" build/xenofarm/configinfo.txt 2>/dev/null || /bin/true + ( + cd "$BUILDDIR" + test -f config.log && cat config.log + for f in `find . -name config.log -type f`; do + echo + echo '###################################################' + echo '##' `dirname "$f"` + echo + cat "$f" + done + ) > build/xenofarm/configlogs.txt + cp "$BUILDDIR/config.cache" build/xenofarm/configcache.txt 2>/dev/null || /bin/true; + # Core files + find . -name "core" -exec \ + gdb --batch --nx --command=bin/xenofarm_gdb_cmd "$BUILDDIR/pike" {} >> \ + build/xenofarm/_core.txt ";" + find . -name "*.core" -exec \ + gdb --batch --nx --command=bin/xenofarm_gdb_cmd "$BUILDDIR/pike" {} >> \ + build/xenofarm/_core.txt ";" + find . -name "core.*" -exec \ + gdb --batch --nx --command=bin/xenofarm_gdb_cmd "$BUILDDIR/pike" {} >> \ + build/xenofarm/_core.txt ";" +log_end $? + +log "END" diff -NaHudr snes9x-1.43-src/snes9x.aps snx/snes9x.aps --- snes9x-1.43-src/snes9x.aps 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x.aps 2005-03-20 23:46:36.000000000 +0200 @@ -0,0 +1,629 @@ + ÿÿÿÿc$HWBÿÿ xc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rcê…$HWBÿÿÈ0 !!resource.hIDR_RT_MANIFEST21IDR_MENU_US101IDC_CURSOR_SCOPE101IDD_SPC7110_CACHE101IDI_ICON1101 IDR_MENU_NL102 +IDC_CURSOR_BLANK102 IDD_SOUND_OPTS102 IDR_SNES9X_ACCELERATORS103 IDD_7110_RTC103IDD_ROM_INFO104IDD_ABOUT105IDD_EMU_SETTINGS106IDD_OPEN_ROM107IDD_GFX_PACK108IDD_NETCONNECT109IDD_NPOPTIONS110IDB_OPENFOLDER111IDD_CHEATER111IDB_CLOSEDFOLDER112IDB_CDDRIVE113IDB_NETDRIVE114IDB_HARDDRIVE115IDD_NEWDISPLAY123IDD_NETPLAYPROGRESS124IDD_INPUTCONFIG125IDB_JOYPAD127IDD_CHEAT_SEARCH129 IDD_DIALOG1130!IDD_CHEAT_FROM_SEARCH131"IDB_PAD133#IDD_OPENMOVIE134$IDD_CREATEMOVIE135%IDD_KEYCUSTOM136&IDC_DRIVER1001'IDC_BUFLEN1002(IDC_RATE1003)IDC_MIX1004*IDC_16BIT1005+IDC_STEREO1006,IDC_REV_STEREO1007-IDC_LINEAR_INTER1008.IDC_SYNC_TO_SOUND_CPU1009/IDC_ENVX10100IDC_ECHO10111IDC_CACHING10122IDC_MASTER_VOL10133IDC_SPC700ON10144IDC_ANTIRES10155IDC_MUTE10166IDC_SKIP_TYPE10177IDC_SCROLLBAR110188IDC_FMUT10189IDC_VRAM_DISPLAY1019:IDC_WIP11019;IDC_ADDRESS1020<IDC_FAMT1020=IDC_SPC7110_ALL1021>IDC_SPC7110_SOME1022?IDC_SPC7110_FILE1023@IDC_RTC_D81024AIDC_RTC_D41025BIDC_RTC_D21026CIDC_RTC_D11027DIDC_RTC_E81028EIDC_RTC_E41029FIDC_RTC_E21030GIDC_RTC_E11031HIDC_RTC_F81032IIDC_RTC_F41033JIDC_RTC_F21034KIDC_RTC_F11035LIDC_DAY1036MIDC_YEAR1037NIDC_MONTH1038OIDC_HOUR1039PIDC_MINUTE1040QIDC_SECOND1041RIDC_LBLMONTH1042SIDC_LBLYEAR1043TIDC_LBLDAY1044UIDC_LBLHOUR1045VIDC_LBLMINUTE1046WIDC_LBLSECOND1047XIDC_CACHE_MB1048YIDC_SPIN_CACHE1049ZIDC_ROM_DATA1051[IDC_WARNINGS1052\IDC_DISCLAIMER1053]IDC_FREEZE_FOLDER1054^IDC_BROWSE1055_IDC_CANCEL1056`IDC_AUTO_SAVE_DELAY1057aIDC_MAX_SKIP1058bIDC_TURBO_SKIP1059cIDC_TOGGLE_TURBO1060dIDC_SRAM_SPIN1061eIDC_SPIN_MAX_SKIP1062fIDC_SPIN_TURBO_SKIP1063gIDC_ROM_DIR1064hIDC_INACTIVE_PAUSE1064iIDC_INTERLEAVE1065jIDC_VIDEO_MODE1066kIDC_HEADER1067lIDC_ROMLIST1068mIDC_MEM_TYPE1069nIDC_STAR_OCEAN1070oIDC_SO_BROWSE1071pIDC_FEOEZ1072qIDC_FEOEZ_BROWSE1073rIDC_MDH1074sIDC_MDH_BROWSE1075tIDC_SPL41076uIDC_SPL4_BROWSE1077vIDC_SJNS1078wIDC_FEOEZ_SJNS_BROWSE1079xIDC_SFA21080yIDC_SFA2_BROWSE1081zIDC_SFA2E1082{IDC_SFA2E_BROWSE1083|IDC_SFZ21084}IDC_SFZ2_BROWSE1085~IDC_HOSTNAME1086IDC_PORTNUMBER1087€IDC_CLEARHISTORY1088IDC_STATIC21089‚IDC_EDIT11090ƒIDC_UP1090„IDC_VALUE_ENTER1090…IDC_MOVIE_METADATA1090†IDC_PAUSEINTERVAL1091‡IDC_UPRIGHT1091ˆIDC_MAXSKIP1092‰IDC_PAUSESPIN1093ŠIDC_DWNRIGHT1093‹IDC_SYNCBYRESET1094ŒIDC_DOWN1094IDC_SENDROM1095ŽIDC_DWNLEFT1095IDC_ACTASSERVER1096IDC_LEFT1096‘IDC_MAXSPIN1097’IDC_UPLEFT1097“IDC_SELECT1098”IDC_PORTNUMBERA1099•IDC_START1099–IDC_TESTMODE1100—IDC_L1100˜IDC_VIDEOLIST1101™IDC_R1101šIDC_SELECT21101›IDC_VIDMODELIST1102œIDC_Y1102IDC_SETDMODE1103žIDC_B1103ŸIDC_A1104 IDC_X1105¡IDC_RIGHT1106¢IDC_SHOWFPS1108£IDC_STRETCH1109¤IDC_FULLSCREEN1110¥IDC_BILINEARMD71111¦IDC_RENDER16BIT1112§IDC_TRANS1113¨IDC_HIRES1114©IDC_CHEAT_CODE1115ªIDC_FILTERBOX1116«IDC_AUTOFRAME1117¬IDC_LIMITFRAMES1118­IDC_FRAMERATESKIPSLIDER1120®IDC_TOGGLE1121¯IDC_DBLBUFFER1122°IDC_CURRMODE1123±IDC_DELETE_CHEAT1124²IDC_NPPROGRESS1124³IDC_VIDEOCARD1124´IDC_UPDATE_CHEAT1125µIDC_JPCOMBO1125¶IDC_CLEAR_CHEATS1126·IDC_JPTOGGLE1126¸IDC_CHEAT_DESCRIPTION1127¹IDC_KEYBOARD1127ºIDC_ALLOWLEFTRIGHT1127»IDC_CHEAT_ADDRESS1128¼IDC_TOGL1128½IDC_CHEAT_BYTE1129¾IDC_ADD_CHEAT1130¿IDC_CHEAT_LIST1131ÀIDC_PICTURE1132ÁIDC_ADDYS1133ÂIDC_OK1134ÃIDC_C_SEARCH1134ÄIDC_RED1135ÅIDC_C_ADD1135ÆIDC_BLUE1136ÇIDC_C_RESET1136ÈIDC_LABEL_BLUE1136ÉIDC_1_BYTE1137ÊIDC_2_BYTE1138ËIDC_3_BYTE1139ÌIDC_4_BYTE1140ÍIDC_LESS_THAN1141ÎIDC_GREATER_THAN1142ÏIDC_LESS_THAN_EQUAL1143ÐIDC_GREATER_THAN_EQUAL1144ÑIDC_EQUAL1145ÒIDC_NOT_EQUAL1146ÓIDC_PREV1147ÔIDC_ENTERED1148ÕIDC_UNSIGNED1149ÖIDC_SIGNED1150×IDC_HEX1151ØIDC_ENTER_LABEL1152ÙIDC_DIAGTOGGLE1153ÚIDC_UNDO1154ÛIDC_COMBO11155ÜIDC_NC_ADDRESS1156ÝIDC_NC_CURRVAL1157ÞIDC_NC_PREVVAL1158ßIDC_NC_NEWVAL1159àIDC_NC_DESC1160áIDC_LABEL_UP1161âIDC_LABEL_LEFT1162ãIDC_LABEL_DOWN1163äIDC_LABEL_RIGHT1164åIDC_LABEL_B1165æIDC_LABEL_A1166çIDC_LABEL_Y1167èIDC_LABEL_RIGHT21167éIDC_LABEL_X1168êIDC_LABEL_START1169ëIDC_LABEL_SELECT1170ìIDC_LABEL_L1171íIDC_LABEL_R1172îIDC_LABEL_UPLEFT1173ïIDC_LABEL_R21173ðIDC_LABEL_UPRIGHT1174ñIDC_LABEL_DOWNRIGHT1175òIDC_LABEL_DOWNLEFT1176óIDC_LABEL_FREEZE1177ôIDC_LABEL_ASRAM1178õIDC_LABEL_SMAX1179öIDC_LABEL_STURBO1180÷IDC_LABEL_ASRAM_TEXT1181øIDC_LABEL_UP21181ùIDC_LABEL_SMAX_TEXT1182úIDC_LABEL_UP31182ûIDC_LABEL_STURBO_TEXT1183üIDC_LABEL_UP41183ýIDC_PORTNUMBLOCK1184þIDC_LABEL_UP51184ÿIDC_CLIENTSETTINGSBLOCK1185IDC_LABEL_UP61185IDC_SERVERSETTINGSBLOCK1186IDC_LABEL_UP71186IDC_LABEL_PORTNUM1187IDC_LABEL_UP81187IDC_LABEL_PAUSEINTERVAL1188IDC_LABEL_UP91188IDC_LABEL_PAUSEINTERVAL_TEXT1189IDC_LABEL_UP101189 IDC_LABEL_MAXSKIP1190 +IDC_LABEL_UP111190 IDC_LABEL_CHEAT_CODE1191 IDC_LABEL_UP121191 IDC_LABEL_CHEAT_DESCRIPTION1192IDC_LABEL_UP131192IDC_LABEL_CHEAT_ADDRESS1193IDC_LABEL_UP141193IDC_LABEL_CHEAT_BYTE1194IDC_LABEL_UP151194IDC_LABEL_SERVERADDY1195IDC_LABEL_UP161195IDC_LABEL_UP171196IDC_LABEL_UP181197IDC_HEIGHT_EXTEND1198IDC_LABEL_UP191198IDC_SPEEDDOWN1199IDC_ASPECT1199IDC_PAUSE1200IDC_RECORD_NOW1201IDC_FRAMEADVANCE1201IDC_RECORD_RESET1202IDC_SKIPUP1202 IDC_JOY11203!IDC_SKIPDOWN1203"IDC_JOY21204#IDC_SPEEDUP1204$IDC_JOY31205%IDC_SCOPETURBO1205&IDC_JOY41206'IDC_SCOPEPAUSE1206(IDC_JOY51207)IDC_FRAMECOUNT1207*IDC_MOVIE_PATH1208+IDC_SAVE11208,IDC_BROWSE_MOVIE1209-IDC_SAVE21209.IDC_MOVIE_DATE1210/IDC_SAVE312100IDC_MOVIE_LENGTH12111IDC_SAVE412112IDC_MOVIE_FRAMES12123IDC_SAVE512124IDC_MOVIE_RERECORD12135IDC_SAVE612136IDC_SAVE712147IDC_SAVE812158IDC_LOADEDFROMMOVIE12159IDC_SAVE91216:IDC_MOVIEROMINFO1216;IDC_SAVE101217<IDC_CURRENTROMINFO1217=IDC_READONLY1218>IDC_SAVE111219BIDC_DISPLAY_INPUT1220CIDC_SAVE121220DIDC_SAVE131221EIDC_SAVE141222FIDC_SAVE151223GIDC_SAVE161224HIDC_SAVE171225IIDC_SAVE181226JIDC_SAVE191227KIDC_SAVE201228LIDC_LABEL_UP201229MIDC_LABEL_UP211230NIDC_FASTFORWARD1231OIDC_SHOWPRESSED1232PID_FILE_EXIT40001QID_LANGUAGE_ENGLISH40002RID_LANGUAGE_NEDERLANDS40003SID_WINDOW_HIDEMENUBAR40004TID_SOUND_8BIT8000HZMONO40005UID_SOUND_8BIT11025HZMONO40006VID_SOUND_8BIT22050HZMONO40007WID_SOUND_8BIT44100HZMONO40008XID_SOUND_16BIT8000HZMONO40009YID_SOUND_16BIT11025HZMONO40010ZID_SOUND_16BIT22050HZMONO40011[ID_SOUND_16BIT44100HZMONO40012\ID_SOUND_8BIT8000HZSTEREO40013]ID_SOUND_8BIT11025HZSTEREO40014^ID_SOUND_8BIT22050HZSTEREO40015_ID_SOUND_8BIT44100HZSTEREO40016`ID_SOUND_16BIT8000HZSTEREO40017aID_SOUND_16BIT11025HZSTEREO40018bID_SOUND_16BIT22050HZSTEREO40019cID_SOUND_16BIT44100HZSTEREO40020dID_SOUND_NOSOUND40021eID_OPTIONS_JOYPAD40022fID_WINDOW_SHOWFPS40023gID_OPTIONS_DISPLAY40024hID_FILE_RESET40025iID_FILE_PAUSE40026jID_SOUND_INTERPOLATED40027kID_SOUND_SYNC40028lID_WINDOW_FULLSCREEN40029mID_SOUND_16BIT40030nID_SOUND_STEREO40031oID_WINDOW_STRETCH40032pID_SOUND_8000HZ40033qID_SOUND_11025HZ40034rID_SOUND_22050HZ40035sID_SOUND_44100HZ40036tID_SOUND_30000HZ40037uID_SOUND_50MS40038vID_SOUND_100MS40039wID_SOUND_200MS40040xID_SOUND_500MS40041yID_SOUND_1S40042zID_SOUND_25MS40043{ID_SOUND_2S40044|ID_FILE_SAVE140045}ID_FILE_SAVE240046~ID_FILE_SAVE340047ID_FILE_SAVE440048€ID_FILE_SAVE540049ID_FILE_SAVE640050‚ID_FILE_SAVE740051ƒID_FILE_SAVE840052„ID_FILE_SAVE940053…ID_FILE_LOAD140054†ID_FILE_LOAD240055‡ID_FILE_LOAD340056ˆID_FILE_LOAD440057‰ID_FILE_LOAD540058ŠID_FILE_LOAD640059‹ID_FILE_LOAD740060ŒID_FILE_LOAD840061ID_FILE_LOAD940062ŽID_CHEAT_ENTER40063ID_CHEAT_SEARCH40064ID_CHEAT_APPLY40065‘ID_FILE_SAVE_SPC_DATA40066’ID_HELP_ABOUT40067“ID_SOUND_OPTIONS40068”ID_OPTIONS_EMULATION40069•ID_OPTIONS_SETTINGS40070–ID_DEBUG_TRACE40071—ID_DEBUG_TRACE_SPC40072˜ID_DEBUG_TRACE_SA140073™ID_DEBUG_TRACE_DSP140074šID_DEBUG_FRAME_ADVANCE40075›ID_DEBUG_SNES_STATUS40076œID_NETPLAY_SERVER40077ID_NETPLAY_CONNECT40078žID_NETPLAY_DISCONNECT40079ŸID_NETPLAY_OPTIONS40080 ID_NETPLAY_ROM40081¡ID_NETPLAY_SYNC40082¢ID_NETPLAY_SEND_ROM_ON_CONNECT40083£ID_NETPLAY_SYNC_BY_RESET40084¤ID_SOUND_48000HZ40085¥ID_SOUND_16000HZ40086¦ID_SOUND_35000HZ40087§ID_SOUND_REVERSE_STEREO40088¨ID_FILE_SAVE_SRAM_DATA40089©ID_RECENT_DUMMY40090ªIDM_LOG_711040091«IDM_7110_RTC40092¬IDM_7110_CACHE40093­IDM_ROM_INFO40094®ID_SOUND_32000HZ40095¯ID_TURBO_START40096°ID_TURBO_SELECT40097±ID_TURBO_L40098²ID_TURBO_R40099³ID_TURBO_Y40100´ID_TURBO_X40101µID_TURBO_B40102¶ID_TURBO_A40103·IDM_ENABLE_MULTITAP40104¸IDM_MOUSE_TOGGLE40105¹IDM_SCOPE_TOGGLE40106ºIDM_CATCH_UP_SOUND40107»IDM_GFX_PACKS40108¼IDM_JUSTIFIER40109½ID_SCREENSHOT40110¾ID_FILE_MOVIE_PLAY40113¿ID_FILE_MOVIE_STOP40114ÀID_FILE_MOVIE_RECORD40115ÁID_FILE_MOVIE_ENABLERECORDING40116ÂID_FILE_WRITE_AVI40116ÃID_FILE_STOP_AVI40117ÄID_OPTIONS_KEYCUSTOM40118Å_APS_NEXT_RESOURCE_VALUE141Ë_APS_NEXT_COMMAND_VALUE40119Ì_APS_NEXT_CONTROL_VALUE1216Í_APS_NEXT_SYMED_VALUE101Î!!afxres.h!winres.hVS_VERSION_INFO1IDC_STATIC(-1))!CBRS_ALIGN_LEFT0x1000L/CBRS_ALIGN_TOP0x2000L0CBRS_ALIGN_RIGHT0x4000L1CBRS_ALIGN_BOTTOM0x8000L2CBRS_ALIGN_ANY0xF000L3CBRS_BORDER_LEFT0x0100L5CBRS_BORDER_TOP0x0200L6CBRS_BORDER_RIGHT0x0400L7CBRS_BORDER_BOTTOM0x0800L8CBRS_BORDER_ANY0x0F00L9CBRS_TOOLTIPS0x0010L;CBRS_FLYBY0x0020L<CBRS_FLOAT_MULTI0x0040L=CBRS_BORDER_3D0x0080L>CBRS_HIDE_INPLACE0x0008L?CBRS_SIZE_DYNAMIC0x0004L@CBRS_SIZE_FIXED0x0002LACBRS_FLOATING0x0001LBCBRS_GRIPPER0x00400000LDCBRS_ORIENT_HORZ(CBRS_ALIGN_TOP|CBRS_ALIGN_BOTTOM)FCBRS_ORIENT_VERT(CBRS_ALIGN_LEFT|CBRS_ALIGN_RIGHT)GCBRS_ORIENT_ANY(CBRS_ORIENT_HORZ|CBRS_ORIENT_VERT)HCBRS_ALL0x0040FFFFLJCBRS_NOALIGN0x00000000LOCBRS_LEFT(CBRS_ALIGN_LEFT|CBRS_BORDER_RIGHT)PCBRS_TOP(CBRS_ALIGN_TOP|CBRS_BORDER_BOTTOM)QCBRS_RIGHT(CBRS_ALIGN_RIGHT|CBRS_BORDER_LEFT)RCBRS_BOTTOM(CBRS_ALIGN_BOTTOM|CBRS_BORDER_TOP)SID_INDICATOR_EXT0xE700YID_INDICATOR_CAPS0xE701ZID_INDICATOR_NUM0xE702[ID_INDICATOR_SCRL0xE703\ID_INDICATOR_OVR0xE704]ID_INDICATOR_REC0xE705^ID_INDICATOR_KANA0xE706_ID_SEPARATOR0aAFX_IDS_APP_TITLE0xE000“AFX_IDS_IDLEMESSAGE0xE001•AFX_IDS_HELPMODEMESSAGE0xE002—AFX_IDS_APP_TITLE_EMBEDDING0xE003™AFX_IDS_COMPANY_NAME0xE004›AFX_IDS_OBJ_TITLE_INPLACE0xE005ID_FILE_NEW0xE100£ID_FILE_OPEN0xE101¤ID_FILE_CLOSE0xE102¥ID_FILE_SAVE0xE103¦ID_FILE_SAVE_AS0xE104§ID_FILE_PAGE_SETUP0xE105¨ID_FILE_PRINT_SETUP0xE106©ID_FILE_PRINT0xE107ªID_FILE_PRINT_DIRECT0xE108«ID_FILE_PRINT_PREVIEW0xE109¬ID_FILE_UPDATE0xE10A­ID_FILE_SAVE_COPY_AS0xE10B®ID_FILE_SEND_MAIL0xE10C¯ID_FILE_NEW_FRAME0xE10D°ID_FILE_MRU_FIRST0xE110²ID_FILE_MRU_FILE10xE110³ID_FILE_MRU_FILE20xE111´ID_FILE_MRU_FILE30xE112µID_FILE_MRU_FILE40xE113¶ID_FILE_MRU_FILE50xE114·ID_FILE_MRU_FILE60xE115¸ID_FILE_MRU_FILE70xE116¹ID_FILE_MRU_FILE80xE117ºID_FILE_MRU_FILE90xE118»ID_FILE_MRU_FILE100xE119¼ID_FILE_MRU_FILE110xE11A½ID_FILE_MRU_FILE120xE11B¾ID_FILE_MRU_FILE130xE11C¿ID_FILE_MRU_FILE140xE11DÀID_FILE_MRU_FILE150xE11EÁID_FILE_MRU_FILE160xE11FÂID_FILE_MRU_LAST0xE11FÃID_EDIT_CLEAR0xE120ÆID_EDIT_CLEAR_ALL0xE121ÇID_EDIT_COPY0xE122ÈID_EDIT_CUT0xE123ÉID_EDIT_FIND0xE124ÊID_EDIT_PASTE0xE125ËID_EDIT_PASTE_LINK0xE126ÌID_EDIT_PASTE_SPECIAL0xE127ÍID_EDIT_REPEAT0xE128ÎID_EDIT_REPLACE0xE129ÏID_EDIT_SELECT_ALL0xE12AÐID_EDIT_UNDO0xE12BÑID_EDIT_REDO0xE12CÒID_WINDOW_NEW0xE130ÕID_WINDOW_ARRANGE0xE131ÖID_WINDOW_CASCADE0xE132×ID_WINDOW_TILE_HORZ0xE133ØID_WINDOW_TILE_VERT0xE134ÙID_WINDOW_SPLIT0xE135ÚID_APP_ABOUT0xE140âID_APP_EXIT0xE141ãID_HELP_INDEX0xE142äID_HELP_FINDER0xE143åID_HELP_USING0xE144æID_CONTEXT_HELP0xE145çID_HELP0xE146éID_DEFAULT_HELP0xE147êID_NEXT_PANE0xE150íID_PREV_PANE0xE151îID_FORMAT_FONT0xE160ñID_OLE_INSERT_NEW0xE200ôID_OLE_EDIT_LINKS0xE201õID_OLE_EDIT_CONVERT0xE202öID_OLE_EDIT_CHANGE_ICON0xE203÷ID_OLE_EDIT_PROPERTIES0xE204øID_OLE_VERB_FIRST0xE210ùAFX_ID_PREVIEW_CLOSE0xE300ÿAFX_ID_PREVIEW_NUMPAGE0xE301AFX_ID_PREVIEW_NEXT0xE302AFX_ID_PREVIEW_PREV0xE303AFX_ID_PREVIEW_PRINT0xE304AFX_ID_PREVIEW_ZOOMIN0xE305AFX_ID_PREVIEW_ZOOMOUT0xE306ID_VIEW_TOOLBAR0xE800ID_VIEW_STATUS_BAR0xE801 ID_VIEW_REBAR0xE804 +ID_VIEW_AUTOARRANGE0xE805 ID_VIEW_SMALLICON0xE810 ID_VIEW_LARGEICON0xE811ID_VIEW_LIST0xE812ID_VIEW_DETAILS0xE813ID_VIEW_LINEUP0xE814ID_VIEW_BYNAME0xE815AFX_ID_VIEW_MINIMUMID_VIEW_SMALLICONAFX_ID_VIEW_MAXIMUMID_VIEW_BYNAMEID_RECORD_FIRST0xE900ID_RECORD_LAST0xE901ID_RECORD_NEXT0xE902ID_RECORD_PREV0xE903IDC_STATIC(-1)#AFX_IDS_SCSIZE0xEF00,AFX_IDS_SCMOVE0xEF01-AFX_IDS_SCMINIMIZE0xEF02.AFX_IDS_SCMAXIMIZE0xEF03/AFX_IDS_SCNEXTWINDOW0xEF040AFX_IDS_SCPREVWINDOW0xEF051AFX_IDS_SCCLOSE0xEF062AFX_IDS_SCRESTORE0xEF123AFX_IDS_SCTASKLIST0xEF134AFX_IDS_MDICHILD0xEF1F6AFX_IDS_DESKACCESSORY0xEFDA8AFX_IDS_OPENFILE0xF000;AFX_IDS_SAVEFILE0xF001<AFX_IDS_ALLFILTER0xF002=AFX_IDS_UNTITLED0xF003>AFX_IDS_SAVEFILECOPY0xF004?AFX_IDS_PREVIEW_CLOSE0xF005@AFX_IDS_UNNAMED_FILE0xF006AAFX_IDS_HIDE0xF011BAFX_IDP_NO_ERROR_AVAILABLE0xF020EAFX_IDS_NOT_SUPPORTED_EXCEPTION0xF021FAFX_IDS_RESOURCE_EXCEPTION0xF022GAFX_IDS_MEMORY_EXCEPTION0xF023HAFX_IDS_USER_EXCEPTION0xF024IAFX_IDS_INVALID_ARG_EXCEPTION0xF025JAFX_IDS_PRINTONPORT0xF040MAFX_IDS_ONEPAGE0xF041NAFX_IDS_TWOPAGE0xF042OAFX_IDS_PRINTPAGENUM0xF043PAFX_IDS_PREVIEWPAGEDESC0xF044QAFX_IDS_PRINTDEFAULTEXT0xF045RAFX_IDS_PRINTDEFAULT0xF046SAFX_IDS_PRINTFILTER0xF047TAFX_IDS_PRINTCAPTION0xF048UAFX_IDS_PRINTTOFILE0xF049VAFX_IDS_OBJECT_MENUITEM0xF080ZAFX_IDS_EDIT_VERB0xF081[AFX_IDS_ACTIVATE_VERB0xF082\AFX_IDS_CHANGE_LINK0xF083]AFX_IDS_AUTO0xF084^AFX_IDS_MANUAL0xF085_AFX_IDS_FROZEN0xF086`AFX_IDS_ALL_FILES0xF087aAFX_IDS_SAVE_MENU0xF088cAFX_IDS_UPDATE_MENU0xF089dAFX_IDS_SAVE_AS_MENU0xF08AeAFX_IDS_SAVE_COPY_AS_MENU0xF08BfAFX_IDS_EXIT_MENU0xF08CgAFX_IDS_UPDATING_ITEMS0xF08DhAFX_IDS_METAFILE_FORMAT0xF08EjAFX_IDS_DIB_FORMAT0xF08FkAFX_IDS_BITMAP_FORMAT0xF090lAFX_IDS_LINKSOURCE_FORMAT0xF091mAFX_IDS_EMBED_FORMAT0xF092nAFX_IDS_PASTELINKEDTYPE0xF094pAFX_IDS_UNKNOWNTYPE0xF095qAFX_IDS_RTF_FORMAT0xF096rAFX_IDS_TEXT_FORMAT0xF097sAFX_IDS_INVALID_CURRENCY0xF098uAFX_IDS_INVALID_DATETIME0xF099vAFX_IDS_INVALID_DATETIMESPAN0xF09AwAFX_IDP_INVALID_FILENAME0xF100zAFX_IDP_FAILED_TO_OPEN_DOC0xF101{AFX_IDP_FAILED_TO_SAVE_DOC0xF102|AFX_IDP_ASK_TO_SAVE0xF103}AFX_IDP_FAILED_TO_CREATE_DOC0xF104~AFX_IDP_FILE_TOO_LARGE0xF105AFX_IDP_FAILED_TO_START_PRINT0xF106€AFX_IDP_FAILED_TO_LAUNCH_HELP0xF107AFX_IDP_INTERNAL_FAILURE0xF108‚AFX_IDP_COMMAND_FAILURE0xF109ƒAFX_IDP_FAILED_MEMORY_ALLOC0xF10A„AFX_IDP_UNREG_DONE0xF10B…AFX_IDP_UNREG_FAILURE0xF10C†AFX_IDP_DLL_LOAD_FAILED0xF10D‡AFX_IDP_DLL_BAD_VERSION0xF10EˆAFX_IDP_PARSE_INT0xF110‹AFX_IDP_PARSE_REAL0xF111ŒAFX_IDP_PARSE_INT_RANGE0xF112AFX_IDP_PARSE_REAL_RANGE0xF113ŽAFX_IDP_PARSE_STRING_SIZE0xF114AFX_IDP_PARSE_RADIO_BUTTON0xF115AFX_IDP_PARSE_BYTE0xF116‘AFX_IDP_PARSE_UINT0xF117’AFX_IDP_PARSE_DATETIME0xF118“AFX_IDP_PARSE_CURRENCY0xF119”AFX_IDP_PARSE_GUID0xF11A•AFX_IDP_PARSE_TIME0xF11B–AFX_IDP_PARSE_DATE0xF11C—AFX_IDP_FAILED_INVALID_FORMAT0xF120šAFX_IDP_FAILED_INVALID_PATH0xF121›AFX_IDP_FAILED_DISK_FULL0xF122œAFX_IDP_FAILED_ACCESS_READ0xF123AFX_IDP_FAILED_ACCESS_WRITE0xF124žAFX_IDP_FAILED_IO_ERROR_READ0xF125ŸAFX_IDP_FAILED_IO_ERROR_WRITE0xF126 AFX_IDP_SCRIPT_ERROR0xF130£AFX_IDP_SCRIPT_DISPATCH_EXCEPTION0xF131¤AFX_IDP_STATIC_OBJECT0xF180§AFX_IDP_FAILED_TO_CONNECT0xF181¨AFX_IDP_SERVER_BUSY0xF182©AFX_IDP_BAD_VERB0xF183ªAFX_IDS_NOT_DOCOBJECT0xF184«AFX_IDP_FAILED_TO_NOTIFY0xF185¬AFX_IDP_FAILED_TO_LAUNCH0xF186­AFX_IDP_ASK_TO_UPDATE0xF187®AFX_IDP_FAILED_TO_UPDATE0xF188¯AFX_IDP_FAILED_TO_REGISTER0xF189°AFX_IDP_FAILED_TO_AUTO_REGISTER0xF18A±AFX_IDP_FAILED_TO_CONVERT0xF18B²AFX_IDP_GET_NOT_SUPPORTED0xF18C³AFX_IDP_SET_NOT_SUPPORTED0xF18D´AFX_IDP_ASK_TO_DISCARD0xF18EµAFX_IDP_FAILED_TO_CREATE0xF18F¶AFX_IDP_FAILED_MAPI_LOAD0xF190¹AFX_IDP_INVALID_MAPI_DLL0xF191ºAFX_IDP_FAILED_MAPI_SEND0xF192»AFX_IDP_FILE_NONE0xF1A0½AFX_IDP_FILE_GENERIC0xF1A1¾AFX_IDP_FILE_NOT_FOUND0xF1A2¿AFX_IDP_FILE_BAD_PATH0xF1A3ÀAFX_IDP_FILE_TOO_MANY_OPEN0xF1A4ÁAFX_IDP_FILE_ACCESS_DENIED0xF1A5ÂAFX_IDP_FILE_INVALID_FILE0xF1A6ÃAFX_IDP_FILE_REMOVE_CURRENT0xF1A7ÄAFX_IDP_FILE_DIR_FULL0xF1A8ÅAFX_IDP_FILE_BAD_SEEK0xF1A9ÆAFX_IDP_FILE_HARD_IO0xF1AAÇAFX_IDP_FILE_SHARING0xF1ABÈAFX_IDP_FILE_LOCKING0xF1ACÉAFX_IDP_FILE_DISKFULL0xF1ADÊAFX_IDP_FILE_EOF0xF1AEËAFX_IDP_ARCH_NONE0xF1B0ÍAFX_IDP_ARCH_GENERIC0xF1B1ÎAFX_IDP_ARCH_READONLY0xF1B2ÏAFX_IDP_ARCH_ENDOFFILE0xF1B3ÐAFX_IDP_ARCH_WRITEONLY0xF1B4ÑAFX_IDP_ARCH_BADINDEX0xF1B5ÒAFX_IDP_ARCH_BADCLASS0xF1B6ÓAFX_IDP_ARCH_BADSCHEMA0xF1B7ÔAFX_IDS_OCC_SCALEUNITS_PIXELS0xF1C0ÖAFX_IDS_STATUS_FONT0xF230ÛAFX_IDS_TOOLTIP_FONT0xF231ÜAFX_IDS_UNICODE_FONT0xF232ÝAFX_IDS_MINI_FONT0xF233ÞAFX_IDP_SQL_CONNECT_FAIL0xF281äAFX_IDP_SQL_RECORDSET_FORWARD_ONLY0xF282åAFX_IDP_SQL_EMPTY_COLUMN_LIST0xF283æAFX_IDP_SQL_FIELD_SCHEMA_MISMATCH0xF284çAFX_IDP_SQL_ILLEGAL_MODE0xF285èAFX_IDP_SQL_MULTIPLE_ROWS_AFFECTED0xF286éAFX_IDP_SQL_NO_CURRENT_RECORD0xF287êAFX_IDP_SQL_NO_ROWS_AFFECTED0xF288ëAFX_IDP_SQL_RECORDSET_READONLY0xF289ìAFX_IDP_SQL_SQL_NO_TOTAL0xF28AíAFX_IDP_SQL_ODBC_LOAD_FAILED0xF28BîAFX_IDP_SQL_DYNASET_NOT_SUPPORTED0xF28CïAFX_IDP_SQL_SNAPSHOT_NOT_SUPPORTED0xF28DðAFX_IDP_SQL_API_CONFORMANCE0xF28EñAFX_IDP_SQL_SQL_CONFORMANCE0xF28FòAFX_IDP_SQL_NO_DATA_FOUND0xF290óAFX_IDP_SQL_ROW_UPDATE_NOT_SUPPORTED0xF291ôAFX_IDP_SQL_ODBC_V2_REQUIRED0xF292õAFX_IDP_SQL_NO_POSITIONED_UPDATES0xF293öAFX_IDP_SQL_LOCK_MODE_NOT_SUPPORTED0xF294÷AFX_IDP_SQL_DATA_TRUNCATED0xF295øAFX_IDP_SQL_ROW_FETCH0xF296ùAFX_IDP_SQL_INCORRECT_ODBC0xF297úAFX_IDP_SQL_UPDATE_DELETE_FAILED0xF298ûAFX_IDP_SQL_DYNAMIC_CURSOR_NOT_SUPPORTED0xF299üAFX_IDP_SQL_FIELD_NOT_FOUND0xF29AýAFX_IDP_SQL_BOOKMARKS_NOT_SUPPORTED0xF29BþAFX_IDP_SQL_BOOKMARKS_NOT_ENABLED0xF29CÿAFX_IDS_DELETED0xF29DAFX_IDP_DAO_ENGINE_INITIALIZATION0xF2B0AFX_IDP_DAO_DFX_BIND0xF2B1 AFX_IDP_DAO_OBJECT_NOT_OPEN0xF2B2 +AFX_IDP_DAO_ROWTOOSHORT0xF2B3AFX_IDP_DAO_BADBINDINFO0xF2B4AFX_IDP_DAO_COLUMNUNAVAILABLE0xF2B5AFX_IDS_HTTP_TITLE0xF2D1AFX_IDS_HTTP_NO_TEXT0xF2D2AFX_IDS_HTTP_BAD_REQUEST0xF2D3AFX_IDS_HTTP_AUTH_REQUIRED0xF2D4AFX_IDS_HTTP_FORBIDDEN0xF2D5AFX_IDS_HTTP_NOT_FOUND0xF2D6AFX_IDS_HTTP_SERVER_ERROR0xF2D7AFX_IDS_HTTP_NOT_IMPLEMENTED0xF2D8AFX_IDS_CHECKLISTBOX_UNCHECK0xF2E1!AFX_IDS_CHECKLISTBOX_CHECK0xF2E2"AFX_IDS_CHECKLISTBOX_MIXED0xF2E3#AFX_IDC_LISTBOX100)AFX_IDC_CHANGE101*AFX_IDC_BROWSER102+AFX_IDC_PRINT_DOCNAME201.AFX_IDC_PRINT_PRINTERNAME202/AFX_IDC_PRINT_PORTNAME2030AFX_IDC_PRINT_PAGENUM2041ID_APPLY_NOW0x30214ID_WIZBACK0x30235ID_WIZNEXT0x30246ID_WIZFINISH0x30257AFX_IDC_TAB_CONTROL0x30208AFX_IDD_NEWTYPEDLG30721KAFX_IDD_PRINTDLG30722LAFX_IDD_PREVIEW_TOOLBAR30723MAFX_IDD_INSERTOBJECT30724PAFX_IDD_CHANGEICON30725QAFX_IDD_CONVERT30726RAFX_IDD_PASTESPECIAL30727SAFX_IDD_EDITLINKS30728TAFX_IDD_FILEBROWSE30729UAFX_IDD_BUSY30730VAFX_IDD_OBJECTPROPERTIES30732XAFX_IDD_CHANGESOURCE30733YAFX_IDC_CONTEXTHELP30977]AFX_IDC_MAGNIFY30978^AFX_IDC_SMALLARROWS30979_AFX_IDC_HSPLITBAR30980`AFX_IDC_VSPLITBAR30981aAFX_IDC_NODROPCRSR30982bAFX_IDC_TRACKNWSE30983cAFX_IDC_TRACKNESW30984dAFX_IDC_TRACKNS30985eAFX_IDC_TRACKWE30986fAFX_IDC_TRACK4WAY30987gAFX_IDC_MOVE4WAY30988hAFX_IDC_MOUSE_PAN_NW30998lAFX_IDC_MOUSE_PAN_N30999mAFX_IDC_MOUSE_PAN_NE31000nAFX_IDC_MOUSE_PAN_W31001oAFX_IDC_MOUSE_PAN_HV31002pAFX_IDC_MOUSE_PAN_E31003qAFX_IDC_MOUSE_PAN_SW31004rAFX_IDC_MOUSE_PAN_S31005sAFX_IDC_MOUSE_PAN_SE31006tAFX_IDC_MOUSE_PAN_HORZ31007uAFX_IDC_MOUSE_PAN_VERT31008vAFX_IDC_MOUSE_ORG_HORZ31009yAFX_IDC_MOUSE_ORG_VERT31010zAFX_IDC_MOUSE_ORG_HV31011{AFX_IDC_MOUSE_MASK31012|AFX_IDB_MINIFRAME_MENU30994AFX_IDB_CHECKLISTBOX_9530996‚AFX_IDR_PREVIEW_ACCEL30997…AFX_IDI_STD_MDIFRAME31233ˆAFX_IDI_STD_FRAME31234‰AFX_IDC_FONTPROP1000AFX_IDC_FONTNAMES1001AFX_IDC_FONTSTYLES1002‘AFX_IDC_FONTSIZES1003’AFX_IDC_STRIKEOUT1004“AFX_IDC_UNDERLINE1005”AFX_IDC_SAMPLEBOX1006•AFX_IDC_COLOR_BLACK1100˜AFX_IDC_COLOR_WHITE1101™AFX_IDC_COLOR_RED1102šAFX_IDC_COLOR_GREEN1103›AFX_IDC_COLOR_BLUE1104œAFX_IDC_COLOR_YELLOW1105AFX_IDC_COLOR_MAGENTA1106žAFX_IDC_COLOR_CYAN1107ŸAFX_IDC_COLOR_GRAY1108 AFX_IDC_COLOR_LIGHTGRAY1109¡AFX_IDC_COLOR_DARKRED1110¢AFX_IDC_COLOR_DARKGREEN1111£AFX_IDC_COLOR_DARKBLUE1112¤AFX_IDC_COLOR_LIGHTBROWN1113¥AFX_IDC_COLOR_DARKMAGENTA1114¦AFX_IDC_COLOR_DARKCYAN1115§AFX_IDC_COLORPROP1116¨AFX_IDC_SYSTEMCOLORS1117©AFX_IDC_PROPNAME1201¬AFX_IDC_PICTURE1202­AFX_IDC_BROWSE1203®AFX_IDC_CLEAR1204¯AFX_IDD_PROPPAGE_COLOR32257µAFX_IDD_PROPPAGE_FONT32258¶AFX_IDD_PROPPAGE_PICTURE32259·AFX_IDB_TRUETYPE32384¹AFX_IDS_PROPPAGE_UNKNOWN0xFE01¿AFX_IDS_COLOR_DESKTOP0xFE04ÀAFX_IDS_COLOR_APPWORKSPACE0xFE05ÁAFX_IDS_COLOR_WNDBACKGND0xFE06ÂAFX_IDS_COLOR_WNDTEXT0xFE07ÃAFX_IDS_COLOR_MENUBAR0xFE08ÄAFX_IDS_COLOR_MENUTEXT0xFE09ÅAFX_IDS_COLOR_ACTIVEBAR0xFE0AÆAFX_IDS_COLOR_INACTIVEBAR0xFE0BÇAFX_IDS_COLOR_ACTIVETEXT0xFE0CÈAFX_IDS_COLOR_INACTIVETEXT0xFE0DÉAFX_IDS_COLOR_ACTIVEBORDER0xFE0EÊAFX_IDS_COLOR_INACTIVEBORDER0xFE0FËAFX_IDS_COLOR_WNDFRAME0xFE10ÌAFX_IDS_COLOR_SCROLLBARS0xFE11ÍAFX_IDS_COLOR_BTNFACE0xFE12ÎAFX_IDS_COLOR_BTNSHADOW0xFE13ÏAFX_IDS_COLOR_BTNTEXT0xFE14ÐAFX_IDS_COLOR_BTNHIGHLIGHT0xFE15ÑAFX_IDS_COLOR_DISABLEDTEXT0xFE16ÒAFX_IDS_COLOR_HIGHLIGHT0xFE17ÓAFX_IDS_COLOR_HIGHLIGHTTEXT0xFE18ÔAFX_IDS_REGULAR0xFE19ÕAFX_IDS_BOLD0xFE1AÖAFX_IDS_ITALIC0xFE1B×AFX_IDS_BOLDITALIC0xFE1CØAFX_IDS_SAMPLETEXT0xFE1DÙAFX_IDS_DISPLAYSTRING_FONT0xFE1EÚAFX_IDS_DISPLAYSTRING_COLOR0xFE1FÛAFX_IDS_DISPLAYSTRING_PICTURE0xFE20ÜAFX_IDS_PICTUREFILTER0xFE21ÝAFX_IDS_PICTYPE_UNKNOWN0xFE22ÞAFX_IDS_PICTYPE_NONE0xFE23ßAFX_IDS_PICTYPE_BITMAP0xFE24àAFX_IDS_PICTYPE_METAFILE0xFE25áAFX_IDS_PICTYPE_ICON0xFE26âAFX_IDS_COLOR_PPG0xFE28ãAFX_IDS_COLOR_PPG_CAPTION0xFE29äAFX_IDS_FONT_PPG0xFE2AåAFX_IDS_FONT_PPG_CAPTION0xFE2BæAFX_IDS_PICTURE_PPG0xFE2CçAFX_IDS_PICTURE_PPG_CAPTION0xFE2DèAFX_IDS_PICTUREBROWSETITLE0xFE30éAFX_IDS_BORDERSTYLE_00xFE31êAFX_IDS_BORDERSTYLE_10xFE32ëAFX_IDS_VERB_EDIT0xFE40îAFX_IDS_VERB_PROPERTIES0xFE41ïAFX_IDP_PICTURECANTOPEN0xFE83òAFX_IDP_PICTURECANTLOAD0xFE84óAFX_IDP_PICTURETOOLARGE0xFE85ôAFX_IDP_PICTUREREADFAILED0xFE86õAFX_IDP_E_ILLEGALFUNCTIONCALL0xFEA0øAFX_IDP_E_OVERFLOW0xFEA1ùAFX_IDP_E_OUTOFMEMORY0xFEA2úAFX_IDP_E_DIVISIONBYZERO0xFEA3ûAFX_IDP_E_OUTOFSTRINGSPACE0xFEA4üAFX_IDP_E_OUTOFSTACKSPACE0xFEA5ýAFX_IDP_E_BADFILENAMEORNUMBER0xFEA6þAFX_IDP_E_FILENOTFOUND0xFEA7ÿAFX_IDP_E_BADFILEMODE0xFEA8AFX_IDP_E_FILEALREADYOPEN0xFEA9AFX_IDP_E_DEVICEIOERROR0xFEAAAFX_IDP_E_FILEALREADYEXISTS0xFEABAFX_IDP_E_BADRECORDLENGTH0xFEACAFX_IDP_E_DISKFULL0xFEADAFX_IDP_E_BADRECORDNUMBER0xFEAEAFX_IDP_E_BADFILENAME0xFEAFAFX_IDP_E_TOOMANYFILES0xFEB0AFX_IDP_E_DEVICEUNAVAILABLE0xFEB1 AFX_IDP_E_PERMISSIONDENIED0xFEB2 +AFX_IDP_E_DISKNOTREADY0xFEB3 AFX_IDP_E_PATHFILEACCESSERROR0xFEB4 AFX_IDP_E_PATHNOTFOUND0xFEB5 AFX_IDP_E_INVALIDPATTERNSTRING0xFEB6AFX_IDP_E_INVALIDUSEOFNULL0xFEB7AFX_IDP_E_INVALIDFILEFORMAT0xFEB8AFX_IDP_E_INVALIDPROPERTYVALUE0xFEB9AFX_IDP_E_INVALIDPROPERTYARRAYINDEX0xFEBAAFX_IDP_E_SETNOTSUPPORTEDATRUNTIME0xFEBBAFX_IDP_E_SETNOTSUPPORTED0xFEBCAFX_IDP_E_NEEDPROPERTYARRAYINDEX0xFEBDAFX_IDP_E_SETNOTPERMITTED0xFEBEAFX_IDP_E_GETNOTSUPPORTEDATRUNTIME0xFEBFAFX_IDP_E_GETNOTSUPPORTED0xFEC0AFX_IDP_E_PROPERTYNOTFOUND0xFEC1AFX_IDP_E_INVALIDCLIPBOARDFORMAT0xFEC2AFX_IDP_E_INVALIDPICTURE0xFEC3AFX_IDP_E_PRINTERERROR0xFEC4AFX_IDP_E_CANTSAVEFILETOTEMP0xFEC5AFX_IDP_E_SEARCHTEXTNOTFOUND0xFEC6AFX_IDP_E_REPLACEMENTSTOOLONG0xFEC7!!language.hWINDOW_TITLE"Snes9X v%s for Windows"\MY_REG_KEY"Software\\Emulators\\Snes9X"^REG_KEY_VER"1.31"`s, zones.\r\n\r\n" "Snes9X is a Super Nintendo Entertainment System\r\n" "emulator that allows you to play most games designed\r\n" "for the SNES on your PC.\r\n\r\n" "Please visit http://www.snes9x.com for\r\n" "up-to-the-minute information and hekAPP_NAME"Snes9x"nSNES9X_INFO"Snes9x: Information"pSNES9X_WARN"Snes9x: WARNING!"qSNES9X_DXS"Snes9X: DirectSound"rSNES9X_SNDQ"Snes9X: Sound CPU Question"sSNES9X_NP_ERROR"Snes9X: NetPlay Error"tBUTTON_OK"&OK"uBUTTON_CANCEL"&Cancel"vINPUTCONFIG_TITLE"Input Configuration"yINPUTCONFIG_JPTOGGLE"Enabled"zINPUTCONFIG_DIAGTOGGLE"Toggle Diagonals"{INPUTCONFIG_JPCOMBO"Joypad #%d"~INPUTCONFIG_LABEL_UP"Up"INPUTCONFIG_LABEL_DOWN"Down"€INPUTCONFIG_LABEL_LEFT"Left"INPUTCONFIG_LABEL_RIGHT"Right"‚INPUTCONFIG_LABEL_A"A"ƒINPUTCONFIG_LABEL_B"B"„INPUTCONFIG_LABEL_X"X"…INPUTCONFIG_LABEL_Y"Y"†INPUTCONFIG_LABEL_L"L"‡INPUTCONFIG_LABEL_R"R"ˆINPUTCONFIG_LABEL_START"Start"‰INPUTCONFIG_LABEL_SELECT"Select"ŠINPUTCONFIG_LABEL_UPLEFT"Up Left"‹INPUTCONFIG_LABEL_UPRIGHT"Up Right"ŒINPUTCONFIG_LABEL_DOWNRIGHT"Dn Right"INPUTCONFIG_LABEL_DOWNLEFT"Dn Left"ŽINPUTCONFIG_LABEL_BLUE"Blue means the button is already mapped;\nRed means it's used by windows or Snes9x"GAMEDEVICE_JOYNUMPREFIX"(J%d)"’GAMEDEVICE_JOYBUTPREFIX"#[%d]"“GAMEDEVICE_XNEG"Left"”GAMEDEVICE_XPOS"Right"•GAMEDEVICE_YPOS"Up"–GAMEDEVICE_YNEG"Down"—GAMEDEVICE_POVLEFT"POV Left"˜GAMEDEVICE_POVRIGHT"POV Right"™GAMEDEVICE_POVUP"POV Up"šGAMEDEVICE_POVDOWN"POV Down"›GAMEDEVICE_POVDNLEFT"POV Dn Left"œGAMEDEVICE_POVDNRIGHT"POV Dn Right"GAMEDEVICE_POVUPLEFT"POV Up Left"žGAMEDEVICE_POVUPRIGHT"POV Up Right"ŸGAMEDEVICE_ZPOS"Z Up" GAMEDEVICE_ZNEG"Z Down"¡GAMEDEVICE_RPOS"R Up"¢GAMEDEVICE_RNEG"R Down"£GAMEDEVICE_UPOS"U Up"¤GAMEDEVICE_UNEG"U Down"¥GAMEDEVICE_VPOS"V Up"¦GAMEDEVICE_VNEG"V Down"§GAMEDEVICE_BUTTON"Button %d"¨GAMEDEVICE_DISABLED"Disabled"«GAMEDEVICE_KEY"#%d"®GAMEDEVICE_NUMPADPREFIX"Numpad-%c"¯GAMEDEVICE_VK_TAB"Tab"°GAMEDEVICE_VK_BACK"Backspace"±GAMEDEVICE_VK_CLEAR"Delete"²GAMEDEVICE_VK_RETURN"Enter"³GAMEDEVICE_VK_LSHIFT"LShift"´GAMEDEVICE_VK_RSHIFT"RShift"µGAMEDEVICE_VK_LCONTROL"LCTRL"¶GAMEDEVICE_VK_RCONTROL"RCTRL"·GAMEDEVICE_VK_LMENU"LAlt"¸GAMEDEVICE_VK_RMENU"RAlt"¹GAMEDEVICE_VK_PAUSE"Pause"ºGAMEDEVICE_VK_CAPITAL"Capslock"»GAMEDEVICE_VK_ESCAPE"Disabled"¼GAMEDEVICE_VK_SPACE"Space"½GAMEDEVICE_VK_PRIOR"PgUp"¾GAMEDEVICE_VK_NEXT"PgDn"¿GAMEDEVICE_VK_HOME"Home"ÀGAMEDEVICE_VK_END"End"ÁGAMEDEVICE_VK_LEFT"Left"ÂGAMEDEVICE_VK_RIGHT"Right"ÃGAMEDEVICE_VK_UP"Up"ÄGAMEDEVICE_VK_DOWN"Down"ÅGAMEDEVICE_VK_SELECT"Select"ÆGAMEDEVICE_VK_PRINT"Print"ÇGAMEDEVICE_VK_EXECUTE"Execute"ÈGAMEDEVICE_VK_SNAPSHOT"SnapShot"ÉGAMEDEVICE_VK_INSERT"Insert"ÊGAMEDEVICE_VK_DELETE"Delete"ËGAMEDEVICE_VK_HELP"Help"ÌGAMEDEVICE_VK_LWIN"LWinKey"ÍGAMEDEVICE_VK_RWIN"RWinKey"ÎGAMEDEVICE_VK_APPS"AppKey"ÏGAMEDEVICE_VK_MULTIPLY"Numpad *"ÐGAMEDEVICE_VK_ADD"Numpad +"ÑGAMEDEVICE_VK_SEPARATOR"\\"ÒGAMEDEVICE_VK_OEM_1"Semi-Colon"ÓGAMEDEVICE_VK_OEM_7"Apostrophe"ÔGAMEDEVICE_VK_OEM_COMMA"Comma"ÕGAMEDEVICE_VK_OEM_PERIOD"Period"ÖGAMEDEVICE_VK_SUBTRACT"Numpad -"×GAMEDEVICE_VK_DECIMAL"Numpad ."ØGAMEDEVICE_VK_DIVIDE"Numpad /"ÙGAMEDEVICE_VK_NUMLOCK"Num-lock"ÚGAMEDEVICE_VK_SCROLL"Scroll-lock"ÛWINPROC_TURBOMODE_ON"Fast-Forward Activated"ßWINPROC_TURBOMODE_OFF"Fast-Forward Deactivated"àWINPROC_TURBOMODE_TEXT"Fast-Forward"áWINPROC_HDMA_TEXT"HDMA emulation"âWINPROC_BG1"BG#1"ãWINPROC_BG2"BG#2"äWINPROC_BG3"BG#3"åWINPROC_BG4"BG#4"æWINPROC_SPRITES"Sprites"çWINPROC_PADSWAP"Joypad swapping"èWINPROC_CONTROLERS0"Multiplayer 5 on #0"éWINPROC_CONTROLERS1"Joypad on #0"êWINPROC_CONTROLERS2"Mouse on #1"ëWINPROC_CONTROLERS3"Mouse on #0"ìWINPROC_CONTROLERS4"Superscope on #1"íWINPROC_CONTROLERS5"Justifier 1 on #1"îWINPROC_CONTROLERS6"Justifier 2 on #1"ïWINPROC_BGHACK"Background layering hack"ðWINPROC_MODE7INTER"Mode 7 Interpolation"ñWINPROC_TRANSPARENCY"Transparency effects"òWINPROC_CLIPWIN"Graphic clip windows"óWINPROC_PAUSE"Pause"ôWINPROC_EMUFRAMETIME"Emulated frame time: %dms"õWINPROC_AUTOSKIP"Auto Frame Skip"öWINPROC_FRAMESKIP"Frame skip: %d"÷WINPROC_TURBO_R_ON"Turbo R Activated"øWINPROC_TURBO_R_OFF"Turbo R Deactivated"ùWINPROC_TURBO_L_ON"Turbo L Activated"úWINPROC_TURBO_L_OFF"Turbo L Deactivated"ûWINPROC_TURBO_X_ON"Turbo X Activated"üWINPROC_TURBO_X_OFF"Turbo X Deactivated"ýWINPROC_TURBO_Y_ON"Turbo Y Activated"þWINPROC_TURBO_Y_OFF"Turbo Y Deactivated"ÿWINPROC_TURBO_A_ON"Turbo A Activated"WINPROC_TURBO_A_OFF"Turbo A Deactivated"WINPROC_TURBO_B_ON"Turbo B Activated"WINPROC_TURBO_B_OFF"Turbo B Deactivated"WINPROC_TURBO_SEL_ON"Turbo Select Activated"WINPROC_TURBO_SEL_OFF"Turbo Select Deactivated"WINPROC_TURBO_START_ON"Turbo Start Activated"WINPROC_TURBO_START_OFF"Turbo Start Deactivated"WINPROC_FILTER_RESTART"You will need to restart Snes9x before the output image\nprocessing option change will take effect."WINPROC_DISCONNECT"Disconnect from the NetPlay server first." WINPROC_NET_RESTART"Your game will be reset after the ROM has been sent due to\nyour 'Sync Using Reset Game' setting.\n\n" +WINPROC_INTERPOLATED_SND"Interpolated sound" WINPROC_SYNC_SND"Sync sound" is is what you want?" WINPROC_SND_RESTART"You will need to reset your game or load another one\nbefore enabling the sound CPU will take effect."EMUSET_TITLE"Emulation Settings"EMUSET_LABEL_FREEZE"Freeze Folder Directory"EMUSET_BROWSE"&Browse..."EMUSET_LABEL_ASRAM"Auto-Save S-RAM"EMUSET_LABEL_ASRAM_TEXT"seconds after last change (0 disables auto-save)"EMUSET_LABEL_SMAX"Skip at most"EMUSET_LABEL_SMAX_TEXT"frames in auto-frame rate mode"EMUSET_LABEL_STURBO"Skip Rendering"EMUSET_LABEL_STURBO_TEXT"frames in fast-forward mode"EMUSET_TOGGLE_TURBO"Toggled fast-forward mode"NPOPT_TITLE"Netplay Options"NPOPT_LABEL_PORTNUM"Socket Port Number" NPOPT_LABEL_PAUSEINTERVAL"Ask Server to Pause when"!NPOPT_LABEL_PAUSEINTERVAL_TEXT"frames behind""NPOPT_LABEL_MAXSKIP"Maximum Frame Rate Skip"#NPOPT_SYNCBYRESET"Sync By Reset"$NPOPT_SENDROM"Send ROM Image to Client on Connect"%NPOPT_ACTASSERVER"Act As Server"&NPOPT_PORTNUMBLOCK"Port Settings"'NPOPT_CLIENTSETTINGSBLOCK"Client Settings"(NPOPT_SERVERSETTINGSBLOCK"Server Settings")NPCON_TITLE"Connect to Server".NPCON_LABEL_SERVERADDY"Server Address"/NPCON_LABEL_PORTNUM"Port Number"0NPCON_CLEARHISTORY"Clear History"1MOVIE_INFO_REPLAY"Movie replay"6MOVIE_INFO_RECORD"Movie record"7MOVIE_INFO_RERECORD"Movie re-record"8MOVIE_INFO_REWIND"Movie rewind"9MOVIE_INFO_STOP"Movie stop":MOVIE_INFO_END"Movie end";MOVIE_INFO_RECORDING_ENABLED"Recording enabled"<MOVIE_INFO_RECORDING_DISABLED"Recording disabled"=MOVIE_ERR_SNAPSHOT_WRONG_MOVIE"Snapshot not from this movie">MOVIE_ERR_SNAPSHOT_NOT_MOVIE"Not a movie snapshot"?MOVIE_ERR_COULD_NOT_OPEN"Could not open movie file."@MOVIE_ERR_NOT_FOUND"File not found."AMOVIE_ERR_WRONG_FORMAT"File is wrong format."BMOVIE_ERR_WRONG_VERSION"File is wrong version."CAVI_CONFIGURATION_CHANGED"AVI recording stopped (configuration settings changed)."H!!ãÿ$HWBÿÿÉ0 ÿÿ ÿÿe nodrop.curÿÿÿÿe icon1.icoÿÿÿÿo openfold.bmpÿÿÿÿp closedfold.bmpÿÿÿÿq cdd.bmpÿÿÿÿr nd.bmpÿÿÿÿs hd.bmpÿÿÿÿ… pad.bmpÿÿÿÿ rt_manif.bin 3$HWBÿÿÊ0 12101IDC_CURSOR_SCOPEc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rc$ÿÿ9103IDR_SNES9X_ACCELERATORSc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rc$ID_SOUND_NOSOUNDUœID_SOUND_8000HZaœID_SOUND_11025HZbœID_SOUND_16000HZ–œID_SOUND_22050HZcœID_SOUND_30000HZeœID_SOUND_32000HZŸœID_SOUND_35000HZ—œID_SOUND_44100HZdœID_SOUND_48000HZ•œID_CHEAT_SEARCH€œID_CHEAT_ENTERœID_FILE_OPENáID_SOUND_REVERSE_STEREO˜œID_SOUND_OPTIONS„œID_WINDOW_STRETCH`œID_TURBO_R£œID_TURBO_B¦œID_SCREENSHOT®œID_OPTIONS_DISPLAYXœID_OPTIONS_JOYPADVœID_OPTIONS_SETTINGS†œID_TURBO_Y¤œID_TURBO_L¢œID_TURBO_A§œID_TURBO_X¥œID_WINDOW_FULLSCREEN]œID_SOUND_INTERPOLATED[œID_SOUND_SYNC\œID_TURBO_SELECT¡œID_TURBO_START œ$ÿÿ5102IDD_SOUND_OPTSc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rcMIDC_STATICÿÿIDC_STATICÿÿIDOKIDC_DRIVERéIDC_STATICÿÿIDC_BUFLENêIDC_STATICÿÿIDC_RATEëIDC_STATICÿÿIDC_MIXìIDC_STATICÿÿIDC_16BITíIDC_STEREOîIDC_REV_STEREOïIDC_LINEAR_INTERðIDC_SYNC_TO_SOUND_CPUñIDC_ENVXòIDC_ECHOóIDC_CACHINGôIDC_MASTER_VOLõIDC_SPC700ONöIDC_ANTIRES÷IDC_MUTEøIDC_SKIP_TYPEùIDC_STATICÿÿIDCANCELIDC_FMUTúIDC_WIP1ûIDC_FAMTü$ÿÿ5101IDD_SPC7110_CACHEc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rc‹IDOKIDCANCELIDC_SPC7110_ALLýIDC_SPC7110_SOMEþIDC_SPC7110_FILEÿIDC_CACHE_MBIDC_SPIN_CACHE$ÿÿ5103IDD_7110_RTCc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rcŸIDOKIDCANCELIDC_STATICÿÿIDC_RTC_D8IDC_RTC_D4IDC_RTC_D2IDC_RTC_D1IDC_RTC_E8IDC_RTC_E4IDC_RTC_E2IDC_RTC_E1IDC_RTC_F8IDC_RTC_F4 IDC_RTC_F2 +IDC_RTC_F1 IDC_STATICÿÿIDC_STATICÿÿIDC_STATICÿÿIDC_DAY IDC_YEAR IDC_LBLDAYIDC_MONTHIDC_HOURIDC_MINUTEIDC_SECONDIDC_LBLMONTHIDC_LBLYEARIDC_STATICÿÿIDC_STATICÿÿIDC_STATICÿÿIDC_STATICÿÿIDC_STATICÿÿIDC_STATICÿÿIDC_LBLHOURIDC_LBLMINUTEIDC_LBLSECOND$ÿÿ5104IDD_ROM_INFOc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rcÝIDOKIDC_ROM_DATAIDC_WARNINGS$ÿÿ5105IDD_ABOUTc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rcèIDOKIDC_DISCLAIMER$ÿÿ5106IDD_EMU_SETTINGSc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rcóIDC_FREEZE_FOLDERIDC_BROWSEIDC_AUTO_SAVE_DELAY!IDC_SRAM_SPIN%IDC_MAX_SKIP"IDC_SPIN_MAX_SKIP&IDC_TURBO_SKIP#IDC_SPIN_TURBO_SKIP'IDC_TOGGLE_TURBO$IDOKIDCANCELIDC_LABEL_FREEZE™IDC_LABEL_ASRAMšIDC_LABEL_SMAX›IDC_LABEL_STURBOœIDC_LABEL_ASRAM_TEXTIDC_LABEL_SMAX_TEXTžIDC_LABEL_STURBO_TEXTŸIDC_INACTIVE_PAUSE($ÿÿ5107IDD_OPEN_ROMc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rcIDC_ROM_DIR(IDC_ROMLIST,IDC_MEM_TYPE-IDC_INTERLEAVE)IDC_VIDEO_MODE*IDC_HEADER+IDOKIDCANCELIDC_STATICÿÿIDC_STATICÿÿIDC_STATICÿÿIDC_STATICÿÿ$ÿÿ5108IDD_GFX_PACKc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rc8IDC_STAR_OCEAN.IDC_STATICÿÿIDC_SO_BROWSE/IDC_FEOEZ0IDC_STATICÿÿIDC_FEOEZ_BROWSE1IDC_MDH2IDC_STATICÿÿIDC_MDH_BROWSE3IDC_SPL44IDC_STATICÿÿIDC_SPL4_BROWSE5IDC_SJNS6IDC_STATICÿÿIDC_FEOEZ_SJNS_BROWSE7IDC_SFA28IDC_STATICÿÿIDC_SFA2_BROWSE9IDC_SFA2E:IDC_STATICÿÿIDC_SFA2E_BROWSE;IDC_SFZ2<IDC_STATICÿÿIDC_SFZ2_BROWSE=IDOKIDCANCEL$ÿÿ5110IDD_NPOPTIONSc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rc[IDC_PORTNUMBLOCK IDC_LABEL_PORTNUM£IDC_PORTNUMBERAKIDC_CLIENTSETTINGSBLOCK¡IDC_LABEL_PAUSEINTERVAL¤IDC_PAUSEINTERVALCIDC_PAUSESPINEIDC_LABEL_PAUSEINTERVAL_TEXT¥IDC_LABEL_MAXSKIP¦IDC_MAXSKIPDIDC_MAXSPINIIDC_SERVERSETTINGSBLOCK¢IDC_SENDROMGIDC_ACTASSERVERHIDOKIDCANCELIDC_SYNCBYRESETF$ÿÿ5123IDD_NEWDISPLAYc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rcƒIDOKIDCANCELIDC_TESTMODELIDC_SETDMODEOIDC_VIDMODELISTNIDC_STATICÿÿIDC_SHOWFPSTIDC_STRETCHUIDC_FULLSCREENVIDC_BILINEARMD7WIDC_STATICÿÿIDC_RENDER16BITXIDC_TRANSYIDC_HIRESZIDC_STATICÿÿIDC_FILTERBOX\IDC_AUTOFRAME]IDC_LIMITFRAMES^IDC_STATICÿÿIDC_FRAMERATESKIPSLIDER`IDC_STATICÿÿIDC_DBLBUFFERbIDC_CURRMODEcIDC_STATICÿÿIDC_STATICÿÿIDC_HEIGHT_EXTEND®IDC_VIDEOCARDdIDC_ASPECT¯$ÿÿ5111IDD_CHEATERc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rcºIDC_CHEAT_LISTkIDC_ADD_CHEATjIDC_DELETE_CHEATdIDC_UPDATE_CHEATeIDC_CLEAR_CHEATSfIDC_CHEAT_CODE[IDC_CHEAT_DESCRIPTIONgIDC_CHEAT_ADDRESShIDC_CHEAT_BYTEiIDOKIDCANCELIDC_LABEL_CHEAT_CODE§IDC_LABEL_CHEAT_DESCRIPTION¨IDC_LABEL_CHEAT_ADDRESS©IDC_LABEL_CHEAT_BYTEª$ÿÿ5124IDD_NETPLAYPROGRESSc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rcÛIDC_STATICÿÿIDC_NPPROGRESSd$ÿÿ5125IDD_INPUTCONFIGc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rcåIDC_JPCOMBOeIDC_JPTOGGLEfIDC_UPBIDC_LEFTHIDC_DOWNFIDC_RIGHTRIDC_BOIDC_APIDC_YNIDC_XQIDC_STARTKIDC_SELECTJIDC_LLIDC_RMIDC_UPLEFTIIDC_UPRIGHTCIDC_DWNRIGHTEIDC_DWNLEFTGIDCANCELIDOKIDC_LABEL_BLUEpIDC_LABEL_UP‰IDC_LABEL_RIGHTŒIDC_LABEL_LEFTŠIDC_LABEL_DOWN‹IDC_LABEL_AŽIDC_LABEL_XIDC_LABEL_BIDC_LABEL_YIDC_LABEL_L“IDC_LABEL_START‘IDC_LABEL_R”IDC_LABEL_SELECT’IDC_LABEL_UPLEFT•IDC_LABEL_DOWNRIGHT—IDC_LABEL_UPRIGHT–IDC_LABEL_DOWNLEFT˜lIDC_STATICÿÿIDC_ALLOWLEFTRIGHTgIDC_TOGLh$ÿÿ5129IDD_CHEAT_SEARCHc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rc*IDOKIDCANCELIDC_ADDYSmIDC_C_SEARCHnIDC_C_ADDoIDC_C_RESETpIDC_1_BYTEqIDC_2_BYTErIDC_3_BYTEsIDC_4_BYTEtIDC_STATICÿÿIDC_STATICÿÿIDC_LESS_THANuIDC_GREATER_THANvIDC_LESS_THAN_EQUALwIDC_GREATER_THAN_EQUALxIDC_EQUALyIDC_NOT_EQUALzIDC_STATICÿÿIDC_STATICÿÿIDC_PREV{IDC_ENTERED|IDC_UNSIGNED}IDC_SIGNED~IDC_HEXIDC_VALUE_ENTERBIDC_ENTER_LABEL€$ÿÿ5130IDD_DIALOG1c:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rcbIDOKIDCANCELIDC_COMBO1ƒ$ÿÿ5131IDD_CHEAT_FROM_SEARCHc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rcmIDOKIDCANCELIDC_NC_ADDRESS„IDC_NC_CURRVAL…IDC_NC_PREVVAL†IDC_NC_NEWVAL‡IDC_NC_DESCˆIDC_STATICÿÿIDC_STATICÿÿIDC_STATICÿÿIDC_STATICÿÿIDC_STATICÿÿ$ÿÿ5134IDD_OPENMOVIEc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rc‚IDOKIDCANCELIDC_MOVIE_PATH¸IDC_STATICÿÿIDC_BROWSE_MOVIE¹IDC_STATICÿÿIDC_STATICÿÿIDC_STATICÿÿIDC_STATICÿÿIDC_MOVIE_DATEºIDC_MOVIE_LENGTH»IDC_MOVIE_FRAMES¼IDC_MOVIE_RERECORD½IDC_STATICÿÿIDC_READONLYÂIDC_MOVIE_METADATABIDC_STATICÿÿIDC_RECORD_NOW±IDC_RECORD_RESET²IDC_JOY1³IDC_JOY3µIDC_JOY2´IDC_JOY4¶IDC_JOY5·IDC_STATICÿÿIDC_WIP1ûIDC_ENVXòIDC_FMUTúIDC_STATICÿÿIDC_ALLOWLEFTRIGHTgIDC_STATICÿÿIDC_SYNC_TO_SOUND_CPUñIDC_LOADEDFROMMOVIE¿IDC_MOVIEROMINFOÀIDC_CURRENTROMINFOÁ$ÿÿ5135IDD_CREATEMOVIEc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rc¿IDOKIDCANCELIDC_MOVIE_PATH¸IDC_STATICÿÿIDC_BROWSE_MOVIE¹IDC_STATICÿÿIDC_RECORD_NOW±IDC_RECORD_RESET²IDC_JOY1³IDC_JOY3µIDC_JOY2´IDC_JOY4¶IDC_JOY5·IDC_STATICÿÿIDC_MOVIE_METADATABIDC_STATICÿÿIDC_WIP1ûIDC_ENVXòIDC_STATICÿÿIDC_ALLOWLEFTRIGHTgIDC_FMUTúIDC_SYNC_TO_SOUND_CPUñ$ÿÿ5136IDD_KEYCUSTOMc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rcèIDCANCELIDOKIDC_LABEL_UP‰IDC_LABEL_RIGHTŒIDC_LABEL_LEFTŠIDC_LABEL_DOWN‹IDC_LABEL_BIDC_LABEL_L“IDC_LABEL_START‘IDC_LABEL_R”IDC_LABEL_SELECT’IDC_LABEL_AŽIDC_SPEEDUP´IDC_SPEEDDOWN¯IDC_PAUSE°IDC_FRAMEADVANCE±IDC_SKIPUP²IDC_SKIPDOWN³IDC_SCOPETURBOµIDC_SCOPEPAUSE¶IDC_FRAMECOUNT·IDC_READONLYÂIDC_SAVE1¸IDC_LABEL_UP2IDC_SAVE2¹IDC_LABEL_UP3žIDC_SAVE3ºIDC_LABEL_UP4ŸIDC_SAVE4»IDC_LABEL_UP5 IDC_SAVE5¼IDC_LABEL_UP6¡IDC_SAVE6½IDC_LABEL_UP7¢IDC_SAVE7¾IDC_LABEL_UP8£IDC_SAVE8¿IDC_LABEL_UP9¤IDC_SAVE9ÀIDC_LABEL_UP10¥IDC_SAVE10ÁIDC_LABEL_UP11¦IDC_SAVE11ÃIDC_LABEL_UP12§IDC_SAVE12ÄIDC_LABEL_UP13¨IDC_SAVE13ÅIDC_LABEL_UP14©IDC_SAVE14ÆIDC_LABEL_UP15ªIDC_SAVE15ÇIDC_LABEL_UP16«IDC_SAVE16ÈIDC_LABEL_UP17¬IDC_SAVE17ÉIDC_LABEL_UP18­IDC_SAVE18ÊIDC_LABEL_UP19®IDC_SAVE19ËIDC_LABEL_UP20ÍIDC_SAVE20ÌIDC_LABEL_UP21ÎIDC_LABEL_RIGHT2IDC_FASTFORWARDÏIDC_LABEL_R2•IDC_SHOWPRESSEDÐ$ÿÿ240102IDD_SOUND_OPTSc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rcX$ÿÿ240125IDD_INPUTCONFIGc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rc¯$ÿÿDESIGNINFOGUIDELINES$ÿÿ14101IDI_ICON1c:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rca$ÿÿ2111IDB_OPENFOLDERc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rch$ÿÿ2112IDB_CLOSEDFOLDERc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rci$ÿÿ2113IDB_CDDRIVEc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rcj$ÿÿ2114IDB_NETDRIVEc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rck$ÿÿ2115IDB_HARDDRIVEc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rcl$ÿÿ2133IDB_PADc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rcm$ÿÿ241IDR_RT_MANIFEST2c:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rct$ÿÿ161VS_VERSION_INFOc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rc‡$ÿÿTEXTINCLUDE1$ÿÿTEXTINCLUDE2$ÿÿTEXTINCLUDE3$ÿÿ4102IDR_MENU_NLc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rcÈID_FILE_OPENáID_FILE_EXITAœID_OPTIONS_JOYPADVœID_SOUND_8BIT8000HZMONOEœID_SOUND_8BIT8000HZSTEREOMœID_SOUND_8BIT11025HZMONOFœID_SOUND_8BIT11025HZSTEREONœID_SOUND_8BIT22050HZMONOGœID_SOUND_8BIT22050HZSTEREOOœID_SOUND_8BIT44100HZMONOHœID_SOUND_8BIT44100HZSTEREOPœID_SOUND_16BIT8000HZMONOIœID_SOUND_16BIT8000HZSTEREOQœID_SOUND_16BIT11025HZMONOJœID_SOUND_16BIT11025HZSTEREORœID_SOUND_16BIT22050HZMONOKœID_SOUND_16BIT22050HZSTEREOSœID_SOUND_16BIT44100HZMONOLœID_SOUND_16BIT44100HZSTEREOTœID_SOUND_NOSOUNDUœID_LANGUAGE_ENGLISHBœID_LANGUAGE_NEDERLANDSCœID_WINDOW_HIDEMENUBARDœ$ÿÿ5109IDD_NETCONNECTc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rcIDOKIDCANCELIDC_LABEL_SERVERADDY«IDC_CLEARHISTORY@IDC_LABEL_PORTNUM£IDC_PORTNUMBER?IDC_HOSTNAME>$ÿÿ4101IDR_MENU_USc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x.rc1ID_FILE_OPENáID_RECENT_DUMMYšœID_FILE_SAVE1mœID_FILE_SAVE2nœID_FILE_SAVE3oœID_FILE_SAVE4pœID_FILE_SAVE5qœID_FILE_SAVE6rœID_FILE_SAVE7sœID_FILE_SAVE8tœID_FILE_SAVE9uœID_FILE_LOAD1vœID_FILE_LOAD2wœID_FILE_LOAD3xœID_FILE_LOAD4yœID_FILE_LOAD5zœID_FILE_LOAD6{œID_FILE_LOAD7|œID_FILE_LOAD8}œID_FILE_LOAD9~œID_FILE_SAVE_SPC_DATA‚œID_FILE_SAVE_SRAM_DATA™œIDM_LOG_7110›œIDM_ROM_INFOžœID_FILE_MOVIE_PLAY±œID_FILE_MOVIE_RECORD³œID_FILE_MOVIE_STOP²œID_FILE_WRITE_AVI´œID_FILE_STOP_AVIµœID_FILE_RESETYœID_FILE_PAUSEZœID_FILE_EXITAœID_OPTIONS_DISPLAYXœID_OPTIONS_SETTINGS†œIDM_7110_CACHEœIDM_GFX_PACKS¬œVœID_OPTIONS_KEYCUSTOM¶œIDM_ENABLE_MULTITAP¨œIDM_MOUSE_TOGGLE©œIDM_SCOPE_TOGGLEªœIDM_JUSTIFIER­œID_SOUND_NOSOUNDUœID_SOUND_8000HZaœID_SOUND_11025HZbœID_SOUND_16000HZ–œID_SOUND_22050HZcœID_SOUND_30000HZeœID_SOUND_32000HZŸœID_SOUND_35000HZ—œID_SOUND_44100HZdœID_SOUND_48000HZ•œID_SOUND_25MSkœID_SOUND_50MSfœID_SOUND_100MSgœID_SOUND_200MShœID_SOUND_500MSiœID_SOUND_1SjœID_SOUND_2SlœID_SOUND_16BIT^œID_SOUND_STEREO_œID_SOUND_REVERSE_STEREO˜œIDM_CATCH_UP_SOUND«œID_SOUND_INTERPOLATED[œID_SOUND_SYNC\œID_SOUND_OPTIONS„œID_LANGUAGE_ENGLISHBœID_LANGUAGE_NEDERLANDSCœID_WINDOW_HIDEMENUBARDœID_WINDOW_FULLSCREEN]œID_WINDOW_STRETCH`œID_CHEAT_ENTERœID_CHEAT_SEARCH€œID_CHEAT_APPLYœIDM_7110_RTCœœID_NETPLAY_CONNECTŽœID_NETPLAY_DISCONNECTœID_NETPLAY_SERVERœID_NETPLAY_SYNC’œID_NETPLAY_ROM‘œID_NETPLAY_SEND_ROM_ON_CONNECT“œID_NETPLAY_SYNC_BY_RESET”œID_NETPLAY_OPTIONSœID_HELP_ABOUTƒœ$ÿÿ$ÿÿ7$HWBÿÿ/0 c:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\resource.hc:\Program Files\Visual Studio\Vc7\atlmfc\include/afxres.hc:\Program Files\Visual Studio\Vc7\atlmfc\include/winres.hc:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\language.h$HWBÿÿ-0 12101IDC_CURSOR_SCOPE9103IDR_SNES9X_ACCELERATORS5102IDD_SOUND_OPTS5101IDD_SPC7110_CACHE5103IDD_7110_RTC5104IDD_ROM_INFO5105IDD_ABOUT5106IDD_EMU_SETTINGS5107IDD_OPEN_ROM5108IDD_GFX_PACK5110IDD_NPOPTIONS5123IDD_NEWDISPLAY5111IDD_CHEATER5124IDD_NETPLAYPROGRESS5125IDD_INPUTCONFIG5129IDD_CHEAT_SEARCH5130IDD_DIALOG15131IDD_CHEAT_FROM_SEARCH5134IDD_OPENMOVIE5135IDD_CREATEMOVIE5136IDD_KEYCUSTOM5109IDD_NETCONNECT240102IDD_SOUND_OPTS240125IDD_INPUTCONFIGDESIGNINFOGUIDELINES14101IDI_ICON12111IDB_OPENFOLDER2112IDB_CLOSEDFOLDER2113IDB_CDDRIVE2114IDB_NETDRIVE2115IDB_HARDDRIVE2133IDB_PAD241IDR_RT_MANIFEST2161VS_VERSION_INFOTEXTINCLUDE1TEXTINCLUDE2TEXTINCLUDE34102IDR_MENU_NL4101IDR_MENU_USm$HWBÿÿ.0 ²ID_SEPARATOR0IDOK1  +   IDR_RT_MANIFEST21!VS_VERSION_INFO1"IDCANCEL2  +   IDABORT3IDRETRY4IDIGNORE5IDYES6IDNO7IDCLOSE8IDHELP9AFX_IDC_LISTBOX100IDR_MENU_US101'IDC_CURSOR_SCOPE101IDD_SPC7110_CACHE101IDI_ICON1101AFX_IDC_CHANGE101_APS_NEXT_SYMED_VALUE101IDR_MENU_NL102&IDC_CURSOR_BLANK102IDD_SOUND_OPTS102AFX_IDC_BROWSER102IDR_SNES9X_ACCELERATORS103IDD_7110_RTC103IDD_ROM_INFO104IDD_ABOUT105IDD_EMU_SETTINGS106IDD_OPEN_ROM107 IDD_GFX_PACK108 +IDD_NETCONNECT109IDD_NPOPTIONS110 IDB_OPENFOLDER111IDD_CHEATER111 IDB_CLOSEDFOLDER112IDB_CDDRIVE113IDB_NETDRIVE114IDB_HARDDRIVE115IDD_NEWDISPLAY123 IDD_NETPLAYPROGRESS124IDD_INPUTCONFIG125IDB_JOYPAD127IDD_CHEAT_SEARCH129IDD_DIALOG1130IDD_CHEAT_FROM_SEARCH131IDB_PAD133 IDD_OPENMOVIE134IDD_CREATEMOVIE135IDD_KEYCUSTOM136_APS_NEXT_RESOURCE_VALUE141AFX_IDC_PRINT_DOCNAME201AFX_IDC_PRINT_PRINTERNAME202AFX_IDC_PRINT_PORTNAME203AFX_IDC_PRINT_PAGENUM204AFX_IDC_FONTPROP1000IDC_DRIVER1001AFX_IDC_FONTNAMES1001IDC_BUFLEN1002AFX_IDC_FONTSTYLES1002IDC_RATE1003AFX_IDC_FONTSIZES1003IDC_MIX1004AFX_IDC_STRIKEOUT1004IDC_16BIT1005AFX_IDC_UNDERLINE1005IDC_STEREO1006AFX_IDC_SAMPLEBOX1006IDC_REV_STEREO1007IDC_LINEAR_INTER1008IDC_SYNC_TO_SOUND_CPU1009IDC_ENVX1010IDC_ECHO1011IDC_CLEARSRAM1011IDC_CACHING1012IDC_MASTER_VOL1013IDC_SPC700ON1014IDC_ANTIRES1015IDC_MUTE1016IDC_SKIP_TYPE1017IDC_SCROLLBAR11018IDC_FMUT1018IDC_VRAM_DISPLAY1019IDC_WIP11019IDC_ADDRESS1020IDC_FAMT1020IDC_SPC7110_ALL1021IDC_SPC7110_SOME1022IDC_SPC7110_FILE1023IDC_RTC_D81024IDC_RTC_D41025IDC_RTC_D21026IDC_RTC_D11027IDC_RTC_E81028IDC_RTC_E41029IDC_RTC_E21030IDC_RTC_E11031IDC_RTC_F81032IDC_RTC_F41033IDC_RTC_F21034IDC_RTC_F11035IDC_DAY1036IDC_YEAR1037IDC_MONTH1038IDC_HOUR1039IDC_MINUTE1040IDC_SECOND1041IDC_LBLMONTH1042IDC_LBLYEAR1043IDC_LBLDAY1044IDC_LBLHOUR1045IDC_LBLMINUTE1046IDC_LBLSECOND1047IDC_CACHE_MB1048IDC_SPIN_CACHE1049IDC_ROM_DATA1051IDC_WARNINGS1052IDC_DISCLAIMER1053IDC_FREEZE_FOLDER1054IDC_BROWSE1055IDC_CANCEL1056IDC_AUTO_SAVE_DELAY1057IDC_MAX_SKIP1058IDC_TURBO_SKIP1059IDC_TOGGLE_TURBO1060IDC_SRAM_SPIN1061IDC_SPIN_MAX_SKIP1062IDC_SPIN_TURBO_SKIP1063IDC_ROM_DIR1064 IDC_INACTIVE_PAUSE1064IDC_INTERLEAVE1065 IDC_VIDEO_MODE1066 IDC_HEADER1067 IDC_ROMLIST1068 IDC_MEM_TYPE1069 IDC_STAR_OCEAN1070 +IDC_SO_BROWSE1071 +IDC_FEOEZ1072 +IDC_FEOEZ_BROWSE1073 +IDC_MDH1074 +IDC_MDH_BROWSE1075 +IDC_SPL41076 +IDC_SPL4_BROWSE1077 +IDC_SJNS1078 +IDC_FEOEZ_SJNS_BROWSE1079 +IDC_SFA21080 +IDC_SFA2_BROWSE1081 +IDC_SFA2E1082 +IDC_SFA2E_BROWSE1083 +IDC_SFZ21084 +IDC_SFZ2_BROWSE1085 +IDC_HOSTNAME1086IDC_PORTNUMBER1087IDC_CLEARHISTORY1088IDC_STATIC21089IDC_EDIT11090IDC_UP1090IDC_VALUE_ENTER1090IDC_MOVIE_METADATA1090IDC_PAUSEINTERVAL1091 IDC_UPRIGHT1091IDC_MAXSKIP1092 IDC_PAUSESPIN1093 IDC_DWNRIGHT1093IDC_SYNCBYRESET1094 IDC_DOWN1094IDC_SENDROM1095 IDC_DWNLEFT1095IDC_ACTASSERVER1096 IDC_LEFT1096IDC_MAXSPIN1097 IDC_UPLEFT1097IDC_SELECT1098IDC_PORTNUMBERA1099 IDC_START1099IDC_TESTMODE1100 IDC_L1100AFX_IDC_COLOR_BLACK1100IDC_VIDEOLIST1101IDC_R1101IDC_SELECT21101AFX_IDC_COLOR_WHITE1101IDC_VIDMODELIST1102 IDC_Y1102AFX_IDC_COLOR_RED1102IDC_SETDMODE1103 IDC_B1103AFX_IDC_COLOR_GREEN1103IDC_A1104AFX_IDC_COLOR_BLUE1104IDC_X1105AFX_IDC_COLOR_YELLOW1105IDC_RIGHT1106AFX_IDC_COLOR_MAGENTA1106AFX_IDC_COLOR_CYAN1107IDC_SHOWFPS1108 AFX_IDC_COLOR_GRAY1108IDC_STRETCH1109 AFX_IDC_COLOR_LIGHTGRAY1109IDC_FULLSCREEN1110 AFX_IDC_COLOR_DARKRED1110IDC_BILINEARMD71111 AFX_IDC_COLOR_DARKGREEN1111IDC_RENDER16BIT1112 AFX_IDC_COLOR_DARKBLUE1112IDC_TRANS1113 AFX_IDC_COLOR_LIGHTBROWN1113IDC_HIRES1114 AFX_IDC_COLOR_DARKMAGENTA1114IDC_CHEAT_CODE1115 AFX_IDC_COLOR_DARKCYAN1115IDC_FILTERBOX1116 AFX_IDC_COLORPROP1116IDC_AUTOFRAME1117 AFX_IDC_SYSTEMCOLORS1117IDC_LIMITFRAMES1118 IDC_FRAMERATESKIPSLIDER1120 IDC_TOGGLE1121IDC_DBLBUFFER1122 IDC_CURRMODE1123 IDC_DELETE_CHEAT1124 IDC_NPPROGRESS1124IDC_VIDEOCARD1124 IDC_UPDATE_CHEAT1125 IDC_JPCOMBO1125IDC_CLEAR_CHEATS1126 IDC_JPTOGGLE1126IDC_CHEAT_DESCRIPTION1127 IDC_KEYBOARD1127IDC_ALLOWLEFTRIGHT1127IDC_CHEAT_ADDRESS1128 IDC_TOGL1128IDC_CHEAT_BYTE1129 IDC_ADD_CHEAT1130 IDC_CHEAT_LIST1131 IDC_PICTURE1132IDC_ADDYS1133IDC_OK1134IDC_C_SEARCH1134IDC_RED1135IDC_C_ADD1135IDC_BLUE1136IDC_C_RESET1136IDC_LABEL_BLUE1136IDC_1_BYTE1137IDC_2_BYTE1138IDC_3_BYTE1139IDC_4_BYTE1140IDC_LESS_THAN1141IDC_GREATER_THAN1142IDC_LESS_THAN_EQUAL1143IDC_GREATER_THAN_EQUAL1144IDC_EQUAL1145IDC_NOT_EQUAL1146IDC_PREV1147IDC_ENTERED1148IDC_UNSIGNED1149IDC_SIGNED1150IDC_HEX1151IDC_ENTER_LABEL1152IDC_DIAGTOGGLE1153IDC_UNDO1154IDC_COMBO11155IDC_NC_ADDRESS1156IDC_NC_CURRVAL1157IDC_NC_PREVVAL1158IDC_NC_NEWVAL1159IDC_NC_DESC1160IDC_LABEL_UP1161IDC_LABEL_LEFT1162IDC_LABEL_DOWN1163IDC_LABEL_RIGHT1164IDC_LABEL_B1165IDC_LABEL_A1166IDC_LABEL_Y1167IDC_LABEL_RIGHT21167IDC_LABEL_X1168IDC_LABEL_START1169IDC_LABEL_SELECT1170IDC_LABEL_L1171IDC_LABEL_R1172IDC_LABEL_UPLEFT1173IDC_LABEL_R21173IDC_LABEL_UPRIGHT1174IDC_LABEL_R31174IDC_LABEL_DOWNRIGHT1175IDC_LABEL_DOWNLEFT1176IDC_LABEL_FREEZE1177IDC_LABEL_ASRAM1178IDC_LABEL_SMAX1179IDC_LABEL_STURBO1180IDC_LABEL_ASRAM_TEXT1181IDC_LABEL_UP21181IDC_LABEL_SMAX_TEXT1182IDC_LABEL_UP31182IDC_LABEL_STURBO_TEXT1183IDC_LABEL_UP41183IDC_PORTNUMBLOCK1184 IDC_LABEL_UP51184IDC_CLIENTSETTINGSBLOCK1185 IDC_LABEL_UP61185IDC_SERVERSETTINGSBLOCK1186 IDC_LABEL_UP71186IDC_LABEL_PORTNUM1187 IDC_LABEL_UP81187IDC_LABEL_PAUSEINTERVAL1188 IDC_LABEL_UP91188IDC_LABEL_PAUSEINTERVAL_TEXT1189 IDC_LABEL_UP101189IDC_LABEL_MAXSKIP1190 IDC_LABEL_UP111190IDC_LABEL_CHEAT_CODE1191 IDC_LABEL_UP121191IDC_LABEL_CHEAT_DESCRIPTION1192 IDC_LABEL_UP131192IDC_LABEL_CHEAT_ADDRESS1193 IDC_LABEL_UP141193IDC_LABEL_CHEAT_BYTE1194 IDC_LABEL_UP151194IDC_LABEL_SERVERADDY1195IDC_LABEL_UP161195IDC_LABEL_UP171196IDC_LABEL_UP181197IDC_HEIGHT_EXTEND1198 IDC_LABEL_UP191198IDC_SPEEDDOWN1199IDC_ASPECT1199 IDC_PAUSE1200IDC_RECORD_NOW1201IDC_FRAMEADVANCE1201AFX_IDC_PROPNAME1201IDC_RECORD_RESET1202IDC_SKIPUP1202AFX_IDC_PICTURE1202IDC_JOY11203IDC_SKIPDOWN1203AFX_IDC_BROWSE1203IDC_JOY21204IDC_SPEEDUP1204AFX_IDC_CLEAR1204IDC_JOY31205IDC_SCOPETURBO1205IDC_JOY41206IDC_SCOPEPAUSE1206IDC_JOY51207IDC_FRAMECOUNT1207IDC_MOVIE_PATH1208IDC_SAVE11208IDC_BROWSE_MOVIE1209IDC_SAVE21209IDC_MOVIE_DATE1210IDC_SAVE31210IDC_MOVIE_LENGTH1211IDC_SAVE41211IDC_MOVIE_FRAMES1212IDC_SAVE51212IDC_MOVIE_RERECORD1213IDC_SAVE61213IDC_SAVE71214IDC_SAVE81215IDC_LOADEDFROMMOVIE1215IDC_SAVE91216IDC_MOVIEROMINFO1216_APS_NEXT_CONTROL_VALUE1216IDC_SAVE101217IDC_CURRENTROMINFO1217IDC_READONLY1218IDC_SAVE111219IDC_DISPLAY_INPUT1220IDC_SAVE121220IDC_SAVE131221IDC_SAVE141222IDC_SAVE151223IDC_SAVE161224IDC_SAVE171225IDC_SAVE181226IDC_SAVE191227IDC_SAVE201228IDC_LABEL_UP201229IDC_LABEL_UP211230IDC_FASTFORWARD1231IDC_SHOWPRESSED1232IDC_SCREENSHOT1233IDC_LABEL_UP221234IDC_SLOTMINUS1235IDC_LABEL_UP231236IDC_SLOTPLUS1237IDC_LABEL_UP241238IDC_SLOTSAVE1239IDC_LABEL_UP251240IDC_SLOTLOAD1241AFX_IDC_TAB_CONTROL0x3020ID_APPLY_NOW0x3021ID_WIZBACK0x3023ID_WIZNEXT0x3024ID_WIZFINISH0x3025AFX_IDD_NEWTYPEDLG30721AFX_IDD_PRINTDLG30722AFX_IDD_PREVIEW_TOOLBAR30723AFX_IDD_INSERTOBJECT30724AFX_IDD_CHANGEICON30725AFX_IDD_CONVERT30726AFX_IDD_PASTESPECIAL30727AFX_IDD_EDITLINKS30728AFX_IDD_FILEBROWSE30729AFX_IDD_BUSY30730AFX_IDD_OBJECTPROPERTIES30732AFX_IDD_CHANGESOURCE30733AFX_IDC_CONTEXTHELP30977AFX_IDC_MAGNIFY30978AFX_IDC_SMALLARROWS30979AFX_IDC_HSPLITBAR30980AFX_IDC_VSPLITBAR30981AFX_IDC_NODROPCRSR30982AFX_IDC_TRACKNWSE30983AFX_IDC_TRACKNESW30984AFX_IDC_TRACKNS30985AFX_IDC_TRACKWE30986AFX_IDC_TRACK4WAY30987AFX_IDC_MOVE4WAY30988AFX_IDB_MINIFRAME_MENU30994AFX_IDB_CHECKLISTBOX_9530996AFX_IDR_PREVIEW_ACCEL30997AFX_IDC_MOUSE_PAN_NW30998AFX_IDC_MOUSE_PAN_N30999AFX_IDC_MOUSE_PAN_NE31000AFX_IDC_MOUSE_PAN_W31001AFX_IDC_MOUSE_PAN_HV31002AFX_IDC_MOUSE_PAN_E31003AFX_IDC_MOUSE_PAN_SW31004AFX_IDC_MOUSE_PAN_S31005AFX_IDC_MOUSE_PAN_SE31006AFX_IDC_MOUSE_PAN_HORZ31007AFX_IDC_MOUSE_PAN_VERT31008AFX_IDC_MOUSE_ORG_HORZ31009AFX_IDC_MOUSE_ORG_VERT31010AFX_IDC_MOUSE_ORG_HV31011AFX_IDC_MOUSE_MASK31012AFX_IDI_STD_MDIFRAME31233AFX_IDI_STD_FRAME31234AFX_IDD_PROPPAGE_COLOR32257AFX_IDD_PROPPAGE_FONT32258AFX_IDD_PROPPAGE_PICTURE32259AFX_IDB_TRUETYPE32384ID_FILE_EXIT40001&'ID_LANGUAGE_ENGLISH40002&'ID_LANGUAGE_NEDERLANDS40003&'ID_WINDOW_HIDEMENUBAR40004&'ID_SOUND_8BIT8000HZMONO40005&ID_SOUND_8BIT11025HZMONO40006&ID_SOUND_8BIT22050HZMONO40007&ID_SOUND_8BIT44100HZMONO40008&ID_SOUND_16BIT8000HZMONO40009&ID_SOUND_16BIT11025HZMONO40010&ID_SOUND_16BIT22050HZMONO40011&ID_SOUND_16BIT44100HZMONO40012&ID_SOUND_8BIT8000HZSTEREO40013&ID_SOUND_8BIT11025HZSTEREO40014&ID_SOUND_8BIT22050HZSTEREO40015&ID_SOUND_8BIT44100HZSTEREO40016&ID_SOUND_16BIT8000HZSTEREO40017&ID_SOUND_16BIT11025HZSTEREO40018&ID_SOUND_16BIT22050HZSTEREO40019&ID_SOUND_16BIT44100HZSTEREO40020&ID_SOUND_NOSOUND40021&'ID_OPTIONS_JOYPAD40022&ID_WINDOW_SHOWFPS40023ID_OPTIONS_DISPLAY40024'ID_FILE_RESET40025'ID_FILE_PAUSE40026'ID_SOUND_INTERPOLATED40027'ID_SOUND_SYNC40028'ID_WINDOW_FULLSCREEN40029'ID_SOUND_16BIT40030'ID_SOUND_STEREO40031'ID_WINDOW_STRETCH40032'ID_SOUND_8000HZ40033'ID_SOUND_11025HZ40034'ID_SOUND_22050HZ40035'ID_SOUND_44100HZ40036'ID_SOUND_30000HZ40037'ID_SOUND_50MS40038'ID_SOUND_100MS40039'ID_SOUND_200MS40040'ID_SOUND_500MS40041'ID_SOUND_1S40042'ID_SOUND_25MS40043'ID_SOUND_2S40044'ID_FILE_SAVE140045'ID_FILE_SAVE240046'ID_FILE_SAVE340047'ID_FILE_SAVE440048'ID_FILE_SAVE540049'ID_FILE_SAVE640050'ID_FILE_SAVE740051'ID_FILE_SAVE840052'ID_FILE_SAVE940053'ID_FILE_LOAD140054'ID_FILE_LOAD240055'ID_FILE_LOAD340056'ID_FILE_LOAD440057'ID_FILE_LOAD540058'ID_FILE_LOAD640059'ID_FILE_LOAD740060'ID_FILE_LOAD840061'ID_FILE_LOAD940062'ID_CHEAT_ENTER40063'ID_CHEAT_SEARCH40064'ID_CHEAT_APPLY40065'ID_FILE_SAVE_SPC_DATA40066'ID_HELP_ABOUT40067'ID_SOUND_OPTIONS40068'ID_OPTIONS_EMULATION40069ID_OPTIONS_SETTINGS40070'ID_DEBUG_TRACE40071ID_DEBUG_TRACE_SPC40072ID_DEBUG_TRACE_SA140073ID_DEBUG_TRACE_DSP140074ID_DEBUG_FRAME_ADVANCE40075ID_DEBUG_SNES_STATUS40076ID_NETPLAY_SERVER40077'ID_NETPLAY_CONNECT40078'ID_NETPLAY_DISCONNECT40079'ID_NETPLAY_OPTIONS40080'ID_NETPLAY_ROM40081'ID_NETPLAY_SYNC40082'ID_NETPLAY_SEND_ROM_ON_CONNECT40083'ID_NETPLAY_SYNC_BY_RESET40084'ID_SOUND_48000HZ40085'ID_SOUND_16000HZ40086'ID_SOUND_35000HZ40087'ID_SOUND_REVERSE_STEREO40088'ID_FILE_SAVE_SRAM_DATA40089'ID_RECENT_DUMMY40090'IDM_LOG_711040091'IDM_7110_RTC40092'IDM_7110_CACHE40093'IDM_ROM_INFO40094'ID_SOUND_32000HZ40095'ID_TURBO_START40096ID_TURBO_SELECT40097ID_TURBO_L40098ID_TURBO_R40099ID_TURBO_Y40100ID_TURBO_X40101ID_TURBO_B40102ID_TURBO_A40103IDM_ENABLE_MULTITAP40104'IDM_MOUSE_TOGGLE40105'IDM_SCOPE_TOGGLE40106'IDM_CATCH_UP_SOUND40107'IDM_GFX_PACKS40108'IDM_JUSTIFIER40109'ID_SCREENSHOT40110ID_FILE_MOVIE_PLAY40113'ID_FILE_MOVIE_STOP40114'ID_FILE_MOVIE_RECORD40115'ID_FILE_MOVIE_ENABLERECORDING40116ID_FILE_WRITE_AVI40116'ID_FILE_STOP_AVI40117'ID_OPTIONS_KEYCUSTOM40118'_APS_NEXT_COMMAND_VALUE40119AFX_IDS_APP_TITLE0xE000AFX_IDS_IDLEMESSAGE0xE001AFX_IDS_HELPMODEMESSAGE0xE002AFX_IDS_APP_TITLE_EMBEDDING0xE003AFX_IDS_COMPANY_NAME0xE004AFX_IDS_OBJ_TITLE_INPLACE0xE005ID_FILE_NEW0xE100ID_FILE_OPEN0xE101&'ID_FILE_CLOSE0xE102ID_FILE_SAVE0xE103ID_FILE_SAVE_AS0xE104ID_FILE_PAGE_SETUP0xE105ID_FILE_PRINT_SETUP0xE106ID_FILE_PRINT0xE107ID_FILE_PRINT_DIRECT0xE108ID_FILE_PRINT_PREVIEW0xE109ID_FILE_UPDATE0xE10AID_FILE_SAVE_COPY_AS0xE10BID_FILE_SEND_MAIL0xE10CID_FILE_NEW_FRAME0xE10DID_FILE_MRU_FIRST0xE110ID_FILE_MRU_FILE10xE110ID_FILE_MRU_FILE20xE111ID_FILE_MRU_FILE30xE112ID_FILE_MRU_FILE40xE113ID_FILE_MRU_FILE50xE114ID_FILE_MRU_FILE60xE115ID_FILE_MRU_FILE70xE116ID_FILE_MRU_FILE80xE117ID_FILE_MRU_FILE90xE118ID_FILE_MRU_FILE100xE119ID_FILE_MRU_FILE110xE11AID_FILE_MRU_FILE120xE11BID_FILE_MRU_FILE130xE11CID_FILE_MRU_FILE140xE11DID_FILE_MRU_FILE150xE11EID_FILE_MRU_FILE160xE11FID_FILE_MRU_LAST0xE11FID_EDIT_CLEAR0xE120ID_EDIT_CLEAR_ALL0xE121ID_EDIT_COPY0xE122ID_EDIT_CUT0xE123ID_EDIT_FIND0xE124ID_EDIT_PASTE0xE125ID_EDIT_PASTE_LINK0xE126ID_EDIT_PASTE_SPECIAL0xE127ID_EDIT_REPEAT0xE128ID_EDIT_REPLACE0xE129ID_EDIT_SELECT_ALL0xE12AID_EDIT_UNDO0xE12BID_EDIT_REDO0xE12CID_WINDOW_NEW0xE130ID_WINDOW_ARRANGE0xE131ID_WINDOW_CASCADE0xE132ID_WINDOW_TILE_HORZ0xE133ID_WINDOW_TILE_VERT0xE134ID_WINDOW_SPLIT0xE135ID_APP_ABOUT0xE140ID_APP_EXIT0xE141ID_HELP_INDEX0xE142ID_HELP_FINDER0xE143ID_HELP_USING0xE144ID_CONTEXT_HELP0xE145ID_HELP0xE146ID_DEFAULT_HELP0xE147ID_NEXT_PANE0xE150ID_PREV_PANE0xE151ID_FORMAT_FONT0xE160ID_OLE_INSERT_NEW0xE200ID_OLE_EDIT_LINKS0xE201ID_OLE_EDIT_CONVERT0xE202ID_OLE_EDIT_CHANGE_ICON0xE203ID_OLE_EDIT_PROPERTIES0xE204ID_OLE_VERB_FIRST0xE210AFX_ID_PREVIEW_CLOSE0xE300AFX_ID_PREVIEW_NUMPAGE0xE301AFX_ID_PREVIEW_NEXT0xE302AFX_ID_PREVIEW_PREV0xE303AFX_ID_PREVIEW_PRINT0xE304AFX_ID_PREVIEW_ZOOMIN0xE305AFX_ID_PREVIEW_ZOOMOUT0xE306ID_INDICATOR_EXT0xE700ID_INDICATOR_CAPS0xE701ID_INDICATOR_NUM0xE702ID_INDICATOR_SCRL0xE703ID_INDICATOR_OVR0xE704ID_INDICATOR_REC0xE705ID_INDICATOR_KANA0xE706ID_VIEW_TOOLBAR0xE800ID_VIEW_STATUS_BAR0xE801ID_VIEW_REBAR0xE804ID_VIEW_AUTOARRANGE0xE805ID_VIEW_SMALLICON0xE810ID_VIEW_LARGEICON0xE811ID_VIEW_LIST0xE812ID_VIEW_DETAILS0xE813ID_VIEW_LINEUP0xE814ID_VIEW_BYNAME0xE815ID_RECORD_FIRST0xE900ID_RECORD_LAST0xE901ID_RECORD_NEXT0xE902ID_RECORD_PREV0xE903AFX_IDS_SCSIZE0xEF00AFX_IDS_SCMOVE0xEF01AFX_IDS_SCMINIMIZE0xEF02AFX_IDS_SCMAXIMIZE0xEF03AFX_IDS_SCNEXTWINDOW0xEF04AFX_IDS_SCPREVWINDOW0xEF05AFX_IDS_SCCLOSE0xEF06AFX_IDS_SCRESTORE0xEF12AFX_IDS_SCTASKLIST0xEF13AFX_IDS_MDICHILD0xEF1FAFX_IDS_DESKACCESSORY0xEFDAAFX_IDS_OPENFILE0xF000AFX_IDS_SAVEFILE0xF001AFX_IDS_ALLFILTER0xF002AFX_IDS_UNTITLED0xF003AFX_IDS_SAVEFILECOPY0xF004AFX_IDS_PREVIEW_CLOSE0xF005AFX_IDS_UNNAMED_FILE0xF006AFX_IDS_HIDE0xF011AFX_IDP_NO_ERROR_AVAILABLE0xF020AFX_IDS_NOT_SUPPORTED_EXCEPTION0xF021AFX_IDS_RESOURCE_EXCEPTION0xF022AFX_IDS_MEMORY_EXCEPTION0xF023AFX_IDS_USER_EXCEPTION0xF024AFX_IDS_INVALID_ARG_EXCEPTION0xF025AFX_IDS_PRINTONPORT0xF040AFX_IDS_ONEPAGE0xF041AFX_IDS_TWOPAGE0xF042AFX_IDS_PRINTPAGENUM0xF043AFX_IDS_PREVIEWPAGEDESC0xF044AFX_IDS_PRINTDEFAULTEXT0xF045AFX_IDS_PRINTDEFAULT0xF046AFX_IDS_PRINTFILTER0xF047AFX_IDS_PRINTCAPTION0xF048AFX_IDS_PRINTTOFILE0xF049AFX_IDS_OBJECT_MENUITEM0xF080AFX_IDS_EDIT_VERB0xF081AFX_IDS_ACTIVATE_VERB0xF082AFX_IDS_CHANGE_LINK0xF083AFX_IDS_AUTO0xF084AFX_IDS_MANUAL0xF085AFX_IDS_FROZEN0xF086AFX_IDS_ALL_FILES0xF087AFX_IDS_SAVE_MENU0xF088AFX_IDS_UPDATE_MENU0xF089AFX_IDS_SAVE_AS_MENU0xF08AAFX_IDS_SAVE_COPY_AS_MENU0xF08BAFX_IDS_EXIT_MENU0xF08CAFX_IDS_UPDATING_ITEMS0xF08DAFX_IDS_METAFILE_FORMAT0xF08EAFX_IDS_DIB_FORMAT0xF08FAFX_IDS_BITMAP_FORMAT0xF090AFX_IDS_LINKSOURCE_FORMAT0xF091AFX_IDS_EMBED_FORMAT0xF092AFX_IDS_PASTELINKEDTYPE0xF094AFX_IDS_UNKNOWNTYPE0xF095AFX_IDS_RTF_FORMAT0xF096AFX_IDS_TEXT_FORMAT0xF097AFX_IDS_INVALID_CURRENCY0xF098AFX_IDS_INVALID_DATETIME0xF099AFX_IDS_INVALID_DATETIMESPAN0xF09AAFX_IDP_INVALID_FILENAME0xF100AFX_IDP_FAILED_TO_OPEN_DOC0xF101AFX_IDP_FAILED_TO_SAVE_DOC0xF102AFX_IDP_ASK_TO_SAVE0xF103AFX_IDP_FAILED_TO_CREATE_DOC0xF104AFX_IDP_FILE_TOO_LARGE0xF105AFX_IDP_FAILED_TO_START_PRINT0xF106AFX_IDP_FAILED_TO_LAUNCH_HELP0xF107AFX_IDP_INTERNAL_FAILURE0xF108AFX_IDP_COMMAND_FAILURE0xF109AFX_IDP_FAILED_MEMORY_ALLOC0xF10AAFX_IDP_UNREG_DONE0xF10BAFX_IDP_UNREG_FAILURE0xF10CAFX_IDP_DLL_LOAD_FAILED0xF10DAFX_IDP_DLL_BAD_VERSION0xF10EAFX_IDP_PARSE_INT0xF110AFX_IDP_PARSE_REAL0xF111AFX_IDP_PARSE_INT_RANGE0xF112AFX_IDP_PARSE_REAL_RANGE0xF113AFX_IDP_PARSE_STRING_SIZE0xF114AFX_IDP_PARSE_RADIO_BUTTON0xF115AFX_IDP_PARSE_BYTE0xF116AFX_IDP_PARSE_UINT0xF117AFX_IDP_PARSE_DATETIME0xF118AFX_IDP_PARSE_CURRENCY0xF119AFX_IDP_PARSE_GUID0xF11AAFX_IDP_PARSE_TIME0xF11BAFX_IDP_PARSE_DATE0xF11CAFX_IDP_FAILED_INVALID_FORMAT0xF120AFX_IDP_FAILED_INVALID_PATH0xF121AFX_IDP_FAILED_DISK_FULL0xF122AFX_IDP_FAILED_ACCESS_READ0xF123AFX_IDP_FAILED_ACCESS_WRITE0xF124AFX_IDP_FAILED_IO_ERROR_READ0xF125AFX_IDP_FAILED_IO_ERROR_WRITE0xF126AFX_IDP_SCRIPT_ERROR0xF130AFX_IDP_SCRIPT_DISPATCH_EXCEPTION0xF131AFX_IDP_STATIC_OBJECT0xF180AFX_IDP_FAILED_TO_CONNECT0xF181AFX_IDP_SERVER_BUSY0xF182AFX_IDP_BAD_VERB0xF183AFX_IDS_NOT_DOCOBJECT0xF184AFX_IDP_FAILED_TO_NOTIFY0xF185AFX_IDP_FAILED_TO_LAUNCH0xF186AFX_IDP_ASK_TO_UPDATE0xF187AFX_IDP_FAILED_TO_UPDATE0xF188AFX_IDP_FAILED_TO_REGISTER0xF189AFX_IDP_FAILED_TO_AUTO_REGISTER0xF18AAFX_IDP_FAILED_TO_CONVERT0xF18BAFX_IDP_GET_NOT_SUPPORTED0xF18CAFX_IDP_SET_NOT_SUPPORTED0xF18DAFX_IDP_ASK_TO_DISCARD0xF18EAFX_IDP_FAILED_TO_CREATE0xF18FAFX_IDP_FAILED_MAPI_LOAD0xF190AFX_IDP_INVALID_MAPI_DLL0xF191AFX_IDP_FAILED_MAPI_SEND0xF192AFX_IDP_FILE_NONE0xF1A0AFX_IDP_FILE_GENERIC0xF1A1AFX_IDP_FILE_NOT_FOUND0xF1A2AFX_IDP_FILE_BAD_PATH0xF1A3AFX_IDP_FILE_TOO_MANY_OPEN0xF1A4AFX_IDP_FILE_ACCESS_DENIED0xF1A5AFX_IDP_FILE_INVALID_FILE0xF1A6AFX_IDP_FILE_REMOVE_CURRENT0xF1A7AFX_IDP_FILE_DIR_FULL0xF1A8AFX_IDP_FILE_BAD_SEEK0xF1A9AFX_IDP_FILE_HARD_IO0xF1AAAFX_IDP_FILE_SHARING0xF1ABAFX_IDP_FILE_LOCKING0xF1ACAFX_IDP_FILE_DISKFULL0xF1ADAFX_IDP_FILE_EOF0xF1AEAFX_IDP_ARCH_NONE0xF1B0AFX_IDP_ARCH_GENERIC0xF1B1AFX_IDP_ARCH_READONLY0xF1B2AFX_IDP_ARCH_ENDOFFILE0xF1B3AFX_IDP_ARCH_WRITEONLY0xF1B4AFX_IDP_ARCH_BADINDEX0xF1B5AFX_IDP_ARCH_BADCLASS0xF1B6AFX_IDP_ARCH_BADSCHEMA0xF1B7AFX_IDS_OCC_SCALEUNITS_PIXELS0xF1C0AFX_IDS_STATUS_FONT0xF230AFX_IDS_TOOLTIP_FONT0xF231AFX_IDS_UNICODE_FONT0xF232AFX_IDS_MINI_FONT0xF233AFX_IDP_SQL_CONNECT_FAIL0xF281AFX_IDP_SQL_RECORDSET_FORWARD_ONLY0xF282AFX_IDP_SQL_EMPTY_COLUMN_LIST0xF283AFX_IDP_SQL_FIELD_SCHEMA_MISMATCH0xF284AFX_IDP_SQL_ILLEGAL_MODE0xF285AFX_IDP_SQL_MULTIPLE_ROWS_AFFECTED0xF286AFX_IDP_SQL_NO_CURRENT_RECORD0xF287AFX_IDP_SQL_NO_ROWS_AFFECTED0xF288AFX_IDP_SQL_RECORDSET_READONLY0xF289AFX_IDP_SQL_SQL_NO_TOTAL0xF28AAFX_IDP_SQL_ODBC_LOAD_FAILED0xF28BAFX_IDP_SQL_DYNASET_NOT_SUPPORTED0xF28CAFX_IDP_SQL_SNAPSHOT_NOT_SUPPORTED0xF28DAFX_IDP_SQL_API_CONFORMANCE0xF28EAFX_IDP_SQL_SQL_CONFORMANCE0xF28FAFX_IDP_SQL_NO_DATA_FOUND0xF290AFX_IDP_SQL_ROW_UPDATE_NOT_SUPPORTED0xF291AFX_IDP_SQL_ODBC_V2_REQUIRED0xF292AFX_IDP_SQL_NO_POSITIONED_UPDATES0xF293AFX_IDP_SQL_LOCK_MODE_NOT_SUPPORTED0xF294AFX_IDP_SQL_DATA_TRUNCATED0xF295AFX_IDP_SQL_ROW_FETCH0xF296AFX_IDP_SQL_INCORRECT_ODBC0xF297AFX_IDP_SQL_UPDATE_DELETE_FAILED0xF298AFX_IDP_SQL_DYNAMIC_CURSOR_NOT_SUPPORTED0xF299AFX_IDP_SQL_FIELD_NOT_FOUND0xF29AAFX_IDP_SQL_BOOKMARKS_NOT_SUPPORTED0xF29BAFX_IDP_SQL_BOOKMARKS_NOT_ENABLED0xF29CAFX_IDS_DELETED0xF29DAFX_IDP_DAO_ENGINE_INITIALIZATION0xF2B0AFX_IDP_DAO_DFX_BIND0xF2B1AFX_IDP_DAO_OBJECT_NOT_OPEN0xF2B2AFX_IDP_DAO_ROWTOOSHORT0xF2B3AFX_IDP_DAO_BADBINDINFO0xF2B4AFX_IDP_DAO_COLUMNUNAVAILABLE0xF2B5AFX_IDS_HTTP_TITLE0xF2D1AFX_IDS_HTTP_NO_TEXT0xF2D2AFX_IDS_HTTP_BAD_REQUEST0xF2D3AFX_IDS_HTTP_AUTH_REQUIRED0xF2D4AFX_IDS_HTTP_FORBIDDEN0xF2D5AFX_IDS_HTTP_NOT_FOUND0xF2D6AFX_IDS_HTTP_SERVER_ERROR0xF2D7AFX_IDS_HTTP_NOT_IMPLEMENTED0xF2D8AFX_IDS_CHECKLISTBOX_UNCHECK0xF2E1AFX_IDS_CHECKLISTBOX_CHECK0xF2E2AFX_IDS_CHECKLISTBOX_MIXED0xF2E3AFX_IDS_PROPPAGE_UNKNOWN0xFE01AFX_IDS_COLOR_DESKTOP0xFE04AFX_IDS_COLOR_APPWORKSPACE0xFE05AFX_IDS_COLOR_WNDBACKGND0xFE06AFX_IDS_COLOR_WNDTEXT0xFE07AFX_IDS_COLOR_MENUBAR0xFE08AFX_IDS_COLOR_MENUTEXT0xFE09AFX_IDS_COLOR_ACTIVEBAR0xFE0AAFX_IDS_COLOR_INACTIVEBAR0xFE0BAFX_IDS_COLOR_ACTIVETEXT0xFE0CAFX_IDS_COLOR_INACTIVETEXT0xFE0DAFX_IDS_COLOR_ACTIVEBORDER0xFE0EAFX_IDS_COLOR_INACTIVEBORDER0xFE0FAFX_IDS_COLOR_WNDFRAME0xFE10AFX_IDS_COLOR_SCROLLBARS0xFE11AFX_IDS_COLOR_BTNFACE0xFE12AFX_IDS_COLOR_BTNSHADOW0xFE13AFX_IDS_COLOR_BTNTEXT0xFE14AFX_IDS_COLOR_BTNHIGHLIGHT0xFE15AFX_IDS_COLOR_DISABLEDTEXT0xFE16AFX_IDS_COLOR_HIGHLIGHT0xFE17AFX_IDS_COLOR_HIGHLIGHTTEXT0xFE18AFX_IDS_REGULAR0xFE19AFX_IDS_BOLD0xFE1AAFX_IDS_ITALIC0xFE1BAFX_IDS_BOLDITALIC0xFE1CAFX_IDS_SAMPLETEXT0xFE1DAFX_IDS_DISPLAYSTRING_FONT0xFE1EAFX_IDS_DISPLAYSTRING_COLOR0xFE1FAFX_IDS_DISPLAYSTRING_PICTURE0xFE20AFX_IDS_PICTUREFILTER0xFE21AFX_IDS_PICTYPE_UNKNOWN0xFE22AFX_IDS_PICTYPE_NONE0xFE23AFX_IDS_PICTYPE_BITMAP0xFE24AFX_IDS_PICTYPE_METAFILE0xFE25AFX_IDS_PICTYPE_ICON0xFE26AFX_IDS_COLOR_PPG0xFE28AFX_IDS_COLOR_PPG_CAPTION0xFE29AFX_IDS_FONT_PPG0xFE2AAFX_IDS_FONT_PPG_CAPTION0xFE2BAFX_IDS_PICTURE_PPG0xFE2CAFX_IDS_PICTURE_PPG_CAPTION0xFE2DAFX_IDS_PICTUREBROWSETITLE0xFE30AFX_IDS_BORDERSTYLE_00xFE31AFX_IDS_BORDERSTYLE_10xFE32AFX_IDS_VERB_EDIT0xFE40AFX_IDS_VERB_PROPERTIES0xFE41AFX_IDP_PICTURECANTOPEN0xFE83AFX_IDP_PICTURECANTLOAD0xFE84AFX_IDP_PICTURETOOLARGE0xFE85AFX_IDP_PICTUREREADFAILED0xFE86AFX_IDP_E_ILLEGALFUNCTIONCALL0xFEA0AFX_IDP_E_OVERFLOW0xFEA1AFX_IDP_E_OUTOFMEMORY0xFEA2AFX_IDP_E_DIVISIONBYZERO0xFEA3AFX_IDP_E_OUTOFSTRINGSPACE0xFEA4AFX_IDP_E_OUTOFSTACKSPACE0xFEA5AFX_IDP_E_BADFILENAMEORNUMBER0xFEA6AFX_IDP_E_FILENOTFOUND0xFEA7AFX_IDP_E_BADFILEMODE0xFEA8AFX_IDP_E_FILEALREADYOPEN0xFEA9AFX_IDP_E_DEVICEIOERROR0xFEAAAFX_IDP_E_FILEALREADYEXISTS0xFEABAFX_IDP_E_BADRECORDLENGTH0xFEACAFX_IDP_E_DISKFULL0xFEADAFX_IDP_E_BADRECORDNUMBER0xFEAEAFX_IDP_E_BADFILENAME0xFEAFAFX_IDP_E_TOOMANYFILES0xFEB0AFX_IDP_E_DEVICEUNAVAILABLE0xFEB1AFX_IDP_E_PERMISSIONDENIED0xFEB2AFX_IDP_E_DISKNOTREADY0xFEB3AFX_IDP_E_PATHFILEACCESSERROR0xFEB4AFX_IDP_E_PATHNOTFOUND0xFEB5AFX_IDP_E_INVALIDPATTERNSTRING0xFEB6AFX_IDP_E_INVALIDUSEOFNULL0xFEB7AFX_IDP_E_INVALIDFILEFORMAT0xFEB8AFX_IDP_E_INVALIDPROPERTYVALUE0xFEB9AFX_IDP_E_INVALIDPROPERTYARRAYINDEX0xFEBAAFX_IDP_E_SETNOTSUPPORTEDATRUNTIME0xFEBBAFX_IDP_E_SETNOTSUPPORTED0xFEBCAFX_IDP_E_NEEDPROPERTYARRAYINDEX0xFEBDAFX_IDP_E_SETNOTPERMITTED0xFEBEAFX_IDP_E_GETNOTSUPPORTEDATRUNTIME0xFEBFAFX_IDP_E_GETNOTSUPPORTED0xFEC0AFX_IDP_E_PROPERTYNOTFOUND0xFEC1AFX_IDP_E_INVALIDCLIPBOARDFORMAT0xFEC2AFX_IDP_E_INVALIDPICTURE0xFEC3AFX_IDP_E_PRINTERERROR0xFEC4AFX_IDP_E_CANTSAVEFILETOTEMP0xFEC5AFX_IDP_E_SEARCHTEXTNOTFOUND0xFEC6AFX_IDP_E_REPLACEMENTSTOOLONG0xFEC7IDC_STATIC-1  +  +  +4 ÿÿÿÿ ( @€ÿÿÿÀ@@pL'r]]±F€aC@ÁA @ @Ð@P?ÿþ ?ÿþ@P@Ð@ ÁA aC@±F€]]'rLp@@Àÿÿÿÿÿÿÿÿÿþ?ÿÿþ?ÿÿþ?ÿÿøÿÿàÿÿÀÿÿ‚ ÿÿ8þ>ü~?ø~?øþ?À€ÀÀÀ€øþ?ø~?ü~?ü>>þ5 +ÿÿ€30 ADJX>5 +ÿÿ€IRQ-FX¸>5 +ÿÿ€CAL / HWPò>- +ÿÿ€HOLDXFP +ÿÿ€T1XP +ÿÿ€T0X¸P3 +ÿÿ€INT/STNDXòP$ +ÿÿ€MASKXFb# +ÿÿ€TESTXb# + ÿÿ€24/12P¸b# + +ÿÿ€STOPPòb( + ÿÿ€RESETP >+ÿÿÿÿ‚Register 0xDP P)ÿÿÿÿ‚Register 0xEP b*ÿÿÿÿ‚Register 0xFP;- msctls_trackbar32Slider1Pj* msctls_trackbar32Slider2PJÿÿ‚1P3msctls_trackbar32Slider1P *msctls_trackbar32Slider2PË*msctls_trackbar32Slider2Pö*msctls_trackbar32Slider2Pÿÿ‚1Ptÿÿ‚1995Pÿÿÿÿ‚MonthPGÿÿÿÿ‚DayPuÿÿÿÿ‚YearP¬ÿÿÿÿ‚HourPÒÿÿÿÿ‚MinutePüÿÿÿÿ‚SecondP­ÿÿ‚0PÛÿÿ‚0Pÿÿ‚0ž ÿÿÿÿh0 ÄÈ‚é¹Rom InfoMS Sans SerifPU¤2ÿÿ€OKPÛ’ÿÿP‘Ûÿÿ‚¬ ÿÿÿÿi0 ÿÿÄÈ‚èµAPP - About DialogMS Sans SerifPZ 2ÿÿ€OK PÚ”ÿÿ ÿÿÿÿj0 ÿÿÄÈ‚@qAPP - Emulator SettingsMS Sans Serif€P[£ÿÿP0ÿÿ€&Browse...€ P[1!ÿÿ6P. %msctls_updown32Spin2e€ P[,1"ÿÿ6P*0 &msctls_updown32Spin3Š€ P[?1#ÿÿ6P(H 'msctls_updown32Spin4ŠP[Q{ $ÿÿ€Toggled Turbo ModeP×\.ÿÿ€&OKP \.ÿÿ€&CancelPL™ÿÿ‚Save Folder DirectoryP@šÿÿ‚Auto-Save S-RAMP&,-›ÿÿ‚Skip at mostP ?3œÿÿ‚Skip renderingP’¡ÿÿ‚seconds after last change (0 disables auto-save)P’,Šžÿÿ‚frames in auto-frame rate modeP’?\Ÿÿÿ‚frames in Turbo modeP[^d (ÿÿ€Pause When Inactive¢ ÿÿÿÿk0 ÿÿÄ +Ë’  ßOpen ROMMS Sans Serif·P¤À(SysTreeView32Tree1P«ïÀ,SysListView32List1PÐB9-ÿÿ…PUÐY@)ÿÿ…P¶Ð:=*ÿÿ…PöÐI,+ÿÿ…PEÍ,ÿÿ€&Open ROMPrÍ,ÿÿ€&CancelPUÄEÿÿÿÿÿÿ‚Interleave Mode:PÄ: ÿÿÿÿÿÿ‚Memory Type:PµÄ6ÿÿÿÿÿÿ‚Video System:PöÄ6ÿÿÿÿÿÿ‚Header:J ÿÿÿÿl0 D +ÌÛGraphics Pack ConfigurationMS Sans Serif€Pª .ÿÿPP ÿÿÿÿ‚Star OceanP­-/ÿÿ€Browse...€P1« 0ÿÿP$P ÿÿÿÿ‚Far East of Eden ZeroP­/-1ÿÿ€Browse...€PNª 2ÿÿPAr ÿÿÿÿ‚Momotaro Densetsu HappyP­L-3ÿÿ€Browse...€Pjª 4ÿÿP^P ÿÿÿÿ‚Super Power League 4P­i-5ÿÿ€Browse...€P‡ª 6ÿÿPz¦ ÿÿÿÿ‚Far East of Eden Zero - Shounen Jump no ShouP­†-7ÿÿ€Browse...€P¤ª 8ÿÿP—h ÿÿÿÿ‚Street Fighter Alpha 2 (US)P­¤-9ÿÿ€Browse...€PÁª :ÿÿP´P ÿÿÿÿ‚Street Fighter Alpha 2 (E)P­Á-;ÿÿ€Browse...€P᪠<ÿÿPÔP ÿÿÿÿ‚Street Fighter Zero 2P­á-=ÿÿ€Browse...P…ô(ÿÿ€OKP²ô(ÿÿ€CancelZ ÿÿÿÿn0 ÿÿÄÀ‚»¡Netplay OptionsMS Sans Serif P´ ÿÿ€Port SettingsP +U +£ÿÿ‚Socket Port Number‚Pd Kÿÿ P#´(¡ÿÿ€Client SettingsP +-U +¤ÿÿ‚Ask Server to Pause when‚Pd- Cÿÿ¶Px- + Emsctls_updown32Spin1P‡-- ¥ÿÿ‚frames behindP +<U +¦ÿÿ‚Maximum Frame Rate Skip‚Pd< Dÿÿ¶Px< + Imsctls_updown32Spin2 PP´<¢ÿÿ€Server Settings P +i­Gÿÿ€Send ROM Image to Client on Connect P +x®Hÿÿ€Act as ServerPP‘2ÿÿ€OKP‡‘2ÿÿ€CancelP +Z®Fÿÿ€Sync By Resetö ÿÿÿÿ{0 ÿÿÄÀ‚QÍDisplay SettingsMS Sans SerifP³2ÿÿ€OKP<³2ÿÿ€CancelP"Œ'Lÿÿ€Test ModeP" 'Oÿÿ€Set ModeP¹‘xNSysListView32List1 PXAÿÿÿÿÿÿ€GeneralP9I +Tÿÿ€Show Frame RateP< +Uÿÿ€Stretch ImageP3 +Vÿÿ€Full ScreenPd-E +Wÿÿ€Bi-Linear Mode 7 P_KAÿÿÿÿÿÿ€SNES ImagePd; +Xÿÿ€Render 16-bitPd; +Yÿÿ€TransparencyPd#% +Zÿÿ€Hi Res PMªÿÿÿÿÿÿ€Output Image Processing!PW Z\ÿÿ…Prb +]ÿÿ€Automatic Frame SkippingX|Y +^ÿÿ€Use Frame Rate Limiter P†ª(ÿÿÿÿÿÿ€Fixed Frame Skipping RateP™ `msctls_trackbar32Slider2 P´›ªÿÿÿÿÿÿ€Display SettingsP¹Œ] +bÿÿ€Enable Double BufferingP¹›^cÿÿ‚Current Mode: 1024x1024x16P‘ ÿÿÿÿÿÿ‚0P”‘ ÿÿÿÿÿÿ‚9Pd8= +®ÿÿ€Extend HeightP$K +dÿÿ€Use Video MemoryP/Q +¯ÿÿ€Maintain Aspect Ratio\ ÿÿÿÿo0 ÿÿÄ +Ê’ÚCheat Entry and EditorMS Sans Serif €PÈ}kSysListView32List1X×(jÿÿ€&AddX×(dÿÿ€&DeleteX×-(eÿÿ€&UpdateP×A(fÿÿ€C&learˆPV†v[ÿÿ€PUšwgÿÿˆPU¯,hÿÿˆPׯiÿÿP]Ä2ÿÿ€&OKP—Ä2ÿÿ€&CancelP†;§ÿÿ‚Enter Cheat Code:Pš=¨ÿÿ‚Cheat DescriptionP¯@©ÿÿ‚Cheat Address (hex)P†¯Jªÿÿ‚New Value (dec or hex)¸ ÿÿÿÿ|0 ÀÈ€º=DialogMS Sans SerifP ÿÿÿÿ‚Static€P dmsctls_progress32Progress1Z ÿÿÿÿ}0 ÿÿÄÀ‚(,Input ConfigMS Sans Serif!PM<eÿÿ…PO* +fÿÿ€EnabledPG BInputCustomWOG!P#G HInputCustomP0G FInputCustomP=G RInputCustomPJG OInputCustomPWG PInputCustomPdG NInputCustomPqG QInputCustomPŽG KInputCustom PŽ#G JInputCustom PŽ0G LInputCustom PŽ=G MInputCustom XŽJG IInputCustom XŽWG CInputCustom XŽdG EInputCustom XŽqG GInputCustom PØo'ÿÿ€CancelPo(ÿÿ€OKPŽpÿÿ‚Blue means the button is already mapped; +Red means it's used by windows or Snes9xP‰ÿÿ‚UPP@Œÿÿ‚DILDOP&Šÿÿ‚LEFTP3‹ÿÿ‚DOWNPYŽÿÿ‚APtÿÿ‚XPMÿÿ‚BPgÿÿ‚YPs2“ÿÿ‚LPs‘ÿÿ‚STARTPs?”ÿÿ‚RPo%’ÿÿ‚SELECTPmM•ÿÿ‚UP LEFTPgg$—ÿÿ‚DN RIGHTPgZ$–ÿÿ‚UP RIGHTPlt˜ÿÿ‚DN LEFTPØPJÿÿÿÿÿÿ‚ÿÿ…PØcT +gÿÿ€Allow Left+Rt/Up+DnPO : +hÿÿ€Toggle ModeH ÿÿÿÿ0 ÿÿÄ +ÈCheat SearchMS Sans SerifP¡ú2ÿÿ€&OKPØú2ÿÿ€&Cancel PɘmSysListView32List1PÖ4nÿÿ€&SearchXÖ4oÿÿ€&Add CheatPÖ34pÿÿ€&Reset PÓ¬* qÿÿ€1 byte PÓ¹* rÿÿ€2 bytes PÓÆ* sÿÿ€3 bytes PÓÓ* tÿÿ€4 bytes PÌ¢6Bÿÿÿÿÿÿ€Data Size P¢rNÿÿÿÿÿÿ€Comparison Type P ªZ uÿÿ€< (Less Than) P µZ vÿÿ€> (Greater Than) P Àj wÿÿ€<= (Less Than or Equal to) P Ëi xÿÿ€>= (Greater than or Equal To) P ÖZ yÿÿ€= (Equal To) P áZ zÿÿ€!= (Not Equal To) P}ÅK+ÿÿÿÿÿÿ€Data Type P}¢K ÿÿÿÿÿÿ€Compare To P«C +{ÿÿ€Previous Value P¶C +|ÿÿ€Entered Value PÏC +}ÿÿ€Unsigned (>=0) PÙC +~ÿÿ€Signed (+/-) PãC +ÿÿ€HexadecimalˆXHúS BÿÿXú6 €ÿÿ‚Enter a Value:¦ ÿÿÿÿ‚0 ÀÈ€DDialogMS Sans SerifPÝ42ÿÿ€OKP©42ÿÿ€Cancel!P¼ ƒÿÿ… ÿÿÿÿƒ0 Ä +Ê’ »Cheat DetailsMS Sans SerifPU{- ÿÿ€&OKP‡{- ÿÿ€&Cancel€POe „ÿÿ€POe …ÿÿ€PO7e †ÿÿ€POOe ‡ÿÿ€POge ˆÿÿPF ÿÿÿÿ‚AddressPF ÿÿÿÿ‚Current ValueP7F ÿÿÿÿ‚Previous ValuePOF ÿÿÿÿ‚New ValuePgF ÿÿÿÿ‚Descriptionˆ ÿÿÿÿ†0 ÿÿÀÈ€#/ßPlay MovieMS Sans SerifP»È2ÿÿ€OKPöÈ2ÿÿ€Cancel€Pæ ¸ÿÿP!ÿÿÿÿÿÿ‚Movie FilePø0¹ÿÿ€&Browse...P75ÿÿÿÿÿÿ‚Recording Date:P+@ÿÿÿÿÿÿ‚Length:P+Iÿÿÿÿÿÿ‚Frames:P R7ÿÿÿÿÿÿ‚Re-record Count:PG7Qºÿÿ‚DATEPG@Q»ÿÿ‚LENGTHPGIQ¼ÿÿ‚FRAMESPGRQ½ÿÿ‚RERECORDPc&ÿÿÿÿÿÿ‚Author Info:P¬E +Âÿÿ€Open Read-Only‚PFcâBÿÿ‚StaticP…M=ÿÿÿÿÿÿ€Record Options X ©F +±ÿÿ€Record from now X šH +²ÿÿ€Record from resetXbŽ- +³ÿÿ€Joypad 1Xb¢- +µÿÿ€Joypad 3Xb˜- +´ÿÿ€Joypad 2Xb¬- +¶ÿÿ€Joypad 4Xb·- +·ÿÿ€Joypad 5PY…E=ÿÿÿÿÿÿ€Record ControllersP¬ŽG +ûÿÿ€Use WIP1 TimingP¬¢{ +òÿÿ€Volume Envelope Height ReadingP¬­r +úÿÿ€Fake Mute desync workaroundP£……=ÿÿÿÿÿÿ€Emulator Sync SettingsP¬—v gÿÿ€Allow Left+Right / Up+DownP +ɤÿÿÿÿÿÿ‚Press OK to start playing the movie. +Don't forget to let the game run for 10 seconds first!P¬·u +ñÿÿ€Sync samples with sound CPUP©|q¿ÿÿ‚ P# Àÿÿ‚Movie's ROM: CRC32=Unknown, Name=UnknownP + Áÿÿ‚Current ROM: CRC32=Unknown, Name=Unknown  ÿÿÿÿ‡0 ÿÿÀÈ€/–Record MovieMS Sans SerifP»2ÿÿ€OKPö2ÿÿ€Cancel€Pæ ¸ÿÿP!ÿÿÿÿ‚Movie FilePø0¹ÿÿ€&Browse...P&M=ÿÿÿÿ€Record Options P AF +±ÿÿ€Record from now P 4H +²ÿÿ€Record from resetPb/- +³ÿÿ€Joypad 1PbC- +µÿÿ€Joypad 3Pb9- +´ÿÿ€Joypad 2PbM- +¶ÿÿ€Joypad 4PbW- +·ÿÿ€Joypad 5PY&E=ÿÿÿÿ€Record Controllers€PCiåBÿÿPl+ÿÿÿÿ‚Author Info:P¬/G +ûÿÿ€Use WIP1 TimingP¬C{ +òÿÿ€Volume Envelope Height ReadingP£&…=ÿÿÿÿ€Emulator Sync SettingsP¬9v +gÿÿ€Allow Left+Right / Up+DownP¬Mr +úÿÿ€Fake Mute desync workaroundP¬Wu +ñÿÿ€Sync samples with sound CPUP SF +óÿÿ€Clear SRAMj ÿÿÿÿˆ0 ÿÿÄÀ‚L_»Customize Special KeysMS Sans SerifFXP§'ÿÿ€CancelP0§(ÿÿ€OKP &‰ÿÿ‚speed +CP 01Œÿÿ‚frame advanceNGP8Šÿÿ‚speed -FEP#(‹ÿÿ‚pausePJ<ÿÿ‚skip +PŠ>“ÿÿ‚movie frame countTYPc>‘ÿÿ‚superscope turboP—;”ÿÿ‚movie read-onlyR_Pp<’ÿÿ‚superscope pausePV;Žÿÿ‚skip -PCb ´InputCustomHotEBPCb ¯InputCustomHotDSPC b °InputCustomHotDSPC-b ±InputCustomHotPCGb ²InputCustomHot0PCTb ³InputCustomHotEGPCab µInputCustomHotIDPCnb ¶InputCustomHotPCˆb ·InputCustomHotSPPC•b ÂInputCustomHotIDPÄ< ¸InputCustomHotAP­ÿÿ‚save1_EPÄ< ¹InputCustomHotBP­#žÿÿ‚save2_IPÄ < ºInputCustomHotP­0Ÿÿÿ‚save3TOPÄ-< »InputCustomHotAP­< ÿÿ‚save4P_PÄ:< ¼InputCustomHotEBP­I¡ÿÿ‚save5IDPÄG< ½InputCustomHotULP­V¢ÿÿ‚save6FEPÄT< ¾InputCustomHotNVP­d£ÿÿ‚save7_SPÄa< ¿InputCustomHotDP­q¤ÿÿ‚save80PÄn< ÀInputCustomHotNOP­~¥ÿÿ‚save9TNPÄ{< ÁInputCustomHotAP­ ¦ÿÿ‚save0AFP< ÃInputCustomHotFEP§ÿÿ‚load1P< ÄInputCustomHotENP#¨ÿÿ‚load2P < ÅInputCustomHotEPP1©ÿÿ‚load3P-< ÆInputCustomHotRTP=ªÿÿ‚load4"P:< ÇInputCustomHotPI«ÿÿ‚load5YPG< ÈInputCustomHotPPV¬ÿÿ‚load61PT< ÉInputCustomHotPd­ÿÿ‚load71Pa< ÊInputCustomHot_CPp®ÿÿ‚load8Pn< ËInputCustomHotIP}Íÿÿ‚load9P{< ÌInputCustomHotENP Îÿÿ‚load0D_P =1ÿÿ‚fast forwardPC:b ÏInputCustomHot12P}=•ÿÿ‚show pressed keysVEPC{b ÐInputCustomHot12P¤;–ÿÿ‚save screenshotT_PC¢b ÑInputCustomHotARP­ŠÒÿÿ‚slot-OVPĈ< ÓInputCustomHotPŠÔÿÿ‚slot+IDPˆ< ÕInputCustomHotX_Pª—Öÿÿ‚save#GEPÄ•< ×InputCustomHotAP—Øÿÿ‚load#P•< ÙInputCustomHotr ÿÿÿÿm0 ÄÀ‚ã=Connect to ServerMS Sans SerifPx-2ÿÿ€&OKP¯-2ÿÿ€CanccelP2«ÿÿ‚Server AddressP¯2@ÿÿ€Clear HistoryP2£ÿÿ‚Port Number€P<?ÿÿ!P<n(>ÿÿ…£ ÿÿðÿÿf0 éSnes9x DirectSoundéFMOD DirectSoundéFMOD Windows Multimediaé FMOD A3Dê10 msê20 msê40 msê80 msê160 msê320 msê640 msë ë8 KHzë11 KHzë16 KHzë22 KHzë30 KHzë35 KHzë44 KHzë48 KHzì10 msì20 msì30 msì40 msì50 msì60 msì70 msì80 msì90 msì100 msì110 msì120 msì130 msì140 msì150 msùSkip method #1ùSkip method #2ùSkip method #3ùSkip method #4ùSkip method #5\ ÿÿðÿÿ}0 e +Joypad #1e +Joypad #2e +Joypad #3e +Joypad #4e +Joypad #5èDDESIGNINFOGUIDELINES0 ÿÿÿÿf X0ÿÿÿÿe ˆ0ÿÿÿÿh ¸0ÿÿÿÿi è0ÿÿÿÿj $ÿÿÿÿk <0ÿÿÿÿl l0ÿÿÿÿ{ œ0ÿÿÿÿo Ì0ÿÿÿÿ| ü0ÿÿÿÿ} ,<ÿÿÿÿ h0ÿÿÿÿ‚ ˜0ÿÿÿÿƒ È0ÿÿÿÿ† ølÿÿÿÿ‡ dTÿÿÿÿˆ ¸0EGYÂEG²UEGâ²EGá®EG9jEGšÝEGÔýEGJÆEGÿÓEG³6G+AMA\€zEG +EG=EG´ˆEG(Û7x…¿EG(&cG\AHA\µè ÿÿÿÿ ( @€€€€€€€€€ÀÀÀ€€€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÁÁÿß^Ý€__}ÿ__±ÿ__·ÿ_C·ÿ_]¯ÿ_A§ÿ_»ÿ^ýà@ÿÿÏÿÿÿßÿÿÿßÿÿÿßÿÿÿßÿÿÿÎ?ÿÿáÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¨ ÿÿÿÿ ( @€€€€€€€€€ÀÀÀÀÜÀðʦ """)))UUUMMMBBB999€|ÿPPÿ“ÖÿìÌÆÖïÖçç©­3f™Ì3333f3™3Ì3ÿff3fff™fÌfÿ™™3™f™™™Ì™ÿÌÌ3ÌfÌ™ÌÌÌÿÿfÿ™ÿÌ3333f3™3Ì3ÿ3333333f33™33Ì33ÿ3f3f33ff3f™3fÌ3fÿ3™3™33™f3™™3™Ì3™ÿ3Ì3Ì33Ìf3Ì™3ÌÌ3Ìÿ3ÿ33ÿf3ÿ™3ÿÌ3ÿÿff3fff™fÌfÿf3f33f3ff3™f3Ìf3ÿffff3fffff™ffÌf™f™3f™ff™™f™Ìf™ÿfÌfÌ3fÌ™fÌÌfÌÿfÿfÿ3fÿ™fÿÌÌÿÿÌ™™™3™™™™Ì™™33™f™3Ì™ÿ™f™f3™3f™f™™fÌ™3ÿ™™3™™f™™™™™Ì™™ÿ™Ì™Ì3fÌf™Ì™™ÌÌ™Ìÿ™ÿ™ÿ3™Ìf™ÿ™™ÿÌ™ÿÿÌ™3ÌfÌ™ÌÌ™3Ì33Ì3fÌ3™Ì3ÌÌ3ÿÌfÌf3™ffÌf™ÌfÌ™fÿ̙̙3Ì™fÌ™™Ì™ÌÌ™ÿÌÌÌÌ3ÌÌfÌÌ™ÌÌÌÌÌÿÌÿÌÿ3™ÿfÌÿ™ÌÿÌÌÿÿÌ3ÿfÿ™Ì3ÿ33ÿ3fÿ3™ÿ3Ìÿ3ÿÿfÿf3Ìffÿf™ÿfÌÌfÿÿ™ÿ™3ÿ™fÿ™™ÿ™Ìÿ™ÿÿÌÿÌ3ÿÌfÿÌ™ÿÌÌÿÌÿÿÿ3Ìÿfÿÿ™ÿÿÌffÿfÿffÿÿÿffÿfÿÿÿf!¥___www†††–––ËË˲²²×××ÝÝÝãããêêêñññøøøðûÿ¤  €€€ÿÿÿÿÿÿÿÿÿÿÿÿ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +µ¼ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +µÏ¼ + + + +µ¼ + + + + + + + + + + + + + + + + + + + + + + + +µÏ¼ + + +µµ¼ + + + + + + + + + + + + + + + + + + + + + + + +ϵ¼ + +µ¼ + + + + + + + + + + + + + + + + + + + + + + + + + +µ¼ + +µ¼ + + + + + + + + + + + + + + + + + + +øøøøøø + + + + + + + + + + + + +øøøø + + +µ¼ + + +øøøððððøøøøøøøøøøøøøððððøø +µ¼ + +øøððððððððððððððððððððððððø + + + + +øðððð¼¼ððððððððððððððð¼¼ðððø + + + +øðð¼øø¼ðððøððøðððððŒŒ¼¼ðøø + + +øð¼¼¼øø¼¼ððððøðÿøð𼌌¼ŒŒ¼ðø + + +øð¼øøøøøøððððððÿððð¼¼¼ŒŒ¼ðø + + +øð¼øøøøøøððððÿðððð𼶶¼¼¼¼ðø + + +øÿ¼¼øø¼ðð¼¼ð¼ð𼶶¼¶¶¼¼ðø + + +øÿð¼øø¼¼ðð¼¼¼¼ðð¼¼¼¶¶¼ððø + + +øÿÿð¼¼¼ððððððððððÿðð¼¼ðððø + + + +øÿÿÿððððððððððððððððððððððø + + + + + +øøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¼øø + + + + +µϵøøøøøøøøøøøøøøøøøøøøø + +µ¼ + + +µϵ +µ + + + + + + +µµµ¼ + + +ϼ + + + +¼µµ¼¼ + + + + + + +ϼ + + + +ϼ + + + +µµ¼µÏϼ + + + + + +µÏµ¼ + + + +µ¼ + + + + +ϼ +µϼ + + + + +µÏµ¼ + + +ϼ + + + + +µµ¼ +µÏ + + + + +µµµ¼ + + +µ¼ + + + + +ϵ¼µµ¼ + + + +µϼ +Ïϼ + +ϼ + + + + + +µϵÏϼ + + + + +µµ¼ +µÏµ¼ +µ¼ + + + + + +µµÏϼ + + + + + +Ïϼ + + +µµÏ¼ + + + + + + + +µÏ¼ + + + + + + + + + + + + + + + +µÏ + + + + + + + + + + + + + + + + + + + + + + + + + + + +µµ¼ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ÿÿÿÿÿÿÿÿùÿÿÿøóÿÿüqÿÿþ1ÿÿøü?à À€€€€€€€€€Àà€3€‡ðsÀðóÀàóâÀsáÀqð‚3ð‚øÇüÿƒÿÿÿÇÿÿÿÿ" ÿÿÿÿe0  è ¨( ÿÿÿÿo0 (ÿÿÿ¸³³ÿýý¸´³åâᾺ¸¹µ³¸µ³¸¶³ÛñðÛðï76ED-trXÒÐgÝÜ~ôó}Ì˳øö³÷ö£ÙØ ]] YY‚ƒ‚‚FÌÌWÈÈU¿¿bÎÎa¸¸iÇÇtÐÐŒ÷÷”ÿÿ•ÿÿ˜ÿÿyËË™þÿ™ÿÿ›ÿÿ|ÉÉžÿÿ¡ÿÿ¢ÿÿ†ÐÐ¥ÿÿŠÒÒˆÏÏ‹ÏЭÿÿ®ÿÿ¨öö¯ÿÿ‘ÓÓ¥íí•ÑÑ®óó²÷÷˜ÒÒ´öö½ûû­ÞÞ¸ááÈèèÛððßóóéööéõõèóóøûûMOKMcf€ƒTU#mpWÊÍaÊÎbÊÎbËÎxÏÑ~ØÛ•ýÿ˜üÿ™üÿüÿžýÿ¡üÿ¤üÿˆÏÑžÓÕ½öø OS~ƒbÈÎúÿ•ùÿ™ùÿ™úÿ™ûÿžùÿžúÿ¡úÿ¡ûÿÂňÍÑ®ûÿ³óöw€|ƒaÇÎbÅÎbÇÎbÄÍP—œ•öÿ•÷ÿ™øÿšøÿ¡øÿ¨øÿ³ñö}‰yƒzƒ•õÿ—ôÿ˜ôÿ™õÿ™öÿœõÿ®øÿ¯÷ÿ¯¹ºvƒlÀÌ•óÿ™òÿ™óÿœòÿ³îösƒ_µÃ™ðÿ™ñÿ²ôÿlÇØ•îÿ™íÿ™ïÿŸðÿ¡ïÿ¡ðÿF”§•êÿ™ëÿ™ìÿšëÿ¡ìÿ³éö™êÿ›éÿœéÿ„Üø™æÿ£êÿˆÓî™äÿ™åÿ”ßÿ™Üÿ™Þÿ Þÿ¡Üÿ¥ÕÿÿÿÿÌ™3Ì™fÌ™™Ì™ÌÌ™ÿÌÌÌÌ3ÌÌfÌÌ™ÌÌÌÌÌÿÌÿÌÿ3™ÿfÌÿ™ÌÿÌÌÿÿÌ3ÿfÿ™Ì3ÿ33ÿ3fÿ3™ÿ3Ìÿ3ÿÿfÿf3Ìffÿf™ÿfÌÌfÿÿ™ÿ™3ÿ™fÿ™™ÿ™Ìÿ™ÿÿÌÿÌ3ÿÌfÿÌ™ÿÌÌÿÌÿÿÿ3Ìÿfÿÿ™ÿÿÌffÿfÿffÿÿÿffÿfÿÿÿf!¥___www†††–––ËË˲²²×××ÝÝÝãããêêêñññøøøðûÿ¤  €€€ÿÿÿÿÿÿÿÿÿÿÿÿò]oSììììììììììììFìû¼û¼û¼û¼ûìBìû¼û¼û¼û¼û¼ì/ì¼û¼û¼û¼û¼ììì¼û¼û¼û¼û¼ûìììì¼ììììììììììììììûìAì¼û¼û¼û¼û¼û¼ììû¼û¼û¼ìì¼û¼û¼ììììììˆFììDDDDDFììììì@( ÿÿÿÿp0 (ÿÿÿàäã¸Å¸Ä¸¿¾±¹¸·¿¾¸ÃÂÛðïI ŸvËÉ€ËɉÓÒ‹ÔÓ¬éè#‡‡-PÏÏOÎÎUÒÒ2stIžŸY¾¾aÊÊU«¬‹úú–ÿÿvÈÉvÉÉ—ÿÿ˜ÿÿ™þÿ™ÿÿƒØÙzÊÊšþþ¡ÿÿŸüü£ÿÿ€ÄʼnÑÒ¯ÿÿ°ÿÿ¸þÿºÿÿ¯çç°çç´èè¬ÝÝ»îî¿â☮®Ûððßóóãç穬¬6€ƒ6ƒIœŸMž J…†—ýÿ2~‚6ƒIšŸtǢùÿ™úÿ‰ÏÒ¨úÿ°ûÿ5„H™ŸI™ŸP—œ˜÷ÿ™÷ÿ™øÿ øÿ¤ùÿ¨øÿ©ùÿ°ùÿI—Ÿ˜õÿ™ôÿ™õÿ™öÿžöÿ õÿ¨÷ÿ©öÿ—òÿ™òÿ™óÿôÿ óÿ¨ôÿ—ñÿ˜ðÿ™ðÿ™ñÿðÿ™íÿ™îÿ™ïÿšíÿšîÿîÿ îÿ ðÿ¨ñÿ™ëÿ™ìÿìÿ ìÿ˜èÿ™êÿ™æÿ™çÿ™åÿåÿ æÿ™ãÿšâÿâÿ¤æÿ™ßÿ™àÿšßÿšáÿ áÿ™Üÿ™ÚÿÝÿšÖÿ¡×ÿÿÿÿ™f3™3f™f™™fÌ™3ÿ™™3™™f™™™™™Ì™™ÿ™Ì™Ì3fÌf™Ì™™ÌÌ™Ìÿ™ÿ™ÿ3™Ìf™ÿ™™ÿÌ™ÿÿÌ™3ÌfÌ™ÌÌ™3Ì33Ì3fÌ3™Ì3ÌÌ3ÿÌfÌf3™ffÌf™ÌfÌ™fÿ̙̙3Ì™fÌ™™Ì™ÌÌ™ÿÌÌÌÌ3ÌÌfÌÌ™ÌÌÌÌÌÿÌÿÌÿ3™ÿfÌÿ™ÌÿÌÌÿÿÌ3ÿfÿ™Ì3ÿ33ÿ3fÿ3™ÿ3Ìÿ3ÿÿfÿf3Ìffÿf™ÿfÌÌfÿÿ™ÿ™3ÿ™fÿ™™ÿ™Ìÿ™ÿÿÌÿÌ3ÿÌfÿÌ™ÿÌÌÿÌÿÿÿ3Ìÿfÿÿ™ÿÿÌffÿfÿffÿÿÿffÿfÿÿÿf!¥___www†††–––ËË˲²²×××ÝÝÝãããêêêñññøøøðûÿ¤  €€€ÿÿÿÿÿÿÿÿÿÿÿÿòò=ììììììììììììììHìû¼û¼û¼û¼û¼ûìHì¼û¼û¼û¼û¼û¼ì:ìû¼û¼û¼û¼û¼ûì:ì¼û¼û¼û¼û¼û¼ì:ìû¼û¼û¼û¼û¼ûì:ì¼û¼û¼û¼û¼û¼ì:ìû¼û¼û¼û¼û¼ûìHìììû¼û¼û¼ûìììììì(1ìû¼û¼ûì46666 63ììììì8( ÿÿÿÿq0 (ÿÿÿ±°µpnvrpvçå뼺¿ÕÓØõòøÒÑÓüúýsdsE@Ec^cÑËÑÈÆÈÚÙÚÅÄŲ±²G=F¿¹¾ÜØÛŸœéâä–Žº±±ÍÇǪ¦¦¨¤¤|yy»··¿¼¼º··®««¤¡¡mkk?>>ÆÃã¡¡¡ŸŸ–””BAA»¹¹³±±¯­­|{{rqqnmmfeeXWWÂÁÁ´³³²±±®­­ª©©£¢¢¢¡¡œ››—––€€ynk·¶µ¾‘9½–:Â<¶¦DojFϾ'ž‘·&“‘mÑÍH²±zÊÊ5wwoÎÎÍ™ž]ÇÙBÈÜI¦³S˜¢rx†K»á^Õñ•¨ÀsèÿÕÀ^¹Å«¨¹–ÛÝÙÑü°•´€äóÚÙöÇÒæÆ—Ð}Ÿ{\¢Z„¦ƒa×a‘º‘ÙàÙîðîxyx_`_šú«¿ÂÀžûÍ\a_“íˉŒ‹¿ÿë–ÿìœÿï¡ìâ‚òï–íë`ÃÃdÁÁyÅÅžôõ¸¸›··®ÁÁV__¶ÇljÀÇÇÁÇǾ¿¿­®®ŒgÓ×zæép¾Ác—˜”Þâ·ÇÈ­¸¹w~kœ¤ÇÌÍbefÆÉÊ‹‹“ÐÐØììîääåÜÜÝ’’“ŠŠ‹üüüùùùøøøöööõõõîîîìììèèèåååßßßÜÜÜÛÛÛÚÚÚÖÖÖÕÕÕÔÔÔÓÓÓÎÎÎÊÊÊÇÇÇÅÅÅÃÃý½½¼¼¼ººº¹¹¹¸¸¸···µµµ±±±°°°¯¯¯¨¨¨¢¢¢›››–––“““’’’ŒŒŒ‹‹‹}}}zzzlllXXXLLLCCCAAA@@@???===ÿÿÿÿ3ÿÿfÿf3Ìffÿf™ÿfÌÌfÿÿ™ÿ™3ÿ™fÿ™™ÿ™Ìÿ™ÿÿÌÿÌ3ÿÌfÿÌ™ÿÌÌÿÌÿÿÿ3Ìÿfÿÿ™ÿÿÌffÿfÿffÿÿÿffÿfÿÿÿf!¥___www†††–––ËË˲²²×××ÝÝÝãããêêêñññøøøðûÿ¤  €€€ÿÿÿÿÿÿÿÿÿÿÿÿ¦ÆÆÊÊÊÆÆÆÆÊů——-3—.ììììììììììììì—ì—úÊ——ÊÊÊ.¾—ì—ÊÊÊÊììî{XÊʾ—ì—.73î{XEE¾¡ì———.773¦{V@â3ʼ—ìììì7377ìA¡“—Ê-——.“›“3ìì3›îÊ——.33îì›ìîîîÊ——¡.¼7LRìì73îîÊ———Wì@HVRì3¦3ʯ———¡.VVAV{3¡3Ê—————¡.AVXu3Ê——————¡..Xu..————————...¯›———( ÿÿÿÿr0 (ÿÿÿ¥ ¥‹ÌÊÌÒÑÒ¡ ¡ŸžŸ³®±RHHkddZUU’ŽŽäßßÙÔÔ‘ŽŽˆ††…ƒƒƒµ³³âááÊÉÉÉÈÈÇÆÆ‹ŠŠˆ‡‡ZTS±°¯ÑÒЦšÏÓÎÆÞŸŒŒ‹Œ‹„¦†£§¤¶¼»(kic¬¬¹ØØßàà¿ÀÀŽŒeˆ‰ÉÔŠ–—BX’’•þþþüüüùùùøøø÷÷÷öööõõõôôôòòòïïïîîîéééèèèçççæææåååãããáááàààßßßÞÞÞÝÝÝÚÚÚÖÖÖÕÕÕÔÔÔÓÓÓÑÑÑÍÍÍËËËÊÊÊÉÉÉÈÈÈÆÆÆÃÃÿ¿¿¾¾¾½½½´´´³³³¤¤¤žžž‘‘‘ŽŽŽŒŒŒ‹‹‹ŠŠŠ‰‰‰vvvgggeeecccaaa```KKKJJJGGGBBBÿÿÿf™3f™ff™™f™Ìf™ÿfÌfÌ3fÌ™fÌÌfÌÿfÿfÿ3fÿ™fÿÌÌÿÿÌ™™™3™™™™Ì™™33™f™3Ì™ÿ™f™f3™3f™f™™fÌ™3ÿ™™3™™f™™™™™Ì™™ÿ™Ì™Ì3fÌf™Ì™™ÌÌ™Ìÿ™ÿ™ÿ3™Ìf™ÿ™™ÿÌ™ÿÿÌ™3ÌfÌ™ÌÌ™3Ì33Ì3fÌ3™Ì3ÌÌ3ÿÌfÌf3™ffÌf™ÌfÌ™fÿ̙̙3Ì™fÌ™™Ì™ÌÌ™ÿÌÌÌÌ3ÌÌfÌÌ™ÌÌÌÌÌÿÌÿÌÿ3™ÿfÌÿ™ÌÿÌÌÿÿÌ3ÿfÿ™Ì3ÿ33ÿ3fÿ3™ÿ3Ìÿ3ÿÿfÿf3Ìffÿf™ÿfÌÌfÿÿ™ÿ™3ÿ™fÿ™™ÿ™Ìÿ™ÿÿÌÿÌ3ÿÌfÿÌ™ÿÌÌÿÌÿÿÿ3Ìÿfÿÿ™ÿÿÌffÿfÿffÿÿÿffÿfÿÿÿf!¥___www†††–––ËË˲²²×××ÝÝÝãããêêêñññøøøðûÿ¤  €€€ÿÿÿÿÿÿÿÿÿÿÿÿ4444444444444444444444444444û4'UUUUUU'''UUUUUU=Zfhh +'Uhhhh^¼4=BHH )HHHLB=444L4444444444U4LffffffffffUfLL¼¼¼¼¼¼UUUUfLLL¼¼¼¼¼¼ú!Uf444444444444f4fLLUUUZZZZZZZf44444444444444444444444444444444444( ÿÿÿÿs0 (ÿÿÿœ˜ž˜˜•Ž•ÂÁ›š›ÛÕÚ°¢­ šž“’§¥¥RQQPOOÂÀÀÀ¾¾¿½½ÛÚÚËÊÊÁÀÀ±°°¯®®¥¤¤£¢¢Ÿžž’‘‘¡ ŸTªP­â­¿è¿‘“#ÁÂÂÀÁÁ¿ÀÀ—˜˜¿¿ÀýýýõõõèèèæææäääãããâââáááàààÞÞÞÝÝÝÜÜÜÛÛÛØØØÖÖÖÔÔÔÓÓÓÒÒÒÑÑÑÏÏÏÎÎÎÊÊÊÆÆÆÂÂÂÁÁÁÀÀÀ¿¿¿½½½¸¸¸···¯¯¯®®®«««ªªª§§§¥¥¥“““ŽŽŽ‹‹‹‰‰‰yyyggg^^^XXXVVVRRR===777666ÿÿÿ3ÿf3ÿ™3ÿÌ3ÿÿff3fff™fÌfÿf3f33f3ff3™f3Ìf3ÿffff3fffff™ffÌf™f™3f™ff™™f™Ìf™ÿfÌfÌ3fÌ™fÌÌfÌÿfÿfÿ3fÿ™fÿÌÌÿÿÌ™™™3™™™™Ì™™33™f™3Ì™ÿ™f™f3™3f™f™™fÌ™3ÿ™™3™™f™™™™™Ì™™ÿ™Ì™Ì3fÌf™Ì™™ÌÌ™Ìÿ™ÿ™ÿ3™Ìf™ÿ™™ÿÌ™ÿÿÌ™3ÌfÌ™ÌÌ™3Ì33Ì3fÌ3™Ì3ÌÌ3ÿÌfÌf3™ffÌf™ÌfÌ™fÿ̙̙3Ì™fÌ™™Ì™ÌÌ™ÿÌÌÌÌ3ÌÌfÌÌ™ÌÌÌÌÌÿÌÿÌÿ3™ÿfÌÿ™ÌÿÌÌÿÿÌ3ÿfÿ™Ì3ÿ33ÿ3fÿ3™ÿ3Ìÿ3ÿÿfÿf3Ìffÿf™ÿfÌÌfÿÿ™ÿ™3ÿ™fÿ™™ÿ™Ìÿ™ÿÿÌÿÌ3ÿÌfÿÌ™ÿÌÌÿÌÿÿÿ3Ìÿfÿÿ™ÿÿÌffÿfÿffÿÿÿffÿfÿÿÿf!¥___www†††–––ËË˲²²×××ÝÝÝãããêêêñññøøøðûÿ¤  €€€ÿÿÿÿÿÿÿÿÿÿÿÿ&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&ìììììììììììììì&ì<&&&&&&&&&&<ììì<ìììììììììì<ììì<<<<<<<<<<<<ììì<<<<<<<<<< <ììì&&&&&&&&&&&&ìì5ì<<<<<<<<<<<<ì&<ìììììììììììììS&&5555555555555ó&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&h< ÿÿÿÿ…0 (xx@8•“ó®ù²¬ã‘„»|o ´™ë§…Þ‹s²pYŽ pÎ8*CP:`š^ÂdA|‹\«B.OƒLŸw>±¿[,n•A³»iÙt/‰ˆ7 Ø‹ðh(z‡&Sabp!‘´LÈ!'+ƒ–v†ÊXß„“mz~ŽELÜ`íèfú€Œ€Œ~‹|‰{‡z†x„‹{ˆ|ˆ{‡Œ}Š}‰…’„†“Ž‰–‡”…’ƒQYˆ •‹ +˜‰ +–Š — +Œ| +‰‹ ˜x …š œ’Ÿ•£ðjþ‚ŒŠ‰|‡{†z…yƒpyjs‡„ƒŽwt~Ya‚z…cl„ƒŽ„Œ|††’†‘…‘ˆ”Š •.1-/ñdþDG79îeöõkþ34ûlÿúýúüøµú&&88ÿiÿýoÿþtÿþçþ±°±¯®¯®­®<;54.-@>?=97 ­«ªŸÄÛ›ÀÖÂØ™»Ó¢ÆÞ˜ºÑ–·Î›½Ô²×ñÇèÿœ¿ØžÀÚ¡ÃÝ ÃÜ¥Èá ÁÚž¿Ø­Ñë§Êãž¼Ó¡Á֛ܽºÔ¤ÅߣÃݤÃÝ ¾×¢ÀØ¡ºÏ¢ÂÞŸ¾Úš¸Óž¼Ø¦Åá»Õ”°ÉªÉæ¨Çã¥ÃߤÂÞž»Õ´Ôò±Ñî°Ïì­Ì陵ιÙ÷¾ßý·×ô™³Ë¢»Ò¶Ìž¶ÌªÃÚ—´ÐŸ½Ú»Ø£ÁÞ ½Úž»ØºÖ™µÑ–²Í£ÀÝ¡¾Ûž»×¹Õ’¬Æ¤ÁÞ¤ÁÝ ¼Ø¸Ò¦Á۶ϭ½¹Ö£¿Ü¢¾Ûž¹Õœ·Ó§ÁŒ£¼¤¾Ûœ¶Ñ‡œ¶£½Û¢»Ú ¹×GP[ª¾Õ™¦µ§¿ßm{al{“—žµÖ“®x‰¢®°³¢¹ß¤ºÜœ±Ò¬Âå=DOƒ†Œ¤´Ú¡°ÖSZj«Ñ™§Ì©µÞ–žÇ¢¦×ŸŸ¡®®°¬¬­««¬¦¦§ÿÿÿüüüüüüüüüüüüüúæðáôæåêÌ¢­­¢èÇÇ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ÇÌééå @@@@@@ åéÝÇ¿¿¿¿¿¿Ç¿¿¿ÇÇ¿¿ÌÙÚÚÝÝéêåæáôú}üüüüüüüüüüüüüüüüüüüüüüüüüüü}úôðáôæåÝïµïÀ¼ÇÇè¿¿¿¿¿¿¿¿¿¿¿¿Ùé'@@]]]``WW\\0\\\W`]]]@@ ÝÇ¿¿Ç¿¿¿¿¿¿¿¿è¿ÌÙÚÝÝééåæááçüüüüüüüüüüüüüüüüüüüüüüüüüü}çáðôôæêÚ¢­¢Þ¼ÇǼ¼¼¼¼¼¿¿¿¿¿èÇÚê @]W\0eee,,,,,,e,,,,,eee00\W]@åéÌ¿¿¿¿¿¿¿Ç¿èÇÌÙÚÝÝéêæááñüüüüüüüüüüüüüüüüüüüüüüüüüñððôôåê̪µªèÌǼ¼¼¼¼¼¼¼¼¼èèÇÝ @@`\ee,,eeeeeeeeeeeeeeeeeeeee,,,0W]]@êÚ¿Ç¿¿¿¿Ç¿¿¿ÇÌÚÝÝéêåôáæüüüüüüüüüüüüüüüüüüüüüüüåððôæåéÇï­¢Ç̼¼¼¼¼¼¼èè¼¼Çê @]`\e,eeeeeeeeee0eeeeeeeeeeeeeeeeeeee,e\`]@Ú¿¿¿¿¿¿¿¿¿¿ÌÙÚÝééåôðæþ}üüüüüüüüüüüüüüüüü}úæðáôæåé­ï»Ç̼¼¼¼è¼è¼è¼èê @]W0e,eeeeeeeeeeeeeeeeeeeeeeee0eeeeeeeeeeeeee\`@ÚŠ¿¿¿¿¿¿¿¿¿ÇÙÚÝéêåæááç}üüüüüüüüüüþüüüü}çôðáôæêÝ»­ïÌǼ¼¼¼è¼¼è¼èÝ @@We,,eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0eeee,,0W]Ç¿¿¿¿¿¿¿¿¿ÇÙÚÝÝéêæááñüüüüüüüüüüææææææáðáææêÚÞÌǼ¼¼¼¼¼¼è¼Ý @We,eeeeeee0eeeeeeeeee0eeeeeeeeee0eeeeeeeeeeeeeeeee,e`@êÇè¿¿¿¿¿¿è¿ÌÚÚééêåôáñüüüüüüüüüðððððððáææêÌ¢ïÞÇÙ¼¼¼¼¼¼è¼¼Ù@We,eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0eee0eeeee,0`@êÇè¿¿¿¿¿è¿ÌÙÚÝéêåôáñ}üüüüüüüôæææææææåêÌ¢¢Ì̼¼¼¼¼¼è¼èÌ@`e,eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0eeeeeeeeeeeeeeeeeeeee,,\]@ é輿¿¿¿¿¿ÇÙÚÝééåôáçüüüüüüüååååååêåéÇ¢Þ¼ÙǼ¼¼¼¼¼èèè»Ù @`\eeeeeeeee00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0eeeeeeeee,\]¼¿¿¿¿¿èÇÙÚÚéêåáôúüüüüüüÚÚÚÙÙÌÌÌÌ»¥¼ÙǼ¼¼¼¼è¼¼é@\,,eeeeeeee& Jeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0eeeeeeeeeeee,,W@Ǽ¼¿¿¿¿¿ÇÙÙÝééæáæþüüüüü¥¥»»»»»»ÇÇÌÙ¼¼¼¼èè¼èèèèê]\,eeeeeeeeee! Jeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,\@ Ù¼¼¿¿¿¿¿¿ÙÚÝéêæáåüüüüüÚÚÚÚÙÌÙÌÚÝÙ¼¼¼èè¼è¼èÇ@`0,eeeeeeeeee0! JH&0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0eee0]ݼ¿è¿¿èÇÙÚÝéêæáñüüüüÚÚÚÚÚÙÙÙÌ̼¼¼¼¼¼èèèÞö @`e,eeeeeeeeeee0!HeJ0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,e]éèèèè¿¿¿ÇÙÚÝéåôáçüüü¼¼¼¼¼¼¼¼¼¼¼¼¼¼è¼¼¼Ú @\eeeeeeeeeeeeee0!  Jeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,e`Çèèèè¿èÇÚÚÝéåáôú}ü¼¼¼¼¼¼¼¼¼¼¼¼¼¼èèÞé]\eeeeeeeeeeeeeee0! \eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeW@Çèèèè¿¿ÇÙÝéêåáôþü¼¼¼¼¼¼¼¼¼¼è¼è¼èè»é]0,eeeeeeeeeeeeeee0 \\"Jeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,\@Çèèèè¿¿ÌÚÚÝêæáæü¼¼¼¼¼¼¼¼è¼¼è¼è¼ÀÚ]e,eeeeeeeeeeeeeeee0!  HeeeeeeeeeJ!J\0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,\]èèèèèè¿¿ÌÚÝÝêæáå¼¼¼¼¼¼¼¼è¼èèèè»ø@\,eeeeeeeeeeeeeeeeee! !0eeeeee&øøöøe0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,W@êèèèèè¿¿ÙÚÝéêôá¼¼¼¼¼¼è¼èèè¼èÇ@\,eeeeeeeeeeeeeeeeeee,&!Jeeeeee&ø¿öeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeWéèèèè¿¿ÇÙÚÝéåá¼¼¼¼¼¼¼è¼èè@WeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeÀèè&0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee]Ùèèè¿èèÌÙÚÝêæ¼¼¼¼¼è¼èÞ@`eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeÌèèèèÀÀÀÞÞ¢ÞÀ0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee] Ìèèèèè¿ÌÚÚéå¼¼¼¼¼è¼èèèÀÝ`eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0èèè¢èÚêåææåé¿ÀÀŠøeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,0]ÇèèèèèÇÚÚÝê¼¼¼¼èè»Ù]\eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeÇèÀèêôow†††† ðå¿ÀÇ,eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,\@èèèèè¿ÌÚÝé¼¼¼èèèÇ ]\,eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeÙèèÀéá †w‚kk‚kw†wáÝÞ¼J0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\éèèèèè¿ÙÚݼè¼è@\eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\èÀæ †wx€€€r€rkkw† +éÞ!eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,`ÙèèèèèÌÚÚ¼¼èèèÀø`,eeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0Ùèæ†kƒ''€€€€€krr‚† +Úeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee]èèèè¿ÙÚèèèèè»@\eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee%ÀèèÀ净€'ƒƒ€€€rrr‚wôöeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,WÚÀèèè¿ÇÚèèèèWeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"Ú‰Ý +‡‚ƒƒ'nƒ€€€€€€‚ êÞè¿,eeeeeeeeeeeeeeeeeeeeeeeeeeeeeee]èèèèè¿Ìèè]\,eeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0ÇÀÀ懆ƒ€ƒ'n€ƒƒƒ€€€xxwôèèè&eeeeeeeeeeeeeeeeeeeeeeeeeeeee,WÝ»èèèè¿Çèè¢Weeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0ÀÌ +‡‚€ƒƒ€ƒnƒƒƒƒƒƒƒ€€€€w +ÚÞèèŠeeeeeeeeeeeeeeeeeeeeeeeeeeeeee`èèèèè¿À]0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\ŠèÀ݆kƒƒƒƒƒ€ƒƒƒƒƒƒƒƒ€€‚ké¢èøeeeeeeeeeeeeeeeeeeeeeeeeeeee,\݉èèèèè¢Weeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,eeÀÀꆆ€ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒxxwê¢èèèöJeeeeeeeeeeeeeeeeeeeeeeeeeeee`èèèèÇ ]0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\‰è¢å‡w€ƒƒƒƒƒ€€€ƒƒƒƒƒƒƒ€€x‚êÞèè¿J0eeeeeeeeeeeeeeeeeeeeeeeeee\@éÞèèèè]\,eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,0‰Þå‡w€ƒƒƒƒƒƒnƒƒƒƒƒƒƒƒ€€x êÞèèŠeeeeeeeeeeeeeeeeeeeeeeeeee,` ¿èèèèè ]eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0èÀꆆ€ƒƒƒƒƒ'ƒƒƒƒƒƒƒ€ +ÚÞèèèè‰øeeeeeeeeeeeeeeeeeeeeeeeeee0]êÀèèøW,eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeÇÞÚ †‚ƒƒƒ€'n€ƒƒƒƒƒƒ‚ ÇÀèèèèöeeeeeeeeeeeeeeeeeeeeeeeeee`è‰]0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee%éÀÀèᇂƒƒƒ€' nƒƒƒƒƒƒ€‚åÞèèèèÀè,eeeeeeeeeeeeeeeeeeeeeee,WÌÀèèè `eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\¢ê†xƒƒ€nƒƒƒƒƒƒƒ ÌÀèèèèèè$0eeeeeeeeeeeeeeeeeeeeee0é¢èèÀÌ`,eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeÙ¢Àèá‡wxƒƒƒn@@ƒ€ƒƒƒƒƒƒoêÞèèèèèÀeeeeeeeeeeeeeeeeeeeeeee`è¢]\,eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0ÞÙ†w€ƒ€€€€ƒƒƒƒƒƒoå»èèÀøeeeeeeeeeeeeeeeeeeeee,WÇèÀ]eeeeeeeeeeeeeeeeeeeee,,,,,eeeeeeeeeeeeeee%ÝÀ¢Ú†‚xƒƒƒƒƒƒƒƒƒ'ê»ÀèÀÀÀÀõ,eeeeeeeeeeeeeeeeeee,\ÚÀèÀöWeeee,,eeeeee,,,,,,,,,,,,,,,,,,e,,,,,e,,e,eÙ‰ÞÙô wwxx€xxxƒoôãÞèèÞ¢ÀèÇÇÇÇÀÞ¢Jeeeeeeeeeeeeeeeeeeee`‰èÞé]\,,,e,,,,,J,,,,,,,,,,,,,,,,,,e,,,,,e,,,,,0Ù¢ÀèÞúô +o ooæ饢À¢Çêåô + +ôêÙ¢‰0eeeeeeeeeeeeeeeeeeW è]e,e,e,,,,J!ee,,,,,,,,,,,,,,,,e,,,,,e,,,,e,eéÀÀÞâÓéññçã»Þ¢À‰Çæ + w†wwww† å‰eeeeeeeeeeeeeeeeee\ÙÀÇ`,e,,,,,,eJee,,,,,,,,,,,,,,,,e,,,,,e,,e,,,ee"êèÀÀÀ¢ÞÞÞÞÀÀ‰ê +‡†w€k€kk‚wwô¿¢öeeeeeeeeeeeeeeeee0`ꢉÝWee,,,,,,eJ!e,,,,,,,,,,,,,,,,,e,,,,,e,,e,,e,eeeÇÀÀÀÀꇆ€nn€ƒ€€rw†ôÇ¢èJeeeeeeeeeeeeeeee`À‰`\,,,,,,,,ee,e,,,,,,,,,,,eeeeee,e,,e,,e,,,,,,eeÙÀÀ¢ê ‡w€n'€ƒ€€x€k‚†æÀ0eeeeeeeeeeeeee,\ è‰]0,,,,,,,e&!e,e,,,,,,ee,JJee,,e,,,,,,,,e݉ÀÞÇð‡wƒ'€ƒ€€€€rrw éÞÀøeeeeeeeeeeeeee,\lj]e,,,,,,ee  e,e,,,,,e,èÀ¢ÞÀõ&eee,,,,,,,,,e"ÀÀÀÞ准‚ƒƒn''€ƒƒƒ€ƒ€€w Àeeeeeeeeeeeeee,\ø‰`e,,,,,,e$Je,,,,,e"ö‰¢ÀÀÀÀÀÀÀÀ¢Àø$e,,,,,,,,,,eeÇ¢ÀÀÀÇð‡w€ƒ€ƒnnnƒƒƒƒƒƒ€€x‚oÝÞ‰Jeeeeeeeeeeeee,0ÚŠ],,,,,,,, ee Je,,,eøŠÀÀÀÀÀÀÀÀ¢Àe,,,,,,,,,ee0Ù¢ÀÀÀÀ݆‚ƒƒƒƒ€€€ƒƒƒƒƒƒƒ€€€‚wå¢Àèeeeeeeeeeeeeee0Ýè`,,,,,,,,J,,b$,,,eÇ¢ÀÀÀÀÀŠŠÀÀò»ÀÀøee,,,,,,,,eeeé‰ÀÀÀÀÀÀÀÀÀꇆƒƒƒƒƒƒƒƒƒƒƒƒƒƒ€€€€wæ¢ÀÀeeeeeeeeeeeeeee`éÇW,,,,,,,,,e,,,,ee,,,e¼‰ÀÀÀÀÌùtò»‰èJe,,,,,,,,,,e"¢ÀÀÀÀÀÀ¢æ‡wƒƒƒƒƒƒƒƒƒƒƒƒƒƒ€€€xwæÀÀÀeeeeeeeeeeeeeee`ÌW,,,,,,,,,,,,,,,,,,e"Ù¢ÀÀÀÀÚqss{uuut÷ÀÀ!e,,,,,,,,,,,eÇÞÀÀ¢æ‡†xƒƒƒƒƒƒnƒƒƒƒƒƒƒƒ€€€‚ôÞÀeeeeeeeeeeeeee,`ø\,,,,,,,,,,,,,,,,,,H‰ÀÀÀÀé(ss{tuv|||v{÷¢ø,,,,,,,,,,,eeÚÀÀÀÀÀÀÀ¢å‡†€ƒƒƒƒn n€ƒƒƒƒƒƒx€w墢eeeeeeeeeeeeee,`Ý\,,,,,,,,,,,,,,,,,eÀÀÀÀŠqsss{uv|||||v{÷Š‰è,e,,,,,,,,,,eé‰ÀÀÀÀÀ¢é†‚ƒƒ€ƒ n€ƒƒƒƒƒxxrê¢Àe,e,eeeeeeeeee,W`\,,,,,,,,,,,,,,,,,Hé¢ÀÀÀ¢êpsss{suv||||||tsòÀÀ¢À!e,,,,,,,,,,e"¢ÀÀÀÀÀÀÇ +‡wƒƒ€€@€ƒƒƒƒƒƒƒÇÞÀee,,,,,eeeeeee,W ]0,,,,,,,,,,,,,,,,eèÀÀÀ¢Ì #sssss{uu|||||vu{sÀÀÀ¢øee,,,,,,,,,eeÇÀÀÀÀÀ¢å†wxƒ€ƒ @€ƒƒƒƒƒƒƒwæ¢Àe,,,,e,,eeeeee,\]\,,,,,,,,,,,,,,,,e‰ÀÀÞ‰æqssss{{tuv||||uu{stóÀÀÀÀ¢õ,e,,,,,,,,,,eÝ¢ÞÀÀ¢Ì +‡‚ƒƒ€ƒn@nƒƒƒƒƒƒƒƒ‚ÌÀÀö!e,,,,e,,,e,eee,W \,,,,,,,,,,,,,,,,H¢ÀÀÞÇ ssssss{{uuvvvvu{{ssŠÀÀÀÀ¢$e,,,,,,,,,,eéÀÀÀÀÀ¢ê †ƒƒƒƒ€€€ƒƒƒƒƒƒo颢,e,,,,e,,,,,,ee,Wø\,,,,,,,,,,,,,,,,HÚ¢ÀÀ¢é)ssss{ss{{tuuut{{sssŠÀÀÀÀÀ‰¢e,,,,,,,,,,eHè¢ÀÀÀÞå †‚ƒƒƒƒƒƒƒƒƒƒƒ‚'ê¢ÀÀèe,,,,,e,,,,,,,,,WÇW,,,,,,,,,,,,,,,b"Ú¢ÀÀ¢åpsssssss{{{{{s{{ssss‰ÀÀÀÀÀÀÞ¢öbe,,,,,,,,,eHÇÞÀÀÀÀê +†wƒƒƒƒƒ€xxx é¢À‰Je,,,,,e,,,,,,,,,`èW,,,,,,,,,,,,,,,b"Ì¢ÀÀ¢åqssssssss{{{{{{sssss)èÀÀÀÀÀÀÀÀ¢è&e,,,,,,,,,,eÚŠÀÀÞ¢ãæo ‚‚‚ƒ€o' å¼¢ÀÀÀèe,,,,,,e,,,,,,,,,`éè`bbb,,b,,,,,bb,,,"ø¢ÞÞ¢æ)qssssssssssssssssssÞÀÀÀÀÀÀÀÀÀ¢À,,,,,,,,,,,e"ÀÀÀÀ¢¢Óçåæææñ㥢ÞÀÀÀÀÀe,,,,,,,e,,,,,,,,e`é‰`,bbb,bbbbbbbbb,,H¢ÞÞ¢å)qqsssssssssssssssssÀÀÀÀÀÀÀÀÀÀÀÀ¢öbe,,,,,,,,,eHÇ¢ÀÀÀÞÞÞâ¾¾ÞÞ¢ÀÀÀÀÀÀ»,e,,,,,,,e,,,,,,,,eÝ¢`ebbbb,bbbbb,bbbbHé¢ÀÞ¢é#sqssssssssssssssssqÀÞÀÀÀÀÀÀÀÀÀÀÀ¢èJe,,,,,,,,,,eÙ¢ÞÀÀÀÀÀÀÀÀÀÀÀÀÀ¢À,e,,ee,,,,eee,,,,,,\Ù¢`eb,bb,bbbbbb,bbbe‰ÞÞ¢Ç sqqqssssssssssssqq)‰ÞÞÞÀÀÀÀÀÀÀÀÀÀ¢À,,,,,,,,,,,eé¢ÀÀÀÀÀÀÀÀÀÀÀ‰Àö,e,,,Je,e$!ee,,,,\Ì¢`ebbbbbbbbbbb,bbb,è¢ÞÞ¢å(qqqqqsssssssssssmÀÀÞÞÞÞÞÞÞÞÀÀÀÀÀÀÀ¢ø,e,,,,,,,,,e&Ú¢¢¢¢¢¢‰¢¢ÀÀö!e,,,,,ee0e,,,,,W Ç›`0bbbbbbbbbbbbbbbbHé¢ÞÞ¢¼ qqqqqqqqssssssss)ÀÞÞÞÞÞÞÞÞÞÀÞÞÀÀÀÀÀ‰è$e,,,,,,,,,,e"Úõ¼èöö!,e,,,,,,!e,,,,,\¢ø\bbbbbbb,bbbbbbbbe¢ÞÞªésqqqqqqqqqss{{tŠÞÞÞÞÞÞÞÞÞÞÞÞÞÞÀÞÀÀÞ¢‰e,,,,,,,,,,,ee"!,ee,,,,,,,eJ e,,e,,,WÀ¢WbbbbbbbbbbbbbbbbbH¢¢Þ¢¢é)q)qqqqqs{{uuÞÀÞÞÞÞÞÞÞÞÞÞÞÞÞ¢ÞÞ‰ÀÞÞÀ¢øe,,,,,,,,,,,,,eeeeee,,,,,,,,,,,e ! e,,,,ee`颢¢`e8bbbbbbbbbbb,bbbb&Ú¢¢¢¢¢Ú(qqm)m)q{uÞÀÞÞÞÞÞÞÞÞÞÞÞÞ¢¢¼ÞÞÀÀ‰À¢èJe,,,,,,,,,,,,,,,,,,,,,,,,,,,,e e !,,,,,,\ÇÀ¢¢\bbbbbbbbbbbbbbbbbbǪ¢¢¢¢è()p)))÷»¢ÞÞ¢ÞÞÞÞÞÞÞÞ¢ÀÚêŠÀ¢¢$e,,,,,,,,,,,,,,,,,,,,,,,,,,,,J e,,,,,,WÀÞ¢è\bbbbbbbbbbbbbbbbbbbø¢¢¢¢¢¢èÞ‰¢ÞÞÞÞÞÞÞÞÞÞÞÞªÙå#(qssss{tÀ¢¢ø,e,,,,,,,,,,,,,,,,,,,,,,,,,,e,,,,,,,`¢ÀÞ¢¢`,bbbbbbbbbb,bbbbbbb,"¢¢¢¢¢¢¢‰ÀÞ¢‰¢¢ÞÞÞÞÞÞÞÞ¢ÞÞÞ¢Þê psssssttuutt‰‰¢èb,,,,,,,,,,,,,,,,,,,,,,,,,,,&$e,,,,,0ÌÞÀ¢¢›`0bbbbbbbbbbbbbbbbbbbbJ袢¢¢¢¢¢¢¢¢¢Þ¢¢¢¢¢ÞÞÞÞÞÞ¢Þésssss{tuv|||utÞ‰¢Àe,,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,,,,,\ ÀÀ¢¢›Ç\bbbbbbbbbbbbbbbbbbbbbbø¢¢¢¢¢¢¢¢¢¢¢Þ¢¢¢¢¢ÞÞÞÞ¢ªÚssssss{tuv||||v{‰Þ¢ö!e,,,,,,,,,,,,,,,,,,,,,,,,,,eee,,,,,,,`¢À¢¢¢¢`bbbbbbbbbbbbbbbbbbbbbb,¢›¢¢¢¢¢¢¢ÞÞ¢ÞÞÞ¢Þ¢¢¢¢ôpssssss{tu||||||utòÀÀ¢b,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0¢À¢¢¢›`,8888>88bbbbbbbbbbbbbbbbJ袢¢¢¢¢¢¢¢¢¢ÞÞ¢Þ¢¢¢ªé'ssssss{{tv||||||u{ŠÞ¢ø!e,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\ èÀÀÀ¢¢¢›ö\88888888>b8bbbbbbbbbbbbbeÚ¢ª¢¢¢¢¢¢¢¢¢¢¢¢¢Þ¢Þô(ssssss{{tuv||||vustèÀ¢Þe,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,W¢ÀÀÀ¢¢¢¢¢Wb888888888888bbbbbbbbbbbbb&À›¢¢¢¢¢¢¢¢¢¢¢¢¢¢Çssssssss{{tuv||vut{q¢Þ¢,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0Ý¢ÀÀÀ¢¢¢¢›ø\D>>8888>88>88888bbbbbbbbbbbö›¢¢¢¢¢¢¢¢¢¢¢¢ªÚ +ssssssss{{tuuuuuts{s‰¢¢b,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,WÞÀÀÀÀ¢¢¢¢ª¢`8D8D888>8888888888bbbbbbbbb,¢›¢¢¢¢¢¢¢¢¢¢ïé'ssssssssssst{{{{{{{s‰Þ¢øJ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\¢ÀÀÀÀª¢¢¢ª›ø%\>D>>>8>>D>8>88>8888888bbbbbb&蛢¢¢¢¢¢¢¢¢ªÝsqsssss{ssss{{{{{ss{ÀÞ¢õ!b,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,W‰ÀÀÀÀÀªªª¢¢ª›W,DD>>>>>D>>D88888888888b8bbbb,ö›¢¢¢¢¢¢¢¢¢Ìqqsssssssssss{{sssss¢Þ¢ö$b,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\Ù¢ÀÀÀÀÀªªªªªª›è\DDDD>D>>888D88888888888bb8bbb,¢›¢¢¢¢¢¢¢¢ "qqqqsssssssssssssssq¢Þ¢øJb,b,b,,,,,,,,,,,,,,,,,,,,,,,,,,WÞÀÀÀÀÀªªªªªªª­WbIDDIDDD>>D>>88>8888888888bbbbb$¢¢¢¢¢¢¢›å(qqqqssssssssssssssÀ¢Þ¢>b,b,bb,,,,,,,,,,,,,,,,,,,,,,,,\Ç¢ÀÀÀÀÀªïïï着­ó"\DIDDDDDDDDD>D>>888>88888b88b8bb,ö›¢¢¢¢¢ïø qqqqssssssssssssss¢¢Þ¢,b,b,bbb,,,,,,,,,,,,,,,,,,,,,,,`¢ÀÀÀÀÀ¼ïïïïïïïï­`8IDDDDDDDDDD>D8D8DD888888888bb8b,¢›¢¢¢¢ªå%#qqqqqsssssssssss÷¢Þ¢»e,,b,bbb,bb,,,,,,,,,,,,,,,,,,,W¿¢ÀÀÀÀÞèÇïïïïïïïïµóWIIIIIDDDDDDDDD>8>D888888888888bb,J»¢¢¢¢ª))qqqqsssssss{st‰Þ¢›ø$bb,b,bbb,bbb,,,,,,,,,,,,,,,,,e`‰ÀÞÞÞ޼ǭï­ï­­ïï­š`eIKIIIDDDDDDDDDDD>>D8>8>88888888bbeø¢¢õ)qqqqqqssss{uu¢ÞÞ¢¢bbb,b,bbb,bbbbbb,,,,,,,,,,,,,,`è¢ÞÞÞÞÞè¼Ç­­­­­­­ïï­­`bIKIIIIIDDDDDDDD>D8>>8>88888888b8b,¢›¢¢ïè#mqmmmmqs{uu¢¢Þ¢›ø!ebb,b,bbb,bbbbbbbbb,,,,,,,,,,\ø¢ÀÞÞÞÞ¼ÇÌ­­­­­­­­­­µ¢W8LKKIIIIIIIDDDDDDDD>>>>>>88888888bbJ蛢¢¢¢Ù #)pmmmq÷‰Þ¢¢¢»bbbb,b,bbb,bbbbbbbbb,,,,,,,,,e`é›ÀÞÞÞÞÀ¼ÇÇÙ­­­­­­µ­­­­µóWILKKIKIIIIIDDDDDDDD8>>>D888888888bb,ø¢ª¢¢ª¢õùÞ¢¢¢¢¢¢¢bbbbb,b,bbb,bbbbbbbbbb,,,,,,,0`ªÀÞÞÞÞÞÀ¼ÇÌÝ­µµµµ­­­­µ­­šö\KLLKKIKIIIIIDDDDDDDDD8D88>88888888b,À›¢¢¢››¢¢¢¢‰¢¢¢¢¢¢›¢bbbbbbbb,bbb,bbbbbbbbbbb,b,,,eWÀ¢ÀÞÞÞÞÀ¼ÇÙéµµµµµµµµµµµµ­š%eLLLLKKKKKIIIIIIDDDDDD8D888>88888b8bbb›ª¢¢¢¢¢¢¢¢¢¢¢¢¢ªèbbbbbbbbbbbbb,bbbbbbbbbbb,bbb,Wè¢ÀÀÞÞÞÀ¼ÇÌÝåµµµµµ´µµ´µµµµµšWbMLLLLLKKKIIIIIDDDDDDD>DD>8888888888bbÞ››¢¢¢¢¢¢¢¢¢›‰bbbbbb bb$ $,,bbbbbbbbb,bbbWÇ¢ÞÞÞÞÞÀ¼¼ÇÙéå´´µ´µµµµµµµµµµšïW$MMLLLKKLKKKIIIIIDDDDDDD>>D8>888888bbbJ󉛭­­ï›¢ó$bbbbbbbIe  ,,,bbbbbbbbb,bb\¢ÞÞÞÞÞÞÀ¼¼ÇÌéåæ´´´´´´´´´µµ´µµµ´Þ\KMMLLLLLKKIKIIIKIDDDDDDDD>>8>88888b8bbbb8bbbbbbbbbb  $bbb,bbbbbbbb,b\¢¢ÞÞÞÞ¢À¼¼ÇÌÝêæñ´³³³´³³³´´´´´´µµ³òWDMMMLLLLLKKKIIIIIIDDDDDD>>D888888888bbbbbbb>>bbbbbbbbbbbbbbbDbbbbbbbbbbbbbb\`¢¢ÞÞÞÞÞÞ¼ÇÌÚêæåü³³³³³³³³³³³´³´´´´³ÞW>MMMMMLLLKLKIKIIDIIDDDDDD>>>88888888bbbbbbbbbbbbbbbbbbbbbbb, ,bbbbbbbbbbbb,\¢¢¢ÞÞ¢ÞÞèÇÇÚéæåþü²²²³³²³³´³³³³³´³´´³­`,MMMMMMLLLLLKKKIIIDDDDDD>>>D888888888bbbbbbbbbbbbbbbbbbbbbb 8bbbbbbbbbbb,WÚ¢¢Þ¢ÞÞÞÞè¼ÇÙéåæúüü²²²²²²²²²²³³³³³´³³³³µ%\LMMMMMMLLLLKKKIIIDDDDDDD>D88>88888888bbbbbbbbbbbbbbbbbbb!,bbbbbbbbbe`ö¢ÞÞÞ¢ÞÞÞÀè¼ÇÌÝåæçëüü·²²²²²²²²²²²²²²³³³³³²²"\LMMMMMLMLLKKKIKIIIDDDD>D>>>>8888888bbbbbbbbbbbbbbbbbbb8 bbbbbbbb0Wè›Þ¢¢ÞÞÞÞÀ¼ÇÇÝêæñëüüü··²²·²²²²²²²²²²²²³²³³²²ó\IMMMMMMLLLLLKKKIIIIDDDDD>>>D88888888bbbbbbbbbbbbbbbbb>b bbbbbbb\WÞ¢¢¢¢Þ¢¢ÞÞè¼ÇÚêæñüüüüü······²²·²²²²²²²²²²²´³³²÷\iMMMMMMMMLLLLKLIIIIDDDDD>>D8>8888888bbbbbbbbbbbbbbbb$$bb8bbbbb,\¢¢¢¢¢¢¢¢¢Àè¼ÇÙéæåþüüüüü¸····²···²²·²²²²²²²²²²²´²­%,LMMMMMMMLLLLKIIIIDDDDDDDD>D8888888b8bbbbbbbbbbbbbbb,bbbb,bbbbb0`ø¢¢¢¢¢¢¢¢¢Þè¼¼ÇÙéååþüüüüüü····¸·········²²²²²²²³²²³²´ø%,LMMMMMMLLLLLIIKIIDDDDD>>>D88888888bbbbbbbbbbbbbbbbbbbbbbbb0Wõ›¢¢¢¢¢¢ÞÞÀè¼ÇÙÝåæúüüüüüüü¸¸¸¸¸¸¸·¸¸······²·²²²²²²²³²²µ0bLMMMMMLLLLKLKIKIIDDDD>>>88888888888bbbbbbbbbbbbbbbbbbbeW%öª›¢¢Þ¢¢¢ÞÞÀè¼ÇÙéêæçëüüüüüüü¸¸¸¸¸¸¸¸¸¸·¸·····²··²··²²²²³²²ï\8LMMMMMLLLLIKIIDIDDDDD>>888888888b8bbbbbbbbbbbbbbbbeW%¢›¢¢¢¢¢¢¢¢Àè¼ÇÙéåæçüüüüüüüüü¸¸¸¸¸¸¸¸¸¸¸¸¸··¸······²²²²²²²³²²ï\8LMMMMLLLLLIIIIDDDDD8D8>8888888b8bbbbbbbbbbbbbb,\¢›¢¢¢¢¢¢¢¢¢ÀÀèè¼ÇÚéåææúüüüüüüüüü’¸¸¸’¸¸¸¸¸¸¸¸¸¸¸¸¸····²·²²²²²²²²²²Þ"\bILMMLLLLKKIIIIDDD>DD888888888bbbbbbbbbbbb,e\W¢›¢¢¢¢¢Þ¢¢¢ÞÀÀè¼ÌÚêåææåñþüüüüüüüü’’’’¸¸’¸¸¸¸¸¸¸¸¸¸·¸¸····²²··²²²³²²²²òH0bDIMLLLIILIDDDDDDD>8D88888888bbbbbbb,\\WÞ›¢¢¢¢¢¢¢¢¢¢¢Àè¼ÌÝêæææñææúüüüüüüüü’’’’’’’’¸’¸¸¸¸¸¸¸¸¸¸·¸······²²²²²²´²²²ïöH\e8IKLKKKIIDDDDDD8D8888888888bbe\\Wö¢›ª¢¢¢¢¢¢¢¢¢ÞÞÀèèÇÌÝêææååæáæ}üüüüüüüü’’’’’’’’’’’¸’¸¸¸¸¸¸¸¸¸¸··²····²²²²²²³³³²²­õ"\0,biiDDDIDDIDI>Di888bbb,e0\%ó¢››¢¢¢¢¢¢¢¢¢¢¢ÞÀÀèèÇÚÝåææååæáæúüüüüüüüüü’’’’’’’’’’’’’’¸’’¸¸¸¸¸¸¸¸·¸····²²²²²²²´³³³²²µò"%H\\\\eee,,,e0\\\\\%"øÞï›ï¢¢¢¢¢¢¢¢¢¢¢¢¢ÞÀèèÇÚéåææåñôðæþëüüüüüüüüü’’’’’’’’’’’’’’’’¸¸¸’¸¸¸¸¸·¸·¸²·²·²²³²³²³³´´´´´ššÞóø""%"øøè¢ï›ªª¢¢¢¢¢¢¢¢¢¢¢¢¢ÞÀè¼¼ÌÝêåæåååôáñüëüüüüüüüüüü’’’’’’’’’’’’’’’’’’’’¸¸¸¸¸¸¸·······²²²²²³³³³´´´µµµ´ššššµµªÞóõöõ»Þª­››µ››ïª¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢ÞÀÀè¿ÇÙéêåæåååááçüüüüüüüüüüüüüm ÿÿÿÿ0  + + + Snes9x + + + + + +¼ ÿÿÿÿ0¼4VS_VERSION_INFO½ïþ?StringFileInfoö080904b0>CompanyNameGary Henderson8FileDescriptionSnes9XW*FileVersion1.40.InternalNameSnes9XPLegalCopyrightCopyright © 1996-2001@ OriginalFilenameSnes9XW.exeJProductNameSnes9X SNES Emulator.ProductVersion1.40DVarFileInfo$Translation ° 4TEXTINCLUDEÿÿ0resource.h+4TEXTINCLUDEÿÿ0#include "afxres.h" +#include "language.h"4TEXTINCLUDEÿÿ0 +  ÿÿÿÿf0&Bestandá&Openen€Aœ&Sluiten&Opties€VœJoypad configuratie&Geluid&8-BitEœ8000 Hz, monoMœ8000 Hz, stereoFœ11025 Hz, monoNœ11025 Hz, stereoGœ22050 Hz, monoOœ22050 Hz, stereoHœ44100 Hz, mono€Pœ44100 Hz, stereo&16-BitIœ8000 Hz, monoQœ8000 Hz, stereoJœ11025 Hz, monoRœ11025 Hz, stereoKœ22050 Hz, monoSœ22050 Hz, stereoLœ44100 Hz, mono€Tœ44100 Hz, stereo€Uœ&Geen Geluid&Venster&TaalBœ&EnglishˆCœ&Nederlands€Dœ&Verberg menubalk ESC’ ÿÿÿÿe0 &FileáL&oad Game... Ctrl+ORecent &Games‚šœDummy&Save Game PositionmœSlot #1 Shift+F1nœSlot #2 Shift+F2oœSlot #3 Shift+F3pœSlot #4 Shift+F4qœSlot #5 Shift+F5rœSlot #6 Shift+F6sœSlot #7 Shift+F7tœSlot #8 Shift+F8uœSlot #9 Shift+F9&Load Game PositionvœSlot #1 F1wœSlot #2 F2xœSlot #3 F3yœSlot #4 F4zœSlot #5 F5{œSlot #6 F6|œSlot #7 F7}œSlot #8 F8~œSlot #9 F9‚œS&ave SPC Data™œSa&ve S-RAM Data›œSave SPC&7110 logžœROM Information...±œMovie Play...³œMovie Record...²œMovie Stop´œRecord AVI...µœStop AVI RecordingYœ&Reset GameZœ&Pause Pause€AœE&xit Alt+F4&OptionsXœ&Display Configuration... Alt+F5†œ&Settings... Alt+F8œSPC7110 Cache Settings...€¬œGFX Pack Configuration...&InputVœ&Joypad Configuration... Alt+F7¶œCustomize Hotkeys...¨œEnable Multitap 5©œEnable MouseªœEnable Superscope€­œEnable Justifiers&Sound&Playback RateUœ&No Sound Alt+0aœ8KHz Alt+1bœ11KHz Alt+2–œ16KHz Alt+3cœ22KHz Alt+4eœ30KHz Alt+5Ÿœ32KHz Alt+6—œ35KHz Alt+7dœ44KHz Alt+8•œ48KHz Alt+9&Buffer Lengthkœ&10msfœ&20msgœ&40mshœ&80msiœ1&60msjœ&320mslœ64&0ms^œ&16-Bit Sound_œ&Stereo˜œ&Reverse Stereo Alt+R«œCatch-up Sample Generation[œ&Interpolated Alt+[\œS&ync Sound Alt+]€„œ&Settings... Alt+T&Window&LanguageBœ&EnglishCœ&NederlandsDœ&Hide menubar ESC]œ&Full Screen Alt+Return€`œ&Stretch Image Alt+Del&Cheatœ&Game Genie, Pro-Action Replay Codes Alt+E€œ&Search for New Cheats Alt+A œ&Apply CheatsœœSet SPC7110 RTC&NetplayŽœ&Connect to Server...œ&Disconnect from Serverœ&Act as Server’œ&Re-sync all Clients Using Freeze File Now‘œ&Send ROM Image to Clients Now“œS&end ROM Image to Clients”œS&ync Using Reset Game€œ&Options...&Help€ƒœ&About...œ$HWBÿÿcDHWBÿÿ ê…ÌHWBÿÿÈ0 ܆HWBÿÿÉ0  3ˆHWBÿÿÊ0 7H»HWBÿÿ/0 ¤¼HWBÿÿ-0 mè¿HWBÿÿ.0 4 -ÿÿÿÿ t.ÿÿ ÿÿe0 ø¨.ÿÿ ÿÿg0 ºÀ/ÿÿÿÿf0 èœ7ÿÿÿÿe0 |¤9ÿÿÿÿg0 ž@@ÿÿÿÿh0 ¬Aÿÿÿÿi0 ÌAÿÿÿÿj0 ¢ðFÿÿÿÿk0 J´Iÿÿÿÿl0 Z Oÿÿÿÿn0 öœSÿÿÿÿ{0 \´Zÿÿÿÿo0 ¸0^ÿÿÿÿ|0 Z_ÿÿÿÿ}0 H„gÿÿÿÿ0 ¦ìmÿÿÿÿ‚0 ´nÿÿÿÿƒ0 ˆ èpÿÿÿÿ†0  zÿÿÿÿ‡0 jP€ÿÿÿÿˆ0 rÜÿÿÿÿm0 £p’ÿÿðÿÿf0 \4•ÿÿðÿÿ}0 èÔ•DESIGNINFOGUIDELINES0 èÜšÿÿÿÿ ¨äÿÿÿÿ "¬¦ÿÿÿÿe0 (ð¦ÿÿÿÿo0 (8¬ÿÿÿÿp0 (€±ÿÿÿÿq0 (ȶÿÿÿÿr0 (¼ÿÿÿÿs0 h<XÁÿÿÿÿ…0 màýÿÿÿÿ0 ¼pÿÿÿÿ0 `TEXTINCLUDEÿÿ0+ TEXTINCLUDEÿÿ0TEXTINCLUDEÿÿ0 $ÿÿÿÿf0’ äÿÿÿÿe0  \ No newline at end of file diff -NaHudr snes9x-1.43-src/snes9x.dsw snx/snes9x.dsw --- snes9x-1.43-src/snes9x.dsw 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x.dsw 2005-03-20 23:46:36.000000000 +0200 @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "Snes9X"=.\Snes9Xw.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff -NaHudr snes9x-1.43-src/snes9x.exe.manifest snx/snes9x.exe.manifest --- snes9x-1.43-src/snes9x.exe.manifest 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x.exe.manifest 2005-03-20 23:46:36.000000000 +0200 @@ -0,0 +1,22 @@ + + + + Snes9x + + + + + + \ No newline at end of file diff -NaHudr snes9x-1.43-src/snes9x.rc snx/snes9x.rc --- snes9x-1.43-src/snes9x.rc 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9x.rc 2005-03-21 14:00:47.000000000 +0200 @@ -0,0 +1,1508 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" +#include "language.h" +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Cursor +// + +IDC_CURSOR_SCOPE CURSOR "nodrop.cur" + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +IDR_SNES9X_ACCELERATORS ACCELERATORS +BEGIN + "0", ID_SOUND_NOSOUND, ASCII, ALT, NOINVERT + "1", ID_SOUND_8000HZ, ASCII, ALT, NOINVERT + "2", ID_SOUND_11025HZ, ASCII, ALT, NOINVERT + "3", ID_SOUND_16000HZ, ASCII, ALT, NOINVERT + "4", ID_SOUND_22050HZ, ASCII, ALT, NOINVERT + "5", ID_SOUND_30000HZ, ASCII, ALT, NOINVERT + "6", ID_SOUND_32000HZ, ASCII, ALT, NOINVERT + "7", ID_SOUND_35000HZ, ASCII, ALT, NOINVERT + "8", ID_SOUND_44100HZ, ASCII, ALT, NOINVERT + "9", ID_SOUND_48000HZ, ASCII, ALT, NOINVERT + "A", ID_CHEAT_SEARCH, VIRTKEY, ALT, NOINVERT + "E", ID_CHEAT_ENTER, VIRTKEY, ALT, NOINVERT + "O", ID_FILE_OPEN, VIRTKEY, CONTROL, NOINVERT + "R", ID_SOUND_REVERSE_STEREO, VIRTKEY, ALT, NOINVERT + "T", ID_SOUND_OPTIONS, VIRTKEY, ALT, NOINVERT + VK_DELETE, ID_WINDOW_STRETCH, VIRTKEY, ALT, NOINVERT + VK_DELETE, ID_TURBO_R, VIRTKEY, SHIFT, NOINVERT + VK_END, ID_TURBO_B, VIRTKEY, SHIFT, NOINVERT + VK_F12, ID_SCREENSHOT, VIRTKEY, NOINVERT + VK_F5, ID_OPTIONS_DISPLAY, VIRTKEY, ALT, NOINVERT + VK_F7, ID_OPTIONS_JOYPAD, VIRTKEY, ALT, NOINVERT + VK_F8, ID_OPTIONS_SETTINGS, VIRTKEY, ALT, NOINVERT + VK_HOME, ID_TURBO_Y, VIRTKEY, SHIFT, NOINVERT + VK_INSERT, ID_TURBO_L, VIRTKEY, SHIFT, NOINVERT + VK_NEXT, ID_TURBO_A, VIRTKEY, SHIFT, NOINVERT + VK_PRIOR, ID_TURBO_X, VIRTKEY, SHIFT, NOINVERT + VK_RETURN, ID_WINDOW_FULLSCREEN, VIRTKEY, ALT, NOINVERT + "[", ID_SOUND_INTERPOLATED, ASCII, ALT, NOINVERT + "]", ID_SOUND_SYNC, ASCII, ALT, NOINVERT + "{", ID_TURBO_SELECT, ASCII, NOINVERT + "}", ID_TURBO_START, ASCII, NOINVERT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_SOUND_OPTS DIALOGEX 0, 0, 352, 202 +STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | + WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU +CAPTION "Sound Settings" +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + GROUPBOX "Sound Quality",IDC_STATIC,7,7,168,167,0, + WS_EX_TRANSPARENT + GROUPBOX "Sound Emulation",IDC_STATIC,177,7,168,167,0, + WS_EX_TRANSPARENT + DEFPUSHBUTTON "&OK",IDOK,229,178,56,16 + COMBOBOX IDC_DRIVER,65,24,106,60,CBS_DROPDOWN | WS_VSCROLL | + WS_TABSTOP + LTEXT "Sound Driver:",IDC_STATIC,13,25,49,11 + COMBOBOX IDC_BUFLEN,65,72,106,101,CBS_DROPDOWN | WS_VSCROLL | + WS_TABSTOP + LTEXT "&Buffer Length:",IDC_STATIC,13,74,49,11 + COMBOBOX IDC_RATE,65,40,106,171,CBS_DROPDOWN | WS_VSCROLL | + WS_TABSTOP + LTEXT "&Playback Rate:",IDC_STATIC,13,41,49,11 + COMBOBOX IDC_MIX,65,56,106,154,CBS_DROPDOWN | WS_VSCROLL | + WS_TABSTOP + LTEXT "Mix Interval:",IDC_STATIC,13,57,49,11 + CONTROL "&16 Bit playback",IDC_16BIT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,13,92,158,10 + CONTROL "&Stereo",IDC_STEREO,"Button",BS_AUTOCHECKBOX | + BS_NOTIFY | WS_TABSTOP,13,108,158,10 + CONTROL "&Reverse Stereo",IDC_REV_STEREO,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,13,124,158,10 + CONTROL "Gaussian &Interpolation of Sample Data", + IDC_LINEAR_INTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 13,140,158,10 + CONTROL "&Generate sample data in sync with sound CPU", + IDC_SYNC_TO_SOUND_CPU,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,13,156,158,10 + CONTROL "&Volume envelope height reading",IDC_ENVX,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,183,19,141,12 + CONTROL "&Echo Effects",IDC_ECHO,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,183,58,141,12 + CONTROL "&Cache decoded samples",IDC_CACHING,"Button", + BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,183,71,141,12 + CONTROL "M&aster volume control",IDC_MASTER_VOL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,183,84,141,12 + CONTROL "Enable sound CP&U emulation",IDC_SPC700ON,"Button", + BS_AUTOCHECKBOX | BS_NOTIFY | WS_TABSTOP,183,136,141,12 + CONTROL "Anti-Resonance's sample &decoding method",IDC_ANTIRES, + "Button",BS_AUTOCHECKBOX | BS_NOTIFY | WS_TABSTOP,183, + 123,157,12 + CONTROL "&Mute sound",IDC_MUTE,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,183,97,141,12 + COMBOBOX IDC_SKIP_TYPE,249,152,94,59,CBS_DROPDOWN | WS_VSCROLL | + WS_TABSTOP + LTEXT "CPU &wait skip style",IDC_STATIC,183,152,64,13 + PUSHBUTTON "&Cancel",IDCANCEL,289,178,56,16 + CONTROL "&Fake Mute desync workaround",IDC_FMUT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,183,32,141,12 + CONTROL "&Use WIP1 timing",IDC_WIP1,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,183,45,141,12 + CONTROL "&Frame Advance mute",IDC_FAMT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,183,110,141,12 +END + +IDD_SPC7110_CACHE DIALOG 0, 0, 185, 92 +STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | + WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU +CAPTION "SPC7110 Pack Configuration" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,138,48,40,16 + PUSHBUTTON "Cancel",IDCANCEL,138,68,40,16 + CONTROL "Load All Data into RAM",IDC_SPC7110_ALL,"Button", + BS_AUTORADIOBUTTON,7,7,92,13 + CONTROL "Load Some Data into RAM",IDC_SPC7110_SOME,"Button", + BS_AUTORADIOBUTTON,7,26,101,13 + CONTROL "Read all data from file",IDC_SPC7110_FILE,"Button", + BS_AUTORADIOBUTTON,7,48,104,13 + EDITTEXT IDC_CACHE_MB,112,26,40,13,ES_AUTOHSCROLL | ES_NUMBER + CONTROL "Spin1",IDC_SPIN_CACHE,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | + UDS_NOTHOUSANDS,146,26,11,13 +END + +IDD_7110_RTC DIALOG 0, 0, 302, 148 +STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | + WS_CAPTION | WS_SYSMENU +CAPTION "SPC7110 RTC Control" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,192,127,50,14 + PUSHBUTTON "Cancel",IDCANCEL,245,127,50,14 + GROUPBOX "RTC Control Registers",IDC_STATIC,7,49,288,71 + CONTROL "30 ADJ",IDC_RTC_D8,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,70,62,53,10 + CONTROL "IRQ-F",IDC_RTC_D4,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,127,62,53,10 + CONTROL "CAL / HW",IDC_RTC_D2,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,184,62,53,10 + CONTROL "HOLD",IDC_RTC_D1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 242,62,45,10 + CONTROL "T1",IDC_RTC_E8,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,70,80,25,10 + CONTROL "T0",IDC_RTC_E4,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,127,80,25,10 + CONTROL "INT/STND",IDC_RTC_E2,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,184,80,51,10 + CONTROL "MASK",IDC_RTC_E1,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,242,80,36,10 + CONTROL "TEST",IDC_RTC_F8,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,70,98,35,10 + CONTROL "24/12",IDC_RTC_F4,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,127,98,35,10 + CONTROL "STOP",IDC_RTC_F2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 184,98,35,10 + CONTROL "RESET",IDC_RTC_F1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 242,98,40,10 + LTEXT "Register 0xD",IDC_STATIC,13,62,43,8 + LTEXT "Register 0xE",IDC_STATIC,13,80,41,8 + LTEXT "Register 0xF",IDC_STATIC,13,98,42,8 + CONTROL "Slider1",IDC_DAY,"msctls_trackbar32",TBS_BOTH | + TBS_NOTICKS | WS_TABSTOP,59,20,45,8 + CONTROL "Slider2",IDC_YEAR,"msctls_trackbar32",TBS_BOTH | + TBS_NOTICKS | WS_TABSTOP,106,20,42,8 + LTEXT "1",IDC_LBLDAY,74,28,18,8 + CONTROL "Slider1",IDC_MONTH,"msctls_trackbar32",TBS_BOTH | + TBS_NOTICKS | WS_TABSTOP,7,20,51,8 + CONTROL "Slider2",IDC_HOUR,"msctls_trackbar32",TBS_BOTH | + TBS_NOTICKS | WS_TABSTOP,160,20,42,8 + CONTROL "Slider2",IDC_MINUTE,"msctls_trackbar32",TBS_BOTH | + TBS_NOTICKS | WS_TABSTOP,203,20,42,8 + CONTROL "Slider2",IDC_SECOND,"msctls_trackbar32",TBS_BOTH | + TBS_NOTICKS | WS_TABSTOP,246,20,42,8 + LTEXT "1",IDC_LBLMONTH,20,28,26,8 + LTEXT "1995",IDC_LBLYEAR,116,28,27,8 + LTEXT "Month",IDC_STATIC,20,7,21,8 + LTEXT "Day",IDC_STATIC,71,7,14,8 + LTEXT "Year",IDC_STATIC,117,7,16,8 + LTEXT "Hour",IDC_STATIC,172,7,16,8 + LTEXT "Minute",IDC_STATIC,210,7,22,8 + LTEXT "Second",IDC_STATIC,252,7,26,8 + LTEXT "0",IDC_LBLHOUR,173,29,19,8 + LTEXT "0",IDC_LBLMINUTE,219,29,17,8 + LTEXT "0",IDC_LBLSECOND,257,28,18,8 +END + +IDD_ROM_INFO DIALOG 0, 0, 233, 185 +STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | + WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU +CAPTION "Rom Info" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,85,164,50,14 + EDITTEXT IDC_ROM_DATA,7,7,219,146,ES_MULTILINE | ES_READONLY + LTEXT "",IDC_WARNINGS,7,145,219,15,SS_CENTERIMAGE +END + +IDD_ABOUT DIALOGEX 0, 0, 232, 181 +STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | + WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU +CAPTION "APP - About Dialog" +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "OK",IDOK,90,160,50,14 + EDITTEXT IDC_DISCLAIMER,7,7,218,148,ES_MULTILINE | ES_NOHIDESEL | + ES_READONLY,WS_EX_STATICEDGE +END + +IDD_EMU_SETTINGS DIALOGEX 0, 0, 320, 113 +STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | + WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU +CAPTION "APP - Emulator Settings" +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + EDITTEXT IDC_FREEZE_FOLDER,91,6,163,14,ES_AUTOHSCROLL + PUSHBUTTON "&Browse...",IDC_BROWSE,264,5,48,14 + EDITTEXT IDC_AUTO_SAVE_DELAY,91,25,49,14,ES_AUTOHSCROLL | + ES_NUMBER + CONTROL "Spin2",IDC_SRAM_SPIN,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,302,29,11, + 13 + EDITTEXT IDC_MAX_SKIP,91,44,49,14,ES_AUTOHSCROLL | ES_NUMBER + CONTROL "Spin3",IDC_SPIN_MAX_SKIP,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | + UDS_ARROWKEYS,298,48,11,13 + EDITTEXT IDC_TURBO_SKIP,91,63,49,14,ES_AUTOHSCROLL | ES_NUMBER + CONTROL "Spin4",IDC_SPIN_TURBO_SKIP,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | + UDS_ARROWKEYS,296,72,11,13 + CONTROL "Toggled Turbo Mode",IDC_TOGGLE_TURBO,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,91,81,123,12 + PUSHBUTTON "&OK",IDOK,215,92,46,14 + DEFPUSHBUTTON "&Cancel",IDCANCEL,267,92,46,14 + RTEXT "Save Folder Directory",IDC_LABEL_FREEZE,7,7,76,14, + SS_CENTERIMAGE + RTEXT "Auto-Save S-RAM",IDC_LABEL_ASRAM,19,25,64,14, + SS_CENTERIMAGE + RTEXT "Skip at most",IDC_LABEL_SMAX,38,44,45,14,SS_CENTERIMAGE + RTEXT "Skip rendering",IDC_LABEL_STURBO,32,63,51,14, + SS_CENTERIMAGE + LTEXT "seconds after last change (0 disables auto-save)", + IDC_LABEL_ASRAM_TEXT,146,25,161,14,SS_CENTERIMAGE + LTEXT "frames in auto-frame rate mode",IDC_LABEL_SMAX_TEXT,146, + 44,138,14,SS_CENTERIMAGE + LTEXT "frames in Turbo mode",IDC_LABEL_STURBO_TEXT,146,63,92, + 14,SS_CENTERIMAGE + CONTROL "Pause When Inactive",IDC_INACTIVE_PAUSE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,91,94,100,12 +END + +IDD_OPEN_ROM DIALOGEX 0, 0, 416, 223 +STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | + WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | + WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU +CAPTION "Open ROM" +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + CONTROL "Tree1",IDC_ROM_DIR,"SysTreeView32",TVS_HASBUTTONS | + TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | + TVS_SHOWSELALWAYS | TVS_NOTOOLTIPS | WS_BORDER | + WS_TABSTOP,4,4,164,192,WS_EX_CLIENTEDGE + CONTROL "List1",IDC_ROMLIST,"SysListView32",LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | + LVS_OWNERDATA | WS_TABSTOP,171,4,239,192, + WS_EX_CLIENTEDGE + COMBOBOX IDC_MEM_TYPE,5,208,66,57,CBS_DROPDOWN | WS_TABSTOP + COMBOBOX IDC_INTERLEAVE,85,208,89,64,CBS_DROPDOWN | WS_TABSTOP + COMBOBOX IDC_VIDEO_MODE,182,208,58,61,CBS_DROPDOWN | WS_TABSTOP + COMBOBOX IDC_HEADER,246,208,73,44,CBS_DROPDOWN | WS_TABSTOP + DEFPUSHBUTTON "&Open ROM",IDOK,325,205,44,15 + PUSHBUTTON "&Cancel",IDCANCEL,370,205,44,15 + LTEXT "Interleave Mode:",IDC_STATIC,85,196,69,8,NOT WS_GROUP + LTEXT "Memory Type:",IDC_STATIC,5,196,58,11,NOT WS_GROUP + LTEXT "Video System:",IDC_STATIC,181,196,54,8,NOT WS_GROUP + LTEXT "Header:",IDC_STATIC,246,196,54,8,NOT WS_GROUP +END + +IDD_GFX_PACK DIALOG 0, 0, 219, 260 +STYLE DS_SETFONT | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | WS_POPUP | + WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "Graphics Pack Configuration" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_STAR_OCEAN,1,20,170,13,ES_AUTOHSCROLL + LTEXT "Star Ocean",IDC_STATIC,1,6,80,12 + PUSHBUTTON "Browse...",IDC_SO_BROWSE,173,18,45,14 + EDITTEXT IDC_FEOEZ,1,49,171,13,ES_AUTOHSCROLL + LTEXT "Far East of Eden Zero",IDC_STATIC,1,36,80,12 + PUSHBUTTON "Browse...",IDC_FEOEZ_BROWSE,173,47,45,14 + EDITTEXT IDC_MDH,1,78,170,13,ES_AUTOHSCROLL + LTEXT "Momotaro Densetsu Happy",IDC_STATIC,1,65,114,12 + PUSHBUTTON "Browse...",IDC_MDH_BROWSE,173,76,45,14 + EDITTEXT IDC_SPL4,1,106,170,13,ES_AUTOHSCROLL + LTEXT "Super Power League 4",IDC_STATIC,1,94,80,12 + PUSHBUTTON "Browse...",IDC_SPL4_BROWSE,173,105,45,14 + EDITTEXT IDC_SJNS,1,135,170,13,ES_AUTOHSCROLL + LTEXT "Far East of Eden Zero - Shounen Jump no Shou", + IDC_STATIC,1,122,166,12 + PUSHBUTTON "Browse...",IDC_FEOEZ_SJNS_BROWSE,173,134,45,14 + EDITTEXT IDC_SFA2,1,164,170,13,ES_AUTOHSCROLL + LTEXT "Street Fighter Alpha 2 (US)",IDC_STATIC,1,151,104,12 + PUSHBUTTON "Browse...",IDC_SFA2_BROWSE,173,164,45,14 + EDITTEXT IDC_SFA2E,1,193,170,13,ES_AUTOHSCROLL + LTEXT "Street Fighter Alpha 2 (E)",IDC_STATIC,1,180,80,12 + PUSHBUTTON "Browse...",IDC_SFA2E_BROWSE,173,193,45,14 + EDITTEXT IDC_SFZ2,1,225,170,13,ES_AUTOHSCROLL + LTEXT "Street Fighter Zero 2",IDC_STATIC,1,212,80,12 + PUSHBUTTON "Browse...",IDC_SFZ2_BROWSE,173,225,45,14 + PUSHBUTTON "OK",IDOK,133,244,40,14 + PUSHBUTTON "Cancel",IDCANCEL,178,244,40,14 +END + +IDD_NPOPTIONS DIALOGEX 0, 0, 187, 161 +STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | + WS_CLIPCHILDREN | WS_CAPTION +CAPTION "Netplay Options" +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + GROUPBOX "Port Settings",IDC_PORTNUMBLOCK,5,5,180,25,0, + WS_EX_TRANSPARENT + RTEXT "Socket Port Number",IDC_LABEL_PORTNUM,10,15,85,10, + SS_CENTERIMAGE + EDITTEXT IDC_PORTNUMBERA,100,15,25,12,ES_RIGHT | ES_AUTOHSCROLL + GROUPBOX "Client Settings",IDC_CLIENTSETTINGSBLOCK,5,35,180,40,0, + WS_EX_TRANSPARENT + RTEXT "Ask Server to Pause when",IDC_LABEL_PAUSEINTERVAL,10,45, + 85,10,SS_CENTERIMAGE + EDITTEXT IDC_PAUSEINTERVAL,100,45,30,12,ES_RIGHT | ES_AUTOHSCROLL + CONTROL "Spin1",IDC_PAUSESPIN,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | + UDS_NOTHOUSANDS | WS_TABSTOP,120,45,10,12 + LTEXT "frames behind",IDC_LABEL_PAUSEINTERVAL_TEXT,135,45,45, + 12,SS_CENTERIMAGE + RTEXT "Maximum Frame Rate Skip",IDC_LABEL_MAXSKIP,10,60,85,10, + SS_CENTERIMAGE + EDITTEXT IDC_MAXSKIP,100,60,30,12,ES_RIGHT | ES_AUTOHSCROLL + CONTROL "Spin2",IDC_MAXSPIN,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | + UDS_NOTHOUSANDS | WS_TABSTOP,120,60,10,12 + GROUPBOX "Server Settings",IDC_SERVERSETTINGSBLOCK,5,80,180,60,0, + WS_EX_TRANSPARENT + CONTROL "Send ROM Image to Client on Connect",IDC_SENDROM,"Button", + BS_AUTOCHECKBOX | BS_LEFT | BS_VCENTER | WS_TABSTOP,10, + 105,173,15 + CONTROL "Act as Server",IDC_ACTASSERVER,"Button",BS_AUTOCHECKBOX | + BS_LEFT | BS_VCENTER | WS_TABSTOP,10,120,174,15 + DEFPUSHBUTTON "OK",IDOK,80,145,50,14 + PUSHBUTTON "Cancel",IDCANCEL,135,145,50,14 + CONTROL "Sync By Reset",IDC_SYNCBYRESET,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,10,90,174,15 +END + +IDD_NEWDISPLAY DIALOGEX 0, 0, 337, 205 +STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | + WS_CLIPCHILDREN | WS_CAPTION +CAPTION "Display Settings" +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "OK",IDOK,5,179,50,14 + PUSHBUTTON "Cancel",IDCANCEL,60,179,50,14 + PUSHBUTTON "Test Mode",IDC_TESTMODE,290,140,39,14 + PUSHBUTTON "Set Mode",IDC_SETDMODE,290,160,39,14 + CONTROL "List1",IDC_VIDMODELIST,"SysListView32",LVS_REPORT | + WS_BORDER | WS_TABSTOP,185,15,145,120 + GROUPBOX "General",IDC_STATIC,3,5,88,65,0,WS_EX_TRANSPARENT + CONTROL "Show Frame Rate",IDC_SHOWFPS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,57,73,10 + CONTROL "Stretch Image",IDC_STRETCH,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,25,60,10 + CONTROL "Full Screen",IDC_FULLSCREEN,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,15,51,10 + CONTROL "Bi-Linear Mode 7",IDC_BILINEARMD7,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,100,45,69,10 + GROUPBOX "SNES Image",IDC_STATIC,95,5,75,65,0,WS_EX_TRANSPARENT + CONTROL "Render 16-bit",IDC_RENDER16BIT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,100,15,59,10 + CONTROL "Transparency",IDC_TRANS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,100,25,59,10 + CONTROL "Hi Res",IDC_HIRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 100,35,37,10 + GROUPBOX "Output Image Processing",IDC_STATIC,0,77,170,30,0, + WS_EX_TRANSPARENT + COMBOBOX IDC_FILTERBOX,5,87,160,90,CBS_DROPDOWN | WS_VSCROLL | + WS_TABSTOP + CONTROL "Automatic Frame Skipping",IDC_AUTOFRAME,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,5,114,98,10 + CONTROL "Use Frame Rate Limiter",IDC_LIMITFRAMES,"Button", + BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,5,124,89,10 + GROUPBOX "Fixed Frame Skipping Rate",IDC_STATIC,0,134,170,40,0, + WS_EX_TRANSPARENT + CONTROL "Slider2",IDC_FRAMERATESKIPSLIDER,"msctls_trackbar32", + TBS_AUTOTICKS | WS_TABSTOP,7,153,160,19 + GROUPBOX "Display Settings",IDC_STATIC,180,5,155,170,0, + WS_EX_TRANSPARENT + CONTROL "Enable Double Buffering",IDC_DBLBUFFER,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,185,140,93,10 + LTEXT "Current Mode: 1024x1024x16",IDC_CURRMODE,185,155,94,8 + LTEXT "0",IDC_STATIC,14,145,11,8 + RTEXT "9",IDC_STATIC,148,145,11,8 + CONTROL "Extend Height",IDC_HEIGHT_EXTEND,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,100,56,61,10 + CONTROL "Use Video Memory",IDC_VIDEOCARD,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,5,36,75,10 + CONTROL "Maintain Aspect Ratio",IDC_ASPECT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,5,47,81,10 +END + +IDD_CHEATER DIALOGEX 0, 0, 262, 218 +STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | + WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | + WS_SYSMENU +CAPTION "Cheat Entry and Editor" +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + CONTROL "List1",IDC_CHEAT_LIST,"SysListView32",LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | + WS_BORDER | WS_TABSTOP,5,5,200,125,WS_EX_CLIENTEDGE + PUSHBUTTON "&Add",IDC_ADD_CHEAT,215,5,40,15,WS_DISABLED + PUSHBUTTON "&Delete",IDC_DELETE_CHEAT,215,25,40,15,WS_DISABLED + PUSHBUTTON "&Update",IDC_UPDATE_CHEAT,215,45,40,15,WS_DISABLED + PUSHBUTTON "C&lear",IDC_CLEAR_CHEATS,215,65,40,15 + EDITTEXT IDC_CHEAT_CODE,86,134,118,15,ES_UPPERCASE | + ES_AUTOHSCROLL + EDITTEXT IDC_CHEAT_DESCRIPTION,85,154,119,15,ES_AUTOHSCROLL + EDITTEXT IDC_CHEAT_ADDRESS,85,175,44,15,ES_UPPERCASE | + ES_AUTOHSCROLL + EDITTEXT IDC_CHEAT_BYTE,215,175,26,15,ES_UPPERCASE | + ES_AUTOHSCROLL + PUSHBUTTON "&OK",IDOK,93,196,50,15 + PUSHBUTTON "&Cancel",IDCANCEL,151,196,50,15 + RTEXT "Enter Cheat Code:",IDC_LABEL_CHEAT_CODE,23,134,59,15, + SS_CENTERIMAGE + RTEXT "Cheat Description",IDC_LABEL_CHEAT_DESCRIPTION,19,154, + 61,15,SS_CENTERIMAGE + RTEXT "Cheat Address (hex)",IDC_LABEL_CHEAT_ADDRESS,18,175,64, + 15,SS_CENTERIMAGE + RTEXT "New Value (dec or hex)",IDC_LABEL_CHEAT_BYTE,134,175,74, + 15,SS_CENTERIMAGE +END + +IDD_NETPLAYPROGRESS DIALOG 0, 0, 186, 61 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Dialog" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "Static",IDC_STATIC,5,0,160,20 + CONTROL "Progress1",IDC_NPPROGRESS,"msctls_progress32",WS_BORDER, + 5,30,160,25 +END + +IDD_INPUTCONFIG DIALOGEX 0, 0, 300, 129 +STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | + WS_CLIPCHILDREN | WS_CAPTION +CAPTION "Input Config" +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + COMBOBOX IDC_JPCOMBO,0,4,77,60,CBS_DROPDOWNLIST | WS_VSCROLL | + WS_TABSTOP + CONTROL "Enabled",IDC_JPTOGGLE,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,79,2,42,10 + CONTROL "WOG!",IDC_UP,"InputCustom",WS_TABSTOP,31,22,71,12, + WS_EX_CLIENTEDGE + CONTROL "",IDC_LEFT,"InputCustom",WS_TABSTOP,31,35,71,12, + WS_EX_CLIENTEDGE + CONTROL "",IDC_DOWN,"InputCustom",WS_TABSTOP,31,48,71,12, + WS_EX_CLIENTEDGE + CONTROL "",IDC_RIGHT,"InputCustom",WS_TABSTOP,31,61,71,12, + WS_EX_CLIENTEDGE + CONTROL "",IDC_B,"InputCustom",WS_TABSTOP,31,74,71,12, + WS_EX_CLIENTEDGE + CONTROL "",IDC_A,"InputCustom",WS_TABSTOP,31,87,71,12, + WS_EX_CLIENTEDGE + CONTROL "",IDC_Y,"InputCustom",WS_TABSTOP,31,100,71,12, + WS_EX_CLIENTEDGE + CONTROL "",IDC_X,"InputCustom",WS_TABSTOP,31,113,71,12, + WS_EX_CLIENTEDGE + CONTROL " ",IDC_START,"InputCustom",WS_TABSTOP,142,22,71,12, + WS_EX_CLIENTEDGE + CONTROL " ",IDC_SELECT,"InputCustom",WS_TABSTOP,142,35,71,12, + WS_EX_CLIENTEDGE + CONTROL " ",IDC_L,"InputCustom",WS_TABSTOP,142,48,71,12, + WS_EX_CLIENTEDGE + CONTROL " ",IDC_R,"InputCustom",WS_TABSTOP,142,61,71,12, + WS_EX_CLIENTEDGE + CONTROL " ",IDC_UPLEFT,"InputCustom",WS_DISABLED | WS_TABSTOP, + 142,74,71,12,WS_EX_CLIENTEDGE + CONTROL " ",IDC_UPRIGHT,"InputCustom",WS_DISABLED | WS_TABSTOP, + 142,87,71,12,WS_EX_CLIENTEDGE + CONTROL " ",IDC_DWNRIGHT,"InputCustom",WS_DISABLED | WS_TABSTOP, + 142,100,71,12,WS_EX_CLIENTEDGE + CONTROL " ",IDC_DWNLEFT,"InputCustom",WS_DISABLED | WS_TABSTOP, + 142,113,71,12,WS_EX_CLIENTEDGE + PUSHBUTTON "Cancel",IDCANCEL,216,111,39,14 + PUSHBUTTON "OK",IDOK,256,111,40,14 + LTEXT "Blue means the button is already mapped;\nRed means it's used by windows or Snes9x", + IDC_LABEL_BLUE,142,3,157,17 + RTEXT "UP",IDC_LABEL_UP,3,25,24,8 + RTEXT "DILDO",IDC_LABEL_RIGHT,0,64,28,8 + RTEXT "LEFT",IDC_LABEL_LEFT,3,38,24,8 + RTEXT "DOWN",IDC_LABEL_DOWN,4,51,24,8 + RTEXT "A",IDC_LABEL_A,3,89,24,8 + RTEXT "X",IDC_LABEL_X,3,116,24,8 + RTEXT "B",IDC_LABEL_B,3,77,24,8 + RTEXT "Y",IDC_LABEL_Y,3,103,24,8 + RTEXT "L",IDC_LABEL_L,115,50,24,8 + RTEXT "START",IDC_LABEL_START,115,24,24,8 + RTEXT "R",IDC_LABEL_R,115,63,24,8 + RTEXT "SELECT",IDC_LABEL_SELECT,111,37,28,8 + RTEXT "UP LEFT",IDC_LABEL_UPLEFT,109,77,30,8 + RTEXT "DN RIGHT",IDC_LABEL_DOWNRIGHT,103,103,36,8 + RTEXT "UP RIGHT",IDC_LABEL_UPRIGHT,103,90,36,8 + RTEXT "DN LEFT",IDC_LABEL_DOWNLEFT,108,116,31,8 + CONTROL 133,IDC_STATIC,"Static",SS_BITMAP,216,22,80,74 + CONTROL "Allow Left+Rt/Up+Dn",IDC_ALLOWLEFTRIGHT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,216,99,84,10 + CONTROL "Toggle Mode",IDC_TOGL,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,79,11,58,10 +END + +IDD_CHEAT_SEARCH DIALOGEX 0, 0, 273, 271 +STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | + WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU +CAPTION "Cheat Search" +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "&OK",IDOK,161,250,50,14 + PUSHBUTTON "&Cancel",IDCANCEL,216,250,50,14 + CONTROL "List1",IDC_ADDYS,"SysListView32",LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_OWNERDATA | + WS_BORDER | WS_TABSTOP,7,7,201,152,WS_EX_CLIENTEDGE + PUSHBUTTON "&Search",IDC_C_SEARCH,214,7,52,16 + PUSHBUTTON "&Add Cheat",IDC_C_ADD,214,29,52,16,WS_DISABLED + PUSHBUTTON "&Reset",IDC_C_RESET,214,51,52,16 + CONTROL "1 byte",IDC_1_BYTE,"Button",BS_AUTORADIOBUTTON | + WS_GROUP | WS_TABSTOP,211,172,42,11 + CONTROL "2 bytes",IDC_2_BYTE,"Button",BS_AUTORADIOBUTTON,211,185, + 42,11 + CONTROL "3 bytes",IDC_3_BYTE,"Button",BS_AUTORADIOBUTTON,211,198, + 42,11 + CONTROL "4 bytes",IDC_4_BYTE,"Button",BS_AUTORADIOBUTTON,211,211, + 42,11 + GROUPBOX "Data Size",IDC_STATIC,204,162,54,66,0,WS_EX_TRANSPARENT + GROUPBOX "Comparison Type",IDC_STATIC,7,162,114,78,0, + WS_EX_TRANSPARENT + CONTROL "< (Less Than)",IDC_LESS_THAN,"Button", + BS_AUTORADIOBUTTON | WS_GROUP,13,170,90,11 + CONTROL "> (Greater Than)",IDC_GREATER_THAN,"Button", + BS_AUTORADIOBUTTON,13,181,90,11 + CONTROL "<= (Less Than or Equal to)",IDC_LESS_THAN_EQUAL,"Button", + BS_AUTORADIOBUTTON,13,192,106,11 + CONTROL ">= (Greater than or Equal To)",IDC_GREATER_THAN_EQUAL, + "Button",BS_AUTORADIOBUTTON,13,203,105,11 + CONTROL "= (Equal To)",IDC_EQUAL,"Button",BS_AUTORADIOBUTTON,13, + 214,90,11 + CONTROL "!= (Not Equal To)",IDC_NOT_EQUAL,"Button", + BS_AUTORADIOBUTTON,13,225,90,11 + GROUPBOX "Data Type",IDC_STATIC,125,197,75,43,0,WS_EX_TRANSPARENT + GROUPBOX "Compare To",IDC_STATIC,125,162,75,32,0, + WS_EX_TRANSPARENT + CONTROL "Previous Value",IDC_PREV,"Button",BS_AUTORADIOBUTTON | + WS_GROUP,129,171,67,10 + CONTROL "Entered Value",IDC_ENTERED,"Button",BS_AUTORADIOBUTTON, + 129,182,67,10 + CONTROL "Unsigned (>=0)",IDC_UNSIGNED,"Button", + BS_AUTORADIOBUTTON | WS_GROUP,129,207,67,10 + CONTROL "Signed (+/-)",IDC_SIGNED,"Button",BS_AUTORADIOBUTTON, + 129,217,67,10 + CONTROL "Hexadecimal",IDC_HEX,"Button",BS_AUTORADIOBUTTON,129, + 227,67,10 + EDITTEXT IDC_VALUE_ENTER,72,250,83,12,ES_UPPERCASE | + ES_AUTOHSCROLL | WS_DISABLED + RTEXT "Enter a Value:",IDC_ENTER_LABEL,7,250,54,12, + SS_CENTERIMAGE | WS_DISABLED +END + +IDD_DIALOG1 DIALOG 0, 0, 271, 68 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Dialog" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,221,52,50,14 + PUSHBUTTON "Cancel",IDCANCEL,169,52,50,14 + COMBOBOX IDC_COMBO1,25,7,188,12,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP +END + +IDD_CHEAT_FROM_SEARCH DIALOG 0, 0, 187, 143 +STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | + WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | + WS_SYSMENU +CAPTION "Cheat Details" +FONT 8, "MS Sans Serif" +BEGIN + PUSHBUTTON "&OK",IDOK,85,123,45,13 + PUSHBUTTON "&Cancel",IDCANCEL,135,123,45,13 + EDITTEXT IDC_NC_ADDRESS,79,7,101,12,ES_AUTOHSCROLL + EDITTEXT IDC_NC_CURRVAL,79,31,101,12,ES_AUTOHSCROLL + EDITTEXT IDC_NC_PREVVAL,79,55,101,12,ES_AUTOHSCROLL + EDITTEXT IDC_NC_NEWVAL,79,79,101,12,ES_AUTOHSCROLL + EDITTEXT IDC_NC_DESC,79,103,101,12,ES_AUTOHSCROLL + RTEXT "Address",IDC_STATIC,7,7,70,12,SS_CENTERIMAGE + RTEXT "Current Value",IDC_STATIC,7,31,70,12,SS_CENTERIMAGE + RTEXT "Previous Value",IDC_STATIC,7,55,70,12,SS_CENTERIMAGE + RTEXT "New Value",IDC_STATIC,7,79,70,12,SS_CENTERIMAGE + RTEXT "Description",IDC_STATIC,7,103,70,12,SS_CENTERIMAGE +END + +IDD_OPENMOVIE DIALOGEX 0, 0, 303, 223 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Play Movie" +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + DEFPUSHBUTTON "OK",IDOK,187,200,50,14 + PUSHBUTTON "Cancel",IDCANCEL,246,200,50,14 + EDITTEXT IDC_MOVIE_PATH,7,18,230,13,ES_AUTOHSCROLL + LTEXT "Movie File",IDC_STATIC,7,7,33,8 + PUSHBUTTON "&Browse...",IDC_BROWSE_MOVIE,248,17,48,14 + LTEXT "Recording Date:",IDC_STATIC,15,55,53,8 + LTEXT "Length:",IDC_STATIC,43,64,25,8 + LTEXT "Frames:",IDC_STATIC,43,73,26,8 + LTEXT "Re-record Count:",IDC_STATIC,13,82,55,8 + LTEXT "DATE",IDC_MOVIE_DATE,71,55,81,8 + LTEXT "LENGTH",IDC_MOVIE_LENGTH,71,64,81,8 + LTEXT "FRAMES",IDC_MOVIE_FRAMES,71,73,81,8 + LTEXT "RERECORD",IDC_MOVIE_RERECORD,71,82,81,8 + LTEXT "Author Info:",IDC_STATIC,30,99,38,8 + CONTROL "Open Read-Only",IDC_READONLY,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,172,7,69,10 + LTEXT "Static",IDC_MOVIE_METADATA,70,99,226,21,WS_BORDER + GROUPBOX "Record Options",IDC_STATIC,7,133,77,61 + CONTROL "Record from now",IDC_RECORD_NOW,"Button", + BS_AUTORADIOBUTTON | WS_DISABLED | WS_GROUP | WS_TABSTOP, + 11,169,70,10 + CONTROL "Record from reset",IDC_RECORD_RESET,"Button", + BS_AUTORADIOBUTTON | WS_DISABLED | WS_TABSTOP,11,154,72, + 10 + CONTROL "Joypad 1",IDC_JOY1,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,98,142,45,10 + CONTROL "Joypad 3",IDC_JOY3,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,98,162,45,10 + CONTROL "Joypad 2",IDC_JOY2,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,98,152,45,10 + CONTROL "Joypad 4",IDC_JOY4,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,98,172,45,10 + CONTROL "Joypad 5",IDC_JOY5,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,98,183,45,10 + GROUPBOX "Record Controllers",IDC_STATIC,89,133,69,61 + CONTROL "Use WIP1 Timing",IDC_WIP1,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,172,142,71,10 + CONTROL "Volume Envelope Height Reading",IDC_ENVX,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,172,162,123,10 + CONTROL "Fake Mute desync workaround",IDC_FMUT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,172,173,114,10 + GROUPBOX "Emulator Sync Settings",IDC_STATIC,163,133,133,61 + CONTROL "Allow Left+Right / Up+Down",IDC_ALLOWLEFTRIGHT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,172,151,118,11 + LTEXT "Press OK to start playing the movie.\nDon't forget to let the game run for 10 seconds first!", + IDC_STATIC,10,201,164,18 + CONTROL "Sync samples with sound CPU",IDC_SYNC_TO_SOUND_CPU, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,172,183,117,10 + LTEXT " ", + IDC_LOADEDFROMMOVIE,169,124,113,8 + LTEXT "Movie's ROM: CRC32=Unknown, Name=Unknown", + IDC_MOVIEROMINFO,8,35,288,8 + LTEXT "Current ROM: CRC32=Unknown, Name=Unknown", + IDC_CURRENTROMINFO,9,43,287,9 +END + +IDD_CREATEMOVIE DIALOGEX 0, 0, 303, 150 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Record Movie" +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "OK",IDOK,187,129,50,14 + PUSHBUTTON "Cancel",IDCANCEL,246,129,50,14 + EDITTEXT IDC_MOVIE_PATH,7,18,230,13,ES_AUTOHSCROLL + LTEXT "Movie File",IDC_STATIC,7,7,33,8 + PUSHBUTTON "&Browse...",IDC_BROWSE_MOVIE,248,17,48,14 + GROUPBOX "Record Options",IDC_STATIC,7,38,77,61 + CONTROL "Record from now",IDC_RECORD_NOW,"Button", + BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,11,65,70,10 + CONTROL "Record from reset",IDC_RECORD_RESET,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP,11,52,72,10 + CONTROL "Joypad 1",IDC_JOY1,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,98,47,45,10 + CONTROL "Joypad 3",IDC_JOY3,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,98,67,45,10 + CONTROL "Joypad 2",IDC_JOY2,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,98,57,45,10 + CONTROL "Joypad 4",IDC_JOY4,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,98,77,45,10 + CONTROL "Joypad 5",IDC_JOY5,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,98,87,45,10 + GROUPBOX "Record Controllers",IDC_STATIC,89,38,69,61 + EDITTEXT IDC_MOVIE_METADATA,67,105,229,14,ES_AUTOHSCROLL + LTEXT "Author Info:",IDC_STATIC,18,108,43,8,0,WS_EX_RIGHT + CONTROL "Use WIP1 Timing",IDC_WIP1,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,172,47,71,10 + CONTROL "Volume Envelope Height Reading",IDC_ENVX,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,172,67,123,10 + GROUPBOX "Emulator Sync Settings",IDC_STATIC,163,38,133,61 + CONTROL "Allow Left+Right / Up+Down",IDC_ALLOWLEFTRIGHT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,172,57,118,10 + CONTROL "Fake Mute desync workaround",IDC_FMUT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,172,77,114,10 + CONTROL "Sync samples with sound CPU",IDC_SYNC_TO_SOUND_CPU, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,172,87,117,10 + CONTROL "Clear SRAM",IDC_CLEARSRAM,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,83,70,10 +END + +IDD_KEYCUSTOM DIALOGEX 0, 0, 351, 187 +STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | + WS_CLIPCHILDREN | WS_CAPTION +CAPTION "Customize Special Keys" +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + PUSHBUTTON "Cancel",IDCANCEL,264,167,39,14 + PUSHBUTTON "OK",IDOK,304,167,40,14 + RTEXT "speed +",IDC_LABEL_UP,25,9,38,8 + RTEXT "frame advance",IDC_LABEL_RIGHT,13,48,49,8 + RTEXT "speed -",IDC_LABEL_LEFT,7,22,56,8 + RTEXT "pause",IDC_LABEL_DOWN,23,35,40,8 + RTEXT "skip +",IDC_LABEL_B,3,74,60,8 + RTEXT "movie frame count",IDC_LABEL_L,1,138,62,8 + RTEXT "superscope turbo",IDC_LABEL_START,1,99,62,8 + RTEXT "movie read-only",IDC_LABEL_R,4,151,59,8 + RTEXT "superscope pause",IDC_LABEL_SELECT,3,112,60,8 + RTEXT "skip -",IDC_LABEL_A,4,86,59,8 + CONTROL "",IDC_SPEEDUP,"InputCustomHot",WS_TABSTOP,67,6,98,12, + WS_EX_CLIENTEDGE + CONTROL "",IDC_SPEEDDOWN,"InputCustomHot",WS_TABSTOP,67,19,98,12, + WS_EX_CLIENTEDGE + CONTROL "",IDC_PAUSE,"InputCustomHot",WS_TABSTOP,67,32,98,12, + WS_EX_CLIENTEDGE + CONTROL "",IDC_FRAMEADVANCE,"InputCustomHot",WS_TABSTOP,67,45,98, + 12,WS_EX_CLIENTEDGE + CONTROL "",IDC_SKIPUP,"InputCustomHot",WS_TABSTOP,67,71,98,12, + WS_EX_CLIENTEDGE + CONTROL "",IDC_SKIPDOWN,"InputCustomHot",WS_TABSTOP,67,84,98,12, + WS_EX_CLIENTEDGE + CONTROL "",IDC_SCOPETURBO,"InputCustomHot",WS_TABSTOP,67,97,98, + 12,WS_EX_CLIENTEDGE + CONTROL "",IDC_SCOPEPAUSE,"InputCustomHot",WS_TABSTOP,67,110,98, + 12,WS_EX_CLIENTEDGE + CONTROL "",IDC_FRAMECOUNT,"InputCustomHot",WS_TABSTOP,67,136,98, + 12,WS_EX_CLIENTEDGE + CONTROL "",IDC_READONLY,"InputCustomHot",WS_TABSTOP,67,149,98,12, + WS_EX_CLIENTEDGE + CONTROL "",IDC_SAVE1,"InputCustomHot",WS_TABSTOP,196,6,60,12, + WS_EX_CLIENTEDGE + RTEXT "save1",IDC_LABEL_UP2,173,22,20,8 + CONTROL "",IDC_SAVE2,"InputCustomHot",WS_TABSTOP,196,19,60,12, + WS_EX_CLIENTEDGE + RTEXT "save2",IDC_LABEL_UP3,173,35,20,8 + CONTROL "",IDC_SAVE3,"InputCustomHot",WS_TABSTOP,196,32,60,12, + WS_EX_CLIENTEDGE + RTEXT "save3",IDC_LABEL_UP4,173,48,20,8 + CONTROL "",IDC_SAVE4,"InputCustomHot",WS_TABSTOP,196,45,60,12, + WS_EX_CLIENTEDGE + RTEXT "save4",IDC_LABEL_UP5,173,60,20,8 + CONTROL "",IDC_SAVE5,"InputCustomHot",WS_TABSTOP,196,58,60,12, + WS_EX_CLIENTEDGE + RTEXT "save5",IDC_LABEL_UP6,173,73,20,8 + CONTROL "",IDC_SAVE6,"InputCustomHot",WS_TABSTOP,196,71,60,12, + WS_EX_CLIENTEDGE + RTEXT "save6",IDC_LABEL_UP7,173,86,20,8 + CONTROL "",IDC_SAVE7,"InputCustomHot",WS_TABSTOP,196,84,60,12, + WS_EX_CLIENTEDGE + RTEXT "save7",IDC_LABEL_UP8,173,100,20,8 + CONTROL "",IDC_SAVE8,"InputCustomHot",WS_TABSTOP,196,97,60,12, + WS_EX_CLIENTEDGE + RTEXT "save8",IDC_LABEL_UP9,173,113,20,8 + CONTROL "",IDC_SAVE9,"InputCustomHot",WS_TABSTOP,196,110,60,12, + WS_EX_CLIENTEDGE + RTEXT "save9",IDC_LABEL_UP10,173,126,20,8 + CONTROL "",IDC_SAVE10,"InputCustomHot",WS_TABSTOP,196,123,60,12, + WS_EX_CLIENTEDGE + RTEXT "save0",IDC_LABEL_UP11,173,9,20,8 + CONTROL "",IDC_SAVE11,"InputCustomHot",WS_TABSTOP,284,6,60,12, + WS_EX_CLIENTEDGE + RTEXT "load1",IDC_LABEL_UP12,261,22,20,8 + CONTROL "",IDC_SAVE12,"InputCustomHot",WS_TABSTOP,284,19,60,12, + WS_EX_CLIENTEDGE + RTEXT "load2",IDC_LABEL_UP13,261,35,20,8 + CONTROL "",IDC_SAVE13,"InputCustomHot",WS_TABSTOP,284,32,60,12, + WS_EX_CLIENTEDGE + RTEXT "load3",IDC_LABEL_UP14,261,49,20,8 + CONTROL "",IDC_SAVE14,"InputCustomHot",WS_TABSTOP,284,45,60,12, + WS_EX_CLIENTEDGE + RTEXT "load4",IDC_LABEL_UP15,261,61,20,8 + CONTROL "",IDC_SAVE15,"InputCustomHot",WS_TABSTOP,284,58,60,12, + WS_EX_CLIENTEDGE + RTEXT "load5",IDC_LABEL_UP16,261,73,20,8 + CONTROL "",IDC_SAVE16,"InputCustomHot",WS_TABSTOP,284,71,60,12, + WS_EX_CLIENTEDGE + RTEXT "load6",IDC_LABEL_UP17,261,86,20,8 + CONTROL "",IDC_SAVE17,"InputCustomHot",WS_TABSTOP,284,84,60,12, + WS_EX_CLIENTEDGE + RTEXT "load7",IDC_LABEL_UP18,261,100,20,8 + CONTROL "",IDC_SAVE18,"InputCustomHot",WS_TABSTOP,284,97,60,12, + WS_EX_CLIENTEDGE + RTEXT "load8",IDC_LABEL_UP19,261,112,20,8 + CONTROL "",IDC_SAVE19,"InputCustomHot",WS_TABSTOP,284,110,60,12, + WS_EX_CLIENTEDGE + RTEXT "load9",IDC_LABEL_UP20,261,125,20,8 + CONTROL "",IDC_SAVE20,"InputCustomHot",WS_TABSTOP,284,123,60,12, + WS_EX_CLIENTEDGE + RTEXT "load0",IDC_LABEL_UP21,261,9,20,8 + RTEXT "fast forward",IDC_LABEL_RIGHT2,13,61,49,8 + CONTROL "",IDC_FASTFORWARD,"InputCustomHot",WS_TABSTOP,67,58,98, + 12,WS_EX_CLIENTEDGE + RTEXT "show pressed keys",IDC_LABEL_R2,2,125,61,8 + CONTROL "",IDC_SHOWPRESSED,"InputCustomHot",WS_TABSTOP,67,123,98, + 12,WS_EX_CLIENTEDGE + RTEXT "save screenshot",IDC_LABEL_R3,4,164,59,8 + CONTROL "",IDC_SCREENSHOT,"InputCustomHot",WS_TABSTOP,67,162,98, + 12,WS_EX_CLIENTEDGE + RTEXT "slot-",IDC_LABEL_UP22,173,138,20,8 + CONTROL "",IDC_SLOTMINUS,"InputCustomHot",WS_TABSTOP,196,136,60, + 12,WS_EX_CLIENTEDGE + RTEXT "slot+",IDC_LABEL_UP23,261,138,20,8 + CONTROL "",IDC_SLOTPLUS,"InputCustomHot",WS_TABSTOP,284,136,60, + 12,WS_EX_CLIENTEDGE + RTEXT "save#",IDC_LABEL_UP24,170,151,23,8 + CONTROL "",IDC_SLOTSAVE,"InputCustomHot",WS_TABSTOP,196,149,60, + 12,WS_EX_CLIENTEDGE + RTEXT "load#",IDC_LABEL_UP25,258,151,23,8 + CONTROL "",IDC_SLOTLOAD,"InputCustomHot",WS_TABSTOP,284,149,60, + 12,WS_EX_CLIENTEDGE +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog Info +// + +IDD_SOUND_OPTS DLGINIT +BEGIN + IDC_DRIVER, 0x403, 19, 0 +0x6e53, 0x7365, 0x7839, 0x4420, 0x7269, 0x6365, 0x5374, 0x756f, 0x646e, +"\000" + IDC_DRIVER, 0x403, 17, 0 +0x4d46, 0x444f, 0x4420, 0x7269, 0x6365, 0x5374, 0x756f, 0x646e, "\000" + IDC_DRIVER, 0x403, 24, 0 +0x4d46, 0x444f, 0x5720, 0x6e69, 0x6f64, 0x7377, 0x4d20, 0x6c75, 0x6974, +0x656d, 0x6964, 0x0061, + IDC_DRIVER, 0x403, 9, 0 +0x4d46, 0x444f, 0x4120, 0x4433, "\000" + IDC_BUFLEN, 0x403, 6, 0 +0x3031, 0x6d20, 0x0073, + IDC_BUFLEN, 0x403, 6, 0 +0x3032, 0x6d20, 0x0073, + IDC_BUFLEN, 0x403, 6, 0 +0x3034, 0x6d20, 0x0073, + IDC_BUFLEN, 0x403, 6, 0 +0x3038, 0x6d20, 0x0073, + IDC_BUFLEN, 0x403, 7, 0 +0x3631, 0x2030, 0x736d, "\000" + IDC_BUFLEN, 0x403, 7, 0 +0x3233, 0x2030, 0x736d, "\000" + IDC_BUFLEN, 0x403, 7, 0 +0x3436, 0x2030, 0x736d, "\000" + IDC_RATE, 0x403, 11, 0 +0x4e3c, 0x206f, 0x6f53, 0x6e75, 0x3e64, "\000" + IDC_RATE, 0x403, 8, 0 +0x2038, 0x2020, 0x484b, 0x007a, + IDC_RATE, 0x403, 7, 0 +0x3131, 0x4b20, 0x7a48, "\000" + IDC_RATE, 0x403, 7, 0 +0x3631, 0x4b20, 0x7a48, "\000" + IDC_RATE, 0x403, 7, 0 +0x3232, 0x4b20, 0x7a48, "\000" + IDC_RATE, 0x403, 7, 0 +0x3033, 0x4b20, 0x7a48, "\000" + IDC_RATE, 0x403, 7, 0 +0x3533, 0x4b20, 0x7a48, "\000" + IDC_RATE, 0x403, 7, 0 +0x3434, 0x4b20, 0x7a48, "\000" + IDC_RATE, 0x403, 7, 0 +0x3834, 0x4b20, 0x7a48, "\000" + IDC_MIX, 0x403, 6, 0 +0x3031, 0x6d20, 0x0073, + IDC_MIX, 0x403, 6, 0 +0x3032, 0x6d20, 0x0073, + IDC_MIX, 0x403, 6, 0 +0x3033, 0x6d20, 0x0073, + IDC_MIX, 0x403, 6, 0 +0x3034, 0x6d20, 0x0073, + IDC_MIX, 0x403, 6, 0 +0x3035, 0x6d20, 0x0073, + IDC_MIX, 0x403, 6, 0 +0x3036, 0x6d20, 0x0073, + IDC_MIX, 0x403, 6, 0 +0x3037, 0x6d20, 0x0073, + IDC_MIX, 0x403, 6, 0 +0x3038, 0x6d20, 0x0073, + IDC_MIX, 0x403, 6, 0 +0x3039, 0x6d20, 0x0073, + IDC_MIX, 0x403, 7, 0 +0x3031, 0x2030, 0x736d, "\000" + IDC_MIX, 0x403, 7, 0 +0x3131, 0x2030, 0x736d, "\000" + IDC_MIX, 0x403, 7, 0 +0x3231, 0x2030, 0x736d, "\000" + IDC_MIX, 0x403, 7, 0 +0x3331, 0x2030, 0x736d, "\000" + IDC_MIX, 0x403, 7, 0 +0x3431, 0x2030, 0x736d, "\000" + IDC_MIX, 0x403, 7, 0 +0x3531, 0x2030, 0x736d, "\000" + IDC_SKIP_TYPE, 0x403, 15, 0 +0x6b53, 0x7069, 0x6d20, 0x7465, 0x6f68, 0x2064, 0x3123, "\000" + IDC_SKIP_TYPE, 0x403, 15, 0 +0x6b53, 0x7069, 0x6d20, 0x7465, 0x6f68, 0x2064, 0x3223, "\000" + IDC_SKIP_TYPE, 0x403, 15, 0 +0x6b53, 0x7069, 0x6d20, 0x7465, 0x6f68, 0x2064, 0x3323, "\000" + IDC_SKIP_TYPE, 0x403, 15, 0 +0x6b53, 0x7069, 0x6d20, 0x7465, 0x6f68, 0x2064, 0x3423, "\000" + IDC_SKIP_TYPE, 0x403, 15, 0 +0x6b53, 0x7069, 0x6d20, 0x7465, 0x6f68, 0x2064, 0x3523, "\000" + 0 +END + +IDD_INPUTCONFIG DLGINIT +BEGIN + IDC_JPCOMBO, 0x403, 10, 0 +0x6f4a, 0x7079, 0x6461, 0x2320, 0x0031, + IDC_JPCOMBO, 0x403, 10, 0 +0x6f4a, 0x7079, 0x6461, 0x2320, 0x0032, + IDC_JPCOMBO, 0x403, 10, 0 +0x6f4a, 0x7079, 0x6461, 0x2320, 0x0033, + IDC_JPCOMBO, 0x403, 10, 0 +0x6f4a, 0x7079, 0x6461, 0x2320, 0x0034, + IDC_JPCOMBO, 0x403, 10, 0 +0x6f4a, 0x7079, 0x6461, 0x2320, 0x0035, + 0 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_SOUND_OPTS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 345 + TOPMARGIN, 7 + BOTTOMMARGIN, 194 + END + + IDD_SPC7110_CACHE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 178 + TOPMARGIN, 7 + BOTTOMMARGIN, 85 + END + + IDD_ROM_INFO, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 226 + TOPMARGIN, 7 + BOTTOMMARGIN, 178 + END + + IDD_ABOUT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 225 + TOPMARGIN, 7 + BOTTOMMARGIN, 174 + END + + IDD_EMU_SETTINGS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 313 + BOTTOMMARGIN, 106 + END + + IDD_OPEN_ROM, DIALOG + BEGIN + LEFTMARGIN, 3 + RIGHTMARGIN, 410 + TOPMARGIN, 3 + BOTTOMMARGIN, 221 + END + + IDD_GFX_PACK, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 212 + TOPMARGIN, 7 + BOTTOMMARGIN, 253 + END + + IDD_NEWDISPLAY, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 330 + TOPMARGIN, 7 + BOTTOMMARGIN, 198 + END + + IDD_CHEATER, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 255 + TOPMARGIN, 7 + BOTTOMMARGIN, 211 + END + + IDD_NETPLAYPROGRESS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 179 + TOPMARGIN, 7 + BOTTOMMARGIN, 54 + END + + IDD_INPUTCONFIG, DIALOG + BEGIN + RIGHTMARGIN, 299 + VERTGUIDE, 77 + VERTGUIDE, 92 + BOTTOMMARGIN, 128 + HORZGUIDE, 122 + END + + IDD_CHEAT_SEARCH, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 266 + TOPMARGIN, 7 + BOTTOMMARGIN, 264 + END + + IDD_DIALOG1, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 264 + TOPMARGIN, 7 + BOTTOMMARGIN, 61 + END + + IDD_CHEAT_FROM_SEARCH, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 180 + TOPMARGIN, 7 + BOTTOMMARGIN, 136 + END + + IDD_OPENMOVIE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 296 + TOPMARGIN, 7 + BOTTOMMARGIN, 219 + HORZGUIDE, 31 + HORZGUIDE, 55 + HORZGUIDE, 120 + HORZGUIDE, 133 + HORZGUIDE, 191 + END + + IDD_CREATEMOVIE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 296 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + HORZGUIDE, 31 + HORZGUIDE, 38 + HORZGUIDE, 99 + END + + IDD_KEYCUSTOM, DIALOG + BEGIN + RIGHTMARGIN, 348 + VERTGUIDE, 72 + VERTGUIDE, 92 + BOTTOMMARGIN, 181 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_ICON1 ICON "icon1.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_OPENFOLDER BITMAP "openfold.bmp" +IDB_CLOSEDFOLDER BITMAP "closedfold.bmp" +IDB_CDDRIVE BITMAP "cdd.bmp" +IDB_NETDRIVE BITMAP "nd.bmp" +IDB_HARDDRIVE BITMAP "hd.bmp" +IDB_PAD BITMAP "pad.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// RT_MANIFEST +// + +IDR_RT_MANIFEST2 RT_MANIFEST "rt_manif.bin" +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// Dutch (Netherlands) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NLD) +#ifdef _WIN32 +LANGUAGE LANG_DUTCH, SUBLANG_DUTCH +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,4,0,0 + PRODUCTVERSION 1,4,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "080904b0" + BEGIN + VALUE "CompanyName", "Gary Henderson" + VALUE "FileDescription", "Snes9XW" + VALUE "FileVersion", "1.40" + VALUE "InternalName", "Snes9X" + VALUE "LegalCopyright", "Copyright © 1996-2001" + VALUE "OriginalFilename", "Snes9XW.exe" + VALUE "ProductName", "Snes9X SNES Emulator" + VALUE "ProductVersion", "1.40" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x809, 1200 + END +END + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "#include ""language.h""\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_MENU_NL MENU +BEGIN + POPUP "&Bestand" + BEGIN + MENUITEM "&Openen", ID_FILE_OPEN + MENUITEM SEPARATOR + MENUITEM "&Sluiten", ID_FILE_EXIT + END + POPUP "&Opties" + BEGIN + MENUITEM "Joypad configuratie", ID_OPTIONS_JOYPAD + END + POPUP "&Geluid" + BEGIN + POPUP "&8-Bit" + BEGIN + MENUITEM "8000 Hz, mono", ID_SOUND_8BIT8000HZMONO + MENUITEM "8000 Hz, stereo", ID_SOUND_8BIT8000HZSTEREO + + MENUITEM "11025 Hz, mono", ID_SOUND_8BIT11025HZMONO + MENUITEM "11025 Hz, stereo", ID_SOUND_8BIT11025HZSTEREO + + MENUITEM "22050 Hz, mono", ID_SOUND_8BIT22050HZMONO + MENUITEM "22050 Hz, stereo", ID_SOUND_8BIT22050HZSTEREO + + MENUITEM "44100 Hz, mono", ID_SOUND_8BIT44100HZMONO + MENUITEM "44100 Hz, stereo", ID_SOUND_8BIT44100HZSTEREO + + END + POPUP "&16-Bit" + BEGIN + MENUITEM "8000 Hz, mono", ID_SOUND_16BIT8000HZMONO + MENUITEM "8000 Hz, stereo", ID_SOUND_16BIT8000HZSTEREO + + MENUITEM "11025 Hz, mono", ID_SOUND_16BIT11025HZMONO + + MENUITEM "11025 Hz, stereo", ID_SOUND_16BIT11025HZSTEREO + + MENUITEM "22050 Hz, mono", ID_SOUND_16BIT22050HZMONO + + MENUITEM "22050 Hz, stereo", ID_SOUND_16BIT22050HZSTEREO + + MENUITEM "44100 Hz, mono", ID_SOUND_16BIT44100HZMONO + + MENUITEM "44100 Hz, stereo", ID_SOUND_16BIT44100HZSTEREO + + END + MENUITEM SEPARATOR + MENUITEM "&Geen Geluid", ID_SOUND_NOSOUND + END + POPUP "&Venster" + BEGIN + POPUP "&Taal" + BEGIN + MENUITEM "&English", ID_LANGUAGE_ENGLISH + MENUITEM "&Nederlands", ID_LANGUAGE_NEDERLANDS + , CHECKED + END + MENUITEM SEPARATOR + MENUITEM "&Verberg menubalk\tESC", ID_WINDOW_HIDEMENUBAR + END +END + +#endif // Dutch (Netherlands) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (U.K.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_NETCONNECT DIALOG 0, 0, 227, 61 +STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | + WS_CLIPCHILDREN | WS_CAPTION +CAPTION "Connect to Server" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "&OK",IDOK,120,45,50,14 + PUSHBUTTON "Canccel",IDCANCEL,175,45,50,14 + RTEXT "Server Address",IDC_LABEL_SERVERADDY,5,5,50,14, + SS_CENTERIMAGE + PUSHBUTTON "Clear History",IDC_CLEARHISTORY,175,5,50,14 + RTEXT "Port Number",IDC_LABEL_PORTNUM,5,25,50,14, + SS_CENTERIMAGE + EDITTEXT IDC_PORTNUMBER,60,25,25,14,ES_AUTOHSCROLL + COMBOBOX IDC_HOSTNAME,60,5,110,40,CBS_DROPDOWN | WS_VSCROLL | + WS_TABSTOP +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_MENU_US MENU +BEGIN + POPUP "&File" + BEGIN + MENUITEM "L&oad Game...\tCtrl+O", ID_FILE_OPEN + POPUP "Recent &Games" + BEGIN + MENUITEM "Dummy", ID_RECENT_DUMMY + , INACTIVE + END + POPUP "&Save Game Position" + BEGIN + MENUITEM "Slot #1\tShift+F1", ID_FILE_SAVE1 + MENUITEM "Slot #2\tShift+F2", ID_FILE_SAVE2, GRAYED + MENUITEM "Slot #3\tShift+F3", ID_FILE_SAVE3, GRAYED + MENUITEM "Slot #4\tShift+F4", ID_FILE_SAVE4, GRAYED + MENUITEM "Slot #5\tShift+F5", ID_FILE_SAVE5, GRAYED + MENUITEM "Slot #6\tShift+F6", ID_FILE_SAVE6, GRAYED + MENUITEM "Slot #7\tShift+F7", ID_FILE_SAVE7, GRAYED + MENUITEM "Slot #8\tShift+F8", ID_FILE_SAVE8, GRAYED + MENUITEM "Slot #9\tShift+F9", ID_FILE_SAVE9, GRAYED + END + POPUP "&Load Game Position" + BEGIN + MENUITEM "Slot #1\tF1", ID_FILE_LOAD1 + MENUITEM "Slot #2\tF2", ID_FILE_LOAD2, GRAYED + MENUITEM "Slot #3\tF3", ID_FILE_LOAD3, GRAYED + MENUITEM "Slot #4\tF4", ID_FILE_LOAD4, GRAYED + MENUITEM "Slot #5\tF5", ID_FILE_LOAD5, GRAYED + MENUITEM "Slot #6\tF6", ID_FILE_LOAD6, GRAYED + MENUITEM "Slot #7\tF7", ID_FILE_LOAD7, GRAYED + MENUITEM "Slot #8\tF8", ID_FILE_LOAD8, GRAYED + MENUITEM "Slot #9\tF9", ID_FILE_LOAD9, GRAYED + END + MENUITEM SEPARATOR + MENUITEM "S&ave SPC Data", ID_FILE_SAVE_SPC_DATA + , GRAYED + MENUITEM "Sa&ve S-RAM Data", ID_FILE_SAVE_SRAM_DATA + , GRAYED + MENUITEM "Save SPC&7110 log", IDM_LOG_7110, GRAYED + MENUITEM "ROM Information...", IDM_ROM_INFO, GRAYED + MENUITEM SEPARATOR + MENUITEM "Movie Play...", ID_FILE_MOVIE_PLAY, GRAYED + MENUITEM "Movie Record...", ID_FILE_MOVIE_RECORD, GRAYED + MENUITEM "Movie Stop", ID_FILE_MOVIE_STOP, GRAYED + MENUITEM SEPARATOR + MENUITEM "Record AVI...", ID_FILE_WRITE_AVI, GRAYED + MENUITEM "Stop AVI Recording", ID_FILE_STOP_AVI, GRAYED + MENUITEM SEPARATOR + MENUITEM "&Reset Game", ID_FILE_RESET, GRAYED + MENUITEM "&Pause\tPause", ID_FILE_PAUSE, GRAYED + MENUITEM "E&xit\tAlt+F4", ID_FILE_EXIT + END + POPUP "&Options" + BEGIN + MENUITEM "&Display Configuration...\tAlt+F5", ID_OPTIONS_DISPLAY + MENUITEM "&Settings...\tAlt+F8", ID_OPTIONS_SETTINGS + MENUITEM "SPC7110 Cache Settings...", IDM_7110_CACHE + MENUITEM "GFX Pack Configuration...", IDM_GFX_PACKS + END + POPUP "&Input" + BEGIN + MENUITEM "&Joypad Configuration...\tAlt+F7", 40022 + MENUITEM "Customize Hotkeys...", ID_OPTIONS_KEYCUSTOM + MENUITEM "Enable Multitap 5", IDM_ENABLE_MULTITAP + MENUITEM "Enable Mouse", IDM_MOUSE_TOGGLE + MENUITEM "Enable Superscope", IDM_SCOPE_TOGGLE + MENUITEM "Enable Justifiers", IDM_JUSTIFIER + END + POPUP "&Sound" + BEGIN + POPUP "&Playback Rate" + BEGIN + MENUITEM "&No Sound\tAlt+0", ID_SOUND_NOSOUND + MENUITEM "8KHz\tAlt+1", ID_SOUND_8000HZ, GRAYED + MENUITEM "11KHz\tAlt+2", ID_SOUND_11025HZ, GRAYED + MENUITEM "16KHz\tAlt+3", ID_SOUND_16000HZ, GRAYED + MENUITEM "22KHz\tAlt+4", ID_SOUND_22050HZ, GRAYED + MENUITEM "30KHz\tAlt+5", ID_SOUND_30000HZ, GRAYED + MENUITEM "32KHz\tAlt+6", ID_SOUND_32000HZ, GRAYED + MENUITEM "35KHz\tAlt+7", ID_SOUND_35000HZ, GRAYED + MENUITEM "44KHz\tAlt+8", ID_SOUND_44100HZ, GRAYED + MENUITEM "48KHz\tAlt+9", ID_SOUND_48000HZ, GRAYED + END + POPUP "&Buffer Length" + BEGIN + MENUITEM "&10ms", ID_SOUND_25MS + MENUITEM "&20ms", ID_SOUND_50MS, GRAYED + MENUITEM "&40ms", ID_SOUND_100MS, GRAYED + MENUITEM "&80ms", ID_SOUND_200MS, GRAYED + MENUITEM "1&60ms", ID_SOUND_500MS, GRAYED + MENUITEM "&320ms", ID_SOUND_1S, GRAYED + MENUITEM "64&0ms", ID_SOUND_2S, GRAYED + END + MENUITEM "&16-Bit Sound", ID_SOUND_16BIT + MENUITEM "&Stereo", ID_SOUND_STEREO + MENUITEM "&Reverse Stereo\tAlt+R", ID_SOUND_REVERSE_STEREO + MENUITEM SEPARATOR + MENUITEM "Catch-up Sample Generation", IDM_CATCH_UP_SOUND + MENUITEM "&Interpolated\tAlt+[", ID_SOUND_INTERPOLATED + MENUITEM "S&ync Sound\tAlt+]", ID_SOUND_SYNC + MENUITEM "&Settings...\tAlt+T", ID_SOUND_OPTIONS + END + POPUP "&Window" + BEGIN + POPUP "&Language" + BEGIN + MENUITEM "&English", ID_LANGUAGE_ENGLISH + , CHECKED + MENUITEM "&Nederlands", ID_LANGUAGE_NEDERLANDS + , GRAYED + END + MENUITEM SEPARATOR + MENUITEM "&Hide menubar\tESC", ID_WINDOW_HIDEMENUBAR + MENUITEM "&Full Screen\tAlt+Return", ID_WINDOW_FULLSCREEN + MENUITEM "&Stretch Image\tAlt+Del", ID_WINDOW_STRETCH + END + POPUP "&Cheat" + BEGIN + MENUITEM "&Game Genie, Pro-Action Replay Codes\tAlt+E", + ID_CHEAT_ENTER + MENUITEM "&Search for New Cheats\tAlt+A", ID_CHEAT_SEARCH, GRAYED + MENUITEM "&Apply Cheats", ID_CHEAT_APPLY + , CHECKED, GRAYED + MENUITEM "Set SPC7110 RTC", IDM_7110_RTC, GRAYED + END + POPUP "&Netplay", GRAYED + BEGIN + MENUITEM "&Connect to Server...", ID_NETPLAY_CONNECT + MENUITEM "&Disconnect from Server", ID_NETPLAY_DISCONNECT + MENUITEM SEPARATOR + MENUITEM "&Act as Server", ID_NETPLAY_SERVER + MENUITEM "&Re-sync all Clients Using Freeze File Now", + ID_NETPLAY_SYNC + MENUITEM "&Send ROM Image to Clients Now", ID_NETPLAY_ROM + MENUITEM "S&end ROM Image to Clients", ID_NETPLAY_SEND_ROM_ON_CONNECT + + MENUITEM "S&ync Using Reset Game", ID_NETPLAY_SYNC_BY_RESET + , CHECKED + MENUITEM SEPARATOR + MENUITEM "&Options...", ID_NETPLAY_OPTIONS + END + POPUP "&Help" + BEGIN + MENUITEM "&About...", ID_HELP_ABOUT + END +END + +#endif // English (U.K.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff -NaHudr snes9x-1.43-src/snes9xw.dsp snx/snes9xw.dsp --- snes9x-1.43-src/snes9xw.dsp 2004-12-31 00:15:55.000000000 +0200 +++ snx/snes9xw.dsp 2005-03-20 23:46:36.000000000 +0200 @@ -44,7 +44,7 @@ # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /Zp4 /MT /W3 /GX /O2 /Ob2 /I "unzip" /I "H:\glide2x" /I "e:\zlib" /I "snes9x\unzip" /I "H:\FMOD\api\inc" /D "ZSNES_C4" /D "SPC700_C" /D "JMA_SUPPORT" /D "SDD1_DECOMP" /D "CORRECT_VRAM_READS" /D "JP_FIX" /D "SPC700_SHUTDOWN" /D "CPU_SHUTDOWN" /D "ZLIB" /D "VAR_CYCLES" /D "UNZIP_SUPPORT" /D "ZSNES_FX" /D "EXECUTE_SUPERFX_PER_LINE" /D "__WIN32__" /D "__MSC__" /D "USE_OPENGL" /D "NDEBUG" /D "FMOD_SUPPORT" /D "OLD_COLOUR_BLENDING" /FR /FD /c +# ADD CPP /nologo /G6 /Zp4 /MT /W3 /O2 /Ob2 /I "unzip" /I "H:\glide2x" /I "e:\zlib" /I "snes9x\unzip" /I "H:\FMOD\api\inc" /D "ZSNES_C4" /D "SPC700_C" /D "USE_GLIDE" /D "SDD1_DECOMP" /D "CORRECT_VRAM_READS" /D "JP_FIX" /D "HAVE_LIBPNG" /D "SPC700_SHUTDOWN" /D "CPU_SHUTDOWN" /D "ZLIB" /D "VAR_CYCLES" /D "UNZIP_SUPPORT" /D "ZSNES_FX" /D "EXECUTE_SUPERFX_PER_LINE" /D "__WIN32__" /D "__MSC__" /D "USE_OPENGL" /D "NDEBUG" /D "NETPLAY_SUPPORT" /D "FMOD_SUPPORT" /D "OLD_COLOUR_BLENDING" /FR /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x413 /d "NDEBUG" @@ -54,7 +54,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 zlibmt.lib comctl32.lib comdlg32.lib shell32.lib ole32.lib winmm.lib opengl32.lib glu32.lib kernel32.lib user32.lib gdi32.lib wsock32.lib advapi32.lib ddraw.lib dsound.lib dxguid.lib delayimp.lib vfw32.lib fmodvc.lib /nologo /subsystem:windows /incremental:yes /machine:I386 /out:"Release/snes9x.exe" /libpath:"H:\FMOD\api\lib" /libpath:"H:\glide2x\lib" /delayload:fmod.dll +# ADD LINK32 zlibmt.lib libpngmt.lib glide2x.lib comctl32.lib comdlg32.lib shell32.lib ole32.lib winmm.lib opengl32.lib glu32.lib kernel32.lib user32.lib gdi32.lib wsock32.lib advapi32.lib ddraw.lib dsound.lib dxguid.lib delayimp.lib fmodvc.lib vfw32.lib /nologo /subsystem:windows /incremental:yes /machine:I386 /out:"Release/snes9x.exe" /libpath:"H:\FMOD\api\lib" /libpath:"H:\glide2x\lib" /delayload:fmod.dll # SUBTRACT LINK32 /profile /debug !ELSEIF "$(CFG)" == "Snes9X - Win32 Debug" @@ -72,7 +72,7 @@ # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /Zp4 /MT /W3 /GX /O2 /Ob2 /I "unzip" /I "H:\glide2x" /I "e:\zlib" /I "snes9x\unzip" /I "H:\FMOD\api\inc" /D "SPC700_SHUTDOWN" /D "CPU_SHUTDOWN" /D "ZLIB" /D "VAR_CYCLES" /D "SPC700_C" /D "UNZIP_SUPPORT" /D "ZSNES_C4" /D "ZSNES_FX" /D "EXECUTE_SUPERFX_PER_LINE" /D "__WIN32__" /D "__MSC__" /D "USE_GLIDE" /D "USE_OPENGL" /D "NDEBUG" /D "NETPLAY_SUPPORT" /D "FMOD_SUPPORT" /D "OLD_COLOUR_BLENDING" /FR /YX /FD /c -# ADD CPP /nologo /G6 /Zp4 /MTd /W3 /GX /Zi /Od /I "unzip" /I "H:\glide2x" /I "e:\zlib" /I "snes9x\unzip" /I "H:\FMOD\api\inc" /D "SPC700_C" /D "HAVE_LIBPNG" /D "JMA_SUPPORT" /D "SDD1_DECOMP" /D "CORRECT_VRAM_READS" /D "JP_FIX" /D "SPC700_SHUTDOWN" /D "CPU_SHUTDOWN" /D "ZLIB" /D "VAR_CYCLES" /D "UNZIP_SUPPORT" /D "ZSNES_FX" /D "EXECUTE_SUPERFX_PER_LINE" /D "__WIN32__" /D "__MSC__" /D "USE_OPENGL" /D "NDEBUG" /D "FMOD_SUPPORT" /D "OLD_COLOUR_BLENDING" /FR /YX /FD /c +# ADD CPP /nologo /G6 /Zp4 /MTd /W3 /GX /Zi /Od /I "unzip" /I "H:\glide2x" /I "e:\zlib" /I "snes9x\unzip" /I "H:\FMOD\api\inc" /D "SPC700_C" /D "USE_GLIDE" /D "SDD1_DECOMP" /D "CORRECT_VRAM_READS" /D "JP_FIX" /D "HAVE_LIBPNG" /D "SPC700_SHUTDOWN" /D "CPU_SHUTDOWN" /D "ZLIB" /D "VAR_CYCLES" /D "UNZIP_SUPPORT" /D "ZSNES_FX" /D "EXECUTE_SUPERFX_PER_LINE" /D "__WIN32__" /D "__MSC__" /D "USE_OPENGL" /D "NDEBUG" /D "NETPLAY_SUPPORT" /D "FMOD_SUPPORT" /D "OLD_COLOUR_BLENDING" /FR /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x413 /d "NDEBUG" @@ -82,7 +82,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 opengl32.lib glu32.lib kernel32.lib user32.lib gdi32.lib wsock32.lib advapi32.lib winmm.lib ddraw.lib dsound.lib dxguid.lib snes9xw.lib glide2x.lib delayimp.lib fmodvc.lib /nologo /subsystem:windows /profile /machine:I386 /libpath:"H:\FMOD\api\lib" /libpath:"H:\glide2x\lib" /delayload:fmod.dll -# ADD LINK32 libpngmtd.lib comctl32.lib comdlg32.lib shell32.lib ole32.lib winmm.lib opengl32.lib glu32.lib kernel32.lib user32.lib gdi32.lib wsock32.lib advapi32.lib ddraw.lib dsound.lib dxguid.lib delayimp.lib fmodvc.lib vfw32.lib /nologo /subsystem:windows /incremental:yes /debug /machine:I386 /out:"Snes9X___Win32_Debug/Snes9x.exe" /libpath:"H:\FMOD\api\lib" /libpath:"H:\glide2x\lib" /delayload:fmod.dll +# ADD LINK32 libpngmtd.lib glide2x.lib comctl32.lib comdlg32.lib shell32.lib ole32.lib winmm.lib opengl32.lib glu32.lib kernel32.lib user32.lib gdi32.lib wsock32.lib advapi32.lib ddraw.lib dsound.lib dxguid.lib delayimp.lib fmodvc.lib vfw32.lib /nologo /subsystem:windows /incremental:yes /debug /machine:I386 /out:"Snes9X___Win32_Debug/Snes9x.exe" /libpath:"H:\FMOD\api\lib" /libpath:"H:\glide2x\lib" /delayload:fmod.dll # SUBTRACT LINK32 /profile !ELSEIF "$(CFG)" == "Snes9X - Win32 C core" @@ -100,7 +100,7 @@ # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /Zp4 /MTd /W3 /GX /ZI /Od /I "unzip" /I "H:\glide2x" /I "e:\zlib" /I "snes9x\unzip" /I "H:\FMOD\api\inc" /D "SPC700_SHUTDOWN" /D "CPU_SHUTDOWN" /D "ZLIB" /D "VAR_CYCLES" /D "SPC700_C" /D "UNZIP_SUPPORT" /D "ZSNES_C4" /D "ZSNES_FX" /D "EXECUTE_SUPERFX_PER_LINE" /D "__WIN32__" /D "__MSC__" /D "USE_GLIDE" /D "USE_OPENGL" /D "NDEBUG" /D "NETPLAY_SUPPORT" /D "FMOD_SUPPORT" /D "OLD_COLOUR_BLENDING" /FR /YX /FD /c -# ADD CPP /nologo /Zp4 /MT /W3 /GX /Zi /O2 /I "unzip" /I "H:\glide2x" /I "e:\zlib" /I "snes9x\unzip" /I "H:\FMOD\api\inc" /D "HAVE_LIBPNG" /D "JMA_SUPPORT" /D "SDD1_DECOMP" /D "CORRECT_VRAM_READS" /D "JP_FIX" /D "SPC700_SHUTDOWN" /D "CPU_SHUTDOWN" /D "ZLIB" /D "VAR_CYCLES" /D "UNZIP_SUPPORT" /D "ZSNES_FX" /D "EXECUTE_SUPERFX_PER_LINE" /D "__WIN32__" /D "__MSC__" /D "USE_OPENGL" /D "NDEBUG" /D "FMOD_SUPPORT" /D "OLD_COLOUR_BLENDING" /YX /FD /c +# ADD CPP /nologo /Zp4 /MT /W3 /Zi /O2 /I "unzip" /I "H:\glide2x" /I "e:\zlib" /I "snes9x\unzip" /I "H:\FMOD\api\inc" /D "SDD1_DECOMP" /D "CORRECT_VRAM_READS" /D "JP_FIX" /D "HAVE_LIBPNG" /D "SPC700_SHUTDOWN" /D "CPU_SHUTDOWN" /D "ZLIB" /D "VAR_CYCLES" /D "UNZIP_SUPPORT" /D "ZSNES_FX" /D "EXECUTE_SUPERFX_PER_LINE" /D "__WIN32__" /D "__MSC__" /D "USE_OPENGL" /D "NDEBUG" /D "NETPLAY_SUPPORT" /D "FMOD_SUPPORT" /D "OLD_COLOUR_BLENDING" /YX /FD /c # SUBTRACT CPP /Fr # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" @@ -143,14 +143,6 @@ # End Source File # Begin Source File -SOURCE=.\InputCustom.cpp -# End Source File -# Begin Source File - -SOURCE=.\InputCustom.h -# End Source File -# Begin Source File - SOURCE=.\language.h # End Source File # Begin Source File @@ -187,20 +179,12 @@ SOURCE=.\wsnes9x.cpp # End Source File -# Begin Source File - -SOURCE=.\wsnes9x.h -# End Source File # End Group # Begin Group "Emu" # PROP Default_Filter "" # Begin Source File -SOURCE=.\0snes9X.rc -# End Source File -# Begin Source File - SOURCE=.\Snes9x\2xsai.cpp # End Source File # Begin Source File @@ -998,6 +982,10 @@ # End Source File # Begin Source File +SOURCE=.\Snes9X.rc +# End Source File +# Begin Source File + SOURCE=.\Snes9X\soundux.cpp !IF "$(CFG)" == "Snes9X - Win32 Release" @@ -1557,118 +1545,6 @@ # End Source File # End Group -# Begin Group "JMA" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\snes9x\jma\7z.h -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\7zlzma.cpp -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\aribitcd.h -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\ariconst.h -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\ariprice.h -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\btreecd.h -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\crc32.cpp -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\crc32.h -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\iiostrm.cpp -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\iiostrm.h -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\inbyte.cpp -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\inbyte.h -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\jma.cpp -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\jma.h -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\lencoder.h -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\litcoder.h -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\lzma.cpp -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\lzma.h -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\lzmadec.cpp -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\lzmadec.h -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\portable.h -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\rcdefs.h -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\rngcoder.h -# End Source File -# Begin Source File - -SOURCE=".\snes9x\jma\s9x-jma.cpp" -# End Source File -# Begin Source File - -SOURCE=".\snes9x\jma\s9x-jma.h" -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\winout.cpp -# End Source File -# Begin Source File - -SOURCE=.\snes9x\jma\winout.h -# End Source File -# End Group # Begin Source File SOURCE=.\Auxmath.cpp diff -NaHudr snes9x-1.43-src/snes9xw.sln snx/snes9xw.sln --- snes9x-1.43-src/snes9xw.sln 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9xw.sln 2005-03-20 23:46:37.000000000 +0200 @@ -0,0 +1,32 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Snes9X", "snes9xw.vcproj", "{B86059D8-C9A6-46BE-8FBA-3170C54F1DFD}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SourceCodeControl) = preSolution + SccNumberOfProjects = 1 + SccProjectUniqueName0 = snes9xw.vcproj + SccProjectName0 = snes9xw + SccLocalPath0 = ..\\.. + SccProvider0 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe + SccProjectFilePathRelativizedFromConnection0 = snes9x_1_43_wip1_source\\snes9x-1.43-dev-src\\ + EndGlobalSection + GlobalSection(SolutionConfiguration) = preSolution + C core = C core + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {B86059D8-C9A6-46BE-8FBA-3170C54F1DFD}.C core.ActiveCfg = C core|Win32 + {B86059D8-C9A6-46BE-8FBA-3170C54F1DFD}.C core.Build.0 = C core|Win32 + {B86059D8-C9A6-46BE-8FBA-3170C54F1DFD}.Debug.ActiveCfg = Debug|Win32 + {B86059D8-C9A6-46BE-8FBA-3170C54F1DFD}.Debug.Build.0 = Debug|Win32 + {B86059D8-C9A6-46BE-8FBA-3170C54F1DFD}.Release.ActiveCfg = Release|Win32 + {B86059D8-C9A6-46BE-8FBA-3170C54F1DFD}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff -NaHudr snes9x-1.43-src/snes9xw.suo snx/snes9xw.suo --- snes9x-1.43-src/snes9xw.suo 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9xw.suo 2005-03-20 23:46:37.000000000 +0200 @@ -0,0 +1,19 @@ +ÐÏࡱá>þÿ þÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýÿÿÿ + þÿÿÿþÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRoot Entryÿÿÿÿÿÿÿÿ ¬ -µ%Å@"ProjInfoExÿÿÿÿDevPartner Solution Properties>ÿÿÿÿÿÿÿÿÿÿÿÿTaskListUserTasks$ +ÿÿÿÿþÿÿÿþÿÿÿþÿÿÿþÿÿÿ þÿÿÿþÿÿÿþÿÿÿ þÿÿÿþÿÿÿþÿÿÿþÿÿÿEþÿÿÿ !"#$%&'G)þÿÿÿ+,-B/0123456789:;<=>?@þÿÿÿþÿÿÿCDþÿÿÿFPþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNOþÿÿÿQþÿÿÿÿÿÿÿÿÿÿÿUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€zíxZ…PqGŽ¶õ¤°âÚ¼ðC Device ControlsData +XML Schema Dialog EditorMobile Web Forms Web Forms +Components Windows FormsHTMLClipboard RingGeneralè"ÿþcC:\Documents and Settings\Justin\Desktop\snes9x_1_43_wiIToolboxService ÿÿÿÿÿÿÿÿ®IVSMDPropertyBrowser*ÿÿÿÿÿÿÿÿþÿÿÿIVSMDDesignerService*ÿÿÿÿÿÿÿÿþÿÿÿSourceCodeControl$ÿÿÿÿÿÿÿÿþp1_source\snes9x-1.43-dev-src\snes9xw.vcproj EndOfStreamC:\Documents and Settings\JuXc:\Program Files\Visual Studio\Vc7\crt\src\fc:\Program Files\Visual Studio\Vc7\atlmfc\src\mfc\fc:\Program Files\VisuDebuggerWatches ÿÿÿÿ +DebuggerBreakpoints(ÿÿÿÿM¸DebuggerExceptions&ÿÿÿÿ ÿÿÿÿ DebuggerFindSource&ÿÿÿÿÿÿÿÿÿÿÿÿ Dal Studio\Vc7\atlmfc\src\atl\iles\Visual Studio\Vc7\atlmfc\c:\Program Files\VisuÍëC:\Program Files\Microsoft Direc±)Ã)Í«4ï¾­Þø Í«4ï¾­ÞDebuggerFindSymbol& ÿÿÿÿDebuggerMemoryWindows,ÿÿÿÿÿÿÿÿÿÿÿÿTDevPartnerCoverage&ÿÿÿÿÿÿÿÿÿÿÿÿExternalFilesProjectContents:ÿÿÿÿÿÿÿÿ6m€Í«4ï¾­ÞáóÍ«4ï¾­ÞWXÍ«4ï¾­ÞbsÍ«4ï¾­ÞàïÍ«4ï¾­Þ¼ËÍ«4ï¾­ÞVkÍ«4ï¾­ÞMultiStartupProj=;4{B86059D8-C9A6-46BE-8FBA-3170C54F1DFD}.dwStartupOpt=;StartupProject=&{B86059D8-C9A6-46BE-8FBA-3170C54F1DFD};={B86059D8-C9A6-DocumentWindowPositions0ÿÿÿÿÿÿÿÿT3 DocumentWindowUserData.ÿÿÿÿÿÿÿÿäSolutionConfiguration, ÿÿÿÿbObjMgrContentsÿÿÿÿÿÿÿÿÿÿÿÿ(€46BE-8FBA-3170C54F1DFD}.Debug|Win32.fBatchBld=;?{B86059D8-C9A6-46BE-8FBA-3170C54F1DFD}.Release|Win32.fBatchBld=;>{B86059D8-C9A6-46BE-8FBA-3170C54F1DFD}.C core|Win32.fBatchBld=;4{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}.dwStartupOpt=; +ActivкñXˆ"¹E¬:Õc˜÷x rÉJA)˜jK¨× Rþ¸ªNSܾï MŠ%˜¿Ÿøç%Ò¯##G¶åá}'bm4Élü #Oÿ‡øϤESnes9X“Q ÈC:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9xw.vcprojÈC:\Documents and SettiC core|Win32DebugSettingsô.õ.ö. ø.÷.ù.ClassViewContents$ÿÿÿÿþÿÿÿProjExplorerState$ÿÿÿÿÿÿÿÿ*ÀUnloadedProjects"ÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿSnes9Xÿÿÿÿÿÿÿÿÿÿÿÿ.ú.û.ü.ý. ÿ.,GeneralConfigSettingsVCBscMakeTool ¢ÿÿ£H.\Snes9X___Win32_C_core/snes9xw.bsc(EndConfigPropertiesRelease|Win32DebugSettingsô.õ.ö. ø.÷.ù.ú.û.ü.ý. ÿ.,GeneralConfigSettingsVCBscMakeTool ¢ÿÿ£,.\Release/snes9xw.bsc(EndConfigPropertiesDebug|Win32DebugSettingsô.õ.ö. ø.÷.ù.ú.û.ü.ý. ÿ.,GeneralConfigSettingsVCBscMakeTool ¢ÿÿ£F.\Snes9X___Win32_Debug/snes9xw.bsc(EndConfigPropertiesXÏ +ngs\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9xw.vcprojGUIEmutX 9.0 SDK (Summer 2004)\Include\dsound.h<open> +c:\Program FileeCfg=Release;Í«4ï¾­Þ!TaskListShortcuts$ÿÿÿÿÿÿÿÿÿÿÿÿAResEdit.optÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿeCfg=Release;n\Desktop\snes9<Í«4ᆳޛͫ4ï¾­Þl{Í«4ï¾­ÞùüÍ«4ï¾­ÞÃÚ Í«4ï¾­ÞÍ«4ï¾­Þ~‘Í«4ï¾­Þˆ˜Í«4ï¾­Þq‹Í«4ï¾­Þ$7¬C:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\x.rcx_1_43_wip1_source\snes9x-1.43-dev-src\wsnes9x.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}2‘ +ÿÿˆ;  <  ˆ{B86059D8-C9A6-46BE-8FBA-3170C54F1DFD}|snes9xw.vcproj|c:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x\movie.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}123456E¸ +ÿÿˆ;  <  „{B86059D8-C9A6-46BE-8FBA-3170C54F1DFD}|snes9xw.vcproj|c:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x\movie.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}12E¸ +ÿÿˆ;  <  z{B86059D8-C9A6-46BE-8FBA-3170C54F1DFD}|snes9xw.vcproj|c:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\wsnes9x.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}1234H5 +ÿÿˆ;  <  Œ{B86059D8-C9A6-46BE-8FBA-3170C54F1DFD}|snes9xw.vcproj|c:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x\soundux.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}12E¸ +ÿÿˆ;  <  ˆ{B86059D8-C9A6-46BE-8FBA-3170C54F1DFD}|snes9xw.vcproj|c:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x\win32.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}123456E¸ +ÿÿˆ;  <  J{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|<MiscFiles>|C:\Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\Include\dsound.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}1234H5 +ÿÿ$ˆ;  <  8{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|<MiscFiles>|c:\Program Files\Visual Studio\Vc7\PlatformSDK\include\winuser.h||{D0E1A5C6-B359-4E‚ƒ„…†‡ˆþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿs\Visual Studio\Vc7\PlatformSDK\include\winuser.h<open> +gs\JuÍ«4ï¾­Þ¼ËÍ«4ï¾­ÞÙòÍ«4ï¾­Þ ® Í«4ï¾­ÞBA-3170C54F1DFdH5 +ÿÿˆ;  <  ~{B86059D8-C9A6-46BE-8FBA-3170C54F1DFD}|snes9xw.vcproj|c:\Documents and Settings\Justin\Desktop\snes941-9B60-3365922C2A22}123456snes9x\memmap.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}1234E¸ +ÿÿ!ˆ;  <  „{B86059D8-C9A6-46BE-8FBA-3170C54F1DFD}|snes9xw.vcproj|c:\Documents and Settings\Justin\Desktop\snes9x_1_43_wip1_source\snes9x-1.43-dev-src\snes9x\cp \ No newline at end of file diff -NaHudr snes9x-1.43-src/snes9xw.vcproj snx/snes9xw.vcproj --- snes9x-1.43-src/snes9xw.vcproj 1970-01-01 02:00:00.000000000 +0200 +++ snx/snes9xw.vcproj 2005-03-20 23:46:37.000000000 +0200 @@ -0,0 +1,2801 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -NaHudr snes9x-1.43-src/Valid.Ext snx/Valid.Ext --- snes9x-1.43-src/Valid.Ext 1970-01-01 02:00:00.000000000 +0200 +++ snx/Valid.Ext 2005-03-20 23:46:36.000000000 +0200 @@ -0,0 +1,23 @@ +N +smcN +zipY +gzY +swcN +figN +058N +078N +japN +usaN +048N +eurN +sfcN +1N +mgdN +ufoN +binN +gd3N +mghN +gd7N +ausN +dx2N +aN \ No newline at end of file diff -NaHudr snes9x-1.43-src/wsnes9x.cpp snx/wsnes9x.cpp --- snes9x-1.43-src/wsnes9x.cpp 2004-12-31 00:15:55.000000000 +0200 +++ snx/wsnes9x.cpp 2007-08-07 14:05:15.000000000 +0300 @@ -91,6 +91,11 @@ Nintendo Co., Limited and its subsidiary companies. *******************************************************************************/ +#ifdef __MINGW32__ +#define _WIN32_IE 0x0501 +#define _WIN32_WINNT 0x0501 +#endif + #include #include @@ -106,13 +111,21 @@ #include "snes9x/netplay.h" #include "snes9x/apu.h" #include "snes9x/movie.h" -#include "AVIOutput.h" -#include "InputCustom.h" +#include "AVIOutput.h" +#include "InputCustom.h" #include #include -#include +#if (((defined(_MSC_VER) && _MSC_VER >= 1300)) || defined(__MINGW32__)) +// both MINGW and VS.NET use fstream instead of fstream.h which is deprecated +#include +using namespace std; +#else + // for VC++ 6 + #include +#endif + #include //#include "string_cache.h" #include "language.h" @@ -154,6 +167,7 @@ int CALLBACK DlgNPOptions(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); int CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); int CALLBACK DlgInputConfig(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +int CALLBACK DlgHotkeyConfig(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); int CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); int CALLBACK DlgCheatSearch(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); int CALLBACK DlgCheatSearchAdd(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); @@ -233,16 +247,16 @@ static const char *rom_filename = NULL; CDirectX DirectX; -struct SJoypad Joypad[5] = { +struct SJoypad Joypad[10] = { { true, /* Joypad 1 enabled */ VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, /* Left, Right, Up, Down */ 0, 0, /* Left_Up, Left_Down */ 0, 0, /* Right_Up, Right_Down */ VK_RETURN, VK_SPACE, /* Start, Select */ - 'D', 'C', /* A B */ - 'S', 'X', /* X Y */ - 'A', 'Z' /* L R */ + 'V', 'C', /* A B */ + 'D', 'X', /* X Y */ + 'A', 'S' /* L R */ }, { false, /* Joypad 2 disabled */ @@ -271,9 +285,175 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } + }, + { + false, /* Joypad 1 Turbo disabled */ + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, /* Joypad 2 Turbo disabled */ + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, /* Joypad 3 Turbo disabled */ + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, /* Joypad 4 Turbo disabled */ + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, /* Joypad 5 Turbo disabled */ + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + } +}; + +// stores on/off toggle info for each key of each controller +SJoypad ToggleJoypadStorage [5] = { + { + false, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + } }; +SJoypad TurboToggleJoypadStorage [5] = { + { + false, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + } +}; + +struct SCustomKeys CustomKeys = { + {VK_OEM_PLUS,0}, // speed+ (=) + {VK_OEM_MINUS,0}, // speed- (-) + {VK_PAUSE,0}, // pause (PAUSE) + {VK_OEM_5,0}, // frame advance (\) + {VK_OEM_PLUS,CUSTKEY_SHIFT_MASK}, // skip+ (_) + {VK_OEM_MINUS,CUSTKEY_SHIFT_MASK}, // skip- (+) + {VK_OEM_3,0}, // superscope turbo (`) + {VK_OEM_2,0}, // superscope pause (/) + {VK_OEM_PERIOD,0}, // frame counter (.) + {'8',CUSTKEY_SHIFT_MASK}, // movie read-only (*) + {{VK_F1,CUSTKEY_SHIFT_MASK}, // save keys + {VK_F2,CUSTKEY_SHIFT_MASK}, + {VK_F3,CUSTKEY_SHIFT_MASK}, + {VK_F4,CUSTKEY_SHIFT_MASK}, + {VK_F5,CUSTKEY_SHIFT_MASK}, + {VK_F6,CUSTKEY_SHIFT_MASK}, + {VK_F7,CUSTKEY_SHIFT_MASK}, + {VK_F8,CUSTKEY_SHIFT_MASK}, + {VK_F9,CUSTKEY_SHIFT_MASK}, + {VK_F10,CUSTKEY_SHIFT_MASK}}, + {{VK_F1,0}, // load keys + {VK_F2,0}, + {VK_F3,0}, + {VK_F4,0}, + {VK_F5,0}, + {VK_F6,0}, + {VK_F7,0}, + {VK_F8,0}, + {VK_F9,0}, + {VK_F10,0}}, + {VK_TAB,0}, // fast forward (TAB) + {VK_OEM_COMMA,0}, // show pressed keys/buttons (,) + {VK_F12,0}, // save screenshot (F12) + {0,0}, // slot plus (disabled by default) + {0,0}, // slot minus (disabled by default) + {0,0}, // slot save (disabled by default) + {0,0}, // slot load (disabled by default) + {'1',0}, // background layer 1 + {'2',0}, // background layer 2 + {'3',0}, // background layer 3 + {'4',0}, // background layer 4 + {'5',0}, // sprite layer + {VK_BACK,0}, // Clipping Windows + {'8',0}, // BG Layering hack + {'9',0}, // Transparency + {'0',0}, // HDMA Emulation + {'6',CUSTKEY_SHIFT_MASK}, // GLCube Mode + {'9',CUSTKEY_SHIFT_MASK}, // Interpolate Mode 7 + {'6',0}, // Joypad Swap + {'7',0} // Switch Controllers +}; + + struct SSoundRates { uint32 rate; @@ -291,7 +471,7 @@ }; static uint32 FrameTimings[] = { - 1, 1, 4, 8, 17, 20, 35, 70, 140, 300, 500, 1000, 1000 + 4, 4, 8, 12, 17, 20, 35, 70, 140, 300, 500, 1000, 1000 }; // Languages supported by Snes9X: Windows @@ -301,7 +481,7 @@ { IDR_MENU_US, TEXT("DirectX failed to initialize!"), TEXT("DirectDraw failed to set the selected display mode!"), - TEXT("DirectSound failed to initialize, no sound will be played."), + TEXT("DirectSound failed to initialize; no sound will be played."), TEXT("These settings won't take effect until you restart the emulator."), TEXT("The frame timer failed to initialize, please do NOT select the automatic framerate option or Snes9X will crash!")}, { IDR_MENU_NL, @@ -316,18 +496,20 @@ { char Path[_MAX_PATH]; bool8 ReadOnly; + bool8 DisplayInput; uint8 ControllersMask; uint8 Opts; + uint8 SyncFlags; wchar_t Metadata[MOVIE_MAX_METADATA]; }; -struct dMode -{ - long height; - long width; - long depth; - int status; -}; - +struct dMode +{ + long height; + long width; + long depth; + int status; +}; + std::vector dm; /*****************************************************************************/ /* WinProc */ @@ -549,9 +731,9 @@ { int i; //bool showFPS; - static char InfoString [100]; + static char InfoString [100]; #ifdef NETPLAY_SUPPORT - char hostname [100]; + char hostname [100]; #endif switch (uMsg) { @@ -561,80 +743,387 @@ DeleteMenu(GUI.hMenu,IDM_CATCH_UP_SOUND,MF_BYCOMMAND); #endif return 0; + case WM_SYSKEYDOWN: case WM_KEYDOWN: - switch (wParam) { - case VK_TAB: - //until I decide how to really handle this - if(Settings.SPC7110RTC) - break; - if (GUI.TurboModeToggle) + // update toggles + for (int J = 0; J < 5; J++) { - Settings.TurboMode ^= TRUE; - if (Settings.TurboMode) - S9xMessage (S9X_INFO, S9X_TURBO_MODE, - WINPROC_TURBOMODE_ON); - else - S9xMessage (S9X_INFO, S9X_TURBO_MODE, - WINPROC_TURBOMODE_OFF); + extern bool S9xGetState (WORD KeyIdent); + if(Joypad[J].Enabled && (!S9xGetState(Joypad[J+5].Left))) // enabled and Togglify + { + SJoypad & p = ToggleJoypadStorage[J]; + if(wParam == Joypad[J].L) p.L = !p.L; + if(wParam == Joypad[J].R) p.R = !p.R; + if(wParam == Joypad[J].A) p.A = !p.A; + if(wParam == Joypad[J].B) p.B = !p.B; + if(wParam == Joypad[J].Y) p.Y = !p.Y; + if(wParam == Joypad[J].X) p.X = !p.X; + if(wParam == Joypad[J].Start) p.Start = !p.Start; + if(wParam == Joypad[J].Select) p.Select = !p.Select; + if(wParam == Joypad[J].Left) p.Left = !p.Left; + if(wParam == Joypad[J].Right) p.Right = !p.Right; + if(wParam == Joypad[J].Up) p.Up = !p.Up; + if(wParam == Joypad[J].Down) p.Down = !p.Down; +/// if(wParam == Joypad[J].Left_Down) p.Left_Down = !p.Left_Down; +/// if(wParam == Joypad[J].Left_Up) p.Left_Up = !p.Left_Up; +/// if(wParam == Joypad[J].Right_Down) p.Right_Down = !p.Right_Down; +/// if(wParam == Joypad[J].Right_Up) p.Right_Up = !p.Right_Up; + if(Settings.DisallowLeftRight) + { + if(p.Left && p.Right) + p.Left = p.Right = false; + if(p.Up && p.Down) + p.Up = p.Down = false; + } + } + if(Joypad[J].Enabled && (!S9xGetState(Joypad[J+5].Down))) // enabled and turbo-togglify (TurboTog) + { + SJoypad & p = TurboToggleJoypadStorage[J]; + if(wParam == Joypad[J].L) p.L = !p.L; + if(wParam == Joypad[J].R) p.R = !p.R; + if(wParam == Joypad[J].A) p.A = !p.A; + if(wParam == Joypad[J].B) p.B = !p.B; + if(wParam == Joypad[J].Y) p.Y = !p.Y; + if(wParam == Joypad[J].X) p.X = !p.X; + if(wParam == Joypad[J].Start) p.Start = !p.Start; + if(wParam == Joypad[J].Select) p.Select = !p.Select; +/// if(wParam == Joypad[J].Left) p.Left = !p.Left; +/// if(wParam == Joypad[J].Right) p.Right = !p.Right; +/// if(wParam == Joypad[J].Up) p.Up = !p.Up; +/// if(wParam == Joypad[J].Down) p.Down = !p.Down; +/// if(wParam == Joypad[J].Left_Down) p.Left_Down = !p.Left_Down; +/// if(wParam == Joypad[J].Left_Up) p.Left_Up = !p.Left_Up; +/// if(wParam == Joypad[J].Right_Down) p.Right_Down = !p.Right_Down; +/// if(wParam == Joypad[J].Right_Up) p.Right_Up = !p.Right_Up; +/* if(Settings.DisallowLeftRight) + { + if(p.Left && p.Right && ) + p.Left = p.Right = false; + if(p.Up && p.Down) + p.Up = p.Down = false; + }*/ + } + if(wParam == Joypad[J+5].Right) // clear all + { + { + SJoypad & p = ToggleJoypadStorage[J]; + p.L = false; + p.R = false; + p.A = false; + p.B = false; + p.Y = false; + p.X = false; + p.Start = false; + p.Select = false; + p.Left = false; + p.Right = false; + p.Up = false; + p.Down = false; + } + { + SJoypad & p = TurboToggleJoypadStorage[J]; + p.L = false; + p.R = false; + p.A = false; + p.B = false; + p.Y = false; + p.X = false; + p.Start = false; + p.Select = false; + p.Left = false; + p.Right = false; + p.Up = false; + p.Down = false; + } + } } - else + + + bool hitHotKey = false; + + if(!(wParam == 0 || wParam == VK_ESCAPE)) // if it's the 'disabled' key, it's never pressed as a hotkey + { + + int modifiers = 0; + if(GetAsyncKeyState(VK_MENU)) + modifiers |= CUSTKEY_ALT_MASK; + if(GetAsyncKeyState(VK_CONTROL)) + modifiers |= CUSTKEY_CTRL_MASK; + if(GetAsyncKeyState(VK_SHIFT)) + modifiers |= CUSTKEY_SHIFT_MASK; + + { + for(int i = 0 ; i < 10 ; i++) + { + if(wParam == CustomKeys.Save[i].key + && modifiers == CustomKeys.Save[i].modifiers) + { + FreezeUnfreeze (i, true); + hitHotKey = true; + } + if(wParam == CustomKeys.Load[i].key + && modifiers == CustomKeys.Load[i].modifiers) + { + FreezeUnfreeze (i, false); + hitHotKey = true; + } + } + + if(wParam == CustomKeys.SlotSave.key + && modifiers == CustomKeys.SlotSave.modifiers) + { + FreezeUnfreeze (Settings.CurrentSaveSlot, true); + hitHotKey = true; + } + if(wParam == CustomKeys.SlotLoad.key + && modifiers == CustomKeys.SlotLoad.modifiers) + { + FreezeUnfreeze (Settings.CurrentSaveSlot, false); + hitHotKey = true; + } + if(wParam == CustomKeys.SlotPlus.key + && modifiers == CustomKeys.SlotPlus.modifiers) + { + Settings.CurrentSaveSlot++; + if(Settings.CurrentSaveSlot > 9) + Settings.CurrentSaveSlot = 0; + + static char str [64]; + sprintf(str, "set slot 00%d", Settings.CurrentSaveSlot); + S9xSetInfoString(str); + + hitHotKey = true; + } + if(wParam == CustomKeys.SlotMinus.key + && modifiers == CustomKeys.SlotMinus.modifiers) + { + Settings.CurrentSaveSlot--; + if(Settings.CurrentSaveSlot < 0) + Settings.CurrentSaveSlot = 9; + + static char str [64]; + sprintf(str, "set slot 00%d", Settings.CurrentSaveSlot); + S9xSetInfoString(str); + + hitHotKey = true; + } + } + + + if(wParam == CustomKeys.FrameAdvance.key + && modifiers == CustomKeys.FrameAdvance.modifiers) + { + if(Settings.Paused) + { + Settings.FrameAdvance = true; + // kick the main thread out of GetMessage (just in case) + SendMessage(GUI.hWnd, WM_NULL, 0, 0); + } + else + { + Settings.Paused = true; + } + hitHotKey = true; + } + if(wParam == CustomKeys.FrameCount.key + && modifiers == CustomKeys.FrameCount.modifiers) + { + if (S9xMovieActive()) + S9xMovieToggleFrameDisplay (); + else + S9xMessage(S9X_INFO, S9X_MOVIE_INFO, "No movie; can't toggle frame count."); + hitHotKey = true; + } + if(wParam == CustomKeys.Pause.key + && modifiers == CustomKeys.Pause.modifiers) + { + Settings.Paused = Settings.Paused ^ true; + Settings.FrameAdvance = false; + hitHotKey = true; + } + if(wParam == CustomKeys.ReadOnly.key + && modifiers == CustomKeys.ReadOnly.modifiers) + { + if (S9xMovieActive()) + S9xMovieToggleRecState(); + else + S9xMessage(S9X_INFO, S9X_MOVIE_INFO, "No movie; can't toggle read-only."); + hitHotKey = true; + } + if(wParam == CustomKeys.FastForward.key + && modifiers == CustomKeys.FastForward.modifiers) + { + if(Settings.SPC7110RTC) + break; + if (GUI.TurboModeToggle) + { + Settings.TurboMode ^= TRUE; + if (Settings.TurboMode) + S9xMessage (S9X_INFO, S9X_TURBO_MODE, + WINPROC_TURBOMODE_ON); + else + S9xMessage (S9X_INFO, S9X_TURBO_MODE, + WINPROC_TURBOMODE_OFF); + } + else + { + Settings.TurboMode = TRUE; + S9xMessage (S9X_INFO, S9X_TURBO_MODE, WINPROC_TURBOMODE_TEXT); + } + hitHotKey = true; + } + if(wParam == CustomKeys.ShowPressed.key + && modifiers == CustomKeys.ShowPressed.modifiers) + { + Settings.DisplayPressedKeys = !Settings.DisplayPressedKeys; + + if(Settings.DisplayPressedKeys) + S9xMessage(S9X_INFO, S9X_MOVIE_INFO, "Input display enabled."); + else + S9xMessage(S9X_INFO, S9X_MOVIE_INFO, "Input display disabled."); + + hitHotKey = true; + } + if(wParam == CustomKeys.SaveScreenShot.key + && modifiers == CustomKeys.SaveScreenShot.modifiers) + { + Settings.TakeScreenshot=true; + } + if(wParam == CustomKeys.ScopePause.key + && modifiers == CustomKeys.ScopePause.modifiers) + { + superscope_pause ^= 1; + hitHotKey = true; + } + if(wParam == CustomKeys.ScopeTurbo.key + && modifiers == CustomKeys.ScopeTurbo.modifiers) + { + superscope_turbo ^= 1; + hitHotKey = true; + } + if(wParam == CustomKeys.SkipDown.key + && modifiers == CustomKeys.SkipDown.modifiers) + { + if (Settings.SkipFrames <= 1) + Settings.SkipFrames = AUTO_FRAMERATE; + else + if (Settings.SkipFrames != AUTO_FRAMERATE) + Settings.SkipFrames--; + + if (Settings.SkipFrames == AUTO_FRAMERATE) + S9xSetInfoString (WINPROC_AUTOSKIP); + else + { + sprintf (InfoString, WINPROC_FRAMESKIP, + Settings.SkipFrames - 1); + S9xSetInfoString (InfoString); + } + hitHotKey = true; + } + if(wParam == CustomKeys.SkipUp.key + && modifiers == CustomKeys.SkipUp.modifiers) + { + if (Settings.SkipFrames == AUTO_FRAMERATE) + Settings.SkipFrames = 1; + else + if (Settings.SkipFrames < 10) + Settings.SkipFrames++; + + if (Settings.SkipFrames == AUTO_FRAMERATE) + S9xSetInfoString (WINPROC_AUTOSKIP); + else + { + sprintf (InfoString, WINPROC_FRAMESKIP, + Settings.SkipFrames - 1); + S9xSetInfoString (InfoString); + } + hitHotKey = true; + } + if(wParam == CustomKeys.SpeedDown.key + && modifiers == CustomKeys.SpeedDown.modifiers) + { + // Increase emulated frame time + int i; + for(i=1; FrameTimings[i]> 16) & 0xffff); ClientToScreen (GUI.hWnd, &p); if ((!Settings.ForcedPause && !Settings.StopEmulation && - !Settings.Paused) && + !(Settings.Paused && !Settings.FrameAdvance)) && (IPPU.Controller == SNES_MOUSE || IPPU.Controller == SNES_MOUSE_SWAPPED)) { @@ -2088,12 +2555,14 @@ SetKey( "16bit Sound", Settings.SixteenBitSound); SetKey( "Interpolated Sound", Settings.InterpolatedSound); SetKey( "Sync Sound", Settings.SoundSync); + SetKey( "Fake Mute Desync Workaround", Settings.FakeMuteFix); SetKey( "Sound Envelope Height Reading", Settings.SoundEnvelopeHeightReading); SetKey( "Reverse Stereo", Settings.ReverseStereo); SetKey( "Disable Echo", Settings.DisableSoundEcho); SetKey( "Disable Sample Caching", Settings.DisableSampleCaching); SetKey( "Disable Master Volume", Settings.DisableMasterVolume); SetKey( "Mute Sound", Settings.Mute); + SetKey( "Frame Advance Mute", Settings.FAMute); SetKey( "Alt Sample Code Method", Settings.AltSampleDecode); SetKey( "Enable SPC700", Settings.NextAPUEnabled); SetKey( "Sound CPU Skip Method", Settings.SoundSkipMethod); @@ -2101,6 +2570,7 @@ SetKey( "Sound Buffer Length", Settings.SoundBufferSize); SetKey( "Sound Mix Interval", Settings.SoundMixInterval); SetKey( "Sound Driver", Settings.SoundDriver); + SetKey( "Use WIP APU Timing", Settings.UseWIPAPUTiming); SetKey( "Width", GUI.Width); SetKey( "Height", GUI.Height); @@ -2112,9 +2582,11 @@ SetKey( "Render SixteenBit", Settings.SixteenBit); SetKey( "Enable Transparency", Settings.Transparency); SetKey( "Support HiRes", Settings.SupportHiRes); + SetKey( "Extend Height", Settings.HeightExtend); SetKey( "Skip Frames", Settings.SkipFrames); SetKey( "Turbo Skip Frames", Settings.TurboSkipFrames); SetKey( "Turbo Mode Toggle", GUI.TurboModeToggle); + SetKey( "Pause When Inactive", GUI.InactivePause); SetKey( "Auto Max Skip Frames", Settings.AutoMaxSkipFrames); SetKey( "Joypad #1", Joypad[0]); @@ -2122,8 +2594,19 @@ SetKey( "Joypad #3", Joypad[2]); SetKey( "Joypad #4", Joypad[3]); SetKey( "Joypad #5", Joypad[4]); - SetKey( "Window Geometry", GUI.window_size); + SetKey( "Joypad #1 Turbo", Joypad[5]); + SetKey( "Joypad #2 Turbo", Joypad[6]); + SetKey( "Joypad #3 Turbo", Joypad[7]); + SetKey( "Joypad #4 Turbo", Joypad[8]); + SetKey( "Joypad #5 Turbo", Joypad[9]); + SetKey( "Hotkeys", CustomKeys); + + SetKey( "Disallow Left+Right/Up+Down", Settings.DisallowLeftRight); + SetKey( "Display Pressed Keys", Settings.DisplayPressedKeys); + + SetKey( "Window Geometry", GUI.window_size); SetKey( "Stretch", GUI.Stretch); + SetKey( "Aspect Ratio", Settings.AspectRatio); SetKey( "Fullscreen", GUI.FullScreen); RegSetValueEx (hKey, TEXT("Freeze File Directory"), 0, REG_SZ, (const unsigned char *) GUI.FreezeFileDir, @@ -2137,8 +2620,9 @@ SetKey( "NetPlay Max Frame Skip", NetPlay.MaxFrameSkip); SetKey( "NetPlay Max Behind Frame Count", NetPlay.MaxBehindFrameCount); #endif - SetKey( "Bi-Linear Filter Mode7", Settings.Mode7Interpolate); - SetKey( "Use Hardware Video Memory",GUI.VideoMemory); + SetKey( "Bi-Linear Filter Mode7", Settings.Mode7Interpolate); + SetKey( "Use Hardware Video Memory", GUI.VideoMemory); + SetKey( "Current Save Slot", Settings.CurrentSaveSlot); RegSetValueEx (hKey, TEXT("StarOcean"), 0, REG_SZ, (const unsigned char *) GUI.StarOceanPack, @@ -2192,28 +2676,27 @@ } } -static void WinSetDefaultValues () +static void WinSetDefaultValues () +{ + HKEY hKey; + char temp[4]; + strcpy(temp,"C:\\"); + if (RegCreateKeyEx (HKEY_CURRENT_USER, + S9X_REG_KEY_BASE TEXT("\\") S9X_REG_KEY_VERSION, 0, NULL, + REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, + NULL) == ERROR_SUCCESS) + RegCloseKey(hKey); + if(RegOpenKeyEx(HKEY_CURRENT_USER, MY_REG_KEY, 0, KEY_ALL_ACCESS, &hKey)==ERROR_SUCCESS) + { + if(RegQueryValueEx(hKey,TEXT("Last Directory"),NULL,NULL,NULL,NULL)!=ERROR_SUCCESS) + { + RegSetValueEx(hKey,TEXT("Last Directory"),0,REG_SZ,(uint8*)temp,strlen(temp)+1); + } + RegCloseKey(hKey); + } + else + -{ - HKEY hKey; - char temp[4]; - strcpy(temp,"C:\\"); - if (RegCreateKeyEx (HKEY_CURRENT_USER, - S9X_REG_KEY_BASE TEXT("\\") S9X_REG_KEY_VERSION, 0, NULL, - REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, - NULL) == ERROR_SUCCESS) - RegCloseKey(hKey); - if(RegOpenKeyEx(HKEY_CURRENT_USER, MY_REG_KEY, 0, KEY_ALL_ACCESS, &hKey)==ERROR_SUCCESS) - { - if(RegQueryValueEx(hKey,TEXT("Last Directory"),NULL,NULL,NULL,NULL)!=ERROR_SUCCESS) - { - RegSetValueEx(hKey,TEXT("Last Directory"),NULL,REG_SZ,(uint8*)temp,strlen(temp)+1); - } - RegCloseKey(hKey); - } - else - - GUI.IgnoreNextMouseMove = false; GUI.window_size.left = 0; @@ -2230,8 +2713,9 @@ GUI.Stretch = false; GUI.PausedFramesBeforeMutingSound = 20; GUI.FlipCounter = 0; - GUI.NumFlipFrames = 1; + GUI.NumFlipFrames = 1; GUI.VideoMemory = false; + WinDeleteRecentGamesList (); // ROM Options @@ -2256,6 +2740,7 @@ Settings.DisableSoundEcho = FALSE; Settings.DisableMasterVolume = FALSE; Settings.Mute = FALSE; + Settings.FAMute = FALSE; Settings.SoundSkipMethod = 0; Settings.SoundPlaybackRate = 32000; Settings.SixteenBitSound = TRUE; @@ -2313,11 +2798,14 @@ Settings.ForceNoTransparency = false; Settings.DisableHDMA = false; Settings.Mode7Interpolate = false; + Settings.HeightExtend = false; Settings.DisplayFrameRate = false; Settings.SixteenBit = true; Settings.Transparency = true; Settings.SupportHiRes = true; + Settings.DisplayPressedKeys = false; + Settings.CurrentSaveSlot = 0; Settings.AutoSaveDelay = 15; Settings.ApplyCheats = true; @@ -2354,7 +2842,7 @@ if (RegOpenKeyEx (HKEY_CURRENT_USER, S9X_REG_KEY_BASE TEXT("\\") S9X_REG_KEY_VERSION, 0, KEY_READ, &hKey) == ERROR_SUCCESS) - { + { GetKey( "Language", GUI.Language); GetKey( "Stereo Sound", Settings.Stereo); @@ -2370,9 +2858,11 @@ GetKeyDef( "Render SixteenBit", Settings.SixteenBit, true); GetKeyDef( "Enable Transparency", Settings.Transparency, true); GetKeyDef( "Support HiRes", Settings.SupportHiRes, true); + GetKeyDef( "Extend Height", Settings.HeightExtend, false); GetKeyDef( "Skip Frames", Settings.SkipFrames, AUTO_FRAMERATE); GetKeyDef( "Turbo Skip Frames", Settings.TurboSkipFrames, 15); GetKeyDef( "Turbo Mode Toggle", GUI.TurboModeToggle, FALSE); + GetKeyDef( "Pause When Inactive", GUI.InactivePause, TRUE); GetKeyDef( "Auto Max Skip Frames", Settings.AutoMaxSkipFrames, 10); GetKeyDef( "Bi-Linear Filter Mode7", Settings.Mode7Interpolate, false); @@ -2381,20 +2871,33 @@ GetKey( "Joypad #3", Joypad[2]); GetKey( "Joypad #4", Joypad[3]); GetKey( "Joypad #5", Joypad[4]); - GetKey( "Window Geometry", GUI.window_size); + GetKey( "Joypad #1 Turbo", Joypad[5]); + GetKey( "Joypad #2 Turbo", Joypad[6]); + GetKey( "Joypad #3 Turbo", Joypad[7]); + GetKey( "Joypad #4 Turbo", Joypad[8]); + GetKey( "Joypad #5 Turbo", Joypad[9]); + GetKey( "Hotkeys", CustomKeys); + + GetKeyDef( "Disallow Left+Right/Up+Down", Settings.DisallowLeftRight, true); + GetKeyDef( "Display Pressed Keys", Settings.DisplayPressedKeys, false); + + GetKey( "Window Geometry", GUI.window_size); GetKeyDef( "Stretch", GUI.Stretch, false); + GetKeyDef( "Aspect Ratio", Settings.AspectRatio, true); GetKeyDef( "Fullscreen", GUI.FullScreen, false); GetKeyDef( "Playback Rate", Settings.SoundPlaybackRate, 22050); GetKeyDef( "Stereo Sound", Settings.Stereo, true); GetKeyDef( "16bit Sound", Settings.SixteenBitSound, true); GetKeyDef( "Interpolated Sound", Settings.InterpolatedSound, true); GetKeyDef( "Sync Sound", Settings.SoundSync, false); + GetKeyDef( "Fake Mute Desync Workaround", Settings.FakeMuteFix, false); GetKeyDef( "Sound Envelope Height Reading", Settings.SoundEnvelopeHeightReading, true); GetKeyDef( "Reverse Stereo", Settings.ReverseStereo, false); GetKeyDef( "Disable Echo", Settings.DisableSoundEcho, false); GetKeyDef( "Disable Sample Caching", Settings.DisableSampleCaching, false); GetKeyDef( "Disable Master Volume", Settings.DisableMasterVolume, false); GetKeyDef( "Mute Sound", Settings.Mute, false); + GetKeyDef( "Frame Advance Mute", Settings.FAMute, false); GetKeyDef( "Alt Sample Code Method", Settings.AltSampleDecode, false); GetKeyDef( "Enable SPC700", Settings.NextAPUEnabled, true); Settings.APUEnabled = Settings.NextAPUEnabled; @@ -2403,6 +2906,7 @@ GetKeyDef( "Sound Buffer Length", Settings.SoundBufferSize, 1); GetKeyDef( "Sound Mix Interval", Settings.SoundMixInterval, 10); GetKeyDef( "Sound Driver", Settings.SoundDriver, WIN_SNES9X_DIRECT_SOUND_DRIVER); + GetKeyDef( "Use WIP APU Timing", Settings.UseWIPAPUTiming, false); GetKeyDef( "Auto Save Delay", Settings.AutoSaveDelay, 30); GetKeyDef( "Apply Cheats", Settings.ApplyCheats, true); #ifdef NETPLAY_SUPPORT @@ -2411,8 +2915,9 @@ GetKeyDef( "NetPlay Send ROM On Connect", NPServer.SendROMImageOnConnect, false); GetKeyDef( "NetPlay Max Frame Skip", NetPlay.MaxFrameSkip, 10); GetKeyDef( "NetPlay Max Behind Frame Count", NetPlay.MaxBehindFrameCount, 10); -#endif - GetKeyDef( "Use Hardware Video Memory",GUI.VideoMemory, false); +#endif + GetKeyDef( "Use Hardware Video Memory", GUI.VideoMemory, true); + GetKeyDef( "Current Save Slot", Settings.CurrentSaveSlot, 0); cbData = _MAX_PATH + 1; RegQueryValueEx (hKey, TEXT("Freeze File Directory"), 0, NULL, (unsigned char *) GUI.FreezeFileDir, &cbData); @@ -2480,7 +2985,7 @@ GUI.RecentGames [j] = strdup (path); } } - RegCloseKey( hKey); + RegCloseKey( hKey); } @@ -2543,7 +3048,7 @@ if (Settings.NetPlayServer) { //- WaitForSingleObject (GUI.ServerTimerSemaphore, 0); - if (Settings.Paused || Settings.StopEmulation || Settings.ForcedPause) + if ((Settings.Paused && !Settings.FrameAdvance) || Settings.StopEmulation || Settings.ForcedPause) { WaitForSingleObject (GUI.ServerTimerSemaphore, 0); return; @@ -2700,7 +3205,11 @@ TIMECAPS tc; if (timeGetDevCaps(&tc, sizeof(TIMECAPS))== TIMERR_NOERROR) { +#ifdef __MINGW32__ + wSoundTimerRes = min(max(tc.wPeriodMin, 1), tc.wPeriodMax); +#else wSoundTimerRes = min(max(tc.wPeriodMin, 1), tc.wPeriodMax); +#endif timeBeginPeriod (wSoundTimerRes); } @@ -2717,7 +3226,7 @@ GUI.FrameTimerSemaphore = CreateSemaphore (NULL, 0, 10, NULL); GUI.ServerTimerSemaphore = CreateSemaphore (NULL, 0, 10, NULL); - if (GUI.hFrameTimer == NULL) + if (GUI.hFrameTimer == 0) { MessageBox( GUI.hWnd, Languages[ GUI.Language].errFrameTimer, TEXT("Snes9X - Frame Timer"), MB_OK | MB_ICONINFORMATION); } @@ -2806,17 +3315,21 @@ } } - if(run_loop) - { - S9xMainLoop(); - DirectX.FrameCount++; - } if(Settings.FrameAdvance) { + if(GFX.InfoStringTimeout > 4) + GFX.InfoStringTimeout = 4; + Settings.FrameAdvance = false; } + if(run_loop) + { + S9xMainLoop(); + DirectX.FrameCount++; + } + #ifdef NETPLAY_SUPPORT } #endif @@ -3017,8 +3530,18 @@ mii.fState = GUI.FullScreen ? MFS_CHECKED : MFS_UNCHECKED; SetMenuItemInfo (GUI.hMenu, ID_WINDOW_FULLSCREEN, FALSE, &mii); + mii.fState = GUI.Stretch ? MFS_CHECKED : MFS_UNCHECKED; SetMenuItemInfo (GUI.hMenu, ID_WINDOW_STRETCH, FALSE, &mii); + + mii.fState = GUI.Stretch ? (Settings.AspectRatio ? MFS_CHECKED : MFS_UNCHECKED) : MFS_CHECKED|MFS_DISABLED; + SetMenuItemInfo (GUI.hMenu, ID_WINDOW_ASPECTRATIO, FALSE, &mii); + + mii.fState = GUI.VideoMemory ? MFS_CHECKED : MFS_UNCHECKED; + if(!GUI.Stretch) + mii.fState |= MFS_DISABLED; + SetMenuItemInfo (GUI.hMenu, ID_WINDOW_VIDMEM, FALSE, &mii); + mii.fState = Settings.Paused ? MFS_CHECKED : MFS_UNCHECKED; SetMenuItemInfo (GUI.hMenu, ID_FILE_PAUSE, FALSE, &mii); @@ -3617,12 +4140,32 @@ mii.fType = MFT_STRING; mii.fState = MFS_UNCHECKED; - for (i = 0; i < 10 && GUI.RecentGames && GUI.RecentGames [i]; i++) + for (i = 0; i < MAX_RECENT_GAMES_LIST_SIZE && GUI.RecentGames && GUI.RecentGames [i]; i++) { // Build up a menu item string in the form: // 1. - sprintf (name, TEXT("&%c. %s"), i < 9 ? '1' + i : 'A' + i - 9, - S9xBasename (GUI.RecentGames [i])); + + sprintf (name, TEXT("&%c. "), i < 9 ? '1' + i : 'A' + i - 9); + + // append the game title to name, with formatting modifications as necessary + { + TCHAR baseName [256]; + strcpy (baseName, S9xBasename (GUI.RecentGames [i])); + int pos = strlen (name), baseNameLen = strlen (baseName); + for (int j = 0; j < baseNameLen ; j++) + { + char c = baseName [j]; + name [pos++] = c; + + // & is a special character in Windows menus, + // so we have to change & to && when copying over the game title + // otherwise "Pocky & Rocky (U).smc" will show up as "Pocky _Rocky (U).smc", for example + if(c == '&') + name [pos++] = '&'; + } + name [pos] = '\0'; + } + mii.dwTypeData = name; mii.cch = strlen (name) + 1; mii.wID = 0xFF00 + i; @@ -3761,6 +4304,8 @@ } if(set->Mute) SendDlgItemMessage(hDlg,IDC_MUTE,BM_SETCHECK,BST_CHECKED,0); + if(set->FAMute) + SendDlgItemMessage(hDlg,IDC_FAMT,BM_SETCHECK,BST_CHECKED,0); if(set->NextAPUEnabled) { @@ -3774,6 +4319,10 @@ SendDlgItemMessage(hDlg,IDC_SYNC_TO_SOUND_CPU,BM_SETCHECK,BST_CHECKED,0); if(set->SoundEnvelopeHeightReading) SendDlgItemMessage(hDlg,IDC_ENVX,BM_SETCHECK,BST_CHECKED,0); + if(set->FakeMuteFix) + SendDlgItemMessage(hDlg,IDC_FMUT,BM_SETCHECK,BST_CHECKED,0); + if(set->UseWIPAPUTiming) + SendDlgItemMessage(hDlg,IDC_WIP1,BM_SETCHECK,BST_CHECKED,0); if(!set->DisableSoundEcho) SendDlgItemMessage(hDlg,IDC_ECHO,BM_SETCHECK,BST_CHECKED,0); @@ -3793,6 +4342,7 @@ { EnableWindow(GetDlgItem(hDlg, IDC_CACHING), FALSE); EnableWindow(GetDlgItem(hDlg, IDC_MUTE), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_FAMT), FALSE); EnableWindow(GetDlgItem(hDlg, IDC_ANTIRES), FALSE); EnableWindow(GetDlgItem(hDlg, IDC_SKIP_TYPE), TRUE); EnableWindow(GetDlgItem(hDlg, IDC_DRIVER), FALSE); @@ -3807,7 +4357,7 @@ EnableWindow(GetDlgItem(hDlg, IDC_BUFLEN), FALSE); EnableWindow(GetDlgItem(hDlg, IDC_MIX), FALSE); EnableWindow(GetDlgItem(hDlg, IDC_SYNC_TO_SOUND_CPU), FALSE); - + EnableWindow(GetDlgItem(hDlg, IDC_FMUT), FALSE); } return true; @@ -3848,8 +4398,11 @@ set->Stereo=IsDlgButtonChecked(hDlg, IDC_STEREO); set->ReverseStereo=IsDlgButtonChecked(hDlg, IDC_REV_STEREO); set->Mute=IsDlgButtonChecked(hDlg, IDC_MUTE); + set->FAMute=IsDlgButtonChecked(hDlg, IDC_FAMT); set->NextAPUEnabled=IsDlgButtonChecked(hDlg, IDC_SPC700ON); set->SoundEnvelopeHeightReading=IsDlgButtonChecked(hDlg, IDC_ENVX); + set->FakeMuteFix=IsDlgButtonChecked(hDlg, IDC_FMUT); + set->UseWIPAPUTiming=IsDlgButtonChecked(hDlg, IDC_WIP1); set->DisableSoundEcho=(!IsDlgButtonChecked(hDlg, IDC_ECHO)); //set->DisableSampleCaching=(!IsDlgButtonChecked(hDlg, IDC_CACHING)); @@ -3888,6 +4441,7 @@ { EnableWindow(GetDlgItem(hDlg, IDC_CACHING), FALSE); EnableWindow(GetDlgItem(hDlg, IDC_MUTE), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_FAMT), FALSE); EnableWindow(GetDlgItem(hDlg, IDC_ANTIRES), FALSE); EnableWindow(GetDlgItem(hDlg, IDC_SKIP_TYPE), TRUE); EnableWindow(GetDlgItem(hDlg, IDC_DRIVER), FALSE); @@ -3902,6 +4456,7 @@ EnableWindow(GetDlgItem(hDlg, IDC_BUFLEN), FALSE); EnableWindow(GetDlgItem(hDlg, IDC_MIX), FALSE); EnableWindow(GetDlgItem(hDlg, IDC_SYNC_TO_SOUND_CPU), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_FMUT), FALSE); } else @@ -3917,6 +4472,8 @@ EnableWindow(GetDlgItem(hDlg, IDC_SKIP_TYPE), FALSE); EnableWindow(GetDlgItem(hDlg, IDC_ANTIRES), TRUE); EnableWindow(GetDlgItem(hDlg, IDC_MUTE), TRUE); + EnableWindow(GetDlgItem(hDlg, IDC_FAMT), TRUE); + EnableWindow(GetDlgItem(hDlg, IDC_FMUT), TRUE); if(!IsDlgButtonChecked(hDlg,IDC_ANTIRES)) EnableWindow(GetDlgItem(hDlg, IDC_CACHING), TRUE); if(IsDlgButtonChecked(hDlg,IDC_STEREO)) @@ -4858,12 +5415,10 @@ SendDlgItemMessage(hDlg, IDC_SRAM_SPIN,UDM_SETPOS,0, Settings.AutoSaveDelay); SendDlgItemMessage(hDlg, IDC_SPIN_MAX_SKIP, UDM_SETRANGE, 0, MAKELPARAM((short)59, (short)0)); SendDlgItemMessage(hDlg, IDC_SPIN_MAX_SKIP,UDM_SETPOS,0, Settings.AutoMaxSkipFrames); - SendDlgItemMessage(hDlg, IDC_SPIN_TURBO_SKIP, UDM_SETRANGE, 0, MAKELPARAM((short)59, (short)0)); + SendDlgItemMessage(hDlg, IDC_SPIN_TURBO_SKIP, UDM_SETRANGE, 0, MAKELPARAM((short)600, (short)0)); SendDlgItemMessage(hDlg, IDC_SPIN_TURBO_SKIP,UDM_SETPOS,0, Settings.TurboSkipFrames); - if(GUI.TurboModeToggle) - { - CheckDlgButton(hDlg,IDC_TOGGLE_TURBO,BST_CHECKED); - } + CheckDlgButton(hDlg,IDC_TOGGLE_TURBO,GUI.TurboModeToggle ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hDlg,IDC_INACTIVE_PAUSE,GUI.InactivePause ? BST_CHECKED : BST_UNCHECKED); } case WM_PAINT: { @@ -4914,9 +5469,9 @@ break; case IDOK: GetDlgItemText(hDlg, IDC_FREEZE_FOLDER,GUI.FreezeFileDir, MAX_PATH); - if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_TOGGLE_TURBO)) - GUI.TurboModeToggle=true; - else GUI.TurboModeToggle=false; + GUI.TurboModeToggle = (BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_TOGGLE_TURBO)); + GUI.InactivePause = (BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_INACTIVE_PAUSE)); + Settings.TurboSkipFrames=SendDlgItemMessage(hDlg, IDC_SPIN_TURBO_SKIP, UDM_GETPOS, 0,0); Settings.AutoMaxSkipFrames=SendDlgItemMessage(hDlg, IDC_SPIN_MAX_SKIP, UDM_GETPOS, 0,0); Settings.AutoSaveDelay=SendDlgItemMessage(hDlg, IDC_SRAM_SPIN, UDM_GETPOS, 0,0); @@ -5185,7 +5740,7 @@ TreeView_GetItem(GetDlgItem(hDlg, tree), &tv); sprintf(selected, TEXT("%s"), temp); - while(TreeView_GetParent(GetDlgItem(hDlg, tree), hTreeTemp)!=NULL) + while(TreeView_GetParent(GetDlgItem(hDlg, tree), hTreeTemp)) { temp[0]='\0'; hTreeTemp=TreeView_GetParent(GetDlgItem(hDlg, tree), hTreeTemp); @@ -5249,7 +5804,7 @@ ZeroMemory(&tvis, sizeof(TV_INSERTSTRUCT)); tvis.hParent=hParent; tvis.hInsertAfter=TVI_SORT; - tvis.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE; + tvis.item.mask = TVIF_STATE | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE; tvis.item.pszText=wfd.cFileName; tvis.item.cchTextMax=MAX_PATH; tvis.item.iImage=4; @@ -5296,6 +5851,48 @@ //scan for folders } + +/* +void OnOdfinditem(NMHDR* pNMHDR, LRESULT* pResult) +{ + NMLVFINDITEM* pFindInfo = (NMLVFINDITEM*)pNMHDR; + LVFINDINFO FindItem = pFindInfo->lvfi; + + int i; + if(FindItem.flags & LVFI_STRING) + { + TCHAR chKeyL = FindItem.psz[0]; + TCHAR chKeyH = _toupper(FindItem.psz[0]);; + + // Search to end. + for( i = pFindInfo->iStart; i < m_LabelCount; i++ ) + { + if( ( chKeyL == m_arLabels[i].m_strText[0] ) + || ( chKeyH == m_arLabels[i].m_strText[0] ) + ) + { + *pResult = i; + return; + } + } + + // Search from 0 to start. + for( i = 0; i < pFindInfo->iStart; i++ ) + { + if( ( chKeyL == m_arLabels[i].m_strText[0] ) + || ( chKeyH == m_arLabels[i].m_strText[0] ) + ) + { + *pResult = i; + return; + } + } + } + + *pResult = -1; // Default action. +} +*/ + void ListFilesFromFolder(HWND hDlg, RomDataList** prdl) { RomDataList* rdl= *prdl; @@ -5307,7 +5904,6 @@ temp[0]='\0'; ZeroMemory(&tv, sizeof(TVITEM)); HTREEITEM hTreeItem=TreeView_GetSelection(GetDlgItem(hDlg, IDC_ROM_DIR)); - HTREEITEM hTreeTemp=hTreeItem; GetPathFromTree(hDlg, IDC_ROM_DIR, selected, hTreeItem); @@ -5374,8 +5970,8 @@ SendDlgItemMessage(hDlg, IDC_ROMLIST, WM_SETREDRAW, TRUE, 0); *prdl=rdl; -ListView_SetItemCount (GetDlgItem(hDlg, IDC_ROMLIST), count); - ListView_SetItemState(GetDlgItem(hDlg,IDC_ROMLIST), 0, LVIS_SELECTED|LVIS_FOCUSED,LVIS_FOCUSED|LVIS_SELECTED); + ListView_SetItemCount (GetDlgItem(hDlg, IDC_ROMLIST), count); + ListView_SetItemState (GetDlgItem(hDlg,IDC_ROMLIST), 0, LVIS_SELECTED|LVIS_FOCUSED,LVIS_FOCUSED|LVIS_SELECTED); } @@ -5403,8 +5999,9 @@ wcex.lpfnWndProc=DlgChildSplitProc; wcex.lpszClassName=tempclassname; wcex.hbrBackground=(HBRUSH)GetStockObject(LTGRAY_BRUSH); - wcex.hCursor=LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZEWE)); - ATOM aSplitter=RegisterClassEx(&wcex); + wcex.hCursor=LoadCursor(NULL, IDC_SIZEWE); +/// wcex.hCursor=LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZEWE)); +/// ATOM aSplitter=RegisterClassEx(&wcex); GetWindowRect(GetDlgItem(hDlg, IDC_ROM_DIR), &treeRect); GetWindowRect(GetDlgItem(hDlg, IDC_ROMLIST), &listRect); POINT p; @@ -5510,15 +6107,26 @@ HKEY hKey; char drive [_MAX_DRIVE + 1]; - strcpy(drive,"C:\\"); + strcpy (drive,"C:\\"); + // fix the NTDLR problem and set the correct directory if(!RegOpenKeyEx(HKEY_CURRENT_USER, MY_REG_KEY, 0, KEY_ALL_ACCESS, &hKey)) { - dw=MAX_PATH; + HANDLE fFile; + WIN32_FIND_DATA dirinfo; + dw = MAX_PATH; buffer[0]='\0'; - result=RegQueryValueEx(hKey, TEXT("Last Directory"), NULL,NULL, (uint8*)buffer,&dw); + result=RegQueryValueEx(hKey, TEXT("Last Directory"), NULL, NULL, (uint8*)buffer, &dw); RegCloseKey(hKey); - _splitpath(buffer,drive, NULL, NULL, NULL); + + fFile = FindFirstFile (buffer, &dirinfo); + + if ((dirinfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) + strcpy (buffer, "C:\\"); // default in case no directory was found + + FindClose (fFile); + + _splitpath (buffer, drive, NULL, NULL, NULL); } DWORD driveMask=GetLogicalDrives(); @@ -5537,8 +6145,10 @@ driveName[3]='\0'; UINT driveType=GetDriveType(driveName); driveName[2]='\0'; + TVINSERTSTRUCT tvis; ZeroMemory(&tvis, sizeof(TVINSERTSTRUCT)); + tvis.hParent=NULL; tvis.hInsertAfter=TVI_ROOT; tvis.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE; @@ -5547,7 +6157,8 @@ tvis.item.iSelectedImage=tvis.item.iImage=0; else if(driveType==DRIVE_REMOTE) tvis.item.iSelectedImage=tvis.item.iImage=2; - else tvis.item.iSelectedImage=tvis.item.iImage=1; + else + tvis.item.iSelectedImage=tvis.item.iImage=1; tvis.item.pszText=driveName; @@ -5561,7 +6172,6 @@ strcat(temp, TEXT("\\*")); bool subdir=false; - if(driveType==DRIVE_REMOVABLE || driveType == DRIVE_CDROM || driveType == DRIVE_UNKNOWN) { TV_INSERTSTRUCT tvis; @@ -5610,7 +6220,7 @@ hTreePrev=hTreeDrive; HTREEITEM hTemp=hTreePrev; TCHAR* temp=buffer; - TCHAR * temp2; + TCHAR* temp2; do { temp2=strstr(temp, TEXT("\\")); @@ -5621,12 +6231,14 @@ tvi.pszText=blah; tvi.cchTextMax=MAX_PATH; blah[0]='\0'; + if(temp2) *temp2='\0'; tvi.hItem=hTemp; TreeView_GetItem(GetDlgItem(hDlg, IDC_ROM_DIR), &tvi); - if(strcmp(blah, temp)) + + if(strcmp(blah, temp) != 0) { do { @@ -5637,54 +6249,33 @@ tvi.hItem=hTemp; TreeView_GetItem(GetDlgItem(hDlg, IDC_ROM_DIR), &tvi); } - while(hTemp!=NULL&&strcmp(blah, temp)); + while((hTemp != NULL) && (strcmp(blah, temp) != 0)); + if(hTemp!=NULL) { hTreePrev=hTemp; + if(temp2==NULL) - { TreeView_SelectItem(GetDlgItem(hDlg, IDC_ROM_DIR), hTreePrev); - TreeView_EnsureVisible (GetDlgItem(hDlg, IDC_ROM_DIR), hTreePrev); - } else - { - TCHAR get_dir[MAX_PATH]; - while(TreeView_GetChild(GetDlgItem(hDlg, IDC_ROM_DIR),hTreePrev)) - { - TreeView_DeleteItem(GetDlgItem(hDlg, IDC_ROM_DIR), TreeView_GetChild(GetDlgItem(hDlg, IDC_ROM_DIR),hTreePrev)); - } - TreeView_SetItemState(GetDlgItem(hDlg, IDC_ROM_DIR), hTreePrev, TVIS_EXPANDED ,TVIS_EXPANDED ); - GetPathFromTree(hDlg, IDC_ROM_DIR, get_dir, hTreePrev); - ExpandDir(get_dir, hTreePrev, hDlg); - //TreeView_Expand(GetDlgItem(hDlg, IDC_ROM_DIR), hTreePrev, TVE_EXPAND); - } + TreeView_Expand(GetDlgItem(hDlg, IDC_ROM_DIR), hTreePrev, TVE_EXPAND); + hTemp=TreeView_GetChild(GetDlgItem(hDlg, IDC_ROM_DIR), hTreePrev); } } else { - if(NULL==temp2) - { + if(temp2==NULL) TreeView_SelectItem(GetDlgItem(hDlg, IDC_ROM_DIR), hTemp); - } else - { - TCHAR get_dir[MAX_PATH]; - while(TreeView_GetChild(GetDlgItem(hDlg, IDC_ROM_DIR),hTreePrev)) - { - TreeView_DeleteItem(GetDlgItem(hDlg, IDC_ROM_DIR), TreeView_GetChild(GetDlgItem(hDlg, IDC_ROM_DIR),hTreePrev)); - } - TreeView_SetItemState(GetDlgItem(hDlg, IDC_ROM_DIR), hTreePrev, TVIS_EXPANDED ,TVIS_EXPANDED ); - GetPathFromTree(hDlg, IDC_ROM_DIR, get_dir, hTreePrev); - ExpandDir(get_dir, hTreePrev, hDlg); - //TreeView_Expand(GetDlgItem(hDlg, IDC_ROM_DIR), hTreePrev, TVE_EXPAND); - } + TreeView_Expand(GetDlgItem(hDlg, IDC_ROM_DIR), hTemp, TVE_EXPAND); hTemp=TreeView_GetChild(GetDlgItem(hDlg, IDC_ROM_DIR), hTemp); } if(temp2) temp=temp2+1; - else temp=NULL; + else + temp=NULL; } while(temp); @@ -5707,7 +6298,6 @@ } SendDlgItemMessage(hDlg, IDC_ROM_DIR, WM_SETREDRAW, TRUE, 0); - TreeView_EnsureVisible (GetDlgItem(hDlg, IDC_ROM_DIR), TreeView_GetSelection(GetDlgItem(hDlg, IDC_ROM_DIR))); } return true; //true sets the keyboard focus, in case we need this elsewhere } @@ -5832,7 +6422,7 @@ HKEY hKey; if(!RegOpenKeyEx(HKEY_CURRENT_USER, MY_REG_KEY, 0, KEY_ALL_ACCESS, &hKey)) { - RegSetValueEx(hKey, TEXT("Last Directory"), NULL, REG_SZ, (uint8*)temp, strlen(temp)+1); + RegSetValueEx(hKey, TEXT("Last Directory"), 0, REG_SZ, (uint8*)temp, strlen(temp)+1); RegCloseKey(hKey); } } @@ -5857,7 +6447,7 @@ } case WM_NOTIFY: { - if(lParam == NULL) + if(lParam == 0) return false; NMHDR* pNmh=(NMHDR*)lParam; switch(pNmh->idFrom) @@ -5866,6 +6456,13 @@ { switch(pNmh->code) { + case LVN_ODFINDITEM: + { +// NMLVFINDITEM* pFindItem = (NMLVFINDITEM*)lParam; + // for some reason returning which item to select doesn't work... +// return 2; + } + break; case LVN_GETDISPINFO: { int i, j; @@ -5926,15 +6523,16 @@ { TCHAR selected[MAX_PATH]; NMTREEVIEW* nmTv=(NMTREEVIEW*)lParam; + while(TreeView_GetChild(GetDlgItem(hDlg, IDC_ROM_DIR),nmTv->itemNew.hItem)) { TreeView_DeleteItem(GetDlgItem(hDlg, IDC_ROM_DIR), TreeView_GetChild(GetDlgItem(hDlg, IDC_ROM_DIR),nmTv->itemNew.hItem)); } + if(nmTv->action&TVE_EXPAND) { GetPathFromTree(hDlg, IDC_ROM_DIR, selected,nmTv->itemNew.hItem); - ExpandDir(selected, nmTv->itemNew.hItem, hDlg); } else @@ -6595,12 +7193,21 @@ curr=valid_ext; ZeroMemory(curr, sizeof(ExtList)); ifstream in; + +#if (((defined(_MSC_VER) && _MSC_VER >= 1300)) || defined(__MINGW32__)) + in.open("Valid.Ext", ios::in); +#else in.open("Valid.Ext", ios::in|ios::nocreate); +#endif if (!in.is_open()) { in.clear(); MakeExtFile(); + #if (((defined(_MSC_VER) && _MSC_VER >= 1300)) || defined(__MINGW32__)) + in.open("Valid.Ext", ios::in); + #else in.open("Valid.Ext", ios::in|ios::nocreate); + #endif if(!in.is_open()) { MessageBox(GUI.hWnd, "Fatal Error: The File \"Valid.Ext\" could not be found or created.", "Error", MB_ICONERROR|MB_OK); @@ -6773,7 +7380,7 @@ #endif HRESULT CALLBACK EnumModesCallback( LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext) { - char depmode[80]; + char depmode[80]; char s[80]; dMode curmode; HWND hDlg = (HWND)lpContext; @@ -6799,35 +7406,35 @@ - curmode.width=lpDDSurfaceDesc->dwWidth; - curmode.height=lpDDSurfaceDesc->dwHeight; - curmode.depth=lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount; - if(RegQueryValueEx(hKey,depmode,0,&type,val,&nuv)==ERROR_SUCCESS) - { - //sprintf(s,"%d %d %d %d",val[0],val[1],val[2],val[3]); - //MessageBox(hDlg,s,temp,MB_OK); - switch(val[0]) - { - case 1: - strcpy(s,"Failed"); - curmode.status=1; - break; - case 3: - strcpy(s,"Works"); - curmode.status=3; - break; - default: - strcpy(s,"Untested"); - curmode.status=0; - } - } - else - { - strcpy(s,"Untested"); - curmode.status=0; - //MessageBox(hDlg,s,temp,MB_OK); - } - dm.push_back(curmode); + curmode.width=lpDDSurfaceDesc->dwWidth; + curmode.height=lpDDSurfaceDesc->dwHeight; + curmode.depth=lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount; + if(RegQueryValueEx(hKey,depmode,0,&type,val,&nuv)==ERROR_SUCCESS) + { + //sprintf(s,"%d %d %d %d",val[0],val[1],val[2],val[3]); + //MessageBox(hDlg,s,temp,MB_OK); + switch(val[0]) + { + case 1: + strcpy(s,"Failed"); + curmode.status=1; + break; + case 3: + strcpy(s,"Works"); + curmode.status=3; + break; + default: + strcpy(s,"Untested"); + curmode.status=0; + } + } + else + { + strcpy(s,"Untested"); + curmode.status=0; + //MessageBox(hDlg,s,temp,MB_OK); + } + dm.push_back(curmode); LVITEM lvi; ZeroMemory(&lvi, sizeof(LVITEM)); lvi.iItem=dm.size(); @@ -6852,6 +7459,43 @@ return DDENUMRET_OK; } +void EnableDisableKeyFields (int index, HWND hDlg) +{ + bool enableUnTurboable; + if(index < 5) + { + SetDlgItemText(hDlg,IDC_LABEL_RIGHT,INPUTCONFIG_LABEL_RIGHT); + SetDlgItemText(hDlg,IDC_LABEL_UPLEFT,INPUTCONFIG_LABEL_UPLEFT); + SetDlgItemText(hDlg,IDC_LABEL_UPRIGHT,INPUTCONFIG_LABEL_UPRIGHT); + SetDlgItemText(hDlg,IDC_LABEL_DOWNRIGHT,INPUTCONFIG_LABEL_DOWNRIGHT); + SetDlgItemText(hDlg,IDC_LABEL_UP,INPUTCONFIG_LABEL_UP); + SetDlgItemText(hDlg,IDC_LABEL_LEFT,INPUTCONFIG_LABEL_LEFT); + SetDlgItemText(hDlg,IDC_LABEL_DOWN,INPUTCONFIG_LABEL_DOWN); + SetDlgItemText(hDlg,IDC_LABEL_DOWNLEFT,INPUTCONFIG_LABEL_DOWNLEFT); + enableUnTurboable = true; + } + else + { + SetDlgItemText(hDlg,IDC_LABEL_UP,INPUTCONFIG_LABEL_MAKE_TURBO); + SetDlgItemText(hDlg,IDC_LABEL_LEFT,INPUTCONFIG_LABEL_MAKE_HELD); + SetDlgItemText(hDlg,IDC_LABEL_DOWN,INPUTCONFIG_LABEL_MAKE_TURBO_HELD); + SetDlgItemText(hDlg,IDC_LABEL_RIGHT,INPUTCONFIG_LABEL_CLEAR_TOGGLES_AND_TURBO); + SetDlgItemText(hDlg,IDC_LABEL_UPLEFT,INPUTCONFIG_LABEL_UNUSED); + SetDlgItemText(hDlg,IDC_LABEL_UPRIGHT,INPUTCONFIG_LABEL_UNUSED); + SetDlgItemText(hDlg,IDC_LABEL_DOWNLEFT,INPUTCONFIG_LABEL_UNUSED); + SetDlgItemText(hDlg,IDC_LABEL_DOWNRIGHT,INPUTCONFIG_LABEL_UNUSED); + SetDlgItemText(hDlg,IDC_UPLEFT,INPUTCONFIG_LABEL_UNUSED); + SetDlgItemText(hDlg,IDC_UPRIGHT,INPUTCONFIG_LABEL_UNUSED); + SetDlgItemText(hDlg,IDC_DWNLEFT,INPUTCONFIG_LABEL_UNUSED); + SetDlgItemText(hDlg,IDC_DWNRIGHT,INPUTCONFIG_LABEL_UNUSED); + enableUnTurboable = false; + } + + EnableWindow(GetDlgItem(hDlg,IDC_UPLEFT), enableUnTurboable); + EnableWindow(GetDlgItem(hDlg,IDC_UPRIGHT), enableUnTurboable); + EnableWindow(GetDlgItem(hDlg,IDC_DWNRIGHT), enableUnTurboable); + EnableWindow(GetDlgItem(hDlg,IDC_DWNLEFT), enableUnTurboable); +} int CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -6929,6 +7573,10 @@ { SendDlgItemMessage(hDlg, IDC_HIRES, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); } + if(Settings.HeightExtend) + { + SendDlgItemMessage(hDlg, IDC_HEIGHT_EXTEND, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + } if(Settings.Mode7Interpolate) { SendDlgItemMessage(hDlg, IDC_BILINEARMD7, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); @@ -6941,13 +7589,17 @@ { SendDlgItemMessage(hDlg, IDC_STRETCH, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); } + if(Settings.AspectRatio) + { + SendDlgItemMessage(hDlg, IDC_ASPECT, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + } if(GUI.FullScreen) { SendDlgItemMessage(hDlg, IDC_FULLSCREEN, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - } - if(GUI.VideoMemory) - { - SendDlgItemMessage(hDlg,IDC_VIDEOCARD, BM_SETCHECK, (WPARAM)BST_CHECKED,0); + } + if(GUI.VideoMemory) + { + SendDlgItemMessage(hDlg,IDC_VIDEOCARD, BM_SETCHECK, (WPARAM)BST_CHECKED,0); } if(Settings.DisplayFrameRate) { @@ -6961,6 +7613,7 @@ { EnableWindow(GetDlgItem(hDlg, IDC_LIMITFRAMES), TRUE); } + EnableWindow(GetDlgItem(hDlg, IDC_ASPECT), GUI.Stretch); strcpy(temp,"None"); @@ -7012,10 +7665,7 @@ { EnableWindow(GetDlgItem(hDlg,IDC_FILTERBOX),false); EnableWindow(GetDlgItem(hDlg,IDC_HIRES),false); - } - - - + } @@ -7047,6 +7697,8 @@ DirectX.lpDD->EnumDisplayModes(0,NULL,GetDlgItem(hDlg,IDC_VIDMODELIST),(LPDDENUMMODESCALLBACK)EnumModesCallback); + // have to start focus on something like this or Escape won't exit the dialog + SetFocus(GetDlgItem(hDlg,IDC_FILTERBOX)); break; case WM_CLOSE: @@ -7057,6 +7709,17 @@ switch(LOWORD(wParam)) { + case IDC_STRETCH: + if(IsDlgButtonChecked(hDlg, IDC_STRETCH)==BST_CHECKED) + { + EnableWindow(GetDlgItem(hDlg, IDC_ASPECT), TRUE); + } + else + { + EnableWindow(GetDlgItem(hDlg, IDC_ASPECT), FALSE); + } + break; + case IDC_AUTOFRAME: if(BN_CLICKED==HIWORD(wParam)||BN_DBLCLK==HIWORD(wParam)) { @@ -7130,7 +7793,7 @@ case IDOK: Settings.SixteenBit = IsDlgButtonChecked(hDlg, IDC_RENDER16BIT); - Settings.Transparency = IsDlgButtonChecked(hDlg, IDC_TRANS); + Settings.Transparency = IsDlgButtonChecked(hDlg, IDC_TRANS); GUI.VideoMemory = (bool)(IsDlgButtonChecked(hDlg,IDC_VIDEOCARD)==BST_CHECKED); if(GUI.Width >= 512 && GUI.Height >= 478) { @@ -7142,6 +7805,7 @@ Settings.SupportHiRes = false; GUI.NextScale = 0; } + Settings.HeightExtend = IsDlgButtonChecked(hDlg, IDC_HEIGHT_EXTEND); Settings.Mode7Interpolate = IsDlgButtonChecked(hDlg, IDC_BILINEARMD7); Settings.AutoMaxSkipFrames = IsDlgButtonChecked(hDlg, IDC_AUTOFRAME); GUI.DoubleBuffered = (bool)(IsDlgButtonChecked(hDlg, IDC_DBLBUFFER)==BST_CHECKED); @@ -7167,9 +7831,18 @@ GUI.Stretch = (bool)(IsDlgButtonChecked(hDlg, IDC_STRETCH)==BST_CHECKED); + Settings.AspectRatio = (bool)(IsDlgButtonChecked(hDlg, IDC_ASPECT)==BST_CHECKED); GUI.FullScreen = (bool)(IsDlgButtonChecked(hDlg, IDC_FULLSCREEN)==BST_CHECKED); Settings.DisplayFrameRate = IsDlgButtonChecked(hDlg, IDC_SHOWFPS); - + + + // we might've change the region that the game draws over + // (by turning on "maintain aspect ratio", or turning on "extend height" when "maintain aspect ratio" is already on), + // so we must invalidate the window to redraw black + // behind the possibly-newly-revealed areas of the window + RedrawWindow((HWND)GetParent(hDlg),NULL,NULL, RDW_INVALIDATE | RDW_INTERNALPAINT | RDW_ERASENOW); + + // dmindex=0; EndDialog(hDlg,0); if(hBmp) @@ -7365,6 +8038,30 @@ return false; } + +static void set_buttoninfo(int index, HWND hDlg) +{ + SendDlgItemMessage(hDlg,IDC_UP,WM_USER+44,Joypad[index].Up,0); + SendDlgItemMessage(hDlg,IDC_LEFT,WM_USER+44,Joypad[index].Left,0); + SendDlgItemMessage(hDlg,IDC_DOWN,WM_USER+44,Joypad[index].Down,0); + SendDlgItemMessage(hDlg,IDC_RIGHT,WM_USER+44,Joypad[index].Right,0); + SendDlgItemMessage(hDlg,IDC_A,WM_USER+44,Joypad[index].A,0); + SendDlgItemMessage(hDlg,IDC_B,WM_USER+44,Joypad[index].B,0); + SendDlgItemMessage(hDlg,IDC_X,WM_USER+44,Joypad[index].X,0); + SendDlgItemMessage(hDlg,IDC_Y,WM_USER+44,Joypad[index].Y,0); + SendDlgItemMessage(hDlg,IDC_L,WM_USER+44,Joypad[index].L,0); + SendDlgItemMessage(hDlg,IDC_R,WM_USER+44,Joypad[index].R,0); + SendDlgItemMessage(hDlg,IDC_START,WM_USER+44,Joypad[index].Start,0); + SendDlgItemMessage(hDlg,IDC_SELECT,WM_USER+44,Joypad[index].Select,0); + if(index < 5) + { + SendDlgItemMessage(hDlg,IDC_UPLEFT,WM_USER+44,Joypad[index].Left_Up,0); + SendDlgItemMessage(hDlg,IDC_UPRIGHT,WM_USER+44,Joypad[index].Right_Up,0); + SendDlgItemMessage(hDlg,IDC_DWNLEFT,WM_USER+44,Joypad[index].Left_Down,0); + SendDlgItemMessage(hDlg,IDC_DWNRIGHT,WM_USER+44,Joypad[index].Right_Down,0); + } +} + void TranslateKey(WORD keyz,char *out); //HWND funky; SJoyState JoystickF [16]; @@ -7378,298 +8075,532 @@ return false; } -#endif -int CALLBACK DlgInputConfig(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - static HBITMAP hBmp; - char temp[256]; - short C; - int i, which; - static int index=0; - - - static SJoypad pads[5]; - - - //HBRUSH g_hbrBackground; - - InitInputCustomControl(); -switch(msg) - { - case WM_PAINT: - { - PAINTSTRUCT ps; - BeginPaint (hDlg, &ps); - if(hBmp) - { - BITMAP bmp; - ZeroMemory(&bmp, sizeof(BITMAP)); - RECT r; - GetClientRect(hDlg, &r); - HDC hdc=GetDC(hDlg); - HDC hDCbmp=CreateCompatibleDC(hdc); - GetObject(hBmp, sizeof(BITMAP), &bmp); - HBITMAP hOldBmp=(HBITMAP)SelectObject(hDCbmp, hBmp); - StretchBlt(hdc, 0,0,r.right,r.bottom,hDCbmp,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY); - SelectObject(hDCbmp, hOldBmp); - DeleteDC(hDCbmp); - ReleaseDC(hDlg, hdc); - } - - EndPaint (hDlg, &ps); - } - return true; - case WM_INITDIALOG: - SetWindowText(hDlg,INPUTCONFIG_TITLE); - SetDlgItemText(hDlg,IDC_JPTOGGLE,INPUTCONFIG_JPTOGGLE); - SetDlgItemText(hDlg,IDC_OK,BUTTON_OK); - SetDlgItemText(hDlg,IDC_CANCEL,BUTTON_CANCEL); - SetDlgItemText(hDlg,IDC_DIAGTOGGLE,INPUTCONFIG_DIAGTOGGLE); - SetDlgItemText(hDlg,IDC_LABEL_UP,INPUTCONFIG_LABEL_UP); - SetDlgItemText(hDlg,IDC_LABEL_DOWN,INPUTCONFIG_LABEL_DOWN); - SetDlgItemText(hDlg,IDC_LABEL_LEFT,INPUTCONFIG_LABEL_LEFT); - SetDlgItemText(hDlg,IDC_LABEL_RIGHT,INPUTCONFIG_LABEL_RIGHT); - SetDlgItemText(hDlg,IDC_LABEL_A,INPUTCONFIG_LABEL_A); - SetDlgItemText(hDlg,IDC_LABEL_B,INPUTCONFIG_LABEL_B); - SetDlgItemText(hDlg,IDC_LABEL_X,INPUTCONFIG_LABEL_X); - SetDlgItemText(hDlg,IDC_LABEL_Y,INPUTCONFIG_LABEL_Y); - SetDlgItemText(hDlg,IDC_LABEL_L,INPUTCONFIG_LABEL_L); - SetDlgItemText(hDlg,IDC_LABEL_R,INPUTCONFIG_LABEL_R); - SetDlgItemText(hDlg,IDC_LABEL_START,INPUTCONFIG_LABEL_START); - SetDlgItemText(hDlg,IDC_LABEL_SELECT,INPUTCONFIG_LABEL_SELECT); - SetDlgItemText(hDlg,IDC_LABEL_UPRIGHT,INPUTCONFIG_LABEL_UPRIGHT); - SetDlgItemText(hDlg,IDC_LABEL_UPLEFT,INPUTCONFIG_LABEL_UPLEFT); - SetDlgItemText(hDlg,IDC_LABEL_DOWNRIGHT,INPUTCONFIG_LABEL_DOWNRIGHT); - SetDlgItemText(hDlg,IDC_LABEL_DOWNRIGHT,INPUTCONFIG_LABEL_DOWNRIGHT); - SetDlgItemText(hDlg,IDC_LABEL_BLUE,INPUTCONFIG_LABEL_BLUE); - - hBmp=(HBITMAP)LoadImage(NULL, TEXT("PBortas.bmp"), IMAGE_BITMAP, 0,0, LR_CREATEDIBSECTION | LR_LOADFROMFILE); - memcpy(pads, Joypad, 5*sizeof(SJoypad)); - for( i=0;i<256;i++) - { - GetAsyncKeyState(i); - } - for( C = 0; C != 16; C ++) - JoystickF[C].Attached = joyGetDevCaps( JOYSTICKID1+C, &JoystickF[C].Caps, sizeof( JOYCAPS)) == JOYERR_NOERROR; - for (i=1;i<6;i++) - { - - sprintf(temp,INPUTCONFIG_JPCOMBO,i); - SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_ADDSTRING,0,(LPARAM)(LPCTSTR)temp); - } - - SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_SETCURSEL,(WPARAM)0,0); - if(Joypad[index].Enabled) - { - SendDlgItemMessage(hDlg,IDC_JPTOGGLE,BM_SETCHECK,(WPARAM)BST_CHECKED,0); - } - else - { - SendDlgItemMessage(hDlg,IDC_JPTOGGLE,BM_SETCHECK,(WPARAM)BST_UNCHECKED,0); - } - SendDlgItemMessage(hDlg,IDC_UP,WM_USER+44,Joypad[index].Up,0); - SendDlgItemMessage(hDlg,IDC_LEFT,WM_USER+44,Joypad[index].Left,0); - SendDlgItemMessage(hDlg,IDC_DOWN,WM_USER+44,Joypad[index].Down,0); - SendDlgItemMessage(hDlg,IDC_RIGHT,WM_USER+44,Joypad[index].Right,0); - SendDlgItemMessage(hDlg,IDC_A,WM_USER+44,Joypad[index].A,0); - SendDlgItemMessage(hDlg,IDC_B,WM_USER+44,Joypad[index].B,0); - SendDlgItemMessage(hDlg,IDC_X,WM_USER+44,Joypad[index].X,0); - SendDlgItemMessage(hDlg,IDC_Y,WM_USER+44,Joypad[index].Y,0); - SendDlgItemMessage(hDlg,IDC_L,WM_USER+44,Joypad[index].L,0); - SendDlgItemMessage(hDlg,IDC_R,WM_USER+44,Joypad[index].R,0); - SendDlgItemMessage(hDlg,IDC_START,WM_USER+44,Joypad[index].Start,0); - SendDlgItemMessage(hDlg,IDC_SELECT,WM_USER+44,Joypad[index].Select,0); - SendDlgItemMessage(hDlg,IDC_UPLEFT,WM_USER+44,Joypad[index].Left_Up,0); - SendDlgItemMessage(hDlg,IDC_UPRIGHT,WM_USER+44,Joypad[index].Right_Up,0); - SendDlgItemMessage(hDlg,IDC_DWNLEFT,WM_USER+44,Joypad[index].Left_Down,0); - SendDlgItemMessage(hDlg,IDC_DWNRIGHT,WM_USER+44,Joypad[index].Right_Down,0); - - - SetFocus(GetDlgItem(hDlg,IDC_JPCOMBO)); - - - return true; - break; - case WM_CLOSE: - EndDialog(hDlg, 0); - return TRUE; - case WM_USER+43: - //MessageBox(hDlg,"USER+43 CAUGHT","moo",MB_OK); - which = GetDlgCtrlID((HWND)lParam); - switch(which) - { - case IDC_UP: - Joypad[index].Up = wParam; - - break; - case IDC_DOWN: - Joypad[index].Down = wParam; - - break; - case IDC_LEFT: - Joypad[index].Left = wParam; - - break; - case IDC_RIGHT: - Joypad[index].Right = wParam; - - break; - case IDC_A: - Joypad[index].A = wParam; - - break; - case IDC_B: - Joypad[index].B = wParam; - - break; - case IDC_X: - Joypad[index].X = wParam; - - break; - case IDC_Y: - Joypad[index].Y = wParam; - - break; - case IDC_L: - Joypad[index].L = wParam; - break; - - case IDC_R: - Joypad[index].R = wParam; - - break; - case IDC_SELECT: - Joypad[index].Select = wParam; - - break; - case IDC_START: - Joypad[index].Start = wParam; - - break; - case IDC_UPLEFT: - Joypad[index].Left_Up = wParam; - - break; - case IDC_UPRIGHT: - Joypad[index].Right_Up = wParam; - - break; - case IDC_DWNLEFT: - Joypad[index].Left_Down = wParam; - - case IDC_DWNRIGHT: - Joypad[index].Right_Down = wParam; - - break; - - } - SendDlgItemMessage(hDlg,IDC_UP,WM_USER+44,Joypad[index].Up,0); - SendDlgItemMessage(hDlg,IDC_LEFT,WM_USER+44,Joypad[index].Left,0); - SendDlgItemMessage(hDlg,IDC_DOWN,WM_USER+44,Joypad[index].Down,0); - SendDlgItemMessage(hDlg,IDC_RIGHT,WM_USER+44,Joypad[index].Right,0); - SendDlgItemMessage(hDlg,IDC_A,WM_USER+44,Joypad[index].A,0); - SendDlgItemMessage(hDlg,IDC_B,WM_USER+44,Joypad[index].B,0); - SendDlgItemMessage(hDlg,IDC_X,WM_USER+44,Joypad[index].X,0); - SendDlgItemMessage(hDlg,IDC_Y,WM_USER+44,Joypad[index].Y,0); - SendDlgItemMessage(hDlg,IDC_L,WM_USER+44,Joypad[index].L,0); - SendDlgItemMessage(hDlg,IDC_R,WM_USER+44,Joypad[index].R,0); - SendDlgItemMessage(hDlg,IDC_START,WM_USER+44,Joypad[index].Start,0); - SendDlgItemMessage(hDlg,IDC_SELECT,WM_USER+44,Joypad[index].Select,0); - SendDlgItemMessage(hDlg,IDC_UPLEFT,WM_USER+44,Joypad[index].Left_Up,0); - SendDlgItemMessage(hDlg,IDC_UPRIGHT,WM_USER+44,Joypad[index].Right_Up,0); - SendDlgItemMessage(hDlg,IDC_DWNLEFT,WM_USER+44,Joypad[index].Left_Down,0); - SendDlgItemMessage(hDlg,IDC_DWNRIGHT,WM_USER+44,Joypad[index].Right_Down,0); - PostMessage(hDlg,WM_NEXTDLGCTL,0,0); - return true; - case WM_COMMAND: - switch(LOWORD(wParam)) - { - case IDCANCEL: - memcpy(Joypad, pads, 5*sizeof(SJoypad)); - EndDialog(hDlg,0); - if(hBmp) - { - DeleteObject(hBmp); - hBmp=NULL; - } - break; - case IDOK: - EndDialog(hDlg,0); - if(hBmp) - { - DeleteObject(hBmp); - hBmp=NULL; - } - break; - case IDC_JPTOGGLE: - index = SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_GETCURSEL,0,0); - Joypad[index].Enabled=IsDlgButtonChecked(hDlg,IDC_JPTOGGLE); - break; - case IDC_DIAGTOGGLE: - if(IsWindowEnabled(GetDlgItem(hDlg,IDC_UPLEFT))==0) - { - - EnableWindow(GetDlgItem(hDlg,IDC_UPLEFT),TRUE); - - EnableWindow(GetDlgItem(hDlg,IDC_UPRIGHT),TRUE); - - EnableWindow(GetDlgItem(hDlg,IDC_DWNLEFT),TRUE); - - EnableWindow(GetDlgItem(hDlg,IDC_DWNRIGHT),TRUE); - - } - else - { - - EnableWindow(GetDlgItem(hDlg,IDC_UPLEFT),FALSE); - - EnableWindow(GetDlgItem(hDlg,IDC_UPRIGHT),FALSE); - - EnableWindow(GetDlgItem(hDlg,IDC_DWNLEFT),FALSE); - - EnableWindow(GetDlgItem(hDlg,IDC_DWNRIGHT),FALSE); - } - break; - } - switch(HIWORD(wParam)) - { - case CBN_SELCHANGE: - index = SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_GETCURSEL,0,0); - SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_SETCURSEL,(WPARAM)index,0); - if(Joypad[index].Enabled) - { - SendDlgItemMessage(hDlg,IDC_JPTOGGLE,BM_SETCHECK,(WPARAM)BST_CHECKED,0); - } - else - { - SendDlgItemMessage(hDlg,IDC_JPTOGGLE,BM_SETCHECK,(WPARAM)BST_UNCHECKED,0); - } - SendDlgItemMessage(hDlg,IDC_UP,WM_USER+44,Joypad[index].Up,0); - SendDlgItemMessage(hDlg,IDC_LEFT,WM_USER+44,Joypad[index].Left,0); - SendDlgItemMessage(hDlg,IDC_DOWN,WM_USER+44,Joypad[index].Down,0); - SendDlgItemMessage(hDlg,IDC_RIGHT,WM_USER+44,Joypad[index].Right,0); - SendDlgItemMessage(hDlg,IDC_A,WM_USER+44,Joypad[index].A,0); - SendDlgItemMessage(hDlg,IDC_B,WM_USER+44,Joypad[index].B,0); - SendDlgItemMessage(hDlg,IDC_X,WM_USER+44,Joypad[index].X,0); - SendDlgItemMessage(hDlg,IDC_Y,WM_USER+44,Joypad[index].Y,0); - SendDlgItemMessage(hDlg,IDC_L,WM_USER+44,Joypad[index].L,0); - SendDlgItemMessage(hDlg,IDC_R,WM_USER+44,Joypad[index].R,0); - SendDlgItemMessage(hDlg,IDC_START,WM_USER+44,Joypad[index].Start,0); - SendDlgItemMessage(hDlg,IDC_SELECT,WM_USER+44,Joypad[index].Select,0); - SendDlgItemMessage(hDlg,IDC_UPLEFT,WM_USER+44,Joypad[index].Left_Up,0); - SendDlgItemMessage(hDlg,IDC_UPRIGHT,WM_USER+44,Joypad[index].Right_Up,0); - SendDlgItemMessage(hDlg,IDC_DWNLEFT,WM_USER+44,Joypad[index].Left_Down,0); - SendDlgItemMessage(hDlg,IDC_DWNRIGHT,WM_USER+44,Joypad[index].Right_Down,0); - break; - } - return FALSE; - - } - - return FALSE; -} - - +#endif +int CALLBACK DlgInputConfig(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static HBITMAP hBmp; + char temp[256]; + short C; + int i, which; + static int index=0; + + + static SJoypad pads[10]; + + + //HBRUSH g_hbrBackground; + + InitInputCustomControl(); +switch(msg) + { + case WM_PAINT: + { + PAINTSTRUCT ps; + BeginPaint (hDlg, &ps); + if(hBmp) + { + BITMAP bmp; + ZeroMemory(&bmp, sizeof(BITMAP)); + RECT r; + GetClientRect(hDlg, &r); + HDC hdc=GetDC(hDlg); + HDC hDCbmp=CreateCompatibleDC(hdc); + GetObject(hBmp, sizeof(BITMAP), &bmp); + HBITMAP hOldBmp=(HBITMAP)SelectObject(hDCbmp, hBmp); + StretchBlt(hdc, 0,0,r.right,r.bottom,hDCbmp,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY); + SelectObject(hDCbmp, hOldBmp); + DeleteDC(hDCbmp); + ReleaseDC(hDlg, hdc); + } + + EndPaint (hDlg, &ps); + } + return true; + case WM_INITDIALOG: + SetWindowText(hDlg,INPUTCONFIG_TITLE); + SetDlgItemText(hDlg,IDC_JPTOGGLE,INPUTCONFIG_JPTOGGLE); + SetDlgItemText(hDlg,IDC_OK,BUTTON_OK); + SetDlgItemText(hDlg,IDC_CANCEL,BUTTON_CANCEL); +/// SetDlgItemText(hDlg,IDC_DIAGTOGGLE,INPUTCONFIG_DIAGTOGGLE); + SetDlgItemText(hDlg,IDC_LABEL_UP,INPUTCONFIG_LABEL_UP); + SetDlgItemText(hDlg,IDC_LABEL_DOWN,INPUTCONFIG_LABEL_DOWN); + SetDlgItemText(hDlg,IDC_LABEL_LEFT,INPUTCONFIG_LABEL_LEFT); + SetDlgItemText(hDlg,IDC_LABEL_A,INPUTCONFIG_LABEL_A); + SetDlgItemText(hDlg,IDC_LABEL_B,INPUTCONFIG_LABEL_B); + SetDlgItemText(hDlg,IDC_LABEL_X,INPUTCONFIG_LABEL_X); + SetDlgItemText(hDlg,IDC_LABEL_Y,INPUTCONFIG_LABEL_Y); + SetDlgItemText(hDlg,IDC_LABEL_L,INPUTCONFIG_LABEL_L); + SetDlgItemText(hDlg,IDC_LABEL_R,INPUTCONFIG_LABEL_R); + SetDlgItemText(hDlg,IDC_LABEL_START,INPUTCONFIG_LABEL_START); + SetDlgItemText(hDlg,IDC_LABEL_SELECT,INPUTCONFIG_LABEL_SELECT); + SetDlgItemText(hDlg,IDC_LABEL_UPRIGHT,INPUTCONFIG_LABEL_UPRIGHT); + SetDlgItemText(hDlg,IDC_LABEL_UPLEFT,INPUTCONFIG_LABEL_UPLEFT); + SetDlgItemText(hDlg,IDC_LABEL_DOWNRIGHT,INPUTCONFIG_LABEL_DOWNRIGHT); + SetDlgItemText(hDlg,IDC_LABEL_DOWNLEFT,INPUTCONFIG_LABEL_DOWNLEFT); + SetDlgItemText(hDlg,IDC_LABEL_BLUE,INPUTCONFIG_LABEL_BLUE); + + for(i=5;i<10;i++) + Joypad[i].Left_Up = Joypad[i].Right_Up = Joypad[i].Left_Down = Joypad[i].Right_Down = 0; + + hBmp=(HBITMAP)LoadImage(NULL, TEXT("PBortas.bmp"), IMAGE_BITMAP, 0,0, LR_CREATEDIBSECTION | LR_LOADFROMFILE); + memcpy(pads, Joypad, 10*sizeof(SJoypad)); + + for( i=0;i<256;i++) + GetAsyncKeyState(i); + + for( C = 0; C != 16; C ++) + JoystickF[C].Attached = joyGetDevCaps( JOYSTICKID1+C, &JoystickF[C].Caps, sizeof( JOYCAPS)) == JOYERR_NOERROR; + + for (i=1;i<6;i++) + { + sprintf(temp,INPUTCONFIG_JPCOMBO,i); + SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_ADDSTRING,0,(LPARAM)(LPCTSTR)temp); + } + + for (i=6;i<11;i++) + { + sprintf(temp,INPUTCONFIG_JPCOMBO INPUTCONFIG_LABEL_CONTROLLER_TURBO_PANEL_MOD,i-5); + SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_ADDSTRING,0,(LPARAM)(LPCTSTR)temp); + } + + SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_SETCURSEL,(WPARAM)0,0); + + SendDlgItemMessage(hDlg,IDC_JPTOGGLE,BM_SETCHECK, Joypad[index].Enabled ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ALLOWLEFTRIGHT,BM_SETCHECK, !Settings.DisallowLeftRight ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + + set_buttoninfo(index,hDlg); + + EnableDisableKeyFields(index,hDlg); + + PostMessage(hDlg,WM_COMMAND, CBN_SELCHANGE<<16, 0); + + SetFocus(GetDlgItem(hDlg,IDC_JPCOMBO)); + + return true; + break; + case WM_CLOSE: + EndDialog(hDlg, 0); + return TRUE; + case WM_USER+46: + // refresh command, for clicking away from a selected field + index = SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_GETCURSEL,0,0); + set_buttoninfo(index,hDlg); + return TRUE; + case WM_USER+43: + //MessageBox(hDlg,"USER+43 CAUGHT","moo",MB_OK); + which = GetDlgCtrlID((HWND)lParam); + switch(which) + { + case IDC_UP: + Joypad[index].Up = wParam; + + break; + case IDC_DOWN: + Joypad[index].Down = wParam; + + break; + case IDC_LEFT: + Joypad[index].Left = wParam; + + break; + case IDC_RIGHT: + Joypad[index].Right = wParam; + + break; + case IDC_A: + Joypad[index].A = wParam; + + break; + case IDC_B: + Joypad[index].B = wParam; + + break; + case IDC_X: + Joypad[index].X = wParam; + + break; + case IDC_Y: + Joypad[index].Y = wParam; + + break; + case IDC_L: + Joypad[index].L = wParam; + break; + + case IDC_R: + Joypad[index].R = wParam; + + break; + case IDC_SELECT: + Joypad[index].Select = wParam; + + break; + case IDC_START: + Joypad[index].Start = wParam; + + break; + case IDC_UPLEFT: + Joypad[index].Left_Up = wParam; + + break; + case IDC_UPRIGHT: + Joypad[index].Right_Up = wParam; + + break; + case IDC_DWNLEFT: + Joypad[index].Left_Down = wParam; + + case IDC_DWNRIGHT: + Joypad[index].Right_Down = wParam; + + break; + + } + + set_buttoninfo(index,hDlg); + + PostMessage(hDlg,WM_NEXTDLGCTL,0,0); + return true; + case WM_COMMAND: + switch(LOWORD(wParam)) + { + case IDCANCEL: + memcpy(Joypad, pads, 10*sizeof(SJoypad)); + EndDialog(hDlg,0); + if(hBmp) + { + DeleteObject(hBmp); + hBmp=NULL; + } + break; + + case IDOK: + Settings.DisallowLeftRight = !IsDlgButtonChecked(hDlg, IDC_ALLOWLEFTRIGHT); + EndDialog(hDlg,0); + if(hBmp) + { + DeleteObject(hBmp); + hBmp=NULL; + } + break; + + case IDC_JPTOGGLE: // joypad Enable toggle + index = SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_GETCURSEL,0,0); + Joypad[index].Enabled=IsDlgButtonChecked(hDlg,IDC_JPTOGGLE); + set_buttoninfo(index, hDlg); // update display of conflicts + break; + + } + switch(HIWORD(wParam)) + { + case CBN_SELCHANGE: + index = SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_GETCURSEL,0,0); + SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_SETCURSEL,(WPARAM)index,0); + if(index < 5) + { + SendDlgItemMessage(hDlg,IDC_JPTOGGLE,BM_SETCHECK, Joypad[index].Enabled ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + EnableWindow(GetDlgItem(hDlg,IDC_JPTOGGLE),TRUE); + } + else + { + SendDlgItemMessage(hDlg,IDC_JPTOGGLE,BM_SETCHECK, Joypad[index-5].Enabled ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + EnableWindow(GetDlgItem(hDlg,IDC_JPTOGGLE),FALSE); + } + + set_buttoninfo(index,hDlg); + + EnableDisableKeyFields(index,hDlg); + + break; + } + return FALSE; + + } + + return FALSE; +} + + +static void set_hotkeyinfo(HWND hDlg) +{ + int index = SendDlgItemMessage(hDlg,IDC_HKCOMBO,CB_GETCURSEL,0,0); + + if(index == 0) + { + // set page 1 fields + SendDlgItemMessage(hDlg,IDC_HOTKEY1,WM_USER+44,CustomKeys.SpeedUp.key,CustomKeys.SpeedUp.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY2,WM_USER+44,CustomKeys.SpeedDown.key,CustomKeys.SpeedDown.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY3,WM_USER+44,CustomKeys.Pause.key,CustomKeys.Pause.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY4,WM_USER+44,CustomKeys.FrameAdvance.key,CustomKeys.FrameAdvance.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY5,WM_USER+44,CustomKeys.FastForward.key,CustomKeys.FastForward.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY6,WM_USER+44,CustomKeys.SkipUp.key,CustomKeys.SkipUp.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY7,WM_USER+44,CustomKeys.SkipDown.key,CustomKeys.SkipDown.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY8,WM_USER+44,CustomKeys.ScopeTurbo.key,CustomKeys.ScopeTurbo.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY9,WM_USER+44,CustomKeys.ScopePause.key,CustomKeys.ScopePause.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY10,WM_USER+44,CustomKeys.ShowPressed.key,CustomKeys.ShowPressed.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY11,WM_USER+44,CustomKeys.FrameCount.key,CustomKeys.FrameCount.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY12,WM_USER+44,CustomKeys.ReadOnly.key,CustomKeys.ReadOnly.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY13,WM_USER+44,CustomKeys.SaveScreenShot.key,CustomKeys.SaveScreenShot.modifiers); + } + else + { + // set page 2 fields + SendDlgItemMessage(hDlg,IDC_HOTKEY1,WM_USER+44,CustomKeys.BGL1.key,CustomKeys.BGL1.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY2,WM_USER+44,CustomKeys.BGL2.key,CustomKeys.BGL2.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY3,WM_USER+44,CustomKeys.BGL3.key,CustomKeys.BGL3.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY4,WM_USER+44,CustomKeys.BGL4.key,CustomKeys.BGL4.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY5,WM_USER+44,CustomKeys.BGL5.key,CustomKeys.BGL5.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY6,WM_USER+44,CustomKeys.ClippingWindows.key,CustomKeys.ClippingWindows.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY7,WM_USER+44,CustomKeys.BGLHack.key,CustomKeys.BGLHack.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY8,WM_USER+44,CustomKeys.Transparency.key,CustomKeys.Transparency.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY9,WM_USER+44,CustomKeys.HDMA.key,CustomKeys.HDMA.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY10,WM_USER+44,CustomKeys.GLCube.key,CustomKeys.GLCube.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY11,WM_USER+44,CustomKeys.InterpMode7.key,CustomKeys.InterpMode7.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY12,WM_USER+44,CustomKeys.JoypadSwap.key,CustomKeys.JoypadSwap.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY13,WM_USER+44,CustomKeys.SwitchControllers.key,CustomKeys.SwitchControllers.modifiers); + } + + SendDlgItemMessage(hDlg,IDC_SLOTPLUS,WM_USER+44,CustomKeys.SlotPlus.key,CustomKeys.SlotPlus.modifiers); + SendDlgItemMessage(hDlg,IDC_SLOTMINUS,WM_USER+44,CustomKeys.SlotMinus.key,CustomKeys.SlotMinus.modifiers); + SendDlgItemMessage(hDlg,IDC_SLOTSAVE,WM_USER+44,CustomKeys.SlotSave.key,CustomKeys.SlotSave.modifiers); + SendDlgItemMessage(hDlg,IDC_SLOTLOAD,WM_USER+44,CustomKeys.SlotLoad.key,CustomKeys.SlotLoad.modifiers); + int i; + for(i = 0 ; i < 10 ; i++) SendDlgItemMessage(hDlg,IDC_SAVE1+i,WM_USER+44,CustomKeys.Save[i].key,CustomKeys.Save[i].modifiers); + for(i = 0 ; i < 10 ; i++) SendDlgItemMessage(hDlg,IDC_SAVE11+i,WM_USER+44,CustomKeys.Load[i].key,CustomKeys.Load[i].modifiers); + + if(index == 0) + { + // set page 1 label text + SetDlgItemText(hDlg,IDC_LABEL_HK1,HOTKEYS_LABEL_1_1); + SetDlgItemText(hDlg,IDC_LABEL_HK2,HOTKEYS_LABEL_1_2); + SetDlgItemText(hDlg,IDC_LABEL_HK3,HOTKEYS_LABEL_1_3); + SetDlgItemText(hDlg,IDC_LABEL_HK4,HOTKEYS_LABEL_1_4); + SetDlgItemText(hDlg,IDC_LABEL_HK5,HOTKEYS_LABEL_1_5); + SetDlgItemText(hDlg,IDC_LABEL_HK6,HOTKEYS_LABEL_1_6); + SetDlgItemText(hDlg,IDC_LABEL_HK7,HOTKEYS_LABEL_1_7); + SetDlgItemText(hDlg,IDC_LABEL_HK8,HOTKEYS_LABEL_1_8); + SetDlgItemText(hDlg,IDC_LABEL_HK9,HOTKEYS_LABEL_1_9); + SetDlgItemText(hDlg,IDC_LABEL_HK10,HOTKEYS_LABEL_1_10); + SetDlgItemText(hDlg,IDC_LABEL_HK11,HOTKEYS_LABEL_1_11); + SetDlgItemText(hDlg,IDC_LABEL_HK12,HOTKEYS_LABEL_1_12); + SetDlgItemText(hDlg,IDC_LABEL_HK13,HOTKEYS_LABEL_1_13); + } + else + { + // set page 2 label text + SetDlgItemText(hDlg,IDC_LABEL_HK1,HOTKEYS_LABEL_2_1); + SetDlgItemText(hDlg,IDC_LABEL_HK2,HOTKEYS_LABEL_2_2); + SetDlgItemText(hDlg,IDC_LABEL_HK3,HOTKEYS_LABEL_2_3); + SetDlgItemText(hDlg,IDC_LABEL_HK4,HOTKEYS_LABEL_2_4); + SetDlgItemText(hDlg,IDC_LABEL_HK5,HOTKEYS_LABEL_2_5); + SetDlgItemText(hDlg,IDC_LABEL_HK6,HOTKEYS_LABEL_2_6); + SetDlgItemText(hDlg,IDC_LABEL_HK7,HOTKEYS_LABEL_2_7); + SetDlgItemText(hDlg,IDC_LABEL_HK8,HOTKEYS_LABEL_2_8); + SetDlgItemText(hDlg,IDC_LABEL_HK9,HOTKEYS_LABEL_2_9); + SetDlgItemText(hDlg,IDC_LABEL_HK10,HOTKEYS_LABEL_2_10); + SetDlgItemText(hDlg,IDC_LABEL_HK11,HOTKEYS_LABEL_2_11); + SetDlgItemText(hDlg,IDC_LABEL_HK12,HOTKEYS_LABEL_2_12); + SetDlgItemText(hDlg,IDC_LABEL_HK13,HOTKEYS_LABEL_2_13); + } +} + +// DlgHotkeyConfig +int CALLBACK DlgHotkeyConfig(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + int i, which; + static int index=0; + + + static SCustomKeys keys; + + + //HBRUSH g_hbrBackground; + InitKeyCustomControl(); +switch(msg) + { + case WM_PAINT: + { + PAINTSTRUCT ps; + BeginPaint (hDlg, &ps); + + EndPaint (hDlg, &ps); + } + return true; + case WM_INITDIALOG: + SetWindowText(hDlg,HOTKEYS_TITLE); + + for(i=1;i<=2;i++) + { + char temp[256]; + sprintf(temp,HOTKEYS_HKCOMBO,i); + SendDlgItemMessage(hDlg,IDC_HKCOMBO,CB_ADDSTRING,0,(LPARAM)(LPCTSTR)temp); + } + + SendDlgItemMessage(hDlg,IDC_HKCOMBO,CB_SETCURSEL,(WPARAM)0,0); + + memcpy(&keys, &CustomKeys, sizeof(SCustomKeys)); + for( i=0;i<256;i++) + { + GetAsyncKeyState(i); + } + + SetDlgItemText(hDlg,IDC_LABEL_BLUE,HOTKEYS_LABEL_BLUE); + + set_hotkeyinfo(hDlg); + + PostMessage(hDlg,WM_COMMAND, CBN_SELCHANGE<<16, 0); + + SetFocus(GetDlgItem(hDlg,IDC_HKCOMBO)); + + + return true; + break; + case WM_CLOSE: + EndDialog(hDlg, 0); + return TRUE; + case WM_USER+46: + // refresh command, for clicking away from a selected field + index = SendDlgItemMessage(hDlg,IDC_HKCOMBO,CB_GETCURSEL,0,0); + set_hotkeyinfo(hDlg); + return TRUE; + case WM_USER+43: + { + //MessageBox(hDlg,"USER+43 CAUGHT","moo",MB_OK); + int modifiers = 0; + if(GetAsyncKeyState(VK_MENU) || wParam == VK_MENU) + modifiers |= CUSTKEY_ALT_MASK; + if(GetAsyncKeyState(VK_CONTROL) || wParam == VK_CONTROL) + modifiers |= CUSTKEY_CTRL_MASK; + if(GetAsyncKeyState(VK_SHIFT) || wParam == VK_SHIFT) + modifiers |= CUSTKEY_SHIFT_MASK; + + int index = SendDlgItemMessage(hDlg,IDC_HKCOMBO,CB_GETCURSEL,0,0); + + which = GetDlgCtrlID((HWND)lParam); + + switch(which) + { + case IDC_HOTKEY1: + if(index == 0) CustomKeys.SpeedUp.key = wParam, CustomKeys.SpeedUp.modifiers = modifiers; + else CustomKeys.BGL1.key = wParam, CustomKeys.BGL1.modifiers = modifiers; + break; + case IDC_HOTKEY2: + if(index == 0) CustomKeys.SpeedDown.key = wParam, CustomKeys.SpeedDown.modifiers = modifiers; + else CustomKeys.BGL2.key = wParam, CustomKeys.BGL2.modifiers = modifiers; + break; + case IDC_HOTKEY3: + if(index == 0) CustomKeys.Pause.key = wParam, CustomKeys.Pause.modifiers = modifiers; + else CustomKeys.BGL3.key = wParam, CustomKeys.BGL3.modifiers = modifiers; + break; + case IDC_HOTKEY4: + if(index == 0) CustomKeys.FrameAdvance.key = wParam, CustomKeys.FrameAdvance.modifiers = modifiers; + else CustomKeys.BGL4.key = wParam, CustomKeys.BGL4.modifiers = modifiers; + break; + case IDC_HOTKEY5: + if(index == 0) CustomKeys.FastForward.key = wParam, CustomKeys.FastForward.modifiers = modifiers; + else CustomKeys.BGL5.key = wParam, CustomKeys.BGL5.modifiers = modifiers; + break; + case IDC_HOTKEY6: + if(index == 0) CustomKeys.SkipUp.key = wParam, CustomKeys.SkipUp.modifiers = modifiers; + else CustomKeys.ClippingWindows.key = wParam, CustomKeys.ClippingWindows.modifiers = modifiers; + break; + case IDC_HOTKEY7: + if(index == 0) CustomKeys.SkipDown.key = wParam, CustomKeys.SkipDown.modifiers = modifiers; + else CustomKeys.BGLHack.key = wParam, CustomKeys.BGLHack.modifiers = modifiers; + break; + case IDC_HOTKEY8: + if(index == 0) CustomKeys.ScopeTurbo.key = wParam, CustomKeys.ScopeTurbo.modifiers = modifiers; + else CustomKeys.Transparency.key = wParam, CustomKeys.Transparency.modifiers = modifiers; + break; + case IDC_HOTKEY9: + if(index == 0) CustomKeys.ScopePause.key = wParam, CustomKeys.ScopePause.modifiers = modifiers; + else CustomKeys.HDMA.key = wParam, CustomKeys.HDMA.modifiers = modifiers; + break; + case IDC_HOTKEY10: + if(index == 0) CustomKeys.ShowPressed.key = wParam, CustomKeys.ShowPressed.modifiers = modifiers; + else CustomKeys.GLCube.key = wParam, CustomKeys.GLCube.modifiers = modifiers; + break; + case IDC_HOTKEY11: + if(index == 0) CustomKeys.FrameCount.key = wParam, CustomKeys.FrameCount.modifiers = modifiers; + else CustomKeys.InterpMode7.key = wParam, CustomKeys.InterpMode7.modifiers = modifiers; + break; + case IDC_HOTKEY12: + if(index == 0) CustomKeys.ReadOnly.key = wParam, CustomKeys.ReadOnly.modifiers = modifiers; + else CustomKeys.JoypadSwap.key = wParam, CustomKeys.JoypadSwap.modifiers = modifiers; + break; + case IDC_HOTKEY13: + if(index == 0) CustomKeys.SaveScreenShot.key = wParam, CustomKeys.SaveScreenShot.modifiers = modifiers; + else CustomKeys.SwitchControllers.key = wParam, CustomKeys.SwitchControllers.modifiers = modifiers; + break; + + case IDC_SLOTPLUS: + CustomKeys.SlotPlus.key = wParam; + CustomKeys.SlotPlus.modifiers = modifiers; + break; + + case IDC_SLOTMINUS: + CustomKeys.SlotMinus.key = wParam; + CustomKeys.SlotMinus.modifiers = modifiers; + break; + + case IDC_SLOTLOAD: + CustomKeys.SlotLoad.key = wParam; + CustomKeys.SlotLoad.modifiers = modifiers; + break; + + case IDC_SLOTSAVE: + CustomKeys.SlotSave.key = wParam; + CustomKeys.SlotSave.modifiers = modifiers; + break; + } + + if(which >= IDC_SAVE1 && which <= IDC_SAVE10) + { + CustomKeys.Save[which-IDC_SAVE1].key = wParam; + CustomKeys.Save[which-IDC_SAVE1].modifiers = modifiers; + } + if(which >= IDC_SAVE11 && which <= IDC_SAVE20) + { + CustomKeys.Load[which-IDC_SAVE11].key = wParam; + CustomKeys.Load[which-IDC_SAVE11].modifiers = modifiers; + } + + set_hotkeyinfo(hDlg); + PostMessage(hDlg,WM_NEXTDLGCTL,0,0); +// PostMessage(hDlg,WM_KILLFOCUS,0,0); + } + return true; + case WM_COMMAND: + switch(LOWORD(wParam)) + { + case IDCANCEL: + memcpy(&CustomKeys, &keys, sizeof(SCustomKeys)); + EndDialog(hDlg,0); + break; + case IDOK: + EndDialog(hDlg,0); + break; + } + switch(HIWORD(wParam)) + { + case CBN_SELCHANGE: + index = SendDlgItemMessage(hDlg,IDC_HKCOMBO,CB_GETCURSEL,0,0); + SendDlgItemMessage(hDlg,IDC_HKCOMBO,CB_SETCURSEL,(WPARAM)index,0); + + set_hotkeyinfo(hDlg); + + SetFocus(GetDlgItem(hDlg,IDC_HKCOMBO)); + + break; + } + return FALSE; + + } + + return FALSE; +} + + enum CheatStatus{ Untouched, @@ -8858,6 +9789,7 @@ } } } + break; case WM_COMMAND: { switch(LOWORD(wParam)) @@ -9113,6 +10045,7 @@ } default: return false; } + return false; } int CALLBACK DlgCheatSearchAdd(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) @@ -9316,8 +10249,8 @@ } GetDlgItemText(hDlg, IDC_NC_DESC, new_cheat->name, 23); - new_cheat->enabled=TRUE; - S9xAddCheat(new_cheat->enabled,new_cheat->saved_val,new_cheat->address,new_cheat->new_val); + new_cheat->enabled=TRUE; + S9xAddCheat(new_cheat->enabled,new_cheat->saved_val,new_cheat->address,new_cheat->new_val); strcpy(Cheat.c[Cheat.num_cheats-1].name,new_cheat->name); ret=0; } @@ -9353,7 +10286,7 @@ *p='\0'; SetWindowTextA(GetDlgItem(hDlg, IDC_MOVIE_DATE), tmpstr); - uint32 div = Settings.PAL ? 50 : 60; + uint32 div = Memory.ROMFramesPerSecond; uint32 l=(m.LengthFrames+(div>>1))/div; uint32 seconds=l%60; l/=60; @@ -9366,7 +10299,28 @@ SetWindowTextA(GetDlgItem(hDlg, IDC_MOVIE_FRAMES), tmpstr); sprintf(tmpstr, "%ld", m.RerecordCount); SetWindowTextA(GetDlgItem(hDlg, IDC_MOVIE_RERECORD), tmpstr); - SetWindowTextW(GetDlgItem(hDlg, IDC_MOVIE_METADATA), m.Metadata); + + // set author comment: + { +/// SetWindowTextW(GetDlgItem(hDlg, IDC_MOVIE_METADATA), m.Metadata); // won't work, because of & symbol + + wchar_t metadata [MOVIE_MAX_METADATA]; + int j, pos = 0, len = wcslen(m.Metadata); + for (j = 0; j < len ; j++) + { + wchar_t c = m.Metadata [j]; + metadata [pos++] = c; + + // & is a special character in Windows fields, + // so we have to change & to && when copying over the game title + // otherwise "Pocky & Rocky" will show up as "Pocky Rocky", for example + if(c == (wchar_t)'&') + metadata [pos++] = (wchar_t)'&'; + } + metadata [pos] = (wchar_t)'\0'; + + SetWindowTextW(GetDlgItem(hDlg, IDC_MOVIE_METADATA), metadata); + } if(m.ReadOnly) { @@ -9376,8 +10330,9 @@ else { EnableWindow(GetDlgItem(hDlg, IDC_READONLY), TRUE); - SendDlgItemMessage(hDlg,IDC_READONLY,BM_SETCHECK,BST_UNCHECKED,0); +/// SendDlgItemMessage(hDlg,IDC_READONLY,BM_SETCHECK,BST_UNCHECKED,0); } + EnableWindow(GetDlgItem(hDlg, IDC_DISPLAY_INPUT), TRUE); for(i=0; i<5; ++i) { @@ -9394,6 +10349,47 @@ SendDlgItemMessage(hDlg,IDC_RECORD_RESET,BM_SETCHECK,BST_UNCHECKED,0); SendDlgItemMessage(hDlg,IDC_RECORD_NOW,BM_SETCHECK,BST_CHECKED,0); } + + + if(m.SyncFlags & MOVIE_SYNC_DATA_EXISTS) + { + SendDlgItemMessage(hDlg,IDC_WIP1,BM_SETCHECK, (m.SyncFlags & MOVIE_SYNC_WIP1TIMING)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ALLOWLEFTRIGHT,BM_SETCHECK, (m.SyncFlags & MOVIE_SYNC_LEFTRIGHT)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ENVX,BM_SETCHECK, (m.SyncFlags & MOVIE_SYNC_VOLUMEENVX)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_FMUT,BM_SETCHECK, (m.SyncFlags & MOVIE_SYNC_FAKEMUTE)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_SYNC_TO_SOUND_CPU,BM_SETCHECK, (m.SyncFlags & MOVIE_SYNC_SYNCSOUND)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SetWindowText(GetDlgItem(hDlg, IDC_LOADEDFROMMOVIE), _T(MOVIE_LABEL_SYNC_DATA_FROM_MOVIE)); + } + else + { + SendDlgItemMessage(hDlg,IDC_WIP1,BM_SETCHECK, Settings.UseWIPAPUTiming ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ALLOWLEFTRIGHT,BM_SETCHECK, !Settings.DisallowLeftRight ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ENVX,BM_SETCHECK, Settings.SoundEnvelopeHeightReading ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_FMUT,BM_SETCHECK, Settings.FakeMuteFix ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_SYNC_TO_SOUND_CPU,BM_SETCHECK, Settings.SoundSync ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SetWindowText(GetDlgItem(hDlg, IDC_LOADEDFROMMOVIE), _T("")); + } + + { + char str [256]; + + if(m.SyncFlags & MOVIE_SYNC_HASROMINFO) + { + sprintf(str, "Movie's ROM: crc32=%08X, name=%s", m.ROMCRC32, m.ROMName); + SetWindowText(GetDlgItem(hDlg, IDC_MOVIEROMINFO), _T(str)); + } + else + { + sprintf(str, "Movie's ROM: (not stored in movie file)"); + SetWindowText(GetDlgItem(hDlg, IDC_MOVIEROMINFO), _T(str)); + } + + bool mismatch = (m.SyncFlags & MOVIE_SYNC_HASROMINFO) && m.ROMCRC32 != Memory.ROMCRC32; + sprintf(str, "Current ROM: crc32=%08X, name=%s%s", Memory.ROMCRC32, Memory.ROMName, mismatch?" <-- MISMATCH !!!":""); + SetWindowText(GetDlgItem(hDlg, IDC_CURRENTROMINFO), _T(str)); + } + + } else { @@ -9403,8 +10399,30 @@ SetWindowText(GetDlgItem(hDlg, IDC_MOVIE_RERECORD), _T("")); SetWindowText(GetDlgItem(hDlg, IDC_MOVIE_METADATA), _T("")); EnableWindow(GetDlgItem(hDlg, IDC_READONLY), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_DISPLAY_INPUT), FALSE); SendDlgItemMessage(hDlg,IDC_READONLY,BM_SETCHECK,BST_UNCHECKED,0); + SendDlgItemMessage(hDlg,IDC_DISPLAY_INPUT,BM_SETCHECK,BST_UNCHECKED,0); + + + { + SendDlgItemMessage(hDlg,IDC_WIP1,BM_SETCHECK, Settings.UseWIPAPUTiming ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ALLOWLEFTRIGHT,BM_SETCHECK, !Settings.DisallowLeftRight ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ENVX,BM_SETCHECK, Settings.SoundEnvelopeHeightReading ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_FMUT,BM_SETCHECK, Settings.FakeMuteFix ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_SYNC_TO_SOUND_CPU,BM_SETCHECK, Settings.SoundSync ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + } + + { + char str [256]; + + // no movie loaded + SetWindowText(GetDlgItem(hDlg, IDC_MOVIEROMINFO), _T("")); + + sprintf(str, "Current ROM: crc32=%08X, name=%s", Memory.ROMCRC32, Memory.ROMName); + SetWindowText(GetDlgItem(hDlg, IDC_CURRENTROMINFO), _T(str)); + } } + } int CALLBACK DlgOpenMovie(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) @@ -9434,6 +10452,30 @@ { set_movieinfo("", hDlg); } +/* + if(op->SyncFlags & MOVIE_SYNC_DATA_EXISTS) + { + SendDlgItemMessage(hDlg,IDC_WIP1,BM_SETCHECK, (op->SyncFlags & MOVIE_SYNC_WIP1TIMING)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ALLOWLEFTRIGHT,BM_SETCHECK, (op->SyncFlags & MOVIE_SYNC_LEFTRIGHT)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ENVX,BM_SETCHECK, (op->SyncFlags & MOVIE_SYNC_VOLUMEENVX)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_FMUT,BM_SETCHECK, (op->SyncFlags & MOVIE_SYNC_FAKEMUTE)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_SYNC_TO_SOUND_CPU,BM_SETCHECK, (op->SyncFlags & MOVIE_SYNC_SYNCSOUND)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SetWindowText(GetDlgItem(hDlg, IDC_LOADEDFROMMOVIE), _T("LOADED FROM MOVIE:")); + } + else + { + SendDlgItemMessage(hDlg,IDC_WIP1,BM_SETCHECK, Settings.UseWIPAPUTiming ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ALLOWLEFTRIGHT,BM_SETCHECK, !Settings.DisallowLeftRight ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ENVX,BM_SETCHECK, Settings.SoundEnvelopeHeightReading ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_FMUT,BM_SETCHECK, Settings.FakeMuteFix ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_SYNC_TO_SOUND_CPU,BM_SETCHECK, Settings.SoundSync ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SetWindowText(GetDlgItem(hDlg, IDC_LOADEDFROMMOVIE), _T("")); + } +*/ + // make read-only the default + SendDlgItemMessage(hDlg,IDC_READONLY,BM_SETCHECK,BST_CHECKED,0); + + EnableWindow(GetDlgItem(hDlg, IDC_SYNC_TO_SOUND_CPU), 0==Settings.SoundDriver); // can't sync sound to CPU unless using "Snes9x DirectSound" driver } return true; @@ -9441,6 +10483,13 @@ { switch(LOWORD(wParam)) { + case IDC_WIP1: + case IDC_ALLOWLEFTRIGHT: + case IDC_ENVX: + case IDC_FMUT: + case IDC_SYNC_TO_SOUND_CPU: + SetWindowText(GetDlgItem(hDlg, IDC_LOADEDFROMMOVIE), _T("")); + break; case IDC_BROWSE_MOVIE: { OPENFILENAME ofn; @@ -9451,10 +10500,11 @@ ZeroMemory( (LPVOID)&ofn, sizeof(OPENFILENAME) ); ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner = hDlg; - ofn.lpstrFilter = "Snes9x Movie File\0*.smv\0All files\0*.*\0\0"; + ofn.lpstrFilter = MOVIE_FILETYPE_DESCRIPTION "\0*.smv\0All files\0*.*\0\0"; ofn.lpstrFile = szFileName; ofn.lpstrDefExt = "smv"; ofn.nMaxFile = MAX_PATH; + ofn.Flags = OFN_HIDEREADONLY; // hide previously-ignored read-only checkbox (the real read-only box in the open-movie dialog itself) if(GetOpenFileName( &ofn )) { SetWindowText(GetDlgItem(hDlg, IDC_MOVIE_PATH), szFileName); @@ -9467,8 +10517,15 @@ { if(BST_CHECKED==SendDlgItemMessage(hDlg, IDC_READONLY, BM_GETCHECK,0,0)) op->ReadOnly=TRUE; + if(BST_CHECKED==SendDlgItemMessage(hDlg, IDC_DISPLAY_INPUT, BM_GETCHECK,0,0)) + op->DisplayInput=TRUE; GetDlgItemText(hDlg, IDC_MOVIE_PATH, op->Path, MAX_PATH); } + Settings.UseWIPAPUTiming = IsDlgButtonChecked(hDlg, IDC_WIP1); + Settings.DisallowLeftRight = !IsDlgButtonChecked(hDlg, IDC_ALLOWLEFTRIGHT); + Settings.SoundEnvelopeHeightReading = IsDlgButtonChecked(hDlg, IDC_ENVX); + Settings.FakeMuteFix = IsDlgButtonChecked(hDlg, IDC_FMUT); + Settings.SoundSync = IsDlgButtonChecked(hDlg, IDC_SYNC_TO_SOUND_CPU); EndDialog(hDlg, 1); return true; @@ -9486,6 +10543,32 @@ } } +// checks if the currently loaded ROM has an SRAM file in the saves directory that we have write access to +static bool existsSRAM () +{ + const char * fname = S9xGetFilename (".srm"); + FILE * file = fopen(fname, "rb"); // check to see if it exists (w would auto-create which is bad) + if(file != NULL) + { + fclose(file); + + FILE * file = fopen(fname, "wb"); // it exists, now check to see if we can also write to it + if(file != NULL) + { + fclose(file); + return true; // success if it exists and can be written to + } + else + { + return false; // failure if it exists but can't be written to + } + } + else + { + return false; // failure if it doesn't exist + } +} + int CALLBACK DlgCreateMovie(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) { static OpenMovieParams* op=NULL; @@ -9494,6 +10577,11 @@ { case WM_INITDIALOG: { + // have to save here or the SRAM file might not exist when we check for it + // (which would cause clear SRAM option to not do anything) + Memory.SaveSRAM(S9xGetFilename (".srm")); + + op=(OpenMovieParams*)lParam; SendDlgItemMessage(hDlg,IDC_RECORD_RESET,BM_SETCHECK,BST_CHECKED,0); @@ -9512,11 +10600,34 @@ TCHAR drive [_MAX_DRIVE + 1]; TCHAR dir [_MAX_DIR + 1]; TCHAR fname [_MAX_FNAME + 1]; - TCHAR ext [_MAX_EXT + 1]; + TCHAR ext [_MAX_EXT + 1]; _splitpath (Memory.ROMFilename, drive, dir, fname, ext); _makepath (filename, "", "", fname, "smv"); SetWindowText(GetDlgItem(hDlg, IDC_MOVIE_PATH), filename); } + if(op->SyncFlags & MOVIE_SYNC_DATA_EXISTS) + { + SendDlgItemMessage(hDlg,IDC_WIP1,BM_SETCHECK, (op->SyncFlags & MOVIE_SYNC_WIP1TIMING)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ALLOWLEFTRIGHT,BM_SETCHECK, (op->SyncFlags & MOVIE_SYNC_LEFTRIGHT)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ENVX,BM_SETCHECK, (op->SyncFlags & MOVIE_SYNC_VOLUMEENVX)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_FMUT,BM_SETCHECK, (op->SyncFlags & MOVIE_SYNC_FAKEMUTE)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_SYNC_TO_SOUND_CPU,BM_SETCHECK, (op->SyncFlags & MOVIE_SYNC_SYNCSOUND)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SetWindowText(GetDlgItem(hDlg, IDC_LOADEDFROMMOVIE), _T("LOADED FROM MOVIE:")); + } + else + { + SendDlgItemMessage(hDlg,IDC_WIP1,BM_SETCHECK, Settings.UseWIPAPUTiming ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ALLOWLEFTRIGHT,BM_SETCHECK, !Settings.DisallowLeftRight ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ENVX,BM_SETCHECK, Settings.SoundEnvelopeHeightReading ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_FMUT,BM_SETCHECK, Settings.FakeMuteFix ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_SYNC_TO_SOUND_CPU,BM_SETCHECK, Settings.SoundSync ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SetWindowText(GetDlgItem(hDlg, IDC_LOADEDFROMMOVIE), _T("")); + } + + EnableWindow(GetDlgItem(hDlg, IDC_SYNC_TO_SOUND_CPU), 0==Settings.SoundDriver); // can't sync sound to CPU unless using "Snes9x DirectSound" driver + + SendDlgItemMessage(hDlg,IDC_CLEARSRAM,BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + EnableWindow(GetDlgItem(hDlg, IDC_CLEARSRAM), existsSRAM() ? true : false); } return true; @@ -9534,7 +10645,7 @@ ZeroMemory( (LPVOID)&ofn, sizeof(OPENFILENAME) ); ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner = hDlg; - ofn.lpstrFilter = "Snes9x Movie File\0*.smv\0All files\0*.*\0\0"; + ofn.lpstrFilter = MOVIE_FILETYPE_DESCRIPTION "\0*.smv\0All files\0*.*\0\0"; ofn.lpstrFile = szFileName; ofn.lpstrDefExt = "smv"; ofn.nMaxFile = MAX_PATH; @@ -9560,6 +10671,25 @@ } if(BST_CHECKED==SendDlgItemMessage(hDlg, IDC_RECORD_RESET, BM_GETCHECK,0,0)) op->Opts |= MOVIE_OPT_FROM_RESET; + + Settings.UseWIPAPUTiming = IsDlgButtonChecked(hDlg, IDC_WIP1); + Settings.DisallowLeftRight = !IsDlgButtonChecked(hDlg, IDC_ALLOWLEFTRIGHT); + Settings.SoundEnvelopeHeightReading = IsDlgButtonChecked(hDlg, IDC_ENVX); + Settings.FakeMuteFix = IsDlgButtonChecked(hDlg, IDC_FMUT); + Settings.SoundSync = IsDlgButtonChecked(hDlg, IDC_SYNC_TO_SOUND_CPU); + + op->SyncFlags = MOVIE_SYNC_DATA_EXISTS | MOVIE_SYNC_HASROMINFO; + if(Settings.UseWIPAPUTiming) op->SyncFlags |= MOVIE_SYNC_WIP1TIMING; + if(!Settings.DisallowLeftRight) op->SyncFlags |= MOVIE_SYNC_LEFTRIGHT; + if(Settings.SoundEnvelopeHeightReading) op->SyncFlags |= MOVIE_SYNC_VOLUMEENVX; + if(Settings.FakeMuteFix) op->SyncFlags |= MOVIE_SYNC_FAKEMUTE; + if(Settings.SoundSync) op->SyncFlags |= MOVIE_SYNC_SYNCSOUND; + + if(IsDlgButtonChecked(hDlg, IDC_CLEARSRAM) && IsDlgButtonChecked(hDlg, IDC_RECORD_RESET) && existsSRAM()) + { + remove(S9xGetFilename (".srm")); // delete SRAM if it exists (maybe unnecessary?) + Memory.LoadSRAM(S9xGetFilename (".srm")); // refresh memory (hard reset) + } } EndDialog(hDlg, 1); return true; @@ -9568,6 +10698,21 @@ EndDialog(hDlg, 0); return true; + case IDC_RECORD_NOW: + if(existsSRAM()) + { + EnableWindow(GetDlgItem(hDlg, IDC_CLEARSRAM), false); + SendDlgItemMessage(hDlg,IDC_CLEARSRAM,BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); + } + break; + + case IDC_RECORD_RESET: + if(existsSRAM()) + { + EnableWindow(GetDlgItem(hDlg, IDC_CLEARSRAM), true); + } + break; + default: break; } diff -NaHudr snes9x-1.43-src/wsnes9x.cpp.orig snx/wsnes9x.cpp.orig --- snes9x-1.43-src/wsnes9x.cpp.orig 1970-01-01 02:00:00.000000000 +0200 +++ snx/wsnes9x.cpp.orig 2005-04-09 00:59:23.000000000 +0300 @@ -0,0 +1,10724 @@ +/******************************************************************************* + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + + (c) Copyright 1996 - 2002 Gary Henderson (gary.henderson@ntlworld.com) and + Jerremy Koot (jkoot@snes9x.com) + + (c) Copyright 2001 - 2004 John Weidman (jweidman@slip.net) + + (c) Copyright 2002 - 2004 Brad Jorsch (anomie@users.sourceforge.net), + funkyass (funkyass@spam.shaw.ca), + Joel Yliluoma (http://iki.fi/bisqwit/) + Kris Bleakley (codeviolation@hotmail.com), + Matthew Kendora, + Nach (n-a-c-h@users.sourceforge.net), + Peter Bortas (peter@bortas.org) and + zones (kasumitokoduck@yahoo.com) + + C4 x86 assembler and some C emulation code + (c) Copyright 2000 - 2003 zsKnight (zsknight@zsnes.com), + _Demo_ (_demo_@zsnes.com), and Nach + + C4 C++ code + (c) Copyright 2003 Brad Jorsch + + DSP-1 emulator code + (c) Copyright 1998 - 2004 Ivar (ivar@snes9x.com), _Demo_, Gary Henderson, + John Weidman, neviksti (neviksti@hotmail.com), + Kris Bleakley, Andreas Naive + + DSP-2 emulator code + (c) Copyright 2003 Kris Bleakley, John Weidman, neviksti, Matthew Kendora, and + Lord Nightmare (lord_nightmare@users.sourceforge.net + + OBC1 emulator code + (c) Copyright 2001 - 2004 zsKnight, pagefault (pagefault@zsnes.com) and + Kris Bleakley + Ported from x86 assembler to C by sanmaiwashi + + SPC7110 and RTC C++ emulator code + (c) Copyright 2002 Matthew Kendora with research by + zsKnight, John Weidman, and Dark Force + + S-DD1 C emulator code + (c) Copyright 2003 Brad Jorsch with research by + Andreas Naive and John Weidman + + S-RTC C emulator code + (c) Copyright 2001 John Weidman + + ST010 C++ emulator code + (c) Copyright 2003 Feather, Kris Bleakley, John Weidman and Matthew Kendora + + Super FX x86 assembler emulator code + (c) Copyright 1998 - 2003 zsKnight, _Demo_, and pagefault + + Super FX C emulator code + (c) Copyright 1997 - 1999 Ivar, Gary Henderson and John Weidman + + + SH assembler code partly based on x86 assembler code + (c) Copyright 2002 - 2004 Marcus Comstedt (marcus@mc.pp.se) + + + Win32 GUI code + (c) Copyright 2003-2004 blip, Nach, Matthew Kendora and funkyass + + + Specific ports contains the works of other authors. See headers in + individual files. + + Snes9x homepage: http://www.snes9x.com + + Permission to use, copy, modify and distribute Snes9x in both binary and + source form, for non-commercial purposes, is hereby granted without fee, + providing that this license information and copyright notice appear with + all copies and any derived work. + + This software is provided 'as-is', without any express or implied + warranty. In no event shall the authors be held liable for any damages + arising from the use of this software. + + Snes9x is freeware for PERSONAL USE only. Commercial users should + seek permission of the copyright holders first. Commercial use includes + charging money for Snes9x or software derived from Snes9x. + + The copyright holders request that bug fixes and improvements to the code + should be forwarded to them so everyone can benefit from the modifications + in future versions. + + Super NES and Super Nintendo Entertainment System are trademarks of + Nintendo Co., Limited and its subsidiary companies. +*******************************************************************************/ + +#ifdef __MINGW32__ +#define _WIN32_IE 0x0501 +#define _WIN32_WINNT 0x0501 +#endif + +#include +#include + + +#include "wsnes9x.h" +#include "DirectX.h" +#include "snes9x/snes9x.h" +#include "snes9x/memmap.h" +#include "snes9x/cpuexec.h" +#include "snes9x/display.h" +#include "snes9x/3d.h" +#include "snes9x/cheats.h" +#include "snes9x/netplay.h" +#include "snes9x/apu.h" +#include "snes9x/movie.h" +#include "AVIOutput.h" +#include "InputCustom.h" +#include + +#include + +#if (((defined(_MSC_VER) && _MSC_VER >= 1300)) || defined(__MINGW32__)) +// both MINGW and VS.NET use fstream instead of fstream.h which is deprecated +#include +using namespace std; +#else + // for VC++ 6 + #include +#endif + +#include +//#include "string_cache.h" +#include "language.h" + +//uncomment to find memory leaks, with a line in WinMain +//#include + +#include +#include +#include + +extern SNPServer NPServer; + +#ifdef USE_OPENGL +OpenGLData OpenGL; +#endif + +#include +#ifdef FMOD_SUPPORT +#include "fmod.h" +#endif + +__int64 PCBase, PCFrameTime, PCFrameTimeNTSC, PCFrameTimePAL, PCStart, PCEnd; + +#ifdef RTC_DEBUGGER +int CALLBACK SPC7110rtc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +#endif +int CALLBACK DlgSP7PackConfig(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +int CALLBACK DlgSoundConf(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +int CALLBACK DlgInfoProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +int CALLBACK DlgAboutProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +int CALLBACK DlgEmulatorProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); + +int CALLBACK DlgOpenROMProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +LRESULT CALLBACK DlgChildSplitProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +int CALLBACK DlgNPProgress(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +int CALLBACK DlgPackConfigProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +int CALLBACK DlgNetConnect(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +int CALLBACK DlgNPOptions(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +int CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +int CALLBACK DlgInputConfig(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +int CALLBACK DlgHotkeyConfig(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +int CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +int CALLBACK DlgCheatSearch(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +int CALLBACK DlgCheatSearchAdd(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +int CALLBACK DlgCreateMovie(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +int CALLBACK DlgOpenMovie(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); +HRESULT CALLBACK EnumModesCallback( LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext); + +int CALLBACK test(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); + + +#ifdef RTC_DEBUGGER +//Messages for sliders (for some reason they don't get included during the build) +#define TBM_GETPOS (WM_USER) +#define TBM_GETRANGEMIN (WM_USER+1) +#define TBM_GETRANGEMAX (WM_USER+2) +#define TBM_GETTIC (WM_USER+3) +#define TBM_SETTIC (WM_USER+4) +#define TBM_SETPOS (WM_USER+5) +#define TBM_SETRANGE (WM_USER+6) +#define TBM_SETRANGEMIN (WM_USER+7) +#define TBM_SETRANGEMAX (WM_USER+8) +#define TBM_CLEARTICS (WM_USER+9) +#define TBM_SETSEL (WM_USER+10) +#define TBM_SETSELSTART (WM_USER+11) +#define TBM_SETSELEND (WM_USER+12) +#define TBM_GETPTICS (WM_USER+14) +#define TBM_GETTICPOS (WM_USER+15) +#define TBM_GETNUMTICS (WM_USER+16) +#define TBM_GETSELSTART (WM_USER+17) +#define TBM_GETSELEND (WM_USER+18) +#define TBM_CLEARSEL (WM_USER+19) +#define TBM_SETTICFREQ (WM_USER+20) +#define TBM_SETPAGESIZE (WM_USER+21) +#define TBM_GETPAGESIZE (WM_USER+22) +#define TBM_SETLINESIZE (WM_USER+23) +#define TBM_GETLINESIZE (WM_USER+24) +#define TBM_GETTHUMBRECT (WM_USER+25) +#define TBM_GETCHANNELRECT (WM_USER+26) +#define TBM_SETTHUMBLENGTH (WM_USER+27) +#define TBM_GETTHUMBLENGTH (WM_USER+28) +#endif + +#define NOTKNOWN "Unknown Company " +#define HEADER_SIZE 512 +#define INFO_LEN (0xFF - 0xC0) + + +/*****************************************************************************/ +/* Global variables */ +/*****************************************************************************/ +struct sGUI GUI; +typedef struct sExtList +{ + TCHAR* extension; + bool compressed; + struct sExtList* next; +} ExtList; + +ExtList* valid_ext=NULL; +void MakeExtFile(void); +void LoadExts(void); + +extern FILE *trace_fs; +extern int superscope_turbo; +extern int superscope_pause; +extern SCheatData Cheat; +extern bool8 do_frame_adjust; + +HINSTANCE g_hInst; + +#ifdef DEBUGGER +extern "C" void Trace (); +#endif + + + +static const char *rom_filename = NULL; + +CDirectX DirectX; +struct SJoypad Joypad[10] = { + { + true, /* Joypad 1 enabled */ + VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, /* Left, Right, Up, Down */ + 0, 0, /* Left_Up, Left_Down */ + 0, 0, /* Right_Up, Right_Down */ + VK_RETURN, VK_SPACE, /* Start, Select */ + 'V', 'C', /* A B */ + 'D', 'X', /* X Y */ + 'A', 'S' /* L R */ + }, + { + false, /* Joypad 2 disabled */ + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, /* Joypad 3 disabled */ + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, /* Joypad 4 disabled */ + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, /* Joypad 5 disabled */ + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, /* Joypad 1 Turbo disabled */ + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, /* Joypad 2 Turbo disabled */ + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, /* Joypad 3 Turbo disabled */ + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, /* Joypad 4 Turbo disabled */ + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, /* Joypad 5 Turbo disabled */ + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + } +}; + +// stores on/off toggle info for each key of each controller +SJoypad ToggleJoypadStorage [5] = { + { + false, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + } +}; + +SJoypad TurboToggleJoypadStorage [5] = { + { + false, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + }, + { + false, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, + 0, 0, 0, 0, 0, 0 + } +}; + +struct SCustomKeys CustomKeys = { + {VK_OEM_PLUS,0}, // speed+ (=) + {VK_OEM_MINUS,0}, // speed- (-) + {VK_PAUSE,0}, // pause (PAUSE) + {VK_OEM_5,0}, // frame advance (\) + {VK_OEM_PLUS,CUSTKEY_SHIFT_MASK}, // skip+ (_) + {VK_OEM_MINUS,CUSTKEY_SHIFT_MASK}, // skip- (+) + {VK_OEM_3,0}, // superscope turbo (`) + {VK_OEM_2,0}, // superscope pause (/) + {VK_OEM_PERIOD,0}, // frame counter (.) + {'8',CUSTKEY_SHIFT_MASK}, // movie read-only (*) + {{VK_F1,CUSTKEY_SHIFT_MASK}, // save keys + {VK_F2,CUSTKEY_SHIFT_MASK}, + {VK_F3,CUSTKEY_SHIFT_MASK}, + {VK_F4,CUSTKEY_SHIFT_MASK}, + {VK_F5,CUSTKEY_SHIFT_MASK}, + {VK_F6,CUSTKEY_SHIFT_MASK}, + {VK_F7,CUSTKEY_SHIFT_MASK}, + {VK_F8,CUSTKEY_SHIFT_MASK}, + {VK_F9,CUSTKEY_SHIFT_MASK}, + {VK_F10,CUSTKEY_SHIFT_MASK}}, + {{VK_F1,0}, // load keys + {VK_F2,0}, + {VK_F3,0}, + {VK_F4,0}, + {VK_F5,0}, + {VK_F6,0}, + {VK_F7,0}, + {VK_F8,0}, + {VK_F9,0}, + {VK_F10,0}}, + {VK_TAB,0}, // fast forward (TAB) + {VK_OEM_COMMA,0}, // show pressed keys/buttons (,) + {VK_F12,0}, // save screenshot (F12) + {0,0}, // slot plus (disabled by default) + {0,0}, // slot minus (disabled by default) + {0,0}, // slot save (disabled by default) + {0,0}, // slot load (disabled by default) + {'1',0}, // background layer 1 + {'2',0}, // background layer 2 + {'3',0}, // background layer 3 + {'4',0}, // background layer 4 + {'5',0}, // sprite layer + {VK_BACK,0}, // Clipping Windows + {'8',0}, // BG Layering hack + {'9',0}, // Transparency + {'0',0}, // HDMA Emulation + {'6',CUSTKEY_SHIFT_MASK}, // GLCube Mode + {'9',CUSTKEY_SHIFT_MASK}, // Interpolate Mode 7 + {'6',0}, // Joypad Swap + {'7',0} // Switch Controllers +}; + + +struct SSoundRates +{ + uint32 rate; + int ident; +} SoundRates[9] = { + { 8000, ID_SOUND_8000HZ}, + {11025, ID_SOUND_11025HZ}, + {16000, ID_SOUND_16000HZ}, + {22050, ID_SOUND_22050HZ}, + {30000, ID_SOUND_30000HZ}, + {32000, ID_SOUND_32000HZ}, + {35000, ID_SOUND_35000HZ}, + {44100, ID_SOUND_44100HZ}, + {48000, ID_SOUND_48000HZ} +}; + +static uint32 FrameTimings[] = { + 4, 4, 8, 12, 17, 20, 35, 70, 140, 300, 500, 1000, 1000 +}; + +// Languages supported by Snes9X: Windows +// 0 - English [Default] +// 1 - Dutch/Nederlands +struct sLanguages Languages[] = { + { IDR_MENU_US, + TEXT("DirectX failed to initialize!"), + TEXT("DirectDraw failed to set the selected display mode!"), + TEXT("DirectSound failed to initialize; no sound will be played."), + TEXT("These settings won't take effect until you restart the emulator."), + TEXT("The frame timer failed to initialize, please do NOT select the automatic framerate option or Snes9X will crash!")}, + { IDR_MENU_NL, + TEXT("Er is een fout opgetreden tijdens het initalizeren van DirectX!"), + TEXT("Er is een fout opgetreden tijdens het verander van scherm modus!"), + TEXT("Er is een fout opgetreden tijdens het initializeren van DirectSound, er zal geen geluid worden afgespeeld."), + TEXT("Deze opties worden pas toegepast als de emulator opnieuw is opgestart."), + TEXT("Er is een fout opgetreden tijdens het initializeren van de frame timer, kies NIET de automatische framerate optie want dan zal Snes9X crashen!")} +}; + +struct OpenMovieParams +{ + char Path[_MAX_PATH]; + bool8 ReadOnly; + bool8 DisplayInput; + uint8 ControllersMask; + uint8 Opts; + uint8 SyncFlags; + wchar_t Metadata[MOVIE_MAX_METADATA]; +}; +struct dMode +{ + long height; + long width; + long depth; + int status; +}; + +std::vector dm; +/*****************************************************************************/ +/* WinProc */ +/*****************************************************************************/ +void DoAVIOpen(const char* filename); +void DoAVIClose(int reason); +bool8 SetupSound( long rate, bool8 sixteen_bit, bool8 stereo); +void RestoreGUIDisplay (); +void RestoreSNESDisplay (); +void FreezeUnfreeze (int slot, bool8 freeze); +void CheckDirectoryIsWritable (const char *filename); +static void CheckMenuStates (); +static void ResetFrameTimer (); +bool8 LoadROM (const char *filename); +#ifdef NETPLAY_SUPPORT +static void EnableServer (bool8 enable); +#endif +static void WinDeleteRegistryEntries (); +static void WinSetDefaultValues (); +static void WinDeleteRecentGamesList (); + +#ifdef USE_DIRECTX3D +void D3DMove (HWND, LPARAM); +void D3DSizeChange (HWND, WPARAM); +#endif + +#include "snes9x/ppu.h" +#include "snes9x/snapshot.h" +extern "C" const char *S9xGetFilename (const char *); +const char *S9xGetFilenameInc (const char *); +void S9xSetRecentGames (); +void S9xAddToRecentGames (const char *filename); + +void S9xMouseOn () +{ + if (IPPU.Controller == SNES_MOUSE || IPPU.Controller == SNES_MOUSE_SWAPPED) + { + SetCursor (NULL); + } + else if (IPPU.Controller != SNES_SUPERSCOPE&&IPPU.Controller != SNES_JUSTIFIER&&IPPU.Controller != SNES_JUSTIFIER_2) + { + SetCursor (GUI.Arrow); + GUI.CursorTimer = 60; + } + else SetCursor (GUI.GunSight); +} + +void S9xRestoreWindowTitle () +{ + TCHAR buf [100]; + sprintf (buf, TEXT(WINDOW_TITLE), VERSION); + SetWindowText (GUI.hWnd, buf); +} + +void SwitchToGDI() +{ + if (!VOODOO_MODE && !OPENGL_MODE) + { + IPPU.ColorsChanged = true; + DirectX.lpDD->FlipToGDISurface(); + GUI.FlipCounter = 0; + DirectX.lpDDSPrimary2->SetPalette (NULL); + } +} + +static void S9xClearSurface (LPDIRECTDRAWSURFACE2 lpDDSurface) +{ + DDBLTFX fx; + + memset (&fx, 0, sizeof (fx)); + fx.dwSize = sizeof (fx); + + while (lpDDSurface->Blt (NULL, DirectX.lpDDSPrimary2, NULL, DDBLT_WAIT, NULL) == DDERR_SURFACELOST) + lpDDSurface->Restore (); +} + +void UpdateBackBuffer() +{ + GUI.ScreenCleared = true; + + if (!VOODOO_MODE && !OPENGL_MODE && GUI.FullScreen) + { + SwitchToGDI(); + + DDBLTFX fx; + + memset (&fx, 0, sizeof (fx)); + fx.dwSize = sizeof (fx); + + while (DirectX.lpDDSPrimary2->Blt (NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx) == DDERR_SURFACELOST) + DirectX.lpDDSPrimary2->Restore (); + + if (GetMenu (GUI.hWnd) != NULL) + DrawMenuBar (GUI.hWnd); + + GUI.FlipCounter = 0; + DDSCAPS caps; + caps.dwCaps = DDSCAPS_BACKBUFFER; + + LPDIRECTDRAWSURFACE2 pDDSurface; + + if (DirectX.lpDDSPrimary2->GetAttachedSurface (&caps, &pDDSurface) == DD_OK && + pDDSurface != NULL) + { + S9xClearSurface (pDDSurface); + DirectX.lpDDSPrimary2->Flip (NULL, DDFLIP_WAIT); + while (DirectX.lpDDSPrimary2->GetFlipStatus (DDGFS_ISFLIPDONE) != DD_OK) + Sleep (0); + S9xClearSurface (pDDSurface); + } + } + else + { + if (GetMenu( GUI.hWnd) != NULL) + DrawMenuBar (GUI.hWnd); + } +} + +void ToggleFullScreen () +{ + S9xSetPause (PAUSE_TOGGLE_FULL_SCREEN); + +#ifdef USE_GLIDE + if (VOODOO_MODE) + { + // S9xGlideEnable (FALSE); + // GUI.Scale = 0; + // MoveWindow (GUI.hWnd, GUI.window_size.left, + // GUI.window_size.top, + // GUI.window_size.right - GUI.window_size.left, + // GUI.window_size.bottom - GUI.window_size.top, TRUE); + } + else +#endif +#ifdef USE_OPENGL + if (OPENGL_MODE) + { + if (!GUI.FullScreen) + { + DEVMODE dmScreenSettings; + + memset (&dmScreenSettings, 0, sizeof(dmScreenSettings)); + dmScreenSettings.dmSize = sizeof(dmScreenSettings); + dmScreenSettings.dmPelsWidth = GUI.Width; + dmScreenSettings.dmPelsHeight = GUI.Height; + dmScreenSettings.dmBitsPerPel = 16; //bits; + dmScreenSettings.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | + DM_PELSHEIGHT; + if (ChangeDisplaySettings (&dmScreenSettings, CDS_FULLSCREEN) == DISP_CHANGE_SUCCESSFUL) + { + GUI.FullScreen = TRUE; + SetWindowLong (GUI.hWnd, GWL_STYLE, WS_POPUP | WS_VISIBLE); + SetWindowPos (GUI.hWnd, HWND_TOP, 0, 0, GUI.Width, + GUI.Height, + SWP_DRAWFRAME|SWP_FRAMECHANGED); + } + } + else + { + SetWindowLong (GUI.hWnd, GWL_STYLE, WS_POPUPWINDOW|WS_CAPTION| + WS_THICKFRAME|WS_VISIBLE|WS_MINIMIZEBOX|WS_MAXIMIZEBOX); + SetWindowPos (GUI.hWnd, HWND_TOP, + GUI.window_size.left, + GUI.window_size.top, + GUI.window_size.right - GUI.window_size.left, + GUI.window_size.bottom - GUI.window_size.top, + SWP_DRAWFRAME|SWP_FRAMECHANGED); + ChangeDisplaySettings (NULL, 0); + GUI.FullScreen = FALSE; + } + } + else + { +#endif + if (!VOODOO_MODE && !GUI.FullScreen) + GetWindowRect (GUI.hWnd, &GUI.window_size); + + if (!DirectX.SetDisplayMode (GUI.Width, GUI.Height, GUI.Depth, GUI.FullScreen, GUI.DoubleBuffered)) + { + MessageBox( GUI.hWnd, Languages[ GUI.Language].errModeDD, TEXT("Snes9X - DirectDraw(2)"), MB_OK | MB_ICONSTOP); + S9xClearPause (PAUSE_TOGGLE_FULL_SCREEN); + return; + } + GUI.FullScreen = !GUI.FullScreen; + if (!GUI.FullScreen) + { + SwitchToGDI(); + MoveWindow (GUI.hWnd, GUI.window_size.left, + GUI.window_size.top, + GUI.window_size.right - GUI.window_size.left, + GUI.window_size.bottom - GUI.window_size.top, TRUE); + } +#if defined(USE_GLIDE) || defined (USE_OPENGL) + } +#endif + S9xGraphicsDeinit(); + S9xSetWinPixelFormat (); + S9xGraphicsInit(); + + IPPU.RenderThisFrame = true; + UpdateBackBuffer(); + + S9xClearPause (PAUSE_TOGGLE_FULL_SCREEN); +} + +void S9xDisplayStateChange (const char *str, bool8 on) +{ + static char string [100]; + + sprintf (string, "%s %s", str, on ? "on" : "off"); + S9xSetInfoString (string); +} + +LRESULT CALLBACK WinProc( + HWND hWnd, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + int i; + //bool showFPS; + static char InfoString [100]; +#ifdef NETPLAY_SUPPORT + char hostname [100]; +#endif + switch (uMsg) + { + case WM_CREATE: + g_hInst = ((LPCREATESTRUCT)lParam)->hInstance; +#ifndef MK_APU + DeleteMenu(GUI.hMenu,IDM_CATCH_UP_SOUND,MF_BYCOMMAND); +#endif + return 0; + case WM_SYSKEYDOWN: + case WM_KEYDOWN: + { + // update toggles + for (int J = 0; J < 5; J++) + { + extern bool S9xGetState (WORD KeyIdent); + if(Joypad[J].Enabled && (!S9xGetState(Joypad[J+5].Left))) // enabled and Togglify + { + SJoypad & p = ToggleJoypadStorage[J]; + if(wParam == Joypad[J].L) p.L = !p.L; + if(wParam == Joypad[J].R) p.R = !p.R; + if(wParam == Joypad[J].A) p.A = !p.A; + if(wParam == Joypad[J].B) p.B = !p.B; + if(wParam == Joypad[J].Y) p.Y = !p.Y; + if(wParam == Joypad[J].X) p.X = !p.X; + if(wParam == Joypad[J].Start) p.Start = !p.Start; + if(wParam == Joypad[J].Select) p.Select = !p.Select; + if(wParam == Joypad[J].Left) p.Left = !p.Left; + if(wParam == Joypad[J].Right) p.Right = !p.Right; + if(wParam == Joypad[J].Up) p.Up = !p.Up; + if(wParam == Joypad[J].Down) p.Down = !p.Down; +/// if(wParam == Joypad[J].Left_Down) p.Left_Down = !p.Left_Down; +/// if(wParam == Joypad[J].Left_Up) p.Left_Up = !p.Left_Up; +/// if(wParam == Joypad[J].Right_Down) p.Right_Down = !p.Right_Down; +/// if(wParam == Joypad[J].Right_Up) p.Right_Up = !p.Right_Up; + if(Settings.DisallowLeftRight) + { + if(p.Left && p.Right) + p.Left = p.Right = false; + if(p.Up && p.Down) + p.Up = p.Down = false; + } + } + if(Joypad[J].Enabled && (!S9xGetState(Joypad[J+5].Down))) // enabled and turbo-togglify (TurboTog) + { + SJoypad & p = TurboToggleJoypadStorage[J]; + if(wParam == Joypad[J].L) p.L = !p.L; + if(wParam == Joypad[J].R) p.R = !p.R; + if(wParam == Joypad[J].A) p.A = !p.A; + if(wParam == Joypad[J].B) p.B = !p.B; + if(wParam == Joypad[J].Y) p.Y = !p.Y; + if(wParam == Joypad[J].X) p.X = !p.X; + if(wParam == Joypad[J].Start) p.Start = !p.Start; + if(wParam == Joypad[J].Select) p.Select = !p.Select; +/// if(wParam == Joypad[J].Left) p.Left = !p.Left; +/// if(wParam == Joypad[J].Right) p.Right = !p.Right; +/// if(wParam == Joypad[J].Up) p.Up = !p.Up; +/// if(wParam == Joypad[J].Down) p.Down = !p.Down; +/// if(wParam == Joypad[J].Left_Down) p.Left_Down = !p.Left_Down; +/// if(wParam == Joypad[J].Left_Up) p.Left_Up = !p.Left_Up; +/// if(wParam == Joypad[J].Right_Down) p.Right_Down = !p.Right_Down; +/// if(wParam == Joypad[J].Right_Up) p.Right_Up = !p.Right_Up; +/* if(Settings.DisallowLeftRight) + { + if(p.Left && p.Right && ) + p.Left = p.Right = false; + if(p.Up && p.Down) + p.Up = p.Down = false; + }*/ + } + if(wParam == Joypad[J+5].Right) // clear all + { + { + SJoypad & p = ToggleJoypadStorage[J]; + p.L = false; + p.R = false; + p.A = false; + p.B = false; + p.Y = false; + p.X = false; + p.Start = false; + p.Select = false; + p.Left = false; + p.Right = false; + p.Up = false; + p.Down = false; + } + { + SJoypad & p = TurboToggleJoypadStorage[J]; + p.L = false; + p.R = false; + p.A = false; + p.B = false; + p.Y = false; + p.X = false; + p.Start = false; + p.Select = false; + p.Left = false; + p.Right = false; + p.Up = false; + p.Down = false; + } + } + } + + + bool hitHotKey = false; + + if(!(wParam == 0 || wParam == VK_ESCAPE)) // if it's the 'disabled' key, it's never pressed as a hotkey + { + + int modifiers = 0; + if(GetAsyncKeyState(VK_MENU)) + modifiers |= CUSTKEY_ALT_MASK; + if(GetAsyncKeyState(VK_CONTROL)) + modifiers |= CUSTKEY_CTRL_MASK; + if(GetAsyncKeyState(VK_SHIFT)) + modifiers |= CUSTKEY_SHIFT_MASK; + + { + for(int i = 0 ; i < 10 ; i++) + { + if(wParam == CustomKeys.Save[i].key + && modifiers == CustomKeys.Save[i].modifiers) + { + FreezeUnfreeze (i, true); + hitHotKey = true; + } + if(wParam == CustomKeys.Load[i].key + && modifiers == CustomKeys.Load[i].modifiers) + { + FreezeUnfreeze (i, false); + hitHotKey = true; + } + } + + if(wParam == CustomKeys.SlotSave.key + && modifiers == CustomKeys.SlotSave.modifiers) + { + FreezeUnfreeze (Settings.CurrentSaveSlot, true); + hitHotKey = true; + } + if(wParam == CustomKeys.SlotLoad.key + && modifiers == CustomKeys.SlotLoad.modifiers) + { + FreezeUnfreeze (Settings.CurrentSaveSlot, false); + hitHotKey = true; + } + if(wParam == CustomKeys.SlotPlus.key + && modifiers == CustomKeys.SlotPlus.modifiers) + { + Settings.CurrentSaveSlot++; + if(Settings.CurrentSaveSlot > 9) + Settings.CurrentSaveSlot = 0; + + static char str [64]; + sprintf(str, "set slot 00%d", Settings.CurrentSaveSlot); + S9xSetInfoString(str); + + hitHotKey = true; + } + if(wParam == CustomKeys.SlotMinus.key + && modifiers == CustomKeys.SlotMinus.modifiers) + { + Settings.CurrentSaveSlot--; + if(Settings.CurrentSaveSlot < 0) + Settings.CurrentSaveSlot = 9; + + static char str [64]; + sprintf(str, "set slot 00%d", Settings.CurrentSaveSlot); + S9xSetInfoString(str); + + hitHotKey = true; + } + } + + + if(wParam == CustomKeys.FrameAdvance.key + && modifiers == CustomKeys.FrameAdvance.modifiers) + { + if(Settings.Paused) + { + Settings.FrameAdvance = true; + // kick the main thread out of GetMessage (just in case) + SendMessage(GUI.hWnd, WM_NULL, 0, 0); + } + else + { + Settings.Paused = true; + } + hitHotKey = true; + } + if(wParam == CustomKeys.FrameCount.key + && modifiers == CustomKeys.FrameCount.modifiers) + { + if (S9xMovieActive()) + S9xMovieToggleFrameDisplay (); + else + S9xMessage(S9X_INFO, S9X_MOVIE_INFO, "No movie; can't toggle frame count."); + hitHotKey = true; + } + if(wParam == CustomKeys.Pause.key + && modifiers == CustomKeys.Pause.modifiers) + { + Settings.Paused = Settings.Paused ^ true; + Settings.FrameAdvance = false; + hitHotKey = true; + } + if(wParam == CustomKeys.ReadOnly.key + && modifiers == CustomKeys.ReadOnly.modifiers) + { + if (S9xMovieActive()) + S9xMovieToggleRecState(); + else + S9xMessage(S9X_INFO, S9X_MOVIE_INFO, "No movie; can't toggle read-only."); + hitHotKey = true; + } + if(wParam == CustomKeys.FastForward.key + && modifiers == CustomKeys.FastForward.modifiers) + { + if(Settings.SPC7110RTC) + break; + if (GUI.TurboModeToggle) + { + Settings.TurboMode ^= TRUE; + if (Settings.TurboMode) + S9xMessage (S9X_INFO, S9X_TURBO_MODE, + WINPROC_TURBOMODE_ON); + else + S9xMessage (S9X_INFO, S9X_TURBO_MODE, + WINPROC_TURBOMODE_OFF); + } + else + { + Settings.TurboMode = TRUE; + S9xMessage (S9X_INFO, S9X_TURBO_MODE, WINPROC_TURBOMODE_TEXT); + } + hitHotKey = true; + } + if(wParam == CustomKeys.ShowPressed.key + && modifiers == CustomKeys.ShowPressed.modifiers) + { + Settings.DisplayPressedKeys = !Settings.DisplayPressedKeys; + + if(Settings.DisplayPressedKeys) + S9xMessage(S9X_INFO, S9X_MOVIE_INFO, "Input display enabled."); + else + S9xMessage(S9X_INFO, S9X_MOVIE_INFO, "Input display disabled."); + + hitHotKey = true; + } + if(wParam == CustomKeys.SaveScreenShot.key + && modifiers == CustomKeys.SaveScreenShot.modifiers) + { + Settings.TakeScreenshot=true; + } + if(wParam == CustomKeys.ScopePause.key + && modifiers == CustomKeys.ScopePause.modifiers) + { + superscope_pause ^= 1; + hitHotKey = true; + } + if(wParam == CustomKeys.ScopeTurbo.key + && modifiers == CustomKeys.ScopeTurbo.modifiers) + { + superscope_turbo ^= 1; + hitHotKey = true; + } + if(wParam == CustomKeys.SkipDown.key + && modifiers == CustomKeys.SkipDown.modifiers) + { + if (Settings.SkipFrames <= 1) + Settings.SkipFrames = AUTO_FRAMERATE; + else + if (Settings.SkipFrames != AUTO_FRAMERATE) + Settings.SkipFrames--; + + if (Settings.SkipFrames == AUTO_FRAMERATE) + S9xSetInfoString (WINPROC_AUTOSKIP); + else + { + sprintf (InfoString, WINPROC_FRAMESKIP, + Settings.SkipFrames - 1); + S9xSetInfoString (InfoString); + } + hitHotKey = true; + } + if(wParam == CustomKeys.SkipUp.key + && modifiers == CustomKeys.SkipUp.modifiers) + { + if (Settings.SkipFrames == AUTO_FRAMERATE) + Settings.SkipFrames = 1; + else + if (Settings.SkipFrames < 10) + Settings.SkipFrames++; + + if (Settings.SkipFrames == AUTO_FRAMERATE) + S9xSetInfoString (WINPROC_AUTOSKIP); + else + { + sprintf (InfoString, WINPROC_FRAMESKIP, + Settings.SkipFrames - 1); + S9xSetInfoString (InfoString); + } + hitHotKey = true; + } + if(wParam == CustomKeys.SpeedDown.key + && modifiers == CustomKeys.SpeedDown.modifiers) + { + // Increase emulated frame time + int i; + for(i=1; FrameTimings[i]> 1; + middle.y = (size.bottom - size.top) >> 1; + ClientToScreen (GUI.hWnd, &middle); + SetCursorPos (middle.x, middle.y); + } + } + if(wParam == CustomKeys.BGLHack.key + && modifiers == CustomKeys.BGLHack.modifiers) + { + Settings.BGLayering = !Settings.BGLayering; + S9xDisplayStateChange (WINPROC_BGHACK, + Settings.BGLayering); + } + if(wParam == CustomKeys.InterpMode7.key + && modifiers == CustomKeys.InterpMode7.modifiers) + { + Settings.Mode7Interpolate ^= TRUE; + S9xDisplayStateChange (WINPROC_MODE7INTER, + Settings.Mode7Interpolate); + } + if(wParam == CustomKeys.Transparency.key + && modifiers == CustomKeys.Transparency.modifiers) + { + if (Settings.SixteenBit) + { + Settings.Transparency = !Settings.Transparency; + S9xDisplayStateChange (WINPROC_TRANSPARENCY, + Settings.Transparency); + } + else + { + S9xSetInfoString ("Transparency requires Sixteen Bit mode."); + } + } + if(wParam == CustomKeys.ClippingWindows.key + && modifiers == CustomKeys.ClippingWindows.modifiers) + { + Settings.DisableGraphicWindows = !Settings.DisableGraphicWindows; + S9xDisplayStateChange (WINPROC_CLIPWIN, + !Settings.DisableGraphicWindows); + } + + // don't pull down menu if alt is a hotkey or the menu isn't there, unless no game is running + if(!Settings.StopEmulation && ((wParam == VK_MENU || wParam == VK_F10) && (hitHotKey || GetMenu (GUI.hWnd) == NULL) && !GetAsyncKeyState(VK_F4))) + return 0; + } + + if(!hitHotKey) + switch (wParam) + { + case VK_ESCAPE: + if (GetMenu (GUI.hWnd) == NULL) + SetMenu (GUI.hWnd, GUI.hMenu); + else + SetMenu (GUI.hWnd, NULL); + + UpdateBackBuffer(); + break; + } + break; + } + + case WM_KEYUP: + { + int modifiers = 0; + if(GetAsyncKeyState(VK_MENU)) + modifiers |= CUSTKEY_ALT_MASK; + if(GetAsyncKeyState(VK_CONTROL)) + modifiers |= CUSTKEY_CTRL_MASK; + if(GetAsyncKeyState(VK_SHIFT)) + modifiers |= CUSTKEY_SHIFT_MASK; + + if(wParam == CustomKeys.FastForward.key + && modifiers == CustomKeys.FastForward.modifiers) + { + if (!GUI.TurboModeToggle) + Settings.TurboMode = FALSE; + } + } + break; + case WM_COMMAND: + switch (wParam & 0xffff) + { + case ID_FILE_WRITE_AVI: + { + RestoreGUIDisplay (); //exit DirectX + OPENFILENAME ofn; + char szFileName[MAX_PATH]; + + szFileName[0] = '\0'; + + ZeroMemory( (LPVOID)&ofn, sizeof(OPENFILENAME) ); + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = GUI.hWnd; + ofn.lpstrFilter = "AVI File\0*.avi\0All files\0*.*\0\0"; + ofn.lpstrFile = szFileName; + ofn.lpstrDefExt = "avi"; + ofn.nMaxFile = MAX_PATH; + ofn.Flags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT; + if(GetSaveFileName( &ofn )) + { + DoAVIOpen(szFileName); +/// Settings.DisplayPressedKeys = false; + } + RestoreSNESDisplay ();// re-enter after dialog + } + break; + case ID_FILE_STOP_AVI: + DoAVIClose(0); + break; + case ID_FILE_MOVIE_STOP: + S9xMovieStop(FALSE); + break; + case ID_FILE_MOVIE_PLAY: + { + RestoreGUIDisplay (); //exit DirectX + OpenMovieParams op; + memset(&op, 0, sizeof(op)); + if(DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_OPENMOVIE), hWnd, DlgOpenMovie, (LPARAM)&op) && + op.Path[0]!='\0') + { + int err=S9xMovieOpen (op.Path, op.ReadOnly); + if(err!=SUCCESS) + { + _TCHAR* err_string=TEXT(MOVIE_ERR_COULD_NOT_OPEN); + switch(err) + { + case FILE_NOT_FOUND: + err_string=TEXT(MOVIE_ERR_NOT_FOUND); + break; + case WRONG_FORMAT: + err_string=TEXT(MOVIE_ERR_WRONG_FORMAT); + break; + case WRONG_VERSION: + err_string=TEXT(MOVIE_ERR_WRONG_VERSION); + break; + } + MessageBox( hWnd, err_string, TEXT(SNES9X_INFO), MB_OK); + } + else + { +/// Settings.DisplayPressedKeys = op.DisplayInput; + } + } + RestoreSNESDisplay ();// re-enter after dialog + } + break; + case ID_FILE_MOVIE_RECORD: + { + RestoreGUIDisplay (); //exit DirectX + OpenMovieParams op; + memset(&op, 0, sizeof(op)); + if(DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_CREATEMOVIE), hWnd, DlgCreateMovie, (LPARAM)&op) && + op.Path[0]!='\0') + { + op.SyncFlags = MOVIE_SYNC_DATA_EXISTS | MOVIE_SYNC_HASROMINFO; + if(Settings.UseWIPAPUTiming) op.SyncFlags |= MOVIE_SYNC_WIP1TIMING; + if(!Settings.DisallowLeftRight) op.SyncFlags |= MOVIE_SYNC_LEFTRIGHT; + if(Settings.SoundEnvelopeHeightReading) op.SyncFlags |= MOVIE_SYNC_VOLUMEENVX; + if(Settings.FakeMuteFix) op.SyncFlags |= MOVIE_SYNC_FAKEMUTE; + if(Settings.SoundSync) op.SyncFlags |= MOVIE_SYNC_SYNCSOUND; + + int err=S9xMovieCreate (op.Path, op.ControllersMask, op.Opts, op.SyncFlags, op.Metadata, wcslen(op.Metadata)); + if(err!=SUCCESS) + { + _TCHAR* err_string=TEXT(MOVIE_ERR_COULD_NOT_OPEN); + switch(err) + { + case FILE_NOT_FOUND: + err_string=TEXT(MOVIE_ERR_NOT_FOUND); + break; + case WRONG_FORMAT: + err_string=TEXT(MOVIE_ERR_WRONG_FORMAT); + break; + case WRONG_VERSION: + err_string=TEXT(MOVIE_ERR_WRONG_VERSION); + break; + } + MessageBox( hWnd, err_string, TEXT(SNES9X_INFO), MB_OK); + } + } + RestoreSNESDisplay ();// re-enter after dialog + } + break; +/// case ID_SCREENSHOT: +/// Settings.TakeScreenshot=true; +/// break; + case IDM_GFX_PACKS: + RestoreGUIDisplay (); //exit DirectX + DialogBox(g_hInst, MAKEINTRESOURCE(IDD_GFX_PACK), hWnd, DlgPackConfigProc); + RestoreSNESDisplay ();// re-enter after dialog + break; + case IDM_CATCH_UP_SOUND: + Settings.SampleCatchup=!Settings.SampleCatchup; + if(Settings.SampleCatchup) + CheckMenuItem(GUI.hMenu, IDM_CATCH_UP_SOUND, MFS_CHECKED); + else CheckMenuItem(GUI.hMenu, IDM_CATCH_UP_SOUND, MFS_UNCHECKED); + break; + case IDM_ENABLE_MULTITAP: + Settings.MultiPlayer5=Settings.MultiPlayer5Master=!Settings.MultiPlayer5Master; + if(Settings.MultiPlayer5Master) + CheckMenuItem(GUI.hMenu, IDM_ENABLE_MULTITAP, MFS_CHECKED); + else CheckMenuItem(GUI.hMenu, IDM_ENABLE_MULTITAP, MFS_UNCHECKED); + + break; + case IDM_SCOPE_TOGGLE: + Settings.SuperScope=Settings.SuperScopeMaster=!Settings.SuperScopeMaster; + if(Settings.SuperScopeMaster) + CheckMenuItem(GUI.hMenu, IDM_SCOPE_TOGGLE, MFS_CHECKED); + else CheckMenuItem(GUI.hMenu, IDM_SCOPE_TOGGLE, MFS_UNCHECKED); + break; + + case IDM_JUSTIFIER: + Settings.Justifier=Settings.JustifierMaster=!Settings.JustifierMaster; + if(Settings.JustifierMaster) + CheckMenuItem(GUI.hMenu, IDM_JUSTIFIER, MFS_CHECKED); + else CheckMenuItem(GUI.hMenu, IDM_JUSTIFIER, MFS_UNCHECKED); + break; + + case IDM_MOUSE_TOGGLE: + Settings.Mouse=Settings.MouseMaster=!Settings.MouseMaster; + if(Settings.MouseMaster) + CheckMenuItem(GUI.hMenu, IDM_MOUSE_TOGGLE, MFS_CHECKED); + else CheckMenuItem(GUI.hMenu, IDM_MOUSE_TOGGLE, MFS_UNCHECKED); + break; + + //start turbo + case ID_TURBO_R: + GUI.TurboMask^=TURBO_R_MASK; + if(GUI.TurboMask&TURBO_R_MASK) + S9xSetInfoString (WINPROC_TURBO_R_ON); + else S9xSetInfoString (WINPROC_TURBO_R_OFF); + break; + case ID_TURBO_L: + GUI.TurboMask^=TURBO_L_MASK; + if(GUI.TurboMask&TURBO_L_MASK) + S9xSetInfoString (WINPROC_TURBO_L_ON); + else S9xSetInfoString (WINPROC_TURBO_L_OFF); + break; + case ID_TURBO_A: + GUI.TurboMask^=TURBO_A_MASK; + if(GUI.TurboMask&TURBO_A_MASK) + S9xSetInfoString (WINPROC_TURBO_A_ON); + else S9xSetInfoString (WINPROC_TURBO_A_OFF); + break; + case ID_TURBO_B: + GUI.TurboMask^=TURBO_B_MASK; + if(GUI.TurboMask&TURBO_B_MASK) + S9xSetInfoString (WINPROC_TURBO_B_ON); + else S9xSetInfoString (WINPROC_TURBO_B_OFF); + break; + case ID_TURBO_Y: + GUI.TurboMask^=TURBO_Y_MASK; + if(GUI.TurboMask&TURBO_Y_MASK) + S9xSetInfoString (WINPROC_TURBO_Y_ON); + else S9xSetInfoString (WINPROC_TURBO_Y_OFF); + break; + case ID_TURBO_X: + GUI.TurboMask^=TURBO_X_MASK; + if(GUI.TurboMask&TURBO_X_MASK) + S9xSetInfoString (WINPROC_TURBO_X_ON); + else S9xSetInfoString (WINPROC_TURBO_X_OFF); + break; + case ID_TURBO_START: + GUI.TurboMask^=TURBO_STA_MASK; + if(GUI.TurboMask&TURBO_STA_MASK) + S9xSetInfoString (WINPROC_TURBO_START_ON); + else S9xSetInfoString (WINPROC_TURBO_START_OFF); + break; + case ID_TURBO_SELECT: + GUI.TurboMask^=TURBO_SEL_MASK; + if(GUI.TurboMask&TURBO_SEL_MASK) + S9xSetInfoString (WINPROC_TURBO_SEL_ON); + else S9xSetInfoString (WINPROC_TURBO_SEL_OFF); + break; + //end turbo + case ID_OPTIONS_DISPLAY: + { + int old_scale = GUI.NextScale; + bool old_stretch = GUI.Stretch; + + RestoreGUIDisplay (); + //showFPS = Settings.DisplayFrameRate ? true : false; + if (!VOODOO_MODE && !GUI.FullScreen) + GetWindowRect (GUI.hWnd, &GUI.window_size); + DialogBox(g_hInst, MAKEINTRESOURCE(IDD_NEWDISPLAY), hWnd, DlgFunky); + //_DirectXConfig (DirectX.lpDD, &Settings, &GUI, &showFPS); + + //Settings.DisplayFrameRate = showFPS; + SwitchToGDI(); + if (GUI.NextScale != old_scale) + { + if ((GUI.Scale < 7 && GUI.NextScale < 7) || + (GUI.Scale > 7 && GUI.NextScale > 7)) + GUI.Scale = GUI.NextScale; + else + { + MessageBox (GUI.hWnd, TEXT(WINPROC_FILTER_RESTART), + TEXT(SNES9X_INFO), + MB_OK | MB_ICONINFORMATION); + } + } + RestoreSNESDisplay (); + if (!GUI.FullScreen) + { + MoveWindow (GUI.hWnd, GUI.window_size.left, + GUI.window_size.top, + GUI.window_size.right - GUI.window_size.left, + GUI.window_size.bottom - GUI.window_size.top, TRUE); + } + S9xGraphicsDeinit(); + S9xSetWinPixelFormat (); + S9xGraphicsInit(); + + IPPU.RenderThisFrame = false; + + if (old_stretch != GUI.Stretch || old_scale != GUI.Scale) + { + RECT rect; + GetClientRect (GUI.hWnd, &rect); + InvalidateRect (GUI.hWnd, &rect, true); + } + break; + } + + case ID_OPTIONS_JOYPAD: + RestoreGUIDisplay (); + DialogBox(g_hInst, MAKEINTRESOURCE(IDD_INPUTCONFIG), hWnd, DlgInputConfig); + RestoreSNESDisplay (); + break; + + case ID_OPTIONS_KEYCUSTOM: + RestoreGUIDisplay (); + DialogBox(g_hInst, MAKEINTRESOURCE(IDD_KEYCUSTOM), hWnd, DlgHotkeyConfig); + RestoreSNESDisplay (); + break; + + case ID_FILE_OPEN: + { + char filename [_MAX_PATH]; + +#ifdef NETPLAY_SUPPORT + if (Settings.NetPlay && !Settings.NetPlayServer) + { + S9xMessage (S9X_INFO, S9X_NETPLAY_NOT_SERVER, + WINPROC_DISCONNECT); + break; + } +#endif + RestoreGUIDisplay (); + INITCOMMONCONTROLSEX icex; + + icex.dwSize = sizeof(INITCOMMONCONTROLSEX); + icex.dwICC = ICC_LISTVIEW_CLASSES|ICC_TREEVIEW_CLASSES; + InitCommonControlsEx(&icex); + + if(1<=DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_OPEN_ROM), hWnd, DlgOpenROMProc, (LPARAM)filename)) + + { + if (!Settings.StopEmulation) + { + Memory.SaveSRAM (S9xGetFilename (".srm")); + S9xSaveCheatFile (S9xGetFilename (".cht")); + } + Settings.StopEmulation = !LoadROM (filename); + if (!Settings.StopEmulation) + { + Memory.LoadSRAM (S9xGetFilename (".srm")); + S9xLoadCheatFile (S9xGetFilename (".cht")); + S9xAddToRecentGames (filename); + CheckDirectoryIsWritable (S9xGetFilename (".---")); + CheckMenuStates (); +#ifdef NETPLAY_SUPPORT + if (NPServer.SendROMImageOnConnect) + S9xNPServerQueueSendingROMImage (); + else + S9xNPServerQueueSendingLoadROMRequest (Memory.ROMName); +#endif + } + + if (IPPU.Controller == SNES_SUPERSCOPE) + SetCursor (GUI.GunSight); + else + { + SetCursor (GUI.Arrow); + GUI.CursorTimer = 60; + } + Settings.Paused = false; + } + + RestoreSNESDisplay (); + GUI.ScreenCleared = true; + } + break; + + case ID_FILE_EXIT: + S9xSetPause (PAUSE_EXIT); +#ifdef USE_GLIDE + S9xGlideEnable (FALSE); +#endif + PostMessage (hWnd, WM_DESTROY, 0, 0); + break; + + case ID_WINDOW_HIDEMENUBAR: + if( GetMenu( GUI.hWnd) == NULL) + SetMenu( GUI.hWnd, GUI.hMenu); + else + SetMenu( GUI.hWnd, NULL); + GUI.ScreenCleared = true; + break; + + case ID_LANGUAGE_ENGLISH: + GUI.Language = 0; + + SetMenu( GUI.hWnd, LoadMenu( GUI.hInstance, MAKEINTRESOURCE( Languages[ GUI.Language].idMenu))); + DestroyMenu( GUI.hMenu); + GUI.hMenu = GetMenu( GUI.hWnd); + break; + case ID_LANGUAGE_NEDERLANDS: + GUI.Language = 1; + + SetMenu( GUI.hWnd, LoadMenu( GUI.hInstance, MAKEINTRESOURCE( Languages[ GUI.Language].idMenu))); + DestroyMenu( GUI.hMenu); + GUI.hMenu = GetMenu( GUI.hWnd); + break; +#ifdef NETPLAY_SUPPORT + case ID_NETPLAY_SERVER: + S9xRestoreWindowTitle (); + EnableServer (!Settings.NetPlayServer); + break; + case ID_NETPLAY_CONNECT: + RestoreGUIDisplay (); + if(1<=DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_NETCONNECT), hWnd, DlgNetConnect,(LPARAM)&hostname)) + + { + + + S9xSetPause (PAUSE_NETPLAY_CONNECT); + + if (!S9xNPConnectToServer (hostname, Settings.Port, + Memory.ROMName)) + { + S9xClearPause (PAUSE_NETPLAY_CONNECT); + } + } + + RestoreSNESDisplay (); + break; + case ID_NETPLAY_DISCONNECT: + if (Settings.NetPlay) + { + Settings.NetPlay = FALSE; + S9xNPDisconnect (); + } + if (Settings.NetPlayServer) + { + Settings.NetPlayServer = FALSE; + S9xNPStopServer (); + } + break; + case ID_NETPLAY_OPTIONS: + { + bool8 old_netplay_server = Settings.NetPlayServer; + RestoreGUIDisplay (); + if(1<=DialogBox(g_hInst, MAKEINTRESOURCE(IDD_NPOPTIONS), hWnd, DlgNPOptions)) + { + if (old_netplay_server != Settings.NetPlayServer) + { + Settings.NetPlayServer = old_netplay_server; + S9xRestoreWindowTitle (); + EnableServer (!Settings.NetPlayServer); + } + } + RestoreSNESDisplay (); + break; + } + case ID_NETPLAY_SYNC: + S9xNPServerQueueSyncAll (); + break; + case ID_NETPLAY_ROM: + if (NPServer.SyncByReset) + { + if (MessageBox (GUI.hWnd, TEXT(WINPROC_NET_RESTART), TEXT(SNES9X_WARN), + MB_OKCANCEL | MB_ICONWARNING) == IDCANCEL) + break; + } + S9xNPServerQueueSendingROMImage (); + break; + case ID_NETPLAY_SEND_ROM_ON_CONNECT: + NPServer.SendROMImageOnConnect ^= TRUE; + break; + case ID_NETPLAY_SYNC_BY_RESET: + NPServer.SyncByReset ^= TRUE; + break; +#endif + case ID_SOUND_8000HZ: + case ID_SOUND_11025HZ: + case ID_SOUND_16000HZ: + case ID_SOUND_22050HZ: + case ID_SOUND_30000HZ: + case ID_SOUND_35000HZ: + case ID_SOUND_44100HZ: + case ID_SOUND_48000HZ: + case ID_SOUND_32000HZ: + for( i = 0; i < COUNT(SoundRates); i ++) + if (SoundRates[i].ident == (int) wParam) + { + Settings.SoundPlaybackRate = SoundRates [i].rate; + if (!SetupSound (Settings.SoundPlaybackRate, + Settings.SixteenBitSound, + Settings.Stereo)) + { MessageBox( GUI.hWnd, Languages[ GUI.Language].errInitDS, TEXT(SNES9X_DXS), MB_OK | MB_ICONINFORMATION); } + break; + } + break; + + case ID_SOUND_NOSOUND: + Settings.SoundPlaybackRate = 0; + SetupSound( 0, FALSE, FALSE); + break; + case ID_SOUND_25MS: + Settings.SoundBufferSize = 1; + SetupSound (Settings.SoundPlaybackRate, + Settings.SixteenBitSound, Settings.Stereo); + break; + case ID_SOUND_50MS: + Settings.SoundBufferSize = 2; + SetupSound (Settings.SoundPlaybackRate, + Settings.SixteenBitSound, Settings.Stereo); + break; + case ID_SOUND_100MS: + Settings.SoundBufferSize = 4; + SetupSound (Settings.SoundPlaybackRate, + Settings.SixteenBitSound, Settings.Stereo); + break; + case ID_SOUND_200MS: + Settings.SoundBufferSize = 8; + SetupSound (Settings.SoundPlaybackRate, + Settings.SixteenBitSound, Settings.Stereo); + break; + case ID_SOUND_500MS: + Settings.SoundBufferSize = 16; + SetupSound (Settings.SoundPlaybackRate, + Settings.SixteenBitSound, Settings.Stereo); + break; + case ID_SOUND_1S: + Settings.SoundBufferSize = 32; + SetupSound (Settings.SoundPlaybackRate, + Settings.SixteenBitSound, Settings.Stereo); + break; + case ID_SOUND_2S: + Settings.SoundBufferSize = 64; + SetupSound (Settings.SoundPlaybackRate, + Settings.SixteenBitSound, Settings.Stereo); + break; + + case ID_SOUND_STEREO: + Settings.Stereo = !Settings.Stereo; + SetupSound (Settings.SoundPlaybackRate, + Settings.SixteenBitSound, Settings.Stereo); + break; + case ID_SOUND_REVERSE_STEREO: + Settings.ReverseStereo = !Settings.ReverseStereo; + break; + case ID_SOUND_16BIT: + Settings.SixteenBitSound = !Settings.SixteenBitSound; + SetupSound (Settings.SoundPlaybackRate, + Settings.SixteenBitSound, Settings.Stereo); + break; + case ID_SOUND_INTERPOLATED: + Settings.InterpolatedSound = !Settings.InterpolatedSound; + S9xDisplayStateChange (WINPROC_INTERPOLATED_SND, Settings.InterpolatedSound); + break; + case ID_SOUND_SYNC: + Settings.SoundSync = !Settings.SoundSync; + S9xDisplayStateChange (WINPROC_SYNC_SND, Settings.SoundSync); + break; + case ID_SOUND_OPTIONS: + { + struct SSettings orig = Settings; + RestoreGUIDisplay (); + if(1<=DialogBoxParam(g_hInst,MAKEINTRESOURCE(IDD_SOUND_OPTS),hWnd,DlgSoundConf, (LPARAM)&Settings)) + { + if (orig.NextAPUEnabled != Settings.NextAPUEnabled) + { + if (!Settings.NextAPUEnabled) + { + if (MessageBox (GUI.hWnd, TEXT(WINPROC_SND_OFF), + TEXT(SNES9X_SNDQ), + MB_YESNO | MB_ICONQUESTION) == IDNO) + { + Settings.NextAPUEnabled = orig.NextAPUEnabled; + } + else + { + Settings.APUEnabled = FALSE; + SetupSound (0, FALSE, FALSE); + } + } + else + { + if (!Settings.StopEmulation) + { + MessageBox (GUI.hWnd, TEXT(WINPROC_SND_RESTART), TEXT(SNES9X_SNDQ), + MB_OK | MB_ICONINFORMATION); + } + else + Settings.APUEnabled = Settings.NextAPUEnabled; + } + } + else + if (orig.SixteenBitSound != Settings.SixteenBitSound || + orig.Stereo != Settings.Stereo || + orig.SoundPlaybackRate != Settings.SoundPlaybackRate || + orig.SoundBufferSize != Settings.SoundBufferSize || + orig.SoundDriver != Settings.SoundDriver || + orig.SoundMixInterval != Settings.SoundMixInterval) + { + if (Settings.SoundDriver != WIN_SNES9X_DIRECT_SOUND_DRIVER) + Settings.SoundSync = FALSE; + + SetupSound (Settings.SoundPlaybackRate, + Settings.SixteenBitSound, + Settings.Stereo); + } + } + RestoreSNESDisplay (); + break; + } +#ifdef RTC_DEBUGGER + case IDM_7110_RTC: + { + struct SPC7110RTC origrtc = s7r.rtc; + RestoreGUIDisplay (); + if(1<=DialogBoxParam(g_hInst,MAKEINTRESOURCE(IDD_7110_RTC),hWnd,SPC7110rtc, (LPARAM)&origrtc)) + { + rtc_f9.reg[0x00]=origrtc.reg[0x00]; + rtc_f9.reg[0x01]=origrtc.reg[0x01]; + rtc_f9.reg[0x02]=origrtc.reg[0x02]; + rtc_f9.reg[0x03]=origrtc.reg[0x03]; + rtc_f9.reg[0x04]=origrtc.reg[0x04]; + rtc_f9.reg[0x05]=origrtc.reg[0x05]; + rtc_f9.reg[0x06]=origrtc.reg[0x06]; + rtc_f9.reg[0x07]=origrtc.reg[0x07]; + rtc_f9.reg[0x08]=origrtc.reg[0x08]; + rtc_f9.reg[0x09]=origrtc.reg[0x09]; + rtc_f9.reg[0x0A]=origrtc.reg[0x0A]; + rtc_f9.reg[0x0B]=origrtc.reg[0x0B]; + rtc_f9.reg[0x0C]=origrtc.reg[0x0C]; + + rtc_f9.reg[0x0D]=origrtc.reg[0x0D]; + + rtc_f9.reg[0x0E]=origrtc.reg[0x0E]; + rtc_f9.reg[0x0F]=origrtc.reg[0x0F]; + rtc_f9.last_used=time(NULL); + + } + RestoreSNESDisplay (); + break; + } +#endif + case ID_WINDOW_FULLSCREEN: + ToggleFullScreen (); + break; + case ID_WINDOW_STRETCH: { + GUI.Stretch = !GUI.Stretch; + RECT rect; + GetClientRect (GUI.hWnd, &rect); + InvalidateRect (GUI.hWnd, &rect, true); + } break; + case ID_WINDOW_ASPECTRATIO: { + Settings.AspectRatio = !Settings.AspectRatio; + RECT rect; + GetClientRect (GUI.hWnd, &rect); + InvalidateRect (GUI.hWnd, &rect, true); + } break; + case ID_WINDOW_VIDMEM: { + GUI.VideoMemory = !GUI.VideoMemory; + RestoreSNESDisplay (); + RECT rect; + GetClientRect (GUI.hWnd, &rect); + InvalidateRect (GUI.hWnd, &rect, true); + } break; + case ID_FILE_SAVE_SPC_DATA: + spc_is_dumping = 1; + // S9xSPCDump (S9xGetFilenameInc (".spc")); + break; + case ID_FILE_SAVE_SRAM_DATA: + Memory.SaveSRAM (S9xGetFilename (".srm")); + break; + case ID_FILE_RESET: +#ifdef NETPLAY_SUPPORT + if (Settings.NetPlayServer) + { + S9xNPReset (); + SetupSound (Settings.SoundPlaybackRate, + Settings.SixteenBitSound, + Settings.Stereo); + } + else + if (!Settings.NetPlay) +#endif + { + S9xMovieStop (TRUE); + S9xSoftReset (); + SetupSound (Settings.SoundPlaybackRate, + Settings.SixteenBitSound, + Settings.Stereo); + } + Settings.Paused = false; + break; + case ID_FILE_PAUSE: + Settings.Paused = !Settings.Paused; + Settings.FrameAdvance = false; + break; + case ID_FILE_LOAD1: + FreezeUnfreeze (0, FALSE); + break; + case ID_FILE_LOAD2: + FreezeUnfreeze (1, FALSE); + break; + case ID_FILE_LOAD3: + FreezeUnfreeze (2, FALSE); + break; + case ID_FILE_LOAD4: + FreezeUnfreeze (3, FALSE); + break; + case ID_FILE_LOAD5: + FreezeUnfreeze (4, FALSE); + break; + case ID_FILE_LOAD6: + FreezeUnfreeze (5, FALSE); + break; + case ID_FILE_LOAD7: + FreezeUnfreeze (6, FALSE); + break; + case ID_FILE_LOAD8: + FreezeUnfreeze (7, FALSE); + break; + case ID_FILE_LOAD9: + FreezeUnfreeze (8, FALSE); + break; + case ID_FILE_SAVE1: + FreezeUnfreeze (0, TRUE); + break; + case ID_FILE_SAVE2: + FreezeUnfreeze (1, TRUE); + break; + case ID_FILE_SAVE3: + FreezeUnfreeze (2, TRUE); + break; + case ID_FILE_SAVE4: + FreezeUnfreeze (3, TRUE); + break; + case ID_FILE_SAVE5: + FreezeUnfreeze (4, TRUE); + break; + case ID_FILE_SAVE6: + FreezeUnfreeze (5, TRUE); + break; + case ID_FILE_SAVE7: + FreezeUnfreeze (6, TRUE); + break; + case ID_FILE_SAVE8: + FreezeUnfreeze (7, TRUE); + break; + case ID_FILE_SAVE9: + FreezeUnfreeze (8, TRUE); + break; + case ID_CHEAT_ENTER: + RestoreGUIDisplay (); + S9xRemoveCheats (); + DialogBox(g_hInst, MAKEINTRESOURCE(IDD_CHEATER), hWnd, DlgCheater); + S9xSaveCheatFile (S9xGetFilename (".cht")); + S9xApplyCheats (); + RestoreSNESDisplay (); + break; + case ID_CHEAT_SEARCH: + RestoreGUIDisplay (); + DialogBox(g_hInst, MAKEINTRESOURCE(IDD_CHEAT_SEARCH), hWnd, DlgCheatSearch); + S9xSaveCheatFile (S9xGetFilename (".cht")); + RestoreSNESDisplay (); + break; + case ID_CHEAT_APPLY: + Settings.ApplyCheats = !Settings.ApplyCheats; + if (!Settings.ApplyCheats) + S9xRemoveCheats (); + else + S9xApplyCheats (); + break; + case ID_OPTIONS_SETTINGS: + RestoreGUIDisplay (); + DialogBox(g_hInst, MAKEINTRESOURCE(IDD_EMU_SETTINGS), hWnd, DlgEmulatorProc); + RestoreSNESDisplay (); + break; + case ID_HELP_ABOUT: + RestoreGUIDisplay (); + DialogBox(g_hInst, MAKEINTRESOURCE(IDD_ABOUT), hWnd, DlgAboutProc); + RestoreSNESDisplay (); + break; +#ifdef DEBUGGER + case ID_DEBUG_TRACE: + { + Trace (); + break; + } + case ID_DEBUG_FRAME_ADVANCE: + CPU.Flags |= FRAME_ADVANCE_FLAG; + ICPU.FrameAdvanceCount = 1; + Settings.Paused = FALSE; + break; +#endif + case IDM_7110_CACHE: + RestoreGUIDisplay (); + DialogBox(g_hInst, MAKEINTRESOURCE(IDD_SPC7110_CACHE), hWnd, DlgSP7PackConfig); + RestoreSNESDisplay (); + break; + case IDM_LOG_7110: + Do7110Logging(); + break; + case IDM_ROM_INFO: + RestoreGUIDisplay (); + DialogBox(g_hInst, MAKEINTRESOURCE(IDD_ROM_INFO), hWnd, DlgInfoProc); + RestoreSNESDisplay (); + break; + default: + if ((wParam & 0xffff) >= 0xFF00) + { + int i = (wParam & 0xffff) - 0xFF00; + int j = 0; + if (GUI.RecentGames) + { + while (GUI.RecentGames [j] && j != i) + j++; + if (i == j) + { +#ifdef NETPLAY_SUPPORT + if (Settings.NetPlay && !Settings.NetPlayServer) + { + S9xMessage (S9X_INFO, S9X_NETPLAY_NOT_SERVER, + WINPROC_DISCONNECT); + break; + } +#endif + if (!Settings.StopEmulation) + { + Memory.SaveSRAM (S9xGetFilename (".srm")); + S9xSaveCheatFile (S9xGetFilename (".cht")); + } + Settings.StopEmulation = !LoadROM (GUI.RecentGames [i]); + if (!Settings.StopEmulation) + { + Memory.LoadSRAM (S9xGetFilename (".srm")); + S9xLoadCheatFile (S9xGetFilename (".cht")); + S9xAddToRecentGames (GUI.RecentGames [i]); + CheckDirectoryIsWritable (S9xGetFilename (".---")); + CheckMenuStates (); +#ifdef NETPLAY_SUPPORT + if (NPServer.SendROMImageOnConnect) + S9xNPServerQueueSendingROMImage (); + else + S9xNPServerQueueSendingLoadROMRequest (Memory.ROMName); +#endif + Settings.Paused = false; + } + } + } + } + break; + } + break; + + case WM_EXITMENULOOP: + UpdateBackBuffer(); + S9xClearPause (PAUSE_MENU); + break; + + case WM_ENTERMENULOOP: + S9xSetPause (PAUSE_MENU); +#ifdef USE_GLIDE + S9xGlideEnable (FALSE); +#endif + CheckMenuStates (); + + SwitchToGDI(); + DrawMenuBar( GUI.hWnd); + break; + + case WM_DESTROY: + Memory.SaveSRAM(S9xGetFilename(".srm")); + if(CleanUp7110) + (*CleanUp7110)(); + PostQuitMessage (0); + return (0); + case WM_PAINT: + { + PAINTSTRUCT paint; + + BeginPaint (GUI.hWnd, &paint); +/* // causes bugs: + AVIFile * curAVI = GUI.AVIOut; + GUI.AVIOut = NULL; + +/// S9xInitUpdate (); + S9xDeinitUpdate (IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight, Settings.SixteenBit); + + GUI.AVIOut = curAVI; +*/ + EndPaint (GUI.hWnd, &paint); + break; + } + case WM_SYSCOMMAND: + { + // Prevent screen saver from starting if not paused + //kode54 says add the ! to fix the screensaver pevention. + if (!(Settings.ForcedPause || Settings.StopEmulation || + (Settings.Paused && !Settings.FrameAdvance)) && + (wParam == SC_SCREENSAVE || wParam == SC_MONITORPOWER)) + return (0); + break; + } + case WM_ACTIVATE: + if (LOWORD(wParam) == WA_INACTIVE) + { +#ifdef USE_GLIDE + if (VOODOO_MODE) + { + S9xGlideEnable (FALSE); +#if 0 + MoveWindow (GUI.hWnd, GUI.window_size.left, + GUI.window_size.top, + GUI.window_size.right - GUI.window_size.left, + GUI.window_size.bottom - GUI.window_size.top, + TRUE); +#endif + } +#endif +//#ifndef NOPAUSE + if(GUI.InactivePause) + { + S9xSetPause (PAUSE_INACTIVE_WINDOW); + } +//#endif + } + else + { +//#ifndef NOPAUSE +/// if(GUI.InactivePause) + { + S9xClearPause (PAUSE_INACTIVE_WINDOW); + } +//#endif + IPPU.ColorsChanged = TRUE; + } + break; + case WM_QUERYNEWPALETTE: + // if (!GUI.FullScreen && GUI.ScreenDepth == 8) + // RealizePalette (GUI.WindowDC); + break; + case WM_SIZE: + if (wParam == SIZE_RESTORED) + { +//#ifndef NOPAUSE + if(GUI.InactivePause) + { + S9xClearPause (PAUSE_WINDOW_ICONISED); + } +//#endif + } + if (wParam == SIZE_MINIMIZED || wParam == SIZE_MAXHIDE) + { +#ifdef USE_GLIDE + S9xGlideEnable (FALSE); +#endif +//#ifndef NOPAUSE +/// if(GUI.InactivePause) + { + S9xClearPause (PAUSE_WINDOW_ICONISED); + } +//#endif + } +#ifdef USE_DIRECTX3D + D3DSizeChange (GUI.hWnd, wParam); +#endif + break; + case WM_MOVE: + if (!VOODOO_MODE && !GUI.FullScreen && !Settings.ForcedPause) + { + GetWindowRect (GUI.hWnd, &GUI.window_size); + } +#ifdef USE_DIRECTX3D + D3DMove (GUI.hWnd, lParam); +#endif + + break; + case WM_DISPLAYCHANGE: + if (!GUI.FullScreen) + { + if (!VOODOO_MODE && !OPENGL_MODE && + DirectX.SetDisplayMode (GUI.Width, GUI.Height, GUI.Depth, + !GUI.FullScreen, GUI.DoubleBuffered)) + { + S9xGraphicsDeinit(); + S9xSetWinPixelFormat (); + S9xGraphicsInit(); + } + } + break; + case WM_MOUSEMOVE: + // Lo-word of lparam is xpos, hi-word is ypos + if (!GUI.IgnoreNextMouseMove) + { + POINT p; + p.x = (int16) (lParam & 0xffff); + p.y = (int16) ((lParam >> 16) & 0xffff); + ClientToScreen (GUI.hWnd, &p); + if ((!Settings.ForcedPause && !Settings.StopEmulation && + !(Settings.Paused && !Settings.FrameAdvance)) && + (IPPU.Controller == SNES_MOUSE || + IPPU.Controller == SNES_MOUSE_SWAPPED)) + { + POINT middle; + RECT size; + + GetClientRect (GUI.hWnd, &size); + middle.x = (size.right - size.left) >> 1; + middle.y = (size.bottom - size.top) >> 1; + ClientToScreen (GUI.hWnd, &middle); + GUI.MouseX += p.x - middle.x; + GUI.MouseY += p.y - middle.y; + SetCursorPos (middle.x, middle.y); + GUI.IgnoreNextMouseMove = true; + } + else if (IPPU.Controller==SNES_SUPERSCOPE||Settings.Justifier||Settings.SecondJustifier) + { + RECT size; + GetClientRect (GUI.hWnd, &size); + if(!(GUI.Scale)&&!(GUI.Stretch)) + { + int x,y, startx, starty; + x=GET_X_LPARAM(lParam); + y=GET_Y_LPARAM(lParam); + + int theight; + (IPPU.RenderedScreenHeight> 256)? theight= SNES_HEIGHT_EXTENDED<<1: theight = SNES_HEIGHT_EXTENDED; + + startx= size.right-IPPU.RenderedScreenWidth; + startx/=2; + starty= size.bottom-theight; + starty/=2; + + if(x(startx+IPPU.RenderedScreenWidth)) + GUI.MouseX=IPPU.RenderedScreenWidth; + else GUI.MouseX=x-startx; + + if(y(starty+theight)) + GUI.MouseY=theight; + else GUI.MouseY=y-starty; + } + else if(!(GUI.Stretch)&&!VOODOO_MODE && !OPENGL_MODE) + { + int x,y, startx, starty, sizex, sizey; + x=GET_X_LPARAM(lParam); + y=GET_Y_LPARAM(lParam); + + if (IPPU.RenderedScreenWidth>256) + sizex=IPPU.RenderedScreenWidth; + else sizex=IPPU.RenderedScreenWidth*2; + + if (IPPU.RenderedScreenHeight>256) + sizey=SNES_HEIGHT_EXTENDED; + else sizey=SNES_HEIGHT_EXTENDED*2; + + + startx= size.right-sizex; + startx/=2; + starty= size.bottom-sizey; + starty/=2; + if(x(startx+sizex)) + GUI.MouseX=sizex; + else GUI.MouseX=x-startx; + + if(y(starty+sizey)) + GUI.MouseY=sizey; + else GUI.MouseY=y-starty; + + GUI.MouseX=(GUI.MouseX*IPPU.RenderedScreenWidth)/sizex; + GUI.MouseY=(GUI.MouseY*SNES_HEIGHT_EXTENDED)/sizey; + + } + else + { + int theight; + (IPPU.RenderedScreenHeight> 256)? theight= SNES_HEIGHT_EXTENDED<<1: theight = SNES_HEIGHT_EXTENDED; + GUI.MouseX=GET_X_LPARAM(lParam)*IPPU.RenderedScreenWidth/size.right; + GUI.MouseY=GET_Y_LPARAM(lParam)*theight/size.bottom; + } + } + else + { + GUI.MouseX = p.x; + GUI.MouseY = p.y; + } + } + else + GUI.IgnoreNextMouseMove = false; + + S9xMouseOn (); + return 0; + case WM_LBUTTONDOWN: + S9xMouseOn (); + GUI.MouseButtons |= 1; + break; + case WM_LBUTTONUP: + S9xMouseOn (); + GUI.MouseButtons &= ~1; + break; + case WM_RBUTTONDOWN: + S9xMouseOn (); + GUI.MouseButtons |= 2; + break; + case WM_RBUTTONUP: + S9xMouseOn (); + GUI.MouseButtons &= ~2; + if(Settings.Justifier||Settings.SecondJustifier) + { + RECT size; + GetClientRect (GUI.hWnd, &size); + GUI.MouseButtons&=~1; + GUI.MouseX=(IPPU.RenderedScreenWidth*(lParam & 0xffff))/(size.right-size.left); + GUI.MouseY=(((lParam >> 16) & 0xffff)*IPPU.RenderedScreenHeight)/(size.bottom-size.top); + } + break; + case WM_MBUTTONDOWN: + S9xMouseOn (); + GUI.MouseButtons |= 4; + break; + case WM_MBUTTONUP: + S9xMouseOn (); + GUI.MouseButtons &= ~4; + break; +#ifdef NETPLAY_SUPPORT + case WM_USER + 3: + NetPlay.Answer = S9xLoadROMImage ((const char *) lParam); + SetEvent (NetPlay.ReplyEvent); + break; + case WM_USER + 2: + S9xMessage (0, 0, NetPlay.WarningMsg); + break; + case WM_USER + 1: + RestoreGUIDisplay (); + S9xRestoreWindowTitle (); + MessageBox (GUI.hWnd, NetPlay.ErrorMsg, + TEXT(SNES9X_NP_ERROR), MB_OK | MB_ICONSTOP); + RestoreSNESDisplay (); + break; + case WM_USER: + if (NetPlay.ActionMsg [0] == 0) + S9xRestoreWindowTitle (); + else + { + TCHAR buf [NP_MAX_ACTION_LEN + 10]; + + sprintf (buf, TEXT("%s %3d%%"), NetPlay.ActionMsg, (int) lParam); + SetWindowText (GUI.hWnd, buf); + } +#if 0 + if ((int) lParam >= 0) + { + RestoreGUIDisplay (); + DialogBox(g_hInst, MAKEINTRESOURCE(IDD_NETPLAYPROGRESS), hWnd, DlgNPProgress); + } + else + { + DialogBox(g_hInst, MAKEINTRESOURCE(IDD_NETPLAYPROGRESS), hWnd, DlgNPProgress); + RestoreSNESDisplay (); + } +#endif + break; +#endif + } + return DefWindowProc (hWnd, uMsg, wParam, lParam); +} + +/*****************************************************************************/ +/* WinInit */ +/*****************************************************************************/ +BOOL WinInit( HINSTANCE hInstance) +{ + WNDCLASS wndclass; + + wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; + wndclass.lpfnWndProc = WinProc; + wndclass.cbClsExtra = 0; + wndclass.cbWndExtra = 0; + wndclass.hInstance = hInstance; + wndclass.hIcon = LoadIcon (NULL, TEXT("IDI_ICON1")); + wndclass.hCursor = NULL; //LoadCursor (NULL, IDC_ARROW); + wndclass.hbrBackground = (HBRUSH)GetStockObject (BLACK_BRUSH); + wndclass.lpszMenuName = NULL; + wndclass.lpszClassName = TEXT("Snes9X: WndClass"); + + GUI.hInstance = hInstance; + + if (!RegisterClass (&wndclass)) + return FALSE; + + if ((GUI.hMenu = LoadMenu (hInstance, MAKEINTRESOURCE( Languages[ GUI.Language].idMenu))) == NULL) + return FALSE; + + TCHAR buf [100]; + sprintf (buf, TEXT(WINDOW_TITLE), VERSION); + + DWORD dwExStyle; + DWORD dwStyle; + RECT rect; + + rect.left = rect.top = 0; + rect.right = MAX_SNES_WIDTH; + rect.bottom = MAX_SNES_HEIGHT; + dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE; + dwStyle = WS_OVERLAPPEDWINDOW; + + AdjustWindowRectEx (&rect, dwStyle, FALSE, dwExStyle); + if ((GUI.hWnd = CreateWindowEx ( + dwExStyle, + TEXT("Snes9X: WndClass"), + buf, + WS_CLIPSIBLINGS | + WS_CLIPCHILDREN | + dwStyle, + 0, 0, + rect.right - rect.left, rect.bottom - rect.top, + NULL, + GUI.hMenu, + hInstance, + NULL)) == NULL) + return FALSE; + + GUI.hDC = GetDC (GUI.hWnd); + LoadExts(); + GUI.GunSight = LoadCursor (hInstance, MAKEINTRESOURCE (IDC_CURSOR_SCOPE)); + GUI.Arrow = LoadCursor (NULL, IDC_ARROW); + GUI.Accelerators = LoadAccelerators (hInstance, MAKEINTRESOURCE (IDR_SNES9X_ACCELERATORS)); + Settings.ForcedPause = 0; + Settings.StopEmulation = TRUE; + Settings.Paused = FALSE; + + GUI.AVIOut = NULL; + + return TRUE; +} + +static inline char *SkipSpaces (char *p) +{ + while (*p && isspace (*p)) + p++; + + return (p); +} + +void WinParseCommandLine (char *line) +{ + // Break the command line up into an array of string pointers, each pointer + // points at a separate word or character sequence enclosed in quotes. + +#define MAX_PARAMETERS 100 + char *p = line; + static char *parameters [MAX_PARAMETERS]; + int count = 0; + + parameters [count++] = "Snes9XW"; + + while (count < MAX_PARAMETERS && *p) + { + p = SkipSpaces (p); + if (*p == '"') + { + p++; + parameters [count++] = p; + while (*p && *p != '"') + p++; + *p++ = 0; + } + else + if (*p == '\'') + { + p++; + parameters [count++] = p; + while (*p && *p != '\'') + p++; + *p++ = 0; + } + else + { + parameters [count++] = p; + while (*p && !isspace (*p)) + p++; + if (!*p) + break; + *p++ = 0; + } + } + rom_filename = S9xParseArgs (parameters, count); +} + +void S9xParseArg (char **argv, int &i, int argc) +{ + if (strcasecmp (argv [i], "-restore") == 0) + { + WinDeleteRegistryEntries (); + WinSetDefaultValues (); + } + if (strcasecmp (argv[i], "-hidemenu") == 0) + { + GUI.HideMenu = true; + } +} + +void S9xExtraUsage () +{ +} + +/*****************************************************************************/ +/* WinSave/WinLoad - Save/Load the settings to/from the registry */ +/*****************************************************************************/ +#define SetKey( n, v)\ +RegSetValueEx( hKey, TEXT(n), 0, REG_BINARY, (const unsigned char *) &v, sizeof( v)); +#define GetKey( n, v)\ + cbData = sizeof( v);\ +RegQueryValueEx( hKey, TEXT(n), 0, NULL, (unsigned char *) &v, &cbData); +#define GetKeyDef( n, v, d)\ + cbData = sizeof( v);\ + if( RegQueryValueEx( hKey, TEXT(n), 0, NULL, (unsigned char *) &v, &cbData) != ERROR_SUCCESS)\ +v = d; + +void WinDeleteRegKey (HKEY hKeyRoot, const TCHAR *key) +{ + FILETIME last_update; + DWORD count; + HKEY hKey; + TCHAR name_buf [100]; + TCHAR class_buf [200]; + DWORD name_len; + DWORD class_len; + + if (RegOpenKeyEx (hKeyRoot, key, 0, KEY_READ | KEY_WRITE, &hKey) == ERROR_SUCCESS) + { + bool8 found = TRUE; + + count = 0; + RegQueryInfoKey (hKey, NULL, NULL, NULL, &count, + NULL, NULL, NULL, NULL, NULL, NULL, NULL); + + for (; found && count != 0; count--) + { + name_len = sizeof (name_buf); + class_len = sizeof (class_buf); + if (RegEnumKeyEx (hKey, count - 1, name_buf, &name_len, NULL, + class_buf, &class_len, &last_update) == ERROR_SUCCESS) + { + found = TRUE; + WinDeleteRegKey (hKey, name_buf); + RegDeleteKey (hKey, name_buf); + } + else + found = FALSE; + } + } +} + +static void WinDeleteRegistryEntries () +{ + WinDeleteRegKey (HKEY_CURRENT_USER, S9X_REG_KEY_BASE); +} + +void WinSave( void) +{ + HKEY hKey; + TCHAR tmp [100]; + + if (RegCreateKeyEx (HKEY_CURRENT_USER, + S9X_REG_KEY_BASE TEXT("\\") S9X_REG_KEY_VERSION, 0, NULL, + REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, + NULL) == ERROR_SUCCESS) + { + SetKey( "Language", GUI.Language); + SetKey( "Playback Rate", Settings.SoundPlaybackRate); + SetKey( "Stereo Sound", Settings.Stereo); + SetKey( "16bit Sound", Settings.SixteenBitSound); + SetKey( "Interpolated Sound", Settings.InterpolatedSound); + SetKey( "Sync Sound", Settings.SoundSync); + SetKey( "Fake Mute Desync Workaround", Settings.FakeMuteFix); + SetKey( "Sound Envelope Height Reading", Settings.SoundEnvelopeHeightReading); + SetKey( "Reverse Stereo", Settings.ReverseStereo); + SetKey( "Disable Echo", Settings.DisableSoundEcho); + SetKey( "Disable Sample Caching", Settings.DisableSampleCaching); + SetKey( "Disable Master Volume", Settings.DisableMasterVolume); + SetKey( "Mute Sound", Settings.Mute); + SetKey( "Frame Advance Mute", Settings.FAMute); + SetKey( "Alt Sample Code Method", Settings.AltSampleDecode); + SetKey( "Enable SPC700", Settings.NextAPUEnabled); + SetKey( "Sound CPU Skip Method", Settings.SoundSkipMethod); + SetKey( "Paused Frames Before Muting Sound", GUI.PausedFramesBeforeMutingSound); + SetKey( "Sound Buffer Length", Settings.SoundBufferSize); + SetKey( "Sound Mix Interval", Settings.SoundMixInterval); + SetKey( "Sound Driver", Settings.SoundDriver); + SetKey( "Use WIP APU Timing", Settings.UseWIPAPUTiming); + + SetKey( "Width", GUI.Width); + SetKey( "Height", GUI.Height); + SetKey( "Depth", GUI.Depth); + SetKey( "Scale", GUI.NextScale); + SetKey( "DoubleBuffered", GUI.DoubleBuffered); + SetKey( "Show FPS", Settings.DisplayFrameRate); + + SetKey( "Render SixteenBit", Settings.SixteenBit); + SetKey( "Enable Transparency", Settings.Transparency); + SetKey( "Support HiRes", Settings.SupportHiRes); + SetKey( "Extend Height", Settings.HeightExtend); + SetKey( "Skip Frames", Settings.SkipFrames); + SetKey( "Turbo Skip Frames", Settings.TurboSkipFrames); + SetKey( "Turbo Mode Toggle", GUI.TurboModeToggle); + SetKey( "Pause When Inactive", GUI.InactivePause); + SetKey( "Auto Max Skip Frames", Settings.AutoMaxSkipFrames); + + SetKey( "Joypad #1", Joypad[0]); + SetKey( "Joypad #2", Joypad[1]); + SetKey( "Joypad #3", Joypad[2]); + SetKey( "Joypad #4", Joypad[3]); + SetKey( "Joypad #5", Joypad[4]); + SetKey( "Joypad #1 Turbo", Joypad[5]); + SetKey( "Joypad #2 Turbo", Joypad[6]); + SetKey( "Joypad #3 Turbo", Joypad[7]); + SetKey( "Joypad #4 Turbo", Joypad[8]); + SetKey( "Joypad #5 Turbo", Joypad[9]); + SetKey( "Hotkeys", CustomKeys); + + SetKey( "Disallow Left+Right/Up+Down", Settings.DisallowLeftRight); + SetKey( "Display Pressed Keys", Settings.DisplayPressedKeys); + + SetKey( "Window Geometry", GUI.window_size); + SetKey( "Stretch", GUI.Stretch); + SetKey( "Aspect Ratio", Settings.AspectRatio); + SetKey( "Fullscreen", GUI.FullScreen); + RegSetValueEx (hKey, TEXT("Freeze File Directory"), 0, REG_SZ, + (const unsigned char *) GUI.FreezeFileDir, + strlen (GUI.FreezeFileDir) + 1); + SetKey( "Apply Cheats", Settings.ApplyCheats); + SetKey( "Auto Save Delay", Settings.AutoSaveDelay); +#ifdef NETPLAY_SUPPORT + SetKey( "NetPlay Port", Settings.Port); + SetKey( "NetPlay Sync By Reset", NPServer.SyncByReset); + SetKey( "NetPlay Send ROM On Connect", NPServer.SendROMImageOnConnect); + SetKey( "NetPlay Max Frame Skip", NetPlay.MaxFrameSkip); + SetKey( "NetPlay Max Behind Frame Count", NetPlay.MaxBehindFrameCount); +#endif + SetKey( "Bi-Linear Filter Mode7", Settings.Mode7Interpolate); + SetKey( "Use Hardware Video Memory", GUI.VideoMemory); + SetKey( "Current Save Slot", Settings.CurrentSaveSlot); + + RegSetValueEx (hKey, TEXT("StarOcean"), 0, REG_SZ, + (const unsigned char *) GUI.StarOceanPack, + strlen (GUI.StarOceanPack) + 1); + RegSetValueEx (hKey, TEXT("FarEast"), 0, REG_SZ, + (const unsigned char *) GUI.FEOEZPack, + strlen (GUI.FEOEZPack) + 1); + RegSetValueEx (hKey, TEXT("ShounenJump"), 0, REG_SZ, + (const unsigned char *) GUI.SJNSPack, + strlen (GUI.SJNSPack) + 1); + RegSetValueEx (hKey, TEXT("SFA2PAL"), 0, REG_SZ, + (const unsigned char *) GUI.SFA2PALPack, + strlen (GUI.SFA2PALPack) + 1); + RegSetValueEx (hKey, TEXT("SFA2NTSC"), 0, REG_SZ, + (const unsigned char *) GUI.SFA2NTSCPack, + strlen (GUI.SFA2NTSCPack) + 1); + RegSetValueEx (hKey, TEXT("SPL4"), 0, REG_SZ, + (const unsigned char *) GUI.SPL4Pack, + strlen (GUI.SPL4Pack) + 1); + RegSetValueEx (hKey, TEXT("Momotarou"), 0, REG_SZ, + (const unsigned char *) GUI.MDHPack, + strlen (GUI.MDHPack) + 1); + RegSetValueEx (hKey, TEXT("SFZ2"), 0, REG_SZ, + (const unsigned char *) GUI.SFZ2Pack, + strlen (GUI.SFZ2Pack) + 1); + + DWORD mk_temp; + if(LoadUp7110==&SPC7110Open) + mk_temp=1; + else if(LoadUp7110==&SPC7110Grab) + mk_temp=2; + else mk_temp=0; + SetKey( "SPC7110 Cache", mk_temp); + + SetKey ( "SPC7110 Size", cacheMegs); + + if (GUI.RecentGames) + { + int i = 0; + + while (GUI.RecentGames [i]) + { + sprintf (tmp, TEXT("Recent Game #%d"), i + 1); + RegSetValueEx (hKey, tmp, 0, REG_SZ, + (const unsigned char *) GUI.RecentGames [i], + strlen (GUI.RecentGames [i]) + 1); + i++; + } + } + RegCloseKey( hKey); + } +} + +static void WinSetDefaultValues () +{ + HKEY hKey; + char temp[4]; + strcpy(temp,"C:\\"); + if (RegCreateKeyEx (HKEY_CURRENT_USER, + S9X_REG_KEY_BASE TEXT("\\") S9X_REG_KEY_VERSION, 0, NULL, + REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, + NULL) == ERROR_SUCCESS) + RegCloseKey(hKey); + if(RegOpenKeyEx(HKEY_CURRENT_USER, MY_REG_KEY, 0, KEY_ALL_ACCESS, &hKey)==ERROR_SUCCESS) + { + if(RegQueryValueEx(hKey,TEXT("Last Directory"),NULL,NULL,NULL,NULL)!=ERROR_SUCCESS) + { + RegSetValueEx(hKey,TEXT("Last Directory"),0,REG_SZ,(uint8*)temp,strlen(temp)+1); + } + RegCloseKey(hKey); + } + else + + + + GUI.IgnoreNextMouseMove = false; + GUI.window_size.left = 0; + GUI.window_size.right = 264 + SNES_WIDTH; + GUI.window_size.top = 0; + GUI.window_size.bottom = 285 + SNES_HEIGHT_EXTENDED; + GUI.Width = 640; + GUI.Height = 480; + GUI.Depth = 16; + GUI.Scale = 0; + GUI.NextScale = 0; + GUI.DoubleBuffered = false; + GUI.FullScreen = false; + GUI.Stretch = false; + GUI.PausedFramesBeforeMutingSound = 20; + GUI.FlipCounter = 0; + GUI.NumFlipFrames = 1; + GUI.VideoMemory = false; + + WinDeleteRecentGamesList (); + + // ROM Options + memset (&Settings, 0, sizeof (Settings)); + + Settings.ForceLoROM = false; + Settings.ForceInterleaved = false; + + Settings.ForceNotInterleaved = false; + Settings.ForceInterleaved = false; + Settings.ForceInterleaved2 = false; + + Settings.ForcePAL = false; + Settings.ForceNTSC = false; + Settings.ForceHeader = false; + Settings.ForceNoHeader = false; + + // Sound options + Settings.SoundSync = FALSE; + Settings.InterpolatedSound = TRUE; + Settings.SoundEnvelopeHeightReading = TRUE; + Settings.DisableSoundEcho = FALSE; + Settings.DisableMasterVolume = FALSE; + Settings.Mute = FALSE; + Settings.FAMute = FALSE; + Settings.SoundSkipMethod = 0; + Settings.SoundPlaybackRate = 32000; + Settings.SixteenBitSound = TRUE; + Settings.Stereo = TRUE; + Settings.AltSampleDecode = FALSE; + Settings.ReverseStereo = FALSE; + Settings.SoundDriver = WIN_SNES9X_DIRECT_SOUND_DRIVER; + Settings.SoundBufferSize = 4; + Settings.SoundMixInterval = 20; + Settings.DisableSampleCaching=TRUE; + + // Tracing options + Settings.TraceDMA = false; + Settings.TraceHDMA = false; + Settings.TraceVRAM = false; + Settings.TraceUnknownRegisters = false; + Settings.TraceDSP = false; + + // Joystick options + Settings.SwapJoypads = false; + Settings.JoystickEnabled = false; + + // ROM timing options (see also H_Max above) + Settings.PAL = false; + Settings.FrameTimePAL = 20; + Settings.FrameTimeNTSC = 17; + Settings.FrameTime = 17; + + // CPU options + Settings.CyclesPercentage = 100; + Settings.Shutdown = true; + Settings.ShutdownMaster = true; + Settings.NextAPUEnabled = Settings.APUEnabled = TRUE; + Settings.DisableIRQ = false; + Settings.Paused = false; + Settings.H_Max = SNES_CYCLES_PER_SCANLINE; + Settings.HBlankStart = (256 * Settings.H_Max) / SNES_HCOUNTER_MAX; + Settings.SkipFrames = AUTO_FRAMERATE; + + // ROM image and peripheral options + Settings.ForceSuperFX = false; + Settings.ForceNoSuperFX = false; + Settings.MultiPlayer5 = false; + Settings.Mouse = false; + Settings.SuperScope = false; + Settings.MultiPlayer5Master = false; + Settings.SuperScopeMaster = false; + Settings.MouseMaster = false; + Settings.SuperFX = false; + + // SNES graphics options + Settings.BGLayering = false; + Settings.DisableGraphicWindows = false; + Settings.ForceTransparency = false; + Settings.ForceNoTransparency = false; + Settings.DisableHDMA = false; + Settings.Mode7Interpolate = false; + Settings.HeightExtend = false; + Settings.DisplayFrameRate = false; + Settings.SixteenBit = true; + Settings.Transparency = true; + Settings.SupportHiRes = true; + + Settings.DisplayPressedKeys = false; + Settings.CurrentSaveSlot = 0; + Settings.AutoSaveDelay = 15; + Settings.ApplyCheats = true; + + Settings.TurboMode = false; + Settings.TurboSkipFrames = 15; + GUI.TurboModeToggle = true; + Settings.AutoMaxSkipFrames = 10; + +#ifdef NETPLAY_SUPPORT + Settings.Port = 1996; + NetPlay.MaxFrameSkip = 10; + NetPlay.MaxBehindFrameCount = 10; + NPServer.SyncByReset = true; + NPServer.SendROMImageOnConnect = false; +#endif + + GUI.FreezeFileDir [0] = 0; + Settings.SampleCatchup=false; + Settings.TakeScreenshot=false; + Settings.StretchScreenshots=1; + + +} + +void WinLoad( void) +{ + HKEY hKey; + unsigned long cbData; + TCHAR tmp [100]; + char path [_MAX_PATH + 1]; + + WinSetDefaultValues (); + + if (RegOpenKeyEx (HKEY_CURRENT_USER, + S9X_REG_KEY_BASE TEXT("\\") S9X_REG_KEY_VERSION, + 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + + GetKey( "Language", GUI.Language); + GetKey( "Stereo Sound", Settings.Stereo); + + GetKeyDef( "Width", GUI.Width, 640); + GetKeyDef( "Height", GUI.Height, 480); + GetKeyDef( "Depth", GUI.Depth, 16); + GetKeyDef( "Scale", GUI.Scale, 0); + GUI.NextScale = GUI.Scale; + GetKeyDef( "DoubleBuffered", GUI.DoubleBuffered, false); + GetKeyDef( "Show FPS", Settings.DisplayFrameRate, false); + + GetKeyDef( "Render SixteenBit", Settings.SixteenBit, true); + GetKeyDef( "Enable Transparency", Settings.Transparency, true); + GetKeyDef( "Support HiRes", Settings.SupportHiRes, true); + GetKeyDef( "Extend Height", Settings.HeightExtend, false); + GetKeyDef( "Skip Frames", Settings.SkipFrames, AUTO_FRAMERATE); + GetKeyDef( "Turbo Skip Frames", Settings.TurboSkipFrames, 15); + GetKeyDef( "Turbo Mode Toggle", GUI.TurboModeToggle, FALSE); + GetKeyDef( "Pause When Inactive", GUI.InactivePause, TRUE); + GetKeyDef( "Auto Max Skip Frames", Settings.AutoMaxSkipFrames, 10); + GetKeyDef( "Bi-Linear Filter Mode7", Settings.Mode7Interpolate, false); + + GetKey( "Joypad #1", Joypad[0]); + GetKey( "Joypad #2", Joypad[1]); + GetKey( "Joypad #3", Joypad[2]); + GetKey( "Joypad #4", Joypad[3]); + GetKey( "Joypad #5", Joypad[4]); + GetKey( "Joypad #1 Turbo", Joypad[5]); + GetKey( "Joypad #2 Turbo", Joypad[6]); + GetKey( "Joypad #3 Turbo", Joypad[7]); + GetKey( "Joypad #4 Turbo", Joypad[8]); + GetKey( "Joypad #5 Turbo", Joypad[9]); + GetKey( "Hotkeys", CustomKeys); + + GetKeyDef( "Disallow Left+Right/Up+Down", Settings.DisallowLeftRight, true); + GetKeyDef( "Display Pressed Keys", Settings.DisplayPressedKeys, false); + + GetKey( "Window Geometry", GUI.window_size); + GetKeyDef( "Stretch", GUI.Stretch, false); + GetKeyDef( "Aspect Ratio", Settings.AspectRatio, true); + GetKeyDef( "Fullscreen", GUI.FullScreen, false); + GetKeyDef( "Playback Rate", Settings.SoundPlaybackRate, 22050); + GetKeyDef( "Stereo Sound", Settings.Stereo, true); + GetKeyDef( "16bit Sound", Settings.SixteenBitSound, true); + GetKeyDef( "Interpolated Sound", Settings.InterpolatedSound, true); + GetKeyDef( "Sync Sound", Settings.SoundSync, false); + GetKeyDef( "Fake Mute Desync Workaround", Settings.FakeMuteFix, false); + GetKeyDef( "Sound Envelope Height Reading", Settings.SoundEnvelopeHeightReading, true); + GetKeyDef( "Reverse Stereo", Settings.ReverseStereo, false); + GetKeyDef( "Disable Echo", Settings.DisableSoundEcho, false); + GetKeyDef( "Disable Sample Caching", Settings.DisableSampleCaching, false); + GetKeyDef( "Disable Master Volume", Settings.DisableMasterVolume, false); + GetKeyDef( "Mute Sound", Settings.Mute, false); + GetKeyDef( "Frame Advance Mute", Settings.FAMute, false); + GetKeyDef( "Alt Sample Code Method", Settings.AltSampleDecode, false); + GetKeyDef( "Enable SPC700", Settings.NextAPUEnabled, true); + Settings.APUEnabled = Settings.NextAPUEnabled; + GetKeyDef( "Sound CPU Skip Method", Settings.SoundSkipMethod, 0); + GetKeyDef( "Paused Frames Before Muting Sound", GUI.PausedFramesBeforeMutingSound, 20); + GetKeyDef( "Sound Buffer Length", Settings.SoundBufferSize, 1); + GetKeyDef( "Sound Mix Interval", Settings.SoundMixInterval, 10); + GetKeyDef( "Sound Driver", Settings.SoundDriver, WIN_SNES9X_DIRECT_SOUND_DRIVER); + GetKeyDef( "Use WIP APU Timing", Settings.UseWIPAPUTiming, false); + GetKeyDef( "Auto Save Delay", Settings.AutoSaveDelay, 30); + GetKeyDef( "Apply Cheats", Settings.ApplyCheats, true); +#ifdef NETPLAY_SUPPORT + GetKeyDef( "NetPlay Port", Settings.Port, 1996); + GetKeyDef( "NetPlay Sync By Reset", NPServer.SyncByReset, true); + GetKeyDef( "NetPlay Send ROM On Connect", NPServer.SendROMImageOnConnect, false); + GetKeyDef( "NetPlay Max Frame Skip", NetPlay.MaxFrameSkip, 10); + GetKeyDef( "NetPlay Max Behind Frame Count", NetPlay.MaxBehindFrameCount, 10); +#endif + GetKeyDef( "Use Hardware Video Memory", GUI.VideoMemory, true); + GetKeyDef( "Current Save Slot", Settings.CurrentSaveSlot, 0); + cbData = _MAX_PATH + 1; + RegQueryValueEx (hKey, TEXT("Freeze File Directory"), 0, NULL, + (unsigned char *) GUI.FreezeFileDir, &cbData); + + cbData = _MAX_PATH + 1; + RegQueryValueEx (hKey, TEXT("StarOcean"), 0, NULL, + (unsigned char *) GUI.StarOceanPack, &cbData); + cbData = _MAX_PATH + 1; + RegQueryValueEx (hKey, TEXT("FarEast"), 0, NULL, + (unsigned char *) GUI.FEOEZPack, &cbData); + cbData = _MAX_PATH + 1; + RegQueryValueEx (hKey, TEXT("SFA2NTSC"), 0, NULL, + (unsigned char *) GUI.SFA2NTSCPack, &cbData); + cbData = _MAX_PATH + 1; + RegQueryValueEx (hKey, TEXT("SFA2PAL"), 0, NULL, + (unsigned char *) GUI.SFA2PALPack, &cbData); + cbData = _MAX_PATH + 1; + RegQueryValueEx (hKey, TEXT("Momotarou"), 0, NULL, + (unsigned char *) GUI.MDHPack, &cbData); + cbData = _MAX_PATH + 1; + RegQueryValueEx (hKey, TEXT("SFZ2"), 0, NULL, + (unsigned char *) GUI.SFZ2Pack, &cbData); + cbData = _MAX_PATH + 1; + RegQueryValueEx (hKey, TEXT("ShounenJump"), 0, NULL, + (unsigned char *) GUI.SJNSPack, &cbData); + cbData = _MAX_PATH + 1; + RegQueryValueEx (hKey, TEXT("SPL4"), 0, NULL, + (unsigned char *) GUI.SPL4Pack, &cbData); + + + DWORD mk_temp; + GetKeyDef( "SPC7110 Cache", mk_temp, 0); + switch(mk_temp) + { + case 2: + LoadUp7110=&SPC7110Grab; + break; + case 1: + LoadUp7110=&SPC7110Open; + break; + case 0: + default:LoadUp7110=&SPC7110Load;break; + } + GetKeyDef ( "SPC7110 Size", cacheMegs, 5); + // Count how many recent games filenames are saved in the registry + int i = -1; + do + { + i++; + sprintf (tmp, TEXT("Recent Game #%d"), i + 1); + cbData = _MAX_PATH + 1; + } while (RegQueryValueEx (hKey, tmp, 0, NULL, + (unsigned char *) path, &cbData) == ERROR_SUCCESS); + if (i > 0) + { + // Now populate the RecentGames array. + GUI.RecentGames = new char *[i + 1]; + GUI.RecentGames [i] = NULL; + for (int j = 0; j < i; j++) + { + sprintf (tmp, TEXT("Recent Game #%d"), j + 1); + cbData = _MAX_PATH + 1; + RegQueryValueEx (hKey, tmp, 0, NULL, + (unsigned char *) path, &cbData); + GUI.RecentGames [j] = strdup (path); + } + } + RegCloseKey( hKey); + } + + + + + GUI.ScreenCleared = true; +} + +extern long _rate; +extern bool _sixteen_bit; +extern bool _stereo; +extern long _buffernos; +extern long _buffersize; +extern long _samplecount; +extern long _bytecount; +extern unsigned long _interval; + +volatile unsigned long LastSound = 0; +uint32 next_frame_time = 0; + +VOID CALLBACK SoundTimer (UINT idEvent, UINT uMsg, DWORD dwUser, + DWORD dw1, DWORD dw2) +{ + void ProcessSound (void); + + if (Settings.SoundDriver == WIN_SNES9X_DIRECT_SOUND_DRIVER) + ProcessSound (); +} + +VOID CALLBACK FrameTimer( UINT idEvent, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2) +{ + // if (DirectX.FrameCount == DirectX.LastFrameCount) + // DirectX.IdleCount++; + // else + QueryPerformanceCounter((LARGE_INTEGER*)&PCEnd); + while ((PCEnd - PCStart) >= PCFrameTime) + { + // DirectX.IdleCount = 0; + // DirectX.LastFrameCount = DirectX.FrameCount; + // } + if (DirectX.FrameCount == DirectX.LastFrameCount) + DirectX.IdleCount++; + else + { + DirectX.IdleCount = 0; + DirectX.LastFrameCount = DirectX.FrameCount; + } + +#ifdef NETPLAY_SUPPORT + // if (Settings.NetPlay && !Settings.NetPlayServer) + // return; + if (Settings.NetPlay && !Settings.NetPlayServer) + return; +#endif + +#ifdef NETPLAY_SUPPORT + //- if (Settings.NetPlayServer) + //- { + //- if (Settings.Paused || Settings.StopEmulation || Settings.ForcedPause) + if (Settings.NetPlayServer) + { + //- WaitForSingleObject (GUI.ServerTimerSemaphore, 0); + if ((Settings.Paused && !Settings.FrameAdvance) || Settings.StopEmulation || Settings.ForcedPause) + { + WaitForSingleObject (GUI.ServerTimerSemaphore, 0); + return; + } + ReleaseSemaphore (GUI.ServerTimerSemaphore, 1, NULL); + + if (Settings.NetPlay) + return; + } + else +#endif + if (Settings.SkipFrames != AUTO_FRAMERATE || Settings.TurboMode || + (Settings.Paused && !Settings.FrameAdvance) || Settings.StopEmulation || Settings.ForcedPause) + { + WaitForSingleObject (GUI.FrameTimerSemaphore, 0); + PCStart = PCEnd; + return; + } + // ReleaseSemaphore (GUI.ServerTimerSemaphore, 1, NULL); + ReleaseSemaphore (GUI.FrameTimerSemaphore, 1, NULL); + + // if (Settings.NetPlay) + // return; + // } + // else + //#endif + // if (Settings.SkipFrames != AUTO_FRAMERATE || Settings.TurboMode || + // Settings.Paused || Settings.StopEmulation || Settings.ForcedPause) + // { + // WaitForSingleObject (GUI.FrameTimerSemaphore, 0); + // return; + // } + // ReleaseSemaphore (GUI.FrameTimerSemaphore, 1, NULL); + PCStart += PCFrameTime; + } +} + +/*****************************************************************************/ +/* WinMain */ +/*****************************************************************************/ +extern "C" void S9xMainLoop(void); +int Init3d (HWND); +extern "C" void DeinitS9x(void); +int WINAPI WinMain( + HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPSTR lpCmdLine, + int nCmdShow) +{ + DWORD wSoundTimerRes; + + GUI.RecentGames = NULL; + WinLoad(); + WinParseCommandLine (lpCmdLine); + + WinInit (hInstance); + if(GUI.HideMenu) + { + SetMenu (GUI.hWnd, NULL); + } + // GUI.hWnd = _MainWindow (); + // SetMenu (GUI.hWnd, GUI.hMenu); + //_InitDLL (GUI.hWnd); + +/* if (_GUIVersion () != GUI_VERSION) + { + MessageBox (GUI.hWnd, "Incorrect version of Snes9XW.dll dynamic-link library file found.\n\nPlease check you extracted both the Snes9XW.exe and Snes9XW.dll\nfiles into the same directory from the Snes9XW distribution\nzip file.", "Snes9X - Incorrect Snes9XW.dll Version", MB_OK | MB_ICONSTOP); + return false; + } +*/ + DirectX.InitDirectSound (); + + if (!SetupSound (Settings.SoundPlaybackRate, Settings.SixteenBitSound, + Settings.Stereo)) + { + MessageBox( GUI.hWnd, Languages[ GUI.Language].errInitDS, TEXT("Snes9X - DirectSound"), MB_OK | MB_ICONINFORMATION); + } + +#ifdef USE_GLIDE + if (VOODOO_MODE) + { + if (!S9xVoodooInitialise ()) + { + GUI.Scale = 0; + GUI.NextScale = 0; + } + else + { + GUI.FullScreen = FALSE; + Settings.SixteenBit = TRUE; + } + } +#endif + +#ifdef USE_OPENGL + if (OPENGL_MODE) + { + if (!S9xOpenGLInit ()) + { + GUI.Scale = 0; + GUI.NextScale = 0; + } + } +#endif + + if (!VOODOO_MODE && !OPENGL_MODE && !DirectX.InitDirectX ()) + { + MessageBox (GUI.hWnd, Languages[ GUI.Language].errInitDD, TEXT("Snes9X - DirectX"), MB_OK | MB_ICONSTOP); + return false; + } + + if (!GUI.FullScreen) + { + MoveWindow (GUI.hWnd, GUI.window_size.left, + GUI.window_size.top, + GUI.window_size.right - GUI.window_size.left, + GUI.window_size.bottom - GUI.window_size.top, TRUE); + } + + if (!VOODOO_MODE && !OPENGL_MODE && + !DirectX.SetDisplayMode (GUI.Width, GUI.Height, GUI.Depth, + !GUI.FullScreen, GUI.DoubleBuffered)) + { + MessageBox( GUI.hWnd, Languages[ GUI.Language].errModeDD, TEXT("Snes9X - DirectDraw(7)"), MB_OK | MB_ICONSTOP); + GUI.FullScreen = FALSE; + if (!DirectX.SetDisplayMode (GUI.Width, GUI.Height, GUI.Depth, + !GUI.FullScreen, GUI.DoubleBuffered)) + return (false); + } + + if (!GUI.FullScreen) + { + RECT rect; + GetClientRect (GUI.hWnd, &rect); + InvalidateRect (GUI.hWnd, &rect, true); + } + + void InitSnes9X( void); + S9xSetRecentGames (); + ShowWindow (GUI.hWnd, SW_SHOWNORMAL); + SetForegroundWindow (GUI.hWnd); + SetFocus (GUI.hWnd); + +#ifdef USE_DIRECTX3D + if (Init3d (GUI.hWnd) != -100) + { + MessageBox (GUI.hWnd, TEXT("InitD3D failed."), TEXT("InitD3D Error"), MB_OK | MB_ICONINFORMATION); + exit (1); + } +#endif + + InitSnes9X (); + + TIMECAPS tc; + if (timeGetDevCaps(&tc, sizeof(TIMECAPS))== TIMERR_NOERROR) + { +#ifdef __MINGW32__ + wSoundTimerRes = min(max(tc.wPeriodMin, 1), tc.wPeriodMax); +#else + wSoundTimerRes = min(max(tc.wPeriodMin, 1), tc.wPeriodMax); +#endif + timeBeginPeriod (wSoundTimerRes); + } + + QueryPerformanceFrequency((LARGE_INTEGER*)&PCBase); + QueryPerformanceCounter((LARGE_INTEGER*)&PCStart); + PCFrameTime = PCFrameTimeNTSC = (__int64)((float)PCBase / 59.948743718592964824120603015098f); + PCFrameTimePAL = PCBase / 50; + + + Settings.StopEmulation = true; + GUI.hFrameTimer = timeSetEvent (20, 0, FrameTimer, 0, TIME_PERIODIC); + GUI.hSoundTimer = timeSetEvent (5, 0, SoundTimer, 0, TIME_PERIODIC); + + GUI.FrameTimerSemaphore = CreateSemaphore (NULL, 0, 10, NULL); + GUI.ServerTimerSemaphore = CreateSemaphore (NULL, 0, 10, NULL); + + if (GUI.hFrameTimer == 0) + { + MessageBox( GUI.hWnd, Languages[ GUI.Language].errFrameTimer, TEXT("Snes9X - Frame Timer"), MB_OK | MB_ICONINFORMATION); + } + + Settings.StopEmulation = !rom_filename || !LoadROM (rom_filename); + + if (!Settings.StopEmulation) + { + Memory.LoadSRAM (S9xGetFilename (".srm")); + S9xLoadCheatFile (S9xGetFilename (".cht")); + CheckDirectoryIsWritable (S9xGetFilename (".---")); + CheckMenuStates (); + } + + if (!Settings.StopEmulation) + { + if (IPPU.Controller == SNES_SUPERSCOPE) + SetCursor (GUI.GunSight); + else + { + SetCursor (GUI.Arrow); + GUI.CursorTimer = 60; + } + } + + MSG msg; + + while (TRUE) + { + // Changed 9/1/2001 + while (Settings.StopEmulation || (Settings.Paused && !Settings.FrameAdvance) || + Settings.ForcedPause || + PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE)) + { + if (!GetMessage (&msg, NULL, 0, 0)) + goto loop_exit; + + if (!TranslateAccelerator (GUI.hWnd, GUI.Accelerators, &msg)) + { + TranslateMessage (&msg); + DispatchMessage (&msg); + } + } + +#ifdef NETPLAY_SUPPORT + if (!Settings.NetPlay || !NetPlay.PendingWait4Sync || + WaitForSingleObject (GUI.ClientSemaphore, 100) != WAIT_TIMEOUT) + { + if (NetPlay.PendingWait4Sync) + { + NetPlay.PendingWait4Sync = FALSE; + NetPlay.FrameCount++; + S9xNPStepJoypadHistory (); + } +#endif + + // the following is a hack to allow frametimes greater than 100ms, + // without affecting the responsiveness of the GUI + BOOL run_loop=false; + do_frame_adjust=false; + if (Settings.TurboMode || Settings.FrameAdvance || Settings.SkipFrames != AUTO_FRAMERATE) + { + run_loop=true; + } + else + { + LONG prev; + BOOL success; + if ((success = ReleaseSemaphore (GUI.FrameTimerSemaphore, 1, &prev)) && + prev == 0) + { + WaitForSingleObject (GUI.FrameTimerSemaphore, 0); + if (WaitForSingleObject (GUI.FrameTimerSemaphore, 100) == WAIT_OBJECT_0) + { + run_loop=true; + } + } + else + { + if (success) + WaitForSingleObject (GUI.FrameTimerSemaphore, 0); + WaitForSingleObject (GUI.FrameTimerSemaphore, 0); + + run_loop=true; + do_frame_adjust=true; + } + } + + + if(Settings.FrameAdvance) + { + if(GFX.InfoStringTimeout > 4) + GFX.InfoStringTimeout = 4; + + Settings.FrameAdvance = false; + } + + if(run_loop) + { + S9xMainLoop(); + DirectX.FrameCount++; + } + +#ifdef NETPLAY_SUPPORT + } +#endif + if (CPU.Flags & DEBUG_MODE_FLAG) + { + Settings.Paused = TRUE; + Settings.FrameAdvance = false; + CPU.Flags &= ~DEBUG_MODE_FLAG; + } + if (GUI.CursorTimer) + { + if (--GUI.CursorTimer == 0) + { + if (IPPU.Controller != SNES_SUPERSCOPE) + SetCursor (NULL); + } + } + } + +loop_exit: +#ifdef USE_GLIDE + S9xGlideEnable (FALSE); +#endif + + if (GUI.hSoundTimer) + timeKillEvent (GUI.hSoundTimer); + + if( GUI.hFrameTimer) + { + timeKillEvent (GUI.hFrameTimer); + timeEndPeriod (wSoundTimerRes); + } + + if (!Settings.StopEmulation) + { + Memory.SaveSRAM (S9xGetFilename (".srm")); + S9xSaveCheatFile (S9xGetFilename (".cht")); + } + if (!VOODOO_MODE && !GUI.FullScreen) + GetWindowRect (GUI.hWnd, &GUI.window_size); + +#ifdef USE_OPENGL + if (OPENGL_MODE) + S9xOpenGLDeinit (); +#endif + + // this goes here, because the avi + // recording might have messed with + // the auto frame skip setting + // (it needs to come before WinSave) + DoAVIClose(0); + + WinSave (); + Memory.Deinit(); +#ifdef USE_GLIDE + if(Settings.GlideEnable) + S9xGlideDeinit(); + else if (Settings.OpenGLEnable) +#else + if (Settings.OpenGLEnable) +#endif +#ifdef USE_OPENGL + S9xOpenGLDeinit(); +#endif + S9xGraphicsDeinit(); + S9xDeinitAPU(); + WinDeleteRecentGamesList (); + DeinitS9x(); + + //uncomment to find memory leaks. + // _CrtDumpMemoryLeaks(); + return msg.wParam; +} + +void RestoreGUIDisplay () +{ + S9xSetPause (PAUSE_RESTORE_GUI); +#ifdef USE_GLIDE + S9xGlideEnable (FALSE); +#endif + if (!VOODOO_MODE && !OPENGL_MODE && GUI.FullScreen && + (GUI.Width < 640 || GUI.Height < 400) && + !DirectX.SetDisplayMode (640, 480, 0, !GUI.FullScreen, false)) + { + MessageBox (GUI.hWnd, Languages[ GUI.Language].errModeDD, TEXT("Snes9X - DirectDraw(1)"), MB_OK | MB_ICONSTOP); + S9xClearPause (PAUSE_RESTORE_GUI); + return; + } + SwitchToGDI(); + S9xClearPause (PAUSE_RESTORE_GUI); +} + +void RestoreSNESDisplay () +{ + if (!VOODOO_MODE && !OPENGL_MODE && + !DirectX.SetDisplayMode (GUI.Width, GUI.Height, GUI.Depth, + !GUI.FullScreen, GUI.DoubleBuffered)) + { + MessageBox (GUI.hWnd, Languages[ GUI.Language].errModeDD, TEXT("Snes9X - DirectDraw(4)"), MB_OK | MB_ICONSTOP); + return; + } +#ifdef USE_GLIDE + if (VOODOO_MODE && Glide.voodoo_present) + { + //S9xGlideEnable (TRUE); + } +#endif + + UpdateBackBuffer(); +} + +void FreezeUnfreeze (int slot, bool8 freeze) +{ + static TCHAR filename [_MAX_PATH + 1]; + TCHAR drive [_MAX_DRIVE + 1]; + TCHAR dir [_MAX_DIR + 1]; + TCHAR fname [_MAX_FNAME + 1]; + TCHAR ext [_MAX_EXT + 1]; + +#ifdef NETPLAY_SUPPORT + if (!freeze && Settings.NetPlay && !Settings.NetPlayServer) + { + S9xMessage (S9X_INFO, S9X_NETPLAY_NOT_SERVER, + "Only the server is allowed to load freeze files."); + return; + } +#endif + + _splitpath (Memory.ROMFilename, drive, dir, fname, ext); + sprintf (ext, TEXT(".%03d"), slot); + if (GUI.FreezeFileDir [0]) + { + strcpy (filename, GUI.FreezeFileDir); + strcat (filename, TEXT("\\")); + strcat (filename, fname); + strcat (filename, ext); + } + else + _makepath (filename, drive, dir, fname, ext); + + if (!freeze && _access (filename, 0) != 0 && slot < 10) + { + static char *digits = "t123456789"; + sprintf (ext, TEXT(".zs%c"), digits [slot]); + if (GUI.FreezeFileDir [0]) + { + strcpy (filename, GUI.FreezeFileDir); + strcat (filename, TEXT("\\")); + strcat (filename, fname); + strcat (filename, ext); + } + else + _makepath (filename, drive, dir, fname, ext); + } + + S9xSetPause (PAUSE_FREEZE_FILE); + + if (freeze) + S9xFreezeGame (filename); + else + { + if (S9xUnfreezeGame (filename)) + { +// S9xMessage (S9X_INFO, S9X_FREEZE_FILE_INFO, S9xBasename (filename)); +#ifdef NETPLAY_SUPPORT + S9xNPServerQueueSendingFreezeFile (filename); +#endif + UpdateBackBuffer(); + } + } + + S9xClearPause (PAUSE_FREEZE_FILE); +} + +void CheckDirectoryIsWritable (const char *filename) +{ + FILE *fs = fopen (filename, "w+"); + + if (fs == NULL) + MessageBox (GUI.hWnd, TEXT("The folder where Snes9X saves emulated save RAM files and\ngame save positions (freeze files) is currently set to a\nread-only folder.\n\nIf you do not change the game save folder, Snes9X will be\nunable to save your progress in this game. Change the folder\nfrom the Settings Dialog available from the Options menu.\n\nThe default the save folder is the same as the ROM image\nfolder, if no value is set.\n"), + TEXT("Snes9X: Unable to save file warning"), + MB_OK | MB_ICONINFORMATION); + else + { + fclose (fs); + remove (filename); + } +} + +static void CheckMenuStates () +{ + MENUITEMINFO mii; + int i; + + ZeroMemory( &mii, sizeof( mii)); + mii.cbSize = sizeof( mii); + mii.fMask = MIIM_STATE; + + mii.fState = GUI.FullScreen ? MFS_CHECKED : MFS_UNCHECKED; + SetMenuItemInfo (GUI.hMenu, ID_WINDOW_FULLSCREEN, FALSE, &mii); + + mii.fState = GUI.Stretch ? MFS_CHECKED : MFS_UNCHECKED; + SetMenuItemInfo (GUI.hMenu, ID_WINDOW_STRETCH, FALSE, &mii); + + mii.fState = GUI.Stretch ? (Settings.AspectRatio ? MFS_CHECKED : MFS_UNCHECKED) : MFS_CHECKED|MFS_DISABLED; + SetMenuItemInfo (GUI.hMenu, ID_WINDOW_ASPECTRATIO, FALSE, &mii); + + mii.fState = GUI.VideoMemory ? MFS_CHECKED : MFS_UNCHECKED; + if(!GUI.Stretch) + mii.fState |= MFS_DISABLED; + SetMenuItemInfo (GUI.hMenu, ID_WINDOW_VIDMEM, FALSE, &mii); + + mii.fState = Settings.Paused ? MFS_CHECKED : MFS_UNCHECKED; + SetMenuItemInfo (GUI.hMenu, ID_FILE_PAUSE, FALSE, &mii); + + mii.fState = MFS_UNCHECKED; + if (Settings.StopEmulation) + mii.fState |= MFS_DISABLED; + SetMenuItemInfo (GUI.hMenu, ID_FILE_SAVE_SPC_DATA, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_SAVE_SRAM_DATA, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_SAVE1, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_SAVE2, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_SAVE3, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_SAVE4, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_SAVE5, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_SAVE6, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_SAVE7, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_SAVE8, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_SAVE9, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_LOAD1, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_LOAD2, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_LOAD3, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_LOAD4, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_LOAD5, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_LOAD6, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_LOAD7, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_LOAD8, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_LOAD9, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_PAUSE, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_RESET, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_CHEAT_ENTER, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_CHEAT_SEARCH, FALSE, &mii); + +#ifdef NETPLAY_SUPPORT + if (Settings.NetPlay && !Settings.NetPlayServer) + mii.fState = MFS_DISABLED; + else + mii.fState = Settings.NetPlayServer ? MFS_CHECKED : MFS_UNCHECKED; + SetMenuItemInfo (GUI.hMenu, ID_NETPLAY_SERVER, FALSE, &mii); + + mii.fState = Settings.NetPlay && !Settings.NetPlayServer ? 0 : MFS_DISABLED; + SetMenuItemInfo (GUI.hMenu, ID_NETPLAY_DISCONNECT, FALSE, &mii); + + mii.fState = Settings.NetPlay || Settings.NetPlayServer ? MFS_DISABLED : 0; + SetMenuItemInfo (GUI.hMenu, ID_NETPLAY_CONNECT, FALSE, &mii); + + mii.fState = NPServer.SendROMImageOnConnect ? MFS_CHECKED : MFS_UNCHECKED; + SetMenuItemInfo (GUI.hMenu, ID_NETPLAY_SEND_ROM_ON_CONNECT, FALSE, &mii); + + mii.fState = NPServer.SyncByReset ? MFS_CHECKED : MFS_UNCHECKED; + SetMenuItemInfo (GUI.hMenu, ID_NETPLAY_SYNC_BY_RESET, FALSE, &mii); + + mii.fState = Settings.NetPlayServer ? 0 : MFS_DISABLED; + SetMenuItemInfo (GUI.hMenu, ID_NETPLAY_SYNC, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_NETPLAY_ROM, FALSE, &mii); +#endif + + mii.fState = Settings.ApplyCheats ? MFS_CHECKED : MFS_UNCHECKED; + if (Settings.StopEmulation) + mii.fState |= MFS_DISABLED; + SetMenuItemInfo( GUI.hMenu, ID_CHEAT_APPLY, FALSE, &mii); + + mii.fState = MFS_UNCHECKED; + SetMenuItemInfo (GUI.hMenu, ID_SOUND_OPTIONS, FALSE, &mii); + + if (!Settings.APUEnabled) + mii.fState |= MFS_DISABLED; + + SetMenuItemInfo (GUI.hMenu, ID_SOUND_NOSOUND, FALSE, &mii); + for (i = 0; i < COUNT(SoundRates); i++) + SetMenuItemInfo (GUI.hMenu, SoundRates[i].ident, FALSE, &mii); + + if (Settings.SoundPlaybackRate == 0) + mii.fState |= MFS_DISABLED; + + SetMenuItemInfo (GUI.hMenu, ID_SOUND_16BIT, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_SOUND_STEREO, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_SOUND_SYNC, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_SOUND_INTERPOLATED, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_SOUND_25MS, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_SOUND_50MS, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_SOUND_100MS, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_SOUND_200MS, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_SOUND_500MS, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_SOUND_1S, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_SOUND_2S, FALSE, &mii); + + if (!Settings.Stereo) + mii.fState |= MFS_DISABLED; + + SetMenuItemInfo (GUI.hMenu, ID_SOUND_REVERSE_STEREO, FALSE, &mii); + + mii.fState = !Settings.APUEnabled ? MFS_CHECKED | MFS_DISABLED : MFS_CHECKED; + + if (!DirectX.DSAvailable || Settings.SoundPlaybackRate == 0 || !Settings.APUEnabled) + SetMenuItemInfo (GUI.hMenu, ID_SOUND_NOSOUND, FALSE, &mii); + else + { + for (i = 0; i < COUNT(SoundRates); i++) + { + if (SoundRates [i].rate == Settings.SoundPlaybackRate) + { + SetMenuItemInfo (GUI.hMenu, SoundRates[i].ident, FALSE, &mii); + break; + } + } + } + if (Settings.SoundPlaybackRate == 0) + mii.fState |= MFS_DISABLED; + + int id; + switch (Settings.SoundBufferSize) + { + case 1: id = ID_SOUND_25MS; break; + case 2: id = ID_SOUND_50MS; break; + default: + case 4: id = ID_SOUND_100MS; break; + case 8: id = ID_SOUND_200MS; break; + case 16: id = ID_SOUND_500MS; break; + case 32: id = ID_SOUND_1S; break; + case 64: id = ID_SOUND_2S; break; + } + SetMenuItemInfo (GUI.hMenu, id, FALSE, &mii); + + if (Settings.SixteenBitSound) + SetMenuItemInfo (GUI.hMenu, ID_SOUND_16BIT, FALSE, &mii); + if (Settings.Stereo) + SetMenuItemInfo (GUI.hMenu, ID_SOUND_STEREO, FALSE, &mii); + if (Settings.InterpolatedSound) + SetMenuItemInfo (GUI.hMenu, ID_SOUND_INTERPOLATED, FALSE,&mii); + if (Settings.SoundSync) + SetMenuItemInfo (GUI.hMenu, ID_SOUND_SYNC, FALSE, &mii); + + if (!Settings.Stereo) + mii.fState |= MFS_DISABLED; + if (Settings.ReverseStereo) + SetMenuItemInfo (GUI.hMenu, ID_SOUND_REVERSE_STEREO, FALSE, &mii); + +#ifndef DEBUGGER + mii.fState = MFS_DISABLED; +#else + mii.fState = MFS_UNCHECKED; +#endif + SetMenuItemInfo (GUI.hMenu, ID_DEBUG_TRACE, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_DEBUG_TRACE_SPC, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_DEBUG_TRACE_SA1, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_DEBUG_TRACE_DSP1, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_DEBUG_FRAME_ADVANCE, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_DEBUG_SNES_STATUS, FALSE, &mii); + + mii.fState = (!Settings.StopEmulation) ? MFS_ENABLED : MFS_DISABLED; + SetMenuItemInfo (GUI.hMenu, ID_FILE_MOVIE_PLAY, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_MOVIE_RECORD, FALSE, &mii); + + mii.fState = (S9xMovieActive () && !Settings.StopEmulation) ? MFS_ENABLED : MFS_DISABLED; + SetMenuItemInfo (GUI.hMenu, ID_FILE_MOVIE_STOP, FALSE, &mii); + + mii.fState = (!Settings.StopEmulation) ? MFS_ENABLED : MFS_DISABLED; + SetMenuItemInfo (GUI.hMenu, ID_FILE_WRITE_AVI, FALSE, &mii); + + mii.fState = (!Settings.StopEmulation && (GUI.AVIOut)) ? MFS_ENABLED : MFS_DISABLED; + SetMenuItemInfo (GUI.hMenu, ID_FILE_STOP_AVI, FALSE, &mii); +} + +static void ResetFrameTimer () +{ + QueryPerformanceCounter((LARGE_INTEGER*)&PCStart); + if (Settings.FrameTime == Settings.FrameTimeNTSC) PCFrameTime = PCFrameTimeNTSC; + else if (Settings.FrameTime == Settings.FrameTimePAL) PCFrameTime = PCFrameTimePAL; + else PCFrameTime = (__int64)((float)(PCBase * Settings.FrameTime) * .001f); + + + if (GUI.hFrameTimer) + timeKillEvent (GUI.hFrameTimer); + + GUI.hFrameTimer = timeSetEvent (Settings.FrameTime, 0, FrameTimer, + 0, TIME_PERIODIC); +} + +bool8 LoadROM (const char *filename) +{ + if (Memory.LoadROM (filename)) + { + S9xMovieStop (TRUE); + S9xStartCheatSearch(&Cheat); + SetupSound (Settings.SoundPlaybackRate, + Settings.SixteenBitSound, + Settings.Stereo); + ResetFrameTimer (); + return (TRUE); + } + return (FALSE); +} + +bool8 S9xLoadROMImage (const TCHAR *string) +{ + RestoreGUIDisplay (); + TCHAR *buf = new TCHAR [200 + strlen (string)]; + sprintf (buf, TEXT("The NetPlay server is requesting you load the following game:\n '%s'"), + string); + + MessageBox (GUI.hWnd, buf, + TEXT(SNES9X_INFO), + MB_OK | MB_ICONINFORMATION); + + delete buf; + + TCHAR FileName [_MAX_PATH]; + + INITCOMMONCONTROLSEX icex; + + icex.dwSize = sizeof(INITCOMMONCONTROLSEX); + icex.dwICC = ICC_LISTVIEW_CLASSES|ICC_TREEVIEW_CLASSES; + InitCommonControlsEx(&icex); + + if(1<=DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_OPEN_ROM), GUI.hWnd, DlgOpenROMProc, (LPARAM)FileName)) + { + if (!Settings.StopEmulation) + { + Memory.SaveSRAM (S9xGetFilename (".srm")); + S9xSaveCheatFile (S9xGetFilename (".cht")); + } + Settings.StopEmulation = !LoadROM (FileName); + if (!Settings.StopEmulation) + { + Memory.LoadSRAM( S9xGetFilename (".srm")); + S9xLoadCheatFile (S9xGetFilename (".cht")); + CheckDirectoryIsWritable (S9xGetFilename (".---")); + CheckMenuStates (); + } + else + return (FALSE); + } + else + return (FALSE); + + return (TRUE); +} + +/*****************************************************************************/ +#ifdef NETPLAY_SUPPORT +void EnableServer (bool8 enable) +{ + if (enable != Settings.NetPlayServer) + { + if (Settings.NetPlay && !Settings.NetPlayServer) + { + Settings.NetPlay = FALSE; + S9xNPDisconnect (); + } + + if (enable) + { + S9xSetPause (PAUSE_NETPLAY_CONNECT); + Settings.NetPlayServer = S9xNPStartServer (Settings.Port); + Sleep (1000); + + if (!S9xNPConnectToServer ("127.0.0.1", Settings.Port, + Memory.ROMName)) + { + S9xClearPause (PAUSE_NETPLAY_CONNECT); + } + } + else + { + Settings.NetPlayServer = FALSE; + S9xNPStopServer (); + } + } +} +#endif +#ifdef USE_OPENGL +bool8 S9xOpenGLInit () +{ + int PixelFormat; + + if (GUI.FullScreen) + { + DEVMODE dmScreenSettings; + + memset (&dmScreenSettings, 0, sizeof(dmScreenSettings)); + dmScreenSettings.dmSize = sizeof(dmScreenSettings); + dmScreenSettings.dmPelsWidth = GUI.Width; + dmScreenSettings.dmPelsHeight = GUI.Height; + dmScreenSettings.dmBitsPerPel = 16; //bits; + dmScreenSettings.dmFields = DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT; + + if (ChangeDisplaySettings (&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL) + { + GUI.FullScreen = FALSE; + } + } + if (GUI.FullScreen) + { + SetWindowLong (GUI.hWnd, GWL_STYLE, WS_POPUP | WS_VISIBLE); + SetWindowPos (GUI.hWnd, HWND_TOP, 0, 0, GUI.Width, + GUI.Height, + SWP_DRAWFRAME|SWP_FRAMECHANGED); + } + else + { + SetWindowLong (GUI.hWnd, GWL_STYLE, WS_POPUPWINDOW|WS_CAPTION| + WS_THICKFRAME|WS_VISIBLE|WS_MINIMIZEBOX|WS_MAXIMIZEBOX); + SetWindowPos (GUI.hWnd, HWND_TOP, + GUI.window_size.left, + GUI.window_size.top, + GUI.window_size.right - GUI.window_size.left, + GUI.window_size.bottom - GUI.window_size.top, + SWP_DRAWFRAME|SWP_FRAMECHANGED); + } + + static PIXELFORMATDESCRIPTOR pfd = + { + sizeof(PIXELFORMATDESCRIPTOR), + 1, + PFD_DRAW_TO_WINDOW | + PFD_SUPPORT_OPENGL | + PFD_DOUBLEBUFFER, + PFD_TYPE_RGBA, + 16, //bits, + 0, 0, 0, 0, 0, 0, + 0, + 0, + 0, + 0, 0, 0, 0, + 16, + 0, + 0, + PFD_MAIN_PLANE, + 0, + 0, 0, 0 + }; + + if (!(PixelFormat = ChoosePixelFormat (GUI.hDC, &pfd))) + { + MessageBox(NULL,TEXT("Can't Find A Suitable PixelFormat."),TEXT("ERROR"),MB_OK|MB_ICONEXCLAMATION); + return FALSE; + } + + if (!SetPixelFormat (GUI.hDC, PixelFormat, &pfd)) + { + MessageBox(NULL,TEXT("Can't Set The PixelFormat."),TEXT("ERROR"),MB_OK|MB_ICONEXCLAMATION); + return (FALSE); + } + + if (!(GUI.hRC = wglCreateContext (GUI.hDC))) + { + MessageBox(NULL,TEXT("Can't Create A GL Rendering Context."),TEXT("ERROR"),MB_OK|MB_ICONEXCLAMATION); + return (FALSE); + } + + if (!wglMakeCurrent (GUI.hDC, GUI.hRC)) + { + MessageBox(NULL,TEXT("Can't Activate The GL Rendering Context."),TEXT("ERROR"),MB_OK|MB_ICONEXCLAMATION); + return (FALSE); + } + + glGetIntegerv (GL_MAX_TEXTURE_SIZE, &OpenGL.max_texture_size); + + if (OpenGL.max_texture_size >= 512) + { + OpenGL.texture_size = 512; + OpenGL.num_textures = 2; + } + else + { + OpenGL.texture_size = OpenGL.max_texture_size; + OpenGL.num_textures = 1; + } + + Settings.OpenGLEnable = TRUE; + + const char *ext = (const char *) glGetString (GL_EXTENSIONS); + + if (ext && strstr (ext, "EXT_packed_pixels") != NULL) + OpenGL.packed_pixels_extension_present = TRUE; + + const char *version = (const char *) glGetString (GL_VERSION); + + if (version && strlen (version) < 100) + { + char ver [100]; + strcpy (ver, version); + + // Strip dots from the version string + char *ptr; + while (ptr = strchr (ver, '.')) + memmove (ptr, ptr + 1, strlen (ptr + 1) + 1); + + // Pad the string with zeros to 4 digits + while (strlen (ver) < 4) + strcat (ver, "0"); + + OpenGL.version = atoi (ver); + } + else + OpenGL.version = 1100; + +#ifndef GL_UNSIGNED_SHORT_5_5_5_1_EXT +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#endif + + if (OpenGL.version >= 1200) + { + OpenGL.internal_format = GL_RGB5_A1; + OpenGL.format = GL_RGBA; + OpenGL.type = GL_UNSIGNED_SHORT_5_5_5_1_EXT; + } + else + if (OpenGL.packed_pixels_extension_present) + { + OpenGL.internal_format = GL_RGB5_A1; + OpenGL.format = GL_RGBA; + OpenGL.type = GL_UNSIGNED_SHORT_5_5_5_1_EXT; + } + else + { + OpenGL.internal_format = GL_RGB; + OpenGL.format = GL_RGB; + OpenGL.type = GL_UNSIGNED_BYTE; + } + + glGenTextures (OpenGL.num_textures, OpenGL.textures); + + if (OpenGL.num_textures == 2) + { + glBindTexture (GL_TEXTURE_2D, OpenGL.textures [1]); + glTexImage2D (GL_TEXTURE_2D, 0, OpenGL.internal_format, 256, 256, 0, + OpenGL.format, OpenGL.type, NULL); + + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + } + + glBindTexture (GL_TEXTURE_2D, OpenGL.textures [0]); + glTexImage2D (GL_TEXTURE_2D, 0, OpenGL.internal_format, + OpenGL.texture_size, OpenGL.texture_size, 0, + OpenGL.format, OpenGL.type, NULL); + + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + + glPolygonMode (GL_FRONT, GL_FILL); + glEnable (GL_CULL_FACE); + glCullFace (GL_BACK); + + glEnable (GL_DITHER); + glEnable (GL_LIGHTING); + glEnable (GL_LIGHT0); + + glEnable (GL_POINT_SMOOTH); + glHint (GL_POINT_SMOOTH_HINT, GL_NICEST); + + glEnable (GL_TEXTURE_2D); + + glShadeModel (GL_SMOOTH); + glClearColor (0.0f, 0.0f, 0.0f, 0.0f); + glClearDepth (1.0f); + glDisable (GL_DEPTH_TEST); + glDepthFunc (GL_LESS); + glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); + + GLfloat LightAmbient[] = { 0.2f, 0.2f, 0.2f, 1.0f }; + GLfloat LightDiffuse[] = { 1.0f, 1.0f, 1.0f, 1.0f }; + GLfloat LightSpecular[] = { 0.5f, 0.5f, 0.5f, 1.0f }; + GLfloat LightPosition[] = { 0.0f, 0.0f, 2.0f, 1.0f }; + + glLightfv (GL_LIGHT0, GL_AMBIENT, LightAmbient); + glLightfv (GL_LIGHT0, GL_DIFFUSE, LightDiffuse); + glLightfv (GL_LIGHT0, GL_SPECULAR, LightSpecular); + glLightfv (GL_LIGHT0, GL_POSITION, LightPosition); + + //Set common material properties + GLfloat MatSpecular[] = { 1.0f, 1.0f, 1.0f, 1.1f }; + GLfloat WhMat[] = { 1.0f, 1.0f, 1.0f, 1.0f }; + + glMaterialf (GL_FRONT_AND_BACK, GL_SHININESS, 128.0f); + glMaterialfv (GL_FRONT_AND_BACK, GL_SPECULAR, MatSpecular); + glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, WhMat); + + glMatrixMode (GL_PROJECTION); + glLoadIdentity (); + glMatrixMode (GL_MODELVIEW); + + glDisable (GL_DEPTH_TEST); + glDisable (GL_LIGHTING); + glEnable (GL_TEXTURE_2D); + glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); + glDisable (GL_BLEND); + + return (TRUE); +} + +void S9xOpenGLDeinit () +{ + if (GUI.FullScreen) + ChangeDisplaySettings (NULL, 0); + + if (GUI.hRC) + { + wglMakeCurrent (NULL, NULL); + wglDeleteContext (GUI.hRC); + GUI.hRC = NULL; + } +} + +void S9xOpenGLResize (int width, int height) +{ + if (height == 0) + height = 1; + + glViewport (0, 0, width, height); + + glMatrixMode (GL_PROJECTION); + glLoadIdentity(); + + gluPerspective (45.0f, (GLfloat)width / (GLfloat)height, 0.1f, 100.0f); + glMatrixMode (GL_MODELVIEW); +} +#endif + +void S9xAddToRecentGames (const char *filename) +{ + if (!GUI.RecentGames) + { + GUI.RecentGames = new char *[2]; + GUI.RecentGames [0] = strdup (filename); + GUI.RecentGames [1] = NULL; + } + else + { + int i = -1; + + // Make sure its not in the list already + while (GUI.RecentGames [++i]) + if (strcmp (filename, GUI.RecentGames [i]) == 0) + break; + + if (GUI.RecentGames [i]) + { + // It is in the list, move it to the head of the list. + char *t = GUI.RecentGames [i]; + for (int j = i; j > 0; j--) + GUI.RecentGames [j] = GUI.RecentGames [j - 1]; + + GUI.RecentGames [0] = t; + } + else + { + // Not in the list, add it. + if (i < MAX_RECENT_GAMES_LIST_SIZE) + { + // Extend the recent game list length by 1. + char **t = new char *[i + 2]; + + memmove (&t [1], GUI.RecentGames, sizeof (char *) * (i + 1)); + delete GUI.RecentGames; + GUI.RecentGames = t; + GUI.RecentGames [0] = strdup (filename); + } + else + { + // Throw the last item off the end of the list + free (GUI.RecentGames [i - 1]); + memmove (&GUI.RecentGames [1], &GUI.RecentGames [0], + sizeof (char *) * (MAX_RECENT_GAMES_LIST_SIZE - 1)); + GUI.RecentGames [0] = strdup (filename); + } + } + } + S9xSetRecentGames (); +} + +void S9xSetRecentGames () +{ + HMENU file = GetSubMenu (GUI.hMenu, 0); + if (file) + { + HMENU recent = GetSubMenu (file, 1); + if (recent) + { + MENUITEMINFO mii; + TCHAR name [256 + 10]; + int i; + + // Clear out the menu first + for (i = GetMenuItemCount (recent) - 1; i >= 0; i--) + RemoveMenu (recent, i, MF_BYPOSITION); + + mii.cbSize = sizeof (mii); + mii.fMask = MIIM_TYPE | MIIM_DATA | MIIM_STATE | MIIM_ID; + mii.fType = MFT_STRING; + mii.fState = MFS_UNCHECKED; + + for (i = 0; i < MAX_RECENT_GAMES_LIST_SIZE && GUI.RecentGames && GUI.RecentGames [i]; i++) + { + // Build up a menu item string in the form: + // 1. + + sprintf (name, TEXT("&%c. "), i < 9 ? '1' + i : 'A' + i - 9); + + // append the game title to name, with formatting modifications as necessary + { + TCHAR baseName [256]; + strcpy (baseName, S9xBasename (GUI.RecentGames [i])); + int pos = strlen (name), baseNameLen = strlen (baseName); + for (int j = 0; j < baseNameLen ; j++) + { + char c = baseName [j]; + name [pos++] = c; + + // & is a special character in Windows menus, + // so we have to change & to && when copying over the game title + // otherwise "Pocky & Rocky (U).smc" will show up as "Pocky _Rocky (U).smc", for example + if(c == '&') + name [pos++] = '&'; + } + name [pos] = '\0'; + } + + mii.dwTypeData = name; + mii.cch = strlen (name) + 1; + mii.wID = 0xFF00 + i; + + InsertMenuItem (recent, 0xFF00 + i, FALSE, &mii); + } + } + } +} + +static void WinDeleteRecentGamesList () +{ + if (GUI.RecentGames) + { + int i = 0; + + while (GUI.RecentGames [i]) + { + free (GUI.RecentGames [i]); + GUI.RecentGames[i]=NULL; + i++; + } + + delete GUI.RecentGames; + GUI.RecentGames = NULL; + } +} + +int CALLBACK DlgSoundConf(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static HBITMAP hBmp; + static struct SSettings* set; + switch(msg) + { + case WM_INITDIALOG: + hBmp=(HBITMAP)LoadImage(NULL, TEXT("Jerremy.bmp"), IMAGE_BITMAP, 0,0, LR_CREATEDIBSECTION | LR_LOADFROMFILE); + set= (struct SSettings *)lParam; +#ifndef MK_APU + SetDlgItemText(hDlg,IDC_LINEAR_INTER, "Linear &Interpolation of Sample Data"); +#endif + SendDlgItemMessage(hDlg, IDC_DRIVER, CB_INSERTSTRING,0,(LPARAM)TEXT("Snes9x DirectSound")); +#ifdef FMOD_SUPPORT + SendDlgItemMessage(hDlg, IDC_DRIVER, CB_INSERTSTRING,1,(LPARAM)TEXT("FMOD DirectSound")); + SendDlgItemMessage(hDlg, IDC_DRIVER, CB_INSERTSTRING,2,(LPARAM)TEXT("FMOD Windows Multimedia")); + SendDlgItemMessage(hDlg, IDC_DRIVER, CB_INSERTSTRING,3,(LPARAM)TEXT("FMOD A3D")); +#endif + SendDlgItemMessage(hDlg, IDC_DRIVER,CB_SETCURSEL,set->SoundDriver,0); + + SendDlgItemMessage(hDlg, IDC_SKIP_TYPE, CB_INSERTSTRING,0,(LPARAM)TEXT("Skip style #1")); + SendDlgItemMessage(hDlg, IDC_SKIP_TYPE, CB_INSERTSTRING,1,(LPARAM)TEXT("Skip style #2")); + SendDlgItemMessage(hDlg, IDC_SKIP_TYPE, CB_INSERTSTRING,2,(LPARAM)TEXT("Skip style #3")); + SendDlgItemMessage(hDlg, IDC_SKIP_TYPE, CB_INSERTSTRING,3,(LPARAM)TEXT("Skip style #4")); + SendDlgItemMessage(hDlg, IDC_SKIP_TYPE, CB_INSERTSTRING,4,(LPARAM)TEXT("Skip style #5")); + + SendDlgItemMessage(hDlg,IDC_SKIP_TYPE,CB_SETCURSEL,set->SoundSkipMethod,0); + + SendDlgItemMessage(hDlg, IDC_RATE, CB_INSERTSTRING,0,(LPARAM)TEXT("")); + SendDlgItemMessage(hDlg, IDC_RATE, CB_INSERTSTRING,1,(LPARAM)TEXT("8 KHz")); + SendDlgItemMessage(hDlg, IDC_RATE, CB_INSERTSTRING,2,(LPARAM)TEXT("11 KHz")); + SendDlgItemMessage(hDlg, IDC_RATE, CB_INSERTSTRING,3,(LPARAM)TEXT("16 KHz")); + SendDlgItemMessage(hDlg, IDC_RATE, CB_INSERTSTRING,4,(LPARAM)TEXT("22 KHz")); + SendDlgItemMessage(hDlg, IDC_RATE, CB_INSERTSTRING,5,(LPARAM)TEXT("30 KHz")); + SendDlgItemMessage(hDlg, IDC_RATE, CB_INSERTSTRING,6,(LPARAM)TEXT("32 KHz")); + SendDlgItemMessage(hDlg, IDC_RATE, CB_INSERTSTRING,7,(LPARAM)TEXT("35 KHz")); + SendDlgItemMessage(hDlg, IDC_RATE, CB_INSERTSTRING,8,(LPARAM)TEXT("44 KHz")); + SendDlgItemMessage(hDlg, IDC_RATE, CB_INSERTSTRING,9,(LPARAM)TEXT("48 KHz")); + + int temp; + switch(set->SoundPlaybackRate) + { + case 8000:temp=1;break; + case 11025:temp=2;break; + case 16000:temp=3;break; + case 22050:temp=4;break; + case 30000:temp=5;break; + case 32000:temp=6;break; + case 35000:temp=7;break; + case 44000: + case 44100:temp=8;break; + case 48000:temp=9;break; + case 0: + default:temp=0;break; + } + SendDlgItemMessage(hDlg,IDC_RATE,CB_SETCURSEL,temp,0); + + SendDlgItemMessage(hDlg, IDC_MIX, CB_INSERTSTRING,0,(LPARAM)TEXT("10 ms")); + SendDlgItemMessage(hDlg, IDC_MIX, CB_INSERTSTRING,1,(LPARAM)TEXT("20 ms")); + SendDlgItemMessage(hDlg, IDC_MIX, CB_INSERTSTRING,2,(LPARAM)TEXT("30 ms")); + SendDlgItemMessage(hDlg, IDC_MIX, CB_INSERTSTRING,3,(LPARAM)TEXT("40 ms")); + SendDlgItemMessage(hDlg, IDC_MIX, CB_INSERTSTRING,4,(LPARAM)TEXT("50 ms")); + SendDlgItemMessage(hDlg, IDC_MIX, CB_INSERTSTRING,5,(LPARAM)TEXT("60 ms")); + SendDlgItemMessage(hDlg, IDC_MIX, CB_INSERTSTRING,6,(LPARAM)TEXT("70 ms")); + SendDlgItemMessage(hDlg, IDC_MIX, CB_INSERTSTRING,7,(LPARAM)TEXT("80 ms")); + SendDlgItemMessage(hDlg, IDC_MIX, CB_INSERTSTRING,8,(LPARAM)TEXT("90 ms")); + SendDlgItemMessage(hDlg, IDC_MIX, CB_INSERTSTRING,9,(LPARAM)TEXT("100 ms")); + SendDlgItemMessage(hDlg, IDC_MIX, CB_INSERTSTRING,10,(LPARAM)TEXT("110 ms")); + SendDlgItemMessage(hDlg, IDC_MIX, CB_INSERTSTRING,11,(LPARAM)TEXT("120 ms")); + SendDlgItemMessage(hDlg, IDC_MIX, CB_INSERTSTRING,12,(LPARAM)TEXT("130 ms")); + SendDlgItemMessage(hDlg, IDC_MIX, CB_INSERTSTRING,13,(LPARAM)TEXT("140 ms")); + SendDlgItemMessage(hDlg, IDC_MIX, CB_INSERTSTRING,14,(LPARAM)TEXT("150 ms")); + + SendDlgItemMessage(hDlg,IDC_MIX,CB_SETCURSEL,((set->SoundMixInterval/10)-1),0); + + SendDlgItemMessage(hDlg, IDC_BUFLEN, CB_INSERTSTRING,0,(LPARAM)TEXT("10 ms")); + SendDlgItemMessage(hDlg, IDC_BUFLEN, CB_INSERTSTRING,1,(LPARAM)TEXT("20 ms")); + SendDlgItemMessage(hDlg, IDC_BUFLEN, CB_INSERTSTRING,2,(LPARAM)TEXT("40 ms")); + SendDlgItemMessage(hDlg, IDC_BUFLEN, CB_INSERTSTRING,3,(LPARAM)TEXT("80 ms")); + SendDlgItemMessage(hDlg, IDC_BUFLEN, CB_INSERTSTRING,4,(LPARAM)TEXT("160 ms")); + SendDlgItemMessage(hDlg, IDC_BUFLEN, CB_INSERTSTRING,5,(LPARAM)TEXT("320 ms")); + SendDlgItemMessage(hDlg, IDC_BUFLEN, CB_INSERTSTRING,6,(LPARAM)TEXT("640 ms")); + + switch(set->SoundBufferSize) + { + case 2:temp=1; break; + case 4:temp=2; break; + case 8:temp=3; break; + case 16:temp=4; break; + case 32:temp=5; break; + case 64: temp=6;break; + case 1: + default:temp=0;break; + } + SendDlgItemMessage(hDlg,IDC_BUFLEN,CB_SETCURSEL,temp,0); + + if(set->SixteenBitSound) + SendDlgItemMessage(hDlg,IDC_16BIT,BM_SETCHECK,BST_CHECKED,0); + if(set->Stereo) + SendDlgItemMessage(hDlg,IDC_STEREO,BM_SETCHECK,BST_CHECKED,0); + else EnableWindow(GetDlgItem(hDlg, IDC_REV_STEREO), FALSE); + if(set->ReverseStereo) + SendDlgItemMessage(hDlg,IDC_REV_STEREO,BM_SETCHECK,BST_CHECKED,0); + if(set->AltSampleDecode) + { + EnableWindow(GetDlgItem(hDlg, IDC_CACHING), FALSE); + SendDlgItemMessage(hDlg,IDC_ANTIRES,BM_SETCHECK,BST_CHECKED,0); + } + if(set->Mute) + SendDlgItemMessage(hDlg,IDC_MUTE,BM_SETCHECK,BST_CHECKED,0); + if(set->FAMute) + SendDlgItemMessage(hDlg,IDC_FAMT,BM_SETCHECK,BST_CHECKED,0); + + if(set->NextAPUEnabled) + { + EnableWindow(GetDlgItem(hDlg, IDC_SKIP_TYPE), FALSE); + SendDlgItemMessage(hDlg,IDC_SPC700ON,BM_SETCHECK,BST_CHECKED,0); + //Gray out the skip feature! + } + if(set->InterpolatedSound) + SendDlgItemMessage(hDlg,IDC_LINEAR_INTER,BM_SETCHECK,BST_CHECKED,0); + if(set->SoundSync) + SendDlgItemMessage(hDlg,IDC_SYNC_TO_SOUND_CPU,BM_SETCHECK,BST_CHECKED,0); + if(set->SoundEnvelopeHeightReading) + SendDlgItemMessage(hDlg,IDC_ENVX,BM_SETCHECK,BST_CHECKED,0); + if(set->FakeMuteFix) + SendDlgItemMessage(hDlg,IDC_FMUT,BM_SETCHECK,BST_CHECKED,0); + if(set->UseWIPAPUTiming) + SendDlgItemMessage(hDlg,IDC_WIP1,BM_SETCHECK,BST_CHECKED,0); + if(!set->DisableSoundEcho) + SendDlgItemMessage(hDlg,IDC_ECHO,BM_SETCHECK,BST_CHECKED,0); + +// if(!set->DisableSampleCaching) +// SendDlgItemMessage(hDlg,IDC_CACHING,BM_SETCHECK,BST_CHECKED,0); + if(!set->DisableMasterVolume) + SendDlgItemMessage(hDlg,IDC_MASTER_VOL,BM_SETCHECK,BST_CHECKED,0); + + if(set->SoundDriver) + { + EnableWindow(GetDlgItem(hDlg, IDC_MIX), false); + EnableWindow(GetDlgItem(hDlg, IDC_BUFLEN), false); + EnableWindow(GetDlgItem(hDlg, IDC_SYNC_TO_SOUND_CPU), false); + } + + if(!IsDlgButtonChecked(hDlg,IDC_SPC700ON)) + { + EnableWindow(GetDlgItem(hDlg, IDC_CACHING), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_MUTE), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_FAMT), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_ANTIRES), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_SKIP_TYPE), TRUE); + EnableWindow(GetDlgItem(hDlg, IDC_DRIVER), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_16BIT), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_ENVX), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_STEREO), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_MASTER_VOL), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_RATE), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_ECHO), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_LINEAR_INTER), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_REV_STEREO), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_BUFLEN), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_MIX), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_SYNC_TO_SOUND_CPU), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_FMUT), FALSE); + } + + return true; + case WM_PAINT: + { + PAINTSTRUCT ps; + BeginPaint (hDlg, &ps); + if(hBmp) + { + BITMAP bmp; + ZeroMemory(&bmp, sizeof(BITMAP)); + RECT r; + GetClientRect(hDlg, &r); + HDC hdc=GetDC(hDlg); + HDC hDCbmp=CreateCompatibleDC(hdc); + GetObject(hBmp, sizeof(BITMAP), &bmp); + HBITMAP hOldBmp=(HBITMAP)SelectObject(hDCbmp, hBmp); + StretchBlt(hdc, 0,0,r.right,r.bottom,hDCbmp,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY); + SelectObject(hDCbmp, hOldBmp); + DeleteDC(hDCbmp); + ReleaseDC(hDlg, hdc); + }; + + EndPaint (hDlg, &ps); + } + return true; + case WM_COMMAND: + switch(LOWORD(wParam)) + { + case IDOK: + + set->SoundDriver=SendDlgItemMessage(hDlg, IDC_DRIVER,CB_GETCURSEL,0,0); + set->SoundSkipMethod=(unsigned char)SendDlgItemMessage(hDlg,IDC_SKIP_TYPE,CB_GETCURSEL,0,0); + set->SixteenBitSound=IsDlgButtonChecked(hDlg, IDC_16BIT); + set->AltSampleDecode=IsDlgButtonChecked(hDlg, IDC_ANTIRES); + set->SoundSync=IsDlgButtonChecked(hDlg, IDC_SYNC_TO_SOUND_CPU); + set->InterpolatedSound=IsDlgButtonChecked(hDlg, IDC_LINEAR_INTER); + set->Stereo=IsDlgButtonChecked(hDlg, IDC_STEREO); + set->ReverseStereo=IsDlgButtonChecked(hDlg, IDC_REV_STEREO); + set->Mute=IsDlgButtonChecked(hDlg, IDC_MUTE); + set->FAMute=IsDlgButtonChecked(hDlg, IDC_FAMT); + set->NextAPUEnabled=IsDlgButtonChecked(hDlg, IDC_SPC700ON); + set->SoundEnvelopeHeightReading=IsDlgButtonChecked(hDlg, IDC_ENVX); + set->FakeMuteFix=IsDlgButtonChecked(hDlg, IDC_FMUT); + set->UseWIPAPUTiming=IsDlgButtonChecked(hDlg, IDC_WIP1); + + set->DisableSoundEcho=(!IsDlgButtonChecked(hDlg, IDC_ECHO)); + //set->DisableSampleCaching=(!IsDlgButtonChecked(hDlg, IDC_CACHING)); + set->DisableMasterVolume=(!IsDlgButtonChecked(hDlg, IDC_MASTER_VOL)); + + + switch(SendDlgItemMessage(hDlg, IDC_RATE,CB_GETCURSEL,0,0)) + { + case 0: set->SoundPlaybackRate=0; break; + case 1: set->SoundPlaybackRate=8000; break; + case 2: set->SoundPlaybackRate=11025; break; + case 3: set->SoundPlaybackRate=16000; break; + case 4: set->SoundPlaybackRate=22050; break; + case 5: set->SoundPlaybackRate=30000; break; + case 6: set->SoundPlaybackRate=32000; break; + case 7: set->SoundPlaybackRate=35000; break; + case 8: set->SoundPlaybackRate=44100; break; + case 9: set->SoundPlaybackRate=48000; break; + } + set->SoundMixInterval=(10*(1+(SendDlgItemMessage(hDlg,IDC_MIX,CB_GETCURSEL,0,0)))); + + set->SoundBufferSize=1<reg[0]+rtc->reg[1]*10; + minutes=rtc->reg[2]+rtc->reg[3]*10; + hour=rtc->reg[4]+rtc->reg[5]*10; + day=rtc->reg[6]+rtc->reg[7]*10; + month=rtc->reg[8]+rtc->reg[9]*10; + year=rtc->reg[10]+rtc->reg[11]*10; + dayinmonth=S9xRTCDaysInMonth(month,year); + + + SendDlgItemMessage(hDlg,IDC_MONTH, TBM_SETRANGE,(WPARAM)1,(LPARAM)MAKELONG(0,11)); + SendDlgItemMessage(hDlg,IDC_MONTH, TBM_SETTICFREQ,(WPARAM)5,0); + SendDlgItemMessage(hDlg,IDC_MONTH, TBM_SETPOS,(WPARAM)(BOOL)TRUE,(LPARAM)month-1); + SetDlgItemInt(hDlg,IDC_LBLMONTH,month,0); + + SendDlgItemMessage(hDlg,IDC_DAY, TBM_SETRANGE,(WPARAM)1,(LPARAM)MAKELONG(0,dayinmonth-1)); + SendDlgItemMessage(hDlg,IDC_DAY, TBM_SETTICFREQ,(WPARAM)5,0); + SendDlgItemMessage(hDlg,IDC_DAY, TBM_SETPOS,(WPARAM)(BOOL)TRUE,(LPARAM)day-1); + SetDlgItemInt(hDlg,IDC_LBLDAY,day,0); + + SendDlgItemMessage(hDlg,IDC_YEAR, TBM_SETRANGE,(WPARAM)1,(LPARAM)MAKELONG(0,99)); + SendDlgItemMessage(hDlg,IDC_YEAR, TBM_SETTICFREQ,(WPARAM)5,0); + if(year<95) + { + SendDlgItemMessage(hDlg,IDC_YEAR, TBM_SETPOS,(WPARAM)(BOOL)TRUE,(LPARAM)year+5); + SetDlgItemInt(hDlg,IDC_LBLYEAR,year+2000,0); + } + else + { + SendDlgItemMessage(hDlg,IDC_YEAR, TBM_SETPOS,(WPARAM)(BOOL)TRUE,(LPARAM)year-95); + SetDlgItemInt(hDlg,IDC_LBLYEAR,year+1900,0); + } + + SendDlgItemMessage(hDlg, IDC_HOUR, TBM_SETRANGE,(WPARAM)1,(LPARAM)MAKELONG(0,23)); + SendDlgItemMessage(hDlg,IDC_HOUR, TBM_SETTICFREQ,(WPARAM)5,0); + SendDlgItemMessage(hDlg,IDC_HOUR, TBM_SETPOS,(WPARAM)(BOOL)TRUE,(LPARAM)hour); + SetDlgItemInt(hDlg,IDC_LBLHOUR,hour,0); + + SendDlgItemMessage(hDlg, IDC_MINUTE, TBM_SETRANGE,(WPARAM)1,(LPARAM)MAKELONG(0,59)); + SendDlgItemMessage(hDlg,IDC_MINUTE, TBM_SETTICFREQ,(WPARAM)5,0); + SendDlgItemMessage(hDlg,IDC_MINUTE, TBM_SETPOS,(WPARAM)(BOOL)TRUE,(LPARAM)minutes); + SetDlgItemInt(hDlg,IDC_LBLMINUTE,minutes,0); + + SendDlgItemMessage(hDlg, IDC_SECOND, TBM_SETRANGE,(WPARAM)1,(LPARAM)MAKELONG(0,59)); + SendDlgItemMessage(hDlg,IDC_SECOND, TBM_SETTICFREQ,(WPARAM)5,0); + SendDlgItemMessage(hDlg,IDC_SECOND, TBM_SETPOS,(WPARAM)(BOOL)TRUE,(LPARAM)seconds); + SetDlgItemInt(hDlg,IDC_LBLSECOND,seconds,0); + + + + if(rtc->reg[0x0D]&0x01) + SendDlgItemMessage(hDlg,IDC_RTC_D1,BM_SETCHECK,BST_CHECKED,0); + if(rtc->reg[0x0D]&0x02) + SendDlgItemMessage(hDlg,IDC_RTC_D2,BM_SETCHECK,BST_CHECKED,0); + if(rtc->reg[0x0D]&0x04) + SendDlgItemMessage(hDlg,IDC_RTC_D4,BM_SETCHECK,BST_CHECKED,0); + if(rtc->reg[0x0D]&0x08) + SendDlgItemMessage(hDlg,IDC_RTC_D8,BM_SETCHECK,BST_CHECKED,0); + + if(rtc->reg[0x0E]&0x01) + SendDlgItemMessage(hDlg,IDC_RTC_E1,BM_SETCHECK,BST_CHECKED,0); + if(rtc->reg[0x0E]&0x02) + SendDlgItemMessage(hDlg,IDC_RTC_E2,BM_SETCHECK,BST_CHECKED,0); + if(rtc->reg[0x0E]&0x04) + SendDlgItemMessage(hDlg,IDC_RTC_E4,BM_SETCHECK,BST_CHECKED,0); + if(rtc->reg[0x0E]&0x08) + SendDlgItemMessage(hDlg,IDC_RTC_E8,BM_SETCHECK,BST_CHECKED,0); + + if(rtc->reg[0x0F]&0x01) + SendDlgItemMessage(hDlg,IDC_RTC_F1,BM_SETCHECK,BST_CHECKED,0); + if(rtc->reg[0x0F]&0x02) + SendDlgItemMessage(hDlg,IDC_RTC_F2,BM_SETCHECK,BST_CHECKED,0); + if(rtc->reg[0x0F]&0x04) + SendDlgItemMessage(hDlg,IDC_RTC_F4,BM_SETCHECK,BST_CHECKED,0); + if(rtc->reg[0x0F]&0x08) + SendDlgItemMessage(hDlg,IDC_RTC_F8,BM_SETCHECK,BST_CHECKED,0); + + return true; + case WM_COMMAND: + switch(LOWORD(wParam)) + { + case IDOK: + rtc->reg[0x0]=seconds%10; + rtc->reg[0x1]=seconds/10; + rtc->reg[0x2]=minutes%10; + rtc->reg[0x3]=minutes/10; + rtc->reg[0x4]=hour%10; + rtc->reg[0x5]=hour/10; + rtc->reg[0x6]=day%10; + rtc->reg[0x7]=day/10; + rtc->reg[0x8]=month%10; + rtc->reg[0x9]=month/10; + rtc->reg[0xA]=year%10; + rtc->reg[0xB]=year/10; + + if(IsDlgButtonChecked(hDlg, IDC_RTC_D1)) + rtc->reg[0x0D]|=0x01; + else + rtc->reg[0x0D]&=0x0E; + if(IsDlgButtonChecked(hDlg, IDC_RTC_D2)) + rtc->reg[0x0D]|=0x02; + else + rtc->reg[0x0D]&=0x0D; + if(IsDlgButtonChecked(hDlg, IDC_RTC_D4)) + rtc->reg[0x0D]|=0x04; + else + rtc->reg[0x0D]&=0x0B; + if(IsDlgButtonChecked(hDlg, IDC_RTC_D8)) + rtc->reg[0x0D]|=0x08; + else + rtc->reg[0x0D]&=0x07; + + if(IsDlgButtonChecked(hDlg, IDC_RTC_E1)) + rtc->reg[0x0E]|=0x01; + else + rtc->reg[0x0E]&=0x0E; + if(IsDlgButtonChecked(hDlg, IDC_RTC_E2)) + rtc->reg[0x0E]|=0x02; + else + rtc->reg[0x0E]&=0x0D; + if(IsDlgButtonChecked(hDlg, IDC_RTC_E4)) + rtc->reg[0x0E]|=0x04; + else + rtc->reg[0x0E]&=0x0B; + if(IsDlgButtonChecked(hDlg, IDC_RTC_E8)) + rtc->reg[0x0E]|=0x08; + else + rtc->reg[0x0E]&=0x07; + + if(IsDlgButtonChecked(hDlg, IDC_RTC_F1)) + rtc->reg[0x0F]|=0x01; + else + rtc->reg[0x0F]&=0x0E; + if(IsDlgButtonChecked(hDlg, IDC_RTC_F2)) + rtc->reg[0x0F]|=0x02; + else + rtc->reg[0x0F]&=0x0D; + if(IsDlgButtonChecked(hDlg, IDC_RTC_F4)) + rtc->reg[0x0F]|=0x04; + else + rtc->reg[0x0F]&=0x0B; + if(IsDlgButtonChecked(hDlg, IDC_RTC_F8)) + rtc->reg[0x0F]|=0x08; + else + rtc->reg[0x0F]&=0x07; + + + + + case IDCANCEL: + EndDialog(hDlg, 1); + return true; + /*case IDC_MONTH: + int dinmonth; + dinmonth = S9xRTCDaysInMonth( + */ + default: return false; + } + case WM_HSCROLL: + month=1+SendDlgItemMessage(hDlg,IDC_MONTH,TBM_GETPOS,0,0); + SetDlgItemInt(hDlg,IDC_LBLMONTH,month,0); + day=1+SendDlgItemMessage(hDlg,IDC_DAY,TBM_GETPOS,0,0); + year=SendDlgItemMessage(hDlg,IDC_YEAR,TBM_GETPOS,0,0); + hour=SendDlgItemMessage(hDlg,IDC_HOUR,TBM_GETPOS,0,0); + minutes=SendDlgItemMessage(hDlg,IDC_MINUTE,TBM_GETPOS,0,0); + seconds=SendDlgItemMessage(hDlg,IDC_SECOND,TBM_GETPOS,0,0); + SetDlgItemInt(hDlg,IDC_LBLHOUR,hour,0); + SetDlgItemInt(hDlg,IDC_LBLMINUTE,minutes,0); + SetDlgItemInt(hDlg,IDC_LBLSECOND,seconds,0); + if(year<5) + { + year+=95; + SetDlgItemInt(hDlg,IDC_LBLYEAR,year+1900,0); + } + else + { + year-=5; + SetDlgItemInt(hDlg,IDC_LBLYEAR,year+2000,0); + } + dayinmonth=S9xRTCDaysInMonth(month,year); + if(day>dayinmonth) + { + day=dayinmonth; + SendDlgItemMessage(hDlg,IDC_DAY, TBM_SETPOS,(WPARAM)(BOOL)TRUE,(LPARAM)day-1); + } + SendDlgItemMessage(hDlg,IDC_DAY, TBM_SETRANGE,(WPARAM)1,(LPARAM)MAKELONG(0,dayinmonth-1)); + SetDlgItemInt(hDlg,IDC_LBLDAY,day,0); + return true; + + default: return false; + } + +} +#endif + +const char *StaticRAMBitSize () +{ + static char tmp [20]; + + sprintf (tmp, " (%dKbit)", 8*(Memory.SRAMMask + 1) / 1024); + return (tmp); +} + +int CALLBACK DlgInfoProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static HBITMAP hBmp; + switch(msg) + { + case WM_INITDIALOG: + { + hBmp=(HBITMAP)LoadImage(NULL, TEXT("anomie.bmp"), IMAGE_BITMAP, 0,0, LR_CREATEDIBSECTION | LR_LOADFROMFILE); + char temp[100]; + char romtext[4096]; + sprintf(romtext, "File: %s\r\nName: %s\r\n", Memory.ROMFilename, Memory.ROMName); + sprintf(temp, "Speed: %02X/%s\r\nROM Map: %s\r\nType: %02x\r\n", Memory.ROMSpeed, ((Memory.ROMSpeed&0x10)!=0)?"FastROM":"SlowROM",(Memory.HiROM)?"HiROM":"LoROM",Memory.ROMType); + strcat(romtext, temp); + strcat(romtext, "Kart contents: "); + strcat(romtext, Memory.KartContents ()); + strcat(romtext, "\r\nHeader ROM Size: "); + strcat(romtext, Memory.Size()); + sprintf(temp, "\r\nCalculated ROM Size: %d Mbits", Memory.CalculatedSize/0x20000); + strcat(romtext, temp); + + strcat(romtext, "\r\nSRAM size: "); + strcat(romtext, Memory.StaticRAMSize ()); + strcat(romtext, StaticRAMBitSize()); + strcat(romtext, "\r\nActual Checksum: "); + sprintf(temp, "%04X", Memory.CalculatedChecksum); + strcat(romtext, temp); + strcat(romtext, "\r\nHeader Checksum: "); + sprintf(temp, "%04X", Memory.ROMChecksum); + strcat(romtext, temp); + strcat(romtext, "\r\nHeader Checksum Compliment: "); + sprintf(temp, "%04X", Memory.ROMComplementChecksum); + strcat(romtext, temp); + strcat(romtext, "\r\nOutput: "); + if(Memory.ROMRegion>12||Memory.ROMRegion<2) + strcat(romtext, "NTSC 60Hz"); + else strcat(romtext, "PAL 50Hz"); + + sprintf(temp, "\r\nCRC32:\t%08X", Memory.ROMCRC32); + strcat(romtext, temp); + + + strcat(romtext, "\r\nLicensee: "); + + int tmp=-1; + // sscanf(Memory.CompanyId, "%02X", &tmp); + if(Memory.CompanyId[0]=='0') + tmp=0; + if(Memory.CompanyId[0]=='1') + tmp=16; + if(Memory.CompanyId[0]=='2') + tmp=32; + if(Memory.CompanyId[0]=='3') + tmp=48; + if(Memory.CompanyId[0]=='4') + tmp=64; + if(Memory.CompanyId[0]=='5') + tmp=80; + if(Memory.CompanyId[0]=='6') + tmp=96; + if(Memory.CompanyId[0]=='7') + tmp=112; + if(Memory.CompanyId[0]=='8') + tmp=128; + if(Memory.CompanyId[0]=='9') + tmp=144; + if(Memory.CompanyId[0]=='A') + tmp=160; + if(Memory.CompanyId[0]=='B') + tmp=176; + if(Memory.CompanyId[0]=='C') + tmp=192; + if(Memory.CompanyId[0]=='D') + tmp=208; + if(Memory.CompanyId[0]=='E') + tmp=224; + if(Memory.CompanyId[0]=='F') + tmp=240; + if(tmp!=-1) + { + if(Memory.CompanyId[1]=='0') + tmp+=0; + else if(Memory.CompanyId[1]=='1') + tmp+=1; + else if(Memory.CompanyId[1]=='2') + tmp+=2; + else if(Memory.CompanyId[1]=='3') + tmp+=3; + else if(Memory.CompanyId[1]=='4') + tmp+=4; + else if(Memory.CompanyId[1]=='5') + tmp+=5; + else if(Memory.CompanyId[1]=='6') + tmp+=6; + else if(Memory.CompanyId[1]=='7') + tmp+=7; + else if(Memory.CompanyId[1]=='8') + tmp+=8; + else if(Memory.CompanyId[1]=='9') + tmp+=9; + else if(Memory.CompanyId[1]=='A') + tmp+=10; + else if(Memory.CompanyId[1]=='B') + tmp+=11; + else if(Memory.CompanyId[1]=='C') + tmp+=12; + else if(Memory.CompanyId[1]=='D') + tmp+=13; + else if(Memory.CompanyId[1]=='E') + tmp+=14; + else if(Memory.CompanyId[1]=='F') + tmp+=15; + else tmp=0; + } + else tmp=0; + if(tmp==0) + tmp=(Memory.HiROM)?Memory.ROM[0x0FFDA]:Memory.ROM[0x7FDA]; + switch(tmp) + // switch(((Memory.ROMSpeed&0x0F)!=0)?Memory.ROM[0x0FFDA]:Memory.ROM[0x7FDA]) + // switch(atoi(Memory.CompanyId)) + // switch(((Memory.CompanyId[0]-'0')*16)+(Memory.CompanyId[1]-'0')) + { + case 0:strcat(romtext, "INVALID COMPANY");break; + case 1:strcat(romtext, "Nintendo");break; + case 2:strcat(romtext, "Ajinomoto");break; + case 3:strcat(romtext, "Imagineer-Zoom");break; + case 4:strcat(romtext, "Chris Gray Enterprises Inc.");break; + case 5:strcat(romtext, "Zamuse");break; + case 6:strcat(romtext, "Falcom");break; + case 7:strcat(romtext, NOTKNOWN "7");break; + case 8:strcat(romtext, "Capcom");break; + case 9:strcat(romtext, "HOT-B");break; + case 10:strcat(romtext, "Jaleco");break; + case 11:strcat(romtext, "Coconuts");break; + case 12:strcat(romtext, "Rage Software");break; + case 13:strcat(romtext, "Micronet"); break; //Acc. ZFE + case 14:strcat(romtext, "Technos");break; + case 15:strcat(romtext, "Mebio Software");break; + case 16:strcat(romtext, "SHOUEi System"); break; //Acc. ZFE + case 17:strcat(romtext, "Starfish");break; //UCON 64 + case 18:strcat(romtext, "Gremlin Graphics");break; + case 19:strcat(romtext, "Electronic Arts");break; + case 20:strcat(romtext, "NCS / Masaya"); break; //Acc. ZFE + case 21:strcat(romtext, "COBRA Team");break; + case 22:strcat(romtext, "Human/Field");break; + case 23:strcat(romtext, "KOEI");break; + case 24:strcat(romtext, "Hudson Soft");break; + case 25:strcat(romtext, "Game Village");break;//uCON64 + case 26:strcat(romtext, "Yanoman");break; + case 27:strcat(romtext, NOTKNOWN "27");break; + case 28:strcat(romtext, "Tecmo");break; + case 29:strcat(romtext, NOTKNOWN "29");break; + case 30:strcat(romtext, "Open System");break; + case 31:strcat(romtext, "Virgin Games");break; + case 32:strcat(romtext, "KSS");break; + case 33:strcat(romtext, "Sunsoft");break; + case 34:strcat(romtext, "POW");break; + case 35:strcat(romtext, "Micro World");break; + case 36:strcat(romtext, NOTKNOWN "36");break; + case 37:strcat(romtext, NOTKNOWN "37");break; + case 38:strcat(romtext, "Enix");break; + case 39:strcat(romtext, "Loriciel/Electro Brain");break;//uCON64 + case 40:strcat(romtext, "Kemco");break; + case 41:strcat(romtext, "Seta Co.,Ltd.");break; + case 42:strcat(romtext, "Culture Brain"); break; //Acc. ZFE + case 43:strcat(romtext, "Irem Japan");break;//Irem? Gun Force J + case 44:strcat(romtext, "Pal Soft"); break; //Acc. ZFE + case 45:strcat(romtext, "Visit Co.,Ltd.");break; + case 46:strcat(romtext, "INTEC Inc."); break; //Acc. ZFE + case 47:strcat(romtext, "System Sacom Corp."); break; //Acc. ZFE + case 48:strcat(romtext, "Viacom New Media");break; //Zoop! + case 49:strcat(romtext, "Carrozzeria");break; + case 50:strcat(romtext, "Dynamic");break; + case 51:strcat(romtext, "Nintendo");break; + case 52:strcat(romtext, "Magifact");break; + case 53:strcat(romtext, "Hect");break; + case 54:strcat(romtext, NOTKNOWN "54");break; + case 55:strcat(romtext, NOTKNOWN "55");break; + case 56:strcat(romtext, "Capcom Europe");break;//Capcom? BOF2(E) MM7 (E) + case 57:strcat(romtext, "Accolade Europe");break;//Accolade?Bubsy 2 (E) + case 58:strcat(romtext, NOTKNOWN "58");break; + case 59:strcat(romtext, "Arcade Zone");break;//uCON64 + case 60:strcat(romtext, "Empire Software");break; + case 61:strcat(romtext, "Loriciel");break; + case 62:strcat(romtext, "Gremlin Graphics"); break; //Acc. ZFE + case 63:strcat(romtext, NOTKNOWN "63");break; + case 64:strcat(romtext, "Seika Corp.");break; + case 65:strcat(romtext, "UBI Soft");break; + case 66:strcat(romtext, NOTKNOWN "66");break; + case 67:strcat(romtext, NOTKNOWN "67");break; + case 68:strcat(romtext, "LifeFitness Exertainment");break;//?? Exertainment Mountain Bike Rally (U).zip + case 69:strcat(romtext, NOTKNOWN "69");break; + case 70:strcat(romtext, "System 3");break; + case 71:strcat(romtext, "Spectrum Holobyte");break; + case 72:strcat(romtext, NOTKNOWN "72");break; + case 73:strcat(romtext, "Irem");break; + case 74:strcat(romtext, NOTKNOWN "74");break; + case 75:strcat(romtext, "Raya Systems/Sculptured Software");break; + case 76:strcat(romtext, "Renovation Products");break; + case 77:strcat(romtext, "Malibu Games/Black Pearl");break; + case 78:strcat(romtext, NOTKNOWN "78");break; + case 79:strcat(romtext, "U.S. Gold");break; + case 80:strcat(romtext, "Absolute Entertainment");break; + case 81:strcat(romtext, "Acclaim");break; + case 82:strcat(romtext, "Activision");break; + case 83:strcat(romtext, "American Sammy");break; + case 84:strcat(romtext, "GameTek");break; + case 85:strcat(romtext, "Hi Tech Expressions");break; + case 86:strcat(romtext, "LJN Toys");break; + case 87:strcat(romtext, NOTKNOWN "87");break; + case 88:strcat(romtext, NOTKNOWN "88");break; + case 89:strcat(romtext, NOTKNOWN "89");break; + case 90:strcat(romtext, "Mindscape");break; + case 91:strcat(romtext, "Romstar, Inc."); break; //Acc. ZFE + case 92:strcat(romtext, NOTKNOWN "92");break; + case 93:strcat(romtext, "Tradewest");break; + case 94:strcat(romtext, NOTKNOWN "94");break; + case 95:strcat(romtext, "American Softworks Corp.");break; + case 96:strcat(romtext, "Titus");break; + case 97:strcat(romtext, "Virgin Interactive Entertainment");break; + case 98:strcat(romtext, "Maxis");break; + case 99:strcat(romtext, "Origin/FCI/Pony Canyon");break;//uCON64 + case 100:strcat(romtext, NOTKNOWN "100");break; + case 101:strcat(romtext, NOTKNOWN "101");break; + case 102:strcat(romtext, NOTKNOWN "102");break; + case 103:strcat(romtext, "Ocean");break; + case 104:strcat(romtext, NOTKNOWN "104");break; + case 105:strcat(romtext, "Electronic Arts");break; + case 106:strcat(romtext, NOTKNOWN "106");break; + case 107:strcat(romtext, "Laser Beam");break; + case 108:strcat(romtext, NOTKNOWN "108");break; + case 109:strcat(romtext, NOTKNOWN "109");break; + case 110:strcat(romtext, "Elite");break; + case 111:strcat(romtext, "Electro Brain");break; + case 112:strcat(romtext, "Infogrames");break; + case 113:strcat(romtext, "Interplay");break; + case 114:strcat(romtext, "LucasArts");break; + case 115:strcat(romtext, "Parker Brothers");break; + case 116:strcat(romtext, "Konami");break;//uCON64 + case 117:strcat(romtext, "STORM");break; + case 118:strcat(romtext, NOTKNOWN "118");break; + case 119:strcat(romtext, NOTKNOWN "119");break; + case 120:strcat(romtext, "THQ Software");break; + case 121:strcat(romtext, "Accolade Inc.");break; + case 122:strcat(romtext, "Triffix Entertainment");break; + case 123:strcat(romtext, NOTKNOWN "123");break; + case 124:strcat(romtext, "Microprose");break; + case 125:strcat(romtext, NOTKNOWN "125");break; + case 126:strcat(romtext, NOTKNOWN "126");break; + case 127:strcat(romtext, "Kemco");break; + case 128:strcat(romtext, "Misawa");break; + case 129:strcat(romtext, "Teichio");break; + case 130:strcat(romtext, "Namco Ltd.");break; + case 131:strcat(romtext, "Lozc");break; + case 132:strcat(romtext, "Koei");break; + case 133:strcat(romtext, NOTKNOWN "133");break; + case 134:strcat(romtext, "Tokuma Shoten Intermedia");break; + case 135:strcat(romtext, "Tsukuda Original"); break; //Acc. ZFE + case 136:strcat(romtext, "DATAM-Polystar");break; + case 137:strcat(romtext, NOTKNOWN "137");break; + case 138:strcat(romtext, NOTKNOWN "138");break; + case 139:strcat(romtext, "Bullet-Proof Software");break; + case 140:strcat(romtext, "Vic Tokai");break; + case 141:strcat(romtext, NOTKNOWN "141");break; + case 142:strcat(romtext, "Character Soft");break; + case 143:strcat(romtext, "I\'\'Max");break; + case 144:strcat(romtext, "Takara");break; + case 145:strcat(romtext, "CHUN Soft");break; + case 146:strcat(romtext, "Video System Co., Ltd.");break; + case 147:strcat(romtext, "BEC");break; + case 148:strcat(romtext, NOTKNOWN "148");break; + case 149:strcat(romtext, "Varie");break; + case 150:strcat(romtext, "Yonezawa / S'Pal Corp."); break; //Acc. ZFE + case 151:strcat(romtext, "Kaneco");break; + case 152:strcat(romtext, NOTKNOWN "152");break; + case 153:strcat(romtext, "Pack in Video");break; + case 154:strcat(romtext, "Nichibutsu");break; + case 155:strcat(romtext, "TECMO");break; + case 156:strcat(romtext, "Imagineer Co.");break; + case 157:strcat(romtext, NOTKNOWN "157");break; + case 158:strcat(romtext, NOTKNOWN "158");break; + case 159:strcat(romtext, NOTKNOWN "159");break; + case 160:strcat(romtext, "Telenet");break; + case 161:strcat(romtext, "Hori"); break; //Acc. uCON64 + case 162:strcat(romtext, NOTKNOWN "162");break; + case 163:strcat(romtext, NOTKNOWN "163");break; + case 164:strcat(romtext, "Konami");break; + case 165:strcat(romtext, "K.Amusement Leasing Co.");break; + case 166:strcat(romtext, NOTKNOWN "166");break; + case 167:strcat(romtext, "Takara");break; + case 168:strcat(romtext, NOTKNOWN "168");break; + case 169:strcat(romtext, "Technos Jap.");break; + case 170:strcat(romtext, "JVC");break; + case 171:strcat(romtext, NOTKNOWN "171");break; + case 172:strcat(romtext, "Toei Animation");break; + case 173:strcat(romtext, "Toho");break; + case 174:strcat(romtext, NOTKNOWN "174");break; + case 175:strcat(romtext, "Namco Ltd.");break; + case 176:strcat(romtext, "Media Rings Corp."); break; //Acc. ZFE + case 177:strcat(romtext, "ASCII Co. Activison");break; + case 178:strcat(romtext, "Bandai");break; + case 179:strcat(romtext, NOTKNOWN "179");break; + case 180:strcat(romtext, "Enix America");break; + case 181:strcat(romtext, NOTKNOWN "181");break; + case 182:strcat(romtext, "Halken");break; + case 183:strcat(romtext, NOTKNOWN "183");break; + case 184:strcat(romtext, NOTKNOWN "184");break; + case 185:strcat(romtext, NOTKNOWN "185");break; + case 186:strcat(romtext, "Culture Brain");break; + case 187:strcat(romtext, "Sunsoft");break; + case 188:strcat(romtext, "Toshiba EMI");break; + case 189:strcat(romtext, "Sony Imagesoft");break; + case 190:strcat(romtext, NOTKNOWN "190");break; + case 191:strcat(romtext, "Sammy");break; + case 192:strcat(romtext, "Taito");break; + case 193:strcat(romtext, NOTKNOWN "193");break; + case 194:strcat(romtext, "Kemco");break; + case 195:strcat(romtext, "Square");break; + case 196:strcat(romtext, "Tokuma Soft");break; + case 197:strcat(romtext, "Data East");break; + case 198:strcat(romtext, "Tonkin House");break; + case 199:strcat(romtext, NOTKNOWN "199");break; + case 200:strcat(romtext, "KOEI");break; + case 201:strcat(romtext, NOTKNOWN "201");break; + case 202:strcat(romtext, "Konami USA");break; + case 203:strcat(romtext, "NTVIC");break; + case 204:strcat(romtext, NOTKNOWN "204");break; + case 205:strcat(romtext, "Meldac");break; + case 206:strcat(romtext, "Pony Canyon");break; + case 207:strcat(romtext, "Sotsu Agency/Sunrise");break; + case 208:strcat(romtext, "Disco/Taito");break; + case 209:strcat(romtext, "Sofel");break; + case 210:strcat(romtext, "Quest Corp.");break; + case 211:strcat(romtext, "Sigma");break; + case 212:strcat(romtext, "Ask Kodansha Co., Ltd."); break; //Acc. ZFE + case 213:strcat(romtext, NOTKNOWN "213");break; + case 214:strcat(romtext, "Naxat");break; + case 215:strcat(romtext, NOTKNOWN "215");break; + case 216:strcat(romtext, "Capcom Co., Ltd.");break; + case 217:strcat(romtext, "Banpresto");break; + case 218:strcat(romtext, "Tomy");break; + case 219:strcat(romtext, "Acclaim");break; + case 220:strcat(romtext, NOTKNOWN "220");break; + case 221:strcat(romtext, "NCS");break; + case 222:strcat(romtext, "Human Entertainment");break; + case 223:strcat(romtext, "Altron");break; + case 224:strcat(romtext, "Jaleco");break; + case 225:strcat(romtext, NOTKNOWN "225");break; + case 226:strcat(romtext, "Yutaka");break; + case 227:strcat(romtext, NOTKNOWN "227");break; + case 228:strcat(romtext, "T&ESoft");break; + case 229:strcat(romtext, "EPOCH Co.,Ltd.");break; + case 230:strcat(romtext, NOTKNOWN "230");break; + case 231:strcat(romtext, "Athena");break; + case 232:strcat(romtext, "Asmik");break; + case 233:strcat(romtext, "Natsume");break; + case 234:strcat(romtext, "King Records");break; + case 235:strcat(romtext, "Atlus");break; + case 236:strcat(romtext, "Sony Music Entertainment");break; + case 237:strcat(romtext, NOTKNOWN "237");break; + case 238:strcat(romtext, "IGS");break; + case 239:strcat(romtext, NOTKNOWN "239");break; + case 240:strcat(romtext, NOTKNOWN "240");break; + case 241:strcat(romtext, "Motown Software");break; + case 242:strcat(romtext, "Left Field Entertainment");break; + case 243:strcat(romtext, "Beam Software");break; + case 244:strcat(romtext, "Tec Magik");break; + case 245:strcat(romtext, NOTKNOWN "245");break; + case 246:strcat(romtext, NOTKNOWN "246");break; + case 247:strcat(romtext, NOTKNOWN "247");break; + case 248:strcat(romtext, NOTKNOWN "248");break; + case 249:strcat(romtext, "Cybersoft");break; + case 250:strcat(romtext, NOTKNOWN "250");break; + case 251:strcat(romtext, "Psygnosis"); break; //Acc. ZFE + case 252:strcat(romtext, NOTKNOWN "252");break; + case 253:strcat(romtext, NOTKNOWN "253");break; + case 254:strcat(romtext, "Davidson"); break; //Acc. uCON64 + case 255:strcat(romtext, NOTKNOWN "255");break; + default:strcat(romtext, NOTKNOWN);break; + } + + strcat(romtext, "\r\nROM Version: "); + sprintf(temp, "1.%d", (Memory.HiROM)?Memory.ROM[0x0FFDB]:Memory.ROM[0x7FDB]); + strcat(romtext, temp); + strcat(romtext, "\r\nRegion: "); + switch(Memory.ROMRegion) + { + case 0: + strcat(romtext, "Japan"); + break; + case 1: + strcat(romtext, "USA/Canada"); + break; + case 2: + strcat(romtext, "Oceania, Europe, and Asia"); + break; + case 3: + strcat(romtext, "Sweden"); + break; + case 4: + strcat(romtext, "Finland"); + break; + case 5: + strcat(romtext, "Denmark"); + break; + case 6: + strcat(romtext, "France"); + break; + case 7: + strcat(romtext, "Holland"); + break; + case 8: + strcat(romtext, "Spain"); + break; + case 9: + strcat(romtext, "Germany, Austria, and Switzerland"); + break; + case 10: + strcat(romtext, "Italy"); + break; + case 11: + strcat(romtext, "Hong Kong and China"); + break; + case 12: + strcat(romtext, "Indonesia"); + break; + case 13: + strcat(romtext, "South Korea"); + break; + case 14:strcat(romtext, "Unknown region 14");break; + default:strcat(romtext, "Unknown region 15");break; + } + SendDlgItemMessage(hDlg, IDC_ROM_DATA, WM_SETTEXT, 0, (LPARAM)romtext); + return true; + break; + } + case WM_CTLCOLORSTATIC: + + if(GUI.InfoColor!=WIN32_WHITE) + { + SetTextColor((HDC)wParam, GUI.InfoColor); + SetBkColor((HDC)wParam, RGB(0,0,0)); + } + return true;break; + case WM_PAINT: + { + PAINTSTRUCT ps; + BeginPaint (hDlg, &ps); + if(hBmp) + { + BITMAP bmp; + ZeroMemory(&bmp, sizeof(BITMAP)); + RECT r; + GetClientRect(hDlg, &r); + HDC hdc=GetDC(hDlg); + HDC hDCbmp=CreateCompatibleDC(hdc); + GetObject(hBmp, sizeof(BITMAP), &bmp); + HBITMAP hOldBmp=(HBITMAP)SelectObject(hDCbmp, hBmp); + StretchBlt(hdc, 0,0,r.right,r.bottom,hDCbmp,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY); + SelectObject(hDCbmp, hOldBmp); + DeleteDC(hDCbmp); + ReleaseDC(hDlg, hdc); + } + + EndPaint (hDlg, &ps); + } + return true; + + case WM_COMMAND: + { + switch(wParam) + { + case IDOK: + case IDCANCEL: + EndDialog(hDlg, 0); + if(hBmp) + { + DeleteObject(hBmp); + hBmp=NULL; + } + return true; + break; + default: return false; break; + } + } + default:return false; + } +} + +int CALLBACK DlgAboutProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static HBITMAP hBmp; + + switch(msg) + { + case WM_INITDIALOG: + { + TCHAR buf[512];//find better way of dealing. + sprintf(buf,TEXT(DISCLAIMER_TEXT),VERSION); + hBmp=(HBITMAP)LoadImage(NULL, TEXT("RedChaos1.bmp"), IMAGE_BITMAP, 0,0, LR_CREATEDIBSECTION | LR_LOADFROMFILE); + SetDlgItemText(hDlg, IDC_DISCLAIMER, buf); + SetWindowText(hDlg, TEXT("About ") TEXT(APP_NAME)); + } + return true; + case WM_PAINT: + { + PAINTSTRUCT ps; + BeginPaint (hDlg, &ps); + if(hBmp) + { + BITMAP bmp; + ZeroMemory(&bmp, sizeof(BITMAP)); + RECT r; + GetClientRect(hDlg, &r); + HDC hdc=GetDC(hDlg); + HDC hDCbmp=CreateCompatibleDC(hdc); + GetObject(hBmp, sizeof(BITMAP), &bmp); + HBITMAP hOldBmp=(HBITMAP)SelectObject(hDCbmp, hBmp); + StretchBlt(hdc, 0,0,r.right,r.bottom,hDCbmp,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY); + SelectObject(hDCbmp, hOldBmp); + DeleteDC(hDCbmp); + ReleaseDC(hDlg, hdc); + } + + EndPaint (hDlg, &ps); + } + return true; + case WM_COMMAND: + { + switch(wParam) + { + case IDOK: + case IDCANCEL: + EndDialog(hDlg, 0); + if(hBmp) + { + DeleteObject(hBmp); + hBmp=NULL; + } + return true; + break; + default: return false; break; + } + } + default:return false; + } +} +int CALLBACK DlgEmulatorProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static HBITMAP hBmp; + switch(msg) + { + case WM_INITDIALOG: + { + hBmp=(HBITMAP)LoadImage(NULL, TEXT("MKendora.bmp"), IMAGE_BITMAP, 0,0, LR_CREATEDIBSECTION | LR_LOADFROMFILE); + SetWindowText(hDlg, TEXT(EMUSET_TITLE)); + SetDlgItemText(hDlg, IDC_TOGGLE_TURBO, EMUSET_TOGGLE_TURBO); + SetDlgItemText(hDlg, IDC_LABEL_FREEZE, EMUSET_LABEL_FREEZE); + SetDlgItemText(hDlg, IDOK, BUTTON_OK); + SetDlgItemText(hDlg, IDCANCEL, BUTTON_CANCEL); + SetDlgItemText(hDlg, IDC_LABEL_ASRAM, EMUSET_LABEL_ASRAM); + SetDlgItemText(hDlg, IDC_LABEL_ASRAM_TEXT, EMUSET_LABEL_ASRAM_TEXT); + SetDlgItemText(hDlg, IDC_LABEL_SMAX, EMUSET_LABEL_SMAX); + SetDlgItemText(hDlg, IDC_LABEL_SMAX_TEXT, EMUSET_LABEL_SMAX_TEXT); + SetDlgItemText(hDlg, IDC_LABEL_STURBO_TEXT, EMUSET_LABEL_STURBO_TEXT); + SetDlgItemText(hDlg, IDC_LABEL_STURBO, EMUSET_LABEL_STURBO); + SetDlgItemText(hDlg, IDC_BROWSE, EMUSET_BROWSE); + SetDlgItemText(hDlg, IDC_FREEZE_FOLDER, GUI.FreezeFileDir); + SendDlgItemMessage(hDlg, IDC_SRAM_SPIN, UDM_SETRANGE, 0, MAKELPARAM((short)99, (short)0)); + SendDlgItemMessage(hDlg, IDC_SRAM_SPIN,UDM_SETPOS,0, Settings.AutoSaveDelay); + SendDlgItemMessage(hDlg, IDC_SPIN_MAX_SKIP, UDM_SETRANGE, 0, MAKELPARAM((short)59, (short)0)); + SendDlgItemMessage(hDlg, IDC_SPIN_MAX_SKIP,UDM_SETPOS,0, Settings.AutoMaxSkipFrames); + SendDlgItemMessage(hDlg, IDC_SPIN_TURBO_SKIP, UDM_SETRANGE, 0, MAKELPARAM((short)600, (short)0)); + SendDlgItemMessage(hDlg, IDC_SPIN_TURBO_SKIP,UDM_SETPOS,0, Settings.TurboSkipFrames); + CheckDlgButton(hDlg,IDC_TOGGLE_TURBO,GUI.TurboModeToggle ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hDlg,IDC_INACTIVE_PAUSE,GUI.InactivePause ? BST_CHECKED : BST_UNCHECKED); + } + case WM_PAINT: + { + PAINTSTRUCT ps; + BeginPaint (hDlg, &ps); + if(hBmp) + { + BITMAP bmp; + ZeroMemory(&bmp, sizeof(BITMAP)); + RECT r; + GetClientRect(hDlg, &r); + HDC hdc=GetDC(hDlg); + HDC hDCbmp=CreateCompatibleDC(hdc); + GetObject(hBmp, sizeof(BITMAP), &bmp); + HBITMAP hOldBmp=(HBITMAP)SelectObject(hDCbmp, hBmp); + StretchBlt(hdc, 0,0,r.right,r.bottom,hDCbmp,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY); + SelectObject(hDCbmp, hOldBmp); + DeleteDC(hDCbmp); + ReleaseDC(hDlg, hdc); + } + + EndPaint (hDlg, &ps); + } + return true; + case WM_COMMAND: + { + switch(wParam) + { + case IDC_BROWSE: + { + LPMALLOC lpm=NULL; + LPITEMIDLIST iidl=NULL; + BROWSEINFO bi; + ZeroMemory(&bi, sizeof(BROWSEINFO)); + TCHAR path[MAX_PATH]; + TCHAR title[]=TEXT("Select Freeze Folder"); + CoInitialize(NULL); + bi.hwndOwner=hDlg; + bi.pszDisplayName=path; + bi.lpszTitle=title; + iidl=SHBrowseForFolder(&bi); + SHGetPathFromIDList(iidl, path); + SHGetMalloc(&lpm); + lpm->Free(iidl); + CoUninitialize(); + SetDlgItemText(hDlg, IDC_FREEZE_FOLDER, path); + } + break; + case IDOK: + GetDlgItemText(hDlg, IDC_FREEZE_FOLDER,GUI.FreezeFileDir, MAX_PATH); + GUI.TurboModeToggle = (BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_TOGGLE_TURBO)); + GUI.InactivePause = (BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_INACTIVE_PAUSE)); + + Settings.TurboSkipFrames=SendDlgItemMessage(hDlg, IDC_SPIN_TURBO_SKIP, UDM_GETPOS, 0,0); + Settings.AutoMaxSkipFrames=SendDlgItemMessage(hDlg, IDC_SPIN_MAX_SKIP, UDM_GETPOS, 0,0); + Settings.AutoSaveDelay=SendDlgItemMessage(hDlg, IDC_SRAM_SPIN, UDM_GETPOS, 0,0); + case IDCANCEL: + EndDialog(hDlg, 0); + if(hBmp) + { + DeleteObject(hBmp); + hBmp=NULL; + } + return true; + break; + default: return false; break; + } + } + default:return false; + } +} + +#define SKIP_FLOPPY + +bool ExtensionIsValid(const TCHAR * filename) +{ + ExtList* curr=valid_ext; + while(curr!=NULL) + { + if(curr->extension==NULL) + { + if(NULL==strstr(filename, TEXT("."))) + return true; + } + else if(filename[(strlen(filename)-1)-strlen(curr->extension)]=='.') + { + if(0==_strnicmp(&filename[(strlen(filename))-strlen(curr->extension)], + curr->extension, strlen(curr->extension))) + return true; + } + curr=curr->next; + } + return false; +} + +bool IsCompressed(TCHAR* filename) +{ + ExtList* curr=valid_ext; + while(curr!=NULL) + { + if(curr->extension==NULL) + { + if(NULL==strstr(filename, TEXT("."))) + return curr->compressed; + } + else if(filename[(strlen(filename)-1)-strlen(curr->extension)]=='.') + { + if(0==_strnicmp(&filename[(strlen(filename))-strlen(curr->extension)], + curr->extension, strlen(curr->extension))) + return curr->compressed; + } + curr=curr->next; + } + return false; +} + +inline bool AllASCII(char *b, int size) +{ + for (int i = 0; i < size; i++) + { + if (b[i] < 32 || b[i] > 126) + { + return(false); + } + } + return(true); +} + +inline int InfoScore(char *Buffer) +{ + int score = 0; + if (Buffer[28] + (Buffer[29] << 8) + + Buffer[30] + (Buffer[31] << 8) == 0xFFFF) + { score += 3; } + + if (Buffer[26] == 0x33) { score += 2; } + if ((Buffer[21] & 0xf) < 4) { score += 2; } + if (!(Buffer[61] & 0x80)) { score -= 4; } + if ((1 << (Buffer[23] - 7)) > 48) { score -= 1; } + if (Buffer[25] < 14) { score += 1; } + if (!AllASCII(Buffer, 20)) { score -= 1; } + + return (score); +} + +inline unsigned short sum(unsigned char *array, unsigned int size = HEADER_SIZE) +{ + register unsigned short theSum = 0; + for (register unsigned int i = 0; i < size; i++) + { + theSum += array[i]; + } + return(theSum); +} + +void rominfo(const TCHAR *filename, TCHAR *namebuffer, TCHAR *sizebuffer) +{ + struct stat filestats; + stat(filename, &filestats); + + int HeaderSize = 0; + + if (filestats.st_size >= 0x8000) + { + ifstream ROMFile(filename, ios::in | ios::binary); + if (ROMFile) + { + int HasHeadScore = 0, NoHeadScore = 0, + HeadRemain = filestats.st_size & 0x7FFF; + + switch(HeadRemain) + { + case 0: + NoHeadScore += 3; + break; + + case HEADER_SIZE: + HasHeadScore += 2; + break; + } + + unsigned char HeaderBuffer[HEADER_SIZE]; + ROMFile.read((char *)HeaderBuffer, HEADER_SIZE); + + if (sum(HeaderBuffer) < 2500) { HasHeadScore += 2; } + + //SMC/SWC Header + if (HeaderBuffer[8] == 0xAA && + HeaderBuffer[9] == 0xBB && + HeaderBuffer[10]== 4) + { HasHeadScore += 3; } + //FIG Header + else if ((HeaderBuffer[4] == 0x77 && HeaderBuffer[5] == 0x83) || + (HeaderBuffer[4] == 0xDD && HeaderBuffer[5] == 0x82) || + (HeaderBuffer[4] == 0xDD && HeaderBuffer[5] == 2) || + (HeaderBuffer[4] == 0xF7 && HeaderBuffer[5] == 0x83) || + (HeaderBuffer[4] == 0xFD && HeaderBuffer[5] == 0x82) || + (HeaderBuffer[4] == 0x00 && HeaderBuffer[5] == 0x80) || + (HeaderBuffer[4] == 0x47 && HeaderBuffer[5] == 0x83) || + (HeaderBuffer[4] == 0x11 && HeaderBuffer[5] == 2)) + { HasHeadScore += 2; } + else if (!strncmp("GAME DOCTOR SF 3", (char *)HeaderBuffer, 16)) + { HasHeadScore += 5; } + + HeaderSize = HasHeadScore > NoHeadScore ? HEADER_SIZE : 0; + + bool EHi = false; + if (filestats.st_size - HeaderSize >= 0x500000) + { + ROMFile.seekg(0x40FFC0 + HeaderSize, ios::beg); + ROMFile.read((char *)HeaderBuffer, INFO_LEN); + if (InfoScore((char *)HeaderBuffer) > 1) + { + EHi = true; + strncpy(namebuffer, (char *)HeaderBuffer, 21); + } + } + + if (!EHi) + { + if (filestats.st_size - HeaderSize >= 0x10000) + { + char LoHead[INFO_LEN], HiHead[INFO_LEN]; + + ROMFile.seekg(0x7FC0 + HeaderSize, ios::beg); + ROMFile.read(LoHead, INFO_LEN); + int LoScore = InfoScore(LoHead); + + ROMFile.seekg(0xFFC0 + HeaderSize, ios::beg); + ROMFile.read(HiHead, INFO_LEN); + int HiScore = InfoScore(HiHead); + + strncpy(namebuffer, LoScore > HiScore ? LoHead : HiHead, 21); + + if (filestats.st_size - HeaderSize >= 0x20000) + { + ROMFile.seekg((filestats.st_size - HeaderSize) / 2 + 0x7FC0 + HeaderSize, ios::beg); + ROMFile.read(LoHead, INFO_LEN); + int IntLScore = InfoScore(LoHead) / 2; + + if (IntLScore > LoScore && IntLScore > HiScore) + { + strncpy(namebuffer, LoHead, 21); + } + } + } + else //ROM only has one block + { + ROMFile.seekg(0x7FC0 + HeaderSize, ios::beg); + ROMFile.read(namebuffer, 21); + } + } + ROMFile.close(); + } + else //Couldn't open file + { + strcpy(namebuffer, "Can't Open File "); + } + } + else //Smaller than a block + { + strcpy(namebuffer, "Not a ROM "); + } + + double MBitD = (double)(filestats.st_size - HeaderSize) / 0x100000 * 8; + int MBitI = (int)MBitD; + if(0!=(MBitI / 10)) + { + sizebuffer[0] = MBitI / 10 + '0'; + sizebuffer[1] = MBitI % 10 + '0'; + sizebuffer[2] = '.'; + sizebuffer[3] = (char)((MBitD - MBitI) * 10) + '0'; + sizebuffer[4] = (char)((int)((MBitD - MBitI) * 100) % 10) + '0'; + sizebuffer[5] = ' '; + sizebuffer[6] = 'M'; + sizebuffer[7] = 'b'; + sizebuffer[8] = 'i'; + sizebuffer[9] = 't'; + sizebuffer[10] = '\0'; + namebuffer[21] = '\0'; + } + else + { + sizebuffer[0] = MBitI % 10 + '0'; + sizebuffer[1] = '.'; + sizebuffer[2] = (char)((MBitD - MBitI) * 10) + '0'; + sizebuffer[3] = (char)((int)((MBitD - MBitI) * 100) % 10) + '0'; + sizebuffer[4] = ' '; + sizebuffer[5] = 'M'; + sizebuffer[6] = 'b'; + sizebuffer[7] = 'i'; + sizebuffer[8] = 't'; + sizebuffer[9] = '\0'; + namebuffer[21] = '\0'; + } +} + +void GetPathFromTree( HWND hDlg, UINT tree, TCHAR* selected, HTREEITEM hItem) +{ + TVITEM tv; + TCHAR temp[MAX_PATH]; + temp[0]='\0'; + ZeroMemory(&tv, sizeof(TVITEM)); + HTREEITEM hTreeTemp=hItem; + + if(tv.iImage==4) + { + tv.mask=TVIF_HANDLE|TVIF_IMAGE; + tv.hItem=hTreeTemp; + tv.iImage=3; + TreeView_SetItem(GetDlgItem(hDlg, tree),&tv); + ZeroMemory(&tv, sizeof(TVITEM)); + } + + tv.mask=TVIF_HANDLE|TVIF_TEXT; + tv.hItem=hTreeTemp; + tv.pszText=temp; + tv.cchTextMax =MAX_PATH; + TreeView_GetItem(GetDlgItem(hDlg, tree), &tv); + + sprintf(selected, TEXT("%s"), temp); + while(TreeView_GetParent(GetDlgItem(hDlg, tree), hTreeTemp)) + { + temp[0]='\0'; + hTreeTemp=TreeView_GetParent(GetDlgItem(hDlg, tree), hTreeTemp); + tv.mask=TVIF_HANDLE|TVIF_TEXT; + tv.hItem=hTreeTemp; + tv.pszText=temp; + tv.cchTextMax =MAX_PATH; + TreeView_GetItem(GetDlgItem(hDlg, tree), &tv); + sprintf(temp, TEXT("%s\\%s"),temp, selected); + strcpy(selected, temp); + } +} + +typedef struct RomDataCacheNode +{ + char* fname; + char* rname; + char* rmbits; + struct RomDataCacheNode* next; +} RomDataList; + +void ClearCacheList(RomDataList* rdl) +{ + RomDataList* temp=rdl; + RomDataList* temp2=NULL; + if(rdl==NULL) + return; + do + { + temp2=temp->next; + if(temp->fname) + delete [] temp->fname; + if(temp->rmbits) + delete [] temp->rmbits; + if(temp->rname) + delete [] temp->rname; + delete temp; + temp=temp2; + } + while(temp!=NULL); +} + + +void ExpandDir(char * selected, HTREEITEM hParent, HWND hDlg) +{ + TCHAR temp[MAX_PATH]; + WIN32_FIND_DATA wfd; + ZeroMemory(&wfd, sizeof(WIN32_FIND_DATA)); + strcat(selected, TEXT("\\*")); + HANDLE hFind=FindFirstFile(selected,&wfd); + selected[(strlen(selected)-1)]='\0'; + + do + { + if(wfd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) + { + if(strcmp(wfd.cFileName, TEXT("."))&&strcmp(wfd.cFileName, TEXT(".."))) + { + //skip these, add the rest. + TV_INSERTSTRUCT tvis; + ZeroMemory(&tvis, sizeof(TV_INSERTSTRUCT)); + tvis.hParent=hParent; + tvis.hInsertAfter=TVI_SORT; + tvis.item.mask = TVIF_STATE | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE; + tvis.item.pszText=wfd.cFileName; + tvis.item.cchTextMax=MAX_PATH; + tvis.item.iImage=4; + tvis.item.iSelectedImage=3; + HTREEITEM hNewTree=TreeView_InsertItem(GetDlgItem(hDlg, IDC_ROM_DIR),&tvis); + + strcpy(temp, selected); + strcat(temp, wfd.cFileName); + strcat(temp, TEXT("\\*")); + + bool subdir=false; + WIN32_FIND_DATA wfd2; + ZeroMemory(&wfd2, sizeof(WIN32_FIND_DATA)); + HANDLE hFind2=FindFirstFile(temp,&wfd2); + do + { + if(wfd2.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) + { + if(strcmp(wfd2.cFileName, TEXT("."))&&strcmp(wfd2.cFileName, TEXT(".."))) + { + subdir=true; + } + } + } + while(FindNextFile(hFind2, &wfd2)&&!subdir); + + if(subdir) + { + TV_INSERTSTRUCT tvis; + ZeroMemory(&tvis, sizeof(TV_INSERTSTRUCT)); + tvis.hParent=hNewTree; + tvis.hInsertAfter=TVI_SORT; + TreeView_InsertItem(GetDlgItem(hDlg, IDC_ROM_DIR),&tvis); + + } + FindClose(hFind2); + + } + } + } + while(FindNextFile(hFind, &wfd)); + + FindClose(hFind); + //scan for folders +} + + +/* +void OnOdfinditem(NMHDR* pNMHDR, LRESULT* pResult) +{ + NMLVFINDITEM* pFindInfo = (NMLVFINDITEM*)pNMHDR; + LVFINDINFO FindItem = pFindInfo->lvfi; + + int i; + if(FindItem.flags & LVFI_STRING) + { + TCHAR chKeyL = FindItem.psz[0]; + TCHAR chKeyH = _toupper(FindItem.psz[0]);; + + // Search to end. + for( i = pFindInfo->iStart; i < m_LabelCount; i++ ) + { + if( ( chKeyL == m_arLabels[i].m_strText[0] ) + || ( chKeyH == m_arLabels[i].m_strText[0] ) + ) + { + *pResult = i; + return; + } + } + + // Search from 0 to start. + for( i = 0; i < pFindInfo->iStart; i++ ) + { + if( ( chKeyL == m_arLabels[i].m_strText[0] ) + || ( chKeyH == m_arLabels[i].m_strText[0] ) + ) + { + *pResult = i; + return; + } + } + } + + *pResult = -1; // Default action. +} +*/ + +void ListFilesFromFolder(HWND hDlg, RomDataList** prdl) +{ + RomDataList* rdl= *prdl; + RomDataList* current=NULL; + int count=0; + TVITEM tv; + TCHAR temp[MAX_PATH]; + TCHAR selected[MAX_PATH]; + temp[0]='\0'; + ZeroMemory(&tv, sizeof(TVITEM)); + HTREEITEM hTreeItem=TreeView_GetSelection(GetDlgItem(hDlg, IDC_ROM_DIR)); + + GetPathFromTree(hDlg, IDC_ROM_DIR, selected, hTreeItem); + + SendDlgItemMessage(hDlg, IDC_ROMLIST, WM_SETREDRAW, FALSE, 0); + ListView_DeleteAllItems(GetDlgItem(hDlg, IDC_ROMLIST)); + ClearCacheList(rdl); + rdl=NULL; + //Add items here. + + WIN32_FIND_DATA wfd; + ZeroMemory(&wfd, sizeof(WIN32_FIND_DATA)); + + strcat(selected, TEXT("\\*")); + + HANDLE hFind=FindFirstFile(selected, &wfd); + selected[(strlen(selected)-1)]='\0'; + do + { + if(wfd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) + continue; + if(ExtensionIsValid(wfd.cFileName)) + { + RomDataList* newitem=new RomDataList; + ZeroMemory(newitem, sizeof(RomDataList)); + newitem->fname=new char[1+strlen(wfd.cFileName)]; + strcpy(newitem->fname, wfd.cFileName); + count++; + + if(IsCompressed(wfd.cFileName)) + { + newitem->rname=new char[14]; + strcpy(newitem->rname, "Not Available"); + newitem->rmbits=new char[8]; + strcpy(newitem->rmbits, "? Mbits"); + } + + if(!rdl) + rdl=newitem; + else + { + if(0>stricmp(newitem->fname,rdl->fname)) + { + newitem->next=rdl; + rdl=newitem; + } + else + { + RomDataList* trail=rdl; + current=rdl->next; + while(current!=NULL&&0fname,current->fname)) + { + trail=current; + current=current->next; + } + newitem->next=current; + trail->next=newitem; + } + } + } + } + while(FindNextFile(hFind, &wfd)); + + FindClose(hFind); + + SendDlgItemMessage(hDlg, IDC_ROMLIST, WM_SETREDRAW, TRUE, 0); + *prdl=rdl; + ListView_SetItemCount (GetDlgItem(hDlg, IDC_ROMLIST), count); + ListView_SetItemState (GetDlgItem(hDlg,IDC_ROMLIST), 0, LVIS_SELECTED|LVIS_FOCUSED,LVIS_FOCUSED|LVIS_SELECTED); +} + + +int CALLBACK DlgOpenROMProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static HBITMAP hBmp; + int rv=0; + static HWND hSplit; + static HIMAGELIST hIcons; + static TCHAR *filename; + static RomDataList* rdl; + switch(msg) + { + case WM_INITDIALOG: + { + hBmp=(HBITMAP)LoadImage(NULL, TEXT("Koji.bmp"), IMAGE_BITMAP, 0,0, LR_CREATEDIBSECTION | LR_LOADFROMFILE); + filename=(TCHAR*)lParam; + RECT treeRect; + RECT listRect; + WNDCLASSEX wcex; + TCHAR tempclassname[]=TEXT("S9xSplitter"); + ZeroMemory(&wcex, sizeof(WNDCLASSEX)); + wcex.cbSize=sizeof(WNDCLASSEX); + wcex.hInstance=g_hInst; + wcex.lpfnWndProc=DlgChildSplitProc; + wcex.lpszClassName=tempclassname; + wcex.hbrBackground=(HBRUSH)GetStockObject(LTGRAY_BRUSH); + wcex.hCursor=LoadCursor(NULL, IDC_SIZEWE); +/// wcex.hCursor=LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZEWE)); +/// ATOM aSplitter=RegisterClassEx(&wcex); + GetWindowRect(GetDlgItem(hDlg, IDC_ROM_DIR), &treeRect); + GetWindowRect(GetDlgItem(hDlg, IDC_ROMLIST), &listRect); + POINT p; + + ListView_SetExtendedListViewStyle(GetDlgItem(hDlg, IDC_ROMLIST), LVS_EX_FULLROWSELECT); + + p.x=treeRect.right; + p.y=treeRect.top; + ScreenToClient(hDlg, &p); + hSplit=CreateWindow(TEXT("S9xSplitter"), TEXT(""),WS_CHILD|WS_VISIBLE , p.x, p.y, listRect.left-treeRect.right , listRect.bottom-listRect.top, hDlg,NULL, g_hInst,0); + + LVCOLUMN col; + TCHAR temp[32]; + strcpy(temp,TEXT("File")); + ZeroMemory(&col, sizeof(LVCOLUMN)); + col.mask=LVCF_FMT|LVCF_ORDER|LVCF_TEXT|LVCF_WIDTH; + col.fmt=LVCFMT_LEFT; + col.iOrder=0; + col.cx=122; + col.cchTextMax=5; + col.pszText=temp; + + ListView_InsertColumn(GetDlgItem(hDlg,IDC_ROMLIST), 0, &col); + + strcpy(temp,TEXT("Description")); + ZeroMemory(&col, sizeof(LVCOLUMN)); + col.mask=LVCF_FMT|LVCF_ORDER|LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM; + col.fmt=LVCFMT_LEFT; + col.iOrder=1; + col.cx=150; + col.cchTextMax=32; + col.pszText=temp; + col.iSubItem=1; + + ListView_InsertColumn(GetDlgItem(hDlg,IDC_ROMLIST), 1, &col); + + + strcpy(temp,TEXT("Size")); + ZeroMemory(&col, sizeof(LVCOLUMN)); + col.mask=LVCF_FMT|LVCF_ORDER|LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM; + col.fmt=LVCFMT_LEFT; + col.iOrder=2; + col.cx=67; + col.cchTextMax=32; + col.pszText=temp; + col.iSubItem=2; + + ListView_InsertColumn(GetDlgItem(hDlg,IDC_ROMLIST), 2, &col); + + + SendDlgItemMessage(hDlg, IDC_MEM_TYPE,CB_INSERTSTRING,0,(LPARAM)TEXT("Auto-Detect")); + SendDlgItemMessage(hDlg, IDC_MEM_TYPE,CB_INSERTSTRING,1,(LPARAM)TEXT("Force HiROM")); + SendDlgItemMessage(hDlg, IDC_MEM_TYPE,CB_INSERTSTRING,2,(LPARAM)TEXT("Force LoROM")); + SendDlgItemMessage(hDlg, IDC_MEM_TYPE,CB_SETCURSEL,0,0); + + SendDlgItemMessage(hDlg, IDC_VIDEO_MODE,CB_INSERTSTRING,0,(LPARAM)TEXT("Auto-Detect")); + SendDlgItemMessage(hDlg, IDC_VIDEO_MODE,CB_INSERTSTRING,1,(LPARAM)TEXT("Force PAL")); + SendDlgItemMessage(hDlg, IDC_VIDEO_MODE,CB_INSERTSTRING,2,(LPARAM)TEXT("Force NTSC")); + SendDlgItemMessage(hDlg, IDC_VIDEO_MODE,CB_SETCURSEL,0,0); + + SendDlgItemMessage(hDlg, IDC_HEADER,CB_INSERTSTRING,0,(LPARAM)TEXT("Auto-Detect")); + SendDlgItemMessage(hDlg, IDC_HEADER,CB_INSERTSTRING,1,(LPARAM)TEXT("Force Header")); + SendDlgItemMessage(hDlg, IDC_HEADER,CB_INSERTSTRING,2,(LPARAM)TEXT("Force No Header")); + SendDlgItemMessage(hDlg, IDC_HEADER,CB_SETCURSEL,0,0); + + SendDlgItemMessage(hDlg, IDC_INTERLEAVE,CB_INSERTSTRING,0,(LPARAM)TEXT("Auto-Detect")); + SendDlgItemMessage(hDlg, IDC_INTERLEAVE,CB_INSERTSTRING,1,(LPARAM)TEXT("Force not interleaved")); + SendDlgItemMessage(hDlg, IDC_INTERLEAVE,CB_INSERTSTRING,2,(LPARAM)TEXT("Force mode 1")); + SendDlgItemMessage(hDlg, IDC_INTERLEAVE,CB_INSERTSTRING,3,(LPARAM)TEXT("Force mode 2")); + SendDlgItemMessage(hDlg, IDC_INTERLEAVE,CB_INSERTSTRING,4,(LPARAM)TEXT("Force GD24")); + SendDlgItemMessage(hDlg, IDC_INTERLEAVE,CB_SETCURSEL,0,0); + + hIcons=ImageList_Create(16,16,ILC_COLOR,5, 8); + + HANDLE hBitmap; + hBitmap=LoadImage(g_hInst, MAKEINTRESOURCE(IDB_HARDDRIVE), IMAGE_BITMAP, 0,0, LR_DEFAULTCOLOR); + ImageList_Add(hIcons, (HBITMAP)hBitmap, NULL); + DeleteObject(hBitmap); + + hBitmap=LoadImage(g_hInst, MAKEINTRESOURCE(IDB_CDDRIVE), IMAGE_BITMAP, 0,0, LR_DEFAULTCOLOR); + ImageList_Add(hIcons, (HBITMAP)hBitmap, NULL); + DeleteObject(hBitmap); + + hBitmap=LoadImage(g_hInst, MAKEINTRESOURCE(IDB_NETDRIVE), IMAGE_BITMAP, 0,0, LR_DEFAULTCOLOR); + ImageList_Add(hIcons, (HBITMAP)hBitmap, NULL); + DeleteObject(hBitmap); + + hBitmap=LoadImage(g_hInst, MAKEINTRESOURCE(IDB_OPENFOLDER), IMAGE_BITMAP, 0,0, LR_DEFAULTCOLOR); + ImageList_Add(hIcons, (HBITMAP)hBitmap, NULL); + DeleteObject(hBitmap); + + hBitmap=LoadImage(g_hInst, MAKEINTRESOURCE(IDB_CLOSEDFOLDER), IMAGE_BITMAP, 0,0, LR_DEFAULTCOLOR); + ImageList_Add(hIcons, (HBITMAP)hBitmap, NULL); + DeleteObject(hBitmap); + + TreeView_SetImageList(GetDlgItem(hDlg,IDC_ROM_DIR), hIcons, TVSIL_NORMAL); + + DWORD dw; + TCHAR buffer[MAX_PATH]; + TCHAR blah[MAX_PATH]; + long result=ERROR_SUCCESS-1; + HTREEITEM hTreeDrive=NULL; + + HKEY hKey; + char drive [_MAX_DRIVE + 1]; + strcpy (drive,"C:\\"); + + // fix the NTDLR problem and set the correct directory + if(!RegOpenKeyEx(HKEY_CURRENT_USER, MY_REG_KEY, 0, KEY_ALL_ACCESS, &hKey)) + { + HANDLE fFile; + WIN32_FIND_DATA dirinfo; + dw = MAX_PATH; + buffer[0]='\0'; + result=RegQueryValueEx(hKey, TEXT("Last Directory"), NULL, NULL, (uint8*)buffer, &dw); + RegCloseKey(hKey); + + fFile = FindFirstFile (buffer, &dirinfo); + + if ((dirinfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) + strcpy (buffer, "C:\\"); // default in case no directory was found + + FindClose (fFile); + + _splitpath (buffer, drive, NULL, NULL, NULL); + } + + DWORD driveMask=GetLogicalDrives(); +#ifndef SKIP_FLOPPY + for (int i=0;i<26;i++) +#else + for (int i=2;i<26;i++) +#endif + { + if(driveMask&(1<idFrom) + { + case IDC_ROMLIST: + { + switch(pNmh->code) + { + case LVN_ODFINDITEM: + { +// NMLVFINDITEM* pFindItem = (NMLVFINDITEM*)lParam; + // for some reason returning which item to select doesn't work... +// return 2; + } + break; + case LVN_GETDISPINFO: + { + int i, j; + RomDataList* curr=rdl; + if(rdl==NULL) + return false; + NMLVDISPINFO * nmlvdi=(NMLVDISPINFO*)lParam; + j=nmlvdi->item.iItem; + for(i=0;inext; + if(curr->rname==NULL) + { + TCHAR path[MAX_PATH]; + TCHAR buffer[32]; + TCHAR buffer2[32]; + GetPathFromTree(hDlg, IDC_ROM_DIR, path, TreeView_GetSelection(GetDlgItem(hDlg, IDC_ROM_DIR))); + strcat(path, "\\"); + strcat(path, curr->fname); + rominfo(path, buffer, buffer2); + curr->rname=new char[strlen(buffer)+1]; + strcpy(curr->rname, buffer); + curr->rmbits=new char[strlen(buffer2)+1]; + strcpy(curr->rmbits, buffer2); + } + + if(nmlvdi->item.iSubItem==0) + { + nmlvdi->item.pszText=curr->fname; + nmlvdi->item.cchTextMax=MAX_PATH; + } + if(nmlvdi->item.iSubItem==1) + { + nmlvdi->item.pszText=curr->rname; + nmlvdi->item.cchTextMax=24; + } + + if(nmlvdi->item.iSubItem==2) + { + nmlvdi->item.pszText=curr->rmbits; + nmlvdi->item.cchTextMax=11; + } + nmlvdi->item.mask=LVIF_TEXT; + } + break; + case NM_DBLCLK: + { + PostMessage(hDlg, WM_COMMAND, (WPARAM)(IDOK),(LPARAM)(NULL)); + } + default:break; + } + } + break; + case IDC_ROM_DIR: + { + switch(pNmh->code) + { + case TVN_ITEMEXPANDING: + { + TCHAR selected[MAX_PATH]; + NMTREEVIEW* nmTv=(NMTREEVIEW*)lParam; + + while(TreeView_GetChild(GetDlgItem(hDlg, IDC_ROM_DIR),nmTv->itemNew.hItem)) + { + TreeView_DeleteItem(GetDlgItem(hDlg, IDC_ROM_DIR), TreeView_GetChild(GetDlgItem(hDlg, IDC_ROM_DIR),nmTv->itemNew.hItem)); + } + + if(nmTv->action&TVE_EXPAND) + { + + GetPathFromTree(hDlg, IDC_ROM_DIR, selected,nmTv->itemNew.hItem); + ExpandDir(selected, nmTv->itemNew.hItem, hDlg); + } + else + { + TVITEM tv; + ZeroMemory(&tv, sizeof(TVITEM)); + HTREEITEM hTreeTemp=nmTv->itemNew.hItem; + + if(tv.iImage==3) + { + tv.mask=TVIF_HANDLE|TVIF_IMAGE; + tv.hItem=hTreeTemp; + tv.iImage=4; + TreeView_SetItem(GetDlgItem(hDlg, IDC_ROM_DIR),&tv); + } + + + TV_INSERTSTRUCT tvis; + ZeroMemory(&tvis, sizeof(TV_INSERTSTRUCT)); + tvis.hParent=nmTv->itemNew.hItem; + tvis.hInsertAfter=TVI_SORT; + TreeView_InsertItem(GetDlgItem(hDlg, IDC_ROM_DIR),&tvis); + + } + } + return false; + break; + case TVN_SELCHANGED: + { + ListFilesFromFolder(hDlg, &rdl); + } + default:return false; + } + } + default:return false; + } + } + default:return false; + } +} +LRESULT CALLBACK DlgChildSplitProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static bool PaintSpecial; + static short drag_x; + short temp_x; + switch(msg) + { + case WM_CREATE: + return 0; + case WM_SIZE: + return 0; + case WM_PAINT: + PAINTSTRUCT ps; + GetUpdateRect (hWnd, &ps.rcPaint, true); + ps.hdc=GetDC(hWnd); + ps.fErase=true; + BeginPaint(hWnd, &ps); + EndPaint(hWnd, &ps); + ReleaseDC(hWnd, ps.hdc); + return 0; + case WM_LBUTTONDOWN: + PaintSpecial=true; + drag_x=GET_X_LPARAM(lParam); + SetCapture(hWnd); + return 0; + case WM_LBUTTONUP: + PaintSpecial=false; + temp_x=(GET_X_LPARAM(lParam)-drag_x); + HWND hDlg,hTree,hList; + RECT treeRect; + RECT listRect; + hDlg=GetParent(hWnd); + hTree=GetDlgItem(hDlg, IDC_ROM_DIR); + hList=GetDlgItem(hDlg, IDC_ROMLIST); + GetWindowRect(hTree, &treeRect); + + POINT p; + p.x=temp_x+treeRect.right; + p.y=treeRect.top; + + GetWindowRect(hList, &listRect); + + if(p.x>(listRect.right-50)) + { + temp_x-=(p.x-(listRect.right-50)); + p.x=listRect.right-50; + } + + + ScreenToClient(hDlg, &p); + + if(p.x<50) + { + temp_x+=(short)(50-p.x); + p.x=50; + } + + + MoveWindow( hWnd, p.x, p.y, listRect.left-treeRect.right, listRect.bottom-listRect.top, FALSE); + MoveWindow(hList, p.x+(listRect.left-treeRect.right), p.y,listRect.right-listRect.left-temp_x, listRect.bottom-listRect.top, TRUE); + p.x=treeRect.left; + p.y=treeRect.top; + ScreenToClient(hDlg, &p); + MoveWindow(hTree, p.x, p.y,treeRect.right-treeRect.left+temp_x,treeRect.bottom-treeRect.top, true); + InvalidateRect(hWnd,NULL, true); + ReleaseCapture(); + return 0; + case WM_MOUSEMOVE: + if (wParam & MK_LBUTTON) + { + //move paint location + PaintSpecial=true; + temp_x=(GET_X_LPARAM(lParam)-drag_x); + hDlg=GetParent(hWnd); + hTree=GetDlgItem(hDlg, IDC_ROM_DIR); + hList=GetDlgItem(hDlg, IDC_ROMLIST); + GetWindowRect(hTree, &treeRect); + + p.x=temp_x+treeRect.right; + + p.y=treeRect.top; + GetWindowRect(hList, &listRect); + + if(p.x>(listRect.right-50)) + { + temp_x-=(p.x-(listRect.right-50)); + p.x=listRect.right-50; + } + + + ScreenToClient(hDlg, &p); + + if(p.x<50) + { + temp_x+=(short)(50-p.x); + p.x=50; + } + + MoveWindow(hWnd, p.x, p.y, listRect.left-treeRect.right, listRect.bottom-listRect.top, FALSE); + MoveWindow(hList, p.x+(listRect.left-treeRect.right), p.y,listRect.right-listRect.left-temp_x, listRect.bottom-listRect.top, TRUE); + p.x=treeRect.left; + p.y=treeRect.top; + ScreenToClient(hDlg, &p); + MoveWindow(hTree, p.x, p.y,treeRect.right-treeRect.left+temp_x,treeRect.bottom-treeRect.top, true); + InvalidateRect(hWnd,NULL, true); + } + return 0; + case WM_CAPTURECHANGED: + PaintSpecial=false; + ReleaseCapture(); + return 0; + case WM_DESTROY: + return 0; + default:return DefWindowProc(hWnd, msg, wParam, lParam); + } +} + + + + + +int CALLBACK DlgPackConfigProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static HBITMAP hBmp; + switch(msg) + { + case WM_INITDIALOG: + { + hBmp=(HBITMAP)LoadImage(NULL, TEXT("LinkHylia.bmp"), IMAGE_BITMAP, 0,0, LR_CREATEDIBSECTION | LR_LOADFROMFILE); + SetDlgItemText(hDlg, IDC_STAR_OCEAN, GUI.StarOceanPack); + SetDlgItemText(hDlg, IDC_SFA2, GUI.SFA2NTSCPack); + SetDlgItemText(hDlg, IDC_SFA2E, GUI.SFA2PALPack); + SetDlgItemText(hDlg, IDC_SJNS, GUI.SJNSPack); + SetDlgItemText(hDlg, IDC_SFZ2, GUI.SFZ2Pack); + SetDlgItemText(hDlg, IDC_MDH, GUI.MDHPack); + SetDlgItemText(hDlg, IDC_SPL4, GUI.SPL4Pack); + SetDlgItemText(hDlg, IDC_FEOEZ, GUI.FEOEZPack); + } + case WM_PAINT: + { + PAINTSTRUCT ps; + BeginPaint (hDlg, &ps); + if(hBmp) + { + BITMAP bmp; + ZeroMemory(&bmp, sizeof(BITMAP)); + RECT r; + GetClientRect(hDlg, &r); + HDC hdc=GetDC(hDlg); + HDC hDCbmp=CreateCompatibleDC(hdc); + GetObject(hBmp, sizeof(BITMAP), &bmp); + HBITMAP hOldBmp=(HBITMAP)SelectObject(hDCbmp, hBmp); + StretchBlt(hdc, 0,0,r.right,r.bottom,hDCbmp,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY); + SelectObject(hDCbmp, hOldBmp); + DeleteDC(hDCbmp); + ReleaseDC(hDlg, hdc); + } + + EndPaint (hDlg, &ps); + } + return true; + case WM_COMMAND: + { + switch(wParam) + { + case IDC_SO_BROWSE: + { + LPMALLOC lpm=NULL; + LPITEMIDLIST iidl=NULL; + BROWSEINFO bi; + ZeroMemory(&bi, sizeof(BROWSEINFO)); + char path[MAX_PATH]; + char title[]="Star Ocean Graphics Pack"; + CoInitialize(NULL); + bi.hwndOwner=hDlg; + bi.pszDisplayName=path; + bi.lpszTitle=title; + iidl=SHBrowseForFolder(&bi); + SHGetPathFromIDList(iidl, path); + SHGetMalloc(&lpm); + lpm->Free(iidl); + CoUninitialize(); + SetDlgItemText(hDlg, IDC_STAR_OCEAN, path); + } + break; + case IDC_SFA2_BROWSE: + { + LPMALLOC lpm=NULL; + LPITEMIDLIST iidl=NULL; + BROWSEINFO bi; + ZeroMemory(&bi, sizeof(BROWSEINFO)); + char path[MAX_PATH]; + char title[]="Street Fighter Alpha 2 Graphics Pack"; + CoInitialize(NULL); + bi.hwndOwner=hDlg; + bi.pszDisplayName=path; + bi.lpszTitle=title; + iidl=SHBrowseForFolder(&bi); + SHGetPathFromIDList(iidl, path); + SHGetMalloc(&lpm); + lpm->Free(iidl); + CoUninitialize(); + SetDlgItemText(hDlg, IDC_SFA2, path); + } + break; + case IDC_SFA2E_BROWSE: + { + LPMALLOC lpm=NULL; + LPITEMIDLIST iidl=NULL; + BROWSEINFO bi; + ZeroMemory(&bi, sizeof(BROWSEINFO)); + char path[MAX_PATH]; + char title[]="Street Fighter Alpha 2 Graphics Pack"; + CoInitialize(NULL); + bi.hwndOwner=hDlg; + bi.pszDisplayName=path; + bi.lpszTitle=title; + iidl=SHBrowseForFolder(&bi); + SHGetPathFromIDList(iidl, path); + SHGetMalloc(&lpm); + lpm->Free(iidl); + CoUninitialize(); + SetDlgItemText(hDlg, IDC_SFA2E, path); + } + break; + case IDC_SFZ2_BROWSE: + { + LPMALLOC lpm=NULL; + LPITEMIDLIST iidl=NULL; + BROWSEINFO bi; + ZeroMemory(&bi, sizeof(BROWSEINFO)); + char path[MAX_PATH]; + char title[]="Street Fighter Zero 2 Graphics Pack"; + CoInitialize(NULL); + bi.hwndOwner=hDlg; + bi.pszDisplayName=path; + bi.lpszTitle=title; + iidl=SHBrowseForFolder(&bi); + SHGetPathFromIDList(iidl, path); + SHGetMalloc(&lpm); + lpm->Free(iidl); + CoUninitialize(); + SetDlgItemText(hDlg, IDC_SFZ2, path); + } + break; + case IDC_FEOEZ_BROWSE: + { + LPMALLOC lpm=NULL; + LPITEMIDLIST iidl=NULL; + BROWSEINFO bi; + ZeroMemory(&bi, sizeof(BROWSEINFO)); + char path[MAX_PATH]; + char title[]="Far East of Eden Zero Graphics Pack"; + CoInitialize(NULL); + bi.hwndOwner=hDlg; + bi.pszDisplayName=path; + bi.lpszTitle=title; + iidl=SHBrowseForFolder(&bi); + SHGetPathFromIDList(iidl, path); + SHGetMalloc(&lpm); + lpm->Free(iidl); + CoUninitialize(); + SetDlgItemText(hDlg, IDC_FEOEZ, path); + } + break; + case IDC_MDH_BROWSE: + { + LPMALLOC lpm=NULL; + LPITEMIDLIST iidl=NULL; + BROWSEINFO bi; + ZeroMemory(&bi, sizeof(BROWSEINFO)); + char path[MAX_PATH]; + char title[]="Momotarou Densetsu Happy Graphics Pack"; + CoInitialize(NULL); + bi.hwndOwner=hDlg; + bi.pszDisplayName=path; + bi.lpszTitle=title; + iidl=SHBrowseForFolder(&bi); + SHGetPathFromIDList(iidl, path); + SHGetMalloc(&lpm); + lpm->Free(iidl); + CoUninitialize(); + SetDlgItemText(hDlg, IDC_MDH, path); + } + break; + case IDC_FEOEZ_SJNS_BROWSE: + { + LPMALLOC lpm=NULL; + LPITEMIDLIST iidl=NULL; + BROWSEINFO bi; + ZeroMemory(&bi, sizeof(BROWSEINFO)); + char path[MAX_PATH]; + char title[]="FEOEZ - Shounen Jump no Shou Graphics Pack"; + CoInitialize(NULL); + bi.hwndOwner=hDlg; + bi.pszDisplayName=path; + bi.lpszTitle=title; + iidl=SHBrowseForFolder(&bi); + SHGetPathFromIDList(iidl, path); + SHGetMalloc(&lpm); + lpm->Free(iidl); + CoUninitialize(); + SetDlgItemText(hDlg, IDC_SJNS, path); + } + break; + case IDC_SPL4_BROWSE: + { + LPMALLOC lpm=NULL; + LPITEMIDLIST iidl=NULL; + BROWSEINFO bi; + ZeroMemory(&bi, sizeof(BROWSEINFO)); + char path[MAX_PATH]; + char title[]="FEOEZ - Shounen Jump no Shou Graphics Pack"; + CoInitialize(NULL); + bi.hwndOwner=hDlg; + bi.pszDisplayName=path; + bi.lpszTitle=title; + iidl=SHBrowseForFolder(&bi); + SHGetPathFromIDList(iidl, path); + SHGetMalloc(&lpm); + lpm->Free(iidl); + CoUninitialize(); + SetDlgItemText(hDlg, IDC_SPL4, path); + } + break; + case IDOK: + GetDlgItemText(hDlg, IDC_STAR_OCEAN, GUI.StarOceanPack, MAX_PATH); + GetDlgItemText(hDlg, IDC_SFA2, GUI.SFA2NTSCPack, MAX_PATH); + GetDlgItemText(hDlg, IDC_SPL4, GUI.SPL4Pack, MAX_PATH); + GetDlgItemText(hDlg, IDC_SJNS, GUI.SJNSPack, MAX_PATH); + GetDlgItemText(hDlg, IDC_SFZ2, GUI.SFZ2Pack, MAX_PATH); + GetDlgItemText(hDlg, IDC_SFA2E, GUI.SFA2PALPack, MAX_PATH); + GetDlgItemText(hDlg, IDC_MDH, GUI.MDHPack, MAX_PATH); + GetDlgItemText(hDlg, IDC_FEOEZ, GUI.FEOEZPack, MAX_PATH); + case IDCANCEL: + if(hBmp) + { + DeleteObject(hBmp); + hBmp=NULL; + } + EndDialog(hDlg, 0); + return true; + break; + default: return false; break; + } + } + default:return false; + } +} + +extern "C" +{ + char*osd_GetPackDir() + { + static char filename[MAX_PATH]; + memset(filename, 0, MAX_PATH); + + if(strlen(GUI.FreezeFileDir)!=0) + strcpy (filename, GUI.FreezeFileDir); + else + { + char dir [_MAX_DIR + 1]; + char drive [_MAX_DRIVE + 1]; + char name [_MAX_FNAME + 1]; + char ext [_MAX_EXT + 1]; + _splitpath(Memory.ROMFilename,drive, dir, name, ext); + _makepath(filename,drive, dir, NULL, NULL); + } + + if(!strncmp((char*)&Memory.ROM [0xffc0], "SUPER POWER LEAG 4 ", 21)) + { + if(strlen(GUI.SPL4Pack)) + return GUI.SPL4Pack; + else strcat(filename, "\\SPL4-SP7"); + } + else if(!strncmp((char*)&Memory.ROM [0xffc0], "MOMOTETSU HAPPY ",21)) + { + if(strlen(GUI.MDHPack)) + return GUI.MDHPack; + else strcat(filename, "\\SMHT-SP7"); + } + else if(!strncmp((char*)&Memory.ROM [0xffc0], "HU TENGAI MAKYO ZERO ", 21)) + { + if(strlen(GUI.FEOEZPack)) + return GUI.FEOEZPack; + else strcat(filename, "\\FEOEZSP7"); + } + else if(!strncmp((char*)&Memory.ROM [0xffc0], "JUMP TENGAIMAKYO ZERO",21)) + { + if(strlen(GUI.SJNSPack)) + return GUI.SJNSPack; + else strcat(filename, "\\SJUMPSP7"); + } + else strcat(filename, "\\MISC-SP7"); + return filename; + } +} +#ifdef NETPLAY_SUPPORT +int CALLBACK DlgNetConnect(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static HBITMAP hBmp; + HKEY hKey; + char defPort[5]; + char portTemp[5]; + char temp[100]; + char temp2[5]; + static char* hostname; + unsigned long cbData; + static int i; + if(Settings.Port==0) + { + _itoa(1996,defPort,10); + } + else + { + _itoa(Settings.Port,defPort,10); + } + + WORD chkLength; + if(RegCreateKeyEx(HKEY_CURRENT_USER,MY_REG_KEY "\\1.x\\NetPlayServerHistory",0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS, NULL, &hKey,NULL) == ERROR_SUCCESS){} + + switch (msg) + { + case WM_INITDIALOG: + SetWindowText(hDlg,NPCON_TITLE); + SetDlgItemText(hDlg,IDC_LABEL_SERVERADDY,NPCON_LABEL_SERVERADDY); + SetDlgItemText(hDlg,IDC_LABEL_PORTNUM,NPCON_LABEL_PORTNUM); + SetDlgItemText(hDlg,IDC_CLEARHISTORY, NPCON_CLEARHISTORY); + SetDlgItemText(hDlg,IDOK,BUTTON_OK); + SetDlgItemText(hDlg,IDCANCEL,BUTTON_CANCEL); + hBmp=(HBITMAP)LoadImage(NULL, TEXT("Overload.bmp"), IMAGE_BITMAP, 0,0, LR_CREATEDIBSECTION | LR_LOADFROMFILE); + hostname = (char *)lParam; + if(RegOpenKeyEx(HKEY_CURRENT_USER, + MY_REG_KEY "\\1.x\\NetPlayServerHistory", + 0,KEY_READ, &hKey)==ERROR_SUCCESS) + { + i=-1; + sprintf(temp,"%d",i); + do + //while(RegQueryValueEx(hKey,temp,0,NULL,NULL,NULL)==ERROR_SUCCESS) + { + //MessageBox(hDlg,temp,"Caption",MB_OK); + //MessageBox(hDlg,temp,"Caption",MB_OK); + i++; + sprintf(temp,"%d",i); + }while(RegQueryValueEx(hKey,temp,0,NULL,NULL,NULL)==ERROR_SUCCESS); + //MessageBox(hDlg,temp,"Caption",MB_OK); + //i--; + int j; + for(j=0;j65535||atoi(portTemp)<1024) + { + MessageBox(hDlg,"Port Number needs to be between 1024 and 65535","Error",MB_OK); + break; + } + else + { + Settings.Port = atoi(portTemp); + + } + //chkLength = (WORD) SendDlgItemMessage(hDlg,IDC_HOSTNAME,EM_LINELENGTH,0,0); + //if(chkLength > 0) + //{ + //SendDlgItemMessage(hDlg,IDC_HOSTNAME,EM_GETLINE,0,(LPARAM)hostname); + SendDlgItemMessage(hDlg,IDC_HOSTNAME,WM_GETTEXT,100,(LPARAM)temp); + strcpy(hostname,temp); + //MessageBox(hDlg,temp,"hola",MB_OK); + unsigned long len; + len = strlen(temp); + if(len > 0) + { + if(RegOpenKeyEx(HKEY_CURRENT_USER, + MY_REG_KEY "\\1.x\\NetPlayServerHistory", + 0,KEY_ALL_ACCESS, &hKey)==ERROR_SUCCESS) + { + + sprintf(temp2,"%d",i); + + if(RegSetValueEx(hKey,temp2,0,REG_SZ,(const unsigned char*)temp,len+1)==ERROR_SUCCESS) + { + + } + else + { + } + RegCloseKey(hKey); + } + EndDialog(hDlg,1); + if(hBmp) + { + DeleteObject(hBmp); + hBmp=NULL; + } + return TRUE; + } + else + { + EndDialog(hDlg,0); + if(hBmp) + { + DeleteObject(hBmp); + hBmp=NULL; + } + return TRUE; + } + + break; + //} + } + case IDCANCEL: + { + EndDialog(hDlg, 0); + if(hBmp) + { + DeleteObject(hBmp); + hBmp=NULL; + } + return TRUE; + } + default:break; + } + } + return FALSE; +} +#endif +void SetInfoDlgColor(unsigned char r, unsigned char g, unsigned char b) +{ + GUI.InfoColor=RGB(r,g,b); +} + +void ClearExts(void) +{ + ExtList* temp; + ExtList* curr=valid_ext; + while(curr!=NULL) + { + temp=curr->next; + if(curr->extension) + delete [] curr->extension; + delete curr; + curr=temp; + } + valid_ext=NULL; + +} + +void LoadExts(void) +{ + char buffer[MAX_PATH+2]; + if(valid_ext!=NULL) + { + ClearExts(); + } + ExtList* curr; + valid_ext=new ExtList; + curr=valid_ext; + ZeroMemory(curr, sizeof(ExtList)); + ifstream in; + +#if (((defined(_MSC_VER) && _MSC_VER >= 1300)) || defined(__MINGW32__)) + in.open("Valid.Ext", ios::in); +#else + in.open("Valid.Ext", ios::in|ios::nocreate); +#endif + if (!in.is_open()) + { + in.clear(); + MakeExtFile(); + #if (((defined(_MSC_VER) && _MSC_VER >= 1300)) || defined(__MINGW32__)) + in.open("Valid.Ext", ios::in); + #else + in.open("Valid.Ext", ios::in|ios::nocreate); + #endif + if(!in.is_open()) + { + MessageBox(GUI.hWnd, "Fatal Error: The File \"Valid.Ext\" could not be found or created.", "Error", MB_ICONERROR|MB_OK); + PostQuitMessage(-1); + } + } + + do + { + buffer[0]='\0'; + in.getline(buffer,MAX_PATH+2); + if((*buffer)!='\0') + { + curr->next=new ExtList; + curr=curr->next; + ZeroMemory(curr, sizeof(ExtList)); + if(_strnicmp(buffer+strlen(buffer)-1, "Y", 1)==0) + curr->compressed=true; + if(strlen(buffer)>1) + { + curr->extension=new char[strlen(buffer)-1]; + strncpy(curr->extension, buffer, strlen(buffer)-1); + curr->extension[strlen(buffer)-1]='\0'; + } + else curr->extension=NULL; + } + } + while(!in.eof()); + in.close(); + curr=valid_ext; + valid_ext=valid_ext->next; + delete curr; +} + +void MakeExtFile(void) +{ + ofstream out; + out.open("Valid.Ext"); + + out<<"N" <65535) + { + MessageBox(hDlg,"Port Number needs to be betweeb 1024 and 65535","Error",MB_OK); + break; + } + else + { + Settings.Port = atoi(defPort); + } + //MessageBox(hDlg,defPort,defPort,MB_OK); + Settings.NetPlayServer = IsDlgButtonChecked(hDlg,IDC_ACTASSERVER); + NPServer.SendROMImageOnConnect = IsDlgButtonChecked(hDlg,IDC_SENDROM); + NPServer.SyncByReset = IsDlgButtonChecked(hDlg,IDC_SYNCBYRESET); + + EndDialog(hDlg,0); + if(hBmp) + { + DeleteObject(hBmp); + hBmp=NULL; + } + return TRUE; + } + case IDCANCEL: + { + EndDialog(hDlg,0); + if(hBmp) + { + DeleteObject(hBmp); + hBmp=NULL; + } + return TRUE; + } + } + } + return FALSE; +} +#endif +HRESULT CALLBACK EnumModesCallback( LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext) +{ + char depmode[80]; + char s[80]; + dMode curmode; + HWND hDlg = (HWND)lpContext; + int index; + HKEY hKey; + DWORD type; + BYTE val[4]; + DWORD nuv=4; + type=REG_DWORD; + + + + if( (lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount != 8 && + lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount != 15 && + lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount != 16) || + (lpDDSurfaceDesc->dwWidth < SNES_WIDTH || + lpDDSurfaceDesc->dwHeight < SNES_HEIGHT_EXTENDED)) + { + return DDENUMRET_OK; + } + sprintf( depmode, "%dx%dx%d", lpDDSurfaceDesc->dwWidth, lpDDSurfaceDesc->dwHeight, lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount); + RegOpenKeyEx(HKEY_CURRENT_USER,MY_REG_KEY "\\1.x\\DisplayModes",0,KEY_ALL_ACCESS, &hKey); + + + + curmode.width=lpDDSurfaceDesc->dwWidth; + curmode.height=lpDDSurfaceDesc->dwHeight; + curmode.depth=lpDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount; + if(RegQueryValueEx(hKey,depmode,0,&type,val,&nuv)==ERROR_SUCCESS) + { + //sprintf(s,"%d %d %d %d",val[0],val[1],val[2],val[3]); + //MessageBox(hDlg,s,temp,MB_OK); + switch(val[0]) + { + case 1: + strcpy(s,"Failed"); + curmode.status=1; + break; + case 3: + strcpy(s,"Works"); + curmode.status=3; + break; + default: + strcpy(s,"Untested"); + curmode.status=0; + } + } + else + { + strcpy(s,"Untested"); + curmode.status=0; + //MessageBox(hDlg,s,temp,MB_OK); + } + dm.push_back(curmode); + LVITEM lvi; + ZeroMemory(&lvi, sizeof(LVITEM)); + lvi.iItem=dm.size(); + lvi.mask=LVIF_TEXT; + lvi.pszText=depmode; + lvi.cchTextMax=80; + //lvi.lParam=dmindex; + index=ListView_InsertItem(hDlg, &lvi); + + + + //dmindex++; + ZeroMemory(&lvi, sizeof(LVITEM)); + lvi.mask=LVIF_TEXT; + lvi.iItem=index; + lvi.iSubItem=1; + lvi.pszText=s; + lvi.cchTextMax=10; + ListView_SetItem(hDlg, &lvi); + RegCloseKey(hKey); + + return DDENUMRET_OK; +} + +void EnableDisableKeyFields (int index, HWND hDlg) +{ + bool enableUnTurboable; + if(index < 5) + { + SetDlgItemText(hDlg,IDC_LABEL_RIGHT,INPUTCONFIG_LABEL_RIGHT); + SetDlgItemText(hDlg,IDC_LABEL_UPLEFT,INPUTCONFIG_LABEL_UPLEFT); + SetDlgItemText(hDlg,IDC_LABEL_UPRIGHT,INPUTCONFIG_LABEL_UPRIGHT); + SetDlgItemText(hDlg,IDC_LABEL_DOWNRIGHT,INPUTCONFIG_LABEL_DOWNRIGHT); + SetDlgItemText(hDlg,IDC_LABEL_UP,INPUTCONFIG_LABEL_UP); + SetDlgItemText(hDlg,IDC_LABEL_LEFT,INPUTCONFIG_LABEL_LEFT); + SetDlgItemText(hDlg,IDC_LABEL_DOWN,INPUTCONFIG_LABEL_DOWN); + SetDlgItemText(hDlg,IDC_LABEL_DOWNLEFT,INPUTCONFIG_LABEL_DOWNLEFT); + enableUnTurboable = true; + } + else + { + SetDlgItemText(hDlg,IDC_LABEL_UP,INPUTCONFIG_LABEL_MAKE_TURBO); + SetDlgItemText(hDlg,IDC_LABEL_LEFT,INPUTCONFIG_LABEL_MAKE_HELD); + SetDlgItemText(hDlg,IDC_LABEL_DOWN,INPUTCONFIG_LABEL_MAKE_TURBO_HELD); + SetDlgItemText(hDlg,IDC_LABEL_RIGHT,INPUTCONFIG_LABEL_CLEAR_TOGGLES_AND_TURBO); + SetDlgItemText(hDlg,IDC_LABEL_UPLEFT,INPUTCONFIG_LABEL_UNUSED); + SetDlgItemText(hDlg,IDC_LABEL_UPRIGHT,INPUTCONFIG_LABEL_UNUSED); + SetDlgItemText(hDlg,IDC_LABEL_DOWNLEFT,INPUTCONFIG_LABEL_UNUSED); + SetDlgItemText(hDlg,IDC_LABEL_DOWNRIGHT,INPUTCONFIG_LABEL_UNUSED); + SetDlgItemText(hDlg,IDC_UPLEFT,INPUTCONFIG_LABEL_UNUSED); + SetDlgItemText(hDlg,IDC_UPRIGHT,INPUTCONFIG_LABEL_UNUSED); + SetDlgItemText(hDlg,IDC_DWNLEFT,INPUTCONFIG_LABEL_UNUSED); + SetDlgItemText(hDlg,IDC_DWNRIGHT,INPUTCONFIG_LABEL_UNUSED); + enableUnTurboable = false; + } + + EnableWindow(GetDlgItem(hDlg,IDC_UPLEFT), enableUnTurboable); + EnableWindow(GetDlgItem(hDlg,IDC_UPRIGHT), enableUnTurboable); + EnableWindow(GetDlgItem(hDlg,IDC_DWNRIGHT), enableUnTurboable); + EnableWindow(GetDlgItem(hDlg,IDC_DWNLEFT), enableUnTurboable); +} + +int CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static HBITMAP hBmp; + HKEY hKey; + int index; + static bool state = false; + char s[80],temp[80]; + + + + + if(RegCreateKeyEx(HKEY_CURRENT_USER,MY_REG_KEY "\\1.x\\DisplayModes",0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS, NULL, &hKey,NULL) == ERROR_SUCCESS) + { + RegCloseKey(hKey); + + } + + switch(msg) + { + case WM_PAINT: + { + PAINTSTRUCT ps; + BeginPaint (hDlg, &ps); + if(hBmp) + { + BITMAP bmp; + ZeroMemory(&bmp, sizeof(BITMAP)); + RECT r; + GetClientRect(hDlg, &r); + HDC hdc=GetDC(hDlg); + HDC hDCbmp=CreateCompatibleDC(hdc); + GetObject(hBmp, sizeof(BITMAP), &bmp); + HBITMAP hOldBmp=(HBITMAP)SelectObject(hDCbmp, hBmp); + StretchBlt(hdc, 0,0,r.right,r.bottom,hDCbmp,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY); + SelectObject(hDCbmp, hOldBmp); + DeleteDC(hDCbmp); + ReleaseDC(hDlg, hdc); + } + + EndPaint (hDlg, &ps); + } + return true; + + case WM_INITDIALOG: + hBmp=(HBITMAP)LoadImage(NULL, TEXT("lantus.bmp"), IMAGE_BITMAP, 0,0, LR_CREATEDIBSECTION | LR_LOADFROMFILE); + sprintf(s,"Current Mode: %dx%dx%d",GUI.Width,GUI.Height,GUI.Depth); + SendDlgItemMessage(hDlg,IDC_CURRMODE,WM_SETTEXT,0,(LPARAM)s); + if(DirectX.lpDD==NULL) + { + DirectDrawCreate( NULL, &DirectX.lpDD, NULL); + } + + if(GUI.DoubleBuffered) + { + SendDlgItemMessage(hDlg, IDC_DBLBUFFER, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + } + SendDlgItemMessage(hDlg,IDC_FRAMERATESKIPSLIDER,TBM_SETRANGE,(WPARAM)true,(LPARAM)MAKELONG(0,9)); + if(Settings.SkipFrames!=AUTO_FRAMERATE) + { + SendDlgItemMessage(hDlg,IDC_FRAMERATESKIPSLIDER,TBM_SETPOS,(WPARAM)true,(LPARAM)Settings.SkipFrames); + } + EnableWindow(GetDlgItem(hDlg, IDC_TRANS), FALSE); + if(Settings.SixteenBit) + { + SendDlgItemMessage(hDlg, IDC_RENDER16BIT, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + EnableWindow(GetDlgItem(hDlg, IDC_TRANS), TRUE); + } + if(Settings.Transparency) + { + SendDlgItemMessage(hDlg, IDC_TRANS, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + } + + if(Settings.SupportHiRes) + { + SendDlgItemMessage(hDlg, IDC_HIRES, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + } + if(Settings.HeightExtend) + { + SendDlgItemMessage(hDlg, IDC_HEIGHT_EXTEND, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + } + if(Settings.Mode7Interpolate) + { + SendDlgItemMessage(hDlg, IDC_BILINEARMD7, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + } + if(Settings.SkipFrames==AUTO_FRAMERATE) + { + SendDlgItemMessage(hDlg, IDC_AUTOFRAME, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + } + if(GUI.Stretch) + { + SendDlgItemMessage(hDlg, IDC_STRETCH, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + } + if(Settings.AspectRatio) + { + SendDlgItemMessage(hDlg, IDC_ASPECT, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + } + if(GUI.FullScreen) + { + SendDlgItemMessage(hDlg, IDC_FULLSCREEN, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + } + if(GUI.VideoMemory) + { + SendDlgItemMessage(hDlg,IDC_VIDEOCARD, BM_SETCHECK, (WPARAM)BST_CHECKED,0); + } + if(Settings.DisplayFrameRate) + { + SendDlgItemMessage(hDlg, IDC_SHOWFPS, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + } + if(Settings.AutoMaxSkipFrames==0) + { + SendDlgItemMessage(hDlg, IDC_LIMITFRAMES, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + } + if(IsDlgButtonChecked(hDlg,IDC_AUTOFRAME)) + { + EnableWindow(GetDlgItem(hDlg, IDC_LIMITFRAMES), TRUE); + } + EnableWindow(GetDlgItem(hDlg, IDC_ASPECT), GUI.Stretch); + + + strcpy(temp,"None"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); + if(Settings.SixteenBit) + { + + strcpy(temp,"Normal"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); + /* Forward thinking by Gary? + strcpy(temp,"Scale X2"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); + */ + strcpy(temp,"Scanlines"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); + strcpy(temp,"Kreed's SuperEagle"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); + strcpy(temp,"Kreed's 2xSaI"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); + strcpy(temp,"Kreed's Super2xSaI"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); + strcpy(temp,"TV Mode"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); +#ifdef USE_GLIDE + strcpy(temp,"3D/FX bi-linear"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); +#endif +#ifdef USE_OPENGL + strcpy(temp,"OpenGL bi-linear"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); +#endif + + } + else + { + strcpy(temp,"Normal"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); + strcpy(temp,"Scanlines"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); + } + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_SETCURSEL,(WPARAM)GUI.NextScale,0); + + if(GUI.Width >= 512 && GUI.Height >= 478) + { + EnableWindow(GetDlgItem(hDlg,IDC_FILTERBOX),true); + EnableWindow(GetDlgItem(hDlg,IDC_HIRES),true); + } + else + { + EnableWindow(GetDlgItem(hDlg,IDC_FILTERBOX),false); + EnableWindow(GetDlgItem(hDlg,IDC_HIRES),false); + } + + + + LVCOLUMN col; + + + strcpy(s,"Status"); + ZeroMemory(&col, sizeof(LVCOLUMN)); + col.mask=LVCF_FMT|LVCF_TEXT|LVCF_WIDTH; + col.fmt=LVCFMT_LEFT; + col.iOrder=0; + col.cx=60; + col.cchTextMax=80; + col.pszText=s; + + ListView_InsertColumn(GetDlgItem(hDlg,IDC_VIDMODELIST), 1, &col); + + + strcpy(s,"Video Mode"); + ZeroMemory(&col, sizeof(LVCOLUMN)); + col.mask=LVCF_FMT|LVCF_ORDER|LVCF_TEXT|LVCF_WIDTH; + col.fmt=LVCFMT_LEFT; + col.iOrder=0; + col.cx=125; + col.cchTextMax=80; + col.pszText=s; + + ListView_InsertColumn(GetDlgItem(hDlg,IDC_VIDMODELIST), 0, &col); + + DirectX.lpDD->EnumDisplayModes(0,NULL,GetDlgItem(hDlg,IDC_VIDMODELIST),(LPDDENUMMODESCALLBACK)EnumModesCallback); + + // have to start focus on something like this or Escape won't exit the dialog + SetFocus(GetDlgItem(hDlg,IDC_FILTERBOX)); + + break; + case WM_CLOSE: + case WM_DESTROY: +// dmindex=0; + break; + case WM_COMMAND: + + switch(LOWORD(wParam)) + { + case IDC_STRETCH: + if(IsDlgButtonChecked(hDlg, IDC_STRETCH)==BST_CHECKED) + { + EnableWindow(GetDlgItem(hDlg, IDC_ASPECT), TRUE); + } + else + { + EnableWindow(GetDlgItem(hDlg, IDC_ASPECT), FALSE); + } + break; + + case IDC_AUTOFRAME: + if(BN_CLICKED==HIWORD(wParam)||BN_DBLCLK==HIWORD(wParam)) + { + if(IsDlgButtonChecked(hDlg,IDC_AUTOFRAME)) + { + EnableWindow(GetDlgItem(hDlg, IDC_LIMITFRAMES), TRUE); + } + else EnableWindow(GetDlgItem(hDlg, IDC_LIMITFRAMES), FALSE); + return true; + + } + else return false; + + break; + case IDC_RENDER16BIT: + + if(BN_CLICKED==HIWORD(wParam)||BN_DBLCLK==HIWORD(wParam)) + { + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_RESETCONTENT,0,0); + strcpy(temp,"None"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); + if(IsDlgButtonChecked(hDlg,IDC_RENDER16BIT)) + { + EnableWindow(GetDlgItem(hDlg, IDC_TRANS), TRUE); + strcpy(temp,"Normal"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); + /* Forward thinking by Gary? + strcpy(temp,"Scale X2"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); + */ + strcpy(temp,"Scanlines"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); + strcpy(temp,"Kreed's SuperEagle"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); + strcpy(temp,"Kreed's 2xSaI"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); + strcpy(temp,"Kreed's Super2xSaI"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); + strcpy(temp,"TV Mode"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); +#ifdef USE_GLIDE + strcpy(temp,"3D/FX bi-linear"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); +#endif +#ifdef USE_OPENGL + strcpy(temp,"OpenGL bi-linear"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_SETCURSEL,(WPARAM)GUI.NextScale,0); +#endif + + + } + else + { + EnableWindow(GetDlgItem(hDlg, IDC_TRANS), FALSE); + SendDlgItemMessage(hDlg, IDC_TRANS, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); + strcpy(temp,"Normal"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); + strcpy(temp,"Scanlines"); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_ADDSTRING,0,(LPARAM) (LPCTSTR)temp); + SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_SETCURSEL,(WPARAM)0,0); + } + + return true; + + } + else return false; + + break; + + + case IDOK: + Settings.SixteenBit = IsDlgButtonChecked(hDlg, IDC_RENDER16BIT); + Settings.Transparency = IsDlgButtonChecked(hDlg, IDC_TRANS); + GUI.VideoMemory = (bool)(IsDlgButtonChecked(hDlg,IDC_VIDEOCARD)==BST_CHECKED); + if(GUI.Width >= 512 && GUI.Height >= 478) + { + Settings.SupportHiRes = IsDlgButtonChecked(hDlg, IDC_HIRES); + GUI.NextScale = (int)SendDlgItemMessage(hDlg,IDC_FILTERBOX,CB_GETCURSEL,0,0); + } + else + { + Settings.SupportHiRes = false; + GUI.NextScale = 0; + } + Settings.HeightExtend = IsDlgButtonChecked(hDlg, IDC_HEIGHT_EXTEND); + Settings.Mode7Interpolate = IsDlgButtonChecked(hDlg, IDC_BILINEARMD7); + Settings.AutoMaxSkipFrames = IsDlgButtonChecked(hDlg, IDC_AUTOFRAME); + GUI.DoubleBuffered = (bool)(IsDlgButtonChecked(hDlg, IDC_DBLBUFFER)==BST_CHECKED); + if(IsDlgButtonChecked(hDlg, IDC_AUTOFRAME)) + { + Settings.SkipFrames=AUTO_FRAMERATE; + } + else + { + Settings.SkipFrames=(uint32)SendDlgItemMessage(hDlg,IDC_FRAMERATESKIPSLIDER,TBM_GETPOS,0,0); + } + if(IsDlgButtonChecked(hDlg, IDC_AUTOFRAME)&&IsDlgButtonChecked(hDlg, IDC_LIMITFRAMES)) + { + Settings.AutoMaxSkipFrames=0; + } + else + { + if(Settings.AutoMaxSkipFrames==0) + { + Settings.AutoMaxSkipFrames=10; + } + } + + + GUI.Stretch = (bool)(IsDlgButtonChecked(hDlg, IDC_STRETCH)==BST_CHECKED); + Settings.AspectRatio = (bool)(IsDlgButtonChecked(hDlg, IDC_ASPECT)==BST_CHECKED); + GUI.FullScreen = (bool)(IsDlgButtonChecked(hDlg, IDC_FULLSCREEN)==BST_CHECKED); + Settings.DisplayFrameRate = IsDlgButtonChecked(hDlg, IDC_SHOWFPS); + + + // we might've change the region that the game draws over + // (by turning on "maintain aspect ratio", or turning on "extend height" when "maintain aspect ratio" is already on), + // so we must invalidate the window to redraw black + // behind the possibly-newly-revealed areas of the window + RedrawWindow((HWND)GetParent(hDlg),NULL,NULL, RDW_INVALIDATE | RDW_INTERNALPAINT | RDW_ERASENOW); + + +// dmindex=0; + EndDialog(hDlg,0); + if(hBmp) + { + DeleteObject(hBmp); + hBmp=NULL; + } + return false; + + + + case IDCANCEL: +// dmindex=0; + EndDialog(hDlg,0); + if(hBmp) + { + DeleteObject(hBmp); + hBmp=NULL; + } + return false; + case IDC_TESTMODE: + + //DirectX.lpDD->SetCooperativeLevel(hDlg,DDSCL_FULLSCREEN|DDSCL_ALLOWMODEX|DDSCL_EXCLUSIVE|DDSCL_ALLOWREBOOT); + index=ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_VIDMODELIST)); + if(index != -1) + { + sprintf(temp,"%dx%dx%d",dm.at(index).width,dm.at(index).height,dm.at(index).depth); + if(DirectX.lpDD->SetDisplayMode(dm.at(index).width,dm.at(index).height,dm.at(index).depth)!=DD_OK) + { + + MessageBox(hDlg,"There was an error testing the selected mode","DD_NOTOK",MB_OK); + LVITEM lvi; + dm.at(index).status=1; + strcpy(s,"Failed"); + ZeroMemory(&lvi, sizeof(LVITEM)); + lvi.mask=LVIF_TEXT; + lvi.iItem=index; + lvi.iSubItem=1; + lvi.pszText=s; + lvi.cchTextMax=10; + ListView_SetItem(GetDlgItem(hDlg,IDC_VIDMODELIST), &lvi); + if(RegOpenKeyEx(HKEY_CURRENT_USER,MY_REG_KEY "\\1.x\\DisplayModes",0,KEY_ALL_ACCESS, &hKey)==ERROR_SUCCESS) + { + + RegSetValueEx(hKey,temp,0,REG_DWORD,(LPBYTE)&dm.at(index).status,sizeof(DWORD)); + + RegCloseKey(hKey); + + } + } + else + { + + + + + if(MessageBox(hDlg,"Did it Work?","Test Display Mode",MB_YESNO)==IDYES) + { + dm.at(index).status=3; + LVITEM lvi; + strcpy(s,"Works"); + ZeroMemory(&lvi, sizeof(LVITEM)); + lvi.mask=LVIF_TEXT; + lvi.iItem=index; + lvi.iSubItem=1; + lvi.pszText=s; + lvi.cchTextMax=10; + ListView_SetItem(GetDlgItem(hDlg,IDC_VIDMODELIST), &lvi); + if(RegOpenKeyEx(HKEY_CURRENT_USER,MY_REG_KEY "\\1.x\\DisplayModes",0,KEY_ALL_ACCESS, &hKey)==ERROR_SUCCESS) + { + + if(RegSetValueEx(hKey,temp,0,REG_DWORD,(LPBYTE)&dm.at(index).status,sizeof(DWORD))==ERROR_SUCCESS) + { + + } + + RegCloseKey(hKey); + + } + } + else + { + dm.at(index).status=1; + LVITEM lvi; + strcpy(s,"Failed"); + ZeroMemory(&lvi, sizeof(LVITEM)); + lvi.mask=LVIF_TEXT; + lvi.iItem=index; + lvi.iSubItem=1; + lvi.pszText=s; + lvi.cchTextMax=10; + ListView_SetItem(GetDlgItem(hDlg,IDC_VIDMODELIST), &lvi); + if(RegOpenKeyEx(HKEY_CURRENT_USER, + MY_REG_KEY "\\1.x\\DisplayModes", + 0,KEY_ALL_ACCESS, &hKey)==ERROR_SUCCESS) + { + RegSetValueEx(hKey,temp,0,REG_DWORD,(LPBYTE)&dm.at(index).status,sizeof(DWORD)); + + RegCloseKey(hKey); + + } + + } + + + } + + + DirectX.lpDD->SetDisplayMode(GUI.Width,GUI.Height,GUI.Depth); + } + else + { + MessageBox(hDlg,"Please select a mode to test","No Mode Selected",MB_OK); + + } + return false; + case IDC_SETDMODE: + bool go; + + + index=ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_VIDMODELIST)); + + switch (dm.at(index).status) + { + case 3: + if(MessageBox(hDlg,"Are you sure?","Confirm Set Display Mode",MB_YESNO)==IDYES) + { + go=true; + } + else + { + go=false; + } + break; + case 1: + if(MessageBox(hDlg,"This mode failed in testing, are you sure?","Confirm Set Display Mode",MB_YESNO)==IDYES) + { + go=true; + } + else + { + go=false; + } + break; + case 0: + if(MessageBox(hDlg,"This Mode Hasn't been tested, are you sure?","Confirm Set Display Mode",MB_YESNO)==IDYES) + { + go=true; + } + else + { + go=false; + } + break; + } + if(go) + { + + if(RegOpenKeyEx(HKEY_CURRENT_USER, + MY_REG_KEY "\\1.x", + 0,KEY_ALL_ACCESS, &hKey)==ERROR_SUCCESS) + { + RegSetValueEx(hKey,"Width",0,REG_DWORD,(LPBYTE)&dm.at(index).width,sizeof(DWORD)); + RegSetValueEx(hKey,"Height",0,REG_DWORD,(LPBYTE)&dm.at(index).height,sizeof(DWORD)); + RegSetValueEx(hKey,"Depth",0,REG_DWORD,(LPBYTE)&dm.at(index).depth,sizeof(DWORD)); + RegCloseKey(hKey); + + } + + GUI.Width=dm.at(index).width; + GUI.Height=dm.at(index).height; + GUI.Depth=dm.at(index).depth; + } + if(GUI.Width >= 512 && GUI.Height >= 478) + { + EnableWindow(GetDlgItem(hDlg,IDC_FILTERBOX),true); + EnableWindow(GetDlgItem(hDlg,IDC_HIRES),true); + } + else + { + EnableWindow(GetDlgItem(hDlg,IDC_FILTERBOX),false); + EnableWindow(GetDlgItem(hDlg,IDC_HIRES),false); + } + sprintf(s,"Current Mode: %dx%dx%d",GUI.Width,GUI.Height,GUI.Depth); + SendDlgItemMessage(hDlg,IDC_CURRMODE,WM_SETTEXT,0,(LPARAM)s); + return false; + + + } + + + } + + return false; +} + +static void set_buttoninfo(int index, HWND hDlg) +{ + SendDlgItemMessage(hDlg,IDC_UP,WM_USER+44,Joypad[index].Up,0); + SendDlgItemMessage(hDlg,IDC_LEFT,WM_USER+44,Joypad[index].Left,0); + SendDlgItemMessage(hDlg,IDC_DOWN,WM_USER+44,Joypad[index].Down,0); + SendDlgItemMessage(hDlg,IDC_RIGHT,WM_USER+44,Joypad[index].Right,0); + SendDlgItemMessage(hDlg,IDC_A,WM_USER+44,Joypad[index].A,0); + SendDlgItemMessage(hDlg,IDC_B,WM_USER+44,Joypad[index].B,0); + SendDlgItemMessage(hDlg,IDC_X,WM_USER+44,Joypad[index].X,0); + SendDlgItemMessage(hDlg,IDC_Y,WM_USER+44,Joypad[index].Y,0); + SendDlgItemMessage(hDlg,IDC_L,WM_USER+44,Joypad[index].L,0); + SendDlgItemMessage(hDlg,IDC_R,WM_USER+44,Joypad[index].R,0); + SendDlgItemMessage(hDlg,IDC_START,WM_USER+44,Joypad[index].Start,0); + SendDlgItemMessage(hDlg,IDC_SELECT,WM_USER+44,Joypad[index].Select,0); + if(index < 5) + { + SendDlgItemMessage(hDlg,IDC_UPLEFT,WM_USER+44,Joypad[index].Left_Up,0); + SendDlgItemMessage(hDlg,IDC_UPRIGHT,WM_USER+44,Joypad[index].Right_Up,0); + SendDlgItemMessage(hDlg,IDC_DWNLEFT,WM_USER+44,Joypad[index].Left_Down,0); + SendDlgItemMessage(hDlg,IDC_DWNRIGHT,WM_USER+44,Joypad[index].Right_Down,0); + } +} + +void TranslateKey(WORD keyz,char *out); +//HWND funky; +SJoyState JoystickF [16]; + + +#ifdef NETPLAY_SUPPORT +int CALLBACK DlgNPProgress(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + SendDlgItemMessage(hDlg,IDC_NPPROGRESS,PBM_SETRANGE,0,(LPARAM)MAKELPARAM (0, 100)); + SendDlgItemMessage(hDlg,IDC_NPPROGRESS,PBM_SETPOS,(WPARAM)(int)NetPlay.PercentageComplete,0); + + return false; +} +#endif +int CALLBACK DlgInputConfig(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static HBITMAP hBmp; + char temp[256]; + short C; + int i, which; + static int index=0; + + + static SJoypad pads[10]; + + + //HBRUSH g_hbrBackground; + + InitInputCustomControl(); +switch(msg) + { + case WM_PAINT: + { + PAINTSTRUCT ps; + BeginPaint (hDlg, &ps); + if(hBmp) + { + BITMAP bmp; + ZeroMemory(&bmp, sizeof(BITMAP)); + RECT r; + GetClientRect(hDlg, &r); + HDC hdc=GetDC(hDlg); + HDC hDCbmp=CreateCompatibleDC(hdc); + GetObject(hBmp, sizeof(BITMAP), &bmp); + HBITMAP hOldBmp=(HBITMAP)SelectObject(hDCbmp, hBmp); + StretchBlt(hdc, 0,0,r.right,r.bottom,hDCbmp,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY); + SelectObject(hDCbmp, hOldBmp); + DeleteDC(hDCbmp); + ReleaseDC(hDlg, hdc); + } + + EndPaint (hDlg, &ps); + } + return true; + case WM_INITDIALOG: + SetWindowText(hDlg,INPUTCONFIG_TITLE); + SetDlgItemText(hDlg,IDC_JPTOGGLE,INPUTCONFIG_JPTOGGLE); + SetDlgItemText(hDlg,IDC_OK,BUTTON_OK); + SetDlgItemText(hDlg,IDC_CANCEL,BUTTON_CANCEL); +/// SetDlgItemText(hDlg,IDC_DIAGTOGGLE,INPUTCONFIG_DIAGTOGGLE); + SetDlgItemText(hDlg,IDC_LABEL_UP,INPUTCONFIG_LABEL_UP); + SetDlgItemText(hDlg,IDC_LABEL_DOWN,INPUTCONFIG_LABEL_DOWN); + SetDlgItemText(hDlg,IDC_LABEL_LEFT,INPUTCONFIG_LABEL_LEFT); + SetDlgItemText(hDlg,IDC_LABEL_A,INPUTCONFIG_LABEL_A); + SetDlgItemText(hDlg,IDC_LABEL_B,INPUTCONFIG_LABEL_B); + SetDlgItemText(hDlg,IDC_LABEL_X,INPUTCONFIG_LABEL_X); + SetDlgItemText(hDlg,IDC_LABEL_Y,INPUTCONFIG_LABEL_Y); + SetDlgItemText(hDlg,IDC_LABEL_L,INPUTCONFIG_LABEL_L); + SetDlgItemText(hDlg,IDC_LABEL_R,INPUTCONFIG_LABEL_R); + SetDlgItemText(hDlg,IDC_LABEL_START,INPUTCONFIG_LABEL_START); + SetDlgItemText(hDlg,IDC_LABEL_SELECT,INPUTCONFIG_LABEL_SELECT); + SetDlgItemText(hDlg,IDC_LABEL_UPRIGHT,INPUTCONFIG_LABEL_UPRIGHT); + SetDlgItemText(hDlg,IDC_LABEL_UPLEFT,INPUTCONFIG_LABEL_UPLEFT); + SetDlgItemText(hDlg,IDC_LABEL_DOWNRIGHT,INPUTCONFIG_LABEL_DOWNRIGHT); + SetDlgItemText(hDlg,IDC_LABEL_DOWNLEFT,INPUTCONFIG_LABEL_DOWNLEFT); + SetDlgItemText(hDlg,IDC_LABEL_BLUE,INPUTCONFIG_LABEL_BLUE); + + for(i=5;i<10;i++) + Joypad[i].Left_Up = Joypad[i].Right_Up = Joypad[i].Left_Down = Joypad[i].Right_Down = 0; + + hBmp=(HBITMAP)LoadImage(NULL, TEXT("PBortas.bmp"), IMAGE_BITMAP, 0,0, LR_CREATEDIBSECTION | LR_LOADFROMFILE); + memcpy(pads, Joypad, 10*sizeof(SJoypad)); + + for( i=0;i<256;i++) + GetAsyncKeyState(i); + + for( C = 0; C != 16; C ++) + JoystickF[C].Attached = joyGetDevCaps( JOYSTICKID1+C, &JoystickF[C].Caps, sizeof( JOYCAPS)) == JOYERR_NOERROR; + + for (i=1;i<6;i++) + { + sprintf(temp,INPUTCONFIG_JPCOMBO,i); + SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_ADDSTRING,0,(LPARAM)(LPCTSTR)temp); + } + + for (i=6;i<11;i++) + { + sprintf(temp,INPUTCONFIG_JPCOMBO INPUTCONFIG_LABEL_CONTROLLER_TURBO_PANEL_MOD,i-5); + SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_ADDSTRING,0,(LPARAM)(LPCTSTR)temp); + } + + SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_SETCURSEL,(WPARAM)0,0); + + SendDlgItemMessage(hDlg,IDC_JPTOGGLE,BM_SETCHECK, Joypad[index].Enabled ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ALLOWLEFTRIGHT,BM_SETCHECK, !Settings.DisallowLeftRight ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + + set_buttoninfo(index,hDlg); + + EnableDisableKeyFields(index,hDlg); + + PostMessage(hDlg,WM_COMMAND, CBN_SELCHANGE<<16, 0); + + SetFocus(GetDlgItem(hDlg,IDC_JPCOMBO)); + + return true; + break; + case WM_CLOSE: + EndDialog(hDlg, 0); + return TRUE; + case WM_USER+46: + // refresh command, for clicking away from a selected field + index = SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_GETCURSEL,0,0); + set_buttoninfo(index,hDlg); + return TRUE; + case WM_USER+43: + //MessageBox(hDlg,"USER+43 CAUGHT","moo",MB_OK); + which = GetDlgCtrlID((HWND)lParam); + switch(which) + { + case IDC_UP: + Joypad[index].Up = wParam; + + break; + case IDC_DOWN: + Joypad[index].Down = wParam; + + break; + case IDC_LEFT: + Joypad[index].Left = wParam; + + break; + case IDC_RIGHT: + Joypad[index].Right = wParam; + + break; + case IDC_A: + Joypad[index].A = wParam; + + break; + case IDC_B: + Joypad[index].B = wParam; + + break; + case IDC_X: + Joypad[index].X = wParam; + + break; + case IDC_Y: + Joypad[index].Y = wParam; + + break; + case IDC_L: + Joypad[index].L = wParam; + break; + + case IDC_R: + Joypad[index].R = wParam; + + break; + case IDC_SELECT: + Joypad[index].Select = wParam; + + break; + case IDC_START: + Joypad[index].Start = wParam; + + break; + case IDC_UPLEFT: + Joypad[index].Left_Up = wParam; + + break; + case IDC_UPRIGHT: + Joypad[index].Right_Up = wParam; + + break; + case IDC_DWNLEFT: + Joypad[index].Left_Down = wParam; + + case IDC_DWNRIGHT: + Joypad[index].Right_Down = wParam; + + break; + + } + + set_buttoninfo(index,hDlg); + + PostMessage(hDlg,WM_NEXTDLGCTL,0,0); + return true; + case WM_COMMAND: + switch(LOWORD(wParam)) + { + case IDCANCEL: + memcpy(Joypad, pads, 10*sizeof(SJoypad)); + EndDialog(hDlg,0); + if(hBmp) + { + DeleteObject(hBmp); + hBmp=NULL; + } + break; + + case IDOK: + Settings.DisallowLeftRight = !IsDlgButtonChecked(hDlg, IDC_ALLOWLEFTRIGHT); + EndDialog(hDlg,0); + if(hBmp) + { + DeleteObject(hBmp); + hBmp=NULL; + } + break; + + case IDC_JPTOGGLE: // joypad Enable toggle + index = SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_GETCURSEL,0,0); + Joypad[index].Enabled=IsDlgButtonChecked(hDlg,IDC_JPTOGGLE); + set_buttoninfo(index, hDlg); // update display of conflicts + break; + + } + switch(HIWORD(wParam)) + { + case CBN_SELCHANGE: + index = SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_GETCURSEL,0,0); + SendDlgItemMessage(hDlg,IDC_JPCOMBO,CB_SETCURSEL,(WPARAM)index,0); + if(index < 5) + { + SendDlgItemMessage(hDlg,IDC_JPTOGGLE,BM_SETCHECK, Joypad[index].Enabled ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + EnableWindow(GetDlgItem(hDlg,IDC_JPTOGGLE),TRUE); + } + else + { + SendDlgItemMessage(hDlg,IDC_JPTOGGLE,BM_SETCHECK, Joypad[index-5].Enabled ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + EnableWindow(GetDlgItem(hDlg,IDC_JPTOGGLE),FALSE); + } + + set_buttoninfo(index,hDlg); + + EnableDisableKeyFields(index,hDlg); + + break; + } + return FALSE; + + } + + return FALSE; +} + + +static void set_hotkeyinfo(HWND hDlg) +{ + int index = SendDlgItemMessage(hDlg,IDC_HKCOMBO,CB_GETCURSEL,0,0); + + if(index == 0) + { + // set page 1 fields + SendDlgItemMessage(hDlg,IDC_HOTKEY1,WM_USER+44,CustomKeys.SpeedUp.key,CustomKeys.SpeedUp.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY2,WM_USER+44,CustomKeys.SpeedDown.key,CustomKeys.SpeedDown.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY3,WM_USER+44,CustomKeys.Pause.key,CustomKeys.Pause.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY4,WM_USER+44,CustomKeys.FrameAdvance.key,CustomKeys.FrameAdvance.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY5,WM_USER+44,CustomKeys.FastForward.key,CustomKeys.FastForward.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY6,WM_USER+44,CustomKeys.SkipUp.key,CustomKeys.SkipUp.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY7,WM_USER+44,CustomKeys.SkipDown.key,CustomKeys.SkipDown.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY8,WM_USER+44,CustomKeys.ScopeTurbo.key,CustomKeys.ScopeTurbo.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY9,WM_USER+44,CustomKeys.ScopePause.key,CustomKeys.ScopePause.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY10,WM_USER+44,CustomKeys.ShowPressed.key,CustomKeys.ShowPressed.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY11,WM_USER+44,CustomKeys.FrameCount.key,CustomKeys.FrameCount.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY12,WM_USER+44,CustomKeys.ReadOnly.key,CustomKeys.ReadOnly.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY13,WM_USER+44,CustomKeys.SaveScreenShot.key,CustomKeys.SaveScreenShot.modifiers); + } + else + { + // set page 2 fields + SendDlgItemMessage(hDlg,IDC_HOTKEY1,WM_USER+44,CustomKeys.BGL1.key,CustomKeys.BGL1.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY2,WM_USER+44,CustomKeys.BGL2.key,CustomKeys.BGL2.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY3,WM_USER+44,CustomKeys.BGL3.key,CustomKeys.BGL3.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY4,WM_USER+44,CustomKeys.BGL4.key,CustomKeys.BGL4.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY5,WM_USER+44,CustomKeys.BGL5.key,CustomKeys.BGL5.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY6,WM_USER+44,CustomKeys.ClippingWindows.key,CustomKeys.ClippingWindows.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY7,WM_USER+44,CustomKeys.BGLHack.key,CustomKeys.BGLHack.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY8,WM_USER+44,CustomKeys.Transparency.key,CustomKeys.Transparency.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY9,WM_USER+44,CustomKeys.HDMA.key,CustomKeys.HDMA.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY10,WM_USER+44,CustomKeys.GLCube.key,CustomKeys.GLCube.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY11,WM_USER+44,CustomKeys.InterpMode7.key,CustomKeys.InterpMode7.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY12,WM_USER+44,CustomKeys.JoypadSwap.key,CustomKeys.JoypadSwap.modifiers); + SendDlgItemMessage(hDlg,IDC_HOTKEY13,WM_USER+44,CustomKeys.SwitchControllers.key,CustomKeys.SwitchControllers.modifiers); + } + + SendDlgItemMessage(hDlg,IDC_SLOTPLUS,WM_USER+44,CustomKeys.SlotPlus.key,CustomKeys.SlotPlus.modifiers); + SendDlgItemMessage(hDlg,IDC_SLOTMINUS,WM_USER+44,CustomKeys.SlotMinus.key,CustomKeys.SlotMinus.modifiers); + SendDlgItemMessage(hDlg,IDC_SLOTSAVE,WM_USER+44,CustomKeys.SlotSave.key,CustomKeys.SlotSave.modifiers); + SendDlgItemMessage(hDlg,IDC_SLOTLOAD,WM_USER+44,CustomKeys.SlotLoad.key,CustomKeys.SlotLoad.modifiers); + int i; + for(i = 0 ; i < 10 ; i++) SendDlgItemMessage(hDlg,IDC_SAVE1+i,WM_USER+44,CustomKeys.Save[i].key,CustomKeys.Save[i].modifiers); + for(i = 0 ; i < 10 ; i++) SendDlgItemMessage(hDlg,IDC_SAVE11+i,WM_USER+44,CustomKeys.Load[i].key,CustomKeys.Load[i].modifiers); + + if(index == 0) + { + // set page 1 label text + SetDlgItemText(hDlg,IDC_LABEL_HK1,HOTKEYS_LABEL_1_1); + SetDlgItemText(hDlg,IDC_LABEL_HK2,HOTKEYS_LABEL_1_2); + SetDlgItemText(hDlg,IDC_LABEL_HK3,HOTKEYS_LABEL_1_3); + SetDlgItemText(hDlg,IDC_LABEL_HK4,HOTKEYS_LABEL_1_4); + SetDlgItemText(hDlg,IDC_LABEL_HK5,HOTKEYS_LABEL_1_5); + SetDlgItemText(hDlg,IDC_LABEL_HK6,HOTKEYS_LABEL_1_6); + SetDlgItemText(hDlg,IDC_LABEL_HK7,HOTKEYS_LABEL_1_7); + SetDlgItemText(hDlg,IDC_LABEL_HK8,HOTKEYS_LABEL_1_8); + SetDlgItemText(hDlg,IDC_LABEL_HK9,HOTKEYS_LABEL_1_9); + SetDlgItemText(hDlg,IDC_LABEL_HK10,HOTKEYS_LABEL_1_10); + SetDlgItemText(hDlg,IDC_LABEL_HK11,HOTKEYS_LABEL_1_11); + SetDlgItemText(hDlg,IDC_LABEL_HK12,HOTKEYS_LABEL_1_12); + SetDlgItemText(hDlg,IDC_LABEL_HK13,HOTKEYS_LABEL_1_13); + } + else + { + // set page 2 label text + SetDlgItemText(hDlg,IDC_LABEL_HK1,HOTKEYS_LABEL_2_1); + SetDlgItemText(hDlg,IDC_LABEL_HK2,HOTKEYS_LABEL_2_2); + SetDlgItemText(hDlg,IDC_LABEL_HK3,HOTKEYS_LABEL_2_3); + SetDlgItemText(hDlg,IDC_LABEL_HK4,HOTKEYS_LABEL_2_4); + SetDlgItemText(hDlg,IDC_LABEL_HK5,HOTKEYS_LABEL_2_5); + SetDlgItemText(hDlg,IDC_LABEL_HK6,HOTKEYS_LABEL_2_6); + SetDlgItemText(hDlg,IDC_LABEL_HK7,HOTKEYS_LABEL_2_7); + SetDlgItemText(hDlg,IDC_LABEL_HK8,HOTKEYS_LABEL_2_8); + SetDlgItemText(hDlg,IDC_LABEL_HK9,HOTKEYS_LABEL_2_9); + SetDlgItemText(hDlg,IDC_LABEL_HK10,HOTKEYS_LABEL_2_10); + SetDlgItemText(hDlg,IDC_LABEL_HK11,HOTKEYS_LABEL_2_11); + SetDlgItemText(hDlg,IDC_LABEL_HK12,HOTKEYS_LABEL_2_12); + SetDlgItemText(hDlg,IDC_LABEL_HK13,HOTKEYS_LABEL_2_13); + } +} + +// DlgHotkeyConfig +int CALLBACK DlgHotkeyConfig(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + int i, which; + static int index=0; + + + static SCustomKeys keys; + + + //HBRUSH g_hbrBackground; + InitKeyCustomControl(); +switch(msg) + { + case WM_PAINT: + { + PAINTSTRUCT ps; + BeginPaint (hDlg, &ps); + + EndPaint (hDlg, &ps); + } + return true; + case WM_INITDIALOG: + SetWindowText(hDlg,HOTKEYS_TITLE); + + for(i=1;i<=2;i++) + { + char temp[256]; + sprintf(temp,HOTKEYS_HKCOMBO,i); + SendDlgItemMessage(hDlg,IDC_HKCOMBO,CB_ADDSTRING,0,(LPARAM)(LPCTSTR)temp); + } + + SendDlgItemMessage(hDlg,IDC_HKCOMBO,CB_SETCURSEL,(WPARAM)0,0); + + memcpy(&keys, &CustomKeys, sizeof(SCustomKeys)); + for( i=0;i<256;i++) + { + GetAsyncKeyState(i); + } + + SetDlgItemText(hDlg,IDC_LABEL_BLUE,HOTKEYS_LABEL_BLUE); + + set_hotkeyinfo(hDlg); + + PostMessage(hDlg,WM_COMMAND, CBN_SELCHANGE<<16, 0); + + SetFocus(GetDlgItem(hDlg,IDC_HKCOMBO)); + + + return true; + break; + case WM_CLOSE: + EndDialog(hDlg, 0); + return TRUE; + case WM_USER+46: + // refresh command, for clicking away from a selected field + index = SendDlgItemMessage(hDlg,IDC_HKCOMBO,CB_GETCURSEL,0,0); + set_hotkeyinfo(hDlg); + return TRUE; + case WM_USER+43: + { + //MessageBox(hDlg,"USER+43 CAUGHT","moo",MB_OK); + int modifiers = 0; + if(GetAsyncKeyState(VK_MENU) || wParam == VK_MENU) + modifiers |= CUSTKEY_ALT_MASK; + if(GetAsyncKeyState(VK_CONTROL) || wParam == VK_CONTROL) + modifiers |= CUSTKEY_CTRL_MASK; + if(GetAsyncKeyState(VK_SHIFT) || wParam == VK_SHIFT) + modifiers |= CUSTKEY_SHIFT_MASK; + + int index = SendDlgItemMessage(hDlg,IDC_HKCOMBO,CB_GETCURSEL,0,0); + + which = GetDlgCtrlID((HWND)lParam); + + switch(which) + { + case IDC_HOTKEY1: + if(index == 0) CustomKeys.SpeedUp.key = wParam, CustomKeys.SpeedUp.modifiers = modifiers; + else CustomKeys.BGL1.key = wParam, CustomKeys.BGL1.modifiers = modifiers; + break; + case IDC_HOTKEY2: + if(index == 0) CustomKeys.SpeedDown.key = wParam, CustomKeys.SpeedDown.modifiers = modifiers; + else CustomKeys.BGL2.key = wParam, CustomKeys.BGL2.modifiers = modifiers; + break; + case IDC_HOTKEY3: + if(index == 0) CustomKeys.Pause.key = wParam, CustomKeys.Pause.modifiers = modifiers; + else CustomKeys.BGL3.key = wParam, CustomKeys.BGL3.modifiers = modifiers; + break; + case IDC_HOTKEY4: + if(index == 0) CustomKeys.FrameAdvance.key = wParam, CustomKeys.FrameAdvance.modifiers = modifiers; + else CustomKeys.BGL4.key = wParam, CustomKeys.BGL4.modifiers = modifiers; + break; + case IDC_HOTKEY5: + if(index == 0) CustomKeys.FastForward.key = wParam, CustomKeys.FastForward.modifiers = modifiers; + else CustomKeys.BGL5.key = wParam, CustomKeys.BGL5.modifiers = modifiers; + break; + case IDC_HOTKEY6: + if(index == 0) CustomKeys.SkipUp.key = wParam, CustomKeys.SkipUp.modifiers = modifiers; + else CustomKeys.ClippingWindows.key = wParam, CustomKeys.ClippingWindows.modifiers = modifiers; + break; + case IDC_HOTKEY7: + if(index == 0) CustomKeys.SkipDown.key = wParam, CustomKeys.SkipDown.modifiers = modifiers; + else CustomKeys.BGLHack.key = wParam, CustomKeys.BGLHack.modifiers = modifiers; + break; + case IDC_HOTKEY8: + if(index == 0) CustomKeys.ScopeTurbo.key = wParam, CustomKeys.ScopeTurbo.modifiers = modifiers; + else CustomKeys.Transparency.key = wParam, CustomKeys.Transparency.modifiers = modifiers; + break; + case IDC_HOTKEY9: + if(index == 0) CustomKeys.ScopePause.key = wParam, CustomKeys.ScopePause.modifiers = modifiers; + else CustomKeys.HDMA.key = wParam, CustomKeys.HDMA.modifiers = modifiers; + break; + case IDC_HOTKEY10: + if(index == 0) CustomKeys.ShowPressed.key = wParam, CustomKeys.ShowPressed.modifiers = modifiers; + else CustomKeys.GLCube.key = wParam, CustomKeys.GLCube.modifiers = modifiers; + break; + case IDC_HOTKEY11: + if(index == 0) CustomKeys.FrameCount.key = wParam, CustomKeys.FrameCount.modifiers = modifiers; + else CustomKeys.InterpMode7.key = wParam, CustomKeys.InterpMode7.modifiers = modifiers; + break; + case IDC_HOTKEY12: + if(index == 0) CustomKeys.ReadOnly.key = wParam, CustomKeys.ReadOnly.modifiers = modifiers; + else CustomKeys.JoypadSwap.key = wParam, CustomKeys.JoypadSwap.modifiers = modifiers; + break; + case IDC_HOTKEY13: + if(index == 0) CustomKeys.SaveScreenShot.key = wParam, CustomKeys.SaveScreenShot.modifiers = modifiers; + else CustomKeys.SwitchControllers.key = wParam, CustomKeys.SwitchControllers.modifiers = modifiers; + break; + + case IDC_SLOTPLUS: + CustomKeys.SlotPlus.key = wParam; + CustomKeys.SlotPlus.modifiers = modifiers; + break; + + case IDC_SLOTMINUS: + CustomKeys.SlotMinus.key = wParam; + CustomKeys.SlotMinus.modifiers = modifiers; + break; + + case IDC_SLOTLOAD: + CustomKeys.SlotLoad.key = wParam; + CustomKeys.SlotLoad.modifiers = modifiers; + break; + + case IDC_SLOTSAVE: + CustomKeys.SlotSave.key = wParam; + CustomKeys.SlotSave.modifiers = modifiers; + break; + } + + if(which >= IDC_SAVE1 && which <= IDC_SAVE10) + { + CustomKeys.Save[which-IDC_SAVE1].key = wParam; + CustomKeys.Save[which-IDC_SAVE1].modifiers = modifiers; + } + if(which >= IDC_SAVE11 && which <= IDC_SAVE20) + { + CustomKeys.Load[which-IDC_SAVE11].key = wParam; + CustomKeys.Load[which-IDC_SAVE11].modifiers = modifiers; + } + + set_hotkeyinfo(hDlg); + PostMessage(hDlg,WM_NEXTDLGCTL,0,0); +// PostMessage(hDlg,WM_KILLFOCUS,0,0); + } + return true; + case WM_COMMAND: + switch(LOWORD(wParam)) + { + case IDCANCEL: + memcpy(&CustomKeys, &keys, sizeof(SCustomKeys)); + EndDialog(hDlg,0); + break; + case IDOK: + EndDialog(hDlg,0); + break; + } + switch(HIWORD(wParam)) + { + case CBN_SELCHANGE: + index = SendDlgItemMessage(hDlg,IDC_HKCOMBO,CB_GETCURSEL,0,0); + SendDlgItemMessage(hDlg,IDC_HKCOMBO,CB_SETCURSEL,(WPARAM)index,0); + + set_hotkeyinfo(hDlg); + + SetFocus(GetDlgItem(hDlg,IDC_HKCOMBO)); + + break; + } + return FALSE; + + } + + return FALSE; +} + + + +enum CheatStatus{ + Untouched, + Deleted, + Modified +}; +typedef struct{ +int* index; +DWORD* state; +}CheatTracker; + +#define ITEM_QUERY(a, b, c, d, e) ZeroMemory(&a, sizeof(LV_ITEM)); \ + a.iItem= ListView_GetSelectionMark(GetDlgItem(hDlg, b)); \ + a.iSubItem=c; \ + a.mask=LVIF_TEXT; \ + a.pszText=d; \ + a.cchTextMax=e; \ + ListView_GetItem(GetDlgItem(hDlg, b), &a); + +int CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static HBITMAP hBmp; + static bool internal_change; + static bool has_sel; + static int sel_idx; + static uint8 new_sel; + static CheatTracker ct; + switch(msg) + { + case WM_INITDIALOG: + + hBmp=(HBITMAP)LoadImage(NULL, TEXT("funkyass.bmp"), IMAGE_BITMAP, 0,0, LR_CREATEDIBSECTION | LR_LOADFROMFILE); + ListView_SetExtendedListViewStyle(GetDlgItem(hDlg, IDC_CHEAT_LIST), LVS_EX_FULLROWSELECT|LVS_EX_CHECKBOXES); + + SendDlgItemMessage(hDlg, IDC_CHEAT_CODE, EM_LIMITTEXT, 14, 0); + SendDlgItemMessage(hDlg, IDC_CHEAT_DESCRIPTION, EM_LIMITTEXT, 22, 0); + SendDlgItemMessage(hDlg, IDC_CHEAT_ADDRESS, EM_LIMITTEXT, 6, 0); + SendDlgItemMessage(hDlg, IDC_CHEAT_BYTE, EM_LIMITTEXT, 3, 0); + + LVCOLUMN col; + char temp[32]; + strcpy(temp,"Address"); + ZeroMemory(&col, sizeof(LVCOLUMN)); + col.mask=LVCF_FMT|LVCF_ORDER|LVCF_TEXT|LVCF_WIDTH; + col.fmt=LVCFMT_LEFT; + col.iOrder=0; + col.cx=70; + col.cchTextMax=7; + col.pszText=temp; + + ListView_InsertColumn(GetDlgItem(hDlg,IDC_CHEAT_LIST), 0, &col); + + strcpy(temp,"Value"); + ZeroMemory(&col, sizeof(LVCOLUMN)); + col.mask=LVCF_FMT|LVCF_ORDER|LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM; + col.fmt=LVCFMT_LEFT; + col.iOrder=1; + col.cx=43; + col.cchTextMax=3; + col.pszText=temp; + col.iSubItem=1; + + ListView_InsertColumn(GetDlgItem(hDlg,IDC_CHEAT_LIST), 1, &col); + + strcpy(temp,"Description"); + ZeroMemory(&col, sizeof(LVCOLUMN)); + col.mask=LVCF_FMT|LVCF_ORDER|LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM; + col.fmt=LVCFMT_LEFT; + col.iOrder=2; + col.cx=165; + col.cchTextMax=32; + col.pszText=temp; + col.iSubItem=2; + + ListView_InsertColumn(GetDlgItem(hDlg,IDC_CHEAT_LIST), 2, &col); + + ct.index=new int[Cheat.num_cheats]; + ct.state=new DWORD[Cheat.num_cheats]; + + uint32 counter; + for(counter=0; counter=curr_idx) + ct.index[k]++; + } + ct.index[counter]=curr_idx; + ct.state[counter]=Untouched; + + sprintf(buffer, "%02X", Cheat.c[counter].byte); + ZeroMemory(&lvi, sizeof(LVITEM)); + lvi.iItem=curr_idx; + lvi.iSubItem=1; + lvi.mask=LVIF_TEXT; + lvi.pszText=buffer; + lvi.cchTextMax=3; + SendDlgItemMessage(hDlg,IDC_CHEAT_LIST, LVM_SETITEM, 0, (LPARAM)&lvi); + + ZeroMemory(&lvi, sizeof(LVITEM)); + lvi.iItem=curr_idx; + lvi.iSubItem=2; + lvi.mask=LVIF_TEXT; + lvi.pszText=Cheat.c[counter].name; + lvi.cchTextMax=23; + SendDlgItemMessage(hDlg,IDC_CHEAT_LIST, LVM_SETITEM, 0, (LPARAM)&lvi); + + ListView_SetCheckState(GetDlgItem(hDlg,IDC_CHEAT_LIST), curr_idx, Cheat.c[counter].enabled); + + } + return true; + case WM_PAINT: + { + PAINTSTRUCT ps; + BeginPaint (hDlg, &ps); + if(hBmp) + { + BITMAP bmp; + ZeroMemory(&bmp, sizeof(BITMAP)); + RECT r; + GetClientRect(hDlg, &r); + HDC hdc=GetDC(hDlg); + HDC hDCbmp=CreateCompatibleDC(hdc); + GetObject(hBmp, sizeof(BITMAP), &bmp); + HBITMAP hOldBmp=(HBITMAP)SelectObject(hDCbmp, hBmp); + StretchBlt(hdc, 0,0,r.right,r.bottom,hDCbmp,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY); + SelectObject(hDCbmp, hOldBmp); + DeleteDC(hDCbmp); + ReleaseDC(hDlg, hdc); + } + + EndPaint (hDlg, &ps); + } + return true; + case WM_NOTIFY: + { + switch(wParam) + { + case IDC_CHEAT_LIST: + if(0==ListView_GetSelectedCount(GetDlgItem(hDlg, IDC_CHEAT_LIST))) + { + EnableWindow(GetDlgItem(hDlg, IDC_DELETE_CHEAT), false); + EnableWindow(GetDlgItem(hDlg, IDC_UPDATE_CHEAT), false); + has_sel=false; + sel_idx=-1; + } + else + { + EnableWindow(GetDlgItem(hDlg, IDC_DELETE_CHEAT), true); + if(!has_sel||sel_idx!=ListView_GetSelectionMark(GetDlgItem(hDlg, IDC_CHEAT_LIST))) + { + new_sel=3; + //change + char buf[25]; + LV_ITEM lvi; + + ITEM_QUERY (lvi, IDC_CHEAT_LIST, 0, buf, 7); + + SetDlgItemText(hDlg, IDC_CHEAT_ADDRESS, lvi.pszText); + + ITEM_QUERY (lvi, IDC_CHEAT_LIST, 1, &buf[strlen(buf)], 3); + + SetDlgItemText(hDlg, IDC_CHEAT_CODE, buf); + char temp[4]; + int q; + sscanf(lvi.pszText, "%02X", &q); + sprintf(temp, "%d", q); + SetDlgItemText(hDlg, IDC_CHEAT_BYTE, temp); + + ITEM_QUERY (lvi, IDC_CHEAT_LIST, 2, buf, 24); + + internal_change=true; + SetDlgItemText(hDlg, IDC_CHEAT_DESCRIPTION, lvi.pszText); + + } + sel_idx=ListView_GetSelectionMark(GetDlgItem(hDlg, IDC_CHEAT_LIST)); + has_sel=true; + } + + return true; + default: return false; + } + } + case WM_COMMAND: + { + switch(LOWORD(wParam)) + { + case IDC_CHEAT_DESCRIPTION: + { + switch(HIWORD(wParam)) + { + case EN_CHANGE: + + if(internal_change) + { + internal_change=!internal_change; + return false; + } + if(!has_sel) + return true; + EnableWindow(GetDlgItem(hDlg, IDC_UPDATE_CHEAT), true); + return true; + } + break; + + } + case IDC_ADD_CHEAT: + { + char temp[24]; + GetDlgItemText(hDlg, IDC_CHEAT_CODE, temp, 23); + if(strcmp(temp, "")) + { + int j; + bool skip=false; + int count=1; + uint32 addy; + uint8 byte[3]; + //test game genie + if (NULL==S9xGameGenieToRaw (temp, addy, byte[0])) + skip=true; + //test goldfinger + + // if(!skip + + //test PAR + + if(!skip) + { + if(NULL==S9xProActionReplayToRaw(temp, addy, byte[0])) + skip=true; + } + + if(!skip) + return 0; + + for(j=0; j=curr_idx) + ct.index[k]++; + } + + + sprintf(buffer, "%02X", byte[j]); + ZeroMemory(&lvi, sizeof(LVITEM)); + lvi.iItem=curr_idx; + lvi.iSubItem=1; + lvi.mask=LVIF_TEXT; + lvi.pszText=buffer; + lvi.cchTextMax=2; + SendDlgItemMessage(hDlg,IDC_CHEAT_LIST, LVM_SETITEM, 0, (LPARAM)&lvi); + + GetDlgItemText(hDlg, IDC_CHEAT_DESCRIPTION, temp, 23); + + ZeroMemory(&lvi, sizeof(LVITEM)); + lvi.iItem=curr_idx; + lvi.iSubItem=2; + lvi.mask=LVIF_TEXT; + lvi.pszText=temp; + lvi.cchTextMax=23; + SendDlgItemMessage(hDlg,IDC_CHEAT_LIST, LVM_SETITEM, 0, (LPARAM)&lvi); + + addy++; + + + } + } + else + { + uint8 byte; + char buffer[7]; + + GetDlgItemText(hDlg, IDC_CHEAT_ADDRESS, buffer, 7); + + int curr_idx=-1; + LVITEM lvi; + ZeroMemory(&lvi, sizeof(LVITEM)); + lvi.mask=LVIF_TEXT; + lvi.pszText=buffer; + lvi.cchTextMax=6; + lvi.iItem=0; + curr_idx=ListView_InsertItem(GetDlgItem(hDlg,IDC_CHEAT_LIST), &lvi); + + + GetDlgItemText(hDlg, IDC_CHEAT_BYTE, buffer, 7); + + if(buffer[0]=='$') + sscanf(buffer,"$%2X", &byte); + else sscanf(buffer,"%d", &byte); + + sprintf(buffer, "%02X", byte); + + ZeroMemory(&lvi, sizeof(LVITEM)); + lvi.iItem=curr_idx; + lvi.iSubItem=1; + lvi.mask=LVIF_TEXT; + lvi.pszText=buffer; + lvi.cchTextMax=2; + SendDlgItemMessage(hDlg,IDC_CHEAT_LIST, LVM_SETITEM, 0, (LPARAM)&lvi); + + GetDlgItemText(hDlg, IDC_CHEAT_DESCRIPTION, temp, 23); + + ZeroMemory(&lvi, sizeof(LVITEM)); + lvi.iItem=curr_idx; + lvi.iSubItem=2; + lvi.mask=LVIF_TEXT; + lvi.pszText=temp; + lvi.cchTextMax=23; + SendDlgItemMessage(hDlg,IDC_CHEAT_LIST, LVM_SETITEM, 0, (LPARAM)&lvi); + } + } + break; + case IDC_UPDATE_CHEAT: + { + char temp[24]; + GetDlgItemText(hDlg, IDC_CHEAT_CODE, temp, 23); + if(strcmp(temp, "")) + { + int j; + bool skip=false; + int count=1; + uint32 addy; + uint8 byte[3]; + //test game genie + if (NULL==S9xGameGenieToRaw (temp, addy, byte[0])) + skip=true; + //test goldfinger + + // if(!skip + + //test PAR + + if(!skip) + { + if(NULL==S9xProActionReplayToRaw(temp, addy, byte[0])) + skip=true; + } + + if(!skip) + return 0; + + for(j=0;j<(int)Cheat.num_cheats;j++) + { + if(ct.index[j]==sel_idx) + ct.state[j]=Modified; + } + + for(j=0; jsel_idx) + ct.index[j]--; + } + } + ListView_DeleteItem(GetDlgItem(hDlg, IDC_CHEAT_LIST), sel_idx); + + break; + case IDC_CLEAR_CHEATS: + internal_change = true; + SetDlgItemText(hDlg,IDC_CHEAT_CODE,""); + SetDlgItemText(hDlg,IDC_CHEAT_ADDRESS,""); + SetDlgItemText(hDlg,IDC_CHEAT_BYTE,""); + SetDlgItemText(hDlg,IDC_CHEAT_DESCRIPTION,""); + ListView_SetItemState(GetDlgItem(hDlg, IDC_CHEAT_LIST),sel_idx, 0, LVIS_SELECTED|LVIS_FOCUSED); + ListView_SetSelectionMark(GetDlgItem(hDlg, IDC_CHEAT_LIST), -1); + sel_idx=-1; + has_sel=false; + break; + case IDC_CHEAT_CODE: + { + uint32 j, k; + long index; + char buffer[15]; + char buffer2[15]; + POINT point; + switch(HIWORD(wParam)) + { + case EN_CHANGE: + if(internal_change) + { + internal_change=false; + return true; + } + SendMessage((HWND)lParam, WM_GETTEXT, 15,(LPARAM)buffer); + GetCaretPos(&point); + + index = SendMessage((HWND)lParam,(UINT) EM_CHARFROMPOS, 0, (LPARAM) ((point.x&0x0000FFFF) | (((point.y&0x0000FFFF))<<16))); + + k=0; + for(j=0; j='0' && buffer[j]<='9') || (buffer[j]>='A' && buffer[j]<='F') || buffer[j]=='-' || buffer[j]=='X') + { + buffer2[k]=buffer[j]; + k++; + } + else index --; + } + buffer2[k]='\0'; + + if(has_sel&&!new_sel&&strlen(buffer2)!=0) + { + SetDlgItemText(hDlg, IDC_CHEAT_ADDRESS, ""); + SetDlgItemText(hDlg, IDC_CHEAT_BYTE, ""); + + } + + if(new_sel!=0) + new_sel--; + + internal_change=true; + SendMessage((HWND)lParam, WM_SETTEXT, 0,(LPARAM)buffer2); + SendMessage((HWND)lParam, (UINT) EM_SETSEL, (WPARAM) (index), index); + + uint32 addy; + uint8 val; + bool8 sram; + uint8 bytes[3]; + if(NULL==S9xGameGenieToRaw(buffer2, addy, val)||NULL==S9xProActionReplayToRaw(buffer2, addy, val)||NULL==S9xGoldFingerToRaw(buffer2, addy, sram, val, bytes)) + { + if(has_sel) + EnableWindow(GetDlgItem(hDlg, IDC_UPDATE_CHEAT), true); + else EnableWindow(GetDlgItem(hDlg, IDC_UPDATE_CHEAT), false); + EnableWindow(GetDlgItem(hDlg, IDC_ADD_CHEAT), true); + } + else + { + EnableWindow(GetDlgItem(hDlg, IDC_ADD_CHEAT), false); + EnableWindow(GetDlgItem(hDlg, IDC_UPDATE_CHEAT), false); + } + + // SetDlgItemText(hDlg, IDC_CHEAT_ADDRESS, ""); + // SetDlgItemText(hDlg, IDC_CHEAT_BYTE, ""); + break; + } + break; + } + case IDC_CHEAT_ADDRESS: + { + uint32 j, k; + long index; + char buffer[7]; + char buffer2[7]; + POINT point; + switch(HIWORD(wParam)) + { + case EN_CHANGE: + if(internal_change) + { + internal_change=false; + return true; + } + SendMessage((HWND)lParam, WM_GETTEXT, 7,(LPARAM)buffer); + GetCaretPos(&point); + + index = SendMessage((HWND)lParam,(UINT) EM_CHARFROMPOS, 0, (LPARAM) ((point.x&0x0000FFFF) | (((point.y&0x0000FFFF))<<16))); + + k=0; + for(j=0; j='0' && buffer[j]<='9') || (buffer[j]>='A' && buffer[j]<='F')) + { + buffer2[k]=buffer[j]; + k++; + } + else index --; + } + buffer2[k]='\0'; + + + internal_change=true; + SendMessage((HWND)lParam, WM_SETTEXT, 0,(LPARAM)buffer2); + SendMessage((HWND)lParam, (UINT) EM_SETSEL, (WPARAM) (index), index); + + SendMessage(GetDlgItem(hDlg, IDC_CHEAT_BYTE), WM_GETTEXT, 4,(LPARAM)buffer); + + if(has_sel&&!new_sel&&0!=strlen(buffer2)) + SetDlgItemText(hDlg, IDC_CHEAT_CODE, ""); + + if(new_sel!=0) + new_sel--; + + if(strlen(buffer2)!=0 && strlen(buffer) !=0) + { + if(has_sel) + EnableWindow(GetDlgItem(hDlg, IDC_UPDATE_CHEAT), true); + else EnableWindow(GetDlgItem(hDlg, IDC_UPDATE_CHEAT), false); + EnableWindow(GetDlgItem(hDlg, IDC_ADD_CHEAT), true); + } + else + { + EnableWindow(GetDlgItem(hDlg, IDC_ADD_CHEAT), false); + EnableWindow(GetDlgItem(hDlg, IDC_UPDATE_CHEAT), false); + } + //SetDlgItemText(hDlg, IDC_CHEAT_CODE, ""); + break; + } + break; + } + case IDC_CHEAT_BYTE: + { + uint32 j, k; + long index; + char buffer[4]; + char buffer2[4]; + POINT point; + switch(HIWORD(wParam)) + { + case EN_CHANGE: + if(internal_change) + { + internal_change=false; + return true; + } + SendMessage((HWND)lParam, WM_GETTEXT, 4,(LPARAM)buffer); + GetCaretPos(&point); + + index = SendMessage((HWND)lParam,(UINT) EM_CHARFROMPOS, 0, (LPARAM) ((point.x&0x0000FFFF) | (((point.y&0x0000FFFF))<<16))); + + k=0; + for(j=0; j='0' && buffer[j]<='9') || (buffer[j]>='A' && buffer[j]<='F') || buffer[j]=='$') + { + buffer2[k]=buffer[j]; + k++; + } + else index --; + } + buffer2[k]='\0'; + + if(has_sel&&!new_sel&&0!=strlen(buffer2)) + SetDlgItemText(hDlg, IDC_CHEAT_CODE, ""); + + if(new_sel!=0) + new_sel--; + + internal_change=true; + SendMessage((HWND)lParam, WM_SETTEXT, 0,(LPARAM)buffer2); + SendMessage((HWND)lParam, (UINT) EM_SETSEL, (WPARAM) (index), index); + + SendMessage(GetDlgItem(hDlg, IDC_CHEAT_ADDRESS), WM_GETTEXT, 7,(LPARAM)buffer); + if(strlen(buffer2)!=0 && strlen(buffer) !=0) + { + if(has_sel) + EnableWindow(GetDlgItem(hDlg, IDC_UPDATE_CHEAT), true); + else EnableWindow(GetDlgItem(hDlg, IDC_UPDATE_CHEAT), false); + EnableWindow(GetDlgItem(hDlg, IDC_ADD_CHEAT), true); + } + else + { + EnableWindow(GetDlgItem(hDlg, IDC_ADD_CHEAT), false); + EnableWindow(GetDlgItem(hDlg, IDC_UPDATE_CHEAT), false); + } + //SetDlgItemText(hDlg, IDC_CHEAT_CODE, ""); + break; + } + break; + } + case IDOK: + { + int k,l; + bool hit; + for(k=0;k=0;l--) + { + if(ct.state[l]==Deleted) + { + S9xDeleteCheat(l); + } + } + } + case IDCANCEL: + delete [] ct.index; + delete [] ct.state; + EndDialog(hDlg, 0); + if(hBmp) + { + DeleteObject(hBmp); + hBmp=NULL; + } + return true; + default:return false; + } + } + default: return false; + } +} + + +#define TEST_BIT(a,v) \ +((a)[(v) >> 5] & (1 << ((v) & 31))) + +#define CHEAT_COUNT(a, b) for(a=0;a<0x20000-bytes;a++) \ + { \ + if(TEST_BIT(Cheat.WRAM_BITS, a)) \ + b++; \ + } + +struct ICheat +{ + uint32 address; + uint32 new_val; + uint32 saved_val; + int size; + bool8 enabled; + bool8 saved; + char name [22]; + int format; +}; + +bool TestRange(int val_type, S9xCheatDataSize bytes, uint32 value) +{ + if(val_type!=2) + { + if(bytes==S9X_8_BITS) + { + if(value<256) + return true; + else return false; + } + if(bytes==S9X_16_BITS) + { + if(value<65536) + return true; + else return false; + } + if(bytes==S9X_24_BITS) + { + if(value<16777216) + return true; + else return false; + } + //if it reads in, it's a valid 32-bit unsigned! + return true; + } + else + { + if(bytes==S9X_8_BITS) + { + if(value<128 && value >= -128) + return true; + else return false; + } + if(bytes==S9X_16_BITS) + { + if(value<32768 && value >= -32768) + return true; + else return false; + } + if(bytes==S9X_24_BITS) + { + if(value<8388608&& value >= -8388608) + return true; + else return false; + } + //should be handled by sscanf + return true; + } +} + + +int CALLBACK DlgCheatSearch(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static HBITMAP hBmp; + static S9xCheatDataSize bytes; + static int val_type; + static bool use_entered; + static S9xCheatComparisonType comp_type; + switch(msg) + { + case WM_INITDIALOG: + { + if(val_type==0) + val_type=1; + hBmp=(HBITMAP)LoadImage(NULL, TEXT("Raptor.bmp"), IMAGE_BITMAP, 0,0, LR_CREATEDIBSECTION | LR_LOADFROMFILE); + ListView_SetExtendedListViewStyle(GetDlgItem(hDlg, IDC_ADDYS), LVS_EX_FULLROWSELECT); + + //defaults + SendDlgItemMessage(hDlg, IDC_LESS_THAN, BM_SETCHECK, BST_CHECKED, 0); + if(!use_entered) + SendDlgItemMessage(hDlg, IDC_PREV, BM_SETCHECK, BST_CHECKED, 0); + else + { + SendDlgItemMessage(hDlg, IDC_ENTERED, BM_SETCHECK, BST_CHECKED, 0); + EnableWindow(GetDlgItem(hDlg, IDC_VALUE_ENTER), true); + EnableWindow(GetDlgItem(hDlg, IDC_ENTER_LABEL), true); + } + SendDlgItemMessage(hDlg, IDC_UNSIGNED, BM_SETCHECK, BST_CHECKED, 0); + SendDlgItemMessage(hDlg, IDC_1_BYTE, BM_SETCHECK, BST_CHECKED, 0); + + if(comp_type==S9X_GREATER_THAN) + { + SendDlgItemMessage(hDlg, IDC_LESS_THAN, BM_SETCHECK, BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_GREATER_THAN, BM_SETCHECK, BST_CHECKED, 0); + } + else if(comp_type==S9X_LESS_THAN_OR_EQUAL) + { + SendDlgItemMessage(hDlg, IDC_LESS_THAN, BM_SETCHECK, BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_LESS_THAN_EQUAL, BM_SETCHECK, BST_CHECKED, 0); + + } + else if(comp_type==S9X_GREATER_THAN_OR_EQUAL) + { + SendDlgItemMessage(hDlg, IDC_LESS_THAN, BM_SETCHECK, BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_GREATER_THAN_EQUAL, BM_SETCHECK, BST_CHECKED, 0); + + } + else if(comp_type==S9X_EQUAL) + { + SendDlgItemMessage(hDlg, IDC_LESS_THAN, BM_SETCHECK, BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_EQUAL, BM_SETCHECK, BST_CHECKED, 0); + + } + else if(comp_type==S9X_NOT_EQUAL) + { + SendDlgItemMessage(hDlg, IDC_LESS_THAN, BM_SETCHECK, BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_NOT_EQUAL, BM_SETCHECK, BST_CHECKED, 0); + + } + + if(val_type==2) + { + SendDlgItemMessage(hDlg, IDC_UNSIGNED, BM_SETCHECK, BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_SIGNED, BM_SETCHECK, BST_CHECKED, 0); + + } + else if(val_type==3) + { + SendDlgItemMessage(hDlg, IDC_UNSIGNED, BM_SETCHECK, BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_HEX, BM_SETCHECK, BST_CHECKED, 0); + } + + if(bytes==S9X_16_BITS) + { + SendDlgItemMessage(hDlg, IDC_1_BYTE, BM_SETCHECK, BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_2_BYTE, BM_SETCHECK, BST_CHECKED, 0); + } + else if(bytes==S9X_24_BITS) + { + SendDlgItemMessage(hDlg, IDC_1_BYTE, BM_SETCHECK, BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_3_BYTE, BM_SETCHECK, BST_CHECKED, 0); + } + else if(bytes==S9X_32_BITS) + { + SendDlgItemMessage(hDlg, IDC_1_BYTE, BM_SETCHECK, BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_4_BYTE, BM_SETCHECK, BST_CHECKED, 0); + } + + LVCOLUMN col; + char temp[32]; + strcpy(temp,"Address"); + ZeroMemory(&col, sizeof(LVCOLUMN)); + col.mask=LVCF_FMT|LVCF_ORDER|LVCF_TEXT|LVCF_WIDTH; + col.fmt=LVCFMT_LEFT; + col.iOrder=0; + col.cx=70; + col.cchTextMax=7; + col.pszText=temp; + + ListView_InsertColumn(GetDlgItem(hDlg,IDC_ADDYS), 0, &col); + + strcpy(temp,"Curr. Value"); + ZeroMemory(&col, sizeof(LVCOLUMN)); + col.mask=LVCF_FMT|LVCF_ORDER|LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM; + col.fmt=LVCFMT_LEFT; + col.iOrder=1; + col.cx=104; + col.cchTextMax=3; + col.pszText=temp; + col.iSubItem=1; + + ListView_InsertColumn(GetDlgItem(hDlg,IDC_ADDYS), 1, &col); + + strcpy(temp,"Prev. Value"); + ZeroMemory(&col, sizeof(LVCOLUMN)); + col.mask=LVCF_FMT|LVCF_ORDER|LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM; + col.fmt=LVCFMT_LEFT; + col.iOrder=2; + col.cx=104; + col.cchTextMax=32; + col.pszText=temp; + col.iSubItem=2; + + ListView_InsertColumn(GetDlgItem(hDlg,IDC_ADDYS), 2, &col); + + { + int k=0, l=0; + CHEAT_COUNT(k,l); + ListView_SetItemCount (GetDlgItem(hDlg, IDC_ADDYS), l); + } + + } + return true; + case WM_PAINT: + { + PAINTSTRUCT ps; + BeginPaint (hDlg, &ps); + if(hBmp) + { + BITMAP bmp; + ZeroMemory(&bmp, sizeof(BITMAP)); + RECT r; + GetClientRect(hDlg, &r); + HDC hdc=GetDC(hDlg); + HDC hDCbmp=CreateCompatibleDC(hdc); + GetObject(hBmp, sizeof(BITMAP), &bmp); + HBITMAP hOldBmp=(HBITMAP)SelectObject(hDCbmp, hBmp); + StretchBlt(hdc, 0,0,r.right,r.bottom,hDCbmp,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY); + SelectObject(hDCbmp, hOldBmp); + DeleteDC(hDCbmp); + ReleaseDC(hDlg, hdc); + } + + EndPaint (hDlg, &ps); + } + return true; + case WM_NOTIFY: + { + if(wParam == IDC_ADDYS) + { + NMHDR * nmh=(NMHDR*)lParam; + if(nmh->hwndFrom == GetDlgItem(hDlg, IDC_ADDYS) && nmh->code == LVN_GETDISPINFO) + { + TCHAR buf[8]; + int i, j; + NMLVDISPINFO * nmlvdi=(NMLVDISPINFO*)lParam; + j=nmlvdi->item.iItem; + j++; + for(i=0;i<(0x20000-bytes)&& j>0;i++) + { + if(TEST_BIT(Cheat.WRAM_BITS, i)) + j--; + } + if (i>=0x20000 && j!=0) + { + return false; + } + i--; + if(j=nmlvdi->item.iSubItem==0) + { + sprintf(buf, "%06X", i+0x7E0000); + nmlvdi->item.pszText=buf; + nmlvdi->item.cchTextMax=8; + } + if(j=nmlvdi->item.iSubItem==1) + { + int q=0, r=0; + for(r=0;r<=bytes;r++) + q+=(Cheat.RAM[i+r])<<(8*r); + //needs to account for size + switch(val_type) + { + case 1: + sprintf(buf, "%u", q); + break; + case 3: + { + switch(bytes) + { + default: + case S9X_8_BITS:sprintf(buf, "%02X", q&0xFF);break; + case S9X_16_BITS: sprintf(buf, "%04X", q&0xFFFF); break; + case S9X_24_BITS: sprintf(buf, "%06X", q&0xFFFFFF);break; + case S9X_32_BITS: sprintf(buf, "%08X", q);break; + } + } + break; + case 2: + default: + switch(bytes) + { + default: + case S9X_8_BITS: + if((q-128)<0) + sprintf(buf, "%d", q&0xFF); + else sprintf(buf, "%d", q-256); + break; + case S9X_16_BITS: + if((q-32768)<0) + sprintf(buf, "%d", q&0xFFFF); + else sprintf(buf, "%d", q-65536); + break; + case S9X_24_BITS: + if((q-0x800000)<0) + sprintf(buf, "%d", q&0xFFFFFF); + else sprintf(buf, "%d", q-0x1000000); + break; + + case S9X_32_BITS: sprintf(buf, "%d", q);break; + } + break; + } + nmlvdi->item.pszText=buf; + nmlvdi->item.cchTextMax=4; + } + if(j=nmlvdi->item.iSubItem==2) + { + int q=0, r=0; + for(r=0;r<=bytes;r++) + q+=(Cheat.CWRAM[i+r])<<(8*r); + //needs to account for size + switch(val_type) + { + case 1: + sprintf(buf, "%u", q); + break; + case 3: + { + switch(bytes) + { + default: + case S9X_8_BITS:sprintf(buf, "%02X", q&0xFF);break; + case S9X_16_BITS: sprintf(buf, "%04X", q&0xFFFF); break; + case S9X_24_BITS: sprintf(buf, "%06X", q&0xFFFFFF);break; + case S9X_32_BITS: sprintf(buf, "%08X", q);break; + } + break; + } + case 2: + default: + switch(bytes) + { + default: + case S9X_8_BITS: + if((q-128)<0) + sprintf(buf, "%d", q&0xFF); + else sprintf(buf, "%d", q-256); + break; + case S9X_16_BITS: + if((q-32768)<0) + sprintf(buf, "%d", q&0xFFFF); + else sprintf(buf, "%d", q-65536); + break; + case S9X_24_BITS: + if((q-0x800000)<0) + sprintf(buf, "%d", q&0xFFFFFF); + else sprintf(buf, "%d", q-0x1000000); + break; + + case S9X_32_BITS: sprintf(buf, "%d", q);break; + } + break; + } + nmlvdi->item.pszText=buf; + nmlvdi->item.cchTextMax=4; + } + nmlvdi->item.mask=LVIF_TEXT; + + } + else if(nmh->hwndFrom == GetDlgItem(hDlg, IDC_ADDYS) && (nmh->code == LVN_ITEMACTIVATE||nmh->code == NM_CLICK)) + { + bool enable=true; + if(-1==ListView_GetSelectionMark(nmh->hwndFrom)) + { + enable=false; + } + EnableWindow(GetDlgItem(hDlg, IDC_C_ADD), enable); + } + } + } + break; + case WM_COMMAND: + { + switch(LOWORD(wParam)) + { + case IDC_LESS_THAN: + case IDC_GREATER_THAN: + case IDC_LESS_THAN_EQUAL: + case IDC_GREATER_THAN_EQUAL: + case IDC_EQUAL: + case IDC_NOT_EQUAL: + if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_LESS_THAN)) + comp_type=S9X_LESS_THAN; + else if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_GREATER_THAN)) + comp_type=S9X_GREATER_THAN; + else if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_LESS_THAN_EQUAL)) + comp_type=S9X_LESS_THAN_OR_EQUAL; + else if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_GREATER_THAN_EQUAL)) + comp_type=S9X_GREATER_THAN_OR_EQUAL; + else if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_EQUAL)) + comp_type=S9X_EQUAL; + else if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_NOT_EQUAL)) + comp_type=S9X_NOT_EQUAL; + + break; + case IDC_1_BYTE: + case IDC_2_BYTE: + case IDC_3_BYTE: + case IDC_4_BYTE: + if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_1_BYTE)) + bytes=S9X_8_BITS; + else if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_2_BYTE)) + bytes=S9X_16_BITS; + else if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_3_BYTE)) + bytes=S9X_24_BITS; + else bytes=S9X_32_BITS; + { + int k=0, l=0; + CHEAT_COUNT(k,l); + ListView_SetItemCount (GetDlgItem(hDlg, IDC_ADDYS), l); + } + + break; + + case IDC_SIGNED: + case IDC_UNSIGNED: + case IDC_HEX: + if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_UNSIGNED)) + val_type=1; + else if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_SIGNED)) + val_type=2; + else val_type=3; + ListView_RedrawItems(GetDlgItem(hDlg, IDC_ADDYS),0, 0x20000); + break; + case IDC_C_ADD: + { + // account for size + struct ICheat cht; + int idx=-1; + LVITEM lvi; + TCHAR buf[12]; + ZeroMemory(&cht, sizeof(struct SCheat)); + + //retrieve and convert to SCheat + + if(bytes==S9X_8_BITS) + cht.size=1; + else if (bytes==S9X_16_BITS) + cht.size=2; + else if (bytes==S9X_24_BITS) + cht.size=3; + else if (bytes==S9X_32_BITS) + cht.size=4; + + + ITEM_QUERY(lvi, IDC_ADDYS, 0, buf, 7); + sscanf(buf, "%6X", &cht.address); + memset(buf, 0, 7); + if(val_type==1) + { + ITEM_QUERY(lvi, IDC_ADDYS, 1, buf, 12); + sscanf(buf, "%u", &cht.new_val); + memset(buf, 0, 7); + ITEM_QUERY(lvi, IDC_ADDYS, 2, buf, 12); + sscanf(buf, "%u", &cht.saved_val); + } + else if(val_type==3) + { + ITEM_QUERY(lvi, IDC_ADDYS, 1, buf, 12); + sscanf(buf, "%x", &cht.new_val); + memset(buf, 0, 7); + ITEM_QUERY(lvi, IDC_ADDYS, 2, buf, 12); + sscanf(buf, "%x", &cht.saved_val); + } + else + { + ITEM_QUERY(lvi, IDC_ADDYS, 1, buf, 12); + sscanf(buf, "%d", &cht.new_val); + memset(buf, 0, 7); + ITEM_QUERY(lvi, IDC_ADDYS, 2, buf, 12); + sscanf(buf, "%d", &cht.saved_val); + } + cht.format=val_type; + //invoke dialog + if(!DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_CHEAT_FROM_SEARCH), hDlg, DlgCheatSearchAdd, (LPARAM)&cht)) + { + int p; + for(p=0; p>(8*p))&0xFF)); + //add cheat + strcpy(Cheat.c[Cheat.num_cheats-1].name, cht.name); + } + } + } + break; + case IDC_C_RESET: + S9xStartCheatSearch(&Cheat); + { + int k=0, l=0; + CHEAT_COUNT(k,l); + ListView_SetItemCount (GetDlgItem(hDlg, IDC_ADDYS), l); + } + ListView_RedrawItems(GetDlgItem(hDlg, IDC_ADDYS),0, 0x20000); + val_type=1; + SendDlgItemMessage(hDlg, IDC_UNSIGNED, BM_SETCHECK, BST_CHECKED, 0); + SendDlgItemMessage(hDlg, IDC_SIGNED, BM_SETCHECK, BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_HEX, BM_SETCHECK, BST_UNCHECKED, 0); + + bytes=S9X_8_BITS; + SendDlgItemMessage(hDlg, IDC_1_BYTE, BM_SETCHECK, BST_CHECKED, 0); + SendDlgItemMessage(hDlg, IDC_2_BYTE, BM_SETCHECK, BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_3_BYTE, BM_SETCHECK, BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_4_BYTE, BM_SETCHECK, BST_UNCHECKED, 0); + + + use_entered=false; + SendDlgItemMessage(hDlg, IDC_PREV, BM_SETCHECK, BST_CHECKED, 0); + SendDlgItemMessage(hDlg, IDC_ENTERED, BM_SETCHECK, BST_UNCHECKED, 0); + EnableWindow(GetDlgItem(hDlg, IDC_VALUE_ENTER), false); + EnableWindow(GetDlgItem(hDlg, IDC_ENTER_LABEL), false); + + comp_type=S9X_LESS_THAN; + SendDlgItemMessage(hDlg, IDC_LESS_THAN, BM_SETCHECK, BST_CHECKED, 0); + SendDlgItemMessage(hDlg, IDC_GREATER_THAN, BM_SETCHECK, BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_LESS_THAN_EQUAL, BM_SETCHECK, BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_GREATER_THAN_EQUAL, BM_SETCHECK, BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_EQUAL, BM_SETCHECK, BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg, IDC_NOT_EQUAL, BM_SETCHECK, BST_UNCHECKED, 0); + return true; + + case IDC_ENTERED: + case IDC_PREV: + if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_ENTERED)) + { + use_entered=true; + EnableWindow(GetDlgItem(hDlg, IDC_VALUE_ENTER), true); + EnableWindow(GetDlgItem(hDlg, IDC_ENTER_LABEL), true); + } + else + { + use_entered=false; + EnableWindow(GetDlgItem(hDlg, IDC_VALUE_ENTER), false); + EnableWindow(GetDlgItem(hDlg, IDC_ENTER_LABEL), false); + } + return true; + break; + case IDC_C_SEARCH: + { + val_type=0; + + if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_LESS_THAN)) + comp_type=S9X_LESS_THAN; + else if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_GREATER_THAN)) + comp_type=S9X_GREATER_THAN; + else if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_LESS_THAN_EQUAL)) + comp_type=S9X_LESS_THAN_OR_EQUAL; + else if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_GREATER_THAN_EQUAL)) + comp_type=S9X_GREATER_THAN_OR_EQUAL; + else if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_EQUAL)) + comp_type=S9X_EQUAL; + else comp_type=S9X_NOT_EQUAL; + + if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_UNSIGNED)) + val_type=1; + else if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_SIGNED)) + val_type=2; + else val_type=3; + + + + if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_1_BYTE)) + bytes=S9X_8_BITS; + else if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_2_BYTE)) + bytes=S9X_16_BITS; + else if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_3_BYTE)) + bytes=S9X_24_BITS; + else bytes=S9X_32_BITS; + + + if(BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_ENTERED)) + { + TCHAR buf[20]; + GetDlgItemText(hDlg, IDC_VALUE_ENTER, buf, 20); + uint32 value; + int ret; + if(val_type==1) + ret=_stscanf(buf, "%ul", &value); + else if (val_type==2) + ret=_stscanf(buf, "%d", &value); + else ret=_stscanf(buf, "%x", &value); + + + + if(ret!=1||!TestRange(val_type, bytes, value)) + { + MessageBox(hDlg, TEXT("Please enter a valid value for a search!"), TEXT("Snes9x Cheat Error"), MB_OK); + return true; + } + + S9xSearchForValue (&Cheat, comp_type, + bytes, value, + (val_type==2), FALSE); + + } + else + { + S9xSearchForChange (&Cheat, comp_type, + bytes, (val_type==2), FALSE); + } + int k=0, l=0; + CHEAT_COUNT(k,l); + ListView_SetItemCount (GetDlgItem(hDlg, IDC_ADDYS), l); + } + + + ListView_RedrawItems(GetDlgItem(hDlg, IDC_ADDYS),0, 0x20000); + return true; + break; + case IDOK: + CopyMemory(Cheat.CWRAM, Cheat.RAM, 0x20000); + CopyMemory(Cheat.CSRAM, Cheat.SRAM, 0x10000); + CopyMemory(Cheat.CIRAM, Cheat.FillRAM, 0x2000); + case IDCANCEL: + EndDialog(hDlg, 0); + if(hBmp) + { + DeleteObject(hBmp); + hBmp=NULL; + }; + return true; + default: break; + } + } + default: return false; + } + return false; +} + +int CALLBACK DlgCheatSearchAdd(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static struct ICheat* new_cheat; + int ret=-1; + static HBITMAP hBmp; + switch(msg) + { + case WM_INITDIALOG: + { + TCHAR buf [12]; + new_cheat=(struct ICheat*)lParam; + hBmp=(HBITMAP)LoadImage(NULL, TEXT("Gary.bmp"), IMAGE_BITMAP, 0,0, LR_CREATEDIBSECTION | LR_LOADFROMFILE); + sprintf(buf, "%06X", new_cheat->address); + SetDlgItemText(hDlg, IDC_NC_ADDRESS, buf); + switch(new_cheat->format) + { + default: + case 1://UNSIGNED + memset(buf,0,12); + sprintf(buf, "%u", new_cheat->new_val); + SetDlgItemText(hDlg, IDC_NC_CURRVAL, buf); + memset(buf,0,12); + sprintf(buf, "%u", new_cheat->saved_val); + SetDlgItemText(hDlg, IDC_NC_PREVVAL, buf); + SetWindowLong(GetDlgItem(hDlg, IDC_NC_NEWVAL), GWL_STYLE, ES_NUMBER |GetWindowLong(GetDlgItem(hDlg, IDC_NC_NEWVAL),GWL_STYLE)); + SetWindowLong(GetDlgItem(hDlg, IDC_NC_CURRVAL), GWL_STYLE, ES_NUMBER |GetWindowLong(GetDlgItem(hDlg, IDC_NC_CURRVAL),GWL_STYLE)); + SetWindowLong(GetDlgItem(hDlg, IDC_NC_PREVVAL), GWL_STYLE, ES_NUMBER |GetWindowLong(GetDlgItem(hDlg, IDC_NC_PREVVAL),GWL_STYLE)); + if(new_cheat->size==1) + { + SendDlgItemMessage(hDlg, IDC_NC_CURRVAL,EM_SETLIMITTEXT, 3, 0); + SendDlgItemMessage(hDlg, IDC_NC_PREVVAL,EM_SETLIMITTEXT, 3, 0); + SendDlgItemMessage(hDlg, IDC_NC_NEWVAL,EM_SETLIMITTEXT, 3, 0); + + } + if(new_cheat->size==2) + { + SendDlgItemMessage(hDlg, IDC_NC_CURRVAL,EM_SETLIMITTEXT, 5, 0); + SendDlgItemMessage(hDlg, IDC_NC_PREVVAL,EM_SETLIMITTEXT, 5, 0); + SendDlgItemMessage(hDlg, IDC_NC_NEWVAL,EM_SETLIMITTEXT, 5, 0); + + } + if(new_cheat->size==3) + { + SendDlgItemMessage(hDlg, IDC_NC_CURRVAL,EM_SETLIMITTEXT, 8, 0); + SendDlgItemMessage(hDlg, IDC_NC_PREVVAL,EM_SETLIMITTEXT, 8, 0); + SendDlgItemMessage(hDlg, IDC_NC_NEWVAL,EM_SETLIMITTEXT, 8, 0); + + } + if(new_cheat->size==4) + { + SendDlgItemMessage(hDlg, IDC_NC_CURRVAL,EM_SETLIMITTEXT, 10, 0); + SendDlgItemMessage(hDlg, IDC_NC_PREVVAL,EM_SETLIMITTEXT, 10, 0); + SendDlgItemMessage(hDlg, IDC_NC_NEWVAL,EM_SETLIMITTEXT, 10, 0); + + } + break; + case 3: + { + char formatstring[10]; + sprintf(formatstring, "%%%02dX",new_cheat->size*2); + memset(buf,0,12); + sprintf(buf, formatstring, new_cheat->new_val); + SetDlgItemText(hDlg, IDC_NC_CURRVAL, buf); + memset(buf,0,12); + sprintf(buf, formatstring, new_cheat->saved_val); + SetDlgItemText(hDlg, IDC_NC_PREVVAL, buf); + SendDlgItemMessage(hDlg, IDC_NC_CURRVAL,EM_SETLIMITTEXT, new_cheat->size*2, 0); + SendDlgItemMessage(hDlg, IDC_NC_PREVVAL,EM_SETLIMITTEXT, new_cheat->size*2, 0); + SendDlgItemMessage(hDlg, IDC_NC_NEWVAL,EM_SETLIMITTEXT, new_cheat->size*2, 0); + + } + break; //HEX + case 2: + memset(buf,0,12); + sprintf(buf, "%d", new_cheat->new_val); + SetDlgItemText(hDlg, IDC_NC_CURRVAL, buf); + memset(buf,0,12); + sprintf(buf, "%d", new_cheat->saved_val); + SetDlgItemText(hDlg, IDC_NC_PREVVAL, buf); + if(new_cheat->size==1) + { + //-128 + SendDlgItemMessage(hDlg, IDC_NC_CURRVAL,EM_SETLIMITTEXT, 4, 0); + SendDlgItemMessage(hDlg, IDC_NC_PREVVAL,EM_SETLIMITTEXT, 4, 0); + SendDlgItemMessage(hDlg, IDC_NC_NEWVAL,EM_SETLIMITTEXT, 4, 0); + } + if(new_cheat->size==2) + { + //-32768 + SendDlgItemMessage(hDlg, IDC_NC_CURRVAL,EM_SETLIMITTEXT, 6, 0); + SendDlgItemMessage(hDlg, IDC_NC_PREVVAL,EM_SETLIMITTEXT, 6, 0); + SendDlgItemMessage(hDlg, IDC_NC_NEWVAL,EM_SETLIMITTEXT, 6, 0); + } + if(new_cheat->size==3) + { + //-8388608 + SendDlgItemMessage(hDlg, IDC_NC_CURRVAL,EM_SETLIMITTEXT, 8, 0); + SendDlgItemMessage(hDlg, IDC_NC_PREVVAL,EM_SETLIMITTEXT, 8, 0); + SendDlgItemMessage(hDlg, IDC_NC_NEWVAL,EM_SETLIMITTEXT, 8, 0); + } + if(new_cheat->size==4) + { + //-2147483648 + SendDlgItemMessage(hDlg, IDC_NC_CURRVAL,EM_SETLIMITTEXT, 11, 0); + SendDlgItemMessage(hDlg, IDC_NC_PREVVAL,EM_SETLIMITTEXT, 11, 0); + SendDlgItemMessage(hDlg, IDC_NC_NEWVAL,EM_SETLIMITTEXT, 11, 0); + } + break; + } + } + return true; + case WM_PAINT: + { + PAINTSTRUCT ps; + BeginPaint (hDlg, &ps); + if(hBmp) + { + BITMAP bmp; + ZeroMemory(&bmp, sizeof(BITMAP)); + RECT r; + GetClientRect(hDlg, &r); + HDC hdc=GetDC(hDlg); + HDC hDCbmp=CreateCompatibleDC(hdc); + GetObject(hBmp, sizeof(BITMAP), &bmp); + HBITMAP hOldBmp=(HBITMAP)SelectObject(hDCbmp, hBmp); + StretchBlt(hdc, 0,0,r.right,r.bottom,hDCbmp,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY); + SelectObject(hDCbmp, hOldBmp); + DeleteDC(hDCbmp); + ReleaseDC(hDlg, hdc); + } + + EndPaint (hDlg, &ps); + } + return true; + case WM_COMMAND: + { + switch(LOWORD(wParam)) + { + case IDOK: + { + int ret; + TCHAR buf[23]; + int temp=new_cheat->size; + S9xCheatDataSize tmp; + ZeroMemory(new_cheat, sizeof(struct SCheat)); + new_cheat->size=temp; + GetDlgItemText(hDlg, IDC_NC_ADDRESS, buf, 7); + sscanf(buf, "%6X", &new_cheat->address); + + if(temp==1) + tmp=S9X_8_BITS; + if(temp==2) + tmp=S9X_16_BITS; + if(temp==3) + tmp=S9X_24_BITS; + if(temp==4) + tmp=S9X_32_BITS; + + + if(0!=GetDlgItemText(hDlg, IDC_NC_NEWVAL, buf, 12)) + { + if(new_cheat->format==2) + ret=sscanf(buf, "%d", &new_cheat->new_val); + else if(new_cheat->format==1) + ret=sscanf(buf, "%u", &new_cheat->new_val); + else if(new_cheat->format==3) + ret=sscanf(buf, "%x", &new_cheat->new_val); + + if(ret!=1 || !TestRange(new_cheat->format, tmp, new_cheat->new_val)) + { + MessageBox(hDlg, "You have entered an out of range or invalid value for the new value", "Range Error", MB_OK); + return true; + } + + + if(0==GetDlgItemText(hDlg, IDC_NC_CURRVAL, buf, 12)) + new_cheat->saved=FALSE; + else + { + int i; + if(new_cheat->format==2) + ret=sscanf(buf, "%d", &i); + else if(new_cheat->format==1) + ret=sscanf(buf, "%u", &i); + else if(new_cheat->format==3) + ret=sscanf(buf, "%x", &i); + + if(ret!=1 || !TestRange(new_cheat->format, tmp, i)) + { + MessageBox(hDlg, "You have entered an out of range or invalid value for\n"\ + "the current value. This value is used when a cheat is unapplied.\n"\ + "(If left blank, no value is restored when the cheat is unapplied)", "Range Error", MB_OK); + return true; + } + + + new_cheat->saved_val=i; + new_cheat->saved=TRUE; + } + GetDlgItemText(hDlg, IDC_NC_DESC, new_cheat->name, 23); + + new_cheat->enabled=TRUE; + S9xAddCheat(new_cheat->enabled,new_cheat->saved_val,new_cheat->address,new_cheat->new_val); + strcpy(Cheat.c[Cheat.num_cheats-1].name,new_cheat->name); + ret=0; + } + } + + case IDCANCEL: + EndDialog(hDlg, ret); + if(hBmp) + { + DeleteObject(hBmp); + hBmp=NULL; + } + return true; + default: break; + } + } + default: return false; + } +} + +static void set_movieinfo(const char* path, HWND hDlg) +{ + MovieInfo m; + int i; + + if(strlen(path) && S9xMovieGetInfo(path, &m)==SUCCESS) + { + char* p; + char tmpstr[128]; + strncpy(tmpstr, ctime(&m.TimeCreated), 127); + tmpstr[127]='\0'; + if((p=strrchr(tmpstr, '\n'))) + *p='\0'; + SetWindowTextA(GetDlgItem(hDlg, IDC_MOVIE_DATE), tmpstr); + + uint32 div = Memory.ROMFramesPerSecond; + uint32 l=(m.LengthFrames+(div>>1))/div; + uint32 seconds=l%60; + l/=60; + uint32 minutes=l%60; + l/=60; + uint32 hours=l%60; + sprintf(tmpstr, "%02d:%02d:%02d", hours, minutes, seconds); + SetWindowTextA(GetDlgItem(hDlg, IDC_MOVIE_LENGTH), tmpstr); + sprintf(tmpstr, "%ld", m.LengthFrames); + SetWindowTextA(GetDlgItem(hDlg, IDC_MOVIE_FRAMES), tmpstr); + sprintf(tmpstr, "%ld", m.RerecordCount); + SetWindowTextA(GetDlgItem(hDlg, IDC_MOVIE_RERECORD), tmpstr); + + // set author comment: + { +/// SetWindowTextW(GetDlgItem(hDlg, IDC_MOVIE_METADATA), m.Metadata); // won't work, because of & symbol + + wchar_t metadata [MOVIE_MAX_METADATA]; + int j, pos = 0, len = wcslen(m.Metadata); + for (j = 0; j < len ; j++) + { + wchar_t c = m.Metadata [j]; + metadata [pos++] = c; + + // & is a special character in Windows fields, + // so we have to change & to && when copying over the game title + // otherwise "Pocky & Rocky" will show up as "Pocky Rocky", for example + if(c == (wchar_t)'&') + metadata [pos++] = (wchar_t)'&'; + } + metadata [pos] = (wchar_t)'\0'; + + SetWindowTextW(GetDlgItem(hDlg, IDC_MOVIE_METADATA), metadata); + } + + if(m.ReadOnly) + { + EnableWindow(GetDlgItem(hDlg, IDC_READONLY), FALSE); + SendDlgItemMessage(hDlg,IDC_READONLY,BM_SETCHECK,BST_CHECKED,0); + } + else + { + EnableWindow(GetDlgItem(hDlg, IDC_READONLY), TRUE); +/// SendDlgItemMessage(hDlg,IDC_READONLY,BM_SETCHECK,BST_UNCHECKED,0); + } + EnableWindow(GetDlgItem(hDlg, IDC_DISPLAY_INPUT), TRUE); + + for(i=0; i<5; ++i) + { + SendDlgItemMessage(hDlg,IDC_JOY1+i,BM_SETCHECK,(m.ControllersMask & (1<SyncFlags & MOVIE_SYNC_DATA_EXISTS) + { + SendDlgItemMessage(hDlg,IDC_WIP1,BM_SETCHECK, (op->SyncFlags & MOVIE_SYNC_WIP1TIMING)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ALLOWLEFTRIGHT,BM_SETCHECK, (op->SyncFlags & MOVIE_SYNC_LEFTRIGHT)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ENVX,BM_SETCHECK, (op->SyncFlags & MOVIE_SYNC_VOLUMEENVX)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_FMUT,BM_SETCHECK, (op->SyncFlags & MOVIE_SYNC_FAKEMUTE)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_SYNC_TO_SOUND_CPU,BM_SETCHECK, (op->SyncFlags & MOVIE_SYNC_SYNCSOUND)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SetWindowText(GetDlgItem(hDlg, IDC_LOADEDFROMMOVIE), _T("LOADED FROM MOVIE:")); + } + else + { + SendDlgItemMessage(hDlg,IDC_WIP1,BM_SETCHECK, Settings.UseWIPAPUTiming ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ALLOWLEFTRIGHT,BM_SETCHECK, !Settings.DisallowLeftRight ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ENVX,BM_SETCHECK, Settings.SoundEnvelopeHeightReading ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_FMUT,BM_SETCHECK, Settings.FakeMuteFix ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_SYNC_TO_SOUND_CPU,BM_SETCHECK, Settings.SoundSync ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SetWindowText(GetDlgItem(hDlg, IDC_LOADEDFROMMOVIE), _T("")); + } +*/ + // make read-only the default + SendDlgItemMessage(hDlg,IDC_READONLY,BM_SETCHECK,BST_CHECKED,0); + + EnableWindow(GetDlgItem(hDlg, IDC_SYNC_TO_SOUND_CPU), 0==Settings.SoundDriver); // can't sync sound to CPU unless using "Snes9x DirectSound" driver + } + return true; + + case WM_COMMAND: + { + switch(LOWORD(wParam)) + { + case IDC_WIP1: + case IDC_ALLOWLEFTRIGHT: + case IDC_ENVX: + case IDC_FMUT: + case IDC_SYNC_TO_SOUND_CPU: + SetWindowText(GetDlgItem(hDlg, IDC_LOADEDFROMMOVIE), _T("")); + break; + case IDC_BROWSE_MOVIE: + { + OPENFILENAME ofn; + char szFileName[MAX_PATH]; + + szFileName[0] = '\0'; + + ZeroMemory( (LPVOID)&ofn, sizeof(OPENFILENAME) ); + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = hDlg; + ofn.lpstrFilter = MOVIE_FILETYPE_DESCRIPTION "\0*.smv\0All files\0*.*\0\0"; + ofn.lpstrFile = szFileName; + ofn.lpstrDefExt = "smv"; + ofn.nMaxFile = MAX_PATH; + ofn.Flags = OFN_HIDEREADONLY; // hide previously-ignored read-only checkbox (the real read-only box in the open-movie dialog itself) + if(GetOpenFileName( &ofn )) + { + SetWindowText(GetDlgItem(hDlg, IDC_MOVIE_PATH), szFileName); + set_movieinfo(szFileName, hDlg); + } + } + return true; + + case IDOK: + { + if(BST_CHECKED==SendDlgItemMessage(hDlg, IDC_READONLY, BM_GETCHECK,0,0)) + op->ReadOnly=TRUE; + if(BST_CHECKED==SendDlgItemMessage(hDlg, IDC_DISPLAY_INPUT, BM_GETCHECK,0,0)) + op->DisplayInput=TRUE; + GetDlgItemText(hDlg, IDC_MOVIE_PATH, op->Path, MAX_PATH); + } + Settings.UseWIPAPUTiming = IsDlgButtonChecked(hDlg, IDC_WIP1); + Settings.DisallowLeftRight = !IsDlgButtonChecked(hDlg, IDC_ALLOWLEFTRIGHT); + Settings.SoundEnvelopeHeightReading = IsDlgButtonChecked(hDlg, IDC_ENVX); + Settings.FakeMuteFix = IsDlgButtonChecked(hDlg, IDC_FMUT); + Settings.SoundSync = IsDlgButtonChecked(hDlg, IDC_SYNC_TO_SOUND_CPU); + EndDialog(hDlg, 1); + return true; + + case IDCANCEL: + EndDialog(hDlg, 0); + return true; + + default: + break; + } + } + + default: + return false; + } +} + +// checks if the currently loaded ROM has an SRAM file in the saves directory that we have write access to +static bool existsSRAM () +{ + const char * fname = S9xGetFilename (".srm"); + FILE * file = fopen(fname, "rb"); // check to see if it exists (w would auto-create which is bad) + if(file != NULL) + { + fclose(file); + + FILE * file = fopen(fname, "wb"); // it exists, now check to see if we can also write to it + if(file != NULL) + { + fclose(file); + return true; // success if it exists and can be written to + } + else + { + return false; // failure if it exists but can't be written to + } + } + else + { + return false; // failure if it doesn't exist + } +} + +int CALLBACK DlgCreateMovie(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static OpenMovieParams* op=NULL; + + switch(msg) + { + case WM_INITDIALOG: + { + // have to save here or the SRAM file might not exist when we check for it + // (which would cause clear SRAM option to not do anything) + Memory.SaveSRAM(S9xGetFilename (".srm")); + + + op=(OpenMovieParams*)lParam; + + SendDlgItemMessage(hDlg,IDC_RECORD_RESET,BM_SETCHECK,BST_CHECKED,0); + + int i; + for(i=1; i<5; ++i) + { + SendDlgItemMessage(hDlg,IDC_JOY1+i,BM_SETCHECK,BST_UNCHECKED,0); + } + SendDlgItemMessage(hDlg,IDC_JOY1,BM_SETCHECK,BST_CHECKED,0); + + // get default filename + if(Memory.ROMFilename[0]!='\0') + { + static TCHAR filename [_MAX_PATH + 1]; + TCHAR drive [_MAX_DRIVE + 1]; + TCHAR dir [_MAX_DIR + 1]; + TCHAR fname [_MAX_FNAME + 1]; + TCHAR ext [_MAX_EXT + 1]; + _splitpath (Memory.ROMFilename, drive, dir, fname, ext); + _makepath (filename, "", "", fname, "smv"); + SetWindowText(GetDlgItem(hDlg, IDC_MOVIE_PATH), filename); + } + if(op->SyncFlags & MOVIE_SYNC_DATA_EXISTS) + { + SendDlgItemMessage(hDlg,IDC_WIP1,BM_SETCHECK, (op->SyncFlags & MOVIE_SYNC_WIP1TIMING)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ALLOWLEFTRIGHT,BM_SETCHECK, (op->SyncFlags & MOVIE_SYNC_LEFTRIGHT)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ENVX,BM_SETCHECK, (op->SyncFlags & MOVIE_SYNC_VOLUMEENVX)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_FMUT,BM_SETCHECK, (op->SyncFlags & MOVIE_SYNC_FAKEMUTE)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_SYNC_TO_SOUND_CPU,BM_SETCHECK, (op->SyncFlags & MOVIE_SYNC_SYNCSOUND)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SetWindowText(GetDlgItem(hDlg, IDC_LOADEDFROMMOVIE), _T("LOADED FROM MOVIE:")); + } + else + { + SendDlgItemMessage(hDlg,IDC_WIP1,BM_SETCHECK, Settings.UseWIPAPUTiming ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ALLOWLEFTRIGHT,BM_SETCHECK, !Settings.DisallowLeftRight ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_ENVX,BM_SETCHECK, Settings.SoundEnvelopeHeightReading ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_FMUT,BM_SETCHECK, Settings.FakeMuteFix ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SendDlgItemMessage(hDlg,IDC_SYNC_TO_SOUND_CPU,BM_SETCHECK, Settings.SoundSync ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0); + SetWindowText(GetDlgItem(hDlg, IDC_LOADEDFROMMOVIE), _T("")); + } + + EnableWindow(GetDlgItem(hDlg, IDC_SYNC_TO_SOUND_CPU), 0==Settings.SoundDriver); // can't sync sound to CPU unless using "Snes9x DirectSound" driver + + SendDlgItemMessage(hDlg,IDC_CLEARSRAM,BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + EnableWindow(GetDlgItem(hDlg, IDC_CLEARSRAM), existsSRAM() ? true : false); + } + return true; + + case WM_COMMAND: + { + switch(LOWORD(wParam)) + { + case IDC_BROWSE_MOVIE: + { + OPENFILENAME ofn; + char szFileName[MAX_PATH]; + + szFileName[0] = '\0'; + + ZeroMemory( (LPVOID)&ofn, sizeof(OPENFILENAME) ); + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = hDlg; + ofn.lpstrFilter = MOVIE_FILETYPE_DESCRIPTION "\0*.smv\0All files\0*.*\0\0"; + ofn.lpstrFile = szFileName; + ofn.lpstrDefExt = "smv"; + ofn.nMaxFile = MAX_PATH; + ofn.Flags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT; + if(GetSaveFileName( &ofn )) + { + SetWindowText(GetDlgItem(hDlg, IDC_MOVIE_PATH), szFileName); + } + } + return true; + + case IDOK: + { + GetDlgItemText(hDlg, IDC_MOVIE_PATH, op->Path, MAX_PATH); + GetDlgItemTextW(hDlg, IDC_MOVIE_METADATA, op->Metadata, MOVIE_MAX_METADATA); + op->ControllersMask=0; + op->Opts=0; + int i; + for(i=0; i<5; ++i) + { + if(BST_CHECKED==SendDlgItemMessage(hDlg, IDC_JOY1+i, BM_GETCHECK,0,0)) + op->ControllersMask |= (1<Opts |= MOVIE_OPT_FROM_RESET; + + Settings.UseWIPAPUTiming = IsDlgButtonChecked(hDlg, IDC_WIP1); + Settings.DisallowLeftRight = !IsDlgButtonChecked(hDlg, IDC_ALLOWLEFTRIGHT); + Settings.SoundEnvelopeHeightReading = IsDlgButtonChecked(hDlg, IDC_ENVX); + Settings.FakeMuteFix = IsDlgButtonChecked(hDlg, IDC_FMUT); + Settings.SoundSync = IsDlgButtonChecked(hDlg, IDC_SYNC_TO_SOUND_CPU); + + op->SyncFlags = MOVIE_SYNC_DATA_EXISTS | MOVIE_SYNC_HASROMINFO; + if(Settings.UseWIPAPUTiming) op->SyncFlags |= MOVIE_SYNC_WIP1TIMING; + if(!Settings.DisallowLeftRight) op->SyncFlags |= MOVIE_SYNC_LEFTRIGHT; + if(Settings.SoundEnvelopeHeightReading) op->SyncFlags |= MOVIE_SYNC_VOLUMEENVX; + if(Settings.FakeMuteFix) op->SyncFlags |= MOVIE_SYNC_FAKEMUTE; + if(Settings.SoundSync) op->SyncFlags |= MOVIE_SYNC_SYNCSOUND; + + if(IsDlgButtonChecked(hDlg, IDC_CLEARSRAM) && IsDlgButtonChecked(hDlg, IDC_RECORD_RESET) && existsSRAM()) + { + remove(S9xGetFilename (".srm")); // delete SRAM if it exists (maybe unnecessary?) + Memory.LoadSRAM(S9xGetFilename (".srm")); // refresh memory (hard reset) + } + } + EndDialog(hDlg, 1); + return true; + + case IDCANCEL: + EndDialog(hDlg, 0); + return true; + + case IDC_RECORD_NOW: + if(existsSRAM()) + { + EnableWindow(GetDlgItem(hDlg, IDC_CLEARSRAM), false); + SendDlgItemMessage(hDlg,IDC_CLEARSRAM,BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); + } + break; + + case IDC_RECORD_RESET: + if(existsSRAM()) + { + EnableWindow(GetDlgItem(hDlg, IDC_CLEARSRAM), true); + } + break; + + default: + break; + } + } + + default: + return false; + } +} diff -NaHudr snes9x-1.43-src/wsnes9x.cpp.rej snx/wsnes9x.cpp.rej --- snes9x-1.43-src/wsnes9x.cpp.rej 1970-01-01 02:00:00.000000000 +0200 +++ snx/wsnes9x.cpp.rej 2007-08-07 14:05:15.000000000 +0300 @@ -0,0 +1,17 @@ +*************** +*** 1951,1956 **** + if (!Settings.NetPlay) + #endif + { + S9xMovieStop (TRUE); + S9xSoftReset (); + SetupSound (Settings.SoundPlaybackRate, +--- 1951,1958 ---- + if (!Settings.NetPlay) + #endif + { ++ S9xMovieUpdateOnReset (); ++ if(S9xMoviePlaying()) + S9xMovieStop (TRUE); + S9xSoftReset (); + SetupSound (Settings.SoundPlaybackRate, diff -NaHudr snes9x-1.43-src/wsnes9x.h snx/wsnes9x.h --- snes9x-1.43-src/wsnes9x.h 2004-12-31 00:15:55.000000000 +0200 +++ snx/wsnes9x.h 2005-04-09 00:59:23.000000000 +0300 @@ -104,7 +104,11 @@ #include #include #ifndef __BORLANDC__ + +#ifndef __MINGW32__ #include +#endif + #include #endif #include "resource.h" @@ -167,6 +171,7 @@ bool NeedDepthConvert; bool BGR; bool TurboModeToggle; + bool InactivePause; int ScreenDepth; int RedShift; int GreenShift; @@ -191,7 +196,7 @@ char SPL4Pack[MAX_PATH]; char MDHPack[MAX_PATH]; COLORREF InfoColor; - bool HideMenu; + bool HideMenu; bool VideoMemory; // avi writing @@ -217,6 +222,50 @@ TCHAR *errFrameTimer; }; +#define CUSTKEY_ALT_MASK 0x01 +#define CUSTKEY_CTRL_MASK 0x02 +#define CUSTKEY_SHIFT_MASK 0x04 + +struct SCustomKey { + WORD key; + WORD modifiers; +}; + +struct SCustomKeys { + SCustomKey SpeedUp; + SCustomKey SpeedDown; + SCustomKey Pause; + SCustomKey FrameAdvance; + SCustomKey SkipUp; + SCustomKey SkipDown; + SCustomKey ScopeTurbo; + SCustomKey ScopePause; + SCustomKey FrameCount; + SCustomKey ReadOnly; + SCustomKey Save [10]; + SCustomKey Load [10]; + SCustomKey FastForward; + SCustomKey ShowPressed; + SCustomKey SaveScreenShot; + SCustomKey SlotPlus; + SCustomKey SlotMinus; + SCustomKey SlotSave; + SCustomKey SlotLoad; + SCustomKey BGL1; + SCustomKey BGL2; + SCustomKey BGL3; + SCustomKey BGL4; + SCustomKey BGL5; + SCustomKey ClippingWindows; + SCustomKey BGLHack; + SCustomKey Transparency; + SCustomKey HDMA; + SCustomKey GLCube; + SCustomKey InterpMode7; + SCustomKey JoypadSwap; + SCustomKey SwitchControllers; +}; + struct SJoypad { BOOL Enabled; WORD Left; @@ -272,7 +321,10 @@ extern struct sGUI GUI; extern struct sLanguages Languages[]; -extern struct SJoypad Joypad[5]; +extern struct SJoypad Joypad[10]; +extern struct SJoypad ToggleJoypadStorage[5]; +extern struct SJoypad TurboToggleJoypadStorage[5]; +extern struct SCustomKeys CustomKeys; enum { @@ -302,8 +354,8 @@ /*****************************************************************************/ -void S9xSetWinPixelFormat (); -//int CheckKey( WORD Key, int OldJoypad); +void S9xSetWinPixelFormat (); +//int CheckKey( WORD Key, int OldJoypad); //void TranslateKey(WORD keyz,char *out); #ifdef USE_GLIDE #define VOODOO_MODE (GUI.Scale == 7)