Starting a PCjr coding project, need advice

Discussions on programming older machines

Re: Starting a PCjr coding project, need advice

Postby Brutman » Sat Sep 06, 2008 7:13 am

The NEC adapters are rebadged Trantors. Get the Trantor drivers for DOS and they will handle removable disks, hard disks and CD-ROMs. I'm not sure if the link that Jim posted gives you the entire driver suite or not, but they are readily available from driver-guide.

Does DOSbox know about the PCjr video? Does it accurately emulate the machine, right down to the strange use of IRQ5?

On the timer - I'll answer a question with a question. How does the PC handle the floppy drive motor?

If you've got the tech ref you should be able to read the diskette sections to see if it is setting up the timer explicitly before turning on the motor. That will answer the question definitively.
Brutman
Site Admin
 
Posts: 919
Joined: Sat Jun 21, 2008 5:03 pm

Re: Starting a PCjr coding project, need advice

Postby Trixter » Sat Sep 06, 2008 1:33 pm

Brutman wrote:The NEC adapters are rebadged Trantors. Get the Trantor drivers for DOS and they will handle removable disks, hard disks and CD-ROMs. I'm not sure if the link that Jim posted gives you the entire driver suite or not, but they are readily available from driver-guide.


Good to know, thanks.

Does DOSbox know about the PCjr video? Does it accurately emulate the machine, right down to the strange use of IRQ5?


Not sure, so that's why I'm going to write a short program that demonstrates all oddities on a real PCjr and then shop it around.

On the timer - I'll answer a question with a question. How does the PC handle the floppy drive motor?
If you've got the tech ref you should be able to read the diskette sections to see if it is setting up the timer explicitly before turning on the motor. That will answer the question definitively.


I only have the PC techref in pdf, I'll have to find it. PCjr techref I own. I have no idea how the motor turns off on PC, I never looked into it ;-)
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 506
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Re: Starting a PCjr coding project, need advice

Postby Trixter » Tue Nov 18, 2008 10:04 am

Okay, so I've halfway decided to use a Tandy 1000 as the development platform for my PCjr project, simply because it has a hard drive. ZIP on PCjr works, but is impractical for development work because of the speed (I tested around 5-11KB/s writing using palmzip). However, this opens up a new can of worms, mainly what new pitfalls I could run into. PC vs. PCjr differences are obvious; Tandy 1000 vs. PCjr is subtle.

Here's what I've been able to find out; I'm still somewhat unclear on how the Tandy 1000 handles video ram "stealing" from main memory, but I think this is accurate:

  • The PCjr could only route one of four sources to the RCA audiojack: 8253 beeper, 76489 3-voice, cassette input port, and a second I/O port (meant for peripherals like the speech adapter). Tandy 1000, however, routed both 8253 and 76489 to the output jack (as well as the built-in speaker). This means that the Tandy has the additional ability to play both 8253 and 76489 simultaneously through the RCA jack.
  • The PCjr has a status bit for monitoring vertical retrace, but lacks the bit to monitor the status of horizontal retrace. The Tandy 1000, just like CGA/EGA/VGA, can monitor horizontal retrace.
  • The PCjr has a hardware interrupt that fires at the beginning of vertical retrace, hardware IRQ 5. (Nice!) Except for EGA, everything else on the PC (Tandy 1000 included) lacks a hardware vertical retrace interrupt.
  • The PCjr can physically dedicate up to 128KB RAM for video pages on 16K boundaries, however the first 16K is impractical to use for this purpose because the interrupt and BIOS table have data there (you can switch to that area if you like, and see static "noise" including some pixels constantly changing due to the time-of-day word counter updating, etc.). The Tandy 1000, as far as I can tell, has no such limitation, and you could theoretically burn 256KB maintaining 8 320x200x16 video pages.

If I'm missing something else, could someone let me know?
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 506
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Re: Starting a PCjr coding project, need advice

Postby Brutman » Tue Nov 18, 2008 9:59 pm

I haven't looked into the audio support on the Jr much. Are you getting your information from the Tech Ref? If so, that is definitive.

The video memory on the PCjr is going to be a little goofy compared to the Tandy. The VGA (Video Gate Array) on the PCjr will route memory references from B8000 to BFFF0 to the correct physical memory in the first 128K as selected by the registers, but only the first 16KB of memory gets routed. Instead of making memory references to the normal CGA range it's probably less confusing to find the real memory addresses and hit them directly. I don't know how the Tandy handles the video memory, other than it is source from the top end of the memory map so there are no holes or collisions with the interrupt and BIOS RAM areas.

Jrs are also missing some video modes that Tandy machines have, and there is a well known 'Tandy' modification to add that support to the Jr. Be sure to use PCjr supported modes unless you want to do the mod. I think there is also a mod to enable some Tandy sound changes on the Jr, but I'm not as familiar with it and I'd have to do some research.

There are differences in the keyboard handling, but your demo probably doesn't care about the keyboard so that is not an issue.

You are just out of luck on mass storage ... A demo on this machine will favor something cpu and graphics intensive that can be represented compactly.

Mike
Brutman
Site Admin
 
Posts: 919
Joined: Sat Jun 21, 2008 5:03 pm

Re: Starting a PCjr coding project, need advice

Postby Trixter » Tue Nov 18, 2008 11:13 pm

Brutman wrote:I haven't looked into the audio support on the Jr much. Are you getting your information from the Tech Ref? If so, that is definitive.


Yep, all from the tech ref and also a great book called IBM Pcjr Assembler Language by David C. Willen.

The video memory on the PCjr is going to be a little goofy compared to the Tandy. The VGA (Video Gate Array) on the PCjr will route memory references from B8000 to BFFF0 to the correct physical memory in the first 128K as selected by the registers, but only the first 16KB of memory gets routed. Instead of making memory references to the normal CGA range it's probably less confusing to find the real memory addresses and hit them directly. I don't know how the Tandy handles the video memory, other than it is source from the top end of the memory map so there are no holes or collisions with the interrupt and BIOS RAM areas.


The techref notes that only 16K is mapped; the Assembler book definitely says you need to write to lower memory. It's the only way to do 32K modes anyway.

Jrs are also missing some video modes that Tandy machines have, and there is a well known 'Tandy' modification to add that support to the Jr. Be sure to use PCjr supported modes unless you want to do the mod. I think there is also a mod to enable some Tandy sound changes on the Jr, but I'm not as familiar with it and I'd have to do some research.


The Tandy 1000 has no more modes than the PCjr does; I think the hardware graphics mod was to change how the PCjr maps memory because you can use more than 128K for Tandy, I'm pretty sure. As for the sound mod, I think all it is is hard-wiring both the 8253 beeper and 3-voice chip to the same output so that you can hear both through the PCjr monitor. Normally, you can only route beeper OR 3-voice. Tandy routes everything to the output jack so a lot of games don't bother to set the PCjr routing bits, and you hear zilch.

There are differences in the keyboard handling, but your demo probably doesn't care about the keyboard so that is not an issue.


I'll disable the keyboard if it gains me an interrupt! IRQ 1 isn't needed for DMA timing on PCjr, but it's used to de-serialize the keyboard data. If I disable it I can use it for whatever I like, but I can probably kiss my chances of using the keyboard goodbye until the next reboot.

You are just out of luck on mass storage ... A demo on this machine will favor something cpu and graphics intensive that can be represented compactly.


I don't want mass storage for RUNNING the demo, I want mass storage for BUILDING the demo. Since my compiler+editor+debugger is 440K it won't even fit onto a single disk :-( so I will have to use another machine to build it, hence the discussion. I still intend to write a small test program for DOSBox to see what that does; if the emulation is good enough, I may just use DOSBox for a theoretical 486-class-speed PCjr to develop on ;-)

The target for the demo is, at most, two 360KB disks. As for memory, I'm not sure; while it would be kick-ass to target 128KB, I don't think that's doable this first round. I have two PCjrs, one that is 640K + NEC V20 and another that is 384KB+8088. I think the second one is more representative of what people might have (ie. 8088 and around 256KB RAM after jrconfig and dos) so that is probably what I will build for.
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 506
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Re: Starting a PCjr coding project, need advice

Postby Vorticon » Fri Dec 11, 2009 6:37 pm

Since your last post, have you started your project? Did you eventually settle on a programming language?
I personally cut my programming teeth on the TI 99/4A which I still actively program, and on that platform Basic was really not a solid option for heavy duty projects given the double interpreted nature of Basic on the TI and hence its slowness.I tried small c and p-code but both were limited, and settled eventually on TMS9900 assembly with my first project being a planetarium program (tigameshelf.net/edu.htm). I am actually working on a wargame currently.
After obtaining my PCjr just about 6 months ago, the first thing I tried was cartridge Basic, and was amazed at the graphic capabilities of the PCjr, and I promptly programmed 2 short programs displaying the chaotic behavior of a couple of equations graphically. Speed, while much faster than TI Basic, was still an issue for calculation intensive processes, so I am now re-acquainting myself with Turbo Pascal (version 5.5). As an exercise, I will be converting a Pi calculation program I wrote in TI Extended Basic which calculates up to 5200 decimals of Pi (and takes over 3 days to do so!) to Pascal and compare performance.
From there, I intend to familiarize myself with 8088 machine language and see what I can come up with...
On that subject, is the Turbo Assembler a better platform than Macro Assembler?

Walid
Vorticon
 
Posts: 276
Joined: Fri Nov 27, 2009 7:25 am

Re: Starting a PCjr coding project, need advice

Postby Trixter » Sat Dec 12, 2009 2:36 pm

Vorticon wrote:Since your last post, have you started your project? Did you eventually settle on a programming language?


Yes, Turbo Pascal 7. I coded it on a Tandy 1000 TX and then tested on PCjr. You can download the result here: ftp://ftp.oldskool.org/pub/misc/HRN-TTRO.ZIP

If you'd like a copy of my Tandy 1000 TX hard drive: ftp://ftp.oldskool.org/pub/misc/tanfiles.rar
It has all of my programming environment, source code, lots of games, and other helpful stuff.

On that subject, is the Turbo Assembler a better platform than Macro Assembler?


MASM 6.0 and later is pretty good but I'm not sure if it supports 16-bit targets or compilation; it is freely available so give it a shot. Turbo Assembler had some great stuff in its IDEAL mode but it's obviously not maintained any more. A86 is a great tiny assembler that can directly produce .com and .obj files without needing a linker, and is shareware (16-bit version and all docs are freely available). A86 is great for small standalone projects. Finally, there's NASM which is very community-supported.
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 506
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Re: Starting a PCjr coding project, need advice

Postby Vorticon » Fri Dec 18, 2009 9:49 pm

Nicely coded demo...
Vorticon
 
Posts: 276
Joined: Fri Nov 27, 2009 7:25 am

Previous

Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron