Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider donating by either clicking this text or the Patreon link on the right.

Patreon

Recommended Posts

Posted

(Apologies for the wall of text!)

I use Spectaculator Version 7.51 which I purchased to Play ZX Spectrum Games.

Previously I was using GameEx to just launch the files directly but now I have it working with Gamebase SpeccyMania.

The same issue that occurs with both methods is that most games work when you set the Spectrum model type set to 48K but there are many games that you would want to run in 128K or other modes.

If you set Spectaculator to 128K mode however many older games will not work.

For Example:

Target Renegade

(TargetRenegade48k.tzx.zip) will run in both 48k mode and 128k mode but with 128k mode the same Rom gives better music. :huh:

Thro' The Wall (ThrotheWall.tap.zip) - The first game ever made for the spectrum! Will just crash in 128k mode so you need to leave it in 48k mode.

The general consensus is that you want to leave it in 48k mode as it is the most compatible mode. For any other games you will need to set the Model manually and then relaunch the game but then you will then need to change it back again afterwards...

So, I want to automate this but the Gemus Scripts in Gamebase ZX / SpeccyMania both just look like this:

If GameType CONTAINS(TZX||TAP||BLK||CSW||DSK||Z80||SNA||RZX||SZX||MDR||ROM||TRD||SCL||FDI||YDI)

Add_CLP(%gamepathfile%)

Run_Emulator()

Else

Show_Message(This game is not supported by Spectaculator V6!)

End If

There is nothing in there to do with setting the Spectrum Model.

Djvj has done part of the work by creating an AHK file that writes the appropriate Registry Entries for use on Hyperspin:

http://hyperlist.hyp...eahk&system=157

This involves creating a file called "settings.ini" and placing a list of games that you want to run in a specific mode in it.

It will then set the mode to whichever you specify or if there is no entry it will set it back to the default - which is 48K. Ideal!

I am going to attempt to modify this AHK and try to get it working with GameBase SpeccyMania scripting. i have never used AHK or Gemus Scripting before but there is good documentation so i'll give it a go.

Before I embark - has anyone got any ideas of how to approach it or has anyone tackled this before?

I am unsure how to pass variables into a AHK (or compiled AHK) file so my first idea would be to:

1. Create an ini file which would store the filename of the game you are about to Launch.

This ini file would also store any specific Models that are required for specific games.

For Example:

[CurrentGame]

RomName=TargetRenegade48k.tzx

[TargetRenegade48k.tzx]

model=128k

[Combat School - 128k.tzx]

model=128k

2. Use the Gemus Script to Update this ini file when you launch with the Rom Name.

For Example:

Set_INI_Value(%emupath%\settings.ini||CurrentGame||RomName||%gamefile%)

3. Modify the AHK to read the [CurrentGame] from the ini file and then look up any specific Spectrum Model specified for that game.

4. Use the same code in the AHK file to modify the registry and run this from the Gemus Script.

For Example:

Run_Program(%emupath%\spectrumahk.exe||||WAIT)

Maybe I could even use another spectrum emulator which uses an ini/config file...

I also have another set of Spekky roms all in TZX format that I was using without Gamebase - maybe a simple Gemus Script to check the filename for "*(128K)*" would be enough too!

Any thoughts or pointers would be appreciated but i'll crack on anyway!

Posted

OK so I have done this now and it works.

As I mentioned is probably not the most elegant method but who cares if it works?

1. Change the Gemus Script in SpeccyMania (It should work fine for GamebaseZX as well) to the following:

Set_INI_Value(%emupath%\settings.ini||CurrentGame||RomName||%gamefile%)

Run_Program(%emupath%\spec.exe||||WAIT)

Add_CLP(%gamepathfile%)

Run_Emulator()

What this will do is copy the name of the Rom you are running into a file named Settings.ini and then run an Autohotkey EXE.

2. Create a text file named "Settings.ini" with the below content and copy it into the Spectaculator Emulator Directory that you have GameBase pointed to:

[CurrentGame]

RomName=throwall.tap

[TargetRenegade48k.tzx]

model=128k

[Combat School - 128k.tzx]

model=128k

This file will contain any Roms that you would NOT want to run in 48K mode.

3. Create a text file named "Spec.ahk" with the below content and copy it into the Spectaculator Emulator Directory:

IniRead, CurrentRom, settings.ini, CurrentGame, RomName

IniRead, RequiredModel, settings.ini, %CurrentRom%, Model

WriteReg("Model v6+", 1) ;Always Set 48K First

; Updating registry with desired model number if anything other than 48k is required

if (RequiredModel = "128k")

{

WriteReg("Model v6+", 2)

ExitApp

}

if (RequiredModel = "16k")

{

WriteReg("Model v6+", 0)

ExitApp

}

if (RequiredModel = "plus3")

{

WriteReg("Model v6+", 5)

ExitApp

}

WriteReg(var1, var2) {

RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\spectaculator.com\Spectaculator\Settings, %var1%, %var2%

}

ExitApp

This file will always set the Spectrum Model to 48K however if you specify any Roms in the ini file to run in 128K or other formats such as plus3 it will change the Model of the Spectrum and then exit.

4. Download the portable version of AHK from the www.autohotkey.com website:

http://www.autohotke.../AutoHotkey.zip

You will see a file in the "Complier" directory named "Ahk2Exe.exe". Run This.

Point "Source Script/File" at the SpekAHK file and click ">Convert<".

5. That's it! it doesn't matter which folder the EXE and INI files are - it will run.

You then need to just add additional entries into that "Settings.ini" file for any other Games that you need to run in any other Mode other than 48K. eg.

[Horace Goes Skiing.tzx]

model=16k

(Although this example will work with 48K).

Feel free to make suggestions.

settings.ini

spec.ahk.txt (remove .txt Extension)

  • Like 1
Posted

Updated Version with Lots of 128K Games already configured in the Settings.ini for you!

Note this ini file is set up for SpeccyMania - i'm not 100% sure whether the Roms have the same names in GBZX.

settings.ini

spec.ahk.txt (Remove .txt Extension)

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...