• Please review our updated Terms and Rules here

Victor 9000 'Emulator' ?

Oh, and I used https://github.com/drdpj/V9000HDTools to "inject" the .exe I built into my hard disk image.

Attached is the test case, plus Makefile to build it with Linux, and copy it into the hard disk image. I forget the steps to install OpenWatcom, I just remember it being somewhat annoying. You only need the variant that generates 16-bit / 8086 binaries.
 

Attachments

Recently I made some experiments with the UCSD pSystem by TDI on the MAME emulation of the Victor 9000.

Everything works quite well, but I am not sure, whether it is possible to redirect the serial interfaces rs232a or rs232b on a Windows system to either a hardware port or simply to a plain file for pure output purposes (I would like to be able to send a hex dump of a file to the host).

I tried options like
-rs232a null_modem
or
-rs232a pty
but I am not sure whether and which additional options could be used to redirect I/O.
The -bitb option with TCP/IP seems to be unavailable in this implementation.

Any hints?

Martin
 
Can you use printer port in Pascal? That's much easier to capture (assuming that it's fully emulated) -- use "-prin log.prn" option.
 
I haven't tried it in UCSD p-System, but in DOS 3.1 I was able to get the mame rs232 output working. I booted mame with the command line
`./mame victor9k -ramsize 896K -hard victor.chd -rs232a null_modem -bitbanger ./serial_a.log`

with the bold part configuring the serial port a to output to the serial_a.log file. Then once inside DOS I have my config.bat file have an entry `clst \dev\seriala` to configure the default printer as serial A. Then I ran portset to configure the bit rate and set it like `portset A 9600 None 1 8`. Then I could output to the file like `type config.sys > SERIALA` and I would see the output inside the serial_a.log file referenced on the mame command line.
 
Thank you!

When I try this command (in my case I use 1 hard disk, 2 floppy disk drives)

D:\MAME>act victor9k -w -ramsize 512k -harddisk vichd.img -flop1 "TDI P-System - TDI P-System.img" -flop2 "EMPTY.img" -rs232a null_modem -bitbanger ./serial_a.log

I obtain an warning message,

Unable to load image './serial_a.log': No such file or directory (generic:2)

but MAME creates an empty file with the given name. If the file exists, this message is not displayed.

If I then use the pSystem Filer to T(ransfer some file to REMOUT: ("remote output" corresponds to the Victor's serial interface) this file indeed grows in size, so something happens.
After the transfer, the size of the file seems to be correct.
Unfortunately, the file contains nothing but NULL bytes and the transfer takes a rather long time (which is acceptable). .

If it works under DOS this seems to be a problem with the UCSD pSystem resp. its usage of the ports. Using the pSystem's CONFIG.CODE module I configured the serial port for different baud rates (300...9600), no parity, no handshake but this did not make a difference.

Or: my MAME is outdated (0.277 LLP64).
 
The
If it works under DOS this seems to be a problem with the UCSD pSystem resp. its usage of the ports. Using the pSystem's CONFIG.CODE module I configured the serial port for different baud rates (300...9600), no parity, no handshake but this did not make a difference.

Or: my MAME is outdated (0.277 LLP64).
Whatever baud rate you configure within the Victor machine has to match what mame thinks is the baud configuration. If you go into the mame menu->slot devices->rs232a you can see the configuration like below:
Screenshot 2025-09-11 at 6.37.15 AM.png


Also, I was able to get the centronics port working by adding to the command line:
Code:
-centronics printer -prin centronics_out.prn
 
@Martin Hepperle I just ran the config.code and set the baud rate to 9600 to match my mame configuration. It didn't ask about stop bits or parity. I was able to get a text file to transfer to remout: successfully after changing the baud. When I tried to transfer a .code file I got a mix of binary and text that had the pascal in the text portion. I don't know much about p-system but it seemed like it was working.
 
@Martin Hepperle I just ran the config.code and set the baud rate to 9600 to match my mame configuration. It didn't ask about stop bits or parity. I was able to get a text file to transfer to remout: successfully after changing the baud. When I tried to transfer a .code file I got a mix of binary and text that had the pascal in the text portion. I don't know much about p-system but it seemed like it was working.
I guess you are running MAME on Linux?

I am trying it on Windows and so far I had no luck producing usable output. I can create a serial output file, but I always see it accumulating only NULL bytes.
Trying the printer output I only receive a short file of two NULL bytes, even if I try to copy a larger file.

I am quite sure that I myself am the problem, not MAME. So far we were not able to become best friends but I am trying to improve our relation.

And yes, a .CODE module in the UCSD pSystem starts with an interface declaration part which is partially readable text, followed by the actual implementation in binary.
If you transfer .TEXT files these will start with a 1KB binary prefix followed by the text part. The text will have a binary sequence at the start of each line (starting with DLE followed by a byte count) which were used to compress leading spaces. All UCSD files are padded to 512 byte blocks.
 
I guess you are running MAME on Linux?
I'm running it on macOS, which is closer to Linux than it is to Windows. I'm running version 0.280 if that helps. I've struggled over the years to figure out mame. It's a complicated little program.

The .CODE format you describe matches what I'm seeing on the output.
 
So: I was able to install and run a current version of mame under the wsl (Linux subsystem with Ubuntu installation) under WIndows.
Using the DOS diskettes I could do a copy filename PRN: to obtain the desired file in the centronics printer file.

Trying again under the completely separate installation under pure Windows (without Linux subsystem) suddenly also worked.
Replacing the MS-DOS diskette images with the UCSD system diskettes and copying a file to PRINTER: did not produce any output.

Trying the same on Windows' Linux subsystem (transferring a file to PRINTER: under UCSD) also did not produce any output.
At least consistent between Linux and MS-DOS hosts.

Next I will give the serial interface another try but so far I have not found how to adjust the baud rate in mame.
 
Next I will give the serial interface another try but so far I have not found how to adjust the baud rate in mame.
I adjusted the baud rate in p-system using the config program and was able to get the output in mame. I believe you configure the baud rate for mame in the victor9k.cfg file inside the cfg directory. This section:

Code:
<input>
  <keyboard tag=":kb" enabled="1" />
  <port tag=":rs232a:printer:RS232_RXBAUD" type="CONFIG" mask="255" defvalue="7" value="4" />
  <port tag=":rs232a:printer:RS232_STOPBITS" type="CONFIG" mask="255" defvalue="1" value="2" />
  <port tag=":rs232a:pty:RS232_RXBAUD" type="CONFIG" mask="255" defvalue="7" value="4" />
  <port tag=":rs232a:pty:RS232_STOPBITS" type="CONFIG" mask="255" defvalue="1" value="2" />
  <port tag=":rs232a:pty:RS232_TXBAUD" type="CONFIG" mask="255" defvalue="7" value="4" />
</input>

I wasn't familiar with what the values should be, that's why I went the route of making p-system match mame rather than the other way around.
 
Phew - it worked. Thank you for your help.
After adding the rs232 definitionlines to my input block I was able to copy files from the UCSD system to a file (after running CONFIG).
In my case eventing is a bit cumbersome as I am using a German keyboard and quite a few of the Victor keys are in surprising places.

Anyway, this is sufficient to export a few of the BASIC and FORTRAN files and compare them with other version IV files I have for the HP-87/87.

Ah...too early: a simple T(ransfer to REMOUT: seems to convert binary 0x0A to 0x0D/0x0A pairs so I have to write small hex dump witing to REMOUT.
 
Last edited:
This primitive hex dumper can be used to write binary files to e.g. REMOUT:
If you don't want to write a decoder, the center columns can be copied and pasted into a HEX editor (like HxD64 on Windows) for recreating the binary file.

Attached are some files which might be interesting. They should also run under other implementations of pSystem version IV.

Code:
(*
  Simple UCSD File HEX Dump Program
 
  Dumps the blocks of a file with leading offset
  and trailing checksum byte.
 
  Martin Hepperle, 2025
*)

Program DumpFile;

Type
  String2 = String[2];
  Byte    = 0..255;
  Nibble  = 0..15;
  Buffer  = Packed Array[0..511] of Char;
 
  BytePack = Packed Record
    Case Integer of
      0 : (b : Byte);
      1 : (n0 : Nibble; n1 : Nibble);
  End;
 
  WordPack = Packed Record
    Case Integer of
      0 : (w : Integer);
      1 : (n0 : Nibble; n1 : Nibble; n2 : Nibble; n3 : Nibble);
  End;

Var
  fOut : Text;
  fIn  : File;
  fileName  : String;
  outDevice : String;
  aByte : BytePack;
  aWord : WordPack;
  HexDigit : Packed Array[0..15] of Char;
  daBuffer : Buffer;
  addr, blk, i, col, iRet, csum : Integer;

Begin
  HexDigit := '0123456789ABCDEF';
 
  (* the name of the file to dump *)
  fileName := 'FILL.TEXT';
 
  (* write the dump to this device*)
  outDevice := 'REMOUT:';
  outDevice := 'CONSOLE:';


  WriteLn('Dumping ',fileName,' to ',outDevice);
 
  Reset(fIn,fileName);
  Rewrite(fOut,outDevice)
         
  WriteLn(fOut,'*FILE:',fileName);
 
  blk  := 0;
  addr := 0;
 
  While Not Eof(fIn) Do
  Begin
 
    iRet := BlockRead(fIn,daBuffer,1,blk);
    blk := Succ(blk);
 
    If iRet = 1 Then
    Begin
      col  := 0;
      csum := 0;
  
      (* first row *)
      aWord.w := addr;
      Write(fOut,':',HexDigit[aWord.n3],HexDigit[aWord.n2],
                     HexDigit[aWord.n1],HexDigit[aWord.n0],':');
  
      For i:=0 to 511 Do
      Begin
        aByte.b := Ord(daBuffer[i]);
        Write(fOut,HexDigit[aByte.n1],HexDigit[aByte.n0]);
        (* add and mask lower byte *)
        csum := csum + aByte.b;
    
        col := Succ(col);
    
        (* 32 bytes per row *)
        If col = 32 Then Begin
          (* UCSD style: mask lower byte of checksum *)
          aByte.b := Ord(Odd(csum) And Odd(255));
          WriteLn(fOut,':',HexDigit[aByte.n1],HexDigit[aByte.n0]);
       
          col  := 0;
          csum := 0;
          addr := addr + 32;
       
          If i < 511 Then
          Begin
            (* prepare start of next row *)
            aWord.w := addr;
            Write(fOut,':',HexDigit[aWord.n3],HexDigit[aWord.n2],
                           HexDigit[aWord.n1],HexDigit[aWord.n0],':');
          End;
        End; (* if col = 32 *)
      End; (* For i := 0 *)
    End; (* If iRet = 1 *)
  End; (* While *)
 
  WriteLn(fOut,'*EOF*');
 
  Close(fIn);
 
  Close(fOut);

End.
 

Attachments

Last edited:
This old thread has got quite nicely revived!
:)
Thanks for the interesting discussion which led me to trying at least to get a HDD version of the MAME V9K (Ver. 0.280) emulation running.

So far I reached this goal from two ends, using Westveld's image, which worked fine and creating a 'blank' image by pdevine's command
./chdman createhd --output victor_60.chd --hunksize 4096 --chs 695,5,17
Running the usual utilities (FACTORYF, etc.) did not bring any success up to now. I started the emulation with:
./mame victor9k -ramsize 896K -hard victor_60.chd
So far I could not make any use of it, I am sure I am missing a step or a command and appreciate any help.

I anyone has a >10MB HDD Image to share, I'll appreciate this as well! :-)

Best,

Martin.
 
If anyone has a >10MB HDD Image to share, I'll appreciate this as well! :-)
Hi Martin,
Here's a 256MB one. The assignment is:
a: 10MB boot disk from the HD
b: left floppy drive 1
c: right floppy drive 2
d: 246MB remainder of the hard drive

I've installed English DOS 3.1 on disk a: along with some other utilities.
 

Attachments

Many thanks @pdevine !

I tried your image and was able to boot it. Once I was in DOS, I ran SHOWSTAT and this showed me the full size of 3800 cylinders / 8 Heads / 17 Sectors @ 512byte/sector equals your huge Hard disk of 256MB, very impressive!
What I've got in the emulation was drive A:\ => 10 MB, Floppy drives B:\&C:\ and drive D:\ => 19MB, please see Screenshot.

Any hints on this?

Thanks in advance!
 

Attachments

  • IMG_7083.jpeg
    IMG_7083.jpeg
    60.9 KB · Views: 5
Back
Top