Previous 15994 Revisions Next

r1863 Saturday 8th March, 2008 at 16:59:02 UTC by Robbbert
[TRS80] Add back chunky gfx for LNW80
[src/mess/drivers]trs80.c
[src/mess/machine]trs80.c
[src/mess/video]trs80.c

src/mess/video/trs80.c
r1862r1863
1616***************************************************************************/
1717static int width_store = 10;  // bodgy value to force an initial resize
1818
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***************************************************************************/
2519VIDEO_UPDATE( trs80 )
2620{
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);
2923   int i=0,x,y,chr;
3024   int adj=readinputport(0)&0x40;
3125
r1862r1863
3428      width_store = width;
3529      video_screen_set_visarea(0, 0, width*FW-1, 0, 16*FH-1);
3630   }
31
3732   for (y = 0; y < 16; y++)
3833   {
3934      for (x = 0; x < 64; x+=skip)
4035      {
41         i = y * 64 + x;
36         i = (y << 6) + x;
4237         chr=videoram[i];
4338         if ((adj) && (chr < 32)) chr+=64;         // 7-bit video handler
4439         drawgfx( bitmap,machine->gfx[0],chr,0,0,0,x/skip*FW,y*FH,
src/mess/machine/trs80.c
r1862r1863
325325
326326DRIVER_INIT( lnw80 )
327327{
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 };
330330
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   }
355352}
356353
357354MACHINE_START( trs80 )
src/mess/drivers/trs80.c
r1862r1863
7373 LNW80 Colour board
7474 LNW80 Hires graphics
7575 LNW80 24x80 screen
76 LNW80 Character generator hasn't been decoded, that's why the screen is corrupt
7776
7877***************************************************************************/
7978
r1862r1863
285284
286285INPUT_PORTS_END
287286
288static const gfx_layout trs80_charlayout_normal_width =
287static const gfx_layout trs80_charlayout =
289288{
290289   FW,FH,         /* 6 x 12 characters */
291290   256,         /* 256 characters */
r1862r1863
299298   8*FH         /* every char takes FH bytes */
300299};
301300
302static 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
315301static 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 )
317303GFXDECODE_END
318304
319static GFXDECODE_START( lnw80 )
320   GFXDECODE_ENTRY( REGION_GFX1, 0, lnw80_charlayout_normal_width, 0, 1 )
321GFXDECODE_END
322305
323
324306static const INT16 speaker_levels[3] = {0.0*32767,0.46*32767,0.85*32767};
325307
326308static const struct Speaker_interface speaker_interface =
r1862r1863
370352   MDRV_CPU_IO_MAP( io_model1, 0 )
371353MACHINE_DRIVER_END
372354
373static MACHINE_DRIVER_START( lnw80 )
374   MDRV_IMPORT_FROM( model1 )
375   MDRV_GFXDECODE( lnw80 )
376MACHINE_DRIVER_END
377355
378
379356static MACHINE_DRIVER_START( model3 )
380357   MDRV_IMPORT_FROM( level1 )
381358   MDRV_CPU_MODIFY( "main" )
r1862r1863
441418   ROM_LOAD("lnw_c1.bin", 0x2800, 0x0800, CRC(ed547445) SHA1(20102de89a3ee4a65366bc2d62be94da984a156b))
442419
443420   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 */
445423ROM_END
446424
447425ROM_START(trs80m3)
r1862r1863
535513COMP( 1978, trs80l2,  trs80,    0,      model1,   trs80, trs80,    trs8012,   "Tandy Radio Shack",  "TRS-80 Model I (Radio Shack Level II Basic)" , 0)
536514COMP( 1978, trs80l2a, trs80,    0,      model1,   trs80, trs80,    trs8012,   "Tandy Radio Shack",  "TRS-80 Model I (R/S L2 Basic)" , 0)
537515COMP( 1980, sys80,    trs80,    0,      model1,   trs80, trs80,    trs8012,   "EACA Computers Ltd.","System-80" , 0)
538COMP( 1981, lnw80,    trs80,    0,      lnw80,    trs80, lnw80,    trs8012,   "LNW Research","LNW-80", 0 )
516COMP( 1981, lnw80,    trs80,    0,      model1,   trs80, lnw80,    trs8012,   "LNW Research","LNW-80", 0 )
539517COMP( 1980, trs80m3,  trs80,    0,      model3,   trs80, trs80,    trs8012,   "Tandy Radio Shack",  "TRS-80 Model III", GAME_NOT_WORKING )
540518COMP( 1980, trs80m4,  trs80,    0,      model3,   trs80, trs80,    trs8012,   "Tandy Radio Shack",  "TRS-80 Model 4", GAME_NOT_WORKING )
541519

Previous 15994 Revisions Next


© 1998-2018 The MESS Team