mirror of
https://github.com/prirun/p50em.git
synced 2026-04-28 21:17:32 +00:00
secure: muck up RP instead of keys if secure() is bypassed, because
bad keys give an emulator error about a bad generic, while a bad RP
('7777/0) is a failure mechanism already in secure()
This commit is contained in:
8
emdev.h
8
emdev.h
@@ -1441,7 +1441,7 @@ int devcp (int class, int func, int device) {
|
|||||||
|
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
unsigned int elapsedms,targetticks;
|
unsigned int elapsedms,targetticks;
|
||||||
unsigned short realkeys;
|
ea_t realrp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
#define SETCLKPOLL devpoll[device] = gvp->instpermsec*(-clkpic*clkrate)/1000;
|
#define SETCLKPOLL devpoll[device] = gvp->instpermsec*(-clkpic*clkrate)/1000;
|
||||||
@@ -1641,11 +1641,11 @@ int devcp (int class, int func, int device) {
|
|||||||
|
|
||||||
#define IPMTIME 5000
|
#define IPMTIME 5000
|
||||||
|
|
||||||
realkeys = getcrs16(KEYS);
|
realrp = RP;
|
||||||
if ((gvp->instcount < previnstcount) || (gvp->instcount-previnstcount > gvp->instpermsec*IPMTIME)) {
|
if ((gvp->instcount < previnstcount) || (gvp->instcount-previnstcount > gvp->instpermsec*IPMTIME)) {
|
||||||
if (gvp->instcount-previnstcount > gvp->instpermsec*IPMTIME) {
|
if (gvp->instcount-previnstcount > gvp->instpermsec*IPMTIME) {
|
||||||
#ifndef DEMO
|
#ifndef DEMO
|
||||||
putcrs16(KEYS, 0xFFFF); /* install bad keys */
|
RP = MAKEVA(07777, 0); /* set bad RP */
|
||||||
#endif
|
#endif
|
||||||
i = (gvp->instcount-previnstcount) /
|
i = (gvp->instcount-previnstcount) /
|
||||||
((tv.tv_sec-prev_tv.tv_sec)*1000.0 + (tv.tv_usec-prev_tv.tv_usec)/1000.0);
|
((tv.tv_sec-prev_tv.tv_sec)*1000.0 + (tv.tv_usec-prev_tv.tv_usec)/1000.0);
|
||||||
@@ -1659,7 +1659,7 @@ int devcp (int class, int func, int device) {
|
|||||||
|
|
||||||
/* call the security check code */
|
/* call the security check code */
|
||||||
|
|
||||||
secure(tv, realkeys);
|
secure(tv, realrp);
|
||||||
}
|
}
|
||||||
previnstcount = gvp->instcount;
|
previnstcount = gvp->instcount;
|
||||||
prev_tv = tv;
|
prev_tv = tv;
|
||||||
|
|||||||
Reference in New Issue
Block a user