Skip to content

Commit

Permalink
fix (#33): Added reset option and ROM swapping
Browse files Browse the repository at this point in the history
  • Loading branch information
agg23 committed Sep 28, 2022
1 parent 3d7d3c0 commit c593b73
Showing 5 changed files with 45 additions and 44 deletions.
4 changes: 2 additions & 2 deletions dist/Cores/agg23.SNES/core.json
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@
"description": "Super Nintendo and Super Famicom. Nintendo's second major home console",
"author": "agg23",
"url": "https://github.com/agg23/openfpga-snes",
"version": "0.2.0",
"date_release": "2022-09-19"
"version": "0.3.0",
"date_release": "2022-09-28"
},
"framework": {
"target_product": "Analogue Pocket",
2 changes: 1 addition & 1 deletion dist/Cores/agg23.SNES/data.json
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
"name": "SMC",
"id": 0,
"required": true,
"parameters": "0x108",
"parameters": "0x109",
"extensions": ["smc", "sfc"],
"address": "0x10000000"
},
56 changes: 24 additions & 32 deletions dist/Cores/agg23.SNES/interact.json
Original file line number Diff line number Diff line change
@@ -2,6 +2,14 @@
"interact": {
"magic": "APF_VER_1",
"variables": [
{
"name": "Reset core",
"id": 10,
"type": "action",
"enabled": true,
"address": "0x00000050",
"value": 1
},
{
"name": "Use Multitap",
"id": 20,
@@ -16,42 +24,26 @@
{
"name": "Lightgun Options",
"id": 30,
"type": "action",
"enabled": false
},
{
"name": "No Lightgun",
"id": 31,
"group": 3,
"type": "radio",
"enabled": true,
"address": "0x00000104",
"persist": true,
"writeonly": true,
"defaultval": 1,
"value": 0
},
{
"name": "Use Super Scope",
"id": 32,
"group": 3,
"type": "radio",
"type": "list",
"enabled": true,
"address": "0x00000104",
"writeonly": true,
"persist": true,
"value": 1
},
{
"name": "Use Justifier",
"id": 33,
"group": 3,
"type": "radio",
"enabled": true,
"address": "0x00000104",
"writeonly": true,
"persist": true,
"value": 3
"defaultval": 0,
"options": [
{
"name": "No Lightgun",
"value": 0
},
{
"name": "Use Super Scope",
"value": 1
},
{
"name": "Use Justifier",
"value": 2
}
]
},
{
"name": "D-Pad Aim Speed",
6 changes: 3 additions & 3 deletions src/fpga/apf/build_id.mif
Original file line number Diff line number Diff line change
@@ -9,8 +9,8 @@ DATA_RADIX = HEX;
CONTENT
BEGIN

0E0 : 20220924;
0E1 : 00112758;
0E2 : 2ef70c64;
0E0 : 20220928;
0E1 : 00083938;
0E2 : 46a76eb8;

END;
21 changes: 15 additions & 6 deletions src/fpga/core/core_top.v
Original file line number Diff line number Diff line change
@@ -329,8 +329,15 @@ module core_top (
end

always @(posedge clk_74a) begin
if (reset_delay > 0) begin
reset_delay <= reset_delay - 1;
end

if (bridge_wr) begin
casex (bridge_addr)
32'h00000050: begin
reset_delay <= 32'h100000;
end
32'h00000100: begin
multitap_enabled <= bridge_wr_data[0];
end
@@ -626,7 +633,7 @@ module core_top (
cont4_key_s,
clk_sys_21_48
);

synch_3 #(
.WIDTH(32)
) joy1_s (
@@ -638,17 +645,19 @@ module core_top (
wire PAL;

// Settings
reg multitap_enabled;
reg lightgun_enabled;
reg lightgun_type;
reg multitap_enabled;
reg lightgun_enabled;
reg lightgun_type;
reg [7:0] lightgun_dpad_aim_speed;
reg use_4_3_video;
reg use_4_3_video;

reg [31:0] reset_delay = 0;

MAIN_SNES snes (
.clk_mem_85_9 (clk_mem_85_9),
.clk_sys_21_48(clk_sys_21_48),

.core_reset(~pll_core_locked),
.core_reset(~pll_core_locked || reset_delay > 0),

// Settings
.multitap_enabled(multitap_enabled),

0 comments on commit c593b73

Please sign in to comment.