trunk/src/mame/drivers/r2dx_v33.c
| r32205 | r32206 | |
| 11 | 11 | Raiden 2 / DX checks if there's the string "RAIDEN" at start-up inside the eeprom, otherwise it dies. |
| 12 | 12 | Then it puts settings at 0x9e08 and 0x9e0a (bp 91acb) |
| 13 | 13 | |
| 14 | |
| 15 | the 333 ROM is a 0x10000 byte table (bytes values?) |
| 16 | followed by a 0x400 bytes (word values)? |
| 17 | the remaining space is 0xff |
| 18 | |
| 14 | 19 | */ |
| 15 | 20 | |
| 16 | 21 | #include "emu.h" |
| r32205 | r32206 | |
| 34 | 39 | optional_device<eeprom_serial_93cxx_device> m_eeprom; |
| 35 | 40 | |
| 36 | 41 | DECLARE_WRITE16_MEMBER(r2dx_angle_w); |
| 37 | | DECLARE_WRITE16_MEMBER(r2dx_dx_w); |
| 38 | | DECLARE_WRITE16_MEMBER(r2dx_dy_w); |
| 39 | 42 | |
| 40 | 43 | DECLARE_WRITE16_MEMBER(r2dx_unk1_w); |
| 41 | 44 | DECLARE_WRITE16_MEMBER(r2dx_unk2_w); |
| 45 | DECLARE_WRITE16_MEMBER(r2dx_dx_w); |
| 46 | DECLARE_WRITE16_MEMBER(r2dx_dy_w); |
| 42 | 47 | |
| 43 | 48 | DECLARE_READ16_MEMBER(rdx_angle_r); |
| 44 | 49 | DECLARE_READ16_MEMBER(rdx_dist_r); |
| 50 | |
| 45 | 51 | DECLARE_READ16_MEMBER(r2dx_sin_r); |
| 46 | 52 | DECLARE_READ16_MEMBER(r2dx_cos_r); |
| 47 | 53 | |
| r32205 | r32206 | |
| 72 | 78 | |
| 73 | 79 | int m_r2dxbank; |
| 74 | 80 | int m_r2dxgameselect; |
| 81 | INT16 m_r2dx_angle; |
| 75 | 82 | |
| 76 | 83 | UINT32 screen_update_rdx_v33(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 77 | 84 | INTERRUPT_GEN_MEMBER(rdx_v33_interrupt); |
| r32205 | r32206 | |
| 227 | 234 | //Olivier Galibert: 16-bits signed |
| 228 | 235 | //Olivier Galibert: write dx/dy at 424/426, get dist and angle at 432/430 |
| 229 | 236 | |
| 237 | // Angle protection 1: |
| 238 | // writes angle |
| 230 | 239 | WRITE16_MEMBER(r2dx_v33_state::r2dx_angle_w) |
| 231 | 240 | { |
| 241 | m_r2dx_angle = data; |
| 242 | } |
| 232 | 243 | |
| 244 | // reads sin and cos |
| 245 | READ16_MEMBER(r2dx_v33_state::r2dx_sin_r) |
| 246 | { |
| 247 | double angle = m_r2dx_angle * M_PI / 128; |
| 248 | return int(2048*sin(angle)); |
| 233 | 249 | } |
| 234 | 250 | |
| 251 | READ16_MEMBER(r2dx_v33_state::r2dx_cos_r) |
| 252 | { |
| 253 | double angle = m_r2dx_angle * M_PI / 128; |
| 254 | return int(2048*cos(angle)); |
| 255 | } |
| 256 | |
| 257 | // Angle protection 2: |
| 258 | // write 2 co-ordinates? |
| 235 | 259 | WRITE16_MEMBER(r2dx_v33_state::r2dx_dx_w) |
| 236 | 260 | { |
| 237 | 261 | |
| r32205 | r32206 | |
| 242 | 266 | |
| 243 | 267 | } |
| 244 | 268 | |
| 245 | | READ16_MEMBER(r2dx_v33_state::rdx_angle_r) |
| 269 | WRITE16_MEMBER(r2dx_v33_state::r2dx_unk1_w) |
| 246 | 270 | { |
| 247 | | return 0x0000; |
| 271 | |
| 248 | 272 | } |
| 249 | 273 | |
| 250 | | READ16_MEMBER(r2dx_v33_state::rdx_dist_r) |
| 274 | WRITE16_MEMBER(r2dx_v33_state::r2dx_unk2_w) |
| 251 | 275 | { |
| 252 | | return 0x0000; |
| 276 | |
| 253 | 277 | } |
| 254 | 278 | |
| 255 | | READ16_MEMBER(r2dx_v33_state::r2dx_sin_r) |
| 279 | // reads angle and distance |
| 280 | READ16_MEMBER(r2dx_v33_state::rdx_angle_r) |
| 256 | 281 | { |
| 257 | 282 | return 0x0000; |
| 258 | 283 | } |
| 259 | 284 | |
| 260 | | READ16_MEMBER(r2dx_v33_state::r2dx_cos_r) |
| 285 | READ16_MEMBER(r2dx_v33_state::rdx_dist_r) |
| 261 | 286 | { |
| 262 | 287 | return 0x0000; |
| 263 | 288 | } |
| 264 | 289 | |
| 265 | | WRITE16_MEMBER(r2dx_v33_state::r2dx_unk1_w) |
| 266 | | { |
| 267 | 290 | |
| 268 | | } |
| 269 | 291 | |
| 270 | | WRITE16_MEMBER(r2dx_v33_state::r2dx_unk2_w) |
| 271 | | { |
| 272 | 292 | |
| 273 | | } |
| 274 | 293 | |
| 275 | | |
| 276 | 294 | static ADDRESS_MAP_START( rdx_v33_map, AS_PROGRAM, 16, r2dx_v33_state ) |
| 277 | 295 | AM_RANGE(0x00000, 0x003ff) AM_RAM // vectors copied here |
| 278 | 296 | |
| r32205 | r32206 | |
| 283 | 301 | AM_RANGE(0x00404, 0x00405) AM_WRITE(r2dx_rom_bank_w) |
| 284 | 302 | AM_RANGE(0x00406, 0x00407) AM_WRITE(tile_bank_w) |
| 285 | 303 | |
| 286 | | AM_RANGE(0x00420, 0x00421) AM_WRITE(r2dx_unk1_w) // frequent |
| 287 | | AM_RANGE(0x00422, 0x00423) AM_WRITE(r2dx_unk2_w) // frequent |
| 288 | | |
| 304 | AM_RANGE(0x00420, 0x00421) AM_WRITE(r2dx_unk1_w) |
| 305 | AM_RANGE(0x00422, 0x00423) AM_WRITE(r2dx_unk2_w) |
| 289 | 306 | AM_RANGE(0x00424, 0x00425) AM_WRITE(r2dx_dx_w) |
| 290 | 307 | AM_RANGE(0x00426, 0x00427) AM_WRITE(r2dx_dy_w) |
| 308 | |
| 291 | 309 | AM_RANGE(0x00428, 0x00429) AM_WRITE(r2dx_angle_w) |
| 292 | 310 | |
| 293 | 311 | AM_RANGE(0x00430, 0x00431) AM_READ(rdx_angle_r) |
| 294 | 312 | AM_RANGE(0x00432, 0x00433) AM_READ(rdx_dist_r) |
| 313 | |
| 295 | 314 | AM_RANGE(0x00434, 0x00435) AM_READ(r2dx_sin_r) |
| 296 | 315 | AM_RANGE(0x00436, 0x00437) AM_READ(r2dx_cos_r) |
| 297 | 316 | |
| r32205 | r32206 | |
| 352 | 371 | // 0x404 is bank on r2dx, this doesn't need it |
| 353 | 372 | // AM_RANGE(0x00406, 0x00407) AM_WRITE(tile_bank_w) // not the same? |
| 354 | 373 | |
| 355 | | AM_RANGE(0x00420, 0x00421) AM_WRITE(r2dx_unk1_w) // frequent |
| 356 | | AM_RANGE(0x00422, 0x00423) AM_WRITE(r2dx_unk2_w) // frequent |
| 357 | | |
| 374 | AM_RANGE(0x00420, 0x00421) AM_WRITE(r2dx_unk1_w) |
| 375 | AM_RANGE(0x00422, 0x00423) AM_WRITE(r2dx_unk2_w) |
| 358 | 376 | AM_RANGE(0x00424, 0x00425) AM_WRITE(r2dx_dx_w) |
| 359 | 377 | AM_RANGE(0x00426, 0x00427) AM_WRITE(r2dx_dy_w) |
| 378 | |
| 360 | 379 | AM_RANGE(0x00428, 0x00429) AM_WRITE(r2dx_angle_w) |
| 361 | 380 | |
| 362 | 381 | AM_RANGE(0x00430, 0x00431) AM_READ(rdx_angle_r) |
| 363 | 382 | AM_RANGE(0x00432, 0x00433) AM_READ(rdx_dist_r) |
| 383 | |
| 364 | 384 | AM_RANGE(0x00434, 0x00435) AM_READ(r2dx_sin_r) |
| 365 | 385 | AM_RANGE(0x00436, 0x00437) AM_READ(r2dx_cos_r) |
| 366 | 386 | |
| r32205 | r32206 | |
| 727 | 747 | |
| 728 | 748 | membank("okibank")->configure_entries(0, 4, memregion("oki")->base(), 0x40000); |
| 729 | 749 | membank("okibank")->set_entry(0); |
| 730 | | // sensible defaults if booting as RDX - we set now set this later.. |
| 731 | | // membank("bank1")->set_entry(0x20+16); |
| 732 | | // membank("bank2")->set_entry(0x20+3); |
| 733 | | // membank("bank3")->set_entry(1); |
| 750 | // sensible defaults if booting as RDX - we set now set this later.. |
| 751 | // membank("bank1")->set_entry(0x20+16); |
| 752 | // membank("bank2")->set_entry(0x20+3); |
| 753 | // membank("bank3")->set_entry(1); |
| 734 | 754 | |
| 735 | 755 | |
| 756 | |
| 757 | |
| 736 | 758 | } |
| 737 | 759 | |
| 738 | 760 | DRIVER_INIT_MEMBER(r2dx_v33_state,nzerotea) |