From afa9bdf8f2749eadf503fdcac6003111a29e02c4 Mon Sep 17 00:00:00 2001 From: harbaum Date: Wed, 29 Apr 2015 08:42:34 +0000 Subject: [PATCH] [ATARI ST] Ignore both floppies being selected at same time. Fixes Violator A_496. --- cores/mist/audio.v | 2 +- cores/mist/fdc.v | 25 +++++++++++++++---------- cores/mist/mist_top.v | 3 +-- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/cores/mist/audio.v b/cores/mist/audio.v index 0490fcf..39f46fb 100644 --- a/cores/mist/audio.v +++ b/cores/mist/audio.v @@ -84,7 +84,7 @@ wire [7:0] port_b_in = { ~joy0[0], ~joy0[1], ~joy0[2], ~joy0[3], ~joy1[0], ~joy1[1], ~joy1[2], ~joy1[3]}; wire [7:0] port_a_in = { 2'b11, ~joy1[4], 5'b11111 }; -assign dout = psg_sel?{psg_dout,8'h00}:ste_dma_snd_sel?ste_dma_snd_data_out:16'h0000; +assign dout = psg_sel?{psg_dout,8'hff}:ste_dma_snd_sel?ste_dma_snd_data_out:16'h0000; wire [15:0] ste_dma_snd_data_out; wire [7:0] psg_dout; diff --git a/cores/mist/fdc.v b/cores/mist/fdc.v index d45418f..ff1fca7 100644 --- a/cores/mist/fdc.v +++ b/cores/mist/fdc.v @@ -25,20 +25,20 @@ module fdc ( input reset, // write protection of currently selected floppy - input [1:0] drv_sel, + input [1:0] drv_sel, input drv_side, input wr_prot, input dma_ack, - input [2:0] status_sel, - output [7:0] status_byte, + input [2:0] status_sel, + output [7:0] status_byte, - // cpu interface - input [1:0] cpu_addr, - input cpu_sel, - input cpu_rw, - input [7:0] cpu_din, - output [7:0] cpu_dout, + // cpu interface + input [1:0] cpu_addr, + input cpu_sel, + input cpu_rw, + input [7:0] cpu_din, + output [7:0] cpu_dout, output reg irq ); @@ -58,13 +58,18 @@ reg [7:0] track; reg [7:0] sector; reg [7:0] data; +// Some broken software selects both drives at the same time. On real hardware this +// only works if no second drive is present. In our setup the second drive is present +// but we can simply map all such broken accesses to drive A only +wire [1:0] drv_sel_exclusive = (drv_sel == 2'b00)?2'b10:drv_sel; + // fdc status as reported to the io controller assign status_byte = (status_sel == 0)?cmd: (status_sel == 1)?track: (status_sel == 2)?sector: (status_sel == 3)?8'h00: // data: - (status_sel == 4)?{ 4'b0000, drv_sel, drv_side, state == STATE_IO_WAIT }: + (status_sel == 4)?{ 4'b0000, drv_sel_exclusive, drv_side, state == STATE_IO_WAIT }: 8'h00; reg step_dir; diff --git a/cores/mist/mist_top.v b/cores/mist/mist_top.v index 695fc69..db39a18 100644 --- a/cores/mist/mist_top.v +++ b/cores/mist/mist_top.v @@ -234,11 +234,10 @@ wire [15:0] dma_data_out; // --------- de-multiplex the various io data output ports into one ----------- // acia returns 0xff on odd addresses (needed e.g. by intro of automation 496) wire [15:0] acia_data_out_16 = { acia_data_out, acia_sel?8'hff:8'h00 }; -wire io_data_out_8l_sel = mmu_sel | mfp_sel | auto_iack | mste_ctrl_sel; wire [15:0] mfp_data_out_16 = { mfp_sel?8'hff:8'h00, mfp_data_out }; wire [15:0] mmu_data_out_16 = { mmu_sel?8'hff:8'h00, mmu_data_out }; wire [15:0] mste_ctrl_data_out_16 = { mste_ctrl_sel?8'hff:8'h00, mste_ctrl_data_out }; -// wire [7:0] io_data_out_8l = mste_ctrl_data_out; + wire [15:0] io_data_out = vreg_data_out | dma_data_out | blitter_data_out | ste_joy_data_out | audio_data_out | rom_data_out | { 8'h00, auto_vector } | mfp_data_out_16 | mmu_data_out_16 | mste_ctrl_data_out_16 | acia_data_out_16;