6060
6161#include " speaker.h"
6262
63+ // #define VERBOSE 1
64+ #include " logmacro.h"
65+
6366
6467DEFINE_DEVICE_TYPE (NES_VT02_VT03_SOC , nes_vt02_vt03_soc_device, " nes_vt02_vt03_soc" , " VT02/03 series System on a Chip (NTSC)" )
6568DEFINE_DEVICE_TYPE (NES_VT02_VT03_SOC_PAL , nes_vt02_vt03_soc_pal_device, " nes_vt02_vt03_soc_pal" , " VT02/03 series System on a Chip (PAL)" )
@@ -347,7 +350,6 @@ void nes_vt02_vt03_soc_device::scrambled_410x_w(u16 offset, u8 data)
347350 break ;
348351
349352 case 0x2 :
350- // logerror("vt03_4102_w %02x\n", data);
351353 // load latched value and start counting
352354 m_410x[0x2 ] = data; // value doesn't matter?
353355 m_timer_val = m_410x[0x1 ];
@@ -361,22 +363,19 @@ void nes_vt02_vt03_soc_device::scrambled_410x_w(u16 offset, u8 data)
361363 break ;
362364
363365 case 0x3 :
364- // logerror("vt03_4103_w %02x\n", data);
365366 m_maincpu->set_input_line (M6502_IRQ_LINE , CLEAR_LINE );
366367 // disable timer irq
367368 m_410x[0x3 ] = data; // value doesn't matter?
368369 m_timer_irq_enabled = 0 ;
369370 break ;
370371
371372 case 0x4 :
372- // logerror("vt03_4104_w %02x\n", data);
373373 // enable timer irq
374374 m_410x[0x4 ] = data; // value doesn't matter?
375375 m_timer_irq_enabled = 1 ;
376376 break ;
377377
378378 case 0x5 :
379- logerror (" vt03_4105_w %02x\n " , data);
380379 m_410x[0x5 ] = data;
381380 update_banks ();
382381 break ;
@@ -396,13 +395,11 @@ void nes_vt02_vt03_soc_device::scrambled_410x_w(u16 offset, u8 data)
396395 break ;
397396
398397 case 0x9 :
399- logerror (" vt03_4109_w %02x\n " , data);
400398 m_410x[0x9 ] = data;
401399 update_banks ();
402400 break ;
403401
404402 case 0xa :
405- logerror (" vt03_410a_w %02x\n " , data);
406403 m_410x[0xa ] = data;
407404 update_banks ();
408405 break ;
@@ -419,7 +416,6 @@ void nes_vt02_vt03_soc_device::scrambled_410x_w(u16 offset, u8 data)
419416
420417 */
421418
422- logerror (" vt03_410b_w %02x\n " , data);
423419 m_410x[0xb ] = data;
424420 update_banks ();
425421 break ;
@@ -449,7 +445,7 @@ void nes_vt02_vt03_soc_device::chr_w(offs_t offset, u8 data)
449445{
450446 if (m_4242 & 0x1 || m_411d & 0x04 ) // newer VT platforms only (not VT03/09), split out
451447 {
452- logerror (" vram write %04x %02x\n " , offset, data);
448+ LOG (" vram write %04x %02x\n " , offset, data);
453449 m_chrram[offset] = data;
454450 }
455451 else
@@ -751,7 +747,7 @@ void nes_vt02_vt03_soc_device::scrambled_8000_w(u16 offset, u8 data)
751747 // MMC3 compat
752748 if ((addr < 0xa000 ) && !(addr & 0x01 ))
753749 {
754- logerror (" %s: scrambled_8000_w real address: (%04x) translated address: (%04x) %02x (banking)\n " , machine ().describe_context (), addr, offset + 0x8000 , data);
750+ LOG (" %s: scrambled_8000_w real address: (%04x) translated address: (%04x) %02x (banking)\n " , machine ().describe_context (), addr, offset + 0x8000 , data);
755751 // Bank select
756752 m_8000_addr_latch = data & 0x07 ;
757753 // Bank config
@@ -760,7 +756,7 @@ void nes_vt02_vt03_soc_device::scrambled_8000_w(u16 offset, u8 data)
760756 }
761757 else if ((addr < 0xa000 ) && (addr & 0x01 ))
762758 {
763- logerror (" %s: scrambled_8000_w real address: (%04x) translated address: (%04x) %02x (other scrambled stuff)\n " , machine ().describe_context (), addr, offset + 0x8000 , data);
759+ LOG (" %s: scrambled_8000_w real address: (%04x) translated address: (%04x) %02x (other scrambled stuff)\n " , machine ().describe_context (), addr, offset + 0x8000 , data);
764760
765761 switch (m_410x[0x05 ] & 0x07 )
766762 {
@@ -901,11 +897,11 @@ void nes_vt02_vt03_soc_device::do_dma(u8 data, bool has_ntsc_bug)
901897 }
902898
903899 u16 src_addr = (data << 8 ) | (src_nib_74 << 4 );
904- logerror (" %s: vthh dma start ctrl=%02x addr=%04x\n " , machine ().describe_context (), m_vdma_ctrl, src_addr);
900+ LOG (" %s: vthh dma start ctrl=%02x addr=%04x\n " , machine ().describe_context (), m_vdma_ctrl, src_addr);
905901
906902 if (dma_mode == 1 )
907903 {
908- logerror (" vdma dest %04x\n " , m_ppu->get_vram_dest ());
904+ LOG (" vdma dest %04x\n " , m_ppu->get_vram_dest ());
909905 }
910906
911907 if (has_ntsc_bug && (dma_mode == 1 ) && ((m_ppu->get_vram_dest () & 0xFF00 ) == 0x3F00 ) && !(m_ppu->get_extended_modes2_enable () & 0x80 ))
@@ -935,14 +931,14 @@ void nes_vt02_vt03_soc_device::do_dma(u8 data, bool has_ntsc_bug)
935931// probably VT3xx only, not earlier?
936932void nes_vt02_vt03_soc_device::vt3xx_4024_new_dma_middle_w (u8 data)
937933{
938- logerror (" %s: vt3xx_4024_new_dma_middle_w %02x (VT3xx newer DMA middle bits?)\n " , machine ().describe_context (), data);
934+ LOG (" %s: vt3xx_4024_new_dma_middle_w %02x (VT3xx newer DMA middle bits?)\n " , machine ().describe_context (), data);
939935 // can set all 8-bits of the lower address using this register
940936 m_4024_newdma = data;
941937}
942938
943939void nes_vt02_vt03_soc_device::vt03_4034_w (u8 data)
944940{
945- logerror (" %s: vt03_4034_w %02x (2nd APU DMA / new DMA)\n " , machine ().describe_context (), data);
941+ LOG (" %s: vt03_4034_w %02x (2nd APU DMA / new DMA)\n " , machine ().describe_context (), data);
946942 m_vdma_ctrl = data;
947943
948944 // this also sets the lower DMA address under certain conditions, but only 4 bits of it? - needed to stop denv150 corrupting
@@ -985,7 +981,7 @@ void nes_vt02_vt03_soc_device::extra_io_control_w(u8 data)
985981 0x80 Extra I/O port 3 enable (1 = enable, 0 = disable)
986982 */
987983
988- logerror (" %s: extra_io_control_w %02x\n " , machine ().describe_context (), data);
984+ LOG (" %s: extra_io_control_w %02x\n " , machine ().describe_context (), data);
989985}
990986
991987u8 nes_vt02_vt03_soc_device::extrain_01_r ()
@@ -1013,13 +1009,13 @@ u8 nes_vt02_vt03_soc_device::extrain_23_r()
10131009void nes_vt02_vt03_soc_device::extraout_01_w (u8 data)
10141010{
10151011 // TODO: use callbacks for this as output can be hooked up to anything
1016- logerror (" %s: extraout_01_w %02x\n " , machine ().describe_context (), data);
1012+ LOG (" %s: extraout_01_w %02x\n " , machine ().describe_context (), data);
10171013}
10181014
10191015void nes_vt02_vt03_soc_device::extraout_23_w (u8 data)
10201016{
10211017 // TODO: use callbacks for this as output can be hooked up to anything
1022- logerror (" %s: extraout_23_w %02x\n " , machine ().describe_context (), data);
1018+ LOG (" %s: extraout_23_w %02x\n " , machine ().describe_context (), data);
10231019}
10241020
10251021u8 nes_vt02_vt03_soc_device::rs232flags_region_r ()
0 commit comments