Skip to content

JimmyStones/Pause_MiSTer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Pause_MiSTer

This is a generic module for MiSTer arcade cores which simplifies pausing the CPU based on user input, OSD status and signals from the high score module.

Created by Jim Gregory (JimmyStones) Twitter Buy Me a Coffee at ko-fi.com

Features

  • Pause can be triggered by user input, hiscore module or OSD opening (optionally controlled by setting in OSD)
  • When paused the RGB outputs will be halved after 10 seconds to reduce burn-in (optionally controlled by setting in OSD)
  • Reset signal will cancel user triggered pause

History

0001 - 2021-04-17

  • First marked release

0002 - 2021-08-28

  • Add optional output of dim_video signal (currently used by Galaga)

0003 - 2021-09-22

  • Convert dim_video to sequential logic to ease timing issues

0004 - 2021-10-07

  • Convert pause_cpu to sequential logic to ease timing issues

Implementation instructions

  • Add pause.v to rtl/ folder and files.qip
  • Add the following code sections to the main core .sv file.

Add Pause options inside the CONF_STR

	"-;",
	"P1,Pause options;",
	"P1OP,Pause when OSD is open,On,Off;",
	"P1OQ,Dim video after 10s,On,Off;",
	"-;",

P & Q are the default bits used by the module which equate to status[26:25], these can be changed here and in the module ports if there is a collision which existing settings

Add pause button to input defaults

	"J1,Fire,Fast,Start P1,Coin,Start P2,Pause;",
	"jn,A,B,Start,R,Select,L;",

Add pause input signal

wire m_pause  = joy[9];

Input signal names will vary between cores.

Instantiate Pause module

// PAUSE SYSTEM
wire				pause_cpu;
wire [11:0]		rgb_out;
pause #(4,4,4,12) pause (
	.*,
	.clk_sys(CLK_12M),
	.reset(iRST),
	.user_button(m_pause),
	.pause_request(hs_pause),
	.options(~status[26:25])
);

The .* wildcard will connect all ports with matching names. In the above example clk_sys and reset are specified as the core is using different names for those signals.

See Module parameters for further details.

Core specific implementation

The pause_cpu signal should be passed through the the main core module and used to halt any relevant CPUs or other processes.

If video output dimming within the module causes issues (if used in Galaga for example the vertical positioning is offset) then use this macro to enable dim_video as an output signal to handle dimming within the core separately.

`define PAUSE_OUTPUT_DIM

Module parameters

Parameter Description
RW Width of red channel
GW Width of green channel
BW Width of blue channel
CLKSPD Main clock speed in MHz

Module ports

Port Direction Description
clk_sys in Core system clock (should match HPS module)
reset in CPU reset signal (active-high)
user_button in User pause button signal (active-high)
pause_request in Pause requested by other code (active-high)
options in Pause options from OSD. [0] = pause in OSD (active-high), [1] = dim video (active-high)
OSD_STATUS in OSD is open (active-high)
r in Red channel
g in Green channel
b in Blue channel
pause_cpu out Pause signal to CPU (active-high)
rgb_out out RGB output to arcade_video moduleaccess

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages