Previous 15994 Revisions Next

r3843 Tuesday 16th December, 2008 at 16:18:49 UTC by Wilbert Pol
[WSWAN] Removed usage of MDRV_CPU_VBLANK_INT_HACK.
[src/mess/drivers]wswan.c
[src/mess/includes]wswan.h
[src/mess/machine]wswan.c

src/mess/includes/wswan.h
r3842r3843
8080   int main_palette[8];
8181   UINT8 display_vertical;         /* Should the wonderswan be held vertically? */
8282   UINT8 new_display_vertical;      /* New value for the display_vertical bit (to prevent mid frame changes) */
83   emu_timer *timer;
8384};
8485
8586
r3842r3843
9899extern WRITE8_HANDLER( wswan_sram_w );
99100extern DEVICE_START(wswan_cart);
100101extern DEVICE_IMAGE_LOAD(wswan_cart);
101extern INTERRUPT_GEN(wswan_scanline_interrupt);
102102
103103
104104/*----------- defined in video/wswan.c -----------*/
src/mess/machine/wswan.c
r3842r3843
5656   UINT8   enable;      /* Enabled */
5757};
5858
59static TIMER_CALLBACK(wswan_scanline_interrupt);
60
61
5962static UINT8 *ROMMap[256];
6063static UINT32 ROMBanks;
6164static UINT8 internal_eeprom[INTERNAL_EEPROM_SIZE];
r3842r3843
237240   vdp.color_mode = 0;
238241   vdp.colors_16 = 0;
239242   vdp.tile_packed = 0;
243   vdp.timer = timer_alloc( machine, wswan_scanline_interrupt, &vdp );
244   timer_adjust_periodic( vdp.timer, ticks_to_attotime( 256, 3072000 ), 0, ticks_to_attotime( 256, 3072000 ) );
240245
241246   /* Initialize sound DMA */
242247   memset( &sound_dma, 0, sizeof( sound_dma ) );
r3842r3843
13551360   return INIT_PASS;
13561361}
13571362
1358INTERRUPT_GEN(wswan_scanline_interrupt)
1363static TIMER_CALLBACK(wswan_scanline_interrupt)
13591364{
13601365   if( vdp.current_line < 144 ) {
13611366      wswan_refresh_scanline();
r3842r3843
13721377            vdp.timer_hblank_reload = 0;
13731378         }
13741379         logerror( "trigerring hbltmr interrupt\n" );
1375         wswan_set_irq_line( device->machine, WSWAN_IFLAG_HBLTMR );
1380         wswan_set_irq_line( machine, WSWAN_IFLAG_HBLTMR );
13761381      }
13771382   }
13781383
13791384   /* Handle Sound DMA */
13801385   if ( ( sound_dma.enable & 0x88 ) == 0x80 ) {
1381      const address_space *space = cpu_get_address_space( device->machine->cpu[0], ADDRESS_SPACE_PROGRAM );
1386      const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
13821387      /* TODO: Output sound DMA byte */
13831388      wswan_port_w( space, 0x89, memory_read_byte(space,  sound_dma.source ) );
13841389      sound_dma.size--;
r3842r3843
13911396//   vdp.current_line = (vdp.current_line + 1) % 159;
13921397
13931398   if( vdp.current_line == 144 ) {
1394      wswan_set_irq_line( device->machine, WSWAN_IFLAG_VBL );
1399      wswan_set_irq_line( machine, WSWAN_IFLAG_VBL );
13951400      /* Decrement 75Hz (VBlank) counter */
13961401      if ( vdp.timer_vblank_enable && vdp.timer_vblank_reload != 0 ) {
13971402         vdp.timer_vblank_count--;
r3842r3843
14031408               vdp.timer_vblank_reload = 0;
14041409            }
14051410            logerror( "triggering vbltmr interrupt\n" );
1406            wswan_set_irq_line( device->machine, WSWAN_IFLAG_VBLTMR );
1411            wswan_set_irq_line( machine, WSWAN_IFLAG_VBLTMR );
14071412         }
14081413      }
14091414   }
r3842r3843
14111416//   vdp.current_line = (vdp.current_line + 1) % 159;
14121417
14131418   if ( vdp.current_line == vdp.line_compare ) {
1414      wswan_set_irq_line( device->machine, WSWAN_IFLAG_LCMP );
1419      wswan_set_irq_line( machine, WSWAN_IFLAG_LCMP );
14151420   }
14161421
14171422   vdp.current_line = (vdp.current_line + 1) % 159;
r3842r3843
14201425      if ( vdp.display_vertical != vdp.new_display_vertical ) {
14211426         vdp.display_vertical = vdp.new_display_vertical;
14221427         if ( vdp.display_vertical ) {
1423            video_screen_set_visarea( device->machine->primary_screen, 5*8, 5*8 + WSWAN_Y_PIXELS - 1, 0, WSWAN_X_PIXELS - 1 );
1428            video_screen_set_visarea( machine->primary_screen, 5*8, 5*8 + WSWAN_Y_PIXELS - 1, 0, WSWAN_X_PIXELS - 1 );
14241429         } else {
1425            video_screen_set_visarea( device->machine->primary_screen, 0, WSWAN_X_PIXELS - 1, 5*8, 5*8 + WSWAN_Y_PIXELS - 1 );
1430            video_screen_set_visarea( machine->primary_screen, 0, WSWAN_X_PIXELS - 1, 5*8, 5*8 + WSWAN_Y_PIXELS - 1 );
14261431         }
14271432      }
14281433   }
src/mess/drivers/wswan.c
r3842r3843
132132   MDRV_CPU_ADD("main", V30MZ, 3072000)
133133   MDRV_CPU_PROGRAM_MAP(wswan_mem, 0)
134134   MDRV_CPU_IO_MAP(wswan_io, 0)
135   MDRV_CPU_VBLANK_INT_HACK(wswan_scanline_interrupt, 159)   /* 1 int each scanline */
136135
137136   MDRV_SCREEN_ADD("main", LCD)
138137   MDRV_SCREEN_REFRESH_RATE(75)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team