MiSTer FPGA · Volume 2

The Console Cores — NES to Saturn, Menu by Menu

Which MiSTer console cores have a light gun, what their menus offer, how each one fakes its console's gun in hardware, the per-game settings hidden in the source, and the cores that have no gun at all

Every MiSTer console core that has a light gun reads it the same way, through the left analog stick that Main feeds it (Volume 1, section 1.3). What differs from core to core is the menu wording, which gun is being imitated, and how faithfully. This volume reads each core’s top-level source (the CONF_STR that defines its OSD menu) and its light-gun module. Repository heads and dates are in the sources; all were read on 20 and 24 October 2026.

The history and hardware of the original guns belong to Console Light Guns, and how each one senses the beam to CRT Timing. This volume is about the cores.

2.1 The common menu

Most gun cores carry the same three or four settings; the Sega cores gained them in May 2020 and later cores copied the wording:

Table 1 — Most gun cores carry the same three or four settings; the Sega cores gained them in May 2020 and later cores copied the wording

SettingChoicesWhat it does
Gun Control (SNES: “Super Scope”; Saturn: “LGun P1 XY Ctrl”)Disabled, Joy1, Joy2, MouseWhere the aim comes from: player 1’s or player 2’s left stick, or the relative PS/2 mouse
Gun Fire (SNES: “Super Scope Btn”)Joy, MouseWhere the trigger comes from
CrossSmall, Medium, Big, NoneA crosshair drawn by the core at the aim point
Gun Port (Master System), Gun Type (SNES, Mega-CD)per coreWhich port, or which gun

For any absolute USB gun, including the project’s OpenFIRE gun, the answer is always Joy1 or Joy2, and Joy for the trigger. The Mouse choice is relative, and the NES README warns that absolute devices “will not work via this method”. The crosshair is useful for checking calibration and is usually switched off for play.

The trigger is a button of the joystick, so it has to be mapped like any other: each core’s joystick map (J1,... in the source) names the button the trigger is assigned to (“Zapper/Vaus Btn” on the NES, “Gun Fire” on the PlayStation), and the gun’s trigger is bound to it in the OSD’s “Define buttons” screen. Mapping is per core, which the OpenFIRE release notes list as a limitation (Volume 6).

2.2 How the cores fake a gun

Figure 1 — How the Sega-family light-gun module works. On the left, the core's picture with an aim point from the gun, the aim line and the seven lines after it shaded. On the right, the checks made at every …
Figure 1 — How the Sega-family light-gun module works. On the left, the core's picture with an aim point from the gun, the aim line and the seven lines after it shaded. On the right, the checks made at every pixel clock: picture active, horizontal count equal to the aim X, line within the eight-line window; if all three, a pending flag starts a SENSOR_DELAY count, then the sensor line goes active and is held for 64 clocks, which the source's comment says is required for games that poll instead of using interrupts; off-screen aim gives no pulse. Below, a timing diagram of one line and the delay each core uses: Master System 34, Mega-CD Justifier 32 and Menacer 64, Saturn 2, Atari 7800 20 or 48 plus 2 per step of Gun X Tuning, and Genesis and 32X by cartridge ID, 44 by default with Body Count 100, Lethal Enforcers 52, Lethal Enforcers II 30, Menacer 6-in-1 120 and T2 126. Own-work diagram.

There are four families of light-gun module in the console cores, each matching how its console’s gun worked:

  1. Sega family (lightgun.sv in the Genesis, Mega Drive, Mega-CD, 32X, Master System, Saturn and Atari 7800 cores). At every pixel clock the module asks whether the picture is active, whether the horizontal count equals the aim X, and whether the current line is the aim line or one of the seven after it. If so, it waits SENSOR_DELAY clocks and drives the console’s sensor line (TH on Sega pads), then holds it for 64 more clocks: “Keep sensor active for a bit to mimic real light gun behavior. Required for games that poll instead of using interrupts.” The eight-line window imitates the real photodiode, which sees a patch of the screen rather than one pixel, and the delay imitates the gun’s own amplifier.
  2. SNES (rtl/lightgun.sv in the SNES core). The Super Scope and Justifier work by pulling the controller port’s IOBit line low, which latches the PPU’s own H and V counters. The module compares the aim with the counters and asserts the latch through a 22-stage shift register, a 22-pixel-clock delay. It does not care what is drawn on the screen.
  3. NES (rtl/zapper.sv). The Zapper reports only “light seen” and “trigger pulled”, and games such as Duck Hunt flash white boxes to find which target was hit. So the NES module does what no other core does: it looks at the colour being drawn under a 9×9-pixel window around the aim point and only reports light for bright palette entries, with a decay of 17 to 26 scanlines depending on the colour, to imitate a photodiode watching phosphor fade.
  4. PlayStation (joypad_pad.vhd, justifier_sensor.vhd). The GunCon measured the beam itself and sent numbers, so the core just computes the numbers the GunCon would have sent. The Konami Justifier instead pulsed an interrupt, and the core has a separate state machine that raises IRQ10 when its raster passes the aim.

The faithful imitation matters for the same reason the original guns were awkward: games depend on the exact moment. Families 1, 2 and 4 are blind to brightness, so a dark scene that defeats an original gun on a CRT costs nothing with a virtual one. Family 3 is not, by design, because NES gun games test brightness themselves.

2.3 NES and Famicom: the Zapper

Figure 2 — Two NES Zappers, model NES-005, the launch grey version above and the later orange version below. On MiSTer either can be used directly through a SNAC adapter on a CRT, or replaced by any USB gun t…
Figure 2 — Two NES Zappers, model NES-005, the launch grey version above and the later orange version below. On MiSTer either can be used directly through a SNAC adapter on a CRT, or replaced by any USB gun through the core's Zapper(Joy) setting. Photos: Evan-Amos, Wikimedia Commons, public domain, arranged as a plate.

Menu (NES core, HEAD 49a0a662, 30 September 2026): “Peripheral: None, Zapper(Mouse), Zapper(Joy1), Zapper(Joy2), Vaus, …”; “Zapper Trigger: Mouse, Joystick”; “Crosshairs: On, Off”; and, for an original gun, “SNAC: Off, Controllers, Zapper, 3D Glasses”. The joystick map names the trigger button “Zapper/Vaus Btn”.

What to set for a USB gun: Peripheral Zapper(Joy1), Zapper Trigger Joystick, and map the gun’s trigger to Zapper/Vaus Btn. The README’s own words: “you can choose Zapper(Joy) to use the Analog stick to aim, and the defined Trigger button to fire. Guns such as Aimtrak have joystick modes which may be compatible with this method.”

How it behaves. The module (zapper.sv, by Kitrinx, header dated April 2019) takes the stick as X from 0 to 255 and Y scaled to the 240-line picture, and treats the gun as off-screen if X is at either extreme or Y is in the top 8 or bottom 16 lines. Light is reported when the colour under the 9×9 window is bright: the brightest whites hold the light signal for 26 scanlines, the next shades 20, and paler mid-tones 17, counting down a line at a time (“Drain the light from the zapper over time”). A trigger pull asserts the trigger line for a fixed count of core clocks and then locks it out for a longer one, imitating the Zapper’s spring contact.

Per-game notes from source. A July 2026 change (d47c27f0, pull request 461) added the Vs. System Zapper, the serial gun of Nintendo’s arcade Vs. Duck Hunt and Vs. Hogan’s Alley: when a Vs. game’s header says it uses the Zapper, the core replaces controller 1’s serial report with the gun’s. Every home Zapper game uses the brightness test, so the core’s response depends on the palette chosen in the menu only to the extent that the palette changes which entries count as bright; that interaction was not tested.

2.4 SNES: Super Scope and Justifier

Menu (SNES core, HEAD 23026830, 4 October 2026): “Super Scope: Disabled, Joy1, Joy2, Mouse”; “Super Scope Btn: Joy, Mouse”; “Cross: Small, Big, None”; “Gun Type: Super Scope, Justifier”; and “SNAC: No, Yes”. The README: “Light gun support via Wiimote, mouse or analog stick.”

What to set for a USB gun: Super Scope Joy1, Super Scope Btn Joy, and Gun Type to match the game: Super Scope for Nintendo’s own titles (the Super Scope 6 pack-in, Yoshi’s Safari, Battle Clash), Justifier for Konami’s Lethal Enforcers.

How it behaves. The counter-latch path described in 2.2, with no brightness test. The Justifier mode adds the Justifier’s identification bits to its serial report and imitates its reload: a shot taken off-screen sets a reload pulse that lasts five frames. The Super Scope’s extra controls (turbo, pause, cursor) are on the joystick map; the source has a turbo toggle. A real Super Scope or Justifier can also be used through SNAC (Volume 4), because the SNAC path passes the controller port’s IOBit line in both directions.

2.5 Master System: the Light Phaser

Menu (SMS core, HEAD 8443a0d1, 14 October 2026): “Gun Control: Disabled, Joy1, Joy2, Mouse”; “Gun Fire: Joy, Mouse”; “Gun Port: Port1, Port2”; “Cross: Small, Medium, Big, None”; and “USERIO: Off, SNAC, Gear2Gear”. The README notes that “SNAC, lightgun, paddle and multitap modes take precedence over these emulated controller types on both ports.”

How it behaves. Sega-family module, SENSOR_DELAY 34. The module first appeared on 29 May 2020 (“Adding virtual phaser support”). A fix on 15 April 2026 (pull request 176, “Fix lightgun position calculation for vertical aim”) addressed the mismatch spelled out in a comment now in the file: the stick’s Y runs 0 to 255 “but vcnt only covers 0..vtotal (~191 NTSC, ~223 PAL)”. Any Master System gun set-up checked before that date may have had vertical aim errors that are now gone; it is a reason to recalibrate after updating.

Gun Port matters: most Light Phaser games expect the gun in port 1, but the setting exists because the cartridge decides. The core places the virtual gun in whichever port is chosen.

2.6 Genesis, Mega Drive, Mega-CD and 32X: Menacer and Justifier

Figure 3 — The two Konami Justifiers for the Genesis, the blue player 1 gun with its cable and the pink player 2 gun that plugs into the first. Lethal Enforcers came with the blue one. On MiSTer the Genesis c…
Figure 3 — The two Konami Justifiers for the Genesis, the blue player 1 gun with its cable and the pink player 2 gun that plugs into the first. Lethal Enforcers came with the blue one. On MiSTer the Genesis core selects Justifier behaviour and a timing offset for Lethal Enforcers automatically from the cartridge's product code. Photo: Evan-Amos, Wikimedia Commons, public domain.

There are four Sega 16-bit cores with guns, and they differ in one important way: who chooses which gun is imitated.

  • Genesis core (HEAD adc0c42c, last commit 24 February 2023) and 32X core: menu “Gun Control”, “Gun Fire”, “Cross”, and “SNAC: Off, On”. There is no Gun Type item. Instead the core reads the cartridge’s product code and sets the gun and its timing offset itself. The table in Genesis.sv, under the comment “Lightgun device and timing offsets”:

Table 2 — - Genesis core (HEAD adc0c42c, last commit 24 February 2023) and 32X core: menu "Gun Control", "Gun Fire", "Cross", and "SNAC: Off, On". There is no Gun Type item. Instead the core reads the cartridge's product code and sets the gun and its timing offset itself. The table in Genesis.sv, under the comment "Lightgun device and timing offsets"

GameProduct codeGun imitatedSENSOR_DELAY
Body CountMK-1533Menacer100
Lethal EnforcersT-95096-Justifier52
Lethal Enforcers IIT-95136-Justifier30
Menacer 6-in-1MK-1658Menacer120
T2: The Arcade GameT-081156Menacer126
Any other game—Menacer44

That table is the best per-game note in this dive: someone tuned the moment of the virtual sensor game by game, so the aim in those games should match the crosshair without further adjustment. A game not in the table runs at the default 44, and if its shots land consistently left or right of the aim it is a candidate for an entry.

  • Mega Drive core (the Nuked-MD port, HEAD becbdee7, 5 October 2026; light gun added 31 August 2023): the same menu items, with the gun type and sensor delay supplied by the cartridge module rather than a menu. SNAC is “Off, Port 1, Port 2, Port 3”.
  • Mega-CD core (HEAD a3a3da81, 30 July 2026): adds a menu item, “Gun Type: Justifier, Menacer”, because a CD game’s product code is not read the same way; the delay follows the choice, 32 for the Justifier and 64 for the Menacer. Mega-CD gun games include the CD Lethal Enforcers and the Menacer-compatible titles. SNAC is under “Serial: OFF, SNAC”.
Figure 4 — The Sega Menacer, the Genesis's wireless light gun, with its shoulder stock and the scope on top. Its light sensor was in the gun and its result crossed the room by infrared to a receiver at the co…
Figure 4 — The Sega Menacer, the Genesis's wireless light gun, with its shoulder stock and the scope on top. Its light sensor was in the gun and its result crossed the room by infrared to a receiver at the console; a MiSTer core imitates the sensor pulse the receiver would have produced. Photo: David Quach, edited by Czar, Wikimedia Commons, CC BY 3.0.

The Menacer was a CRT gun with a wireless link to a receiver on the console (Console Light Guns). Its delays in the table are mostly longer than the Justifier’s, which fits a pulse that has crossed an extra link, but the source gives no reason for any of the numbers.

2.7 PlayStation: GunCon and Justifier

Menu (PSX core, HEAD cd17b5a0, 21 August 2026): “Pad1” and “Pad2”, each with choices including GunCon, Justifier and SNAC-port1/2; “Show Crosshair: Off, On”. The joystick map names “O (Gun Fire)”, “X (Gun B)” and “Start (Gun A)”. The README’s table:

Table 3 — Menu (PSX core, HEAD cd17b5a0, 21 August 2026): "Pad1" and "Pad2", each with choices including GunCon, Justifier and SNAC-port1/2; "Show Crosshair: Off, On". The joystick map names "O (Gun Fire)", "X (Gun B)" and "Start (Gun A)". The README's table

DualShock buttonGunConJustifier
OTriggerTrigger
StartA (Left)Start
XB (Right)Special

How it behaves. GunCon (identity 0x62 in the README) is pure arithmetic: the core converts the stick byte into the 8 MHz dot-clock X the real GunCon would have reported (67 + X + X/2, a span of 67 to 449) and a scanline Y, and when the gun is off-screen it reports X = 0x0001, Y = 0x000A, the values the real gun sent to mean “no light”. Pressing Triangle, or the gun’s off-screen condition, forces those values, which is how a reload is done. A November 2022 change (a3ca44f4) added an “offscreen trigger” mode for games that reload on an off-screen shot.

The Justifier (added 1 May 2022 by Nolan Nicholson, “add Konami Justifier lightgun support”) is the interrupt type: a state machine checks when the raster is a set number of lines below the aim, then when the horizontal position matches, then pulses IRQ10 for four clock enables.

Two notes for real hardware. Because the GunCon’s real version needs composite sync, the core outputs sync on the SNAC’s interrupt line when a GunCon is selected on SNAC; a comment calls it a “quirk for guncon, irq is N/C in guncon” (Volume 4). And the PlayStation core’s scaling is 128 rather than 127 per half-axis in Main (Volume 1), a one-step difference specific to this core.

Display width. PlayStation games use several horizontal resolutions, and the GunCon’s X is in dot-clock units, not pixels, so a calibration made in one game can be off in a game using another mode. Calibration is per core, not per game (Volume 5); a PlayStation player who moves between Time Crisis and Point Blank should check the crosshair in each.

2.8 Saturn: the virtual Stunner

Menu (Saturn core, HEAD 9aa94498, 19 October 2026): “Pad 1: Digital, Virt LGun, Wheel, …”; then, when Virt LGun is chosen, “LGun P1 XY Ctrl: Joy 1, Mouse”, “LGun P1 Buttons: Joy 1, Mouse” and “LGun P1 Crosshair: Small, Medium, Big, None”; the same for player 2; and “Pad 1 SNAC: OFF, ON”.

The Saturn’s gun (sold as the Virtua Gun in Japan and Europe and the Stunner in North America) came late to MiSTer: ElectronAsh’s “Initial Virtual LightGun support” is dated 2 February 2025, with a further change on 7 May 2026. The core instantiates the Sega-family module per player with a SENSOR_DELAY of only 2 and a red crosshair. The GunCon 2 compatibility list (Volume 4) still says the Saturn has “No lightgun support yet”; that line predates February 2025 and is out of date for USB guns, though whether a GunCon 2 on a CRT works with the virtual Stunner was not found tested.

Saturn gun games include Virtua Cop and Virtua Cop 2, The House of the Dead and Area 51.

2.9 Atari 7800 and 2600

Menu (Atari 7800 core, HEAD 0dc8ad2e, 11 September 2026): “Port1 Input” and “Port2 Input”, each with a Lightgun choice among a dozen controllers and SNAC; “Gun X Tuning: 0 to 7”; “Gun Control: Joy1, Joy2, Mouse”; “Gun Fire: Joy, Mouse”; “Cross”; and, under SNAC, “SNAC Analog” and “Sega Phaser Mode”. The README: “Supports Light Guns”.

How it behaves. Sega-family module, with a delay of 20 in 2600 mode or 48 in 7800 mode, plus 2 for each step of Gun X Tuning, which exists because the 7800’s light-gun games (Atari’s XG-1 titles such as Alien Brigade, Crossbow, Meltdown and Barnyard Blaster) do not agree on their horizontal offset. A December 2022 change fixed “overscan option breaking gun and improve accuracy”. Sega Phaser Mode swaps which SNAC lines carry the trigger and the light signal; from the remapping in source it appears to let a Sega Light Phaser stand in for Atari’s XG-1 through SNAC, but that reading of its purpose is an inference.

2.10 Cores with no gun

As of 24 October 2026:

  • TurboGrafx-16 / PC Engine: no light-gun option in the menu (it has “USER I/O: Off, SNAC” for controllers).
  • 3DO: no light-gun option, though the 3DO had gun games.
  • CD-i: the README lists “Light Gun … (not yet supported)”.
  • Vectrex: the light pen is not supported.
  • Game Boy, Game Gear, and the other handheld cores had no guns to imitate.
  • Nintendo 64 and others: no gun peripherals in the original libraries that a core would need to imitate.

2.11 The console cores on one page

Table 4 — 2.11 The console cores on one page

CoreGun imitatedMenu for a USB gunReal gun via SNACNotes
NESZapper; Vs. System ZapperPeripheral Zapper(Joy1)Yes, “SNAC: Zapper”Brightness test in the core
SNESSuper Scope, JustifierSuper Scope Joy1; Gun TypeLikely (IOBit passed; no test found)Justifier reload after 5 frames off-screen
Master SystemLight PhaserGun Control Joy1; Gun PortLikely (TH passed)Vertical-aim fix 2026-04-15
Genesis, 32XMenacer or Justifier by cartridgeGun Control Joy1Likely (TH passed)Per-game timing table
Mega Drive (Nuked-MD)from cartridgeGun Control Joy1LikelyGun added 2023-08-31
Mega-CDJustifier or MenacerGun Control Joy1; Gun TypeLikelyDelay 32 or 64
PlayStationGunCon, JustifierPad1 GunConGunCon 1 via SNAC (tested by users, 2024)Sync output on SNAC for a real GunCon
SaturnVirtua Gun / StunnerPad 1 Virt LGun; XY Ctrl Joy 1Not documentedAdded 2025-02-02
Atari 7800 / 2600XG-1Port Input Lightgun; Gun Control Joy1Likely; Sega Phaser ModeGun X Tuning 0–7
TurboGrafx-16, 3DO, CD-i, Vectrex———No gun

2.12 What could not be verified

  • No core was run for this volume; behaviour is read from source.
  • Whether every game in each library works with the virtual gun; the cores’ issue trackers were not surveyed.
  • The interaction of the NES core’s palette options with its brightness test.
  • The purpose of the Atari 7800 core’s Sega Phaser Mode (inferred from the line remapping).
  • Whether a GunCon 2 on a CRT works with the Saturn core’s virtual gun.
  • The real-time length of the NES trigger pulse: the module counts core clocks, and the clock frequency was not traced.

Sources

  1. MiSTer-devel, NES_MiSTer: NES.sv, rtl/zapper.sv, README; HEAD 49a0a662e2 (2026-09-30); Vs. Zapper commit d47c27f0bb (2026-07-20, #461). https://github.com/MiSTer-devel/NES_MiSTer
  2. MiSTer-devel, SNES_MiSTer: SNES.sv, rtl/lightgun.sv, README; HEAD 23026830ff (2026-10-04). https://github.com/MiSTer-devel/SNES_MiSTer
  3. MiSTer-devel, SMS_MiSTer: SMS.sv, rtl/lightgun.sv, README; HEAD 8443a0d19a (2026-10-14); first gun commit 28c980d7a1 (2020-05-29); fix 260e0a1903 (2026-04-15, #176). https://github.com/MiSTer-devel/SMS_MiSTer
  4. MiSTer-devel, Genesis_MiSTer: Genesis.sv, rtl/lightgun.sv; HEAD adc0c42cfb (2023-02-24). https://github.com/MiSTer-devel/Genesis_MiSTer
  5. MiSTer-devel, MegaDrive_MiSTer: MegaDrive.sv; HEAD becbdee78c (2026-10-05); gun 461a5160b0 (2023-08-31). https://github.com/MiSTer-devel/MegaDrive_MiSTer
  6. MiSTer-devel, MegaCD_MiSTer: MegaCD.sv; HEAD a3a3da81d0 (2026-07-30). https://github.com/MiSTer-devel/MegaCD_MiSTer
  7. MiSTer-devel, S32X_MiSTer: S32X.sv, read 2026-10-24. https://github.com/MiSTer-devel/S32X_MiSTer
  8. MiSTer-devel, PSX_MiSTer: PSX.sv, joypad_pad.vhd, justifier_sensor.vhd, README; HEAD cd17b5a0ad (2026-08-21); Justifier 3dab3e2dea (2022-05-01); offscreen trigger a3ca44f4cc (2022-11-25). https://github.com/MiSTer-devel/PSX_MiSTer
  9. MiSTer-devel, Saturn_MiSTer: Saturn.sv, lightgun.sv; HEAD 9aa944985a (2026-10-19); first gun commit 853d8447e9 (2025-02-02). https://github.com/MiSTer-devel/Saturn_MiSTer
  10. MiSTer-devel, Atari7800_MiSTer: Atari7800.sv, lightgun.sv, README; HEAD 0dc8ad2e3f (2026-09-11); gun aef45f04b8 (2021-04-09); fix 4c4e9ec868 (2022-12-27). https://github.com/MiSTer-devel/Atari7800_MiSTer
  11. MiSTer-devel, TurboGrafx16_MiSTer (TurboGrafx16.sv), 3DO_MiSTer, CDi_MiSTer README, read 2026-10-20 and 2026-10-24.
  12. Nolan Nicholson, “GunCon2-MiSTer”, README, read 2026-10-24. https://github.com/NolanNicholson/GunCon2-MiSTer
  13. Photos: Evan-Amos, Wikimedia Commons (Zappers, public domain; Konami Justifiers, public domain); David Quach, edited by Czar, “Sega Menacer cropped”, Wikimedia Commons, CC BY 3.0.

Comments (0)

  1. Loading…

Comments are held for moderation — nothing appears until approved.