src/mess/video/dgn_beta.c
| r7426 | r7427 | |
| 170 | 170 | |
| 171 | 171 | static int FlashCount; /* Flash counter, IC2, LS393 decade counter */ |
| 172 | 172 | static int FlashBit; /* Flash bit, FL input to I38 */ |
| 173 | | static int DoubleY; /* Double height latch, 'Y' in I38 */ |
| 173 | static int s_DoubleY; /* Double height latch, 'Y' in I38 */ |
| 174 | 174 | static int DoubleHL; /* Double height second row 'HL' in I38 */ |
| 175 | 175 | |
| 176 | 176 | static int ColourRAM[4]; /* I59, 74ls670, 4x4bit colour ram for graphics modes */ |
| r7426 | r7427 | |
| 320 | 320 | FlashCount=0; |
| 321 | 321 | FlashBit=0; |
| 322 | 322 | DoubleHL=1; /* Default to normal height */ |
| 323 | | DoubleY=1; |
| 323 | s_DoubleY=1; |
| 324 | 324 | DrawInterlace=INTERLACE_OFF; /* No interlace by default */ |
| 325 | 325 | |
| 326 | 326 | /* setup debug commands */ |
| r7426 | r7427 | |
| 429 | 429 | ULActive=(UnderLine && (beta_6845_RA==9) && ~SWChar); |
| 430 | 430 | |
| 431 | 431 | /* If Character set one, and undeline set, latch double height */ |
| 432 | | DoubleY=(UnderLine & SWChar & DoubleHL) | |
| 433 | | (SWChar & ~DoubleY & DoubleHL) | |
| 434 | | (SWChar & ~DoubleY & (beta_6845_RA==9)); |
| 432 | s_DoubleY=(UnderLine & SWChar & DoubleHL) | |
| 433 | (SWChar & ~s_DoubleY & DoubleHL) | |
| 434 | (SWChar & ~s_DoubleY & (beta_6845_RA==9)); |
| 435 | 435 | |
| 436 | 436 | /* Invert forground and background if flashing char and flash acive */ |
| 437 | 437 | Invert=(FlashChar & FlashBit); |
src/mess/video/pc_cga.c
| r7426 | r7427 | |
| 268 | 268 | int Y_total; |
| 269 | 269 | int I_total; |
| 270 | 270 | int Q_total; |
| 271 | | } ntsc; |
| 271 | } s_ntsc; |
| 272 | 272 | |
| 273 | 273 | |
| 274 | 274 | /* Clear NTSC buffers and running totals. Call this before the beginning of each new line. */ |
| r7426 | r7427 | |
| 502 | 502 | |
| 503 | 503 | internal_pc_cga_video_start(machine, M6845_PERSONALITY_GENUINE); |
| 504 | 504 | |
| 505 | | ntsc_decoder_init( machine, &ntsc, 8, 256 ); |
| 505 | ntsc_decoder_init( machine, &s_ntsc, 8, 256 ); |
| 506 | 506 | } |
| 507 | 507 | |
| 508 | 508 | |
| r7426 | r7427 | |
| 831 | 831 | if ( y == 0 ) CGA_LOG(1,"cga_gfx_4bpph_update_row",("\n")); |
| 832 | 832 | if ( NTSC_FILTER ) |
| 833 | 833 | { |
| 834 | | ntsc_clear( &ntsc ); |
| 834 | ntsc_clear( &s_ntsc ); |
| 835 | 835 | memset( ntsc_decoded, 0, sizeof(ntsc_decoded)); |
| 836 | 836 | } |
| 837 | 837 | for ( i = 0; i < x_count; i++ ) |
| r7426 | r7427 | |
| 903 | 903 | } |
| 904 | 904 | if (NTSC_FILTER) |
| 905 | 905 | { |
| 906 | | ntsc_decode( &ntsc, samples, ntsc_decoded, 160 ); |
| 906 | ntsc_decode( &s_ntsc, samples, ntsc_decoded, 160 ); |
| 907 | 907 | p = BITMAP_ADDR16(bitmap, y, 0); |
| 908 | 908 | samp_index = 0; |
| 909 | 909 | for ( i = 0; i < ( 8 * x_count ); i++ ) |
| r7426 | r7427 | |
| 1553 | 1553 | { |
| 1554 | 1554 | UINT16 *p = BITMAP_ADDR16(bitmap, y, 0); |
| 1555 | 1555 | UINT16 offset_base = ra << 13; |
| 1556 | | int i; |
| 1556 | int j; |
| 1557 | 1557 | running_machine *machine = device->machine; |
| 1558 | 1558 | |
| 1559 | 1559 | if ( y == 0 ) CGA_LOG(1,"pc1512_gfx_4bpp_update_row",("\n")); |
| 1560 | | for ( i = 0; i < x_count; i++ ) |
| 1560 | for ( j = 0; j < x_count; j++ ) |
| 1561 | 1561 | { |
| 1562 | | UINT16 offset = offset_base | ( ( ma + i ) & 0x1FFF ); |
| 1562 | UINT16 offset = offset_base | ( ( ma + j ) & 0x1FFF ); |
| 1563 | 1563 | UINT16 i = ( cga.color_select & 8 ) ? device->machine->generic.videoram.u8[ videoram_offset[3] | offset ] << 3 : 0; |
| 1564 | 1564 | UINT16 r = ( cga.color_select & 4 ) ? device->machine->generic.videoram.u8[ videoram_offset[2] | offset ] << 2 : 0; |
| 1565 | 1565 | UINT16 g = ( cga.color_select & 2 ) ? device->machine->generic.videoram.u8[ videoram_offset[1] | offset ] << 1 : 0; |
src/mess/video/hd61830.c
| r7426 | r7427 | |
| 266 | 266 | case HD61830_INSTRUCTION_CLEAR_BIT: |
| 267 | 267 | { |
| 268 | 268 | int nb = data & 0x07; |
| 269 | | UINT8 data = memory_read_byte(space, hd61830->cac); |
| 269 | UINT8 data_ = memory_read_byte(space, hd61830->cac); |
| 270 | 270 | |
| 271 | | data &= ~(2 << nb); |
| 271 | data_ &= ~(2 << nb); |
| 272 | 272 | |
| 273 | 273 | if (LOG) logerror("HD61380 '%s' Clear Bit %u at %04x\n", device->tag.cstr(), nb + 1, hd61830->cac); |
| 274 | 274 | |
| 275 | | memory_write_byte(space, hd61830->cac, data); |
| 275 | memory_write_byte(space, hd61830->cac, data_); |
| 276 | 276 | |
| 277 | 277 | hd61830->cac++; |
| 278 | 278 | } |
| r7426 | r7427 | |
| 281 | 281 | case HD61830_INSTRUCTION_SET_BIT: |
| 282 | 282 | { |
| 283 | 283 | int nb = data & 0x07; |
| 284 | | UINT8 data = memory_read_byte(space, hd61830->cac); |
| 284 | UINT8 data_ = memory_read_byte(space, hd61830->cac); |
| 285 | 285 | |
| 286 | | data |= 2 << nb; |
| 286 | data_ |= 2 << nb; |
| 287 | 287 | |
| 288 | 288 | if (LOG) logerror("HD61380 '%s' Set Bit %u at %04x\n", device->tag.cstr(), nb + 1, hd61830->cac); |
| 289 | 289 | |
| 290 | | memory_write_byte(space, hd61830->cac, data); |
| 290 | memory_write_byte(space, hd61830->cac, data_); |
| 291 | 291 | |
| 292 | 292 | hd61830->cac++; |
| 293 | 293 | } |
src/mess/video/gba.c
| r7426 | r7427 | |
| 43 | 43 | /* Utility functions */ |
| 44 | 44 | INLINE int is_in_window(gba_state_t *gba_state, int x, int window); |
| 45 | 45 | INLINE UINT32 alpha_blend_pixel(UINT32 color0, UINT32 color1, int ca, int cb); |
| 46 | | INLINE UINT32 increase_brightness(UINT32 color, int coeff); |
| 47 | | INLINE UINT32 decrease_brightness(UINT32 color, int coeff); |
| 46 | INLINE UINT32 increase_brightness(UINT32 color, int coeff_); |
| 47 | INLINE UINT32 decrease_brightness(UINT32 color, int coeff_); |
| 48 | 48 | |
| 49 | 49 | #include "gbamode0.c" |
| 50 | 50 | #include "gbamode1.c" |
| r7426 | r7427 | |
| 482 | 482 | if(ctrl & BGCNT_PALETTE256) |
| 483 | 483 | { |
| 484 | 484 | UINT16 *src = screendata + 0x400 * (pixx >> 8) + ((pixx & 255) >> 3) + stride; |
| 485 | | INT32 x = 0; |
| 486 | 485 | for(x = 0; x < 240; x++) |
| 487 | 486 | { |
| 488 | 487 | UINT16 data = *src; |
| r7426 | r7427 | |
| 546 | 545 | else |
| 547 | 546 | { |
| 548 | 547 | UINT16 *src = screendata + 0x400 * (pixx >> 8) + ((pixx & 255) >> 3) + stride; |
| 549 | | INT32 x = 0; |
| 550 | 548 | for(x = 0; x < 240; x++) |
| 551 | 549 | { |
| 552 | 550 | UINT16 data = *src; |
| r7426 | r7427 | |
| 882 | 880 | else |
| 883 | 881 | { |
| 884 | 882 | INT32 ax; |
| 885 | | int cury = y - sy; |
| 883 | int cury_ = y - sy; |
| 886 | 884 | |
| 887 | 885 | width *= 8; |
| 888 | 886 | height *= 8; |
| 889 | 887 | |
| 890 | | if(cury >= 0 && cury < height) |
| 888 | if(cury_ >= 0 && cury_ < height) |
| 891 | 889 | { |
| 892 | 890 | if( ( (sx < 240) || ( ( (sx + width) & 0x1ff ) < 240 ) ) && (attr0 & OBJ_ROZMODE_DISABLE) == 0) |
| 893 | 891 | { |
| r7426 | r7427 | |
| 897 | 895 | int address = 0; |
| 898 | 896 | if(attr1 & OBJ_VFLIP) |
| 899 | 897 | { |
| 900 | | cury = height - cury - 1; |
| 898 | cury_ = height - cury_ - 1; |
| 901 | 899 | } |
| 902 | 900 | if((gba_state->DISPCNT & DISPCNT_MODE) > 2 && tiledrawindex < 0x200) |
| 903 | 901 | { |
| r7426 | r7427 | |
| 919 | 917 | ax = width - 1; |
| 920 | 918 | } |
| 921 | 919 | |
| 922 | | address = 0x10000 + ((((tiledrawindex + (cury >> 3) * inc) << 5) + ((cury & 7) << 3) + ((ax >> 3) << 6) + (ax & 7)) & 0x7fff); |
| 920 | address = 0x10000 + ((((tiledrawindex + (cury_ >> 3) * inc) << 5) + ((cury_ & 7) << 3) + ((ax >> 3) << 6) + (ax & 7)) & 0x7fff); |
| 923 | 921 | |
| 924 | 922 | if(attr1 & OBJ_HFLIP) |
| 925 | 923 | { |
| r7426 | r7427 | |
| 976 | 974 | UINT32 address; |
| 977 | 975 | if(attr1 & OBJ_VFLIP) |
| 978 | 976 | { |
| 979 | | cury = height - cury - 1; |
| 977 | cury_ = height - cury_ - 1; |
| 980 | 978 | } |
| 981 | 979 | if((gba_state->DISPCNT & DISPCNT_MODE) > 2 && tiledrawindex < 0x200) |
| 982 | 980 | { |
| r7426 | r7427 | |
| 994 | 992 | ax = width - 1; |
| 995 | 993 | } |
| 996 | 994 | |
| 997 | | address = 0x10000 + ((((tiledrawindex + (cury >> 3) * inc) << 5) + ((cury & 0x07) << 2) + ((ax >> 3) << 5) + ((ax & 0x07) >> 1)) & 0x7fff); |
| 995 | address = 0x10000 + ((((tiledrawindex + (cury_ >> 3) * inc) << 5) + ((cury_ & 0x07) << 2) + ((ax >> 3) << 5) + ((ax & 0x07) >> 1)) & 0x7fff); |
| 998 | 996 | if(attr1 & OBJ_HFLIP) |
| 999 | 997 | { |
| 1000 | 998 | ax = 7; |
| r7426 | r7427 | |
| 1729 | 1727 | return color0; |
| 1730 | 1728 | } |
| 1731 | 1729 | |
| 1732 | | INLINE UINT32 increase_brightness(UINT32 color, int coeff) |
| 1730 | INLINE UINT32 increase_brightness(UINT32 color, int coeff_) |
| 1733 | 1731 | { |
| 1734 | 1732 | int r = (color >> 0) & 0x1f; |
| 1735 | 1733 | int g = (color >> 5) & 0x1f; |
| 1736 | 1734 | int b = (color >> 10) & 0x1f; |
| 1737 | 1735 | |
| 1738 | | r += ((0x1f - r) * coeff) >> 4; |
| 1739 | | g += ((0x1f - g) * coeff) >> 4; |
| 1740 | | b += ((0x1f - b) * coeff) >> 4; |
| 1736 | r += ((0x1f - r) * coeff_) >> 4; |
| 1737 | g += ((0x1f - g) * coeff_) >> 4; |
| 1738 | b += ((0x1f - b) * coeff_) >> 4; |
| 1741 | 1739 | |
| 1742 | 1740 | if(r > 0x1f) r = 0x1f; |
| 1743 | 1741 | if(g > 0x1f) g = 0x1f; |
| r7426 | r7427 | |
| 1746 | 1744 | return (color & 0xffff0000) | (b << 10) | (g << 5) | r; |
| 1747 | 1745 | } |
| 1748 | 1746 | |
| 1749 | | INLINE UINT32 decrease_brightness(UINT32 color, int coeff) |
| 1747 | INLINE UINT32 decrease_brightness(UINT32 color, int coeff_) |
| 1750 | 1748 | { |
| 1751 | 1749 | int r = (color >> 0) & 0x1f; |
| 1752 | 1750 | int g = (color >> 5) & 0x1f; |
| 1753 | 1751 | int b = (color >> 10) & 0x1f; |
| 1754 | 1752 | |
| 1755 | | r -= (r * coeff) >> 4; |
| 1756 | | g -= (g * coeff) >> 4; |
| 1757 | | b -= (b * coeff) >> 4; |
| 1753 | r -= (r * coeff_) >> 4; |
| 1754 | g -= (g * coeff_) >> 4; |
| 1755 | b -= (b * coeff_) >> 4; |
| 1758 | 1756 | |
| 1759 | 1757 | if(r < 0) r = 0; |
| 1760 | 1758 | if(g < 0) g = 0; |
src/mess/osd/winui/messui.c
| r7426 | r7427 | |
| 82 | 82 | // LOCAL VARIABLES |
| 83 | 83 | //============================================================ |
| 84 | 84 | |
| 85 | | static software_config *config; |
| 85 | static software_config *s_config; |
| 86 | 86 | static BOOL s_bIgnoreSoftwarePickerNotifies; |
| 87 | 87 | |
| 88 | 88 | static int *mess_icon_index; |
| r7426 | r7427 | |
| 349 | 349 | void MySoftwareListClose(void) |
| 350 | 350 | { |
| 351 | 351 | // free the machine config, if necessary |
| 352 | | if (config != NULL) |
| 352 | if (s_config != NULL) |
| 353 | 353 | { |
| 354 | | software_config_free(config); |
| 355 | | config = NULL; |
| 354 | software_config_free(s_config); |
| 355 | s_config = NULL; |
| 356 | 356 | } |
| 357 | 357 | } |
| 358 | 358 | |
| r7426 | r7427 | |
| 366 | 366 | // do we have to do anything? |
| 367 | 367 | if (!bForce) |
| 368 | 368 | { |
| 369 | | if (config != NULL) |
| 370 | | is_same = (drvindex == config->driver_index); |
| 369 | if (s_config != NULL) |
| 370 | is_same = (drvindex == s_config->driver_index); |
| 371 | 371 | else |
| 372 | 372 | is_same = (drvindex < 0); |
| 373 | 373 | if (is_same) |
| r7426 | r7427 | |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | // free the machine config, if necessary |
| 378 | | if (config != NULL) |
| 379 | | { |
| 380 | | software_config_free(config); |
| 381 | | config = NULL; |
| 382 | | } |
| 378 | MySoftwareListClose(); |
| 383 | 379 | |
| 384 | 380 | // allocate the machine config, if necessary |
| 385 | 381 | if (drvindex >= 0) |
| 386 | 382 | { |
| 387 | | config = software_config_alloc(drvindex, MameUIGlobal(), NULL); |
| 383 | s_config = software_config_alloc(drvindex, MameUIGlobal(), NULL); |
| 388 | 384 | } |
| 389 | 385 | |
| 390 | 386 | // locate key widgets |
| r7426 | r7427 | |
| 392 | 388 | hwndSoftwareDevView = GetDlgItem(GetMainWindow(), IDC_SWDEVVIEW); |
| 393 | 389 | |
| 394 | 390 | // set up the device view |
| 395 | | DevView_SetDriver(hwndSoftwareDevView, config); |
| 391 | DevView_SetDriver(hwndSoftwareDevView, s_config); |
| 396 | 392 | |
| 397 | 393 | // set up the software picker |
| 398 | 394 | SoftwarePicker_Clear(hwndSoftwarePicker); |
| 399 | | SoftwarePicker_SetDriver(hwndSoftwarePicker, config); |
| 395 | SoftwarePicker_SetDriver(hwndSoftwarePicker, s_config); |
| 400 | 396 | |
| 401 | 397 | // add the relevant paths |
| 402 | 398 | drv = drivers[drvindex]; |
| r7426 | r7427 | |
| 503 | 499 | // if device is NULL, this is a special case; try to find existing image |
| 504 | 500 | if (device == NULL) |
| 505 | 501 | { |
| 506 | | for (device = config->mconfig->devicelist.first(); device != NULL;device = device->next) |
| 502 | for (device = s_config->mconfig->devicelist.first(); device != NULL;device = device->next) |
| 507 | 503 | { |
| 508 | 504 | if (is_image_device(device)) |
| 509 | 505 | { |
| 510 | | s = GetSelectedSoftware(drvindex, config->mconfig, device); |
| 506 | s = GetSelectedSoftware(drvindex, s_config->mconfig, device); |
| 511 | 507 | if ((s != NULL) && !mame_stricmp(s, pszFilename)) |
| 512 | 508 | break; |
| 513 | 509 | } |
| r7426 | r7427 | |
| 526 | 522 | |
| 527 | 523 | if (file_extension != NULL) |
| 528 | 524 | { |
| 529 | | for (device = config->mconfig->devicelist.first(); device != NULL;device = device->next) |
| 525 | for (device = s_config->mconfig->devicelist.first(); device != NULL;device = device->next) |
| 530 | 526 | { |
| 531 | 527 | if (is_image_device(device)) |
| 532 | 528 | { |
| 533 | | s = GetSelectedSoftware(drvindex, config->mconfig, device); |
| 529 | s = GetSelectedSoftware(drvindex, s_config->mconfig, device); |
| 534 | 530 | if (is_null_or_empty(s) && image_device_uses_file_extension(device, file_extension)) |
| 535 | 531 | break; |
| 536 | 532 | } |
| r7426 | r7427 | |
| 541 | 537 | if (device != NULL) |
| 542 | 538 | { |
| 543 | 539 | // place the image |
| 544 | | InternalSetSelectedSoftware(drvindex, config->mconfig, device, pszFilename); |
| 540 | InternalSetSelectedSoftware(drvindex, s_config->mconfig, device, pszFilename); |
| 545 | 541 | } |
| 546 | 542 | else |
| 547 | 543 | { |
| r7426 | r7427 | |
| 558 | 554 | const device_config *device; |
| 559 | 555 | const char *s; |
| 560 | 556 | |
| 561 | | for (device = config->mconfig->devicelist.first(); device != NULL;device = device->next) |
| 557 | for (device = s_config->mconfig->devicelist.first(); device != NULL;device = device->next) |
| 562 | 558 | { |
| 563 | 559 | if (is_image_device(device)) |
| 564 | 560 | { |
| 565 | | s = GetSelectedSoftware(drvindex, config->mconfig, device); |
| 561 | s = GetSelectedSoftware(drvindex, s_config->mconfig, device); |
| 566 | 562 | if ((s != NULL) && !strcmp(pszFilename, s)) |
| 567 | 563 | MessSpecifyImage(drvindex, device, NULL); |
| 568 | 564 | } |
| r7426 | r7427 | |
| 598 | 594 | // be problematic |
| 599 | 595 | ListView_SetItemState(hwndSoftware, -1, 0, LVIS_SELECTED); |
| 600 | 596 | |
| 601 | | for (dev = config->mconfig->devicelist.first(); dev != NULL;dev = dev->next) |
| 597 | for (dev = s_config->mconfig->devicelist.first(); dev != NULL;dev = dev->next) |
| 602 | 598 | { |
| 603 | 599 | if (is_image_device(dev)) |
| 604 | 600 | { |
| 605 | | pszSoftware = GetSelectedSoftware(config->driver_index, config->mconfig, dev); |
| 601 | pszSoftware = GetSelectedSoftware(s_config->driver_index, s_config->mconfig, dev); |
| 606 | 602 | if (pszSoftware && *pszSoftware) |
| 607 | 603 | { |
| 608 | 604 | i = SoftwarePicker_LookupIndex(hwndSoftware, pszSoftware); |
| r7426 | r7427 | |
| 633 | 629 | struct PickerOptions opts; |
| 634 | 630 | HWND hwndSoftware; |
| 635 | 631 | |
| 636 | | config = NULL; |
| 632 | s_config = NULL; |
| 637 | 633 | hwndSoftware = GetDlgItem(GetMainWindow(), IDC_SWLIST); |
| 638 | 634 | |
| 639 | 635 | memset(&opts, 0, sizeof(opts)); |
src/mess/machine/microtan.c
| r7426 | r7427 | |
| 438 | 438 | static int parse_intel_hex(UINT8 *snapshot_buff, char *src) |
| 439 | 439 | { |
| 440 | 440 | char line[128]; |
| 441 | | int row = 0, column = 0, last_addr = 0, last_size = 0; |
| 441 | int /*row = 0,*/ column = 0, last_addr = 0, last_size = 0; |
| 442 | 442 | |
| 443 | 443 | while (*src) |
| 444 | 444 | { |
| r7426 | r7427 | |
| 449 | 449 | unsigned int size, addr, null, b[32], cs, n; |
| 450 | 450 | |
| 451 | 451 | line[column] = '\0'; |
| 452 | | row++; |
| 452 | /*row++;*/ |
| 453 | 453 | n = sscanf(line, ":%02x%04x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", |
| 454 | 454 | &size, &addr, &null, |
| 455 | 455 | &b[ 0], &b[ 1], &b[ 2], &b[ 3], &b[ 4], &b[ 5], &b[ 6], &b[ 7], |
| r7426 | r7427 | |
| 519 | 519 | static int parse_zillion_hex(UINT8 *snapshot_buff, char *src) |
| 520 | 520 | { |
| 521 | 521 | char line[128]; |
| 522 | | int parsing = 0, row = 0, column = 0; |
| 522 | int parsing = 0, /*row = 0,*/ column = 0; |
| 523 | 523 | |
| 524 | 524 | while (*src) |
| 525 | 525 | { |
| r7426 | r7427 | |
| 536 | 536 | unsigned int addr, b[8], n; |
| 537 | 537 | |
| 538 | 538 | line[column] = '\0'; |
| 539 | | row++; |
| 539 | /*row++;*/ |
| 540 | 540 | n = sscanf(line, "%x %x %x %x %x %x %x %x %x", &addr, &b[0], &b[1], &b[2], &b[3], &b[4], &b[5], &b[6], &b[7]); |
| 541 | 541 | if (n == 0) |
| 542 | 542 | { |
| r7426 | r7427 | |
| 572 | 572 | { |
| 573 | 573 | int addr, n; |
| 574 | 574 | |
| 575 | | row++; |
| 575 | /*row++;*/ |
| 576 | 576 | line[column] = '\0'; |
| 577 | 577 | n = sscanf(line, "G%x", (unsigned int *) &addr); |
| 578 | 578 | if (n == 1 && !snapshot_buff[8192+64+1] && !snapshot_buff[8192+64+1]) |
src/mess/formats/td0_dsk.c
| r7426 | r7427 | |
| 174 | 174 | // size of data that should be reapeted next byte times |
| 175 | 175 | while(buff_pos<realsize) { |
| 176 | 176 | if (data[data_pos]==0x00) { |
| 177 | | int size = data[data_pos+1]; |
| 178 | | memcpy(buf+buff_pos,data + data_pos + 2,size); |
| 179 | | data_pos += 2 + size; |
| 180 | | buff_pos += size; |
| 177 | int size_ = data[data_pos+1]; |
| 178 | memcpy(buf+buff_pos,data + data_pos + 2,size_); |
| 179 | data_pos += 2 + size_; |
| 180 | buff_pos += size_; |
| 181 | 181 | } else { |
| 182 | | int size = 2*data[data_pos]; |
| 182 | int size_ = 2*data[data_pos]; |
| 183 | 183 | int repeat = data[data_pos+1]; |
| 184 | 184 | data_pos+=2; |
| 185 | 185 | |
| 186 | 186 | for (i=0;i<repeat;i++) { |
| 187 | | memcpy(buf + buff_pos,data + data_pos,size); |
| 188 | | buff_pos += size; |
| 187 | memcpy(buf + buff_pos,data + data_pos,size_); |
| 188 | buff_pos += size_; |
| 189 | 189 | } |
| 190 | | data_pos += size; |
| 190 | data_pos += size_; |
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | break; |
| 194 | 194 | default: |
| 195 | 195 | return FLOPPY_ERROR_INTERNAL; |
| 196 | | break; |
| 197 | 196 | } |
| 198 | 197 | return FLOPPY_ERROR_SUCCESS; |
| 199 | 198 | } |
src/mess/formats/hect_tap.c
| r7426 | r7427 | |
| 88 | 88 | |
| 89 | 89 | static int hector_handle_tap(INT16 *buffer, const UINT8 *casdata) |
| 90 | 90 | { |
| 91 | | int data_pos, sample_count, block_count; |
| 91 | int data_pos, sample_count/*, block_count*/; |
| 92 | 92 | int previous_block=0; |
| 93 | 93 | |
| 94 | 94 | data_pos = 0; |
| 95 | 95 | sample_count = 0; |
| 96 | | block_count = 0; |
| 96 | /*block_count = 0;*/ |
| 97 | 97 | previous_block = 0; |
| 98 | 98 | |
| 99 | 99 | /* First 768 cycle of synchro */ |
| r7426 | r7427 | |
| 119 | 119 | if (block_size==0) |
| 120 | 120 | block_size=256; |
| 121 | 121 | |
| 122 | | block_count++; |
| 122 | /*block_count++;*/ |
| 123 | 123 | sample_count += hector_tap_byte(buffer, sample_count, casdata[data_pos] ); |
| 124 | 124 | data_pos++; |
| 125 | 125 | |
| r7426 | r7427 | |
| 146 | 146 | |
| 147 | 147 | static int hector_handle_forth_tap(INT16 *buffer, const UINT8 *casdata) |
| 148 | 148 | { |
| 149 | | int data_pos, sample_count, block_count; |
| 150 | | int previous_block=0; |
| 149 | int data_pos, sample_count/*, block_count*/; |
| 150 | /*int previous_block=0;*/ |
| 151 | 151 | |
| 152 | 152 | data_pos = 0; |
| 153 | 153 | sample_count = 0; |
| 154 | | block_count = 0; |
| 155 | | previous_block = 0; |
| 154 | /*block_count = 0;*/ |
| 155 | /*previous_block = 0;*/ |
| 156 | 156 | |
| 157 | 157 | /* Out if len of file not modulo 822 octets */ |
| 158 | 158 | if ( (cas_size % 822) != 0 ) |
| r7426 | r7427 | |
| 169 | 169 | /* Handle block lenght on tape data */ |
| 170 | 170 | block_size = 822 ; /* Fixed size for the forth*/ |
| 171 | 171 | |
| 172 | | block_count=0; |
| 172 | /*block_count=0;*/ |
| 173 | 173 | |
| 174 | 174 | /* Data samples */ |
| 175 | 175 | for ( ; block_size ; data_pos++, block_size-- ) |
src/mess/drivers/vboy.c
| r7426 | r7427 | |
| 147 | 147 | switch(offset << 1) { |
| 148 | 148 | case 0x00: //INTPND |
| 149 | 149 | return state->vip_regs.INTPND; |
| 150 | | break; |
| 151 | 150 | case 0x02: //INTENB |
| 152 | 151 | return state->vip_regs.INTENB; |
| 153 | | break; |
| 154 | 152 | case 0x04: //INTCLR |
| 155 | 153 | logerror("Error reading INTCLR\n"); |
| 156 | 154 | break; |
| 157 | 155 | case 0x20: //DPSTTS |
| 158 | 156 | return state->vip_regs.DPSTTS; |
| 159 | | break; |
| 160 | 157 | case 0x22: //DPCTRL |
| 161 | 158 | return state->vip_regs.DPCTRL; |
| 162 | | break; |
| 163 | 159 | case 0x24: //BRTA |
| 164 | 160 | return state->vip_regs.BRTA; |
| 165 | | break; |
| 166 | 161 | case 0x26: //BRTB |
| 167 | 162 | return state->vip_regs.BRTB; |
| 168 | | break; |
| 169 | 163 | case 0x28: //BRTC |
| 170 | 164 | return state->vip_regs.BRTC; |
| 171 | | break; |
| 172 | 165 | case 0x2A: //REST |
| 173 | 166 | return state->vip_regs.REST; |
| 174 | | break; |
| 175 | 167 | case 0x2E: //FRMCYC |
| 176 | 168 | return state->vip_regs.FRMCYC; |
| 177 | | break; |
| 178 | 169 | case 0x30: //CTA |
| 179 | 170 | return state->vip_regs.CTA; |
| 180 | | break; |
| 181 | 171 | case 0x40: //XPSTTS |
| 182 | 172 | return state->vip_regs.XPSTTS; |
| 183 | | break; |
| 184 | 173 | case 0x42: //XPCTRL |
| 185 | 174 | return state->vip_regs.XPCTRL; |
| 186 | | break; |
| 187 | 175 | case 0x44: //VER |
| 188 | 176 | return state->vip_regs.VER; |
| 189 | | break; |
| 190 | 177 | case 0x48: //SPT0 |
| 191 | 178 | return state->vip_regs.SPT[0]; |
| 192 | | break; |
| 193 | 179 | case 0x4A: //SPT1 |
| 194 | 180 | return state->vip_regs.SPT[1]; |
| 195 | | break; |
| 196 | 181 | case 0x4C: //SPT2 |
| 197 | 182 | return state->vip_regs.SPT[2]; |
| 198 | | break; |
| 199 | 183 | case 0x4E: //SPT3 |
| 200 | 184 | return state->vip_regs.SPT[3]; |
| 201 | | break; |
| 202 | 185 | case 0x60: //GPLT0 |
| 203 | 186 | return state->vip_regs.GPLT[0]; |
| 204 | | break; |
| 205 | 187 | case 0x62: //GPLT1 |
| 206 | 188 | return state->vip_regs.GPLT[1]; |
| 207 | | break; |
| 208 | 189 | case 0x64: //GPLT2 |
| 209 | 190 | return state->vip_regs.GPLT[2]; |
| 210 | | break; |
| 211 | 191 | case 0x66: //GPLT3 |
| 212 | 192 | return state->vip_regs.GPLT[3]; |
| 213 | | break; |
| 214 | 193 | case 0x68: //JPLT0 |
| 215 | 194 | return state->vip_regs.JPLT[0]; |
| 216 | | break; |
| 217 | 195 | case 0x6A: //JPLT1 |
| 218 | 196 | return state->vip_regs.JPLT[1]; |
| 219 | | break; |
| 220 | 197 | case 0x6C: //JPLT2 |
| 221 | 198 | return state->vip_regs.JPLT[2]; |
| 222 | | break; |
| 223 | 199 | case 0x6E: //JPLT3 |
| 224 | 200 | return state->vip_regs.JPLT[3]; |
| 225 | | break; |
| 226 | 201 | case 0x70: //BKCOL |
| 227 | 202 | return state->vip_regs.BKCOL; |
| 228 | | break; |
| 229 | 203 | default: |
| 230 | 204 | logerror("Unemulated read: addr %08x\n", offset * 2 + 0x0005f800); |
| 231 | 205 | break; |
src/mess/drivers/cdi.c
| r7426 | r7427 | |
| 703 | 703 | verboselog(space->machine, 12, "scc68070_periphs_r: Timer Status Register: %02x & %04x\n", scc68070->timers.timer_status_register, mem_mask); |
| 704 | 704 | } |
| 705 | 705 | return (scc68070->timers.timer_status_register << 8) | scc68070->timers.timer_control_register; |
| 706 | | break; |
| 707 | 706 | case 0x2022/2: |
| 708 | 707 | verboselog(space->machine, 2, "scc68070_periphs_r: Timer Reload Register: %04x & %04x\n", scc68070->timers.reload_register, mem_mask); |
| 709 | 708 | return scc68070->timers.reload_register; |
| r7426 | r7427 | |
| 747 | 746 | verboselog(space->machine, 2, "scc68070_periphs_r: DMA(%d) Status Register: %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].channel_status, mem_mask); |
| 748 | 747 | } |
| 749 | 748 | return (scc68070->dma.channel[(offset - 0x2000) / 32].channel_status << 8) | scc68070->dma.channel[(offset - 0x2000) / 32].channel_error; |
| 750 | | break; |
| 751 | 749 | case 0x4004/2: |
| 752 | 750 | case 0x4044/2: |
| 753 | 751 | if(ACCESSING_BITS_0_7) |
| r7426 | r7427 | |
| 1453 | 1451 | l3=cdic_xa_last[3]; |
| 1454 | 1452 | int b=0; |
| 1455 | 1453 | int s=0; |
| 1456 | | int decoded = 0; |
| 1454 | //int decoded = 0; |
| 1457 | 1455 | |
| 1458 | 1456 | for (b=0; b<18; b++) |
| 1459 | 1457 | { |
| r7426 | r7427 | |
| 1486 | 1484 | *dp++=d1; |
| 1487 | 1485 | l3=l2; |
| 1488 | 1486 | l2=d1; |
| 1489 | | decoded += 2; |
| 1487 | //decoded += 2; |
| 1490 | 1488 | } |
| 1491 | 1489 | } |
| 1492 | 1490 | |
| r7426 | r7427 | |
| 3472 | 3470 | { |
| 3473 | 3471 | if(mcd212->channel[0].image_coding_method & MCD212_ICM_NR) |
| 3474 | 3472 | { |
| 3475 | | int reg = 0; |
| 3473 | int reg_ = 0; |
| 3476 | 3474 | int flag = 0; |
| 3477 | 3475 | |
| 3478 | 3476 | for(flag = 0; flag < 2; flag++) |
| 3479 | 3477 | { |
| 3480 | | for(reg = 0; reg < 4; reg++) |
| 3478 | for(reg_ = 0; reg_ < 4; reg_++) |
| 3481 | 3479 | { |
| 3482 | | if(mcd212->channel[0].region_control[reg] == 0) |
| 3480 | if(mcd212->channel[0].region_control[reg_] == 0) |
| 3483 | 3481 | { |
| 3484 | 3482 | break; |
| 3485 | 3483 | } |
| 3486 | | if(x == (mcd212->channel[0].region_control[flag*4 + reg] & MCD212_RC_X)) |
| 3484 | if(x == (mcd212->channel[0].region_control[flag*4 + reg_] & MCD212_RC_X)) |
| 3487 | 3485 | { |
| 3488 | | switch((mcd212->channel[0].region_control[flag*4 + reg] & MCD212_RC_OP) >> MCD212_RC_OP_SHIFT) |
| 3486 | switch((mcd212->channel[0].region_control[flag*4 + reg_] & MCD212_RC_OP) >> MCD212_RC_OP_SHIFT) |
| 3489 | 3487 | { |
| 3490 | 3488 | case 0: // End of region control for line |
| 3491 | 3489 | break; |
| r7426 | r7427 | |
| 3494 | 3492 | case 3: // Not used |
| 3495 | 3493 | break; |
| 3496 | 3494 | case 4: // Change weight of plane A |
| 3497 | | latched_wfa = (mcd212->channel[0].region_control[flag*4 + reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT; |
| 3495 | latched_wfa = (mcd212->channel[0].region_control[flag*4 + reg_] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT; |
| 3498 | 3496 | break; |
| 3499 | 3497 | case 5: // Not used |
| 3500 | 3498 | break; |
| 3501 | 3499 | case 6: // Change weight of plane B |
| 3502 | | latched_wfb = (mcd212->channel[0].region_control[flag*4 + reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT; |
| 3500 | latched_wfb = (mcd212->channel[0].region_control[flag*4 + reg_] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT; |
| 3503 | 3501 | break; |
| 3504 | 3502 | case 7: // Not used |
| 3505 | 3503 | break; |
| r7426 | r7427 | |
| 3527 | 3525 | case 11: // Not used |
| 3528 | 3526 | break; |
| 3529 | 3527 | case 12: // Reset region flag and change weight of plane A |
| 3530 | | latched_wfa = (mcd212->channel[0].region_control[flag*4 + reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT; |
| 3528 | latched_wfa = (mcd212->channel[0].region_control[flag*4 + reg_] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT; |
| 3531 | 3529 | if(flag) |
| 3532 | 3530 | { |
| 3533 | 3531 | latched_rf1 = 0; |
| r7426 | r7427 | |
| 3538 | 3536 | } |
| 3539 | 3537 | break; |
| 3540 | 3538 | case 13: // Set region flag and change weight of plane A |
| 3541 | | latched_wfa = (mcd212->channel[0].region_control[flag*4 + reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT; |
| 3539 | latched_wfa = (mcd212->channel[0].region_control[flag*4 + reg_] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT; |
| 3542 | 3540 | if(flag) |
| 3543 | 3541 | { |
| 3544 | 3542 | latched_rf1 = 1; |
| r7426 | r7427 | |
| 3549 | 3547 | } |
| 3550 | 3548 | break; |
| 3551 | 3549 | case 14: // Reset region flag and change weight of plane B |
| 3552 | | latched_wfb = (mcd212->channel[0].region_control[flag*4 + reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT; |
| 3550 | latched_wfb = (mcd212->channel[0].region_control[flag*4 + reg_] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT; |
| 3553 | 3551 | if(flag) |
| 3554 | 3552 | { |
| 3555 | 3553 | latched_rf1 = 0; |
| r7426 | r7427 | |
| 3560 | 3558 | } |
| 3561 | 3559 | break; |
| 3562 | 3560 | case 15: // Set region flag and change weight of plane B |
| 3563 | | latched_wfb = (mcd212->channel[0].region_control[flag*4 + reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT; |
| 3561 | latched_wfb = (mcd212->channel[0].region_control[flag*4 + reg_] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT; |
| 3564 | 3562 | if(flag) |
| 3565 | 3563 | { |
| 3566 | 3564 | latched_rf1 = 1; |
src/mess/drivers/pyl601.c
| r7426 | r7427 | |
| 351 | 351 | { |
| 352 | 352 | UINT8 code = messram_get_ptr(devtag_get_device(device->machine, "messram"))[(((ma + column) & 0x0fff) + 0xf000)]; |
| 353 | 353 | code = ((code << 1) | (code >> 7)) & 0xff; |
| 354 | | data = charrom[((code << 3) | (ra & 0x07)) & 0x7ff]; |
| 355 | 354 | if (column == cursor_x-2) |
| 356 | 355 | { |
| 357 | 356 | data = 0xff; |
| 358 | 357 | } |
| 358 | else |
| 359 | { |
| 360 | data = charrom[((code << 3) | (ra & 0x07)) & 0x7ff]; |
| 361 | } |
| 359 | 362 | for (bit = 0; bit < 8; bit++) |
| 360 | 363 | { |
| 361 | 364 | int x = (column * 8) + bit; |
| r7426 | r7427 | |
| 371 | 374 | { |
| 372 | 375 | for (i = 0; i < x_count; i++) |
| 373 | 376 | { |
| 374 | | UINT8 data = messram_get_ptr(devtag_get_device(device->machine, "messram"))[(((ma + i) << 3) | (ra & 0x07)) & 0xffff]; |
| 377 | data = messram_get_ptr(devtag_get_device(device->machine, "messram"))[(((ma + i) << 3) | (ra & 0x07)) & 0xffff]; |
| 375 | 378 | for (bit = 0; bit < 8; bit++) |
| 376 | 379 | { |
| 377 | 380 | *BITMAP_ADDR16(bitmap, y, (i * 8) + bit) = BIT(data, 7) ? 1 : 0; |
| r7426 | r7427 | |
| 413 | 416 | { |
| 414 | 417 | for (i = 0; i < x_count; i++) |
| 415 | 418 | { |
| 416 | | UINT8 data = messram_get_ptr(devtag_get_device(device->machine, "messram"))[(((ma + i) << 3) | (ra & 0x07)) & 0xffff]; |
| 419 | data = messram_get_ptr(devtag_get_device(device->machine, "messram"))[(((ma + i) << 3) | (ra & 0x07)) & 0xffff]; |
| 417 | 420 | for (bit = 0; bit < 8; bit++) |
| 418 | 421 | { |
| 419 | 422 | *BITMAP_ADDR16(bitmap, y, (i * 8) + bit) = BIT(data, 7) ? 1 : 0; |