diff options
author | 2017-05-07 23:18:47 +1000 | |
---|---|---|
committer | 2017-05-14 21:44:11 +1000 | |
commit | 0f0d39ef81562c75e79176dd3bebb1e491ca39d5 (patch) | |
tree | 201cee7fdf55ee800f83859a92efd2cfe66cf2b3 /src/devices/video/scn2674.cpp | |
parent | e6c4be2b4d71c7a6c95be0bae111eb416ff0f9e7 (diff) |
Move static data out of devices into the device types. This is a significant change, so please pay attention.
The core changes are:
* Short name, full name and source file are no longer members of device_t, they are part of the device type
* MACHINE_COFIG_START no longer needs a driver class
* MACHINE_CONFIG_DERIVED_CLASS is no longer necessary
* Specify the state class you want in the GAME/COMP/CONS line
* The compiler will work out the base class where the driver init member is declared
* There is one static device type object per driver rather than one per machine configuration
Use DECLARE_DEVICE_TYPE or DECLARE_DEVICE_TYPE_NS to declare device type.
* DECLARE_DEVICE_TYPE forward-declares teh device type and class, and declares extern object finders.
* DECLARE_DEVICE_TYPE_NS is for devices classes in namespaces - it doesn't forward-declare the device type.
Use DEFINE_DEVICE_TYPE or DEFINE_DEVICE_TYPE_NS to define device types.
* These macros declare storage for the static data, and instantiate the device type and device finder templates.
The rest of the changes are mostly just moving stuff out of headers that shouldn't be there, renaming stuff for consistency, and scoping stuff down where appropriate.
Things I've actually messed with substantially:
* More descriptive names for a lot of devices
* Untangled the fantasy sound from the driver state, which necessitates breaking up sound/flip writes
* Changed DECO BSMT2000 ready callback into a device delegate
* Untangled Microprose 3D noise from driver state
* Used object finders for CoCo multipak, KC85 D002, and Irem sound subdevices
* Started to get TI-99 stuff out of the TI-990 directory and arrange bus devices properly
* Started to break out common parts of Samsung ARM SoC devices
* Turned some of FM, SID, SCSP DSP, EPIC12 and Voodoo cores into something resmbling C++
* Tried to make Z180 table allocation/setup a bit safer
* Converted generic keyboard/terminal to not use WRITE8 - space/offset aren't relevant
* Dynamically allocate generic terminal buffer so derived devices (e.g. teleprinter) can specify size
* Imporved encapsulation of Z80DART channels
* Refactored the SPC7110 bit table generator loop to make it more readable
* Added wrappers for SNES PPU operations so members can be made protected
* Factored out some boilerplate for YM chips with PSG
* toaplan2 gfx
* stic/intv resolution
* Video System video
* Out Run/Y-board sprite alignment
* GIC video hookup
* Amstrad CPC ROM box members
* IQ151 ROM cart region
* MSX cart IRQ callback resolution time
* SMS passthrough control devices starting subslots
I've smoke-tested several drivers, but I've probably missed something. Things I've missed will likely blow up spectacularly with failure to bind errors and the like. Let me know if there's more subtle breakage (could have happened in FM or Voodoo).
And can everyone please, please try to keep stuff clean. In particular, please stop polluting the global namespace. Keep things out of headers that don't need to be there, and use things that can be scoped down rather than macros.
It feels like an uphill battle trying to get this stuff under control while more of it's added.
Diffstat (limited to 'src/devices/video/scn2674.cpp')
-rw-r--r-- | src/devices/video/scn2674.cpp | 225 |
1 files changed, 120 insertions, 105 deletions
diff --git a/src/devices/video/scn2674.cpp b/src/devices/video/scn2674.cpp index 517580c2231..e5058e3a90c 100644 --- a/src/devices/video/scn2674.cpp +++ b/src/devices/video/scn2674.cpp @@ -9,11 +9,11 @@ #include "screen.h" +//#define VERBOSE 1 +#include "logmacro.h" -#define S674VERBOSE 0 -#define LOG2674(x) do { if (S674VERBOSE) logerror x; } while (0) -const device_type SCN2674_VIDEO = device_creator<scn2674_device>; +DEFINE_DEVICE_TYPE(SCN2674_VIDEO, scn2674_device, "scn2674", "Signetics SCN2674 AVDC") // default address map @@ -22,19 +22,34 @@ static ADDRESS_MAP_START( scn2674_vram, AS_0, 8, scn2674_device ) ADDRESS_MAP_END scn2674_device::scn2674_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, SCN2674_VIDEO, "Signetics SCN2674 AVDC", tag, owner, clock, "scn2674_device", __FILE__), - device_video_interface(mconfig, *this), - device_memory_interface(mconfig, *this), - m_irq_cb(*this), m_IR_pointer(0), m_screen1_l(0), m_screen1_h(0), m_cursor_l(0), m_cursor_h(0), m_screen2_l(0), m_screen2_h(0), m_irq_register(0), m_status_register(0), m_irq_mask(0), - m_gfx_enabled(0), m_display_enabled(0), m_display_enabled_field(0), m_display_enabled_scanline(0), m_cursor_enabled(0), m_hpixels_per_column(0), m_text_hpixels_per_column(0), - m_gfx_hpixels_per_column(0), m_IR0_double_ht_wd(0), m_IR0_scanline_per_char_row(0), m_IR0_sync_select(0), m_IR0_buffer_mode_select(0), m_IR1_interlace_enable(0), m_IR1_equalizing_constant(0), - m_IR2_row_table(0), m_IR2_horz_sync_width(0), m_IR2_horz_back_porch(0), m_IR3_vert_front_porch(0), m_IR3_vert_back_porch(0), m_IR4_rows_per_screen(0), m_IR4_character_blink_rate_divisor(0), - m_IR5_character_per_row(0), m_IR6_cursor_first_scanline(0), m_IR6_cursor_last_scanline(0), m_IR7_cursor_underline_position(0), m_IR7_cursor_rate_divisor(0), m_IR7_cursor_blink(0), - m_IR7_vsync_width(0), m_IR8_display_buffer_first_address_LSB(0), m_IR9_display_buffer_first_address_MSB(0), m_IR9_display_buffer_last_address(0), m_IR10_display_pointer_address_lower(0), - m_IR11_display_pointer_address_upper(0), m_IR11_reset_scanline_counter_on_scrollup(0), m_IR11_reset_scanline_counter_on_scrolldown(0), m_IR12_scroll_start(0), m_IR12_split_register_1(0), - m_IR13_scroll_end(0), m_IR13_split_register_2(0), m_IR14_scroll_lines(0), m_IR14_double_1(0), m_IR14_double_2(0), m_spl1(0), m_spl2(0), m_dbl1(0), m_buffer(0), m_linecounter(0), m_address(0), - m_start1change(0), m_irq_state(0), m_scanline_timer(nullptr), - m_space_config("videoram", ENDIANNESS_LITTLE, 8, 16, 0, nullptr, *ADDRESS_MAP_NAME(scn2674_vram)) + : device_t(mconfig, SCN2674_VIDEO, tag, owner, clock) + , device_video_interface(mconfig, *this) + , device_memory_interface(mconfig, *this) + , m_irq_cb(*this) + , m_IR_pointer(0) + , m_screen1_l(0), m_screen1_h(0), m_cursor_l(0), m_cursor_h(0), m_screen2_l(0), m_screen2_h(0) + , m_irq_register(0), m_status_register(0), m_irq_mask(0) + , m_gfx_enabled(0), m_display_enabled(0), m_display_enabled_field(0), m_display_enabled_scanline(0), m_cursor_enabled(0) + , m_hpixels_per_column(0), m_text_hpixels_per_column(0), m_gfx_hpixels_per_column(0) + , m_IR0_double_ht_wd(0), m_IR0_scanline_per_char_row(0), m_IR0_sync_select(0), m_IR0_buffer_mode_select(0) + , m_IR1_interlace_enable(0), m_IR1_equalizing_constant(0) + , m_IR2_row_table(0), m_IR2_horz_sync_width(0), m_IR2_horz_back_porch(0) + , m_IR3_vert_front_porch(0), m_IR3_vert_back_porch(0) + , m_IR4_rows_per_screen(0), m_IR4_character_blink_rate_divisor(0) + , m_IR5_character_per_row(0) + , m_IR6_cursor_first_scanline(0), m_IR6_cursor_last_scanline(0) + , m_IR7_cursor_underline_position(0), m_IR7_cursor_rate_divisor(0), m_IR7_cursor_blink(0), m_IR7_vsync_width(0) + , m_IR8_display_buffer_first_address_LSB(0) + , m_IR9_display_buffer_first_address_MSB(0), m_IR9_display_buffer_last_address(0) + , m_IR10_display_pointer_address_lower(0) + , m_IR11_display_pointer_address_upper(0), m_IR11_reset_scanline_counter_on_scrollup(0), m_IR11_reset_scanline_counter_on_scrolldown(0) + , m_IR12_scroll_start(0), m_IR12_split_register_1(0) + , m_IR13_scroll_end(0), m_IR13_split_register_2(0) + , m_IR14_scroll_lines(0), m_IR14_double_1(0), m_IR14_double_2(0) + , m_spl1(0), m_spl2(0), m_dbl1(0) + , m_buffer(0), m_linecounter(0), m_address(0), m_start1change(0), m_irq_state(0) + , m_scanline_timer(nullptr) + , m_space_config("videoram", ENDIANNESS_LITTLE, 8, 16, 0, nullptr, *ADDRESS_MAP_NAME(scn2674_vram)) { } @@ -119,7 +134,7 @@ void scn2674_device::device_reset() // 15 Initialization Registers (8-bit each) void scn2674_device::write_init_regs(uint8_t data) { - LOG2674(("scn2674_write_init_regs %02x %02x\n",m_IR_pointer,data)); + LOG("scn2674_write_init_regs %02x %02x\n",m_IR_pointer,data); switch ( m_IR_pointer) /* display some debug info, set mame specific variables */ { @@ -129,18 +144,18 @@ void scn2674_device::write_init_regs(uint8_t data) m_IR0_sync_select = (data&0x04)>>2; m_IR0_buffer_mode_select = (data&0x03); - LOG2674(("IR0 - Double Ht Wd %02x\n",m_IR0_double_ht_wd));//affects IR14 as well - LOG2674(("IR0 - Scanlines per Character Row %02x\n",m_IR0_scanline_per_char_row));//value+1 = scanlines - LOG2674(("IR0 - Sync Select %02x\n",m_IR0_sync_select));//1 = csync - LOG2674(("IR0 - Buffer Mode Select %02x\n",m_IR0_buffer_mode_select)); //0 independent 1 transparent 2 shared 3 row + LOG("IR0 - Double Ht Wd %02x\n",m_IR0_double_ht_wd);//affects IR14 as well + LOG("IR0 - Scanlines per Character Row %02x\n",m_IR0_scanline_per_char_row);//value+1 = scanlines + LOG("IR0 - Sync Select %02x\n",m_IR0_sync_select);//1 = csync + LOG("IR0 - Buffer Mode Select %02x\n",m_IR0_buffer_mode_select); //0 independent 1 transparent 2 shared 3 row break; case 1: m_IR1_interlace_enable = (data&0x80)>>7; m_IR1_equalizing_constant = (data&0x7f)+1; - LOG2674(("IR1 - Interlace Enable %02x\n",m_IR1_interlace_enable)); - LOG2674(("IR1 - Equalizing Constant %02i CCLKs\n",m_IR1_equalizing_constant)); + LOG("IR1 - Interlace Enable %02x\n",m_IR1_interlace_enable); + LOG("IR1 - Equalizing Constant %02i CCLKs\n",m_IR1_equalizing_constant); break; case 2: @@ -148,25 +163,25 @@ void scn2674_device::write_init_regs(uint8_t data) m_IR2_horz_sync_width = (((data&0x78)>>3)*2) + 2; m_IR2_horz_back_porch = ((data&0x07)*4) - 1; - LOG2674(("IR2 - Row Table %02x\n",m_IR2_row_table)); - LOG2674(("IR2 - Horizontal Sync Width %02i CCLKs\n",m_IR2_horz_sync_width)); - LOG2674(("IR2 - Horizontal Back Porch %02i CCLKs\n",m_IR2_horz_back_porch)); + LOG("IR2 - Row Table %02x\n",m_IR2_row_table); + LOG("IR2 - Horizontal Sync Width %02i CCLKs\n",m_IR2_horz_sync_width); + LOG("IR2 - Horizontal Back Porch %02i CCLKs\n",m_IR2_horz_back_porch); break; case 3: m_IR3_vert_front_porch = (((data&0xe0)>>5) * 4)+4 ; m_IR3_vert_back_porch = ((data&0x1f) * 2) + 4; - LOG2674(("IR3 - Vertical Front Porch %02i Lines\n",m_IR3_vert_front_porch)); - LOG2674(("IR3 - Vertical Back Porch %02i Lines\n",m_IR3_vert_back_porch)); + LOG("IR3 - Vertical Front Porch %02i Lines\n",m_IR3_vert_front_porch); + LOG("IR3 - Vertical Back Porch %02i Lines\n",m_IR3_vert_back_porch); break; case 4: m_IR4_rows_per_screen = (data&0x7f) + 1; m_IR4_character_blink_rate_divisor = ((data & 0x80)>>7 ? 128:64); - LOG2674(("IR4 - Rows Per Screen %02i\n",m_IR4_rows_per_screen)); - LOG2674(("IR4 - Character Blink Rate = 1/%02i\n",m_IR4_character_blink_rate_divisor)); + LOG("IR4 - Rows Per Screen %02i\n",m_IR4_rows_per_screen); + LOG("IR4 - Character Blink Rate = 1/%02i\n",m_IR4_character_blink_rate_divisor); break; case 5: @@ -174,14 +189,14 @@ void scn2674_device::write_init_regs(uint8_t data) cccc cccc c = Characters Per Row */ m_IR5_character_per_row = data + 1; - LOG2674(("IR5 - Active Characters Per Row %02i\n",m_IR5_character_per_row)); + LOG("IR5 - Active Characters Per Row %02i\n",m_IR5_character_per_row); break; case 6: m_IR6_cursor_last_scanline = (data & 0x0f); m_IR6_cursor_first_scanline = (data & 0xf0)>>4; - LOG2674(("IR6 - First Line of Cursor %02x\n",m_IR6_cursor_first_scanline)); - LOG2674(("IR6 - Last Line of Cursor %02x\n",m_IR6_cursor_last_scanline)); + LOG("IR6 - First Line of Cursor %02x\n",m_IR6_cursor_first_scanline); + LOG("IR6 - Last Line of Cursor %02x\n",m_IR6_cursor_last_scanline); break; case 7: @@ -193,28 +208,28 @@ void scn2674_device::write_init_regs(uint8_t data) m_IR7_vsync_width = vsync_table[(data & 0xC0)>>6]; - LOG2674(("IR7 - Underline Position %02x\n",m_IR7_cursor_underline_position)); - LOG2674(("IR7 - Cursor rate 1/%02i\n",m_IR7_cursor_rate_divisor)); - LOG2674(("IR7 - Cursor blink %02x\n",m_IR7_cursor_blink)); - LOG2674(("IR7 - Vsync Width %02i Lines\n",m_IR7_vsync_width)); + LOG("IR7 - Underline Position %02x\n",m_IR7_cursor_underline_position); + LOG("IR7 - Cursor rate 1/%02i\n",m_IR7_cursor_rate_divisor); + LOG("IR7 - Cursor blink %02x\n",m_IR7_cursor_blink); + LOG("IR7 - Vsync Width %02i Lines\n",m_IR7_vsync_width); break; } case 8: m_IR8_display_buffer_first_address_LSB = data; - LOG2674(("IR8 - Display Buffer First Address LSB %02x\n",m_IR8_display_buffer_first_address_LSB)); + LOG("IR8 - Display Buffer First Address LSB %02x\n",m_IR8_display_buffer_first_address_LSB); break; case 9: m_IR9_display_buffer_first_address_MSB = data & 0x0f; m_IR9_display_buffer_last_address = (data & 0xf0)>>4; - LOG2674(("IR9 - Display Buffer First Address MSB %02x\n",m_IR9_display_buffer_first_address_MSB)); - LOG2674(("IR9 - Display Buffer Last Address %02x\n",m_IR9_display_buffer_last_address)); + LOG("IR9 - Display Buffer First Address MSB %02x\n",m_IR9_display_buffer_first_address_MSB); + LOG("IR9 - Display Buffer Last Address %02x\n",m_IR9_display_buffer_last_address); break; case 10: m_IR10_display_pointer_address_lower = data; - LOG2674(("IR10 - Display Pointer Address Lower %02x\n",m_IR10_display_pointer_address_lower)); + LOG("IR10 - Display Pointer Address Lower %02x\n",m_IR10_display_pointer_address_lower); break; case 11: @@ -222,23 +237,23 @@ void scn2674_device::write_init_regs(uint8_t data) m_IR11_reset_scanline_counter_on_scrollup= (data&0x40 >> 6); m_IR11_reset_scanline_counter_on_scrolldown= (data&0x80 >> 7); - LOG2674(("IR11 - Display Pointer Address Lower %02x\n",m_IR11_display_pointer_address_upper)); - LOG2674(("IR11 - Reset Scanline Counter on Scroll Up %02x\n",m_IR11_reset_scanline_counter_on_scrollup)); - LOG2674(("IR11 - Reset Scanline Counter on Scroll Down %02x\n",m_IR11_reset_scanline_counter_on_scrolldown)); + LOG("IR11 - Display Pointer Address Lower %02x\n",m_IR11_display_pointer_address_upper); + LOG("IR11 - Reset Scanline Counter on Scroll Up %02x\n",m_IR11_reset_scanline_counter_on_scrollup); + LOG("IR11 - Reset Scanline Counter on Scroll Down %02x\n",m_IR11_reset_scanline_counter_on_scrolldown); break; case 12: m_IR12_scroll_start = (data & 0x80)>>7; m_IR12_split_register_1 = (data & 0x7f); - LOG2674(("IR12 - Scroll Start %02x\n",m_IR12_scroll_start)); - LOG2674(("IR12 - Split Register 1 %02x\n",m_IR12_split_register_1)); + LOG("IR12 - Scroll Start %02x\n",m_IR12_scroll_start); + LOG("IR12 - Split Register 1 %02x\n",m_IR12_split_register_1); break; case 13: m_IR13_scroll_end = (data & 0x80)>>7; m_IR13_split_register_2 = (data & 0x7f); - LOG2674(("IR13 - Scroll End %02x\n",m_IR13_scroll_end)); - LOG2674(("IR13 - Split Register 2 %02x\n",m_IR13_split_register_2)); + LOG("IR13 - Scroll End %02x\n",m_IR13_scroll_end); + LOG("IR13 - Split Register 2 %02x\n",m_IR13_split_register_2); break; case 14: @@ -246,15 +261,15 @@ void scn2674_device::write_init_regs(uint8_t data) if (!m_IR0_double_ht_wd) { m_IR14_double_2 = (data & 0x30)>>4; - LOG2674(("IR14 - Double 2 %02x\n",m_IR14_double_2)); + LOG("IR14 - Double 2 %02x\n",m_IR14_double_2); } //0 normal, 1, double width, 2, double width and double tops 3, double width and double bottoms //1 affects SSR1, 2 affects SSR2 //If Double Height enabled in IR0, Screen start 1 upper (bits 7 and 6)replace Double 1, and Double 2 is unused m_IR14_double_1 = (data & 0xc0)>>6; - LOG2674(("IR14 - Double 1 %02x\n",m_IR14_double_1)); + LOG("IR14 - Double 1 %02x\n",m_IR14_double_1); - LOG2674(("IR14 - Scroll Lines %02i\n",m_IR14_scroll_lines)); + LOG("IR14 - Scroll Lines %02i\n",m_IR14_scroll_lines); break; case 15: /* not valid! */ @@ -276,7 +291,7 @@ void scn2674_device::write_command(uint8_t data) if (data==0x00) { /* master reset, configures registers */ - LOG2674(("master reset\n")); + LOG("master reset\n"); m_IR_pointer=0; m_irq_register = 0x00; m_status_register = 0x20;//RDFLG activated @@ -292,7 +307,7 @@ void scn2674_device::write_command(uint8_t data) { /* set IR pointer */ operand = data & 0x0f; - LOG2674(("set IR pointer %02x\n",operand)); + LOG("set IR pointer %02x\n",operand); m_IR_pointer=operand; @@ -303,7 +318,7 @@ void scn2674_device::write_command(uint8_t data) if ((data&0xe3)==0x22) { /* Disable GFX */ - LOG2674(("disable GFX %02x\n",data)); + LOG("disable GFX %02x\n",data); m_gfx_enabled = 0; recompute_parameters(); } @@ -311,7 +326,7 @@ void scn2674_device::write_command(uint8_t data) if ((data&0xe3)==0x23) { /* Enable GFX */ - LOG2674(("enable GFX %02x\n",data)); + LOG("enable GFX %02x\n",data); m_gfx_enabled = 1; recompute_parameters(); } @@ -324,9 +339,9 @@ void scn2674_device::write_command(uint8_t data) m_display_enabled = 0; if (operand) - LOG2674(("display OFF - float DADD bus %02x\n",data)); + LOG("display OFF - float DADD bus %02x\n",data); else - LOG2674(("display OFF - no float DADD bus %02x\n",data)); + LOG("display OFF - no float DADD bus %02x\n",data); } if ((data&0xe9)==0x29) @@ -337,12 +352,12 @@ void scn2674_device::write_command(uint8_t data) if (operand) { m_display_enabled_field = 1; - LOG2674(("display ON - next field %02x\n",data)); + LOG("display ON - next field %02x\n",data); } else { m_display_enabled_scanline = 1; - LOG2674(("display ON - next scanline %02x\n",data)); + LOG("display ON - next scanline %02x\n",data); } recompute_parameters(); // start the scanline timer } @@ -350,14 +365,14 @@ void scn2674_device::write_command(uint8_t data) if ((data&0xf1)==0x30) { /* Cursor Off */ - LOG2674(("cursor off %02x\n",data)); + LOG("cursor off %02x\n",data); m_cursor_enabled = 0; } if ((data&0xf1)==0x31) { /* Cursor On */ - LOG2674(("cursor on %02x\n",data)); + LOG("cursor on %02x\n",data); m_cursor_enabled = 1; } @@ -367,17 +382,17 @@ void scn2674_device::write_command(uint8_t data) { /* Reset Interrupt / Status bit */ operand = data & 0x1f; - LOG2674(("reset interrupt / status bit %02x\n",operand)); + LOG("reset interrupt / status bit %02x\n",operand); m_irq_register &= ~(data & 0x1f); m_status_register &= ~(data & 0x1f); - LOG2674(("IRQ Status after reset\n")); - LOG2674(("Split 2 IRQ: %d Active\n",(m_irq_register>>0)&1)); - LOG2674(("Ready IRQ: %d Active\n",(m_irq_register>>1)&1)); - LOG2674(("Split 1 IRQ: %d Active\n",(m_irq_register>>2)&1)); - LOG2674(("Line Zero IRQ: %d Active\n",(m_irq_register>>3)&1)); - LOG2674(("V-Blank IRQ: %d Active\n",(m_irq_register>>4)&1)); + LOG("IRQ Status after reset\n"); + LOG("Split 2 IRQ: %d Active\n",(m_irq_register>>0)&1); + LOG("Ready IRQ: %d Active\n",(m_irq_register>>1)&1); + LOG("Split 1 IRQ: %d Active\n",(m_irq_register>>2)&1); + LOG("Line Zero IRQ: %d Active\n",(m_irq_register>>3)&1); + LOG("V-Blank IRQ: %d Active\n",(m_irq_register>>4)&1); m_irq_state = 0; @@ -396,12 +411,12 @@ void scn2674_device::write_command(uint8_t data) /* Disable Interrupt mask*/ operand = data & 0x1f; m_irq_mask &= ~(operand); - LOG2674(("IRQ Mask after disable %x\n",operand)); - LOG2674(("Split 2 IRQ: %d Unmasked\n",(m_irq_mask>>0)&1)); - LOG2674(("Ready IRQ: %d Unmasked\n",(m_irq_mask>>1)&1)); - LOG2674(("Split 1 IRQ: %d Unmasked\n",(m_irq_mask>>2)&1)); - LOG2674(("Line Zero IRQ: %d Unmasked\n",(m_irq_mask>>3)&1)); - LOG2674(("V-Blank IRQ: %d Unmasked\n",(m_irq_mask>>4)&1)); + LOG("IRQ Mask after disable %x\n",operand); + LOG("Split 2 IRQ: %d Unmasked\n",(m_irq_mask>>0)&1); + LOG("Ready IRQ: %d Unmasked\n",(m_irq_mask>>1)&1); + LOG("Split 1 IRQ: %d Unmasked\n",(m_irq_mask>>2)&1); + LOG("Line Zero IRQ: %d Unmasked\n",(m_irq_mask>>3)&1); + LOG("V-Blank IRQ: %d Unmasked\n",(m_irq_mask>>4)&1); } @@ -411,12 +426,12 @@ void scn2674_device::write_command(uint8_t data) operand = data & 0x1f; m_irq_mask |= (data & 0x1f); - LOG2674(("IRQ Mask after enable %x\n",operand)); - LOG2674(("Split 2 IRQ: %d Unmasked\n",(m_irq_mask>>0)&1)); - LOG2674(("Ready IRQ: %d Unmasked\n",(m_irq_mask>>1)&1)); - LOG2674(("Split 1 IRQ: %d Unmasked\n",(m_irq_mask>>2)&1)); - LOG2674(("Line Zero IRQ: %d Unmasked\n",(m_irq_mask>>3)&1)); - LOG2674(("V-Blank IRQ: %d Unmasked\n",(m_irq_mask>>4)&1)); + LOG("IRQ Mask after enable %x\n",operand); + LOG("Split 2 IRQ: %d Unmasked\n",(m_irq_mask>>0)&1); + LOG("Ready IRQ: %d Unmasked\n",(m_irq_mask>>1)&1); + LOG("Split 1 IRQ: %d Unmasked\n",(m_irq_mask>>2)&1); + LOG("Line Zero IRQ: %d Unmasked\n",(m_irq_mask>>3)&1); + LOG("V-Blank IRQ: %d Unmasked\n",(m_irq_mask>>4)&1); } @@ -428,38 +443,38 @@ void scn2674_device::write_command(uint8_t data) case 0xa4: /* read at pointer address */ m_buffer = space().read_byte(m_screen2_l | (m_screen2_h << 8)); - LOG2674(("DELAYED read at pointer address %02x\n",data)); + LOG("DELAYED read at pointer address %02x\n",data); break; case 0xa2: /* write at pointer address */ space().write_byte(m_screen2_l | (m_screen2_h << 8), m_buffer); - LOG2674(("DELAYED write at pointer address %02x\n",data)); + LOG("DELAYED write at pointer address %02x\n",data); break; case 0xa6: // used by the Octopus /* write at pointer address */ space().write_byte((m_IR10_display_pointer_address_lower | (m_IR11_display_pointer_address_upper << 8)), m_buffer); - LOG2674(("DELAYED write at display pointer address %02x\n",data)); + LOG("DELAYED write at display pointer address %02x\n",data); break; case 0xa9: /* increment cursor address */ if(!(++m_cursor_l)) m_cursor_h++; - LOG2674(("DELAYED increase cursor address %02x\n",data)); + LOG("DELAYED increase cursor address %02x\n",data); break; case 0xac: /* read at cursor address */ m_buffer = space().read_byte(m_cursor_l | (m_cursor_h << 8)); - LOG2674(("DELAYED read at cursor address %02x\n",data)); + LOG("DELAYED read at cursor address %02x\n",data); break; case 0xaa: /* write at cursor address */ space().write_byte(m_cursor_l | (m_cursor_h << 8), m_buffer); - LOG2674(("DELAYED write at cursor address %02x\n",data)); + LOG("DELAYED write at cursor address %02x\n",data); break; case 0xad: @@ -467,7 +482,7 @@ void scn2674_device::write_command(uint8_t data) m_buffer = space().read_byte(m_cursor_l | (m_cursor_h << 8)); if(!(++m_cursor_l)) m_cursor_h++; - LOG2674(("DELAYED read at cursor address+increment %02x\n",data)); + LOG("DELAYED read at cursor address+increment %02x\n",data); break; case 0xab: @@ -476,7 +491,7 @@ void scn2674_device::write_command(uint8_t data) space().write_byte(m_cursor_l | (m_cursor_h << 8), m_buffer); if(!(++m_cursor_l)) m_cursor_h++; - LOG2674(("DELAYED write at cursor address+increment %02x\n",data)); + LOG("DELAYED write at cursor address+increment %02x\n",data); break; case 0xbb: @@ -486,12 +501,12 @@ void scn2674_device::write_command(uint8_t data) space().write_byte(i, m_buffer); // get the last m_cursor_l = m_screen2_l; m_cursor_h = m_screen2_h; - LOG2674(("DELAYED write from cursor address to pointer address %02x\n",data)); + LOG("DELAYED write from cursor address to pointer address %02x\n",data); break; case 0xbd: /* read from cursor address to pointer address */ - LOG2674(("DELAYED read from cursor address to pointer address %02x\n",data)); + LOG("DELAYED read from cursor address to pointer address %02x\n",data); break; case 0xbf: @@ -501,7 +516,7 @@ void scn2674_device::write_command(uint8_t data) space().write_byte(i, m_buffer); // get the last m_cursor_l = m_IR10_display_pointer_address_lower; m_cursor_h = m_IR11_display_pointer_address_upper; - LOG2674(("DELAYED write from cursor address to pointer address %02x\n",data)); + LOG("DELAYED write from cursor address to pointer address %02x\n",data); break; } } @@ -537,19 +552,19 @@ READ8_MEMBER( scn2674_device::read ) */ case 0: - LOG2674(("Read Irq Register %02x %06x\n",m_irq_register,space.device().safe_pc())); + LOG("Read Irq Register %02x %06x\n",m_irq_register,space.device().safe_pc()); return m_irq_register; case 1: - LOG2674(("Read Status Register %02X %06x\n",m_status_register,space.device().safe_pc())); + LOG("Read Status Register %02X %06x\n",m_status_register,space.device().safe_pc()); return m_status_register; - case 2: LOG2674(("Read Screen1_l Register %06x\n",space.device().safe_pc()));return m_screen1_l; - case 3: LOG2674(("Read Screen1_h Register %06x\n",space.device().safe_pc()));return m_screen1_h & 0x3f; - case 4: LOG2674(("Read Cursor_l Register %06x\n",space.device().safe_pc()));return m_cursor_l; - case 5: LOG2674(("Read Cursor_h Register %06x\n",space.device().safe_pc()));return m_cursor_h; - case 6: LOG2674(("Read Screen2_l Register %06x\n",space.device().safe_pc()));return m_screen2_l; - case 7: LOG2674(("Read Screen2_h Register %06x\n",space.device().safe_pc()));return m_screen2_h; + case 2: LOG("Read Screen1_l Register %06x\n",space.device().safe_pc());return m_screen1_l; + case 3: LOG("Read Screen1_h Register %06x\n",space.device().safe_pc());return m_screen1_h & 0x3f; + case 4: LOG("Read Cursor_l Register %06x\n",space.device().safe_pc());return m_cursor_l; + case 5: LOG("Read Cursor_h Register %06x\n",space.device().safe_pc());return m_cursor_h; + case 6: LOG("Read Screen2_l Register %06x\n",space.device().safe_pc());return m_screen2_l; + case 7: LOG("Read Screen2_h Register %06x\n",space.device().safe_pc());return m_screen2_h; } return 0xff; @@ -592,7 +607,7 @@ WRITE8_MEMBER( scn2674_device::write ) { m_IR14_double_1 = m_dbl1; m_screen1_h &= 0x3f; - LOG2674(("IR14 - Double 1 overridden %02x\n",m_IR14_double_1)); + LOG("IR14 - Double 1 overridden %02x\n",m_IR14_double_1); } if(!m_screen->vblank()) m_start1change = (m_linecounter / m_IR0_scanline_per_char_row) + 1; @@ -624,7 +639,7 @@ void scn2674_device::recompute_parameters() return; } - LOG2674(("width %u height %u max_x %u max_y %u refresh %f\n", horiz_pix_total, vert_pix_total, max_visible_x, max_visible_y, 1 / ATTOSECONDS_TO_DOUBLE(refresh))); + LOG("width %u height %u max_x %u max_y %u refresh %f\n", horiz_pix_total, vert_pix_total, max_visible_x, max_visible_y, 1 / ATTOSECONDS_TO_DOUBLE(refresh)); rectangle visarea; visarea.set(0, max_visible_x, 0, max_visible_y); @@ -660,7 +675,7 @@ void scn2674_device::device_timer(emu_timer &timer, device_timer_id id, int para m_status_register |= 0x10; if(m_irq_mask & 0x10) { - LOG2674(("vblank irq\n")); + LOG("vblank irq\n"); m_irq_state = 1; m_irq_register |= 0x10; m_irq_cb(1); @@ -679,7 +694,7 @@ void scn2674_device::device_timer(emu_timer &timer, device_timer_id id, int para m_status_register |= 0x08; if (m_irq_mask & 0x08) { - LOG2674(("SCN2674 Line Zero\n")); + LOG("SCN2674 Line Zero\n"); m_irq_state = 1; m_irq_register |= 0x08; m_irq_cb(1); @@ -691,7 +706,7 @@ void scn2674_device::device_timer(emu_timer &timer, device_timer_id id, int para m_status_register |= 0x04; if(m_irq_mask & 0x04) { - LOG2674(("SCN2674 Split Screen 1 irq\n")); + LOG("SCN2674 Split Screen 1 irq\n"); m_irq_state = 1; m_irq_register |= 0x04; m_irq_cb(1); @@ -707,7 +722,7 @@ void scn2674_device::device_timer(emu_timer &timer, device_timer_id id, int para m_status_register |= 0x01; if(m_irq_mask & 0x01) { - LOG2674(("SCN2674 Split Screen 2 irq\n")); + LOG("SCN2674 Split Screen 2 irq\n"); m_irq_state = 1; m_irq_register |= 0x01; m_irq_cb(1); |