MiSTer PCXT

User avatar
pgimeno
Top Contributor
Posts: 679
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 261 times
Been thanked: 210 times

Re: MiSTer PCXT

Unread post by pgimeno »

Could we focus on the test programs? I believe they are executed without any interrupt in the middle of the transfer.

From my disassembly though, they are incomplete, in that they don't clear the destination area prior to the move. But that could give false negatives (pass the test), not false positives (fail the test).
bbond007
Top Contributor
Posts: 521
Joined: Tue May 26, 2020 5:06 am
Has thanked: 86 times
Been thanked: 204 times

Re: MiSTer PCXT

Unread post by bbond007 »

pgimeno wrote: Fri Aug 19, 2022 3:36 pm
Wikipedia is not the best source for interrupt information. Ralf Brown's interrupt list has this to say about this function:

Code: Select all

--------B-1605-------------------------------
INT 16 - KEYBOARD - STORE KEYSTROKE IN KEYBOARD BUFFER (AT/PS w enh keybd only)
        AH = 05h
        CH = BIOS scan code
        CL = ASCII character
Return: AL = status
            00h if successful
            01h if keyboard buffer full
        AH destroyed by many BIOSes
Emphasis in "(AT/PS w enh keybd only)"

It also lists different behaviours for this function on PCjr and Tandy 2000.

You can emulate it by grabbing the circular buffer pointers in the BIOS memory area and inserting the key in the buffer yourself.
Thanks...

changed the code modify the buffer directly... and now it works!

Strange that it worked on x86box with my XT config :)

Code: Select all

Procedure StuffKeyCode(KeyCode : word); assembler;
Asm
  cli
  mov es, Seg0040
  mov di, 001Ch
  mov ax, KeyCode
  mov bx, es:[di]
  mov es:[bx], ax
  add byte ptr es:[di], 2
  cmp byte ptr es:[di], 60
  jle @end
  mov byte ptr [es:di], 30
@end:
  sti
End;
MicroCoreLabs
Core Developer
Posts: 96
Joined: Sun Jun 05, 2022 6:12 pm
Location: California
Has thanked: 6 times
Been thanked: 86 times
Contact:

Re: MiSTer PCXT

Unread post by MicroCoreLabs »

Could you add some MCL86 signals to SignalTap with a trigger on the 0x5C write?

The first MOVSB was successful and after this instruction CX equals zero, so it appears that the CX number of bytes were transferred with all but the first being read from or written to the wrong segment. Triggering on the first write and looking at the subsequent cycles will tell us the story.

We need to see the BIU signals: biu_muxed_segment, addr_out_temp, EU_BIU_COMMAND, biu_state, and the 8088 local bus would be helpful.

If you trigger on the 0x5C write we should be able to see the subsequent segment-overriden read and write cycles as requested by the EU.

That said, im not sure the prefixed MOVSB is broken. I don't think DEBUG will preserve all of an opcodes prefixes if it is a genuine 8088, so the example you showed using another emulator may not reflect what the real silicon is doing. The MCL86 does try to adopt these quirks...

The issue with DOSMAX may lie somewhere else...
User avatar
spark2k06
Core Developer
Posts: 868
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 961 times

Re: MiSTer PCXT

Unread post by spark2k06 »

MicroCoreLabs wrote: Fri Aug 19, 2022 7:06 pm Of course the SS is necessarily modified when an interrupt is taken. The DS is not. Suspicious, no? :)

I believe the sequence you isolated is being interrupted in the middle of the REP, possibly after the first copy. And on the genuine 8088 which has a bug where only the prefix preceding the MOVSB is saved.

Also, I suspect that DEBUG will also debounce the REP and maybe the reason you only see one successful copy.

Maybe you can allow this sequence to run and use a breakpoint on an opcode after the sequence to see if all bytes were copied.
In the driver, I have tried putting the INT 3 right at the end, where the RET of the function is. The content of that memory area is wrong, just like before with the debugger step-by-step.

I have also tried to put a CLI before the REP MOVSB and then the STI... same result, both in the driver and in the test program I have done.
MicroCoreLabs wrote: Sat Aug 20, 2022 4:40 am Could you add some MCL86 signals to SignalTap with a trigger on the 0x5C write?

The first MOVSB was successful and after this instruction CX equals zero, so it appears that the CX number of bytes were transferred with all but the first being read from or written to the wrong segment. Triggering on the first write and looking at the subsequent cycles will tell us the story.

We need to see the BIU signals: biu_muxed_segment, addr_out_temp, EU_BIU_COMMAND, biu_state, and the 8088 local bus would be helpful.

If you trigger on the 0x5C write we should be able to see the subsequent segment-overriden read and write cycles as requested by the EU.

That said, im not sure the prefixed MOVSB is broken. I don't think DEBUG will preserve all of an opcodes prefixes if it is a genuine 8088, so the example you showed using another emulator may not reflect what the real silicon is doing. The MCL86 does try to adopt these quirks...

The bug in DOSMAX may be somewhere else...
I don't have much experience with signal tap, but I'll give it a try, I'll let you know.
MicroCoreLabs
Core Developer
Posts: 96
Joined: Sun Jun 05, 2022 6:12 pm
Location: California
Has thanked: 6 times
Been thanked: 86 times
Contact:

Re: MiSTer PCXT

Unread post by MicroCoreLabs »

I think I found the error in the microcode. It looks like the segment override selection is being cleared by mistake across all string opcodes.

For a quick fix can you look for the sequence 4ddf0000 5c7f0000 in the microcode - there should be eight instances of this sequence.

For each one please change the 4ddf0000 to 4ddf0003 and see how it works!
User avatar
spark2k06
Core Developer
Posts: 868
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 961 times

Re: MiSTer PCXT

Unread post by spark2k06 »

MicroCoreLabs wrote: Sat Aug 20, 2022 6:55 am I think I found the error in the microcode. It looks like the segment override selection is being cleared by mistake across all string opcodes.

For a quick fix can you look for the sequence 4ddf0000 5c7f0000 in the microcode - there should be eight instances of this sequence.

For each one please change the 4ddf0000 to 4ddf0003 and see how it works!
Something is wrong, it starts to load the Tandy BIOS but stays like that... it hasn't even deleted the previous content of the splash screen:
20220820_093354-screen.png
20220820_093354-screen.png (139.83 KiB) Viewed 8114 times
I also attach the modified microcode file in case I have modified it wrong.
Attachments
microcode.zip
(10.4 KiB) Downloaded 76 times
MicroCoreLabs
Core Developer
Posts: 96
Joined: Sun Jun 05, 2022 6:12 pm
Location: California
Has thanked: 6 times
Been thanked: 86 times
Contact:

Re: MiSTer PCXT

Unread post by MicroCoreLabs »

Your microcode doesn't seem right. Did you you replace both 4ddf0000 and 5c7f0000 with a single line 4ddf0003? 5c7f0000 is missing in your microcode...

You just want to change the eight instances of 4ddf0000 that precede 5c7f0000 with 4ddf0003. Just the two bits :)
User avatar
spark2k06
Core Developer
Posts: 868
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 961 times

Re: MiSTer PCXT

Unread post by spark2k06 »

It works! :-)

More testing to be done now but it looks very good. I attach binary so that more users can test it. This would be the definitive change for an official release or do you think it needs a different solution?
20220820_103728-screen.png
20220820_103728-screen.png (184.22 KiB) Viewed 8047 times
20220820_103735-screen.png
20220820_103735-screen.png (180.99 KiB) Viewed 8047 times
Attachments
PCXT.rbf
(3.23 MiB) Downloaded 96 times
User avatar
spark2k06
Core Developer
Posts: 868
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 961 times

Re: MiSTer PCXT

Unread post by spark2k06 »

Here is the best possible configuration to have no more and no less than 630Kb of conventional memory available and 2MB of EMS in MS-Dos 6.22:
20220820_121107-screen.png
20220820_121107-screen.png (151.27 KiB) Viewed 7985 times
Attachments
config.zip
(88.21 KiB) Downloaded 110 times
User avatar
wark91
Core Developer
Posts: 334
Joined: Sun May 24, 2020 8:34 pm
Has thanked: 447 times
Been thanked: 94 times

Re: MiSTer PCXT

Unread post by wark91 »

also with the AO486 is kind difficult to get also this value for conventional memories :)
Great work !
suww37
Posts: 173
Joined: Sun Apr 17, 2022 2:24 am
Has thanked: 7 times
Been thanked: 15 times

Re: MiSTer PCXT

Unread post by suww37 »

In addition to ".img", Can you also allow ".ima" to recognize the floppy disk image extension? The two files have different extensions but are the same image.
suww37
Posts: 173
Joined: Sun Apr 17, 2022 2:24 am
Has thanked: 7 times
Been thanked: 15 times

Re: MiSTer PCXT

Unread post by suww37 »

suww37 wrote: Sat Aug 20, 2022 2:30 pm In addition to ".img", Can you also allow ".ima" to recognize the floppy disk image extension? The two files have different extensions but are the same image.
please ".dsk" extesion also.
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: MiSTer PCXT

Unread post by jca »

Just renaming the files is soooooooo difficult!
MicroCoreLabs
Core Developer
Posts: 96
Joined: Sun Jun 05, 2022 6:12 pm
Location: California
Has thanked: 6 times
Been thanked: 86 times
Contact:

Re: MiSTer PCXT

Unread post by MicroCoreLabs »

This would be the definitive change for an official release or do you think it needs a different solution?
It's a definitive change :)

The MCL86 has two bits to store the segment override register and another bit to activate this override. The problem is that I was clearing both fields when I should have only cleared the activate bit. When cleared the segment override register points to the DS which was what you were seeing. Rather than just ANDing 0x0000 I changed it to 0x0003 to mask off these bits. Easy fix.

I will upload the new microcode to GitHub shortly.
kubbie
Posts: 69
Joined: Mon May 25, 2020 11:41 am
Has thanked: 1 time
Been thanked: 3 times

Re: MiSTer PCXT

Unread post by kubbie »

I cannot seem to be able to compile the pcxt.rom and tandy.rom. I keep getting error invalid character '-' (U+00B7). Thats the line for the

C:\PCXT>python make_rom_with_ibm5160.py
File "C:\PCXT\make_rom_with_ibm5160.py", line 68
<title>PCXT_MiSTer/make_rom_with_ibm5160.py at main · spark2k06/PCXT_MiSTer · GitHub</title>
^
SyntaxError: invalid character '·' (U+00B7)
Flandango
Core Developer
Posts: 404
Joined: Wed May 26, 2021 9:35 pm
Has thanked: 43 times
Been thanked: 343 times

Re: MiSTer PCXT

Unread post by Flandango »

kubbie wrote: Sat Aug 20, 2022 6:46 pm I cannot seem to be able to compile the pcxt.rom and tandy.rom. I keep getting error invalid character '-' (U+00B7). Thats the line for the

C:\PCXT>python make_rom_with_ibm5160.py
File "C:\PCXT\make_rom_with_ibm5160.py", line 68
<title>PCXT_MiSTer/make_rom_with_ibm5160.py at main · spark2k06/PCXT_MiSTer · GitHub</title>
^
SyntaxError: invalid character '·' (U+00B7)
Looks like you downloaded the script from git without clicking on the RAW button first. Click on the Raw button then save it.
flynnsbit
Top Contributor
Posts: 552
Joined: Sun May 24, 2020 8:07 pm
Has thanked: 183 times
Been thanked: 308 times
Contact:

Re: MiSTer PCXT

Unread post by flynnsbit »

Flandango wrote: Sat Aug 20, 2022 7:19 pm
kubbie wrote: Sat Aug 20, 2022 6:46 pm I cannot seem to be able to compile the pcxt.rom and tandy.rom. I keep getting error invalid character '-' (U+00B7). Thats the line for the

C:\PCXT>python make_rom_with_ibm5160.py
File "C:\PCXT\make_rom_with_ibm5160.py", line 68
<title>PCXT_MiSTer/make_rom_with_ibm5160.py at main · spark2k06/PCXT_MiSTer · GitHub</title>
^
SyntaxError: invalid character '·' (U+00B7)
Looks like you downloaded the script from git without clicking on the RAW button first. Click on the Raw button then save it.
^this

https://raw.githubusercontent.com/MiSTe ... ibm5160.py

etc...
kubbie
Posts: 69
Joined: Mon May 25, 2020 11:41 am
Has thanked: 1 time
Been thanked: 3 times

Re: MiSTer PCXT

Unread post by kubbie »

Flandango wrote: Sat Aug 20, 2022 7:19 pm
kubbie wrote: Sat Aug 20, 2022 6:46 pm I cannot seem to be able to compile the pcxt.rom and tandy.rom. I keep getting error invalid character '-' (U+00B7). Thats the line for the

C:\PCXT>python make_rom_with_ibm5160.py
File "C:\PCXT\make_rom_with_ibm5160.py", line 68
<title>PCXT_MiSTer/make_rom_with_ibm5160.py at main · spark2k06/PCXT_MiSTer · GitHub</title>
^
SyntaxError: invalid character '·' (U+00B7)
Looks like you downloaded the script from git without clicking on the RAW button first. Click on the Raw button then save it.
Now. I'm getting this when I clicked "raw" and saved.

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.

=================== RESTART: C:\PCXT\make_rom_with_ibm5160.py ==================
Traceback (most recent call last):
File "C:\PCXT\make_rom_with_ibm5160.py", line 4, in <module>
import requests
ModuleNotFoundError: No module named 'requests'

EDIT: I figured out my problem. Thanks for the help!
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: MiSTer PCXT

Unread post by Caldor »

I made some Windows batch scripts for creating the ROM files:
http://dionysus.dk/devstuff/mister/

The jukost one requires WSL installed I think, the Linux subsystem. It will also create the file as pcxt_jukost.rom so it has to be renamed like the open source ones do.

The scripts should download the files from the websites, also the ide_xtl.rom from the git, extract zip files and combine the different files.

Hmm, just got an idea. I will add the zero file that is the problem for the jukost script. Then it should work I think even without WSL. All that part does is help create an empty file of a certain size. So copy the file: "zerofile.tmp" as well.
arromdee
Posts: 31
Joined: Mon Jul 11, 2022 9:24 am
Been thanked: 3 times

Re: MiSTer PCXT

Unread post by arromdee »

I found that the existing scripts didn't work on actual Linux, because of the difference between "bin" and "BIN".
User avatar
spark2k06
Core Developer
Posts: 868
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 961 times

Re: MiSTer PCXT

Unread post by spark2k06 »

suww37 wrote: Sat Aug 20, 2022 3:20 pm
suww37 wrote: Sat Aug 20, 2022 2:30 pm In addition to ".img", Can you also allow ".ima" to recognize the floppy disk image extension? The two files have different extensions but are the same image.
please ".dsk" extesion also.
IMA added, I am not so sure that DSK images are in raw format.
User avatar
spark2k06
Core Developer
Posts: 868
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 961 times

Re: MiSTer PCXT

Unread post by spark2k06 »

spark2k06 wrote: Mon Aug 15, 2022 9:38 am
wark91 wrote: Mon Aug 15, 2022 9:07 am Thank you for the update.
I think it will be great to keep option on the OSD to load BIOS or XTIDE.
The fact is that now the core reset is linked to the selected model, which automatically loads the appropriate ROM. To keep the option to load ROM and XTIDE, I should adapt it to ignore the PC model during the reset... via some developer option, because that's really what it is.

I will keep this in mind for future revisions.
@wark91, I am not forgetting this, only that modifications have to be made to the Main and must wait until later.
suww37
Posts: 173
Joined: Sun Apr 17, 2022 2:24 am
Has thanked: 7 times
Been thanked: 15 times

Re: MiSTer PCXT

Unread post by suww37 »

spark2k06 wrote: Sun Aug 21, 2022 5:22 am
suww37 wrote: Sat Aug 20, 2022 3:20 pm
suww37 wrote: Sat Aug 20, 2022 2:30 pm In addition to ".img", Can you also allow ".ima" to recognize the floppy disk image extension? The two files have different extensions but are the same image.
please ".dsk" extesion also.
IMA added, I am not so sure that DSK images are in raw format.
Thank you . I renamed the file ".dsk" to ".ima" and confirmed that it is recognized normally in pcxt core.
kubbie
Posts: 69
Joined: Mon May 25, 2020 11:41 am
Has thanked: 1 time
Been thanked: 3 times

Re: MiSTer PCXT

Unread post by kubbie »

Caldor wrote: Sat Aug 20, 2022 11:20 pm I made some Windows batch scripts for creating the ROM files:
http://dionysus.dk/devstuff/mister/

The jukost one requires WSL installed I think, the Linux subsystem. It will also create the file as pcxt_jukost.rom so it has to be renamed like the open source ones do.

The scripts should download the files from the websites, also the ide_xtl.rom from the git, extract zip files and combine the different files.

Hmm, just got an idea. I will add the zero file that is the problem for the jukost script. Then it should work I think even without WSL. All that part does is help create an empty file of a certain size. So copy the file: "zerofile.tmp" as well.
Thanks for this.
User avatar
Daniel8b
Posts: 24
Joined: Tue Feb 08, 2022 10:03 am
Been thanked: 14 times

Re: MiSTer PCXT

Unread post by Daniel8b »

Excellent job! Is quite nice for running early PC games and applications. Kudos!

I noticed an issue with the keyboard not reacting properly to shift/capslock keys. Should I report it here or at Github?

Thanks!
kitune-san
Top Contributor
Posts: 401
Joined: Wed May 18, 2022 11:20 am
Has thanked: 127 times
Been thanked: 412 times

Re: MiSTer PCXT

Unread post by kitune-san »

FDC Progress Report

Floppy Disk Controller is now recognized.
Read has not been confirmed yet. I'm sleepy and will try tomorrow.
2022-08-22 003828.png
2022-08-22 003828.png (196.43 KiB) Viewed 7044 times
Also, the .WIDE setting for hps_io was changed to .WIDE(1).
breiztiger
Top Contributor
Posts: 433
Joined: Sun May 24, 2020 7:17 pm
Has thanked: 24 times
Been thanked: 93 times

Re: MiSTer PCXT

Unread post by breiztiger »

very good !!!
CPC-Power Staff
User avatar
Goingdown
Posts: 38
Joined: Mon May 25, 2020 6:58 am
Has thanked: 5 times
Been thanked: 4 times

Re: MiSTer PCXT

Unread post by Goingdown »

Daniel8b wrote: Sun Aug 21, 2022 11:25 am I noticed an issue with the keyboard not reacting properly to shift/capslock keys. Should I report it here or at Github?
Are you using keyb to load non-us keyboard layout? That does not work properly yet.
User avatar
spark2k06
Core Developer
Posts: 868
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 961 times

Re: MiSTer PCXT

Unread post by spark2k06 »

Goingdown wrote: Sun Aug 21, 2022 5:46 pm
Daniel8b wrote: Sun Aug 21, 2022 11:25 am I noticed an issue with the keyboard not reacting properly to shift/capslock keys. Should I report it here or at Github?
Are you using keyb to load non-us keyboard layout? That does not work properly yet.
We know, you can log issues as issues on GitHub, when it is possible to review them, we will do it.

Thank you!
User avatar
spark2k06
Core Developer
Posts: 868
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 961 times

Re: MiSTer PCXT

Unread post by spark2k06 »

I have added a second COM2 port (2F8h) experimentally, it now works on the USER_IO but I think a mouse could be implemented there... I would have to try to figure out how to do it:

https://github.com/MiSTer-devel/PCXT_Mi ... a3a25145b1
20220821_194800-screen.png
20220821_194800-screen.png (113.39 KiB) Viewed 6924 times
Post Reply