Thread: MODULE does not work Snes9x 1.59.2

Results 1 to 8 of 8
  1. Collapse Details
    MODULE does not work Snes9x 1.59.2 
    #1
    Member
    MainSecondary
    Join Date
    Aug 2014
    Posts
    63
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site
    MODULE does not work Snes9x 1.59.2, test the existing module works PERFECT in Snes9x 1.58 but if i change emulator for Snes9x 1.59.2 does not work, emulator opens game in background and after seconds "Wrong emulador version" = ( Someone solve it? i think is also easy! Thanks
     

  2. Collapse Details
    Re: MODULE does not work Snes9x 1.59.2 
    #2
    Super Moderator
    agent47's Avatar
    MainSecondary
    Join Date
    Jan 2016
    Posts
    1,109
    I'll take a look when I get home. It's possible the window class has changed.
     

  3. Collapse Details
    Re: MODULE does not work Snes9x 1.59.2 
    #3
    Super Moderator
    agent47's Avatar
    MainSecondary
    Join Date
    Jan 2016
    Posts
    1,109
    This should work. They changed the capitalization in the window title and class for the 'x'.

    I only tested it very briefly so let me know if something isn't working. I'll do more extensive testing later.

    Code:
    MEmu := "Snes9x"
    MEmuV := "v1.59.2"
    MURL := ["http://www.snes9x.com/","http://bsxproj.superfamicom.org/"]
    MAuthor := ["djvj","brolly"]
    MVersion := "2.0.6"
    MCRC := ""
    iCRC := ""
    MID := ""
    MSystem := ["Bandai Sufami Turbo","Nintendo Satellaview","Nintendo Super Famicom","Super Nintendo Entertainment System"]
    ;----------------------------------------------------------------------------
    ; Notes:
    ; snes9x adjusts the windowed resolutions in the ini automatically based on the settings you choose in RocketLauncherUI.
    ; Bezels work, but if you notice a black bar along the bottom, change this option to false in snes9x.conf: ExtendHeight
    ;
    ; Bandai Sufami Turbo:
    ; Make sure you have the stbios.bin file inside the BIOS folder.
    ; If you are using hacked dumps that also include the bios in the game's rom make sure you enable hackedROM in the module 
    ; settings. You won't be able to combine roms by using the 2 cart slots though so using proper dumps is advisable.
    ;----------------------------------------------------------------------------
    StartModule()
    BezelGUI()
    FadeInStart()
    
    primaryExe := new Emulator(emuPath . "\" . executable)			; instantiate emulator executable object
    If InStr(systemName,"Satellaview") {
    	BSXBiosFile := new File(emuPath . "\BIOS\BS-X.bin")
    	BSXBiosFile.CheckFile("Could not locate " . BSXBiosFile.FileName . " that is required to launch Satellaview games. Place it in here: " . BSXBiosFile.FileFullPath)
    }
    
    emuPrimaryWindow := new Window(new WindowTitle("Snes9x","Snes9x: WndClass"))
    emuMultiCartWindow := new Window(new WindowTitle("Open MultiCart",""))
    
    Fullscreen := moduleIni.Read("Settings", "Fullscreen","true",,1)
    EmulateFullscreen := moduleIni.Read("Settings", "EmulateFullscreen","true",,1)		; This helps fading look better and work better on exit. You cannot use this with a normal fullscreen so one has to be false
    WindowMaximized := moduleIni.Read("Settings", "WindowMaximized","true",,1)
    Stretch := moduleIni.Read("Settings", "Stretch","true",,1)
    MaintainAspectRatio := moduleIni.Read("Settings", "MaintainAspectRatio","true",,1)
    HideMenu := moduleIni.Read("Settings", "HideMenu","true",,1)
    FullScreenWidth := moduleIni.Read("Settings", "FullScreenWidth","1024",,1)
    FullScreenHeight := moduleIni.Read("Settings", "FullScreenHeight","768",,1)
    ControlType := moduleIni.Read(romName . "|Settings", "ControlType",0,,1)
    StereoSound := moduleIni.Read(romName . "|Settings", "StereoSound","true",,1)
    HackedROM := moduleIni.Read(romName . "|Settings", "HackedROM","false",,1)
    CartBrom := moduleIni.Read(romName, "CartBrom","",,1)
    
    If (HideMenu = "false")
    	disableHideToggleMenu := "true"	; disables Bezel's builtin menu hiding
    
    ; cType := Object(0,"Use SNES Joypad(s)",1,"Use SNES Mouse",2,"Use Super Scope",3,"Use Super Multitap (5-Player)",4,"Use Konami Justifier",5,"Use Mouse in alternate port",6,"Use Multitaps (8-Player)",7,"Use Dual Justifiers")
    cType := Object(0,40137,1,40105,2,40106,3,40104,4,40109,5,40133,6,40135,7,40134)
    snes9xControl := cType[ControlType]	; search object for the ControlType snes9x uses in its input menu
    If !snes9xControl
    	ScriptError("Your ControlType is set to: " . ControlType . "`nIt is not one of the supported control types. Please set a proper control type in RocketLauncherUI for this system or game.")
    
    ; Multicart Setup for Sufami Turbo
    MultiCartA := ""
    MultiCartB := ""
    UseCliBoot := "true"
    
    If StringUtils.Contains(systemName,"Sufami") {
    	stBiosFile := new File(emuPath . "\BIOS\stbios.bin")
    	stBiosFile.CheckFile()
    
    	If (HackedROM = "false") {
    		UseCliBoot := "false"
    		MultiCartA := romPath . "\" . romName . romExtension
    		If (CartBrom) {
    			CartBromFile := new File(romPath . "\" . CartBrom)
    			CartBromFile.CheckFile()
    			MultiCartB := romPath . "\" . CartBrom
    		}
    		Else {
    			MultiCartB := stBiosFile.FileFullPath
    		}
    	}
    }
    
    BezelStart()
    
    ; Compare existing settings and if different than desired, write them to the emulator's ini
    snes9xConf := new IniFile(emuPath . "\snes9x.conf")
    snes9xConf.CheckFile()
    snes9xConf.Write(Fullscreen, "Display\Win", "Fullscreen:Enabled", 1)
    snes9xConf.Write(EmulateFullscreen, "Display\Win", "Fullscreen:EmulateFullscreen", 1)
    snes9xConf.Write(WindowMaximized, "Display\Win", "Window:Maximized", 1)
    snes9xConf.Write(Stretch, "Display\Win", "Stretch:Enabled", 1)
    snes9xConf.Write(MaintainAspectRatio, "Display\Win", "Stretch:MaintainAspectRatio", 1)
    snes9xConf.Write(FullScreenWidth, "Display\Win", "Fullscreen:Width", 1)
    snes9xConf.Write(FullScreenHeight, "Display\Win", "Fullscreen:Height", 1)
    snes9xConf.Write(HideMenu, "HideMenu", "HideMenu", 1)
    snes9xConf.Write(If StereoSound = "true" ? "ON" : "OFF", "Sound", "Stereo", 1)
    snes9xConf.Write(MultiCartA, "Settings\Win\Files", "Rom:MultiCartA", 1)
    snes9xConf.Write(MultiCartB, "Settings\Win\Files", "Rom:MultiCartB", 1)
    
    hideEmuObj := Object(emuPrimaryWindow,1)
    7z(romPath, romName, romExtension, sevenZExtractPath)
    
    HideAppStart(hideEmuObj,hideEmu)
    If (UseCliBoot = "true")
    	PrimaryExe.Run(" """ . romPath . "\" . romName . romExtension . """")
    Else
    	PrimaryExe.Run()
    
    emuPrimaryWindow.Wait()
    emuPrimaryWindow.WaitActive()
    
    ;Open MultiCart dialog and press OK, this workaround is needed otherwise Sufami games won't work. (Only applies to proper dumps not hacked ones)
    If (UseCliBoot = "false") {
    	emuPrimaryWindow.PostMessage(0x111,40153)
    	emuMultiCartWindow.Wait()
    	; emuMultiCartWindow.WaitActive()
    	emuMultiCartWindow.PostMessage(0x111,1)
    }
    
    ; Change the control type to what's required for this game
    ; WinMenuSelectItem, %emuWinClass%,, Input, %snes9xControl%
    ; msgbox 40%snes9xControl%`n%emuWinClass%
    emuPrimaryWindow.PostMessage(0x111,snes9xControl)
    
    BezelDraw()
    HideAppEnd(hideEmuObj,hideEmu)
    FadeInExit()
    primaryExe.Process("WaitClose")
    BezelExit()
    7zCleanUp()
    FadeOutExit()
    ExitModule()
    
    
    RestoreEmu:
    	If (bezelEnabled = "true") ; checking if emulator window is on bezel defined coordinates and if not try to move the window (timeout = 3 seconds).
    		If (bezelPath) { 
    			X:="" , Y:="" , W:="" , H:=""
    			timeout := A_TickCount
    			Loop {
    				WinGetPos, X, Y, W, H, ahk_id %emulatorID%
    				If (X = bezelScreenX) and (Y = bezelScreenY) and (W = bezelScreenWidth) and (H = bezelScreenHeight)
    					Break
    				If (timeout < A_TickCount - 3000)
    					Break
    				TimerUtils.Sleep(50)
    				WinMove, ahk_id %emulatorID%,, %bezelScreenX%, %bezelScreenY%, %bezelScreenWidth%, %bezelScreenHeight%
    				TimerUtils.Sleep(50)
    			}
    		}
    Return
    
    CloseProcess:
    	FadeOutStart()
    	emuPrimaryWindow.Close()
    Return
     

  4. Collapse Details
    Re: MODULE does not work Snes9x 1.59.2 
    #4
    Member
    MainSecondary
    Join Date
    Aug 2014
    Posts
    63
    Apparently it's working now, but please if you can also do a test there. Thanks for now!!
     

  5. Collapse Details
    Re: MODULE does not work Snes9x 1.59.2 
    #5
    Junior Member
    MainSecondary
    Join Date
    Apr 2019
    Posts
    3
    I'm unable to get this module to work properly with snes9x 1.6, module shows its for 1.53?
     

  6. Collapse Details
    Re: MODULE does not work Snes9x 1.59.2 
    #6
    Super Moderator
    agent47's Avatar
    MainSecondary
    Join Date
    Jan 2016
    Posts
    1,109
    So you just posted on this thread without reading it?

    If you had, you would see that I updated the module to work with 1.59.2 and updated the version in the module header. Unless they've changed the window title/class in the recent commits or something else the module I posted should work fine.

    Edit: Unless by "this" module you're referring to the official module and not the one I posted and are unaware that you need to replace the official module with mine. Also, I just tested my module with a dev version of the emulator (since there's not a 1.6 release yet) and it works.
    Last edited by agent47 ; 04-06-2019 at 02:13 PM.
     

  7. Collapse Details
    Re: MODULE does not work Snes9x 1.59.2 
    #7
    Junior Member
    MainSecondary
    Join Date
    Apr 2019
    Posts
    3
    Quote Originally Posted by agent47 View Post
    So you just posted on this thread without reading it?

    If you had, you would see that I updated the module to work with 1.59.2 and updated the version in the module header. Unless they've changed the window title/class in the recent commits or something else the module I posted should work fine.

    Edit: Unless by "this" module you're referring to the official module and not the one I posted and are unaware that you need to replace the official module with mine. Also, I just tested my module with a dev version of the emulator (since there's not a 1.6 release yet) and it works.
    You're right lol you got me I posted then immediately grabbed the new script and it works perfect. Thanks for your help.
     

  8. Collapse Details
    Re: MODULE does not work Snes9x 1.59.2 
    #8
    Junior Member
    MainSecondary
    Join Date
    Feb 2016
    Posts
    17
    Thanks agent47 for update the module. With this modification works well also the new version Snes9x 1.60

    Greetings.
     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •