diff options
Diffstat (limited to 'src/mess/video/stic.c')
-rw-r--r-- | src/mess/video/stic.c | 230 |
1 files changed, 115 insertions, 115 deletions
diff --git a/src/mess/video/stic.c b/src/mess/video/stic.c index cca1631d632..142da8646aa 100644 --- a/src/mess/video/stic.c +++ b/src/mess/video/stic.c @@ -1,11 +1,11 @@ /********************************************************************** - + General Instruments AY-3-8900-1 a.k.a. Standard Television Interface Chip (STIC) emulation for Mattel Intellivision - + Copyright MESS Team. Visit http://mamedev.org for licensing and usage restrictions. - + *********************************************************************/ #include "emu.h" @@ -42,7 +42,7 @@ stic_device::~stic_device() void stic_device::device_start() { machine().primary_screen->register_screen_bitmap(m_bitmap); - + save_item(NAME(m_stic_registers)); save_item(NAME(m_gramdirty)); save_item(NAME(m_gram)); @@ -123,7 +123,7 @@ void stic_device::device_reset() m_col_delay = 0; m_row_delay = 0; m_left_edge_inhibit = 0; - m_top_edge_inhibit = 0; + m_top_edge_inhibit = 0; } ROM_START( stic_grom ) @@ -149,12 +149,12 @@ const rom_entry *stic_device::device_rom_region() const void stic_device::intv_set_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color) { int w, h; - + // output scaling x *= m_x_scale; y *= m_y_scale; color = SET_COLOR(color); - + for (h = 0; h < m_y_scale; h++) for (w = 0; w < m_x_scale; w++) bitmap.pix16(y + h, x + w) = color; @@ -174,10 +174,10 @@ void stic_device::intv_plot_box(bitmap_ind16 &bitmap, int x, int y, int w, int h int stic_device::sprites_collide(int spriteNum1, int spriteNum2) { INT16 x0, y0, w0, h0, x1, y1, w1, h1, x2, y2, w2, h2; - + intv_sprite_type* s1 = &m_sprite[spriteNum1]; intv_sprite_type* s2 = &m_sprite[spriteNum2]; - + x0 = STIC_OVERSCAN_LEFT_WIDTH + m_col_delay - STIC_CARD_WIDTH; y0 = STIC_OVERSCAN_TOP_HEIGHT + m_row_delay - STIC_CARD_HEIGHT; x1 = (s1->xpos + x0) * STIC_X_SCALE; y1 = (s1->ypos + y0) * STIC_Y_SCALE; @@ -186,11 +186,11 @@ int stic_device::sprites_collide(int spriteNum1, int spriteNum2) w2 = (s2->doublex ? 2 : 1) * STIC_CARD_WIDTH; h1 = (s1->quady ? 4 : 1) * (s1->doubley ? 2 : 1) * (s1->doubleyres ? 2 : 1) * STIC_CARD_HEIGHT; h2 = (s2->quady ? 4 : 1) * (s2->doubley ? 2 : 1) * (s2->doubleyres ? 2 : 1) * STIC_CARD_HEIGHT; - + if ((x1 >= x2 + w2) || (y1 >= y2 + h2) || (x2 >= x1 + w1) || (y2 >= y1 + h1)) return FALSE; - + // iterate over the intersecting bits to see if any touch x0 = MAX(x1, x2); y0 = MAX(y1, y2); @@ -209,7 +209,7 @@ int stic_device::sprites_collide(int spriteNum1, int spriteNum2) return TRUE; } } - + return FALSE; } @@ -221,13 +221,13 @@ void stic_device::determine_sprite_collisions() intv_sprite_type* s1 = &m_sprite[i]; if (s1->xpos == 0 || !s1->coll) continue; - + for (int j = i + 1; j < STIC_MOBS; j++) { intv_sprite_type* s2 = &m_sprite[j]; if (s2->xpos == 0 || !s2->coll) continue; - + if (sprites_collide(i, j)) { s1->collision |= (1 << j); @@ -246,21 +246,21 @@ void stic_device::render_sprites() INT32 nextX; INT32 nextY; INT32 xInc; - + UINT8* memory = m_grom_region->base(); - + for (int i = 0; i < STIC_MOBS; i++) { intv_sprite_type* s = &m_sprite[i]; - + if (s->grom) cardMemoryLocation = (s->card * STIC_CARD_HEIGHT); else cardMemoryLocation = ((s->card & 0x003F) * STIC_CARD_HEIGHT); - + pixelSize = (s->quady ? 4 : 1) * (s->doubley ? 2 : 1); spritePixelHeight = pixelSize * (s->doubleyres ? 2 : 1) * STIC_CARD_HEIGHT; - + for (int j = 0; j < spritePixelHeight; j++) { nextMemoryLocation = (cardMemoryLocation + (j/pixelSize)); @@ -273,7 +273,7 @@ void stic_device::render_sprites() nextX = (s->xflip ? ((s->doublex ? 2 : 1) * STIC_CARD_WIDTH - 1) : 0); nextY = (s->yflip ? (spritePixelHeight - j - 1) : j); xInc = (s->xflip ? -1: 1); - + for (int k = 0; k < STIC_CARD_WIDTH * (1 + s->doublex); k++) { m_sprite_buffers[i][nextX + k * xInc][nextY] = (nextData & (1 << ((STIC_CARD_WIDTH - 1) - k / (1 + s->doublex)))) != 0; @@ -285,7 +285,7 @@ void stic_device::render_sprites() void stic_device::render_line(bitmap_ind16 &bitmap, UINT8 nextByte, UINT16 x, UINT16 y, UINT8 fgcolor, UINT8 bgcolor) { UINT32 color; - + for (int i = 0; i < STIC_CARD_WIDTH; i++) { color = (nextByte & (1 << ((STIC_CARD_WIDTH - 1) - i)) ? fgcolor : bgcolor); @@ -308,17 +308,17 @@ void stic_device::render_color_stack_mode(bitmap_ind16 &bitmap) UINT8 csPtr = 0; UINT16 nextCard; UINT8 *ram = m_grom_region->base(); - + for (h = 0, nexty = (STIC_OVERSCAN_TOP_HEIGHT + m_row_delay) * STIC_Y_SCALE; - h < STIC_BACKTAB_HEIGHT; - h++, nexty += STIC_CARD_HEIGHT * STIC_Y_SCALE) + h < STIC_BACKTAB_HEIGHT; + h++, nexty += STIC_CARD_HEIGHT * STIC_Y_SCALE) { for (w = 0, nextx = (STIC_OVERSCAN_LEFT_WIDTH + m_col_delay) * STIC_X_SCALE; - w < STIC_BACKTAB_WIDTH; - w++, nextx += STIC_CARD_WIDTH * STIC_X_SCALE) + w < STIC_BACKTAB_WIDTH; + w++, nextx += STIC_CARD_WIDTH * STIC_X_SCALE) { nextCard = m_backtab_buffer[h][w]; - + // colored squares mode if ((nextCard & (STIC_CSTM_FG3|STIC_CSTM_SEL)) == STIC_CSTM_FG3) { @@ -329,10 +329,10 @@ void stic_device::render_color_stack_mode(bitmap_ind16 &bitmap) UINT8 color3 = ((nextCard & STIC_CSQM_D2) >> 11) | ((nextCard & (STIC_CSQM_D10)) >> 9); render_colored_squares(bitmap, nextx, nexty, - (color0 == 7 ? csColor : (color0 | FOREGROUND_BIT)), - (color1 == 7 ? csColor : (color1 | FOREGROUND_BIT)), - (color2 == 7 ? csColor : (color2 | FOREGROUND_BIT)), - (color3 == 7 ? csColor : (color3 | FOREGROUND_BIT))); + (color0 == 7 ? csColor : (color0 | FOREGROUND_BIT)), + (color1 == 7 ? csColor : (color1 | FOREGROUND_BIT)), + (color2 == 7 ? csColor : (color2 | FOREGROUND_BIT)), + (color3 == 7 ? csColor : (color3 | FOREGROUND_BIT))); } //color stack mode else @@ -340,15 +340,15 @@ void stic_device::render_color_stack_mode(bitmap_ind16 &bitmap) UINT8 isGrom; UINT16 memoryLocation, fgcolor, bgcolor; UINT8* memory; - + //advance the color pointer, if necessary if (nextCard & STIC_CSTM_ADV) csPtr = (csPtr+1) & (STIC_CSRS - 1); - + fgcolor = ((nextCard & STIC_CSTM_FG3) >> 9) | (nextCard & (STIC_CSTM_FG20)) | FOREGROUND_BIT; bgcolor = m_stic_registers[STIC_CSR + csPtr] & STIC_CSR_BG; - + isGrom = !(nextCard & STIC_CSTM_SEL); if (isGrom) { @@ -378,20 +378,20 @@ void stic_device::render_fg_bg_mode(bitmap_ind16 &bitmap) UINT16 nextCard, memoryLocation; UINT8* memory; UINT8* ram = m_grom_region->base(); - + for (h = 0, nexty = (STIC_OVERSCAN_TOP_HEIGHT + m_row_delay) * STIC_Y_SCALE; - h < STIC_BACKTAB_HEIGHT; - h++, nexty += STIC_CARD_HEIGHT * STIC_Y_SCALE) + h < STIC_BACKTAB_HEIGHT; + h++, nexty += STIC_CARD_HEIGHT * STIC_Y_SCALE) { for (w = 0, nextx = (STIC_OVERSCAN_LEFT_WIDTH + m_col_delay) * STIC_X_SCALE; - w < STIC_BACKTAB_WIDTH; - w++, nextx += STIC_CARD_WIDTH * STIC_X_SCALE) + w < STIC_BACKTAB_WIDTH; + w++, nextx += STIC_CARD_WIDTH * STIC_X_SCALE) { nextCard = m_backtab_buffer[h][w]; fgcolor = (nextCard & STIC_FBM_FG) | FOREGROUND_BIT; bgcolor = ((nextCard & STIC_FBM_BG2) >> 11) | ((nextCard & STIC_FBM_BG310) >> 9); - + isGrom = !(nextCard & STIC_FBM_SEL); if (isGrom) { @@ -421,27 +421,27 @@ void stic_device::copy_sprites_to_background(bitmap_ind16 &bitmap) INT16 leftX, nextY; INT16 leftBorder, rightBorder, topBorder, bottomBorder; INT32 nextX; - + for (int i = STIC_MOBS - 1; i >= 0; i--) { intv_sprite_type *s = &m_sprite[i]; if (s->xpos == 0 || (!s->coll && !s->visible)) continue; - + borderCollision = FALSE; foregroundCollision = FALSE; - + spritePixelHeight = (s->quady ? 4 : 1) * (s->doubley ? 2 : 1) * (s->doubleyres ? 2 : 1) * STIC_CARD_HEIGHT; width = (s->doublex ? 2 : 1) * STIC_CARD_WIDTH; - + leftX = (s->xpos - STIC_CARD_WIDTH + STIC_OVERSCAN_LEFT_WIDTH + m_col_delay) * STIC_X_SCALE; nextY = (s->ypos - STIC_CARD_HEIGHT + STIC_OVERSCAN_TOP_HEIGHT + m_row_delay) * STIC_Y_SCALE; - + leftBorder = (STIC_OVERSCAN_LEFT_WIDTH + (m_left_edge_inhibit ? STIC_CARD_WIDTH : 0)) * STIC_X_SCALE; rightBorder = (STIC_OVERSCAN_LEFT_WIDTH + STIC_BACKTAB_WIDTH * STIC_CARD_WIDTH - 1 - 1) * STIC_X_SCALE; topBorder = (STIC_OVERSCAN_TOP_HEIGHT + (m_top_edge_inhibit ? STIC_CARD_HEIGHT : 0)) * STIC_Y_SCALE; bottomBorder = (STIC_OVERSCAN_TOP_HEIGHT + STIC_BACKTAB_HEIGHT * STIC_CARD_HEIGHT) * STIC_Y_SCALE - 1; - + for (y = 0; y < spritePixelHeight; y++) { for (x = 0; x < width; x++) @@ -449,7 +449,7 @@ void stic_device::copy_sprites_to_background(bitmap_ind16 &bitmap) //if this sprite pixel is not on, then don't paint it if (!m_sprite_buffers[i][x][y]) continue; - + nextX = leftX + x; //if the next pixel location is on the border, then we //have a border collision and we can ignore painting it @@ -459,9 +459,9 @@ void stic_device::copy_sprites_to_background(bitmap_ind16 &bitmap) borderCollision = TRUE; continue; } - + currentPixel = intv_get_pixel(bitmap, nextX, nextY); - + //check for foreground collision if (currentPixel & FOREGROUND_BIT) { @@ -469,7 +469,7 @@ void stic_device::copy_sprites_to_background(bitmap_ind16 &bitmap) if (s->behind_foreground) continue; } - + if (s->visible) { intv_set_pixel(bitmap, nextX, nextY, s->color | (currentPixel & FOREGROUND_BIT)); @@ -477,7 +477,7 @@ void stic_device::copy_sprites_to_background(bitmap_ind16 &bitmap) } nextY++; } - + //update the collision bits if (s->coll) { @@ -506,18 +506,18 @@ void stic_device::draw_background(bitmap_ind16 &bitmap, int transparency) int row,col; int fgcolor,bgcolor = 0; int code; - + int colora, colorb, colorc, colord; - + int n_bit; int p_bit; int g_bit; - + int j; - + int x0 = STIC_OVERSCAN_LEFT_WIDTH + m_col_delay; int y0 = STIC_OVERSCAN_TOP_HEIGHT + m_row_delay; - + if (m_color_stack_mode == 1) { m_color_stack_offset = 0; @@ -526,11 +526,11 @@ void stic_device::draw_background(bitmap_ind16 &bitmap, int transparency) for(col = 0; col < STIC_BACKTAB_WIDTH; col++) { value = m_ram16[offs]; - + n_bit = value & STIC_CSTM_ADV; p_bit = value & STIC_CSTM_FG3; g_bit = value & STIC_CSTM_SEL; - + if (p_bit && (!g_bit)) // colored squares mode { colora = value & STIC_CSQM_A; @@ -554,24 +554,24 @@ void stic_device::draw_background(bitmap_ind16 &bitmap, int transparency) m_color_stack_offset += 1; m_color_stack_offset &= (STIC_CSRS - 1); } - + if (p_bit) // pastel color set fgcolor = (value & STIC_CSTM_FG20) + 8; else fgcolor = value & STIC_CSTM_FG20; - + bgcolor = m_stic_registers[STIC_CSR + m_color_stack_offset]; code = (value & STIC_CSTM_C)>>3; - + if (g_bit) // read from gram { code &= (STIC_CSTM_C50 >> 3); // keep from going outside the array //if (m_gramdirtybytes[code] == 1) { decodechar(machine().gfx[1], - code, - m_gram, - machine().config()->gfxdecodeinfo[1].gfxlayout); + code, + m_gram, + machine().config()->gfxdecodeinfo[1].gfxlayout); m_gramdirtybytes[code] = 0; } // Draw GRAM char @@ -580,12 +580,12 @@ void stic_device::draw_background(bitmap_ind16 &bitmap, int transparency) bgcolor*16+fgcolor, 0,0, (x0 + col * STIC_CARD_WIDTH) * STIC_X_SCALE, (y0 + row * STIC_CARD_HEIGHT) * STIC_Y_SCALE, 0,transparency,bgcolor); - + for(j=0;j<8;j++) { //intv_set_pixel(bitmap, (x0 + col * STIC_CARD_WIDTH + j) * STIC_X_SCALE, (y0 + row * STIC_CARD_HEIGHT + 7) * STIC_Y_SCALE + 1, 1); } - + } else // read from grom { @@ -594,7 +594,7 @@ void stic_device::draw_background(bitmap_ind16 &bitmap, int transparency) bgcolor*16+fgcolor, 0,0, (x0 + col * STIC_CARD_WIDTH) * STIC_X_SCALE, (y0 + row * STIC_CARD_HEIGHT) * STIC_Y_SCALE, 0,transparency,bgcolor); - + for(j=0;j<8;j++) { //intv_set_pixel(bitmap, (x0 + col * STIC_CARD_WIDTH + j) * STIC_X_SCALE, (y0 + row * STIC_CARD_HEIGHT + 7) * STIC_Y_SCALE + 1, 2); @@ -616,15 +616,15 @@ void stic_device::draw_background(bitmap_ind16 &bitmap, int transparency) fgcolor = value & STIC_FBM_FG; bgcolor = ((value & STIC_FBM_BG2) >> 11) + ((value & STIC_FBM_BG310) >> 9); code = (value & STIC_FBM_C) >> 3; - + if (value & STIC_FBM_SEL) // read for GRAM { //if (m_gramdirtybytes[code] == 1) { decodechar(machine().gfx[1], - code, - m_gram, - machine().config()->gfxdecodeinfo[1].gfxlayout); + code, + m_gram, + machine().config()->gfxdecodeinfo[1].gfxlayout); m_gramdirtybytes[code] = 0; } // Draw GRAM char @@ -656,7 +656,7 @@ void stic_device::draw_sprites(bitmap_ind16 &bitmap, int behind_foreground) int code; int x0 = STIC_OVERSCAN_LEFT_WIDTH + m_col_delay - STIC_CARD_WIDTH; int y0 = STIC_OVERSCAN_TOP_HEIGHT + m_row_delay - STIC_CARD_HEIGHT; - + for (int i = STIC_MOBS - 1; i >= 0; --i) { intv_sprite_type *s = &m_sprite[i]; @@ -671,47 +671,47 @@ void stic_device::draw_sprites(bitmap_ind16 &bitmap, int behind_foreground) //if (m_gramdirtybytes[code] == 1) { decodechar(machine().gfx[1], - code, - m_gram, - machine().config()->gfxdecodeinfo[1].gfxlayout); + code, + m_gram, + machine().config()->gfxdecodeinfo[1].gfxlayout); m_gramdirtybytes[code] = 0; } // Draw GRAM char drawgfxzoom_transpen(bitmap,&machine().screen[0].visarea,machine().gfx[1], - code, - s->color, - s->xflip,s->yflip, - (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE, - 0x8000 * s->xsize, 0x8000 * s->ysize,0); + code, + s->color, + s->xflip,s->yflip, + (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE, + 0x8000 * s->xsize, 0x8000 * s->ysize,0); } else { //if ((m_gramdirtybytes[code] == 1) || (m_gramdirtybytes[code+1] == 1)) { decodechar(machine().gfx[1], - code, - m_gram, - machine().config()->gfxdecodeinfo[1].gfxlayout); + code, + m_gram, + machine().config()->gfxdecodeinfo[1].gfxlayout); decodechar(machine().gfx[1], - code+1, - m_gram, - machine().config()->gfxdecodeinfo[1].gfxlayout); + code+1, + m_gram, + machine().config()->gfxdecodeinfo[1].gfxlayout); m_gramdirtybytes[code] = 0; m_gramdirtybytes[code+1] = 0; } // Draw GRAM char drawgfxzoom_transpen(bitmap,&machine().screen[0].visarea,machine().gfx[1], - code, - s->color, - s->xflip,s->yflip, - (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + s->yflip * s->ysize * STIC_CARD_HEIGHT, - 0x8000*s->xsize, 0x8000*s->ysize,0); + code, + s->color, + s->xflip,s->yflip, + (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + s->yflip * s->ysize * STIC_CARD_HEIGHT, + 0x8000*s->xsize, 0x8000*s->ysize,0); drawgfxzoom_transpen(bitmap,&machine().screen[0].visarea,machine().gfx[1], - code+1, - s->color, - s->xflip,s->yflip, - (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + (1 - s->yflip) * s->ysize * STIC_CARD_HEIGHT, - 0x8000*s->xsize, 0x8000*s->ysize,0); + code+1, + s->color, + s->xflip,s->yflip, + (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + (1 - s->yflip) * s->ysize * STIC_CARD_HEIGHT, + 0x8000*s->xsize, 0x8000*s->ysize,0); } } else @@ -720,26 +720,26 @@ void stic_device::draw_sprites(bitmap_ind16 &bitmap, int behind_foreground) { // Draw GROM char drawgfxzoom_transpen(bitmap,&machine().screen[0].visarea,machine().gfx[0], - code, - s->color, - s->xflip,s->yflip, - (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE, - 0x8000*s->xsize, 0x8000*s->ysize,0); + code, + s->color, + s->xflip,s->yflip, + (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE, + 0x8000*s->xsize, 0x8000*s->ysize,0); } else { drawgfxzoom_transpen(bitmap,&machine().screen[0].visarea,machine().gfx[0], - code, - s->color, - s->xflip,s->yflip, - (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + s->yflip * s->ysize * STIC_CARD_HEIGHT, - 0x8000*s->xsize, 0x8000*s->ysize,0); + code, + s->color, + s->xflip,s->yflip, + (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + s->yflip * s->ysize * STIC_CARD_HEIGHT, + 0x8000*s->xsize, 0x8000*s->ysize,0); drawgfxzoom_transpen(bitmap,&machine().screen[0].visarea,machine().gfx[0], - code+1, - s->color, - s->xflip,s->yflip, - (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + (1 - s->yflip) * s->ysize * STIC_CARD_HEIGHT, - 0x8000*s->xsize, 0x8000*s->ysize,0); + code+1, + s->color, + s->xflip,s->yflip, + (s->xpos + x0) * STIC_X_SCALE, (s->ypos + y0) * STIC_Y_SCALE + (1 - s->yflip) * s->ysize * STIC_CARD_HEIGHT, + 0x8000*s->xsize, 0x8000*s->ysize,0); } } } @@ -751,7 +751,7 @@ void stic_device::draw_borders(bitmap_ind16 &bitmap) { intv_plot_box(bitmap, 0, 0, (STIC_OVERSCAN_LEFT_WIDTH + (m_left_edge_inhibit ? STIC_CARD_WIDTH : m_col_delay)) * STIC_X_SCALE, (STIC_OVERSCAN_TOP_HEIGHT + STIC_BACKTAB_HEIGHT * STIC_CARD_HEIGHT + STIC_OVERSCAN_BOTTOM_HEIGHT) * STIC_Y_SCALE, m_border_color); intv_plot_box(bitmap, (STIC_OVERSCAN_LEFT_WIDTH + STIC_BACKTAB_WIDTH * STIC_CARD_WIDTH - 1) * STIC_X_SCALE, 0, STIC_OVERSCAN_RIGHT_WIDTH, (STIC_OVERSCAN_TOP_HEIGHT + STIC_BACKTAB_HEIGHT * STIC_CARD_HEIGHT + STIC_OVERSCAN_BOTTOM_HEIGHT) * STIC_Y_SCALE, m_border_color); - + intv_plot_box(bitmap, 0, 0, (STIC_OVERSCAN_LEFT_WIDTH + STIC_BACKTAB_WIDTH * STIC_CARD_WIDTH - 1 + STIC_OVERSCAN_RIGHT_WIDTH) * STIC_X_SCALE, (STIC_OVERSCAN_TOP_HEIGHT + (m_top_edge_inhibit ? STIC_CARD_HEIGHT : m_row_delay)) * STIC_Y_SCALE, m_border_color); intv_plot_box(bitmap, 0, (STIC_OVERSCAN_TOP_HEIGHT + STIC_BACKTAB_HEIGHT * STIC_CARD_HEIGHT) * STIC_Y_SCALE, (STIC_OVERSCAN_LEFT_WIDTH + STIC_BACKTAB_WIDTH * STIC_CARD_WIDTH - 1 + STIC_OVERSCAN_RIGHT_WIDTH) * STIC_X_SCALE, STIC_OVERSCAN_BOTTOM_HEIGHT * STIC_Y_SCALE, m_border_color); } @@ -765,12 +765,12 @@ void stic_device::screenrefresh() render_background(m_bitmap); // Render the sprites into their buffers render_sprites(); - for (int i = 0; i < STIC_MOBS; i++) + for (int i = 0; i < STIC_MOBS; i++) m_sprite[i].collision = 0; // Copy the sprites to the background copy_sprites_to_background(m_bitmap); determine_sprite_collisions(); - for (int i = 0; i < STIC_MOBS; i++) + for (int i = 0; i < STIC_MOBS; i++) m_stic_registers[STIC_MCR + i] |= m_sprite[i].collision; /* draw the screen borders if enabled */ draw_borders(m_bitmap); @@ -951,7 +951,7 @@ WRITE16_MEMBER( stic_device::write ) //logerror("unmapped write to STIC register %02X: %04X\n", offset, data); break; } - + if (offset < sizeof(m_stic_registers) / sizeof(m_stic_registers[0])) m_stic_registers[offset] = data; } |