Skip to content
/ JinGasa Public

experimental custom BIOS for Naomi1/2, System SP and SET5

Notifications You must be signed in to change notification settings

Tchan0/JinGasa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 

Repository files navigation

JinGasa

!! DISCLAIMER / WARNING / DANGER !!

  • This is an experimental, Work-In-Progress BIOS, USE AT YOUR OWN RISK !!
  • Don't blindly believe anything that's written here, verify everything for yourself, especially the voltage levels !!
  • Not all things written here have been verified by me !!
  • Not all register values have been cross-checked, so this BIOS might be setting some wrong values !!

What ?

A Kabuto is a full-fledged Samurai helmet.

  • Kabuto is the codename for the (full-fledged) BIOS of the Dreamcast.

A Jingasa is a light helmet.

  • JinGasa is an experimental minimalistic custom WIP BIOS that contains dcload-serial, for Naomi 1/2, System SP and SET5.

(Incidently, the Naomi & System SP Bios contain "Hat"-references: "NAOMIHAT" and "SPIDERHAT")

The only things JinGasa does are:

  • init the strict necessary registers & vectors
  • copy over dcload-serial to 0x8c010000
  • jump to 0x8c010000

Hence, it only uses the SH-4 SCIF serial pins, not the MIE pins.

It auto-detects 16 and 32 MB RAM.

It assumes VGA output.

Audio (AICA) is not initialized yet (TODO).

Building

  • To compile it, you need:
    • a file with the DC BIOS (preferably 1.01d), to extract the font
    • a gcc compiler for sh-elf
    • download and compile dcload-serial, so that /target-src/1st_read/loader.bin exists
      • Before compiling, hardcode dcload-ser to VGA:
        • in target-src/dcload/video.s - _check_cable: change the 3 first commands:
        • MOV #0,R0 !by T - for Naomi & System SP - Tmp test, since KOS also does not know how to check the cable
        • RTS ! note: I commented out the 3 next commands, so that the size of the bin remains the same
        • NOP
        • ! set PORT8 and PORT9 to input
        • ! mov.l porta,r0
        • ! mov.l pctra_clr,r2
        • ! mov.l @r0,r1
  • Build JinGasa.bin:
    • cd src
    • edit the Makefile to your paths !
    • make

Burning

  • To burn JinGasa.bin on a 2MB UV-eprom ST M27C160-100F1:
    • Erase the chip using an eprom UV eraser
      • Depending on the UV eraser, you may need 15 to 30 minutes of erasure time.
    • Burn JinGasa.bin using an eprom programmer
      • Before buying a programmer, make sure the ST M27C160-100F1 is listed in the supported devices of that programmer !

Naomi 1 variants

  • Certain Naomi 1 boards (the later revisions) have 5 populated jumpers JP9 to JP13.
  • This indicates that serial communication will also be possible via the CN8 connector on the filter board.
  • cfr Mame source code:
    • without: models 837-13707 (171-7772F/837-13544-01)
    • with: models 837-14351 (171-8183C) and 837-14601 (171-8183E).
  • TODO: insert images

Naomi 1 / 2

  • The Naomi 1/2 exposes the SH-4 SCIF serial pins in 1 or 2 ways:
    • via the internal CN1 100-pin connector:

      • available on all Naomi 1 & 2
      • max baudrate: 1562500
      • CN1 pins (cfr OzOnE's analysis):

      CN1 pins

      • Naomi 1 without JP9-JP13: CN1 SCIF works out-of-the-box, nothing special needed.
      • Naomi 1 with JP9-JP13: TODO, probably similar to Naomi2.
      • Naomi2: By default, RXD2 and CTS2 are disabled on CN1. To enable them, JP6 and JP7 should be populated / pins 1-2 should be connected, and the trace between pins 2-3 at the back of the board should be cut (RXD2 is linked to JP6-2, and CTS2 to JP7-2).

      Naomi2 JP6-JP7

    • via the external CN8 connector on the filter board:

      • available on all Naomi 2, but only on Naomi 1 that have JP9-JP13.
      • max baudrate: 390625
      • DANGER !
        • According to Mame, the Naomi 2 uses 12V voltage levels on CN8, while the Naomi 1 uses 3V3 voltage levels ! I haven't checked this myself, since I don't have a Naomi 1 with RS-232 (TODO) !
      • Prerequisite:
        • set JP9 to JP13 to 2-3. (cfr Mame source)
          • Naomi1 with JP9-JP13: TODO
          • Naomi2: Naomi2 JP9-13
      • CN8 pins (Naomi2. Not verified on Naomi1 (TODO)):
      • The CN8 connector is a JST NH 6pin B6P-SHF-1AA
      • Naomi 2: seems to be connected to D4721 - NEC uPD4721GS RS-232 Line Driver/Receiver at 3.3V / 5V (TSSOP20), located at the opposite side of the filter board, near the fan ?

System SP

  • The System SP exposes the SH-4 SCIF serial pins in 2 ways:
    • via the CN11 100-pin connector:

      • max baudrate: 1562500
      • CN11 pins - similar to the Naomi (cfr OzOnE's analysis):

      CN1 pins

      • RXD2 and CTS2 seem to be disabled - not sure yet if not connected at all, or needing some I/O initialization to make it work (TODO). Can be made working by soldering 2 cables from the CN11 to resistors on the back of the board: CN11-RXD2 -> R16S, and CN11-CTS2 -> R32S

      CN11 RXD2_CTS2

    • via the CN16 connector:

      • (in progress - code not included here yet - thanks to MetalliC, we know that it needs an extra initialiation - of a "IO Control" register at 0xA101011C)
      • max baudrate: 781250
      • DANGER !
        • Requires RS232 signal-level (typically 9-12V) on the pins !
      • CN16 pins:
        • 1-4 (TXD, RXD, RTS, CTS), 5 and 10 are GND System SP CN16 pinout
      • The CN16 connector is a JST NH 10pin BS10P-SHF-1AA
  • Mame System SP info

Katana SET5

  • The SET5 exposes the SH-4 SCIF serial pins via the Modem board, to the external connector marked "SERIAL"
    • This is a regular RS232 (12V) output
    • Max baudrate: 520833
      • Faster speeds probably possible by bypassing the modem, and connecting directly to the SET5 motherboard.

Connection to your USB-Serial adapter

  • Connect the Naomi/System SP pins to your USB-Serial adapter like this:
    • GND <-> GND
    • TXD <-> RXD
    • RXD <-> TXD
    • RTS <-> CTS
    • CTS <-> RTS
  • If you need to connect it to a 12V RS232 male connector, this is the pinout of that male connector, viewed from the front:

RS232 male pinout

SH-4 Baudrates

  • To obtain the most optimal serial communication between the SH-4 cpu and your PC, you need to:
    • use a USB-Serial chip that can generate baudrates as close as possible to the SH-4 baudrates
    • select a baudrate that matches the SH-4 baudrates as close as possible
  • The baudrates the SH-4 can generate, are:
    • Up until 115200, you can use the common baudrates: 9600, 19200, 38400, 57600, 115200.
      • Note about 115200: In fact, the SH-4 can only generate 111607 or 120192, but since 115200 is only a 3.22% deviation from 111607, 115200 usually works. 111607 or 120192 might give better results though.
    • Higher baudrates: 223214, 260416, 312500, 390625, 520833, 781250, 1562500.
    • Not recommended: 230400 (11.53%), 460800 (11.53%), 500000 (4.00%), 576000 (26.27%), 921600 (41.02%), 1000000 (36.00%), 1152000 (26.27%), 1500000 (4.00%).
      • The deviation % compared to the SH-4 supported baudrates are mentioned between () here above. A deviation of 2-3% usually works, but a deviation of 4 % only works on specific chips (aka chip luck).
  • The most compatible chip known today is the Silicon Labs CP2102N, it supports all SH-4 baudrates up to 1562500.
  • FTDI FT232R-like chips are not really recommended, they are good until 781250, but they do NOT support 1562500 (only 1500000, hence you'll depend on chip luck).

Big Thanks to

  • Colton for all the good tips during this project, for finding the Naomi2's JP6-JP7 functionality, and for finding & testing SCIF on CN11 on the System SP.
  • OzOnE for the Naomi pinouts
  • MetalliC for - amongst others - explaining how to enable the CN16 serial on the System SP
  • Mame for all the low-level info
  • The open source Dreamcast SDK KallistiOS
  • DragonMinded's NaomiDev and libnaomi pages & source code
  • The good people of the Simulant Discord

Other Interesting Links

About

experimental custom BIOS for Naomi1/2, System SP and SET5

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published