• Please review our updated Terms and Rules here

NABU PC Emulation under MAME

So I just posted this on Discord... give this ROM a try. It boots cpm from floppy, and runs the non-cycle stuff from IA (just quickly tested cloud cpm, Snake, Djs playground, and Slide Show.). On mame, be sure to use -bios rev14. Should be fine on real hardware as well. :)
 

Attachments

  • nabupc-u53-ver14-2732.zip
    3.1 KB · Views: 6
Last edited:
I've finally had time to sit down and take apart one of my NABU keyboards to figure out how things were connected inside. This means i have finally been able to get true low level keyboard emulation working in MAME for the NABU system, which is now the default. You can still use the HLE emulation by adding "-kbd nabu_hle" to the command line when launching MAME if you want.

One thing this means is that MAME will now support paddles on the NABU, yes the real hardware does support paddles, though I'm unsure if there were any games developed to use them. The analog paddle lines can be found on pins 9 and 5 just like with the ATARI, and are read via an ADC chip every time the key matrix is scanned. This data is then sent back to the NABU over the serial line.

The serial protocol for the paddles is similar to that of the joysticks, in that the keyboard first sends a prefix byte to inform the computer which port the data is for. Then instead of a single byte it sends 4 bytes the encode the 2 8 bit values read for the paddles on that port.

Prefix Bytes:
  • 0x84 - Port 1
  • 0x86 - Port 2
  • 0x88 - Port 3
  • 0x8A - Port 4
The 4 data bytes are sent in the form of 0xCX 0xDX 0xCX 0xDX, where X is a value 0-F representing one of the four nibbles. Each CX/DX is a pair with the CX giving the low nibble and the DX giving the high nibble for one of the paddles.

As an example suppose the paddles on port 1 read 0x9F on pin 9 and 0x13 on pin 5, then the data sent to the NABU would look like this: 0x84 0xCF 0xD9 0xC3 0xD1
 
The definitions in https://github.com/LeoBinkowski/NABU/blob/main/nabu-title-z80-example/COMMON.MRO describe the device numbers:

;
; DEVICE NUMBERS FOR KEYBOARD HANDLER
;
KEYSTROKE EQU 01H ; Keystroke device number
JSTCK1 EQU 02H ; Joystick 1 device number
JSTCK2 EQU 03H ; Joystick 2 device number
JSTCK3 EQU 04H ; Joystick 3 device number
JSTCK4 EQU 05H ; Joystick 4 device number
PADDL1 EQU 08H ; Paddle 1 device number
PADL1B EQU 09H ; Paddle 1B device number
PADDL2 EQU 0AH ; Paddle 2 device number
PADL2B EQU 0BH ; Paddle 2B device number
PADDL3 EQU 0CH ; Paddle 3 device number
PADL3B EQU 0DH ; Paddle 3B device number
PADDL4 EQU 0EH ; Paddle 4 device number
PADL4B EQU 0FH ; Paddle 4B device number

We did hook up the paddles to the NABU 1100 with HCC card from an Atari set to try it way back in 1982, but there were no plans to make any game use a paddle, thus interest in them was lost quickly. Also, we only had one set of paddles in the whole place. It came with the Atari 2600. Oh yeah, because the original keyboard had 4! game ports, you could have 8 paddles.

I just remembered I envisioned an up to 8 person pole position like game at some point if we ever did paddles.
 
If Arkanoid could be properly ported from the MSX, it would be a good game to use the paddles to emulate the arcade version's spinner or the MSX/NES versions' Vaus Controller.
 
I'm not having any success building MAME on Ubuntu 18.04. The error trace is:

Code:
Compiling src/osd/modules/debugger/qt/windowqt.cpp...
moc: Invalid argument
Usage: moc [options] <header-file>
  -o<file>           write output to file rather than stdout
  -I<dir>            add dir to the include path for header files
  -E                 preprocess only; do not generate meta object code
  -D<macro>[=<def>]  define macro, with optional definition
  -U<macro>          undefine macro
  -i                 do not generate an #include statement
  -p<path>           path prefix for included file
  -f[<file>]         force #include, optional file name
  -nn                do not display notes
  -nw                do not display warnings
  @<file>            read additional options from file
  -v                 display version of moc
qtdbg_sdl.make:518: recipe for target '../../../../generated/osd/modules/debugger/qt/breakpointswindow.moc.cpp' failed
make[2]: *** [../../../../generated/osd/modules/debugger/qt/breakpointswindow.moc.cpp] Error 1
Makefile:16: recipe for target 'qtdbg_sdl' failed
make[1]: *** [qtdbg_sdl] Error 2
makefile:1285: recipe for target 'linux_x64' failed
make: *** [linux_x64] Error 2
Can anyone shed light on this?

UPDATE: For whatever reason, I have to set QT_SELECT=qt5 in the environment in order to build. Doesn't run properly, but that's for a future post.
 
Last edited:
Does anyone have the MAME Nabu personality working on Linux? I've tried two different bodies of MAME source that claim to support Nabu, but neither works properly. One of them appears to boot, based on server log messages, but shows a screen consisting of the ASCII character range repeated a few times and does not respond to keyboard input. When I reset it (F3) I can briefly see the correct splash screen for Ishkur CP/M before it restarts.
 
Does anyone have the MAME Nabu personality working on Linux? I've tried two different bodies of MAME source that claim to support Nabu, but neither works properly. One of them appears to boot, based on server log messages, but shows a screen consisting of the ASCII character range repeated a few times and does not respond to keyboard input. When I reset it (F3) I can briefly see the correct splash screen for Ishkur CP/M before it restarts.
It should work fine under linux. The latest code is is at my own github repository and should be run just fine. What CLI are you using to launch MAME?
 
I invoke it with this:

./mame nabupc -window -kbd nabu_hle -hcca null_modem -bitb socket.127.0.0.1:5816

Trying again for a third time with your Github sources, but this did not work yesterday. When I do
The resulting tree does not contain a src/mame/nabu directory, BTW. I may be missing a step somewhere but I have to explicitly checkout the nabupc_wip branch.
 
I invoke it with this:

./mame nabupc -window -kbd nabu_hle -hcca null_modem -bitb socket.127.0.0.1:5816

Trying again for a third time with your Github sources, but this did not work yesterday. When I do

The resulting tree does not contain a src/mame/nabu directory, BTW. I may be missing a step somewhere but I have to explicitly checkout the nabupc_wip branch.
The link is to the github view of the branch that includes my code, to actually clone it localling use:
Code:
git clone https://github.com/brijohn/mame.git
cd mame
git checkout nabupc_wip

Also with the latest version you don't need the '-kbd nabu_hle' option anymore. The keyboard is natively emulated so you don't need the hle variant. Otherwise the CLI looks correct. One issue that occurs to me is that perhaps you don't have the baud rate of the hcca configured correctly on MAME. If you have not done once mame starts hit scroll lock to enable the UI menu and then tab and select machine configuration then change the TX/RX baud rate to 111900 and restart the machine,
 
That's exactly how I'm obtaining the source: clone then checkout. I am set for the 111900 baud rate. I eliminated the keyboard selection from the CLI. No change. Still just a screen full of garbage. One more bit of information: My initial attempts were spitting out complaints about missing bgfx, so I copied the entire bgfx subtree from the sources to my run directory. Was that expected to be necessary?
 
It occurs to me that I may have the runtime directory setup incorrectly. I was following advice from a third-party to download the prepackaged Windows build and simply replace mame.exe with the linux binary. Can anyone comment on this?

UPDATE: I tried deleting all the configuration files from that Windows build. No change. It's definitely booting, but no usable display or keyboard. I give up. Will put a gun to my head and just use the Windows build on a VMware guest.
 
Last edited:
It occurs to me that I may have the runtime directory setup incorrectly. I was following advice from a third-party to download the prepackaged Windows build and simply replace mame.exe with the linux binary. Can anyone comment on this?

UPDATE: I tried deleting all the configuration files from that Windows build. No change. It's definitely booting, but no usable display or keyboard. I give up. Will put a gun to my head and just use the Windows build on a VMware guest.
Do you get that character display immediately on boot up? You never see a blue screen and the nabu logo? Have you tried just compiling my github repo and running directly from there? I seems there is something wrong with how you are adding the executable to a pre packaged build. I've never done that myself.
 
I initially see the blue NABU screen with logo, then it clears to some garbage before redisplaying the blue NABU screen. After a moment with the LEDs blinking it clears to black and white with the NABU logo and 'PLEASE WAIT' in the lower left. Finally, it blinks again and shows the ASCII garbage I posted above. I'll try running from the build area.

UPDATE: The 'roms' subdirectory in your repo is empty, so I cannot simply run from there.

UPDATE2: Found the problem! The CP/M image I'm trying to boot is setup for 80-column text using an F18A. If I delete the init.ini file it comes up in 40-column mode just fine. But, I thought I remembered reading (somewhere) that the Nabu MAME port supported F18 video? Is that not the case? At any rate, I'm operational now - albeit at a lower resolution. Thanks for bearing with me.
 
Last edited:
I initially see the blue NABU screen with logo, then it clears to some garbage before redisplaying the blue NABU screen. After a moment with the LEDs blinking it clears to black and white with the NABU logo and 'PLEASE WAIT' in the lower left. Finally, it blinks again and shows the ASCII garbage I posted above. I'll try running from the build area.

UPDATE: The 'roms' subdirectory in your repo is empty, so I cannot simply run from there.
Yeah you would need to make a directory called nabupc in the roms folder and then copy the nabupc roms there. Though it does seem like it is starting correctly. what hcca emulator are you using and what is it configured to send to mame? It seems like the nabu emulator might be working but there is an issue with what is being sent over the TCP connection. You could try using '-hcca hcca_remote' instead of the null_mode setup. That should load the standard nabu cycle from nabu.ca if it works then the issue is liekly something wrong with the communication between mame and the hcca emulator you are using.
 
Are there any plans to emulate the F18A graphics adapter? A significant number of NABU owners are running with them.
While i don't have plans immediately for support the F18A under mame. If what you want is 80 column mode you can recompile mame using the V9938 VDP instead of the TMS9918. The patches to do so can be found at https://forums.nabu.ca/viewtopic.php?p=742#p742
 
Back
Top