Previous 15994 Revisions Next

r7016 Tuesday 12th January, 2010 at 10:44:39 UTC by Barry Rodewald
[FMTOWNS] Fixed Kanji port use in Prince of Persia (hopefully).
[src/mess/video]fmtowns.c

src/mess/video/fmtowns.c
r7015r7016
250250   }
251251}
252252
253static void towns_update_kanji_offset(void)
254{
255   // this is a little over the top...
256   if(towns_kanji_code_h < 0x30)
257   {
258      towns_kanji_offset = ((towns_kanji_code_l & 0x1f) << 4)
259                         | (((towns_kanji_code_l - 0x20) & 0x20) << 8)
260                         | (((towns_kanji_code_l - 0x20) & 0x40) << 6)
261                         | ((towns_kanji_code_h & 0x07) << 9);
262   }
263   else if(towns_kanji_code_h < 0x70)
264   {
265      towns_kanji_offset = ((towns_kanji_code_l & 0x1f) << 4)
266                         + (((towns_kanji_code_l - 0x20) & 0x60) << 8)
267                         + ((towns_kanji_code_h & 0x0f) << 9)
268                         + (((towns_kanji_code_h - 0x30) & 0x70) * 0xc00)
269                         + 0x8000;
270   }
271   else
272   {
273      towns_kanji_offset = ((towns_kanji_code_l & 0x1f) << 4)
274                         | (((towns_kanji_code_l - 0x20) & 0x20) << 8)
275                         | (((towns_kanji_code_l - 0x20) & 0x40) << 6)
276                         | ((towns_kanji_code_h & 0x07) << 9)
277                         | 0x38000;
278   }
279}
280
253281READ8_HANDLER( towns_video_cff80_r )
254282{
255283   UINT8* ROM = memory_region(space->machine,"user");
r7015r7016
302330         towns_vram_wplane = data & 0x0f;
303331         towns_vram_rplane = (data & 0xc0) >> 6;
304332         towns_update_video_banks(space);
305         logerror("VGA: VRAM wplane select = 0x%02x\n",towns_vram_wplane);
333         //logerror("VGA: VRAM wplane select = 0x%02x\n",towns_vram_wplane);
306334         break;
307335      case 0x02:  // display plane (bits 0-2), display page select (bit 4)
308336         towns_display_plane = data & 0x27;
r7015r7016
313341         break;
314342      case 0x14:  // Kanji offset (high)
315343         towns_kanji_code_h = data & 0x7f;
344         towns_update_kanji_offset();
345         //logerror("VID: Kanji code set (high) = %02x %02x\n",towns_kanji_code_h,towns_kanji_code_l);
316346         break;
317347      case 0x15:  // Kanji offset (low)
318348         towns_kanji_code_l = data & 0x7f;
319         // this is a little over the top...
320         if(towns_kanji_code_h < 0x30)
321         {
322            towns_kanji_offset = ((towns_kanji_code_l & 0x1f) << 4)
323                               | (((towns_kanji_code_l - 0x20) & 0x20) << 8)
324                               | (((towns_kanji_code_l - 0x20) & 0x40) << 6)
325                               | ((towns_kanji_code_h & 0x07) << 9);
326         }
327         else if(towns_kanji_code_h < 0x70)
328         {
329            towns_kanji_offset = ((towns_kanji_code_l & 0x1f) << 4)
330                               + (((towns_kanji_code_l - 0x20) & 0x60) << 8)
331                               + ((towns_kanji_code_h & 0x0f) << 9)
332                               + (((towns_kanji_code_h - 0x30) & 0x70) * 0xc00)
333                               + 0x8000;
334         }
335         else
336         {
337            towns_kanji_offset = ((towns_kanji_code_l & 0x1f) << 4)
338                               | (((towns_kanji_code_l - 0x20) & 0x20) << 8)
339                               | (((towns_kanji_code_l - 0x20) & 0x40) << 6)
340                               | ((towns_kanji_code_h & 0x07) << 9)
341                               | 0x38000;
342         }
349         towns_update_kanji_offset();
350         //logerror("VID: Kanji code set (low) = %02x %02x\n",towns_kanji_code_h,towns_kanji_code_l);
343351         break;
344352      case 0x19:  // ANK CG ROM
345353         towns_ankcg_enable = data & 0x01;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team