Previous 15994 Revisions Next

r804 Thursday 9th August, 2007 at 13:33:47 UTC by Curt Coder
[ATARIST] Displays a little better
[src/mess/drivers]atarist.c
[src/mess/machine]68901mfp.c
[src/mess/video]atarist.c atarist.h

src/mess/video/atarist.c
r803r804
2020static struct SHIFTER
2121{
2222   UINT32 base;
23   UINT32 counter;
23   UINT32 ofs;
2424   UINT8 sync;
2525   UINT8 mode;
2626   UINT16 palette[16];
r803r804
4949   {
5050   case 0: // 320 x 200, 4 Plane
5151      color = (BIT(shifter.rr[3], 15) << 3) | (BIT(shifter.rr[2], 15) << 2) | (BIT(shifter.rr[1], 15) << 1) | BIT(shifter.rr[0], 15);
52//      logerror("y %u x %u color %u mode %u\n", y, x, color, shifter.mode);
53         
52       
53      //logerror("y %u x %u color %u mode %u de %u h %u v %u hc %u\n", y, x, color, shifter.mode, shifter.h&&shifter.v, shifter.h, shifter.v, shifter.hcount);
54       
5455      *BITMAP_ADDR16(atarist_bitmap, y, x) = Machine->pens[color];
5556 
5657      shifter.rr[0] <<= 1;
5758      shifter.rr[1] <<= 1;
5859      shifter.rr[2] <<= 1;
5960      shifter.rr[3] <<= 1;
61 
6062      break;
6163 
6264   case 1: // 640 x 200, 2 Plane
6365      color = (BIT(shifter.rr[1], 15) << 1) | BIT(shifter.rr[0], 15);
64//      logerror("y %u x %u color %u mode %u\n", y, x, color, shifter.mode);
6566 
6667      *BITMAP_ADDR16(atarist_bitmap, y, x) = Machine->pens[color];
6768 
r803r804
7980      break;
8081 
8182   case 2: // 640 x 400, 1 Plane
82//      logerror("y %u x %u color %u mode %u\n", y, x, color, shifter.mode);
8383      // unimplemented
8484      break;
8585   }
r803r804
8888static TIMER_CALLBACK(atarist_glue_tick)
8989{
9090   int de;
91   UINT8 *RAM = memory_region(REGION_CPU1) + shifter.base + shifter.counter;
91   UINT8 *RAM = memory_region(REGION_CPU1) + shifter.base + shifter.ofs;
9292 
93   shifter.hcount = video_screen_get_hpos(0) / 4;
9394   shifter.vcount = video_screen_get_vpos(0);
9495 
9596   if (shifter.sync & 0x02)
r803r804
104105      case ATARIST_HBDSTART_PAL:
105106         shifter.h = CLEAR_LINE;
106107         break;
107      case ATARIST_HBSTART_PAL/4:
108      case 128:
108109         cpunum_set_input_line(0, MC68000_IRQ_2, ASSERT_LINE);
109         shifter.hcount = 0;
110110         break;
111111      }
112112 
113113      switch (shifter.vcount)
114114      {
115      case ATARIST_VBSTART_PAL:
116         cpunum_set_input_line(0, MC68000_IRQ_4, ASSERT_LINE);
117         shifter.counter = 0;
118         break;
119115      case ATARIST_VBDEND_PAL:
120116         shifter.v = ASSERT_LINE;
121117         break;
122118      case ATARIST_VBDSTART_PAL:
123119         shifter.v = CLEAR_LINE;
124120         break;
121      case ATARIST_VBSTART_PAL:
122         cpunum_set_input_line(0, MC68000_IRQ_4, ASSERT_LINE);
123         shifter.ofs = 0;
124         break;
125125      }
126126   }
127127   else
r803r804
135135      case ATARIST_HBDSTART_NTSC:
136136         shifter.h = CLEAR_LINE;
137137         break;
138      case ATARIST_HBSTART_NTSC/4:
138      case 127:
139139         cpunum_set_input_line(0, MC68000_IRQ_2, ASSERT_LINE);
140         shifter.hcount = 0;
141140         break;
142141      }
143142 
144143      switch (shifter.vcount)
145144      {
146      case ATARIST_VBSTART_NTSC:
147         shifter.counter = 0;
148         cpunum_set_input_line(0, MC68000_IRQ_4, ASSERT_LINE);
149         break;
150145      case ATARIST_VBDEND_NTSC:
151146         shifter.v = ASSERT_LINE;
152147         break;
153148      case ATARIST_VBDSTART_NTSC:
154149         shifter.v = CLEAR_LINE;
155150         break;
151      case ATARIST_VBSTART_NTSC:
152         cpunum_set_input_line(0, MC68000_IRQ_4, ASSERT_LINE);
153         shifter.ofs = 0;
154         break;
156155      }
157156   }
158157 
159158   de = shifter.h && shifter.v;
160159 
161160   mfp68901_tbi_w(0, de);
162 
163//   logerror("shifter base %x\n", shifter.base);
164//   logerror("shifter counter %x\n", shifter.counter);
165//   logerror("shifter bitplane %x\n", shifter.bitplane);
166   shifter.ir[shifter.bitplane] = (RAM[0] << 8) | RAM[1];
167   shifter.counter += 2;
168   shifter.bitplane++;
169161   
170   if (shifter.bitplane == 4)
162   if (de)
171163   {
172      if (de)
164      shifter.ir[shifter.bitplane] = (RAM[0] << 8) | RAM[1];
165      shifter.ofs += 2;
166      shifter.bitplane++;
167       
168      if (shifter.bitplane == 4)
173169      {
170         shifter.bitplane = 0;
171         
174172         shifter.rr[0] = shifter.ir[0];
175173         shifter.rr[1] = shifter.ir[1];
176174         shifter.rr[2] = shifter.ir[2];
r803r804
178176 
179177         shifter.ir[0] = shifter.ir[1] = shifter.ir[2] = shifter.ir[3] = 0;
180178      }
181 
182      shifter.bitplane = 0;
183179   }
184 
185   shifter.hcount++;
186180}
187181 
188182READ16_HANDLER( atarist_shifter_r )
r803r804
195189      return (shifter.base >> 8) & 0xff;
196190 
197191   case 0x04:
198      return (shifter.counter >> 16) & 0xff;
192      return (shifter.ofs >> 16) & 0xff;
199193   case 0x06:
200      return (shifter.counter >> 8) & 0xff;
194      return (shifter.ofs >> 8) & 0xff;
201195   case 0x08:
202      return shifter.counter & 0xff;
196      return shifter.ofs & 0xff;
203197 
204198   case 0x0a:
205199      return shifter.sync;
r803r804
262256      return shifter.base & 0xfe;
263257 
264258   case 0x04:
265      return (shifter.counter >> 16) & 0x3f;
259      return (shifter.ofs >> 16) & 0x3f;
266260   case 0x06:
267      return (shifter.counter >> 8) & 0xff;
261      return (shifter.ofs >> 8) & 0xff;
268262   case 0x08:
269      return shifter.counter & 0xfe;
263      return shifter.ofs & 0xfe;
270264 
271265   case 0x0a:
272266      return shifter.sync << 8;
r803r804
303297      break;
304298 
305299   case 0x04:
306      shifter.counter = (shifter.counter & 0x00ffff) | (data & 0x3f) << 16;
300      shifter.ofs = (shifter.ofs & 0x00ffff) | (data & 0x3f) << 16;
307301      break;
308302   case 0x06:
309      shifter.counter = (shifter.counter & 0xff00ff) | (data & 0xff) << 8;
303      shifter.ofs = (shifter.ofs & 0xff00ff) | (data & 0xff) << 8;
310304      break;
311305   case 0x08:
312      shifter.counter = (shifter.counter & 0xffff00) | (data & 0xfe);
306      shifter.ofs = (shifter.ofs & 0xffff00) | (data & 0xfe);
313307      break;
314308 
315309   case 0x0a:
r803r804
341335 
342336VIDEO_START( atarist )
343337{
344   atarist_glue_timer = mame_timer_alloc(atarist_glue_tick);
345338   atarist_shifter_timer = mame_timer_alloc(atarist_shifter_tick);
339   atarist_glue_timer = mame_timer_alloc(atarist_glue_tick);
346340 
347   mame_timer_adjust(atarist_glue_timer, time_zero, 0, MAME_TIME_IN_NSEC(500));
348   mame_timer_adjust(atarist_shifter_timer, time_zero, 0, MAME_TIME_IN_NSEC(125));
341   mame_timer_adjust(atarist_glue_timer, video_screen_get_time_until_pos(0,0,0), 0, MAME_TIME_IN_HZ(Y2/16)); // 500 ns
342   mame_timer_adjust(atarist_shifter_timer, video_screen_get_time_until_pos(0,0,0), 0, MAME_TIME_IN_HZ(Y2/4)); // 125 ns
349343 
350344   atarist_bitmap = auto_bitmap_alloc(Machine->screen[0].width, Machine->screen[0].height, Machine->screen[0].format);
351345 
src/mess/video/atarist.h
r803r804
11#ifndef _VIDEO_ATARIST_H_
22#define _VIDEO_ATARIST_H_
33 
4#define Y2      32084988.0
5#define Y2_NTSC   32042400.0
6 
47#define ATARIST_HBSTART_PAL      512
58#define ATARIST_HBEND_PAL      0
69#define ATARIST_HBSTART_NTSC   508
src/mess/machine/68901mfp.c
r803r804
106106{
107107   mfp_68901 *mfp_p = &mfp[which];
108108 
109   logerror("MFP68901 read register %u\n", reg);
110 
111109   switch (reg)
112110   {
113111   case MFP68901_REGISTER_GPIP:
114112      {
115      UINT8 gpio = 0;
113      UINT8 gpio = 0x80;
116114 
117115      if (mfp_p->gpio_r)
118116      {
119         gpio = mfp_p->gpio_r(0);
117         //gpio = (*mfp_p->gpio_r)(0);
120118      }
121119 
122120      gpio |= (mfp_p->gpip & mfp_p->ddr);
src/mess/drivers/atarist.c
r803r804
2020   TODO:
2121
2222   - US keyboard layout
23   - HD6310 cpu core
23   - add serial communications to HD63710 cpu core
2424   - connect keyboard ports to ikbd
2525   - connect mouse to ikbd
26   - connect ikbd to ACIA #0
2726   - floppy image device_load
2827   - MFP interrupts
2928   - accurate screen timing
r803r804
3635*/
3736
3837#define Y1      2457600.0
39#define Y2      32084988.0
40#define Y2_NTSC   32042400.0
4138
4239/* WD1772 FDC */
4340
r803r804
318315/* Memory Maps */
319316
320317static ADDRESS_MAP_START(keyboard_map, ADDRESS_SPACE_PROGRAM, 8)
321   AM_RANGE(0x0000, 0x001f) AM_RAM
318   AM_RANGE(0x0000, 0x001f) AM_READWRITE(hd63701_internal_registers_r, hd63701_internal_registers_w)
322319   AM_RANGE(0x0080, 0x00ff) AM_RAM
323320   AM_RANGE(0xf000, 0xffff) AM_ROM
324321ADDRESS_MAP_END
325322
326323static ADDRESS_MAP_START(keyboard_io_map, ADDRESS_SPACE_IO, 8)
327/*   AM_RANGE(HD63701_PORT1, HD63701_PORT1) AM_WRITE(hd6301_port1_w)
324   AM_RANGE(HD63701_PORT1, HD63701_PORT1) AM_WRITE(hd6301_port1_w)
328325   AM_RANGE(HD63701_PORT2, HD63701_PORT2) AM_READWRITE(hd6301_port2_r, hd6301_port2_w)
329326   AM_RANGE(HD63701_PORT3, HD63701_PORT3) AM_READ(hd6301_port_3_r)
330   AM_RANGE(HD63701_PORT4, HD63701_PORT4) AM_READ(hd6301_port_4_r)*/
327   AM_RANGE(HD63701_PORT4, HD63701_PORT4) AM_READ(hd6301_port_4_r)
331328ADDRESS_MAP_END
332329
333330static ADDRESS_MAP_START(st_map, ADDRESS_SPACE_PROGRAM, 16)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team