Align with latest TomB version
This commit is contained in:
parent
a551f1e3a9
commit
97082274cf
167 changed files with 50559 additions and 25948 deletions
|
@ -20,13 +20,14 @@
|
|||
#include "gui_handling.h"
|
||||
|
||||
|
||||
#define DIALOG_WIDTH 520
|
||||
#define DIALOG_WIDTH 620
|
||||
#define DIALOG_HEIGHT 242
|
||||
|
||||
static const char *harddisk_filter[] = { ".hdf", "\0" };
|
||||
|
||||
static bool dialogResult = false;
|
||||
static bool dialogFinished = false;
|
||||
static bool fileSelected = false;
|
||||
|
||||
static gcn::Window *wndEditFilesysHardfile;
|
||||
static gcn::Button* cmdOK;
|
||||
|
@ -60,7 +61,10 @@ class FilesysHardfileActionListener : public gcn::ActionListener
|
|||
strncpy(tmp, txtPath->getText().c_str(), MAX_PATH);
|
||||
wndEditFilesysHardfile->releaseModalFocus();
|
||||
if(SelectFile("Select harddisk file", tmp, harddisk_filter))
|
||||
{
|
||||
txtPath->setText(tmp);
|
||||
fileSelected = true;
|
||||
}
|
||||
wndEditFilesysHardfile->requestModalFocus();
|
||||
cmdPath->requestFocus();
|
||||
}
|
||||
|
@ -68,7 +72,7 @@ class FilesysHardfileActionListener : public gcn::ActionListener
|
|||
{
|
||||
if (actionEvent.getSource() == cmdOK)
|
||||
{
|
||||
if(txtDevice->getText().length() <= 0)
|
||||
if(txtDevice->getText().length() <= 0 || !fileSelected)
|
||||
{
|
||||
// ToDo: Message to user
|
||||
return;
|
||||
|
@ -118,35 +122,35 @@ static void InitEditFilesysHardfile(void)
|
|||
chkReadWrite->setId("hdfRW");
|
||||
|
||||
lblBootPri = new gcn::Label("Boot priority:");
|
||||
lblBootPri->setSize(84, LABEL_HEIGHT);
|
||||
lblBootPri->setSize(100, LABEL_HEIGHT);
|
||||
lblBootPri->setAlignment(gcn::Graphics::RIGHT);
|
||||
txtBootPri = new gcn::TextField();
|
||||
txtBootPri->setSize(40, TEXTFIELD_HEIGHT);
|
||||
txtBootPri->setId("hdfBootPri");
|
||||
|
||||
lblSurfaces = new gcn::Label("Surfaces:");
|
||||
lblSurfaces->setSize(84, LABEL_HEIGHT);
|
||||
lblSurfaces->setSize(100, LABEL_HEIGHT);
|
||||
lblSurfaces->setAlignment(gcn::Graphics::RIGHT);
|
||||
txtSurfaces = new gcn::TextField();
|
||||
txtSurfaces->setSize(40, TEXTFIELD_HEIGHT);
|
||||
txtSurfaces->setId("hdfSurface");
|
||||
|
||||
lblReserved = new gcn::Label("Reserved:");
|
||||
lblReserved->setSize(84, LABEL_HEIGHT);
|
||||
lblReserved->setSize(100, LABEL_HEIGHT);
|
||||
lblReserved->setAlignment(gcn::Graphics::RIGHT);
|
||||
txtReserved = new gcn::TextField();
|
||||
txtReserved->setSize(40, TEXTFIELD_HEIGHT);
|
||||
txtReserved->setId("hdfReserved");
|
||||
|
||||
lblSectors = new gcn::Label("Sectors:");
|
||||
lblSectors->setSize(84, LABEL_HEIGHT);
|
||||
lblSectors->setSize(100, LABEL_HEIGHT);
|
||||
lblSectors->setAlignment(gcn::Graphics::RIGHT);
|
||||
txtSectors = new gcn::TextField();
|
||||
txtSectors->setSize(40, TEXTFIELD_HEIGHT);
|
||||
txtSectors->setId("hdfSectors");
|
||||
|
||||
lblBlocksize = new gcn::Label("Blocksize:");
|
||||
lblBlocksize->setSize(84, LABEL_HEIGHT);
|
||||
lblBlocksize->setSize(100, LABEL_HEIGHT);
|
||||
lblBlocksize->setAlignment(gcn::Graphics::RIGHT);
|
||||
txtBlocksize = new gcn::TextField();
|
||||
txtBlocksize->setSize(40, TEXTFIELD_HEIGHT);
|
||||
|
@ -156,7 +160,7 @@ static void InitEditFilesysHardfile(void)
|
|||
lblPath->setSize(100, LABEL_HEIGHT);
|
||||
lblPath->setAlignment(gcn::Graphics::RIGHT);
|
||||
txtPath = new gcn::TextField();
|
||||
txtPath->setSize(338, TEXTFIELD_HEIGHT);
|
||||
txtPath->setSize(438, TEXTFIELD_HEIGHT);
|
||||
txtPath->setEnabled(false);
|
||||
cmdPath = new gcn::Button("...");
|
||||
cmdPath->setSize(SMALL_BUTTON_WIDTH, SMALL_BUTTON_HEIGHT);
|
||||
|
@ -288,11 +292,10 @@ static void EditFilesysHardfileLoop(void)
|
|||
|
||||
bool EditFilesysHardfile(int unit_no)
|
||||
{
|
||||
char *volname, *devname, *rootdir, *filesys;
|
||||
int secspertrack, surfaces, cylinders, reserved, blocksize, readonly, bootpri;
|
||||
uae_u64 size;
|
||||
const char *failure;
|
||||
|
||||
struct mountedinfo mi;
|
||||
struct uaedev_config_info *uci = &changed_prefs.mountconfig[unit_no];
|
||||
std::string strdevname, strroot;
|
||||
|
||||
dialogResult = false;
|
||||
dialogFinished = false;
|
||||
|
||||
|
@ -302,28 +305,32 @@ bool EditFilesysHardfile(int unit_no)
|
|||
{
|
||||
char tmp[32];
|
||||
|
||||
failure = get_filesys_unit(currprefs.mountinfo, unit_no,
|
||||
&devname, &volname, &rootdir, &readonly, &secspertrack, &surfaces, &reserved,
|
||||
&cylinders, &size, &blocksize, &bootpri, &filesys, 0);
|
||||
get_filesys_unitconfig(&changed_prefs, unit_no, &mi);
|
||||
strdevname.assign(uci->devname);
|
||||
txtDevice->setText(strdevname);
|
||||
strroot.assign(uci->rootdir);
|
||||
txtPath->setText(strroot);
|
||||
fileSelected = true;
|
||||
|
||||
txtDevice->setText(devname);
|
||||
txtPath->setText(rootdir);
|
||||
chkReadWrite->setSelected(!readonly);
|
||||
snprintf(tmp, 32, "%d", bootpri);
|
||||
chkReadWrite->setSelected(!uci->readonly);
|
||||
snprintf(tmp, 32, "%d", uci->bootpri >= -127 ? uci->bootpri : -127);
|
||||
txtBootPri->setText(tmp);
|
||||
snprintf(tmp, 32, "%d", surfaces);
|
||||
snprintf(tmp, 32, "%d", uci->surfaces);
|
||||
txtSurfaces->setText(tmp);
|
||||
snprintf(tmp, 32, "%d", reserved);
|
||||
snprintf(tmp, 32, "%d", uci->reserved);
|
||||
txtReserved->setText(tmp);
|
||||
snprintf(tmp, 32, "%d", secspertrack);
|
||||
snprintf(tmp, 32, "%d", uci->sectors);
|
||||
txtSectors->setText(tmp);
|
||||
snprintf(tmp, 32, "%d", blocksize);
|
||||
snprintf(tmp, 32, "%d", uci->blocksize);
|
||||
txtBlocksize->setText(tmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
txtDevice->setText("");
|
||||
txtPath->setText(currentDir);
|
||||
strroot.assign(currentDir);
|
||||
txtPath->setText(strroot);
|
||||
fileSelected = false;
|
||||
|
||||
chkReadWrite->setSelected(true);
|
||||
txtBootPri->setText("0");
|
||||
txtSurfaces->setText("1");
|
||||
|
@ -336,14 +343,17 @@ bool EditFilesysHardfile(int unit_no)
|
|||
if(dialogResult)
|
||||
{
|
||||
if(unit_no >= 0)
|
||||
kill_filesys_unit(currprefs.mountinfo, unit_no);
|
||||
kill_filesys_unitconfig(&changed_prefs, unit_no);
|
||||
else
|
||||
extractPath((char *) txtPath->getText().c_str(), currentDir);
|
||||
failure = add_filesys_unit(currprefs.mountinfo, (char *) txtDevice->getText().c_str(),
|
||||
|
||||
uci = add_filesys_config(&changed_prefs, -1, (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);
|
||||
atoi(txtBootPri->getText().c_str()), 0, 0, 0);
|
||||
if (uci)
|
||||
hardfile_do_disk_change (uci->configoffset, 1);
|
||||
}
|
||||
return dialogResult;
|
||||
}
|
||||
|
|
|
@ -251,10 +251,9 @@ static void EditFilesysVirtualLoop(void)
|
|||
|
||||
bool EditFilesysVirtual(int unit_no)
|
||||
{
|
||||
char *volname, *devname, *rootdir, *filesys;
|
||||
int secspertrack, surfaces, cylinders, reserved, blocksize, readonly, bootpri;
|
||||
uae_u64 size;
|
||||
const char *failure;
|
||||
struct mountedinfo mi;
|
||||
struct uaedev_config_info *uci = &changed_prefs.mountconfig[unit_no];
|
||||
std::string strdevname, strvolname, strroot;
|
||||
|
||||
dialogResult = false;
|
||||
dialogFinished = false;
|
||||
|
@ -265,22 +264,24 @@ bool EditFilesysVirtual(int unit_no)
|
|||
{
|
||||
char tmp[32];
|
||||
|
||||
failure = get_filesys_unit(currprefs.mountinfo, unit_no,
|
||||
&devname, &volname, &rootdir, &readonly, &secspertrack, &surfaces, &reserved,
|
||||
&cylinders, &size, &blocksize, &bootpri, &filesys, 0);
|
||||
get_filesys_unitconfig(&changed_prefs, unit_no, &mi);
|
||||
|
||||
txtDevice->setText(devname);
|
||||
txtVolume->setText(volname);
|
||||
txtPath->setText(rootdir);
|
||||
chkReadWrite->setSelected(!readonly);
|
||||
snprintf(tmp, 32, "%d", bootpri);
|
||||
strdevname.assign(uci->devname);
|
||||
txtDevice->setText(strdevname);
|
||||
strvolname.assign(uci->volname);
|
||||
txtVolume->setText(strvolname);
|
||||
strroot.assign(uci->rootdir);
|
||||
txtPath->setText(strroot);
|
||||
chkReadWrite->setSelected(!uci->readonly);
|
||||
snprintf(tmp, 32, "%d", uci->bootpri >= -127 ? uci->bootpri : -127);
|
||||
txtBootPri->setText(tmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
txtDevice->setText("");
|
||||
txtVolume->setText("");
|
||||
txtPath->setText(currentDir);
|
||||
strroot.assign(currentDir);
|
||||
txtPath->setText(strroot);
|
||||
chkReadWrite->setSelected(true);
|
||||
txtBootPri->setText("0");
|
||||
}
|
||||
|
@ -291,12 +292,15 @@ bool EditFilesysVirtual(int unit_no)
|
|||
if(dialogResult)
|
||||
{
|
||||
if(unit_no >= 0)
|
||||
kill_filesys_unit(currprefs.mountinfo, unit_no);
|
||||
kill_filesys_unitconfig(&changed_prefs, unit_no);
|
||||
else
|
||||
extractPath((char *) txtPath->getText().c_str(), currentDir);
|
||||
failure = add_filesys_unit(currprefs.mountinfo, (char *) txtDevice->getText().c_str(),
|
||||
|
||||
uci = add_filesys_config(&changed_prefs, -1, (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);
|
||||
!chkReadWrite->isSelected(), 0, 0, 0, 0, atoi(txtBootPri->getText().c_str()), 0, 0, 0);
|
||||
if (uci)
|
||||
filesys_media_change (uci->rootdir, 1, uci);
|
||||
}
|
||||
|
||||
return dialogResult;
|
||||
|
|
|
@ -59,17 +59,21 @@ static NavigationMap navMap[] =
|
|||
|
||||
// active move left move right move up move down
|
||||
// PanelCPU
|
||||
{ "68000", "CPU", "7 Mhz", "JIT", "68010" },
|
||||
{ "68010", "CPU", "14 Mhz", "68000", "68EC020" },
|
||||
{ "68EC020", "CPU", "28 Mhz", "68010", "68020" },
|
||||
{ "68020", "CPU", "Fastest", "68EC020", "68040" },
|
||||
{ "68040", "CPU", "Fastest", "68020", "CPUComp" },
|
||||
{ "CPUComp", "CPU", "Fastest", "68040", "JIT" },
|
||||
{ "JIT", "CPU", "Fastest", "CPUComp", "68000" },
|
||||
{ "7 Mhz", "68000", "CPU", "Fastest", "14 Mhz" },
|
||||
{ "14 Mhz", "68010", "CPU", "7 Mhz", "28 Mhz" },
|
||||
{ "28 Mhz", "68EC020", "CPU", "14 Mhz", "Fastest" },
|
||||
{ "Fastest", "68020", "CPU", "28 Mhz", "7 Mhz" },
|
||||
{ "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" },
|
||||
{ "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" },
|
||||
|
||||
// PanelChipset
|
||||
{ "OCS", "Chipset", "BlitNormal", "CollFull", "ECS" },
|
||||
|
|
|
@ -28,6 +28,7 @@ static gcn::Window *grpFPU;
|
|||
static gcn::UaeRadioButton* optFPUnone;
|
||||
static gcn::UaeRadioButton* optFPU68881;
|
||||
static gcn::UaeRadioButton* optFPU68882;
|
||||
static gcn::UaeRadioButton* optFPUinternal;
|
||||
static gcn::Window *grpCPUSpeed;
|
||||
static gcn::UaeRadioButton* opt7Mhz;
|
||||
static gcn::UaeRadioButton* opt14Mhz;
|
||||
|
@ -42,14 +43,16 @@ class CPUButtonActionListener : public gcn::ActionListener
|
|||
{
|
||||
if (actionEvent.getSource() == optCPU68000)
|
||||
{
|
||||
changed_prefs.cpu_level = 0;
|
||||
changed_prefs.cpu_model = 68000;
|
||||
changed_prefs.fpu_model = 0;
|
||||
changed_prefs.address_space_24 = true;
|
||||
changed_prefs.z3fastmem_size = 0;
|
||||
changed_prefs.gfxmem_size = 0;
|
||||
}
|
||||
else if (actionEvent.getSource() == optCPU68010)
|
||||
{
|
||||
changed_prefs.cpu_level = 1;
|
||||
changed_prefs.cpu_model = 68010;
|
||||
changed_prefs.fpu_model = 0;
|
||||
changed_prefs.address_space_24 = true;
|
||||
changed_prefs.z3fastmem_size = 0;
|
||||
changed_prefs.gfxmem_size = 0;
|
||||
|
@ -57,7 +60,9 @@ class CPUButtonActionListener : public gcn::ActionListener
|
|||
}
|
||||
else if (actionEvent.getSource() == optCPU68EC020)
|
||||
{
|
||||
changed_prefs.cpu_level = 2;
|
||||
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;
|
||||
|
@ -65,16 +70,16 @@ class CPUButtonActionListener : public gcn::ActionListener
|
|||
}
|
||||
else if (actionEvent.getSource() == optCPU68020)
|
||||
{
|
||||
if(optFPU68881->isSelected())
|
||||
changed_prefs.cpu_level = 3; // with 68881
|
||||
else
|
||||
changed_prefs.cpu_level = 2; // no fpu
|
||||
changed_prefs.cpu_model = 68020;
|
||||
if(changed_prefs.fpu_model == 68040)
|
||||
changed_prefs.fpu_model = 68881;
|
||||
changed_prefs.address_space_24 = false;
|
||||
changed_prefs.cpu_compatible = 0;
|
||||
}
|
||||
else if (actionEvent.getSource() == optCPU68040)
|
||||
{
|
||||
changed_prefs.cpu_level = 4;
|
||||
changed_prefs.cpu_model = 68040;
|
||||
changed_prefs.fpu_model = 68040;
|
||||
changed_prefs.address_space_24 = false;
|
||||
changed_prefs.cpu_compatible = 0;
|
||||
}
|
||||
|
@ -92,16 +97,22 @@ class FPUButtonActionListener : public gcn::ActionListener
|
|||
{
|
||||
if (actionEvent.getSource() == optFPUnone)
|
||||
{
|
||||
if(changed_prefs.cpu_level == 3)
|
||||
changed_prefs.cpu_level = 2;
|
||||
changed_prefs.fpu_model = 0;
|
||||
}
|
||||
else if(actionEvent.getSource() == optFPU68881)
|
||||
{
|
||||
if(changed_prefs.cpu_level == 2)
|
||||
changed_prefs.cpu_level = 3;
|
||||
changed_prefs.fpu_model = 68881;
|
||||
}
|
||||
else
|
||||
;
|
||||
else if(actionEvent.getSource() == optFPU68882)
|
||||
{
|
||||
changed_prefs.fpu_model = 68882;
|
||||
}
|
||||
else if(actionEvent.getSource() == optFPUinternal)
|
||||
{
|
||||
changed_prefs.fpu_model = 68040;
|
||||
}
|
||||
RefreshPanelCPU();
|
||||
RefreshPanelRAM();
|
||||
}
|
||||
};
|
||||
static FPUButtonActionListener* fpuButtonActionListener;
|
||||
|
@ -217,13 +228,17 @@ void InitPanelCPU(const struct _ConfigCategory& category)
|
|||
optFPU68882 = new gcn::UaeRadioButton("68882", "radiofpugroup");
|
||||
optFPU68882->addActionListener(fpuButtonActionListener);
|
||||
|
||||
optFPUinternal = new gcn::UaeRadioButton("CPU internal", "radiofpugroup");
|
||||
optFPUinternal->addActionListener(fpuButtonActionListener);
|
||||
|
||||
grpFPU = new gcn::Window("FPU");
|
||||
grpFPU->setPosition(DISTANCE_BORDER, DISTANCE_BORDER + grpCPU->getHeight() + DISTANCE_NEXT_Y);
|
||||
grpFPU->setPosition(DISTANCE_BORDER + grpCPU->getWidth() + DISTANCE_NEXT_X, DISTANCE_BORDER);
|
||||
grpFPU->add(optFPUnone, 5, 10);
|
||||
grpFPU->add(optFPU68881, 5, 40);
|
||||
// grpFPU->add(optFPU68882, 5, 70);
|
||||
grpFPU->add(optFPU68882, 5, 70);
|
||||
grpFPU->add(optFPUinternal, 5, 100);
|
||||
grpFPU->setMovable(false);
|
||||
grpFPU->setSize(grpCPU->getWidth(), 115);
|
||||
grpFPU->setSize(140, 145);
|
||||
grpFPU->setBaseColor(gui_baseCol);
|
||||
|
||||
category.panel->add(grpFPU);
|
||||
|
@ -243,7 +258,7 @@ void InitPanelCPU(const struct _ConfigCategory& category)
|
|||
optFastest->addActionListener(cpuSpeedButtonActionListener);
|
||||
|
||||
grpCPUSpeed = new gcn::Window("CPU Speed");
|
||||
grpCPUSpeed->setPosition(DISTANCE_BORDER + grpCPU->getWidth() + DISTANCE_NEXT_X, DISTANCE_BORDER);
|
||||
grpCPUSpeed->setPosition(grpFPU->getX() + grpFPU->getWidth() + DISTANCE_NEXT_X, DISTANCE_BORDER);
|
||||
grpCPUSpeed->add(opt7Mhz, 5, 10);
|
||||
grpCPUSpeed->add(opt14Mhz, 5, 40);
|
||||
grpCPUSpeed->add(opt28Mhz, 5, 70);
|
||||
|
@ -275,6 +290,7 @@ void ExitPanelCPU(void)
|
|||
delete optFPUnone;
|
||||
delete optFPU68881;
|
||||
delete optFPU68882;
|
||||
delete optFPUinternal;
|
||||
delete grpFPU;
|
||||
delete fpuButtonActionListener;
|
||||
|
||||
|
@ -291,29 +307,43 @@ void RefreshPanelCPU(void)
|
|||
{
|
||||
if(changed_prefs.address_space_24)
|
||||
{
|
||||
if(changed_prefs.cpu_level == 0)
|
||||
if(changed_prefs.cpu_model == 68000)
|
||||
optCPU68000->setSelected(true);
|
||||
else if(changed_prefs.cpu_level == 1)
|
||||
else if(changed_prefs.cpu_model == 68010)
|
||||
optCPU68010->setSelected(true);
|
||||
else if(changed_prefs.cpu_level == 2)
|
||||
else if(changed_prefs.cpu_model == 68020)
|
||||
optCPU68EC020->setSelected(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(changed_prefs.cpu_level == 2 || changed_prefs.cpu_level == 3)
|
||||
if(changed_prefs.cpu_model == 68020 || changed_prefs.cpu_model == 68030)
|
||||
optCPU68020->setSelected(true);
|
||||
else if(changed_prefs.cpu_level == 4)
|
||||
else if(changed_prefs.cpu_model == 68040)
|
||||
optCPU68040->setSelected(true);
|
||||
}
|
||||
|
||||
chkCPUCompatible->setSelected(changed_prefs.cpu_compatible > 0);
|
||||
chkCPUCompatible->setEnabled(changed_prefs.cpu_level == 0);
|
||||
chkCPUCompatible->setEnabled(changed_prefs.cpu_model == 68000);
|
||||
chkJIT->setSelected(changed_prefs.cachesize > 0);
|
||||
|
||||
if(changed_prefs.cpu_level <= 2)
|
||||
optFPUnone->setSelected(true);
|
||||
else
|
||||
optFPU68881->setSelected(true);
|
||||
switch(changed_prefs.fpu_model)
|
||||
{
|
||||
case 68881:
|
||||
optFPU68881->setSelected(true);
|
||||
break;
|
||||
case 68882:
|
||||
optFPU68882->setSelected(true);
|
||||
break;
|
||||
case 68040:
|
||||
optFPUinternal->setSelected(true);
|
||||
break;
|
||||
default:
|
||||
optFPUnone->setSelected(true);
|
||||
break;
|
||||
}
|
||||
optFPU68881->setEnabled(changed_prefs.cpu_model >= 68020 && changed_prefs.cpu_model < 68040);
|
||||
optFPU68882->setEnabled(changed_prefs.cpu_model >= 68020 && changed_prefs.cpu_model < 68040);
|
||||
optFPUinternal->setEnabled(changed_prefs.cpu_model == 68040);
|
||||
|
||||
if (changed_prefs.m68k_speed == M68K_SPEED_7MHZ_CYCLES)
|
||||
opt7Mhz->setSelected(true);
|
||||
|
|
|
@ -32,7 +32,7 @@ static gcn::Slider* sldDriveSpeed;
|
|||
static gcn::UaeCheckBox* chkLoadConfig;
|
||||
static gcn::Button *cmdSaveForDisk;
|
||||
|
||||
static const char *diskfile_filter[] = { ".adf", ".adz", ".zip", ".gz", "\0" };
|
||||
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 };
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ class HDRemoveActionListener : public gcn::ActionListener
|
|||
{
|
||||
if (actionEvent.getSource() == listCmdDelete[i])
|
||||
{
|
||||
kill_filesys_unit(currprefs.mountinfo, i);
|
||||
kill_filesys_unitconfig(&changed_prefs, i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ class HDEditActionListener : public gcn::ActionListener
|
|||
{
|
||||
if (actionEvent.getSource() == listCmdProps[i])
|
||||
{
|
||||
int type = is_hardfile (currprefs.mountinfo, i);
|
||||
int type = is_hardfile (i);
|
||||
if(type == FILESYS_VIRTUAL)
|
||||
EditFilesysVirtual(i);
|
||||
else
|
||||
|
@ -232,49 +232,50 @@ void RefreshPanelHD(void)
|
|||
{
|
||||
int row, col;
|
||||
char tmp[32];
|
||||
char *volname, *devname, *rootdir, *filesys;
|
||||
int secspertrack, surfaces, cylinders, reserved, blocksize, readonly, type, bootpri;
|
||||
uae_u64 size;
|
||||
const char *failure;
|
||||
int units = nr_units(currprefs.mountinfo);
|
||||
struct mountedinfo mi;
|
||||
struct uaedev_config_info *uci;
|
||||
int nosize = 0, type;
|
||||
int units = nr_units();
|
||||
|
||||
for(row=0; row<MAX_HD_DEVICES; ++row)
|
||||
{
|
||||
if(row < units)
|
||||
uci = &changed_prefs.mountconfig[row];
|
||||
if(uci->devname && uci->devname[0])
|
||||
{
|
||||
failure = get_filesys_unit(currprefs.mountinfo, row,
|
||||
&devname, &volname, &rootdir, &readonly, &secspertrack, &surfaces, &reserved,
|
||||
&cylinders, &size, &blocksize, &bootpri, &filesys, 0);
|
||||
type = is_hardfile (currprefs.mountinfo, row);
|
||||
type = get_filesys_unitconfig(&changed_prefs, row, &mi);
|
||||
if (type < 0) {
|
||||
type = uci->ishdf ? FILESYS_HARDFILE : FILESYS_VIRTUAL;
|
||||
nosize = 1;
|
||||
}
|
||||
|
||||
if(type == FILESYS_VIRTUAL)
|
||||
{
|
||||
listCells[row][COL_DEVICE]->setText(devname);
|
||||
listCells[row][COL_VOLUME]->setText(volname);
|
||||
listCells[row][COL_PATH]->setText(rootdir);
|
||||
if(readonly)
|
||||
listCells[row][COL_DEVICE]->setText(uci->devname);
|
||||
listCells[row][COL_VOLUME]->setText(uci->volname);
|
||||
listCells[row][COL_PATH]->setText(uci->rootdir);
|
||||
if(uci->readonly)
|
||||
listCells[row][COL_READWRITE]->setText("no");
|
||||
else
|
||||
listCells[row][COL_READWRITE]->setText("yes");
|
||||
listCells[row][COL_SIZE]->setText("n/a");
|
||||
snprintf(tmp, 32, "%d", bootpri);
|
||||
snprintf(tmp, 32, "%d", uci->bootpri);
|
||||
listCells[row][COL_BOOTPRI]->setText(tmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
listCells[row][COL_DEVICE]->setText(devname);
|
||||
listCells[row][COL_DEVICE]->setText(uci->devname);
|
||||
listCells[row][COL_VOLUME]->setText("n/a");
|
||||
listCells[row][COL_PATH]->setText(rootdir);
|
||||
if(readonly)
|
||||
listCells[row][COL_PATH]->setText(uci->rootdir);
|
||||
if(uci->readonly)
|
||||
listCells[row][COL_READWRITE]->setText("no");
|
||||
else
|
||||
listCells[row][COL_READWRITE]->setText("yes");
|
||||
if (size >= 1024 * 1024 * 1024)
|
||||
snprintf (tmp, 32, "%.1fG", ((double)(uae_u32)(size / (1024 * 1024))) / 1024.0);
|
||||
if (mi.size >= 1024 * 1024 * 1024)
|
||||
snprintf (tmp, 32, "%.1fG", ((double)(uae_u32)(mi.size / (1024 * 1024))) / 1024.0);
|
||||
else
|
||||
snprintf (tmp, 32, "%.1fM", ((double)(uae_u32)(size / (1024))) / 1024.0);
|
||||
snprintf (tmp, 32, "%.1fM", ((double)(uae_u32)(mi.size / (1024))) / 1024.0);
|
||||
listCells[row][COL_SIZE]->setText(tmp);
|
||||
snprintf(tmp, 32, "%d", bootpri);
|
||||
snprintf(tmp, 32, "%d", uci->bootpri);
|
||||
listCells[row][COL_BOOTPRI]->setText(tmp);
|
||||
}
|
||||
listCmdProps[row]->setEnabled(true);
|
||||
|
|
|
@ -238,7 +238,7 @@ void RefreshPanelSavestate(void)
|
|||
}
|
||||
}
|
||||
|
||||
bool enabled = nr_units (currprefs.mountinfo) == 0;
|
||||
bool enabled = nr_units () == 0;
|
||||
optState0->setEnabled(enabled);
|
||||
optState1->setEnabled(enabled);
|
||||
optState2->setEnabled(enabled);
|
||||
|
|
|
@ -217,9 +217,9 @@ class SoundActionListener : public gcn::ActionListener
|
|||
{
|
||||
curr_stereodelay_idx = (int)(sldStereoDelay->getValue());
|
||||
if(curr_stereodelay_idx > 0)
|
||||
changed_prefs.sound_mixed_stereo = curr_stereodelay_idx;
|
||||
changed_prefs.sound_mixed_stereo_delay = curr_stereodelay_idx;
|
||||
else
|
||||
changed_prefs.sound_mixed_stereo = -1;
|
||||
changed_prefs.sound_mixed_stereo_delay = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -441,7 +441,7 @@ void RefreshPanelSound(void)
|
|||
else
|
||||
{
|
||||
curr_separation_idx = 10 - changed_prefs.sound_stereo_separation;
|
||||
curr_stereodelay_idx = changed_prefs.sound_mixed_stereo > 0 ? changed_prefs.sound_mixed_stereo : 0;
|
||||
curr_stereodelay_idx = changed_prefs.sound_mixed_stereo_delay > 0 ? changed_prefs.sound_mixed_stereo_delay : 0;
|
||||
}
|
||||
|
||||
sldSeparation->setValue(curr_separation_idx);
|
||||
|
|
|
@ -305,8 +305,12 @@ static void SetPresetMode(int mode, struct uae_prefs *p)
|
|||
|
||||
static void SetDefaultMenuSettings(struct uae_prefs *p)
|
||||
{
|
||||
while(nr_units(p->mountinfo) > 0)
|
||||
kill_filesys_unit(p->mountinfo, 0);
|
||||
int i;
|
||||
|
||||
free_mountinfo();
|
||||
for(i=0; i<MOUNT_CONFIG_SIZE; ++i)
|
||||
kill_filesys_unitconfig(p, i);
|
||||
p->mountitems = 0;
|
||||
|
||||
kickstart = 1;
|
||||
|
||||
|
@ -403,7 +407,8 @@ static bool CheckKickstart(struct uae_prefs *p)
|
|||
int loadconfig_old(struct uae_prefs *p, const char *orgpath)
|
||||
{
|
||||
char path[MAX_PATH];
|
||||
|
||||
int cpu_level;
|
||||
|
||||
strcpy(path, orgpath);
|
||||
char *ptr = strstr(path, ".uae");
|
||||
if(ptr > 0)
|
||||
|
@ -498,10 +503,10 @@ int loadconfig_old(struct uae_prefs *p, const char *orgpath)
|
|||
fscanf(f,"custom_Y=%d\n",&p->pandora_custom_Y);
|
||||
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", &p->cpu_level);
|
||||
if(p->cpu_level > M68000)
|
||||
fscanf(f,"cpu=%d\n", &cpu_level);
|
||||
if(cpu_level > M68000)
|
||||
// Was old format
|
||||
p->cpu_level = M68020;
|
||||
cpu_level = 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;
|
||||
|
@ -523,7 +528,7 @@ int loadconfig_old(struct uae_prefs *p, const char *orgpath)
|
|||
if(p->m68k_speed >= 2)
|
||||
{
|
||||
// 1200: set to 68020 with 14 MHz
|
||||
p->cpu_level = M68020;
|
||||
cpu_level = M68020;
|
||||
p->m68k_speed--;
|
||||
if(p->m68k_speed > 2)
|
||||
p->m68k_speed = 2;
|
||||
|
@ -535,7 +540,30 @@ int loadconfig_old(struct uae_prefs *p, const char *orgpath)
|
|||
p->m68k_speed = M68K_SPEED_25MHZ_CYCLES;
|
||||
p->cachesize = 0;
|
||||
p->cpu_compatible = 0;
|
||||
|
||||
switch(cpu_level)
|
||||
{
|
||||
case 0:
|
||||
p->cpu_model = 68000;
|
||||
p->fpu_model = 0;
|
||||
break;
|
||||
case 1:
|
||||
p->cpu_model = 68010;
|
||||
p->fpu_model = 0;
|
||||
break;
|
||||
case 2:
|
||||
p->cpu_model = 68020;
|
||||
p->fpu_model = 0;
|
||||
break;
|
||||
case 3:
|
||||
p->cpu_model = 68020;
|
||||
p->fpu_model = 68881;
|
||||
break;
|
||||
case 4:
|
||||
p->cpu_model = 68040;
|
||||
p->fpu_model = 68881;
|
||||
break;
|
||||
}
|
||||
|
||||
disk_eject(0);
|
||||
disk_eject(1);
|
||||
disk_eject(2);
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
.global NEON_doline_n6
|
||||
.global NEON_doline_n8
|
||||
|
||||
|
||||
.text
|
||||
|
||||
.align 8
|
||||
|
|
|
@ -119,6 +119,16 @@ void logging_cleanup( void )
|
|||
}
|
||||
|
||||
|
||||
void target_quit (void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void target_fixup_options (struct uae_prefs *p)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void target_default_options (struct uae_prefs *p, int type)
|
||||
{
|
||||
p->pandora_horizontal_offset = 0;
|
||||
|
@ -254,10 +264,13 @@ void fetch_screenshotpath(char *out, int size)
|
|||
|
||||
int target_cfgfile_load (struct uae_prefs *p, char *filename, int type, int isdefault)
|
||||
{
|
||||
int i;
|
||||
int result = 0;
|
||||
|
||||
while(nr_units(p->mountinfo) > 0)
|
||||
kill_filesys_unit(p->mountinfo, 0);
|
||||
free_mountinfo();
|
||||
for(i=0; i<MOUNT_CONFIG_SIZE; ++i)
|
||||
kill_filesys_unitconfig(p, i);
|
||||
p->mountitems = 0;
|
||||
|
||||
char *ptr = strstr(filename, ".uae");
|
||||
if(ptr > 0)
|
||||
|
|
|
@ -7,11 +7,6 @@
|
|||
#include "zfile.h"
|
||||
|
||||
|
||||
void filesys_init( void )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
int my_existsfile (const char *name)
|
||||
{
|
||||
struct stat st;
|
||||
|
@ -39,6 +34,19 @@ int my_existsdir(const char *name)
|
|||
}
|
||||
|
||||
|
||||
int my_getvolumeinfo (const char *root)
|
||||
{
|
||||
struct stat st;
|
||||
int ret = 0;
|
||||
|
||||
if (lstat (root, &st) == -1)
|
||||
return -1;
|
||||
if (!S_ISDIR(st.st_mode))
|
||||
return -1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void *my_opendir (const char* name)
|
||||
{
|
||||
return opendir(name);
|
||||
|
@ -124,3 +132,11 @@ int my_truncate (const char *name, long int len)
|
|||
{
|
||||
return truncate(name, len);
|
||||
}
|
||||
|
||||
|
||||
/* Returns 1 if an actual volume-name was found, 2 if no volume-name (so uses some defaults) */
|
||||
int target_get_volume_name(struct uaedev_mount_info *mtinf, const char *volumepath, char *volumename, int size, int inserted, int fullcheck)
|
||||
{
|
||||
sprintf(volumename, "DH_%c", volumepath[0]);
|
||||
return 2;
|
||||
}
|
||||
|
|
|
@ -10,11 +10,17 @@
|
|||
#include "events.h"
|
||||
#include "osdep/inputmode.h"
|
||||
#include "savestate.h"
|
||||
#include "picasso96.h"
|
||||
|
||||
#include <png.h>
|
||||
#include <SDL.h>
|
||||
#include <SDL_image.h>
|
||||
#include <SDL_gfxPrimitives.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/fb.h>
|
||||
#include <linux/matroxfb.h>
|
||||
|
||||
#ifdef ANDROIDSDL
|
||||
#include <android/log.h>
|
||||
#endif
|
||||
|
@ -22,12 +28,26 @@
|
|||
extern int stylusClickOverride;
|
||||
|
||||
|
||||
/* SDL variable for output of emulation and menu */
|
||||
/* SDL variable for output of emulation */
|
||||
SDL_Surface *prSDLScreen = NULL;
|
||||
uae_u16 *prSDLScreenPixels;
|
||||
static SDL_Surface *current_screenshot = NULL;
|
||||
|
||||
/* Possible screen modes (x and y resolutions) */
|
||||
#define MAX_SCREEN_MODES 6
|
||||
static int x_size_table[MAX_SCREEN_MODES] = { 640, 640, 800, 1024, 1152, 1280 };
|
||||
static int y_size_table[MAX_SCREEN_MODES] = { 400, 480, 480, 768, 864, 960 };
|
||||
|
||||
static int red_bits, green_bits, blue_bits;
|
||||
static int red_shift, green_shift, blue_shift;
|
||||
|
||||
int screen_is_picasso;
|
||||
static int picasso_maxw = 0, picasso_maxh = 0;
|
||||
|
||||
static int bitdepth, bit_unit;
|
||||
|
||||
|
||||
static int curr_layer_width = 0;
|
||||
|
||||
static SDL_Surface *current_screenshot = NULL;
|
||||
static char screenshot_filename_default[255]={
|
||||
'/', 't', 'm', 'p', '/', 'n', 'u', 'l', 'l', '.', 'p', 'n', 'g', '\0'
|
||||
};
|
||||
|
@ -44,6 +64,7 @@ int delay_savestate_frame = 0;
|
|||
#define VIDEO_FLAGS VIDEO_FLAGS_INIT | SDL_DOUBLEBUF
|
||||
#endif
|
||||
|
||||
|
||||
int justClicked = 0;
|
||||
int mouseMoving = 0;
|
||||
int fcounter = 0;
|
||||
|
@ -53,8 +74,20 @@ static unsigned long previous_synctime = 0;
|
|||
static unsigned long next_synctime = 0;
|
||||
|
||||
|
||||
static int fbdevice = -1;
|
||||
static inline void WaitForVSync(void)
|
||||
{
|
||||
int arg = 0;
|
||||
if(fbdevice != -1)
|
||||
ioctl(fbdevice, FBIO_WAITFORVSYNC, &arg);
|
||||
}
|
||||
|
||||
|
||||
int graphics_setup (void)
|
||||
{
|
||||
#ifdef PICASSO96
|
||||
InitPicasso96();
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -77,6 +110,11 @@ void graphics_subshutdown (void)
|
|||
{
|
||||
SDL_FreeSurface(prSDLScreen);
|
||||
prSDLScreen = NULL;
|
||||
if(fbdevice != -1)
|
||||
{
|
||||
close(fbdevice);
|
||||
fbdevice = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -98,17 +136,27 @@ static void CalcPandoraWidth(struct uae_prefs *p)
|
|||
}
|
||||
|
||||
|
||||
void update_display(struct uae_prefs *p)
|
||||
static void open_screen(struct uae_prefs *p)
|
||||
{
|
||||
char layersize[20];
|
||||
|
||||
if(prSDLScreen != NULL)
|
||||
graphics_subshutdown();
|
||||
|
||||
CalcPandoraWidth(p);
|
||||
if(curr_layer_width != p->gfx_size_fs.width)
|
||||
{
|
||||
char layersize[20];
|
||||
snprintf(layersize, 20, "%dx480", p->gfx_size_fs.width);
|
||||
|
||||
if(!screen_is_picasso)
|
||||
{
|
||||
CalcPandoraWidth(p);
|
||||
if(curr_layer_width != p->gfx_size_fs.width)
|
||||
{
|
||||
snprintf(layersize, 20, "%dx480", p->gfx_size_fs.width);
|
||||
#ifndef WIN32
|
||||
setenv("SDL_OMAP_LAYER_SIZE", layersize, 1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(layersize, 20, "%dx%d", picasso_vidinfo.width, picasso_vidinfo.height);
|
||||
#ifndef WIN32
|
||||
setenv("SDL_OMAP_LAYER_SIZE", layersize, 1);
|
||||
#endif
|
||||
|
@ -118,20 +166,39 @@ void update_display(struct uae_prefs *p)
|
|||
update_onscreen();
|
||||
#endif
|
||||
|
||||
if(prSDLScreen == NULL || prSDLScreen->w != p->gfx_size.width || prSDLScreen->h != p->gfx_size.height)
|
||||
if(!screen_is_picasso)
|
||||
{
|
||||
if(prSDLScreen == NULL || prSDLScreen->w != p->gfx_size.width || prSDLScreen->h != p->gfx_size.height)
|
||||
{
|
||||
#if defined(PANDORA) && !defined(WIN32)
|
||||
prSDLScreen = SDL_SetVideoMode(p->gfx_size.width, p->gfx_size.height, 16, SDL_SWSURFACE|SDL_FULLSCREEN|SDL_DOUBLEBUF);
|
||||
prSDLScreen = SDL_SetVideoMode(p->gfx_size.width, p->gfx_size.height, 16, SDL_HWSURFACE|SDL_FULLSCREEN|SDL_DOUBLEBUF);
|
||||
#elif defined(PANDORA) && defined(WIN32)
|
||||
prSDLScreen = SDL_SetVideoMode(p->gfx_size.width, p->gfx_size.height, 16, SDL_SWSURFACE|SDL_DOUBLEBUF);
|
||||
prSDLScreen = SDL_SetVideoMode(p->gfx_size.width, p->gfx_size.height, 16, SDL_SWSURFACE|SDL_DOUBLEBUF);
|
||||
#else
|
||||
prSDLScreen = SDL_SetVideoMode(p->gfx_size.width, p->gfx_size.height, 16, SDL_SWSURFACE|SDL_FULLSCREEN);
|
||||
prSDLScreen = SDL_SetVideoMode(p->gfx_size.width, p->gfx_size.height, 16, SDL_HWSURFACE|SDL_FULLSCREEN);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
prSDLScreen = SDL_SetVideoMode(picasso_vidinfo.width, picasso_vidinfo.height, 16, SDL_SWSURFACE|SDL_FULLSCREEN);
|
||||
if(fbdevice == -1)
|
||||
fbdevice = open("/dev/fb0", O_RDWR); // We have to wait for vsync by hand when no SDL_DOUBLEBUF...
|
||||
}
|
||||
if(prSDLScreen != NULL)
|
||||
{
|
||||
init_row_map();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void update_display(struct uae_prefs *p)
|
||||
{
|
||||
open_screen(p);
|
||||
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
|
||||
InitAmigaVidMode(p);
|
||||
init_row_map();
|
||||
framecnt = 1; // Don't draw frame before reset done
|
||||
}
|
||||
|
||||
|
@ -171,21 +238,18 @@ int check_prefs_changed_gfx (void)
|
|||
|
||||
int lockscr (void)
|
||||
{
|
||||
SDL_LockSurface(prSDLScreen);
|
||||
return 1;
|
||||
SDL_LockSurface(prSDLScreen);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
void unlockscr (void)
|
||||
{
|
||||
SDL_UnlockSurface(prSDLScreen);
|
||||
SDL_UnlockSurface(prSDLScreen);
|
||||
}
|
||||
|
||||
|
||||
void flush_block ()
|
||||
{
|
||||
SDL_UnlockSurface (prSDLScreen);
|
||||
|
||||
if (show_inputmode)
|
||||
inputmode_redraw();
|
||||
|
||||
|
@ -203,9 +267,18 @@ void flush_block ()
|
|||
|
||||
unsigned long start = read_processor_time();
|
||||
if(start < next_synctime && next_synctime - start > time_per_frame - 1000)
|
||||
usleep((next_synctime - start) - 1000);
|
||||
SDL_Flip(prSDLScreen);
|
||||
last_synctime = read_processor_time();
|
||||
usleep((next_synctime - start) - 750);
|
||||
if(screen_is_picasso)
|
||||
{
|
||||
WaitForVSync();
|
||||
last_synctime = read_processor_time();
|
||||
SDL_Flip(prSDLScreen);
|
||||
}
|
||||
else
|
||||
{
|
||||
SDL_Flip(prSDLScreen);
|
||||
last_synctime = read_processor_time();
|
||||
}
|
||||
|
||||
if(last_synctime - next_synctime > time_per_frame - 1000)
|
||||
adjust_idletime(0);
|
||||
|
@ -217,7 +290,7 @@ void flush_block ()
|
|||
else
|
||||
next_synctime = next_synctime + time_per_frame * (1 + currprefs.gfx_framerate);
|
||||
|
||||
SDL_LockSurface (prSDLScreen);
|
||||
init_row_map();
|
||||
|
||||
if(stylusClickOverride)
|
||||
{
|
||||
|
@ -252,7 +325,6 @@ void flush_block ()
|
|||
fcounter++;
|
||||
}
|
||||
}
|
||||
init_row_map();
|
||||
}
|
||||
|
||||
|
||||
|
@ -272,9 +344,6 @@ static void graphics_subinit (void)
|
|||
}
|
||||
else
|
||||
{
|
||||
prSDLScreenPixels=(uae_u16 *)prSDLScreen->pixels;
|
||||
SDL_LockSurface(prSDLScreen);
|
||||
SDL_UnlockSurface(prSDLScreen);
|
||||
SDL_Flip(prSDLScreen);
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
|
||||
|
@ -324,6 +393,7 @@ static int init_colors (void)
|
|||
green_shift = maskShift(prSDLScreen->format->Gmask);
|
||||
blue_shift = maskShift(prSDLScreen->format->Bmask);
|
||||
alloc_colors64k (red_bits, green_bits, blue_bits, red_shift, green_shift, blue_shift, 0);
|
||||
notice_new_xcolors();
|
||||
for (i = 0; i < 4096; i++)
|
||||
xcolors[i] = xcolors[i] * 0x00010001;
|
||||
|
||||
|
@ -331,20 +401,39 @@ static int init_colors (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* Find the colour depth of the display
|
||||
*/
|
||||
static int get_display_depth (void)
|
||||
{
|
||||
const SDL_VideoInfo *vid_info;
|
||||
int depth = 0;
|
||||
|
||||
if ((vid_info = SDL_GetVideoInfo())) {
|
||||
depth = vid_info->vfmt->BitsPerPixel;
|
||||
|
||||
/* Don't trust the answer if it's 16 bits; the display
|
||||
* could actually be 15 bits deep. We'll count the bits
|
||||
* ourselves */
|
||||
if (depth == 16)
|
||||
depth = bitsInMask (vid_info->vfmt->Rmask) + bitsInMask (vid_info->vfmt->Gmask) + bitsInMask (vid_info->vfmt->Bmask);
|
||||
}
|
||||
return depth;
|
||||
}
|
||||
|
||||
|
||||
int graphics_init (void)
|
||||
{
|
||||
int i,j;
|
||||
|
||||
graphics_subinit ();
|
||||
|
||||
init_row_map ();
|
||||
|
||||
if (!init_colors ())
|
||||
return 0;
|
||||
|
||||
buttonstate[0] = buttonstate[1] = buttonstate[2] = 0;
|
||||
keyboard_init();
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -352,7 +441,6 @@ void graphics_leave (void)
|
|||
{
|
||||
graphics_subshutdown ();
|
||||
SDL_VideoQuit();
|
||||
//dumpcustom ();
|
||||
}
|
||||
|
||||
|
||||
|
@ -446,9 +534,8 @@ static void CreateScreenshot(void)
|
|||
|
||||
w=prSDLScreen->w;
|
||||
h=prSDLScreen->h;
|
||||
|
||||
current_screenshot = SDL_CreateRGBSurface(prSDLScreen->flags,w,h,prSDLScreen->format->BitsPerPixel,prSDLScreen->format->Rmask,prSDLScreen->format->Gmask,prSDLScreen->format->Bmask,prSDLScreen->format->Amask);
|
||||
SDL_BlitSurface(prSDLScreen, NULL, current_screenshot, NULL);
|
||||
current_screenshot = SDL_CreateRGBSurfaceFrom(prSDLScreen->pixels, w, h, prSDLScreen->format->BitsPerPixel, prSDLScreen->pitch,
|
||||
prSDLScreen->format->Rmask, prSDLScreen->format->Gmask, prSDLScreen->format->Bmask, prSDLScreen->format->Amask);
|
||||
}
|
||||
|
||||
|
||||
|
@ -463,3 +550,153 @@ static int save_thumb(char *path)
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
#ifdef PICASSO96
|
||||
|
||||
uae_u16 picasso96_pixel_format = RGBFF_CHUNKY;
|
||||
|
||||
|
||||
void DX_Invalidate (int x, int y, int width, int height)
|
||||
{
|
||||
// We draw everything direct to the frame buffer
|
||||
}
|
||||
|
||||
int DX_BitsPerCannon (void)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
static int palette_update_start = 256;
|
||||
static int palette_update_end = 0;
|
||||
|
||||
void DX_SetPalette (int start, int count)
|
||||
{
|
||||
if (! screen_is_picasso || picasso96_state.RGBFormat != RGBFB_CHUNKY)
|
||||
return;
|
||||
|
||||
if (picasso_vidinfo.pixbytes != 1) {
|
||||
/* This is the case when we're emulating a 256 color display. */
|
||||
while (count-- > 0) {
|
||||
int r = picasso96_state.CLUT[start].Red;
|
||||
int g = picasso96_state.CLUT[start].Green;
|
||||
int b = picasso96_state.CLUT[start].Blue;
|
||||
picasso_vidinfo.clut[start++] =
|
||||
(doMask256 (r, red_bits, red_shift)
|
||||
| doMask256 (g, green_bits, green_shift)
|
||||
| doMask256 (b, blue_bits, blue_shift));
|
||||
}
|
||||
notice_screen_contents_lost();
|
||||
}
|
||||
}
|
||||
|
||||
int DX_Fill (int dstx, int dsty, int width, int height, uae_u32 color, RGBFTYPE rgbtype)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
SDL_Rect rect = {dstx, dsty, width, height};
|
||||
|
||||
if (SDL_FillRect (prSDLScreen, &rect, color) == 0) {
|
||||
DX_Invalidate (dstx, dsty, width, height);
|
||||
result = 1;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int DX_FillResolutions (uae_u16 *ppixel_format)
|
||||
{
|
||||
int i, count = 0;
|
||||
int w = 0;
|
||||
int h = 0;
|
||||
int emulate_chunky = 0;
|
||||
|
||||
/* In the new scheme of things, this function is called *before* graphics_init.
|
||||
* Hence, we need to find the display depth ourselves - Rich */
|
||||
bitdepth = get_display_depth ();
|
||||
bit_unit = (bitdepth + 1) & 0xF8;
|
||||
|
||||
picasso_vidinfo.rgbformat = (bit_unit == 8 ? RGBFB_CHUNKY
|
||||
: bitdepth == 15 && bit_unit == 16 ? RGBFB_R5G5B5
|
||||
: bitdepth == 16 && bit_unit == 16 ? RGBFB_R5G6B5
|
||||
: bit_unit == 24 ? RGBFB_B8G8R8
|
||||
: bit_unit == 32 ? RGBFB_A8R8G8B8
|
||||
: RGBFB_NONE);
|
||||
|
||||
*ppixel_format = 1 << picasso_vidinfo.rgbformat;
|
||||
if (bit_unit == 16 || bit_unit == 32) {
|
||||
*ppixel_format |= RGBFF_CHUNKY;
|
||||
// emulate_chunky = 1;
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_SCREEN_MODES && count < MAX_PICASSO_MODES; i++) {
|
||||
int j;
|
||||
if (SDL_VideoModeOK (x_size_table[i], y_size_table[i], bitdepth, SDL_SWSURFACE))
|
||||
{
|
||||
for (j = 0; j <= emulate_chunky && count < MAX_PICASSO_MODES; j++) {
|
||||
if (x_size_table[i] > picasso_maxw)
|
||||
picasso_maxw = x_size_table[i];
|
||||
if (y_size_table[i] > picasso_maxh)
|
||||
picasso_maxh = y_size_table[i];
|
||||
DisplayModes[count].res.width = x_size_table[i];
|
||||
DisplayModes[count].res.height = y_size_table[i];
|
||||
DisplayModes[count].depth = j == 1 ? 1 : bit_unit >> 3;
|
||||
DisplayModes[count].refresh = 50;
|
||||
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
DisplayModes[count].depth = -1;
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
void gfx_set_picasso_modeinfo (uae_u32 w, uae_u32 h, uae_u32 depth, RGBFTYPE rgbfmt)
|
||||
{
|
||||
depth >>= 3;
|
||||
if( ((unsigned)picasso_vidinfo.width == w ) &&
|
||||
( (unsigned)picasso_vidinfo.height == h ) &&
|
||||
( (unsigned)picasso_vidinfo.depth == depth ) &&
|
||||
( picasso_vidinfo.selected_rgbformat == rgbfmt) )
|
||||
return;
|
||||
|
||||
picasso_vidinfo.selected_rgbformat = rgbfmt;
|
||||
picasso_vidinfo.width = w;
|
||||
picasso_vidinfo.height = h;
|
||||
picasso_vidinfo.depth = depth;
|
||||
picasso_vidinfo.extra_mem = 1;
|
||||
|
||||
picasso_vidinfo.pixbytes = depth;
|
||||
if (screen_is_picasso)
|
||||
{
|
||||
open_screen(&currprefs);
|
||||
picasso_vidinfo.rowbytes = prSDLScreen->pitch;
|
||||
}
|
||||
}
|
||||
|
||||
void gfx_set_picasso_state (int on)
|
||||
{
|
||||
if (on == screen_is_picasso)
|
||||
return;
|
||||
|
||||
screen_is_picasso = on;
|
||||
open_screen(&currprefs);
|
||||
picasso_vidinfo.rowbytes = prSDLScreen->pitch;
|
||||
if (on)
|
||||
DX_SetPalette (0, 256);
|
||||
}
|
||||
|
||||
uae_u8 *gfx_lock_picasso (void)
|
||||
{
|
||||
SDL_LockSurface(prSDLScreen);
|
||||
picasso_vidinfo.rowbytes = prSDLScreen->pitch;
|
||||
return (uae_u8 *)prSDLScreen->pixels;
|
||||
}
|
||||
|
||||
void gfx_unlock_picasso (void)
|
||||
{
|
||||
SDL_UnlockSurface(prSDLScreen);
|
||||
}
|
||||
|
||||
#endif // PICASSO96
|
||||
|
|
|
@ -56,8 +56,17 @@ struct gui_msg {
|
|||
const char *msg;
|
||||
};
|
||||
struct gui_msg gui_msglist[] = {
|
||||
{ NUMSG_KS68EC020, "Your Kickstart requires a 68EC020 or later CPU." },
|
||||
{ NUMSG_KS68020, "Your Kickstart requires a 68020 CPU or later CPU." },
|
||||
{ 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." },
|
||||
{ NUMSG_KSROMREADERROR, "Error while reading system ROM." },
|
||||
{ NUMSG_NOEXTROM, "No extended ROM found." },
|
||||
{ NUMSG_KS68EC020, "The selected system ROM requires a 68EC020 or later CPU." },
|
||||
{ NUMSG_KS68020, "The selected system ROM requires a 68020 or later CPU." },
|
||||
{ NUMSG_KS68030, "The selected system ROM requires a 68030 CPU." },
|
||||
{ NUMSG_STATEHD, "WARNING: Current configuration is not fully compatible with state saves." },
|
||||
{ NUMSG_KICKREP, "You need to have a floppy disk (image file) in DF0: to use the system ROM replacement." },
|
||||
{ NUMSG_KICKREPNO, "The floppy disk (image file) in DF0: is not compatible with the system ROM replacement functionality." },
|
||||
{ -1, "" }
|
||||
};
|
||||
|
||||
|
@ -125,7 +134,7 @@ static struct romdata *scan_single_rom_2 (struct zfile *f, uae_u8 *keybuf, int k
|
|||
zfile_fseek (f, 0, SEEK_END);
|
||||
size = zfile_ftell (f);
|
||||
zfile_fseek (f, 0, SEEK_SET);
|
||||
if (size > 1760 * 512) /* don't skip KICK disks */
|
||||
if (size > 524288 * 2) /* don't skip KICK disks or 1M ROMs */
|
||||
return 0;
|
||||
zfile_fread (buffer, 1, 11, f);
|
||||
if (!memcmp (buffer, "KICK", 4)) {
|
||||
|
@ -154,12 +163,36 @@ static struct romdata *scan_single_rom_2 (struct zfile *f, uae_u8 *keybuf, int k
|
|||
return rd;
|
||||
}
|
||||
|
||||
static int isromext(char *path)
|
||||
{
|
||||
char *ext = strrchr (path, '.');
|
||||
int i;
|
||||
|
||||
if (!ext)
|
||||
return 0;
|
||||
ext++;
|
||||
|
||||
if (!stricmp (ext, "rom") || !stricmp (ext, "adf") || !stricmp (ext, "key")
|
||||
|| !stricmp (ext, "a500") || !stricmp (ext, "a1200") || !stricmp (ext, "a4000"))
|
||||
return 1;
|
||||
for (i = 0; uae_archive_extensions[i]; i++) {
|
||||
if (!stricmp (ext, uae_archive_extensions[i]))
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int scan_rom_2 (struct zfile *f, void *rsd)
|
||||
{
|
||||
struct romdata *rd = scan_single_rom_2(f, ((struct romscandata *)rsd)->keybuf, ((struct romscandata *)rsd)->keysize);
|
||||
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);
|
||||
if (rd)
|
||||
addrom (rd, zfile_getname(f));
|
||||
return 1;
|
||||
addrom (rd, path);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void scan_rom(char *path, uae_u8 *keybuf, int keysize)
|
||||
|
@ -167,6 +200,10 @@ static void scan_rom(char *path, uae_u8 *keybuf, int keysize)
|
|||
struct romdata *rd;
|
||||
struct romscandata rsd = { keybuf, keysize };
|
||||
|
||||
if (!isromext(path)) {
|
||||
//write_log("ROMSCAN: skipping file '%s', unknown extension\n", path);
|
||||
return;
|
||||
}
|
||||
rd = getarcadiarombyname(path);
|
||||
if (rd)
|
||||
addrom(rd, path);
|
||||
|
@ -271,6 +308,22 @@ ConfigFileInfo* SearchConfigInList(const char *name)
|
|||
}
|
||||
|
||||
|
||||
static void prefs_to_gui()
|
||||
{
|
||||
/* filesys hack */
|
||||
changed_prefs.mountitems = currprefs.mountitems;
|
||||
memcpy(&changed_prefs.mountconfig, &currprefs.mountconfig, MOUNT_CONFIG_SIZE * sizeof (struct uaedev_config_info));
|
||||
}
|
||||
|
||||
|
||||
static void gui_to_prefs (void)
|
||||
{
|
||||
/* filesys hack */
|
||||
currprefs.mountitems = changed_prefs.mountitems;
|
||||
memcpy(&currprefs.mountconfig, &changed_prefs.mountconfig, MOUNT_CONFIG_SIZE * sizeof (struct uaedev_config_info));
|
||||
}
|
||||
|
||||
|
||||
int gui_init (void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
@ -286,7 +339,9 @@ int gui_init (void)
|
|||
RescanROMs();
|
||||
|
||||
graphics_subshutdown();
|
||||
prefs_to_gui();
|
||||
run_gui();
|
||||
gui_to_prefs();
|
||||
if(quit_program < 0)
|
||||
quit_program = -quit_program;
|
||||
if(quit_program == 1)
|
||||
|
@ -378,7 +433,9 @@ static void goMenu(void)
|
|||
if(lstAvailableROMs.size() == 0)
|
||||
RescanROMs();
|
||||
graphics_subshutdown();
|
||||
prefs_to_gui();
|
||||
run_gui();
|
||||
gui_to_prefs();
|
||||
setCpuSpeed();
|
||||
update_display(&changed_prefs);
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ void alloc_AmigaMem(void)
|
|||
{
|
||||
int i;
|
||||
uae_u64 total;
|
||||
uae_u32 max_allowed_mman;
|
||||
int max_allowed_mman;
|
||||
|
||||
free_AmigaMem();
|
||||
|
||||
|
@ -117,6 +117,9 @@ uae_u8 *mapped_malloc (size_t s, const char *file)
|
|||
if(!strcmp(file, "rom_e0"))
|
||||
return natmem_offset + 0xe00000;
|
||||
|
||||
if(!strcmp(file, "rom_a8"))
|
||||
return natmem_offset + 0xa80000;
|
||||
|
||||
if(!strcmp(file, "kick"))
|
||||
return natmem_offset + kickmem_start;
|
||||
|
||||
|
@ -124,10 +127,13 @@ uae_u8 *mapped_malloc (size_t s, const char *file)
|
|||
return natmem_offset + 0x1000000; //z3fastmem_start;
|
||||
|
||||
if(!strcmp(file, "gfx"))
|
||||
return natmem_offset + 0x3000000; //gfxmem_start;
|
||||
{
|
||||
p96ram_start = 0x3000000;
|
||||
return natmem_offset + p96ram_start;
|
||||
}
|
||||
|
||||
if(!strcmp(file, "rtarea"))
|
||||
return natmem_offset + RTAREA_BASE;
|
||||
return natmem_offset + rtarea_base;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -395,3 +395,7 @@
|
|||
#define M68K_SPEED_7MHZ_CYCLES 0
|
||||
#define M68K_SPEED_14MHZ_CYCLES 1024
|
||||
#define M68K_SPEED_25MHZ_CYCLES 128
|
||||
|
||||
typedef unsigned char boolean;
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue