src/mess/drivers/x1.c
| r6298 | r6299 | |
| 990 | 990 | return 0x3ff; |
| 991 | 991 | } |
| 992 | 992 | |
| 993 | static UINT16 check_chr_addr(running_machine *machine) |
| 994 | { |
| 995 | if(!(colorram[0x7ff] & 0x20)) return 0x7ff; |
| 996 | if(!(colorram[0x3ff] & 0x20)) return 0x3ff; |
| 997 | if(!(colorram[0x5ff] & 0x20)) return 0x5ff; |
| 998 | if(!(colorram[0x1ff] & 0x20)) return 0x1ff; |
| 999 | |
| 1000 | return 0x3ff; |
| 1001 | } |
| 1002 | |
| 993 | 1003 | static READ8_HANDLER( x1_pcg_r ) |
| 994 | 1004 | { |
| 995 | 1005 | int addr; |
| r6298 | r6299 | |
| 1002 | 1012 | |
| 1003 | 1013 | if(addr == 0) |
| 1004 | 1014 | { |
| 1005 | | // printf("%04x %04x %02x\n",pcg_write_addr*4*8,pcg_write_addr,bios_offset); |
| 1006 | | gfx_data = memory_region(space->machine, "kanji"); |
| 1007 | | if(bios_offset == 0) |
| 1008 | | kanji_offset = pcg_write_addr*4*8; |
| 1015 | if(scrn_reg.pcg_mode) |
| 1016 | { |
| 1017 | gfx_data = memory_region(space->machine, "kanji"); |
| 1018 | calc_pcg_offset = (videoram[check_chr_addr(space->machine)]+(videoram[check_chr_addr(space->machine)+0x800]<<8)) & 0xfff; |
| 1009 | 1019 | |
| 1010 | | res = gfx_data[0x0000+bios_offset+kanji_offset]; |
| 1020 | kanji_offset = calc_pcg_offset*0x20; |
| 1011 | 1021 | |
| 1012 | | bios_offset++; |
| 1013 | | bios_offset&=0x1f; |
| 1022 | res = gfx_data[0x0000+bios_offset+kanji_offset]; |
| 1023 | |
| 1024 | bios_offset++; |
| 1025 | bios_offset&=0x1f; |
| 1026 | } |
| 1027 | else |
| 1028 | { |
| 1029 | // printf("%04x %04x %02x\n",pcg_write_addr*4*8,pcg_write_addr,bios_offset); |
| 1030 | gfx_data = memory_region(space->machine, "kanji"); |
| 1031 | if(bios_offset == 0) |
| 1032 | kanji_offset = pcg_write_addr*4*8;//TODO: check me |
| 1033 | |
| 1034 | res = gfx_data[0x0000+bios_offset+kanji_offset]; |
| 1035 | |
| 1036 | bios_offset++; |
| 1037 | bios_offset&=0x1f; |
| 1038 | } |
| 1014 | 1039 | return res; |
| 1015 | 1040 | } |
| 1016 | 1041 | else |
| r6298 | r6299 | |
| 1885 | 1910 | |
| 1886 | 1911 | static const gfx_layout x1_chars_16x16 = |
| 1887 | 1912 | { |
| 1888 | | 8,8, |
| 1913 | 8,16, |
| 1889 | 1914 | RGN_FRAC(1,1), |
| 1890 | 1915 | 1, |
| 1891 | 1916 | { 0 }, |
| 1892 | 1917 | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 1893 | | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, |
| 1894 | | 8*8 |
| 1918 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, |
| 1919 | 8*16 |
| 1895 | 1920 | }; |
| 1896 | 1921 | |
| 1897 | 1922 | /* decoded for debugging purpose, this will be nuked in the end... */ |
| r6298 | r6299 | |
| 1899 | 1924 | GFXDECODE_ENTRY( "cgrom", 0x00000, x1_chars_8x8, 0x200, 0x20 ) |
| 1900 | 1925 | GFXDECODE_ENTRY( "pcg", 0x00000, x1_pcg_8x8, 0x000, 1 ) |
| 1901 | 1926 | GFXDECODE_ENTRY( "font", 0x00000, x1_chars_8x16, 0x200, 0x20 ) |
| 1902 | | GFXDECODE_ENTRY( "kanji", 0x00000, x1_chars_16x16, 0, 0x20 ) |
| 1927 | GFXDECODE_ENTRY( "kanji", 0x00000, x1_chars_16x16, 0x200, 0x20 ) |
| 1903 | 1928 | GFXDECODE_END |
| 1904 | 1929 | |
| 1905 | 1930 | /************************************* |