src/mess/video/trs80.c
| r4444 | r4445 | |
| 48 | 48 | /* 7 or 8-bit video, 32/64 characters per line = trs80, trs80l2, sys80 */ |
| 49 | 49 | VIDEO_UPDATE( trs80 ) |
| 50 | 50 | { |
| 51 | | UINT8 y,ra,chr,gfx; |
| 51 | UINT8 y,ra,chr,gfx,gfxbit; |
| 52 | 52 | UINT16 sy=0,ma=0,x; |
| 53 | 53 | UINT8 *FNT = memory_region(screen->machine, "gfx1"); |
| 54 | 54 | UINT8 seven_bit = screen->machine->gamedrv->flags >> 24; |
| 55 | | static UINT8 size_store=0; |
| 55 | static UINT8 size_store=0xff; |
| 56 | 56 | static UINT8 cols=64,skip=1; |
| 57 | | UINT8 lores1,lores2; |
| 58 | 57 | |
| 59 | 58 | if ((trs80_mode & 0x7f) != size_store) |
| 60 | 59 | { |
| r4444 | r4445 | |
| 76 | 75 | |
| 77 | 76 | if (chr & 0x80) |
| 78 | 77 | { |
| 79 | | lores1 = 1<<((ra & 0x0c)>>1); |
| 80 | | lores2 = lores1<<1; |
| 78 | gfxbit = 1<<((ra & 0x0c)>>1); |
| 81 | 79 | /* Display one line of a lores character (6 pixels) */ |
| 82 | | *p = ( chr & lores1 ) ? 1 : 0; p++; |
| 83 | | *p = ( chr & lores1 ) ? 1 : 0; p++; |
| 84 | | *p = ( chr & lores1 ) ? 1 : 0; p++; |
| 85 | | *p = ( chr & lores2 ) ? 1 : 0; p++; |
| 86 | | *p = ( chr & lores2 ) ? 1 : 0; p++; |
| 87 | | *p = ( chr & lores2 ) ? 1 : 0; p++; |
| 80 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 81 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 82 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 83 | gfxbit = gfxbit<<1; |
| 84 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 85 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 86 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 88 | 87 | } |
| 89 | 88 | else |
| 90 | 89 | { |
| r4444 | r4445 | |
| 111 | 110 | return 0; |
| 112 | 111 | } |
| 113 | 112 | |
| 113 | /* 8-bit video, 32/64/40/80 characters per line = trs80m3, trs80m4. |
| 114 | The proper character generator is not dumped, and has extra characters in the 192-255 range. */ |
| 115 | VIDEO_UPDATE( trs80m4 ) |
| 116 | { |
| 117 | UINT8 y,ra,chr,gfx,gfxbit; |
| 118 | UINT16 sy=0,ma=0,x; |
| 119 | UINT8 *FNT = memory_region(screen->machine, "gfx1"); |
| 120 | static UINT8 size_store=0xff; |
| 121 | static UINT8 cols=64,rows=16,skip=1,s_cols; |
| 114 | 122 | |
| 123 | if ((trs80_mode & 0x7f) != size_store) |
| 124 | { |
| 125 | size_store = trs80_mode & 0x7f; |
| 126 | s_cols = cols = (trs80_mode & 4) ? 80 : 64; |
| 127 | rows = (trs80_mode & 4) ? 24 : 16; |
| 128 | |
| 129 | if (trs80_mode & 1) |
| 130 | { |
| 131 | s_cols >>= 1; |
| 132 | skip = 2; |
| 133 | } |
| 134 | video_screen_set_visarea(screen, 0, s_cols*FW-1, 0, rows*FH-1); |
| 135 | } |
| 136 | |
| 137 | for (y = 0; y < rows; y++) |
| 138 | { |
| 139 | for (ra = 0; ra < FH; ra++) |
| 140 | { |
| 141 | UINT16 *p = BITMAP_ADDR16(bitmap, sy++, 0); |
| 142 | |
| 143 | for (x = ma; x < ma + cols; x+=skip) |
| 144 | { |
| 145 | chr = videoram[x+start_address]; |
| 146 | |
| 147 | if ((chr & 0x80) && (~trs80_mode & 8)) |
| 148 | { |
| 149 | gfxbit = 1<<((ra & 0x0c)>>1); |
| 150 | /* Display one line of a lores character (6 pixels) */ |
| 151 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 152 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 153 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 154 | gfxbit <<= 1; |
| 155 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 156 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 157 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 158 | } |
| 159 | else |
| 160 | { |
| 161 | /* get pattern of pixels for that character scanline */ |
| 162 | if (ra < 8) |
| 163 | gfx = FNT[((chr&0x7f)<<3) | ra ]; |
| 164 | else |
| 165 | gfx = 0; |
| 166 | |
| 167 | /* if inverse mode, and bit 7 set, invert gfx */ |
| 168 | if ((trs80_mode & 8) && (chr & 0x80)) |
| 169 | gfx ^= 0xff; |
| 170 | |
| 171 | /* Display a scanline of a character (6 pixels) */ |
| 172 | *p = ( gfx & 0x20 ) ? 1 : 0; p++; |
| 173 | *p = ( gfx & 0x10 ) ? 1 : 0; p++; |
| 174 | *p = ( gfx & 0x08 ) ? 1 : 0; p++; |
| 175 | *p = ( gfx & 0x04 ) ? 1 : 0; p++; |
| 176 | *p = ( gfx & 0x02 ) ? 1 : 0; p++; |
| 177 | *p = ( gfx & 0x01 ) ? 1 : 0; p++; |
| 178 | } |
| 179 | } |
| 180 | } |
| 181 | ma+=cols; |
| 182 | } |
| 183 | return 0; |
| 184 | } |
| 185 | |
| 115 | 186 | /* 7 or 8-bit video, 64/32 characters per line = ht1080z, ht1080z2, ht108064 */ |
| 116 | 187 | VIDEO_UPDATE( ht1080z ) |
| 117 | 188 | { |
| 118 | | UINT8 y,ra,chr,gfx; |
| 189 | UINT8 y,ra,chr,gfx,gfxbit; |
| 119 | 190 | UINT16 sy=0,ma=0,x; |
| 120 | 191 | UINT8 *FNT = memory_region(screen->machine, "gfx1"); |
| 121 | 192 | UINT8 seven_bit = screen->machine->gamedrv->flags >> 24; |
| 122 | | static UINT8 size_store=0; |
| 193 | static UINT8 size_store=0xff; |
| 123 | 194 | static UINT8 cols=64,skip=1; |
| 124 | | UINT8 lores1,lores2; |
| 125 | 195 | |
| 126 | 196 | if ((trs80_mode & 0x7f) != size_store) |
| 127 | 197 | { |
| r4444 | r4445 | |
| 143 | 213 | |
| 144 | 214 | if (chr & 0x80) |
| 145 | 215 | { |
| 146 | | lores1 = 1<<((ra & 0x0c)>>1); |
| 147 | | lores2 = lores1<<1; |
| 216 | gfxbit = 1<<((ra & 0x0c)>>1); |
| 148 | 217 | /* Display one line of a lores character (6 pixels) */ |
| 149 | | *p = ( chr & lores1 ) ? 1 : 0; p++; |
| 150 | | *p = ( chr & lores1 ) ? 1 : 0; p++; |
| 151 | | *p = ( chr & lores1 ) ? 1 : 0; p++; |
| 152 | | *p = ( chr & lores2 ) ? 1 : 0; p++; |
| 153 | | *p = ( chr & lores2 ) ? 1 : 0; p++; |
| 154 | | *p = ( chr & lores2 ) ? 1 : 0; p++; |
| 218 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 219 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 220 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 221 | gfxbit = gfxbit<<1; |
| 222 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 223 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 224 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 155 | 225 | } |
| 156 | 226 | else |
| 157 | 227 | { |
| r4444 | r4445 | |
| 178 | 248 | VIDEO_UPDATE( lnw80 ) |
| 179 | 249 | { |
| 180 | 250 | const UINT16 rows[] = { 0, 0x200, 0x100, 0x300, 1, 0x201, 0x101, 0x301 }; |
| 181 | | UINT8 y,ra,chr,gfx; |
| 251 | UINT8 y,ra,chr,gfx,gfxbit; |
| 182 | 252 | UINT16 sy=0,ma=0,x; |
| 183 | 253 | UINT8 *FNT = memory_region(screen->machine, "gfx1"); |
| 184 | | static UINT8 size_store=0; |
| 254 | static UINT8 size_store=0xff; |
| 185 | 255 | static UINT8 cols=64,skip=1; |
| 186 | | UINT8 lores1,lores2; |
| 187 | 256 | |
| 188 | 257 | if ((trs80_mode & 0x7f) != size_store) |
| 189 | 258 | { |
| r4444 | r4445 | |
| 205 | 274 | |
| 206 | 275 | if (chr & 0x80) |
| 207 | 276 | { |
| 208 | | lores1 = 1<<((ra & 0x0c)>>1); |
| 209 | | lores2 = lores1<<1; |
| 277 | gfxbit = 1<<((ra & 0x0c)>>1); |
| 210 | 278 | /* Display one line of a lores character (6 pixels) */ |
| 211 | | *p = ( chr & lores1 ) ? 1 : 0; p++; |
| 212 | | *p = ( chr & lores1 ) ? 1 : 0; p++; |
| 213 | | *p = ( chr & lores1 ) ? 1 : 0; p++; |
| 214 | | *p = ( chr & lores2 ) ? 1 : 0; p++; |
| 215 | | *p = ( chr & lores2 ) ? 1 : 0; p++; |
| 216 | | *p = ( chr & lores2 ) ? 1 : 0; p++; |
| 279 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 280 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 281 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 282 | gfxbit = gfxbit<<1; |
| 283 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 284 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 285 | *p = ( chr & gfxbit ) ? 1 : 0; p++; |
| 217 | 286 | } |
| 218 | 287 | else |
| 219 | 288 | { |
| r4444 | r4445 | |
| 238 | 307 | return 0; |
| 239 | 308 | } |
| 240 | 309 | |
| 241 | | |
| 310 | /* lores characters are in the character generator. Each character is 8x16. */ |
| 242 | 311 | VIDEO_UPDATE( radionic ) |
| 243 | 312 | { |
| 244 | 313 | UINT8 y,ra,chr,gfx; |
| 245 | 314 | UINT16 sy=0,ma=0,x; |
| 246 | 315 | UINT8 *FNT = memory_region(screen->machine, "gfx1"); |
| 247 | | static UINT8 size_store=0; |
| 316 | static UINT8 size_store=0xff; |
| 248 | 317 | static UINT8 cols=64,skip=1; |
| 249 | | UINT8 lores1,lores2; |
| 250 | 318 | |
| 251 | 319 | if ((trs80_mode & 0x7f) != size_store) |
| 252 | 320 | { |
| 253 | 321 | size_store = trs80_mode & 0x7f; |
| 254 | 322 | cols = (trs80_mode & 1) ? 32 : 64; |
| 255 | 323 | skip = (trs80_mode & 1) ? 2 : 1; |
| 256 | | video_screen_set_visarea(screen, 0, cols*FW-1, 0, 16*FH-1); |
| 324 | video_screen_set_visarea(screen, 0, cols*8-1, 0, 16*16-1); |
| 257 | 325 | } |
| 258 | 326 | |
| 259 | 327 | for (y = 0; y < 16; y++) |
| 260 | 328 | { |
| 261 | | for (ra = 0; ra < FH; ra++) |
| 329 | for (ra = 0; ra < 16; ra++) |
| 262 | 330 | { |
| 263 | 331 | UINT16 *p = BITMAP_ADDR16(bitmap, sy++, 0); |
| 264 | 332 | |
| r4444 | r4445 | |
| 266 | 334 | { |
| 267 | 335 | chr = videoram[x]; |
| 268 | 336 | |
| 269 | | if ((chr & 0xc0) == 0x80) |
| 270 | | { |
| 271 | | lores1 = 1<<((ra & 0x0c)>>1); |
| 272 | | lores2 = lores1<<1; |
| 273 | | /* Display one line of a lores character (6 pixels) */ |
| 274 | | *p = ( chr & lores1 ) ? 1 : 0; p++; |
| 275 | | *p = ( chr & lores1 ) ? 1 : 0; p++; |
| 276 | | *p = ( chr & lores1 ) ? 1 : 0; p++; |
| 277 | | *p = ( chr & lores2 ) ? 1 : 0; p++; |
| 278 | | *p = ( chr & lores2 ) ? 1 : 0; p++; |
| 279 | | *p = ( chr & lores2 ) ? 1 : 0; p++; |
| 280 | | } |
| 281 | | else |
| 282 | | { |
| 283 | | /* get pattern of pixels for that character scanline */ |
| 284 | | if (ra < 8) |
| 285 | | gfx = FNT[(chr<<3) | ra ]; |
| 286 | | else |
| 287 | | gfx = FNT[(chr<<3) | (ra & 7) | 0x800]; |
| 337 | /* get pattern of pixels for that character scanline */ |
| 338 | gfx = FNT[(chr<<3) | (ra & 7) | (ra & 8) << 8]; |
| 288 | 339 | |
| 289 | | /* Display a scanline of a character (6 pixels) */ |
| 290 | | *p = ( gfx & 0x01 ) ? 1 : 0; p++; |
| 291 | | *p = ( gfx & 0x02 ) ? 1 : 0; p++; |
| 292 | | *p = ( gfx & 0x04 ) ? 1 : 0; p++; |
| 293 | | *p = ( gfx & 0x08 ) ? 1 : 0; p++; |
| 294 | | *p = ( gfx & 0x10 ) ? 1 : 0; p++; |
| 295 | | *p = ( gfx & 0x20 ) ? 1 : 0; p++; |
| 296 | | } |
| 340 | /* Display a scanline of a character (8 pixels) */ |
| 341 | *p = ( gfx & 0x01 ) ? 1 : 0; p++; |
| 342 | *p = ( gfx & 0x02 ) ? 1 : 0; p++; |
| 343 | *p = ( gfx & 0x04 ) ? 1 : 0; p++; |
| 344 | *p = ( gfx & 0x08 ) ? 1 : 0; p++; |
| 345 | *p = ( gfx & 0x10 ) ? 1 : 0; p++; |
| 346 | *p = ( gfx & 0x20 ) ? 1 : 0; p++; |
| 347 | *p = ( gfx & 0x40 ) ? 1 : 0; p++; |
| 348 | *p = ( gfx & 0x80 ) ? 1 : 0; p++; |
| 297 | 349 | } |
| 298 | 350 | } |
| 299 | 351 | ma+=64; |