trunk/src/mame/video/inufuku.c
| r18350 | r18351 | |
| 13 | 13 | |
| 14 | 14 | #include "emu.h" |
| 15 | 15 | #include "includes/inufuku.h" |
| 16 | #include "vsystem_spr.h" |
| 16 | 17 | |
| 17 | 18 | |
| 18 | 19 | /****************************************************************************** |
| r18350 | r18351 | |
| 56 | 57 | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 57 | 58 | { |
| 58 | 59 | inufuku_state *state = machine.driver_data<inufuku_state>(); |
| 59 | | int offs; |
| 60 | 60 | |
| 61 | | for (offs = (state->m_spriteram1.bytes() / 16) - 1; offs >= 0; offs--) |
| 62 | | { |
| 63 | | if ((state->m_spriteram1[offs] & 0x8000) == 0x0000) |
| 64 | | { |
| 65 | | int attr_start; |
| 66 | | int map_start; |
| 67 | | int ox, oy, x, y, xsize, ysize, zoomx, zoomy, flipx, flipy, color; |
| 68 | | int priority, priority_mask; |
| 69 | | |
| 70 | | attr_start = 4 * (state->m_spriteram1[offs] & 0x03ff); |
| 71 | | |
| 72 | | /* |
| 73 | | attr_start + 0x0000 |
| 74 | | ---- ---x xxxx xxxx oy |
| 75 | | ---- xxx- ---- ---- ysize |
| 76 | | xxxx ---- ---- ---- zoomy |
| 77 | | |
| 78 | | attr_start + 0x0001 |
| 79 | | ---- ---x xxxx xxxx ox |
| 80 | | ---- xxx- ---- ---- xsize |
| 81 | | xxxx ---- ---- ---- zoomx |
| 82 | | |
| 83 | | attr_start + 0x0002 |
| 84 | | -x-- ---- ---- ---- flipx |
| 85 | | x--- ---- ---- ---- flipy |
| 86 | | --xx xxxx ---- ---- color |
| 87 | | --xx ---- ---- ---- priority? |
| 88 | | ---- ---- xxxx xxxx unused? |
| 89 | | |
| 90 | | attr_start + 0x0003 |
| 91 | | -xxx xxxx xxxx xxxx map start |
| 92 | | x--- ---- ---- ---- unused? |
| 93 | | */ |
| 94 | | |
| 95 | | ox = (state->m_spriteram1[attr_start + 1] & 0x01ff) + 0; |
| 96 | | xsize = (state->m_spriteram1[attr_start + 1] & 0x0e00) >> 9; |
| 97 | | zoomx = (state->m_spriteram1[attr_start + 1] & 0xf000) >> 12; |
| 98 | | oy = (state->m_spriteram1[attr_start + 0] & 0x01ff) + 1; |
| 99 | | ysize = (state->m_spriteram1[attr_start + 0] & 0x0e00) >> 9; |
| 100 | | zoomy = (state->m_spriteram1[attr_start + 0] & 0xf000) >> 12; |
| 101 | | flipx = state->m_spriteram1[attr_start + 2] & 0x4000; |
| 102 | | flipy = state->m_spriteram1[attr_start + 2] & 0x8000; |
| 103 | | color = (state->m_spriteram1[attr_start + 2] & 0x3f00) >> 8; |
| 104 | | priority = (state->m_spriteram1[attr_start + 2] & 0x3000) >> 12; |
| 105 | | map_start = (state->m_spriteram1[attr_start + 3] & 0x7fff) << 1; |
| 106 | | |
| 107 | | switch (priority) |
| 108 | | { |
| 109 | | default: |
| 110 | | case 0: priority_mask = 0x00; break; |
| 111 | | case 3: priority_mask = 0xfe; break; |
| 112 | | case 2: priority_mask = 0xfc; break; |
| 113 | | case 1: priority_mask = 0xf0; break; |
| 114 | | } |
| 115 | | |
| 116 | | ox += (xsize * zoomx + 2) / 4; |
| 117 | | oy += (ysize * zoomy + 2) / 4; |
| 118 | | |
| 119 | | zoomx = 32 - zoomx; |
| 120 | | zoomy = 32 - zoomy; |
| 121 | | |
| 122 | | for (y = 0; y <= ysize; y++) |
| 123 | | { |
| 124 | | int sx, sy; |
| 125 | | |
| 126 | | if (flipy) |
| 127 | | sy = (oy + zoomy * (ysize - y) / 2 + 16) & 0x1ff; |
| 128 | | else |
| 129 | | sy = (oy + zoomy * y / 2 + 16) & 0x1ff; |
| 130 | | |
| 131 | | for (x = 0; x <= xsize; x++) |
| 132 | | { |
| 133 | | int code; |
| 134 | | |
| 135 | | if (flipx) |
| 136 | | sx = (ox + zoomx * (xsize - x) / 2 + 16) & 0x1ff; |
| 137 | | else |
| 138 | | sx = (ox + zoomx * x / 2 + 16) & 0x1ff; |
| 139 | | |
| 140 | | code = ((state->m_spriteram2[map_start] & 0x0007) << 16) + state->m_spriteram2[map_start + 1]; |
| 141 | | |
| 142 | | pdrawgfxzoom_transpen(bitmap, cliprect, machine.gfx[2], |
| 143 | | code, |
| 144 | | color, |
| 145 | | flipx, flipy, |
| 146 | | sx - 16, sy - 16, |
| 147 | | zoomx << 11, zoomy << 11, |
| 148 | | machine.priority_bitmap,priority_mask, 15); |
| 149 | | |
| 150 | | map_start += 2; |
| 151 | | } |
| 152 | | } |
| 153 | | } |
| 154 | | } |
| 61 | draw_sprites_inufuku( state->m_spriteram1_old, state->m_spriteram1.bytes(), state->m_spriteram2, machine, bitmap, cliprect ); |
| 155 | 62 | } |
| 156 | 63 | |
| 157 | 64 | |
| r18350 | r18351 | |
| 216 | 123 | |
| 217 | 124 | m_bg_tilemap->set_transparent_pen(255); |
| 218 | 125 | m_tx_tilemap->set_transparent_pen(255); |
| 126 | |
| 127 | m_spriteram1_old = auto_alloc_array_clear(machine(), UINT16, m_spriteram1.bytes()/2); |
| 219 | 128 | } |
| 220 | 129 | |
| 221 | 130 | |
| r18350 | r18351 | |
| 236 | 145 | { |
| 237 | 146 | m_bg_tilemap->set_scroll_rows(512); |
| 238 | 147 | for (i = 0; i < 256; i++) |
| 239 | | m_bg_tilemap->set_scrollx((m_bg_scrolly + i) & 0x1ff, m_bg_rasterram[i]); |
| 148 | m_bg_tilemap->set_scrollx((m_bg_scrolly + i) & 0x1ff, m_bg_scrollx+m_bg_rasterram[i]); |
| 240 | 149 | } |
| 241 | 150 | else |
| 242 | 151 | { |
| r18350 | r18351 | |
| 253 | 162 | draw_sprites(machine(), bitmap, cliprect); |
| 254 | 163 | return 0; |
| 255 | 164 | } |
| 165 | |
| 166 | void inufuku_state::screen_eof_inufuku(screen_device &screen, bool state) |
| 167 | { |
| 168 | // rising edge |
| 169 | if (state) |
| 170 | { |
| 171 | memcpy(m_spriteram1_old,m_spriteram1,m_spriteram1.bytes()); |
| 172 | } |
| 173 | } |
| 174 | |
trunk/src/mame/video/vsystem_spr.c
| r0 | r18351 | |
| 1 | // Video System Sprites |
| 2 | // todo: |
| 3 | // move various vsystem sprite functions here |
| 4 | // unify common ones + convert to device |
| 5 | |
| 6 | #include "emu.h" |
| 7 | |
| 8 | // zooming is wrong for 3on3dunk ... suprslam implementation is probably better |
| 9 | void draw_sprites_inufuku( UINT16* spriteram1, int spriteram1_bytes, UINT16* spriteram2, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 10 | { |
| 11 | int offs; |
| 12 | int end = 0; |
| 13 | |
| 14 | for (offs = 0; offs < (spriteram1_bytes / 16 ); offs++) |
| 15 | { |
| 16 | if (spriteram1[offs] & 0x4000) break; |
| 17 | } |
| 18 | end = offs; |
| 19 | |
| 20 | for (offs = end - 1; offs >= 0; offs--) |
| 21 | { |
| 22 | if ((spriteram1[offs] & 0x8000) == 0x0000) |
| 23 | { |
| 24 | int attr_start; |
| 25 | int map_start; |
| 26 | int ox, oy, x, y, xsize, ysize, zoomx, zoomy, flipx, flipy, color; |
| 27 | int priority, priority_mask; |
| 28 | |
| 29 | attr_start = 4 * (spriteram1[offs] & 0x03ff); |
| 30 | |
| 31 | /* |
| 32 | attr_start + 0x0000 |
| 33 | ---- ---x xxxx xxxx oy |
| 34 | ---- xxx- ---- ---- ysize |
| 35 | xxxx ---- ---- ---- zoomy |
| 36 | |
| 37 | attr_start + 0x0001 |
| 38 | ---- ---x xxxx xxxx ox |
| 39 | ---- xxx- ---- ---- xsize |
| 40 | xxxx ---- ---- ---- zoomx |
| 41 | |
| 42 | attr_start + 0x0002 |
| 43 | -x-- ---- ---- ---- flipx |
| 44 | x--- ---- ---- ---- flipy |
| 45 | --xx xxxx ---- ---- color |
| 46 | --xx ---- ---- ---- priority? |
| 47 | ---- ---- xxxx xxxx unused? |
| 48 | |
| 49 | attr_start + 0x0003 |
| 50 | -xxx xxxx xxxx xxxx map start |
| 51 | x--- ---- ---- ---- unused? |
| 52 | */ |
| 53 | |
| 54 | ox = (spriteram1[attr_start + 1] & 0x01ff) + 0; |
| 55 | xsize = (spriteram1[attr_start + 1] & 0x0e00) >> 9; |
| 56 | zoomx = (spriteram1[attr_start + 1] & 0xf000) >> 12; |
| 57 | oy = (spriteram1[attr_start + 0] & 0x01ff) + 1; |
| 58 | ysize = (spriteram1[attr_start + 0] & 0x0e00) >> 9; |
| 59 | zoomy = (spriteram1[attr_start + 0] & 0xf000) >> 12; |
| 60 | flipx = spriteram1[attr_start + 2] & 0x4000; |
| 61 | flipy = spriteram1[attr_start + 2] & 0x8000; |
| 62 | color = (spriteram1[attr_start + 2] & 0x3f00) >> 8; |
| 63 | priority = (spriteram1[attr_start + 2] & 0x3000) >> 12; |
| 64 | map_start = (spriteram1[attr_start + 3] & 0x7fff) << 1; |
| 65 | |
| 66 | switch (priority) |
| 67 | { |
| 68 | default: |
| 69 | case 0: priority_mask = 0x00; break; |
| 70 | case 3: priority_mask = 0xfe; break; |
| 71 | case 2: priority_mask = 0xfc; break; |
| 72 | case 1: priority_mask = 0xf0; break; |
| 73 | } |
| 74 | |
| 75 | ox += (xsize * zoomx + 2) / 4; |
| 76 | oy += (ysize * zoomy + 2) / 4; |
| 77 | |
| 78 | zoomx = 32 - zoomx; |
| 79 | zoomy = 32 - zoomy; |
| 80 | |
| 81 | for (y = 0; y <= ysize; y++) |
| 82 | { |
| 83 | int sx, sy; |
| 84 | |
| 85 | if (flipy) |
| 86 | sy = (oy + zoomy * (ysize - y) / 2 + 16) & 0x1ff; |
| 87 | else |
| 88 | sy = (oy + zoomy * y / 2 + 16) & 0x1ff; |
| 89 | |
| 90 | for (x = 0; x <= xsize; x++) |
| 91 | { |
| 92 | int code; |
| 93 | |
| 94 | if (flipx) |
| 95 | sx = (ox + zoomx * (xsize - x) / 2 + 16) & 0x1ff; |
| 96 | else |
| 97 | sx = (ox + zoomx * x / 2 + 16) & 0x1ff; |
| 98 | |
| 99 | code = ((spriteram2[map_start] & 0x0007) << 16) + spriteram2[map_start + 1]; |
| 100 | |
| 101 | pdrawgfxzoom_transpen(bitmap, cliprect, machine.gfx[2], |
| 102 | code, |
| 103 | color, |
| 104 | flipx, flipy, |
| 105 | sx - 16, sy - 16, |
| 106 | zoomx << 11, zoomy << 11, |
| 107 | machine.priority_bitmap,priority_mask, 15); |
| 108 | |
| 109 | map_start += 2; |
| 110 | } |
| 111 | } |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | |
| 117 | |
| 118 | /* todo, fix zooming correctly, it's _not_ like aerofgt */ |
| 119 | void draw_sprites_suprslam( UINT16* spriteram, int spriteram_bytes, UINT16* sp_videoram, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 120 | { |
| 121 | /* SPRITE INFO |
| 122 | |
| 123 | Video System hardware, like aerofgt etc. |
| 124 | |
| 125 | the sprites use 2 areas of ram, one containing a spritelist + sprite attributes, the other |
| 126 | contains the sprite tile #'s to use |
| 127 | |
| 128 | sprite attribute info (4 words per sprite) |
| 129 | |
| 130 | | ZZZZ hhhy yyyy yyyy | zzzz wwwx xxxx xxxx | -fpp pppp ---- ---- | -ooo oooo oooo oooo | |
| 131 | |
| 132 | x = x position |
| 133 | y = y position |
| 134 | w = width |
| 135 | h = height |
| 136 | zZ = y zoom / x zoom |
| 137 | f = xflip |
| 138 | p = palette / colour |
| 139 | o = offset to tile data in other ram area |
| 140 | |
| 141 | */ |
| 142 | |
| 143 | gfx_element *gfx = machine.gfx[1]; |
| 144 | UINT16 *source = spriteram; |
| 145 | UINT16 *source2 = spriteram; |
| 146 | UINT16 *finish = source + 0x2000/2; |
| 147 | |
| 148 | while (source < finish) |
| 149 | { |
| 150 | UINT32 sprnum = source[0] & 0x03ff; |
| 151 | if (source[0] == 0x4000) break; |
| 152 | |
| 153 | sprnum *= 4; |
| 154 | |
| 155 | source++; |
| 156 | /* DRAW START */ |
| 157 | { |
| 158 | int ypos = source2[sprnum + 0] & 0x1ff; |
| 159 | int high = (source2[sprnum + 0] & 0x0e00) >> 9; |
| 160 | int yzoom = (source2[sprnum + 0] & 0xf000) >> 12; |
| 161 | |
| 162 | int xpos = source2[sprnum + 1] & 0x1ff; |
| 163 | int wide = (source2[sprnum + 1] & 0x0e00) >> 9; |
| 164 | int xzoom = (source2[sprnum + 1] & 0xf000) >> 12; |
| 165 | |
| 166 | int col = (source2[sprnum + 2] & 0x3f00) >> 8; |
| 167 | int flipx = (source2[sprnum + 2] & 0x4000) >> 14; |
| 168 | // int flipy = (source2[sprnum + 2] & 0x8000) >> 15; |
| 169 | |
| 170 | int word_offset = source2[sprnum + 3] & 0x7fff; |
| 171 | int xcnt, ycnt; |
| 172 | |
| 173 | int loopno = 0; |
| 174 | |
| 175 | xzoom = 32 - xzoom; |
| 176 | yzoom = 32 - yzoom; |
| 177 | |
| 178 | if (ypos > 0xff) ypos -=0x200; |
| 179 | |
| 180 | for (ycnt = 0; ycnt < high+1; ycnt ++) |
| 181 | { |
| 182 | if (!flipx) |
| 183 | { |
| 184 | for (xcnt = 0; xcnt < wide+1; xcnt ++) |
| 185 | { |
| 186 | int tileno = sp_videoram[word_offset + loopno]; |
| 187 | drawgfxzoom_transpen(bitmap, cliprect, gfx, tileno, col, 0, 0,xpos + xcnt * xzoom/2, ypos + ycnt * yzoom/2,xzoom << 11, yzoom << 11, 15); |
| 188 | drawgfxzoom_transpen(bitmap, cliprect, gfx, tileno, col, 0, 0,-0x200+xpos + xcnt * xzoom/2, ypos + ycnt * yzoom/2,xzoom << 11, yzoom << 11, 15); |
| 189 | loopno ++; |
| 190 | } |
| 191 | } |
| 192 | else |
| 193 | { |
| 194 | for (xcnt = wide; xcnt >= 0; xcnt --) |
| 195 | { |
| 196 | int tileno = sp_videoram[word_offset + loopno]; |
| 197 | drawgfxzoom_transpen(bitmap, cliprect, gfx, tileno, col, 1, 0,xpos + xcnt * xzoom/2, ypos + ycnt * yzoom/2,xzoom << 11, yzoom << 11, 15); |
| 198 | drawgfxzoom_transpen(bitmap, cliprect, gfx, tileno, col, 1, 0,-0x200+xpos + xcnt * xzoom/2, ypos + ycnt * yzoom/2,xzoom << 11, yzoom << 11, 15); |
| 199 | loopno ++; |
| 200 | } |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | } |
| 205 | } |
trunk/src/mame/video/suprslam.c
| r18350 | r18351 | |
| 3 | 3 | #include "emu.h" |
| 4 | 4 | #include "video/konicdev.h" |
| 5 | 5 | #include "includes/suprslam.h" |
| 6 | #include "vsystem_spr.h" |
| 6 | 7 | |
| 7 | | |
| 8 | | /* todo, fix zooming correctly, it's _not_ like aerofgt */ |
| 9 | | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 10 | | { |
| 11 | | /* SPRITE INFO |
| 12 | | |
| 13 | | Video System hardware, like aerofgt etc. |
| 14 | | |
| 15 | | the sprites use 2 areas of ram, one containing a spritelist + sprite attributes, the other |
| 16 | | contains the sprite tile #'s to use |
| 17 | | |
| 18 | | sprite attribute info (4 words per sprite) |
| 19 | | |
| 20 | | | ZZZZ hhhy yyyy yyyy | zzzz wwwx xxxx xxxx | -fpp pppp ---- ---- | -ooo oooo oooo oooo | |
| 21 | | |
| 22 | | x = x position |
| 23 | | y = y position |
| 24 | | w = width |
| 25 | | h = height |
| 26 | | zZ = y zoom / x zoom |
| 27 | | f = xflip |
| 28 | | p = palette / colour |
| 29 | | o = offset to tile data in other ram area |
| 30 | | |
| 31 | | */ |
| 32 | | |
| 33 | | suprslam_state *state = machine.driver_data<suprslam_state>(); |
| 34 | | gfx_element *gfx = machine.gfx[1]; |
| 35 | | UINT16 *source = state->m_spriteram; |
| 36 | | UINT16 *source2 = state->m_spriteram; |
| 37 | | UINT16 *finish = source + 0x2000/2; |
| 38 | | |
| 39 | | while (source < finish) |
| 40 | | { |
| 41 | | UINT32 sprnum = source[0] & 0x03ff; |
| 42 | | if (source[0] == 0x4000) break; |
| 43 | | |
| 44 | | sprnum *= 4; |
| 45 | | |
| 46 | | source++; |
| 47 | | /* DRAW START */ |
| 48 | | { |
| 49 | | int ypos = source2[sprnum + 0] & 0x1ff; |
| 50 | | int high = (source2[sprnum + 0] & 0x0e00) >> 9; |
| 51 | | int yzoom = (source2[sprnum + 0] & 0xf000) >> 12; |
| 52 | | |
| 53 | | int xpos = source2[sprnum + 1] & 0x1ff; |
| 54 | | int wide = (source2[sprnum + 1] & 0x0e00) >> 9; |
| 55 | | int xzoom = (source2[sprnum + 1] & 0xf000) >> 12; |
| 56 | | |
| 57 | | int col = (source2[sprnum + 2] & 0x3f00) >> 8; |
| 58 | | int flipx = (source2[sprnum + 2] & 0x4000) >> 14; |
| 59 | | // int flipy = (source2[sprnum + 2] & 0x8000) >> 15; |
| 60 | | |
| 61 | | int word_offset = source2[sprnum + 3] & 0x7fff; |
| 62 | | int xcnt, ycnt; |
| 63 | | |
| 64 | | int loopno = 0; |
| 65 | | |
| 66 | | xzoom = 32 - xzoom; |
| 67 | | yzoom = 32 - yzoom; |
| 68 | | |
| 69 | | if (ypos > 0xff) ypos -=0x200; |
| 70 | | |
| 71 | | for (ycnt = 0; ycnt < high+1; ycnt ++) |
| 72 | | { |
| 73 | | if (!flipx) |
| 74 | | { |
| 75 | | for (xcnt = 0; xcnt < wide+1; xcnt ++) |
| 76 | | { |
| 77 | | int tileno = state->m_sp_videoram[word_offset + loopno]; |
| 78 | | drawgfxzoom_transpen(bitmap, cliprect, gfx, tileno, col, 0, 0,xpos + xcnt * xzoom/2, ypos + ycnt * yzoom/2,xzoom << 11, yzoom << 11, 15); |
| 79 | | drawgfxzoom_transpen(bitmap, cliprect, gfx, tileno, col, 0, 0,-0x200+xpos + xcnt * xzoom/2, ypos + ycnt * yzoom/2,xzoom << 11, yzoom << 11, 15); |
| 80 | | loopno ++; |
| 81 | | } |
| 82 | | } |
| 83 | | else |
| 84 | | { |
| 85 | | for (xcnt = wide; xcnt >= 0; xcnt --) |
| 86 | | { |
| 87 | | int tileno = state->m_sp_videoram[word_offset + loopno]; |
| 88 | | drawgfxzoom_transpen(bitmap, cliprect, gfx, tileno, col, 1, 0,xpos + xcnt * xzoom/2, ypos + ycnt * yzoom/2,xzoom << 11, yzoom << 11, 15); |
| 89 | | drawgfxzoom_transpen(bitmap, cliprect, gfx, tileno, col, 1, 0,-0x200+xpos + xcnt * xzoom/2, ypos + ycnt * yzoom/2,xzoom << 11, yzoom << 11, 15); |
| 90 | | loopno ++; |
| 91 | | } |
| 92 | | } |
| 93 | | } |
| 94 | | } |
| 95 | | } |
| 96 | | } |
| 97 | | |
| 98 | 8 | /* FG 'SCREEN' LAYER */ |
| 99 | 9 | |
| 100 | 10 | WRITE16_MEMBER(suprslam_state::suprslam_screen_videoram_w) |
| r18350 | r18351 | |
| 154 | 64 | bitmap.fill(get_black_pen(machine()), cliprect); |
| 155 | 65 | k053936_zoom_draw(m_k053936, bitmap, cliprect, m_bg_tilemap, 0, 0, 1); |
| 156 | 66 | if(!(m_spr_ctrl[0] & 8)) |
| 157 | | draw_sprites(machine(), bitmap, cliprect); |
| 67 | draw_sprites_suprslam(m_spriteram, m_spriteram.bytes(), m_sp_videoram, machine(), bitmap, cliprect); |
| 158 | 68 | m_screen_tilemap->draw(bitmap, cliprect, 0, 0); |
| 159 | 69 | if(m_spr_ctrl[0] & 8) |
| 160 | | draw_sprites(machine(), bitmap, cliprect); |
| 70 | draw_sprites_suprslam(m_spriteram, m_spriteram.bytes(), m_sp_videoram, machine(), bitmap, cliprect); |
| 161 | 71 | return 0; |
| 162 | 72 | } |
| 163 | 73 | |
trunk/src/mame/drivers/inufuku.c
| r18350 | r18351 | |
| 5 | 5 | Quiz & Variety Sukusuku Inufuku (Japan) |
| 6 | 6 | (c)1998 Video System Co.,Ltd. |
| 7 | 7 | |
| 8 | 3 On 3 Dunk Madness (US, prototype?) |
| 9 | (c)1996 Video System Co.,Ltd. |
| 10 | |
| 8 | 11 | Driver by Takahiro Nogi <nogi@kt.rim.or.jp> 2003/08/09 - |
| 9 | 12 | |
| 10 | 13 | based on other Video System drivers |
| r18350 | r18351 | |
| 127 | 130 | static ADDRESS_MAP_START( inufuku_map, AS_PROGRAM, 16, inufuku_state ) |
| 128 | 131 | AM_RANGE(0x000000, 0x0fffff) AM_ROM // main rom |
| 129 | 132 | |
| 130 | | AM_RANGE(0x100000, 0x100007) AM_WRITENOP // ? |
| 133 | // AM_RANGE(0x100000, 0x100007) AM_WRITENOP // ? |
| 131 | 134 | |
| 132 | 135 | AM_RANGE(0x180000, 0x180001) AM_READ_PORT("P1") |
| 133 | 136 | AM_RANGE(0x180002, 0x180003) AM_READ_PORT("P2") |
| r18350 | r18351 | |
| 143 | 146 | AM_RANGE(0x380000, 0x3801ff) AM_WRITEONLY AM_SHARE("bg_rasterram") // bg raster ram |
| 144 | 147 | AM_RANGE(0x400000, 0x401fff) AM_READWRITE(inufuku_bg_videoram_r, inufuku_bg_videoram_w) AM_SHARE("bg_videoram") // bg ram |
| 145 | 148 | AM_RANGE(0x402000, 0x403fff) AM_READWRITE(inufuku_tx_videoram_r, inufuku_tx_videoram_w) AM_SHARE("tx_videoram") // text ram |
| 146 | | AM_RANGE(0x580000, 0x580fff) AM_RAM AM_SHARE("spriteram1") // sprite table + sprite attribute |
| 149 | AM_RANGE(0x404000, 0x40ffff) AM_RAM // ?? mirror (3on3dunk) |
| 150 | AM_RANGE(0x580000, 0x581fff) AM_RAM AM_SHARE("spriteram1") // sprite table + sprite attribute |
| 147 | 151 | AM_RANGE(0x600000, 0x61ffff) AM_RAM AM_SHARE("spriteram2") // cell table |
| 148 | 152 | |
| 149 | 153 | AM_RANGE(0x780000, 0x780013) AM_WRITE(inufuku_palettereg_w) // bg & text palettebank register |
| r18350 | r18351 | |
| 222 | 226 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4) |
| 223 | 227 | |
| 224 | 228 | PORT_START("EXTRA") |
| 225 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 ) |
| 226 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 ) |
| 227 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 ) |
| 228 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START4 ) |
| 229 | | PORT_DIPNAME( 0x10, 0x10, "3P/4P" ) |
| 230 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 231 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 232 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 233 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) |
| 234 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, inufuku_state,soundflag_r, NULL) // pending sound command |
| 229 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN3 ) |
| 230 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN4 ) |
| 231 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START3 ) |
| 232 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START4 ) |
| 233 | PORT_DIPNAME( 0x0010, 0x0010, "3P/4P" ) |
| 234 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) |
| 235 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 236 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 237 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) |
| 238 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, inufuku_state,soundflag_r, NULL) // pending sound command |
| 239 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) // 3on3dunk cares about something in here, possibly a vblank flag |
| 235 | 240 | |
| 236 | 241 | PORT_START( "EEPROMOUT" ) |
| 237 | 242 | PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) |
| r18350 | r18351 | |
| 250 | 255 | INPUT_PORTS_END |
| 251 | 256 | |
| 252 | 257 | |
| 258 | |
| 259 | |
| 253 | 260 | /****************************************************************************** |
| 254 | 261 | |
| 255 | 262 | Graphics definitions |
| r18350 | r18351 | |
| 280 | 287 | 128*8 |
| 281 | 288 | }; |
| 282 | 289 | |
| 290 | static const gfx_layout spritelayout_alt = |
| 291 | { |
| 292 | 16, 16, |
| 293 | RGN_FRAC(1, 1), |
| 294 | 4, |
| 295 | { 0, 1, 2, 3 }, |
| 296 | { 1*4, 0*4, 3*4, 2*4, 5*4, 4*4, 7*4, 6*4, |
| 297 | 9*4, 8*4, 11*4, 10*4, 13*4, 12*4, 15*4, 14*4 }, |
| 298 | { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, |
| 299 | 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 }, |
| 300 | 128*8 |
| 301 | }; |
| 302 | |
| 283 | 303 | static GFXDECODE_START( inufuku ) |
| 284 | 304 | GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 0, 256*16 ) // bg |
| 285 | 305 | GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 0, 256*16 ) // text |
| 286 | 306 | GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0, 256*16 ) // sprite |
| 287 | 307 | GFXDECODE_END |
| 288 | 308 | |
| 309 | static GFXDECODE_START( _3on3dunk ) |
| 310 | GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 0, 256*16 ) // bg |
| 311 | GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 0, 256*16 ) // text |
| 312 | GFXDECODE_ENTRY( "gfx3", 0, spritelayout_alt, 0, 256*16 ) // sprite |
| 313 | GFXDECODE_END |
| 289 | 314 | |
| 315 | |
| 290 | 316 | /****************************************************************************** |
| 291 | 317 | |
| 292 | 318 | Sound definitions |
| r18350 | r18351 | |
| 315 | 341 | { |
| 316 | 342 | UINT8 *ROM = memregion("audiocpu")->base(); |
| 317 | 343 | |
| 318 | | membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x8000); |
| 344 | membank("bank1")->configure_entries(0, 4, &ROM[0x00000], 0x8000); |
| 319 | 345 | membank("bank1")->set_entry(0); |
| 320 | 346 | |
| 321 | 347 | m_audiocpu = machine().device<cpu_device>("audiocpu"); |
| r18350 | r18351 | |
| 361 | 387 | /* video hardware */ |
| 362 | 388 | MCFG_SCREEN_ADD("screen", RASTER) |
| 363 | 389 | MCFG_SCREEN_REFRESH_RATE(60) |
| 364 | | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 390 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2300)) |
| 365 | 391 | MCFG_SCREEN_SIZE(2048, 256) |
| 366 | 392 | MCFG_SCREEN_VISIBLE_AREA(0, 319-1, 1, 224-1) |
| 367 | 393 | MCFG_SCREEN_UPDATE_DRIVER(inufuku_state, screen_update_inufuku) |
| 394 | MCFG_SCREEN_VBLANK_DRIVER(inufuku_state, screen_eof_inufuku) |
| 368 | 395 | |
| 369 | 396 | MCFG_GFXDECODE(inufuku) |
| 370 | 397 | MCFG_PALETTE_LENGTH(4096) |
| r18350 | r18351 | |
| 381 | 408 | MACHINE_CONFIG_END |
| 382 | 409 | |
| 383 | 410 | |
| 411 | static MACHINE_CONFIG_DERIVED( _3on3dunk, inufuku ) |
| 412 | MCFG_GFXDECODE(_3on3dunk) |
| 413 | MACHINE_CONFIG_END |
| 414 | |
| 415 | |
| 416 | |
| 417 | |
| 418 | |
| 384 | 419 | /****************************************************************************** |
| 385 | 420 | |
| 386 | 421 | ROM definitions |
| r18350 | r18351 | |
| 393 | 428 | ROM_LOAD16_WORD_SWAP( "u146.bin", 0x0080000, 0x080000, CRC(e05e9bd4) SHA1(af0fdf31c2bdf851bf15c9de725dcbbb58464d54) ) |
| 394 | 429 | ROM_LOAD16_WORD_SWAP( "lhmn5l28.148", 0x0800000, 0x400000, CRC(802d17e7) SHA1(43b26efea65fd051c094d19784cb977ced39a1a0) ) |
| 395 | 430 | |
| 396 | | ROM_REGION( 0x0030000, "audiocpu", 0 ) // sound cpu |
| 431 | ROM_REGION( 0x0020000, "audiocpu", 0 ) // sound cpu |
| 397 | 432 | ROM_LOAD( "u107.bin", 0x0000000, 0x020000, CRC(1744ef90) SHA1(e019f4ca83e21aa25710cc0ca40ffe765c7486c9) ) |
| 398 | | ROM_RELOAD( 0x010000, 0x020000 ) |
| 399 | 433 | |
| 400 | 434 | ROM_REGION( 0x0400000, "gfx1", 0 ) // bg |
| 401 | 435 | ROM_LOAD16_WORD_SWAP( "lhmn5ku8.u40", 0x0000000, 0x400000, CRC(8cbca80a) SHA1(063e9be97f5a1f021f8326f2994b51f9af5e1eaf) ) |
| r18350 | r18351 | |
| 412 | 446 | ROM_LOAD( "lhmn5ku6.u53", 0x0000000, 0x400000, CRC(b320c5c9) SHA1(7c99da2d85597a3c008ed61a3aa5f47ad36186ec) ) |
| 413 | 447 | ROM_END |
| 414 | 448 | |
| 449 | ROM_START( 3on3dunk ) |
| 450 | ROM_REGION( 0x1000000, "maincpu", 0 ) // main cpu + data |
| 451 | ROM_LOAD16_WORD_SWAP( "prog0_2_4_usa.u147", 0x0000000, 0x080000, CRC(957924ab) SHA1(6fe8ca711d11239310d58188e9d6d28cd27bc5af) ) |
| 452 | ROM_LOAD16_WORD_SWAP( "prog1_2_4_usa.u146", 0x0080000, 0x080000, CRC(2479e236) SHA1(729e6c85d34d6925c8d6557b138e2bed43e1de6a) ) |
| 453 | ROM_LOAD16_WORD_SWAP( "u148", 0x0800000, 0x400000, CRC(aa33e02a) SHA1(86381ecf18fba9065cbc02112751c435bbf8b8b4) ) |
| 415 | 454 | |
| 455 | ROM_REGION( 0x0020000, "audiocpu", 0 ) // sound cpu |
| 456 | ROM_LOAD( "sound_prog_97_1_13.u107", 0x0000000, 0x020000, CRC(d9d42805) SHA1(ab5cb7c141d9c9ed5121ba4dbc1d0fa187bd9f68) ) |
| 457 | |
| 458 | ROM_REGION( 0x0400000, "gfx1", 0 ) // bg |
| 459 | ROM_LOAD16_WORD_SWAP( "u40", 0x0000000, 0x400000, CRC(aaa426d1) SHA1(2f9a2981f336caf3188baec9a34f61452dee2203) ) |
| 460 | |
| 461 | ROM_REGION( 0x0400000, "gfx2", 0 ) // text |
| 462 | ROM_LOAD16_WORD_SWAP( "u8", 0x0000000, 0x200000, CRC(2b7be1d8) SHA1(aac274a8f4028db7429478601a1761e61ab4f9a2) ) |
| 463 | |
| 464 | ROM_REGION( 0x2000000, "gfx3", 0 ) // sprite |
| 465 | ROM_LOAD( "u34", 0x0000000, 0x400000, CRC(7372ce78) SHA1(ed2a861986357fad7ef983750cd906c3d722b862) ) |
| 466 | ROM_LOAD( "u36", 0x0400000, 0x400000, CRC(247e5741) SHA1(8d71d964791fb4b86e390bcdf7744f616d6357b1) ) |
| 467 | ROM_LOAD( "u38", 0x0800000, 0x400000, CRC(76449b1e) SHA1(b63d50c6f0dc91dc94dbcdda9842598529c1c26e) ) |
| 468 | ROM_LOAD( "u20", 0x0c00000, 0x200000, CRC(f457cd3b) SHA1(cc13f5dc44e4675c1074a365b10f34e684817d81) ) |
| 469 | /* 0x0e00000, 0x200000 empty */ |
| 470 | ROM_LOAD( "u32", 0x1000000, 0x400000, CRC(bc39e449) SHA1(5aea90b66ee03c70797ddc42dbcb064d83ce8cc7) ) |
| 471 | |
| 472 | ROM_REGION( 0x0400000, "ymsnd", 0 ) // adpcm data |
| 473 | ROM_LOAD( "u53", 0x0000000, 0x100000, CRC(765d892f) SHA1(9b078c879d0437d1669bf4301fd52a768aa4d293) ) |
| 474 | |
| 475 | ROM_REGION( 0x400000, "ymsnd.deltat", 0 ) /* Samples */ // plays speech clips from here |
| 476 | ROM_LOAD( "u51", 0x0000000, 0x400000, CRC(153989b1) SHA1(754cce382d9a7bfcebdfd0f23c5e04ee30449aa4) ) |
| 477 | ROM_END |
| 478 | |
| 479 | |
| 480 | |
| 416 | 481 | /****************************************************************************** |
| 417 | 482 | |
| 418 | 483 | Game drivers |
| r18350 | r18351 | |
| 420 | 485 | ******************************************************************************/ |
| 421 | 486 | |
| 422 | 487 | GAME( 1998, inufuku, 0, inufuku, inufuku, driver_device, 0, ROT0, "Video System Co.", "Quiz & Variety Sukusuku Inufuku (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) |
| 488 | GAME( 1996, 3on3dunk, 0, _3on3dunk, inufuku, driver_device, 0, ROT0, "Video System Co.", "3 On 3 Dunk Madness (US, prototype?)", GAME_NOT_WORKING ) |