Page 1 of 1

Gyruss (FDS Conversion) (Kaiser KS-7057)

Posted: Fri Sep 20, 2019 4:24 am
by krzysiobal
After finishing my analysis of Kaiser KS-7037 Metroid, Gyruss KS-7057 was the last one of that series that bothered my mind.

The PCB is desribed as Mapper 302. However, the description does not match the hardware - KS204 is MMC3 predecessor with 4*6 bit CHR regs, 2*5 bit CHR regs and 2*4 bit PRG regs, while this 128KiB game using 2KiB banks needs 8*6 regs + mirroring and except one 7474 there are no more latches in that PCB.

I gave my best to trace the PCB to follow the description (I dont physically have the PCB)

* Mirroring register is done using 7474 and it is placed at $8000-$9fff (mask $E000) [.......M], 0=H, 1=V (opposite what wiki says)
* KS204 is wired in a way so that it controls PRG banks using its CHR registers (KS204_PPU_A12..A10 <= CPU_A13..A10)
* I don't think I quite follow what is going with the KS204's D5..D0 and A14/A13/A0:
Image
- IC10B from logical view point is doing nothing, but electrically it adds delay to rising/falling edge of M2
- if so, on the rising edge of M2, KS204 sees:
pin3 = CPU-A14,
pin4 = CPU-A13,
pin5 = CPU-A12,
pin6 = CPU-A1,
and on the falling edge:
pin3 = CPU-D3
pin4 = CPU-D2
pin5 = CPU-D1
pin6 = CPU-D0
- KS204 pin 9 is wired to CPU A0,
- KS204 pin 8 is wired to CPU D4 (according to mapper description, D4 shouldn't be taken into account at all)
This makes me think that KS204 despite similar pinout is not behaving the same like in Kaiser KS-7037 Metroid PCB (is it some programmable chip?)

* PRG memory map is

Code: Select all

			 
      | /RM CPU CPU CPU CPU | PRG PRG PRG PRG PRG PRG | comment
 ADR  | SEL A14 A13 A12 A11 | A16 A15 A14 A13 A12 A11 |
$6000 |  1   1   1   0   0  |  E   E   e   e   e   e  |
$6800 |  1   1   1   0   1  |  F   F   f   f   f   f  |
$7000 |  1   1   1   1   0  |  G   G   g   g   g   g  |
$7800 |  1   1   1   1   1  |  H   H   h   h   h   h  |
$8000 |  0   0   0   0   0  |  A   A   a   a   a   a  |
$8800 |  0   0   0   0   1  |  B   B   b   b   b   b  |
$9000 |  0   0   0   1   0  |  C   C   c   c   c   c  |
$9800 |  0   0   0   1   1  |  D   D   d   d   d   d  |
$a000 |  0   0   1   0   0  |  1   1   0   1   0   0  |  PRG_A16 = 1, PRG_A15 = 1, PRG_A14..A11 = CPU_A14..A11
$a800 |  0   0   1   0   1  |  1   1   0   1   0   1  |  PRG_A16 = 1, PRG_A15 = 1, PRG_A14..A11 = CPU_A14..A11
$b000 |  0   0   1   1   0  |  1   1   0   1   1   0  |  PRG_A16 = 1, PRG_A15 = 1, PRG_A14..A11 = CPU_A14..A11
$b800 |  0   0   1   1   1  |  1   1   0   1   1   1  |  PRG_A16 = 1, PRG_A15 = 1, PRG_A14..A11 = CPU_A14..A11
$c000 |  0   1   0   0   0  |  1   1   1   0   0   0  |  PRG_A16 = 1, PRG_A15 = 1, PRG_A14..A11 = CPU_A14..A11
$c800 |  0   1   0   0   1  |  1   1   1   0   0   1  |  PRG_A16 = 1, PRG_A15 = 1, PRG_A14..A11 = CPU_A14..A11
$d000 |  0   1   0   1   0  |  1   1   1   0   1   0  |  PRG_A16 = 1, PRG_A15 = 1, PRG_A14..A11 = CPU_A14..A11
$d800 |  0   1   0   1   1  |  1   1   1   0   1   1  |  PRG_A16 = 1, PRG_A15 = 1, PRG_A14..A11 = CPU_A14..A11
$e000 |  0   1   1   0   0  |  1   1   1   1   0   0  |  PRG_A16 = 1, PRG_A15 = 1, PRG_A14..A11 = CPU_A14..A11
$e800 |  0   1   1   0   1  |  1   1   1   1   0   1  |  PRG_A16 = 1, PRG_A15 = 1, PRG_A14..A11 = CPU_A14..A11
$f000 |  0   1   1   1   0  |  1   1   1   1   1   0  |  PRG_A16 = 1, PRG_A15 = 1, PRG_A14..A11 = CPU_A14..A11
$f800 |  0   1   1   1   1  |  1   1   1   1   1   1  |  PRG_A16 = 1, PRG_A15 = 1, PRG_A14..A11 = CPU_A14..A11

Internal registers:
$b000 [....aaaa]
$b001 [......AA]
$b002 [....bbbb]
$b003 [......BB]
$c000 [....cccc]
$c001 [......CC]
$c002 [....dddd]
$c003 [......DD]
$d000 [....eeee]
$d001 [......EE]
$d002 [....ffff]
$d003 [......FF]
$e000 [....gggg]
$e001 [......GG]
$e002 [....hhhh]
$e003 [......HH]

Image Image Image Image

Re: Gyruss (FDS Conversion) (Kaiser KS-7057)

Posted: Sat Sep 21, 2019 10:25 am
by lidnariq
zxbdragon has previously asserted that the KS204 is programmable logic.

Re: Gyruss (FDS Conversion) (Kaiser KS-7057)

Posted: Tue Oct 08, 2019 3:33 pm
by krzysiobal
I was so much obsessed about that chip so I hit up on a really crazy idea of making replica of the Gyruss cartridge, with exact wiring and components. And then put into it KS204 from Metroid cartridge to see if that will work.
I had silent intuition that both KS204 are the same chips :oops:
Image

I needed also to make 100% compatible KS204 replica, using FPGA to put into that cartridge first to see if the cartridge is OK.
Image Image Image Image

After implementing in VHDL how I thought the Gyruss' chip worked, I put it inside and.. it worked.
At this point I Was wondering why the CPU-A12/A13 are muxed and latched inside KS204 on rising edge of M2, if they're also wired to pins17/18, anyway.

Next I put the KS204 into cartridge and.. it did not work. :cry:
Image

I was quite disappointed, but I checked it in kazzo and by writing to $b000/$b001 I was able to read correctly the whole rom at $8000-$87ff. And also by other 7 pair of registers too!

So it was suspicious. Then I checked it on different console and it works!
Now I am wondering why It did not worked even one time out of 20 runs on my home-made one, which contains discrete chips? No single cartridge failed to work on it.
* Too long in RESET? I decreased the RESET capacitor on cartridge - did not help.
* Some hazards during power up? I pulled CPU R/W to VCC - didn not help.
* The original M2 pulldown to GND suggested me that there might be some issude with that. I replaced the 74HCT139 in my console with 74LS139 and.. it worked!
Image

Either the M2-ROMSEL delay is causing problems, or.. during powerup, when CPU is held in reset for some time, M2 is high impedance, which might cause the 74HCT139 generate false /ROMSEL cycles. 74LS139 has internal pullup so it won't.

Anyway, I am annoucing that KS204 in both cartridges is probably the same one, so maybe same also with KS202? Now I am wondering how the KS204 knows that it should operate in Gyruss' or Metroid mode...