Previous 15994 Revisions Next

r14293 Tuesday 31st January, 2012 at 16:39:30 UTC by Sandro Ronco
pda600: some minor adjustments. (no whatsnew)
[src/mess/drivers]pda600.c

src/mess/drivers/pda600.c
r14292r14293
5656
5757#include "emu.h"
5858#include "cpu/z180/z180.h"
59#include "machine/nvram.h"
60#include "rendlay.h"
5961
6062
6163class pda600_state : public driver_device
6264{
6365public:
6466   pda600_state(const machine_config &mconfig, device_type type, const char *tag)
65      : driver_device(mconfig, type, tag) { }
67      : driver_device(mconfig, type, tag),
68        m_maincpu(*this, "maincpu")
69      {}
6670
71   required_device<cpu_device> m_maincpu;
72
73   virtual void video_start();
74   virtual void machine_reset();
75   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
76
77   UINT8 *      m_video_ram;
6778};
6879
6980
7081static ADDRESS_MAP_START(pda600_mem, AS_PROGRAM, 8, pda600_state)
7182   ADDRESS_MAP_UNMAP_HIGH
7283   AM_RANGE(0x00000, 0x1ffff) AM_ROM
73   AM_RANGE(0x20000, 0x3ffff) AM_RAM
74   //AM_RANGE(0x90000, 0x92fff) AM_RAM // video ram
75   AM_RANGE(0xf0000, 0xfffff) AM_RAM
84   //AM_RANGE(0x20000, 0x9ffff) AM_RAM // PCMCIA Card
85   AM_RANGE(0xa0000, 0xa7fff) AM_RAM   AM_REGION("videoram", 0)
86   AM_RANGE(0xe0000, 0xfffff) AM_RAM   AM_REGION("mainram", 0)      AM_SHARE("nvram")
7687ADDRESS_MAP_END
7788
7889static ADDRESS_MAP_START(pda600_io, AS_IO, 8, pda600_state)
r14292r14293
90101INPUT_PORTS_END
91102
92103
93static MACHINE_RESET(pda600)
104void pda600_state::machine_reset()
94105{
106   // the PDA600 soon after start waits for something from the Z180 CSIO, I do not know exactly for what
107   // the CSIO is used and for now I forced the CNTR End-Flag bit to 1 for allow the emulation to continue.
108   cpu_set_reg(m_maincpu, Z180_CNTR, cpu_get_reg(m_maincpu, Z180_CNTR) | 0x80);
95109}
96110
97static VIDEO_START( pda600 )
111void pda600_state::video_start()
98112{
113   m_video_ram = machine().region("videoram")->base();
99114}
100115
101static SCREEN_UPDATE_IND16( pda600 )
116UINT32 pda600_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
102117{
118   for (int y=0; y<320; y++)
119      for (int x=0; x<30; x++)
120      {
121         UINT8 data = m_video_ram[y*30 + x];
122
123         for (int px=0; px<8; px++)
124         {
125            bitmap.pix16(y, (x * 8) + px) = BIT(data, 7);
126            data <<= 1;
127         }
128      }
129
103130   return 0;
104131}
105132
r14292r14293
172199   MCFG_CPU_PROGRAM_MAP(pda600_mem)
173200   MCFG_CPU_IO_MAP(pda600_io)
174201
175   MCFG_MACHINE_RESET(pda600)
176
177202   /* video hardware */
178203   MCFG_SCREEN_ADD("screen", RASTER)
179204   MCFG_SCREEN_REFRESH_RATE(50)
180205   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
181206   MCFG_SCREEN_SIZE(240, 320)
182207   MCFG_SCREEN_VISIBLE_AREA(0, 240-1, 0, 320-1)
183   MCFG_VIDEO_START(pda600)
184   MCFG_SCREEN_UPDATE_STATIC(pda600)
208   MCFG_SCREEN_UPDATE_DRIVER( pda600_state, screen_update )
185209   MCFG_GFXDECODE(pda600)
210   MCFG_DEFAULT_LAYOUT(layout_lcd)
186211   MCFG_PALETTE_LENGTH(2)
187212   MCFG_PALETTE_INIT(black_and_white)
213
214   // NVRAM needs to be filled with random data to fail the checksum and be initialized correctly
215   MCFG_NVRAM_ADD_RANDOM_FILL("nvram")
188216MACHINE_CONFIG_END
189217
190218/* ROM definition */
191219ROM_START( pda600 )
192220   ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASEFF )
193221   ROM_LOAD( "pdarom.bin", 0x00000, 0x20000, CRC(f793a6c5) SHA1(ab14b0fdcedb927c66357368a2bfff605ba758fb))
222
223   // 128KB RAM
224   ROM_REGION( 0x20000, "mainram", ROMREGION_ERASE )
225
226   // 32KB Video RAM
227   ROM_REGION( 0x8000, "videoram", ROMREGION_ERASE )
194228ROM_END
195229
196230/* Driver */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team