Previous 15994 Revisions Next

r794 Tuesday 7th August, 2007 at 13:44:28 UTC by Curt Coder
[ATARIST] WIP fixes
[src/mess/drivers]atarist.c
[src/mess/video]atarist.c atarist.h

src/mess/video/atarist.c
r793r794
1414#include "video/generic.h"
1515#include "cpu/m68000/m68k.h"
1616#include "cpu/m68000/m68000.h"
17#include "video/atarist.h"
1718 
1819static struct SHIFTER
1920{
r793r794
2425   UINT16 palette[16];
2526   UINT8 lineofs;  // STe
2627   UINT8 pixelofs; // STe
28   UINT16 rr[4];
29   UINT16 ir[4];
2730   int vcount;
2831   int hcount;
29   UINT16 rr[4];
30   UINT16 ir[4];
3132   int bitplane;
3233   int shift;
3334} shifter;
r793r794
9293 
9394      switch (shifter.hcount)
9495      {
95      case 14:
96      case ATARIST_HBDEND_PAL:
9697         h = ASSERT_LINE;
9798         break;
98      case 94:
99      case ATARIST_HBDSTART_PAL:
99100         h = CLEAR_LINE;
100101         break;
101      case 128:
102      case ATARIST_HBSTART_PAL/4:
102103         cpunum_set_input_line(0, MC68000_IRQ_2, ASSERT_LINE);
103104         shifter.hcount = 0;
104105         break;
r793r794
106107 
107108      switch (shifter.vcount)
108109      {
109      case 0:
110      case ATARIST_VBSTART_PAL:
110111         cpunum_set_input_line(0, MC68000_IRQ_4, ASSERT_LINE);
111112         shifter.counter = 0;
112113         break;
113      case 63:
114      case ATARIST_VBDEND_PAL:
114115         v = ASSERT_LINE;
115116         break;
116      case 263:
117      case ATARIST_VBDSTART_PAL:
117118         v = CLEAR_LINE;
118119         break;
119120      }
r793r794
123124      // 60 Hz
124125      switch (shifter.hcount)
125126      {
126      case 13:
127      case ATARIST_HBDEND_NTSC:
127128         h = ASSERT_LINE;
128129         break;
129      case 93:
130      case ATARIST_HBDSTART_NTSC:
130131         h = CLEAR_LINE;
131132         break;
132      case 127:
133      case ATARIST_HBSTART_NTSC/4:
133134         cpunum_set_input_line(0, MC68000_IRQ_2, ASSERT_LINE);
134135         shifter.hcount = 0;
135136         break;
r793r794
137138 
138139      switch (shifter.vcount)
139140      {
140      case 0:
141      case ATARIST_VBSTART_NTSC:
141142         shifter.counter = 0;
142143         cpunum_set_input_line(0, MC68000_IRQ_4, ASSERT_LINE);
143144         break;
144      case 34:
145      case ATARIST_VBDEND_NTSC:
145146         v = ASSERT_LINE;
146147         break;
147      case 234:
148      case ATARIST_VBDSTART_NTSC:
148149         v = CLEAR_LINE;
149150         break;
150151      }
r793r794
198199   default:
199200      if ((offset & 0xe0) == 0x40)
200201      {
201         return shifter.palette[offset & 0x1e];
202         return shifter.palette[offset & 0x1f];
202203      }
203204   }
204205 
r793r794
265266   default:
266267      if ((offset & 0xe0) == 0x40)
267268      {
268         return shifter.palette[offset & 0x1e];
269         return shifter.palette[offset & 0x1f];
269270      }
270271   }
271272 
r793r794
332333   mame_timer_adjust(atarist_shifter_timer, time_zero, 0, MAME_TIME_IN_NSEC(500));
333334 
334335   atarist_bitmap = auto_bitmap_alloc(Machine->screen[0].width, Machine->screen[0].height, Machine->screen[0].format);
336 
337   memset(&shifter, 0, sizeof(shifter));
335338}
336339 
337340VIDEO_UPDATE( atarist )
src/mess/video/atarist.h
r793r794
11#ifndef _VIDEO_ATARIST_H_
22#define _VIDEO_ATARIST_H_
33 
4#define ATARIST_HBSTART_PAL      512
5#define ATARIST_HBEND_PAL      0
6#define ATARIST_HBSTART_NTSC   508
7#define ATARIST_HBEND_NTSC      0
8#define ATARIST_HTOT_PAL      516
9#define ATARIST_HTOT_NTSC      512
10 
11#define ATARIST_HBDEND_PAL      14
12#define ATARIST_HBDSTART_PAL   94
13#define ATARIST_HBDEND_NTSC      13
14#define ATARIST_HBDSTART_NTSC   93
15 
16#define ATARIST_VBEND_PAL      0
17#define ATARIST_VBEND_NTSC      0
18#define ATARIST_VBSTART_PAL      312
19#define ATARIST_VBSTART_NTSC   262
20#define ATARIST_VTOT_PAL      313
21#define ATARIST_VTOT_NTSC      263
22 
23#define ATARIST_VBDEND_PAL      63
24#define ATARIST_VBDSTART_PAL   263
25#define ATARIST_VBDEND_NTSC      34
26#define ATARIST_VBDSTART_NTSC   234
27 
428READ16_HANDLER( atarist_shifter_r );
529WRITE16_HANDLER( atarist_shifter_w );
630READ16_HANDLER( atariste_shifter_r );
src/mess/drivers/atarist.c
r793r794
2727   - MFP interrupts
2828   - MMU
2929   - accurate screen timing
30   - fdc.dma_int ?
31   - save states
32   - Mega ST real time clock
3033
3134*/
3235
r793r794
4750   int dma_bytes;
4851   int dma_int;
4952   int active;
53   int interrupt;
5054} fdc;
5155
5256static void atarist_dma_transfer(void)
r793r794
8084   switch (event)
8185   {
8286   case WD17XX_IRQ_CLR:
87      fdc.interrupt = CLEAR_LINE;
88      break;
8389   case WD17XX_DRQ_CLR:
8490      break;
8591   case WD17XX_IRQ_SET:
86      logerror("WD1792: Warning: IRQ set!\n");
92      fdc.interrupt = ASSERT_LINE;
8793      break;
8894   case WD17XX_DRQ_SET:
8995      if (fdc.dma_select == 0)
r793r794
198204   }
199205}
200206
201/* SHIFTER */
202
203
204207/* MMU */
205208
206209static int mmu;
r793r794
314317ADDRESS_MAP_END
315318
316319static ADDRESS_MAP_START(keyboard_io_map, ADDRESS_SPACE_IO, 8)
317/*   AM_RANGE(HD6301_PORT1, HD6301_PORT1) AM_WRITE(keyboard_latch_w)
320/*   AM_RANGE(HD6301_PORT1, HD6301_PORT1) AM_WRITE(hd6301_port1_w)
318321   AM_RANGE(HD6301_PORT2, HD6301_PORT2) AM_READWRITE(hd6301_port2_r, hd6301_port2_w)
319   AM_RANGE(HD6301_PORT3, HD6301_PORT3) AM_READ(keyboard_0_r)
320   AM_RANGE(HD6301_PORT4, HD6301_PORT4) AM_READ(keyboard_1_r)*/
322   AM_RANGE(HD6301_PORT3, HD6301_PORT3) AM_READ(hd6301_port_3_r)
323   AM_RANGE(HD6301_PORT4, HD6301_PORT4) AM_READ(hd6301_port_4_r)*/
321324ADDRESS_MAP_END
322325
323326static ADDRESS_MAP_START(st_map, ADDRESS_SPACE_PROGRAM, 16)
r793r794
491494   PORT_CONFNAME( 0x20, 0x00, "Input Port 0 Device")
492495   PORT_CONFSETTING( 0x00, "Mouse" )
493496   PORT_CONFSETTING( 0x20, DEF_STR(Joystick) )
497   PORT_CONFNAME( 0x80, 0x80, "Monitor")
498   PORT_CONFSETTING( 0x00, "Monochrome" )
499   PORT_CONFSETTING( 0x80, "Color" )
494500
495501   PORT_START_TAG("MOUSE_X")
496502   PORT_BIT( 0xff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(5) PORT_MINMAX(0, 255) PORT_PLAYER(1)   
r793r794
662668   }
663669
664670   data |= acia_int << 4;
665   data |= fdc.active << 5;
666   data |= 0x80;
671   data |= fdc.interrupt << 5;
672   data |= readinputportbytag("config") & 0x80;
667673
668674   return data;
669675}
r793r794
733739   MDRV_VIDEO_UPDATE( atarist )
734740
735741   MDRV_SCREEN_ADD("main", 0)
736   MDRV_SCREEN_RAW_PARAMS(Y2/4, 516, 0, 512, 313, 0, 312)
742   MDRV_SCREEN_RAW_PARAMS(Y2/4, ATARIST_HTOT_PAL, ATARIST_HBEND_PAL, ATARIST_HBSTART_PAL, ATARIST_VTOT_PAL, ATARIST_VBEND_PAL, ATARIST_VBSTART_PAL)
737743
738744   // sound hardware
739745   MDRV_SPEAKER_STANDARD_MONO("mono")

Previous 15994 Revisions Next


© 1998-2018 The MESS Team