Previous 199869 Revisions Next

r21295 Thursday 21st February, 2013 at 23:39:26 UTC by David Haywood
rotated object (map screen) + removed old debug code, will rewrite for further tests (nw)
[src/mame/drivers]coolridr.c

trunk/src/mame/drivers/coolridr.c
r21294r21295
424424   UINT32 m_blit4; // ?
425425   UINT32 m_b4flipx;
426426   UINT32 m_b4flipy;
427   UINT32 m_b4rotate;
427428
428429   UINT32 m_blit5_unused; // indirection enable + other bits?
429430   int m_indirect_tile_enable; // from m_blit5
r21294r21295
471472   DECLARE_WRITE32_MEMBER(sysh1_pal_w);
472473   DECLARE_WRITE32_MEMBER(sysh1_dma_w);
473474   DECLARE_WRITE32_MEMBER(sysh1_char_w);
474   DECLARE_READ32_MEMBER(coolridr_hack1_r);
475475   DECLARE_READ32_MEMBER(coolridr_hack2_r);
476476   DECLARE_READ16_MEMBER(h1_soundram_r);
477477   DECLARE_READ16_MEMBER(h1_soundram2_r);
r21294r21295
499499};
500500
501501#define PRINT_BLIT_STUFF \
502   printf("type blit %08x %08x(%d, %03x) %08x(%02x, %03x) %08x(%06x) %08x(%08x, %d, %d) %08x(%d,%d) %04x %04x %04x %04x %08x %08x %d %d\n", m_blit0, m_blit1_unused,m_b1mode,m_b1colorNumber, m_blit2_unused,m_b2tpen,m_b2colorNumber, m_blit3_unused,m_b3romoffset, m_blit4_unused, m_blit4, m_b4flipy, m_b4flipx, m_blit5_unused, m_indirect_tile_enable, m_indirect_zoom_enable, m_vCellCount, m_hCellCount, m_vZoom, m_hZoom, m_blit10, data, m_vPosition, m_hPosition); \
502   printf("type blit %08x %08x(%d, %03x) %08x(%02x, %03x) %08x(%06x) %08x(%08x, %d, %d, %d) %08x(%d,%d) %04x %04x %04x %04x %08x %08x %d %d\n", m_blit0, m_blit1_unused,m_b1mode,m_b1colorNumber, m_blit2_unused,m_b2tpen,m_b2colorNumber, m_blit3_unused,m_b3romoffset, m_blit4_unused, m_blit4, m_b4flipy,m_b4rotate, m_b4flipx, m_blit5_unused, m_indirect_tile_enable, m_indirect_zoom_enable, m_vCellCount, m_hCellCount, m_vZoom, m_hZoom, m_blit10, data, m_vPosition, m_hPosition); \
503503
504504
505505/* video */
r21294r21295
956956               if (!(m_blit0 & 1)) // don't bother for non-sprites
957957               {
958958                  m_blit4_unused = data & 0xf8fefefe;
959                  m_blit4 = data & 0x07010000;
959                  m_blit4 = data & 0x07000000;
960960                  m_b4flipx = data & 0x00000001;
961961                  m_b4flipy = (data & 0x00000100)>>8;
962                  m_b4rotate = (data & 0x00010000)>>16;
962963                  if (m_blit4_unused) printf("unknown bits in blit word %d -  %08x\n", m_blitterSerialCount, m_blit4_unused);
963964
964965                  // ---- -111 ---- ---r ---- ---y ---- ---x
r21294r21295
10281029               }
10291030               else
10301031               {
1032                  UINT16 used_hCellCount = m_hCellCount;
1033                  UINT16 used_vCellCount = m_vCellCount;
1034                  UINT16 used_flipx = m_b4flipx;
1035                  UINT16 used_flipy = m_b4flipy;
1036
1037                  if (m_b4rotate)
1038                  {
1039                     used_hCellCount = m_vCellCount;
1040                     used_vCellCount = m_hCellCount;
1041                     used_flipx = m_b4flipy;
1042                     used_flipy = m_b4flipx;
1043                     // do the zoom params rotate?
1044                  }
1045
10311046                  // SPRITES / BLITS
10321047
10331048                  // for text objects this is an address containing the 8-bit tile numbers to use for ASCII text
r21294r21295
10531068
10541069                  }
10551070
1056                  //if (m_b1mode)
1057                  //{
1058                  //   PRINT_BLIT_STUFF
1059                  //}
1060                  //else
1061                  //{
1062                  //   return;
1063                  //}
1064
10651071                  bitmap_rgb32* drawbitmap;
10661072
10671073                  // 0x30 - 0x60 are definitely the left screen, 0x90 - 0xc0 are definitely the right screen.. the modes seem priority related
r21294r21295
10701076                  else // 0x90, 0xa0, 0xb0, 0xc0
10711077                     drawbitmap = &m_temp_bitmap_sprites2;
10721078
1073                  int sizex = m_hCellCount * 16 * m_hZoom;
1074                  int sizey = m_vCellCount * 16 * m_vZoom;
1079                  int sizex = used_hCellCount * 16 * m_hZoom;
1080                  int sizey = used_vCellCount * 16 * m_vZoom;
10751081                  m_hPosition *= 0x40;
10761082                  m_vPosition *= 0x40;
10771083
r21294r21295
11111117                     break;
11121118                  }
11131119
1114/*
1115
1116-- a blit with tile numbers (in the compressed gfx roms) referencing compressed data in same roms
1117
1118
1119type blit 00000000 00000000(0, 32d) 00000000(00, 32d) 00000000(3e8ffc) 00000000(00000000) 00000000(0,0) 000d 0010 0040 0040 00000000 00000000 80 -48
11200x00(0x000) - 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0
11210x10(0x020) - 07668 076ef 0771d 07742 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0
11220x20(0x040) - 07772 0784b 07913 079fe 07aef 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0
11230x30(0x060) - 07b78 07c6b 07d5b 07e04 07ee7 07fd9 0806a 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0
11240x40(0x080) - 080ba 0819c 0827e 0835d 08445 0852f 08612 0870c 0878a 087f0 0887d 0891c 0897a 089bf 089e9 08a22
11250x50(0x0a0) - 08a6e 08b5f 08c4e 08d3d 08e1b 08efa 08fdb 090b7 09198 0927a 09365 0944c 09536 0961b 096f1 097db
11260x60(0x0c0) - 098c7 099ae 09a8b 09b70 09c4a 09d32 09e1a 09ef4 09fcf 0a0b3 0a18b 0a274 0a34f 0a42e 0a506 0a5c3
11270x70(0x0e0) - 0a6a2 0a78a 0a883 0a968 0aa56 0ab44 0ac2c 0ad0b 0add8 0aea8 0af72 0b046 0b10a 0b1da 0b298 0b333
11280x80(0x100) - 0b3d1 0b49e 0b57a 0b658 0b730 0b7fe 0b8bc 0b986 0ba39 0bae6 0bb83 0bc28 0bc7e 0bcc7 0bd68 0be11
11290x90(0x120) - 0bed1 0bf72 0c013 0c0be 0c160 0c210 0c2b1 0c356 0c3f5 0c492 0c52c 0c5b1 0c65a 0c70b 0c7a8 0c864
11300xa0(0x140) - 0c91a 0c9bb 0ca5b 0caf8 0cbbc 0cc6c 0cd24 0cdc9 0ce7c 0cf15 0cfb5 0d039 0d0ca 0d178 0d207 0d2c0
11310xb0(0x160) - 0d371 0d409 0d4a4 0d548 0d619 0d6ad 0d744 0d7f6 0d8bc 0d95f 0da00 0da83 0db1b 0dbc0 0dc50 0dd06
11320xc0(0x180) - 0ddb7 0de52 0deef 0df91 0e063 0e0ef 0e180 0e217 0e2d4 0e368 0e400 0e485 0e519 0e5be 0e650 0e702
1133
11340xd0(0x1a0) - 0403f 0003e 0f83e 0f83e 0f83a dd37e 05b2c e0f3c cf014 cb33c c5b16 c5800 0f83e 0f83e 0cb2c 01b2c // the compressed data referenced by 1a0
11350xe0(0x1c0) - 03374 de349 d0f83 d0f9a d0f83 02b9a e0f16 e8f16 d9688 c5a89 00b2c 00b7e e6365 d2348 c8b31 b7720
1136           c838a e4372 e0f43 d0f0e d2369 ce6dd da741 d07a7 c3b3c cf35c cf383 cf322 d2348 b7739 c8339 d0711
1137           a6288 c3b0e d7335 cd70e c5b16 a2722 d96dc 0003e 0f83e 0f804 cb395 d7f2c 04396 e478a e0f16 e2791
1138             df80e e0f3c c3b0e c5b16 c3b5c e2b7e dd808 c5b0e c5a88 a6322 b7765 d738f dd806 c82dc c8b48 d2339
1139           be341 ce722 d737e 01b05 be348 ce739 c8305 dcf73 c8365 d7376 01360 d06dd c82f8 d8305 c17a7 b7365
1140           d732c 00b20 da6dd d0760 be755 be362 b73a3 d0f76 e5800 0f83e 0f83e 0f83e 0f81e e5b2c 03b34 02000
1141           0f83e 0f83c dd01c e401a e4316 06376 c5a88 06b90 c381a cb30e 06334 e0e98 05b7e d72dc c8814 dfb16
1142           c8339 a2003 04b2c d7289 d96dc 04334 e0f16 c8a98 cc6dc 04396 e633c c5a88 b7288 01b2c ddb74 cb37e
1143           e633c cf383 e0f4d cf002 cb374 d0f5c cf335 cf316 a2316 c5b0e e0f4d 00374 e2b72 d370e e2716 c5b22
1144           c8b16 c5ba3 c3b3c ddb72 cf33c cf30e c5b0e c8a98 d9716 a2722 a6343 d730e c3b16 a2365 b7322 a2365
1145           b7348 d8b41 c8383 d730e a22dd c8320 c8b22 b7348 c8341 c833b cf316 c5b22 ce6f8 d6348 ce6dc c8305
1146             c9f27 be360 e2716 c8b48 d8373 d0720 dcf05 c9f38 ce338 ce327 c5a88 b7339 d06f8 c8327 ce327 ce338
1147           ce392 ce338 a2322 ce720 be348 d0727 e5387 e7394 ce30b c2f10 c5adc d06f9 ce755 e4b38 e7387 e1f10
1148           d5b56 cfb65 ce705 c9f27 be327 c4310 e1f0b d775d cfb9c 8c320 a4338 e1f38 c9f0b ce387 e7356 d773e
1149           cfb56 8c00f d2348 c8b22 b7322 a2365 c3b0e c3b89 c8a88 a6365 a2716 c8b48 d2322 b7288 c5a88 d9722
1150
1151-- another blit, referencing the same compressed data
1152
1153type blit 00000000 00000000(0, 32d) 00000000(00, 32d) 00000000(3e8fc8) 00000000(00000000) 00000000(0,0) 000d 0010 0040 0040 00000000 00000000 64 136
11540x00(0x000) - 00340 00340 00340 00340 00340 00340 00340 00340 00340 00340 00340 00342 00357 003ae 00411 00340
11550x10(0x020) - 00340 00340 00340 00340 00340 00340 00340 00340 00340 00340 0041f 00443 00523 0061d 0070a 007f2
11560x20(0x040) - 00340 00340 00340 00340 00340 00340 00340 008b5 008ea 00928 0098a 00a44 00b01 00ba0 00c73 00d21
11570x30(0x060) - 00340 00340 00340 00dc7 00df2 00e85 00f5a 01053 01149 01239 0131d 013ea 014d5 015b9 0168c 01736
11580x40(0x080) - 017ff 00340 0181d 0183c 01911 01a05 01ae9 01bd5 01cca 01db6 01e4c 01ebe 01fa9 02069 02138 02210
11590x50(0x0a0) - 022f3 023d0 024a6 02577 0264c 02732 0281c 028f7 029e1 02a8c 02b11 02ba8 02c7d 02d60 02e3b 02f28
11600x60(0x0c0) - 0300e 030d6 031a4 0326b 0331e 033d8 034a0 03575 0363d 03730 03818 038f5 039dd 03ac6 03b9c 03c80
11610x70(0x0e0) - 03d66 03e0a 03ec1 03f60 04016 040d7 04179 0421c 042db 0437c 0442e 044d2 04567 04630 0470b 047e1
11620x80(0x100) - 048b3 04963 04a1a 04abc 04b69 04c20 04ce0 04d78 04e27 04ec9 04f65 0500f 050cf 05173 05227 052d0
11630x90(0x120) - 05390 05438 054e6 05583 0563f 056ee 057a5 05859 05926 059cf 05a5f 05b01 05ba8 05c5e 05d33 05dea
11640xa0(0x140) - 05e82 05f2b 05fda 06078 0613a 061df 06298 06345 06410 064c2 0655a 065f0 06682 06731 067cc 06861
11650xb0(0x160) - 068fa 069a3 06a54 06078 0613a 06af2 06baa 06c59 06d0e 06dbc 06e5b 06ef0 06fa2 07051 07101 071b9
11660xc0(0x180) - 05390 05438 054e6 06078 0613a 07276 0732c 06c59 073d9 07488 06e5b 06ef0 07528 075ca 07686 07747
1167
11680xd0(0x1a0) - 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 // this is the data pointed to by the blit above, we reference past it for the compressed data this time
11690xe0(0x1c0) - 07668 076ef 0771d 07742 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0
11700xf0(0x1e0) - 07772 0784b 07913 079fe 07aef 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0
1171x100(0x200) - 07b78 07c6b 07d5b 07e04 07ee7 07fd9 0806a 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0 001a0
11720110(0x220) - 080ba 0819c 0827e 0835d 08445 0852f 08612 0870c 0878a 087f0 0887d 0891c 0897a 089bf 089e9 08a22
11730120(0x240) - 08a6e 08b5f 08c4e 08d3d 08e1b 08efa 08fdb 090b7 09198 0927a 09365 0944c 09536 0961b 096f1 097db
11740130(0x260) - 098c7 099ae 09a8b 09b70 09c4a 09d32 09e1a 09ef4 09fcf 0a0b3 0a18b 0a274 0a34f 0a42e 0a506 0a5c3
11750140(0x280) - 0a6a2 0a78a 0a883 0a968 0aa56 0ab44 0ac2c 0ad0b 0add8 0aea8 0af72 0b046 0b10a 0b1da 0b298 0b333
11760150(0x2a0) - 0b3d1 0b49e 0b57a 0b658 0b730 0b7fe 0b8bc 0b986 0ba39 0bae6 0bb83 0bc28 0bc7e 0bcc7 0bd68 0be11
11770160(0x2c0) - 0bed1 0bf72 0c013 0c0be 0c160 0c210 0c2b1 0c356 0c3f5 0c492 0c52c 0c5b1 0c65a 0c70b 0c7a8 0c864
11780170(0x2e0) - 0c91a 0c9bb 0ca5b 0caf8 0cbbc 0cc6c 0cd24 0cdc9 0ce7c 0cf15 0cfb5 0d039 0d0ca 0d178 0d207 0d2c0
11790180(0x300) - 0d371 0d409 0d4a4 0d548 0d619 0d6ad 0d744 0d7f6 0d8bc 0d95f 0da00 0da83 0db1b 0dbc0 0dc50 0dd06
11800190(0x320) - 0ddb7 0de52 0deef 0df91 0e063 0e0ef 0e180 0e217 0e2d4 0e368 0e400 0e485 0e519 0e5be 0e650 0e702
1181
118201a0(0x340) - 0403f 0003e 0f83e 0f83e 0f83a dd37e 05b2c e0f3c cf014 cb33c c5b16 c5800 0f83e 0f83e 0cb2c 01b2c // the compressed data referenced by (0x340)
118301b0(0x360) - 03374 de349 d0f83 d0f9a d0f83 02b9a e0f16 e8f16 d9688 c5a89 00b2c 00b7e e6365 d2348 c8b31 b7720
1184             c838a e4372 e0f43 d0f0e d2369 ce6dd da741 d07a7 c3b3c cf35c cf383 cf322 d2348 b7739 c8339 d0711
1185*/
1186
1187
1188/*
1189investigate this sprite
1190(much wider, all columns the same)
119100200 (00016590,0)  00200 (00016590,0)
119200210 (00016592,0)  00210 (00016592,0)
119300251 (0001659a,1)  00251 (0001659a,1)
119400292 (000165a2,2)  00292 (000165a2,2)
1195002b7 (000165a6,7)  002b7 (000165a6,7)
1196002c4 (000165a8,4)  002c4 (000165a8,4)
1197002f4 (000165ae,4)  002f4 (000165ae,4)
119800335 (000165b6,5)  00335 (000165b6,5)
119900373 (000165be,3)  00373 (000165be,3)
12000038a (000165c1,2)  0038a (000165c1,2)
1201003ac (000165c5,4)  003ac (000165c5,4)
1202003bd (000165c7,5)  003bd (000165c7,5)
1203003fe (000165cf,6)  003fe (000165cf,6)
120400419 (000165d3,1)  00419 (000165d3,1)
12050045a (000165db,2)  0045a (000165db,2)
12060049b (000165e3,3)  0049b (000165e3,3)
1207004b2 (000165e6,2)  004b2 (000165e6,2)
1208
1209*/
1210
1211#if 0
1212                  // logging only
1213                  //if (!m_indirect_tile_enable)
1214                  {
1215                     //if (m_hCellCount==0x10)
1216                     {
1217                        for (int v = 0; v < m_vCellCount/*+16*/; v++)
1218                        {
1219                           for (int h = 0; h < m_hCellCount; h++)
1220                           {
1221                                 int lookupnum = h + (v*m_hCellCount);
1222                                 if (m_indirect_tile_enable)
1223                                 {
1224                                    const UINT32 memOffset = data;
1225                                    lookupnum = space.read_byte(memOffset + h + (v*m_hCellCount));
1226                                 }
1227                                 UINT32 spriteNumber = get_20bit_data( m_b3romoffset, lookupnum);
1228
1229#if 0
1230                                 printf("%05x (%08x,%d)  ",spriteNumber, (m_b3romoffset + (spriteNumber>>3)), spriteNumber&7 );
1231
1232
1233                                 if ((h == m_hCellCount-1))
1234                                    printf("\n");
1235
1236                                 if ((h == m_hCellCount-1) && (v == m_vCellCount-1))
1237                                    printf("\n");
1238#endif
1239#if 1
1240                                 int compdataoffset = (m_b3romoffset + (spriteNumber>>3));
1241                                 // do some logging for the sprite mentioned above 'investigate this sprite' looking at compressed data used in the first column
1242                                 //if ((compdataoffset==0x3e9030) && (h==0))
1243                                 if (v==0)
1244                                 {
1245                                    printf("%05x (%08x,%d) | ",spriteNumber, compdataoffset, spriteNumber&7 );
1246
1247
1248                                    //00200 (00016590,0)  00200 (00016590,0)
1249                                    //00210 (00016592,0)  00210 (00016592,0)
1250
1251                                    for (int i=0;i<8*12;i++)
1252                                    {
1253                                       UINT16 compdata = get_10bit_data( m_b3romoffset, spriteNumber + i);
1254                                       printf("%03x ", compdata);
1255
1256                                       // as 20-bit
1257                                       //   00200 (00016590,0) | 03c3e 0f83e 0f83e 0f83e 95e57 95e57 95e57 95e57 (03e57)
1258                                       //   00210 (00016592,0) | 03e57 95e57 95e07 81e07 81e07 81e07 81e07 81e07 81e07
1259
1260                                       // as 10-bit (pretty, I like this)
1261                                       /*                                                                                   |this is where 210 starts
1262                                       00200 (00016590,0) | 00f 03e 03e 03e 03e 03e 03e 03e 257 257 257 257 257 257 257 257 (00f 257)
1263                                       00210 (00016592,0) | 00f 257 257 257 257 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 237 237 237 237 237 237 237 237 237 237 237 237 237 237 237 237 (00f 237) - these lines are 64 lone
1264                                       00251 (0001659a,1) | 00f 237 237 237 237 237 237 237 237 237 237 237 237 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f (00f 21f)
1265                                       00292 (000165a2,2) | 00f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 24f 24f 24f 24f 24f 24f 24f 24f 24f 24f 24f 24f 0be 0be 0be 0be (00f 0be)
1266                                       002b7 (000165a6,7) | 00f 0be 0be 0be 263 263 263 263 07e 07e 07e 07e 05e (00f 07e)
1267                                       002c4 (000165a8,4) | 00f 07e 07e 05e 247 247 247 247 247 247 247 247 247 247 247 247 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f (00f 20f)
1268                                       002f4 (000165ae,4) | 00f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b (00f 23b)
1269                                       00335 (000165b6,5) | 00f 23b 23b 23b 23b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 24b 24b 24b 24b 24b 24b 24b 24b 24b 24b 24b 24b 0de (00f 0fe)
1270                                       00373 (000165be,3) | 00f 0fe 0fe 0fe 0fe 0fe 0fe 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 00f 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 267 267 267 267 17e 17e 17e 17e 15e (00f 17e)
1271                                       0038a (000165c1,2) | 00f 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 267 267 267 267 17e 17e 17e 17e 15e (00f 17e)
1272                                       003ac (000165c5,4) | 00f 17e 15e 1be 1be 1be 1be 1be 19e 217 217 217 217 217 217 217 217 (00f 217)
1273                                       003bd (000165c7,5) | 00f 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b (00f 22b)
1274                                       003fe (000165cf,6) | 00f 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 1fe 1fe 1fe 1fe 1fe 1de (00f 203)
1275                                       00419 (000165d3,1) | 00f 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 (00f 227)
1276                                       0045a (000165db,2) | 00f 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 253 253 253 253 253 253 253 253 253 253 253 253 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 (00f 213)
1277                                       0049b (000165e3,3) | 00f 213 213 213 213 213 213 213 213 13e 13e 13e 13e 13e 13e 21b 21b 21b 21b 21b 21b 21b 21b (000 21b)
1278                                       004b2 (000165e6,2) | 000 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 25f 25f 25f 25f 25b 25b 25b 25b 25b 25b 25b 25b 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f (000 000)
1279                                                                              */
1280                                    }
1281                                    printf("\n");
1282                                 }
1283#endif
1284
1285                           }
1286                        }
1287                     }
1288                  }
1289#endif
12901120                  UINT32 lastSpriteNumber = 0xffffffff;
1291
12921121                  // Splat some sprites
1293                  for (int v = 0; v < m_vCellCount; v++)
1122                  for (int v = 0; v < used_vCellCount; v++)
12941123                  {
12951124                     const int pixelOffsetY = ((m_vPosition) + (v* 16 * m_vZoom)) / 0x40;
12961125
12971126                     if (pixelOffsetY>383)
12981127                     {
1299                        v = m_vCellCount;
1128                        v = used_vCellCount;
13001129                        continue;
13011130                     }
13021131
13031132
1304                     for (int h = 0; h < m_hCellCount; h++)
1133                     for (int h = 0; h < used_hCellCount; h++)
13051134                     {
13061135                        const int pixelOffsetX = ((m_hPosition) + (h* 16 * m_hZoom)) / 0x40;
13071136
13081137                        if (pixelOffsetX>495)
13091138                        {
1310                           h = m_hCellCount;
1139                           h = used_hCellCount;
13111140                           continue;
13121141                        }
13131142
r21294r21295
13171146                        // this allows text strings to be written as 8-bit ascii in one area (using command 0x10), and drawn using multi-width sprites
13181147                        if (m_indirect_tile_enable)
13191148                        {
1320                           lookupnum = space.read_byte(data + h + (v*m_hCellCount));
1149                           lookupnum = space.read_byte(data + h + (v*used_hCellCount));
13211150                        }
13221151                        else
13231152                        {
1324                           if (!m_b4flipy)
1153                           if (!m_b4rotate)
13251154                           {
1326                              if (!m_b4flipx)
1327                                 lookupnum = h + (v*m_hCellCount);
1155                              if (!used_flipy)
1156                              {
1157                                 if (!used_flipx)
1158                                    lookupnum = h + (v*used_hCellCount);
1159                                 else
1160                                    lookupnum = (used_hCellCount-h-1) + (v*used_hCellCount);
1161                              }
13281162                              else
1329                                 lookupnum = (m_hCellCount-h-1) + (v*m_hCellCount);
1163                              {
1164                                 if (!used_flipx)
1165                                    lookupnum = h + ((used_vCellCount-v-1)*used_hCellCount);
1166                                 else
1167                                    lookupnum = (used_hCellCount-h-1) + ((used_vCellCount-v-1)*used_hCellCount);
1168
1169                              }
13301170                           }
13311171                           else
13321172                           {
1333                              if (!m_b4flipx)
1334                                 lookupnum = h + ((m_vCellCount-v-1)*m_hCellCount);
1173                              if (!used_flipy)
1174                              {
1175                                 if (!used_flipx)
1176                                    lookupnum = v + (h*used_vCellCount);
1177                                 else
1178                                    lookupnum = (used_vCellCount-v-1) + (h*used_vCellCount);
1179                              }
13351180                              else
1336                                 lookupnum = (m_hCellCount-h-1) + ((m_vCellCount-v-1)*m_hCellCount);
1181                              {
1182                                 if (!used_flipx)
1183                                    lookupnum = v + ((used_hCellCount-h-1)*used_vCellCount);
1184                                 else
1185                                    lookupnum = (used_vCellCount-v-1) + ((used_hCellCount-h-1)*used_vCellCount);
13371186
1187                              }
13381188                           }
13391189                        }
13401190
r21294r21295
14091259
14101260                        // DEBUG: Draw 16x16 block
14111261                        UINT32* line;
1412                        if (m_b4flipy)
1262                        if (m_b4rotate)
14131263                        {
1414                           for (int y = 0; y < 16; y++)
1264                           if (used_flipy)
14151265                           {
1416                              const int drawy = pixelOffsetY+y;
1417                              if ((drawy>383) || (drawy<0)) continue;
1418                              line = &drawbitmap->pix32(drawy);
1419
1420                              if (m_b4flipx)
1266                              for (int y = 0; y < 16; y++)
14211267                              {
1422                                 for (int x = 0; x < 16; x++)
1268                                 const int drawy = pixelOffsetY+y;
1269                                 if ((drawy>383) || (drawy<0)) continue;
1270                                 line = &drawbitmap->pix32(drawy);
1271
1272                                 if (used_flipx)
14231273                                 {
1424                                    const int drawx = pixelOffsetX+x;
1425                                    if ((drawx>=495 || drawx<0)) continue;
1274                                    for (int x = 0; x < 16; x++)
1275                                    {
1276                                       const int drawx = pixelOffsetX+x;
1277                                       if ((drawx>=495 || drawx<0)) continue;
14261278
1427                                    UINT16 pix = m_tempshape[(15-y)*16+(15-x)];
1428                                    if (pix )
1429                                       if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
1279                                       UINT16 pix = m_tempshape[(15-x)*16+(15-y)];
1280                                       if (pix )
1281                                          if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
1282                                    }
14301283                                 }
1284                                 else
1285                                 {
1286                                    for (int x = 0; x < 16; x++)
1287                                    {
1288                                       const int drawx = pixelOffsetX+x;
1289                                       if ((drawx>=495 || drawx<0)) continue;
1290
1291                                       UINT16 pix = m_tempshape[(15-x)*16+y];
1292                                       if (pix )
1293                                          if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
1294                                    }
1295                                 }
14311296                              }
1432                              else
1297                           }
1298                           else
1299                           {
1300                              for (int y = 0; y < 16; y++)
14331301                              {
1434                                 for (int x = 0; x < 16; x++)
1302                                 const int drawy = pixelOffsetY+y;
1303                                 if ((drawy>383) || (drawy<0)) continue;
1304                                 line = &drawbitmap->pix32(drawy);
1305
1306                                 if (used_flipx)
14351307                                 {
1436                                    const int drawx = pixelOffsetX+x;
1437                                    if ((drawx>=495 || drawx<0)) continue;
1308                                    for (int x = 0; x < 16; x++)
1309                                    {
1310                                       const int drawx = pixelOffsetX+x;
1311                                       if ((drawx>=495 || drawx<0)) continue;
14381312
1439                                    UINT16 pix = m_tempshape[(15-y)*16+x];
1440                                    if (pix )
1441                                       if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
1313                                       UINT16 pix = m_tempshape[x*16+(15-y)];
1314                                       if (pix )
1315                                          if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
1316                                    }
14421317                                 }
1318                                 else
1319                                 {
1320                                    for (int x = 0; x < 16; x++)
1321                                    {
1322                                       const int drawx = pixelOffsetX+x;
1323                                       if ((drawx>=495 || drawx<0)) continue;
1324
1325                                       UINT16 pix = m_tempshape[x*16+y];
1326                                       if (pix )
1327                                          if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
1328                                    }
1329                                 }
14431330                              }
1444                           }
1331                           }                       
14451332                        }
14461333                        else
14471334                        {
1448                           for (int y = 0; y < 16; y++)
1335                           if (used_flipy)
14491336                           {
1450                              const int drawy = pixelOffsetY+y;
1451                              if ((drawy>383) || (drawy<0)) continue;
1452                              line = &drawbitmap->pix32(drawy);
1453
1454                              if (m_b4flipx)
1337                              for (int y = 0; y < 16; y++)
14551338                              {
1456                                 for (int x = 0; x < 16; x++)
1339                                 const int drawy = pixelOffsetY+y;
1340                                 if ((drawy>383) || (drawy<0)) continue;
1341                                 line = &drawbitmap->pix32(drawy);
1342
1343                                 if (used_flipx)
14571344                                 {
1458                                    const int drawx = pixelOffsetX+x;
1459                                    if ((drawx>=495 || drawx<0)) continue;
1345                                    for (int x = 0; x < 16; x++)
1346                                    {
1347                                       const int drawx = pixelOffsetX+x;
1348                                       if ((drawx>=495 || drawx<0)) continue;
14601349
1461                                    UINT16 pix = m_tempshape[y*16+(15-x)];
1462                                    if (pix )
1463                                       if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
1350                                       UINT16 pix = m_tempshape[(15-y)*16+(15-x)];
1351                                       if (pix )
1352                                          if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
1353                                    }
14641354                                 }
1355                                 else
1356                                 {
1357                                    for (int x = 0; x < 16; x++)
1358                                    {
1359                                       const int drawx = pixelOffsetX+x;
1360                                       if ((drawx>=495 || drawx<0)) continue;
1361
1362                                       UINT16 pix = m_tempshape[(15-y)*16+x];
1363                                       if (pix )
1364                                          if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
1365                                    }
1366                                 }
14651367                              }
1466                              else
1368                           }
1369                           else
1370                           {
1371                              for (int y = 0; y < 16; y++)
14671372                              {
1468                                 for (int x = 0; x < 16; x++)
1373                                 const int drawy = pixelOffsetY+y;
1374                                 if ((drawy>383) || (drawy<0)) continue;
1375                                 line = &drawbitmap->pix32(drawy);
1376
1377                                 if (used_flipx)
14691378                                 {
1470                                    const int drawx = pixelOffsetX+x;
1471                                    if ((drawx>=495 || drawx<0)) continue;
1379                                    for (int x = 0; x < 16; x++)
1380                                    {
1381                                       const int drawx = pixelOffsetX+x;
1382                                       if ((drawx>=495 || drawx<0)) continue;
14721383
1473                                    UINT16 pix = m_tempshape[y*16+x];
1474                                    if (pix )
1475                                       if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
1384                                       UINT16 pix = m_tempshape[y*16+(15-x)];
1385                                       if (pix )
1386                                          if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
1387                                    }
14761388                                 }
1389                                 else
1390                                 {
1391                                    for (int x = 0; x < 16; x++)
1392                                    {
1393                                       const int drawx = pixelOffsetX+x;
1394                                       if ((drawx>=495 || drawx<0)) continue;
1395
1396                                       UINT16 pix = m_tempshape[y*16+x];
1397                                       if (pix )
1398                                          if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
1399                                    }
1400                                 }
14771401                              }
14781402                           }
14791403                        }
1480
14811404#if 0 // this one does zooming
14821405                        // DEBUG: Draw 16x16 block
14831406                        UINT32* line;
r21294r21295
24152338   MCFG_SCREEN_ADD("lscreen", RASTER)
24162339   MCFG_SCREEN_REFRESH_RATE(60)
24172340   MCFG_SCREEN_SIZE(640, 512)
2418   MCFG_SCREEN_VISIBLE_AREA(0,495, 0, 383) // the game uses this resolution
2419   //MCFG_SCREEN_VISIBLE_AREA(0,639, 0, 479) // the 'for use in Japan screen uses this resolution' (Outrunners also uses the higher res for this screen on system 32..)
2341   MCFG_SCREEN_VISIBLE_AREA(0,495, 0, 383)
24202342   MCFG_SCREEN_UPDATE_DRIVER(coolridr_state, screen_update_coolridr1)
24212343
24222344   MCFG_SCREEN_ADD("rscreen", RASTER)
24232345   MCFG_SCREEN_REFRESH_RATE(60)
24242346   MCFG_SCREEN_SIZE(640, 512)
2425   MCFG_SCREEN_VISIBLE_AREA(0,495, 0, 383) // the game uses this resolution
2426   //MCFG_SCREEN_VISIBLE_AREA(0,639, 0, 479) // the 'for use in ... screen uses this resolution'
2347   MCFG_SCREEN_VISIBLE_AREA(0,495, 0, 383)
24272348   MCFG_SCREEN_UPDATE_DRIVER(coolridr_state, screen_update_coolridr2)
24282349
24292350   MCFG_PALETTE_LENGTH(0x10000)
r21294r21295
25152436READ32_MEMBER(coolridr_state::coolridr_hack2_r)
25162437{
25172438   offs_t pc = downcast<cpu_device *>(&space.device())->pc();
2439
2440
25182441   if(pc == 0x6002cba || pc == 0x6002d42)
25192442      return 0;
25202443
2444   // with the non-recompiler pc returns +2
2445   if(pc == 0x06002cbc || pc == 0x06002d44)
2446      return 0;
2447   
25212448   return m_sysh1_workram_h[0xd8894/4];
25222449}
25232450
2451
2452
25242453DRIVER_INIT_MEMBER(coolridr_state,coolridr)
25252454{
2526//  machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x60d88a4, 0x060d88a7, FUNC(coolridr_hack1_r) );
25272455   machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x60d8894, 0x060d8897, read32_delegate(FUNC(coolridr_state::coolridr_hack2_r), this));
2456
2457
2458   sh2drc_set_options(machine().device("maincpu"), SH2DRC_FASTEST_OPTIONS);
2459   sh2drc_set_options(machine().device("sub"), SH2DRC_FASTEST_OPTIONS);
25282460}
25292461
25302462GAME( 1995, coolridr,    0, coolridr,    coolridr, coolridr_state,    coolridr, ROT0,  "Sega", "Cool Riders",GAME_NOT_WORKING|GAME_NO_SOUND ) // region is set in test mode, this set is for Japan, USA and Export (all regions)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team