Image Map Image Map
Results 1 to 8 of 8

Thread: IBM PCjr demo + source code + howto

  1. #1

    Default IBM PCjr demo + source code + howto

    Hi,

    A few months ago, we released a demo for the IBM PCjr called "64k ought to be enough".
    The demo runs in any PCjr including the 64Kb RAM-only version[*]. The challenge was to write a demo for the slowest PC ever [**]

    The demo contains 3 parts and in the end we jump to the "easter egg"... which jumps to the PCjr keyboard-test routine from BIOS + injecting some keystrokes in the keyboard buffer.

    There is nothing "super technical" besides trying to make sure it runs smooth... the whole demo relies on intel 'string' functions in order to try to make thing faster.
    The demo has its own boot loader in order to save precious RAM, and uses standard BIOS calls for disk access.
    Not sure whether it is possible to load data from disk and play music at the same time on the PCjr (we haven't even tried that in the demo)... but could be a nice challenge for the next one.


    Video of the demo here:
    https://www.youtube.com/watch?v=uakDpJns9LA
    (captured from composite... if you run it using RGBI output it looks better)

    Binaries here:
    http://pungas.space/pvm-64ko.zip

    Source code here:
    https://gitlab.com/ricardoquesada/pcjr-flashparty-2018

    Technical explanation here:
    https://retro.moe/2018/09/26/64k-ram...-for-the-pcjr/
    [*]: If you run it in the 64Kb-RAM, there is a bug with certain graphics that we couldn't fix. But runs Ok on the 128-KB RAM version... and the 128KB RAM is as slow as the 64KB RAM.
    [**]: The PCjr, if it has more than 128KB RAM, and the code is placed above the 128KB, is as fast as the IBM 5150... but if the code runs within the first 128KB RAM (like this demo) it could be up to 2.6 times slower than the IBM 5150.

  2. #2
    Join Date
    Mar 2011
    Location
    Atlanta, GA, USA
    Posts
    1,285

    Default

    I always appreciate Peanut love. Thanks for sharing!
    "Good engineers keep thick authoritative books on their shelf. Not for their own reference, but to throw at people who ask stupid questions; hoping a small fragment of knowledge will osmotically transfer with each cranial impact." - Me

  3. #3

    Default

    Quote Originally Posted by riq View Post
    if the code runs within the first 128KB RAM (like this demo) it could be up to 2.6 times slower than the IBM 5150.
    I wonder how this compares to the Sanyo MBC-550, which has an 8088 running at 3.58 MHz. It's not fully IBM PC compatible, but runs MS-DOS and an optional add-in card for it is compatible with CGA at the hardware level (it even has "snow"!):

    https://www.seasip.info/VintagePC/sanyo.html

  4. #4

    Default

    Quote Originally Posted by vwestlife View Post
    I wonder how this compares to the Sanyo MBC-550, which has an 8088 running at 3.58 MHz. It's not fully IBM PC compatible, but runs MS-DOS and an optional add-in card for it is compatible with CGA at the hardware level (it even has "snow"!):

    https://www.seasip.info/VintagePC/sanyo.html
    Interesting. First time that I hear of this computer. My guess is that the Sanyo is still faster the the PCjr. Running at 3.58Mhz is only 25% slower than the PCjr (CPU only). And assuming that the Sanyo has a real CGA card (one with its own RAM), then it won't have the "CPU/Video card wait-state" issues that the PCjr has, and overall, it should be faster than the PCjr.

  5. #5
    Join Date
    Mar 2011
    Location
    Atlanta, GA, USA
    Posts
    1,285

    Default

    Jr still runs at 4.77 MHz. Just the added CPU waits during low memory access caused by the video's ASICs higher priority access make the overall base 128K RAM speed slower. JRCONFIG.SYS will allocate the rest of RAM through 128K to prevent DOS from loading transient portions there including programs. That speeds normal processing up to be on-par with a 5150 - assuming your memory is expanded to 640 or 768 KB. But video RAM access is still a lot slower than a CGA card in a real 5150.

    I've rewritten some of the logic ROMs before on my Jr to disable on-board memory from 0-128K and back-fill it with a JR-IDE board. It runs a lot faster overall, allows running of MS-DOS 6.22, a full 128KB of dedicated video RAM, and other benefits. But the Jr had an aliasing problem with the B8000 CGA window. The upper 16KB at BC000 mirrored the lower 16KB at B8000. And 320x200x16 color, it's marquee mode, is 32KB per page! So you could not get a full frame at B8000. Thus most PCJr 'Enhanced Color Graphics' programs directly accessed their frame buffer in the 0, 1, 2, and 3 segments rather than the CGA window. When Tandy cloned it, they fixed the aliasing problem. But back-filling faster memory into 0-128K will break most PCJr games - which defeats the point. A machine as fast as a 5150 with 768 KB usable RAM, but incompatible with most of it's unique software.

    -Alan
    "Good engineers keep thick authoritative books on their shelf. Not for their own reference, but to throw at people who ask stupid questions; hoping a small fragment of knowledge will osmotically transfer with each cranial impact." - Me

  6. #6

    Default

    Quote Originally Posted by eeguru View Post
    Thus most PCJr 'Enhanced Color Graphics' programs directly accessed their frame buffer in the 0, 1, 2, and 3 segments rather than the CGA window
    A machine as fast as a 5150 with 768 KB usable RAM, but incompatible with most of it's unique software.

    -Alan
    Yes, the "uniqueness" of the PCjr is one of the things that I like most about it. As you said, it allows you to have four 32kB pages, or eight pages if you use the 16Kb video modes... you can use them for animations and stuff like that. Not sure whether that is possible on Tandy.

  7. #7
    Join Date
    Mar 2011
    Location
    Atlanta, GA, USA
    Posts
    1,285

    Default

    Quote Originally Posted by riq View Post
    As you said, it allows you to have four 32kB pages, or eight pages if you use the 16Kb video modes...
    Technically 3 and 6 respectively. Unless you hack the machine like I did and break compatibility, the vector table, BDA, DOS bootstrap, and other non-relocatable things will prevent the first few pages from being used.
    "Good engineers keep thick authoritative books on their shelf. Not for their own reference, but to throw at people who ask stupid questions; hoping a small fragment of knowledge will osmotically transfer with each cranial impact." - Me

  8. #8

    Default

    yes, I know what you mean (technically you still have 4 and 8, but usable without garbage are only 3 and 7).

    And by any chance, do you know anything about the "odd/even memory address" in high density video modes (the 32Kb ones)? I want to disable that feature so that I can use high-density video modes in 64k RAM only machines. I'm aware that perhaps the machine might not have the performance to drive 32Kb buffers with this "hack", but I still want to try it.

    This is the bug that I've been trying to fix for a while. The demo runs on a PCjr with only 64K RAM, but when the demo displays the high-res video modes, it tries to fetch the "odd memory address" values from a non-mapped region.
    I read the schematics but I couldn't find out how to fix it. I guess I will need to install something on the memory-expansion port to prevent this "odd/even memory addressing" thing.
    I tried to disable it from software, but I couldn't.
    Thanks.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •