@@ -316,7 +316,6 @@ module core_top (
316316 end
317317 32'h10xxxxxx : begin
318318 // example
319- // bridge_rd_data <= example_device_data;
320319 bridge_rd_data <= 0 ;
321320 end
322321 32'hF8xxxxxx : begin
@@ -329,15 +328,15 @@ module core_top (
329328 end
330329 end
331330
332- // always @(posedge clk_74a) begin
333- // if (bridge_wr) begin
334- // casex(bridge_addr)
335- // 32'h00000000 : begin
336- // LHRom_type <= bridge_wr_data[2: 0];
337- // end
338- // endcase
339- // end
340- // end
331+ always @(posedge clk_74a) begin
332+ if (bridge_wr) begin
333+ casex (bridge_addr)
334+ 32'h00000100 : begin
335+ multitap_enabled <= bridge_wr_data[0 ];
336+ end
337+ endcase
338+ end
339+ end
341340
342341
343342 //
@@ -582,6 +581,8 @@ module core_top (
582581
583582 wire [15 :0 ] cont1_key_s;
584583 wire [15 :0 ] cont2_key_s;
584+ wire [15 :0 ] cont3_key_s;
585+ wire [15 :0 ] cont4_key_s;
585586
586587 synch_3 #(
587588 .WIDTH(32 )
@@ -599,14 +600,36 @@ module core_top (
599600 clk_sys_21_48
600601 );
601602
603+ synch_3 #(
604+ .WIDTH(32 )
605+ ) cont3_s (
606+ cont3_key,
607+ cont3_key_s,
608+ clk_sys_21_48
609+ );
610+
611+ synch_3 #(
612+ .WIDTH(32 )
613+ ) cont4_s (
614+ cont4_key,
615+ cont4_key_s,
616+ clk_sys_21_48
617+ );
618+
602619 wire PAL;
603620
621+ // Settings
622+ reg multitap_enabled;
623+
604624 MAIN_SNES snes (
605625 .clk_mem_85_9 (clk_mem_85_9),
606626 .clk_sys_21_48(clk_sys_21_48),
607627
608628 .core_reset(~pll_core_locked),
609629
630+ // Settings
631+ .multitap_enabled(multitap_enabled),
632+
610633 // Input
611634 .p1_button_a(cont1_key_s[4 ]),
612635 .p1_button_b(cont1_key_s[5 ]),
@@ -634,6 +657,32 @@ module core_top (
634657 .p2_dpad_left(cont2_key_s[2 ]),
635658 .p2_dpad_right(cont2_key_s[3 ]),
636659
660+ .p3_button_a(cont3_key_s[4 ]),
661+ .p3_button_b(cont3_key_s[5 ]),
662+ .p3_button_x(cont3_key_s[6 ]),
663+ .p3_button_y(cont3_key_s[7 ]),
664+ .p3_button_trig_l(cont3_key_s[8 ]),
665+ .p3_button_trig_r(cont3_key_s[9 ]),
666+ .p3_button_start(cont3_key_s[15 ]),
667+ .p3_button_select(cont3_key_s[14 ]),
668+ .p3_dpad_up(cont3_key_s[0 ]),
669+ .p3_dpad_down(cont3_key_s[1 ]),
670+ .p3_dpad_left(cont3_key_s[2 ]),
671+ .p3_dpad_right(cont3_key_s[3 ]),
672+
673+ .p4_button_a(cont4_key_s[4 ]),
674+ .p4_button_b(cont4_key_s[5 ]),
675+ .p4_button_x(cont4_key_s[6 ]),
676+ .p4_button_y(cont4_key_s[7 ]),
677+ .p4_button_trig_l(cont4_key_s[8 ]),
678+ .p4_button_trig_r(cont4_key_s[9 ]),
679+ .p4_button_start(cont4_key_s[15 ]),
680+ .p4_button_select(cont4_key_s[14 ]),
681+ .p4_dpad_up(cont4_key_s[0 ]),
682+ .p4_dpad_down(cont4_key_s[1 ]),
683+ .p4_dpad_left(cont4_key_s[2 ]),
684+ .p4_dpad_right(cont4_key_s[3 ]),
685+
637686 // ROM loading
638687 .rom_file_size(rom_file_size),
639688 .ioctl_download(ioctl_download),
0 commit comments