trunk/src/mame/video/decodmd2.c
| r23968 | r23969 | |
| 51 | 51 | { |
| 52 | 52 | UINT8 ret = 0x00; |
| 53 | 53 | |
| 54 | | ret = (m_status & 0x03) << 3; |
| 54 | ret = (m_status & 0x0f) << 3; |
| 55 | 55 | |
| 56 | 56 | if(m_busy) |
| 57 | 57 | return 0x80 | ret; |
| r23968 | r23969 | |
| 77 | 77 | m_ctrl = data; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | READ8_MEMBER( decodmd_type2_device::ctrl_r ) |
| 81 | { |
| 82 | return m_ctrl; |
| 83 | } |
| 84 | |
| 80 | 85 | READ8_MEMBER( decodmd_type2_device::status_r ) |
| 81 | 86 | { |
| 82 | 87 | return m_status; |
| r23968 | r23969 | |
| 92 | 97 | m_cpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE); |
| 93 | 98 | } |
| 94 | 99 | |
| 100 | MC6845_UPDATE_ROW( dmd_update_row ) |
| 101 | { |
| 102 | decodmd_type2_device *state = downcast<decodmd_type2_device *>(device->owner()); |
| 103 | UINT8* RAM = state->m_ram->pointer(); |
| 104 | UINT8 x,dot,intensity; |
| 105 | UINT16 addr = (ma & 0xfc00) + ((ma & 0x100)<<2) + (ra << 4); |
| 106 | |
| 107 | for(x=0;x<128;x+=8) |
| 108 | { |
| 109 | for(dot=0;dot<8;dot++) |
| 110 | { |
| 111 | intensity = (RAM[addr] >> (7-dot) & 0x01) | ((RAM[addr+0x200] >> (7-dot) & 0x01) << 1); |
| 112 | bitmap.pix32(y,x+dot) = MAKE_RGB(0x3f*intensity,0x2a*intensity,0x00); |
| 113 | } |
| 114 | addr++; |
| 115 | } |
| 116 | } |
| 117 | |
| 95 | 118 | MC6845_INTERFACE( decodmd2_6845_intf ) |
| 96 | 119 | { |
| 97 | 120 | NULL, /* screen name */ |
| 98 | 121 | false, /* show border area */ |
| 99 | | 16, /* number of pixels per video memory address */ |
| 122 | 8, /* number of pixels per video memory address */ |
| 100 | 123 | NULL, /* begin_update */ |
| 101 | | NULL, /* update_row */ |
| 124 | dmd_update_row, /* update_row */ |
| 102 | 125 | NULL, /* end_update */ |
| 103 | 126 | DEVCB_NULL, /* on_de_changed */ |
| 104 | 127 | DEVCB_NULL, /* on_cur_changed */ |
| r23968 | r23969 | |
| 124 | 147 | |
| 125 | 148 | MCFG_QUANTUM_TIME(attotime::from_hz(60)) |
| 126 | 149 | |
| 127 | | MCFG_TIMER_DRIVER_ADD_PERIODIC("firq_timer",decodmd_type2_device,dmd_firq,attotime::from_hz(60)) |
| 150 | MCFG_TIMER_DRIVER_ADD_PERIODIC("firq_timer",decodmd_type2_device,dmd_firq,attotime::from_hz(80)) |
| 128 | 151 | |
| 129 | 152 | MCFG_MC6845_ADD("dmd6845",MC6845,XTAL_8MHz / 8,decodmd2_6845_intf) // TODO: confirm clock speed |
| 130 | 153 | |
| r23968 | r23969 | |
| 133 | 156 | MCFG_SCREEN_ADD("dmd",RASTER) |
| 134 | 157 | MCFG_SCREEN_SIZE(128, 32) |
| 135 | 158 | MCFG_SCREEN_VISIBLE_AREA(0, 128-1, 0, 32-1) |
| 136 | | MCFG_SCREEN_UPDATE_DRIVER(decodmd_type2_device, screen_update) |
| 159 | MCFG_SCREEN_UPDATE_DEVICE("dmd6845",mc6845_device, screen_update) |
| 137 | 160 | MCFG_SCREEN_REFRESH_RATE(60) |
| 138 | 161 | |
| 139 | 162 | MCFG_RAM_ADD(RAM_TAG) |
| r23968 | r23969 | |
| 191 | 214 | m_romregion = NULL; |
| 192 | 215 | } |
| 193 | 216 | } |
| 194 | | |
| 195 | | UINT32 decodmd_type2_device::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) |
| 196 | | { |
| 197 | | UINT16 addr = (START_ADDRESS & 0xfc00) | ((START_ADDRESS & 0x1ff) << 2); |
| 198 | | UINT8* RAM = m_ram->pointer(); |
| 199 | | UINT8 x,y,dot,intensity; |
| 200 | | |
| 201 | | for(y=0;y<bitmap.height();y++) |
| 202 | | { |
| 203 | | for(x=0;x<bitmap.width();x+=8) |
| 204 | | { |
| 205 | | for(dot=0;dot<8;dot++) |
| 206 | | { |
| 207 | | intensity = (RAM[addr] >> (7-dot) & 0x01) | ((RAM[addr+0x200] >> (7-dot) & 0x01) << 1); |
| 208 | | bitmap.pix32(y,x+dot) = MAKE_RGB(0x3f*intensity,0x2a*intensity,0x00); |
| 209 | | } |
| 210 | | addr++; |
| 211 | | } |
| 212 | | } |
| 213 | | |
| 214 | | return 0; |
| 215 | | } |