trunk/src/emu/video/m50458.c
r17517 | r17518 | |
21 | 21 | static ADDRESS_MAP_START( m50458_vram, AS_0, 16, m50458_device ) |
22 | 22 | AM_RANGE(0x0000, 0x023f) AM_RAM // vram |
23 | 23 | AM_RANGE(0x0240, 0x0241) AM_WRITE(vreg_120_w) |
| 24 | // AM_RANGE(0x0242, 0x0243) AM_WRITE(vreg_121_w) |
| 25 | AM_RANGE(0x0244, 0x0245) AM_WRITE(vreg_122_w) |
| 26 | AM_RANGE(0x0246, 0x0247) AM_WRITE(vreg_123_w) |
24 | 27 | AM_RANGE(0x024c, 0x024d) AM_WRITE(vreg_126_w) |
25 | 28 | AM_RANGE(0x024e, 0x024f) AM_WRITE(vreg_127_w) |
26 | 29 | ADDRESS_MAP_END |
r17517 | r17518 | |
36 | 39 | // printf("%04x\n",data); |
37 | 40 | } |
38 | 41 | |
| 42 | WRITE16_MEMBER( m50458_device::vreg_122_w) |
| 43 | { |
| 44 | // printf("%04x\n",data); |
| 45 | } |
| 46 | |
| 47 | WRITE16_MEMBER( m50458_device::vreg_123_w) |
| 48 | { |
| 49 | /* fractional part of vertical scrolling */ |
| 50 | m_scrf = data & 0x1f; |
| 51 | |
| 52 | m_space = (data & 0x60) >> 5; |
| 53 | |
| 54 | /* char part of vertical scrolling */ |
| 55 | m_scrr = (data & 0x0f00) >> 8; |
| 56 | |
| 57 | printf("%02x %02x %02x\n",m_scrr,m_scrf,m_space); |
| 58 | } |
| 59 | |
39 | 60 | WRITE16_MEMBER( m50458_device::vreg_126_w) |
40 | 61 | { |
41 | 62 | /* Raster Color Setting */ |
r17517 | r17518 | |
168 | 189 | } |
169 | 190 | } |
170 | 191 | |
171 | | /* |
172 | | 0x7e: "JUST A MOMENT" |
173 | | 0x81: "NON SLOT" |
174 | | */ |
175 | 192 | |
176 | 193 | WRITE_LINE_MEMBER( m50458_device::set_clock_line ) |
177 | 194 | { |
r17517 | r17518 | |
194 | 211 | break; |
195 | 212 | case OSD_SET_DATA: |
196 | 213 | //if(m_osd_addr >= 0x120) |
197 | | //printf("%04x %04x\n",m_osd_addr,m_current_cmd); |
| 214 | printf("%04x %04x\n",m_osd_addr,m_current_cmd); |
198 | 215 | write_word(m_osd_addr,m_current_cmd); |
199 | 216 | m_osd_addr++; |
200 | 217 | /* Presumably wraps at 0x127? */ |
r17517 | r17518 | |
225 | 242 | bg_b = m_phase & 4 ? 0xdf : 0; |
226 | 243 | bitmap.fill(MAKE_ARGB(0xff,bg_r,bg_g,bg_b),cliprect); |
227 | 244 | |
| 245 | |
228 | 246 | for(y=0;y<12;y++) |
229 | 247 | { |
230 | 248 | for(x=0;x<24;x++) |
231 | 249 | { |
232 | 250 | int xi,yi; |
233 | 251 | UINT16 tile; |
| 252 | int y_base = y; |
234 | 253 | |
235 | | tile = read_word(x+y*24); |
| 254 | /* TODO: needs improvements */ |
| 255 | if(y != 0 && m_scrr) |
| 256 | y_base+=(m_scrr - 1); |
236 | 257 | |
| 258 | if(y != 0 && y_base == 0) |
| 259 | y_base ++; |
| 260 | |
| 261 | if(y_base >= 12) |
| 262 | y_base -= 11; |
| 263 | |
| 264 | |
| 265 | tile = read_word(x+y_base*24); |
| 266 | |
237 | 267 | for(yi=0;yi<18;yi++) |
238 | 268 | { |
239 | 269 | for(xi=4;xi<16;xi++) /* TODO: remove 4 / 16 / -4 offset once that the ROM is fixed */ |