FamicomBox

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
FamicomBox
by on (#96025)
Hi, I've spent some days on (trying to) understanding the FamicomBox (a special NES with 15 game cartridge slots, and pay-per-play feature, for use in hotel rooms).
There's a good and (almost) complete description of the hardware on kevtris.org - first of, here's a review of the pages:
-----------------------------
PAGE 1
http://kevtris.org/mappers/famicombox/index.html
Quote:
then it goes back to the title. 20:23 20:44 20:45

Hmmmm.... the SNES-SuperFamicomBox does actually have a RTC chip, but I think the NES-FamicomBox doesn't have one - and the Menu program doesn't contain any time-display function. So, the "20:23 20:44 20:45" part must be some sort of copy-paste-typo.
-----------------------------
PAGE2
http://kevtris.org/mappers/famicombox/index1.html
Quote:
When the keyswitch is turned all the way to the left, this screen comes up [GAME & TITLE COUNT DISP.]
And finally, if you turn the keyswitch to the right a couple clicks, you get this self test screen

Ah, the keyswitch. Even with a lot of love in detail... understanding that thing will be pretty hardcore. Let's see:
- It has six positions.
- Two of the positions are labelled OFF and ON (unknown which ones)
- There are Black visitor keys, and red master keys (see http://www.famicombox.jp/kaitai1.html)
- The 1st position from left is the COUNT DISP stuff, this is in Bit5 in the I/O port
- The 2nd..6th position from left have unknown function, and are assigned to unknown Bit numbers in the I/O port (if it's equally messy as the SNES version, then the bits are probably not straightly numbered).
- Aside from the obvious "Nth from Left" and "Bit number" naming schemes, there are three more naming schemes: "1 2 3 4 5 6" (ASCII string found in the menu program. "1-OFF-ON-2-3-4" (depicted on the http://www.famicombox.jp/kaitai1.html page), and "0 1 2 3 4 6" (used on the kevtris page; note the gap between 4 and 6 - I guess that are pin numbers, and pin5 would be GND or so).

-----------------------------
PAGE3
http://kevtris.org/mappers/famicombox/index2.html
Quote:
This thing cannot run later games that use the MMC3 or anything which uses IRQs, and anything that maps stuff outside the area of 8000-FFFFh.

Okay... but why not?

The FamicomBox & Menu cartridge don't use IRQs internally (except with a Test mode adaptor), so IRQs should be available for use by games - unless the IRQ lines of the deselected games are somehow disturbing the selected game...?

For the 8000h-FFFFh are, the FamicomBox is apparently masking the ROM select pin (pin 50). For other memory it would somehow need to mask memory cycles (PHI, pin 38.), and/or to output dummy-addresses (A13-A14, pin 40-41). But that isn't implemented?

For the 6000h-7FFFh part. A few games are using that area for I/O, but most commonly it is used for SRAM. Now, the FamicomBox mainboard does contain 8K SRAM mapped to that address; the Menu program doesn't seem to be using that memory at all (except in test mode). I guess the memory is kept enabled even during Game-execution (?) and probably it's actually intended for use by games.

Ie. Unlike NES games, FamicomBox SRAM Games won't contain any built-in SRAM, but rather use the SRAM on the mainboard. Right?
And a side-note on the SRAM supply: I can't see a battery on the photos, so it's probably not battery-backed. On the other hand, there's no power-switch, so SRAM should be permanently powered; unless one unplugs the power supply.

-----------------------------
PAGE4
http://kevtris.org/mappers/famicombox/index3.html
Just some photos here.

-----------------------------
PAGE5
http://kevtris.org/mappers/famicombox/index4.html
Some more photos. Including a few details on the "CATV" connector... Does anybody know anything on that CATV thing?

It seems to be intended to be connected to a computer in the hotel office or so. Ie. in COIN mode, you'd insert coins to play. And in CATV mode, your room bill would be charged automatically when playing (via a PLAY pin). There's also an ALERT pin (used when you try to steal the joypads or zapper).

-----------------------------
PAGE6
http://kevtris.org/mappers/famicombox/index5.html
Some more photos here.

-----------------------------
PAGE7
http://kevtris.org/mappers/famicombox/index6.html
Descriptions of the Pin-Outs and I/O Ports. More on that in next two posts...

by on (#96027)
Pinout section PAGE7
http://kevtris.org/mappers/famicombox/index6.html

Quote:
Pinout of the 26 pin connector that connects the front controls:
3 - Front LED anode (cathode is grounded)
7 - pin 3 of coin connector. connects to LED.

What is that? Are there two separate LEDs, or is it both the same LED? Are the LED(s) always on? Or software controlled by 6502 CPU? Or by the Coin Timer Chip? Or by something else?

Quote:
Pinout of the 26 pin connector that connects the front controls:
4 - TV/Game button (5V on other end- connected to pin 6)
6 - +5V

Okay, sounds simple. Unless... is there something special wih the 5V on pin 6? (like being switched via the relay or so?)

Quote:
Pinout of the 26 pin connector that connects the front controls:
9 - GND on zapper plug (!!)

That must be referring to Pin 1 of the Zapper's 7-pin connector, ie. the pin that would be GND on normal controller ports. For normal operation, the FamicomBox should output a strong LOW level, presumably via a transitor. For zapper connection check, the pin can be apparently switched to a weaker "Low-Z" level, and the Menu program can then read the voltage level of that pin - if the zapper is disconnected (guest has cut the cable), then the pin would be Low. If the zapper is connected, then zapper hardware will drag the pin High.
It's a bit similar to the VS-Unisystem connect check, but works with a regular 4-wire zapper (the VS connect check doesprobably using special 5-wire lightguns).

Quote:
Expansion connector (behind a small door on the back left side):
23 - 5007R.7

According to the I/O port descriptions, 5007h.R.7 somehow connects to 5005h.W.5. If that's correct... then Expansion Pin 23 should be actually 25007h.R.7+5005h.W.5" ?

Quote:
The modulator has a couple inputs:
Audio - mono audio from amplifier+external+coin feep
Video - comes from the usual transistor circuit on the PPU
B+ - connects to 5V
B+SW - when grounded, switches the game in. when high, lets TV signal pass through
GND - connects to ground
40% - undermodulates video by 40% when low. high = normal

That are only six inputs? The photos are showing 7-wire connection to modulator.

Now the pin-outs missing on the kevtris page. The 3pin coin mech and 7pin joypad connectors are somewhat implied in the Front-panel description - ie. they should be as so:
Code:
3pin Coin Mechanics connector (from Front Panel to External Coin Unit)
  1 - (pin8 of front panel PCB) (Low=Add credit) (also wired to TEST button)
  2 - GND
  3 - (pin7 of front panel PCB) "connects to LED"   err.. what LED, what for?

7pin Controller Ports (3 pieces; for 2 Joypads and 1 Zapper)
  Pin Purpose        Port 1 (Joy1) Port 2 (Joy2)      Port 3 (Zapper)
  1 - Ground         GND           GND                5005h.W.Bit2/5007h.R.Bit2
  2 - Joypad Clock   4016h.R       4017h.R            4017h.R       .---------.
  3 - Joypad Strobe  4016h.W.Bit0  4016h.W.Bit0       NC            | 4 3 2 1 |
  4 - Joypad Data    4016h.R.Bit0  4017h.R.Bit0       NC            | 7 6 5  /
  5 - Supply         +5V           +5V                +5V           '-------'
  6 - Zapper Light   4016h.R.Bit3  4017h.R.Bit3/DIP10 4017h.R.Bit3/DIP10
  7 - Zapper Button  4016h.R.Bit4  4017h.R.Bit4/DIP10 4017h.R.Bit4/DIP10


And the strange CATV thing. Judging from photos and fragments from the I/O description, it should be somehow like so:
Code:
Whatever connector (marked "CATV INTERFACE")
  1 - 5000h.RW.Bit7 Exception Trap (usually strapped to GND, ie. CATV pin4)
  2 - Unknown
  3 - Unknown
  4 - GND
  5 - +5V
  6 - Unknown
  7 - 5001h.W.Bit6                  ;Play-and-Pay (unless TV mode?)
  8 - 5001h.W.Bit7 and 5007h.R.Bit4 ;Joypad/Zapper-Disconnect-Alert

Note that the kevtris I/O description claims 5000h.RW.Bit7 to be on Pin 4. But judging from the kevtris photos it looks more like Pin4=GND. Pin 1+4 are somehow "related", so I guessed 5000h.RW.Bit7 being on Pin 1 instead Pin 4 (but that may be wrong).
For Pin 8, I have no clue why it has two I/O bits assigned.
And for the unknown pins, both the ASCII strings in the menu, and the kevtris I/O specs are indicating that there is a "Switching Relay" (whatever that means) - maybe that thing is related to the CATV connector?

EDIT: Two more pin-outs:

3199 - 16pin Coin Timer/Coin Chip (1 piece; on mainboard)
(assuming it has same pins as normal CICs, ie. Pin1-4 = P00..P03 etc.)
1 P00 5001h.W.Bit0 (unknown purpose)
2 P01 5001h.W.Bit1 (unknown purpose)
3 P02 5001h.W.Bit2 (unknown purpose)
4 P03 5001h.W.Bit3 (unknown purpose)
5 CL2 whatever MHz clock (or maybe NC)
6 CL1 whatever MHz clock (this one needed)
7 RES whatever type of reset (maybe I/O controlled?)
8 GND Supply GND
9 P10 5003h.R.Bit6 (reportedly "Money system enabled")
10 P11 5003h.R.Bit7 (unknown purpose)
11 P12 (unknown purpose)
12 P13 5001h.W.Bit4 (unknown purpose)
13 P20 (unknown purpose)
14 P21 5001h.W.Bit5 (unknown purpose)
15 P22 (unknown purpose)
16 VCC Supply VCC
Note: Reportedly, 5005h.W.Bit1 also connects to whatever 3199 pin. Moreover, the 3199 chip should connect to "a LED", sound feep, 40% video dimming, and coin-insert signal.

72-Pin Cartridge Slots (16 slots: for menu cart and 15 game carts)
As far as known, this is mostly same as on 72-pin NES cartridges. But, with some differences:
Pin 16-19 are the 4bit SlotID; for use by the FamicomBox CIC chip (on NES carts, these pins are unused "expansion" pins).
And, PRG-ROM select (Pin 50) is probably masked on unused slots. And deselecting PPU memory is... maybe... done by masking the PPU-READ signal (Pin 21) or so?
And, there seems to be a problem with the /IRQ pin (see above post), and with CPU space below 8000h (see above, too).

by on (#96029)
And, the I/O section from PAGE7
http://kevtris.org/mappers/famicombox/index6.html

Quote:
5000R: Device which caused an exception (0 = this device caused the exception)
0 - 6.82Hz interrupt source hit
1 - 8 bit timer expired @ 5003W
2 - controller(s) were read
3 - keyswitch was rotated
4 - money was inserted
5 - reset button was pressed
6 - watchdog timer expired (reading either controller resets this timer)
7 - Pin 4 of "CATV connector" went high/open
When 5000R is read, this register is reset, and the exception trap controller is reset.


"6.82Hz interrupt source" would be just a 6.82Hz square wave asserted to Reset Trap? Any clue what is that good for? And "interrupt" refers only to the Reset-exceptions (not to IRQ pin), right?

"controller(s) were read" - what is that good for? Does it really reset as soon as controllers are read (even when no buttons are pressed)?

"money was inserted" doesn't seem to be too useful, except maybe for automatically leaving Demo mode. The menu software seems to handle that bit also for "money has expired" situations - maybe that exception trap is used for BOTH inserted and expired?
And if so, I'd bet that it traps only on transitions (empty-->inserted, and inserted-->expired). But not on recharging (inserted-->more inserted); doing a reset in that situation would be annoying.
And if that trap-bit doesn't trap on expired... is there an expired-trap bit elsewhere in other I/O ports?

"Pin 4 of CATV connector" went high/open" - pretty sure that pin 4 is GND, so that must be wrong.

-------------------------------

Quote:
5001W Money handling register (reset to 00h on power up only)
6 - enable pin 7 of "CATV" connector, 1 = enable. when in TV mode, output goes low. else output stays high

I don't really understand that part. Sounds as if there are 4 possible situations (Bit6 set/cleared, and button in tv/game mode)... and then something happens?
My current conclusions for 5001W are:
Code:
  0    Coin Chip pin 1  (1=Ten Minutes per Coin)
  1    Coin Chip pin 2  (1=Twenty Minutes per Coin)
  2    Coin Chip pin 3  (should be always 0, except in test mode)
  3    Coin Chip pin 4  (should be always 0, except in test mode)
  4    Coin Chip pin 12 (should be always 0, except in test mode)
  5    Coin Chip pin 14 (1=Apply Minutes?)
  6    CATV Connector pin 7 (0=Free-Menu/Demo, 1=Play-and-Pay; unless TV Mode?)
  7    CATV Connector pin 8 (0=High=Okay, 1=Low=Joypad/Zapper-Disconnect-Alert)


Quote:
5002W LED & memory protect register (reset to 00h when CPU is reset)
7 - LED flash- high = flash, low = steady

Okay, that does probably refer to the currently selected Red Slot-LED (not to the green Front-panel LED), right?
And steady means always-on, and flash means 3.414Hz blink?
Ah, and "low" means 0, or what?

------------------------------

Quote:
5004W Cart control register (reset to 00h when CPU is reset)
4 - row select 0
5 - row select 1
6 - Lock. writing a 1 here unmaps all hardware

I am a bit curious what the Row Select bits are doing, disabling data/address bus on unused carts? or even disabling VCC?

"Lock. writing a 1 here unmaps all hardware"
All hardware? Like the PPU, CPU, power-supply? No.
The bits seems to be set before starting games, so it does probably disable only the "special famicombox" hardware, and thereby switches to a regular-NES emulation mode.

Namely, I would guess that it disables all writes (and maybe reads) to the port 500xh area. Ie. freezes all 500xh.W ports in their current state - that, of course only until a reset-trap occurs.

Other than that, I can't imagine any other special hardware that could/should be disabled by the "lock" bit. Except maybe the SRAM at 6000h-7FFFh, but I think that memory is explicitly intended to be used by the games.

Quote:
Proper cart selection requires setting up BOTH the desired cart # (00-0fh), AND the proper row. The menu software uses a small table to do this.

A table? No, it does do the row selection, but it isn't using a table.
Unless there are different versions of the menu software? The one I have seen has CRC32=DA1EB8D2h on the 32K PRG-ROM part (=excluding iNES header and CHR-ROM).

-------------------------------

Quote:
5005W CATV and joypad control (reset to 00h on power up only)
0 - 1 = flip latching relay to position A (coil on pins 1 & 10)
1 - connects to 3199
2 - turn zapper on. 1 = turn on
3 - enable 40% input of modulator. 1 = enable, 0 = disable
4 - NC
5 - maps to 5007R.7
6 - joypad enable- 1 = disable, 0 = enable
7 - joypad swap. 1 = normal, 0 = swap swapping only swaps D0 and CLK

Whoops.
First question would be: Which bits of the CATV register do have anything to do with CATV? The relay, maybe?

For the relay bit, 1=PositionA sounds fine. But what happens on zero? 0=NoChange? Or 0=PositionB?

"1 - connects to 3199"... but to which pin? The bit seems to be used somehow as "0=Operate, 1=Config/Reset". So far, it might actually connect to the Reset line of the 3199 chip...?

"2 - turn zapper on. 1 = turn on" Yes, seems to be right. Or in other words: "Zapper GND (0=Disable/Low-Z; for 5007h.R connect-check, 1=Enable/GND)"

"3 - enable 40% input of modulator. 1 = enable, 0 = disable"... in other words, that would mean 0=normal brightness, 1=dimmed picture?

"5 - maps to 5007R.7"... according to the pin-Out section, 5007R.7 is Pin 23 on the 50-pin expansion port... so 5005R.5 would go to that pin, too, right?

"6 - joypad enable- 1 = disable, 0 = enable" okay... not perfectly clear which pins are disabled, though not too important either. In practice, the bit seems to be used to disable joypads (maybe also zapper) in demo mode.

------------------------------
Quote:
5003R
0 - key position 0 (1 = in this position)
1 - key position 1
2 - key position 2
3 - key position 3
4 - key position 4
5 - key position 6
6 - money system enabled (pin 9 of 3199)
7 - pin 10 of 3199

Here, bit7 seems to be left unused by the existing software, so no idea what that bit is used for.

Bit6 means 0=NoMoney (or Money expired), 1=Money (coin timer is running), simple. Well, except - I don't know if the coin timer can be paused (eg. during menu selections, or when watching TV or so); ie. ideally it should be running only when actually playing a game.

Bit0-5 are somewhat:
Code:
  0    Key Position 0 (0=No, 1=Yes) (??? from left) ;-(demo mode?)
  1    Key Position 1 (0=No, 1=Yes) (??? from left) ;\SELECT GAME (play modes)
  2    Key Position 2 (0=No, 1=Yes) (??? from left) ;/
  3    Key Position 3 (0=No, 1=Yes) (??? from left) ;-SELF CHECK and GAME CHECK
  4    Key Position 4 (0=No, 1=Yes) (??? from left) ;-Lockup ???
  5    Key Position 6 (0=No, 1=Yes) (1st from left) ;-GAME TITLE & COUNT

Plenty question marks. Aside from Bit5 - there is almost nothing known.

------------------------------

Quote:
5007R
0 - TV type selection (1 = game, 0 = TV)
1 - keyswitch turned (1 = in middle of positions)
2 - 0 = zapper grounded
3 - pin 21 of exp. conn. (inverted)
4 - state of pin 8 of "CATV" connector, 0 = low, 1 = high
5 - relay position. 0 = position A, 1 = position B
6 - pin 22 of exp. conn. (inverted)
7 - 5005.5W (inverted)

This one is nasty, too...

"0 - TV type selection (1 = game, 0 = TV)" ... actually, the menu does boot only if that bit is 0. Assuming that it CAN boot in game mode, the bits should be vice-versa.
But, actually, the menu seems to handle that bit as 9th bit of the Exception Flag register. Namely, it looks like a CIC-Error-Trap flag. Which would have nothing to do with TV/Game selection.

"1 - keyswitch turned (1 = in middle of positions)"... that should be vice-versa: 1=stable position, 0=middle of positions.

"2 - 0 = zapper grounded"... basically, yes. Again, the purpose is connect check, and the more relevant values (seen when zapper is NOT grounded) would be: 0=Low=Disconnected, and 1=High=Connected.

"4 - state of pin 8 of "CATV" connector"... hmmm, then Pin8 is shared for 5007R.4 and 5001W.7 (=disconnect alert signal)... is that correct?

"5 - relay position. 0 = position A, 1 = position B"... I really don't have much of a clue what the relay is used for. Some info fragments:
The menu software does do the "flip to position A" stuff here and there, and the self-checks expect 5007R.5 to be "1=okay" - in so far, if the relay is still "flipped-to-A" at that point, then I'd expect the settings to be vice-versa: 0=B, and 1=A (though there might be something that "flips-to-B" before doing the self-check.
In CATV mode, 5007R.5=1 seems to have this meaning: Prompt-User-before-Play. If the user responds NO in the DO YOU PLAY screen, then the box goes into demo mode.

"7 - 5005.5W (inverted)"... again, according to the Pin-Out section, this bit does ALSO go to Pin 23 of the 50-pin expansion port. AND, the menu program seems to be somehow treating this bit as coldboot/warmboot flag. I am pretty puzzled there.

----------------------

Oh, and some notes on menu features: The STAFF gimmick shows up when pushing U,D,L,R,A,B,SEL,STA in the TITLE & COUNT DISP screen.

Then there's the SELF CHECK SCREEN DISP screen (as seen on the kevtris photos). After pushing a button, that screen is followed by list of installed games, and then the menu seems to hang-up; though that might be a bug in my emu.

Then there should be a "FINAL CHECK MENU" screen with 7 options - but I have no clue how one is intended to enter that menu screen. Does anybody know how to get in there?

And, a third test feature called AGING or AGEING test seems to be activated via the 5003R.Bit4 keyswitch position. These tests aren't listing OK/BAD results. Instead, they are programmed to lock-up with a "fatal" error message (eg. PROTECT IC ERROR), and otherwise they are passing silently (without showing any PROTECT IC OKAY message).
In fact, the error messages aren't shown either (except, sometimes they are shown, but only AFTER turning the keyswitch to a different location) - seems to be a bug either in my emulator, or in the Menu program.

Are that error messages showing up on real hardware? Some if the AGING tests seem to be require special test-cartridges (with RAM at 8000h and such things), so, I think you should definitely see an error message; unless the menu program is bugged.

by on (#96030)
I hate to have to ask, but is Kevtris uncontactable? It seems like he'd be able to shed some useful light on this.

by on (#96031)
Kev's on #nesdev regularly.

by on (#96033)
Okay, just wasn't sure if he'd disappeared or something - a lot of posts that looked like they were once useful have been edited out.
Back on track, didn't mean to derail anything!

by on (#96077)
Yes, he seems to be uncontactable. Tried a sending a PM in this forum, but don't know if he's reading that messages. And the email address on the kevtris.org page is having a killer-spam filter that tells me that it doesn't accept messages from web.de users.
Would be great if somebody could ask him to drop by, maybe via #nesdev (haven't tried there), or via a less disliked email server...