trunk/src/mame/video/stvvdp2.c
| r20870 | r20871 | |
| 1103 | 1103 | | -- | -- | -- | -- | -- | -- | -- | -- | |
| 1104 | 1104 | \----------|----------|----------|----------|----------|----------|----------|---------*/ |
| 1105 | 1105 | |
| 1106 | #define STV_VDP2_SCXDN0 (m_vdp2_regs[0x072/2]) |
| 1107 | |
| 1106 | 1108 | /* 180074 - SCYIN0 - Screen Scroll (NBG0, Vertical Integer Part) |
| 1107 | 1109 | bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\ |
| 1108 | 1110 | | -- | -- | -- | -- | -- | -- | -- | -- | |
| r20870 | r20871 | |
| 1119 | 1121 | | -- | -- | -- | -- | -- | -- | -- | -- | |
| 1120 | 1122 | \----------|----------|----------|----------|----------|----------|----------|---------*/ |
| 1121 | 1123 | |
| 1124 | #define STV_VDP2_SCYDN0 (m_vdp2_regs[0x076/2]) |
| 1125 | |
| 1122 | 1126 | /* 180078 - Coordinate Inc (NBG0, Horizontal Integer Part) |
| 1123 | 1127 | bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\ |
| 1124 | 1128 | | -- | -- | -- | -- | -- | -- | -- | -- | |
| r20870 | r20871 | |
| 1182 | 1186 | | -- | -- | -- | -- | -- | -- | -- | -- | |
| 1183 | 1187 | \----------|----------|----------|----------|----------|----------|----------|---------*/ |
| 1184 | 1188 | |
| 1189 | #define STV_VDP2_SCXDN1 (m_vdp2_regs[0x082/2]) |
| 1190 | |
| 1185 | 1191 | /* 180084 - SCYIN1 - Screen Scroll (NBG1, Vertical Integer Part) |
| 1186 | 1192 | bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\ |
| 1187 | 1193 | | -- | -- | -- | -- | -- | -- | -- | -- | |
| r20870 | r20871 | |
| 1198 | 1204 | | -- | -- | -- | -- | -- | -- | -- | -- | |
| 1199 | 1205 | \----------|----------|----------|----------|----------|----------|----------|---------*/ |
| 1200 | 1206 | |
| 1207 | #define STV_VDP2_SCYDN1 (m_vdp2_regs[0x086/2]) |
| 1208 | |
| 1201 | 1209 | /* 180088 - Coordinate Inc (NBG1, Horizontal Integer Part) |
| 1202 | 1210 | bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09----|----08----\ |
| 1203 | 1211 | | -- | -- | -- | -- | -- | -- | -- | -- | |
| r20870 | r20871 | |
| 3011 | 3019 | UINT16 dot_data; |
| 3012 | 3020 | UINT16 pal_bank; |
| 3013 | 3021 | |
| 3014 | | /* TODO: clean this up. */ |
| 3015 | 3022 | xsize = (stv2_current_tilemap.bitmap_size & 2) ? 1024 : 512; |
| 3016 | 3023 | ysize = (stv2_current_tilemap.bitmap_size & 1) ? 512 : 256; |
| 3017 | 3024 | |
| r20870 | r20871 | |
| 3067 | 3074 | int scrolly = stv2_current_tilemap.scrolly; |
| 3068 | 3075 | UINT16 dot_data; |
| 3069 | 3076 | UINT16 pal_bank; |
| 3077 | int xf, yf; |
| 3070 | 3078 | |
| 3071 | | /* TODO: clean this up. */ |
| 3072 | 3079 | xsize = (stv2_current_tilemap.bitmap_size & 2) ? 1024 : 512; |
| 3073 | 3080 | ysize = (stv2_current_tilemap.bitmap_size & 1) ? 512 : 256; |
| 3074 | 3081 | |
| r20870 | r20871 | |
| 3089 | 3096 | if(stv_vdp2_window_process(xdst,ydst)) |
| 3090 | 3097 | continue; |
| 3091 | 3098 | |
| 3092 | | xsrc = (xdst + scrollx) & (xsize_mask-1); |
| 3093 | | ysrc = (ydst + scrolly) & (ysize_mask-1); |
| 3099 | xf = stv2_current_tilemap.incx * xdst; |
| 3100 | xf>>=16; |
| 3101 | yf = stv2_current_tilemap.incy * ydst; |
| 3102 | yf>>=16; |
| 3103 | |
| 3104 | xsrc = (xf + scrollx) & (xsize_mask-1); |
| 3105 | ysrc = (yf + scrolly) & (ysize_mask-1); |
| 3094 | 3106 | src_offs = (xsrc + (ysrc*xsize)); |
| 3095 | 3107 | src_offs += map_offset; |
| 3096 | 3108 | src_offs &= 0x7ffff; |
| r20870 | r20871 | |
| 3122 | 3134 | int r,g,b; |
| 3123 | 3135 | UINT16 dot_data; |
| 3124 | 3136 | |
| 3125 | | /* TODO: clean this up. */ |
| 3126 | 3137 | xsize = (stv2_current_tilemap.bitmap_size & 2) ? 1024 : 512; |
| 3127 | 3138 | ysize = (stv2_current_tilemap.bitmap_size & 1) ? 512 : 256; |
| 3128 | 3139 | |
| r20870 | r20871 | |
| 3175 | 3186 | int r,g,b; |
| 3176 | 3187 | UINT32 dot_data; |
| 3177 | 3188 | |
| 3178 | | /* TODO: clean this up. */ |
| 3179 | 3189 | xsize = (stv2_current_tilemap.bitmap_size & 2) ? 1024 : 512; |
| 3180 | 3190 | ysize = (stv2_current_tilemap.bitmap_size & 1) ? 512 : 256; |
| 3181 | 3191 | |
| r20870 | r20871 | |
| 3258 | 3268 | switch(stv2_current_tilemap.colour_depth) |
| 3259 | 3269 | { |
| 3260 | 3270 | // case 0: draw_4bpp_bitmap(bitmap,cliprect); return; |
| 3261 | | // case 1: draw_8bpp_bitmap(bitmap,cliprect); return; |
| 3271 | case 1: draw_8bpp_bitmap(bitmap,cliprect); return; |
| 3262 | 3272 | // case 3: draw_rgb15_bitmap(bitmap,cliprect); return; |
| 3263 | 3273 | // case 4: draw_rgb32_bitmap(bitmap,cliprect); return; |
| 3264 | 3274 | } |
| r20870 | r20871 | |
| 4526 | 4536 | if(stv2_current_tilemap.colour_depth == 2 && !stv2_current_tilemap.bitmap_enable) |
| 4527 | 4537 | popmessage("2048 color mode used on a non-bitmap plane"); |
| 4528 | 4538 | |
| 4539 | // if(STV_VDP2_SCXDN0 || STV_VDP2_SCXDN1 || STV_VDP2_SCYDN0 || STV_VDP2_SCYDN1) |
| 4540 | // popmessage("Fractional part scrolling write, contact MAMEdev"); |
| 4541 | |
| 4529 | 4542 | /* Pukunpa */ |
| 4530 | 4543 | //if(STV_VDP2_SPWINEN) |
| 4531 | 4544 | // popmessage("Sprite Window enabled"); |
| r20870 | r20871 | |
| 6991 | 7004 | } |
| 6992 | 7005 | |
| 6993 | 7006 | copybitmap(bitmap, m_tmpbitmap, 0, 0, 0, 0, cliprect); |
| 7007 | |
| 7008 | #if 0 |
| 7009 | /* Do NOT remove me, used to test video code performance. */ |
| 7010 | if(machine().input().code_pressed(KEYCODE_Q)) |
| 7011 | { |
| 7012 | popmessage("Halt CPUs"); |
| 7013 | m_maincpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); |
| 7014 | m_slave->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); |
| 7015 | m_audiocpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); |
| 7016 | } |
| 7017 | #endif |
| 6994 | 7018 | return 0; |
| 6995 | 7019 | } |
| 6996 | 7020 | |