src/mess/machine/vip_exp.c
| r15894 | r15895 | |
| 246 | 246 | SLOT_INTERFACE("ram", VP570) |
| 247 | 247 | SLOT_INTERFACE("exp", VP575) |
| 248 | 248 | //SLOT_INTERFACE("exp2", VP576_EXP) |
| 249 | | //SLOT_INTERFACE("basic", VP700) |
| 250 | 249 | SLOT_INTERFACE("keypad", VP585) |
| 251 | 250 | SLOT_INTERFACE("color", VP590) |
| 252 | 251 | SLOT_INTERFACE("simple", VP595) |
| 252 | SLOT_INTERFACE("basic", VP700) |
| 253 | 253 | SLOT_INTERFACE_END |
src/mess/machine/vp700.c
| r0 | r15895 | |
| 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 | |
| 17 | const device_type VP700 = &device_creator<vp700_device>; |
| 18 | |
| 19 | |
| 20 | //------------------------------------------------- |
| 21 | // ROM( vp700 ) |
| 22 | //------------------------------------------------- |
| 23 | |
| 24 | ROM_START( vp700 ) |
| 25 | ROM_REGION( 0x1000, "vp700", 0 ) |
| 26 | ROM_LOAD( "vp700.bin", 0x0000, 0x1000, CRC(3f2b8524) SHA1(8fa88740cae82d8d62ea34891a657d3ca1fb732a) ) |
| 27 | ROM_END |
| 28 | |
| 29 | |
| 30 | //------------------------------------------------- |
| 31 | // rom_region - device-specific ROM region |
| 32 | //------------------------------------------------- |
| 33 | |
| 34 | const 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 | |
| 49 | vp700_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 | |
| 60 | void 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 | |
| 71 | UINT8 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
| r0 | r15895 | |
| 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 | |
| 27 | class vp700_device : public device_t, |
| 28 | public device_vip_expansion_card_interface |
| 29 | { |
| 30 | public: |
| 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 | |
| 37 | protected: |
| 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 | |
| 45 | private: |
| 46 | const UINT8 *m_rom; |
| 47 | }; |
| 48 | |
| 49 | |
| 50 | // device type definition |
| 51 | extern const device_type VP700; |
| 52 | |
| 53 | |
| 54 | #endif |
src/mess/drivers/vip.c
| r15894 | r15895 | |
| 56 | 56 | |
| 57 | 57 | TODO: |
| 58 | 58 | |
| 59 | - Tiny BASIC |
| 59 | 60 | - cassette loading |
| 60 | 61 | - 20K RAM for Floating Point BASIC |
| 61 | 62 | - VP-111 has 1K RAM, no byte I/O, no expansion |
| r15894 | r15895 | |
| 265 | 266 | |
| 266 | 267 | UINT8 data = m_exp->program_r(space, offset, cs, cdef, &minh); |
| 267 | 268 | |
| 268 | | if (cs) |
| 269 | if (!minh) |
| 269 | 270 | { |
| 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 | } |
| 271 | 279 | } |
| 272 | | else if (!minh) |
| 273 | | { |
| 274 | | data = m_ram->pointer()[offset & (m_ram->size() - 1)]; |
| 275 | | } |
| 276 | 280 | |
| 277 | 281 | return data; |
| 278 | 282 | } |
| r15894 | r15895 | |
| 292 | 296 | |
| 293 | 297 | if (!cs && !minh) |
| 294 | 298 | { |
| 295 | | m_ram->pointer()[offset & (m_ram->size() - 1)] = data; |
| 299 | m_ram->pointer()[offset & m_ram->mask()] = data; |
| 296 | 300 | } |
| 297 | 301 | } |
| 298 | 302 | |