MiSTer PCXT

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 don't quite know how to test this. Provide me with a complete instruction set and I could compare between PCEm and PCXT core.
Sorry I did not answer this.

LES fetches two words. The first one goes into the described register and the second word gets stored in the segment register ES.

We want to see how LES operates when the beginning address will cause the fetch of these two words to go past the end of the segment.

We want to test with the EA set to:
0xFFFC = Totally aligned so should work ok
0xFFFD = First word fetch ok and first byte of the second word also ok (from address 0xFFFF), but where does the second byte get fetched from?
0xFFFE = First word fetch ok, but from which segment does the second word get fetched from?
0xFFFF = First byte of first word ok. but where does the second byte get fetched from? Also which segment does the second word get fetched from?
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 »

Thank you for gathering these results, but I suggest that you populate the two words in memory so we know for certain which ones are being fetched into DI and ES. It would be easier to see what is happening if you populate memory at the end of the segment with an incrementing pattern.

DS:0000. 11
DS:0001. 22

DS:FFFC. CC
DS:FFFD. DD
DS:FFFE. EE
DS:FFFF. FF

DS+1:0000. 5A
DS+1:0001. 5B
DS+1:0002. 5C
DS+1:0003. 5D

Keep in mind that LES DI,[BX] means:
1) copy [DS:BX] to DI
2) copy [DS:BX+2] to ES

Experiments:
1) Set BX=0xFFFC then LES DI,[BX]
2) Set BX=0xFFFD then LES DI,[BX]
3) Set BX=0xFFFE then LES DI,[BX]
4) Set BX=0xFFFF then LES DI,[BX]

For the experiments BX is bing set near the end of the DS segment. We want to first populate these ares with known data, then see what gets fetched to the DI and ES registers. It's a little complicated, sorry :)
User avatar
spark2k06
Core Developer
Posts: 876
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 969 times

Re: MiSTer PCXT

Unread post by spark2k06 »

MicroCoreLabs wrote: Mon Aug 29, 2022 6:43 am Thank you for gathering these results, but I suggest that you populate the two words in memory so we know for certain which ones are being fetched into DI and ES. It would be easier to see what is happening if you populate memory at the end of the segment with an incrementing pattern.

DS:0000. 11
DS:0001. 22

DS:FFFC. CC
DS:FFFD. DD
DS:FFFE. EE
DS:FFFF. FF

DS+1:0000. 5A
DS+1:0001. 5B
DS+1:0002. 5C
DS+1:0003. 5D

Keep in mind that LES DI,[BX] means:
1) copy [DS:BX] to DI
2) copy [DS:BX+2] to ES

Experiments:
1) Set BX=0xFFFC then LES DI,[BX]
2) Set BX=0xFFFD then LES DI,[BX]
3) Set BX=0xFFFE then LES DI,[BX]
4) Set BX=0xFFFF then LES DI,[BX]

For the experiments BX is bing set near the end of the DS segment. We want to first populate these ares with known data, then see what gets fetched to the DI and ES registers. It's a little complicated, sorry :)
This is the result:

Code: Select all

DI=FFFC -> LES BX,[DI] -> ES = FFEE, BX = DDCC (Core PCXT, PCEm, Micro8088)

DI=FFFD -> LES BX,[DI] -> ES = 00FF, BX = EEDD (Core PCXT)
DI=FFFD -> LES BX,[DI] -> ES = 11FF, BX = EEDD (PCEm, Micro8088)

DI=FFFE -> LES BX,[DI] -> ES = 1211, BX = FFEE (Core PCXT)
DI=FFFE -> LES BX,[DI] -> ES = 2211, BX = FFEE (PCEm, Micro8088)

DI=FFFF -> LES BX,[DI] -> ES = FF12, BX = 00FF (Core PCXT)
DI=FFFF -> LES BX,[DI] -> ES = 0022, BX = 11FF (PCEm, Micro8088)
User avatar
pgimeno
Top Contributor
Posts: 710
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 277 times
Been thanked: 226 times

Re: MiSTer PCXT

Unread post by pgimeno »

I've been trying to debug using this core, but I was unable to make it boot from floppy. The only version that I got to boot is the official one, and in that one the keys get stuck, so I could not use it.

So I've started debugging on ao486 only, but I'm not quite there yet. PKUNZIP uses some anti-debugging tricks, easy to work around but I was not expecting them and that made me waste some time.

I strongly recommend symdeb instead of debug, for many reasons. It's basically compatible, but it has very interesting features. Among them: it allows expressions in the command line; e.g. you can do D (DS+1F42):2314 L 4, also multiple commands in the same line (e.g. to read register 4 of the 6845: o 3D4 4;i 3D5), it has a help command "?", and the main one: it allows you to write scripts. You redirect standard input from the script, and at the end of the file you add <CON to redirect standard input back to the console so you can continue typing. Or you add Q to quit, but debug supports that too.

PKUNZIP is compressed with PKLITE in a way that PKLITE can't revert, but there's a tool called UNP that can revert it (attached). I'm working with the uncompressed version.

With that uncompressed version, this is my current WIP script:

Code: Select all

g 10
t
* Go to start of main() (PKUNZIP is written in C)
g 1fbc
* Defeat anti-debug (writes to vectors 81 and 83 instead of 01 and 03)
e 116a 00 02
e 1168 00 02
* Pretend to detect 8086
g 21a4
p
rax 0
* This is where the processor is printed
*g 220a
* Enter the main routine that opens the file etc.
g 2237
t
* Prints "Searching ZIP: blahblah"
g 1d63
p
* Actually scans files
g 1d84
t
* Apparently scans one file
g 1c2b
* This may be doing the decompression, judging by the time it takes
g 1816
<con
Since I couldn't test with the PCXT core, I couldn't see that the failures depend on the preceding file. That's interesting, but since I isolated the BUBBOB.DAT file in a single zip to go directly to the meat, it doesn't seem like I would run into the issue, so my debugging would have been futile.

What I can think of, is to use a symdeb script to trace the decompression, dumping the output to a file, to compare the traces of the decompression when run in the core and when run in a "good" system. symdeb can also redirect output, so in the script you can put >FILENAME.TXT to redirect to a file, or >CON to redirect to the console, or even >NUL to suppress output temporarily.
Attachments
UNP.ZIP
(19.64 KiB) Downloaded 199 times
User avatar
spark2k06
Core Developer
Posts: 876
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 969 times

Re: MiSTer PCXT

Unread post by spark2k06 »

pgimeno wrote: Mon Aug 29, 2022 11:37 am I've been trying to debug using this core, but I was unable to make it boot from floppy. The only version that I got to boot is the official one, and in that one the keys get stuck, so I could not use it.
The problems you have with the keyboard are probably because you are using KEYB... don't use it, even if you have to be with the default English keyboard.

All problems with PKUNZIP could be due to the segment change in the LES instruction, as suggested by MicroCoreLabs. In the tests I have done, you can see that it does not work correctly, unlike in PCEm or a real PCXT. I think the best thing to do first is to wait for it to be solved, and then we can confirm if it solves the PKUNZIP problem or not.

Edit: I'll make a note of using symdeb, thanks!
User avatar
pgimeno
Top Contributor
Posts: 710
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 277 times
Been thanked: 226 times

Re: MiSTer PCXT

Unread post by pgimeno »

MicroCoreLabs wrote: Mon Aug 29, 2022 6:43 am DS+1:0000. 5A
DS+1:0001. 5B
DS+1:0002. 5C
DS+1:0003. 5D
This should have been DS+1000 instead of DS+1 (all four times). And also DS:0002 = 33 for the last test.
User avatar
pgimeno
Top Contributor
Posts: 710
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 277 times
Been thanked: 226 times

Re: MiSTer PCXT

Unread post by pgimeno »

spark2k06 wrote: Mon Aug 29, 2022 12:04 pm The problems you have with the keyboard are probably because you are using KEYB... don't use it, even if you have to be with the default English keyboard.
It was a Spanish DOS 5 installation disk, so you're probably right. I'll try with a US version. Thanks.
User avatar
spark2k06
Core Developer
Posts: 876
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 969 times

Re: MiSTer PCXT

Unread post by spark2k06 »

pgimeno wrote: Mon Aug 29, 2022 12:30 pm
spark2k06 wrote: Mon Aug 29, 2022 12:04 pm The problems you have with the keyboard are probably because you are using KEYB... don't use it, even if you have to be with the default English keyboard.
It was a Spanish DOS 5 installation disk, so you're probably right. I'll try with a US version. Thanks.
In any case, if the autoexec.bat has a KEYB in it, comment it out so that it does not load. You can use MSDos 5.0 in Spanish, just comment out the KEYB line so it doesn't load at startup.
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 »

spark2k06 wrote: Mon Aug 29, 2022 7:35 am
MicroCoreLabs wrote: Mon Aug 29, 2022 6:43 am Thank you for gathering these results, but I suggest that you populate the two words in memory so we know for certain which ones are being fetched into DI and ES. It would be easier to see what is happening if you populate memory at the end of the segment with an incrementing pattern.

DS:0000. 11
DS:0001. 22

DS:FFFC. CC
DS:FFFD. DD
DS:FFFE. EE
DS:FFFF. FF

DS+1:0000. 5A
DS+1:0001. 5B
DS+1:0002. 5C
DS+1:0003. 5D

Keep in mind that LES DI,[BX] means:
1) copy [DS:BX] to DI
2) copy [DS:BX+2] to ES

Experiments:
1) Set BX=0xFFFC then LES DI,[BX]
2) Set BX=0xFFFD then LES DI,[BX]
3) Set BX=0xFFFE then LES DI,[BX]
4) Set BX=0xFFFF then LES DI,[BX]

For the experiments BX is bing set near the end of the DS segment. We want to first populate these ares with known data, then see what gets fetched to the DI and ES registers. It's a little complicated, sorry :)
This is the result:

Code: Select all

DI=FFFC -> LES BX,[DI] -> ES = FFEE, BX = DDCC (Core PCXT, PCEm, Micro8088)

DI=FFFD -> LES BX,[DI] -> ES = 00FF, BX = EEDD (Core PCXT)
DI=FFFD -> LES BX,[DI] -> ES = 11FF, BX = EEDD (PCEm, Micro8088)

DI=FFFE -> LES BX,[DI] -> ES = 1211, BX = FFEE (Core PCXT)
DI=FFFE -> LES BX,[DI] -> ES = 2211, BX = FFEE (PCEm, Micro8088)

DI=FFFF -> LES BX,[DI] -> ES = FF12, BX = 00FF (Core PCXT)
DI=FFFF -> LES BX,[DI] -> ES = 0022, BX = 11FF (PCEm, Micro8088)
If there is a problem with the timing of adding the offset and base address, would it work well if I change the BIU code as follows?
However, I do not understand why 12 is read out instead of 22...
Attachments
biu_max.zip
(5.4 KiB) Downloaded 194 times
User avatar
spark2k06
Core Developer
Posts: 876
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 969 times

Re: MiSTer PCXT

Unread post by spark2k06 »

kitune-san wrote: Mon Aug 29, 2022 12:49 pm If there is a problem with the timing of adding the offset and base address, would it work well if I change the BIU code as follows?
However, I do not understand why 12 is read out instead of 22...
I'll try it now, thanks!

You're right, now I get 22, did I look at it wrong? I don't know, but with pgimeno's suggestion, the results now would be like this... I still have to try the modification you send:
pgimeno wrote: Mon Aug 29, 2022 12:25 pm This should have been DS+1000 instead of DS+1 (all four times). And also DS:0002 = 33 for the last test.

Code: Select all

DI=FFFC -> LES BX,[DI] -> ES = FFEE, BX = DDCC (Core PCXT, PCEm, Micro8088)

DI=FFFD -> LES BX,[DI] -> ES = 5AFF, BX = EEDD (Core PCXT)
DI=FFFD -> LES BX,[DI] -> ES = 11FF, BX = EEDD (PCEm, Micro8088)

DI=FFFE -> LES BX,[DI] -> ES = 2211, BX = FFEE (Core PCXT, PCEm, Micro8088)

DI=FFFF -> LES BX,[DI] -> ES = 3322, BX = 00FF (Core PCXT, PCEm, Micro8088)

User avatar
spark2k06
Core Developer
Posts: 876
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 969 times

Re: MiSTer PCXT

Unread post by spark2k06 »

kitune-san wrote: Mon Aug 29, 2022 12:49 pm If there is a problem with the timing of adding the offset and base address, would it work well if I change the BIU code as follows?
It works!

PKUNZIP and TDL already work perfectly :)

I will make it public in the next release. Can you make me a pull request on the prerelease branch with this change, please? This way your contribution is registered
flynnsbit
Top Contributor
Posts: 552
Joined: Sun May 24, 2020 8:07 pm
Has thanked: 185 times
Been thanked: 310 times
Contact:

Re: MiSTer PCXT

Unread post by flynnsbit »

spark2k06 wrote: Mon Aug 29, 2022 1:37 pm
kitune-san wrote: Mon Aug 29, 2022 12:49 pm If there is a problem with the timing of adding the offset and base address, would it work well if I change the BIU code as follows?
It works!

PKUNZIP and TDL already work perfectly :)

I will make it public in the next release. Can you make me a pull request on the prerelease branch with this change, please? This way your contribution is registered
Nice, you guys really rallied around that bug. Thanks! That will make the pre-packaged pack VHDs much more stable as zip/pkunzip were pretty core depending on what you were doing. Wonder if that fixes anything else outside of zip?
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 »

It was late last night so I did not get a change to suggest that the problem appears to be in the BIU, but @kitune-san seems to have found it! :)

Im very surprised that only PKUNZIP was having trouble as the problem with the BIU appears to have been related to word accesses so you would think many applications would also be failing!

Thank you @spark2k06 for running those tests! They confirmed that the real 8088 does in-fact wrap round the same segment for word operations and the LES opcode, so the MCL86 microcode is correct!
Mills
Posts: 90
Joined: Mon Jun 08, 2020 2:52 pm
Has thanked: 15 times
Been thanked: 32 times

Re: MiSTer PCXT

Unread post by Mills »

MicroCoreLabs wrote: Mon Aug 29, 2022 3:50 pm It was late last night so I did not get a change to suggest that the problem appears to be in the BIU, but @kitune-san seems to have found it! :)

Im very surprised that only PKUNZIP was having trouble as the problem with the BIU appears to have been related to word accesses so you would think many applications would also be failing!
Maybe there are other apps failing for that, I'm testing games and some of them freeze the system. Also some games with intros, trainers etc... do not work.
dmckean
Posts: 310
Joined: Sat Jan 16, 2021 7:03 am
Has thanked: 396 times
Been thanked: 95 times

Re: MiSTer PCXT

Unread post by dmckean »

It probably makes sense to try to debug all those games that freeze or have errors to search for similar issues.
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 »

Nice work with the debuggin :) I have noticed Castle Master freezes whether I launch it with CGA or Tandy and given how its a 3D game, I suspect it might use whatever it is PKUNZIP uses for unpacking, to do some 3D math stuff. I have not begun doing much debugging yet in games as I am still trying things out, and I think most games work and a few just wont run because they cannot see any mouse and wont run without one. I have thought about maybe finding a mouse emulator for DOS. Pretty sure that existed. I have not been able to find one yet though... problem is DOS and emulator as search terms does not have mouse emulators coming up at the top... So I will probably have to find some collections of DOS tools that might have one hidden there.
breiztiger
Top Contributor
Posts: 468
Joined: Sun May 24, 2020 7:17 pm
Has thanked: 35 times
Been thanked: 99 times

Re: MiSTer PCXT

Unread post by breiztiger »

yes that exist but only in textmode
Attachments
kme_beta.zip
(3.29 KiB) Downloaded 202 times
CPC-Power Staff
flynnsbit
Top Contributor
Posts: 552
Joined: Sun May 24, 2020 8:07 pm
Has thanked: 185 times
Been thanked: 310 times
Contact:

Re: MiSTer PCXT

Unread post by flynnsbit »

TDL Extraction and auto creation of a PC Booter disk is working great now. For those games that require a floppy boot, you need to create yourself an empty floppy on the mister first:

Code: Select all

cd/media/fat/games/PCXT
serdrive -n 1.44MB floppy.img
then go mount that floppy in the core and reboot. Both A and B will be the same floppy so either should work.

Then TDL will auto extract the .img file
Auto Format to the right diskette size, then use IMG2DSK to apply the .img for you to the floppy.

Then just reboot and select A on the XT-IDE menu. You can also go make a copy of floppy.img and name it whatever game you just created like MS Flightv2.img

I should be able to make this process simpler with MyMenu later but if you have one of the XT vhd's I've referenced before this should work well.

@spark, way down your list, but if you could pass that serdrive command above and have it create an empty floppy container then people wouldn't have to drop to the mister console or ssh in to create them. Just a nice to have.
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 »

How is the new bios setup supposed to work? I can get Tandy to boot, but I cannot get any PCXT rom to boot. They all just fail to find a boot drive. I tried with both C and A. It does not help that the bios page is bugged and does not show what you have actually selected.

But I can see during boot that it does find the IBM and Jukost bios. But then it fails to find any boot drive. I tried switching roms, saving settings and reboot the core. I am running the new core released today (29th of August) with the MiSTer Main nightly release, the one that had gotten AO486 FDD support reverted from 26th of August.

I will try the latest official release again.

That said, I tried Castle Master with the new core and Tandy, and it did not seem to fix Castle Master, that game still freezes. The Area5150 demo though seems much better. It still has some graphics issues early on. Its like the last line of the text has the wrong offset or something. I figured this has to do with the Tandy bios, because when I run Volkov Commander with the Tandy bios, it has horizontal lines going all the way down the screen for each... ascii line I guess you can call it. So it might be a thing for all of Tandy that the last line of each character is bugged in some way.

The demo still crashed at the end but I wanted to try to see if the IBM bios or one of the other PCXT bioses might work better with the text issue. The demo crashed at the Doom Cacodemon monster and space invader graphics screen.

Would be nice if the Git readme would be updated to explain exactly how to setup bioses now. Or maybe there is a PCXT issue with the core... or maybe I just did something wrong. The Python scripts might have been updated. I ran the demo at 14mhz. Not sure if the problem with running it at the 4mhz got fixed? I read a post about this demo showing that the 4mhz speed option would show how it was a bit too slow for this core with this demo and that would cause some problems for it. Certainly looks good at a higher speed although it does run too fast. Looks near perfect I think until it crashes somewhere between 5 and 7 minutes into the demo.

update:
Did some more testing. Seems one thing that confused me was the PCXT bios. It still only seems to use the ROM file called PCXT.ROM no matter what you select in the BIOS GUI. I also think the issue with it not booting any drives is some bug with the settings for the core. Not sure what causes it, but when it happens I just seem to go through the settings and redo them all and ensure they are set a certain way. Then save the settings and reboot the core. I even reset all the the settings then did this. It was not enough to even power off the mister for a few seconds and reboot. The settings kept lingering somehow where the core was unable to see any boot drives. No drive C or A. Might be a problem coming from how I have been testing several different MiSTer Main and different PCXT core versions.

I got the Juko ST bios to run and the IBM one. The Area 5150 still has those graphics errors on the first part with the text and the mixed text and graphics. Also it still crashes for me around the Doom monster. I tried with 7mhz in case the problem with the 14mhz. I have not tried with 4mhz yet. The one that should be the original PCXT speed as I understand it?

One of the settings I changed to get disks booting again was the speed of the HDD, I guess it might have switched to the lowest setting without showing it. I read somewhere that the lowest setting does not work with the current IDE bios?
User avatar
pgimeno
Top Contributor
Posts: 710
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 277 times
Been thanked: 226 times

Re: MiSTer PCXT

Unread post by pgimeno »

spark2k06 wrote: Mon Aug 29, 2022 1:07 pm

Code: Select all

DI=FFFF -> LES BX,[DI] -> ES = 3322, BX = 00FF (Core PCXT, PCEm, Micro8088)
Not that it matters anymore, but that 00 doesn't make much sense.

Just to show the power of symdeb, here's a script to perform the test:

Code: Select all

>nul
a 100
les bx,[di]
int 3

* Set DS to skip over the PSP and the LES + INT3 instructions
* Also to ensure the last bytes are past the stack
rds ds+20
e 0 11 22 33
e fffc c8 d8 e8 f8
e (ds+1000):0 5a 5b 5c 5d
rdi fffc; g=100; >fffc.txt ; ?es:bx; >nul
rdi fffd; g=100; >fffd.txt ; ?es:bx; >nul
rdi fffe; g=100; >fffe.txt ; ?es:bx; >nul
rdi ffff; g=100; >ffff.txt ; ?es:bx; >nul
q
If the file is named test.sd you can run it with: symdeb < test.sd

It generates four files: fffc.txt, fffd.txt, fffe.txt and ffff.txt which you can concatenate with a copy command: copy fffc.txx+fffd.txt+fffe.txt+ffff.txt results.txt

Here's the output with DOSBOX-X (after setting CPU to 8086):

Code: Select all

F8E8:D8C8h  00106748  (1075016)  ".."
5AF8:E8D8h  00069858  (432216)  ".."
5B5A:F8E8h  0006AE88  (437896)  ".."
335B:11F8h  000347A8  (214952)  ".."
This seems to imply that my (oldish) copy of DOSBOX-X is broken in its emulation of LDS/LES wraparound. That, or things are different for 8086 vs 8088 (it doesn't support 8088).
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 »

Not that it matters anymore, but that 00 doesn't make much sense.
It matters :) I agree that the results do not look 100% right, even though PKUNZIP is happier with the result.

Can we run this test one more time? The MCL86 results should exactly match the real 8088 and PCEM which uses the same algorithm I do.

One thing I noticed is that the PCXT BIU does not have the same amount of delay at the end of the state machine between bytes of a word as my original BIU does so maybe this needs to be increased. I also suggest trying both 4.77Mhz and your Turbo mode to see if they both yield the same results.
DI=FFFF -> LES BX,[DI] -> ES = 3322, BX = 00FF (Core PCXT, PCEm, Micro8088)
I believe the 0x00FF is a typo and was probably 0x11FF for all cores.
DI=FFFD -> LES BX,[DI] -> ES = 5AFF, BX = EEDD (Core PCXT)
DI=FFFD -> LES BX,[DI] -> ES = 11FF, BX = EEDD (PCEm, Micro8088)
This result is more troubling. There definitely should not be a 0x5A for the last(upper) byte fetched by the MCL86. I dont see how this is possible unless there is a new bug in the PCXT BIU.

I also suggest adding another byte to memory so that the last test case has real data and not 0x0:

DS:0000. 11
DS:0001. 22
DS:0002. 33. <--- add this
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 »

flynnsbit wrote: Mon Aug 29, 2022 9:55 pm TDL Extraction and auto creation of a PC Booter disk is working great now. For those games that require a floppy boot, you need to create yourself an empty floppy on the mister first:

Code: Select all

cd/media/fat/games/PCXT
serdrive -n 1.44MB floppy.img
then go mount that floppy in the core and reboot. Both A and B will be the same floppy so either should work.

Then TDL will auto extract the .img file
Auto Format to the right diskette size, then use IMG2DSK to apply the .img for you to the floppy.

Then just reboot and select A on the XT-IDE menu. You can also go make a copy of floppy.img and name it whatever game you just created like MS Flightv2.img

I should be able to make this process simpler with MyMenu later but if you have one of the XT vhd's I've referenced before this should work well.

@spark, way down your list, but if you could pass that serdrive command above and have it create an empty floppy container then people wouldn't have to drop to the mister console or ssh in to create them. Just a nice to have.
I will try this out and see if I can get rid of disk read errors this way. I hope it works :)
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 seems to imply that my (oldish) copy of DOSBOX-X is broken in its emulation of LDS/LES wraparound. That, or things are different for 8086 vs 8088 (it doesn't support 8088).
The 8088 and 8086 share the same EU core, so they are both the same CPU with only difference being the BIU.

Lots of cores implement LDS/LES incorrectly. :) They just add 0x2 to the linear address, sometimes for words and for LDS/LES.

The way to architect an x86 core is to make it a fully 16-bit processor with the segment registers and linear addresses handled in the BIU as they are not accessible or used in the EU.
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 »

Ohh, I tried running the Area5150 demo again. This time using the IBM bios and the boot disk I shared earlier. It frees up 626kb conventional memory. Not sure if that helps or not. But I set the core to 4.77mhz, and the disk speed to 460800. Also not sure if that is relevant. While I did boot from a floppy the demo was still on the HDD.

I will have to try the serdrive tool to create a HDD image tomorrow to see if maybe the errors in the demo might be disk read errors that cause them. That could explain why they seem inconsistent. But this time I got past the UFO. After that the graphics went a bit crazy... but I waited a while and the demo actually gave the exit text "Thank you for dropping by at...". So I guess it did not crash, the last graphics part just did not seem to work.

Seems promising though. I will test some more tomorrow.

Other things I was using this time to run the core: It was the latest release of the PCXT core and the latest nightly release of the MiSTer Core. The latest nightly MiSTer release is from the 26th and the latest PCXT core was from today, the 29th of August. I was using the latest method of creating the IBM bios, the one in the updated Python script, so it does not include the XTIDE IDE bios, but only the IBM bioses combined into one as shown in the updated Python script.
User avatar
spark2k06
Core Developer
Posts: 876
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 969 times

Re: MiSTer PCXT

Unread post by spark2k06 »

flynnsbit wrote: Mon Aug 29, 2022 9:55 pm @spark, way down your list, but if you could pass that serdrive command above and have it create an empty floppy container then people wouldn't have to drop to the mister console or ssh in to create them. Just a nice to have.
It's not worth spending effort on that, @kitune-san is working hard on floppy drive support based on ao486, and by then it would be work for nothing.
Caldor wrote: Mon Aug 29, 2022 10:20 pm The demo still crashed at the end but I wanted to try to see if the IBM bios or one of the other PCXT bioses might work better with the text issue. The demo crashed at the Doom Cacodemon monster and space invader graphics screen.
Avoid using UMB and EMS in CONFIG.SYS, and disable EMS in the OSD. With this, the 8088MPH and Area5150 demos should go all the way to the end.... and of course, set to 4.77MHz.
Caldor wrote: Mon Aug 29, 2022 10:20 pm One of the settings I changed to get disks booting again was the speed of the HDD, I guess it might have switched to the lowest setting without showing it. I read somewhere that the lowest setting does not work with the current IDE bios?
The default speed of 115200 should not be used, as it will not recognise the images, and the maximum speed of 921600 is only valid for 14.318MHz, at other CPU speeds it will not recognise the images... I think the current README of the project already explains these points correctly, as well as how to generate the ROMs with the scripts. When you set a speed, don't forget to save the configuration to have it for the next core boot.
pgimeno wrote: Mon Aug 29, 2022 10:25 pm Not that it matters anymore, but that 00 doesn't make much sense.
MicroCoreLabs wrote: Mon Aug 29, 2022 10:45 pm It matters :) I agree that the results do not look 100% right, even though PKUNZIP is happier with the result.
MicroCoreLabs wrote: Mon Aug 29, 2022 10:45 pm I believe the 0x00FF is a typo and was probably 0x11FF for all cores.
They were all typos, this was the only discrepancy of MCL86 from a real PCXT and PCEm:
spark2k06 wrote: Mon Aug 29, 2022 1:07 pm You're right, now I get 22, did I look at it wrong? I don't know, but with pgimeno's suggestion, the results now would be like this... I still have to try the modification you send:
pgimeno wrote: Mon Aug 29, 2022 12:25 pm This should have been DS+1000 instead of DS+1 (all four times). And also DS:0002 = 33 for the last test.

Code: Select all

DI=FFFC -> LES BX,[DI] -> ES = FFEE, BX = DDCC (Core PCXT, PCEm, Micro8088)

DI=FFFD -> LES BX,[DI] -> ES = 5AFF, BX = EEDD (Core PCXT)
DI=FFFD -> LES BX,[DI] -> ES = 11FF, BX = EEDD (PCEm, Micro8088)

DI=FFFE -> LES BX,[DI] -> ES = 2211, BX = FFEE (Core PCXT, PCEm, Micro8088)

DI=FFFF -> LES BX,[DI] -> ES = 3322, BX = 00FF (Core PCXT, PCEm, Micro8088)

But by correcting it @kitune-san, everything is fine... with the test plan prepared by @pgimeno, now the three environments return the same result, so in principle, there would be nothing more to fix:
test.png
test.png (6.61 KiB) Viewed 17563 times
Thanks @pgimeno for this symdeb script, this debug clone really has potential ;)
MicroCoreLabs wrote: Mon Aug 29, 2022 10:45 pm I also suggest trying both 4.77Mhz and your Turbo mode to see if they both yield the same results.
Same result for any CPU speed, now always works fine ;-)
User avatar
NightShadowPT
Posts: 224
Joined: Mon May 25, 2020 9:56 am
Has thanked: 5 times
Been thanked: 12 times

Re: MiSTer PCXT

Unread post by NightShadowPT »

I have asked a similar question on the AO486 core, but since this core is being actively developed, here it goes:

Is it possible to connect a USB floppy drive to the MiSTer and use it within the core? If not, is it somewhere on the roadmap?

Asking because floppies do play a big role on my nostalgia, despite being an unreliable media at best.

In any way, thanks a lot for all the work put into the development of this core. Being able to play games from my first computer is great!
User avatar
spark2k06
Core Developer
Posts: 876
Joined: Sat Jun 06, 2020 9:05 am
Has thanked: 409 times
Been thanked: 969 times

Re: MiSTer PCXT

Unread post by spark2k06 »

NightShadowPT wrote: Tue Aug 30, 2022 5:02 am I have asked a similar question on the AO486 core, but since this core is being actively developed, here it goes:

Is it possible to connect a USB floppy drive to the MiSTer and use it within the core? If not, is it somewhere on the roadmap?

Asking because floppies do play a big role on my nostalgia, despite being an unreliable media at best.

In any way, thanks a lot for all the work put into the development of this core. Being able to play games from my first computer is great!
I'm glad you like the core. Right now it's not a priority, there's a long way to go before that, like not relying on serdrive at all.

However, even if it is possible to do what you are proposing, I think there would be limitations. USB floppy drives are not exactly the same as the original ones with controller, in the sense that (it seems to me) they don't access the boot sectors correctly, and therefore the PCBooter games wouldn't work.
User avatar
NightShadowPT
Posts: 224
Joined: Mon May 25, 2020 9:56 am
Has thanked: 5 times
Been thanked: 12 times

Re: MiSTer PCXT

Unread post by NightShadowPT »

spark2k06 wrote: Tue Aug 30, 2022 5:15 am I'm glad you like the core. Right now it's not a priority, there's a long way to go before that, like not relying on serdrive at all.

However, even if it is possible to do what you are proposing, I think there would be limitations. USB floppy drives are not exactly the same as the original ones with controller, in the sense that (it seems to me) they don't access the boot sectors correctly, and therefore the PCBooter games wouldn't work.
To be honest at this point just getting the floppy to work (even without the PCBooter games) would already be a win :D

I'll be following closely the development of the core and enjoying my childhood memories.

Thanks again.
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 »

spark2k06 wrote: Tue Aug 30, 2022 4:46 am
Caldor wrote: Mon Aug 29, 2022 10:20 pm The demo still crashed at the end but I wanted to try to see if the IBM bios or one of the other PCXT bioses might work better with the text issue. The demo crashed at the Doom Cacodemon monster and space invader graphics screen.
Avoid using UMB and EMS in CONFIG.SYS, and disable EMS in the OSD. With this, the 8088MPH and Area5150 demos should go all the way to the end.... and of course, set to 4.77MHz.
Ahh, nice :) I will give this a try, and see if there are games that might run better this way as well.
spark2k06 wrote: Tue Aug 30, 2022 4:46 am
Caldor wrote: Mon Aug 29, 2022 10:20 pm One of the settings I changed to get disks booting again was the speed of the HDD, I guess it might have switched to the lowest setting without showing it. I read somewhere that the lowest setting does not work with the current IDE bios?
The default speed of 115200 should not be used, as it will not recognise the images, and the maximum speed of 921600 is only valid for 14.318MHz, at other CPU speeds it will not recognise the images... I think the current README of the project already explains these points correctly, as well as how to generate the ROMs with the scripts. When you set a speed, don't forget to save the configuration to have it for the next core boot.
Yes, I do know to ensure to save and all of this. It just seems that sometimes some settings suddenly change when I switch between different releases of the core and / or MiSTer Main, and it then leaves some of the settings changed without showing that in the UI. After testing quite a bit I suspect the setting it does change is the HDD speed. Maybe because it reverts to default, and then still just shows the speed I used before.
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 »

NightShadowPT wrote: Tue Aug 30, 2022 5:27 am
spark2k06 wrote: Tue Aug 30, 2022 5:15 am I'm glad you like the core. Right now it's not a priority, there's a long way to go before that, like not relying on serdrive at all.

However, even if it is possible to do what you are proposing, I think there would be limitations. USB floppy drives are not exactly the same as the original ones with controller, in the sense that (it seems to me) they don't access the boot sectors correctly, and therefore the PCBooter games wouldn't work.
To be honest at this point just getting the floppy to work (even without the PCBooter games) would already be a win :D

I'll be following closely the development of the core and enjoying my childhood memories.

Thanks again.
Did you try the symlink method? If you go to the Linux prompt on the MiSTer after connecting a USB floppy drive, you should be able to make a symlink to the floppy drive and if you then name that symlink something like floppydrive.img and place it in the PCXT or AO486 folder you should be able to mount that file in either of the cores and access whatever floppy is active in the drive. It probably still has some issues, since the controller in the core wont be the same as the controller for the USB drive... and I do not know if it can work with a bootable floppy.

I have not tried it myself yet, but I have read it being suggested a few times. If I test it myself, and it works for me, I will make a video about it.

Update:
Ah, seems to not be without issues. Flynnsbit wrote about his test of the symlink method. I guess for this to work fully, it will need support from the core and probably MiSTer Main and even then it might not be a good solution.
viewtopic.php?p=59252#p59252
Post Reply