trunk/src/mame/drivers/gunpey.c
| r21571 | r21572 | |
| 767 | 767 | int count = 0; |
| 768 | 768 | printf("data: "); |
| 769 | 769 | const int show_bytes = 0; |
| 770 | | int bitspacer = 0; |
| 771 | | int bitspace = 9; |
| 770 | //int bitspacer = 0; |
| 771 | //int bitspace = 9; |
| 772 | 772 | int linespacer = 0; |
| 773 | 773 | #endif |
| 774 | 774 | |
| r21571 | r21572 | |
| 791 | 791 | for (;;) |
| 792 | 792 | { |
| 793 | 793 | |
| 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 | |
| 796 | 816 | // hack, really I imagine there is exactly enough compressed data to fill the dest bitmap area when decompressed, but to stop us |
| 797 | 817 | // overrunning into reading other data we terminate on a 0000, which doesn't seem likely to be compressed data. |
| 798 | 818 | if (data==0x00 && lastdata == 0x00) |
| r21571 | r21572 | |
| 815 | 835 | } |
| 816 | 836 | else |
| 817 | 837 | { |
| 818 | | for (int z=0;z<8;z++) |
| 838 | |
| 839 | printf("%1x-", test); |
| 840 | |
| 841 | for (int z=0;z<getbits;z++) |
| 819 | 842 | { |
| 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"); |
| 826 | 848 | |
| 827 | | printf(" "); |
| 828 | | bitspacer = 0; |
| 829 | | } |
| 830 | | } |
| 849 | printf(" "); |
| 850 | |
| 831 | 851 | } |
| 832 | 852 | count++; |
| 833 | 853 | } |