src/mess/video/trs80.c
| r1862 | r1863 | |
| 16 | 16 | ***************************************************************************/ |
| 17 | 17 | static int width_store = 10; // bodgy value to force an initial resize |
| 18 | 18 | |
| 19 | | |
| 20 | | /*************************************************************************** |
| 21 | | Draw the game screen in the given mame_bitmap. |
| 22 | | Do NOT call osd_update_display() from this function, |
| 23 | | it will be called by the main emulation engine. |
| 24 | | ***************************************************************************/ |
| 25 | 19 | VIDEO_UPDATE( trs80 ) |
| 26 | 20 | { |
| 27 | | int width = 64 - (trs80_port_ff & 8) * 4; |
| 28 | | int skip = 3 - width / 32; |
| 21 | int width = 64 - ((trs80_port_ff & 8) << 2); |
| 22 | int skip = 3 - (width >> 5); |
| 29 | 23 | int i=0,x,y,chr; |
| 30 | 24 | int adj=readinputport(0)&0x40; |
| 31 | 25 | |
| r1862 | r1863 | |
| 34 | 28 | width_store = width; |
| 35 | 29 | video_screen_set_visarea(0, 0, width*FW-1, 0, 16*FH-1); |
| 36 | 30 | } |
| 31 | |
| 37 | 32 | for (y = 0; y < 16; y++) |
| 38 | 33 | { |
| 39 | 34 | for (x = 0; x < 64; x+=skip) |
| 40 | 35 | { |
| 41 | | i = y * 64 + x; |
| 36 | i = (y << 6) + x; |
| 42 | 37 | chr=videoram[i]; |
| 43 | 38 | if ((adj) && (chr < 32)) chr+=64; // 7-bit video handler |
| 44 | 39 | drawgfx( bitmap,machine->gfx[0],chr,0,0,0,x/skip*FW,y*FH, |
src/mess/machine/trs80.c
| r1862 | r1863 | |
| 325 | 325 | |
| 326 | 326 | DRIVER_INIT( lnw80 ) |
| 327 | 327 | { |
| 328 | | // UINT8 *FNT = memory_region(REGION_GFX1); |
| 329 | | // int i, y; |
| 328 | UINT8 y, *FNT = memory_region(REGION_GFX1); |
| 329 | UINT16 i, rows[] = { 0, 0x200, 0x100, 0x300, 1, 0x201, 0x101, 0x301 }; |
| 330 | 330 | |
| 331 | | // for( i = 0x000; i < 0x080; i++ ) |
| 332 | | // { |
| 333 | | // /* copy eight lines from the character generator */ |
| 334 | | // for (y = 0; y < 8; y++) |
| 335 | | // FNT[i*FH+y] = FNT[0x0800+i*8+y] << 3; |
| 336 | | // /* wipe out the lower lines (no descenders!) */ |
| 337 | | // for (y = 8; y < FH; y++) |
| 338 | | // FNT[i*FH+y] = 0; |
| 339 | | // } |
| 340 | | // /* setup the 2x3 chunky block graphics (two times 64 characters) */ |
| 341 | | // for( i = 0x080; i < 0x100; i++ ) |
| 342 | | // { |
| 343 | | // UINT8 b0, b1, b2, b3, b4, b5; |
| 344 | | // b0 = (i & 0x01) ? 0xe0 : 0x00; |
| 345 | | // b1 = (i & 0x02) ? 0x1c : 0x00; |
| 346 | | // b2 = (i & 0x04) ? 0xe0 : 0x00; |
| 347 | | // b3 = (i & 0x08) ? 0x1c : 0x00; |
| 348 | | // b4 = (i & 0x10) ? 0xe0 : 0x00; |
| 349 | | // b5 = (i & 0x20) ? 0x1c : 0x00; |
| 350 | | // |
| 351 | | // FNT[i*FH+ 0] = FNT[i*FH+ 1] = FNT[i*FH+ 2] = FNT[i*FH+ 3] = b0 | b1; |
| 352 | | // FNT[i*FH+ 4] = FNT[i*FH+ 5] = FNT[i*FH+ 6] = FNT[i*FH+ 7] = b2 | b3; |
| 353 | | // FNT[i*FH+ 8] = FNT[i*FH+ 9] = FNT[i*FH+10] = FNT[i*FH+11] = b4 | b5; |
| 354 | | // } |
| 331 | for( i = 0; i < 0x80; i++ ) |
| 332 | { |
| 333 | /* copy eight lines from the character generator */ |
| 334 | for (y = 0; y < 8; y++) |
| 335 | FNT[i*FH+y] = BITSWAP8(FNT[0x800+(i<<1)+rows[y]], 2, 1, 6, 7, 5, 3, 4, 0); /* bits 0,3,4 are blank */ |
| 336 | } |
| 337 | /* setup the 2x3 chunky block graphics (two times 64 characters) */ |
| 338 | for( i = 0x80; i < 0x100; i++ ) |
| 339 | { |
| 340 | UINT8 b0, b1, b2, b3, b4, b5; |
| 341 | b0 = (i & 0x01) ? 0xe0 : 0x00; |
| 342 | b1 = (i & 0x02) ? 0x1c : 0x00; |
| 343 | b2 = (i & 0x04) ? 0xe0 : 0x00; |
| 344 | b3 = (i & 0x08) ? 0x1c : 0x00; |
| 345 | b4 = (i & 0x10) ? 0xe0 : 0x00; |
| 346 | b5 = (i & 0x20) ? 0x1c : 0x00; |
| 347 | |
| 348 | FNT[i*FH+ 0] = FNT[i*FH+ 1] = FNT[i*FH+ 2] = FNT[i*FH+ 3] = b0 | b1; |
| 349 | FNT[i*FH+ 4] = FNT[i*FH+ 5] = FNT[i*FH+ 6] = FNT[i*FH+ 7] = b2 | b3; |
| 350 | FNT[i*FH+ 8] = FNT[i*FH+ 9] = FNT[i*FH+10] = FNT[i*FH+11] = b4 | b5; |
| 351 | } |
| 355 | 352 | } |
| 356 | 353 | |
| 357 | 354 | MACHINE_START( trs80 ) |
src/mess/drivers/trs80.c
| r1862 | r1863 | |
| 73 | 73 | LNW80 Colour board |
| 74 | 74 | LNW80 Hires graphics |
| 75 | 75 | LNW80 24x80 screen |
| 76 | | LNW80 Character generator hasn't been decoded, that's why the screen is corrupt |
| 77 | 76 | |
| 78 | 77 | ***************************************************************************/ |
| 79 | 78 | |
| r1862 | r1863 | |
| 285 | 284 | |
| 286 | 285 | INPUT_PORTS_END |
| 287 | 286 | |
| 288 | | static const gfx_layout trs80_charlayout_normal_width = |
| 287 | static const gfx_layout trs80_charlayout = |
| 289 | 288 | { |
| 290 | 289 | FW,FH, /* 6 x 12 characters */ |
| 291 | 290 | 256, /* 256 characters */ |
| r1862 | r1863 | |
| 299 | 298 | 8*FH /* every char takes FH bytes */ |
| 300 | 299 | }; |
| 301 | 300 | |
| 302 | | static const gfx_layout lnw80_charlayout_normal_width = |
| 303 | | { |
| 304 | | 8, 8, /* 6 x 12 characters */ |
| 305 | | 256, /* 256 characters */ |
| 306 | | 1, /* 1 bits per pixel */ |
| 307 | | { 0 }, /* no bitplanes; 1 bit per pixel */ |
| 308 | | /* x offsets */ |
| 309 | | { 5, 6, 1, 0, 2, 3, 4, 7 }, |
| 310 | | /* y offsets */ |
| 311 | | { 0*8, 0x200*8, 0x100*8, 0x300*8, 1*8, 0x201*8, 0x101*8, 0x301*8 }, |
| 312 | | 2*8 /* every char takes FH bytes */ |
| 313 | | }; |
| 314 | | |
| 315 | 301 | static GFXDECODE_START( trs80 ) |
| 316 | | GFXDECODE_ENTRY( REGION_GFX1, 0, trs80_charlayout_normal_width, 0, 1 ) |
| 302 | GFXDECODE_ENTRY( REGION_GFX1, 0, trs80_charlayout, 0, 1 ) |
| 317 | 303 | GFXDECODE_END |
| 318 | 304 | |
| 319 | | static GFXDECODE_START( lnw80 ) |
| 320 | | GFXDECODE_ENTRY( REGION_GFX1, 0, lnw80_charlayout_normal_width, 0, 1 ) |
| 321 | | GFXDECODE_END |
| 322 | 305 | |
| 323 | | |
| 324 | 306 | static const INT16 speaker_levels[3] = {0.0*32767,0.46*32767,0.85*32767}; |
| 325 | 307 | |
| 326 | 308 | static const struct Speaker_interface speaker_interface = |
| r1862 | r1863 | |
| 370 | 352 | MDRV_CPU_IO_MAP( io_model1, 0 ) |
| 371 | 353 | MACHINE_DRIVER_END |
| 372 | 354 | |
| 373 | | static MACHINE_DRIVER_START( lnw80 ) |
| 374 | | MDRV_IMPORT_FROM( model1 ) |
| 375 | | MDRV_GFXDECODE( lnw80 ) |
| 376 | | MACHINE_DRIVER_END |
| 377 | 355 | |
| 378 | | |
| 379 | 356 | static MACHINE_DRIVER_START( model3 ) |
| 380 | 357 | MDRV_IMPORT_FROM( level1 ) |
| 381 | 358 | MDRV_CPU_MODIFY( "main" ) |
| r1862 | r1863 | |
| 441 | 418 | ROM_LOAD("lnw_c1.bin", 0x2800, 0x0800, CRC(ed547445) SHA1(20102de89a3ee4a65366bc2d62be94da984a156b)) |
| 442 | 419 | |
| 443 | 420 | ROM_REGION(0x01000, REGION_GFX1,0) |
| 444 | | ROM_LOAD("lnw_chr.bin",0x0000, 0x0800, CRC(c89b27df) SHA1(be2a009a07e4378d070002a558705e9a0de59389)) |
| 421 | ROM_LOAD("lnw_chr.bin",0x0800, 0x0400, CRC(c89b27df) SHA1(be2a009a07e4378d070002a558705e9a0de59389)) |
| 422 | ROM_IGNORE( 0x400 ) /* leave out unused ff's */ |
| 445 | 423 | ROM_END |
| 446 | 424 | |
| 447 | 425 | ROM_START(trs80m3) |
| r1862 | r1863 | |
| 535 | 513 | COMP( 1978, trs80l2, trs80, 0, model1, trs80, trs80, trs8012, "Tandy Radio Shack", "TRS-80 Model I (Radio Shack Level II Basic)" , 0) |
| 536 | 514 | COMP( 1978, trs80l2a, trs80, 0, model1, trs80, trs80, trs8012, "Tandy Radio Shack", "TRS-80 Model I (R/S L2 Basic)" , 0) |
| 537 | 515 | COMP( 1980, sys80, trs80, 0, model1, trs80, trs80, trs8012, "EACA Computers Ltd.","System-80" , 0) |
| 538 | | COMP( 1981, lnw80, trs80, 0, lnw80, trs80, lnw80, trs8012, "LNW Research","LNW-80", 0 ) |
| 516 | COMP( 1981, lnw80, trs80, 0, model1, trs80, lnw80, trs8012, "LNW Research","LNW-80", 0 ) |
| 539 | 517 | COMP( 1980, trs80m3, trs80, 0, model3, trs80, trs80, trs8012, "Tandy Radio Shack", "TRS-80 Model III", GAME_NOT_WORKING ) |
| 540 | 518 | COMP( 1980, trs80m4, trs80, 0, model3, trs80, trs80, trs8012, "Tandy Radio Shack", "TRS-80 Model 4", GAME_NOT_WORKING ) |
| 541 | 519 | |