rcornwell / sims

Burroughs B5500, ICL1900, SEL32, IBM 360/370, IBM 7000 and DEC PDP10 KA10/KI10/KL10/KS10, PDP6 simulators for SimH
http://sky-visions.com
95 stars 20 forks source link

KA10: Various III fixes #255

Closed larsbrinkhoff closed 3 years ago

larsbrinkhoff commented 3 years ago

The lines drawn by the III display emulator seems to be slightly off. See screenshots below.

I recently added a line primitive to the display library. I suggest using this common code.

larsbrinkhoff commented 3 years ago

Actual:
Actual display

Expected: Expected display

larsbrinkhoff commented 3 years ago

I'm wondering about this.

2,10,18         Edge  overflow  flag.  This bit is set if the beam is
                  ever positioned off the screen by any means.
3,11,19         Wrap-around flag.  This bit is set if overflow occurs
                  in incremental vector mode.

You have the edge overflow flag set when a short or long vector goes outside ±512. Then you check the coordinates again in draw_point and draw_line and set the wrap-around flag if outside ±512.

But the documentation refers to the wrap-around flag only in connection with "incremental vector mode". I don't see any other mention of incremental vectors. Maybe they are the same as short vectors?

rcornwell commented 3 years ago

Incremental vectors should be any vector that is drawn in relative mode. If the position of the vector is set as an absolute position it does not need to check. If I remember correctly there is only 10 bits for position which means that a absolute vector can never overflow.

larsbrinkhoff commented 3 years ago

The X and Y fields are 11 bits including the sign bit. So that's a theoretical -1024...1023 range for absolute positioning. I don't see the ±512 range stated in the documentation, and empirically I found Y coordinates up to 522. @bgbaumgart's JavaScript III (i.e. https://www.saildart.org/j5/top.html?L3) seems to have a ±511 range and does not display the top wholine.

larsbrinkhoff commented 3 years ago

Here's another problem. Normally after the TAKE ME I'M YOURS! message the III encounters a 000000000000 instruction and halts. The monitor takes notice and restarts the display:

DBG(312321161)> III DETAIL: III: fetch 014335 000000000000             ;III: halt
DBG(312321400)> III DETAIL: III: pos -24 0 1 4 4000
DBG(312382007)> III CONI: III 432 CONI 3700400010 000636          ;monitor: hey, what's up
DBG(312382013)> III CONI: III 432 CONI 3700400010 126753
DBG(312382028)> III CONI: III 432 CONI 3700400010 126765
DBG(312382034)> III CONI: III 432 CONI 3700400010 126770
DBG(312382136)> III DATAIO: III 431 DATAO 30461000020             ;monitor: restart here
DBG(312382146)> III DETAIL: III: pos -24 0 1 4 0
DBG(312382146)> III CONO: III 433 CONO 741043 127001
DBG(312382156)> III DETAIL: III: pos -24 0 1 4 4000
DBG(312382156)> III DETAIL: III: fetch 770461 770465000074          ;III ok I'm on it

But for some reason if the III is running for a few minutes, I get this:

DBG(316534102)> III DETAIL: III: fetch 014335 000000000000         ;III: halt
DBG(316534103)> III DETAIL: III: pos -24 0 1 4 4000
DBG(316534375)> III CONI: III 432 CONI 3700400010 000636
DBG(316534381)> III CONI: III 432 CONI 3700400010 126753
DBG(316534404)> III CONI: III 432 CONI 3700400010 126765
DBG(316534410)> III CONI: III 432 CONI 3700400010 126770
DBG(316534501)> same as above (4 times)
DBG(316534512)> III DATAIO: III 431 DATAO 30461000020           ;monitor: restart here
DBG(316534527)> III CONO: III 433 CONO 741043 127001
DBG(316534529)> III DETAIL: III: pos -24 0 1 4 4000
DBG(316534529)> III DETAIL: III: fetch 014340 014336000020     ;III no way, I'll keep going
DBG(316534530)> III DETAIL: III: pos -24 0 1 4 4000
DBG(316534530)> III DETAIL: III: fetch 014336 014337000024
DBG(316534531)> III DETAIL: III: pos -24 0 1 4 4000
DBG(316534531)> III DETAIL: III: fetch 014340 014336000020      ;III stuck in a loop
DBG(316534532)> III DETAIL: III: pos -24 0 1 4 4000
DBG(316534532)> III DETAIL: III: fetch 014336 014337000024

The III is now spinning here in ALLDAT:

DPYAV1:         ASCID /TAKE ME I'M YOURS!/
                0
;*** RPH PATCH TO CATCH LOSING DP
                XWD .+1,24
                0
                XWD .-2,20

I see III DETAIL: III: pos -24 0 1 4 0 is missing between the DATAO and CONO. So I think what's going on here is that iii_svc wasn't called so the III jmp instruction wasn't executed, so the MAR wasn't updated.

larsbrinkhoff commented 3 years ago

With the call to iii_svc after DATAO, I had an III display working fine a few hours.