Previous 15994 Revisions Next

r5012 Saturday 13th June, 2009 at 13:18:30 UTC by Robbbert
[CAMPUTER] Colour is working.
[src/mess/drivers]camplynx.c

src/mess/drivers/camplynx.c
r5011r5012
6262
6363   The work so far is without the benefit of manuals, schematic etc [Robbbert]
6464
65   Sound is working. The cassette save also uses the sound dac, but the
66   output should be redirected to the cassette. This isn't done yet.
65   Cassette operation is strange indeed. Save takes the dac output and directs
66   it to the tape. Load takes over line 0 of the keyboard and uses bits 0 and 5.
6767
6868   To Do:
6969   128k, 96k: everything
r5011r5012
8484
8585static const device_config *mc6845;
8686
87static WRITE8_HANDLER( camplynx_bank_w )
88{
89/* This is very incomplete, just enough to get the computer working.
90   Also, as it happens twice for every scanline of every character,
91   it causes a huge slowdown. */
92
93   if (!data)
94      memory_set_bank(space->machine, 1, 0);
95   else
96   if (data & 2)
97      memory_set_bank(space->machine, 1, 1);
98   else
99   if (data & 4)
100      memory_set_bank(space->machine, 1, 2);
101   else
102      logerror("cannot understand bankswitch command %X\n",data);
103}
104
105
87106static ADDRESS_MAP_START( camplynx_mem, ADDRESS_SPACE_PROGRAM, 8)
88107   ADDRESS_MAP_UNMAP_HIGH
89108   AM_RANGE(0x0000,0x5fff) AM_ROM
90   AM_RANGE(0x6000,0xffff) AM_RAM
91   AM_RANGE(0x8000,0x9fff) AM_BASE(&videoram)
109   AM_RANGE(0x6000,0x7fff) AM_RAM
110   AM_RANGE(0x8000,0xffff) AM_RAMBANK(1)
92111ADDRESS_MAP_END
93112
94113static ADDRESS_MAP_START( camp96_mem, ADDRESS_SPACE_PROGRAM, 8)
95114   ADDRESS_MAP_UNMAP_HIGH
96115   AM_RANGE(0x0000,0x5fff) AM_ROM
97116   AM_RANGE(0x6000,0xdfff) AM_RAM
98   AM_RANGE(0xe000,0xffff) AM_ROM
99   AM_RANGE(0x8000,0x9fff) AM_BASE(&videoram)
117   AM_RANGE(0x6000,0x7fff) AM_RAM
118   AM_RANGE(0x8000,0xffff) AM_RAMBANK(1)
119//   AM_RANGE(0xe000,0xffff) AM_ROM
120//   AM_RANGE(0x8000,0x9fff) AM_BASE(&videoram)
100121ADDRESS_MAP_END
101122
102123static ADDRESS_MAP_START( camplynx_io , ADDRESS_SPACE_IO, 8)
103124   ADDRESS_MAP_UNMAP_HIGH
104   AM_RANGE(0x007f,0x007f) AM_MIRROR(0xff00) AM_WRITE(SMH_NOP)   /* these 2 seem to be */
105   AM_RANGE(0x0080,0x0080) AM_MIRROR(0xff00) AM_WRITE(SMH_NOP)   /* for bankswitching */
125   AM_RANGE(0x007f,0x007f) AM_MIRROR(0xff00) AM_WRITE(camplynx_bank_w)
126   AM_RANGE(0x0080,0x0080) AM_MIRROR(0xff00) AM_WRITE(SMH_NOP)      /* to be emulated */
106127   AM_RANGE(0x0080,0x0080) AM_READ_PORT("LINE0")
107128   AM_RANGE(0x0180,0x0180) AM_READ_PORT("LINE1")
108129   AM_RANGE(0x0280,0x0280) AM_READ_PORT("LINE2")
r5011r5012
203224{
204225}
205226
227static const UINT8 camplynx_palette[16*3] =
228{
229   0x00, 0x00, 0x00,   /*  0 Black      */
230   0x00, 0x00, 0xff,   /*  1 Blue      */
231   0xff, 0x00, 0x00,   /*  2 Red      */
232   0xff, 0x00, 0xff,   /*  3 Magenta      */
233   0x00, 0xff, 0x00,   /*  4 Green      */
234   0x00, 0xff, 0xff,   /*  5 Cyan      */
235   0xff, 0xff, 0x00,   /*  6 Yellow      */
236   0xff, 0xff, 0xff,   /*  7 White      */
237};
238
239static PALETTE_INIT( camplynx )
240{
241   UINT8 r, b, g, i=0, color_count = 8;
242
243   while (color_count--)
244   {
245      r = camplynx_palette[i++]; g = camplynx_palette[i++]; b = camplynx_palette[i++];
246      palette_set_color(machine, 7-color_count, MAKE_RGB(r, g, b));
247   }
248}
249
206250static MC6845_UPDATE_ROW( camplynx_update_row )
207251{
208   UINT8 gfx,fg=1,bg=0;
209
252   UINT8 *RAM = memory_region(device->machine, "maincpu");
253   UINT8 r,g,b;
210254   UINT16 x, *p = BITMAP_ADDR16(bitmap, y, 0);
211255
212256   for (x = (y << 5); x < x_count + (y << 5); x++)
213257   {
214      gfx = videoram[x];
215         if (x == cursor_x) gfx^=0xff;   // not used - cursor is generated in software
258      r = RAM[0x14000|x];
259      g = RAM[0x1c000|x];
260      b = RAM[0x10000|x];
216261
217         *p = ( gfx & 0x80 ) ? fg : bg; p++;
218         *p = ( gfx & 0x40 ) ? fg : bg; p++;
219         *p = ( gfx & 0x20 ) ? fg : bg; p++;
220         *p = ( gfx & 0x10 ) ? fg : bg; p++;
221         *p = ( gfx & 0x08 ) ? fg : bg; p++;
222         *p = ( gfx & 0x04 ) ? fg : bg; p++;
223         *p = ( gfx & 0x02 ) ? fg : bg; p++;
224         *p = ( gfx & 0x01 ) ? fg : bg; p++;
262      *p = ((r & 0x80) ? 2 : 0) | ((g & 0x80) ? 4 : 0) | ((b & 0x80) ? 1 : 0); p++;
263      *p = ((r & 0x40) ? 2 : 0) | ((g & 0x40) ? 4 : 0) | ((b & 0x40) ? 1 : 0); p++;
264      *p = ((r & 0x20) ? 2 : 0) | ((g & 0x20) ? 4 : 0) | ((b & 0x20) ? 1 : 0); p++;
265      *p = ((r & 0x10) ? 2 : 0) | ((g & 0x10) ? 4 : 0) | ((b & 0x10) ? 1 : 0); p++;
266      *p = ((r & 0x08) ? 2 : 0) | ((g & 0x08) ? 4 : 0) | ((b & 0x08) ? 1 : 0); p++;
267      *p = ((r & 0x04) ? 2 : 0) | ((g & 0x04) ? 4 : 0) | ((b & 0x04) ? 1 : 0); p++;
268      *p = ((r & 0x02) ? 2 : 0) | ((g & 0x02) ? 4 : 0) | ((b & 0x02) ? 1 : 0); p++;
269      *p = ((r & 0x01) ? 2 : 0) | ((g & 0x01) ? 4 : 0) | ((b & 0x01) ? 1 : 0); p++;
225270   }
226271}
227272
r5011r5012
266311   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
267312   MDRV_SCREEN_SIZE(512, 480)
268313   MDRV_SCREEN_VISIBLE_AREA(0, 511, 0, 479)
269   MDRV_PALETTE_LENGTH(2)
270   MDRV_PALETTE_INIT(black_and_white)
314   MDRV_PALETTE_LENGTH(8)
315   MDRV_PALETTE_INIT(camplynx)
271316
272317   MDRV_MC6845_ADD("crtc", MC6845, XTAL_12MHz / 8 /*? dot clock divided by dots per char */, camplynx_crtc6845_interface)
273318
r5011r5012
287332   MDRV_CPU_PROGRAM_MAP(camp96_mem)
288333MACHINE_DRIVER_END
289334
335static DRIVER_INIT( camplynx )
336{
337   UINT8 *RAM = memory_region(machine, "maincpu");
338   memory_configure_bank(machine, 1, 0, 3, &RAM[0x8000],  0x8000);
339}
340
290341/* ROM definition */
291342ROM_START( camplynx )
292   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
343   ROM_REGION( 0x30000, "maincpu", ROMREGION_ERASEFF )
293344   ROM_LOAD( "lynx48-1.rom", 0x0000, 0x2000, CRC(56feec44) SHA1(7ded5184561168e159a30fa8e9d3fde5e52aa91a) )
294345   ROM_LOAD( "lynx48-2.rom", 0x2000, 0x2000, CRC(d894562e) SHA1(c08a78ecb4eb05baa4c52488fce3648cd2688744) )
295   ROM_FILL(0x8cf,1,0xc9)   // cheap rotten hack
296346ROM_END
297347
298348ROM_START( camply96 )
299   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
349   ROM_REGION( 0x30000, "maincpu", ROMREGION_ERASEFF )
300350   ROM_LOAD( "lynx96-1.rom", 0x0000, 0x2000, CRC(56feec44) SHA1(7ded5184561168e159a30fa8e9d3fde5e52aa91a) )
301351   ROM_LOAD( "lynx96-2.rom", 0x2000, 0x2000, CRC(d894562e) SHA1(c08a78ecb4eb05baa4c52488fce3648cd2688744) )
302352   ROM_LOAD( "lynx96-3.rom", 0x4000, 0x2000, CRC(21f11709) SHA1(f86a729b01de286197c550974f7825c12815a4f4) )
303353   ROM_LOAD( "dosrom.rom", 0xe000, 0x2000, CRC(011e106a) SHA1(e77f0ca99790551a7122945f3194516b2390fb69) )
304   ROM_FILL(0x8cf,1,0xc9)   // cheap rotten hack
305354ROM_END
306355
307356ROM_START( camply128 )
r5011r5012
328377
329378/* Driver */
330379/*    YEAR  NAME       PARENT     COMPAT   MACHINE    INPUT     INIT  CONFIG    COMPANY       FULLNAME     FLAGS */
331COMP( 1983, camplynx,  0,         0,       camplynx,  camplynx, 0,    camp48,   "Camputers",  "Lynx 48",   GAME_NOT_WORKING)
332COMP( 1983, camply96,  camplynx,  0,       camp96,    camplynx, 0,    camp96,   "Camputers",  "Lynx 96",   GAME_NOT_WORKING)
380COMP( 1983, camplynx,  0,         0,       camplynx,  camplynx, camplynx,    camp48,   "Camputers",  "Lynx 48",   GAME_NOT_WORKING)
381COMP( 1983, camply96,  camplynx,  0,       camp96,    camplynx, camplynx,    camp96,   "Camputers",  "Lynx 96",   GAME_NOT_WORKING)
333382COMP( 1983, camply128, camplynx,  0,       camp96,    camplynx, 0,    camp128,  "Camputers",  "Lynx 128",  GAME_NOT_WORKING)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team