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 para