• Please review our updated Terms and Rules here

NABU PC Emulation under MAME

I can't get a disk to successfully format using the Disk Utilities:
1. made floppy disk: dd if=/dev/zero of=nabu_floppy.dsk bs=1024 count=200
2. added following: -option 1 fdc -flop1 nabu_floppy.dsk

I'm using the 4K BIOS as I couldn't figure out how to consistently get the 8K BIOS working.

see attachment for error on verify.

Sincerely,

Jeffery Stone
Yes, for some reason the verify stage keeps failing. However the disk does get formatted if you do a hexdump -C on the image it should be all e5 now. You can restart the machine and run check from the disk utilies menu and all tracks will be verified. You should also now be able to use it to save basic programs.
 
I also use a mech board - but mine's a full 104. Wouldn't have it any other way.
 
Yes, for some reason the verify stage keeps failing. However the disk does get formatted if you do a hexdump -C on the image it should be all e5 now. You can restart the machine and run check from the disk utilies menu and all tracks will be verified. You should also now be able to use it to save basic programs.
Thanks. I was able to verify the following will save to disk: basic, nabu writer and nabu filer.

I'm really impressed with nabu writer (many options if you look at the help).

Sincerely,

Jeffery Stone
 
I can't get a disk to successfully format using the Disk Utilities:
1. made floppy disk: dd if=/dev/zero of=nabu_floppy.dsk bs=1024 count=200
2. added following: -option 1 fdc -flop1 nabu_floppy.dsk
I did create a floppy image, but when I try to start the nabu.cmd with this additional option it doenst know this option.
So where should I add it or has the MAME-version to be compiled for accepting this option?

C:\nabu-mame_16122022\nabu-mame>mame nabupc -window -kbd nabu_hle -hcca null_modem -bitb socket.127.0.0.1:5816 -option 1 fdc -flop1 nabu_floppy.dsk

Error: unknown option: -option
 
Since the keybindings of individual computer systems often conflict with mame UI key bindings, mame provides a way to enable or disable those UI key bindings. I think the default key for that is insert. If you press insert you should see a message come up about UI controls either being enabled or disabled. When they are enabled you should be able to press F3 to restart the machine.
on "insert" it show AUTO 0/10 110% (CPU-Speed Info?)
The UI-Toogle is on my keyboard when you press "scroll-lock"
And of courde - TAB for UI Menu
 
I did create a floppy image, but when I try to start the nabu.cmd with this additional option it doenst know this option.
So where should I add it or has the MAME-version to be compiled for accepting this option?

C:\nabu-mame_16122022\nabu-mame>mame nabupc -window -kbd nabu_hle -hcca null_modem -bitb socket.127.0.0.1:5816 -option 1 fdc -flop1 nabu_floppy.dsk

Error: unknown option: -option
Remove the space, it should be -option1
 
There is a routine in the ROM at 065d if my memory serves... It uses a table to do a CRC. To get the two bytes that go at the end of the packet you xor the CRC up to that point with 0xffff and the result of that will give you the two bytes to go at the end of the packet.


Has code for packetizing a undecorated .NABU (segment) file. I haven't deciphered the .npak files the DJ's tool uses, they appear to be scrambled or encrypted, and it was easier to simulate the nabu side of the comms and pull all the packets that way.

Try this for the .npak files in "NABU Segments.zip" (tested on latest version, make sure OUTPUTFOLDER exists):
Python:
#!/usr/bin/env python3

import sys
import hashlib

from Crypto.Cipher import DES
from Crypto.Util import Padding

DESKEY=bytes((0x6e, 0x58, 0x61, 0x32, 0x62, 0x79, 0x75, 0x7a))
DESIV=bytes((0x0c, 0x15, 0x2b, 0x11, 0x39, 0x23, 0x43, 0x1b))

INPUTFOLDER="NoSSLSoYouCanFindThisEasily/"
OUTPUTFOLDER="pakfiles/"

for i in range(1, 0x1000):
    segnum = "{0:06X}".format(i)
    hashstr = hashlib.md5((segnum + "nabu").encode('utf-8')).hexdigest().upper()
    hashstr = "-".join([hashstr[i:i+2] for i in range(0, len(hashstr), 2)])
    try:
        with open(INPUTFOLDER + hashstr + ".npak", "rb") as fh:
            with open(OUTPUTFOLDER + segnum + ".pak", "wb") as outf:
                cipher = DES.new(DESKEY, DES.MODE_CBC, iv=DESIV)
                data = cipher.decrypt(fh.read())
                data = Padding.unpad(data, 8)
                print(segnum + ": " + str(len(data)) + " bytes")
                outf.write(data)
    except FileNotFoundError:
        pass
 
Remove the space, it should be -option1
That did work ;)
With only a Floppy in A: inserted the verify didnt work, but after putting also a floppy in B: the format/verify worked on both drives...after some resets I could also save in BASIC ;)
 

Attachments

  • NABU_Verify_OK.jpg
    NABU_Verify_OK.jpg
    134.6 KB · Views: 10
Try this for the .npak files in "NABU Segments.zip" (tested on latest version, make sure OUTPUTFOLDER exists):
Python:
#!/usr/bin/env python3

import sys
import hashlib

from Crypto.Cipher import DES
from Crypto.Util import Padding

DESKEY=bytes((0x6e, 0x58, 0x61, 0x32, 0x62, 0x79, 0x75, 0x7a))
DESIV=bytes((0x0c, 0x15, 0x2b, 0x11, 0x39, 0x23, 0x43, 0x1b))

INPUTFOLDER="NoSSLSoYouCanFindThisEasily/"
OUTPUTFOLDER="pakfiles/"

for i in range(1, 0x1000):
    segnum = "{0:06X}".format(i)
    hashstr = hashlib.md5((segnum + "nabu").encode('utf-8')).hexdigest().upper()
    hashstr = "-".join([hashstr[i:i+2] for i in range(0, len(hashstr), 2)])
    try:
        with open(INPUTFOLDER + hashstr + ".npak", "rb") as fh:
            with open(OUTPUTFOLDER + segnum + ".pak", "wb") as outf:
                cipher = DES.new(DESKEY, DES.MODE_CBC, iv=DESIV)
                data = cipher.decrypt(fh.read())
                data = Padding.unpad(data, 8)
                print(segnum + ": " + str(len(data)) + " bytes")
                outf.write(data)
    except FileNotFoundError:
        pass
Oh hey cool, thanks for sharing.
 
I haven't been able to determine how to configure mame to always use a specific ROM file. I found the "Machine Configuration -> BIOS Size" setting, which has the two options of 4K and 8K, and my selection seems to persist when restarting mame. The "BIOS Selection" setting provides two options, "4k BIOS" and "8k BIOS - Floppy support", which does not seem to persist (if I select the 8k option and then select "Reset", mame will reset with that ROM, but it always reverts to the 4k ROM when starting mame).

No doubt I'm doing something wrong. Also, I have numerous ROM files... is there a way to have more than the two options in the "BIOS Selection" setting (perhaps via the config file)?
 
I haven't been able to determine how to configure mame to always use a specific ROM file. I found the "Machine Configuration -> BIOS Size" setting, which has the two options of 4K and 8K, and my selection seems to persist when restarting mame. The "BIOS Selection" setting provides two options, "4k BIOS" and "8k BIOS - Floppy support", which does not seem to persist (if I select the 8k option and then select "Reset", mame will reset with that ROM, but it always reverts to the 4k ROM when starting mame).

No doubt I'm doing something wrong. Also, I have numerous ROM files... is there a way to have more than the two options in the "BIOS Selection" setting (perhaps via the config fi
Yeah mame always uses the default rom, for the nabu this is the 4k one, you can start the machine with a given bios with the following cli option when running mame "-bios <name>" for the 8k rom <name> would be revb. There also might be a ini config file setting for it but i just add the cli option when starting mame.
 
Yeah mame always uses the default rom, for the nabu this is the 4k one, you can start the machine with a given bios with the following cli option when running mame "-bios <name>" for the 8k rom <name> would be revb. There also might be a ini config file setting for it but i just add the cli option when starting mame.
@labomb
I missed the second part of your question, but no to add more bios options the need to be added to mame in the code. I have done that locally on my test system, but haven't uploaded the changes yet.

It might be possible to place one of the two exsiting bios roms with one of the newer ones, I think mame will complain about checksums not matching, but will still load the ROM. I'll update my repo with the full set of roms later today.
 
Thank you, and I'm looking forward to the update.

For now, I keep getting the error 'invalid BIOS "roms/nabupc/NabuPC-U53-90020060-RevB-2764.bin", reverting to default', or similar with any rom image I try. The full command line is:

Code:
mame nabupc -window -kbd nabu_hle -hcca null_modem -bitb socket.192.168.168.16:5816 -bios "roms/nabupc/NabuPC-U53-90020060-RevB-2764.bin" -option1 fdc -flop1 "disks/nabupc/LEO2_USER_W_VC_BOOT.dsk"
 
Thank you, and I'm looking forward to the update.

For now, I keep getting the error 'invalid BIOS "roms/nabupc/NabuPC-U53-90020060-RevB-2764.bin", reverting to default', or similar with any rom image I try. The full command line is:

Code:
mame nabupc -window -kbd nabu_hle -hcca null_modem -bitb socket.192.168.168.16:5816 -bios "roms/nabupc/NabuPC-U53-90020060-RevB-2764.bin" -option1 fdc -flop1 "disks/nabupc/LEO2_USER_W_VC_BOOT.dsk"
The bios option does not take the path to the bios rom. it takes the name of the rom as known by mame. For the the 8k rom this just revb, while the 4k is called reva.

Code:
MAME BIOS Options
"-bios reva"  - This is for the 4k rom
"-bios revb"  - This is for the 8k rom
 
Interesting find(s) - for me - about Floppy formating and verify:
- FORMAT & VERIFY does (for me) only work when I in the first place format Drive B: and then Drive A:

If I try to format Drive A: after a Restart the NABU in MAME does format, but can not verify the format.
When I after a Restart format Drive B: it does format and verify fine - and then after that I can format and verify also Drive A: without problems.

In NABU BASIC I can only use the Floppy for saving if it starts with 17915 Bytes free.
If it starts (maybe without inserted floppys?) with 26543 Bytes free then I cant access the floppy.

And - as mentioned here in the thrad before - after formatting the Floppys (and exiting the Disk Utilities) you have to restart, before the Floppy can be used to save a BASIC file to Floppy.

Can anyone confirm my find ( first format B: then A: )?
The question is if this only apply to the NABU-MAME or also for the original NABU-Hardware?

BTW: This is my .cmd for inserting also a floppy-disl in Drive B:
mame nabupc -window -kbd nabu_hle -hcca null_modem -bitb socket.127.0.0.1:5816 -option1 fdc -flop1 nabu_floppy_a.dsk -flop2 nabu_floppy_b.dsk
 
Last edited:
Like in the YT-Video
you can run Zork1 also on the NABU-MAME ;) (using ZORK as Shortcut)
because the .dsk-Floppy files are accessable via cpmtools using the "osborne1" format:
cpmls -f osborne1 /NABU/nabu_floppy_a.dsk 0: "test".bas cpmcp -f osborne1 /NABU/nabu_floppy_a.dsk /NABU/ZORK1.DAT 0:
 

Attachments

  • nabu_floppy_a_with_ZORK1_DAT.zip
    59.2 KB · Views: 10
  • NABU_Floppy_DSK_Format_Details.jpg
    NABU_Floppy_DSK_Format_Details.jpg
    64 KB · Views: 12
  • NABU_ZORK1_Startup.jpg
    NABU_ZORK1_Startup.jpg
    84.6 KB · Views: 12
  • ZORK1_Shortcut.jpg
    ZORK1_Shortcut.jpg
    58.9 KB · Views: 12
Trivia time: Mark Blank, one of the authors of the original Zork, debugged the NABU version of Zork using an ICE (In Circuit Emulator). in the cube beside me at NABU Baxter Rd. I also met Joel Berez, one of the other authors of Zork there.

Personally, I found the NABU Zork a very nice version that showcased another side of the NABU's abilities.
 
I've updated my emulator branch with support for the new roms (ver14, ver17, and ver29). I've also included the HDD support for the system since both ver14 and ver17 support hdd booting.

To enable hdd support use -bios ver17 to boot into the version 17 4k bios and also add -option1 hdd -hard <image> to the cli.

You can create a new 10 MB image file on linux with dd if=/dev/zero of=<path/to/image> bs=512 count=20808

There is much to do with it since we don't have bootable hdd with OS at the moment, though I have written a small bootloader that can be places at track 0, sector 1 and can load something from track 0 sectors 2-17 and was able to put some homebrew that I modified the ORG address to 0x100 and get it to boot.
 

Attachments

  • hddboot.txt
    1.4 KB · Views: 19
The same code for Zork 1 should run Zork 2-3, Ballyhoo, Cutthroats, Deadline, Enchanter, Hitchhiker's Guide to the Galaxy, Infidel, Leather Goddesses of Phobos, Lurking Horror (gotta be careful with this one, only certain versions of the bytecode will work correctly on most interpreters), Moonmist, Plundered Hearts, Seastalker, Sorcerer, Spellbreaker, Starcross, Stationfall, Suspect, Suspended, Wishbringer and The Witness, if given the correct data files.

Also, except for the very earliest versions all the games should support a $VERIFY command.

I was actually pretty big on Infocom stuff at one time.
 
Back
Top