Merge remote-tracking branch 'upstream/master' into creativision
This commit is contained in:
@@ -161,7 +161,7 @@ void CollAppend (Collection* C, void* Item)
|
||||
{
|
||||
/* Insert the item at the end of the current list */
|
||||
CollInsert (C, Item, C->Count);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -341,22 +341,23 @@ void CollReplaceExpand (Collection* C, void* Item, unsigned Index)
|
||||
|
||||
void CollMove (Collection* C, unsigned OldIndex, unsigned NewIndex)
|
||||
/* Move an item from one position in the collection to another. OldIndex
|
||||
** is the current position of the item, NewIndex is the new index after
|
||||
** is the current position of the item, NewIndex is the new index before
|
||||
** the function has done it's work. Existing entries with indices NewIndex
|
||||
** and up are moved one position upwards.
|
||||
** and up might be moved one position upwards.
|
||||
*/
|
||||
{
|
||||
/* Get the item and remove it from the collection */
|
||||
/* Get the item; and, remove it from the collection */
|
||||
void* Item = CollAt (C, OldIndex);
|
||||
|
||||
CollDelete (C, OldIndex);
|
||||
|
||||
/* Correct NewIndex if needed */
|
||||
if (NewIndex >= OldIndex) {
|
||||
if (NewIndex > OldIndex) {
|
||||
/* Position has changed with removal */
|
||||
--NewIndex;
|
||||
}
|
||||
|
||||
/* Now insert it at the new position */
|
||||
/* Now, insert it at the new position */
|
||||
CollInsert (C, Item, NewIndex);
|
||||
}
|
||||
|
||||
|
||||
@@ -268,9 +268,9 @@ void CollReplaceExpand (Collection* C, void* Item, unsigned Index);
|
||||
|
||||
void CollMove (Collection* C, unsigned OldIndex, unsigned NewIndex);
|
||||
/* Move an item from one position in the collection to another. OldIndex
|
||||
** is the current position of the item, NewIndex is the new index after
|
||||
** is the current position of the item, NewIndex is the new index before
|
||||
** the function has done it's work. Existing entries with indices NewIndex
|
||||
** and up are moved one position upwards.
|
||||
** and up might be moved one position upwards.
|
||||
*/
|
||||
|
||||
void CollMoveMultiple (Collection* C, unsigned Start, unsigned Count, unsigned Target);
|
||||
|
||||
@@ -61,6 +61,7 @@ const char* CPUNames[CPU_COUNT] = {
|
||||
"sweet16",
|
||||
"huc6280",
|
||||
"m740",
|
||||
"4510",
|
||||
};
|
||||
|
||||
/* Tables with CPU instruction sets */
|
||||
@@ -74,6 +75,7 @@ const unsigned CPUIsets[CPU_COUNT] = {
|
||||
CPU_ISET_SWEET16,
|
||||
CPU_ISET_6502 | CPU_ISET_65SC02 | CPU_ISET_65C02 | CPU_ISET_HUC6280,
|
||||
CPU_ISET_6502 | CPU_ISET_M740,
|
||||
CPU_ISET_6502 | CPU_ISET_65SC02 | CPU_ISET_65C02 | CPU_ISET_4510,
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ typedef enum {
|
||||
CPU_SWEET16,
|
||||
CPU_HUC6280, /* Used in PC engine */
|
||||
CPU_M740, /* Mitsubishi 740 series MCUs */
|
||||
CPU_4510, /* CPU of C65 */
|
||||
CPU_COUNT /* Number of different CPUs */
|
||||
} cpu_t;
|
||||
|
||||
@@ -70,6 +71,7 @@ enum {
|
||||
CPU_ISET_SWEET16 = 1 << CPU_SWEET16,
|
||||
CPU_ISET_HUC6280 = 1 << CPU_HUC6280,
|
||||
CPU_ISET_M740 = 1 << CPU_M740,
|
||||
CPU_ISET_4510 = 1 << CPU_4510,
|
||||
};
|
||||
|
||||
/* CPU used */
|
||||
|
||||
@@ -238,6 +238,18 @@ void PopSearchPath (SearchPaths* P)
|
||||
|
||||
|
||||
|
||||
char* GetSearchPath (SearchPaths* P, unsigned Index)
|
||||
/* Return the search path at the given index, if the index is valid, return an
|
||||
** empty string otherwise.
|
||||
*/
|
||||
{
|
||||
if (Index < CollCount (P))
|
||||
return CollAtUnchecked (P, Index);
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
char* SearchFile (const SearchPaths* P, const char* File)
|
||||
/* Search for a file in a list of directories. Return a pointer to a malloced
|
||||
** area that contains the complete path, if found, return 0 otherwise.
|
||||
|
||||
@@ -94,6 +94,11 @@ int PushSearchPath (SearchPaths* P, const char* NewPath);
|
||||
void PopSearchPath (SearchPaths* P);
|
||||
/* Remove a search path from the head of an existing search path list */
|
||||
|
||||
char* GetSearchPath (SearchPaths* P, unsigned Index);
|
||||
/* Return the search path at the given index, if the index is valid, return an
|
||||
** empty string otherwise.
|
||||
*/
|
||||
|
||||
char* SearchFile (const SearchPaths* P, const char* File);
|
||||
/* Search for a file in a list of directories. Return a pointer to a malloced
|
||||
** area that contains the complete path, if found, return 0 otherwise.
|
||||
|
||||
@@ -139,12 +139,13 @@ struct TargetEntry {
|
||||
};
|
||||
|
||||
/* Table that maps target names to ids. Sorted alphabetically for bsearch.
|
||||
** Allows mupltiple entries for one target id (target name aliases).
|
||||
** Allows multiple entries for one target id (target name aliases).
|
||||
*/
|
||||
static const TargetEntry TargetMap[] = {
|
||||
{ "apple2", TGT_APPLE2 },
|
||||
{ "apple2enh", TGT_APPLE2ENH },
|
||||
{ "atari", TGT_ATARI },
|
||||
{ "atari2600", TGT_ATARI2600 },
|
||||
{ "atari5200", TGT_ATARI5200 },
|
||||
{ "atarixl", TGT_ATARIXL },
|
||||
{ "atmos", TGT_ATMOS },
|
||||
@@ -152,6 +153,7 @@ static const TargetEntry TargetMap[] = {
|
||||
{ "c128", TGT_C128 },
|
||||
{ "c16", TGT_C16 },
|
||||
{ "c64", TGT_C64 },
|
||||
{ "c65", TGT_C65 },
|
||||
{ "cbm510", TGT_CBM510 },
|
||||
{ "cbm610", TGT_CBM610 },
|
||||
{ "creativision", TGT_CREATIVISION},
|
||||
@@ -171,7 +173,6 @@ static const TargetEntry TargetMap[] = {
|
||||
{ "sim6502", TGT_SIM6502 },
|
||||
{ "sim65c02", TGT_SIM65C02 },
|
||||
{ "supervision", TGT_SUPERVISION },
|
||||
{ "vc20", TGT_VIC20 },
|
||||
{ "vic20", TGT_VIC20 },
|
||||
};
|
||||
#define MAP_ENTRY_COUNT (sizeof (TargetMap) / sizeof (TargetMap[0]))
|
||||
@@ -182,6 +183,7 @@ static const TargetProperties PropertyTable[TGT_COUNT] = {
|
||||
{ "none", CPU_6502, BINFMT_BINARY, CTNone },
|
||||
{ "module", CPU_6502, BINFMT_O65, CTNone },
|
||||
{ "atari", CPU_6502, BINFMT_BINARY, CTAtari },
|
||||
{ "atari2600", CPU_6502, BINFMT_BINARY, CTNone },
|
||||
{ "atari5200", CPU_6502, BINFMT_BINARY, CTAtari },
|
||||
{ "atarixl", CPU_6502, BINFMT_BINARY, CTAtari },
|
||||
{ "vic20", CPU_6502, BINFMT_BINARY, CTPET },
|
||||
@@ -201,13 +203,16 @@ static const TargetProperties PropertyTable[TGT_COUNT] = {
|
||||
{ "geos-apple", CPU_65C02, BINFMT_BINARY, CTNone },
|
||||
{ "geos-cbm", CPU_6502, BINFMT_BINARY, CTNone },
|
||||
{ "lunix", CPU_6502, BINFMT_O65, CTNone },
|
||||
{ "lynx", CPU_65C02, BINFMT_BINARY, CTNone },
|
||||
{ "atmos", CPU_6502, BINFMT_BINARY, CTNone },
|
||||
{ "nes", CPU_6502, BINFMT_BINARY, CTNone },
|
||||
{ "supervision", CPU_65SC02, BINFMT_BINARY, CTNone },
|
||||
{ "lynx", CPU_65SC02, BINFMT_BINARY, CTNone },
|
||||
{ "sim6502", CPU_6502, BINFMT_BINARY, CTNone },
|
||||
{ "sim65c02", CPU_65C02, BINFMT_BINARY, CTNone },
|
||||
{ "pce", CPU_HUC6280, BINFMT_BINARY, CTNone },
|
||||
{ "gamate", CPU_6502, BINFMT_BINARY, CTNone },
|
||||
{ "supervision", CPU_65SC02, BINFMT_BINARY, CTNone },
|
||||
{ "c65", CPU_4510, BINFMT_BINARY, CTPET },
|
||||
};
|
||||
|
||||
/* Target system */
|
||||
|
||||
@@ -55,6 +55,7 @@ typedef enum {
|
||||
TGT_NONE,
|
||||
TGT_MODULE,
|
||||
TGT_ATARI,
|
||||
TGT_ATARI2600,
|
||||
TGT_ATARI5200,
|
||||
TGT_ATARIXL,
|
||||
TGT_VIC20,
|
||||
@@ -81,6 +82,7 @@ typedef enum {
|
||||
TGT_PCENGINE,
|
||||
TGT_GAMATE,
|
||||
TGT_SUPERVISION,
|
||||
TGT_C65,
|
||||
TGT_COUNT /* Number of target systems */
|
||||
} target_t;
|
||||
|
||||
|
||||
@@ -124,6 +124,6 @@ void TgtTranslateStrBuf (StrBuf* Buf)
|
||||
void TgtTranslateSet (unsigned Index, unsigned char C)
|
||||
/* Set the translation code for the given character */
|
||||
{
|
||||
CHECK (Index > 0 && Index < sizeof (Tab));
|
||||
CHECK (Index < sizeof (Tab));
|
||||
Tab[Index] = C;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user