The BIOS has been modified to avoid initial errors, now it shows the PCjr splash screen but the keyboard doesn't work and it doesn't boot from a previously mounted floppy drive:
I have carried out the following patches on the original PCjr BIOS to bypass various errors up to this point:
PCJR BIOS FAILS HERE (IN THIS CASE IT IS NORMAL BECAUSE WE ARE MODIFYING THE BIOS)
F000:08C9 jz short f15a_0 ; continue if no error
F000:08CB mov dl, 2
F000:08CD call err_beep
F000:08D0 err_wait: ; CODE XREF: F000:08D7j
F000:08D0 mov ah, 0
F000:08D2 int 16h ; KEYBOARD - READ CHAR FROM BUFFER, WAIT IF EMPTY
F000:08D2 ; Return: AH = scan code, AL = character
F000:08D4 cmp ah, 1Ch
F000:08D7 jnz short err_wait
F000:08D9 jmp short f15c
IF WE SKIP THIS LOOP THAT WAITS FOR A KEY TO BE PRESSED, IT JUMPS DIRECTLY TO THE BASIC ROM, WITH THE KEYBOARD NOT WORKING... EVEN IF THERE IS A FLOPPY IMAGE MOUNTED, IT SEEMS TO IGNORE IT AND JUMPS TO THE BASIC ROM
The complete list of the disassembled PCjr BIOS can be found here:
It would be interesting to run this BIOS to enjoy various PC booters games in Tandy video mode, which are only displayed on this particular model of PC, and not in Tandy 1000:
The games determined by the system they were running on by checking the PC identifier byte at F000:FFFE, which was FF for a PC, FD for a PCjr., FE for an early XT and all PC Portables, FB for a later XT, F9 for a PC Convertible and FC for an AT and XT/286.
Keyboard - The IBM PCjr.'s keyboard is basically compatible with the PCs, although not as easy to use due to the fewer keys and the chiclet arrangement. However, with Fn key combinations it is possible to generate all the keystrokes of the PC keyboard. The Tandy 1000's keyboard interface came from the less-than-PC compatible Tandy 2000, and while compatible at the BIOS Int 16 level, there are real differences on how the keyboards work at the hardware level. Games bypassing the BIOS routines may fail to recognize keyboard input.
Re: IBM PCjr BIOS in PCXT Core
Posted: Tue Oct 25, 2022 10:57 am
by spark2k06
jordi wrote: ↑Tue Oct 25, 2022 7:29 am
Interesting!
There was this article that showed the differences
The games determined by the system they were running on by checking the PC identifier byte at F000:FFFE, which was FF for a PC, FD for a PCjr., FE for an early XT and all PC Portables, FB for a later XT, F9 for a PC Convertible and FC for an AT and XT/286.
Keyboard - The IBM PCjr.'s keyboard is basically compatible with the PCs, although not as easy to use due to the fewer keys and the chiclet arrangement. However, with Fn key combinations it is possible to generate all the keystrokes of the PC keyboard. The Tandy 1000's keyboard interface came from the less-than-PC compatible Tandy 2000, and while compatible at the BIOS Int 16 level, there are real differences on how the keyboards work at the hardware level. Games bypassing the BIOS routines may fail to recognize keyboard input.
Thanks for the information, for now, I will try duplicating the floppy access in 3F0h-3F5h and F0h-F5hI/O ports, and see what happens.
Re: IBM PCjr BIOS in PCXT Core
Posted: Tue Oct 25, 2022 11:53 am
by spark2k06
I've already made the change and tried it, but no luck... it doesn't boot from the floppy either, it goes straight to the BASIC ROM:
jordi wrote: ↑Tue Oct 25, 2022 7:29 am
Keyboard - The IBM PCjr.'s keyboard is basically compatible with the PCs, although not as easy to use due to the fewer keys and the chiclet arrangement. However, with Fn key combinations it is possible to generate all the keystrokes of the PC keyboard. The Tandy 1000's keyboard interface came from the less-than-PC compatible Tandy 2000, and while compatible at the BIOS Int 16 level, there are real differences on how the keyboards work at the hardware level. Games bypassing the BIOS routines may fail to recognize keyboard input.
Here is a more detailed description of pcJr keyboard handling:
"On the PCjr the Non-Maskable Interrupt (NMI) of the 8088 is used instead of IRQ 1 as on the IBM PC."
jordi wrote: ↑Tue Oct 25, 2022 7:29 am
Keyboard - The IBM PCjr.'s keyboard is basically compatible with the PCs, although not as easy to use due to the fewer keys and the chiclet arrangement. However, with Fn key combinations it is possible to generate all the keystrokes of the PC keyboard. The Tandy 1000's keyboard interface came from the less-than-PC compatible Tandy 2000, and while compatible at the BIOS Int 16 level, there are real differences on how the keyboards work at the hardware level. Games bypassing the BIOS routines may fail to recognize keyboard input.
Here is a more detailed description of pcJr keyboard handling:
"On the PCjr the Non-Maskable Interrupt (NMI) of the 8088 is used instead of IRQ 1 as on the IBM PC."
This has important implications, especially in relation to serdrive, if we ever use it with this BIOS, as the use of floppy and PC booters could be sufficient in principle, and for the rest, use Tandy 1000:
The leading edge of the start bit from the keyboard signals the NMI on the 8088. When the NMI occurs the PCjr jumps to a routine to start reading the incoming data stream from the keyboard. Interrupts are disabled during this time so any hardware event that requires service in 4.8 milliseconds to avoid an overrun condition might experience an overrun.
This explains why the PCjr can not reliably transfer data using the serial port at high speed:
However, I wonder whether this is really critical for the normal functioning of the BIOS or whether the fact that we also use IRQ 1 is transparent.
Re: IBM PCjr BIOS in PCXT Core
Posted: Tue Oct 25, 2022 1:41 pm
by kitune-san
PCJr cannot use PCXT keyboard controller.
Re: IBM PCjr BIOS in PCXT Core
Posted: Tue Oct 25, 2022 2:30 pm
by kitune-san
In PCXT, keyboard input was buffered in the shift register.
However, in PCJr, the data signal is input directly to 8255.
If we want to implement it in MisterPCXT... we will need to create a converter.
Re: IBM PCjr BIOS in PCXT Core
Posted: Tue Oct 25, 2022 2:55 pm
by spark2k06
kitune-san wrote: ↑Tue Oct 25, 2022 2:30 pm
In PCXT, keyboard input was buffered in the shift register.
However, in PCJr, the data signal is input directly to 8255.
If we want to implement it in MisterPCXT... we will need to create a converter.
It seems like it would take a lot of work, maybe in the future it could be assessed. We would only gain another small catalogue of PCjr exclusive Tandy 320x200 16 colour games, I don't think much more... so I don't know if it's worth the effort.
kitune-san wrote: ↑Tue Oct 25, 2022 2:30 pm
In PCXT, keyboard input was buffered in the shift register.
However, in PCJr, the data signal is input directly to 8255.
If we want to implement it in MisterPCXT... we will need to create a converter.
It seems like it would take a lot of work, maybe in the future it could be assessed. We would only gain another small catalogue of PCjr exclusive Tandy 320x200 16 colour games, I don't think much more... so I don't know if it's worth the effort.
Anyway, thanks for the information!
From the historical point of view the support of PCJr would be a HUGE think, even if the catalogue is small.. In meantime, THANKS for your EXCELLENT work! I'm enjoying using PCXT core on my MiSTer!
Re: IBM PCjr BIOS in PCXT Core
Posted: Tue Oct 25, 2022 4:56 pm
by bbond007
kitune-san wrote: ↑Tue Oct 25, 2022 2:30 pm
In PCXT, keyboard input was buffered in the shift register.
However, in PCJr, the data signal is input directly to 8255.
If we want to implement it in MisterPCXT... we will need to create a converter.
spark2k06 wrote: ↑Tue Oct 25, 2022 2:55 pm
It seems like it would take a lot of work, maybe in the future it could be assessed. We would only gain another small catalogue of PCjr exclusive Tandy 320x200 16 colour games, I don't think much more... so I don't know if it's worth the effort.
We can't just alter the pcJr BIOS's keyboard ISR?
I guess there might be some stuff that reads the pcJr's keyboard directly without using the BIOS. I wonder how common that is...
Re: IBM PCjr BIOS in PCXT Core
Posted: Tue Oct 25, 2022 5:04 pm
by spark2k06
bbond007 wrote: ↑Tue Oct 25, 2022 4:56 pm
We can't just alter the pcJr BIOS's keyboard ISR?
My philosophy in this core is not to alter BIOS code to avoid maintenance, let alone proprietary code. The alteration I have made so far is only on a test level.
Re: IBM PCjr BIOS in PCXT Core
Posted: Tue Oct 25, 2022 11:03 pm
by bbond007
spark2k06 wrote: ↑Tue Oct 25, 2022 1:26 pm
This has important implications, especially in relation to serdrive, if we ever use it with this BIOS, as the use of floppy and PC booters could be sufficient in principle, and for the rest, use Tandy 1000:
I was also considering that, however, I'd also guess that the XTIDE BIOS probably is aware of the FIFO in a 16550 UART so was not quite sure if it would be a factor or not...
spark2k06 wrote: ↑Tue Oct 25, 2022 1:26 pm
This has important implications, especially in relation to serdrive, if we ever use it with this BIOS, as the use of floppy and PC booters could be sufficient in principle, and for the rest, use Tandy 1000:
I was also considering that, however, I'd also guess that the XTIDE BIOS probably is aware of the FIFO in a 16550 UART so was not quite sure if it would be a factor or not...
Well seen.
Re: IBM PCjr BIOS in PCXT Core
Posted: Thu Oct 27, 2022 2:03 am
by Malor
If the games are still calling into the BIOS for service routines, not being PCJr versions might not matter. You possibly could fool some games by just changing to the PCJr ID byte, rather than implementing the entire hardware and BIOS.
That may also blow up spectacularly, if the programs try to twiddle the hardware directly without using the BIOS.
Interesting BIOS, it works perfectly. I will make reference to it in the README of the project, thanks!
GLaBIOS.png (122.86 KiB) Viewed 7904 times
Re: IBM PCjr BIOS in PCXT Core
Posted: Sun Oct 30, 2022 10:08 pm
by MicroCoreLabs
For the PCjr experiment is there any way to insert a CTL-ALT-INS which, after the splash screen, begins the internal diagnostics. It will display a menu and memory count at the top the screen which would be interesting to see.
Re: IBM PCjr BIOS in PCXT Core
Posted: Mon Oct 31, 2022 5:31 am
by spark2k06
MicroCoreLabs wrote: ↑Sun Oct 30, 2022 10:08 pm
For the PCjr experiment is there any way to insert a CTL-ALT-INS which, after the splash screen, begins the internal diagnostics. It will display a menu and memory count at the top the screen which would be interesting to see.
I can see from the 86Box emulator that a lot of diagnostics can be done:
test_pcjr.png (2.52 KiB) Viewed 7786 times
However, as the keyboard does not work, it is not possible to do CTRL-ALT-INS... and even if I skip this step and manage to enter, I will not be able to enter any of the tests, because the keyboard is needed for it
Re: IBM PCjr BIOS in PCXT Core
Posted: Tue Nov 01, 2022 8:43 am
by Caldor
I think I saw that Alleycat has a special color theme for the PCjr. Not sure how many games have special PCjr support though.
This article goes into it. There does seem to be... well... more than 10 games? That have PCjr specific enhancements without having Tandy support as an alternative: http://nerdlypleasures.blogspot.com/202 ... usive.html
Certainly could be interesting to see support for it at some point. I still have plans to do a video of this core, but have not gotten around to it. Got sidetracked by new VR hardware and the C64OS and games.
Re: IBM PCjr BIOS in PCXT Core
Posted: Tue Nov 01, 2022 2:17 pm
by jordi
Caldor wrote: ↑Tue Nov 01, 2022 8:43 am
I think I saw that Alleycat has a special color theme for the PCjr. Not sure how many games have special PCjr support though.
This article goes into it. There does seem to be... well... more than 10 games? That have PCjr specific enhancements without having Tandy support as an alternative: http://nerdlypleasures.blogspot.com/202 ... usive.html
Certainly could be interesting to see support for it at some point. I still have plans to do a video of this core, but have not gotten around to it. Got sidetracked by new VR hardware and the C64OS and games.
You should check tandycat patch which is mostly creating this alleycat version on the tandy.