Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - SP-400 (Sega Printer) reverse engineering

Reply to topic
Author Message
  • Joined: 28 Sep 1999
  • Posts: 1197
Reply with quote
SP-400 (Sega Printer) reverse engineering
Post Posted: Sun Feb 27, 2022 9:22 pm
Last edited by Charles MacDonald on Tue Mar 01, 2022 4:35 am; edited 1 time in total
Thanks to HoverEel I was able to dump the internal ROM of the HD6805V1 so I think we have everything needed to emulate it.

Of interest is that the stepper motor driver chip (LB1257) mentions it's suited for the Alps DPG plotter. HoverEel confirmed the SP-400 has an Alps mechanism and it was used in many other plotters of the time (specifically " ALPS Micrographic Printer DPG 1302"):

VIC 1520 plotter:
https://www.telecomm.at/documents/C1520_Manual.pdf

Atari 1020 plotter:
http://www.atarimania.com/documents/atari_1020_Field_Service_manual.pdf

We don't know what model the SP-400 uses but the stepper motor drive datasheet say it meets all specifications for the Alps DPG series. It would be good if we could find the Alps documentation for any of their DPG products.

Some of the HD6805 connections and matching Commodore/Atari signal names are:

Port B[3:0] : CN2 pins 3-6 (Commodore: X motor, Atari: XD, XC, XB, XA)
Port B[7:0] : CN2 pins 8-11 (Commodore: Y motor, Atari: YD, YC, YB, YA)
Port C[3] : CN2 pin 2 (Commodore: Color sensor switch, Atari: Reed switch), has pull-up resistor.
Port D[7:0] to 8035 port P1.0-P1.7 (parallel data)
Port C[4] ties to 8035 pin P2.7
INT# pin ties to 8035 pin P2.6

Updates [2/28/2022]

The 4.0 MHz oscillator connects to XTAL, EXTAL of HD6805V, but also the same pin as XTAL connects to the 8035 X1 with X2 left disconnected. So both run at 4 MHz.

Port A connections:
Port A[0] to ground
Port A[1] to ground
Port A[2] to CN3 P2
Port A[3] to CN3 P3
Port A[4] to CN3 P1
Port A[5] to ground
Port A[6] to ground
Port A[7] to common node with R3,R4,R15,R16,Q1

Thus connector CN3 pinout is:

CN3 P7 is ground
CN3 P6 is from other side of R15 (see Port A[7] above)
CN3 P5 is 8035 P2.7 through LS04 inverter (in to pin 1, out pin 2 to CN3)
CN3 P4 is from other side of R16 (see Port A[7] above)
CN3 P2 is Port A[2]
CN3 P3 is Port A[3]
CN3 P1 is Port A[4]
  View user's profile Send private message Visit poster's website
  • Joined: 05 Jun 2010
  • Posts: 757
  • Location: Pennsylvania, USA
Reply with quote
Post Posted: Sun Feb 27, 2022 10:10 pm
I have no idea what it uses, but great work so far. I never heard of the SP-400 until now and watched a video of it in action. Pretty neat stuff!
  View user's profile Send private message Visit poster's website
  • Joined: 25 Feb 2013
  • Posts: 384
  • Location: Osaka
Reply with quote
Post Posted: Mon Feb 28, 2022 4:44 am
Last edited by kamillebidan on Mon Feb 28, 2022 2:35 pm; edited 1 time in total
Thank you!

By comparing the atari's service manual ad the sega's user manual the charset seems to be different, so either there's a switching mechanism or they are different (I would think the latter is more probable).

From pics only there's not much visible, however I started laying out the schematic (with kicad) here
https://github.com/fabiodl/sp400/tree/master/schematic
  View user's profile Send private message
  • Joined: 25 Feb 2013
  • Posts: 384
  • Location: Osaka
Reply with quote
Post Posted: Tue Mar 01, 2022 6:14 am
As for the other chip, these are my guesses from the code (https://github.com/fabiodl/sp400/blob/master/sp400_commented.asm)

M5L8035LP (Mitsubishi clone of I8035)

P1 is the deserialized output data
P2.4 is the input serial data
P2.5 may be busy (output to sc3000)
P2.6 is the output strobe
P2.7 may be busy (input)
  View user's profile Send private message
  • Joined: 25 Nov 2015
  • Posts: 143
Reply with quote
Post Posted: Fri Mar 04, 2022 2:52 pm
Charles MacDonald wrote
Thanks to HoverEel I was able to dump the internal ROM of the HD6805V1 so I think we have everything needed to emulate it.

Of interest is that the stepper motor driver chip (LB1257) mentions it's suited for the Alps DPG plotter. HoverEel confirmed the SP-400 has an Alps mechanism and it was used in many other plotters of the time (specifically " ALPS Micrographic Printer DPG 1302"):

VIC 1520 plotter:
https://www.telecomm.at/documents/C1520_Manual.pdf

Atari 1020 plotter:
http://www.atarimania.com/documents/atari_1020_Field_Service_manual.pdf

We don't know what model the SP-400 uses but the stepper motor drive datasheet say it meets all specifications for the Alps DPG series. It would be good if we could find the Alps documentation for any of their DPG products.

Some of the HD6805 connections and matching Commodore/Atari signal names are:

Port B[3:0] : CN2 pins 3-6 (Commodore: X motor, Atari: XD, XC, XB, XA)
Port B[7:0] : CN2 pins 8-11 (Commodore: Y motor, Atari: YD, YC, YB, YA)
Port C[3] : CN2 pin 2 (Commodore: Color sensor switch, Atari: Reed switch), has pull-up resistor.
Port D[7:0] to 8035 port P1.0-P1.7 (parallel data)
Port C[4] ties to 8035 pin P2.7
INT# pin ties to 8035 pin P2.6

Updates [2/28/2022]

The 4.0 MHz oscillator connects to XTAL, EXTAL of HD6805V, but also the same pin as XTAL connects to the 8035 X1 with X2 left disconnected. So both run at 4 MHz.

Port A connections:
Port A[0] to ground
Port A[1] to ground
Port A[2] to CN3 P2
Port A[3] to CN3 P3
Port A[4] to CN3 P1
Port A[5] to ground
Port A[6] to ground
Port A[7] to common node with R3,R4,R15,R16,Q1

Thus connector CN3 pinout is:

CN3 P7 is ground
CN3 P6 is from other side of R15 (see Port A[7] above)
CN3 P5 is 8035 P2.7 through LS04 inverter (in to pin 1, out pin 2 to CN3)
CN3 P4 is from other side of R16 (see Port A[7] above)
CN3 P2 is Port A[2]
CN3 P3 is Port A[3]
CN3 P1 is Port A[4]

You probably already found that: https://datasheetspdf.com/pdf-file/391354/Sanyo/LB1257/1

I also found those technical official pages from ALPS but they require a login:
https://alps.groups.io/g/ALPS/files/Technical_Info
https://alps.groups.io/g/ALPS/files
https://alps.groups.io/g/ALPS/files/Troubleshooting_Repair_Adjustment
  View user's profile Send private message
  • Joined: 25 Feb 2013
  • Posts: 384
  • Location: Osaka
Reply with quote
Post Posted: Mon Mar 07, 2022 7:14 am
asper wrote

I also found those technical official pages from ALPS but they require a login:
https://alps.groups.io/g/ALPS/files/Technical_Info
https://alps.groups.io/g/ALPS/files
https://alps.groups.io/g/ALPS/files/Troubleshooting_Repair_Adjustment

I tried to register, but here's the reply

>>> I am adding the emulation of the ALPS DPG1302 to mame, and I'd like it to be as faithful as possible

You're in the wrong group, this groups is only for the MicroDry printers.

Cheers,
Christos
Co-moderator
  View user's profile Send private message
  • Joined: 25 Feb 2013
  • Posts: 384
  • Location: Osaka
Reply with quote
Post Posted: Fri Mar 11, 2022 4:29 am
At https://github.com/fabiodl/sp400/ you can find

- the commented disassembly for the 8035 (a simple circular buffer and data deserialization), syntax compatible with https://github.com/daveho/asm48

- the disassembly (automatic, much of the assumed instructions are probably just data, this needs to be reverse engineered) for the 6805. Syntax compatible with https://github.com/sbprojects/sbasm3

-the manual's sample programs in text form (.basic) audio form (.tzx) and the drawing produced (.png)
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14682
  • Location: London
Reply with quote
Post Posted: Fri Mar 11, 2022 9:34 am
Shouldn't the output be in SVG form? :)
  View user's profile Send private message Visit poster's website
  • Joined: 25 Feb 2013
  • Posts: 384
  • Location: Osaka
Reply with quote
Post Posted: Fri Mar 11, 2022 12:59 pm
Ideally yes. The problem is that at each instant all we get is whether the motors should step or no. Therefore, guessing when the average direction changed is not trivial, especially for curves. If we had motor velocities ratios it would suffice to check when the ratio changes. However, since all we get is this discrete signal, it would be necessary to introduce some arbitrary heuristic to estimate the local stepping frequency ratios. It is doable, but not much more faithful than simply using 1 pixel= 1 motor step (0.2mm) as done here. An analysis of the disassembled code may reveal how to intercept the desired ratios before the discretization, and thus to generate vector images. That would be cool.
  View user's profile Send private message
  • Joined: 25 Feb 2013
  • Posts: 384
  • Location: Osaka
Reply with quote
Post Posted: Sat Mar 12, 2022 6:41 am
For anyone wanting to try it out,
https://github.com/fabiodl/mame/

and the command line to connect the plotter (it can be done through the GUI as well) is

./mame sc3000 -cart ~/emu/rom/Sega_BASIC_Level_3_V1_\(SC-3000\).sc -sgexp:sk1100:printer sp400
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14682
  • Location: London
Reply with quote
Post Posted: Sat Mar 12, 2022 7:59 am
You could model the motor steps as instantaneous which would lead to not very smooth vector curves (consisting of horizontal, vertical and 45 degree lines) but as the font seems designed for this, it may look fine. Modelling inertia while drawing seems trickier.
  View user's profile Send private message Visit poster's website
  • Joined: 25 Feb 2013
  • Posts: 384
  • Location: Osaka
Reply with quote
Post Posted: Sat Mar 12, 2022 9:09 am
Good point! I checked the font, and every single line is at k*45 degrees.
  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Tue Apr 12, 2022 9:38 pm
Mildly on-topic but probably a good place for search-ability. This site appears to set plotter pens compatible with SP-400:
https://www.evident-shop.de/en/diagnostics/plotter-pens/249/plotter-pens/pencil-...

And paper:
https://www.evident-shop.de/en/diagnostics/paper-for-misc.-device-printers/321/p...

(Thanks Kirils for the links)
  View user's profile Send private message Visit poster's website
  • Joined: 25 Feb 2013
  • Posts: 384
  • Location: Osaka
Reply with quote
Post Posted: Sun Sep 25, 2022 10:40 am
By analyzing the disassembly I found out that three pins (PA5,6,7 of the 6805) are used to set different configurations. The resolution can be changed, probably to support different mechanics.
The baud rate is 4800
  View user's profile Send private message
  • Joined: 25 Feb 2013
  • Posts: 384
  • Location: Osaka
Reply with quote
Post Posted: Thu Oct 27, 2022 3:12 am
The plotter has katakana as well! This matches https://www.smspower.org/Development/SC-3000Font

I wonder if there exists a japanese manual and if that was reported.
Just send chars 0xA0 to 0xDF.

  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!