Previous 199869 Revisions Next

r25443 Friday 27th September, 2013 at 11:56:10 UTC by Robbbert
(MESS) Modello T : added keyboard and cursor, notes.
[src/mess/drivers]modellot.c

trunk/src/mess/drivers/modellot.c
r25442r25443
1/***************************************************************************
1/**********************************************************************************
22
3        General Processor Modello T
3    General Processor Modello T
44
5        10/12/2012 Skeleton driver.
5    2012-12-10 Skeleton driver.
6    2013-09-27 Added keyboard and cursor.
67
7****************************************************************************/
8    Made in Italy, a single board with numerous small daughter boards.
9    The 3 units (keyboard, disk drives, main unit) had wooden cabinets.
10    It had an inbuilt small green-screen CRT, like a Kaypro, and the RAM could
11    be 16, 32, or 48k. The FDC is a FD1791.
812
13    All the articles and doco (what there is of it) is all in Italian.
14       
15***********************************************************************************/
16
917#include "emu.h"
1018#include "cpu/z80/z80.h"
19#include "machine/keyboard.h"
1120
1221
1322class modellot_state : public driver_device
1423{
1524public:
1625   modellot_state(const machine_config &mconfig, device_type type, const char *tag)
17      : driver_device(mconfig, type, tag),
18         m_maincpu(*this, "maincpu") ,
19         m_video_ram(*this, "video_ram")
26      : driver_device(mconfig, type, tag)
27      , m_p_videoram(*this, "videoram")
28      , m_maincpu(*this, "maincpu")
2029      { }
2130
22   required_device<cpu_device> m_maincpu;
23   required_shared_ptr<UINT8> m_video_ram;
31   DECLARE_READ8_MEMBER(port77_r);
32   DECLARE_READ8_MEMBER(portff_r);
33   DECLARE_WRITE8_MEMBER(kbd_put);
2434   UINT32 screen_update_modellot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
25
35   required_shared_ptr<UINT8> m_p_videoram;
36private:
37   UINT8 m_term_data;
38   const UINT8 *m_p_chargen;
2639   virtual void machine_reset();
27
28   DECLARE_READ8_MEMBER(modellot_77);
29   DECLARE_READ8_MEMBER(modellot_ff);
40   required_device<cpu_device> m_maincpu;
3041};
3142
3243static ADDRESS_MAP_START(modellot_mem, AS_PROGRAM, 8, modellot_state)
3344   ADDRESS_MAP_UNMAP_HIGH
34   AM_RANGE(0x0000, 0xbfff) AM_RAM
35   AM_RANGE(0xc000, 0xc3ff) AM_RAM AM_SHARE("video_ram")
45   AM_RANGE(0x0000, 0xbfff) AM_RAM // 48k ram
46   AM_RANGE(0xc000, 0xc3ff) AM_RAM AM_SHARE("videoram")
3647   AM_RANGE(0xe000, 0xffff) AM_ROM
3748ADDRESS_MAP_END
3849
3950static ADDRESS_MAP_START(modellot_io, AS_IO, 8, modellot_state)
4051   ADDRESS_MAP_UNMAP_HIGH
4152   ADDRESS_MAP_GLOBAL_MASK(0xff)
42   AM_RANGE(0x77, 0x77) AM_READ(modellot_77)
43   AM_RANGE(0xff, 0xff) AM_READ(modellot_ff)
53   AM_RANGE(0x77, 0x77) AM_READ(port77_r)
54   AM_RANGE(0xff, 0xff) AM_READ(portff_r)
4455ADDRESS_MAP_END
4556
4657
r25442r25443
4859static INPUT_PORTS_START( modellot )
4960INPUT_PORTS_END
5061
51READ8_MEMBER( modellot_state::modellot_77)
62READ8_MEMBER( modellot_state::port77_r)
5263{
53   return 0x04;
64   return 4;
5465}
5566
56READ8_MEMBER( modellot_state::modellot_ff)
67READ8_MEMBER( modellot_state::portff_r)
5768{
58   return 0x00;
69   UINT8 data = (m_term_data) ? m_term_data ^ 0x7f : 0xff;
70   m_term_data = 0;
71   return data;
5972}
6073
74WRITE8_MEMBER( modellot_state::kbd_put )
75{
76   m_term_data = data;
77}
78
79static ASCII_KEYBOARD_INTERFACE( keyboard_intf )
80{
81   DEVCB_DRIVER_MEMBER(modellot_state, kbd_put)
82};
83
6184void modellot_state::machine_reset()
6285{
86   m_term_data = 1;
87   m_p_chargen = memregion("chargen")->base();
6388   m_maincpu->set_state_int(Z80_PC, 0xe000);
6489}
6590
r25442r25443
82107
83108UINT32 modellot_state::screen_update_modellot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
84109{
85   int x,y;
110   UINT8 y,ra,chr,gfx,inv;
111   UINT16 sy=0,ma=0,x;
86112
87   for(y = 0; y < 16; y++ )
113   for (y = 0; y < 16; y++)
88114   {
89      for(x = 0; x < 64; x++ )
115      for (ra = 0; ra < 16; ra++)
90116      {
91         int code = m_video_ram[x + y*64];
92         drawgfx_opaque(bitmap, cliprect, machine().gfx[0], code, 0, 0, 0, x*8, y*16);
117         UINT16 *p = &bitmap.pix16(sy++);
118
119         for (x = 0; x < 64; x++)
120         {
121            inv = 0;
122
123            chr = m_p_videoram[x+ma];
124
125            if BIT(chr, 7) inv = 0xff;
126
127            chr &= 0x7f; // cursor
128
129            if (ra < 8)
130               gfx = m_p_chargen[(chr<<3) | ra ];
131            else
132               gfx = m_p_chargen[(chr<<3) | (ra-8) | 0x400];
133
134            gfx ^= inv;
135
136            /* Display a scanline of a character */
137            *p++ = BIT(gfx, 7);
138            *p++ = BIT(gfx, 6);
139            *p++ = BIT(gfx, 5);
140            *p++ = BIT(gfx, 4);
141            *p++ = BIT(gfx, 3);
142            *p++ = BIT(gfx, 2);
143            *p++ = BIT(gfx, 1);
144            *p++ = BIT(gfx, 0);
145         }
93146      }
147      ma+=64;
94148   }
95149   return 0;
96150}
r25442r25443
108162   MCFG_SCREEN_SIZE(64*8, 16*16)
109163   MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 16*16-1)
110164   MCFG_SCREEN_UPDATE_DRIVER(modellot_state, screen_update_modellot)
111
112165   MCFG_GFXDECODE( modellot )
166   MCFG_PALETTE_LENGTH(2)
167   MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
113168
114   MCFG_PALETTE_LENGTH(2)
115   MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
169   /* Devices */
170   MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf)
116171MACHINE_CONFIG_END
117172
118173/* ROM definition */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team