XaiJu
Coin-Op Collection
Coin-Op Collection

patreon


Coin-Op Collection Presents: Twin Cobra (RC1)

The beta release of Kyūkyoku Tiger / Twin Cobra marks the 13th Toaplan entry in the Coin-Op Collection! Twin Cobra is one of Darren's favorite arcade games and is something he's looked forward to working on for some time. Released in late 1987, Twin Cobra was a highly popular vertical shooter and a huge success for Toaplan. Distributed by Taito, it ranked as the third-highest-grossing arcade machine in the United States in December 1987 and the fourth-highest-grossing arcade machine in Japan in January 1988.



Darren and I began examining Twin Cobra in August of last year. I had acquired a working Flying Shark several months earlier but passed on a Twin Cobra board due to cost (we purchased a Twin Cobra PCB six weeks ago). Darren started sprite and tile decoding in August 2023. After he successfully rendered tiles and sprites, I created the shell for Twin Cobra, and between us, we had the game successfully booting by late September 2023.


There were challenges to overcome to reach our current state. The majority stemmed from the Texas Instruments TMS32010 / TMS320C1X digital signal processor. Unlike in Demon's World, the TMS32010 is used for much more than a protection check in Twin Cobra. The DSP controls all enemy shots and movements and checks for collisions with enemy fire or with the enemies themselves.

Initially, we attempted to use an available TMS32010 module written by srg320 for his Battletoads implementation. Unfortunately, after modifying the module, it wouldn't proceed past the ROM checks due to it being a partial implementation.

In November 2023, developer Raki released an alpha version of the TMS32010. After modifying this module, we passed the ROM checks, and the game fully booted. But there were still issues, mainly revolving around collision and movement.

Collision Examples:

The rendered gif provides and example of enemy collision and enemy fire based on helicopter placement. Graphical glitches are present due to horizontal line count, sprite and tile placement, and priority encoding.


During the holidays, we shifted our focus to developing another Toaplan title, Snow Bros, and temporarily set aside debugging the TMS32010. Snow Bros ended up in a stalemate similar to Twin Cobra but I'll address that in an upcoming post!

In February, Darren, Pramod, and I spent several weeks addressing the collision and movement issues. Collectively, we narrowed the issues down to instructions missing and incorrect ALU (arithmetic logic unit).

Further debugging utilizing custom compilations of emulators (MAME / FBNeo) and the module proved we were on the right track. Pramod was able to make the helicopter invincible by modification but unable to resolve the collision issues.

Developer Raki reached out to us in mid-June and offered to debug the DSP implementation. He was able to resolve the issues in Twin Cobra and provided the necessary changes.

Collision / Enemy Movement Fixes:


Correct AR increment bug on the BANZ instruction
Correct AR increment / zero-eval bit width (16->9)
Correct several arithmetic calculations ( ADDH, ADDS, etc. )
Correct shifter-b behavior

Once the game reached a stable state, Darren and I began addressing the remaining graphical, buffering, and interrupt issues. To tackle buffering, Darren implemented a sprite ram buffer and tied it to vertical blanking. The most significant challenge was priority management among the three layers: the tile layer which generates the background, the sprite layer which generates the foreground, and the text layer.

There are several combinations for how the layers interact. In one case, the tile layer mixes with both the sprite and text layers. Another possibility is that the tile and sprite layers mix together, but the text layer remains separate and the text layer takes priority over both the tile and sprite layers.

Graphical Issues:

First column - Horizontal wrap due to blanking
Sprite alignment - Offset alignment, missing top row and generating a row at the bottom
Sprite flip - Line present in the middle of an explosion
GFX Priority - This was hardcoded until we overcame the challenges due to the DSP

Graphical Fixes:

First column - Adjust H/V total and offset blanking start
Sprite alignment - Adjusted priority buffer from 327 to 511; sprite x position from 320 to 327
Sprite flip - Implemented sprite flipping on x axis
GFX Priority - Implemented sprite and tile priority, palette addressing


Below is an overview of gameplay and hardware specifications. Twin Cobra is an expanded platform based on Hishōzame / Flying Shark / Sky Shark, which currently boots with issues. Darren and I have traced it back to the TMS32010.

There are still adjustments that need to be made for Flying Shark and the TMS32010; as it writes the sprite to sprite ram. It appears this and the coordinate instructions provided by the M68000 to the TMS32010 aren't be executed properly.

FPGA Core Information:

  • Flip Screen currently not implemented; cocktail mode for the one player version of Kyūkyoku Tiger will not function correctly if playing a two player game.

  • If you have issues syncing to a commercial CRT, toggle the refresh rate from "native" to "NTSC". This will change the vertical refresh rate from 54.9 to 59.7; this will alter gameplay from it's original state.

  • CRT placement not set; if you encounter screen placement issues adjust the H/V positioning toggles.

  • 68k frequency toggle; increase the frequency from 7MHz to 11.67MHz for Kyūkyoku Tiger and 10MHz to 17.5MHz for Twin Cobra; this will alter gameplay from it's original state and address any undesired native slow down.

Hardware Specifications:

Kyūkyoku Tiger uses a multi-processor system, featuring a Motorola 68000 CPU as its main processor, clocked at 7 MHz; a Texas Instruments TMS320C10 microcontroller running at 14 MHz; and a Zilog Z80 CPU at 3.5 MHz, which handles audio processing. Audio playback is generated from the Yamaha YM3812 FM OPLII in tandem with a Yamaha YM3014 DAC. Additionally, Twin Cobra featured a 10 MHz oscillator for the Motorola 68000 CPU in order to support cooperative gameplay.

The hardware employs custom chips, notably the TOAPLAN GXL-01, TOAPLAN-02 M70H005, and TOAPLAN SCU, which handle tile and sprite generation. These are managed by a Hitachi HD6845SP CRT controller, running at 3.5 MHz. The controller operates with a 7 MHz pixel clock and outputs 15.695067 kHz for horizontal and 54.877857 Hz for vertical refresh rates.

Gameplay Information:

Kyūkyoku Tiger / Twin Cobra is a vertical scrolling shooter where players control a helicopter equipped with two primary actions: a main shot and smart bombs. The main shot is used for both air and ground attacks, allowing players to destroy enemy planes, ships, tanks, and certain buildings. The smart bomb, while limited in number, delivers a powerful blast that can clear multiple enemies at once.

If the player is hit by enemy fire or collides with an enemy aircraft, they lose a life and are sent back to the nearest checkpoint. The game ends when all lives are lost. The game spans 10 stages, and upon completing the 10th stage, the player starts a more challenging loop (stages 1-10). This cycle continues until the game is over, with difficulty increasing progressively until the 16th loop, where enemy bullet speed is significantly heightened.

Item Information:

Target and eliminate pickup carriers, like the large green chopper, to access hidden pickups.

Enhance your firepower:

  • Collect 'S' to boost shot power and range

  • Grab 'B' for an additional bomb

Upgrade the TC-7 weapon system:

  • Blue: Acquire a spreading forward shot

  • Green: Gain a powerful forward shot

  • Red: Obtain a wider forward shot

  • Yellow: Unlock a 4-direction narrow shot

Maximize your score:

  • Destroy buildings to reveal 'P' stars

  • Collect these stars for bonus points at the level's end

Regional Differences:

Twin Cobra implements a more forgiving respawn system, allowing players to instantly reenter the action upon losing a life, rather than returning to a checkpoint. In the event of a tie with a boss, the game skips the landing scene and seamlessly transitions to the next stage's music.

However, these player-friendly changes come with a trade-off: while Twin Cobra boasts faster ship movement and co-operative gameplay, it reduces the on-screen bullet capacity from Kyūkyoku Tiger's four-round bursts to three-round bursts, these changes alter gameplay strategy and balance.

In 1989, Taito released an updated version of Kyūkyoku Tiger that introduced co-operative gameplay at the cost of reducing on-screen bullet capacity. The final version incorporates two new features that could be activated via dipswitches on the PCB: a "screen halt" function, which pauses gameplay, and an "invulnerability" mode for practice.

Upcoming Releases / Notes:

Pramod and I attended Too Many Games at the end of June; we did our first Coin-Op Collection panel. If you'd like to view the full presentation, I've got the raw footage and can upload it here. The Coin-Op Collection team plans to attend a more conventions in 2025. Have a great weekend and enjoy!



Coin-Op Collection Presents: Twin Cobra (RC1) Coin-Op Collection Presents: Twin Cobra (RC1) Coin-Op Collection Presents: Twin Cobra (RC1)

Comments

I understand, and don’t worry you should never be held to a date. I am happy with it is ready when it is ready 👍. Just glad you can look at it when you can.

Alan Shurvinton

Anytime! "Next week" meant after MK releases.

atrac17

Thank you so much, and thanks again for all you are doing.

Alan Shurvinton

Will circle back to Flying Shark and screen flip sometime next week.

atrac17

Hi guys, I know you are very busy but is there any chance you can get the Invert Screen dip switch fixed. It plays fantastic on the tv but i would really like to play on the Arcade Machine. Thanks again 👍

Alan Shurvinton

Thanks for your reply, okay i'll wait 🙄

Tymour Azzam

Currently, all Toaplan cores that require a YM3812 uses jtopl. There are bass and percussion issues with playback that have been reported, starting in 2022. Until there is a replacement, it's the best version of opl. There is a die shot replacement module for opl2 being worked on by another author. When it is released, the module will be compared and swapped.

atrac17

Hi, thanks for the hard work, i wanted to adress an issue i have with various cores you have developped. I dont know if there is something i'm missing but i find the audio very harsh and sometimes distorted, i have this issue specifically on the Toaplan cores but i only can compare Truxton/Tatsujin as it is the only board i own. Once i arrive to the second level it becomes very obvious that all the bass part of the music is getting very distorted... I have tried adjusting settings with no luck. Same goes for this Kyūkyoku Tiger core where the soundtrack is a bit off when i compare to youtube longplays recordings and the SFX are very harsh... Maybe it is an open issue on discord or such but i didnt found anything on the subject. Thanks if you can help me and thanks anyway for all the great cores ! Regards Tymour

Tymour Azzam

This is the best news in many years regarding Mister! Keep up the great work!!!

Niklas Lindström

Absolutely fantastic, I have some fond memories of this down in the beach arcade. Thank you 👍

Alan Shurvinton

not yet, will get to it soon

atrac17

Excellent work!

yomitron

sub'd and now I'll have to pull the mister back out. Been using my AP for too long lol

F34R

This game has a very special place in my heart, wonderful work gentlemen.

Christopher Brown

Thank you! As a bonus, one of the very best shooter soundtracks!

Alex Limi

Thanks guys :)

Geckofingers

very nice dear. cps3 core wen??

80's spaceman

Nice work guys. Thanks!!!

Juan Carlos Pastor (Denymetanol)

Thank you very much for the efforts and explanation - gold standard as always - looking forward to flying shark too :)

Michael Johnson

does this work with the analogue pocket?

f3bandit

Excellent core!!! Thanks

ronalvel .


More Creators