Skip to content

Commit 6ded9f4

Browse files
committed
fixed carry flags
1 parent 5c7747d commit 6ded9f4

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

emu/apr.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ void
508508
ar_cry_in(Apr *apr, word c)
509509
{
510510
word a;
511-
a = (apr->n.ar & ~F0) + (c & ~F0);
511+
a = (apr->n.ar & ~F0) + c;
512512
apr->n.ar += c;
513513
if(apr->n.ar & FCRY) apr->ar_cry0 = 1;
514514
if(a & F0) apr->ar_cry1 = 1;
@@ -2347,7 +2347,8 @@ defpulse(ar_cry_comp)
23472347
{
23482348
if(apr->ar_com_cont){
23492349
AR_COM; // 6-8
2350-
pulse(apr, &art3, 100); // 6-9
2350+
if(!apr->sw_art3_maint)
2351+
pulse(apr, &art3, 100); // 6-9
23512352
}
23522353
}
23532354

@@ -2361,7 +2362,7 @@ defpulse_(ar_pm1_t1)
23612362
// but I don't quite know how this works,
23622363
// so we just use 100ns as the average value
23632364
// given in "The Evolution of the DECsystem-10"
2364-
if(!apr->ar_com_cont)
2365+
if(!apr->ar_com_cont && !apr->sw_art3_maint)
23652366
pulse(apr, &art3, 100); // 6-9
23662367
pulse(apr, &ar_cry_comp, 100); // 6-9
23672368
}
@@ -2383,7 +2384,7 @@ defpulse(ar_ast2)
23832384
{
23842385
ar_cry_in(apr, (~apr->c.ar & apr->c.mb) << 1); // 6-8
23852386
// see comment in ar_pm1_t1
2386-
if(!apr->ar_com_cont)
2387+
if(!apr->ar_com_cont && !apr->sw_art3_maint)
23872388
pulse(apr, &art3, 50); // 6-9
23882389
pulse(apr, &ar_cry_comp, 50); // 6-9
23892390
}
@@ -3372,6 +3373,8 @@ defpulse(kt2)
33723373
if(KEY_EXECUTE_DP_DPNXT)
33733374
apr->n.ar |= apr->data; // 5-2
33743375
pulse(apr, &kt3, 200); // 5-2
3376+
if(apr->sw_art3_maint)
3377+
pulse(apr, &art3, 0); // 6-9
33753378
}
33763379

33773380
defpulse_(kt1)
@@ -3482,18 +3485,15 @@ aprcycle(void *p)
34823485

34833486
int foo;
34843487
if(channbrecv(apr->clkchan, &foo) == 1){
3485-
/* This isn't correct but how else can you single step? */
3486-
if(apr->run){
34873488
apr->cpa_clock_flag = 1;
34883489
recalc_cpa_req(apr);
3489-
}
34903490
}
3491-
/*
3491+
/* This isn't correct but how else can you single step? */
3492+
// just force it OFF
34923493
if(!apr->run){
34933494
apr->cpa_clock_flag = 0;
34943495
recalc_cpa_req(apr);
34953496
}
3496-
*/
34973497

34983498
if(channbrecv(apr->rptchan, &foo) == 1){
34993499
if(KEY_MANUAL)

0 commit comments

Comments
 (0)