Previous 15994 Revisions Next

r5024 Monday 15th June, 2009 at 10:43:49 UTC by Robbbert
[CAMPUTER] Lynx128 screen is working.
[src/mess/drivers]camplynx.c

src/mess/drivers/camplynx.c
r5023r5024
6262
6363   The work so far is without the benefit of manuals, schematic etc [Robbbert]
6464
65   48k, 96k:
6566   Cassette operation is strange indeed. Save takes the dac output and directs
6667   it to the tape. Load takes over line 0 of the keyboard and uses bits 0 and 5.
6768
6869   To Do:
69   128k, 96k: everything
70
71   48k:
7270   - find Break key
73   - colour
74   - banking
71   - banking (it is incomplete atm)
7572   - devices (cassette, disk)
7673   - find out the mc6845 clock frequency
74   - check out the roms (48k, 96k), they could be wrong
7775
7876****************************************************************************/
7977
r5023r5024
8482
8583static const device_config *mc6845;
8684
85/* These bankswitch handlers are very incomplete, just enough to get the
86   computer working. Also, as it happens 6 times for every scanline
87   of every character, it causes a huge slowdown. */
88
8789static WRITE8_HANDLER( camplynx_bank_w )
8890{
89/* This is very incomplete, just enough to get the computer working.
90   Also, as it happens 6 times for every scanline of every character,
91   it causes a huge slowdown. */
92
9391   if (!data)
9492      memory_set_bank(space->machine, 1, 0);
9593   else
r5023r5024
9997   if (data & 4)
10098      memory_set_bank(space->machine, 1, 2);
10199   else
102      logerror("cannot understand bankswitch command %X\n",data);
100      logerror("%04X: Cannot understand bankswitch command %X\n",cpu_get_pc(space->cpu), data);
103101}
104102
105103static WRITE8_HANDLER( lynx128_bank_w )
r5023r5024
127125      memory_set_bankptr(mem->machine, 18, memory_region(mem->machine, "maincpu") + 0x1e000);
128126   }
129127   else
130   if (data == 0xc0)
128   if ((data == 0xc0) || (data == 0xe0))
131129   {
132130      memory_set_bankptr(mem->machine, 1, memory_region(mem->machine, "maincpu") + 0x00000);
133131      memory_set_bankptr(mem->machine, 2, memory_region(mem->machine, "maincpu") + 0x02000);
r5023r5024
147145      memory_set_bankptr(mem->machine, 18, memory_region(mem->machine, "maincpu") + 0x2e000);
148146   }
149147   else
150   if (data == 0xe0)
148   if ((data == 0xce) || (data == 0xee))
151149   {
152      memory_set_bankptr(mem->machine, 1, memory_region(mem->machine, "maincpu") + 0x00000);
153      memory_set_bankptr(mem->machine, 2, memory_region(mem->machine, "maincpu") + 0x02000);
154      memory_set_bankptr(mem->machine, 3, memory_region(mem->machine, "maincpu") + 0x04000);
155      memory_set_bankptr(mem->machine, 4, memory_region(mem->machine, "maincpu") + 0x16000);
156      memory_set_bankptr(mem->machine, 5, memory_region(mem->machine, "maincpu") + 0x18000);
157      memory_set_bankptr(mem->machine, 6, memory_region(mem->machine, "maincpu") + 0x1a000);
158      memory_set_bankptr(mem->machine, 7, memory_region(mem->machine, "maincpu") + 0x0c000);
159      memory_set_bankptr(mem->machine, 8, memory_region(mem->machine, "maincpu") + 0x0e000);
150      memory_set_bankptr(mem->machine, 1, memory_region(mem->machine, "maincpu") + 0x20000);
151      memory_set_bankptr(mem->machine, 2, memory_region(mem->machine, "maincpu") + 0x22000);
152      memory_set_bankptr(mem->machine, 3, memory_region(mem->machine, "maincpu") + 0x24000);
153      memory_set_bankptr(mem->machine, 4, memory_region(mem->machine, "maincpu") + 0x26000);
154      memory_set_bankptr(mem->machine, 5, memory_region(mem->machine, "maincpu") + 0x28000);
155      memory_set_bankptr(mem->machine, 6, memory_region(mem->machine, "maincpu") + 0x2a000);
156      memory_set_bankptr(mem->machine, 7, memory_region(mem->machine, "maincpu") + 0x2c000);
157      memory_set_bankptr(mem->machine, 8, memory_region(mem->machine, "maincpu") + 0x2e000);
160158      memory_set_bankptr(mem->machine, 11, memory_region(mem->machine, "maincpu") + 0x20000);
161159      memory_set_bankptr(mem->machine, 12, memory_region(mem->machine, "maincpu") + 0x22000);
162160      memory_set_bankptr(mem->machine, 13, memory_region(mem->machine, "maincpu") + 0x24000);
r5023r5024
167165      memory_set_bankptr(mem->machine, 18, memory_region(mem->machine, "maincpu") + 0x2e000);
168166   }
169167   else
170      logerror("cannot understand bankswitch command %X\n",data);
168      logerror("%04X: Cannot understand bankswitch command %X\n",cpu_get_pc(space->cpu), data);
171169}
172170
173171static ADDRESS_MAP_START( camplynx_mem, ADDRESS_SPACE_PROGRAM, 8)
r5023r5024
185183ADDRESS_MAP_END
186184
187185static ADDRESS_MAP_START( lynx128_mem, ADDRESS_SPACE_PROGRAM, 8)
188   AM_RANGE(0x0000,0x1fff) AM_RAMBANK(1)
189   AM_RANGE(0x2000,0x3fff) AM_RAMBANK(2)
190   AM_RANGE(0x4000,0x5fff) AM_RAMBANK(3)
191   AM_RANGE(0x6000,0x7fff) AM_RAMBANK(4)
192   AM_RANGE(0x8000,0x9fff) AM_RAMBANK(5)
193   AM_RANGE(0xa000,0xbfff) AM_RAMBANK(6)
194   AM_RANGE(0xc000,0xdfff) AM_RAMBANK(7)
195   AM_RANGE(0xe000,0xffff) AM_RAMBANK(8)
196186ADDRESS_MAP_END
197187
198188static ADDRESS_MAP_START( camplynx_io , ADDRESS_SPACE_IO, 8)
r5023r5024
393383   UINT8 r,g,b;
394384   UINT16 x, *p = BITMAP_ADDR16(bitmap, y, 0);
395385
396   for (x = (y << 5); x < x_count + (y << 5); x++)
386   for (x = (y << 6); x < x_count + (y << 6); x++)
397387   {
398388      r = RAM[0x20100+x];
399389      g = RAM[0x28100+x];
r5023r5024
436426};
437427
438428static const mc6845_interface lynx128_crtc6845_interface = {
439   "screen",
440   8,
429   "screen",         /* screen name */
430   8,            /* dots per character */
441431   NULL,
442   lynx128_update_row,
432   lynx128_update_row,      /* callback to display one scanline */
443433   NULL,
444434   DEVCB_NULL,
445435   DEVCB_NULL,
446   DEVCB_HANDLER(lynx128_irq),
436   DEVCB_HANDLER(lynx128_irq),   /* callback when cursor pin changes state */
447437   DEVCB_NULL,
448438   NULL
449439};

Previous 15994 Revisions Next


© 1998-2018 The MESS Team