trunk/src/mess/drivers/fp200.c
| r21863 | r21864 | |
| 69 | 69 | m_lcd.attr = auto_alloc_array_clear(machine(), UINT8, 20*64); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | /* TODO: Very preliminary, I actually believe that the LCDC writes in a blitter fashion ... */ |
| 72 | 73 | UINT32 fp200_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 73 | 74 | { |
| 75 | UINT16 l_offs, r_offs; |
| 76 | |
| 77 | bitmap.fill(0, cliprect); |
| 78 | |
| 79 | l_offs = 0; |
| 80 | r_offs = 0; |
| 74 | 81 | for(int y=cliprect.min_y;y<cliprect.max_y;y++) |
| 75 | 82 | { |
| 76 | | for(int x=cliprect.min_x;x<cliprect.max_x;x++) |
| 83 | for(int x=0;x<80;x++) |
| 77 | 84 | { |
| 78 | | if(m_lcd.attr[x/8+y*20] == 0x60) |
| 85 | if(m_lcd.attr[x/8+y*20] == 0x50) |
| 79 | 86 | { |
| 87 | l_offs = (y & ~7); |
| 88 | break; |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | for(int y=cliprect.min_y;y<cliprect.max_y;y++) |
| 94 | { |
| 95 | for(int x=80;x<160;x++) |
| 96 | { |
| 97 | if(m_lcd.attr[x/8+y*20] == 0x50) |
| 98 | { |
| 99 | r_offs = (y & ~7); |
| 100 | break; |
| 101 | } |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | for(int y=cliprect.min_y;y<cliprect.max_y;y++) |
| 106 | { |
| 107 | for(int x=0;x<80;x++) |
| 108 | { |
| 109 | UINT16 yoffs; |
| 110 | |
| 111 | yoffs = y + l_offs; |
| 112 | |
| 113 | if(yoffs >= 64) |
| 114 | yoffs -= 64; |
| 115 | |
| 116 | if(m_lcd.attr[x/8+yoffs*20] == 0x60 || m_lcd.attr[x/8+yoffs*20] == 0x50) |
| 117 | { |
| 80 | 118 | UINT8 vram,pix; |
| 81 | 119 | |
| 82 | | vram = m_lcd.vram[x/8+y*20]; |
| 83 | | pix = ((m_chargen[vram*8+(x & 7)]) >> (7-(y & 7))) & 1; |
| 120 | vram = m_lcd.vram[x/8+yoffs*20]; |
| 121 | pix = ((m_chargen[vram*8+(x & 7)]) >> (7-(yoffs & 7))) & 1; |
| 84 | 122 | bitmap.pix16(y,x) = pix; |
| 85 | 123 | } |
| 86 | | /* fake, to see where the scrolling should stay. */ |
| 87 | | if(m_lcd.attr[x/8+y*20] == 0x50) |
| 88 | | bitmap.pix16(y,x) = machine().rand() & 1; |
| 124 | /* |
| 125 | else if(m_lcd.attr[x/8+yoffs*20] == 0x40) |
| 126 | { |
| 127 | UINT8 vram,pix; |
| 128 | |
| 129 | vram = m_lcd.vram[x/8+yoffs*20]; |
| 130 | pix = (vram) >> (7-(yoffs & 7)) & 1; |
| 131 | bitmap.pix16(y,x) = pix; |
| 132 | }*/ |
| 89 | 133 | } |
| 90 | 134 | } |
| 91 | 135 | |
| 136 | for(int y=cliprect.min_y;y<cliprect.max_y;y++) |
| 137 | { |
| 138 | for(int x=80;x<160;x++) |
| 139 | { |
| 140 | UINT16 yoffs; |
| 141 | |
| 142 | yoffs = y + r_offs; |
| 143 | |
| 144 | if(yoffs >= 64) |
| 145 | yoffs -= 64; |
| 146 | |
| 147 | if(m_lcd.attr[x/8+yoffs*20] == 0x60 || m_lcd.attr[x/8+yoffs*20] == 0x50) |
| 148 | { |
| 149 | UINT8 vram,pix; |
| 150 | |
| 151 | vram = m_lcd.vram[x/8+yoffs*20]; |
| 152 | pix = ((m_chargen[vram*8+(x & 7)]) >> (7-(yoffs & 7))) & 1; |
| 153 | bitmap.pix16(y,x) = pix; |
| 154 | } |
| 155 | /*else if(m_lcd.attr[x/8+yoffs*20] == 0x40) |
| 156 | { |
| 157 | UINT8 vram,pix; |
| 158 | |
| 159 | vram = m_lcd.vram[x/8+yoffs*20]; |
| 160 | pix = (vram) >> (7-(yoffs & 7)) & 1; |
| 161 | bitmap.pix16(y,x) = pix; |
| 162 | }*/ |
| 163 | } |
| 164 | } |
| 165 | |
| 92 | 166 | return 0; |
| 93 | 167 | } |
| 94 | 168 | |
| r21863 | r21864 | |
| 144 | 218 | switch(offset) |
| 145 | 219 | { |
| 146 | 220 | case 1: |
| 147 | | printf("%d %d -> (L) %02x\n",m_lcd.x,m_lcd.y,m_lcd.status); |
| 221 | //printf("%d %d -> (L) %02x\n",m_lcd.x,m_lcd.y,m_lcd.status); |
| 148 | 222 | if(m_lcd.status == 0xb) |
| 149 | 223 | res = read_lcd_attr(m_lcd.x,m_lcd.y); |
| 150 | 224 | else if(m_lcd.status == 1) |
| 151 | 225 | res = read_lcd_vram(m_lcd.x,m_lcd.y); |
| 152 | 226 | break; |
| 153 | 227 | case 2: |
| 154 | | printf("%d %d -> (R) %02x\n",m_lcd.x,m_lcd.y,m_lcd.status); |
| 228 | //printf("%d %d -> (R) %02x\n",m_lcd.x,m_lcd.y,m_lcd.status); |
| 155 | 229 | if(m_lcd.status == 0xb) |
| 156 | 230 | res = read_lcd_attr(m_lcd.x + 10,m_lcd.y); |
| 157 | 231 | else if(m_lcd.status == 1) |