WIP - Fixes after merge #2 (GUI updates)

This commit is contained in:
Dimitris Panokostas 2017-09-18 17:36:45 +02:00
parent 05387498c0
commit 5adf64a276
29 changed files with 2090 additions and 233 deletions

View file

@ -402,6 +402,7 @@
<ClCompile Include="..\src\osdep\gui\PanelInput.cpp" />
<ClCompile Include="..\src\osdep\gui\PanelMisc.cpp" />
<ClCompile Include="..\src\osdep\gui\PanelPaths.cpp" />
<ClCompile Include="..\src\osdep\gui\PanelQuickstart.cpp" />
<ClCompile Include="..\src\osdep\gui\PanelRAM.cpp" />
<ClCompile Include="..\src\osdep\gui\PanelROM.cpp" />
<ClCompile Include="..\src\osdep\gui\PanelSavestate.cpp" />
@ -409,6 +410,7 @@
<ClCompile Include="..\src\osdep\gui\SelectFile.cpp" />
<ClCompile Include="..\src\osdep\gui\SelectFolder.cpp" />
<ClCompile Include="..\src\osdep\gui\SelectorEntry.cpp" />
<ClCompile Include="..\src\osdep\gui\ShowHelp.cpp" />
<ClCompile Include="..\src\osdep\gui\ShowMessage.cpp" />
<ClCompile Include="..\src\osdep\gui\UaeCheckBox.cpp" />
<ClCompile Include="..\src\osdep\gui\UaeDropDown.cpp" />

View file

@ -756,6 +756,12 @@
<ClCompile Include="..\src\archivers\mp2\kjmp2.cpp">
<Filter>src\archivers\mp2</Filter>
</ClCompile>
<ClCompile Include="..\src\osdep\gui\PanelQuickstart.cpp">
<Filter>src\osdep\gui</Filter>
</ClCompile>
<ClCompile Include="..\src\osdep\gui\ShowHelp.cpp">
<Filter>src\osdep\gui</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\archivers\7z\7zAlloc.h">

View file

@ -45,34 +45,26 @@
<MainSourceDirectoryForLocalBuilds>$(ProjectDir)</MainSourceDirectoryForLocalBuilds>
</Project>
<Build xsi:type="com.visualgdb.build.msbuild">
<ToolchainID>
<ID>com.visualgdb.raspberry_pi</ID>
<Version>
<GCC>4.9.2</GCC>
<GDB>7.7.1</GDB>
<Revision>4</Revision>
</Version>
</ToolchainID>
<Toolchain>
<UnixSystem>false</UnixSystem>
<AdditionalPathDirectories>
<string>C:\SysGCC\raspberry\bin</string>
</AdditionalPathDirectories>
<RequireCtrlBreak>false</RequireCtrlBreak>
<SourceDirMapping>
<Directories />
<PathStyle>MinGWUnixSlash</PathStyle>
</SourceDirMapping>
<Name>Raspberry PI</Name>
<UniqueID>com.visualgdb.raspberry_pi</UniqueID>
<Location>C:\SysGCC\raspberry</Location>
<UnixSystem>false</UnixSystem>
<GCC>C:\SysGCC\raspberry\bin\arm-linux-gnueabihf-gcc.exe</GCC>
<GXX>C:\SysGCC\raspberry\bin\arm-linux-gnueabihf-g++.exe</GXX>
<GDB>C:\SysGCC\raspberry\bin\arm-linux-gnueabihf-gdb.exe</GDB>
<AR>C:\SysGCC\raspberry\bin\arm-linux-gnueabihf-ar.exe</AR>
<OBJCOPY>C:\SysGCC\raspberry\bin\arm-linux-gnueabihf-objcopy.exe</OBJCOPY>
<Make>C:\SysGCC\raspberry\bin\make.exe</Make>
<UseCygwinBash>false</UseCygwinBash>
<AdditionalPathDirectories>
<string>C:\SysGCC\raspberry\bin</string>
</AdditionalPathDirectories>
<RequireCmdExe>false</RequireCmdExe>
<RequireCtrlBreak>false</RequireCtrlBreak>
<SourceDirMapping>
<Directories />
<PathStyle>MinGWUnixSlash</PathStyle>
</SourceDirMapping>
</Toolchain>
<ProjectFile>Amiberry.vcxproj</ProjectFile>
<RemoteBuildEnvironment>
@ -80,7 +72,6 @@
<EnvironmentSetupFiles />
</RemoteBuildEnvironment>
<ParallelJobCount>1</ParallelJobCount>
<SuppressDirectoryChangeMessages>true</SuppressDirectoryChangeMessages>
</Build>
<Debug xsi:type="com.visualgdb.debug.remote">
<AdditionalStartupCommands />
@ -154,7 +145,6 @@
<ExternalSourceFileList />
<ExtraSettings>
<HideErrorsInSystemHeaders>true</HideErrorsInSystemHeaders>
<SupportLightweightReferenceAnalysis>false</SupportLightweightReferenceAnalysis>
<DiscoverySettings>
<Mode>Enabled</Mode>
<SearchInProjectDir>true</SearchInProjectDir>
@ -164,9 +154,6 @@
<IgnoredHeaders />
</DiscoverySettings>
</ExtraSettings>
<CodeAnalyzerSettings>
<Enabled>false</Enabled>
</CodeAnalyzerSettings>
</CodeSense>
<BuildContextDirectory>VisualGDB\VisualGDBCache</BuildContextDirectory>
</VisualGDBProjectSettings2>

View file

@ -275,6 +275,7 @@
<ClCompile Include="..\..\src\osdep\gui\PanelInput.cpp" />
<ClCompile Include="..\..\src\osdep\gui\PanelMisc.cpp" />
<ClCompile Include="..\..\src\osdep\gui\PanelPaths.cpp" />
<ClCompile Include="..\..\src\osdep\gui\PanelQuickstart.cpp" />
<ClCompile Include="..\..\src\osdep\gui\PanelRAM.cpp" />
<ClCompile Include="..\..\src\osdep\gui\PanelROM.cpp" />
<ClCompile Include="..\..\src\osdep\gui\PanelSavestate.cpp" />
@ -282,6 +283,7 @@
<ClCompile Include="..\..\src\osdep\gui\SelectFile.cpp" />
<ClCompile Include="..\..\src\osdep\gui\SelectFolder.cpp" />
<ClCompile Include="..\..\src\osdep\gui\SelectorEntry.cpp" />
<ClCompile Include="..\..\src\osdep\gui\ShowHelp.cpp" />
<ClCompile Include="..\..\src\osdep\gui\ShowMessage.cpp" />
<ClCompile Include="..\..\src\osdep\gui\UaeCheckBox.cpp" />
<ClCompile Include="..\..\src\osdep\gui\UaeDropDown.cpp" />

View file

@ -708,6 +708,12 @@
<ClCompile Include="..\..\src\archivers\mp2\kjmp2.cpp">
<Filter>Source files\archivers\mp2</Filter>
</ClCompile>
<ClCompile Include="..\..\src\osdep\gui\PanelQuickstart.cpp">
<Filter>Source files\osdep\gui</Filter>
</ClCompile>
<ClCompile Include="..\..\src\osdep\gui\ShowHelp.cpp">
<Filter>Source files\osdep\gui</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Image Include="..\..\data\35floppy.ico">

View file

@ -24,6 +24,7 @@ extern void sleep_millis (int ms);
extern void uae_reset (int, int);
extern void uae_quit (void);
extern void host_shutdown();
extern void uae_restart (int, const TCHAR*);
extern void target_reset (void);
extern void target_addtorecent (const TCHAR*, int);

View file

@ -15,7 +15,7 @@
#include "gui.h"
#include "gui_handling.h"
#define DIALOG_WIDTH 520
#define DIALOG_WIDTH 620
#define DIALOG_HEIGHT 202
static const char* harddisk_filter[] = {".hdf", "\0"};

View file

@ -16,11 +16,21 @@
#include "gui.h"
#include "gui_handling.h"
#define DIALOG_WIDTH 520
#define DIALOG_WIDTH 620
#define DIALOG_HEIGHT 270
static const char* harddisk_filter[] = {".hdf", "\0"};
struct controller_map {
int type;
char display[64];
};
static struct controller_map controller[] = {
{ HD_CONTROLLER_TYPE_UAE, "UAE" },
{ HD_CONTROLLER_TYPE_IDE_FIRST, "A600/A1200/A4000 IDE" },
{ -1 }
};
static bool dialogResult = false;
static bool dialogFinished = false;
static bool fileSelected = false;
@ -46,7 +56,9 @@ static gcn::Label* lblSectors;
static gcn::TextField* txtSectors;
static gcn::Label* lblBlocksize;
static gcn::TextField* txtBlocksize;
static gcn::Label *lblController;
static gcn::UaeDropDown* cboController;
static gcn::UaeDropDown* cboUnit;
static void check_rdb(const TCHAR* filename)
{
@ -65,6 +77,52 @@ static void check_rdb(const TCHAR* filename)
}
class ControllerListModel : public gcn::ListModel
{
public:
ControllerListModel()
{
}
int getNumberOfElements() override
{
return 2;
}
std::string getElementAt(int i) override
{
if (i < 0 || i >= 2)
return "---";
return controller[i].display;
}
};
static ControllerListModel controllerListModel;
class UnitListModel : public gcn::ListModel
{
public:
UnitListModel()
{
}
int getNumberOfElements() override
{
return 4;
}
std::string getElementAt(int i) override
{
char num[8];
if (i < 0 || i >= 4)
return "---";
snprintf(num, 8, "%d", i);
return num;
}
};
static UnitListModel unitListModel;
class FilesysHardfileActionListener : public gcn::ActionListener
{
public:
@ -84,6 +142,17 @@ public:
wndEditFilesysHardfile->requestModalFocus();
cmdPath->requestFocus();
}
else if (actionEvent.getSource() == cboController) {
switch (controller[cboController->getSelected()].type) {
case HD_CONTROLLER_TYPE_UAE:
cboUnit->setSelected(0);
cboUnit->setEnabled(false);
break;
default:
cboUnit->setEnabled(true);
break;
}
}
else
{
if (actionEvent.getSource() == cmdOK)
@ -110,6 +179,18 @@ static FilesysHardfileActionListener* filesysHardfileActionListener;
static void InitEditFilesysHardfile()
{
for (int i = 0; expansionroms[i].name; i++) {
const struct expansionromtype *erc = &expansionroms[i];
if (erc->deviceflags & EXPANSIONTYPE_IDE) {
for (int j = 0; controller[j].type >= 0; ++j) {
if (!strcmp(erc->friendlyname, controller[j].display)) {
controller[j].type = HD_CONTROLLER_TYPE_IDE_EXPANSION_FIRST + i;
break;
}
}
}
}
wndEditFilesysHardfile = new gcn::Window("Edit");
wndEditFilesysHardfile->setSize(DIALOG_WIDTH, DIALOG_HEIGHT);
wndEditFilesysHardfile->setPosition((GUI_WIDTH - DIALOG_WIDTH) / 2, (GUI_HEIGHT - DIALOG_HEIGHT) / 2);
@ -193,6 +274,19 @@ static void InitEditFilesysHardfile()
cmdPath->setId("hdfPath");
cmdPath->addActionListener(filesysHardfileActionListener);
lblController = new gcn::Label("Controller:");
lblController->setSize(100, LABEL_HEIGHT);
lblController->setAlignment(gcn::Graphics::RIGHT);
cboController = new gcn::UaeDropDown(&controllerListModel);
cboController->setSize(180, DROPDOWN_HEIGHT);
cboController->setBaseColor(gui_baseCol);
cboController->setId("hdfController");
cboController->addActionListener(filesysHardfileActionListener);
cboUnit = new gcn::UaeDropDown(&unitListModel);
cboUnit->setSize(60, DROPDOWN_HEIGHT);
cboUnit->setBaseColor(gui_baseCol);
cboUnit->setId("hdfUnit");
int posY = DISTANCE_BORDER;
int posX = DISTANCE_BORDER;
@ -230,6 +324,11 @@ static void InitEditFilesysHardfile()
wndEditFilesysHardfile->add(txtBlocksize, lblBlocksize->getX() + lblBlocksize->getWidth() + 8, posY);
posY += txtSectors->getHeight() + DISTANCE_NEXT_Y;
wndEditFilesysHardfile->add(lblController, DISTANCE_BORDER, posY);
wndEditFilesysHardfile->add(cboController, DISTANCE_BORDER + lblController->getWidth() + 8, posY);
wndEditFilesysHardfile->add(cboUnit, cboController->getX() + cboController->getWidth() + 8, posY);
posY += cboController->getHeight() + DISTANCE_NEXT_Y;
wndEditFilesysHardfile->add(cmdOK);
wndEditFilesysHardfile->add(cmdCancel);
@ -262,6 +361,9 @@ static void ExitEditFilesysHardfile()
delete txtSectors;
delete lblBlocksize;
delete txtBlocksize;
delete lblController;
delete cboController;
delete cboUnit;
delete cmdOK;
delete cmdCancel;
@ -273,6 +375,9 @@ static void ExitEditFilesysHardfile()
static void EditFilesysHardfileLoop()
{
// TODO: Check if this is needed in Guisan?
FocusBugWorkaround(wndEditFilesysHardfile);
while (!dialogFinished)
{
SDL_Event event;
@ -370,6 +475,13 @@ bool EditFilesysHardfile(int unit_no)
txtSectors->setText(tmp);
snprintf(tmp, sizeof tmp, "%d", ci->blocksize);
txtBlocksize->setText(tmp);
int selIndex = 0;
for (int i = 0; i < 2; ++i) {
if (controller[i].type == ci->controller_type)
selIndex = i;
}
cboController->setSelected(selIndex);
cboUnit->setSelected(ci->controller_unit);
check_rdb(strroot.c_str());
}
@ -387,6 +499,8 @@ bool EditFilesysHardfile(int unit_no)
txtReserved->setText("2");
txtSectors->setText("32");
txtBlocksize->setText("512");
cboController->setSelected(0);
cboUnit->setSelected(0);
}
EditFilesysHardfileLoop();
@ -401,18 +515,28 @@ bool EditFilesysHardfile(int unit_no)
strcpy(ci.devname, const_cast<char *>(txtDevice->getText().c_str()));
strcpy(ci.rootdir, const_cast<char *>(txtPath->getText().c_str()));
ci.type = UAEDEV_HDF;
ci.controller_type = controller[cboController->getSelected()].type;
ci.controller_type_unit = 0;
ci.controller_unit = cboUnit->getSelected();
ci.controller_media_type = 0;
ci.unit_feature_level = 1;
ci.unit_special_flags = 0;
ci.readonly = !chkReadWrite->isSelected();
ci.sectors = atoi(txtSectors->getText().c_str());
ci.surfaces = atoi(txtSurfaces->getText().c_str());
ci.reserved = atoi(txtReserved->getText().c_str());
ci.blocksize = atoi(txtBlocksize->getText().c_str());
ci.bootpri = bp;
ci.physical_geometry = hardfile_testrdb(ci.rootdir);
uci = add_filesys_config(&changed_prefs, unit_no, &ci);
if (uci)
{
struct hardfiledata* hfd = get_hardfile_data(uci->configoffset);
hardfile_media_change(hfd, &ci, true, false);
struct hardfiledata *hfd = get_hardfile_data(uci->configoffset);
if (hfd)
hardfile_media_change(hfd, &ci, true, false);
else
hardfile_added(&ci);
}
}

View file

@ -23,10 +23,11 @@ static NavigationMap navMap[] =
{
// active move left move right move up move down
// main_window
{"Paths", "SystemROMs", "SystemROMs", "Reset", "Configurations"},
{"Configurations", "ConfigList", "ConfigList", "Paths", "CPU and FPU"},
{"CPU and FPU", "7 Mhz", "68000", "Configurations", "Chipset"},
{"Chipset", "BlitNormal", "OCS", "CPU and FPU", "ROM"},
{ "Paths", "SystemROMs", "SystemROMs", "Reset", "Quickstart" },
{ "Quickstart", "qsNTSC", "AModel", "Paths", "Configurations" },
{ "Configurations", "ConfigList", "ConfigList", "Quickstart", "CPU and FPU" },
{"CPU and FPU", "7 Mhz", "68000", "Configurations", "Chipset"},
{"Chipset", "BlitNormal", "OCS", "CPU and FPU", "ROM"},
{"ROM", "MainROM", "cboMainROM", "Chipset", "RAM"},
{"RAM", "Chipmem", "Chipmem", "ROM", "Floppy drives"},
{"Floppy drives", "cmdSel0", "DF0:", "RAM", "Hard drives/CD"},
@ -37,7 +38,8 @@ static NavigationMap navMap[] =
{"Miscellaneous", "StatusLine", "StatusLine", "Input", "Savestates"},
{"Savestates", "State0", "State0", "Miscellaneous", "Reset"},
{"Reset", "Start", "Quit", "Savestates", "Paths"},
{"Quit", "Reset", "Start", "Savestates", "Paths"},
{"Quit", "Reset", "Help", "Savestates", "Paths"},
{ "Help", "Quit", "Start", "Savestates", "Paths" },
{"Start", "Quit", "Reset", "Savestates", "Paths"},
// PanelPaths
@ -45,6 +47,29 @@ static NavigationMap navMap[] =
{"ConfigPath", "Paths", "Paths", "SystemROMs", "RescanROMs"},
{"RescanROMs", "Paths", "Paths", "ConfigPath", "SystemROMs"},
// active move left move right move up move down
// PanelQuickstart
{ "AModel", "Quickstart", "qsNTSC", "qsMode", "AConfig" },
{ "qsNTSC", "AModel", "Quickstart", "qsMode", "AConfig" },
{ "AConfig", "Quickstart", "Quickstart", "AModel", "qscmdSel0" },
{ "qsDF0", "Quickstart", "qsWP0", "AConfig", "qscboDisk0" },
{ "qsWP0", "qsDF0", "qscmdEject0", "AConfig", "qscboDisk0" },
// { "qsInfo0", "Quickstart", "", "", "" },
{ "qscmdEject0", "qsWP0", "qscmdSel0", "AConfig", "qscboDisk0" },
{ "qscmdSel0", "qscmdEject0", "Quickstart", "AConfig", "qscboDisk0" },
{ "qscboDisk0", "Quickstart", "Quickstart", "qscmdSel0", "qscmdSel1" },
{ "qsDF1", "Quickstart", "qsWP1", "qscboDisk0", "qscboDisk1" },
{ "qsWP1", "qsDF1", "qscmdEject1", "qscboDisk0", "qscboDisk1" },
// { "qsInfo1", "Quickstart", "", "", "" },
{ "qscmdEject1", "qsWP1", "qscmdSel1", "qscboDisk0", "qscboDisk1" },
{ "qscmdSel1", "qscmdEject1", "Quickstart", "qscboDisk0", "qscboDisk1" },
{ "qscboDisk1", "Quickstart", "Quickstart", "qsDF1", "qsCDSelect" },
{ "qsCD drive", "Quickstart", "qscdEject", "qscboDisk1", "qscboCD" },
{ "qscdEject", "qsCD drive", "qsCDSelect", "qscboDisk1", "qscboCD" },
{ "qsCDSelect", "qscdEject", "Quickstart", "qscboDisk1", "qscboCD" },
{ "qscboCD", "Quickstart", "Quickstart", "qsCDSelect", "qsMode" },
{ "qsMode", "Quickstart", "Quickstart", "qscboCD", "qsNTSC" },
// PanelConfig
{"ConfigList", "Configurations", "ConfigName", "", ""},
{"ConfigName", "Configurations", "Configurations", "ConfigList", "ConfigDesc"},
@ -55,22 +80,24 @@ static NavigationMap navMap[] =
// active move left move right move up move down
// PanelCPU
{"68000", "CPU and FPU", "FPUnone", "JIT", "68010"},
{"68010", "CPU and FPU", "68881", "68000", "68020"},
{"68020", "CPU and FPU", "68882", "68010", "68030"},
{"68030", "CPU and FPU", "CPU internal", "68020", "68040"},
{"68040", "CPU and FPU", "CPU internal", "68030", "CPU24Bit"},
{"CPU24Bit", "CPU and FPU", "CPU internal", "68040", "CPUComp"},
{"CPUComp", "CPU and FPU", "CPU internal", "CPU24Bit", "JIT"},
{"JIT", "CPU and FPU", "CPU internal", "CPUComp", "68000"},
{"FPUnone", "68000", "7 Mhz", "CPU internal", "68881"},
{"68881", "68010", "14 Mhz", "FPUnone", "68882"},
{"68882", "68020", "25 Mhz", "68881", "CPU internal"},
{"CPU internal", "68030", "Fastest", "68882", "FPUnone"},
{"7 Mhz", "FPUnone", "CPU and FPU", "Fastest", "14 Mhz"},
{"14 Mhz", "68881", "CPU and FPU", "7 Mhz", "25 Mhz"},
{"25 Mhz", "68882", "CPU and FPU", "14 Mhz", "Fastest"},
{"Fastest", "CPU internal", "CPU and FPU", "25 Mhz", "7 Mhz"},
{ "68000", "CPU and FPU", "FPUnone", "JIT", "68010" },
{ "68010", "CPU and FPU", "68881", "68000", "68020" },
{ "68020", "CPU and FPU", "68882", "68010", "68030" },
{ "68030", "CPU and FPU", "CPU internal", "68020", "68040" },
{ "68040", "CPU and FPU", "FPUstrict", "68030", "CPU24Bit" },
{ "CPU24Bit", "CPU and FPU", "SoftFloat", "68040", "CPUComp" },
{ "CPUComp", "CPU and FPU", "SoftFloat", "CPU24Bit", "JIT" },
{ "JIT", "CPU and FPU", "SoftFloat", "CPUComp", "68000" },
{ "FPUnone", "68000", "7 Mhz", "SoftFloat", "68881" },
{ "68881", "68010", "14 Mhz", "FPUnone", "68882" },
{ "68882", "68020", "25 Mhz", "68881", "CPU internal" },
{ "CPU internal", "68030", "Fastest", "68882", "FPUstrict" },
{ "FPUstrict", "68040", "Fastest", "CPU internal", "SoftFloat" },
{ "SoftFloat", "CPU24Bit", "Fastest", "FPUstrict", "FPUnone" },
{ "7 Mhz", "FPUnone", "CPU and FPU", "Fastest", "14 Mhz" },
{ "14 Mhz", "68881", "CPU and FPU", "7 Mhz", "25 Mhz" },
{ "25 Mhz", "68882", "CPU and FPU", "14 Mhz", "Fastest" },
{ "Fastest", "CPU internal", "CPU and FPU", "25 Mhz", "7 Mhz" },
// PanelChipset
{"OCS", "Chipset", "BlitNormal", "CollFull", "ECS Agnus"},
@ -88,17 +115,28 @@ static NavigationMap navMap[] =
// active move left move right move up move down
// PanelROM
{"cboMainROM", "ROM", "MainROM", "cboExtROM", "cboExtROM"},
{"MainROM", "cboMainROM", "ROM", "ExtROM", "ExtROM"},
{"cboExtROM", "ROM", "ExtROM", "cboMainROM", "cboMainROM"},
{"ExtROM", "cboExtROM", "ROM", "MainROM", "MainROM"},
#ifdef ACTION_REPLAY
{ "cboMainROM", "ROM", "MainROM", "cboCartROM", "cboExtROM" },
{ "MainROM", "cboMainROM", "ROM", "CartROM", "ExtROM" },
{ "cboExtROM", "ROM", "ExtROM", "cboMainROM", "cboCartROM" },
{ "ExtROM", "cboExtROM", "ROM", "MainROM", "CartROM" },
{ "cboCartROM", "ROM", "CartROM", "cboExtROM", "cboMainROM" },
{ "CartROM", "cboCartROM", "ROM", "ExtROM", "MainROM" },
#else
{ "cboMainROM", "ROM", "MainROM", "cboExtROM", "cboExtROM" },
{ "MainROM", "cboMainROM", "ROM", "ExtROM", "ExtROM" },
{ "cboExtROM", "ROM", "ExtROM", "cboMainROM", "cboMainROM" },
{ "ExtROM", "cboExtROM", "ROM", "MainROM", "MainROM" },
#endif
//PanelRAM
{"Chipmem", "", "", "RAM", "Slowmem"},
{"Slowmem", "", "", "Chipmem", "Fastmem"},
{"Fastmem", "", "", "Slowmem", "Z3mem"},
{"Z3mem", "", "", "Fastmem", "Gfxmem"},
{"Gfxmem", "", "", "Z3mem", "RAM"},
{ "Chipmem", "", "", "RAM", "Slowmem" },
{ "Slowmem", "", "", "Chipmem", "Fastmem" },
{ "Fastmem", "", "", "Slowmem", "Z3mem" },
{ "Z3mem", "", "", "Fastmem", "Gfxmem" },
{ "Gfxmem", "", "", "Z3mem", "A3000Low" },
{ "A3000Low", "", "", "Gfxmem", "A3000High" },
{ "A3000High", "", "", "A3000Low", "RAM" },
//PanelFloppy
{"DF0:", "Floppy drives", "cboType0", "SaveForDisk", "cboDisk0"},
@ -188,10 +226,11 @@ static NavigationMap navMap[] =
{"cboRight", "cboLeft", "Input", "cboDown", "cboPort0"},
// PanelMisc
{"StatusLine", "Miscellaneous", "Miscellaneous", "BSDSocket", "HideIdle"},
{"StatusLine", "Miscellaneous", "Miscellaneous", "MasterWP", "HideIdle"},
{"HideIdle", "Miscellaneous", "Miscellaneous", "StatusLine", "ShowGUI"},
{"ShowGUI", "Miscellaneous", "Miscellaneous", "HideIdle", "BSDSocket"},
{"BSDSocket", "Miscellaneous", "Miscellaneous", "ShowGUI", "numlock"},
{"BSDSocket", "Miscellaneous", "Miscellaneous", "ShowGUI", "MasterWP"},
{ "MasterWP", "Miscellaneous", "Miscellaneous", "BSDSocket", "numlock" },
{"numlock", "Miscellaneous", "scrolllock", "", ""},
{"scrolllock", "numlock", "", "", ""},
@ -216,17 +255,19 @@ static NavigationMap navMap[] =
{"virtCancel", "virtOK", "virtOK", "virtPath", "virtRW"},
// EditFilesysHardfile
{"hdfDev", "hdfBootPri", "hdfRW", "hdfOK", "hdfPath"},
{"hdfRW", "hdfDev", "hdfAutoboot", "hdfOK", "hdfPath"},
{"hdfAutoboot", "hdfRW", "hdfBootPri", "hdfOK", "hdfPath"},
{"hdfBootPri", "hdfAutoboot", "hdfDev", "hdfCancel", "hdfPath"},
{"hdfSurface", "hdfReserved", "hdfReserved", "hdfPath", "hdfSectors"},
{"hdfReserved", "hdfSurface", "hdfSurface", "hdfPath", "hdfBlocksize"},
{"hdfSectors", "hdfBlocksize", "hdfBlocksize", "hdfSurface", "hdfOK"},
{"hdfBlocksize", "hdfSectors", "hdfSectors", "hdfReserved", "hdfOK"},
{"hdfPath", "", "", "hdfBootPri", "hdfReserved"},
{"hdfOK", "hdfCancel", "hdfCancel", "hdfBlocksize", "hdfBootPri"},
{"hdfCancel", "hdfOK", "hdfOK", "hdfBlocksize", "hdfBootPri"},
{ "hdfDev", "hdfBootPri", "hdfRW", "hdfOK", "hdfPath" },
{ "hdfRW", "hdfDev", "hdfAutoboot", "hdfOK", "hdfPath" },
{ "hdfAutoboot", "hdfRW", "hdfBootPri", "hdfOK", "hdfPath" },
{ "hdfBootPri", "hdfAutoboot", "hdfDev", "hdfCancel", "hdfPath" },
{ "hdfSurface", "hdfReserved", "hdfReserved", "hdfPath", "hdfSectors" },
{ "hdfReserved", "hdfSurface", "hdfSurface", "hdfPath", "hdfBlocksize" },
{ "hdfSectors", "hdfBlocksize", "hdfBlocksize", "hdfSurface", "hdfController" },
{ "hdfBlocksize", "hdfSectors", "hdfSectors", "hdfReserved", "hdfUnit" },
{ "hdfPath", "", "", "hdfBootPri", "hdfReserved" },
{ "hdfController", "hdfUnit", "hdfUnit", "hdfSectors", "hdfOK" },
{ "hdfUnit", "hdfController", "hdfController", "hdfBlocksize", "hdfOK" },
{ "hdfOK", "hdfCancel", "hdfCancel", "hdfUnit", "hdfBootPri" },
{ "hdfCancel", "hdfOK", "hdfOK", "hdfUnit", "hdfBootPri" },
// CreateFilesysHardfile
{"createHdfDev", "createHdfBootPri", "createHdfAutoboot", "createHdfOK", "createHdfPath"},
@ -254,8 +295,9 @@ bool HandleNavigation(int direction)
{
string activeName = activeWidget->getId();
bool bFoundEnabled = false;
int tries = 10;
while (!bFoundEnabled)
while (!bFoundEnabled && tries > 0)
{
string searchFor = "";
@ -299,6 +341,7 @@ bool HandleNavigation(int direction)
}
if (searchFor == "")
bFoundEnabled = true; // No entry to navigate to -> exit loop
--tries;
}
if (focusTarget != nullptr)

View file

@ -9,8 +9,10 @@
#include "sysconfig.h"
#include "sysdeps.h"
#include "options.h"
#include "uae.h"
#include "gui.h"
#include "gui_handling.h"
#include "newcpu.h"
static gcn::Window* grpCPU;
static gcn::UaeRadioButton* optCPU68000;
@ -26,6 +28,8 @@ static gcn::UaeRadioButton* optFPUnone;
static gcn::UaeRadioButton* optFPU68881;
static gcn::UaeRadioButton* optFPU68882;
static gcn::UaeRadioButton* optFPUinternal;
static gcn::UaeCheckBox* chkFPUstrict;
static gcn::UaeCheckBox* chkSoftFloat;
static gcn::Window* grpCPUSpeed;
static gcn::UaeRadioButton* opt7Mhz;
static gcn::UaeRadioButton* opt14Mhz;
@ -43,16 +47,16 @@ public:
changed_prefs.cpu_model = 68000;
changed_prefs.fpu_model = 0;
changed_prefs.address_space_24 = true;
changed_prefs.z3fastmem_size = 0;
changed_prefs.rtgmem_size = 0;
changed_prefs.z3fastmem[0].size = 0;
changed_prefs.rtgboards[0].rtgmem_size = 0;
}
else if (actionEvent.getSource() == optCPU68010)
{
changed_prefs.cpu_model = 68010;
changed_prefs.fpu_model = 0;
changed_prefs.address_space_24 = true;
changed_prefs.z3fastmem_size = 0;
changed_prefs.rtgmem_size = 0;
changed_prefs.z3fastmem[0].size = 0;
changed_prefs.rtgboards[0].rtgmem_size = 0;
}
else if (actionEvent.getSource() == optCPU68020)
{
@ -155,7 +159,7 @@ public:
}
else
{
changed_prefs.cpu_compatible = 0;
changed_prefs.cpu_compatible = false;
}
RefreshPanelCPU();
}
@ -172,7 +176,7 @@ public:
if (chkJIT->isSelected())
{
changed_prefs.cpu_compatible = 0;
changed_prefs.cachesize = DEFAULT_JIT_CACHE_SIZE;
changed_prefs.cachesize = MAX_JIT_CACHE;
}
else
{
@ -184,6 +188,23 @@ public:
static JITActionListener* jitActionListener;
class FPUActionListener : public gcn::ActionListener
{
public:
void action(const gcn::ActionEvent& actionEvent)
{
if (actionEvent.getSource() == chkFPUstrict) {
changed_prefs.fpu_strict = chkFPUstrict->isSelected();
}
else if (actionEvent.getSource() == chkSoftFloat) {
changed_prefs.fpu_softfloat = chkSoftFloat->isSelected();
}
RefreshPanelCPU();
}
};
static FPUActionListener* fpuActionListener;
void InitPanelCPU(const struct _ConfigCategory& category)
{
@ -191,6 +212,7 @@ void InitPanelCPU(const struct _ConfigCategory& category)
cpu24BitActionListener = new CPU24BitActionListener();
cpuCompActionListener = new CPUCompActionListener();
jitActionListener = new JITActionListener();
fpuActionListener = new FPUActionListener();
optCPU68000 = new gcn::UaeRadioButton("68000", "radiocpugroup");
optCPU68000->addActionListener(cpuButtonActionListener);
@ -246,14 +268,24 @@ void InitPanelCPU(const struct _ConfigCategory& category)
optFPUinternal = new gcn::UaeRadioButton("CPU internal", "radiofpugroup");
optFPUinternal->addActionListener(fpuButtonActionListener);
chkFPUstrict = new gcn::UaeCheckBox("More compatible", true);
chkFPUstrict->setId("FPUstrict");
chkFPUstrict->addActionListener(fpuActionListener);
chkSoftFloat = new gcn::UaeCheckBox("Softfloat FPU emul.", true);
chkSoftFloat->setId("SoftFloat");
chkSoftFloat->addActionListener(fpuActionListener);
grpFPU = new gcn::Window("FPU");
grpFPU->setPosition(DISTANCE_BORDER + grpCPU->getWidth() + DISTANCE_NEXT_X, DISTANCE_BORDER);
grpFPU->add(optFPUnone, 5, 10);
grpFPU->add(optFPU68881, 5, 40);
grpFPU->add(optFPU68882, 5, 70);
grpFPU->add(optFPUinternal, 5, 100);
grpFPU->add(chkFPUstrict, 5, 140);
grpFPU->add(chkSoftFloat, 5, 170);
grpFPU->setMovable(false);
grpFPU->setSize(140, 145);
grpFPU->setSize(180, 215);
grpFPU->setBaseColor(gui_baseCol);
category.panel->add(grpFPU);
@ -308,8 +340,11 @@ void ExitPanelCPU()
delete optFPU68881;
delete optFPU68882;
delete optFPUinternal;
delete chkFPUstrict;
delete chkSoftFloat;
delete grpFPU;
delete fpuButtonActionListener;
delete fpuActionListener;
delete opt7Mhz;
delete opt14Mhz;
@ -358,6 +393,9 @@ void RefreshPanelCPU()
optFPU68882->setEnabled(changed_prefs.cpu_model >= 68020 && changed_prefs.cpu_model < 68040);
optFPUinternal->setEnabled(changed_prefs.cpu_model == 68040);
chkFPUstrict->setSelected(changed_prefs.fpu_strict);
chkSoftFloat->setSelected(changed_prefs.fpu_softfloat);
if (changed_prefs.m68k_speed == M68K_SPEED_7MHZ_CYCLES)
opt7Mhz->setSelected(true);
else if (changed_prefs.m68k_speed == M68K_SPEED_14MHZ_CYCLES)
@ -367,3 +405,25 @@ void RefreshPanelCPU()
else if (changed_prefs.m68k_speed == -1)
optFastest->setSelected(true);
}
bool HelpPanelCPU(std::vector<std::string> &helptext)
{
helptext.clear();
helptext.push_back("Select the required Amiga CPU (68000 - 68040).");
helptext.push_back("If you select 68020, you can choose between 24-bit addressing (68EC020) or 32-bit addressing (68020).");
helptext.push_back("The option \"More compatible\" is only available if 68000 or 68010 is selected and emulates simple prefetch of");
helptext.push_back("the 68000. This may improve compatibility in few situations but is not required for most games and demos.");
helptext.push_back("");
helptext.push_back("JIT enables the Just-in-time compiler. This may break compatibility in some games.");
helptext.push_back("");
helptext.push_back("The available FPU models depending on the selected CPU.");
helptext.push_back("The option \"More compatible\" activates more accurate rounding and compare of two floats.");
helptext.push_back("\"Softfloat FPU emul.\" aktivates the FPU emulation from QEMU. This is more accurate, but a bit slower.");
helptext.push_back("");
helptext.push_back("With \"CPU Speed\" you can choose the clock rate of the Amiga.");
helptext.push_back("");
helptext.push_back("In current version, you will not see a difference in the performance for 68020, 68030 and 68040 CPUs. The cpu");
helptext.push_back("cycles for the opcodes are based on 68020. The different cycles for 68030 and 68040 may come in a later");
helptext.push_back("version.");
return true;
}

View file

@ -5,6 +5,7 @@
#include "SelectorEntry.hpp"
#include "UaeRadioButton.hpp"
#include "UaeCheckBox.hpp"
#include "UaeDropDown.hpp"
#include "sysconfig.h"
#include "sysdeps.h"
@ -14,13 +15,14 @@
#include "custom.h"
#include "gui_handling.h"
static gcn::Window* grpChipset;
static gcn::UaeRadioButton* optOCS;
static gcn::UaeRadioButton* optECSAgnus;
static gcn::UaeRadioButton* optECS;
static gcn::UaeRadioButton* optAGA;
static gcn::UaeCheckBox* chkNTSC;
static gcn::Label *lblChipset;
static gcn::UaeDropDown* cboChipset;
static gcn::Window* grpBlitter;
static gcn::UaeRadioButton* optBlitNormal;
static gcn::UaeRadioButton* optBlitImmed;
@ -31,6 +33,68 @@ static gcn::UaeRadioButton* optCollSprites;
static gcn::UaeRadioButton* optCollPlayfield;
static gcn::UaeRadioButton* optCollFull;
struct chipset {
int compatible;
char name[32];
};
static struct chipset chipsets[] = {
{ CP_GENERIC, "Generic" },
{ CP_CD32, "CD32" },
{ CP_A500, "A500" },
{ CP_A500P, "A500+" },
{ CP_A600, "A600" },
{ CP_A1200, "A1200" },
{ CP_A2000, "A2000" },
{ CP_A4000, "A4000" },
{ -1, "" }
};
static const int numChipsets = 8;
class ChipsetListModel : public gcn::ListModel
{
public:
ChipsetListModel()
{
}
int getNumberOfElements() override
{
return numChipsets;
}
std::string getElementAt(int i) override
{
if (i < 0 || i >= numChipsets)
return "---";
return chipsets[i].name;
}
};
static ChipsetListModel chipsetList;
static bool bIgnoreListChange = true;
class ChipsetActionListener : public gcn::ActionListener
{
public:
void action(const gcn::ActionEvent& actionEvent) override
{
if (!bIgnoreListChange) {
if (actionEvent.getSource() == cboChipset) {
//---------------------------------------
// Chipset selected
//---------------------------------------
int cs = chipsets[cboChipset->getSelected()].compatible;
if (changed_prefs.cs_compatible != cs) {
changed_prefs.cs_compatible = cs;
built_in_chipset_prefs(&changed_prefs);
RefreshPanelChipset();
}
}
}
}
};
static ChipsetActionListener* chipsetActionListener;
class ChipsetButtonActionListener : public gcn::ActionListener
{
@ -106,6 +170,7 @@ static CollisionButtonActionListener* collisionButtonActionListener;
void InitPanelChipset(const struct _ConfigCategory& category)
{
chipsetActionListener = new ChipsetActionListener();
chipsetButtonActionListener = new ChipsetButtonActionListener();
ntscButtonActionListener = new NTSCButtonActionListener();
@ -124,6 +189,15 @@ void InitPanelChipset(const struct _ConfigCategory& category)
chkNTSC = new gcn::UaeCheckBox("NTSC");
chkNTSC->addActionListener(ntscButtonActionListener);
lblChipset = new gcn::Label("Extra:");
lblChipset->setSize(40, LABEL_HEIGHT);
lblChipset->setAlignment(gcn::Graphics::RIGHT);
cboChipset = new gcn::UaeDropDown(&chipsetList);
cboChipset->setSize(75, DROPDOWN_HEIGHT);
cboChipset->setBaseColor(gui_baseCol);
cboChipset->setId("ChipsetExtra");
cboChipset->addActionListener(chipsetActionListener);
grpChipset = new gcn::Window("Chipset");
grpChipset->setPosition(DISTANCE_BORDER, DISTANCE_BORDER);
grpChipset->add(optOCS, 5, 10);
@ -131,6 +205,9 @@ void InitPanelChipset(const struct _ConfigCategory& category)
grpChipset->add(optECS, 5, 70);
grpChipset->add(optAGA, 5, 100);
grpChipset->add(chkNTSC, 5, 140);
grpChipset->add(lblChipset, 115, 10);
grpChipset->add(cboChipset, 115 + lblChipset->getWidth() + 8, 10);
grpChipset->setMovable(false);
grpChipset->setSize(120, 185);
grpChipset->setBaseColor(gui_baseCol);
@ -201,9 +278,12 @@ void ExitPanelChipset()
delete optECS;
delete optAGA;
delete chkNTSC;
delete lblChipset;
delete cboChipset;
delete grpChipset;
delete chipsetButtonActionListener;
delete ntscButtonActionListener;
delete chipsetActionListener;
delete optBlitNormal;
delete optBlitImmed;
@ -222,6 +302,17 @@ void ExitPanelChipset()
void RefreshPanelChipset()
{
bIgnoreListChange = true;
int idx = 0;
for (int i = 0; i<numChipsets; ++i) {
if (chipsets[i].compatible == changed_prefs.cs_compatible) {
idx = i;
break;
}
}
cboChipset->setSelected(idx);
bIgnoreListChange = false;
if (changed_prefs.chipset_mask == 0)
optOCS->setSelected(true);
else if (changed_prefs.chipset_mask == CSMASK_ECS_AGNUS)
@ -240,7 +331,7 @@ void RefreshPanelChipset()
else
optBlitNormal->setSelected(true);
if (changed_prefs.collision_level == 0)
if (changed_prefs.collision_level == 0)
optCollNone->setSelected(true);
else if (changed_prefs.collision_level == 1)
optCollSprites->setSelected(true);
@ -249,3 +340,23 @@ void RefreshPanelChipset()
else
optCollFull->setSelected(true);
}
bool HelpPanelChipset(std::vector<std::string> &helptext)
{
helptext.clear();
helptext.push_back("If you want to emulate an Amiga 1200, select AGA. For most Amiga 500 games, select \"Full ECS\". Some older");
helptext.push_back("Amiga games requires \"OCS\" or \"ECS Agnus\". You have to play with these options if a game won't work as");
helptext.push_back("expected. By selecting an entry in \"Extra\", all internal chipset settings will become the required values for the specified");
helptext.push_back("Amiga model.");
helptext.push_back("For some games, you have to activate \"NTSC\" (60 Hz instead of 50 Hz) for correct timing.");
helptext.push_back("");
helptext.push_back("When you see some graphic issues in a game, try \"Immediate\" or \"Wait for blit.\" for blitter and/or disable");
helptext.push_back("\"Fast copper\".");
helptext.push_back("");
helptext.push_back("\"Fast copper\" uses a prediction algorithm instead of checking the copper state on a more regular basis. This may");
helptext.push_back("cause issues but brings a big performance improvement. The option was removed in WinUAE in an early state,");
helptext.push_back("but for most games, it works fine and the better performance is helpful for low powered devices.");
helptext.push_back("");
helptext.push_back("For \"Collision Level\", select \"Sprites and Sprites vs. Playfield\" which is fine for nearly all games.");
return true;
}

View file

@ -10,6 +10,7 @@
#include "options.h"
#include "gui.h"
#include "gui_handling.h"
#include "uae.h"
static char last_active_config[MAX_DPATH] = {'\0'};
static int ensureVisible = -1;
@ -43,28 +44,6 @@ bool LoadConfigByName(const char* name)
return false;
}
void load_builtin_config(int id)
{
if (changed_prefs.cdslots[0].inuse)
gui_force_rtarea_hdchange();
discard_prefs(&changed_prefs, 0);
default_prefs(&changed_prefs, 0);
switch (id)
{
case BUILTINID_A500:
built_in_prefs(&changed_prefs, 0, 1, 0, 0);
break;
case BUILTINID_A1200:
built_in_prefs(&changed_prefs, 4, 0, 0, 0);
break;
case BUILTINID_CD32:
built_in_prefs(&changed_prefs, 8, 0, 0, 0);
break;
}
}
void SetLastActiveConfig(const char* filename)
{
extractFileName(filename, last_active_config);
@ -126,18 +105,12 @@ public:
// Load selected configuration
//-----------------------------------------------
i = lstConfigs->getSelected();
if (i != -1)
{
if (ConfigFilesList[i]->BuiltInID != BUILTINID_NONE)
{
load_builtin_config(ConfigFilesList[i]->BuiltInID);
strcpy(changed_prefs.description, ConfigFilesList[i]->Description);
}
else
{
target_cfgfile_load(&changed_prefs, ConfigFilesList[i]->FullPath, 0, 0);
}
strcpy(last_active_config, ConfigFilesList[i]->Name);
if (emulating) {
uae_restart(-1, ConfigFilesList[i]->FullPath);
}
else {
target_cfgfile_load(&changed_prefs, ConfigFilesList[i]->FullPath, 0, 0);
strncpy(last_active_config, ConfigFilesList[i]->Name, MAX_PATH);
DisableResume();
RefreshAllPanels();
}
@ -171,9 +144,9 @@ public:
//-----------------------------------------------
char msg[MAX_DPATH];
i = lstConfigs->getSelected();
if (i >= 0 && ConfigFilesList[i]->BuiltInID == BUILTINID_NONE && strcmp(ConfigFilesList[i]->Name, OPTIONSFILENAME))
if (i >= 0 && strcmp(ConfigFilesList[i]->Name, OPTIONSFILENAME))
{
snprintf(msg, sizeof msg, "Do you want to delete '%s' ?", ConfigFilesList[i]->Name);
snprintf(msg, 256, "Do you want to delete '%s' ?", ConfigFilesList[i]->Name);
if (ShowMessage("Delete Configuration", msg, "", "Yes", "No"))
{
remove(ConfigFilesList[i]->FullPath);
@ -206,18 +179,17 @@ public:
//-----------------------------------------------
// Selected same config again -> load and start it
//-----------------------------------------------
if (ConfigFilesList[selected_item]->BuiltInID != BUILTINID_NONE)
{
load_builtin_config(ConfigFilesList[selected_item]->BuiltInID);
strcpy(changed_prefs.description, ConfigFilesList[selected_item]->Description);
if (emulating) {
uae_restart(0, ConfigFilesList[selected_item]->FullPath);
}
else
{
else {
target_cfgfile_load(&changed_prefs, ConfigFilesList[selected_item]->FullPath, 0, 0);
strncpy(last_active_config, ConfigFilesList[selected_item]->Name, MAX_PATH);
DisableResume();
RefreshAllPanels();
uae_reset(0, 1);
}
strcpy(last_active_config, ConfigFilesList[selected_item]->Name);
DisableResume();
RefreshAllPanels();
gui_running = false;
}
else
{
@ -375,3 +347,16 @@ void RefreshPanelConfig()
}
}
}
bool HelpPanelConfig(std::vector<std::string> &helptext)
{
helptext.clear();
helptext.push_back("To load a configuration, select the entry in the list and then click on \"Load\". If you doubleclick on an entry");
helptext.push_back("in the list, the emulation starts with this configuration.");
helptext.push_back("");
helptext.push_back("If you want to create a new configuration, setup all options, enter a new name in \"Name\", provide a short");
helptext.push_back("description and then click on \"Save\".");
helptext.push_back("");
helptext.push_back("\"Delete\" will delete the selected configuration.");
return true;
}

View file

@ -112,3 +112,16 @@ void RefreshPanelDisplay()
else if (changed_prefs.scaling_method == 1)
optLinear->setSelected(true);
}
bool HelpPanelDisplay(std::vector<std::string> &helptext)
{
helptext.clear();
helptext.push_back("Select the scaling method for the Amiga screen. The default option \"Auto\", will try to find the best looking");
helptext.push_back("scaling method depending on your monitor's resolution. \"Nearest Neighbor\" will give you a more pixelated");
helptext.push_back("and crisp image, but it may come with some distortion if your resolution is not an exact multiple.");
helptext.push_back("\"Linear\" will give you a smoother scaling but some people might find it a bit blurry.");
helptext.push_back("");
helptext.push_back("When you activate \"Frameskip\", only every second frame is drawn. This will improve performance and some");
helptext.push_back("more games are playable.");
return true;
}

View file

@ -30,13 +30,13 @@ static gcn::Button* cmdSaveForDisk;
static gcn::Button* cmdCreateDDDisk;
static gcn::Button* cmdCreateHDDisk;
static const char* diskfile_filter[] = {".adf", ".adz", ".zip", ".gz", ".dms", "\0"};
static const char *diskfile_filter[] = { ".adf", ".adz", ".fdi", ".zip", ".dms", ".gz", ".xz", "\0" };
static const char* drivespeedlist[] = {"100% (compatible)", "200%", "400%", "800%"};
static const int drivespeedvalues[] = {100, 200, 400, 800};
static void AdjustDropDownControls();
static bool bLoadConfigForDisk = false;
static bool bIgnoreListChange = false;
class DriveTypeListModel : public gcn::ListModel
{
@ -104,6 +104,7 @@ public:
changed_prefs.floppyslots[i].dfxtype = cboDFxType[i]->getSelected() - 1;
}
RefreshPanelFloppy();
RefreshPanelQuickstart();
}
};
@ -136,10 +137,17 @@ public:
// Write-protect changed
//---------------------------------------
disk_setwriteprotect(&changed_prefs, i, changed_prefs.floppyslots[i].df, chkDFxWriteProtect[i]->isSelected());
if (disk_getwriteprotect(&changed_prefs, changed_prefs.floppyslots[i].df) != chkDFxWriteProtect[i]->isSelected()) {
// Failed to change write protection -> maybe filesystem doesn't support this
chkDFxWriteProtect[i]->setSelected(!chkDFxWriteProtect[i]->isSelected());
ShowMessage("Set/Clear write protect", "Failed to change write permission.", "Maybe underlying filesystem doesn't support this.", "Ok", "");
}
DISK_reinsert(i);
}
}
}
RefreshPanelFloppy();
RefreshPanelQuickstart();
}
};
@ -159,6 +167,7 @@ public:
// Show info about current disk-image
//---------------------------------------
if (changed_prefs.floppyslots[i].dfxtype != DRV_NONE && strlen(changed_prefs.floppyslots[i].df) > 0); // ToDo: Show info dialog
//ToDo: Show info dialog
}
else if (actionEvent.getSource() == cmdDFxEject[i])
{
@ -203,14 +212,13 @@ public:
}
}
RefreshPanelFloppy();
RefreshPanelQuickstart();
}
};
static DFxButtonActionListener* dfxButtonActionListener;
static bool bIgnoreListChange = false;
class DiskFileActionListener : public gcn::ActionListener
{
public:
@ -260,6 +268,7 @@ public:
}
}
RefreshPanelFloppy();
RefreshPanelQuickstart();
}
};
@ -325,7 +334,7 @@ public:
extractFileName(tmp, diskname);
removeFileExtension(diskname);
diskname[31] = '\0';
disk_creatediskfile(tmp, 0, DRV_35_DD, diskname, false, false, nullptr);
disk_creatediskfile(&changed_prefs, tmp, 0, DRV_35_DD, -1, diskname, false, false, nullptr);
AddFileToDiskList(tmp, 1);
extractPath(tmp, currentDir);
}
@ -342,7 +351,7 @@ public:
extractFileName(tmp, diskname);
removeFileExtension(diskname);
diskname[31] = '\0';
disk_creatediskfile(tmp, 0, DRV_35_HD, diskname, false, false, nullptr);
disk_creatediskfile(&changed_prefs, tmp, 0, DRV_35_HD, -1, diskname, false, false, nullptr);
AddFileToDiskList(tmp, 1);
extractPath(tmp, currentDir);
}
@ -563,6 +572,7 @@ void RefreshPanelFloppy()
chkDFx[i]->setEnabled(prevAvailable);
cboDFxType[i]->setEnabled(prevAvailable);
chkDFxWriteProtect[i]->setEnabled(driveEnabled && !changed_prefs.floppy_read_only);
cmdDFxInfo[i]->setEnabled(driveEnabled);
cmdDFxEject[i]->setEnabled(driveEnabled);
cmdDFxSelect[i]->setEnabled(driveEnabled);
@ -585,3 +595,23 @@ void RefreshPanelFloppy()
}
}
}
bool HelpPanelFloppy(std::vector<std::string> &helptext)
{
helptext.clear();
helptext.push_back("You can enable/disable each drive by clicking the checkbox next to DFx or select the drive type in the dropdown");
helptext.push_back("control. \"3.5'' DD\" is the right choise for nearly all ADF and ADZ files.");
helptext.push_back("The option \"Write-protected\" indicates if the emulator can write to the ADF. Changing the write protection of the");
helptext.push_back("disk file may fail because of missing rights on the host filesystem.");
helptext.push_back("The button \"...\" opens a dialog to select the required disk file. With the dropdown control, you can select one of");
helptext.push_back("the disks you recently used.");
helptext.push_back("");
helptext.push_back("You can reduce the loading time for lot of games by increasing the floppy drive emulation speed. A few games");
helptext.push_back("will not load with higher drive speed and you have to select 100%.");
helptext.push_back("");
helptext.push_back("\"Save config for disk\" will create a new configuration file with the name of the disk in DF0. This configuration will");
helptext.push_back("be loaded each time you select the disk and have the option \"Load config with same name as disk\" enabled.");
helptext.push_back("");
helptext.push_back("With the buttons \"Create 3.5'' DD disk\" and \"Create 3.5'' HD disk\" you can create a new and empty disk.");
return true;
}

View file

@ -55,6 +55,7 @@ static gcn::ImageButton* listCmdDelete[MAX_HD_DEVICES];
static gcn::Button* cmdAddDirectory;
static gcn::Button* cmdAddHardfile;
static gcn::Button* cmdCreateHardfile;
static gcn::UaeCheckBox* chkHDReadOnly;
static gcn::UaeCheckBox* chkCD;
static gcn::UaeDropDown* cboCDFile;
static gcn::Button* cmdCDEject;
@ -258,6 +259,7 @@ public:
cmdCDSelect->requestFocus();
}
RefreshPanelHD();
RefreshPanelQuickstart();
}
};
@ -271,13 +273,16 @@ public:
{
if (actionEvent.getSource() == sldCDVol)
{
int newvol = 100 - int(sldCDVol->getValue());
int newvol = 100 - (int)sldCDVol->getValue();
if (changed_prefs.sound_volume_cd != newvol)
{
changed_prefs.sound_volume_cd = newvol;
RefreshPanelHD();
}
}
else if (actionEvent.getSource() == chkHDReadOnly) {
changed_prefs.harddrive_read_only = chkHDReadOnly->isSelected();
}
}
};
@ -395,6 +400,10 @@ void InitPanelHD(const struct _ConfigCategory& category)
cdFileActionListener = new CDFileActionListener();
genericActionListener = new GenericActionListener();
chkHDReadOnly = new gcn::UaeCheckBox("Master harddrive write protection");
chkHDReadOnly->setId("chkHDRO");
chkHDReadOnly->addActionListener(genericActionListener);
chkCD = new gcn::UaeCheckBox("CD drive");
chkCD->addActionListener(cdCheckActionListener);
@ -459,6 +468,9 @@ void InitPanelHD(const struct _ConfigCategory& category)
category.panel->add(cmdCreateHardfile, cmdAddHardfile->getX() + cmdAddHardfile->getWidth() + DISTANCE_NEXT_X, posY);
posY += cmdAddDirectory->getHeight() + 2 * DISTANCE_NEXT_Y;
category.panel->add(chkHDReadOnly, DISTANCE_BORDER, posY);
posY += chkHDReadOnly->getHeight() + DISTANCE_NEXT_Y + 4;
category.panel->add(chkCD, DISTANCE_BORDER, posY + 2);
category.panel->add(cmdCDEject, category.panel->getWidth() - cmdCDEject->getWidth() - DISTANCE_NEXT_X - cmdCDSelect->getWidth() - DISTANCE_BORDER, posY);
category.panel->add(cmdCDSelect, category.panel->getWidth() - cmdCDSelect->getWidth() - DISTANCE_BORDER, posY);
@ -494,6 +506,7 @@ void ExitPanelHD()
delete cmdAddDirectory;
delete cmdAddHardfile;
delete cmdCreateHardfile;
delete chkHDReadOnly;
delete chkCD;
delete cmdCDEject;
@ -600,6 +613,8 @@ void RefreshPanelHD()
}
}
chkHDReadOnly->setSelected(changed_prefs.harddrive_read_only);
chkCD->setSelected(changed_prefs.cdslots[0].inuse);
cmdCDEject->setEnabled(changed_prefs.cdslots[0].inuse);
cmdCDSelect->setEnabled(changed_prefs.cdslots[0].inuse);
@ -616,3 +631,21 @@ int count_HDs(struct uae_prefs* p)
{
return p->mountitems;
}
bool HelpPanelHD(std::vector<std::string> &helptext)
{
helptext.clear();
helptext.push_back("Use \"Add Directory\" to add a folder or \"Add Hardfile\" to add a HDF file as a hard disk. To edit the settings of a");
helptext.push_back("HDD, click on \"...\" left to the entry in the list. With the red cross, you can delete an entry.");
helptext.push_back("");
helptext.push_back("With \"Create Hardfile\", you can create a new formatted HDF file up to 2 GB. For large files, it will take some time");
helptext.push_back("to create the new hard disk. You have to format the new HDD in the Amiga via the Workbench.");
helptext.push_back("");
helptext.push_back("If \"Master harddrive write protection\" is activated, you can't write to any HD.");
helptext.push_back("");
helptext.push_back("Activate \"CD drive\" to emulate CD for CD32. Use \"Eject\" to remove current CD and click on \"...\" to open a dialog");
helptext.push_back("to select the iso/cue file for CD emulation.");
helptext.push_back("");
helptext.push_back("In current version, WAV, MP3 and FLAC is supported for audio tracks.");
return true;
}

View file

@ -754,3 +754,16 @@ void RefreshPanelInput()
txtRight->setText(changed_prefs.custom_right);
txtPlay->setText(changed_prefs.custom_play);
}
bool HelpPanelInput(std::vector<std::string> &helptext)
{
helptext.clear();
helptext.push_back("You can select the control type for both ports and the rate for autofire.");
helptext.push_back("");
helptext.push_back("Set the emulated mouse speed to .25x, .5x, 1x, 2x and 4x to slow down or speed up the mouse.");
helptext.push_back("");
helptext.push_back("When you activate \"Custom Control\", you can define which Amiga key should be emulated by pressing one of the");
helptext.push_back("ABXY- or D-pad buttons. Useful to setup controls for pinball games. During emulation, you can switch between");
helptext.push_back("regular buttons and custom settings by pressing left shoulder button and 'c'.");
return true;
}

View file

@ -18,6 +18,7 @@ static gcn::UaeCheckBox* chkStatusLine;
static gcn::UaeCheckBox* chkHideIdleLed;
static gcn::UaeCheckBox* chkShowGUI;
static gcn::UaeCheckBox* chkBSDSocket;
static gcn::UaeCheckBox* chkMasterWP;
static gcn::Label* lblOpenGUI;
static gcn::TextField* txtOpenGUI;
@ -72,6 +73,12 @@ public:
else if (actionEvent.getSource() == chkBSDSocket)
changed_prefs.socket_emu = chkBSDSocket->isSelected();
else if (actionEvent.getSource() == chkMasterWP) {
changed_prefs.floppy_read_only = chkMasterWP->isSelected();
RefreshPanelQuickstart();
RefreshPanelFloppy();
}
else if (actionEvent.getSource() == cmdOpenGUI)
{
const char* key = ShowMessageForInput("Press a key", "Press a key to map to Open the GUI", "Cancel");
@ -123,6 +130,10 @@ void InitPanelMisc(const struct _ConfigCategory& category)
chkBSDSocket->setId("BSDSocket");
chkBSDSocket->addActionListener(miscActionListener);
chkMasterWP = new gcn::UaeCheckBox("Master floppy write protection");
chkMasterWP->setId("MasterWP");
chkMasterWP->addActionListener(miscActionListener);
lblNumLock = new gcn::Label("NumLock:");
lblNumLock->setSize(85, LABEL_HEIGHT);
lblNumLock->setAlignment(gcn::Graphics::RIGHT);
@ -203,6 +214,7 @@ void ExitPanelMisc()
delete chkHideIdleLed;
delete chkShowGUI;
delete chkBSDSocket;
delete chkMasterWP;
delete lblScrLock;
delete lblNumLock;
@ -223,9 +235,29 @@ void RefreshPanelMisc()
chkStatusLine->setSelected(changed_prefs.leds_on_screen);
chkShowGUI->setSelected(changed_prefs.start_gui);
chkBSDSocket->setSelected(changed_prefs.socket_emu);
chkMasterWP->setSelected(changed_prefs.floppy_read_only);
cboKBDLed_num->setSelected(changed_prefs.kbd_led_num);
cboKBDLed_scr->setSelected(changed_prefs.kbd_led_scr);
txtOpenGUI->setText(changed_prefs.open_gui != "" ? changed_prefs.open_gui : "Click to map");
txtKeyForQuit->setText(changed_prefs.quit_amiberry != "" ? changed_prefs.quit_amiberry : "Click to map");
}
bool HelpPanelMisc(std::vector<std::string> &helptext)
{
helptext.clear();
helptext.push_back("\"Status Line\" shows/hides the status line indicator. The first value in the status line");
helptext.push_back("shows the idle time of the CPU in %, the second value is the current frame rate.");
helptext.push_back("When you have a HDD in your Amiga emulation, the HD indicator shows read (blue) and");
helptext.push_back("write (red) access to the HDD. The next values are showing the track number for each disk");
helptext.push_back("drive and indicates disk access.");
helptext.push_back("");
helptext.push_back("When you deactivate the option \"Show GUI on startup\" and use this configuration by specifying it with the");
helptext.push_back("command line parameter \"-config=<file>\", the emulation starts directly without showing the GUI.");
helptext.push_back("");
helptext.push_back("\"bsdsocket.library\" enables network functions (i.e. for web browsers in OS3.9).");
helptext.push_back("");
helptext.push_back("\"Master floppy drive protection\" will disable all write access to floppy disks.");
return true;
}

View file

@ -146,3 +146,14 @@ void RefreshPanelPaths()
fetch_configurationpath(tmp, sizeof tmp);
txtConfigPath->setText(tmp);
}
bool HelpPanelPaths(std::vector<std::string> &helptext)
{
helptext.clear();
helptext.push_back("Specify the location of your kickstart roms and the folder where the configuration files should be stored.");
helptext.push_back("Use the \"...\" button to open a dialog to choose the folder.");
helptext.push_back("");
helptext.push_back("After changing the location of the kickstart roms, click on \"Rescan ROMS\" to refresh the list of the available");
helptext.push_back("ROMs.");
return true;
}

View file

@ -0,0 +1,898 @@
#include <guisan.hpp>
#include <SDL/SDL_ttf.h>
#include <guisan/sdl.hpp>
#include "guisan/sdl/sdltruetypefont.hpp"
#include "SelectorEntry.hpp"
#include "UaeRadioButton.hpp"
#include "UaeDropDown.hpp"
#include "UaeCheckBox.hpp"
#include "sysconfig.h"
#include "sysdeps.h"
#include "config.h"
#include "options.h"
#include "memory.h"
#include "disk.h"
#include "uae.h"
#include "autoconf.h"
#include "filesys.h"
#include "blkdev.h"
#include "gui.h"
#include "gui_handling.h"
static gcn::Label *lblModel;
static gcn::UaeDropDown* cboModel;
static gcn::Label *lblConfig;
static gcn::UaeDropDown* cboConfig;
static gcn::UaeCheckBox* chkNTSC;
static gcn::UaeCheckBox* chkDFx[2];
static gcn::UaeCheckBox* chkDFxWriteProtect[2];
static gcn::Button* cmdDFxInfo[2];
static gcn::Button* cmdDFxEject[2];
static gcn::Button* cmdDFxSelect[2];
static gcn::UaeDropDown* cboDFxFile[2];
static gcn::UaeCheckBox* chkCD;
static gcn::Button* cmdCDEject;
static gcn::Button* cmdCDSelect;
static gcn::UaeDropDown* cboCDFile;
static gcn::UaeCheckBox* chkQuickstartMode;
struct amigamodels {
int compalevels;
char name[32];
char configs[8][128];
};
static struct amigamodels amodels[] = {
{ 4, "Amiga 500",{
"1.3 ROM, OCS, 512 KB Chip + 512 KB Slow RAM (most common)",
"1.3 ROM, ECS Agnus, 512 KB Chip RAM + 512 KB Slow RAM",
"1.3 ROM, ECS Agnus, 1 MB Chip RAM",
"1.3 ROM, OCS Agnus, 512 KB Chip RAM",
"1.2 ROM, OCS Agnus, 512 KB Chip RAM",
"1.2 ROM, OCS Agnus, 512 KB Chip RAM + 512 KB Slow RAM",
"\0" } },
{ 4, "Amiga 500+",{
"Basic non-expanded configuration",
"2 MB Chip RAM expanded configuration",
"MB Fast RAM expanded configuration\n",
"\0" } },
{ 4, "Amiga 600",{
"Basic non-expanded configuration",
"2 MB Chip RAM expanded configuration",
"n MB Fast RAM expanded configuration",
"\0" } },
{ 4, "Amiga 1200",{
"Basic non-expanded configuration",
"4 MB Fast RAM expanded configuration",
"\0" } },
// { 2, "Amiga 3000", {
// "1.4 ROM, 2MB Chip + 8MB Fast",
// "2.04 ROM, 2MB Chip + 8MB Fast",
// "3.1 ROM, 2MB Chip + 8MB Fast",
// "\0" } },
{ 1, "Amiga 4000",{
"68030, 3.1 ROM, 2MB Chip + 8MB Fast",
"68040, 3.1 ROM, 2MB Chip + 8MB Fast",
"\0" } },
{ 3, "CD32",{
"CD32",
"CD32 with Full Motion Video cartridge",
"\0" } },
{ -1 }
};
static const int numModels = 6;
static int numModelConfigs = 0;
static bool bIgnoreListChange = true;
static const char *diskfile_filter[] = { ".adf", ".adz", ".fdi", ".zip", ".dms", ".gz", ".xz", "\0" };
static const char *cdfile_filter[] = { ".cue", ".ccd", ".iso", "\0" };
static void AdjustDropDownControls(void);
static void CountModelConfigs(void)
{
numModelConfigs = 0;
if (quickstart_model >= 0 && quickstart_model < numModels) {
for (int i = 0; i<8; ++i) {
if (amodels[quickstart_model].configs[i][0] == '\0')
break;
++numModelConfigs;
}
}
}
static void SetControlState(int model)
{
bool df1Visible = true;
bool cdVisible = false;
bool df0Editable = true;
switch (model) {
case 0: // A500
case 1: // A500+
case 2: // A600
case 3: // A1200
case 4: // A4000
break;
case 5: // CD32
// No floppy drive available, CD available
df0Editable = false;
df1Visible = false;
cdVisible = true;
break;
}
chkDFxWriteProtect[0]->setEnabled(df0Editable && !changed_prefs.floppy_read_only);
cmdDFxInfo[0]->setEnabled(df0Editable);
cmdDFxEject[0]->setEnabled(df0Editable);
cmdDFxSelect[0]->setEnabled(df0Editable);
cboDFxFile[0]->setEnabled(df0Editable);
chkDFx[1]->setVisible(df1Visible);
chkDFxWriteProtect[1]->setVisible(df1Visible);
cmdDFxInfo[1]->setVisible(df1Visible);
cmdDFxEject[1]->setVisible(df1Visible);
cmdDFxSelect[1]->setVisible(df1Visible);
cboDFxFile[1]->setVisible(df1Visible);
chkCD->setVisible(cdVisible);
cmdCDEject->setVisible(cdVisible);
cmdCDSelect->setVisible(cdVisible);
cboCDFile->setVisible(cdVisible);
}
static void AdjustPrefs(void)
{
int old_cs = changed_prefs.cs_compatible;
built_in_prefs(&changed_prefs, quickstart_model, quickstart_conf, 0, 0);
switch (quickstart_model) {
case 0: // A500
case 1: // A500+
case 2: // A600
case 3: // A1200
case 4: // A4000
// df0 always active
changed_prefs.floppyslots[0].dfxtype = DRV_35_DD;
// No CD available
changed_prefs.cdslots[0].inuse = false;
changed_prefs.cdslots[0].type = SCSI_UNIT_DISABLED;
break;
case 5: // CD32
// No floppy drive available, CD available
changed_prefs.floppyslots[0].dfxtype = DRV_NONE;
changed_prefs.floppyslots[1].dfxtype = DRV_NONE;
changed_prefs.cdslots[0].inuse = true;
changed_prefs.cdslots[0].type = SCSI_UNIT_IMAGE;
break;
}
if (emulating && old_cs != changed_prefs.cs_compatible)
uae_restart(-1, NULL);
}
static void SetModelFromConfig(void)
{
switch (changed_prefs.cs_compatible) {
case CP_A500:
quickstart_model = 0;
if (changed_prefs.chipset_mask == 0)
quickstart_conf = 0;
else if (changed_prefs.chipmem_size == 0x100000)
quickstart_conf = 2;
else
quickstart_conf = 1;
break;
case CP_A500P:
quickstart_model = 1;
if (changed_prefs.chipmem_size == 0x200000)
quickstart_conf = 1;
else if (changed_prefs.fastmem[0].size == 0x400000)
quickstart_conf = 2;
else
quickstart_conf = 1;
break;
case CP_A600:
quickstart_model = 2;
if (changed_prefs.chipmem_size == 0x200000)
quickstart_conf = 1;
else if (changed_prefs.fastmem[0].size == 0x400000)
quickstart_conf = 2;
else
quickstart_conf = 1;
break;
case CP_A1200:
quickstart_model = 3;
if (changed_prefs.fastmem[0].size == 0x400000)
quickstart_conf = 1;
else
quickstart_conf = 0;
break;
case CP_A4000:
quickstart_model = 4;
if (changed_prefs.cpu_model == 68040)
quickstart_conf = 1;
else
quickstart_conf = 0;
break;
case CP_CD32:
quickstart_model = 5;
if (changed_prefs.cs_cd32fmv)
quickstart_conf = 1;
else
quickstart_conf = 0;
break;
default:
if (changed_prefs.cpu_model == 68000)
quickstart_model = 0;
else if (changed_prefs.cpu_model == 68020)
quickstart_model = 3;
else
quickstart_model = 4;
quickstart_conf = 0;
}
cboModel->setSelected(quickstart_model);
}
class AmigaModelListModel : public gcn::ListModel
{
public:
AmigaModelListModel()
{
}
int getNumberOfElements() override
{
return numModels;
}
std::string getElementAt(int i) override
{
if (i < 0 || i >= numModels)
return "---";
return amodels[i].name;
}
};
static AmigaModelListModel amigaModelList;
class AmigaConfigListModel : public gcn::ListModel
{
public:
AmigaConfigListModel()
{
}
int getNumberOfElements() override
{
return numModelConfigs;
}
std::string getElementAt(int i) override
{
if (quickstart_model < 0 || i < 0 || i >= numModelConfigs)
return "---";
return amodels[quickstart_model].configs[i];
}
};
static AmigaConfigListModel amigaConfigList;
class QSDiskfileListModel : public gcn::ListModel
{
public:
QSDiskfileListModel()
{
}
int getNumberOfElements() override
{
return lstMRUDiskList.size();
}
std::string getElementAt(int i) override
{
if (i < 0 || i >= lstMRUDiskList.size())
return "---";
return lstMRUDiskList[i];
}
};
static QSDiskfileListModel diskfileList;
class QSCDfileListModel : public gcn::ListModel
{
public:
QSCDfileListModel()
{
}
int getNumberOfElements() override
{
return lstMRUCDList.size();
}
std::string getElementAt(int i) override
{
if (i < 0 || i >= lstMRUCDList.size())
return "---";
return lstMRUCDList[i];
}
};
static QSCDfileListModel cdfileList;
class QSCDButtonActionListener : public gcn::ActionListener
{
public:
void action(const gcn::ActionEvent& actionEvent) override
{
if (actionEvent.getSource() == cmdCDEject) {
//---------------------------------------
// Eject CD from drive
//---------------------------------------
strncpy(changed_prefs.cdslots[0].name, "", MAX_DPATH);
AdjustDropDownControls();
}
else if (actionEvent.getSource() == cmdCDSelect) {
char tmp[MAX_DPATH];
if (strlen(changed_prefs.cdslots[0].name) > 0)
strncpy(tmp, changed_prefs.cdslots[0].name, MAX_DPATH);
else
strncpy(tmp, currentDir, MAX_DPATH);
if (SelectFile("Select CD image file", tmp, cdfile_filter))
{
if (strncmp(changed_prefs.cdslots[0].name, tmp, MAX_DPATH))
{
strncpy(changed_prefs.cdslots[0].name, tmp, sizeof(changed_prefs.cdslots[0].name));
changed_prefs.cdslots[0].inuse = true;
changed_prefs.cdslots[0].type = SCSI_UNIT_IMAGE;
AddFileToCDList(tmp, 1);
extractPath(tmp, currentDir);
AdjustDropDownControls();
}
}
cmdCDSelect->requestFocus();
}
RefreshPanelHD();
RefreshPanelQuickstart();
}
};
static QSCDButtonActionListener* cdButtonActionListener;
class QSCDFileActionListener : public gcn::ActionListener
{
public:
void action(const gcn::ActionEvent& actionEvent) override
{
//---------------------------------------
// CD image from list selected
//---------------------------------------
if (!bIgnoreListChange) {
int idx = cboCDFile->getSelected();
if (idx < 0) {
strncpy(changed_prefs.cdslots[0].name, "", MAX_DPATH);
AdjustDropDownControls();
}
else {
if (cdfileList.getElementAt(idx).compare(changed_prefs.cdslots[0].name))
{
strncpy(changed_prefs.cdslots[0].name, cdfileList.getElementAt(idx).c_str(), sizeof(changed_prefs.cdslots[0].name));
changed_prefs.cdslots[0].inuse = true;
changed_prefs.cdslots[0].type = SCSI_UNIT_IMAGE;
lstMRUCDList.erase(lstMRUCDList.begin() + idx);
lstMRUCDList.insert(lstMRUCDList.begin(), changed_prefs.cdslots[0].name);
bIgnoreListChange = true;
cboCDFile->setSelected(0);
bIgnoreListChange = false;
}
}
}
RefreshPanelHD();
RefreshPanelQuickstart();
}
};
static QSCDFileActionListener* cdFileActionListener;
class AmigaModelActionListener : public gcn::ActionListener
{
public:
void action(const gcn::ActionEvent& actionEvent) override
{
if (!bIgnoreListChange) {
if (actionEvent.getSource() == cboModel) {
//---------------------------------------
// Amiga model selected
//---------------------------------------
if (quickstart_model != cboModel->getSelected()) {
quickstart_model = cboModel->getSelected();
CountModelConfigs();
cboConfig->setSelected(0);
SetControlState(quickstart_model);
AdjustPrefs();
DisableResume();
}
}
else if (actionEvent.getSource() == cboConfig) {
//---------------------------------------
// Model configuration selected
//---------------------------------------
if (quickstart_conf != cboConfig->getSelected()) {
quickstart_conf = cboConfig->getSelected();
AdjustPrefs();
}
}
RefreshAllPanels();
}
}
};
static AmigaModelActionListener* amigaModelActionListener;
class QSNTSCButtonActionListener : public gcn::ActionListener
{
public:
void action(const gcn::ActionEvent& actionEvent) override
{
if (chkNTSC->isSelected()) {
changed_prefs.ntscmode = true;
changed_prefs.chipset_refreshrate = 60;
}
else {
changed_prefs.ntscmode = false;
changed_prefs.chipset_refreshrate = 50;
}
RefreshPanelChipset();
}
};
static QSNTSCButtonActionListener* ntscButtonActionListener;
class QSDFxCheckActionListener : public gcn::ActionListener
{
public:
void action(const gcn::ActionEvent& actionEvent) override
{
for (int i = 0; i<2; ++i) {
if (actionEvent.getSource() == chkDFx[i]) {
//---------------------------------------
// Drive enabled/disabled
//---------------------------------------
if (chkDFx[i]->isSelected())
changed_prefs.floppyslots[i].dfxtype = DRV_35_DD;
else
changed_prefs.floppyslots[i].dfxtype = DRV_NONE;
}
else if (actionEvent.getSource() == chkDFxWriteProtect[i]) {
//---------------------------------------
// Write-protect changed
//---------------------------------------
disk_setwriteprotect(&changed_prefs, i, changed_prefs.floppyslots[i].df, chkDFxWriteProtect[i]->isSelected());
if (disk_getwriteprotect(&changed_prefs, changed_prefs.floppyslots[i].df) != chkDFxWriteProtect[i]->isSelected()) {
// Failed to change write protection -> maybe filesystem doesn't support this
ShowMessage("Set/Clear write protect", "Failed to change write permission.", "Maybe underlying filesystem doesn't support this.", "Ok", "");
}
DISK_reinsert(i);
}
}
RefreshPanelFloppy();
RefreshPanelQuickstart();
}
};
static QSDFxCheckActionListener* dfxCheckActionListener;
class QSDFxButtonActionListener : public gcn::ActionListener
{
public:
void action(const gcn::ActionEvent& actionEvent) override
{
for (int i = 0; i<2; ++i) {
if (actionEvent.getSource() == cmdDFxInfo[i]) {
//---------------------------------------
// Show info about current disk-image
//---------------------------------------
if (changed_prefs.floppyslots[i].dfxtype != DRV_NONE && strlen(changed_prefs.floppyslots[i].df) > 0)
; // ToDo: Show info dialog
}
else if (actionEvent.getSource() == cmdDFxEject[i]) {
//---------------------------------------
// Eject disk from drive
//---------------------------------------
disk_eject(i);
strncpy(changed_prefs.floppyslots[i].df, "", MAX_DPATH);
AdjustDropDownControls();
}
else if (actionEvent.getSource() == cmdDFxSelect[i]) {
//---------------------------------------
// Select disk for drive
//---------------------------------------
char tmp[MAX_PATH];
if (strlen(changed_prefs.floppyslots[i].df) > 0)
strncpy(tmp, changed_prefs.floppyslots[i].df, MAX_PATH);
else
strncpy(tmp, currentDir, MAX_PATH);
if (SelectFile("Select disk image file", tmp, diskfile_filter))
{
if (strncmp(changed_prefs.floppyslots[i].df, tmp, MAX_PATH))
{
strncpy(changed_prefs.floppyslots[i].df, tmp, sizeof(changed_prefs.floppyslots[i].df));
disk_insert(i, tmp);
AddFileToDiskList(tmp, 1);
extractPath(tmp, currentDir);
AdjustDropDownControls();
}
}
cmdDFxSelect[i]->requestFocus();
}
}
RefreshPanelFloppy();
RefreshPanelQuickstart();
}
};
static QSDFxButtonActionListener* dfxButtonActionListener;
class QSDiskFileActionListener : public gcn::ActionListener
{
public:
void action(const gcn::ActionEvent& actionEvent) override
{
for (int i = 0; i<2; ++i) {
if (actionEvent.getSource() == cboDFxFile[i]) {
//---------------------------------------
// Diskimage from list selected
//---------------------------------------
if (!bIgnoreListChange) {
int idx = cboDFxFile[i]->getSelected();
if (idx < 0) {
disk_eject(i);
strncpy(changed_prefs.floppyslots[i].df, "", MAX_DPATH);
AdjustDropDownControls();
}
else {
if (diskfileList.getElementAt(idx).compare(changed_prefs.floppyslots[i].df)) {
strncpy(changed_prefs.floppyslots[i].df, diskfileList.getElementAt(idx).c_str(), sizeof(changed_prefs.floppyslots[i].df));
disk_insert(i, changed_prefs.floppyslots[i].df);
lstMRUDiskList.erase(lstMRUDiskList.begin() + idx);
lstMRUDiskList.insert(lstMRUDiskList.begin(), changed_prefs.floppyslots[i].df);
bIgnoreListChange = true;
cboDFxFile[i]->setSelected(0);
bIgnoreListChange = false;
}
}
RefreshPanelFloppy();
RefreshPanelQuickstart();
}
}
}
}
};
static QSDiskFileActionListener* diskFileActionListener;
class QuickstartModeActionListener : public gcn::ActionListener
{
public:
void action(const gcn::ActionEvent& actionEvent) override
{
quickstart_start = chkQuickstartMode->isSelected();
}
};
static QuickstartModeActionListener* quickstartModeActionListener;
void InitPanelQuickstart(const struct _ConfigCategory& category)
{
int posX;
int posY = DISTANCE_BORDER;
int i;
amigaModelActionListener = new AmigaModelActionListener();
ntscButtonActionListener = new QSNTSCButtonActionListener();
dfxCheckActionListener = new QSDFxCheckActionListener();
dfxButtonActionListener = new QSDFxButtonActionListener();
diskFileActionListener = new QSDiskFileActionListener();
cdButtonActionListener = new QSCDButtonActionListener();
cdFileActionListener = new QSCDFileActionListener();
quickstartModeActionListener = new QuickstartModeActionListener();
lblModel = new gcn::Label("Amiga model:");
lblModel->setSize(100, LABEL_HEIGHT);
lblModel->setAlignment(gcn::Graphics::RIGHT);
cboModel = new gcn::UaeDropDown(&amigaModelList);
cboModel->setSize(160, DROPDOWN_HEIGHT);
cboModel->setBaseColor(gui_baseCol);
cboModel->setId("AModel");
cboModel->addActionListener(amigaModelActionListener);
lblConfig = new gcn::Label("Configuration:");
lblConfig->setSize(100, LABEL_HEIGHT);
lblConfig->setAlignment(gcn::Graphics::RIGHT);
cboConfig = new gcn::UaeDropDown(&amigaConfigList);
cboConfig->setSize(category.panel->getWidth() - lblConfig->getWidth() - 8 - 2 * DISTANCE_BORDER, DROPDOWN_HEIGHT);
cboConfig->setBaseColor(gui_baseCol);
cboConfig->setId("AConfig");
cboConfig->addActionListener(amigaModelActionListener);
chkNTSC = new gcn::UaeCheckBox("NTSC");
chkNTSC->setId("qsNTSC");
chkNTSC->addActionListener(ntscButtonActionListener);
for (i = 0; i<2; ++i)
{
char tmp[20];
snprintf(tmp, 20, "DF%d:", i);
chkDFx[i] = new gcn::UaeCheckBox(tmp);
chkDFx[i]->addActionListener(dfxCheckActionListener);
snprintf(tmp, 20, "qsDF%d", i);
chkDFx[i]->setId(tmp);
chkDFxWriteProtect[i] = new gcn::UaeCheckBox("Write-protected");
chkDFxWriteProtect[i]->addActionListener(dfxCheckActionListener);
snprintf(tmp, 20, "qsWP%d", i);
chkDFxWriteProtect[i]->setId(tmp);
cmdDFxInfo[i] = new gcn::Button("?");
cmdDFxInfo[i]->setSize(SMALL_BUTTON_WIDTH, SMALL_BUTTON_HEIGHT);
cmdDFxInfo[i]->setBaseColor(gui_baseCol);
cmdDFxInfo[i]->addActionListener(dfxButtonActionListener);
snprintf(tmp, 20, "qsInfo%d", i);
cmdDFxInfo[i]->setId(tmp);
cmdDFxEject[i] = new gcn::Button("Eject");
cmdDFxEject[i]->setSize(SMALL_BUTTON_WIDTH * 2, SMALL_BUTTON_HEIGHT);
cmdDFxEject[i]->setBaseColor(gui_baseCol);
snprintf(tmp, 20, "qscmdEject%d", i);
cmdDFxEject[i]->setId(tmp);
cmdDFxEject[i]->addActionListener(dfxButtonActionListener);
cmdDFxSelect[i] = new gcn::Button("Select file");
cmdDFxSelect[i]->setSize(BUTTON_WIDTH, SMALL_BUTTON_HEIGHT);
cmdDFxSelect[i]->setBaseColor(gui_baseCol);
snprintf(tmp, 20, "qscmdSel%d", i);
cmdDFxSelect[i]->setId(tmp);
cmdDFxSelect[i]->addActionListener(dfxButtonActionListener);
cboDFxFile[i] = new gcn::UaeDropDown(&diskfileList);
cboDFxFile[i]->setSize(category.panel->getWidth() - 2 * DISTANCE_BORDER, DROPDOWN_HEIGHT);
cboDFxFile[i]->setBaseColor(gui_baseCol);
snprintf(tmp, 20, "qscboDisk%d", i);
cboDFxFile[i]->setId(tmp);
cboDFxFile[i]->addActionListener(diskFileActionListener);
}
chkCD = new gcn::UaeCheckBox("CD drive");
chkCD->setId("qsCD drive");
chkCD->setEnabled(false);
cmdCDEject = new gcn::Button("Eject");
cmdCDEject->setSize(SMALL_BUTTON_WIDTH * 2, SMALL_BUTTON_HEIGHT);
cmdCDEject->setBaseColor(gui_baseCol);
cmdCDEject->setId("qscdEject");
cmdCDEject->addActionListener(cdButtonActionListener);
cmdCDSelect = new gcn::Button("Select image");
cmdCDSelect->setSize(BUTTON_WIDTH, SMALL_BUTTON_HEIGHT);
cmdCDSelect->setBaseColor(gui_baseCol);
cmdCDSelect->setId("qsCDSelect");
cmdCDSelect->addActionListener(cdButtonActionListener);
cboCDFile = new gcn::UaeDropDown(&cdfileList);
cboCDFile->setSize(category.panel->getWidth() - 2 * DISTANCE_BORDER, DROPDOWN_HEIGHT);
cboCDFile->setBaseColor(gui_baseCol);
cboCDFile->setId("qscboCD");
cboCDFile->addActionListener(cdFileActionListener);
chkQuickstartMode = new gcn::UaeCheckBox("Start in Quickstart mode");
chkQuickstartMode->setId("qsMode");
chkQuickstartMode->addActionListener(quickstartModeActionListener);
category.panel->add(lblModel, DISTANCE_BORDER, posY);
category.panel->add(cboModel, DISTANCE_BORDER + lblModel->getWidth() + 8, posY);
category.panel->add(chkNTSC, cboModel->getX() + cboModel->getWidth() + 8, posY);
posY += cboModel->getHeight() + DISTANCE_NEXT_Y;
category.panel->add(lblConfig, DISTANCE_BORDER, posY);
category.panel->add(cboConfig, DISTANCE_BORDER + lblConfig->getWidth() + 8, posY);
posY += cboConfig->getHeight() + DISTANCE_NEXT_Y;
for (i = 0; i<2; ++i)
{
posX = DISTANCE_BORDER;
category.panel->add(chkDFx[i], posX, posY);
posX += 180;
category.panel->add(chkDFxWriteProtect[i], posX, posY);
posX += chkDFxWriteProtect[i]->getWidth() + 4 * DISTANCE_NEXT_X;
// category.panel->add(cmdDFxInfo[i], posX, posY);
posX += cmdDFxInfo[i]->getWidth() + DISTANCE_NEXT_X;
category.panel->add(cmdDFxEject[i], posX, posY);
posX += cmdDFxEject[i]->getWidth() + DISTANCE_NEXT_X;
category.panel->add(cmdDFxSelect[i], posX, posY);
posY += chkDFx[i]->getHeight() + 8;
category.panel->add(cboDFxFile[i], DISTANCE_BORDER, posY);
posY += cboDFxFile[i]->getHeight() + DISTANCE_NEXT_Y + 4;
}
category.panel->add(chkCD, chkDFx[1]->getX(), chkDFx[1]->getY());
category.panel->add(cmdCDEject, cmdDFxEject[1]->getX(), cmdDFxEject[1]->getY());
category.panel->add(cmdCDSelect, cmdDFxSelect[1]->getX(), cmdDFxSelect[1]->getY());
category.panel->add(cboCDFile, cboDFxFile[1]->getX(), cboDFxFile[1]->getY());
category.panel->add(chkQuickstartMode, category.panel->getWidth() - chkQuickstartMode->getWidth() - DISTANCE_BORDER, posY);
posY += chkQuickstartMode->getHeight() + DISTANCE_NEXT_Y;
chkCD->setVisible(false);
cmdCDEject->setVisible(false);
cmdCDSelect->setVisible(false);
cboCDFile->setVisible(false);
bIgnoreListChange = false;
cboModel->setSelected(quickstart_model);
CountModelConfigs();
cboConfig->setSelected(quickstart_conf);
SetControlState(quickstart_model);
SetModelFromConfig();
RefreshPanelQuickstart();
}
void ExitPanelQuickstart(void)
{
delete lblModel;
delete cboModel;
delete lblConfig;
delete cboConfig;
delete chkNTSC;
for (int i = 0; i<2; ++i)
{
delete chkDFx[i];
delete chkDFxWriteProtect[i];
delete cmdDFxInfo[i];
delete cmdDFxEject[i];
delete cmdDFxSelect[i];
delete cboDFxFile[i];
}
delete chkCD;
delete cmdCDEject;
delete cmdCDSelect;
delete cboCDFile;
delete chkQuickstartMode;
delete amigaModelActionListener;
delete ntscButtonActionListener;
delete dfxCheckActionListener;
delete dfxButtonActionListener;
delete diskFileActionListener;
delete cdButtonActionListener;
delete cdFileActionListener;
delete quickstartModeActionListener;
}
static void AdjustDropDownControls(void)
{
int i;
bIgnoreListChange = true;
for (i = 0; i<2; ++i)
{
cboDFxFile[i]->clearSelected();
if (changed_prefs.floppyslots[i].dfxtype != DRV_NONE && strlen(changed_prefs.floppyslots[i].df) > 0)
{
for (int j = 0; j<lstMRUDiskList.size(); ++j)
{
if (!lstMRUDiskList[j].compare(changed_prefs.floppyslots[i].df))
{
cboDFxFile[i]->setSelected(j);
break;
}
}
}
}
cboCDFile->clearSelected();
if (changed_prefs.cdslots[0].inuse && strlen(changed_prefs.cdslots[0].name) > 0)
{
for (i = 0; i < lstMRUCDList.size(); ++i)
{
if (!lstMRUCDList[i].compare(changed_prefs.cdslots[0].name))
{
cboCDFile->setSelected(i);
break;
}
}
}
bIgnoreListChange = false;
}
void RefreshPanelQuickstart(void)
{
bool prevAvailable = true;
chkNTSC->setSelected(changed_prefs.ntscmode);
AdjustDropDownControls();
changed_prefs.nr_floppies = 0;
for (int i = 0; i<4; ++i)
{
bool driveEnabled = changed_prefs.floppyslots[i].dfxtype != DRV_NONE;
if (i < 2) {
chkDFx[i]->setSelected(driveEnabled);
chkDFxWriteProtect[i]->setSelected(disk_getwriteprotect(&changed_prefs, changed_prefs.floppyslots[i].df));
if (i == 0)
chkDFx[i]->setEnabled(false);
else
chkDFx[i]->setEnabled(prevAvailable);
cmdDFxInfo[i]->setEnabled(driveEnabled);
chkDFxWriteProtect[i]->setEnabled(driveEnabled && !changed_prefs.floppy_read_only);
cmdDFxEject[i]->setEnabled(driveEnabled);
cmdDFxSelect[i]->setEnabled(driveEnabled);
cboDFxFile[i]->setEnabled(driveEnabled);
}
prevAvailable = driveEnabled;
if (driveEnabled)
changed_prefs.nr_floppies = i + 1;
}
chkCD->setSelected(changed_prefs.cdslots[0].inuse);
cmdCDEject->setEnabled(changed_prefs.cdslots[0].inuse);
cmdCDSelect->setEnabled(changed_prefs.cdslots[0].inuse);
cboCDFile->setEnabled(changed_prefs.cdslots[0].inuse);
chkQuickstartMode->setSelected(quickstart_start);
}
bool HelpPanelQuickstart(std::vector<std::string> &helptext)
{
helptext.clear();
helptext.push_back("Simplified start of emulation by just selecting the Amiga model and the disk/CD you want to use.");
helptext.push_back("");
helptext.push_back("After selecting the Amiga model, you can choose from a small list of standard configurations for this model to");
helptext.push_back("start with.");
helptext.push_back("");
helptext.push_back("When you activate \"Start in Quickstart mode\", the next time you run the emulator, it will start with the quickstart");
helptext.push_back("panel. Otherwise you start in configuraions panel.");
return true;
}

View file

@ -13,16 +13,21 @@
#include "include/memory.h"
#include "gui.h"
#include "gui_handling.h"
#include "gfxboard.h"
static const char* ChipMem_list[] = {"512 K", "1 MB", "2 MB", "4 MB", "8 MB"};
static const int ChipMem_values[] = {0x080000, 0x100000, 0x200000, 0x400000, 0x800000};
static const char* SlowMem_list[] = {"None", "512 K", "1 MB", "1.5 MB", "1.8 MB"};
static const int SlowMem_values[] = {0x000000, 0x080000, 0x100000, 0x180000, 0x1c0000};
static const char* FastMem_list[] = {"None", "1 MB", "2 MB", "4 MB", "8 MB", "16 MB", "32 MB", "64 MB", "128 MB"};
static const int FastMem_values[] = {0x000000, 0x100000, 0x200000, 0x400000, 0x800000, 0x1000000, 0x2000000, 0x4000000, 0x8000000};
static const char *ChipMem_list[] = { "512 K", "1 MB", "2 MB", "4 MB", "8 MB" };
static const int ChipMem_values[] = { 0x080000, 0x100000, 0x200000, 0x400000, 0x800000 };
static const char *SlowMem_list[] = { "None", "512 K", "1 MB", "1.5 MB", "1.8 MB" };
static const int SlowMem_values[] = { 0x000000, 0x080000, 0x100000, 0x180000, 0x1c0000 };
static const char *FastMem_list[] = { "None", "1 MB", "2 MB", "4 MB", "8 MB", "16 MB", "32 MB", "64 MB", "128 MB" };
static const int FastMem_values[] = { 0x000000, 0x100000, 0x200000, 0x400000, 0x800000, 0x1000000, 0x2000000, 0x4000000, 0x8000000 };
static const char *A3000LowMem_list[] = { "None", "8 MB", "16 MB" };
static const int A3000LowMem_values[] = { 0x080000, 0x800000, 0x1000000 };
static const char *A3000HighMem_list[] = { "None", "8 MB", "16 MB", "32 MB" };
static const int A3000HighMem_values[] = { 0x080000, 0x800000, 0x1000000, 0x2000000 };
static gcn::Window* grpRAM;
static gcn::Window *grpRAM;
static gcn::Label* lblChipmem;
static gcn::Label* lblChipsize;
static gcn::Slider* sldChipmem;
@ -38,6 +43,12 @@ static gcn::Slider* sldZ3mem;
static gcn::Label* lblGfxmem;
static gcn::Label* lblGfxsize;
static gcn::Slider* sldGfxmem;
static gcn::Label* lblA3000Lowmem;
static gcn::Label* lblA3000Lowsize;
static gcn::Slider* sldA3000Lowmem;
static gcn::Label* lblA3000Highmem;
static gcn::Label* lblA3000Highsize;
static gcn::Slider* sldA3000Highmem;
class MemorySliderActionListener : public gcn::ActionListener
@ -48,8 +59,8 @@ public:
if (actionEvent.getSource() == sldChipmem)
{
changed_prefs.chipmem_size = ChipMem_values[int(sldChipmem->getValue())];
if ((changed_prefs.chipmem_size > 0x200000) && (changed_prefs.fastmem_size > 0))
changed_prefs.fastmem_size = 0;
if ((changed_prefs.chipmem_size > 0x200000) && (changed_prefs.fastmem[0].size > 0))
changed_prefs.fastmem[0].size = 0;
}
if (actionEvent.getSource() == sldSlowmem)
@ -59,22 +70,34 @@ public:
if (actionEvent.getSource() == sldFastmem)
{
changed_prefs.fastmem_size = FastMem_values[int(sldFastmem->getValue())];
if (changed_prefs.fastmem_size > 0 && changed_prefs.chipmem_size > 0x200000)
changed_prefs.fastmem[0].size = FastMem_values[int(sldFastmem->getValue())];
if (changed_prefs.fastmem[0].size > 0 && changed_prefs.chipmem_size > 0x200000)
changed_prefs.chipmem_size = 0x200000;
}
if (actionEvent.getSource() == sldZ3mem)
{
changed_prefs.z3fastmem_size = FastMem_values[int(sldZ3mem->getValue())];
if (changed_prefs.z3fastmem_size > max_z3fastmem)
changed_prefs.z3fastmem_size = max_z3fastmem;
changed_prefs.z3fastmem[0].size = FastMem_values[int(sldZ3mem->getValue())];
if (changed_prefs.z3fastmem[0].size > max_z3fastmem)
changed_prefs.z3fastmem[0].size = max_z3fastmem;
}
if (actionEvent.getSource() == sldGfxmem)
{
changed_prefs.rtgmem_size = FastMem_values[int(sldGfxmem->getValue())];
changed_prefs.rtgmem_type = 1;
changed_prefs.rtgboards[0].rtgmem_size = FastMem_values[int(sldGfxmem->getValue())];
changed_prefs.rtgboards[0].rtgmem_type = GFXBOARD_UAE_Z3;
}
if (actionEvent.getSource() == sldA3000Lowmem) {
changed_prefs.mbresmem_low_size = A3000LowMem_values[(int)(sldA3000Lowmem->getValue())];
if (currprefs.mbresmem_low_size != changed_prefs.mbresmem_low_size)
DisableResume();
}
if (actionEvent.getSource() == sldA3000Highmem) {
changed_prefs.mbresmem_high_size = A3000HighMem_values[(int)(sldA3000Highmem->getValue())];
if (currprefs.mbresmem_high_size != changed_prefs.mbresmem_high_size)
DisableResume();
}
RefreshPanelRAM();
@ -108,7 +131,7 @@ void InitPanelRAM(const struct _ConfigCategory& category)
sldSlowmem->addActionListener(memorySliderActionListener);
lblSlowsize = new gcn::Label("None ");
lblFastmem = new gcn::Label("Fast:");
lblFastmem = new gcn::Label("Z2 Fast:");
sldFastmem = new gcn::Slider(0, 4);
sldFastmem->setSize(110, SLIDER_HEIGHT);
sldFastmem->setBaseColor(gui_baseCol);
@ -116,7 +139,7 @@ void InitPanelRAM(const struct _ConfigCategory& category)
sldFastmem->setStepLength(1);
sldFastmem->setId("Fastmem");
sldFastmem->addActionListener(memorySliderActionListener);
lblFastsize = new gcn::Label("None ");
lblFastsize = new gcn::Label("None ");
lblZ3mem = new gcn::Label("Z3 fast:");
sldZ3mem = new gcn::Slider(0, 8);
@ -126,9 +149,9 @@ void InitPanelRAM(const struct _ConfigCategory& category)
sldZ3mem->setStepLength(1);
sldZ3mem->setId("Z3mem");
sldZ3mem->addActionListener(memorySliderActionListener);
lblZ3size = new gcn::Label("None ");
lblZ3size = new gcn::Label("None ");
lblGfxmem = new gcn::Label("RTG:");
lblGfxmem = new gcn::Label("RTG board:");
sldGfxmem = new gcn::Slider(0, 5);
sldGfxmem->setSize(110, SLIDER_HEIGHT);
sldGfxmem->setBaseColor(gui_baseCol);
@ -136,39 +159,69 @@ void InitPanelRAM(const struct _ConfigCategory& category)
sldGfxmem->setStepLength(1);
sldGfxmem->setId("Gfxmem");
sldGfxmem->addActionListener(memorySliderActionListener);
lblGfxsize = new gcn::Label("None ");
lblGfxsize = new gcn::Label("None ");
lblA3000Lowmem = new gcn::Label("A4000 Motherb. slot:");
sldA3000Lowmem = new gcn::Slider(0, 2);
sldA3000Lowmem->setSize(110, SLIDER_HEIGHT);
sldA3000Lowmem->setBaseColor(gui_baseCol);
sldA3000Lowmem->setMarkerLength(20);
sldA3000Lowmem->setStepLength(1);
sldA3000Lowmem->setId("A3000Low");
sldA3000Lowmem->addActionListener(memorySliderActionListener);
lblA3000Lowsize = new gcn::Label("None ");
lblA3000Highmem = new gcn::Label("A4000 Proc. board:");
sldA3000Highmem = new gcn::Slider(0, 3);
sldA3000Highmem->setSize(110, SLIDER_HEIGHT);
sldA3000Highmem->setBaseColor(gui_baseCol);
sldA3000Highmem->setMarkerLength(20);
sldA3000Highmem->setStepLength(1);
sldA3000Highmem->setId("A3000High");
sldA3000Highmem->addActionListener(memorySliderActionListener);
lblA3000Highsize = new gcn::Label("None ");
grpRAM = new gcn::Window("Memory Settings");
grpRAM->setPosition(DISTANCE_BORDER, DISTANCE_BORDER);
int posY = 10;
grpRAM->add(lblChipmem, 8, posY);
grpRAM->add(sldChipmem, 70, posY);
grpRAM->add(lblChipsize, 70 + sldChipmem->getWidth() + 12, posY);
grpRAM->add(sldChipmem, 160, posY);
grpRAM->add(lblChipsize, 160 + sldChipmem->getWidth() + 12, posY);
posY += sldChipmem->getHeight() + DISTANCE_NEXT_Y;
grpRAM->add(lblSlowmem, 8, posY);
grpRAM->add(sldSlowmem, 70, posY);
grpRAM->add(lblSlowsize, 70 + sldSlowmem->getWidth() + 12, posY);
grpRAM->add(sldSlowmem, 160, posY);
grpRAM->add(lblSlowsize, 160 + sldSlowmem->getWidth() + 12, posY);
posY += sldSlowmem->getHeight() + DISTANCE_NEXT_Y;
grpRAM->add(lblFastmem, 8, posY);
grpRAM->add(sldFastmem, 70, posY);
grpRAM->add(lblFastsize, 70 + sldFastmem->getWidth() + 12, posY);
grpRAM->add(sldFastmem, 160, posY);
grpRAM->add(lblFastsize, 160 + sldFastmem->getWidth() + 12, posY);
posY += sldFastmem->getHeight() + DISTANCE_NEXT_Y;
grpRAM->add(lblZ3mem, 8, posY);
grpRAM->add(sldZ3mem, 70, posY);
grpRAM->add(lblZ3size, 70 + sldZ3mem->getWidth() + 12, posY);
grpRAM->add(sldZ3mem, 160, posY);
grpRAM->add(lblZ3size, 160 + sldZ3mem->getWidth() + 12, posY);
posY += sldZ3mem->getHeight() + DISTANCE_NEXT_Y;
#ifdef PICASSO96
grpRAM->add(lblGfxmem, 8, posY);
grpRAM->add(sldGfxmem, 70, posY);
grpRAM->add(lblGfxsize, 70 + sldGfxmem->getWidth() + 12, posY);
grpRAM->add(sldGfxmem, 160, posY);
grpRAM->add(lblGfxsize, 160 + sldGfxmem->getWidth() + 12, posY);
posY += sldGfxmem->getHeight() + DISTANCE_NEXT_Y;
#endif
grpRAM->add(lblA3000Lowmem, 8, posY);
grpRAM->add(sldA3000Lowmem, 160, posY);
grpRAM->add(lblA3000Lowsize, 160 + sldA3000Lowmem->getWidth() + 12, posY);
posY += sldA3000Lowmem->getHeight() + DISTANCE_NEXT_Y;
grpRAM->add(lblA3000Highmem, 8, posY);
grpRAM->add(sldA3000Highmem, 160, posY);
grpRAM->add(lblA3000Highsize, 160 + sldA3000Highmem->getWidth() + 12, posY);
posY += sldA3000Highmem->getHeight() + DISTANCE_NEXT_Y;
grpRAM->setMovable(false);
grpRAM->setSize(250, posY + DISTANCE_BORDER);
grpRAM->setSize(350, posY + DISTANCE_BORDER);
grpRAM->setBaseColor(gui_baseCol);
category.panel->add(grpRAM);
@ -194,6 +247,12 @@ void ExitPanelRAM()
delete lblGfxmem;
delete sldGfxmem;
delete lblGfxsize;
delete lblA3000Lowmem;
delete sldA3000Lowmem;
delete lblA3000Lowsize;
delete lblA3000Highmem;
delete sldA3000Highmem;
delete lblA3000Highsize;
delete grpRAM;
delete memorySliderActionListener;
}
@ -223,9 +282,9 @@ void RefreshPanelRAM()
}
}
for (i = 0; i < 5; ++i)
for (i = 0; i<5; ++i)
{
if (changed_prefs.fastmem_size == FastMem_values[i])
if (changed_prefs.fastmem[0].size == FastMem_values[i])
{
sldFastmem->setValue(i);
lblFastsize->setCaption(FastMem_list[i]);
@ -233,9 +292,9 @@ void RefreshPanelRAM()
}
}
for (i = 0; i < 9; ++i)
for (i = 0; i<9; ++i)
{
if (changed_prefs.z3fastmem_size == FastMem_values[i])
if (changed_prefs.z3fastmem[0].size == FastMem_values[i])
{
sldZ3mem->setValue(i);
lblZ3size->setCaption(FastMem_list[i]);
@ -244,9 +303,9 @@ void RefreshPanelRAM()
}
sldZ3mem->setEnabled(!changed_prefs.address_space_24);
for (i = 0; i < 6; ++i)
for (i = 0; i<6; ++i)
{
if (changed_prefs.rtgmem_size == FastMem_values[i])
if (changed_prefs.rtgboards[0].rtgmem_size == FastMem_values[i])
{
sldGfxmem->setValue(i);
lblGfxsize->setCaption(FastMem_list[i]);
@ -254,4 +313,39 @@ void RefreshPanelRAM()
}
}
sldGfxmem->setEnabled(!changed_prefs.address_space_24);
for (i = 0; i<3; ++i)
{
if (changed_prefs.mbresmem_low_size == A3000LowMem_values[i])
{
sldA3000Lowmem->setValue(i);
lblA3000Lowsize->setCaption(A3000LowMem_list[i]);
break;
}
}
for (i = 0; i<4; ++i)
{
if (changed_prefs.mbresmem_high_size == A3000HighMem_values[i])
{
sldA3000Highmem->setValue(i);
lblA3000Highsize->setCaption(A3000HighMem_list[i]);
break;
}
}
}
bool HelpPanelRAM(std::vector<std::string> &helptext)
{
helptext.clear();
helptext.push_back("Select the amount of RAM for each type you want to emulate in your Amiga.");
helptext.push_back("\"Slow\" is the simple memory extension of an Amiga 500.");
helptext.push_back("\"Z2 Fast\" is real fast memory in 24 bit address space.");
helptext.push_back("\"Z3 Fast\" is real fast memory in 32 bit address space and only available if a 32 bit CPU is selected.");
helptext.push_back("\"RTG board\" is the graphics memory used by Picasso96 and only available if a 32 bit CPU is selected. If you");
helptext.push_back("select some memory for this type, the Z3 RTG board will be activated.");
helptext.push_back("A4000 motherboard and processor board memory is only detected by the Amiga if you choose the correct");
helptext.push_back("Kickstart ROM (A4000).");
return true;
}

View file

@ -20,6 +20,11 @@ static gcn::Button* cmdMainROM;
static gcn::Label* lblExtROM;
static gcn::UaeDropDown* cboExtROM;
static gcn::Button* cmdExtROM;
#ifdef ACTION_REPLAY
static gcn::Label *lblCartROM;
static gcn::UaeDropDown* cboCartROM;
static gcn::Button *cmdCartROM;
#endif
class ROMListModel : public gcn::ListModel
{
@ -57,12 +62,14 @@ public:
roms.clear();
idxToAvailableROMs.clear();
int currIdx = -1;
if (ROMType & (ROMTYPE_EXTCDTV | ROMTYPE_EXTCD32))
{
roms.push_back("");
idxToAvailableROMs.push_back(-1);
currIdx = 0;
}
int currIdx = -1;
for (int i = 0; i < lstAvailableROMs.size(); ++i)
{
if (lstAvailableROMs[i]->ROMType & ROMType)
@ -79,7 +86,9 @@ public:
static ROMListModel* mainROMList;
static ROMListModel* extROMList;
#ifdef ACTION_REPLAY
static ROMListModel *cartROMList;
#endif
class MainROMActionListener : public gcn::ActionListener
{
@ -110,6 +119,21 @@ public:
static ExtROMActionListener* extROMActionListener;
#ifdef ACTION_REPLAY
class CartROMActionListener : public gcn::ActionListener
{
public:
void action(const gcn::ActionEvent& actionEvent) override
{
AvailableROM* rom = cartROMList->getROMat(cboCartROM->getSelected());
if (rom != nullptr)
strcpy(changed_prefs.cartfile, rom->Path);
else
strcpy(changed_prefs.cartfile, "");
}
};
static CartROMActionListener* cartROMActionListener;
#endif
class ROMButtonActionListener : public gcn::ActionListener
{
@ -124,8 +148,7 @@ public:
strcpy(tmp, currentDir);
if (SelectFile("Select System ROM", tmp, filter))
{
AvailableROM* newrom;
newrom = new AvailableROM();
AvailableROM * newrom = new AvailableROM();
extractFileName(tmp, newrom->Name);
removeFileExtension(newrom->Name);
strcpy(newrom->Path, tmp);
@ -141,8 +164,7 @@ public:
strcpy(tmp, currentDir);
if (SelectFile("Select Extended ROM", tmp, filter))
{
AvailableROM* newrom;
newrom = new AvailableROM();
AvailableROM * newrom = new AvailableROM();
extractFileName(tmp, newrom->Name);
removeFileExtension(newrom->Name);
strcpy(newrom->Path, tmp);
@ -153,6 +175,24 @@ public:
}
cmdExtROM->requestFocus();
}
#ifdef ACTION_REPLAY
else if (actionEvent.getSource() == cmdCartROM)
{
strncpy(tmp, currentDir, MAX_PATH);
if (SelectFile("Select Cartridge ROM", tmp, filter))
{
AvailableROM *newrom = new AvailableROM();
extractFileName(tmp, newrom->Name);
removeFileExtension(newrom->Name);
strcpy(newrom->Path, tmp);
newrom->ROMType = ROMTYPE_CD32CART;
lstAvailableROMs.push_back(newrom);
strcpy(changed_prefs.romextfile, tmp);
RefreshPanelROM();
}
cmdCartROM->requestFocus();
}
#endif
}
};
@ -165,9 +205,15 @@ void InitPanelROM(const struct _ConfigCategory& category)
mainROMActionListener = new MainROMActionListener();
extROMActionListener = new ExtROMActionListener();
#ifdef ACTION_REPLAY
cartROMActionListener = new CartROMActionListener();
#endif
romButtonActionListener = new ROMButtonActionListener();
mainROMList = new ROMListModel(ROMTYPE_KICK | ROMTYPE_KICKCD32);
extROMList = new ROMListModel(ROMTYPE_EXTCDTV | ROMTYPE_EXTCD32);
#ifdef ACTION_REPLAY
cartROMList = new ROMListModel(ROMTYPE_ALL_CART);
#endif
lblMainROM = new gcn::Label("Main ROM File:");
lblMainROM->setSize(120, LABEL_HEIGHT);
@ -197,6 +243,21 @@ void InitPanelROM(const struct _ConfigCategory& category)
cmdExtROM->setBaseColor(gui_baseCol);
cmdExtROM->addActionListener(romButtonActionListener);
#ifdef ACTION_REPLAY
lblCartROM = new gcn::Label("Cardridge ROM File:");
lblCartROM->setSize(200, LABEL_HEIGHT);
cboCartROM = new gcn::UaeDropDown(cartROMList);
cboCartROM->setSize(400, DROPDOWN_HEIGHT);
cboCartROM->setBaseColor(gui_baseCol);
cboCartROM->setId("cboCartROM");
cboCartROM->addActionListener(cartROMActionListener);
cmdCartROM = new gcn::Button("...");
cmdCartROM->setId("CartROM");
cmdCartROM->setSize(SMALL_BUTTON_WIDTH, SMALL_BUTTON_HEIGHT);
cmdCartROM->setBaseColor(gui_baseCol);
cmdCartROM->addActionListener(romButtonActionListener);
#endif
int posY = DISTANCE_BORDER;
category.panel->add(lblMainROM, DISTANCE_BORDER, posY);
posY += lblMainROM->getHeight() + 4;
@ -210,6 +271,14 @@ void InitPanelROM(const struct _ConfigCategory& category)
category.panel->add(cmdExtROM, DISTANCE_BORDER + cboExtROM->getWidth() + DISTANCE_NEXT_X, posY);
posY += cboExtROM->getHeight() + DISTANCE_NEXT_Y;
#ifdef ACTION_REPLAY
category.panel->add(lblCartROM, DISTANCE_BORDER, posY);
posY += lblCartROM->getHeight() + 4;
category.panel->add(cboCartROM, DISTANCE_BORDER, posY);
category.panel->add(cmdCartROM, DISTANCE_BORDER + cboCartROM->getWidth() + DISTANCE_NEXT_X, posY);
posY += cboCartROM->getHeight() + DISTANCE_NEXT_Y;
#endif
RefreshPanelROM();
}
@ -228,6 +297,14 @@ void ExitPanelROM()
delete extROMList;
delete extROMActionListener;
#ifdef ACTION_REPLAY
delete lblCartROM;
delete cboCartROM;
delete cmdCartROM;
delete cartROMList;
delete cartROMActionListener;
#endif
delete romButtonActionListener;
// delete chkMapROM;
}
@ -240,4 +317,21 @@ void RefreshPanelROM()
idx = extROMList->InitROMList(changed_prefs.romextfile);
cboExtROM->setSelected(idx);
#ifdef ACTION_REPLAY
idx = cartROMList->InitROMList(changed_prefs.cartfile);
cboCartROM->setSelected(idx);
#endif
}
bool HelpPanelROM(std::vector<std::string> &helptext)
{
helptext.clear();
helptext.push_back("Select the required kickstart ROM for the Amiga you want to emulate in \"Main ROM File\".");
helptext.push_back("");
helptext.push_back("In \"Extended ROM File\", you can only select the required ROM for CD32 emulation.");
helptext.push_back("");
helptext.push_back("In \"Cartridge ROM File\", you can select the CD32 FMV module to activate video playback in CD32.");
helptext.push_back("There are also some Action Replay and Freezer cards and the built in HRTMon available.");
return true;
}

View file

@ -241,3 +241,12 @@ void RefreshPanelSavestate()
cmdSaveState->setEnabled(enabled);
lblWarningHDDon->setVisible(!enabled);
}
bool HelpPanelSavestate(std::vector<std::string> &helptext)
{
helptext.clear();
helptext.push_back("Savestates are stored with the name of the disk in drive DF0 attached with the selected number.");
helptext.push_back("");
helptext.push_back("Note: Savestates will not work with HDDs.");
return true;
}

View file

@ -459,3 +459,19 @@ void RefreshPanelSound()
lblStereoDelayInfo->setCaption(tmp);
}
}
bool HelpPanelSound(std::vector<std::string> &helptext)
{
helptext.clear();
helptext.push_back("You can turn on sound emulation with different levels of accuracy and choose between mono and stereo.");
helptext.push_back("");
helptext.push_back("The different types of interpolation have different impact on the performance. Play with the settings to find the");
helptext.push_back("type you like most. You may need headphones to really hear the differences between the interpolations.");
helptext.push_back("");
helptext.push_back("With \"Filter\", you can select the type of the Amiga audio filter.");
helptext.push_back("");
helptext.push_back("With \"Stereo separation\" and \"Stereo delay\", you can adjust how the left and right audio channels of the Amiga");
helptext.push_back("are mixed to the left and right channels of your device. A value of 70% for separation and no delay is a good");
helptext.push_back("start.");
return true;
}

View file

@ -278,6 +278,8 @@ static void ExitSelectFile()
static void SelectFileLoop()
{
FocusBugWorkaround(wndSelectFile);
while (!dialogFinished)
{
SDL_Event event;

View file

@ -191,6 +191,8 @@ static void ExitSelectFolder()
static void SelectFolderLoop()
{
FocusBugWorkaround(wndSelectFolder);
while (!dialogFinished)
{
SDL_Event event;

179
src/osdep/gui/ShowHelp.cpp Normal file
View file

@ -0,0 +1,179 @@
#include <algorithm>
#include <guisan.hpp>
#include <iostream>
#include <sstream>
#include <SDL_ttf.h>
#include <guisan/sdl.hpp>
#include "guisan/sdl/sdltruetypefont.hpp"
#include "SelectorEntry.hpp"
#include "sysconfig.h"
#include "sysdeps.h"
#include "config.h"
#include "gui.h"
#include "gui_handling.h"
#define DIALOG_WIDTH 760
#define DIALOG_HEIGHT 420
static bool dialogFinished = false;
static gcn::Window *wndShowHelp;
static gcn::Button* cmdOK;
static gcn::ListBox* lstHelp;
static gcn::ScrollArea* scrAreaHelp;
class HelpListModel : public gcn::ListModel
{
std::vector<std::string> lines;
public:
HelpListModel(std::vector<std::string> helptext)
{
lines = helptext;
}
int getNumberOfElements() override
{
return lines.size();
}
std::string getElementAt(int i) override
{
if (i >= 0 && i < lines.size())
return lines[i];
return "";
}
};
static HelpListModel *helpList;
class ShowHelpActionListener : public gcn::ActionListener
{
public:
void action(const gcn::ActionEvent& actionEvent) override
{
dialogFinished = true;
}
};
static ShowHelpActionListener* showHelpActionListener;
static void InitShowHelp(const std::vector<std::string>& helptext)
{
wndShowHelp = new gcn::Window("Help");
wndShowHelp->setSize(DIALOG_WIDTH, DIALOG_HEIGHT);
wndShowHelp->setPosition((GUI_WIDTH - DIALOG_WIDTH) / 2, (GUI_HEIGHT - DIALOG_HEIGHT) / 2);
wndShowHelp->setBaseColor(gui_baseCol);
wndShowHelp->setTitleBarHeight(TITLEBAR_HEIGHT);
showHelpActionListener = new ShowHelpActionListener();
helpList = new HelpListModel(helptext);
lstHelp = new gcn::ListBox(helpList);
lstHelp->setSize(DIALOG_WIDTH - 2 * DISTANCE_BORDER - 4, DIALOG_HEIGHT - 3 * DISTANCE_BORDER - BUTTON_HEIGHT - DISTANCE_NEXT_Y - 10);
lstHelp->setPosition(DISTANCE_BORDER, DISTANCE_BORDER);
lstHelp->setBaseColor(gui_baseCol + 0x202020);
lstHelp->setBackgroundColor(gui_baseCol);
lstHelp->setWrappingEnabled(true);
scrAreaHelp = new gcn::ScrollArea(lstHelp);
scrAreaHelp->setBorderSize(1);
scrAreaHelp->setPosition(DISTANCE_BORDER, 10 + TEXTFIELD_HEIGHT + 10);
scrAreaHelp->setSize(DIALOG_WIDTH - 2 * DISTANCE_BORDER - 4, DIALOG_HEIGHT - 3 * DISTANCE_BORDER - BUTTON_HEIGHT - DISTANCE_NEXT_Y - 10);
scrAreaHelp->setScrollbarWidth(20);
scrAreaHelp->setBaseColor(gui_baseCol + 0x202020);
scrAreaHelp->setBackgroundColor(gui_baseCol);
cmdOK = new gcn::Button("Ok");
cmdOK->setSize(BUTTON_WIDTH, BUTTON_HEIGHT);
cmdOK->setPosition(DIALOG_WIDTH - DISTANCE_BORDER - BUTTON_WIDTH, DIALOG_HEIGHT - 2 * DISTANCE_BORDER - BUTTON_HEIGHT - 10);
cmdOK->setBaseColor(gui_baseCol);
cmdOK->addActionListener(showHelpActionListener);
wndShowHelp->add(scrAreaHelp, DISTANCE_BORDER, DISTANCE_BORDER);
wndShowHelp->add(cmdOK);
gui_top->add(wndShowHelp);
cmdOK->requestFocus();
wndShowHelp->requestModalFocus();
}
static void ExitShowHelp(void)
{
wndShowHelp->releaseModalFocus();
gui_top->remove(wndShowHelp);
delete lstHelp;
delete scrAreaHelp;
delete cmdOK;
delete helpList;
delete showHelpActionListener;
delete wndShowHelp;
}
static void ShowHelpLoop(void)
{
FocusBugWorkaround(wndShowHelp);
while (!dialogFinished)
{
SDL_Event event;
while (SDL_PollEvent(&event))
{
if (event.type == SDL_KEYDOWN)
{
switch (event.key.keysym.scancode)
{
case VK_ESCAPE:
dialogFinished = true;
break;
case VK_Red:
case VK_Green:
case SDL_SCANCODE_RETURN:
event.key.keysym.scancode = SDL_SCANCODE_RETURN;
gui_input->pushInput(event); // Fire key down
event.type = SDL_KEYUP; // and the key up
break;
default:
break;
}
}
//-------------------------------------------------
// Send event to guisan-controls
//-------------------------------------------------
gui_input->pushInput(event);
}
// Now we let the Gui object perform its logic.
uae_gui->logic();
// Now we let the Gui object draw itself.
uae_gui->draw();
// Finally we update the screen.
UpdateGuiScreen();
}
}
void ShowHelp(const char *title, const std::vector<std::string>& text)
{
dialogFinished = false;
InitShowHelp(text);
wndShowHelp->setCaption(title);
cmdOK->setCaption("Ok");
ShowHelpLoop();
ExitShowHelp();
}

View file

@ -98,6 +98,8 @@ static void ExitShowMessage()
static void ShowMessageWaitInputLoop()
{
FocusBugWorkaround(wndShowMessage);
while (!dialogFinished)
{
SDL_Event event;
@ -143,6 +145,8 @@ static void ShowMessageWaitInputLoop()
static void ShowMessageLoop()
{
FocusBugWorkaround(wndShowMessage);
while (!dialogFinished)
{
SDL_Event event;
@ -214,6 +218,7 @@ bool ShowMessage(const char* title, const char* line1, const char* line2, const
cmdCancel->setVisible(false);
cmdOK->setPosition(cmdCancel->getX(), cmdCancel->getY());
}
cmdOK->setEnabled(true);
ShowMessageLoop();
ExitShowMessage();

View file

@ -28,6 +28,7 @@ typedef struct _ConfigCategory
void (*InitFunc)(const struct _ConfigCategory& category);
void (*ExitFunc)(void);
void (*RefreshFunc)(void);
bool(*HelpFunc) (std::vector<std::string>&);
} ConfigCategory;
extern bool gui_running;
@ -42,10 +43,9 @@ extern SDL_Surface* gui_screen;
extern char currentDir[MAX_DPATH];
extern char last_loaded_config[MAX_DPATH];
#define BUILTINID_NONE 0
#define BUILTINID_A500 1
#define BUILTINID_A1200 2
#define BUILTINID_CD32 3
extern int quickstart_start;
extern int quickstart_model;
extern int quickstart_conf;
typedef struct
{
@ -60,45 +60,77 @@ extern vector<ConfigFileInfo*> ConfigFilesList;
void InitPanelPaths(const struct _ConfigCategory& category);
void ExitPanelPaths(void);
void RefreshPanelPaths(void);
bool HelpPanelPaths(std::vector<std::string> &helptext);
void InitPanelQuickstart(const struct _ConfigCategory& category);
void ExitPanelQuickstart(void);
void RefreshPanelQuickstart(void);
bool HelpPanelQuickstart(std::vector<std::string> &helptext);
void InitPanelConfig(const struct _ConfigCategory& category);
void ExitPanelConfig(void);
void RefreshPanelConfig(void);
bool HelpPanelConfig(std::vector<std::string> &helptext);
void InitPanelCPU(const struct _ConfigCategory& category);
void ExitPanelCPU(void);
void RefreshPanelCPU(void);
bool HelpPanelCPU(std::vector<std::string> &helptext);
void InitPanelChipset(const struct _ConfigCategory& category);
void ExitPanelChipset(void);
void RefreshPanelChipset(void);
bool HelpPanelChipset(std::vector<std::string> &helptext);
void InitPanelROM(const struct _ConfigCategory& category);
void ExitPanelROM(void);
void RefreshPanelROM(void);
bool HelpPanelROM(std::vector<std::string> &helptext);
void InitPanelRAM(const struct _ConfigCategory& category);
void ExitPanelRAM(void);
void RefreshPanelRAM(void);
bool HelpPanelRAM(std::vector<std::string> &helptext);
void InitPanelFloppy(const struct _ConfigCategory& category);
void ExitPanelFloppy(void);
void RefreshPanelFloppy(void);
bool HelpPanelFloppy(std::vector<std::string> &helptext);
void InitPanelHD(const struct _ConfigCategory& category);
void ExitPanelHD(void);
void RefreshPanelHD(void);
bool HelpPanelHD(std::vector<std::string> &helptext);
void InitPanelDisplay(const struct _ConfigCategory& category);
void ExitPanelDisplay(void);
void RefreshPanelDisplay(void);
bool HelpPanelDisplay(std::vector<std::string> &helptext);
void InitPanelSound(const struct _ConfigCategory& category);
void ExitPanelSound(void);
void RefreshPanelSound(void);
bool HelpPanelSound(std::vector<std::string> &helptext);
void InitPanelInput(const struct _ConfigCategory& category);
void ExitPanelInput(void);
void RefreshPanelInput(void);
bool HelpPanelInput(std::vector<std::string> &helptext);
void InitPanelMisc(const struct _ConfigCategory& category);
void ExitPanelMisc(void);
void RefreshPanelMisc(void);
bool HelpPanelMisc(std::vector<std::string> &helptext);
void InitPanelSavestate(const struct _ConfigCategory& category);
void ExitPanelSavestate(void);
void RefreshPanelSavestate(void);
bool HelpPanelSavestate(std::vector<std::string> &helptext);
void RefreshAllPanels(void);
void RegisterRefreshFunc(void (*func)(void));
void RegisterRefreshFunc(void(*func)(void));
void FocusBugWorkaround(gcn::Window *wnd);
void DisableResume(void);
@ -109,6 +141,7 @@ bool SelectFile(const char* title, char* value, const char* filter[], bool creat
bool EditFilesysVirtual(int unit_no);
bool EditFilesysHardfile(int unit_no);
bool CreateFilesysHardfile(void);
void ShowHelp(const char *title, const std::vector<std::string>& text);
bool LoadConfigByName(const char* name);
ConfigFileInfo* SearchConfigInList(const char* name);

View file

@ -13,68 +13,68 @@
#include "gui.h"
#include "gui_handling.h"
#include "amiberry_gfx.h"
#include "autoconf.h"
bool gui_running = false;
static int last_active_panel = 1;
static int last_active_panel = 2;
#define MAX_STARTUP_TITLE 64
#define MAX_STARTUP_MESSAGE 256
static TCHAR startup_title[MAX_STARTUP_TITLE] = _T("");
static TCHAR startup_message[MAX_STARTUP_MESSAGE] = _T("");
ConfigCategory categories[] =
void target_startup_msg(TCHAR* title, TCHAR* msg)
{
{"Paths", "data/paths.ico", nullptr, nullptr, InitPanelPaths, ExitPanelPaths, RefreshPanelPaths},
{"Configurations", "data/file.ico", nullptr, nullptr, InitPanelConfig, ExitPanelConfig, RefreshPanelConfig},
{"CPU and FPU", "data/cpu.ico", nullptr, nullptr, InitPanelCPU, ExitPanelCPU, RefreshPanelCPU},
{"Chipset", "data/cpu.ico", nullptr, nullptr, InitPanelChipset, ExitPanelChipset, RefreshPanelChipset},
{"ROM", "data/chip.ico", nullptr, nullptr, InitPanelROM, ExitPanelROM, RefreshPanelROM},
{"RAM", "data/chip.ico", nullptr, nullptr, InitPanelRAM, ExitPanelRAM, RefreshPanelRAM},
{"Floppy drives", "data/35floppy.ico", nullptr, nullptr, InitPanelFloppy, ExitPanelFloppy, RefreshPanelFloppy},
{"Hard drives/CD", "data/drive.ico", nullptr, nullptr, InitPanelHD, ExitPanelHD, RefreshPanelHD},
{"Display", "data/screen.ico", nullptr, nullptr, InitPanelDisplay, ExitPanelDisplay, RefreshPanelDisplay},
{"Sound", "data/sound.ico", nullptr, nullptr, InitPanelSound, ExitPanelSound, RefreshPanelSound},
{"Input", "data/joystick.ico", nullptr, nullptr, InitPanelInput, ExitPanelInput, RefreshPanelInput},
{"Miscellaneous", "data/misc.ico", nullptr, nullptr, InitPanelMisc, ExitPanelMisc, RefreshPanelMisc},
{"Savestates", "data/savestate.png", nullptr, nullptr, InitPanelSavestate, ExitPanelSavestate, RefreshPanelSavestate},
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}
_tcsncpy(startup_title, title, MAX_STARTUP_TITLE);
_tcsncpy(startup_message, msg, MAX_STARTUP_MESSAGE);
}
ConfigCategory categories[] = {
{ "Paths", "data/paths.ico", nullptr, nullptr, InitPanelPaths, ExitPanelPaths, RefreshPanelPaths, HelpPanelPaths },
{ "Quickstart", "data/quickstart.ico", nullptr, nullptr, InitPanelQuickstart, ExitPanelQuickstart, RefreshPanelQuickstart, HelpPanelQuickstart },
{ "Configurations", "data/file.ico", nullptr, nullptr, InitPanelConfig, ExitPanelConfig, RefreshPanelConfig, HelpPanelConfig },
{ "CPU and FPU", "data/cpu.ico", nullptr, nullptr, InitPanelCPU, ExitPanelCPU, RefreshPanelCPU, HelpPanelCPU },
{ "Chipset", "data/cpu.ico", nullptr, nullptr, InitPanelChipset, ExitPanelChipset, RefreshPanelChipset, HelpPanelChipset },
{ "ROM", "data/chip.ico", nullptr, nullptr, InitPanelROM, ExitPanelROM, RefreshPanelROM, HelpPanelROM },
{ "RAM", "data/chip.ico", nullptr, nullptr, InitPanelRAM, ExitPanelRAM, RefreshPanelRAM, HelpPanelRAM },
{ "Floppy drives", "data/35floppy.ico", nullptr, nullptr, InitPanelFloppy, ExitPanelFloppy, RefreshPanelFloppy, HelpPanelFloppy },
{ "Hard drives/CD", "data/drive.ico", nullptr, nullptr, InitPanelHD, ExitPanelHD, RefreshPanelHD, HelpPanelHD },
{ "Display", "data/screen.ico", nullptr, nullptr, InitPanelDisplay, ExitPanelDisplay, RefreshPanelDisplay, HelpPanelDisplay },
{ "Sound", "data/sound.ico", nullptr, nullptr, InitPanelSound, ExitPanelSound, RefreshPanelSound, HelpPanelSound },
{ "Input", "data/joystick.ico", nullptr, nullptr, InitPanelInput, ExitPanelInput, RefreshPanelInput, HelpPanelInput },
{ "Miscellaneous", "data/misc.ico", nullptr, nullptr, InitPanelMisc, ExitPanelMisc, RefreshPanelMisc, HelpPanelMisc },
{ "Savestates", "data/savestate.png", nullptr, nullptr, InitPanelSavestate, ExitPanelSavestate, RefreshPanelSavestate, HelpPanelSavestate },
{ nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }
};
enum
{
PANEL_PATHS,
PANEL_CONFIGURATIONS,
PANEL_CPU,
PANEL_CHIPSET,
PANEL_ROM,
PANEL_RAM,
PANEL_FLOPPY,
PANEL_HD,
PANEL_DISPLAY,
PANEL_SOUND,
PANEL_INPUT,
PANEL_MISC,
PANEL_SAVESTATES,
enum {
PANEL_PATHS, PANEL_QUICKSTART, PANEL_CONFIGURATIONS, PANEL_CPU, PANEL_CHIPSET, PANEL_ROM, PANEL_RAM,
PANEL_FLOPPY, PANEL_HD, PANEL_DISPLAY, PANEL_SOUND, PANEL_INPUT, PANEL_MISC, PANEL_SAVESTATES,
NUM_PANELS
};
/*
* SDL Stuff we need
*/
* SDL Stuff we need
*/
SDL_Surface* gui_screen;
SDL_Texture* gui_texture;
SDL_Event gui_event;
SDL_Cursor* cursor;
SDL_Surface *cursorSurface;
SDL_Surface* cursorSurface;
/*
* Guisan SDL stuff we need
*/
* Guisan SDL stuff we need
*/
gcn::SDLInput* gui_input;
gcn::SDLGraphics* gui_graphics;
gcn::SDLImageLoader* gui_imageLoader;
gcn::SDLTrueTypeFont* gui_font;
/*
* Guisan stuff we need
*/
* Guisan stuff we need
*/
gcn::Gui* uae_gui;
gcn::Container* gui_top;
gcn::Container* selectors;
@ -91,18 +91,19 @@ namespace widgets
gcn::Button* cmdRestart;
gcn::Button* cmdStart;
gcn::Button* cmdShutdown;
gcn::Button* cmdHelp;
}
/* Flag for changes in rtarea:
Bit 0: any HD in config?
Bit 1: force because add/remove HD was clicked
Bit 2: socket_emu on
Bit 3: mousehack on
Bit 4: rtgmem on
Bit 5: chipmem larger than 2MB
Bit 0: any HD in config?
Bit 1: force because add/remove HD was clicked
Bit 2: socket_emu on
Bit 3: mousehack on
Bit 4: rtgmem on
Bit 5: chipmem larger than 2MB
gui_rtarea_flags_onenter is set before GUI is shown, bit 1 may change during GUI display.
gui_rtarea_flags_onenter is set before GUI is shown, bit 1 may change during GUI display.
*/
static int gui_rtarea_flags_onenter;
@ -119,7 +120,7 @@ static int gui_create_rtarea_flag(struct uae_prefs* p)
if (p->input_tablet > 0)
flag |= 8;
if (p->rtgmem_size)
if (p->rtgboards[0].rtgmem_size)
flag |= 16;
if (p->chipmem_size > 2 * 1024 * 1024)
@ -133,6 +134,11 @@ void gui_force_rtarea_hdchange()
gui_rtarea_flags_onenter |= 2;
}
void gui_restart()
{
gui_running = false;
}
static void (*refreshFuncAfterDraw)() = nullptr;
void RegisterRefreshFunc(void (*func)())
@ -140,6 +146,35 @@ void RegisterRefreshFunc(void (*func)())
refreshFuncAfterDraw = func;
}
void FocusBugWorkaround(gcn::Window *wnd)
{
// When modal dialog opens via mouse, the dialog will not
// have the focus unless there is a mouse click. We simulate the click...
SDL_Event event;
event.type = SDL_MOUSEBUTTONDOWN;
event.button.button = SDL_BUTTON_LEFT;
event.button.state = SDL_PRESSED;
event.button.x = wnd->getX() + 2;
event.button.y = wnd->getY() + 2;
gui_input->pushInput(event);
event.type = SDL_MOUSEBUTTONUP;
gui_input->pushInput(event);
}
static void ShowHelpRequested()
{
std::vector<std::string> helptext;
if (categories[last_active_panel].HelpFunc != nullptr && categories[last_active_panel].HelpFunc(helptext))
{
//------------------------------------------------
// Show help for current panel
//------------------------------------------------
char title[128];
snprintf(title, 128, "Help for %s", categories[last_active_panel].category);
ShowHelp(title, helptext);
}
}
void UpdateGuiScreen()
{
// Update the texture from the surface
@ -209,10 +244,11 @@ namespace sdl
delete gui_imageLoader;
delete gui_input;
delete gui_graphics;
SDL_FreeSurface(gui_screen);
SDL_DestroyTexture(gui_texture);
if (cursor) {
if (cursor)
{
SDL_FreeCursor(cursor);
}
gui_screen = nullptr;
@ -295,7 +331,7 @@ namespace sdl
if (HandleNavigation(DIRECTION_RIGHT))
continue; // Don't change value when enter Slider -> don't send event to control
break;
default:
default:
break;
}
}
@ -510,6 +546,12 @@ namespace widgets
cmdStart->setId("Start");
cmdStart->addActionListener(mainButtonActionListener);
cmdHelp = new gcn::Button("Help");
cmdHelp->setSize(BUTTON_WIDTH, BUTTON_HEIGHT);
cmdHelp->setBaseColor(gui_baseCol);
cmdHelp->setId("Help");
cmdHelp->addActionListener(mainButtonActionListener);
//--------------------------------------------------
// Create selector entries
//--------------------------------------------------
@ -552,6 +594,7 @@ namespace widgets
gui_top->add(cmdReset, DISTANCE_BORDER, GUI_HEIGHT - DISTANCE_BORDER - BUTTON_HEIGHT);
gui_top->add(cmdQuit, DISTANCE_BORDER + BUTTON_WIDTH + DISTANCE_NEXT_X, GUI_HEIGHT - DISTANCE_BORDER - BUTTON_HEIGHT);
gui_top->add(cmdShutdown, DISTANCE_BORDER + 2 * BUTTON_WIDTH + 2 * DISTANCE_NEXT_X, GUI_HEIGHT - DISTANCE_BORDER - BUTTON_HEIGHT);
gui_top->add(cmdHelp, DISTANCE_BORDER + 3 * BUTTON_WIDTH + 3 * DISTANCE_NEXT_X, GUI_HEIGHT - DISTANCE_BORDER - BUTTON_HEIGHT);
gui_top->add(cmdStart, GUI_WIDTH - DISTANCE_BORDER - BUTTON_WIDTH, GUI_HEIGHT - DISTANCE_BORDER - BUTTON_HEIGHT);
gui_top->add(selectors, DISTANCE_BORDER + 1, DISTANCE_BORDER + 1);
@ -564,7 +607,10 @@ namespace widgets
//--------------------------------------------------
// Activate last active panel
//--------------------------------------------------
if (!emulating && quickstart_start)
last_active_panel = 1;
categories[last_active_panel].selector->requestFocus();
cmdHelp->setVisible(categories[last_active_panel].HelpFunc != nullptr);
}
@ -588,6 +634,7 @@ namespace widgets
delete cmdReset;
delete cmdRestart;
delete cmdStart;
delete cmdHelp;
delete mainButtonActionListener;
@ -626,40 +673,59 @@ void run_gui()
gui_running = true;
gui_rtarea_flags_onenter = gui_create_rtarea_flag(&currprefs);
expansion_generate_autoconfig_info(&changed_prefs);
try
{
sdl::gui_init();
widgets::gui_init();
if (_tcslen(startup_message) > 0) {
ShowMessage(startup_title, startup_message, _T(""), _T("Ok"), _T(""));
_tcscpy(startup_title, _T(""));
_tcscpy(startup_message, _T(""));
widgets::cmdStart->requestFocus();
}
sdl::gui_run();
widgets::gui_halt();
sdl::gui_halt();
}
// Catch all guisan exceptions.
catch (gcn::Exception e)
{
cout << e.getMessage() << endl;
uae_quit();
}
// Catch all Std exceptions.
catch (exception e)
{
cout << "Std exception: " << e.what() << endl;
uae_quit();
}
// Catch all unknown exceptions.
catch (...)
{
cout << "Unknown exception" << endl;
uae_quit();
}
expansion_generate_autoconfig_info(&changed_prefs);
cfgfile_compatibility_romtype(&changed_prefs);
if (quit_program > UAE_QUIT || quit_program < -UAE_QUIT)
{
//--------------------------------------------------
// Prepare everything for Reset of Amiga
//--------------------------------------------------
currprefs.nr_floppies = changed_prefs.nr_floppies;
screen_is_picasso = 0;
if (gui_rtarea_flags_onenter != gui_create_rtarea_flag(&changed_prefs))
quit_program = -UAE_RESET_HARD; // Hardreset required...
}
// Reset counter for access violations
init_max_signals();
}