|
Joined: Jun 2001
Posts: 536 Likes: 42
Senior Member
|
Senior Member
Joined: Jun 2001
Posts: 536 Likes: 42 |
It's figured out already :-)
|
|
|
|
Joined: Dec 2017
Posts: 78 Likes: 5
Member
|
Member
Joined: Dec 2017
Posts: 78 Likes: 5 |
Good morning! I have some more issues with the keyboard. All the space for the keys has been used, but even so, a lot of keys are missing. I have seen a lot of invalid scan codes and even combinations trigggered by a single key stroke. Maybe my keyboard is different from the one pictured here in this thread, it could be that my unit has an entirely different matrix... as the computer always receives the scancodes it really does not care about the matrix. There's also the possibility that there could be more columns, but so far I have been unable to find them. It may also be that my logic for the keyboard could be entirely wrong. I have made tests on that machine that could give goosebumps to other owners of the system. But our red line lies within the keyboard. Fortunately, with the help and contributions of @Golden Child and another Datamaster owner I have had all the information required to reach the stage I'm at with the keyboard. There are other things to do in this emulation that only me or any other Datamaster owner can do: - Paging the character ROM.
- Setting the DMA page.
- Build the Datamaster bus (there are undocumented signals).
- Build the Datamaster keyboard bus (for internationalization -> our small community has people around the world: USA, Canada, Spain, Andorra, France, Belgium, Italy, Deutschland, Romania, and maybe others still not contacted); it also has undocumented stuff...
- Dump the FDC microcontroller and study the card.
- Document the drivers.
- Add remaining jumpers
- Dump and document ROMs
- Add the printer port
There are issues that could be resolved by someone more experienced than me in MAME: - Fix the uninstalled ROMs errors (sometimes in the space of uninstalled ROMs the program finds the signature for a present ROM and checks it, but as there is only garbage it does not pass the test). This happens at 10, 11, 1A-29.
- Fix a crash at test 19. Cause is unknown.
- Replace parts of my poorly produced code with something more worthy of MAME standards. While having been programming for some years, I am still a novice in C/C++ and MAME.
And finally we have the keyboard, whose communication has been found but the expertise of someone with knowledge of MCS-48 may be the only way to make it viable. I have also some doubts regarding the definitions of dip switches. So far I have made them as in the hardware, but would it be better to do it with only the valid options (for example in the language switches)? With the virtual machine in the current state, I will center myself on tasks of the first group. Basically because only owners of a unit can do them. At the same time, I would like to consolidate the learnt knowledge by building a hardware clone of the computer. I would be very grateful if someone could help me with stability/quality issues and if someone with experience with such microcontroller could join, please. I am not asking people to write it for me, as you have seen I have done it by myself (with lots of help, of course). From March on I will have less time to dedicate to the emulator, and from September on, I will not have regular access to the System/23 computer except during special occasions. My goal would be to deliver a working machine before I lose access to the hardware, but I cannot do it alone. Due to the nature of the hardware, reverse-engineering is a more costly process than usual. Please, could I count with some collaborators? I hope I am not asking too much, and if I do I ask your forgiveness. In any case, wether if you accept or refuse, thank you very much. If I had been alone this wouldn't have progressed as much as it has done. Regards
|
|
|
|
Joined: Feb 2008
Posts: 175 Likes: 15
Senior Member
|
Senior Member
Joined: Feb 2008
Posts: 175 Likes: 15 |
You can submit the current work-in-progress and get it into MAME (or send it to someone who can make it acceptable for inclusion) then it will be more accessible to others who may step up and try to fix things. Of course if you have not finished then finish your work first. But do get it into MAME at some point even if not fully working otherwise your work will have been for nothing.
|
2 members like this:
jlopezm, robcfg |
|
|
|
Joined: Feb 2014
Posts: 1,156 Likes: 209
Very Senior Member
|
Very Senior Member
Joined: Feb 2014
Posts: 1,156 Likes: 209 |
Doing some experiments,
I wonder if that the bit reversal in read_keyboard may be unnecessary. In the documents, it says that the bits are reversed coming out of the keyboard controller bus, but when the I8255 reads them on port A maybe it is hooked up in reverse too, so the net effect is that the bits aren't reversed when they're actually read.
If we take out that reversal bitswap, the matrix looks more like what we would expect to see from the table in rom at 0x300.
Maybe. (or maybe I need more sleep haha)
|
1 member likes this:
jlopezm |
|
|
|
Joined: Dec 2017
Posts: 78 Likes: 5
Member
|
Member
Joined: Dec 2017
Posts: 78 Likes: 5 |
For the time being I am testing it without the reversal and the matrix seems correct, at least for the unshifted characters. When shift is pressed, I get the wrong character on screen again; however that's something I have to investigate later on. For the Pull Request, there would be the reversal in the keyboard and also in the computer to compensate and also to be respecting the pinout in the service manual of the computer. Thank you!
|
|
|
|
Joined: Feb 2014
Posts: 1,156 Likes: 209
Very Senior Member
|
Very Senior Member
Joined: Feb 2014
Posts: 1,156 Likes: 209 |
Here's a fragment of code that helped me experiment with the key matrix. You press 0-9,a to select the matrix drive line, and keypad0 to 7 to select the sense line. Pressing the sense line presses the key for that combination of matrix drive line and sense line.
#define PRESSED(x) (machine().input().code_pressed(machine().input().code_from_token(x)))
u8 keydown = 0;
const char * matrix_table[11] =
{
"KEYCODE_0",
"KEYCODE_1",
"KEYCODE_2",
"KEYCODE_3",
"KEYCODE_4",
"KEYCODE_5",
"KEYCODE_6",
"KEYCODE_7",
"KEYCODE_8",
"KEYCODE_9",
"KEYCODE_A"
};
for (int i=0;i<11;i++)
if (PRESSED(matrix_table[i]))
m_c = i; // set the column
const char * sense_table[8] =
{
"KEYCODE_0PAD",
"KEYCODE_1PAD",
"KEYCODE_2PAD",
"KEYCODE_3PAD",
"KEYCODE_4PAD",
"KEYCODE_5PAD",
"KEYCODE_6PAD",
"KEYCODE_7PAD"
};
for (int i=0;i<8;i++)
if (PRESSED(sense_table[i]))
{
m_r = i; // set the row
keydown = 1;
}
u8 retval = (keydown ? ((m_c == translate_columns() && m_r == m_select) ? 0 : 1) : 1);
m_counter = 0;
m_select = 7;
return retval;
another approach is to use an ioport:
u8 keydown = 0;
for (int i=0;i<11;i++)
if (BIT(ioport("TESTMATRIX")->read(),i))
m_c = i; // column
for (int i=0;i<8;i++)
if (BIT(ioport("TESTSENSE")->read(),i))
{
m_r = i; // row
keydown = 1;
}
u8 retval = (keydown ? ((m_c == translate_columns() && m_r == m_select) ? 0 : 1) : 1); // active high
m_counter = 0;
m_select = 7;
return retval;
PORT_START("TESTMATRIX")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1)
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2)
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3)
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4)
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5)
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7)
PORT_BIT( 0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8)
PORT_BIT( 0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9)
PORT_BIT( 0x400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A)
PORT_START("TESTSENSE")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0_PAD)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1_PAD)
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2_PAD)
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3_PAD)
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD)
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5_PAD)
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6_PAD)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7_PAD)
if you get an error 94 (when you press a field key) you can clear that off with A and KEYPAD 3 which is the ERROR RESET key and it goes back to INPUT.
Last edited by Golden Child; 02/11/25 10:59 AM.
|
|
|
|
Joined: Dec 2017
Posts: 78 Likes: 5
Member
|
Member
Joined: Dec 2017
Posts: 78 Likes: 5 |
Sounds pretty good! I will try it later. Thank you very much!
|
|
|
|
Joined: Feb 2014
Posts: 1,156 Likes: 209
Very Senior Member
|
Very Senior Member
Joined: Feb 2014
Posts: 1,156 Likes: 209 |
Another experiment I was trying was to make an ioport from a spreadsheet using google sheets and google Apps Script: ![[Linked Image from i.imgur.com]](https://i.imgur.com/KfzCwy9.png)
|
|
|
|
Joined: Dec 2017
Posts: 78 Likes: 5
Member
|
Member
Joined: Dec 2017
Posts: 78 Likes: 5 |
I have good news. I have completed assigning keys to the keyboard. BASIC works! I am updating the repo so anybody interested can see the code and play with BASIC. Thank you!
|
2 members like this:
robcfg, Golden Child |
|
|
0 members (),
135
guests, and
0
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
Forums9
Topics9,345
Posts122,343
Members5,082
|
Most Online1,283 Dec 21st, 2022
|
|
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!
|
|
|
|