Previous 199869 Revisions Next

r33863 Saturday 13th December, 2014 at 22:27:15 UTC by R. Belmont
(MESS) hp16500b: main screen do what? (nw)
[src/mess/drivers]hp16500.c

trunk/src/mess/drivers/hp16500.c
r242374r242375
1/*
2    Hewlett-Packard HP16500b Logic Analyzer
1/***************************************************************************
2 
3   Hewlett-Packard HP16500b Logic Analyzer
34
45    MC68EC030 @ 25 MHz
56
r242374r242375
1516    IRQ 5 = 814a
1617    IRQ 6 = 35c8 (jump 840120)
1718    IRQ 7 = 35d4 (jump 840120)
18*/
1919
20****************************************************************************/
2021
2122#include "emu.h"
2223#include "cpu/m68000/m68000.h"
2324
24
2525class hp16500_state : public driver_device
2626{
2727public:
2828   hp16500_state(const machine_config &mconfig, device_type type, const char *tag)
29      : driver_device(mconfig, type, tag) ,
30      m_maincpu(*this, "maincpu") { }
29      : driver_device(mconfig, type, tag),
30      m_maincpu(*this, "maincpu"),
31      m_vram(*this, "vram")
32    { }                                     
3133
3234   virtual void video_start();
3335   UINT32 screen_update_hp16500(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
36
3437   required_device<cpu_device> m_maincpu;
38   required_shared_ptr<UINT32> m_vram;
39
40
41   DECLARE_WRITE32_MEMBER(palette_w);
42
43private:
44   UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs;
3545};
3646
37
3847static ADDRESS_MAP_START(hp16500_map, AS_PROGRAM, 32, hp16500_state)
3948   AM_RANGE(0x00000000, 0x0001ffff) AM_ROM AM_REGION("bios", 0)
40   AM_RANGE(0x00600000, 0x0063ffff) AM_RAM
49   AM_RANGE(0x0020f000, 0x0020f003) AM_WRITE(palette_w)
50   AM_RANGE(0x00600000, 0x0063ffff) AM_RAM AM_SHARE("vram")
4151   AM_RANGE(0x00800000, 0x009fffff) AM_RAM     // 284e end of test - d0 = 0 for pass
4252ADDRESS_MAP_END
4353
4454void hp16500_state::video_start()
4555{
56   m_count = 0;
57   m_clutoffs = 0;
58   memset(m_palette, 0, sizeof(m_palette));
4659}
4760
61WRITE32_MEMBER(hp16500_state::palette_w)
62{
63   if (mem_mask == 0xff000000)
64   {
65      m_clutoffs = (data>>24) & 0xff;
66   }
67   else if (mem_mask == 0x00ff0000)
68   {
69      UINT8 tmpcolor = (data>>16) & 0xff;
70
71      if ((tmpcolor & 0xf0) == 0x00)
72      {
73         tmpcolor |= (tmpcolor << 4);
74      }
75
76      m_colors[m_count++] = tmpcolor;
77
78      if (m_count == 3)
79      {
80         m_palette[m_clutoffs] = rgb_t(m_colors[0], m_colors[1], m_colors[2]);
81         m_clutoffs++;
82         if (m_clutoffs > 255)
83         {
84            m_clutoffs = 0;
85         }
86         m_count = 0;
87      }
88   }
89}
90
91// 4 bpp
92// addr = ((Y * 0xfc0) + 0x360) + (X * 4)
4893UINT32 hp16500_state::screen_update_hp16500(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
4994{
95   UINT32 *scanline;
96   int x, y;
97   UINT8 pixels;
98
99   for (y = 0; y < 400; y++)
100   {
101      scanline = &bitmap.pix32(y);
102
103      for (x = 0; x < 576/8; x++)
104      {
105         pixels = m_vram[(y * (288/4)) + x];
106
107         *scanline++ = m_palette[((pixels&0xf0000000)>>28)];
108         *scanline++ = m_palette[((pixels&0xf000000)>>24)];
109         *scanline++ = m_palette[((pixels&0xf00000)>>20)];
110         *scanline++ = m_palette[((pixels&0xf0000)>>16)];
111         *scanline++ = m_palette[((pixels&0xf000)>>12)];
112         *scanline++ = m_palette[((pixels&0xf00)>>8)];
113         *scanline++ = m_palette[((pixels&0xf0)>>4)];
114         *scanline++ = m_palette[(pixels&0xf)];
115      }
116   }
117
50118   return 0;
51119}
52120
r242374r242375
56124   MCFG_CPU_PROGRAM_MAP(hp16500_map)
57125
58126   MCFG_SCREEN_ADD("screen", RASTER)
59   MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480)
60   MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
61   MCFG_SCREEN_SIZE(1024, 768)
62   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
63127   MCFG_SCREEN_UPDATE_DRIVER(hp16500_state, screen_update_hp16500)
128   MCFG_SCREEN_SIZE(576,400)
129   MCFG_SCREEN_VISIBLE_AREA(0, 576-1, 0, 400-1)
130   MCFG_SCREEN_REFRESH_RATE(60)
64131
65   MCFG_PALETTE_ADD("palette", 256)
66
67
68132   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
69133MACHINE_CONFIG_END
70134


Previous 199869 Revisions Next


© 1997-2024 The MAME Team