Previous 199869 Revisions Next

r25493 Wednesday 2nd October, 2013 at 12:56:06 UTC by Robbbert
(MESS) delete unused files (nw)
[src/mess/includes]sapi1.h
[src/mess/machine]sapi1.c
[src/mess/video]sapi1.c

trunk/src/mess/machine/sapi1.c
r25492r25493
1/***************************************************************************
2
3        SAPI-1 driver by Miodrag Milanovic
4
5        09/09/2008 Preliminary driver.
6
7****************************************************************************/
8
9#include "includes/sapi1.h"
10
11
12/* Driver initialization */
13DRIVER_INIT_MEMBER(sapi1_state,sapi1)
14{
15}
16
17MACHINE_RESET_MEMBER(sapi1_state,sapi1)
18{
19   m_keyboard_mask = 0;
20}
21
22MACHINE_START_MEMBER(sapi1_state,sapi1)
23{
24}
25
26READ8_MEMBER( sapi1_state::sapi1_keyboard_r )
27{
28   UINT8 key = 0xff;
29   if (BIT(m_keyboard_mask, 0)) { key &= m_line0->read(); }
30   if (BIT(m_keyboard_mask, 1)) { key &= m_line1->read(); }
31   if (BIT(m_keyboard_mask, 2)) { key &= m_line2->read(); }
32   if (BIT(m_keyboard_mask, 3)) { key &= m_line3->read(); }
33   if (BIT(m_keyboard_mask, 4)) { key &= m_line4->read(); }
34   return key;
35}
36
37WRITE8_MEMBER( sapi1_state::sapi1_keyboard_w )
38{
39   m_keyboard_mask = (data ^ 0xff ) & 0x1f;
40}
41
42
43MACHINE_RESET_MEMBER(sapi1_state,sapizps3)
44{
45   m_keyboard_mask = 0;
46   m_bank1->set_entry(1);
47}
48
49DRIVER_INIT_MEMBER(sapi1_state,sapizps3)
50{
51   UINT8 *RAM = memregion("maincpu")->base();
52   m_bank1->configure_entries(0, 2, &RAM[0x0000], 0xf800);
53}
trunk/src/mess/video/sapi1.c
r25492r25493
1/***************************************************************************
2
3        SAPI-1 driver by Miodrag Milanovic
4
5        09/09/2008 Preliminary driver.
6
7****************************************************************************/
8
9
10#include "includes/sapi1.h"
11
12static const UINT8 MHB2501[] = {
13   0x0c,0x11,0x13,0x15,0x17,0x10,0x0e,0x00, // @
14   0x04,0x0a,0x11,0x11,0x1f,0x11,0x11,0x00, // A
15   0x1e,0x11,0x11,0x1e,0x11,0x11,0x1e,0x00, // B
16   0x0e,0x11,0x10,0x10,0x10,0x11,0x0e,0x00, // C
17   0x1e,0x09,0x09,0x09,0x09,0x09,0x1e,0x00, // D
18   0x1f,0x10,0x10,0x1e,0x10,0x10,0x1f,0x00, // E
19   0x1f,0x10,0x10,0x1e,0x10,0x10,0x10,0x00, // F
20   0x0e,0x11,0x10,0x10,0x13,0x11,0x0f,0x00, // G
21
22   0x11,0x11,0x11,0x1f,0x11,0x11,0x11,0x00, // H
23   0x0e,0x04,0x04,0x04,0x04,0x04,0x0e,0x00, // I
24   0x01,0x01,0x01,0x01,0x11,0x11,0x0e,0x00, // J
25   0x11,0x12,0x14,0x18,0x14,0x12,0x11,0x00, // K
26   0x10,0x10,0x10,0x10,0x10,0x10,0x1f,0x00, // L
27   0x11,0x1b,0x15,0x15,0x11,0x11,0x11,0x00, // M
28   0x11,0x11,0x19,0x15,0x13,0x11,0x11,0x00, // N
29   0x0e,0x11,0x11,0x11,0x11,0x11,0x0e,0x00, // O
30
31   0x1e,0x11,0x11,0x1e,0x10,0x10,0x10,0x00, // P
32   0x0e,0x11,0x11,0x11,0x15,0x12,0x0d,0x00, // Q
33   0x1e,0x11,0x11,0x1e,0x14,0x12,0x11,0x00, // R
34   0x0e,0x11,0x10,0x0e,0x01,0x11,0x0e,0x00, // S
35   0x1f,0x04,0x04,0x04,0x04,0x04,0x04,0x00, // T
36   0x11,0x11,0x11,0x11,0x11,0x11,0x0e,0x00, // U
37   0x11,0x11,0x11,0x0a,0x0a,0x04,0x04,0x00, // V
38   0x11,0x11,0x11,0x15,0x15,0x15,0x0a,0x00, // W
39
40   0x11,0x11,0x0a,0x04,0x0a,0x11,0x11,0x00, // X
41   0x11,0x11,0x0a,0x04,0x04,0x04,0x04,0x00, // Y
42   0x1f,0x01,0x02,0x04,0x08,0x10,0x1f,0x00, // Z
43   0x1c,0x10,0x10,0x10,0x10,0x10,0x1c,0x00, // [
44   0x00,0x10,0x08,0x04,0x02,0x01,0x00,0x00, // backslash
45   0x07,0x01,0x01,0x01,0x01,0x01,0x07,0x00, // ]
46   0x0e,0x11,0x00,0x00,0x00,0x00,0x00,0x00, // ^
47   0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x00, // _
48
49   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //
50   0x04,0x04,0x04,0x04,0x04,0x00,0x04,0x00, // !
51   0x0a,0x0a,0x0a,0x00,0x00,0x00,0x00,0x00, // "
52   0x0a,0x0a,0x1f,0x0a,0x1f,0x0a,0x0a,0x00, // #
53   0x00,0x11,0x0e,0x0a,0x0e,0x11,0x00,0x00, //
54   0x18,0x19,0x02,0x04,0x08,0x13,0x03,0x00, // %
55   0x04,0x0a,0x0a,0x0c,0x15,0x12,0x0d,0x00, // &
56   0x04,0x04,0x08,0x00,0x00,0x00,0x00,0x00, // '
57
58   0x02,0x04,0x08,0x08,0x08,0x04,0x02,0x00, // (
59   0x08,0x04,0x02,0x02,0x02,0x04,0x08,0x00, // )
60   0x00,0x04,0x15,0x0e,0x15,0x04,0x00,0x00, // *
61   0x00,0x04,0x04,0x1f,0x04,0x04,0x00,0x00, // +
62   0x00,0x00,0x00,0x00,0x08,0x08,0x10,0x00, // ,
63   0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x00, // -
64   0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00, // .
65   0x00,0x01,0x02,0x04,0x08,0x10,0x00,0x00, // /
66
67   0x0e,0x11,0x13,0x15,0x19,0x11,0x0e,0x00, // 0
68   0x04,0x0c,0x04,0x04,0x04,0x04,0x0e,0x00, // 1
69   0x0e,0x11,0x01,0x06,0x08,0x10,0x1f,0x00, // 2
70   0x1f,0x01,0x02,0x06,0x01,0x11,0x0e,0x00, // 3
71   0x02,0x06,0x0a,0x12,0x1f,0x02,0x02,0x00, // 4
72   0x1f,0x10,0x1e,0x01,0x01,0x11,0x0e,0x00, // 5
73   0x07,0x08,0x10,0x1e,0x11,0x11,0x0e,0x00, // 6
74   0x1f,0x01,0x02,0x04,0x08,0x08,0x08,0x00, // 7
75
76   0x0e,0x11,0x11,0x0e,0x11,0x11,0x0e,0x00, // 8
77   0x0e,0x11,0x11,0x0f,0x01,0x02,0x1c,0x00, // 9
78   0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x00, // :
79   0x00,0x00,0x04,0x00,0x04,0x04,0x08,0x00, // ;
80   0x02,0x04,0x08,0x10,0x08,0x04,0x02,0x00, // <
81   0x00,0x00,0x1f,0x00,0x1f,0x00,0x00,0x00, // =
82   0x08,0x04,0x02,0x01,0x02,0x04,0x08,0x00, // >
83   0x0e,0x11,0x01,0x02,0x04,0x00,0x04,0x00  // ?
84};
85
86
87VIDEO_START_MEMBER(sapi1_state,sapi1)
88{
89   m_refresh_counter = 0;
90}
91
92UINT32 sapi1_state::screen_update_sapi1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
93{
94   int x,y,j,b;
95   UINT16 addr;
96   int xpos;
97
98   for(y = 0; y < 24; y++ )
99   {
100      addr = y*64;
101      xpos = 0;
102      for(x = 0; x < 40; x++ )
103      {
104         UINT8 code = m_sapi_video_ram[addr + x];
105         UINT8 attr = (code >> 6) & 3;
106         code &= 0x3f;
107         for(j = 0; j < 9; j++ )
108         {
109            for(b = 0; b < 6; b++ )
110            {
111               UINT8 val;
112               if (j==8) {
113                  if (attr==2) {
114                     val = (m_refresh_counter & 0x20) ? 1 : 0;
115                  } else {
116                     val = 0;
117                  }
118               } else {
119                  val = (MHB2501[code*8 + j] >> (5-b)) & 1;
120                  if (attr==1) {
121                     val = (m_refresh_counter & 0x20) ? val : 0;
122                  }
123               }
124               if(attr==3) {
125                  bitmap.pix16(y*9+j, xpos+2*b   ) = val;
126                  bitmap.pix16(y*9+j, xpos+2*b+1 ) = val;
127               } else {
128                  bitmap.pix16(y*9+j, xpos+b ) = val;
129               }
130            }
131         }
132         xpos+= (attr==3) ? 12 : 6;
133         if (xpos>=6*40) break;
134      }
135   }
136   m_refresh_counter++;
137   return 0;
138}
139
140
141VIDEO_START_MEMBER(sapi1_state,sapizps3)
142{
143}
144
145UINT32 sapi1_state::screen_update_sapizps3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
146{
147   return 0;
148}
trunk/src/mess/includes/sapi1.h
r25492r25493
1/*****************************************************************************
2 *
3 * includes/sapi1.h
4 *
5 ****************************************************************************/
6
7#ifndef SAPI_1_H_
8#define SAPI_1_H_
9
10#include "emu.h"
11#include "cpu/i8085/i8085.h"
12#include "cpu/z80/z80.h"
13#include "machine/ram.h"
14#include "machine/keyboard.h"
15#include "machine/terminal.h"
16
17
18class sapi1_state : public driver_device
19{
20public:
21   sapi1_state(const machine_config &mconfig, device_type type, const char *tag)
22      : driver_device(mconfig, type, tag),
23      m_sapi_video_ram(*this, "sapi_video_ram"),
24      m_bank1(*this, "bank1"),
25      m_line0(*this, "LINE0"),
26      m_line1(*this, "LINE1"),
27      m_line2(*this, "LINE2"),
28      m_line3(*this, "LINE3"),
29      m_line4(*this, "LINE4") ,
30      m_maincpu(*this, "maincpu") { }
31
32   required_shared_ptr<UINT8> m_sapi_video_ram;
33   UINT8 m_keyboard_mask;
34   UINT8 m_refresh_counter;
35   UINT8 m_zps3_25;
36   DECLARE_READ8_MEMBER(sapi1_keyboard_r);
37   DECLARE_WRITE8_MEMBER(sapi1_keyboard_w);
38   DECLARE_READ8_MEMBER(sapi2_keyboard_status_r);
39   DECLARE_READ8_MEMBER(sapi2_keyboard_data_r);
40   DECLARE_WRITE8_MEMBER(sapi3_00_w);
41   DECLARE_READ8_MEMBER(sapi3_25_r);
42   DECLARE_WRITE8_MEMBER(sapi3_25_w);
43   DECLARE_WRITE8_MEMBER(kbd_put);
44   UINT8 m_term_data;
45   DECLARE_DRIVER_INIT(sapi1);
46   DECLARE_DRIVER_INIT(sapizps3);
47   DECLARE_MACHINE_START(sapi1);
48   DECLARE_MACHINE_RESET(sapi1);
49   DECLARE_VIDEO_START(sapi1);
50   DECLARE_MACHINE_RESET(sapizps3);
51   DECLARE_VIDEO_START(sapizps3);
52   UINT32 screen_update_sapi1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
53   UINT32 screen_update_sapizps3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
54
55protected:
56   optional_memory_bank m_bank1;   // Only for sapi3
57   required_ioport m_line0;
58   required_ioport m_line1;
59   required_ioport m_line2;
60   required_ioport m_line3;
61   required_ioport m_line4;
62   required_device<cpu_device> m_maincpu;
63};
64
65#endif

Previous 199869 Revisions Next


© 1997-2024 The MAME Team