mirror of
https://github.com/holub/mame
synced 2025-10-05 08:41:31 +03:00
(MESS) Modello T : added keyboard and cursor, notes.
This commit is contained in:
parent
e4b17f5653
commit
28887c16b3
@ -1,46 +1,57 @@
|
||||
/***************************************************************************
|
||||
/**********************************************************************************
|
||||
|
||||
General Processor Modello T
|
||||
General Processor Modello T
|
||||
|
||||
10/12/2012 Skeleton driver.
|
||||
2012-12-10 Skeleton driver.
|
||||
2013-09-27 Added keyboard and cursor.
|
||||
|
||||
****************************************************************************/
|
||||
Made in Italy, a single board with numerous small daughter boards.
|
||||
The 3 units (keyboard, disk drives, main unit) had wooden cabinets.
|
||||
It had an inbuilt small green-screen CRT, like a Kaypro, and the RAM could
|
||||
be 16, 32, or 48k. The FDC is a FD1791.
|
||||
|
||||
All the articles and doco (what there is of it) is all in Italian.
|
||||
|
||||
***********************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "machine/keyboard.h"
|
||||
|
||||
|
||||
class modellot_state : public driver_device
|
||||
{
|
||||
public:
|
||||
modellot_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu") ,
|
||||
m_video_ram(*this, "video_ram")
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_p_videoram(*this, "videoram")
|
||||
, m_maincpu(*this, "maincpu")
|
||||
{ }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_shared_ptr<UINT8> m_video_ram;
|
||||
DECLARE_READ8_MEMBER(port77_r);
|
||||
DECLARE_READ8_MEMBER(portff_r);
|
||||
DECLARE_WRITE8_MEMBER(kbd_put);
|
||||
UINT32 screen_update_modellot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
required_shared_ptr<UINT8> m_p_videoram;
|
||||
private:
|
||||
UINT8 m_term_data;
|
||||
const UINT8 *m_p_chargen;
|
||||
virtual void machine_reset();
|
||||
|
||||
DECLARE_READ8_MEMBER(modellot_77);
|
||||
DECLARE_READ8_MEMBER(modellot_ff);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
};
|
||||
|
||||
static ADDRESS_MAP_START(modellot_mem, AS_PROGRAM, 8, modellot_state)
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x0000, 0xbfff) AM_RAM
|
||||
AM_RANGE(0xc000, 0xc3ff) AM_RAM AM_SHARE("video_ram")
|
||||
AM_RANGE(0x0000, 0xbfff) AM_RAM // 48k ram
|
||||
AM_RANGE(0xc000, 0xc3ff) AM_RAM AM_SHARE("videoram")
|
||||
AM_RANGE(0xe000, 0xffff) AM_ROM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START(modellot_io, AS_IO, 8, modellot_state)
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x77, 0x77) AM_READ(modellot_77)
|
||||
AM_RANGE(0xff, 0xff) AM_READ(modellot_ff)
|
||||
AM_RANGE(0x77, 0x77) AM_READ(port77_r)
|
||||
AM_RANGE(0xff, 0xff) AM_READ(portff_r)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
@ -48,18 +59,32 @@ ADDRESS_MAP_END
|
||||
static INPUT_PORTS_START( modellot )
|
||||
INPUT_PORTS_END
|
||||
|
||||
READ8_MEMBER( modellot_state::modellot_77)
|
||||
READ8_MEMBER( modellot_state::port77_r)
|
||||
{
|
||||
return 0x04;
|
||||
return 4;
|
||||
}
|
||||
|
||||
READ8_MEMBER( modellot_state::modellot_ff)
|
||||
READ8_MEMBER( modellot_state::portff_r)
|
||||
{
|
||||
return 0x00;
|
||||
UINT8 data = (m_term_data) ? m_term_data ^ 0x7f : 0xff;
|
||||
m_term_data = 0;
|
||||
return data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( modellot_state::kbd_put )
|
||||
{
|
||||
m_term_data = data;
|
||||
}
|
||||
|
||||
static ASCII_KEYBOARD_INTERFACE( keyboard_intf )
|
||||
{
|
||||
DEVCB_DRIVER_MEMBER(modellot_state, kbd_put)
|
||||
};
|
||||
|
||||
void modellot_state::machine_reset()
|
||||
{
|
||||
m_term_data = 1;
|
||||
m_p_chargen = memregion("chargen")->base();
|
||||
m_maincpu->set_state_int(Z80_PC, 0xe000);
|
||||
}
|
||||
|
||||
@ -82,15 +107,44 @@ GFXDECODE_END
|
||||
|
||||
UINT32 modellot_state::screen_update_modellot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
int x,y;
|
||||
UINT8 y,ra,chr,gfx,inv;
|
||||
UINT16 sy=0,ma=0,x;
|
||||
|
||||
for(y = 0; y < 16; y++ )
|
||||
for (y = 0; y < 16; y++)
|
||||
{
|
||||
for(x = 0; x < 64; x++ )
|
||||
for (ra = 0; ra < 16; ra++)
|
||||
{
|
||||
int code = m_video_ram[x + y*64];
|
||||
drawgfx_opaque(bitmap, cliprect, machine().gfx[0], code, 0, 0, 0, x*8, y*16);
|
||||
UINT16 *p = &bitmap.pix16(sy++);
|
||||
|
||||
for (x = 0; x < 64; x++)
|
||||
{
|
||||
inv = 0;
|
||||
|
||||
chr = m_p_videoram[x+ma];
|
||||
|
||||
if BIT(chr, 7) inv = 0xff;
|
||||
|
||||
chr &= 0x7f; // cursor
|
||||
|
||||
if (ra < 8)
|
||||
gfx = m_p_chargen[(chr<<3) | ra ];
|
||||
else
|
||||
gfx = m_p_chargen[(chr<<3) | (ra-8) | 0x400];
|
||||
|
||||
gfx ^= inv;
|
||||
|
||||
/* Display a scanline of a character */
|
||||
*p++ = BIT(gfx, 7);
|
||||
*p++ = BIT(gfx, 6);
|
||||
*p++ = BIT(gfx, 5);
|
||||
*p++ = BIT(gfx, 4);
|
||||
*p++ = BIT(gfx, 3);
|
||||
*p++ = BIT(gfx, 2);
|
||||
*p++ = BIT(gfx, 1);
|
||||
*p++ = BIT(gfx, 0);
|
||||
}
|
||||
}
|
||||
ma+=64;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -108,11 +162,12 @@ static MACHINE_CONFIG_START( modellot, modellot_state )
|
||||
MCFG_SCREEN_SIZE(64*8, 16*16)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 16*16-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(modellot_state, screen_update_modellot)
|
||||
|
||||
MCFG_GFXDECODE( modellot )
|
||||
|
||||
MCFG_PALETTE_LENGTH(2)
|
||||
MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
|
||||
MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
|
||||
|
||||
/* Devices */
|
||||
MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
/* ROM definition */
|
||||
|
Loading…
Reference in New Issue
Block a user