Previous 15994 Revisions Next

r15380 Saturday 2nd June, 2012 at 03:21:29 UTC by R. Belmont
Apple II: Make Brazilian quasi-clone TK2000 show something. [R. Belmont]
[src/mess/drivers]apple2.c
[src/mess/includes]apple2.h
[src/mess/machine]apple2.c
[src/mess/video]apple2.c

src/mess/machine/apple2.c
r15379r15380
825825   meminfo->write_handler = &wd;
826826}
827827
828static void tk2000_mem_C100(running_machine &machine, offs_t begin, offs_t end, apple2_meminfo *meminfo)
829{
830   apple2_state *state = machine.driver_data<apple2_state>();
831
832    if (state->m_flags & VAR_TK2000RAM)
833    {
834        meminfo->read_mem = 0x00C100;
835        meminfo->write_mem = 0x00C100;
836    }
837    else
838    {
839        meminfo->read_mem = (begin & 0x3fff) | APPLE2_MEM_ROM;
840        meminfo->write_mem = 0x00C100;
841    }
842}
843
828844static void apple2_mem_CFFF(running_machine &machine, offs_t begin, offs_t end, apple2_meminfo *meminfo)
829845{
830846   apple2_state *state = machine.driver_data<apple2_state>();
r15379r15380
10091025};
10101026
10111027
1028static const apple2_memmap_entry tk2000_memmap_entries[] =
1029{
1030   { 0x0000, 0x01FF, apple2_mem_0000, A2MEM_MONO },
1031   { 0x0200, 0x03FF, apple2_mem_0200, A2MEM_DUAL },
1032   { 0x0400, 0x07FF, apple2_mem_0400, A2MEM_DUAL },
1033   { 0x0800, 0x1FFF, apple2_mem_0800, A2MEM_DUAL },
1034   { 0x2000, 0x3FFF, apple2_mem_2000, A2MEM_DUAL },
1035   { 0x4000, 0xBFFF, apple2_mem_4000, A2MEM_DUAL },
1036   { 0xC000, 0xC07F, apple2_mem_C000, A2MEM_IO },
1037   { 0xC080, 0xC0FF, apple2_mem_C080, A2MEM_IO },
1038   { 0xC100, 0xFFFF, tk2000_mem_C100, A2MEM_DUAL },
1039   { 0 }
1040};
10121041
10131042void apple2_setvar(running_machine &machine, UINT32 val, UINT32 mask)
10141043{
r15379r15380
14561485   {
14571486      UINT32 mask;
14581487
1488        if (m_machinetype == TK2000)
1489        {
1490            if (offset == 0xa)  // RAM
1491            {
1492                apple2_setvar(space.machine(), VAR_TK2000RAM, ~0);
1493                printf("TK2000: RAM (PC %x)\n", cpu_get_pc(m_maincpu));
1494            }
1495            else if (offset == 0xb) // ROM
1496            {
1497                apple2_setvar(space.machine(), 0, ~VAR_TK2000RAM);
1498                printf("TK2000: ROM (PC %x)\n", cpu_get_pc(m_maincpu));
1499            }
1500        }
1501
14591502      /* ANx has reverse SET logic */
14601503      if (offset >= 8)
14611504      {
r15379r15380
17941837   if (!strcmp(machine.system().name, "apple2cp"))
17951838      apple2cp_ce00_ram = auto_alloc_array(machine, UINT8, 0x200);
17961839
1840    state->m_machinetype = APPLE_IIEPLUS;
1841
17971842   apple2_init_common(machine);
17981843
17991844   /* setup memory */
r15379r15380
18161861    // II and II+ have no internal ROM or internal slot 3 h/w, so don't allow these states
18171862    state->m_flags_mask = VAR_INTCXROM|VAR_SLOTC3ROM;
18181863
1864    state->m_machinetype = APPLE_II;
1865
18191866   apple2_init_common(machine);
18201867
18211868   /* setup memory */
r15379r15380
18291876   apple2_reset(machine);
18301877}
18311878
1879MACHINE_START( tk2000 )
1880{
1881   apple2_memmap_config mem_cfg;
1882   apple2_state *state = machine.driver_data<apple2_state>();
18321883
1884    // II and II+ have no internal ROM or internal slot 3 h/w, so don't allow these states
1885    state->m_flags_mask = VAR_INTCXROM|VAR_SLOTC3ROM;
1886
1887    state->m_machinetype = TK2000;
1888
1889   apple2_init_common(machine);
1890
1891   /* setup memory */
1892   memset(&mem_cfg, 0, sizeof(mem_cfg));
1893   mem_cfg.first_bank = 1;
1894   mem_cfg.memmap = tk2000_memmap_entries;
1895   mem_cfg.auxmem = (UINT8*)NULL;
1896   apple2_setup_memory(machine, &mem_cfg);
1897
1898   /* perform initial reset */
1899   apple2_reset(machine);
1900}
1901
18331902int apple2_pressed_specialkey(running_machine &machine, UINT8 key)
18341903{
18351904   return (machine.root_device().ioport("keyb_special")->read() & key)
src/mess/includes/apple2.h
r15379r15380
4040#define VAR_LCRAM2      0x020000
4141#define VAR_LCWRITE      0x040000
4242#define VAR_ROMSWITCH   0x080000
43#define VAR_TK2000RAM   0x100000        // ROM/RAM switch for TK2000
4344
4445#define VAR_DHIRES      VAR_AN3
4546
r15379r15380
7374
7475typedef enum
7576{
77    APPLE_II,           // Apple II/II+
78    APPLE_IIEPLUS,      // Apple IIe/IIc/IIgs/IIc+
79    TK2000              // Microdigital TK2000
80} machine_type_t;
81
82typedef enum
83{
7684   A2MEM_IO      = 0,   /* this is always handlers; never banked memory */
7785   A2MEM_MONO      = 1,   /* this is a bank where read and write are always in unison */
7886   A2MEM_DUAL      = 2      /* this is a bank where read and write can go different places */
r15379r15380
157165
158166    UINT8 *m_rambase;
159167
168    machine_type_t m_machinetype;
169
160170    READ8_MEMBER(apple2_c0xx_r);
161171    WRITE8_MEMBER(apple2_c0xx_w);
162172    READ8_MEMBER(apple2_c080_r);
r15379r15380
222232void apple2_init_common(running_machine &machine);
223233MACHINE_START( apple2 );
224234MACHINE_START( apple2orig );
235MACHINE_START( tk2000 );
225236UINT8 apple2_getfloatingbusvalue(running_machine &machine);
226237READ8_HANDLER( apple2_c0xx_r );
227238WRITE8_HANDLER( apple2_c0xx_w );
src/mess/video/apple2.c
r15379r15380
239239   if (endrow < beginrow)
240240      return;
241241
242   vram      = state->m_a2_videoram + (page ? 0x4000 : 0x2000);
242    if (state->m_machinetype == TK2000)
243    {
244        vram      = state->m_a2_videoram + (page ? 0xa000 : 0x2000);
245    }
246    else
247    {
248        vram      = state->m_a2_videoram + (page ? 0x4000 : 0x2000);
249    }
243250   columns      = ((effective_a2(state) & (VAR_DHIRES|VAR_80COL)) == (VAR_DHIRES|VAR_80COL)) ? 80 : 40;
244251
245252   vram_row[0] = 0;
r15379r15380
476483   /* choose the video mode to draw */
477484   if (effective_a2(state) & VAR_TEXT)
478485   {
479      /* text screen */
480      apple2_text_draw(machine, bitmap, cliprect, page, 0, 191);
486      /* text screen - TK2000 uses HGR for text */
487        if (state->m_machinetype == TK2000)
488        {
489            apple2_hires_draw(machine, bitmap, cliprect, page, 0, 191);
490        }
491        else
492        {
493            apple2_text_draw(machine, bitmap, cliprect, page, 0, 191);
494        }
481495   }
482496   else if ((effective_a2(state) & VAR_HIRES) && (effective_a2(state) & VAR_MIXED))
483497   {
src/mess/drivers/apple2.c
r15379r15380
728728MACHINE_CONFIG_END
729729
730730static MACHINE_CONFIG_DERIVED( tk2000, apple2_common )
731   MCFG_MACHINE_START(tk2000)
731732    MCFG_VIDEO_START(apple2e)
732733   /* internal ram */
733734   MCFG_RAM_ADD(RAM_TAG)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team