Previous 15994 Revisions Next

r3679 Thursday 27th November, 2008 at 20:08:39 UTC by Wilbert Pol
Re-enable veb.a
[src/mess]mess.mak
[src/mess/drivers]kc.c
[src/mess/machine]kc.c

src/mess/machine/kc.c
r3678r3679
204204WRITE8_HANDLER(kc85_disc_hw_terminal_count_w)
205205{
206206   logerror("kc85 disc hw tc w: %02x\n",data);
207   nec765_set_tc_state(machine, data & 0x01);
207   nec765_set_tc_state(space->machine, data & 0x01);
208208}
209209
210210
r3678r3679
232232
233233static TIMER_CALLBACK(kc85_disk_reset_timer_callback)
234234{
235   cpunum_set_reg(1, REG_PC, 0x0f000);
235   cpu_set_reg(machine->cpu[1], REG_PC, 0x0f000);
236236   cpu_set_reg(machine->cpu[0], REG_PC, 0x0f000);
237237}
238238
r3678r3679
11311131
11321132static void kc85_4_update_0x08000(running_machine *machine)
11331133{
1134   const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
11341135   unsigned char *ram_page;
11351136
11361137    if (kc85_pio_data[1] & (1<<5))
r3678r3679
11451146
11461147      memory_set_bankptr(machine, 3, mem_ptr);
11471148      memory_set_bankptr(machine, 4, mem_ptr+0x02800);
1148      memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_BANK3);
1149      memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_BANK4);
1149      memory_install_read8_handler(space, 0x8000, 0xa7ff, 0, 0, SMH_BANK3);
1150      memory_install_read8_handler(space, 0xa800, 0xbfff, 0, 0, SMH_BANK4);
11501151
11511152      /* write protect RAM8 ? */
11521153      if ((kc85_pio_data[1] & (1<<6))==0)
11531154      {
11541155         /* ram8 is enabled and write protected */
1155         memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_NOP);
1156         memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_NOP);
1156         memory_install_write8_handler(space, 0x8000, 0xa7ff, 0, 0, SMH_NOP);
1157         memory_install_write8_handler(space, 0xa800, 0xbfff, 0, 0, SMH_NOP);
11571158      }
11581159      else
11591160      {
11601161         LOG(("RAM8 write enabled\n"));
11611162
11621163         /* ram8 is enabled and write enabled */
1163         memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_BANK9);
1164         memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_BANK10);
1164         memory_install_write8_handler(space, 0x8000, 0xa7ff, 0, 0, SMH_BANK9);
1165         memory_install_write8_handler(space, 0xa800, 0xbfff, 0, 0, SMH_BANK10);
11651166         memory_set_bankptr(machine, 9, mem_ptr);
11661167         memory_set_bankptr(machine, 10, mem_ptr+0x02800);
11671168      }
r3678r3679
11701171    {
11711172      LOG(("no memory at ram8\n"));
11721173
1173      memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_NOP);
1174      memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_NOP);
1175      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_NOP);
1176      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_NOP);
1174      memory_install_read8_handler(space, 0x8000, 0xa7ff, 0, 0, SMH_NOP);
1175      memory_install_read8_handler(space, 0xa800, 0xbfff, 0, 0, SMH_NOP);
1176      memory_install_write8_handler(space, 0x8000, 0xa7ff, 0, 0, SMH_NOP);
1177      memory_install_write8_handler(space, 0xa800, 0xbfff, 0, 0, SMH_NOP);
11771178    }
11781179
11791180   /* if IRM is enabled override block 3/9 settings */
r3678r3679
11841185
11851186      memory_set_bankptr(machine, 3, ram_page);
11861187      memory_set_bankptr(machine, 9, ram_page);
1187      memory_install_read8_handler(machine, 0,  ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_BANK3);
1188      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xa7ff, 0, 0, SMH_BANK9);
1188      memory_install_read8_handler(space, 0x8000, 0xa7ff, 0, 0, SMH_BANK3);
1189      memory_install_write8_handler(space, 0x8000, 0xa7ff, 0, 0, SMH_BANK9);
11891190
11901191      ram_page = kc85_4_get_video_ram_base(0, 0);
11911192
1192      memory_set_bankptr( 4, ram_page + 0x2800);
1193      memory_set_bankptr(machine, 4, ram_page + 0x2800);
11931194      memory_set_bankptr(machine, 10, ram_page + 0x2800);
1194      memory_install_read8_handler(machine, 0,  ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_BANK4);
1195      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xbfff, 0, 0, SMH_BANK10);
1195      memory_install_read8_handler(space, 0xa800, 0xbfff, 0, 0, SMH_BANK4);
1196      memory_install_write8_handler(space, 0xa800, 0xbfff, 0, 0, SMH_BANK10);
11961197   }
11971198}
11981199
11991200/* update status of memory area 0x0000-0x03fff */
12001201static void kc85_4_update_0x00000(running_machine *machine)
12011202{
1203   const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
1204
12021205   /* access ram? */
12031206   if (kc85_pio_data[0] & (1<<1))
12041207   {
12051208      LOG(("ram0 enabled\n"));
12061209
12071210      /* yes; set address of bank */
1208      memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1);
1211      memory_install_read8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_BANK1);
12091212      memory_set_bankptr(machine, 1, mess_ram);
12101213
12111214      /* write protect ram? */
r3678r3679
12151218         LOG(("ram0 write protected\n"));
12161219
12171220         /* ram is enabled and write protected */
1218         memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
1221         memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
12191222      }
12201223      else
12211224      {
12221225         LOG(("ram0 write enabled\n"));
12231226
12241227         /* ram is enabled and write enabled; and set address of bank */
1225         memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK7);
1228         memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_BANK7);
12261229         memory_set_bankptr(machine, 7, mess_ram);
12271230      }
12281231   }
r3678r3679
12321235
12331236//      memory_set_bankptr(machine, 1,memory_region(machine, "main") + 0x013000);
12341237      /* ram is disabled */
1235      memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_NOP);
1236      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_NOP);
1238      memory_install_read8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_NOP);
1239      memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_NOP);
12371240   }
12381241}
12391242
12401243/* update status of memory area 0x4000-0x07fff */
12411244static void kc85_4_update_0x04000(running_machine *machine)
12421245{
1243   read8_machine_func rh;
1244   write8_machine_func wh;
1246   const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
1247   read8_space_func rh;
1248   write8_space_func wh;
12451249
12461250   /* access ram? */
12471251   if (kc85_86_data & (1<<0))
r3678r3679
12821286      rh = SMH_NOP;
12831287      wh = SMH_NOP;
12841288   }
1285   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, rh);
1286   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, wh);
1289   memory_install_read8_handler(space, 0x4000, 0x7fff, 0, 0, rh);
1290   memory_install_write8_handler(space, 0x4000, 0x7fff, 0, 0, wh);
12871291}
12881292
12891293
12901294/* update memory address 0x0c000-0x0e000 */
12911295static void kc85_4_update_0x0c000(running_machine *machine)
12921296{
1293   read8_machine_func rh;
1297   const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
1298   read8_space_func rh;
12941299
12951300   if (kc85_86_data & (1<<7))
12961301   {
r3678r3679
13251330         rh = SMH_NOP;
13261331      }
13271332   }
1328   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, rh);
1333   memory_install_read8_handler(space, 0xc000, 0xdfff, 0, 0, rh);
13291334}
13301335
13311336/* update memory address 0x0e000-0x0ffff */
13321337static void kc85_4_update_0x0e000(running_machine *machine)
13331338{
1334   read8_machine_func rh;
1339   const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
1340   read8_space_func rh;
13351341
13361342   if (kc85_pio_data[0] & (1<<0))
13371343   {
r3678r3679
13471353
13481354      rh = SMH_NOP;
13491355   }
1350   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, rh);
1356   memory_install_read8_handler(space, 0xe000, 0xffff, 0, 0, rh);
13511357}
13521358
13531359/* PIO PORT A: port 0x088:
r3678r3679
13821388
13831389      case 0:
13841390      {
1385         kc85_4_update_0x0c000(machine);
1386         kc85_4_update_0x0e000(machine);
1387         kc85_4_update_0x08000(machine);
1388         kc85_4_update_0x00000(machine);
1391         kc85_4_update_0x0c000(space->machine);
1392         kc85_4_update_0x0e000(space->machine);
1393         kc85_4_update_0x08000(space->machine);
1394         kc85_4_update_0x00000(space->machine);
13891395
1390         kc_cassette_set_motor(machine, (data>>6) & 0x01);
1396         kc_cassette_set_motor(space->machine, (data>>6) & 0x01);
13911397      }
13921398      break;
13931399
r3678r3679
13951401      {
13961402         int speaker_level;
13971403
1398         kc85_4_update_0x08000(machine);
1404         kc85_4_update_0x08000(space->machine);
13991405
14001406         /* 16 speaker levels */
14011407         speaker_level = (data>>1) & 0x0f;
r3678r3679
14151421
14161422   kc85_86_data = data;
14171423
1418   kc85_4_update_0x0c000(machine);
1419   kc85_4_update_0x04000(machine);
1424   kc85_4_update_0x0c000(space->machine);
1425   kc85_4_update_0x04000(space->machine);
14201426}
14211427
14221428 READ8_HANDLER ( kc85_4_86_r )
r3678r3679
14331439
14341440   kc85_4_video_ram_select_bank(data & 0x01);
14351441
1436   kc85_4_update_0x08000(machine);
1442   kc85_4_update_0x08000(space->machine);
14371443}
14381444
14391445 READ8_HANDLER ( kc85_4_84_r )
r3678r3679
14451451/* update memory region 0x0c000-0x0e000 */
14461452static void kc85_3_update_0x0c000(running_machine *machine)
14471453{
1448   read8_machine_func rh;
1454   const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
1455   read8_space_func rh;
14491456
14501457   if (kc85_pio_data[0] & (1<<7))
14511458   {
r3678r3679
14611468
14621469      rh = SMH_NOP;
14631470   }
1464   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xdfff, 0, 0, rh);
1471   memory_install_read8_handler(space, 0xc000, 0xdfff, 0, 0, rh);
14651472}
14661473
14671474/* update memory address 0x0e000-0x0ffff */
14681475static void kc85_3_update_0x0e000(running_machine *machine)
14691476{
1470   read8_machine_func rh;
1477   const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
1478   read8_space_func rh;
14711479
14721480   if (kc85_pio_data[0] & (1<<0))
14731481   {
r3678r3679
14831491
14841492      rh = SMH_NOP;
14851493   }
1486   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xffff, 0, 0, rh);
1494   memory_install_read8_handler(space, 0xe000, 0xffff, 0, 0, rh);
14871495}
14881496
14891497/* update status of memory area 0x0000-0x03fff */
r3678r3679
14911499for write operations */
14921500static void kc85_3_update_0x00000(running_machine *machine)
14931501{
1494   read8_machine_func rh;
1495   write8_machine_func wh;
1502   const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
1503   read8_space_func rh;
1504   write8_space_func wh;
14961505
14971506   /* access ram? */
14981507   if (kc85_pio_data[0] & (1<<1))
r3678r3679
15321541      wh = SMH_NOP;
15331542   }
15341543
1535   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, rh);
1536   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, wh);
1544   memory_install_read8_handler(space, 0x0000, 0x3fff, 0, 0, rh);
1545   memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, wh);
15371546}
15381547
15391548/* update status of memory area 0x08000-0x0ffff */
15401549/* SMH_BANK3 is used for read, SMH_BANK8 is used for write */
15411550static void kc85_3_update_0x08000(running_machine *machine)
15421551{
1543   read8_machine_func rh;
1544   write8_machine_func wh;
1552   const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
1553   read8_space_func rh;
1554   write8_space_func wh;
15451555    unsigned char *ram_page;
15461556
15471557    if (kc85_pio_data[0] & (1<<2))
r3678r3679
15871597      wh = SMH_NOP;
15881598    }
15891599
1590   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, rh);
1591   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, wh);
1600   memory_install_read8_handler(space, 0x8000, 0xbfff, 0, 0, rh);
1601   memory_install_write8_handler(space, 0x8000, 0xbfff, 0, 0, wh);
15921602}
15931603
15941604
r3678r3679
16241634
16251635      case 0:
16261636      {
1627         kc85_3_update_0x0c000(machine);
1628         kc85_3_update_0x0e000(machine);
1629         kc85_3_update_0x00000(machine);
1637         kc85_3_update_0x0c000(space->machine);
1638         kc85_3_update_0x0e000(space->machine);
1639         kc85_3_update_0x00000(space->machine);
16301640
1631         kc_cassette_set_motor(machine, (data>>6) & 0x01);
1641         kc_cassette_set_motor(space->machine, (data>>6) & 0x01);
16321642      }
16331643      break;
16341644
r3678r3679
16361646      {
16371647         int speaker_level;
16381648
1639         kc85_3_update_0x08000(machine);
1649         kc85_3_update_0x08000(space->machine);
16401650
16411651         /* 16 speaker levels */
16421652         speaker_level = (data>>1) & 0x0f;
src/mess/mess.mak
r3678r3679
458458   $(MESSOBJ)/tutor.a \
459459   $(MESSOBJ)/ut88.a \
460460   $(MESSOBJ)/vc4000.a \
461   $(MESSOBJ)/veb.a \
461462   $(MESSOBJ)/vector06.a \
462463   $(MESSOBJ)/votrax.a \
463464   $(MESSOBJ)/vtech.a \
r3678r3679
485486#   $(MESSOBJ)/teamconc.a \
486487#   $(MESSOBJ)/ti99.a \
487488#   $(MESSOBJ)/tx0.a \
488#   $(MESSOBJ)/veb.a \
489489
490490
491491
src/mess/drivers/kc.c
r3678r3679
3737   switch (port)
3838   {
3939//      case 0x080:
40//          return kc85_module_r(machine, offset);
40//          return kc85_module_r(space, offset);
4141
4242      case 0x085:
4343      case 0x084:
44         return kc85_4_84_r(machine, offset);
44         return kc85_4_84_r(space, offset);
4545
4646
4747      case 0x086:
4848      case 0x087:
49         return kc85_4_86_r(machine, offset);
49         return kc85_4_86_r(space, offset);
5050
5151      case 0x088:
5252      case 0x089:
53         return kc85_pio_data_r(machine, port-0x088);
53         return kc85_pio_data_r(space, port-0x088);
5454      case 0x08a:
5555      case 0x08b:
56         return kc85_pio_control_r(machine, port-0x08a);
56         return kc85_pio_control_r(space, port-0x08a);
5757      case 0x08c:
5858      case 0x08d:
5959      case 0x08e:
6060      case 0x08f:
61         return kc85_ctc_r(device_list_find_by_tag(machine->config->devicelist, Z80CTC, "z80ctc"), port-0x08c);
61         return kc85_ctc_r(device_list_find_by_tag(space->machine->config->devicelist, Z80CTC, "z80ctc"), port-0x08c);
6262
6363   }
6464
r3678r3679
7575   switch (port)
7676   {
7777//      case 0x080:
78//          kc85_module_w(machine, offset,data);
78//          kc85_module_w(space, offset,data);
7979//          return;
8080
8181      case 0x085:
8282      case 0x084:
83         kc85_4_84_w(machine, offset,data);
83         kc85_4_84_w(space, offset,data);
8484         return;
8585
8686      case 0x086:
8787      case 0x087:
88         kc85_4_86_w(machine, offset,data);
88         kc85_4_86_w(space, offset,data);
8989         return;
9090
9191      case 0x088:
9292      case 0x089:
93         kc85_4_pio_data_w(machine, port-0x088, data);
93         kc85_4_pio_data_w(space, port-0x088, data);
9494         return;
9595
9696      case 0x08a:
9797      case 0x08b:
98         kc85_pio_control_w(machine, port-0x08a, data);
98         kc85_pio_control_w(space, port-0x08a, data);
9999         return;
100100
101101      case 0x08c:
102102      case 0x08d:
103103      case 0x08e:
104104      case 0x08f:
105         kc85_ctc_w(device_list_find_by_tag(machine->config->devicelist, Z80CTC, "z80ctc"), port-0x08c, data);
105         kc85_ctc_w(device_list_find_by_tag(space->machine->config->devicelist, Z80CTC, "z80ctc"), port-0x08c, data);
106106         return;
107107   }
108108
r3678r3679
146146
147147      case 0x088:
148148      case 0x089:
149         return kc85_pio_data_r(machine, port-0x088);
149         return kc85_pio_data_r(space, port-0x088);
150150      case 0x08a:
151151      case 0x08b:
152         return kc85_pio_control_r(machine, port-0x08a);
152         return kc85_pio_control_r(space, port-0x08a);
153153      case 0x08c:
154154      case 0x08d:
155155      case 0x08e:
156156      case 0x08f:
157         return kc85_ctc_r(device_list_find_by_tag(machine->config->devicelist, Z80CTC, "z80ctc"), port-0x08c);
157         return kc85_ctc_r(device_list_find_by_tag(space->machine->config->devicelist, Z80CTC, "z80ctc"), port-0x08c);
158158   }
159159
160160   logerror("unhandled port r: %04x\n",offset);
r3678r3679
170170   switch (port)
171171   {
172172//      case 0x080:
173//          kc85_module_w(offset,data);
173//          kc85_module_w(space, offset,data);
174174//          return;
175175
176176      case 0x088:
177177      case 0x089:
178         kc85_3_pio_data_w(machine, port-0x088, data);
178         kc85_3_pio_data_w(space, port-0x088, data);
179179         return;
180180
181181      case 0x08a:
182182      case 0x08b:
183         kc85_pio_control_w(machine, port-0x08a, data);
183         kc85_pio_control_w(space, port-0x08a, data);
184184         return;
185185
186186      case 0x08c:
187187      case 0x08d:
188188      case 0x08e:
189189      case 0x08f:
190         kc85_ctc_w(device_list_find_by_tag(machine->config->devicelist, Z80CTC, "z80ctc"), port-0x08c, data);
190         kc85_ctc_w(device_list_find_by_tag(space->machine->config->devicelist, Z80CTC, "z80ctc"), port-0x08c, data);
191191         return;
192192   }
193193

Previous 15994 Revisions Next


© 1998-2018 The MESS Team