Merge latest TomB version as of 22 August 2016
This commit is contained in:
parent
2d3da3d49e
commit
975a634a38
147 changed files with 16789 additions and 10817 deletions
|
@ -614,10 +614,10 @@ static void copyProtoent (TrapContext *context, SB, const struct protoent *p)
|
|||
size += strlen (p->p_aliases[numaliases++]) + 5;
|
||||
|
||||
if (sb->protoent) {
|
||||
uae_FreeMem (context, sb->protoent, sb->protoentsize);
|
||||
uae_FreeMem (context, sb->protoent, sb->protoentsize, sb->sysbase);
|
||||
}
|
||||
|
||||
sb->protoent = uae_AllocMem (context, size, 0);
|
||||
sb->protoent = uae_AllocMem (context, size, 0, sb->sysbase);
|
||||
|
||||
if (!sb->protoent) {
|
||||
write_log ("BSDSOCK: WARNING - copyProtoent() ran out of Amiga memory (couldn't allocate %d bytes)\n", size);
|
||||
|
@ -1359,10 +1359,10 @@ void host_getservbynameport (TrapContext *context, SB, uae_u32 name, uae_u32 pro
|
|||
size += strlen (s->s_aliases[numaliases++]) + 5;
|
||||
|
||||
if (sb->servent) {
|
||||
uae_FreeMem (context, sb->servent, sb->serventsize);
|
||||
uae_FreeMem (context, sb->servent, sb->serventsize, sb->sysbase);
|
||||
}
|
||||
|
||||
sb->servent = uae_AllocMem (context, size, 0);
|
||||
sb->servent = uae_AllocMem (context, size, 0, sb->sysbase);
|
||||
|
||||
if (!sb->servent) {
|
||||
write_log ("BSDSOCK: WARNING - getservby%s() ran out of Amiga memory (couldn't allocate %d bytes)\n",type ? "port" : "name", size);
|
||||
|
@ -1408,7 +1408,7 @@ int host_sbinit (TrapContext *context, SB)
|
|||
}
|
||||
|
||||
/* Alloc hostent buffer */
|
||||
sb->hostent = uae_AllocMem (context, 1024, 0);
|
||||
sb->hostent = uae_AllocMem (context, 1024, 0, sb->sysbase);
|
||||
sb->hostentsize = 1024;
|
||||
|
||||
/* @@@ The thread should be PTHREAD_CREATE_DETACHED */
|
||||
|
|
84
src/od-pandora/charset.cpp
Normal file
84
src/od-pandora/charset.cpp
Normal file
|
@ -0,0 +1,84 @@
|
|||
#include "sysconfig.h"
|
||||
#include "sysdeps.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
// UAE4ARM and fs-uae uses only chars / UTF-8 internally, so TCHAR is typedefed to
|
||||
// char (WinUAE uses wchar_t internally).
|
||||
|
||||
char *ua (const TCHAR *s)
|
||||
{
|
||||
if (s == NULL)
|
||||
return NULL;
|
||||
return strdup (s);
|
||||
}
|
||||
|
||||
char *au (const TCHAR *s)
|
||||
{
|
||||
if (s == NULL)
|
||||
return NULL;
|
||||
return strdup (s);
|
||||
}
|
||||
|
||||
TCHAR* utf8u (const char *s)
|
||||
{
|
||||
if (s == NULL)
|
||||
return NULL;
|
||||
return ua (s);
|
||||
}
|
||||
|
||||
char* uutf8 (const TCHAR *s)
|
||||
{
|
||||
if (s == NULL)
|
||||
return NULL;
|
||||
return ua (s);
|
||||
}
|
||||
|
||||
TCHAR *au_copy (TCHAR *dst, int maxlen, const char *src)
|
||||
{
|
||||
// this should match the WinUAE au_copy behavior, where either the
|
||||
// entire string is copied (and null-terminated), or the result is
|
||||
// an empty string
|
||||
if (uae_tcslcpy (dst, src, maxlen) >= maxlen) {
|
||||
dst[0] = '\0';
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
char *ua_copy (char *dst, int maxlen, const TCHAR *src)
|
||||
{
|
||||
return au_copy (dst, maxlen, src);
|
||||
}
|
||||
|
||||
TCHAR *my_strdup_ansi (const char *src)
|
||||
{
|
||||
return strdup (src);
|
||||
}
|
||||
|
||||
TCHAR *au_fs (const char *src)
|
||||
{
|
||||
if (src == NULL)
|
||||
return NULL;
|
||||
return strdup(src);
|
||||
}
|
||||
|
||||
char *ua_fs (const TCHAR *s, int defchar)
|
||||
{
|
||||
if (s == NULL)
|
||||
return NULL;
|
||||
return strdup(s);
|
||||
}
|
||||
|
||||
TCHAR *au_fs_copy (TCHAR *dst, int maxlen, const char *src)
|
||||
{
|
||||
dst[0] = 0;
|
||||
strncpy(dst, src, maxlen);
|
||||
return dst;
|
||||
}
|
||||
|
||||
char *ua_fs_copy (char *dst, int maxlen, const TCHAR *src, int defchar)
|
||||
{
|
||||
dst[0] = 0;
|
||||
strncpy(dst, src, maxlen);
|
||||
return dst;
|
||||
}
|
|
@ -2,6 +2,9 @@
|
|||
#include "sysdeps.h"
|
||||
#include "config.h"
|
||||
#include "fsdb.h"
|
||||
#include "zfile.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
||||
int dos_errno(void)
|
||||
|
@ -34,3 +37,69 @@ int dos_errno(void)
|
|||
return ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool my_stat (const TCHAR *name, struct mystat *statbuf)
|
||||
{
|
||||
struct stat64 st;
|
||||
|
||||
if(stat64(name, &st) == -1) {
|
||||
write_log("my_stat: stat on file %s failed\n", name);
|
||||
return false;
|
||||
}
|
||||
|
||||
statbuf->size = st.st_size;
|
||||
statbuf->mode = 0;
|
||||
if (st.st_mode & S_IRUSR) {
|
||||
statbuf->mode |= FILEFLAG_READ;
|
||||
}
|
||||
if (st.st_mode & S_IWUSR) {
|
||||
statbuf->mode |= FILEFLAG_WRITE;
|
||||
}
|
||||
statbuf->mtime.tv_sec = st.st_mtime;
|
||||
statbuf->mtime.tv_usec = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool my_chmod (const TCHAR *name, uae_u32 mode)
|
||||
{
|
||||
// return result of mystat so invalid file will return false
|
||||
struct mystat ms;
|
||||
return my_stat(name, &ms);
|
||||
}
|
||||
|
||||
|
||||
bool my_utime (const TCHAR *name, struct mytimeval *tv)
|
||||
{
|
||||
struct mytimeval mtv;
|
||||
struct timeval times[2];
|
||||
|
||||
if(tv == NULL) {
|
||||
struct timeval time;
|
||||
struct timezone tz;
|
||||
|
||||
gettimeofday(&time, &tz);
|
||||
mtv.tv_sec = time.tv_sec + tz.tz_minuteswest;
|
||||
mtv.tv_usec = time.tv_usec;
|
||||
} else {
|
||||
mtv.tv_sec = tv->tv_sec;
|
||||
mtv.tv_usec = tv->tv_usec;
|
||||
}
|
||||
|
||||
times[0].tv_sec = mtv.tv_sec;
|
||||
times[0].tv_usec = mtv.tv_usec;
|
||||
times[1].tv_sec = mtv.tv_sec;
|
||||
times[1].tv_usec = mtv.tv_usec;
|
||||
if(utimes(name, times) == 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get local time in secs, starting from 01.01.1970
|
||||
uae_u32 getlocaltime (void)
|
||||
{
|
||||
return time(NULL); // ToDo: convert UTC to local time...
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include "autoconf.h"
|
||||
#include "filesys.h"
|
||||
#include "gui.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
|
||||
|
||||
|
@ -249,6 +248,7 @@ static void CreateFilesysHardfileLoop(void)
|
|||
// Now we let the Gui object draw itself.
|
||||
uae_gui->draw();
|
||||
// Finally we update the screen.
|
||||
wait_for_vsync();
|
||||
SDL_Flip(gui_screen);
|
||||
}
|
||||
}
|
||||
|
@ -301,8 +301,8 @@ bool CreateFilesysHardfile(void)
|
|||
|
||||
uci = add_filesys_config(&changed_prefs, -1, (char *) txtDevice->getText().c_str(),
|
||||
0, (char *) txtPath->getText().c_str(), 0,
|
||||
32, (size / 1024) + 1, 2, 512,
|
||||
bp, 0, 0, 0);
|
||||
0, 32, (size / 1024) + 1, 2, 512,
|
||||
bp, 0, 0, 0, 0, 0, 0);
|
||||
if (uci)
|
||||
hardfile_do_disk_change (uci, 1);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include "autoconf.h"
|
||||
#include "filesys.h"
|
||||
#include "gui.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
|
||||
|
||||
|
@ -315,6 +314,7 @@ static void EditFilesysHardfileLoop(void)
|
|||
// Now we let the Gui object draw itself.
|
||||
uae_gui->draw();
|
||||
// Finally we update the screen.
|
||||
wait_for_vsync();
|
||||
SDL_Flip(gui_screen);
|
||||
}
|
||||
}
|
||||
|
@ -382,9 +382,9 @@ bool EditFilesysHardfile(int unit_no)
|
|||
|
||||
uci = add_filesys_config(&changed_prefs, unit_no, (char *) txtDevice->getText().c_str(),
|
||||
0, (char *) txtPath->getText().c_str(), !chkReadWrite->isSelected(),
|
||||
atoi(txtSectors->getText().c_str()), atoi(txtSurfaces->getText().c_str()),
|
||||
0, atoi(txtSectors->getText().c_str()), atoi(txtSurfaces->getText().c_str()),
|
||||
atoi(txtReserved->getText().c_str()), atoi(txtBlocksize->getText().c_str()),
|
||||
bp, 0, 0, 0);
|
||||
bp, 0, 0, 0, 0, 0, 0);
|
||||
if (uci)
|
||||
hardfile_do_disk_change (uci, 1);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include "autoconf.h"
|
||||
#include "filesys.h"
|
||||
#include "gui.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
|
||||
|
||||
|
@ -250,6 +249,7 @@ static void EditFilesysVirtualLoop(void)
|
|||
// Now we let the Gui object draw itself.
|
||||
uae_gui->draw();
|
||||
// Finally we update the screen.
|
||||
wait_for_vsync();
|
||||
SDL_Flip(gui_screen);
|
||||
}
|
||||
}
|
||||
|
@ -303,7 +303,7 @@ bool EditFilesysVirtual(int unit_no)
|
|||
|
||||
uci = add_filesys_config(&changed_prefs, unit_no, (char *) txtDevice->getText().c_str(),
|
||||
(char *) txtVolume->getText().c_str(), (char *) txtPath->getText().c_str(),
|
||||
!chkReadWrite->isSelected(), 0, 0, 0, 0, bp, 0, 0, 0);
|
||||
!chkReadWrite->isSelected(), 0, 0, 0, 0, 0, bp, 0, 0, 0, 0, 0, 0);
|
||||
if (uci)
|
||||
filesys_media_change (uci->rootdir, 1, uci);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "options.h"
|
||||
#include "uae.h"
|
||||
#include "gui.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
|
||||
|
||||
|
@ -92,6 +91,7 @@ void InGameMessage(const char *msg)
|
|||
cmdDone->requestFocus();
|
||||
|
||||
msg_done = 0;
|
||||
bool drawn = false;
|
||||
while(!msg_done)
|
||||
{
|
||||
//-------------------------------------------------
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "sysconfig.h"
|
||||
#include "sysdeps.h"
|
||||
#include "config.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
|
||||
typedef struct
|
||||
|
@ -79,11 +78,12 @@ static NavigationMap navMap[] =
|
|||
// PanelChipset
|
||||
{ "OCS", "Chipset", "BlitNormal", "CollFull", "ECS Agnus" },
|
||||
{ "ECS Agnus", "Chipset", "Immediate", "OCS", "Full ECS" },
|
||||
{ "Full ECS", "Chipset", "Immediate", "ECS Agnus", "AGA" },
|
||||
{ "Full ECS", "Chipset", "BlitWait", "ECS Agnus", "AGA" },
|
||||
{ "AGA", "Chipset", "Chipset", "Full ECS", "NTSC" },
|
||||
{ "NTSC", "Chipset", "Chipset", "AGA", "CollNone" },
|
||||
{ "BlitNormal", "OCS", "Fast copper", "CollFull", "Immediate" },
|
||||
{ "Immediate", "ECS Agnus", "Fast copper", "BlitNormal", "CollNone" },
|
||||
{ "Immediate", "ECS Agnus", "Fast copper", "BlitNormal", "BlitWait" },
|
||||
{ "BlitWait", "Full ECS", "Fast copper", "Immediate", "CollNone" },
|
||||
{ "Fast copper", "BlitNormal", "Chipset", "CollFull", "CollNone" },
|
||||
{ "CollNone", "Chipset", "Chipset", "NTSC", "Sprites only" },
|
||||
{ "Sprites only", "Chipset", "Chipset", "CollNone", "CollPlay" },
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "options.h"
|
||||
#include "uae.h"
|
||||
#include "gui.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "memory.h"
|
||||
#include "newcpu.h"
|
||||
#include "custom.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
|
||||
|
||||
|
@ -28,6 +27,7 @@ static gcn::UaeCheckBox* chkNTSC;
|
|||
static gcn::Window *grpBlitter;
|
||||
static gcn::UaeRadioButton* optBlitNormal;
|
||||
static gcn::UaeRadioButton* optBlitImmed;
|
||||
static gcn::UaeRadioButton* optBlitWait;
|
||||
static gcn::Window *grpCopper;
|
||||
static gcn::UaeCheckBox* chkFastCopper;
|
||||
static gcn::Window *grpCollisionLevel;
|
||||
|
@ -92,6 +92,7 @@ class BlitterButtonActionListener : public gcn::ActionListener
|
|||
void action(const gcn::ActionEvent& actionEvent)
|
||||
{
|
||||
changed_prefs.immediate_blits = optBlitImmed->isSelected();
|
||||
changed_prefs.waiting_blits = optBlitWait->isSelected();
|
||||
}
|
||||
};
|
||||
static BlitterButtonActionListener* blitterButtonActionListener;
|
||||
|
@ -157,12 +158,17 @@ void InitPanelChipset(const struct _ConfigCategory& category)
|
|||
optBlitImmed = new gcn::UaeRadioButton("Immediate", "radiocblittergroup");
|
||||
optBlitImmed->addActionListener(blitterButtonActionListener);
|
||||
|
||||
optBlitWait = new gcn::UaeRadioButton("Wait for blit.", "radiocblittergroup");
|
||||
optBlitWait->setId("BlitWait");
|
||||
optBlitWait->addActionListener(blitterButtonActionListener);
|
||||
|
||||
grpBlitter = new gcn::Window("Blitter");
|
||||
grpBlitter->setPosition(DISTANCE_BORDER + grpChipset->getWidth() + DISTANCE_NEXT_X, DISTANCE_BORDER);
|
||||
grpBlitter->add(optBlitNormal, 5, 10);
|
||||
grpBlitter->add(optBlitImmed, 5, 40);
|
||||
grpBlitter->add(optBlitWait, 5, 70);
|
||||
grpBlitter->setMovable(false);
|
||||
grpBlitter->setSize(120, 85);
|
||||
grpBlitter->setSize(120, 115);
|
||||
grpBlitter->setBaseColor(gui_baseCol);
|
||||
|
||||
category.panel->add(grpBlitter);
|
||||
|
@ -227,6 +233,7 @@ void ExitPanelChipset(void)
|
|||
|
||||
delete optBlitNormal;
|
||||
delete optBlitImmed;
|
||||
delete optBlitWait;
|
||||
delete grpBlitter;
|
||||
delete blitterButtonActionListener;
|
||||
|
||||
|
@ -258,6 +265,8 @@ void RefreshPanelChipset(void)
|
|||
|
||||
if(changed_prefs.immediate_blits)
|
||||
optBlitImmed->setSelected(true);
|
||||
else if(changed_prefs.waiting_blits)
|
||||
optBlitWait->setSelected(true);
|
||||
else
|
||||
optBlitNormal->setSelected(true);
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "uae.h"
|
||||
#include "blkdev.h"
|
||||
#include "gui.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
|
||||
|
||||
|
@ -213,9 +212,9 @@ class ConfigsListActionListener : public gcn::ActionListener
|
|||
DisableResume();
|
||||
RefreshAllPanels();
|
||||
if(emulating)
|
||||
uae_reset(1);
|
||||
uae_reset(1, 1);
|
||||
else
|
||||
uae_reset(0);
|
||||
uae_reset(0, 1);
|
||||
gui_running = false;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "memory.h"
|
||||
#include "uae.h"
|
||||
#include "gui.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "disk.h"
|
||||
#include "uae.h"
|
||||
#include "gui.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
|
||||
|
||||
|
@ -324,7 +323,7 @@ class CreateDiskActionListener : public gcn::ActionListener
|
|||
extractFileName(tmp, diskname);
|
||||
removeFileExtension(diskname);
|
||||
diskname[31] = '\0';
|
||||
disk_creatediskfile(tmp, 0, DRV_35_DD, diskname, false, false);
|
||||
disk_creatediskfile(tmp, 0, DRV_35_DD, diskname, false, false, NULL);
|
||||
AddFileToDiskList(tmp, 1);
|
||||
extractPath(tmp, currentDir);
|
||||
}
|
||||
|
@ -341,7 +340,7 @@ class CreateDiskActionListener : public gcn::ActionListener
|
|||
extractFileName(tmp, diskname);
|
||||
removeFileExtension(diskname);
|
||||
diskname[31] = '\0';
|
||||
disk_creatediskfile(tmp, 0, DRV_35_HD, diskname, false, false);
|
||||
disk_creatediskfile(tmp, 0, DRV_35_HD, diskname, false, false, NULL);
|
||||
AddFileToDiskList(tmp, 1);
|
||||
extractPath(tmp, currentDir);
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "filesys.h"
|
||||
#include "blkdev.h"
|
||||
#include "gui.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include "autoconf.h"
|
||||
#include "filesys.h"
|
||||
#include "gui.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
#include "keyboard.h"
|
||||
#include "inputdevice.h"
|
||||
|
@ -177,7 +176,7 @@ class InputActionListener : public gcn::ActionListener
|
|||
changed_prefs.jports[0].mode = JSEM_MODE_JOYSTICK;
|
||||
break;
|
||||
}
|
||||
inputdevice_updateconfig(&changed_prefs);
|
||||
inputdevice_updateconfig(NULL, &changed_prefs);
|
||||
}
|
||||
|
||||
else if (actionEvent.getSource() == cboPort1) {
|
||||
|
@ -192,7 +191,7 @@ class InputActionListener : public gcn::ActionListener
|
|||
changed_prefs.jports[1].mode = JSEM_MODE_JOYSTICK;
|
||||
break;
|
||||
}
|
||||
inputdevice_updateconfig(&changed_prefs);
|
||||
inputdevice_updateconfig(NULL, &changed_prefs);
|
||||
}
|
||||
|
||||
else if (actionEvent.getSource() == cboAutofire)
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include "autoconf.h"
|
||||
#include "filesys.h"
|
||||
#include "gui.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "options.h"
|
||||
#include "uae.h"
|
||||
#include "gui.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
|
||||
static gcn::Label *lblSystemROMs;
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "memory.h"
|
||||
#include "uae.h"
|
||||
#include "gui.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "rommgr.h"
|
||||
#include "uae.h"
|
||||
#include "gui.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
|
||||
static gcn::Label *lblMainROM;
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "uae.h"
|
||||
#include "gui.h"
|
||||
#include "savestate.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
|
||||
|
||||
|
@ -240,7 +239,7 @@ void RefreshPanelSavestate(void)
|
|||
}
|
||||
}
|
||||
|
||||
bool enabled = nr_units () == 0;
|
||||
bool enabled = 1; // nr_units () == 0;
|
||||
optState0->setEnabled(enabled);
|
||||
optState1->setEnabled(enabled);
|
||||
optState2->setEnabled(enabled);
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include "memory.h"
|
||||
#include "newcpu.h"
|
||||
#include "custom.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
#include "sd-pandora/sound.h"
|
||||
|
||||
|
|
|
@ -350,6 +350,7 @@ static void SelectFileLoop(void)
|
|||
// Now we let the Gui object draw itself.
|
||||
uae_gui->draw();
|
||||
// Finally we update the screen.
|
||||
wait_for_vsync();
|
||||
SDL_Flip(gui_screen);
|
||||
|
||||
if(!dialogCreated)
|
||||
|
|
|
@ -250,6 +250,7 @@ static void SelectFolderLoop(void)
|
|||
// Now we let the Gui object draw itself.
|
||||
uae_gui->draw();
|
||||
// Finally we update the screen.
|
||||
wait_for_vsync();
|
||||
SDL_Flip(gui_screen);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -143,6 +143,7 @@ static void ShowMessageLoop(void)
|
|||
// Now we let the Gui object draw itself.
|
||||
uae_gui->draw();
|
||||
// Finally we update the screen.
|
||||
wait_for_vsync();
|
||||
SDL_Flip(gui_screen);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "options.h"
|
||||
#include "uae.h"
|
||||
#include "gui.h"
|
||||
#include "target.h"
|
||||
#include "gui_handling.h"
|
||||
#include "memory.h"
|
||||
#include "autoconf.h"
|
||||
|
@ -204,7 +203,7 @@ namespace sdl
|
|||
//------------------------------------------------
|
||||
// First start of emulator -> reset Amiga
|
||||
//------------------------------------------------
|
||||
uae_reset(0);
|
||||
uae_reset(0,1);
|
||||
gui_running = false;
|
||||
}
|
||||
} else
|
||||
|
@ -228,7 +227,7 @@ namespace sdl
|
|||
//-------------------------------------------------
|
||||
// Reset Amiga
|
||||
//-------------------------------------------------
|
||||
uae_reset(1);
|
||||
uae_reset(1,1);
|
||||
gui_running = false;
|
||||
break;
|
||||
|
||||
|
@ -278,6 +277,7 @@ namespace sdl
|
|||
// Now we let the Gui object draw itself.
|
||||
uae_gui->draw();
|
||||
// Finally we update the screen.
|
||||
wait_for_vsync();
|
||||
SDL_Flip(gui_screen);
|
||||
|
||||
if(refreshFuncAfterDraw != NULL)
|
||||
|
@ -312,7 +312,7 @@ namespace widgets
|
|||
//-------------------------------------------------
|
||||
// Reset Amiga via click on Reset-button
|
||||
//-------------------------------------------------
|
||||
uae_reset(1);
|
||||
uae_reset(1, 1);
|
||||
gui_running = false;
|
||||
}
|
||||
else if(actionEvent.getSource() == cmdRestart)
|
||||
|
@ -346,7 +346,7 @@ namespace widgets
|
|||
//------------------------------------------------
|
||||
// First start of emulator -> reset Amiga
|
||||
//------------------------------------------------
|
||||
uae_reset(0);
|
||||
uae_reset(0, 1);
|
||||
gui_running = false;
|
||||
}
|
||||
}
|
||||
|
@ -592,7 +592,7 @@ void run_gui(void)
|
|||
std::cout << "Unknown exception" << std::endl;
|
||||
uae_quit();
|
||||
}
|
||||
if(quit_program > 1 || quit_program < -1)
|
||||
if(quit_program > UAE_QUIT || quit_program < -UAE_QUIT)
|
||||
{
|
||||
//--------------------------------------------------
|
||||
// Prepare everything for Reset of Amiga
|
||||
|
@ -600,6 +600,6 @@ void run_gui(void)
|
|||
currprefs.nr_floppies = changed_prefs.nr_floppies;
|
||||
|
||||
if(gui_rtarea_flags_onenter != gui_create_rtarea_flag(&changed_prefs))
|
||||
quit_program = -3; // Hardreset required...
|
||||
quit_program = -UAE_RESET_HARD; // Hardreset required...
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "sysconfig.h"
|
||||
#include "sysdeps.h"
|
||||
|
||||
#include "target.h"
|
||||
#include "zfile.h"
|
||||
#include "mp3decoder.h"
|
||||
#include "cda_play.h"
|
||||
|
|
|
@ -758,8 +758,6 @@ NEON_doline_n8_exit:
|
|||
ldmia sp!, {r4-r8, pc}
|
||||
|
||||
|
||||
.data
|
||||
|
||||
.align 8
|
||||
|
||||
Lookup_doline_n1:
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include "inputdevice.h"
|
||||
#include "keybuf.h"
|
||||
#include "keyboard.h"
|
||||
#include "joystick.h"
|
||||
#include "disk.h"
|
||||
#include "savestate.h"
|
||||
#include "traps.h"
|
||||
|
@ -333,6 +332,11 @@ void target_save_options (struct zfile *f, struct uae_prefs *p)
|
|||
}
|
||||
|
||||
|
||||
void target_restart (void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
TCHAR *target_expand_environment (const TCHAR *path)
|
||||
{
|
||||
return strdup(path);
|
||||
|
@ -463,7 +467,7 @@ int target_cfgfile_load (struct uae_prefs *p, const char *filename, int type, in
|
|||
}
|
||||
|
||||
if(!isdefault)
|
||||
inputdevice_updateconfig (p);
|
||||
inputdevice_updateconfig (NULL, p);
|
||||
|
||||
SetLastActiveConfig(filename);
|
||||
|
||||
|
@ -710,6 +714,21 @@ void loadAdfDir(void)
|
|||
}
|
||||
|
||||
|
||||
int currVSyncRate = 0;
|
||||
bool SetVSyncRate(int hz)
|
||||
{
|
||||
char cmd[64];
|
||||
|
||||
if(currVSyncRate != hz)
|
||||
{
|
||||
snprintf((char*)cmd, 64, "sudo /usr/pandora/scripts/op_lcdrate.sh %d", hz);
|
||||
system(cmd);
|
||||
currVSyncRate = hz;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void setCpuSpeed()
|
||||
{
|
||||
#ifdef PANDORA_SPECIFIC
|
||||
|
@ -727,9 +746,9 @@ void setCpuSpeed()
|
|||
if(changed_prefs.ntscmode != currprefs.ntscmode)
|
||||
{
|
||||
if(changed_prefs.ntscmode)
|
||||
system("sudo /usr/pandora/scripts/op_lcdrate.sh 60");
|
||||
SetVSyncRate(60);
|
||||
else
|
||||
system("sudo /usr/pandora/scripts/op_lcdrate.sh 50");
|
||||
SetVSyncRate(50);
|
||||
}
|
||||
#else
|
||||
return;
|
||||
|
@ -806,7 +825,7 @@ uae_u32 emulib_target_getcpurate (uae_u32 v, uae_u32 *low)
|
|||
int main (int argc, char *argv[])
|
||||
{
|
||||
struct sigaction action;
|
||||
|
||||
|
||||
defaultCpuSpeed = getDefaultCpuSpeed();
|
||||
|
||||
// Get startup path
|
||||
|
@ -1063,8 +1082,9 @@ void amiga_clipboard_got_data (uaecptr data, uae_u32 size, uae_u32 actual)
|
|||
{
|
||||
}
|
||||
|
||||
void amiga_clipboard_want_data (void)
|
||||
int amiga_clipboard_want_data (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void clipboard_vsync (void)
|
||||
|
|
|
@ -23,9 +23,21 @@
|
|||
#include <android/log.h>
|
||||
#endif
|
||||
|
||||
#include <linux/fb.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#ifndef OMAPFB_WAITFORVSYNC
|
||||
#define OMAPFB_WAITFORVSYNC _IOW('F', 0x20, unsigned int)
|
||||
#endif
|
||||
#ifndef OMAPFB_WAITFORVSYNC_FRAME
|
||||
#define OMAPFB_WAITFORVSYNC_FRAME _IOWR('O', 70, unsigned int)
|
||||
#endif
|
||||
|
||||
|
||||
/* SDL variable for output of emulation */
|
||||
SDL_Surface *prSDLScreen = NULL;
|
||||
static int fbdev = -1;
|
||||
static unsigned int current_vsync_frame = 0;
|
||||
|
||||
/* Possible screen modes (x and y resolutions) */
|
||||
#define MAX_SCREEN_MODES 6
|
||||
|
@ -58,7 +70,6 @@ int delay_savestate_frame = 0;
|
|||
#endif
|
||||
|
||||
|
||||
static unsigned long previous_synctime = 0;
|
||||
static unsigned long next_synctime = 0;
|
||||
|
||||
|
||||
|
@ -137,6 +148,11 @@ void graphics_subshutdown (void)
|
|||
SDL_FreeSurface(prSDLScreen);
|
||||
prSDLScreen = NULL;
|
||||
}
|
||||
if(fbdev != -1)
|
||||
{
|
||||
close(fbdev);
|
||||
fbdev = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -186,6 +202,9 @@ static void open_screen(struct uae_prefs *p)
|
|||
setenv("SDL_OMAP_LAYER_SIZE", layersize, 1);
|
||||
#endif
|
||||
}
|
||||
#ifndef WIN32
|
||||
setenv("SDL_OMAP_VSYNC", "0", 1);
|
||||
#endif
|
||||
|
||||
#ifdef ANDROIDSDL
|
||||
update_onscreen();
|
||||
|
@ -215,6 +234,17 @@ static void open_screen(struct uae_prefs *p)
|
|||
InitAmigaVidMode(p);
|
||||
init_row_map();
|
||||
}
|
||||
|
||||
current_vsync_frame = 0;
|
||||
fbdev = open("/dev/fb0", O_RDWR);
|
||||
if(fbdev != -1)
|
||||
{
|
||||
// Check if we have vsync with frame counter...
|
||||
current_vsync_frame = 0;
|
||||
ioctl(fbdev, OMAPFB_WAITFORVSYNC_FRAME, ¤t_vsync_frame);
|
||||
if(current_vsync_frame != 0)
|
||||
current_vsync_frame += 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -260,6 +290,8 @@ int check_prefs_changed_gfx (void)
|
|||
init_hz_full ();
|
||||
changed = 1;
|
||||
}
|
||||
|
||||
currprefs.filesys_limit = changed_prefs.filesys_limit;
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
@ -277,6 +309,17 @@ void unlockscr (void)
|
|||
SDL_UnlockSurface(prSDLScreen);
|
||||
}
|
||||
|
||||
|
||||
void wait_for_vsync(void)
|
||||
{
|
||||
if(fbdev != -1)
|
||||
{
|
||||
unsigned int dummy;
|
||||
ioctl(fbdev, OMAPFB_WAITFORVSYNC, &dummy);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void flush_screen ()
|
||||
{
|
||||
if (savestate_state == STATE_DOSAVE)
|
||||
|
@ -291,26 +334,47 @@ void flush_screen ()
|
|||
}
|
||||
}
|
||||
|
||||
unsigned long start = read_processor_time();
|
||||
if(start < next_synctime && next_synctime - start > time_per_frame - 1000)
|
||||
usleep((next_synctime - start) - 750);
|
||||
|
||||
#ifdef WITH_LOGGING
|
||||
RefreshLiveInfo();
|
||||
#endif
|
||||
|
||||
SDL_Flip(prSDLScreen);
|
||||
|
||||
unsigned long start = read_processor_time();
|
||||
if(current_vsync_frame == 0)
|
||||
{
|
||||
// Old style for vsync and idle time calc
|
||||
if(start < next_synctime && next_synctime - start > time_per_frame - 1000)
|
||||
usleep((next_synctime - start) - 750);
|
||||
ioctl(fbdev, OMAPFB_WAITFORVSYNC, ¤t_vsync_frame);
|
||||
}
|
||||
else
|
||||
{
|
||||
// New style for vsync and idle time calc
|
||||
int wait_till = current_vsync_frame;
|
||||
do
|
||||
{
|
||||
ioctl(fbdev, OMAPFB_WAITFORVSYNC_FRAME, ¤t_vsync_frame);
|
||||
} while (wait_till >= current_vsync_frame);
|
||||
|
||||
if(wait_till + 1 != current_vsync_frame)
|
||||
{
|
||||
// We missed a vsync...
|
||||
next_synctime = 0;
|
||||
}
|
||||
current_vsync_frame += currprefs.gfx_framerate;
|
||||
}
|
||||
|
||||
last_synctime = read_processor_time();
|
||||
SDL_Flip(prSDLScreen);
|
||||
|
||||
if(!screen_is_picasso)
|
||||
gfxvidinfo.bufmem = (uae_u8 *)prSDLScreen->pixels;
|
||||
|
||||
if(last_synctime - next_synctime > time_per_frame - 1000 || next_synctime < start)
|
||||
|
||||
if(last_synctime - next_synctime > time_per_frame * (1 + currprefs.gfx_framerate) - 1000 || next_synctime < start)
|
||||
adjust_idletime(0);
|
||||
else
|
||||
adjust_idletime(next_synctime - start);
|
||||
|
||||
if(last_synctime - next_synctime > time_per_frame - 5000)
|
||||
if (last_synctime - next_synctime > time_per_frame - 5000)
|
||||
next_synctime = last_synctime + time_per_frame * (1 + currprefs.gfx_framerate);
|
||||
else
|
||||
next_synctime = next_synctime + time_per_frame * (1 + currprefs.gfx_framerate);
|
||||
|
@ -425,7 +489,7 @@ int GetSurfacePixelFormat(void)
|
|||
}
|
||||
|
||||
|
||||
int graphics_init (void)
|
||||
int graphics_init (bool mousecapture)
|
||||
{
|
||||
graphics_subinit ();
|
||||
|
||||
|
@ -670,7 +734,72 @@ void picasso_InitResolutions (void)
|
|||
modesList();
|
||||
DisplayModes = Displays[0].DisplayModes;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool vsync_switchmode (int hz)
|
||||
{
|
||||
int changed_height = changed_prefs.gfx_size.height;
|
||||
|
||||
if (hz >= 55)
|
||||
hz = 60;
|
||||
else
|
||||
hz = 50;
|
||||
|
||||
if(hz == 50 && currVSyncRate == 60)
|
||||
{
|
||||
// Switch from NTSC -> PAL
|
||||
switch(changed_height) {
|
||||
case 200: changed_height = 240; break;
|
||||
case 216: changed_height = 262; break;
|
||||
case 240: changed_height = 270; break;
|
||||
case 256: changed_height = 270; break;
|
||||
case 262: changed_height = 270; break;
|
||||
case 270: changed_height = 270; break;
|
||||
}
|
||||
}
|
||||
else if(hz == 60 && currVSyncRate == 50)
|
||||
{
|
||||
// Switch from PAL -> NTSC
|
||||
switch(changed_height) {
|
||||
case 200: changed_height = 200; break;
|
||||
case 216: changed_height = 200; break;
|
||||
case 240: changed_height = 200; break;
|
||||
case 256: changed_height = 216; break;
|
||||
case 262: changed_height = 216; break;
|
||||
case 270: changed_height = 240; break;
|
||||
}
|
||||
}
|
||||
|
||||
if(changed_height == currprefs.gfx_size.height && hz == currprefs.chipset_refreshrate)
|
||||
return true;
|
||||
|
||||
changed_prefs.gfx_size.height = changed_height;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool target_graphics_buffer_update (void)
|
||||
{
|
||||
bool rate_changed = SetVSyncRate(currprefs.chipset_refreshrate);
|
||||
|
||||
if(currprefs.gfx_size.height != changed_prefs.gfx_size.height)
|
||||
{
|
||||
update_display(&changed_prefs);
|
||||
rate_changed = true;
|
||||
}
|
||||
|
||||
if(rate_changed)
|
||||
{
|
||||
black_screen_now();
|
||||
fpscounter_reset();
|
||||
time_per_frame = 1000 * 1000 / (currprefs.chipset_refreshrate);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef PICASSO96
|
||||
void gfx_set_picasso_state (int on)
|
||||
{
|
||||
if (on == screen_is_picasso)
|
||||
|
|
|
@ -438,7 +438,7 @@ static void after_leave_gui(void)
|
|||
}
|
||||
}
|
||||
if(update)
|
||||
inputdevice_updateconfig(&changed_prefs);
|
||||
inputdevice_updateconfig(NULL, &changed_prefs);
|
||||
|
||||
inputdevice_copyconfig (&changed_prefs, &currprefs);
|
||||
inputdevice_config_change_test();
|
||||
|
@ -460,7 +460,7 @@ int gui_init (void)
|
|||
gui_to_prefs();
|
||||
if(quit_program < 0)
|
||||
quit_program = -quit_program;
|
||||
if(quit_program == 1)
|
||||
if(quit_program == UAE_QUIT)
|
||||
ret = -2; // Quit without start of emulator
|
||||
|
||||
setCpuSpeed();
|
||||
|
@ -591,7 +591,7 @@ void gui_handle_events (void)
|
|||
|
||||
|
||||
if(keystate[SDLK_LCTRL] && keystate[SDLK_LSUPER] && (keystate[SDLK_RSUPER] ||keystate[SDLK_MENU]))
|
||||
uae_reset(0);
|
||||
uae_reset(0,1);
|
||||
|
||||
// L + R
|
||||
if(triggerL && triggerR)
|
||||
|
|
|
@ -143,30 +143,28 @@ struct inputdevice_functions inputdevicefunc_mouse = {
|
|||
get_mouse_flags
|
||||
};
|
||||
|
||||
static void setid (struct uae_input_device *uid, int i, int slot, int sub, int port, int evt)
|
||||
static void setid (struct uae_input_device *uid, int i, int slot, int sub, int port, int evt, bool gp)
|
||||
{
|
||||
uid->eventid[slot][SPARE_SUB_EVENT] = uid->eventid[slot][sub];
|
||||
uid->flags[slot][SPARE_SUB_EVENT] = uid->flags[slot][sub];
|
||||
uid->port[slot][SPARE_SUB_EVENT] = MAX_JPORTS + 1;
|
||||
|
||||
if (gp)
|
||||
inputdevice_sparecopy (&uid[i], slot, 0);
|
||||
uid[i].eventid[slot][sub] = evt;
|
||||
uid[i].port[slot][sub] = port + 1;
|
||||
}
|
||||
|
||||
static void setid_af (struct uae_input_device *uid, int i, int slot, int sub, int port, int evt, int af)
|
||||
static void setid_af (struct uae_input_device *uid, int i, int slot, int sub, int port, int evt, int af, bool gp)
|
||||
{
|
||||
setid (uid, i, slot, sub, port, evt);
|
||||
setid (uid, i, slot, sub, port, evt, gp);
|
||||
uid[i].flags[slot][sub] &= ~ID_FLAG_AUTOFIRE_MASK;
|
||||
if (af >= JPORT_AF_NORMAL)
|
||||
uid[i].flags[slot][sub] |= ID_FLAG_AUTOFIRE;
|
||||
}
|
||||
|
||||
int input_get_default_mouse (struct uae_input_device *uid, int i, int port, int af)
|
||||
int input_get_default_mouse (struct uae_input_device *uid, int i, int port, int af, bool gp)
|
||||
{
|
||||
setid (uid, i, ID_AXIS_OFFSET + 0, 0, port, port ? INPUTEVENT_MOUSE2_HORIZ : INPUTEVENT_MOUSE1_HORIZ);
|
||||
setid (uid, i, ID_AXIS_OFFSET + 1, 0, port, port ? INPUTEVENT_MOUSE2_VERT : INPUTEVENT_MOUSE1_VERT);
|
||||
setid_af (uid, i, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_FIRE_BUTTON : INPUTEVENT_JOY1_FIRE_BUTTON, af);
|
||||
setid (uid, i, ID_BUTTON_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_2ND_BUTTON : INPUTEVENT_JOY1_2ND_BUTTON);
|
||||
setid (uid, i, ID_AXIS_OFFSET + 0, 0, port, port ? INPUTEVENT_MOUSE2_HORIZ : INPUTEVENT_MOUSE1_HORIZ, gp);
|
||||
setid (uid, i, ID_AXIS_OFFSET + 1, 0, port, port ? INPUTEVENT_MOUSE2_VERT : INPUTEVENT_MOUSE1_VERT, gp);
|
||||
setid_af (uid, i, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_FIRE_BUTTON : INPUTEVENT_JOY1_FIRE_BUTTON, af, gp);
|
||||
setid (uid, i, ID_BUTTON_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_2ND_BUTTON : INPUTEVENT_JOY1_2ND_BUTTON, gp);
|
||||
|
||||
if (i == 0)
|
||||
return 1;
|
||||
|
@ -489,30 +487,28 @@ struct inputdevice_functions inputdevicefunc_joystick = {
|
|||
get_joystick_flags
|
||||
};
|
||||
|
||||
int input_get_default_joystick (struct uae_input_device *uid, int num, int port, int af, int mode)
|
||||
int input_get_default_joystick (struct uae_input_device *uid, int num, int port, int af, int mode, bool gp)
|
||||
{
|
||||
int h, v;
|
||||
|
||||
h = port ? INPUTEVENT_JOY2_HORIZ : INPUTEVENT_JOY1_HORIZ;;
|
||||
v = port ? INPUTEVENT_JOY2_VERT : INPUTEVENT_JOY1_VERT;
|
||||
|
||||
setid (uid, num, ID_AXIS_OFFSET + 0, 0, port, h);
|
||||
setid (uid, num, ID_AXIS_OFFSET + 1, 0, port, v);
|
||||
setid (uid, num, ID_AXIS_OFFSET + 0, 0, port, h, gp);
|
||||
setid (uid, num, ID_AXIS_OFFSET + 1, 0, port, v, gp);
|
||||
|
||||
setid_af (uid, num, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_FIRE_BUTTON : INPUTEVENT_JOY1_FIRE_BUTTON, af);
|
||||
setid (uid, num, ID_BUTTON_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_2ND_BUTTON : INPUTEVENT_JOY1_2ND_BUTTON);
|
||||
setid (uid, num, ID_BUTTON_OFFSET + 2, 0, port, port ? INPUTEVENT_JOY2_3RD_BUTTON : INPUTEVENT_JOY1_3RD_BUTTON);
|
||||
setid_af (uid, num, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_FIRE_BUTTON : INPUTEVENT_JOY1_FIRE_BUTTON, af, gp);
|
||||
setid (uid, num, ID_BUTTON_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_2ND_BUTTON : INPUTEVENT_JOY1_2ND_BUTTON, gp);
|
||||
setid (uid, num, ID_BUTTON_OFFSET + 2, 0, port, port ? INPUTEVENT_JOY2_3RD_BUTTON : INPUTEVENT_JOY1_3RD_BUTTON, gp);
|
||||
|
||||
if (mode == JSEM_MODE_JOYSTICK_CD32) {
|
||||
setid_af (uid, num, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_CD32_RED : INPUTEVENT_JOY1_CD32_RED, af);
|
||||
setid_af (uid, num, ID_BUTTON_OFFSET + 0, 1, port, port ? INPUTEVENT_JOY2_FIRE_BUTTON : INPUTEVENT_JOY1_FIRE_BUTTON, af);
|
||||
setid (uid, num, ID_BUTTON_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_CD32_BLUE : INPUTEVENT_JOY1_CD32_BLUE);
|
||||
setid (uid, num, ID_BUTTON_OFFSET + 1, 1, port, port ? INPUTEVENT_JOY2_2ND_BUTTON : INPUTEVENT_JOY1_2ND_BUTTON);
|
||||
setid (uid, num, ID_BUTTON_OFFSET + 2, 0, port, port ? INPUTEVENT_JOY2_CD32_GREEN : INPUTEVENT_JOY1_CD32_GREEN);
|
||||
setid (uid, num, ID_BUTTON_OFFSET + 3, 0, port, port ? INPUTEVENT_JOY2_CD32_YELLOW : INPUTEVENT_JOY1_CD32_YELLOW);
|
||||
setid (uid, num, ID_BUTTON_OFFSET + 4, 0, port, port ? INPUTEVENT_JOY2_CD32_RWD : INPUTEVENT_JOY1_CD32_RWD);
|
||||
setid (uid, num, ID_BUTTON_OFFSET + 5, 0, port, port ? INPUTEVENT_JOY2_CD32_FFW : INPUTEVENT_JOY1_CD32_FFW);
|
||||
setid (uid, num, ID_BUTTON_OFFSET + 6, 0, port, port ? INPUTEVENT_JOY2_CD32_PLAY : INPUTEVENT_JOY1_CD32_PLAY);
|
||||
setid_af (uid, num, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_CD32_RED : INPUTEVENT_JOY1_CD32_RED, af, gp);
|
||||
setid (uid, num, ID_BUTTON_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_CD32_BLUE : INPUTEVENT_JOY1_CD32_BLUE, gp);
|
||||
setid (uid, num, ID_BUTTON_OFFSET + 2, 0, port, port ? INPUTEVENT_JOY2_CD32_GREEN : INPUTEVENT_JOY1_CD32_GREEN, gp);
|
||||
setid (uid, num, ID_BUTTON_OFFSET + 3, 0, port, port ? INPUTEVENT_JOY2_CD32_YELLOW : INPUTEVENT_JOY1_CD32_YELLOW, gp);
|
||||
setid (uid, num, ID_BUTTON_OFFSET + 4, 0, port, port ? INPUTEVENT_JOY2_CD32_RWD : INPUTEVENT_JOY1_CD32_RWD, gp);
|
||||
setid (uid, num, ID_BUTTON_OFFSET + 5, 0, port, port ? INPUTEVENT_JOY2_CD32_FFW : INPUTEVENT_JOY1_CD32_FFW, gp);
|
||||
setid (uid, num, ID_BUTTON_OFFSET + 6, 0, port, port ? INPUTEVENT_JOY2_CD32_PLAY : INPUTEVENT_JOY1_CD32_PLAY, gp);
|
||||
}
|
||||
if (num == 0) {
|
||||
return 1;
|
||||
|
|
|
@ -8,14 +8,18 @@
|
|||
#include "memory.h"
|
||||
#include "newcpu.h"
|
||||
#include "custom.h"
|
||||
#include "akiko.h"
|
||||
#include <sys/mman.h>
|
||||
#include <SDL.h>
|
||||
|
||||
extern uae_u8 *extendedkickmemory2;
|
||||
|
||||
|
||||
uae_u8* natmem_offset = 0;
|
||||
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)
|
||||
uae_u32 max_z3fastmem;
|
||||
|
||||
/* JIT can access few bytes outside of memory block of it executes code at the very end of memory block */
|
||||
#define BARRIER 32
|
||||
|
@ -60,7 +64,7 @@ void alloc_AmigaMem(void)
|
|||
abort();
|
||||
}
|
||||
additional_mem = (uae_u8*) mmap(natmem_offset + 0x10000000, ADDITIONAL_MEMSIZE + BARRIER,
|
||||
PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
|
||||
PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
|
||||
if(additional_mem != MAP_FAILED)
|
||||
{
|
||||
// Allocation successful -> we can use natmem_offset for entire memory access
|
||||
|
@ -189,3 +193,29 @@ uae_u8 *mapped_malloc (size_t s, const char *file)
|
|||
void mapped_free (uae_u8 *p)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void protect_roms (bool protect)
|
||||
{
|
||||
/*
|
||||
If this code is enabled, we can't switch back from JIT to nonJIT emulation...
|
||||
|
||||
if (protect) {
|
||||
// protect only if JIT enabled, always allow unprotect
|
||||
if (!currprefs.cachesize)
|
||||
return;
|
||||
}
|
||||
|
||||
// Protect all regions, which contains ROM
|
||||
if(extendedkickmemory != NULL)
|
||||
mprotect(extendedkickmemory, 0x80000, protect ? PROT_READ : PROT_READ | PROT_WRITE);
|
||||
if(extendedkickmemory2 != NULL)
|
||||
mprotect(extendedkickmemory2, 0x80000, protect ? PROT_READ : PROT_READ | PROT_WRITE);
|
||||
if(kickmemory != NULL)
|
||||
mprotect(kickmemory, 0x80000, protect ? PROT_READ : PROT_READ | PROT_WRITE);
|
||||
if(rtarea != NULL)
|
||||
mprotect(rtarea, RTAREA_SIZE, protect ? PROT_READ : PROT_READ | PROT_WRITE);
|
||||
if(filesysory != NULL)
|
||||
mprotect(filesysory, 0x10000, protect ? PROT_READ : PROT_READ | PROT_WRITE);
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -361,9 +361,9 @@ static void parse_boot(struct uae_prefs *p, xmlNode *node)
|
|||
sprintf(dhx, "DH%d", add_HDF_DHnum);
|
||||
++add_HDF_DHnum;
|
||||
if(hardfile_testrdb (target_file))
|
||||
uci = add_filesys_config(p, -1, dhx, 0, target_file, readonly, 0, 0, 0, 512, 127, 0, 0, 0);
|
||||
uci = add_filesys_config(p, -1, dhx, 0, target_file, readonly, 0, 0, 0, 0, 512, 127, 0, 0, 0, 0, 0, 0);
|
||||
else
|
||||
uci = add_filesys_config(p, -1, dhx, 0, target_file, readonly, 32, 1, 2, 512, 127, 0, 0, 0);
|
||||
uci = add_filesys_config(p, -1, dhx, 0, target_file, readonly, 0, 32, 1, 2, 512, 127, 0, 0, 0, 0, 0, 0);
|
||||
if (uci)
|
||||
hardfile_do_disk_change (uci, 1);
|
||||
gui_force_rtarea_hdchange();
|
||||
|
@ -460,9 +460,9 @@ static void extract_media(struct uae_prefs *p, unzFile uz, xmlNode *node)
|
|||
sprintf(dhx, "DH%d", add_HDF_DHnum);
|
||||
++add_HDF_DHnum;
|
||||
if(hardfile_testrdb (target_file))
|
||||
uci = add_filesys_config(p, -1, dhx, 0, target_file, 0, 0, 0, 0, 512, 0, 0, 0, 0);
|
||||
uci = add_filesys_config(p, -1, dhx, 0, target_file, 0, 0, 0, 0, 0, 512, 0, 0, 0, 0, 0, 0, 0);
|
||||
else
|
||||
uci = add_filesys_config(p, -1, dhx, 0, target_file, 0, 32, 1, 2, 512, 0, 0, 0, 0);
|
||||
uci = add_filesys_config(p, -1, dhx, 0, target_file, 0, 0, 32, 1, 2, 512, 0, 0, 0, 0, 0, 0, 0);
|
||||
if (uci)
|
||||
hardfile_do_disk_change (uci, 1);
|
||||
gui_force_rtarea_hdchange();
|
||||
|
|
|
@ -48,8 +48,8 @@
|
|||
#include "options.h"
|
||||
#include "td-sdl/thread.h"
|
||||
#include "memory.h"
|
||||
#include "newcpu.h"
|
||||
#include "custom.h"
|
||||
#include "newcpu.h"
|
||||
#include "xwin.h"
|
||||
#include "savestate.h"
|
||||
#include "autoconf.h"
|
||||
|
@ -71,10 +71,10 @@ static int p96syncrate;
|
|||
int p96hsync_counter;
|
||||
|
||||
#ifdef PICASSO96
|
||||
|
||||
#define P96TRACING_ENABLED 0
|
||||
#define P96TRACING_LEVEL 0
|
||||
|
||||
#ifdef DEBUG // Change this to _DEBUG for debugging
|
||||
#define P96TRACING_ENABLED 1
|
||||
#define P96TRACING_LEVEL 1
|
||||
#endif
|
||||
static void flushpixels(void);
|
||||
#if P96TRACING_ENABLED
|
||||
#define P96TRACE(x) do { write_log x; } while(0)
|
||||
|
@ -157,7 +157,10 @@ static void checkrtglibrary(void)
|
|||
uae_u16 ver = get_word(v + 20);
|
||||
uae_u16 rev = get_word(v + 22);
|
||||
if (ver * 10000 + rev < UAE_RTG_LIBRARY_VERSION * 10000 + UAE_RTG_LIBRARY_REVISION) {
|
||||
write_log(_T("installed rtg.library: %d.%d, required: %d.%d\n"), ver, rev, UAE_RTG_LIBRARY_VERSION, UAE_RTG_LIBRARY_REVISION);
|
||||
TCHAR msg[2000];
|
||||
sprintf(msg, _T("installed rtg.library: %d.%d, required: %d.%d\n"), ver, rev, UAE_RTG_LIBRARY_VERSION, UAE_RTG_LIBRARY_REVISION);
|
||||
write_log(msg);
|
||||
gui_message(msg);
|
||||
} else {
|
||||
write_log(_T("P96: rtg.library %d.%d detected\n"), ver, rev);
|
||||
}
|
||||
|
@ -521,15 +524,17 @@ void picasso_trigger_vblank (void)
|
|||
return;
|
||||
put_long (uaegfx_base + CARD_IRQPTR, ABI_interrupt + PSSO_BoardInfo_SoftInterrupt);
|
||||
put_byte (uaegfx_base + CARD_IRQFLAG, 1);
|
||||
INTREQ (0x8000 | 0x0008);
|
||||
}
|
||||
|
||||
void picasso_handle_vsync (void)
|
||||
{
|
||||
picasso_trigger_vblank();
|
||||
if (currprefs.rtgmem_size == 0)
|
||||
return;
|
||||
|
||||
if (!picasso_on)
|
||||
return;
|
||||
if (!picasso_on) {
|
||||
picasso_trigger_vblank ();
|
||||
return;
|
||||
}
|
||||
|
||||
framecnt++;
|
||||
|
||||
|
@ -537,8 +542,10 @@ void picasso_handle_vsync (void)
|
|||
;
|
||||
} else {
|
||||
flushpixels ();
|
||||
flush_screen();
|
||||
}
|
||||
gfx_unlock_picasso ();
|
||||
|
||||
picasso_trigger_vblank();
|
||||
}
|
||||
|
||||
static int set_panning_called = 0;
|
||||
|
@ -580,13 +587,12 @@ enum {
|
|||
RGBFB_CLUT_8
|
||||
};
|
||||
|
||||
static void setconvert (void)
|
||||
static int getconvert (int rgbformat, int pixbytes)
|
||||
{
|
||||
int d = picasso_vidinfo.pixbytes;
|
||||
int v;
|
||||
int v = 0;
|
||||
int d = pixbytes;
|
||||
|
||||
v = 0;
|
||||
switch (picasso96_state.RGBFormat)
|
||||
switch (rgbformat)
|
||||
{
|
||||
case RGBFB_CLUT:
|
||||
if (d == 1)
|
||||
|
@ -672,9 +678,16 @@ static void setconvert (void)
|
|||
v = RGBFB_R8G8B8A8_32;
|
||||
break;
|
||||
}
|
||||
picasso_convert = v;
|
||||
return v;
|
||||
}
|
||||
|
||||
static void setconvert (void)
|
||||
{
|
||||
picasso_convert = getconvert (picasso96_state.RGBFormat, picasso_vidinfo.pixbytes);
|
||||
host_mode = GetSurfacePixelFormat();
|
||||
write_log (_T("RTG conversion: Depth=%d HostRGBF=%d P96RGBF=%d Mode=%d\n"), d, host_mode, picasso96_state.RGBFormat, v);
|
||||
picasso_palette ();
|
||||
write_log (_T("RTG conversion: Depth=%d HostRGBF=%d P96RGBF=%d Mode=%d\n"),
|
||||
picasso_vidinfo.pixbytes, host_mode, picasso96_state.RGBFormat, picasso_convert);
|
||||
}
|
||||
|
||||
/* Clear our screen, since we've got a new Picasso screen-mode, and refresh with the proper contents
|
||||
|
@ -1055,6 +1068,8 @@ d7: RGBFTYPE RGBFormat
|
|||
*/
|
||||
static uae_u32 REGPARAM2 picasso_SetSpritePosition (TrapContext *ctx)
|
||||
{
|
||||
uaecptr bi = m68k_areg (regs, 0);
|
||||
boardinfo = bi;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1073,6 +1088,8 @@ This function changes one of the possible three colors of the hardware sprite.
|
|||
*/
|
||||
static uae_u32 REGPARAM2 picasso_SetSpriteColor (TrapContext *ctx)
|
||||
{
|
||||
uaecptr bi = m68k_areg (regs, 0);
|
||||
boardinfo = bi;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1104,6 +1121,8 @@ compensate for this when accounting for hotspot offsets and sprite dimensions.
|
|||
*/
|
||||
static uae_u32 REGPARAM2 picasso_SetSpriteImage (TrapContext *ctx)
|
||||
{
|
||||
uaecptr bi = m68k_areg (regs, 0);
|
||||
boardinfo = bi;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1468,7 +1487,7 @@ void picasso96_alloc (TrapContext *ctx)
|
|||
picasso96_alloc2 (ctx);
|
||||
}
|
||||
|
||||
static uaecptr inituaegfxfuncs (uaecptr start, uaecptr ABI);
|
||||
static void inituaegfxfuncs (uaecptr start, uaecptr ABI);
|
||||
static void inituaegfx (uaecptr ABI)
|
||||
{
|
||||
uae_u32 flags;
|
||||
|
@ -1503,14 +1522,17 @@ static void inituaegfx (uaecptr ABI)
|
|||
|
||||
flags = get_long (ABI + PSSO_BoardInfo_Flags);
|
||||
flags &= 0xffff0000;
|
||||
if (flags & BIF_NOBLITTER)
|
||||
write_log (_T("P96: Blitter disabled in devs:monitors/uaegfx!\n"));
|
||||
flags |= BIF_BLITTER | BIF_NOMEMORYMODEMIX;
|
||||
flags &= ~BIF_HARDWARESPRITE;
|
||||
|
||||
if (flags & BIF_NOBLITTER)
|
||||
write_log (_T("P96: Blitter disabled in devs:monitors/uaegfx!\n"));
|
||||
|
||||
if (!uaegfx_old)
|
||||
flags |= BIF_VBLANKINTERRUPT;
|
||||
if (!(flags & BIF_INDISPLAYCHAIN)) {
|
||||
write_log (_T("P96: BIF_INDISPLAYCHAIN force-enabled!\n"));
|
||||
flags |= BIF_INDISPLAYCHAIN;
|
||||
}
|
||||
|
||||
put_long (ABI + PSSO_BoardInfo_Flags, flags);
|
||||
|
||||
|
@ -1537,10 +1559,13 @@ static void addmode (uaecptr AmigaBoardInfo, uaecptr *amem, struct LibResolution
|
|||
res->Height = h;
|
||||
res->Flags = P96F_PUBLIC;
|
||||
memcpy (res->P96ID, "P96-0:", 6);
|
||||
if (name)
|
||||
strcpy (res->Name, name);
|
||||
else
|
||||
if (name) {
|
||||
char *n2 = ua (name);
|
||||
strcpy (res->Name, n2);
|
||||
xfree (n2);
|
||||
} else {
|
||||
sprintf (res->Name, "UAE:%4dx%4d", w, h);
|
||||
}
|
||||
|
||||
for (depth = 8; depth <= 32; depth++) {
|
||||
if (!p96depth (depth))
|
||||
|
@ -1561,7 +1586,7 @@ static void addmode (uaecptr AmigaBoardInfo, uaecptr *amem, struct LibResolution
|
|||
static uae_u32 REGPARAM2 picasso_InitCard (TrapContext *ctx)
|
||||
{
|
||||
int LibResolutionStructureCount = 0;
|
||||
int i, j, unkcnt;
|
||||
int i, j, unkcnt, cnt;
|
||||
|
||||
uaecptr amem;
|
||||
uaecptr AmigaBoardInfo = m68k_areg (regs, 0);
|
||||
|
@ -1575,12 +1600,15 @@ static uae_u32 REGPARAM2 picasso_InitCard (TrapContext *ctx)
|
|||
inituaegfx (AmigaBoardInfo);
|
||||
|
||||
i = 0;
|
||||
unkcnt = 0;
|
||||
unkcnt = cnt = 0;
|
||||
while (newmodes[i].depth >= 0) {
|
||||
struct LibResolution res = { 0 };
|
||||
TCHAR *s;
|
||||
j = i;
|
||||
addmode (AmigaBoardInfo, &amem, &res, newmodes[i].res.width, newmodes[i].res.height, NULL, 0, &unkcnt);
|
||||
write_log (_T("%08X %4dx%4d %s\n"), res.DisplayID, res.Width, res.Height, res.Name);
|
||||
s = au (res.Name);
|
||||
write_log (_T("%2d: %08X %4dx%4d %s\n"), ++cnt, res.DisplayID, res.Width, res.Height, s);
|
||||
xfree (s);
|
||||
while (newmodes[i].depth >= 0
|
||||
&& newmodes[i].res.width == newmodes[j].res.width
|
||||
&& newmodes[i].res.height == newmodes[j].res.height)
|
||||
|
@ -1693,6 +1721,8 @@ static uae_u32 REGPARAM2 picasso_SetColorArray (TrapContext *ctx)
|
|||
uae_u16 count = m68k_dreg (regs, 1);
|
||||
uaecptr boardinfo = m68k_areg (regs, 0);
|
||||
uaecptr clut = boardinfo + PSSO_BoardInfo_CLUT;
|
||||
if (start > 256 || start + count > 256)
|
||||
return 0;
|
||||
updateclut (clut, start, count);
|
||||
P96TRACE((_T("SetColorArray(%d,%d)\n"), start, count));
|
||||
return 1;
|
||||
|
@ -2567,7 +2597,8 @@ static uae_u32 REGPARAM2 picasso_SetDisplay (TrapContext *ctx)
|
|||
|
||||
void init_hz_p96 (void)
|
||||
{
|
||||
p96vblank = currprefs.ntscmode ? 60 : 50;
|
||||
p96vblank = vblank_hz;
|
||||
p96syncrate = maxvpos_nom * vblank_hz / p96vblank;
|
||||
}
|
||||
|
||||
/* NOTE: Watch for those planeptrs of 0x00000000 and 0xFFFFFFFF for all zero / all one bitmaps !!!! */
|
||||
|
@ -2830,6 +2861,22 @@ static uae_u32 REGPARAM2 picasso_BlitPlanar2Direct (TrapContext *ctx)
|
|||
return result;
|
||||
}
|
||||
|
||||
#include "statusline.h"
|
||||
static void statusline (uae_u8 *dst)
|
||||
{
|
||||
int y;
|
||||
int dst_height, dst_width, pitch;
|
||||
|
||||
dst_height = picasso96_state.Height;
|
||||
dst_width = picasso96_state.Width;
|
||||
pitch = picasso_vidinfo.rowbytes;
|
||||
for (y = 0; y < TD_TOTAL_HEIGHT; y++) {
|
||||
int line = dst_height - TD_TOTAL_HEIGHT + y;
|
||||
uae_u8 *buf = dst + line * pitch;
|
||||
draw_status_line_single (buf, y, dst_width);
|
||||
}
|
||||
}
|
||||
|
||||
static void copyall (uae_u8 *src, uae_u8 *dst)
|
||||
{
|
||||
if (picasso96_state.RGBFormat == RGBFB_R5G6B5)
|
||||
|
@ -2857,14 +2904,15 @@ static void flushpixels (void)
|
|||
if (doskip () && p96skipmode == 1)
|
||||
return;
|
||||
|
||||
if(picasso96_state.RGBFormat == RGBFB_CLUT)
|
||||
picasso_palette ();
|
||||
|
||||
dst = gfx_lock_picasso ();
|
||||
if (dst == NULL)
|
||||
return;
|
||||
|
||||
copyall (src + off, dst);
|
||||
|
||||
if(currprefs.leds_on_screen)
|
||||
statusline (dst);
|
||||
|
||||
gfx_unlock_picasso ();
|
||||
}
|
||||
|
||||
|
@ -2998,11 +3046,11 @@ static void initvblankirq (TrapContext *ctx, uaecptr base)
|
|||
put_long (p2 + 14, base + CARD_IRQFLAG);
|
||||
put_long (p2 + 18, c);
|
||||
|
||||
put_word (c, 0x4a11); c += 2; // tst.b (a1)
|
||||
put_word (c, 0x4a11); c += 2; // tst.b (a1) CARD_IRQFLAG
|
||||
put_word (c, 0x670e); c += 2; // beq.s label
|
||||
put_word (c, 0x4211); c += 2; // clr.b (a1)
|
||||
put_long (c, 0x22690004); c += 4; // move.l 4(a1),a1
|
||||
put_long (c, 0x2c780004); c += 4; // move.l 4.w,a6
|
||||
put_long (c, 0x2c690008); c += 4; // move.l 8(a1),a6 CARD_IRQEXECBASE
|
||||
put_long (c, 0x22690004); c += 4; // move.l 4(a1),a1 CARD_IRQPTR
|
||||
put_long (c, 0x4eaeff4c); c += 4; // jsr Cause(a6)
|
||||
put_word (c, 0x7000); c += 2; // label: moveq #0,d0
|
||||
put_word (c, RTS); // rts
|
||||
|
@ -3060,13 +3108,10 @@ static uae_u32 REGPARAM2 picasso_SetMemoryMode(TrapContext *ctx)
|
|||
if (ABI) \
|
||||
put_long (ABI + func, start);
|
||||
|
||||
static uaecptr inituaegfxfuncs (uaecptr start, uaecptr ABI)
|
||||
static void inituaegfxfuncs (uaecptr start, uaecptr ABI)
|
||||
{
|
||||
uaecptr old = here ();
|
||||
uaecptr ptr;
|
||||
|
||||
if (uaegfx_old)
|
||||
return 0;
|
||||
return;
|
||||
org (start);
|
||||
|
||||
dw (RTS);
|
||||
|
@ -3222,26 +3267,26 @@ static uaecptr inituaegfxfuncs (uaecptr start, uaecptr ABI)
|
|||
|
||||
if (ABI)
|
||||
initvblankABI (uaegfx_base, ABI);
|
||||
ptr = here ();
|
||||
org (old);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void picasso_reset (void)
|
||||
{
|
||||
uaegfx_base = 0;
|
||||
uaegfx_old = 0;
|
||||
uaegfx_active = 0;
|
||||
interrupt_enabled = 0;
|
||||
reserved_gfxmem = 0;
|
||||
resetpalette();
|
||||
if (savestate_state != STATE_RESTORE) {
|
||||
uaegfx_base = 0;
|
||||
uaegfx_old = 0;
|
||||
uaegfx_active = 0;
|
||||
interrupt_enabled = 0;
|
||||
reserved_gfxmem = 0;
|
||||
resetpalette();
|
||||
InitPicasso96 ();
|
||||
}
|
||||
}
|
||||
|
||||
void uaegfx_install_code (void)
|
||||
void uaegfx_install_code (uaecptr start)
|
||||
{
|
||||
uaecptr start = here ();
|
||||
uaegfx_rom = start;
|
||||
org (inituaegfxfuncs (start, 0));
|
||||
org (start);
|
||||
inituaegfxfuncs (start, 0);
|
||||
}
|
||||
|
||||
#define UAEGFX_VERSION 3
|
||||
|
@ -3323,6 +3368,7 @@ static uaecptr uaegfx_card_install (TrapContext *ctx, uae_u32 extrasize)
|
|||
m68k_dreg (regs, 0) = 0;
|
||||
put_long (uaegfx_base + CARD_EXPANSIONBASE, CallLib (ctx, exec, -0x228)); /* OpenLibrary */
|
||||
put_long (uaegfx_base + CARD_EXECBASE, exec);
|
||||
put_long (uaegfx_base + CARD_IRQEXECBASE, exec);
|
||||
put_long (uaegfx_base + CARD_NAME, uaegfx_resname);
|
||||
put_long (uaegfx_base + CARD_RESLIST, uaegfx_base + CARD_SIZEOF);
|
||||
put_long (uaegfx_base + CARD_RESLISTSIZE, extrasize);
|
||||
|
@ -3384,14 +3430,20 @@ void restore_p96_finish (void)
|
|||
init_alloc (NULL, 0);
|
||||
if (uaegfx_rom && boardinfo)
|
||||
inituaegfxfuncs (uaegfx_rom, boardinfo);
|
||||
if (set_gc_called) {
|
||||
init_picasso_screen ();
|
||||
init_hz_p96 ();
|
||||
}
|
||||
#if 0
|
||||
if (picasso_requested_on) {
|
||||
picasso_on = true;
|
||||
set_gc_called = 1;
|
||||
init_picasso_screen ();
|
||||
init_hz_p96 ();
|
||||
picasso_refresh ();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
uae_u8 *restore_p96 (uae_u8 *src)
|
||||
{
|
||||
uae_u32 flags;
|
||||
int i;
|
||||
|
||||
if (restore_u32 () != 2)
|
||||
return src;
|
||||
|
@ -3420,6 +3472,13 @@ uae_u8 *restore_p96 (uae_u8 *src)
|
|||
uaegfx_base = restore_u32 ();
|
||||
uaegfx_rom = restore_u32 ();
|
||||
boardinfo = restore_u32 ();
|
||||
if (flags & 64) {
|
||||
for (i = 0; i < 256; i++) {
|
||||
picasso96_state.CLUT[i].Red = restore_u8 ();
|
||||
picasso96_state.CLUT[i].Green = restore_u8 ();
|
||||
picasso96_state.CLUT[i].Blue = restore_u8 ();
|
||||
}
|
||||
}
|
||||
picasso96_state.HostAddress = NULL;
|
||||
picasso_SetPanningInit();
|
||||
picasso96_state.Extent = picasso96_state.Address + picasso96_state.BytesPerRow * picasso96_state.VirtualHeight;
|
||||
|
@ -3429,6 +3488,7 @@ uae_u8 *restore_p96 (uae_u8 *src)
|
|||
uae_u8 *save_p96 (int *len, uae_u8 *dstptr)
|
||||
{
|
||||
uae_u8 *dstbak,*dst;
|
||||
int i;
|
||||
|
||||
if (currprefs.rtgmem_size == 0)
|
||||
return NULL;
|
||||
|
@ -3438,7 +3498,7 @@ uae_u8 *save_p96 (int *len, uae_u8 *dstptr)
|
|||
dstbak = dst = xmalloc (uae_u8, 1000);
|
||||
save_u32 (2);
|
||||
save_u32 ((picasso_on ? 1 : 0) | (set_gc_called ? 2 : 0) | (set_panning_called ? 4 : 0) |
|
||||
(interrupt_enabled ? 32 : 0));
|
||||
(interrupt_enabled ? 32 : 0) | 64);
|
||||
save_u32 (currprefs.rtgmem_size);
|
||||
save_u32 (picasso96_state.Address);
|
||||
save_u32 (picasso96_state.RGBFormat);
|
||||
|
@ -3455,6 +3515,11 @@ uae_u8 *save_p96 (int *len, uae_u8 *dstptr)
|
|||
save_u32 (uaegfx_base);
|
||||
save_u32 (uaegfx_rom);
|
||||
save_u32 (boardinfo);
|
||||
for (i = 0; i < 256; i++) {
|
||||
save_u8 (picasso96_state.CLUT[i].Red);
|
||||
save_u8 (picasso96_state.CLUT[i].Green);
|
||||
save_u8 (picasso96_state.CLUT[i].Blue);
|
||||
}
|
||||
*len = dst - dstbak;
|
||||
return dstbak;
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ enum {
|
|||
ARM_REG_CPSR = 16
|
||||
};
|
||||
|
||||
static inline void unknown_instruction(uae_u32 instr)
|
||||
STATIC_INLINE void unknown_instruction(uae_u32 instr)
|
||||
{
|
||||
panicbug("Unknown instruction %08x!\n", instr);
|
||||
SDL_Quit();
|
||||
|
@ -76,7 +76,8 @@ static bool handle_arm_instruction(unsigned long *pregs, uintptr addr)
|
|||
unsigned int *pc = (unsigned int *)pregs[ARM_REG_PC];
|
||||
|
||||
panicbug("IP: %p [%08x] %p\n", pc, pc[0], addr);
|
||||
if (pc == 0) return false;
|
||||
if (pc == 0)
|
||||
return false;
|
||||
|
||||
if (in_handler > 0)
|
||||
{
|
||||
|
@ -111,26 +112,28 @@ static bool handle_arm_instruction(unsigned long *pregs, uintptr addr)
|
|||
style = SIGNED;
|
||||
transfer_size = SIZE_BYTE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case 3: // Single Data Transfer (LDR, STR)
|
||||
case 2:
|
||||
case 3: // Single Data Transfer (LDR, STR)
|
||||
style = UNSIGNED;
|
||||
// Determine transfer size (B bit)
|
||||
if (((opcode >> 22) & 1) == 1)
|
||||
transfer_size = SIZE_BYTE;
|
||||
transfer_size = SIZE_BYTE;
|
||||
else
|
||||
transfer_size = SIZE_INT;
|
||||
transfer_size = SIZE_INT;
|
||||
break;
|
||||
default:
|
||||
default:
|
||||
panicbug("FIXME: support load/store mutliple?\n");
|
||||
in_handler--;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for invalid transfer size (SWP instruction?)
|
||||
if (transfer_size == SIZE_UNKNOWN) {
|
||||
panicbug("Invalid transfer size\n");
|
||||
return false;
|
||||
// Check for invalid transfer size (SWP instruction?)
|
||||
if (transfer_size == SIZE_UNKNOWN) {
|
||||
panicbug("Invalid transfer size\n");
|
||||
in_handler--;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Determine transfer type (L bit)
|
||||
|
@ -142,15 +145,15 @@ static bool handle_arm_instruction(unsigned long *pregs, uintptr addr)
|
|||
int rd = (opcode >> 12) & 0xf;
|
||||
#if DEBUG
|
||||
static const char * reg_names[] = {
|
||||
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
|
||||
"r8", "r9", "sl", "fp", "ip", "sp", "lr", "pc"
|
||||
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
|
||||
"r8", "r9", "sl", "fp", "ip", "sp", "lr", "pc"
|
||||
};
|
||||
panicbug("%s %s register %s\n",
|
||||
transfer_size == SIZE_BYTE ? "byte" :
|
||||
transfer_size == SIZE_WORD ? "word" :
|
||||
transfer_size == SIZE_INT ? "long" : "unknown",
|
||||
transfer_type == TYPE_LOAD ? "load to" : "store from",
|
||||
reg_names[rd]);
|
||||
transfer_size == SIZE_BYTE ? "byte" :
|
||||
transfer_size == SIZE_WORD ? "word" :
|
||||
transfer_size == SIZE_INT ? "long" : "unknown",
|
||||
transfer_type == TYPE_LOAD ? "load to" : "store from",
|
||||
reg_names[rd]);
|
||||
panicbug("\n");
|
||||
// for (int i = 0; i < 16; i++) {
|
||||
// panicbug("%s : %p", reg_names[i], pregs[i]);
|
||||
|
@ -201,6 +204,7 @@ static bool handle_arm_instruction(unsigned long *pregs, uintptr addr)
|
|||
|
||||
buserr:
|
||||
panicbug("Amiga bus error\n");
|
||||
in_handler--;
|
||||
|
||||
// BUS_ERROR(addr);
|
||||
return false;
|
||||
|
@ -219,6 +223,10 @@ void signal_segv(int signum, siginfo_t* info, void*ptr)
|
|||
ucontext_t *ucontext = (ucontext_t*)ptr;
|
||||
Dl_info dlinfo;
|
||||
|
||||
#ifdef TRACER
|
||||
trace_end();
|
||||
#endif
|
||||
|
||||
void **bp = 0;
|
||||
void *ip = 0;
|
||||
|
||||
|
@ -233,6 +241,7 @@ void signal_segv(int signum, siginfo_t* info, void*ptr)
|
|||
printf("Illegal Instruction!\n");
|
||||
else
|
||||
printf("Segmentation Fault!\n");
|
||||
|
||||
printf("info.si_signo = %d\n", signum);
|
||||
printf("info.si_errno = %d\n", info->si_errno);
|
||||
// printf("info.si_code = %d (%s)\n", info->si_code, si_codes[info->si_code]);
|
||||
|
@ -262,34 +271,58 @@ void signal_segv(int signum, siginfo_t* info, void*ptr)
|
|||
printf("Err Code = 0x%08x\n", ucontext->uc_mcontext.error_code);
|
||||
printf("Old Mask = 0x%08x\n", ucontext->uc_mcontext.oldmask);
|
||||
|
||||
dump_compiler((uae_u32*)ucontext->uc_mcontext.arm_pc);
|
||||
|
||||
// printf("Stack trace:\n");
|
||||
// ip = (void*)ucontext->uc_mcontext.arm_r10;
|
||||
// bp = (void**)ucontext->uc_mcontext.arm_r10;
|
||||
// while(bp && ip) {
|
||||
// if (!dladdr(ip, &dlinfo)) {
|
||||
// printf("IP out of range\n");
|
||||
// break;
|
||||
// }
|
||||
// const char *symname = dlinfo.dli_sname;
|
||||
// printf("% 2d: %p <%s + 0x%08x> (%s)\n", ++f, ip, symname,
|
||||
// (unsigned long)ip - (unsigned long)dlinfo.dli_saddr, dlinfo.dli_fname);
|
||||
// if(dlinfo.dli_sname && !strcmp(dlinfo.dli_sname, "main"))
|
||||
// break;
|
||||
// ip = bp[1];
|
||||
// bp = (void**)bp[0];
|
||||
// }
|
||||
//
|
||||
// printf("Stack trace (non-dedicated):\n");
|
||||
// char **strings;
|
||||
// void *bt[20];
|
||||
// int sz = backtrace(bt, 20);
|
||||
// strings = backtrace_symbols(bt, sz);
|
||||
// for(i = 0; i < sz; ++i)
|
||||
// printf("%s\n", strings[i]);
|
||||
// printf("End of stack trace.\n");
|
||||
// dump_compiler((uae_u32*)ucontext->uc_mcontext.arm_pc);
|
||||
|
||||
void *getaddr = (void *)ucontext->uc_mcontext.arm_lr;
|
||||
if(dladdr(getaddr, &dlinfo))
|
||||
printf("LR - 0x%08X: <%s> (%s)\n", getaddr, dlinfo.dli_sname, dlinfo.dli_fname);
|
||||
else
|
||||
printf("LR - 0x%08X: symbol not found\n", getaddr);
|
||||
|
||||
// printf("Stack trace:\n");
|
||||
|
||||
/*
|
||||
#define MAX_BACKTRACE 10
|
||||
|
||||
void *array[MAX_BACKTRACE];
|
||||
int size = backtrace(array, MAX_BACKTRACE);
|
||||
for(int i=0; i<size; ++i)
|
||||
{
|
||||
if (dladdr(array[i], &dlinfo)) {
|
||||
const char *symname = dlinfo.dli_sname;
|
||||
printf("%p <%s + 0x%08x> (%s)\n", array[i], symname,
|
||||
(unsigned long)array[i] - (unsigned long)dlinfo.dli_saddr, dlinfo.dli_fname);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
ip = (void*)ucontext->uc_mcontext.arm_r10;
|
||||
bp = (void**)ucontext->uc_mcontext.arm_r10;
|
||||
while(bp && ip) {
|
||||
if (!dladdr(ip, &dlinfo)) {
|
||||
printf("IP out of range\n");
|
||||
break;
|
||||
}
|
||||
const char *symname = dlinfo.dli_sname;
|
||||
printf("% 2d: %p <%s + 0x%08x> (%s)\n", ++f, ip, symname,
|
||||
(unsigned long)ip - (unsigned long)dlinfo.dli_saddr, dlinfo.dli_fname);
|
||||
if(dlinfo.dli_sname && !strcmp(dlinfo.dli_sname, "main"))
|
||||
break;
|
||||
ip = bp[1];
|
||||
bp = (void**)bp[0];
|
||||
}
|
||||
|
||||
printf("Stack trace (non-dedicated):\n");
|
||||
char **strings;
|
||||
void *bt[20];
|
||||
int sz = backtrace(bt, 20);
|
||||
strings = backtrace_symbols(bt, sz);
|
||||
for(i = 0; i < sz; ++i)
|
||||
printf("%s\n", strings[i]);
|
||||
printf("End of stack trace.\n");
|
||||
*/
|
||||
|
||||
SDL_Quit();
|
||||
abort();
|
||||
exit(1);
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
#define HAVE_GETMNTENT 1
|
||||
|
||||
/* Define if your struct stat has st_blocks. */
|
||||
#define HAVE_ST_BLOCKS
|
||||
/* #undef HAVE_ST_BLOCKS */
|
||||
|
||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||
#define HAVE_UTIME_NULL 1
|
||||
|
@ -446,6 +446,14 @@
|
|||
#define strcmpi(x,y) strcasecmp(x,y)
|
||||
#define stricmp(x,y) strcasecmp(x,y)
|
||||
|
||||
#define A_ZIP
|
||||
//#define A_RAR
|
||||
#define A_7Z
|
||||
#define A_LHA
|
||||
#define A_LZX
|
||||
#define A_DMS
|
||||
#define A_WRP
|
||||
|
||||
#ifndef MAX_PATH
|
||||
#define MAX_PATH 256
|
||||
#endif
|
||||
|
@ -466,6 +474,10 @@ typedef unsigned char boolean;
|
|||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
#ifndef USHORT
|
||||
#define USHORT unsigned short
|
||||
#endif
|
||||
|
||||
#define Sleep(x) usleep(x*1000)
|
||||
|
||||
/* Some defines to make it easier to compare files with WinUAE */
|
||||
|
@ -475,6 +487,7 @@ typedef unsigned char boolean;
|
|||
#define _tcsftime(w,x,y,z) strftime(w,x,y,z)
|
||||
#define _timezone timezone
|
||||
#define _daylight daylight
|
||||
#define _ftime(x) ftime(x)
|
||||
#define _tfopen(x,y) fopen(x,y)
|
||||
#define _ftelli64(x) ftello64(x)
|
||||
#define _fseeki64(x,y,z) fseeko64(x,y,z)
|
||||
|
@ -497,10 +510,15 @@ typedef unsigned char boolean;
|
|||
#define _totlower(x) tolower(x)
|
||||
#define _istupper(x) isupper(x)
|
||||
#define _istspace(x) isspace(x)
|
||||
#define _istdigit(x) isdigit(x)
|
||||
#define _tstoi(x) atoi(x)
|
||||
#define _tstol(x) atol(x)
|
||||
#define _tstof(x) atof(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)
|
||||
#define _strtoui64(x,y,z) strtoll(x,y,z)
|
||||
#define _istalnum(x) isalnum(x)
|
||||
#define _tcsspn(x,y) strspn(x,y)
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
* Copyright 1997 Bernd Schmidt
|
||||
*/
|
||||
|
||||
#include <SDL.h>
|
||||
|
||||
#define TARGET_NAME "pandora"
|
||||
|
||||
#define NO_MAIN_IN_MAIN_C
|
||||
|
@ -17,10 +19,14 @@ extern int emulating;
|
|||
extern int z3_start_adr;
|
||||
extern int rtg_start_adr;
|
||||
|
||||
extern int currVSyncRate;
|
||||
|
||||
void run_gui(void);
|
||||
void InGameMessage(const char *msg);
|
||||
void wait_for_vsync(void);
|
||||
|
||||
void saveAdfDir(void);
|
||||
bool SetVSyncRate(int hz);
|
||||
void setCpuSpeed(void);
|
||||
void resetCpuSpeed(void);
|
||||
void update_display(struct uae_prefs *);
|
||||
|
@ -51,3 +57,48 @@ void reinit_amiga(void);
|
|||
int count_HDs(struct uae_prefs *p);
|
||||
extern void gui_force_rtarea_hdchange(void);
|
||||
extern bool hardfile_testrdb (const TCHAR *filename);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void trace_begin (void);
|
||||
void trace_end (void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
STATIC_INLINE size_t uae_tcslcpy(TCHAR *dst, const TCHAR *src, size_t size)
|
||||
{
|
||||
if (size == 0) {
|
||||
return 0;
|
||||
}
|
||||
size_t src_len = _tcslen(src);
|
||||
size_t cpy_len = src_len;
|
||||
if (cpy_len >= size) {
|
||||
cpy_len = size - 1;
|
||||
}
|
||||
memcpy(dst, src, cpy_len * sizeof(TCHAR));
|
||||
dst[cpy_len] = _T('\0');
|
||||
return src_len;
|
||||
}
|
||||
|
||||
STATIC_INLINE size_t uae_strlcpy(char *dst, const char *src, size_t size)
|
||||
{
|
||||
if (size == 0) {
|
||||
return 0;
|
||||
}
|
||||
size_t src_len = strlen(src);
|
||||
size_t cpy_len = src_len;
|
||||
if (cpy_len >= size) {
|
||||
cpy_len = size - 1;
|
||||
}
|
||||
memcpy(dst, src, cpy_len);
|
||||
dst[cpy_len] = '\0';
|
||||
return src_len;
|
||||
}
|
||||
|
||||
STATIC_INLINE int max(int x, int y)
|
||||
{
|
||||
return x > y ? x : y;
|
||||
}
|
||||
|
|
|
@ -58,5 +58,5 @@ void jit_abort (const TCHAR *format,...)
|
|||
if (!happened)
|
||||
gui_message ("JIT: Serious error:\n%s", buffer);
|
||||
happened = 1;
|
||||
uae_reset (1);
|
||||
uae_reset (1, 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue