mirror of
https://github.com/MiSTer-devel/Gameboy_MiSTer.git
synced 2026-05-17 03:03:43 +00:00
GBC: routed out T80 stop signal and implemented freq. switch
This commit is contained in:
11
gb.v
11
gb.v
@@ -117,6 +117,7 @@ wire cpu_m1_n;
|
||||
wire cpu_mreq_n;
|
||||
|
||||
wire cpu_clken = isGBC ? !hdma_rd:1'b1; //when hdma is enabled stop CPU (GBC)
|
||||
wire cpu_stop;
|
||||
|
||||
GBse cpu (
|
||||
.RESET_n ( !reset ),
|
||||
@@ -136,7 +137,8 @@ GBse cpu (
|
||||
.BUSAK_n ( ),
|
||||
.A ( cpu_addr ),
|
||||
.DI ( cpu_di ),
|
||||
.DO ( cpu_do )
|
||||
.DO ( cpu_do ),
|
||||
.STOP ( cpu_stop )
|
||||
);
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
@@ -151,8 +153,13 @@ always @(posedge clk2x) begin
|
||||
cpu_speed <= 1'b0;
|
||||
end else if (sel_key1 && !cpu_wr_n && isGBC)begin
|
||||
prepare_switch <= cpu_do[0];
|
||||
//TODO: wait for stop to toggle speed
|
||||
end
|
||||
|
||||
if (isGBC && prepare_switch && cpu_stop) begin
|
||||
cpu_speed <= !cpu_speed;
|
||||
prepare_switch <= 1'b0;
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -93,6 +93,7 @@ entity GBse is
|
||||
RFSH_n : out std_logic;
|
||||
HALT_n : out std_logic;
|
||||
BUSAK_n : out std_logic;
|
||||
STOP : out std_logic;
|
||||
A : out std_logic_vector(15 downto 0);
|
||||
DI : in std_logic_vector(7 downto 0);
|
||||
DO : out std_logic_vector(7 downto 0)
|
||||
@@ -133,6 +134,7 @@ begin
|
||||
Write => Write,
|
||||
RFSH_n => RFSH_n,
|
||||
HALT_n => HALT_n,
|
||||
Stop => STOP,
|
||||
WAIT_n => Wait_n,
|
||||
INT_n => INT_n,
|
||||
NMI_n => NMI_n,
|
||||
|
||||
Reference in New Issue
Block a user