Use port commands for quickload to allow undo.

This commit is contained in:
Brandon Wright 2018-06-21 14:23:43 -05:00
parent ae814163dd
commit 95ee47ac06
2 changed files with 66 additions and 0 deletions

View File

@ -7,6 +7,7 @@
#include "gtk_s9x.h"
#include "gtk_config.h"
#include "gtk_control.h"
#include "gtk_file.h"
const BindingLink b_links[] =
{
@ -244,6 +245,11 @@ S9xHandlePortCommand (s9xcommand_t cmd, int16 data1, int16 data2)
if (quit_binding_down)
S9xExit ();
}
else if (cmd.port[0] >= PORT_QUICKLOAD0 && cmd.port[0] <= PORT_QUICKLOAD9)
{
S9xQuickLoadSlot (cmd.port[0] - PORT_QUICKLOAD0);
}
}
return;
@ -316,6 +322,56 @@ S9xGetPortCommandT (const char *name)
cmd.port[0] = PORT_REWIND;
}
else if (strstr (name, "QuickLoad000"))
{
cmd.port[0] = PORT_QUICKLOAD0;
}
else if (strstr (name, "QuickLoad001"))
{
cmd.port[0] = PORT_QUICKLOAD1;
}
else if (strstr (name, "QuickLoad002"))
{
cmd.port[0] = PORT_QUICKLOAD2;
}
else if (strstr (name, "QuickLoad003"))
{
cmd.port[0] = PORT_QUICKLOAD3;
}
else if (strstr (name, "QuickLoad004"))
{
cmd.port[0] = PORT_QUICKLOAD4;
}
else if (strstr (name, "QuickLoad005"))
{
cmd.port[0] = PORT_QUICKLOAD5;
}
else if (strstr (name, "QuickLoad006"))
{
cmd.port[0] = PORT_QUICKLOAD6;
}
else if (strstr (name, "QuickLoad007"))
{
cmd.port[0] = PORT_QUICKLOAD7;
}
else if (strstr (name, "QuickLoad008"))
{
cmd.port[0] = PORT_QUICKLOAD8;
}
else if (strstr (name, "QuickLoad009"))
{
cmd.port[0] = PORT_QUICKLOAD9;
}
else
{
cmd = S9xGetCommandT (name);

View File

@ -27,6 +27,16 @@
#define PORT_QUIT 6
#define PORT_SWAP_CONTROLLERS 7
#define PORT_REWIND 8
#define PORT_QUICKLOAD0 9
#define PORT_QUICKLOAD1 10
#define PORT_QUICKLOAD2 11
#define PORT_QUICKLOAD3 12
#define PORT_QUICKLOAD4 13
#define PORT_QUICKLOAD5 14
#define PORT_QUICKLOAD6 15
#define PORT_QUICKLOAD7 16
#define PORT_QUICKLOAD8 17
#define PORT_QUICKLOAD9 18
typedef struct BindingLink
{