1
0
mirror of https://github.com/UzixLS/zx-sizif-512.git synced 2025-07-19 07:11:36 +03:00

allow nmi call when divmmc's mapram in use

This commit is contained in:
Eugene Lozovoy
2022-08-28 20:38:55 +03:00
parent 0a2d594bf4
commit 3b043445a6
3 changed files with 10 additions and 9 deletions

View File

@ -24,13 +24,13 @@ module divmmc(
output reg [3:0] page,
output map,
output reg automap,
output reg mapram,
output ram,
output ramwr_mask,
output cpuwait
);
reg automap_next;
reg automap, automap_next;
always @(posedge clk28 or negedge rst_n) begin
if (!rst_n) begin
automap_next <= 0;
@ -63,7 +63,7 @@ always @(posedge clk28 or negedge rst_n) begin
end
end
reg conmem, mapram;
reg conmem;
wire port_e3_cs = en && bus.ioreq && bus.a[7:0] == 8'hE3;
wire port_e7_cs = en && bus.ioreq && bus.a[7:0] == 8'hE7;
wire port_eb_cs = en && bus.ioreq && bus.a[7:0] == 8'hEB;

View File

@ -13,7 +13,7 @@ module magic(
input magic_button,
input pause_button,
input div_automap,
input div_paged,
output reg magic_mode,
output reg magic_map,
@ -147,7 +147,7 @@ always @(posedge clk28 or negedge rst_n) begin
end
reg config_rd;
wire [7:0] config_data = {4'b0000, div_automap, 1'b1, pause_button, magic_button};
wire [7:0] config_data = {4'b0000, div_paged, 1'b1, pause_button, magic_button};
always @(posedge clk28 or negedge rst_n) begin
if (!rst_n)
config_rd <= 0;

View File

@ -315,7 +315,8 @@ always @(posedge clk28) // precharge to 1 - this is required because of weak
assign n_nmi = n_nmi0? (n_nmi0_prev? 1'bz : 1'b1) : 1'b0;
wire rom_wren;
wire div_automap;
wire div_map;
wire div_mapram;
wire [7:0] magic_dout;
wire magic_dout_active;
wire magic_mode, magic_map;
@ -346,7 +347,7 @@ magic magic0(
.magic_button(~n_magic || joy_mode || ps2_key_magic),
.pause_button(ps2_key_pause || joy_start),
.div_automap(div_automap),
.div_paged(div_map && !div_mapram),
.magic_mode(magic_mode),
.magic_map(magic_map),
@ -471,7 +472,7 @@ mixer mixer0(
/* DIVMMC */
wire div_map, div_ram, div_ramwr_mask, div_dout_active;
wire div_ram, div_ramwr_mask, div_dout_active;
wire [7:0] div_dout;
wire [3:0] div_page;
divmmc divmmc0(
@ -499,7 +500,7 @@ divmmc divmmc0(
.page(div_page),
.map(div_map),
.automap(div_automap),
.mapram(div_mapram),
.ram(div_ram),
.ramwr_mask(div_ramwr_mask),
.cpuwait(div_wait)