src/mame/video/dec0.c
| r15435 | r15436 | |
| 6 | 6 | |
| 7 | 7 | #include "emu.h" |
| 8 | 8 | #include "includes/dec0.h" |
| 9 | | #include "video/decbac06.h" |
| 10 | | #include "video/decmxc06.h" |
| 11 | 9 | |
| 10 | |
| 12 | 11 | /******************************************************************************/ |
| 13 | 12 | |
| 14 | 13 | WRITE16_MEMBER(dec0_state::dec0_update_sprites_w) |
| r15435 | r15436 | |
| 49 | 48 | { |
| 50 | 49 | dec0_state *state = screen.machine().driver_data<dec0_state>(); |
| 51 | 50 | |
| 52 | | state->flip_screen_set(screen.machine().device<deco_bac06_device>("tilegen1")->get_flip_state()); |
| 51 | state->flip_screen_set(state->m_tilegen1->get_flip_state()); |
| 53 | 52 | |
| 54 | | screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 55 | | screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, 0x08, 0x0f); |
| 56 | | screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 53 | state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 54 | state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, 0x08, 0x0f); |
| 55 | state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 57 | 56 | |
| 58 | 57 | /* HB always keeps pf2 on top of pf3, no need explicitly support priority register */ |
| 59 | 58 | |
| 60 | | screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, 0x00, 0x0f); |
| 61 | | screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 59 | state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, 0x00, 0x0f); |
| 60 | state->m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 62 | 61 | return 0; |
| 63 | 62 | } |
| 64 | 63 | |
| r15435 | r15436 | |
| 67 | 66 | SCREEN_UPDATE_IND16( baddudes ) |
| 68 | 67 | { |
| 69 | 68 | dec0_state *state = screen.machine().driver_data<dec0_state>(); |
| 70 | | state->flip_screen_set(screen.machine().device<deco_bac06_device>("tilegen1")->get_flip_state()); |
| 69 | state->flip_screen_set(state->m_tilegen1->get_flip_state()); |
| 71 | 70 | |
| 72 | 71 | /* WARNING: inverted wrt Midnight Resistance */ |
| 73 | 72 | if ((state->m_pri & 0x01) == 0) |
| 74 | 73 | { |
| 75 | | screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 76 | | screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 74 | state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 75 | state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 77 | 76 | |
| 78 | 77 | if (state->m_pri & 2) |
| 79 | | screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */ |
| 78 | state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */ |
| 80 | 79 | |
| 81 | | screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); |
| 80 | state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); |
| 82 | 81 | |
| 83 | 82 | if (state->m_pri & 4) |
| 84 | | screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */ |
| 83 | state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */ |
| 85 | 84 | } |
| 86 | 85 | else |
| 87 | 86 | { |
| 88 | | screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 89 | | screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 87 | state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 88 | state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 90 | 89 | |
| 91 | 90 | if (state->m_pri & 2) |
| 92 | | screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */ |
| 91 | state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */ |
| 93 | 92 | |
| 94 | | screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); |
| 93 | state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); |
| 95 | 94 | |
| 96 | 95 | if (state->m_pri & 4) |
| 97 | | screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */ |
| 96 | state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */ |
| 98 | 97 | } |
| 99 | 98 | |
| 100 | | screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 99 | state->m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 101 | 100 | return 0; |
| 102 | 101 | } |
| 103 | 102 | |
| r15435 | r15436 | |
| 108 | 107 | dec0_state *state = screen.machine().driver_data<dec0_state>(); |
| 109 | 108 | int trans; |
| 110 | 109 | |
| 111 | | state->flip_screen_set(screen.machine().device<deco_bac06_device>("tilegen1")->get_flip_state()); |
| 110 | state->flip_screen_set(state->m_tilegen1->get_flip_state()); |
| 112 | 111 | |
| 113 | 112 | if (state->m_pri & 0x04) |
| 114 | 113 | trans = 0x08; |
| r15435 | r15436 | |
| 121 | 120 | /* Robocop uses it only for the title screen, so this might be just */ |
| 122 | 121 | /* completely wrong. The top 8 bits of the register might mean */ |
| 123 | 122 | /* something (they are 0x80 in midres, 0x00 here) */ |
| 124 | | screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 123 | state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 125 | 124 | |
| 126 | 125 | if (state->m_pri & 0x02) |
| 127 | | screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f); |
| 126 | state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f); |
| 128 | 127 | |
| 129 | | screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 128 | state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 130 | 129 | } |
| 131 | 130 | else |
| 132 | 131 | { |
| 133 | | screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 132 | state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 134 | 133 | |
| 135 | 134 | if (state->m_pri & 0x02) |
| 136 | | screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f); |
| 135 | state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f); |
| 137 | 136 | |
| 138 | | screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 137 | state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 139 | 138 | } |
| 140 | 139 | |
| 141 | 140 | if (state->m_pri & 0x02) |
| 142 | | screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans^0x08, 0x0f); |
| 141 | state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans^0x08, 0x0f); |
| 143 | 142 | else |
| 144 | | screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); |
| 143 | state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); |
| 145 | 144 | |
| 146 | | screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 145 | state->m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 147 | 146 | return 0; |
| 148 | 147 | } |
| 149 | 148 | |
| 150 | 149 | |
| 151 | 150 | SCREEN_UPDATE_IND16( automat ) |
| 152 | 151 | { |
| 152 | dec0_automat_state *state = screen.machine().driver_data<dec0_automat_state>(); |
| 153 | int trans; |
| 154 | |
| 155 | // layer enables seem different... where are they? |
| 156 | |
| 157 | // the bootleg doesn't write these registers, I think they're hardcoded?, so fake them for compatibility with our implementation.. |
| 158 | deco_bac06_pf_control_0_w(state->m_tilegen1,0,0x0003, 0x00ff); // 8x8 |
| 159 | deco_bac06_pf_control_0_w(state->m_tilegen1,1,0x0003, 0x00ff); |
| 160 | deco_bac06_pf_control_0_w(state->m_tilegen1,2,0x0000, 0x00ff); |
| 161 | deco_bac06_pf_control_0_w(state->m_tilegen1,3,0x0001, 0x00ff); // dimensions |
| 162 | |
| 163 | deco_bac06_pf_control_0_w(state->m_tilegen2,0,0x0082, 0x00ff); // 16x16 |
| 164 | deco_bac06_pf_control_0_w(state->m_tilegen2,1,0x0000, 0x00ff); |
| 165 | deco_bac06_pf_control_0_w(state->m_tilegen2,2,0x0000, 0x00ff); |
| 166 | deco_bac06_pf_control_0_w(state->m_tilegen2,3,0x0001, 0x00ff); // dimensions |
| 167 | |
| 168 | deco_bac06_pf_control_0_w(state->m_tilegen3,0,0x0082, 0x00ff); // 16x16 |
| 169 | deco_bac06_pf_control_0_w(state->m_tilegen3,1,0x0003, 0x00ff); |
| 170 | deco_bac06_pf_control_0_w(state->m_tilegen3,2,0x0000, 0x00ff); |
| 171 | deco_bac06_pf_control_0_w(state->m_tilegen3,3,0x0001, 0x00ff); // dimensions |
| 172 | |
| 173 | // scroll registers got written elsewhere, copy them across |
| 174 | deco_bac06_pf_control_1_w(state->m_tilegen1,0,0x0000, 0xffff); // no scroll? |
| 175 | deco_bac06_pf_control_1_w(state->m_tilegen1,1,0x0000, 0xffff); // no scroll? |
| 176 | |
| 177 | deco_bac06_pf_control_1_w(state->m_tilegen2,0,state->m_automat_scroll_regs[3] - 0x010a, 0xffff); |
| 178 | deco_bac06_pf_control_1_w(state->m_tilegen2,1,state->m_automat_scroll_regs[2], 0xffff); |
| 179 | |
| 180 | deco_bac06_pf_control_1_w(state->m_tilegen3,0,state->m_automat_scroll_regs[1] - 0x0108, 0xffff); |
| 181 | deco_bac06_pf_control_1_w(state->m_tilegen3,1,state->m_automat_scroll_regs[0], 0xffff); |
| 182 | |
| 183 | // sprites seem very different, probably need new functions |
| 184 | |
| 185 | state->flip_screen_set(state->m_tilegen1->get_flip_state()); |
| 186 | |
| 187 | if (state->m_pri & 0x04) |
| 188 | trans = 0x08; |
| 189 | else |
| 190 | trans = 0x00; |
| 191 | |
| 192 | if (state->m_pri & 0x01) |
| 193 | { |
| 194 | state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 195 | |
| 196 | if (state->m_pri & 0x02) |
| 197 | state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f); |
| 198 | |
| 199 | state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 200 | } |
| 201 | else |
| 202 | { |
| 203 | state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 204 | |
| 205 | if (state->m_pri & 0x02) |
| 206 | state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f); |
| 207 | |
| 208 | state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 209 | } |
| 210 | |
| 211 | // if (state->m_pri & 0x02) |
| 212 | // state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans^0x08, 0x0f); |
| 213 | // else |
| 214 | // state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); |
| 215 | |
| 216 | state->m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 153 | 217 | return 0; |
| 154 | 218 | } |
| 155 | 219 | |
| r15435 | r15436 | |
| 159 | 223 | { |
| 160 | 224 | dec0_state *state = screen.machine().driver_data<dec0_state>(); |
| 161 | 225 | |
| 162 | | state->flip_screen_set(screen.machine().device<deco_bac06_device>("tilegen1")->get_flip_state()); |
| 226 | state->flip_screen_set(state->m_tilegen1->get_flip_state()); |
| 163 | 227 | |
| 164 | 228 | /* This game doesn't have the extra playfield chip on the game board, but |
| 165 | 229 | the palette does show through. */ |
| 166 | 230 | bitmap.fill(screen.machine().pens[768], cliprect); |
| 167 | | screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 168 | | screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); |
| 169 | | screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 231 | state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 232 | state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); |
| 233 | state->m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 170 | 234 | return 0; |
| 171 | 235 | } |
| 172 | 236 | |
| r15435 | r15436 | |
| 175 | 239 | SCREEN_UPDATE_IND16( hippodrm ) |
| 176 | 240 | { |
| 177 | 241 | dec0_state *state = screen.machine().driver_data<dec0_state>(); |
| 178 | | state->flip_screen_set(screen.machine().device<deco_bac06_device>("tilegen1")->get_flip_state()); |
| 242 | state->flip_screen_set(state->m_tilegen1->get_flip_state()); |
| 179 | 243 | |
| 180 | 244 | if (state->m_pri & 0x01) |
| 181 | 245 | { |
| 182 | | screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 183 | | screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 246 | state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 247 | state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 184 | 248 | } |
| 185 | 249 | else |
| 186 | 250 | { |
| 187 | | screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 188 | | screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 251 | state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 252 | state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 189 | 253 | } |
| 190 | 254 | |
| 191 | | screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); |
| 192 | | screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 255 | state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); |
| 256 | state->m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 193 | 257 | return 0; |
| 194 | 258 | } |
| 195 | 259 | |
| r15435 | r15436 | |
| 198 | 262 | SCREEN_UPDATE_IND16( slyspy ) |
| 199 | 263 | { |
| 200 | 264 | dec0_state *state = screen.machine().driver_data<dec0_state>(); |
| 201 | | state->flip_screen_set(screen.machine().device<deco_bac06_device>("tilegen1")->get_flip_state()); |
| 265 | state->flip_screen_set(state->m_tilegen1->get_flip_state()); |
| 202 | 266 | |
| 203 | | screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 204 | | screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 267 | state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 268 | state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 205 | 269 | |
| 206 | | screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); |
| 270 | state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); |
| 207 | 271 | |
| 208 | 272 | /* Redraw top 8 pens of top 8 palettes over sprites */ |
| 209 | 273 | if (state->m_pri&0x80) |
| 210 | | screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles |
| 274 | state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles |
| 211 | 275 | |
| 212 | | screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 276 | state->m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 213 | 277 | return 0; |
| 214 | 278 | } |
| 215 | 279 | |
| r15435 | r15436 | |
| 220 | 284 | dec0_state *state = screen.machine().driver_data<dec0_state>(); |
| 221 | 285 | int trans; |
| 222 | 286 | |
| 223 | | state->flip_screen_set(screen.machine().device<deco_bac06_device>("tilegen1")->get_flip_state()); |
| 287 | state->flip_screen_set(state->m_tilegen1->get_flip_state()); |
| 224 | 288 | |
| 225 | 289 | if (state->m_pri & 0x04) |
| 226 | 290 | trans = 0x00; |
| r15435 | r15436 | |
| 228 | 292 | |
| 229 | 293 | if (state->m_pri & 0x01) |
| 230 | 294 | { |
| 231 | | screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 295 | state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 232 | 296 | |
| 233 | 297 | if (state->m_pri & 0x02) |
| 234 | | screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f); |
| 298 | state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f); |
| 235 | 299 | |
| 236 | | screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 300 | state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 237 | 301 | } |
| 238 | 302 | else |
| 239 | 303 | { |
| 240 | | screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 304 | state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); |
| 241 | 305 | |
| 242 | 306 | if (state->m_pri & 0x02) |
| 243 | | screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f); |
| 307 | state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f); |
| 244 | 308 | |
| 245 | | screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 309 | state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 246 | 310 | } |
| 247 | 311 | |
| 248 | 312 | if (state->m_pri & 0x02) |
| 249 | | screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans ^ 0x08, 0x0f); |
| 313 | state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans ^ 0x08, 0x0f); |
| 250 | 314 | else |
| 251 | | screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); |
| 315 | state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); |
| 252 | 316 | |
| 253 | | screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 317 | state->m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 254 | 318 | return 0; |
| 255 | 319 | } |
| 256 | 320 | |
src/mame/drivers/model2.c
| r15435 | r15436 | |
| 4117 | 4117 | ROM_LOAD("mpr-20253.35", 0x0600000, 0x200000, CRC(ca6aa17c) SHA1(f6df2483ca75573449ba36638dbbed4be7843a44) ) |
| 4118 | 4118 | ROM_END |
| 4119 | 4119 | |
| 4120 | | /* Over Rev: There is known to be an undumped Model 2B version with EPR-19992B & EPR-19993B program roms */ |
| 4121 | 4120 | ROM_START( overrev ) /* Over Rev Revision A, Model 2C */ |
| 4122 | 4121 | ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program |
| 4123 | 4122 | ROM_LOAD32_WORD( "epr-20124a.15", 0x000000, 0x080000, CRC(74beb8d7) SHA1(c65c641138ecd7312c4930702d1498b8a346175a) ) |
| r15435 | r15436 | |
| 4147 | 4146 | ROM_LOAD( "mpr-20004.34", 0x400000, 0x400000, CRC(0b9c5410) SHA1(e5bb30702fc853ccc03316be07a334269d3ebb4a) ) |
| 4148 | 4147 | ROM_END |
| 4149 | 4148 | |
| 4149 | ROM_START( overrevb ) /* Over Rev Revision B, Model 2B, rom board stickered as 836-13275 */ |
| 4150 | ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program |
| 4151 | ROM_LOAD32_WORD( "epr-19992b.15", 0x000000, 0x080000, CRC(6d3e78d5) SHA1(40d18ee284ea2e038f7e3d04db56e793ab3e3dd5) ) /* sum16 492A printed on label */ |
| 4152 | ROM_LOAD32_WORD( "epr-19993b.16", 0x000002, 0x080000, CRC(765dc9ce) SHA1(a718c32ca27ec1fb5ed2d7d3797ea7e906510a04) ) /* sum16 B955 printed on label */ |
| 4153 | |
| 4154 | ROM_REGION32_LE( 0x2000000, "user1", 0 ) // Data |
| 4155 | ROM_LOAD32_WORD( "mpr-19996.11", 0x000000, 0x400000, CRC(21928a00) SHA1(6b439fd2b113b64df9378ef8180a17aa6fa975c5) ) |
| 4156 | ROM_LOAD32_WORD( "mpr-19997.12", 0x000002, 0x400000, CRC(2a169cab) SHA1(dbf9af938afd0599d345c42c1df242e575c14de9) ) |
| 4157 | ROM_LOAD32_WORD( "mpr-19994.9", 0x800000, 0x400000, CRC(e691fbd5) SHA1(b99c2f3f2a682966d792917dfcb8ed8e53bc0b7a) ) |
| 4158 | ROM_LOAD32_WORD( "mpr-19995.10", 0x800002, 0x400000, CRC(82a7828e) SHA1(4336a12a07a67f94091b4a9b491bab02c375dd15) ) |
| 4159 | |
| 4160 | ROM_REGION( 0x800000, "cpu2", ROMREGION_ERASE00 ) // TGPx4 program (COPRO sockets) |
| 4161 | |
| 4162 | ROM_REGION( 0x800000, "user2", 0 ) // Models (TGP sockets) |
| 4163 | ROM_LOAD32_WORD( "mpr-19998.17", 0x000000, 0x200000, CRC(6a834574) SHA1(8be19bf42dbb157d6acde62a2018ef4c0d41aab4) ) |
| 4164 | ROM_LOAD32_WORD( "mpr-19999.21", 0x000002, 0x200000, CRC(ff590a2d) SHA1(ad29e4270b4a2f82189fbab83358eb1200f43777) ) |
| 4165 | |
| 4166 | ROM_REGION( 0x400000, "user3", 0 ) // Textures (TEXTURE sockets) |
| 4167 | ROM_LOAD32_WORD( "mpr-20001.27", 0x000000, 0x200000, CRC(6ca236aa) SHA1(b3cb89fadb42afed13be4f229d7158dee487978a) ) |
| 4168 | ROM_LOAD32_WORD( "mpr-20000.25", 0x000002, 0x200000, CRC(894d8ded) SHA1(9bf7c754a29eef47fa49b5567980601895127306) ) |
| 4169 | |
| 4170 | ROM_REGION( 0x100000, "audiocpu", 0 ) // Sound program |
| 4171 | ROM_LOAD16_WORD_SWAP( "epr-20002.31", 0x000000, 0x080000, CRC(7efb069e) SHA1(30b1bbaf348d6a6b9ee2fdf82a0749baa025e0bf) ) |
| 4172 | |
| 4173 | ROM_REGION( 0x800000, "scsp", 0 ) // Samples |
| 4174 | ROM_LOAD( "mpr-20003.32", 0x000000, 0x400000, CRC(149ac22b) SHA1(c890bbaebbbb07b62bcb8a3a8edded9fa0ec9a1e) ) |
| 4175 | ROM_LOAD( "mpr-20004.34", 0x400000, 0x400000, CRC(0b9c5410) SHA1(e5bb30702fc853ccc03316be07a334269d3ebb4a) ) |
| 4176 | ROM_END |
| 4177 | |
| 4150 | 4178 | ROM_START( topskatr ) /* Top Skater Revision A (Export), Model 2C */ |
| 4151 | 4179 | ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program |
| 4152 | 4180 | ROM_LOAD32_WORD("epr-19755a.15", 0x000000, 0x080000, CRC(b80633b9) SHA1(5396da414beeb918e6f38f25a43dd76345a0c8ed) ) |
| r15435 | r15436 | |
| 5267 | 5295 | GAME( 1996, lastbrnxu,lastbrnx, model2b, model2, 0, ROT0, "Sega", "Last Bronx (USA, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5268 | 5296 | GAME( 1996, lastbrnxj,lastbrnx, model2b, model2, 0, ROT0, "Sega", "Last Bronx (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5269 | 5297 | GAME( 1996, doa, 0, model2b, model2, doa, ROT0, "Sega", "Dead or Alive (Model 2B, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5270 | | GAME( 1996, sgt24h, 0, model2b, srallyc, sgt24h, ROT0, "Jaleco", "Super GT 24h", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5298 | GAME( 1996, sgt24h, 0, model2b, srallyc,sgt24h, ROT0, "Jaleco", "Super GT 24h", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5271 | 5299 | GAME( 1996, von, 0, model2b, model2, 0, ROT0, "Sega", "Cyber Troopers Virtual-On (USA, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5272 | 5300 | GAME( 1996, vonj, von, model2b, model2, 0, ROT0, "Sega", "Cyber Troopers Virtual-On (Japan, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5273 | 5301 | GAME( 1996, dynabb, 0, model2b, model2, 0, ROT0, "Sega", "Dynamite Baseball", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5274 | 5302 | GAME( 1997, dynabb97, 0, model2b, model2, 0, ROT0, "Sega", "Dynamite Baseball 97 (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5303 | GAME( 1997, overrevb, overrev, model2b, srallyc,overrev, ROT0, "Jaleco", "Over Rev (Model 2B, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5275 | 5304 | GAME( 1997, zerogun, 0, model2b, model2, zerogun, ROT0, "Psikyo", "Zero Gunner (Export, Model 2B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5276 | 5305 | GAME( 1997, zerogunj, zerogun, model2b, model2, zerogun, ROT0, "Psikyo", "Zero Gunner (Japan, Model 2B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5277 | 5306 | GAME( 1998, dynamcopb,dynamcop, model2b, model2, genprot, ROT0, "Sega", "Dynamite Cop (Export, Model 2B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| r15435 | r15436 | |
| 5280 | 5309 | GAME( 1995, rchase2, 0, model2b, rchase2,rchase2, ROT0, "Sega", "Rail Chase 2 (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5281 | 5310 | |
| 5282 | 5311 | // Model 2C-CRX (TGPx4, SCSP sound board) |
| 5283 | | GAME( 1996, skisuprg, 0, model2c, model2, 0, ROT0, "Sega", "Sega Ski Super G", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5284 | | GAME( 1996, stcc, 0, model2c, model2, 0, ROT0, "Sega", "Sega Touring Car Championship", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5285 | | GAME( 1996, stcca, stcc, model2c, model2, 0, ROT0, "Sega", "Sega Touring Car Championship (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5286 | | GAME( 1996, stccb, stcc, model2c, model2, 0, ROT0, "Sega", "Sega Touring Car Championship (Unknown Revision)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5287 | | GAME( 1996, waverunr, 0, model2c, model2, 0, ROT0, "Sega", "Wave Runner (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5288 | | GAME( 1997, hotd, 0, model2c, model2, 0, ROT0, "Sega", "House of the Dead", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5289 | | GAME( 1997, overrev, 0, model2c, srallyc, overrev, ROT0, "Jaleco", "Over Rev (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5290 | | GAME( 1997, segawski, 0, model2c, model2, 0, ROT0, "Sega", "Sega Water Ski (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5291 | | GAME( 1997, topskatr, 0, model2c, model2, 0, ROT0, "Sega", "Top Skater (Export, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5292 | | GAME( 1997, topskatru,topskatr, model2c, model2, 0, ROT0, "Sega", "Top Skater (USA, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5293 | | GAME( 1997, topskatrj,topskatr, model2c, model2, 0, ROT0, "Sega", "Top Skater (Japan)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5294 | | GAME( 1998, bel, 0, model2c, bel, 0, ROT0, "Sega / EPL Productions", "Behind Enemy Lines", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5295 | | GAME( 1998, dynamcopc,dynamcop, model2c, model2, 0, ROT0, "Sega", "Dynamite Cop (USA, Model 2C)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5312 | GAME( 1996, skisuprg, 0, model2c, model2, 0, ROT0, "Sega", "Sega Ski Super G", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5313 | GAME( 1996, stcc, 0, model2c, model2, 0, ROT0, "Sega", "Sega Touring Car Championship", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5314 | GAME( 1996, stcca, stcc, model2c, model2, 0, ROT0, "Sega", "Sega Touring Car Championship (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5315 | GAME( 1996, stccb, stcc, model2c, model2, 0, ROT0, "Sega", "Sega Touring Car Championship (Unknown Revision)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5316 | GAME( 1996, waverunr, 0, model2c, model2, 0, ROT0, "Sega", "Wave Runner (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5317 | GAME( 1997, hotd, 0, model2c, model2, 0, ROT0, "Sega", "House of the Dead", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5318 | GAME( 1997, overrev, 0, model2c, srallyc,overrev, ROT0, "Jaleco", "Over Rev (Model, 2C Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5319 | GAME( 1997, segawski, 0, model2c, model2, 0, ROT0, "Sega", "Sega Water Ski (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5320 | GAME( 1997, topskatr, 0, model2c, model2, 0, ROT0, "Sega", "Top Skater (Export, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5321 | GAME( 1997, topskatru,topskatr, model2c, model2, 0, ROT0, "Sega", "Top Skater (USA, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5322 | GAME( 1997, topskatrj,topskatr, model2c, model2, 0, ROT0, "Sega", "Top Skater (Japan)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5323 | GAME( 1998, bel, 0, model2c, bel, 0, ROT0, "Sega / EPL Productions", "Behind Enemy Lines", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5324 | GAME( 1998, dynamcopc,dynamcop, model2c, model2, 0, ROT0, "Sega", "Dynamite Cop (USA, Model 2C)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5296 | 5325 | |
src/mame/drivers/naomi.c
| r15435 | r15436 | |
| 21 | 21 | |
| 22 | 22 | TODO (general): |
| 23 | 23 | - all games that uses YUV just updates one frame then dies, why? |
| 24 | | - SH to ARM sound streaming doesn't work (used by ADX compression system) |
| 24 | - Some SH to ARM sound streaming doesn't work (used by ADX compression system) |
| 25 | 25 | - ngdup23a, ngdup23c: missing DIMM emulation, hence they can't possibly work, emulate the DIMM means to add an extra SH-4 ... |
| 26 | | |
| 27 | | - Following games doesn't boot, any attempt makes it to return to the system test mode (almost likely to be JVS related): |
| 28 | | * Death Crimson OX |
| 29 | | * La Keyboard |
| 30 | | * Lupin the Third |
| 31 | | * Moeru Casinyo |
| 32 | | * Puyo Puyo DA! |
| 33 | | * Puyo Puyo Fever |
| 34 | | * Samba de Amigo |
| 35 | | * Samba de Amigo Ver. 2000 |
| 36 | | * Shootout Pool |
| 26 | - games using "m4" decryption have never successfully worked, may be |
| 27 | an issue there. |
| 28 | |
| 29 | - Following games doesn't boot, any attempt makes it to return to the system test mode (note these are also "m4" type games) |
| 30 | * Illvelo |
| 31 | * Akatsuki Blitzkampf Ausf Achse |
| 32 | |
| 33 | - Doesn't boot |
| 34 | * Shootout Pool (all 3 Shootout Pool games show an animated loading screen and then lock up) |
| 37 | 35 | * Shootout Pool Medal |
| 38 | 36 | * Shootout Pool Prize |
| 37 | |
| 38 | - Boots and accepts coin, but won't accept start button |
| 39 | 39 | * Usagi Yamashiro Hen |
| 40 | | * Virtual On |
| 41 | | * WWF Royal Rumble |
| 42 | | |
| 40 | |
| 43 | 41 | - missing inputs (needs rotary channels): |
| 44 | 42 | * Crakin' DJ |
| 45 | 43 | * Dynamic Golf |
| r15435 | r15436 | |
| 51 | 49 | * Sega Marine Fishing |
| 52 | 50 | * Wave Runner GP |
| 53 | 51 | |
| 54 | | - doesn't boot consistently (JVS checksum error?): |
| 55 | | * Cannon Spike; |
| 56 | | * Heavy Metal GeoMatrix; |
| 57 | | * Moeru Justice Gakuen; |
| 58 | | * Power Stone 2; |
| 59 | | * Spawn; |
| 60 | | |
| 52 | - "com error occured between Naomi BD and I/O BD" |
| 53 | * Samba de Amigo |
| 54 | * Samba de Amigo Ver. 2000 |
| 55 | |
| 56 | - other issues: |
| 57 | * Death Crimson OX (boots now, but dies in YUV-mode movie; coining up before it appears to freeze the game) |
| 58 | * La Keyboard (boots fine & attract mode looks OK, but no keyboard) |
| 59 | |
| 61 | 60 | TODO (game-specific): |
| 62 | 61 | - 18th Wheeler Deluxe: "MOTOR NETWORK ERR IN 01 OUT FF" msg pops up during gameplay; |
| 63 | 62 | - Airline Pilots Deluxe: returns error 03 |
| r15435 | r15436 | |
| 1850 | 1849 | INPUT_PORTS_END |
| 1851 | 1850 | |
| 1852 | 1851 | static INPUT_PORTS_START( naomi_mie ) |
| 1853 | | PORT_START("MIE:3") |
| 1852 | PORT_START("MIE.3") |
| 1854 | 1853 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("mie_eeprom", eeprom_device, write_bit) |
| 1855 | 1854 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("mie_eeprom", eeprom_device, set_cs_line) |
| 1856 | 1855 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("mie_eeprom", eeprom_device, set_clock_line) |
| 1857 | 1856 | |
| 1858 | | PORT_START("MIE:5") |
| 1857 | PORT_START("MIE.5") |
| 1859 | 1858 | PORT_DIPNAME( 0x01, 0x00, "Monitor" ) PORT_DIPLOCATION("SW1:1") |
| 1860 | 1859 | PORT_DIPSETTING( 0x01, "31 kHz" ) |
| 1861 | 1860 | PORT_DIPSETTING( 0x00, "15 kHz" ) |
| r15435 | r15436 | |
| 2409 | 2408 | |
| 2410 | 2409 | // 2 joysticks variant |
| 2411 | 2410 | static INPUT_PORTS_START( aw2c ) |
| 2412 | | PORT_START("P1:0") |
| 2411 | PORT_START("P1.0") |
| 2413 | 2412 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) |
| 2414 | 2413 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| 2415 | 2414 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| r15435 | r15436 | |
| 2418 | 2417 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 2419 | 2418 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 2420 | 2419 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) |
| 2421 | | PORT_START("P1:1") |
| 2420 | PORT_START("P1.1") |
| 2422 | 2421 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2423 | 2422 | PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW ) |
| 2424 | 2423 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| r15435 | r15436 | |
| 2428 | 2427 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) |
| 2429 | 2428 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) |
| 2430 | 2429 | |
| 2431 | | PORT_START("P2:0") |
| 2430 | PORT_START("P2.0") |
| 2432 | 2431 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 2433 | 2432 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 2434 | 2433 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| r15435 | r15436 | |
| 2437 | 2436 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 2438 | 2437 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 2439 | 2438 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 2440 | | PORT_START("P2:1") |
| 2439 | PORT_START("P2.1") |
| 2441 | 2440 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2442 | 2441 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2443 | 2442 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 ) |
| r15435 | r15436 | |
| 2456 | 2455 | |
| 2457 | 2456 | // Single-player wheel variant |
| 2458 | 2457 | static INPUT_PORTS_START( aw1w ) |
| 2459 | | PORT_START("P1:0") |
| 2458 | PORT_START("P1.0") |
| 2460 | 2459 | PORT_BIT( 0xf1, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 2461 | 2460 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) |
| 2462 | 2461 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 2463 | 2462 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 2464 | 2463 | |
| 2465 | | PORT_START("P1:1") |
| 2464 | PORT_START("P1.1") |
| 2466 | 2465 | PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW ) |
| 2467 | 2466 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 2468 | 2467 | PORT_BIT( 0x9f, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 2469 | 2468 | |
| 2470 | | PORT_START("P2:A0") /* steering */ |
| 2469 | PORT_START("P2.A0") /* steering */ |
| 2471 | 2470 | PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) |
| 2472 | 2471 | |
| 2473 | | PORT_START("P2:A1") /* gas pedal */ |
| 2472 | PORT_START("P2.A1") /* gas pedal */ |
| 2474 | 2473 | PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) |
| 2475 | 2474 | |
| 2476 | | PORT_START("P2:A2") /* brake */ |
| 2475 | PORT_START("P2.A2") /* brake */ |
| 2477 | 2476 | PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(100) PORT_KEYDELTA(40) |
| 2478 | 2477 | |
| 2479 | | PORT_START("P2:A3") /* steering */ |
| 2478 | PORT_START("P2.A3") /* steering */ |
| 2480 | 2479 | PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) |
| 2481 | 2480 | |
| 2482 | | PORT_START("P2:A4") /* gas pedal */ |
| 2481 | PORT_START("P2.A4") /* gas pedal */ |
| 2483 | 2482 | PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) |
| 2484 | 2483 | |
| 2485 | | PORT_START("P2:A5") /* brake */ |
| 2484 | PORT_START("P2.A5") /* brake */ |
| 2486 | 2485 | PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(100) PORT_KEYDELTA(40) |
| 2487 | 2486 | |
| 2488 | 2487 | PORT_START("COINS") |
| r15435 | r15436 | |
| 2542 | 2541 | MACHINE_CONFIG_END |
| 2543 | 2542 | |
| 2544 | 2543 | static MACHINE_CONFIG_DERIVED( naomi_base, naomi_aw_base ) |
| 2545 | | MCFG_MIE_ADD("mie", 4000000, "maple_dc", 0, 0, 0, 0, "MIE:3", 0, "MIE:5", 0, 0) // Actual frequency unknown |
| 2546 | | MCFG_SEGA_837_13551_DEVICE_ADD("837_13551", "mie", "TILT", "P1", "P2", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "OUTPUT") |
| 2544 | MCFG_MIE_ADD("mie", 4000000, "maple_dc", 0, 0, 0, 0, ":MIE.3", 0, ":MIE.5", 0, 0) // Actual frequency unknown |
| 2545 | MCFG_SEGA_837_13551_DEVICE_ADD("837_13551", "mie", ":TILT", ":P1", ":P2", ":A0", ":A1", ":A2", ":A3", ":A4", ":A5", ":A6", ":A7", ":OUTPUT") |
| 2547 | 2546 | MCFG_EEPROM_93C46_8BIT_ADD("mie_eeprom") |
| 2548 | 2547 | |
| 2549 | 2548 | MCFG_X76F100_ADD("naomibd_eeprom") |
| r15435 | r15436 | |
| 2637 | 2636 | MACHINE_CONFIG_END |
| 2638 | 2637 | |
| 2639 | 2638 | static MACHINE_CONFIG_DERIVED( aw1c, aw_base ) |
| 2640 | | MCFG_DC_CONTROLLER_ADD("dcctrl0", "maple_dc", 0, "P1:0", "P1:1", "P1:A0", "P1:A1", "P1:A2", "P1:A3", "P1:A4", "P1:A5") |
| 2641 | | MCFG_DC_CONTROLLER_ADD("dcctrl1", "maple_dc", 1, "P2:0", "P2:1", "P2:A0", "P2:A1", "P2:A2", "P2:A3", "P2:A4", "P2:A5") |
| 2639 | MCFG_DC_CONTROLLER_ADD("dcctrl0", "maple_dc", 0, ":P1.0", ":P1.1", ":P1.A0", ":P1.A1", ":P1.A2", ":P1.A3", ":P1.A4", ":P1.A5") |
| 2640 | MCFG_DC_CONTROLLER_ADD("dcctrl1", "maple_dc", 1, ":P2.0", ":P2.1", ":P2.A0", ":P2.A1", ":P2.A2", ":P2.A3", ":P2.A4", ":P2.A5") |
| 2642 | 2641 | MACHINE_CONFIG_END |
| 2643 | 2642 | |
| 2644 | 2643 | static MACHINE_CONFIG_DERIVED( aw2c, aw_base ) |
| 2645 | | MCFG_DC_CONTROLLER_ADD("dcctrl0", "maple_dc", 0, "P1:0", "P1:1", "P1:A0", "P1:A1", "P1:A2", "P1:A3", "P1:A4", "P1:A5") |
| 2646 | | MCFG_DC_CONTROLLER_ADD("dcctrl1", "maple_dc", 1, "P2:0", "P2:1", "P2:A0", "P2:A1", "P2:A2", "P2:A3", "P2:A4", "P2:A5") |
| 2644 | MCFG_DC_CONTROLLER_ADD("dcctrl0", "maple_dc", 0, ":P1.0", ":P1.1", ":P1.A0", ":P1.A1", ":P1.A2", ":P1.A3", ":P1.A4", ":P1.A5") |
| 2645 | MCFG_DC_CONTROLLER_ADD("dcctrl1", "maple_dc", 1, ":P2.0", ":P2.1", ":P2.A0", ":P2.A1", ":P2.A2", ":P2.A3", ":P2.A4", ":P2.A5") |
| 2647 | 2646 | MACHINE_CONFIG_END |
| 2648 | 2647 | |
| 2649 | 2648 | #define ROM_LOAD16_WORD_SWAP_BIOS(bios,name,offset,length,hash) \ |
src/mame/drivers/deshoros.c
| r15435 | r15436 | |
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | | Destiny Horoscope (c) 1983 Data East Corporation |
| 3 | Destiny (c) 1983 Data East Corporation |
| 4 | 4 | |
| 5 | 5 | driver by Angelo Salese |
| 6 | 6 | |
| 7 | 7 | A fortune-teller machine with 24 characters LED-array and a printer. |
| 8 | M6809 CPU, 2KB RAM |
| 8 | 9 | |
| 10 | Rough cpanel sketch: |
| 11 | |
| 12 | [LED-array dispay] CLEAR ENTER |
| 13 | 7 8 9 0 |
| 14 | 4 5 6 F |
| 15 | 1 2 3 M |
| 16 | |
| 17 | To control system buttons (SYSTEM, lower nibble), hold one down and then |
| 18 | push the main service button F2. |
| 19 | |
| 20 | |
| 9 | 21 | TODO: |
| 10 | | -Emulate the graphics with genuine artwork display; |
| 11 | | -Printer emulation; |
| 22 | - Emulate the graphics with genuine artwork display; |
| 23 | - Printer emulation; |
| 24 | - Exact sound & irq frequency; |
| 12 | 25 | |
| 13 | 26 | ***************************************************************************/ |
| 14 | 27 | |
| 15 | 28 | #include "emu.h" |
| 16 | 29 | #include "cpu/m6809/m6809.h" |
| 30 | #include "sound/beep.h" |
| 17 | 31 | |
| 18 | | |
| 19 | | class deshoros_state : public driver_device |
| 32 | class destiny_state : public driver_device |
| 20 | 33 | { |
| 21 | 34 | public: |
| 22 | | deshoros_state(const machine_config &mconfig, device_type type, const char *tag) |
| 23 | | : driver_device(mconfig, type, tag) , |
| 24 | | m_io_ram(*this, "io_ram"){ } |
| 35 | destiny_state(const machine_config &mconfig, device_type type, const char *tag) |
| 36 | : driver_device(mconfig, type, tag), |
| 37 | m_maincpu(*this, "maincpu") |
| 38 | { } |
| 25 | 39 | |
| 26 | | required_shared_ptr<UINT8> m_io_ram; |
| 40 | required_device<cpu_device> m_maincpu; |
| 41 | |
| 27 | 42 | char m_led_array[21]; |
| 28 | | UINT8 m_bank; |
| 29 | | DECLARE_READ8_MEMBER(io_r); |
| 30 | | DECLARE_WRITE8_MEMBER(io_w); |
| 31 | | void update_led_array(UINT8 new_data); |
| 43 | |
| 44 | DECLARE_WRITE8_MEMBER(firq_ack_w); |
| 45 | DECLARE_WRITE8_MEMBER(nmi_ack_w); |
| 46 | DECLARE_READ8_MEMBER(printer_status_r); |
| 47 | DECLARE_READ8_MEMBER(display_ready_r); |
| 48 | DECLARE_WRITE8_MEMBER(display_w); |
| 49 | DECLARE_WRITE8_MEMBER(out_w); |
| 50 | DECLARE_WRITE8_MEMBER(bank_select_w); |
| 51 | DECLARE_WRITE8_MEMBER(sound_on_w); |
| 52 | DECLARE_WRITE8_MEMBER(sound_off_w); |
| 53 | |
| 54 | DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); |
| 55 | |
| 56 | protected: |
| 57 | // driver_device overrides |
| 58 | virtual void machine_start(); |
| 59 | virtual void machine_reset(); |
| 32 | 60 | }; |
| 33 | 61 | |
| 34 | 62 | |
| 35 | 63 | /*Temporary,to show something on screen...*/ |
| 36 | 64 | |
| 37 | | static VIDEO_START( deshoros ) |
| 65 | static VIDEO_START( destiny ) |
| 38 | 66 | { |
| 39 | | deshoros_state *state = machine.driver_data<deshoros_state>(); |
| 67 | destiny_state *state = machine.driver_data<destiny_state>(); |
| 40 | 68 | UINT8 i; |
| 41 | 69 | for(i=0;i<20;i++) |
| 42 | 70 | state->m_led_array[i] = 0x20; |
| 43 | 71 | state->m_led_array[20] = 0; |
| 44 | 72 | } |
| 45 | 73 | |
| 46 | | static SCREEN_UPDATE_IND16( deshoros ) |
| 74 | static SCREEN_UPDATE_IND16( destiny ) |
| 47 | 75 | { |
| 48 | | deshoros_state *state = screen.machine().driver_data<deshoros_state>(); |
| 76 | destiny_state *state = screen.machine().driver_data<destiny_state>(); |
| 49 | 77 | popmessage("%s",state->m_led_array); |
| 50 | 78 | return 0; |
| 51 | 79 | } |
| 52 | 80 | |
| 53 | | /*I don't know it this is 100% correct,might be different...*/ |
| 54 | | void deshoros_state::update_led_array(UINT8 new_data) |
| 81 | |
| 82 | |
| 83 | /*************************************************************************** |
| 84 | |
| 85 | I/O |
| 86 | |
| 87 | ***************************************************************************/ |
| 88 | |
| 89 | WRITE8_MEMBER(destiny_state::firq_ack_w) |
| 55 | 90 | { |
| 56 | | UINT8 i; |
| 57 | | /*scroll the data*/ |
| 58 | | for(i=0;i<19;i++) |
| 59 | | m_led_array[i] = m_led_array[i+1]; |
| 60 | | /*update the data*/ |
| 61 | | m_led_array[19] = new_data; |
| 91 | device_set_input_line(m_maincpu, M6809_FIRQ_LINE, CLEAR_LINE); |
| 62 | 92 | } |
| 63 | 93 | |
| 94 | WRITE8_MEMBER(destiny_state::nmi_ack_w) |
| 95 | { |
| 96 | device_set_input_line(m_maincpu, INPUT_LINE_NMI, CLEAR_LINE); |
| 97 | } |
| 64 | 98 | |
| 65 | | static void answer_bankswitch(running_machine &machine,UINT8 new_bank) |
| 99 | READ8_MEMBER(destiny_state::printer_status_r) |
| 66 | 100 | { |
| 67 | | deshoros_state *state = machine.driver_data<deshoros_state>(); |
| 68 | | if(state->m_bank!=new_bank) |
| 69 | | { |
| 70 | | UINT8 *ROM = state->memregion("data")->base(); |
| 71 | | UINT32 bankaddress; |
| 101 | // d2: mark sensor |
| 102 | // d3: motor stop |
| 103 | // d4: status |
| 104 | // d5: /L-SW |
| 105 | // d6: paper |
| 106 | // d7: /R-SW |
| 107 | return 0xff; |
| 108 | } |
| 72 | 109 | |
| 73 | | state->m_bank = new_bank; |
| 74 | | bankaddress = 0 + 0x6000 * state->m_bank; |
| 75 | | state->membank("bank1")->set_base(&ROM[bankaddress]); |
| 76 | | } |
| 110 | READ8_MEMBER(destiny_state::display_ready_r) |
| 111 | { |
| 112 | // d7: /display ready |
| 113 | // other bits: N/C |
| 114 | return 0; |
| 77 | 115 | } |
| 78 | 116 | |
| 79 | | READ8_MEMBER(deshoros_state::io_r) |
| 117 | WRITE8_MEMBER(destiny_state::display_w) |
| 80 | 118 | { |
| 81 | | switch(offset) |
| 82 | | { |
| 83 | | case 0x00: return 0xff; //printer read |
| 84 | | case 0x03: return ioport("KEY0" )->read(); |
| 85 | | case 0x04: return ioport("KEY1" )->read(); |
| 86 | | case 0x05: return ioport("SYSTEM" )->read(); |
| 87 | | case 0x0a: return m_io_ram[offset]; //"buzzer" 0 read |
| 88 | | case 0x0b: return m_io_ram[offset]; //"buzzer" 1 read |
| 89 | | } |
| 90 | | // printf("R -> [%02x]\n",offset); |
| 119 | /* this is preliminary, just fills a string and doesn't support control codes etc. */ |
| 91 | 120 | |
| 92 | | return m_io_ram[offset]; |
| 121 | // scroll the data |
| 122 | for (int i = 0; i < 19; i++) |
| 123 | m_led_array[i] = m_led_array[i+1]; |
| 124 | |
| 125 | // update |
| 126 | m_led_array[19] = data; |
| 93 | 127 | } |
| 94 | 128 | |
| 95 | | WRITE8_MEMBER(deshoros_state::io_w) |
| 129 | WRITE8_MEMBER(destiny_state::out_w) |
| 96 | 130 | { |
| 97 | | switch(offset) |
| 98 | | { |
| 99 | | case 0x00: /*Printer data*/ return; |
| 100 | | case 0x02: update_led_array(data); return; |
| 101 | | case 0x05: coin_lockout_w(machine(), 0,m_io_ram[offset] & 1);return; |
| 102 | | case 0x06: /*Printer IRQ enable*/ return; |
| 103 | | // case 0x0a: "buzzer" 0 write |
| 104 | | // case 0x0b: "buzzer" 1 write |
| 105 | | case 0x0c: answer_bankswitch(machine(),data&0x03); return; //data & 0x10 enabled too,dunno if it is worth to shift the data... |
| 106 | | } |
| 107 | | m_io_ram[offset] = data; |
| 108 | | // printf("%02x -> [%02x]\n",data,offset); |
| 131 | // d0: coin blocker |
| 132 | coin_lockout_w(machine(), 0, ~data & 1); |
| 133 | |
| 134 | // d1: paper cutter 1 |
| 135 | // d2: paper cutter 2 |
| 136 | // other bits: N/C? |
| 109 | 137 | } |
| 110 | 138 | |
| 111 | | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, deshoros_state ) |
| 139 | WRITE8_MEMBER(destiny_state::bank_select_w) |
| 140 | { |
| 141 | // d0-d2 and d4: bank (but only up to 4 banks supported) |
| 142 | membank("bank1")->set_base(memregion("answers")->base() + 0x6000 * (data & 3)); |
| 143 | } |
| 144 | |
| 145 | INPUT_CHANGED_MEMBER(destiny_state::coin_inserted) |
| 146 | { |
| 147 | // NMI on Coin SW or Service SW |
| 148 | if (oldval) |
| 149 | device_set_input_line(m_maincpu, INPUT_LINE_NMI, ASSERT_LINE); |
| 150 | |
| 151 | // coincounter on coin insert |
| 152 | if (((int)(FPTR)param) == 0) |
| 153 | coin_counter_w(machine(), 0, newval); |
| 154 | } |
| 155 | |
| 156 | WRITE8_MEMBER(destiny_state::sound_on_w) |
| 157 | { |
| 158 | beep_set_state(machine().device(BEEPER_TAG),1); |
| 159 | } |
| 160 | |
| 161 | WRITE8_MEMBER(destiny_state::sound_off_w) |
| 162 | { |
| 163 | beep_set_state(machine().device(BEEPER_TAG),0); |
| 164 | } |
| 165 | |
| 166 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, destiny_state ) |
| 112 | 167 | AM_RANGE(0x0000, 0x5fff) AM_ROMBANK("bank1") |
| 113 | 168 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 114 | | AM_RANGE(0x9000, 0x900f) AM_READWRITE(io_r,io_w) AM_SHARE("io_ram") //i/o area |
| 169 | AM_RANGE(0x9000, 0x9000) AM_READWRITE(printer_status_r, firq_ack_w) |
| 170 | AM_RANGE(0x9001, 0x9001) AM_READ_PORT("SYSTEM") AM_WRITE(nmi_ack_w) |
| 171 | AM_RANGE(0x9002, 0x9002) AM_READWRITE(display_ready_r, display_w) |
| 172 | AM_RANGE(0x9003, 0x9003) AM_READ_PORT("KEY1") |
| 173 | AM_RANGE(0x9004, 0x9004) AM_READ_PORT("KEY2") |
| 174 | AM_RANGE(0x9005, 0x9005) AM_READ_PORT("DIPSW") AM_WRITE(out_w) |
| 175 | // AM_RANGE(0x9006, 0x9006) AM_NOP // printer motor on |
| 176 | // AM_RANGE(0x9007, 0x9007) AM_NOP // printer data |
| 177 | AM_RANGE(0x900a, 0x900a) AM_WRITE(sound_on_w) |
| 178 | AM_RANGE(0x900b, 0x900b) AM_WRITE(sound_off_w) |
| 179 | AM_RANGE(0x900c, 0x900c) AM_WRITE(bank_select_w) |
| 180 | // AM_RANGE(0x900d, 0x900d) AM_NOP // printer motor off |
| 181 | // AM_RANGE(0x900e, 0x900e) AM_NOP // printer motor jam reset |
| 115 | 182 | AM_RANGE(0xc000, 0xffff) AM_ROM |
| 116 | 183 | ADDRESS_MAP_END |
| 117 | 184 | |
| 118 | 185 | |
| 119 | | static INPUT_PORTS_START( deshoros ) |
| 120 | | PORT_START("KEY0") |
| 121 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON11 ) PORT_NAME("Key Male") PORT_CODE(KEYCODE_SLASH_PAD) |
| 122 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Key 3") PORT_CODE(KEYCODE_3_PAD) |
| 123 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Key 2") PORT_CODE(KEYCODE_2_PAD) |
| 124 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Key 1") PORT_CODE(KEYCODE_1_PAD) |
| 125 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON12 ) PORT_NAME("Key Female") PORT_CODE(KEYCODE_ASTERISK) |
| 126 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Key 6") PORT_CODE(KEYCODE_6_PAD) |
| 127 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Key 5") PORT_CODE(KEYCODE_5_PAD) |
| 128 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Key 4") PORT_CODE(KEYCODE_4_PAD) |
| 186 | |
| 187 | /*************************************************************************** |
| 188 | |
| 189 | Inputs |
| 190 | |
| 191 | ***************************************************************************/ |
| 192 | |
| 193 | static INPUT_PORTS_START( destiny ) |
| 129 | 194 | PORT_START("KEY1") |
| 130 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Key 0") PORT_CODE(KEYCODE_0_PAD) |
| 131 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Key 9") PORT_CODE(KEYCODE_9_PAD) |
| 132 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Key 8") PORT_CODE(KEYCODE_8_PAD) |
| 133 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Key 7") PORT_CODE(KEYCODE_7_PAD) |
| 134 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON11 ) PORT_NAME("Key Enter") PORT_CODE(KEYCODE_ENTER_PAD) |
| 135 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 136 | | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON13 ) PORT_NAME("Key Cancel") PORT_CODE(KEYCODE_PLUS_PAD) |
| 137 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 195 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key Male") PORT_CODE(KEYCODE_SLASH_PAD) |
| 196 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key 3") PORT_CODE(KEYCODE_3_PAD) |
| 197 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key 2") PORT_CODE(KEYCODE_2_PAD) |
| 198 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key 1") PORT_CODE(KEYCODE_1_PAD) |
| 199 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key Female") PORT_CODE(KEYCODE_ASTERISK) |
| 200 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key 6") PORT_CODE(KEYCODE_6_PAD) |
| 201 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key 5") PORT_CODE(KEYCODE_5_PAD) |
| 202 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key 4") PORT_CODE(KEYCODE_4_PAD) |
| 138 | 203 | |
| 139 | | PORT_START("SYSTEM") |
| 140 | | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) |
| 204 | PORT_START("KEY2") |
| 205 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key 0") PORT_CODE(KEYCODE_0_PAD) |
| 206 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key 9") PORT_CODE(KEYCODE_9_PAD) |
| 207 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key 8") PORT_CODE(KEYCODE_8_PAD) |
| 208 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key 7") PORT_CODE(KEYCODE_7_PAD) |
| 209 | PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key Enter") PORT_CODE(KEYCODE_ENTER_PAD) |
| 210 | PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key Clear") PORT_CODE(KEYCODE_PLUS_PAD) |
| 211 | |
| 212 | PORT_START("DIPSW") |
| 213 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1") |
| 214 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| 215 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 216 | PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "SW1:2" ) |
| 217 | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:3" ) |
| 218 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:4" ) |
| 219 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW1:5" ) |
| 220 | PORT_DIPNAME( 0x20, 0x00, "Force Start" ) PORT_DIPLOCATION("SW1:6") |
| 141 | 221 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 142 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 143 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) |
| 144 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 145 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 146 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) |
| 147 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 148 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 149 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 150 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 151 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 152 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 153 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 154 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 155 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 156 | | PORT_DIPNAME( 0xc0, 0x00, "Operation Mode" ) |
| 222 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 223 | PORT_DIPNAME( 0xc0, 0x00, "Operation Mode" ) PORT_DIPLOCATION("SW1:7,8") |
| 157 | 224 | PORT_DIPSETTING( 0x00, "Normal Mode" ) |
| 225 | // PORT_DIPSETTING( 0x40, "Normal Mode" ) // dupe |
| 158 | 226 | PORT_DIPSETTING( 0x80, "Test Mode" ) |
| 159 | 227 | PORT_DIPSETTING( 0xc0, "I/O Test" ) |
| 160 | | // 0x40, Normal Mode again |
| 228 | |
| 229 | PORT_START("SYSTEM") |
| 230 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE4 ) PORT_NAME("Paper Cutter Reset") |
| 231 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE3 ) PORT_NAME("Paper Cutter Set") |
| 232 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE2 ) PORT_NAME("Paper Cutter Point") |
| 233 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Spear") // starts game |
| 234 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 235 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 236 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 237 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, destiny_state, coin_inserted, (void *)0) |
| 238 | |
| 239 | PORT_START("SERVICE") |
| 240 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CHANGED_MEMBER(DEVICE_SELF, destiny_state, coin_inserted, (void *)1) |
| 161 | 241 | INPUT_PORTS_END |
| 162 | 242 | |
| 163 | | /*Is it there an IRQ mask?*/ |
| 164 | | static INTERRUPT_GEN( deshoros_irq ) |
| 243 | |
| 244 | |
| 245 | /*************************************************************************** |
| 246 | |
| 247 | Machine Config(s) |
| 248 | |
| 249 | ***************************************************************************/ |
| 250 | |
| 251 | void destiny_state::machine_start() |
| 165 | 252 | { |
| 166 | | cputag_set_input_line(device->machine(), "maincpu", M6809_IRQ_LINE, HOLD_LINE); |
| 253 | beep_set_frequency(machine().device(BEEPER_TAG),800); // TODO: determine exact frequency thru schematics |
| 254 | beep_set_state(machine().device(BEEPER_TAG),0); |
| 167 | 255 | } |
| 168 | 256 | |
| 169 | | static MACHINE_RESET( deshoros ) |
| 257 | void destiny_state::machine_reset() |
| 170 | 258 | { |
| 171 | | deshoros_state *state = machine.driver_data<deshoros_state>(); |
| 172 | | state->m_bank = -1; |
| 259 | bank_select_w(*m_maincpu->memory().space(AS_PROGRAM), 0, 0); |
| 173 | 260 | } |
| 174 | 261 | |
| 175 | | static MACHINE_CONFIG_START( deshoros, deshoros_state ) |
| 262 | static MACHINE_CONFIG_START( destiny, destiny_state ) |
| 176 | 263 | |
| 177 | 264 | /* basic machine hardware */ |
| 178 | | MCFG_CPU_ADD("maincpu",M6809,2000000) |
| 265 | MCFG_CPU_ADD("maincpu", M6809, XTAL_4MHz/2) |
| 179 | 266 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 180 | | MCFG_CPU_VBLANK_INT("screen",deshoros_irq) |
| 267 | MCFG_CPU_PERIODIC_INT(irq0_line_hold, 60) // timer irq controls update speed, frequency needs to be determined yet (2MHz through three 74LS390) |
| 181 | 268 | |
| 182 | | MCFG_MACHINE_RESET(deshoros) |
| 183 | | |
| 184 | | /* video hardware */ |
| 269 | /* video hardware (dummy) */ |
| 185 | 270 | MCFG_SCREEN_ADD("screen", RASTER) |
| 186 | 271 | MCFG_SCREEN_REFRESH_RATE(60) |
| 187 | 272 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 188 | 273 | MCFG_SCREEN_SIZE(48*8, 16*8) |
| 189 | 274 | MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 0*8, 16*8-1) |
| 190 | | MCFG_SCREEN_UPDATE_STATIC(deshoros) |
| 275 | MCFG_SCREEN_UPDATE_STATIC(destiny) |
| 191 | 276 | MCFG_PALETTE_LENGTH(16) |
| 192 | 277 | |
| 193 | | MCFG_VIDEO_START(deshoros) |
| 278 | MCFG_VIDEO_START(destiny) |
| 194 | 279 | |
| 195 | 280 | /* sound hardware */ |
| 196 | 281 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 197 | | |
| 282 | MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0) |
| 283 | MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50) |
| 198 | 284 | MACHINE_CONFIG_END |
| 199 | 285 | |
| 286 | |
| 287 | |
| 200 | 288 | /*************************************************************************** |
| 201 | 289 | |
| 202 | 290 | Game driver(s) |
| 203 | 291 | |
| 204 | 292 | ***************************************************************************/ |
| 205 | 293 | |
| 206 | | ROM_START( deshoros ) |
| 294 | ROM_START( destiny ) |
| 207 | 295 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 208 | | ROM_LOAD( "ag12-4", 0xc000, 0x2000, CRC(03b2c850) SHA1(4e2c49a8d80bc559d0f406caddddb85bc107aac0) ) |
| 209 | | ROM_LOAD( "ag13-4", 0xe000, 0x2000, CRC(36959ef6) SHA1(9b3ed44416fcda6a8e89d11ad6e713abd4f63d83) ) |
| 296 | ROM_LOAD( "ag12-4.16c", 0xc000, 0x2000, CRC(03b2c850) SHA1(4e2c49a8d80bc559d0f406caddddb85bc107aac0) ) |
| 297 | ROM_LOAD( "ag13-4.17c", 0xe000, 0x2000, CRC(36959ef6) SHA1(9b3ed44416fcda6a8e89d11ad6e713abd4f63d83) ) |
| 210 | 298 | |
| 211 | | ROM_REGION( 0x18000, "data", 0 ) //answers data |
| 212 | | ROM_LOAD( "ag00", 0x00000, 0x2000, CRC(77f5bce0) SHA1(20b5257710c5e848893fec107f0d87a473a4ba24) ) |
| 213 | | ROM_LOAD( "ag01", 0x02000, 0x2000, CRC(c08e6a74) SHA1(88679ed8bd2b6b8698258baddf8433c0f60a1b64) ) |
| 214 | | ROM_LOAD( "ag02", 0x04000, 0x2000, CRC(687c72b5) SHA1(3f2768c9b6247e96d11b4159f6f5c0dfeb2c5075) ) |
| 215 | | ROM_LOAD( "ag03", 0x06000, 0x2000, CRC(535dbe83) SHA1(29336539c57d1fa7d42a0ce01884b29e1707e9ad) ) |
| 216 | | ROM_LOAD( "ag04", 0x08000, 0x2000, CRC(e6ae8eb7) SHA1(d0e20e438dcfeac9d844d1fd98701a443ea5e4f7) ) |
| 217 | | ROM_LOAD( "ag05", 0x0a000, 0x2000, CRC(c2485e40) SHA1(03f6d7c63a45d430a7965e28aaf07e053ecac7a1) ) |
| 218 | | ROM_LOAD( "ag06", 0x0c000, 0x2000, CRC(e6e0bbd1) SHA1(fe693d038b05ae18a3c0cfb25a4649dbb10ab2c7) ) |
| 219 | | ROM_LOAD( "ag07", 0x0e000, 0x2000, CRC(a62d879d) SHA1(94d07e774df4c9e4e34ae386714372b53b255530) ) |
| 220 | | ROM_LOAD( "ag08", 0x10000, 0x2000, CRC(f5822738) SHA1(afe53e875057317033cdd5f4b7614c96cd11193b) ) |
| 221 | | ROM_LOAD( "ag09", 0x12000, 0x2000, CRC(ad3c9f2c) SHA1(f665efb65c072a3d3d2e19844ebe0b352c0251d3) ) |
| 222 | | ROM_LOAD( "ag10", 0x14000, 0x2000, CRC(c498754a) SHA1(90e215e8e41d32237d1f4b074d93e20eade92e4e) ) |
| 223 | | ROM_LOAD( "ag11", 0x16000, 0x2000, CRC(5f7bf9f9) SHA1(281f89c0bccfcc2bdc1d4d0a5b9cc9a8ab2e7869) ) |
| 299 | ROM_REGION( 0x18000, "answers", 0 ) |
| 300 | ROM_LOAD( "ag00.1a", 0x00000, 0x2000, CRC(77f5bce0) SHA1(20b5257710c5e848893fec107f0d87a473a4ba24) ) |
| 301 | ROM_LOAD( "ag01.3a", 0x02000, 0x2000, CRC(c08e6a74) SHA1(88679ed8bd2b6b8698258baddf8433c0f60a1b64) ) |
| 302 | ROM_LOAD( "ag02.4a", 0x04000, 0x2000, CRC(687c72b5) SHA1(3f2768c9b6247e96d11b4159f6f5c0dfeb2c5075) ) |
| 303 | ROM_LOAD( "ag03.6a", 0x06000, 0x2000, CRC(535dbe83) SHA1(29336539c57d1fa7d42a0ce01884b29e1707e9ad) ) |
| 304 | ROM_LOAD( "ag04.7a", 0x08000, 0x2000, CRC(e6ae8eb7) SHA1(d0e20e438dcfeac9d844d1fd98701a443ea5e4f7) ) |
| 305 | ROM_LOAD( "ag05.9a", 0x0a000, 0x2000, CRC(c2485e40) SHA1(03f6d7c63a45d430a7965e28aaf07e053ecac7a1) ) |
| 306 | ROM_LOAD( "ag06.10a", 0x0c000, 0x2000, CRC(e6e0bbd1) SHA1(fe693d038b05ae18a3c0cfb25a4649dbb10ab2c7) ) |
| 307 | ROM_LOAD( "ag07.12a", 0x0e000, 0x2000, CRC(a62d879d) SHA1(94d07e774df4c9e4e34ae386714372b53b255530) ) |
| 308 | ROM_LOAD( "ag08.13a", 0x10000, 0x2000, CRC(f5822738) SHA1(afe53e875057317033cdd5f4b7614c96cd11193b) ) |
| 309 | ROM_LOAD( "ag09.15a", 0x12000, 0x2000, CRC(ad3c9f2c) SHA1(f665efb65c072a3d3d2e19844ebe0b352c0251d3) ) |
| 310 | ROM_LOAD( "ag10.16a", 0x14000, 0x2000, CRC(c498754a) SHA1(90e215e8e41d32237d1f4b074d93e20eade92e4e) ) |
| 311 | ROM_LOAD( "ag11.18a", 0x16000, 0x2000, CRC(5f7bf9f9) SHA1(281f89c0bccfcc2bdc1d4d0a5b9cc9a8ab2e7869) ) |
| 224 | 312 | ROM_END |
| 225 | 313 | |
| 226 | | GAME( 1983, deshoros, 0, deshoros, deshoros, 0, ROT0, "Data East Corporation", "Destiny Horoscope", GAME_NO_SOUND | GAME_NOT_WORKING ) |
| 314 | GAME( 1983, destiny, 0, destiny, destiny, 0, ROT0, "Data East Corporation", "Destiny - The Fortuneteller (USA)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) |
src/mame/drivers/bzone.c
| r15435 | r15436 | |
| 20 | 20 | 0c00 IN2 |
| 21 | 21 | |
| 22 | 22 | 1200 Vector generator start (write) |
| 23 | | 1400 |
| 23 | 1400 Watchdog Clear |
| 24 | 24 | 1600 Vector generator reset (write) |
| 25 | 25 | |
| 26 | 26 | 1800 Mathbox Status register |
| r15435 | r15436 | |
| 30 | 30 | 1828 Control inputs |
| 31 | 31 | 1860-187f Mathbox RAM |
| 32 | 32 | |
| 33 | | 2000-2fff Vector generator RAM |
| 34 | | 3000-37ff Vector Generator ROM |
| 35 | | 5000-7fff ROM |
| 33 | 2000-27ff Vector generator RAM (2K) |
| 34 | 2800-2fff Vector generator RAM / Vector ROM (2K) |
| 35 | 3000-37ff Vector Generator ROM (4K) |
| 36 | 5000-5fff Program ROM (4K) |
| 37 | 6000-7fff Program ROM (8K) |
| 36 | 38 | |
| 37 | 39 | Battlezone settings: |
| 38 | 40 | |
| r15435 | r15436 | |
| 90 | 92 | |
| 91 | 93 | Red Baron memory map (preliminary) |
| 92 | 94 | |
| 93 | | 0000-04ff RAM |
| 95 | 0000-03ff RAM (1K) |
| 94 | 96 | 0800 COIN_IN |
| 95 | 97 | 0a00 IN1 |
| 96 | 98 | 0c00 IN2 |
| 97 | 99 | |
| 100 | 1000 Coin Counter |
| 98 | 101 | 1200 Vector generator start (write) |
| 99 | | 1400 |
| 102 | 1400 Watchdog Clear |
| 100 | 103 | 1600 Vector generator reset (write) |
| 101 | 104 | |
| 102 | 105 | 1800 Mathbox Status register |
| r15435 | r15436 | |
| 108 | 111 | 1818 Joystick inputs |
| 109 | 112 | 1860-187f Mathbox RAM |
| 110 | 113 | |
| 111 | | 2000-2fff Vector generator RAM |
| 112 | | 3000-37ff Vector generator ROM |
| 113 | | 5000-7fff ROM |
| 114 | 2000-27ff Vector generator RAM (2K) |
| 115 | 2800-2fff Vector generator RAM / Vector ROM (2K) |
| 116 | 3000-37ff Vector generator ROM (4K) |
| 117 | 4800-7fff Program ROM (14K) |
| 114 | 118 | |
| 115 | 119 | RED BARON DIP SWITCH SETTINGS |
| 116 | 120 | Donated by Dana Colbert |
| r15435 | r15436 | |
| 189 | 193 | _____________________ |
| 190 | 194 | All 3 mechs same denomination | On | On | | | |
| 191 | 195 | Left and Center same, right different denomination | On |Off | | | |
| 192 | | Right and Center same, left differnnt denomination |Off | On | | | |
| 196 | Right and Center same, left different denomination |Off | On | | | |
| 193 | 197 | All different denominations |Off |Off | | | |
| 194 | 198 | --------------------- |
| 195 | 199 | |
| r15435 | r15436 | |
| 321 | 325 | AM_RANGE(0x0800, 0x0800) AM_READ_PORT("IN0") |
| 322 | 326 | AM_RANGE(0x0a00, 0x0a00) AM_READ_PORT("DSW0") |
| 323 | 327 | AM_RANGE(0x0c00, 0x0c00) AM_READ_PORT("DSW1") |
| 324 | | AM_RANGE(0x1000, 0x1000) AM_WRITENOP /* coin out */ |
| 328 | AM_RANGE(0x1000, 0x1000) AM_WRITENOP /* coin out - Manual states this is "Coin Counter" */ |
| 325 | 329 | AM_RANGE(0x1200, 0x1200) AM_WRITE_LEGACY(avgdvg_go_w) |
| 326 | 330 | AM_RANGE(0x1400, 0x1400) AM_WRITE(watchdog_reset_w) |
| 327 | 331 | AM_RANGE(0x1600, 0x1600) AM_WRITE_LEGACY(avgdvg_reset_w) |
| r15435 | r15436 | |
| 616 | 620 | * |
| 617 | 621 | *************************************/ |
| 618 | 622 | |
| 619 | | ROM_START( bzone ) |
| 623 | /* Battle Zone |
| 624 | |
| 625 | For the Analog Vec Gen A035742 PCB: |
| 626 | |
| 627 | The -01 revision uses PROMs, -02 uses ROMs |
| 628 | |
| 629 | Rom Component Equivalents & Locations: |
| 630 | |
| 631 | -01 P.C. Boards -02 P.C. Boards |
| 632 | --------------------------------------- |
| 633 | 036415-01 (A3) |
| 634 | 036421-01 (A3) |
| 635 | 036418-01 (E3) |
| 636 | |
| 637 | |
| 638 | 036416-01 (B/C3) |
| 639 | 036422-01 (B/C3) |
| 640 | 036419-01 (F/H3) |
| 641 | |
| 642 | */ |
| 643 | |
| 644 | ROM_START( bzone ) /* Analog Vec Gen A035742-02 */ |
| 620 | 645 | ROM_REGION( 0x8000, "maincpu", 0 ) |
| 621 | | ROM_LOAD( "036414-01.e1", 0x5000, 0x0800, CRC(efbc3fa0) SHA1(6d284fab34b09dde8aa0df7088711d4723f07970) ) |
| 646 | ROM_LOAD( "036414-02.e1", 0x5000, 0x0800, CRC(13de36d5) SHA1(40e356ddc5c042bc1ce0b71f51e8b6de72daf1e4) ) |
| 622 | 647 | ROM_LOAD( "036413-01.h1", 0x5800, 0x0800, CRC(5d9d9111) SHA1(42638cff53a9791a0f18d316f62a0ea8eea4e194) ) |
| 623 | 648 | ROM_LOAD( "036412-01.j1", 0x6000, 0x0800, CRC(ab55cbd2) SHA1(6bbb8316d9f8588ea0893932f9174788292b8edc) ) |
| 624 | 649 | ROM_LOAD( "036411-01.k1", 0x6800, 0x0800, CRC(ad281297) SHA1(54c5e06b2e69eb731a6c9b1704e4340f493e7ea5) ) |
| r15435 | r15436 | |
| 646 | 671 | ROM_END |
| 647 | 672 | |
| 648 | 673 | |
| 649 | | ROM_START( bzone2 ) |
| 674 | ROM_START( bzonea ) /* Analog Vec Gen A035742-02 */ |
| 650 | 675 | ROM_REGION( 0x8000, "maincpu", 0 ) |
| 651 | | ROM_LOAD( "036414-02.e1", 0x5000, 0x0800, CRC(13de36d5) SHA1(40e356ddc5c042bc1ce0b71f51e8b6de72daf1e4) ) |
| 676 | ROM_LOAD( "036414-01.e1", 0x5000, 0x0800, CRC(efbc3fa0) SHA1(6d284fab34b09dde8aa0df7088711d4723f07970) ) |
| 652 | 677 | ROM_LOAD( "036413-01.h1", 0x5800, 0x0800, CRC(5d9d9111) SHA1(42638cff53a9791a0f18d316f62a0ea8eea4e194) ) |
| 653 | 678 | ROM_LOAD( "036412-01.j1", 0x6000, 0x0800, CRC(ab55cbd2) SHA1(6bbb8316d9f8588ea0893932f9174788292b8edc) ) |
| 654 | 679 | ROM_LOAD( "036411-01.k1", 0x6800, 0x0800, CRC(ad281297) SHA1(54c5e06b2e69eb731a6c9b1704e4340f493e7ea5) ) |
| r15435 | r15436 | |
| 739 | 764 | ROM_END |
| 740 | 765 | |
| 741 | 766 | |
| 742 | | ROM_START( redbaron ) |
| 767 | /* Red Barron |
| 768 | |
| 769 | For the Analog Vec Gen A035742 PCB: |
| 770 | |
| 771 | The -01 revision uses PROMs, -02 uses ROMs |
| 772 | |
| 773 | Rom Component Equivalents & Locations: |
| 774 | |
| 775 | -01 P.C. Boards -02 P.C. Boards |
| 776 | --------------------------------------- |
| 777 | 037005-01 (A3) |
| 778 | 037007-01 (A3) |
| 779 | 037003-01 (E3) |
| 780 | |
| 781 | |
| 782 | 037004-01 (B/C3) |
| 783 | 037006-01 (B/C3) |
| 784 | 037002-01 (F/H3) |
| 785 | |
| 786 | Program rom locations as same as redbarona listed below |
| 787 | */ |
| 788 | |
| 789 | |
| 790 | ROM_START( redbaron ) /* Analog Vec Gen A035742-02 Rev. C+ */ |
| 743 | 791 | ROM_REGION( 0x8000, "maincpu", 0 ) |
| 744 | | ROM_LOAD( "037587.01", 0x4800, 0x0800, CRC(60f23983) SHA1(7a9e5380bf49bf50a2d8ab0e0bd1ba3ac8efde24) ) |
| 745 | | ROM_CONTINUE( 0x5800, 0x0800 ) |
| 746 | | ROM_LOAD( "037000.01e", 0x5000, 0x0800, CRC(69bed808) SHA1(27d99efc74113cdcbbf021734b8a5a5fdb78c04c) ) |
| 747 | | ROM_LOAD( "036998.01e", 0x6000, 0x0800, CRC(d1104dd7) SHA1(0eab47cb45ede9dcc4dd7498dcf3a8d8194460b4) ) |
| 748 | | ROM_LOAD( "036997.01e", 0x6800, 0x0800, CRC(7434acb4) SHA1(c950c4c12ab556b5051ad356ab4a0ed6b779ba1f) ) |
| 749 | | ROM_LOAD( "036996.01e", 0x7000, 0x0800, CRC(c0e7589e) SHA1(c1aedc95966afffd860d7e0009d5a43e8b292036) ) |
| 750 | | ROM_LOAD( "036995.01e", 0x7800, 0x0800, CRC(ad81d1da) SHA1(8bd66e5f34fc1c75f31eb6b168607e52aa3aa4df) ) |
| 792 | ROM_LOAD( "037587-01.fh1", 0x4800, 0x0800, CRC(60f23983) SHA1(7a9e5380bf49bf50a2d8ab0e0bd1ba3ac8efde24) ) /* == 037001-1E + 036999-1E */ |
| 793 | ROM_CONTINUE( 0x5800, 0x0800 ) |
| 794 | ROM_LOAD( "037000-01.e1", 0x5000, 0x0800, CRC(69bed808) SHA1(27d99efc74113cdcbbf021734b8a5a5fdb78c04c) ) |
| 795 | ROM_LOAD( "036998-01.j1", 0x6000, 0x0800, CRC(d1104dd7) SHA1(0eab47cb45ede9dcc4dd7498dcf3a8d8194460b4) ) |
| 796 | ROM_LOAD( "036997-01.k1", 0x6800, 0x0800, CRC(7434acb4) SHA1(c950c4c12ab556b5051ad356ab4a0ed6b779ba1f) ) |
| 797 | ROM_LOAD( "036996-01.lm1", 0x7000, 0x0800, CRC(c0e7589e) SHA1(c1aedc95966afffd860d7e0009d5a43e8b292036) ) |
| 798 | ROM_LOAD( "036995-01.n1", 0x7800, 0x0800, CRC(ad81d1da) SHA1(8bd66e5f34fc1c75f31eb6b168607e52aa3aa4df) ) |
| 751 | 799 | /* Vector Generator ROMs */ |
| 752 | | ROM_LOAD( "037006.01e", 0x3000, 0x0800, CRC(9fcffea0) SHA1(69b76655ee75742fcaa0f39a4a1cf3aa58088343) ) |
| 753 | | ROM_LOAD( "037007.01e", 0x3800, 0x0800, CRC(60250ede) SHA1(9c48952bd69863bee0c6dce09f3613149e0151ef) ) |
| 800 | ROM_LOAD( "037006-01.bc3", 0x3000, 0x0800, CRC(9fcffea0) SHA1(69b76655ee75742fcaa0f39a4a1cf3aa58088343) ) |
| 801 | ROM_LOAD( "037007-01.a3", 0x3800, 0x0800, CRC(60250ede) SHA1(9c48952bd69863bee0c6dce09f3613149e0151ef) ) |
| 754 | 802 | |
| 755 | 803 | /* AVG PROM */ |
| 756 | 804 | ROM_REGION( 0x100, "user1", 0 ) |
| 757 | | ROM_LOAD( "036408-01.k7", 0x0000, 0x0100, CRC(5903af03) SHA1(24bc0366f394ad0ec486919212e38be0f08d0239) ) /* 74S287N or compatible bprom */ |
| 805 | ROM_LOAD( "036408-01.k7", 0x0000, 0x0100, CRC(5903af03) SHA1(24bc0366f394ad0ec486919212e38be0f08d0239) ) /* 74S287N or compatible bprom like the 82S129 */ |
| 758 | 806 | |
| 759 | 807 | /* Mathbox PROMs */ |
| 760 | 808 | ROM_REGION( 0x20, "user2", 0 ) |
| 761 | | ROM_LOAD( "036174.01", 0x0000, 0x0020, CRC(8b04f921) SHA1(317b3397482f13b2d1bc21f296d3b3f9a118787b) ) |
| 809 | ROM_LOAD( "036174-01.a1", 0x0000, 0x0020, CRC(8b04f921) SHA1(317b3397482f13b2d1bc21f296d3b3f9a118787b) ) /* 74S288 or compatible bprom like the 82S123 */ |
| 762 | 810 | |
| 763 | 811 | ROM_REGION32_BE( 0x400, "user3", 0 ) |
| 764 | | ROMX_LOAD( "036175.01", 0, 0x100, CRC(2af82e87) SHA1(3816835a9ccf99a76d246adf204989d9261bb065), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3)) |
| 765 | | ROMX_LOAD( "036176.01", 0, 0x100, CRC(b31f6e24) SHA1(ce5f8ca34d06a5cfa0076b47400e61e0130ffe74), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3)) |
| 766 | | ROMX_LOAD( "036177.01", 1, 0x100, CRC(8119b847) SHA1(c4fbaedd4ce1ad6a4128cbe902b297743edb606a), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3)) |
| 767 | | ROMX_LOAD( "036178.01", 1, 0x100, CRC(09f5a4d5) SHA1(d6f2ac07ca9ee385c08831098b0dcaf56808993b), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3)) |
| 768 | | ROMX_LOAD( "036179.01", 2, 0x100, CRC(823b61ae) SHA1(d99a839874b45f64e14dae92a036e47a53705d16), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3)) |
| 769 | | ROMX_LOAD( "036180.01", 2, 0x100, CRC(276eadd5) SHA1(55718cd8ec4bcf75076d5ef0ee1ed2551e19d9ba), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3)) |
| 812 | ROMX_LOAD( "036175-01.e1", 0, 0x100, CRC(2af82e87) SHA1(3816835a9ccf99a76d246adf204989d9261bb065), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3)) |
| 813 | ROMX_LOAD( "036176-01.f1", 0, 0x100, CRC(b31f6e24) SHA1(ce5f8ca34d06a5cfa0076b47400e61e0130ffe74), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3)) |
| 814 | ROMX_LOAD( "036177-01.h1", 1, 0x100, CRC(8119b847) SHA1(c4fbaedd4ce1ad6a4128cbe902b297743edb606a), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3)) |
| 815 | ROMX_LOAD( "036178-01.j1", 1, 0x100, CRC(09f5a4d5) SHA1(d6f2ac07ca9ee385c08831098b0dcaf56808993b), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3)) |
| 816 | ROMX_LOAD( "036179-01.k1", 2, 0x100, CRC(823b61ae) SHA1(d99a839874b45f64e14dae92a036e47a53705d16), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3)) |
| 817 | ROMX_LOAD( "036180-01.l1", 2, 0x100, CRC(276eadd5) SHA1(55718cd8ec4bcf75076d5ef0ee1ed2551e19d9ba), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3)) |
| 818 | |
| 819 | /* Address decoding PROM (located on the AUX PCB) - currently not used */ |
| 820 | ROM_REGION( 0x20, "prom", 0 ) |
| 821 | ROM_LOAD( "036464-01.a5", 0x0000, 0x0020, CRC(42875b18) SHA1(10ba29f3c8c8e581eb275a85574c746272ebb865) ) /* 74S288 or compatible bprom like the 82S123 */ |
| 770 | 822 | ROM_END |
| 771 | 823 | |
| 824 | ROM_START( redbarona ) /* Analog Vec Gen A035742-02 */ |
| 825 | ROM_REGION( 0x8000, "maincpu", 0 ) |
| 826 | ROM_LOAD( "037001-01e.e1", 0x4800, 0x0800, CRC(b9486a6a) SHA1(76cf42569c4ef0a2ad7171e3c766c1a815a62a0e) ) |
| 827 | ROM_LOAD( "037000-01e.fh1", 0x5000, 0x0800, CRC(69bed808) SHA1(27d99efc74113cdcbbf021734b8a5a5fdb78c04c) ) |
| 828 | ROM_LOAD( "036999-01e.j1", 0x5800, 0x0800, CRC(48d49819) SHA1(caf1521ae7bbf3afa91069dae62201748b482a50) ) |
| 829 | ROM_LOAD( "036998-01e.k1", 0x6000, 0x0800, CRC(d1104dd7) SHA1(0eab47cb45ede9dcc4dd7498dcf3a8d8194460b4) ) |
| 830 | ROM_LOAD( "036997-01e.lm1", 0x6800, 0x0800, CRC(7434acb4) SHA1(c950c4c12ab556b5051ad356ab4a0ed6b779ba1f) ) |
| 831 | ROM_LOAD( "036996-01e.n1", 0x7000, 0x0800, CRC(c0e7589e) SHA1(c1aedc95966afffd860d7e0009d5a43e8b292036) ) |
| 832 | ROM_LOAD( "036995-01e.p1", 0x7800, 0x0800, CRC(ad81d1da) SHA1(8bd66e5f34fc1c75f31eb6b168607e52aa3aa4df) ) |
| 833 | /* Vector Generator ROMs */ |
| 834 | ROM_LOAD( "037006-01e.bc3", 0x3000, 0x0800, CRC(9fcffea0) SHA1(69b76655ee75742fcaa0f39a4a1cf3aa58088343) ) |
| 835 | ROM_LOAD( "037007-01e.a3", 0x3800, 0x0800, CRC(60250ede) SHA1(9c48952bd69863bee0c6dce09f3613149e0151ef) ) |
| 772 | 836 | |
| 837 | /* AVG PROM */ |
| 838 | ROM_REGION( 0x100, "user1", 0 ) |
| 839 | ROM_LOAD( "036408-01.k7", 0x0000, 0x0100, CRC(5903af03) SHA1(24bc0366f394ad0ec486919212e38be0f08d0239) ) /* 74S287N or compatible bprom like the 82S129 */ |
| 773 | 840 | |
| 841 | /* Mathbox PROMs */ |
| 842 | ROM_REGION( 0x20, "user2", 0 ) |
| 843 | ROM_LOAD( "036174-01.a1", 0x0000, 0x0020, CRC(8b04f921) SHA1(317b3397482f13b2d1bc21f296d3b3f9a118787b) ) /* 74S288 or compatible bprom like the 82S123 */ |
| 844 | |
| 845 | ROM_REGION32_BE( 0x400, "user3", 0 ) |
| 846 | ROMX_LOAD( "036175-01.e1", 0, 0x100, CRC(2af82e87) SHA1(3816835a9ccf99a76d246adf204989d9261bb065), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3)) |
| 847 | ROMX_LOAD( "036176-01.f1", 0, 0x100, CRC(b31f6e24) SHA1(ce5f8ca34d06a5cfa0076b47400e61e0130ffe74), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3)) |
| 848 | ROMX_LOAD( "036177-01.h1", 1, 0x100, CRC(8119b847) SHA1(c4fbaedd4ce1ad6a4128cbe902b297743edb606a), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3)) |
| 849 | ROMX_LOAD( "036178-01.j1", 1, 0x100, CRC(09f5a4d5) SHA1(d6f2ac07ca9ee385c08831098b0dcaf56808993b), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3)) |
| 850 | ROMX_LOAD( "036179-01.k1", 2, 0x100, CRC(823b61ae) SHA1(d99a839874b45f64e14dae92a036e47a53705d16), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3)) |
| 851 | ROMX_LOAD( "036180-01.l1", 2, 0x100, CRC(276eadd5) SHA1(55718cd8ec4bcf75076d5ef0ee1ed2551e19d9ba), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3)) |
| 852 | |
| 853 | /* Address decoding PROM (located on the AUX PCB) - currently not used */ |
| 854 | ROM_REGION( 0x20, "prom", 0 ) |
| 855 | ROM_LOAD( "036464-01.a5", 0x0000, 0x0020, CRC(42875b18) SHA1(10ba29f3c8c8e581eb275a85574c746272ebb865) ) /* 74S288 or compatible bprom like the 82S123 */ |
| 856 | ROM_END |
| 857 | |
| 858 | |
| 859 | |
| 774 | 860 | /************************************* |
| 775 | 861 | * |
| 776 | 862 | * Driver initialization |
| r15435 | r15436 | |
| 811 | 897 | * |
| 812 | 898 | *************************************/ |
| 813 | 899 | |
| 814 | | GAMEL(1980, bzone, 0, bzone, bzone, 0, ROT0, "Atari", "Battle Zone (set 1)", GAME_SUPPORTS_SAVE, layout_bzone ) |
| 815 | | GAMEL(1980, bzone2, bzone, bzone, bzone, 0, ROT0, "Atari", "Battle Zone (set 2)", GAME_SUPPORTS_SAVE, layout_bzone ) |
| 816 | | GAMEL(1980, bzonec, bzone, bzone, bzone, 0, ROT0, "Atari", "Battle Zone (cocktail)", GAME_SUPPORTS_SAVE|GAME_NO_COCKTAIL, layout_bzone ) |
| 817 | | GAME( 1980, bradley, 0, bzone, bradley, bradley, ROT0, "Atari", "Bradley Trainer", GAME_SUPPORTS_SAVE ) |
| 818 | | GAMEL(1980, redbaron, 0, redbaron, redbaron, 0, ROT0, "Atari", "Red Baron", GAME_SUPPORTS_SAVE, layout_ho88ffff ) |
| 900 | GAMEL(1980, bzone, 0, bzone, bzone, 0, ROT0, "Atari", "Battle Zone (rev 2)", GAME_SUPPORTS_SAVE, layout_bzone ) |
| 901 | GAMEL(1980, bzonea, bzone, bzone, bzone, 0, ROT0, "Atari", "Battle Zone (rev 1)", GAME_SUPPORTS_SAVE, layout_bzone ) |
| 902 | GAMEL(1980, bzonec, bzone, bzone, bzone, 0, ROT0, "Atari", "Battle Zone (cocktail)", GAME_SUPPORTS_SAVE|GAME_NO_COCKTAIL, layout_bzone ) |
| 903 | GAME( 1980, bradley, 0, bzone, bradley, bradley, ROT0, "Atari", "Bradley Trainer", GAME_SUPPORTS_SAVE ) |
| 904 | GAMEL(1980, redbaron, 0, redbaron, redbaron, 0, ROT0, "Atari", "Red Baron (Revised Hardware)", GAME_SUPPORTS_SAVE, layout_ho88ffff ) |
| 905 | GAMEL(1980, redbarona, redbaron, redbaron, redbaron, 0, ROT0, "Atari", "Red Baron", GAME_SUPPORTS_SAVE, layout_ho88ffff ) |
src/mame/drivers/dec0.c
| r15435 | r15436 | |
| 167 | 167 | #include "sound/3812intf.h" |
| 168 | 168 | #include "sound/okim6295.h" |
| 169 | 169 | #include "sound/msm5205.h" |
| 170 | | #include "video/decbac06.h" |
| 171 | | #include "video/decmxc06.h" |
| 172 | 170 | |
| 173 | 171 | |
| 174 | 172 | /******************************************************************************/ |
| r15435 | r15436 | |
| 220 | 218 | } |
| 221 | 219 | |
| 222 | 220 | |
| 223 | | WRITE16_MEMBER(automat_state::automat_control_w) |
| 221 | WRITE16_MEMBER(dec0_automat_state::automat_control_w) |
| 224 | 222 | { |
| 225 | 223 | switch (offset << 1) |
| 226 | 224 | { |
| r15435 | r15436 | |
| 426 | 424 | dec0_state *state = machine.driver_data<dec0_state>(); |
| 427 | 425 | address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 428 | 426 | |
| 429 | | deco_bac06_device *tilegen1 = (deco_bac06_device*)space->machine().device<deco_bac06_device>("tilegen1"); |
| 430 | | deco_bac06_device *tilegen2 = (deco_bac06_device*)space->machine().device<deco_bac06_device>("tilegen2"); |
| 427 | deco_bac06_device *tilegen1 = (deco_bac06_device*)state->m_tilegen1; |
| 428 | deco_bac06_device *tilegen2 = (deco_bac06_device*)state->m_tilegen2; |
| 431 | 429 | |
| 432 | 430 | space->install_write_handler( 0x240000, 0x24ffff, write16_delegate(FUNC(dec0_state::unmapped_w),state)); |
| 433 | 431 | |
| r15435 | r15436 | |
| 610 | 608 | AM_RANGE(0xb08000, 0xb087ff) AM_RAM AM_SHARE("spriteram") /* Sprites */ |
| 611 | 609 | ADDRESS_MAP_END |
| 612 | 610 | |
| 611 | /* swizzle the palette writes around so we can use the same gfx plane ordering as the originals */ |
| 612 | READ16_MEMBER( dec0_automat_state::automat_palette_r ) |
| 613 | { |
| 614 | offset ^=0xf; |
| 615 | return m_generic_paletteram_16[offset]; |
| 616 | } |
| 613 | 617 | |
| 614 | | static ADDRESS_MAP_START( automat_map, AS_PROGRAM, 16, automat_state ) |
| 618 | WRITE16_MEMBER( dec0_automat_state::automat_palette_w ) |
| 619 | { |
| 620 | offset ^=0xf; |
| 621 | paletteram_xxxxBBBBGGGGRRRR_word_w(space, offset, data, mem_mask); |
| 622 | } |
| 623 | |
| 624 | |
| 625 | |
| 626 | static ADDRESS_MAP_START( automat_map, AS_PROGRAM, 16, dec0_automat_state ) |
| 615 | 627 | AM_RANGE(0x000000, 0x05ffff) AM_ROM |
| 616 | 628 | |
| 617 | 629 | AM_RANGE(0x240000, 0x240007) AM_RAM /* text layer */ |
| r15435 | r15436 | |
| 619 | 631 | AM_RANGE(0x242000, 0x24207f) AM_RAM |
| 620 | 632 | AM_RANGE(0x242400, 0x2427ff) AM_RAM |
| 621 | 633 | AM_RANGE(0x242800, 0x243fff) AM_RAM |
| 622 | | AM_RANGE(0x244000, 0x245fff) AM_RAM |
| 634 | AM_RANGE(0x244000, 0x245fff) AM_RAM AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_r, deco_bac06_pf_data_w) |
| 623 | 635 | |
| 624 | 636 | AM_RANGE(0x246000, 0x246007) AM_RAM /* first tile layer */ |
| 625 | 637 | AM_RANGE(0x246010, 0x246017) AM_RAM |
| 626 | 638 | AM_RANGE(0x248000, 0x24807f) AM_RAM |
| 627 | 639 | AM_RANGE(0x248400, 0x2487ff) AM_RAM |
| 628 | | AM_RANGE(0x24a000, 0x24a7ff) AM_RAM |
| 640 | AM_RANGE(0x24a000, 0x24a7ff) AM_RAM AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_data_r, deco_bac06_pf_data_w) |
| 629 | 641 | |
| 630 | 642 | AM_RANGE(0x24c000, 0x24c007) AM_RAM /* second tile layer */ |
| 631 | 643 | AM_RANGE(0x24c010, 0x24c017) AM_RAM |
| 632 | 644 | AM_RANGE(0x24c800, 0x24c87f) AM_RAM |
| 633 | 645 | AM_RANGE(0x24cc00, 0x24cfff) AM_RAM |
| 634 | | AM_RANGE(0x24d000, 0x24d7ff) AM_RAM |
| 646 | AM_RANGE(0x24d000, 0x24d7ff) AM_RAM AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_data_r, deco_bac06_pf_data_w) |
| 635 | 647 | |
| 636 | 648 | AM_RANGE(0x300000, 0x30001f) AM_READ(dec0_rotary_r) |
| 637 | 649 | AM_RANGE(0x30c000, 0x30c00b) AM_READ(dec0_controls_r) |
| 638 | 650 | AM_RANGE(0x30c000, 0x30c01f) AM_WRITE(automat_control_w) /* Priority, sound, etc. */ |
| 639 | | AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_word_w) AM_SHARE("paletteram") |
| 651 | AM_RANGE(0x310000, 0x3107ff) AM_READWRITE(automat_palette_r, automat_palette_w) AM_SHARE("paletteram") |
| 640 | 652 | AM_RANGE(0x314000, 0x3147ff) AM_RAM |
| 641 | | AM_RANGE(0x400008, 0x400009) AM_WRITE(dec0_priority_w) // NEW |
| 653 | |
| 654 | // video regs are moved to here.. |
| 655 | AM_RANGE(0x400000, 0x400007) AM_WRITE(automat_scroll_w) |
| 656 | AM_RANGE(0x400008, 0x400009) AM_WRITE(dec0_priority_w) |
| 657 | |
| 642 | 658 | AM_RANGE(0xff8000, 0xffbfff) AM_RAM AM_SHARE("ram") /* Main ram */ |
| 643 | 659 | AM_RANGE(0xffc000, 0xffc7ff) AM_RAM AM_SHARE("spriteram") /* Sprites */ |
| 644 | 660 | ADDRESS_MAP_END |
| 645 | 661 | |
| 646 | | WRITE8_MEMBER(automat_state::automat_adpcm_w) |
| 662 | WRITE8_MEMBER(dec0_automat_state::automat_adpcm_w) |
| 647 | 663 | { |
| 648 | 664 | m_automat_adpcm_byte = data; |
| 649 | 665 | } |
| 650 | 666 | |
| 651 | | static ADDRESS_MAP_START( automat_s_map, AS_PROGRAM, 8, automat_state ) |
| 667 | static ADDRESS_MAP_START( automat_s_map, AS_PROGRAM, 8, dec0_automat_state ) |
| 652 | 668 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 653 | | // AM_RANGE(0xc800, 0xc800) AM_WRITE_LEGACY(ym2203_control_port_0_w) |
| 654 | | // AM_RANGE(0xc801, 0xc801) AM_WRITE_LEGACY(ym2203_write_port_0_w) |
| 655 | | AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_byte_r) |
| 656 | | // AM_RANGE(0xd000, 0xd000) AM_WRITE_LEGACY(ym2203_control_port_1_w) |
| 657 | | // AM_RANGE(0xd001, 0xd001) AM_WRITE_LEGACY(ym2203_write_port_1_w) |
| 669 | AM_RANGE(0xc800, 0xc801) AM_DEVWRITE_LEGACY("2203a", ym2203_w) |
| 670 | AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_byte_r) |
| 671 | AM_RANGE(0xd000, 0xd001) AM_DEVWRITE_LEGACY("2203b", ym2203_w) |
| 658 | 672 | AM_RANGE(0xf000, 0xf000) AM_WRITE(automat_adpcm_w) |
| 659 | 673 | AM_RANGE(0x0000, 0xffff) AM_ROM |
| 660 | 674 | ADDRESS_MAP_END |
| r15435 | r15436 | |
| 1198 | 1212 | 16*16 |
| 1199 | 1213 | }; |
| 1200 | 1214 | |
| 1201 | | static const gfx_layout automat_tilelayout = |
| 1215 | static const gfx_layout automat_spritelayout = |
| 1202 | 1216 | { |
| 1203 | 1217 | 16,16, |
| 1204 | 1218 | RGN_FRAC(1,4), |
| r15435 | r15436 | |
| 1244 | 1258 | GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) /* Characters 8x8 */ |
| 1245 | 1259 | GFXDECODE_ENTRY( "gfx2", 0, automat_tilelayout3, 512, 16 ) /* Tiles 16x16 */ |
| 1246 | 1260 | GFXDECODE_ENTRY( "gfx3", 0, automat_tilelayout2, 768, 16 ) /* Tiles 16x16 */ |
| 1247 | | GFXDECODE_ENTRY( "gfx4", 0, automat_tilelayout, 256, 16 ) /* Sprites 16x16 */ |
| 1261 | GFXDECODE_ENTRY( "gfx4", 0, automat_spritelayout, 256, 16 ) /* Sprites 16x16 */ |
| 1248 | 1262 | GFXDECODE_END |
| 1249 | 1263 | |
| 1250 | 1264 | static GFXDECODE_START( midres ) |
| r15435 | r15436 | |
| 1401 | 1415 | |
| 1402 | 1416 | static void automat_vclk_cb(device_t *device) |
| 1403 | 1417 | { |
| 1404 | | automat_state *state = device->machine().driver_data<automat_state>(); |
| 1418 | dec0_automat_state *state = device->machine().driver_data<dec0_automat_state>(); |
| 1405 | 1419 | if (state->m_automat_msm5205_vclk_toggle == 0) |
| 1406 | 1420 | { |
| 1407 | 1421 | msm5205_data_w(device, state->m_automat_adpcm_byte & 0xf); |
| r15435 | r15436 | |
| 1422 | 1436 | }; |
| 1423 | 1437 | |
| 1424 | 1438 | |
| 1425 | | static MACHINE_CONFIG_START( automat, automat_state ) |
| 1439 | static MACHINE_CONFIG_START( automat, dec0_automat_state ) |
| 1426 | 1440 | |
| 1427 | 1441 | /* basic machine hardware */ |
| 1428 | 1442 | MCFG_CPU_ADD("maincpu", M68000, 10000000) |
| r15435 | r15436 | |
| 1439 | 1453 | MCFG_SCREEN_RAW_PARAMS(DEC0_PIXEL_CLOCK,DEC0_HTOTAL,DEC0_HBEND,DEC0_HBSTART,DEC0_VTOTAL,DEC0_VBEND,DEC0_VBSTART) |
| 1440 | 1454 | MCFG_SCREEN_UPDATE_STATIC(automat) |
| 1441 | 1455 | |
| 1456 | MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0) |
| 1457 | deco_bac06_device::set_gfx_region_wide(*device, 0,0,0); |
| 1458 | MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0) |
| 1459 | deco_bac06_device::set_gfx_region_wide(*device, 0,1,0); |
| 1460 | MCFG_DEVICE_ADD("tilegen3", DECO_BAC06, 0) |
| 1461 | deco_bac06_device::set_gfx_region_wide(*device, 0,2,0); |
| 1462 | |
| 1463 | |
| 1442 | 1464 | MCFG_PALETTE_LENGTH(1024) |
| 1443 | 1465 | MCFG_GFXDECODE(automat) |
| 1444 | 1466 | |
| 1445 | 1467 | /* sound hardware */ |
| 1446 | 1468 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1447 | 1469 | |
| 1448 | | MCFG_SOUND_ADD("ym1", YM2203, 1500000) |
| 1470 | MCFG_SOUND_ADD("2203a", YM2203, 1500000) |
| 1449 | 1471 | MCFG_SOUND_ROUTE(0, "mono", 0.90) |
| 1450 | 1472 | MCFG_SOUND_ROUTE(1, "mono", 0.90) |
| 1451 | 1473 | MCFG_SOUND_ROUTE(2, "mono", 0.90) |
| 1452 | 1474 | MCFG_SOUND_ROUTE(3, "mono", 0.35) |
| 1453 | 1475 | |
| 1454 | | MCFG_SOUND_ADD("ym2", YM2203, 1500000) |
| 1476 | MCFG_SOUND_ADD("2203b", YM2203, 1500000) |
| 1455 | 1477 | MCFG_SOUND_ROUTE(0, "mono", 0.90) |
| 1456 | 1478 | MCFG_SOUND_ROUTE(1, "mono", 0.90) |
| 1457 | 1479 | MCFG_SOUND_ROUTE(2, "mono", 0.90) |
| r15435 | r15436 | |
| 2297 | 2319 | ROM_LOAD( "12.bin", 0x30000, 0x10000, CRC(00cd0990) SHA1(3fc498fcee2110001e376f5ee38d7dd361bd3ee3) ) // y |
| 2298 | 2320 | |
| 2299 | 2321 | /* copy out the chars */ |
| 2300 | | ROM_REGION( 0x20000, "gfx1", 0 ) /* chars */ |
| 2322 | ROM_REGION( 0x20000, "gfx1", ROMREGION_INVERT ) /* chars */ |
| 2301 | 2323 | ROM_COPY( "gfxload1", 0x00000, 0x00000, 0x8000 ) |
| 2302 | 2324 | ROM_COPY( "gfxload1", 0x10000, 0x08000, 0x8000 ) |
| 2303 | 2325 | ROM_COPY( "gfxload1", 0x20000, 0x10000, 0x8000 ) |
| 2304 | 2326 | ROM_COPY( "gfxload1", 0x30000, 0x18000, 0x8000 ) |
| 2305 | 2327 | |
| 2306 | | ROM_REGION( 0x20000, "gfx3", 0 ) /* tiles */ |
| 2328 | ROM_REGION( 0x20000, "gfx3", ROMREGION_INVERT ) /* tiles */ |
| 2307 | 2329 | ROM_COPY( "gfxload1", 0x08000, 0x00000, 0x8000 ) |
| 2308 | 2330 | ROM_COPY( "gfxload1", 0x18000, 0x08000, 0x8000 ) |
| 2309 | 2331 | ROM_COPY( "gfxload1", 0x28000, 0x10000, 0x8000 ) |
| 2310 | 2332 | ROM_COPY( "gfxload1", 0x38000, 0x18000, 0x8000 ) |
| 2311 | 2333 | |
| 2312 | 2334 | // we have to rearrange this with ROM_CONTINUE due to the way gfxdecode works */ |
| 2313 | | ROM_REGION( 0x40000, "gfx2", 0 ) /* tiles */ |
| 2335 | ROM_REGION( 0x40000, "gfx2", ROMREGION_INVERT ) /* tiles */ |
| 2314 | 2336 | ROM_LOAD( "9.bin", 0x00000, 0x2000, CRC(ccf91ce0) SHA1(c976eddcea48da6e7fbd28a4d5c48706d61cabfb) ) |
| 2315 | 2337 | ROM_CONTINUE( 0x04000, 0x2000 ) |
| 2316 | 2338 | ROM_CONTINUE( 0x08000, 0x2000 ) |
| r15435 | r15436 | |
| 2346 | 2368 | |
| 2347 | 2369 | // the sprite data is the same as robocop, but with the bits in each byte reversed |
| 2348 | 2370 | // 21.bin was repaired with this knowledge as the chip was faulty |
| 2349 | | ROM_REGION( 0x80000, "gfx4", ROMREGION_INVERT) /* sprites */ |
| 2371 | ROM_REGION( 0x80000, "gfx4", 0) /* sprites */ |
| 2350 | 2372 | ROM_LOAD( "16.bin", 0x00000, 0x10000, CRC(e42e8675) SHA1(5b964477de8278ea330ffc2366e5fc7e10122ef8) ) |
| 2351 | 2373 | ROM_LOAD( "17.bin", 0x10000, 0x08000, CRC(9a414c56) SHA1(017eb5a238e24cd6de50afd029c239993fc61a21) ) |
| 2352 | 2374 | ROM_LOAD( "20.bin", 0x20000, 0x10000, CRC(7c62a2a1) SHA1(43a40355cdcbb17506f9634e8f12673287e79bd7) ) |
| r15435 | r15436 | |
| 3021 | 3043 | ROM_LOAD( "ta-16.21k", 0x0000, 0x0100, CRC(ad26e8d4) SHA1(827337aeb8904429a1c050279240ae38aa6ce064) ) /* Priority (not used) */ |
| 3022 | 3044 | ROM_END |
| 3023 | 3045 | |
| 3024 | | // helper function |
| 3025 | | #if 0 |
| 3026 | | static void dump_to_file(running_machine& machine, UINT8* ROM, int offset, int size) |
| 3027 | | { |
| 3028 | | { |
| 3029 | | FILE *fp; |
| 3030 | | char filename[256]; |
| 3031 | | sprintf(filename,"%s_%08x_%08x", machine.system().name, offset, size); |
| 3032 | | fp=fopen(filename, "w+b"); |
| 3033 | | if (fp) |
| 3034 | | { |
| 3035 | | fwrite(ROM+offset, size, 1, fp); |
| 3036 | | fclose(fp); |
| 3037 | | } |
| 3038 | | } |
| 3039 | | } |
| 3040 | 3046 | |
| 3041 | | |
| 3042 | | static DRIVER_INIT( convert_robocop_gfx4_to_automat ) |
| 3043 | | { |
| 3044 | | UINT8* R = machine.root_device().memregion("gfx4")->base(); |
| 3045 | | int i; |
| 3046 | | |
| 3047 | | for (i=0;i<0x80000;i++) |
| 3048 | | { |
| 3049 | | R[i] = BITSWAP8(R[i],0,1,2,3,4,5,6,7); |
| 3050 | | } |
| 3051 | | |
| 3052 | | dump_to_file(machine,R, 0x00000, 0x10000); |
| 3053 | | dump_to_file(machine,R, 0x10000, 0x08000); |
| 3054 | | dump_to_file(machine,R, 0x20000, 0x10000); |
| 3055 | | dump_to_file(machine,R, 0x30000, 0x08000); |
| 3056 | | dump_to_file(machine,R, 0x40000, 0x10000); |
| 3057 | | dump_to_file(machine,R, 0x50000, 0x08000); |
| 3058 | | dump_to_file(machine,R, 0x60000, 0x10000); |
| 3059 | | dump_to_file(machine,R, 0x70000, 0x08000); |
| 3060 | | } |
| 3061 | | #endif |
| 3062 | | |
| 3063 | 3047 | static DRIVER_INIT( midresb ) |
| 3064 | 3048 | { |
| 3065 | 3049 | dec0_state *state = machine.driver_data<dec0_state>(); |
src/emu/machine/am9517a.c
| r15435 | r15436 | |
| 1 | | /*************************************************************************** |
| 2 | | |
| 3 | | AMD AM9517A/8237A Multimode DMA Controller emulation |
| 4 | | |
| 5 | | Copyright the MESS Team. |
| 6 | | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | | |
| 8 | | ***************************************************************************/ |
| 9 | | |
| 10 | | /* |
| 11 | | |
| 12 | | TODO: |
| 13 | | |
| 14 | | - memory-to-memory transfer |
| 15 | | - external EOP |
| 16 | | |
| 17 | | */ |
| 18 | | |
| 19 | | #include "am9517a.h" |
| 20 | | |
| 21 | | |
| 22 | | |
| 23 | | //************************************************************************** |
| 24 | | // DEVICE DEFINITIONS |
| 25 | | //************************************************************************** |
| 26 | | |
| 27 | | const device_type AM9517A = &device_creator<am9517a_device>; |
| 28 | | |
| 29 | | |
| 30 | | |
| 31 | | //************************************************************************** |
| 32 | | // MACROS / CONSTANTS |
| 33 | | //************************************************************************** |
| 34 | | |
| 35 | | #define LOG 0 |
| 36 | | |
| 37 | | |
| 38 | | enum |
| 39 | | { |
| 40 | | REGISTER_ADDRESS = 0, |
| 41 | | REGISTER_WORD_COUNT, |
| 42 | | REGISTER_STATUS = 8, |
| 43 | | REGISTER_COMMAND = REGISTER_STATUS, |
| 44 | | REGISTER_REQUEST, |
| 45 | | REGISTER_SINGLE_MASK, |
| 46 | | REGISTER_MODE, |
| 47 | | REGISTER_BYTE_POINTER, |
| 48 | | REGISTER_TEMPORARY, |
| 49 | | REGISTER_MASTER_CLEAR = REGISTER_TEMPORARY, |
| 50 | | REGISTER_CLEAR_MASK, |
| 51 | | REGISTER_MASK |
| 52 | | }; |
| 53 | | |
| 54 | | |
| 55 | | #define COMMAND_MEM_TO_MEM BIT(m_command, 0) |
| 56 | | #define COMMAND_CH0_ADDRESS_HOLD BIT(m_command, 1) |
| 57 | | #define COMMAND_DISABLE BIT(m_command, 2) |
| 58 | | #define COMMAND_COMPRESSED_TIMING BIT(m_command, 3) |
| 59 | | #define COMMAND_ROTATING_PRIORITY BIT(m_command, 4) |
| 60 | | #define COMMAND_EXTENDED_WRITE BIT(m_command, 5) |
| 61 | | #define COMMAND_DREQ_ACTIVE_LOW BIT(m_command, 6) |
| 62 | | #define COMMAND_DACK_ACTIVE_HIGH BIT(m_command, 7) |
| 63 | | |
| 64 | | |
| 65 | | #define MODE_TRANSFER_MASK (m_channel[m_current_channel].m_mode & 0x0c) |
| 66 | | #define MODE_TRANSFER_VERIFY 0x00 |
| 67 | | #define MODE_TRANSFER_WRITE 0x04 |
| 68 | | #define MODE_TRANSFER_READ 0x08 |
| 69 | | #define MODE_TRANSFER_ILLEGAL 0x0c |
| 70 | | #define MODE_AUTOINITIALIZE BIT(m_channel[m_current_channel].m_mode, 4) |
| 71 | | #define MODE_ADDRESS_DECREMENT BIT(m_channel[m_current_channel].m_mode, 5) |
| 72 | | #define MODE_MASK (m_channel[m_current_channel].m_mode & 0xc0) |
| 73 | | #define MODE_DEMAND 0x00 |
| 74 | | #define MODE_SINGLE 0x40 |
| 75 | | #define MODE_BLOCK 0x80 |
| 76 | | #define MODE_CASCADE 0xc0 |
| 77 | | |
| 78 | | |
| 79 | | enum |
| 80 | | { |
| 81 | | STATE_SI, |
| 82 | | STATE_S0, |
| 83 | | STATE_SC, |
| 84 | | STATE_S1, |
| 85 | | STATE_S2, |
| 86 | | STATE_S3, |
| 87 | | STATE_SW, |
| 88 | | STATE_S4, |
| 89 | | STATE_S11, |
| 90 | | STATE_S12, |
| 91 | | STATE_S13, |
| 92 | | STATE_S14, |
| 93 | | STATE_S21, |
| 94 | | STATE_S22, |
| 95 | | STATE_S23, |
| 96 | | STATE_S24 |
| 97 | | }; |
| 98 | | |
| 99 | | |
| 100 | | |
| 101 | | //************************************************************************** |
| 102 | | // INLINE HELPERS |
| 103 | | //************************************************************************** |
| 104 | | |
| 105 | | //------------------------------------------------- |
| 106 | | // dma_request - |
| 107 | | //------------------------------------------------- |
| 108 | | |
| 109 | | inline void am9517a_device::dma_request(int channel, int state) |
| 110 | | { |
| 111 | | if (LOG) logerror("AM9517A '%s' Channel %u DMA Request: %u\n", tag(), channel, state); |
| 112 | | |
| 113 | | if (state ^ COMMAND_DREQ_ACTIVE_LOW) |
| 114 | | { |
| 115 | | m_status |= (1 << (channel + 4)); |
| 116 | | } |
| 117 | | else |
| 118 | | { |
| 119 | | m_status &= ~(1 << (channel + 4)); |
| 120 | | } |
| 121 | | } |
| 122 | | |
| 123 | | |
| 124 | | //------------------------------------------------- |
| 125 | | // is_request_active - |
| 126 | | //------------------------------------------------- |
| 127 | | |
| 128 | | inline bool am9517a_device::is_request_active(int channel) |
| 129 | | { |
| 130 | | return (BIT(m_status, channel + 4) & !BIT(m_mask, channel)) ? true : false; |
| 131 | | } |
| 132 | | |
| 133 | | |
| 134 | | //------------------------------------------------- |
| 135 | | // is_software_request_active - |
| 136 | | //------------------------------------------------- |
| 137 | | |
| 138 | | inline bool am9517a_device::is_software_request_active(int channel) |
| 139 | | { |
| 140 | | return BIT(m_request, channel) && ((m_channel[channel].m_mode & 0xc0) == MODE_BLOCK); |
| 141 | | } |
| 142 | | |
| 143 | | |
| 144 | | //------------------------------------------------- |
| 145 | | // set_hreq - |
| 146 | | //------------------------------------------------- |
| 147 | | |
| 148 | | inline void am9517a_device::set_hreq(int state) |
| 149 | | { |
| 150 | | if (m_hreq != state) |
| 151 | | { |
| 152 | | m_out_hreq_func(state); |
| 153 | | |
| 154 | | m_hreq = state; |
| 155 | | } |
| 156 | | } |
| 157 | | |
| 158 | | |
| 159 | | //------------------------------------------------- |
| 160 | | // set_dack - |
| 161 | | //------------------------------------------------- |
| 162 | | |
| 163 | | inline void am9517a_device::set_dack() |
| 164 | | { |
| 165 | | for (int channel = 0; channel < 4; channel++) |
| 166 | | { |
| 167 | | if ((channel == m_current_channel) && !COMMAND_MEM_TO_MEM) |
| 168 | | { |
| 169 | | m_channel[channel].m_out_dack_func(COMMAND_DACK_ACTIVE_HIGH); |
| 170 | | } |
| 171 | | else |
| 172 | | { |
| 173 | | m_channel[channel].m_out_dack_func(!COMMAND_DACK_ACTIVE_HIGH); |
| 174 | | } |
| 175 | | } |
| 176 | | } |
| 177 | | |
| 178 | | |
| 179 | | //------------------------------------------------- |
| 180 | | // set_eop - |
| 181 | | //------------------------------------------------- |
| 182 | | |
| 183 | | inline void am9517a_device::set_eop(int state) |
| 184 | | { |
| 185 | | if (m_eop != state) |
| 186 | | { |
| 187 | | m_out_eop_func(state); |
| 188 | | |
| 189 | | m_eop = state; |
| 190 | | } |
| 191 | | } |
| 192 | | |
| 193 | | |
| 194 | | //------------------------------------------------- |
| 195 | | // dma_read - |
| 196 | | //------------------------------------------------- |
| 197 | | |
| 198 | | inline int am9517a_device::get_state1(bool msb_changed) |
| 199 | | { |
| 200 | | if (COMMAND_MEM_TO_MEM) |
| 201 | | { |
| 202 | | return msb_changed ? STATE_S11 : STATE_S12; |
| 203 | | } |
| 204 | | else |
| 205 | | { |
| 206 | | return msb_changed ? STATE_S1 : STATE_S2; |
| 207 | | } |
| 208 | | } |
| 209 | | |
| 210 | | |
| 211 | | //------------------------------------------------- |
| 212 | | // dma_read - |
| 213 | | //------------------------------------------------- |
| 214 | | |
| 215 | | inline void am9517a_device::dma_read() |
| 216 | | { |
| 217 | | offs_t offset = m_channel[m_current_channel].m_address; |
| 218 | | |
| 219 | | switch (MODE_TRANSFER_MASK) |
| 220 | | { |
| 221 | | case MODE_TRANSFER_VERIFY: |
| 222 | | break; |
| 223 | | |
| 224 | | case MODE_TRANSFER_WRITE: |
| 225 | | m_temp = m_channel[m_current_channel].m_in_ior_func(offset); |
| 226 | | break; |
| 227 | | |
| 228 | | case MODE_TRANSFER_READ: |
| 229 | | m_temp = m_in_memr_func(offset); |
| 230 | | break; |
| 231 | | } |
| 232 | | } |
| 233 | | |
| 234 | | |
| 235 | | //------------------------------------------------- |
| 236 | | // dma_write - |
| 237 | | //------------------------------------------------- |
| 238 | | |
| 239 | | inline void am9517a_device::dma_write() |
| 240 | | { |
| 241 | | offs_t offset = m_channel[m_current_channel].m_address; |
| 242 | | |
| 243 | | switch (MODE_TRANSFER_MASK) |
| 244 | | { |
| 245 | | case MODE_TRANSFER_VERIFY: |
| 246 | | break; |
| 247 | | |
| 248 | | case MODE_TRANSFER_WRITE: |
| 249 | | m_out_memw_func(offset, m_temp); |
| 250 | | break; |
| 251 | | |
| 252 | | case MODE_TRANSFER_READ: |
| 253 | | m_channel[m_current_channel].m_out_iow_func(offset, m_temp); |
| 254 | | break; |
| 255 | | } |
| 256 | | } |
| 257 | | |
| 258 | | |
| 259 | | //------------------------------------------------- |
| 260 | | // dma_advance - |
| 261 | | //------------------------------------------------- |
| 262 | | |
| 263 | | inline void am9517a_device::dma_advance() |
| 264 | | { |
| 265 | | bool msb_changed = false; |
| 266 | | |
| 267 | | m_channel[m_current_channel].m_count--; |
| 268 | | |
| 269 | | if (m_current_channel || !COMMAND_MEM_TO_MEM || !COMMAND_CH0_ADDRESS_HOLD) |
| 270 | | { |
| 271 | | if (MODE_ADDRESS_DECREMENT) |
| 272 | | { |
| 273 | | m_channel[m_current_channel].m_address--; |
| 274 | | |
| 275 | | if ((m_channel[m_current_channel].m_address & 0xff) == 0xff) |
| 276 | | { |
| 277 | | msb_changed = true; |
| 278 | | } |
| 279 | | } |
| 280 | | else |
| 281 | | { |
| 282 | | m_channel[m_current_channel].m_address++; |
| 283 | | |
| 284 | | if ((m_channel[m_current_channel].m_address & 0xff) == 0x00) |
| 285 | | { |
| 286 | | msb_changed = true; |
| 287 | | } |
| 288 | | } |
| 289 | | } |
| 290 | | |
| 291 | | if (m_channel[m_current_channel].m_count == 0xffff) |
| 292 | | { |
| 293 | | end_of_process(); |
| 294 | | } |
| 295 | | else |
| 296 | | { |
| 297 | | switch (MODE_MASK) |
| 298 | | { |
| 299 | | case MODE_DEMAND: |
| 300 | | if (!is_request_active(m_current_channel)) |
| 301 | | { |
| 302 | | set_hreq(0); |
| 303 | | set_dack(); |
| 304 | | m_state = STATE_SI; |
| 305 | | } |
| 306 | | else |
| 307 | | { |
| 308 | | m_state = get_state1(msb_changed); |
| 309 | | } |
| 310 | | break; |
| 311 | | |
| 312 | | case MODE_SINGLE: |
| 313 | | set_hreq(0); |
| 314 | | set_dack(); |
| 315 | | m_state = STATE_SI; |
| 316 | | break; |
| 317 | | |
| 318 | | case MODE_BLOCK: |
| 319 | | m_state = get_state1(msb_changed); |
| 320 | | break; |
| 321 | | |
| 322 | | case MODE_CASCADE: |
| 323 | | break; |
| 324 | | } |
| 325 | | } |
| 326 | | } |
| 327 | | |
| 328 | | |
| 329 | | //------------------------------------------------- |
| 330 | | // end_of_process - |
| 331 | | //------------------------------------------------- |
| 332 | | |
| 333 | | inline void am9517a_device::end_of_process() |
| 334 | | { |
| 335 | | // terminal count |
| 336 | | m_status |= 1 << m_current_channel; |
| 337 | | m_request &= ~(1 << m_current_channel); |
| 338 | | |
| 339 | | if (MODE_AUTOINITIALIZE) |
| 340 | | { |
| 341 | | // autoinitialize |
| 342 | | m_channel[m_current_channel].m_address = m_channel[m_current_channel].m_base_address; |
| 343 | | m_channel[m_current_channel].m_count = m_channel[m_current_channel].m_base_count; |
| 344 | | } |
| 345 | | else |
| 346 | | { |
| 347 | | // mask out channel |
| 348 | | m_mask |= 1 << m_current_channel; |
| 349 | | } |
| 350 | | |
| 351 | | // signal end of process |
| 352 | | set_eop(0); |
| 353 | | set_hreq(0); |
| 354 | | |
| 355 | | m_current_channel = -1; |
| 356 | | set_dack(); |
| 357 | | |
| 358 | | m_state = STATE_SI; |
| 359 | | } |
| 360 | | |
| 361 | | |
| 362 | | |
| 363 | | //************************************************************************** |
| 364 | | // LIVE DEVICE |
| 365 | | //************************************************************************** |
| 366 | | |
| 367 | | //------------------------------------------------- |
| 368 | | // am9517a_device - constructor |
| 369 | | //------------------------------------------------- |
| 370 | | |
| 371 | | am9517a_device::am9517a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 372 | | : device_t(mconfig, AM9517A, "AM9517A", tag, owner, clock), |
| 373 | | device_execute_interface(mconfig, *this), |
| 374 | | m_icount(0), |
| 375 | | m_hack(0), |
| 376 | | m_ready(1) |
| 377 | | { |
| 378 | | } |
| 379 | | |
| 380 | | |
| 381 | | //------------------------------------------------- |
| 382 | | // device_config_complete - perform any |
| 383 | | // operations now that the configuration is |
| 384 | | // complete |
| 385 | | //------------------------------------------------- |
| 386 | | |
| 387 | | void am9517a_device::device_config_complete() |
| 388 | | { |
| 389 | | // inherit a copy of the static data |
| 390 | | const am9517a_interface *intf = reinterpret_cast<const am9517a_interface *>(static_config()); |
| 391 | | if (intf != NULL) |
| 392 | | *static_cast<am9517a_interface *>(this) = *intf; |
| 393 | | |
| 394 | | // or initialize to defaults if none provided |
| 395 | | else |
| 396 | | { |
| 397 | | memset(&m_out_hreq_cb, 0, sizeof(m_out_hreq_cb)); |
| 398 | | memset(&m_out_eop_cb, 0, sizeof(m_out_eop_cb)); |
| 399 | | memset(&m_in_memr_cb, 0, sizeof(m_in_memr_cb)); |
| 400 | | memset(&m_out_memw_cb, 0, sizeof(m_out_memw_cb)); |
| 401 | | |
| 402 | | for (int i = 0; i < 4; i++) |
| 403 | | { |
| 404 | | memset(&m_in_ior_cb[i], 0, sizeof(m_in_ior_cb[i])); |
| 405 | | memset(&m_out_iow_cb[i], 0, sizeof(m_out_iow_cb[i])); |
| 406 | | memset(&m_out_dack_cb[i], 0, sizeof(m_out_dack_cb[i])); |
| 407 | | } |
| 408 | | } |
| 409 | | } |
| 410 | | |
| 411 | | |
| 412 | | //------------------------------------------------- |
| 413 | | // device_start - device-specific startup |
| 414 | | //------------------------------------------------- |
| 415 | | |
| 416 | | void am9517a_device::device_start() |
| 417 | | { |
| 418 | | // set our instruction counter |
| 419 | | m_icountptr = &m_icount; |
| 420 | | |
| 421 | | // resolve callbacks |
| 422 | | m_out_hreq_func.resolve(m_out_hreq_cb, *this); |
| 423 | | m_out_eop_func.resolve(m_out_eop_cb, *this); |
| 424 | | m_in_memr_func.resolve(m_in_memr_cb, *this); |
| 425 | | m_out_memw_func.resolve(m_out_memw_cb, *this); |
| 426 | | |
| 427 | | for (int i = 0; i < 4; i++) |
| 428 | | { |
| 429 | | m_channel[i].m_in_ior_func.resolve(m_in_ior_cb[i], *this); |
| 430 | | m_channel[i].m_out_iow_func.resolve(m_out_iow_cb[i], *this); |
| 431 | | m_channel[i].m_out_dack_func.resolve(m_out_dack_cb[i], *this); |
| 432 | | } |
| 433 | | |
| 434 | | // state saving |
| 435 | | save_item(NAME(m_state)); |
| 436 | | } |
| 437 | | |
| 438 | | |
| 439 | | //------------------------------------------------- |
| 440 | | // device_reset - device-specific reset |
| 441 | | //------------------------------------------------- |
| 442 | | |
| 443 | | void am9517a_device::device_reset() |
| 444 | | { |
| 445 | | m_state = STATE_SI; |
| 446 | | m_command = 0; |
| 447 | | m_status = 0; |
| 448 | | m_request = 0; |
| 449 | | m_mask = 0x0f; |
| 450 | | m_temp = 0; |
| 451 | | m_msb = 0; |
| 452 | | m_current_channel = -1; |
| 453 | | m_last_channel = 3; |
| 454 | | |
| 455 | | set_hreq(0); |
| 456 | | set_eop(1); |
| 457 | | |
| 458 | | set_dack(); |
| 459 | | } |
| 460 | | |
| 461 | | |
| 462 | | //------------------------------------------------- |
| 463 | | // execute_run - |
| 464 | | //------------------------------------------------- |
| 465 | | |
| 466 | | void am9517a_device::execute_run() |
| 467 | | { |
| 468 | | do |
| 469 | | { |
| 470 | | switch (m_state) |
| 471 | | { |
| 472 | | case STATE_SI: |
| 473 | | set_eop(1); |
| 474 | | |
| 475 | | if (!COMMAND_DISABLE) |
| 476 | | { |
| 477 | | int priority[] = { 0, 1, 2, 3 }; |
| 478 | | |
| 479 | | if (COMMAND_ROTATING_PRIORITY) |
| 480 | | { |
| 481 | | int last_channel = m_last_channel; |
| 482 | | |
| 483 | | for (int channel = 3; channel >= 0; channel--) |
| 484 | | { |
| 485 | | priority[channel] = last_channel; |
| 486 | | last_channel--; |
| 487 | | if (last_channel < 0) last_channel = 3; |
| 488 | | } |
| 489 | | } |
| 490 | | |
| 491 | | for (int channel = 0; channel < 4; channel++) |
| 492 | | { |
| 493 | | if (is_request_active(priority[channel]) || is_software_request_active(priority[channel])) |
| 494 | | { |
| 495 | | m_current_channel = m_last_channel = priority[channel]; |
| 496 | | m_state = STATE_S0; |
| 497 | | break; |
| 498 | | } |
| 499 | | } |
| 500 | | } |
| 501 | | break; |
| 502 | | |
| 503 | | case STATE_S0: |
| 504 | | set_hreq(1); |
| 505 | | |
| 506 | | if (m_hack) |
| 507 | | { |
| 508 | | m_state = (MODE_MASK == MODE_CASCADE) ? STATE_SC : get_state1(true); |
| 509 | | } |
| 510 | | break; |
| 511 | | |
| 512 | | case STATE_SC: |
| 513 | | if (!is_request_active(m_current_channel)) |
| 514 | | { |
| 515 | | m_current_channel = -1; |
| 516 | | m_state = STATE_SI; |
| 517 | | } |
| 518 | | |
| 519 | | set_dack(); |
| 520 | | break; |
| 521 | | |
| 522 | | case STATE_S1: |
| 523 | | m_state = STATE_S2; |
| 524 | | break; |
| 525 | | |
| 526 | | case STATE_S2: |
| 527 | | set_dack(); |
| 528 | | m_state = COMMAND_COMPRESSED_TIMING ? STATE_S4 : STATE_S3; |
| 529 | | break; |
| 530 | | |
| 531 | | case STATE_S3: |
| 532 | | dma_read(); |
| 533 | | |
| 534 | | if (COMMAND_EXTENDED_WRITE) |
| 535 | | { |
| 536 | | dma_write(); |
| 537 | | } |
| 538 | | |
| 539 | | m_state = m_ready ? STATE_S4 : STATE_SW; |
| 540 | | break; |
| 541 | | |
| 542 | | case STATE_SW: |
| 543 | | m_state = m_ready ? STATE_S4 : STATE_SW; |
| 544 | | break; |
| 545 | | |
| 546 | | case STATE_S4: |
| 547 | | if (COMMAND_COMPRESSED_TIMING) |
| 548 | | { |
| 549 | | dma_read(); |
| 550 | | dma_write(); |
| 551 | | } |
| 552 | | else if (!COMMAND_EXTENDED_WRITE) |
| 553 | | { |
| 554 | | dma_write(); |
| 555 | | } |
| 556 | | |
| 557 | | dma_advance(); |
| 558 | | break; |
| 559 | | |
| 560 | | case STATE_S11: |
| 561 | | m_current_channel = 0; |
| 562 | | |
| 563 | | m_state = STATE_S12; |
| 564 | | break; |
| 565 | | |
| 566 | | case STATE_S12: |
| 567 | | m_state = STATE_S13; |
| 568 | | break; |
| 569 | | |
| 570 | | case STATE_S13: |
| 571 | | m_state = STATE_S14; |
| 572 | | break; |
| 573 | | |
| 574 | | case STATE_S14: |
| 575 | | dma_read(); |
| 576 | | |
| 577 | | m_state = STATE_S21; |
| 578 | | break; |
| 579 | | |
| 580 | | case STATE_S21: |
| 581 | | m_current_channel = 1; |
| 582 | | |
| 583 | | m_state = STATE_S22; |
| 584 | | break; |
| 585 | | |
| 586 | | case STATE_S22: |
| 587 | | m_state = STATE_S23; |
| 588 | | break; |
| 589 | | |
| 590 | | case STATE_S23: |
| 591 | | m_state = STATE_S24; |
| 592 | | break; |
| 593 | | |
| 594 | | case STATE_S24: |
| 595 | | dma_write(); |
| 596 | | dma_advance(); |
| 597 | | break; |
| 598 | | } |
| 599 | | |
| 600 | | m_icount--; |
| 601 | | } while (m_icount > 0); |
| 602 | | } |
| 603 | | |
| 604 | | |
| 605 | | //------------------------------------------------- |
| 606 | | // read - |
| 607 | | //------------------------------------------------- |
| 608 | | |
| 609 | | READ8_MEMBER( am9517a_device::read ) |
| 610 | | { |
| 611 | | UINT8 data = 0; |
| 612 | | |
| 613 | | if (!BIT(offset, 3)) |
| 614 | | { |
| 615 | | int channel = (offset >> 1) & 0x03; |
| 616 | | |
| 617 | | switch (offset & 0x01) |
| 618 | | { |
| 619 | | case REGISTER_ADDRESS: |
| 620 | | if (m_msb) |
| 621 | | { |
| 622 | | data = m_channel[channel].m_address >> 8; |
| 623 | | } |
| 624 | | else |
| 625 | | { |
| 626 | | data = m_channel[channel].m_address & 0xff; |
| 627 | | } |
| 628 | | break; |
| 629 | | |
| 630 | | case REGISTER_WORD_COUNT: |
| 631 | | if (m_msb) |
| 632 | | { |
| 633 | | data = m_channel[channel].m_count >> 8; |
| 634 | | } |
| 635 | | else |
| 636 | | { |
| 637 | | data = m_channel[channel].m_count & 0xff; |
| 638 | | } |
| 639 | | break; |
| 640 | | } |
| 641 | | |
| 642 | | m_msb = !m_msb; |
| 643 | | } |
| 644 | | else |
| 645 | | { |
| 646 | | switch (offset & 0x0f) |
| 647 | | { |
| 648 | | case REGISTER_STATUS: |
| 649 | | data = m_status; |
| 650 | | |
| 651 | | // clear TC bits |
| 652 | | m_status &= 0x0f; |
| 653 | | break; |
| 654 | | |
| 655 | | case REGISTER_TEMPORARY: |
| 656 | | data = m_temp; |
| 657 | | break; |
| 658 | | |
| 659 | | case REGISTER_MASK: |
| 660 | | data = m_mask; |
| 661 | | break; |
| 662 | | } |
| 663 | | } |
| 664 | | |
| 665 | | return data; |
| 666 | | } |
| 667 | | |
| 668 | | |
| 669 | | //------------------------------------------------- |
| 670 | | // write - |
| 671 | | //------------------------------------------------- |
| 672 | | |
| 673 | | WRITE8_MEMBER( am9517a_device::write ) |
| 674 | | { |
| 675 | | if (!BIT(offset, 3)) |
| 676 | | { |
| 677 | | int channel = (offset >> 1) & 0x03; |
| 678 | | |
| 679 | | switch (offset & 0x01) |
| 680 | | { |
| 681 | | case REGISTER_ADDRESS: |
| 682 | | if (m_msb) |
| 683 | | { |
| 684 | | m_channel[channel].m_base_address = (data << 8) | (m_channel[channel].m_base_address & 0xff); |
| 685 | | m_channel[channel].m_address = (data << 8) | (m_channel[channel].m_address & 0xff); |
| 686 | | } |
| 687 | | else |
| 688 | | { |
| 689 | | m_channel[channel].m_base_address = (m_channel[channel].m_base_address & 0xff00) | data; |
| 690 | | m_channel[channel].m_address = (m_channel[channel].m_address & 0xff00) | data; |
| 691 | | } |
| 692 | | |
| 693 | | if (LOG) logerror("AM9517A '%s' Channel %u Base Address: %04x\n", tag(), channel, m_channel[channel].m_base_address); |
| 694 | | break; |
| 695 | | |
| 696 | | case REGISTER_WORD_COUNT: |
| 697 | | if (m_msb) |
| 698 | | { |
| 699 | | m_channel[channel].m_base_count = (data << 8) | (m_channel[channel].m_base_count & 0xff); |
| 700 | | m_channel[channel].m_count = (data << 8) | (m_channel[channel].m_count & 0xff); |
| 701 | | } |
| 702 | | else |
| 703 | | { |
| 704 | | m_channel[channel].m_base_count = (m_channel[channel].m_base_count & 0xff00) | data; |
| 705 | | m_channel[channel].m_count = (m_channel[channel].m_count & 0xff00) | data; |
| 706 | | } |
| 707 | | |
| 708 | | if (LOG) logerror("AM9517A '%s' Channel %u Base Word Count: %04x\n", tag(), channel, m_channel[channel].m_base_count); |
| 709 | | break; |
| 710 | | } |
| 711 | | |
| 712 | | m_msb = !m_msb; |
| 713 | | } |
| 714 | | else |
| 715 | | { |
| 716 | | switch (offset & 0x0f) |
| 717 | | { |
| 718 | | case REGISTER_COMMAND: |
| 719 | | m_command = data; |
| 720 | | |
| 721 | | if (LOG) logerror("AM9517A '%s' Command Register: %02x\n", tag(), m_command); |
| 722 | | break; |
| 723 | | |
| 724 | | case REGISTER_REQUEST: |
| 725 | | { |
| 726 | | int channel = data & 0x03; |
| 727 | | |
| 728 | | if (BIT(data, 2)) |
| 729 | | { |
| 730 | | m_request |= (1 << (channel + 4)); |
| 731 | | } |
| 732 | | else |
| 733 | | { |
| 734 | | m_request &= ~(1 << (channel + 4)); |
| 735 | | } |
| 736 | | |
| 737 | | if (LOG) logerror("AM9517A '%s' Request Register: %01x\n", tag(), m_request); |
| 738 | | } |
| 739 | | break; |
| 740 | | |
| 741 | | case REGISTER_SINGLE_MASK: |
| 742 | | { |
| 743 | | int channel = data & 0x03; |
| 744 | | |
| 745 | | if (BIT(data, 2)) |
| 746 | | { |
| 747 | | m_mask |= (1 << channel); |
| 748 | | } |
| 749 | | else |
| 750 | | { |
| 751 | | m_mask &= ~(1 << channel); |
| 752 | | } |
| 753 | | |
| 754 | | if (LOG) logerror("AM9517A '%s' Mask Register: %01x\n", tag(), m_mask); |
| 755 | | } |
| 756 | | break; |
| 757 | | |
| 758 | | case REGISTER_MODE: |
| 759 | | { |
| 760 | | int channel = data & 0x03; |
| 761 | | |
| 762 | | m_channel[channel].m_mode = data & 0xfc; |
| 763 | | |
| 764 | | // clear terminal count |
| 765 | | m_status &= ~(1 << channel); |
| 766 | | |
| 767 | | if (LOG) logerror("AM9517A '%s' Channel %u Mode: %02x\n", tag(), channel, data & 0xfc); |
| 768 | | } |
| 769 | | break; |
| 770 | | |
| 771 | | case REGISTER_BYTE_POINTER: |
| 772 | | if (LOG) logerror("AM9517A '%s' Clear Byte Pointer Flip-Flop\n", tag()); |
| 773 | | |
| 774 | | m_msb = 0; |
| 775 | | break; |
| 776 | | |
| 777 | | case REGISTER_MASTER_CLEAR: |
| 778 | | if (LOG) logerror("AM9517A '%s' Master Clear\n", tag()); |
| 779 | | |
| 780 | | device_reset(); |
| 781 | | break; |
| 782 | | |
| 783 | | case REGISTER_CLEAR_MASK: |
| 784 | | if (LOG) logerror("AM9517A '%s' Clear Mask Register\n", tag()); |
| 785 | | |
| 786 | | m_mask = 0; |
| 787 | | break; |
| 788 | | |
| 789 | | case REGISTER_MASK: |
| 790 | | m_mask = data & 0x0f; |
| 791 | | |
| 792 | | if (LOG) logerror("AM9517A '%s' Mask Register: %01x\n", tag(), m_mask); |
| 793 | | break; |
| 794 | | } |
| 795 | | } |
| 796 | | } |
| 797 | | |
| 798 | | |
| 799 | | //------------------------------------------------- |
| 800 | | // hack_w - hold acknowledge |
| 801 | | //------------------------------------------------- |
| 802 | | |
| 803 | | WRITE_LINE_MEMBER( am9517a_device::hack_w ) |
| 804 | | { |
| 805 | | if (LOG) logerror("AM9517A '%s' Hold Acknowledge: %u\n", tag(), state); |
| 806 | | |
| 807 | | m_hack = state; |
| 808 | | } |
| 809 | | |
| 810 | | |
| 811 | | //------------------------------------------------- |
| 812 | | // ready_w - ready |
| 813 | | //------------------------------------------------- |
| 814 | | |
| 815 | | WRITE_LINE_MEMBER( am9517a_device::ready_w ) |
| 816 | | { |
| 817 | | if (LOG) logerror("AM9517A '%s' Ready: %u\n", tag(), state); |
| 818 | | |
| 819 | | m_ready = state; |
| 820 | | } |
| 821 | | |
| 822 | | |
| 823 | | //------------------------------------------------- |
| 824 | | // eop_w - end of process |
| 825 | | //------------------------------------------------- |
| 826 | | |
| 827 | | WRITE_LINE_MEMBER( am9517a_device::eop_w ) |
| 828 | | { |
| 829 | | if (LOG) logerror("AM9517A '%s' End of Process: %u\n", tag(), state); |
| 830 | | } |
| 831 | | |
| 832 | | |
| 833 | | //------------------------------------------------- |
| 834 | | // dreq0_w - DMA request for channel 0 |
| 835 | | //------------------------------------------------- |
| 836 | | |
| 837 | | WRITE_LINE_MEMBER( am9517a_device::dreq0_w ) |
| 838 | | { |
| 839 | | dma_request(0, state); |
| 840 | | } |
| 841 | | |
| 842 | | |
| 843 | | //------------------------------------------------- |
| 844 | | // dreq0_w - DMA request for channel 1 |
| 845 | | //------------------------------------------------- |
| 846 | | |
| 847 | | WRITE_LINE_MEMBER( am9517a_device::dreq1_w ) |
| 848 | | { |
| 849 | | dma_request(1, state); |
| 850 | | } |
| 851 | | |
| 852 | | |
| 853 | | //------------------------------------------------- |
| 854 | | // dreq1_w - DMA request for channel 2 |
| 855 | | //------------------------------------------------- |
| 856 | | |
| 857 | | WRITE_LINE_MEMBER( am9517a_device::dreq2_w ) |
| 858 | | { |
| 859 | | dma_request(2, state); |
| 860 | | } |
| 861 | | |
| 862 | | |
| 863 | | //------------------------------------------------- |
| 864 | | // dreq3_w - DMA request for channel 3 |
| 865 | | //------------------------------------------------- |
| 866 | | |
| 867 | | WRITE_LINE_MEMBER( am9517a_device::dreq3_w ) |
| 868 | | { |
| 869 | | dma_request(3, state); |
| 870 | | } |
| 1 | /***************************************************************************
|
| 2 | |
| 3 | AMD AM9517A/8237A Multimode DMA Controller emulation
|
| 4 | |
| 5 | Copyright the MESS Team.
|
| 6 | Visit http://mamedev.org for licensing and usage restrictions.
|
| 7 | |
| 8 | ***************************************************************************/
|
| 9 | |
| 10 | /*
|
| 11 | |
| 12 | TODO:
|
| 13 | |
| 14 | - memory-to-memory transfer
|
| 15 | - external EOP
|
| 16 | |
| 17 | */
|
| 18 | |
| 19 | #include "am9517a.h"
|
| 20 | |
| 21 | |
| 22 | |
| 23 | //**************************************************************************
|
| 24 | // DEVICE DEFINITIONS
|
| 25 | //**************************************************************************
|
| 26 | |
| 27 | const device_type AM9517A = &device_creator<am9517a_device>;
|
| 28 | |
| 29 | |
| 30 | |
| 31 | //**************************************************************************
|
| 32 | // MACROS / CONSTANTS
|
| 33 | //**************************************************************************
|
| 34 | |
| 35 | #define LOG 0
|
| 36 | |
| 37 | |
| 38 | enum
|
| 39 | {
|
| 40 | REGISTER_ADDRESS = 0,
|
| 41 | REGISTER_WORD_COUNT,
|
| 42 | REGISTER_STATUS = 8,
|
| 43 | REGISTER_COMMAND = REGISTER_STATUS,
|
| 44 | REGISTER_REQUEST,
|
| 45 | REGISTER_SINGLE_MASK,
|
| 46 | REGISTER_MODE,
|
| 47 | REGISTER_BYTE_POINTER,
|
| 48 | REGISTER_TEMPORARY,
|
| 49 | REGISTER_MASTER_CLEAR = REGISTER_TEMPORARY,
|
| 50 | REGISTER_CLEAR_MASK,
|
| 51 | REGISTER_MASK
|
| 52 | };
|
| 53 | |
| 54 | |
| 55 | #define COMMAND_MEM_TO_MEM BIT(m_command, 0)
|
| 56 | #define COMMAND_CH0_ADDRESS_HOLD BIT(m_command, 1)
|
| 57 | #define COMMAND_DISABLE BIT(m_command, 2)
|
| 58 | #define COMMAND_COMPRESSED_TIMING BIT(m_command, 3)
|
| 59 | #define COMMAND_ROTATING_PRIORITY BIT(m_command, 4)
|
| 60 | #define COMMAND_EXTENDED_WRITE BIT(m_command, 5)
|
| 61 | #define COMMAND_DREQ_ACTIVE_LOW BIT(m_command, 6)
|
| 62 | #define COMMAND_DACK_ACTIVE_HIGH BIT(m_command, 7)
|
| 63 | |
| 64 | |
| 65 | #define MODE_TRANSFER_MASK (m_channel[m_current_channel].m_mode & 0x0c)
|
| 66 | #define MODE_TRANSFER_VERIFY 0x00
|
| 67 | #define MODE_TRANSFER_WRITE 0x04
|
| 68 | #define MODE_TRANSFER_READ 0x08
|
| 69 | #define MODE_TRANSFER_ILLEGAL 0x0c
|
| 70 | #define MODE_AUTOINITIALIZE BIT(m_channel[m_current_channel].m_mode, 4)
|
| 71 | #define MODE_ADDRESS_DECREMENT BIT(m_channel[m_current_channel].m_mode, 5)
|
| 72 | #define MODE_MASK (m_channel[m_current_channel].m_mode & 0xc0)
|
| 73 | #define MODE_DEMAND 0x00
|
| 74 | #define MODE_SINGLE 0x40
|
| 75 | #define MODE_BLOCK 0x80
|
| 76 | #define MODE_CASCADE 0xc0
|
| 77 | |
| 78 | |
| 79 | enum
|
| 80 | {
|
| 81 | STATE_SI,
|
| 82 | STATE_S0,
|
| 83 | STATE_SC,
|
| 84 | STATE_S1,
|
| 85 | STATE_S2,
|
| 86 | STATE_S3,
|
| 87 | STATE_SW,
|
| 88 | STATE_S4,
|
| 89 | STATE_S11,
|
| 90 | STATE_S12,
|
| 91 | STATE_S13,
|
| 92 | STATE_S14,
|
| 93 | STATE_S21,
|
| 94 | STATE_S22,
|
| 95 | STATE_S23,
|
| 96 | STATE_S24
|
| 97 | };
|
| 98 | |
| 99 | |
| 100 | |
| 101 | //**************************************************************************
|
| 102 | // INLINE HELPERS
|
| 103 | //**************************************************************************
|
| 104 | |
| 105 | //-------------------------------------------------
|
| 106 | // dma_request -
|
| 107 | //-------------------------------------------------
|
| 108 | |
| 109 | inline void am9517a_device::dma_request(int channel, int state)
|
| 110 | {
|
| 111 | if (LOG) logerror("AM9517A '%s' Channel %u DMA Request: %u\n", tag(), channel, state);
|
| 112 | |
| 113 | if (state ^ COMMAND_DREQ_ACTIVE_LOW)
|
| 114 | {
|
| 115 | m_status |= (1 << (channel + 4));
|
| 116 | }
|
| 117 | else
|
| 118 | {
|
| 119 | m_status &= ~(1 << (channel + 4));
|
| 120 | }
|
| 121 | }
|
| 122 | |
| 123 | |
| 124 | //-------------------------------------------------
|
| 125 | // is_request_active -
|
| 126 | //-------------------------------------------------
|
| 127 | |
| 128 | inline bool am9517a_device::is_request_active(int channel)
|
| 129 | {
|
| 130 | return (BIT(m_status, channel + 4) & !BIT(m_mask, channel)) ? true : false;
|
| 131 | }
|
| 132 | |
| 133 | |
| 134 | //-------------------------------------------------
|
| 135 | // is_software_request_active -
|
| 136 | //-------------------------------------------------
|
| 137 | |
| 138 | inline bool am9517a_device::is_software_request_active(int channel)
|
| 139 | {
|
| 140 | return BIT(m_request, channel) && ((m_channel[channel].m_mode & 0xc0) == MODE_BLOCK);
|
| 141 | }
|
| 142 | |
| 143 | |
| 144 | //-------------------------------------------------
|
| 145 | // set_hreq -
|
| 146 | //-------------------------------------------------
|
| 147 | |
| 148 | inline void am9517a_device::set_hreq(int state)
|
| 149 | {
|
| 150 | if (m_hreq != state)
|
| 151 | {
|
| 152 | m_out_hreq_func(state);
|
| 153 | |
| 154 | m_hreq = state;
|
| 155 | }
|
| 156 | }
|
| 157 | |
| 158 | |
| 159 | //-------------------------------------------------
|
| 160 | // set_dack -
|
| 161 | //-------------------------------------------------
|
| 162 | |
| 163 | inline void am9517a_device::set_dack()
|
| 164 | {
|
| 165 | for (int channel = 0; channel < 4; channel++)
|
| 166 | {
|
| 167 | if ((channel == m_current_channel) && !COMMAND_MEM_TO_MEM)
|
| 168 | {
|
| 169 | m_channel[channel].m_out_dack_func(COMMAND_DACK_ACTIVE_HIGH);
|
| 170 | }
|
| 171 | else
|
| 172 | {
|
| 173 | m_channel[channel].m_out_dack_func(!COMMAND_DACK_ACTIVE_HIGH);
|
| 174 | }
|
| 175 | }
|
| 176 | }
|
| 177 | |
| 178 | |
| 179 | //-------------------------------------------------
|
| 180 | // set_eop -
|
| 181 | //-------------------------------------------------
|
| 182 | |
| 183 | inline void am9517a_device::set_eop(int state)
|
| 184 | {
|
| 185 | if (m_eop != state)
|
| 186 | {
|
| 187 | m_out_eop_func(state);
|
| 188 | |
| 189 | m_eop = state;
|
| 190 | }
|
| 191 | }
|
| 192 | |
| 193 | |
| 194 | //-------------------------------------------------
|
| 195 | // dma_read -
|
| 196 | //-------------------------------------------------
|
| 197 | |
| 198 | inline int am9517a_device::get_state1(bool msb_changed)
|
| 199 | {
|
| 200 | if (COMMAND_MEM_TO_MEM)
|
| 201 | {
|
| 202 | return msb_changed ? STATE_S11 : STATE_S12;
|
| 203 | }
|
| 204 | else
|
| 205 | {
|
| 206 | return msb_changed ? STATE_S1 : STATE_S2;
|
| 207 | }
|
| 208 | }
|
| 209 | |
| 210 | |
| 211 | //-------------------------------------------------
|
| 212 | // dma_read -
|
| 213 | //-------------------------------------------------
|
| 214 | |
| 215 | inline void am9517a_device::dma_read()
|
| 216 | {
|
| 217 | offs_t offset = m_channel[m_current_channel].m_address;
|
| 218 | |
| 219 | switch (MODE_TRANSFER_MASK)
|
| 220 | {
|
| 221 | case MODE_TRANSFER_VERIFY:
|
| 222 | break;
|
| 223 | |
| 224 | case MODE_TRANSFER_WRITE:
|
| 225 | m_temp = m_channel[m_current_channel].m_in_ior_func(offset);
|
| 226 | break;
|
| 227 | |
| 228 | case MODE_TRANSFER_READ:
|
| 229 | m_temp = m_in_memr_func(offset);
|
| 230 | break;
|
| 231 | }
|
| 232 | }
|
| 233 | |
| 234 | |
| 235 | //-------------------------------------------------
|
| 236 | // dma_write -
|
| 237 | //-------------------------------------------------
|
| 238 | |
| 239 | inline void am9517a_device::dma_write()
|
| 240 | {
|
| 241 | offs_t offset = m_channel[m_current_channel].m_address;
|
| 242 | |
| 243 | switch (MODE_TRANSFER_MASK)
|
| 244 | {
|
| 245 | case MODE_TRANSFER_VERIFY:
|
| 246 | break;
|
| 247 | |
| 248 | case MODE_TRANSFER_WRITE:
|
| 249 | m_out_memw_func(offset, m_temp);
|
| 250 | break;
|
| 251 | |
| 252 | case MODE_TRANSFER_READ:
|
| 253 | m_channel[m_current_channel].m_out_iow_func(offset, m_temp);
|
| 254 | break;
|
| 255 | }
|
| 256 | }
|
| 257 | |
| 258 | |
| 259 | //-------------------------------------------------
|
| 260 | // dma_advance -
|
| 261 | //-------------------------------------------------
|
| 262 | |
| 263 | inline void am9517a_device::dma_advance()
|
| 264 | {
|
| 265 | bool msb_changed = false;
|
| 266 | |
| 267 | m_channel[m_current_channel].m_count--;
|
| 268 | |
| 269 | if (m_current_channel || !COMMAND_MEM_TO_MEM || !COMMAND_CH0_ADDRESS_HOLD)
|
| 270 | {
|
| 271 | if (MODE_ADDRESS_DECREMENT)
|
| 272 | {
|
| 273 | m_channel[m_current_channel].m_address--;
|
| 274 |
|
| 275 | if ((m_channel[m_current_channel].m_address & 0xff) == 0xff)
|
| 276 | {
|
| 277 | msb_changed = true;
|
| 278 | }
|
| 279 | }
|
| 280 | else
|
| 281 | {
|
| 282 | m_channel[m_current_channel].m_address++;
|
| 283 |
|
| 284 | if ((m_channel[m_current_channel].m_address & 0xff) == 0x00)
|
| 285 | {
|
| 286 | msb_changed = true;
|
| 287 | }
|
| 288 | }
|
| 289 | }
|
| 290 | |
| 291 | if (m_channel[m_current_channel].m_count == 0xffff)
|
| 292 | {
|
| 293 | end_of_process();
|
| 294 | }
|
| 295 | else
|
| 296 | {
|
| 297 | switch (MODE_MASK)
|
| 298 | {
|
| 299 | case MODE_DEMAND:
|
| 300 | if (!is_request_active(m_current_channel))
|
| 301 | {
|
| 302 | set_hreq(0);
|
| 303 | set_dack();
|
| 304 | m_state = STATE_SI;
|
| 305 | }
|
| 306 | else
|
| 307 | {
|
| 308 | m_state = get_state1(msb_changed);
|
| 309 | }
|
| 310 | break;
|
| 311 | |
| 312 | case MODE_SINGLE:
|
| 313 | set_hreq(0);
|
| 314 | set_dack();
|
| 315 | m_state = STATE_SI;
|
| 316 | break;
|
| 317 |
|
| 318 | case MODE_BLOCK:
|
| 319 | m_state = get_state1(msb_changed);
|
| 320 | break;
|
| 321 |
|
| 322 | case MODE_CASCADE:
|
| 323 | break;
|
| 324 | }
|
| 325 | }
|
| 326 | }
|
| 327 | |
| 328 | |
| 329 | //-------------------------------------------------
|
| 330 | // end_of_process -
|
| 331 | //-------------------------------------------------
|
| 332 | |
| 333 | inline void am9517a_device::end_of_process()
|
| 334 | {
|
| 335 | // terminal count
|
| 336 | m_status |= 1 << m_current_channel;
|
| 337 | m_request &= ~(1 << m_current_channel);
|
| 338 | |
| 339 | if (MODE_AUTOINITIALIZE)
|
| 340 | {
|
| 341 | // autoinitialize
|
| 342 | m_channel[m_current_channel].m_address = m_channel[m_current_channel].m_base_address;
|
| 343 | m_channel[m_current_channel].m_count = m_channel[m_current_channel].m_base_count;
|
| 344 | }
|
| 345 | else
|
| 346 | {
|
| 347 | // mask out channel
|
| 348 | m_mask |= 1 << m_current_channel;
|
| 349 | }
|
| 350 | |
| 351 | // signal end of process
|
| 352 | set_eop(0);
|
| 353 | set_hreq(0);
|
| 354 | |
| 355 | m_current_channel = -1;
|
| 356 | set_dack();
|
| 357 | |
| 358 | m_state = STATE_SI;
|
| 359 | }
|
| 360 | |
| 361 | |
| 362 | |
| 363 | //**************************************************************************
|
| 364 | // LIVE DEVICE
|
| 365 | //**************************************************************************
|
| 366 | |
| 367 | //-------------------------------------------------
|
| 368 | // am9517a_device - constructor
|
| 369 | //-------------------------------------------------
|
| 370 | |
| 371 | am9517a_device::am9517a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
| 372 | : device_t(mconfig, AM9517A, "AM9517A", tag, owner, clock),
|
| 373 | device_execute_interface(mconfig, *this),
|
| 374 | m_icount(0),
|
| 375 | m_hack(0),
|
| 376 | m_ready(1)
|
| 377 | {
|
| 378 | }
|
| 379 | |
| 380 | |
| 381 | //-------------------------------------------------
|
| 382 | // device_config_complete - perform any
|
| 383 | // operations now that the configuration is
|
| 384 | // complete
|
| 385 | //-------------------------------------------------
|
| 386 | |
| 387 | void am9517a_device::device_config_complete()
|
| 388 | {
|
| 389 | // inherit a copy of the static data
|
| 390 | const am9517a_interface *intf = reinterpret_cast<const am9517a_interface *>(static_config());
|
| 391 | if (intf != NULL)
|
| 392 | *static_cast<am9517a_interface *>(this) = *intf;
|
| 393 | |
| 394 | // or initialize to defaults if none provided
|
| 395 | else
|
| 396 | {
|
| 397 | memset(&m_out_hreq_cb, 0, sizeof(m_out_hreq_cb));
|
| 398 | memset(&m_out_eop_cb, 0, sizeof(m_out_eop_cb));
|
| 399 | memset(&m_in_memr_cb, 0, sizeof(m_in_memr_cb));
|
| 400 | memset(&m_out_memw_cb, 0, sizeof(m_out_memw_cb));
|
| 401 | |
| 402 | for (int i = 0; i < 4; i++)
|
| 403 | {
|
| 404 | memset(&m_in_ior_cb[i], 0, sizeof(m_in_ior_cb[i]));
|
| 405 | memset(&m_out_iow_cb[i], 0, sizeof(m_out_iow_cb[i]));
|
| 406 | memset(&m_out_dack_cb[i], 0, sizeof(m_out_dack_cb[i]));
|
| 407 | }
|
| 408 | }
|
| 409 | }
|
| 410 | |
| 411 | |
| 412 | //-------------------------------------------------
|
| 413 | // device_start - device-specific startup
|
| 414 | //-------------------------------------------------
|
| 415 | |
| 416 | void am9517a_device::device_start()
|
| 417 | {
|
| 418 | // set our instruction counter
|
| 419 | m_icountptr = &m_icount;
|
| 420 | |
| 421 | // resolve callbacks
|
| 422 | m_out_hreq_func.resolve(m_out_hreq_cb, *this);
|
| 423 | m_out_eop_func.resolve(m_out_eop_cb, *this);
|
| 424 | m_in_memr_func.resolve(m_in_memr_cb, *this);
|
| 425 | m_out_memw_func.resolve(m_out_memw_cb, *this);
|
| 426 | |
| 427 | for (int i = 0; i < 4; i++)
|
| 428 | {
|
| 429 | m_channel[i].m_in_ior_func.resolve(m_in_ior_cb[i], *this);
|
| 430 | m_channel[i].m_out_iow_func.resolve(m_out_iow_cb[i], *this);
|
| 431 | m_channel[i].m_out_dack_func.resolve(m_out_dack_cb[i], *this);
|
| 432 | }
|
| 433 | |
| 434 | // state saving
|
| 435 | save_item(NAME(m_state));
|
| 436 | }
|
| 437 | |
| 438 | |
| 439 | //-------------------------------------------------
|
| 440 | // device_reset - device-specific reset
|
| 441 | //-------------------------------------------------
|
| 442 | |
| 443 | void am9517a_device::device_reset()
|
| 444 | {
|
| 445 | m_state = STATE_SI;
|
| 446 | m_command = 0;
|
| 447 | m_status = 0;
|
| 448 | m_request = 0;
|
| 449 | m_mask = 0x0f;
|
| 450 | m_temp = 0;
|
| 451 | m_msb = 0;
|
| 452 | m_current_channel = -1;
|
| 453 | m_last_channel = 3;
|
| 454 | |
| 455 | set_hreq(0);
|
| 456 | set_eop(1);
|
| 457 | |
| 458 | set_dack();
|
| 459 | }
|
| 460 | |
| 461 | |
| 462 | //-------------------------------------------------
|
| 463 | // execute_run -
|
| 464 | //-------------------------------------------------
|
| 465 | |
| 466 | void am9517a_device::execute_run()
|
| 467 | {
|
| 468 | do
|
| 469 | {
|
| 470 | switch (m_state)
|
| 471 | {
|
| 472 | case STATE_SI:
|
| 473 | set_eop(1);
|
| 474 | |
| 475 | if (!COMMAND_DISABLE)
|
| 476 | {
|
| 477 | int priority[] = { 0, 1, 2, 3 };
|
| 478 | |
| 479 | if (COMMAND_ROTATING_PRIORITY)
|
| 480 | {
|
| 481 | int last_channel = m_last_channel;
|
| 482 | |
| 483 | for (int channel = 3; channel >= 0; channel--)
|
| 484 | {
|
| 485 | priority[channel] = last_channel;
|
| 486 | last_channel--;
|
| 487 | if (last_channel < 0) last_channel = 3;
|
| 488 | }
|
| 489 | }
|
| 490 | |
| 491 | for (int channel = 0; channel < 4; channel++)
|
| 492 | {
|
| 493 | if (is_request_active(priority[channel]) || is_software_request_active(priority[channel]))
|
| 494 | {
|
| 495 | m_current_channel = m_last_channel = priority[channel];
|
| 496 | m_state = STATE_S0;
|
| 497 | break;
|
| 498 | }
|
| 499 | }
|
| 500 | }
|
| 501 | break;
|
| 502 | |
| 503 | case STATE_S0:
|
| 504 | set_hreq(1);
|
| 505 | |
| 506 | if (m_hack)
|
| 507 | {
|
| 508 | m_state = (MODE_MASK == MODE_CASCADE) ? STATE_SC : get_state1(true);
|
| 509 | }
|
| 510 | break;
|
| 511 | |
| 512 | case STATE_SC:
|
| 513 | if (!is_request_active(m_current_channel))
|
| 514 | {
|
| 515 | m_current_channel = -1;
|
| 516 | m_state = STATE_SI;
|
| 517 | } |
| 518 | |
| 519 | set_dack();
|
| 520 | break;
|
| 521 | |
| 522 | case STATE_S1:
|
| 523 | m_state = STATE_S2;
|
| 524 | break;
|
| 525 | |
| 526 | case STATE_S2:
|
| 527 | set_dack();
|
| 528 | m_state = COMMAND_COMPRESSED_TIMING ? STATE_S4 : STATE_S3;
|
| 529 | break;
|
| 530 |
|
| 531 | case STATE_S3:
|
| 532 | dma_read();
|
| 533 | |
| 534 | if (COMMAND_EXTENDED_WRITE)
|
| 535 | {
|
| 536 | dma_write();
|
| 537 | }
|
| 538 | |
| 539 | m_state = m_ready ? STATE_S4 : STATE_SW;
|
| 540 | break;
|
| 541 | |
| 542 | case STATE_SW:
|
| 543 | m_state = m_ready ? STATE_S4 : STATE_SW;
|
| 544 | break;
|
| 545 |
|
| 546 | case STATE_S4:
|
| 547 | if (COMMAND_COMPRESSED_TIMING)
|
| 548 | {
|
| 549 | dma_read();
|
| 550 | dma_write();
|
| 551 | }
|
| 552 | else if (!COMMAND_EXTENDED_WRITE)
|
| 553 | {
|
| 554 | dma_write();
|
| 555 | }
|
| 556 | |
| 557 | dma_advance();
|
| 558 | break;
|
| 559 |
|
| 560 | case STATE_S11:
|
| 561 | m_current_channel = 0;
|
| 562 | |
| 563 | m_state = STATE_S12;
|
| 564 | break;
|
| 565 | |
| 566 | case STATE_S12:
|
| 567 | m_state = STATE_S13;
|
| 568 | break;
|
| 569 | |
| 570 | case STATE_S13:
|
| 571 | m_state = STATE_S14;
|
| 572 | break;
|
| 573 |
|
| 574 | case STATE_S14:
|
| 575 | dma_read();
|
| 576 | |
| 577 | m_state = STATE_S21;
|
| 578 | break;
|
| 579 |
|
| 580 | case STATE_S21:
|
| 581 | m_current_channel = 1;
|
| 582 | |
| 583 | m_state = STATE_S22;
|
| 584 | break;
|
| 585 |
|
| 586 | case STATE_S22:
|
| 587 | m_state = STATE_S23;
|
| 588 | break;
|
| 589 |
|
| 590 | case STATE_S23:
|
| 591 | m_state = STATE_S24;
|
| 592 | break;
|
| 593 |
|
| 594 | case STATE_S24:
|
| 595 | dma_write();
|
| 596 | dma_advance();
|
| 597 | break;
|
| 598 | }
|
| 599 | |
| 600 | m_icount--;
|
| 601 | } while (m_icount > 0);
|
| 602 | }
|
| 603 | |
| 604 | |
| 605 | //-------------------------------------------------
|
| 606 | // read - |
| 607 | //-------------------------------------------------
|
| 608 | |
| 609 | READ8_MEMBER( am9517a_device::read )
|
| 610 | {
|
| 611 | UINT8 data = 0;
|
| 612 | |
| 613 | if (!BIT(offset, 3))
|
| 614 | {
|
| 615 | int channel = (offset >> 1) & 0x03;
|
| 616 | |
| 617 | switch (offset & 0x01)
|
| 618 | {
|
| 619 | case REGISTER_ADDRESS:
|
| 620 | if (m_msb)
|
| 621 | {
|
| 622 | data = m_channel[channel].m_address >> 8;
|
| 623 | }
|
| 624 | else
|
| 625 | {
|
| 626 | data = m_channel[channel].m_address & 0xff;
|
| 627 | }
|
| 628 | break;
|
| 629 | |
| 630 | case REGISTER_WORD_COUNT:
|
| 631 | if (m_msb)
|
| 632 | {
|
| 633 | data = m_channel[channel].m_count >> 8;
|
| 634 | }
|
| 635 | else
|
| 636 | {
|
| 637 | data = m_channel[channel].m_count & 0xff;
|
| 638 | }
|
| 639 | break;
|
| 640 | }
|
| 641 | |
| 642 | m_msb = !m_msb;
|
| 643 | }
|
| 644 | else
|
| 645 | {
|
| 646 | switch (offset & 0x0f)
|
| 647 | {
|
| 648 | case REGISTER_STATUS:
|
| 649 | data = m_status;
|
| 650 | |
| 651 | // clear TC bits
|
| 652 | m_status &= 0x0f;
|
| 653 | break;
|
| 654 | |
| 655 | case REGISTER_TEMPORARY:
|
| 656 | data = m_temp;
|
| 657 | break;
|
| 658 | |
| 659 | case REGISTER_MASK:
|
| 660 | data = m_mask;
|
| 661 | break;
|
| 662 | }
|
| 663 | }
|
| 664 | |
| 665 | return data;
|
| 666 | }
|
| 667 | |
| 668 | |
| 669 | //-------------------------------------------------
|
| 670 | // write - |
| 671 | //-------------------------------------------------
|
| 672 | |
| 673 | WRITE8_MEMBER( am9517a_device::write )
|
| 674 | {
|
| 675 | if (!BIT(offset, 3))
|
| 676 | {
|
| 677 | int channel = (offset >> 1) & 0x03;
|
| 678 | |
| 679 | switch (offset & 0x01)
|
| 680 | {
|
| 681 | case REGISTER_ADDRESS:
|
| 682 | if (m_msb)
|
| 683 | {
|
| 684 | m_channel[channel].m_base_address = (data << 8) | (m_channel[channel].m_base_address & 0xff);
|
| 685 | m_channel[channel].m_address = (data << 8) | (m_channel[channel].m_address & 0xff);
|
| 686 | }
|
| 687 | else
|
| 688 | {
|
| 689 | m_channel[channel].m_base_address = (m_channel[channel].m_base_address & 0xff00) | data;
|
| 690 | m_channel[channel].m_address = (m_channel[channel].m_address & 0xff00) | data;
|
| 691 | }
|
| 692 | |
| 693 | if (LOG) logerror("AM9517A '%s' Channel %u Base Address: %04x\n", tag(), channel, m_channel[channel].m_base_address);
|
| 694 | break;
|
| 695 | |
| 696 | case REGISTER_WORD_COUNT:
|
| 697 | if (m_msb)
|
| 698 | {
|
| 699 | m_channel[channel].m_base_count = (data << 8) | (m_channel[channel].m_base_count & 0xff);
|
| 700 | m_channel[channel].m_count = (data << 8) | (m_channel[channel].m_count & 0xff);
|
| 701 | }
|
| 702 | else
|
| 703 | {
|
| 704 | m_channel[channel].m_base_count = (m_channel[channel].m_base_count & 0xff00) | data;
|
| 705 | m_channel[channel].m_count = (m_channel[channel].m_count & 0xff00) | data;
|
| 706 | }
|
| 707 | |
| 708 | if (LOG) logerror("AM9517A '%s' Channel %u Base Word Count: %04x\n", tag(), channel, m_channel[channel].m_base_count);
|
| 709 | break;
|
| 710 | }
|
| 711 | |
| 712 | m_msb = !m_msb;
|
| 713 | }
|
| 714 | else
|
| 715 | {
|
| 716 | switch (offset & 0x0f)
|
| 717 | {
|
| 718 | case REGISTER_COMMAND:
|
| 719 | m_command = data;
|
| 720 | |
| 721 | if (LOG) logerror("AM9517A '%s' Command Register: %02x\n", tag(), m_command);
|
| 722 | break;
|
| 723 | |
| 724 | case REGISTER_REQUEST:
|
| 725 | {
|
| 726 | int channel = data & 0x03;
|
| 727 | |
| 728 | if (BIT(data, 2))
|
| 729 | {
|
| 730 | m_request |= (1 << (channel + 4));
|
| 731 | }
|
| 732 | else
|
| 733 | {
|
| 734 | m_request &= ~(1 << (channel + 4));
|
| 735 | }
|
| 736 | |
| 737 | if (LOG) logerror("AM9517A '%s' Request Register: %01x\n", tag(), m_request);
|
| 738 | }
|
| 739 | break;
|
| 740 |
|
| 741 | case REGISTER_SINGLE_MASK:
|
| 742 | {
|
| 743 | int channel = data & 0x03;
|
| 744 | |
| 745 | if (BIT(data, 2))
|
| 746 | {
|
| 747 | m_mask |= (1 << channel);
|
| 748 | }
|
| 749 | else
|
| 750 | {
|
| 751 | m_mask &= ~(1 << channel);
|
| 752 | }
|
| 753 | |
| 754 | if (LOG) logerror("AM9517A '%s' Mask Register: %01x\n", tag(), m_mask);
|
| 755 | }
|
| 756 | break;
|
| 757 |
|
| 758 | case REGISTER_MODE:
|
| 759 | {
|
| 760 | int channel = data & 0x03;
|
| 761 | |
| 762 | m_channel[channel].m_mode = data & 0xfc;
|
| 763 | |
| 764 | // clear terminal count
|
| 765 | m_status &= ~(1 << channel);
|
| 766 | |
| 767 | if (LOG) logerror("AM9517A '%s' Channel %u Mode: %02x\n", tag(), channel, data & 0xfc);
|
| 768 | }
|
| 769 | break;
|
| 770 |
|
| 771 | case REGISTER_BYTE_POINTER:
|
| 772 | if (LOG) logerror("AM9517A '%s' Clear Byte Pointer Flip-Flop\n", tag());
|
| 773 | |
| 774 | m_msb = 0;
|
| 775 | break;
|
| 776 |
|
| 777 | case REGISTER_MASTER_CLEAR:
|
| 778 | if (LOG) logerror("AM9517A '%s' Master Clear\n", tag());
|
| 779 |
|
| 780 | device_reset();
|
| 781 | break;
|
| 782 |
|
| 783 | case REGISTER_CLEAR_MASK:
|
| 784 | if (LOG) logerror("AM9517A '%s' Clear Mask Register\n", tag());
|
| 785 | |
| 786 | m_mask = 0;
|
| 787 | break;
|
| 788 |
|
| 789 | case REGISTER_MASK:
|
| 790 | m_mask = data & 0x0f;
|
| 791 | |
| 792 | if (LOG) logerror("AM9517A '%s' Mask Register: %01x\n", tag(), m_mask);
|
| 793 | break;
|
| 794 | }
|
| 795 | }
|
| 796 | }
|
| 797 | |
| 798 | |
| 799 | //-------------------------------------------------
|
| 800 | // hack_w - hold acknowledge
|
| 801 | //-------------------------------------------------
|
| 802 | |
| 803 | WRITE_LINE_MEMBER( am9517a_device::hack_w )
|
| 804 | {
|
| 805 | if (LOG) logerror("AM9517A '%s' Hold Acknowledge: %u\n", tag(), state);
|
| 806 | |
| 807 | m_hack = state;
|
| 808 | }
|
| 809 | |
| 810 | |
| 811 | //-------------------------------------------------
|
| 812 | // ready_w - ready
|
| 813 | //-------------------------------------------------
|
| 814 | |
| 815 | WRITE_LINE_MEMBER( am9517a_device::ready_w )
|
| 816 | {
|
| 817 | if (LOG) logerror("AM9517A '%s' Ready: %u\n", tag(), state);
|
| 818 | |
| 819 | m_ready = state;
|
| 820 | }
|
| 821 | |
| 822 | |
| 823 | //-------------------------------------------------
|
| 824 | // eop_w - end of process
|
| 825 | //-------------------------------------------------
|
| 826 | |
| 827 | WRITE_LINE_MEMBER( am9517a_device::eop_w )
|
| 828 | {
|
| 829 | if (LOG) logerror("AM9517A '%s' End of Process: %u\n", tag(), state);
|
| 830 | }
|
| 831 | |
| 832 | |
| 833 | //-------------------------------------------------
|
| 834 | // dreq0_w - DMA request for channel 0
|
| 835 | //-------------------------------------------------
|
| 836 | |
| 837 | WRITE_LINE_MEMBER( am9517a_device::dreq0_w )
|
| 838 | {
|
| 839 | dma_request(0, state);
|
| 840 | }
|
| 841 | |
| 842 | |
| 843 | //-------------------------------------------------
|
| 844 | // dreq0_w - DMA request for channel 1
|
| 845 | //-------------------------------------------------
|
| 846 | |
| 847 | WRITE_LINE_MEMBER( am9517a_device::dreq1_w )
|
| 848 | {
|
| 849 | dma_request(1, state);
|
| 850 | }
|
| 851 | |
| 852 | |
| 853 | //-------------------------------------------------
|
| 854 | // dreq1_w - DMA request for channel 2
|
| 855 | //-------------------------------------------------
|
| 856 | |
| 857 | WRITE_LINE_MEMBER( am9517a_device::dreq2_w )
|
| 858 | {
|
| 859 | dma_request(2, state);
|
| 860 | }
|
| 861 | |
| 862 | |
| 863 | //-------------------------------------------------
|
| 864 | // dreq3_w - DMA request for channel 3
|
| 865 | //-------------------------------------------------
|
| 866 | |
| 867 | WRITE_LINE_MEMBER( am9517a_device::dreq3_w )
|
| 868 | {
|
| 869 | dma_request(3, state);
|
| 870 | }
|