trunk/src/mame/drivers/gunpey.c
| r21487 | r21488 | |
| 101 | 101 | checks if 0x5e62 is 0 (bit 6 of 0x5c80, i/o 0x7f41) |
| 102 | 102 | ... |
| 103 | 103 | 0x8474a: call 0xa7f53 sound init |
| 104 | ... |
| 104 | 105 | |
| 106 | |
| 107 | |
| 105 | 108 | ============================================================================================= |
| 106 | 109 | |
| 107 | 110 | Gunpey |
| r21487 | r21488 | |
| 190 | 193 | gunpey_state(const machine_config &mconfig, device_type type, const char *tag) |
| 191 | 194 | : driver_device(mconfig, type, tag), |
| 192 | 195 | m_maincpu(*this, "maincpu"), |
| 193 | | m_oki(*this, "oki") |
| 196 | m_oki(*this, "oki"), |
| 197 | m_wram(*this, "wram") |
| 194 | 198 | { } |
| 195 | 199 | |
| 196 | 200 | required_device<cpu_device> m_maincpu; |
| 197 | 201 | required_device<okim6295_device> m_oki; |
| 202 | required_shared_ptr<UINT16> m_wram; |
| 198 | 203 | |
| 199 | 204 | UINT16 *m_blit_buffer; |
| 200 | 205 | UINT16 m_blit_ram[0x10]; |
| r21487 | r21488 | |
| 220 | 225 | |
| 221 | 226 | UINT32 gunpey_state::screen_update_gunpey(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 222 | 227 | { |
| 223 | | UINT16 *blit_buffer = m_blit_buffer; |
| 228 | //UINT16 *blit_buffer = m_blit_buffer; |
| 224 | 229 | int x,y; |
| 225 | 230 | int count; |
| 226 | 231 | |
| 227 | | count = 0; |
| 232 | bitmap.fill(machine().pens[0], cliprect); //black pen |
| 228 | 233 | |
| 234 | for(count = 0x1800/2;count<0x1d40/2;count+=0x10/2) |
| 235 | { |
| 236 | if(m_wram[count+0/2] == 0xc200) |
| 237 | { |
| 238 | x = (m_wram[count+6/2] >> 8) | ((m_wram[count+8/2] & 0xff) << 8); |
| 239 | y = m_wram[count+8/2] >> 8; |
| 240 | |
| 241 | x-=0x1100; |
| 242 | |
| 243 | for(int yi=0;yi<8;yi++) |
| 244 | { |
| 245 | for(int xi=0;xi<8;xi++) |
| 246 | { |
| 247 | if(cliprect.contains(x+xi, y+yi)) |
| 248 | bitmap.pix32(y+yi, x+xi) = 0xffffff; |
| 249 | } |
| 250 | } |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | #if 0 |
| 229 | 255 | for(y=0;y<512;y++) |
| 230 | 256 | { |
| 231 | 257 | for(x=0;x<512;x++) |
| r21487 | r21488 | |
| 244 | 270 | count++; |
| 245 | 271 | } |
| 246 | 272 | } |
| 273 | #endif |
| 247 | 274 | |
| 248 | 275 | return 0; |
| 249 | 276 | } |
| r21487 | r21488 | |
| 297 | 324 | |
| 298 | 325 | WRITE8_MEMBER(gunpey_state::gunpey_blitter_w) |
| 299 | 326 | { |
| 300 | | UINT16 *blit_buffer = m_blit_buffer; |
| 327 | // UINT16 *blit_buffer = m_blit_buffer; |
| 301 | 328 | UINT16 *blit_ram = m_blit_ram; |
| 302 | | UINT8 *blit_rom = memregion("blit_data")->base(); |
| 303 | | int x,y; |
| 329 | // UINT8 *blit_rom = memregion("blit_data")->base(); |
| 330 | // int x,y; |
| 304 | 331 | |
| 305 | 332 | //printf("gunpey_blitter_w offset %01x data %02x\n", offset,data); |
| 306 | 333 | |
| 307 | 334 | blit_ram[offset] = data; |
| 308 | 335 | |
| 336 | #if 0 |
| 309 | 337 | if(offset == 0 && data == 2) // blitter trigger |
| 310 | 338 | { |
| 311 | 339 | int srcx = blit_ram[0x04]+(blit_ram[0x05]<<8); |
| r21487 | r21488 | |
| 316 | 344 | int ysize = blit_ram[0x0e]+1; |
| 317 | 345 | int color,color_offs; |
| 318 | 346 | |
| 347 | printf("%d %d %d %d\n",blit_ram[0x08]+(blit_ram[0x09]<<8),blit_ram[0x0a]+(blit_ram[0x0b]<<8),xsize,ysize); |
| 348 | |
| 319 | 349 | if(blit_ram[0x01] == 8) //1bpp? |
| 320 | 350 | { |
| 321 | 351 | // ... |
| r21487 | r21488 | |
| 348 | 378 | ,blit_ram[0xc],blit_ram[0xd],blit_ram[0xe],blit_ram[0xf]); |
| 349 | 379 | */ |
| 350 | 380 | } |
| 351 | | |
| 381 | #endif |
| 352 | 382 | } |
| 353 | 383 | |
| 354 | 384 | WRITE8_MEMBER(gunpey_state::gunpey_output_w) |
| r21487 | r21488 | |
| 362 | 392 | /***************************************************************************************/ |
| 363 | 393 | |
| 364 | 394 | static ADDRESS_MAP_START( mem_map, AS_PROGRAM, 16, gunpey_state ) |
| 365 | | AM_RANGE(0x00000, 0x0ffff) AM_RAM |
| 395 | AM_RANGE(0x00000, 0x0ffff) AM_RAM AM_SHARE("wram") |
| 366 | 396 | // AM_RANGE(0x50000, 0x500ff) AM_RAM |
| 367 | 397 | // AM_RANGE(0x50100, 0x502ff) AM_NOP |
| 368 | 398 | AM_RANGE(0x80000, 0xfffff) AM_ROM |