Previous 199869 Revisions Next

r21572 Monday 4th March, 2013 at 17:26:34 UTC by David Haywood
keep some of the more basic looking bitstreams (eg. char 959) aligned, although this is likely wrong.
[src/mame/drivers]gunpey.c

trunk/src/mame/drivers/gunpey.c
r21571r21572
767767            int count = 0;
768768            printf("data: ");
769769            const int show_bytes = 0;
770            int bitspacer = 0;
771            int bitspace = 9;
770            //int bitspacer = 0;
771            //int bitspace = 9;
772772            int linespacer = 0;
773773#endif
774774
r21571r21572
791791            for (;;)
792792            {
793793               
794               int data = gunpey_state_get_stream_bits(8);
795               
794               int test = gunpey_state_get_stream_bits(2);
795               int data;
796               int getbits;
797               // don't think this is right.. just keeps some streams in alignment, see 959 in char test for example
798               if (test==0x0)
799               {
800                  getbits = 7;
801               }
802               else if (test==0x1)
803               {
804                  getbits = 5;
805               }
806               else if (test==0x2)
807               {
808                  getbits = 5;
809               }
810               else if (test==0x3)
811               {
812                  getbits = 7;
813               }
814               data = gunpey_state_get_stream_bits(getbits);
815
796816               // hack, really I imagine there is exactly enough compressed data to fill the dest bitmap area when decompressed, but to stop us
797817               // overrunning into reading other data we terminate on a 0000, which doesn't seem likely to be compressed data.
798818               if (data==0x00 && lastdata == 0x00)
r21571r21572
815835                     }
816836                     else
817837                     {
818                        for (int z=0;z<8;z++)
838
839                        printf("%1x-", test);
840
841                        for (int z=0;z<getbits;z++)
819842                        {
820                           printf("%d", (data>>(7-z))&1);
821                           bitspacer++;
822                           if (bitspacer == bitspace)
823                           {
824                              linespacer++;
825                              if ((linespacer%16) == 0) printf("\n");
843                           printf("%d", (data>>((getbits-1)-z))&1);
844                        }
845   
846                        linespacer++;
847                        if ((linespacer%16) == 0) printf("\n");
826848                             
827                              printf(" ");
828                              bitspacer = 0;
829                           }
830                        }
849                        printf(" ");
850
831851                     }
832852                     count++;
833853                  }

Previous 199869 Revisions Next


© 1997-2024 The MAME Team