trunk/src/mame/drivers/nss.c
r17546 | r17547 | |
844 | 844 | state->m_joy_flag = 1; |
845 | 845 | } |
846 | 846 | |
| 847 | static M50458_INTERFACE( m50458_intf ) |
| 848 | { |
| 849 | "osd" |
| 850 | }; |
| 851 | |
847 | 852 | static MACHINE_CONFIG_DERIVED( nss, snes ) |
848 | 853 | |
849 | 854 | MCFG_CPU_ADD("bios", Z80, 4000000) |
r17546 | r17547 | |
851 | 856 | MCFG_CPU_IO_MAP(bios_io_map) |
852 | 857 | MCFG_CPU_VBLANK_INT("screen", nss_vblank_irq) |
853 | 858 | |
854 | | MCFG_M50458_ADD("m50458",4000000) /* TODO: clock */ |
| 859 | MCFG_M50458_ADD("m50458",m50458_intf,4000000) /* TODO: clock */ |
855 | 860 | MCFG_S3520CF_ADD("s3520cf") /* RTC */ |
856 | 861 | MCFG_RP5H01_ADD("rp5h01") |
857 | 862 | MCFG_M6M80011AP_ADD("m6m80011ap") |
trunk/src/emu/video/m50458.c
r17546 | r17547 | |
32 | 32 | AM_RANGE(0x0242, 0x0243) AM_WRITE(vreg_121_w) |
33 | 33 | AM_RANGE(0x0244, 0x0245) AM_WRITE(vreg_122_w) |
34 | 34 | AM_RANGE(0x0246, 0x0247) AM_WRITE(vreg_123_w) |
| 35 | AM_RANGE(0x0248, 0x0249) AM_WRITE(vreg_124_w) |
| 36 | AM_RANGE(0x024a, 0x024b) AM_WRITE(vreg_125_w) |
35 | 37 | AM_RANGE(0x024c, 0x024d) AM_WRITE(vreg_126_w) |
36 | 38 | AM_RANGE(0x024e, 0x024f) AM_WRITE(vreg_127_w) |
37 | 39 | ADDRESS_MAP_END |
r17546 | r17547 | |
86 | 88 | // printf("%02x %02x %02x\n",m_scrr,m_scrf,m_space); |
87 | 89 | } |
88 | 90 | |
| 91 | WRITE16_MEMBER( m50458_device::vreg_124_w) |
| 92 | { |
| 93 | |
| 94 | } |
| 95 | |
| 96 | WRITE16_MEMBER( m50458_device::vreg_125_w) |
| 97 | { |
| 98 | /* blinking cycle */ |
| 99 | m_blink = data & 4 ? 0x20 : 0x40; |
| 100 | } |
| 101 | |
89 | 102 | WRITE16_MEMBER( m50458_device::vreg_126_w) |
90 | 103 | { |
91 | 104 | /* Raster Color Setting */ |
r17546 | r17547 | |
175 | 188 | } |
176 | 189 | |
177 | 190 | |
| 191 | void m50458_device::device_config_complete() |
| 192 | { |
| 193 | // inherit a copy of the static data |
| 194 | const m50458_interface *intf = reinterpret_cast<const m50458_interface *>(static_config()); |
| 195 | if (intf != NULL) |
| 196 | *static_cast<m50458_interface *>(this) = *intf; |
| 197 | |
| 198 | // or initialize to defaults if none provided |
| 199 | else |
| 200 | { |
| 201 | // ... |
| 202 | } |
| 203 | } |
| 204 | |
178 | 205 | //------------------------------------------------- |
179 | 206 | // device_start - device-specific startup |
180 | 207 | //------------------------------------------------- |
r17546 | r17547 | |
222 | 249 | m_shadow_gfx[dst] |= (tmp >> 8); |
223 | 250 | } |
224 | 251 | } |
| 252 | |
| 253 | // find screen |
| 254 | m_screen = machine().device<screen_device>(m_screen_tag); |
| 255 | |
| 256 | if (m_screen == NULL) |
| 257 | { |
| 258 | m_screen = owner()->subdevice<screen_device>(m_screen_tag); |
| 259 | } |
225 | 260 | } |
226 | 261 | |
227 | 262 | |
r17546 | r17547 | |
236 | 271 | /* clear VRAM at boot */ |
237 | 272 | for(i=0;i<0x120;i++) |
238 | 273 | write_word(i,0x007f); |
| 274 | |
| 275 | m_blink = 0x40; |
239 | 276 | } |
240 | 277 | |
241 | 278 | |
r17546 | r17547 | |
338 | 375 | int res_y,res_x; |
339 | 376 | UINT8 xh,yh; |
340 | 377 | |
341 | | /* TODO: blinking, bit 7 (RTC test in NSS) */ |
342 | | |
343 | 378 | if(xi>=8) |
344 | 379 | pix = ((pcg[offset+1] >> (7-(xi & 0x7))) & 1) << 1; |
345 | 380 | else |
r17546 | r17547 | |
350 | 385 | else |
351 | 386 | pix |= ((m_shadow_gfx[offset+0] >> (7-(xi & 0x7))) & 1); |
352 | 387 | |
| 388 | /* blinking, VERY preliminary */ |
| 389 | if(tile & 0x800 && m_screen->frame_number() & m_blink) |
| 390 | pix = 0; |
| 391 | |
353 | 392 | if(yi == 17 && tile & 0x1000) /* underline? */ |
354 | 393 | pix |= 1; |
355 | 394 | |
trunk/src/emu/video/m50458.h
r17546 | r17547 | |
15 | 15 | // INTERFACE CONFIGURATION MACROS |
16 | 16 | //************************************************************************** |
17 | 17 | |
18 | | #define MCFG_M50458_ADD(_tag,_freq) \ |
| 18 | #define MCFG_M50458_ADD(_tag,_config,_freq) \ |
19 | 19 | MCFG_DEVICE_ADD(_tag, M50458,_freq) \ |
| 20 | MCFG_DEVICE_CONFIG(_config) \ |
20 | 21 | |
21 | 22 | |
| 23 | #define M50458_INTERFACE(name) \ |
| 24 | const m50458_interface (name) = |
| 25 | |
| 26 | |
22 | 27 | //************************************************************************** |
23 | 28 | // TYPE DEFINITIONS |
24 | 29 | //************************************************************************** |
r17546 | r17547 | |
29 | 34 | OSD_SET_DATA |
30 | 35 | } m50458_state_t; |
31 | 36 | |
| 37 | // ======================> upd7220_interface |
| 38 | |
| 39 | struct m50458_interface |
| 40 | { |
| 41 | const char *m_screen_tag; |
| 42 | }; |
| 43 | |
32 | 44 | // ======================> m50458_device |
33 | 45 | |
34 | 46 | class m50458_device : public device_t, |
35 | | public device_memory_interface |
| 47 | public device_memory_interface, |
| 48 | public m50458_interface |
36 | 49 | { |
37 | 50 | public: |
38 | 51 | // construction/destruction |
r17546 | r17547 | |
46 | 59 | DECLARE_WRITE16_MEMBER(vreg_121_w); |
47 | 60 | DECLARE_WRITE16_MEMBER(vreg_122_w); |
48 | 61 | DECLARE_WRITE16_MEMBER(vreg_123_w); |
| 62 | DECLARE_WRITE16_MEMBER(vreg_124_w); |
| 63 | DECLARE_WRITE16_MEMBER(vreg_125_w); |
49 | 64 | DECLARE_WRITE16_MEMBER(vreg_126_w); |
50 | 65 | DECLARE_WRITE16_MEMBER(vreg_127_w); |
51 | 66 | |
r17546 | r17547 | |
58 | 73 | virtual void device_start(); |
59 | 74 | virtual void device_reset(); |
60 | 75 | virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const; |
| 76 | virtual void device_config_complete(); |
61 | 77 | |
| 78 | screen_device *m_screen; |
| 79 | |
62 | 80 | int m_latch; |
63 | 81 | int m_reset_line; |
64 | 82 | int m_clock_line; |
r17546 | r17547 | |
73 | 91 | UINT8 m_space; |
74 | 92 | UINT8 m_hsz1,m_hsz2,m_hsz3; |
75 | 93 | UINT8 m_vsz1,m_vsz2,m_vsz3; |
| 94 | UINT8 m_blink; |
76 | 95 | |
77 | 96 | m50458_state_t m_osd_state; |
78 | 97 | |