Previous 15994 Revisions Next

r1898 Tuesday 11th March, 2008 at 01:41:55 UTC by Dirk Best
[ASTROCDE] Removed vblank hack
[src/mess/drivers]astrocde.c
[src/mess/includes]astrocde.h
[src/mess/machine]astrocde.c
[src/mess/video]astrocde.c

src/mess/includes/astrocde.h
r1897r1898
1010
1111/*----------- defined in machine/astrocde.c -----------*/
1212
13extern WRITE8_HANDLER( astrocade_interrupt_enable_w );
14extern WRITE8_HANDLER( astrocade_interrupt_w );
15extern INTERRUPT_GEN( astrocade_interrupt );
13WRITE8_HANDLER( astrocade_interrupt_enable_w );
14WRITE8_HANDLER( astrocade_interrupt_w );
1615WRITE8_HANDLER ( astrocade_interrupt_vector_w );
16MACHINE_RESET( astrocde );
17DRIVER_INIT( astrocde );
1718
1819
1920/*----------- defined in video/astrocde.c -----------*/
src/mess/video/astrocde.c
r1897r1898
112112         palette_set_color_rgb(machine, i*8+j, floor(R+.5), floor(G+.5),  floor(B+.5));
113113      }
114114   }
115
116   /* Set the fake colortable for the dip switch menus, etc. */
117115}
118116
119WRITE8_HANDLER ( astrocade_vertical_blank_w )
117WRITE8_HANDLER( astrocade_vertical_blank_w )
120118{
121119   VerticalBlank = data;
122120}
123121
124 READ8_HANDLER ( astrocade_intercept_r )
122READ8_HANDLER( astrocade_intercept_r )
125123{
126124   int res;
127125
r1897r1898
132130}
133131
134132
135 READ8_HANDLER ( astrocade_video_retrace_r )
133READ8_HANDLER( astrocade_video_retrace_r )
136134{
137   extern int CurrentScan;
138
139    return CurrentScan;
135    return video_screen_get_vpos(0);
140136}
141137
138
142139/* Switches colour registers at this zone - 40 zones */
143140/* Also sets the background colors */
144141
src/mess/machine/astrocde.c
r1897r1898
2222 * Scanline Interrupt System
2323 ****************************************************************************/
2424
25int CurrentScan=0;
25static emu_timer *scanline_timer;
26
2627static int NextScanInt=0;         /* Normal */
2728
2829static int screen_interrupts_enabled;
r1897r1898
3940   lightpen_interrupts_enabled = data & 0x02;
4041   lightpen_interrupt_mode = data & 0x01;
4142
42       LOG(("Interrupt Flag set to %02x\n",data & 0x0f));
43   LOG(("Interrupt Flag set to %02x\n",data & 0x0f));
4344}
4445
4546WRITE8_HANDLER ( astrocade_interrupt_w )
r1897r1898
5152    NextScanInt = data;
5253}
5354
54INTERRUPT_GEN( astrocade_interrupt )
55
56static TIMER_CALLBACK( astrocde_scanline_callback )
5557{
56    CurrentScan++;
58   int scanline = video_screen_get_vpos(0);
59   
60   /* draw if we are in the visable area */
61   if (scanline < machine->screen[0].visarea.max_y)
62      astrocade_copy_line(scanline);
63   
64   /* scanline interrupt? */
65   if (screen_interrupts_enabled && (screen_interrupt_mode == 0) && (scanline == NextScanInt))
66      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
5767
58    if (CurrentScan == machine->config->cpu[0].vblank_interrupts_per_frame)
59      CurrentScan = 0;
68   /* are we on the last scanline? */
69   if (++scanline == machine->screen[0].height)
70      scanline = 0;
6071
61    if (CurrentScan < 204) astrocade_copy_line(CurrentScan);
62
63    /* Scanline interrupt enabled ? */
64    if ((screen_interrupts_enabled) && (screen_interrupt_mode == 0)
65                                   && (CurrentScan == NextScanInt))
66      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
72   /* wait for next scanline */
73   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), 0);
6774}
6875
76
6977WRITE8_HANDLER( astrocade_interrupt_vector_w )
7078{
7179   cpunum_set_input_line_vector(0, 0, data);
7280   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
7381}
82
83
84MACHINE_RESET( astrocde )
85{
86   /* wait for the first scanline */
87   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
88}
89
90
91DRIVER_INIT( astrocde )
92{
93   scanline_timer = timer_alloc(astrocde_scanline_callback, NULL);
94}
src/mess/drivers/astrocde.c
r1897r1898
226226   MDRV_CPU_ADD(Z80, 1789000)        /* 1.789 Mhz */
227227   MDRV_CPU_PROGRAM_MAP(astrocade_mem, 0)
228228   MDRV_CPU_IO_MAP(astrocade_io, 0)
229   MDRV_CPU_VBLANK_INT_HACK(astrocade_interrupt, 256)
230   MDRV_INTERLEAVE(1)
231229
230   MDRV_MACHINE_RESET(astrocde)
231
232232    /* video hardware */
233233   MDRV_SCREEN_ADD("main", RASTER)
234234   MDRV_SCREEN_REFRESH_RATE(60)
235235   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
236236   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
237   MDRV_SCREEN_SIZE(320, 204)
237   MDRV_SCREEN_SIZE(320, 256)
238238   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 204-1)
239239   MDRV_PALETTE_LENGTH(8*32)
240240   MDRV_PALETTE_INIT( astrocade )
r1897r1898
288288 *
289289 *************************************/
290290
291/*    YEAR  NAME      PARENT    COMPAT    MACHINE   INPUT     INIT  CONFIG    COMPANY                FULLNAME                     FLAGS */
292CONS( 1978, astrocde, 0,        0,        astrocde, astrocde, 0,    astrocde, "Bally Manufacturing", "Bally Professional Arcade", 0)
293CONS( 1977, astrocdw, astrocde, 0,        astrocde, astrocde, 0,    astrocde, "Bally Manufacturing", "Bally Computer System",     0)
291/*    YEAR  NAME      PARENT    COMPAT    MACHINE   INPUT     INIT      CONFIG    COMPANY                FULLNAME                     FLAGS */
292CONS( 1978, astrocde, 0,        0,        astrocde, astrocde, astrocde, astrocde, "Bally Manufacturing", "Bally Professional Arcade", 0)
293CONS( 1977, astrocdw, astrocde, 0,        astrocde, astrocde, astrocde, astrocde, "Bally Manufacturing", "Bally Computer System",     0)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team