trunk/src/mame/video/galaxian.c
| r23635 | r23636 | |
| 236 | 236 | void galaxian_state::palette_init() |
| 237 | 237 | { |
| 238 | 238 | const UINT8 *color_prom = memregion("proms")->base(); |
| 239 | | int rgb_resistances[3]; |
| 239 | static const int rgb_resistances[3] = { 1000, 470, 220 }; |
| 240 | 240 | double rweights[3], gweights[3], bweights[2]; |
| 241 | | int i, minval, midval, maxval, maxres, len; |
| 241 | int i, minval, midval, maxval, len; |
| 242 | 242 | UINT8 starmap[4]; |
| 243 | 243 | |
| 244 | 244 | /* |
| r23635 | r23636 | |
| 267 | 267 | of the main game would be very low to allow for all the oversaturation |
| 268 | 268 | of the stars and shells/missiles. |
| 269 | 269 | */ |
| 270 | | |
| 271 | | // official Namco PCB used 330 ohm resistors instead of the 220 ohm ones |
| 272 | | switch (m_color_resnet_type) |
| 273 | | { |
| 274 | | case GALAXIAN_RESNET_TYPE_NAMCO: |
| 275 | | rgb_resistances[0] = 1000; |
| 276 | | rgb_resistances[1] = 470; |
| 277 | | rgb_resistances[2] = 330; |
| 278 | | break; |
| 279 | | |
| 280 | | default: |
| 281 | | rgb_resistances[0] = 1000; |
| 282 | | rgb_resistances[1] = 470; |
| 283 | | rgb_resistances[2] = 220; |
| 284 | | break; |
| 285 | | } |
| 286 | | |
| 287 | 270 | compute_resistor_weights(0, RGB_MAXIMUM, -1.0, |
| 288 | 271 | 3, &rgb_resistances[0], rweights, 470, 0, |
| 289 | 272 | 3, &rgb_resistances[0], gweights, 470, 0, |
| r23635 | r23636 | |
| 330 | 313 | Since we can't saturate that high, we instead approximate this |
| 331 | 314 | by compressing the values proportionally into the 194->255 range. |
| 332 | 315 | */ |
| 333 | | maxres = 1.0 / (1.0/rgb_resistances[0] + 1.0/rgb_resistances[1] + 1.0/rgb_resistances[2]); |
| 334 | | minval = RGB_MAXIMUM * maxres / 150; |
| 335 | | midval = RGB_MAXIMUM * maxres / 100; |
| 336 | | maxval = RGB_MAXIMUM * maxres / 60; |
| 316 | minval = RGB_MAXIMUM * 130 / 150; |
| 317 | midval = RGB_MAXIMUM * 130 / 100; |
| 318 | maxval = RGB_MAXIMUM * 130 / 60; |
| 337 | 319 | |
| 338 | 320 | /* compute the values for each of 4 possible star values */ |
| 339 | 321 | starmap[0] = 0; |
trunk/src/mame/includes/galaxian.h
| r23635 | r23636 | |
| 28 | 28 | #define GALAXIAN_VBEND (16) |
| 29 | 29 | #define GALAXIAN_VBSTART (224+16) |
| 30 | 30 | |
| 31 | | enum |
| 32 | | { |
| 33 | | GALAXIAN_RESNET_TYPE_MIDWAY, |
| 34 | | GALAXIAN_RESNET_TYPE_NAMCO |
| 35 | | }; |
| 36 | 31 | |
| 37 | | |
| 38 | 32 | class galaxian_state : public driver_device |
| 39 | 33 | { |
| 40 | 34 | public: |
| r23635 | r23636 | |
| 59 | 53 | int m_bullets_base; |
| 60 | 54 | int m_sprites_base; |
| 61 | 55 | int m_numspritegens; |
| 62 | | int m_color_resnet_type; |
| 63 | 56 | int m_counter_74ls161[2]; |
| 64 | 57 | int m_direction[2]; |
| 65 | 58 | UINT8 m_gmgalax_selected_game; |
| r23635 | r23636 | |
| 189 | 182 | DECLARE_WRITE8_MEMBER(kingball_dac_w); |
| 190 | 183 | DECLARE_WRITE8_MEMBER(moonwar_port_select_w); |
| 191 | 184 | DECLARE_DRIVER_INIT(galaxian); |
| 192 | | DECLARE_DRIVER_INIT(galaxiann); |
| 193 | 185 | DECLARE_DRIVER_INIT(nolock); |
| 194 | 186 | DECLARE_DRIVER_INIT(azurian); |
| 195 | 187 | DECLARE_DRIVER_INIT(gmgalax); |
trunk/src/mame/drivers/galdrvr.c
| r23635 | r23636 | |
| 6904 | 6904 | *************************************/ |
| 6905 | 6905 | |
| 6906 | 6906 | /* basic galaxian hardware */ |
| 6907 | | GAME( 1979, galaxian, 0, galaxian, galaxian, galaxian_state, galaxiann, ROT90, "Namco", "Galaxian (Namco set 1)", GAME_SUPPORTS_SAVE ) |
| 6908 | | GAME( 1979, galaxiana, galaxian, galaxian, superg, galaxian_state, galaxiann, ROT90, "Namco", "Galaxian (Namco set 2)", GAME_SUPPORTS_SAVE ) |
| 6909 | | GAME( 1979, galaxiant, galaxian, galaxian, superg, galaxian_state, galaxiann, ROT90, "Namco (Taito license)", "Galaxian (Taito)", GAME_SUPPORTS_SAVE ) |
| 6910 | | GAME( 1979, galaxianm, galaxian, galaxian, galaxian, galaxian_state, galaxian, ROT90, "Namco (Midway license)", "Galaxian (Midway set 1)", GAME_SUPPORTS_SAVE ) |
| 6911 | | GAME( 1979, galaxianmo, galaxian, galaxian, galaxian, galaxian_state, galaxian, ROT90, "Namco (Midway license)", "Galaxian (Midway set 2)", GAME_SUPPORTS_SAVE ) |
| 6907 | GAME( 1979, galaxian, 0, galaxian, galaxian, galaxian_state, galaxian, ROT90, "Namco", "Galaxian (Namco set 1)", GAME_SUPPORTS_SAVE ) |
| 6908 | GAME( 1979, galaxiana, galaxian, galaxian, superg, galaxian_state, galaxian, ROT90, "Namco", "Galaxian (Namco set 2)", GAME_SUPPORTS_SAVE ) |
| 6909 | GAME( 1979, galaxianm, galaxian, galaxian, galaxian, galaxian_state, galaxian, ROT90, "Namco (Midway license)", "Galaxian (Midway set 1)", GAME_SUPPORTS_SAVE ) |
| 6910 | GAME( 1979, galaxianmo, galaxian, galaxian, galaxian, galaxian_state, galaxian, ROT90, "Namco (Midway license)", "Galaxian (Midway set 2)", GAME_SUPPORTS_SAVE ) |
| 6911 | GAME( 1979, galaxiant, galaxian, galaxian, superg, galaxian_state, galaxian, ROT90, "Namco (Taito license)", "Galaxian (Taito)", GAME_SUPPORTS_SAVE ) |
| 6912 | 6912 | |
| 6913 | 6913 | /* straight Galaxian ripoffs on basic galaxian hardware */ |
| 6914 | 6914 | GAME( 1979, moonaln, galaxian, galaxian, superg, galaxian_state, galaxian, ROT90, "Namco / Nichibutsu (Karateco license?)", "Moon Alien", GAME_SUPPORTS_SAVE ) // or bootleg? |
trunk/src/mame/drivers/galaxian.c
| r23635 | r23636 | |
| 2759 | 2759 | { |
| 2760 | 2760 | m_irq_enabled = 0; |
| 2761 | 2761 | m_irq_line = INPUT_LINE_NMI; |
| 2762 | | m_color_resnet_type = GALAXIAN_RESNET_TYPE_MIDWAY; |
| 2763 | 2762 | m_numspritegens = 1; |
| 2764 | 2763 | m_bullets_base = 0x60; |
| 2765 | 2764 | m_sprites_base = 0x40; |
| r23635 | r23636 | |
| 2795 | 2794 | } |
| 2796 | 2795 | |
| 2797 | 2796 | |
| 2798 | | DRIVER_INIT_MEMBER(galaxian_state,galaxiann) |
| 2799 | | { |
| 2800 | | DRIVER_INIT_CALL(galaxian); |
| 2801 | | |
| 2802 | | /* Namco PCB had a slightly different color prom resnet */ |
| 2803 | | m_color_resnet_type = GALAXIAN_RESNET_TYPE_NAMCO; |
| 2804 | | } |
| 2805 | | |
| 2806 | | |
| 2807 | 2797 | DRIVER_INIT_MEMBER(galaxian_state,nolock) |
| 2808 | 2798 | { |
| 2809 | 2799 | address_space &space = m_maincpu->space(AS_PROGRAM); |
| r23635 | r23636 | |
| 3310 | 3300 | |
| 3311 | 3301 | /* video extensions */ |
| 3312 | 3302 | common_init(&galaxian_state::galaxian_draw_bullet, &galaxian_state::galaxian_draw_background, NULL, NULL); |
| 3313 | | |
| 3314 | | /* Namco PCB had a slightly different color prom resnet */ |
| 3315 | | m_color_resnet_type = GALAXIAN_RESNET_TYPE_NAMCO; |
| 3316 | 3303 | |
| 3317 | 3304 | /* disable the stars */ |
| 3318 | 3305 | space.unmap_write(0xb004, 0xb004, 0, 0x07f8); |