Skip to content

Commit fdb90cb

Browse files
committed
isa/hdc: Improve initial state, proper units for dma transfers
1 parent 84f1bc2 commit fdb90cb

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

src/devices/bus/isa/hdc.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,15 @@ st11m_device::st11m_device(const machine_config &mconfig, const char *tag, devic
194194

195195
void xt_hdc_device::device_start()
196196
{
197-
m_buffer = std::make_unique<uint8_t[]>(256*512); // maximum possible transfer
197+
m_buffer = std::make_unique<uint8_t[]>(256 * 512); // maximum possible transfer
198198
m_timer = timer_alloc(FUNC(xt_hdc_device::process_command), this);
199199
}
200200

201201
void xt_hdc_device::device_reset()
202202
{
203203
m_drv = 0;
204204
m_data_cnt = 0;
205-
m_buffer_ptr = nullptr;
205+
m_buffer_ptr = &m_buffer[0];
206206
m_hdc_control = 0;
207207
for (int i = 0; i < 2; i++)
208208
{
@@ -221,7 +221,7 @@ void xt_hdc_device::device_reset()
221221
}
222222

223223
m_csb = 0;
224-
m_status = 0;
224+
m_status = STA_COMMAND | STA_READY;
225225
m_error = 0;
226226
}
227227

@@ -310,7 +310,7 @@ int xt_hdc_device::get_lbasector()
310310
* implementation that threw the idea of "emulating the hardware" to the wind
311311
*/
312312

313-
int xt_hdc_device::dack_r()
313+
uint8_t xt_hdc_device::dack_r()
314314
{
315315
harddisk_image_device *file = pc_hdc_file(m_drv);
316316
if (!file)
@@ -354,7 +354,7 @@ int xt_hdc_device::dack_r()
354354
return result;
355355
}
356356

357-
int xt_hdc_device::dack_rs()
357+
uint8_t xt_hdc_device::dack_rs()
358358
{
359359
logerror("%s dack_rs(%d %d)\n", machine().describe_context(), m_hdcdma_read, m_hdcdma_size);
360360

@@ -383,7 +383,7 @@ int xt_hdc_device::dack_rs()
383383

384384

385385

386-
void xt_hdc_device::dack_w(int data)
386+
void xt_hdc_device::dack_w(uint8_t data)
387387
{
388388
harddisk_image_device *file = pc_hdc_file(m_drv);
389389
if (!file)
@@ -423,7 +423,7 @@ void xt_hdc_device::dack_w(int data)
423423

424424

425425

426-
void xt_hdc_device::dack_ws(int data)
426+
void xt_hdc_device::dack_ws(uint8_t data)
427427
{
428428
*(m_hdcdma_dst++) = data;
429429

@@ -829,6 +829,7 @@ void xt_hdc_device::select_w(uint8_t data)
829829
{
830830
m_status &= ~STA_INTERRUPT;
831831
m_status |= STA_SELECT;
832+
m_status |= STA_READY;
832833
}
833834

834835

src/devices/bus/isa/hdc.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ class xt_hdc_device :
3030
auto irq_handler() { return m_irq_handler.bind(); }
3131
auto drq_handler() { return m_drq_handler.bind(); }
3232

33-
int dack_r();
34-
int dack_rs();
35-
void dack_w(int data);
36-
void dack_ws(int data);
33+
uint8_t dack_r();
34+
uint8_t dack_rs();
35+
void dack_w(uint8_t data);
36+
void dack_ws(uint8_t data);
3737

3838
void data_w(uint8_t data);
3939
void reset_w(uint8_t data);

0 commit comments

Comments
 (0)