trunk/src/emu/video/315_5124.c
r32449 | r32450 | |
13 | 13 | |
14 | 14 | - Display mode 1 (text) |
15 | 15 | - Display mode 3 (multicolor) |
| 16 | - Sprite doubling bug of the 315-5124 chip |
16 | 17 | |
17 | 18 | |
18 | 19 | SMS Display Timing |
r32449 | r32450 | |
66 | 67 | #define VINT_HPOS 24 |
67 | 68 | #define VINT_FLAG_HPOS 24 |
68 | 69 | #define HINT_HPOS 26 |
69 | | #define NMI_HPOS 28 |
| 70 | #define NMI_HPOS 28 /* not verified */ |
70 | 71 | #define VCOUNT_CHANGE_HPOS 23 |
71 | 72 | #define SPROVR_HPOS 24 |
72 | 73 | #define SPRCOL_BASEHPOS 59 |
73 | | #define X_SCROLL_HPOS 21 |
74 | 74 | #define DISPLAY_DISABLED_HPOS 24 /* not verified, works if above 18 (for 'pstrike2') and below 25 (for 'fantdizzy') */ |
75 | | #define SPR_PATTERN_HPOS 26 /* not verified, needed for 'backtof3' (SMS PAL game) title screen */ |
76 | 75 | #define DISPLAY_CB_HPOS 2 /* fixes 'roadrash' (SMS game) title scrolling, due to line counter reload timing */ |
77 | 76 | |
78 | 77 | #define DRAW_TIME_GG 94 /* 9 + 2 + 14 + 8 + 13 + 96/2 */ |
r32449 | r32450 | |
162 | 161 | , m_pause_cb(*this) |
163 | 162 | , m_space_config("videoram", ENDIANNESS_LITTLE, 8, 14, 0, NULL, *ADDRESS_MAP_NAME(sega315_5124)) |
164 | 163 | , m_palette(*this, "palette") |
| 164 | , m_xscroll_hpos(X_SCROLL_HPOS_5124) |
165 | 165 | { |
166 | 166 | } |
167 | 167 | |
168 | 168 | |
169 | | sega315_5124_device::sega315_5124_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 cram_size, UINT8 palette_offset, bool supports_224_240, const char *shortname, const char *source) |
170 | | : device_t( mconfig, type, name, tag, owner, clock, shortname, source) |
| 169 | sega315_5124_device::sega315_5124_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 cram_size, UINT8 palette_offset, bool supports_224_240, const char *shortname, const char *source, int xscroll_hpos) |
| 170 | : device_t( mconfig, type, name, tag, owner, clock, shortname, __FILE__) |
171 | 171 | , device_memory_interface(mconfig, *this) |
172 | 172 | , device_video_interface(mconfig, *this) |
173 | 173 | , m_cram_size( cram_size ) |
r32449 | r32450 | |
178 | 178 | , m_pause_cb(*this) |
179 | 179 | , m_space_config("videoram", ENDIANNESS_LITTLE, 8, 14, 0, NULL, *ADDRESS_MAP_NAME(sega315_5124)) |
180 | 180 | , m_palette(*this, "palette") |
| 181 | , m_xscroll_hpos(xscroll_hpos) |
181 | 182 | { |
182 | 183 | } |
183 | 184 | |
184 | 185 | |
185 | 186 | sega315_5246_device::sega315_5246_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
186 | | : sega315_5124_device( mconfig, SEGA315_5246, "Sega 315-5246 VDP", tag, owner, clock, SEGA315_5124_CRAM_SIZE, 0, true, "sega315_5246", __FILE__) |
| 187 | : sega315_5124_device( mconfig, SEGA315_5246, "Sega 315-5246 VDP", tag, owner, clock, SEGA315_5124_CRAM_SIZE, 0, true, "sega315_5246", __FILE__, X_SCROLL_HPOS_5124) |
187 | 188 | { |
188 | 189 | } |
189 | 190 | |
190 | 191 | |
191 | 192 | sega315_5378_device::sega315_5378_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
192 | | : sega315_5124_device( mconfig, SEGA315_5378, "Sega 315-5378", tag, owner, clock, SEGA315_5378_CRAM_SIZE, 0x10, true, "sega315_5378", __FILE__) |
| 193 | : sega315_5124_device( mconfig, SEGA315_5378, "Sega 315-5378", tag, owner, clock, SEGA315_5378_CRAM_SIZE, 0x10, true, "sega315_5378", __FILE__, X_SCROLL_HPOS_5378) |
193 | 194 | { |
194 | 195 | } |
195 | 196 | |
r32449 | r32450 | |
407 | 408 | |
408 | 409 | /* copy current values in case they are not changed until latch time */ |
409 | 410 | m_display_disabled = !(m_reg[0x01] & 0x40); |
410 | | m_reg6copy = m_reg[0x06]; |
411 | 411 | m_reg8copy = m_reg[0x08]; |
412 | 412 | |
413 | 413 | vpos_limit -= m_frame_timing[BOTTOM_BLANKING]; |
r32449 | r32450 | |
690 | 690 | if (m_screen->hpos() <= DISPLAY_DISABLED_HPOS) |
691 | 691 | m_display_disabled = !(m_reg[0x01] & 0x40); |
692 | 692 | break; |
693 | | case 6: |
694 | | if (m_screen->hpos() <= SPR_PATTERN_HPOS) |
695 | | m_reg6copy = m_reg[0x06]; |
696 | | break; |
697 | 693 | case 8: |
698 | | if (m_screen->hpos() <= X_SCROLL_HPOS) |
| 694 | if (m_screen->hpos() <= m_xscroll_hpos) |
699 | 695 | m_reg8copy = m_reg[0x08]; |
700 | 696 | } |
701 | 697 | |
r32449 | r32450 | |
886 | 882 | { |
887 | 883 | int max_sprites; |
888 | 884 | |
| 885 | /* At this point the VDP vcount still doesn't refer the new line, |
| 886 | because the logical start point is slightly shifted on the scanline */ |
| 887 | int parse_line = line - 1; |
| 888 | |
| 889 | /* Check if SI is set */ |
| 890 | m_sprite_height = (m_reg[0x01] & 0x02) ? 16 : 8; |
| 891 | /* Check if MAG is set */ |
| 892 | m_sprite_zoom = (m_reg[0x01] & 0x01) ? 2 : 1; |
| 893 | |
| 894 | if (m_sprite_zoom == 2) |
| 895 | { |
| 896 | /* Divide before use the value for comparison, same later with sprite_y, or |
| 897 | else an off-by-one bug could occur, as seen with Tarzan, for Game Gear */ |
| 898 | parse_line >>= 1; |
| 899 | } |
| 900 | |
889 | 901 | m_sprite_count = 0; |
890 | 902 | |
891 | 903 | if ( m_vdp_mode == 0 || m_vdp_mode == 2 ) |
r32449 | r32450 | |
895 | 907 | max_sprites = 4; |
896 | 908 | |
897 | 909 | m_sprite_base = ((m_reg[0x05] & 0x7f) << 7); |
898 | | m_sprite_height = 8; |
899 | 910 | |
900 | | if (m_reg[0x01] & 0x02) /* Check if SI is set */ |
901 | | m_sprite_height = m_sprite_height * 2; |
902 | | if (m_reg[0x01] & 0x01) /* Check if MAG is set */ |
903 | | m_sprite_height = m_sprite_height * 2; |
904 | | |
905 | 911 | for (int sprite_index = 0; (sprite_index < 32 * 4) && (m_sprite_count <= max_sprites); sprite_index += 4) |
906 | 912 | { |
907 | 913 | int sprite_y = space().read_byte(m_sprite_base + sprite_index); |
908 | 914 | if (sprite_y == 0xd0) |
909 | 915 | break; |
910 | | sprite_y += 1; |
911 | 916 | |
912 | | if (sprite_y > 240) |
| 917 | if (sprite_y >= 240) |
913 | 918 | { |
914 | 919 | sprite_y -= 256; |
915 | 920 | } |
916 | 921 | |
917 | | if ((line >= sprite_y) && (line < (sprite_y + m_sprite_height))) |
| 922 | if (m_sprite_zoom > 1) |
918 | 923 | { |
| 924 | sprite_y >>= 1; |
| 925 | } |
| 926 | |
| 927 | if ((parse_line >= sprite_y) && (parse_line < (sprite_y + m_sprite_height))) |
| 928 | { |
919 | 929 | if (m_sprite_count < max_sprites) |
920 | 930 | { |
921 | | m_selected_sprite[m_sprite_count] = sprite_index; |
| 931 | int sprite_x = space().read_byte( m_sprite_base + sprite_index + 1 ); |
| 932 | int sprite_tile_selected = space().read_byte( m_sprite_base + sprite_index + 2 ); |
| 933 | UINT8 flags = space().read_byte( m_sprite_base + sprite_index + 3 ); |
| 934 | |
| 935 | if (flags & 0x80) |
| 936 | sprite_x -= 32; |
| 937 | |
| 938 | int sprite_line = parse_line - sprite_y; |
| 939 | |
| 940 | if (m_reg[0x01] & 0x01) |
| 941 | sprite_line >>= 1; |
| 942 | |
| 943 | if (m_reg[0x01] & 0x02) |
| 944 | { |
| 945 | sprite_tile_selected &= 0xfc; |
| 946 | |
| 947 | if (sprite_line > 0x07) |
| 948 | { |
| 949 | sprite_tile_selected += 1; |
| 950 | sprite_line -= 8; |
| 951 | } |
| 952 | } |
| 953 | |
| 954 | m_sprite_x[m_sprite_count] = sprite_x; |
| 955 | m_sprite_tile_selected[m_sprite_count] = sprite_tile_selected; |
| 956 | m_sprite_flags[m_sprite_count] = flags; |
| 957 | m_sprite_pattern_line[m_sprite_count] = ((m_reg[0x06] & 0x07) << 11) + sprite_line; |
922 | 958 | } |
923 | 959 | m_sprite_count++; |
924 | 960 | } |
r32449 | r32450 | |
931 | 967 | max_sprites = 8; |
932 | 968 | |
933 | 969 | m_sprite_base = ((m_reg[0x05] << 7) & 0x3f00); |
934 | | m_sprite_height = (m_reg[0x01] & 0x02) ? 16 : 8; |
935 | | m_sprite_zoom = (m_reg[0x01] & 0x01) ? 2 : 1; |
936 | 970 | |
937 | 971 | for (int sprite_index = 0; (sprite_index < 64) && (m_sprite_count <= max_sprites); sprite_index++) |
938 | 972 | { |
939 | 973 | int sprite_y = space().read_byte(m_sprite_base + sprite_index); |
940 | 974 | if (m_y_pixels == 192 && sprite_y == 0xd0) |
941 | 975 | break; |
942 | | sprite_y += 1; /* sprite y position starts at line 1 */ |
943 | 976 | |
944 | | if (sprite_y > 240) |
| 977 | if (sprite_y >= 240) |
945 | 978 | { |
946 | 979 | sprite_y -= 256; /* wrap from top if y position is > 240 */ |
947 | 980 | } |
948 | 981 | |
949 | | if ((line >= sprite_y) && (line < (sprite_y + m_sprite_height * m_sprite_zoom))) |
| 982 | if (m_sprite_zoom > 1) |
950 | 983 | { |
| 984 | sprite_y >>= 1; |
| 985 | } |
| 986 | |
| 987 | if ((parse_line >= sprite_y) && (parse_line < (sprite_y + m_sprite_height))) |
| 988 | { |
951 | 989 | if (m_sprite_count < max_sprites) |
952 | 990 | { |
953 | | m_selected_sprite[m_sprite_count] = sprite_index; |
| 991 | int sprite_x = space().read_byte( m_sprite_base + 0x80 + (sprite_index << 1) ); |
| 992 | int sprite_tile_selected = space().read_byte( m_sprite_base + 0x81 + (sprite_index << 1) ); |
| 993 | |
| 994 | if (m_reg[0x00] & 0x08) |
| 995 | { |
| 996 | sprite_x -= 0x08; /* sprite shift */ |
| 997 | } |
| 998 | |
| 999 | if (m_reg[0x06] & 0x04) |
| 1000 | { |
| 1001 | sprite_tile_selected += 256; /* pattern table select */ |
| 1002 | } |
| 1003 | |
| 1004 | if (m_reg[0x01] & 0x02) |
| 1005 | { |
| 1006 | sprite_tile_selected &= 0x01fe; /* force even index */ |
| 1007 | } |
| 1008 | |
| 1009 | int sprite_line = parse_line - sprite_y; |
| 1010 | |
| 1011 | if (sprite_line > 0x07) |
| 1012 | { |
| 1013 | sprite_tile_selected += 1; |
| 1014 | } |
| 1015 | |
| 1016 | m_sprite_x[m_sprite_count] = sprite_x; |
| 1017 | m_sprite_tile_selected[m_sprite_count] = sprite_tile_selected; |
| 1018 | m_sprite_pattern_line[m_sprite_count] = ((sprite_line & 0x07) << 2); |
954 | 1019 | } |
955 | 1020 | m_sprite_count++; |
956 | 1021 | } |
r32449 | r32450 | |
975 | 1040 | { |
976 | 1041 | bool sprite_col_occurred = false; |
977 | 1042 | int sprite_col_x = SEGA315_5124_WIDTH; |
| 1043 | UINT8 collision_buffer[SEGA315_5124_WIDTH]; |
978 | 1044 | |
979 | 1045 | if (m_display_disabled || m_sprite_count == 0) |
980 | 1046 | return; |
981 | 1047 | |
982 | | memset(m_collision_buffer, 0, SEGA315_5124_WIDTH); |
| 1048 | memset(collision_buffer, 0, SEGA315_5124_WIDTH); |
983 | 1049 | |
984 | 1050 | /* Draw sprite layer */ |
985 | 1051 | for (int sprite_buffer_index = m_sprite_count - 1; sprite_buffer_index >= 0; sprite_buffer_index--) |
986 | 1052 | { |
987 | | int sprite_index = m_selected_sprite[sprite_buffer_index]; |
988 | | int sprite_y = space().read_byte( m_sprite_base + sprite_index ) + 1; /* sprite y position starts at line 1 */ |
989 | | int sprite_x = space().read_byte( m_sprite_base + 0x80 + (sprite_index << 1) ); |
990 | | int sprite_tile_selected = space().read_byte( m_sprite_base + 0x81 + (sprite_index << 1) ); |
| 1053 | int sprite_x = m_sprite_x[sprite_buffer_index]; |
| 1054 | int sprite_tile_selected = m_sprite_tile_selected[sprite_buffer_index]; |
| 1055 | UINT16 sprite_pattern_line = m_sprite_pattern_line[sprite_buffer_index]; |
991 | 1056 | |
992 | | if (sprite_y > 240) |
993 | | { |
994 | | sprite_y -= 256; /* wrap from top if y position is > 240 */ |
995 | | } |
| 1057 | UINT8 bit_plane_0 = space().read_byte((sprite_tile_selected << 5) + sprite_pattern_line + 0x00); |
| 1058 | UINT8 bit_plane_1 = space().read_byte((sprite_tile_selected << 5) + sprite_pattern_line + 0x01); |
| 1059 | UINT8 bit_plane_2 = space().read_byte((sprite_tile_selected << 5) + sprite_pattern_line + 0x02); |
| 1060 | UINT8 bit_plane_3 = space().read_byte((sprite_tile_selected << 5) + sprite_pattern_line + 0x03); |
996 | 1061 | |
997 | | if (m_reg[0x00] & 0x08) |
998 | | { |
999 | | sprite_x -= 0x08; /* sprite shift */ |
1000 | | } |
1001 | | |
1002 | | if (m_reg6copy & 0x04) |
1003 | | { |
1004 | | sprite_tile_selected += 256; /* pattern table select */ |
1005 | | } |
1006 | | |
1007 | | if (m_reg[0x01] & 0x02) |
1008 | | { |
1009 | | sprite_tile_selected &= 0x01fe; /* force even index */ |
1010 | | } |
1011 | | |
1012 | | int sprite_line = (line - sprite_y) / m_sprite_zoom; |
1013 | | |
1014 | | if (sprite_line > 0x07) |
1015 | | { |
1016 | | sprite_tile_selected += 1; |
1017 | | } |
1018 | | |
1019 | | UINT8 bit_plane_0 = space().read_byte(((sprite_tile_selected << 5) + ((sprite_line & 0x07) << 2)) + 0x00); |
1020 | | UINT8 bit_plane_1 = space().read_byte(((sprite_tile_selected << 5) + ((sprite_line & 0x07) << 2)) + 0x01); |
1021 | | UINT8 bit_plane_2 = space().read_byte(((sprite_tile_selected << 5) + ((sprite_line & 0x07) << 2)) + 0x02); |
1022 | | UINT8 bit_plane_3 = space().read_byte(((sprite_tile_selected << 5) + ((sprite_line & 0x07) << 2)) + 0x03); |
1023 | | |
1024 | 1062 | for (int pixel_x = 0; pixel_x < 8 ; pixel_x++) |
1025 | 1063 | { |
1026 | 1064 | UINT8 pen_bit_0 = (bit_plane_0 >> (7 - pixel_x)) & 0x01; |
r32449 | r32450 | |
1065 | 1103 | priority_selected[pixel_plot_x + 1] = pen_selected; |
1066 | 1104 | } |
1067 | 1105 | } |
1068 | | if (m_collision_buffer[pixel_plot_x] != 1) |
| 1106 | if (collision_buffer[pixel_plot_x] != 1) |
1069 | 1107 | { |
1070 | | m_collision_buffer[pixel_plot_x] = 1; |
| 1108 | collision_buffer[pixel_plot_x] = 1; |
1071 | 1109 | } |
1072 | 1110 | else |
1073 | 1111 | { |
1074 | 1112 | sprite_col_occurred = true; |
1075 | 1113 | sprite_col_x = MIN(sprite_col_x, pixel_plot_x); |
1076 | 1114 | } |
1077 | | if (m_collision_buffer[pixel_plot_x + 1] != 1) |
| 1115 | if (collision_buffer[pixel_plot_x + 1] != 1) |
1078 | 1116 | { |
1079 | | m_collision_buffer[pixel_plot_x + 1] = 1; |
| 1117 | collision_buffer[pixel_plot_x + 1] = 1; |
1080 | 1118 | } |
1081 | 1119 | else |
1082 | 1120 | { |
r32449 | r32450 | |
1107 | 1145 | priority_selected[pixel_plot_x] = pen_selected; |
1108 | 1146 | } |
1109 | 1147 | } |
1110 | | if (m_collision_buffer[pixel_plot_x] != 1) |
| 1148 | if (collision_buffer[pixel_plot_x] != 1) |
1111 | 1149 | { |
1112 | | m_collision_buffer[pixel_plot_x] = 1; |
| 1150 | collision_buffer[pixel_plot_x] = 1; |
1113 | 1151 | } |
1114 | 1152 | else |
1115 | 1153 | { |
r32449 | r32450 | |
1131 | 1169 | { |
1132 | 1170 | bool sprite_col_occurred = false; |
1133 | 1171 | int sprite_col_x = SEGA315_5124_WIDTH; |
1134 | | UINT16 sprite_pattern_base; |
| 1172 | UINT8 collision_buffer[SEGA315_5124_WIDTH]; |
1135 | 1173 | |
1136 | 1174 | if (m_display_disabled || m_sprite_count == 0) |
1137 | 1175 | return; |
1138 | 1176 | |
1139 | | sprite_pattern_base = ((m_reg6copy & 0x07) << 11); |
1140 | | memset(m_collision_buffer, 0, SEGA315_5124_WIDTH); |
| 1177 | memset(collision_buffer, 0, SEGA315_5124_WIDTH); |
1141 | 1178 | |
1142 | 1179 | /* Draw sprite layer */ |
1143 | 1180 | for (int sprite_buffer_index = m_sprite_count - 1; sprite_buffer_index >= 0; sprite_buffer_index--) |
1144 | 1181 | { |
1145 | | int sprite_index = m_selected_sprite[sprite_buffer_index]; |
1146 | | int sprite_y = space().read_byte( m_sprite_base + sprite_index ) + 1; |
1147 | | int sprite_x = space().read_byte( m_sprite_base + sprite_index + 1 ); |
1148 | | UINT8 flags = space().read_byte( m_sprite_base + sprite_index + 3 ); |
| 1182 | int sprite_x = m_sprite_x[sprite_buffer_index]; |
| 1183 | UINT8 flags = m_sprite_flags[sprite_buffer_index]; |
1149 | 1184 | int pen_selected = m_palette_offset + ( flags & 0x0f ); |
1150 | 1185 | |
1151 | | if (sprite_y > 240) |
1152 | | sprite_y -= 256; |
| 1186 | int sprite_tile_selected = m_sprite_tile_selected[sprite_buffer_index]; |
| 1187 | UINT16 sprite_pattern_line = m_sprite_pattern_line[sprite_buffer_index]; |
1153 | 1188 | |
1154 | | if (flags & 0x80) |
1155 | | sprite_x -= 32; |
| 1189 | UINT8 pattern = space().read_byte( sprite_pattern_line + sprite_tile_selected * 8 ); |
1156 | 1190 | |
1157 | | int sprite_tile_selected = space().read_byte( m_sprite_base + sprite_index + 2 ); |
1158 | | int sprite_line = line - sprite_y; |
1159 | | |
1160 | | if (m_reg[0x01] & 0x01) |
1161 | | sprite_line >>= 1; |
1162 | | |
1163 | | if (m_reg[0x01] & 0x02) |
1164 | | { |
1165 | | sprite_tile_selected &= 0xfc; |
1166 | | |
1167 | | if (sprite_line > 0x07) |
1168 | | { |
1169 | | sprite_tile_selected += 1; |
1170 | | sprite_line -= 8; |
1171 | | } |
1172 | | } |
1173 | | |
1174 | | UINT8 pattern = space().read_byte( sprite_pattern_base + sprite_tile_selected * 8 + sprite_line ); |
1175 | | |
1176 | 1191 | for (int pixel_x = 0; pixel_x < 8; pixel_x++) |
1177 | 1192 | { |
1178 | 1193 | if (m_reg[0x01] & 0x01) |
r32449 | r32450 | |
1188 | 1203 | { |
1189 | 1204 | line_buffer[pixel_plot_x] = m_current_palette[pen_selected]; |
1190 | 1205 | |
1191 | | if (m_collision_buffer[pixel_plot_x] != 1) |
| 1206 | if (collision_buffer[pixel_plot_x] != 1) |
1192 | 1207 | { |
1193 | | m_collision_buffer[pixel_plot_x] = 1; |
| 1208 | collision_buffer[pixel_plot_x] = 1; |
1194 | 1209 | } |
1195 | 1210 | else |
1196 | 1211 | { |
r32449 | r32450 | |
1200 | 1215 | |
1201 | 1216 | line_buffer[pixel_plot_x+1] = m_current_palette[pen_selected]; |
1202 | 1217 | |
1203 | | if (m_collision_buffer[pixel_plot_x + 1] != 1) |
| 1218 | if (collision_buffer[pixel_plot_x + 1] != 1) |
1204 | 1219 | { |
1205 | | m_collision_buffer[pixel_plot_x + 1] = 1; |
| 1220 | collision_buffer[pixel_plot_x + 1] = 1; |
1206 | 1221 | } |
1207 | 1222 | else |
1208 | 1223 | { |
r32449 | r32450 | |
1224 | 1239 | { |
1225 | 1240 | line_buffer[pixel_plot_x] = m_current_palette[pen_selected]; |
1226 | 1241 | |
1227 | | if (m_collision_buffer[pixel_plot_x] != 1) |
| 1242 | if (collision_buffer[pixel_plot_x] != 1) |
1228 | 1243 | { |
1229 | | m_collision_buffer[pixel_plot_x] = 1; |
| 1244 | collision_buffer[pixel_plot_x] = 1; |
1230 | 1245 | } |
1231 | 1246 | else |
1232 | 1247 | { |
r32449 | r32450 | |
1237 | 1252 | } |
1238 | 1253 | } |
1239 | 1254 | |
1240 | | if (m_reg[0x01] & 0x02) |
| 1255 | if (m_sprite_height == 16) |
1241 | 1256 | { |
1242 | 1257 | sprite_tile_selected += 2; |
1243 | | pattern = space().read_byte( sprite_pattern_base + sprite_tile_selected * 8 + sprite_line ); |
1244 | | sprite_x += (m_reg[0x01] & 0x01 ? 16 : 8); |
| 1258 | pattern = space().read_byte( sprite_pattern_line + sprite_tile_selected * 8 ); |
| 1259 | sprite_x += (m_sprite_zoom == 2 ? 16 : 8); |
1245 | 1260 | |
1246 | 1261 | for (int pixel_x = 0; pixel_x < 8; pixel_x++) |
1247 | 1262 | { |
r32449 | r32450 | |
1258 | 1273 | { |
1259 | 1274 | line_buffer[pixel_plot_x] = m_current_palette[pen_selected]; |
1260 | 1275 | |
1261 | | if (m_collision_buffer[pixel_plot_x] != 1) |
| 1276 | if (collision_buffer[pixel_plot_x] != 1) |
1262 | 1277 | { |
1263 | | m_collision_buffer[pixel_plot_x] = 1; |
| 1278 | collision_buffer[pixel_plot_x] = 1; |
1264 | 1279 | } |
1265 | 1280 | else |
1266 | 1281 | { |
r32449 | r32450 | |
1270 | 1285 | |
1271 | 1286 | line_buffer[pixel_plot_x+1] = m_current_palette[pen_selected]; |
1272 | 1287 | |
1273 | | if (m_collision_buffer[pixel_plot_x + 1] != 1) |
| 1288 | if (collision_buffer[pixel_plot_x + 1] != 1) |
1274 | 1289 | { |
1275 | | m_collision_buffer[pixel_plot_x + 1] = 1; |
| 1290 | collision_buffer[pixel_plot_x + 1] = 1; |
1276 | 1291 | } |
1277 | 1292 | else |
1278 | 1293 | { |
r32449 | r32450 | |
1294 | 1309 | { |
1295 | 1310 | line_buffer[pixel_plot_x] = m_current_palette[pen_selected]; |
1296 | 1311 | |
1297 | | if (m_collision_buffer[pixel_plot_x] != 1) |
| 1312 | if (collision_buffer[pixel_plot_x] != 1) |
1298 | 1313 | { |
1299 | | m_collision_buffer[pixel_plot_x] = 1; |
| 1314 | collision_buffer[pixel_plot_x] = 1; |
1300 | 1315 | } |
1301 | 1316 | else |
1302 | 1317 | { |
r32449 | r32450 | |
1832 | 1847 | save_item(NAME(m_status)); |
1833 | 1848 | save_item(NAME(m_pending_status)); |
1834 | 1849 | save_item(NAME(m_pending_sprcol_x)); |
1835 | | save_item(NAME(m_reg6copy)); |
1836 | 1850 | save_item(NAME(m_reg8copy)); |
1837 | 1851 | save_item(NAME(m_reg9copy)); |
1838 | 1852 | save_item(NAME(m_addrmode)); |
r32449 | r32450 | |
1851 | 1865 | save_item(NAME(m_reg)); |
1852 | 1866 | save_item(NAME(m_current_palette)); |
1853 | 1867 | save_pointer(NAME(m_line_buffer), 256 * 5); |
1854 | | save_item(NAME(m_collision_buffer)); |
1855 | 1868 | save_item(NAME(m_tmpbitmap)); |
1856 | 1869 | save_item(NAME(m_y1_bitmap)); |
1857 | 1870 | save_item(NAME(m_draw_time)); |
1858 | 1871 | save_item(NAME(m_sprite_base)); |
1859 | | save_item(NAME(m_selected_sprite)); |
| 1872 | save_item(NAME(m_sprite_pattern_line)); |
| 1873 | save_item(NAME(m_sprite_tile_selected)); |
| 1874 | save_item(NAME(m_sprite_x)); |
| 1875 | save_item(NAME(m_sprite_flags)); |
1860 | 1876 | save_item(NAME(m_sprite_count)); |
1861 | 1877 | save_item(NAME(m_sprite_height)); |
1862 | 1878 | save_item(NAME(m_sprite_zoom)); |
r32449 | r32450 | |
1881 | 1897 | m_pending_status = 0; |
1882 | 1898 | m_pending_sprcol_x = 0; |
1883 | 1899 | m_pending_reg_write = 0; |
1884 | | m_reg6copy = 0; |
1885 | 1900 | m_reg8copy = 0; |
1886 | 1901 | m_reg9copy = 0; |
1887 | 1902 | m_addrmode = 0; |