trunk/src/mame/machine/315-5881_crypt.c
| r243034 | r243035 | |
| 661 | 661 | // in astrass the first block is 0xffff (for a 0x10000 block) followed by 0x3f3f (for a 0x1000 block) |
| 662 | 662 | // etc. after each block a new header must be read, it looks like compressed and uncompressed blocks |
| 663 | 663 | // can be mixed like this, I don't know if the length is src length of decompressed length. |
| 664 | | int blockx = ((dec_header & 0x00ff) >> 0) + 1; |
| 665 | | int blocky = ((dec_header & 0xff00) >> 8) + 1; |
| 664 | // deathcox and others confirm format as 0x20000 bit as compressed bit, 0x1ff00 bits as block size 1, 0x000ff bits as block size 2 |
| 665 | // for compressed streams the 'line size' is block size 1. |
| 666 | |
| 667 | int blockx = ((dec_header & 0x000000ff) >> 0) + 1; |
| 668 | int blocky = ((dec_header & 0x0001ff00) >> 8) + 1; |
| 666 | 669 | block_size = blockx * blocky; |
| 667 | 670 | |
| 668 | 671 | if(dec_header & FLAG_COMPRESSED) { |
| 669 | | line_buffer_size = dec_header & FLAG_LINE_SIZE_512 ? 512 : 256; |
| 672 | line_buffer_size = blocky; |
| 670 | 673 | line_buffer_pos = line_buffer_size; |
| 671 | 674 | buffer_bit = 7; |
| 672 | 675 | } |
| r243034 | r243035 | |
| 683 | 686 | buffer[i] = val; |
| 684 | 687 | buffer[i+1] = val >> 8; |
| 685 | 688 | block_pos+=2; |
| 686 | | if (block_pos == block_size) |
| 689 | |
| 690 | if (!(dec_header & FLAG_COMPRESSED)) |
| 687 | 691 | { |
| 688 | | // if we reach the size specified we need to read a new header |
| 689 | | // todo: how should this work with compressed blocks?? |
| 692 | if (block_pos == block_size) |
| 693 | { |
| 694 | // if we reach the size specified we need to read a new header |
| 695 | // todo: for compressed blocks this depends on OUTPUT size, not input size, so things get messy |
| 690 | 696 | |
| 691 | | enc_start(); |
| 697 | enc_start(); |
| 698 | } |
| 692 | 699 | } |
| 693 | 700 | } |
| 694 | 701 | buffer_pos = 0; |
| r243034 | r243035 | |
| 788 | 795 | line_buffer_prev = lp; |
| 789 | 796 | line_buffer_pos = 0; |
| 790 | 797 | |
| 791 | | UINT32 line_buffer_mask = line_buffer_size-1; |
| 792 | | |
| 793 | 798 | for(int i=0; i != line_buffer_size;) { |
| 794 | 799 | // vlc 0: start of line |
| 795 | 800 | // vlc 1: interior of line |
| r243034 | r243035 | |
| 812 | 817 | static int offsets[4] = {0, 1, 0, -1}; |
| 813 | 818 | int offset = offsets[(tmp & 0x18) >> 3]; |
| 814 | 819 | for(int j=0; j != count; j++) { |
| 815 | | lc[i^1] = lp[((i+offset) & line_buffer_mask)^1]; |
| 820 | lc[i^1] = lp[((i+offset) % line_buffer_size)^1]; |
| 816 | 821 | i++; |
| 817 | 822 | } |
| 818 | 823 | |
trunk/src/mame/machine/315-5881_crypt.h
| r243034 | r243035 | |
| 42 | 42 | private: |
| 43 | 43 | |
| 44 | 44 | enum { |
| 45 | | BUFFER_SIZE = 32768, LINE_SIZE = 512, |
| 46 | | FLAG_COMPRESSED = 0x10000, FLAG_LINE_SIZE_512 = 0x20000 |
| 45 | // BUFFER_SIZE = 32768, LINE_SIZE = 512, |
| 46 | BUFFER_SIZE = 2, LINE_SIZE = 512, // this should be a stream, without any 'BUFFER_SIZE' ? I guess the SH4 DMA implementation isn't on a timer tho? |
| 47 | FLAG_COMPRESSED = 0x20000 |
| 47 | 48 | }; |
| 48 | 49 | |
| 49 | 50 | UINT32 key; |
trunk/src/mame/machine/315-5881_helper.c
| r243034 | r243035 | |
| 32 | 32 | static const struct game_keys keys_table[] = |
| 33 | 33 | { |
| 34 | 34 | // name key gameid # year chip label platform |
| 35 | | // { "twcup98", 0x05200913 }, // 25209801 1998 317-5039-COM ST-V (this is correct key, but not yet working with our code) |
| 36 | | { "twcup98", -1 }, // 25209801 1998 317-5039-COM ST-V |
| 35 | { "twcup98", 0x05200913 }, // 25209801 1998 317-5039-COM ST-V (this is correct key, but not yet working with our code) |
| 36 | // { "twcup98", -1 }, // 25209801 1998 317-5039-COM ST-V |
| 37 | 37 | { "astrass", 0x052e2901 }, // 25349801 1998 317-5040-COM ST-V (yes, the 317-5040-COM chip was reused for 3 different games and on both Naomi and ST-V!) |
| 38 | 38 | { "wldkicks", 0x052e2901 }, // 25209801 2000 317-5040-COM Naomi |
| 39 | 39 | { "toukon4", 0x052e2901 }, // 25349801 2000 317-5040-COM Naomi |