Previous 15994 Revisions Next

r1883 Monday 10th March, 2008 at 02:54:15 UTC by Robbbert
[MBEE] Using new z80bin code. Removed 4 unneeded includes.
[src/mess/drivers]mbee.c

src/mess/drivers/mbee.c
r1882r1883
3333
3434***************************************************************************/
3535
36#include <math.h>
3736#include "driver.h"
38#include "machine/z80ctc.h"
3937#include "machine/z80pio.h"
40#include "machine/z80sio.h"
38#include "cpu/z80/z80daisy.h"
4139#include "machine/wd17xx.h"
4240#include "includes/mbee.h"
41#include "devices/snapquik.h"
4342#include "devices/basicdsk.h"
4443#include "devices/cartslot.h"
4544#include "devices/cassette.h"
4645#include "devices/z80bin.h"
47#include "mslegacy.h"
48#include "cpu/z80/z80daisy.h"
4946
5047static ADDRESS_MAP_START(mbee_mem, ADDRESS_SPACE_PROGRAM, 8)
5148   AM_RANGE(0x0000, 0x0fff) AM_RAMBANK(1)
r1882r1883
165162    PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(Right)") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT))
166163    PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(Insert)") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(INSERT))
167164    PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
165
166   /* Enhanced options not available on real hardware */
167   PORT_START_TAG("CONFIG")
168   PORT_CONFNAME( 0x01, 0x01, "Autorun on Quickload")
169   PORT_CONFSETTING(    0x00, DEF_STR(No))
170   PORT_CONFSETTING(    0x01, DEF_STR(Yes))
171   PORT_BIT( 0x6, 0x6, IPT_UNUSED )
172//   PORT_CONFNAME( 0x08, 0x08, "Cassette Speaker")
173//   PORT_CONFSETTING(    0x08, DEF_STR(On))
174//   PORT_CONFSETTING(    0x00, DEF_STR(Off))
175//   PORT_CONFNAME( 0x10, 0x10, "Auto-Resize?")
176//   PORT_CONFSETTING(    0x00, DEF_STR(No))
177//   PORT_CONFSETTING(    0x10, DEF_STR(Yes))
168178INPUT_PORTS_END
169179
170180static const gfx_layout mbee_charlayout =
r1882r1883
342352
343353***************************************************************************/
344354
355static QUICKLOAD_LOAD( mbee )
356{
357   UINT8 sw = readinputportbytag("CONFIG") & 1;         /* reading the dipswitch: 1 = autorun */
358   UINT16 exec_addr;
359   UINT64 return_info = z80bin_load_file( image, file_type );   /* load file */
360
361   if (return_info == INIT_FAIL) return INIT_FAIL;         /* failure */
362
363   exec_addr = (return_info & 0xffff0000) >> 16;         /* get program run address */
364
365   if (exec_addr == 0xffff) return INIT_PASS;         /* data file */
366
367   program_write_word_16le(0xa6,exec_addr);         /* fix the EXEC command */
368
369   if (sw)
370   {
371      program_write_word_16le(0xa2,exec_addr);      /* fix warm-start vector to get around some copy-protections */
372      cpunum_set_reg(0, REG_PC, exec_addr);
373   }
374   else
375      program_write_word_16le(0xa2,0x8517);
376
377   return INIT_PASS;
378}
379
380static void mbee_quickload_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
381{
382   /* quickload */
383   switch(state)
384   {
385      /* --- the following bits of info are returned as NULL-terminated strings --- */
386      case MESS_DEVINFO_STR_DEV_FILE:      strcpy(info->s = device_temp_str(), __FILE__); break;
387      case MESS_DEVINFO_STR_FILE_EXTENSIONS:   strcpy(info->s = device_temp_str(), "bin"); break;
388
389      /* --- the following bits of info are returned as pointers to data or functions --- */
390      case MESS_DEVINFO_PTR_QUICKLOAD_LOAD:   info->f = (genf *) quickload_load_mbee; break;
391
392      default:            quickload_device_getinfo(devclass, state, info); break;
393   }
394}
395
345396static void mbee_cassette_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
346397{
347398   /* cassette */
r1882r1883
391442}
392443
393444
394
395445SYSTEM_CONFIG_START(mbee)
396446   CONFIG_DEVICE(mbee_cassette_getinfo)
397447   CONFIG_DEVICE(mbee_cartslot_getinfo)
398448   CONFIG_DEVICE(mbee_floppy_getinfo)
399   CONFIG_DEVICE(z80bin_quickload_getinfo)
449   CONFIG_DEVICE(mbee_quickload_getinfo)
400450SYSTEM_CONFIG_END
401451
402452/*    YEAR  NAME      PARENT    COMPAT  MACHINE   INPUT     INIT      CONFIG    COMPANY   FULLNAME */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team