-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Tek4404 wip #14519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Tek4404 wip #14519
Conversation
src/devices/machine/ncr5385.h
Outdated
| virtual void device_reset() override ATTR_COLD; | ||
|
|
||
| // ncsci_device implementation | ||
| virtual attotime scsi_data_byte_period(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How this is not overriding the base method and manages to compile anyway? Is this ncr5385_device supposed to be a nscsi_full_device, and this function essentially do nothing here?
src/emu/diserial.cpp
Outdated
| #ifndef USE_TEK4404_CHANGES | ||
| receive_register_reset(); | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of hacking diserial, do this:
index dbefa1507be..e19716e8661 100644
--- a/src/devices/machine/mc68681.cpp
+++ b/src/devices/machine/mc68681.cpp
@@ -1641,6 +1641,7 @@ void duart_channel::write_chan_reg(int reg, uint8_t data)
void duart_channel::write_MR(uint8_t data)
{
+ bool const frame_change = (MR_ptr == 0) ? ((MR1 ^ data) & 0x1f) : ((MR2 ^ data) & 0x0f);
if (MR_ptr == 0)
{
MR1 = data;
@@ -1650,7 +1651,8 @@ void duart_channel::write_MR(uint8_t data)
{
MR2 = data;
}
- recalc_framing();
+ if (frame_change)
+ recalc_framing();
update_interrupts();
}```There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the above changes I get:
Tektronix 4404
Self Test Error-Keyboard Failure or Not. Attached [02, 0002]
Fatal Error - Cannot Initialize Keyboard_
Any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only other place that resets the receive register is when changing the receive baud rate, so it must be that; do the same thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In duart_channel::write_chan_reg(), right? (Obv, I have not a clue how this chip works.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given we check if any params have changed and early out, I just added a test if its also already syncronized which works but as I said before, I have no idea how this chip works so asking me to make changes like this is probably a bad idea.
// no params have changed and already syncronised
if (m_rcv_flags & RECEIVE_REGISTER_SYNCHRONISED)
return;
receive_register_reset();
| // copied from stkbd.cpp | ||
| int tek440x_state::mouseupdate() | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a generic quadrature mouse that needs its own device?
pmackinlay
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ACB-4000 device which acts as a SCSI target used in this system no doubt accounts for the delays assumed by the host software. The ACB-4000 is documented as only sustaining up to 1.3MBps for SCSI data transfers (rather than the maximum 5MBps for a SCSI-I device).
You can simulate such a slow hard disk by overriding scsi_data_byte_period() in a SCSI target and supplying a suitable value. As an experiment, you can modify src/devices/nscsi/hd.h by adding the following:
virtual attotime scsi_data_byte_period() override { return attotime::from_nsec(770); }
This will cause the SCSI ACK signal for the default SCSI hard disk target to be delayed, producing a data rate of ~1.3MBps, and appears to eliminate reported SCSI issues.
Moving forward, adding a new SCSI device which represents a "slow" hard disk is the right interim measure until the ACB-4000 is emulated.
src/emu/diserial.cpp
Outdated
| #ifndef USE_TEK4404_CHANGES | ||
| receive_register_reset(); | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of hacking diserial, do this:
index dbefa1507be..e19716e8661 100644
--- a/src/devices/machine/mc68681.cpp
+++ b/src/devices/machine/mc68681.cpp
@@ -1641,6 +1641,7 @@ void duart_channel::write_chan_reg(int reg, uint8_t data)
void duart_channel::write_MR(uint8_t data)
{
+ bool const frame_change = (MR_ptr == 0) ? ((MR1 ^ data) & 0x1f) : ((MR2 ^ data) & 0x0f);
if (MR_ptr == 0)
{
MR1 = data;
@@ -1650,7 +1651,8 @@ void duart_channel::write_MR(uint8_t data)
{
MR2 = data;
}
- recalc_framing();
+ if (frame_change)
+ recalc_framing();
update_interrupts();
}```
src/devices/machine/ncr5385.cpp
Outdated
|
|
||
| if (m_cnt == 0) | ||
| { | ||
| #ifdef USE_TEK4404_CHANGES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested simulating a slow hard disk instead of this change, and it can successfully complete the "diskrepair" and reach a login prompt. I don't have the knowledge of this system to test further, but I believe this change is wrong and the delay occur in the target, not this device.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I've had a few false dawns at being able to just boot. Running a script that does "cp /system.boot /tmp" 20-30 times seems to always flush out timing issues.
d2baa16 to
a67c52e
Compare
OK tried this and my disk thrashing script succeeds. Hurrah. Thank you. BUT, XFI_ACK delay version takes 1m12s to run the copying script, the hd.hpp changes that to 5m25s.!! 5x slower, I'm guessing I can tweak that 770ns delay? |
Ah no, making the delay less than 770ns hangs the machine on boot... |
|
Trying to speed up something which was failing because it was too fast seems illogical. A 5x slowdown doesn't seem out of order since you're talking about dropping back to ~1.3MB/s from whatever it was getting without limits before; how long does the script take on hardware? The 770 wasn't random; it was chosen specifically to represent the documented throughput of the ACB-4000. Again you seem to be ignoring that MAME is fundamentally about accuracy; usability of the end result is a nice side effect. If you want it to run at unrealistic speed, try unthrottling it or make local hacks, but don't expect those to make it upstream. Another option would be to fix the broken software, which might even allow your hardware to use a modern/fast storage device. |
I will test on tek4404 h/w; I'm not in the country right now |
|
This PR now builds and works without need for magic #ifdef for Tek4404 and doesn't change ncr5385. |
- some comments in trying to understand how to attach a target scsi device
…sent in m_videocntl
- MAP_SYS_WR_ENABLE eppears to really mean read/write enable - page table needs to be accessible without MAP_VM_ENABLE
- need to find a way of faking a connection so we can get debug output
…lftest mamedev#20 before failing
- mouse position (gray codes?) seems borked
…lftest now passes but not sure this is right solution - Timer selftest fails; need a way of resetting interrupt when writing to 0x1xx
- hook writes to m_timer 0x1xx and clear IRQ1
- helped by Lord Nightmare; Interval Timer now passes
- added 8255 mapped to 0x7b2000 to handle Centronics interface; not working
…ing something else
…ide the main CRT box.
…IRQ_6 line when VIntEn==0 - First thing in Vblank processing is reset VIntEn which is the ack for the IRQ
- document that patching the tek4404 IRQ3 handler wholly fixes the timing issue for MAME! - remove custom scsi_data_byte_period - make logging of XFI_OUT states clearer - log all set bits in m_inst_status
…or not? - removed debug logging of kernel calls - more logging
…g it and ignore it
…STER_SYNCHRONISED already
08ed6b7 to
f5f010f
Compare
Oh and just so to add some numbers to this: My ACK hack is a transfer rate of 64k Bytes/sec That does seem very very slow. |
which one these is more accurate to the real hardware? |
REQUIRES
-DUSE_TEK4404_CHANGESwhen compiling in order to work since it requires delays in ncr5385 and backing out resetting the serial interface in diserial.cppEDIT: no longer needs special #ifdef to build and run successfully.