diff --git a/src/devices/bus/a2bus/agat840k_hle.cpp b/src/devices/bus/a2bus/agat840k_hle.cpp index a27d3d95ceb..72217fbe464 100644 --- a/src/devices/bus/a2bus/agat840k_hle.cpp +++ b/src/devices/bus/a2bus/agat840k_hle.cpp @@ -13,10 +13,10 @@ *********************************************************************/ #include "emu.h" -#include "imagedev/flopdrv.h" -#include "formats/agat840k_hle_dsk.h" #include "agat840k_hle.h" +#include "formats/agat840k_hle_dsk.h" + //#define VERBOSE 1 #include "logmacro.h" @@ -175,14 +175,18 @@ void a2bus_agat840k_hle_device::device_reset() } for (int j = 0; j < 21; j++) { - int k, cksum = 0, s = (j * 1) % 21; + const int s = (j * 1) % 21; + int cksum = 0; m_floppy->floppy_drive_read_sector_data(t & 1, s, buf, 256); -#define BAUX 22 -#define BLOB (256 + 19 + BAUX) + enum + { + BAUX = 22, + BLOB = 256 + 19 + BAUX + }; - for (k = 0; k < 256; k++) + for (int k = 0; k < 256; k++) { if (cksum > 255) { cksum++; cksum &= 255; } cksum += buf[k]; @@ -211,13 +215,11 @@ void a2bus_agat840k_hle_device::device_reset() elem[13 + (BLOB * j) + 17 + 257] = 0x5a; // gap3 - for (k = 0; k < BAUX; k++) + for (int k = 0; k < BAUX; k++) { elem[13 + (BLOB * j) + 17 + 258 + k] = 0xaa; } } -#undef BAUX -#undef BLOB t++; if ((t & 1) == 0) @@ -407,9 +409,7 @@ WRITE8_MEMBER(a2bus_agat840k_hle_device::d14_o_c) // data are latched in by write to PC4 READ8_MEMBER(a2bus_agat840k_hle_device::d15_i_a) { - u16 data = 0; - - data = m_tracks[(2 * m_floppy->floppy_drive_get_current_track()) + m_side][m_count_read]; + const u16 data = m_tracks[(2 * m_floppy->floppy_drive_get_current_track()) + m_side][m_count_read]; LOG("sector data: %02x @ %4d (head %d track %2d)%s\n", data & 0xff, m_count_read, m_side, m_floppy->floppy_drive_get_current_track(), BIT(data, 14) ? " volume" : (BIT(data, 13) ? " cksum" : "")); diff --git a/src/devices/bus/a2bus/agat840k_hle.h b/src/devices/bus/a2bus/agat840k_hle.h index 42a1f2cc8c4..cab186c2c62 100644 --- a/src/devices/bus/a2bus/agat840k_hle.h +++ b/src/devices/bus/a2bus/agat840k_hle.h @@ -14,22 +14,26 @@ #pragma once #include "a2bus.h" +#include "imagedev/flopdrv.h" #include "machine/i8255.h" -#define MXCSR_SYNC 0x40 -#define MXCSR_TR 0x80 - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** class a2bus_agat840k_hle_device: - public device_t, - public device_a2bus_card_interface + public device_t, + public device_a2bus_card_interface { public: + enum : u8 + { + MXCSR_SYNC = 0x40, + MXCSR_TR = 0x80 + }; + // construction/destruction a2bus_agat840k_hle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); diff --git a/src/devices/video/dp8510.h b/src/devices/video/dp8510.h index 946dd0d8c15..04a0c2b1676 100644 --- a/src/devices/video/dp8510.h +++ b/src/devices/video/dp8510.h @@ -5,7 +5,6 @@ #pragma once -#include "video/dp8510.h" class dp8510_device : public device_t {