Previous 15994 Revisions Next

r5939 Friday 2nd October, 2009 at 09:06:11 UTC by Barry Rodewald
[FMTOWNS] Added Kanji ports, messages on boot screen are now visible.
[src/mess/drivers]fmtowns.c

src/mess/drivers/fmtowns.c
r5938r5939
9797static UINT8 towns_palette_g[256];
9898static UINT8 towns_palette_b[256];
9999static UINT8 towns_degipal[8];
100static UINT16 towns_kanji_offset;
101static UINT8 towns_kanji_code_h;
102static UINT8 towns_kanji_code_l;
100103
101104static void towns_update_video_banks(const address_space* space);
102105
r5938r5939
405408
406409static READ8_HANDLER( towns_video_cff80_r )
407410{
411   UINT8* ROM = memory_region(space->machine,"user");
408412   if(towns_mainmem_enable != 0)
409413      return mess_ram[offset+0xcff80];
410414   
r5938r5939
412416   {
413417      case 0x01:  // read/write plane select (bit 0-3 write, bit 6-7 read)
414418         return ((towns_vram_rplane << 6) & 0xc0) | towns_vram_wplane;
419      case 0x16:  // Kanji character data
420         return ROM[(towns_kanji_offset << 1) + 0x180000];
421      case 0x17:  // Kanji character data
422         return ROM[(towns_kanji_offset++ << 1) + 0x180001];
415423      case 0x19:  // ANK CG ROM
416424         if(towns_ankcg_enable != 0)
417425            return 0x01;
r5938r5939
440448         towns_update_video_banks(space);
441449         logerror("VGA: VRAM wplane select = 0x%02x\n",towns_vram_wplane);
442450         break;
451      case 0x14:  // Kanji offset (high)
452         towns_kanji_code_h = data & 0x7f;
453         break;
454      case 0x15:  // Kanji offset (low)
455         towns_kanji_code_l = data & 0x7f;
456         // this is a little over the top...
457         if(towns_kanji_code_h < 0x30)
458         {
459            towns_kanji_offset = ((towns_kanji_code_l & 0x1f) << 4)
460                               | (((towns_kanji_code_l - 0x20) & 0x20) << 8)
461                               | (((towns_kanji_code_l - 0x20) & 0x40) << 6)
462                               | ((towns_kanji_code_h & 0x07) << 9);
463         }
464         else if(towns_kanji_code_h < 0x70)
465         {
466            towns_kanji_offset = ((towns_kanji_code_l & 0x1f) << 4)
467                               + (((towns_kanji_code_l - 0x20) & 0x60) << 8)
468                               + ((towns_kanji_code_h & 0x0f) << 9)
469                               + (((towns_kanji_code_h - 0x30) & 0x70) * 0xc00)
470                               + 0x8000;
471         }
472         else
473         {
474            towns_kanji_offset = ((towns_kanji_code_l & 0x1f) << 4)
475                               | (((towns_kanji_code_l - 0x20) & 0x20) << 8)
476                               | (((towns_kanji_code_l - 0x20) & 0x40) << 6)
477                               | ((towns_kanji_code_h & 0x07) << 9)
478                               | 0x38000;
479         }
480         break;
443481      case 0x19:  // ANK CG ROM
444482         towns_ankcg_enable = data & 0x00000100;
445483         towns_update_video_banks(space);
r5938r5939
702740   NULL
703741};
704742
743// for debugging
744static const gfx_layout x1_chars_16x16 =
745{
746   16,16,
747   RGN_FRAC(1,1),
748   1,
749   { 0 },
750   { 0, 1, 2, 3, 4, 5, 6, 7,8,9,10,11,12,13,14,15 },
751   { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
752   16*16
753};
754
755/* decoded for debugging purpose, this will be nuked in the end... */
756static GFXDECODE_START( towns )
757   GFXDECODE_ENTRY( "user",   0x180000, x1_chars_16x16,  0, 0x100 ) //needs to be checked when the ROM will be redumped
758GFXDECODE_END
759
705760static SYSTEM_CONFIG_START(towns)
706761   CONFIG_RAM_DEFAULT(0x6000000)  // 6MB will do to start, standard amount for the Marty
707762SYSTEM_CONFIG_END
r5938r5939
721776    MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
722777    MDRV_SCREEN_SIZE(640, 480)
723778    MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
779    MDRV_GFXDECODE(towns)
724780
725781    /* sound hardware */
726782    MDRV_SPEAKER_STANDARD_MONO("mono")

Previous 15994 Revisions Next


© 1998-2018 The MESS Team