Align with latest TomB version 1.0.0
This commit is contained in:
parent
3f743e49be
commit
c5610e7acd
103 changed files with 66138 additions and 15463 deletions
311
src/od-pandora/gui/CreateFilesysHardfile.cpp
Normal file
311
src/od-pandora/gui/CreateFilesysHardfile.cpp
Normal file
|
@ -0,0 +1,311 @@
|
|||
#include <guichan.hpp>
|
||||
#include <SDL/SDL_ttf.h>
|
||||
#include <guichan/sdl.hpp>
|
||||
#include "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 "uae.h"
|
||||
#include "autoconf.h"
|
||||
#include "filesys.h"
|
||||
#include "gui.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
|
||||
|
||||
#define DIALOG_WIDTH 620
|
||||
#define DIALOG_HEIGHT 202
|
||||
|
||||
static const char *harddisk_filter[] = { ".hdf", "\0" };
|
||||
|
||||
static bool dialogResult = false;
|
||||
static bool dialogFinished = false;
|
||||
static bool fileSelected = false;
|
||||
|
||||
static gcn::Window *wndCreateFilesysHardfile;
|
||||
static gcn::Button* cmdOK;
|
||||
static gcn::Button* cmdCancel;
|
||||
static gcn::Label *lblDevice;
|
||||
static gcn::TextField *txtDevice;
|
||||
static gcn::UaeCheckBox* chkAutoboot;
|
||||
static gcn::Label *lblBootPri;
|
||||
static gcn::TextField *txtBootPri;
|
||||
static gcn::Label *lblPath;
|
||||
static gcn::TextField *txtPath;
|
||||
static gcn::Button* cmdPath;
|
||||
static gcn::Label *lblSize;
|
||||
static gcn::TextField *txtSize;
|
||||
|
||||
|
||||
class CreateFilesysHardfileActionListener : public gcn::ActionListener
|
||||
{
|
||||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent)
|
||||
{
|
||||
if(actionEvent.getSource() == cmdPath)
|
||||
{
|
||||
char tmp[MAX_PATH];
|
||||
strncpy(tmp, txtPath->getText().c_str(), MAX_PATH);
|
||||
wndCreateFilesysHardfile->releaseModalFocus();
|
||||
if(SelectFile("Create harddisk file", tmp, harddisk_filter, true))
|
||||
{
|
||||
txtPath->setText(tmp);
|
||||
fileSelected = true;
|
||||
}
|
||||
wndCreateFilesysHardfile->requestModalFocus();
|
||||
cmdPath->requestFocus();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (actionEvent.getSource() == cmdOK)
|
||||
{
|
||||
if(txtDevice->getText().length() <= 0)
|
||||
{
|
||||
wndCreateFilesysHardfile->setCaption("Please enter a device name.");
|
||||
return;
|
||||
}
|
||||
if(!fileSelected)
|
||||
{
|
||||
wndCreateFilesysHardfile->setCaption("Please select a new filename.");
|
||||
return;
|
||||
}
|
||||
dialogResult = true;
|
||||
}
|
||||
dialogFinished = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
static CreateFilesysHardfileActionListener* createFilesysHardfileActionListener;
|
||||
|
||||
|
||||
static void InitCreateFilesysHardfile(void)
|
||||
{
|
||||
wndCreateFilesysHardfile = new gcn::Window("Create");
|
||||
wndCreateFilesysHardfile->setSize(DIALOG_WIDTH, DIALOG_HEIGHT);
|
||||
wndCreateFilesysHardfile->setPosition((GUI_WIDTH - DIALOG_WIDTH) / 2, (GUI_HEIGHT - DIALOG_HEIGHT) / 2);
|
||||
wndCreateFilesysHardfile->setBaseColor(gui_baseCol + 0x202020);
|
||||
wndCreateFilesysHardfile->setCaption("Create hardfile");
|
||||
wndCreateFilesysHardfile->setTitleBarHeight(TITLEBAR_HEIGHT);
|
||||
|
||||
createFilesysHardfileActionListener = new CreateFilesysHardfileActionListener();
|
||||
|
||||
cmdOK = new gcn::Button("Ok");
|
||||
cmdOK->setSize(BUTTON_WIDTH, BUTTON_HEIGHT);
|
||||
cmdOK->setPosition(DIALOG_WIDTH - DISTANCE_BORDER - 2 * BUTTON_WIDTH - DISTANCE_NEXT_X, DIALOG_HEIGHT - 2 * DISTANCE_BORDER - BUTTON_HEIGHT - 10);
|
||||
cmdOK->setBaseColor(gui_baseCol + 0x202020);
|
||||
cmdOK->setId("createHdfOK");
|
||||
cmdOK->addActionListener(createFilesysHardfileActionListener);
|
||||
|
||||
cmdCancel = new gcn::Button("Cancel");
|
||||
cmdCancel->setSize(BUTTON_WIDTH, BUTTON_HEIGHT);
|
||||
cmdCancel->setPosition(DIALOG_WIDTH - DISTANCE_BORDER - BUTTON_WIDTH, DIALOG_HEIGHT - 2 * DISTANCE_BORDER - BUTTON_HEIGHT - 10);
|
||||
cmdCancel->setBaseColor(gui_baseCol + 0x202020);
|
||||
cmdCancel->setId("createHdfCancel");
|
||||
cmdCancel->addActionListener(createFilesysHardfileActionListener);
|
||||
|
||||
lblDevice = new gcn::Label("Device Name:");
|
||||
lblDevice->setSize(100, LABEL_HEIGHT);
|
||||
lblDevice->setAlignment(gcn::Graphics::RIGHT);
|
||||
txtDevice = new gcn::TextField();
|
||||
txtDevice->setSize(80, TEXTFIELD_HEIGHT);
|
||||
txtDevice->setId("createHdfDev");
|
||||
|
||||
chkAutoboot = new gcn::UaeCheckBox("Bootable", true);
|
||||
chkAutoboot->setId("createHdfAutoboot");
|
||||
|
||||
lblBootPri = new gcn::Label("Boot priority:");
|
||||
lblBootPri->setSize(100, LABEL_HEIGHT);
|
||||
lblBootPri->setAlignment(gcn::Graphics::RIGHT);
|
||||
txtBootPri = new gcn::TextField();
|
||||
txtBootPri->setSize(40, TEXTFIELD_HEIGHT);
|
||||
txtBootPri->setId("createHdfBootPri");
|
||||
|
||||
lblSize = new gcn::Label("Size (MB):");
|
||||
lblSize->setSize(100, LABEL_HEIGHT);
|
||||
lblSize->setAlignment(gcn::Graphics::RIGHT);
|
||||
txtSize = new gcn::TextField();
|
||||
txtSize->setSize(60, TEXTFIELD_HEIGHT);
|
||||
txtSize->setId("createHdfSize");
|
||||
|
||||
lblPath = new gcn::Label("Path:");
|
||||
lblPath->setSize(100, LABEL_HEIGHT);
|
||||
lblPath->setAlignment(gcn::Graphics::RIGHT);
|
||||
txtPath = new gcn::TextField();
|
||||
txtPath->setSize(438, TEXTFIELD_HEIGHT);
|
||||
txtPath->setEnabled(false);
|
||||
cmdPath = new gcn::Button("...");
|
||||
cmdPath->setSize(SMALL_BUTTON_WIDTH, SMALL_BUTTON_HEIGHT);
|
||||
cmdPath->setBaseColor(gui_baseCol + 0x202020);
|
||||
cmdPath->setId("createHdfPath");
|
||||
cmdPath->addActionListener(createFilesysHardfileActionListener);
|
||||
|
||||
int posY = DISTANCE_BORDER;
|
||||
wndCreateFilesysHardfile->add(lblDevice, DISTANCE_BORDER, posY);
|
||||
wndCreateFilesysHardfile->add(txtDevice, DISTANCE_BORDER + lblDevice->getWidth() + 8, posY);
|
||||
wndCreateFilesysHardfile->add(chkAutoboot, 235, posY + 1);
|
||||
wndCreateFilesysHardfile->add(lblBootPri, 335, posY);
|
||||
wndCreateFilesysHardfile->add(txtBootPri, 335 + lblBootPri->getWidth() + 8, posY);
|
||||
posY += txtDevice->getHeight() + DISTANCE_NEXT_Y;
|
||||
wndCreateFilesysHardfile->add(lblPath, DISTANCE_BORDER, posY);
|
||||
wndCreateFilesysHardfile->add(txtPath, DISTANCE_BORDER + lblPath->getWidth() + 8, posY);
|
||||
wndCreateFilesysHardfile->add(cmdPath, wndCreateFilesysHardfile->getWidth() - DISTANCE_BORDER - SMALL_BUTTON_WIDTH, posY);
|
||||
posY += txtPath->getHeight() + DISTANCE_NEXT_Y;
|
||||
wndCreateFilesysHardfile->add(lblSize, DISTANCE_BORDER, posY);
|
||||
wndCreateFilesysHardfile->add(txtSize, DISTANCE_BORDER + lblSize->getWidth() + 8, posY);
|
||||
|
||||
wndCreateFilesysHardfile->add(cmdOK);
|
||||
wndCreateFilesysHardfile->add(cmdCancel);
|
||||
|
||||
gui_top->add(wndCreateFilesysHardfile);
|
||||
|
||||
txtDevice->requestFocus();
|
||||
wndCreateFilesysHardfile->requestModalFocus();
|
||||
}
|
||||
|
||||
|
||||
static void ExitCreateFilesysHardfile(void)
|
||||
{
|
||||
wndCreateFilesysHardfile->releaseModalFocus();
|
||||
gui_top->remove(wndCreateFilesysHardfile);
|
||||
|
||||
delete lblDevice;
|
||||
delete txtDevice;
|
||||
delete chkAutoboot;
|
||||
delete lblBootPri;
|
||||
delete txtBootPri;
|
||||
delete lblPath;
|
||||
delete txtPath;
|
||||
delete cmdPath;
|
||||
delete lblSize;
|
||||
delete txtSize;
|
||||
|
||||
delete cmdOK;
|
||||
delete cmdCancel;
|
||||
delete createFilesysHardfileActionListener;
|
||||
|
||||
delete wndCreateFilesysHardfile;
|
||||
}
|
||||
|
||||
|
||||
static void CreateFilesysHardfileLoop(void)
|
||||
{
|
||||
while(!dialogFinished)
|
||||
{
|
||||
SDL_Event event;
|
||||
while(SDL_PollEvent(&event))
|
||||
{
|
||||
if (event.type == SDL_KEYDOWN)
|
||||
{
|
||||
switch(event.key.keysym.sym)
|
||||
{
|
||||
case SDLK_ESCAPE:
|
||||
dialogFinished = true;
|
||||
break;
|
||||
|
||||
case SDLK_UP:
|
||||
if(HandleNavigation(DIRECTION_UP))
|
||||
continue; // Don't change value when enter ComboBox -> don't send event to control
|
||||
break;
|
||||
|
||||
case SDLK_DOWN:
|
||||
if(HandleNavigation(DIRECTION_DOWN))
|
||||
continue; // Don't change value when enter ComboBox -> don't send event to control
|
||||
break;
|
||||
|
||||
case SDLK_LEFT:
|
||||
if(HandleNavigation(DIRECTION_LEFT))
|
||||
continue; // Don't change value when enter Slider -> don't send event to control
|
||||
break;
|
||||
|
||||
case SDLK_RIGHT:
|
||||
if(HandleNavigation(DIRECTION_RIGHT))
|
||||
continue; // Don't change value when enter Slider -> don't send event to control
|
||||
break;
|
||||
|
||||
case SDLK_PAGEDOWN:
|
||||
case SDLK_HOME:
|
||||
event.key.keysym.sym = SDLK_RETURN;
|
||||
gui_input->pushInput(event); // Fire key down
|
||||
event.type = SDL_KEYUP; // and the key up
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// Send event to guichan-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.
|
||||
SDL_Flip(gui_screen);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool CreateFilesysHardfile(void)
|
||||
{
|
||||
struct uaedev_config_info *uci;
|
||||
std::string strroot;
|
||||
char tmp[32];
|
||||
char zero = 0;
|
||||
|
||||
dialogResult = false;
|
||||
dialogFinished = false;
|
||||
|
||||
InitCreateFilesysHardfile();
|
||||
|
||||
CreateDefaultDevicename(tmp);
|
||||
txtDevice->setText(tmp);
|
||||
strroot.assign(currentDir);
|
||||
txtPath->setText(strroot);
|
||||
fileSelected = false;
|
||||
|
||||
txtBootPri->setText("0");
|
||||
txtSize->setText("100");
|
||||
|
||||
CreateFilesysHardfileLoop();
|
||||
ExitCreateFilesysHardfile();
|
||||
|
||||
if(dialogResult)
|
||||
{
|
||||
char buffer[512];
|
||||
int size = atoi(txtSize->getText().c_str());
|
||||
if(size < 1)
|
||||
size = 1;
|
||||
if(size > 2048)
|
||||
size = 2048;
|
||||
int bp = tweakbootpri(atoi(txtBootPri->getText().c_str()), 1, 0);
|
||||
extractPath((char *) txtPath->getText().c_str(), currentDir);
|
||||
|
||||
FILE *newFile = fopen(txtPath->getText().c_str(), "wb");
|
||||
if(!newFile)
|
||||
{
|
||||
ShowMessage("Create Hardfile", "Unable to create new file.", "", "Ok", "");
|
||||
return false;
|
||||
}
|
||||
fseek(newFile, size * 1024 * 1024 - 1, SEEK_SET);
|
||||
fwrite(&zero, 1, 1, newFile);
|
||||
fclose(newFile);
|
||||
|
||||
uci = add_filesys_config(&changed_prefs, -1, (char *) txtDevice->getText().c_str(),
|
||||
0, (char *) txtPath->getText().c_str(), 0,
|
||||
32, (size / 1024) + 1, 2, 512,
|
||||
bp, 0, 0, 0);
|
||||
if (uci)
|
||||
hardfile_do_disk_change (uci->configoffset, 1);
|
||||
}
|
||||
|
||||
return dialogResult;
|
||||
}
|
|
@ -35,6 +35,7 @@ static gcn::Button* cmdCancel;
|
|||
static gcn::Label *lblDevice;
|
||||
static gcn::TextField *txtDevice;
|
||||
static gcn::UaeCheckBox* chkReadWrite;
|
||||
static gcn::UaeCheckBox* chkAutoboot;
|
||||
static gcn::Label *lblBootPri;
|
||||
static gcn::TextField *txtBootPri;
|
||||
static gcn::Label *lblPath;
|
||||
|
@ -72,9 +73,14 @@ class FilesysHardfileActionListener : public gcn::ActionListener
|
|||
{
|
||||
if (actionEvent.getSource() == cmdOK)
|
||||
{
|
||||
if(txtDevice->getText().length() <= 0 || !fileSelected)
|
||||
if(txtDevice->getText().length() <= 0)
|
||||
{
|
||||
// ToDo: Message to user
|
||||
wndEditFilesysHardfile->setCaption("Please enter a device name.");
|
||||
return;
|
||||
}
|
||||
if(!fileSelected)
|
||||
{
|
||||
wndEditFilesysHardfile->setCaption("Please select a filename.");
|
||||
return;
|
||||
}
|
||||
dialogResult = true;
|
||||
|
@ -121,6 +127,9 @@ static void InitEditFilesysHardfile(void)
|
|||
chkReadWrite = new gcn::UaeCheckBox("Read/Write", true);
|
||||
chkReadWrite->setId("hdfRW");
|
||||
|
||||
chkAutoboot = new gcn::UaeCheckBox("Bootable", true);
|
||||
chkAutoboot->setId("hdfAutoboot");
|
||||
|
||||
lblBootPri = new gcn::Label("Boot priority:");
|
||||
lblBootPri->setSize(100, LABEL_HEIGHT);
|
||||
lblBootPri->setAlignment(gcn::Graphics::RIGHT);
|
||||
|
@ -171,9 +180,10 @@ static void InitEditFilesysHardfile(void)
|
|||
int posY = DISTANCE_BORDER;
|
||||
wndEditFilesysHardfile->add(lblDevice, DISTANCE_BORDER, posY);
|
||||
wndEditFilesysHardfile->add(txtDevice, DISTANCE_BORDER + lblDevice->getWidth() + 8, posY);
|
||||
wndEditFilesysHardfile->add(chkReadWrite, 240, posY);
|
||||
wndEditFilesysHardfile->add(lblBootPri, 374, posY);
|
||||
wndEditFilesysHardfile->add(txtBootPri, 374 + lblBootPri->getWidth() + 8, posY);
|
||||
wndEditFilesysHardfile->add(chkReadWrite, 235, posY + 1);
|
||||
wndEditFilesysHardfile->add(chkAutoboot, 360, posY + 1);
|
||||
wndEditFilesysHardfile->add(lblBootPri, 460, posY);
|
||||
wndEditFilesysHardfile->add(txtBootPri, 460 + lblBootPri->getWidth() + 8, posY);
|
||||
posY += txtDevice->getHeight() + DISTANCE_NEXT_Y;
|
||||
wndEditFilesysHardfile->add(lblPath, DISTANCE_BORDER, posY);
|
||||
wndEditFilesysHardfile->add(txtPath, DISTANCE_BORDER + lblPath->getWidth() + 8, posY);
|
||||
|
@ -208,6 +218,7 @@ static void ExitEditFilesysHardfile(void)
|
|||
delete lblDevice;
|
||||
delete txtDevice;
|
||||
delete chkReadWrite;
|
||||
delete chkAutoboot;
|
||||
delete lblBootPri;
|
||||
delete txtBootPri;
|
||||
delete lblPath;
|
||||
|
@ -295,6 +306,7 @@ bool EditFilesysHardfile(int unit_no)
|
|||
struct mountedinfo mi;
|
||||
struct uaedev_config_info *uci = &changed_prefs.mountconfig[unit_no];
|
||||
std::string strdevname, strroot;
|
||||
char tmp[32];
|
||||
|
||||
dialogResult = false;
|
||||
dialogFinished = false;
|
||||
|
@ -303,8 +315,6 @@ bool EditFilesysHardfile(int unit_no)
|
|||
|
||||
if(unit_no >= 0)
|
||||
{
|
||||
char tmp[32];
|
||||
|
||||
get_filesys_unitconfig(&changed_prefs, unit_no, &mi);
|
||||
strdevname.assign(uci->devname);
|
||||
txtDevice->setText(strdevname);
|
||||
|
@ -313,6 +323,7 @@ bool EditFilesysHardfile(int unit_no)
|
|||
fileSelected = true;
|
||||
|
||||
chkReadWrite->setSelected(!uci->readonly);
|
||||
chkAutoboot->setSelected(uci->bootpri != -128);
|
||||
snprintf(tmp, 32, "%d", uci->bootpri >= -127 ? uci->bootpri : -127);
|
||||
txtBootPri->setText(tmp);
|
||||
snprintf(tmp, 32, "%d", uci->surfaces);
|
||||
|
@ -326,7 +337,8 @@ bool EditFilesysHardfile(int unit_no)
|
|||
}
|
||||
else
|
||||
{
|
||||
txtDevice->setText("");
|
||||
CreateDefaultDevicename(tmp);
|
||||
txtDevice->setText(tmp);
|
||||
strroot.assign(currentDir);
|
||||
txtPath->setText(strroot);
|
||||
fileSelected = false;
|
||||
|
@ -342,16 +354,14 @@ bool EditFilesysHardfile(int unit_no)
|
|||
ExitEditFilesysHardfile();
|
||||
if(dialogResult)
|
||||
{
|
||||
if(unit_no >= 0)
|
||||
kill_filesys_unitconfig(&changed_prefs, unit_no);
|
||||
else
|
||||
extractPath((char *) txtPath->getText().c_str(), currentDir);
|
||||
|
||||
uci = add_filesys_config(&changed_prefs, -1, (char *) txtDevice->getText().c_str(),
|
||||
int bp = tweakbootpri(atoi(txtBootPri->getText().c_str()), chkAutoboot->isSelected() ? 1 : 0, 0);
|
||||
extractPath((char *) txtPath->getText().c_str(), currentDir);
|
||||
|
||||
uci = add_filesys_config(&changed_prefs, unit_no, (char *) txtDevice->getText().c_str(),
|
||||
0, (char *) txtPath->getText().c_str(), !chkReadWrite->isSelected(),
|
||||
atoi(txtSectors->getText().c_str()), atoi(txtSurfaces->getText().c_str()),
|
||||
atoi(txtReserved->getText().c_str()), atoi(txtBlocksize->getText().c_str()),
|
||||
atoi(txtBootPri->getText().c_str()), 0, 0, 0);
|
||||
bp, 0, 0, 0);
|
||||
if (uci)
|
||||
hardfile_do_disk_change (uci->configoffset, 1);
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ static gcn::Label *lblPath;
|
|||
static gcn::TextField *txtPath;
|
||||
static gcn::Button* cmdPath;
|
||||
static gcn::UaeCheckBox* chkReadWrite;
|
||||
static gcn::UaeCheckBox* chkAutoboot;
|
||||
static gcn::Label *lblBootPri;
|
||||
static gcn::TextField *txtBootPri;
|
||||
|
||||
|
@ -62,12 +63,12 @@ class FilesysVirtualActionListener : public gcn::ActionListener
|
|||
{
|
||||
if(txtDevice->getText().length() <= 0)
|
||||
{
|
||||
// ToDo: Message to user
|
||||
wndEditFilesysVirtual->setCaption("Please enter a device name.");
|
||||
return;
|
||||
}
|
||||
if(txtVolume->getText().length() <= 0)
|
||||
{
|
||||
// ToDo: Message to user
|
||||
wndEditFilesysVirtual->setCaption("Please enter a volume name.");
|
||||
return;
|
||||
}
|
||||
dialogResult = true;
|
||||
|
@ -133,6 +134,9 @@ static void InitEditFilesysVirtual(void)
|
|||
chkReadWrite = new gcn::UaeCheckBox("Read/Write", true);
|
||||
chkReadWrite->setId("virtRW");
|
||||
|
||||
chkAutoboot = new gcn::UaeCheckBox("Bootable", true);
|
||||
chkAutoboot->setId("virtAutoboot");
|
||||
|
||||
lblBootPri = new gcn::Label("Boot priority:");
|
||||
lblBootPri->setSize(84, LABEL_HEIGHT);
|
||||
lblBootPri->setAlignment(gcn::Graphics::RIGHT);
|
||||
|
@ -143,12 +147,13 @@ static void InitEditFilesysVirtual(void)
|
|||
int posY = DISTANCE_BORDER;
|
||||
wndEditFilesysVirtual->add(lblDevice, DISTANCE_BORDER, posY);
|
||||
wndEditFilesysVirtual->add(txtDevice, DISTANCE_BORDER + lblDevice->getWidth() + 8, posY);
|
||||
wndEditFilesysVirtual->add(chkReadWrite, 260, posY);
|
||||
wndEditFilesysVirtual->add(chkReadWrite, 250, posY + 1);
|
||||
posY += txtDevice->getHeight() + DISTANCE_NEXT_Y;
|
||||
wndEditFilesysVirtual->add(lblVolume, DISTANCE_BORDER, posY);
|
||||
wndEditFilesysVirtual->add(txtVolume, DISTANCE_BORDER + lblDevice->getWidth() + 8, posY);
|
||||
wndEditFilesysVirtual->add(lblBootPri, 260, posY);
|
||||
wndEditFilesysVirtual->add(txtBootPri, 260 + lblBootPri->getWidth() + 8, posY);
|
||||
wndEditFilesysVirtual->add(chkAutoboot, 250, posY + 1);
|
||||
wndEditFilesysVirtual->add(lblBootPri, 374, posY);
|
||||
wndEditFilesysVirtual->add(txtBootPri, 374 + lblBootPri->getWidth() + 8, posY);
|
||||
posY += txtDevice->getHeight() + DISTANCE_NEXT_Y;
|
||||
wndEditFilesysVirtual->add(lblPath, DISTANCE_BORDER, posY);
|
||||
wndEditFilesysVirtual->add(txtPath, DISTANCE_BORDER + lblDevice->getWidth() + 8, posY);
|
||||
|
@ -178,6 +183,7 @@ static void ExitEditFilesysVirtual(void)
|
|||
delete txtPath;
|
||||
delete cmdPath;
|
||||
delete chkReadWrite;
|
||||
delete chkAutoboot;
|
||||
delete lblBootPri;
|
||||
delete txtBootPri;
|
||||
|
||||
|
@ -252,8 +258,9 @@ static void EditFilesysVirtualLoop(void)
|
|||
bool EditFilesysVirtual(int unit_no)
|
||||
{
|
||||
struct mountedinfo mi;
|
||||
struct uaedev_config_info *uci = &changed_prefs.mountconfig[unit_no];
|
||||
struct uaedev_config_info *uci;
|
||||
std::string strdevname, strvolname, strroot;
|
||||
char tmp[32];
|
||||
|
||||
dialogResult = false;
|
||||
dialogFinished = false;
|
||||
|
@ -262,8 +269,7 @@ bool EditFilesysVirtual(int unit_no)
|
|||
|
||||
if(unit_no >= 0)
|
||||
{
|
||||
char tmp[32];
|
||||
|
||||
uci = &changed_prefs.mountconfig[unit_no];
|
||||
get_filesys_unitconfig(&changed_prefs, unit_no, &mi);
|
||||
|
||||
strdevname.assign(uci->devname);
|
||||
|
@ -273,13 +279,15 @@ bool EditFilesysVirtual(int unit_no)
|
|||
strroot.assign(uci->rootdir);
|
||||
txtPath->setText(strroot);
|
||||
chkReadWrite->setSelected(!uci->readonly);
|
||||
chkAutoboot->setSelected(uci->bootpri != -128);
|
||||
snprintf(tmp, 32, "%d", uci->bootpri >= -127 ? uci->bootpri : -127);
|
||||
txtBootPri->setText(tmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
txtDevice->setText("");
|
||||
txtVolume->setText("");
|
||||
CreateDefaultDevicename(tmp);
|
||||
txtDevice->setText(tmp);
|
||||
txtVolume->setText(tmp);
|
||||
strroot.assign(currentDir);
|
||||
txtPath->setText(strroot);
|
||||
chkReadWrite->setSelected(true);
|
||||
|
@ -291,14 +299,12 @@ bool EditFilesysVirtual(int unit_no)
|
|||
|
||||
if(dialogResult)
|
||||
{
|
||||
if(unit_no >= 0)
|
||||
kill_filesys_unitconfig(&changed_prefs, unit_no);
|
||||
else
|
||||
extractPath((char *) txtPath->getText().c_str(), currentDir);
|
||||
|
||||
uci = add_filesys_config(&changed_prefs, -1, (char *) txtDevice->getText().c_str(),
|
||||
int bp = tweakbootpri(atoi(txtBootPri->getText().c_str()), chkAutoboot->isSelected() ? 1 : 0, 0);
|
||||
extractPath((char *) txtPath->getText().c_str(), currentDir);
|
||||
|
||||
uci = add_filesys_config(&changed_prefs, unit_no, (char *) txtDevice->getText().c_str(),
|
||||
(char *) txtVolume->getText().c_str(), (char *) txtPath->getText().c_str(),
|
||||
!chkReadWrite->isSelected(), 0, 0, 0, 0, atoi(txtBootPri->getText().c_str()), 0, 0, 0);
|
||||
!chkReadWrite->isSelected(), 0, 0, 0, 0, bp, 0, 0, 0);
|
||||
if (uci)
|
||||
filesys_media_change (uci->rootdir, 1, uci);
|
||||
}
|
||||
|
|
|
@ -27,9 +27,9 @@ static NavigationMap navMap[] =
|
|||
// active move left move right move up move down
|
||||
// main_window
|
||||
{ "Paths", "SystemROMs", "SystemROMs", "Reset", "Configurations" },
|
||||
{ "Configurations", "ConfigList", "ConfigList", "Paths", "CPU" },
|
||||
{ "CPU", "7 Mhz", "68000", "Configurations", "Chipset" },
|
||||
{ "Chipset", "BlitNormal", "OCS", "CPU", "ROM" },
|
||||
{ "Configurations", "ConfigList", "ConfigList", "Paths", "CPU and FPU" },
|
||||
{ "CPU and FPU", "7 Mhz", "68000", "Configurations", "Chipset" },
|
||||
{ "Chipset", "Fast copper", "OCS", "CPU and FPU", "ROM" },
|
||||
{ "ROM", "MainROM", "cboMainROM", "Chipset", "RAM" },
|
||||
{ "RAM", "Chipmem", "Chipmem", "ROM", "Floppy drives" },
|
||||
{ "Floppy drives", "cmdSel0", "DF0:", "RAM", "Hard drives" },
|
||||
|
@ -59,30 +59,32 @@ static NavigationMap navMap[] =
|
|||
|
||||
// active move left move right move up move down
|
||||
// PanelCPU
|
||||
{ "68000", "CPU", "FPUnone", "JIT", "68010" },
|
||||
{ "68010", "CPU", "68881", "68000", "68EC020" },
|
||||
{ "68EC020", "CPU", "68882", "68010", "68020" },
|
||||
{ "68020", "CPU", "CPU internal", "68EC020", "68040" },
|
||||
{ "68040", "CPU", "CPU internal", "68020", "CPUComp" },
|
||||
{ "CPUComp", "CPU", "CPU internal", "68040", "JIT" },
|
||||
{ "JIT", "CPU", "CPU internal", "CPUComp", "68000" },
|
||||
{ "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", "68EC020", "28 Mhz", "68881", "CPU internal" },
|
||||
{ "CPU internal", "68020", "Fastest", "68882", "FPUnone" },
|
||||
{ "7 Mhz", "FPUnone", "CPU", "Fastest", "14 Mhz" },
|
||||
{ "14 Mhz", "68881", "CPU", "7 Mhz", "28 Mhz" },
|
||||
{ "28 Mhz", "68882", "CPU", "14 Mhz", "Fastest" },
|
||||
{ "Fastest", "CPU internal", "CPU", "28 Mhz", "7 Mhz" },
|
||||
{ "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" },
|
||||
|
||||
// PanelChipset
|
||||
{ "OCS", "Chipset", "BlitNormal", "CollFull", "ECS" },
|
||||
{ "ECS", "Chipset", "Immediate", "OCS", "AGA" },
|
||||
{ "AGA", "Chipset", "Improved", "ECS", "NTSC" },
|
||||
{ "OCS", "Chipset", "BlitNormal", "CollFull", "ECS Agnus" },
|
||||
{ "ECS Agnus", "Chipset", "Immediate", "OCS", "Full ECS" },
|
||||
{ "Full ECS", "Chipset", "Immediate", "ECS Agnus", "AGA" },
|
||||
{ "AGA", "Chipset", "Chipset", "Full ECS", "NTSC" },
|
||||
{ "NTSC", "Chipset", "Chipset", "AGA", "CollNone" },
|
||||
{ "BlitNormal", "OCS", "Chipset", "CollFull", "Immediate" },
|
||||
{ "Immediate", "ECS", "Chipset", "BlitNormal", "Improved" },
|
||||
{ "Improved", "AGA", "Chipset", "Immediate", "CollNone" },
|
||||
{ "BlitNormal", "OCS", "Fast copper", "CollFull", "Immediate" },
|
||||
{ "Immediate", "ECS Agnus", "Fast copper", "BlitNormal", "CollNone" },
|
||||
{ "Fast copper", "BlitNormal", "Chipset", "CollFull", "CollNone" },
|
||||
{ "CollNone", "Chipset", "Chipset", "NTSC", "Sprites only" },
|
||||
{ "Sprites only", "Chipset", "Chipset", "CollNone", "CollPlay" },
|
||||
{ "CollPlay", "Chipset", "Chipset", "Sprites only", "CollFull" },
|
||||
|
@ -103,15 +105,16 @@ static NavigationMap navMap[] =
|
|||
{ "Gfxmem", "", "", "Z3mem", "RAM" },
|
||||
|
||||
//PanelFloppy
|
||||
{ "DF0:", "Floppy drives", "cboType0", "SaveForDisk", "cboDisk0" },
|
||||
{ "cboType0", "DF0:", "cmdEject0", "SaveForDisk", "cboDisk0" },
|
||||
{ "cmdEject0", "cboType0", "cmdSel0", "SaveForDisk", "cboDisk0" },
|
||||
{ "cmdSel0", "cmdEject0", "Floppy drives", "SaveForDisk", "cboDisk0" },
|
||||
{ "cboDisk0", "Floppy drives", "Floppy drives", "DF0:", "DF1:" },
|
||||
{ "DF1:", "Floppy drives", "cboType1", "cboDisk0", "cboDisk1" },
|
||||
{ "cboType1", "DF1:", "cmdEject1", "cboDisk0", "cboDisk1" },
|
||||
{ "cmdEject1", "cboType1", "cmdSel1", "cboDisk0", "cboDisk1" },
|
||||
{ "cmdSel1", "cmdEject1", "Floppy drives", "cboDisk0", "cboDisk1" },
|
||||
{ "DF0:", "Floppy drives", "cboType0", "SaveForDisk", "cboDisk0" },
|
||||
{ "cboType0", "DF0:", "cmdEject0", "SaveForDisk", "cboDisk0" },
|
||||
{ "cmdEject0", "cboType0", "cmdSel0", "CreateHD", "cboDisk0" },
|
||||
{ "cmdSel0", "cmdEject0", "Floppy drives", "CreateHD", "cboDisk0" },
|
||||
{ "cboDisk0", "Floppy drives", "Floppy drives", "DF0:", "LoadDiskCfg" },
|
||||
{ "LoadDiskCfg", "Floppy drives", "Floppy drives", "cboDisk0", "DF1:" },
|
||||
{ "DF1:", "Floppy drives", "cboType1", "LoadDiskCfg", "cboDisk1" },
|
||||
{ "cboType1", "DF1:", "cmdEject1", "LoadDiskCfg", "cboDisk1" },
|
||||
{ "cmdEject1", "cboType1", "cmdSel1", "LoadDiskCfg", "cboDisk1" },
|
||||
{ "cmdSel1", "cmdEject1", "Floppy drives", "LoadDiskCfg", "cboDisk1" },
|
||||
{ "cboDisk1", "Floppy drives", "Floppy drives", "DF1:", "DF2:" },
|
||||
{ "DF2:", "Floppy drives", "cboType2", "cboDisk1", "cboDisk2" },
|
||||
{ "cboType2", "DF2:", "cmdEject2", "cboDisk1", "cboDisk2" },
|
||||
|
@ -123,8 +126,10 @@ static NavigationMap navMap[] =
|
|||
{ "cmdEject3", "cboType3", "cmdSel3", "cboDisk2", "cboDisk3" },
|
||||
{ "cmdSel3", "cmdEject3", "Floppy drives", "cboDisk2", "cboDisk3" },
|
||||
{ "cboDisk3", "Floppy drives", "Floppy drives", "DF3:", "DriveSpeed" },
|
||||
{ "DriveSpeed", "", "", "cboDisk3", "SaveForDisk" },
|
||||
{ "SaveForDisk", "Floppy drives", "Floppy drives", "DriveSpeed", "DF0:" },
|
||||
{ "DriveSpeed", "", "", "cboDisk3", "CreateDD" },
|
||||
{ "SaveForDisk", "Floppy drives", "CreateDD", "DriveSpeed", "DF0:" },
|
||||
{ "CreateDD", "SaveForDisk", "CreateHD", "DriveSpeed", "cboType0" },
|
||||
{ "CreateHD", "CreateDD", "Floppy drives", "DriveSpeed", "cmdEject0" },
|
||||
|
||||
// active move left move right move up move down
|
||||
// PanelHD
|
||||
|
@ -139,7 +144,8 @@ static NavigationMap navMap[] =
|
|||
{ "cmdProp4", "Hard drives", "cmdDel4", "cmdProp3", "cmdAddDir" },
|
||||
{ "cmdDel4", "cmdProp4", "Hard drives", "cmdDel3", "cmdAddHDF" },
|
||||
{ "cmdAddDir", "Hard drives", "cmdAddHDF", "cmdProp4", "cmdProp0" },
|
||||
{ "cmdAddHDF", "cmdAddDir", "Hard drives", "cmdDel4", "cmdDel0" },
|
||||
{ "cmdAddHDF", "cmdAddDir", "cmdCreateHDF", "cmdDel4", "cmdDel0" },
|
||||
{ "cmdCreateHDF", "cmdAddHDF", "Hard drives", "cmdDel4", "cmdDel0" },
|
||||
|
||||
// PanelDisplay
|
||||
{ "sldWidth", "", "", "Frameskip", "sldHeight" },
|
||||
|
@ -197,17 +203,19 @@ static NavigationMap navMap[] =
|
|||
// active move left move right move up move down
|
||||
// EditFilesysVirtual
|
||||
{ "virtDev", "virtRW", "virtRW", "virtOK", "virtVol" },
|
||||
{ "virtVol", "virtBootpri", "virtBootpri", "virtDev", "virtPath" },
|
||||
{ "virtVol", "virtBootpri", "virtAutoboot", "virtDev", "virtPath" },
|
||||
{ "virtPath", "", "", "virtBootpri", "virtCancel" },
|
||||
{ "virtRW", "virtDev", "virtDev", "virtOK", "virtBootpri" },
|
||||
{ "virtBootpri", "virtVol", "virtVol", "virtRW", "virtPath" },
|
||||
{ "virtRW", "virtDev", "virtDev", "virtOK", "virtAutoboot" },
|
||||
{ "virtAutoboot", "virtVol", "virtBootpri", "virtRW", "virtPath" },
|
||||
{ "virtBootpri", "virtAutoboot", "virtVol", "virtRW", "virtPath" },
|
||||
{ "virtOK", "virtCancel", "virtCancel", "virtPath", "virtRW" },
|
||||
{ "virtCancel", "virtOK", "virtOK", "virtPath", "virtRW" },
|
||||
|
||||
// EditFilesysHardfile
|
||||
{ "hdfDev", "hdfBootPri", "hdfRW", "hdfOK", "hdfPath" },
|
||||
{ "hdfRW", "hdfDev", "hdfBootPri", "hdfOK", "hdfPath" },
|
||||
{ "hdfBootPri", "hdfRW", "hdfDev", "hdfCancel", "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" },
|
||||
|
@ -216,6 +224,15 @@ static NavigationMap navMap[] =
|
|||
{ "hdfOK", "hdfCancel", "hdfCancel", "hdfBlocksize", "hdfBootPri" },
|
||||
{ "hdfCancel", "hdfOK", "hdfOK", "hdfBlocksize", "hdfBootPri" },
|
||||
|
||||
// CreateFilesysHardfile
|
||||
{ "createHdfDev", "createHdfBootPri", "createHdfAutoboot", "createHdfOK", "createHdfPath" },
|
||||
{ "createHdfAutoboot", "createHdfDev", "createHdfBootPri", "createHdfOK", "createHdfPath" },
|
||||
{ "createHdfBootPri", "createHdfAutoboot", "createHdfDev", "createHdfOK", "createHdfPath" },
|
||||
{ "createHdfSize", "", "", "createHdfPath", "createHdfOK" },
|
||||
{ "createHdfPath", "", "", "createHdfBootPri", "createHdfSize" },
|
||||
{ "createHdfOK", "createHdfCancel", "createHdfCancel", "createHdfSize", "createHdfBootPri" },
|
||||
{ "createHdfCancel", "createHdfOK", "createHdfOK", "createHdfSize", "createHdfBootPri" },
|
||||
|
||||
{ "END", "", "", "", "" }
|
||||
};
|
||||
|
||||
|
|
|
@ -19,9 +19,10 @@
|
|||
static gcn::Window *grpCPU;
|
||||
static gcn::UaeRadioButton* optCPU68000;
|
||||
static gcn::UaeRadioButton* optCPU68010;
|
||||
static gcn::UaeRadioButton* optCPU68EC020;
|
||||
static gcn::UaeRadioButton* optCPU68020;
|
||||
static gcn::UaeRadioButton* optCPU68030;
|
||||
static gcn::UaeRadioButton* optCPU68040;
|
||||
static gcn::UaeCheckBox* chk24Bit;
|
||||
static gcn::UaeCheckBox* chkCPUCompatible;
|
||||
static gcn::UaeCheckBox* chkJIT;
|
||||
static gcn::Window *grpFPU;
|
||||
|
@ -58,19 +59,16 @@ class CPUButtonActionListener : public gcn::ActionListener
|
|||
changed_prefs.gfxmem_size = 0;
|
||||
changed_prefs.cpu_compatible = 0;
|
||||
}
|
||||
else if (actionEvent.getSource() == optCPU68EC020)
|
||||
else if (actionEvent.getSource() == optCPU68020)
|
||||
{
|
||||
changed_prefs.cpu_model = 68020;
|
||||
if(changed_prefs.fpu_model == 68040)
|
||||
changed_prefs.fpu_model = 68881;
|
||||
changed_prefs.address_space_24 = true;
|
||||
changed_prefs.z3fastmem_size = 0;
|
||||
changed_prefs.gfxmem_size = 0;
|
||||
changed_prefs.cpu_compatible = 0;
|
||||
}
|
||||
else if (actionEvent.getSource() == optCPU68020)
|
||||
else if (actionEvent.getSource() == optCPU68030)
|
||||
{
|
||||
changed_prefs.cpu_model = 68020;
|
||||
changed_prefs.cpu_model = 68030;
|
||||
if(changed_prefs.fpu_model == 68040)
|
||||
changed_prefs.fpu_model = 68881;
|
||||
changed_prefs.address_space_24 = false;
|
||||
|
@ -136,6 +134,17 @@ class CPUSpeedButtonActionListener : public gcn::ActionListener
|
|||
static CPUSpeedButtonActionListener* cpuSpeedButtonActionListener;
|
||||
|
||||
|
||||
class CPU24BitActionListener : public gcn::ActionListener
|
||||
{
|
||||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent)
|
||||
{
|
||||
changed_prefs.address_space_24 = chk24Bit->isSelected();
|
||||
RefreshPanelCPU();
|
||||
}
|
||||
};
|
||||
static CPU24BitActionListener* cpu24BitActionListener;
|
||||
|
||||
class CPUCompActionListener : public gcn::ActionListener
|
||||
{
|
||||
public:
|
||||
|
@ -179,6 +188,7 @@ static JITActionListener* jitActionListener;
|
|||
void InitPanelCPU(const struct _ConfigCategory& category)
|
||||
{
|
||||
cpuButtonActionListener = new CPUButtonActionListener();
|
||||
cpu24BitActionListener = new CPU24BitActionListener();
|
||||
cpuCompActionListener = new CPUCompActionListener();
|
||||
jitActionListener = new JITActionListener();
|
||||
|
||||
|
@ -186,13 +196,17 @@ void InitPanelCPU(const struct _ConfigCategory& category)
|
|||
optCPU68000->addActionListener(cpuButtonActionListener);
|
||||
optCPU68010 = new gcn::UaeRadioButton("68010", "radiocpugroup");
|
||||
optCPU68010->addActionListener(cpuButtonActionListener);
|
||||
optCPU68EC020 = new gcn::UaeRadioButton("68EC020", "radiocpugroup");
|
||||
optCPU68EC020->addActionListener(cpuButtonActionListener);
|
||||
optCPU68020 = new gcn::UaeRadioButton("68020", "radiocpugroup");
|
||||
optCPU68020->addActionListener(cpuButtonActionListener);
|
||||
optCPU68030 = new gcn::UaeRadioButton("68030", "radiocpugroup");
|
||||
optCPU68030->addActionListener(cpuButtonActionListener);
|
||||
optCPU68040 = new gcn::UaeRadioButton("68040", "radiocpugroup");
|
||||
optCPU68040->addActionListener(cpuButtonActionListener);
|
||||
|
||||
chk24Bit = new gcn::UaeCheckBox("24-bit addressing", true);
|
||||
chk24Bit->setId("CPU24Bit");
|
||||
chk24Bit->addActionListener(cpu24BitActionListener);
|
||||
|
||||
chkCPUCompatible = new gcn::UaeCheckBox("More compatible", true);
|
||||
chkCPUCompatible->setId("CPUComp");
|
||||
chkCPUCompatible->addActionListener(cpuCompActionListener);
|
||||
|
@ -205,13 +219,14 @@ void InitPanelCPU(const struct _ConfigCategory& category)
|
|||
grpCPU->setPosition(DISTANCE_BORDER, DISTANCE_BORDER);
|
||||
grpCPU->add(optCPU68000, 5, 10);
|
||||
grpCPU->add(optCPU68010, 5, 40);
|
||||
grpCPU->add(optCPU68EC020, 5, 70);
|
||||
grpCPU->add(optCPU68020, 5, 100);
|
||||
grpCPU->add(optCPU68020, 5, 70);
|
||||
grpCPU->add(optCPU68030, 5, 100);
|
||||
grpCPU->add(optCPU68040, 5, 130);
|
||||
grpCPU->add(chkCPUCompatible, 5, 170);
|
||||
grpCPU->add(chkJIT, 5, 200);
|
||||
grpCPU->add(chk24Bit, 5, 170);
|
||||
grpCPU->add(chkCPUCompatible, 5, 200);
|
||||
grpCPU->add(chkJIT, 5, 230);
|
||||
grpCPU->setMovable(false);
|
||||
grpCPU->setSize(160, 245);
|
||||
grpCPU->setSize(160, 275);
|
||||
grpCPU->setBaseColor(gui_baseCol);
|
||||
|
||||
category.panel->add(grpCPU);
|
||||
|
@ -251,7 +266,7 @@ void InitPanelCPU(const struct _ConfigCategory& category)
|
|||
opt14Mhz = new gcn::UaeRadioButton("14 Mhz", "radiocpuspeedgroup");
|
||||
opt14Mhz->addActionListener(cpuSpeedButtonActionListener);
|
||||
|
||||
opt28Mhz = new gcn::UaeRadioButton("28 Mhz", "radiocpuspeedgroup");
|
||||
opt28Mhz = new gcn::UaeRadioButton("25 Mhz", "radiocpuspeedgroup");
|
||||
opt28Mhz->addActionListener(cpuSpeedButtonActionListener);
|
||||
|
||||
optFastest = new gcn::UaeRadioButton("Fastest", "radiocpuspeedgroup");
|
||||
|
@ -277,13 +292,15 @@ void ExitPanelCPU(void)
|
|||
{
|
||||
delete optCPU68000;
|
||||
delete optCPU68010;
|
||||
delete optCPU68EC020;
|
||||
delete optCPU68020;
|
||||
delete optCPU68030;
|
||||
delete optCPU68040;
|
||||
delete chk24Bit;
|
||||
delete chkCPUCompatible;
|
||||
delete chkJIT;
|
||||
delete grpCPU;
|
||||
delete cpuButtonActionListener;
|
||||
delete cpu24BitActionListener;
|
||||
delete cpuCompActionListener;
|
||||
delete jitActionListener;
|
||||
|
||||
|
@ -305,23 +322,19 @@ void ExitPanelCPU(void)
|
|||
|
||||
void RefreshPanelCPU(void)
|
||||
{
|
||||
if(changed_prefs.address_space_24)
|
||||
{
|
||||
if(changed_prefs.cpu_model == 68000)
|
||||
optCPU68000->setSelected(true);
|
||||
else if(changed_prefs.cpu_model == 68010)
|
||||
optCPU68010->setSelected(true);
|
||||
else if(changed_prefs.cpu_model == 68020)
|
||||
optCPU68EC020->setSelected(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(changed_prefs.cpu_model == 68020 || changed_prefs.cpu_model == 68030)
|
||||
optCPU68020->setSelected(true);
|
||||
else if(changed_prefs.cpu_model == 68040)
|
||||
optCPU68040->setSelected(true);
|
||||
}
|
||||
if(changed_prefs.cpu_model == 68000)
|
||||
optCPU68000->setSelected(true);
|
||||
else if(changed_prefs.cpu_model == 68010)
|
||||
optCPU68010->setSelected(true);
|
||||
else if(changed_prefs.cpu_model == 68020)
|
||||
optCPU68020->setSelected(true);
|
||||
else if(changed_prefs.cpu_model == 68030)
|
||||
optCPU68030->setSelected(true);
|
||||
else if(changed_prefs.cpu_model == 68040)
|
||||
optCPU68040->setSelected(true);
|
||||
|
||||
chk24Bit->setSelected(changed_prefs.address_space_24);
|
||||
chk24Bit->setEnabled(changed_prefs.cpu_model == 68020);
|
||||
chkCPUCompatible->setSelected(changed_prefs.cpu_compatible > 0);
|
||||
chkCPUCompatible->setEnabled(changed_prefs.cpu_model == 68000);
|
||||
chkJIT->setSelected(changed_prefs.cachesize > 0);
|
||||
|
|
|
@ -19,13 +19,15 @@
|
|||
|
||||
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::Window *grpBlitter;
|
||||
static gcn::UaeRadioButton* optBlitNormal;
|
||||
static gcn::UaeRadioButton* optBlitImmed;
|
||||
static gcn::UaeRadioButton* optBlitImproved;
|
||||
static gcn::Window *grpCopper;
|
||||
static gcn::UaeCheckBox* chkFastCopper;
|
||||
static gcn::Window *grpCollisionLevel;
|
||||
static gcn::UaeRadioButton* optCollNone;
|
||||
static gcn::UaeRadioButton* optCollSprites;
|
||||
|
@ -39,6 +41,8 @@ class ChipsetButtonActionListener : public gcn::ActionListener
|
|||
void action(const gcn::ActionEvent& actionEvent)
|
||||
{
|
||||
if (actionEvent.getSource() == optOCS)
|
||||
changed_prefs.chipset_mask = 0;
|
||||
else if (actionEvent.getSource() == optECSAgnus)
|
||||
changed_prefs.chipset_mask = CSMASK_ECS_AGNUS;
|
||||
else if (actionEvent.getSource() == optECS)
|
||||
changed_prefs.chipset_mask = CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE;
|
||||
|
@ -69,13 +73,23 @@ class NTSCButtonActionListener : public gcn::ActionListener
|
|||
static NTSCButtonActionListener* ntscButtonActionListener;
|
||||
|
||||
|
||||
class FastCopperActionListener : public gcn::ActionListener
|
||||
{
|
||||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent)
|
||||
{
|
||||
changed_prefs.fast_copper = chkFastCopper->isSelected();
|
||||
}
|
||||
};
|
||||
static FastCopperActionListener* fastCopperActionListener;
|
||||
|
||||
|
||||
class BlitterButtonActionListener : public gcn::ActionListener
|
||||
{
|
||||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent)
|
||||
{
|
||||
changed_prefs.immediate_blits = optBlitImmed->isSelected();
|
||||
changed_prefs.pandora_partial_blits = optBlitImproved->isSelected();
|
||||
}
|
||||
};
|
||||
static BlitterButtonActionListener* blitterButtonActionListener;
|
||||
|
@ -107,7 +121,10 @@ void InitPanelChipset(const struct _ConfigCategory& category)
|
|||
optOCS = new gcn::UaeRadioButton("OCS", "radiochipsetgroup");
|
||||
optOCS->addActionListener(chipsetButtonActionListener);
|
||||
|
||||
optECS = new gcn::UaeRadioButton("ECS", "radiochipsetgroup");
|
||||
optECSAgnus = new gcn::UaeRadioButton("ECS Agnus", "radiochipsetgroup");
|
||||
optECSAgnus->addActionListener(chipsetButtonActionListener);
|
||||
|
||||
optECS = new gcn::UaeRadioButton("Full ECS", "radiochipsetgroup");
|
||||
optECS->addActionListener(chipsetButtonActionListener);
|
||||
|
||||
optAGA = new gcn::UaeRadioButton("AGA", "radiochipsetgroup");
|
||||
|
@ -119,11 +136,12 @@ void InitPanelChipset(const struct _ConfigCategory& category)
|
|||
grpChipset = new gcn::Window("Chipset");
|
||||
grpChipset->setPosition(DISTANCE_BORDER, DISTANCE_BORDER);
|
||||
grpChipset->add(optOCS, 5, 10);
|
||||
grpChipset->add(optECS, 5, 40);
|
||||
grpChipset->add(optAGA, 5, 70);
|
||||
grpChipset->add(chkNTSC, 5, 110);
|
||||
grpChipset->add(optECSAgnus, 5, 40);
|
||||
grpChipset->add(optECS, 5, 70);
|
||||
grpChipset->add(optAGA, 5, 100);
|
||||
grpChipset->add(chkNTSC, 5, 140);
|
||||
grpChipset->setMovable(false);
|
||||
grpChipset->setSize(100, 155);
|
||||
grpChipset->setSize(120, 185);
|
||||
grpChipset->setBaseColor(gui_baseCol);
|
||||
|
||||
category.panel->add(grpChipset);
|
||||
|
@ -137,20 +155,30 @@ void InitPanelChipset(const struct _ConfigCategory& category)
|
|||
optBlitImmed = new gcn::UaeRadioButton("Immediate", "radiocblittergroup");
|
||||
optBlitImmed->addActionListener(blitterButtonActionListener);
|
||||
|
||||
optBlitImproved = new gcn::UaeRadioButton("Improved", "radiocblittergroup");
|
||||
optBlitImproved->addActionListener(blitterButtonActionListener);
|
||||
|
||||
grpBlitter = new gcn::Window("Blitter");
|
||||
grpBlitter->setPosition(DISTANCE_BORDER + grpChipset->getWidth() + DISTANCE_NEXT_X, DISTANCE_BORDER);
|
||||
grpBlitter->add(optBlitNormal, 5, 10);
|
||||
grpBlitter->add(optBlitImmed, 5, 40);
|
||||
grpBlitter->add(optBlitImproved, 5, 70);
|
||||
grpBlitter->setMovable(false);
|
||||
grpBlitter->setSize(120, 115);
|
||||
grpBlitter->setSize(120, 85);
|
||||
grpBlitter->setBaseColor(gui_baseCol);
|
||||
|
||||
category.panel->add(grpBlitter);
|
||||
|
||||
fastCopperActionListener = new FastCopperActionListener();
|
||||
|
||||
chkFastCopper = new gcn::UaeCheckBox("Fast copper");
|
||||
chkFastCopper->addActionListener(fastCopperActionListener);
|
||||
|
||||
grpCopper = new gcn::Window("Copper");
|
||||
grpCopper->setPosition(grpBlitter->getX() + grpBlitter->getWidth() + DISTANCE_NEXT_X, DISTANCE_BORDER);
|
||||
grpCopper->add(chkFastCopper, 5, 10);
|
||||
grpCopper->setMovable(false);
|
||||
grpCopper->setSize(120, 55);
|
||||
grpCopper->setBaseColor(gui_baseCol);
|
||||
|
||||
category.panel->add(grpCopper);
|
||||
|
||||
collisionButtonActionListener = new CollisionButtonActionListener();
|
||||
|
||||
optCollNone = new gcn::UaeRadioButton("None", "radioccollisiongroup");
|
||||
|
@ -187,6 +215,7 @@ void InitPanelChipset(const struct _ConfigCategory& category)
|
|||
void ExitPanelChipset(void)
|
||||
{
|
||||
delete optOCS;
|
||||
delete optECSAgnus;
|
||||
delete optECS;
|
||||
delete optAGA;
|
||||
delete chkNTSC;
|
||||
|
@ -196,10 +225,13 @@ void ExitPanelChipset(void)
|
|||
|
||||
delete optBlitNormal;
|
||||
delete optBlitImmed;
|
||||
delete optBlitImproved;
|
||||
delete grpBlitter;
|
||||
delete blitterButtonActionListener;
|
||||
|
||||
delete chkFastCopper;
|
||||
delete grpCopper;
|
||||
delete fastCopperActionListener;
|
||||
|
||||
delete optCollNone;
|
||||
delete optCollSprites;
|
||||
delete optCollPlayfield;
|
||||
|
@ -211,8 +243,10 @@ void ExitPanelChipset(void)
|
|||
|
||||
void RefreshPanelChipset(void)
|
||||
{
|
||||
if (changed_prefs.chipset_mask == CSMASK_ECS_AGNUS)
|
||||
if (changed_prefs.chipset_mask == 0)
|
||||
optOCS->setSelected(true);
|
||||
else if (changed_prefs.chipset_mask == CSMASK_ECS_AGNUS)
|
||||
optECSAgnus->setSelected(true);
|
||||
else if (changed_prefs.chipset_mask == (CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE))
|
||||
optECS->setSelected(true);
|
||||
else if (changed_prefs.chipset_mask == (CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE | CSMASK_AGA))
|
||||
|
@ -222,11 +256,11 @@ void RefreshPanelChipset(void)
|
|||
|
||||
if(changed_prefs.immediate_blits)
|
||||
optBlitImmed->setSelected(true);
|
||||
else if (changed_prefs.pandora_partial_blits)
|
||||
optBlitImproved->setSelected(true);
|
||||
else
|
||||
optBlitNormal->setSelected(true);
|
||||
|
||||
chkFastCopper->setSelected(changed_prefs.fast_copper);
|
||||
|
||||
if(changed_prefs.collision_level == 0)
|
||||
optCollNone->setSelected(true);
|
||||
else if(changed_prefs.collision_level == 1)
|
||||
|
|
|
@ -39,6 +39,7 @@ bool LoadConfigByName(const char *name)
|
|||
txtDesc->setText(config->Description);
|
||||
target_cfgfile_load(&changed_prefs, config->FullPath, 0, 0);
|
||||
strncpy(last_active_config, config->Name, MAX_PATH);
|
||||
DisableResume();
|
||||
RefreshAllPanels();
|
||||
}
|
||||
|
||||
|
@ -107,6 +108,7 @@ class ConfigButtonActionListener : public gcn::ActionListener
|
|||
i = lstConfigs->getSelected();
|
||||
target_cfgfile_load(&changed_prefs, ConfigFilesList[i]->FullPath, 0, 0);
|
||||
strncpy(last_active_config, ConfigFilesList[i]->Name, MAX_PATH);
|
||||
DisableResume();
|
||||
RefreshAllPanels();
|
||||
}
|
||||
else if(actionEvent.getSource() == cmdSave)
|
||||
|
@ -175,6 +177,7 @@ class ConfigsListActionListener : public gcn::ActionListener
|
|||
//-----------------------------------------------
|
||||
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(1);
|
||||
gui_running = false;
|
||||
|
|
|
@ -31,12 +31,15 @@ static gcn::Label* lblDriveSpeedInfo;
|
|||
static gcn::Slider* sldDriveSpeed;
|
||||
static gcn::UaeCheckBox* chkLoadConfig;
|
||||
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 *drivespeedlist[] = { "100% (compatible)", "200%", "400%", "800%" };
|
||||
static const int drivespeedvalues[] = { 100, 200, 400, 800 };
|
||||
|
||||
static void AdjustDropDownControls(void);
|
||||
static bool bLoadConfigForDisk = true;
|
||||
|
||||
|
||||
class DriveTypeListModel : public gcn::ListModel
|
||||
|
@ -115,27 +118,29 @@ class DFxCheckActionListener : public gcn::ActionListener
|
|||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent)
|
||||
{
|
||||
for(int i=0; i<4; ++i)
|
||||
{
|
||||
if (actionEvent.getSource() == chkDFx[i])
|
||||
{
|
||||
// Patch done on RASPBERRY, but should be needed for everybody
|
||||
changed_prefs.nr_floppies = chkDFx[0]->isSelected()+chkDFx[1]->isSelected()+chkDFx[2]->isSelected()+chkDFx[3]->isSelected();
|
||||
// Patch done on RASPBERRY, but should be needed for everybody
|
||||
//---------------------------------------
|
||||
// Drive enabled/disabled
|
||||
//---------------------------------------
|
||||
if(chkDFx[i]->isSelected())
|
||||
changed_prefs.dfxtype[i] = DRV_35_DD;
|
||||
else
|
||||
changed_prefs.dfxtype[i] = DRV_NONE;
|
||||
}
|
||||
else if(actionEvent.getSource() == chkDFxWriteProtect[i])
|
||||
{
|
||||
//---------------------------------------
|
||||
// Write-protect changed
|
||||
//---------------------------------------
|
||||
// ToDo: set write protect for floppy
|
||||
if(actionEvent.getSource() == chkLoadConfig)
|
||||
bLoadConfigForDisk = chkLoadConfig->isSelected();
|
||||
else
|
||||
{
|
||||
for(int i=0; i<4; ++i)
|
||||
{
|
||||
if (actionEvent.getSource() == chkDFx[i])
|
||||
{
|
||||
//---------------------------------------
|
||||
// Drive enabled/disabled
|
||||
//---------------------------------------
|
||||
if(chkDFx[i]->isSelected())
|
||||
changed_prefs.dfxtype[i] = DRV_35_DD;
|
||||
else
|
||||
changed_prefs.dfxtype[i] = DRV_NONE;
|
||||
}
|
||||
else if(actionEvent.getSource() == chkDFxWriteProtect[i])
|
||||
{
|
||||
//---------------------------------------
|
||||
// Write-protect changed
|
||||
//---------------------------------------
|
||||
// ToDo: set write protect for floppy
|
||||
}
|
||||
}
|
||||
}
|
||||
RefreshPanelFloppy();
|
||||
|
@ -201,6 +206,7 @@ class DFxButtonActionListener : public gcn::ActionListener
|
|||
cmdDFxSelect[i]->requestFocus();
|
||||
}
|
||||
}
|
||||
RefreshPanelFloppy();
|
||||
}
|
||||
};
|
||||
static DFxButtonActionListener* dfxButtonActionListener;
|
||||
|
@ -255,6 +261,7 @@ class DiskFileActionListener : public gcn::ActionListener
|
|||
}
|
||||
}
|
||||
}
|
||||
RefreshPanelFloppy();
|
||||
}
|
||||
};
|
||||
static DiskFileActionListener* diskFileActionListener;
|
||||
|
@ -301,6 +308,50 @@ class SaveForDiskActionListener : public gcn::ActionListener
|
|||
static SaveForDiskActionListener* saveForDiskActionListener;
|
||||
|
||||
|
||||
class CreateDiskActionListener : public gcn::ActionListener
|
||||
{
|
||||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent)
|
||||
{
|
||||
if(actionEvent.getSource() == cmdCreateDDDisk)
|
||||
{
|
||||
// Create 3.5'' DD Disk
|
||||
char tmp[MAX_PATH];
|
||||
char diskname[MAX_PATH];
|
||||
strncpy(tmp, currentDir, MAX_PATH);
|
||||
if(SelectFile("Create 3.5'' DD disk file", tmp, diskfile_filter, true))
|
||||
{
|
||||
extractFileName(tmp, diskname);
|
||||
removeFileExtension(diskname);
|
||||
diskname[31] = '\0';
|
||||
disk_creatediskfile(tmp, 0, DRV_35_DD, diskname);
|
||||
AddFileToDiskList(tmp, 1);
|
||||
extractPath(tmp, currentDir);
|
||||
}
|
||||
cmdCreateDDDisk->requestFocus();
|
||||
}
|
||||
else if(actionEvent.getSource() == cmdCreateHDDisk)
|
||||
{
|
||||
// Create 3.5'' HD Disk
|
||||
char tmp[MAX_PATH];
|
||||
char diskname[MAX_PATH];
|
||||
strncpy(tmp, currentDir, MAX_PATH);
|
||||
if(SelectFile("Create 3.5'' HD disk file", tmp, diskfile_filter, true))
|
||||
{
|
||||
extractFileName(tmp, diskname);
|
||||
removeFileExtension(diskname);
|
||||
diskname[31] = '\0';
|
||||
disk_creatediskfile(tmp, 0, DRV_35_HD, diskname);
|
||||
AddFileToDiskList(tmp, 1);
|
||||
extractPath(tmp, currentDir);
|
||||
}
|
||||
cmdCreateHDDisk->requestFocus();
|
||||
}
|
||||
}
|
||||
};
|
||||
static CreateDiskActionListener* createDiskActionListener;
|
||||
|
||||
|
||||
void InitPanelFloppy(const struct _ConfigCategory& category)
|
||||
{
|
||||
int posX;
|
||||
|
@ -313,6 +364,7 @@ void InitPanelFloppy(const struct _ConfigCategory& category)
|
|||
diskFileActionListener = new DiskFileActionListener();
|
||||
driveSpeedSliderActionListener = new DriveSpeedSliderActionListener();
|
||||
saveForDiskActionListener = new SaveForDiskActionListener();
|
||||
createDiskActionListener = new CreateDiskActionListener();
|
||||
|
||||
for(i=0; i<4; ++i)
|
||||
{
|
||||
|
@ -362,6 +414,7 @@ void InitPanelFloppy(const struct _ConfigCategory& category)
|
|||
{
|
||||
chkLoadConfig = new gcn::UaeCheckBox("Load config with same name as disk");
|
||||
chkLoadConfig->setId("LoadDiskCfg");
|
||||
chkLoadConfig->addActionListener(dfxCheckActionListener);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -376,10 +429,22 @@ void InitPanelFloppy(const struct _ConfigCategory& category)
|
|||
lblDriveSpeedInfo = new gcn::Label(drivespeedlist[0]);
|
||||
|
||||
cmdSaveForDisk = new gcn::Button("Save config for disk");
|
||||
cmdSaveForDisk->setSize(BUTTON_WIDTH * 2, BUTTON_HEIGHT);
|
||||
cmdSaveForDisk->setSize(160, BUTTON_HEIGHT);
|
||||
cmdSaveForDisk->setBaseColor(gui_baseCol);
|
||||
cmdSaveForDisk->setId("SaveForDisk");
|
||||
cmdSaveForDisk->addActionListener(saveForDiskActionListener);
|
||||
|
||||
cmdCreateDDDisk = new gcn::Button("Create 3.5'' DD disk");
|
||||
cmdCreateDDDisk->setSize(160, BUTTON_HEIGHT);
|
||||
cmdCreateDDDisk->setBaseColor(gui_baseCol);
|
||||
cmdCreateDDDisk->setId("CreateDD");
|
||||
cmdCreateDDDisk->addActionListener(createDiskActionListener);
|
||||
|
||||
cmdCreateHDDisk = new gcn::Button("Create 3.5'' HD disk");
|
||||
cmdCreateHDDisk->setSize(160, BUTTON_HEIGHT);
|
||||
cmdCreateHDDisk->setBaseColor(gui_baseCol);
|
||||
cmdCreateHDDisk->setId("CreateHD");
|
||||
cmdCreateHDDisk->addActionListener(createDiskActionListener);
|
||||
|
||||
for(i=0; i<4; ++i)
|
||||
{
|
||||
|
@ -388,7 +453,7 @@ void InitPanelFloppy(const struct _ConfigCategory& category)
|
|||
posX += 100;
|
||||
category.panel->add(cboDFxType[i], posX, posY);
|
||||
posX += cboDFxType[i]->getWidth() + 2 * DISTANCE_NEXT_X;
|
||||
// category.panel->add(chkDFxWriteProtect[i], posX, posY);
|
||||
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;
|
||||
|
@ -413,9 +478,12 @@ void InitPanelFloppy(const struct _ConfigCategory& category)
|
|||
posX += sldDriveSpeed->getWidth() + DISTANCE_NEXT_X;
|
||||
category.panel->add(lblDriveSpeedInfo, posX, posY);
|
||||
posY += sldDriveSpeed->getHeight() + DISTANCE_NEXT_Y;
|
||||
|
||||
category.panel->add(cmdSaveForDisk, DISTANCE_BORDER, category.panel->getHeight() - DISTANCE_BORDER - BUTTON_HEIGHT);
|
||||
|
||||
posY = category.panel->getHeight() - DISTANCE_BORDER - BUTTON_HEIGHT;
|
||||
category.panel->add(cmdSaveForDisk, DISTANCE_BORDER, posY);
|
||||
category.panel->add(cmdCreateDDDisk, cmdSaveForDisk->getX() + cmdSaveForDisk->getWidth() + DISTANCE_NEXT_X, posY);
|
||||
category.panel->add(cmdCreateHDDisk, cmdCreateDDDisk->getX() + cmdCreateDDDisk->getWidth() + DISTANCE_NEXT_X, posY);
|
||||
|
||||
RefreshPanelFloppy();
|
||||
}
|
||||
|
||||
|
@ -437,6 +505,8 @@ void ExitPanelFloppy(void)
|
|||
delete sldDriveSpeed;
|
||||
delete lblDriveSpeedInfo;
|
||||
delete cmdSaveForDisk;
|
||||
delete cmdCreateDDDisk;
|
||||
delete cmdCreateHDDisk;
|
||||
|
||||
delete dfxCheckActionListener;
|
||||
delete driveTypeActionListener;
|
||||
|
@ -444,6 +514,7 @@ void ExitPanelFloppy(void)
|
|||
delete diskFileActionListener;
|
||||
delete driveSpeedSliderActionListener;
|
||||
delete saveForDiskActionListener;
|
||||
delete createDiskActionListener;
|
||||
}
|
||||
|
||||
|
||||
|
@ -477,23 +548,31 @@ static void AdjustDropDownControls(void)
|
|||
void RefreshPanelFloppy(void)
|
||||
{
|
||||
int i;
|
||||
bool prevAvailable = true;
|
||||
|
||||
AdjustDropDownControls();
|
||||
|
||||
changed_prefs.nr_floppies = 0;
|
||||
for(i=0; i<4; ++i)
|
||||
{
|
||||
bool driveEnabled = changed_prefs.dfxtype[i] != DRV_NONE;
|
||||
chkDFx[i]->setSelected(driveEnabled);
|
||||
cboDFxType[i]->setSelected(changed_prefs.dfxtype[i] + 1);
|
||||
chkDFxWriteProtect[i]->setSelected(false);
|
||||
chkDFxWriteProtect[i]->setSelected(disk_getwriteprotect(changed_prefs.df[i]));
|
||||
chkDFx[i]->setEnabled(prevAvailable);
|
||||
cboDFxType[i]->setEnabled(prevAvailable);
|
||||
|
||||
cmdDFxInfo[i]->setEnabled(driveEnabled);
|
||||
cmdDFxEject[i]->setEnabled(driveEnabled);
|
||||
cmdDFxSelect[i]->setEnabled(driveEnabled);
|
||||
cboDFxFile[i]->setEnabled(driveEnabled);
|
||||
|
||||
prevAvailable = driveEnabled;
|
||||
if(driveEnabled)
|
||||
changed_prefs.nr_floppies = i + 1;
|
||||
}
|
||||
|
||||
chkLoadConfig->setSelected(true);
|
||||
chkLoadConfig->setSelected(bLoadConfigForDisk);
|
||||
|
||||
for(i=0; i<4; ++i)
|
||||
{
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "gui_handling.h"
|
||||
|
||||
|
||||
#define MAX_HD_DEVICES 5
|
||||
enum { COL_DEVICE, COL_VOLUME, COL_PATH, COL_READWRITE, COL_SIZE, COL_BOOTPRI, COL_COUNT };
|
||||
|
||||
static const char *column_caption[] = {
|
||||
|
@ -41,6 +40,22 @@ static gcn::Button* listCmdProps[MAX_HD_DEVICES];
|
|||
static gcn::ImageButton* listCmdDelete[MAX_HD_DEVICES];
|
||||
static gcn::Button* cmdAddDirectory;
|
||||
static gcn::Button* cmdAddHardfile;
|
||||
static gcn::Button* cmdCreateHardfile;
|
||||
|
||||
|
||||
static int GetHDType(int index)
|
||||
{
|
||||
int type;
|
||||
struct uaedev_config_info *uci;
|
||||
struct mountedinfo mi;
|
||||
|
||||
type = get_filesys_unitconfig(&changed_prefs, index, &mi);
|
||||
if (type < 0) {
|
||||
uci = &changed_prefs.mountconfig[index];
|
||||
type = uci->ishdf ? FILESYS_HARDFILE : FILESYS_VIRTUAL;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
class HDRemoveActionListener : public gcn::ActionListener
|
||||
|
@ -72,8 +87,7 @@ class HDEditActionListener : public gcn::ActionListener
|
|||
{
|
||||
if (actionEvent.getSource() == listCmdProps[i])
|
||||
{
|
||||
int type = is_hardfile (i);
|
||||
if(type == FILESYS_VIRTUAL)
|
||||
if (GetHDType(i) == FILESYS_VIRTUAL)
|
||||
EditFilesysVirtual(i);
|
||||
else
|
||||
EditFilesysHardfile(i);
|
||||
|
@ -113,6 +127,19 @@ class AddHardfileActionListener : public gcn::ActionListener
|
|||
AddHardfileActionListener* addHardfileActionListener;
|
||||
|
||||
|
||||
class CreateHardfileActionListener : public gcn::ActionListener
|
||||
{
|
||||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent)
|
||||
{
|
||||
CreateFilesysHardfile();
|
||||
cmdCreateHardfile->requestFocus();
|
||||
RefreshPanelHD();
|
||||
}
|
||||
};
|
||||
CreateHardfileActionListener* createHardfileActionListener;
|
||||
|
||||
|
||||
void InitPanelHD(const struct _ConfigCategory& category)
|
||||
{
|
||||
int row, col;
|
||||
|
@ -124,6 +151,7 @@ void InitPanelHD(const struct _ConfigCategory& category)
|
|||
hdEditActionListener = new HDEditActionListener();
|
||||
addVirtualHDActionListener = new AddVirtualHDActionListener();
|
||||
addHardfileActionListener = new AddHardfileActionListener();
|
||||
createHardfileActionListener = new CreateHardfileActionListener();
|
||||
|
||||
for(col=0; col<COL_COUNT; ++col)
|
||||
lblList[col] = new gcn::Label(column_caption[col]);
|
||||
|
@ -169,6 +197,12 @@ void InitPanelHD(const struct _ConfigCategory& category)
|
|||
cmdAddHardfile->setSize(BUTTON_WIDTH + 20, BUTTON_HEIGHT);
|
||||
cmdAddHardfile->setId("cmdAddHDF");
|
||||
cmdAddHardfile->addActionListener(addHardfileActionListener);
|
||||
|
||||
cmdCreateHardfile = new gcn::Button("Create Hardfile");
|
||||
cmdCreateHardfile->setBaseColor(gui_baseCol);
|
||||
cmdCreateHardfile->setSize(BUTTON_WIDTH + 20, BUTTON_HEIGHT);
|
||||
cmdCreateHardfile->setId("cmdCreateHDF");
|
||||
cmdCreateHardfile->addActionListener(createHardfileActionListener);
|
||||
|
||||
posX = DISTANCE_BORDER + 2 + SMALL_BUTTON_WIDTH + 34;
|
||||
for(col=0; col<COL_COUNT; ++col)
|
||||
|
@ -197,6 +231,7 @@ void InitPanelHD(const struct _ConfigCategory& category)
|
|||
posY = category.panel->getHeight() - DISTANCE_BORDER - BUTTON_HEIGHT;
|
||||
category.panel->add(cmdAddDirectory, DISTANCE_BORDER, posY);
|
||||
category.panel->add(cmdAddHardfile, DISTANCE_BORDER + cmdAddDirectory->getWidth() + DISTANCE_NEXT_X, posY);
|
||||
category.panel->add(cmdCreateHardfile, cmdAddHardfile->getX() + cmdAddHardfile->getWidth() + DISTANCE_NEXT_X, posY);
|
||||
|
||||
RefreshPanelHD();
|
||||
}
|
||||
|
@ -220,11 +255,13 @@ void ExitPanelHD(void)
|
|||
|
||||
delete cmdAddDirectory;
|
||||
delete cmdAddHardfile;
|
||||
delete cmdCreateHardfile;
|
||||
|
||||
delete hdRemoveActionListener;
|
||||
delete hdEditActionListener;
|
||||
delete addVirtualHDActionListener;
|
||||
delete addHardfileActionListener;
|
||||
delete createHardfileActionListener;
|
||||
}
|
||||
|
||||
|
||||
|
@ -235,7 +272,6 @@ void RefreshPanelHD(void)
|
|||
struct mountedinfo mi;
|
||||
struct uaedev_config_info *uci;
|
||||
int nosize = 0, type;
|
||||
int units = nr_units();
|
||||
|
||||
for(row=0; row<MAX_HD_DEVICES; ++row)
|
||||
{
|
||||
|
@ -291,3 +327,22 @@ void RefreshPanelHD(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int count_HDs(struct uae_prefs *p)
|
||||
{
|
||||
int row;
|
||||
struct uaedev_config_info *uci;
|
||||
int cnt = 0;
|
||||
|
||||
for(row=0; row<MAX_HD_DEVICES; ++row)
|
||||
{
|
||||
uci = &p->mountconfig[row];
|
||||
if(uci->devname && uci->devname[0])
|
||||
{
|
||||
++cnt;
|
||||
}
|
||||
}
|
||||
|
||||
return cnt;
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "sysdeps.h"
|
||||
#include "config.h"
|
||||
#include "uae.h"
|
||||
#include "fsdb.h"
|
||||
#include "gui.h"
|
||||
#include "gui_handling.h"
|
||||
|
||||
|
@ -24,6 +25,7 @@
|
|||
|
||||
static bool dialogResult = false;
|
||||
static bool dialogFinished = false;
|
||||
static bool createNew = false;
|
||||
static char workingDir[MAX_PATH];
|
||||
static const char **filefilter;
|
||||
|
||||
|
@ -33,6 +35,8 @@ static gcn::Button* cmdCancel;
|
|||
static gcn::ListBox* lstFiles;
|
||||
static gcn::ScrollArea* scrAreaFiles;
|
||||
static gcn::TextField *txtCurrent;
|
||||
static gcn::Label *lblFilename;
|
||||
static gcn::TextField *txtFilename;
|
||||
|
||||
|
||||
class SelectFileListModel : public gcn::ListModel
|
||||
|
@ -85,11 +89,29 @@ class FileButtonActionListener : public gcn::ActionListener
|
|||
{
|
||||
int selected_item;
|
||||
selected_item = lstFiles->getSelected();
|
||||
if(fileList->isDir(selected_item))
|
||||
return; // Directory selected -> Ok not possible
|
||||
strcat(workingDir, "/");
|
||||
strcat(workingDir, fileList->getElementAt(selected_item).c_str());
|
||||
dialogResult = true;
|
||||
if(createNew)
|
||||
{
|
||||
char tmp[MAX_PATH];
|
||||
if(txtFilename->getText().length() <= 0)
|
||||
return;
|
||||
strcpy(tmp, workingDir);
|
||||
strcat(tmp, "/");
|
||||
strcat(tmp, txtFilename->getText().c_str());
|
||||
if(strstr(tmp, filefilter[0]) == NULL)
|
||||
strcat(tmp, filefilter[0]);
|
||||
if(my_existsfile(tmp) == 1)
|
||||
return; // File already exists
|
||||
strcpy(workingDir, tmp);
|
||||
dialogResult = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(fileList->isDir(selected_item))
|
||||
return; // Directory selected -> Ok not possible
|
||||
strcat(workingDir, "/");
|
||||
strcat(workingDir, fileList->getElementAt(selected_item).c_str());
|
||||
dialogResult = true;
|
||||
}
|
||||
}
|
||||
dialogFinished = true;
|
||||
}
|
||||
|
@ -144,7 +166,7 @@ class SelectFileActionListener : public gcn::ActionListener
|
|||
strcat(foldername, fileList->getElementAt(selected_item).c_str());
|
||||
if(fileList->isDir(selected_item))
|
||||
checkfoldername(foldername);
|
||||
else
|
||||
else if(!createNew)
|
||||
{
|
||||
strncpy(workingDir, foldername, sizeof(workingDir));
|
||||
dialogResult = true;
|
||||
|
@ -198,6 +220,22 @@ static void InitSelectFile(const char *title)
|
|||
scrAreaFiles->setSize(DIALOG_WIDTH - 2 * DISTANCE_BORDER - 4, 272);
|
||||
scrAreaFiles->setScrollbarWidth(20);
|
||||
scrAreaFiles->setBaseColor(gui_baseCol + 0x202020);
|
||||
|
||||
if(createNew)
|
||||
{
|
||||
scrAreaFiles->setSize(DIALOG_WIDTH - 2 * DISTANCE_BORDER - 4, 272 - TEXTFIELD_HEIGHT - DISTANCE_NEXT_Y);
|
||||
lblFilename = new gcn::Label("Filename:");
|
||||
lblFilename->setSize(80, LABEL_HEIGHT);
|
||||
lblFilename->setAlignment(gcn::Graphics::LEFT);
|
||||
lblFilename->setPosition(DISTANCE_BORDER, scrAreaFiles->getY() + scrAreaFiles->getHeight() + DISTANCE_NEXT_Y);
|
||||
txtFilename = new gcn::TextField();
|
||||
txtFilename->setSize(120, TEXTFIELD_HEIGHT);
|
||||
txtFilename->setId("Filename");
|
||||
txtFilename->setPosition(lblFilename->getX() + lblFilename->getWidth() + DISTANCE_NEXT_X, lblFilename->getY());
|
||||
|
||||
wndSelectFile->add(lblFilename);
|
||||
wndSelectFile->add(txtFilename);
|
||||
}
|
||||
|
||||
wndSelectFile->add(cmdOK);
|
||||
wndSelectFile->add(cmdCancel);
|
||||
|
@ -225,6 +263,11 @@ static void ExitSelectFile(void)
|
|||
delete scrAreaFiles;
|
||||
delete selectFileActionListener;
|
||||
delete fileList;
|
||||
if(createNew)
|
||||
{
|
||||
delete lblFilename;
|
||||
delete txtFilename;
|
||||
}
|
||||
|
||||
delete wndSelectFile;
|
||||
}
|
||||
|
@ -254,6 +297,11 @@ static void SelectFileLoop(void)
|
|||
else if(activeWidget == cmdCancel)
|
||||
cmdOK->requestFocus();
|
||||
else if(activeWidget == cmdOK)
|
||||
if(createNew)
|
||||
txtFilename->requestFocus();
|
||||
else
|
||||
lstFiles->requestFocus();
|
||||
else if(activeWidget == txtFilename)
|
||||
lstFiles->requestFocus();
|
||||
continue;
|
||||
}
|
||||
|
@ -264,6 +312,11 @@ static void SelectFileLoop(void)
|
|||
gcn::FocusHandler* focusHdl = gui_top->_getFocusHandler();
|
||||
gcn::Widget* activeWidget = focusHdl->getFocused();
|
||||
if(activeWidget == lstFiles)
|
||||
if(createNew)
|
||||
txtFilename->requestFocus();
|
||||
else
|
||||
cmdOK->requestFocus();
|
||||
else if(activeWidget == txtFilename)
|
||||
cmdOK->requestFocus();
|
||||
else if(activeWidget == cmdCancel)
|
||||
lstFiles->requestFocus();
|
||||
|
@ -301,10 +354,11 @@ static void SelectFileLoop(void)
|
|||
static int Already_init = 0;
|
||||
#endif
|
||||
|
||||
bool SelectFile(const char *title, char *value, const char *filter[])
|
||||
bool SelectFile(const char *title, char *value, const char *filter[], bool create)
|
||||
{
|
||||
dialogResult = false;
|
||||
dialogFinished = false;
|
||||
createNew = create;
|
||||
filefilter = filter;
|
||||
|
||||
|
||||
|
|
|
@ -59,4 +59,19 @@ namespace gcn
|
|||
{
|
||||
return mDroppedDown;
|
||||
}
|
||||
|
||||
void UaeDropDown::setEnabled(bool enabled)
|
||||
{
|
||||
if(mEnabled != enabled)
|
||||
{
|
||||
mEnabled = enabled;
|
||||
if(mEnabled)
|
||||
mBackgroundColor = mBackgroundColorBackup;
|
||||
else
|
||||
{
|
||||
mBackgroundColorBackup = mBackgroundColor;
|
||||
mBackgroundColor = mBackgroundColor - 0x303030;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,9 +24,15 @@ namespace gcn
|
|||
|
||||
virtual void keyPressed(KeyEvent& keyEvent);
|
||||
|
||||
virtual void setEnabled(bool enabled);
|
||||
|
||||
void clearSelected(void);
|
||||
|
||||
bool isDroppedDown(void);
|
||||
|
||||
protected:
|
||||
Color mBackgroundColorBackup;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -86,12 +86,15 @@ void RefreshPanelSavestate(void);
|
|||
|
||||
void RefreshAllPanels(void);
|
||||
|
||||
void DisableResume(void);
|
||||
|
||||
void InGameMessage(const char *msg);
|
||||
bool ShowMessage(const char *title, const char *line1, const char *line2, const char *button1, const char *button2);
|
||||
bool SelectFolder(const char *title, char *value);
|
||||
bool SelectFile(const char *title, char *value, const char *filter[]);
|
||||
bool SelectFile(const char *title, char *value, const char *filter[], bool create = false);
|
||||
bool EditFilesysVirtual(int unit_no);
|
||||
bool EditFilesysHardfile(int unit_no);
|
||||
bool CreateFilesysHardfile(void);
|
||||
|
||||
bool LoadConfigByName(const char *name);
|
||||
ConfigFileInfo* SearchConfigInList(const char *name);
|
||||
|
@ -102,6 +105,11 @@ extern void FilterFiles(std::vector<std::string> *files, const char *filter[]);
|
|||
enum { DIRECTION_NONE, DIRECTION_UP, DIRECTION_DOWN, DIRECTION_LEFT, DIRECTION_RIGHT };
|
||||
bool HandleNavigation(int direction);
|
||||
|
||||
#define MAX_HD_DEVICES 5
|
||||
extern void CreateDefaultDevicename(char *name);
|
||||
extern bool DevicenameExists(const char *name);
|
||||
extern int tweakbootpri (int bp, int ab, int dnm);
|
||||
|
||||
extern char *screenshot_filename;
|
||||
extern int currentStateNum;
|
||||
extern int delay_savestate_frame;
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
#include "gui.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
#include "memory.h"
|
||||
#include "autoconf.h"
|
||||
|
||||
bool gui_running = false;
|
||||
static int last_active_panel = 1;
|
||||
|
@ -20,7 +22,7 @@ static int last_active_panel = 1;
|
|||
ConfigCategory categories[] = {
|
||||
{ "Paths", "data/paths.ico", NULL, NULL, InitPanelPaths, ExitPanelPaths, RefreshPanelPaths },
|
||||
{ "Configurations", "data/file.ico", NULL, NULL, InitPanelConfig, ExitPanelConfig, RefreshPanelConfig },
|
||||
{ "CPU", "data/cpu.ico", NULL, NULL, InitPanelCPU, ExitPanelCPU, RefreshPanelCPU },
|
||||
{ "CPU and FPU", "data/cpu.ico", NULL, NULL, InitPanelCPU, ExitPanelCPU, RefreshPanelCPU },
|
||||
{ "Chipset", "data/cpu.ico", NULL, NULL, InitPanelChipset, ExitPanelChipset, RefreshPanelChipset },
|
||||
{ "ROM", "data/chip.ico", NULL, NULL, InitPanelROM, ExitPanelROM, RefreshPanelROM },
|
||||
{ "RAM", "data/chip.ico", NULL, NULL, InitPanelRAM, ExitPanelRAM, RefreshPanelRAM },
|
||||
|
@ -51,6 +53,29 @@ gcn::SDLGraphics* gui_graphics;
|
|||
gcn::SDLInput* gui_input;
|
||||
gcn::SDLImageLoader* gui_imageLoader;
|
||||
|
||||
namespace widgets
|
||||
{
|
||||
// Main buttons
|
||||
gcn::Button* cmdQuit;
|
||||
gcn::Button* cmdReset;
|
||||
gcn::Button* cmdRestart;
|
||||
gcn::Button* cmdStart;
|
||||
}
|
||||
|
||||
|
||||
int gui_check_boot_rom(struct uae_prefs *p)
|
||||
{
|
||||
if(count_HDs(p) > 0)
|
||||
return 1;
|
||||
if(p->gfxmem_size)
|
||||
return 1;
|
||||
if (p->chipmem_size > 2 * 1024 * 1024)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
namespace sdl
|
||||
{
|
||||
void gui_init()
|
||||
|
@ -142,12 +167,12 @@ namespace sdl
|
|||
//-------------------------------------------------
|
||||
// Reset Amiga
|
||||
//-------------------------------------------------
|
||||
uae_reset(0);
|
||||
uae_reset(1);
|
||||
gui_running = false;
|
||||
break;
|
||||
|
||||
case SDLK_LCTRL:
|
||||
if(emulating)
|
||||
if(emulating && widgets::cmdStart->isEnabled())
|
||||
{
|
||||
//------------------------------------------------
|
||||
// Continue emulation
|
||||
|
@ -213,15 +238,9 @@ namespace sdl
|
|||
|
||||
}
|
||||
|
||||
|
||||
namespace widgets
|
||||
{
|
||||
// Main buttons
|
||||
gcn::Button* cmdQuit;
|
||||
gcn::Button* cmdReset;
|
||||
gcn::Button* cmdRestart;
|
||||
gcn::Button* cmdStart;
|
||||
|
||||
|
||||
class MainButtonActionListener : public gcn::ActionListener
|
||||
{
|
||||
public:
|
||||
|
@ -262,7 +281,7 @@ namespace widgets
|
|||
}
|
||||
else if(actionEvent.getSource() == cmdStart)
|
||||
{
|
||||
if(emulating)
|
||||
if(emulating && widgets::cmdStart->isEnabled())
|
||||
{
|
||||
//------------------------------------------------
|
||||
// Continue emulation
|
||||
|
@ -475,9 +494,27 @@ void RefreshAllPanels(void)
|
|||
}
|
||||
|
||||
|
||||
void DisableResume(void)
|
||||
{
|
||||
if(emulating)
|
||||
{
|
||||
widgets::cmdStart->setEnabled(false);
|
||||
gcn::Color backCol;
|
||||
backCol.r = 128;
|
||||
backCol.g = 128;
|
||||
backCol.b = 128;
|
||||
widgets::cmdStart->setForegroundColor(backCol);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void run_gui(void)
|
||||
{
|
||||
int boot_rom_on_enter;
|
||||
|
||||
gui_running = true;
|
||||
boot_rom_on_enter = gui_check_boot_rom(&currprefs);
|
||||
|
||||
try
|
||||
{
|
||||
sdl::gui_init();
|
||||
|
@ -510,5 +547,8 @@ void run_gui(void)
|
|||
// Prepare everything for Reset of Amiga
|
||||
//--------------------------------------------------
|
||||
currprefs.nr_floppies = changed_prefs.nr_floppies;
|
||||
|
||||
if(boot_rom_on_enter != gui_check_boot_rom(&changed_prefs))
|
||||
quit_program = -3; // Hardreset required...
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,34 +85,34 @@ void inputmode_redraw(void)
|
|||
}
|
||||
|
||||
|
||||
void set_joyConf(void)
|
||||
void set_joyConf(struct uae_prefs *p)
|
||||
{
|
||||
if(changed_prefs.pandora_joyConf == 0)
|
||||
if(p->pandora_joyConf == 0)
|
||||
{
|
||||
changed_prefs.pandora_button1 = GP2X_BUTTON_X;
|
||||
changed_prefs.pandora_button2 = GP2X_BUTTON_A;
|
||||
changed_prefs.pandora_jump = -1;
|
||||
changed_prefs.pandora_autofireButton1 = GP2X_BUTTON_B;
|
||||
p->pandora_button1 = GP2X_BUTTON_X;
|
||||
p->pandora_button2 = GP2X_BUTTON_A;
|
||||
p->pandora_jump = -1;
|
||||
p->pandora_autofireButton1 = GP2X_BUTTON_B;
|
||||
}
|
||||
else if(changed_prefs.pandora_joyConf == 1)
|
||||
else if(p->pandora_joyConf == 1)
|
||||
{
|
||||
changed_prefs.pandora_button1 = GP2X_BUTTON_B;
|
||||
changed_prefs.pandora_button2 = GP2X_BUTTON_A;
|
||||
changed_prefs.pandora_jump = -1;
|
||||
changed_prefs.pandora_autofireButton1 = GP2X_BUTTON_X;
|
||||
p->pandora_button1 = GP2X_BUTTON_B;
|
||||
p->pandora_button2 = GP2X_BUTTON_A;
|
||||
p->pandora_jump = -1;
|
||||
p->pandora_autofireButton1 = GP2X_BUTTON_X;
|
||||
}
|
||||
else if(changed_prefs.pandora_joyConf == 2)
|
||||
else if(p->pandora_joyConf == 2)
|
||||
{
|
||||
changed_prefs.pandora_button1 = GP2X_BUTTON_Y;
|
||||
changed_prefs.pandora_button2 = GP2X_BUTTON_A;
|
||||
changed_prefs.pandora_jump = GP2X_BUTTON_X;
|
||||
changed_prefs.pandora_autofireButton1 = GP2X_BUTTON_B;
|
||||
p->pandora_button1 = GP2X_BUTTON_Y;
|
||||
p->pandora_button2 = GP2X_BUTTON_A;
|
||||
p->pandora_jump = GP2X_BUTTON_X;
|
||||
p->pandora_autofireButton1 = GP2X_BUTTON_B;
|
||||
}
|
||||
else if(changed_prefs.pandora_joyConf == 3)
|
||||
{
|
||||
changed_prefs.pandora_button1 = GP2X_BUTTON_B;
|
||||
changed_prefs.pandora_button2 = GP2X_BUTTON_A;
|
||||
changed_prefs.pandora_jump = GP2X_BUTTON_X;
|
||||
changed_prefs.pandora_autofireButton1 = GP2X_BUTTON_Y;
|
||||
p->pandora_button1 = GP2X_BUTTON_B;
|
||||
p->pandora_button2 = GP2X_BUTTON_A;
|
||||
p->pandora_jump = GP2X_BUTTON_X;
|
||||
p->pandora_autofireButton1 = GP2X_BUTTON_Y;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
void inputmode_init(void);
|
||||
void inputmode_redraw(void);
|
||||
|
||||
void set_joyConf(void);
|
||||
void set_joyConf(struct uae_prefs *p);
|
||||
|
||||
extern int show_inputmode;
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "sd-pandora/sound.h"
|
||||
#include "custom.h"
|
||||
#include "od-pandora/gp2x.h"
|
||||
#include "cfgfile.h"
|
||||
#include "uae.h"
|
||||
#include "disk.h"
|
||||
#include "../inputmode.h"
|
||||
|
@ -305,13 +304,6 @@ static void SetPresetMode(int mode, struct uae_prefs *p)
|
|||
|
||||
static void SetDefaultMenuSettings(struct uae_prefs *p)
|
||||
{
|
||||
int i;
|
||||
|
||||
free_mountinfo();
|
||||
for(i=0; i<MOUNT_CONFIG_SIZE; ++i)
|
||||
kill_filesys_unitconfig(p, i);
|
||||
p->mountitems = 0;
|
||||
|
||||
kickstart = 1;
|
||||
|
||||
SetPresetMode(2, p);
|
||||
|
@ -504,12 +496,11 @@ int loadconfig_old(struct uae_prefs *p, const char *orgpath)
|
|||
fscanf(f,"custom_L=%d\n",&p->pandora_custom_L);
|
||||
fscanf(f,"custom_R=%d\n",&p->pandora_custom_R);
|
||||
fscanf(f,"cpu=%d\n", &cpu_level);
|
||||
if(cpu_level > M68000)
|
||||
if(cpu_level > 0) // M68000
|
||||
// Was old format
|
||||
cpu_level = M68020;
|
||||
cpu_level = 2; // M68020
|
||||
fscanf(f,"chipset=%d\n", &p->chipset_mask);
|
||||
p->immediate_blits = (p->chipset_mask & 0x100) == 0x100;
|
||||
p->pandora_partial_blits = (p->chipset_mask & 0x200) == 0x200;
|
||||
switch (p->chipset_mask & 0xff)
|
||||
{
|
||||
case 1: p->chipset_mask = CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE; break;
|
||||
|
@ -528,7 +519,7 @@ int loadconfig_old(struct uae_prefs *p, const char *orgpath)
|
|||
if(p->m68k_speed >= 2)
|
||||
{
|
||||
// 1200: set to 68020 with 14 MHz
|
||||
cpu_level = M68020;
|
||||
cpu_level = 2; // M68020
|
||||
p->m68k_speed--;
|
||||
if(p->m68k_speed > 2)
|
||||
p->m68k_speed = 2;
|
||||
|
@ -570,14 +561,20 @@ int loadconfig_old(struct uae_prefs *p, const char *orgpath)
|
|||
disk_eject(3);
|
||||
fscanf(f,"df0=%s\n",&filebuffer);
|
||||
replace(filebuffer,' ','|');
|
||||
strcpy(p->df[0], filebuffer);
|
||||
if(DISK_validate_filename(filebuffer, 0, NULL, NULL))
|
||||
strcpy(p->df[0], filebuffer);
|
||||
else
|
||||
p->df[0][0] = 0;
|
||||
disk_insert(0, filebuffer);
|
||||
if(p->nr_floppies > 1)
|
||||
{
|
||||
memset(filebuffer, 0, 256);
|
||||
fscanf(f,"df1=%s\n",&filebuffer);
|
||||
replace(filebuffer,' ','|');
|
||||
strcpy(p->df[1], filebuffer);
|
||||
if(DISK_validate_filename(filebuffer, 0, NULL, NULL))
|
||||
strcpy(p->df[1], filebuffer);
|
||||
else
|
||||
p->df[1][0] = 0;
|
||||
disk_insert(1, filebuffer);
|
||||
}
|
||||
if(p->nr_floppies > 2)
|
||||
|
@ -585,7 +582,10 @@ int loadconfig_old(struct uae_prefs *p, const char *orgpath)
|
|||
memset(filebuffer, 0, 256);
|
||||
fscanf(f,"df2=%s\n",&filebuffer);
|
||||
replace(filebuffer,' ','|');
|
||||
strcpy(p->df[2], filebuffer);
|
||||
if(DISK_validate_filename(filebuffer, 0, NULL, NULL))
|
||||
strcpy(p->df[2], filebuffer);
|
||||
else
|
||||
p->df[2][0] = 0;
|
||||
disk_insert(2, filebuffer);
|
||||
}
|
||||
if(p->nr_floppies > 3)
|
||||
|
@ -593,7 +593,10 @@ int loadconfig_old(struct uae_prefs *p, const char *orgpath)
|
|||
memset(filebuffer, 0, 256);
|
||||
fscanf(f,"df3=%s\n",&filebuffer);
|
||||
replace(filebuffer,' ','|');
|
||||
strcpy(p->df[3], filebuffer);
|
||||
if(DISK_validate_filename(filebuffer, 0, NULL, NULL))
|
||||
strcpy(p->df[3], filebuffer);
|
||||
else
|
||||
p->df[3][0] = 0;
|
||||
disk_insert(3, filebuffer);
|
||||
}
|
||||
|
||||
|
@ -656,7 +659,7 @@ int loadconfig_old(struct uae_prefs *p, const char *orgpath)
|
|||
SetPresetMode(presetModeId, p);
|
||||
|
||||
CheckKickstart(p);
|
||||
set_joyConf();
|
||||
set_joyConf(p);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "autoconf.h"
|
||||
#include "uae.h"
|
||||
#include "options.h"
|
||||
#include "td-sdl/thread.h"
|
||||
#include "gui.h"
|
||||
#include "events.h"
|
||||
#include "memory.h"
|
||||
|
@ -32,6 +33,9 @@
|
|||
#include "joystick.h"
|
||||
#include "disk.h"
|
||||
#include "savestate.h"
|
||||
#include "newcpu.h"
|
||||
#include "traps.h"
|
||||
#include "native2amiga.h"
|
||||
#include <SDL.h>
|
||||
#include "gp2x.h"
|
||||
|
||||
|
@ -72,6 +76,52 @@ static int lastCpuSpeed = 600;
|
|||
extern "C" int main( int argc, char *argv[] );
|
||||
|
||||
|
||||
void reinit_amiga(void)
|
||||
{
|
||||
write_log("reinit_amiga() called\n");
|
||||
DISK_free ();
|
||||
memory_cleanup ();
|
||||
#ifdef FILESYS
|
||||
filesys_cleanup ();
|
||||
#endif
|
||||
#ifdef AUTOCONFIG
|
||||
expansion_cleanup ();
|
||||
#endif
|
||||
|
||||
currprefs = changed_prefs;
|
||||
/* force sound settings change */
|
||||
currprefs.produce_sound = 0;
|
||||
|
||||
framecnt = 1;
|
||||
#ifdef AUTOCONFIG
|
||||
rtarea_setup ();
|
||||
#endif
|
||||
#ifdef FILESYS
|
||||
rtarea_init ();
|
||||
hardfile_install();
|
||||
#endif
|
||||
|
||||
#ifdef AUTOCONFIG
|
||||
expansion_init ();
|
||||
#endif
|
||||
#ifdef FILESYS
|
||||
filesys_install ();
|
||||
#endif
|
||||
memory_init ();
|
||||
memory_reset ();
|
||||
|
||||
#ifdef AUTOCONFIG
|
||||
emulib_install ();
|
||||
native2amiga_install ();
|
||||
#endif
|
||||
|
||||
custom_init (); /* Must come after memory_init */
|
||||
DISK_init ();
|
||||
|
||||
init_m68k();
|
||||
}
|
||||
|
||||
|
||||
void sleep_millis (int ms)
|
||||
{
|
||||
usleep(ms * 1000);
|
||||
|
@ -119,6 +169,12 @@ void logging_cleanup( void )
|
|||
}
|
||||
|
||||
|
||||
uae_u8 *target_load_keyfile (struct uae_prefs *p, char *path, int *sizep, char *name)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void target_quit (void)
|
||||
{
|
||||
}
|
||||
|
@ -134,7 +190,6 @@ void target_default_options (struct uae_prefs *p, int type)
|
|||
p->pandora_horizontal_offset = 0;
|
||||
p->pandora_vertical_offset = 0;
|
||||
p->pandora_cpu_speed = 600;
|
||||
p->pandora_partial_blits = 0;
|
||||
|
||||
p->pandora_joyConf = 0;
|
||||
p->pandora_joyPort = 0;
|
||||
|
@ -167,7 +222,6 @@ void target_default_options (struct uae_prefs *p, int type)
|
|||
|
||||
void target_save_options (struct zfile *f, struct uae_prefs *p)
|
||||
{
|
||||
cfgfile_write (f, "pandora.blitter_in_partial_mode=%d\n", p->pandora_partial_blits);
|
||||
cfgfile_write (f, "pandora.cpu_speed=%d\n", p->pandora_cpu_speed);
|
||||
cfgfile_write (f, "pandora.joy_conf=%d\n", p->pandora_joyConf);
|
||||
cfgfile_write (f, "pandora.joy_port=%d\n", p->pandora_joyPort);
|
||||
|
@ -196,8 +250,7 @@ void target_save_options (struct zfile *f, struct uae_prefs *p)
|
|||
|
||||
int target_parse_option (struct uae_prefs *p, char *option, char *value)
|
||||
{
|
||||
int result = (cfgfile_intval (option, value, "blitter_in_partial_mode", &p->pandora_partial_blits, 1)
|
||||
|| cfgfile_intval (option, value, "cpu_speed", &p->pandora_cpu_speed, 1)
|
||||
int result = (cfgfile_intval (option, value, "cpu_speed", &p->pandora_cpu_speed, 1)
|
||||
|| cfgfile_intval (option, value, "joy_conf", &p->pandora_joyConf, 1)
|
||||
|| cfgfile_intval (option, value, "joy_port", &p->pandora_joyPort, 1)
|
||||
|| cfgfile_intval (option, value, "stylus_offset", &p->pandora_stylusOffset, 1)
|
||||
|
@ -224,6 +277,13 @@ int target_parse_option (struct uae_prefs *p, char *option, char *value)
|
|||
}
|
||||
|
||||
|
||||
void fetch_saveimagepath (char *out, int size, int dir)
|
||||
{
|
||||
strncpy(out, start_path_data, size);
|
||||
strncat(out, "/savestates/", size);
|
||||
}
|
||||
|
||||
|
||||
void fetch_configurationpath (char *out, int size)
|
||||
{
|
||||
strncpy(out, config_path, size);
|
||||
|
@ -267,11 +327,11 @@ int target_cfgfile_load (struct uae_prefs *p, char *filename, int type, int isde
|
|||
int i;
|
||||
int result = 0;
|
||||
|
||||
free_mountinfo();
|
||||
for(i=0; i<MOUNT_CONFIG_SIZE; ++i)
|
||||
kill_filesys_unitconfig(p, i);
|
||||
p->mountitems = 0;
|
||||
|
||||
filesys_prepare_reset();
|
||||
while(p->mountitems > 0)
|
||||
kill_filesys_unitconfig(p, 0);
|
||||
discard_prefs(p, type);
|
||||
|
||||
char *ptr = strstr(filename, ".uae");
|
||||
if(ptr > 0)
|
||||
{
|
||||
|
@ -280,7 +340,7 @@ int target_cfgfile_load (struct uae_prefs *p, char *filename, int type, int isde
|
|||
}
|
||||
if(result)
|
||||
{
|
||||
set_joyConf();
|
||||
set_joyConf(p);
|
||||
extractFileName(filename, last_loaded_config);
|
||||
}
|
||||
else
|
||||
|
@ -288,8 +348,11 @@ int target_cfgfile_load (struct uae_prefs *p, char *filename, int type, int isde
|
|||
|
||||
if(result)
|
||||
{
|
||||
for(int i=0; i < p->nr_floppies; ++i)
|
||||
for(i=0; i < p->nr_floppies; ++i)
|
||||
{
|
||||
if(!DISK_validate_filename(p->df[i], 0, NULL, NULL))
|
||||
p->df[i][0] = 0;
|
||||
disk_insert(i, p->df[i]);
|
||||
if(strlen(p->df[i]) > 0)
|
||||
AddFileToDiskList(p->df[i], 1);
|
||||
}
|
||||
|
@ -595,6 +658,7 @@ int main (int argc, char *argv[])
|
|||
}
|
||||
|
||||
alloc_AmigaMem();
|
||||
RescanROMs();
|
||||
real_main (argc, argv);
|
||||
free_AmigaMem();
|
||||
|
||||
|
|
|
@ -187,6 +187,7 @@ static void open_screen(struct uae_prefs *p)
|
|||
}
|
||||
if(prSDLScreen != NULL)
|
||||
{
|
||||
InitAmigaVidMode(p);
|
||||
init_row_map();
|
||||
}
|
||||
}
|
||||
|
@ -198,7 +199,6 @@ void update_display(struct uae_prefs *p)
|
|||
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
|
||||
InitAmigaVidMode(p);
|
||||
framecnt = 1; // Don't draw frame before reset done
|
||||
}
|
||||
|
||||
|
@ -248,7 +248,7 @@ void unlockscr (void)
|
|||
SDL_UnlockSurface(prSDLScreen);
|
||||
}
|
||||
|
||||
void flush_block ()
|
||||
void flush_screen ()
|
||||
{
|
||||
if (show_inputmode)
|
||||
inputmode_redraw();
|
||||
|
@ -278,6 +278,7 @@ void flush_block ()
|
|||
{
|
||||
SDL_Flip(prSDLScreen);
|
||||
last_synctime = read_processor_time();
|
||||
gfxvidinfo.bufmem = (uae_u8 *)prSDLScreen->pixels;
|
||||
}
|
||||
|
||||
if(last_synctime - next_synctime > time_per_frame - 1000)
|
||||
|
@ -349,8 +350,6 @@ static void graphics_subinit (void)
|
|||
|
||||
InitAmigaVidMode(&currprefs);
|
||||
}
|
||||
lastmx = lastmy = 0;
|
||||
newmousecounters = 0;
|
||||
}
|
||||
|
||||
STATIC_INLINE int bitsInMask (unsigned long mask)
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#include "keyboard.h"
|
||||
#include "disk.h"
|
||||
#include "savestate.h"
|
||||
#include "filesys.h"
|
||||
#include "autoconf.h"
|
||||
#include <SDL.h>
|
||||
|
||||
|
||||
|
@ -56,6 +58,7 @@ struct gui_msg {
|
|||
const char *msg;
|
||||
};
|
||||
struct gui_msg gui_msglist[] = {
|
||||
{ NUMSG_NEEDEXT2, "The software uses a non-standard floppy disk format. You may need to use a custom floppy disk image file instead of a standard one. This message will not appear again." },
|
||||
{ NUMSG_NOROM, "Could not load system ROM, trying system ROM replacement." },
|
||||
{ NUMSG_NOROMKEY, "Could not find system ROM key file." },
|
||||
{ NUMSG_KSROMCRCERROR, "System ROM checksum incorrect. The system ROM image file may be corrupt." },
|
||||
|
@ -112,8 +115,10 @@ static void ClearAvailableROMList(void)
|
|||
static void addrom(struct romdata *rd, char *path)
|
||||
{
|
||||
AvailableROM *tmp;
|
||||
char tmpName[MAX_DPATH];
|
||||
tmp = new AvailableROM();
|
||||
strncpy(tmp->Name, rd->name, MAX_PATH);
|
||||
getromname(rd, tmpName);
|
||||
strncpy(tmp->Name, tmpName, MAX_PATH);
|
||||
strncpy(tmp->Path, path, MAX_PATH);
|
||||
tmp->ROMType = rd->type;
|
||||
lstAvailableROMs.push_back(tmp);
|
||||
|
@ -124,7 +129,7 @@ struct romscandata {
|
|||
int keysize;
|
||||
};
|
||||
|
||||
static struct romdata *scan_single_rom_2 (struct zfile *f, uae_u8 *keybuf, int keysize)
|
||||
static struct romdata *scan_single_rom_2 (struct zfile *f)
|
||||
{
|
||||
uae_u8 buffer[20] = { 0 };
|
||||
uae_u8 *rombuf;
|
||||
|
@ -143,8 +148,6 @@ static struct romdata *scan_single_rom_2 (struct zfile *f, uae_u8 *keybuf, int k
|
|||
size = 262144;
|
||||
} else if (!memcmp (buffer, "AMIROMTYPE1", 11)) {
|
||||
cl = 1;
|
||||
if (keybuf == 0)
|
||||
cl = -1;
|
||||
size -= 11;
|
||||
} else {
|
||||
zfile_fseek (f, 0, SEEK_SET);
|
||||
|
@ -154,8 +157,8 @@ static struct romdata *scan_single_rom_2 (struct zfile *f, uae_u8 *keybuf, int k
|
|||
return 0;
|
||||
zfile_fread (rombuf, 1, size, f);
|
||||
if (cl > 0) {
|
||||
decode_cloanto_rom_do (rombuf, size, size, keybuf, keysize);
|
||||
cl = 0;
|
||||
if(decode_cloanto_rom_do (rombuf, size, size))
|
||||
cl = 0;
|
||||
}
|
||||
if (!cl)
|
||||
rd = getromdatabydata (rombuf, size);
|
||||
|
@ -163,11 +166,30 @@ static struct romdata *scan_single_rom_2 (struct zfile *f, uae_u8 *keybuf, int k
|
|||
return rd;
|
||||
}
|
||||
|
||||
static struct romdata *scan_single_rom (char *path)
|
||||
{
|
||||
struct zfile *z;
|
||||
char tmp[MAX_DPATH];
|
||||
struct romdata *rd;
|
||||
|
||||
strcpy (tmp, path);
|
||||
rd = getromdatabypath(path);
|
||||
if (rd && rd->crc32 == 0xffffffff)
|
||||
return rd;
|
||||
z = zfile_fopen (path, "rb");
|
||||
if (!z)
|
||||
return 0;
|
||||
return scan_single_rom_2 (z);
|
||||
}
|
||||
|
||||
static int isromext(char *path)
|
||||
{
|
||||
char *ext = strrchr (path, '.');
|
||||
char *ext;
|
||||
int i;
|
||||
|
||||
if (!path)
|
||||
return 0;
|
||||
ext = strrchr (path, '.');
|
||||
if (!ext)
|
||||
return 0;
|
||||
ext++;
|
||||
|
@ -182,23 +204,22 @@ static int isromext(char *path)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int scan_rom_2 (struct zfile *f, void *rsd)
|
||||
static int scan_rom_2 (struct zfile *f, void *dummy)
|
||||
{
|
||||
char *path = zfile_getname(f);
|
||||
struct romdata *rd;
|
||||
|
||||
if (!isromext(path))
|
||||
return 0;
|
||||
rd = scan_single_rom_2(f, ((struct romscandata *)rsd)->keybuf, ((struct romscandata *)rsd)->keysize);
|
||||
rd = scan_single_rom_2(f);
|
||||
if (rd)
|
||||
addrom (rd, path);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void scan_rom(char *path, uae_u8 *keybuf, int keysize)
|
||||
static void scan_rom(char *path)
|
||||
{
|
||||
struct romdata *rd;
|
||||
struct romscandata rsd = { keybuf, keysize };
|
||||
|
||||
if (!isromext(path)) {
|
||||
//write_log("ROMSCAN: skipping file '%s', unknown extension\n", path);
|
||||
|
@ -208,30 +229,27 @@ static void scan_rom(char *path, uae_u8 *keybuf, int keysize)
|
|||
if (rd)
|
||||
addrom(rd, path);
|
||||
else
|
||||
zfile_zopen (path, scan_rom_2, &rsd);
|
||||
zfile_zopen (path, scan_rom_2, 0);
|
||||
}
|
||||
|
||||
|
||||
void RescanROMs(void)
|
||||
{
|
||||
int keysize;
|
||||
uae_u8 *keybuf;
|
||||
std::vector<std::string> files;
|
||||
char path[MAX_DPATH];
|
||||
|
||||
ClearAvailableROMList();
|
||||
fetch_rompath(path, MAX_DPATH);
|
||||
|
||||
keybuf = load_keyfile (&changed_prefs, path, &keysize);
|
||||
load_keyring(&changed_prefs, path);
|
||||
ReadDirectory(path, NULL, &files);
|
||||
for(int i=0; i<files.size(); ++i)
|
||||
{
|
||||
char tmppath[MAX_PATH];
|
||||
strncpy(tmppath, path, MAX_PATH);
|
||||
strncat(tmppath, files[i].c_str(), MAX_PATH);
|
||||
scan_rom (tmppath, keybuf, keysize);
|
||||
scan_rom (tmppath);
|
||||
}
|
||||
free_keyfile (keybuf);
|
||||
}
|
||||
|
||||
static void ClearConfigFileList(void)
|
||||
|
@ -327,7 +345,7 @@ static void gui_to_prefs (void)
|
|||
int gui_init (void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
|
||||
#ifndef ANDROIDSDL
|
||||
SDL_JoystickEventState(SDL_ENABLE);
|
||||
SDL_JoystickOpen(0);
|
||||
|
@ -610,13 +628,7 @@ void gui_handle_events (void)
|
|||
|
||||
else if(triggerL)
|
||||
{
|
||||
if(keystate[SDLK_a])
|
||||
{
|
||||
keystate[SDLK_a]=0;
|
||||
currprefs.m68k_speed == 2 ? changed_prefs.m68k_speed = 0 : changed_prefs.m68k_speed++;
|
||||
check_prefs_changed_cpu();
|
||||
}
|
||||
else if(keystate[SDLK_c])
|
||||
if(keystate[SDLK_c])
|
||||
{
|
||||
keystate[SDLK_c]=0;
|
||||
currprefs.pandora_customControls = !currprefs.pandora_customControls;
|
||||
|
@ -1377,3 +1389,50 @@ void FilterFiles(std::vector<std::string> *files, const char *filter[])
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool DevicenameExists(const char *name)
|
||||
{
|
||||
int i;
|
||||
struct uaedev_config_info *uci;
|
||||
|
||||
for(i=0; i<MAX_HD_DEVICES; ++i)
|
||||
{
|
||||
uci = &changed_prefs.mountconfig[i];
|
||||
|
||||
if(uci->devname && uci->devname[0])
|
||||
{
|
||||
if(!strcmp(uci->devname, name))
|
||||
return true;
|
||||
if(uci->volname != 0 && !strcmp(uci->volname, name))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void CreateDefaultDevicename(char *name)
|
||||
{
|
||||
int freeNum = 0;
|
||||
bool foundFree = false;
|
||||
|
||||
while(!foundFree && freeNum < 10)
|
||||
{
|
||||
sprintf(name, "DH%d", freeNum);
|
||||
foundFree = !DevicenameExists(name);
|
||||
++freeNum;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int tweakbootpri (int bp, int ab, int dnm)
|
||||
{
|
||||
if (dnm)
|
||||
return -129;
|
||||
if (!ab)
|
||||
return -128;
|
||||
if (bp < -127)
|
||||
bp = -127;
|
||||
return bp;
|
||||
}
|
||||
|
|
|
@ -652,7 +652,7 @@ void picasso_handle_vsync (void)
|
|||
palette_changed = 0;
|
||||
}
|
||||
|
||||
flush_block ();
|
||||
flush_screen ();
|
||||
}
|
||||
|
||||
static int set_panning_called = 0;
|
||||
|
@ -1019,7 +1019,7 @@ static void FillBoardInfo (uaecptr amigamemptr, struct LibResolution *res, struc
|
|||
put_byte (amigamemptr + PSSO_ModeInfo_second_union, 14);
|
||||
|
||||
put_long (amigamemptr + PSSO_ModeInfo_PixelClock,
|
||||
dm->res.width * dm->res.height * (currprefs.gfx_refreshrate ? abs (currprefs.gfx_refreshrate) : 50));
|
||||
dm->res.width * dm->res.height * (currprefs.ntscmode ? 60 : 50));
|
||||
}
|
||||
|
||||
struct modeids {
|
||||
|
|
|
@ -1,3 +1,64 @@
|
|||
|
||||
#define SUPPORT_THREADS
|
||||
#define MAX_DPATH 256
|
||||
|
||||
/* #define DRIVESOUND */
|
||||
/* #define GFXFILTER */
|
||||
|
||||
/* #define DEBUGGER */
|
||||
#define FILESYS /* filesys emulation */
|
||||
#define UAE_FILESYS_THREADS
|
||||
#define AUTOCONFIG /* autoconfig support, fast ram, harddrives etc.. */
|
||||
#define JIT /* JIT compiler support */
|
||||
/* #define NATMEM_OFFSET natmem_offset */
|
||||
/* #define CATWEASEL */ /* Catweasel MK2/3 support */
|
||||
/* #define AHI */ /* AHI sound emulation */
|
||||
/* #define ENFORCER */ /* UAE Enforcer */
|
||||
#define ECS_DENISE /* ECS DENISE new features */
|
||||
#define AGA /* AGA chipset emulation (ECS_DENISE must be enabled) */
|
||||
/* #define CD32 */ /* CD32 emulation */
|
||||
/* #define CDTV */ /* CDTV emulation */
|
||||
/* #define PARALLEL_PORT */ /* parallel port emulation */
|
||||
/* #define SERIAL_PORT */ /* serial port emulation */
|
||||
/* #define SCSIEMU */ /* uaescsi.device emulation */
|
||||
/* #define UAESERIAL */ /* uaeserial.device emulation */
|
||||
#define FPUEMU /* FPU emulation */
|
||||
/* #define FPU_UAE */
|
||||
/* #define MMUEMU */
|
||||
#define CPUEMU_0 /* generic 680x0 emulation */
|
||||
#define CPUEMU_11 /* 68000+prefetch emulation */
|
||||
/* #define CPUEMU_12 */ /* cycle-exact cpu&blitter */
|
||||
/* #define ACTION_REPLAY */ /* Action Replay 1/2/3 support */
|
||||
#if !defined(RASPBERRY)
|
||||
#define PICASSO96 /* Picasso96 display card emulation */
|
||||
#endif
|
||||
/* #define BSDSOCKET */ /* bsdsocket.library emulation */
|
||||
/* #define CAPS */ /* CAPS-image support */
|
||||
/* #define FDI2RAW */ /* FDI 1.0 and 2.x image support */
|
||||
/* #define AVIOUTPUT */ /* Avioutput support */
|
||||
/* #define PROWIZARD */ /* Pro-Wizard module ripper */
|
||||
/* #define ARCADIA */ /* Arcadia arcade system */
|
||||
/* #define ARCHIVEACCESS */ /* ArchiveAccess decompression library */
|
||||
/* #define LOGITECHLCD */ /* Logitech G15 LCD */
|
||||
#define SAVESTATE /* State file support */
|
||||
/* #define A2091 */ /* A590/A2091 SCSI */
|
||||
/* #define NCR */ /* A4000T/A4091 SCSI */
|
||||
/* #define SANA2 */ /* SANA2 network driver */
|
||||
/* #define AMAX */ /* A-Max ROM adapater emulation */
|
||||
/* #define RETROPLATFORM */ /* Cloanto RetroPlayer support */
|
||||
|
||||
/* #define INPUT_RECORDER */ /* Use input recoder */
|
||||
|
||||
/* #define CUSTOM_SIMPLE */ /* simplified custom chipset emulation */
|
||||
/* #define CPUEMU_68000_ONLY */ /* drop 68010+ commands from CPUEMU_0 */
|
||||
/* #define ADDRESS_SPACE_24BIT */
|
||||
|
||||
#define SIZEOF_VOID_P 4
|
||||
|
||||
#if !defined(AHI)
|
||||
#undef ENFORCER
|
||||
#endif
|
||||
|
||||
/* src/sysconfig.h. Generated automatically by configure. */
|
||||
/* src/sysconfig.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
|
@ -144,8 +205,6 @@
|
|||
#define SIZEOF_FLOAT 4
|
||||
#define SIZEOF_DOUBLE 8
|
||||
|
||||
#define SIZEOF_VOID_P 4
|
||||
|
||||
#define HAVE_ISNAN
|
||||
#undef HAVE_ISINF
|
||||
|
||||
|
@ -260,9 +319,6 @@
|
|||
/* Define if you have the <dirent.h> header file. */
|
||||
#define HAVE_DIRENT_H 1
|
||||
|
||||
/* Define if you have the <dmedia/audio.h> header file. */
|
||||
/* #undef HAVE_DMEDIA_AUDIO_H */
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
|
@ -272,6 +328,9 @@
|
|||
/* Define if you have the <getopt.h> header file. */
|
||||
#define HAVE_GETOPT_H 1
|
||||
|
||||
/* Define if you have the <ggi/libggi.h> header file. */
|
||||
/* #undef HAVE_GGI_LIBGGI_H */
|
||||
|
||||
/* Define if you have the <libraries/cybergraphics.h> header file. */
|
||||
/* #undef HAVE_LIBRARIES_CYBERGRAPHICS_H */
|
||||
|
||||
|
@ -388,7 +447,6 @@
|
|||
#ifndef MAX_PATH
|
||||
#define MAX_PATH 256
|
||||
#endif
|
||||
#define MAX_DPATH 256
|
||||
|
||||
#define WORDS_BIGENDIAN 1
|
||||
|
||||
|
|
|
@ -1,22 +1,17 @@
|
|||
/*
|
||||
* UAE - The Un*x Amiga Emulator
|
||||
*
|
||||
* Target specific stuff
|
||||
* Target specific stuff, Pandora version
|
||||
*
|
||||
* Copyright 1997 Bernd Schmidt
|
||||
*/
|
||||
|
||||
#define TARGET_NAME "pandora"
|
||||
|
||||
#define NO_MAIN_IN_MAIN_C
|
||||
|
||||
#define OPTIONSFILENAME "uaeconfig"
|
||||
|
||||
/* Just 0x0 and not 680x0, so that constants can fit in ARM instructions */
|
||||
#define M68000 0
|
||||
#define M68020 2
|
||||
|
||||
#define SIMULATE_SHIFT 0x200
|
||||
#define SIMULATE_RELEASED_SHIFT 0x400
|
||||
|
||||
extern int emulating;
|
||||
extern int uae4all_keystate[256];
|
||||
extern int stylusAdjustX;
|
||||
|
@ -33,3 +28,6 @@ void graphics_subshutdown (void);
|
|||
void pandora_stop_sound(void);
|
||||
|
||||
void keyboard_init(void);
|
||||
|
||||
void reinit_amiga(void);
|
||||
int count_HDs(struct uae_prefs *p);
|
||||
|
|
|
@ -11,6 +11,17 @@
|
|||
#define WRITE_LOG_BUF_SIZE 4096
|
||||
FILE *debugfile = NULL;
|
||||
|
||||
void console_out (const char *format,...)
|
||||
{
|
||||
va_list parms;
|
||||
char buffer[WRITE_LOG_BUF_SIZE];
|
||||
|
||||
va_start (parms, format);
|
||||
vsnprintf (buffer, WRITE_LOG_BUF_SIZE-1, format, parms);
|
||||
va_end (parms);
|
||||
printf(buffer);
|
||||
}
|
||||
|
||||
#ifdef WITH_LOGGING
|
||||
|
||||
void write_log (const char *format,...)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue