Previous 15994 Revisions Next

r4153 Saturday 17th January, 2009 at 14:41:00 UTC by Nathan Woods
[COCO] Cleanups
[docs]messnew.txt
[src/mess/drivers]coco.c
[src/mess/includes]coco.h
[src/mess/machine]coco.c

src/mess/includes/coco.h
r4152r4153
11/*****************************************************************************
2 *
3 * includes/coco.h
4 *
5 * CoCo/Dragon
6 *
7 ****************************************************************************/
82
9#ifndef COCO_H_
10#define COCO_H_
3   includes/coco.h
114
5   CoCo/Dragon
6
7****************************************************************************/
8
9#ifndef __COCO_H__
10#define __COCO_H__
11
1212#include "devices/snapquik.h"
1313#include "machine/wd17xx.h"
1414#include "machine/6883sam.h"
1515
16
17/***************************************************************************
18    CONSTANTS
19***************************************************************************/
20
1621#define COCO_CPU_SPEED_HZ      894886   /* 0.894886 MHz */
1722#define COCO_FRAMES_PER_SECOND   (COCO_CPU_SPEED_HZ / 57.0 / 263)
1823#define COCO_CPU_SPEED         (ATTOTIME_IN_HZ(COCO_CPU_SPEED_HZ))
1924#define COCO_TIMER_CMPCARRIER   (COCO_CPU_SPEED * 0.25)
2025
2126
27/***************************************************************************
28    TYPE DEFINITIONS
29***************************************************************************/
30
31typedef struct _coco_state coco_state;
32struct _coco_state
33{
34   const device_config *cartslot_device;
35   const device_config *cassette_device;
36   const device_config *bitbanger_device;
37   const device_config *printer_device;
38};
39
40
41/***************************************************************************
42    PROTOTYPES
43***************************************************************************/
44
2245/*----------- defined in video/coco.c -----------*/
2346
2447ATTR_CONST UINT8 coco_get_attributes(UINT8 c);
r4152r4153
118141extern const struct coco3_video_vars coco3_vidvars;
119142
120143
121#endif /* COCO_H_ */
144#endif /* __COCO_H__ */
src/mess/machine/coco.c
r4152r4153
455455
456456static void pak_load_trailer(running_machine *machine, const pak_decodedtrailer *trailer)
457457{
458   device_config *sam = (device_config*)devtag_get_device(machine, SAM6883, "sam");
458   const device_config *sam = devtag_get_device(machine, SAM6883, "sam");
459459   cpu_set_reg(machine->cpu[0], M6809_PC, trailer->reg_pc);
460460   cpu_set_reg(machine->cpu[0], M6809_X, trailer->reg_x);
461461   cpu_set_reg(machine->cpu[0], M6809_Y, trailer->reg_y);
r4152r4153
11201120
11211121static const device_config *cartslot_image(running_machine *machine)
11221122{
1123   return devtag_get_device(machine, CARTSLOT, "cart");
1123   coco_state *state = machine->driver_data;
1124   return state->cartslot_device;
11241125}
11251126
11261127static const device_config *cassette_device_image(running_machine *machine)
11271128{
1128   return devtag_get_device(machine, CASSETTE, "cassette");
1129   coco_state *state = machine->driver_data;
1130   return state->cassette_device;
11291131}
11301132
11311133static const device_config *bitbanger_image(running_machine *machine)
11321134{
1133   return devtag_get_device(machine, BITBANGER, "bitbanger");
1135   coco_state *state = machine->driver_data;
1136   return state->bitbanger_device;
11341137}
11351138
11361139static const device_config *printer_image(running_machine *machine)
11371140{
1138   return devtag_get_device(machine, PRINTER, "printer");
1141   coco_state *state = machine->driver_data;
1142   return state->printer_device;
11391143}
11401144
11411145static int get_soundmux_status(void)
r4152r4153
12151219
12161220WRITE8_HANDLER ( dgnalpha_psg_porta_write )
12171221{
1218   device_config *fdc = (device_config*)devtag_get_device(space->machine, WD179X, "wd179x");
1222   const device_config *fdc = devtag_get_device(space->machine, WD179X, "wd179x");
12191223   /* Bits 0..3 are the drive select lines for the internal floppy interface */
12201224   /* Bit 4 is the motor on, in the real hardware these are inverted on their way to the drive */
12211225   /* Bits 5,6,7 are connected to /DDEN, ENP and 5/8 on the WD2797 */
r4152r4153
16711675/* The Dragon Alpha hardware reverses the order of the WD2797 registers */
16721676READ8_HANDLER(wd2797_r)
16731677{
1674   device_config *fdc = (device_config*)devtag_get_device(space->machine, WD179X, "wd179x");
1678   const device_config *fdc = devtag_get_device(space->machine, WD179X, "wd179x");
16751679   int result = 0;
16761680
16771681   switch(offset & 0x03)
r4152r4153
16971701
16981702WRITE8_HANDLER(wd2797_w)
16991703{
1700   device_config *fdc = (device_config*)devtag_get_device(space->machine, WD179X, "wd179x");
1704   const device_config *fdc = devtag_get_device(space->machine, WD179X, "wd179x");
17011705    switch(offset & 0x3)
17021706   {
17031707      case 0:
r4152r4153
19371941
19381942   /* We need to init these vars from the sam, as this may be called from outside the sam callbacks */
19391943   const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
1940   device_config *sam = (device_config*)devtag_get_device(space->machine, SAM6883, "sam");
1944   const device_config *sam = devtag_get_device(space->machine, SAM6883, "sam");
19411945   UINT8 memsize   = get_sam_memorysize(sam);
19421946   UINT8 maptype   = get_sam_maptype(sam);
19431947//   UINT8 pagemode   = get_sam_pagemode(machine);
r4152r4153
19901994   if(!maptype)
19911995   {
19921996      UINT8 *cart_rom = memory_region(machine, "cart");
1997      UINT32 cart_length = memory_region_length(machine, "cart");
19931998
19941999      for(block_index=0;block_index<=7;block_index++)
19952000      {
r4152r4153
19992004         if (block_index < 4)
20002005            offset = &bas_rom_bank[0x1000*block_index];
20012006         else
2002            offset = &cart_rom[(0x1000*(block_index-4))];
2007            offset = &cart_rom[(0x1000*(block_index-4)) % cart_length];
20032008
20042009         memory_set_bankptr(machine, block_index + 9,offset);
20052010         memory_install_write_handler(space, memmap[block_index+8].start, memmap[block_index+8].end, 0, 0, STATIC_NOP);
r4152r4153
28112816/* for everything except the coco3, so it made sense not to pass it as a parameter */
28122817static void generic_init_machine(running_machine *machine, const machine_init_interface *init)
28132818{
2819   coco_state *state = (coco_state *) machine->driver_data;
28142820   coco_cartridge_config cart_config;
28152821   const device_config *cart_image;
28162822   const char *extrainfo;
28172823   const char *cart_hardware;
28182824   int i;
28192825
2826   /* locate devices */
2827   state->cartslot_device   = devtag_get_device(machine, CARTSLOT, "cart");
2828   state->cassette_device   = devtag_get_device(machine, CASSETTE, "cassette");
2829   state->bitbanger_device   = devtag_get_device(machine, BITBANGER, "bitbanger");
2830   state->printer_device   = devtag_get_device(machine, PRINTER, "printer");
2831
28202832   /* clear static variables */
28212833   coco_hiresjoy_ca = 1;
28222834   coco_hiresjoy_xtransitiontime = attotime_zero;
src/mess/drivers/coco.c
r4152r4153
659659   MDRV_SCREEN_REFRESH_RATE(M6847_PAL_FRAMES_PER_SECOND)
660660
661661   MDRV_MACHINE_START( dragon32 )
662   MDRV_DRIVER_DATA( coco_state )
662663
663664   /* video hardware */
664665   MDRV_VIDEO_START(dragon)
r4152r4153
691692   MDRV_CPU_PROGRAM_MAP(d64_map, 0)
692693
693694   MDRV_MACHINE_START( dragon64 )
695   MDRV_DRIVER_DATA( coco_state )
694696
695697   /* video hardware */
696698   MDRV_VIDEO_START(dragon)
r4152r4153
729731   MDRV_CPU_PROGRAM_MAP(d64_plus_map, 0)
730732
731733   MDRV_MACHINE_START( dragon64 )
734   MDRV_DRIVER_DATA( coco_state )
732735
733736   /* video hardware */
734737   MDRV_VIDEO_START(dragon)
r4152r4153
767770   MDRV_CPU_PROGRAM_MAP(dgnalpha_map, 0)
768771
769772   MDRV_MACHINE_START( dgnalpha )
773   MDRV_DRIVER_DATA( coco_state )
770774
771775   /* video hardware */
772776   MDRV_VIDEO_START(dragon)
r4152r4153
808812   MDRV_CPU_PROGRAM_MAP(d64_map, 0)
809813
810814   MDRV_MACHINE_START( tanodr64 )
815   MDRV_DRIVER_DATA( coco_state )
811816
812817   /* video hardware */
813818   MDRV_VIDEO_START(dragon)
r4152r4153
846851   MDRV_CPU_PROGRAM_MAP(coco_map, 0)
847852
848853   MDRV_MACHINE_START( coco )
854   MDRV_DRIVER_DATA( coco_state )
849855
850856   /* video hardware */
851857   MDRV_SCREEN_ADD("main", RASTER)
r4152r4153
886892   MDRV_CPU_PROGRAM_MAP(coco_map, 0)
887893
888894   MDRV_MACHINE_START( coco2 )
895   MDRV_DRIVER_DATA( coco_state )
889896
890897   /* video hardware */
891898   MDRV_SCREEN_ADD("main", RASTER)
r4152r4153
926933   MDRV_CPU_PROGRAM_MAP(coco_map, 0)
927934
928935   MDRV_MACHINE_START( coco2 )
936   MDRV_DRIVER_DATA( coco_state )
929937
930938   /* video hardware */
931939   MDRV_SCREEN_ADD("main", RASTER)
r4152r4153
967975
968976   MDRV_MACHINE_START( coco3 )
969977   MDRV_MACHINE_RESET( coco3 )
978   MDRV_DRIVER_DATA( coco_state )
970979
971980   /* video hardware */
972981   MDRV_VIDEO_START(coco3)
docs/messnew.txt
r4152r4153
1010
1111System Driver Changes:
1212----------------------
13- [COCO] Cleanups  [Nathan Woods]
14
1315- [TI81, TI85, TI86] Added the new ROM_DEFAULT_BIOS feature to select the most
1416  recent rom versions.  [Hobie Troxell]
1517

Previous 15994 Revisions Next


© 1998-2018 The MESS Team