summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2020-02-02 01:43:27 +1100
committer Vas Crabb <vas@vastheman.com>2020-02-02 01:43:27 +1100
commit9e0b03710d1f19791bd9bdbcd7f2eb2afa506ed9 (patch)
treed3833e5c40aa6edd09eef16a0bf0bc32a81bc968
parentfad49881ace3908c627e7b6da042c1ba94a8f8bd (diff)
more debug logging left on, few small cleanups (nw)
-rw-r--r--src/devices/bus/multibus/isbc202.cpp42
-rw-r--r--src/devices/bus/ti99/internal/992board.cpp4
-rw-r--r--src/lib/formats/img_dsk.cpp40
-rw-r--r--src/lib/formats/img_dsk.h12
4 files changed, 49 insertions, 49 deletions
diff --git a/src/devices/bus/multibus/isbc202.cpp b/src/devices/bus/multibus/isbc202.cpp
index 864856eca8c..490ed125e97 100644
--- a/src/devices/bus/multibus/isbc202.cpp
+++ b/src/devices/bus/multibus/isbc202.cpp
@@ -135,11 +135,11 @@ offs_t isbc202_disassembler::disassemble(std::ostream &stream, offs_t pc, const
uint32_t microcode = opcodes.r32(pc);
// Decode address control instruction
- uint8_t ac = (uint8_t)(microcode >> 25);
+ uint8_t ac = uint8_t(microcode >> 25);
if ((ac & 0b1100000) == 0b0000000) {
// JCC
- util::stream_format(stream , "JCC $%03x" , (((uint16_t)ac & 0b11111) << 4) | (pc & 0xf));
+ util::stream_format(stream , "JCC $%03x" , ((uint16_t(ac) & 0b11111) << 4) | (pc & 0xf));
} else if ((ac & 0b1110000) == 0b0100000) {
// JZR
util::stream_format(stream , "JZR $00%x" , ac & 0b1111);
@@ -173,11 +173,11 @@ offs_t isbc202_disassembler::disassemble(std::ostream &stream, offs_t pc, const
}
// Decode input multiplexer
- uint8_t in = (uint8_t)((microcode >> 13) & 7);
+ uint8_t in = uint8_t((microcode >> 13) & 7);
util::stream_format(stream , " I=%u" , in);
// Decode function code
- uint8_t fc = (uint8_t)((microcode >> 18) & 0x7f);
+ uint8_t fc = uint8_t((microcode >> 18) & 0x7f);
uint8_t fg;
uint8_t rg;
unsigned reg;
@@ -189,8 +189,8 @@ offs_t isbc202_disassembler::disassemble(std::ostream &stream, offs_t pc, const
stream << (BIT(microcode , 16) ? " HCZ" : " SCZ");
// Decode K
- uint8_t slk = (uint8_t)((microcode >> 8) & 3);
- uint8_t mask = (uint8_t)microcode;
+ uint8_t slk = uint8_t((microcode >> 8) & 3);
+ uint8_t mask = uint8_t(microcode);
uint8_t kbus;
if (!BIT(slk , 0)) {
kbus = mask;
@@ -204,7 +204,7 @@ offs_t isbc202_disassembler::disassemble(std::ostream &stream, offs_t pc, const
// Decode OUT
util::stream_format(stream , " S=%u M=$%02x" , slk , mask);
if (BIT(slk , 0) && !BIT(mask , 7)) {
- uint8_t out = (uint8_t)((microcode >> 10) & 7);
+ uint8_t out = uint8_t((microcode >> 10) & 7);
util::stream_format(stream , " O=%u" , out);
}
@@ -481,11 +481,11 @@ void isbc202_device::device_timer(emu_timer &timer, device_timer_id id, int para
}
ROM_START(isbc202)
- ROM_REGION(0x800 , "microcode" , ROMREGION_32BIT | ROMREGION_BE)
- ROM_LOAD32_BYTE("sbc202-a10-0230.bin" , 0x000 , 0x200 , CRC(e8fa3893) SHA1(88fab74b0466e8aac36eee46cd7536ed1b32a2c9))
- ROM_LOAD32_BYTE("sbc202-a11-0261.bin" , 0x001 , 0x200 , CRC(3ad01769) SHA1(4c22b8fc3ea599dd49684ff4dcafc29ec3425c4c))
- ROM_LOAD32_BYTE("sbc202-a12-0233.bin" , 0x002 , 0x200 , CRC(61496232) SHA1(b0473217944b2f6e966d97e97cf5ad8d883a09e4))
- ROM_LOAD32_BYTE("sbc202-a13-0232.bin" , 0x003 , 0x200 , CRC(c369ab86) SHA1(fc3b7f9c3e71ea1442827c51247a9944c6d40b37))
+ ROM_REGION(0x800 , "microcode" , ROMREGION_32BIT | ROMREGION_BE)
+ ROM_LOAD32_BYTE("sbc202-a10-0230.bin" , 0x000 , 0x200 , CRC(e8fa3893) SHA1(88fab74b0466e8aac36eee46cd7536ed1b32a2c9))
+ ROM_LOAD32_BYTE("sbc202-a11-0261.bin" , 0x001 , 0x200 , CRC(3ad01769) SHA1(4c22b8fc3ea599dd49684ff4dcafc29ec3425c4c))
+ ROM_LOAD32_BYTE("sbc202-a12-0233.bin" , 0x002 , 0x200 , CRC(61496232) SHA1(b0473217944b2f6e966d97e97cf5ad8d883a09e4))
+ ROM_LOAD32_BYTE("sbc202-a13-0232.bin" , 0x003 , 0x200 , CRC(c369ab86) SHA1(fc3b7f9c3e71ea1442827c51247a9944c6d40b37))
ROM_END
const tiny_rom_entry *isbc202_device::device_rom_region() const
@@ -571,14 +571,14 @@ void isbc202_device::execute_run()
// 12..10 Output control
// 9..8 SLK field
// 7..0 Mask field
- m_ac = (uint8_t)(m_code_word >> 25);
- m_fc = (uint8_t)((m_code_word >> 18) & 0x7f);
+ m_ac = uint8_t(m_code_word >> 25);
+ m_fc = uint8_t((m_code_word >> 18) & 0x7f);
m_fc32 = BIT(m_code_word , 17);
m_fc10 = BIT(m_code_word , 16);
- m_in_sel = (uint8_t)((m_code_word >> 13) & 7);
- m_out_sel = (uint8_t)((m_code_word >> 10) & 7);
- m_slk = (uint8_t)((m_code_word >> 8) & 3);
- m_mask = (uint8_t)m_code_word;
+ m_in_sel = uint8_t((m_code_word >> 13) & 7);
+ m_out_sel = uint8_t((m_code_word >> 10) & 7);
+ m_slk = uint8_t((m_code_word >> 8) & 3);
+ m_mask = uint8_t(m_code_word);
m_mcu->fc_w((m_fc32 ? 0b1100 : 0b0000) | (m_fc10 ? 0b0011 : 0b0000));
@@ -852,7 +852,7 @@ void isbc202_device::set_output()
if (m_mem_wrt) {
if (!m_wrt_inh) {
// CPU memory write
- uint16_t addr = m_addr_low_out | ((uint16_t)abus_r() << 8);
+ uint16_t addr = m_addr_low_out | (uint16_t(abus_r()) << 8);
if (m_mem_space) {
LOG_BUS("MEM W %04x=%02x\n" , addr , m_data_low_out);
m_mem_space->write_byte(addr , m_data_low_out);
@@ -862,7 +862,7 @@ void isbc202_device::set_output()
}
} else {
// CPU memory read
- uint16_t addr = m_addr_low_out | ((uint16_t)abus_r() << 8);
+ uint16_t addr = m_addr_low_out | (uint16_t(abus_r()) << 8);
if (m_mem_space) {
m_data_low_in = m_mem_space->read_byte(addr);
LOG_BUS("MEM R %04x=%02x\n" , addr , m_data_low_in);
@@ -1130,7 +1130,7 @@ uint8_t isbc202_device::aligned_rd_data(uint16_t sr)
LOG_RD("Aligning by %u bits\n" , bits);
sr <<= bits;
}
- return (uint8_t)(sr >> 8);
+ return uint8_t(sr >> 8);
}
void isbc202_device::rd_bits(unsigned n)
diff --git a/src/devices/bus/ti99/internal/992board.cpp b/src/devices/bus/ti99/internal/992board.cpp
index fcb5d904a68..5bae14a0e9a 100644
--- a/src/devices/bus/ti99/internal/992board.cpp
+++ b/src/devices/bus/ti99/internal/992board.cpp
@@ -12,6 +12,7 @@
***************************************************************************/
#include "emu.h"
+#include "992board.h"
#define LOG_WARN (1U<<1) // Warnings
#define LOG_CRU (1U<<2) // CRU logging
@@ -20,10 +21,9 @@
#define LOG_BANK (1U<<5) // Change ROM banks
#define LOG_KEYBOARD (1U<<6) // Keyboard operation
-#define VERBOSE ( LOG_GENERAL | LOG_WARN )
+#define VERBOSE ( LOG_WARN )
#include "logmacro.h"
-#include "992board.h"
/*
Emulation of the CRT Gate Array of the TI-99/2
diff --git a/src/lib/formats/img_dsk.cpp b/src/lib/formats/img_dsk.cpp
index 0dfcc7a359f..40093bee4aa 100644
--- a/src/lib/formats/img_dsk.cpp
+++ b/src/lib/formats/img_dsk.cpp
@@ -19,7 +19,7 @@
// Debugging
#define VERBOSE 0
-#define LOG(...) do { if (VERBOSE) printf(__VA_ARGS__); } while (false)
+#define LOG(...) do { if (VERBOSE) osd_printf_info(__VA_ARGS__); } while (false)
constexpr unsigned CELL_SIZE = 1200; // Bit cell size (1 µs)
constexpr uint8_t INDEX_AM = 0x0c; // Index address mark
@@ -31,7 +31,7 @@ constexpr unsigned SYNC_00_LEN = 18; // 00's in sync (gaps 1, 2, 3)
constexpr unsigned SYNC_FF_LEN = 10; // FF's in sync (gaps 1, 2, 3)
constexpr int ID_DATA_OFFSET = 35 * 16; // Nominal distance (in cells) between ID & DATA AM
// Size of image file
-constexpr unsigned IMG_IMAGE_SIZE = IMG_TRACKS * IMG_HEADS * IMG_SECTORS * IMG_SECTOR_SIZE;
+constexpr unsigned IMG_IMAGE_SIZE = img_format::TRACKS * img_format::HEADS * img_format::SECTORS * img_format::SECTOR_SIZE;
constexpr uint16_t CRC_POLY = 0x1021; // CRC-CCITT
img_format::img_format()
@@ -62,7 +62,7 @@ bool img_format::load(io_generic *io, uint32_t form_factor, floppy_image *image)
std::vector<uint8_t> image_data(size);
io_generic_read(io, (void *)image_data.data(), 0, size);
- for (unsigned cyl = 0; cyl < IMG_TRACKS; cyl++) {
+ for (unsigned cyl = 0; cyl < TRACKS; cyl++) {
std::vector<uint32_t> track_data;
write_gap(track_data, 0 , PREIDX_GAP);
@@ -83,9 +83,9 @@ bool img_format::load(io_generic *io, uint32_t form_factor, floppy_image *image)
}
std::vector<uint8_t> sector_list = interleaved_sectors(il_factor);
- for (unsigned sector = 0; sector < IMG_SECTORS; sector++) {
- unsigned real_sector = sector_list[ (sector + skew) % IMG_SECTORS ];
- unsigned offset_in_image = (real_sector - 1 + cyl * IMG_SECTORS) * IMG_SECTOR_SIZE;
+ for (unsigned sector = 0; sector < SECTORS; sector++) {
+ unsigned real_sector = sector_list[ (sector + skew) % SECTORS ];
+ unsigned offset_in_image = (real_sector - 1 + cyl * SECTORS) * SECTOR_SIZE;
write_sector(track_data , cyl , real_sector , &image_data[ offset_in_image ]);
}
fill_with_gap4(track_data);
@@ -96,17 +96,17 @@ bool img_format::load(io_generic *io, uint32_t form_factor, floppy_image *image)
bool img_format::save(io_generic *io, floppy_image *image)
{
- for (int cyl = 0; cyl < IMG_TRACKS; cyl++) {
+ for (int cyl = 0; cyl < TRACKS; cyl++) {
uint8_t bitstream[ 21000 ];
int bitstream_size;
generate_bitstream_from_track(cyl , 0 , CELL_SIZE , bitstream , bitstream_size , image , 0);
int pos = 0;
unsigned track_no , sector_no;
- uint8_t sector_data[ IMG_SECTOR_SIZE ];
+ uint8_t sector_data[ SECTOR_SIZE ];
while (get_next_sector(bitstream , bitstream_size , pos , track_no , sector_no , sector_data)) {
- if (track_no == cyl && sector_no >= 1 && sector_no <= IMG_SECTORS) {
- unsigned offset_in_image = (cyl * IMG_SECTORS + sector_no - 1) * IMG_SECTOR_SIZE;
- io_generic_write(io, sector_data, offset_in_image, IMG_SECTOR_SIZE);
+ if (track_no == cyl && sector_no >= 1 && sector_no <= SECTORS) {
+ unsigned offset_in_image = (cyl * SECTORS + sector_no - 1) * SECTOR_SIZE;
+ io_generic_write(io, sector_data, offset_in_image, SECTOR_SIZE);
}
}
}
@@ -135,18 +135,18 @@ bool img_format::supports_save() const
std::vector<uint8_t> img_format::interleaved_sectors(unsigned il_factor)
{
- std::vector<uint8_t> out(IMG_SECTORS);
+ std::vector<uint8_t> out(SECTORS);
unsigned idx = 0;
- for (unsigned s = 0; s < IMG_SECTORS; s++) {
+ for (unsigned s = 0; s < SECTORS; s++) {
while (out[ idx ] != 0) {
- if (++idx >= IMG_SECTORS) {
+ if (++idx >= SECTORS) {
idx = 0;
}
}
out[ idx ] = s + 1;
idx += il_factor;
- if (idx >= IMG_SECTORS) {
- idx -= IMG_SECTORS;
+ if (idx >= SECTORS) {
+ idx -= SECTORS;
}
}
return out;
@@ -235,7 +235,7 @@ void img_format::write_sector(std::vector<uint32_t> &buffer , uint8_t track_no ,
// Data AM
m_crc = 0;
write_mmfm_byte(buffer , DATA_AM , AM_CLOCK);
- for (unsigned i = 0; i < IMG_SECTOR_SIZE; i++) {
+ for (unsigned i = 0; i < SECTOR_SIZE; i++) {
// Data
write_mmfm_byte(buffer , sect_data[ i ]);
}
@@ -317,7 +317,7 @@ std::vector<uint8_t> img_format::get_next_id_n_block(const uint8_t *bitstream ,
if (data_sr == ID_AM) {
to_dump = 4;
} else if (data_sr == DATA_AM) {
- to_dump = IMG_SECTOR_SIZE;
+ to_dump = SECTOR_SIZE;
} else {
to_dump = 0;
}
@@ -365,12 +365,12 @@ bool img_format::get_next_sector(const uint8_t *bitstream , int bitstream_size ,
if (block.size() == 0) {
return false;
}
- if (block[ 0 ] == DATA_AM && block.size() >= (IMG_SECTOR_SIZE + 1) && abs((data_pos - id_pos) - ID_DATA_OFFSET) <= 64) {
+ if (block[ 0 ] == DATA_AM && block.size() >= (SECTOR_SIZE + 1) && abs((data_pos - id_pos) - ID_DATA_OFFSET) <= 64) {
break;
}
}
- memcpy(sector_data , block.data() + 1 , IMG_SECTOR_SIZE);
+ memcpy(sector_data , block.data() + 1 , SECTOR_SIZE);
return true;
}
diff --git a/src/lib/formats/img_dsk.h b/src/lib/formats/img_dsk.h
index f1ac7aef3c0..ab2c5adc1c2 100644
--- a/src/lib/formats/img_dsk.h
+++ b/src/lib/formats/img_dsk.h
@@ -16,15 +16,15 @@
#include <vector>
-// Geometry constants
-constexpr unsigned IMG_TRACKS = 77;
-constexpr unsigned IMG_HEADS = 1;
-constexpr unsigned IMG_SECTORS = 52;
-constexpr unsigned IMG_SECTOR_SIZE = 128;
-
class img_format : public floppy_image_format_t
{
public:
+ // Geometry constants
+ static constexpr unsigned TRACKS = 77;
+ static constexpr unsigned HEADS = 1;
+ static constexpr unsigned SECTORS = 52;
+ static constexpr unsigned SECTOR_SIZE = 128;
+
img_format();
virtual int identify(io_generic *io, uint32_t form_factor) override;