Page 37 of 47

Re: MiSTer PCXT

Posted: Fri Aug 19, 2022 9:03 pm
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).

Re: MiSTer PCXT

Posted: Fri Aug 19, 2022 11:43 pm
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;

Re: MiSTer PCXT

Posted: Sat Aug 20, 2022 4:40 am
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...

Re: MiSTer PCXT

Posted: Sat Aug 20, 2022 5:39 am
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.

Re: MiSTer PCXT

Posted: Sat Aug 20, 2022 6:55 am
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!

Re: MiSTer PCXT

Posted: Sat Aug 20, 2022 7:37 am
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 9056 times
I also attach the modified microcode file in case I have modified it wrong.

Re: MiSTer PCXT

Posted: Sat Aug 20, 2022 7:53 am
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 :)

Re: MiSTer PCXT

Posted: Sat Aug 20, 2022 8:41 am
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 8989 times
20220820_103735-screen.png
20220820_103735-screen.png (180.99 KiB) Viewed 8989 times

Re: MiSTer PCXT

Posted: Sat Aug 20, 2022 10:13 am
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 8927 times

Re: MiSTer PCXT

Posted: Sat Aug 20, 2022 1:17 pm
by wark91
also with the AO486 is kind difficult to get also this value for conventional memories :)
Great work !

Re: MiSTer PCXT

Posted: Sat Aug 20, 2022 2:30 pm
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.

Re: MiSTer PCXT

Posted: Sat Aug 20, 2022 3:20 pm
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.

Re: MiSTer PCXT

Posted: Sat Aug 20, 2022 3:44 pm
by jca
Just renaming the files is soooooooo difficult!

Re: MiSTer PCXT

Posted: Sat Aug 20, 2022 4:45 pm
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.

Re: MiSTer PCXT

Posted: Sat Aug 20, 2022 6:46 pm
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)

Re: MiSTer PCXT

Posted: Sat Aug 20, 2022 7:19 pm
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.

Re: MiSTer PCXT

Posted: Sat Aug 20, 2022 9:28 pm
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...

Re: MiSTer PCXT

Posted: Sat Aug 20, 2022 9:42 pm
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!

Re: MiSTer PCXT

Posted: Sat Aug 20, 2022 11:20 pm
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.

Re: MiSTer PCXT

Posted: Sun Aug 21, 2022 1:51 am
by arromdee
I found that the existing scripts didn't work on actual Linux, because of the difference between "bin" and "BIN".

Re: MiSTer PCXT

Posted: Sun Aug 21, 2022 5:22 am
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.

Re: MiSTer PCXT

Posted: Sun Aug 21, 2022 5:27 am
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.

Re: MiSTer PCXT

Posted: Sun Aug 21, 2022 5:32 am
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.

Re: MiSTer PCXT

Posted: Sun Aug 21, 2022 11:24 am
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.

Re: MiSTer PCXT

Posted: Sun Aug 21, 2022 11:25 am
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!

Re: MiSTer PCXT

Posted: Sun Aug 21, 2022 3:42 pm
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 7986 times
Also, the .WIDE setting for hps_io was changed to .WIDE(1).

Re: MiSTer PCXT

Posted: Sun Aug 21, 2022 3:50 pm
by breiztiger
very good !!!

Re: MiSTer PCXT

Posted: Sun Aug 21, 2022 5:46 pm
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.

Re: MiSTer PCXT

Posted: Sun Aug 21, 2022 5:50 pm
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!

Re: MiSTer PCXT

Posted: Sun Aug 21, 2022 5:56 pm
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 7866 times