Eshs

From DaphneWiki

Revision as of 23:00, 15 September 2021 by Matt (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Intersteller to Esh's Conversion Video

https://youtu.be/P1-Usce5N1w

Esh Test ROM

Written by Matt Ownby in late 2020, this replaces the H8 ROM on the Esh PCB and quickly runs through a bunch of tests to mostly determine whether the PCB is working correctly. Source code included.

http://www.rulecity.com/esh/esh_test_v2.zip

Hardware

Schematics

http://www.rulecity.com/esh/esh-schematic-22mar2021.pdf

Memory Map

Address Range Description
0x0000-0x1FFF ROM H8
0x2000-0x3FFF ROM F8
0x4000-053FFF ROM E8
0x6000-073FFF ROM D8
0x8000-0x9FFF ROM C8
0xA000-0xDFFF Not connected
0xE000-0xE7FF CPU RAM (B8)
0xF000-0xF7FF Video RAM (F3)

Z80 Port Map

Address Range Direction Description
0xF0 In Control panel input. Only lower 6 data bits are used. Active low.
Bit Description
0 COIN 1
1 COIN 2
2 START 1
3 START 2
4 TEST
0xF1 In Control panel input. Only lower 6 data bits are used. Active low.
Bit Description
0 UP
1 DOWN
2 LEFT
3 RIGHT
4 ACTION 1
5 ACTION 2
0xF2 In Control panel input. Only lower 6 data bits are used.
0xF3 In Control panel input. Only lower 6 data bits are used.
0xF4 In/Out LD-V1000 data. Writing queues a command to be sent on the next command strobe. Reading reads the most recent byte received during last the status strobe.
0xF5 Out Misc value.
Bit Description
0 Not connected
1 is audio (1 = audio signal comes from a vertical counter (VA3), 0 = audio signal is low).
2,3 Bit 2 and 3 deal with whether to show the laserdisc image or not. If bit 3 is high, A7 of the RGB prom is also high, laserdisc video is suppressed, and bit 2 is ignored. If bit 2 is high (and bit 3 is low) A7 of the RGB prom is low, and laserdisc video is suppressed.
4-7 Bits 4-7 indirectly map to A8 of the RGB PROM. They are selectable via bits 6 and 7 of the tile attribute (video memory 0xF400-0xF7FF). Although the hardware applies no further restrictions on use, the Esh program will constantly cycle each of these bits. Bit 4 doesn't cycle at all and is always high. Bit 5 cycles at about 15 Hz. Bit 6 cycles at about 7.5 Hz. Bit 7 cycles at about 4.3 Hz. The game uses this for variable blink speed.
0xF8 Out 0 disables start 1 button lamp. 1 enables.
0xF9 Out Start 2 button lamp. 0 disables, 1 enables.
0xFA Out 0 disables action button lamp. 1 enables.
0xFB Out 0 disables joystick lamp. 1 enables.
0xFC Out Not connected
0xFD Out Not connected
0xFE Out 0 holds IRQ' line high (disabled) by forcing a latch to be clear. 1 stops forcing latch to be clear, which allows IRQs to set the latch. To allow a future IRQ, this port must have 0 followed by 1 written to it.
0xFF Out 0 holds NMI' line high (disabled) by forcing a latch to be clear. 1 stops forcing latch to be clear, which allows NMIs to set the latch. To allow a future NMI, this port must have 0 followed by 1 written to it.

Z80 Interrupts

NMI: Caused by LD-V1000 status strobe going low (becoming active)

IRQ: Caused by D2 output (pin 10) on vertical PROM (C6) transitioning from 0 to 1. This ends up being 60 Hz (vsync).

Video RAM Structure

Screen is divided into 32x32 tiles. The first tile is the top left.

0xF000-0xF3FF contain which tile to show.

0xF400-0xF7FF contain tile attributes. For example, 0xF400 would have attributes about the tile index at 0xF000.

Bit Description
0-3 Which color palette to use for the tile.
5-6 Not used
6-7 Blink frequency. 0: no blinking, 1: blink at about 15 Hz, 2: blink at about 7.5 Hz, 3: blink at about 4.3 Hz ; The blink frequency is controlled by the Z80 program, and is not a hardware restriction.

Tile and color palette details

The tile bitmaps are stored in M3, L3, and K3 EPROMs (also labeled as "A", "B", and "C" with stickers). Each tile pixel is represented by a color index ranging from 0-7 (3 bit). Each EPROM contains 1 bit of this color index. M3 contains the least significant bit, L3 the middle, and K3 the most significant bit. Each byte in the EPROM represents a tile row of 8 pixels. To find the data for a tile, take the tile index (for example 0x40 for a solid block) and multiply by 8 (8 rows per tile). Continuing our example, this would take you to offset 0x200 where you would find 8 consecutive 0xFF bytes to represent the solid block. Each color index would be 7 in this example (because each bit would be 1, so 111 binary is 7 decimal). This value of 7 would make up the least significant bits in the color PROM address (A0-A2). The color palette value (4 bits) would be the next significant bits of the color PROM address (A3-A6) (so there are 16 possible color palettes available to choose from). A7 determines the background color if laserdisc video is hidden (0 for black, 1 for blue when using the values inside the Esh color PROM). A8 is used for a blinking effect where 0 means a blink is 'in progress' and 1 otherwise.

Color PROM Address Bit Description
0 Color index from M3
1 Color index from L3
2 Color index from K3
3-6 Which color palette to use.
7 0: Black or transparent (laserdisc video shown) background. 1: Blue background.
8 0: Blinking is 'in effect' so display background color. 1: Blinking is 'disabled' so display selected color normally.

Color PROM output

Color PROM data bit Description
0-2 Red index
3-4 Green index
5-6 Blue index
7 Transparency (0 = opaque, 1 = transparent)

NOTE : the transparency bit is only honored if the 'misc' value is set accordingly. Else it is ignored.

Color PROM to RGB calculation

Red has 3 bits (0-7), green and blue have 2 bits (0-3). Red goes through 3 resistors: 220, 470 and 1000 Ohms. Blue and green go through two resistors: 220, 470. For red, parallel resistance should be taken account (sometimes two of the resistors will have high inputs or two will have low inputs). For green/blue, if the inputs to the resistors are different (one high, one low), one can imagine a circuit with two resistors in series that create a voltage divider. For each color, the highest resistance is the least significant bit of the color index.

Color Index Voltage 8-bit value
Red 0 0 0
Red 1 0.52 33
Red 2 1.11 71
Red 3 1.63 104
Red 4 2.37 151
Red 5 2.89 184
Red 6 3.48 222
Red 7 4 255
Green/Blue 0 0 0
Green/Blue 1 1.28 82
Green/Blue 2 2.72 173
Green/Blue 3 4 255

Caveat: Just because these are the theoretical values does not mean the Esh color PROM is guaranteed to use all of them.

Measured values

Using color palette 14 (nearly white) and tile index 0x40 (solid block), here are the actual measured voltage values from a 82S147 PROM used in Esh:

Description Voltage
Analog Red 3.0V
Analog Green 3.4V
Analog Blue 3.6V
PROM pins 8 ("D2"), 11 ("D4") and 13 ("D6") 3.6V

NOTE: The PROM byte output is 0x7E so it makes sense that red is at a lower level. I am unclear why green and blue are not both 3.6V, however. Perhaps resistor inaccuracy?

Conclusion: The PROM's high output level is about 3.6V

PROM replacements

H and V PROMs are MB7052. I've replaced them with a single CPLD chip, the Xilinx XC9536XL-5VQG44C.

RGB PROM is MB7124. MB7124 are compatible with 82s147 proms which I have found to work. If these become unavailable, the CPLD option is my recommendation. I would also use the SN74LVC4245A in order to output 3.6V instead of 3.3V (the original PROM appears to output 3.6V).

Audio

Sampled from pin 1 of the audio connector on the Esh PCB (CN1).

Esh audio buzz.png

Lamps

D2 on the Esh PCB will connect lamp lines to ground when the lamp is to be enabled. Therefore, if testing with, for example, a 20mA LED and 12V power, you would need to to wire one end of the LED to 12V and a 820 ohm resistor, and the other end to the output of one of the D2 lines. Once a path to ground is created, the LED will light up.

  1. LAMP_JOYSTICK will light up when a valid joystick move needs to be made in order to not die.
  2. LAMP_ACTION will light up when a valid action button move needs to be made in order to not die.
  3. LAMP_START1 and LAMP_START2 light up when the associated buttons may be pressed to start a game.


Troubleshooting

Timing Troubleshooting

Unplug edge connector and apply only 5V/GND to PCB edge. Unplugging edge connector removes ambiguity about whether timing is coming from laserdisc player sync or PCB-generated sync (which is slightly different).

Esh minimal power.jpg


Check B7, pin 3. Must be stable 18.432 MHz clock. If not stable, check resistors/cap near clock.

Esh B7 P3.png


Check B7, pin 10. Must be stable 6.144 MHz clock. If not stable, check B3 and A5.

Esh B7 P10.png


With sync PROMS removed, check B7 pin 14. Must be stable 12 kHz clock. (this is the 6.144MHz clock divided by 512)

Esh B6 P14 no sync prom.png


With sync PROMS removed, check D6 pin P2. Should be about 6.25 kHz. If not seeing any activity, A5 may be the problem (driving pin 13 instead of reading it like it is supposed to).

D6P2 nosync.png


With sync PROMS removed, check C7 pin P9. Should be about 45 Hz. If not, could be A5.

C7P9 NoSync.png


With sync PROMS installed, check B7, pin 14. Must be stable 15.63 kHz clock. If not stable, check H PROM (C5) and all of the horizontal counters (B6, B5, B4, and B3).

Esh B6 P14.png


Check D7, pin 12. Must be stable 59.5 Hz clock. If not, check vertical counters (C7, D7), A5, A6 and V PROM (C6).

Esh D7 P12.png


Check H7, pin 9 (CPU clock source). Must be stable 3.07 MHz clock.

(image not available)


If all is working, you can install the normal edge connector again.

"No Video" Troubleshooting

  1. Install Matt's Esh Test ROM into H8.
  2. Remove F8 ROM and B8 RAM to help isolate the problem.
  3. Attach logic analyzer to Z80 and power on PCB. Take logic analyzer capture of CPU's address/data lines after CPU has been on for a second or so. Make sure that CPU is looping in the "BAD RAM" part of the test ROM code (currently 0x9D5 - 0xA04 but this could change in the future). If it isn't, check K7 to make sure that basic routing is working.
  4. Check pin 21 (write) of F3, the video RAM, to make sure it is pulsing low.
  5. Check pin 11 of H1 (load) to make sure it is going high and low. Check pin 12 to make sure it is high.

Gameplay Troubleshooting

Having problems getting past Stage 4 after the giant sand fish emerges? Are you playing without the superimpose board? Make sure the edge connector pin 19 (DISC_VSYNC') is connected and edge connector pin V (DISC_CSYNC') is connected. Otherwise, you will not be able to play beyond this point. If you don't have a superimpose board, you can attach to Dexter's vsync and csync signals as a temporary workaround.

Dexter 3g vsync csync.png

Personal tools