Previous 199869 Revisions Next

r34523 Wednesday 21st January, 2015 at 17:53:27 UTC by David Haywood
misc 315-5881 (nw)
[src/mame/machine]315-5881_crypt.c 315-5881_crypt.h 315-5881_helper.c

trunk/src/mame/machine/315-5881_crypt.c
r243034r243035
661661   // in astrass the first block is 0xffff (for a 0x10000 block) followed by 0x3f3f (for a 0x1000 block)
662662   // etc. after each block a new header must be read, it looks like compressed and uncompressed blocks
663663   // 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;
666669   block_size = blockx * blocky;
667670
668671   if(dec_header & FLAG_COMPRESSED) {
669      line_buffer_size = dec_header & FLAG_LINE_SIZE_512 ? 512 : 256;
672      line_buffer_size = blocky;
670673      line_buffer_pos = line_buffer_size;
671674      buffer_bit = 7;
672675   }
r243034r243035
683686      buffer[i] = val;
684687      buffer[i+1] = val >> 8;
685688      block_pos+=2;
686      if (block_pos == block_size)
689
690      if (!(dec_header & FLAG_COMPRESSED))
687691      {
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
690696
691         enc_start();
697            enc_start();
698         }
692699      }
693700   }
694701   buffer_pos = 0;
r243034r243035
788795   line_buffer_prev = lp;
789796   line_buffer_pos = 0;
790797
791   UINT32 line_buffer_mask = line_buffer_size-1;
792
793798   for(int i=0; i != line_buffer_size;) {
794799      // vlc 0: start of line
795800      // vlc 1: interior of line
r243034r243035
812817            static int offsets[4] = {0, 1, 0, -1};
813818            int offset = offsets[(tmp & 0x18) >> 3];
814819            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];
816821               i++;
817822            }
818823
trunk/src/mame/machine/315-5881_crypt.h
r243034r243035
4242private:
4343
4444   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
4748   };
4849
4950   UINT32 key;
trunk/src/mame/machine/315-5881_helper.c
r243034r243035
3232static const struct game_keys keys_table[] =
3333{
3434   // 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
3737   { "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!)
3838   { "wldkicks",        0x052e2901 }, // 25209801    2000     317-5040-COM   Naomi
3939   { "toukon4",         0x052e2901 }, // 25349801    2000     317-5040-COM   Naomi


Previous 199869 Revisions Next


© 1997-2024 The MAME Team