mirror of
https://github.com/prirun/p50em.git
synced 2026-04-10 06:26:35 +00:00
-cpuid takes model numbers too, STPM stores emulator version
This commit is contained in:
16
em.c
16
em.c
@@ -4422,6 +4422,7 @@ main (int argc, char **argv) {
|
||||
struct timezone tz;
|
||||
|
||||
printf("[Prime Emulator ver %s %s]\n", REV, __DATE__);
|
||||
printf("[Copyright (C) 2005-2011 Prirun LLC]\n");
|
||||
if (argc > 1 && (strcmp(argv[1],"--version") == 0)) {
|
||||
exit(0);
|
||||
}
|
||||
@@ -4605,8 +4606,17 @@ main (int argc, char **argv) {
|
||||
sscanf(argv[++i],"%d", &templ);
|
||||
if (0 <= templ && templ <= 44)
|
||||
cpuid = templ;
|
||||
else
|
||||
fatal("-cpuid arg range is 0 to 44\n");
|
||||
else {
|
||||
cpuid = 9999;
|
||||
for (j=0; cputab[j].cpumodel; j++) {
|
||||
if (templ == cputab[j].cpumodel) {
|
||||
cpuid = cputab[j].cputype;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (cpuid > 44)
|
||||
fatal("-cpuid arg range is 0 to 44 or model name: 400, 550, 9950, etc\n");
|
||||
}
|
||||
} else
|
||||
fatal("-cpuid needs an argument\n");
|
||||
|
||||
@@ -6187,6 +6197,8 @@ d_stpm: /* 000024 */
|
||||
for (i=0; i<8; i++)
|
||||
put16(0, ea+i);
|
||||
put16(cpuid, ea+1);
|
||||
if (sscanf(REV, "%d", &templ))
|
||||
put16((short)templ, ea+3);
|
||||
goto fetch;
|
||||
}
|
||||
|
||||
|
||||
56
regs.h
56
regs.h
@@ -108,6 +108,62 @@
|
||||
#define OWNER32 (OWNERH/2)
|
||||
#define TIMER32 (TIMERH/2)
|
||||
|
||||
/* table of CPU names & types */
|
||||
|
||||
static struct {
|
||||
short cputype;
|
||||
short cpumodel;
|
||||
} cputab[45] = { \
|
||||
{1, 400},
|
||||
{3, 350},
|
||||
{4, 450},
|
||||
{5, 750},
|
||||
{7, 150},
|
||||
{7, 250},
|
||||
{8, 850},
|
||||
{9, 550},
|
||||
{10, 650},
|
||||
{11, 2250},
|
||||
{15, 9950},
|
||||
{16, 9650},
|
||||
{17, 2550},
|
||||
{19, 9750},
|
||||
{21, 2350},
|
||||
{22, 2655},
|
||||
{23, 9655},
|
||||
{24, 9955},
|
||||
{25, 2450},
|
||||
{26, 4050},
|
||||
{27, 4150},
|
||||
{28, 6350},
|
||||
{29, 6550},
|
||||
{31, 2755},
|
||||
{32, 2455},
|
||||
{33, 5310},
|
||||
{34, 9755},
|
||||
{35, 2850},
|
||||
{36, 2950},
|
||||
{37, 5330},
|
||||
{38, 4450},
|
||||
{39, 5370},
|
||||
{40, 6650},
|
||||
{41, 6450},
|
||||
{42, 6150},
|
||||
{43, 5320},
|
||||
{44, 5340},
|
||||
#if 0
|
||||
{45, 5510),
|
||||
{46, 5520),
|
||||
{47, 5530),
|
||||
{48, 5540),
|
||||
{49, 5550),
|
||||
{50, 5560),
|
||||
{51, 5570),
|
||||
{52, 5580),
|
||||
{0, 0},
|
||||
#endif
|
||||
};
|
||||
|
||||
/* this is the number of user register sets for this cpuid */
|
||||
|
||||
static short regsets[] = { \
|
||||
|
||||
Reference in New Issue
Block a user