Previous 15994 Revisions Next

r15895 Tuesday 14th August, 2012 at 14:11:34 UTC by Curt Coder
[VIP] Added VP-700 Tiny BASIC board. [ekeefe, Curt Coder]
[src/mess]mess.mak
[src/mess/drivers]vip.c
[src/mess/machine]vip_exp.c vip_exp.h vp700.c* vp700.h*

src/mess/machine/vip_exp.c
r15894r15895
246246    SLOT_INTERFACE("ram", VP570)
247247    SLOT_INTERFACE("exp", VP575)
248248    //SLOT_INTERFACE("exp2", VP576_EXP)
249    //SLOT_INTERFACE("basic", VP700)
250249    SLOT_INTERFACE("keypad", VP585)
251250    SLOT_INTERFACE("color", VP590)
252251    SLOT_INTERFACE("simple", VP595)
252    SLOT_INTERFACE("basic", VP700)
253253SLOT_INTERFACE_END
src/mess/machine/vip_exp.h
r15894r15895
173173#include "machine/vp585.h"
174174#include "machine/vp590.h"
175175#include "machine/vp595.h"
176#include "machine/vp700.h"
176177
177178SLOT_INTERFACE_EXTERN( vip_expansion_cards );
178179
src/mess/machine/vp700.c
r0r15895
1/**********************************************************************
2
3    RCA VIP Tiny BASIC VP-700 emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "vp700.h"
11
12
13//**************************************************************************
14//  DEVICE DEFINITIONS
15//**************************************************************************
16
17const device_type VP700 = &device_creator<vp700_device>;
18
19
20//-------------------------------------------------
21//  ROM( vp700 )
22//-------------------------------------------------
23
24ROM_START( vp700 )
25   ROM_REGION( 0x1000, "vp700", 0 )
26   ROM_LOAD( "vp700.bin", 0x0000, 0x1000, CRC(3f2b8524) SHA1(8fa88740cae82d8d62ea34891a657d3ca1fb732a) )
27ROM_END
28
29
30//-------------------------------------------------
31//  rom_region - device-specific ROM region
32//-------------------------------------------------
33
34const rom_entry *vp700_device::device_rom_region() const
35{
36   return ROM_NAME( vp700 );
37}
38
39
40
41//**************************************************************************
42//  LIVE DEVICE
43//**************************************************************************
44
45//-------------------------------------------------
46//  vp700_device - constructor
47//-------------------------------------------------
48
49vp700_device::vp700_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
50   device_t(mconfig, VP700, "VP700", tag, owner, clock),
51   device_vip_expansion_card_interface(mconfig, *this)
52{
53}
54
55
56//-------------------------------------------------
57//  device_start - device-specific startup
58//-------------------------------------------------
59
60void vp700_device::device_start()
61{
62   // find memory regions
63   m_rom = memregion("vp700")->base();
64}
65
66
67//-------------------------------------------------
68//  vip_program_r - program read
69//-------------------------------------------------
70
71UINT8 vp700_device::vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh)
72{
73   UINT8 data = 0xff;
74
75   if (cs)
76   {
77      *minh = 1;
78
79      data = m_rom[offset & 0xfff];
80   }
81
82   return data;
83}
src/mess/machine/vp700.h
r0r15895
1/**********************************************************************
2
3    RCA VIP Tiny BASIC VP-700 emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#pragma once
11
12#ifndef __VP700__
13#define __VP700__
14
15#include "emu.h"
16#include "machine/vip_exp.h"
17#include "sound/cdp1863.h"
18
19
20
21//**************************************************************************
22//  TYPE DEFINITIONS
23//**************************************************************************
24
25// ======================> vp700_device
26
27class vp700_device : public device_t,
28                public device_vip_expansion_card_interface
29{
30public:
31   // construction/destruction
32   vp700_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
33
34   // optional information overrides
35   virtual const rom_entry *device_rom_region() const;
36
37protected:
38   // device-level overrides
39   virtual void device_config_complete() { m_shortname = "vp700"; }
40   virtual void device_start();
41
42   // device_vip_expansion_card_interface overrides
43   virtual UINT8 vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh);
44
45private:
46   const UINT8 *m_rom;
47};
48
49
50// device type definition
51extern const device_type VP700;
52
53
54#endif
src/mess/drivers/vip.c
r15894r15895
5656
5757    TODO:
5858
59    - Tiny BASIC
5960    - cassette loading
6061    - 20K RAM for Floating Point BASIC
6162    - VP-111 has 1K RAM, no byte I/O, no expansion
r15894r15895
265266
266267    UINT8 data = m_exp->program_r(space, offset, cs, cdef, &minh);
267268
268    if (cs)
269    if (!minh)
269270    {
270        data = memregion(CDP1802_TAG)->base()[offset & 0x1ff];
271        if (cs)
272        {
273            data = memregion(CDP1802_TAG)->base()[offset & 0x1ff];
274        }
275        else
276        {
277            data = m_ram->pointer()[offset & m_ram->mask()];
278        }
271279    }
272    else if (!minh)
273    {
274        data = m_ram->pointer()[offset & (m_ram->size() - 1)];
275    }
276280
277281    return data;
278282}
r15894r15895
292296
293297    if (!cs && !minh)
294298    {
295        m_ram->pointer()[offset & (m_ram->size() - 1)] = data;
299        m_ram->pointer()[offset & m_ram->mask()] = data;
296300    }
297301}
298302
src/mess/mess.mak
r15894r15895
15001500   $(MESS_MACHINE)/vp590.o      \
15011501   $(MESS_MACHINE)/vp595.o      \
15021502   $(MESS_MACHINE)/vp620.o      \
1503   $(MESS_MACHINE)/vp700.o      \
15031504
15041505$(MESSOBJ)/rm.a:            \
15051506   $(MESS_DRIVERS)/rm380z.o   \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team