Files
mame2003-plus-libretro/src/includes/namcos22.h
T
zanacandClaude Opus 5.5 34988bc120 Namco System 22 / Super System 22 from current MAME (#2206)
Replaces the old namcos22 driver (no DSPs, every game not working) with a
C89 backport of the current MAME driver:

- new Namco C71 core (TMS320C25 with internal ROM) for the master and
  slave DSPs: MAME's tms320c2x instructions, a page table memory system;
- Super System 22 (68EC020, M37710 MCU with C352 and MB87078 volume) and
  System 22 (68020, C74 MCU with internal BIOS);
- the video: display list simulation, z-sorted polygons and sprites,
  text layer, fog, fades, alpha, spot RAM, gamma; MAME's rasterizer
  rules, single threaded, with 1/z every 8 pixels and fast paths;
- the "Threaded Video" option (was "ST-V Threaded Video") draws the
  frame in bands on 2 to 4 threads (3D scene, text layer, mix, gamma),
  same picture;
- M37710: timer A event counters count up or down (output pin or up/down
  register, as MAME), for the Prop Cycle pedal and the Armadillo Racing
  trackball;
- C352: optional routing of the four outputs to the stereo stream (rear
  speakers, cabinet speakers), as current MAME maps them to stereo; off
  unless a driver asks for it, System 11/12 unchanged;
- game I/O as MAME: driving games and Cyber Commando on System 22,
  Alpine Racer steplock motor, Alpine Surfer ROM banking, Armadillo
  Racing trackball, default EEPROMs.

System 22 sets (namcoc74 BIOS): ridgerac, ridgeraca, ridgeracb,
ridgeracc, ridgeracj, ridgera2, ridgera2j, ridgera2ja, ridgera28,
cybrcomm, raverace, raveracej, raveraceja, acedrive, victlap, victlapa,
victlapj.

Super System 22 sets: alpinerd, alpinerc, alpinerjc, airco22b, cybrcycc,
cybrcyccj, dirtdash, dirtdasha, dirtdashb, dirtdashj, timecris,
timecrisa, timecrisj, propcycl, propcyclj, alpines, tokyowar, tokyowarj,
aquajet, alpinr2b, alpinr2a, adillor, adillorj.


Claude-Session: https://claude.ai/code/session_01N3fzdsnzkQVtgYtYzqepjX

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-05 13:08:58 -05:00

89 lines
2.8 KiB
C

/***************************************************************************
Namco System 22 / Super System 22
Backported from current MAME (Phil Stroffolino, hap, R. Belmont and
others, BSD-3-Clause).
***************************************************************************/
#ifndef NAMCOS22_H
#define NAMCOS22_H
enum
{
NAMCOS22_AIR_COMBAT22,
NAMCOS22_ALPINE_RACER,
NAMCOS22_CYBER_COMMANDO,
NAMCOS22_CYBER_CYCLES,
NAMCOS22_PROP_CYCLE,
NAMCOS22_RAVE_RACER,
NAMCOS22_RIDGE_RACER,
NAMCOS22_RIDGE_RACER2,
NAMCOS22_TIME_CRISIS,
NAMCOS22_VICTORY_LAP,
NAMCOS22_ACE_DRIVER,
NAMCOS22_ALPINE_RACER_2,
NAMCOS22_ALPINE_SURFER,
NAMCOS22_TOKYO_WARS,
NAMCOS22_AQUA_JET,
NAMCOS22_DIRT_DASH,
NAMCOS22_ARMADILLO_RACING
};
/* big endian views of the 32-bit RAMs (stored as native data32_t) */
#define NTHBYTE32(base, n) (((base)[(n) >> 2] >> (8 * (~(n) & 3))) & 0xff)
#define NTHWORD32(base, n) (((base)[(n) >> 1] >> (16 * (~(n) & 1))) & 0xffff)
#define SIGNED12(v) ((INT32)((UINT32)(v) << 20) >> 20)
#define SIGNED18(v) ((INT32)((UINT32)(v) << 14) >> 14)
#define SIGNED24(v) ((INT32)((UINT32)(v) << 8) >> 8)
/* drivers/namcos22.c */
extern int namcos22_gametype;
extern int namcos22_is_ss22;
extern data32_t *namcos22_polygonram; /* 0x8000 dwords, 24 bits connected */
extern data32_t *namcos22_spriteram;
extern data32_t *namcos22_vics_data;
extern data32_t *namcos22_vics_control;
extern data32_t *namcos22_mixer;
extern data32_t *namcos22_paletteram;
extern data32_t *namcos22_cgram; /* text layer tiles; the tilemap is at 0x1e000 */
extern data32_t *namcos22_czram; /* System 22 */
extern data16_t *namcos22_shareram;
extern data8_t *namcos22_gamma_proms; /* System 22 */
extern int namcos22_pdp_render_done;
extern int namcos22_render_refresh;
extern int namcos22_slave_simulation_active;
extern UINT32 namcos22_pdp_frame;
extern INT32 namcos22_point_read(offs_t offs);
extern void namcos22_pdp_handle_commands(UINT16 offs);
extern UINT8 namcos22_syscontrol[0x20];
extern int namcos22_irq_enabled, namcos22_irq_state;
/* vidhrdw/namcos22_vidhrdw.c */
VIDEO_START( namcos22s );
VIDEO_START( namcos22 );
VIDEO_UPDATE( namcos22s );
VIDEO_UPDATE( namcos22 );
VIDEO_STOP( namcos22 );
int namcos22_video_threads_available(void);
void namcos22_video_reset(void);
void namcos22_draw_direct_poly(const UINT16 *src);
WRITE32_HANDLER( namcos22_paletteram_w );
WRITE32_HANDLER( namcos22_cgram_w );
READ32_HANDLER( namcos22_tilemapattr_r );
WRITE32_HANDLER( namcos22_tilemapattr_w );
READ32_HANDLER( namcos22s_czattr_r );
WRITE32_HANDLER( namcos22s_czattr_w );
READ32_HANDLER( namcos22s_czram_r );
WRITE32_HANDLER( namcos22s_czram_w );
READ32_HANDLER( namcos22s_spotram_r );
WRITE32_HANDLER( namcos22s_spotram_w );
READ32_HANDLER( namcos22s_vics_control_r );
WRITE32_HANDLER( namcos22s_vics_control_w );
WRITE32_HANDLER( namcos22s_chipselect_w );
#endif