Merge latest TomB version as of 6 April
This commit is contained in:
parent
dcb6ab5053
commit
d8ba1f9037
240 changed files with 125165 additions and 108915 deletions
1747
src/od-pandora/bsdsocket_host.cpp
Normal file
1747
src/od-pandora/bsdsocket_host.cpp
Normal file
File diff suppressed because it is too large
Load diff
|
@ -46,21 +46,6 @@
|
|||
#undef USE_COMPILER
|
||||
#undef RELY_ON_LOADSEG_DETECTION
|
||||
|
||||
/*
|
||||
* Set USER_PROGRAMS_BEHAVE to 1 or 2 to indicate that you are only running
|
||||
* non-hardware banging programs which leave all the dirty work to the
|
||||
* Kickstart. This affects the compiler. Any program that is _not_ in the ROM
|
||||
* (i.e. everything but the Kickstart) will use faster memory access
|
||||
* functions.
|
||||
* There is of course the problem that the Amiga doesn't really distinguish
|
||||
* between user programs and the kernel. Not all of the OS is in the ROM,
|
||||
* e.g. the parallel.device is on the disk and gets loaded into RAM at least
|
||||
* with Kickstart 1.3 (don't know about newer Kickstarts). So you probably
|
||||
* can't print, and some other stuff may also fail to work.
|
||||
* A useless option, really, given the way lots of Amiga software is written.
|
||||
#define USER_PROGRAMS_BEHAVE 0
|
||||
*/
|
||||
|
||||
/***************************************************************************
|
||||
* Operating system/machine specific options
|
||||
* Configure these for your CPU. The default settings should work on any
|
||||
|
|
|
@ -350,8 +350,9 @@ bool EditFilesysHardfile(int unit_no)
|
|||
txtSectors->setText("32");
|
||||
txtBlocksize->setText("512");
|
||||
}
|
||||
|
||||
EditFilesysHardfileLoop();
|
||||
ExitEditFilesysHardfile();
|
||||
|
||||
if(dialogResult)
|
||||
{
|
||||
int bp = tweakbootpri(atoi(txtBootPri->getText().c_str()), chkAutoboot->isSelected() ? 1 : 0, 0);
|
||||
|
@ -365,5 +366,8 @@ bool EditFilesysHardfile(int unit_no)
|
|||
if (uci)
|
||||
hardfile_do_disk_change (uci, 1);
|
||||
}
|
||||
|
||||
ExitEditFilesysHardfile();
|
||||
|
||||
return dialogResult;
|
||||
}
|
||||
|
|
|
@ -295,7 +295,6 @@ bool EditFilesysVirtual(int unit_no)
|
|||
}
|
||||
|
||||
EditFilesysVirtualLoop();
|
||||
ExitEditFilesysVirtual();
|
||||
|
||||
if(dialogResult)
|
||||
{
|
||||
|
@ -309,5 +308,7 @@ bool EditFilesysVirtual(int unit_no)
|
|||
filesys_media_change (uci->rootdir, 1, uci);
|
||||
}
|
||||
|
||||
ExitEditFilesysVirtual();
|
||||
|
||||
return dialogResult;
|
||||
}
|
||||
|
|
|
@ -171,10 +171,10 @@ static NavigationMap navMap[] =
|
|||
{ "cboJoystick", "Input", "cboAutofire", "cboCtrlConfig", "cboTapDelay" },
|
||||
{ "cboAutofire", "cboJoystick", "Input", "cboCtrlConfig", "cboTapDelay" },
|
||||
{ "cboTapDelay", "Input", "Input", "cboJoystick", "MouseSpeed" },
|
||||
{ "MouseSpeed", "", "", "cboTapDelay", "StylusOffset" },
|
||||
{ "StylusOffset", "", "", "MouseSpeed", "cboDPAD" },
|
||||
{ "cboDPAD", "Input", "CustomCtrl", "StylusOffset", "cboA" },
|
||||
{ "CustomCtrl", "cboDPAD", "Input", "StylusOffset", "cboB" },
|
||||
{ "MouseSpeed", "", "", "cboTapDelay", "cboDPAD" },
|
||||
{ "MouseHack", "MouseSpeed", "Input", "cboTapDelay", "CustomCtrl" },
|
||||
{ "cboDPAD", "Input", "CustomCtrl", "MouseSpeed", "cboA" },
|
||||
{ "CustomCtrl", "cboDPAD", "Input", "MouseHack", "cboB" },
|
||||
{ "cboA", "Input", "cboB", "cboDPAD", "cboX" },
|
||||
{ "cboB", "cboA", "Input", "CustomCtrl", "cboY" },
|
||||
{ "cboX", "Input", "cboY", "cboA", "cboL" },
|
||||
|
@ -187,10 +187,11 @@ static NavigationMap navMap[] =
|
|||
{ "cboRight", "cboLeft", "Input", "cboDown", "cboCtrlConfig" },
|
||||
|
||||
// PanelMisc
|
||||
{ "Status Line", "Miscellaneous", "Miscellaneous", "PandSpeed", "ShowGUI" },
|
||||
{ "Status Line", "Miscellaneous", "Miscellaneous", "BSDSocket", "ShowGUI" },
|
||||
{ "ShowGUI", "Miscellaneous", "Miscellaneous", "Status Line", "PandSpeed" },
|
||||
{ "PandSpeed", "", "", "ShowGUI", "Status Line" },
|
||||
|
||||
{ "PandSpeed", "", "", "ShowGUI", "BSDSocket" },
|
||||
{ "BSDSocket", "Miscellaneous", "Miscellaneous", "PandSpeed", "Status Line" },
|
||||
|
||||
// PanelSavestate
|
||||
{ "State0", "Savestates", "Savestates", "LoadState", "State1" },
|
||||
{ "State1", "Savestates", "Savestates", "State0", "State2" },
|
||||
|
@ -245,7 +246,7 @@ bool HandleNavigation(int direction)
|
|||
if(focusHdl != NULL)
|
||||
{
|
||||
gcn::Widget* activeWidget = focusHdl->getFocused();
|
||||
|
||||
|
||||
if(activeWidget != NULL && activeWidget->getId().length() > 0)
|
||||
{
|
||||
std::string activeName = activeWidget->getId();
|
||||
|
|
|
@ -48,7 +48,7 @@ class CPUButtonActionListener : public gcn::ActionListener
|
|||
changed_prefs.fpu_model = 0;
|
||||
changed_prefs.address_space_24 = true;
|
||||
changed_prefs.z3fastmem_size = 0;
|
||||
changed_prefs.gfxmem_size = 0;
|
||||
changed_prefs.rtgmem_size = 0;
|
||||
}
|
||||
else if (actionEvent.getSource() == optCPU68010)
|
||||
{
|
||||
|
@ -56,7 +56,7 @@ class CPUButtonActionListener : public gcn::ActionListener
|
|||
changed_prefs.fpu_model = 0;
|
||||
changed_prefs.address_space_24 = true;
|
||||
changed_prefs.z3fastmem_size = 0;
|
||||
changed_prefs.gfxmem_size = 0;
|
||||
changed_prefs.rtgmem_size = 0;
|
||||
changed_prefs.cpu_compatible = 0;
|
||||
}
|
||||
else if (actionEvent.getSource() == optCPU68020)
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
#include "options.h"
|
||||
#include "uae.h"
|
||||
#include "gui.h"
|
||||
#include "memory.h"
|
||||
#include "newcpu.h"
|
||||
#include "custom.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
|
|
|
@ -34,7 +34,7 @@ static gcn::Button *cmdSaveForDisk;
|
|||
static gcn::Button *cmdCreateDDDisk;
|
||||
static gcn::Button *cmdCreateHDDisk;
|
||||
|
||||
static const char *diskfile_filter[] = { ".adf", ".adz", ".zip", ".gz", ".dms", "\0" };
|
||||
static const char *diskfile_filter[] = { ".adf", ".adz", ".zip", ".gz", ".dms", ".rp9", "\0" };
|
||||
static const char *drivespeedlist[] = { "100% (compatible)", "200%", "400%", "800%" };
|
||||
static const int drivespeedvalues[] = { 100, 200, 400, 800 };
|
||||
|
||||
|
@ -105,7 +105,7 @@ class DriveTypeActionListener : public gcn::ActionListener
|
|||
for(int i=0; i<4; ++i)
|
||||
{
|
||||
if (actionEvent.getSource() == cboDFxType[i])
|
||||
changed_prefs.dfxtype[i] = cboDFxType[i]->getSelected() - 1;
|
||||
changed_prefs.floppyslots[i].dfxtype = cboDFxType[i]->getSelected() - 1;
|
||||
}
|
||||
RefreshPanelFloppy();
|
||||
}
|
||||
|
@ -130,9 +130,9 @@ class DFxCheckActionListener : public gcn::ActionListener
|
|||
// Drive enabled/disabled
|
||||
//---------------------------------------
|
||||
if(chkDFx[i]->isSelected())
|
||||
changed_prefs.dfxtype[i] = DRV_35_DD;
|
||||
changed_prefs.floppyslots[i].dfxtype = DRV_35_DD;
|
||||
else
|
||||
changed_prefs.dfxtype[i] = DRV_NONE;
|
||||
changed_prefs.floppyslots[i].dfxtype = DRV_NONE;
|
||||
}
|
||||
else if(actionEvent.getSource() == chkDFxWriteProtect[i])
|
||||
{
|
||||
|
@ -161,7 +161,7 @@ class DFxButtonActionListener : public gcn::ActionListener
|
|||
//---------------------------------------
|
||||
// Show info about current disk-image
|
||||
//---------------------------------------
|
||||
if(changed_prefs.dfxtype[i] != DRV_NONE && strlen(changed_prefs.df[i]) > 0)
|
||||
if(changed_prefs.floppyslots[i].dfxtype != DRV_NONE && strlen(changed_prefs.floppyslots[i].df) > 0)
|
||||
; // ToDo: Show info dialog
|
||||
}
|
||||
else if (actionEvent.getSource() == cmdDFxEject[i])
|
||||
|
@ -170,7 +170,7 @@ class DFxButtonActionListener : public gcn::ActionListener
|
|||
// Eject disk from drive
|
||||
//---------------------------------------
|
||||
disk_eject(i);
|
||||
strcpy(changed_prefs.df[i], "");
|
||||
strcpy(changed_prefs.floppyslots[i].df, "");
|
||||
AdjustDropDownControls();
|
||||
}
|
||||
else if (actionEvent.getSource() == cmdDFxSelect[i])
|
||||
|
@ -180,15 +180,15 @@ class DFxButtonActionListener : public gcn::ActionListener
|
|||
//---------------------------------------
|
||||
char tmp[MAX_PATH];
|
||||
|
||||
if(strlen(changed_prefs.df[i]) > 0)
|
||||
strncpy(tmp, changed_prefs.df[i], MAX_PATH);
|
||||
if(strlen(changed_prefs.floppyslots[i].df) > 0)
|
||||
strncpy(tmp, changed_prefs.floppyslots[i].df, MAX_PATH);
|
||||
else
|
||||
strncpy(tmp, currentDir, MAX_PATH);
|
||||
if(SelectFile("Select disk image file", tmp, diskfile_filter))
|
||||
{
|
||||
if(strncmp(changed_prefs.df[i], tmp, MAX_PATH))
|
||||
if(strncmp(changed_prefs.floppyslots[i].df, tmp, MAX_PATH))
|
||||
{
|
||||
strncpy(changed_prefs.df[i], tmp, sizeof(changed_prefs.df[i]));
|
||||
strncpy(changed_prefs.floppyslots[i].df, tmp, sizeof(changed_prefs.floppyslots[i].df));
|
||||
disk_insert(i, tmp);
|
||||
AddFileToDiskList(tmp, 1);
|
||||
extractPath(tmp, currentDir);
|
||||
|
@ -196,7 +196,7 @@ class DFxButtonActionListener : public gcn::ActionListener
|
|||
if(i == 0 && chkLoadConfig->isSelected())
|
||||
{
|
||||
// Search for config of disk
|
||||
extractFileName(changed_prefs.df[i], tmp);
|
||||
extractFileName(changed_prefs.floppyslots[i].df, tmp);
|
||||
removeFileExtension(tmp);
|
||||
LoadConfigByName(tmp);
|
||||
}
|
||||
|
@ -232,17 +232,17 @@ class DiskFileActionListener : public gcn::ActionListener
|
|||
if(idx < 0)
|
||||
{
|
||||
disk_eject(i);
|
||||
strcpy(changed_prefs.df[i], "");
|
||||
strcpy(changed_prefs.floppyslots[i].df, "");
|
||||
AdjustDropDownControls();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(diskfileList.getElementAt(idx).compare(changed_prefs.df[i]))
|
||||
if(diskfileList.getElementAt(idx).compare(changed_prefs.floppyslots[i].df))
|
||||
{
|
||||
strncpy(changed_prefs.df[i], diskfileList.getElementAt(idx).c_str(), sizeof(changed_prefs.df[i]));
|
||||
disk_insert(i, changed_prefs.df[i]);
|
||||
strncpy(changed_prefs.floppyslots[i].df, diskfileList.getElementAt(idx).c_str(), sizeof(changed_prefs.floppyslots[i].df));
|
||||
disk_insert(i, changed_prefs.floppyslots[i].df);
|
||||
lstMRUDiskList.erase(lstMRUDiskList.begin() + idx);
|
||||
lstMRUDiskList.insert(lstMRUDiskList.begin(), changed_prefs.df[i]);
|
||||
lstMRUDiskList.insert(lstMRUDiskList.begin(), changed_prefs.floppyslots[i].df);
|
||||
bIgnoreListChange = true;
|
||||
cboDFxFile[i]->setSelected(0);
|
||||
bIgnoreListChange = false;
|
||||
|
@ -252,7 +252,7 @@ class DiskFileActionListener : public gcn::ActionListener
|
|||
// Search for config of disk
|
||||
char tmp[MAX_PATH];
|
||||
|
||||
extractFileName(changed_prefs.df[i], tmp);
|
||||
extractFileName(changed_prefs.floppyslots[i].df, tmp);
|
||||
removeFileExtension(tmp);
|
||||
LoadConfigByName(tmp);
|
||||
}
|
||||
|
@ -287,12 +287,12 @@ class SaveForDiskActionListener : public gcn::ActionListener
|
|||
//---------------------------------------
|
||||
// Save configuration for current disk
|
||||
//---------------------------------------
|
||||
if(strlen(changed_prefs.df[0]) > 0)
|
||||
if(strlen(changed_prefs.floppyslots[0].df) > 0)
|
||||
{
|
||||
char filename[MAX_DPATH];
|
||||
char diskname[MAX_PATH];
|
||||
|
||||
extractFileName(changed_prefs.df[0], diskname);
|
||||
extractFileName(changed_prefs.floppyslots[0].df, diskname);
|
||||
removeFileExtension(diskname);
|
||||
|
||||
fetch_configurationpath(filename, MAX_DPATH);
|
||||
|
@ -324,7 +324,7 @@ class CreateDiskActionListener : public gcn::ActionListener
|
|||
extractFileName(tmp, diskname);
|
||||
removeFileExtension(diskname);
|
||||
diskname[31] = '\0';
|
||||
disk_creatediskfile(tmp, 0, DRV_35_DD, diskname);
|
||||
disk_creatediskfile(tmp, 0, DRV_35_DD, diskname, false, false);
|
||||
AddFileToDiskList(tmp, 1);
|
||||
extractPath(tmp, currentDir);
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ class CreateDiskActionListener : public gcn::ActionListener
|
|||
extractFileName(tmp, diskname);
|
||||
removeFileExtension(diskname);
|
||||
diskname[31] = '\0';
|
||||
disk_creatediskfile(tmp, 0, DRV_35_HD, diskname);
|
||||
disk_creatediskfile(tmp, 0, DRV_35_HD, diskname, false, false);
|
||||
AddFileToDiskList(tmp, 1);
|
||||
extractPath(tmp, currentDir);
|
||||
}
|
||||
|
@ -415,6 +415,7 @@ void InitPanelFloppy(const struct _ConfigCategory& category)
|
|||
chkLoadConfig = new gcn::UaeCheckBox("Load config with same name as disk");
|
||||
chkLoadConfig->setId("LoadDiskCfg");
|
||||
chkLoadConfig->addActionListener(dfxCheckActionListener);
|
||||
chkLoadConfig->setSelected(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -528,11 +529,11 @@ static void AdjustDropDownControls(void)
|
|||
{
|
||||
cboDFxFile[i]->clearSelected();
|
||||
|
||||
if((changed_prefs.dfxtype[i] != DRV_NONE) && strlen(changed_prefs.df[i]) > 0)
|
||||
if((changed_prefs.floppyslots[i].dfxtype != DRV_NONE) && strlen(changed_prefs.floppyslots[i].df) > 0)
|
||||
{
|
||||
for(j=0; j<lstMRUDiskList.size(); ++j)
|
||||
{
|
||||
if(!lstMRUDiskList[j].compare(changed_prefs.df[i]))
|
||||
if(!lstMRUDiskList[j].compare(changed_prefs.floppyslots[i].df))
|
||||
{
|
||||
cboDFxFile[i]->setSelected(j);
|
||||
break;
|
||||
|
@ -555,10 +556,10 @@ void RefreshPanelFloppy(void)
|
|||
changed_prefs.nr_floppies = 0;
|
||||
for(i=0; i<4; ++i)
|
||||
{
|
||||
bool driveEnabled = changed_prefs.dfxtype[i] != DRV_NONE;
|
||||
bool driveEnabled = changed_prefs.floppyslots[i].dfxtype != DRV_NONE;
|
||||
chkDFx[i]->setSelected(driveEnabled);
|
||||
cboDFxType[i]->setSelected(changed_prefs.dfxtype[i] + 1);
|
||||
chkDFxWriteProtect[i]->setSelected(disk_getwriteprotect(changed_prefs.df[i]));
|
||||
cboDFxType[i]->setSelected(changed_prefs.floppyslots[i].dfxtype + 1);
|
||||
chkDFxWriteProtect[i]->setSelected(disk_getwriteprotect(&changed_prefs, changed_prefs.floppyslots[i].df));
|
||||
chkDFx[i]->setEnabled(prevAvailable);
|
||||
cboDFxType[i]->setEnabled(prevAvailable);
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ class HDRemoveActionListener : public gcn::ActionListener
|
|||
if (actionEvent.getSource() == listCmdDelete[i])
|
||||
{
|
||||
kill_filesys_unitconfig(&changed_prefs, i);
|
||||
gui_force_rtarea_hdchange();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -88,9 +89,15 @@ class HDEditActionListener : public gcn::ActionListener
|
|||
if (actionEvent.getSource() == listCmdProps[i])
|
||||
{
|
||||
if (GetHDType(i) == FILESYS_VIRTUAL)
|
||||
EditFilesysVirtual(i);
|
||||
{
|
||||
if(EditFilesysVirtual(i))
|
||||
gui_force_rtarea_hdchange();
|
||||
}
|
||||
else
|
||||
EditFilesysHardfile(i);
|
||||
{
|
||||
if(EditFilesysHardfile(i))
|
||||
gui_force_rtarea_hdchange();
|
||||
}
|
||||
listCmdProps[i]->requestFocus();
|
||||
break;
|
||||
}
|
||||
|
@ -106,7 +113,8 @@ class AddVirtualHDActionListener : public gcn::ActionListener
|
|||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent)
|
||||
{
|
||||
EditFilesysVirtual(-1);
|
||||
if(EditFilesysVirtual(-1))
|
||||
gui_force_rtarea_hdchange();
|
||||
cmdAddDirectory->requestFocus();
|
||||
RefreshPanelHD();
|
||||
}
|
||||
|
@ -119,7 +127,8 @@ class AddHardfileActionListener : public gcn::ActionListener
|
|||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent)
|
||||
{
|
||||
EditFilesysHardfile(-1);
|
||||
if(EditFilesysHardfile(-1))
|
||||
gui_force_rtarea_hdchange();
|
||||
cmdAddHardfile->requestFocus();
|
||||
RefreshPanelHD();
|
||||
}
|
||||
|
@ -132,7 +141,8 @@ class CreateHardfileActionListener : public gcn::ActionListener
|
|||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent)
|
||||
{
|
||||
CreateFilesysHardfile();
|
||||
if(CreateFilesysHardfile())
|
||||
gui_force_rtarea_hdchange();
|
||||
cmdCreateHardfile->requestFocus();
|
||||
RefreshPanelHD();
|
||||
}
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
|
||||
static const char *mousespeed_list[] = { ".25", ".5", "1x", "2x", "4x" };
|
||||
static const int mousespeed_values[] = { 2, 5, 10, 20, 40 };
|
||||
#ifndef RASPBERRY
|
||||
static const char *stylusoffset_list[] = { "None", "1 px", "2 px", "3 px", "4 px", "5 px", "6 px", "7 px", "8 px", "9 px", "10 px" };
|
||||
static const int stylusoffset_values[] = { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 };
|
||||
#endif
|
||||
|
||||
static gcn::Label *lblCtrlConfig;
|
||||
static gcn::UaeDropDown* cboCtrlConfig;
|
||||
|
@ -39,9 +35,7 @@ static gcn::Slider* sldMouseSpeed;
|
|||
#ifndef RASPBERRY
|
||||
static gcn::Label *lblTapDelay;
|
||||
static gcn::UaeDropDown* cboTapDelay;
|
||||
static gcn::Label* lblStylusOffset;
|
||||
static gcn::Label* lblStylusOffsetInfo;
|
||||
static gcn::Slider* sldStylusOffset;
|
||||
static gcn::UaeCheckBox* chkMouseHack;
|
||||
#endif
|
||||
|
||||
static gcn::UaeCheckBox* chkCustomCtrl;
|
||||
|
@ -170,11 +164,11 @@ class InputActionListener : public gcn::ActionListener
|
|||
else
|
||||
changed_prefs.pandora_tapDelay = 2;
|
||||
}
|
||||
else if (actionEvent.getSource() == sldStylusOffset)
|
||||
{
|
||||
changed_prefs.pandora_stylusOffset = stylusoffset_values[(int)(sldStylusOffset->getValue())];
|
||||
RefreshPanelInput();
|
||||
}
|
||||
|
||||
else if (actionEvent.getSource() == chkMouseHack)
|
||||
{
|
||||
changed_prefs.input_tablet = chkMouseHack->isSelected() ? TABLET_MOUSEHACK : TABLET_OFF;
|
||||
}
|
||||
#endif
|
||||
else if (actionEvent.getSource() == chkCustomCtrl)
|
||||
changed_prefs.pandora_customControls = chkCustomCtrl->isSelected() ? 1 : 0;
|
||||
|
@ -267,24 +261,16 @@ void InitPanelInput(const struct _ConfigCategory& category)
|
|||
cboTapDelay->setBaseColor(gui_baseCol);
|
||||
cboTapDelay->setId("cboTapDelay");
|
||||
cboTapDelay->addActionListener(inputActionListener);
|
||||
|
||||
lblStylusOffset = new gcn::Label("Stylus Offset:");
|
||||
lblStylusOffset->setSize(100, LABEL_HEIGHT);
|
||||
lblStylusOffset->setAlignment(gcn::Graphics::RIGHT);
|
||||
sldStylusOffset = new gcn::Slider(0, 10);
|
||||
sldStylusOffset->setSize(110, SLIDER_HEIGHT);
|
||||
sldStylusOffset->setBaseColor(gui_baseCol);
|
||||
sldStylusOffset->setMarkerLength(20);
|
||||
sldStylusOffset->setStepLength(1);
|
||||
sldStylusOffset->setId("StylusOffset");
|
||||
sldStylusOffset->addActionListener(inputActionListener);
|
||||
lblStylusOffsetInfo = new gcn::Label("10 px");
|
||||
|
||||
chkMouseHack = new gcn::UaeCheckBox("Enable mousehack");
|
||||
chkMouseHack->setId("MouseHack");
|
||||
chkMouseHack->addActionListener(inputActionListener);
|
||||
#endif
|
||||
chkCustomCtrl = new gcn::UaeCheckBox("Custom Control");
|
||||
chkCustomCtrl->setId("CustomCtrl");
|
||||
chkCustomCtrl->addActionListener(inputActionListener);
|
||||
|
||||
lblDPAD = new gcn::Label("DPAD/Port1:");
|
||||
lblDPAD = new gcn::Label("DPAD:");
|
||||
lblDPAD->setSize(100, LABEL_HEIGHT);
|
||||
lblDPAD->setAlignment(gcn::Graphics::RIGHT);
|
||||
cboDPAD = new gcn::UaeDropDown(&dPADList);
|
||||
|
@ -400,13 +386,11 @@ void InitPanelInput(const struct _ConfigCategory& category)
|
|||
category.panel->add(lblMouseSpeed, DISTANCE_BORDER, posY);
|
||||
category.panel->add(sldMouseSpeed, DISTANCE_BORDER + lblMouseSpeed->getWidth() + 8, posY);
|
||||
category.panel->add(lblMouseSpeedInfo, sldMouseSpeed->getX() + sldMouseSpeed->getWidth() + 12, posY);
|
||||
posY += sldMouseSpeed->getHeight() + DISTANCE_NEXT_Y;
|
||||
#ifndef RASPBERRY
|
||||
category.panel->add(lblStylusOffset, DISTANCE_BORDER, posY);
|
||||
category.panel->add(sldStylusOffset, DISTANCE_BORDER + lblStylusOffset->getWidth() + 8, posY);
|
||||
category.panel->add(lblStylusOffsetInfo, sldStylusOffset->getX() + sldStylusOffset->getWidth() + 12, posY);
|
||||
posY += sldStylusOffset->getHeight() + DISTANCE_NEXT_Y;
|
||||
category.panel->add(chkMouseHack, 320, posY);
|
||||
#endif
|
||||
posY += sldMouseSpeed->getHeight() + DISTANCE_NEXT_Y;
|
||||
|
||||
category.panel->add(lblDPAD, DISTANCE_BORDER, posY);
|
||||
category.panel->add(cboDPAD, DISTANCE_BORDER + lblDPAD->getWidth() + 8, posY);
|
||||
category.panel->add(chkCustomCtrl, 320, posY);
|
||||
|
@ -455,9 +439,7 @@ void ExitPanelInput(void)
|
|||
#ifndef RASPBERRY
|
||||
delete lblTapDelay;
|
||||
delete cboTapDelay;
|
||||
delete lblStylusOffset;
|
||||
delete sldStylusOffset;
|
||||
delete lblStylusOffsetInfo;
|
||||
delete chkMouseHack;
|
||||
#endif
|
||||
delete chkCustomCtrl;
|
||||
delete lblDPAD;
|
||||
|
@ -517,16 +499,8 @@ void RefreshPanelInput(void)
|
|||
cboTapDelay->setSelected(1);
|
||||
else
|
||||
cboTapDelay->setSelected(2);
|
||||
|
||||
for(i=0; i<11; ++i)
|
||||
{
|
||||
if(changed_prefs.pandora_stylusOffset == stylusoffset_values[i])
|
||||
{
|
||||
sldStylusOffset->setValue(i);
|
||||
lblStylusOffsetInfo->setCaption(stylusoffset_list[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
chkMouseHack->setSelected(changed_prefs.input_tablet == TABLET_MOUSEHACK);
|
||||
#endif
|
||||
chkCustomCtrl->setSelected(changed_prefs.pandora_customControls);
|
||||
cboDPAD->setSelected(changed_prefs.pandora_custom_dpad);
|
||||
|
|
|
@ -30,6 +30,8 @@ static gcn::Label* lblPandoraSpeed;
|
|||
static gcn::Label* lblPandoraSpeedInfo;
|
||||
static gcn::Slider* sldPandoraSpeed;
|
||||
#endif
|
||||
static gcn::UaeCheckBox* chkBSDSocket;
|
||||
|
||||
|
||||
class MiscActionListener : public gcn::ActionListener
|
||||
{
|
||||
|
@ -42,6 +44,9 @@ class MiscActionListener : public gcn::ActionListener
|
|||
else if (actionEvent.getSource() == chkShowGUI)
|
||||
changed_prefs.start_gui = chkShowGUI->isSelected();
|
||||
|
||||
else if (actionEvent.getSource() == chkBSDSocket)
|
||||
changed_prefs.socket_emu = chkBSDSocket->isSelected();
|
||||
|
||||
#ifdef RASPBERRY
|
||||
else if (actionEvent.getSource() == chkAspect)
|
||||
changed_prefs.gfx_correct_aspect = chkAspect->isSelected();
|
||||
|
@ -91,6 +96,11 @@ void InitPanelMisc(const struct _ConfigCategory& category)
|
|||
sldPandoraSpeed->addActionListener(miscActionListener);
|
||||
lblPandoraSpeedInfo = new gcn::Label("1000 MHz");
|
||||
#endif
|
||||
|
||||
chkBSDSocket = new gcn::UaeCheckBox("bsdsocket.library");
|
||||
chkBSDSocket->setId("BSDSocket");
|
||||
chkBSDSocket->addActionListener(miscActionListener);
|
||||
|
||||
int posY = DISTANCE_BORDER;
|
||||
category.panel->add(chkStatusLine, DISTANCE_BORDER, posY);
|
||||
posY += chkStatusLine->getHeight() + DISTANCE_NEXT_Y;
|
||||
|
@ -106,6 +116,8 @@ void InitPanelMisc(const struct _ConfigCategory& category)
|
|||
category.panel->add(lblPandoraSpeedInfo, sldPandoraSpeed->getX() + sldPandoraSpeed->getWidth() + 12, posY);
|
||||
posY += sldPandoraSpeed->getHeight() + DISTANCE_NEXT_Y;
|
||||
#endif
|
||||
category.panel->add(chkBSDSocket, DISTANCE_BORDER, posY);
|
||||
posY += chkBSDSocket->getHeight() + DISTANCE_NEXT_Y;
|
||||
RefreshPanelMisc();
|
||||
}
|
||||
|
||||
|
@ -122,6 +134,7 @@ void ExitPanelMisc(void)
|
|||
delete sldPandoraSpeed;
|
||||
delete lblPandoraSpeedInfo;
|
||||
#endif
|
||||
delete chkBSDSocket;
|
||||
delete miscActionListener;
|
||||
}
|
||||
|
||||
|
@ -140,4 +153,6 @@ void RefreshPanelMisc(void)
|
|||
snprintf(tmp, 20, "%d MHz", changed_prefs.pandora_cpu_speed);
|
||||
lblPandoraSpeedInfo->setCaption(tmp);
|
||||
#endif
|
||||
|
||||
chkBSDSocket->setSelected(changed_prefs.socket_emu);
|
||||
}
|
||||
|
|
|
@ -22,8 +22,8 @@ static const char *ChipMem_list[] = { "512 K", "1 MB", "2 MB", "4 MB", "8 MB" };
|
|||
static const int ChipMem_values[] = { 0x080000, 0x100000, 0x200000, 0x400000, 0x800000 };
|
||||
static const char *SlowMem_list[] = { "None", "512 K", "1 MB", "1.5 MB", "1.8 MB" };
|
||||
static const int SlowMem_values[] = { 0x000000, 0x080000, 0x100000, 0x180000, 0x1c0000 };
|
||||
static const char *FastMem_list[] = { "None", "1 MB", "2 MB", "4 MB", "8 MB", "16 MB", "32 MB", "64 MB" };
|
||||
static const int FastMem_values[] = { 0x000000, 0x100000, 0x200000, 0x400000, 0x800000, 0x1000000, 0x2000000, 0x4000000 };
|
||||
static const char *FastMem_list[] = { "None", "1 MB", "2 MB", "4 MB", "8 MB", "16 MB", "32 MB", "64 MB", "128 MB" };
|
||||
static const int FastMem_values[] = { 0x000000, 0x100000, 0x200000, 0x400000, 0x800000, 0x1000000, 0x2000000, 0x4000000, 0x8000000 };
|
||||
|
||||
static gcn::Window *grpRAM;
|
||||
static gcn::Label* lblChipmem;
|
||||
|
@ -71,7 +71,8 @@ class MemorySliderActionListener : public gcn::ActionListener
|
|||
}
|
||||
|
||||
if (actionEvent.getSource() == sldGfxmem) {
|
||||
changed_prefs.gfxmem_size = FastMem_values[(int)(sldGfxmem->getValue())];
|
||||
changed_prefs.rtgmem_size = FastMem_values[(int)(sldGfxmem->getValue())];
|
||||
changed_prefs.rtgmem_type = 1;
|
||||
}
|
||||
|
||||
RefreshPanelRAM();
|
||||
|
@ -115,7 +116,7 @@ void InitPanelRAM(const struct _ConfigCategory& category)
|
|||
lblFastsize = new gcn::Label("None ");
|
||||
|
||||
lblZ3mem = new gcn::Label("Z3 fast:");
|
||||
sldZ3mem = new gcn::Slider(0, 7);
|
||||
sldZ3mem = new gcn::Slider(0, 8);
|
||||
sldZ3mem->setSize(110, SLIDER_HEIGHT);
|
||||
sldZ3mem->setBaseColor(gui_baseCol);
|
||||
sldZ3mem->setMarkerLength(20);
|
||||
|
@ -229,7 +230,7 @@ void RefreshPanelRAM(void)
|
|||
}
|
||||
}
|
||||
|
||||
for(i=0; i<8; ++i)
|
||||
for(i=0; i<9; ++i)
|
||||
{
|
||||
if(changed_prefs.z3fastmem_size == FastMem_values[i])
|
||||
{
|
||||
|
@ -242,7 +243,7 @@ void RefreshPanelRAM(void)
|
|||
|
||||
for(i=0; i<6; ++i)
|
||||
{
|
||||
if(changed_prefs.gfxmem_size == FastMem_values[i])
|
||||
if(changed_prefs.rtgmem_size == FastMem_values[i])
|
||||
{
|
||||
sldGfxmem->setValue(i);
|
||||
lblGfxsize->setCaption(FastMem_list[i]);
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "config.h"
|
||||
#include "options.h"
|
||||
#include "memory.h"
|
||||
#include "rommgr.h"
|
||||
#include "uae.h"
|
||||
#include "gui.h"
|
||||
#include "target.h"
|
||||
|
|
|
@ -12,8 +12,10 @@
|
|||
#include "config.h"
|
||||
#include "options.h"
|
||||
#include "autoconf.h"
|
||||
#include "xwin.h"
|
||||
#include "memory.h"
|
||||
#include "newcpu.h"
|
||||
#include "custom.h"
|
||||
#include "xwin.h"
|
||||
#include "drawing.h"
|
||||
#include "uae.h"
|
||||
#include "gui.h"
|
||||
|
@ -63,7 +65,7 @@ class SavestateActionListener : public gcn::ActionListener
|
|||
if (f)
|
||||
{
|
||||
fclose(f);
|
||||
savestate_initsave(savestate_fname, 2, 0);
|
||||
savestate_initsave(savestate_fname, 2, 0, false);
|
||||
savestate_state = STATE_DORESTORE;
|
||||
gui_running = false;
|
||||
}
|
||||
|
@ -81,7 +83,7 @@ class SavestateActionListener : public gcn::ActionListener
|
|||
//------------------------------------------
|
||||
if(emulating)
|
||||
{
|
||||
savestate_initsave(savestate_fname, 2, 0);
|
||||
savestate_initsave(savestate_fname, 2, 0, false);
|
||||
save_state (savestate_fname, "...");
|
||||
savestate_state = STATE_DOSAVE; // Just to create the screenshot
|
||||
delay_savestate_frame = 1;
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
#include "options.h"
|
||||
#include "uae.h"
|
||||
#include "gui.h"
|
||||
#include "memory.h"
|
||||
#include "newcpu.h"
|
||||
#include "custom.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
|
|
|
@ -34,6 +34,8 @@ extern gcn::Color gui_baseCol;
|
|||
extern gcn::SDLInput* gui_input;
|
||||
extern SDL_Surface* gui_screen;
|
||||
|
||||
extern void gui_force_rtarea_hdchange(void);
|
||||
|
||||
extern char currentDir[MAX_DPATH];
|
||||
extern char last_loaded_config[MAX_DPATH];
|
||||
|
||||
|
@ -88,7 +90,6 @@ 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 create = false);
|
||||
|
|
|
@ -63,16 +63,43 @@ namespace widgets
|
|||
}
|
||||
|
||||
|
||||
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;
|
||||
/* Flag for changes in rtarea:
|
||||
Bit 0: any HD in config?
|
||||
Bit 1: force because add/remove HD was clicked
|
||||
Bit 2: socket_emu on
|
||||
Bit 3: mousehack on
|
||||
Bit 4: rtgmem on
|
||||
Bit 5: chipmem larger than 2MB
|
||||
|
||||
gui_rtarea_flags_onenter is set before GUI is shown, bit 1 may change during GUI display.
|
||||
*/
|
||||
static int gui_rtarea_flags_onenter;
|
||||
|
||||
return 0;
|
||||
static int gui_create_rtarea_flag(struct uae_prefs *p)
|
||||
{
|
||||
int flag = 0;
|
||||
|
||||
if(count_HDs(p) > 0)
|
||||
flag |= 1;
|
||||
|
||||
if (p->socket_emu)
|
||||
flag |= 4;
|
||||
|
||||
if (p->input_tablet > 0)
|
||||
flag |= 8;
|
||||
|
||||
if(p->rtgmem_size)
|
||||
flag |= 16;
|
||||
|
||||
if (p->chipmem_size > 2 * 1024 * 1024)
|
||||
flag |= 32;
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
void gui_force_rtarea_hdchange(void)
|
||||
{
|
||||
gui_rtarea_flags_onenter |= 2;
|
||||
}
|
||||
|
||||
|
||||
|
@ -152,14 +179,22 @@ namespace sdl
|
|||
|
||||
else if (event.type == SDL_KEYDOWN)
|
||||
{
|
||||
gcn::FocusHandler* focusHdl;
|
||||
gcn::Widget* activeWidget;
|
||||
|
||||
switch(event.key.keysym.sym)
|
||||
{
|
||||
case SDLK_q:
|
||||
//-------------------------------------------------
|
||||
// Quit entire program via Q on keyboard
|
||||
//-------------------------------------------------
|
||||
uae_quit();
|
||||
gui_running = false;
|
||||
focusHdl = gui_top->_getFocusHandler();
|
||||
activeWidget = focusHdl->getFocused();
|
||||
if(dynamic_cast<gcn::TextField*>(activeWidget) == NULL) {
|
||||
// ...but only if we are not in a Textfield...
|
||||
uae_quit();
|
||||
gui_running = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case SDLK_ESCAPE:
|
||||
|
@ -227,6 +262,9 @@ namespace sdl
|
|||
gui_input->pushInput(event);
|
||||
}
|
||||
|
||||
if(gui_rtarea_flags_onenter != gui_create_rtarea_flag(&changed_prefs))
|
||||
DisableResume();
|
||||
|
||||
// Now we let the Gui object perform its logic.
|
||||
uae_gui->logic();
|
||||
// Now we let the Gui object draw itself.
|
||||
|
@ -510,10 +548,8 @@ void DisableResume(void)
|
|||
|
||||
void run_gui(void)
|
||||
{
|
||||
int boot_rom_on_enter;
|
||||
|
||||
gui_running = true;
|
||||
boot_rom_on_enter = gui_check_boot_rom(&currprefs);
|
||||
gui_rtarea_flags_onenter = gui_create_rtarea_flag(&currprefs);
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -548,7 +584,7 @@ void run_gui(void)
|
|||
//--------------------------------------------------
|
||||
currprefs.nr_floppies = changed_prefs.nr_floppies;
|
||||
|
||||
if(boot_rom_on_enter != gui_check_boot_rom(&changed_prefs))
|
||||
if(gui_rtarea_flags_onenter != gui_create_rtarea_flag(&changed_prefs))
|
||||
quit_program = -3; // Hardreset required...
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,19 @@ extern SDL_Surface *prSDLScreen;
|
|||
static SDL_Surface *inputMode[3];
|
||||
|
||||
|
||||
void inputmode_close(void)
|
||||
{
|
||||
for(int i=0; i<3; ++i)
|
||||
{
|
||||
if(inputMode[i] != NULL)
|
||||
{
|
||||
SDL_FreeSurface(inputMode[i]);
|
||||
inputMode[i] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void inputmode_init(void)
|
||||
{
|
||||
int i;
|
||||
|
@ -111,3 +124,9 @@ void set_joyConf(struct uae_prefs *p)
|
|||
p->pandora_autofireButton1 = GP2X_BUTTON_Y;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int is_tablet (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define SIMULATE_SHIFT 0x200
|
||||
#define SIMULATE_RELEASED_SHIFT 0x400
|
||||
|
||||
void inputmode_close(void);
|
||||
void inputmode_init(void);
|
||||
void inputmode_redraw(void);
|
||||
|
||||
|
|
|
@ -15,8 +15,10 @@
|
|||
#include "uae.h"
|
||||
#include "options.h"
|
||||
#include "memory.h"
|
||||
#include "newcpu.h"
|
||||
#include "custom.h"
|
||||
#include "joystick.h"
|
||||
#include "inputdevice.h"
|
||||
#include "SDL.h"
|
||||
|
||||
#ifdef GP2X
|
||||
|
@ -45,13 +47,42 @@ static SDL_Joystick *uae4all_joy0, *uae4all_joy1;
|
|||
|
||||
void read_joystick(int nr, unsigned int *dir, int *button)
|
||||
{
|
||||
int left = 0, right = 0, top = 0, bot = 0, upRight=0, downRight=0, upLeft=0, downLeft=0, x=0, y=0, a=0, b=0;
|
||||
SDL_Joystick *joy = nr == 0 ? uae4all_joy0 : uae4all_joy1;
|
||||
int left = 0, right = 0, top = 0, bot = 0;
|
||||
SDL_Joystick *joy = nr == 1 ? uae4all_joy0 : uae4all_joy1;
|
||||
|
||||
if(nr == 0)
|
||||
{
|
||||
static int last_buttonstate0 = 0;
|
||||
static int delay_leftmouse = 0;
|
||||
|
||||
if(last_buttonstate0 != buttonstate[0])
|
||||
{
|
||||
last_buttonstate0 = buttonstate[0];
|
||||
if(buttonstate[0])
|
||||
{
|
||||
// Left mousebutton click -> delay click
|
||||
delay_leftmouse = 2;
|
||||
}
|
||||
}
|
||||
if(delay_leftmouse)
|
||||
{
|
||||
--delay_leftmouse;
|
||||
*button = (buttonstate[2] ? 2 : 0) | (buttonstate[1] ? 4 : 0);
|
||||
}
|
||||
else
|
||||
*button = (buttonstate[0] ? 1 : 0) | (buttonstate[2] ? 2 : 0) | (buttonstate[1] ? 4 : 0);
|
||||
}
|
||||
else
|
||||
*button = 0;
|
||||
|
||||
if(currprefs.pandora_joyPort != 0)
|
||||
{
|
||||
// Only one joystick active
|
||||
if((nr == 0 && currprefs.pandora_joyPort == 2) || (nr == 1 && currprefs.pandora_joyPort == 1))
|
||||
return;
|
||||
}
|
||||
|
||||
*dir = 0;
|
||||
*button = 0;
|
||||
|
||||
nr = (~nr)&0x1;
|
||||
|
||||
SDL_JoystickUpdate ();
|
||||
|
||||
|
@ -63,10 +94,12 @@ void read_joystick(int nr, unsigned int *dir, int *button)
|
|||
{
|
||||
// get joystick direction via dPad or joystick
|
||||
int hat=SDL_JoystickGetHat(joy,0);
|
||||
if ((hat & SDL_HAT_RIGHT) || dpadRight || SDL_JoystickGetAxis(joy, 0) > 0) right=1;
|
||||
if ((hat & SDL_HAT_LEFT) || dpadLeft || SDL_JoystickGetAxis(joy, 0) < 0) left=1;
|
||||
if ((hat & SDL_HAT_UP) || dpadUp || SDL_JoystickGetAxis(joy, 1) < 0) top=1;
|
||||
if ((hat & SDL_HAT_DOWN) || dpadDown || SDL_JoystickGetAxis(joy, 1) > 0) bot=1;
|
||||
int val = SDL_JoystickGetAxis(joy, 0);
|
||||
if ((hat & SDL_HAT_RIGHT) || dpadRight || val > 0) right=1;
|
||||
if ((hat & SDL_HAT_LEFT) || dpadLeft || val < 0) left=1;
|
||||
val = SDL_JoystickGetAxis(joy, 1);
|
||||
if ((hat & SDL_HAT_UP) || dpadUp || val < 0) top=1;
|
||||
if ((hat & SDL_HAT_DOWN) || dpadDown || val > 0) bot=1;
|
||||
if (currprefs.pandora_joyConf)
|
||||
{
|
||||
if ((buttonX && currprefs.pandora_jump > -1) || SDL_JoystickGetButton(joy, currprefs.pandora_jump))
|
||||
|
@ -120,7 +153,7 @@ void read_joystick(int nr, unsigned int *dir, int *button)
|
|||
&& delay > currprefs.input_autofire_framecnt))
|
||||
{
|
||||
if(!buttonB)
|
||||
*button=1;
|
||||
*button |= 1;
|
||||
delay=0;
|
||||
*button |= (buttonB & 1) << 1;
|
||||
}
|
||||
|
@ -130,11 +163,11 @@ void read_joystick(int nr, unsigned int *dir, int *button)
|
|||
{
|
||||
// get joystick button via custom controls
|
||||
if((currprefs.pandora_custom_A==-3 && buttonA) || (currprefs.pandora_custom_B==-3 && buttonB) || (currprefs.pandora_custom_X==-3 && buttonX) || (currprefs.pandora_custom_Y==-3 && buttonY) || (currprefs.pandora_custom_L==-3 && triggerL) || (currprefs.pandora_custom_R==-3 && triggerR))
|
||||
*button = 1;
|
||||
*button |= 1;
|
||||
else if(currprefs.pandora_custom_dpad == 2)
|
||||
{
|
||||
if((currprefs.pandora_custom_up==-3 && dpadUp) || (currprefs.pandora_custom_down==-3 && dpadDown) || (currprefs.pandora_custom_left==-3 && dpadLeft) || (currprefs.pandora_custom_right==-3 && dpadRight))
|
||||
*button = 1;
|
||||
*button |= 1;
|
||||
}
|
||||
|
||||
if((currprefs.pandora_custom_A==-4 && buttonA) || (currprefs.pandora_custom_B==-4 && buttonB) || (currprefs.pandora_custom_X==-4 && buttonX) || (currprefs.pandora_custom_Y==-4 && buttonY) || (currprefs.pandora_custom_L==-4 && triggerL) || (currprefs.pandora_custom_R==-4 && triggerR))
|
||||
|
@ -149,7 +182,7 @@ void read_joystick(int nr, unsigned int *dir, int *button)
|
|||
else
|
||||
{
|
||||
// get joystick button via ABXY or joystick
|
||||
*button = ((currprefs.pandora_button1==GP2X_BUTTON_B && buttonA) || (currprefs.pandora_button1==GP2X_BUTTON_X && buttonX) || (currprefs.pandora_button1==GP2X_BUTTON_Y && buttonY) || SDL_JoystickGetButton(joy, currprefs.pandora_button1)) & 1;
|
||||
*button |= ((currprefs.pandora_button1==GP2X_BUTTON_B && buttonA) || (currprefs.pandora_button1==GP2X_BUTTON_X && buttonX) || (currprefs.pandora_button1==GP2X_BUTTON_Y && buttonY) || SDL_JoystickGetButton(joy, currprefs.pandora_button1)) & 1;
|
||||
delay++;
|
||||
|
||||
*button |= ((buttonB || SDL_JoystickGetButton(joy, currprefs.pandora_button2)) & 1) << 1;
|
||||
|
@ -175,48 +208,32 @@ void read_joystick(int nr, unsigned int *dir, int *button)
|
|||
if (right)
|
||||
bot = !bot;
|
||||
*dir = bot | (right << 1) | (top << 8) | (left << 9);
|
||||
|
||||
if(currprefs.pandora_joyPort != 0)
|
||||
{
|
||||
// Only one joystick active
|
||||
if((nr == 0 && currprefs.pandora_joyPort == 2) || (nr == 1 && currprefs.pandora_joyPort == 1))
|
||||
{
|
||||
*dir = 0;
|
||||
*button = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void handle_joymouse(void)
|
||||
{
|
||||
if (currprefs.pandora_custom_dpad == 1)
|
||||
{
|
||||
int mouseScale = currprefs.input_joymouse_multiplier / 2;
|
||||
int y = 1024;
|
||||
int mouseScale = currprefs.input_joymouse_multiplier / 2;
|
||||
|
||||
if (buttonY) // slow mouse active
|
||||
mouseScale = currprefs.input_joymouse_multiplier / 10;
|
||||
if (buttonY) // slow mouse active
|
||||
mouseScale = currprefs.input_joymouse_multiplier / 10;
|
||||
|
||||
if (dpadLeft)
|
||||
{
|
||||
lastmx -= mouseScale;
|
||||
newmousecounters=1;
|
||||
}
|
||||
if (dpadRight)
|
||||
{
|
||||
lastmx += mouseScale;
|
||||
newmousecounters=1;
|
||||
}
|
||||
if (dpadUp)
|
||||
{
|
||||
lastmy -= mouseScale;
|
||||
newmousecounters=1;
|
||||
}
|
||||
if (dpadDown)
|
||||
{
|
||||
lastmy += mouseScale;
|
||||
newmousecounters=1;
|
||||
}
|
||||
if (dpadLeft) {
|
||||
setmousestate(0, 0, -mouseScale, 0);
|
||||
y = 0;
|
||||
}
|
||||
if (dpadRight) {
|
||||
setmousestate(0, 0, mouseScale, 0);
|
||||
y = 0;
|
||||
}
|
||||
if (dpadUp) {
|
||||
y = -mouseScale;
|
||||
}
|
||||
if (dpadDown) {
|
||||
y = mouseScale;
|
||||
}
|
||||
if(y < 1024)
|
||||
setmousestate(0, 1, y, 0);
|
||||
}
|
||||
|
||||
void init_joystick(void)
|
||||
|
|
|
@ -4,8 +4,9 @@
|
|||
#include "options.h"
|
||||
#include "uae.h"
|
||||
#include "memory.h"
|
||||
#include "xwin.h"
|
||||
#include "newcpu.h"
|
||||
#include "custom.h"
|
||||
#include "xwin.h"
|
||||
#include "drawing.h"
|
||||
#include "keyboard.h"
|
||||
#include "keybuf.h"
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
#include "options.h"
|
||||
#include "gui.h"
|
||||
#include "sd-pandora/sound.h"
|
||||
#include "memory.h"
|
||||
#include "newcpu.h"
|
||||
#include "custom.h"
|
||||
#include "od-pandora/gp2x.h"
|
||||
#include "uae.h"
|
||||
|
@ -459,7 +461,7 @@ int loadconfig_old(struct uae_prefs *p, const char *orgpath)
|
|||
p->pandora_joyPort = ((joybuffer >> 4) & 0x0f);
|
||||
fscanf(f,"autofireRate=%d\n",&p->input_autofire_framecnt);
|
||||
fscanf(f,"autofire=%d\n", &dummy);
|
||||
fscanf(f,"stylusOffset=%d\n",&p->pandora_stylusOffset);
|
||||
fscanf(f,"stylusOffset=%d\n",&dummy);
|
||||
fscanf(f,"tapDelay=%d\n",&p->pandora_tapDelay);
|
||||
fscanf(f,"scanlines=%d\n", &dummy);
|
||||
#if defined(PANDORA) || defined(ANDROIDSDL)
|
||||
|
@ -561,20 +563,20 @@ int loadconfig_old(struct uae_prefs *p, const char *orgpath)
|
|||
disk_eject(3);
|
||||
fscanf(f,"df0=%s\n",&filebuffer);
|
||||
replace(filebuffer,' ','|');
|
||||
if(DISK_validate_filename(filebuffer, 0, NULL, NULL))
|
||||
strcpy(p->df[0], filebuffer);
|
||||
if(DISK_validate_filename(p, filebuffer, 0, NULL, NULL, NULL))
|
||||
strcpy(p->floppyslots[0].df, filebuffer);
|
||||
else
|
||||
p->df[0][0] = 0;
|
||||
p->floppyslots[0].df[0] = 0;
|
||||
disk_insert(0, filebuffer);
|
||||
if(p->nr_floppies > 1)
|
||||
{
|
||||
memset(filebuffer, 0, 256);
|
||||
fscanf(f,"df1=%s\n",&filebuffer);
|
||||
replace(filebuffer,' ','|');
|
||||
if(DISK_validate_filename(filebuffer, 0, NULL, NULL))
|
||||
strcpy(p->df[1], filebuffer);
|
||||
if(DISK_validate_filename(p, filebuffer, 0, NULL, NULL, NULL))
|
||||
strcpy(p->floppyslots[1].df, filebuffer);
|
||||
else
|
||||
p->df[1][0] = 0;
|
||||
p->floppyslots[1].df[0] = 0;
|
||||
disk_insert(1, filebuffer);
|
||||
}
|
||||
if(p->nr_floppies > 2)
|
||||
|
@ -582,10 +584,10 @@ int loadconfig_old(struct uae_prefs *p, const char *orgpath)
|
|||
memset(filebuffer, 0, 256);
|
||||
fscanf(f,"df2=%s\n",&filebuffer);
|
||||
replace(filebuffer,' ','|');
|
||||
if(DISK_validate_filename(filebuffer, 0, NULL, NULL))
|
||||
strcpy(p->df[2], filebuffer);
|
||||
if(DISK_validate_filename(p, filebuffer, 0, NULL, NULL, NULL))
|
||||
strcpy(p->floppyslots[2].df, filebuffer);
|
||||
else
|
||||
p->df[2][0] = 0;
|
||||
p->floppyslots[2].df[0] = 0;
|
||||
disk_insert(2, filebuffer);
|
||||
}
|
||||
if(p->nr_floppies > 3)
|
||||
|
@ -593,19 +595,19 @@ int loadconfig_old(struct uae_prefs *p, const char *orgpath)
|
|||
memset(filebuffer, 0, 256);
|
||||
fscanf(f,"df3=%s\n",&filebuffer);
|
||||
replace(filebuffer,' ','|');
|
||||
if(DISK_validate_filename(filebuffer, 0, NULL, NULL))
|
||||
strcpy(p->df[3], filebuffer);
|
||||
if(DISK_validate_filename(p, filebuffer, 0, NULL, NULL, NULL))
|
||||
strcpy(p->floppyslots[3].df, filebuffer);
|
||||
else
|
||||
p->df[3][0] = 0;
|
||||
p->floppyslots[3].df[0] = 0;
|
||||
disk_insert(3, filebuffer);
|
||||
}
|
||||
|
||||
for(int i=0; i<4; ++i)
|
||||
{
|
||||
if(i < p->nr_floppies)
|
||||
p->dfxtype[i] = DRV_35_DD;
|
||||
p->floppyslots[i].dfxtype = DRV_35_DD;
|
||||
else
|
||||
p->dfxtype[i] = DRV_NONE;
|
||||
p->floppyslots[i].dfxtype = DRV_NONE;
|
||||
}
|
||||
|
||||
fscanf(f,"chipmemory=%d\n",&p->chipmem_size);
|
||||
|
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
.arm
|
||||
|
||||
.global TRACE_Start
|
||||
.global TRACE_mem
|
||||
.global copy_screen_8bit
|
||||
.global copy_screen_16bit_swap
|
||||
.global copy_screen_32bit_to_16bit_neon
|
||||
.global ARM_doline_n1
|
||||
|
@ -17,49 +16,43 @@
|
|||
|
||||
.align 8
|
||||
|
||||
TRACE_Start:
|
||||
stmdb sp!, {r0, r1}
|
||||
stmdb sp!, {r1}
|
||||
ldr r1, =TRACE_mem
|
||||
str r0, [r1]
|
||||
add r1, r1, #4
|
||||
ldmia sp!, {r0}
|
||||
str r0, [r1]
|
||||
add r1, r1, #4
|
||||
str r2, [r1]
|
||||
add r1, r1, #4
|
||||
str r3, [r1]
|
||||
|
||||
add r1, r1, #4
|
||||
str r4, [r1]
|
||||
add r1, r1, #4
|
||||
str r5, [r1]
|
||||
add r1, r1, #4
|
||||
str r6, [r1]
|
||||
add r1, r1, #4
|
||||
str r7, [r1]
|
||||
@----------------------------------------------------------------
|
||||
@ copy_screen_8bit
|
||||
@
|
||||
@ r0: uae_u8 *dst
|
||||
@ r1: uae_u8 *src
|
||||
@ r2: int bytes always a multiple of 64: even number of lines, number of pixel per line is multiple of 32 (320, 640, 800, 1024, 1152, 1280)
|
||||
@ r3: uae_u32 *clut
|
||||
@
|
||||
@ void copy_screen_8bit(uae_u8 *dst, uae_u8 *src, int bytes, uae_u32 *clut);
|
||||
@
|
||||
@----------------------------------------------------------------
|
||||
copy_screen_8bit:
|
||||
stmdb sp!, {r4-r7, lr}
|
||||
copy_screen_8bit_loop:
|
||||
pld [r1, #192]
|
||||
mov r7, #64
|
||||
copy_screen_8bit_loop_2:
|
||||
ldr r4, [r1], #4
|
||||
and r5, r4, #255
|
||||
ldr r6, [r3, r5, lsl #2]
|
||||
ubfx r5, r4, #8, #8
|
||||
strh r6, [r0], #2
|
||||
ldr r6, [r3, r5, lsl #2]
|
||||
ubfx r5, r4, #16, #8
|
||||
strh r6, [r0], #2
|
||||
ldr r6, [r3, r5, lsl #2]
|
||||
ubfx r5, r4, #24, #8
|
||||
strh r6, [r0], #2
|
||||
ldr r6, [r3, r5, lsl #2]
|
||||
subs r7, r7, #4
|
||||
strh r6, [r0], #2
|
||||
bgt copy_screen_8bit_loop_2
|
||||
subs r2, r2, #64
|
||||
bgt copy_screen_8bit_loop
|
||||
ldmia sp!, {r4-r7, pc}
|
||||
|
||||
add r1, r1, #4
|
||||
str r8, [r1]
|
||||
add r1, r1, #4
|
||||
str r9, [r1]
|
||||
add r1, r1, #4
|
||||
str r10, [r1]
|
||||
add r1, r1, #4
|
||||
str r11, [r1]
|
||||
|
||||
add r1, r1, #4
|
||||
str r12, [r1]
|
||||
add r1, r1, #4
|
||||
str r13, [r1]
|
||||
add r1, r1, #4
|
||||
str r14, [r1]
|
||||
add r1, r1, #4
|
||||
str r15, [r1]
|
||||
|
||||
ldmia sp!, {r0, r1}
|
||||
bx lr
|
||||
|
||||
|
||||
@----------------------------------------------------------------
|
||||
@ copy_screen_16bit_swap
|
||||
|
@ -141,45 +134,34 @@ ARM_doline_n1:
|
|||
add r3, r3, r2 @ real_bplpt[0]
|
||||
|
||||
ldr r4, =Lookup_doline_n1
|
||||
|
||||
sub r3, r3, #4
|
||||
|
||||
|
||||
ARM_doline_n1_loop:
|
||||
ldr r2, [r3, #4]!
|
||||
@ add r3, r3, #4
|
||||
ldr r2, [r3], #4
|
||||
|
||||
ubfx r5, r2, #28, #4
|
||||
add r5, r4, r5, lsl #2
|
||||
ldr r6, [r5]
|
||||
ldr r6, [r4, r5, lsl #2]
|
||||
|
||||
ubfx r5, r2, #24, #4
|
||||
add r5, r4, r5, lsl #2
|
||||
ldr r7, [r5]
|
||||
ldr r7, [r4, r5, lsl #2]
|
||||
|
||||
ubfx r5, r2, #20, #4
|
||||
add r5, r4, r5, lsl #2
|
||||
ldr r8, [r5]
|
||||
ldr r8, [r4, r5, lsl #2]
|
||||
|
||||
ubfx r5, r2, #16, #4
|
||||
add r5, r4, r5, lsl #2
|
||||
ldr r9, [r5]
|
||||
ldr r9, [r4, r5, lsl #2]
|
||||
stmia r0!, {r6-r9}
|
||||
|
||||
ubfx r5, r2, #12, #4
|
||||
add r5, r4, r5, lsl #2
|
||||
ldr r6, [r5]
|
||||
ldr r6, [r4, r5, lsl #2]
|
||||
|
||||
ubfx r5, r2, #8, #4
|
||||
add r5, r4, r5, lsl #2
|
||||
ldr r7, [r5]
|
||||
ldr r7, [r4, r5, lsl #2]
|
||||
|
||||
ubfx r5, r2, #4, #4
|
||||
add r5, r4, r5, lsl #2
|
||||
ldr r8, [r5]
|
||||
ldr r8, [r4, r5, lsl #2]
|
||||
|
||||
ubfx r5, r2, #0, #4
|
||||
add r5, r4, r5, lsl #2
|
||||
ldr r9, [r5]
|
||||
ldr r9, [r4, r5, lsl #2]
|
||||
stmia r0!, {r6-r9}
|
||||
|
||||
subs r1, r1, #1
|
||||
|
@ -207,60 +189,46 @@ NEON_doline_n2:
|
|||
ldr r3, =line_data
|
||||
add r2, r3, r2 @ real_bplpt[0]
|
||||
add r3, r2, #200
|
||||
|
||||
|
||||
@ Load masks to registers
|
||||
vmov.u8 d18, #0x55
|
||||
vmov.u8 d19, #0x33
|
||||
vmov.u8 d20, #0x0f
|
||||
vmov.u8 q11, #0x03 @ -> d22 and d23
|
||||
|
||||
NEON_doline_n2_loop:
|
||||
@ Load data as early as possible
|
||||
vldmia r2!, {d4}
|
||||
vldmia r3!, {d6}
|
||||
|
||||
|
||||
@ MERGE (b6, b7, 0x55555555, 1);
|
||||
vshr.u8 d16, d4, #1 @ tmpb = b >> shift
|
||||
vshl.u8 d17, d6, #1 @ tmpa = a << shift
|
||||
vbit.u8 d6, d16, d18 @ a = a and bit set from tmpb if mask is true
|
||||
vbif.u8 d4, d17, d18 @ b = b and bit set from tmpa if mask is false
|
||||
|
||||
@ MERGE_0(b4, b6, 0x33333333, 2);
|
||||
vshr.u8 d16, d6, #2 @ tmp = b >> shift
|
||||
vand.8 d2, d16, d19 @ a = tmp & mask
|
||||
vand.8 d6, d6, d19 @ b = b & mask
|
||||
@ MERGE_0(b5, b7, 0x33333333, 2);
|
||||
vshr.u8 d16, d4, #2 @ tmp = b >> shift
|
||||
vand.8 d0, d16, d19 @ a = tmp & mask
|
||||
vand.8 d4, d4, d19 @ b = b & mask
|
||||
vshr.u8 d3, d6, #6
|
||||
vshr.u8 d1, d4, #6
|
||||
|
||||
@ MERGE_0(b0, b4, 0x0f0f0f0f, 4);
|
||||
vshr.u8 d16, d2, #4 @ tmp = b >> shift
|
||||
vand.8 d3, d16, d20 @ a = tmp & mask
|
||||
vand.8 d2, d2, d20 @ b = b & mask
|
||||
@ MERGE_0(b1, b5, 0x0f0f0f0f, 4);
|
||||
vshr.u8 d16, d0, #4 @ tmp = b >> shift
|
||||
vand.8 d1, d16, d20 @ a = tmp & mask
|
||||
vand.8 d0, d0, d20 @ b = b & mask
|
||||
@ MERGE_0(b2, b6, 0x0f0f0f0f, 4);
|
||||
vshr.u8 d16, d6, #4 @ tmp = b >> shift
|
||||
vand.8 d7, d16, d20 @ a = tmp & mask
|
||||
vand.8 d6, d6, d20 @ b = b & mask
|
||||
@ MERGE_0(b3, b7, 0x0f0f0f0f, 4);
|
||||
vshr.u8 d16, d4, #4 @ tmp = b >> shift
|
||||
vand.8 d5, d16, d20 @ a = tmp & mask
|
||||
vand.8 d4, d4, d20 @ b = b & mask
|
||||
|
||||
vshr.u8 d7, d6, #4
|
||||
vshr.u8 d5, d4, #4
|
||||
|
||||
vshr.u8 d2, d6, #2
|
||||
vshr.u8 d0, d4, #2
|
||||
|
||||
vand d2, d2, d22
|
||||
vand d0, d0, d22
|
||||
vand q3, q3, q11 @ -> d6 and d7
|
||||
vand q2, q2, q11 @ -> d4 and d5
|
||||
|
||||
vzip.8 d3, d7
|
||||
vzip.8 d1, d5
|
||||
vzip.8 d2, d6
|
||||
vzip.8 d0, d4
|
||||
|
||||
|
||||
vzip.8 d3, d1
|
||||
vzip.8 d2, d0
|
||||
vzip.32 d3, d2
|
||||
vzip.32 d1, d0
|
||||
|
||||
vst1.8 {d0, d1, d2, d3}, [r0]!
|
||||
|
||||
vstmia r0!, {d0, d1, d2, d3}
|
||||
|
||||
cmp r1, #1 @ Exit from here if odd number of words
|
||||
bxeq lr
|
||||
|
@ -272,8 +240,8 @@ NEON_doline_n2_loop:
|
|||
vzip.32 d7, d6
|
||||
vzip.32 d5, d4
|
||||
|
||||
vst1.8 {d4, d5, d6, d7}, [r0]!
|
||||
|
||||
vstmia r0!, {d4, d5, d6, d7}
|
||||
|
||||
bgt NEON_doline_n2_loop
|
||||
|
||||
NEON_doline_n2_exit:
|
||||
|
@ -799,13 +767,3 @@ Lookup_doline_n1:
|
|||
.long 0x00000100, 0x01000100, 0x00010100, 0x01010100
|
||||
.long 0x00000001, 0x01000001, 0x00010001, 0x01010001
|
||||
.long 0x00000101, 0x01000101, 0x00010101, 0x01010101
|
||||
|
||||
TRACE_mem:
|
||||
.long 0x00000000, 0x00000000, 0x00000000, 0x00000000
|
||||
.long 0x00000000, 0x00000000, 0x00000000, 0x00000000
|
||||
.long 0x00000000, 0x00000000, 0x00000000, 0x00000000
|
||||
.long 0x00000000, 0x00000000, 0x00000000, 0x00000000
|
||||
.long 0x00000000, 0x00000000, 0x00000000, 0x00000000
|
||||
.long 0x00000000, 0x00000000, 0x00000000, 0x00000000
|
||||
.long 0x00000000, 0x00000000, 0x00000000, 0x00000000
|
||||
.long 0x00000000, 0x00000000, 0x00000000, 0x00000000
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
#include "options.h"
|
||||
#include "td-sdl/thread.h"
|
||||
#include "gui.h"
|
||||
#include "events.h"
|
||||
#include "memory.h"
|
||||
#include "newcpu.h"
|
||||
#include "custom.h"
|
||||
#include "xwin.h"
|
||||
#include "drawing.h"
|
||||
|
@ -33,15 +33,68 @@
|
|||
#include "joystick.h"
|
||||
#include "disk.h"
|
||||
#include "savestate.h"
|
||||
#include "newcpu.h"
|
||||
#include "traps.h"
|
||||
#include "bsdsocket.h"
|
||||
#include "native2amiga.h"
|
||||
#include "rtgmodes.h"
|
||||
#include "uaeresource.h"
|
||||
#include "rommgr.h"
|
||||
#include <SDL.h>
|
||||
#include "gp2x.h"
|
||||
|
||||
/*
|
||||
#define DBG_MAX_THREADS 128
|
||||
uae_thread_id running_threads[DBG_MAX_THREADS];
|
||||
char running_threads_name[DBG_MAX_THREADS][64];
|
||||
|
||||
void dbg_add_thread(uae_thread_id id, const char *name)
|
||||
{
|
||||
int i;
|
||||
for(i=0; i<DBG_MAX_THREADS; ++i)
|
||||
{
|
||||
if(running_threads[i] == 0)
|
||||
{
|
||||
running_threads[i] = id;
|
||||
if(name != NULL)
|
||||
strncpy(running_threads_name[i], name, 64);
|
||||
else
|
||||
strncpy(running_threads_name[i], "<empty>", 64);
|
||||
write_log("dbg_add_thread: id = %d, name = %s, pos = %d\n", id, running_threads_name[i], i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
write_log("dbg_add_thread: no more free entries\n");
|
||||
}
|
||||
|
||||
void dbg_rem_thread(uae_thread_id id)
|
||||
{
|
||||
int i;
|
||||
for(i=0; i<DBG_MAX_THREADS; ++i)
|
||||
{
|
||||
if(running_threads[i] == id)
|
||||
{
|
||||
write_log("dbg_rem_thread: id = %d, name = %s, pos = %d\n", id, running_threads_name[i], i);
|
||||
running_threads[i] = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dbg_list_threads(void)
|
||||
{
|
||||
int i;
|
||||
for(i=0; i<DBG_MAX_THREADS; ++i)
|
||||
{
|
||||
if(running_threads[i] != 0)
|
||||
{
|
||||
write_log("dbg_list_threads: id = %d, name = %s, pos = %d\n", running_threads[i], running_threads_name[i], i);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
extern void signal_segv(int signum, siginfo_t* info, void*ptr);
|
||||
extern void gui_force_rtarea_hdchange(void);
|
||||
|
||||
extern int doStylusRightClick;
|
||||
extern int mouseMoving;
|
||||
|
@ -53,6 +106,8 @@ extern int loadconfig_old(struct uae_prefs *p, const char *orgpath);
|
|||
extern void SetLastActiveConfig(const char *filename);
|
||||
|
||||
/* Keyboard and mouse */
|
||||
int buttonstate[3];
|
||||
|
||||
/* Keyboard */
|
||||
int uae4all_keystate[256];
|
||||
#ifdef PANDORA
|
||||
|
@ -82,14 +137,22 @@ void reinit_amiga(void)
|
|||
{
|
||||
write_log("reinit_amiga() called\n");
|
||||
DISK_free ();
|
||||
memory_cleanup ();
|
||||
#ifdef FILESYS
|
||||
filesys_cleanup ();
|
||||
hardfile_reset();
|
||||
#endif
|
||||
#ifdef AUTOCONFIG
|
||||
#if defined (BSDSOCKET)
|
||||
bsdlib_reset();
|
||||
#endif
|
||||
expansion_cleanup ();
|
||||
#endif
|
||||
memory_cleanup ();
|
||||
|
||||
/* At this point, there might run some threads from bsdsocket.*/
|
||||
// write_log("Threads in reinit_amiga():\n");
|
||||
// dbg_list_threads();
|
||||
|
||||
currprefs = changed_prefs;
|
||||
/* force sound settings change */
|
||||
currprefs.produce_sound = 0;
|
||||
|
@ -103,6 +166,7 @@ void reinit_amiga(void)
|
|||
uaeres_install ();
|
||||
hardfile_install();
|
||||
#endif
|
||||
keybuf_init();
|
||||
|
||||
#ifdef AUTOCONFIG
|
||||
expansion_init ();
|
||||
|
@ -114,6 +178,9 @@ void reinit_amiga(void)
|
|||
memory_reset ();
|
||||
|
||||
#ifdef AUTOCONFIG
|
||||
#if defined (BSDSOCKET)
|
||||
bsdlib_install ();
|
||||
#endif
|
||||
emulib_install ();
|
||||
native2amiga_install ();
|
||||
#endif
|
||||
|
@ -121,6 +188,7 @@ void reinit_amiga(void)
|
|||
custom_init (); /* Must come after memory_init */
|
||||
DISK_init ();
|
||||
|
||||
reset_frame_rate_hack ();
|
||||
init_m68k();
|
||||
}
|
||||
|
||||
|
@ -153,12 +221,12 @@ void logging_init( void )
|
|||
debugfile = 0;
|
||||
}
|
||||
|
||||
sprintf(debugfilename, "%s/uae4all_log.txt", start_path_data);
|
||||
sprintf(debugfilename, "%s/uae4arm_log.txt", start_path_data);
|
||||
if(!debugfile)
|
||||
debugfile = fopen(debugfilename, "wt");
|
||||
|
||||
first++;
|
||||
write_log ( "UAE4ALL Logfile\n\n");
|
||||
write_log ( "UAE4ARM Logfile\n\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -172,12 +240,48 @@ void logging_cleanup( void )
|
|||
}
|
||||
|
||||
|
||||
uae_u8 *target_load_keyfile (struct uae_prefs *p, char *path, int *sizep, char *name)
|
||||
void stripslashes (TCHAR *p)
|
||||
{
|
||||
while (_tcslen (p) > 0 && (p[_tcslen (p) - 1] == '\\' || p[_tcslen (p) - 1] == '/'))
|
||||
p[_tcslen (p) - 1] = 0;
|
||||
}
|
||||
void fixtrailing (TCHAR *p)
|
||||
{
|
||||
if (_tcslen(p) == 0)
|
||||
return;
|
||||
if (p[_tcslen(p) - 1] == '/' || p[_tcslen(p) - 1] == '\\')
|
||||
return;
|
||||
_tcscat(p, "/");
|
||||
}
|
||||
|
||||
void getpathpart (TCHAR *outpath, int size, const TCHAR *inpath)
|
||||
{
|
||||
_tcscpy (outpath, inpath);
|
||||
TCHAR *p = _tcsrchr (outpath, '/');
|
||||
if (p)
|
||||
p[0] = 0;
|
||||
fixtrailing (outpath);
|
||||
}
|
||||
void getfilepart (TCHAR *out, int size, const TCHAR *path)
|
||||
{
|
||||
out[0] = 0;
|
||||
const TCHAR *p = _tcsrchr (path, '/');
|
||||
if (p)
|
||||
_tcscpy (out, p + 1);
|
||||
else
|
||||
_tcscpy (out, path);
|
||||
}
|
||||
|
||||
|
||||
uae_u8 *target_load_keyfile (struct uae_prefs *p, const char *path, int *sizep, char *name)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void target_run (void)
|
||||
{
|
||||
}
|
||||
void target_quit (void)
|
||||
{
|
||||
}
|
||||
|
@ -185,6 +289,13 @@ void target_quit (void)
|
|||
|
||||
void target_fixup_options (struct uae_prefs *p)
|
||||
{
|
||||
p->rtgmem_type = 1;
|
||||
gfxmem_start = rtg_start_adr;
|
||||
if (p->z3fastmem_start != z3_start_adr)
|
||||
p->z3fastmem_start = z3_start_adr;
|
||||
|
||||
p->picasso96_modeflags = RGBFF_CLUT | RGBFF_R5G6B5 | RGBFF_R8G8B8A8;
|
||||
p->gfx_resolution = p->gfx_size.width > 600 ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -197,7 +308,6 @@ void target_default_options (struct uae_prefs *p, int type)
|
|||
p->pandora_joyConf = 0;
|
||||
p->pandora_joyPort = 0;
|
||||
p->pandora_tapDelay = 10;
|
||||
p->pandora_stylusOffset = 0;
|
||||
|
||||
p->pandora_customControls = 0;
|
||||
#ifdef RASPBERRY
|
||||
|
@ -221,44 +331,47 @@ void target_default_options (struct uae_prefs *p, int type)
|
|||
p->pandora_autofireButton1 = GP2X_BUTTON_B;
|
||||
p->pandora_jump = -1;
|
||||
|
||||
p->picasso96_modeflags = RGBFF_R5G6B5 | RGBFF_R8G8B8A8;
|
||||
p->picasso96_modeflags = RGBFF_CLUT | RGBFF_R5G6B5 | RGBFF_R8G8B8A8;
|
||||
}
|
||||
|
||||
|
||||
void target_save_options (struct zfile *f, struct uae_prefs *p)
|
||||
{
|
||||
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);
|
||||
cfgfile_write (f, "pandora.stylus_offset=%d\n", p->pandora_stylusOffset);
|
||||
cfgfile_write (f, "pandora.tap_delay=%d\n", p->pandora_tapDelay);
|
||||
cfgfile_write (f, "pandora.custom_controls=%d\n", p->pandora_customControls);
|
||||
cfgfile_write (f, "pandora.custom_dpad=%d\n", p->pandora_custom_dpad);
|
||||
cfgfile_write (f, "pandora.custom_up=%d\n", p->pandora_custom_up);
|
||||
cfgfile_write (f, "pandora.custom_down=%d\n", p->pandora_custom_down);
|
||||
cfgfile_write (f, "pandora.custom_left=%d\n", p->pandora_custom_left);
|
||||
cfgfile_write (f, "pandora.custom_right=%d\n", p->pandora_custom_right);
|
||||
cfgfile_write (f, "pandora.custom_a=%d\n", p->pandora_custom_A);
|
||||
cfgfile_write (f, "pandora.custom_b=%d\n", p->pandora_custom_B);
|
||||
cfgfile_write (f, "pandora.custom_x=%d\n", p->pandora_custom_X);
|
||||
cfgfile_write (f, "pandora.custom_y=%d\n", p->pandora_custom_Y);
|
||||
cfgfile_write (f, "pandora.custom_l=%d\n", p->pandora_custom_L);
|
||||
cfgfile_write (f, "pandora.custom_r=%d\n", p->pandora_custom_R);
|
||||
cfgfile_write (f, "pandora.move_x=%d\n", p->pandora_horizontal_offset);
|
||||
cfgfile_write (f, "pandora.move_y=%d\n", p->pandora_vertical_offset);
|
||||
cfgfile_write (f, "pandora.button1=%d\n", p->pandora_button1);
|
||||
cfgfile_write (f, "pandora.button2=%d\n", p->pandora_button2);
|
||||
cfgfile_write (f, "pandora.autofire_button=%d\n", p->pandora_autofireButton1);
|
||||
cfgfile_write (f, "pandora.jump=%d\n", p->pandora_jump);
|
||||
cfgfile_write (f, "pandora.cpu_speed", "%d", p->pandora_cpu_speed);
|
||||
cfgfile_write (f, "pandora.joy_conf", "%d", p->pandora_joyConf);
|
||||
cfgfile_write (f, "pandora.joy_port", "%d", p->pandora_joyPort);
|
||||
cfgfile_write (f, "pandora.tap_delay", "%d", p->pandora_tapDelay);
|
||||
cfgfile_write (f, "pandora.custom_controls", "%d", p->pandora_customControls);
|
||||
cfgfile_write (f, "pandora.custom_dpad", "%d", p->pandora_custom_dpad);
|
||||
cfgfile_write (f, "pandora.custom_up", "%d", p->pandora_custom_up);
|
||||
cfgfile_write (f, "pandora.custom_down", "%d", p->pandora_custom_down);
|
||||
cfgfile_write (f, "pandora.custom_left", "%d", p->pandora_custom_left);
|
||||
cfgfile_write (f, "pandora.custom_right", "%d", p->pandora_custom_right);
|
||||
cfgfile_write (f, "pandora.custom_a", "%d", p->pandora_custom_A);
|
||||
cfgfile_write (f, "pandora.custom_b", "%d", p->pandora_custom_B);
|
||||
cfgfile_write (f, "pandora.custom_x", "%d", p->pandora_custom_X);
|
||||
cfgfile_write (f, "pandora.custom_y", "%d", p->pandora_custom_Y);
|
||||
cfgfile_write (f, "pandora.custom_l", "%d", p->pandora_custom_L);
|
||||
cfgfile_write (f, "pandora.custom_r", "%d", p->pandora_custom_R);
|
||||
cfgfile_write (f, "pandora.move_x", "%d", p->pandora_horizontal_offset);
|
||||
cfgfile_write (f, "pandora.move_y", "%d", p->pandora_vertical_offset);
|
||||
cfgfile_write (f, "pandora.button1", "%d", p->pandora_button1);
|
||||
cfgfile_write (f, "pandora.button2", "%d", p->pandora_button2);
|
||||
cfgfile_write (f, "pandora.autofire_button", "%d", p->pandora_autofireButton1);
|
||||
cfgfile_write (f, "pandora.jump", "%d", p->pandora_jump);
|
||||
}
|
||||
|
||||
|
||||
int target_parse_option (struct uae_prefs *p, char *option, char *value)
|
||||
TCHAR *target_expand_environment (const TCHAR *path)
|
||||
{
|
||||
return strdup(path);
|
||||
}
|
||||
|
||||
int target_parse_option (struct uae_prefs *p, const char *option, const char *value)
|
||||
{
|
||||
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)
|
||||
|| cfgfile_intval (option, value, "tap_delay", &p->pandora_tapDelay, 1)
|
||||
|| cfgfile_intval (option, value, "custom_controls", &p->pandora_customControls, 1)
|
||||
|| cfgfile_intval (option, value, "custom_dpad", &p->pandora_custom_dpad, 1)
|
||||
|
@ -327,21 +440,18 @@ void fetch_screenshotpath(char *out, int size)
|
|||
}
|
||||
|
||||
|
||||
int target_cfgfile_load (struct uae_prefs *p, char *filename, int type, int isdefault)
|
||||
int target_cfgfile_load (struct uae_prefs *p, const char *filename, int type, int isdefault)
|
||||
{
|
||||
int i;
|
||||
int result = 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)
|
||||
{
|
||||
int type = CONFIG_TYPE_HARDWARE | CONFIG_TYPE_HOST;
|
||||
result = cfgfile_load(p, filename, &type, 0);
|
||||
result = cfgfile_load(p, filename, &type, 0, 1);
|
||||
}
|
||||
if(result)
|
||||
{
|
||||
|
@ -355,16 +465,19 @@ int target_cfgfile_load (struct uae_prefs *p, char *filename, int type, int isde
|
|||
{
|
||||
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);
|
||||
if(!DISK_validate_filename(p, p->floppyslots[i].df, 0, NULL, NULL, NULL))
|
||||
p->floppyslots[i].df[0] = 0;
|
||||
disk_insert(i, p->floppyslots[i].df);
|
||||
if(strlen(p->floppyslots[i].df) > 0)
|
||||
AddFileToDiskList(p->floppyslots[i].df, 1);
|
||||
}
|
||||
|
||||
inputdevice_updateconfig (p);
|
||||
|
||||
SetLastActiveConfig(filename);
|
||||
|
||||
if(count_HDs(p) > 0) // When loading a config with HDs, always do a hardreset
|
||||
gui_force_rtarea_hdchange();
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -636,6 +749,27 @@ void resetCpuSpeed(void)
|
|||
}
|
||||
|
||||
|
||||
void target_reset (void)
|
||||
{
|
||||
}
|
||||
|
||||
uae_u32 emulib_target_getcpurate (uae_u32 v, uae_u32 *low)
|
||||
{
|
||||
*low = 0;
|
||||
if (v == 1) {
|
||||
*low = 1e+9; /* We have nano seconds */
|
||||
return 0;
|
||||
} else if (v == 2) {
|
||||
int64_t time;
|
||||
struct timespec ts;
|
||||
clock_gettime (CLOCK_MONOTONIC, &ts);
|
||||
time = (((int64_t) ts.tv_sec) * 1000000000) + ts.tv_nsec;
|
||||
*low = (uae_u32) (time & 0xffffffff);
|
||||
return (uae_u32)(time >> 32);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
struct sigaction action;
|
||||
|
@ -664,27 +798,23 @@ int main (int argc, char *argv[])
|
|||
|
||||
alloc_AmigaMem();
|
||||
RescanROMs();
|
||||
|
||||
real_main (argc, argv);
|
||||
|
||||
ClearAvailableROMList();
|
||||
free_keyring();
|
||||
free_AmigaMem();
|
||||
lstMRUDiskList.clear();
|
||||
|
||||
logging_cleanup();
|
||||
|
||||
// printf("Threads at exit:\n");
|
||||
// dbg_list_threads();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int needmousehack (void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int mousehack_allowed (void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
void keyboard_init(void)
|
||||
{
|
||||
int i;
|
||||
|
@ -705,7 +835,14 @@ void handle_events (void)
|
|||
/* Handle GUI events */
|
||||
gui_handle_events ();
|
||||
#ifdef PANDORA_SPECIFIC
|
||||
handle_joymouse();
|
||||
if (currprefs.pandora_custom_dpad == 1)
|
||||
handle_joymouse();
|
||||
else if(currprefs.input_tablet > TABLET_OFF) {
|
||||
int x, y;
|
||||
SDL_GetMouseState(&x, &y);
|
||||
setmousestate(0, 0, x, 1);
|
||||
setmousestate(0, 1, y, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
while (SDL_PollEvent(&rEvent))
|
||||
|
@ -741,7 +878,7 @@ void handle_events (void)
|
|||
if (rEvent.key.keysym.sym==SDLK_F11)
|
||||
{
|
||||
// state moves thus:
|
||||
// joystick mode (with virt keyboard on L and R)
|
||||
// joystick mode
|
||||
// mouse mode (with mouse buttons on L and R)
|
||||
// remapping mode (with whatever's been supplied)
|
||||
// back to start of state
|
||||
|
@ -754,10 +891,6 @@ void handle_events (void)
|
|||
#endif
|
||||
currprefs.pandora_custom_dpad = 0;
|
||||
changed_prefs.pandora_custom_dpad = currprefs.pandora_custom_dpad;
|
||||
if(currprefs.pandora_custom_dpad == 2)
|
||||
mousehack_set(mousehack_follow);
|
||||
else
|
||||
mousehack_set (mousehack_dontcare);
|
||||
|
||||
show_inputmode = 1;
|
||||
}
|
||||
|
@ -891,51 +1024,60 @@ void handle_events (void)
|
|||
if (currprefs.pandora_custom_dpad < 2)
|
||||
buttonstate[(rEvent.button.button-1)%3] = 0;
|
||||
break;
|
||||
|
||||
|
||||
case SDL_MOUSEMOTION:
|
||||
if(currprefs.pandora_custom_dpad == 2)
|
||||
{
|
||||
lastmx = rEvent.motion.x*2 - currprefs.pandora_stylusOffset + stylusAdjustX >> 1;
|
||||
lastmy = rEvent.motion.y*2 - currprefs.pandora_stylusOffset + stylusAdjustY >> 1;
|
||||
//mouseMoving = 1;
|
||||
}
|
||||
else if(slow_mouse)
|
||||
{
|
||||
lastmx += rEvent.motion.xrel;
|
||||
lastmy += rEvent.motion.yrel;
|
||||
if(rEvent.motion.x == 0)
|
||||
lastmx -= 2;
|
||||
if(rEvent.motion.y == 0)
|
||||
lastmy -= 2;
|
||||
if(rEvent.motion.x == currprefs.gfx_size.width - 1)
|
||||
lastmx += 2;
|
||||
if(rEvent.motion.y == currprefs.gfx_size.height - 1)
|
||||
lastmy += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
int mouseScale = currprefs.input_joymouse_multiplier / 2;
|
||||
if(currprefs.input_tablet == TABLET_OFF) {
|
||||
int x, y;
|
||||
int mouseScale = slow_mouse ? 1 : currprefs.input_joymouse_multiplier / 2;
|
||||
x = rEvent.motion.xrel;
|
||||
y = rEvent.motion.yrel;
|
||||
#ifdef PANDORA_SPECIFIC
|
||||
if(rEvent.motion.xrel > 20 || rEvent.motion.xrel < -20 || rEvent.motion.yrel > 20 || rEvent.motion.yrel < -20)
|
||||
break;
|
||||
if(rEvent.motion.x == 0 && x > -4)
|
||||
x = -4;
|
||||
if(rEvent.motion.y == 0 && y > -4)
|
||||
y = -4;
|
||||
if(rEvent.motion.x == currprefs.gfx_size.width - 1 && x < 4)
|
||||
x = 4;
|
||||
if(rEvent.motion.y == currprefs.gfx_size.height - 1 && y < 4)
|
||||
y = 4;
|
||||
#endif
|
||||
lastmx += rEvent.motion.xrel * mouseScale;
|
||||
lastmy += rEvent.motion.yrel * mouseScale;
|
||||
if(rEvent.motion.x == 0)
|
||||
lastmx -= mouseScale * 4;
|
||||
if(rEvent.motion.y == 0)
|
||||
lastmy -= mouseScale * 4;
|
||||
if(rEvent.motion.x == currprefs.gfx_size.width - 1)
|
||||
lastmx += mouseScale * 4;
|
||||
if(rEvent.motion.y == currprefs.gfx_size.height - 1)
|
||||
lastmy += mouseScale * 4;
|
||||
}
|
||||
newmousecounters = 1;
|
||||
break;
|
||||
setmousestate(0, 0, x * mouseScale, 0);
|
||||
setmousestate(0, 1, y * mouseScale, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void uae_set_thread_priority (int pri)
|
||||
|
||||
static uaecptr clipboard_data;
|
||||
|
||||
void amiga_clipboard_die (void)
|
||||
{
|
||||
}
|
||||
|
||||
void amiga_clipboard_init (void)
|
||||
{
|
||||
}
|
||||
|
||||
void amiga_clipboard_task_start (uaecptr data)
|
||||
{
|
||||
clipboard_data = data;
|
||||
}
|
||||
|
||||
uae_u32 amiga_clipboard_proc_start (void)
|
||||
{
|
||||
return clipboard_data;
|
||||
}
|
||||
|
||||
void amiga_clipboard_got_data (uaecptr data, uae_u32 size, uae_u32 actual)
|
||||
{
|
||||
}
|
||||
|
||||
void amiga_clipboard_want_data (void)
|
||||
{
|
||||
}
|
||||
|
||||
void clipboard_vsync (void)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -7,6 +7,114 @@
|
|||
#include "zfile.h"
|
||||
|
||||
|
||||
int my_mkdir (const char*name)
|
||||
{
|
||||
return mkdir(name, 0777);
|
||||
}
|
||||
|
||||
|
||||
int my_rmdir (const char*name)
|
||||
{
|
||||
return rmdir(name);
|
||||
}
|
||||
|
||||
|
||||
int my_unlink (const char* name)
|
||||
{
|
||||
return unlink(name);
|
||||
}
|
||||
|
||||
|
||||
int my_rename (const char* oldname, const char* newname)
|
||||
{
|
||||
return rename(oldname, newname);
|
||||
}
|
||||
|
||||
|
||||
struct my_opendir_s {
|
||||
void *h;
|
||||
};
|
||||
|
||||
|
||||
struct my_opendir_s *my_opendir (const char* name)
|
||||
{
|
||||
struct my_opendir_s *mod;
|
||||
|
||||
mod = xmalloc (struct my_opendir_s, 1);
|
||||
if (!mod)
|
||||
return NULL;
|
||||
mod->h = opendir(name);
|
||||
if (mod->h == NULL) {
|
||||
xfree (mod);
|
||||
return NULL;
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
|
||||
void my_closedir (struct my_opendir_s *mod)
|
||||
{
|
||||
if (mod)
|
||||
closedir((DIR *) mod->h);
|
||||
xfree (mod);
|
||||
}
|
||||
|
||||
|
||||
int my_readdir (struct my_opendir_s *mod, char* name)
|
||||
{
|
||||
struct dirent *de;
|
||||
|
||||
if (!mod)
|
||||
return 0;
|
||||
|
||||
de = readdir((DIR *) mod->h);
|
||||
if(de == 0)
|
||||
return 0;
|
||||
strncpy(name, de->d_name, MAX_PATH);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
struct my_openfile_s {
|
||||
void *h;
|
||||
};
|
||||
|
||||
|
||||
void my_close (struct my_openfile_s *mos)
|
||||
{
|
||||
if(mos)
|
||||
close((int) mos->h);
|
||||
xfree (mos);
|
||||
}
|
||||
|
||||
|
||||
uae_s64 int my_lseek (struct my_openfile_s *mos, uae_s64 int offset, int pos)
|
||||
{
|
||||
return lseek((int) mos->h, offset, pos);
|
||||
}
|
||||
|
||||
|
||||
uae_s64 int my_fsize (struct my_openfile_s *mos)
|
||||
{
|
||||
uae_s64 pos = lseek((int) mos->h, 0, SEEK_CUR);
|
||||
uae_s64 size = lseek((int) mos->h, 0, SEEK_END);
|
||||
lseek((int) mos->h, pos, SEEK_SET);
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
unsigned int my_read (struct my_openfile_s *mos, void *b, unsigned int size)
|
||||
{
|
||||
return read((int) mos->h, b, size);
|
||||
}
|
||||
|
||||
|
||||
unsigned int my_write (struct my_openfile_s *mos, void *b, unsigned int size)
|
||||
{
|
||||
return write((int) mos->h, b, size);
|
||||
}
|
||||
|
||||
|
||||
int my_existsfile (const char *name)
|
||||
{
|
||||
struct stat st;
|
||||
|
@ -34,6 +142,28 @@ int my_existsdir(const char *name)
|
|||
}
|
||||
|
||||
|
||||
struct my_openfile_s *my_open (const TCHAR *name, int flags)
|
||||
{
|
||||
struct my_openfile_s *mos;
|
||||
|
||||
mos = xmalloc (struct my_openfile_s, 1);
|
||||
if (!mos)
|
||||
return NULL;
|
||||
mos->h = (void *) open(name, flags);
|
||||
if (!mos->h) {
|
||||
xfree (mos);
|
||||
mos = NULL;
|
||||
}
|
||||
return mos;
|
||||
}
|
||||
|
||||
|
||||
int my_truncate (const TCHAR *name, uae_u64 len)
|
||||
{
|
||||
return truncate(name, len);
|
||||
}
|
||||
|
||||
|
||||
int my_getvolumeinfo (const char *root)
|
||||
{
|
||||
struct stat st;
|
||||
|
@ -47,95 +177,13 @@ int my_getvolumeinfo (const char *root)
|
|||
}
|
||||
|
||||
|
||||
void *my_opendir (const char* name)
|
||||
FILE *my_opentext (const TCHAR *name)
|
||||
{
|
||||
return opendir(name);
|
||||
return fopen (name, "r");
|
||||
}
|
||||
|
||||
|
||||
void my_closedir (void* dir)
|
||||
{
|
||||
closedir((DIR *) dir);
|
||||
}
|
||||
|
||||
|
||||
int my_readdir (void* dir, char* name)
|
||||
{
|
||||
struct dirent *de;
|
||||
|
||||
if (!dir)
|
||||
return 0;
|
||||
|
||||
de = readdir((DIR *) dir);
|
||||
if(de == 0)
|
||||
return 0;
|
||||
strncpy(name, de->d_name, MAX_PATH);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int my_rmdir (const char*name)
|
||||
{
|
||||
return rmdir(name);
|
||||
}
|
||||
|
||||
|
||||
int my_mkdir (const char*name)
|
||||
{
|
||||
return mkdir(name, 0777);
|
||||
}
|
||||
|
||||
|
||||
int my_unlink (const char* name)
|
||||
{
|
||||
return unlink(name);
|
||||
}
|
||||
|
||||
|
||||
int my_rename (const char* oldname, const char* newname)
|
||||
{
|
||||
return rename(oldname, newname);
|
||||
}
|
||||
|
||||
|
||||
void *my_open (const char* name, int flags)
|
||||
{
|
||||
return (void *) open(name, flags);
|
||||
}
|
||||
|
||||
|
||||
void my_close (void* f)
|
||||
{
|
||||
close((int) f);
|
||||
}
|
||||
|
||||
|
||||
unsigned int my_lseek (void* f, unsigned int offset, int pos)
|
||||
{
|
||||
return lseek((int) f, offset, pos);
|
||||
}
|
||||
|
||||
|
||||
unsigned int my_read (void* f, void* b, unsigned int len)
|
||||
{
|
||||
return read((int) f, b, len);
|
||||
}
|
||||
|
||||
|
||||
unsigned int my_write (void* f, void* b, unsigned int len)
|
||||
{
|
||||
return write((int) f, b, len);
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
int target_get_volume_name(struct uaedev_mount_info *mtinf, const char *volumepath, char *volumename, int size, bool inserted, bool fullcheck)
|
||||
{
|
||||
sprintf(volumename, "DH_%c", volumepath[0]);
|
||||
return 2;
|
||||
|
|
|
@ -4,10 +4,12 @@
|
|||
#include "uae.h"
|
||||
#include "options.h"
|
||||
#include "gui.h"
|
||||
#include "xwin.h"
|
||||
#include "memory.h"
|
||||
#include "newcpu.h"
|
||||
#include "custom.h"
|
||||
#include "xwin.h"
|
||||
#include "drawing.h"
|
||||
#include "events.h"
|
||||
#include "inputdevice.h"
|
||||
#include "od-pandora/inputmode.h"
|
||||
#include "savestate.h"
|
||||
#include "picasso96.h"
|
||||
|
@ -16,6 +18,7 @@
|
|||
#include <SDL.h>
|
||||
#include <SDL_image.h>
|
||||
#include <SDL_gfxPrimitives.h>
|
||||
#include <SDL/SDL_ttf.h>
|
||||
|
||||
#ifdef ANDROIDSDL
|
||||
#include <android/log.h>
|
||||
|
@ -79,24 +82,71 @@ int graphics_setup (void)
|
|||
}
|
||||
|
||||
|
||||
#ifdef WITH_LOGGING
|
||||
|
||||
SDL_Surface *liveInfo = NULL;
|
||||
TTF_Font *liveFont = NULL;
|
||||
int liveInfoCounter = 0;
|
||||
void ShowLiveInfo(char *msg)
|
||||
{
|
||||
if(liveFont == NULL)
|
||||
{
|
||||
TTF_Init();
|
||||
liveFont = TTF_OpenFont("data/FreeSans.ttf", 12);
|
||||
}
|
||||
if(liveInfo != NULL)
|
||||
SDL_FreeSurface(liveInfo);
|
||||
SDL_Color col;
|
||||
col.r = 0xbf;
|
||||
col.g = 0xbf;
|
||||
col.b = 0xbf;
|
||||
liveInfo = TTF_RenderText_Solid(liveFont, msg, col);
|
||||
liveInfoCounter = 50 * 5;
|
||||
}
|
||||
|
||||
void RefreshLiveInfo()
|
||||
{
|
||||
if(liveInfoCounter > 0)
|
||||
{
|
||||
SDL_Rect dst, src;
|
||||
|
||||
dst.x = 0;
|
||||
dst.y = 2;
|
||||
src.w = liveInfo->w;
|
||||
src.h = liveInfo->h;
|
||||
src.x = 0;
|
||||
src.y = 0;
|
||||
SDL_BlitSurface(liveInfo, &src, prSDLScreen, &dst);
|
||||
liveInfoCounter--;
|
||||
if(liveInfoCounter == 0)
|
||||
{
|
||||
SDL_FreeSurface(liveInfo);
|
||||
liveInfo = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
void InitAmigaVidMode(struct uae_prefs *p)
|
||||
{
|
||||
/* Initialize structure for Amiga video modes */
|
||||
gfxvidinfo.pixbytes = 2;
|
||||
gfxvidinfo.bufmem = (uae_u8 *)prSDLScreen->pixels;
|
||||
gfxvidinfo.linemem = 0;
|
||||
gfxvidinfo.emergmem = 0;
|
||||
gfxvidinfo.width = p->gfx_size.width;
|
||||
gfxvidinfo.height = p->gfx_size.height;
|
||||
gfxvidinfo.maxblocklines = 0;
|
||||
gfxvidinfo.outwidth = p->gfx_size.width;
|
||||
gfxvidinfo.outheight = p->gfx_size.height;
|
||||
gfxvidinfo.rowbytes = prSDLScreen->pitch;
|
||||
}
|
||||
|
||||
|
||||
void graphics_subshutdown (void)
|
||||
{
|
||||
SDL_FreeSurface(prSDLScreen);
|
||||
prSDLScreen = NULL;
|
||||
if(prSDLScreen != NULL)
|
||||
{
|
||||
SDL_FreeSurface(prSDLScreen);
|
||||
prSDLScreen = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -119,13 +169,21 @@ static void CalcPandoraWidth(struct uae_prefs *p)
|
|||
}
|
||||
|
||||
|
||||
void getgfxoffset (int *dxp, int *dyp, int *mxp, int *myp)
|
||||
{
|
||||
*dxp = 0;
|
||||
*dyp = 0;
|
||||
*mxp = 1;
|
||||
*myp = 1;
|
||||
}
|
||||
|
||||
|
||||
static void open_screen(struct uae_prefs *p)
|
||||
{
|
||||
char layersize[20];
|
||||
|
||||
if(prSDLScreen != NULL)
|
||||
graphics_subshutdown();
|
||||
|
||||
graphics_subshutdown();
|
||||
|
||||
if(!screen_is_picasso)
|
||||
{
|
||||
CalcPandoraWidth(p);
|
||||
|
@ -177,6 +235,8 @@ static void open_screen(struct uae_prefs *p)
|
|||
{
|
||||
InitAmigaVidMode(p);
|
||||
init_row_map();
|
||||
|
||||
inputdevice_mouselimit(prSDLScreen->w, prSDLScreen->h);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -218,7 +278,7 @@ int check_prefs_changed_gfx (void)
|
|||
if (currprefs.chipset_refreshrate != changed_prefs.chipset_refreshrate)
|
||||
{
|
||||
currprefs.chipset_refreshrate = changed_prefs.chipset_refreshrate;
|
||||
init_hz ();
|
||||
init_hz_full ();
|
||||
changed = 1;
|
||||
}
|
||||
|
||||
|
@ -259,6 +319,10 @@ void flush_screen ()
|
|||
if(start < next_synctime && next_synctime - start > time_per_frame - 1000)
|
||||
usleep((next_synctime - start) - 750);
|
||||
|
||||
#ifdef WITH_LOGGING
|
||||
RefreshLiveInfo();
|
||||
#endif
|
||||
|
||||
SDL_Flip(prSDLScreen);
|
||||
last_synctime = read_processor_time();
|
||||
|
||||
|
@ -551,55 +615,72 @@ static int save_thumb(char *path)
|
|||
|
||||
#ifdef PICASSO96
|
||||
|
||||
int picasso_palette (void)
|
||||
{
|
||||
int i, changed;
|
||||
|
||||
changed = 0;
|
||||
for (i = 0; i < 256; i++) {
|
||||
int r = picasso96_state.CLUT[i].Red;
|
||||
int g = picasso96_state.CLUT[i].Green;
|
||||
int b = picasso96_state.CLUT[i].Blue;
|
||||
uae_u32 v = CONVERT_RGB(r << 16 | g << 8 | b);
|
||||
if (v != picasso_vidinfo.clut[i]) {
|
||||
picasso_vidinfo.clut[i] = v;
|
||||
changed = 1;
|
||||
}
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
static int resolution_compare (const void *a, const void *b)
|
||||
{
|
||||
struct PicassoResolution *ma = (struct PicassoResolution *)a;
|
||||
struct PicassoResolution *mb = (struct PicassoResolution *)b;
|
||||
if (ma->res.width < mb->res.width)
|
||||
return -1;
|
||||
if (ma->res.width > mb->res.width)
|
||||
return 1;
|
||||
if (ma->res.height < mb->res.height)
|
||||
return -1;
|
||||
if (ma->res.height > mb->res.height)
|
||||
return 1;
|
||||
return ma->depth - mb->depth;
|
||||
struct PicassoResolution *ma = (struct PicassoResolution *)a;
|
||||
struct PicassoResolution *mb = (struct PicassoResolution *)b;
|
||||
if (ma->res.width < mb->res.width)
|
||||
return -1;
|
||||
if (ma->res.width > mb->res.width)
|
||||
return 1;
|
||||
if (ma->res.height < mb->res.height)
|
||||
return -1;
|
||||
if (ma->res.height > mb->res.height)
|
||||
return 1;
|
||||
return ma->depth - mb->depth;
|
||||
}
|
||||
static void sortmodes (void)
|
||||
{
|
||||
int i = 0, idx = -1;
|
||||
int pw = -1, ph = -1;
|
||||
while (DisplayModes[i].depth >= 0)
|
||||
i++;
|
||||
qsort (DisplayModes, i, sizeof (struct PicassoResolution), resolution_compare);
|
||||
for (i = 0; DisplayModes[i].depth >= 0; i++) {
|
||||
if (DisplayModes[i].res.height != ph || DisplayModes[i].res.width != pw) {
|
||||
int i = 0, idx = -1;
|
||||
int pw = -1, ph = -1;
|
||||
while (DisplayModes[i].depth >= 0)
|
||||
i++;
|
||||
qsort (DisplayModes, i, sizeof (struct PicassoResolution), resolution_compare);
|
||||
for (i = 0; DisplayModes[i].depth >= 0; i++) {
|
||||
if (DisplayModes[i].res.height != ph || DisplayModes[i].res.width != pw) {
|
||||
ph = DisplayModes[i].res.height;
|
||||
pw = DisplayModes[i].res.width;
|
||||
idx++;
|
||||
}
|
||||
DisplayModes[i].residx = idx;
|
||||
}
|
||||
}
|
||||
DisplayModes[i].residx = idx;
|
||||
}
|
||||
}
|
||||
|
||||
static void modesList (void)
|
||||
{
|
||||
int i, j;
|
||||
int i, j;
|
||||
|
||||
i = 0;
|
||||
while (DisplayModes[i].depth >= 0) {
|
||||
write_log ("%d: %s (", i, DisplayModes[i].name);
|
||||
j = 0;
|
||||
while (DisplayModes[i].refresh[j] > 0) {
|
||||
i = 0;
|
||||
while (DisplayModes[i].depth >= 0) {
|
||||
write_log ("%d: %s (", i, DisplayModes[i].name);
|
||||
j = 0;
|
||||
while (DisplayModes[i].refresh[j] > 0) {
|
||||
if (j > 0)
|
||||
write_log (",");
|
||||
write_log (",");
|
||||
write_log ("%d", DisplayModes[i].refresh[j]);
|
||||
j++;
|
||||
}
|
||||
write_log (")\n");
|
||||
i++;
|
||||
}
|
||||
}
|
||||
write_log (")\n");
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
void picasso_InitResolutions (void)
|
||||
|
@ -607,7 +688,8 @@ void picasso_InitResolutions (void)
|
|||
struct MultiDisplay *md1;
|
||||
int i, count = 0;
|
||||
char tmp[200];
|
||||
int bitdepth;
|
||||
int bit_idx;
|
||||
int bits[] = { 8, 16, 32 };
|
||||
|
||||
Displays[0].primary = 1;
|
||||
Displays[0].disabled = 0;
|
||||
|
@ -620,15 +702,16 @@ void picasso_InitResolutions (void)
|
|||
Displays[0].name2 = my_strdup("Display");
|
||||
|
||||
md1 = Displays;
|
||||
DisplayModes = md1->DisplayModes = (struct PicassoResolution*) xmalloc (sizeof (struct PicassoResolution) * MAX_PICASSO_MODES);
|
||||
DisplayModes = md1->DisplayModes = xmalloc (struct PicassoResolution, MAX_PICASSO_MODES);
|
||||
for (i = 0; i < MAX_SCREEN_MODES && count < MAX_PICASSO_MODES; i++) {
|
||||
for(bitdepth = 16; bitdepth <= 32; bitdepth += 16) {
|
||||
for(bit_idx = 0; bit_idx < 3; ++bit_idx) {
|
||||
int bitdepth = bits[bit_idx];
|
||||
int bit_unit = (bitdepth + 1) & 0xF8;
|
||||
int rgbFormat = (bitdepth == 16 ? RGBFB_R5G6B5 : RGBFB_R8G8B8A8);
|
||||
int rgbFormat = (bitdepth == 8 ? RGBFB_CLUT : (bitdepth == 16 ? RGBFB_R5G6B5 : RGBFB_R8G8B8A8));
|
||||
int pixelFormat = 1 << rgbFormat;
|
||||
pixelFormat |= RGBFF_CHUNKY;
|
||||
|
||||
if (SDL_VideoModeOK (x_size_table[i], y_size_table[i], bitdepth, SDL_SWSURFACE))
|
||||
if (SDL_VideoModeOK (x_size_table[i], y_size_table[i], 16, SDL_SWSURFACE))
|
||||
{
|
||||
DisplayModes[count].res.width = x_size_table[i];
|
||||
DisplayModes[count].res.height = y_size_table[i];
|
||||
|
@ -650,6 +733,16 @@ void picasso_InitResolutions (void)
|
|||
DisplayModes = Displays[0].DisplayModes;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
void gfx_set_picasso_modeinfo (uae_u32 w, uae_u32 h, uae_u32 depth, RGBFTYPE rgbfmt)
|
||||
{
|
||||
depth >>= 3;
|
||||
|
@ -662,27 +755,18 @@ void gfx_set_picasso_modeinfo (uae_u32 w, uae_u32 h, uae_u32 depth, RGBFTYPE rgb
|
|||
picasso_vidinfo.selected_rgbformat = rgbfmt;
|
||||
picasso_vidinfo.width = w;
|
||||
picasso_vidinfo.height = h;
|
||||
picasso_vidinfo.depth = depth;
|
||||
picasso_vidinfo.depth = 2; // Native depth
|
||||
picasso_vidinfo.extra_mem = 1;
|
||||
|
||||
picasso_vidinfo.pixbytes = depth;
|
||||
picasso_vidinfo.pixbytes = 2; // Native bytes
|
||||
if (screen_is_picasso)
|
||||
{
|
||||
open_screen(&currprefs);
|
||||
picasso_vidinfo.rowbytes = prSDLScreen->pitch;
|
||||
picasso_vidinfo.rgbformat = RGBFB_R5G6B5;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
uae_u8 *gfx_lock_picasso (void)
|
||||
{
|
||||
SDL_LockSurface(prSDLScreen);
|
||||
|
|
|
@ -10,14 +10,15 @@
|
|||
#include "uae.h"
|
||||
#include "options.h"
|
||||
#include "keybuf.h"
|
||||
#include "inputdevice.h"
|
||||
#include "memory.h"
|
||||
#include "zfile.h"
|
||||
#include "gui.h"
|
||||
#include "od-pandora/gui/SelectorEntry.hpp"
|
||||
#include "gui/gui_handling.h"
|
||||
#include "custom.h"
|
||||
#include "memory.h"
|
||||
#include "rommgr.h"
|
||||
#include "newcpu.h"
|
||||
#include "custom.h"
|
||||
#include "inputdevice.h"
|
||||
#include "xwin.h"
|
||||
#include "drawing.h"
|
||||
#include "sd-pandora/sound.h"
|
||||
|
@ -29,18 +30,20 @@
|
|||
#include "filesys.h"
|
||||
#include "autoconf.h"
|
||||
#include <SDL.h>
|
||||
#include "td-sdl/thread.h"
|
||||
|
||||
|
||||
int emulating = 0;
|
||||
extern bool switch_autofire;
|
||||
|
||||
static int justMovedUp=0, justMovedDown=0, justMovedLeft=0, justMovedRight=0;
|
||||
static int justPressedA=0, justPressedB=0, justPressedX=0, justPressedY=0;
|
||||
static int justPressedL=0, justPressedR=0;
|
||||
int stylusClickOverride=0;
|
||||
int stylusAdjustX=0, stylusAdjustY=0;
|
||||
|
||||
|
||||
extern SDL_Surface *prSDLScreen;
|
||||
extern int screen_is_picasso;
|
||||
|
||||
int dpadUp=0;
|
||||
int dpadDown=0;
|
||||
|
@ -70,6 +73,9 @@ struct gui_msg gui_msglist[] = {
|
|||
{ 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." },
|
||||
{ NUMSG_ROMNEED, "One of the following system ROMs is required:\n\n%s\n\nCheck the System ROM path in the Paths panel and click Rescan ROMs." },
|
||||
{ NUMSG_EXPROMNEED, "One of the following expansion boot ROMs is required:\n\n%s\n\nCheck the System ROM path in the Paths panel and click Rescan ROMs." },
|
||||
|
||||
{ -1, "" }
|
||||
};
|
||||
|
||||
|
@ -102,7 +108,7 @@ void AddFileToDiskList(const char *file, int moveToTop)
|
|||
}
|
||||
|
||||
|
||||
static void ClearAvailableROMList(void)
|
||||
void ClearAvailableROMList(void)
|
||||
{
|
||||
while(lstAvailableROMs.size() > 0)
|
||||
{
|
||||
|
@ -119,7 +125,8 @@ static void addrom(struct romdata *rd, char *path)
|
|||
tmp = new AvailableROM();
|
||||
getromname(rd, tmpName);
|
||||
strncpy(tmp->Name, tmpName, MAX_PATH);
|
||||
strncpy(tmp->Path, path, MAX_PATH);
|
||||
if(path != NULL)
|
||||
strncpy(tmp->Path, path, MAX_PATH);
|
||||
tmp->ROMType = rd->type;
|
||||
lstAvailableROMs.push_back(tmp);
|
||||
}
|
||||
|
@ -152,7 +159,7 @@ static struct romdata *scan_single_rom_2 (struct zfile *f)
|
|||
} else {
|
||||
zfile_fseek (f, 0, SEEK_SET);
|
||||
}
|
||||
rombuf = (uae_u8 *) xcalloc (size, 1);
|
||||
rombuf = xcalloc (uae_u8, size);
|
||||
if (!rombuf)
|
||||
return 0;
|
||||
zfile_fread (rombuf, 1, size, f);
|
||||
|
@ -187,7 +194,7 @@ static struct romdata *scan_single_rom (char *path)
|
|||
rd = getromdatabypath(path);
|
||||
if (rd && rd->crc32 == 0xffffffff)
|
||||
return rd;
|
||||
z = zfile_fopen (path, "rb");
|
||||
z = zfile_fopen (path, "rb", ZFD_NORMAL);
|
||||
if (!z)
|
||||
return 0;
|
||||
return scan_single_rom_2 (z);
|
||||
|
@ -232,10 +239,10 @@ static void scan_rom(char *path)
|
|||
{
|
||||
struct romdata *rd;
|
||||
|
||||
if (!isromext(path)) {
|
||||
//write_log("ROMSCAN: skipping file '%s', unknown extension\n", path);
|
||||
return;
|
||||
}
|
||||
if (!isromext(path)) {
|
||||
//write_log("ROMSCAN: skipping file '%s', unknown extension\n", path);
|
||||
return;
|
||||
}
|
||||
rd = getarcadiarombyname(path);
|
||||
if (rd)
|
||||
addrom(rd, path);
|
||||
|
@ -261,6 +268,16 @@ void RescanROMs(void)
|
|||
strncat(tmppath, files[i].c_str(), MAX_PATH);
|
||||
scan_rom (tmppath);
|
||||
}
|
||||
|
||||
int id = 1;
|
||||
for (;;) {
|
||||
struct romdata *rd = getromdatabyid (id);
|
||||
if (!rd)
|
||||
break;
|
||||
if (rd->crc32 == 0xffffffff && strncmp(rd->model, "AROS", 4) == 0)
|
||||
addrom (rd, ":AROS");
|
||||
id++;
|
||||
}
|
||||
}
|
||||
|
||||
static void ClearConfigFileList(void)
|
||||
|
@ -379,7 +396,6 @@ int gui_init (void)
|
|||
setCpuSpeed();
|
||||
update_display(&changed_prefs);
|
||||
|
||||
inputmode_init();
|
||||
inputdevice_copyconfig (&changed_prefs, &currprefs);
|
||||
inputdevice_config_change_test();
|
||||
emulating=1;
|
||||
|
@ -420,8 +436,8 @@ int gui_update (void)
|
|||
fetch_savestatepath(savestate_fname, MAX_DPATH);
|
||||
fetch_screenshotpath(screenshot_filename, MAX_DPATH);
|
||||
|
||||
if(strlen(currprefs.df[0]) > 0)
|
||||
extractFileName(currprefs.df[0], tmp);
|
||||
if(strlen(currprefs.floppyslots[0].df) > 0)
|
||||
extractFileName(currprefs.floppyslots[0].df, tmp);
|
||||
else
|
||||
strncpy(tmp, last_loaded_config, MAX_PATH);
|
||||
|
||||
|
@ -466,11 +482,13 @@ static void goMenu(void)
|
|||
run_gui();
|
||||
gui_to_prefs();
|
||||
setCpuSpeed();
|
||||
if(quit_program)
|
||||
screen_is_picasso = 0;
|
||||
|
||||
update_display(&changed_prefs);
|
||||
|
||||
/* Clear menu garbage at the bottom of the screen */
|
||||
black_screen_now();
|
||||
notice_screen_contents_lost();
|
||||
resume_sound();
|
||||
|
||||
inputdevice_copyconfig (&changed_prefs, &currprefs);
|
||||
|
@ -480,7 +498,6 @@ static void goMenu(void)
|
|||
|
||||
gui_purge_events();
|
||||
fpscounter_reset();
|
||||
notice_screen_contents_lost();
|
||||
}
|
||||
|
||||
|
||||
|
@ -547,13 +564,11 @@ void gui_handle_events (void)
|
|||
if(dpadUp)
|
||||
{
|
||||
moveVertical(1);
|
||||
stylusAdjustY += 2;
|
||||
}
|
||||
//down
|
||||
else if(dpadDown)
|
||||
{
|
||||
moveVertical(-1);
|
||||
stylusAdjustY -= 2;
|
||||
}
|
||||
//1
|
||||
else if(keystate[SDLK_1])
|
||||
|
@ -1299,42 +1314,12 @@ void gui_handle_events (void)
|
|||
justMovedRight=0;
|
||||
}
|
||||
|
||||
//L + up
|
||||
if(triggerL && dpadUp)
|
||||
stylusAdjustY-=2;
|
||||
//L + down
|
||||
if(triggerL && dpadDown)
|
||||
stylusAdjustY+=2;
|
||||
//L + left
|
||||
if(triggerL && dpadLeft)
|
||||
stylusAdjustX-=2;
|
||||
//L + right
|
||||
if(triggerL && dpadRight)
|
||||
stylusAdjustX+=2;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void gui_disk_image_change (int unitnum, const char *name)
|
||||
{
|
||||
}
|
||||
|
||||
void gui_hd_led (int led)
|
||||
{
|
||||
static int resetcounter;
|
||||
|
||||
if (led == 0) {
|
||||
resetcounter--;
|
||||
if (resetcounter > 0)
|
||||
return;
|
||||
}
|
||||
gui_data.hd = led;
|
||||
resetcounter = 2;
|
||||
}
|
||||
|
||||
void gui_cd_led (int led)
|
||||
void gui_disk_image_change (int unitnum, const char *name, bool writeprotected)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -1342,6 +1327,32 @@ void gui_led (int led, int on)
|
|||
{
|
||||
}
|
||||
|
||||
void gui_flicker_led (int led, int unitnum, int status)
|
||||
{
|
||||
static int hd_resetcounter;
|
||||
|
||||
switch(led)
|
||||
{
|
||||
case -1: // Reset HD and CD
|
||||
gui_data.hd = 0;
|
||||
break;
|
||||
|
||||
case LED_POWER:
|
||||
break;
|
||||
|
||||
case LED_HD:
|
||||
if (status == 0) {
|
||||
hd_resetcounter--;
|
||||
if (hd_resetcounter > 0)
|
||||
return;
|
||||
}
|
||||
gui_data.hd = status;
|
||||
hd_resetcounter = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void gui_filename (int num, const char *name)
|
||||
{
|
||||
}
|
||||
|
@ -1373,6 +1384,21 @@ void notify_user (int msg)
|
|||
}
|
||||
|
||||
|
||||
int translate_message (int msg, TCHAR *out)
|
||||
{
|
||||
int i=0;
|
||||
while(gui_msglist[i].num >= 0)
|
||||
{
|
||||
if(gui_msglist[i].num == msg)
|
||||
{
|
||||
strcpy(out, gui_msglist[i].msg);
|
||||
return 1;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void gui_lock (void)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
#include "uae.h"
|
||||
#include "options.h"
|
||||
#include "gui.h"
|
||||
#include "custom.h"
|
||||
#include "memory.h"
|
||||
#include "newcpu.h"
|
||||
#include "custom.h"
|
||||
#include <sys/mman.h>
|
||||
#include <SDL.h>
|
||||
|
||||
|
@ -16,35 +17,11 @@ uae_u32 natmem_size;
|
|||
static uae_u64 totalAmigaMemSize;
|
||||
#define MAXAMIGAMEM 0x6000000 // 64 MB (16 MB for standard Amiga stuff, 16 MG RTG, 64 MB Z3 fast)
|
||||
|
||||
static uae_u8* additional_mem = (uae_u8*) MAP_FAILED;
|
||||
#define ADDITIONAL_MEMSIZE (128 + 16) * 1024 * 1024
|
||||
|
||||
/*
|
||||
void TestMemMap(void)
|
||||
{
|
||||
void *starting = (void *)0x60000000;
|
||||
void *base;
|
||||
void *z3fast;
|
||||
void *gfx;
|
||||
|
||||
base = mmap(starting, 0x1000000, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||
printf("TEST: adr for first 16MB: 0x%08x\n", base);
|
||||
if(base != MAP_FAILED)
|
||||
{
|
||||
z3fast = mmap((void *)((int)base + 0x10000000), 0x2000000, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||
printf("TEST: adr for z3fast 32MB: 0x%08x\n", z3fast);
|
||||
if(z3fast != MAP_FAILED)
|
||||
{
|
||||
gfx = mmap((void *)((int)base + 0x12000000), 0x800000, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||
printf("TEST: adr for gfx 8MB: 0x%08x\n", gfx);
|
||||
if(gfx != MAP_FAILED)
|
||||
{
|
||||
munmap(gfx, 0x800000);
|
||||
}
|
||||
munmap(z3fast, 0x2000000);
|
||||
}
|
||||
munmap(base, 0x1000000);
|
||||
}
|
||||
}
|
||||
*/
|
||||
int z3_start_adr = 0;
|
||||
int rtg_start_adr = 0;
|
||||
|
||||
|
||||
void free_AmigaMem(void)
|
||||
|
@ -54,6 +31,11 @@ void free_AmigaMem(void)
|
|||
free(natmem_offset);
|
||||
natmem_offset = 0;
|
||||
}
|
||||
if(additional_mem != MAP_FAILED)
|
||||
{
|
||||
munmap(additional_mem, ADDITIONAL_MEMSIZE);
|
||||
additional_mem = (uae_u8*) MAP_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -65,6 +47,41 @@ void alloc_AmigaMem(void)
|
|||
|
||||
free_AmigaMem();
|
||||
|
||||
// First attempt: allocate 16 MB for all memory in 24-bit area
|
||||
// and additional mem for Z3 and RTG at correct offset
|
||||
natmem_size = 16 * 1024 * 1024;
|
||||
natmem_offset = (uae_u8*)valloc (natmem_size);
|
||||
max_z3fastmem = ADDITIONAL_MEMSIZE - (16 * 1024 * 1024);
|
||||
if (!natmem_offset) {
|
||||
write_log("Can't allocate 16M of virtual address space!?\n");
|
||||
abort();
|
||||
}
|
||||
additional_mem = (uae_u8*) mmap(natmem_offset + 0x10000000, ADDITIONAL_MEMSIZE,
|
||||
PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
|
||||
if(additional_mem != MAP_FAILED)
|
||||
{
|
||||
// Allocation successful -> we can use natmem_offset for entire memory access
|
||||
z3_start_adr = 0x10000000;
|
||||
rtg_start_adr = 0x18000000;
|
||||
write_log("Allocated 16 MB for 24-bit area and %d MB for Z3 and RTG\n", ADDITIONAL_MEMSIZE / (1024 * 1024));
|
||||
return;
|
||||
}
|
||||
free(natmem_offset);
|
||||
|
||||
// Second attempt: allocate huge memory block for entire area
|
||||
natmem_size = ADDITIONAL_MEMSIZE + 256 * 1024 * 1024;
|
||||
natmem_offset = (uae_u8*)valloc (natmem_size);
|
||||
if(natmem_offset)
|
||||
{
|
||||
// Allocation successful
|
||||
z3_start_adr = 0x10000000;
|
||||
rtg_start_adr = 0x18000000;
|
||||
write_log("Allocated %d MB for entire memory\n", natmem_size / (1024 * 1024));
|
||||
return;
|
||||
}
|
||||
|
||||
// Third attempt: old style: 64 MB allocated and Z3 and RTG at wrong address
|
||||
|
||||
// Get max. available size
|
||||
total = (uae_u64)sysconf (_SC_PHYS_PAGES) * (uae_u64)getpagesize();
|
||||
|
||||
|
@ -92,14 +109,34 @@ void alloc_AmigaMem(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
z3_start_adr = 0x01000000;
|
||||
rtg_start_adr = 0x03000000;
|
||||
max_z3fastmem = natmem_size - 32 * 1024 * 1024;
|
||||
if(max_z3fastmem < 0)
|
||||
if(max_z3fastmem <= 0)
|
||||
{
|
||||
z3_start_adr = 0x00000000; // No mem for Z3
|
||||
if(max_z3fastmem == 0)
|
||||
rtg_start_adr = 0x01000000; // We have mem for RTG
|
||||
else
|
||||
rtg_start_adr = 0x00000000; // No mem for expansion at all
|
||||
max_z3fastmem = 0;
|
||||
}
|
||||
write_log("Reserved: %p-%p (0x%08x %dM)\n", natmem_offset, (uae_u8*)natmem_offset + natmem_size,
|
||||
natmem_size, natmem_size >> 20);
|
||||
}
|
||||
|
||||
|
||||
static uae_u32 getz2rtgaddr (void)
|
||||
{
|
||||
uae_u32 start;
|
||||
start = currprefs.fastmem_size;
|
||||
while (start & (currprefs.rtgmem_size - 1) && start < 4 * 1024 * 1024)
|
||||
start += 1024 * 1024;
|
||||
return start + 2 * 1024 * 1024;
|
||||
}
|
||||
|
||||
|
||||
uae_u8 *mapped_malloc (size_t s, const char *file)
|
||||
{
|
||||
if(!strcmp(file, "chip"))
|
||||
|
@ -124,11 +161,18 @@ uae_u8 *mapped_malloc (size_t s, const char *file)
|
|||
return natmem_offset + kickmem_start;
|
||||
|
||||
if(!strcmp(file, "z3"))
|
||||
return natmem_offset + 0x1000000; //z3fastmem_start;
|
||||
return natmem_offset + z3_start_adr; //z3fastmem_start;
|
||||
|
||||
#ifdef PICASSO96
|
||||
if(!strcmp(file, "gfx"))
|
||||
if(!strcmp(file, "z3_gfx"))
|
||||
{
|
||||
p96ram_start = 0x3000000;
|
||||
p96ram_start = rtg_start_adr;
|
||||
return natmem_offset + p96ram_start;
|
||||
}
|
||||
|
||||
if(!strcmp(file, "z2_gfx"))
|
||||
{
|
||||
p96ram_start = getz2rtgaddr();
|
||||
return natmem_offset + p96ram_start;
|
||||
}
|
||||
#endif
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -27,10 +27,9 @@
|
|||
#include "sysconfig.h"
|
||||
#include "sysdeps.h"
|
||||
#include "options.h"
|
||||
#include "events.h"
|
||||
#include "include/memory.h"
|
||||
#include "custom.h"
|
||||
#include "newcpu.h"
|
||||
#include "custom.h"
|
||||
#include "jit/comptbl.h"
|
||||
#include "jit/compemu.h"
|
||||
|
||||
|
|
|
@ -24,16 +24,15 @@
|
|||
/* #define UAESERIAL */ /* uaeserial.device emulation */
|
||||
#define FPUEMU /* FPU emulation */
|
||||
/* #define FPU_UAE */
|
||||
/* #define MMUEMU */
|
||||
/* #define MMUEMU Aranym 68040 MMU */
|
||||
/* #define FULLMMU Aranym 68040 MMU */
|
||||
#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 */
|
||||
#define UAEGFX_INTERNAL /* built-in libs:picasso96/uaegfx.card */
|
||||
#endif
|
||||
/* #define BSDSOCKET */ /* bsdsocket.library emulation */
|
||||
/* #define UAEGFX_INTERNAL */ /* built-in libs:picasso96/uaegfx.card */
|
||||
#define BSDSOCKET /* bsdsocket.library emulation */
|
||||
/* #define CAPS */ /* CAPS-image support */
|
||||
/* #define FDI2RAW */ /* FDI 1.0 and 2.x image support */
|
||||
/* #define AVIOUTPUT */ /* Avioutput support */
|
||||
|
@ -441,6 +440,7 @@
|
|||
/* #undef HAVE_WINDOWS_H */
|
||||
|
||||
#define FSDB_DIR_SEPARATOR '/'
|
||||
#define FSDB_DIR_SEPARATOR_S "/"
|
||||
|
||||
#define strcmpi(x,y) strcasecmp(x,y)
|
||||
#define stricmp(x,y) strcasecmp(x,y)
|
||||
|
@ -455,6 +455,49 @@
|
|||
#define M68K_SPEED_14MHZ_CYCLES 1024
|
||||
#define M68K_SPEED_25MHZ_CYCLES 128
|
||||
|
||||
typedef unsigned int WPARAM;
|
||||
typedef long LPARAM;
|
||||
typedef int SOCKET;
|
||||
#define INVALID_SOCKET -1
|
||||
|
||||
typedef int BOOL;
|
||||
typedef unsigned char boolean;
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
/* Some defines to make it easier to compare files with WinUAE */
|
||||
#define _T(x) x
|
||||
#define TCHAR char
|
||||
#define _tzset() tzset()
|
||||
#define _tcsftime(w,x,y,z) strftime(w,x,y,z)
|
||||
#define _timezone timezone
|
||||
#define _daylight daylight
|
||||
#define _tfopen(x,y) fopen(x,y)
|
||||
#define _ftelli64(x) ftello64(x)
|
||||
#define _fseeki64(x,y,z) fseeko64(x,y,z)
|
||||
#define _stat64 stat64
|
||||
#define _wunlink(x) unlink(x)
|
||||
#define _tcslen(x) strlen(x)
|
||||
#define _tcscpy(x,y) strcpy(x,y)
|
||||
#define _tcsncpy(x,y,z) strncpy(x,y,z)
|
||||
#define _tcscat(x,y) strcat(x,y)
|
||||
#define _tcsncat(x,y,z) strncat(x,y,z)
|
||||
#define _tcscmp(x,y) strcmp(x,y)
|
||||
#define _tcsicmp(x,y) strcmpi(x,y)
|
||||
#define _tcsncmp(x,y,z) strncmp(x,y,z)
|
||||
#define _tcsnicmp(x,y,z) strncasecmp(x,y,z)
|
||||
#define _tcschr(x,y) strchr(x,y)
|
||||
#define _tcsrchr(x,y) strrchr(x,y)
|
||||
#define _tcsstr(x,y) strstr(x,y)
|
||||
#define _tcscspn(x,y) strcspn(x,y)
|
||||
#define _totupper(x) toupper(x)
|
||||
#define _totlower(x) tolower(x)
|
||||
#define _istupper(x) isupper(x)
|
||||
#define _istspace(x) isspace(x)
|
||||
#define _tstoi(x) atoi(x)
|
||||
#define _tstol(x) atol(x)
|
||||
#define _tcstol(x,y,z) strtol(x,y,z)
|
||||
#define _tcstod(x,y) strtod(x,y)
|
||||
#define _stprintf sprintf
|
||||
#define _vstprintf(x,y,z) vsprintf(x,y,z)
|
||||
#define _vsntprintf(w,x,y,z) vsnprintf(w,x,y,z)
|
||||
|
|
|
@ -14,15 +14,18 @@
|
|||
|
||||
extern int emulating;
|
||||
extern int uae4all_keystate[256];
|
||||
extern int stylusAdjustX;
|
||||
extern int stylusAdjustY;
|
||||
|
||||
extern int z3_start_adr;
|
||||
extern int rtg_start_adr;
|
||||
|
||||
void run_gui(void);
|
||||
void InGameMessage(const char *msg);
|
||||
|
||||
void saveAdfDir(void);
|
||||
void setCpuSpeed(void);
|
||||
void resetCpuSpeed(void);
|
||||
void update_display(struct uae_prefs *);
|
||||
void black_screen_now(void);
|
||||
void graphics_subshutdown (void);
|
||||
|
||||
void pandora_stop_sound(void);
|
||||
|
|
|
@ -13,10 +13,10 @@
|
|||
#define WRITE_LOG_BUF_SIZE 4096
|
||||
FILE *debugfile = NULL;
|
||||
|
||||
void console_out (const char *format,...)
|
||||
void console_out (const TCHAR *format,...)
|
||||
{
|
||||
va_list parms;
|
||||
char buffer[WRITE_LOG_BUF_SIZE];
|
||||
TCHAR buffer[WRITE_LOG_BUF_SIZE];
|
||||
|
||||
va_start (parms, format);
|
||||
vsnprintf (buffer, WRITE_LOG_BUF_SIZE-1, format, parms);
|
||||
|
@ -26,11 +26,11 @@ void console_out (const char *format,...)
|
|||
|
||||
#ifdef WITH_LOGGING
|
||||
|
||||
void write_log (const char *format,...)
|
||||
void write_log (const TCHAR *format,...)
|
||||
{
|
||||
int count;
|
||||
int numwritten;
|
||||
char buffer[WRITE_LOG_BUF_SIZE];
|
||||
TCHAR buffer[WRITE_LOG_BUF_SIZE];
|
||||
|
||||
va_list parms;
|
||||
va_start (parms, format);
|
||||
|
@ -44,11 +44,11 @@ void write_log (const char *format,...)
|
|||
|
||||
#endif
|
||||
|
||||
void jit_abort (const char *format,...)
|
||||
void jit_abort (const TCHAR *format,...)
|
||||
{
|
||||
static int happened;
|
||||
int count;
|
||||
char buffer[WRITE_LOG_BUF_SIZE];
|
||||
TCHAR buffer[WRITE_LOG_BUF_SIZE];
|
||||
va_list parms;
|
||||
va_start (parms, format);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue