TFMSX rev 2 features & problems

Home for the Terriblefire MSX clone

Moderators: terriblefire, Terriblefire Moderator

User avatar
NYYRIKKI
Posts: 25
Joined: Sat Sep 30, 2023 12:20 pm
Location: Helsinki
Contact:

TFMSX rev 2 features & problems

Post by NYYRIKKI »

Hi!

I'm new here, but I had the opportunity to buy TFMSX rev 2 from "Chucky" in person and I'm very happy that I did, but I have still few issues that I would like to get solved.

First of all I really enjoy the small PCB size. The machine has pretty much all that I need in small form factor. The fact that you can use USB-joysticks sounds brilliant and yet it does not break the original joystick-port compatibility. I did test ie. light gun and it worked just fine without any timing issues. In future USB-mouse support would be nice to have as well.

When it comes to keyboard support, that is not working that fine... I have Swedish/Finnish keyboard and I have 4-keys missing completely and few others are in wrong place.

To be more exact, following keys are completely missing from my keyboard:
MSX row 1, bit 4. aka "|"
MSX row 2, bit 4. aka "?"
MSX row 6, bit 2. aka "GRAPH"
MSX row 7, bit 6. aka "SELECT"

What I did not test are:
MSX row 11, bit 1. aka "Yes"
MSX row 11, bit 3. aka "No"

... These last two are not part of normal keyboard scan and they exist only in few MSX2+ models. They are used only in very manufacturer specific softwares, so they are not important, but I would map them anyway to some unused keys like F11/F12 just in case.

The keys that seem to be mapped to a bit wrong place are on bottom row... This is a bit hard to explain or get "right" due to all different language versions, but actually the language version / character outlook does not really matter. The important part is to compare scancodes and get them as close as possible to original physical places of MSX keyboard.

In MSX the bottom row in Japanese keyboard starting from "N" is like this:
N M , . ? _ SHIFT while in PC it is N M , . _ SHIFT
Now in TFMSX the bottom row is N M ] , . SHIFT
ie. openMSX solves the missing key problem by mapping "_" to right RCTRL. I would recommend same approach. (Now mapped as 2nd CTRL)
The correct place for "]" would be one line up, next to Return. Now that key does not do anything.

The "|" is usually mapped on PC keyboard key next to "Z", but in TFMSX this key seems to be mapped as Numpad ",". Button next to "Z" is a totally wrong place in a sense that "|" should be next to backspace, but on PC keyboard there is key missing as well, so here you can't really do it right. In my opinion the Numpad "," could be mapped to "Num Lock"-key. (All NumPad keys are anyway optional on MSX)
GRAPH is usually mapped to "Alt Gr" or RALT-key.
Select could be mapped ie. to "Scroll lock" or "Print screen"

Everything else related to keyboard seems to be ok.

When it comes to memory layout, things seem to be a bit weird...

On "Normal MSX" the cartridge slots are 1 & 2. However in TFMSX they seem to be 1 & 3 while the SUB-ROM & RAM seems to be in expanded slot 2... Standard says this is all just fine and ok, but still I would have not selected such slot layout as all software may not follow the standard that well.

Personally I have even more RAM-issues. Practically in slot 2-2 I have only 64kB of memory and there is no sign of Memory Mapper of being present although it is said the computer has 512kB of RAM. According to Chuck it may be because I have bad CPLD-chip, but I list my findings here anyway just in case:

- If I boot the TFMSX without external RAM, I have 64kB in slot 2-2
- If I boot the TFMSX with memory mapper in slot 1 the memory mapper works fine, but somehow 16kB of RAM disappears from slot 2-2, so that I have RAM only on area #0000-#BFFF
- If I boot the TFMSX with memory mapper in slot 3 then I have again 64kB in slot 2-2, but only 48kB of the Z80 address space of memory mapper is visible on area #0000-#BFFF in slot 3

If you ask me, this makes no sense what so ever, but this is how it looks like to me ATM.

I also a bit disagree with the design choice that now there is 8x 64kB ROM that is divided between slots 0 and 2-2... If you put there MSX2 ROMs you have only 16kB left for virtual disk drive, BASIC compiler or other things you might consider useful... At least you can't have them all... If you want to have MSX2+ ROMs with boot logo and all then you have even less space left while slots 2-0 and 2-1 are totally unused. 4x128kB would have been SO much better.

Only remaining complaint after these is that the machine is lacking +12V and -12V voltages that render sound extensions useless in many devices like FM-PAC, Carnivore2, GR8NET, SFG-05, Music-Module and MFR+SD. These are only that I've tested, but likely some less-used RS-232 devices are affected as well.

I've been thinking of adding something like this:
https://www.ebay.com/itm/374091763057

... I understand that I'm kind of a special user, but it would be super nice to have a socket on PCB for this or something similar.

During testing, I've also noticed that if I try to boot from USB-stick using RookieDrive NX, it just hangs to "Loading Nextor"-message without ever clearing the screen... ATM I don't know if it is somehow related to previously mentioned issues.

This was a long post mostly put together from chats with Chucky, but I just hope that when there is wider audience, we will find solutions to some of these remaining issues in this forum together.
terriblefire
Moderator Team
Moderator Team
Posts: 5297
Joined: Mon Aug 28, 2017 10:56 pm
Location: Glasgow, UK

Re: TFMSX rev 2 features & problems

Post by terriblefire »

NYYRIKKI wrote: Sat Sep 30, 2023 12:49 pm When it comes to keyboard support, that is not working that fine... I have Swedish/Finnish keyboard and I have 4-keys missing completely and few others are in wrong place.
@arkadiusz.makarenko Should be able to help with the keyboard. I guess we just tested UK Qwerty. It will be an ARM firmware thing.
NYYRIKKI wrote: Sat Sep 30, 2023 12:49 pm When it comes to memory layout, things seem to be a bit weird...

On "Normal MSX" the cartridge slots are 1 & 2. However in TFMSX they seem to be 1 & 3 while the SUB-ROM & RAM seems to be in expanded slot 2... Standard says this is all just fine and ok, but still I would have not selected such slot layout as all software may not follow the standard that well.
Look at this tool.

https://www.tiny-yarou.com/slotchecker.html
https://www.tiny-yarou.com/files/MSXSlotInfoViewer.zip
msxsivo.png
msxsivo.png (63.34 KiB) Viewed 689 times
There is no "normal" I just chose something to match a real MSX i have. i.e. 1/3. Why does this make any difference? The ROM provided works with the layout provided. That said i'm not that bothered about changing the layout. But the layout makes no difference and we tested multiple Konami carts and checked you got the easter eggs. (with 2 carts inserted)
NYYRIKKI wrote: Sat Sep 30, 2023 12:49 pm Personally I have even more RAM-issues. Practically in slot 2-2 I have only 64kB of memory and there is no sign of Memory Mapper of being present although it is said the computer has 512kB of RAM. According to Chuck it may be because I have bad CPLD-chip, but I list my findings here anyway just in case:

- If I boot the TFMSX without external RAM, I have 64kB in slot 2-2
- If I boot the TFMSX with memory mapper in slot 1 the memory mapper works fine, but somehow 16kB of RAM disappears from slot 2-2, so that I have RAM only on area #0000-#BFFF
- If I boot the TFMSX with memory mapper in slot 3 then I have again 64kB in slot 2-2, but only 48kB of the Z80 address space of memory mapper is visible on area #0000-#BFFF in slot 3
I suspect there is some soldering issue here because the RAM checker tool works for me. It finds 512K as a secondary slot. Again i matched up to a real MSX in that tool.
NYYRIKKI wrote: Sat Sep 30, 2023 12:49 pm Only remaining complaint after these is that the machine is lacking +12V and -12V voltages that render sound extensions useless in many devices like FM-PAC, Carnivore2, GR8NET, SFG-05, Music-Module and MFR+SD. These are only that I've tested, but likely some less-used RS-232 devices are affected as well.
100% design choice to drop 12V. I dont want to have to deal with 12v potentially hitting these chips on a home build. The machine is really not designed for these add on carts and i'm consciously not supporting it. Its not just that i dont want to add more parts. I dont want to have 12V on my board and the PCB was not designed to keep 12v away from the other rails etc or prevent a badly behaved cart from killing the TFMSX. Those chips are too expensive and rare to risk killing.

Sorry but this is a decision made very early along with no tape support. Hope you can still enjoy the board.
———
"It is not necessarily a supply voltage at no load, but the amount of current it can provide when touched that
indicates how much hurting you shall receive."
User avatar
NYYRIKKI
Posts: 25
Joined: Sat Sep 30, 2023 12:20 pm
Location: Helsinki
Contact:

Re: TFMSX rev 2 features & problems

Post by NYYRIKKI »

terriblefire wrote: Sat Sep 30, 2023 2:36 pm
NYYRIKKI wrote: Sat Sep 30, 2023 12:49 pm When it comes to keyboard support, that is not working that fine... I have Swedish/Finnish keyboard and I have 4-keys missing completely and few others are in wrong place.
@arkadiusz.makarenko Should be able to help with the keyboard. I guess we just tested UK Qwerty. It will be an ARM firmware thing.
Yes... but I guess these same problems affect UK qwerty as well... The most important differences on USB-keyboard side are likely limited to "Alt Gr"-key.
terriblefire wrote: Sat Sep 30, 2023 2:36 pm
NYYRIKKI wrote: Sat Sep 30, 2023 12:49 pm When it comes to memory layout, things seem to be a bit weird...

On "Normal MSX" the cartridge slots are 1 & 2. However in TFMSX they seem to be 1 & 3 while the SUB-ROM & RAM seems to be in expanded slot 2... Standard says this is all just fine and ok, but still I would have not selected such slot layout as all software may not follow the standard that well.
Look at this tool.

https://www.tiny-yarou.com/slotchecker.html
https://www.tiny-yarou.com/files/MSXSlotInfoViewer.zip

msxsivo.png

There is no "normal" I just chose something to match a real MSX i have. i.e. 1/3. Why does this make any difference? The ROM provided works with the layout provided. That said i'm not that bothered about changing the layout. But the layout makes no difference and we tested multiple Konami carts and checked you got the easter eggs. (with 2 carts inserted)
Yes, if you test Konami cartridges, then this is no problem... Actually you can test any game cartridge and this is not a problem. When you run disk software this MAY become a problem, but even then it is not very likely to be issue or at least it is not big or popular issue... My point was that you have now selected not to follow best known practices and I see no reason for it.

Edit: Ie. Carnivore2 does not work from slot 3... Not your fault though...
terriblefire wrote: Sat Sep 30, 2023 2:36 pm
NYYRIKKI wrote: Sat Sep 30, 2023 12:49 pm Personally I have even more RAM-issues. Practically in slot 2-2 I have only 64kB of memory and there is no sign of Memory Mapper of being present although it is said the computer has 512kB of RAM. According to Chuck it may be because I have bad CPLD-chip, but I list my findings here anyway just in case:

- If I boot the TFMSX without external RAM, I have 64kB in slot 2-2
- If I boot the TFMSX with memory mapper in slot 1 the memory mapper works fine, but somehow 16kB of RAM disappears from slot 2-2, so that I have RAM only on area #0000-#BFFF
- If I boot the TFMSX with memory mapper in slot 3 then I have again 64kB in slot 2-2, but only 48kB of the Z80 address space of memory mapper is visible on area #0000-#BFFF in slot 3
I suspect there is some soldering issue here because the RAM checker tool works for me. It finds 512K as a secondary slot. Again i matched up to a real MSX in that tool.
Chuck suspected that here might be bad CPLD issue as he had some returns from customers. I can only tell what I can see and ie. in BASUC OUT 255,255 does not crash the computer as it should.
terriblefire wrote: Sat Sep 30, 2023 2:36 pm
NYYRIKKI wrote: Sat Sep 30, 2023 12:49 pm Only remaining complaint after these is that the machine is lacking +12V and -12V voltages that render sound extensions useless in many devices like FM-PAC, Carnivore2, GR8NET, SFG-05, Music-Module and MFR+SD. These are only that I've tested, but likely some less-used RS-232 devices are affected as well.
100% design choice to drop 12V. I dont want to have to deal with 12v potentially hitting these chips on a home build. The machine is really not designed for these add on carts and i'm consciously not supporting it. Its not just that i dont want to add more parts. I dont want to have 12V on my board and the PCB was not designed to keep 12v away from the other rails etc or prevent a badly behaved cart from killing the TFMSX. Those chips are too expensive and rare to risk killing.

Sorry but this is a decision made very early along with no tape support. Hope you can still enjoy the board.
I'm perfectly fine with that... I mostly just hope that you consider pulling the wires a bit further from the cartridge edge connector on next release. It should not cause extra costs.
User avatar
arkadiusz.makarenko
Moderator Team
Moderator Team
Posts: 1193
Joined: Wed Jun 19, 2019 7:36 am
Location: Edinburgh

Re: TFMSX rev 2 features & problems

Post by arkadiusz.makarenko »

NYYRIKKI wrote: Sat Sep 30, 2023 12:49 pm Hi!

Hi

Mouse support is possible, but I how would we test it? I have very limited ability to load software to this m MSX.
I would need a little bit help with this to progress it. Another bit is if it is one or two pieces of software and literally three users, then I may say that my time could be spent a little bit more productively.

Keyboard mappings are very simple to change. I have mapping array ready in my project, but I need to be told exactly what to change.

Code: Select all

// Array of 3 elements USB_KEYCODE, MSX_ROW, MSX_BIT
static const uint8_t msxkeymap[MSX_KEYS_SIZE][3] =
{
		//7 &		6 ^		5 %		4 $		3 #		2 @		1 !		0 )
		{KEY_7_AMPERSAND,		KB_ROW_0,		KB_BIT_7},
		{KEY_6_CARET,			KB_ROW_0,		KB_BIT_6},
		{KEY_5_PERCENT,			KB_ROW_0,		KB_BIT_5},
		{KEY_4_DOLLAR,			KB_ROW_0,		KB_BIT_4},
		{KEY_3_NUMBER_SIGN,		KB_ROW_0,		KB_BIT_3},
		{KEY_2_AT,			KB_ROW_0,		KB_BIT_2},
		{KEY_1_EXCLAMATION_MARK,	KB_ROW_0,		KB_BIT_1},
		{KEY_0_CPARENTHESIS,		KB_ROW_0,		KB_BIT_0},
		//; :		] }		[ {		\ ¦		= +		- _		9 (		8 *
		{KEY_SEMICOLON_COLON,				KB_ROW_1,		KB_BIT_7},
		{KEY_CBRACKET_AND_CBRACE,			KB_ROW_1,		KB_BIT_6},
		{KEY_OBRACKET_AND_OBRACE ,			KB_ROW_1,		KB_BIT_5},
		{KEY_BACKSLASH_VERTICAL_BAR,			KB_ROW_1,		KB_BIT_4},
		{KEY_EQUAL_PLUS,						KB_ROW_1,		KB_BIT_3},
		{KEY_MINUS_UNDERSCORE,				KB_ROW_1,		KB_BIT_2},
		{KEY_9_OPARENTHESIS,					KB_ROW_1,		KB_BIT_1},
		{KEY_8_ASTERISK,						KB_ROW_1,		KB_BIT_0},
		//B		A		DEAD	/ ?		. >		, <		` ~		' "
		{KEY_B,									KB_ROW_2,		KB_BIT_7},
		{KEY_A,									KB_ROW_2,		KB_BIT_6},
		{0x35,									KB_ROW_2,		KB_BIT_5}, //KEY_GRAVE_ACCENT_AND_TILDE
		{KEY_BACKSLASH_VERTICAL_BAR,			KB_ROW_2,		KB_BIT_4},
		{KEY_SLASH_QUESTION,					KB_ROW_2,		KB_BIT_3},
		{KEY_DOT_GREATER,						KB_ROW_2,		KB_BIT_2},
		{KEY_COMMA_AND_LESS,					KB_ROW_2,		KB_BIT_1},
		{KEY_SINGLE_AND_DOUBLE_QUOTE,		KB_ROW_2,		KB_BIT_0},
		//J		I		H		G		F		E		D		C
		{KEY_J,									KB_ROW_3,		KB_BIT_7},
		{KEY_I,									KB_ROW_3,		KB_BIT_6},
		{KEY_H,									KB_ROW_3,		KB_BIT_5},
		{KEY_G,									KB_ROW_3,		KB_BIT_4},
		{KEY_F,									KB_ROW_3,		KB_BIT_3},
		{KEY_E,									KB_ROW_3,		KB_BIT_2},
		{KEY_D,									KB_ROW_3,		KB_BIT_1},
		{KEY_C,									KB_ROW_3,		KB_BIT_0},
		//R		Q		P		O		N		M		L		K
		{KEY_R,									KB_ROW_4,		KB_BIT_7},
		{KEY_Q,									KB_ROW_4,		KB_BIT_6},
		{KEY_P,									KB_ROW_4,		KB_BIT_5},
		{KEY_O,									KB_ROW_4,		KB_BIT_4},
		{KEY_N,									KB_ROW_4,		KB_BIT_3},
		{KEY_M,									KB_ROW_4,		KB_BIT_2},
		{KEY_L,									KB_ROW_4,		KB_BIT_1},
		{KEY_K,									KB_ROW_4,		KB_BIT_0},
		//Z		Y		X		W		V		U		T		S
		{KEY_Z,									KB_ROW_5,		KB_BIT_7},
		{KEY_Y,									KB_ROW_5,		KB_BIT_6},
		{KEY_X,									KB_ROW_5,		KB_BIT_5},
		{KEY_W,									KB_ROW_5,		KB_BIT_4},
		{KEY_V,									KB_ROW_5,		KB_BIT_3},
		{KEY_U,									KB_ROW_5,		KB_BIT_2},
		{KEY_T,									KB_ROW_5,		KB_BIT_1},
		{KEY_S,									KB_ROW_5,		KB_BIT_0},
		//F3		F2		F1		CODE	CAPS	GRAPH	CTRL	SHIFT
		{KEY_F3,								KB_ROW_6,		KB_BIT_7},
		{KEY_F2,								KB_ROW_6,		KB_BIT_6},
		{KEY_F1,								KB_ROW_6,		KB_BIT_5},
		{KEY_LEFT_GUI,							KB_ROW_6,		KB_BIT_4},
		{0x39, 									KB_ROW_6,		KB_BIT_3},//KEY_CAPS LOCK,
		{KEY_RIGHT_GUI,							KB_ROW_6,		KB_BIT_2},
		{KEY_LEFTCONTROL,						KB_ROW_6,		KB_BIT_1},
		{KEY_RIGHTCONTROL,						KB_ROW_6,		KB_BIT_1},
		{KEY_LEFTSHIFT,							KB_ROW_6,		KB_BIT_0},
		{KEY_RIGHTSHIFT,						KB_ROW_6,		KB_BIT_0},
		//RET		SELECT	BS		STOP	TAB		ESC		F5		F4
		{KEY_ENTER,							KB_ROW_7,		KB_BIT_7},
		{KEY_SELECT,							KB_ROW_7,		KB_BIT_6},
		{KEY_BACKSPACE,						KB_ROW_7,		KB_BIT_5},
		{KEY_PAUSE,								KB_ROW_7,		KB_BIT_4},
		{KEY_TAB,								KB_ROW_7,		KB_BIT_3},
		{KEY_ESCAPE,							KB_ROW_7,		KB_BIT_2},
		{KEY_F5,								KB_ROW_7,		KB_BIT_1},
		{KEY_F4,								KB_ROW_7,		KB_BIT_0},
		//→		↓		↑		←		DEL		INS		HOME	SPACE
		{KEY_RIGHTARROW,						KB_ROW_8,		KB_BIT_7},
		{KEY_DOWNARROW,						KB_ROW_8,		KB_BIT_6},
		{KEY_UPARROW,							KB_ROW_8,		KB_BIT_5},
		{KEY_LEFTARROW,						KB_ROW_8,		KB_BIT_4},
		{KEY_DELETE,							KB_ROW_8,		KB_BIT_3},
		{KEY_INSERT,							KB_ROW_8,		KB_BIT_2},
		{KEY_HOME,								KB_ROW_8,		KB_BIT_1},
		{KEY_SPACEBAR,							KB_ROW_8,		KB_BIT_0},
		//NUM4	NUM3	NUM2	NUM1	NUM0	NUM/	NUM+	NUM*
		{KEY_KEYPAD_4_LEFT_ARROW,			KB_ROW_9,		KB_BIT_7},
		{KEY_KEYPAD_3_PAGEDN,					KB_ROW_9,		KB_BIT_6},
		{KEY_KEYPAD_2_DOWN_ARROW,			KB_ROW_9,		KB_BIT_5},
		{KEY_KEYPAD_1_END,						KB_ROW_9,		KB_BIT_4},
		{KEY_KEYPAD_0_INSERT,					KB_ROW_9,		KB_BIT_3},
		{KEY_KEYPAD_SLASH,					KB_ROW_9,		KB_BIT_2},
		{KEY_KEYPAD_PLUS,						KB_ROW_9,		KB_BIT_1},
		{KEY_KEYPAD_ASTERIKS,					KB_ROW_9,		KB_BIT_0},
		//NUM.	NUM,	NUM-	NUM9	NUM8	NUM7	NUM6	NUM5
		{KEY_KEYPAD_DECIMAL_SEPARATOR_DELETE,KB_ROW_10,		KB_BIT_7},
		{KEY_NONUS_BACK_SLASH_VERTICAL_BAR,	KB_ROW_10,		KB_BIT_6},
		{KEY_KEYPAD_MINUS,						KB_ROW_10,		KB_BIT_5},
		{KEY_KEYPAD_9_PAGEUP,					KB_ROW_10,		KB_BIT_4},
		{KEY_KEYPAD_8_UP_ARROW,				KB_ROW_10,		KB_BIT_3},
		{KEY_KEYPAD_7_HOME,					KB_ROW_10,		KB_BIT_2},
		{KEY_KEYPAD_6_RIGHT_ARROW,			KB_ROW_10,		KB_BIT_1},
		{KEY_KEYPAD_5,							KB_ROW_10,		KB_BIT_0},

};
First value it is USB key code, then MSX row and bit.
I wouldn't know what codes are sent from your keyboard to TFMSX, so you need to help me with this, and tell me what USB Codes to use.

Any help much appreciated!

PS.
USB Keyboard is working in Boot mode, not all keys are directly available to micro-controller. This is the only way to make sure that almost all usb keyboards are supported.
Do not trust people. They are capable of greatness.
~ Stanislaw Lem
User avatar
NYYRIKKI
Posts: 25
Joined: Sat Sep 30, 2023 12:20 pm
Location: Helsinki
Contact:

Re: TFMSX rev 2 features & problems

Post by NYYRIKKI »

Mouse support is possible, but I how would we test it?
Most easy is likely just power on the TFMSX and write a little test program like:

Code: Select all

10 screen 1:sprite$(0)="0HH0":fori=0to1:r=pad(12):x=(x+pad(13))and255:y=(y+pad(14))and255:put sprite 0,(x,y),8:i=-strig(1):NEXT
This program puts a small red circle to screen that you can move with a mouse.
PAD(12) function reads mouse from port 1 (returns always -1) to read from port 2, change it to PAD(16). PAD(13) returns X delta and PAD(14) returns Y delta. Both X and Y are 1 if mouse is not connected. Buttons work same way as with joystick.

Here is some more info about low level protocol:
https://www.msx.org/wiki/Mouse/Trackball

...for basic functionality you practically just need to send X and Y-delta (from last read) 4-bits at a time with pins 1-4 according to change of pin 8.
Another bit is if it is one or two pieces of software and literally three users, then I may say that my time could be spent a little bit more productively.
Well... I must say that if you think TFMSX is purely targeted for playing game cartridges, then this is not worth the trouble. There are very few cartridge software that supports mouse. I kind of have a feeling, mouse is pretty much considered a feature for disk/HDD users although some of the internal software that was available in MSX2+ machines sure had mouse support, but those are not inside TFMSX anyway.

I would say that where I mostly use mouse is when I'm running SymbOS. This kind of Windows-like multitasking OS with lots of windows is not fun at all to use without mouse... There are also lots of older tools, GUIs and launchers that support mouse, but I don't think they are really used these days other than maybe for nostalgic memories. The most popular launchers today are MultiMente and SofaRun and neither of those use mouse. Next on list are naturally graphics editors. If I ie. need to quickly ie. draw some 16x16 tiles for demo or game, I very often launch DD-graphics and do it directly on MSX instead of jumping to PC, but I don't know how many more do that anymore these days... I may be considered a bit oldskool this way. In reality last time I did this was on June, so definitely not something that even I would do in daily basis...

Rest of the use cases cover mostly different puzzle, chess, card, Lemmings or Mahjong type of games... I think last 3 mouse enabled games I've played are "Match Maniac" (puzzle), some card game collection with different solitaires (that's name I forgot) and "Sales discontinued" that is a Broken Sword / Larry type of massive point 'n click adventure, but in reality I think people mostly play these kinds of games today on browsers without bothering to launch MSX at all. As summary I would say mouse support on Amiga is more important than it is on MSX world. On MSX the mouse role is much more similar to early PC days.
Keyboard mappings are very simple to change. I have mapping array ready in my project, but I need to be told exactly what to change.
I would like to help hunting down these USB key codes, but I'm not sure how... You have now used these constants for keycode, but I don't know numbers they map to, so I can't really verify, what table to use. Is there ie. a Windows tool to read the codes from keyboard? ...or can you maybe link to some documentation/source/picture of keyboard where these codes come from?
User avatar
NYYRIKKI
Posts: 25
Joined: Sat Sep 30, 2023 12:20 pm
Location: Helsinki
Contact:

Re: TFMSX rev 2 features & problems

Post by NYYRIKKI »

Ok, ok... To get even a bit further, I tried my best to fix this without the codes...

To me the problem seems that you had defined same "VERTICAL_BAR" USB scan code 3 times with two different names and only last one of the definitions was effective. The other problem was that KB_ROW_2 was shifted by one bit from middle.

This table should be more close although I can't be 100% sure that it is correct... I now added "???" to all definitions where I'm not sure what constant to use:

Code: Select all

// Array of 3 elements USB_KEYCODE, MSX_ROW, MSX_BIT
static const uint8_t msxkeymap[MSX_KEYS_SIZE][3] =
{
		//7 &		6 ^		5 %		4 $		3 #		2 @		1 !		0 )
		{KEY_7_AMPERSAND,		KB_ROW_0,		KB_BIT_7},
		{KEY_6_CARET,			KB_ROW_0,		KB_BIT_6},
		{KEY_5_PERCENT,			KB_ROW_0,		KB_BIT_5},
		{KEY_4_DOLLAR,			KB_ROW_0,		KB_BIT_4},
		{KEY_3_NUMBER_SIGN,		KB_ROW_0,		KB_BIT_3},
		{KEY_2_AT,			KB_ROW_0,		KB_BIT_2},
		{KEY_1_EXCLAMATION_MARK,	KB_ROW_0,		KB_BIT_1},
		{KEY_0_CPARENTHESIS,		KB_ROW_0,		KB_BIT_0},

		//; :		] }		[ {		\ ¦		= +		- _		9 (		8 *
		{KEY_SEMICOLON_COLON,				KB_ROW_1,		KB_BIT_7},
		{KEY_CBRACKET_AND_CBRACE,			KB_ROW_1,		KB_BIT_6},
		{KEY_OBRACKET_AND_OBRACE ,			KB_ROW_1,		KB_BIT_5},
		{KEY_BACKSLASH_VERTICAL_BAR,			KB_ROW_1,		KB_BIT_4},
		{KEY_EQUAL_PLUS,				KB_ROW_1,		KB_BIT_3},
		{KEY_MINUS_UNDERSCORE,				KB_ROW_1,		KB_BIT_2},
		{KEY_9_OPARENTHESIS,				KB_ROW_1,		KB_BIT_1},
		{KEY_8_ASTERISK,				KB_ROW_1,		KB_BIT_0},

		//B		A		_	     / ?		. >		, <		` ~		' "
		{KEY_B,						KB_ROW_2,		KB_BIT_7},
		{KEY_A,						KB_ROW_2,		KB_BIT_6},
		{KEY_RIGHTCONTROL,				KB_ROW_2,		KB_BIT_5},
		{KEY_SLASH_QUESTION,				KB_ROW_2,		KB_BIT_4},
		{KEY_DOT_GREATER,				KB_ROW_2,		KB_BIT_3},
		{KEY_COMMA_AND_LESS,			        KB_ROW_2,		KB_BIT_2},
                {KEY_TILDE_HASH,			        KB_ROW_2,		KB_BIT_1}, //Maybe 0x35 KEY_GRAVE_ACCENT_AND_TILDE ???
		{KEY_SINGLE_AND_DOUBLE_QUOTE,		        KB_ROW_2,		KB_BIT_0},


		//J		I		H		G		F		E		D		C
		{KEY_J,									KB_ROW_3,		KB_BIT_7},
		{KEY_I,									KB_ROW_3,		KB_BIT_6},
		{KEY_H,									KB_ROW_3,		KB_BIT_5},
		{KEY_G,									KB_ROW_3,		KB_BIT_4},
		{KEY_F,									KB_ROW_3,		KB_BIT_3},
		{KEY_E,									KB_ROW_3,		KB_BIT_2},
		{KEY_D,									KB_ROW_3,		KB_BIT_1},
		{KEY_C,									KB_ROW_3,		KB_BIT_0},
		//R		Q		P		O		N		M		L		K
		{KEY_R,									KB_ROW_4,		KB_BIT_7},
		{KEY_Q,									KB_ROW_4,		KB_BIT_6},
		{KEY_P,									KB_ROW_4,		KB_BIT_5},
		{KEY_O,									KB_ROW_4,		KB_BIT_4},
		{KEY_N,									KB_ROW_4,		KB_BIT_3},
		{KEY_M,									KB_ROW_4,		KB_BIT_2},
		{KEY_L,									KB_ROW_4,		KB_BIT_1},
		{KEY_K,									KB_ROW_4,		KB_BIT_0},
		//Z		Y		X		W		V		U		T		S
		{KEY_Z,									KB_ROW_5,		KB_BIT_7},
		{KEY_Y,									KB_ROW_5,		KB_BIT_6},
		{KEY_X,									KB_ROW_5,		KB_BIT_5},
		{KEY_W,									KB_ROW_5,		KB_BIT_4},
		{KEY_V,									KB_ROW_5,		KB_BIT_3},
		{KEY_U,									KB_ROW_5,		KB_BIT_2},
		{KEY_T,									KB_ROW_5,		KB_BIT_1},
		{KEY_S,									KB_ROW_5,		KB_BIT_0},

		//F3		F2		F1		CODE	CAPS	GRAPH	CTRL	SHIFT
		{KEY_F3,							KB_ROW_6,		KB_BIT_7},
		{KEY_F2,							KB_ROW_6,		KB_BIT_6},
		{KEY_F1,							KB_ROW_6,		KB_BIT_5},
		{KEY_LEFT_GUI,							KB_ROW_6,		KB_BIT_4},
		{0x39, 								KB_ROW_6,		KB_BIT_3},//KEY_CAPS LOCK,
		{KEY_RIGHT_GUI,							KB_ROW_6,		KB_BIT_2}, // Not working... Code for RALT/AltGr needed ???
		{KEY_LEFTCONTROL,						KB_ROW_6,		KB_BIT_1},
		{KEY_LEFTSHIFT,							KB_ROW_6,		KB_BIT_0},
		{KEY_RIGHTSHIFT,						KB_ROW_6,		KB_BIT_0},

		//RET		SELECT	BS		STOP	TAB		ESC		F5		F4
		{KEY_ENTER,							KB_ROW_7,		KB_BIT_7},
		{KEY_SCROLL_LOCK,						KB_ROW_7,		KB_BIT_6}, // ??? Was KEY_SELECT
		{KEY_BACKSPACE,						        KB_ROW_7,		KB_BIT_5},
		{KEY_PAUSE,							KB_ROW_7,		KB_BIT_4},
		{KEY_TAB,							KB_ROW_7,		KB_BIT_3},
		{KEY_ESCAPE,							KB_ROW_7,		KB_BIT_2},
		{KEY_F5,							KB_ROW_7,		KB_BIT_1},
		{KEY_F4,							KB_ROW_7,		KB_BIT_0},

		//?		?		?		?		DEL		INS		HOME	SPACE
		{KEY_RIGHTARROW,						KB_ROW_8,		KB_BIT_7},
		{KEY_DOWNARROW,						        KB_ROW_8,		KB_BIT_6},
		{KEY_UPARROW,							KB_ROW_8,		KB_BIT_5},
		{KEY_LEFTARROW,						        KB_ROW_8,		KB_BIT_4},
		{KEY_DELETE,							KB_ROW_8,		KB_BIT_3},
		{KEY_INSERT,							KB_ROW_8,		KB_BIT_2},
		{KEY_HOME,							KB_ROW_8,		KB_BIT_1},
		{KEY_SPACEBAR,							KB_ROW_8,		KB_BIT_0},

		//NUM4	NUM3	NUM2	NUM1	NUM0	NUM/	NUM+	NUM*
		{KEY_KEYPAD_4_LEFT_ARROW,			        KB_ROW_9,		KB_BIT_7},
		{KEY_KEYPAD_3_PAGEDN,					KB_ROW_9,		KB_BIT_6},
		{KEY_KEYPAD_2_DOWN_ARROW,			        KB_ROW_9,		KB_BIT_5},
		{KEY_KEYPAD_1_END,					KB_ROW_9,		KB_BIT_4},
		{KEY_KEYPAD_0_INSERT,					KB_ROW_9,		KB_BIT_3},
		{KEY_KEYPAD_SLASH,					KB_ROW_9,		KB_BIT_2},
		{KEY_KEYPAD_PLUS,					KB_ROW_9,		KB_BIT_1},
		{KEY_KEYPAD_ASTERIKS,					KB_ROW_9,		KB_BIT_0},

		//NUM.	NUM,	NUM-	NUM9	NUM8	NUM7	NUM6	NUM5
		{KEY_KEYPAD_DECIMAL_SEPARATOR_DELETE,                   KB_ROW_10,		KB_BIT_7},
		{KEY_NUMLOCK,	                                        KB_ROW_10,	        KB_BIT_6}, // Was KEY_NONUS_BACK_SLASH_VERTICAL_BAR ???
		{KEY_KEYPAD_MINUS,					KB_ROW_10,		KB_BIT_5},
		{KEY_KEYPAD_9_PAGEUP,					KB_ROW_10,		KB_BIT_4},
		{KEY_KEYPAD_8_UP_ARROW,				        KB_ROW_10,		KB_BIT_3},
		{KEY_KEYPAD_7_HOME,					KB_ROW_10,		KB_BIT_2},
		{KEY_KEYPAD_6_RIGHT_ARROW,			        KB_ROW_10,		KB_BIT_1},
		{KEY_KEYPAD_5,						KB_ROW_10,		KB_BIT_0},

                // X   X   X   X   Cancel   X   Execute   X
		{KEY_F12,						KB_ROW_11,		KB_BIT_3},
       		{KEY_F11,			                        KB_ROW_11,		KB_BIT_1},

};
User avatar
NYYRIKKI
Posts: 25
Joined: Sat Sep 30, 2023 12:20 pm
Location: Helsinki
Contact:

Re: TFMSX rev 2 features & problems

Post by NYYRIKKI »

terriblefire wrote: Sat Sep 30, 2023 2:36 pm
NYYRIKKI wrote: Sat Sep 30, 2023 12:49 pm On "Normal MSX" the cartridge slots are 1 & 2. However in TFMSX they seem to be 1 & 3 while the SUB-ROM & RAM seems to be in expanded slot 2... Standard says this is all just fine and ok, but still I would have not selected such slot layout as all software may not follow the standard that well.
Look at this tool.

https://www.tiny-yarou.com/slotchecker.html
https://www.tiny-yarou.com/files/MSXSlotInfoViewer.zip
Yes, now I did to get a better idea, what made you think slot 3 is somewhat "normal" and this data is just not correct...

If we ie. look MSX2+ machines, only the DDX+ upgrade boards and CIEL upgrade boards has mention of slot B being in slot3, but that is not accurate. The story is same as with other Expert, Talent, Daewoo and Goldstar machines or for example SVI-728 that is more familiar in Europe. These machines did not really have 2nd cartridge slot at all, but there was manufacturer specific "Expansion port". Technically it was very similar to standard cartridge slot, but it did not have standard cartridge connector and it was not meant for plugging in cartridges. It was meant for plugging a flat cable for manufacturer's own disk drive expansion unit that contained also the disk interface.

I also noticed that the listing tends to mention some other computers like SVI-738 having slot B in slot 3, but that is simply because this is tool to read emulator configuration and BlueMSX tries to do best to insert 2nd cartridge even when in real life it would not be possible. In reality ie. SVI-738 has only 1 physical slot and the slot 3-2 that is mentioned as slot B is not even decoded in hardware level so much that you could build a real standard slot in there without adding extra logic gates.

If you really have an unmodified MSX that has standard slot that is mapped to slot 3 then please share the model name. I don't try to claim to you that there is no such device produced somewhere, I just can't name such ATM.
User avatar
NYYRIKKI
Posts: 25
Joined: Sat Sep 30, 2023 12:20 pm
Location: Helsinki
Contact:

Re: TFMSX rev 2 features & problems

Post by NYYRIKKI »

arkadiusz.makarenko wrote: Sun Oct 01, 2023 7:13 pm I have very limited ability to load software to this m MSX.
On previous reply I forgot to mention that few weeks ago I tried running disk emulation with TFMSX using this kind of 3-wire setup to joystick port and it worked just fine... It is not exactly fast, but good enough for basic testing of disk software functionality and running test programs from disk images. Here I'm running a game called Aleste 2.

TFMSX1.jpeg
TFMSX1.jpeg (87.45 KiB) Viewed 510 times
TFMSX2.jpeg
TFMSX2.jpeg (47.74 KiB) Viewed 510 times

It is very easy setup, but you need to have some TTL RS-232 adapter to make it work... I was a bit disappointed though that if the cable is not connected on boot or the software is not running on PC side the MSX just hangs, but that is just a small design laziness. My point is anyway that you likely have all needed HW already at home to make it run.

Required software is here:
https://jjfs.ocitygate.com/
terriblefire
Moderator Team
Moderator Team
Posts: 5297
Joined: Mon Aug 28, 2017 10:56 pm
Location: Glasgow, UK

Re: TFMSX rev 2 features & problems

Post by terriblefire »

NYYRIKKI wrote: Tue Oct 10, 2023 1:54 am Yes, now I did to get a better idea, what made you think slot 3 is somewhat "normal" and this data is just not correct...

...

If you really have an unmodified MSX that has standard slot that is mapped to slot 3 then please share the model name. I don't try to claim to you that there is no such device produced somewhere, I just can't name such ATM.
My Toshiba HX10 has a the second cart slot mapped to slot 3. I see this in tiny slot checker. TBH since i have absolutely no background in the MSX i just had to trust these information sources. But like i said before i'm happy to change it when i get a moment.

With that said my disk controller worked fine in the second slot mapped like this and so did all the games that myself and Ollie tried out so until now there was no reason to change. I'll post a firmware here when i get around to changing it.

Do you have the ability to reflash the CPLD? its the same process as the Amiga TF cards and there are plenty of discussions on this site if you dont know how to.

EDIT: Try this one
tfmsxr2_top.jed.zip
(17.2 KiB) Downloaded 10 times
———
"It is not necessarily a supply voltage at no load, but the amount of current it can provide when touched that
indicates how much hurting you shall receive."
User avatar
NYYRIKKI
Posts: 25
Joined: Sat Sep 30, 2023 12:20 pm
Location: Helsinki
Contact:

Re: TFMSX rev 2 features & problems

Post by NYYRIKKI »

terriblefire wrote: Tue Oct 10, 2023 8:10 am
NYYRIKKI wrote: Tue Oct 10, 2023 1:54 am If you really have an unmodified MSX that has standard slot that is mapped to slot 3 then please share the model name. I don't try to claim to you that there is no such device produced somewhere, I just can't name such ATM.
My Toshiba HX10 has a the second cart slot mapped to slot 3. I see this in tiny slot checker. TBH since i have absolutely no background in the MSX i just had to trust these information sources. But like i said before i'm happy to change it when i get a moment.
Well... In that case you fall in to same category with rest of my examples... "Not a slot but expansion bus" (for disk drives)...
With that said my disk controller worked fine in the second slot mapped like this and so did all the games that myself and Ollie tried out so until now there was no reason to change. I'll post a firmware here when i get around to changing it.
As I said before there SHOULD not be technical reason to change, but reality is a bitch. 95% of technical people say that in 95% of cases machine should use slots 0 and 3 internally and leave slots 1 and 2 for external devices. Yes, most of the time it makes no difference, but the question is, do you really want to put your device in to that last 5% category? As software developer my opinion is that MSX standard has enough compatibility problems even without trying to be original.

Especially disk controllers are made from the start to work on any slot as they have been designed to work as internal or external devices... Games mostly work great as they don't need to know more about their environment than what they know about them self. The problems tend to appear when there is program (like one loaded from disk) that does not really know the environment it faces. Most of the time all goes well, but in 80's programming specs were far from perfect. To give you an idea of the problem, I just copy/paste here one quote:

Aackosoft's Paul van Aacken said about compatibility problems in 1986 "As all MSX software houses have discovered, staying within the rules is OK as long as you know what the rules are." He also told that "The intimate support which is usually provided to independent software developers by companies like Atari and Commodore when they release new machines was not forthcoming from the Japanese manufacturers. The twin barriers of distance and language were partially responsible, and another problem was the inexperience of the Japanese consumer electronics giants in dealing with independent companies in a way that was not necessary for televisions or HI-FI units."
Do you have the ability to reflash the CPLD? its the same process as the Amiga TF cards and there are plenty of discussions on this site if you dont know how to.
I don't think so, but if you can give me exact links to follow, I may try my best to evaluate my possibilities. TBH ATM I'm considering shipping my PCB back to Chuck for overall maintenance, so that I can get my memory problems, slot layout as well as keyboard layout problems fixed all at a same go. I know I should not do it quite yet, Chuck is building new test PCB, we are chatting and I'm not in a hurry. I'll also need to test my own ROMs first (programming adapters still in mail), but if that HW upgrade goes fine, I'll promise that, I'll newer bother you guys again this way.

I've been doing very detailed testing behind the scenes and I'm very sure I've covered all the major problems in these posts already, so overall I can only say, GOOD JOB!
Post Reply

Return to “TFMSX”