etabeta's playground

MESS & MAME wip

MESS how to, episode I: IBM PC Jr.

without comments

First of this series about “How to emulate old home computers in MESS”, is the IBM PCJr. If you have never heard about this system, you would better spend next 5 minutes to read the correspondent Wikipedia and old-computers.com pages (more links at the bottom of the page).

The system has probably been a quite interesting beast back in the early 80s, with its graphics capabilities which extended the IBM PC CGA, its 3-voice sound chip from TI, its two cartridge slots and its built-in joystick ports. Too bad I’ve never been able to see one directly.

However, the reason I started from this system, it’s because MESS is pretty well capable of emulating the PC Jr., thanks to the wonderful work judge has done on the driver.

Hence, let assume we have dumped the proper BIOS required by MESS and that we have collected some software to be used with this machine, and let’s fire up MESS!

First of all, let’s take a look at which media are supported for this specific machine, i.e. let’s run

mess ibmpcjr -listmedia

and look at the output… mmm, there are 3 printers (which we will forget about for the moment, since I’m not sure how printer emulation works exactly in MESS :blush: ), one tape drive (“cassette (cass)“), two floppy drives (“floppydisk1 (flop1)” & “floppydisk2 (flop2)“) and two cartridge slots (“cartridge1 (cart1)” & “cartridge2 (cart2)“) to play with!! good!

Notice that -listmedia also lists all the file extensions that are supported for each media, so that we more or less know already which media has to be used for the various files we have found. However, we will come back to this pretty soon.

Now, it’s almost time to start the emulator. But first, let’s remember that we are going to emulate a computer, hence a few things have to be kept in mind:

  • If we want to use the usual MAME/MESS interface (i.e. TAB to access the menu, ESC to leave, P to pause, Insert to speed-up emulation, etc.) we need to press ScrlLock. This will switch MESS from fully emulated keyboard (where e.g. P only prints a P on screen, and does not pause the emulation) to partially emulated keyboard (where P also pauses emulation)
  • MESS offers Natural Keyboard mode and Emulated keyboard mode: say in our keyboard “Shift+0” gives a “=” symbol instead of a “)” like on a IBM PC Jr; then in Natural mode, by pressing “Shift+0” we would simply get a “=”, while in Emulated mode we would get a “)” as if pressing “Shift+0” on the IBM PC Jr. Both modes can be useful in certain moments, so keep in mind that we can switch between the two by entering the TAB menu and choosing Keyboard Mode.

Ok, we are ready to start. Let’s launch

mess ibmpcjr

and here we are: the good old IBM logo is there awaiting for us
pcjr_1

with a counter in the bottom-right corner which is an internal test for the available RAM. MESS emulates a PC Jr. with 640KB of RAM, so we have to wait until the system finds this amount. A few seconds (you can always speed up emulation by pressing ScrollLock, to enable UI keys, and then Insert, to actually fast-forward emulation), and we are rewarded with this screen:
pcjr_2

What?!? “Error B”?!? oh well, it’s a keyboard related problem and we can simply ignore it for now (sometimes it does not even show up). Let’s press Enter and go on 😉

pcjr_3

let’s wait for some time (the fast-forward trick with Insert is handy once more), and here we are with the IBM BASIC Prompt

pcjr_4

at this point we can either write our own basic program, or we can decide to try some of the games and programs which can be found floating in the web. Let’s start with some carts: either access the File Manager in the TAB menu and load the cart you want to try, or restart emulation with

mess ibmpcjr -cart1 "C:\my_cart_folder\game.jrc"

(replace “game” with the name of the file you have, zipped images are fine as well) and see what happens…

IBM logo, Error B, Press Enter and… wow, the cart loads and the game starts (CrossFire in this case)!

pcjr_5 pcjr_6

mmm, joystick does not work (it seems to stick to Left), but Keyboard works pretty fine! I,J,K,L to move and E,S,D,F to fire. Simple game and simple commands, but not bad.
Other game carts work pretty much the same, they load automatically and they use simple controls: either I,J,K,L or Keypad 8,4,6,2 used for moving the character and some action button that you can usually find around the F key, or the Spacebar.

Mine Shaft
pcjr_7 pcjr_8

Mouser
pcjr_9 pcjr_10

Pitfall II
pcjr_9 pcjr_10

and the BASIC cart, which is the main reason why we have two cart slots: one for the BASIC cart and one for a cart porgram which requires BASIC.
pcjr_11

Unfortunately, I haven’t been able to make Color Paint work, so I’m not sure how well the two slots work in MESS.

What now? mmm… tapes? MESS supports .wav files for the cassette media, but I have none. so I cannot really test them (I think there exists at least a BASIC version on tape, and maybe some Utility program as well… I will probably try to save some BASIC program on tape, one of these days, and we will see how it works out)

So let’s skip cassettes, for now. What else? Floppies!! Back to command line, we start

mess ibmpcjr -flop1 "C:\my_floppy_folder\game.dsk"

(replace “game” with the name of the file you have, zipped images are fine as well) and see what happens…

IBM logo, Error B, Press Enter and… wow, floppies load as well and the game starts! In this case, King Quest for the PC Jr. fires up in all his magnificence
pcjr_12 pcjr_13
pcjr_14

Too bad the main character ends up at the far left corner of the screen and does not move (the Joystick problem again?)

MS Flight Simulator is another old game which supported PC Jr.

pcjr_15 pcjr_16

I don’t seem to have more PC Jr. floppies, so let’s see what other PC Jr. files can be found in the ‘net… .BAS and .EXE files…

.EXE cannot be used: we would need to create a blank floppy disk, to insert this executable (possibly together with some Disk Operating System to make the disk boot) and finally to load it in MESS in the hope it works. While this might be possible with some tool like WinImage, it’s definitely beyond the scope of this “How to” guide and will (maybe) be covered in a future episode. For now, let’s forget .EXE as well.

What are .BAS files, then? If you open them with a text editor, you find out they are the BASIC listing of some program. Then we can use them in MESS!!

Start again MESS without any media and reach the BASIC prompt. Ok, now we can write down the BASIC program! But how to avoid typing mistakes? And what if there are thousand of lines of code? Wait, don’t give up, we can use the Paste command of MESS: let’s simply Copy from the text editor the BASIC lines and Paste them in the emulated system by using Shift+ScrlLock.

pcjr_17

It’s a bit strange to see the text getting written without any input from you, but it’s definitely better than typing each character one by one 😉
Mind that it can be safer to split large amounts of text into smaller chunks and paste them separately.

However, after the BASIC listing has been copied, just type run

pcjr_18

and it works! (as long as the program is compatible with your version of BASIC 😉 )

Is that all, folks? No!
You might have noticed that when we examined the -listmedia output, there were many formats supported for the floppy drives (some with exotic extensions like .d88). Why is that?

Simply because Micko has recently done an astounding work cleaning up floppy emulation in MESS. As a result, we now support, directly in the core, most raw disk format (from Teledisk, to CQM disks, etc.) and therefore all systems using a floppy controller are capable of reading all those formats and of looking for data they recognize.

But then, hey, maybe we can give a try to .img and .dsk files available for IBM PC compatible machines… and indeed, many bootable disks (cough… TOSEC bootable disks collection.. cough…) properly boots in the IBM PC Jr. driver!

pcjr_19 pcjr_20
pcjr_21 pcjr_22
pcjr_23 pcjr_24
pcjr_25 pcjr_26
pcjr_27 pcjr_28

of course, titles requiring more memory or other graphic modes (EGA etc.) won’t work, but there are enough compatible titles to keep an user busy for some time…

Some more PCJr. links

http://www.brutman.com/PCjr/
http://www.oldskool.org/shrines/pcjr_tandy
http://www.digibarn.com/collections/devices/pcjr-chicklet-keyboard/index.html



Written by etabeta

April 9th, 2010 at 9:13 am

Posted in MESS

Leave a Reply

You must be logged in to post a comment.