Previous 15994 Revisions Next

r4171 Tuesday 20th January, 2009 at 16:24:26 UTC by Dirk Best
[ENTERPRISE] Converted to the standard 'basicdsk' interface, cleanups
[src/mess]mess.mak
[src/mess/drivers]enterp.c
[src/mess/includes]enterp.h
[src/mess/machine]enterp.c
[src/mess/video]enterp.c

src/mess/video/enterp.c
r4170r4171
1/***************************************************************************
2
3  Functions to emulate the video hardware of the Enterprise.
4
5***************************************************************************/
6
7#include "driver.h"
8#include "video/epnick.h"
9#include "includes/enterp.h"
10
11/***************************************************************************
12  Start the video hardware emulation.
13***************************************************************************/
14VIDEO_START( enterprise )
15{
16   Nick_vh_start();
17   VIDEO_START_CALL(generic_bitmapped);
18}
19
20/***************************************************************************
21  Draw the game screen in the given bitmap_t.
22  Do NOT call osd_update_display() from this function,
23  it will be called by the main emulation engine.
24***************************************************************************/
25VIDEO_UPDATE( enterprise )
26{
27   Nick_DoScreen(tmpbitmap);
28   return VIDEO_UPDATE_CALL(generic_bitmapped);
29}
30
src/mess/includes/enterp.h
r4170r4171
1/*****************************************************************************
2 *
3 * includes/enterp.h
4 *
5 ****************************************************************************/
6
7#ifndef ENTERP_H_
8#define ENTERP_H_
9
10
11/*----------- defined in machine/enterp.c -----------*/
12
13DEVICE_IMAGE_LOAD( enterprise_floppy );
14
15
16/*----------- defined in video/enterp.c -----------*/
17
18VIDEO_START( enterprise );
19VIDEO_UPDATE( enterprise );
20
21
22#endif /* ENTERP_H_ */
src/mess/machine/enterp.c
r4170r4171
1/***************************************************************************
2
3  machine.c
4
5  Functions to emulate general aspects of the machine (RAM, ROM, interrupts,
6  I/O ports)
7
8***************************************************************************/
9
10#include <stdarg.h>
11#include "driver.h"
12#include "cpu/z80/z80.h"
13#include "includes/enterp.h"
14#include "devices/basicdsk.h"
15#include "machine/wd17xx.h"
16#include "audio/dave.h"
17
18
19DEVICE_IMAGE_LOAD( enterprise_floppy )
20{
21   if (device_load_basicdsk_floppy(image)==INIT_PASS)
22   {
23      basicdsk_set_geometry(image, 80, 2, 9, 512, 1, 0, FALSE);
24      return INIT_PASS;
25   }
26   return INIT_FAIL;
27}
src/mess/mess.mak
r4170r4171
921921$(MESSOBJ)/enterp.a :   \
922922   $(MESS_AUDIO)/dave.o    \
923923   $(MESS_VIDEO)/epnick.o    \
924   $(MESS_VIDEO)/enterp.o    \
925   $(MESS_MACHINE)/enterp.o    \
926924   $(MESS_DRIVERS)/enterp.o
927925
928926$(MESSOBJ)/ascii.a :   \
src/mess/drivers/enterp.c
r4170r4171
1818#include "driver.h"
1919#include "cpu/z80/z80.h"
2020#include "audio/dave.h"
21#include "includes/enterp.h"
2221#include "video/epnick.h"
2322#include "machine/wd17xx.h"
2423#include "devices/basicdsk.h"
25/* for CPCEMU style disk images */
26#include "devices/dsk.h"
2724
2825
2926#define ENTERPRISE_XTAL_X1   XTAL_8MHz
r4170r4171
4239/* index of keyboard line to read */
4340static int Enterprise_KeyboardLine = 0;
4441
45/* set read/write pointers for CPU page */
42
43/***************************************************************************
44    MEMORY / I/O
45***************************************************************************/
46
4647static void enterprise_update_memory_page(const address_space *space, offs_t page, int index)
4748{
4849   int start = (page - 1) * 0x4000;
r4170r4171
9495   case 0xff:
9596      /* basic 64k ram */
9697      memory_install_readwrite8_handler(space, start, end, 0, 0, SMH_BANK((FPTR)page), SMH_BANK((FPTR)page));
97      memory_set_bankptr(space->machine, page, mess_ram + (index - 0xfc) * 0x4000);             
98      memory_set_bankptr(space->machine, page, mess_ram + (index - 0xfc) * 0x4000);
9899      break;
99100
100101   default:
r4170r4171
121122   }
122123}
123124
125
124126static void enterprise_dave_reg_read(running_machine *machine, offs_t RegIndex)
125127{
126128   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4",
r4170r4171
157159   }
158160}
159161
162
160163static void enterprise_dave_interrupt(running_machine *machine, int state)
161164{
162165   if (state)
r4170r4171
195198}
196199
197200
201/***************************************************************************
202    VIDEO
203***************************************************************************/
198204
205static VIDEO_START( enterprise )
206{
207   Nick_vh_start();
208   VIDEO_START_CALL(generic_bitmapped);
209}
210
211
212static VIDEO_UPDATE( enterprise )
213{
214   Nick_DoScreen(tmpbitmap);
215   return VIDEO_UPDATE_CALL(generic_bitmapped);
216}
217
218
199219/***************************************************************************
200220    FLOPPY/EXDOS
201221***************************************************************************/
r4170r4171
251271}
252272
253273
274DEVICE_IMAGE_LOAD( enterprise_floppy )
275{
276   const device_config *fdc = devtag_get_device(image->machine, WD1770, "wd1770");
277
278   wd17xx_set_density(fdc, DEN_FM_HI);
279
280   if (device_load_basicdsk_floppy(image) != INIT_PASS)
281      return INIT_FAIL;
282
283   basicdsk_set_geometry(image, 80, 2, 9, 512, 1, 0, FALSE);
284   return INIT_PASS;
285}
286
287
254288/***************************************************************************
255289    ADDRESS MAPS
256290***************************************************************************/
r4170r4171
522556    SYSTEM CONFIG
523557***************************************************************************/
524558
525static void ep128_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
559static void enterprise_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
526560{
527561   /* floppy */
528562   switch(state)
529563   {
530564      /* --- the following bits of info are returned as 64-bit signed integers --- */
531      case MESS_DEVINFO_INT_COUNT:                     info->i = 4; break;
565      case MESS_DEVINFO_INT_COUNT:         info->i = 4; break;
532566
533      default:                              legacydsk_device_getinfo(devclass, state, info); break;
534   }
535}
536
537#if 0
538static void ep128_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
539{
540   /* floppy */
541   switch(state)
542   {
543      /* --- the following bits of info are returned as 64-bit signed integers --- */
544      case MESS_DEVINFO_INT_COUNT:                     info->i = 4; break;
545
546567      /* --- the following bits of info are returned as pointers to data or functions --- */
547      case MESS_DEVINFO_PTR_LOAD:                     info->load = DEVICE_IMAGE_LOAD_NAME(enterprise_floppy); break;
568      case MESS_DEVINFO_PTR_LOAD:            info->load = DEVICE_IMAGE_LOAD_NAME(enterprise_floppy); break;
548569
549570      /* --- the following bits of info are returned as NULL-terminated strings --- */
550      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "dsk"); break;
571      case MESS_DEVINFO_STR_FILE_EXTENSIONS:   strcpy(info->s = device_temp_str(), "dsk,img"); break;
551572
552      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
573      default:                        legacybasicdsk_device_getinfo(devclass, state, info); break;
553574   }
554575}
555#endif
556576
577
557578static SYSTEM_CONFIG_START(ep64)
558579   CONFIG_RAM_DEFAULT(64*1024)
559   CONFIG_DEVICE(ep128_floppy_getinfo)
580   CONFIG_DEVICE(enterprise_floppy_getinfo)
560581SYSTEM_CONFIG_END
561582
562583static SYSTEM_CONFIG_START(ep128)
563584   CONFIG_RAM_DEFAULT(128*1024)
564   CONFIG_DEVICE(ep128_floppy_getinfo)
585   CONFIG_DEVICE(enterprise_floppy_getinfo)
565586SYSTEM_CONFIG_END
566587
567588

Previous 15994 Revisions Next


© 1998-2018 The MESS Team