Previous 199869 Revisions Next

r20491 Saturday 26th January, 2013 at 14:57:12 UTC by Robbbert
(MESS) Osi tag cleanup (nw)
[src/mess/drivers]osi.c
[src/mess/includes]osi.h
[src/mess/video]osi.c

trunk/src/mess/drivers/osi.c
r20490r20491
261261
262262READ8_MEMBER( sb2m600_state::keyboard_r )
263263{
264   if (ioport("Reset")->read())
265      machine().device(M6502_TAG)->reset();
264   if (m_io_reset->read())
265      m_maincpu->reset();
266266
267   static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7" };
268
269267   UINT8 data = 0xff;
270   int bit;
271268
272   for (bit = 0; bit < 8; bit++)
273   {
274      if (!BIT(m_keylatch, bit)) data &= ioport(keynames[bit])->read();
275   }
269   if (!BIT(m_keylatch, 0))
270      data &= m_io_row0->read();
271   if (!BIT(m_keylatch, 1))
272      data &= m_io_row1->read();
273   if (!BIT(m_keylatch, 2))
274      data &= m_io_row2->read();
275   if (!BIT(m_keylatch, 3))
276      data &= m_io_row3->read();
277   if (!BIT(m_keylatch, 4))
278      data &= m_io_row4->read();
279   if (!BIT(m_keylatch, 5))
280      data &= m_io_row5->read();
281   if (!BIT(m_keylatch, 6))
282      data &= m_io_row6->read();
283   if (!BIT(m_keylatch, 7))
284      data &= m_io_row7->read();
276285
277286   return data;
278287}
r20490r20491
281290{
282291   m_keylatch = data;
283292
284   if (ioport("Sound")->read())
293   if (m_io_sound->read())
285294      discrete_sound_w(m_discrete, space, NODE_01, (data >> 2) & 0x0f);
286295}
287296
trunk/src/mess/includes/osi.h
r20490r20491
3030public:
3131   sb2m600_state(const machine_config &mconfig, device_type type, const char *tag)
3232      : driver_device(mconfig, type, tag),
33         m_maincpu(*this, M6502_TAG),
34         m_cassette(*this, CASSETTE_TAG),
35         m_discrete(*this, DISCRETE_TAG),
36         m_ram(*this, RAM_TAG),
37         m_video_ram(*this, "video_ram"),
38         m_color_ram(*this, "color_ram")
33   m_maincpu(*this, M6502_TAG),
34   m_cassette(*this, CASSETTE_TAG),
35   m_discrete(*this, DISCRETE_TAG),
36   m_ram(*this, RAM_TAG),
37   m_video_ram(*this, "video_ram"),
38   m_color_ram(*this, "color_ram"),
39   m_io_row0(*this, "ROW0"),
40   m_io_row1(*this, "ROW1"),
41   m_io_row2(*this, "ROW2"),
42   m_io_row3(*this, "ROW3"),
43   m_io_row4(*this, "ROW4"),
44   m_io_row5(*this, "ROW5"),
45   m_io_row6(*this, "ROW6"),
46   m_io_row7(*this, "ROW7"),
47   m_io_sound(*this, "Sound"),
48   m_io_reset(*this, "Reset")
3949   { }
4050
41   required_device<cpu_device> m_maincpu;
42   required_device<cassette_image_device> m_cassette;
43   optional_device<discrete_sound_device> m_discrete;
44   required_device<ram_device> m_ram;
45
4651   virtual void machine_start();
47
4852   virtual void video_start();
4953   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
50
5154   DECLARE_READ8_MEMBER( keyboard_r );
5255   DECLARE_WRITE8_MEMBER( keyboard_w );
5356   DECLARE_WRITE8_MEMBER( ctrl_w );
r20490r20491
6063   /* video state */
6164   int m_32;
6265   int m_coloren;
63   required_shared_ptr<UINT8> m_video_ram;
64   optional_shared_ptr<UINT8> m_color_ram;
66   UINT8 *m_p_chargen;
6567
6668   /* floppy state */
6769   int m_fdc_index;
6870   TIMER_CALLBACK_MEMBER(setup_beep);
6971   DECLARE_WRITE_LINE_MEMBER(osi470_index_callback);
72
73   required_device<cpu_device> m_maincpu;
74   required_device<cassette_image_device> m_cassette;
75   optional_device<discrete_sound_device> m_discrete;
76   required_device<ram_device> m_ram;
77   required_shared_ptr<UINT8> m_video_ram;
78   optional_shared_ptr<UINT8> m_color_ram;
79   required_ioport m_io_row0;
80   required_ioport m_io_row1;
81   required_ioport m_io_row2;
82   required_ioport m_io_row3;
83   required_ioport m_io_row4;
84   required_ioport m_io_row5;
85   required_ioport m_io_row6;
86   required_ioport m_io_row7;
87   required_ioport m_io_sound;
88   required_ioport m_io_reset;
7089};
7190
7291class c1p_state : public sb2m600_state
trunk/src/mess/video/osi.c
r20490r20491
2323
2424void sb2m600_state::video_start()
2525{
26   m_p_chargen = memregion("chargen")->base();
2627   UINT16 addr;
2728
2829   /* randomize video memory contents */
2930   for (addr = 0; addr < OSI600_VIDEORAM_SIZE; addr++)
30   {
3131      m_video_ram[addr] = machine().rand() & 0xff;
32   }
3332
3433   /* randomize color memory contents */
3534   if (m_color_ram)
36   {
3735      for (addr = 0; addr < OSI630_COLORRAM_SIZE; addr++)
38      {
3936         m_color_ram[addr] = machine().rand() & 0x0f;
40      }
41   }
4237}
4338
4439/* Video Update */
r20490r20491
5954         {
6055            UINT8 videoram_data = m_video_ram[videoram_addr];
6156            UINT16 charrom_addr = ((videoram_data << 3) | line) & 0x7ff;
62            UINT8 charrom_data = memregion("chargen")->base()[charrom_addr];
57            UINT8 charrom_data = m_p_chargen[charrom_addr];
6358
6459            for (bit = 0; bit < 8; bit++)
6560            {
66               int color = BIT(charrom_data, 7);
61               bool color = BIT(charrom_data, 7);
6762
6863               if (m_coloren)
6964               {
r20490r20491
9287         {
9388            UINT8 videoram_data = m_video_ram[videoram_addr];
9489            UINT16 charrom_addr = ((videoram_data << 3) | line) & 0x7ff;
95            UINT8 charrom_data = memregion("chargen")->base()[charrom_addr];
90            UINT8 charrom_data = m_p_chargen[charrom_addr];
9691
9792            for (bit = 0; bit < 8; bit++)
9893            {
99               int color = BIT(charrom_data, 7);
94               bool color = BIT(charrom_data, 7);
10095
10196               if (m_coloren)
10297               {
r20490r20491
132127      {
133128         UINT8 videoram_data = m_video_ram[videoram_addr++];
134129         UINT16 charrom_addr = ((videoram_data << 3) | line) & 0x7ff;
135         UINT8 charrom_data = memregion("chargen")->base()[charrom_addr];
130         UINT8 charrom_data = m_p_chargen[charrom_addr];
136131
137132         for (bit = 0; bit < 8; bit++)
138133         {

Previous 199869 Revisions Next


© 1997-2024 The MAME Team