| Previous | 15994 Revisions | Next |
| r10614 Monday 28th February, 2011 at 13:24:31 UTC by Miodrag Milanović |
|---|
| Update to MAME 0.141u3 |
| [src/emu] | attotime.h audit.h fileio.c fileio.h hash.c hash.h info.c inptport.c rendlay.h romload.c screen.h softlist.c video.c |
| [src/emu/cpu/i386] | i386priv.h |
| [src/emu/cpu/m68000] | m68k_in.c m68kfpu.c |
| [src/emu/imagedev] | multcart.c |
| [src/emu/machine] | secflash.h x76f041.c x76f100.c |
| [src/emu/sound] | aica.c bsmt2000.c okiadpcm.c okiadpcm.h okim9810.c okim9810.h rf5c68.c sn76496.c spu.c spu.h spu_tables.c spureverb.c spureverb.h |
| [src/emu/video] | generic.c |
| [src/lib/util] | cdrom.h |
| [src/mame] | mame.mak mamedriv.c |
| [src/mame/audio] | spacefb.c |
| [src/mame/drivers] | ace.c armedf.c astrocde.c atarifb.c atarig42.c atetris.c bartop52.c blockade.c btime.c bwing.c by17.c by35.c cd32.c cham24.c cinemat.c circus.c cischeat.c clshroad.c compgolf.c cosmic.c csplayh5.c cyclemb.c ddragon3.c de_3.c de_3b.c deco_ld.c destroyr.c dooyong.c dynax.c exidy.c exidy440.c fantland.c firetrk.c fromanc2.c galpanic.c ghosteo.c goldnpkr.c gomoku.c gottlieb.c gunpey.c halleys.c hornet.c hyhoo.c igs011.c jchan.c jollyjgr.c kaneko16.c ksys573.c lgp.c m90.c magmax.c mainsnk.c mastboy.c mcr68.c megatech.c mlanding.c monzagp.c mpu4.c mpu4drvr.c multigam.c namcos10.c naomi.c nbmj8688.c nbmj8891.c nbmj8900.c nbmj8991.c nbmj9195.c niyanpai.c nss.c pangofun.c pastelg.c pcat_dyn.c pgm.c pingpong.c pirates.c playch10.c polepos.c popeye.c punchout.c roul.c segac2.c seta2.c sfbonus.c sigmab98.c snesb.c snowbros.c spacefb.c srmp2.c ssfindo.c subsino.c suprnova.c taito_f2.c terracre.c tickee.c toaplan1.c triplhnt.c tubep.c upscope.c vcombat.c victory.c vsnes.c warpwarp.c white_mod.c whitestar.c williams.c wiping.c xtheball.c |
| [src/mame/etc] | jrcrypt.c |
| [src/mame/includes] | atarig42.h clshroad.h dkong.h dooyong.h exidy.h exidy440.h gatron.h gomoku.h hyhoo.h m90.h magmax.h megadriv.h micro3d.h nbmj8688.h nbmj8891.h nbmj8900.h nbmj8991.h nbmj9195.h niyanpai.h pastelg.h pgm.h pingpong.h pirates.h playch10.h pokechmp.h popeye.h punchout.h segas32.h seta2.h shootout.h spacefb.h terracre.h triplhnt.h tubep.h victory.h vigilant.h vsnes.h warpwarp.h williams.h wiping.h xorworld.h |
| [src/mame/layout] | blockade.lay geebee.lay navarone.lay* outrun.lay |
| [src/mame/machine] | archimds.c dec0.c md_cart.c megadriv.c naomibd.c pgmcrypt.c playch10.c psx.c scramble.c vsnes.c williams.c zs01.c |
| [src/mame/video] | 20pacgal.c amiga.c argus.c cischeat.c clshroad.c crgolf.c dkong.c exidy.c exidy440.c gatron.c gomoku.c hyhoo.c m90.c magmax.c nbmj8688.c nbmj8891.c nbmj8900.c nbmj8991.c nbmj9195.c niyanpai.c pacman.c pastelg.c pingpong.c pirates.c playch10.c pokechmp.c popeye.c punchout.c redalert.c segas32.c seta2.c shootout.c spacefb.c taito_b.c terracre.c triplhnt.c tubep.c victory.c vigilant.c warpwarp.c williams.c wiping.c xorworld.c |
| [src/osd/sdl] | drawogl.c drawsdl.c window.h |
| [src/tools] | chdcd.c |
| r10613 | r10614 | |
|---|---|---|
| 11 | 11 | #include "includes/spacefb.h" |
| 12 | 12 | |
| 13 | 13 | |
| 14 | ||
| 15 | static UINT8 spacefb_sound_latch; | |
| 16 | ||
| 17 | ||
| 18 | ||
| 19 | 14 | READ8_HANDLER( spacefb_audio_p2_r ) |
| 20 | 15 | { |
| 21 | return (spacefb_sound_latch & 0x18) << 1; | |
| 16 | spacefb_state *state = space->machine->driver_data<spacefb_state>(); | |
| 17 | return (state->sound_latch & 0x18) << 1; | |
| 22 | 18 | } |
| 23 | 19 | |
| 24 | 20 | |
| 25 | 21 | READ8_HANDLER( spacefb_audio_t0_r ) |
| 26 | 22 | { |
| 27 | return spacefb_sound_latch & 0x20; | |
| 23 | spacefb_state *state = space->machine->driver_data<spacefb_state>(); | |
| 24 | return state->sound_latch & 0x20; | |
| 28 | 25 | } |
| 29 | 26 | |
| 30 | 27 | |
| 31 | 28 | READ8_HANDLER( spacefb_audio_t1_r ) |
| 32 | 29 | { |
| 33 | return spacefb_sound_latch & 0x04; | |
| 30 | spacefb_state *state = space->machine->driver_data<spacefb_state>(); | |
| 31 | return state->sound_latch & 0x04; | |
| 34 | 32 | } |
| 35 | 33 | |
| 36 | 34 | |
| 37 | 35 | WRITE8_HANDLER( spacefb_port_1_w ) |
| 38 | 36 | { |
| 37 | spacefb_state *state = space->machine->driver_data<spacefb_state>(); | |
| 39 | 38 | device_t *samples = space->machine->device("samples"); |
| 40 | 39 | |
| 41 | 40 | cputag_set_input_line(space->machine, "audiocpu", 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE); |
| 42 | 41 | |
| 43 | 42 | /* enemy killed */ |
| 44 | if (!(data & 0x01) && (s | |
| 43 | if (!(data & 0x01) && (state-> | |
| 45 | 44 | |
| 46 | 45 | /* ship fire */ |
| 47 | if (!(data & 0x40) && (s | |
| 46 | if (!(data & 0x40) && (state-> | |
| 48 | 47 | |
| 49 | 48 | /* |
| 50 | 49 | * Explosion Noise |
| r10613 | r10614 | |
| 54 | 53 | * Fortunately it seems like the recorded sample of the spaceship death is the longest the sample plays for. |
| 55 | 54 | * We loop it just in case it runs out |
| 56 | 55 | */ |
| 57 | if ((data & 0x80) != (s | |
| 56 | if ((data & 0x80) != (state-> | |
| 58 | 57 | { |
| 59 | 58 | if (data & 0x80) |
| 60 | 59 | /* play decaying noise */ |
| r10613 | r10614 | |
| 64 | 63 | sample_start(samples, 2,2,1); |
| 65 | 64 | } |
| 66 | 65 | |
| 67 | s | |
| 66 | state-> | |
| 68 | 67 | } |
| 69 | 68 | |
| 70 | 69 |
| r10613 | r10614 | |
|---|---|---|
| 198 | 198 | |
| 199 | 199 | if ((state->md_cart.ssf2_lastoff != offset) || (state->md_cart.ssf2_lastdata != data)) |
| 200 | 200 | { |
| 201 | state->md_cart.ssf2_lastoff = offset; | |
| 201 | state->md_cart.ssf2_lastoff = offset; | |
| 202 | 202 | state->md_cart.ssf2_lastdata = data; |
| 203 | 203 | switch (offset << 1) |
| 204 | 204 | { |
| r10613 | r10614 | |
| 1301 | 1301 | switch (state->md_cart.type) |
| 1302 | 1302 | { |
| 1303 | 1303 | // These types only come from xml |
| 1304 | // TODO: Eventually megadriv_backupram should point to the allocated cart:sram region! | |
| 1304 | // TODO: Eventually megadriv_backupram should point to the allocated cart:sram region! | |
| 1305 | 1305 | // For now, we only use the region as a placeholder to carry size info... |
| 1306 | 1306 | case SEGA_SRAM: |
| 1307 | 1307 | state->md_cart.sram_start = 0x200000; |
| r10613 | r10614 | |
|---|---|---|
| 5 | 5 | #include "includes/playch10.h" |
| 6 | 6 | |
| 7 | 7 | /* prototypes */ |
| 8 | static void pc10_set_mirroring( int mirroring ); | |
| 8 | static void pc10_set_mirroring( playch10_state *state, int mirroring ); | |
| 9 | 9 | static WRITE8_HANDLER( pc10_nt_w ); |
| 10 | 10 | static READ8_HANDLER( pc10_nt_r ); |
| 11 | 11 | static WRITE8_HANDLER( pc10_chr_w ); |
| r10613 | r10614 | |
| 13 | 13 | static void pc10_set_videorom_bank( running_machine *machine, int first, int count, int bank, int size ); |
| 14 | 14 | static void set_videoram_bank( running_machine *machine, int first, int count, int bank, int size ); |
| 15 | 15 | |
| 16 | typedef struct | |
| 17 | { | |
| 18 | int writable; // 1 for RAM, 0 for ROM | |
| 19 | UINT8* chr; // direct access to the memory | |
| 20 | } chr_bank; | |
| 21 | 16 | |
| 22 | ||
| 23 | /* Globals */ | |
| 24 | int pc10_sdcs; /* ShareD Chip Select */ | |
| 25 | int pc10_dispmask; /* Display Mask */ | |
| 26 | int pc10_nmi_enable; /* nmi enable */ | |
| 27 | int pc10_dog_di; /* watchdog disable */ | |
| 28 | int pc10_int_detect; /* interrupt detect */ | |
| 29 | static int pc10_gun_controller; | |
| 30 | int pc10_game_mode; /* Used in Single monitor version to display Game or PPU */ | |
| 31 | int pc10_dispmask_old; | |
| 32 | ||
| 33 | /* Locals */ | |
| 34 | static int cart_sel; | |
| 35 | static int cntrl_mask; | |
| 36 | static int input_latch[2]; | |
| 37 | static int mirroring; | |
| 38 | ||
| 39 | static int MMC2_bank[4], MMC2_bank_latch[2]; | |
| 40 | ||
| 41 | static UINT8* vrom; // used for games with cart gfx loaded (a,c,e,f,g,h) | |
| 42 | static UINT8* vram = NULL; // used for boards h, b, d, i, k (Presumably, 8K. 16K didn't work in MESS) | |
| 43 | static UINT8* nametable[4]; // For non-mirroring boards, this can be moved to a direct mapping | |
| 44 | static UINT8* nt_ram = NULL; // Per-board size! Some boards clearly need 4K. Some MAY use 2K. Research needed. | |
| 45 | static chr_bank chr_page[8]; // Simple wrapper for ROM/RAM, since we could be banking either (Hboard) | |
| 46 | ||
| 47 | 17 | /************************************* |
| 48 | 18 | * |
| 49 | 19 | * Init machine |
| r10613 | r10614 | |
| 52 | 22 | |
| 53 | 23 | MACHINE_RESET( pc10 ) |
| 54 | 24 | { |
| 25 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 55 | 26 | device_t *rp5h01 = machine->device("rp5h01"); |
| 56 | 27 | |
| 57 | 28 | /* initialize latches and flip-flops */ |
| 58 | pc10_nmi_enable = pc10_dog_di = pc10_dispmask = pc10_sdcs = pc10_int_detect = 0; | |
| 29 | state->pc10_nmi_enable = state->pc10_dog_di = state->pc10_dispmask = state->pc10_sdcs = state->pc10_int_detect = 0; | |
| 59 | 30 | |
| 60 | pc10_game_mode = pc10_dispmask_old = 0; | |
| 31 | state->pc10_game_mode = state->pc10_dispmask_old = 0; | |
| 61 | 32 | |
| 62 | cart_sel = 0; | |
| 63 | cntrl_mask = 1; | |
| 33 | state->cart_sel = 0; | |
| 34 | state->cntrl_mask = 1; | |
| 64 | 35 | |
| 65 | input_latch[0] = input_latch[1] = 0; | |
| 36 | state->input_latch[0] = state->input_latch[1] = 0; | |
| 66 | 37 | |
| 67 | 38 | /* variables used only in MMC2 game (mapper 9) */ |
| 68 | MMC2_bank[0] = MMC2_bank[1] = MMC2_bank[2] = MMC2_bank[3] = 0; | |
| 69 | MMC2_bank_latch[0] = MMC2_bank_latch[1] = 0xfe; | |
| 39 | state->MMC2_bank[0] = state->MMC2_bank[1] = state->MMC2_bank[2] = state->MMC2_bank[3] = 0; | |
| 40 | state->MMC2_bank_latch[0] = state->MMC2_bank_latch[1] = 0xfe; | |
| 70 | 41 | |
| 71 | 42 | /* reset the security chip */ |
| 72 | 43 | rp5h01_enable_w(rp5h01, 0, 0); |
| r10613 | r10614 | |
| 74 | 45 | rp5h01_reset_w(rp5h01, 0, 1); |
| 75 | 46 | rp5h01_enable_w(rp5h01, 0, 1); |
| 76 | 47 | |
| 77 | pc10_set_mirroring(mirroring); | |
| 48 | pc10_set_mirroring(state, state->mirroring); | |
| 78 | 49 | } |
| 79 | 50 | |
| 80 | 51 | MACHINE_START( pc10 ) |
| 81 | 52 | { |
| 82 | vrom = machine->region("gfx2")->base(); | |
| 53 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 54 | state->vrom = machine->region("gfx2")->base(); | |
| 83 | 55 | |
| 84 | 56 | /* allocate 4K of nametable ram here */ |
| 85 | 57 | /* move to individual boards as documentation of actual boards allows */ |
| 86 | nt_ram = auto_alloc_array(machine, UINT8, 0x1000); | |
| 58 | state->nt_ram = auto_alloc_array(machine, UINT8, 0x1000); | |
| 87 | 59 | |
| 88 | 60 | memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0, 0x1fff, 0, 0, pc10_chr_r, pc10_chr_w); |
| 89 | 61 | memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, pc10_nt_r, pc10_nt_w); |
| 90 | 62 | |
| 91 | if (NULL != vram) | |
| 63 | if (NULL != state->vram) | |
| 92 | 64 | set_videoram_bank(machine, 0, 8, 0, 8); |
| 93 | 65 | else pc10_set_videorom_bank(machine, 0, 8, 0, 8); |
| 94 | 66 | |
| 95 | 67 | nvram_device *nvram = machine->device<nvram_device>("nvram"); |
| 96 | 68 | if (nvram != NULL) |
| 97 | nvram->set_base(machine->region( | |
| 69 | nvram->set_base(machine->region( | |
| 98 | 70 | } |
| 99 | 71 | |
| 100 | 72 | MACHINE_START( playch10_hboard ) |
| 101 | 73 | { |
| 102 | vrom = machine->region("gfx2")->base(); | |
| 74 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 75 | state->vrom = machine->region("gfx2")->base(); | |
| 103 | 76 | |
| 104 | 77 | /* allocate 4K of nametable ram here */ |
| 105 | 78 | /* move to individual boards as documentation of actual boards allows */ |
| 106 | nt_ram = auto_alloc_array(machine, UINT8, 0x1000); | |
| 79 | state->nt_ram = auto_alloc_array(machine, UINT8, 0x1000); | |
| 107 | 80 | /* allocate vram */ |
| 108 | 81 | |
| 109 | vram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 82 | state->vram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 110 | 83 | |
| 111 | 84 | memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0, 0x1fff, 0, 0, pc10_chr_r, pc10_chr_w); |
| 112 | 85 | memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, pc10_nt_r, pc10_nt_w); |
| r10613 | r10614 | |
| 120 | 93 | |
| 121 | 94 | CUSTOM_INPUT( pc10_int_detect_r ) |
| 122 | 95 | { |
| 123 | return ~pc10_int_detect & 1; | |
| 96 | playch10_state *state = field->port->machine->driver_data<playch10_state>(); | |
| 97 | return ~state->pc10_int_detect & 1; | |
| 124 | 98 | } |
| 125 | 99 | |
| 126 | 100 | WRITE8_HANDLER( pc10_SDCS_w ) |
| 127 | 101 | { |
| 102 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 128 | 103 | /* |
| 129 | 104 | Hooked to CLR on LS194A - Sheet 2, bottom left. |
| 130 | 105 | Drives character and color code to 0. |
| 131 | 106 | It's used to keep the screen black during redraws. |
| 132 | 107 | Also hooked to the video sram. Prevent writes. |
| 133 | 108 | */ |
| 134 | pc10_sdcs = ~data & 1; | |
| 109 | state->pc10_sdcs = ~data & 1; | |
| 135 | 110 | } |
| 136 | 111 | |
| 137 | 112 | WRITE8_HANDLER( pc10_CNTRLMASK_w ) |
| 138 | 113 | { |
| 139 | cntrl_mask = ~data & 1; | |
| 114 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 115 | state->cntrl_mask = ~data & 1; | |
| 140 | 116 | } |
| 141 | 117 | |
| 142 | 118 | WRITE8_HANDLER( pc10_DISPMASK_w ) |
| 143 | 119 | { |
| 144 | pc10_dispmask = ~data & 1; | |
| 120 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 121 | state->pc10_dispmask = ~data & 1; | |
| 145 | 122 | } |
| 146 | 123 | |
| 147 | 124 | WRITE8_HANDLER( pc10_SOUNDMASK_w ) |
| r10613 | r10614 | |
| 151 | 128 | |
| 152 | 129 | WRITE8_HANDLER( pc10_NMIENABLE_w ) |
| 153 | 130 | { |
| 154 | pc10_nmi_enable = data & 1; | |
| 131 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 132 | state->pc10_nmi_enable = data & 1; | |
| 155 | 133 | } |
| 156 | 134 | |
| 157 | 135 | WRITE8_HANDLER( pc10_DOGDI_w ) |
| 158 | 136 | { |
| 159 | pc10_dog_di = data & 1; | |
| 137 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 138 | state->pc10_dog_di = data & 1; | |
| 160 | 139 | } |
| 161 | 140 | |
| 162 | 141 | WRITE8_HANDLER( pc10_GAMERES_w ) |
| r10613 | r10614 | |
| 177 | 156 | |
| 178 | 157 | READ8_HANDLER( pc10_detectclr_r ) |
| 179 | 158 | { |
| 180 | pc10_int_detect = 0; | |
| 159 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 160 | state->pc10_int_detect = 0; | |
| 181 | 161 | |
| 182 | 162 | return 0; |
| 183 | 163 | } |
| 184 | 164 | |
| 185 | 165 | WRITE8_HANDLER( pc10_CARTSEL_w ) |
| 186 | 166 | { |
| 187 | cart_sel &= ~(1 << offset); | |
| 188 | cart_sel |= (data & 1) << offset; | |
| 167 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 168 | state->cart_sel &= ~(1 << offset); | |
| 169 | state->cart_sel |= (data & 1) << offset; | |
| 189 | 170 | } |
| 190 | 171 | |
| 191 | 172 | |
| r10613 | r10614 | |
| 197 | 178 | |
| 198 | 179 | READ8_HANDLER( pc10_prot_r ) |
| 199 | 180 | { |
| 181 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 200 | 182 | device_t *rp5h01 = space->machine->device("rp5h01"); |
| 201 | 183 | int data = 0xe7; |
| 202 | 184 | |
| 203 | 185 | /* we only support a single cart connected at slot 0 */ |
| 204 | if (cart_sel == 0) | |
| 186 | if (state->cart_sel == 0) | |
| 205 | 187 | { |
| 206 | 188 | rp5h01_enable_w(rp5h01, 0, 0); |
| 207 | 189 | data |= ((~rp5h01_counter_r(rp5h01, 0)) << 4) & 0x10; /* D4 */ |
| r10613 | r10614 | |
| 213 | 195 | |
| 214 | 196 | WRITE8_HANDLER( pc10_prot_w ) |
| 215 | 197 | { |
| 198 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 216 | 199 | device_t *rp5h01 = space->machine->device("rp5h01"); |
| 217 | 200 | /* we only support a single cart connected at slot 0 */ |
| 218 | if (cart_sel == 0) | |
| 201 | if (state->cart_sel == 0) | |
| 219 | 202 | { |
| 220 | 203 | rp5h01_enable_w(rp5h01, 0, 0); |
| 221 | 204 | rp5h01_test_w(rp5h01, 0, data & 0x10); /* D4 */ |
| r10613 | r10614 | |
| 241 | 224 | |
| 242 | 225 | WRITE8_HANDLER( pc10_in0_w ) |
| 243 | 226 | { |
| 227 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 244 | 228 | /* Toggling bit 0 high then low resets both controllers */ |
| 245 | 229 | if (data & 1) |
| 246 | 230 | return; |
| 247 | 231 | |
| 248 | 232 | /* load up the latches */ |
| 249 | input_latch[0] = input_port_read(space->machine, "P1"); | |
| 250 | input_latch[1] = input_port_read(space->machine, "P2"); | |
| 233 | state->input_latch[0] = input_port_read(space->machine, "P1"); | |
| 234 | state->input_latch[1] = input_port_read(space->machine, "P2"); | |
| 251 | 235 | |
| 252 | 236 | /* apply any masking from the BIOS */ |
| 253 | if (cntrl_mask) | |
| 237 | if (state->cntrl_mask) | |
| 254 | 238 | { |
| 255 | 239 | /* mask out select and start */ |
| 256 | input_latch[0] &= ~0x0c; | |
| 240 | state->input_latch[0] &= ~0x0c; | |
| 257 | 241 | } |
| 258 | 242 | } |
| 259 | 243 | |
| 260 | 244 | READ8_HANDLER( pc10_in0_r ) |
| 261 | 245 | { |
| 262 | int ret = (input_latch[0]) & 1; | |
| 246 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 247 | int ret = (state->input_latch[0]) & 1; | |
| 263 | 248 | |
| 264 | 249 | /* shift */ |
| 265 | input_latch[0] >>= 1; | |
| 250 | state->input_latch[0] >>= 1; | |
| 266 | 251 | |
| 267 | 252 | /* some games expect bit 6 to be set because the last entry on the data bus shows up */ |
| 268 | 253 | /* in the unused upper 3 bits, so typically a read from $4016 leaves 0x40 there. */ |
| r10613 | r10614 | |
| 273 | 258 | |
| 274 | 259 | READ8_HANDLER( pc10_in1_r ) |
| 275 | 260 | { |
| 276 | int ret = (input_latch[1]) & 1; | |
| 261 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 262 | int ret = (state->input_latch[1]) & 1; | |
| 277 | 263 | |
| 278 | 264 | /* shift */ |
| 279 | input_latch[1] >>= 1; | |
| 265 | state->input_latch[1] >>= 1; | |
| 280 | 266 | |
| 281 | 267 | /* do the gun thing */ |
| 282 | if (pc10_gun_controller) | |
| 268 | if (state->pc10_gun_controller) | |
| 283 | 269 | { |
| 284 | 270 | device_t *ppu = space->machine->device("ppu"); |
| 285 | 271 | int trigger = input_port_read(space->machine, "P1"); |
| r10613 | r10614 | |
| 304 | 290 | } |
| 305 | 291 | |
| 306 | 292 | /* now, add the trigger if not masked */ |
| 307 | if (!cntrl_mask) | |
| 293 | if (!state->cntrl_mask) | |
| 308 | 294 | { |
| 309 | 295 | ret |= (trigger & 2) << 3; |
| 310 | 296 | } |
| r10613 | r10614 | |
| 324 | 310 | |
| 325 | 311 | static WRITE8_HANDLER( pc10_nt_w ) |
| 326 | 312 | { |
| 313 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 327 | 314 | int page = ((offset & 0xc00) >> 10); |
| 328 | nametable[page][offset & 0x3ff] = data; | |
| 315 | state->nametable[page][offset & 0x3ff] = data; | |
| 329 | 316 | } |
| 330 | 317 | |
| 331 | 318 | static READ8_HANDLER( pc10_nt_r ) |
| 332 | 319 | { |
| 320 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 333 | 321 | int page = ((offset & 0xc00) >> 10); |
| 334 | return nametable[page][offset & 0x3ff]; | |
| 322 | return state->nametable[page][offset & 0x3ff]; | |
| 335 | 323 | } |
| 336 | 324 | |
| 337 | 325 | static WRITE8_HANDLER( pc10_chr_w ) |
| 338 | 326 | { |
| 327 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 339 | 328 | int bank = offset >> 10; |
| 340 | if (chr_page[bank].writable) | |
| 329 | if (state->chr_page[bank].writable) | |
| 341 | 330 | { |
| 342 | chr_page[bank].chr[offset & 0x3ff] = data; | |
| 331 | state->chr_page[bank].chr[offset & 0x3ff] = data; | |
| 343 | 332 | } |
| 344 | 333 | } |
| 345 | 334 | |
| 346 | 335 | static READ8_HANDLER( pc10_chr_r ) |
| 347 | 336 | { |
| 337 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 348 | 338 | int bank = offset >> 10; |
| 349 | return chr_page[bank].chr[offset & 0x3ff]; | |
| 339 | return state->chr_page[bank].chr[offset & 0x3ff]; | |
| 350 | 340 | } |
| 351 | 341 | |
| 352 | static void pc10_set_mirroring( int mirroring ) | |
| 342 | static void pc10_set_mirroring( playch10_state *state, int mirroring ) | |
| 353 | 343 | { |
| 354 | 344 | switch (mirroring) |
| 355 | 345 | { |
| 356 | 346 | case PPU_MIRROR_LOW: |
| 357 | nametable[0] = nametable[1] = nametable[2] = nametable[3] = nt_ram; | |
| 347 | state->nametable[0] = state->nametable[1] = state->nametable[2] = state->nametable[3] = state->nt_ram; | |
| 358 | 348 | break; |
| 359 | 349 | case PPU_MIRROR_HIGH: |
| 360 | nametable[0] = nametable[1] = nametable[2] = nametable[3] = nt_ram + 0x400; | |
| 350 | state->nametable[0] = state->nametable[1] = state->nametable[2] = state->nametable[3] = state->nt_ram + 0x400; | |
| 361 | 351 | break; |
| 362 | 352 | case PPU_MIRROR_HORZ: |
| 363 | nametable[0] = nt_ram; | |
| 364 | nametable[1] = nt_ram; | |
| 365 | nametable[2] = nt_ram + 0x400; | |
| 366 | nametable[3] = nt_ram + 0x400; | |
| 353 | state->nametable[0] = state->nt_ram; | |
| 354 | state->nametable[1] = state->nt_ram; | |
| 355 | state->nametable[2] = state->nt_ram + 0x400; | |
| 356 | state->nametable[3] = state->nt_ram + 0x400; | |
| 367 | 357 | break; |
| 368 | 358 | case PPU_MIRROR_VERT: |
| 369 | nametable[0] = nt_ram; | |
| 370 | nametable[1] = nt_ram + 0x400; | |
| 371 | nametable[2] = nt_ram; | |
| 372 | nametable[3] = nt_ram + 0x400; | |
| 359 | state->nametable[0] = state->nt_ram; | |
| 360 | state->nametable[1] = state->nt_ram + 0x400; | |
| 361 | state->nametable[2] = state->nt_ram; | |
| 362 | state->nametable[3] = state->nt_ram + 0x400; | |
| 373 | 363 | break; |
| 374 | 364 | case PPU_MIRROR_NONE: |
| 375 | 365 | default: |
| 376 | nametable[0] = nt_ram; | |
| 377 | nametable[1] = nt_ram + 0x400; | |
| 378 | nametable[2] = nt_ram + 0x800; | |
| 379 | nametable[3] = nt_ram + 0xc00; | |
| 366 | state->nametable[0] = state->nt_ram; | |
| 367 | state->nametable[1] = state->nt_ram + 0x400; | |
| 368 | state->nametable[2] = state->nt_ram + 0x800; | |
| 369 | state->nametable[3] = state->nt_ram + 0xc00; | |
| 380 | 370 | break; |
| 381 | 371 | } |
| 382 | 372 | } |
| r10613 | r10614 | |
| 391 | 381 | |
| 392 | 382 | static void pc10_set_videorom_bank( running_machine *machine, int first, int count, int bank, int size ) |
| 393 | 383 | { |
| 384 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 394 | 385 | int i, len; |
| 395 | 386 | /* first = first bank to map */ |
| 396 | 387 | /* count = number of 1K banks to map */ |
| r10613 | r10614 | |
| 409 | 400 | |
| 410 | 401 | for (i = 0; i < count; i++) |
| 411 | 402 | { |
| 412 | chr_page[i + first].writable = 0; | |
| 413 | chr_page[i + first].chr=vrom + (i * 0x400) + (bank * size * 0x400); | |
| 403 | state->chr_page[i + first].writable = 0; | |
| 404 | state->chr_page[i + first].chr=state->vrom + (i * 0x400) + (bank * size * 0x400); | |
| 414 | 405 | } |
| 415 | 406 | } |
| 416 | 407 | |
| 417 | 408 | static void set_videoram_bank( running_machine *machine, int first, int count, int bank, int size ) |
| 418 | 409 | { |
| 410 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 419 | 411 | int i; |
| 420 | 412 | /* first = first bank to map */ |
| 421 | 413 | /* count = number of 1K banks to map */ |
| r10613 | r10614 | |
| 429 | 421 | |
| 430 | 422 | for (i = 0; i < count; i++) |
| 431 | 423 | { |
| 432 | chr_page[i + first].writable = 1; | |
| 433 | chr_page[i + first].chr = vram + (((i * 0x400) + (bank * size * 0x400)) & 0x1fff); | |
| 424 | state->chr_page[i + first].writable = 1; | |
| 425 | state->chr_page[i + first].chr = state->vram + (((i * 0x400) + (bank * size * 0x400)) & 0x1fff); | |
| 434 | 426 | } |
| 435 | 427 | } |
| 436 | 428 | |
| r10613 | r10614 | |
| 442 | 434 | |
| 443 | 435 | DRIVER_INIT( playch10 ) |
| 444 | 436 | { |
| 445 | vram = NULL; | |
| 437 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 438 | state->vram = NULL; | |
| 446 | 439 | |
| 447 | 440 | /* set the controller to default */ |
| 448 | pc10_gun_controller = 0; | |
| 441 | state->pc10_gun_controller = 0; | |
| 449 | 442 | |
| 450 | 443 | /* default mirroring */ |
| 451 | mirroring = PPU_MIRROR_NONE; | |
| 444 | state->mirroring = PPU_MIRROR_NONE; | |
| 452 | 445 | } |
| 453 | 446 | |
| 454 | 447 | /********************************************************************************** |
| r10613 | r10614 | |
| 461 | 454 | |
| 462 | 455 | DRIVER_INIT( pc_gun ) |
| 463 | 456 | { |
| 457 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 464 | 458 | /* common init */ |
| 465 | 459 | DRIVER_INIT_CALL(playch10); |
| 466 | 460 | |
| 467 | 461 | /* we have no vram, make sure switching games doesn't point to an old allocation */ |
| 468 | vram = NULL; | |
| 462 | state->vram = NULL; | |
| 469 | 463 | |
| 470 | 464 | /* set the control type */ |
| 471 | pc10_gun_controller = 1; | |
| 465 | state->pc10_gun_controller = 1; | |
| 472 | 466 | } |
| 473 | 467 | |
| 474 | 468 | |
| r10613 | r10614 | |
| 476 | 470 | |
| 477 | 471 | DRIVER_INIT( pc_hrz ) |
| 478 | 472 | { |
| 473 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 479 | 474 | /* common init */ |
| 480 | 475 | DRIVER_INIT_CALL(playch10); |
| 481 | 476 | |
| 482 | 477 | /* setup mirroring */ |
| 483 | mirroring = PPU_MIRROR_HORZ; | |
| 478 | state->mirroring = PPU_MIRROR_HORZ; | |
| 484 | 479 | } |
| 485 | 480 | |
| 486 | 481 | /* MMC1 mapper, used by D and F boards */ |
| 487 | 482 | |
| 488 | static int mmc1_shiftreg; | |
| 489 | static int mmc1_shiftcount; | |
| 490 | static int mmc1_rom_mask; | |
| 491 | 483 | |
| 492 | 484 | static WRITE8_HANDLER( mmc1_rom_switch_w ) |
| 493 | 485 | { |
| 486 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 494 | 487 | /* basically, a MMC1 mapper from the nes */ |
| 495 | 488 | static int size16k, switchlow, vrom4k; |
| 496 | 489 | |
| r10613 | r10614 | |
| 499 | 492 | /* reset mapper */ |
| 500 | 493 | if (data & 0x80) |
| 501 | 494 | { |
| 502 | mmc1_shiftreg = mmc1_shiftcount = 0; | |
| 495 | state->mmc1_shiftreg = state->mmc1_shiftcount = 0; | |
| 503 | 496 | |
| 504 | 497 | size16k = 1; |
| 505 | 498 | switchlow = 1; |
| r10613 | r10614 | |
| 509 | 502 | } |
| 510 | 503 | |
| 511 | 504 | /* see if we need to clock in data */ |
| 512 | if (mmc1_shiftcount < 5) | |
| 505 | if (state->mmc1_shiftcount < 5) | |
| 513 | 506 | { |
| 514 | mmc1_shiftreg >>= 1; | |
| 515 | mmc1_shiftreg |= (data & 1) << 4; | |
| 516 | mmc1_shiftcount++; | |
| 507 | state->mmc1_shiftreg >>= 1; | |
| 508 | state->mmc1_shiftreg |= (data & 1) << 4; | |
| 509 | state->mmc1_shiftcount++; | |
| 517 | 510 | } |
| 518 | 511 | |
| 519 | 512 | /* are we done shifting? */ |
| 520 | if (mmc1_shiftcount == 5) | |
| 513 | if (state->mmc1_shiftcount == 5) | |
| 521 | 514 | { |
| 522 | 515 | /* reset count */ |
| 523 | mmc1_shiftcount = 0; | |
| 516 | state->mmc1_shiftcount = 0; | |
| 524 | 517 | |
| 525 | 518 | /* apply data to registers */ |
| 526 | 519 | switch (reg) |
| r10613 | r10614 | |
| 529 | 522 | { |
| 530 | 523 | int _mirroring; |
| 531 | 524 | |
| 532 | vrom4k = mmc1_shiftreg & 0x10; | |
| 533 | size16k = mmc1_shiftreg & 0x08; | |
| 534 | switchlow = mmc1_shiftreg & 0x04; | |
| 525 | vrom4k = state->mmc1_shiftreg & 0x10; | |
| 526 | size16k = state->mmc1_shiftreg & 0x08; | |
| 527 | switchlow = state->mmc1_shiftreg & 0x04; | |
| 535 | 528 | |
| 536 | switch (mmc1_shiftreg & 3) | |
| 529 | switch (state->mmc1_shiftreg & 3) | |
| 537 | 530 | { |
| 538 | 531 | case 0: |
| 539 | 532 | _mirroring = PPU_MIRROR_LOW; |
| r10613 | r10614 | |
| 554 | 547 | } |
| 555 | 548 | |
| 556 | 549 | /* apply mirroring */ |
| 557 | pc10_set_mirroring(_mirroring); | |
| 550 | pc10_set_mirroring(state, _mirroring); | |
| 558 | 551 | } |
| 559 | 552 | break; |
| 560 | 553 | |
| 561 | 554 | case 1: /* video rom banking - bank 0 - 4k or 8k */ |
| 562 | if (vram) | |
| 563 | set_videoram_bank(space->machine, 0, (vrom4k) ? 4 : 8, (mmc1_shiftreg & 0x1f), 4); | |
| 555 | if (state->vram) | |
| 556 | set_videoram_bank(space->machine, 0, (vrom4k) ? 4 : 8, (state->mmc1_shiftreg & 0x1f), 4); | |
| 564 | 557 | else |
| 565 | pc10_set_videorom_bank(space->machine, 0, (vrom4k) ? 4 : 8, (mmc1_shiftreg & 0x1f), 4); | |
| 558 | pc10_set_videorom_bank(space->machine, 0, (vrom4k) ? 4 : 8, (state->mmc1_shiftreg & 0x1f), 4); | |
| 566 | 559 | break; |
| 567 | 560 | |
| 568 | 561 | case 2: /* video rom banking - bank 1 - 4k only */ |
| 569 | 562 | if (vrom4k) |
| 570 | 563 | { |
| 571 | if (vram) | |
| 572 | set_videoram_bank(space->machine, 0, (vrom4k) ? 4 : 8, (mmc1_shiftreg & 0x1f), 4); | |
| 564 | if (state->vram) | |
| 565 | set_videoram_bank(space->machine, 0, (vrom4k) ? 4 : 8, (state->mmc1_shiftreg & 0x1f), 4); | |
| 573 | 566 | else |
| 574 | pc10_set_videorom_bank(space->machine, 4, 4, (mmc1_shiftreg & 0x1f), 4); | |
| 567 | pc10_set_videorom_bank(space->machine, 4, 4, (state->mmc1_shiftreg & 0x1f), 4); | |
| 575 | 568 | } |
| 576 | 569 | break; |
| 577 | 570 | |
| 578 | 571 | case 3: /* program banking */ |
| 579 | 572 | { |
| 580 | int bank = (mmc1_shiftreg & mmc1_rom_mask) * 0x4000; | |
| 573 | int bank = (state->mmc1_shiftreg & state->mmc1_rom_mask) * 0x4000; | |
| 581 | 574 | UINT8 *prg = space->machine->region("cart")->base(); |
| 582 | 575 | |
| 583 | 576 | if (!size16k) |
| r10613 | r10614 | |
| 615 | 608 | |
| 616 | 609 | DRIVER_INIT( pcaboard ) |
| 617 | 610 | { |
| 611 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 618 | 612 | /* switches vrom with writes to the $803e-$8041 area */ |
| 619 | 613 | memory_install_write8_handler(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x8000, 0x8fff, 0, 0, aboard_vrom_switch_w ); |
| 620 | 614 | |
| r10613 | r10614 | |
| 622 | 616 | DRIVER_INIT_CALL(playch10); |
| 623 | 617 | |
| 624 | 618 | /* set the mirroring here */ |
| 625 | mirroring = PPU_MIRROR_VERT; | |
| 619 | state->mirroring = PPU_MIRROR_VERT; | |
| 626 | 620 | |
| 627 | 621 | /* we have no vram, make sure switching games doesn't point to an old allocation */ |
| 628 | vram = NULL; | |
| 622 | state->vram = NULL; | |
| 629 | 623 | } |
| 630 | 624 | |
| 631 | 625 | /**********************************************************************************/ |
| r10613 | r10614 | |
| 641 | 635 | |
| 642 | 636 | DRIVER_INIT( pcbboard ) |
| 643 | 637 | { |
| 638 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 644 | 639 | UINT8 *prg = machine->region("cart")->base(); |
| 645 | 640 | |
| 646 | 641 | /* We do manual banking, in case the code falls through */ |
| r10613 | r10614 | |
| 654 | 649 | DRIVER_INIT_CALL(playch10); |
| 655 | 650 | |
| 656 | 651 | /* allocate vram */ |
| 657 | vram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 652 | state->vram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 658 | 653 | |
| 659 | 654 | /* set the mirroring here */ |
| 660 | mirroring = PPU_MIRROR_VERT; | |
| 655 | state->mirroring = PPU_MIRROR_VERT; | |
| 661 | 656 | /* special init */ |
| 662 | 657 | set_videoram_bank(machine, 0, 8, 0, 8); |
| 663 | 658 | } |
| r10613 | r10614 | |
| 672 | 667 | |
| 673 | 668 | DRIVER_INIT( pccboard ) |
| 674 | 669 | { |
| 670 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 675 | 671 | /* switches vrom with writes to $6000 */ |
| 676 | 672 | memory_install_write8_handler(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x6000, 0x6000, 0, 0, cboard_vrom_switch_w ); |
| 677 | 673 | |
| 678 | 674 | /* we have no vram, make sure switching games doesn't point to an old allocation */ |
| 679 | vram = NULL; | |
| 675 | state->vram = NULL; | |
| 680 | 676 | |
| 681 | 677 | /* common init */ |
| 682 | 678 | DRIVER_INIT_CALL(playch10); |
| r10613 | r10614 | |
| 687 | 683 | |
| 688 | 684 | DRIVER_INIT( pcdboard ) |
| 689 | 685 | { |
| 686 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 690 | 687 | UINT8 *prg = machine->region("cart")->base(); |
| 691 | 688 | |
| 692 | 689 | /* We do manual banking, in case the code falls through */ |
| 693 | 690 | /* Copy the initial banks */ |
| 694 | 691 | memcpy(&prg[0x08000], &prg[0x28000], 0x8000); |
| 695 | 692 | |
| 696 | mmc1_rom_mask = 0x07; | |
| 693 | state->mmc1_rom_mask = 0x07; | |
| 697 | 694 | |
| 698 | 695 | /* MMC mapper at writes to $8000-$ffff */ |
| 699 | 696 | memory_install_write8_handler(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, mmc1_rom_switch_w ); |
| r10613 | r10614 | |
| 702 | 699 | /* common init */ |
| 703 | 700 | DRIVER_INIT_CALL(playch10); |
| 704 | 701 | /* allocate vram */ |
| 705 | vram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 702 | state->vram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 706 | 703 | /* special init */ |
| 707 | 704 | set_videoram_bank(machine, 0, 8, 0, 8); |
| 708 | 705 | } |
| r10613 | r10614 | |
| 711 | 708 | |
| 712 | 709 | DRIVER_INIT( pcdboard_2 ) |
| 713 | 710 | { |
| 711 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 714 | 712 | /* extra ram at $6000-$7fff */ |
| 715 | 713 | memory_install_ram(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, NULL ); |
| 716 | 714 | |
| r10613 | r10614 | |
| 718 | 716 | DRIVER_INIT_CALL(pcdboard); |
| 719 | 717 | |
| 720 | 718 | /* allocate vram */ |
| 721 | vram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 719 | state->vram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 722 | 720 | /* special init */ |
| 723 | 721 | set_videoram_bank(machine, 0, 8, 0, 8); |
| 724 | 722 | } |
| r10613 | r10614 | |
| 729 | 727 | /* callback for the ppu_latch */ |
| 730 | 728 | static void mapper9_latch( device_t *ppu, offs_t offset ) |
| 731 | 729 | { |
| 730 | playch10_state *state = ppu->machine->driver_data<playch10_state>(); | |
| 732 | 731 | |
| 733 | if((offset & 0x1ff0) == 0x0fd0 && MMC2_bank_latch[0] != 0xfd) | |
| 732 | if((offset & 0x1ff0) == 0x0fd0 && state->MMC2_bank_latch[0] != 0xfd) | |
| 734 | 733 | { |
| 735 | MMC2_bank_latch[0] = 0xfd; | |
| 736 | pc10_set_videorom_bank(ppu->machine, 0, 4, MMC2_bank[0], 4); | |
| 734 | state->MMC2_bank_latch[0] = 0xfd; | |
| 735 | pc10_set_videorom_bank(ppu->machine, 0, 4, state->MMC2_bank[0], 4); | |
| 737 | 736 | } |
| 738 | else if((offset & 0x1ff0) == 0x0fe0 && MMC2_bank_latch[0] != 0xfe) | |
| 737 | else if((offset & 0x1ff0) == 0x0fe0 && state->MMC2_bank_latch[0] != 0xfe) | |
| 739 | 738 | { |
| 740 | MMC2_bank_latch[0] = 0xfe; | |
| 741 | pc10_set_videorom_bank(ppu->machine, 0, 4, MMC2_bank[1], 4); | |
| 739 | state->MMC2_bank_latch[0] = 0xfe; | |
| 740 | pc10_set_videorom_bank(ppu->machine, 0, 4, state->MMC2_bank[1], 4); | |
| 742 | 741 | } |
| 743 | else if((offset & 0x1ff0) == 0x1fd0 && MMC2_bank_latch[1] != 0xfd) | |
| 742 | else if((offset & 0x1ff0) == 0x1fd0 && state->MMC2_bank_latch[1] != 0xfd) | |
| 744 | 743 | { |
| 745 | MMC2_bank_latch[1] = 0xfd; | |
| 746 | pc10_set_videorom_bank(ppu->machine, 4, 4, MMC2_bank[2], 4); | |
| 744 | state->MMC2_bank_latch[1] = 0xfd; | |
| 745 | pc10_set_videorom_bank(ppu->machine, 4, 4, state->MMC2_bank[2], 4); | |
| 747 | 746 | } |
| 748 | else if((offset & 0x1ff0) == 0x1fe0 && MMC2_bank_latch[1] != 0xfe) | |
| 747 | else if((offset & 0x1ff0) == 0x1fe0 && state->MMC2_bank_latch[1] != 0xfe) | |
| 749 | 748 | { |
| 750 | MMC2_bank_latch[1] = 0xfe; | |
| 751 | pc10_set_videorom_bank(ppu->machine, 4, 4, MMC2_bank[3], 4); | |
| 749 | state->MMC2_bank_latch[1] = 0xfe; | |
| 750 | pc10_set_videorom_bank(ppu->machine, 4, 4, state->MMC2_bank[3], 4); | |
| 752 | 751 | } |
| 753 | 752 | } |
| 754 | 753 | |
| 755 | 754 | static WRITE8_HANDLER( eboard_rom_switch_w ) |
| 756 | 755 | { |
| 756 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 757 | 757 | /* a variation of mapper 9 on a nes */ |
| 758 | 758 | switch (offset & 0x7000) |
| 759 | 759 | { |
| r10613 | r10614 | |
| 766 | 766 | break; |
| 767 | 767 | |
| 768 | 768 | case 0x3000: /* gfx bank 0 - 4k */ |
| 769 | MMC2_bank[0] = data; | |
| 770 | if (MMC2_bank_latch[0] == 0xfd) | |
| 769 | state->MMC2_bank[0] = data; | |
| 770 | if (state->MMC2_bank_latch[0] == 0xfd) | |
| 771 | 771 | pc10_set_videorom_bank(space->machine, 0, 4, data, 4); |
| 772 | 772 | break; |
| 773 | 773 | |
| 774 | 774 | case 0x4000: /* gfx bank 0 - 4k */ |
| 775 | MMC2_bank[1] = data; | |
| 776 | if (MMC2_bank_latch[0] == 0xfe) | |
| 775 | state->MMC2_bank[1] = data; | |
| 776 | if (state->MMC2_bank_latch[0] == 0xfe) | |
| 777 | 777 | pc10_set_videorom_bank(space->machine, 0, 4, data, 4); |
| 778 | 778 | break; |
| 779 | 779 | |
| 780 | 780 | case 0x5000: /* gfx bank 1 - 4k */ |
| 781 | MMC2_bank[2] = data; | |
| 782 | if (MMC2_bank_latch[1] == 0xfd) | |
| 781 | state->MMC2_bank[2] = data; | |
| 782 | if (state->MMC2_bank_latch[1] == 0xfd) | |
| 783 | 783 | pc10_set_videorom_bank(space->machine, 4, 4, data, 4); |
| 784 | 784 | break; |
| 785 | 785 | |
| 786 | 786 | case 0x6000: /* gfx bank 1 - 4k */ |
| 787 | MMC2_bank[3] = data; | |
| 788 | if (MMC2_bank_latch[1] == 0xfe) | |
| 787 | state->MMC2_bank[3] = data; | |
| 788 | if (state->MMC2_bank_latch[1] == 0xfe) | |
| 789 | 789 | pc10_set_videorom_bank(space->machine, 4, 4, data, 4); |
| 790 | 790 | break; |
| 791 | 791 | |
| 792 | 792 | case 0x7000: /* mirroring */ |
| 793 | pc10_set_mirroring(data ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); | |
| 793 | pc10_set_mirroring(state, data ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); | |
| 794 | 794 | |
| 795 | 795 | break; |
| 796 | 796 | } |
| r10613 | r10614 | |
| 798 | 798 | |
| 799 | 799 | DRIVER_INIT( pceboard ) |
| 800 | 800 | { |
| 801 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 801 | 802 | UINT8 *prg = machine->region("cart")->base(); |
| 802 | 803 | |
| 803 | 804 | /* we have no vram, make sure switching games doesn't point to an old allocation */ |
| 804 | vram = NULL; | |
| 805 | state->vram = NULL; | |
| 805 | 806 | |
| 806 | 807 | /* We do manual banking, in case the code falls through */ |
| 807 | 808 | /* Copy the initial banks */ |
| r10613 | r10614 | |
| 825 | 826 | |
| 826 | 827 | DRIVER_INIT( pcfboard ) |
| 827 | 828 | { |
| 829 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 828 | 830 | UINT8 *prg = machine->region("cart")->base(); |
| 829 | 831 | |
| 830 | 832 | /* we have no vram, make sure switching games doesn't point to an old allocation */ |
| 831 | vram = NULL; | |
| 833 | state->vram = NULL; | |
| 832 | 834 | |
| 833 | 835 | /* We do manual banking, in case the code falls through */ |
| 834 | 836 | /* Copy the initial banks */ |
| 835 | 837 | memcpy(&prg[0x08000], &prg[0x28000], 0x8000); |
| 836 | 838 | |
| 837 | mmc1_rom_mask = 0x07; | |
| 839 | state->mmc1_rom_mask = 0x07; | |
| 838 | 840 | |
| 839 | 841 | /* MMC mapper at writes to $8000-$ffff */ |
| 840 | 842 | memory_install_write8_handler(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, mmc1_rom_switch_w ); |
| r10613 | r10614 | |
| 847 | 849 | |
| 848 | 850 | DRIVER_INIT( pcfboard_2 ) |
| 849 | 851 | { |
| 852 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 850 | 853 | /* extra ram at $6000-$6fff */ |
| 851 | 854 | memory_install_ram(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x6000, 0x6fff, 0, 0, NULL ); |
| 852 | 855 | |
| 853 | vram = NULL; | |
| 856 | state->vram = NULL; | |
| 854 | 857 | |
| 855 | 858 | /* common init */ |
| 856 | 859 | DRIVER_INIT_CALL(pcfboard); |
| r10613 | r10614 | |
| 859 | 862 | /**********************************************************************************/ |
| 860 | 863 | /* G Board games (Super Mario Bros. 3) */ |
| 861 | 864 | |
| 862 | static int gboard_scanline_counter; | |
| 863 | static int gboard_scanline_latch; | |
| 864 | static int gboard_banks[2]; | |
| 865 | static int gboard_4screen; | |
| 866 | static int gboard_last_bank; | |
| 867 | static int gboard_command; | |
| 868 | 865 | |
| 869 | 866 | static void gboard_scanline_cb( device_t *device, int scanline, int vblank, int blanked ) |
| 870 | 867 | { |
| 868 | playch10_state *state = device->machine->driver_data<playch10_state>(); | |
| 871 | 869 | if (!vblank && !blanked) |
| 872 | 870 | { |
| 873 | if (--gboard_scanline_counter == -1) | |
| 871 | if (--state->gboard_scanline_counter == -1) | |
| 874 | 872 | { |
| 875 | gboard_scanline_counter = gboard_scanline_latch; | |
| 873 | state->gboard_scanline_counter = state->gboard_scanline_latch; | |
| 876 | 874 | generic_pulse_irq_line(device->machine->device("cart"), 0); |
| 877 | 875 | } |
| 878 | 876 | } |
| r10613 | r10614 | |
| 880 | 878 | |
| 881 | 879 | static WRITE8_HANDLER( gboard_rom_switch_w ) |
| 882 | 880 | { |
| 881 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 883 | 882 | device_t *ppu = space->machine->device("ppu"); |
| 884 | 883 | |
| 885 | 884 | /* basically, a MMC3 mapper from the nes */ |
| r10613 | r10614 | |
| 887 | 886 | switch (offset & 0x7001) |
| 888 | 887 | { |
| 889 | 888 | case 0x0000: |
| 890 | gboard_command = data; | |
| 889 | state->gboard_command = data; | |
| 891 | 890 | |
| 892 | if (gboard_last_bank != (data & 0xc0)) | |
| 891 | if (state->gboard_last_bank != (data & 0xc0)) | |
| 893 | 892 | { |
| 894 | 893 | int bank; |
| 895 | 894 | UINT8 *prg = space->machine->region("cart")->base(); |
| 896 | 895 | |
| 897 | 896 | /* reset the banks */ |
| 898 | if (gboard_command & 0x40) | |
| 897 | if (state->gboard_command & 0x40) | |
| 899 | 898 | { |
| 900 | 899 | /* high bank */ |
| 901 | bank = gboard_banks[0] * 0x2000 + 0x10000; | |
| 900 | bank = state->gboard_banks[0] * 0x2000 + 0x10000; | |
| 902 | 901 | |
| 903 | 902 | memcpy(&prg[0x0c000], &prg[bank], 0x2000); |
| 904 | 903 | memcpy(&prg[0x08000], &prg[0x4c000], 0x2000); |
| r10613 | r10614 | |
| 906 | 905 | else |
| 907 | 906 | { |
| 908 | 907 | /* low bank */ |
| 909 | bank = gboard_banks[0] * 0x2000 + 0x10000; | |
| 908 | bank = state->gboard_banks[0] * 0x2000 + 0x10000; | |
| 910 | 909 | |
| 911 | 910 | memcpy(&prg[0x08000], &prg[bank], 0x2000); |
| 912 | 911 | memcpy(&prg[0x0c000], &prg[0x4c000], 0x2000); |
| 913 | 912 | } |
| 914 | 913 | |
| 915 | 914 | /* mid bank */ |
| 916 | bank = gboard_banks[1] * 0x2000 + 0x10000; | |
| 915 | bank = state->gboard_banks[1] * 0x2000 + 0x10000; | |
| 917 | 916 | memcpy(&prg[0x0a000], &prg[bank], 0x2000); |
| 918 | 917 | |
| 919 | gboard_last_bank = data & 0xc0; | |
| 918 | state->gboard_last_bank = data & 0xc0; | |
| 920 | 919 | } |
| 921 | 920 | break; |
| 922 | 921 | |
| 923 | 922 | case 0x0001: |
| 924 | 923 | { |
| 925 | UINT8 cmd = gboard_command & 0x07; | |
| 926 | int page = (gboard_command & 0x80) >> 5; | |
| 924 | UINT8 cmd = state->gboard_command & 0x07; | |
| 925 | int page = (state->gboard_command & 0x80) >> 5; | |
| 927 | 926 | int bank; |
| 928 | 927 | |
| 929 | 928 | switch (cmd) |
| r10613 | r10614 | |
| 946 | 945 | case 6: /* program banking */ |
| 947 | 946 | { |
| 948 | 947 | UINT8 *prg = space->machine->region("cart")->base(); |
| 949 | if (gboard_command & 0x40) | |
| 948 | if (state->gboard_command & 0x40) | |
| 950 | 949 | { |
| 951 | 950 | /* high bank */ |
| 952 | gboard_banks[0] = data & 0x1f; | |
| 953 | bank = (gboard_banks[0]) * 0x2000 + 0x10000; | |
| 951 | state->gboard_banks[0] = data & 0x1f; | |
| 952 | bank = (state->gboard_banks[0]) * 0x2000 + 0x10000; | |
| 954 | 953 | |
| 955 | 954 | memcpy(&prg[0x0c000], &prg[bank], 0x2000); |
| 956 | 955 | memcpy(&prg[0x08000], &prg[0x4c000], 0x2000); |
| r10613 | r10614 | |
| 958 | 957 | else |
| 959 | 958 | { |
| 960 | 959 | /* low bank */ |
| 961 | gboard_banks[0] = data & 0x1f; | |
| 962 | bank = (gboard_banks[0]) * 0x2000 + 0x10000; | |
| 960 | state->gboard_banks[0] = data & 0x1f; | |
| 961 | bank = (state->gboard_banks[0]) * 0x2000 + 0x10000; | |
| 963 | 962 | |
| 964 | 963 | memcpy(&prg[0x08000], &prg[bank], 0x2000); |
| 965 | 964 | memcpy(&prg[0x0c000], &prg[0x4c000], 0x2000); |
| r10613 | r10614 | |
| 971 | 970 | { |
| 972 | 971 | /* mid bank */ |
| 973 | 972 | UINT8 *prg = space->machine->region("cart")->base(); |
| 974 | gboard_banks[1] = data & 0x1f; | |
| 975 | bank = gboard_banks[1] * 0x2000 + 0x10000; | |
| 973 | state->gboard_banks[1] = data & 0x1f; | |
| 974 | bank = state->gboard_banks[1] * 0x2000 + 0x10000; | |
| 976 | 975 | |
| 977 | 976 | memcpy(&prg[0x0a000], &prg[bank], 0x2000); |
| 978 | 977 | } |
| r10613 | r10614 | |
| 982 | 981 | break; |
| 983 | 982 | |
| 984 | 983 | case 0x2000: /* mirroring */ |
| 985 | if (!gboard_4screen) | |
| 984 | if (!state->gboard_4screen) | |
| 986 | 985 | { |
| 987 | 986 | if (data & 0x40) |
| 988 | pc10_set_mirroring(PPU_MIRROR_HIGH); | |
| 987 | pc10_set_mirroring(state, PPU_MIRROR_HIGH); | |
| 989 | 988 | else |
| 990 | pc10_set_mirroring((data & 1) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); | |
| 989 | pc10_set_mirroring(state, (data & 1) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); | |
| 991 | 990 | } |
| 992 | 991 | break; |
| 993 | 992 | |
| r10613 | r10614 | |
| 996 | 995 | break; |
| 997 | 996 | |
| 998 | 997 | case 0x4000: /* scanline counter */ |
| 999 | gboard_scanline_counter = data; | |
| 998 | state->gboard_scanline_counter = data; | |
| 1000 | 999 | break; |
| 1001 | 1000 | |
| 1002 | 1001 | case 0x4001: /* scanline latch */ |
| 1003 | gboard_scanline_latch = data; | |
| 1002 | state->gboard_scanline_latch = data; | |
| 1004 | 1003 | break; |
| 1005 | 1004 | |
| 1006 | 1005 | case 0x6000: /* disable irqs */ |
| r10613 | r10614 | |
| 1015 | 1014 | |
| 1016 | 1015 | DRIVER_INIT( pcgboard ) |
| 1017 | 1016 | { |
| 1017 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 1018 | 1018 | UINT8 *prg = machine->region("cart")->base(); |
| 1019 | vram = NULL; | |
| 1019 | state->vram = NULL; | |
| 1020 | 1020 | |
| 1021 | 1021 | /* We do manual banking, in case the code falls through */ |
| 1022 | 1022 | /* Copy the initial banks */ |
| r10613 | r10614 | |
| 1029 | 1029 | /* extra ram at $6000-$7fff */ |
| 1030 | 1030 | memory_install_ram(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, NULL ); |
| 1031 | 1031 | |
| 1032 | gboard_banks[0] = 0x1e; | |
| 1033 | gboard_banks[1] = 0x1f; | |
| 1034 | gboard_scanline_counter = 0; | |
| 1035 | gboard_scanline_latch = 0; | |
| 1036 | gboard_4screen = 0; | |
| 1032 | state->gboard_banks[0] = 0x1e; | |
| 1033 | state->gboard_banks[1] = 0x1f; | |
| 1034 | state->gboard_scanline_counter = 0; | |
| 1035 | state->gboard_scanline_latch = 0; | |
| 1036 | state->gboard_4screen = 0; | |
| 1037 | 1037 | |
| 1038 | 1038 | /* common init */ |
| 1039 | 1039 | DRIVER_INIT_CALL(playch10); |
| r10613 | r10614 | |
| 1041 | 1041 | |
| 1042 | 1042 | DRIVER_INIT( pcgboard_type2 ) |
| 1043 | 1043 | { |
| 1044 | vram = NULL; | |
| 1044 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 1045 | state->vram = NULL; | |
| 1045 | 1046 | /* common init */ |
| 1046 | 1047 | DRIVER_INIT_CALL(pcgboard); |
| 1047 | 1048 | |
| 1048 | 1049 | /* enable 4 screen mirror */ |
| 1049 | gboard_4screen = 1; | |
| 1050 | state->gboard_4screen = 1; | |
| 1050 | 1051 | } |
| 1051 | 1052 | |
| 1052 | 1053 | /**********************************************************************************/ |
| r10613 | r10614 | |
| 1054 | 1055 | |
| 1055 | 1056 | static WRITE8_HANDLER( iboard_rom_switch_w ) |
| 1056 | 1057 | { |
| 1058 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 1057 | 1059 | int bank = data & 7; |
| 1058 | 1060 | UINT8 *prg = space->machine->region("cart")->base(); |
| 1059 | 1061 | |
| 1060 | 1062 | if (data & 0x10) |
| 1061 | pc10_set_mirroring(PPU_MIRROR_HIGH); | |
| 1063 | pc10_set_mirroring(state, PPU_MIRROR_HIGH); | |
| 1062 | 1064 | else |
| 1063 | pc10_set_mirroring(PPU_MIRROR_LOW); | |
| 1065 | pc10_set_mirroring(state, PPU_MIRROR_LOW); | |
| 1064 | 1066 | |
| 1065 | 1067 | memcpy(&prg[0x08000], &prg[bank * 0x8000 + 0x10000], 0x8000); |
| 1066 | 1068 | } |
| 1067 | 1069 | |
| 1068 | 1070 | DRIVER_INIT( pciboard ) |
| 1069 | 1071 | { |
| 1072 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 1070 | 1073 | UINT8 *prg = machine->region("cart")->base(); |
| 1071 | 1074 | |
| 1072 | 1075 | /* We do manual banking, in case the code falls through */ |
| r10613 | r10614 | |
| 1080 | 1083 | DRIVER_INIT_CALL(playch10); |
| 1081 | 1084 | |
| 1082 | 1085 | /* allocate vram */ |
| 1083 | vram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 1086 | state->vram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 1084 | 1087 | /* special init */ |
| 1085 | 1088 | set_videoram_bank(machine, 0, 8, 0, 8); |
| 1086 | 1089 | } |
| r10613 | r10614 | |
| 1090 | 1093 | |
| 1091 | 1094 | static WRITE8_HANDLER( hboard_rom_switch_w ) |
| 1092 | 1095 | { |
| 1096 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 1093 | 1097 | switch (offset & 0x7001) |
| 1094 | 1098 | { |
| 1095 | 1099 | case 0x0001: |
| 1096 | 1100 | { |
| 1097 | UINT8 cmd = gboard_command & 0x07; | |
| 1098 | int page = (gboard_command & 0x80) >> 5; | |
| 1101 | UINT8 cmd = state->gboard_command & 0x07; | |
| 1102 | int page = (state->gboard_command & 0x80) >> 5; | |
| 1099 | 1103 | |
| 1100 | 1104 | switch (cmd) |
| 1101 | 1105 | { |
| r10613 | r10614 | |
| 1136 | 1140 | |
| 1137 | 1141 | DRIVER_INIT( pchboard ) |
| 1138 | 1142 | { |
| 1143 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 1139 | 1144 | UINT8 *prg = machine->region("cart")->base(); |
| 1140 | 1145 | memcpy(&prg[0x08000], &prg[0x4c000], 0x4000); |
| 1141 | 1146 | memcpy(&prg[0x0c000], &prg[0x4c000], 0x4000); |
| r10613 | r10614 | |
| 1146 | 1151 | /* extra ram at $6000-$7fff */ |
| 1147 | 1152 | memory_install_ram(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, NULL ); |
| 1148 | 1153 | |
| 1149 | gboard_banks[0] = 0x1e; | |
| 1150 | gboard_banks[1] = 0x1f; | |
| 1151 | gboard_scanline_counter = 0; | |
| 1152 | gboard_scanline_latch = 0; | |
| 1153 | gboard_last_bank = 0xff; | |
| 1154 | gboard_command = 0; | |
| 1154 | state->gboard_banks[0] = 0x1e; | |
| 1155 | state->gboard_banks[1] = 0x1f; | |
| 1156 | state->gboard_scanline_counter = 0; | |
| 1157 | state->gboard_scanline_latch = 0; | |
| 1158 | state->gboard_last_bank = 0xff; | |
| 1159 | state->gboard_command = 0; | |
| 1155 | 1160 | |
| 1156 | 1161 | /* common init */ |
| 1157 | 1162 | DRIVER_INIT_CALL(playch10); |
| r10613 | r10614 | |
| 1162 | 1167 | |
| 1163 | 1168 | DRIVER_INIT( pckboard ) |
| 1164 | 1169 | { |
| 1170 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 1165 | 1171 | UINT8 *prg = machine->region("cart")->base(); |
| 1166 | 1172 | |
| 1167 | 1173 | /* We do manual banking, in case the code falls through */ |
| 1168 | 1174 | /* Copy the initial banks */ |
| 1169 | 1175 | memcpy(&prg[0x08000], &prg[0x48000], 0x8000); |
| 1170 | 1176 | |
| 1171 | mmc1_rom_mask = 0x0f; | |
| 1177 | state->mmc1_rom_mask = 0x0f; | |
| 1172 | 1178 | |
| 1173 | 1179 | /* extra ram at $6000-$7fff */ |
| 1174 | 1180 | memory_install_ram(cputag_get_address_space(machine, "cart", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, NULL ); |
| r10613 | r10614 | |
| 1180 | 1186 | DRIVER_INIT_CALL(playch10); |
| 1181 | 1187 | |
| 1182 | 1188 | /* allocate vram */ |
| 1183 | vram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 1189 | state->vram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 1184 | 1190 | /* special init */ |
| 1185 | 1191 | set_videoram_bank(machine, 0, 8, 0, 8); |
| 1186 | 1192 | } |
| r10613 | r10614 | |
|---|---|---|
| 454 | 454 | 0x7c, 0x01, 0x43, 0xdb, 0x53, 0x85, 0xfe, 0x78, 0x91, 0x40, 0xa3, 0xdf, 0x4f, 0xff, 0x10, 0x6c, |
| 455 | 455 | }; |
| 456 | 456 | |
| 457 | void pgm_mm_decrypt(running_machine *machine) | |
| 457 | void pgm_mm_decrypt(running_machine *machine) // and dw2001 | |
| 458 | 458 | { |
| 459 | 459 | int i; |
| 460 | 460 | UINT16 *src = (UINT16 *)(machine->region("user1")->base()); |
| r10613 | r10614 | |
| 946 | 946 | } |
| 947 | 947 | } |
| 948 | 948 | |
| 949 | /* not 100% correct */ | |
| 950 | static const UINT8 dw2001_tab[256] = { | |
| 951 | 0xd0,0x45,0xbc,0x84,0x93,0x60,0x7d,0x49,0x68,0xb1,0x54,0xa2,0x05,0x29,0x41,0x20, | |
| 952 | 0x04,0x08,0x52,0x25,0x89,0xf4,0x69,0x9f,0x24,0x46,0x3d,0xf1,0xf9,0xab,0xa6,0x2d, | |
| 953 | 0x18,0x19,0x6d,0x33,0x79,0x23,0x3b,0x1d,0xe0,0xb8,0x61,0x1a,0xe1,0x4c,0x5d,0x3f, | |
| 954 | 0x5e,0x02,0xe3,0x4d,0x9e,0X80,0x28,0x50,0xa0,0x81,0xe4,0xa5,0x97,0xa1,0x86,0x36, | |
| 955 | 0x1e,0xed,0x16,0x8a,0x44,0x06,0x64,0x12,0x9a,0x7e,0xce,0x9b,0xef,0xf7,0x3e,0xf8, | |
| 956 | 0x15,0x07,0xcb,0x6f,0x8e,0x3c,0x82,0x70,0x62,0x8d,0x66,0x7a,0x4e,0xd3,0xb6,0x6a, | |
| 957 | 0x51,0xa7,0x2c,0xc7,0xa4,0x0b,0xb5,0xe5,0x88,0xbd,0x5a,0x5b,0x1b,0xae,0xe6,0X5F, | |
| 958 | 0x2e,0x92,0x8c,0xb7,0x96,0xba,0x99,0xbb,0xbe,0x0e,0xbf,0xe7,0x2f,0xe9,0x30,0x37, | |
| 959 | 0x98,0xac,0x4a,0x94,0x38,0xf3,0x39,0xb2,0x55,0x72,0x7b,0xee,0xdd,0x6e,0x11,0xd5, | |
| 960 | 0x26,0xa8,0x71,0xd6,0x74,0x7f,0x13,0xc2,0x56,0xea,0xa9,0xaf,0XC3,0x42,0x03,0xb3, | |
| 961 | 0xc4,0x6b,0x47,0xf0,0x31,0xf5,0xaa,0x58,0x8f,0x48,0x75,0x95,0x35,0x8b,0x57,0x3a, | |
| 962 | 0x73,0x0c,0x59,0xd8,0x14,0x65,0xd7,0x00,0xfa,0xdc,0x34,0xde,0xc0,0xb0,0x87,0xc1, | |
| 963 | 0xc8,0xcd,0xd4,0x2a,0xda,0xe8,0xd2,0x83,0x0d,0xca,0xf2,0x0f,0xeb,0xec,0x9c,0x1f, | |
| 964 | 0xad,0x22,0xd1,0x4b,0x5c,0xf6,0x17,0xc5,0x67,0x9d,0xfb,0xc9,0xcc,0x32,0x1c,0xb4, | |
| 965 | 0xd9,0xe2,0xcf,0x90,0xb9,0x2b,0x61,0xc6,0x76,0x21,0x77,0x27,0xfc,0xfd,0x0a,0x09, | |
| 966 | 0x7c,0x01,0x43,0xdb,0x53,0x87,0xfe,0x78,0x91,0x40,0xa3,0xdf,0x4f,0xff,0x10,0x6c, | |
| 967 | }; | |
| 968 | ||
| 969 | void pgm_dw2001_decrypt(running_machine *machine) | |
| 970 | { | |
| 971 | int i; | |
| 972 | UINT16 *src = (UINT16 *)(machine->region("user1")->base()); | |
| 973 | ||
| 974 | int rom_size = 0x200000; | |
| 975 | ||
| 976 | for(i=0; i<rom_size/2; i++) { | |
| 977 | UINT16 x = src[i]; | |
| 978 | ||
| 979 | if((i & 0x000480) != 0x00080) | |
| 980 | x^=0x0001; | |
| 981 | ||
| 982 | if((i & 0x004008) == 0x004008) | |
| 983 | x^=0x0002; | |
| 984 | ||
| 985 | if((i & 0x000030) == 0x000010) | |
| 986 | x^=0x0004; | |
| 987 | ||
| 988 | if((i & 0x000242) != 0x000042) | |
| 989 | x^=0x0008; | |
| 990 | ||
| 991 | if((i & 0x02004) != 0x00004) | |
| 992 | x^=0x0020; | |
| 993 | ||
| 994 | if((i & 0x11800) != 0x10000) | |
| 995 | x^=0x0040; | |
| 996 | ||
| 997 | if((i & 0x00820) == 0x00820) | |
| 998 | x^=0x0080; | |
| 999 | ||
| 1000 | x ^= dw2001_tab[(i >> 1) & 0xff] << 8; | |
| 1001 | ||
| 1002 | src[i] = x; | |
| 1003 | } | |
| 1004 | } | |
| 1005 | ||
| 1006 | /* todo: */ | |
| 1007 | 949 | static const UINT8 py2k2_tab[256] = { |
| 1008 | 950 | 0x74, 0xe8, 0xa8, 0x64, 0x26, 0x44, 0xa6, 0x9a, 0xa5, 0x69, 0xa2, 0xd3, 0x6d, 0xba, 0xff, 0xf3, |
| 1009 | 951 | 0xeb, 0x6e, 0xe3, 0x70, 0x72, 0x58, 0x27, 0xd9, 0xe4, 0x9f, 0x50, 0xa2, 0xdd, 0xce, 0x6e, 0xf6, |
| r10613 | r10614 | |
|---|---|---|
| 597 | 597 | /* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */ |
| 598 | 598 | offs_t A; |
| 599 | 599 | UINT8 *rom = machine->region("audiocpu")->base(); |
| 600 | ||
| 601 | ||
| 600 | ||
| 601 | ||
| 602 | 602 | for (A = 0;A < 0x0800;A++) |
| 603 | 603 | rom[A] = BITSWAP8(rom[A],7,6,5,4,3,2,0,1); |
| 604 | 604 | } |
| r10613 | r10614 | |
|---|---|---|
| 11 | 11 | #include "video/ppu2c0x.h" |
| 12 | 12 | #include "includes/vsnes.h" |
| 13 | 13 | |
| 14 | /* Globals */ | |
| 15 | static int vsnes_do_vrom_bank; | |
| 16 | 14 | |
| 17 | /* Locals */ | |
| 18 | static int input_latch[4]; | |
| 19 | ||
| 20 | static int sound_fix=0; | |
| 21 | static UINT8 last_bank; | |
| 22 | ||
| 23 | 15 | /* PPU notes */ |
| 24 | 16 | /* nametable is, per Lord Nightmare, always 4K per PPU */ |
| 25 | 17 | /* The vsnes system has relatively few banking options for CHR */ |
| 26 | 18 | /* Each driver will use ROM or RAM for CHR, never both, and RAM is never banked */ |
| 27 | 19 | /* This leads to the memory system being an optimal place to perform banking */ |
| 28 | 20 | |
| 29 | /* need double pointers for vsdual */ | |
| 30 | static UINT8* vram = NULL; | |
| 31 | static UINT8* vrom[2]; | |
| 32 | static UINT8* nt_ram[2]; | |
| 33 | static UINT8* nt_page[2][4]; // because mirroring is used. | |
| 34 | static UINT32 vrom_size[2]; | |
| 35 | static int vrom_banks; | |
| 36 | ||
| 37 | 21 | /* Prototypes for mapping board components to PPU bus */ |
| 38 | 22 | static WRITE8_HANDLER( vsnes_nt0_w ); |
| 39 | 23 | static WRITE8_HANDLER( vsnes_nt1_w ); |
| r10613 | r10614 | |
| 50 | 34 | |
| 51 | 35 | WRITE8_HANDLER( vsnes_in0_w ) |
| 52 | 36 | { |
| 37 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 53 | 38 | /* Toggling bit 0 high then low resets both controllers */ |
| 54 | 39 | if (data & 1) |
| 55 | 40 | { |
| 56 | 41 | /* load up the latches */ |
| 57 | input_latch[0] = input_port_read(space->machine, "IN0"); | |
| 58 | input_latch[1] = input_port_read(space->machine, "IN1"); | |
| 42 | state->input_latch[0] = input_port_read(space->machine, "IN0"); | |
| 43 | state->input_latch[1] = input_port_read(space->machine, "IN1"); | |
| 59 | 44 | } |
| 60 | 45 | } |
| 61 | 46 | |
| 62 | 47 | static READ8_HANDLER( gun_in0_r ) |
| 63 | 48 | { |
| 64 | int ret = (input_latch[0]) & 1; | |
| 49 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 50 | int ret = (state->input_latch[0]) & 1; | |
| 65 | 51 | |
| 66 | 52 | /* shift */ |
| 67 | input_latch[0] >>= 1; | |
| 53 | state->input_latch[0] >>= 1; | |
| 68 | 54 | |
| 69 | 55 | ret |= input_port_read(space->machine, "COINS"); /* merge coins, etc */ |
| 70 | 56 | ret |= (input_port_read(space->machine, "DSW0") & 3) << 3; /* merge 2 dipswitches */ |
| r10613 | r10614 | |
| 72 | 58 | /* The gun games expect a 1 returned on every 5th read after sound_fix is reset*/ |
| 73 | 59 | /* Info Supplied by Ben Parnell <xodnizel@home.com> of FCE Ultra fame */ |
| 74 | 60 | |
| 75 | if (sound_fix == 4) | |
| 61 | if (state->sound_fix == 4) | |
| 76 | 62 | { |
| 77 | 63 | ret = 1; |
| 78 | 64 | } |
| 79 | 65 | |
| 80 | sound_fix++; | |
| 66 | state->sound_fix++; | |
| 81 | 67 | |
| 82 | 68 | return ret; |
| 83 | 69 | |
| r10613 | r10614 | |
| 85 | 71 | |
| 86 | 72 | READ8_HANDLER( vsnes_in0_r ) |
| 87 | 73 | { |
| 74 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 88 | 75 | |
| 89 | int ret = (input_latch[0]) & 1; | |
| 76 | int ret = (state->input_latch[0]) & 1; | |
| 90 | 77 | |
| 91 | 78 | /* shift */ |
| 92 | input_latch[0] >>= 1; | |
| 79 | state->input_latch[0] >>= 1; | |
| 93 | 80 | |
| 94 | 81 | ret |= input_port_read(space->machine, "COINS"); /* merge coins, etc */ |
| 95 | 82 | ret |= (input_port_read(space->machine, "DSW0") & 3) << 3; /* merge 2 dipswitches */ |
| r10613 | r10614 | |
| 100 | 87 | |
| 101 | 88 | READ8_HANDLER( vsnes_in1_r ) |
| 102 | 89 | { |
| 103 | int ret = (input_latch[1]) & 1; | |
| 90 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 91 | int ret = (state->input_latch[1]) & 1; | |
| 104 | 92 | |
| 105 | 93 | ret |= input_port_read(space->machine, "DSW0") & ~3; /* merge the rest of the dipswitches */ |
| 106 | 94 | |
| 107 | 95 | /* shift */ |
| 108 | input_latch[1] >>= 1; | |
| 96 | state->input_latch[1] >>= 1; | |
| 109 | 97 | |
| 110 | 98 | return ret; |
| 111 | 99 | } |
| 112 | 100 | |
| 113 | 101 | WRITE8_HANDLER( vsnes_in0_1_w ) |
| 114 | 102 | { |
| 103 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 115 | 104 | /* Toggling bit 0 high then low resets both controllers */ |
| 116 | 105 | if (data & 1) |
| 117 | 106 | { |
| 118 | 107 | /* load up the latches */ |
| 119 | input_latch[2] = input_port_read(space->machine, "IN2"); | |
| 120 | input_latch[3] = input_port_read(space->machine, "IN3"); | |
| 108 | state->input_latch[2] = input_port_read(space->machine, "IN2"); | |
| 109 | state->input_latch[3] = input_port_read(space->machine, "IN3"); | |
| 121 | 110 | } |
| 122 | 111 | } |
| 123 | 112 | |
| 124 | 113 | READ8_HANDLER( vsnes_in0_1_r ) |
| 125 | 114 | { |
| 126 | int ret = (input_latch[2]) & 1; | |
| 115 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 116 | int ret = (state->input_latch[2]) & 1; | |
| 127 | 117 | |
| 128 | 118 | /* shift */ |
| 129 | input_latch[2] >>= 1; | |
| 119 | state->input_latch[2] >>= 1; | |
| 130 | 120 | |
| 131 | 121 | ret |= input_port_read(space->machine, "COINS2"); /* merge coins, etc */ |
| 132 | 122 | ret |= (input_port_read(space->machine, "DSW1") & 3) << 3; /* merge 2 dipswitches */ |
| r10613 | r10614 | |
| 135 | 125 | |
| 136 | 126 | READ8_HANDLER( vsnes_in1_1_r ) |
| 137 | 127 | { |
| 138 | int ret = (input_latch[3]) & 1; | |
| 128 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 129 | int ret = (state->input_latch[3]) & 1; | |
| 139 | 130 | |
| 140 | 131 | ret |= input_port_read(space->machine, "DSW1") & ~3; /* merge the rest of the dipswitches */ |
| 141 | 132 | |
| 142 | 133 | /* shift */ |
| 143 | input_latch[3] >>= 1; | |
| 134 | state->input_latch[3] >>= 1; | |
| 144 | 135 | |
| 145 | 136 | return ret; |
| 146 | 137 | |
| r10613 | r10614 | |
| 154 | 145 | |
| 155 | 146 | MACHINE_RESET( vsnes ) |
| 156 | 147 | { |
| 148 | vsnes_state *state = machine->driver_data<vsnes_state>(); | |
| 157 | 149 | |
| 158 | last_bank = 0xff; | |
| 159 | sound_fix = 0; | |
| 160 | input_latch[0] = input_latch[1] = 0; | |
| 161 | input_latch[2] = input_latch[3] = 0; | |
| 150 | state->last_bank = 0xff; | |
| 151 | state->sound_fix = 0; | |
| 152 | state->input_latch[0] = state->input_latch[1] = 0; | |
| 153 | state->input_latch[2] = state->input_latch[3] = 0; | |
| 162 | 154 | |
| 163 | 155 | } |
| 164 | 156 | |
| r10613 | r10614 | |
| 170 | 162 | |
| 171 | 163 | MACHINE_RESET( vsdual ) |
| 172 | 164 | { |
| 165 | vsnes_state *state = machine->driver_data<vsnes_state>(); | |
| 173 | 166 | |
| 174 | input_latch[0] = input_latch[1] = 0; | |
| 175 | input_latch[2] = input_latch[3] = 0; | |
| 167 | state->input_latch[0] = state->input_latch[1] = 0; | |
| 168 | state->input_latch[2] = state->input_latch[3] = 0; | |
| 176 | 169 | |
| 177 | 170 | } |
| 178 | 171 | |
| r10613 | r10614 | |
| 184 | 177 | |
| 185 | 178 | static void v_set_videorom_bank( running_machine* machine, int start, int count, int vrom_start_bank ) |
| 186 | 179 | { |
| 180 | vsnes_state *state = machine->driver_data<vsnes_state>(); | |
| 187 | 181 | int i; |
| 188 | 182 | |
| 189 | 183 | assert(start + count <= 8); |
| 190 | 184 | |
| 191 | vrom_start_bank &= (vrom_banks - 1); | |
| 192 | assert(vrom_start_bank + count <= vrom_banks); | |
| 185 | vrom_start_bank &= (state->vrom_banks - 1); | |
| 186 | assert(vrom_start_bank + count <= state->vrom_banks); | |
| 193 | 187 | |
| 194 | 188 | /* bank_size_in_kb is used to determine how large the "bank" parameter is */ |
| 195 | 189 | /* count determines the size of the area mapped */ |
| r10613 | r10614 | |
| 201 | 195 | |
| 202 | 196 | MACHINE_START( vsnes ) |
| 203 | 197 | { |
| 198 | vsnes_state *state = machine->driver_data<vsnes_state>(); | |
| 204 | 199 | address_space *ppu1_space = cpu_get_address_space(machine->device("ppu1"), ADDRESS_SPACE_PROGRAM); |
| 205 | 200 | int i; |
| 206 | 201 | |
| 207 | 202 | /* establish nametable ram */ |
| 208 | nt_ram[0] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 203 | state->nt_ram[0] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 209 | 204 | /* set mirroring */ |
| 210 | nt_page[0][0] = nt_ram[0]; | |
| 211 | nt_page[0][1] = nt_ram[0] + 0x400; | |
| 212 | nt_page[0][2] = nt_ram[0] + 0x800; | |
| 213 | nt_page[0][3] = nt_ram[0] + 0xc00; | |
| 205 | state->nt_page[0][0] = state->nt_ram[0]; | |
| 206 | state->nt_page[0][1] = state->nt_ram[0] + 0x400; | |
| 207 | state->nt_page[0][2] = state->nt_ram[0] + 0x800; | |
| 208 | state->nt_page[0][3] = state->nt_ram[0] + 0xc00; | |
| 214 | 209 | |
| 215 | 210 | memory_install_readwrite8_handler(ppu1_space, 0x2000, 0x3eff, 0, 0, vsnes_nt0_r, vsnes_nt0_w); |
| 216 | 211 | |
| 217 | vrom[0] = machine->region("gfx1")->base(); | |
| 218 | vrom_size[0] = machine->region("gfx1")->bytes(); | |
| 219 | vrom_banks = vrom_size[0] / 0x400; | |
| 212 | state->vrom[0] = machine->region("gfx1")->base(); | |
| 213 | state->vrom_size[0] = machine->region("gfx1")->bytes(); | |
| 214 | state->vrom_banks = state->vrom_size[0] / 0x400; | |
| 220 | 215 | |
| 221 | 216 | /* establish chr banks */ |
| 222 | 217 | /* bank 1 is used already! */ |
| 223 | 218 | /* DRIVER_INIT is called first - means we can handle this different for VRAM games! */ |
| 224 | if (NULL != vrom[0]) | |
| 219 | if (NULL != state->vrom[0]) | |
| 225 | 220 | { |
| 226 | 221 | for (i = 0; i < 8; i++) |
| 227 | 222 | { |
| 228 | 223 | memory_install_read_bank(ppu1_space, 0x0400 * i, 0x0400 * i + 0x03ff, 0, 0, chr_banknames[i]); |
| 229 | memory_configure_bank(machine, chr_banknames[i], 0, vrom_banks, vrom[0], 0x400); | |
| 224 | memory_configure_bank(machine, chr_banknames[i], 0, state->vrom_banks, state->vrom[0], 0x400); | |
| 230 | 225 | } |
| 231 | 226 | v_set_videorom_bank(machine, 0, 8, 0); |
| 232 | 227 | } |
| 233 | 228 | else |
| 234 | 229 | { |
| 235 | memory_install_ram(ppu1_space, 0x0000, 0x1fff, 0, 0, vram); | |
| 230 | memory_install_ram(ppu1_space, 0x0000, 0x1fff, 0, 0, state->vram); | |
| 236 | 231 | } |
| 237 | 232 | } |
| 238 | 233 | |
| 239 | 234 | MACHINE_START( vsdual ) |
| 240 | 235 | { |
| 241 | vrom[0] = machine->region("gfx1")->base(); | |
| 242 | vrom[1] = machine->region("gfx2")->base(); | |
| 243 | vrom_size[0] = machine->region("gfx1")->bytes(); | |
| 244 | vrom_size[1] = machine->region("gfx2")->bytes(); | |
| 236 | vsnes_state *state = machine->driver_data<vsnes_state>(); | |
| 237 | state->vrom[0] = machine->region("gfx1")->base(); | |
| 238 | state->vrom[1] = machine->region("gfx2")->base(); | |
| 239 | state->vrom_size[0] = machine->region("gfx1")->bytes(); | |
| 240 | state->vrom_size[1] = machine->region("gfx2")->bytes(); | |
| 245 | 241 | |
| 246 | 242 | /* establish nametable ram */ |
| 247 | nt_ram[0] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 248 | nt_ram[1] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 243 | state->nt_ram[0] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 244 | state->nt_ram[1] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 249 | 245 | /* set mirroring */ |
| 250 | nt_page[0][0] = nt_ram[0]; | |
| 251 | nt_page[0][1] = nt_ram[0] + 0x400; | |
| 252 | nt_page[0][2] = nt_ram[0] + 0x800; | |
| 253 | nt_page[0][3] = nt_ram[0] + 0xc00; | |
| 254 | nt_page[1][0] = nt_ram[1]; | |
| 255 | nt_page[1][1] = nt_ram[1] + 0x400; | |
| 256 | nt_page[1][2] = nt_ram[1] + 0x800; | |
| 257 | nt_page[1][3] = nt_ram[1] + 0xc00; | |
| 246 | state->nt_page[0][0] = state->nt_ram[0]; | |
| 247 | state->nt_page[0][1] = state->nt_ram[0] + 0x400; | |
| 248 | state->nt_page[0][2] = state->nt_ram[0] + 0x800; | |
| 249 | state->nt_page[0][3] = state->nt_ram[0] + 0xc00; | |
| 250 | state->nt_page[1][0] = state->nt_ram[1]; | |
| 251 | state->nt_page[1][1] = state->nt_ram[1] + 0x400; | |
| 252 | state->nt_page[1][2] = state->nt_ram[1] + 0x800; | |
| 253 | state->nt_page[1][3] = state->nt_ram[1] + 0xc00; | |
| 258 | 254 | |
| 259 | 255 | memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu1"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, vsnes_nt0_r, vsnes_nt0_w); |
| 260 | 256 | memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu2"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, vsnes_nt1_r, vsnes_nt1_w); |
| r10613 | r10614 | |
| 262 | 258 | memory_install_read_bank(cpu_get_address_space(machine->device("ppu1"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank2"); |
| 263 | 259 | // read only! |
| 264 | 260 | memory_install_read_bank(cpu_get_address_space(machine->device("ppu2"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank3"); |
| 265 | memory_configure_bank(machine, "bank2", 0, vrom_size[0] / 0x2000, vrom[0], 0x2000); | |
| 266 | memory_configure_bank(machine, "bank3", 0, vrom_size[1] / 0x2000, vrom[1], 0x2000); | |
| 261 | memory_configure_bank(machine, "bank2", 0, state->vrom_size[0] / 0x2000, state->vrom[0], 0x2000); | |
| 262 | memory_configure_bank(machine, "bank3", 0, state->vrom_size[1] / 0x2000, state->vrom[1], 0x2000); | |
| 267 | 263 | memory_set_bank(machine, "bank2", 0); |
| 268 | 264 | memory_set_bank(machine, "bank3", 0); |
| 269 | 265 | } |
| r10613 | r10614 | |
| 276 | 272 | |
| 277 | 273 | static WRITE8_HANDLER( vsnes_nt0_w ) |
| 278 | 274 | { |
| 275 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 279 | 276 | int page = ((offset & 0xc00) >> 10); |
| 280 | nt_page[0][page][offset & 0x3ff] = data; | |
| 277 | state->nt_page[0][page][offset & 0x3ff] = data; | |
| 281 | 278 | } |
| 282 | 279 | |
| 283 | 280 | static WRITE8_HANDLER( vsnes_nt1_w ) |
| 284 | 281 | { |
| 282 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 285 | 283 | int page = ((offset & 0xc00) >> 10); |
| 286 | nt_page[1][page][offset & 0x3ff] = data; | |
| 284 | state->nt_page[1][page][offset & 0x3ff] = data; | |
| 287 | 285 | } |
| 288 | 286 | |
| 289 | 287 | static READ8_HANDLER( vsnes_nt0_r ) |
| 290 | 288 | { |
| 289 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 291 | 290 | int page = ((offset&0xc00) >> 10); |
| 292 | return nt_page[0][page][offset & 0x3ff]; | |
| 291 | return state->nt_page[0][page][offset & 0x3ff]; | |
| 293 | 292 | } |
| 294 | 293 | |
| 295 | 294 | static READ8_HANDLER( vsnes_nt1_r ) |
| 296 | 295 | { |
| 296 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 297 | 297 | int page = ((offset & 0xc00) >> 10); |
| 298 | return nt_page[1][page][offset & 0x3ff]; | |
| 298 | return state->nt_page[1][page][offset & 0x3ff]; | |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | static void v_set_mirroring( int ppu, int mirroring ) | |
| 301 | static void v_set_mirroring( vsnes_state *state, int ppu, int mirroring ) | |
| 302 | 302 | { |
| 303 | 303 | switch (mirroring) |
| 304 | 304 | { |
| 305 | 305 | case PPU_MIRROR_LOW: |
| 306 | nt_page[ppu][0] = nt_page[ppu][1] = nt_page[ppu][2] = nt_page[ppu][3] = nt_ram[ppu]; | |
| 306 | state->nt_page[ppu][0] = state->nt_page[ppu][1] = state->nt_page[ppu][2] = state->nt_page[ppu][3] = state->nt_ram[ppu]; | |
| 307 | 307 | break; |
| 308 | 308 | case PPU_MIRROR_HIGH: |
| 309 | nt_page[ppu][0] = nt_page[ppu][1] = nt_page[ppu][2] = nt_page[ppu][3] = nt_ram[ppu] + 0x400; | |
| 309 | state->nt_page[ppu][0] = state->nt_page[ppu][1] = state->nt_page[ppu][2] = state->nt_page[ppu][3] = state->nt_ram[ppu] + 0x400; | |
| 310 | 310 | break; |
| 311 | 311 | case PPU_MIRROR_HORZ: |
| 312 | nt_page[ppu][0] = nt_ram[ppu]; | |
| 313 | nt_page[ppu][1] = nt_ram[ppu]; | |
| 314 | nt_page[ppu][2] = nt_ram[ppu] + 0x400; | |
| 315 | nt_page[ppu][3] = nt_ram[ppu] + 0x400; | |
| 312 | state->nt_page[ppu][0] = state->nt_ram[ppu]; | |
| 313 | state->nt_page[ppu][1] = state->nt_ram[ppu]; | |
| 314 | state->nt_page[ppu][2] = state->nt_ram[ppu] + 0x400; | |
| 315 | state->nt_page[ppu][3] = state->nt_ram[ppu] + 0x400; | |
| 316 | 316 | break; |
| 317 | 317 | case PPU_MIRROR_VERT: |
| 318 | nt_page[ppu][0] = nt_ram[ppu]; | |
| 319 | nt_page[ppu][1] = nt_ram[ppu] + 0x400; | |
| 320 | nt_page[ppu][2] = nt_ram[ppu]; | |
| 321 | nt_page[ppu][3] = nt_ram[ppu] + 0x400; | |
| 318 | state->nt_page[ppu][0] = state->nt_ram[ppu]; | |
| 319 | state->nt_page[ppu][1] = state->nt_ram[ppu] + 0x400; | |
| 320 | state->nt_page[ppu][2] = state->nt_ram[ppu]; | |
| 321 | state->nt_page[ppu][3] = state->nt_ram[ppu] + 0x400; | |
| 322 | 322 | break; |
| 323 | 323 | case PPU_MIRROR_NONE: |
| 324 | 324 | default: |
| 325 | nt_page[ppu][0] = nt_ram[ppu]; | |
| 326 | nt_page[ppu][1] = nt_ram[ppu] + 0x400; | |
| 327 | nt_page[ppu][2] = nt_ram[ppu] + 0x800; | |
| 328 | nt_page[ppu][3] = nt_ram[ppu] + 0xc00; | |
| 325 | state->nt_page[ppu][0] = state->nt_ram[ppu]; | |
| 326 | state->nt_page[ppu][1] = state->nt_ram[ppu] + 0x400; | |
| 327 | state->nt_page[ppu][2] = state->nt_ram[ppu] + 0x800; | |
| 328 | state->nt_page[ppu][3] = state->nt_ram[ppu] + 0xc00; | |
| 329 | 329 | break; |
| 330 | 330 | } |
| 331 | 331 | |
| r10613 | r10614 | |
| 362 | 362 | |
| 363 | 363 | static WRITE8_HANDLER( gun_in0_w ) |
| 364 | 364 | { |
| 365 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 365 | 366 | device_t *ppu1 = space->machine->device("ppu1"); |
| 366 | static int zapstore; | |
| 367 | 367 | |
| 368 | if ( | |
| 368 | if ( | |
| 369 | 369 | { |
| 370 | 370 | /* switch vrom */ |
| 371 | 371 | v_set_videorom_bank(space->machine, 0, 8, (data & 4) ? 8 : 0); |
| r10613 | r10614 | |
| 376 | 376 | { |
| 377 | 377 | |
| 378 | 378 | /* load up the latches */ |
| 379 | input_latch[0] = input_port_read(space->machine, "IN0"); | |
| 379 | state->input_latch[0] = input_port_read(space->machine, "IN0"); | |
| 380 | 380 | |
| 381 | 381 | /* do the gun thing */ |
| 382 | 382 | int x = input_port_read(space->machine, "GUNX"); |
| r10613 | r10614 | |
| 393 | 393 | if ((pix == color_base + 0x20 ) || (pix == color_base + 0x30) || |
| 394 | 394 | (pix == color_base + 0x33 ) || (pix == color_base + 0x34)) |
| 395 | 395 | { |
| 396 | input_latch[0] |= 0x40; | |
| 396 | state->input_latch[0] |= 0x40; | |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | input_latch[1] = input_port_read(space->machine, "IN1"); | |
| 399 | state->input_latch[1] = input_port_read(space->machine, "IN1"); | |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | if ((zapstore & 1) && (!(data & 1))) | |
| 402 | if ((state->zapstore & 1) && (!(data & 1))) | |
| 403 | 403 | /* reset sound_fix to keep sound from hanging */ |
| 404 | 404 | { |
| 405 | sound_fix = 0; | |
| 405 | state->sound_fix = 0; | |
| 406 | 406 | } |
| 407 | 407 | |
| 408 | zapstore = data; | |
| 408 | state->zapstore = data; | |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | 411 | DRIVER_INIT( vsgun ) |
| 412 | 412 | { |
| 413 | vsnes_state *state = machine->driver_data<vsnes_state>(); | |
| 413 | 414 | /* VROM switching is enabled with bit 2 of $4016 */ |
| 414 | 415 | memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4016, 0x4016, 0, 0, gun_in0_r, gun_in0_w); |
| 415 | | |
| 416 | | |
| 416 | 417 | } |
| 417 | 418 | |
| 418 | 419 | /**********************************************************************************/ |
| r10613 | r10614 | |
| 460 | 461 | |
| 461 | 462 | static WRITE8_HANDLER( vsgshoe_gun_in0_w ) |
| 462 | 463 | { |
| 463 | stat | |
| 464 | vsnes_state | |
| 464 | 465 | int addr; |
| 465 | if((data & 0x04) != old_bank) | |
| 466 | if((data & 0x04) != state->old_bank) | |
| 466 | 467 | { |
| 467 | 468 | UINT8 *prg = space->machine->region("maincpu")->base(); |
| 468 | old_bank = data & 0x04; | |
| 469 | addr = old_bank ? 0x12000: 0x10000; | |
| 469 | state->old_bank = data & 0x04; | |
| 470 | addr = state->old_bank ? 0x12000: 0x10000; | |
| 470 | 471 | memcpy(&prg[0x08000], &prg[addr], 0x2000); |
| 471 | 472 | } |
| 472 | 473 | |
| r10613 | r10614 | |
| 475 | 476 | |
| 476 | 477 | DRIVER_INIT( vsgshoe ) |
| 477 | 478 | { |
| 479 | vsnes_state *state = machine->driver_data<vsnes_state>(); | |
| 478 | 480 | /* set up the default bank */ |
| 479 | 481 | UINT8 *prg = machine->region("maincpu")->base(); |
| 480 | 482 | memcpy (&prg[0x08000], &prg[0x12000], 0x2000); |
| r10613 | r10614 | |
| 482 | 484 | /* vrom switching is enabled with bit 2 of $4016 */ |
| 483 | 485 | memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4016, 0x4016, 0, 0, gun_in0_r, vsgshoe_gun_in0_w); |
| 484 | 486 | |
| 485 | | |
| 487 | | |
| 486 | 488 | } |
| 487 | 489 | |
| 488 | 490 | /**********************************************************************************/ |
| 489 | 491 | /* Dr Mario: ROMs bankings at $8000-$ffff */ |
| 490 | 492 | |
| 491 | static int drmario_shiftreg; | |
| 492 | static int drmario_shiftcount; | |
| 493 | 493 | |
| 494 | 494 | static WRITE8_HANDLER( drmario_rom_banking ) |
| 495 | 495 | { |
| 496 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 496 | 497 | /* basically, a MMC1 mapper from the nes */ |
| 497 | static int size16k, switchlow, vrom4k; | |
| 498 | 498 | |
| 499 | 499 | int reg = (offset >> 13); |
| 500 | 500 | |
| 501 | 501 | /* reset mapper */ |
| 502 | 502 | if (data & 0x80) |
| 503 | 503 | { |
| 504 | drmario_shiftreg = drmario_shiftcount = 0; | |
| 504 | state->drmario_shiftreg = state->drmario_shiftcount = 0; | |
| 505 | 505 | |
| 506 | size16k = 1; | |
| 506 | state->size16k = 1; | |
| 507 | 507 | |
| 508 | switchlow = 1; | |
| 509 | vrom4k = 0; | |
| 508 | state->switchlow = 1; | |
| 509 | state->vrom4k = 0; | |
| 510 | 510 | |
| 511 | 511 | return; |
| 512 | 512 | } |
| 513 | 513 | |
| 514 | 514 | /* see if we need to clock in data */ |
| 515 | if (drmario_shiftcount < 5) | |
| 515 | if (state->drmario_shiftcount < 5) | |
| 516 | 516 | { |
| 517 | drmario_shiftreg >>= 1; | |
| 518 | drmario_shiftreg |= (data & 1) << 4; | |
| 519 | drmario_shiftcount++; | |
| 517 | state->drmario_shiftreg >>= 1; | |
| 518 | state->drmario_shiftreg |= (data & 1) << 4; | |
| 519 | state->drmario_shiftcount++; | |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | /* are we done shifting? */ |
| 523 | if (drmario_shiftcount == 5) | |
| 523 | if (state->drmario_shiftcount == 5) | |
| 524 | 524 | { |
| 525 | 525 | /* reset count */ |
| 526 | drmario_shiftcount = 0; | |
| 526 | state->drmario_shiftcount = 0; | |
| 527 | 527 | |
| 528 | 528 | /* apply data to registers */ |
| 529 | 529 | switch (reg) |
| r10613 | r10614 | |
| 532 | 532 | { |
| 533 | 533 | int mirroring; |
| 534 | 534 | |
| 535 | vrom4k = drmario_shiftreg & 0x10; | |
| 536 | size16k = drmario_shiftreg & 0x08; | |
| 537 | switchlow = drmario_shiftreg & 0x04; | |
| 535 | state->vrom4k = state->drmario_shiftreg & 0x10; | |
| 536 | state->size16k = state->drmario_shiftreg & 0x08; | |
| 537 | state->switchlow = state->drmario_shiftreg & 0x04; | |
| 538 | 538 | |
| 539 | switch (drmario_shiftreg & 3) | |
| 539 | switch (state->drmario_shiftreg & 3) | |
| 540 | 540 | { |
| 541 | 541 | case 0: |
| 542 | 542 | mirroring = PPU_MIRROR_LOW; |
| r10613 | r10614 | |
| 557 | 557 | } |
| 558 | 558 | |
| 559 | 559 | /* apply mirroring */ |
| 560 | v_set_mirroring(1, mirroring); | |
| 560 | v_set_mirroring(state, 1, mirroring); | |
| 561 | 561 | } |
| 562 | 562 | break; |
| 563 | 563 | |
| 564 | 564 | case 1: /* video rom banking - bank 0 - 4k or 8k */ |
| 565 | if (!vram) | |
| 566 | v_set_videorom_bank(space->machine, 0, (vrom4k) ? 4 : 8, drmario_shiftreg * 4); | |
| 565 | if (!state->vram) | |
| 566 | v_set_videorom_bank(space->machine, 0, (state->vrom4k) ? 4 : 8, state->drmario_shiftreg * 4); | |
| 567 | 567 | break; |
| 568 | 568 | |
| 569 | 569 | case 2: /* video rom banking - bank 1 - 4k only */ |
| 570 | if (vrom4k && !vram) | |
| 571 | v_set_videorom_bank(space->machine, 4, 4, drmario_shiftreg * 4); | |
| 570 | if (state->vrom4k && !state->vram) | |
| 571 | v_set_videorom_bank(space->machine, 4, 4, state->drmario_shiftreg * 4); | |
| 572 | 572 | break; |
| 573 | 573 | |
| 574 | 574 | case 3: /* program banking */ |
| 575 | 575 | { |
| 576 | int bank = (drmario_shiftreg & 0x03) * 0x4000; | |
| 576 | int bank = (state->drmario_shiftreg & 0x03) * 0x4000; | |
| 577 | 577 | UINT8 *prg = space->machine->region("maincpu")->base(); |
| 578 | 578 | |
| 579 | if (!size16k) | |
| 579 | if (!state->size16k) | |
| 580 | 580 | { |
| 581 | 581 | /* switch 32k */ |
| 582 | 582 | memcpy(&prg[0x08000], &prg[0x010000 + bank], 0x8000); |
| r10613 | r10614 | |
| 584 | 584 | else |
| 585 | 585 | { |
| 586 | 586 | /* switch 16k */ |
| 587 | if (switchlow) | |
| 587 | if (state->switchlow) | |
| 588 | 588 | { |
| 589 | 589 | /* low */ |
| 590 | 590 | memcpy(&prg[0x08000], &prg[0x010000 + bank], 0x4000); |
| r10613 | r10614 | |
| 599 | 599 | break; |
| 600 | 600 | } |
| 601 | 601 | |
| 602 | drmario_shiftreg = 0; | |
| 602 | state->drmario_shiftreg = 0; | |
| 603 | 603 | } |
| 604 | 604 | } |
| 605 | 605 | |
| 606 | 606 | DRIVER_INIT( drmario ) |
| 607 | 607 | { |
| 608 | vsnes_state *state = machine->driver_data<vsnes_state>(); | |
| 608 | 609 | /* We do manual banking, in case the code falls through */ |
| 609 | 610 | /* Copy the initial banks */ |
| 610 | 611 | UINT8 *prg = machine->region("maincpu")->base(); |
| r10613 | r10614 | |
| 614 | 615 | /* MMC1 mapper at writes to $8000-$ffff */ |
| 615 | 616 | memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, drmario_rom_banking); |
| 616 | 617 | |
| 617 | drmario_shiftreg = 0; | |
| 618 | drmario_shiftcount = 0; | |
| 618 | state->drmario_shiftreg = 0; | |
| 619 | state->drmario_shiftcount = 0; | |
| 619 | 620 | } |
| 620 | 621 | |
| 621 | 622 | /**********************************************************************************/ |
| r10613 | r10614 | |
| 631 | 632 | |
| 632 | 633 | DRIVER_INIT( vsvram ) |
| 633 | 634 | { |
| 635 | vsnes_state *state = machine->driver_data<vsnes_state>(); | |
| 634 | 636 | /* when starting the game, the 1st 16k and the last 16k are loaded into the 2 banks */ |
| 635 | 637 | UINT8 *prg = machine->region("maincpu")->base(); |
| 636 | 638 | memcpy(&prg[0x08000], &prg[0x28000], 0x8000); |
| r10613 | r10614 | |
| 638 | 640 | /* banking is done with writes to the $8000-$ffff area */ |
| 639 | 641 | memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, vsvram_rom_banking); |
| 640 | 642 | |
| 641 | /* allocate vram */ | |
| 642 | vram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 643 | /* allocate state->vram */ | |
| 644 | state->vram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 643 | 645 | } |
| 644 | 646 | |
| 645 | 647 | /**********************************************************************************/ |
| 646 | 648 | |
| 647 | static int MMC3_cmd; | |
| 648 | static int MMC3_prg_bank[4]; | |
| 649 | static int MMC3_chr_bank[6]; | |
| 650 | static int MMC3_prg_mask; | |
| 651 | static int IRQ_enable, IRQ_count, IRQ_count_latch; | |
| 652 | 649 | |
| 653 | 650 | static void mapper4_set_prg( running_machine *machine ) |
| 654 | 651 | { |
| 652 | vsnes_state *state = machine->driver_data<vsnes_state>(); | |
| 655 | 653 | UINT8 *prg = machine->region("maincpu")->base(); |
| 656 | UINT8 prg_flip = (MMC3_cmd & 0x40) ? 2 : 0; | |
| 654 | UINT8 prg_flip = (state->MMC3_cmd & 0x40) ? 2 : 0; | |
| 657 | 655 | |
| 658 | memcpy(&prg[0x8000], &prg[0x2000 * (MMC3_prg_bank[0 ^ prg_flip] & MMC3_prg_mask) + 0x10000], 0x2000); | |
| 659 | memcpy(&prg[0xa000], &prg[0x2000 * (MMC3_prg_bank[1] & MMC3_prg_mask) + 0x10000], 0x2000); | |
| 660 | memcpy(&prg[0xc000], &prg[0x2000 * (MMC3_prg_bank[2 ^ prg_flip] & MMC3_prg_mask) + 0x10000], 0x2000); | |
| 661 | memcpy(&prg[0xe000], &prg[0x2000 * (MMC3_prg_bank[3] & MMC3_prg_mask) + 0x10000], 0x2000); | |
| 656 | memcpy(&prg[0x8000], &prg[0x2000 * (state->MMC3_prg_bank[0 ^ prg_flip] & state->MMC3_prg_mask) + 0x10000], 0x2000); | |
| 657 | memcpy(&prg[0xa000], &prg[0x2000 * (state->MMC3_prg_bank[1] & state->MMC3_prg_mask) + 0x10000], 0x2000); | |
| 658 | memcpy(&prg[0xc000], &prg[0x2000 * (state->MMC3_prg_bank[2 ^ prg_flip] & state->MMC3_prg_mask) + 0x10000], 0x2000); | |
| 659 | memcpy(&prg[0xe000], &prg[0x2000 * (state->MMC3_prg_bank[3] & state->MMC3_prg_mask) + 0x10000], 0x2000); | |
| 662 | 660 | } |
| 663 | 661 | |
| 664 | 662 | static void mapper4_set_chr( running_machine *machine ) |
| 665 | 663 | { |
| 666 | UINT8 chr_page = (MMC3_cmd & 0x80) >> 5; | |
| 664 | vsnes_state *state = machine->driver_data<vsnes_state>(); | |
| 665 | UINT8 chr_page = (state->MMC3_cmd & 0x80) >> 5; | |
| 667 | 666 | |
| 668 | v_set_videorom_bank(machine, chr_page ^ 0, 1, MMC3_chr_bank[0] & ~0x01); | |
| 669 | v_set_videorom_bank(machine, chr_page ^ 1, 1, MMC3_chr_bank[0] | 0x01); | |
| 670 | v_set_videorom_bank(machine, chr_page ^ 2, 1, MMC3_chr_bank[1] & ~0x01); | |
| 671 | v_set_videorom_bank(machine, chr_page ^ 3, 1, MMC3_chr_bank[1] | 0x01); | |
| 672 | v_set_videorom_bank(machine, chr_page ^ 4, 1, MMC3_chr_bank[2]); | |
| 673 | v_set_videorom_bank(machine, chr_page ^ 5, 1, MMC3_chr_bank[3]); | |
| 674 | v_set_videorom_bank(machine, chr_page ^ 6, 1, MMC3_chr_bank[4]); | |
| 675 | v_set_videorom_bank(machine, chr_page ^ 7, 1, MMC3_chr_bank[5]); | |
| 667 | v_set_videorom_bank(machine, chr_page ^ 0, 1, state->MMC3_chr_bank[0] & ~0x01); | |
| 668 | v_set_videorom_bank(machine, chr_page ^ 1, 1, state->MMC3_chr_bank[0] | 0x01); | |
| 669 | v_set_videorom_bank(machine, chr_page ^ 2, 1, state->MMC3_chr_bank[1] & ~0x01); | |
| 670 | v_set_videorom_bank(machine, chr_page ^ 3, 1, state->MMC3_chr_bank[1] | 0x01); | |
| 671 | v_set_videorom_bank(machine, chr_page ^ 4, 1, state->MMC3_chr_bank[2]); | |
| 672 | v_set_videorom_bank(machine, chr_page ^ 5, 1, state->MMC3_chr_bank[3]); | |
| 673 | v_set_videorom_bank(machine, chr_page ^ 6, 1, state->MMC3_chr_bank[4]); | |
| 674 | v_set_videorom_bank(machine, chr_page ^ 7, 1, state->MMC3_chr_bank[5]); | |
| 676 | 675 | } |
| 677 | 676 | |
| 678 | 677 | #define BOTTOM_VISIBLE_SCANLINE 239 /* The bottommost visible scanline */ |
| r10613 | r10614 | |
| 680 | 679 | |
| 681 | 680 | static void mapper4_irq( device_t *device, int scanline, int vblank, int blanked ) |
| 682 | 681 | { |
| 682 | vsnes_state *state = device->machine->driver_data<vsnes_state>(); | |
| 683 | 683 | if (scanline < PPU_BOTTOM_VISIBLE_SCANLINE) |
| 684 | 684 | { |
| 685 | int priorCount = IRQ_count; | |
| 686 | if ((IRQ_count == 0)) | |
| 685 | int priorCount = state->IRQ_count; | |
| 686 | if ((state->IRQ_count == 0)) | |
| 687 | 687 | { |
| 688 | IRQ_count = IRQ_count_latch; | |
| 688 | state->IRQ_count = state->IRQ_count_latch; | |
| 689 | 689 | } |
| 690 | 690 | else |
| 691 | IRQ_count--; | |
| 691 | state->IRQ_count--; | |
| 692 | 692 | |
| 693 | if (IRQ_enable && !blanked && (IRQ_count == 0) && priorCount) | |
| 693 | if (state->IRQ_enable && !blanked && (state->IRQ_count == 0) && priorCount) | |
| 694 | 694 | { |
| 695 | 695 | cputag_set_input_line(device->machine, "maincpu", 0, HOLD_LINE); |
| 696 | 696 | } |
| r10613 | r10614 | |
| 699 | 699 | |
| 700 | 700 | static WRITE8_HANDLER( mapper4_w ) |
| 701 | 701 | { |
| 702 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 702 | 703 | device_t *ppu1 = space->machine->device("ppu1"); |
| 703 | 704 | UINT8 MMC3_helper, cmd; |
| 704 | 705 | |
| 705 | 706 | switch (offset & 0x6001) |
| 706 | 707 | { |
| 707 | 708 | case 0x0000: /* $8000 */ |
| 708 | MMC3_helper = MMC3_cmd ^ data; | |
| 709 | MMC3_cmd = data; | |
| 709 | MMC3_helper = state->MMC3_cmd ^ data; | |
| 710 | state->MMC3_cmd = data; | |
| 710 | 711 | |
| 711 | 712 | /* Has PRG Mode changed? */ |
| 712 | 713 | if (MMC3_helper & 0x40) |
| r10613 | r10614 | |
| 718 | 719 | break; |
| 719 | 720 | |
| 720 | 721 | case 0x0001: /* $8001 */ |
| 721 | cmd = MMC3_cmd & 0x07; | |
| 722 | cmd = state->MMC3_cmd & 0x07; | |
| 722 | 723 | switch (cmd) |
| 723 | 724 | { |
| 724 | 725 | case 0: case 1: // these do not need to be separated: we take care of them in set_chr! |
| 725 | 726 | case 2: case 3: case 4: case 5: |
| 726 | MMC3_chr_bank[cmd] = data; | |
| 727 | state->MMC3_chr_bank[cmd] = data; | |
| 727 | 728 | mapper4_set_chr(space->machine); |
| 728 | 729 | break; |
| 729 | 730 | case 6: |
| 730 | 731 | case 7: |
| 731 | MMC3_prg_bank[cmd - 6] = data; | |
| 732 | state->MMC3_prg_bank[cmd - 6] = data; | |
| 732 | 733 | mapper4_set_prg(space->machine); |
| 733 | 734 | break; |
| 734 | 735 | } |
| r10613 | r10614 | |
| 736 | 737 | |
| 737 | 738 | case 0x2000: /* $a000 */ |
| 738 | 739 | if (data & 0x40) |
| 739 | v_set_mirroring(1, PPU_MIRROR_HIGH); | |
| 740 | v_set_mirroring(state, 1, PPU_MIRROR_HIGH); | |
| 740 | 741 | else |
| 741 | 742 | { |
| 742 | 743 | if (data & 0x01) |
| 743 | v_set_mirroring(1, PPU_MIRROR_HORZ); | |
| 744 | v_set_mirroring(state, 1, PPU_MIRROR_HORZ); | |
| 744 | 745 | else |
| 745 | v_set_mirroring(1, PPU_MIRROR_VERT); | |
| 746 | v_set_mirroring(state, 1, PPU_MIRROR_VERT); | |
| 746 | 747 | } |
| 747 | 748 | break; |
| 748 | 749 | |
| r10613 | r10614 | |
| 751 | 752 | |
| 752 | 753 | break; |
| 753 | 754 | case 0x4000: /* $c000 - IRQ scanline counter */ |
| 754 | IRQ_count = data; | |
| 755 | state->IRQ_count = data; | |
| 755 | 756 | |
| 756 | 757 | break; |
| 757 | 758 | |
| 758 | 759 | case 0x4001: /* $c001 - IRQ scanline latch */ |
| 759 | IRQ_count_latch = data; | |
| 760 | state->IRQ_count_latch = data; | |
| 760 | 761 | |
| 761 | 762 | break; |
| 762 | 763 | |
| 763 | 764 | case 0x6000: /* $e000 - Disable IRQs */ |
| 764 | IRQ_enable = 0; | |
| 765 | IRQ_count = IRQ_count_latch; | |
| 765 | state->IRQ_enable = 0; | |
| 766 | state->IRQ_count = state->IRQ_count_latch; | |
| 766 | 767 | |
| 767 | 768 | ppu2c0x_set_scanline_callback (ppu1, 0); |
| 768 | 769 | |
| 769 | 770 | break; |
| 770 | 771 | |
| 771 | 772 | case 0x6001: /* $e001 - Enable IRQs */ |
| 772 | IRQ_enable = 1; | |
| 773 | state->IRQ_enable = 1; | |
| 773 | 774 | ppu2c0x_set_scanline_callback (ppu1, mapper4_irq); |
| 774 | 775 | |
| 775 | 776 | break; |
| r10613 | r10614 | |
| 784 | 785 | |
| 785 | 786 | DRIVER_INIT( MMC3 ) |
| 786 | 787 | { |
| 788 | vsnes_state *state = machine->driver_data<vsnes_state>(); | |
| 787 | 789 | UINT8 *prg = machine->region("maincpu")->base(); |
| 788 | IRQ_enable = IRQ_count = IRQ_count_latch = 0; | |
| 790 | state->IRQ_enable = state->IRQ_count = state->IRQ_count_latch = 0; | |
| 789 | 791 | int MMC3_prg_chunks = (machine->region("maincpu")->bytes() - 0x10000) / 0x4000; |
| 790 | 792 | |
| 791 | MMC3_prg_bank[0] = MMC3_prg_bank[2] = 0xfe; | |
| 792 | MMC3_prg_bank[1] = MMC3_prg_bank[3] = 0xff; | |
| 793 | MMC3_cmd = 0; | |
| 793 | state->MMC3_prg_bank[0] = state->MMC3_prg_bank[2] = 0xfe; | |
| 794 | state->MMC3_prg_bank[1] = state->MMC3_prg_bank[3] = 0xff; | |
| 795 | state->MMC3_cmd = 0; | |
| 794 | 796 | |
| 795 | MMC3_prg_mask = ((MMC3_prg_chunks << 1) - 1); | |
| 797 | state->MMC3_prg_mask = ((MMC3_prg_chunks << 1) - 1); | |
| 796 | 798 | |
| 797 | 799 | memcpy(&prg[0x8000], &prg[(MMC3_prg_chunks - 1) * 0x4000 + 0x10000], 0x2000); |
| 798 | 800 | memcpy(&prg[0xa000], &prg[(MMC3_prg_chunks - 1) * 0x4000 + 0x12000], 0x2000); |
| r10613 | r10614 | |
| 810 | 812 | |
| 811 | 813 | static READ8_HANDLER( rbi_hack_r ) |
| 812 | 814 | { |
| 815 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 813 | 816 | /* Supplied by Ben Parnell <xodnizel@home.com> of FCE Ultra fame */ |
| 814 | 817 | |
| 815 | static int VSindex; | |
| 816 | 818 | |
| 817 | 819 | if (offset == 0) |
| 818 | 820 | { |
| 819 | VSindex=0; | |
| 821 | state->VSindex=0; | |
| 820 | 822 | return 0xFF; |
| 821 | 823 | |
| 822 | 824 | } |
| 823 | 825 | else |
| 824 | 826 | { |
| 825 | switch(VSindex++) | |
| 827 | switch(state->VSindex++) | |
| 826 | 828 | { |
| 827 | 829 | case 9: |
| 828 | 830 | return 0x6F; |
| r10613 | r10614 | |
| 846 | 848 | |
| 847 | 849 | /* Vs. Super Xevious */ |
| 848 | 850 | |
| 849 | static int supxevs_prot_index = 0; | |
| 850 | 851 | |
| 851 | 852 | static READ8_HANDLER( supxevs_read_prot_1_r ) |
| 852 | 853 | { |
| r10613 | r10614 | |
| 855 | 856 | |
| 856 | 857 | static READ8_HANDLER( supxevs_read_prot_2_r ) |
| 857 | 858 | { |
| 858 | if (supxevs_prot_index) | |
| 859 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 860 | if (state->supxevs_prot_index) | |
| 859 | 861 | return 0; |
| 860 | 862 | else |
| 861 | 863 | return 0x01; |
| r10613 | r10614 | |
| 863 | 865 | |
| 864 | 866 | static READ8_HANDLER( supxevs_read_prot_3_r ) |
| 865 | 867 | { |
| 866 | if (supxevs_prot_index) | |
| 868 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 869 | if (state->supxevs_prot_index) | |
| 867 | 870 | return 0xd1; |
| 868 | 871 | else |
| 869 | 872 | return 0x89; |
| r10613 | r10614 | |
| 871 | 874 | |
| 872 | 875 | static READ8_HANDLER( supxevs_read_prot_4_r ) |
| 873 | 876 | { |
| 874 | if (supxevs_prot_index) | |
| 877 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 878 | if (state->supxevs_prot_index) | |
| 875 | 879 | { |
| 876 | supxevs_prot_index = 0; | |
| 880 | state->supxevs_prot_index = 0; | |
| 877 | 881 | return 0x3e; |
| 878 | 882 | } |
| 879 | 883 | else |
| 880 | 884 | { |
| 881 | supxevs_prot_index = 1; | |
| 885 | state->supxevs_prot_index = 1; | |
| 882 | 886 | return 0x37; |
| 883 | 887 | } |
| 884 | 888 | } |
| r10613 | r10614 | |
| 899 | 903 | |
| 900 | 904 | static READ8_HANDLER( tko_security_r ) |
| 901 | 905 | { |
| 902 | stat | |
| 906 | vsnes_state | |
| 903 | 907 | static const UINT8 security_data[] = { |
| 904 | 908 | 0xff, 0xbf, 0xb7, 0x97, 0x97, 0x17, 0x57, 0x4f, |
| 905 | 909 | 0x6f, 0x6b, 0xeb, 0xa9, 0xb1, 0x90, 0x94, 0x14, |
| r10613 | r10614 | |
| 909 | 913 | |
| 910 | 914 | if (offset == 0) |
| 911 | 915 | { |
| 912 | security_counter = 0; | |
| 916 | state->security_counter = 0; | |
| 913 | 917 | return 0; |
| 914 | 918 | } |
| 915 | 919 | |
| 916 | return security_data[(security_counter++)]; | |
| 920 | return security_data[(state->security_counter++)]; | |
| 917 | 921 | |
| 918 | 922 | } |
| 919 | 923 | |
| r10613 | r10614 | |
| 929 | 933 | |
| 930 | 934 | DRIVER_INIT( vsfdf ) |
| 931 | 935 | { |
| 936 | vsnes_state *state = machine->driver_data<vsnes_state>(); | |
| 932 | 937 | DRIVER_INIT_CALL(MMC3); |
| 933 | 938 | |
| 934 | 939 | memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4016, 0x4016, 0, 0, gun_in0_r, gun_in0_w); |
| 935 | 940 | |
| 936 | | |
| 941 | | |
| 937 | 942 | } |
| 938 | 943 | |
| 939 | 944 | /**********************************************************************************/ |
| r10613 | r10614 | |
| 987 | 992 | /**********************************************************************************/ |
| 988 | 993 | /* Vs. Raid on Bungeling Bay (Japan) */ |
| 989 | 994 | |
| 990 | static int ret; | |
| 991 | 995 | static WRITE8_HANDLER( set_bnglngby_irq_w ) |
| 992 | 996 | { |
| 993 | ret = data; | |
| 997 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 998 | state->ret = data; | |
| 994 | 999 | cputag_set_input_line(space->machine, "maincpu", 0, (data & 2) ? ASSERT_LINE : CLEAR_LINE); |
| 995 | 1000 | /* other values ??? */ |
| 996 | 1001 | /* 0, 4, 84 */ |
| r10613 | r10614 | |
| 998 | 1003 | |
| 999 | 1004 | static READ8_HANDLER( set_bnglngby_irq_r ) |
| 1000 | 1005 | { |
| 1001 | return ret; | |
| 1006 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 1007 | return state->ret; | |
| 1002 | 1008 | } |
| 1003 | 1009 | |
| 1004 | 1010 | DRIVER_INIT( bnglngby ) |
| 1005 | 1011 | { |
| 1012 | vsnes_state *state = machine->driver_data<vsnes_state>(); | |
| 1006 | 1013 | memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0231, 0x0231, 0, 0, set_bnglngby_irq_r, set_bnglngby_irq_w); |
| 1007 | 1014 | |
| 1008 | 1015 | /* extra ram */ |
| 1009 | 1016 | memory_install_ram(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, NULL); |
| 1010 | 1017 | |
| 1011 | ret = 0; | |
| 1018 | state->ret = 0; | |
| 1012 | 1019 | |
| 1013 | 1020 | /* normal banking */ |
| 1014 | 1021 | DRIVER_INIT_CALL(vsnormal); |
| r10613 | r10614 | |
|---|---|---|
| 3865 | 3865 | |
| 3866 | 3866 | |
| 3867 | 3867 | #define TOCCMD_CURPOS (0x0) |
| 3868 | #define TOCCMD_TRKPOS | |
| 3868 | #define TOCCMD_TRKPOS | |
| 3869 | 3869 | #define TOCCMD_CURTRK (0x2) |
| 3870 | 3870 | #define TOCCMD_LENGTH (0x3) |
| 3871 | 3871 | #define TOCCMD_FIRSTLAST (0x4) |
| r10613 | r10614 | |
| 4181 | 4181 | int elapsedlba; |
| 4182 | 4182 | UINT32 msf; |
| 4183 | 4183 | CDD_STATUS &= 0xFF; |
| 4184 | // | |
| 4184 | // UINT32 end_msf = ; | |
| 4185 | 4185 | if(segacd.cd == NULL) // no cd is there, bail out |
| 4186 | 4186 | return; |
| 4187 | 4187 | CDD_STATUS |= SCD_STATUS; |
| r10613 | r10614 | |
| 4506 | 4506 | { |
| 4507 | 4507 | space->write_byte(0xff2000+(((dstoffset*2)+1)&0x1fff),data >> 8); |
| 4508 | 4508 | space->write_byte(0xff2000+(((dstoffset*2)+3)&0x1fff),data & 0xff); |
| 4509 | // | |
| 4509 | // printf("PCM_DMA writing %04x %04x\n",0xff2000+(dstoffset*2), data); | |
| 4510 | 4510 | } |
| 4511 | 4511 | else |
| 4512 | 4512 | { |
| r10613 | r10614 | |
| 4694 | 4694 | { |
| 4695 | 4695 | "Get Status", // 0 |
| 4696 | 4696 | "Stop ALL", // 1 |
| 4697 | "Handle TOC", | |
| 4697 | "Handle TOC", | |
| 4698 | 4698 | "Play", // 3 |
| 4699 | 4699 | "Seek", // 4 |
| 4700 | 4700 | "<undefined>", // 5 |
| r10613 | r10614 | |
| 5273 | 5273 | // do we care about the ret bit?? HOTA is missing some startup screens... |
| 5274 | 5274 | //if (!segacd_ret) |
| 5275 | 5275 | //{ |
| 5276 | // | |
| 5276 | // return segacd_dataram[offset+0x20000/2]; | |
| 5277 | 5277 | //} |
| 5278 | 5278 | //else |
| 5279 | 5279 | { |
| r10613 | r10614 | |
| 5901 | 5901 | segacd_gfx_conversion_timer->adjust(attotime::never); |
| 5902 | 5902 | |
| 5903 | 5903 | segacd_hock_timer = machine->scheduler().timer_alloc(FUNC(segacd_access_timer_callback)); |
| 5904 | // | |
| 5904 | // segacd_hock_timer->adjust( attotime::from_nsec(20000000), 0, attotime::from_nsec(20000000)); | |
| 5905 | 5905 | segacd_hock_timer->adjust( attotime::from_hz(75),0, attotime::from_hz(75)); |
| 5906 | 5906 | |
| 5907 | 5907 | segacd_irq3_timer = machine->scheduler().timer_alloc(FUNC(segacd_irq3_timer_callback)); |
| r10613 | r10614 | |
| 6125 | 6125 | { |
| 6126 | 6126 | UINT16 control = CDD_CONTROL; |
| 6127 | 6127 | |
| 6128 | // | |
| 6128 | // printf("segacd_irq_mask_w %04x %04x (CDD control is %04x)\n",data, mem_mask, control); | |
| 6129 | 6129 | |
| 6130 | 6130 | if (data & 0x10) |
| 6131 | 6131 | { |
| r10613 | r10614 | |
| 6207 | 6207 | { |
| 6208 | 6208 | segacd_stampsize = data & 0x07; |
| 6209 | 6209 | //if (data & 0xf8) |
| 6210 | // | |
| 6210 | // printf(" unused bits (LSB) set in stampsize!\n"); | |
| 6211 | 6211 | |
| 6212 | 6212 | //if (data&1) printf(" Repeat On\n"); |
| 6213 | 6213 | //else printf(" Repeat Off\n"); |
| r10613 | r10614 | |
| 6446 | 6446 | static WRITE16_HANDLER( segacd_imagebuffer_offset_w ) |
| 6447 | 6447 | { |
| 6448 | 6448 | COMBINE_DATA(&segacd_imagebuffer_offset); |
| 6449 | // | |
| 6449 | // printf("segacd_imagebuffer_offset_w %04x\n", segacd_imagebuffer_offset); | |
| 6450 | 6450 | } |
| 6451 | 6451 | |
| 6452 | 6452 | static READ16_HANDLER( segacd_imagebuffer_vcell_size_r ) |
| r10613 | r10614 | |
|---|---|---|
| 415 | 415 | switch(write_buffer[0] & 1) { |
| 416 | 416 | case COMMAND_WRITE: |
| 417 | 417 | memcpy(&data[data_offset()], &write_buffer[2], SIZE_DATA_BUFFER); |
| 418 | ||
| 418 | ||
| 419 | 419 | /* todo: find out what should be returned. */ |
| 420 | 420 | memset(&read_buffer[0] , 0, SIZE_WRITE_BUFFER); |
| 421 | 421 | break; |
| r10613 | r10614 | |
| 519 | 519 | verboselog(1, "goto start\n"); |
| 520 | 520 | state = STATE_LOAD_COMMAND; |
| 521 | 521 | break; |
| 522 | // default: | |
| 523 | // verboselog(1, "skipped start (default)\n"); | |
| 524 | // break; | |
| 522 | // default: | |
| 523 | // verboselog(1, "skipped start (default)\n"); | |
| 524 | // break; | |
| 525 | 525 | } |
| 526 | 526 | |
| 527 | 527 | bit = 0; |
| r10613 | r10614 | |
|---|---|---|
| 2 | 2 | |
| 3 | 3 | Naomi plug-in board emulator |
| 4 | 4 | |
| 5 | emulator by Samuele Zannoli | |
| 6 | protection chip by R. Belmont, reverse engineering by Deunan Knute | |
| 5 | emulator by Samuele Zannoli and R. Belmont | |
| 6 | reverse engineering by ElSemi, Deunan Knute, Andreas Naive, Olivier Galibert, and Cah4e3 | |
| 7 | 7 | |
| 8 | 8 | **************************************************************************/ |
| 9 | 9 | |
| r10613 | r10614 | |
| 61 | 61 | In other words, disable DMA once before using PIO (most games using both access types do that when the DMA terminates). |
| 62 | 62 | This bit is also used to reset the chip's internal protection mechanism on "Oh! My Goddess" to a known state. |
| 63 | 63 | |
| 64 | * bit 29 (mode bit 1) is | |
| 64 | * bit 29 (mode bit 1) is "M1" compression bit on Actel carts, oth | |
| 65 | 65 | It's actually the opposite, when set the addressing is following the chip layout and when cleared the protection chip will have it's fun |
| 66 | with address lines 10 to 23(?). It's not a simple swap function, rather a lookup table and one with repeating results too. | |
| 67 | The few games I got to work never made any use of that bit, it's always set for all normal reads. | |
| 66 | doing a decompression + XOR on the data for Actel carts. Non-Actel carts may ignore this bit or remap the address space. | |
| 68 | 67 | |
| 69 | 68 | * bit 28 (mode bit 0) is unused (so far) |
| 70 | 69 | Or it could really be the last address bit to allow up to 512MB of data on a cart? |
| r10613 | r10614 | |
| 179 | 178 | |
| 180 | 179 | #define NAOMIBD_FLAG_AUTO_ADVANCE (8) // address auto-advances on read |
| 181 | 180 | #define NAOMIBD_FLAG_SPECIAL_MODE (4) // used to access protection registers |
| 182 | #define NAOMIBD_FLAG_ | |
| 181 | #define NAOMIBD_FLAG_ | |
| 183 | 182 | |
| 184 | #define NAOMIBD_PRINTF_PROTECTION ( | |
| 183 | #define NAOMIBD_PRINTF_PROTECTION (0) // 1 to printf protection access details | |
| 185 | 184 | |
| 186 | 185 | /************************************* |
| 187 | 186 | * |
| r10613 | r10614 | |
| 189 | 188 | * |
| 190 | 189 | *************************************/ |
| 191 | 190 | |
| 192 | #define | |
| 191 | #define PACK_BUF | |
| 193 | 192 | |
| 193 | enum | |
| 194 | { | |
| 195 | CMD_READY = 0, | |
| 196 | CMD_FETCH, | |
| 197 | CMD_REPEAT | |
| 198 | }; | |
| 199 | ||
| 194 | 200 | typedef struct _naomibd_config_table naomibd_config_table; |
| 195 | 201 | struct _naomibd_config_table |
| 196 | 202 | { |
| 197 | 203 | const char *name; |
| 198 | int reverse_bytes; | |
| 199 | int live_key; | |
| 200 | UINT32 transtbl[MAX_PROT_REGIONS*3]; | |
| 204 | int m2m3_key; | |
| 205 | int m1_key; | |
| 201 | 206 | }; |
| 202 | 207 | |
| 208 | typedef struct _naomibd_prot naomibd_prot; | |
| 209 | struct _naomibd_prot | |
| 210 | { | |
| 211 | UINT16 last_word, aux_word, pak_word, heading_word; | |
| 212 | UINT16 *ptr; | |
| 213 | int count, pak_bit, control_bits, pak_state, dec_count, pak_buf_size, pak_buf_pos; | |
| 214 | int pak_fetch_ofs; | |
| 215 | UINT8 pak_byte, cmd_byte; | |
| 216 | int seed; | |
| 217 | UINT8 pak_buf[PACK_BUF_SIZE]; | |
| 218 | ||
| 219 | UINT8 *s_input; | |
| 220 | UINT8 s_xor[4]; | |
| 221 | UINT8 s_dict[111]; | |
| 222 | int s_subst, s_out_len, s_out_cnt, s_shift, s_bits, s_in_len, s_in_pos; | |
| 223 | }; | |
| 224 | ||
| 203 | 225 | typedef struct _naomibd_state naomibd_state; |
| 204 | 226 | struct _naomibd_state |
| 205 | 227 | { |
| r10613 | r10614 | |
| 208 | 230 | device_t *device; /* pointer to our containing device */ |
| 209 | 231 | |
| 210 | 232 | UINT8 * memory; |
| 211 | UINT8 * protdata; | |
| 212 | 233 | chd_file * gdromchd; |
| 213 | 234 | UINT8 * picdata; |
| 214 | 235 | UINT32 rom_offset, rom_offset_flags, dma_count; |
| r10613 | r10614 | |
| 216 | 237 | UINT32 prot_offset, prot_key; |
| 217 | 238 | UINT32 aw_offset, aw_file_base, aw_file_offset; |
| 218 | 239 | |
| 219 | INT32 prot_sum; | |
| 220 | ||
| 221 | const UINT32 *prot_translate; | |
| 222 | int prot_reverse_bytes; | |
| 223 | ||
| 224 | 240 | // live decrypt vars |
| 225 | UINT32 dc_gamekey, dc_seqkey, dc_seed; | |
| 226 | UINT8 dc_cart_ram[128*1024]; // internal cartridge RAM | |
| 227 | INT32 dc_m3_ptr, dc_m2_ptr, dc_readback; | |
| 241 | UINT32 dc_gamekey, dc_seqkey, dc_dmakey; | |
| 242 | UINT8 dc_cart_ram[256*1024]; // internal cartridge RAM | |
| 243 | INT32 dc_m3_ptr; | |
| 228 | 244 | |
| 229 | #if NAOMIBD_PRINTF_PROTECTION | |
| 230 | int prot_pio_count; | |
| 231 | #endif | |
| 245 | naomibd_prot prot; | |
| 232 | 246 | }; |
| 233 | 247 | |
| 234 | 248 | // maps protection offsets to real addresses |
| r10613 | r10614 | |
| 237 | 251 | static const naomibd_config_table naomibd_translate_tbl[] = |
| 238 | 252 | { |
| 239 | 253 | // games where on-the-fly decryption works (many of these are fully playable in MAME, just slow) |
| 240 | { "18wheelr", 0, 0x07cf54, { 0x1502, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 241 | { "alpilota", 0, 0x070e41, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 242 | { "alpiltdx", 0, 0x070e41, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 243 | { "capsnk", 0, 0, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 244 | { "capsnka", 0, 0, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 245 | { "crackndj", 0, 0x1c2347, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 246 | { "crzytaxi", 0, 0x0d2f45, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 247 | { "csmash", 1, 0x103347, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 248 | { "csmasho", 1, 0x103347, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 249 | { "cspike", 0, 0x0e2010, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 250 | { "deathcox", 0, 0x0b64d0, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 251 | { "derbyoc", 0, 0x0fee35, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 252 | { "dybb99", 0, 0x048a01, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 253 | { "f355twin", 0, 0x06efd4, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 254 | { "f355twn2", 0, 0x1666c6, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 255 | { "ggram2", 0, 0x074a61, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 256 | { "gundmct", 0, 0x0e8010, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 257 | { "gwing2", 0, 0x0b25d0, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 258 | { "hmgeo", 0, 0x038510, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 259 | { "jambo", 0, 0x0fab95, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 260 | { "otrigger", 0, 0x0fea94, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 261 | { "pjustic", 0, 0x0725d0, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 262 | { "pstone", 0, 0x0e69c1, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 263 | { "pstone2", 0, 0x0b8dc0, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 264 | { "puyoda", 0, 0x0acd40, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 265 | { "ringout", 0, 0x0b1e40, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 266 | { "samba", 0, 0x0a8b5d, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 267 | { "samba2k", 0, 0x1702cf, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 268 | { "slasho", 0, 0x1a66ca, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 269 | { "smlg99", 0, 0x048a01, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 270 | { "spawn", 0, 0x078d01, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 271 | { "sstrkfgt", 0, 0x132303, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 272 | { "suchie3", 0, 0x0368e1, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 273 | { "toyfight", 0, 0x02ca85, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 274 | { "vf4cart", 0, 0x2ef2f96, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 275 | { "vtennis", 0, 0x03eb15, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 276 | { "vonot", 0, 0x010715, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 277 | { "wldkicks", 0, 0xae2901, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 278 | { "wwfroyal",0, 0x1627c3, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 279 | { "zerogu2", 0, 0x07c010, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 280 | { "zombrvn", 0, 0x012b41, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 281 | ||
| 282 | // games where the encryption is stacked with the ASIC's compression | |
| 283 | { "doa2", 0, -1, { -1, 0x500, 0, -1, 0x20504, 0x20000, -1, 0x40508, 0x40000, -1, 0x6050c, 0x60000, -1, 0x80510, 0x80000, // 0x8ad01, has compression | |
| 284 | -1, 0xa0514, 0xa0000, -1, 0xc0518, 0xc0000, -1, 0xe051c, 0xe0000, -1, 0x100520,0x100000, -1, 0x118a3a, 0x120000, | |
| 285 | -1, 0x12c0d8, 0x140000, -1, 0x147e22, 0x160000, -1, 0x1645ce, 0x180000, -1, 0x17c6b2, 0x1a0000, | |
| 286 | -1, 0x19902e, 0x1c0000, -1, 0x1b562a, 0x1e0000, -1, 0xffffffff, 0xffffffff } }, | |
| 287 | { "doa2m", 0, -1, { -1, 0x500, 0, -1, 0x20504, 0x20000, -1, 0x40508, 0x40000, -1, 0x6050c, 0x60000, -1, 0x80510, 0x80000, | |
| 288 | -1, 0xa0514, 0xa0000, -1, 0xc0518, 0xc0000, -1, 0xe051c, 0xe0000, -1, 0x100520,0x100000, -1, 0x11a5b4, 0x120000, | |
| 289 | -1, 0x12e7c4, 0x140000, -1, 0x1471f6, 0x160000, -1, 0x1640c4, 0x180000, -1, 0x1806ca, 0x1a0000, | |
| 290 | -1, 0x199df4, 0x1c0000, -1, 0x1b5d0a, 0x1e0000, 0xffffffff, 0xffffffff } }, | |
| 291 | { "ggx", 0, -1, { -1, 0x200000, 0x100000, -1, 0x210004, 0x110000, -1, 0x220008, 0x120000, -1, 0x228000, 0x130000, // 0x76110, uses compression | |
| 292 | 0x3af9, 0, 0x000000, 0x2288, 0, 0x010000, 0xe5e6, 0, 0x020000, 0xebb0, 0, 0x030000, | |
| 293 | 0x0228, 0, 0x040000, 0x872c, 0, 0x050000, 0xbba0, 0, 0x060000, 0x772f, 0, 0x070000, | |
| 294 | 0x2924, 0, 0x080000, 0x3222, 0, 0x090000, 0x7954, 0, 0x0a0000, 0x5acd, 0, 0x0b0000, | |
| 295 | 0xdd19, 0, 0x0c0000, 0x2428, 0, 0x0d0000, 0x3329, 0, 0x0e0000, 0x2142, 0, 0x0f0000, | |
| 296 | 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 297 | { "sgtetris", 0, -1, { 0x1234, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, // 0x08ae51, uses compression | |
| 298 | // { "virnbao", 0, 0x68b58, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, // note: "virnba" set doesn't have protection | |
| 299 | // { "vs2_2k", 0, 0x88b08, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 254 | { "18wheelr", 0x07cf54, 0 }, | |
| 255 | { "alpilota", 0x070e41, 0 }, | |
| 256 | { "alpiltdx", 0x070e41, 0 }, | |
| 257 | { "capsnk", 0, 0 }, | |
| 258 | { "capsnka", 0, 0 }, | |
| 259 | { "crackndj", 0x1c2347, 0 }, | |
| 260 | { "crzytaxi", 0x0d2f45, 0 }, | |
| 261 | { "csmash", 0x103347, 0 }, | |
| 262 | { "csmasho", 0x103347, 0 }, | |
| 263 | { "cspike", 0x0e2010, 0 }, | |
| 264 | { "deathcox", 0x0b64d0, 0 }, | |
| 265 | { "derbyoc", 0x0fee35, 0 }, | |
| 266 | { "doa2", 0x8ad01, 0 }, | |
| 267 | { "doa2m", 0x8ad01, 0 }, | |
| 268 | { "dybb99", 0x048a01, 0 }, | |
| 269 | { "f355twin", 0x06efd4, 0 }, | |
| 270 | { "f355twn2", 0x1666c6, 0 }, | |
| 271 | { "ggram2", 0x074a61, 0 }, | |
| 272 | { "ggx", 0x076110, 0 }, | |
| 273 | { "gram2000", 0, 0x7f805c3f }, | |
| 274 | { "gundmct", 0x0e8010, 0 }, | |
| 275 | { "gwing2", 0x0b25d0, 0 }, | |
| 276 | { "hmgeo", 0x038510, 0 }, | |
| 277 | { "jambo", 0x0fab95, 0 }, | |
| 278 | { "kick4csh", 0, 0x820857c9 }, | |
| 279 | { "mvsc2", 0, 0xc18b6e7c }, | |
| 280 | { "otrigger", 0x0fea94, 0 }, | |
| 281 | { "pjustic", 0x0725d0, 0 }, | |
| 282 | { "pstone", 0x0e69c1, 0 }, | |
| 283 | { "pstone2", 0x0b8dc0, 0 }, | |
| 284 | { "puyoda", 0x0acd40, 0 }, | |
| 285 | { "qmegamis", 0, 0xcd9b4896 }, | |
| 286 | { "ringout", 0x0b1e40, 0 }, | |
| 287 | { "samba", 0x0a8b5d, 0 }, | |
| 288 | { "samba2k", 0x1702cf, 0 }, | |
| 289 | { "sgtetris", 0x8ae51, 0 }, | |
| 290 | { "shootopl", 0, 0xa0f37ca7 }, | |
| 291 | { "shootpl", 0, 0x9d8de9cd }, | |
| 292 | { "shootplm", 0, 0x9d8de9cd }, | |
| 293 | { "slasho", 0x1a66ca, 0 }, | |
| 294 | { "smlg99", 0x048a01, 0 }, | |
| 295 | { "spawn", 0x078d01, 0 }, | |
| 296 | { "sstrkfgt", 0x132303, 0 }, | |
| 297 | { "suchie3", 0x0368e1, 0 }, | |
| 298 | { "toyfight", 0x02ca85, 0 }, | |
| 299 | { "vf4cart", 0x2ef2f96, 0 }, | |
| 300 | { "vf4evoct", 0, 0x1e5bb0cd }, | |
| 301 | { "virnbao", 0x68b58, 0 }, // note: "virnba" set doesn't have protection | |
| 302 | { "vs2_2k", 0x88b08, 0 }, | |
| 303 | { "vtennis", 0x03eb15, 0 }, | |
| 304 | { "vtenis2c", 0, 0x2d2d4743 }, | |
| 305 | { "vonot", 0x010715, 0 }, | |
| 306 | { "wldkicks", 0xae2901, 0 }, | |
| 307 | { "wwfroyal", 0x1627c3, 0 }, | |
| 308 | { "zerogu2", 0x07c010, 0 }, | |
| 309 | { "zombrvn", 0x012b41, 0 }, | |
| 300 | 310 | }; |
| 301 | 311 | |
| 302 | 312 | // forward declaration for decrypt function |
| 303 | static void stream_decrypt(UINT32 game_key, UINT32 sequence_key, UINT16 seed, UINT8* ciphertext, UINT8* plaintext, int length); | |
| 304 | 313 | static UINT16 block_decrypt(UINT32 game_key, UINT16 sequence_key, UINT16 counter, UINT16 data); |
| 305 | 314 | |
| 306 | 315 | /*************************************************************************** |
| r10613 | r10614 | |
| 331 | 340 | int naomibd_interrupt_callback(device_t *device, naomibd_interrupt_func callback) |
| 332 | 341 | { |
| 333 | 342 | naomibd_config *config = (naomibd_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config(); |
| 334 | //naomibd_state *v = get_safe_token(device); | |
| 335 | ||
| 336 | 343 | config->interrupt = callback; |
| 337 | 344 | return 0; |
| 338 | 345 | } |
| r10613 | r10614 | |
| 343 | 350 | return v->type; |
| 344 | 351 | } |
| 345 | 352 | |
| 353 | // M1 decryption/decompression | |
| 354 | static UINT8 naomibd_m1dec_readbyte(naomibd_state *naomibd) | |
| 355 | { | |
| 356 | UINT8 v; | |
| 346 | 357 | |
| 358 | switch (naomibd->prot.s_in_pos & 3) | |
| 359 | { | |
| 360 | case 0: | |
| 361 | v = naomibd->prot.s_input[naomibd->prot.s_in_pos + 3]; | |
| 362 | v ^= naomibd->prot.s_input[naomibd->prot.s_in_pos + 1]; | |
| 363 | break; | |
| 364 | ||
| 365 | case 1: | |
| 366 | v = naomibd->prot.s_input[naomibd->prot.s_in_pos + 1]; | |
| 367 | v ^= naomibd->prot.s_input[naomibd->prot.s_in_pos - 1]; | |
| 368 | break; | |
| 369 | ||
| 370 | case 2: | |
| 371 | v = naomibd->prot.s_input[naomibd->prot.s_in_pos - 1]; | |
| 372 | break; | |
| 373 | ||
| 374 | case 3: | |
| 375 | v = naomibd->prot.s_input[naomibd->prot.s_in_pos - 3]; | |
| 376 | break; | |
| 377 | } | |
| 378 | ||
| 379 | v ^= naomibd->prot.s_xor[naomibd->prot.s_in_pos & 3]; | |
| 380 | naomibd->prot.s_in_pos++; | |
| 381 | return v; | |
| 382 | } | |
| 383 | ||
| 384 | static void naomibd_m1dec_storebyte (naomibd_state *naomibd, UINT8 b) | |
| 385 | { | |
| 386 | if (naomibd->prot.s_subst && naomibd->prot.s_out_cnt >= 2) | |
| 387 | { | |
| 388 | b = naomibd->dc_cart_ram[naomibd->prot.s_out_cnt - 2] - b; | |
| 389 | } | |
| 390 | naomibd->dc_cart_ram[naomibd->prot.s_out_cnt] = b; | |
| 391 | naomibd->prot.s_out_cnt++; | |
| 392 | ||
| 393 | if (naomibd->prot.s_out_cnt >= (256*1024)) | |
| 394 | { | |
| 395 | fatalerror("naomibd: M1 decode exceeds buffer size!\n"); | |
| 396 | } | |
| 397 | } | |
| 398 | ||
| 399 | static void naomibd_m1dec_shiftin(naomibd_state *naomibd) | |
| 400 | { | |
| 401 | naomibd->prot.s_shift <<= 8; | |
| 402 | naomibd->prot.s_shift |= naomibd_m1dec_readbyte(naomibd); | |
| 403 | naomibd->prot.s_bits += 8; | |
| 404 | } | |
| 405 | ||
| 406 | static void naomibd_m1_decode(naomibd_state *naomibd) | |
| 407 | { | |
| 408 | int i, eos; | |
| 409 | ||
| 410 | naomibd->prot.s_xor [0] = (UINT8)naomibd->dc_dmakey; | |
| 411 | naomibd->prot.s_xor [1] = (UINT8)(naomibd->dc_dmakey >> 8); | |
| 412 | naomibd->prot.s_xor [2] = (UINT8)(naomibd->dc_dmakey >> 16); | |
| 413 | naomibd->prot.s_xor [3] = (UINT8)(naomibd->dc_dmakey >> 24); | |
| 414 | ||
| 415 | #if NAOMIBD_PRINTF_PROTECTION | |
| 416 | printf("M1 decode: dma offset %x, key %x\n", naomibd->dma_offset, naomibd->dc_dmakey); | |
| 417 | #endif | |
| 418 | ||
| 419 | naomibd->prot.s_input = naomibd->memory + naomibd->dma_offset; | |
| 420 | naomibd->prot.s_in_pos = 0; | |
| 421 | ||
| 422 | // read in the dictionary | |
| 423 | for (i = 0; i < 111; i++) | |
| 424 | { | |
| 425 | naomibd->prot.s_dict [i] = naomibd_m1dec_readbyte(naomibd); | |
| 426 | } | |
| 427 | ||
| 428 | // control bits | |
| 429 | naomibd->prot.s_subst = (naomibd->prot.s_dict [0] & 64) ? 1 : 0; | |
| 430 | ||
| 431 | // command stream | |
| 432 | naomibd->prot.s_out_cnt = 0, eos = 0; | |
| 433 | naomibd->prot.s_shift = 0, naomibd->prot.s_bits = 0; | |
| 434 | while (!eos) | |
| 435 | { | |
| 436 | int code, addr, t; | |
| 437 | ||
| 438 | if (naomibd->prot.s_bits < 2) | |
| 439 | naomibd_m1dec_shiftin(naomibd); | |
| 440 | ||
| 441 | code = (naomibd->prot.s_shift >> (naomibd->prot.s_bits - 2)) & 3; | |
| 442 | switch (code) | |
| 443 | { | |
| 444 | case 0: | |
| 445 | // 00-aa | |
| 446 | if (naomibd->prot.s_bits < 4) | |
| 447 | naomibd_m1dec_shiftin(naomibd); | |
| 448 | addr = (naomibd->prot.s_shift >> (naomibd->prot.s_bits - 4)) & 3; | |
| 449 | naomibd->prot.s_bits -= 4; | |
| 450 | if (addr == 0) | |
| 451 | { | |
| 452 | // quotation | |
| 453 | if (naomibd->prot.s_bits < 8) | |
| 454 | naomibd_m1dec_shiftin (naomibd); | |
| 455 | t = (naomibd->prot.s_shift >> (naomibd->prot.s_bits - 8)) & 255; | |
| 456 | naomibd->prot.s_bits -= 8; | |
| 457 | naomibd_m1dec_storebyte(naomibd, t); | |
| 458 | break; | |
| 459 | } | |
| 460 | naomibd_m1dec_storebyte(naomibd, naomibd->prot.s_dict [addr]); | |
| 461 | break; | |
| 462 | ||
| 463 | case 1: | |
| 464 | if (naomibd->prot.s_bits < 5) | |
| 465 | naomibd_m1dec_shiftin (naomibd); | |
| 466 | t = (naomibd->prot.s_shift >> (naomibd->prot.s_bits - 3)) & 1; | |
| 467 | if (t == 0) | |
| 468 | { | |
| 469 | // 010-aa | |
| 470 | addr = (naomibd->prot.s_shift >> (naomibd->prot.s_bits - 5)) & 3; | |
| 471 | addr += 4; | |
| 472 | naomibd->prot.s_bits -= 5; | |
| 473 | } | |
| 474 | else | |
| 475 | { | |
| 476 | // 011-aaa | |
| 477 | if (naomibd->prot.s_bits < 6) | |
| 478 | naomibd_m1dec_shiftin (naomibd); | |
| 479 | addr = (naomibd->prot.s_shift >> (naomibd->prot.s_bits - 6)) & 7; | |
| 480 | addr += 8; | |
| 481 | naomibd->prot.s_bits -= 6; | |
| 482 | } | |
| 483 | naomibd_m1dec_storebyte(naomibd, naomibd->prot.s_dict [addr]); | |
| 484 | break; | |
| 485 | ||
| 486 | case 2: | |
| 487 | if (naomibd->prot.s_bits < 7) | |
| 488 | naomibd_m1dec_shiftin(naomibd); | |
| 489 | // 10-aaaaa | |
| 490 | addr = (naomibd->prot.s_shift >> (naomibd->prot.s_bits - 7)) & 31; | |
| 491 | addr += 16; | |
| 492 | naomibd->prot.s_bits -= 7; | |
| 493 | naomibd_m1dec_storebyte(naomibd, naomibd->prot.s_dict [addr]); | |
| 494 | break; | |
| 495 | ||
| 496 | case 3: | |
| 497 | if (naomibd->prot.s_bits < 8) | |
| 498 | naomibd_m1dec_shiftin(naomibd); | |
| 499 | // 11-aaaaaa | |
| 500 | addr = (naomibd->prot.s_shift >> (naomibd->prot.s_bits - 8)) & 63; | |
| 501 | addr += 48; | |
| 502 | naomibd->prot.s_bits -= 8; | |
| 503 | if (addr == 111) | |
| 504 | { | |
| 505 | // end of stream | |
| 506 | eos = 1; | |
| 507 | } | |
| 508 | else | |
| 509 | { | |
| 510 | naomibd_m1dec_storebyte(naomibd, naomibd->prot.s_dict [addr]); | |
| 511 | } | |
| 512 | break; | |
| 513 | } | |
| 514 | } | |
| 515 | } | |
| 516 | ||
| 517 | // Streaming M2/M3 protection and decompression | |
| 518 | ||
| 519 | INLINE UINT16 bswap16(UINT16 in) | |
| 520 | { | |
| 521 | return ((in>>8) | (in<<8)); | |
| 522 | } | |
| 523 | ||
| 524 | static UINT16 naomibd_get_decrypted_stream(naomibd_state *naomibd) | |
| 525 | { | |
| 526 | UINT16 wordn = bswap16(naomibd->prot.ptr[naomibd->prot.count++]); | |
| 527 | ||
| 528 | naomibd->prot.aux_word = block_decrypt(naomibd->dc_gamekey, naomibd->dc_seqkey, naomibd->prot.seed++, wordn); | |
| 529 | wordn = (naomibd->prot.last_word&~3) | (naomibd->prot.aux_word&3); | |
| 530 | naomibd->prot.last_word = naomibd->prot.aux_word; | |
| 531 | ||
| 532 | return wordn; | |
| 533 | } | |
| 534 | ||
| 535 | static void naomibd_init_stream(naomibd_state *naomibd) | |
| 536 | { | |
| 537 | naomibd->prot.last_word = 0; | |
| 538 | ||
| 539 | naomibd->prot.control_bits = naomibd_get_decrypted_stream(naomibd); | |
| 540 | naomibd->prot.heading_word = naomibd_get_decrypted_stream(naomibd); | |
| 541 | ||
| 542 | if (naomibd->prot.control_bits & 2) | |
| 543 | { | |
| 544 | naomibd->prot.pak_bit = 0; | |
| 545 | naomibd->prot.pak_state = CMD_READY; | |
| 546 | naomibd->prot.dec_count = 0; | |
| 547 | naomibd->prot.pak_buf_size = 256 << (naomibd->prot.control_bits & 1); | |
| 548 | naomibd->prot.pak_buf_pos = 0; | |
| 549 | } | |
| 550 | } | |
| 551 | ||
| 552 | static UINT16 naomibd_get_compressed_bit(naomibd_state *naomibd) | |
| 553 | { | |
| 554 | if(naomibd->prot.pak_bit == 0) | |
| 555 | { | |
| 556 | naomibd->prot.pak_bit = 15; | |
| 557 | naomibd->prot.pak_word = naomibd_get_decrypted_stream(naomibd); | |
| 558 | } | |
| 559 | else | |
| 560 | { | |
| 561 | naomibd->prot.pak_bit--; | |
| 562 | naomibd->prot.pak_word<<=1; | |
| 563 | } | |
| 564 | return naomibd->prot.pak_word >> 15; | |
| 565 | } | |
| 566 | ||
| 567 | static UINT16 naomibd_get_decompressed_stream(naomibd_state *naomibd) | |
| 568 | { | |
| 569 | /* node format | |
| 570 | 0xxxxxxx - next node index | |
| 571 | 1a0bbccc - end node | |
| 572 | a - 0 = repeat | |
| 573 | 1 = fetch | |
| 574 | b - if a = 1 | |
| 575 | 00 - fetch 0 | |
| 576 | 01 - fetch 1 | |
| 577 | 11 - fetch -1 | |
| 578 | if a = 0 | |
| 579 | 000 | |
| 580 | c - repeat/fetch counter | |
| 581 | count = ccc + 1 | |
| 582 | 11111111 - empty node | |
| 583 | */ | |
| 584 | static UINT8 trees[9][2][32] = { | |
| 585 | { | |
| 586 | {0x01,0x10,0x0f,0x05,0xc4,0x13,0x87,0x0a,0xcc,0x81,0xce,0x0c,0x86,0x0e,0x84,0xc2, | |
| 587 | 0x11,0xc1,0xc3,0xcf,0x15,0xc8,0xcd,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,}, | |
| 588 | {0xc7,0x02,0x03,0x04,0x80,0x06,0x07,0x08,0x09,0xc9,0x0b,0x0d,0x82,0x83,0x85,0xc0, | |
| 589 | 0x12,0xc6,0xc5,0x14,0x16,0xca,0xcb,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,}, | |
| 590 | }, | |
| 591 | { | |
| 592 | {0x02,0x80,0x05,0x04,0x81,0x10,0x15,0x82,0x09,0x83,0x0b,0x0c,0x0d,0xdc,0x0f,0xde, | |
| 593 | 0x1c,0xcf,0xc5,0xdd,0x86,0x16,0x87,0x18,0x19,0x1a,0xda,0xca,0xc9,0x1e,0xce,0xff,}, | |
| 594 | {0x01,0x17,0x03,0x0a,0x08,0x06,0x07,0xc2,0xd9,0xc4,0xd8,0xc8,0x0e,0x84,0xcb,0x85, | |
| 595 | 0x11,0x12,0x13,0x14,0xcd,0x1b,0xdb,0xc7,0xc0,0xc1,0x1d,0xdf,0xc3,0xc6,0xcc,0xff,}, | |
| 596 | }, | |
| 597 | { | |
| 598 | {0xc6,0x80,0x03,0x0b,0x05,0x07,0x82,0x08,0x15,0xdc,0xdd,0x0c,0xd9,0xc2,0x14,0x10, | |
| 599 | 0x85,0x86,0x18,0x16,0xc5,0xc4,0xc8,0xc9,0xc0,0xcc,0xff,0xff,0xff,0xff,0xff,0xff,}, | |
| 600 | {0x01,0x02,0x12,0x04,0x81,0x06,0x83,0xc3,0x09,0x0a,0x84,0x11,0x0d,0x0e,0x0f,0x19, | |
| 601 | 0xca,0xc1,0x13,0xd8,0xda,0xdb,0x17,0xde,0xcd,0xcb,0xff,0xff,0xff,0xff,0xff,0xff,}, | |
| 602 | }, | |
| 603 | { | |
| 604 | {0x01,0x80,0x0d,0x04,0x05,0x15,0x83,0x08,0xd9,0x10,0x0b,0x0c,0x84,0x0e,0xc0,0x14, | |
| 605 | 0x12,0xcb,0x13,0xca,0xc8,0xc2,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,}, | |
| 606 | {0xc5,0x02,0x03,0x07,0x81,0x06,0x82,0xcc,0x09,0x0a,0xc9,0x11,0xc4,0x0f,0x85,0xd8, | |
| 607 | 0xda,0xdb,0xc3,0xdc,0xdd,0xc1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,}, | |
| 608 | }, | |
| 609 | { | |
| 610 | {0x01,0x80,0x06,0x0c,0x05,0x81,0xd8,0x84,0x09,0xdc,0x0b,0x0f,0x0d,0x0e,0x10,0xdb, | |
| 611 | 0x11,0xca,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,}, | |
| 612 | {0xc4,0x02,0x03,0x04,0xcb,0x0a,0x07,0x08,0xd9,0x82,0xc8,0x83,0xc0,0xc1,0xda,0xc2, | |
| 613 | 0xc9,0xc3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,}, | |
| 614 | }, | |
| 615 | { | |
| 616 | {0x01,0x02,0x06,0x0a,0x83,0x0b,0x07,0x08,0x09,0x82,0xd8,0x0c,0xd9,0xda,0xff,0xff, | |
| 617 | 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,}, | |
| 618 | {0xc3,0x80,0x03,0x04,0x05,0x81,0xca,0xc8,0xdb,0xc9,0xc0,0xc1,0x0d,0xc2,0xff,0xff, | |
| 619 | 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,}, | |
| 620 | }, | |
| 621 | { | |
| 622 | {0x01,0x02,0x03,0x04,0x81,0x07,0x08,0xd8,0xda,0xd9,0xff,0xff,0xff,0xff,0xff,0xff, | |
| 623 | 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,}, | |
| 624 | {0xc2,0x80,0x05,0xc9,0xc8,0x06,0x82,0xc0,0x09,0xc1,0xff,0xff,0xff,0xff,0xff,0xff, | |
| 625 | 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,}, | |
| 626 | }, | |
| 627 | { | |
| 628 | {0x01,0x80,0x04,0xc8,0xc0,0xd9,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, | |
| 629 | 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,}, | |
| 630 | {0xc1,0x02,0x03,0x81,0x05,0xd8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, | |
| 631 | 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,}, | |
| 632 | }, | |
| 633 | { | |
| 634 | {0x01,0xd8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, | |
| 635 | 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,}, | |
| 636 | {0xc0,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, | |
| 637 | 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,}, | |
| 638 | }, | |
| 639 | }; | |
| 640 | ||
| 641 | UINT32 word_complete = 2; | |
| 642 | UINT16 wordn = 0; | |
| 643 | ||
| 644 | while(word_complete) | |
| 645 | { | |
| 646 | switch(naomibd->prot.pak_state) | |
| 647 | { | |
| 648 | case CMD_READY: | |
| 649 | { | |
| 650 | UINT32 tmp = 0; | |
| 651 | INT32 slot = (naomibd->prot.pak_buf_pos & (naomibd->prot.pak_buf_size-1)); | |
| 652 | if(slot > 0) | |
| 653 | { | |
| 654 | if(slot < (naomibd->prot.pak_buf_size-7)) | |
| 655 | slot = 1; | |
| 656 | else | |
| 657 | slot = (slot & 7) + 1; | |
| 658 | } | |
| 659 | while (!(tmp&0x80)) | |
| 660 | if(naomibd_get_compressed_bit(naomibd)) | |
| 661 | tmp = trees[slot][1][tmp]; | |
| 662 | else | |
| 663 | tmp = trees[slot][0][tmp]; | |
| 664 | if(tmp != 0xff) | |
| 665 | { | |
| 666 | naomibd->prot.pak_byte = (tmp&7)+1; | |
| 667 | if(tmp&0x40) | |
| 668 | { | |
| 669 | static INT32 cmds[4] = {0, 1, 0, -1}; | |
| 670 | naomibd->prot.pak_fetch_ofs = cmds[(tmp&0x18)>>3]; | |
| 671 | naomibd->prot.pak_state = CMD_FETCH; | |
| 672 | } | |
| 673 | else | |
| 674 | { | |
| 675 | UINT8 byten; | |
| 676 | naomibd->prot.pak_state = CMD_REPEAT; | |
| 677 | byten = naomibd_get_compressed_bit(naomibd) << 1; | |
| 678 | byten = (byten | naomibd_get_compressed_bit(naomibd)) << 1; | |
| 679 | byten = (byten | naomibd_get_compressed_bit(naomibd)) << 1; | |
| 680 | byten = (byten | naomibd_get_compressed_bit(naomibd)) << 1; | |
| 681 | byten = (byten | naomibd_get_compressed_bit(naomibd)) << 1; | |
| 682 | byten = (byten | naomibd_get_compressed_bit(naomibd)) << 1; | |
| 683 | byten = (byten | naomibd_get_compressed_bit(naomibd)) << 1; | |
| 684 | byten = byten | naomibd_get_compressed_bit(naomibd); | |
| 685 | naomibd->prot.cmd_byte = byten; | |
| 686 | } | |
| 687 | } | |
| 688 | break; | |
| 689 | } | |
| 690 | case CMD_FETCH: | |
| 691 | naomibd->prot.cmd_byte = naomibd->prot.pak_buf[(naomibd->prot.pak_buf_pos-naomibd->prot.pak_buf_size+naomibd->prot.pak_fetch_ofs)&(PACK_BUF_SIZE-1)]; | |
| 692 | ||
| 693 | case CMD_REPEAT: | |
| 694 | naomibd->prot.pak_buf[naomibd->prot.pak_buf_pos&(PACK_BUF_SIZE-1)]=naomibd->prot.cmd_byte; | |
| 695 | if(word_complete&2) | |
| 696 | { | |
| 697 | wordn = naomibd->prot.cmd_byte << 8; | |
| 698 | } | |
| 699 | else | |
| 700 | { | |
| 701 | wordn = wordn | naomibd->prot.cmd_byte; | |
| 702 | } | |
| 703 | word_complete--; | |
| 704 | naomibd->prot.pak_byte--; | |
| 705 | naomibd->prot.pak_buf_pos++; | |
| 706 | if(naomibd->prot.pak_byte == 0) naomibd->prot.pak_state = CMD_READY; | |
| 707 | break; | |
| 708 | } | |
| 709 | } | |
| 710 | return wordn; | |
| 711 | } | |
| 712 | ||
| 713 | // stream read protected PIO hook | |
| 714 | //----------------------------------------------------------- | |
| 715 | static UINT16 naomibd_get_data_stream(naomibd_state *naomibd) | |
| 716 | { | |
| 717 | UINT16 wordn; | |
| 718 | ||
| 719 | if(naomibd->prot.control_bits&2) | |
| 720 | { | |
| 721 | wordn = naomibd_get_decompressed_stream(naomibd); | |
| 722 | } | |
| 723 | else | |
| 724 | { | |
| 725 | wordn = naomibd_get_decrypted_stream(naomibd); | |
| 726 | } | |
| 727 | ||
| 728 | return wordn; | |
| 729 | } | |
| 730 | ||
| 347 | 731 | void *naomibd_get_memory(device_t *device) |
| 348 | 732 | { |
| 733 | naomibd_state *naomibd = get_safe_token(device); | |
| 734 | ||
| 735 | // for M1 decodes, return the buffer we'll DMA from | |
| 736 | if (!(naomibd->dma_offset_flags & NAOMIBD_FLAG_DMA_COMPRESSION) && (naomibd->type == ROM_BOARD) && (naomibd->dc_dmakey != 0)) | |
| 737 | { | |
| 738 | // perform the M1 decode | |
| 739 | naomibd_m1_decode(naomibd); | |
| 740 | ||
| 741 | // return the pointer to our output buffer | |
| 742 | return naomibd->dc_cart_ram; | |
| 743 | } | |
| 744 | ||
| 745 | if (!(naomibd->dma_offset_flags & NAOMIBD_FLAG_DMA_COMPRESSION) && (naomibd->type == ROM_BOARD)) | |
| 746 | { | |
| 747 | logerror("Unhandled M1 DMA with key %x, flags %x, offset %x\n", naomibd->dc_dmakey, naomibd->dma_offset_flags, naomibd->dma_offset); | |
| 748 | } | |
| 749 | ||
| 349 | 750 | return get_safe_token(device)->memory; |
| 350 | 751 | } |
| 351 | 752 | |
| 352 | ||
| 353 | 753 | offs_t naomibd_get_dmaoffset(device_t *device) |
| 354 | 754 | { |
| 755 | naomibd_state *naomibd = get_safe_token(device); | |
| 355 | 756 | offs_t result = 0; |
| 356 | 757 | |
| 357 | 758 | #if NAOMIBD_PRINTF_PROTECTION |
| r10613 | r10614 | |
| 359 | 760 | #endif |
| 360 | 761 | |
| 361 | 762 | // if the flag is cleared that lets the protection chip go, |
| 362 | // we need to handle this specially. but not on DIMM boards. | |
| 363 | if (!(get_safe_token(device)->dma_offset_flags & NAOMIBD_FLAG_ADDRESS_SHUFFLE) && (get_safe_token(device)->type == ROM_BOARD)) | |
| 763 | // we need to handle this specially. but not on DIMM boards or if there's no key. | |
| 764 | if (!(naomibd->dma_offset_flags & NAOMIBD_FLAG_DMA_COMPRESSION) && (naomibd->type == ROM_BOARD) && (naomibd->dc_dmakey != 0)) | |
| 364 | 765 | { |
| 365 | if (!strcmp(device->machine->gamedrv->name, "qmegamis")) | |
| 366 | { | |
| 367 | result = 0x9000000; | |
| 368 | return result; | |
| 369 | } | |
| 370 | else if (!strcmp(device->machine->gamedrv->name, "mvsc2")) | |
| 371 | { | |
| 372 | switch (get_safe_token(device)->dma_offset) | |
| 373 | { | |
| 374 | case 0x08000000: result = 0x8800000; break; | |
| 375 | case 0x08026440: result = 0x8830000; break; | |
| 376 | case 0x0803bda0: result = 0x8850000; break; | |
| 377 | case 0x0805a560: result = 0x8870000; break; | |
| 378 | case 0x0805b720: result = 0x8880000; break; | |
| 379 | case 0x0808b7e0: result = 0x88a0000; break; | |
| 380 | default: | |
| 381 | result = get_safe_token(device)->dma_offset; | |
| 382 | break; | |
| 383 | } | |
| 384 | ||
| 385 | return result; | |
| 386 | } | |
| 387 | else | |
| 388 | { | |
| 389 | logerror("Protected DMA not handled for this game (dma_offset %x)\n", get_safe_token(device)->dma_offset); | |
| 390 | } | |
| 766 | // no offset, start at the beginning of cart ram for M1 transfers | |
| 767 | result = 0; | |
| 391 | 768 | } |
| 769 | else | |
| 770 | { | |
| 771 | result = get_safe_token(device)->dma_offset; | |
| 772 | } | |
| 392 | 773 | |
| 393 | result = get_safe_token(device)->dma_offset; | |
| 394 | 774 | return result; |
| 395 | 775 | } |
| 396 | 776 | |
| r10613 | r10614 | |
| 426 | 806 | device->save_item(NAME(v->aw_offset)); |
| 427 | 807 | device->save_item(NAME(v->aw_file_base)); |
| 428 | 808 | device->save_item(NAME(v->aw_file_offset)); |
| 809 | device->save_item(NAME(v->dc_m3_ptr)); | |
| 810 | device->save_item(NAME(v->dc_cart_ram)); | |
| 811 | device->save_item(NAME(v->prot.last_word)); | |
| 812 | device->save_item(NAME(v->prot.aux_word)); | |
| 813 | device->save_item(NAME(v->prot.pak_word)); | |
| 814 | device->save_item(NAME(v->prot.heading_word)); | |
| 815 | device->save_item(NAME(v->prot.count)); | |
| 816 | device->save_item(NAME(v->prot.pak_bit)); | |
| 817 | device->save_item(NAME(v->prot.control_bits)); | |
| 818 | device->save_item(NAME(v->prot.pak_state)); | |
| 819 | device->save_item(NAME(v->prot.dec_count)); | |
| 820 | device->save_item(NAME(v->prot.pak_buf_size)); | |
| 821 | device->save_item(NAME(v->prot.pak_buf_pos)); | |
| 822 | device->save_item(NAME(v->prot.pak_fetch_ofs)); | |
| 823 | device->save_item(NAME(v->prot.pak_byte)); | |
| 824 | device->save_item(NAME(v->prot.cmd_byte)); | |
| 825 | device->save_item(NAME(v->prot.seed)); | |
| 826 | device->save_item(NAME(v->prot.s_xor)); | |
| 827 | device->save_item(NAME(v->prot.s_dict)); | |
| 828 | device->save_item(NAME(v->prot.s_subst)); | |
| 829 | device->save_item(NAME(v->prot.s_out_len)); | |
| 830 | device->save_item(NAME(v->prot.s_out_cnt)); | |
| 831 | device->save_item(NAME(v->prot.s_shift)); | |
| 832 | device->save_item(NAME(v->prot.s_bits)); | |
| 833 | device->save_item(NAME(v->prot.s_in_len)); | |
| 834 | device->save_item(NAME(v->prot.s_in_pos)); | |
| 429 | 835 | } |
| 430 | 836 | |
| 431 | 837 | |
| r10613 | r10614 | |
| 438 | 844 | |
| 439 | 845 | static void soft_reset(naomibd_state *v) |
| 440 | 846 | { |
| 441 | v->prot_sum = 0; | |
| 442 | ||
| 443 | 847 | v->dc_m3_ptr = 0; |
| 444 | 848 | v->dc_seqkey = 0; |
| 445 | 849 | } |
| r10613 | r10614 | |
| 474 | 878 | // can we live-decrypt this game? |
| 475 | 879 | if (v->dc_gamekey != -1) |
| 476 | 880 | { |
| 477 | ret = (UINT64)(v->dc_cart_ram[v->dc_readback+1] | (v->dc_cart_ram[v->dc_readback]<<8)); | |
| 478 | v->dc_readback += 2; | |
| 881 | ret = (UINT64)naomibd_get_data_stream(v); | |
| 479 | 882 | } |
| 480 | 883 | else |
| 481 | 884 | { |
| 482 | if (v->rom_offset == 0x1fffe) | |
| 483 | { | |
| 484 | UINT8 *prot = (UINT8 *)v->protdata; | |
| 485 | UINT32 byte_offset = v->prot_offset*2; | |
| 486 | ||
| 487 | // this is a good time to clear the prot_sum | |
| 488 | v->prot_sum = 0; | |
| 489 | ||
| 490 | if (v->prot_translate == NULL) | |
| 491 | { | |
| 492 | #if NAOMIBD_PRINTF_PROTECTION | |
| 493 | v->prot_pio_count += 2; | |
| 494 | printf("naomibd: reading protection data, but none was supplied (now %x bytes)\n", v->prot_pio_count); | |
| 495 | #endif | |
| 496 | return 0; | |
| 497 | } | |
| 498 | ||
| 499 | #if NAOMIBD_PRINTF_PROTECTION | |
| 500 | v->prot_pio_count += 2; | |
| 501 | printf("naomibd: PIO read count %x\n", v->prot_pio_count); | |
| 502 | #endif | |
| 503 | ||
| 504 | if (v->prot_reverse_bytes) | |
| 505 | { | |
| 506 | ret = (UINT64)(prot[byte_offset+1] | (prot[byte_offset]<<8)); | |
| 507 | } | |
| 508 | else | |
| 509 | { | |
| 510 | ret = (UINT64)(prot[byte_offset] | (prot[byte_offset+1]<<8)); | |
| 511 | } | |
| 512 | ||
| 513 | v->prot_offset++; | |
| 514 | } | |
| 515 | #if NAOMIBD_PRINTF_PROTECTION | |
| 516 | else | |
| 517 | { | |
| 518 | printf("Bad protection offset read %x\n", v->rom_offset); | |
| 519 | } | |
| 520 | #endif | |
| 885 | ret = U64(0); | |
| 521 | 886 | } |
| 522 | 887 | } |
| 523 | 888 | else |
| r10613 | r10614 | |
| 619 | 984 | v->aw_offset &= 0xffff; |
| 620 | 985 | v->aw_offset |= ((data>>16) & 0xffff0000); |
| 621 | 986 | v->dma_offset = v->aw_offset*2; |
| 622 | v->dma_offset_flags = NAOMIBD_FLAG_ | |
| 987 | v->dma_offset_flags = NAOMIBD_FLAG_ | |
| 623 | 988 | //printf("EPR_OFFSETH = %x, dma_offset %x\n", (UINT32)(data>>32), v->dma_offset); |
| 624 | 989 | } |
| 625 | 990 | |
| r10613 | r10614 | |
| 712 | 1077 | // DMA_OFFSETH |
| 713 | 1078 | v->dma_offset &= 0xffff; |
| 714 | 1079 | v->dma_offset |= (data >> 16) & 0x1fff0000; |
| 715 | v->dma_offset_flags = (data>>28); | |
| 1080 | v->dma_offset_flags = (data>>(28+16)); | |
| 716 | 1081 | } |
| 717 | 1082 | if(ACCESSING_BITS_0_15) |
| 718 | 1083 | { |
| r10613 | r10614 | |
| 733 | 1098 | v->prot_key = data; |
| 734 | 1099 | |
| 735 | 1100 | #if NAOMIBD_PRINTF_PROTECTION |
| 736 | printf("Protection: set up read @ %x, key %x sum %x (PIO %x DMA %x) [%s]\n", v->prot_offset*2, v->prot_key, v->prot_sum, v->rom_offset, v->dma_offset, device->machine->describe_context()); | |
| 737 | ||
| 738 | v->prot_pio_count = 0; | |
| 1101 | printf("Protection: set up read @ %x, key %x (PIO %x DMA %x) [%s]\n", v->prot_offset*2, v->prot_key, v->rom_offset, v->dma_offset, device->machine->describe_context()); | |
| 739 | 1102 | #endif |
| 740 | 1103 | |
| 741 | 1104 | // if dc_gamekey isn't -1, we can live-decrypt this one |
| 742 | 1105 | if (v->dc_gamekey != -1) |
| 743 | 1106 | { |
| 744 | UINT8 temp_ram[128*1024]; | |
| 745 | 1107 | UINT8 *ROM = (UINT8 *)v->memory; |
| 746 | 1108 | |
| 747 | v->dc_seed = 0; | |
| 748 | v->dc_readback = 0; | |
| 749 | 1109 | v->dc_seqkey = v->prot_key; |
| 750 | 1110 | |
| 751 | #if NAOMIBD_PRINTF_PROTECTION | |
| 752 | printf("M2/M3 decrypt: gamekey %x seqkey %x seed %x length %x\n", v->dc_gamekey, v->dc_seqkey, v->dc_seed, v->dc_m3_ptr); | |
| 753 | #endif | |
| 754 | ||
| 755 | // M2: just decrypt up to the size limit since we don't know the size in advance | |
| 756 | 1111 | if (v->prot_offset != 0x2000000/2) |
| 757 | 1112 | { |
| 758 | // decrypt to temp buffer | |
| 759 | stream_decrypt(v->dc_gamekey, v->dc_seqkey, v->prot_offset&0xffff, &ROM[v->prot_offset*2], temp_ram, 128*1024); | |
| 1113 | // M2: decrypt from ROM | |
| 1114 | v->prot.ptr = (UINT16 *)&ROM[v->prot_offset*2]; | |
| 1115 | v->prot.seed = v->prot_offset&0xffff; | |
| 1116 | #if NAOMIBD_PRINTF_PROTECTION | |
| 1117 | printf("M2 decrypt: gamekey %x seqkey %x length %x\n", v->dc_gamekey, v->dc_seqkey, v->dc_m3_ptr); | |
| 1118 | #endif | |
| 760 | 1119 | } |
| 761 | 1120 | else |
| 762 | 1121 | { |
| 763 | // decrypt cart ram to temp buffer | |
| 764 | stream_decrypt(v->dc_gamekey, v->dc_seqkey, v->dc_seed, v->dc_cart_ram, temp_ram, v->dc_m3_ptr); | |
| 1122 | // M3: decrypt from cart ram | |
| 1123 | v->prot.ptr = (UINT16 *)v->dc_cart_ram; | |
| 1124 | v->prot.seed = 0; | |
| 1125 | #if NAOMIBD_PRINTF_PROTECTION | |
| 1126 | printf("M3 decrypt: gamekey %x seqkey %x length %x\n", v->dc_gamekey, v->dc_seqkey, v->dc_m3_ptr); | |
| 1127 | #endif | |
| 765 | 1128 | } |
| 766 | 1129 | |
| 767 | #if NAOMIBD_PRINTF_PROTECTION | |
| 768 | printf("result: %02x %02x %02x %02x %02x %02x %02x %02x\n", | |
| 769 | temp_ram[0], temp_ram[1], temp_ram[2], temp_ram[3], | |
| 770 | temp_ram[4], temp_ram[5], temp_ram[6], temp_ram[7]); | |
| 771 | #endif | |
| 1130 | v->prot.count = 0; | |
| 1131 | naomibd_init_stream(v); | |
| 772 | 1132 | |
| 773 | // copy results to cart ram for readback | |
| 774 | memcpy(v->dc_cart_ram, temp_ram, 128*1024); | |
| 775 | ||
| 776 | 1133 | v->dc_m3_ptr = 0; |
| 777 | v->prot_sum = 0; | |
| 778 | 1134 | } |
| 779 | else | |
| 780 | { | |
| 781 | // translate address if necessary | |
| 782 | if (v->prot_translate != NULL) | |
| 783 | { | |
| 784 | int i = 0; | |
| 785 | while (v->prot_translate[i+1] != 0xffffffff) | |
| 786 | { | |
| 787 | // should we match by key, address, or sum? | |
| 788 | if (v->prot_translate[i] == -2) // match sum | |
| 789 | { | |
| 790 | if (v->prot_translate[i+1] == v->prot_sum) | |
| 791 | { | |
| 792 | #if NAOMIBD_PRINTF_PROTECTION | |
| 793 | printf("Protection: got sum %x, translated to %x\n", v->prot_sum, v->prot_translate[i+2]); | |
| 794 | #endif | |
| 795 | v->prot_offset = v->prot_translate[i+2]/2; | |
| 796 | break; | |
| 797 | } | |
| 798 | else | |
| 799 | { | |
| 800 | i+= 3; | |
| 801 | } | |
| 802 | } | |
| 803 | else if (v->prot_translate[i] == -1) // match address | |
| 804 | { | |
| 805 | if (v->prot_translate[i+1] == (v->prot_offset*2)) | |
| 806 | { | |
| 807 | #if NAOMIBD_PRINTF_PROTECTION | |
| 808 | printf("Protection: got offset %x, translated to %x\n", v->prot_offset, v->prot_translate[i+2]); | |
| 809 | #endif | |
| 810 | v->prot_offset = v->prot_translate[i+2]/2; | |
| 811 | break; | |
| 812 | } | |
| 813 | else | |
| 814 | { | |
| 815 | i += 3; | |
| 816 | } | |
| 817 | } | |
| 818 | else // match key | |
| 819 | { | |
| 820 | if (v->prot_translate[i] == v->prot_key) | |
| 821 | { | |
| 822 | #if NAOMIBD_PRINTF_PROTECTION | |
| 823 | printf("Protection: got key %x, translated to %x\n", v->prot_key, v->prot_translate[i+2]); | |
| 824 | #endif | |
| 825 | v->prot_offset = v->prot_translate[i+2]/2; | |
| 826 | break; | |
| 827 | } | |
| 828 | else | |
| 829 | { | |
| 830 | i+= 3; | |
| 831 | } | |
| 832 | } | |
| 833 | } | |
| 834 | } | |
| 835 | #if NAOMIBD_PRINTF_PROTECTION | |
| 836 | else | |
| 837 | { | |
| 838 | printf("naomibd: protection not handled for this game\n"); | |
| 839 | } | |
| 840 | #endif | |
| 841 | } | |
| 1135 | #if NAOMIBD_PRINTF_PROTECTION | |
| 1136 | else | |
| 1137 | { | |
| 1138 | printf("naomibd: protection not handled for this game\n"); | |
| 1139 | } | |
| 1140 | #endif | |
| 842 | 1141 | break; |
| 843 | 1142 | |
| 844 | 1143 | case 0x2000000: |
| 845 | 1144 | case 0x2020000: |
| 846 | #if NAOMIBD_PRINTF_PROTECTION | |
| 847 | printf("Protection write %04x to upload @ %x\n", (UINT32)(data&0xffff), v->dc_m3_ptr); | |
| 848 | #endif | |
| 849 | v->prot_sum += (INT16)(data&0xffff); | |
| 850 | ||
| 851 | 1145 | v->dc_cart_ram[v->dc_m3_ptr] = (data&0xff); |
| 852 | 1146 | v->dc_cart_ram[v->dc_m3_ptr+1] = (data>>8)&0xff; |
| 853 | 1147 | v->dc_m3_ptr += 2; |
| r10613 | r10614 | |
| 1703 | 1997 | return aux; |
| 1704 | 1998 | } |
| 1705 | 1999 | |
| 1706 | static void stream_decrypt(UINT32 game_key, UINT32 sequence_key, UINT16 seed, UINT8* ciphertext, UINT8* plaintext, int length) | |
| 1707 | { | |
| 1708 | UINT16 counter = seed; | |
| 1709 | UINT16 last_word; | |
| 1710 | UINT16 plain_word; | |
| 1711 | UINT16 aux_word; | |
| 1712 | int control_bits; | |
| 1713 | UINT16 heading_word; | |
| 1714 | ||
| 1715 | last_word = block_decrypt(game_key, sequence_key, counter, *ciphertext<<8 | *(ciphertext+1)); | |
| 1716 | control_bits = last_word&3; | |
| 1717 | ++counter; ciphertext+=2; | |
| 1718 | ||
| 1719 | aux_word = block_decrypt(game_key, sequence_key, counter, *ciphertext<<8 | *(ciphertext+1)); | |
| 1720 | heading_word = (last_word&~3) | (aux_word&3); | |
| 1721 | last_word = aux_word; | |
| 1722 | ++counter; ciphertext+=2; | |
| 1723 | ||
| 1724 | if (BIT(control_bits,1)==0) // no decompression, just decryption | |
| 1725 | { | |
| 1726 | for (; length>0; length-=2, ++counter, ciphertext+=2) | |
| 1727 | { | |
| 1728 | aux_word = block_decrypt(game_key, sequence_key, counter, *ciphertext<<8 | *(ciphertext+1)); | |
| 1729 | plain_word = (last_word&~3) | (aux_word&3); | |
| 1730 | last_word = aux_word; | |
| 1731 | ||
| 1732 | *(plaintext++) = plain_word>>8; | |
| 1733 | *(plaintext++) = plain_word&0xff; | |
| 1734 | } | |
| 1735 | } | |
| 1736 | else // decryption plus decompression | |
| 1737 | { | |
| 1738 | fatalerror("NAOMI ASIC compression unsupported\n"); | |
| 1739 | return; // not implemented, decompression has not been fully reverse engineered as of february/2010 | |
| 1740 | } | |
| 1741 | } | |
| 1742 | ||
| 1743 | 2000 | /*************************************************************************** |
| 1744 | 2001 | DEVICE INTERFACE |
| 1745 | 2002 | ***************************************************************************/ |
| r10613 | r10614 | |
| 1766 | 2023 | /* store a pointer back to the device */ |
| 1767 | 2024 | v->device = device; |
| 1768 | 2025 | |
| 1769 | /* find the protection address translation for this game */ | |
| 1770 | v->prot_translate = (UINT32 *)0; | |
| 1771 | #if NAOMIBD_PRINTF_PROTECTION | |
| 1772 | v->prot_pio_count = 0; | |
| 1773 | #endif | |
| 2026 | v->dc_dmakey = 0; | |
| 2027 | ||
| 1774 | 2028 | for (i=0; i<ARRAY_LENGTH(naomibd_translate_tbl); i++) |
| 1775 | 2029 | { |
| 1776 | 2030 | if (!strcmp(device->machine->gamedrv->name, naomibd_translate_tbl[i].name)) |
| 1777 | 2031 | { |
| 1778 | v->prot_translate = &naomibd_translate_tbl[i].transtbl[0]; | |
| 1779 | v->prot_reverse_bytes = naomibd_translate_tbl[i].reverse_bytes; | |
| 1780 | v->dc_gamekey = naomibd_translate_tbl[i].live_key; | |
| 2032 | v->dc_gamekey = naomibd_translate_tbl[i].m2m3_key; | |
| 2033 | v->dc_dmakey = naomibd_translate_tbl[i].m1_key; | |
| 1781 | 2034 | break; |
| 1782 | 2035 | } |
| 1783 | 2036 | } |
| r10613 | r10614 | |
| 1787 | 2040 | { |
| 1788 | 2041 | case ROM_BOARD: |
| 1789 | 2042 | v->memory = (UINT8 *)device->machine->region(config->regiontag)->base(); |
| 1790 | v->protdata = (UINT8 *)device->machine->region("naomibd_prot")->base(); | |
| 1791 | 2043 | break; |
| 1792 | 2044 | |
| 1793 | 2045 | case AW_ROM_BOARD: |
| r10613 | r10614 | |
|---|---|---|
| 1008 | 1008 | // now go ahead and set the mapping in the page table |
| 1009 | 1009 | memc_pages[log] = phys + (memc*0x80); |
| 1010 | 1010 | |
| 1011 | ||
| 1011 | // printf("PC=%08x = MEMC_PAGE(%d): W %08x: log %x to phys %x, MEMC %d, perms %d\n", cpu_get_pc(space->cpu),memc_pagesize, data, log, phys, memc, perms); | |
| 1012 | 1012 | } |
| 1013 | 1013 |
| r10613 | r10614 | |
|---|---|---|
| 533 | 533 | p_psx->n_dicr = ( p_psx->n_dicr & ( 0x80000000 | ~mem_mask ) ) | |
| 534 | 534 | ( p_psx->n_dicr & ~data & 0x7f000000 & mem_mask ) | |
| 535 | 535 | ( data & 0x00ffffff & mem_mask ); |
| 536 | ||
| 536 | ||
| 537 | 537 | if( ( p_psx->n_dicr & 0x80000000 ) != 0 && ( p_psx->n_dicr & 0x7f000000 ) == 0 ) |
| 538 | 538 | { |
| 539 | 539 | verboselog( p_psx, 2, "dma interrupt cleared\n" ); |
| r10613 | r10614 | |
|---|---|---|
| 465 | 465 | case 0x20d: hgt = 0x280; break; /*|*/ |
| 466 | 466 | case 0x20e: hgt = 0x240; break; /*|*/ |
| 467 | 467 | case 0x20f: hgt = 0x200; break; /*L*/ |
| 468 | case 0x534: state->i8751_return = hgt; | |
| 468 | case 0x534: state->i8751_return = hgt; | |
| 469 | 469 | |
| 470 | 470 | /*At the ending screen(???)*/ |
| 471 | 471 | //case 0x3b4: state->i8751_return = 0; break; |
| r10613 | r10614 | |
|---|---|---|
| 15 | 15 | #include "sound/hc55516.h" |
| 16 | 16 | |
| 17 | 17 | |
| 18 | /* banking addresses set by the drivers */ | |
| 19 | UINT8 *mayday_protection; | |
| 20 | ||
| 21 | /* internal bank switching tracking */ | |
| 22 | static UINT8 blaster_bank; | |
| 23 | static UINT8 vram_bank; | |
| 24 | ||
| 25 | /* other stuff */ | |
| 26 | static UINT16 joust2_current_sound_data; | |
| 27 | ||
| 28 | 18 | /* older-Williams routines */ |
| 29 | 19 | static void williams_main_irq(device_t *device, int state); |
| 30 | 20 | static void williams_main_firq(device_t *device, int state); |
| r10613 | r10614 | |
| 33 | 23 | static WRITE8_DEVICE_HANDLER( playball_snd_cmd_w ); |
| 34 | 24 | |
| 35 | 25 | /* input port mapping */ |
| 36 | static UINT8 port_select; | |
| 37 | 26 | static WRITE8_DEVICE_HANDLER( williams_port_select_w ); |
| 38 | 27 | static READ8_DEVICE_HANDLER( williams_input_port_49way_0_5_r ); |
| 39 | 28 | static READ8_DEVICE_HANDLER( williams_49way_port_0_r ); |
| r10613 | r10614 | |
| 352 | 341 | |
| 353 | 342 | static MACHINE_START( williams_common ) |
| 354 | 343 | { |
| 344 | williams_state *state = machine->driver_data<williams_state>(); | |
| 355 | 345 | /* configure the memory bank */ |
| 356 | memory_configure_bank(machine, "bank1", 0, 1, | |
| 346 | memory_configure_bank(machine, "bank1", 0, 1, | |
| 357 | 347 | memory_configure_bank(machine, "bank1", 1, 1, machine->region("maincpu")->base() + 0x10000, 0); |
| 358 | 348 | |
| 359 | state_save_register_global(machine, vram_bank); | |
| 349 | state_save_register_global(machine, state->vram_bank); | |
| 360 | 350 | } |
| 361 | 351 | |
| 362 | 352 | |
| r10613 | r10614 | |
| 441 | 431 | |
| 442 | 432 | static STATE_POSTLOAD( williams2_postload ) |
| 443 | 433 | { |
| 434 | williams_state *state = machine->driver_data<williams_state>(); | |
| 444 | 435 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 445 | williams2_bank_select_w(space, 0, vram_bank); | |
| 436 | williams2_bank_select_w(space, 0, state->vram_bank); | |
| 446 | 437 | } |
| 447 | 438 | |
| 448 | 439 | |
| 449 | 440 | MACHINE_START( williams2 ) |
| 450 | 441 | { |
| 442 | williams_state *state = machine->driver_data<williams_state>(); | |
| 451 | 443 | /* configure memory banks */ |
| 452 | memory_configure_bank(machine, "bank1", 0, 1, | |
| 444 | memory_configure_bank(machine, "bank1", 0, 1, | |
| 453 | 445 | memory_configure_bank(machine, "bank1", 1, 4, machine->region("maincpu")->base() + 0x10000, 0x10000); |
| 454 | 446 | |
| 455 | 447 | /* register for save states */ |
| 456 | state_save_register_global(machine, vram_bank); | |
| 448 | state_save_register_global(machine, state->vram_bank); | |
| 457 | 449 | machine->state().register_postload(williams2_postload, NULL); |
| 458 | 450 | } |
| 459 | 451 | |
| r10613 | r10614 | |
| 484 | 476 | |
| 485 | 477 | WRITE8_HANDLER( williams_vram_select_w ) |
| 486 | 478 | { |
| 479 | williams_state *state = space->machine->driver_data<williams_state>(); | |
| 487 | 480 | /* VRAM/ROM banking from bit 0 */ |
| 488 | vram_bank = data & 0x01; | |
| 489 | memory_set_bank(space->machine, "bank1", vram_bank); | |
| 481 | state->vram_bank = data & 0x01; | |
| 482 | memory_set_bank(space->machine, "bank1", state->vram_bank); | |
| 490 | 483 | |
| 491 | 484 | /* cocktail flip from bit 1 */ |
| 492 | | |
| 485 | | |
| 493 | 486 | } |
| 494 | 487 | |
| 495 | 488 | |
| 496 | 489 | WRITE8_HANDLER( williams2_bank_select_w ) |
| 497 | 490 | { |
| 498 | vram_bank = data & 0x07; | |
| 491 | williams_state *state = space->machine->driver_data<williams_state>(); | |
| 492 | state->vram_bank = data & 0x07; | |
| 499 | 493 | |
| 500 | 494 | /* the low two bits control the paging */ |
| 501 | switch (vram_bank & 0x03) | |
| 495 | switch (state->vram_bank & 0x03) | |
| 502 | 496 | { |
| 503 | 497 | /* page 0 is video ram */ |
| 504 | 498 | case 0: |
| 505 | 499 | memory_install_read_bank(space, 0x0000, 0x8fff, 0, 0, "bank1"); |
| 506 | 500 | memory_install_write_bank(space, 0x8000, 0x87ff, 0, 0, "bank4"); |
| 507 | 501 | memory_set_bank(space->machine, "bank1", 0); |
| 508 | memory_set_bankptr(space->machine, "bank4", & | |
| 502 | memory_set_bankptr(space->machine, "bank4", & | |
| 509 | 503 | break; |
| 510 | 504 | |
| 511 | 505 | /* pages 1 and 2 are ROM */ |
| r10613 | r10614 | |
| 513 | 507 | case 2: |
| 514 | 508 | memory_install_read_bank(space, 0x0000, 0x8fff, 0, 0, "bank1"); |
| 515 | 509 | memory_install_write_bank(space, 0x8000, 0x87ff, 0, 0, "bank4"); |
| 516 | memory_set_bank(space->machine, "bank1", 1 + ((vram_bank & 6) >> 1)); | |
| 517 | memory_set_bankptr(space->machine, "bank4", &williams_videoram[0x8000]); | |
| 510 | memory_set_bank(space->machine, "bank1", 1 + ((state->vram_bank & 6) >> 1)); | |
| 511 | memory_set_bankptr(space->machine, "bank4", &state->videoram[0x8000]); | |
| 518 | 512 | break; |
| 519 | 513 | |
| 520 | 514 | /* page 3 accesses palette RAM; the remaining areas are as if page 1 ROM was selected */ |
| 521 | 515 | case 3: |
| 522 | 516 | memory_install_read_bank(space, 0x8000, 0x87ff, 0, 0, "bank4"); |
| 523 | 517 | memory_install_write8_handler(space, 0x8000, 0x87ff, 0, 0, williams2_paletteram_w); |
| 524 | memory_set_bank(space->machine, "bank1", 1 + ((vram_bank & 4) >> 1)); | |
| 518 | memory_set_bank(space->machine, "bank1", 1 + ((state->vram_bank & 4) >> 1)); | |
| 525 | 519 | memory_set_bankptr(space->machine, "bank4", space->machine->generic.paletteram.v); |
| 526 | 520 | break; |
| 527 | 521 | } |
| r10613 | r10614 | |
| 577 | 571 | |
| 578 | 572 | WRITE8_DEVICE_HANDLER( williams_port_select_w ) |
| 579 | 573 | { |
| 580 | port_select = data; | |
| 574 | williams_state *state = device->machine->driver_data<williams_state>(); | |
| 575 | state->port_select = data; | |
| 581 | 576 | } |
| 582 | 577 | |
| 583 | 578 | CUSTOM_INPUT( williams_mux_r ) |
| 584 | 579 | { |
| 580 | williams_state *state = field->port->machine->driver_data<williams_state>(); | |
| 585 | 581 | const char *tag = (const char *)param; |
| 586 | 582 | |
| 587 | if (port_select != 0) | |
| 583 | if (state->port_select != 0) | |
| 588 | 584 | tag += strlen(tag) + 1; |
| 589 | 585 | |
| 590 | 586 | return input_port_read(field->port->machine, tag); |
| r10613 | r10614 | |
| 624 | 620 | |
| 625 | 621 | READ8_DEVICE_HANDLER( williams_input_port_49way_0_5_r ) |
| 626 | 622 | { |
| 627 | if (port_select) | |
| 623 | williams_state *state = device->machine->driver_data<williams_state>(); | |
| 624 | if (state->port_select) | |
| 628 | 625 | return williams_49way_port_0_r(device, 0); |
| 629 | 626 | else |
| 630 | 627 | return input_port_read(device->machine, "IN3"); |
| r10613 | r10614 | |
| 727 | 724 | |
| 728 | 725 | static STATE_POSTLOAD( defender_postload ) |
| 729 | 726 | { |
| 727 | williams_state *state = machine->driver_data<williams_state>(); | |
| 730 | 728 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 731 | defender_bank_select_w(space, 0, vram_bank); | |
| 729 | defender_bank_select_w(space, 0, state->vram_bank); | |
| 732 | 730 | } |
| 733 | 731 | |
| 734 | 732 | |
| r10613 | r10614 | |
| 755 | 753 | |
| 756 | 754 | WRITE8_HANDLER( defender_video_control_w ) |
| 757 | 755 | { |
| 758 | williams_cocktail = data & 0x01; | |
| 756 | williams_state *state = space->machine->driver_data<williams_state>(); | |
| 757 | state->cocktail = data & 0x01; | |
| 759 | 758 | } |
| 760 | 759 | |
| 761 | 760 | |
| 762 | 761 | WRITE8_HANDLER( defender_bank_select_w ) |
| 763 | 762 | { |
| 764 | vram_bank = data & 0x0f; | |
| 763 | williams_state *state = space->machine->driver_data<williams_state>(); | |
| 764 | state->vram_bank = data & 0x0f; | |
| 765 | 765 | |
| 766 | 766 | /* set bank address */ |
| 767 | 767 | switch (data) |
| r10613 | r10614 | |
| 783 | 783 | case 9: |
| 784 | 784 | memory_install_read_bank(space, 0xc000, 0xcfff, 0, 0, "bank1"); |
| 785 | 785 | memory_unmap_write(space, 0xc000, 0xcfff, 0, 0); |
| 786 | memory_set_bank(space->machine, "bank1", vram_bank - 1); | |
| 786 | memory_set_bank(space->machine, "bank1", state->vram_bank - 1); | |
| 787 | 787 | break; |
| 788 | 788 | |
| 789 | 789 | /* pages A-F are not connected */ |
| r10613 | r10614 | |
| 803 | 803 | |
| 804 | 804 | READ8_HANDLER( mayday_protection_r ) |
| 805 | 805 | { |
| 806 | williams_state *state = space->machine->driver_data<williams_state>(); | |
| 806 | 807 | /* Mayday does some kind of protection check that is not currently understood */ |
| 807 | 808 | /* However, the results of that protection check are stored at $a190 and $a191 */ |
| 808 | 809 | /* These are compared against $a193 and $a194, respectively. Thus, to prevent */ |
| 809 | 810 | /* the protection from resetting the space->machine, we just return $a193 for $a190, */ |
| 810 | 811 | /* and $a194 for $a191. */ |
| 811 | return mayday_protection[offset + 3]; | |
| 812 | return state->mayday_protection[offset + 3]; | |
| 812 | 813 | } |
| 813 | 814 | |
| 814 | 815 | |
| r10613 | r10614 | |
| 821 | 822 | |
| 822 | 823 | WRITE8_HANDLER( sinistar_vram_select_w ) |
| 823 | 824 | { |
| 825 | williams_state *state = space->machine->driver_data<williams_state>(); | |
| 824 | 826 | /* low two bits are standard */ |
| 825 | 827 | williams_vram_select_w(space, offset, data); |
| 826 | 828 | |
| 827 | 829 | /* window enable from bit 2 (clips to 0x7400) */ |
| 828 | | |
| 830 | | |
| 829 | 831 | } |
| 830 | 832 | |
| 831 | 833 | |
| r10613 | r10614 | |
| 838 | 840 | |
| 839 | 841 | MACHINE_START( blaster ) |
| 840 | 842 | { |
| 843 | williams_state *state = machine->driver_data<williams_state>(); | |
| 841 | 844 | MACHINE_START_CALL(williams_common); |
| 842 | 845 | |
| 843 | 846 | /* banking is different for blaster */ |
| 844 | memory_configure_bank(machine, "bank1", 0, 1, | |
| 847 | memory_configure_bank(machine, "bank1", 0, 1, | |
| 845 | 848 | memory_configure_bank(machine, "bank1", 1, 16, machine->region("maincpu")->base() + 0x18000, 0x4000); |
| 846 | 849 | |
| 847 | memory_configure_bank(machine, "bank2", 0, 1, | |
| 850 | memory_configure_bank(machine, "bank2", 0, 1, | |
| 848 | 851 | memory_configure_bank(machine, "bank2", 1, 16, machine->region("maincpu")->base() + 0x10000, 0x0000); |
| 849 | 852 | |
| 850 | state_save_register_global(machine, blaster_bank); | |
| 853 | state_save_register_global(machine, state->blaster_bank); | |
| 851 | 854 | } |
| 852 | 855 | |
| 853 | 856 | |
| r10613 | r10614 | |
| 859 | 862 | |
| 860 | 863 | INLINE void update_blaster_banking(running_machine *machine) |
| 861 | 864 | { |
| 862 | memory_set_bank(machine, "bank1", vram_bank * (blaster_bank + 1)); | |
| 863 | memory_set_bank(machine, "bank2", vram_bank * (blaster_bank + 1)); | |
| 865 | williams_state *state = machine->driver_data<williams_state>(); | |
| 866 | memory_set_bank(machine, "bank1", state->vram_bank * (state->blaster_bank + 1)); | |
| 867 | memory_set_bank(machine, "bank2", state->vram_bank * (state->blaster_bank + 1)); | |
| 864 | 868 | } |
| 865 | 869 | |
| 866 | 870 | |
| 867 | 871 | WRITE8_HANDLER( blaster_vram_select_w ) |
| 868 | 872 | { |
| 873 | williams_state *state = space->machine->driver_data<williams_state>(); | |
| 869 | 874 | /* VRAM/ROM banking from bit 0 */ |
| 870 | vram_bank = data & 0x01; | |
| 875 | state->vram_bank = data & 0x01; | |
| 871 | 876 | update_blaster_banking(space->machine); |
| 872 | 877 | |
| 873 | 878 | /* cocktail flip from bit 1 */ |
| 874 | | |
| 879 | | |
| 875 | 880 | |
| 876 | 881 | /* window enable from bit 2 (clips to 0x9700) */ |
| 877 | | |
| 882 | | |
| 878 | 883 | } |
| 879 | 884 | |
| 880 | 885 | |
| 881 | 886 | WRITE8_HANDLER( blaster_bank_select_w ) |
| 882 | 887 | { |
| 883 | blaster_bank = data & 15; | |
| 888 | williams_state *state = space->machine->driver_data<williams_state>(); | |
| 889 | state->blaster_bank = data & 15; | |
| 884 | 890 | update_blaster_banking(space->machine); |
| 885 | 891 | } |
| 886 | 892 | |
| r10613 | r10614 | |
| 947 | 953 | |
| 948 | 954 | MACHINE_START( joust2 ) |
| 949 | 955 | { |
| 956 | williams_state *state = machine->driver_data<williams_state>(); | |
| 950 | 957 | MACHINE_START_CALL(williams2); |
| 951 | 958 | williams_cvsd_init(machine); |
| 952 | state_save_register_global(machine, joust2_current_sound_data); | |
| 959 | state_save_register_global(machine, state->joust2_current_sound_data); | |
| 953 | 960 | } |
| 954 | 961 | |
| 955 | 962 | |
| r10613 | r10614 | |
| 972 | 979 | |
| 973 | 980 | static WRITE8_DEVICE_HANDLER( joust2_pia_3_cb1_w ) |
| 974 | 981 | { |
| 982 | williams_state *state = device->machine->driver_data<williams_state>(); | |
| 975 | 983 | pia6821_device *pia_3 = device->machine->device<pia6821_device>("cvsdpia"); |
| 976 | 984 | |
| 977 | joust2_current_sound_data = (joust2_current_sound_data & ~0x100) | ((data << 8) & 0x100); | |
| 985 | state->joust2_current_sound_data = (state->joust2_current_sound_data & ~0x100) | ((data << 8) & 0x100); | |
| 978 | 986 | pia6821_cb1_w(pia_3, data); |
| 979 | 987 | } |
| 980 | 988 | |
| 981 | 989 | |
| 982 | 990 | static WRITE8_DEVICE_HANDLER( joust2_snd_cmd_w ) |
| 983 | 991 | { |
| 984 | joust2_current_sound_data = (joust2_current_sound_data & ~0xff) | (data & 0xff); | |
| 985 | williams_cvsd_data_w(device->machine, joust2_current_sound_data); | |
| 986 | device->machine->scheduler().synchronize(FUNC(joust2_deferred_snd_cmd_w), joust2_current_sound_data); | |
| 992 | williams_state *state = device->machine->driver_data<williams_state>(); | |
| 993 | state->joust2_current_sound_data = (state->joust2_current_sound_data & ~0xff) | (data & 0xff); | |
| 994 | williams_cvsd_data_w(device->machine, state->joust2_current_sound_data); | |
| 995 | device->machine->scheduler().synchronize(FUNC(joust2_deferred_snd_cmd_w), state->joust2_current_sound_data); | |
| 987 | 996 | } |
| r10613 | r10614 | |
|---|---|---|
| 3385 | 3385 | /* Namco System 10 */ |
| 3386 | 3386 | DRIVER( mrdrilr2 ) /* 2000.07 Mr Driller 2 (DR21 Ver.A) */ |
| 3387 | 3387 | DRIVER( mrdrlr2a ) /* 2000.?? Mr Driller 2 (DR22 Ver.A) */ |
| 3388 | DRIVER( ptblank3 ) | |
| 3388 | DRIVER( ptblank3 ) | |
| 3389 | 3389 | /* 2001.02 Photo Battole */ |
| 3390 | 3390 | /* 2001.02 Taiko no Tatsujin */ |
| 3391 | 3391 | /* 2001.03 Gahaha Ippatsudou */ |
| r10613 | r10614 | |
| 4928 | 4928 | DRIVER( ftspeed ) /* 2004.09 Faster than Speed */ |
| 4929 | 4929 | DRIVER( kov7sprt ) /* 2004.?? Knights of Valour - The Seven Sprits */ |
| 4930 | 4930 | DRIVER( vfurlong ) /* 2005.03 Net Select Keiba Victory Furlong */ |
| 4931 | | |
| 4931 | DRIVER( rumblef2 ) /* 2005.03 The Rumble Fish 2 */ | |
| 4932 | 4932 | DRIVER( ngbc ) /* 2005.07 NeoGeo Battle Colloseum */ |
| 4933 | 4933 | DRIVER( samsptk ) /* 2005.09 Samurai Spirits Tenkaichi Kenkakuden */ |
| 4934 | 4934 | DRIVER( kofxi ) /* 2005.10 The King of Fighters XI */ |
| r10613 | r10614 | |
| 8053 | 8053 | DRIVER( funcube2 ) /* (c) 2001 Namco */ |
| 8054 | 8054 | DRIVER( funcube4 ) /* (c) 2001 Namco */ |
| 8055 | 8055 | DRIVER( trophyh ) /* (c) 2002 Sammy USA Corporation */ |
| 8056 | DRIVER( reelquak ) /* (c) ???? <unknown> */ | |
| 8056 | 8057 | |
| 8057 | 8058 | /* SSV System (Seta, Sammy, Visco) games */ |
| 8058 | 8059 | DRIVER( srmp4 ) /* (c) 1993 Seta */ |
| r10613 | r10614 | |
| 8556 | 8557 | |
| 8557 | 8558 | /* Sigma B98 / Sammy Medal Games */ |
| 8558 | 8559 | DRIVER( gegege ) /* (c) 1997 Banpresto / Sigma */ |
| 8560 | DRIVER( sammymdl ) /* (c) 2000-2003 Sammy */ | |
| 8559 | 8561 | DRIVER( animalc ) /* (c) 2000 Sammy */ |
| 8560 | 8562 | DRIVER( itazuram ) /* (c) 2000 Sammy */ |
| 8561 | 8563 | DRIVER( pyenaget ) /* (c) 2000 Sammy */ |
| r10613 | r10614 | |
| 8685 | 8687 | DRIVER( kov2106 ) /* (c) 2000 */ |
| 8686 | 8688 | DRIVER( kov2103 ) /* (c) 2000 */ |
| 8687 | 8689 | DRIVER( kov2102 ) /* (c) 2000 */ |
| 8690 | DRIVER( kov2101 ) /* (c) 2000 */ | |
| 8688 | 8691 | DRIVER( kov2100 ) /* (c) 2000 */ |
| 8689 | 8692 | DRIVER( kov2p ) /* (c) 2000 */ |
| 8690 | 8693 | DRIVER( kov2p205 ) /* (c) 2000 */ |
| r10613 | r10614 | |
| 9431 | 9434 | DRIVER( poizone ) /* (c) 1990 Sisteme */ |
| 9432 | 9435 | DRIVER( ssfindo ) /* (c) 1999 Icarus */ |
| 9433 | 9436 | DRIVER( ppcar ) /* (c) 1999 Icarus */ |
| 9437 | DRIVER( tetfight) /* (c) 2001 Sego */ | |
| 9434 | 9438 | DRIVER( imolagp ) /* (c) 1981 Leante Games */ |
| 9435 | 9439 | DRIVER( dambustr ) /* (c) 1981 South West Research */ |
| 9436 | 9440 | DRIVER( dambustra ) /* (c) 1981 South West Research */ |
| r10613 | r10614 | |
| 9606 | 9610 | DRIVER( smoto20 ) /* (c) 1996 Subsino */ |
| 9607 | 9611 | DRIVER( smoto16 ) /* (c) 1996 Subsino */ |
| 9608 | 9612 | DRIVER( mtrain ) /* (c) 1996 Subsino */ |
| 9613 | DRIVER( mtrainnv ) /* (c) 1996 Subsino */ | |
| 9609 | 9614 | DRIVER( expcard ) /* (c) 1998 American Alpha */ |
| 9610 | 9615 | DRIVER( saklove ) /* (c) 1998 Subsino */ |
| 9611 | 9616 | DRIVER( bishjan ) /* (c) 1999 Subsino */ |
| r10613 | r10614 | |
| 9688 | 9693 | DRIVER( sloco93 ) /* 1993, Unknown */ |
| 9689 | 9694 | DRIVER( sloco93a ) /* 1993, Unknown */ |
| 9690 | 9695 | DRIVER( maverik ) /* 198?, Unknown */ |
| 9696 | DRIVER( brasil86 ) /* 1986, Unknown */ | |
| 9697 | DRIVER( brasil87 ) /* 1987, Unknown */ | |
| 9691 | 9698 | DRIVER( brasil89 ) /* 1989, Unknown */ |
| 9699 | DRIVER( brasil89a ) /* 1989, Unknown */ | |
| 9700 | DRIVER( brasil93 ) /* 1993, Unknown */ | |
| 9692 | 9701 | DRIVER( poker91 ) /* 1991, Unknown */ |
| 9693 | 9702 | DRIVER( genie ) /* (c) 198? Video Fun Games Ltd. */ |
| 9694 | 9703 | DRIVER( silverga ) /* 1983, Unknown */ |
| r10613 | r10614 | |
| 10749 | 10758 | DRIVER( freedom ) |
| 10750 | 10759 | DRIVER( matahari ) |
| 10751 | 10760 | DRIVER( nightrdr ) |
| 10761 | DRIVER( nightr20 ) | |
| 10752 | 10762 | DRIVER( pwerplay ) |
| 10753 | 10763 | DRIVER( stk_sprs ) |
| 10754 | 10764 | |
| r10613 | r10614 | |
| 10763 | 10773 | DRIVER( cybrnaut ) |
| 10764 | 10774 | DRIVER( dollyptn ) |
| 10765 | 10775 | DRIVER( eballdlx ) |
| 10776 | DRIVER( eballd14 ) | |
| 10766 | 10777 | DRIVER( elektra ) |
| 10767 | 10778 | DRIVER( embryon ) |
| 10768 | 10779 | DRIVER( fathom ) |
| r10613 | r10614 | |
| 10953 | 10964 | DRIVER( tomy_h30 ) |
| 10954 | 10965 | DRIVER( wwfr_106 ) |
| 10955 | 10966 | DRIVER( wwfr_103 ) |
| 10956 | DRIVER( titanic ) | |
| 10957 | DRIVER( monopred ) | |
| 10958 | DRIVER( wackadoo ) | |
| 10959 | 10967 | |
| 10960 | 10968 | |
| 10961 | 10969 | // de_3b.c |
| r10613 | r10614 | |
| 10980 | 10988 | DRIVER( frankstg ) |
| 10981 | 10989 | DRIVER( mav_402 ) |
| 10982 | 10990 | DRIVER( mav_401 ) |
| 10991 | DRIVER( mav_400 ) | |
| 10983 | 10992 | DRIVER( mav_100 ) |
| 10984 | 10993 | DRIVER( detest ) |
| 10994 | DRIVER( ctcheese ) | |
| 10985 | 10995 | |
| 10986 | 10996 | |
| 10987 | 10997 | // flicker.c |
| r10613 | r10614 | |
| 11574 | 11584 | |
| 11575 | 11585 | // whitestar.c |
| 11576 | 11586 | DRIVER( apollo13 ) |
| 11587 | DRIVER( aust301 ) | |
| 11588 | DRIVER( aust300 ) | |
| 11589 | DRIVER( aust201 ) | |
| 11577 | 11590 | DRIVER( austin ) |
| 11578 | 11591 | DRIVER( austnew ) |
| 11579 | 11592 | DRIVER( austinf ) |
| r10613 | r10614 | |
| 11608 | 11621 | DRIVER( id4 ) |
| 11609 | 11622 | DRIVER( lostspc ) |
| 11610 | 11623 | DRIVER( monopolp ) |
| 11611 | DRIVER( monopole ) | |
| 11624 | DRIVER( monop303 ) | |
| 11625 | DRIVER( monop301 ) | |
| 11626 | DRIVER( monop251 ) | |
| 11627 | DRIVER( monop233 ) | |
| 11612 | 11628 | DRIVER( monopolf ) |
| 11613 | 11629 | DRIVER( monopolg ) |
| 11614 | 11630 | DRIVER( monopoli ) |
| r10613 | r10614 | |
| 11616 | 11632 | DRIVER( mononew ) |
| 11617 | 11633 | DRIVER( nfl ) |
| 11618 | 11634 | DRIVER( playboys ) |
| 11635 | DRIVER( playboys_303 ) | |
| 11636 | DRIVER( playboys_300 ) | |
| 11619 | 11637 | DRIVER( playnew ) |
| 11620 | 11638 | DRIVER( playboyf ) |
| 11639 | DRIVER( playboyf_303 ) | |
| 11640 | DRIVER( playboyf_300 ) | |
| 11621 | 11641 | DRIVER( playboyg ) |
| 11642 | DRIVER( playboyg_303 ) | |
| 11643 | DRIVER( playboyg_300 ) | |
| 11622 | 11644 | DRIVER( playboyi ) |
| 11645 | DRIVER( playboyi_303 ) | |
| 11646 | DRIVER( playboyi_300 ) | |
| 11623 | 11647 | DRIVER( playboyl ) |
| 11648 | DRIVER( playboyl_303 ) | |
| 11649 | DRIVER( playboyl_300 ) | |
| 11624 | 11650 | DRIVER( rctycn ) |
| 11651 | DRIVER( rctycn_701 ) | |
| 11652 | DRIVER( rctycn_400 ) | |
| 11625 | 11653 | DRIVER( rctnew ) |
| 11626 | 11654 | DRIVER( rctycng ) |
| 11655 | DRIVER( rctycng_701 ) | |
| 11656 | DRIVER( rctycng_400 ) | |
| 11627 | 11657 | DRIVER( rctycnf ) |
| 11658 | DRIVER( rctycnf_701 ) | |
| 11659 | DRIVER( rctycnf_400 ) | |
| 11628 | 11660 | DRIVER( rctycni ) |
| 11661 | DRIVER( rctycni_701 ) | |
| 11662 | DRIVER( rctycni_400 ) | |
| 11629 | 11663 | DRIVER( rctycnl ) |
| 11664 | DRIVER( rctycnl_701 ) | |
| 11665 | DRIVER( rctycnl_400 ) | |
| 11630 | 11666 | DRIVER( shrkysht ) |
| 11667 | DRIVER( shrky_207 ) | |
| 11631 | 11668 | DRIVER( shrknew ) |
| 11632 | DRIVER( shrky_gr ) | |
| 11633 | DRIVER( shrky_fr ) | |
| 11634 | DRIVER( shrky_it ) | |
| 11669 | DRIVER( shrkygr ) | |
| 11670 | DRIVER( shrkygr_207 ) | |
| 11671 | DRIVER( shrkyfr ) | |
| 11672 | DRIVER( shrkyfr_207 ) | |
| 11673 | DRIVER( shrkyit ) | |
| 11674 | DRIVER( shrkyit_207 ) | |
| 11635 | 11675 | DRIVER( sprk_103 ) |
| 11636 | 11676 | DRIVER( sprk_090 ) |
| 11637 | 11677 | DRIVER( spacejam ) |
| r10613 | r10614 | |
| 11649 | 11689 | DRIVER( strxt_it ) |
| 11650 | 11690 | DRIVER( strxt_sp ) |
| 11651 | 11691 | DRIVER( term3 ) |
| 11692 | DRIVER( term3_205 ) | |
| 11652 | 11693 | DRIVER( t3new ) |
| 11653 | 11694 | DRIVER( term3g ) |
| 11654 | 11695 | DRIVER( term3l ) |
| 11696 | DRIVER( term3l_205 ) | |
| 11655 | 11697 | DRIVER( term3f ) |
| 11698 | DRIVER( term3f_205 ) | |
| 11656 | 11699 | DRIVER( term3i ) |
| 11700 | DRIVER( term3i_205 ) | |
| 11657 | 11701 | DRIVER( jplstw22 ) |
| 11658 | 11702 | DRIVER( jplstw20 ) |
| 11659 | 11703 | DRIVER( simpprty ) |
| r10613 | r10614 | |
| 11668 | 11712 | DRIVER( twst_404 ) |
| 11669 | 11713 | DRIVER( twst_300 ) |
| 11670 | 11714 | DRIVER( viprsega ) |
| 11715 | DRIVER( ctchzdlx ) | |
| 11716 | DRIVER( titanic ) | |
| 11717 | DRIVER( monopred ) | |
| 11718 | DRIVER( wackadoo ) | |
| 11671 | 11719 | |
| 11672 | 11720 | |
| 11673 | 11721 | // white_mod.c |
| 11674 | 11722 | DRIVER( elvisp ) |
| 11723 | DRIVER( elvisp4 ) | |
| 11724 | DRIVER( elvisp303 ) | |
| 11725 | DRIVER( elvisp302 ) | |
| 11675 | 11726 | DRIVER( elvisl ) |
| 11727 | DRIVER( elvisl4 ) | |
| 11728 | DRIVER( elvisl303 ) | |
| 11729 | DRIVER( elvisl302 ) | |
| 11676 | 11730 | DRIVER( elvisg ) |
| 11731 | DRIVER( elvisg4 ) | |
| 11732 | DRIVER( elvisg303 ) | |
| 11733 | DRIVER( elvisg302 ) | |
| 11677 | 11734 | DRIVER( elvisf ) |
| 11735 | DRIVER( elvisf4 ) | |
| 11736 | DRIVER( elvisf303 ) | |
| 11737 | DRIVER( elvisf302 ) | |
| 11678 | 11738 | DRIVER( elvisi ) |
| 11739 | DRIVER( elvisi4 ) | |
| 11740 | DRIVER( elvisi303 ) | |
| 11741 | DRIVER( elvisi302 ) | |
| 11679 | 11742 | DRIVER( gprix ) |
| 11680 | 11743 | DRIVER( gprixg ) |
| 11681 | 11744 | DRIVER( gprixl ) |
| r10613 | r10614 | |
| 11684 | 11747 | DRIVER( nascar ) |
| 11685 | 11748 | DRIVER( nascarl ) |
| 11686 | 11749 | DRIVER( ripleys ) |
| 11750 | DRIVER( rip310 ) | |
| 11751 | DRIVER( rip302 ) | |
| 11752 | DRIVER( rip300 ) | |
| 11687 | 11753 | DRIVER( ripleysf ) |
| 11754 | DRIVER( ripf310 ) | |
| 11755 | DRIVER( ripf302 ) | |
| 11756 | DRIVER( ripf300 ) | |
| 11688 | 11757 | DRIVER( ripleysg ) |
| 11758 | DRIVER( ripg310 ) | |
| 11759 | DRIVER( ripg302 ) | |
| 11760 | DRIVER( ripg300 ) | |
| 11689 | 11761 | DRIVER( ripleysi ) |
| 11762 | DRIVER( ripi310 ) | |
| 11763 | DRIVER( ripi302 ) | |
| 11764 | DRIVER( ripi300 ) | |
| 11690 | 11765 | DRIVER( ripleysl ) |
| 11766 | DRIVER( ripl310 ) | |
| 11767 | DRIVER( ripl302 ) | |
| 11768 | DRIVER( ripl300 ) | |
| 11691 | 11769 | DRIVER( lotr ) |
| 11770 | DRIVER( lotr9 ) | |
| 11771 | DRIVER( lotr8 ) | |
| 11772 | DRIVER( lotr7 ) | |
| 11773 | DRIVER( lotr401 ) | |
| 11692 | 11774 | DRIVER( lotr_le ) |
| 11693 | 11775 | DRIVER( lotr_sp ) |
| 11776 | DRIVER( lotr_sp9 ) | |
| 11777 | DRIVER( lotr_sp8 ) | |
| 11778 | DRIVER( lotr_sp7 ) | |
| 11779 | DRIVER( lotr_sp401 ) | |
| 11694 | 11780 | DRIVER( lotr_gr ) |
| 11781 | DRIVER( lotr_gr9 ) | |
| 11782 | DRIVER( lotr_gr8 ) | |
| 11783 | DRIVER( lotr_gr7 ) | |
| 11784 | DRIVER( lotr_gr401 ) | |
| 11695 | 11785 | DRIVER( lotr_fr ) |
| 11786 | DRIVER( lotr_fr9 ) | |
| 11787 | DRIVER( lotr_fr8 ) | |
| 11788 | DRIVER( lotr_fr7 ) | |
| 11789 | DRIVER( lotr_fr401 ) | |
| 11696 | 11790 | DRIVER( lotr_it ) |
| 11791 | DRIVER( lotr_it9 ) | |
| 11792 | DRIVER( lotr_it8 ) | |
| 11793 | DRIVER( lotr_it7 ) | |
| 11794 | DRIVER( lotr_it401 ) | |
| 11697 | 11795 | DRIVER( sopranos ) |
| 11698 | 11796 | DRIVER( soprano3 ) |
| 11699 | 11797 | DRIVER( sopranog ) |
| r10613 | r10614 | |
|---|---|---|
| 1 | #define VRAM_MAX 2 | |
| 2 | ||
| 3 | #define SCANLINE_MIN 0 | |
| 4 | #define SCANLINE_MAX 512 | |
| 5 | ||
| 6 | ||
| 7 | class nbmj9195_state : public driver_device | |
| 8 | { | |
| 9 | public: | |
| 10 | nbmj9195_state(running_machine &machine, const driver_device_config_base &config) | |
| 11 | : driver_device(machine, config) { } | |
| 12 | ||
| 13 | int inputport; | |
| 14 | int dipswbitsel; | |
| 15 | int outcoin_flag; | |
| 16 | int mscoutm_inputport; | |
| 17 | UINT8 *nvram; | |
| 18 | size_t nvram_size; | |
| 19 | UINT8 pio_dir[5 * 2]; | |
| 20 | UINT8 pio_latch[5 * 2]; | |
| 21 | int scrollx[VRAM_MAX]; | |
| 22 | int scrolly[VRAM_MAX]; | |
| 23 | int scrollx_raster[VRAM_MAX][SCANLINE_MAX]; | |
| 24 | int scanline[VRAM_MAX]; | |
| 25 | int blitter_destx[VRAM_MAX]; | |
| 26 | int blitter_desty[VRAM_MAX]; | |
| 27 | int blitter_sizex[VRAM_MAX]; | |
| 28 | int blitter_sizey[VRAM_MAX]; | |
| 29 | int blitter_src_addr[VRAM_MAX]; | |
| 30 | int blitter_direction_x[VRAM_MAX]; | |
| 31 | int blitter_direction_y[VRAM_MAX]; | |
| 32 | int dispflag[VRAM_MAX]; | |
| 33 | int flipscreen[VRAM_MAX]; | |
| 34 | int clutmode[VRAM_MAX]; | |
| 35 | int transparency[VRAM_MAX]; | |
| 36 | int clutsel; | |
| 37 | int screen_refresh; | |
| 38 | int gfxflag2; | |
| 39 | int gfxdraw_mode; | |
| 40 | int nb19010_busyctr; | |
| 41 | int nb19010_busyflag; | |
| 42 | bitmap_t *tmpbitmap[VRAM_MAX]; | |
| 43 | UINT16 *videoram[VRAM_MAX]; | |
| 44 | UINT16 *videoworkram[VRAM_MAX]; | |
| 45 | UINT8 *palette; | |
| 46 | UINT8 *nb22090_palette; | |
| 47 | UINT8 *clut[VRAM_MAX]; | |
| 48 | int flipscreen_old[VRAM_MAX]; | |
| 49 | }; | |
| 50 | ||
| 51 | ||
| 1 | 52 | /*----------- defined in video/nbmj9195.c -----------*/ |
| 2 | 53 | |
| 3 | 54 | SCREEN_UPDATE( nbmj9195 ); |
| r10613 | r10614 | |
| 17 | 68 | WRITE8_HANDLER( nbmj9195_clut_0_w ); |
| 18 | 69 | WRITE8_HANDLER( nbmj9195_clut_1_w ); |
| 19 | 70 | |
| 20 | void nbmj9195_clutsel_w(int data); | |
| 21 | void nbmj9195_gfxflag2_w(int data); | |
| 71 | void nbmj9195_clutsel_w(address_space *space, int data); | |
| 72 | void nbmj9195_gfxflag2_w(address_space *space, int data); |
| r10613 | r10614 | |
|---|---|---|
| 1 | #define VRAM_MAX 3 | |
| 2 | ||
| 3 | class niyanpai_state : public driver_device | |
| 4 | { | |
| 5 | public: | |
| 6 | niyanpai_state(running_machine &machine, const driver_device_config_base &config) | |
| 7 | : driver_device(machine, config) { } | |
| 8 | ||
| 9 | int musobana_inputport; | |
| 10 | int musobana_outcoin_flag; | |
| 11 | UINT8 pio_dir[5]; | |
| 12 | UINT8 pio_latch[5]; | |
| 13 | int scrollx[VRAM_MAX]; | |
| 14 | int scrolly[VRAM_MAX]; | |
| 15 | int blitter_destx[VRAM_MAX]; | |
| 16 | int blitter_desty[VRAM_MAX]; | |
| 17 | int blitter_sizex[VRAM_MAX]; | |
| 18 | int blitter_sizey[VRAM_MAX]; | |
| 19 | int blitter_src_addr[VRAM_MAX]; | |
| 20 | int blitter_direction_x[VRAM_MAX]; | |
| 21 | int blitter_direction_y[VRAM_MAX]; | |
| 22 | int dispflag[VRAM_MAX]; | |
| 23 | int flipscreen[VRAM_MAX]; | |
| 24 | int clutmode[VRAM_MAX]; | |
| 25 | int transparency[VRAM_MAX]; | |
| 26 | int clutsel[VRAM_MAX]; | |
| 27 | int screen_refresh; | |
| 28 | int nb19010_busyctr; | |
| 29 | int nb19010_busyflag; | |
| 30 | bitmap_t *tmpbitmap[VRAM_MAX]; | |
| 31 | UINT16 *videoram[VRAM_MAX]; | |
| 32 | UINT16 *videoworkram[VRAM_MAX]; | |
| 33 | UINT16 *palette; | |
| 34 | UINT8 *clut[VRAM_MAX]; | |
| 35 | int flipscreen_old[VRAM_MAX]; | |
| 36 | }; | |
| 37 | ||
| 38 | ||
| 1 | 39 | /*----------- defined in video/niyanpai.c -----------*/ |
| 2 | 40 | |
| 3 | 41 | SCREEN_UPDATE( niyanpai ); |
| r10613 | r10614 | |
|---|---|---|
| 8 | 8 | optional_shared_ptr<UINT16> m_nvram; |
| 9 | 9 | |
| 10 | 10 | UINT16 *vregs; |
| 11 | int yoffset; | |
| 11 | int xoffset, yoffset; | |
| 12 | 12 | int keyboard_row; |
| 13 | 13 | |
| 14 | 14 | UINT16 *spriteram; |
| r10613 | r10614 | |
| 32 | 32 | WRITE16_HANDLER( seta2_vregs_w ); |
| 33 | 33 | |
| 34 | 34 | VIDEO_START( seta2 ); |
| 35 | VIDEO_START( seta2_offset ); | |
| 35 | VIDEO_START( seta2_xoffset ); | |
| 36 | VIDEO_START( seta2_yoffset ); | |
| 36 | 37 | SCREEN_UPDATE( seta2 ); |
| 37 | 38 | SCREEN_EOF( seta2 ); |
| 38 | ||
| 39 |
| r10613 | r10614 | |
|---|---|---|
| 9 | 9 | UINT8 *spriteram; |
| 10 | 10 | UINT8 *videoram; |
| 11 | 11 | UINT8 *textram; |
| 12 | int bFlicker; | |
| 12 | 13 | }; |
| 13 | 14 | |
| 14 | 15 |
| r10613 | r10614 | |
|---|---|---|
| 104 | 104 | public: |
| 105 | 105 | md_boot_state(running_machine &machine, const driver_device_config_base &config) |
| 106 | 106 | : md_base_state(machine, config) { } |
| 107 | ||
| 108 | // bootleg specific | |
| 107 | ||
| 108 | // bootleg specific | |
| 109 | 109 | int aladmdb_mcu_port; |
| 110 | 110 | }; |
| 111 | 111 | |
| r10613 | r10614 | |
| 114 | 114 | public: |
| 115 | 115 | segac2_state(running_machine &machine, const driver_device_config_base &config) |
| 116 | 116 | : md_base_state(machine, config) { } |
| 117 | ||
| 117 | ||
| 118 | 118 | // for Print Club only |
| 119 | 119 | int cam_data; |
| 120 | ||
| 120 | ||
| 121 | 121 | int segac2_enable_display; |
| 122 | ||
| 122 | ||
| 123 | 123 | UINT16* paletteram; |
| 124 | ||
| 124 | ||
| 125 | 125 | /* internal states */ |
| 126 | 126 | UINT8 misc_io_data[0x10]; /* holds values written to the I/O chip */ |
| 127 | ||
| 127 | ||
| 128 | 128 | /* protection-related tracking */ |
| 129 | 129 | int (*prot_func)(int in); /* emulation of protection chip */ |
| 130 | 130 | UINT8 prot_write_buf; /* remembers what was written */ |
| 131 | 131 | UINT8 prot_read_buf; /* remembers what was returned */ |
| 132 | ||
| 132 | ||
| 133 | 133 | /* palette-related variables */ |
| 134 | 134 | UINT8 segac2_alt_palette_mode; |
| 135 | 135 | UINT8 palbank; |
| 136 | 136 | UINT8 bg_palbase; |
| 137 | 137 | UINT8 sp_palbase; |
| 138 | ||
| 138 | ||
| 139 | 139 | /* sound-related variables */ |
| 140 | 140 | UINT8 sound_banks; /* number of sound banks */ |
| 141 | 141 | }; |
| r10613 | r10614 | |
| 145 | 145 | public: |
| 146 | 146 | mplay_state(running_machine &machine, const driver_device_config_base &config) |
| 147 | 147 | : md_base_state(machine, config) { } |
| 148 | ||
| 148 | ||
| 149 | 149 | UINT32 bios_mode; // determines whether ROM banks or Game data |
| 150 | 150 | // is to read from 0x8000-0xffff |
| 151 | ||
| 151 | ||
| 152 | 152 | UINT32 bios_bank; // ROM bank selection |
| 153 | 153 | UINT16 game_banksel; // Game bank selection |
| 154 | 154 | UINT32 readpos; // serial bank selection position (9-bit) |
| 155 | 155 | UINT32 mp_bios_bank_addr; |
| 156 | ||
| 156 | ||
| 157 | 157 | UINT32 bios_width; // determines the way the game info ROM is read |
| 158 | 158 | UINT8 bios_ctrl[6]; |
| 159 | 159 | UINT8 bios_6600; |
| 160 | 160 | UINT8 bios_6403; |
| 161 | 161 | UINT8 bios_6404; |
| 162 | ||
| 162 | ||
| 163 | 163 | UINT16 *genesis_io_ram; |
| 164 | 164 | UINT8* ic3_ram; |
| 165 | 165 | UINT8* ic37_ram; |
| r10613 | r10614 | |
| 171 | 171 | public: |
| 172 | 172 | mtech_state(running_machine &machine, const driver_device_config_base &config) |
| 173 | 173 | : md_base_state(machine, config) { } |
| 174 | ||
| 174 | ||
| 175 | 175 | UINT8 mt_cart_select_reg; |
| 176 | 176 | UINT32 bios_port_ctrl; |
| 177 | 177 | int current_game_is_sms; // is the current game SMS based (running on genesis z80, in VDP compatibility mode) |
| 178 | 178 | UINT32 bios_ctrl_inputs; |
| 179 | 179 | UINT8 bios_ctrl[6]; |
| 180 | ||
| 180 | ||
| 181 | 181 | int mt_bank_addr; |
| 182 | ||
| 182 | ||
| 183 | 183 | int cart_is_genesis[8]; |
| 184 | ||
| 184 | ||
| 185 | 185 | /* Megatech BIOS specific */ |
| 186 | 186 | UINT8* megatech_banked_ram; |
| 187 | 187 | }; |
| r10613 | r10614 | |
| 190 | 190 | struct _megadriv_cart |
| 191 | 191 | { |
| 192 | 192 | int type; |
| 193 | ||
| 193 | ||
| 194 | 194 | // SRAM related |
| 195 | 195 | UINT16 *sram; |
| 196 | 196 | int last_loaded_image_length; |
| r10613 | r10614 | |
| 198 | 198 | int sram_active, sram_readonly; |
| 199 | 199 | int sram_handlers_installed; |
| 200 | 200 | int sram_detected; |
| 201 | ||
| 201 | ||
| 202 | 202 | // EEPROM related |
| 203 | 203 | int has_serial_eeprom; |
| 204 | ||
| 204 | ||
| 205 | 205 | // I2C related |
| 206 | 206 | UINT8 i2c_mem, i2c_clk; |
| 207 | ||
| 207 | ||
| 208 | 208 | // mapper related (mostly for pirate carts) |
| 209 | 209 | UINT16 squirrel_king_extra; |
| 210 | 210 | UINT16 lion2_prot1_data, lion2_prot2_data; |
| r10613 | r10614 | |
| 218 | 218 | public: |
| 219 | 219 | md_cons_state(running_machine &machine, const driver_device_config_base &config) |
| 220 | 220 | : md_base_state(machine, config) { } |
| 221 | ||
| 221 | ||
| 222 | 222 | emu_timer *mess_io_timeout[3]; |
| 223 | 223 | int mess_io_stage[3]; |
| 224 | UINT8 jcart_io_data[2]; | |
| 225 | ||
| 224 | UINT8 jcart_io_data[2]; | |
| 225 | ||
| 226 | 226 | megadriv_cart md_cart; |
| 227 | 227 | }; |
| 228 | 228 | |
| r10613 | r10614 | |
| 231 | 231 | public: |
| 232 | 232 | pico_state(running_machine &machine, const driver_device_config_base &config) |
| 233 | 233 | : md_cons_state(machine, config) { } |
| 234 | ||
| 234 | ||
| 235 | 235 | UINT8 page_register; |
| 236 | 236 | }; |
| 237 | 237 |
| r10613 | r10614 | |
|---|---|---|
| 5 | 5 | : driver_device(machine, config) { } |
| 6 | 6 | |
| 7 | 7 | UINT16 *videoram; |
| 8 | const UINT16 *mpProtData; | |
| 9 | UINT8 mAmazonProtCmd; | |
| 10 | UINT8 mAmazonProtReg[6]; | |
| 11 | UINT16 *amazon_videoram; | |
| 12 | UINT16 xscroll; | |
| 13 | UINT16 yscroll; | |
| 14 | tilemap_t *background; | |
| 15 | tilemap_t *foreground; | |
| 8 | 16 | }; |
| 9 | 17 | |
| 10 | 18 | |
| 11 | 19 | /*----------- defined in video/terracre.c -----------*/ |
| 12 | 20 | |
| 13 | extern UINT16 *amazon_videoram; | |
| 14 | ||
| 15 | 21 | PALETTE_INIT( amazon ); |
| 16 | 22 | WRITE16_HANDLER( amazon_background_w ); |
| 17 | 23 | WRITE16_HANDLER( amazon_foreground_w ); |
| r10613 | r10614 | |
|---|---|---|
| 1 | class punchout_state : public driver_device | |
| 2 | { | |
| 3 | public: | |
| 4 | punchout_state(running_machine &machine, const driver_device_config_base &config) | |
| 5 | : driver_device(machine, config) { } | |
| 6 | ||
| 7 | int rp5c01_mode_sel; | |
| 8 | int rp5c01_mem[16*4]; | |
| 9 | UINT8 *bg_top_videoram; | |
| 10 | UINT8 *bg_bot_videoram; | |
| 11 | UINT8 *armwrest_fg_videoram; | |
| 12 | UINT8 *spr1_videoram; | |
| 13 | UINT8 *spr2_videoram; | |
| 14 | UINT8 *spr1_ctrlram; | |
| 15 | UINT8 *spr2_ctrlram; | |
| 16 | UINT8 *palettebank; | |
| 17 | tilemap_t *bg_top_tilemap; | |
| 18 | tilemap_t *bg_bot_tilemap; | |
| 19 | tilemap_t *fg_tilemap; | |
| 20 | tilemap_t *spr1_tilemap; | |
| 21 | tilemap_t *spr1_tilemap_flipx; | |
| 22 | tilemap_t *spr2_tilemap; | |
| 23 | int palette_reverse_top; | |
| 24 | int palette_reverse_bot; | |
| 25 | }; | |
| 26 | ||
| 27 | ||
| 1 | 28 | /*----------- defined in video/punchout.c -----------*/ |
| 2 | 29 | |
| 3 | extern UINT8 *punchout_bg_top_videoram; | |
| 4 | extern UINT8 *punchout_bg_bot_videoram; | |
| 5 | extern UINT8 *armwrest_fg_videoram; | |
| 6 | extern UINT8 *punchout_spr1_videoram; | |
| 7 | extern UINT8 *punchout_spr2_videoram; | |
| 8 | extern UINT8 *punchout_spr1_ctrlram; | |
| 9 | extern UINT8 *punchout_spr2_ctrlram; | |
| 10 | extern UINT8 *punchout_palettebank; | |
| 11 | ||
| 12 | 30 | WRITE8_HANDLER( punchout_bg_top_videoram_w ); |
| 13 | 31 | WRITE8_HANDLER( punchout_bg_bot_videoram_w ); |
| 14 | 32 | WRITE8_HANDLER( armwrest_fg_videoram_w ); |
| r10613 | r10614 | |
|---|---|---|
| 5 | 5 | : driver_device(machine, config) { } |
| 6 | 6 | |
| 7 | 7 | UINT16 *videoram; |
| 8 | tilemap_t *bg_tilemap; | |
| 8 | 9 | }; |
| 9 | 10 | |
| 10 | 11 |
| r10613 | r10614 | |
|---|---|---|
| 180 | 180 | UINT8 dma_latch; |
| 181 | 181 | UINT8 flip; |
| 182 | 182 | |
| 183 | /* radarscp_step */ | |
| 184 | double cv1; | |
| 185 | double cv2; | |
| 186 | double vg1; | |
| 187 | double vg2; | |
| 188 | double vg3; | |
| 189 | double cv3; | |
| 190 | double cv4; | |
| 191 | int pixelcnt; | |
| 192 | ||
| 193 | /* radarscp_scanline */ | |
| 194 | int counter; | |
| 195 | ||
| 183 | 196 | /* reverse address lookup map - hunchbkd */ |
| 184 | 197 | INT16 rev_map[0x200]; |
| 185 | 198 | }; |
| r10613 | r10614 | |
|---|---|---|
| 1 | class wiping_state : public driver_device | |
| 2 | { | |
| 3 | public: | |
| 4 | wiping_state(running_machine &machine, const driver_device_config_base &config) | |
| 5 | : driver_device(machine, config) { } | |
| 6 | ||
| 7 | UINT8 *sharedram1; | |
| 8 | UINT8 *sharedram2; | |
| 9 | UINT8 *videoram; | |
| 10 | UINT8 *colorram; | |
| 11 | int flipscreen; | |
| 12 | UINT8 *soundregs; | |
| 13 | }; | |
| 14 | ||
| 15 | ||
| 1 | 16 | /*----------- defined in video/wiping.c -----------*/ |
| 2 | 17 | |
| 3 | extern UINT8 *wiping_videoram; | |
| 4 | extern UINT8 *wiping_colorram; | |
| 5 | ||
| 6 | 18 | WRITE8_HANDLER( wiping_flipscreen_w ); |
| 7 | 19 | PALETTE_INIT( wiping ); |
| 8 | 20 | SCREEN_UPDATE( wiping ); |
| r10613 | r10614 | |
|---|---|---|
| 1 | class popeye_state : public driver_device | |
| 2 | { | |
| 3 | public: | |
| 4 | popeye_state(running_machine &machine, const driver_device_config_base &config) | |
| 5 | : driver_device(machine, config) { } | |
| 6 | ||
| 7 | UINT8 prot0; | |
| 8 | UINT8 prot1; | |
| 9 | UINT8 prot_shift; | |
| 10 | int dswbit; | |
| 11 | UINT8 *videoram; | |
| 12 | UINT8 *colorram; | |
| 13 | UINT8 *background_pos; | |
| 14 | UINT8 *palettebank; | |
| 15 | UINT8 *bitmapram; | |
| 16 | bitmap_t *tmpbitmap2; | |
| 17 | UINT8 invertmask; | |
| 18 | UINT8 bitmap_type; | |
| 19 | tilemap_t *fg_tilemap; | |
| 20 | UINT8 lastflip; | |
| 21 | }; | |
| 22 | ||
| 23 | ||
| 1 | 24 | /*----------- defined in video/popeye.c -----------*/ |
| 2 | 25 | |
| 3 | extern UINT8 *popeye_videoram; | |
| 4 | extern UINT8 *popeye_colorram; | |
| 5 | extern UINT8 *popeye_background_pos; | |
| 6 | extern UINT8 *popeye_palettebank; | |
| 7 | ||
| 8 | 26 | WRITE8_HANDLER( popeye_videoram_w ); |
| 9 | 27 | WRITE8_HANDLER( popeye_colorram_w ); |
| 10 | 28 | WRITE8_HANDLER( popeye_bitmap_w ); |
| r10613 | r10614 | |
|---|---|---|
| 93 | 93 | void pgm_kovshp_decrypt(running_machine *machine); |
| 94 | 94 | void pgm_killbldp_decrypt(running_machine *machine); |
| 95 | 95 | void pgm_svg_decrypt(running_machine *machine); |
| 96 | void pgm_dw2001_decrypt(running_machine *machine); | |
| 97 | 96 | void pgm_ket_decrypt(running_machine *machine); |
| 98 | 97 | void pgm_espgal_decrypt(running_machine *machine); |
| 99 | 98 |
| r10613 | r10614 | |
|---|---|---|
| 1 | class pastelg_state : public driver_device | |
| 2 | { | |
| 3 | public: | |
| 4 | pastelg_state(running_machine &machine, const driver_device_config_base &config) | |
| 5 | : driver_device(machine, config) { } | |
| 6 | ||
| 7 | UINT8 mux_data; | |
| 8 | int blitter_destx; | |
| 9 | int blitter_desty; | |
| 10 | int blitter_sizex; | |
| 11 | int blitter_sizey; | |
| 12 | int blitter_src_addr; | |
| 13 | int gfxrom; | |
| 14 | int dispflag; | |
| 15 | int flipscreen; | |
| 16 | int blitter_direction_x; | |
| 17 | int blitter_direction_y; | |
| 18 | int palbank; | |
| 19 | UINT8 *videoram; | |
| 20 | UINT8 *clut; | |
| 21 | int flipscreen_old; | |
| 22 | }; | |
| 23 | ||
| 24 | ||
| 1 | 25 | /*----------- defined in video/pastelg.c -----------*/ |
| 2 | 26 | |
| 3 | 27 | PALETTE_INIT( pastelg ); |
| r10613 | r10614 | |
| 11 | 35 | WRITE8_HANDLER( pastelg_blitter_w ); |
| 12 | 36 | READ8_HANDLER( threeds_rom_readback_r ); |
| 13 | 37 | |
| 14 | int pastelg_blitter_src_addr_r( | |
| 38 | int pastelg_blitter_src_addr_r(a |
| r10613 | r10614 | |
|---|---|---|
| 30 | 30 | UINT16 * sloop_base; |
| 31 | 31 | |
| 32 | 32 | device_t * rle; |
| 33 | UINT32 last_accesses[8]; | |
| 33 | 34 | }; |
| 34 | 35 | |
| 35 | 36 |
| r10613 | r10614 | |
|---|---|---|
| 7 | 7 | extern int warpwarp_ball_on; |
| 8 | 8 | extern int warpwarp_ball_h, warpwarp_ball_v; |
| 9 | 9 | extern int warpwarp_ball_pen, warpwarp_ball_sizex, warpwarp_ball_sizey; |
| 10 | extern int geebee_handleoverlay; | |
| 11 | 10 | |
| 12 | 11 | PALETTE_INIT( geebee ); |
| 13 | 12 | PALETTE_INIT( navarone ); |
| r10613 | r10614 | |
|---|---|---|
| 24 | 24 | #define SPACEFB_INT_TRIGGER_COUNT_2 (0x0f0) |
| 25 | 25 | |
| 26 | 26 | |
| 27 | class spacefb_state : public driver_device | |
| 28 | { | |
| 29 | public: | |
| 30 | spacefb_state(running_machine &machine, const driver_device_config_base &config) | |
| 31 | : driver_device(machine, config) { } | |
| 32 | ||
| 33 | UINT8 sound_latch; | |
| 34 | emu_timer *interrupt_timer; | |
| 35 | UINT8 *videoram; | |
| 36 | size_t videoram_size; | |
| 37 | UINT8 *object_present_map; | |
| 38 | UINT8 port_0; | |
| 39 | UINT8 port_2; | |
| 40 | UINT32 star_shift_reg; | |
| 41 | double color_weights_rg[3]; | |
| 42 | double color_weights_b[2]; | |
| 43 | }; | |
| 44 | ||
| 45 | ||
| 27 | 46 | /*----------- defined in audio/spacefb.c -----------*/ |
| 28 | 47 | |
| 29 | 48 | MACHINE_CONFIG_EXTERN( spacefb_audio ); |
| r10613 | r10614 | |
| 36 | 55 | |
| 37 | 56 | /*----------- defined in video/spacefb.c -----------*/ |
| 38 | 57 | |
| 39 | extern UINT8 *spacefb_videoram; | |
| 40 | extern size_t spacefb_videoram_size; | |
| 41 | ||
| 42 | 58 | VIDEO_START( spacefb ); |
| 43 | 59 | SCREEN_UPDATE( spacefb ); |
| 44 | 60 |
| r10613 | r10614 | |
|---|---|---|
| 1 | class nbmj8891_state : public driver_device | |
| 2 | { | |
| 3 | public: | |
| 4 | nbmj8891_state(running_machine &machine, const driver_device_config_base &config) | |
| 5 | : driver_device(machine, config) { } | |
| 6 | ||
| 7 | int scrolly; | |
| 8 | int blitter_destx; | |
| 9 | int blitter_desty; | |
| 10 | int blitter_sizex; | |
| 11 | int blitter_sizey; | |
| 12 | int blitter_src_addr; | |
| 13 | int blitter_direction_x; | |
| 14 | int blitter_direction_y; | |
| 15 | int vram; | |
| 16 | int gfxrom; | |
| 17 | int dispflag; | |
| 18 | int flipscreen; | |
| 19 | int clutsel; | |
| 20 | int screen_refresh; | |
| 21 | int gfxdraw_mode; | |
| 22 | bitmap_t *tmpbitmap0; | |
| 23 | bitmap_t *tmpbitmap1; | |
| 24 | UINT8 *videoram0; | |
| 25 | UINT8 *videoram1; | |
| 26 | UINT8 *palette; | |
| 27 | UINT8 *clut; | |
| 28 | int param_old[0x10]; | |
| 29 | int param_cnt; | |
| 30 | int flipscreen_old; | |
| 31 | }; | |
| 32 | ||
| 33 | ||
| 1 | 34 | /*----------- defined in video/nbmj8891.c -----------*/ |
| 2 | 35 | |
| 3 | 36 | SCREEN_UPDATE( nbmj8891 ); |
| r10613 | r10614 | |
|---|---|---|
| 5 | 5 | : driver_device(machine, config) { } |
| 6 | 6 | |
| 7 | 7 | UINT16 *videoram; |
| 8 | UINT8 sound_latch; | |
| 9 | UINT8 LS74_clr; | |
| 10 | UINT8 LS74_q; | |
| 11 | UINT8 gain_control; | |
| 12 | emu_timer *interrupt_timer; | |
| 13 | UINT16 *vreg; | |
| 14 | UINT16 *scroll_x; | |
| 15 | UINT16 *scroll_y; | |
| 16 | int flipscreen; | |
| 17 | UINT32 *prom_tab; | |
| 8 | 18 | }; |
| 9 | 19 | |
| 10 | 20 | |
| 11 | 21 | /*----------- defined in video/magmax.c -----------*/ |
| 12 | 22 | |
| 13 | extern UINT16 *magmax_vreg; | |
| 14 | extern UINT16 *magmax_scroll_x; | |
| 15 | extern UINT16 *magmax_scroll_y; | |
| 16 | ||
| 17 | 23 | PALETTE_INIT( magmax ); |
| 18 | 24 | SCREEN_UPDATE( magmax ); |
| 19 | 25 | VIDEO_START( magmax ); |
| r10613 | r10614 | |
|---|---|---|
| 5 | 5 | : driver_device(machine, config) { } |
| 6 | 6 | |
| 7 | 7 | UINT8 *videoram; |
| 8 | tilemap_t *bg_tilemap; | |
| 8 | 9 | }; |
| 9 | 10 | |
| 10 | 11 |
| r10613 | r10614 | |
|---|---|---|
| 1 | class nbmj8688_state : public driver_device | |
| 2 | { | |
| 3 | public: | |
| 4 | nbmj8688_state(running_machine &machine, const driver_device_config_base &config) | |
| 5 | : driver_device(machine, config) { } | |
| 6 | ||
| 7 | int mjsikaku_scrolly; | |
| 8 | int blitter_destx; | |
| 9 | int blitter_desty; | |
| 10 | int blitter_sizex; | |
| 11 | int blitter_sizey; | |
| 12 | int blitter_direction_x; | |
| 13 | int blitter_direction_y; | |
| 14 | int blitter_src_addr; | |
| 15 | int mjsikaku_gfxrom; | |
| 16 | int mjsikaku_dispflag; | |
| 17 | int mjsikaku_gfxflag2; | |
| 18 | int mjsikaku_gfxflag3; | |
| 19 | int mjsikaku_flipscreen; | |
| 20 | int mjsikaku_screen_refresh; | |
| 21 | int mjsikaku_gfxmode; | |
| 22 | bitmap_t *mjsikaku_tmpbitmap; | |
| 23 | UINT16 *mjsikaku_videoram; | |
| 24 | UINT8 *clut; | |
| 25 | UINT8 *HD61830B_ram[2]; | |
| 26 | int HD61830B_instr[2]; | |
| 27 | int HD61830B_addr[2]; | |
| 28 | int mjsikaku_flipscreen_old; | |
| 29 | }; | |
| 30 | ||
| 31 | ||
| 1 | 32 | /*----------- defined in video/nbmj8688.c -----------*/ |
| 2 | 33 | |
| 3 | 34 | PALETTE_INIT( mbmj8688_8bit ); |
| r10613 | r10614 | |
|---|---|---|
| 1 | class vsnes_state : public driver_device | |
| 2 | { | |
| 3 | public: | |
| 4 | vsnes_state(running_machine &machine, const driver_device_config_base &config) | |
| 5 | : driver_device(machine, config) { } | |
| 6 | ||
| 7 | UINT8 *work_ram; | |
| 8 | UINT8 *work_ram_1; | |
| 9 | int coin; | |
| 10 | int do_vrom_bank; | |
| 11 | int input_latch[4]; | |
| 12 | int sound_fix; | |
| 13 | UINT8 last_bank; | |
| 14 | UINT8* vram; | |
| 15 | UINT8* vrom[2]; | |
| 16 | UINT8* nt_ram[2]; | |
| 17 | UINT8* nt_page[2][4]; | |
| 18 | UINT32 vrom_size[2]; | |
| 19 | int vrom_banks; | |
| 20 | int zapstore; | |
| 21 | int old_bank; | |
| 22 | int drmario_shiftreg; | |
| 23 | int drmario_shiftcount; | |
| 24 | int size16k; | |
| 25 | int switchlow; | |
| 26 | int vrom4k; | |
| 27 | int MMC3_cmd; | |
| 28 | int MMC3_prg_bank[4]; | |
| 29 | int MMC3_chr_bank[6]; | |
| 30 | int MMC3_prg_mask; | |
| 31 | int IRQ_enable; | |
| 32 | int IRQ_count; | |
| 33 | int IRQ_count_latch; | |
| 34 | int VSindex; | |
| 35 | int supxevs_prot_index; | |
| 36 | int security_counter; | |
| 37 | int ret; | |
| 38 | }; | |
| 39 | ||
| 40 | ||
| 1 | 41 | /*----------- defined in video/vsnes.c -----------*/ |
| 2 | 42 | |
| 3 | 43 | VIDEO_START( vsnes ); |
| r10613 | r10614 | |
|---|---|---|
| 16 | 16 | #define VICTORY_VBSTART (0x100) |
| 17 | 17 | |
| 18 | 18 | |
| 19 | /* microcode state */ | |
| 20 | struct micro_t | |
| 21 | { | |
| 22 | UINT16 i; | |
| 23 | UINT16 pc; | |
| 24 | UINT8 r,g,b; | |
| 25 | UINT8 x,xp,y,yp; | |
| 26 | UINT8 cmd,cmdlo; | |
| 27 | emu_timer * timer; | |
| 28 | UINT8 timer_active; | |
| 29 | attotime endtime; | |
| 30 | }; | |
| 31 | ||
| 32 | class victory_state : public driver_device | |
| 33 | { | |
| 34 | public: | |
| 35 | victory_state(running_machine &machine, const driver_device_config_base &config) | |
| 36 | : driver_device(machine, config) { } | |
| 37 | ||
| 38 | UINT8 *videoram; | |
| 39 | UINT8 *charram; | |
| 40 | UINT16 paletteram[0x40]; | |
| 41 | UINT8 *bgbitmap; | |
| 42 | UINT8 *fgbitmap; | |
| 43 | UINT8 *rram; | |
| 44 | UINT8 *gram; | |
| 45 | UINT8 *bram; | |
| 46 | UINT8 vblank_irq; | |
| 47 | UINT8 fgcoll; | |
| 48 | UINT8 fgcollx; | |
| 49 | UINT8 fgcolly; | |
| 50 | UINT8 bgcoll; | |
| 51 | UINT8 bgcollx; | |
| 52 | UINT8 bgcolly; | |
| 53 | UINT8 scrollx; | |
| 54 | UINT8 scrolly; | |
| 55 | UINT8 video_control; | |
| 56 | struct micro_t micro; | |
| 57 | }; | |
| 58 | ||
| 59 | ||
| 19 | 60 | /*----------- defined in video/victory.c -----------*/ |
| 20 | 61 | |
| 21 | extern UINT8 *victory_videoram; | |
| 22 | extern UINT8 *victory_charram; | |
| 23 | ||
| 24 | 62 | VIDEO_START( victory ); |
| 25 | 63 | SCREEN_UPDATE( victory ); |
| 26 | 64 | INTERRUPT_GEN( victory_vblank_interrupt ); |
| r10613 | r10614 | |
|---|---|---|
| 5 | 5 | : driver_device(machine, config) { } |
| 6 | 6 | |
| 7 | 7 | UINT8 *videoram; |
| 8 | int horiz_scroll_low; | |
| 9 | int horiz_scroll_high; | |
| 10 | int rear_horiz_scroll_low; | |
| 11 | int rear_horiz_scroll_high; | |
| 12 | int rear_color; | |
| 13 | int rear_disable; | |
| 14 | int rear_refresh; | |
| 15 | bitmap_t *bg_bitmap; | |
| 8 | 16 | }; |
| 9 | 17 | |
| 10 | 18 |
| r10613 | r10614 | |
|---|---|---|
| 1 | class nbmj8991_state : public driver_device | |
| 2 | { | |
| 3 | public: | |
| 4 | nbmj8991_state(running_machine &machine, const driver_device_config_base &config) | |
| 5 | : driver_device(machine, config) { } | |
| 6 | ||
| 7 | int scrollx; | |
| 8 | int scrolly; | |
| 9 | int blitter_destx; | |
| 10 | int blitter_desty; | |
| 11 | int blitter_sizex; | |
| 12 | int blitter_sizey; | |
| 13 | int blitter_src_addr; | |
| 14 | int blitter_direction_x; | |
| 15 | int blitter_direction_y; | |
| 16 | int gfxrom; | |
| 17 | int dispflag; | |
| 18 | int flipscreen; | |
| 19 | int clutsel; | |
| 20 | int screen_refresh; | |
| 21 | bitmap_t *tmpbitmap; | |
| 22 | UINT8 *videoram; | |
| 23 | UINT8 *clut; | |
| 24 | int flipscreen_old; | |
| 25 | }; | |
| 26 | ||
| 27 | ||
| 1 | 28 | /*----------- defined in video/nbmj8991.c -----------*/ |
| 2 | 29 | |
| 3 | 30 | SCREEN_UPDATE( nbmj8991_type1 ); |
| r10613 | r10614 | |
|---|---|---|
| 7 | 7 | #define EXIDY440_MASTER_CLOCK (XTAL_12_9792MHz) |
| 8 | 8 | |
| 9 | 9 | |
| 10 | class exidy440_state : public driver_device | |
| 11 | { | |
| 12 | public: | |
| 13 | exidy440_state(running_machine &machine, const driver_device_config_base &config) | |
| 14 | : driver_device(machine, config) { } | |
| 15 | ||
| 16 | UINT8 bank; | |
| 17 | const UINT8 *showdown_bank_data[2]; | |
| 18 | INT8 showdown_bank_select; | |
| 19 | UINT8 showdown_bank_offset; | |
| 20 | UINT8 *imageram; | |
| 21 | UINT8 *scanline; | |
| 22 | UINT8 firq_vblank; | |
| 23 | UINT8 firq_beam; | |
| 24 | UINT8 *topsecex_yscroll; | |
| 25 | UINT8 latched_x; | |
| 26 | UINT8 *local_videoram; | |
| 27 | UINT8 *local_paletteram; | |
| 28 | UINT8 firq_enable; | |
| 29 | UINT8 firq_select; | |
| 30 | UINT8 palettebank_io; | |
| 31 | UINT8 palettebank_vis; | |
| 32 | }; | |
| 33 | ||
| 34 | ||
| 10 | 35 | /*----------- defined in drivers/exidy440.c -----------*/ |
| 11 | 36 | |
| 12 | 37 | void exidy440_bank_select(running_machine *machine, UINT8 bank); |
| r10613 | r10614 | |
| 14 | 39 | |
| 15 | 40 | /*----------- defined in video/exidy440.c -----------*/ |
| 16 | 41 | |
| 17 | extern UINT8 *exidy440_imageram; | |
| 18 | extern UINT8 *exidy440_scanline; | |
| 19 | extern UINT8 exidy440_firq_vblank; | |
| 20 | extern UINT8 exidy440_firq_beam; | |
| 21 | extern UINT8 *topsecex_yscroll; | |
| 22 | ||
| 23 | 42 | INTERRUPT_GEN( exidy440_vblank_interrupt ); |
| 24 | 43 | |
| 25 | 44 | READ8_HANDLER( exidy440_videoram_r ); |
| r10613 | r10614 | |
|---|---|---|
| 1 | class pingpong_state : public driver_device | |
| 2 | { | |
| 3 | public: | |
| 4 | pingpong_state(running_machine &machine, const driver_device_config_base &config) | |
| 5 | : driver_device(machine, config) { } | |
| 6 | ||
| 7 | int intenable; | |
| 8 | int question_addr_high; | |
| 9 | UINT8 *videoram; | |
| 10 | UINT8 *colorram; | |
| 11 | tilemap_t *bg_tilemap; | |
| 12 | }; | |
| 13 | ||
| 14 | ||
| 1 | 15 | /*----------- defined in video/pingpong.c -----------*/ |
| 2 | 16 | |
| 3 | extern UINT8 *pingpong_videoram; | |
| 4 | extern UINT8 *pingpong_colorram; | |
| 5 | ||
| 6 | 17 | WRITE8_HANDLER( pingpong_videoram_w ); |
| 7 | 18 | WRITE8_HANDLER( pingpong_colorram_w ); |
| 8 | 19 |
| r10613 | r10614 | |
|---|---|---|
| 5 | 5 | : driver_device(machine, config) { } |
| 6 | 6 | |
| 7 | 7 | UINT8 *videoram; |
| 8 | tilemap_t *bg_tilemap; | |
| 8 | 9 | }; |
| 9 | 10 | |
| 10 | 11 |
| r10613 | r10614 | |
|---|---|---|
| 1 | class nbmj8900_state : public driver_device | |
| 2 | { | |
| 3 | public: | |
| 4 | nbmj8900_state(running_machine &machine, const driver_device_config_base &config) | |
| 5 | : driver_device(machine, config) { } | |
| 6 | ||
| 7 | int scrolly; | |
| 8 | int blitter_destx; | |
| 9 | int blitter_desty; | |
| 10 | int blitter_sizex; | |
| 11 | int blitter_sizey; | |
| 12 | int blitter_src_addr; | |
| 13 | int blitter_direction_x; | |
| 14 | int blitter_direction_y; | |
| 15 | int vram; | |
| 16 | int gfxrom; | |
| 17 | int dispflag; | |
| 18 | int flipscreen; | |
| 19 | int clutsel; | |
| 20 | int screen_refresh; | |
| 21 | int gfxdraw_mode; | |
| 22 | int screen_height; | |
| 23 | int screen_width; | |
| 24 | bitmap_t *tmpbitmap0; | |
| 25 | bitmap_t *tmpbitmap1; | |
| 26 | UINT8 *videoram0; | |
| 27 | UINT8 *videoram1; | |
| 28 | UINT8 *palette; | |
| 29 | UINT8 *clut; | |
| 30 | int flipscreen_old; | |
| 31 | }; | |
| 32 | ||
| 33 | ||
| 1 | 34 | /*----------- defined in video/nbmj8900.c -----------*/ |
| 2 | 35 | |
| 3 | 36 | SCREEN_UPDATE( nbmj8900 ); |
| r10613 | r10614 | |
|---|---|---|
| 17 | 17 | public: |
| 18 | 18 | micro3d_state(running_machine &machine, const driver_device_config_base &config) |
| 19 | 19 | : driver_device(machine, config) { } |
| 20 | ||
| 20 | ||
| 21 | 21 | UINT16 *shared_ram; |
| 22 | 22 | device_t *duart68681; |
| 23 | 23 | UINT8 m68681_tx0; |
| r10613 | r10614 | |
|---|---|---|
| 1 | class m90_state : public driver_device | |
| 2 | { | |
| 3 | public: | |
| 4 | m90_state(running_machine &machine, const driver_device_config_base &config) | |
| 5 | : driver_device(machine, config) { } | |
| 6 | ||
| 7 | UINT32 bankaddress; | |
| 8 | UINT16 *video_data; | |
| 9 | UINT16 *spriteram; | |
| 10 | UINT16 video_control_data[8]; | |
| 11 | tilemap_t *pf1_layer; | |
| 12 | tilemap_t *pf2_layer; | |
| 13 | tilemap_t *pf1_wide_layer; | |
| 14 | tilemap_t *pf2_wide_layer; | |
| 15 | int last_pf1; | |
| 16 | int last_pf2; | |
| 17 | }; | |
| 18 | ||
| 19 | ||
| 1 | 20 | /*----------- defined in video/m90.c -----------*/ |
| 2 | 21 | |
| 3 | extern UINT16 *m90_video_data; | |
| 4 | ||
| 5 | 22 | VIDEO_START( m90 ); |
| 6 | 23 | VIDEO_START( dynablsb ); |
| 7 | 24 | VIDEO_START( bomblord ); |
| r10613 | r10614 | |
|---|---|---|
| 1 | typedef struct | |
| 2 | { | |
| 3 | int writable; // 1 for RAM, 0 for ROM | |
| 4 | UINT8* chr; // direct access to the memory | |
| 5 | } chr_bank; | |
| 6 | ||
| 1 | 7 | class playch10_state : public driver_device |
| 2 | 8 | { |
| 3 | 9 | public: |
| r10613 | r10614 | |
| 5 | 11 | : driver_device(machine, config) { } |
| 6 | 12 | |
| 7 | 13 | UINT8 *videoram; |
| 14 | UINT8 *ram_8w; | |
| 15 | UINT8 *work_ram; | |
| 16 | int up_8w; | |
| 17 | UINT8 *timedata; | |
| 18 | int pc10_nmi_enable; | |
| 19 | int pc10_dog_di; | |
| 20 | int pc10_sdcs; | |
| 21 | int pc10_dispmask; | |
| 22 | int pc10_int_detect; | |
| 23 | int pc10_game_mode; | |
| 24 | int pc10_dispmask_old; | |
| 25 | int pc10_gun_controller; | |
| 26 | int cart_sel; | |
| 27 | int cntrl_mask; | |
| 28 | int input_latch[2]; | |
| 29 | int mirroring; | |
| 30 | int MMC2_bank[4]; | |
| 31 | int MMC2_bank_latch[2]; | |
| 32 | UINT8* vrom; | |
| 33 | UINT8* vram; | |
| 34 | UINT8* nametable[4]; | |
| 35 | UINT8* nt_ram; | |
| 36 | chr_bank chr_page[8]; | |
| 37 | int mmc1_shiftreg; | |
| 38 | int mmc1_shiftcount; | |
| 39 | int mmc1_rom_mask; | |
| 40 | int gboard_scanline_counter; | |
| 41 | int gboard_scanline_latch; | |
| 42 | int gboard_banks[2]; | |
| 43 | int gboard_4screen; | |
| 44 | int gboard_last_bank; | |
| 45 | int gboard_command; | |
| 46 | int pc10_bios; | |
| 47 | tilemap_t *bg_tilemap; | |
| 8 | 48 | }; |
| 9 | 49 | |
| 10 | 50 | |
| r10613 | r10614 | |
| 47 | 87 | WRITE8_HANDLER( pc10_CARTSEL_w ); |
| 48 | 88 | WRITE8_HANDLER( pc10_in0_w ); |
| 49 | 89 | |
| 50 | extern int pc10_nmi_enable; | |
| 51 | extern int pc10_dog_di; | |
| 52 | extern int pc10_sdcs; /* ShareD Chip Select */ | |
| 53 | extern int pc10_dispmask; /* Display Mask */ | |
| 54 | extern int pc10_int_detect; | |
| 55 | extern int pc10_game_mode; | |
| 56 | extern int pc10_dispmask_old; | |
| 57 | 90 | |
| 58 | 91 | |
| 59 | 92 | /*----------- defined in video/playch10.c -----------*/ |
| r10613 | r10614 | |
|---|---|---|
| 56 | 56 | UINT8 sprite_control[8]; |
| 57 | 57 | UINT32 *spriteram_32bit; |
| 58 | 58 | void (*system32_prot_vblank)(device_t *device); |
| 59 | int print_count; | |
| 59 | 60 | }; |
| 60 | 61 | |
| 61 | 62 |
| r10613 | r10614 | |
|---|---|---|
| 1 | 1 | #include "devlegcy.h" |
| 2 | 2 | |
| 3 | class gomoku_state : public driver_device | |
| 4 | { | |
| 5 | public: | |
| 6 | gomoku_state(running_machine &machine, const driver_device_config_base &config) | |
| 7 | : driver_device(machine, config) { } | |
| 8 | ||
| 9 | UINT8 *videoram; | |
| 10 | UINT8 *colorram; | |
| 11 | UINT8 *bgram; | |
| 12 | int flipscreen; | |
| 13 | int bg_dispsw; | |
| 14 | tilemap_t *fg_tilemap; | |
| 15 | bitmap_t *bg_bitmap; | |
| 16 | }; | |
| 17 | ||
| 18 | ||
| 3 | 19 | /*----------- defined in audio/gomoku.c -----------*/ |
| 4 | 20 | |
| 5 | 21 | WRITE8_DEVICE_HANDLER( gomoku_sound1_w ); |
| r10613 | r10614 | |
| 10 | 26 | |
| 11 | 27 | /*----------- defined in video/gomoku.c -----------*/ |
| 12 | 28 | |
| 13 | extern UINT8 *gomoku_videoram; | |
| 14 | extern UINT8 *gomoku_colorram; | |
| 15 | extern UINT8 *gomoku_bgram; | |
| 16 | ||
| 17 | 29 | PALETTE_INIT( gomoku ); |
| 18 | 30 | VIDEO_START( gomoku ); |
| 19 | 31 | SCREEN_UPDATE( gomoku ); |
| r10613 | r10614 | |
|---|---|---|
| 1 | class tubep_state : public driver_device | |
| 2 | { | |
| 3 | public: | |
| 4 | tubep_state(running_machine &machine, const driver_device_config_base &config) | |
| 5 | : driver_device(machine, config) { } | |
| 6 | ||
| 7 | UINT8 sound_latch; | |
| 8 | UINT8 ls74; | |
| 9 | UINT8 ls377; | |
| 10 | emu_timer *interrupt_timer; | |
| 11 | int curr_scanline; | |
| 12 | UINT8 *rjammer_backgroundram; | |
| 13 | UINT8 *backgroundram; | |
| 14 | UINT8 *textram; | |
| 15 | UINT8 *sprite_colorsharedram; | |
| 16 | UINT8 *spritemap; | |
| 17 | UINT8 prom2[32]; | |
| 18 | UINT32 romD_addr; | |
| 19 | UINT32 romEF_addr; | |
| 20 | UINT32 E16_add_b; | |
| 21 | UINT32 HINV; | |
| 22 | UINT32 VINV; | |
| 23 | UINT32 XSize; | |
| 24 | UINT32 YSize; | |
| 25 | UINT32 mark_1; | |
| 26 | UINT32 mark_2; | |
| 27 | UINT32 colorram_addr_hi; | |
| 28 | UINT32 ls273_g6; | |
| 29 | UINT32 ls273_j6; | |
| 30 | UINT32 romHI_addr_mid; | |
| 31 | UINT32 romHI_addr_msb; | |
| 32 | UINT8 DISP; | |
| 33 | UINT8 background_romsel; | |
| 34 | UINT8 color_A4; | |
| 35 | UINT8 ls175_b7; | |
| 36 | UINT8 ls175_e8; | |
| 37 | UINT8 ls377_data; | |
| 38 | UINT32 page; | |
| 39 | }; | |
| 40 | ||
| 41 | ||
| 1 | 42 | /*----------- defined in video/tubep.c -----------*/ |
| 2 | 43 | |
| 3 | void tubep_vblank_end( | |
| 44 | void tubep_vblank_end(running_machine *machine); | |
| 4 | 45 | PALETTE_INIT( tubep ); |
| 5 | 46 | SCREEN_UPDATE( tubep ); |
| 6 | 47 | PALETTE_INIT( rjammer ); |
| r10613 | r10614 | |
| 8 | 49 | VIDEO_START( tubep ); |
| 9 | 50 | VIDEO_RESET( tubep ); |
| 10 | 51 | |
| 11 | extern UINT8 *rjammer_backgroundram; | |
| 12 | extern UINT8 *tubep_backgroundram; | |
| 13 | extern UINT8 *tubep_textram; | |
| 14 | extern UINT8 *tubep_sprite_colorsharedram; | |
| 15 | 52 | |
| 16 | 53 | extern WRITE8_HANDLER( tubep_textram_w ); |
| 17 | 54 | extern WRITE8_HANDLER( rjammer_background_LS377_w ); |
| r10613 | r10614 | |
|---|---|---|
| 19 | 19 | #define EXIDY_VSSTART (0x100) |
| 20 | 20 | |
| 21 | 21 | |
| 22 | class exidy_state : public driver_device | |
| 23 | { | |
| 24 | public: | |
| 25 | exidy_state(running_machine &machine, const driver_device_config_base &config) | |
| 26 | : driver_device(machine, config) { } | |
| 27 | ||
| 28 | UINT8 last_dial; | |
| 29 | UINT8 *videoram; | |
| 30 | UINT8 *characterram; | |
| 31 | UINT8 *color_latch; | |
| 32 | UINT8 *sprite1_xpos; | |
| 33 | UINT8 *sprite1_ypos; | |
| 34 | UINT8 *sprite2_xpos; | |
| 35 | UINT8 *sprite2_ypos; | |
| 36 | UINT8 *spriteno; | |
| 37 | UINT8 *sprite_enable; | |
| 38 | UINT8 collision_mask; | |
| 39 | UINT8 collision_invert; | |
| 40 | int is_2bpp; | |
| 41 | UINT8 int_condition; | |
| 42 | bitmap_t *background_bitmap; | |
| 43 | bitmap_t *motion_object_1_vid; | |
| 44 | bitmap_t *motion_object_2_vid; | |
| 45 | bitmap_t *motion_object_2_clip; | |
| 46 | }; | |
| 47 | ||
| 48 | ||
| 22 | 49 | /*----------- defined in video/exidy.c -----------*/ |
| 23 | 50 | |
| 24 | extern UINT8 *exidy_videoram; | |
| 25 | extern UINT8 *exidy_characterram; | |
| 26 | extern UINT8 *exidy_color_latch; | |
| 27 | extern UINT8 *exidy_sprite1_xpos; | |
| 28 | extern UINT8 *exidy_sprite1_ypos; | |
| 29 | extern UINT8 *exidy_sprite2_xpos; | |
| 30 | extern UINT8 *exidy_sprite2_ypos; | |
| 31 | extern UINT8 *exidy_spriteno; | |
| 32 | extern UINT8 *exidy_sprite_enable; | |
| 33 | ||
| 34 | void exidy_video_config(UINT8 _collision_mask, UINT8 _collision_invert, int _is_2bpp); | |
| 51 | void exidy_video_config(running_machine *machine, UINT8 _collision_mask, UINT8 _collision_invert, int _is_2bpp); | |
| 35 | 52 | VIDEO_START( exidy ); |
| 36 | 53 | SCREEN_UPDATE( exidy ); |
| 37 | 54 |
| r10613 | r10614 | |
|---|---|---|
| 1 | class hyhoo_state : public driver_device | |
| 2 | { | |
| 3 | public: | |
| 4 | hyhoo_state(running_machine &machine, const driver_device_config_base &config) | |
| 5 | : driver_device(machine, config) { } | |
| 6 | ||
| 7 | UINT8 *clut; | |
| 8 | int blitter_destx; | |
| 9 | int blitter_desty; | |
| 10 | int blitter_sizex; | |
| 11 | int blitter_sizey; | |
| 12 | int blitter_src_addr; | |
| 13 | int blitter_direction_x; | |
| 14 | int blitter_direction_y; | |
| 15 | int gfxrom; | |
| 16 | int dispflag; | |
| 17 | int highcolorflag; | |
| 18 | int flipscreen; | |
| 19 | bitmap_t *tmpbitmap; | |
| 20 | }; | |
| 21 | ||
| 22 | ||
| 1 | 23 | /*----------- defined in video/hyhoo.c -----------*/ |
| 2 | 24 | |
| 3 | extern UINT8 *hyhoo_clut; | |
| 4 | ||
| 5 | 25 | SCREEN_UPDATE( hyhoo ); |
| 6 | 26 | VIDEO_START( hyhoo ); |
| 7 | 27 |
| r10613 | r10614 | |
|---|---|---|
| 1 | class clshroad_state : public driver_device | |
| 2 | { | |
| 3 | public: | |
| 4 | clshroad_state(running_machine &machine, const driver_device_config_base &config) | |
| 5 | : driver_device(machine, config) { } | |
| 6 | ||
| 7 | UINT8 *vram_0; | |
| 8 | UINT8 *vram_1; | |
| 9 | UINT8 *vregs; | |
| 10 | tilemap_t *tilemap_0a; | |
| 11 | tilemap_t *tilemap_0b; | |
| 12 | tilemap_t *tilemap_1; | |
| 13 | }; | |
| 14 | ||
| 15 | ||
| 1 | 16 | /*----------- defined in video/clshroad.c -----------*/ |
| 2 | 17 | |
| 3 | extern UINT8 *clshroad_vram_0, *clshroad_vram_1; | |
| 4 | extern UINT8 *clshroad_vregs; | |
| 5 | ||
| 6 | 18 | WRITE8_HANDLER( clshroad_vram_0_w ); |
| 7 | 19 | WRITE8_HANDLER( clshroad_vram_1_w ); |
| 8 | 20 | WRITE8_HANDLER( clshroad_flipscreen_w ); |
| r10613 | r10614 | |
|---|---|---|
| 33 | 33 | int fg_gfx; |
| 34 | 34 | int fg2_gfx; |
| 35 | 35 | int tx_tilemap_mode; |
| 36 | ||
| 36 | ||
| 37 | 37 | int interrupt_line_1, interrupt_line_2; |
| 38 | 38 | }; |
| 39 | 39 |
| r10613 | r10614 | |
|---|---|---|
| 15 | 15 | m_nvram(*this, "nvram") { } |
| 16 | 16 | |
| 17 | 17 | required_shared_ptr<UINT8> m_nvram; |
| 18 | UINT8 sound_int_state; | |
| 19 | UINT8 audio_talkback; | |
| 20 | UINT8 audio_sync; | |
| 21 | device_t *sound_cpu; | |
| 22 | device_t *soundalt_cpu; | |
| 23 | UINT8 *mayday_protection; | |
| 24 | UINT8 *videoram; | |
| 25 | UINT8 *williams2_tileram; | |
| 26 | UINT8 *blaster_palette_0; | |
| 27 | UINT8 *blaster_scanline_control; | |
| 28 | UINT8 blitter_config; | |
| 29 | UINT16 blitter_clip_address; | |
| 30 | UINT8 blitter_window_enable; | |
| 31 | UINT8 williams2_tilemap_config; | |
| 32 | UINT8 cocktail; | |
| 33 | UINT8 blaster_bank; | |
| 34 | UINT8 vram_bank; | |
| 35 | UINT16 joust2_current_sound_data; | |
| 36 | UINT8 port_select; | |
| 37 | rgb_t *palette_lookup; | |
| 38 | UINT8 blitterram[8]; | |
| 39 | UINT8 blitter_xor; | |
| 40 | UINT8 blitter_remap_index; | |
| 41 | const UINT8 *blitter_remap; | |
| 42 | UINT8 *blitter_remap_lookup; | |
| 43 | rgb_t blaster_color0; | |
| 44 | UINT8 blaster_video_control; | |
| 45 | tilemap_t *bg_tilemap; | |
| 46 | UINT16 tilemap_xscroll; | |
| 47 | UINT8 williams2_fg_color; | |
| 18 | 48 | }; |
| 19 | 49 | |
| 20 | 50 | |
| r10613 | r10614 | |
| 87 | 117 | CUSTOM_INPUT( williams_mux_r ); |
| 88 | 118 | |
| 89 | 119 | /* Mayday protection */ |
| 90 | extern UINT8 *mayday_protection; | |
| 91 | 120 | READ8_HANDLER( mayday_protection_r ); |
| 92 | 121 | |
| 93 | 122 | WRITE8_HANDLER( defender_video_control_w ); |
| r10613 | r10614 | |
| 102 | 131 | #define WILLIAMS_TILEMAP_TSHOOT 1 /* IC79 is a 74LS157 selector jumpered to be enabled */ |
| 103 | 132 | #define WILLIAMS_TILEMAP_JOUST2 2 /* IC79 is a 74LS157 selector jumpered to be disabled */ |
| 104 | 133 | |
| 105 | /* RAM globals */ | |
| 106 | extern UINT8 *williams_videoram; | |
| 107 | extern UINT8 *williams2_tileram; | |
| 108 | extern UINT8 *blaster_palette_0; | |
| 109 | extern UINT8 *blaster_scanline_control; | |
| 110 | ||
| 111 | /* blitter globals */ | |
| 112 | extern UINT8 williams_blitter_config; | |
| 113 | extern UINT16 williams_blitter_clip_address; | |
| 114 | extern UINT8 williams_blitter_window_enable; | |
| 115 | ||
| 116 | /* tilemap globals */ | |
| 117 | extern UINT8 williams2_tilemap_config; | |
| 118 | ||
| 119 | /* rendering globals */ | |
| 120 | extern UINT8 williams_cocktail; | |
| 121 | ||
| 122 | ||
| 123 | 134 | WRITE8_HANDLER( williams_blitter_w ); |
| 124 | 135 | WRITE8_HANDLER( blaster_remap_select_w ); |
| 125 | 136 | WRITE8_HANDLER( blaster_video_control_w ); |
| r10613 | r10614 | |
|---|---|---|
| 16 | 16 | #define TRIPLHNT_LAMP_EN NODE_05 |
| 17 | 17 | |
| 18 | 18 | |
| 19 | class triplhnt_state : public driver_device | |
| 20 | { | |
| 21 | public: | |
| 22 | triplhnt_state(running_machine &machine, const driver_device_config_base &config) | |
| 23 | : driver_device(machine, config) { } | |
| 24 | ||
| 25 | UINT8 cmos[16]; | |
| 26 | UINT8 da_latch; | |
| 27 | UINT8 misc_flags; | |
| 28 | UINT8 cmos_latch; | |
| 29 | UINT8 hit_code; | |
| 30 | UINT8* playfield_ram; | |
| 31 | UINT8* vpos_ram; | |
| 32 | UINT8* hpos_ram; | |
| 33 | UINT8* code_ram; | |
| 34 | UINT8* orga_ram; | |
| 35 | int sprite_zoom; | |
| 36 | int sprite_bank; | |
| 37 | bitmap_t* helper; | |
| 38 | tilemap_t* bg_tilemap; | |
| 39 | }; | |
| 40 | ||
| 41 | ||
| 19 | 42 | /*----------- defined in drivers/triplhnt.c -----------*/ |
| 20 | 43 | |
| 21 | 44 | void triplhnt_set_collision(running_machine *machine, int data); |
| r10613 | r10614 | |
| 32 | 55 | VIDEO_START( triplhnt ); |
| 33 | 56 | SCREEN_UPDATE( triplhnt ); |
| 34 | 57 | |
| 35 | extern UINT8* triplhnt_playfield_ram; | |
| 36 | extern UINT8* triplhnt_vpos_ram; | |
| 37 | extern UINT8* triplhnt_hpos_ram; | |
| 38 | extern UINT8* triplhnt_code_ram; | |
| 39 | extern UINT8* triplhnt_orga_ram; | |
| 40 | 58 | |
| 41 | extern int triplhnt_sprite_zoom; | |
| 42 | extern int triplhnt_sprite_bank; |
| r10613 | r10614 | |
|---|---|---|
| 1 | class pirates_state : public driver_device | |
| 2 | { | |
| 3 | public: | |
| 4 | pirates_state(running_machine &machine, const driver_device_config_base &config) | |
| 5 | : driver_device(machine, config) { } | |
| 6 | ||
| 7 | UINT16 *tx_tileram; | |
| 8 | UINT16 *spriteram; | |
| 9 | UINT16 *fg_tileram; | |
| 10 | UINT16 *bg_tileram; | |
| 11 | UINT16 *scroll; | |
| 12 | tilemap_t *tx_tilemap; | |
| 13 | tilemap_t *fg_tilemap; | |
| 14 | tilemap_t *bg_tilemap; | |
| 15 | }; | |
| 16 | ||
| 17 | ||
| 1 | 18 | /*----------- defined in video/pirates.c -----------*/ |
| 2 | 19 | |
| 3 | extern UINT16 *pirates_tx_tileram, *pirates_spriteram; | |
| 4 | extern UINT16 *pirates_fg_tileram, *pirates_bg_tileram; | |
| 5 | extern UINT16 *pirates_scroll; | |
| 6 | ||
| 7 | 20 | WRITE16_HANDLER( pirates_tx_tileram_w ); |
| 8 | 21 | WRITE16_HANDLER( pirates_fg_tileram_w ); |
| 9 | 22 | WRITE16_HANDLER( pirates_bg_tileram_w ); |
| r10613 | r10614 | |
|---|---|---|
| 737 | 737 | $(MAMEOBJ)/jaleco.a: \ |
| 738 | 738 | $(DRIVERS)/aeroboto.o $(VIDEO)/aeroboto.o \ |
| 739 | 739 | $(DRIVERS)/argus.o $(VIDEO)/argus.o \ |
| 740 | $(VIDEO)/jalblend.o \ | |
| 741 | 740 | $(DRIVERS)/bestleag.o \ |
| 742 | 741 | $(DRIVERS)/bigstrkb.o $(VIDEO)/bigstrkb.o \ |
| 743 | 742 | $(DRIVERS)/blueprnt.o $(VIDEO)/blueprnt.o \ |
| r10613 | r10614 | |
| 758 | 757 | $(DRIVERS)/stepstag.o \ |
| 759 | 758 | $(DRIVERS)/tetrisp2.o $(VIDEO)/tetrisp2.o \ |
| 760 | 759 | $(MACHINE)/ms32crpt.o \ |
| 760 | $(VIDEO)/jalblend.o \ | |
| 761 | 761 | |
| 762 | 762 | $(MAMEOBJ)/jpm.a: \ |
| 763 | 763 | $(DRIVERS)/guab.o \ |
| r10613 | r10614 | |
| 947 | 947 | $(DRIVERS)/namcona1.o $(VIDEO)/namcona1.o \ |
| 948 | 948 | $(DRIVERS)/namconb1.o $(VIDEO)/namconb1.o \ |
| 949 | 949 | $(DRIVERS)/namcond1.o $(MACHINE)/namcond1.o $(VIDEO)/ygv608.o \ |
| 950 | $(DRIVERS)/namcops2.o \ | |
| 950 | 951 | $(DRIVERS)/namcos1.o $(MACHINE)/namcos1.o $(VIDEO)/namcos1.o \ |
| 951 | 952 | $(DRIVERS)/namcos10.o \ |
| 952 | 953 | $(DRIVERS)/namcos11.o \ |
| r10613 | r10614 | |
| 964 | 965 | $(DRIVERS)/tceptor.o $(VIDEO)/tceptor.o \ |
| 965 | 966 | $(DRIVERS)/toypop.o $(VIDEO)/toypop.o \ |
| 966 | 967 | $(DRIVERS)/turrett.o \ |
| 967 | $(DRIVERS)/warpwarp.o $(AUDIO)/warpwarp.o $(VIDEO)/warpwarp.o \ | |
| 968 | $(DRIVERS)/warpwarp.o $(AUDIO)/geebee.o $(AUDIO)/warpwarp.o $(VIDEO)/warpwarp.o \ | |
| 968 | 969 | $(MACHINE)/namcoio.o \ |
| 969 | $(AUDIO)/geebee.o \ | |
| 970 | 970 | $(MACHINE)/namco06.o \ |
| 971 | 971 | $(MACHINE)/namco50.o \ |
| 972 | 972 | $(MACHINE)/namco51.o \ |
| r10613 | r10614 | |
| 979 | 979 | $(VIDEO)/digdug.o \ |
| 980 | 980 | $(MACHINE)/psx.o $(VIDEO)/psx.o \ |
| 981 | 981 | $(MACHINE)/xevious.o $(VIDEO)/xevious.o \ |
| 982 | $(DRIVERS)/namcops2.o \ | |
| 983 | 982 | |
| 984 | 983 | $(MAMEOBJ)/nasco.a: \ |
| 985 | 984 | $(DRIVERS)/crgolf.o $(VIDEO)/crgolf.o \ |
| r10613 | r10614 | |
| 1019 | 1018 | $(MACHINE)/nb1413m3.o \ |
| 1020 | 1019 | |
| 1021 | 1020 | $(MAMEOBJ)/nintendo.a: \ |
| 1021 | $(DRIVERS)/cham24.o \ | |
| 1022 | 1022 | $(DRIVERS)/dkong.o $(AUDIO)/dkong.o $(VIDEO)/dkong.o \ |
| 1023 | $(DRIVERS)/cham24.o \ | |
| 1024 | $(DRIVERS)/snesb.o \ | |
| 1025 | 1023 | $(DRIVERS)/mario.o $(AUDIO)/mario.o $(VIDEO)/mario.o \ |
| 1026 | 1024 | $(DRIVERS)/multigam.o \ |
| 1027 | 1025 | $(DRIVERS)/n8080.o $(AUDIO)/n8080.o $(VIDEO)/n8080.o \ |
| r10613 | r10614 | |
| 1030 | 1028 | $(DRIVERS)/popeye.o $(VIDEO)/popeye.o \ |
| 1031 | 1029 | $(DRIVERS)/punchout.o $(VIDEO)/punchout.o \ |
| 1032 | 1030 | $(DRIVERS)/sfcbox.o \ |
| 1031 | $(DRIVERS)/snesb.o \ | |
| 1033 | 1032 | $(DRIVERS)/spacefb.o $(AUDIO)/spacefb.o $(VIDEO)/spacefb.o \ |
| 1034 | 1033 | $(DRIVERS)/vsnes.o $(MACHINE)/vsnes.o $(VIDEO)/vsnes.o \ |
| 1035 | 1034 | $(VIDEO)/ppu2c0x.o \ |
| r10613 | r10614 | |
| 1081 | 1080 | $(MACHINE)/theglobp.o \ |
| 1082 | 1081 | |
| 1083 | 1082 | $(MAMEOBJ)/pce.a: \ |
| 1083 | $(DRIVERS)/ggconnie.o \ | |
| 1084 | $(DRIVERS)/paranoia.o \ | |
| 1084 | 1085 | $(DRIVERS)/uapce.o \ |
| 1085 | $(DRIVERS)/paranoia.o \ | |
| 1086 | $(DRIVERS)/ggconnie.o \ | |
| 1087 | 1086 | $(MACHINE)/pcecommn.o $(VIDEO)/vdc.o \ |
| 1088 | 1087 | |
| 1089 | 1088 | $(MAMEOBJ)/phoenix.a: \ |
| r10613 | r10614 | |
| 1192 | 1191 | $(VIDEO)/stvvdp1.o $(VIDEO)/stvvdp2.o \ |
| 1193 | 1192 | |
| 1194 | 1193 | $(MAMEOBJ)/seibu.a: \ |
| 1194 | $(DRIVERS)/bloodbro.o $(VIDEO)/bloodbro.o \ | |
| 1195 | $(DRIVERS)/cabal.o $(VIDEO)/cabal.o \ | |
| 1195 | 1196 | $(DRIVERS)/cshooter.o \ |
| 1196 | 1197 | $(DRIVERS)/dcon.o $(VIDEO)/dcon.o \ |
| 1197 | 1198 | $(DRIVERS)/deadang.o $(VIDEO)/deadang.o \ |
| 1198 | 1199 | $(DRIVERS)/dynduke.o $(VIDEO)/dynduke.o \ |
| 1200 | $(DRIVERS)/feversoc.o \ | |
| 1201 | $(DRIVERS)/goal92.o $(VIDEO)/goal92.o \ | |
| 1202 | $(DRIVERS)/goodejan.o \ | |
| 1199 | 1203 | $(DRIVERS)/kncljoe.o $(VIDEO)/kncljoe.o \ |
| 1204 | $(DRIVERS)/legionna.o $(VIDEO)/legionna.o \ | |
| 1200 | 1205 | $(DRIVERS)/mustache.o $(VIDEO)/mustache.o \ |
| 1201 | 1206 | $(DRIVERS)/panicr.o \ |
| 1202 | 1207 | $(DRIVERS)/raiden.o $(VIDEO)/raiden.o \ |
| 1203 | 1208 | $(DRIVERS)/raiden2.o $(MACHINE)/r2crypt.o \ |
| 1204 | 1209 | $(DRIVERS)/r2dx_v33.o \ |
| 1205 | 1210 | $(DRIVERS)/seibuspi.o $(MACHINE)/seibuspi.o $(VIDEO)/seibuspi.o \ |
| 1206 | $(VIDEO)/sei_crtc.o \ | |
| 1207 | 1211 | $(DRIVERS)/sengokmj.o \ |
| 1208 | $(DRIVERS)/goodejan.o \ | |
| 1209 | 1212 | $(DRIVERS)/stfight.o $(MACHINE)/stfight.o $(VIDEO)/stfight.o \ |
| 1213 | $(DRIVERS)/toki.o $(VIDEO)/toki.o \ | |
| 1210 | 1214 | $(DRIVERS)/wiz.o $(VIDEO)/wiz.o \ |
| 1215 | $(MACHINE)/seicop.o \ | |
| 1211 | 1216 | $(MACHINE)/spisprit.o \ |
| 1212 | 1217 | $(AUDIO)/seibu.o \ |
| 1213 | $(DRIVERS)/bloodbro.o $(VIDEO)/bloodbro.o \ | |
| 1214 | $(DRIVERS)/cabal.o $(VIDEO)/cabal.o \ | |
| 1215 | $(DRIVERS)/goal92.o $(VIDEO)/goal92.o \ | |
| 1216 | $(DRIVERS)/legionna.o $(VIDEO)/legionna.o \ | |
| 1217 | $(MACHINE)/seicop.o \ | |
| 1218 | $(DRIVERS)/toki.o $(VIDEO)/toki.o \ | |
| 1219 | $(DRIVERS)/feversoc.o \ | |
| 1218 | $(VIDEO)/sei_crtc.o \ | |
| 1220 | 1219 | |
| 1221 | 1220 | $(MAMEOBJ)/seta.a: \ |
| 1222 | 1221 | $(DRIVERS)/aleck64.o $(MACHINE)/n64.o $(VIDEO)/n64.o $(VIDEO)/rdpblend.o $(VIDEO)/rdpfb.o $(VIDEO)/rdpspn16.o $(VIDEO)/rdptpipe.o \ |
| r10613 | r10614 | |
| 1277 | 1276 | $(DRIVERS)/strnskil.o $(VIDEO)/strnskil.o \ |
| 1278 | 1277 | |
| 1279 | 1278 | $(MAMEOBJ)/suna.a: \ |
| 1279 | $(DRIVERS)/go2000.o \ | |
| 1280 | 1280 | $(DRIVERS)/goindol.o $(VIDEO)/goindol.o \ |
| 1281 | 1281 | $(DRIVERS)/suna8.o $(AUDIO)/suna8.o $(VIDEO)/suna8.o \ |
| 1282 | 1282 | $(DRIVERS)/suna16.o $(VIDEO)/suna16.o \ |
| 1283 | $(DRIVERS)/go2000.o \ | |
| 1284 | 1283 | |
| 1285 | 1284 | $(MAMEOBJ)/taito.a: \ |
| 1286 | 1285 | $(DRIVERS)/40love.o $(VIDEO)/40love.o \ |
| r10613 | r10614 | |
| 2004 | 2003 | $(LAYOUT)/babydad.lh |
| 2005 | 2004 | |
| 2006 | 2005 | $(DRIVERS)/warpwarp.o: $(LAYOUT)/geebee.lh \ |
| 2006 | $(LAYOUT)/navarone.lh \ | |
| 2007 | 2007 | $(LAYOUT)/sos.lh |
| 2008 | 2008 | |
| 2009 | 2009 | $(DRIVERS)/wecleman.o: $(LAYOUT)/wecleman.lh |
| r10613 | r10614 | |
|---|---|---|
| 11 | 11 | #include "includes/nbmj9195.h" |
| 12 | 12 | |
| 13 | 13 | |
| 14 | #define VRAM_MAX 2 | |
| 15 | ||
| 16 | #define SCANLINE_MIN 0 | |
| 17 | #define SCANLINE_MAX 512 | |
| 18 | ||
| 19 | ||
| 20 | static int nbmj9195_scrollx[VRAM_MAX], nbmj9195_scrolly[VRAM_MAX]; | |
| 21 | static int nbmj9195_scrollx_raster[VRAM_MAX][SCANLINE_MAX]; | |
| 22 | static int nbmj9195_scanline[VRAM_MAX]; | |
| 23 | static int blitter_destx[VRAM_MAX], blitter_desty[VRAM_MAX]; | |
| 24 | static int blitter_sizex[VRAM_MAX], blitter_sizey[VRAM_MAX]; | |
| 25 | static int blitter_src_addr[VRAM_MAX]; | |
| 26 | static int blitter_direction_x[VRAM_MAX], blitter_direction_y[VRAM_MAX]; | |
| 27 | static int nbmj9195_dispflag[VRAM_MAX]; | |
| 28 | static int nbmj9195_flipscreen[VRAM_MAX]; | |
| 29 | static int nbmj9195_clutmode[VRAM_MAX]; | |
| 30 | static int nbmj9195_transparency[VRAM_MAX]; | |
| 31 | static int nbmj9195_clutsel; | |
| 32 | static int nbmj9195_screen_refresh; | |
| 33 | static int nbmj9195_gfxflag2; | |
| 34 | static int gfxdraw_mode; | |
| 35 | static int nb19010_busyctr; | |
| 36 | static int nb19010_busyflag; | |
| 37 | ||
| 38 | static bitmap_t *nbmj9195_tmpbitmap[VRAM_MAX]; | |
| 39 | static UINT16 *nbmj9195_videoram[VRAM_MAX]; | |
| 40 | static UINT16 *nbmj9195_videoworkram[VRAM_MAX]; | |
| 41 | static UINT8 *nbmj9195_palette, *nbmj9195_nb22090_palette; | |
| 42 | static UINT8 *nbmj9195_clut[VRAM_MAX]; | |
| 43 | ||
| 44 | ||
| 45 | 14 | static void nbmj9195_vramflip(running_machine *machine, int vram); |
| 46 | 15 | static void nbmj9195_gfxdraw(running_machine *machine, int vram); |
| 47 | 16 | |
| r10613 | r10614 | |
| 52 | 21 | ******************************************************************************/ |
| 53 | 22 | READ8_HANDLER( nbmj9195_palette_r ) |
| 54 | 23 | { |
| 55 | return nbmj9195_palette[offset]; | |
| 24 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 25 | return state->palette[offset]; | |
| 56 | 26 | } |
| 57 | 27 | |
| 58 | 28 | WRITE8_HANDLER( nbmj9195_palette_w ) |
| 59 | 29 | { |
| 30 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 60 | 31 | int r, g, b; |
| 61 | 32 | |
| 62 | | |
| 33 | state-> | |
| 63 | 34 | |
| 64 | 35 | if (offset & 1) |
| 65 | 36 | { |
| 66 | 37 | offset &= 0x1fe; |
| 67 | 38 | |
| 68 | r = ((nbmj9195_palette[offset + 0] & 0x0f) >> 0); | |
| 69 | g = ((nbmj9195_palette[offset + 0] & 0xf0) >> 4); | |
| 70 | b = ((nbmj9195_palette[offset + 1] & 0x0f) >> 0); | |
| 39 | r = ((state->palette[offset + 0] & 0x0f) >> 0); | |
| 40 | g = ((state->palette[offset + 0] & 0xf0) >> 4); | |
| 41 | b = ((state->palette[offset + 1] & 0x0f) >> 0); | |
| 71 | 42 | |
| 72 | 43 | palette_set_color_rgb(space->machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b)); |
| 73 | 44 | } |
| r10613 | r10614 | |
| 75 | 46 | |
| 76 | 47 | READ8_HANDLER( nbmj9195_nb22090_palette_r ) |
| 77 | 48 | { |
| 78 | return nbmj9195_nb22090_palette[offset]; | |
| 49 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 50 | return state->nb22090_palette[offset]; | |
| 79 | 51 | } |
| 80 | 52 | |
| 81 | 53 | WRITE8_HANDLER( nbmj9195_nb22090_palette_w ) |
| 82 | 54 | { |
| 55 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 83 | 56 | int r, g, b; |
| 84 | 57 | int offs_h, offs_l; |
| 85 | 58 | |
| 86 | | |
| 59 | state-> | |
| 87 | 60 | |
| 88 | 61 | offs_h = (offset / 0x0300); |
| 89 | 62 | offs_l = (offset & 0x00ff); |
| 90 | 63 | |
| 91 | r = nbmj9195_nb22090_palette[(0x000 + (offs_h * 0x300) + offs_l)]; | |
| 92 | g = nbmj9195_nb22090_palette[(0x100 + (offs_h * 0x300) + offs_l)]; | |
| 93 | b = nbmj9195_nb22090_palette[(0x200 + (offs_h * 0x300) + offs_l)]; | |
| 64 | r = state->nb22090_palette[(0x000 + (offs_h * 0x300) + offs_l)]; | |
| 65 | g = state->nb22090_palette[(0x100 + (offs_h * 0x300) + offs_l)]; | |
| 66 | b = state->nb22090_palette[(0x200 + (offs_h * 0x300) + offs_l)]; | |
| 94 | 67 | |
| 95 | 68 | palette_set_color(space->machine, ((offs_h * 0x100) + offs_l), MAKE_RGB(r, g, b)); |
| 96 | 69 | } |
| r10613 | r10614 | |
| 99 | 72 | |
| 100 | 73 | |
| 101 | 74 | ******************************************************************************/ |
| 102 | static int nbmj9195_blitter_r(r | |
| 75 | static int nbmj9195_blitter_r(address | |
| 103 | 76 | { |
| 77 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 104 | 78 | int ret; |
| 105 | UINT8 *GFXROM = machine->region("gfx1")->base(); | |
| 79 | UINT8 *GFXROM = space->machine->region("gfx1")->base(); | |
| 106 | 80 | |
| 107 | 81 | switch (offset) |
| 108 | 82 | { |
| 109 | case 0x00: ret = 0xfe | ((nb19010_busyflag & 0x01) ^ 0x01); break; // NB19010 Busy Flag | |
| 110 | case 0x01: ret = GFXROM[blitter_src_addr[vram]]; break; // NB19010 GFX-ROM Read | |
| 83 | case 0x00: ret = 0xfe | ((state->nb19010_busyflag & 0x01) ^ 0x01); break; // NB19010 Busy Flag | |
| 84 | case 0x01: ret = GFXROM[state->blitter_src_addr[vram]]; break; // NB19010 GFX-ROM Read | |
| 111 | 85 | default: ret = 0xff; break; |
| 112 | 86 | } |
| 113 | 87 | |
| 114 | 88 | return ret; |
| 115 | 89 | } |
| 116 | 90 | |
| 117 | static void nbmj9195_blitter_w(r | |
| 91 | static void nbmj9195_blitter_w(address | |
| 118 | 92 | { |
| 93 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 119 | 94 | int new_line; |
| 120 | 95 | |
| 121 | 96 | switch (offset) |
| 122 | 97 | { |
| 123 | case 0x00: blitter_direction_x[vram] = (data & 0x01) ? 1 : 0; | |
| 124 | blitter_direction_y[vram] = (data & 0x02) ? 1 : 0; | |
| 125 | nbmj9195_clutmode[vram] = (data & 0x04) ? 1 : 0; | |
| 98 | case 0x00: state->blitter_direction_x[vram] = (data & 0x01) ? 1 : 0; | |
| 99 | state->blitter_direction_y[vram] = (data & 0x02) ? 1 : 0; | |
| 100 | state->clutmode[vram] = (data & 0x04) ? 1 : 0; | |
| 126 | 101 | // if (data & 0x08) popmessage("Unknown GFX Flag!! (0x08)"); |
| 127 | | |
| 102 | state-> | |
| 128 | 103 | // if (data & 0x20) popmessage("Unknown GFX Flag!! (0x20)"); |
| 129 | nbmj9195_flipscreen[vram] = (data & 0x40) ? 0 : 1; | |
| 130 | nbmj9195_dispflag[vram] = (data & 0x80) ? 1 : 0; | |
| 131 | nbmj9195_vramflip(machine, vram); | |
| 104 | state->flipscreen[vram] = (data & 0x40) ? 0 : 1; | |
| 105 | state->dispflag[vram] = (data & 0x80) ? 1 : 0; | |
| 106 | nbmj9195_vramflip(space->machine, vram); | |
| 132 | 107 | break; |
| 133 | case 0x01: nbmj9195_scrollx[vram] = (nbmj9195_scrollx[vram] & 0x0100) | data; break; | |
| 134 | case 0x02: nbmj9195_scrollx[vram] = (nbmj9195_scrollx[vram] & 0x00ff) | ((data << 8) & 0x0100); | |
| 135 | new_line = machine->primary_screen->vpos(); | |
| 136 | if (nbmj9195_flipscreen[vram]) | |
| 108 | case 0x01: state->scrollx[vram] = (state->scrollx[vram] & 0x0100) | data; break; | |
| 109 | case 0x02: state->scrollx[vram] = (state->scrollx[vram] & 0x00ff) | ((data << 8) & 0x0100); | |
| 110 | new_line = space->machine->primary_screen->vpos(); | |
| 111 | if (state->flipscreen[vram]) | |
| 137 | 112 | { |
| 138 | for ( ; nbmj9195_scanline[vram] < new_line; nbmj9195_scanline[vram]++) | |
| 139 | nbmj9195_scrollx_raster[vram][nbmj9195_scanline[vram]] = (((-nbmj9195_scrollx[vram]) - 0x4e) & 0x1ff) << 1; | |
| 113 | for ( ; state->scanline[vram] < new_line; state->scanline[vram]++) | |
| 114 | state->scrollx_raster[vram][state->scanline[vram]] = (((-state->scrollx[vram]) - 0x4e) & 0x1ff) << 1; | |
| 140 | 115 | } |
| 141 | 116 | else |
| 142 | 117 | { |
| 143 | for ( ; nbmj9195_scanline[vram] < new_line; nbmj9195_scanline[vram]++) | |
| 144 | nbmj9195_scrollx_raster[vram][(nbmj9195_scanline[vram] ^ 0x1ff)] = (((-nbmj9195_scrollx[vram]) - 0x4e) & 0x1ff) << 1; | |
| 118 | for ( ; state->scanline[vram] < new_line; state->scanline[vram]++) | |
| 119 | state->scrollx_raster[vram][(state->scanline[vram] ^ 0x1ff)] = (((-state->scrollx[vram]) - 0x4e) & 0x1ff) << 1; | |
| 145 | 120 | } |
| 146 | 121 | break; |
| 147 | case 0x03: nbmj9195_scrolly[vram] = (nbmj9195_scrolly[vram] & 0x0100) | data; break; | |
| 148 | case 0x04: nbmj9195_scrolly[vram] = (nbmj9195_scrolly[vram] & 0x00ff) | ((data << 8) & 0x0100); break; | |
| 149 | case 0x05: blitter_src_addr[vram] = (blitter_src_addr[vram] & 0xffff00) | data; break; | |
| 150 | case 0x06: blitter_src_addr[vram] = (blitter_src_addr[vram] & 0xff00ff) | (data << 8); break; | |
| 151 | case 0x07: blitter_src_addr[vram] = (blitter_src_addr[vram] & 0x00ffff) | (data << 16); break; | |
| 152 | case 0x08: blitter_sizex[vram] = data; break; | |
| 153 | case 0x09: blitter_sizey[vram] = data; break; | |
| 154 | case 0x0a: blitter_destx[vram] = (blitter_destx[vram] & 0xff00) | data; break; | |
| 155 | case 0x0b: blitter_destx[vram] = (blitter_destx[vram] & 0x00ff) | (data << 8); break; | |
| 156 | case 0x0c: blitter_desty[vram] = (blitter_desty[vram] & 0xff00) | data; break; | |
| 157 | case 0x0d: blitter_desty[vram] = (blitter_desty[vram] & 0x00ff) | (data << 8); | |
| 158 | nbmj9195_gfxdraw(machine, vram); | |
| 122 | case 0x03: state->scrolly[vram] = (state->scrolly[vram] & 0x0100) | data; break; | |
| 123 | case 0x04: state->scrolly[vram] = (state->scrolly[vram] & 0x00ff) | ((data << 8) & 0x0100); break; | |
| 124 | case 0x05: state->blitter_src_addr[vram] = (state->blitter_src_addr[vram] & 0xffff00) | data; break; | |
| 125 | case 0x06: state->blitter_src_addr[vram] = (state->blitter_src_addr[vram] & 0xff00ff) | (data << 8); break; | |
| 126 | case 0x07: state->blitter_src_addr[vram] = (state->blitter_src_addr[vram] & 0x00ffff) | (data << 16); break; | |
| 127 | case 0x08: state->blitter_sizex[vram] = data; break; | |
| 128 | case 0x09: state->blitter_sizey[vram] = data; break; | |
| 129 | case 0x0a: state->blitter_destx[vram] = (state->blitter_destx[vram] & 0xff00) | data; break; | |
| 130 | case 0x0b: state->blitter_destx[vram] = (state->blitter_destx[vram] & 0x00ff) | (data << 8); break; | |
| 131 | case 0x0c: state->blitter_desty[vram] = (state->blitter_desty[vram] & 0xff00) | data; break; | |
| 132 | case 0x0d: state->blitter_desty[vram] = (state->blitter_desty[vram] & 0x00ff) | (data << 8); | |
| 133 | nbmj9195_gfxdraw(space->machine, vram); | |
| 159 | 134 | break; |
| 160 | 135 | default: break; |
| 161 | 136 | } |
| 162 | 137 | } |
| 163 | 138 | |
| 164 | void nbmj9195_clutsel_w(int data) | |
| 139 | void nbmj9195_clutsel_w(address_space *space, int data) | |
| 165 | 140 | { |
| 166 | nbmj9195_clutsel = data; | |
| 141 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 142 | state->clutsel = data; | |
| 167 | 143 | } |
| 168 | 144 | |
| 169 | static void nbmj9195_clut_w( | |
| 145 | static void nbmj9195_clut_w(add | |
| 170 | 146 | { |
| 171 | nbmj9195_clut[vram][((nbmj9195_clutsel & 0xff) * 0x10) + (offset & 0x0f)] = data; | |
| 147 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 148 | state->clut[vram][((state->clutsel & 0xff) * 0x10) + (offset & 0x0f)] = data; | |
| 172 | 149 | } |
| 173 | 150 | |
| 174 | void nbmj9195_gfxflag2_w(int data) | |
| 151 | void nbmj9195_gfxflag2_w(address_space *space, int data) | |
| 175 | 152 | { |
| 176 | nbmj9195_gfxflag2 = data; | |
| 153 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 154 | state->gfxflag2 = data; | |
| 177 | 155 | } |
| 178 | 156 | |
| 179 | 157 | /****************************************************************************** |
| r10613 | r10614 | |
| 182 | 160 | ******************************************************************************/ |
| 183 | 161 | static void nbmj9195_vramflip(running_machine *machine, int vram) |
| 184 | 162 | { |
| 185 | stat | |
| 163 | nbmj9195_state | |
| 186 | 164 | int x, y; |
| 187 | 165 | UINT16 color1, color2; |
| 188 | 166 | int width = machine->primary_screen->width(); |
| 189 | 167 | int height = machine->primary_screen->height(); |
| 190 | 168 | |
| 191 | if ( | |
| 169 | if (state-> | |
| 192 | 170 | |
| 193 | 171 | for (y = 0; y < (height / 2); y++) |
| 194 | 172 | { |
| 195 | 173 | for (x = 0; x < width; x++) |
| 196 | 174 | { |
| 197 | color1 = nbmj9195_videoram[vram][(y * width) + x]; | |
| 198 | color2 = nbmj9195_videoram[vram][((y ^ 0x1ff) * width) + (x ^ 0x3ff)]; | |
| 199 | nbmj9195_videoram[vram][(y * width) + x] = color2; | |
| 200 | nbmj9195_videoram[vram][((y ^ 0x1ff) * width) + (x ^ 0x3ff)] = color1; | |
| 175 | color1 = state->videoram[vram][(y * width) + x]; | |
| 176 | color2 = state->videoram[vram][((y ^ 0x1ff) * width) + (x ^ 0x3ff)]; | |
| 177 | state->videoram[vram][(y * width) + x] = color2; | |
| 178 | state->videoram[vram][((y ^ 0x1ff) * width) + (x ^ 0x3ff)] = color1; | |
| 201 | 179 | } |
| 202 | 180 | } |
| 203 | 181 | |
| 204 | if (gfxdraw_mode == 2) | |
| 182 | if (state->gfxdraw_mode == 2) | |
| 205 | 183 | { |
| 206 | 184 | for (y = 0; y < (height / 2); y++) |
| 207 | 185 | { |
| 208 | 186 | for (x = 0; x < width; x++) |
| 209 | 187 | { |
| 210 | color1 = nbmj9195_videoworkram[vram][(y * width) + x]; | |
| 211 | color2 = nbmj9195_videoworkram[vram][((y ^ 0x1ff) * width) + (x ^ 0x3ff)]; | |
| 212 | nbmj9195_videoworkram[vram][(y * width) + x] = color2; | |
| 213 | nbmj9195_videoworkram[vram][((y ^ 0x1ff) * width) + (x ^ 0x3ff)] = color1; | |
| 188 | color1 = state->videoworkram[vram][(y * width) + x]; | |
| 189 | color2 = state->videoworkram[vram][((y ^ 0x1ff) * width) + (x ^ 0x3ff)]; | |
| 190 | state->videoworkram[vram][(y * width) + x] = color2; | |
| 191 | state->videoworkram[vram][((y ^ 0x1ff) * width) + (x ^ 0x3ff)] = color1; | |
| 214 | 192 | } |
| 215 | 193 | } |
| 216 | 194 | } |
| 217 | 195 | |
| 218 | nbmj9195_flipscreen_old[vram] = nbmj9195_flipscreen[vram]; | |
| 219 | nbmj9195_screen_refresh = 1; | |
| 196 | state->flipscreen_old[vram] = state->flipscreen[vram]; | |
| 197 | state->screen_refresh = 1; | |
| 220 | 198 | } |
| 221 | 199 | |
| 222 | 200 | static void update_pixel(running_machine *machine, int vram, int x, int y) |
| 223 | 201 | { |
| 224 | UINT16 color = nbmj9195_videoram[vram][(y * machine->primary_screen->width()) + x]; | |
| 225 | *BITMAP_ADDR16(nbmj9195_tmpbitmap[vram], y, x) = color; | |
| 202 | nbmj9195_state *state = machine->driver_data<nbmj9195_state>(); | |
| 203 | UINT16 color = state->videoram[vram][(y * machine->primary_screen->width()) + x]; | |
| 204 | *BITMAP_ADDR16(state->tmpbitmap[vram], y, x) = color; | |
| 226 | 205 | } |
| 227 | 206 | |
| 228 | 207 | static TIMER_CALLBACK( blitter_timer_callback ) |
| 229 | 208 | { |
| 230 | nb19010_busyflag = 1; | |
| 209 | nbmj9195_state *state = machine->driver_data<nbmj9195_state>(); | |
| 210 | state->nb19010_busyflag = 1; | |
| 231 | 211 | } |
| 232 | 212 | |
| 233 | 213 | static void nbmj9195_gfxdraw(running_machine *machine, int vram) |
| 234 | 214 | { |
| 215 | nbmj9195_state *state = machine->driver_data<nbmj9195_state>(); | |
| 235 | 216 | UINT8 *GFX = machine->region("gfx1")->base(); |
| 236 | 217 | int width = machine->primary_screen->width(); |
| 237 | 218 | |
| r10613 | r10614 | |
| 244 | 225 | UINT16 color, color1, color2; |
| 245 | 226 | int gfxaddr, gfxlen; |
| 246 | 227 | |
| 247 | nb19010_busyctr = 0; | |
| 228 | state->nb19010_busyctr = 0; | |
| 248 | 229 | |
| 249 | if ((gfxdraw_mode == 2) && ( | |
| 230 | if ((state->gfxdraw_mode == 2) && (state-> | |
| 250 | 231 | { |
| 251 | 232 | // NB22090 clut256 mode |
| 252 | blitter_sizex[vram] = GFX[((blitter_src_addr[vram] + 0) & 0x00ffffff)]; | |
| 253 | blitter_sizey[vram] = GFX[((blitter_src_addr[vram] + 1) & 0x00ffffff)]; | |
| 233 | state->blitter_sizex[vram] = GFX[((state->blitter_src_addr[vram] + 0) & 0x00ffffff)]; | |
| 234 | state->blitter_sizey[vram] = GFX[((state->blitter_src_addr[vram] + 1) & 0x00ffffff)]; | |
| 254 | 235 | } |
| 255 | 236 | |
| 256 | if (blitter_direction_x[vram]) | |
| 237 | if (state->blitter_direction_x[vram]) | |
| 257 | 238 | { |
| 258 | startx = blitter_destx[vram]; | |
| 259 | sizex = blitter_sizex[vram]; | |
| 239 | startx = state->blitter_destx[vram]; | |
| 240 | sizex = state->blitter_sizex[vram]; | |
| 260 | 241 | skipx = 1; |
| 261 | 242 | } |
| 262 | 243 | else |
| 263 | 244 | { |
| 264 | startx = blitter_destx[vram] + blitter_sizex[vram]; | |
| 265 | sizex = blitter_sizex[vram]; | |
| 245 | startx = state->blitter_destx[vram] + state->blitter_sizex[vram]; | |
| 246 | sizex = state->blitter_sizex[vram]; | |
| 266 | 247 | skipx = -1; |
| 267 | 248 | } |
| 268 | 249 | |
| 269 | if (blitter_direction_y[vram]) | |
| 250 | if (state->blitter_direction_y[vram]) | |
| 270 | 251 | { |
| 271 | starty = blitter_desty[vram]; | |
| 272 | sizey = blitter_sizey[vram]; | |
| 252 | starty = state->blitter_desty[vram]; | |
| 253 | sizey = state->blitter_sizey[vram]; | |
| 273 | 254 | skipy = 1; |
| 274 | 255 | } |
| 275 | 256 | else |
| 276 | 257 | { |
| 277 | starty = blitter_desty[vram] + blitter_sizey[vram]; | |
| 278 | sizey = blitter_sizey[vram]; | |
| 258 | starty = state->blitter_desty[vram] + state->blitter_sizey[vram]; | |
| 259 | sizey = state->blitter_sizey[vram]; | |
| 279 | 260 | skipy = -1; |
| 280 | 261 | } |
| 281 | 262 | |
| 282 | 263 | gfxlen = machine->region("gfx1")->bytes(); |
| 283 | gfxaddr = ((blitter_src_addr[vram] + 2) & 0x00ffffff); | |
| 264 | gfxaddr = ((state->blitter_src_addr[vram] + 2) & 0x00ffffff); | |
| 284 | 265 | |
| 285 | 266 | for (y = starty, ctry = sizey; ctry >= 0; y += skipy, ctry--) |
| 286 | 267 | { |
| r10613 | r10614 | |
| 301 | 282 | dx2 = (2 * x + 1) & 0x3ff; |
| 302 | 283 | dy = y & 0x1ff; |
| 303 | 284 | |
| 304 | if (! | |
| 285 | if (!state-> | |
| 305 | 286 | { |
| 306 | 287 | dx1 ^= 0x3ff; |
| 307 | 288 | dx2 ^= 0x3ff; |
| 308 | 289 | dy ^= 0x1ff; |
| 309 | 290 | } |
| 310 | 291 | |
| 311 | if (blitter_direction_x[vram]) | |
| 292 | if (state->blitter_direction_x[vram]) | |
| 312 | 293 | { |
| 313 | 294 | // flip |
| 314 | 295 | color1 = (color & 0x0f) >> 0; |
| r10613 | r10614 | |
| 321 | 302 | color2 = (color & 0x0f) >> 0; |
| 322 | 303 | } |
| 323 | 304 | |
| 324 | if ((gfxdraw_mode == 2) && ( | |
| 305 | if ((state->gfxdraw_mode == 2) && (state-> | |
| 325 | 306 | { |
| 326 | 307 | // clut256 mode |
| 327 | 308 | |
| 328 | if ( | |
| 309 | if (state-> | |
| 329 | 310 | { |
| 330 | 311 | // clut256 mode 1st(low) |
| 331 | nbmj9195_videoworkram[vram][(dy * width) + dx1] &= 0x00f0; | |
| 332 | nbmj9195_videoworkram[vram][(dy * width) + dx1] |= color1 & 0x0f; | |
| 333 | nbmj9195_videoworkram[vram][(dy * width) + dx2] &= 0x00f0; | |
| 334 | nbmj9195_videoworkram[vram][(dy * width) + dx2] |= color2 & 0x0f; | |
| 312 | state->videoworkram[vram][(dy * width) + dx1] &= 0x00f0; | |
| 313 | state->videoworkram[vram][(dy * width) + dx1] |= color1 & 0x0f; | |
| 314 | state->videoworkram[vram][(dy * width) + dx2] &= 0x00f0; | |
| 315 | state->videoworkram[vram][(dy * width) + dx2] |= color2 & 0x0f; | |
| 335 | 316 | |
| 336 | 317 | continue; |
| 337 | 318 | } |
| 338 | 319 | else |
| 339 | 320 | { |
| 340 | 321 | // clut256 mode 2nd(high) |
| 341 | nbmj9195_videoworkram[vram][(dy * width) + dx1] &= 0x000f; | |
| 342 | nbmj9195_videoworkram[vram][(dy * width) + dx1] |= (color1 & 0x0f) << 4; | |
| 343 | nbmj9195_videoworkram[vram][(dy * width) + dx2] &= 0x000f; | |
| 344 | nbmj9195_videoworkram[vram][(dy * width) + dx2] |= (color2 & 0x0f) << 4; | |
| 322 | state->videoworkram[vram][(dy * width) + dx1] &= 0x000f; | |
| 323 | state->videoworkram[vram][(dy * width) + dx1] |= (color1 & 0x0f) << 4; | |
| 324 | state->videoworkram[vram][(dy * width) + dx2] &= 0x000f; | |
| 325 | state->videoworkram[vram][(dy * width) + dx2] |= (color2 & 0x0f) << 4; | |
| 345 | 326 | |
| 346 | nbmj9195_videoworkram[vram][(dy * width) + dx1] += nbmj9195_clut[vram][(nbmj9195_clutsel * 0x10)]; | |
| 347 | nbmj9195_videoworkram[vram][(dy * width) + dx2] += nbmj9195_clut[vram][(nbmj9195_clutsel * 0x10)]; | |
| 327 | state->videoworkram[vram][(dy * width) + dx1] += state->clut[vram][(state->clutsel * 0x10)]; | |
| 328 | state->videoworkram[vram][(dy * width) + dx2] += state->clut[vram][(state->clutsel * 0x10)]; | |
| 348 | 329 | } |
| 349 | 330 | |
| 350 | color1 = nbmj9195_videoworkram[vram][(dy * width) + dx1]; | |
| 351 | color2 = nbmj9195_videoworkram[vram][(dy * width) + dx2]; | |
| 331 | color1 = state->videoworkram[vram][(dy * width) + dx1]; | |
| 332 | color2 = state->videoworkram[vram][(dy * width) + dx2]; | |
| 352 | 333 | } |
| 353 | 334 | else |
| 354 | 335 | { |
| 355 | 336 | // clut16 mode |
| 356 | color1 = nbmj9195_clut[vram][(nbmj9195_clutsel * 0x10) + color1]; | |
| 357 | color2 = nbmj9195_clut[vram][(nbmj9195_clutsel * 0x10) + color2]; | |
| 337 | color1 = state->clut[vram][(state->clutsel * 0x10) + color1]; | |
| 338 | color2 = state->clut[vram][(state->clutsel * 0x10) + color2]; | |
| 358 | 339 | } |
| 359 | 340 | |
| 360 | if (gfxdraw_mode == 2) | |
| 341 | if (state->gfxdraw_mode == 2) | |
| 361 | 342 | { |
| 362 | 343 | color1 |= (0x0100 * vram); |
| 363 | 344 | color2 |= (0x0100 * vram); |
| 364 | 345 | } |
| 365 | 346 | |
| 366 | if (((color1 & 0x00ff) != 0x00ff) || (! | |
| 347 | if (((color1 & 0x00ff) != 0x00ff) || (!state-> | |
| 367 | 348 | { |
| 368 | | |
| 349 | state-> | |
| 369 | 350 | update_pixel(machine, vram, dx1, dy); |
| 370 | 351 | } |
| 371 | if (((color2 & 0x00ff) != 0x00ff) || (! | |
| 352 | if (((color2 & 0x00ff) != 0x00ff) || (!state-> | |
| 372 | 353 | { |
| 373 | | |
| 354 | state-> | |
| 374 | 355 | update_pixel(machine, vram, dx2, dy); |
| 375 | 356 | } |
| 376 | 357 | |
| 377 | nb19010_busyctr++; | |
| 358 | state->nb19010_busyctr++; | |
| 378 | 359 | } |
| 379 | 360 | } |
| 380 | 361 | |
| 381 | if ((gfxdraw_mode == 2) && ( | |
| 362 | if ((state->gfxdraw_mode == 2) && (state-> | |
| 382 | 363 | { |
| 383 | 364 | // NB22090 clut256 mode |
| 384 | blitter_src_addr[vram] = gfxaddr; | |
| 365 | state->blitter_src_addr[vram] = gfxaddr; | |
| 385 | 366 | } |
| 386 | 367 | |
| 387 | nb19010_busyflag = 0; | |
| 368 | state->nb19010_busyflag = 0; | |
| 388 | 369 | |
| 389 | 370 | /* 1650ns per count */ |
| 390 | machine->scheduler().timer_set(attotime::from_nsec(nb19010_busyctr * 1650), FUNC(blitter_timer_callback)); | |
| 371 | machine->scheduler().timer_set(attotime::from_nsec(state->nb19010_busyctr * 1650), FUNC(blitter_timer_callback)); | |
| 391 | 372 | } |
| 392 | 373 | |
| 393 | 374 | /****************************************************************************** |
| 394 | 375 | |
| 395 | 376 | |
| 396 | 377 | ******************************************************************************/ |
| 397 | WRITE8_HANDLER( nbmj9195_blitter_0_w ) { nbmj9195_blitter_w(space->machine, 0, offset, data); } | |
| 398 | WRITE8_HANDLER( nbmj9195_blitter_1_w ) { nbmj9195_blitter_w(space->machine, 1, offset, data); } | |
| 378 | WRITE8_HANDLER( nbmj9195_blitter_0_w ) { nbmj9195_blitter_w(space, offset, data, 0); } | |
| 379 | WRITE8_HANDLER( nbmj9195_blitter_1_w ) { nbmj9195_blitter_w(space, offset, data, 1); } | |
| 399 | 380 | |
| 400 | READ8_HANDLER( nbmj9195_blitter_0_r ) { return nbmj9195_blitter_r(space->machine, 0, offset); } | |
| 401 | READ8_HANDLER( nbmj9195_blitter_1_r ) { return nbmj9195_blitter_r(space->machine, 1, offset); } | |
| 381 | READ8_HANDLER( nbmj9195_blitter_0_r ) { return nbmj9195_blitter_r(space, offset, 0); } | |
| 382 | READ8_HANDLER( nbmj9195_blitter_1_r ) { return nbmj9195_blitter_r(space, offset, 1); } | |
| 402 | 383 | |
| 403 | WRITE8_HANDLER( nbmj9195_clut_0_w ) { nbmj9195_clut_w(0, offset, data); } | |
| 404 | WRITE8_HANDLER( nbmj9195_clut_1_w ) { nbmj9195_clut_w(1, offset, data); } | |
| 384 | WRITE8_HANDLER( nbmj9195_clut_0_w ) { nbmj9195_clut_w(space, offset, data, 0); } | |
| 385 | WRITE8_HANDLER( nbmj9195_clut_1_w ) { nbmj9195_clut_w(space, offset, data, 1); } | |
| 405 | 386 | |
| 406 | 387 | /****************************************************************************** |
| 407 | 388 | |
| r10613 | r10614 | |
| 409 | 390 | ******************************************************************************/ |
| 410 | 391 | VIDEO_START( nbmj9195_1layer ) |
| 411 | 392 | { |
| 393 | nbmj9195_state *state = machine->driver_data<nbmj9195_state>(); | |
| 412 | 394 | int width = machine->primary_screen->width(); |
| 413 | 395 | int height = machine->primary_screen->height(); |
| 414 | 396 | |
| 415 | nbmj9195_tmpbitmap[0] = machine->primary_screen->alloc_compatible_bitmap(); | |
| 416 | nbmj9195_videoram[0] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 417 | nbmj9195_palette = auto_alloc_array(machine, UINT8, 0x200); | |
| 418 | nbmj9195_clut[0] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 419 | nbmj9195_scanline[0] = nbmj9195_scanline[1] = SCANLINE_MIN; | |
| 420 | nb19010_busyflag = 1; | |
| 421 | gfxdraw_mode = 0; | |
| 397 | state->tmpbitmap[0] = machine->primary_screen->alloc_compatible_bitmap(); | |
| 398 | state->videoram[0] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 399 | state->palette = auto_alloc_array(machine, UINT8, 0x200); | |
| 400 | state->clut[0] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 401 | state->scanline[0] = state->scanline[1] = SCANLINE_MIN; | |
| 402 | state->nb19010_busyflag = 1; | |
| 403 | state->gfxdraw_mode = 0; | |
| 422 | 404 | } |
| 423 | 405 | |
| 424 | 406 | VIDEO_START( nbmj9195_2layer ) |
| 425 | 407 | { |
| 408 | nbmj9195_state *state = machine->driver_data<nbmj9195_state>(); | |
| 426 | 409 | int width = machine->primary_screen->width(); |
| 427 | 410 | int height = machine->primary_screen->height(); |
| 428 | 411 | |
| 429 | nbmj9195_tmpbitmap[0] = machine->primary_screen->alloc_compatible_bitmap(); | |
| 430 | nbmj9195_tmpbitmap[1] = machine->primary_screen->alloc_compatible_bitmap(); | |
| 431 | nbmj9195_videoram[0] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 432 | nbmj9195_videoram[1] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 433 | nbmj9195_palette = auto_alloc_array(machine, UINT8, 0x200); | |
| 434 | nbmj9195_clut[0] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 435 | nbmj9195_clut[1] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 436 | nbmj9195_scanline[0] = nbmj9195_scanline[1] = SCANLINE_MIN; | |
| 437 | nb19010_busyflag = 1; | |
| 438 | gfxdraw_mode = 1; | |
| 412 | state->tmpbitmap[0] = machine->primary_screen->alloc_compatible_bitmap(); | |
| 413 | state->tmpbitmap[1] = machine->primary_screen->alloc_compatible_bitmap(); | |
| 414 | state->videoram[0] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 415 | state->videoram[1] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 416 | state->palette = auto_alloc_array(machine, UINT8, 0x200); | |
| 417 | state->clut[0] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 418 | state->clut[1] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 419 | state->scanline[0] = state->scanline[1] = SCANLINE_MIN; | |
| 420 | state->nb19010_busyflag = 1; | |
| 421 | state->gfxdraw_mode = 1; | |
| 439 | 422 | } |
| 440 | 423 | |
| 441 | 424 | VIDEO_START( nbmj9195_nb22090 ) |
| 442 | 425 | { |
| 426 | nbmj9195_state *state = machine->driver_data<nbmj9195_state>(); | |
| 443 | 427 | int width = machine->primary_screen->width(); |
| 444 | 428 | int height = machine->primary_screen->height(); |
| 445 | 429 | |
| 446 | nbmj9195_tmpbitmap[0] = machine->primary_screen->alloc_compatible_bitmap(); | |
| 447 | nbmj9195_tmpbitmap[1] = machine->primary_screen->alloc_compatible_bitmap(); | |
| 448 | nbmj9195_videoram[0] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 449 | nbmj9195_videoram[1] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 450 | nbmj9195_videoworkram[0] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 451 | nbmj9195_videoworkram[1] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 452 | nbmj9195_nb22090_palette = auto_alloc_array(machine, UINT8, 0xc00); | |
| 453 | nbmj9195_clut[0] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 454 | nbmj9195_clut[1] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 455 | nbmj9195_scanline[0] = nbmj9195_scanline[1] = SCANLINE_MIN; | |
| 456 | nb19010_busyflag = 1; | |
| 457 | gfxdraw_mode = 2; | |
| 430 | state->tmpbitmap[0] = machine->primary_screen->alloc_compatible_bitmap(); | |
| 431 | state->tmpbitmap[1] = machine->primary_screen->alloc_compatible_bitmap(); | |
| 432 | state->videoram[0] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 433 | state->videoram[1] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 434 | state->videoworkram[0] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 435 | state->videoworkram[1] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 436 | state->nb22090_palette = auto_alloc_array(machine, UINT8, 0xc00); | |
| 437 | state->clut[0] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 438 | state->clut[1] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 439 | state->scanline[0] = state->scanline[1] = SCANLINE_MIN; | |
| 440 | state->nb19010_busyflag = 1; | |
| 441 | state->gfxdraw_mode = 2; | |
| 458 | 442 | } |
| 459 | 443 | |
| 460 | 444 | /****************************************************************************** |
| r10613 | r10614 | |
| 463 | 447 | ******************************************************************************/ |
| 464 | 448 | SCREEN_UPDATE( nbmj9195 ) |
| 465 | 449 | { |
| 450 | nbmj9195_state *state = screen->machine->driver_data<nbmj9195_state>(); | |
| 466 | 451 | int i; |
| 467 | 452 | int x, y; |
| 468 | 453 | int scrolly[2]; |
| 469 | 454 | |
| 470 | if ( | |
| 455 | if (state-> | |
| 471 | 456 | { |
| 472 | 457 | int width = screen->width(); |
| 473 | 458 | int height = screen->height(); |
| 474 | 459 | |
| 475 | | |
| 460 | state-> | |
| 476 | 461 | |
| 477 | 462 | for (y = 0; y < height; y++) |
| 478 | 463 | for (x = 0; x < width; x++) |
| 479 | 464 | { |
| 480 | 465 | update_pixel(screen->machine, 0, x, y); |
| 481 | 466 | |
| 482 | if (gfxdraw_mode) | |
| 467 | if (state->gfxdraw_mode) | |
| 483 | 468 | update_pixel(screen->machine, 1, x, y); |
| 484 | 469 | } |
| 485 | 470 | } |
| 486 | 471 | |
| 487 | 472 | for (i = 0; i < 2; i++) |
| 488 | 473 | { |
| 489 | if ( | |
| 474 | if (state-> | |
| 490 | 475 | { |
| 491 | for ( ; | |
| 476 | for ( ; | |
| 492 | 477 | { |
| 493 | | |
| 478 | | |
| 494 | 479 | } |
| 495 | scrolly[i] = (- | |
| 480 | scrolly[i] = (-state-> | |
| 496 | 481 | } |
| 497 | 482 | else |
| 498 | 483 | { |
| 499 | for ( ; | |
| 484 | for ( ; | |
| 500 | 485 | { |
| 501 | | |
| 486 | | |
| 502 | 487 | } |
| 503 | scrolly[i] = | |
| 488 | scrolly[i] = state-> | |
| 504 | 489 | } |
| 505 | | |
| 490 | state-> | |
| 506 | 491 | } |
| 507 | 492 | |
| 508 | if ( | |
| 493 | if (state-> | |
| 509 | 494 | // nbmj9195 1layer |
| 510 | copyscrollbitmap(bitmap, | |
| 495 | copyscrollbitmap(bitmap, s | |
| 511 | 496 | else |
| 512 | 497 | bitmap_fill(bitmap, 0, 0x0ff); |
| 513 | 498 | |
| 514 | if ( | |
| 499 | if (state-> | |
| 515 | 500 | { |
| 516 | if (gfxdraw_mode == 1) | |
| 501 | if (state->gfxdraw_mode == 1) | |
| 517 | 502 | // nbmj9195 2layer |
| 518 | copyscrollbitmap_trans(bitmap, | |
| 503 | copyscrollbitmap_trans(bitmap, s | |
| 519 | 504 | |
| 520 | if (gfxdraw_mode == 2) | |
| 505 | if (state->gfxdraw_mode == 2) | |
| 521 | 506 | // nbmj9195 nb22090 2layer |
| 522 | copyscrollbitmap_trans(bitmap, | |
| 507 | copyscrollbitmap_trans(bitmap, s | |
| 523 | 508 | } |
| 524 | 509 | return 0; |
| 525 | 510 | } |
| r10613 | r10614 | |
|---|---|---|
| 10 | 10 | #include "includes/niyanpai.h" |
| 11 | 11 | |
| 12 | 12 | |
| 13 | #define VRAM_MAX 3 | |
| 14 | ||
| 15 | ||
| 16 | static int niyanpai_scrollx[VRAM_MAX], niyanpai_scrolly[VRAM_MAX]; | |
| 17 | static int blitter_destx[VRAM_MAX], blitter_desty[VRAM_MAX]; | |
| 18 | static int blitter_sizex[VRAM_MAX], blitter_sizey[VRAM_MAX]; | |
| 19 | static int blitter_src_addr[VRAM_MAX]; | |
| 20 | static int blitter_direction_x[VRAM_MAX], blitter_direction_y[VRAM_MAX]; | |
| 21 | static int niyanpai_dispflag[VRAM_MAX]; | |
| 22 | static int niyanpai_flipscreen[VRAM_MAX]; | |
| 23 | static int niyanpai_clutmode[VRAM_MAX]; | |
| 24 | static int niyanpai_transparency[VRAM_MAX]; | |
| 25 | static int niyanpai_clutsel[VRAM_MAX]; | |
| 26 | static int niyanpai_screen_refresh; | |
| 27 | static int nb19010_busyctr; | |
| 28 | static int nb19010_busyflag; | |
| 29 | ||
| 30 | static bitmap_t *niyanpai_tmpbitmap[VRAM_MAX]; | |
| 31 | static UINT16 *niyanpai_videoram[VRAM_MAX]; | |
| 32 | static UINT16 *niyanpai_videoworkram[VRAM_MAX]; | |
| 33 | static UINT16 *niyanpai_palette; | |
| 34 | static UINT8 *niyanpai_clut[VRAM_MAX]; | |
| 35 | ||
| 36 | ||
| 37 | 13 | static void niyanpai_vramflip(running_machine *machine, int vram); |
| 38 | 14 | static void niyanpai_gfxdraw(running_machine *machine, int vram); |
| 39 | 15 | |
| r10613 | r10614 | |
| 44 | 20 | ******************************************************************************/ |
| 45 | 21 | READ16_HANDLER( niyanpai_palette_r ) |
| 46 | 22 | { |
| 47 | return niyanpai_palette[offset]; | |
| 23 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 24 | return state->palette[offset]; | |
| 48 | 25 | } |
| 49 | 26 | |
| 50 | 27 | WRITE16_HANDLER( niyanpai_palette_w ) |
| 51 | 28 | { |
| 29 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 52 | 30 | int r, g, b; |
| 53 | 31 | int offs_h, offs_l; |
| 54 | UINT16 oldword = | |
| 32 | UINT16 oldword = st | |
| 55 | 33 | UINT16 newword; |
| 56 | 34 | |
| 57 | COMBINE_DATA(&niyanpai_palette[offset]); | |
| 58 | newword = niyanpai_palette[offset]; | |
| 35 | COMBINE_DATA(&state->palette[offset]); | |
| 36 | newword = state->palette[offset]; | |
| 59 | 37 | |
| 60 | 38 | if (oldword != newword) |
| 61 | 39 | { |
| r10613 | r10614 | |
| 64 | 42 | |
| 65 | 43 | if (ACCESSING_BITS_8_15) |
| 66 | 44 | { |
| 67 | r = ((niyanpai_palette[(0x000 + (offs_h * 0x180) + offs_l)] & 0xff00) >> 8); | |
| 68 | g = ((niyanpai_palette[(0x080 + (offs_h * 0x180) + offs_l)] & 0xff00) >> 8); | |
| 69 | b = ((niyanpai_palette[(0x100 + (offs_h * 0x180) + offs_l)] & 0xff00) >> 8); | |
| 45 | r = ((state->palette[(0x000 + (offs_h * 0x180) + offs_l)] & 0xff00) >> 8); | |
| 46 | g = ((state->palette[(0x080 + (offs_h * 0x180) + offs_l)] & 0xff00) >> 8); | |
| 47 | b = ((state->palette[(0x100 + (offs_h * 0x180) + offs_l)] & 0xff00) >> 8); | |
| 70 | 48 | |
| 71 | 49 | palette_set_color(space->machine, ((offs_h << 8) + (offs_l << 1) + 0), MAKE_RGB(r, g, b)); |
| 72 | 50 | } |
| 73 | 51 | |
| 74 | 52 | if (ACCESSING_BITS_0_7) |
| 75 | 53 | { |
| 76 | r = ((niyanpai_palette[(0x000 + (offs_h * 0x180) + offs_l)] & 0x00ff) >> 0); | |
| 77 | g = ((niyanpai_palette[(0x080 + (offs_h * 0x180) + offs_l)] & 0x00ff) >> 0); | |
| 78 | b = ((niyanpai_palette[(0x100 + (offs_h * 0x180) + offs_l)] & 0x00ff) >> 0); | |
| 54 | r = ((state->palette[(0x000 + (offs_h * 0x180) + offs_l)] & 0x00ff) >> 0); | |
| 55 | g = ((state->palette[(0x080 + (offs_h * 0x180) + offs_l)] & 0x00ff) >> 0); | |
| 56 | b = ((state->palette[(0x100 + (offs_h * 0x180) + offs_l)] & 0x00ff) >> 0); | |
| 79 | 57 | |
| 80 | 58 | palette_set_color(space->machine, ((offs_h << 8) + (offs_l << 1) + 1), MAKE_RGB(r, g, b)); |
| 81 | 59 | } |
| r10613 | r10614 | |
| 88 | 66 | ******************************************************************************/ |
| 89 | 67 | static int niyanpai_blitter_r(running_machine *machine, int vram, int offset) |
| 90 | 68 | { |
| 69 | niyanpai_state *state = machine->driver_data<niyanpai_state>(); | |
| 91 | 70 | int ret; |
| 92 | 71 | UINT8 *GFXROM = machine->region("gfx1")->base(); |
| 93 | 72 | |
| 94 | 73 | switch (offset) |
| 95 | 74 | { |
| 96 | case 0x00: ret = 0xfe | ((nb19010_busyflag & 0x01) ^ 0x01); break; // NB19010 Busy Flag | |
| 97 | case 0x01: ret = GFXROM[blitter_src_addr[vram]]; break; // NB19010 GFX-ROM Read | |
| 75 | case 0x00: ret = 0xfe | ((state->nb19010_busyflag & 0x01) ^ 0x01); break; // NB19010 Busy Flag | |
| 76 | case 0x01: ret = GFXROM[state->blitter_src_addr[vram]]; break; // NB19010 GFX-ROM Read | |
| 98 | 77 | default: ret = 0xff; break; |
| 99 | 78 | } |
| 100 | 79 | |
| r10613 | r10614 | |
| 103 | 82 | |
| 104 | 83 | static void niyanpai_blitter_w(running_machine *machine, int vram, int offset, int data) |
| 105 | 84 | { |
| 85 | niyanpai_state *state = machine->driver_data<niyanpai_state>(); | |
| 106 | 86 | switch (offset) |
| 107 | 87 | { |
| 108 | case 0x00: blitter_direction_x[vram] = (data & 0x01) ? 1 : 0; | |
| 109 | blitter_direction_y[vram] = (data & 0x02) ? 1 : 0; | |
| 110 | niyanpai_clutmode[vram] = (data & 0x04) ? 1 : 0; | |
| 88 | case 0x00: state->blitter_direction_x[vram] = (data & 0x01) ? 1 : 0; | |
| 89 | state->blitter_direction_y[vram] = (data & 0x02) ? 1 : 0; | |
| 90 | state->clutmode[vram] = (data & 0x04) ? 1 : 0; | |
| 111 | 91 | // if (data & 0x08) popmessage("Unknown GFX Flag!! (0x08)"); |
| 112 | | |
| 92 | st | |
| 113 | 93 | // if (data & 0x20) popmessage("Unknown GFX Flag!! (0x20)"); |
| 114 | niyanpai_flipscreen[vram] = (data & 0x40) ? 0 : 1; | |
| 115 | niyanpai_dispflag[vram] = (data & 0x80) ? 1 : 0; | |
| 94 | state->flipscreen[vram] = (data & 0x40) ? 0 : 1; | |
| 95 | state->dispflag[vram] = (data & 0x80) ? 1 : 0; | |
| 116 | 96 | niyanpai_vramflip(machine, vram); |
| 117 | 97 | break; |
| 118 | case 0x01: niyanpai_scrollx[vram] = (niyanpai_scrollx[vram] & 0x0100) | data; break; | |
| 119 | case 0x02: niyanpai_scrollx[vram] = (niyanpai_scrollx[vram] & 0x00ff) | ((data << 8) & 0x0100); break; | |
| 120 | case 0x03: niyanpai_scrolly[vram] = (niyanpai_scrolly[vram] & 0x0100) | data; break; | |
| 121 | case 0x04: niyanpai_scrolly[vram] = (niyanpai_scrolly[vram] & 0x00ff) | ((data << 8) & 0x0100); break; | |
| 122 | case 0x05: blitter_src_addr[vram] = (blitter_src_addr[vram] & 0xffff00) | data; break; | |
| 123 | case 0x06: blitter_src_addr[vram] = (blitter_src_addr[vram] & 0xff00ff) | (data << 8); break; | |
| 124 | case 0x07: blitter_src_addr[vram] = (blitter_src_addr[vram] & 0x00ffff) | (data << 16); break; | |
| 125 | case 0x08: blitter_sizex[vram] = data; break; | |
| 126 | case 0x09: blitter_sizey[vram] = data; break; | |
| 127 | case 0x0a: blitter_destx[vram] = (blitter_destx[vram] & 0xff00) | data; break; | |
| 128 | case 0x0b: blitter_destx[vram] = (blitter_destx[vram] & 0x00ff) | (data << 8); break; | |
| 129 | case 0x0c: blitter_desty[vram] = (blitter_desty[vram] & 0xff00) | data; break; | |
| 130 | case 0x0d: blitter_desty[vram] = (blitter_desty[vram] & 0x00ff) | (data << 8); | |
| 98 | case 0x01: state->scrollx[vram] = (state->scrollx[vram] & 0x0100) | data; break; | |
| 99 | case 0x02: state->scrollx[vram] = (state->scrollx[vram] & 0x00ff) | ((data << 8) & 0x0100); break; | |
| 100 | case 0x03: state->scrolly[vram] = (state->scrolly[vram] & 0x0100) | data; break; | |
| 101 | case 0x04: state->scrolly[vram] = (state->scrolly[vram] & 0x00ff) | ((data << 8) & 0x0100); break; | |
| 102 | case 0x05: state->blitter_src_addr[vram] = (state->blitter_src_addr[vram] & 0xffff00) | data; break; | |
| 103 | case 0x06: state->blitter_src_addr[vram] = (state->blitter_src_addr[vram] & 0xff00ff) | (data << 8); break; | |
| 104 | case 0x07: state->blitter_src_addr[vram] = (state->blitter_src_addr[vram] & 0x00ffff) | (data << 16); break; | |
| 105 | case 0x08: state->blitter_sizex[vram] = data; break; | |
| 106 | case 0x09: state->blitter_sizey[vram] = data; break; | |
| 107 | case 0x0a: state->blitter_destx[vram] = (state->blitter_destx[vram] & 0xff00) | data; break; | |
| 108 | case 0x0b: state->blitter_destx[vram] = (state->blitter_destx[vram] & 0x00ff) | (data << 8); break; | |
| 109 | case 0x0c: state->blitter_desty[vram] = (state->blitter_desty[vram] & 0xff00) | data; break; | |
| 110 | case 0x0d: state->blitter_desty[vram] = (state->blitter_desty[vram] & 0x00ff) | (data << 8); | |
| 131 | 111 | niyanpai_gfxdraw(machine, vram); |
| 132 | 112 | break; |
| 133 | 113 | default: break; |
| 134 | 114 | } |
| 135 | 115 | } |
| 136 | 116 | |
| 137 | static void niyanpai_clutsel_w(int vram, int data) | |
| 117 | static void niyanpai_clutsel_w(running_machine *machine, int vram, int data) | |
| 138 | 118 | { |
| 139 | niyanpai_clutsel[vram] = data; | |
| 119 | niyanpai_state *state = machine->driver_data<niyanpai_state>(); | |
| 120 | state->clutsel[vram] = data; | |
| 140 | 121 | } |
| 141 | 122 | |
| 142 | static void niyanpai_clut_w(int vram, int offset, int data) | |
| 123 | static void niyanpai_clut_w(running_machine *machine, int vram, int offset, int data) | |
| 143 | 124 | { |
| 144 | niyanpai_clut[vram][((niyanpai_clutsel[vram] & 0xff) * 0x10) + (offset & 0x0f)] = data; | |
| 125 | niyanpai_state *state = machine->driver_data<niyanpai_state>(); | |
| 126 | state->clut[vram][((state->clutsel[vram] & 0xff) * 0x10) + (offset & 0x0f)] = data; | |
| 145 | 127 | } |
| 146 | 128 | |
| 147 | 129 | /****************************************************************************** |
| r10613 | r10614 | |
| 150 | 132 | ******************************************************************************/ |
| 151 | 133 | static void niyanpai_vramflip(running_machine *machine, int vram) |
| 152 | 134 | { |
| 153 | stat | |
| 135 | niyanpai_state | |
| 154 | 136 | int x, y; |
| 155 | 137 | UINT16 color1, color2; |
| 156 | 138 | int width = machine->primary_screen->width(); |
| 157 | 139 | int height = machine->primary_screen->height(); |
| 158 | 140 | |
| 159 | if ( | |
| 141 | if (st | |
| 160 | 142 | |
| 161 | 143 | for (y = 0; y < (height / 2); y++) |
| 162 | 144 | { |
| 163 | 145 | for (x = 0; x < width; x++) |
| 164 | 146 | { |
| 165 | color1 = niyanpai_videoram[vram][(y * width) + x]; | |
| 166 | color2 = niyanpai_videoram[vram][((y ^ 0x1ff) * width) + (x ^ 0x3ff)]; | |
| 167 | niyanpai_videoram[vram][(y * width) + x] = color2; | |
| 168 | niyanpai_videoram[vram][((y ^ 0x1ff) * width) + (x ^ 0x3ff)] = color1; | |
| 147 | color1 = state->videoram[vram][(y * width) + x]; | |
| 148 | color2 = state->videoram[vram][((y ^ 0x1ff) * width) + (x ^ 0x3ff)]; | |
| 149 | state->videoram[vram][(y * width) + x] = color2; | |
| 150 | state->videoram[vram][((y ^ 0x1ff) * width) + (x ^ 0x3ff)] = color1; | |
| 169 | 151 | } |
| 170 | 152 | } |
| 171 | 153 | |
| r10613 | r10614 | |
| 173 | 155 | { |
| 174 | 156 | for (x = 0; x < width; x++) |
| 175 | 157 | { |
| 176 | color1 = niyanpai_videoworkram[vram][(y * width) + x]; | |
| 177 | color2 = niyanpai_videoworkram[vram][((y ^ 0x1ff) * width) + (x ^ 0x3ff)]; | |
| 178 | niyanpai_videoworkram[vram][(y * width) + x] = color2; | |
| 179 | niyanpai_videoworkram[vram][((y ^ 0x1ff) * width) + (x ^ 0x3ff)] = color1; | |
| 158 | color1 = state->videoworkram[vram][(y * width) + x]; | |
| 159 | color2 = state->videoworkram[vram][((y ^ 0x1ff) * width) + (x ^ 0x3ff)]; | |
| 160 | state->videoworkram[vram][(y * width) + x] = color2; | |
| 161 | state->videoworkram[vram][((y ^ 0x1ff) * width) + (x ^ 0x3ff)] = color1; | |
| 180 | 162 | } |
| 181 | 163 | } |
| 182 | 164 | |
| 183 | niyanpai_flipscreen_old[vram] = niyanpai_flipscreen[vram]; | |
| 184 | niyanpai_screen_refresh = 1; | |
| 165 | state->flipscreen_old[vram] = state->flipscreen[vram]; | |
| 166 | state->screen_refresh = 1; | |
| 185 | 167 | } |
| 186 | 168 | |
| 187 | 169 | static void update_pixel(running_machine *machine, int vram, int x, int y) |
| 188 | 170 | { |
| 189 | UINT16 color = niyanpai_videoram[vram][(y * machine->primary_screen->width()) + x]; | |
| 190 | *BITMAP_ADDR16(niyanpai_tmpbitmap[vram], y, x) = color; | |
| 171 | niyanpai_state *state = machine->driver_data<niyanpai_state>(); | |
| 172 | UINT16 color = state->videoram[vram][(y * machine->primary_screen->width()) + x]; | |
| 173 | *BITMAP_ADDR16(state->tmpbitmap[vram], y, x) = color; | |
| 191 | 174 | } |
| 192 | 175 | |
| 193 | 176 | static TIMER_CALLBACK( blitter_timer_callback ) |
| 194 | 177 | { |
| 195 | nb19010_busyflag = 1; | |
| 178 | niyanpai_state *state = machine->driver_data<niyanpai_state>(); | |
| 179 | state->nb19010_busyflag = 1; | |
| 196 | 180 | } |
| 197 | 181 | |
| 198 | 182 | static void niyanpai_gfxdraw(running_machine *machine, int vram) |
| 199 | 183 | { |
| 184 | niyanpai_state *state = machine->driver_data<niyanpai_state>(); | |
| 200 | 185 | UINT8 *GFX = machine->region("gfx1")->base(); |
| 201 | 186 | int width = machine->primary_screen->width(); |
| 202 | 187 | |
| r10613 | r10614 | |
| 209 | 194 | UINT16 color, color1, color2; |
| 210 | 195 | int gfxaddr, gfxlen; |
| 211 | 196 | |
| 212 | nb19010_busyctr = 0; | |
| 197 | state->nb19010_busyctr = 0; | |
| 213 | 198 | |
| 214 | if ( | |
| 199 | if (st | |
| 215 | 200 | { |
| 216 | 201 | // NB22090 clut256 mode |
| 217 | blitter_sizex[vram] = GFX[((blitter_src_addr[vram] + 0) & 0x00ffffff)]; | |
| 218 | blitter_sizey[vram] = GFX[((blitter_src_addr[vram] + 1) & 0x00ffffff)]; | |
| 202 | state->blitter_sizex[vram] = GFX[((state->blitter_src_addr[vram] + 0) & 0x00ffffff)]; | |
| 203 | state->blitter_sizey[vram] = GFX[((state->blitter_src_addr[vram] + 1) & 0x00ffffff)]; | |
| 219 | 204 | } |
| 220 | 205 | |
| 221 | if (blitter_direction_x[vram]) | |
| 206 | if (state->blitter_direction_x[vram]) | |
| 222 | 207 | { |
| 223 | startx = blitter_destx[vram]; | |
| 224 | sizex = blitter_sizex[vram]; | |
| 208 | startx = state->blitter_destx[vram]; | |
| 209 | sizex = state->blitter_sizex[vram]; | |
| 225 | 210 | skipx = 1; |
| 226 | 211 | } |
| 227 | 212 | else |
| 228 | 213 | { |
| 229 | startx = blitter_destx[vram] + blitter_sizex[vram]; | |
| 230 | sizex = blitter_sizex[vram]; | |
| 214 | startx = state->blitter_destx[vram] + state->blitter_sizex[vram]; | |
| 215 | sizex = state->blitter_sizex[vram]; | |
| 231 | 216 | skipx = -1; |
| 232 | 217 | } |
| 233 | 218 | |
| 234 | if (blitter_direction_y[vram]) | |
| 219 | if (state->blitter_direction_y[vram]) | |
| 235 | 220 | { |
| 236 | starty = blitter_desty[vram]; | |
| 237 | sizey = blitter_sizey[vram]; | |
| 221 | starty = state->blitter_desty[vram]; | |
| 222 | sizey = state->blitter_sizey[vram]; | |
| 238 | 223 | skipy = 1; |
| 239 | 224 | } |
| 240 | 225 | else |
| 241 | 226 | { |
| 242 | starty = blitter_desty[vram] + blitter_sizey[vram]; | |
| 243 | sizey = blitter_sizey[vram]; | |
| 227 | starty = state->blitter_desty[vram] + state->blitter_sizey[vram]; | |
| 228 | sizey = state->blitter_sizey[vram]; | |
| 244 | 229 | skipy = -1; |
| 245 | 230 | } |
| 246 | 231 | |
| 247 | 232 | gfxlen = machine->region("gfx1")->bytes(); |
| 248 | gfxaddr = ((blitter_src_addr[vram] + 2) & 0x00ffffff); | |
| 233 | gfxaddr = ((state->blitter_src_addr[vram] + 2) & 0x00ffffff); | |
| 249 | 234 | |
| 250 | 235 | for (y = starty, ctry = sizey; ctry >= 0; y += skipy, ctry--) |
| 251 | 236 | { |
| r10613 | r10614 | |
| 266 | 251 | dx2 = (2 * x + 1) & 0x3ff; |
| 267 | 252 | dy = y & 0x1ff; |
| 268 | 253 | |
| 269 | if (! | |
| 254 | if (!st | |
| 270 | 255 | { |
| 271 | 256 | dx1 ^= 0x3ff; |
| 272 | 257 | dx2 ^= 0x3ff; |
| 273 | 258 | dy ^= 0x1ff; |
| 274 | 259 | } |
| 275 | 260 | |
| 276 | if (blitter_direction_x[vram]) | |
| 261 | if (state->blitter_direction_x[vram]) | |
| 277 | 262 | { |
| 278 | 263 | // flip |
| 279 | 264 | color1 = (color & 0x0f) >> 0; |
| r10613 | r10614 | |
| 286 | 271 | color2 = (color & 0x0f) >> 0; |
| 287 | 272 | } |
| 288 | 273 | |
| 289 | if ( | |
| 274 | if (st | |
| 290 | 275 | { |
| 291 | 276 | // clut256 mode |
| 292 | 277 | |
| 293 | if ( | |
| 278 | if (st | |
| 294 | 279 | { |
| 295 | 280 | // clut256 mode 1st(low) |
| 296 | niyanpai_videoworkram[vram][(dy * width) + dx1] &= 0x00f0; | |
| 297 | niyanpai_videoworkram[vram][(dy * width) + dx1] |= color1 & 0x0f; | |
| 298 | niyanpai_videoworkram[vram][(dy * width) + dx2] &= 0x00f0; | |
| 299 | niyanpai_videoworkram[vram][(dy * width) + dx2] |= color2 & 0x0f; | |
| 281 | state->videoworkram[vram][(dy * width) + dx1] &= 0x00f0; | |
| 282 | state->videoworkram[vram][(dy * width) + dx1] |= color1 & 0x0f; | |
| 283 | state->videoworkram[vram][(dy * width) + dx2] &= 0x00f0; | |
| 284 | state->videoworkram[vram][(dy * width) + dx2] |= color2 & 0x0f; | |
| 300 | 285 | |
| 301 | 286 | continue; |
| 302 | 287 | } |
| 303 | 288 | else |
| 304 | 289 | { |
| 305 | 290 | // clut256 mode 2nd(high) |
| 306 | niyanpai_videoworkram[vram][(dy * width) + dx1] &= 0x000f; | |
| 307 | niyanpai_videoworkram[vram][(dy * width) + dx1] |= (color1 & 0x0f) << 4; | |
| 308 | niyanpai_videoworkram[vram][(dy * width) + dx2] &= 0x000f; | |
| 309 | niyanpai_videoworkram[vram][(dy * width) + dx2] |= (color2 & 0x0f) << 4; | |
| 291 | state->videoworkram[vram][(dy * width) + dx1] &= 0x000f; | |
| 292 | state->videoworkram[vram][(dy * width) + dx1] |= (color1 & 0x0f) << 4; | |
| 293 | state->videoworkram[vram][(dy * width) + dx2] &= 0x000f; | |
| 294 | state->videoworkram[vram][(dy * width) + dx2] |= (color2 & 0x0f) << 4; | |
| 310 | 295 | |
| 311 | // niyanpai_videoworkram[vram][(dy * width) + dx1] += niyanpai_clut[vram][(niyanpai_clutsel[vram] * 0x10)]; | |
| 312 | // niyanpai_videoworkram[vram][(dy * width) + dx2] += niyanpai_clut[vram][(niyanpai_clutsel[vram] * 0x10)]; | |
| 296 | // state->videoworkram[vram][(dy * width) + dx1] += state->clut[vram][(state->clutsel[vram] * 0x10)]; | |
| 297 | // state->videoworkram[vram][(dy * width) + dx2] += state->clut[vram][(state->clutsel[vram] * 0x10)]; | |
| 313 | 298 | } |
| 314 | 299 | |
| 315 | color1 = niyanpai_videoworkram[vram][(dy * width) + dx1]; | |
| 316 | color2 = niyanpai_videoworkram[vram][(dy * width) + dx2]; | |
| 300 | color1 = state->videoworkram[vram][(dy * width) + dx1]; | |
| 301 | color2 = state->videoworkram[vram][(dy * width) + dx2]; | |
| 317 | 302 | } |
| 318 | 303 | else |
| 319 | 304 | { |
| 320 | 305 | // clut16 mode |
| 321 | color1 = niyanpai_clut[vram][(niyanpai_clutsel[vram] * 0x10) + color1]; | |
| 322 | color2 = niyanpai_clut[vram][(niyanpai_clutsel[vram] * 0x10) + color2]; | |
| 306 | color1 = state->clut[vram][(state->clutsel[vram] * 0x10) + color1]; | |
| 307 | color2 = state->clut[vram][(state->clutsel[vram] * 0x10) + color2]; | |
| 323 | 308 | } |
| 324 | 309 | |
| 325 | 310 | color1 |= (0x0100 * vram); |
| 326 | 311 | color2 |= (0x0100 * vram); |
| 327 | 312 | |
| 328 | if (((color1 & 0x00ff) != 0x00ff) || (! | |
| 313 | if (((color1 & 0x00ff) != 0x00ff) || (!st | |
| 329 | 314 | { |
| 330 | | |
| 315 | st | |
| 331 | 316 | update_pixel(machine, vram, dx1, dy); |
| 332 | 317 | } |
| 333 | if (((color2 & 0x00ff) != 0x00ff) || (! | |
| 318 | if (((color2 & 0x00ff) != 0x00ff) || (!st | |
| 334 | 319 | { |
| 335 | | |
| 320 | st | |
| 336 | 321 | update_pixel(machine, vram, dx2, dy); |
| 337 | 322 | } |
| 338 | 323 | |
| 339 | nb19010_busyctr++; | |
| 324 | state->nb19010_busyctr++; | |
| 340 | 325 | } |
| 341 | 326 | } |
| 342 | 327 | |
| 343 | if ( | |
| 328 | if (st | |
| 344 | 329 | { |
| 345 | 330 | // NB22090 clut256 mode |
| 346 | blitter_src_addr[vram] = gfxaddr; | |
| 331 | state->blitter_src_addr[vram] = gfxaddr; | |
| 347 | 332 | } |
| 348 | 333 | |
| 349 | nb19010_busyflag = 0; | |
| 350 | machine->scheduler().timer_set(attotime::from_nsec(1650 * nb19010_busyctr), FUNC(blitter_timer_callback)); | |
| 334 | state->nb19010_busyflag = 0; | |
| 335 | machine->scheduler().timer_set(attotime::from_nsec(1650 * state->nb19010_busyctr), FUNC(blitter_timer_callback)); | |
| 351 | 336 | } |
| 352 | 337 | |
| 353 | 338 | /****************************************************************************** |
| r10613 | r10614 | |
| 362 | 347 | READ16_HANDLER( niyanpai_blitter_1_r ) { return niyanpai_blitter_r(space->machine, 1, offset); } |
| 363 | 348 | READ16_HANDLER( niyanpai_blitter_2_r ) { return niyanpai_blitter_r(space->machine, 2, offset); } |
| 364 | 349 | |
| 365 | WRITE16_HANDLER( niyanpai_clut_0_w ) { niyanpai_clut_w(0, offset, data); } | |
| 366 | WRITE16_HANDLER( niyanpai_clut_1_w ) { niyanpai_clut_w(1, offset, data); } | |
| 367 | WRITE16_HANDLER( niyanpai_clut_2_w ) { niyanpai_clut_w(2, offset, data); } | |
| 350 | WRITE16_HANDLER( niyanpai_clut_0_w ) { niyanpai_clut_w(space->machine, 0, offset, data); } | |
| 351 | WRITE16_HANDLER( niyanpai_clut_1_w ) { niyanpai_clut_w(space->machine, 1, offset, data); } | |
| 352 | WRITE16_HANDLER( niyanpai_clut_2_w ) { niyanpai_clut_w(space->machine, 2, offset, data); } | |
| 368 | 353 | |
| 369 | WRITE16_HANDLER( niyanpai_clutsel_0_w ) { niyanpai_clutsel_w(0, data); } | |
| 370 | WRITE16_HANDLER( niyanpai_clutsel_1_w ) { niyanpai_clutsel_w(1, data); } | |
| 371 | WRITE16_HANDLER( niyanpai_clutsel_2_w ) { niyanpai_clutsel_w(2, data); } | |
| 354 | WRITE16_HANDLER( niyanpai_clutsel_0_w ) { niyanpai_clutsel_w(space->machine, 0, data); } | |
| 355 | WRITE16_HANDLER( niyanpai_clutsel_1_w ) { niyanpai_clutsel_w(space->machine, 1, data); } | |
| 356 | WRITE16_HANDLER( niyanpai_clutsel_2_w ) { niyanpai_clutsel_w(space->machine, 2, data); } | |
| 372 | 357 | |
| 373 | 358 | /****************************************************************************** |
| 374 | 359 | |
| r10613 | r10614 | |
| 376 | 361 | ******************************************************************************/ |
| 377 | 362 | VIDEO_START( niyanpai ) |
| 378 | 363 | { |
| 364 | niyanpai_state *state = machine->driver_data<niyanpai_state>(); | |
| 379 | 365 | int width = machine->primary_screen->width(); |
| 380 | 366 | int height = machine->primary_screen->height(); |
| 381 | 367 | |
| 382 | niyanpai_tmpbitmap[0] = machine->primary_screen->alloc_compatible_bitmap(); | |
| 383 | niyanpai_tmpbitmap[1] = machine->primary_screen->alloc_compatible_bitmap(); | |
| 384 | niyanpai_tmpbitmap[2] = machine->primary_screen->alloc_compatible_bitmap(); | |
| 385 | niyanpai_videoram[0] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 386 | niyanpai_videoram[1] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 387 | niyanpai_videoram[2] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 388 | niyanpai_videoworkram[0] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 389 | niyanpai_videoworkram[1] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 390 | niyanpai_videoworkram[2] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 391 | niyanpai_palette = auto_alloc_array(machine, UINT16, 0x480); | |
| 392 | niyanpai_clut[0] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 393 | niyanpai_clut[1] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 394 | niyanpai_clut[2] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 395 | nb19010_busyflag = 1; | |
| 368 | state->tmpbitmap[0] = machine->primary_screen->alloc_compatible_bitmap(); | |
| 369 | state->tmpbitmap[1] = machine->primary_screen->alloc_compatible_bitmap(); | |
| 370 | state->tmpbitmap[2] = machine->primary_screen->alloc_compatible_bitmap(); | |
| 371 | state->videoram[0] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 372 | state->videoram[1] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 373 | state->videoram[2] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 374 | state->videoworkram[0] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 375 | state->videoworkram[1] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 376 | state->videoworkram[2] = auto_alloc_array_clear(machine, UINT16, width * height); | |
| 377 | state->palette = auto_alloc_array(machine, UINT16, 0x480); | |
| 378 | state->clut[0] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 379 | state->clut[1] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 380 | state->clut[2] = auto_alloc_array(machine, UINT8, 0x1000); | |
| 381 | state->nb19010_busyflag = 1; | |
| 396 | 382 | } |
| 397 | 383 | |
| 398 | 384 | /****************************************************************************** |
| r10613 | r10614 | |
| 401 | 387 | ******************************************************************************/ |
| 402 | 388 | SCREEN_UPDATE( niyanpai ) |
| 403 | 389 | { |
| 390 | niyanpai_state *state = screen->machine->driver_data<niyanpai_state>(); | |
| 404 | 391 | int i; |
| 405 | 392 | int x, y; |
| 406 | 393 | int scrollx[3], scrolly[3]; |
| 407 | 394 | |
| 408 | if ( | |
| 395 | if (st | |
| 409 | 396 | { |
| 410 | 397 | int width = screen->width(); |
| 411 | 398 | int height = screen->height(); |
| 412 | 399 | |
| 413 | | |
| 400 | st | |
| 414 | 401 | |
| 415 | 402 | for (y = 0; y < height; y++) |
| 416 | 403 | for (x = 0; x < width; x++) |
| r10613 | r10614 | |
| 423 | 410 | |
| 424 | 411 | for (i = 0; i < 3; i++) |
| 425 | 412 | { |
| 426 | if ( | |
| 413 | if (st | |
| 427 | 414 | { |
| 428 | scrollx[i] = (((-niyanpai_scrollx[i]) - 0x4e) & 0x1ff) << 1; | |
| 429 | scrolly[i] = (-niyanpai_scrolly[i]) & 0x1ff; | |
| 415 | scrollx[i] = (((-state->scrollx[i]) - 0x4e) & 0x1ff) << 1; | |
| 416 | scrolly[i] = (-state->scrolly[i]) & 0x1ff; | |
| 430 | 417 | } |
| 431 | 418 | else |
| 432 | 419 | { |
| 433 | scrollx[i] = (((-niyanpai_scrollx[i]) - 0x4e) & 0x1ff) << 1; | |
| 434 | scrolly[i] = niyanpai_scrolly[i] & 0x1ff; | |
| 420 | scrollx[i] = (((-state->scrollx[i]) - 0x4e) & 0x1ff) << 1; | |
| 421 | scrolly[i] = state->scrolly[i] & 0x1ff; | |
| 435 | 422 | } |
| 436 | 423 | } |
| 437 | 424 | |
| 438 | if (niyanpai_dispflag[0]) | |
| 439 | copyscrollbitmap(bitmap, niyanpai_tmpbitmap[0], 1, &scrollx[0], 1, &scrolly[0], cliprect); | |
| 425 | if (state->dispflag[0]) | |
| 426 | copyscrollbitmap(bitmap, state->tmpbitmap[0], 1, &scrollx[0], 1, &scrolly[0], cliprect); | |
| 440 | 427 | else |
| 441 | 428 | bitmap_fill(bitmap, 0, 0x00ff); |
| 442 | 429 | |
| 443 | if (niyanpai_dispflag[1]) | |
| 444 | copyscrollbitmap_trans(bitmap, niyanpai_tmpbitmap[1], 1, &scrollx[1], 1, &scrolly[1], cliprect, 0x01ff); | |
| 430 | if (state->dispflag[1]) | |
| 431 | copyscrollbitmap_trans(bitmap, state->tmpbitmap[1], 1, &scrollx[1], 1, &scrolly[1], cliprect, 0x01ff); | |
| 445 | 432 | |
| 446 | if (niyanpai_dispflag[2]) | |
| 447 | copyscrollbitmap_trans(bitmap, niyanpai_tmpbitmap[2], 1, &scrollx[2], 1, &scrolly[2], cliprect, 0x02ff); | |
| 433 | if (state->dispflag[2]) | |
| 434 | copyscrollbitmap_trans(bitmap, state->tmpbitmap[2], 1, &scrollx[2], 1, &scrolly[2], cliprect, 0x02ff); | |
| 448 | 435 | |
| 449 | 436 | return 0; |
| 450 | 437 | } |
| r10613 | r10614 | |
|---|---|---|
| 15 | 15 | Offset: Bits: Value: |
| 16 | 16 | |
| 17 | 17 | 0.w f--- ---- ---- ---- Last sprite |
| 18 | -edc ---- ---- ---- ? | |
| 19 | ---c ---- ---- ---- 0 = Each sprite specifies its size, 1 = use the size in the following words | |
| 20 | ---- b--- ---- ---- ? | |
| 21 | ---- -a98 ---- ---- tile color depth | |
| 18 | -ed- ---- ---- ---- ? | |
| 19 | ---c ---- ---- ---- 0 = Each sprite specifies its size, 1 = Use the global size (following words) | |
| 20 | ---- b--- ---- ---- Shadow | |
| 21 | ---- -a98 ---- ---- Tile color depth | |
| 22 | 22 | ---- ---- 7654 3210 Number of sprites - 1 |
| 23 | 23 | |
| 24 | 2.w fedc ---- ---- ---- Number of tiles? | |
| 25 | ---- ba-- ---- ---- Number of tiles along X (1 << n) | |
| 24 | 2.w fedc ba-- ---- ---- X global size | |
| 26 | 25 | ---- --98 7654 3210 X displacement |
| 27 | 26 | |
| 28 | 4.w fedc ---- ---- ---- Number of tiles? | |
| 29 | ---- ba-- ---- ---- Number of tiles along Y (1 << n) | |
| 27 | 4.w fedc ba-- ---- ---- Y global size | |
| 30 | 28 | ---- --98 7654 3210 Y displacement |
| 31 | 29 | |
| 32 | 30 | 6.w f--- ---- ---- ---- Single-sprite(s) type: tile (0) or row of tiles (1) |
| 33 | -edc ba98 7654 3210 Offset of the single-sprite(s) data | |
| 31 | -edc ba98 7654 3210 Offset of the single-sprite(s) data (8 bytes each) | |
| 34 | 32 | |
| 35 | 33 | |
| 36 | 34 | A single-sprite can be a tile or some horizontal rows of tiles. |
| 37 | 35 | |
| 38 | 36 | Tile case: |
| 39 | 37 | |
| 40 | 0.w fedc ---- ---- ---- | |
| 38 | 0.w fedc ---- ---- ---- | |
| 41 | 39 | ---- ba-- ---- ---- Number of tiles along X (1 << n) |
| 42 | 40 | ---- --98 7654 3210 X |
| 43 | 41 | |
| 44 | 2.w fedc ---- ---- ---- | |
| 42 | 2.w fedc ---- ---- ---- | |
| 45 | 43 | ---- ba-- ---- ---- Number of tiles along Y (1 << n) |
| 46 | 44 | ---- --98 7654 3210 Y |
| 47 | 45 | |
| r10613 | r10614 | |
| 55 | 53 | |
| 56 | 54 | Row case: |
| 57 | 55 | |
| 58 | 0.w fedc ba-- ---- ---- | |
| 56 | 0.w fedc ba-- ---- ---- Number of columns | |
| 59 | 57 | ---- --98 7654 3210 X |
| 60 | 58 | |
| 61 | 59 | 2.w fedc ba-- ---- ---- Number of rows - 1 |
| 62 | 60 | ---- --98 7654 3210 Y |
| 63 | 61 | |
| 64 | 62 | 4.w f--- ---- ---- ---- Tile size: 8x8 (0) or 16x16 (1) |
| 65 | -edc ba-- ---- ---- "Tilemap" page | |
| 66 | ---- --98 7654 3210 "Tilemap" Scroll X | |
| 63 | -edc ba-- ---- ---- "Tilemap" page (0x2000 bytes each) | |
| 64 | ---- --98 7654 3210 "Tilemap" scroll X | |
| 67 | 65 | |
| 68 | 66 | 6.w fedc ba9- ---- ---- |
| 69 | ---- ---8 7654 3210 "Tilemap" | |
| 67 | ---- ---8 7654 3210 "Tilemap" scroll Y | |
| 70 | 68 | |
| 69 | ||
| 70 | Shadows (same principle as ssv.c): | |
| 71 | ||
| 72 | The low bits of the pens from a "shadowing" tile (regardless of color code) | |
| 73 | substitute the top bits of the color index (0-7fff) in the frame buffer. | |
| 74 | ||
| 71 | 75 | ***************************************************************************/ |
| 72 | 76 | |
| 73 | 77 | #include "emu.h" |
| r10613 | r10614 | |
| 75 | 79 | |
| 76 | 80 | /*************************************************************************** |
| 77 | 81 | |
| 78 | ||
| 79 | 82 | Video Registers |
| 80 | 83 | |
| 81 | 84 | Offset: Bits: Value: |
| 82 | 85 | |
| 83 | 0/2/4/6 ? Horizontal | |
| 84 | 8/a/c/e ? Vertical | |
| 86 | 0/2/4/6 ? Horizontal (same as ssv.c?) | |
| 87 | 8/a/c/e ? Vertical (same as ssv.c?) | |
| 85 | 88 | |
| 86 | 89 | 10 |
| 87 | 90 | 12 Offset X? |
| r10613 | r10614 | |
| 91 | 94 | 18 |
| 92 | 95 | 1a Offset Y? |
| 93 | 96 | 1c Zoom Y? low bits |
| 94 | 1e Zoom Y? high bits | |
| 97 | 1e Zoom Y? high bits * | |
| 95 | 98 | |
| 99 | 26 1->0 during INT0, before writing sprites | |
| 100 | ||
| 96 | 101 | 30 fedc ba98 7654 321- |
| 97 | 102 | ---- ---- ---- ---0 Disable video |
| 98 | 103 | |
| 99 | 104 | 32..3f ? |
| 100 | 105 | |
| 106 | * A value of 0x0100 is means no zoom, a value of 0x0200 will halve the size. | |
| 107 | A value less than 0x0100 probably means magnification. | |
| 101 | 108 | |
| 102 | * A value of 1 is means no zoom, a value of 2 will halve the size. | |
| 103 | It's unknown whether a value less than 1 means magnification (probably yes) | |
| 104 | ||
| 105 | 109 | ***************************************************************************/ |
| 106 | 110 | |
| 107 | 111 | WRITE16_HANDLER( seta2_vregs_w ) |
| r10613 | r10614 | |
| 157 | 161 | |
| 158 | 162 | ***************************************************************************/ |
| 159 | 163 | |
| 164 | static void seta_drawgfx( bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx, | |
| 165 | UINT32 code,UINT32 color,int flipx,int flipy,int x0,int y0, | |
| 166 | int shadow_depth ) | |
| 167 | { | |
| 168 | const UINT8 *addr, *source; | |
| 169 | UINT8 pen; | |
| 170 | UINT16 *dest; | |
| 171 | int sx, x1, dx; | |
| 172 | int sy, y1, dy; | |
| 173 | ||
| 174 | addr = gfx_element_get_data(gfx, code % gfx->total_elements); | |
| 175 | color = gfx->color_granularity * (color % gfx->total_colors); | |
| 176 | ||
| 177 | if ( flipx ) { x1 = x0-1; x0 += gfx->width-1; dx = -1; } | |
| 178 | else { x1 = x0 + gfx->width; dx = 1; } | |
| 179 | ||
| 180 | if ( flipy ) { y1 = y0-1; y0 += gfx->height-1; dy = -1; } | |
| 181 | else { y1 = y0 + gfx->height; dy = 1; } | |
| 182 | ||
| 183 | #define SETA_DRAWGFX(SETPIXELCOLOR) \ | |
| 184 | for ( sy = y0; sy != y1; sy += dy ) \ | |
| 185 | { \ | |
| 186 | if ( sy >= cliprect->min_y && sy <= cliprect->max_y ) \ | |
| 187 | { \ | |
| 188 | source = addr; \ | |
| 189 | dest = BITMAP_ADDR16(bitmap, sy, 0); \ | |
| 190 | \ | |
| 191 | for ( sx = x0; sx != x1; sx += dx ) \ | |
| 192 | { \ | |
| 193 | pen = *source++; \ | |
| 194 | \ | |
| 195 | if ( pen && sx >= cliprect->min_x && sx <= cliprect->max_x ) \ | |
| 196 | SETPIXELCOLOR \ | |
| 197 | } \ | |
| 198 | } \ | |
| 199 | \ | |
| 200 | addr += gfx->line_modulo; \ | |
| 201 | } | |
| 202 | ||
| 203 | if (shadow_depth) | |
| 204 | { | |
| 205 | int pen_shift = 15 - shadow_depth; | |
| 206 | int pen_mask = (1 << pen_shift) - 1; | |
| 207 | SETA_DRAWGFX( { dest[sx] = ((dest[sx] & pen_mask) | (pen << pen_shift)) & 0x7fff; } ) | |
| 208 | } | |
| 209 | else | |
| 210 | { | |
| 211 | SETA_DRAWGFX( { dest[sx] = (color + pen) & 0x7fff; } ) | |
| 212 | } | |
| 213 | } | |
| 214 | ||
| 160 | 215 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) |
| 161 | 216 | { |
| 162 | / | |
| 217 | // Sprites list | |
| 163 | 218 | |
| 164 | 219 | seta2_state *state = machine->driver_data<seta2_state>(); |
| 220 | // When debugging, use state->spriteram here, and run mame -update_in_pause | |
| 165 | 221 | UINT16 *buffered_spriteram16 = state->buffered_spriteram; |
| 166 | 222 | UINT16 *s1 = buffered_spriteram16 + 0x3000/2; |
| 167 | 223 | UINT16 *end = &buffered_spriteram16[state->spriteram_size/2]; |
| 168 | 224 | |
| 169 | 225 | for ( ; s1 < end; s1+=4 ) |
| 170 | 226 | { |
| 171 | | |
| 227 | const gfx_element *gfx; | |
| 172 | 228 | int num = s1[0]; |
| 173 | 229 | int xoffs = s1[1]; |
| 174 | 230 | int yoffs = s1[2]; |
| 175 | 231 | int sprite = s1[3]; |
| 176 | 232 | |
| 177 | / | |
| 233 | // Single-sprite address | |
| 178 | 234 | UINT16 *s2 = &buffered_spriteram16[(sprite & 0x7fff) * 4]; |
| 179 | 235 | |
| 180 | /* Single-sprite tile size */ | |
| 181 | int global_sizex = xoffs & 0x0c00; | |
| 182 | int global_sizey = yoffs & 0x0c00; | |
| 236 | // Single-sprite size | |
| 237 | int global_sizex = xoffs & 0xfc00; | |
| 238 | int global_sizey = yoffs & 0xfc00; | |
| 183 | 239 | |
| 184 | int use_global_size = num & 0x1000; | |
| 240 | int use_global_size = num & 0x1000; | |
| 241 | int use_shadow = num & 0x0800; | |
| 185 | 242 | |
| 186 | 243 | xoffs &= 0x3ff; |
| 187 | 244 | yoffs &= 0x3ff; |
| 188 | 245 | |
| 189 | /* Color depth */ | |
| 246 | // Color depth | |
| 247 | int shadow_depth; | |
| 190 | 248 | switch (num & 0x0700) |
| 191 | 249 | { |
| 192 | 250 | default: |
| 193 | 251 | popmessage("unknown gfxset %x",(num & 0x0700)>>8); |
| 194 | gfx = machine->rand()&3; break; | |
| 195 | case 0x0700: // 8bpp tiles (76543210) | |
| 196 | gfx = 3; break; | |
| 197 | case 0x0600: // 6bpp tiles (--543210) (myangel sliding blocks test) | |
| 198 | gfx = 2; break; | |
| 199 | case 0x0500: // 4bpp tiles (3210----) | |
| 200 | gfx = 1; break; | |
| 201 | case 0x0400: // 4bpp tiles (----3210) | |
| 202 | gfx = 0; break; | |
| 252 | shadow_depth = 0; | |
| 253 | gfx = machine->gfx[machine->rand()&3]; | |
| 254 | break; | |
| 255 | case 0x0700: // 8bpp tiles (76543210) | |
| 256 | shadow_depth = 8; // ? | |
| 257 | gfx = machine->gfx[3]; | |
| 258 | break; | |
| 259 | case 0x0600: // 6bpp tiles (--543210) (myangel sliding blocks test) | |
| 260 | shadow_depth = 6; // ? | |
| 261 | gfx = machine->gfx[2]; | |
| 262 | break; | |
| 263 | case 0x0500: // 4bpp tiles (3210----) | |
| 264 | shadow_depth = 4; // ? | |
| 265 | gfx = machine->gfx[1]; | |
| 266 | break; | |
| 267 | case 0x0400: // 4bpp tiles (----3210) | |
| 268 | shadow_depth = 3; // reelquak | |
| 269 | gfx = machine->gfx[0]; | |
| 270 | break; | |
| 203 | 271 | // case 0x0300: |
| 204 | 272 | // unknown |
| 205 | case 0x0200: // 3bpp tiles? (-----210) (myangel "Graduate Tests") | |
| 206 | gfx = 4; break; | |
| 207 | case 0x0100: // 2bpp tiles??? (--10----) (myangel2 question bubble, myangel endgame) | |
| 208 | gfx = 5; break; | |
| 209 | case 0x0000: // no idea! | |
| 210 | gfx = 0; break; | |
| 273 | case 0x0200: // 3bpp tiles? (-----210) (myangel "Graduate Tests") | |
| 274 | shadow_depth = 3; // ? | |
| 275 | gfx = machine->gfx[4]; | |
| 276 | break; | |
| 277 | case 0x0100: // 2bpp tiles??? (--10----) (myangel2 question bubble, myangel endgame) | |
| 278 | shadow_depth = 2; // myangel2 | |
| 279 | gfx = machine->gfx[5]; | |
| 280 | break; | |
| 281 | case 0x0000: // no idea! | |
| 282 | shadow_depth = 4; // ? | |
| 283 | gfx = machine->gfx[0]; | |
| 284 | break; | |
| 211 | 285 | } |
| 286 | if (!use_shadow) | |
| 287 | shadow_depth = 0; | |
| 212 | 288 | |
| 213 | / | |
| 289 | // Number of single-sprites | |
| 214 | 290 | num = (num & 0x00ff) + 1; |
| 215 | 291 | |
| 216 | 292 | for( ; num > 0; num--,s2+=4 ) |
| r10613 | r10614 | |
| 222 | 298 | if (sprite & 0x8000) |
| 223 | 299 | { |
| 224 | 300 | rectangle clip; |
| 225 | int dx,x,y; | |
| 301 | int dx, x, y; | |
| 226 | 302 | int flipx; |
| 227 | 303 | int flipy; |
| 228 | 304 | int sx = s2[0]; |
| r10613 | r10614 | |
| 231 | 307 | int scrolly = s2[3]; |
| 232 | 308 | int tilesize = (scrollx & 0x8000) >> 15; |
| 233 | 309 | int page = (scrollx & 0x7c00) >> 10; |
| 234 | int height = ((sy & 0xfc00) >> 10) + 1; | |
| 235 | 310 | |
| 311 | int width = use_global_size ? global_sizex : sx; | |
| 312 | int height = use_global_size ? global_sizey : sy; | |
| 313 | height = ((height & 0xfc00) >> 10) + 1; | |
| 314 | width = ((width & 0xfc00) >> 10)/* + 1*/; // reelquak reels | |
| 315 | if (!width) | |
| 316 | continue; | |
| 317 | ||
| 236 | 318 | sx &= 0x3ff; |
| 237 | 319 | sy &= 0x1ff; |
| 320 | ||
| 321 | scrollx += state->xoffset; | |
| 238 | 322 | scrollx &= 0x3ff; |
| 239 | 323 | scrolly &= 0x1ff; |
| 240 | 324 | |
| 241 | clip.min_y = (sy + yoffs) & 0x1ff; | |
| 325 | // sprite clipping region (x) | |
| 326 | clip.min_x = (sx + xoffs) & 0x3ff; | |
| 327 | clip.min_x = (clip.min_x & 0x1ff) - (clip.min_x & 0x200); | |
| 328 | clip.max_x = clip.min_x + width * 0x10 - 1; | |
| 329 | ||
| 330 | if (clip.min_x > cliprect->max_x) continue; | |
| 331 | if (clip.max_x < cliprect->min_x) continue; | |
| 332 | if (clip.min_x < cliprect->min_x) clip.min_x = cliprect->min_x; | |
| 333 | if (clip.max_x > cliprect->max_x) clip.max_x = cliprect->max_x; | |
| 334 | ||
| 335 | // sprite clipping region (y) | |
| 336 | clip.min_y = ((sy + yoffs) & 0x1ff) - state->yoffset; | |
| 242 | 337 | clip.max_y = clip.min_y + height * 0x10 - 1; |
| 243 | 338 | |
| 244 | 339 | if (clip.min_y > cliprect->max_y) continue; |
| 245 | 340 | if (clip.max_y < cliprect->min_y) continue; |
| 246 | ||
| 247 | clip.min_x = cliprect->min_x; | |
| 248 | clip.max_x = cliprect->max_x; | |
| 249 | ||
| 250 | 341 | if (clip.min_y < cliprect->min_y) clip.min_y = cliprect->min_y; |
| 251 | 342 | if (clip.max_y > cliprect->max_y) clip.max_y = cliprect->max_y; |
| 252 | 343 | |
| 253 | 344 | dx = sx + (scrollx & 0x3ff) + xoffs + 0x10; |
| 254 | 345 | |
| 255 | /* Draw the rows */ | |
| 256 | /* I don't think the following is entirely correct (when using 16x16 | |
| 257 | tiles x should probably loop from 0 to 0x20) but it seems to work | |
| 258 | fine in all the games we have for now. */ | |
| 346 | // Draw the rows | |
| 259 | 347 | for (y = 0; y < (0x40 >> tilesize); y++) |
| 260 | 348 | { |
| 261 | 349 | int py = ((scrolly - (y+1) * (8 << tilesize) + 0x10) & 0x1ff) - 0x10 - state->yoffset; |
| 262 | 350 | |
| 263 | if (py < clip.min_y - 0x10) continue; | |
| 264 | if (py > clip.max_y) continue; | |
| 265 | ||
| 266 | for (x = 0; x < 0x40;x++) | |
| 351 | for (x = 0; x < 0x40; x++) | |
| 267 | 352 | { |
| 268 | 353 | int px = ((dx + x * (8 << tilesize) + 0x10) & 0x3ff) - 0x10; |
| 269 | 354 | int tx, ty; |
| 270 | 355 | int attr, code, color; |
| 271 | 356 | UINT16 *s3; |
| 272 | 357 | |
| 273 | if (px < clip.min_x - 0x10) continue; | |
| 274 | if (px > clip.max_x) continue; | |
| 275 | ||
| 276 | 358 | s3 = &buffered_spriteram16[2 * ((page * 0x2000/4) + ((y & 0x1f) << 6) + (x & 0x03f))]; |
| 277 | 359 | |
| 278 | 360 | attr = s3[0]; |
| r10613 | r10614 | |
| 287 | 369 | { |
| 288 | 370 | for (tx = 0; tx <= tilesize; tx++) |
| 289 | 371 | { |
| 290 | drawgfx_transpen(bitmap, cliprect,machine->gfx[gfx], | |
| 372 | int dst_x = (px + (flipx ? tilesize-tx : tx) * 8) & 0x3ff; | |
| 373 | int dst_y = (py + (flipy ? tilesize-ty : ty) * 8) & 0x1ff; | |
| 374 | ||
| 375 | dst_x = (dst_x & 0x1ff) - (dst_x & 0x200); | |
| 376 | ||
| 377 | seta_drawgfx(bitmap, &clip, gfx, | |
| 291 | 378 | code ^ tx ^ (ty<<1), |
| 292 | 379 | color, |
| 293 | 380 | flipx, flipy, |
| 294 | px + (flipx ? tilesize-tx : tx) * 8, py + (flipy ? tilesize-ty : ty) * 8,0 ); | |
| 381 | dst_x, dst_y, | |
| 382 | shadow_depth ); | |
| 295 | 383 | } |
| 296 | 384 | } |
| 297 | 385 | |
| r10613 | r10614 | |
| 320 | 408 | sy += yoffs; |
| 321 | 409 | |
| 322 | 410 | sx = (sx & 0x1ff) - (sx & 0x200); |
| 411 | ||
| 323 | 412 | sy &= 0x1ff; |
| 324 | 413 | sy -= state->yoffset; |
| 325 | 414 | |
| r10613 | r10614 | |
| 329 | 418 | { |
| 330 | 419 | for (x = 0; x <= sizex; x++) |
| 331 | 420 | { |
| 332 | drawgfx | |
| 421 | seta_drawgfx | |
| 333 | 422 | code++, |
| 334 | 423 | color, |
| 335 | 424 | flipx, flipy, |
| 336 | sx + (flipx ? sizex-x : x) * 8, sy + (flipy ? sizey-y : y) * 8,0 ); | |
| 425 | sx + (flipx ? sizex-x : x) * 8, sy + (flipy ? sizey-y : y) * 8, | |
| 426 | shadow_depth ); | |
| 337 | 427 | } |
| 338 | 428 | } |
| 339 | 429 | } |
| 340 | 430 | } |
| 341 | 431 | |
| 342 | if (s1[0] & 0x8000) break; /* end of list marker */ | |
| 343 | } /* sprite list */ | |
| 432 | if (s1[0] & 0x8000) break; // end of list marker | |
| 433 | } // sprite list | |
| 344 | 434 | } |
| 345 | 435 | |
| 346 | 436 | |
| r10613 | r10614 | |
| 363 | 453 | |
| 364 | 454 | state->buffered_spriteram = auto_alloc_array(machine, UINT16, state->spriteram_size/2); |
| 365 | 455 | |
| 456 | state->xoffset = 0; | |
| 366 | 457 | state->yoffset = 0; |
| 458 | ||
| 459 | state_save_register_global_pointer(machine, state->vregs, 0x40); | |
| 367 | 460 | } |
| 368 | 461 | |
| 369 | VIDEO_START( seta2_offset ) | |
| 462 | VIDEO_START( seta2_xoffset ) | |
| 370 | 463 | { |
| 371 | 464 | seta2_state *state = machine->driver_data<seta2_state>(); |
| 372 | 465 | |
| 373 | 466 | VIDEO_START_CALL(seta2); |
| 374 | 467 | |
| 468 | state->xoffset = 0x200; | |
| 469 | } | |
| 470 | ||
| 471 | VIDEO_START( seta2_yoffset ) | |
| 472 | { | |
| 473 | seta2_state *state = machine->driver_data<seta2_state>(); | |
| 474 | ||
| 475 | VIDEO_START_CALL(seta2); | |
| 476 | ||
| 375 | 477 | state->yoffset = 0x10; |
| 376 | 478 | } |
| 377 | 479 | |
| r10613 | r10614 | |
| 379 | 481 | { |
| 380 | 482 | seta2_state *state = screen->machine->driver_data<seta2_state>(); |
| 381 | 483 | |
| 382 | /* Black or pen 0? */ | |
| 383 | bitmap_fill(bitmap,cliprect,0); | |
| 484 | // Black or pen 0? | |
| 485 | bitmap_fill(bitmap, cliprect, screen->machine->pens[0]); | |
| 384 | 486 | |
| 385 | if (state->vregs[0x30/2] & 1) return 0; // BLANK SCREEN | |
| 487 | if ( (state->vregs[0x30/2] & 1) == 0 ) // 1 = BLANK SCREEN | |
| 488 | draw_sprites(screen->machine, bitmap, cliprect); | |
| 386 | 489 | |
| 387 | draw_sprites(screen->machine,bitmap,cliprect); | |
| 388 | 490 | return 0; |
| 389 | 491 | } |
| 390 | 492 | |
| r10613 | r10614 | |
| 392 | 494 | { |
| 393 | 495 | seta2_state *state = machine->driver_data<seta2_state>(); |
| 394 | 496 | |
| 395 | / | |
| 497 | // Buffer sprites by 1 frame | |
| 396 | 498 | memcpy(state->buffered_spriteram, state->spriteram, state->spriteram_size); |
| 397 | 499 | } |
| r10613 | r10614 | |
|---|---|---|
| 95 | 95 | { |
| 96 | 96 | shootout_state *state = machine->driver_data<shootout_state>(); |
| 97 | 97 | UINT8 *spriteram = state->spriteram; |
| 98 | static int bFlicker; | |
| 99 | 98 | const gfx_element *gfx = machine->gfx[1]; |
| 100 | 99 | const UINT8 *source = spriteram+127*4; |
| 101 | 100 | int count; |
| 102 | 101 | |
| 103 | bFlicker = !bFlicker; | |
| 102 | state->bFlicker = !state->bFlicker; | |
| 104 | 103 | |
| 105 | 104 | for( count=0; count<128; count++ ) |
| 106 | 105 | { |
| r10613 | r10614 | |
| 115 | 114 | -------x enable |
| 116 | 115 | */ |
| 117 | 116 | if ( attributes & 0x01 ){ /* visible */ |
| 118 | if( bFlicker || (attributes&0x02)==0 ){ | |
| 117 | if( state->bFlicker || (attributes&0x02)==0 ){ | |
| 119 | 118 | int priority_mask = (attributes&0x08)?0x2:0; |
| 120 | 119 | int sx = (240 - source[2])&0xff; |
| 121 | 120 | int sy = (240 - source[0])&0xff; |
| r10613 | r10614 | |
|---|---|---|
| 9 | 9 | #include "emu.h" |
| 10 | 10 | #include "includes/terracre.h" |
| 11 | 11 | |
| 12 | static UINT16 xscroll; | |
| 13 | static UINT16 yscroll; | |
| 14 | static tilemap_t *background, *foreground; | |
| 15 | 12 | |
| 16 | UINT16 *amazon_videoram; | |
| 17 | ||
| 18 | 13 | static |
| 19 | 14 | TILE_GET_INFO( get_bg_tile_info ) |
| 20 | 15 | { |
| 16 | terracre_state *state = machine->driver_data<terracre_state>(); | |
| 21 | 17 | /* xxxx.----.----.---- |
| 22 | 18 | * ----.xx--.----.---- |
| 23 | 19 | * ----.--xx.xxxx.xxxx */ |
| 24 | unsigned data = amazon_videoram[tile_index]; | |
| 20 | unsigned data = state->amazon_videoram[tile_index]; | |
| 25 | 21 | unsigned color = data>>11; |
| 26 | 22 | SET_TILE_INFO( 1,data&0x3ff,color,0 ); |
| 27 | 23 | } |
| r10613 | r10614 | |
| 156 | 152 | |
| 157 | 153 | WRITE16_HANDLER( amazon_background_w ) |
| 158 | 154 | { |
| 159 | COMBINE_DATA( &amazon_videoram[offset] ); | |
| 160 | tilemap_mark_tile_dirty( background, offset ); | |
| 155 | terracre_state *state = space->machine->driver_data<terracre_state>(); | |
| 156 | COMBINE_DATA( &state->amazon_videoram[offset] ); | |
| 157 | tilemap_mark_tile_dirty( state->background, offset ); | |
| 161 | 158 | } |
| 162 | 159 | |
| 163 | 160 | WRITE16_HANDLER( amazon_foreground_w ) |
| r10613 | r10614 | |
| 165 | 162 | terracre_state *state = space->machine->driver_data<terracre_state>(); |
| 166 | 163 | UINT16 *videoram = state->videoram; |
| 167 | 164 | COMBINE_DATA( &videoram[offset] ); |
| 168 | tilemap_mark_tile_dirty( foreground, offset ); | |
| 165 | tilemap_mark_tile_dirty( state->foreground, offset ); | |
| 169 | 166 | } |
| 170 | 167 | |
| 171 | 168 | WRITE16_HANDLER( amazon_flipscreen_w ) |
| r10613 | r10614 | |
| 180 | 177 | |
| 181 | 178 | WRITE16_HANDLER( amazon_scrolly_w ) |
| 182 | 179 | { |
| 183 | COMBINE_DATA(&yscroll); | |
| 184 | tilemap_set_scrolly(background,0,yscroll); | |
| 180 | terracre_state *state = space->machine->driver_data<terracre_state>(); | |
| 181 | COMBINE_DATA(&state->yscroll); | |
| 182 | tilemap_set_scrolly(state->background,0,state->yscroll); | |
| 185 | 183 | } |
| 186 | 184 | |
| 187 | 185 | WRITE16_HANDLER( amazon_scrollx_w ) |
| 188 | 186 | { |
| 189 | COMBINE_DATA(&xscroll); | |
| 190 | tilemap_set_scrollx(background,0,xscroll); | |
| 187 | terracre_state *state = space->machine->driver_data<terracre_state>(); | |
| 188 | COMBINE_DATA(&state->xscroll); | |
| 189 | tilemap_set_scrollx(state->background,0,state->xscroll); | |
| 191 | 190 | } |
| 192 | 191 | |
| 193 | 192 | VIDEO_START( amazon ) |
| 194 | 193 | { |
| 195 | background = tilemap_create(machine, get_bg_tile_info,tilemap_scan_cols,16,16,64,32); | |
| 196 | foreground = tilemap_create(machine, get_fg_tile_info,tilemap_scan_cols,8,8,64,32); | |
| 197 | tilemap_set_transparent_pen(foreground,0xf); | |
| 194 | terracre_state *state = machine->driver_data<terracre_state>(); | |
| 195 | state->background = tilemap_create(machine, get_bg_tile_info,tilemap_scan_cols,16,16,64,32); | |
| 196 | state->foreground = tilemap_create(machine, get_fg_tile_info,tilemap_scan_cols,8,8,64,32); | |
| 197 | tilemap_set_transparent_pen(state->foreground,0xf); | |
| 198 | 198 | |
| 199 | 199 | /* register for saving */ |
| 200 | state_save_register_global(machine, xscroll); | |
| 201 | state_save_register_global(machine, yscroll); | |
| 200 | state_save_register_global(machine, state->xscroll); | |
| 201 | state_save_register_global(machine, state->yscroll); | |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | SCREEN_UPDATE( amazon ) |
| 205 | 205 | { |
| 206 | if( xscroll&0x2000 ) | |
| 206 | terracre_state *state = screen->machine->driver_data<terracre_state>(); | |
| 207 | if( state->xscroll&0x2000 ) | |
| 207 | 208 | bitmap_fill( bitmap,cliprect ,get_black_pen(screen->machine)); |
| 208 | 209 | else |
| 209 | tilemap_draw( bitmap,cliprect, background, 0, 0 ); | |
| 210 | tilemap_draw( bitmap,cliprect, state->background, 0, 0 ); | |
| 210 | 211 | |
| 211 | 212 | draw_sprites(screen->machine, bitmap,cliprect ); |
| 212 | tilemap_draw( bitmap,cliprect, foreground, 0, 0 ); | |
| 213 | tilemap_draw( bitmap,cliprect, state->foreground, 0, 0 ); | |
| 213 | 214 | return 0; |
| 214 | 215 | } |
| r10613 | r10614 | |
|---|---|---|
| 259 | 259 | word0 = (word0 >> 1) & 0xff; |
| 260 | 260 | if (word0 >= min) |
| 261 | 261 | { |
| 262 | if (delay[word0] == 0) | |
| 262 | if (delay[word0] == 0) | |
| 263 | 263 | { |
| 264 | 264 | if (LOG_COPPER) |
| 265 | 265 | logerror("%02X.%02X: Write to %s = %04x\n", state->last_scanline, xpos / 2, amiga_custom_names[word0 & 0xff], word1); |
| r10613 | r10614 | |
|---|---|---|
| 914 | 914 | { |
| 915 | 915 | int step=state->mosaic; |
| 916 | 916 | UINT32 *dest; |
| 917 | int x,y,xx,yy; | |
| 917 | int x,y,xx,yy,c=0; | |
| 918 | 918 | int width = screen.width(); |
| 919 | 919 | int height = screen.height(); |
| 920 | 920 | |
| r10613 | r10614 | |
| 923 | 923 | for (y=0;y<width+step;y+=step) |
| 924 | 924 | for (x=0;x<height+step;x+=step) |
| 925 | 925 | { |
| 926 | static int c=0; | |
| 927 | ||
| 928 | if (y<height && x< width) | |
| 926 | if (y < height && x < width) | |
| 929 | 927 | c=*BITMAP_ADDR32(state->mosaicbitmap, y, x); |
| 930 | 928 | |
| 931 | 929 | if (state->mosaic<0) |
| r10613 | r10614 | |
| 958 | 956 | tilemap_draw(state->mosaicbitmap, cliprect, state->bg1_tilemap, 0, 0); |
| 959 | 957 | { |
| 960 | 958 | UINT32 *dest; |
| 961 | int x,y,xx,yy; | |
| 959 | int x,y,xx,yy,c=0; | |
| 962 | 960 | int width = screen.width(); |
| 963 | 961 | int height = screen.height(); |
| 964 | 962 | |
| 965 | 963 | for (y = 0; y < width+step; y += step) |
| 966 | 964 | for (x = 0; x < height+step; x += step) |
| 967 | 965 | { |
| 968 | static int c = 0; | |
| 969 | ||
| 970 | 966 | if (y < height && x < width) |
| 971 | 967 | c = *BITMAP_ADDR32(state->mosaicbitmap, y, x); |
| 972 | 968 |
| r10613 | r10614 | |
|---|---|---|
| 10 | 10 | #include "includes/punchout.h" |
| 11 | 11 | |
| 12 | 12 | |
| 13 | static tilemap_t *bg_top_tilemap; | |
| 14 | static tilemap_t *bg_bot_tilemap; | |
| 15 | static tilemap_t *fg_tilemap; // bottom only | |
| 16 | ||
| 17 | static tilemap_t *spr1_tilemap; | |
| 18 | static tilemap_t *spr1_tilemap_flipx; | |
| 19 | static tilemap_t *spr2_tilemap; | |
| 20 | ||
| 21 | UINT8 *punchout_bg_top_videoram; | |
| 22 | UINT8 *punchout_bg_bot_videoram; | |
| 23 | UINT8 *armwrest_fg_videoram; | |
| 24 | UINT8 *punchout_spr1_videoram; | |
| 25 | UINT8 *punchout_spr2_videoram; | |
| 26 | UINT8 *punchout_spr1_ctrlram; | |
| 27 | UINT8 *punchout_spr2_ctrlram; | |
| 28 | UINT8 *punchout_palettebank; | |
| 29 | ||
| 30 | ||
| 31 | ||
| 32 | /* these depend on jumpers(?) on the board and change from game to game */ | |
| 33 | static int palette_reverse_top, palette_reverse_bot; | |
| 34 | ||
| 35 | ||
| 36 | 13 | DRIVER_INIT( punchout ) |
| 37 | 14 | { |
| 38 | palette_reverse_top = 0x00; | |
| 39 | palette_reverse_bot = 0xff; | |
| 15 | punchout_state *state = machine->driver_data<punchout_state>(); | |
| 16 | state->palette_reverse_top = 0x00; | |
| 17 | state->palette_reverse_bot = 0xff; | |
| 40 | 18 | } |
| 41 | 19 | |
| 42 | 20 | DRIVER_INIT( spnchout ) |
| 43 | 21 | { |
| 44 | palette_reverse_top = 0x00; | |
| 45 | palette_reverse_bot = 0xff; | |
| 22 | punchout_state *state = machine->driver_data<punchout_state>(); | |
| 23 | state->palette_reverse_top = 0x00; | |
| 24 | state->palette_reverse_bot = 0xff; | |
| 46 | 25 | } |
| 47 | 26 | |
| 48 | 27 | DRIVER_INIT( spnchotj ) |
| 49 | 28 | { |
| 50 | palette_reverse_top = 0xff; | |
| 51 | palette_reverse_bot = 0xff; | |
| 29 | punchout_state *state = machine->driver_data<punchout_state>(); | |
| 30 | state->palette_reverse_top = 0xff; | |
| 31 | state->palette_reverse_bot = 0xff; | |
| 52 | 32 | } |
| 53 | 33 | |
| 54 | 34 | DRIVER_INIT( armwrest ) |
| 55 | 35 | { |
| 56 | palette_reverse_top = 0x00; | |
| 57 | palette_reverse_bot = 0x00; | |
| 36 | punchout_state *state = machine->driver_data<punchout_state>(); | |
| 37 | state->palette_reverse_top = 0x00; | |
| 38 | state->palette_reverse_bot = 0x00; | |
| 58 | 39 | } |
| 59 | 40 | |
| 60 | 41 | |
| r10613 | r10614 | |
| 68 | 49 | |
| 69 | 50 | static TILE_GET_INFO( top_get_info ) |
| 70 | 51 | { |
| 71 | int attr = punchout_bg_top_videoram[tile_index*2 + 1]; | |
| 72 | int code = punchout_bg_top_videoram[tile_index*2] + ((attr & 0x03) << 8); | |
| 52 | punchout_state *state = machine->driver_data<punchout_state>(); | |
| 53 | int attr = state->bg_top_videoram[tile_index*2 + 1]; | |
| 54 | int code = state->bg_top_videoram[tile_index*2] + ((attr & 0x03) << 8); | |
| 73 | 55 | int color = ((attr & 0x7c) >> 2); |
| 74 | 56 | int flipx = attr & 0x80; |
| 75 | 57 | SET_TILE_INFO(0, code, color, flipx ? TILE_FLIPX : 0); |
| r10613 | r10614 | |
| 77 | 59 | |
| 78 | 60 | static TILE_GET_INFO( armwrest_top_get_info ) |
| 79 | 61 | { |
| 80 | int attr = punchout_bg_top_videoram[tile_index*2 + 1]; | |
| 81 | int code = punchout_bg_top_videoram[tile_index*2] + ((attr & 0x03) << 8) + ((attr & 0x80) << 3); | |
| 62 | punchout_state *state = machine->driver_data<punchout_state>(); | |
| 63 | int attr = state->bg_top_videoram[tile_index*2 + 1]; | |
| 64 | int code = state->bg_top_videoram[tile_index*2] + ((attr & 0x03) << 8) + ((attr & 0x80) << 3); | |
| 82 | 65 | int color = ((attr & 0x7c) >> 2); |
| 83 | 66 | SET_TILE_INFO(0, code, color, 0); |
| 84 | 67 | } |
| 85 | 68 | |
| 86 | 69 | static TILE_GET_INFO( bot_get_info ) |
| 87 | 70 | { |
| 88 | int attr = punchout_bg_bot_videoram[tile_index*2 + 1]; | |
| 89 | int code = punchout_bg_bot_videoram[tile_index*2] + ((attr & 0x03) << 8); | |
| 71 | punchout_state *state = machine->driver_data<punchout_state>(); | |
| 72 | int attr = state->bg_bot_videoram[tile_index*2 + 1]; | |
| 73 | int code = state->bg_bot_videoram[tile_index*2] + ((attr & 0x03) << 8); | |
| 90 | 74 | int color = ((attr & 0x7c) >> 2); |
| 91 | 75 | int flipx = attr & 0x80; |
| 92 | 76 | SET_TILE_INFO(1, code, color, flipx ? TILE_FLIPX : 0); |
| r10613 | r10614 | |
| 94 | 78 | |
| 95 | 79 | static TILE_GET_INFO( armwrest_bot_get_info ) |
| 96 | 80 | { |
| 97 | int attr = punchout_bg_bot_videoram[tile_index*2 + 1]; | |
| 98 | int code = punchout_bg_bot_videoram[tile_index*2] + ((attr & 0x03) << 8); | |
| 81 | punchout_state *state = machine->driver_data<punchout_state>(); | |
| 82 | int attr = state->bg_bot_videoram[tile_index*2 + 1]; | |
| 83 | int code = state->bg_bot_videoram[tile_index*2] + ((attr & 0x03) << 8); | |
| 99 | 84 | int color = ((attr & 0x7c) >> 2) + 0x40; |
| 100 | 85 | int flipx = attr & 0x80; |
| 101 | 86 | SET_TILE_INFO(0, code, color, flipx ? TILE_FLIPX : 0); |
| r10613 | r10614 | |
| 103 | 88 | |
| 104 | 89 | static TILE_GET_INFO( bs1_get_info ) |
| 105 | 90 | { |
| 106 | int attr = punchout_spr1_videoram[tile_index*4 + 3]; | |
| 107 | int code = punchout_spr1_videoram[tile_index*4] + ((punchout_spr1_videoram[tile_index*4 + 1] & 0x1f) << 8); | |
| 91 | punchout_state *state = machine->driver_data<punchout_state>(); | |
| 92 | int attr = state->spr1_videoram[tile_index*4 + 3]; | |
| 93 | int code = state->spr1_videoram[tile_index*4] + ((state->spr1_videoram[tile_index*4 + 1] & 0x1f) << 8); | |
| 108 | 94 | int color = attr & 0x1f; |
| 109 | 95 | int flipx = attr & 0x80; |
| 110 | 96 | SET_TILE_INFO(2, code, color, flipx ? TILE_FLIPX : 0); |
| r10613 | r10614 | |
| 112 | 98 | |
| 113 | 99 | static TILE_GET_INFO( bs2_get_info ) |
| 114 | 100 | { |
| 115 | int attr = punchout_spr2_videoram[tile_index*4 + 3]; | |
| 116 | int code = punchout_spr2_videoram[tile_index*4] + ((punchout_spr2_videoram[tile_index*4 + 1] & 0x0f) << 8); | |
| 101 | punchout_state *state = machine->driver_data<punchout_state>(); | |
| 102 | int attr = state->spr2_videoram[tile_index*4 + 3]; | |
| 103 | int code = state->spr2_videoram[tile_index*4] + ((state->spr2_videoram[tile_index*4 + 1] & 0x0f) << 8); | |
| 117 | 104 | int color = attr & 0x3f; |
| 118 | 105 | int flipx = attr & 0x80; |
| 119 | 106 | SET_TILE_INFO(3, code, color, flipx ? TILE_FLIPX : 0); |
| r10613 | r10614 | |
| 121 | 108 | |
| 122 | 109 | static TILE_GET_INFO( armwrest_fg_get_info ) |
| 123 | 110 | { |
| 124 | int attr = armwrest_fg_videoram[tile_index*2 + 1]; | |
| 125 | int code = armwrest_fg_videoram[tile_index*2] + 256 * (attr & 0x07); | |
| 111 | punchout_state *state = machine->driver_data<punchout_state>(); | |
| 112 | int attr = state->armwrest_fg_videoram[tile_index*2 + 1]; | |
| 113 | int code = state->armwrest_fg_videoram[tile_index*2] + 256 * (attr & 0x07); | |
| 126 | 114 | int color = ((attr & 0xf8) >> 3); |
| 127 | 115 | int flipx = attr & 0x80; |
| 128 | 116 | SET_TILE_INFO(1, code, color, flipx ? TILE_FLIPX : 0); |
| r10613 | r10614 | |
| 144 | 132 | |
| 145 | 133 | VIDEO_START( punchout ) |
| 146 | 134 | { |
| 147 | bg_top_tilemap = tilemap_create(machine, top_get_info, tilemap_scan_rows, 8,8, 32,32); | |
| 148 | bg_bot_tilemap = tilemap_create(machine, bot_get_info, tilemap_scan_rows, 8,8, 64,32); | |
| 149 | tilemap_set_scroll_rows(bg_bot_tilemap, 32); | |
| 135 | punchout_state *state = machine->driver_data<punchout_state>(); | |
| 136 | state->bg_top_tilemap = tilemap_create(machine, top_get_info, tilemap_scan_rows, 8,8, 32,32); | |
| 137 | state->bg_bot_tilemap = tilemap_create(machine, bot_get_info, tilemap_scan_rows, 8,8, 64,32); | |
| 138 | tilemap_set_scroll_rows(state->bg_bot_tilemap, 32); | |
| 150 | 139 | |
| 151 | spr1_tilemap = tilemap_create(machine, bs1_get_info, tilemap_scan_rows, 8,8, 16,32); | |
| 152 | spr2_tilemap = tilemap_create(machine, bs2_get_info, tilemap_scan_rows, 8,8, 16,32); | |
| 140 | state->spr1_tilemap = tilemap_create(machine, bs1_get_info, tilemap_scan_rows, 8,8, 16,32); | |
| 141 | state->spr2_tilemap = tilemap_create(machine, bs2_get_info, tilemap_scan_rows, 8,8, 16,32); | |
| 153 | 142 | |
| 154 | fg_tilemap = NULL; | |
| 143 | state->fg_tilemap = NULL; | |
| 155 | 144 | |
| 156 | tilemap_set_transparent_pen(spr1_tilemap, 0x07); | |
| 157 | tilemap_set_transparent_pen(spr2_tilemap, 0x03); | |
| 145 | tilemap_set_transparent_pen(state->spr1_tilemap, 0x07); | |
| 146 | tilemap_set_transparent_pen(state->spr2_tilemap, 0x03); | |
| 158 | 147 | } |
| 159 | 148 | |
| 160 | 149 | |
| 161 | 150 | VIDEO_START( armwrest ) |
| 162 | 151 | { |
| 163 | bg_top_tilemap = tilemap_create(machine, armwrest_top_get_info, tilemap_scan_rows, 8,8, 32,32); | |
| 164 | bg_bot_tilemap = tilemap_create(machine, armwrest_bot_get_info, tilemap_scan_rows, 8,8, 32,32); | |
| 152 | punchout_state *state = machine->driver_data<punchout_state>(); | |
| 153 | state->bg_top_tilemap = tilemap_create(machine, armwrest_top_get_info, tilemap_scan_rows, 8,8, 32,32); | |
| 154 | state->bg_bot_tilemap = tilemap_create(machine, armwrest_bot_get_info, tilemap_scan_rows, 8,8, 32,32); | |
| 165 | 155 | |
| 166 | spr1_tilemap = tilemap_create(machine, bs1_get_info, armwrest_bs1_scan, 8,8, 32,16); | |
| 167 | spr1_tilemap_flipx = tilemap_create(machine, bs1_get_info, armwrest_bs1_scan_flipx, 8,8, 32,16); | |
| 168 | spr2_tilemap = tilemap_create(machine, bs2_get_info, tilemap_scan_rows, 8,8, 16,32); | |
| 169 | fg_tilemap = tilemap_create(machine, armwrest_fg_get_info, tilemap_scan_rows, 8,8, 32,32); | |
| 156 | state->spr1_tilemap = tilemap_create(machine, bs1_get_info, armwrest_bs1_scan, 8,8, 32,16); | |
| 157 | state->spr1_tilemap_flipx = tilemap_create(machine, bs1_get_info, armwrest_bs1_scan_flipx, 8,8, 32,16); | |
| 158 | state->spr2_tilemap = tilemap_create(machine, bs2_get_info, tilemap_scan_rows, 8,8, 16,32); | |
| 159 | state->fg_tilemap = tilemap_create(machine, armwrest_fg_get_info, tilemap_scan_rows, 8,8, 32,32); | |
| 170 | 160 | |
| 171 | tilemap_set_transparent_pen(spr1_tilemap, 0x07); | |
| 172 | tilemap_set_transparent_pen(spr1_tilemap_flipx, 0x07); | |
| 173 | tilemap_set_transparent_pen(spr2_tilemap, 0x03); | |
| 174 | tilemap_set_transparent_pen(fg_tilemap, 0x07); | |
| 161 | tilemap_set_transparent_pen(state->spr1_tilemap, 0x07); | |
| 162 | tilemap_set_transparent_pen(state->spr1_tilemap_flipx, 0x07); | |
| 163 | tilemap_set_transparent_pen(state->spr2_tilemap, 0x03); | |
| 164 | tilemap_set_transparent_pen(state->fg_tilemap, 0x07); | |
| 175 | 165 | } |
| 176 | 166 | |
| 177 | 167 | |
| 178 | 168 | |
| 179 | 169 | WRITE8_HANDLER( punchout_bg_top_videoram_w ) |
| 180 | 170 | { |
| 181 | punchout_bg_top_videoram[offset] = data; | |
| 182 | tilemap_mark_tile_dirty(bg_top_tilemap, offset/2); | |
| 171 | punchout_state *state = space->machine->driver_data<punchout_state>(); | |
| 172 | state->bg_top_videoram[offset] = data; | |
| 173 | tilemap_mark_tile_dirty(state->bg_top_tilemap, offset/2); | |
| 183 | 174 | } |
| 184 | 175 | |
| 185 | 176 | WRITE8_HANDLER( punchout_bg_bot_videoram_w ) |
| 186 | 177 | { |
| 187 | punchout_bg_bot_videoram[offset] = data; | |
| 188 | tilemap_mark_tile_dirty(bg_bot_tilemap, offset/2); | |
| 178 | punchout_state *state = space->machine->driver_data<punchout_state>(); | |
| 179 | state->bg_bot_videoram[offset] = data; | |
| 180 | tilemap_mark_tile_dirty(state->bg_bot_tilemap, offset/2); | |
| 189 | 181 | } |
| 190 | 182 | |
| 191 | 183 | WRITE8_HANDLER( armwrest_fg_videoram_w ) |
| 192 | 184 | { |
| 193 | armwrest_fg_videoram[offset] = data; | |
| 194 | tilemap_mark_tile_dirty(fg_tilemap, offset/2); | |
| 185 | punchout_state *state = space->machine->driver_data<punchout_state>(); | |
| 186 | state->armwrest_fg_videoram[offset] = data; | |
| 187 | tilemap_mark_tile_dirty(state->fg_tilemap, offset/2); | |
| 195 | 188 | } |
| 196 | 189 | |
| 197 | 190 | WRITE8_HANDLER( punchout_spr1_videoram_w ) |
| 198 | 191 | { |
| 199 | punchout_spr1_videoram[offset] = data; | |
| 200 | tilemap_mark_tile_dirty(spr1_tilemap, offset/4); | |
| 201 | if (spr1_tilemap_flipx) | |
| 202 | tilemap_mark_tile_dirty(spr1_tilemap_flipx, offset/4); | |
| 192 | punchout_state *state = space->machine->driver_data<punchout_state>(); | |
| 193 | state->spr1_videoram[offset] = data; | |
| 194 | tilemap_mark_tile_dirty(state->spr1_tilemap, offset/4); | |
| 195 | if (state->spr1_tilemap_flipx) | |
| 196 | tilemap_mark_tile_dirty(state->spr1_tilemap_flipx, offset/4); | |
| 203 | 197 | } |
| 204 | 198 | |
| 205 | 199 | WRITE8_HANDLER( punchout_spr2_videoram_w ) |
| 206 | 200 | { |
| 207 | punchout_spr2_videoram[offset] = data; | |
| 208 | tilemap_mark_tile_dirty(spr2_tilemap, offset/4); | |
| 201 | punchout_state *state = space->machine->driver_data<punchout_state>(); | |
| 202 | state->spr2_videoram[offset] = data; | |
| 203 | tilemap_mark_tile_dirty(state->spr2_tilemap, offset/4); | |
| 209 | 204 | } |
| 210 | 205 | |
| 211 | 206 | |
| 212 | 207 | |
| 213 | static void draw_big_sprite(bitmap_t *bitmap, const rectangle *cliprect, int palette) | |
| 208 | static void draw_big_sprite(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int palette) | |
| 214 | 209 | { |
| 210 | punchout_state *state = machine->driver_data<punchout_state>(); | |
| 215 | 211 | int zoom; |
| 216 | 212 | |
| 217 | zoom = | |
| 213 | zoom = s | |
| 218 | 214 | if (zoom) |
| 219 | 215 | { |
| 220 | 216 | int sx,sy; |
| 221 | 217 | UINT32 startx,starty; |
| 222 | 218 | int incxx,incyy; |
| 223 | 219 | |
| 224 | sx = 4096 - ( | |
| 220 | sx = 4096 - (s | |
| 225 | 221 | if (sx > 4096-4*127) sx -= 4096; |
| 226 | 222 | |
| 227 | sy = -( | |
| 223 | sy = -(s | |
| 228 | 224 | if (sy <= -256 + zoom/0x40) sy += 512; |
| 229 | 225 | sy += 12; |
| 230 | 226 | |
| r10613 | r10614 | |
| 236 | 232 | startx += 3740 * zoom; /* adjustment to match the screen shots */ |
| 237 | 233 | starty -= 178 * zoom; /* and make the hall of fame picture nice */ |
| 238 | 234 | |
| 239 | if ( | |
| 235 | if (s | |
| 240 | 236 | { |
| 241 | 237 | startx = ((16 * 8) << 16) - startx - 1; |
| 242 | 238 | incxx = -incxx; |
| 243 | 239 | } |
| 244 | 240 | |
| 245 | tilemap_set_palette_offset(spr1_tilemap, 0x100 * palette); | |
| 241 | tilemap_set_palette_offset(state->spr1_tilemap, 0x100 * palette); | |
| 246 | 242 | |
| 247 | tilemap_draw_roz(bitmap,cliprect,spr1_tilemap, | |
| 243 | tilemap_draw_roz(bitmap,cliprect,state->spr1_tilemap, | |
| 248 | 244 | startx,starty + 0x200*(2) * zoom, |
| 249 | 245 | incxx,0,0,incyy, /* zoom, no rotation */ |
| 250 | 246 | 0, /* no wraparound */ |
| r10613 | r10614 | |
| 253 | 249 | } |
| 254 | 250 | |
| 255 | 251 | |
| 256 | static void armwrest_draw_big_sprite(bitmap_t *bitmap, const rectangle *cliprect, int palette) | |
| 252 | static void armwrest_draw_big_sprite(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int palette) | |
| 257 | 253 | { |
| 254 | punchout_state *state = machine->driver_data<punchout_state>(); | |
| 258 | 255 | int zoom; |
| 259 | 256 | |
| 260 | zoom = | |
| 257 | zoom = s | |
| 261 | 258 | if (zoom) |
| 262 | 259 | { |
| 263 | 260 | int sx,sy; |
| r10613 | r10614 | |
| 265 | 262 | int incxx,incyy; |
| 266 | 263 | tilemap_t *_tilemap; |
| 267 | 264 | |
| 268 | sx = 4096 - ( | |
| 265 | sx = 4096 - (s | |
| 269 | 266 | if (sx > 2048) sx -= 4096; |
| 270 | 267 | |
| 271 | sy = -( | |
| 268 | sy = -(s | |
| 272 | 269 | if (sy <= -256 + zoom/0x40) sy += 512; |
| 273 | 270 | sy += 12; |
| 274 | 271 | |
| r10613 | r10614 | |
| 280 | 277 | startx += 3740 * zoom; /* adjustment to match the screen shots */ |
| 281 | 278 | starty -= 178 * zoom; /* and make the hall of fame picture nice */ |
| 282 | 279 | |
| 283 | if ( | |
| 280 | if (s | |
| 284 | 281 | { |
| 285 | _tilemap = spr1_tilemap_flipx; | |
| 282 | _tilemap = state->spr1_tilemap_flipx; | |
| 286 | 283 | startx = ((32 * 8) << 16) - startx - 1; |
| 287 | 284 | incxx = -incxx; |
| 288 | 285 | } |
| 289 | 286 | else |
| 290 | _tilemap = spr1_tilemap; | |
| 287 | _tilemap = state->spr1_tilemap; | |
| 291 | 288 | |
| 292 | 289 | tilemap_set_palette_offset(_tilemap, 0x100 * palette); |
| 293 | 290 | |
| r10613 | r10614 | |
| 301 | 298 | |
| 302 | 299 | static void drawbs2(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) |
| 303 | 300 | { |
| 301 | punchout_state *state = machine->driver_data<punchout_state>(); | |
| 304 | 302 | int sx,sy; |
| 305 | 303 | int incxx; |
| 306 | 304 | |
| 307 | sx = 512 - ( | |
| 305 | sx = 512 - (s | |
| 308 | 306 | if (sx > 512-127) sx -= 512; |
| 309 | 307 | sx -= 55; /* adjustment to match the screen shots */ |
| 310 | 308 | |
| 311 | sy = - | |
| 309 | sy = -s | |
| 312 | 310 | sy += 3; /* adjustment to match the screen shots */ |
| 313 | 311 | |
| 314 | 312 | sx = -sx << 16; |
| 315 | 313 | sy = -sy << 16; |
| 316 | 314 | |
| 317 | if ( | |
| 315 | if (s | |
| 318 | 316 | { |
| 319 | 317 | sx = ((16 * 8) << 16) - sx - 1; |
| 320 | 318 | incxx = -1; |
| r10613 | r10614 | |
| 323 | 321 | incxx = 1; |
| 324 | 322 | |
| 325 | 323 | // this tilemap doesn't actually zoom, but draw_roz is the only way to draw it without wraparound |
| 326 | tilemap_draw_roz(bitmap,cliprect,spr2_tilemap, | |
| 324 | tilemap_draw_roz(bitmap,cliprect,state->spr2_tilemap, | |
| 327 | 325 | sx, sy, incxx << 16, 0, 0, 1 << 16, |
| 328 | 326 | 0, 0, 0); |
| 329 | 327 | } |
| r10613 | r10614 | |
| 332 | 330 | |
| 333 | 331 | static void punchout_copy_top_palette(running_machine *machine, int bank) |
| 334 | 332 | { |
| 333 | punchout_state *state = machine->driver_data<punchout_state>(); | |
| 335 | 334 | int i; |
| 336 | 335 | const UINT8 *color_prom = machine->region("proms")->base(); |
| 337 | 336 | |
| r10613 | r10614 | |
| 345 | 344 | g = 255 - pal4bit(color_prom[i + 0x200 + base]); |
| 346 | 345 | b = 255 - pal4bit(color_prom[i + 0x400 + base]); |
| 347 | 346 | |
| 348 | palette_set_color(machine, i ^ palette_reverse_top, MAKE_RGB(r, g, b)); | |
| 347 | palette_set_color(machine, i ^ state->palette_reverse_top, MAKE_RGB(r, g, b)); | |
| 349 | 348 | } |
| 350 | 349 | } |
| 351 | 350 | |
| 352 | 351 | static void punchout_copy_bot_palette(running_machine *machine, int bank) |
| 353 | 352 | { |
| 353 | punchout_state *state = machine->driver_data<punchout_state>(); | |
| 354 | 354 | int i; |
| 355 | 355 | const UINT8 *color_prom = machine->region("proms")->base() + 0x600; |
| 356 | 356 | |
| r10613 | r10614 | |
| 364 | 364 | g = 255 - pal4bit(color_prom[i + 0x200 + base]); |
| 365 | 365 | b = 255 - pal4bit(color_prom[i + 0x400 + base]); |
| 366 | 366 | |
| 367 | palette_set_color(machine, (i ^ palette_reverse_bot) + 0x100, MAKE_RGB(r, g, b)); | |
| 367 | palette_set_color(machine, (i ^ state->palette_reverse_bot) + 0x100, MAKE_RGB(r, g, b)); | |
| 368 | 368 | } |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | |
| 372 | 372 | SCREEN_UPDATE( punchout ) |
| 373 | 373 | { |
| 374 | punchout_state *state = screen->machine->driver_data<punchout_state>(); | |
| 374 | 375 | device_t *top_screen = screen->machine->device("top"); |
| 375 | 376 | device_t *bottom_screen = screen->machine->device("bottom"); |
| 376 | 377 | |
| 377 | 378 | if (screen == top_screen) |
| 378 | 379 | { |
| 379 | punchout_copy_top_palette(screen->machine, BIT(* | |
| 380 | punchout_copy_top_palette(screen->machine, BIT(*s | |
| 380 | 381 | |
| 381 | tilemap_draw(bitmap, cliprect, bg_top_tilemap, 0, 0); | |
| 382 | tilemap_draw(bitmap, cliprect, state->bg_top_tilemap, 0, 0); | |
| 382 | 383 | |
| 383 | if (punchout_spr1_ctrlram[7] & 1) /* display in top monitor */ | |
| 384 | draw_big_sprite(bitmap, cliprect, 0); | |
| 384 | if (state->spr1_ctrlram[7] & 1) /* display in top monitor */ | |
| 385 | draw_big_sprite(screen->machine, bitmap, cliprect, 0); | |
| 385 | 386 | } |
| 386 | 387 | else if (screen == bottom_screen) |
| 387 | 388 | { |
| 388 | 389 | int offs; |
| 389 | 390 | |
| 390 | punchout_copy_bot_palette(screen->machine, BIT(* | |
| 391 | punchout_copy_bot_palette(screen->machine, BIT(*s | |
| 391 | 392 | |
| 392 | 393 | /* copy the character mapped graphics */ |
| 393 | 394 | for (offs = 0;offs < 32;offs++) |
| 394 | tilemap_set_scrollx(bg_bot_tilemap, offs, 58 + | |
| 395 | tilemap_set_scrollx(state->bg_bot_tilemap, offs, 58 + s | |
| 395 | 396 | |
| 396 | tilemap_draw(bitmap, cliprect, bg_bot_tilemap, 0, 0); | |
| 397 | tilemap_draw(bitmap, cliprect, state->bg_bot_tilemap, 0, 0); | |
| 397 | 398 | |
| 398 | if (punchout_spr1_ctrlram[7] & 2) /* display in bottom monitor */ | |
| 399 | draw_big_sprite(bitmap, cliprect, 1); | |
| 399 | if (state->spr1_ctrlram[7] & 2) /* display in bottom monitor */ | |
| 400 | draw_big_sprite(screen->machine, bitmap, cliprect, 1); | |
| 400 | 401 | drawbs2(screen->machine, bitmap, cliprect); |
| 401 | 402 | } |
| 402 | 403 | return 0; |
| r10613 | r10614 | |
| 405 | 406 | |
| 406 | 407 | SCREEN_UPDATE( armwrest ) |
| 407 | 408 | { |
| 409 | punchout_state *state = screen->machine->driver_data<punchout_state>(); | |
| 408 | 410 | device_t *top_screen = screen->machine->device("top"); |
| 409 | 411 | device_t *bottom_screen = screen->machine->device("bottom"); |
| 410 | 412 | |
| 411 | 413 | if (screen == top_screen) |
| 412 | 414 | { |
| 413 | punchout_copy_top_palette(screen->machine, BIT(* | |
| 415 | punchout_copy_top_palette(screen->machine, BIT(*s | |
| 414 | 416 | |
| 415 | tilemap_draw(bitmap, cliprect, bg_top_tilemap, 0, 0); | |
| 417 | tilemap_draw(bitmap, cliprect, state->bg_top_tilemap, 0, 0); | |
| 416 | 418 | |
| 417 | if (punchout_spr1_ctrlram[7] & 1) /* display in top monitor */ | |
| 418 | armwrest_draw_big_sprite(bitmap, cliprect, 0); | |
| 419 | if (state->spr1_ctrlram[7] & 1) /* display in top monitor */ | |
| 420 | armwrest_draw_big_sprite(screen->machine, bitmap, cliprect, 0); | |
| 419 | 421 | } |
| 420 | 422 | else if (screen == bottom_screen) |
| 421 | 423 | { |
| 422 | punchout_copy_bot_palette(screen->machine, BIT(* | |
| 424 | punchout_copy_bot_palette(screen->machine, BIT(*s | |
| 423 | 425 | |
| 424 | tilemap_draw(bitmap, cliprect, bg_bot_tilemap, 0, 0); | |
| 426 | tilemap_draw(bitmap, cliprect, state->bg_bot_tilemap, 0, 0); | |
| 425 | 427 | |
| 426 | if (punchout_spr1_ctrlram[7] & 2) /* display in bottom monitor */ | |
| 427 | armwrest_draw_big_sprite(bitmap, cliprect, 1); | |
| 428 | if (state->spr1_ctrlram[7] & 2) /* display in bottom monitor */ | |
| 429 | armwrest_draw_big_sprite(screen->machine, bitmap, cliprect, 1); | |
| 428 | 430 | drawbs2(screen->machine, bitmap, cliprect); |
| 429 | 431 | |
| 430 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); | |
| 432 | tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0); | |
| 431 | 433 | } |
| 432 | 434 | return 0; |
| 433 | 435 | } |
| r10613 | r10614 | |
|---|---|---|
| 1 | 1 | #include "emu.h" |
| 2 | 2 | #include "includes/xorworld.h" |
| 3 | 3 | |
| 4 | static tilemap_t *bg_tilemap; | |
| 5 | 4 | |
| 6 | 5 | /*************************************************************************** |
| 7 | 6 | |
| r10613 | r10614 | |
| 54 | 53 | xorworld_state *state = space->machine->driver_data<xorworld_state>(); |
| 55 | 54 | UINT16 *videoram = state->videoram; |
| 56 | 55 | COMBINE_DATA(&videoram[offset]); |
| 57 | tilemap_mark_tile_dirty(bg_tilemap, offset); | |
| 56 | tilemap_mark_tile_dirty(state->bg_tilemap, offset); | |
| 58 | 57 | } |
| 59 | 58 | |
| 60 | 59 | /* |
| r10613 | r10614 | |
| 79 | 78 | |
| 80 | 79 | VIDEO_START( xorworld ) |
| 81 | 80 | { |
| 82 | bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, | |
| 81 | xorworld_state *state = machine->driver_data<xorworld_state>(); | |
| 82 | state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, | |
| 83 | 83 | 8, 8, 32, 32); |
| 84 | 84 | } |
| 85 | 85 | |
| r10613 | r10614 | |
| 114 | 114 | |
| 115 | 115 | SCREEN_UPDATE( xorworld ) |
| 116 | 116 | { |
| 117 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); | |
| 117 | xorworld_state *state = screen->machine->driver_data<xorworld_state>(); | |
| 118 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 118 | 119 | draw_sprites(screen->machine, bitmap, cliprect); |
| 119 | 120 | return 0; |
| 120 | 121 | } |
| r10613 | r10614 | |
|---|---|---|
| 719 | 719 | * TRS1 board states 3.3u. |
| 720 | 720 | */ |
| 721 | 721 | |
| 722 | static double cv1=0,cv2=0,vg1=0,vg2=0,vg3=0,cv3=0,cv4=0; | |
| 723 | 722 | double vg3i; |
| 724 | static int pixelcnt = 0; | |
| 725 | 723 | double diff; |
| 726 | 724 | int sig; |
| 727 | 725 | |
| r10613 | r10614 | |
| 750 | 748 | state->rflip_sig = !state->rflip_sig; |
| 751 | 749 | |
| 752 | 750 | if (sig) /* 128VF */ |
| 753 | diff = (0.0 - cv1); | |
| 751 | diff = (0.0 - state->cv1); | |
| 754 | 752 | else |
| 755 | diff = (3.4 - cv1); | |
| 753 | diff = (3.4 - state->cv1); | |
| 756 | 754 | diff = diff - diff*exp(0.0 - (1.0/RC1 * dt) ); |
| 757 | cv1 += diff; | |
| 755 | state->cv1 += diff; | |
| 758 | 756 | |
| 759 | diff = (cv1 - cv2 - vg1); | |
| 757 | diff = (state->cv1 - state->cv2 - state->vg1); | |
| 760 | 758 | diff = diff - diff*exp(0.0 - (1.0/RC2 * dt) ); |
| 761 | cv2 += diff; | |
| 759 | state->cv2 += diff; | |
| 762 | 760 | |
| 763 | vg1 = (cv1 - cv2)*0.9 + 0.1 * vg2; | |
| 764 | vg2 = 5*CD4049(machine, vg1/5); | |
| 761 | state->vg1 = (state->cv1 - state->cv2)*0.9 + 0.1 * state->vg2; | |
| 762 | state->vg2 = 5*CD4049(machine, state->vg1/5); | |
| 765 | 763 | |
| 766 | 764 | /* on the real hardware, the gain would be 1. |
| 767 | 765 | * This will not work here. |
| 768 | 766 | */ |
| 769 | vg3i = 0.9*vg2 + 0.1 * vg3; | |
| 770 | vg3 = 5*CD4049(machine, vg3i/5); | |
| 767 | vg3i = 0.9*state->vg2 + 0.1 * state->vg3; | |
| 768 | state->vg3 = 5*CD4049(machine, vg3i/5); | |
| 771 | 769 | |
| 772 | state->blue_level = (int)(vg3/5.0*255); | |
| 770 | state->blue_level = (int)(state->vg3/5.0*255); | |
| 773 | 771 | |
| 774 | 772 | /* |
| 775 | 773 | * Grid signal |
| r10613 | r10614 | |
| 778 | 776 | */ |
| 779 | 777 | if (state->grid_on && latch8_bit5_r(state->dev_vp2, 0)) |
| 780 | 778 | { |
| 781 | diff = (0.0 - cv3); | |
| 779 | diff = (0.0 - state->cv3); | |
| 782 | 780 | diff = diff - diff*exp(0.0 - (1.0/RC32 * dt) ); |
| 783 | 781 | } |
| 784 | 782 | else |
| 785 | 783 | { |
| 786 | diff = (5.0 - cv3); | |
| 784 | diff = (5.0 - state->cv3); | |
| 787 | 785 | diff = diff - diff*exp(0.0 - (1.0/RC31 * dt) ); |
| 788 | 786 | } |
| 789 | cv3 += diff; | |
| 787 | state->cv3 += diff; | |
| 790 | 788 | |
| 791 | diff = (vg2 - 0.8 * cv3 - cv4); | |
| 789 | diff = (state->vg2 - 0.8 * state->cv3 - state->cv4); | |
| 792 | 790 | diff = diff - diff*exp(0.0 - (1.0/RC4 * dt) ); |
| 793 | cv4 += diff; | |
| 791 | state->cv4 += diff; | |
| 794 | 792 | |
| 795 | if (CD4049(machine, CD4049(machine, vg2 - cv4))>2.4/5.0) /* TTL - Level */ | |
| 793 | if (CD4049(machine, CD4049(machine, state->vg2 - state->cv4))>2.4/5.0) /* TTL - Level */ | |
| 796 | 794 | state->grid_sig = 0; |
| 797 | 795 | else |
| 798 | 796 | state->grid_sig = 1; |
| 799 | 797 | |
| 800 | 798 | /* stars */ |
| 801 | pixelcnt += HTOTAL; | |
| 802 | if (pixelcnt > period2 ) | |
| 799 | state->pixelcnt += HTOTAL; | |
| 800 | if (state->pixelcnt > period2 ) | |
| 803 | 801 | { |
| 804 | 802 | state->star_ff = !state->star_ff; |
| 805 | pixelcnt = pixelcnt - period2; | |
| 803 | state->pixelcnt = state->pixelcnt - period2; | |
| 806 | 804 | } |
| 807 | 805 | |
| 808 | 806 | } |
| r10613 | r10614 | |
| 842 | 840 | int table_len = state->gfx3_len; |
| 843 | 841 | int x,y,offset; |
| 844 | 842 | UINT16 *pixel; |
| 845 | static int counter=0; | |
| 846 | 843 | const rectangle &visarea = machine->primary_screen->visible_area(); |
| 847 | 844 | |
| 848 | 845 | y = scanline; |
| 849 | 846 | radarscp_step(machine, y); |
| 850 | 847 | if (y <= visarea.min_y || y > visarea.max_y) |
| 851 | counter = 0; | |
| 848 | state->counter = 0; | |
| 852 | 849 | offset = (state->flip ^ state->rflip_sig) ? 0x000 : 0x400; |
| 853 | 850 | x = 0; |
| 854 | 851 | while (x < machine->primary_screen->width()) |
| 855 | 852 | { |
| 856 | 853 | pixel = BITMAP_ADDR16(state->bg_bits, y, x); |
| 857 | if ((counter < table_len) && (x == 4 * (table[counter|offset] & 0x7f))) | |
| 854 | if ((state->counter < table_len) && (x == 4 * (table[state->counter|offset] & 0x7f))) | |
| 858 | 855 | { |
| 859 | if ( state->star_ff && (table[counter|offset] & 0x80) ) /* star */ | |
| 856 | if ( state->star_ff && (table[state->counter|offset] & 0x80) ) /* star */ | |
| 860 | 857 | *pixel = RADARSCP_STAR_COL; |
| 861 | else if (state->grid_sig && !(table[counter|offset] & 0x80)) /* radar */ | |
| 858 | else if (state->grid_sig && !(table[state->counter|offset] & 0x80)) /* radar */ | |
| 862 | 859 | *pixel = RADARSCP_GRID_COL_OFFSET+state->grid_col; |
| 863 | 860 | else |
| 864 | 861 | *pixel = RADARSCP_BCK_COL_OFFSET + state->blue_level; |
| 865 | counter++; | |
| 862 | state->counter++; | |
| 866 | 863 | } |
| 867 | 864 | else |
| 868 | 865 | *pixel = RADARSCP_BCK_COL_OFFSET + state->blue_level; |
| 869 | 866 | x++; |
| 870 | 867 | } |
| 871 | while ((counter < table_len) && ( x < 4 * (table[counter|offset] & 0x7f))) | |
| 872 | counter++; | |
| 868 | while ((state->counter < table_len) && ( x < 4 * (table[state->counter|offset] & 0x7f))) | |
| 869 | state->counter++; | |
| 873 | 870 | } |
| 874 | 871 | |
| 875 | 872 | static TIMER_CALLBACK( scanline_callback ) |
| r10613 | r10614 | |
|---|---|---|
| 434 | 434 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 435 | 435 | MCFG_SCREEN_SIZE(SCREEN_WIDTH, SCREEN_HEIGHT) |
| 436 | 436 | MCFG_SCREEN_VISIBLE_AREA(0, SCREEN_WIDTH - 1, 0, SCREEN_HEIGHT - 1) |
| 437 | MCFG_SCREEN_UPDATE(20pacgal) | |
| 437 | MCFG_SCREEN_UPDATE(20pacgal) | |
| 438 | 438 | MACHINE_CONFIG_END |
| r10613 | r10614 | |
|---|---|---|
| 439 | 439 | |
| 440 | 440 | MACHINE_CONFIG_FRAGMENT( demoneye_video ) |
| 441 | 441 | MCFG_VIDEO_START(redalert) |
| 442 | ||
| 442 | ||
| 443 | 443 | MCFG_SCREEN_ADD("screen", RASTER) |
| 444 | 444 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 445 | 445 | MCFG_SCREEN_REFRESH_RATE(60) |
| r10613 | r10614 | |
| 453 | 453 | MACHINE_CONFIG_FRAGMENT( panther_video ) |
| 454 | 454 | |
| 455 | 455 | MCFG_VIDEO_START(ww3) |
| 456 | ||
| 456 | ||
| 457 | 457 | MCFG_SCREEN_ADD("screen", RASTER) |
| 458 | 458 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 459 | 459 | MCFG_SCREEN_REFRESH_RATE(60) |
| r10613 | r10614 | |
|---|---|---|
| 213 | 213 | zoomy = zoomylatch; |
| 214 | 214 | |
| 215 | 215 | /* Note: like taito_f2.c, this zoom implementation is wrong, |
| 216 | chopped up into 16x16 sections instead of one sprite. This | |
| 217 | is especially visible in rambo3. */ | |
| 216 | chopped up into 16x16 sections instead of one sprite. This | |
| 217 | is especially visible in rambo3. */ | |
| 218 | 218 | |
| 219 | 219 | x = xlatch + (x_no * (0xff - zoomx) + 15) / 16; |
| 220 | 220 | y = ylatch + (y_no * (0xff - zoomy) + 15) / 16; |
| r10613 | r10614 | |
|---|---|---|
| 11 | 11 | #include "includes/wiping.h" |
| 12 | 12 | |
| 13 | 13 | |
| 14 | static int flipscreen; | |
| 15 | UINT8 *wiping_videoram; | |
| 16 | UINT8 *wiping_colorram; | |
| 17 | ||
| 18 | ||
| 19 | 14 | /*************************************************************************** |
| 20 | 15 | |
| 21 | 16 | Convert the color PROMs into a more useable format. |
| r10613 | r10614 | |
| 86 | 81 | |
| 87 | 82 | WRITE8_HANDLER( wiping_flipscreen_w ) |
| 88 | 83 | { |
| 89 | flipscreen = (data & 1); | |
| 84 | wiping_state *state = space->machine->driver_data<wiping_state>(); | |
| 85 | state->flipscreen = (data & 1); | |
| 90 | 86 | } |
| 91 | 87 | |
| 92 | 88 | |
| 93 | 89 | SCREEN_UPDATE( wiping ) |
| 94 | 90 | { |
| 91 | wiping_state *state = screen->machine->driver_data<wiping_state>(); | |
| 95 | 92 | UINT8 *spriteram = screen->machine->generic.spriteram.u8; |
| 96 | 93 | int offs; |
| 97 | 94 | |
| r10613 | r10614 | |
| 118 | 115 | sy = my - 2; |
| 119 | 116 | } |
| 120 | 117 | |
| 121 | if (flipscreen) | |
| 118 | if (state->flipscreen) | |
| 122 | 119 | { |
| 123 | 120 | sx = 35 - sx; |
| 124 | 121 | sy = 27 - sy; |
| 125 | 122 | } |
| 126 | 123 | |
| 127 | 124 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0], |
| 128 | wiping_videoram[offs], | |
| 129 | wiping_colorram[offs] & 0x3f, | |
| 130 | flipscreen,flipscreen, | |
| 125 | state->videoram[offs], | |
| 126 | state->colorram[offs] & 0x3f, | |
| 127 | state->flipscreen,state->flipscreen, | |
| 131 | 128 | sx*8,sy*8); |
| 132 | 129 | } |
| 133 | 130 | |
| r10613 | r10614 | |
| 145 | 142 | flipy = spriteram[offs] & 0x40; |
| 146 | 143 | flipx = spriteram[offs] & 0x80; |
| 147 | 144 | |
| 148 | if (flipscreen) | |
| 145 | if (state->flipscreen) | |
| 149 | 146 | { |
| 150 | 147 | sy = 208 - sy; |
| 151 | 148 | flipx = !flipx; |
| r10613 | r10614 | |
| 163 | 160 | /* redraw high priority chars */ |
| 164 | 161 | for (offs = 0x3ff; offs > 0; offs--) |
| 165 | 162 | { |
| 166 | if ( | |
| 163 | if (state->colorram[offs] & 0x80) | |
| 167 | 164 | { |
| 168 | 165 | int mx,my,sx,sy; |
| 169 | 166 | |
| r10613 | r10614 | |
| 186 | 183 | sy = my - 2; |
| 187 | 184 | } |
| 188 | 185 | |
| 189 | if (flipscreen) | |
| 186 | if (state->flipscreen) | |
| 190 | 187 | { |
| 191 | 188 | sx = 35 - sx; |
| 192 | 189 | sy = 27 - sy; |
| 193 | 190 | } |
| 194 | 191 | |
| 195 | 192 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0], |
| 196 | wiping_videoram[offs], | |
| 197 | wiping_colorram[offs] & 0x3f, | |
| 198 | flipscreen,flipscreen, | |
| 193 | state->videoram[offs], | |
| 194 | state->colorram[offs] & 0x3f, | |
| 195 | state->flipscreen,state->flipscreen, | |
| 199 | 196 | sx*8,sy*8); |
| 200 | 197 | } |
| 201 | 198 | } |
| r10613 | r10614 | |
| 204 | 201 | #if 0 |
| 205 | 202 | { |
| 206 | 203 | int i,j; |
| 207 | extern UINT8 *wiping_soundregs; | |
| 208 | 204 | |
| 209 | 205 | for (i = 0;i < 8;i++) |
| 210 | 206 | { |
| 211 | 207 | for (j = 0;j < 8;j++) |
| 212 | 208 | { |
| 213 | 209 | char buf[40]; |
| 214 | sprintf(buf,"%01x", | |
| 210 | sprintf(buf,"%01x",state->soundregs[i*8+j]&0xf); | |
| 215 | 211 | ui_draw_text(buf,j*10,i*8); |
| 216 | 212 | } |
| 217 | 213 | } |
| r10613 | r10614 | |
| 221 | 217 | for (j = 0;j < 8;j++) |
| 222 | 218 | { |
| 223 | 219 | char buf[40]; |
| 224 | sprintf(buf,"%01x", | |
| 220 | sprintf(buf,"%01x",state->soundregs[0x2000+i*8+j]>>4); | |
| 225 | 221 | ui_draw_text(buf,j*10,80+i*8); |
| 226 | 222 | } |
| 227 | 223 | } |
| r10613 | r10614 | |
|---|---|---|
| 9 | 9 | #include "emu.h" |
| 10 | 10 | #include "includes/popeye.h" |
| 11 | 11 | |
| 12 | UINT8 *popeye_videoram; | |
| 13 | UINT8 *popeye_colorram; | |
| 14 | UINT8 *popeye_background_pos; | |
| 15 | UINT8 *popeye_palettebank; | |
| 16 | static UINT8 *popeye_bitmapram; | |
| 17 | 12 | static const size_t popeye_bitmapram_size = 0x2000; |
| 18 | 13 | |
| 19 | static bitmap_t *tmpbitmap2; | |
| 20 | static UINT8 invertmask; | |
| 21 | static UINT8 bitmap_type; | |
| 22 | 14 | enum { TYPE_SKYSKIPR, TYPE_POPEYE }; |
| 23 | 15 | |
| 24 | static tilemap_t *fg_tilemap; | |
| 25 | 16 | |
| 26 | static UINT8 lastflip; | |
| 27 | 17 | |
| 28 | 18 | /*************************************************************************** |
| 29 | 19 | |
| r10613 | r10614 | |
| 61 | 51 | ***************************************************************************/ |
| 62 | 52 | static void convert_color_prom(running_machine *machine,const UINT8 *color_prom) |
| 63 | 53 | { |
| 54 | popeye_state *state = machine->driver_data<popeye_state>(); | |
| 64 | 55 | int i; |
| 65 | 56 | |
| 66 | 57 | |
| r10613 | r10614 | |
| 74 | 65 | int bit0,bit1,bit2,r,g,b; |
| 75 | 66 | |
| 76 | 67 | /* red component */ |
| 77 | bit0 = ((color_prom[prom_offs] ^ invertmask) >> 0) & 0x01; | |
| 78 | bit1 = ((color_prom[prom_offs] ^ invertmask) >> 1) & 0x01; | |
| 79 | bit2 = ((color_prom[prom_offs] ^ invertmask) >> 2) & 0x01; | |
| 68 | bit0 = ((color_prom[prom_offs] ^ state->invertmask) >> 0) & 0x01; | |
| 69 | bit1 = ((color_prom[prom_offs] ^ state->invertmask) >> 1) & 0x01; | |
| 70 | bit2 = ((color_prom[prom_offs] ^ state->invertmask) >> 2) & 0x01; | |
| 80 | 71 | r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; |
| 81 | 72 | /* green component */ |
| 82 | bit0 = ((color_prom[prom_offs] ^ invertmask) >> 3) & 0x01; | |
| 83 | bit1 = ((color_prom[prom_offs] ^ invertmask) >> 4) & 0x01; | |
| 84 | bit2 = ((color_prom[prom_offs] ^ invertmask) >> 5) & 0x01; | |
| 73 | bit0 = ((color_prom[prom_offs] ^ state->invertmask) >> 3) & 0x01; | |
| 74 | bit1 = ((color_prom[prom_offs] ^ state->invertmask) >> 4) & 0x01; | |
| 75 | bit2 = ((color_prom[prom_offs] ^ state->invertmask) >> 5) & 0x01; | |
| 85 | 76 | g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; |
| 86 | 77 | /* blue component */ |
| 87 | 78 | bit0 = 0; |
| 88 | bit1 = ((color_prom[prom_offs] ^ invertmask) >> 6) & 0x01; | |
| 89 | bit2 = ((color_prom[prom_offs] ^ invertmask) >> 7) & 0x01; | |
| 79 | bit1 = ((color_prom[prom_offs] ^ state->invertmask) >> 6) & 0x01; | |
| 80 | bit2 = ((color_prom[prom_offs] ^ state->invertmask) >> 7) & 0x01; | |
| 90 | 81 | b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; |
| 91 | 82 | |
| 92 | 83 | palette_set_color(machine,16 + (2 * i) + 1,MAKE_RGB(r,g,b)); |
| r10613 | r10614 | |
| 101 | 92 | |
| 102 | 93 | |
| 103 | 94 | /* red component */ |
| 104 | bit0 = ((color_prom[0] ^ invertmask) >> 0) & 0x01; | |
| 105 | bit1 = ((color_prom[0] ^ invertmask) >> 1) & 0x01; | |
| 106 | bit2 = ((color_prom[0] ^ invertmask) >> 2) & 0x01; | |
| 95 | bit0 = ((color_prom[0] ^ state->invertmask) >> 0) & 0x01; | |
| 96 | bit1 = ((color_prom[0] ^ state->invertmask) >> 1) & 0x01; | |
| 97 | bit2 = ((color_prom[0] ^ state->invertmask) >> 2) & 0x01; | |
| 107 | 98 | r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; |
| 108 | 99 | /* green component */ |
| 109 | bit0 = ((color_prom[0] ^ invertmask) >> 3) & 0x01; | |
| 110 | bit1 = ((color_prom[256] ^ invertmask) >> 0) & 0x01; | |
| 111 | bit2 = ((color_prom[256] ^ invertmask) >> 1) & 0x01; | |
| 100 | bit0 = ((color_prom[0] ^ state->invertmask) >> 3) & 0x01; | |
| 101 | bit1 = ((color_prom[256] ^ state->invertmask) >> 0) & 0x01; | |
| 102 | bit2 = ((color_prom[256] ^ state->invertmask) >> 1) & 0x01; | |
| 112 | 103 | g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; |
| 113 | 104 | /* blue component */ |
| 114 | 105 | bit0 = 0; |
| 115 | bit1 = ((color_prom[256] ^ invertmask) >> 2) & 0x01; | |
| 116 | bit2 = ((color_prom[256] ^ invertmask) >> 3) & 0x01; | |
| 106 | bit1 = ((color_prom[256] ^ state->invertmask) >> 2) & 0x01; | |
| 107 | bit2 = ((color_prom[256] ^ state->invertmask) >> 3) & 0x01; | |
| 117 | 108 | b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; |
| 118 | 109 | |
| 119 | 110 | palette_set_color(machine,48+i,MAKE_RGB(r,g,b)); |
| r10613 | r10614 | |
| 124 | 115 | |
| 125 | 116 | PALETTE_INIT( popeye ) |
| 126 | 117 | { |
| 127 | invertmask = 0xff; | |
| 118 | popeye_state *state = machine->driver_data<popeye_state>(); | |
| 119 | state->invertmask = 0xff; | |
| 128 | 120 | |
| 129 | 121 | convert_color_prom(machine,color_prom); |
| 130 | 122 | } |
| 131 | 123 | |
| 132 | 124 | PALETTE_INIT( popeyebl ) |
| 133 | 125 | { |
| 134 | invertmask = 0x00; | |
| 126 | popeye_state *state = machine->driver_data<popeye_state>(); | |
| 127 | state->invertmask = 0x00; | |
| 135 | 128 | |
| 136 | 129 | convert_color_prom(machine,color_prom); |
| 137 | 130 | } |
| 138 | 131 | |
| 139 | 132 | static void set_background_palette(running_machine *machine,int bank) |
| 140 | 133 | { |
| 134 | popeye_state *state = machine->driver_data<popeye_state>(); | |
| 141 | 135 | int i; |
| 142 | 136 | UINT8 *color_prom = machine->region("proms")->base() + 16 * bank; |
| 143 | 137 | |
| r10613 | r10614 | |
| 147 | 141 | int r,g,b; |
| 148 | 142 | |
| 149 | 143 | /* red component */ |
| 150 | bit0 = ((*color_prom ^ invertmask) >> 0) & 0x01; | |
| 151 | bit1 = ((*color_prom ^ invertmask) >> 1) & 0x01; | |
| 152 | bit2 = ((*color_prom ^ invertmask) >> 2) & 0x01; | |
| 144 | bit0 = ((*color_prom ^ state->invertmask) >> 0) & 0x01; | |
| 145 | bit1 = ((*color_prom ^ state->invertmask) >> 1) & 0x01; | |
| 146 | bit2 = ((*color_prom ^ state->invertmask) >> 2) & 0x01; | |
| 153 | 147 | r = 0x1c * bit0 + 0x31 * bit1 + 0x47 * bit2; |
| 154 | 148 | /* green component */ |
| 155 | bit0 = ((*color_prom ^ invertmask) >> 3) & 0x01; | |
| 156 | bit1 = ((*color_prom ^ invertmask) >> 4) & 0x01; | |
| 157 | bit2 = ((*color_prom ^ invertmask) >> 5) & 0x01; | |
| 149 | bit0 = ((*color_prom ^ state->invertmask) >> 3) & 0x01; | |
| 150 | bit1 = ((*color_prom ^ state->invertmask) >> 4) & 0x01; | |
| 151 | bit2 = ((*color_prom ^ state->invertmask) >> 5) & 0x01; | |
| 158 | 152 | g = 0x1c * bit0 + 0x31 * bit1 + 0x47 * bit2; |
| 159 | 153 | /* blue component */ |
| 160 | 154 | bit0 = 0; |
| 161 | bit1 = ((*color_prom ^ invertmask) >> 6) & 0x01; | |
| 162 | bit2 = ((*color_prom ^ invertmask) >> 7) & 0x01; | |
| 163 | if (bitmap_type == TYPE_SKYSKIPR) | |
| 155 | bit1 = ((*color_prom ^ state->invertmask) >> 6) & 0x01; | |
| 156 | bit2 = ((*color_prom ^ state->invertmask) >> 7) & 0x01; | |
| 157 | if (state->bitmap_type == TYPE_SKYSKIPR) | |
| 164 | 158 | { |
| 165 | 159 | /* Sky Skipper has different weights */ |
| 166 | 160 | bit0 = bit1; |
| r10613 | r10614 | |
| 176 | 170 | |
| 177 | 171 | WRITE8_HANDLER( popeye_videoram_w ) |
| 178 | 172 | { |
| 179 | popeye_videoram[offset] = data; | |
| 180 | tilemap_mark_tile_dirty(fg_tilemap, offset); | |
| 173 | popeye_state *state = space->machine->driver_data<popeye_state>(); | |
| 174 | state->videoram[offset] = data; | |
| 175 | tilemap_mark_tile_dirty(state->fg_tilemap, offset); | |
| 181 | 176 | } |
| 182 | 177 | |
| 183 | 178 | WRITE8_HANDLER( popeye_colorram_w ) |
| 184 | 179 | { |
| 185 | popeye_colorram[offset] = data; | |
| 186 | tilemap_mark_tile_dirty(fg_tilemap, offset); | |
| 180 | popeye_state *state = space->machine->driver_data<popeye_state>(); | |
| 181 | state->colorram[offset] = data; | |
| 182 | tilemap_mark_tile_dirty(state->fg_tilemap, offset); | |
| 187 | 183 | } |
| 188 | 184 | |
| 189 | 185 | WRITE8_HANDLER( popeye_bitmap_w ) |
| 190 | 186 | { |
| 187 | popeye_state *state = space->machine->driver_data<popeye_state>(); | |
| 191 | 188 | int sx,sy,x,y,colour; |
| 192 | 189 | |
| 193 | | |
| 190 | state-> | |
| 194 | 191 | |
| 195 | if (bitmap_type == TYPE_SKYSKIPR) | |
| 192 | if (state->bitmap_type == TYPE_SKYSKIPR) | |
| 196 | 193 | { |
| 197 | 194 | sx = 8 * (offset % 128); |
| 198 | 195 | sy = 8 * (offset / 128); |
| r10613 | r10614 | |
| 205 | 202 | { |
| 206 | 203 | for (x = 0; x < 8; x++) |
| 207 | 204 | { |
| 208 | *BITMAP_ADDR16(tmpbitmap2, sy+y, sx+x) = colour; | |
| 205 | *BITMAP_ADDR16(state->tmpbitmap2, sy+y, sx+x) = colour; | |
| 209 | 206 | } |
| 210 | 207 | } |
| 211 | 208 | } |
| r10613 | r10614 | |
| 222 | 219 | { |
| 223 | 220 | for (x = 0; x < 8; x++) |
| 224 | 221 | { |
| 225 | *BITMAP_ADDR16(tmpbitmap2, sy+y, sx+x) = colour; | |
| 222 | *BITMAP_ADDR16(state->tmpbitmap2, sy+y, sx+x) = colour; | |
| 226 | 223 | } |
| 227 | 224 | } |
| 228 | 225 | } |
| r10613 | r10614 | |
| 239 | 236 | |
| 240 | 237 | static TILE_GET_INFO( get_fg_tile_info ) |
| 241 | 238 | { |
| 242 | int code = popeye_videoram[tile_index]; | |
| 243 | int color = popeye_colorram[tile_index] & 0x0f; | |
| 239 | popeye_state *state = machine->driver_data<popeye_state>(); | |
| 240 | int code = state->videoram[tile_index]; | |
| 241 | int color = state->colorram[tile_index] & 0x0f; | |
| 244 | 242 | |
| 245 | 243 | SET_TILE_INFO(0, code, color, 0); |
| 246 | 244 | } |
| 247 | 245 | |
| 248 | 246 | VIDEO_START( skyskipr ) |
| 249 | 247 | { |
| 250 | popeye_bitmapram = auto_alloc_array(machine, UINT8, popeye_bitmapram_size); | |
| 251 | tmpbitmap2 = auto_bitmap_alloc(machine,1024,1024,machine->primary_screen->format()); /* actually 1024x512 but not rolling over vertically? */ | |
| 248 | popeye_state *state = machine->driver_data<popeye_state>(); | |
| 249 | state->bitmapram = auto_alloc_array(machine, UINT8, popeye_bitmapram_size); | |
| 250 | state->tmpbitmap2 = auto_bitmap_alloc(machine,1024,1024,machine->primary_screen->format()); /* actually 1024x512 but not rolling over vertically? */ | |
| 252 | 251 | |
| 253 | bitmap_type = TYPE_SKYSKIPR; | |
| 252 | state->bitmap_type = TYPE_SKYSKIPR; | |
| 254 | 253 | |
| 255 | fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32); | |
| 256 | tilemap_set_transparent_pen(fg_tilemap, 0); | |
| 254 | state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32); | |
| 255 | tilemap_set_transparent_pen(state->fg_tilemap, 0); | |
| 257 | 256 | |
| 258 | lastflip = 0; | |
| 257 | state->lastflip = 0; | |
| 259 | 258 | |
| 260 | state_save_register_global(machine, lastflip); | |
| 261 | state_save_register_global_bitmap(machine, tmpbitmap2); | |
| 262 | state_save_register_global_pointer(machine, popeye_bitmapram, popeye_bitmapram_size); | |
| 259 | state_save_register_global(machine, state->lastflip); | |
| 260 | state_save_register_global_bitmap(machine, state->tmpbitmap2); | |
| 261 | state_save_register_global_pointer(machine, state->bitmapram, popeye_bitmapram_size); | |
| 263 | 262 | } |
| 264 | 263 | |
| 265 | 264 | VIDEO_START( popeye ) |
| 266 | 265 | { |
| 267 | popeye_bitmapram = auto_alloc_array(machine, UINT8, popeye_bitmapram_size); | |
| 268 | tmpbitmap2 = auto_bitmap_alloc(machine,512,512,machine->primary_screen->format()); | |
| 266 | popeye_state *state = machine->driver_data<popeye_state>(); | |
| 267 | state->bitmapram = auto_alloc_array(machine, UINT8, popeye_bitmapram_size); | |
| 268 | state->tmpbitmap2 = auto_bitmap_alloc(machine,512,512,machine->primary_screen->format()); | |
| 269 | 269 | |
| 270 | bitmap_type = TYPE_POPEYE; | |
| 270 | state->bitmap_type = TYPE_POPEYE; | |
| 271 | 271 | |
| 272 | fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32); | |
| 273 | tilemap_set_transparent_pen(fg_tilemap, 0); | |
| 272 | state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32); | |
| 273 | tilemap_set_transparent_pen(state->fg_tilemap, 0); | |
| 274 | 274 | |
| 275 | lastflip = 0; | |
| 275 | state->lastflip = 0; | |
| 276 | 276 | |
| 277 | state_save_register_global(machine, lastflip); | |
| 278 | state_save_register_global_bitmap(machine, tmpbitmap2); | |
| 279 | state_save_register_global_pointer(machine, popeye_bitmapram, popeye_bitmapram_size); | |
| 277 | state_save_register_global(machine, state->lastflip); | |
| 278 | state_save_register_global_bitmap(machine, state->tmpbitmap2); | |
| 279 | state_save_register_global_pointer(machine, state->bitmapram, popeye_bitmapram_size); | |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) |
| 283 | 283 | { |
| 284 | popeye_state *state = machine->driver_data<popeye_state>(); | |
| 284 | 285 | int offs; |
| 285 | 286 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 286 | 287 | |
| 287 | if (lastflip != flip_screen_get(machine)) | |
| 288 | if (state->lastflip != flip_screen_get(machine)) | |
| 288 | 289 | { |
| 289 | 290 | for (offs = 0;offs < popeye_bitmapram_size;offs++) |
| 290 | popeye_bitmap_w(space,offs, | |
| 291 | popeye_bitmap_w(space,offs,state-> | |
| 291 | 292 | |
| 292 | lastflip = flip_screen_get(machine); | |
| 293 | state->lastflip = flip_screen_get(machine); | |
| 293 | 294 | } |
| 294 | 295 | |
| 295 | set_background_palette(machine, (* | |
| 296 | set_background_palette(machine, (*state-> | |
| 296 | 297 | |
| 297 | if ( | |
| 298 | if (state-> | |
| 298 | 299 | bitmap_fill(bitmap,cliprect,0); |
| 299 | 300 | else |
| 300 | 301 | { |
| 301 | 302 | /* copy the background graphics */ |
| 302 | int scrollx = 200 - popeye_background_pos[0] - 256*(popeye_background_pos[2]&1); /* ??? */ | |
| 303 | int scrolly = 2 * (256 - popeye_background_pos[1]); | |
| 303 | int scrollx = 200 - state->background_pos[0] - 256*(state->background_pos[2]&1); /* ??? */ | |
| 304 | int scrolly = 2 * (256 - state->background_pos[1]); | |
| 304 | 305 | |
| 305 | if (bitmap_type == TYPE_SKYSKIPR) | |
| 306 | if (state->bitmap_type == TYPE_SKYSKIPR) | |
| 306 | 307 | scrollx = 2*scrollx - 512; |
| 307 | 308 | |
| 308 | 309 | if (flip_screen_get(machine)) |
| 309 | 310 | { |
| 310 | if (bitmap_type == TYPE_POPEYE) | |
| 311 | if (state->bitmap_type == TYPE_POPEYE) | |
| 311 | 312 | scrollx = -scrollx; |
| 312 | 313 | scrolly = -scrolly; |
| 313 | 314 | } |
| 314 | 315 | |
| 315 | copyscrollbitmap(bitmap,tmpbitmap2,1,&scrollx,1,&scrolly,cliprect); | |
| 316 | copyscrollbitmap(bitmap,state->tmpbitmap2,1,&scrollx,1,&scrolly,cliprect); | |
| 316 | 317 | } |
| 317 | 318 | } |
| 318 | 319 | |
| 319 | 320 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) |
| 320 | 321 | { |
| 322 | popeye_state *state = machine->driver_data<popeye_state>(); | |
| 321 | 323 | UINT8 *spriteram = machine->generic.spriteram.u8; |
| 322 | 324 | int offs; |
| 323 | 325 | |
| r10613 | r10614 | |
| 339 | 341 | |
| 340 | 342 | code = (spriteram[offs + 2] & 0x7f) + ((spriteram[offs + 3] & 0x10) << 3) |
| 341 | 343 | + ((spriteram[offs + 3] & 0x04) << 6); |
| 342 | color = (spriteram[offs + 3] & 0x07) + 8*(*popeye_palettebank & 0x07); | |
| 343 | if (bitmap_type == TYPE_SKYSKIPR) | |
| 344 | color = (spriteram[offs + 3] & 0x07) + 8*(*state->palettebank & 0x07); | |
| 345 | if (state->bitmap_type == TYPE_SKYSKIPR) | |
| 344 | 346 | { |
| 345 | 347 | /* Two of the PROM address pins are tied together and one is not connected... */ |
| 346 | 348 | color = (color & 0x0f) | ((color & 0x08) << 1); |
| r10613 | r10614 | |
| 371 | 373 | |
| 372 | 374 | SCREEN_UPDATE( popeye ) |
| 373 | 375 | { |
| 376 | popeye_state *state = screen->machine->driver_data<popeye_state>(); | |
| 374 | 377 | draw_background(screen->machine, bitmap, cliprect); |
| 375 | 378 | draw_sprites(screen->machine, bitmap, cliprect); |
| 376 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); | |
| 379 | tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0); | |
| 377 | 380 | return 0; |
| 378 | 381 | } |
| r10613 | r10614 | |
|---|---|---|
| 11 | 11 | #include "includes/pastelg.h" |
| 12 | 12 | |
| 13 | 13 | |
| 14 | static int blitter_destx, blitter_desty; | |
| 15 | static int blitter_sizex, blitter_sizey; | |
| 16 | static int blitter_src_addr; | |
| 17 | static int pastelg_gfxrom; | |
| 18 | static int pastelg_dispflag; | |
| 19 | static int pastelg_flipscreen; | |
| 20 | static int blitter_direction_x, blitter_direction_y; | |
| 21 | static int pastelg_palbank; | |
| 22 | ||
| 23 | static UINT8 *pastelg_videoram; | |
| 24 | static UINT8 *pastelg_clut; | |
| 25 | ||
| 26 | ||
| 27 | 14 | static void pastelg_vramflip(running_machine *machine); |
| 28 | 15 | static void pastelg_gfxdraw(running_machine *machine); |
| 29 | 16 | |
| r10613 | r10614 | |
| 62 | 49 | |
| 63 | 50 | WRITE8_HANDLER( pastelg_clut_w ) |
| 64 | 51 | { |
| 65 | pastelg_clut[offset] = data; | |
| 52 | pastelg_state *state = space->machine->driver_data<pastelg_state>(); | |
| 53 | state->clut[offset] = data; | |
| 66 | 54 | } |
| 67 | 55 | |
| 68 | 56 | /****************************************************************************** |
| 69 | 57 | |
| 70 | 58 | |
| 71 | 59 | ******************************************************************************/ |
| 72 | int pastelg_blitter_src_addr_r( | |
| 60 | int pastelg_blitter_src_addr_r(a | |
| 73 | 61 | { |
| 74 | return blitter_src_addr; | |
| 62 | pastelg_state *state = space->machine->driver_data<pastelg_state>(); | |
| 63 | return state->blitter_src_addr; | |
| 75 | 64 | } |
| 76 | 65 | |
| 77 | 66 | WRITE8_HANDLER( pastelg_blitter_w ) |
| 78 | 67 | { |
| 68 | pastelg_state *state = space->machine->driver_data<pastelg_state>(); | |
| 79 | 69 | switch (offset) |
| 80 | 70 | { |
| 81 | case 0: blitter_src_addr = (blitter_src_addr & 0xff00) | data; break; | |
| 82 | case 1: blitter_src_addr = (blitter_src_addr & 0x00ff) | (data << 8); break; | |
| 83 | case 2: blitter_destx = data; break; | |
| 84 | case 3: blitter_desty = data; break; | |
| 85 | case 4: blitter_sizex = data; break; | |
| 86 | case 5: blitter_sizey = data; | |
| 71 | case 0: state->blitter_src_addr = (state->blitter_src_addr & 0xff00) | data; break; | |
| 72 | case 1: state->blitter_src_addr = (state->blitter_src_addr & 0x00ff) | (data << 8); break; | |
| 73 | case 2: state->blitter_destx = data; break; | |
| 74 | case 3: state->blitter_desty = data; break; | |
| 75 | case 4: state->blitter_sizex = data; break; | |
| 76 | case 5: state->blitter_sizey = data; | |
| 87 | 77 | /* writing here also starts the blit */ |
| 88 | 78 | pastelg_gfxdraw(space->machine); |
| 89 | 79 | break; |
| 90 | case 6: blitter_direction_x = (data & 0x01) ? 1 : 0; | |
| 91 | blitter_direction_y = (data & 0x02) ? 1 : 0; | |
| 92 | pastelg_flipscreen = (data & 0x04) ? 0 : 1; | |
| 93 | pastelg_dispflag = (data & 0x08) ? 0 : 1; | |
| 80 | case 6: state->blitter_direction_x = (data & 0x01) ? 1 : 0; | |
| 81 | state->blitter_direction_y = (data & 0x02) ? 1 : 0; | |
| 82 | state->flipscreen = (data & 0x04) ? 0 : 1; | |
| 83 | state->dispflag = (data & 0x08) ? 0 : 1; | |
| 94 | 84 | pastelg_vramflip(space->machine); |
| 95 | 85 | break; |
| 96 | 86 | } |
| r10613 | r10614 | |
| 99 | 89 | |
| 100 | 90 | WRITE8_HANDLER( threeds_romsel_w ) |
| 101 | 91 | { |
| 92 | pastelg_state *state = space->machine->driver_data<pastelg_state>(); | |
| 102 | 93 | if (data&0xfc) printf("%02x\n",data); |
| 103 | | |
| 94 | | |
| 104 | 95 | } |
| 105 | 96 | |
| 106 | 97 | WRITE8_HANDLER( threeds_output_w ) |
| 107 | 98 | { |
| 108 | pastelg_palbank = ((data & 0x10) >> 4); | |
| 99 | pastelg_state *state = space->machine->driver_data<pastelg_state>(); | |
| 100 | state->palbank = ((data & 0x10) >> 4); | |
| 109 | 101 | |
| 110 | 102 | } |
| 111 | 103 | |
| 112 | 104 | READ8_HANDLER( threeds_rom_readback_r ) |
| 113 | 105 | { |
| 106 | pastelg_state *state = space->machine->driver_data<pastelg_state>(); | |
| 114 | 107 | UINT8 *GFX = space->machine->region("gfx1")->base(); |
| 115 | 108 | |
| 116 | return GFX[(blitter_src_addr | ( | |
| 109 | return GFX[(state->blitter_src_addr | ( | |
| 117 | 110 | } |
| 118 | 111 | |
| 119 | 112 | |
| 120 | 113 | WRITE8_HANDLER( pastelg_romsel_w ) |
| 121 | 114 | { |
| 115 | pastelg_state *state = space->machine->driver_data<pastelg_state>(); | |
| 122 | 116 | int gfxlen = space->machine->region("gfx1")->bytes(); |
| 123 | pastelg_gfxrom = ((data & 0xc0) >> 6); | |
| 124 | pastelg_palbank = ((data & 0x10) >> 4); | |
| 117 | state->gfxrom = ((data & 0xc0) >> 6); | |
| 118 | state->palbank = ((data & 0x10) >> 4); | |
| 125 | 119 | nb1413m3_sndrombank1_w(space, 0, data); |
| 126 | 120 | |
| 127 | if (( | |
| 121 | if (( | |
| 128 | 122 | { |
| 129 | 123 | #ifdef MAME_DEBUG |
| 130 | 124 | popmessage("GFXROM BANK OVER!!"); |
| 131 | 125 | #endif |
| 132 | | |
| 126 | | |
| 133 | 127 | } |
| 134 | 128 | } |
| 135 | 129 | |
| r10613 | r10614 | |
| 139 | 133 | ******************************************************************************/ |
| 140 | 134 | static void pastelg_vramflip(running_machine *machine) |
| 141 | 135 | { |
| 142 | stat | |
| 136 | pastelg_state | |
| 143 | 137 | int x, y; |
| 144 | 138 | UINT8 color1, color2; |
| 145 | 139 | int width = machine->primary_screen->width(); |
| 146 | 140 | int height = machine->primary_screen->height(); |
| 147 | 141 | |
| 148 | if ( | |
| 142 | if ( | |
| 149 | 143 | |
| 150 | 144 | for (y = 0; y < height; y++) |
| 151 | 145 | { |
| 152 | 146 | for (x = 0; x < width; x++) |
| 153 | 147 | { |
| 154 | color1 = pastelg_videoram[(y * width) + x]; | |
| 155 | color2 = pastelg_videoram[((y ^ 0xff) * width) + (x ^ 0xff)]; | |
| 156 | pastelg_videoram[(y * width) + x] = color2; | |
| 157 | pastelg_videoram[((y ^ 0xff) * width) + (x ^ 0xff)] = color1; | |
| 148 | color1 = state->videoram[(y * width) + x]; | |
| 149 | color2 = state->videoram[((y ^ 0xff) * width) + (x ^ 0xff)]; | |
| 150 | state->videoram[(y * width) + x] = color2; | |
| 151 | state->videoram[((y ^ 0xff) * width) + (x ^ 0xff)] = color1; | |
| 158 | 152 | } |
| 159 | 153 | } |
| 160 | 154 | |
| 161 | | |
| 155 | | |
| 162 | 156 | } |
| 163 | 157 | |
| 164 | 158 | static TIMER_CALLBACK( blitter_timer_callback ) |
| r10613 | r10614 | |
| 168 | 162 | |
| 169 | 163 | static void pastelg_gfxdraw(running_machine *machine) |
| 170 | 164 | { |
| 165 | pastelg_state *state = machine->driver_data<pastelg_state>(); | |
| 171 | 166 | UINT8 *GFX = machine->region("gfx1")->base(); |
| 172 | 167 | int width = machine->primary_screen->width(); |
| 173 | 168 | |
| r10613 | r10614 | |
| 184 | 179 | |
| 185 | 180 | nb1413m3_busyctr = 0; |
| 186 | 181 | |
| 187 | startx = blitter_destx + blitter_sizex; | |
| 188 | starty = blitter_desty + blitter_sizey; | |
| 182 | startx = state->blitter_destx + state->blitter_sizex; | |
| 183 | starty = state->blitter_desty + state->blitter_sizey; | |
| 189 | 184 | |
| 190 | 185 | |
| 191 | if (blitter_direction_x) | |
| 186 | if (state->blitter_direction_x) | |
| 192 | 187 | { |
| 193 | if (blitter_sizex&0x80) sizex = 0xff-blitter_sizex; | |
| 194 | else sizex=blitter_sizex; | |
| 188 | if (state->blitter_sizex&0x80) sizex = 0xff-state->blitter_sizex; | |
| 189 | else sizex=state->blitter_sizex; | |
| 195 | 190 | incx = 1; |
| 196 | 191 | } |
| 197 | 192 | else |
| 198 | 193 | { |
| 199 | sizex = blitter_sizex; | |
| 194 | sizex = state->blitter_sizex; | |
| 200 | 195 | incx = -1; |
| 201 | 196 | } |
| 202 | 197 | |
| 203 | if (blitter_direction_y) | |
| 198 | if (state->blitter_direction_y) | |
| 204 | 199 | { |
| 205 | if (blitter_sizey&0x80) sizey = 0xff-blitter_sizey; | |
| 206 | else sizey=blitter_sizey; | |
| 200 | if (state->blitter_sizey&0x80) sizey = 0xff-state->blitter_sizey; | |
| 201 | else sizey=state->blitter_sizey; | |
| 207 | 202 | incy = 1; |
| 208 | 203 | } |
| 209 | 204 | else |
| 210 | 205 | { |
| 211 | sizey = blitter_sizey; | |
| 206 | sizey = state->blitter_sizey; | |
| 212 | 207 | incy = -1; |
| 213 | 208 | } |
| 214 | 209 | |
| 215 | 210 | gfxlen = machine->region("gfx1")->bytes(); |
| 216 | gfxaddr = ( | |
| 211 | gfxaddr = ( | |
| 217 | 212 | |
| 218 | 213 | readflag = 0; |
| 219 | 214 | |
| r10613 | r10614 | |
| 226 | 221 | |
| 227 | 222 | for (ctrx = sizex; ctrx >= 0; ctrx--) |
| 228 | 223 | { |
| 229 | gfxaddr = ( | |
| 224 | gfxaddr = ( | |
| 230 | 225 | |
| 231 | 226 | if ((gfxaddr > (gfxlen - 1))) |
| 232 | 227 | { |
| r10613 | r10614 | |
| 241 | 236 | dx = x & 0xff; |
| 242 | 237 | dy = y & 0xff; |
| 243 | 238 | |
| 244 | if ( | |
| 239 | if ( | |
| 245 | 240 | { |
| 246 | 241 | dx ^= 0xff; |
| 247 | 242 | dy ^= 0xff; |
| r10613 | r10614 | |
| 261 | 256 | |
| 262 | 257 | readflag ^= 1; |
| 263 | 258 | |
| 264 | if ( | |
| 259 | if ( | |
| 265 | 260 | { |
| 266 | 261 | if (color) |
| 267 | 262 | { |
| 268 | color = ((pastelg_palbank * 0x10) + color); | |
| 269 | pastelg_videoram[(dy * width) + dx] = color; | |
| 263 | color = ((state->palbank * 0x10) + color); | |
| 264 | state->videoram[(dy * width) + dx] = color; | |
| 270 | 265 | } |
| 271 | 266 | } |
| 272 | 267 | else |
| 273 | 268 | { |
| 274 | if( | |
| 269 | if( | |
| 275 | 270 | { |
| 276 | color = ((pastelg_palbank * 0x10) + pastelg_clut[color]); | |
| 277 | pastelg_videoram[(dy * width) + dx] = color; | |
| 271 | color = ((state->palbank * 0x10) + state->clut[color]); | |
| 272 | state->videoram[(dy * width) + dx] = color; | |
| 278 | 273 | } |
| 279 | 274 | } |
| 280 | 275 | |
| r10613 | r10614 | |
| 295 | 290 | ******************************************************************************/ |
| 296 | 291 | VIDEO_START( pastelg ) |
| 297 | 292 | { |
| 293 | pastelg_state *state = machine->driver_data<pastelg_state>(); | |
| 298 | 294 | int width = machine->primary_screen->width(); |
| 299 | 295 | int height = machine->primary_screen->height(); |
| 300 | 296 | |
| 301 | pastelg_videoram = auto_alloc_array_clear(machine, UINT8, width * height); | |
| 302 | pastelg_clut = auto_alloc_array(machine, UINT8, 0x10); | |
| 297 | state->videoram = auto_alloc_array_clear(machine, UINT8, width * height); | |
| 298 | state->clut = auto_alloc_array(machine, UINT8, 0x10); | |
| 303 | 299 | } |
| 304 | 300 | |
| 305 | 301 | /****************************************************************************** |
| r10613 | r10614 | |
| 308 | 304 | ******************************************************************************/ |
| 309 | 305 | SCREEN_UPDATE( pastelg ) |
| 310 | 306 | { |
| 311 | if (pastelg_dispflag) | |
| 307 | pastelg_state *state = screen->machine->driver_data<pastelg_state>(); | |
| 308 | if (state->dispflag) | |
| 312 | 309 | { |
| 313 | 310 | int x, y; |
| 314 | 311 | int width = screen->width(); |
| r10613 | r10614 | |
| 316 | 313 | |
| 317 | 314 | for (y = 0; y < height; y++) |
| 318 | 315 | for (x = 0; x < width; x++) |
| 319 | *BITMAP_ADDR16(bitmap, y, x) = | |
| 316 | *BITMAP_ADDR16(bitmap, y, x) = | |
| 320 | 317 | } |
| 321 | 318 | else |
| 322 | 319 | bitmap_fill(bitmap, cliprect, 0); |
| r10613 | r10614 | |
|---|---|---|
| 1110 | 1110 | ***************************************************************************/ |
| 1111 | 1111 | |
| 1112 | 1112 | #ifdef MAME_DEBUG |
| 1113 | static int show_unknown; | |
| 1114 | 1113 | #define CISCHEAT_LAYERSCTRL \ |
| 1115 | 1114 | state->debugsprites = 0; \ |
| 1116 | 1115 | if ( input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X) ) \ |
| r10613 | r10614 | |
| 1131 | 1130 | \ |
| 1132 | 1131 | { \ |
| 1133 | 1132 | if ( input_code_pressed(screen->machine, KEYCODE_Z) && input_code_pressed_once(screen->machine, KEYCODE_U) ) \ |
| 1134 | show_unknown ^= 1; \ | |
| 1135 | if (show_unknown) \ | |
| 1133 | state->show_unknown ^= 1; \ | |
| 1134 | if (state->show_unknown) \ | |
| 1136 | 1135 | popmessage("0:%04X 2:%04X 4:%04X 6:%04X c:%04X", \ |
| 1137 | 1136 | megasys1_vregs[0],megasys1_vregs[1],megasys1_vregs[2],megasys1_vregs[3],megasys1_vregs[0xc/2] ); \ |
| 1138 | 1137 | } |
| r10613 | r10614 | |
|---|---|---|
| 12 | 12 | |
| 13 | 13 | |
| 14 | 14 | UINT8 *geebee_videoram,*warpwarp_videoram; |
| 15 | int geebee_handleoverlay; | |
| 16 | 15 | int geebee_bgw; |
| 17 | 16 | int warpwarp_ball_on; |
| 18 | 17 | int warpwarp_ball_h,warpwarp_ball_v; |
| r10613 | r10614 | |
| 121 | 120 | ***************************************************************************/ |
| 122 | 121 | |
| 123 | 122 | /* convert from 32x32 to 34x28 */ |
| 124 | static | |
| 123 | static | |
| 125 | 124 | { |
| 126 | 125 | int offs; |
| 127 | 126 | |
| r10613 | r10614 | |
| 239 | 238 | |
| 240 | 239 | SCREEN_UPDATE( geebee ) |
| 241 | 240 | { |
| 242 | /* use an overlay only in upright mode */ | |
| 243 | if (geebee_handleoverlay) | |
| 244 | output_set_value("overlay", (input_port_read(screen->machine, "DSW2") & 0x01) == 0); | |
| 245 | ||
| 246 | 241 | tilemap_draw(bitmap,cliprect,bg_tilemap,0,0); |
| 247 | 242 | |
| 248 | 243 | draw_ball(bitmap,cliprect,warpwarp_ball_pen); |
| r10613 | r10614 | |
|---|---|---|
| 9 | 9 | #include "video/resnet.h" |
| 10 | 10 | |
| 11 | 11 | |
| 12 | UINT8 *spacefb_videoram; | |
| 13 | size_t spacefb_videoram_size; | |
| 14 | ||
| 15 | static UINT8 *object_present_map; | |
| 16 | static UINT8 port_0; | |
| 17 | static UINT8 port_2; | |
| 18 | static UINT32 star_shift_reg; | |
| 19 | ||
| 20 | static double color_weights_rg[3], color_weights_b[2]; | |
| 21 | ||
| 22 | ||
| 23 | ||
| 24 | 12 | /************************************* |
| 25 | 13 | * |
| 26 | 14 | * Port setters |
| r10613 | r10614 | |
| 29 | 17 | |
| 30 | 18 | WRITE8_HANDLER( spacefb_port_0_w ) |
| 31 | 19 | { |
| 20 | spacefb_state *state = space->machine->driver_data<spacefb_state>(); | |
| 32 | 21 | space->machine->primary_screen->update_now(); |
| 33 | port_0 = data; | |
| 22 | state->port_0 = data; | |
| 34 | 23 | } |
| 35 | 24 | |
| 36 | 25 | |
| 37 | 26 | WRITE8_HANDLER( spacefb_port_2_w ) |
| 38 | 27 | { |
| 28 | spacefb_state *state = space->machine->driver_data<spacefb_state>(); | |
| 39 | 29 | space->machine->primary_screen->update_now(); |
| 40 | port_2 = data; | |
| 30 | state->port_2 = data; | |
| 41 | 31 | } |
| 42 | 32 | |
| 43 | 33 | |
| r10613 | r10614 | |
| 79 | 69 | |
| 80 | 70 | VIDEO_START( spacefb ) |
| 81 | 71 | { |
| 72 | spacefb_state *state = machine->driver_data<spacefb_state>(); | |
| 82 | 73 | int width, height; |
| 83 | 74 | |
| 84 | 75 | /* compute the color gun weights */ |
| r10613 | r10614 | |
| 86 | 77 | static const int resistances_b [] = { 470, 220 }; |
| 87 | 78 | |
| 88 | 79 | compute_resistor_weights(0, 0xff, -1.0, |
| 89 | 3, resistances_rg, color_weights_rg, 470, 0, | |
| 90 | 2, resistances_b, color_weights_b, 470, 0, | |
| 80 | 3, resistances_rg, state->color_weights_rg, 470, 0, | |
| 81 | 2, resistances_b, state->color_weights_b, 470, 0, | |
| 91 | 82 | 0, 0, 0, 0, 0); |
| 92 | 83 | |
| 93 | 84 | width = machine->primary_screen->width(); |
| 94 | 85 | height = machine->primary_screen->height(); |
| 95 | object_present_map = auto_alloc_array(machine, UINT8, width * height); | |
| 86 | state->object_present_map = auto_alloc_array(machine, UINT8, width * height); | |
| 96 | 87 | |
| 97 | 88 | /* this start value positions the stars to match the flyer screen shot, |
| 98 | 89 | but most likely, the actual star position is random as the hardware |
| 99 | 90 | uses whatever value is on the shift register on power-up */ |
| 100 | star_shift_reg = 0x18f89; | |
| 91 | state->star_shift_reg = 0x18f89; | |
| 101 | 92 | } |
| 102 | 93 | |
| 103 | 94 | |
| r10613 | r10614 | |
| 111 | 102 | #define NUM_STARFIELD_PENS (0x40) |
| 112 | 103 | |
| 113 | 104 | |
| 114 | INLINE void shift_star_generator( | |
| 105 | INLINE void shift_star_generator(spacefb_state *state) | |
| 115 | 106 | { |
| 116 | star_shift_reg = ((star_shift_reg << 1) | (((~star_shift_reg >> 16) & 0x01) ^ ((star_shift_reg >> 4) & 0x01))) & 0x1ffff; | |
| 107 | state->star_shift_reg = ((state->star_shift_reg << 1) | (((~state->star_shift_reg >> 16) & 0x01) ^ ((state->star_shift_reg >> 4) & 0x01))) & 0x1ffff; | |
| 117 | 108 | } |
| 118 | 109 | |
| 119 | 110 | |
| 120 | static void get_starfield_pens(pen_t *pens) | |
| 111 | static void get_starfield_pens(spacefb_state *state, pen_t *pens) | |
| 121 | 112 | { |
| 122 | 113 | /* generate the pens based on the various enable bits */ |
| 123 | 114 | int i; |
| 124 | 115 | |
| 125 | int color_contrast_r = port_2 & 0x01; | |
| 126 | int color_contrast_g = port_2 & 0x02; | |
| 127 | int color_contrast_b = port_2 & 0x04; | |
| 128 | int background_red = port_2 & 0x08; | |
| 129 | int background_blue = port_2 & 0x10; | |
| 130 | int disable_star_field = port_2 & 0x80; | |
| 116 | int color_contrast_r = state->port_2 & 0x01; | |
| 117 | int color_contrast_g = state->port_2 & 0x02; | |
| 118 | int color_contrast_b = state->port_2 & 0x04; | |
| 119 | int background_red = state->port_2 & 0x08; | |
| 120 | int background_blue = state->port_2 & 0x10; | |
| 121 | int disable_star_field = state->port_2 & 0x80; | |
| 131 | 122 | |
| 132 | 123 | for (i = 0; i < NUM_STARFIELD_PENS; i++) |
| 133 | 124 | { |
| r10613 | r10614 | |
| 138 | 129 | UINT8 ra = (((i >> 4) & 0x01) || background_red) && !disable_star_field; |
| 139 | 130 | UINT8 rb = ((i >> 5) & 0x01) && color_contrast_r && !disable_star_field; |
| 140 | 131 | |
| 141 | UINT8 r = combine_3_weights(color_weights_rg, 0, rb, ra); | |
| 142 | UINT8 g = combine_3_weights(color_weights_rg, 0, gb, ga); | |
| 143 | UINT8 b = combine_2_weights(color_weights_b, bb, ba); | |
| 132 | UINT8 r = combine_3_weights(state->color_weights_rg, 0, rb, ra); | |
| 133 | UINT8 g = combine_3_weights(state->color_weights_rg, 0, gb, ga); | |
| 134 | UINT8 b = combine_2_weights(state->color_weights_b, bb, ba); | |
| 144 | 135 | |
| 145 | 136 | pens[i] = MAKE_RGB(r, g, b); |
| 146 | 137 | } |
| r10613 | r10614 | |
| 149 | 140 | |
| 150 | 141 | static void draw_starfield(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect) |
| 151 | 142 | { |
| 143 | spacefb_state *state = screen.machine->driver_data<spacefb_state>(); | |
| 152 | 144 | int y; |
| 153 | 145 | pen_t pens[NUM_STARFIELD_PENS]; |
| 154 | 146 | |
| 155 | get_starfield_pens(pens); | |
| 147 | get_starfield_pens(state, pens); | |
| 156 | 148 | |
| 157 | 149 | /* the shift register is always shifting -- do the portion in the top VBLANK */ |
| 158 | 150 | if (cliprect->min_y == screen.visible_area().min_y) |
| r10613 | r10614 | |
| 163 | 155 | int clock_count = (SPACEFB_HBSTART - SPACEFB_HBEND) * SPACEFB_VBEND - 1; |
| 164 | 156 | |
| 165 | 157 | for (i = 0; i < clock_count; i++) |
| 166 | shift_star_generator(); | |
| 158 | shift_star_generator(state); | |
| 167 | 159 | } |
| 168 | 160 | |
| 169 | 161 | /* visible region of the screen */ |
| r10613 | r10614 | |
| 173 | 165 | |
| 174 | 166 | for (x = SPACEFB_HBEND; x < SPACEFB_HBSTART; x++) |
| 175 | 167 | { |
| 176 | if (object_present_map[(y * bitmap->width) + x] == 0) | |
| 168 | if (state->object_present_map[(y * bitmap->width) + x] == 0) | |
| 177 | 169 | { |
| 178 | 170 | /* draw the star - the 4 possible values come from the effect of the two XOR gates */ |
| 179 | if (((star_shift_reg & 0x1c0ff) == 0x0c0b7) || | |
| 180 | ((star_shift_reg & 0x1c0ff) == 0x0c0d7) || | |
| 181 | ((star_shift_reg & 0x1c0ff) == 0x0c0bb) || | |
| 182 | ((star_shift_reg & 0x1c0ff) == 0x0c0db)) | |
| 183 | *BITMAP_ADDR32(bitmap, y, x) = pens[(star_shift_reg >> 8) & 0x3f]; | |
| 171 | if (((state->star_shift_reg & 0x1c0ff) == 0x0c0b7) || | |
| 172 | ((state->star_shift_reg & 0x1c0ff) == 0x0c0d7) || | |
| 173 | ((state->star_shift_reg & 0x1c0ff) == 0x0c0bb) || | |
| 174 | ((state->star_shift_reg & 0x1c0ff) == 0x0c0db)) | |
| 175 | *BITMAP_ADDR32(bitmap, y, x) = pens[(state->star_shift_reg >> 8) & 0x3f]; | |
| 184 | 176 | else |
| 185 | 177 | *BITMAP_ADDR32(bitmap, y, x) = pens[0]; |
| 186 | 178 | } |
| 187 | 179 | |
| 188 | shift_star_generator(); | |
| 180 | shift_star_generator(state); | |
| 189 | 181 | } |
| 190 | 182 | } |
| 191 | 183 | |
| r10613 | r10614 | |
| 196 | 188 | int clock_count = (SPACEFB_HBSTART - SPACEFB_HBEND) * (SPACEFB_VTOTAL - SPACEFB_VBSTART); |
| 197 | 189 | |
| 198 | 190 | for (i = 0; i < clock_count; i++) |
| 199 | shift_star_generator(); | |
| 191 | shift_star_generator(state); | |
| 200 | 192 | } |
| 201 | 193 | } |
| 202 | 194 | |
| r10613 | r10614 | |
| 217 | 209 | |
| 218 | 210 | static void get_sprite_pens(running_machine *machine, pen_t *pens) |
| 219 | 211 | { |
| 212 | spacefb_state *state = machine->driver_data<spacefb_state>(); | |
| 220 | 213 | static const double fade_weights[] = { 1.0, 1.5, 2.5, 4.0 }; |
| 221 | 214 | const UINT8 *prom = machine->region("proms")->base(); |
| 222 | 215 | int i; |
| 223 | 216 | |
| 224 | 217 | for (i = 0; i < NUM_SPRITE_PENS; i++) |
| 225 | 218 | { |
| 226 | UINT8 data = prom[((port_0 & 0x40) >> 2) | (i & 0x0f)]; | |
| 219 | UINT8 data = prom[((state->port_0 & 0x40) >> 2) | (i & 0x0f)]; | |
| 227 | 220 | |
| 228 | 221 | UINT8 r0 = (data >> 0) & 0x01; |
| 229 | 222 | UINT8 r1 = (data >> 1) & 0x01; |
| r10613 | r10614 | |
| 236 | 229 | UINT8 b1 = (data >> 6) & 0x01; |
| 237 | 230 | UINT8 b2 = (data >> 7) & 0x01; |
| 238 | 231 | |
| 239 | UINT8 r = combine_3_weights(color_weights_rg, r0, r1, r2); | |
| 240 | UINT8 g = combine_3_weights(color_weights_rg, g0, g1, g2); | |
| 241 | UINT8 b = combine_2_weights(color_weights_b, b1, b2); | |
| 232 | UINT8 r = combine_3_weights(state->color_weights_rg, r0, r1, r2); | |
| 233 | UINT8 g = combine_3_weights(state->color_weights_rg, g0, g1, g2); | |
| 234 | UINT8 b = combine_2_weights(state->color_weights_b, b1, b2); | |
| 242 | 235 | |
| 243 | 236 | if (i >> 4) |
| 244 | 237 | { |
| r10613 | r10614 | |
| 257 | 250 | |
| 258 | 251 | static void draw_bullet(running_machine *machine, offs_t offs, pen_t pen, bitmap_t *bitmap, const rectangle *cliprect, int flip) |
| 259 | 252 | { |
| 253 | spacefb_state *state = machine->driver_data<spacefb_state>(); | |
| 260 | 254 | UINT8 sy; |
| 261 | 255 | |
| 262 | 256 | UINT8 *gfx = machine->region("gfx2")->base(); |
| 263 | 257 | |
| 264 | UINT8 code = spacefb_videoram[offs + 0x0200] & 0x3f; | |
| 265 | UINT8 y = ~spacefb_videoram[offs + 0x0100] - 2; | |
| 258 | UINT8 code = state->videoram[offs + 0x0200] & 0x3f; | |
| 259 | UINT8 y = ~state->videoram[offs + 0x0100] - 2; | |
| 266 | 260 | |
| 267 | 261 | for (sy = 0; sy < 4; sy++) |
| 268 | 262 | { |
| 269 | 263 | UINT8 sx, dy; |
| 270 | 264 | |
| 271 | 265 | UINT8 data = gfx[(code << 2) | sy]; |
| 272 | UINT8 x = s | |
| 266 | UINT8 x = state-> | |
| 273 | 267 | |
| 274 | 268 | if (flip) |
| 275 | 269 | dy = ~y; |
| r10613 | r10614 | |
| 292 | 286 | *BITMAP_ADDR32(bitmap, dy, dx + 0) = pen; |
| 293 | 287 | *BITMAP_ADDR32(bitmap, dy, dx + 1) = pen; |
| 294 | 288 | |
| 295 | object_present_map[(dy * bitmap->width) + dx + 0] = 1; | |
| 296 | object_present_map[(dy * bitmap->width) + dx + 1] = 1; | |
| 289 | state->object_present_map[(dy * bitmap->width) + dx + 0] = 1; | |
| 290 | state->object_present_map[(dy * bitmap->width) + dx + 1] = 1; | |
| 297 | 291 | } |
| 298 | 292 | |
| 299 | 293 | x = x + 1; |
| r10613 | r10614 | |
| 308 | 302 | |
| 309 | 303 | static void draw_sprite(running_machine *machine, offs_t offs, pen_t *pens, bitmap_t *bitmap, const rectangle *cliprect, int flip) |
| 310 | 304 | { |
| 305 | spacefb_state *state = machine->driver_data<spacefb_state>(); | |
| 311 | 306 | UINT8 sy; |
| 312 | 307 | |
| 313 | 308 | UINT8 *gfx = machine->region("gfx1")->base(); |
| 314 | 309 | |
| 315 | UINT8 code = ~spacefb_videoram[offs + 0x0200]; | |
| 316 | UINT8 color_base = (~spacefb_videoram[offs + 0x0300] & 0x0f) << 2; | |
| 317 | UINT8 y = ~spacefb_videoram[offs + 0x0100] - 2; | |
| 310 | UINT8 code = ~state->videoram[offs + 0x0200]; | |
| 311 | UINT8 color_base = (~state->videoram[offs + 0x0300] & 0x0f) << 2; | |
| 312 | UINT8 y = ~state->videoram[offs + 0x0100] - 2; | |
| 318 | 313 | |
| 319 | 314 | for (sy = 0; sy < 8; sy++) |
| 320 | 315 | { |
| r10613 | r10614 | |
| 323 | 318 | UINT8 data1 = gfx[0x0000 | (code << 3) | (sy ^ 0x07)]; |
| 324 | 319 | UINT8 data2 = gfx[0x0800 | (code << 3) | (sy ^ 0x07)]; |
| 325 | 320 | |
| 326 | UINT8 x = s | |
| 321 | UINT8 x = state-> | |
| 327 | 322 | |
| 328 | 323 | if (flip) |
| 329 | 324 | dy = ~y; |
| r10613 | r10614 | |
| 349 | 344 | *BITMAP_ADDR32(bitmap, dy, dx + 0) = pen; |
| 350 | 345 | *BITMAP_ADDR32(bitmap, dy, dx + 1) = pen; |
| 351 | 346 | |
| 352 | object_present_map[(dy * bitmap->width) + dx + 0] = (data != 0); | |
| 353 | object_present_map[(dy * bitmap->width) + dx + 1] = (data != 0); | |
| 347 | state->object_present_map[(dy * bitmap->width) + dx + 0] = (data != 0); | |
| 348 | state->object_present_map[(dy * bitmap->width) + dx + 1] = (data != 0); | |
| 354 | 349 | |
| 355 | 350 | x = x + 1; |
| 356 | 351 | data1 = data1 >> 1; |
| r10613 | r10614 | |
| 365 | 360 | |
| 366 | 361 | static void draw_objects(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) |
| 367 | 362 | { |
| 363 | spacefb_state *state = machine->driver_data<spacefb_state>(); | |
| 368 | 364 | pen_t sprite_pens[NUM_SPRITE_PENS]; |
| 369 | 365 | |
| 370 | offs_t offs = (port_0 & 0x20) ? 0x80 : 0x00; | |
| 371 | int flip = port_0 & 0x01; | |
| 366 | offs_t offs = (state->port_0 & 0x20) ? 0x80 : 0x00; | |
| 367 | int flip = state->port_0 & 0x01; | |
| 372 | 368 | |
| 373 | 369 | /* since the way the schematics show the bullet color |
| 374 | 370 | connected is impossible, just use pure red for now */ |
| r10613 | r10614 | |
| 376 | 372 | |
| 377 | 373 | get_sprite_pens(machine, sprite_pens); |
| 378 | 374 | |
| 379 | memset(object_present_map, 0, bitmap->width * bitmap->height); | |
| 375 | memset(state->object_present_map, 0, bitmap->width * bitmap->height); | |
| 380 | 376 | |
| 381 | 377 | while (1) |
| 382 | 378 | { |
| 383 | if (s | |
| 379 | if (state-> | |
| 384 | 380 | draw_bullet(machine, offs, bullet_pen, bitmap, cliprect, flip); |
| 385 | else if (s | |
| 381 | else if (state-> | |
| 386 | 382 | draw_sprite(machine, offs, sprite_pens, bitmap, cliprect, flip); |
| 387 | 383 | |
| 388 | 384 | /* next object */ |
| r10613 | r10614 | |
|---|---|---|
| 11 | 11 | #include "includes/nbmj8891.h" |
| 12 | 12 | |
| 13 | 13 | |
| 14 | static int nbmj8891_scrolly; | |
| 15 | static int blitter_destx, blitter_desty; | |
| 16 | static int blitter_sizex, blitter_sizey; | |
| 17 | static int blitter_src_addr; | |
| 18 | static int blitter_direction_x, blitter_direction_y; | |
| 19 | static int nbmj8891_vram; | |
| 20 | static int nbmj8891_gfxrom; | |
| 21 | static int nbmj8891_dispflag; | |
| 22 | static int nbmj8891_flipscreen; | |
| 23 | static int nbmj8891_clutsel; | |
| 24 | static int nbmj8891_screen_refresh; | |
| 25 | static int gfxdraw_mode; | |
| 26 | ||
| 27 | static bitmap_t *nbmj8891_tmpbitmap0, *nbmj8891_tmpbitmap1; | |
| 28 | static UINT8 *nbmj8891_videoram0, *nbmj8891_videoram1; | |
| 29 | static UINT8 *nbmj8891_palette; | |
| 30 | static UINT8 *nbmj8891_clut; | |
| 31 | ||
| 32 | ||
| 33 | 14 | static void nbmj8891_vramflip(running_machine *machine, int vram); |
| 34 | 15 | static void nbmj8891_gfxdraw(running_machine *machine); |
| 35 | 16 | |
| r10613 | r10614 | |
| 40 | 21 | ******************************************************************************/ |
| 41 | 22 | READ8_HANDLER( nbmj8891_palette_type1_r ) |
| 42 | 23 | { |
| 43 | return nbmj8891_palette[offset]; | |
| 24 | nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>(); | |
| 25 | return state->palette[offset]; | |
| 44 | 26 | } |
| 45 | 27 | |
| 46 | 28 | WRITE8_HANDLER( nbmj8891_palette_type1_w ) |
| 47 | 29 | { |
| 30 | nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>(); | |
| 48 | 31 | int r, g, b; |
| 49 | 32 | |
| 50 | | |
| 33 | state-> | |
| 51 | 34 | |
| 52 | 35 | if (!(offset & 1)) return; |
| 53 | 36 | |
| 54 | 37 | offset &= 0x1fe; |
| 55 | 38 | |
| 56 | r = ((nbmj8891_palette[offset + 0] & 0x0f) >> 0); | |
| 57 | g = ((nbmj8891_palette[offset + 1] & 0xf0) >> 4); | |
| 58 | b = ((nbmj8891_palette[offset + 1] & 0x0f) >> 0); | |
| 39 | r = ((state->palette[offset + 0] & 0x0f) >> 0); | |
| 40 | g = ((state->palette[offset + 1] & 0xf0) >> 4); | |
| 41 | b = ((state->palette[offset + 1] & 0x0f) >> 0); | |
| 59 | 42 | |
| 60 | 43 | palette_set_color_rgb(space->machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b)); |
| 61 | 44 | } |
| 62 | 45 | |
| 63 | 46 | READ8_HANDLER( nbmj8891_palette_type2_r ) |
| 64 | 47 | { |
| 65 | return nbmj8891_palette[offset]; | |
| 48 | nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>(); | |
| 49 | return state->palette[offset]; | |
| 66 | 50 | } |
| 67 | 51 | |
| 68 | 52 | WRITE8_HANDLER( nbmj8891_palette_type2_w ) |
| 69 | 53 | { |
| 54 | nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>(); | |
| 70 | 55 | int r, g, b; |
| 71 | 56 | |
| 72 | | |
| 57 | state-> | |
| 73 | 58 | |
| 74 | 59 | if (!(offset & 0x100)) return; |
| 75 | 60 | |
| 76 | 61 | offset &= 0x0ff; |
| 77 | 62 | |
| 78 | r = ((nbmj8891_palette[offset + 0x000] & 0x0f) >> 0); | |
| 79 | g = ((nbmj8891_palette[offset + 0x000] & 0xf0) >> 4); | |
| 80 | b = ((nbmj8891_palette[offset + 0x100] & 0x0f) >> 0); | |
| 63 | r = ((state->palette[offset + 0x000] & 0x0f) >> 0); | |
| 64 | g = ((state->palette[offset + 0x000] & 0xf0) >> 4); | |
| 65 | b = ((state->palette[offset + 0x100] & 0x0f) >> 0); | |
| 81 | 66 | |
| 82 | 67 | palette_set_color_rgb(space->machine, (offset & 0x0ff), pal4bit(r), pal4bit(g), pal4bit(b)); |
| 83 | 68 | } |
| 84 | 69 | |
| 85 | 70 | READ8_HANDLER( nbmj8891_palette_type3_r ) |
| 86 | 71 | { |
| 87 | return nbmj8891_palette[offset]; | |
| 72 | nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>(); | |
| 73 | return state->palette[offset]; | |
| 88 | 74 | } |
| 89 | 75 | |
| 90 | 76 | WRITE8_HANDLER( nbmj8891_palette_type3_w ) |
| 91 | 77 | { |
| 78 | nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>(); | |
| 92 | 79 | int r, g, b; |
| 93 | 80 | |
| 94 | | |
| 81 | state-> | |
| 95 | 82 | |
| 96 | 83 | if (!(offset & 1)) return; |
| 97 | 84 | |
| 98 | 85 | offset &= 0x1fe; |
| 99 | 86 | |
| 100 | r = ((nbmj8891_palette[offset + 1] & 0x0f) >> 0); | |
| 101 | g = ((nbmj8891_palette[offset + 0] & 0xf0) >> 4); | |
| 102 | b = ((nbmj8891_palette[offset + 0] & 0x0f) >> 0); | |
| 87 | r = ((state->palette[offset + 1] & 0x0f) >> 0); | |
| 88 | g = ((state->palette[offset + 0] & 0xf0) >> 4); | |
| 89 | b = ((state->palette[offset + 0] & 0x0f) >> 0); | |
| 103 | 90 | |
| 104 | 91 | palette_set_color_rgb(space->machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b)); |
| 105 | 92 | } |
| 106 | 93 | |
| 107 | 94 | WRITE8_HANDLER( nbmj8891_clutsel_w ) |
| 108 | 95 | { |
| 109 | nbmj8891_clutsel = data; | |
| 96 | nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>(); | |
| 97 | state->clutsel = data; | |
| 110 | 98 | } |
| 111 | 99 | |
| 112 | 100 | READ8_HANDLER( nbmj8891_clut_r ) |
| 113 | 101 | { |
| 114 | return nbmj8891_clut[offset]; | |
| 102 | nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>(); | |
| 103 | return state->clut[offset]; | |
| 115 | 104 | } |
| 116 | 105 | |
| 117 | 106 | WRITE8_HANDLER( nbmj8891_clut_w ) |
| 118 | 107 | { |
| 119 | nbmj8891_clut[((nbmj8891_clutsel & 0x7f) * 0x10) + (offset & 0x0f)] = data; | |
| 108 | nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>(); | |
| 109 | state->clut[((state->clutsel & 0x7f) * 0x10) + (offset & 0x0f)] = data; | |
| 120 | 110 | } |
| 121 | 111 | |
| 122 | 112 | /****************************************************************************** |
| r10613 | r10614 | |
| 125 | 115 | ******************************************************************************/ |
| 126 | 116 | WRITE8_HANDLER( nbmj8891_blitter_w ) |
| 127 | 117 | { |
| 118 | nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>(); | |
| 128 | 119 | switch (offset) |
| 129 | 120 | { |
| 130 | case 0x00: blitter_src_addr = (blitter_src_addr & 0xff00) | data; break; | |
| 131 | case 0x01: blitter_src_addr = (blitter_src_addr & 0x00ff) | (data << 8); break; | |
| 132 | case 0x02: blitter_destx = data; break; | |
| 133 | case 0x03: blitter_desty = data; break; | |
| 134 | case 0x04: blitter_sizex = data; break; | |
| 135 | case 0x05: blitter_sizey = data; | |
| 121 | case 0x00: state->blitter_src_addr = (state->blitter_src_addr & 0xff00) | data; break; | |
| 122 | case 0x01: state->blitter_src_addr = (state->blitter_src_addr & 0x00ff) | (data << 8); break; | |
| 123 | case 0x02: state->blitter_destx = data; break; | |
| 124 | case 0x03: state->blitter_desty = data; break; | |
| 125 | case 0x04: state->blitter_sizex = data; break; | |
| 126 | case 0x05: state->blitter_sizey = data; | |
| 136 | 127 | /* writing here also starts the blit */ |
| 137 | 128 | nbmj8891_gfxdraw(space->machine); |
| 138 | 129 | break; |
| 139 | case 0x06: blitter_direction_x = (data & 0x01) ? 1 : 0; | |
| 140 | blitter_direction_y = (data & 0x02) ? 1 : 0; | |
| 141 | nbmj8891_flipscreen = (data & 0x04) ? 1 : 0; | |
| 142 | nbmj8891_dispflag = (data & 0x08) ? 0 : 1; | |
| 143 | if (gfxdraw_mode) nbmj8891_vramflip(space->machine, 1); | |
| 130 | case 0x06: state->blitter_direction_x = (data & 0x01) ? 1 : 0; | |
| 131 | state->blitter_direction_y = (data & 0x02) ? 1 : 0; | |
| 132 | state->flipscreen = (data & 0x04) ? 1 : 0; | |
| 133 | state->dispflag = (data & 0x08) ? 0 : 1; | |
| 134 | if (state->gfxdraw_mode) nbmj8891_vramflip(space->machine, 1); | |
| 144 | 135 | nbmj8891_vramflip(space->machine, 0); |
| 145 | 136 | break; |
| 146 | 137 | case 0x07: break; |
| r10613 | r10614 | |
| 149 | 140 | |
| 150 | 141 | WRITE8_HANDLER( nbmj8891_taiwanmb_blitter_w ) |
| 151 | 142 | { |
| 143 | nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>(); | |
| 152 | 144 | switch (offset) |
| 153 | 145 | { |
| 154 | case 0: blitter_src_addr = (blitter_src_addr & 0xff00) | data; break; | |
| 155 | case 1: blitter_src_addr = (blitter_src_addr & 0x00ff) | (data << 8); break; | |
| 156 | case 2: blitter_destx = data; break; | |
| 157 | case 3: blitter_desty = data; break; | |
| 158 | case 4: blitter_sizex = (data - 1) & 0xff; break; | |
| 159 | case 5: blitter_sizey = (data - 1) & 0xff; break; | |
| 146 | case 0: state->blitter_src_addr = (state->blitter_src_addr & 0xff00) | data; break; | |
| 147 | case 1: state->blitter_src_addr = (state->blitter_src_addr & 0x00ff) | (data << 8); break; | |
| 148 | case 2: state->blitter_destx = data; break; | |
| 149 | case 3: state->blitter_desty = data; break; | |
| 150 | case 4: state->blitter_sizex = (data - 1) & 0xff; break; | |
| 151 | case 5: state->blitter_sizey = (data - 1) & 0xff; break; | |
| 160 | 152 | } |
| 161 | 153 | } |
| 162 | 154 | |
| r10613 | r10614 | |
| 167 | 159 | |
| 168 | 160 | WRITE8_HANDLER( nbmj8891_taiwanmb_gfxflag_w ) |
| 169 | 161 | { |
| 170 | nbmj8891_flipscreen = (data & 0x04) ? 1 : 0; | |
| 162 | nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>(); | |
| 163 | state->flipscreen = (data & 0x04) ? 1 : 0; | |
| 171 | 164 | |
| 172 | 165 | nbmj8891_vramflip(space->machine, 0); |
| 173 | 166 | } |
| 174 | 167 | |
| 175 | 168 | WRITE8_HANDLER( nbmj8891_taiwanmb_mcu_w ) |
| 176 | 169 | { |
| 177 | static int param_old[0x10]; | |
| 178 | static int param_cnt = 0; | |
| 170 | nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>(); | |
| 179 | 171 | |
| 180 | param_old[param_cnt & 0x0f] = data; | |
| 172 | state->param_old[state->param_cnt & 0x0f] = data; | |
| 181 | 173 | |
| 182 | 174 | if (data == 0x00) |
| 183 | 175 | { |
| 184 | blitter_direction_x = 0; | |
| 185 | blitter_direction_y = 0; | |
| 186 | blitter_destx = 0; | |
| 187 | blitter_desty = 0; | |
| 188 | blitter_sizex = 0; | |
| 189 | blitter_sizey = 0; | |
| 190 | nbmj8891_dispflag = 0; | |
| 176 | state->blitter_direction_x = 0; | |
| 177 | state->blitter_direction_y = 0; | |
| 178 | state->blitter_destx = 0; | |
| 179 | state->blitter_desty = 0; | |
| 180 | state->blitter_sizex = 0; | |
| 181 | state->blitter_sizey = 0; | |
| 182 | state->dispflag = 0; | |
| 191 | 183 | } |
| 192 | 184 | |
| 193 | 185 | /* |
| 194 | 186 | if (data == 0x02) |
| 195 | 187 | { |
| 196 | if (param_old[(param_cnt - 1) & 0x0f] == 0x18) | |
| 188 | if (state->param_old[(state->param_cnt - 1) & 0x0f] == 0x18) | |
| 197 | 189 | { |
| 198 | | |
| 190 | state-> | |
| 199 | 191 | } |
| 200 | else if (param_old[(param_cnt - 1) & 0x0f] == 0x1a) | |
| 192 | else if (state->param_old[(state->param_cnt - 1) & 0x0f] == 0x1a) | |
| 201 | 193 | { |
| 202 | | |
| 194 | state-> | |
| 203 | 195 | } |
| 204 | 196 | } |
| 205 | 197 | */ |
| r10613 | r10614 | |
| 211 | 203 | |
| 212 | 204 | if (data == 0x12) |
| 213 | 205 | { |
| 214 | if (param_old[(param_cnt - 1) & 0x0f] == 0x08) | |
| 206 | if (state->param_old[(state->param_cnt - 1) & 0x0f] == 0x08) | |
| 215 | 207 | { |
| 216 | blitter_direction_x = 1; | |
| 217 | blitter_direction_y = 0; | |
| 218 | blitter_destx += blitter_sizex + 1; | |
| 219 | blitter_desty += 0; | |
| 220 | blitter_sizex ^= 0xff; | |
| 221 | blitter_sizey ^= 0x00; | |
| 208 | state->blitter_direction_x = 1; | |
| 209 | state->blitter_direction_y = 0; | |
| 210 | state->blitter_destx += state->blitter_sizex + 1; | |
| 211 | state->blitter_desty += 0; | |
| 212 | state->blitter_sizex ^= 0xff; | |
| 213 | state->blitter_sizey ^= 0x00; | |
| 222 | 214 | } |
| 223 | else if (param_old[(param_cnt - 1) & 0x0f] == 0x0a) | |
| 215 | else if (state->param_old[(state->param_cnt - 1) & 0x0f] == 0x0a) | |
| 224 | 216 | { |
| 225 | blitter_direction_x = 0; | |
| 226 | blitter_direction_y = 1; | |
| 227 | blitter_destx += 0; | |
| 228 | blitter_desty += blitter_sizey + 1; | |
| 229 | blitter_sizex ^= 0x00; | |
| 230 | blitter_sizey ^= 0xff; | |
| 217 | state->blitter_direction_x = 0; | |
| 218 | state->blitter_direction_y = 1; | |
| 219 | state->blitter_destx += 0; | |
| 220 | state->blitter_desty += state->blitter_sizey + 1; | |
| 221 | state->blitter_sizex ^= 0x00; | |
| 222 | state->blitter_sizey ^= 0xff; | |
| 231 | 223 | } |
| 232 | else if (param_old[(param_cnt - 1) & 0x0f] == 0x0c) | |
| 224 | else if (state->param_old[(state->param_cnt - 1) & 0x0f] == 0x0c) | |
| 233 | 225 | { |
| 234 | blitter_direction_x = 1; | |
| 235 | blitter_direction_y = 1; | |
| 236 | blitter_destx += blitter_sizex + 1; | |
| 237 | blitter_desty += blitter_sizey + 1; | |
| 238 | blitter_sizex ^= 0xff; | |
| 239 | blitter_sizey ^= 0xff; | |
| 226 | state->blitter_direction_x = 1; | |
| 227 | state->blitter_direction_y = 1; | |
| 228 | state->blitter_destx += state->blitter_sizex + 1; | |
| 229 | state->blitter_desty += state->blitter_sizey + 1; | |
| 230 | state->blitter_sizex ^= 0xff; | |
| 231 | state->blitter_sizey ^= 0xff; | |
| 240 | 232 | } |
| 241 | else if (param_old[(param_cnt - 1) & 0x0f] == 0x0e) | |
| 233 | else if (state->param_old[(state->param_cnt - 1) & 0x0f] == 0x0e) | |
| 242 | 234 | { |
| 243 | blitter_direction_x = 0; | |
| 244 | blitter_direction_y = 0; | |
| 245 | blitter_destx += 0; | |
| 246 | blitter_desty += 0; | |
| 247 | blitter_sizex ^= 0x00; | |
| 248 | blitter_sizey ^= 0x00; | |
| 235 | state->blitter_direction_x = 0; | |
| 236 | state->blitter_direction_y = 0; | |
| 237 | state->blitter_destx += 0; | |
| 238 | state->blitter_desty += 0; | |
| 239 | state->blitter_sizex ^= 0x00; | |
| 240 | state->blitter_sizey ^= 0x00; | |
| 249 | 241 | } |
| 250 | 242 | |
| 251 | 243 | nbmj8891_gfxdraw(space->machine); |
| 252 | 244 | } |
| 253 | 245 | |
| 254 | // blitter_direction_x = 0; // for debug | |
| 255 | // blitter_direction_y = 0; // for debug | |
| 256 | nbmj8891_dispflag = 1; // for debug | |
| 246 | // state->blitter_direction_x = 0; // for debug | |
| 247 | // state->blitter_direction_y = 0; // for debug | |
| 248 | state->dispflag = 1; // for debug | |
| 257 | 249 | |
| 258 | param_cnt++; | |
| 250 | state->param_cnt++; | |
| 259 | 251 | } |
| 260 | 252 | |
| 261 | 253 | WRITE8_HANDLER( nbmj8891_scrolly_w ) |
| 262 | 254 | { |
| 263 | nbmj8891_scrolly = data; | |
| 255 | nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>(); | |
| 256 | state->scrolly = data; | |
| 264 | 257 | } |
| 265 | 258 | |
| 266 | 259 | WRITE8_HANDLER( nbmj8891_vramsel_w ) |
| 267 | 260 | { |
| 261 | nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>(); | |
| 268 | 262 | /* protection - not sure about this */ |
| 269 | 263 | nb1413m3_sndromrgntag = (data & 0x20) ? "protection" : "voice"; |
| 270 | 264 | |
| 271 | | |
| 265 | state-> | |
| 272 | 266 | } |
| 273 | 267 | |
| 274 | 268 | WRITE8_HANDLER( nbmj8891_romsel_w ) |
| 275 | 269 | { |
| 270 | nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>(); | |
| 276 | 271 | int gfxlen = space->machine->region("gfx1")->bytes(); |
| 277 | | |
| 272 | state-> | |
| 278 | 273 | |
| 279 | if ((0x20000 * | |
| 274 | if ((0x20000 * state-> | |
| 280 | 275 | { |
| 281 | 276 | #ifdef MAME_DEBUG |
| 282 | 277 | popmessage("GFXROM BANK OVER!!"); |
| 283 | 278 | #endif |
| 284 | | |
| 279 | state-> | |
| 285 | 280 | } |
| 286 | 281 | } |
| 287 | 282 | |
| r10613 | r10614 | |
| 291 | 286 | ******************************************************************************/ |
| 292 | 287 | void nbmj8891_vramflip(running_machine *machine, int vram) |
| 293 | 288 | { |
| 294 | stat | |
| 289 | nbmj8891_state | |
| 295 | 290 | int x, y; |
| 296 | 291 | UINT8 color1, color2; |
| 297 | 292 | UINT8 *vidram; |
| r10613 | r10614 | |
| 299 | 294 | int width = machine->primary_screen->width(); |
| 300 | 295 | int height = machine->primary_screen->height(); |
| 301 | 296 | |
| 302 | if ( | |
| 297 | if (state-> | |
| 303 | 298 | |
| 304 | vidram = vram ? | |
| 299 | vidram = vram ? state-> | |
| 305 | 300 | |
| 306 | 301 | for (y = 0; y < (height / 2); y++) |
| 307 | 302 | { |
| r10613 | r10614 | |
| 314 | 309 | } |
| 315 | 310 | } |
| 316 | 311 | |
| 317 | nbmj8891_flipscreen_old = nbmj8891_flipscreen; | |
| 318 | nbmj8891_screen_refresh = 1; | |
| 312 | state->flipscreen_old = state->flipscreen; | |
| 313 | state->screen_refresh = 1; | |
| 319 | 314 | } |
| 320 | 315 | |
| 321 | 316 | |
| 322 | 317 | static void update_pixel0(running_machine *machine, int x, int y) |
| 323 | 318 | { |
| 324 | UINT8 color = nbmj8891_videoram0[(y * machine->primary_screen->width()) + x]; | |
| 325 | *BITMAP_ADDR16(nbmj8891_tmpbitmap0, y, x) = color; | |
| 319 | nbmj8891_state *state = machine->driver_data<nbmj8891_state>(); | |
| 320 | UINT8 color = state->videoram0[(y * machine->primary_screen->width()) + x]; | |
| 321 | *BITMAP_ADDR16(state->tmpbitmap0, y, x) = color; | |
| 326 | 322 | } |
| 327 | 323 | |
| 328 | 324 | static void update_pixel1(running_machine *machine, int x, int y) |
| 329 | 325 | { |
| 330 | UINT8 color = nbmj8891_videoram1[(y * machine->primary_screen->width()) + x]; | |
| 331 | *BITMAP_ADDR16(nbmj8891_tmpbitmap1, y, x) = (color == 0x7f) ? 0xff : color; | |
| 326 | nbmj8891_state *state = machine->driver_data<nbmj8891_state>(); | |
| 327 | UINT8 color = state->videoram1[(y * machine->primary_screen->width()) + x]; | |
| 328 | *BITMAP_ADDR16(state->tmpbitmap1, y, x) = (color == 0x7f) ? 0xff : color; | |
| 332 | 329 | } |
| 333 | 330 | |
| 334 | 331 | static TIMER_CALLBACK( blitter_timer_callback ) |
| r10613 | r10614 | |
| 338 | 335 | |
| 339 | 336 | static void nbmj8891_gfxdraw(running_machine *machine) |
| 340 | 337 | { |
| 338 | nbmj8891_state *state = machine->driver_data<nbmj8891_state>(); | |
| 341 | 339 | UINT8 *GFX = machine->region("gfx1")->base(); |
| 342 | 340 | int width = machine->primary_screen->width(); |
| 343 | 341 | |
| r10613 | r10614 | |
| 352 | 350 | |
| 353 | 351 | nb1413m3_busyctr = 0; |
| 354 | 352 | |
| 355 | startx = blitter_destx + blitter_sizex; | |
| 356 | starty = blitter_desty + blitter_sizey; | |
| 353 | startx = state->blitter_destx + state->blitter_sizex; | |
| 354 | starty = state->blitter_desty + state->blitter_sizey; | |
| 357 | 355 | |
| 358 | if (blitter_direction_x) | |
| 356 | if (state->blitter_direction_x) | |
| 359 | 357 | { |
| 360 | sizex = blitter_sizex ^ 0xff; | |
| 358 | sizex = state->blitter_sizex ^ 0xff; | |
| 361 | 359 | skipx = 1; |
| 362 | 360 | } |
| 363 | 361 | else |
| 364 | 362 | { |
| 365 | sizex = blitter_sizex; | |
| 363 | sizex = state->blitter_sizex; | |
| 366 | 364 | skipx = -1; |
| 367 | 365 | } |
| 368 | 366 | |
| 369 | if (blitter_direction_y) | |
| 367 | if (state->blitter_direction_y) | |
| 370 | 368 | { |
| 371 | sizey = blitter_sizey ^ 0xff; | |
| 369 | sizey = state->blitter_sizey ^ 0xff; | |
| 372 | 370 | skipy = 1; |
| 373 | 371 | } |
| 374 | 372 | else |
| 375 | 373 | { |
| 376 | sizey = blitter_sizey; | |
| 374 | sizey = state->blitter_sizey; | |
| 377 | 375 | skipy = -1; |
| 378 | 376 | } |
| 379 | 377 | |
| 380 | 378 | gfxlen = machine->region("gfx1")->bytes(); |
| 381 | gfxaddr = ( | |
| 379 | gfxaddr = (state-> | |
| 382 | 380 | |
| 383 | 381 | for (y = starty, ctry = sizey; ctry >= 0; y += skipy, ctry--) |
| 384 | 382 | { |
| r10613 | r10614 | |
| 403 | 401 | dx1 = (2 * x + 0) & 0x1ff; |
| 404 | 402 | dx2 = (2 * x + 1) & 0x1ff; |
| 405 | 403 | |
| 406 | if (gfxdraw_mode) | |
| 404 | if (state->gfxdraw_mode) | |
| 407 | 405 | { |
| 408 | 406 | // 2 layer type |
| 409 | 407 | dy1 = y & 0xff; |
| 410 | dy2 = (y + | |
| 408 | dy2 = (y + state-> | |
| 411 | 409 | } |
| 412 | 410 | else |
| 413 | 411 | { |
| 414 | 412 | // 1 layer type |
| 415 | dy1 = (y + | |
| 413 | dy1 = (y + state-> | |
| 416 | 414 | dy2 = 0; |
| 417 | 415 | } |
| 418 | 416 | |
| 419 | if (! | |
| 417 | if (!state-> | |
| 420 | 418 | { |
| 421 | 419 | dx1 ^= 0x1ff; |
| 422 | 420 | dx2 ^= 0x1ff; |
| r10613 | r10614 | |
| 424 | 422 | dy2 ^= 0xff; |
| 425 | 423 | } |
| 426 | 424 | |
| 427 | if (blitter_direction_x) | |
| 425 | if (state->blitter_direction_x) | |
| 428 | 426 | { |
| 429 | 427 | // flip |
| 430 | 428 | color1 = (color & 0x0f) >> 0; |
| r10613 | r10614 | |
| 437 | 435 | color2 = (color & 0x0f) >> 0; |
| 438 | 436 | } |
| 439 | 437 | |
| 440 | color1 = nbmj8891_clut[((nbmj8891_clutsel & 0x7f) << 4) + color1]; | |
| 441 | color2 = nbmj8891_clut[((nbmj8891_clutsel & 0x7f) << 4) + color2]; | |
| 438 | color1 = state->clut[((state->clutsel & 0x7f) << 4) + color1]; | |
| 439 | color2 = state->clut[((state->clutsel & 0x7f) << 4) + color2]; | |
| 442 | 440 | |
| 443 | if ((!gfxdraw_mode) || ( | |
| 441 | if ((!state->gfxdraw_mode) || (state-> | |
| 444 | 442 | { |
| 445 | 443 | // layer 1 |
| 446 | 444 | if (color1 != 0xff) |
| 447 | 445 | { |
| 448 | | |
| 446 | state-> | |
| 449 | 447 | update_pixel0(machine, dx1, dy1); |
| 450 | 448 | } |
| 451 | 449 | if (color2 != 0xff) |
| 452 | 450 | { |
| 453 | | |
| 451 | state-> | |
| 454 | 452 | update_pixel0(machine, dx2, dy1); |
| 455 | 453 | } |
| 456 | 454 | } |
| 457 | if (gfxdraw_mode && ( | |
| 455 | if (state->gfxdraw_mode && (state-> | |
| 458 | 456 | { |
| 459 | 457 | // layer 2 |
| 460 | if ( | |
| 458 | if (state-> | |
| 461 | 459 | { |
| 462 | 460 | // transparent enable |
| 463 | 461 | if (color1 != 0xff) |
| 464 | 462 | { |
| 465 | | |
| 463 | state-> | |
| 466 | 464 | update_pixel1(machine, dx1, dy2); |
| 467 | 465 | } |
| 468 | 466 | if (color2 != 0xff) |
| 469 | 467 | { |
| 470 | | |
| 468 | state-> | |
| 471 | 469 | update_pixel1(machine, dx2, dy2); |
| 472 | 470 | } |
| 473 | 471 | } |
| 474 | 472 | else |
| 475 | 473 | { |
| 476 | 474 | // transparent disable |
| 477 | | |
| 475 | state-> | |
| 478 | 476 | update_pixel1(machine, dx1, dy2); |
| 479 | | |
| 477 | state-> | |
| 480 | 478 | update_pixel1(machine, dx2, dy2); |
| 481 | 479 | } |
| 482 | 480 | } |
| r10613 | r10614 | |
| 495 | 493 | ******************************************************************************/ |
| 496 | 494 | VIDEO_START( nbmj8891_1layer ) |
| 497 | 495 | { |
| 496 | nbmj8891_state *state = machine->driver_data<nbmj8891_state>(); | |
| 498 | 497 | UINT8 *CLUT = machine->region("protection")->base(); |
| 499 | 498 | int i; |
| 500 | 499 | int width = machine->primary_screen->width(); |
| 501 | 500 | int height = machine->primary_screen->height(); |
| 502 | 501 | |
| 503 | nbmj8891_tmpbitmap0 = machine->primary_screen->alloc_compatible_bitmap(); | |
| 504 | nbmj8891_videoram0 = auto_alloc_array(machine, UINT8, width * height); | |
| 505 | nbmj8891_palette = auto_alloc_array(machine, UINT8, 0x200); | |
| 506 | nbmj8891_clut = auto_alloc_array(machine, UINT8, 0x800); | |
| 507 | memset(nbmj8891_videoram0, 0xff, (width * height * sizeof(char))); | |
| 508 | gfxdraw_mode = 0; | |
| 502 | state->tmpbitmap0 = machine->primary_screen->alloc_compatible_bitmap(); | |
| 503 | state->videoram0 = auto_alloc_array(machine, UINT8, width * height); | |
| 504 | state->palette = auto_alloc_array(machine, UINT8, 0x200); | |
| 505 | state->clut = auto_alloc_array(machine, UINT8, 0x800); | |
| 506 | memset(state->videoram0, 0xff, (width * height * sizeof(char))); | |
| 507 | state->gfxdraw_mode = 0; | |
| 509 | 508 | |
| 510 | 509 | if (nb1413m3_type == NB1413M3_TAIWANMB) |
| 511 | for (i = 0; i < 0x0800; i++) | |
| 510 | for (i = 0; i < 0x0800; i++) state-> | |
| 512 | 511 | } |
| 513 | 512 | |
| 514 | 513 | VIDEO_START( nbmj8891_2layer ) |
| 515 | 514 | { |
| 515 | nbmj8891_state *state = machine->driver_data<nbmj8891_state>(); | |
| 516 | 516 | int width = machine->primary_screen->width(); |
| 517 | 517 | int height = machine->primary_screen->height(); |
| 518 | 518 | |
| 519 | nbmj8891_tmpbitmap0 = machine->primary_screen->alloc_compatible_bitmap(); | |
| 520 | nbmj8891_tmpbitmap1 = machine->primary_screen->alloc_compatible_bitmap(); | |
| 521 | nbmj8891_videoram0 = auto_alloc_array(machine, UINT8, width * height); | |
| 522 | nbmj8891_videoram1 = auto_alloc_array(machine, UINT8, width * height); | |
| 523 | nbmj8891_palette = auto_alloc_array(machine, UINT8, 0x200); | |
| 524 | nbmj8891_clut = auto_alloc_array(machine, UINT8, 0x800); | |
| 525 | memset(nbmj8891_videoram0, 0xff, (width * height * sizeof(UINT8))); | |
| 526 | memset(nbmj8891_videoram1, 0xff, (width * height * sizeof(UINT8))); | |
| 527 | gfxdraw_mode = 1; | |
| 519 | state->tmpbitmap0 = machine->primary_screen->alloc_compatible_bitmap(); | |
| 520 | state->tmpbitmap1 = machine->primary_screen->alloc_compatible_bitmap(); | |
| 521 | state->videoram0 = auto_alloc_array(machine, UINT8, width * height); | |
| 522 | state->videoram1 = auto_alloc_array(machine, UINT8, width * height); | |
| 523 | state->palette = auto_alloc_array(machine, UINT8, 0x200); | |
| 524 | state->clut = auto_alloc_array(machine, UINT8, 0x800); | |
| 525 | memset(state->videoram0, 0xff, (width * height * sizeof(UINT8))); | |
| 526 | memset(state->videoram1, 0xff, (width * height * sizeof(UINT8))); | |
| 527 | state->gfxdraw_mode = 1; | |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | 530 | /****************************************************************************** |
| r10613 | r10614 | |
| 533 | 533 | ******************************************************************************/ |
| 534 | 534 | SCREEN_UPDATE( nbmj8891 ) |
| 535 | 535 | { |
| 536 | nbmj8891_state *state = screen->machine->driver_data<nbmj8891_state>(); | |
| 536 | 537 | int x, y; |
| 537 | 538 | |
| 538 | if ( | |
| 539 | if (state-> | |
| 539 | 540 | { |
| 540 | 541 | int width = screen->width(); |
| 541 | 542 | int height = screen->height(); |
| 542 | 543 | |
| 543 | | |
| 544 | state-> | |
| 544 | 545 | for (y = 0; y < height; y++) |
| 545 | 546 | for (x = 0; x < width; x++) |
| 546 | 547 | update_pixel0(screen->machine, x, y); |
| 547 | 548 | |
| 548 | if (gfxdraw_mode) | |
| 549 | if (state->gfxdraw_mode) | |
| 549 | 550 | for (y = 0; y < height; y++) |
| 550 | 551 | for (x = 0; x < width; x++) |
| 551 | 552 | update_pixel1(screen->machine, x, y); |
| 552 | 553 | } |
| 553 | 554 | |
| 554 | if ( | |
| 555 | if (state-> | |
| 555 | 556 | { |
| 556 | static int scrolly; | |
| 557 | if (!nbmj8891_flipscreen) scrolly = nbmj8891_scrolly; | |
| 558 | else scrolly = (-nbmj8891_scrolly) & 0xff; | |
| 557 | int scrolly; | |
| 558 | if (!state->flipscreen) scrolly = state->scrolly; | |
| 559 | else scrolly = (-state->scrolly) & 0xff; | |
| 559 | 560 | |
| 560 | if (gfxdraw_mode) | |
| 561 | if (state->gfxdraw_mode) | |
| 561 | 562 | { |
| 562 | copyscrollbitmap (bitmap, nbmj8891_tmpbitmap0, 0, 0, 0, 0, cliprect); | |
| 563 | copyscrollbitmap_trans(bitmap, nbmj8891_tmpbitmap1, 0, 0, 1, &scrolly, cliprect, 0xff); | |
| 563 | copyscrollbitmap (bitmap, state->tmpbitmap0, 0, 0, 0, 0, cliprect); | |
| 564 | copyscrollbitmap_trans(bitmap, state->tmpbitmap1, 0, 0, 1, &scrolly, cliprect, 0xff); | |
| 564 | 565 | } |
| 565 | 566 | else |
| 566 | copyscrollbitmap(bitmap, | |
| 567 | copyscrollbitmap(bitmap, state-> | |
| 567 | 568 | } |
| 568 | 569 | else |
| 569 | 570 | bitmap_fill(bitmap, 0, 0xff); |
| r10613 | r10614 | |
|---|---|---|
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "includes/magmax.h" |
| 12 | 12 | |
| 13 | UINT16 *magmax_scroll_x; | |
| 14 | UINT16 *magmax_scroll_y; | |
| 15 | UINT16 *magmax_vreg; | |
| 16 | static int flipscreen = 0; | |
| 17 | 13 | |
| 18 | static UINT32 *prom_tab; | |
| 19 | ||
| 20 | ||
| 21 | 14 | /*************************************************************************** |
| 22 | 15 | |
| 23 | 16 | Convert the color PROMs into a more useable format. |
| r10613 | r10614 | |
| 70 | 63 | |
| 71 | 64 | VIDEO_START( magmax ) |
| 72 | 65 | { |
| 66 | magmax_state *state = machine->driver_data<magmax_state>(); | |
| 73 | 67 | int i,v; |
| 74 | 68 | UINT8 * prom14D = machine->region("user2")->base(); |
| 75 | 69 | |
| 76 | 70 | /* Set up save state */ |
| 77 | state_save_register_global(machine, flipscreen); | |
| 71 | state_save_register_global(machine, state->flipscreen); | |
| 78 | 72 | |
| 79 | prom_tab = auto_alloc_array(machine, UINT32, 256); | |
| 73 | state->prom_tab = auto_alloc_array(machine, UINT32, 256); | |
| 80 | 74 | |
| 81 | 75 | /* Allocate temporary bitmap */ |
| 82 | 76 | machine->generic.tmpbitmap = machine->primary_screen->alloc_compatible_bitmap(); |
| r10613 | r10614 | |
| 84 | 78 | for (i=0; i<256; i++) |
| 85 | 79 | { |
| 86 | 80 | v = (prom14D[i] << 4) + prom14D[i + 0x100]; |
| 87 | prom_tab[i] = ((v&0x1f)<<8) | ((v&0x10)<<10) | ((v&0xe0)>>1); /*convert data into more useful format*/ | |
| 81 | state->prom_tab[i] = ((v&0x1f)<<8) | ((v&0x10)<<10) | ((v&0xe0)>>1); /*convert data into more useful format*/ | |
| 88 | 82 | } |
| 89 | 83 | } |
| 90 | 84 | |
| r10613 | r10614 | |
| 98 | 92 | int offs; |
| 99 | 93 | |
| 100 | 94 | /* bit 2 flip screen */ |
| 101 | flipscreen = * | |
| 95 | state->flipscreen = *state-> | |
| 102 | 96 | |
| 103 | 97 | /* copy the background graphics */ |
| 104 | if (* | |
| 98 | if (*state-> | |
| 105 | 99 | bitmap_fill(bitmap, cliprect, 0); |
| 106 | 100 | else |
| 107 | 101 | { |
| 108 | 102 | int v; |
| 109 | 103 | UINT8 * rom18B = screen->machine->region("user1")->base(); |
| 110 | UINT32 scroll_h = (*magmax_scroll_x) & 0x3fff; | |
| 111 | UINT32 scroll_v = (*magmax_scroll_y) & 0xff; | |
| 104 | UINT32 scroll_h = (*state->scroll_x) & 0x3fff; | |
| 105 | UINT32 scroll_v = (*state->scroll_y) & 0xff; | |
| 112 | 106 | |
| 113 | 107 | /*clear background-over-sprites bitmap*/ |
| 114 | 108 | bitmap_fill(screen->machine->generic.tmpbitmap, NULL, 0); |
| r10613 | r10614 | |
| 142 | 136 | LS283 = LS283 + rom18B[ map_v_scr_1fe_6 + h ] + 0xff01; |
| 143 | 137 | } |
| 144 | 138 | |
| 145 | prom_data = prom_tab[ (LS283 >> 6) & 0xff ]; | |
| 139 | prom_data = state->prom_tab[ (LS283 >> 6) & 0xff ]; | |
| 146 | 140 | |
| 147 | 141 | rom18D_addr &= 0x20f8; |
| 148 | 142 | rom18D_addr += (prom_data & 0x1f00) + ((LS283 & 0x38) >>3); |
| r10613 | r10614 | |
| 165 | 159 | *BITMAP_ADDR16(screen->machine->generic.tmpbitmap, v, h) = line_data[h]; |
| 166 | 160 | } |
| 167 | 161 | |
| 168 | if (flipscreen) | |
| 162 | if (state->flipscreen) | |
| 169 | 163 | { |
| 170 | 164 | int i; |
| 171 | 165 | UINT16 line_data_flip_x[256]; |
| r10613 | r10614 | |
| 196 | 190 | sx = (spriteram16[offs + 3] & 0xff) - 0x80 + 0x100 * (attr & 0x01); |
| 197 | 191 | sy = 239 - sy; |
| 198 | 192 | |
| 199 | if (flipscreen) | |
| 193 | if (state->flipscreen) | |
| 200 | 194 | { |
| 201 | 195 | sx = 255-16 - sx; |
| 202 | 196 | sy = 239 - sy; |
| r10613 | r10614 | |
| 205 | 199 | } |
| 206 | 200 | |
| 207 | 201 | if (code & 0x80) /* sprite bankswitch */ |
| 208 | code += (* | |
| 202 | code += (*state-> | |
| 209 | 203 | |
| 210 | 204 | drawgfx_transmask(bitmap, cliprect, screen->machine->gfx[1], |
| 211 | 205 | code, |
| r10613 | r10614 | |
| 216 | 210 | } |
| 217 | 211 | } |
| 218 | 212 | |
| 219 | if (!(*magmax_vreg & 0x40)) /* background disable */ | |
| 220 | copybitmap_trans(bitmap, screen->machine->generic.tmpbitmap, flipscreen,flipscreen,0,0, cliprect, 0); | |
| 213 | if (!(*state->vreg & 0x40)) /* background disable */ | |
| 214 | copybitmap_trans(bitmap, screen->machine->generic.tmpbitmap, state->flipscreen,state->flipscreen,0,0, cliprect, 0); | |
| 221 | 215 | |
| 222 | 216 | /* draw the foreground characters */ |
| 223 | 217 | for (offs = 32*32-1; offs >= 0; offs -= 1) |
| 224 | 218 | { |
| 225 | //int page = (* | |
| 219 | //int page = (*state-> | |
| 226 | 220 | int code; |
| 227 | 221 | |
| 228 | 222 | code = videoram[offs /*+ page*/] & 0xff; |
| r10613 | r10614 | |
| 231 | 225 | int sx = (offs % 32); |
| 232 | 226 | int sy = (offs / 32); |
| 233 | 227 | |
| 234 | if (flipscreen) | |
| 228 | if (state->flipscreen) | |
| 235 | 229 | { |
| 236 | 230 | sx = 31 - sx; |
| 237 | 231 | sy = 31 - sy; |
| r10613 | r10614 | |
| 240 | 234 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], |
| 241 | 235 | code, |
| 242 | 236 | 0, |
| 243 | flipscreen, flipscreen, | |
| 237 | state->flipscreen, state->flipscreen, | |
| 244 | 238 | 8 * sx, 8 * sy, 0x0f); |
| 245 | 239 | } |
| 246 | 240 | } |
| r10613 | r10614 | |
|---|---|---|
| 20 | 20 | #include "emu.h" |
| 21 | 21 | #include "includes/gatron.h" |
| 22 | 22 | |
| 23 | static tilemap_t *bg_tilemap; | |
| 24 | 23 | |
| 25 | ||
| 26 | 24 | WRITE8_HANDLER( gat_videoram_w ) |
| 27 | 25 | { |
| 28 | 26 | gatron_state *state = space->machine->driver_data<gatron_state>(); |
| 29 | 27 | UINT8 *videoram = state->videoram; |
| 30 | 28 | videoram[offset] = data; |
| 31 | tilemap_mark_tile_dirty(bg_tilemap, offset); | |
| 29 | tilemap_mark_tile_dirty(state->bg_tilemap, offset); | |
| 32 | 30 | } |
| 33 | 31 | |
| 34 | 32 | static TILE_GET_INFO( get_bg_tile_info ) |
| r10613 | r10614 | |
| 49 | 47 | |
| 50 | 48 | VIDEO_START( gat ) |
| 51 | 49 | { |
| 52 | bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 8, 16, 48, 16); | |
| 50 | gatron_state *state = machine->driver_data<gatron_state>(); | |
| 51 | state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 8, 16, 48, 16); | |
| 53 | 52 | } |
| 54 | 53 | |
| 55 | 54 | SCREEN_UPDATE( gat ) |
| 56 | 55 | { |
| 57 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); | |
| 56 | gatron_state *state = screen->machine->driver_data<gatron_state>(); | |
| 57 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 58 | 58 | return 0; |
| 59 | 59 | } |
| 60 | 60 |
| r10613 | r10614 | |
|---|---|---|
| 11 | 11 | #include "includes/nbmj8688.h" |
| 12 | 12 | |
| 13 | 13 | |
| 14 | static int mjsikaku_scrolly; | |
| 15 | static int blitter_destx, blitter_desty; | |
| 16 | static int blitter_sizex, blitter_sizey; | |
| 17 | static int blitter_direction_x, blitter_direction_y; | |
| 18 | static int blitter_src_addr; | |
| 19 | static int mjsikaku_gfxrom; | |
| 20 | static int mjsikaku_dispflag; | |
| 21 | static int mjsikaku_gfxflag2; | |
| 22 | static int mjsikaku_gfxflag3; | |
| 23 | static int mjsikaku_flipscreen; | |
| 24 | static int mjsikaku_screen_refresh; | |
| 25 | static int mjsikaku_gfxmode; | |
| 26 | ||
| 27 | static bitmap_t *mjsikaku_tmpbitmap; | |
| 28 | static UINT16 *mjsikaku_videoram; | |
| 29 | static UINT8 *nbmj8688_clut; | |
| 30 | ||
| 31 | static UINT8 *HD61830B_ram[2]; | |
| 32 | static int HD61830B_instr[2]; | |
| 33 | static int HD61830B_addr[2]; | |
| 34 | ||
| 35 | ||
| 36 | static void mjsikaku_vramflip(void); | |
| 14 | static void mjsikaku_vramflip(nbmj8688_state *state); | |
| 37 | 15 | static void mbmj8688_gfxdraw(running_machine *machine, int gfxtype); |
| 38 | 16 | |
| 39 | 17 | |
| r10613 | r10614 | |
| 127 | 105 | |
| 128 | 106 | WRITE8_HANDLER( nbmj8688_clut_w ) |
| 129 | 107 | { |
| 130 | nbmj8688_clut[offset] = (data ^ 0xff); | |
| 108 | nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>(); | |
| 109 | state->clut[offset] = (data ^ 0xff); | |
| 131 | 110 | } |
| 132 | 111 | |
| 133 | 112 | /****************************************************************************** |
| r10613 | r10614 | |
| 137 | 116 | |
| 138 | 117 | WRITE8_HANDLER( nbmj8688_blitter_w ) |
| 139 | 118 | { |
| 119 | nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>(); | |
| 140 | 120 | switch (offset) |
| 141 | 121 | { |
| 142 | case 0x00: blitter_src_addr = (blitter_src_addr & 0xff00) | data; break; | |
| 143 | case 0x01: blitter_src_addr = (blitter_src_addr & 0x00ff) | (data << 8); break; | |
| 144 | case 0x02: blitter_destx = data; break; | |
| 145 | case 0x03: blitter_desty = data; break; | |
| 146 | case 0x04: blitter_sizex = data; break; | |
| 147 | case 0x05: blitter_sizey = data; | |
| 122 | case 0x00: state->blitter_src_addr = (state->blitter_src_addr & 0xff00) | data; break; | |
| 123 | case 0x01: state->blitter_src_addr = (state->blitter_src_addr & 0x00ff) | (data << 8); break; | |
| 124 | case 0x02: state->blitter_destx = data; break; | |
| 125 | case 0x03: state->blitter_desty = data; break; | |
| 126 | case 0x04: state->blitter_sizex = data; break; | |
| 127 | case 0x05: state->blitter_sizey = data; | |
| 148 | 128 | /* writing here also starts the blit */ |
| 149 | mbmj8688_gfxdraw(space->machine, mjsikaku_gfxmode); | |
| 129 | mbmj8688_gfxdraw(space->machine, state->mjsikaku_gfxmode); | |
| 150 | 130 | break; |
| 151 | case 0x06: blitter_direction_x = (data & 0x01) ? 1 : 0; | |
| 152 | blitter_direction_y = (data & 0x02) ? 1 : 0; | |
| 153 | mjsikaku_flipscreen = (data & 0x04) ? 0 : 1; | |
| 154 | mjsikaku_dispflag = (data & 0x08) ? 0 : 1; | |
| 155 | mjsikaku_vramflip(); | |
| 131 | case 0x06: state->blitter_direction_x = (data & 0x01) ? 1 : 0; | |
| 132 | state->blitter_direction_y = (data & 0x02) ? 1 : 0; | |
| 133 | state->mjsikaku_flipscreen = (data & 0x04) ? 0 : 1; | |
| 134 | state->mjsikaku_dispflag = (data & 0x08) ? 0 : 1; | |
| 135 | mjsikaku_vramflip(state); | |
| 156 | 136 | break; |
| 157 | 137 | case 0x07: break; |
| 158 | 138 | } |
| r10613 | r10614 | |
| 160 | 140 | |
| 161 | 141 | WRITE8_HANDLER( mjsikaku_gfxflag2_w ) |
| 162 | 142 | { |
| 163 | mjsikaku_gfxflag2 = data; | |
| 143 | nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>(); | |
| 144 | state->mjsikaku_gfxflag2 = data; | |
| 164 | 145 | |
| 165 | 146 | if (nb1413m3_type == NB1413M3_SEIHAM |
| 166 | 147 | || nb1413m3_type == NB1413M3_KORINAI |
| 167 | 148 | || nb1413m3_type == NB1413M3_KORINAIM |
| 168 | 149 | || nb1413m3_type == NB1413M3_LIVEGAL) |
| 169 | mjsikaku_gfxflag2 ^= 0x20; | |
| 150 | state->mjsikaku_gfxflag2 ^= 0x20; | |
| 170 | 151 | |
| 171 | 152 | if (nb1413m3_type == NB1413M3_OJOUSANM |
| 172 | 153 | || nb1413m3_type == NB1413M3_RYUUHA) |
| 173 | mjsikaku_gfxflag2 |= 0x20; | |
| 154 | state->mjsikaku_gfxflag2 |= 0x20; | |
| 174 | 155 | } |
| 175 | 156 | |
| 176 | 157 | static WRITE8_HANDLER( mjsikaku_gfxflag3_w ) |
| 177 | 158 | { |
| 178 | mjsikaku_gfxflag3 = (data & 0xe0); | |
| 159 | nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>(); | |
| 160 | state->mjsikaku_gfxflag3 = (data & 0xe0); | |
| 179 | 161 | } |
| 180 | 162 | |
| 181 | 163 | WRITE8_HANDLER( mjsikaku_scrolly_w ) |
| 182 | 164 | { |
| 183 | mjsikaku_scrolly = data; | |
| 165 | nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>(); | |
| 166 | state->mjsikaku_scrolly = data; | |
| 184 | 167 | } |
| 185 | 168 | |
| 186 | 169 | WRITE8_HANDLER( mjsikaku_romsel_w ) |
| 187 | 170 | { |
| 171 | nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>(); | |
| 188 | 172 | int gfxlen = space->machine->region("gfx1")->bytes(); |
| 189 | mjsikaku_gfxrom = (data & 0x0f); | |
| 173 | state->mjsikaku_gfxrom = (data & 0x0f); | |
| 190 | 174 | |
| 191 | if ((mjsikaku_gfxrom << 17) > (gfxlen - 1)) | |
| 175 | if ((state->mjsikaku_gfxrom << 17) > (gfxlen - 1)) | |
| 192 | 176 | { |
| 193 | 177 | #ifdef MAME_DEBUG |
| 194 | 178 | popmessage("GFXROM BANK OVER!!"); |
| 195 | 179 | #endif |
| 196 | mjsikaku_gfxrom &= (gfxlen / 0x20000 - 1); | |
| 180 | state->mjsikaku_gfxrom &= (gfxlen / 0x20000 - 1); | |
| 197 | 181 | } |
| 198 | 182 | } |
| 199 | 183 | |
| 200 | 184 | WRITE8_HANDLER( secolove_romsel_w ) |
| 201 | 185 | { |
| 186 | nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>(); | |
| 202 | 187 | int gfxlen = space->machine->region("gfx1")->bytes(); |
| 203 | mjsikaku_gfxrom = ((data & 0xc0) >> 4) + (data & 0x03); | |
| 188 | state->mjsikaku_gfxrom = ((data & 0xc0) >> 4) + (data & 0x03); | |
| 204 | 189 | mjsikaku_gfxflag2_w(space, 0, data); |
| 205 | 190 | |
| 206 | if ((mjsikaku_gfxrom << 17) > (gfxlen - 1)) | |
| 191 | if ((state->mjsikaku_gfxrom << 17) > (gfxlen - 1)) | |
| 207 | 192 | { |
| 208 | 193 | #ifdef MAME_DEBUG |
| 209 | 194 | popmessage("GFXROM BANK OVER!!"); |
| 210 | 195 | #endif |
| 211 | mjsikaku_gfxrom &= (gfxlen / 0x20000 - 1); | |
| 196 | state->mjsikaku_gfxrom &= (gfxlen / 0x20000 - 1); | |
| 212 | 197 | } |
| 213 | 198 | } |
| 214 | 199 | |
| 215 | 200 | WRITE8_HANDLER( crystalg_romsel_w ) |
| 216 | 201 | { |
| 202 | nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>(); | |
| 217 | 203 | int gfxlen = space->machine->region("gfx1")->bytes(); |
| 218 | mjsikaku_gfxrom = (data & 0x03); | |
| 204 | state->mjsikaku_gfxrom = (data & 0x03); | |
| 219 | 205 | mjsikaku_gfxflag2_w(space, 0, data); |
| 220 | 206 | |
| 221 | if ((mjsikaku_gfxrom << 17) > (gfxlen - 1)) | |
| 207 | if ((state->mjsikaku_gfxrom << 17) > (gfxlen - 1)) | |
| 222 | 208 | { |
| 223 | 209 | #ifdef MAME_DEBUG |
| 224 | 210 | popmessage("GFXROM BANK OVER!!"); |
| 225 | 211 | #endif |
| 226 | mjsikaku_gfxrom &= (gfxlen / 0x20000 - 1); | |
| 212 | state->mjsikaku_gfxrom &= (gfxlen / 0x20000 - 1); | |
| 227 | 213 | } |
| 228 | 214 | } |
| 229 | 215 | |
| 230 | 216 | WRITE8_HANDLER( seiha_romsel_w ) |
| 231 | 217 | { |
| 218 | nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>(); | |
| 232 | 219 | int gfxlen = space->machine->region("gfx1")->bytes(); |
| 233 | mjsikaku_gfxrom = (data & 0x1f); | |
| 220 | state->mjsikaku_gfxrom = (data & 0x1f); | |
| 234 | 221 | mjsikaku_gfxflag3_w(space, 0, data); |
| 235 | 222 | |
| 236 | if ((mjsikaku_gfxrom << 17) > (gfxlen - 1)) | |
| 223 | if ((state->mjsikaku_gfxrom << 17) > (gfxlen - 1)) | |
| 237 | 224 | { |
| 238 | 225 | #ifdef MAME_DEBUG |
| 239 | 226 | popmessage("GFXROM BANK OVER!!"); |
| 240 | 227 | #endif |
| 241 | mjsikaku_gfxrom &= (gfxlen / 0x20000 - 1); | |
| 228 | state->mjsikaku_gfxrom &= (gfxlen / 0x20000 - 1); | |
| 242 | 229 | } |
| 243 | 230 | } |
| 244 | 231 | |
| r10613 | r10614 | |
| 246 | 233 | |
| 247 | 234 | |
| 248 | 235 | ******************************************************************************/ |
| 249 | void mjsikaku_vramflip( | |
| 236 | void mjsikaku_vramflip(nbmj8688_state *state) | |
| 250 | 237 | { |
| 251 | static int mjsikaku_flipscreen_old = 0; | |
| 252 | 238 | int x, y; |
| 253 | 239 | UINT16 color1, color2; |
| 254 | 240 | |
| 255 | if (mjsikaku_flipscreen == mjsikaku_flipscreen_old) return; | |
| 241 | if (state->mjsikaku_flipscreen == state->mjsikaku_flipscreen_old) return; | |
| 256 | 242 | |
| 257 | 243 | for (y = 0; y < (256 / 2); y++) |
| 258 | 244 | { |
| 259 | 245 | for (x = 0; x < 512; x++) |
| 260 | 246 | { |
| 261 | color1 = mjsikaku_videoram[(y * 512) + x]; | |
| 262 | color2 = mjsikaku_videoram[((y ^ 0xff) * 512) + (x ^ 0x1ff)]; | |
| 263 | mjsikaku_videoram[(y * 512) + x] = color2; | |
| 264 | mjsikaku_videoram[((y ^ 0xff) * 512) + (x ^ 0x1ff)] = color1; | |
| 247 | color1 = state->mjsikaku_videoram[(y * 512) + x]; | |
| 248 | color2 = state->mjsikaku_videoram[((y ^ 0xff) * 512) + (x ^ 0x1ff)]; | |
| 249 | state->mjsikaku_videoram[(y * 512) + x] = color2; | |
| 250 | state->mjsikaku_videoram[((y ^ 0xff) * 512) + (x ^ 0x1ff)] = color1; | |
| 265 | 251 | } |
| 266 | 252 | } |
| 267 | 253 | |
| 268 | mjsikaku_flipscreen_old = mjsikaku_flipscreen; | |
| 269 | mjsikaku_screen_refresh = 1; | |
| 254 | state->mjsikaku_flipscreen_old = state->mjsikaku_flipscreen; | |
| 255 | state->mjsikaku_screen_refresh = 1; | |
| 270 | 256 | } |
| 271 | 257 | |
| 272 | 258 | |
| 273 | static void update_pixel(int x, int y) | |
| 259 | static void update_pixel(nbmj8688_state *state, int x, int y) | |
| 274 | 260 | { |
| 275 | int color = mjsikaku_videoram[(y * 512) + x]; | |
| 276 | *BITMAP_ADDR16(mjsikaku_tmpbitmap, y, x) = color; | |
| 261 | int color = state->mjsikaku_videoram[(y * 512) + x]; | |
| 262 | *BITMAP_ADDR16(state->mjsikaku_tmpbitmap, y, x) = color; | |
| 277 | 263 | } |
| 278 | 264 | |
| 279 | static void writeram_low(int x, int y, int color) | |
| 265 | static void writeram_low(nbmj8688_state *state, int x, int y, int color) | |
| 280 | 266 | { |
| 281 | mjsikaku_videoram[(y * 512) + x] &= 0xff00; | |
| 282 | mjsikaku_videoram[(y * 512) + x] |= color; | |
| 283 | update_pixel(x, y); | |
| 267 | state->mjsikaku_videoram[(y * 512) + x] &= 0xff00; | |
| 268 | state->mjsikaku_videoram[(y * 512) + x] |= color; | |
| 269 | update_pixel(state, x, y); | |
| 284 | 270 | } |
| 285 | 271 | |
| 286 | static void writeram_high(int x, int y, int color) | |
| 272 | static void writeram_high(nbmj8688_state *state, int x, int y, int color) | |
| 287 | 273 | { |
| 288 | mjsikaku_videoram[(y * 512) + x] &= 0x00ff; | |
| 289 | mjsikaku_videoram[(y * 512) + x] |= color << 8; | |
| 290 | update_pixel(x, y); | |
| 274 | state->mjsikaku_videoram[(y * 512) + x] &= 0x00ff; | |
| 275 | state->mjsikaku_videoram[(y * 512) + x] |= color << 8; | |
| 276 | update_pixel(state, x, y); | |
| 291 | 277 | } |
| 292 | 278 | |
| 293 | 279 | static TIMER_CALLBACK( blitter_timer_callback ) |
| r10613 | r10614 | |
| 297 | 283 | |
| 298 | 284 | static void mbmj8688_gfxdraw(running_machine *machine, int gfxtype) |
| 299 | 285 | { |
| 286 | nbmj8688_state *state = machine->driver_data<nbmj8688_state>(); | |
| 300 | 287 | UINT8 *GFX = machine->region("gfx1")->base(); |
| 301 | 288 | |
| 302 | 289 | int x, y; |
| r10613 | r10614 | |
| 310 | 297 | |
| 311 | 298 | if (gfxtype == GFXTYPE_PURE_12BIT) |
| 312 | 299 | { |
| 313 | if (mjsikaku_gfxflag2 & 0x20) return; | |
| 300 | if (state->mjsikaku_gfxflag2 & 0x20) return; | |
| 314 | 301 | } |
| 315 | 302 | |
| 316 | 303 | nb1413m3_busyctr = 0; |
| 317 | 304 | |
| 318 | startx = blitter_destx + blitter_sizex; | |
| 319 | starty = blitter_desty + blitter_sizey; | |
| 305 | startx = state->blitter_destx + state->blitter_sizex; | |
| 306 | starty = state->blitter_desty + state->blitter_sizey; | |
| 320 | 307 | |
| 321 | if (blitter_direction_x) | |
| 308 | if (state->blitter_direction_x) | |
| 322 | 309 | { |
| 323 | sizex = blitter_sizex ^ 0xff; | |
| 310 | sizex = state->blitter_sizex ^ 0xff; | |
| 324 | 311 | skipx = 1; |
| 325 | 312 | } |
| 326 | 313 | else |
| 327 | 314 | { |
| 328 | sizex = blitter_sizex; | |
| 315 | sizex = state->blitter_sizex; | |
| 329 | 316 | skipx = -1; |
| 330 | 317 | } |
| 331 | 318 | |
| 332 | if (blitter_direction_y) | |
| 319 | if (state->blitter_direction_y) | |
| 333 | 320 | { |
| 334 | sizey = blitter_sizey ^ 0xff; | |
| 321 | sizey = state->blitter_sizey ^ 0xff; | |
| 335 | 322 | skipy = 1; |
| 336 | 323 | } |
| 337 | 324 | else |
| 338 | 325 | { |
| 339 | sizey = blitter_sizey; | |
| 326 | sizey = state->blitter_sizey; | |
| 340 | 327 | skipy = -1; |
| 341 | 328 | } |
| 342 | 329 | |
| 343 | 330 | gfxlen = machine->region("gfx1")->bytes(); |
| 344 | gfxaddr = (mjsikaku_gfxrom << 17) + (blitter_src_addr << 1); | |
| 331 | gfxaddr = (state->mjsikaku_gfxrom << 17) + (state->blitter_src_addr << 1); | |
| 345 | 332 | //popmessage("ADDR:%08X DX:%03d DY:%03d SX:%03d SY:%03d", gfxaddr, startx, starty, sizex, sizey); |
| 346 | //if (blitter_direction_x|blitter_direction_y) popmessage("ADDR:%08X FX:%01d FY:%01d", gfxaddr, blitter_direction_x, blitter_direction_y); | |
| 333 | //if (state->blitter_direction_x|state->blitter_direction_y) popmessage("ADDR:%08X FX:%01d FY:%01d", gfxaddr, state->blitter_direction_x, state->blitter_direction_y); | |
| 347 | 334 | |
| 348 | 335 | for (y = starty, ctry = sizey; ctry >= 0; y += skipy, ctry--) |
| 349 | 336 | { |
| r10613 | r10614 | |
| 361 | 348 | |
| 362 | 349 | dx1 = (2 * x + 0) & 0x1ff; |
| 363 | 350 | dx2 = (2 * x + 1) & 0x1ff; |
| 364 | dy = (y + mjsikaku_scrolly) & 0xff; | |
| 351 | dy = (y + state->mjsikaku_scrolly) & 0xff; | |
| 365 | 352 | |
| 366 | if (mjsikaku_flipscreen) | |
| 353 | if (state->mjsikaku_flipscreen) | |
| 367 | 354 | { |
| 368 | 355 | dx1 ^= 0x1ff; |
| 369 | 356 | dx2 ^= 0x1ff; |
| r10613 | r10614 | |
| 372 | 359 | |
| 373 | 360 | if (gfxtype == GFXTYPE_HYBRID_16BIT) |
| 374 | 361 | { |
| 375 | if (mjsikaku_gfxflag3 & 0x40) | |
| 362 | if (state->mjsikaku_gfxflag3 & 0x40) | |
| 376 | 363 | { |
| 377 | 364 | // direct mode |
| 378 | 365 | |
| 379 | if (mjsikaku_gfxflag3 & 0x80) | |
| 366 | if (state->mjsikaku_gfxflag3 & 0x80) | |
| 380 | 367 | { |
| 381 | 368 | /* least significant bits */ |
| 382 | 369 | if (color != 0xff) |
| 383 | 370 | { |
| 384 | writeram_low(dx1, dy, color); | |
| 385 | writeram_low(dx2, dy, color); | |
| 371 | writeram_low(state, dx1, dy, color); | |
| 372 | writeram_low(state, dx2, dy, color); | |
| 386 | 373 | } |
| 387 | 374 | } |
| 388 | 375 | else |
| r10613 | r10614 | |
| 390 | 377 | /* most significant bits */ |
| 391 | 378 | if (color != 0xff) |
| 392 | 379 | { |
| 393 | writeram_high(dx1, dy, color); | |
| 394 | writeram_high(dx2, dy, color); | |
| 380 | writeram_high(state, dx1, dy, color); | |
| 381 | writeram_high(state, dx2, dy, color); | |
| 395 | 382 | } |
| 396 | 383 | } |
| 397 | 384 | } |
| r10613 | r10614 | |
| 401 | 388 | // lookup table mode |
| 402 | 389 | |
| 403 | 390 | // unknown flag (seiha, seiham) |
| 404 | // if (mjsikaku_gfxflag3 & 0x80) return; | |
| 391 | // if (state->mjsikaku_gfxflag3 & 0x80) return; | |
| 405 | 392 | |
| 406 | 393 | // unknown (seiha, seiham, iemoto, ojousan) |
| 407 | if (!(mjsikaku_gfxflag2 & 0x20)) return; | |
| 394 | if (!(state->mjsikaku_gfxflag2 & 0x20)) return; | |
| 408 | 395 | |
| 409 | if (blitter_direction_x) | |
| 396 | if (state->blitter_direction_x) | |
| 410 | 397 | { |
| 411 | 398 | // flip |
| 412 | 399 | color1 = (color & 0x0f) >> 0; |
| r10613 | r10614 | |
| 419 | 406 | color2 = (color & 0x0f) >> 0; |
| 420 | 407 | } |
| 421 | 408 | |
| 422 | color1 = (nbmj8688_clut[color1] << 8) | ((nbmj8688_clut[color1 | 0x10] & 0x0f) << 4); | |
| 423 | color2 = (nbmj8688_clut[color2] << 8) | ((nbmj8688_clut[color2 | 0x10] & 0x0f) << 4); | |
| 409 | color1 = (state->clut[color1] << 8) | ((state->clut[color1 | 0x10] & 0x0f) << 4); | |
| 410 | color2 = (state->clut[color2] << 8) | ((state->clut[color2 | 0x10] & 0x0f) << 4); | |
| 424 | 411 | |
| 425 | 412 | if (color1 != 0xfff0) |
| 426 | 413 | { |
| 427 | 414 | /* extend color from 12-bit to 16-bit */ |
| 428 | 415 | color1 = (color1 & 0xffc0) | ((color1 & 0x20) >> 1) | ((color1 & 0x10) >> 2); |
| 429 | mjsikaku_videoram[(dy * 512) + dx1] = color1; | |
| 430 | update_pixel(dx1, dy); | |
| 416 | state->mjsikaku_videoram[(dy * 512) + dx1] = color1; | |
| 417 | update_pixel(state, dx1, dy); | |
| 431 | 418 | } |
| 432 | 419 | |
| 433 | 420 | if (color2 != 0xfff0) |
| 434 | 421 | { |
| 435 | 422 | /* extend color from 12-bit to 16-bit */ |
| 436 | 423 | color2 = (color2 & 0xffc0) | ((color2 & 0x20) >> 1) | ((color2 & 0x10) >> 2); |
| 437 | mjsikaku_videoram[(dy * 512) + dx2] = color2; | |
| 438 | update_pixel(dx2, dy); | |
| 424 | state->mjsikaku_videoram[(dy * 512) + dx2] = color2; | |
| 425 | update_pixel(state, dx2, dy); | |
| 439 | 426 | } |
| 440 | 427 | } |
| 441 | 428 | } |
| r10613 | r10614 | |
| 443 | 430 | { |
| 444 | 431 | /* 12-bit palette with 4-to-12 bit lookup table */ |
| 445 | 432 | |
| 446 | if (blitter_direction_x) | |
| 433 | if (state->blitter_direction_x) | |
| 447 | 434 | { |
| 448 | 435 | // flip |
| 449 | 436 | color1 = (color & 0x0f) >> 0; |
| r10613 | r10614 | |
| 456 | 443 | color2 = (color & 0x0f) >> 0; |
| 457 | 444 | } |
| 458 | 445 | |
| 459 | color1 = nbmj8688_clut[color1] | ((nbmj8688_clut[color1 | 0x10] & 0x0f) << 8); | |
| 460 | color2 = nbmj8688_clut[color2] | ((nbmj8688_clut[color2 | 0x10] & 0x0f) << 8); | |
| 446 | color1 = state->clut[color1] | ((state->clut[color1 | 0x10] & 0x0f) << 8); | |
| 447 | color2 = state->clut[color2] | ((state->clut[color2 | 0x10] & 0x0f) << 8); | |
| 461 | 448 | |
| 462 | 449 | if (color1 != 0x0fff) |
| 463 | 450 | { |
| 464 | mjsikaku_videoram[(dy * 512) + dx1] = color1; | |
| 465 | update_pixel(dx1, dy); | |
| 451 | state->mjsikaku_videoram[(dy * 512) + dx1] = color1; | |
| 452 | update_pixel(state, dx1, dy); | |
| 466 | 453 | } |
| 467 | 454 | if (color2 != 0x0fff) |
| 468 | 455 | { |
| 469 | mjsikaku_videoram[(dy * 512) + dx2] = color2; | |
| 470 | update_pixel(dx2, dy); | |
| 456 | state->mjsikaku_videoram[(dy * 512) + dx2] = color2; | |
| 457 | update_pixel(state, dx2, dy); | |
| 471 | 458 | } |
| 472 | 459 | } |
| 473 | 460 | else |
| 474 | 461 | { |
| 475 | if (gfxtype == GFXTYPE_HYBRID_12BIT && (mjsikaku_gfxflag2 & 0x20)) | |
| 462 | if (gfxtype == GFXTYPE_HYBRID_12BIT && (state->mjsikaku_gfxflag2 & 0x20)) | |
| 476 | 463 | { |
| 477 | 464 | /* 4096 colors mode, wedged in on top of normal mode |
| 478 | 465 | Here we affect only the 4 least significant bits, the others are |
| 479 | 466 | changed as usual. |
| 480 | 467 | */ |
| 481 | 468 | |
| 482 | if (mjsikaku_gfxflag2 & 0x10) | |
| 469 | if (state->mjsikaku_gfxflag2 & 0x10) | |
| 483 | 470 | { |
| 484 | 471 | // 4096 colors low mode (2nd draw upper) |
| 485 | color = | |
| 472 | color = state-> | |
| 486 | 473 | } |
| 487 | 474 | else |
| 488 | 475 | { |
| 489 | 476 | // 4096 colors low mode (1st draw lower) |
| 490 | color = | |
| 477 | color = state-> | |
| 491 | 478 | } |
| 492 | 479 | |
| 493 | 480 | if (color != 0xff) |
| 494 | 481 | { |
| 495 | 482 | color &= 0x0f; |
| 496 | writeram_high(dx1, dy, color); | |
| 497 | writeram_high(dx2, dy, color); | |
| 483 | writeram_high(state, dx1, dy, color); | |
| 484 | writeram_high(state, dx2, dy, color); | |
| 498 | 485 | } |
| 499 | 486 | } |
| 500 | 487 | else |
| 501 | 488 | { |
| 502 | if (mjsikaku_gfxflag2 & 0x04) | |
| 489 | if (state->mjsikaku_gfxflag2 & 0x04) | |
| 503 | 490 | { |
| 504 | 491 | // direct mode |
| 505 | 492 | |
| r10613 | r10614 | |
| 509 | 496 | { |
| 510 | 497 | // lookup table mode |
| 511 | 498 | |
| 512 | if (blitter_direction_x) | |
| 499 | if (state->blitter_direction_x) | |
| 513 | 500 | { |
| 514 | 501 | // flip |
| 515 | 502 | color1 = (color & 0x0f) >> 0; |
| r10613 | r10614 | |
| 522 | 509 | color2 = (color & 0x0f) >> 0; |
| 523 | 510 | } |
| 524 | 511 | |
| 525 | color1 = nbmj8688_clut[color1]; | |
| 526 | color2 = nbmj8688_clut[color2]; | |
| 512 | color1 = state->clut[color1]; | |
| 513 | color2 = state->clut[color2]; | |
| 527 | 514 | } |
| 528 | 515 | |
| 529 | if (gfxtype == GFXTYPE_PURE_16BIT && !(mjsikaku_gfxflag2 & 0x20)) | |
| 516 | if (gfxtype == GFXTYPE_PURE_16BIT && !(state->mjsikaku_gfxflag2 & 0x20)) | |
| 530 | 517 | { |
| 531 | 518 | /* 16-bit palette most significant bits */ |
| 532 | if (color1 != 0xff) writeram_high(dx1, dy, color1); | |
| 533 | if (color2 != 0xff) writeram_high(dx2, dy, color2); | |
| 519 | if (color1 != 0xff) writeram_high(state, dx1, dy, color1); | |
| 520 | if (color2 != 0xff) writeram_high(state, dx2, dy, color2); | |
| 534 | 521 | } |
| 535 | 522 | else |
| 536 | 523 | { |
| 537 | 524 | /* 8-bit palette or 16-bit palette least significant bits */ |
| 538 | if (color1 != 0xff) writeram_low(dx1, dy, color1); | |
| 539 | if (color2 != 0xff) writeram_low(dx2, dy, color2); | |
| 525 | if (color1 != 0xff) writeram_low(state, dx1, dy, color1); | |
| 526 | if (color2 != 0xff) writeram_low(state, dx2, dy, color2); | |
| 540 | 527 | } |
| 541 | 528 | } |
| 542 | 529 | } |
| r10613 | r10614 | |
| 561 | 548 | |
| 562 | 549 | static void common_video_start(running_machine *machine) |
| 563 | 550 | { |
| 564 | mjsikaku_tmpbitmap = auto_bitmap_alloc(machine, 512, 256, machine->primary_screen->format()); | |
| 565 | mjsikaku_videoram = auto_alloc_array_clear(machine, UINT16, 512 * 256); | |
| 566 | nbmj8688_clut = auto_alloc_array(machine, UINT8, 0x20); | |
| 551 | nbmj8688_state *state = machine->driver_data<nbmj8688_state>(); | |
| 552 | state->mjsikaku_tmpbitmap = auto_bitmap_alloc(machine, 512, 256, machine->primary_screen->format()); | |
| 553 | state->mjsikaku_videoram = auto_alloc_array_clear(machine, UINT16, 512 * 256); | |
| 554 | state->clut = auto_alloc_array(machine, UINT8, 0x20); | |
| 567 | 555 | |
| 568 | mjsikaku_scrolly = 0; // reset because crystalg/crystal2 don't write to this register | |
| 556 | state->mjsikaku_scrolly = 0; // reset because crystalg/crystal2 don't write to this register | |
| 569 | 557 | } |
| 570 | 558 | |
| 571 | 559 | VIDEO_START( mbmj8688_8bit ) |
| 572 | 560 | { |
| 573 | mjsikaku_gfxmode = GFXTYPE_8BIT; | |
| 561 | nbmj8688_state *state = machine->driver_data<nbmj8688_state>(); | |
| 562 | state->mjsikaku_gfxmode = GFXTYPE_8BIT; | |
| 574 | 563 | common_video_start(machine); |
| 575 | 564 | } |
| 576 | 565 | |
| 577 | 566 | VIDEO_START( mbmj8688_hybrid_12bit ) |
| 578 | 567 | { |
| 579 | mjsikaku_gfxmode = GFXTYPE_HYBRID_12BIT; | |
| 568 | nbmj8688_state *state = machine->driver_data<nbmj8688_state>(); | |
| 569 | state->mjsikaku_gfxmode = GFXTYPE_HYBRID_12BIT; | |
| 580 | 570 | common_video_start(machine); |
| 581 | 571 | } |
| 582 | 572 | |
| 583 | 573 | VIDEO_START( mbmj8688_pure_12bit ) |
| 584 | 574 | { |
| 585 | mjsikaku_gfxmode = GFXTYPE_PURE_12BIT; | |
| 575 | nbmj8688_state *state = machine->driver_data<nbmj8688_state>(); | |
| 576 | state->mjsikaku_gfxmode = GFXTYPE_PURE_12BIT; | |
| 586 | 577 | common_video_start(machine); |
| 587 | 578 | } |
| 588 | 579 | |
| 589 | 580 | VIDEO_START( mbmj8688_hybrid_16bit ) |
| 590 | 581 | { |
| 591 | mjsikaku_gfxmode = GFXTYPE_HYBRID_16BIT; | |
| 582 | nbmj8688_state *state = machine->driver_data<nbmj8688_state>(); | |
| 583 | state->mjsikaku_gfxmode = GFXTYPE_HYBRID_16BIT; | |
| 592 | 584 | common_video_start(machine); |
| 593 | 585 | } |
| 594 | 586 | |
| 595 | 587 | VIDEO_START( mbmj8688_pure_16bit ) |
| 596 | 588 | { |
| 597 | mjsikaku_gfxmode = GFXTYPE_PURE_16BIT; | |
| 589 | nbmj8688_state *state = machine->driver_data<nbmj8688_state>(); | |
| 590 | state->mjsikaku_gfxmode = GFXTYPE_PURE_16BIT; | |
| 598 | 591 | common_video_start(machine); |
| 599 | 592 | } |
| 600 | 593 | |
| 601 | 594 | VIDEO_START( mbmj8688_pure_16bit_LCD ) |
| 602 | 595 | { |
| 603 | mjsikaku_gfxmode = GFXTYPE_PURE_16BIT; | |
| 596 | nbmj8688_state *state = machine->driver_data<nbmj8688_state>(); | |
| 597 | state->mjsikaku_gfxmode = GFXTYPE_PURE_16BIT; | |
| 604 | 598 | |
| 605 | HD61830B_ram[0] = auto_alloc_array(machine, UINT8, 0x10000); | |
| 606 | HD61830B_ram[1] = auto_alloc_array(machine, UINT8, 0x10000); | |
| 599 | state->HD61830B_ram[0] = auto_alloc_array(machine, UINT8, 0x10000); | |
| 600 | state->HD61830B_ram[1] = auto_alloc_array(machine, UINT8, 0x10000); | |
| 607 | 601 | |
| 608 | 602 | common_video_start(machine); |
| 609 | 603 | } |
| r10613 | r10614 | |
| 616 | 610 | |
| 617 | 611 | ******************************************************************************/ |
| 618 | 612 | |
| 619 | static void nbmj8688_HD61830B_instr_w( | |
| 613 | static void nbmj8688_HD61830B_instr_w(address_space *space,int offset,int data,int chip) | |
| 620 | 614 | { |
| 621 | HD61830B_instr[chip] = data; | |
| 615 | nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>(); | |
| 616 | state->HD61830B_instr[chip] = data; | |
| 622 | 617 | } |
| 623 | 618 | |
| 624 | static void nbmj8688_HD61830B_data_w( | |
| 619 | static void nbmj8688_HD61830B_data_w(address_space *space,int offset,int data,int chip) | |
| 625 | 620 | { |
| 626 | switch (HD61830B_instr[chip]) | |
| 621 | nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>(); | |
| 622 | switch (state->HD61830B_instr[chip]) | |
| 627 | 623 | { |
| 628 | 624 | case 0x0a: // set cursor address (low order) |
| 629 | HD61830B_addr[chip] = (HD61830B_addr[chip] & 0xff00) | data; | |
| 625 | state->HD61830B_addr[chip] = (state->HD61830B_addr[chip] & 0xff00) | data; | |
| 630 | 626 | break; |
| 631 | 627 | case 0x0b: // set cursor address (high order) |
| 632 | HD61830B_addr[chip] = (HD61830B_addr[chip] & 0x00ff) | (data << 8); | |
| 628 | state->HD61830B_addr[chip] = (state->HD61830B_addr[chip] & 0x00ff) | (data << 8); | |
| 633 | 629 | break; |
| 634 | 630 | case 0x0c: // write display data |
| 635 | HD61830B_ram[chip][HD61830B_addr[chip]++] = data; | |
| 631 | state->HD61830B_ram[chip][state->HD61830B_addr[chip]++] = data; | |
| 636 | 632 | break; |
| 637 | 633 | default: |
| 638 | logerror("HD61830B unsupported instruction %02x %02x\n",HD61830B_instr[chip],data); | |
| 634 | logerror("HD61830B unsupported instruction %02x %02x\n",state->HD61830B_instr[chip],data); | |
| 639 | 635 | break; |
| 640 | 636 | } |
| 641 | 637 | } |
| 642 | 638 | |
| 643 | 639 | WRITE8_HANDLER( nbmj8688_HD61830B_0_instr_w ) |
| 644 | 640 | { |
| 645 | nbmj8688_HD61830B_instr_w( | |
| 641 | nbmj8688_HD61830B_instr_w(space,offset,data,0); | |
| 646 | 642 | } |
| 647 | 643 | |
| 648 | 644 | WRITE8_HANDLER( nbmj8688_HD61830B_1_instr_w ) |
| 649 | 645 | { |
| 650 | nbmj8688_HD61830B_instr_w( | |
| 646 | nbmj8688_HD61830B_instr_w(space,offset,data,1); | |
| 651 | 647 | } |
| 652 | 648 | |
| 653 | 649 | WRITE8_HANDLER( nbmj8688_HD61830B_both_instr_w ) |
| 654 | 650 | { |
| 655 | nbmj8688_HD61830B_instr_w(0,offset,data); | |
| 656 | nbmj8688_HD61830B_instr_w(1,offset,data); | |
| 651 | nbmj8688_HD61830B_instr_w(space,offset,data,0); | |
| 652 | nbmj8688_HD61830B_instr_w(space,offset,data,1); | |
| 657 | 653 | } |
| 658 | 654 | |
| 659 | 655 | WRITE8_HANDLER( nbmj8688_HD61830B_0_data_w ) |
| 660 | 656 | { |
| 661 | nbmj8688_HD61830B_data_w( | |
| 657 | nbmj8688_HD61830B_data_w(space,offset,data,0); | |
| 662 | 658 | } |
| 663 | 659 | |
| 664 | 660 | WRITE8_HANDLER( nbmj8688_HD61830B_1_data_w ) |
| 665 | 661 | { |
| 666 | nbmj8688_HD61830B_data_w( | |
| 662 | nbmj8688_HD61830B_data_w(space,offset,data,1); | |
| 667 | 663 | } |
| 668 | 664 | |
| 669 | 665 | WRITE8_HANDLER( nbmj8688_HD61830B_both_data_w ) |
| 670 | 666 | { |
| 671 | nbmj8688_HD61830B_data_w(0,offset,data); | |
| 672 | nbmj8688_HD61830B_data_w(1,offset,data); | |
| 667 | nbmj8688_HD61830B_data_w(space,offset,data,0); | |
| 668 | nbmj8688_HD61830B_data_w(space,offset,data,1); | |
| 673 | 669 | } |
| 674 | 670 | |
| 675 | 671 | |
| r10613 | r10614 | |
| 682 | 678 | |
| 683 | 679 | SCREEN_UPDATE( mbmj8688 ) |
| 684 | 680 | { |
| 681 | nbmj8688_state *state = screen->machine->driver_data<nbmj8688_state>(); | |
| 685 | 682 | int x, y; |
| 686 | 683 | |
| 687 | if (mjsikaku_screen_refresh) | |
| 684 | if (state->mjsikaku_screen_refresh) | |
| 688 | 685 | { |
| 689 | mjsikaku_screen_refresh = 0; | |
| 686 | state->mjsikaku_screen_refresh = 0; | |
| 690 | 687 | for (y = 0; y < 256; y++) |
| 691 | 688 | { |
| 692 | 689 | for (x = 0; x < 512; x++) |
| 693 | 690 | { |
| 694 | update_pixel(x,y); | |
| 691 | update_pixel(state, x, y); | |
| 695 | 692 | } |
| 696 | 693 | } |
| 697 | 694 | } |
| 698 | 695 | |
| 699 | if (mjsikaku_dispflag) | |
| 696 | if (state->mjsikaku_dispflag) | |
| 700 | 697 | { |
| 701 | 698 | int scrolly; |
| 702 | if (mjsikaku_flipscreen) scrolly = mjsikaku_scrolly; | |
| 703 | else scrolly = (-mjsikaku_scrolly) & 0xff; | |
| 699 | if (state->mjsikaku_flipscreen) scrolly = state->mjsikaku_scrolly; | |
| 700 | else scrolly = (-state->mjsikaku_scrolly) & 0xff; | |
| 704 | 701 | |
| 705 | copybitmap(bitmap, mjsikaku_tmpbitmap, 0, 0, 0, scrolly, cliprect); | |
| 706 | copybitmap(bitmap, mjsikaku_tmpbitmap, 0, 0, 0, scrolly - 256, cliprect); | |
| 702 | copybitmap(bitmap, state->mjsikaku_tmpbitmap, 0, 0, 0, scrolly, cliprect); | |
| 703 | copybitmap(bitmap, state->mjsikaku_tmpbitmap, 0, 0, 0, scrolly - 256, cliprect); | |
| 707 | 704 | } |
| 708 | 705 | else |
| 709 | 706 | bitmap_fill(bitmap, 0, 0); |
| r10613 | r10614 | |
| 715 | 712 | |
| 716 | 713 | SCREEN_UPDATE( mbmj8688_lcd0 ) |
| 717 | 714 | { |
| 715 | nbmj8688_state *state = screen->machine->driver_data<nbmj8688_state>(); | |
| 718 | 716 | int x, y, b; |
| 719 | 717 | |
| 720 | 718 | for (y = 0;y < 64;y++) |
| 721 | 719 | for (x = 0;x < 60;x++) |
| 722 | 720 | { |
| 723 | int data = HD61830B_ram[0][y * 60 + x]; | |
| 721 | int data = state->HD61830B_ram[0][y * 60 + x]; | |
| 724 | 722 | |
| 725 | 723 | for (b = 0;b < 8;b++) |
| 726 | 724 | *BITMAP_ADDR16(bitmap, y, (8*x+b)) = (data & (1<<b)) ? 0x0000 : 0x18ff; |
| r10613 | r10614 | |
| 730 | 728 | |
| 731 | 729 | SCREEN_UPDATE( mbmj8688_lcd1 ) |
| 732 | 730 | { |
| 731 | nbmj8688_state *state = screen->machine->driver_data<nbmj8688_state>(); | |
| 733 | 732 | int x, y, b; |
| 734 | 733 | |
| 735 | 734 | for (y = 0;y < 64;y++) |
| 736 | 735 | for (x = 0;x < 60;x++) |
| 737 | 736 | { |
| 738 | int data = HD61830B_ram[1][y * 60 + x]; | |
| 737 | int data = state->HD61830B_ram[1][y * 60 + x]; | |
| 739 | 738 | |
| 740 | 739 | for (b = 0;b < 8;b++) |
| 741 | 740 | *BITMAP_ADDR16(bitmap, y, (8*x+b)) = (data & (1<<b)) ? 0x0000 : 0x18ff; |
| r10613 | r10614 | |
|---|---|---|
| 8 | 8 | #include "includes/victory.h" |
| 9 | 9 | |
| 10 | 10 | |
| 11 | /* globally-accessible storage */ | |
| 12 | UINT8 *victory_videoram; | |
| 13 | UINT8 *victory_charram; | |
| 14 | 11 | |
| 15 | /* local allocated storage */ | |
| 16 | static UINT16 victory_paletteram[0x40]; /* 9 bits used */ | |
| 17 | static UINT8 *bgbitmap; | |
| 18 | static UINT8 *fgbitmap; | |
| 19 | static UINT8 *rram, *gram, *bram; | |
| 20 | ||
| 21 | /* interrupt, collision, and control states */ | |
| 22 | static UINT8 vblank_irq; | |
| 23 | static UINT8 fgcoll, fgcollx, fgcolly; | |
| 24 | static UINT8 bgcoll, bgcollx, bgcolly; | |
| 25 | static UINT8 scrollx, scrolly; | |
| 26 | static UINT8 video_control; | |
| 27 | ||
| 28 | /* microcode state */ | |
| 29 | static struct | |
| 30 | { | |
| 31 | UINT16 i; | |
| 32 | UINT16 pc; | |
| 33 | UINT8 r,g,b; | |
| 34 | UINT8 x,xp,y,yp; | |
| 35 | UINT8 cmd,cmdlo; | |
| 36 | emu_timer * timer; | |
| 37 | UINT8 timer_active; | |
| 38 | attotime endtime; | |
| 39 | } micro; | |
| 40 | ||
| 41 | ||
| 42 | 12 | /* number of ticks per clock of the microcode state machine */ |
| 43 | 13 | /* from what I can tell, this should be divided by 32, not 8 */ |
| 44 | 14 | /* but the interrupt test does some precise timing, and fails */ |
| r10613 | r10614 | |
| 53 | 23 | |
| 54 | 24 | |
| 55 | 25 | /* function prototypes */ |
| 56 | static int command2( | |
| 26 | static int command2(running_machine *machine); | |
| 57 | 27 | static int command3(running_machine *machine); |
| 58 | 28 | static int command4(running_machine *machine); |
| 59 | 29 | static int command5(running_machine *machine); |
| 60 | static int command6( | |
| 30 | static int command6(running_machine *machine); | |
| 61 | 31 | static int command7(running_machine *machine); |
| 62 | 32 | |
| 63 | 33 | |
| r10613 | r10614 | |
| 70 | 40 | |
| 71 | 41 | VIDEO_START( victory ) |
| 72 | 42 | { |
| 43 | victory_state *state = machine->driver_data<victory_state>(); | |
| 73 | 44 | /* allocate bitmapram */ |
| 74 | rram = auto_alloc_array(machine, UINT8, 0x4000); | |
| 75 | gram = auto_alloc_array(machine, UINT8, 0x4000); | |
| 76 | bram = auto_alloc_array(machine, UINT8, 0x4000); | |
| 45 | state->rram = auto_alloc_array(machine, UINT8, 0x4000); | |
| 46 | state->gram = auto_alloc_array(machine, UINT8, 0x4000); | |
| 47 | state->bram = auto_alloc_array(machine, UINT8, 0x4000); | |
| 77 | 48 | |
| 78 | 49 | /* allocate bitmaps */ |
| 79 | bgbitmap = auto_alloc_array(machine, UINT8, 256 * 256); | |
| 80 | fgbitmap = auto_alloc_array(machine, UINT8, 256 * 256); | |
| 50 | state->bgbitmap = auto_alloc_array(machine, UINT8, 256 * 256); | |
| 51 | state->fgbitmap = auto_alloc_array(machine, UINT8, 256 * 256); | |
| 81 | 52 | |
| 82 | 53 | /* reset globals */ |
| 83 | vblank_irq = 0; | |
| 84 | fgcoll = fgcollx = fgcolly = 0; | |
| 85 | bgcoll = bgcollx = bgcolly = 0; | |
| 86 | scrollx = scrolly = 0; | |
| 87 | video_control = 0; | |
| 88 | memset(µ, 0, sizeof(micro)); | |
| 89 | micro.timer = machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 54 | state->vblank_irq = 0; | |
| 55 | state->fgcoll = state->fgcollx = state->fgcolly = 0; | |
| 56 | state->bgcoll = state->bgcollx = state->bgcolly = 0; | |
| 57 | state->scrollx = state->scrolly = 0; | |
| 58 | state->video_control = 0; | |
| 59 | memset(&state->micro, 0, sizeof(state->micro)); | |
| 60 | state->micro.timer = machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 90 | 61 | |
| 91 | 62 | /* register for state saving */ |
| 92 | state_save_register_global_array(machine, | |
| 63 | state_save_register_global_array(machine, s | |
| 93 | 64 | } |
| 94 | 65 | |
| 95 | 66 | |
| r10613 | r10614 | |
| 102 | 73 | |
| 103 | 74 | static void victory_update_irq(running_machine *machine) |
| 104 | 75 | { |
| 105 | if (vblank_irq || fgcoll || (bgcoll && (video_control & 0x20))) | |
| 76 | victory_state *state = machine->driver_data<victory_state>(); | |
| 77 | if (state->vblank_irq || state->fgcoll || (state->bgcoll && (state->video_control & 0x20))) | |
| 106 | 78 | cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); |
| 107 | 79 | else |
| 108 | 80 | cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE); |
| r10613 | r10614 | |
| 111 | 83 | |
| 112 | 84 | INTERRUPT_GEN( victory_vblank_interrupt ) |
| 113 | 85 | { |
| 114 | vblank_irq = 1; | |
| 86 | victory_state *state = device->machine->driver_data<victory_state>(); | |
| 87 | state->vblank_irq = 1; | |
| 115 | 88 | |
| 116 | 89 | victory_update_irq(device->machine); |
| 117 | 90 | } |
| r10613 | r10614 | |
| 126 | 99 | |
| 127 | 100 | WRITE8_HANDLER( victory_paletteram_w ) |
| 128 | 101 | { |
| 129 | victory_paletteram[offset & 0x3f] = ((offset & 0x80) << 1) | data; | |
| 102 | victory_state *state = space->machine->driver_data<victory_state>(); | |
| 103 | state->paletteram[offset & 0x3f] = ((offset & 0x80) << 1) | data; | |
| 130 | 104 | } |
| 131 | 105 | |
| 132 | 106 | |
| 133 | 107 | static void set_palette(running_machine *machine) |
| 134 | 108 | { |
| 109 | victory_state *state = machine->driver_data<victory_state>(); | |
| 135 | 110 | offs_t offs; |
| 136 | 111 | |
| 137 | 112 | for (offs = 0; offs < 0x40; offs++) |
| 138 | 113 | { |
| 139 | UINT16 data = | |
| 114 | UINT16 data = s | |
| 140 | 115 | |
| 141 | 116 | palette_set_color_rgb(machine, offs, pal3bit(data >> 6), pal3bit(data >> 0), pal3bit(data >> 3)); |
| 142 | 117 | } |
| r10613 | r10614 | |
| 152 | 127 | |
| 153 | 128 | READ8_HANDLER( victory_video_control_r ) |
| 154 | 129 | { |
| 130 | victory_state *state = space->machine->driver_data<victory_state>(); | |
| 155 | 131 | int result = 0; |
| 156 | 132 | |
| 157 | 133 | switch (offset) |
| 158 | 134 | { |
| 159 | 135 | case 0x00: /* 5XFIQ */ |
| 160 | result = fgcollx; | |
| 136 | result = state->fgcollx; | |
| 161 | 137 | if (LOG_COLLISION) logerror("%04X:5XFIQ read = %02X\n", cpu_get_previouspc(space->cpu), result); |
| 162 | 138 | return result; |
| 163 | 139 | |
| 164 | 140 | case 0x01: /* 5CLFIQ */ |
| 165 | result = fgcolly; | |
| 166 | if (fgcoll) | |
| 141 | result = state->fgcolly; | |
| 142 | if (state->fgcoll) | |
| 167 | 143 | { |
| 168 | fgcoll = 0; | |
| 144 | state->fgcoll = 0; | |
| 169 | 145 | victory_update_irq(space->machine); |
| 170 | 146 | } |
| 171 | 147 | if (LOG_COLLISION) logerror("%04X:5CLFIQ read = %02X\n", cpu_get_previouspc(space->cpu), result); |
| 172 | 148 | return result; |
| 173 | 149 | |
| 174 | 150 | case 0x02: /* 5BACKX */ |
| 175 | result = bgcollx & 0xfc; | |
| 151 | result = state->bgcollx & 0xfc; | |
| 176 | 152 | if (LOG_COLLISION) logerror("%04X:5BACKX read = %02X\n", cpu_get_previouspc(space->cpu), result); |
| 177 | 153 | return result; |
| 178 | 154 | |
| 179 | 155 | case 0x03: /* 5BACKY */ |
| 180 | result = bgcolly; | |
| 181 | if (bgcoll) | |
| 156 | result = state->bgcolly; | |
| 157 | if (state->bgcoll) | |
| 182 | 158 | { |
| 183 | bgcoll = 0; | |
| 159 | state->bgcoll = 0; | |
| 184 | 160 | victory_update_irq(space->machine); |
| 185 | 161 | } |
| 186 | 162 | if (LOG_COLLISION) logerror("%04X:5BACKY read = %02X\n", cpu_get_previouspc(space->cpu), result); |
| r10613 | r10614 | |
| 192 | 168 | // D5 = 5VIRQ |
| 193 | 169 | // D4 = 5BCIRQ (3B1) |
| 194 | 170 | // D3 = SL256 |
| 195 | if (micro.timer_active && micro.timer->elapsed() < micro.endtime) | |
| 171 | if (state->micro.timer_active && state->micro.timer->elapsed() < state->micro.endtime) | |
| 196 | 172 | result |= 0x80; |
| 197 | result |= (~fgcoll & 1) << 6; | |
| 198 | result |= (~vblank_irq & 1) << 5; | |
| 199 | result |= (~bgcoll & 1) << 4; | |
| 173 | result |= (~state->fgcoll & 1) << 6; | |
| 174 | result |= (~state->vblank_irq & 1) << 5; | |
| 175 | result |= (~state->bgcoll & 1) << 4; | |
| 200 | 176 | result |= (space->machine->primary_screen->vpos() & 0x100) >> 5; |
| 201 | 177 | if (LOG_COLLISION) logerror("%04X:5STAT read = %02X\n", cpu_get_previouspc(space->cpu), result); |
| 202 | 178 | return result; |
| r10613 | r10614 | |
| 218 | 194 | |
| 219 | 195 | WRITE8_HANDLER( victory_video_control_w ) |
| 220 | 196 | { |
| 197 | victory_state *state = space->machine->driver_data<victory_state>(); | |
| 198 | struct micro_t µ = state->micro; | |
| 221 | 199 | switch (offset) |
| 222 | 200 | { |
| 223 | 201 | case 0x00: /* LOAD IL */ |
| r10613 | r10614 | |
| 246 | 224 | else if (micro.cmdlo == 6) |
| 247 | 225 | { |
| 248 | 226 | if (LOG_MICROCODE) logerror(" Command 6 triggered\n"); |
| 249 | command6(); | |
| 227 | command6(space->machine); | |
| 250 | 228 | } |
| 251 | 229 | break; |
| 252 | 230 | |
| r10613 | r10614 | |
| 286 | 264 | if (micro.cmdlo == 2) |
| 287 | 265 | { |
| 288 | 266 | if (LOG_MICROCODE) logerror(" Command 2 triggered by write to B\n"); |
| 289 | command2(); | |
| 267 | command2(space->machine); | |
| 290 | 268 | } |
| 291 | 269 | else if (micro.cmdlo == 7) |
| 292 | 270 | { |
| r10613 | r10614 | |
| 297 | 275 | |
| 298 | 276 | case 0x08: /* SCROLLX */ |
| 299 | 277 | if (LOG_MICROCODE) logerror("%04X:SCROLLX write = %02X\n", cpu_get_previouspc(space->cpu), data); |
| 300 | scrollx = data; | |
| 278 | state->scrollx = data; | |
| 301 | 279 | break; |
| 302 | 280 | |
| 303 | 281 | case 0x09: /* SCROLLY */ |
| 304 | 282 | if (LOG_MICROCODE) logerror("%04X:SCROLLY write = %02X\n", cpu_get_previouspc(space->cpu), data); |
| 305 | scrolly = data; | |
| 283 | state->scrolly = data; | |
| 306 | 284 | break; |
| 307 | 285 | |
| 308 | 286 | case 0x0a: /* CONTROL */ |
| r10613 | r10614 | |
| 314 | 292 | // D2 = BIR12 |
| 315 | 293 | // D1 = SELOVER |
| 316 | 294 | if (LOG_MICROCODE) logerror("%04X:CONTROL write = %02X\n", cpu_get_previouspc(space->cpu), data); |
| 317 | video_control = data; | |
| 295 | state->video_control = data; | |
| 318 | 296 | break; |
| 319 | 297 | |
| 320 | 298 | case 0x0b: /* CLRVIRQ */ |
| 321 | 299 | if (LOG_MICROCODE) logerror("%04X:CLRVIRQ write = %02X\n", cpu_get_previouspc(space->cpu), data); |
| 322 | vblank_irq = 0; | |
| 300 | state->vblank_irq = 0; | |
| 323 | 301 | victory_update_irq(space->machine); |
| 324 | 302 | break; |
| 325 | 303 | |
| r10613 | r10614 | |
| 524 | 502 | * |
| 525 | 503 | *************************************/ |
| 526 | 504 | |
| 527 | INLINE void count_states(int states) | |
| 505 | INLINE void count_states(struct micro_t µ, int states) | |
| 528 | 506 | { |
| 529 | 507 | attotime state_time = MICRO_STATE_CLOCK_PERIOD * states; |
| 530 | 508 | |
| r10613 | r10614 | |
| 552 | 530 | * |
| 553 | 531 | *************************************/ |
| 554 | 532 | |
| 555 | static int command2( | |
| 533 | static int command2(running_machine *machine) | |
| 556 | 534 | { |
| 535 | victory_state *state = machine->driver_data<victory_state>(); | |
| 536 | struct micro_t µ = state->micro; | |
| 557 | 537 | /* |
| 558 | 538 | Actual microcode: |
| 559 | 539 | 02 00 0 0 ZERORAM, INCI, SWVRAM |
| r10613 | r10614 | |
| 566 | 546 | int addr = micro.i++ & 0x3fff; |
| 567 | 547 | |
| 568 | 548 | if (micro.cmd & 0x10) |
| 569 | gram[addr] = micro.g; | |
| 549 | state->gram[addr] = micro.g; | |
| 570 | 550 | if (micro.cmd & 0x20) |
| 571 | bram[addr] = micro.b; | |
| 551 | state->bram[addr] = micro.b; | |
| 572 | 552 | if (micro.cmd & 0x40) |
| 573 | rram[addr] = micro.r; | |
| 553 | state->rram[addr] = micro.r; | |
| 574 | 554 | |
| 575 | count_states(3); | |
| 555 | count_states(micro, 3); | |
| 576 | 556 | return 0; |
| 577 | 557 | } |
| 578 | 558 | |
| r10613 | r10614 | |
| 586 | 566 | |
| 587 | 567 | static int command3(running_machine *machine) |
| 588 | 568 | { |
| 569 | victory_state *state = machine->driver_data<victory_state>(); | |
| 570 | struct micro_t µ = state->micro; | |
| 589 | 571 | /* |
| 590 | 572 | Actual microcode: |
| 591 | 573 | 03 1C 2 0 SLOADLH, SXFERY |
| r10613 | r10614 | |
| 624 | 606 | UINT8 src; |
| 625 | 607 | |
| 626 | 608 | /* non-collision-detect case */ |
| 627 | if (!(micro.cmd & 0x08) || fgcoll) | |
| 609 | if (!(micro.cmd & 0x08) || state->fgcoll) | |
| 628 | 610 | { |
| 629 | 611 | if (micro.cmd & 0x10) |
| 630 | 612 | { |
| 631 | src = gram[srcoffs]; | |
| 632 | gram[dstoffs + 0] ^= src >> shift; | |
| 633 | gram[dstoffs + 1] ^= src << nshift; | |
| 613 | src = state->gram[srcoffs]; | |
| 614 | state->gram[dstoffs + 0] ^= src >> shift; | |
| 615 | state->gram[dstoffs + 1] ^= src << nshift; | |
| 634 | 616 | } |
| 635 | 617 | if (micro.cmd & 0x20) |
| 636 | 618 | { |
| 637 | src = bram[srcoffs]; | |
| 638 | bram[dstoffs + 0] ^= src >> shift; | |
| 639 | bram[dstoffs + 1] ^= src << nshift; | |
| 619 | src = state->bram[srcoffs]; | |
| 620 | state->bram[dstoffs + 0] ^= src >> shift; | |
| 621 | state->bram[dstoffs + 1] ^= src << nshift; | |
| 640 | 622 | } |
| 641 | 623 | if (micro.cmd & 0x40) |
| 642 | 624 | { |
| 643 | src = rram[srcoffs]; | |
| 644 | rram[dstoffs + 0] ^= src >> shift; | |
| 645 | rram[dstoffs + 1] ^= src << nshift; | |
| 625 | src = state->rram[srcoffs]; | |
| 626 | state->rram[dstoffs + 0] ^= src >> shift; | |
| 627 | state->rram[dstoffs + 1] ^= src << nshift; | |
| 646 | 628 | } |
| 647 | 629 | } |
| 648 | 630 | |
| r10613 | r10614 | |
| 651 | 633 | { |
| 652 | 634 | if (micro.cmd & 0x10) |
| 653 | 635 | { |
| 654 | src = gram[srcoffs]; | |
| 655 | if ((gram[dstoffs + 0] & (src >> shift)) | (gram[dstoffs + 1] & (src << nshift))) | |
| 656 | fgcoll = 1, fgcollx = micro.xp, fgcolly = sy - 1; | |
| 657 | gram[dstoffs + 0] ^= src >> shift; | |
| 658 | gram[dstoffs + 1] ^= src << nshift; | |
| 636 | src = state->gram[srcoffs]; | |
| 637 | if ((state->gram[dstoffs + 0] & (src >> shift)) | (state->gram[dstoffs + 1] & (src << nshift))) | |
| 638 | state->fgcoll = 1, state->fgcollx = micro.xp, state->fgcolly = sy - 1; | |
| 639 | state->gram[dstoffs + 0] ^= src >> shift; | |
| 640 | state->gram[dstoffs + 1] ^= src << nshift; | |
| 659 | 641 | } |
| 660 | 642 | if (micro.cmd & 0x20) |
| 661 | 643 | { |
| 662 | src = bram[srcoffs]; | |
| 663 | if ((bram[dstoffs + 0] & (src >> shift)) | (bram[dstoffs + 1] & (src << nshift))) | |
| 664 | fgcoll = 1, fgcollx = micro.xp, fgcolly = sy - 1; | |
| 665 | bram[dstoffs + 0] ^= src >> shift; | |
| 666 | bram[dstoffs + 1] ^= src << nshift; | |
| 644 | src = state->bram[srcoffs]; | |
| 645 | if ((state->bram[dstoffs + 0] & (src >> shift)) | (state->bram[dstoffs + 1] & (src << nshift))) | |
| 646 | state->fgcoll = 1, state->fgcollx = micro.xp, state->fgcolly = sy - 1; | |
| 647 | state->bram[dstoffs + 0] ^= src >> shift; | |
| 648 | state->bram[dstoffs + 1] ^= src << nshift; | |
| 667 | 649 | } |
| 668 | 650 | if (micro.cmd & 0x40) |
| 669 | 651 | { |
| 670 | src = rram[srcoffs]; | |
| 671 | if ((rram[dstoffs + 0] & (src >> shift)) | (rram[dstoffs + 1] & (src << nshift))) | |
| 672 | fgcoll = 1, fgcollx = micro.xp, fgcolly = sy - 1; | |
| 673 | rram[dstoffs + 0] ^= src >> shift; | |
| 674 | rram[dstoffs + 1] ^= src << nshift; | |
| 652 | src = state->rram[srcoffs]; | |
| 653 | if ((state->rram[dstoffs + 0] & (src >> shift)) | (state->rram[dstoffs + 1] & (src << nshift))) | |
| 654 | state->fgcoll = 1, state->fgcollx = micro.xp, state->fgcolly = sy - 1; | |
| 655 | state->rram[dstoffs + 0] ^= src >> shift; | |
| 656 | state->rram[dstoffs + 1] ^= src << nshift; | |
| 675 | 657 | } |
| 676 | if (fgcoll) victory_update_irq(machine); | |
| 658 | if (state->fgcoll) victory_update_irq(machine); | |
| 677 | 659 | } |
| 678 | 660 | } |
| 679 | 661 | } |
| 680 | 662 | |
| 681 | count_states(3 + (2 + 2 * ycount) * xcount); | |
| 663 | count_states(micro, 3 + (2 + 2 * ycount) * xcount); | |
| 682 | 664 | |
| 683 | 665 | return micro.cmd & 0x80; |
| 684 | 666 | } |
| r10613 | r10614 | |
| 693 | 675 | |
| 694 | 676 | static int command4(running_machine *machine) |
| 695 | 677 | { |
| 678 | victory_state *state = machine->driver_data<victory_state>(); | |
| 679 | struct micro_t µ = state->micro; | |
| 696 | 680 | /* |
| 697 | 681 | Actual microcode: |
| 698 | 682 | 04 1A 2 0 SLOADPC |
| r10613 | r10614 | |
| 714 | 698 | |
| 715 | 699 | if (LOG_MICROCODE) logerror("================= EXECUTE BEGIN\n"); |
| 716 | 700 | |
| 717 | count_states(4); | |
| 701 | count_states(micro, 4); | |
| 718 | 702 | |
| 719 | 703 | micro.pc = micro.yp << 1; |
| 720 | 704 | do |
| 721 | 705 | { |
| 722 | micro.cmd = gram[0x2000 + micro.pc]; | |
| 706 | micro.cmd = state->gram[0x2000 + micro.pc]; | |
| 723 | 707 | micro.cmdlo = micro.cmd & 7; |
| 724 | micro.i = (bram[0x2000 + micro.pc] << 8) | rram[0x2000 + micro.pc]; | |
| 725 | micro.r = gram[0x2001 + micro.pc]; | |
| 726 | micro.xp = rram[0x2001 + micro.pc]; | |
| 727 | micro.yp = bram[0x2001 + micro.pc]; | |
| 708 | micro.i = (state->bram[0x2000 + micro.pc] << 8) | state->rram[0x2000 + micro.pc]; | |
| 709 | micro.r = state->gram[0x2001 + micro.pc]; | |
| 710 | micro.xp = state->rram[0x2001 + micro.pc]; | |
| 711 | micro.yp = state->bram[0x2001 + micro.pc]; | |
| 728 | 712 | if (LOG_MICROCODE) logerror("PC=%03X CMD=%02X I=%04X R=%02X X=%02X Y=%02X\n", micro.pc, micro.cmd, micro.i, micro.r, micro.xp, micro.yp); |
| 729 | 713 | micro.pc = (micro.pc + 2) & 0x1ff; |
| 730 | 714 | |
| r10613 | r10614 | |
| 732 | 716 | { |
| 733 | 717 | case 0: break; |
| 734 | 718 | case 1: break; |
| 735 | case 2: keep_going = command2(); break; | |
| 719 | case 2: keep_going = command2(machine); break; | |
| 736 | 720 | case 3: keep_going = command3(machine); break; |
| 737 | 721 | case 4: micro.pc = micro.yp << 1; keep_going = 1; break; |
| 738 | 722 | case 5: keep_going = command5(machine); break; |
| 739 | case 6: keep_going = command6(); break; | |
| 723 | case 6: keep_going = command6(machine); break; | |
| 740 | 724 | case 7: keep_going = command7(machine); break; |
| 741 | 725 | } |
| 742 | 726 | } while (keep_going); |
| r10613 | r10614 | |
| 756 | 740 | |
| 757 | 741 | static int command5(running_machine *machine) |
| 758 | 742 | { |
| 743 | victory_state *state = machine->driver_data<victory_state>(); | |
| 744 | struct micro_t µ = state->micro; | |
| 759 | 745 | /* |
| 760 | 746 | Actual microcode: |
| 761 | 747 | 05 0A 1 0 SXFERY, ADD128+SACCCLEAR, SACCCLK |
| r10613 | r10614 | |
| 809 | 795 | int c; |
| 810 | 796 | |
| 811 | 797 | /* non-collision-detect case */ |
| 812 | if (!(micro.cmd & 0x08) || fgcoll) | |
| 798 | if (!(micro.cmd & 0x08) || state->fgcoll) | |
| 813 | 799 | { |
| 814 | 800 | for (c = micro.i & 0xff; c < 0x100; c++) |
| 815 | 801 | { |
| r10613 | r10614 | |
| 817 | 803 | int shift = x & 7; |
| 818 | 804 | int nshift = 8 - shift; |
| 819 | 805 | |
| 820 | gram[addr + 0] ^= micro.g >> shift; | |
| 821 | gram[addr + 1] ^= micro.g << nshift; | |
| 822 | bram[addr + 0] ^= micro.b >> shift; | |
| 823 | bram[addr + 1] ^= micro.b << nshift; | |
| 824 | rram[addr + 0] ^= micro.r >> shift; | |
| 825 | rram[addr + 1] ^= micro.r << nshift; | |
| 806 | state->gram[addr + 0] ^= micro.g >> shift; | |
| 807 | state->gram[addr + 1] ^= micro.g << nshift; | |
| 808 | state->bram[addr + 0] ^= micro.b >> shift; | |
| 809 | state->bram[addr + 1] ^= micro.b << nshift; | |
| 810 | state->rram[addr + 0] ^= micro.r >> shift; | |
| 811 | state->rram[addr + 1] ^= micro.r << nshift; | |
| 826 | 812 | |
| 827 | 813 | acc += i; |
| 828 | 814 | if (acc & 0x100) |
| r10613 | r10614 | |
| 848 | 834 | int shift = x & 7; |
| 849 | 835 | int nshift = 8 - shift; |
| 850 | 836 | |
| 851 | if ((gram[addr + 0] & (micro.g >> shift)) | (gram[addr + 1] & (micro.g << nshift)) | | |
| 852 | (bram[addr + 0] & (micro.b >> shift)) | (bram[addr + 1] & (micro.b << nshift)) | | |
| 853 | (rram[addr + 0] & (micro.r >> shift)) | (rram[addr + 1] & (micro.r << nshift))) | |
| 854 | fgcoll = 1, fgcollx = x, fgcolly = y; | |
| 837 | if ((state->gram[addr + 0] & (micro.g >> shift)) | (state->gram[addr + 1] & (micro.g << nshift)) | | |
| 838 | (state->bram[addr + 0] & (micro.b >> shift)) | (state->bram[addr + 1] & (micro.b << nshift)) | | |
| 839 | (state->rram[addr + 0] & (micro.r >> shift)) | (state->rram[addr + 1] & (micro.r << nshift))) | |
| 840 | state->fgcoll = 1, state->fgcollx = x, state->fgcolly = y; | |
| 855 | 841 | |
| 856 | gram[addr + 0] ^= micro.g >> shift; | |
| 857 | gram[addr + 1] ^= micro.g << nshift; | |
| 858 | bram[addr + 0] ^= micro.b >> shift; | |
| 859 | bram[addr + 1] ^= micro.b << nshift; | |
| 860 | rram[addr + 0] ^= micro.r >> shift; | |
| 861 | rram[addr + 1] ^= micro.r << nshift; | |
| 842 | state->gram[addr + 0] ^= micro.g >> shift; | |
| 843 | state->gram[addr + 1] ^= micro.g << nshift; | |
| 844 | state->bram[addr + 0] ^= micro.b >> shift; | |
| 845 | state->bram[addr + 1] ^= micro.b << nshift; | |
| 846 | state->rram[addr + 0] ^= micro.r >> shift; | |
| 847 | state->rram[addr + 1] ^= micro.r << nshift; | |
| 862 | 848 | |
| 863 | 849 | acc += i; |
| 864 | 850 | if (acc & 0x100) |
| r10613 | r10614 | |
| 873 | 859 | } |
| 874 | 860 | acc &= 0xff; |
| 875 | 861 | } |
| 876 | if (fgcoll) victory_update_irq(machine); | |
| 862 | if (state->fgcoll) victory_update_irq(machine); | |
| 877 | 863 | } |
| 878 | 864 | |
| 879 | 865 | micro.xp = x; |
| 880 | 866 | |
| 881 | count_states(3 + 2 * (0x100 - (micro.i & 0xff))); | |
| 867 | count_states(micro, 3 + 2 * (0x100 - (micro.i & 0xff))); | |
| 882 | 868 | |
| 883 | 869 | return micro.cmd & 0x80; |
| 884 | 870 | } |
| r10613 | r10614 | |
| 891 | 877 | * |
| 892 | 878 | *************************************/ |
| 893 | 879 | |
| 894 | static int command6( | |
| 880 | static int command6(running_machine *machine) | |
| 895 | 881 | { |
| 882 | victory_state *state = machine->driver_data<victory_state>(); | |
| 883 | struct micro_t µ = state->micro; | |
| 896 | 884 | /* |
| 897 | 885 | Actual microcode: |
| 898 | 886 | 06 0C 0 0 SLOADLH, SLOADPC |
| r10613 | r10614 | |
| 920 | 908 | micro.pc &= 0x1ff; |
| 921 | 909 | |
| 922 | 910 | if (micro.cmd & 0x10) |
| 923 | gram[daddr] = gram[saddr]; | |
| 911 | state->gram[daddr] = state->gram[saddr]; | |
| 924 | 912 | if (micro.cmd & 0x20) |
| 925 | bram[daddr] = bram[saddr]; | |
| 913 | state->bram[daddr] = state->bram[saddr]; | |
| 926 | 914 | if (micro.cmd & 0x40) |
| 927 | rram[daddr] = rram[saddr]; | |
| 915 | state->rram[daddr] = state->rram[saddr]; | |
| 928 | 916 | } |
| 929 | 917 | |
| 930 | count_states(3 + 2 * (64 - (micro.r & 31) * 2)); | |
| 918 | count_states(micro, 3 + 2 * (64 - (micro.r & 31) * 2)); | |
| 931 | 919 | |
| 932 | 920 | return micro.cmd & 0x80; |
| 933 | 921 | } |
| r10613 | r10614 | |
| 942 | 930 | |
| 943 | 931 | static int command7(running_machine *machine) |
| 944 | 932 | { |
| 933 | victory_state *state = machine->driver_data<victory_state>(); | |
| 934 | struct micro_t µ = state->micro; | |
| 945 | 935 | /* |
| 946 | 936 | Actual microcode: |
| 947 | 937 | 07 08 1 0 SXFERY, SXFERX+INCX |
| r10613 | r10614 | |
| 960 | 950 | int nshift = 8 - shift; |
| 961 | 951 | |
| 962 | 952 | /* non-collision-detect case */ |
| 963 | if (!(micro.cmd & 0x08) || fgcoll) | |
| 953 | if (!(micro.cmd & 0x08) || state->fgcoll) | |
| 964 | 954 | { |
| 965 | 955 | if (micro.cmd & 0x10) |
| 966 | 956 | { |
| 967 | gram[addr + 0] ^= micro.g >> shift; | |
| 968 | gram[addr + 1] ^= micro.g << nshift; | |
| 957 | state->gram[addr + 0] ^= micro.g >> shift; | |
| 958 | state->gram[addr + 1] ^= micro.g << nshift; | |
| 969 | 959 | } |
| 970 | 960 | if (micro.cmd & 0x20) |
| 971 | 961 | { |
| 972 | bram[addr + 0] ^= micro.b >> shift; | |
| 973 | bram[addr + 1] ^= micro.b << nshift; | |
| 962 | state->bram[addr + 0] ^= micro.b >> shift; | |
| 963 | state->bram[addr + 1] ^= micro.b << nshift; | |
| 974 | 964 | } |
| 975 | 965 | if (micro.cmd & 0x40) |
| 976 | 966 | { |
| 977 | rram[addr + 0] ^= micro.r >> shift; | |
| 978 | rram[addr + 1] ^= micro.r << nshift; | |
| 967 | state->rram[addr + 0] ^= micro.r >> shift; | |
| 968 | state->rram[addr + 1] ^= micro.r << nshift; | |
| 979 | 969 | } |
| 980 | 970 | } |
| 981 | 971 | |
| r10613 | r10614 | |
| 984 | 974 | { |
| 985 | 975 | if (micro.cmd & 0x10) |
| 986 | 976 | { |
| 987 | if ((gram[addr + 0] & (micro.g >> shift)) | (gram[addr + 1] & (micro.g << nshift))) | |
| 988 | fgcoll = 1, fgcollx = micro.xp + 8, fgcolly = micro.yp; | |
| 989 | gram[addr + 0] ^= micro.g >> shift; | |
| 990 | gram[addr + 1] ^= micro.g << nshift; | |
| 977 | if ((state->gram[addr + 0] & (micro.g >> shift)) | (state->gram[addr + 1] & (micro.g << nshift))) | |
| 978 | state->fgcoll = 1, state->fgcollx = micro.xp + 8, state->fgcolly = micro.yp; | |
| 979 | state->gram[addr + 0] ^= micro.g >> shift; | |
| 980 | state->gram[addr + 1] ^= micro.g << nshift; | |
| 991 | 981 | } |
| 992 | 982 | if (micro.cmd & 0x20) |
| 993 | 983 | { |
| 994 | if ((bram[addr + 0] & (micro.b >> shift)) | (bram[addr + 1] & (micro.b << nshift))) | |
| 995 | fgcoll = 1, fgcollx = micro.xp + 8, fgcolly = micro.yp; | |
| 996 | bram[addr + 0] ^= micro.b >> shift; | |
| 997 | bram[addr + 1] ^= micro.b << nshift; | |
| 984 | if ((state->bram[addr + 0] & (micro.b >> shift)) | (state->bram[addr + 1] & (micro.b << nshift))) | |
| 985 | state->fgcoll = 1, state->fgcollx = micro.xp + 8, state->fgcolly = micro.yp; | |
| 986 | state->bram[addr + 0] ^= micro.b >> shift; | |
| 987 | state->bram[addr + 1] ^= micro.b << nshift; | |
| 998 | 988 | } |
| 999 | 989 | if (micro.cmd & 0x40) |
| 1000 | 990 | { |
| 1001 | if ((rram[addr + 0] & (micro.r >> shift)) | (rram[addr + 1] & (micro.r << nshift))) | |
| 1002 | fgcoll = 1, fgcollx = micro.xp + 8, fgcolly = micro.yp; | |
| 1003 | rram[addr + 0] ^= micro.r >> shift; | |
| 1004 | rram[addr + 1] ^= micro.r << nshift; | |
| 991 | if ((state->rram[addr + 0] & (micro.r >> shift)) | (state->rram[addr + 1] & (micro.r << nshift))) | |
| 992 | state->fgcoll = 1, state->fgcollx = micro.xp + 8, state->fgcolly = micro.yp; | |
| 993 | state->rram[addr + 0] ^= micro.r >> shift; | |
| 994 | state->rram[addr + 1] ^= micro.r << nshift; | |
| 1005 | 995 | } |
| 1006 | if (fgcoll) victory_update_irq(machine); | |
| 996 | if (state->fgcoll) victory_update_irq(machine); | |
| 1007 | 997 | } |
| 1008 | 998 | |
| 1009 | count_states(4); | |
| 999 | count_states(micro, 4); | |
| 1010 | 1000 | |
| 1011 | 1001 | return micro.cmd & 0x80; |
| 1012 | 1002 | } |
| r10613 | r10614 | |
| 1018 | 1008 | * |
| 1019 | 1009 | *************************************/ |
| 1020 | 1010 | |
| 1021 | static void update_background( | |
| 1011 | static void update_background(running_machine *machine) | |
| 1022 | 1012 | { |
| 1013 | victory_state *state = machine->driver_data<victory_state>(); | |
| 1023 | 1014 | int x, y, row, offs; |
| 1024 | 1015 | |
| 1025 | 1016 | for (y = offs = 0; y < 32; y++) |
| 1026 | 1017 | for (x = 0; x < 32; x++, offs++) |
| 1027 | 1018 | { |
| 1028 | int code = | |
| 1019 | int code = s | |
| 1029 | 1020 | |
| 1030 | 1021 | for (row = 0; row < 8; row++) |
| 1031 | 1022 | { |
| 1032 | UINT8 pix2 = victory_charram[0x0000 + 8 * code + row]; | |
| 1033 | UINT8 pix1 = victory_charram[0x0800 + 8 * code + row]; | |
| 1034 | UINT8 pix0 = victory_charram[0x1000 + 8 * code + row]; | |
| 1035 | UINT8 *dst = &bgbitmap[(y * 8 + row) * 256 + x * 8]; | |
| 1023 | UINT8 pix2 = state->charram[0x0000 + 8 * code + row]; | |
| 1024 | UINT8 pix1 = state->charram[0x0800 + 8 * code + row]; | |
| 1025 | UINT8 pix0 = state->charram[0x1000 + 8 * code + row]; | |
| 1026 | UINT8 *dst = &state->bgbitmap[(y * 8 + row) * 256 + x * 8]; | |
| 1036 | 1027 | |
| 1037 | 1028 | *dst++ = ((pix2 & 0x80) >> 5) | ((pix1 & 0x80) >> 6) | ((pix0 & 0x80) >> 7); |
| 1038 | 1029 | *dst++ = ((pix2 & 0x40) >> 4) | ((pix1 & 0x40) >> 5) | ((pix0 & 0x40) >> 6); |
| r10613 | r10614 | |
| 1053 | 1044 | * |
| 1054 | 1045 | *************************************/ |
| 1055 | 1046 | |
| 1056 | static void update_foreground( | |
| 1047 | static void update_foreground(running_machine *machine) | |
| 1057 | 1048 | { |
| 1049 | victory_state *state = machine->driver_data<victory_state>(); | |
| 1058 | 1050 | int x, y; |
| 1059 | 1051 | |
| 1060 | 1052 | for (y = 0; y < 256; y++) |
| 1061 | 1053 | { |
| 1062 | UINT8 *dst = &fgbitmap[y * 256]; | |
| 1054 | UINT8 *dst = &state->fgbitmap[y * 256]; | |
| 1063 | 1055 | |
| 1064 | 1056 | /* assemble the RGB bits for each 8-pixel chunk */ |
| 1065 | 1057 | for (x = 0; x < 256; x += 8) |
| 1066 | 1058 | { |
| 1067 | UINT8 g = gram[y * 32 + x / 8]; | |
| 1068 | UINT8 b = bram[y * 32 + x / 8]; | |
| 1069 | UINT8 r = rram[y * 32 + x / 8]; | |
| 1059 | UINT8 g = state->gram[y * 32 + x / 8]; | |
| 1060 | UINT8 b = state->bram[y * 32 + x / 8]; | |
| 1061 | UINT8 r = state->rram[y * 32 + x / 8]; | |
| 1070 | 1062 | |
| 1071 | 1063 | *dst++ = ((r & 0x80) >> 5) | ((b & 0x80) >> 6) | ((g & 0x80) >> 7); |
| 1072 | 1064 | *dst++ = ((r & 0x40) >> 4) | ((b & 0x40) >> 5) | ((g & 0x40) >> 6); |
| r10613 | r10614 | |
| 1083 | 1075 | |
| 1084 | 1076 | static TIMER_CALLBACK( bgcoll_irq_callback ) |
| 1085 | 1077 | { |
| 1086 | bgcollx = param & 0xff; | |
| 1087 | bgcolly = param >> 8; | |
| 1088 | bgcoll = 1; | |
| 1078 | victory_state *state = machine->driver_data<victory_state>(); | |
| 1079 | state->bgcollx = param & 0xff; | |
| 1080 | state->bgcolly = param >> 8; | |
| 1081 | state->bgcoll = 1; | |
| 1089 | 1082 | victory_update_irq(machine); |
| 1090 | 1083 | } |
| 1091 | 1084 | |
| r10613 | r10614 | |
| 1099 | 1092 | |
| 1100 | 1093 | SCREEN_UPDATE( victory ) |
| 1101 | 1094 | { |
| 1102 | int bgcollmask = (video_control & 4) ? 4 : 7; | |
| 1095 | victory_state *state = screen->machine->driver_data<victory_state>(); | |
| 1096 | int bgcollmask = (state->video_control & 4) ? 4 : 7; | |
| 1103 | 1097 | int count = 0; |
| 1104 | 1098 | int x, y; |
| 1105 | 1099 | |
| r10613 | r10614 | |
| 1107 | 1101 | set_palette(screen->machine); |
| 1108 | 1102 | |
| 1109 | 1103 | /* update the foreground & background */ |
| 1110 | update_foreground(); | |
| 1111 | update_background(); | |
| 1104 | update_foreground(screen->machine); | |
| 1105 | update_background(screen->machine); | |
| 1112 | 1106 | |
| 1113 | 1107 | /* blend the bitmaps and do collision detection */ |
| 1114 | 1108 | for (y = 0; y < 256; y++) |
| 1115 | 1109 | { |
| 1116 | 1110 | UINT16 *scanline = BITMAP_ADDR16(bitmap, y, 0); |
| 1117 | UINT8 sy = scrolly + y; | |
| 1118 | UINT8 *fg = &fgbitmap[y * 256]; | |
| 1119 | UINT8 *bg = &bgbitmap[sy * 256]; | |
| 1111 | UINT8 sy = state->scrolly + y; | |
| 1112 | UINT8 *fg = &state->fgbitmap[y * 256]; | |
| 1113 | UINT8 *bg = &state->bgbitmap[sy * 256]; | |
| 1120 | 1114 | |
| 1121 | 1115 | /* do the blending */ |
| 1122 | 1116 | for (x = 0; x < 256; x++) |
| 1123 | 1117 | { |
| 1124 | 1118 | int fpix = *fg++; |
| 1125 | int bpix = bg[(x + scrollx) & 255]; | |
| 1119 | int bpix = bg[(x + state->scrollx) & 255]; | |
| 1126 | 1120 | scanline[x] = bpix | (fpix << 3); |
| 1127 | 1121 | if (fpix && (bpix & bgcollmask) && count++ < 128) |
| 1128 | 1122 | screen->machine->scheduler().timer_set(screen->time_until_pos(y, x), FUNC(bgcoll_irq_callback), x | (y << 8)); |
| r10613 | r10614 | |
|---|---|---|
| 24 | 24 | 6*8, 32*8-1 |
| 25 | 25 | }; |
| 26 | 26 | |
| 27 | //UINT8 *vigilant_paletteram; | |
| 28 | //UINT8 *vigilant_sprite_paletteram; | |
| 29 | 27 | |
| 30 | static int horiz_scroll_low=0; | |
| 31 | static int horiz_scroll_high=0; | |
| 32 | static int rear_horiz_scroll_low=0; | |
| 33 | static int rear_horiz_scroll_high=0; | |
| 34 | static int rear_color=0; | |
| 35 | static int rear_disable; | |
| 36 | ||
| 37 | static int rear_refresh; | |
| 38 | ||
| 39 | static bitmap_t *bg_bitmap; | |
| 40 | ||
| 41 | ||
| 42 | 28 | VIDEO_START( vigilant ) |
| 43 | 29 | { |
| 44 | bg_bitmap = auto_bitmap_alloc(machine,512*4,256,machine->primary_screen->format()); | |
| 30 | vigilant_state *state = machine->driver_data<vigilant_state>(); | |
| 31 | state->bg_bitmap = auto_bitmap_alloc(machine,512*4,256,machine->primary_screen->format()); | |
| 45 | 32 | } |
| 46 | 33 | |
| 47 | 34 | |
| 48 | 35 | VIDEO_RESET( vigilant ) |
| 49 | 36 | { |
| 50 | horiz_scroll_low = 0; | |
| 51 | horiz_scroll_high = 0; | |
| 52 | rear_horiz_scroll_low = 0; | |
| 53 | rear_horiz_scroll_high = 0; | |
| 54 | rear_color = 0; | |
| 55 | rear_disable = 1; | |
| 56 | rear_refresh = 1; | |
| 37 | vigilant_state *state = machine->driver_data<vigilant_state>(); | |
| 38 | state->horiz_scroll_low = 0; | |
| 39 | state->horiz_scroll_high = 0; | |
| 40 | state->rear_horiz_scroll_low = 0; | |
| 41 | state->rear_horiz_scroll_high = 0; | |
| 42 | state->rear_color = 0; | |
| 43 | state->rear_disable = 1; | |
| 44 | state->rear_refresh = 1; | |
| 57 | 45 | } |
| 58 | 46 | |
| 59 | 47 | |
| r10613 | r10614 | |
| 65 | 53 | **************************************************************************/ |
| 66 | 54 | static void update_background(running_machine *machine) |
| 67 | 55 | { |
| 56 | vigilant_state *state = machine->driver_data<vigilant_state>(); | |
| 68 | 57 | int row,col,page; |
| 69 | 58 | int charcode; |
| 70 | 59 | |
| r10613 | r10614 | |
| 78 | 67 | { |
| 79 | 68 | for( col=0; col<512; col+=32 ) |
| 80 | 69 | { |
| 81 | drawgfx_opaque(bg_bitmap, | |
| 70 | drawgfx_opaque(state->bg_bitmap, | |
| 82 | 71 | 0,machine->gfx[2], |
| 83 | 72 | charcode, |
| 84 | 73 | row < 128 ? 0 : 1, |
| r10613 | r10614 | |
| 133 | 122 | **************************************************************************/ |
| 134 | 123 | WRITE8_HANDLER( vigilant_horiz_scroll_w ) |
| 135 | 124 | { |
| 125 | vigilant_state *state = space->machine->driver_data<vigilant_state>(); | |
| 136 | 126 | if (offset==0) |
| 137 | horiz_scroll_low = data; | |
| 127 | state->horiz_scroll_low = data; | |
| 138 | 128 | else |
| 139 | horiz_scroll_high = (data & 0x01) * 256; | |
| 129 | state->horiz_scroll_high = (data & 0x01) * 256; | |
| 140 | 130 | } |
| 141 | 131 | |
| 142 | 132 | /*************************************************************************** |
| r10613 | r10614 | |
| 147 | 137 | ***************************************************************************/ |
| 148 | 138 | WRITE8_HANDLER( vigilant_rear_horiz_scroll_w ) |
| 149 | 139 | { |
| 140 | vigilant_state *state = space->machine->driver_data<vigilant_state>(); | |
| 150 | 141 | if (offset==0) |
| 151 | rear_horiz_scroll_low = data; | |
| 142 | state->rear_horiz_scroll_low = data; | |
| 152 | 143 | else |
| 153 | rear_horiz_scroll_high = (data & 0x07) * 256; | |
| 144 | state->rear_horiz_scroll_high = (data & 0x07) * 256; | |
| 154 | 145 | } |
| 155 | 146 | |
| 156 | 147 | /*************************************************************************** |
| r10613 | r10614 | |
| 170 | 161 | **************************************************************************/ |
| 171 | 162 | WRITE8_HANDLER( vigilant_rear_color_w ) |
| 172 | 163 | { |
| 173 | rear_disable = data & 0x40; | |
| 174 | rear_color = (data & 0x0d); | |
| 164 | vigilant_state *state = space->machine->driver_data<vigilant_state>(); | |
| 165 | state->rear_disable = data & 0x40; | |
| 166 | state->rear_color = (data & 0x0d); | |
| 175 | 167 | } |
| 176 | 168 | |
| 177 | 169 | /*************************************************************************** |
| r10613 | r10614 | |
| 185 | 177 | vigilant_state *state = machine->driver_data<vigilant_state>(); |
| 186 | 178 | UINT8 *videoram = state->videoram; |
| 187 | 179 | int offs; |
| 188 | int scroll = -(horiz_scroll_low + horiz_scroll_high); | |
| 180 | int scroll = -(state->horiz_scroll_low + state->horiz_scroll_high); | |
| 189 | 181 | |
| 190 | 182 | |
| 191 | 183 | for (offs = 0; offs < 0x1000; offs += 2) |
| r10613 | r10614 | |
| 231 | 223 | |
| 232 | 224 | static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) |
| 233 | 225 | { |
| 234 | int scrollx = 0x17a + 16*8 - (rear_horiz_scroll_low + rear_horiz_scroll_high); | |
| 226 | vigilant_state *state = machine->driver_data<vigilant_state>(); | |
| 227 | int scrollx = 0x17a + 16*8 - (state->rear_horiz_scroll_low + state->rear_horiz_scroll_high); | |
| 235 | 228 | |
| 236 | 229 | |
| 237 | if (rear_refresh) | |
| 230 | if (state->rear_refresh) | |
| 238 | 231 | { |
| 239 | 232 | update_background(machine); |
| 240 | rear_refresh=0; | |
| 233 | state->rear_refresh=0; | |
| 241 | 234 | } |
| 242 | 235 | |
| 243 | copyscrollbitmap(bitmap,bg_bitmap,1,&scrollx,0,0,&bottomvisiblearea); | |
| 236 | copyscrollbitmap(bitmap,state->bg_bitmap,1,&scrollx,0,0,&bottomvisiblearea); | |
| 244 | 237 | } |
| 245 | 238 | |
| 246 | 239 | |
| r10613 | r10614 | |
| 307 | 300 | |
| 308 | 301 | SCREEN_UPDATE( vigilant ) |
| 309 | 302 | { |
| 303 | vigilant_state *state = screen->machine->driver_data<vigilant_state>(); | |
| 310 | 304 | int i; |
| 311 | 305 | |
| 312 | 306 | /* copy the background palette */ |
| r10613 | r10614 | |
| 315 | 309 | int r,g,b; |
| 316 | 310 | |
| 317 | 311 | |
| 318 | r = (screen->machine->generic.paletteram.u8[0x400 + 16 * rear_color + i] << 3) & 0xFF; | |
| 319 | g = (screen->machine->generic.paletteram.u8[0x500 + 16 * rear_color + i] << 3) & 0xFF; | |
| 320 | b = (screen->machine->generic.paletteram.u8[0x600 + 16 * rear_color + i] << 3) & 0xFF; | |
| 312 | r = (screen->machine->generic.paletteram.u8[0x400 + 16 * state->rear_color + i] << 3) & 0xFF; | |
| 313 | g = (screen->machine->generic.paletteram.u8[0x500 + 16 * state->rear_color + i] << 3) & 0xFF; | |
| 314 | b = (screen->machine->generic.paletteram.u8[0x600 + 16 * state->rear_color + i] << 3) & 0xFF; | |
| 321 | 315 | |
| 322 | 316 | palette_set_color(screen->machine,512 + i,MAKE_RGB(r,g,b)); |
| 323 | 317 | |
| 324 | r = (screen->machine->generic.paletteram.u8[0x400 + 16 * rear_color + 32 + i] << 3) & 0xFF; | |
| 325 | g = (screen->machine->generic.paletteram.u8[0x500 + 16 * rear_color + 32 + i] << 3) & 0xFF; | |
| 326 | b = (screen->machine->generic.paletteram.u8[0x600 + 16 * rear_color + 32 + i] << 3) & 0xFF; | |
| 318 | r = (screen->machine->generic.paletteram.u8[0x400 + 16 * state->rear_color + 32 + i] << 3) & 0xFF; | |
| 319 | g = (screen->machine->generic.paletteram.u8[0x500 + 16 * state->rear_color + 32 + i] << 3) & 0xFF; | |
| 320 | b = (screen->machine->generic.paletteram.u8[0x600 + 16 * state->rear_color + 32 + i] << 3) & 0xFF; | |
| 327 | 321 | |
| 328 | 322 | palette_set_color(screen->machine,512 + 16 + i,MAKE_RGB(r,g,b)); |
| 329 | 323 | } |
| 330 | 324 | |
| 331 | if (rear_disable) /* opaque foreground */ | |
| 325 | if (state->rear_disable) /* opaque foreground */ | |
| 332 | 326 | { |
| 333 | 327 | draw_foreground(screen->machine,bitmap,cliprect,0,1); |
| 334 | 328 | draw_sprites(screen->machine,bitmap,&bottomvisiblearea); |
| r10613 | r10614 | |
|---|---|---|
| 11 | 11 | #include "includes/nbmj8991.h" |
| 12 | 12 | |
| 13 | 13 | |
| 14 | static int nbmj8991_scrollx, nbmj8991_scrolly; | |
| 15 | static int blitter_destx, blitter_desty; | |
| 16 | static int blitter_sizex, blitter_sizey; | |
| 17 | static int blitter_src_addr; | |
| 18 | static int blitter_direction_x, blitter_direction_y; | |
| 19 | static int nbmj8991_gfxrom; | |
| 20 | static int nbmj8991_dispflag; | |
| 21 | static int nbmj8991_flipscreen; | |
| 22 | static int nbmj8991_clutsel; | |
| 23 | static int nbmj8991_screen_refresh; | |
| 24 | ||
| 25 | static bitmap_t *nbmj8991_tmpbitmap; | |
| 26 | static UINT8 *nbmj8991_videoram; | |
| 27 | static UINT8 *nbmj8991_clut; | |
| 28 | ||
| 29 | ||
| 30 | 14 | static void nbmj8991_vramflip(running_machine *machine); |
| 31 | 15 | static void nbmj8991_gfxdraw(running_machine *machine); |
| 32 | 16 | static void update_pixel(running_machine *machine, int x, int y); |
| r10613 | r10614 | |
| 94 | 78 | ******************************************************************************/ |
| 95 | 79 | WRITE8_HANDLER( nbmj8991_blitter_w ) |
| 96 | 80 | { |
| 81 | nbmj8991_state *state = space->machine->driver_data<nbmj8991_state>(); | |
| 97 | 82 | int gfxlen = space->machine->region("gfx1")->bytes(); |
| 98 | 83 | |
| 99 | 84 | switch (offset) |
| 100 | 85 | { |
| 101 | case 0x00: blitter_src_addr = (blitter_src_addr & 0xff00) | data; break; | |
| 102 | case 0x01: blitter_src_addr = (blitter_src_addr & 0x00ff) | (data << 8); break; | |
| 86 | case 0x00: state->blitter_src_addr = (state->blitter_src_addr & 0xff00) | data; break; | |
| 87 | case 0x01: state->blitter_src_addr = (state->blitter_src_addr & 0x00ff) | (data << 8); break; | |
| 103 | 88 | case 0x02: break; |
| 104 | 89 | case 0x03: break; |
| 105 | case 0x04: blitter_sizex = data; break; | |
| 106 | case 0x05: blitter_sizey = data; | |
| 90 | case 0x04: state->blitter_sizex = data; break; | |
| 91 | case 0x05: state->blitter_sizey = data; | |
| 107 | 92 | /* writing here also starts the blit */ |
| 108 | 93 | nbmj8991_gfxdraw(space->machine); |
| 109 | 94 | break; |
| 110 | case 0x06: blitter_direction_x = (data & 0x01) ? 1 : 0; | |
| 111 | blitter_direction_y = (data & 0x02) ? 1 : 0; | |
| 112 | nbmj8991_flipscreen = (data & 0x04) ? 0 : 1; | |
| 113 | nbmj8991_dispflag = (data & 0x10) ? 0 : 1; | |
| 95 | case 0x06: state->blitter_direction_x = (data & 0x01) ? 1 : 0; | |
| 96 | state->blitter_direction_y = (data & 0x02) ? 1 : 0; | |
| 97 | state->flipscreen = (data & 0x04) ? 0 : 1; | |
| 98 | state->dispflag = (data & 0x10) ? 0 : 1; | |
| 114 | 99 | nbmj8991_vramflip(space->machine); |
| 115 | 100 | break; |
| 116 | 101 | case 0x07: break; |
| 117 | case 0x10: blitter_destx = (blitter_destx & 0xff00) | data; break; | |
| 118 | case 0x20: blitter_desty = (blitter_desty & 0xff00) | data; break; | |
| 119 | case 0x30: nbmj8991_scrollx = (nbmj8991_scrollx & 0xff00) | data; break; | |
| 120 | case 0x40: nbmj8991_scrolly = (nbmj8991_scrolly & 0xff00) | data; break; | |
| 121 | case 0x50: blitter_destx = (blitter_destx & 0x00ff) | ((data & 0x01) << 8); | |
| 122 | blitter_desty = (blitter_desty & 0x00ff) | ((data & 0x02) << 7); | |
| 123 | nbmj8991_scrollx = (nbmj8991_scrollx & 0x00ff) | ((data & 0x04) << 6); | |
| 124 | nbmj8991_scrolly = (nbmj8991_scrolly & 0x00ff) | ((data & 0x08) << 5); | |
| 102 | case 0x10: state->blitter_destx = (state->blitter_destx & 0xff00) | data; break; | |
| 103 | case 0x20: state->blitter_desty = (state->blitter_desty & 0xff00) | data; break; | |
| 104 | case 0x30: state->scrollx = (state->scrollx & 0xff00) | data; break; | |
| 105 | case 0x40: state->scrolly = (state->scrolly & 0xff00) | data; break; | |
| 106 | case 0x50: state->blitter_destx = (state->blitter_destx & 0x00ff) | ((data & 0x01) << 8); | |
| 107 | state->blitter_desty = (state->blitter_desty & 0x00ff) | ((data & 0x02) << 7); | |
| 108 | state->scrollx = (state->scrollx & 0x00ff) | ((data & 0x04) << 6); | |
| 109 | state->scrolly = (state->scrolly & 0x00ff) | ((data & 0x08) << 5); | |
| 125 | 110 | break; |
| 126 | case 0x60: nbmj8991_gfxrom = data; break; | |
| 127 | case 0x70: nbmj8991_clutsel = data; break; | |
| 111 | case 0x60: state->gfxrom = data; break; | |
| 112 | case 0x70: state->clutsel = data; break; | |
| 128 | 113 | } |
| 129 | 114 | |
| 130 | if ((0x20000 * | |
| 115 | if ((0x20000 * state-> | |
| 131 | 116 | { |
| 132 | 117 | #ifdef MAME_DEBUG |
| 133 | 118 | popmessage("GFXROM BANK OVER!!"); |
| 134 | 119 | #endif |
| 135 | | |
| 120 | state-> | |
| 136 | 121 | } |
| 137 | 122 | } |
| 138 | 123 | |
| 139 | 124 | READ8_HANDLER( nbmj8991_clut_r ) |
| 140 | 125 | { |
| 141 | return nbmj8991_clut[offset]; | |
| 126 | nbmj8991_state *state = space->machine->driver_data<nbmj8991_state>(); | |
| 127 | return state->clut[offset]; | |
| 142 | 128 | } |
| 143 | 129 | |
| 144 | 130 | WRITE8_HANDLER( nbmj8991_clut_w ) |
| 145 | 131 | { |
| 146 | nbmj8991_clut[((nbmj8991_clutsel & 0x7f) * 0x10) + (offset & 0x0f)] = data; | |
| 132 | nbmj8991_state *state = space->machine->driver_data<nbmj8991_state>(); | |
| 133 | state->clut[((state->clutsel & 0x7f) * 0x10) + (offset & 0x0f)] = data; | |
| 147 | 134 | } |
| 148 | 135 | |
| 149 | 136 | /****************************************************************************** |
| r10613 | r10614 | |
| 152 | 139 | ******************************************************************************/ |
| 153 | 140 | static void nbmj8991_vramflip(running_machine *machine) |
| 154 | 141 | { |
| 155 | stat | |
| 142 | nbmj8991_state | |
| 156 | 143 | int x, y; |
| 157 | 144 | UINT8 color1, color2; |
| 158 | 145 | int width = machine->primary_screen->width(); |
| 159 | 146 | int height = machine->primary_screen->height(); |
| 160 | 147 | |
| 161 | if ( | |
| 148 | if (state-> | |
| 162 | 149 | |
| 163 | 150 | for (y = 0; y < height / 2; y++) |
| 164 | 151 | { |
| 165 | 152 | for (x = 0; x < width / 2; x++) |
| 166 | 153 | { |
| 167 | 154 | // rotate 180 degrees ( 0, 0) - ( 511, 511) |
| 168 | color1 = nbmj8991_videoram[(y * width) + x]; | |
| 169 | color2 = nbmj8991_videoram[(((height - 1) - y) * width) + (((width / 2) - 1) - x)]; | |
| 170 | nbmj8991_videoram[(y * width) + x] = color2; | |
| 171 | nbmj8991_videoram[(((height - 1) - y) * width) + (((width / 2) - 1) - x)] = color1; | |
| 155 | color1 = state->videoram[(y * width) + x]; | |
| 156 | color2 = state->videoram[(((height - 1) - y) * width) + (((width / 2) - 1) - x)]; | |
| 157 | state->videoram[(y * width) + x] = color2; | |
| 158 | state->videoram[(((height - 1) - y) * width) + (((width / 2) - 1) - x)] = color1; | |
| 172 | 159 | // rotate 180 degrees ( 512, 0) - (1023, 511) |
| 173 | color1 = nbmj8991_videoram[(y * width) + (x + (width / 2))]; | |
| 174 | color2 = nbmj8991_videoram[(((height - 1) - y) * width) + ((((width / 2) - 1) - x) + (width / 2))]; | |
| 175 | nbmj8991_videoram[(y * width) + (x + (width / 2))] = color2; | |
| 176 | nbmj8991_videoram[(((height - 1) - y) * width) + ((((width / 2) - 1) - x) + (width / 2))] = color1; | |
| 160 | color1 = state->videoram[(y * width) + (x + (width / 2))]; | |
| 161 | color2 = state->videoram[(((height - 1) - y) * width) + ((((width / 2) - 1) - x) + (width / 2))]; | |
| 162 | state->videoram[(y * width) + (x + (width / 2))] = color2; | |
| 163 | state->videoram[(((height - 1) - y) * width) + ((((width / 2) - 1) - x) + (width / 2))] = color1; | |
| 177 | 164 | } |
| 178 | 165 | } |
| 179 | 166 | |
| 180 | nbmj8991_flipscreen_old = nbmj8991_flipscreen; | |
| 181 | nbmj8991_screen_refresh = 1; | |
| 167 | state->flipscreen_old = state->flipscreen; | |
| 168 | state->screen_refresh = 1; | |
| 182 | 169 | } |
| 183 | 170 | |
| 184 | 171 | static void update_pixel(running_machine *machine, int x, int y) |
| 185 | 172 | { |
| 186 | UINT8 color = nbmj8991_videoram[(y * machine->primary_screen->width()) + x]; | |
| 187 | *BITMAP_ADDR16(nbmj8991_tmpbitmap, y, x) = color; | |
| 173 | nbmj8991_state *state = machine->driver_data<nbmj8991_state>(); | |
| 174 | UINT8 color = state->videoram[(y * machine->primary_screen->width()) + x]; | |
| 175 | *BITMAP_ADDR16(state->tmpbitmap, y, x) = color; | |
| 188 | 176 | } |
| 189 | 177 | |
| 190 | 178 | static TIMER_CALLBACK( blitter_timer_callback ) |
| r10613 | r10614 | |
| 194 | 182 | |
| 195 | 183 | static void nbmj8991_gfxdraw(running_machine *machine) |
| 196 | 184 | { |
| 185 | nbmj8991_state *state = machine->driver_data<nbmj8991_state>(); | |
| 197 | 186 | UINT8 *GFX = machine->region("gfx1")->base(); |
| 198 | 187 | int width = machine->primary_screen->width(); |
| 199 | 188 | |
| r10613 | r10614 | |
| 208 | 197 | |
| 209 | 198 | nb1413m3_busyctr = 0; |
| 210 | 199 | |
| 211 | if (blitter_direction_x) | |
| 200 | if (state->blitter_direction_x) | |
| 212 | 201 | { |
| 213 | startx = blitter_destx; | |
| 214 | sizex = blitter_sizex ^ 0xff; | |
| 202 | startx = state->blitter_destx; | |
| 203 | sizex = state->blitter_sizex ^ 0xff; | |
| 215 | 204 | skipx = 1; |
| 216 | 205 | } |
| 217 | 206 | else |
| 218 | 207 | { |
| 219 | startx = blitter_destx + blitter_sizex; | |
| 220 | sizex = blitter_sizex; | |
| 208 | startx = state->blitter_destx + state->blitter_sizex; | |
| 209 | sizex = state->blitter_sizex; | |
| 221 | 210 | skipx = -1; |
| 222 | 211 | } |
| 223 | 212 | |
| 224 | if (blitter_direction_y) | |
| 213 | if (state->blitter_direction_y) | |
| 225 | 214 | { |
| 226 | starty = blitter_desty; | |
| 227 | sizey = blitter_sizey ^ 0xff; | |
| 215 | starty = state->blitter_desty; | |
| 216 | sizey = state->blitter_sizey ^ 0xff; | |
| 228 | 217 | skipy = 1; |
| 229 | 218 | } |
| 230 | 219 | else |
| 231 | 220 | { |
| 232 | starty = blitter_desty + blitter_sizey; | |
| 233 | sizey = blitter_sizey; | |
| 221 | starty = state->blitter_desty + state->blitter_sizey; | |
| 222 | sizey = state->blitter_sizey; | |
| 234 | 223 | skipy = -1; |
| 235 | 224 | } |
| 236 | 225 | |
| 237 | 226 | gfxlen = machine->region("gfx1")->bytes(); |
| 238 | gfxaddr = ( | |
| 227 | gfxaddr = (state-> | |
| 239 | 228 | |
| 240 | 229 | for (y = starty, ctry = sizey; ctry >= 0; y += skipy, ctry--) |
| 241 | 230 | { |
| r10613 | r10614 | |
| 255 | 244 | dx2 = (2 * x + 1) & 0x3ff; |
| 256 | 245 | dy = y & 0x1ff; |
| 257 | 246 | |
| 258 | if (! | |
| 247 | if (!state-> | |
| 259 | 248 | { |
| 260 | 249 | dx1 ^= 0x1ff; |
| 261 | 250 | dx2 ^= 0x1ff; |
| 262 | 251 | dy ^= 0x1ff; |
| 263 | 252 | } |
| 264 | 253 | |
| 265 | if (blitter_direction_x) | |
| 254 | if (state->blitter_direction_x) | |
| 266 | 255 | { |
| 267 | 256 | // flip |
| 268 | 257 | color1 = (color & 0x0f) >> 0; |
| r10613 | r10614 | |
| 275 | 264 | color2 = (color & 0x0f) >> 0; |
| 276 | 265 | } |
| 277 | 266 | |
| 278 | color1 = nbmj8991_clut[((nbmj8991_clutsel & 0x7f) * 0x10) + color1]; | |
| 279 | color2 = nbmj8991_clut[((nbmj8991_clutsel & 0x7f) * 0x10) + color2]; | |
| 267 | color1 = state->clut[((state->clutsel & 0x7f) * 0x10) + color1]; | |
| 268 | color2 = state->clut[((state->clutsel & 0x7f) * 0x10) + color2]; | |
| 280 | 269 | |
| 281 | 270 | if (color1 != 0xff) |
| 282 | 271 | { |
| 283 | | |
| 272 | state-> | |
| 284 | 273 | update_pixel(machine, dx1, dy); |
| 285 | 274 | } |
| 286 | 275 | if (color2 != 0xff) |
| 287 | 276 | { |
| 288 | | |
| 277 | state-> | |
| 289 | 278 | update_pixel(machine, dx2, dy); |
| 290 | 279 | } |
| 291 | 280 | |
| r10613 | r10614 | |
| 303 | 292 | ******************************************************************************/ |
| 304 | 293 | VIDEO_START( nbmj8991 ) |
| 305 | 294 | { |
| 295 | nbmj8991_state *state = machine->driver_data<nbmj8991_state>(); | |
| 306 | 296 | int width = machine->primary_screen->width(); |
| 307 | 297 | int height = machine->primary_screen->height(); |
| 308 | 298 | |
| 309 | nbmj8991_tmpbitmap = machine->primary_screen->alloc_compatible_bitmap(); | |
| 310 | nbmj8991_videoram = auto_alloc_array(machine, UINT8, width * height); | |
| 311 | nbmj8991_clut = auto_alloc_array(machine, UINT8, 0x800); | |
| 312 | memset(nbmj8991_videoram, 0x00, (width * height * sizeof(UINT8))); | |
| 299 | state->tmpbitmap = machine->primary_screen->alloc_compatible_bitmap(); | |
| 300 | state->videoram = auto_alloc_array(machine, UINT8, width * height); | |
| 301 | state->clut = auto_alloc_array(machine, UINT8, 0x800); | |
| 302 | memset(state->videoram, 0x00, (width * height * sizeof(UINT8))); | |
| 313 | 303 | } |
| 314 | 304 | |
| 315 | 305 | SCREEN_UPDATE( nbmj8991_type1 ) |
| 316 | 306 | { |
| 307 | nbmj8991_state *state = screen->machine->driver_data<nbmj8991_state>(); | |
| 317 | 308 | int x, y; |
| 318 | 309 | |
| 319 | if ( | |
| 310 | if (state-> | |
| 320 | 311 | { |
| 321 | 312 | int width = screen->machine->primary_screen->width(); |
| 322 | 313 | int height = screen->machine->primary_screen->height(); |
| 323 | 314 | |
| 324 | | |
| 315 | state-> | |
| 325 | 316 | |
| 326 | 317 | for (y = 0; y < height; y++) |
| 327 | 318 | for (x = 0; x < width; x++) |
| 328 | 319 | update_pixel(screen->machine, x, y); |
| 329 | 320 | } |
| 330 | 321 | |
| 331 | if ( | |
| 322 | if (state-> | |
| 332 | 323 | { |
| 333 | | |
| 324 | | |
| 334 | 325 | |
| 335 | if ( | |
| 326 | if (state-> | |
| 336 | 327 | { |
| 337 | scrollx = (((-nbmj8991_scrollx) + 0x000) & 0x1ff) * 2; | |
| 338 | scrolly = ((-nbmj8991_scrolly) - 0x00f) & 0x1ff; | |
| 328 | scrollx = (((-state->scrollx) + 0x000) & 0x1ff) * 2; | |
| 329 | scrolly = ((-state->scrolly) - 0x00f) & 0x1ff; | |
| 339 | 330 | } |
| 340 | 331 | else |
| 341 | 332 | { |
| 342 | scrollx = (((-nbmj8991_scrollx) - 0x100) & 0x1ff) * 2; | |
| 343 | scrolly = (( nbmj8991_scrolly) + 0x0f1) & 0x1ff; | |
| 333 | scrollx = (((-state->scrollx) - 0x100) & 0x1ff) * 2; | |
| 334 | scrolly = (( state->scrolly) + 0x0f1) & 0x1ff; | |
| 344 | 335 | } |
| 345 | 336 | |
| 346 | copyscrollbitmap(bitmap, | |
| 337 | copyscrollbitmap(bitmap, state-> | |
| 347 | 338 | } |
| 348 | 339 | else |
| 349 | 340 | bitmap_fill(bitmap, 0, 0); |
| r10613 | r10614 | |
| 353 | 344 | |
| 354 | 345 | SCREEN_UPDATE( nbmj8991_type2 ) |
| 355 | 346 | { |
| 347 | nbmj8991_state *state = screen->machine->driver_data<nbmj8991_state>(); | |
| 356 | 348 | int x, y; |
| 357 | 349 | |
| 358 | if ( | |
| 350 | if (state-> | |
| 359 | 351 | { |
| 360 | 352 | int width = screen->width(); |
| 361 | 353 | int height = screen->height(); |
| 362 | 354 | |
| 363 | | |
| 355 | state-> | |
| 364 | 356 | |
| 365 | 357 | for (y = 0; y < height; y++) |
| 366 | 358 | for (x = 0; x < width; x++) |
| r10613 | r10614 | |
| 369 | 361 | |
| 370 | 362 | if (nb1413m3_inputport & 0x20) |
| 371 | 363 | { |
| 372 | | |
| 364 | | |
| 373 | 365 | |
| 374 | if ( | |
| 366 | if (state-> | |
| 375 | 367 | { |
| 376 | scrollx = (((-nbmj8991_scrollx) + 0x000) & 0x1ff) * 2; | |
| 377 | scrolly = ((-nbmj8991_scrolly) - 0x00f) & 0x1ff; | |
| 368 | scrollx = (((-state->scrollx) + 0x000) & 0x1ff) * 2; | |
| 369 | scrolly = ((-state->scrolly) - 0x00f) & 0x1ff; | |
| 378 | 370 | } |
| 379 | 371 | else |
| 380 | 372 | { |
| 381 | scrollx = (((-nbmj8991_scrollx) - 0x100) & 0x1ff) * 2; | |
| 382 | scrolly = (( nbmj8991_scrolly) + 0x0f1) & 0x1ff; | |
| 373 | scrollx = (((-state->scrollx) - 0x100) & 0x1ff) * 2; | |
| 374 | scrolly = (( state->scrolly) + 0x0f1) & 0x1ff; | |
| 383 | 375 | } |
| 384 | 376 | |
| 385 | copyscrollbitmap(bitmap, | |
| 377 | copyscrollbitmap(bitmap, state-> | |
| 386 | 378 | } |
| 387 | 379 | else |
| 388 | 380 | bitmap_fill(bitmap, 0, 0); |
| r10613 | r10614 | |
|---|---|---|
| 26 | 26 | #define SPRITE_COUNT (0x28) |
| 27 | 27 | |
| 28 | 28 | |
| 29 | /* globals */ | |
| 30 | UINT8 *exidy440_scanline; | |
| 31 | UINT8 *exidy440_imageram; | |
| 32 | UINT8 exidy440_firq_vblank; | |
| 33 | UINT8 exidy440_firq_beam; | |
| 34 | UINT8 *topsecex_yscroll; | |
| 35 | ||
| 36 | /* local allocated storage */ | |
| 37 | static UINT8 exidy440_latched_x; | |
| 38 | static UINT8 *local_videoram; | |
| 39 | static UINT8 *local_paletteram; | |
| 40 | ||
| 41 | /* local variables */ | |
| 42 | static UINT8 firq_enable; | |
| 43 | static UINT8 firq_select; | |
| 44 | static UINT8 palettebank_io; | |
| 45 | static UINT8 palettebank_vis; | |
| 46 | ||
| 47 | 29 | /* function prototypes */ |
| 48 | 30 | static void exidy440_update_firq(running_machine *machine); |
| 49 | 31 | |
| r10613 | r10614 | |
| 57 | 39 | |
| 58 | 40 | static VIDEO_START( exidy440 ) |
| 59 | 41 | { |
| 42 | exidy440_state *state = machine->driver_data<exidy440_state>(); | |
| 60 | 43 | /* reset the system */ |
| 61 | firq_enable = 0; | |
| 62 | firq_select = 0; | |
| 63 | palettebank_io = 0; | |
| 64 | palettebank_vis = 0; | |
| 65 | exidy440_firq_vblank = 0; | |
| 66 | exidy440_firq_beam = 0; | |
| 44 | state->firq_enable = 0; | |
| 45 | state->firq_select = 0; | |
| 46 | state->palettebank_io = 0; | |
| 47 | state->palettebank_vis = 0; | |
| 48 | state->firq_vblank = 0; | |
| 49 | state->firq_beam = 0; | |
| 67 | 50 | |
| 68 | 51 | /* allocate a buffer for VRAM */ |
| 69 | local_videoram = auto_alloc_array(machine, UINT8, 256 * 256 * 2); | |
| 70 | memset(local_videoram, 0, 256 * 256 * 2); | |
| 52 | state->local_videoram = auto_alloc_array(machine, UINT8, 256 * 256 * 2); | |
| 53 | memset(state->local_videoram, 0, 256 * 256 * 2); | |
| 71 | 54 | |
| 72 | 55 | /* allocate a buffer for palette RAM */ |
| 73 | local_paletteram = auto_alloc_array(machine, UINT8, 512 * 2); | |
| 74 | memset(local_paletteram, 0, 512 * 2); | |
| 56 | state->local_paletteram = auto_alloc_array(machine, UINT8, 512 * 2); | |
| 57 | memset(state->local_paletteram, 0, 512 * 2); | |
| 75 | 58 | } |
| 76 | 59 | |
| 77 | 60 | |
| 78 | 61 | static VIDEO_START( topsecex ) |
| 79 | 62 | { |
| 63 | exidy440_state *state = machine->driver_data<exidy440_state>(); | |
| 80 | 64 | VIDEO_START_CALL(exidy440); |
| 81 | 65 | |
| 82 | *topsecex_yscroll = 0; | |
| 66 | *state->topsecex_yscroll = 0; | |
| 83 | 67 | } |
| 84 | 68 | |
| 85 | 69 | |
| r10613 | r10614 | |
| 92 | 76 | |
| 93 | 77 | READ8_HANDLER( exidy440_videoram_r ) |
| 94 | 78 | { |
| 95 | UINT8 *base = &local_videoram[(*exidy440_scanline * 256 + offset) * 2]; | |
| 79 | exidy440_state *state = space->machine->driver_data<exidy440_state>(); | |
| 80 | UINT8 *base = &state->local_videoram[(*state->scanline * 256 + offset) * 2]; | |
| 96 | 81 | |
| 97 | 82 | /* combine the two pixel values into one byte */ |
| 98 | 83 | return (base[0] << 4) | base[1]; |
| r10613 | r10614 | |
| 101 | 86 | |
| 102 | 87 | WRITE8_HANDLER( exidy440_videoram_w ) |
| 103 | 88 | { |
| 104 | UINT8 *base = &local_videoram[(*exidy440_scanline * 256 + offset) * 2]; | |
| 89 | exidy440_state *state = space->machine->driver_data<exidy440_state>(); | |
| 90 | UINT8 *base = &state->local_videoram[(*state->scanline * 256 + offset) * 2]; | |
| 105 | 91 | |
| 106 | 92 | /* expand the two pixel values into two bytes */ |
| 107 | 93 | base[0] = (data >> 4) & 15; |
| r10613 | r10614 | |
| 118 | 104 | |
| 119 | 105 | READ8_HANDLER( exidy440_paletteram_r ) |
| 120 | 106 | { |
| 121 | return local_paletteram[palettebank_io * 512 + offset]; | |
| 107 | exidy440_state *state = space->machine->driver_data<exidy440_state>(); | |
| 108 | return state->local_paletteram[state->palettebank_io * 512 + offset]; | |
| 122 | 109 | } |
| 123 | 110 | |
| 124 | 111 | |
| 125 | 112 | WRITE8_HANDLER( exidy440_paletteram_w ) |
| 126 | 113 | { |
| 114 | exidy440_state *state = space->machine->driver_data<exidy440_state>(); | |
| 127 | 115 | /* update palette ram in the I/O bank */ |
| 128 | local_paletteram[palettebank_io * 512 + offset] = data; | |
| 116 | state->local_paletteram[state->palettebank_io * 512 + offset] = data; | |
| 129 | 117 | |
| 130 | 118 | /* if we're modifying the active palette, change the color immediately */ |
| 131 | if (palettebank_io == palettebank_vis) | |
| 119 | if (state->palettebank_io == state->palettebank_vis) | |
| 132 | 120 | { |
| 133 | 121 | int word; |
| 134 | 122 | |
| 135 | 123 | /* combine two bytes into a word */ |
| 136 | offset = palettebank_vis * 512 + (offset & 0x1fe); | |
| 137 | word = (local_paletteram[offset] << 8) + local_paletteram[offset + 1]; | |
| 124 | offset = state->palettebank_vis * 512 + (offset & 0x1fe); | |
| 125 | word = (state->local_paletteram[offset] << 8) + state->local_paletteram[offset + 1]; | |
| 138 | 126 | |
| 139 | 127 | /* extract the 5-5-5 RGB colors */ |
| 140 | 128 | palette_set_color_rgb(space->machine, offset / 2, pal5bit(word >> 10), pal5bit(word >> 5), pal5bit(word >> 0)); |
| r10613 | r10614 | |
| 151 | 139 | |
| 152 | 140 | READ8_HANDLER( exidy440_horizontal_pos_r ) |
| 153 | 141 | { |
| 142 | exidy440_state *state = space->machine->driver_data<exidy440_state>(); | |
| 154 | 143 | /* clear the FIRQ on a read here */ |
| 155 | e | |
| 144 | state-> | |
| 156 | 145 | exidy440_update_firq(space->machine); |
| 157 | 146 | |
| 158 | 147 | /* according to the schems, this value is only latched on an FIRQ |
| 159 | 148 | * caused by collision or beam */ |
| 160 | return e | |
| 149 | return state-> | |
| 161 | 150 | } |
| 162 | 151 | |
| 163 | 152 | |
| r10613 | r10614 | |
| 197 | 186 | |
| 198 | 187 | WRITE8_HANDLER( exidy440_control_w ) |
| 199 | 188 | { |
| 200 | int oldvis = palettebank_vis; | |
| 189 | exidy440_state *state = space->machine->driver_data<exidy440_state>(); | |
| 190 | int oldvis = state->palettebank_vis; | |
| 201 | 191 | |
| 202 | 192 | /* extract the various bits */ |
| 203 | 193 | exidy440_bank_select(space->machine, data >> 4); |
| 204 | firq_enable = (data >> 3) & 1; | |
| 205 | firq_select = (data >> 2) & 1; | |
| 206 | palettebank_io = (data >> 1) & 1; | |
| 207 | palettebank_vis = data & 1; | |
| 194 | state->firq_enable = (data >> 3) & 1; | |
| 195 | state->firq_select = (data >> 2) & 1; | |
| 196 | state->palettebank_io = (data >> 1) & 1; | |
| 197 | state->palettebank_vis = data & 1; | |
| 208 | 198 | |
| 209 | 199 | /* update the FIRQ in case we enabled something */ |
| 210 | 200 | exidy440_update_firq(space->machine); |
| 211 | 201 | |
| 212 | 202 | /* if we're swapping palettes, change all the colors */ |
| 213 | if (oldvis != palettebank_vis) | |
| 203 | if (oldvis != state->palettebank_vis) | |
| 214 | 204 | { |
| 215 | 205 | int i; |
| 216 | 206 | |
| 217 | 207 | /* pick colors from the visible bank */ |
| 218 | offset = palettebank_vis * 512; | |
| 208 | offset = state->palettebank_vis * 512; | |
| 219 | 209 | for (i = 0; i < 256; i++, offset += 2) |
| 220 | 210 | { |
| 221 | 211 | /* extract a word and the 5-5-5 RGB components */ |
| 222 | int word = (local_paletteram[offset] << 8) + local_paletteram[offset + 1]; | |
| 212 | int word = (state->local_paletteram[offset] << 8) + state->local_paletteram[offset + 1]; | |
| 223 | 213 | palette_set_color_rgb(space->machine, i, pal5bit(word >> 10), pal5bit(word >> 5), pal5bit(word >> 0)); |
| 224 | 214 | } |
| 225 | 215 | } |
| r10613 | r10614 | |
| 228 | 218 | |
| 229 | 219 | WRITE8_HANDLER( exidy440_interrupt_clear_w ) |
| 230 | 220 | { |
| 221 | exidy440_state *state = space->machine->driver_data<exidy440_state>(); | |
| 231 | 222 | /* clear the VBLANK FIRQ on a write here */ |
| 232 | e | |
| 223 | state-> | |
| 233 | 224 | exidy440_update_firq(space->machine); |
| 234 | 225 | } |
| 235 | 226 | |
| r10613 | r10614 | |
| 243 | 234 | |
| 244 | 235 | static void exidy440_update_firq(running_machine *machine) |
| 245 | 236 | { |
| 246 | if (exidy440_firq_vblank || (firq_enable && exidy440_firq_beam)) | |
| 237 | exidy440_state *state = machine->driver_data<exidy440_state>(); | |
| 238 | if (state->firq_vblank || (state->firq_enable && state->firq_beam)) | |
| 247 | 239 | cputag_set_input_line(machine, "maincpu", 1, ASSERT_LINE); |
| 248 | 240 | else |
| 249 | 241 | cputag_set_input_line(machine, "maincpu", 1, CLEAR_LINE); |
| r10613 | r10614 | |
| 252 | 244 | |
| 253 | 245 | INTERRUPT_GEN( exidy440_vblank_interrupt ) |
| 254 | 246 | { |
| 247 | exidy440_state *state = device->machine->driver_data<exidy440_state>(); | |
| 255 | 248 | /* set the FIRQ line on a VBLANK */ |
| 256 | e | |
| 249 | state-> | |
| 257 | 250 | exidy440_update_firq(device->machine); |
| 258 | 251 | } |
| 259 | 252 | |
| r10613 | r10614 | |
| 267 | 260 | |
| 268 | 261 | static TIMER_CALLBACK( beam_firq_callback ) |
| 269 | 262 | { |
| 263 | exidy440_state *state = machine->driver_data<exidy440_state>(); | |
| 270 | 264 | /* generate the interrupt, if we're selected */ |
| 271 | if (firq_select && firq_enable) | |
| 265 | if (state->firq_select && state->firq_enable) | |
| 272 | 266 | { |
| 273 | e | |
| 267 | state-> | |
| 274 | 268 | exidy440_update_firq(machine); |
| 275 | 269 | } |
| 276 | 270 | |
| r10613 | r10614 | |
| 278 | 272 | param = (param + 1) / 2; |
| 279 | 273 | |
| 280 | 274 | /* latch the x value; this convolution comes from the read routine */ |
| 281 | e | |
| 275 | state-> | |
| 282 | 276 | } |
| 283 | 277 | |
| 284 | 278 | |
| 285 | 279 | static TIMER_CALLBACK( collide_firq_callback ) |
| 286 | 280 | { |
| 281 | exidy440_state *state = machine->driver_data<exidy440_state>(); | |
| 287 | 282 | /* generate the interrupt, if we're selected */ |
| 288 | if (!firq_select && firq_enable) | |
| 283 | if (!state->firq_select && state->firq_enable) | |
| 289 | 284 | { |
| 290 | e | |
| 285 | state-> | |
| 291 | 286 | exidy440_update_firq(machine); |
| 292 | 287 | } |
| 293 | 288 | |
| r10613 | r10614 | |
| 295 | 290 | param = (param + 1) / 2; |
| 296 | 291 | |
| 297 | 292 | /* latch the x value; this convolution comes from the read routine */ |
| 298 | e | |
| 293 | state-> | |
| 299 | 294 | } |
| 300 | 295 | |
| 301 | 296 | |
| r10613 | r10614 | |
| 309 | 304 | static void draw_sprites(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, |
| 310 | 305 | int scroll_offset, int check_collision) |
| 311 | 306 | { |
| 307 | exidy440_state *state = screen.machine->driver_data<exidy440_state>(); | |
| 312 | 308 | int i; |
| 313 | 309 | |
| 314 | 310 | /* get a pointer to the palette to look for collision flags */ |
| 315 | UINT8 *palette = &local_paletteram[palettebank_vis * 512]; | |
| 311 | UINT8 *palette = &state->local_paletteram[state->palettebank_vis * 512]; | |
| 316 | 312 | int count = 0; |
| 317 | 313 | |
| 318 | 314 | /* draw the sprite images, checking for collisions along the way */ |
| r10613 | r10614 | |
| 331 | 327 | continue; |
| 332 | 328 | |
| 333 | 329 | /* get a pointer to the source image */ |
| 334 | src = &e | |
| 330 | src = &state-> | |
| 335 | 331 | |
| 336 | 332 | /* account for large positive offsets meaning small negative values */ |
| 337 | 333 | if (xoffs >= 0x1ff - 16) |
| r10613 | r10614 | |
| 354 | 350 | /* only draw scanlines that are in this cliprect */ |
| 355 | 351 | if (yoffs <= cliprect->max_y) |
| 356 | 352 | { |
| 357 | UINT8 *old = &local_videoram[sy * 512 + xoffs]; | |
| 353 | UINT8 *old = &state->local_videoram[sy * 512 + xoffs]; | |
| 358 | 354 | int currx = xoffs; |
| 359 | 355 | |
| 360 | 356 | /* loop over x */ |
| r10613 | r10614 | |
| 409 | 405 | static void update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, |
| 410 | 406 | int scroll_offset, int check_collision) |
| 411 | 407 | { |
| 408 | exidy440_state *state = screen.machine->driver_data<exidy440_state>(); | |
| 412 | 409 | int y, sy; |
| 413 | 410 | |
| 414 | 411 | /* draw any dirty scanlines from the VRAM directly */ |
| r10613 | r10614 | |
| 420 | 417 | sy -= (VBSTART - VBEND); |
| 421 | 418 | |
| 422 | 419 | /* draw line */ |
| 423 | draw_scanline8(bitmap, 0, y, (HBSTART - HBEND), &local_videoram[sy * 512], NULL); | |
| 420 | draw_scanline8(bitmap, 0, y, (HBSTART - HBEND), &state->local_videoram[sy * 512], NULL); | |
| 424 | 421 | } |
| 425 | 422 | |
| 426 | 423 | /* draw the sprites */ |
| r10613 | r10614 | |
| 469 | 466 | |
| 470 | 467 | static SCREEN_UPDATE( topsecex ) |
| 471 | 468 | { |
| 469 | exidy440_state *state = screen->machine->driver_data<exidy440_state>(); | |
| 472 | 470 | /* redraw the screen */ |
| 473 | update_screen(*screen, bitmap, cliprect, *topsecex_yscroll, FALSE); | |
| 471 | update_screen(*screen, bitmap, cliprect, *state->topsecex_yscroll, FALSE); | |
| 474 | 472 | |
| 475 | 473 | return 0; |
| 476 | 474 | } |
| r10613 | r10614 | |
|---|---|---|
| 9 | 9 | #include "emu.h" |
| 10 | 10 | #include "includes/pingpong.h" |
| 11 | 11 | |
| 12 | static tilemap_t *bg_tilemap; | |
| 13 | UINT8 *pingpong_videoram; | |
| 14 | UINT8 *pingpong_colorram; | |
| 15 | 12 | |
| 16 | 13 | |
| 17 | 14 | /* This is strange; it's unlikely that the sprites actually have a hardware */ |
| r10613 | r10614 | |
| 98 | 95 | |
| 99 | 96 | WRITE8_HANDLER( pingpong_videoram_w ) |
| 100 | 97 | { |
| 101 | pingpong_videoram[offset] = data; | |
| 102 | tilemap_mark_tile_dirty(bg_tilemap, offset); | |
| 98 | pingpong_state *state = space->machine->driver_data<pingpong_state>(); | |
| 99 | state->videoram[offset] = data; | |
| 100 | tilemap_mark_tile_dirty(state->bg_tilemap, offset); | |
| 103 | 101 | } |
| 104 | 102 | |
| 105 | 103 | WRITE8_HANDLER( pingpong_colorram_w ) |
| 106 | 104 | { |
| 107 | pingpong_colorram[offset] = data; | |
| 108 | tilemap_mark_tile_dirty(bg_tilemap, offset); | |
| 105 | pingpong_state *state = space->machine->driver_data<pingpong_state>(); | |
| 106 | state->colorram[offset] = data; | |
| 107 | tilemap_mark_tile_dirty(state->bg_tilemap, offset); | |
| 109 | 108 | } |
| 110 | 109 | |
| 111 | 110 | static TILE_GET_INFO( get_bg_tile_info ) |
| 112 | 111 | { |
| 113 | int attr = pingpong_colorram[tile_index]; | |
| 114 | int code = pingpong_videoram[tile_index] + ((attr & 0x20) << 3); | |
| 112 | pingpong_state *state = machine->driver_data<pingpong_state>(); | |
| 113 | int attr = state->colorram[tile_index]; | |
| 114 | int code = state->videoram[tile_index] + ((attr & 0x20) << 3); | |
| 115 | 115 | int color = attr & 0x1f; |
| 116 | 116 | int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0); |
| 117 | 117 | |
| r10613 | r10614 | |
| 120 | 120 | |
| 121 | 121 | VIDEO_START( pingpong ) |
| 122 | 122 | { |
| 123 | bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 123 | pingpong_state *state = machine->driver_data<pingpong_state>(); | |
| 124 | state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 124 | 125 | } |
| 125 | 126 | |
| 126 | 127 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) |
| r10613 | r10614 | |
| 152 | 153 | |
| 153 | 154 | SCREEN_UPDATE( pingpong ) |
| 154 | 155 | { |
| 155 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); | |
| 156 | pingpong_state *state = screen->machine->driver_data<pingpong_state>(); | |
| 157 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 156 | 158 | draw_sprites(screen->machine, bitmap, cliprect); |
| 157 | 159 | return 0; |
| 158 | 160 | } |
| r10613 | r10614 | |
|---|---|---|
| 3 | 3 | #include "emu.h" |
| 4 | 4 | #include "includes/pokechmp.h" |
| 5 | 5 | |
| 6 | static tilemap_t *bg_tilemap; | |
| 7 | 6 | |
| 8 | 7 | WRITE8_HANDLER( pokechmp_videoram_w ) |
| 9 | 8 | { |
| 10 | 9 | pokechmp_state *state = space->machine->driver_data<pokechmp_state>(); |
| 11 | 10 | UINT8 *videoram = state->videoram; |
| 12 | 11 | videoram[offset] = data; |
| 13 | tilemap_mark_tile_dirty(bg_tilemap, offset / 2); | |
| 12 | tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2); | |
| 14 | 13 | } |
| 15 | 14 | |
| 16 | 15 | WRITE8_HANDLER( pokechmp_flipscreen_w ) |
| r10613 | r10614 | |
| 34 | 33 | |
| 35 | 34 | VIDEO_START( pokechmp ) |
| 36 | 35 | { |
| 37 | bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, | |
| 36 | pokechmp_state *state = machine->driver_data<pokechmp_state>(); | |
| 37 | state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, | |
| 38 | 38 | 8, 8, 32, 32); |
| 39 | 39 | } |
| 40 | 40 | |
| r10613 | r10614 | |
| 73 | 73 | |
| 74 | 74 | SCREEN_UPDATE( pokechmp ) |
| 75 | 75 | { |
| 76 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); | |
| 76 | pokechmp_state *state = screen->machine->driver_data<pokechmp_state>(); | |
| 77 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 77 | 78 | draw_sprites(screen->machine, bitmap, cliprect); |
| 78 | 79 | return 0; |
| 79 | 80 | } |
| r10613 | r10614 | |
|---|---|---|
| 201 | 201 | MCFG_SCREEN_VISIBLE_AREA(0, 255, 8, 247) |
| 202 | 202 | MCFG_SCREEN_REFRESH_RATE(60) |
| 203 | 203 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) |
| 204 | MCFG_SCREEN_UPDATE(crgolf) | |
| 204 | MCFG_SCREEN_UPDATE(crgolf) | |
| 205 | 205 | MACHINE_CONFIG_END |
| r10613 | r10614 | |
|---|---|---|
| 11 | 11 | #include "includes/nbmj8900.h" |
| 12 | 12 | |
| 13 | 13 | |
| 14 | static int nbmj8900_scrolly; | |
| 15 | static int blitter_destx, blitter_desty; | |
| 16 | static int blitter_sizex, blitter_sizey; | |
| 17 | static int blitter_src_addr; | |
| 18 | static int blitter_direction_x, blitter_direction_y; | |
| 19 | static int nbmj8900_vram; | |
| 20 | static int nbmj8900_gfxrom; | |
| 21 | static int nbmj8900_dispflag; | |
| 22 | static int nbmj8900_flipscreen; | |
| 23 | static int nbmj8900_clutsel; | |
| 24 | static int nbmj8900_screen_refresh; | |
| 25 | static int gfxdraw_mode; | |
| 26 | ||
| 27 | static int screen_height; | |
| 28 | static int screen_width; | |
| 29 | ||
| 30 | static bitmap_t *nbmj8900_tmpbitmap0, *nbmj8900_tmpbitmap1; | |
| 31 | static UINT8 *nbmj8900_videoram0, *nbmj8900_videoram1; | |
| 32 | static UINT8 *nbmj8900_palette; | |
| 33 | static UINT8 *nbmj8900_clut; | |
| 34 | ||
| 35 | ||
| 36 | 14 | static void nbmj8900_vramflip(running_machine *machine, int vram); |
| 37 | 15 | static void nbmj8900_gfxdraw(running_machine *machine); |
| 38 | 16 | |
| r10613 | r10614 | |
| 43 | 21 | ******************************************************************************/ |
| 44 | 22 | READ8_HANDLER( nbmj8900_palette_type1_r ) |
| 45 | 23 | { |
| 46 | return nbmj8900_palette[offset]; | |
| 24 | nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>(); | |
| 25 | return state->palette[offset]; | |
| 47 | 26 | } |
| 48 | 27 | |
| 49 | 28 | WRITE8_HANDLER( nbmj8900_palette_type1_w ) |
| 50 | 29 | { |
| 30 | nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>(); | |
| 51 | 31 | int r, g, b; |
| 52 | 32 | |
| 53 | | |
| 33 | state-> | |
| 54 | 34 | |
| 55 | 35 | if (!(offset & 1)) return; |
| 56 | 36 | |
| 57 | 37 | offset &= 0x1fe; |
| 58 | 38 | |
| 59 | r = ((nbmj8900_palette[offset + 0] & 0x0f) >> 0); | |
| 60 | g = ((nbmj8900_palette[offset + 1] & 0xf0) >> 4); | |
| 61 | b = ((nbmj8900_palette[offset + 1] & 0x0f) >> 0); | |
| 39 | r = ((state->palette[offset + 0] & 0x0f) >> 0); | |
| 40 | g = ((state->palette[offset + 1] & 0xf0) >> 4); | |
| 41 | b = ((state->palette[offset + 1] & 0x0f) >> 0); | |
| 62 | 42 | |
| 63 | 43 | palette_set_color_rgb(space->machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b)); |
| 64 | 44 | } |
| r10613 | r10614 | |
| 66 | 46 | #ifdef UNUSED_FUNCTION |
| 67 | 47 | READ8_HANDLER( nbmj8900_palette_type2_r ) |
| 68 | 48 | { |
| 69 | return nbmj8900_palette[offset]; | |
| 49 | nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>(); | |
| 50 | return state->palette[offset]; | |
| 70 | 51 | } |
| 71 | 52 | |
| 72 | 53 | WRITE8_HANDLER( nbmj8900_palette_type2_w ) |
| 73 | 54 | { |
| 55 | nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>(); | |
| 74 | 56 | int r, g, b; |
| 75 | 57 | |
| 76 | | |
| 58 | state-> | |
| 77 | 59 | |
| 78 | 60 | if (!(offset & 0x100)) return; |
| 79 | 61 | |
| 80 | 62 | offset &= 0x0ff; |
| 81 | 63 | |
| 82 | r = ((nbmj8900_palette[offset + 0x000] & 0x0f) >> 0); | |
| 83 | g = ((nbmj8900_palette[offset + 0x000] & 0xf0) >> 4); | |
| 84 | b = ((nbmj8900_palette[offset + 0x100] & 0x0f) >> 0); | |
| 64 | r = ((state->palette[offset + 0x000] & 0x0f) >> 0); | |
| 65 | g = ((state->palette[offset + 0x000] & 0xf0) >> 4); | |
| 66 | b = ((state->palette[offset + 0x100] & 0x0f) >> 0); | |
| 85 | 67 | |
| 86 | 68 | palette_set_color_rgb(space->machine, (offset & 0x0ff), pal4bit(r), pal4bit(g), pal4bit(b)); |
| 87 | 69 | } |
| 88 | 70 | |
| 89 | 71 | READ8_HANDLER( nbmj8900_palette_type3_r ) |
| 90 | 72 | { |
| 91 | return nbmj8900_palette[offset]; | |
| 73 | nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>(); | |
| 74 | return state->palette[offset]; | |
| 92 | 75 | } |
| 93 | 76 | |
| 94 | 77 | WRITE8_HANDLER( nbmj8900_palette_type3_w ) |
| 95 | 78 | { |
| 79 | nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>(); | |
| 96 | 80 | int r, g, b; |
| 97 | 81 | |
| 98 | | |
| 82 | state-> | |
| 99 | 83 | |
| 100 | 84 | if (!(offset & 1)) return; |
| 101 | 85 | |
| 102 | 86 | offset &= 0x1fe; |
| 103 | 87 | |
| 104 | r = ((nbmj8900_palette[offset + 1] & 0x0f) >> 0); | |
| 105 | g = ((nbmj8900_palette[offset + 0] & 0xf0) >> 4); | |
| 106 | b = ((nbmj8900_palette[offset + 0] & 0x0f) >> 0); | |
| 88 | r = ((state->palette[offset + 1] & 0x0f) >> 0); | |
| 89 | g = ((state->palette[offset + 0] & 0xf0) >> 4); | |
| 90 | b = ((state->palette[offset + 0] & 0x0f) >> 0); | |
| 107 | 91 | |
| 108 | 92 | palette_set_color_rgb(space->machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b)); |
| 109 | 93 | } |
| r10613 | r10614 | |
| 111 | 95 | |
| 112 | 96 | WRITE8_HANDLER( nbmj8900_clutsel_w ) |
| 113 | 97 | { |
| 114 | nbmj8900_clutsel = data; | |
| 98 | nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>(); | |
| 99 | state->clutsel = data; | |
| 115 | 100 | } |
| 116 | 101 | |
| 117 | 102 | READ8_HANDLER( nbmj8900_clut_r ) |
| 118 | 103 | { |
| 119 | return nbmj8900_clut[offset]; | |
| 104 | nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>(); | |
| 105 | return state->clut[offset]; | |
| 120 | 106 | } |
| 121 | 107 | |
| 122 | 108 | WRITE8_HANDLER( nbmj8900_clut_w ) |
| 123 | 109 | { |
| 124 | nbmj8900_clut[((nbmj8900_clutsel & 0x7f) * 0x10) + (offset & 0x0f)] = data; | |
| 110 | nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>(); | |
| 111 | state->clut[((state->clutsel & 0x7f) * 0x10) + (offset & 0x0f)] = data; | |
| 125 | 112 | } |
| 126 | 113 | |
| 127 | 114 | /****************************************************************************** |
| r10613 | r10614 | |
| 130 | 117 | ******************************************************************************/ |
| 131 | 118 | WRITE8_HANDLER( nbmj8900_blitter_w ) |
| 132 | 119 | { |
| 120 | nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>(); | |
| 133 | 121 | switch (offset) |
| 134 | 122 | { |
| 135 | case 0x00: blitter_src_addr = (blitter_src_addr & 0xff00) | data; break; | |
| 136 | case 0x01: blitter_src_addr = (blitter_src_addr & 0x00ff) | (data << 8); break; | |
| 137 | case 0x02: blitter_destx = data; break; | |
| 138 | case 0x03: blitter_desty = data; break; | |
| 139 | case 0x04: blitter_sizex = data; break; | |
| 140 | case 0x05: blitter_sizey = data; | |
| 123 | case 0x00: state->blitter_src_addr = (state->blitter_src_addr & 0xff00) | data; break; | |
| 124 | case 0x01: state->blitter_src_addr = (state->blitter_src_addr & 0x00ff) | (data << 8); break; | |
| 125 | case 0x02: state->blitter_destx = data; break; | |
| 126 | case 0x03: state->blitter_desty = data; break; | |
| 127 | case 0x04: state->blitter_sizex = data; break; | |
| 128 | case 0x05: state->blitter_sizey = data; | |
| 141 | 129 | /* writing here also starts the blit */ |
| 142 | 130 | nbmj8900_gfxdraw(space->machine); |
| 143 | 131 | break; |
| 144 | case 0x06: blitter_direction_x = (data & 0x01) ? 1 : 0; | |
| 145 | blitter_direction_y = (data & 0x02) ? 1 : 0; | |
| 146 | nbmj8900_flipscreen = (data & 0x04) ? 1 : 0; | |
| 147 | nbmj8900_dispflag = (data & 0x08) ? 0 : 1; | |
| 148 | if (gfxdraw_mode) nbmj8900_vramflip(space->machine, 1); | |
| 132 | case 0x06: state->blitter_direction_x = (data & 0x01) ? 1 : 0; | |
| 133 | state->blitter_direction_y = (data & 0x02) ? 1 : 0; | |
| 134 | state->flipscreen = (data & 0x04) ? 1 : 0; | |
| 135 | state->dispflag = (data & 0x08) ? 0 : 1; | |
| 136 | if (state->gfxdraw_mode) nbmj8900_vramflip(space->machine, 1); | |
| 149 | 137 | nbmj8900_vramflip(space->machine, 0); |
| 150 | 138 | break; |
| 151 | 139 | case 0x07: break; |
| r10613 | r10614 | |
| 154 | 142 | |
| 155 | 143 | WRITE8_HANDLER( nbmj8900_scrolly_w ) |
| 156 | 144 | { |
| 157 | nbmj8900_scrolly = data; | |
| 145 | nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>(); | |
| 146 | state->scrolly = data; | |
| 158 | 147 | } |
| 159 | 148 | |
| 160 | 149 | WRITE8_HANDLER( nbmj8900_vramsel_w ) |
| 161 | 150 | { |
| 151 | nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>(); | |
| 162 | 152 | /* protection - not sure about this */ |
| 163 | 153 | nb1413m3_sndromrgntag = (data & 0x20) ? "protdata" : "voice"; |
| 164 | 154 | |
| 165 | | |
| 155 | state-> | |
| 166 | 156 | } |
| 167 | 157 | |
| 168 | 158 | WRITE8_HANDLER( nbmj8900_romsel_w ) |
| 169 | 159 | { |
| 170 | nbmj8900_gfxrom = (data & 0x0f); | |
| 160 | nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>(); | |
| 161 | state->gfxrom = (data & 0x0f); | |
| 171 | 162 | |
| 172 | if ((0x20000 * | |
| 163 | if ((0x20000 * state-> | |
| 173 | 164 | { |
| 174 | 165 | #ifdef MAME_DEBUG |
| 175 | 166 | popmessage("GFXROM BANK OVER!!"); |
| 176 | 167 | #endif |
| 177 | | |
| 168 | state-> | |
| 178 | 169 | } |
| 179 | 170 | } |
| 180 | 171 | |
| r10613 | r10614 | |
| 184 | 175 | ******************************************************************************/ |
| 185 | 176 | void nbmj8900_vramflip(running_machine *machine, int vram) |
| 186 | 177 | { |
| 187 | stat | |
| 178 | nbmj8900_state | |
| 188 | 179 | int x, y; |
| 189 | 180 | unsigned char color1, color2; |
| 190 | 181 | unsigned char *vidram; |
| 191 | 182 | int width = machine->primary_screen->width(); |
| 192 | 183 | int height = machine->primary_screen->height(); |
| 193 | 184 | |
| 194 | if ( | |
| 185 | if (state-> | |
| 195 | 186 | |
| 196 | vidram = vram ? | |
| 187 | vidram = vram ? state-> | |
| 197 | 188 | |
| 198 | 189 | for (y = 0; y < (height / 2); y++) |
| 199 | 190 | { |
| r10613 | r10614 | |
| 206 | 197 | } |
| 207 | 198 | } |
| 208 | 199 | |
| 209 | nbmj8900_flipscreen_old = nbmj8900_flipscreen; | |
| 210 | nbmj8900_screen_refresh = 1; | |
| 200 | state->flipscreen_old = state->flipscreen; | |
| 201 | state->screen_refresh = 1; | |
| 211 | 202 | } |
| 212 | 203 | |
| 213 | 204 | |
| 214 | 205 | static void update_pixel0(running_machine *machine, int x, int y) |
| 215 | 206 | { |
| 216 | UINT8 color = nbmj8900_videoram0[(y * screen_width) + x]; | |
| 217 | *BITMAP_ADDR16(nbmj8900_tmpbitmap0, y, x) = machine->pens[color]; | |
| 207 | nbmj8900_state *state = machine->driver_data<nbmj8900_state>(); | |
| 208 | UINT8 color = state->videoram0[(y * state->screen_width) + x]; | |
| 209 | *BITMAP_ADDR16(state->tmpbitmap0, y, x) = machine->pens[color]; | |
| 218 | 210 | } |
| 219 | 211 | |
| 220 | 212 | static void update_pixel1(running_machine *machine, int x, int y) |
| 221 | 213 | { |
| 222 | UINT8 color = nbmj8900_videoram1[(y * screen_width) + x]; | |
| 223 | *BITMAP_ADDR16(nbmj8900_tmpbitmap1, y, x) = machine->pens[color]; | |
| 214 | nbmj8900_state *state = machine->driver_data<nbmj8900_state>(); | |
| 215 | UINT8 color = state->videoram1[(y * state->screen_width) + x]; | |
| 216 | *BITMAP_ADDR16(state->tmpbitmap1, y, x) = machine->pens[color]; | |
| 224 | 217 | } |
| 225 | 218 | |
| 226 | 219 | static TIMER_CALLBACK( blitter_timer_callback ) |
| r10613 | r10614 | |
| 230 | 223 | |
| 231 | 224 | static void nbmj8900_gfxdraw(running_machine *machine) |
| 232 | 225 | { |
| 226 | nbmj8900_state *state = machine->driver_data<nbmj8900_state>(); | |
| 233 | 227 | unsigned char *GFX = machine->region("gfx")->base(); |
| 234 | 228 | |
| 235 | 229 | int x, y; |
| r10613 | r10614 | |
| 243 | 237 | |
| 244 | 238 | nb1413m3_busyctr = 0; |
| 245 | 239 | |
| 246 | startx = blitter_destx + blitter_sizex; | |
| 247 | starty = blitter_desty + blitter_sizey; | |
| 240 | startx = state->blitter_destx + state->blitter_sizex; | |
| 241 | starty = state->blitter_desty + state->blitter_sizey; | |
| 248 | 242 | |
| 249 | if (blitter_direction_x) | |
| 243 | if (state->blitter_direction_x) | |
| 250 | 244 | { |
| 251 | sizex = blitter_sizex ^ 0xff; | |
| 245 | sizex = state->blitter_sizex ^ 0xff; | |
| 252 | 246 | skipx = 1; |
| 253 | 247 | } |
| 254 | 248 | else |
| 255 | 249 | { |
| 256 | sizex = blitter_sizex; | |
| 250 | sizex = state->blitter_sizex; | |
| 257 | 251 | skipx = -1; |
| 258 | 252 | } |
| 259 | 253 | |
| 260 | if (blitter_direction_y) | |
| 254 | if (state->blitter_direction_y) | |
| 261 | 255 | { |
| 262 | sizey = blitter_sizey ^ 0xff; | |
| 256 | sizey = state->blitter_sizey ^ 0xff; | |
| 263 | 257 | skipy = 1; |
| 264 | 258 | } |
| 265 | 259 | else |
| 266 | 260 | { |
| 267 | sizey = blitter_sizey; | |
| 261 | sizey = state->blitter_sizey; | |
| 268 | 262 | skipy = -1; |
| 269 | 263 | } |
| 270 | 264 | |
| 271 | gfxaddr = ( | |
| 265 | gfxaddr = (state-> | |
| 272 | 266 | |
| 273 | 267 | for (y = starty, ctry = sizey; ctry >= 0; y += skipy, ctry--) |
| 274 | 268 | { |
| r10613 | r10614 | |
| 293 | 287 | dx1 = (2 * x + 0) & 0x1ff; |
| 294 | 288 | dx2 = (2 * x + 1) & 0x1ff; |
| 295 | 289 | |
| 296 | if (gfxdraw_mode) | |
| 290 | if (state->gfxdraw_mode) | |
| 297 | 291 | { |
| 298 | 292 | // 2 layer type |
| 299 | 293 | dy1 = y & 0xff; |
| 300 | dy2 = (y + | |
| 294 | dy2 = (y + state-> | |
| 301 | 295 | } |
| 302 | 296 | else |
| 303 | 297 | { |
| 304 | 298 | // 1 layer type |
| 305 | dy1 = (y + | |
| 299 | dy1 = (y + state-> | |
| 306 | 300 | dy2 = 0; |
| 307 | 301 | } |
| 308 | 302 | |
| 309 | if (! | |
| 303 | if (!state-> | |
| 310 | 304 | { |
| 311 | 305 | dx1 ^= 0x1ff; |
| 312 | 306 | dx2 ^= 0x1ff; |
| r10613 | r10614 | |
| 314 | 308 | dy2 ^= 0xff; |
| 315 | 309 | } |
| 316 | 310 | |
| 317 | if (blitter_direction_x) | |
| 311 | if (state->blitter_direction_x) | |
| 318 | 312 | { |
| 319 | 313 | // flip |
| 320 | 314 | color1 = (color & 0x0f) >> 0; |
| r10613 | r10614 | |
| 327 | 321 | color2 = (color & 0x0f) >> 0; |
| 328 | 322 | } |
| 329 | 323 | |
| 330 | color1 = nbmj8900_clut[((nbmj8900_clutsel & 0x7f) << 4) + color1]; | |
| 331 | color2 = nbmj8900_clut[((nbmj8900_clutsel & 0x7f) << 4) + color2]; | |
| 324 | color1 = state->clut[((state->clutsel & 0x7f) << 4) + color1]; | |
| 325 | color2 = state->clut[((state->clutsel & 0x7f) << 4) + color2]; | |
| 332 | 326 | |
| 333 | if ((!gfxdraw_mode) || ( | |
| 327 | if ((!state->gfxdraw_mode) || (state-> | |
| 334 | 328 | { |
| 335 | 329 | // layer 1 |
| 336 | 330 | if (color1 != 0xff) |
| 337 | 331 | { |
| 338 | | |
| 332 | state-> | |
| 339 | 333 | update_pixel0(machine, dx1, dy1); |
| 340 | 334 | } |
| 341 | 335 | if (color2 != 0xff) |
| 342 | 336 | { |
| 343 | | |
| 337 | state-> | |
| 344 | 338 | update_pixel0(machine, dx2, dy1); |
| 345 | 339 | } |
| 346 | 340 | } |
| 347 | if (gfxdraw_mode && ( | |
| 341 | if (state->gfxdraw_mode && (state-> | |
| 348 | 342 | { |
| 349 | 343 | // layer 2 |
| 350 | if ( | |
| 344 | if (state-> | |
| 351 | 345 | { |
| 352 | 346 | // transparent enable |
| 353 | 347 | if (color1 != 0xff) |
| 354 | 348 | { |
| 355 | | |
| 349 | state-> | |
| 356 | 350 | update_pixel1(machine, dx1, dy2); |
| 357 | 351 | } |
| 358 | 352 | if (color2 != 0xff) |
| 359 | 353 | { |
| 360 | | |
| 354 | state-> | |
| 361 | 355 | update_pixel1(machine, dx2, dy2); |
| 362 | 356 | } |
| 363 | 357 | } |
| 364 | 358 | else |
| 365 | 359 | { |
| 366 | 360 | // transparent disable |
| 367 | | |
| 361 | state-> | |
| 368 | 362 | update_pixel1(machine, dx1, dy2); |
| 369 | | |
| 363 | state-> | |
| 370 | 364 | update_pixel1(machine, dx2, dy2); |
| 371 | 365 | } |
| 372 | 366 | } |
| r10613 | r10614 | |
| 385 | 379 | ******************************************************************************/ |
| 386 | 380 | VIDEO_START( nbmj8900_2layer ) |
| 387 | 381 | { |
| 388 | screen_width = machine->primary_screen->width(); | |
| 389 | screen_height = machine->primary_screen->height(); | |
| 382 | nbmj8900_state *state = machine->driver_data<nbmj8900_state>(); | |
| 383 | state->screen_width = machine->primary_screen->width(); | |
| 384 | state->screen_height = machine->primary_screen->height(); | |
| 390 | 385 | |
| 391 | nbmj8900_tmpbitmap0 = machine->primary_screen->alloc_compatible_bitmap(); | |
| 392 | nbmj8900_tmpbitmap1 = machine->primary_screen->alloc_compatible_bitmap(); | |
| 393 | nbmj8900_videoram0 = auto_alloc_array(machine, UINT8, screen_width * screen_height); | |
| 394 | nbmj8900_videoram1 = auto_alloc_array(machine, UINT8, screen_width * screen_height); | |
| 395 | nbmj8900_palette = auto_alloc_array(machine, UINT8, 0x200); | |
| 396 | nbmj8900_clut = auto_alloc_array(machine, UINT8, 0x800); | |
| 397 | memset(nbmj8900_videoram0, 0xff, (screen_width * screen_height * sizeof(UINT8))); | |
| 398 | memset(nbmj8900_videoram1, 0xff, (screen_width * screen_height * sizeof(UINT8))); | |
| 386 | state->tmpbitmap0 = machine->primary_screen->alloc_compatible_bitmap(); | |
| 387 | state->tmpbitmap1 = machine->primary_screen->alloc_compatible_bitmap(); | |
| 388 | state->videoram0 = auto_alloc_array(machine, UINT8, state->screen_width * state->screen_height); | |
| 389 | state->videoram1 = auto_alloc_array(machine, UINT8, state->screen_width * state->screen_height); | |
| 390 | state->palette = auto_alloc_array(machine, UINT8, 0x200); | |
| 391 | state->clut = auto_alloc_array(machine, UINT8, 0x800); | |
| 392 | memset(state->videoram0, 0xff, (state->screen_width * state->screen_height * sizeof(UINT8))); | |
| 393 | memset(state->videoram1, 0xff, (state->screen_width * state->screen_height * sizeof(UINT8))); | |
| 399 | 394 | // machine->pens[0x07f] = 0xff; /* palette_transparent_pen */ |
| 400 | gfxdraw_mode = 1; | |
| 395 | state->gfxdraw_mode = 1; | |
| 401 | 396 | } |
| 402 | 397 | |
| 403 | 398 | /****************************************************************************** |
| r10613 | r10614 | |
| 406 | 401 | ******************************************************************************/ |
| 407 | 402 | SCREEN_UPDATE( nbmj8900 ) |
| 408 | 403 | { |
| 404 | nbmj8900_state *state = screen->machine->driver_data<nbmj8900_state>(); | |
| 409 | 405 | int x, y; |
| 410 | 406 | |
| 411 | if ( | |
| 407 | if (state-> | |
| 412 | 408 | { |
| 413 | nbmj8900_screen_refresh = 0; | |
| 414 | for (y = 0; y < screen_height; y++) | |
| 409 | state->screen_refresh = 0; | |
| 410 | for (y = 0; y < state->screen_height; y++) | |
| 415 | 411 | { |
| 416 | for (x = 0; x < screen_width; x++) | |
| 412 | for (x = 0; x < state->screen_width; x++) | |
| 417 | 413 | { |
| 418 | 414 | update_pixel0(screen->machine, x, y); |
| 419 | 415 | } |
| 420 | 416 | } |
| 421 | if (gfxdraw_mode) | |
| 417 | if (state->gfxdraw_mode) | |
| 422 | 418 | { |
| 423 | for (y = 0; y < screen_height; y++) | |
| 419 | for (y = 0; y < state->screen_height; y++) | |
| 424 | 420 | { |
| 425 | for (x = 0; x < screen_width; x++) | |
| 421 | for (x = 0; x < state->screen_width; x++) | |
| 426 | 422 | { |
| 427 | 423 | update_pixel1(screen->machine, x, y); |
| 428 | 424 | } |
| r10613 | r10614 | |
| 430 | 426 | } |
| 431 | 427 | } |
| 432 | 428 | |
| 433 | if ( | |
| 429 | if (state-> | |
| 434 | 430 | { |
| 435 | static int scrolly; | |
| 436 | if (!nbmj8900_flipscreen) scrolly = nbmj8900_scrolly; | |
| 437 | else scrolly = (-nbmj8900_scrolly) & 0xff; | |
| 431 | int scrolly; | |
| 432 | if (!state->flipscreen) scrolly = state->scrolly; | |
| 433 | else scrolly = (-state->scrolly) & 0xff; | |
| 438 | 434 | |
| 439 | if (gfxdraw_mode) | |
| 435 | if (state->gfxdraw_mode) | |
| 440 | 436 | { |
| 441 | copyscrollbitmap(bitmap, nbmj8900_tmpbitmap0, 0, 0, 0, 0, cliprect); | |
| 442 | copyscrollbitmap_trans(bitmap, nbmj8900_tmpbitmap1, 0, 0, 1, &scrolly, cliprect, 0xff); | |
| 437 | copyscrollbitmap(bitmap, state->tmpbitmap0, 0, 0, 0, 0, cliprect); | |
| 438 | copyscrollbitmap_trans(bitmap, state->tmpbitmap1, 0, 0, 1, &scrolly, cliprect, 0xff); | |
| 443 | 439 | } |
| 444 | 440 | else |
| 445 | 441 | { |
| 446 | copyscrollbitmap(bitmap, | |
| 442 | copyscrollbitmap(bitmap, state-> | |
| 447 | 443 | } |
| 448 | 444 | } |
| 449 | 445 | else |
| r10613 | r10614 | |
|---|---|---|
| 29 | 29 | #include "emu.h" |
| 30 | 30 | #include "includes/m90.h" |
| 31 | 31 | |
| 32 | static UINT16 *m90_spriteram; | |
| 33 | UINT16 *m90_video_data; | |
| 34 | static UINT16 m90_video_control_data[8]; | |
| 35 | static tilemap_t *pf1_layer,*pf2_layer,*pf1_wide_layer,*pf2_wide_layer; | |
| 36 | 32 | |
| 37 | 33 | INLINE void get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int layer,int page_mask) |
| 38 | 34 | { |
| 35 | m90_state *state = machine->driver_data<m90_state>(); | |
| 39 | 36 | int tile,color; |
| 40 | tile_index = 2*tile_index + (( | |
| 37 | tile_index = 2*tile_index + ((state->video_control_data[5+layer] & page_mask) * 0x2000); | |
| 41 | 38 | |
| 42 | tile=m90_video_data[tile_index]; | |
| 43 | color=m90_video_data[tile_index+1]; | |
| 39 | tile=state->video_data[tile_index]; | |
| 40 | color=state->video_data[tile_index+1]; | |
| 44 | 41 | SET_TILE_INFO( |
| 45 | 42 | 0, |
| 46 | 43 | tile, |
| r10613 | r10614 | |
| 51 | 48 | |
| 52 | 49 | INLINE void bomblord_get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int layer) |
| 53 | 50 | { |
| 51 | m90_state *state = machine->driver_data<m90_state>(); | |
| 54 | 52 | int tile,color; |
| 55 | 53 | tile_index = 2*tile_index + (layer * 0x2000); |
| 56 | 54 | |
| 57 | tile=m90_video_data[tile_index]; | |
| 58 | color=m90_video_data[tile_index+1]; | |
| 55 | tile=state->video_data[tile_index]; | |
| 56 | color=state->video_data[tile_index+1]; | |
| 59 | 57 | SET_TILE_INFO( |
| 60 | 58 | 0, |
| 61 | 59 | tile, |
| r10613 | r10614 | |
| 66 | 64 | |
| 67 | 65 | INLINE void dynablsb_get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int layer) |
| 68 | 66 | { |
| 67 | m90_state *state = machine->driver_data<m90_state>(); | |
| 69 | 68 | int tile,color; |
| 70 | 69 | tile_index = 2*tile_index + (layer * 0x2000); |
| 71 | 70 | |
| 72 | tile=m90_video_data[tile_index]; | |
| 73 | color=m90_video_data[tile_index+1]; | |
| 71 | tile=state->video_data[tile_index]; | |
| 72 | color=state->video_data[tile_index+1]; | |
| 74 | 73 | SET_TILE_INFO( |
| 75 | 74 | 0, |
| 76 | 75 | tile, |
| r10613 | r10614 | |
| 96 | 95 | |
| 97 | 96 | VIDEO_START( m90 ) |
| 98 | 97 | { |
| 99 | pf1_layer = tilemap_create(machine, get_pf1_tile_info, tilemap_scan_rows,8,8,64,64); | |
| 100 | pf1_wide_layer = tilemap_create(machine, get_pf1w_tile_info,tilemap_scan_rows,8,8,128,64); | |
| 101 | pf2_layer = tilemap_create(machine, get_pf2_tile_info, tilemap_scan_rows,8,8,64,64); | |
| 102 | pf2_wide_layer = tilemap_create(machine, get_pf2w_tile_info,tilemap_scan_rows,8,8,128,64); | |
| 98 | m90_state *state = machine->driver_data<m90_state>(); | |
| 99 | state->pf1_layer = tilemap_create(machine, get_pf1_tile_info, tilemap_scan_rows,8,8,64,64); | |
| 100 | state->pf1_wide_layer = tilemap_create(machine, get_pf1w_tile_info,tilemap_scan_rows,8,8,128,64); | |
| 101 | state->pf2_layer = tilemap_create(machine, get_pf2_tile_info, tilemap_scan_rows,8,8,64,64); | |
| 102 | state->pf2_wide_layer = tilemap_create(machine, get_pf2w_tile_info,tilemap_scan_rows,8,8,128,64); | |
| 103 | 103 | |
| 104 | tilemap_set_transparent_pen(pf1_layer,0); | |
| 105 | tilemap_set_transparent_pen(pf1_wide_layer,0); | |
| 104 | tilemap_set_transparent_pen(state->pf1_layer,0); | |
| 105 | tilemap_set_transparent_pen(state->pf1_wide_layer,0); | |
| 106 | 106 | |
| 107 | state_save_register_global_array(machine, | |
| 107 | state_save_register_global_array(machine, state->video_control_data); | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | VIDEO_START( bomblord ) |
| 111 | 111 | { |
| 112 | pf1_layer = tilemap_create(machine, bomblord_get_pf1_tile_info, tilemap_scan_rows,8,8,64,64); | |
| 113 | pf1_wide_layer = tilemap_create(machine, bomblord_get_pf1w_tile_info,tilemap_scan_rows,8,8,128,64); | |
| 114 | pf2_layer = tilemap_create(machine, bomblord_get_pf2_tile_info, tilemap_scan_rows,8,8,64,64); | |
| 115 | pf2_wide_layer = tilemap_create(machine, bomblord_get_pf2w_tile_info,tilemap_scan_rows,8,8,128,64); | |
| 112 | m90_state *state = machine->driver_data<m90_state>(); | |
| 113 | state->pf1_layer = tilemap_create(machine, bomblord_get_pf1_tile_info, tilemap_scan_rows,8,8,64,64); | |
| 114 | state->pf1_wide_layer = tilemap_create(machine, bomblord_get_pf1w_tile_info,tilemap_scan_rows,8,8,128,64); | |
| 115 | state->pf2_layer = tilemap_create(machine, bomblord_get_pf2_tile_info, tilemap_scan_rows,8,8,64,64); | |
| 116 | state->pf2_wide_layer = tilemap_create(machine, bomblord_get_pf2w_tile_info,tilemap_scan_rows,8,8,128,64); | |
| 116 | 117 | |
| 117 | tilemap_set_transparent_pen(pf2_layer,0); | |
| 118 | tilemap_set_transparent_pen(pf2_wide_layer,0); | |
| 119 | tilemap_set_transparent_pen(pf1_layer,0); | |
| 120 | tilemap_set_transparent_pen(pf1_wide_layer,0); | |
| 118 | tilemap_set_transparent_pen(state->pf2_layer,0); | |
| 119 | tilemap_set_transparent_pen(state->pf2_wide_layer,0); | |
| 120 | tilemap_set_transparent_pen(state->pf1_layer,0); | |
| 121 | tilemap_set_transparent_pen(state->pf1_wide_layer,0); | |
| 121 | 122 | |
| 122 | state_save_register_global_array(machine, | |
| 123 | state_save_register_global_array(machine, state->video_control_data); | |
| 123 | 124 | } |
| 124 | 125 | |
| 125 | 126 | VIDEO_START( dynablsb ) |
| 126 | 127 | { |
| 127 | pf1_layer = tilemap_create(machine, dynablsb_get_pf1_tile_info, tilemap_scan_rows,8,8,64,64); | |
| 128 | pf1_wide_layer = tilemap_create(machine, dynablsb_get_pf1w_tile_info,tilemap_scan_rows,8,8,128,64); | |
| 129 | pf2_layer = tilemap_create(machine, dynablsb_get_pf2_tile_info, tilemap_scan_rows,8,8,64,64); | |
| 130 | pf2_wide_layer = tilemap_create(machine, dynablsb_get_pf2w_tile_info,tilemap_scan_rows,8,8,128,64); | |
| 128 | m90_state *state = machine->driver_data<m90_state>(); | |
| 129 | state->pf1_layer = tilemap_create(machine, dynablsb_get_pf1_tile_info, tilemap_scan_rows,8,8,64,64); | |
| 130 | state->pf1_wide_layer = tilemap_create(machine, dynablsb_get_pf1w_tile_info,tilemap_scan_rows,8,8,128,64); | |
| 131 | state->pf2_layer = tilemap_create(machine, dynablsb_get_pf2_tile_info, tilemap_scan_rows,8,8,64,64); | |
| 132 | state->pf2_wide_layer = tilemap_create(machine, dynablsb_get_pf2w_tile_info,tilemap_scan_rows,8,8,128,64); | |
| 131 | 133 | |
| 132 | tilemap_set_transparent_pen(pf2_layer,0); | |
| 133 | tilemap_set_transparent_pen(pf2_wide_layer,0); | |
| 134 | tilemap_set_transparent_pen(state->pf2_layer,0); | |
| 135 | tilemap_set_transparent_pen(state->pf2_wide_layer,0); | |
| 134 | 136 | |
| 135 | state_save_register_global_array(machine, | |
| 137 | state_save_register_global_array(machine, state->video_control_data); | |
| 136 | 138 | } |
| 137 | 139 | |
| 138 | 140 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) |
| 139 | 141 | { |
| 142 | m90_state *state = machine->driver_data<m90_state>(); | |
| 140 | 143 | int offs; |
| 141 | 144 | |
| 142 | 145 | for (offs = 0x1f2/2; offs >= 0; offs -= 3) |
| 143 | 146 | { |
| 144 | 147 | int x,y,sprite,colour,fx,fy,y_multi,i; |
| 145 | 148 | |
| 146 | sprite = m90_spriteram[offs+1]; | |
| 147 | colour = (m90_spriteram[offs+0] >> 9) & 0x0f; | |
| 149 | sprite = state->spriteram[offs+1]; | |
| 150 | colour = (state->spriteram[offs+0] >> 9) & 0x0f; | |
| 148 | 151 | |
| 149 | y = m90_spriteram[offs+0] & 0x1ff; | |
| 150 | x = m90_spriteram[offs+2] & 0x1ff; | |
| 152 | y = state->spriteram[offs+0] & 0x1ff; | |
| 153 | x = state->spriteram[offs+2] & 0x1ff; | |
| 151 | 154 | |
| 152 | 155 | x = x - 16; |
| 153 | 156 | y = 512 - y; |
| 154 | 157 | |
| 155 | fx = (m90_spriteram[offs+2] >> 8) & 0x02; | |
| 156 | fy = (m90_spriteram[offs+0] >> 8) & 0x80; | |
| 158 | fx = (state->spriteram[offs+2] >> 8) & 0x02; | |
| 159 | fy = (state->spriteram[offs+0] >> 8) & 0x80; | |
| 157 | 160 | |
| 158 | y_multi = 1 << (( | |
| 161 | y_multi = 1 << ((state->spriteram[offs+0] & 0x6000) >> 13); | |
| 159 | 162 | y -= 16 * y_multi; |
| 160 | 163 | |
| 161 | 164 | for (i = 0;i < y_multi;i++) |
| 162 | 165 | |
| 163 | if ( | |
| 166 | if (state->video_control_data[7] & 0x01) | |
| 164 | 167 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1], |
| 165 | 168 | sprite + (fy ? y_multi-1 - i : i), |
| 166 | 169 | colour, |
| r10613 | r10614 | |
| 168 | 171 | x,y+i*16, |
| 169 | 172 | machine->priority_bitmap, |
| 170 | 173 | (colour & 0x08) ? 0x00 : 0x02,0); |
| 171 | else if ( | |
| 174 | else if (state->video_control_data[7] & 0x02) | |
| 172 | 175 | pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1], |
| 173 | 176 | sprite + (fy ? y_multi-1 - i : i), |
| 174 | 177 | colour, |
| r10613 | r10614 | |
| 266 | 269 | |
| 267 | 270 | WRITE16_HANDLER( m90_video_control_w ) |
| 268 | 271 | { |
| 269 | COMBINE_DATA(&m90_video_control_data[offset]); | |
| 272 | m90_state *state = space->machine->driver_data<m90_state>(); | |
| 273 | COMBINE_DATA(&state->video_control_data[offset]); | |
| 270 | 274 | } |
| 271 | 275 | |
| 272 | 276 | static void markdirty(tilemap_t *tmap,int page,offs_t offset) |
| r10613 | r10614 | |
| 279 | 283 | |
| 280 | 284 | WRITE16_HANDLER( m90_video_w ) |
| 281 | 285 | { |
| 282 | COMBINE_DATA(&m90_video_data[offset]); | |
| 286 | m90_state *state = space->machine->driver_data<m90_state>(); | |
| 287 | COMBINE_DATA(&state->video_data[offset]); | |
| 283 | 288 | |
| 284 | markdirty(pf1_layer, m90_video_control_data[5] & 0x3,offset); | |
| 285 | markdirty(pf1_wide_layer,m90_video_control_data[5] & 0x2,offset); | |
| 286 | markdirty(pf2_layer, m90_video_control_data[6] & 0x3,offset); | |
| 287 | markdirty(pf2_wide_layer,m90_video_control_data[6] & 0x2,offset); | |
| 289 | markdirty(state->pf1_layer, state->video_control_data[5] & 0x3,offset); | |
| 290 | markdirty(state->pf1_wide_layer,state->video_control_data[5] & 0x2,offset); | |
| 291 | markdirty(state->pf2_layer, state->video_control_data[6] & 0x3,offset); | |
| 292 | markdirty(state->pf2_wide_layer,state->video_control_data[6] & 0x2,offset); | |
| 288 | 293 | } |
| 289 | 294 | |
| 290 | 295 | SCREEN_UPDATE( m90 ) |
| 291 | 296 | { |
| 292 | static int last_pf1,last_pf2; | |
| 293 | int pf1_base = m90_video_control_data[5] & 0x3; | |
| 294 | int pf2_base = m90_video_control_data[6] & 0x3; | |
| 297 | m90_state *state = screen->machine->driver_data<m90_state>(); | |
| 298 | int pf1_base = state->video_control_data[5] & 0x3; | |
| 299 | int pf2_base = state->video_control_data[6] & 0x3; | |
| 295 | 300 | int i,pf1_enable,pf2_enable, video_enable; |
| 296 | 301 | |
| 297 | if (m90_video_control_data[7]&0x04) video_enable=0; else video_enable=1; | |
| 298 | if (m90_video_control_data[5]&0x10) pf1_enable=0; else pf1_enable=1; | |
| 299 | if (m90_video_control_data[6]&0x10) pf2_enable=0; else pf2_enable=1; | |
| 302 | if (state->video_control_data[7]&0x04) video_enable=0; else video_enable=1; | |
| 303 | if (state->video_control_data[5]&0x10) pf1_enable=0; else pf1_enable=1; | |
| 304 | if (state->video_control_data[6]&0x10) pf2_enable=0; else pf2_enable=1; | |
| 300 | 305 | |
| 301 | // tilemap_set_enable(pf1_layer,pf1_enable); | |
| 302 | // tilemap_set_enable(pf2_layer,pf2_enable); | |
| 303 | // tilemap_set_enable(pf1_wide_layer,pf1_enable); | |
| 304 | // tilemap_set_enable(pf2_wide_layer,pf2_enable); | |
| 306 | // tilemap_set_enable(state->pf1_layer,pf1_enable); | |
| 307 | // tilemap_set_enable(state->pf2_layer,pf2_enable); | |
| 308 | // tilemap_set_enable(state->pf1_wide_layer,pf1_enable); | |
| 309 | // tilemap_set_enable(state->pf2_wide_layer,pf2_enable); | |
| 305 | 310 | |
| 306 | 311 | /* Dirty tilemaps if VRAM base changes */ |
| 307 | if (pf1_base!=last_pf1) | |
| 312 | if (pf1_base!=state->last_pf1) | |
| 308 | 313 | { |
| 309 | tilemap_mark_all_tiles_dirty(pf1_layer); | |
| 310 | tilemap_mark_all_tiles_dirty(pf1_wide_layer); | |
| 314 | tilemap_mark_all_tiles_dirty(state->pf1_layer); | |
| 315 | tilemap_mark_all_tiles_dirty(state->pf1_wide_layer); | |
| 311 | 316 | } |
| 312 | if (pf2_base!=last_pf2) | |
| 317 | if (pf2_base!=state->last_pf2) | |
| 313 | 318 | { |
| 314 | tilemap_mark_all_tiles_dirty(pf2_layer); | |
| 315 | tilemap_mark_all_tiles_dirty(pf2_wide_layer); | |
| 319 | tilemap_mark_all_tiles_dirty(state->pf2_layer); | |
| 320 | tilemap_mark_all_tiles_dirty(state->pf2_wide_layer); | |
| 316 | 321 | } |
| 317 | last_pf1=pf1_base; | |
| 318 | last_pf2=pf2_base; | |
| 322 | state->last_pf1=pf1_base; | |
| 323 | state->last_pf2=pf2_base; | |
| 319 | 324 | |
| 320 | | |
| 325 | | |
| 321 | 326 | |
| 322 | 327 | /* Setup scrolling */ |
| 323 | if ( | |
| 328 | if (state->video_control_data[5]&0x20) | |
| 324 | 329 | { |
| 325 | tilemap_set_scroll_rows(pf1_layer,512); | |
| 326 | tilemap_set_scroll_rows(pf1_wide_layer,512); | |
| 330 | tilemap_set_scroll_rows(state->pf1_layer,512); | |
| 331 | tilemap_set_scroll_rows(state->pf1_wide_layer,512); | |
| 327 | 332 | |
| 328 | 333 | for (i=0; i<512; i++) |
| 329 | tilemap_set_scrollx( pf1_layer,i, | |
| 334 | tilemap_set_scrollx( state->pf1_layer,i, state->video_data[0xf000/2+i]+2); | |
| 330 | 335 | for (i=0; i<512; i++) |
| 331 | tilemap_set_scrollx( pf1_wide_layer,i, | |
| 336 | tilemap_set_scrollx( state->pf1_wide_layer,i, state->video_data[0xf000/2+i]+256+2); | |
| 332 | 337 | |
| 333 | 338 | } |
| 334 | 339 | else |
| 335 | 340 | { |
| 336 | tilemap_set_scroll_rows(pf1_layer,1); | |
| 337 | tilemap_set_scroll_rows(pf1_wide_layer,1); | |
| 338 | tilemap_set_scrollx( pf1_layer,0, m90_video_control_data[1]+2); | |
| 339 | tilemap_set_scrollx( pf1_wide_layer,0, m90_video_control_data[1]+256+2); | |
| 341 | tilemap_set_scroll_rows(state->pf1_layer,1); | |
| 342 | tilemap_set_scroll_rows(state->pf1_wide_layer,1); | |
| 343 | tilemap_set_scrollx( state->pf1_layer,0, state->video_control_data[1]+2); | |
| 344 | tilemap_set_scrollx( state->pf1_wide_layer,0, state->video_control_data[1]+256+2); | |
| 340 | 345 | } |
| 341 | 346 | |
| 342 | 347 | /* Setup scrolling */ |
| 343 | if ( | |
| 348 | if (state->video_control_data[6]&0x20) | |
| 344 | 349 | { |
| 345 | tilemap_set_scroll_rows(pf2_layer,512); | |
| 346 | tilemap_set_scroll_rows(pf2_wide_layer,512); | |
| 350 | tilemap_set_scroll_rows(state->pf2_layer,512); | |
| 351 | tilemap_set_scroll_rows(state->pf2_wide_layer,512); | |
| 347 | 352 | for (i=0; i<512; i++) |
| 348 | tilemap_set_scrollx( pf2_layer,i, | |
| 353 | tilemap_set_scrollx( state->pf2_layer,i, state->video_data[0xf400/2+i]-2); | |
| 349 | 354 | for (i=0; i<512; i++) |
| 350 | tilemap_set_scrollx( pf2_wide_layer,i, | |
| 355 | tilemap_set_scrollx( state->pf2_wide_layer,i, state->video_data[0xf400/2+i]+256-2); | |
| 351 | 356 | } else { |
| 352 | tilemap_set_scroll_rows(pf2_layer,1); | |
| 353 | tilemap_set_scroll_rows(pf2_wide_layer,1); | |
| 354 | tilemap_set_scrollx( pf2_layer,0, m90_video_control_data[3]-2); | |
| 355 | tilemap_set_scrollx( pf2_wide_layer,0, m90_video_control_data[3]+256-2 ); | |
| 357 | tilemap_set_scroll_rows(state->pf2_layer,1); | |
| 358 | tilemap_set_scroll_rows(state->pf2_wide_layer,1); | |
| 359 | tilemap_set_scrollx( state->pf2_layer,0, state->video_control_data[3]-2); | |
| 360 | tilemap_set_scrollx( state->pf2_wide_layer,0, state->video_control_data[3]+256-2 ); | |
| 356 | 361 | } |
| 357 | 362 | |
| 358 | 363 | bitmap_fill(screen->machine->priority_bitmap,cliprect,0); |
| r10613 | r10614 | |
| 363 | 368 | if (pf2_enable) |
| 364 | 369 | { |
| 365 | 370 | // use the playfield 2 y-offset table for each scanline |
| 366 | if ( | |
| 371 | if (state->video_control_data[6] & 0x40) | |
| 367 | 372 | { |
| 368 | 373 | int line; |
| 369 | 374 | rectangle clip; |
| r10613 | r10614 | |
| 374 | 379 | { |
| 375 | 380 | clip.min_y = clip.max_y = line; |
| 376 | 381 | |
| 377 | if ( | |
| 382 | if (state->video_control_data[6] & 0x4) | |
| 378 | 383 | { |
| 379 | tilemap_set_scrolly(pf2_wide_layer, 0, 0x200 + m90_video_data[0xfc00/2 + line]); | |
| 380 | tilemap_draw(bitmap,&clip,pf2_wide_layer,0,0); | |
| 381 | tilemap_draw(bitmap,&clip,pf2_wide_layer,1,1); | |
| 384 | tilemap_set_scrolly(state->pf2_wide_layer, 0, 0x200 + state->video_data[0xfc00/2 + line]); | |
| 385 | tilemap_draw(bitmap,&clip,state->pf2_wide_layer,0,0); | |
| 386 | tilemap_draw(bitmap,&clip,state->pf2_wide_layer,1,1); | |
| 382 | 387 | } else { |
| 383 | tilemap_set_scrolly(pf2_layer, 0, 0x200 + m90_video_data[0xfc00/2 + line]); | |
| 384 | tilemap_draw(bitmap,&clip,pf2_layer,0,0); | |
| 385 | tilemap_draw(bitmap,&clip,pf2_layer,1,1); | |
| 388 | tilemap_set_scrolly(state->pf2_layer, 0, 0x200 + state->video_data[0xfc00/2 + line]); | |
| 389 | tilemap_draw(bitmap,&clip,state->pf2_layer,0,0); | |
| 390 | tilemap_draw(bitmap,&clip,state->pf2_layer,1,1); | |
| 386 | 391 | } |
| 387 | 392 | } |
| 388 | 393 | } |
| 389 | 394 | else |
| 390 | 395 | { |
| 391 | if ( | |
| 396 | if (state->video_control_data[6] & 0x4) | |
| 392 | 397 | { |
| 393 | tilemap_set_scrolly( pf2_wide_layer,0, m90_video_control_data[2] ); | |
| 394 | tilemap_draw(bitmap,cliprect,pf2_wide_layer,0,0); | |
| 395 | tilemap_draw(bitmap,cliprect,pf2_wide_layer,1,1); | |
| 398 | tilemap_set_scrolly( state->pf2_wide_layer,0, state->video_control_data[2] ); | |
| 399 | tilemap_draw(bitmap,cliprect,state->pf2_wide_layer,0,0); | |
| 400 | tilemap_draw(bitmap,cliprect,state->pf2_wide_layer,1,1); | |
| 396 | 401 | } else { |
| 397 | tilemap_set_scrolly( pf2_layer,0, m90_video_control_data[2] ); | |
| 398 | tilemap_draw(bitmap,cliprect,pf2_layer,0,0); | |
| 399 | tilemap_draw(bitmap,cliprect,pf2_layer,1,1); | |
| 402 | tilemap_set_scrolly( state->pf2_layer,0, state->video_control_data[2] ); | |
| 403 | tilemap_draw(bitmap,cliprect,state->pf2_layer,0,0); | |
| 404 | tilemap_draw(bitmap,cliprect,state->pf2_layer,1,1); | |
| 400 | 405 | } |
| 401 | 406 | } |
| 402 | 407 | } |
| r10613 | r10614 | |
| 408 | 413 | if (pf1_enable) |
| 409 | 414 | { |
| 410 | 415 | // use the playfield 1 y-offset table for each scanline |
| 411 | if ( | |
| 416 | if (state->video_control_data[5] & 0x40) | |
| 412 | 417 | { |
| 413 | 418 | int line; |
| 414 | 419 | rectangle clip; |
| r10613 | r10614 | |
| 419 | 424 | { |
| 420 | 425 | clip.min_y = clip.max_y = line; |
| 421 | 426 | |
| 422 | if ( | |
| 427 | if (state->video_control_data[5] & 0x4) | |
| 423 | 428 | { |
| 424 | tilemap_set_scrolly(pf1_wide_layer, 0, 0x200 + m90_video_data[0xf800/2 + line]); | |
| 425 | tilemap_draw(bitmap,&clip,pf1_wide_layer,0,0); | |
| 426 | tilemap_draw(bitmap,&clip,pf1_wide_layer,1,1); | |
| 429 | tilemap_set_scrolly(state->pf1_wide_layer, 0, 0x200 + state->video_data[0xf800/2 + line]); | |
| 430 | tilemap_draw(bitmap,&clip,state->pf1_wide_layer,0,0); | |
| 431 | tilemap_draw(bitmap,&clip,state->pf1_wide_layer,1,1); | |
| 427 | 432 | } else { |
| 428 | tilemap_set_scrolly(pf1_layer, 0, 0x200 + m90_video_data[0xf800/2 + line]); | |
| 429 | tilemap_draw(bitmap,&clip,pf1_layer,0,0); | |
| 430 | tilemap_draw(bitmap,&clip,pf1_layer,1,1); | |
| 433 | tilemap_set_scrolly(state->pf1_layer, 0, 0x200 + state->video_data[0xf800/2 + line]); | |
| 434 | tilemap_draw(bitmap,&clip,state->pf1_layer,0,0); | |
| 435 | tilemap_draw(bitmap,&clip,state->pf1_layer,1,1); | |
| 431 | 436 | } |
| 432 | 437 | } |
| 433 | 438 | } |
| 434 | 439 | else |
| 435 | 440 | { |
| 436 | if ( | |
| 441 | if (state->video_control_data[5] & 0x4) | |
| 437 | 442 | { |
| 438 | tilemap_set_scrolly( pf1_wide_layer,0, m90_video_control_data[0] ); | |
| 439 | tilemap_draw(bitmap,cliprect,pf1_wide_layer,0,0); | |
| 440 | tilemap_draw(bitmap,cliprect,pf1_wide_layer,1,1); | |
| 443 | tilemap_set_scrolly( state->pf1_wide_layer,0, state->video_control_data[0] ); | |
| 444 | tilemap_draw(bitmap,cliprect,state->pf1_wide_layer,0,0); | |
| 445 | tilemap_draw(bitmap,cliprect,state->pf1_wide_layer,1,1); | |
| 441 | 446 | } else { |
| 442 | tilemap_set_scrolly( pf1_layer,0, m90_video_control_data[0] ); | |
| 443 | tilemap_draw(bitmap,cliprect,pf1_layer,0,0); | |
| 444 | tilemap_draw(bitmap,cliprect,pf1_layer,1,1); | |
| 447 | tilemap_set_scrolly( state->pf1_layer,0, state->video_control_data[0] ); | |
| 448 | tilemap_draw(bitmap,cliprect,state->pf1_layer,0,0); | |
| 449 | tilemap_draw(bitmap,cliprect,state->pf1_layer,1,1); | |
| 445 | 450 | } |
| 446 | 451 | } |
| 447 | 452 | } |
| r10613 | r10614 | |
| 457 | 462 | |
| 458 | 463 | SCREEN_UPDATE( bomblord ) |
| 459 | 464 | { |
| 465 | m90_state *state = screen->machine->driver_data<m90_state>(); | |
| 460 | 466 | int i; |
| 461 | 467 | bitmap_fill(screen->machine->priority_bitmap,cliprect,0); |
| 462 | 468 | bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine)); |
| 463 | 469 | |
| 464 | 470 | /* Setup scrolling */ |
| 465 | if (m90_video_control_data[6]&0x20) { | |
| 466 | tilemap_set_scroll_rows(pf1_layer,512); | |
| 467 | tilemap_set_scroll_rows(pf1_wide_layer,512); | |
| 471 | if (state->video_control_data[6]&0x20) { | |
| 472 | tilemap_set_scroll_rows(state->pf1_layer,512); | |
| 473 | tilemap_set_scroll_rows(state->pf1_wide_layer,512); | |
| 468 | 474 | for (i=0; i<512; i++) |
| 469 | tilemap_set_scrollx( pf1_layer,i, | |
| 475 | tilemap_set_scrollx( state->pf1_layer,i, state->video_data[0xf400/2+i]-12); | |
| 470 | 476 | for (i=0; i<512; i++) |
| 471 | tilemap_set_scrollx( pf1_wide_layer,i, | |
| 477 | tilemap_set_scrollx( state->pf1_wide_layer,i, state->video_data[0xf400/2+i]-12+256); | |
| 472 | 478 | } else { |
| 473 | tilemap_set_scroll_rows(pf1_layer,1); | |
| 474 | tilemap_set_scroll_rows(pf1_wide_layer,1); | |
| 475 | tilemap_set_scrollx( pf1_layer,0, m90_video_data[0xf004/2]-12); | |
| 476 | tilemap_set_scrollx( pf1_wide_layer,0, m90_video_data[0xf004/2]-12 ); | |
| 479 | tilemap_set_scroll_rows(state->pf1_layer,1); | |
| 480 | tilemap_set_scroll_rows(state->pf1_wide_layer,1); | |
| 481 | tilemap_set_scrollx( state->pf1_layer,0, state->video_data[0xf004/2]-12); | |
| 482 | tilemap_set_scrollx( state->pf1_wide_layer,0, state->video_data[0xf004/2]-12 ); | |
| 477 | 483 | } |
| 478 | 484 | |
| 479 | if (m90_video_control_data[6] & 0x02) { | |
| 480 | tilemap_mark_all_tiles_dirty(pf2_wide_layer); | |
| 481 | tilemap_set_scrollx( pf2_wide_layer,0, m90_video_data[0xf000/2]-16 ); | |
| 482 | tilemap_set_scrolly( pf2_wide_layer,0, m90_video_data[0xf008/2]+388 ); | |
| 483 | tilemap_draw(bitmap,cliprect,pf2_wide_layer,0,0); | |
| 484 | tilemap_draw(bitmap,cliprect,pf2_wide_layer,1,1); | |
| 485 | if (state->video_control_data[6] & 0x02) { | |
| 486 | tilemap_mark_all_tiles_dirty(state->pf2_wide_layer); | |
| 487 | tilemap_set_scrollx( state->pf2_wide_layer,0, state->video_data[0xf000/2]-16 ); | |
| 488 | tilemap_set_scrolly( state->pf2_wide_layer,0, state->video_data[0xf008/2]+388 ); | |
| 489 | tilemap_draw(bitmap,cliprect,state->pf2_wide_layer,0,0); | |
| 490 | tilemap_draw(bitmap,cliprect,state->pf2_wide_layer,1,1); | |
| 485 | 491 | } else { |
| 486 | tilemap_mark_all_tiles_dirty(pf2_layer); | |
| 487 | tilemap_set_scrollx( pf2_layer,0, m90_video_data[0xf000/2]-16 ); | |
| 488 | tilemap_set_scrolly( pf2_layer,0, m90_video_data[0xf008/2]-120 ); | |
| 489 | tilemap_draw(bitmap,cliprect,pf2_layer,0,0); | |
| 490 | tilemap_draw(bitmap,cliprect,pf2_layer,1,1); | |
| 492 | tilemap_mark_all_tiles_dirty(state->pf2_layer); | |
| 493 | tilemap_set_scrollx( state->pf2_layer,0, state->video_data[0xf000/2]-16 ); | |
| 494 | tilemap_set_scrolly( state->pf2_layer,0, state->video_data[0xf008/2]-120 ); | |
| 495 | tilemap_draw(bitmap,cliprect,state->pf2_layer,0,0); | |
| 496 | tilemap_draw(bitmap,cliprect,state->pf2_layer,1,1); | |
| 491 | 497 | } |
| 492 | 498 | |
| 493 | if (m90_video_control_data[6] & 0x04) { | |
| 494 | tilemap_mark_all_tiles_dirty(pf1_wide_layer); | |
| 495 | tilemap_set_scrolly( pf1_wide_layer,0, m90_video_data[0xf00c/2]+392 ); | |
| 496 | tilemap_draw(bitmap,cliprect,pf1_wide_layer,0,0); | |
| 497 | tilemap_draw(bitmap,cliprect,pf1_wide_layer,1,1); | |
| 499 | if (state->video_control_data[6] & 0x04) { | |
| 500 | tilemap_mark_all_tiles_dirty(state->pf1_wide_layer); | |
| 501 | tilemap_set_scrolly( state->pf1_wide_layer,0, state->video_data[0xf00c/2]+392 ); | |
| 502 | tilemap_draw(bitmap,cliprect,state->pf1_wide_layer,0,0); | |
| 503 | tilemap_draw(bitmap,cliprect,state->pf1_wide_layer,1,1); | |
| 498 | 504 | } else { |
| 499 | tilemap_mark_all_tiles_dirty(pf1_layer); | |
| 500 | tilemap_set_scrolly( pf1_layer,0, m90_video_data[0xf00c/2]-116 ); | |
| 501 | tilemap_draw(bitmap,cliprect,pf1_layer,0,0); | |
| 502 | tilemap_draw(bitmap,cliprect,pf1_layer,1,1); | |
| 505 | tilemap_mark_all_tiles_dirty(state->pf1_layer); | |
| 506 | tilemap_set_scrolly( state->pf1_layer,0, state->video_data[0xf00c/2]-116 ); | |
| 507 | tilemap_draw(bitmap,cliprect,state->pf1_layer,0,0); | |
| 508 | tilemap_draw(bitmap,cliprect,state->pf1_layer,1,1); | |
| 503 | 509 | } |
| 504 | 510 | |
| 505 | 511 | bomblord_draw_sprites(screen->machine,bitmap,cliprect); |
| r10613 | r10614 | |
| 509 | 515 | |
| 510 | 516 | SCREEN_UPDATE( dynablsb ) |
| 511 | 517 | { |
| 518 | m90_state *state = screen->machine->driver_data<m90_state>(); | |
| 512 | 519 | bitmap_fill(screen->machine->priority_bitmap,cliprect,0); |
| 513 | 520 | bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine)); |
| 514 | 521 | |
| 515 | if (!(m90_video_data[0xf008/2] & 0x4000)) { | |
| 516 | tilemap_mark_all_tiles_dirty(pf1_wide_layer); | |
| 517 | tilemap_set_scroll_rows(pf1_wide_layer,1); | |
| 518 | tilemap_set_scrollx( pf1_wide_layer,0, m90_video_data[0xf004/2]+64); | |
| 519 | tilemap_set_scrolly( pf1_wide_layer,0, m90_video_data[0xf006/2]+512); | |
| 520 | tilemap_draw(bitmap,cliprect,pf1_wide_layer,0,0); | |
| 521 | tilemap_draw(bitmap,cliprect,pf1_wide_layer,1,1); | |
| 522 | if (!(state->video_data[0xf008/2] & 0x4000)) { | |
| 523 | tilemap_mark_all_tiles_dirty(state->pf1_wide_layer); | |
| 524 | tilemap_set_scroll_rows(state->pf1_wide_layer,1); | |
| 525 | tilemap_set_scrollx( state->pf1_wide_layer,0, state->video_data[0xf004/2]+64); | |
| 526 | tilemap_set_scrolly( state->pf1_wide_layer,0, state->video_data[0xf006/2]+512); | |
| 527 | tilemap_draw(bitmap,cliprect,state->pf1_wide_layer,0,0); | |
| 528 | tilemap_draw(bitmap,cliprect,state->pf1_wide_layer,1,1); | |
| 522 | 529 | } else { |
| 523 | tilemap_mark_all_tiles_dirty(pf1_layer); | |
| 524 | tilemap_set_scroll_rows(pf1_layer,1); | |
| 525 | tilemap_set_scrollx( pf1_layer,0, m90_video_data[0xf004/2]+64); | |
| 526 | tilemap_set_scrolly( pf1_layer,0, m90_video_data[0xf006/2]+4); | |
| 527 | tilemap_draw(bitmap,cliprect,pf1_layer,0,0); | |
| 528 | tilemap_draw(bitmap,cliprect,pf1_layer,1,1); | |
| 530 | tilemap_mark_all_tiles_dirty(state->pf1_layer); | |
| 531 | tilemap_set_scroll_rows(state->pf1_layer,1); | |
| 532 | tilemap_set_scrollx( state->pf1_layer,0, state->video_data[0xf004/2]+64); | |
| 533 | tilemap_set_scrolly( state->pf1_layer,0, state->video_data[0xf006/2]+4); | |
| 534 | tilemap_draw(bitmap,cliprect,state->pf1_layer,0,0); | |
| 535 | tilemap_draw(bitmap,cliprect,state->pf1_layer,1,1); | |
| 529 | 536 | } |
| 530 | 537 | |
| 531 | if (!(m90_video_data[0xf008/2] & 0x8000)) { | |
| 532 | tilemap_mark_all_tiles_dirty(pf2_wide_layer); | |
| 533 | tilemap_set_scroll_rows(pf2_wide_layer,1); | |
| 534 | tilemap_set_scrollx( pf2_wide_layer,0, m90_video_data[0xf000/2]+68); | |
| 535 | tilemap_set_scrolly( pf2_wide_layer,0, m90_video_data[0xf002/2]+512); | |
| 536 | tilemap_draw(bitmap,cliprect,pf2_wide_layer,0,0); | |
| 537 | tilemap_draw(bitmap,cliprect,pf2_wide_layer,1,1); | |
| 538 | if (!(state->video_data[0xf008/2] & 0x8000)) { | |
| 539 | tilemap_mark_all_tiles_dirty(state->pf2_wide_layer); | |
| 540 | tilemap_set_scroll_rows(state->pf2_wide_layer,1); | |
| 541 | tilemap_set_scrollx( state->pf2_wide_layer,0, state->video_data[0xf000/2]+68); | |
| 542 | tilemap_set_scrolly( state->pf2_wide_layer,0, state->video_data[0xf002/2]+512); | |
| 543 | tilemap_draw(bitmap,cliprect,state->pf2_wide_layer,0,0); | |
| 544 | tilemap_draw(bitmap,cliprect,state->pf2_wide_layer,1,1); | |
| 538 | 545 | } else { |
| 539 | tilemap_mark_all_tiles_dirty(pf2_layer); | |
| 540 | tilemap_set_scroll_rows(pf2_layer,1); | |
| 541 | tilemap_set_scrollx( pf2_layer,0, m90_video_data[0xf000/2]+68); | |
| 542 | tilemap_set_scrolly( pf2_layer,0, m90_video_data[0xf002/2]+4); | |
| 543 | tilemap_draw(bitmap,cliprect,pf2_layer,0,0); | |
| 544 | tilemap_draw(bitmap,cliprect,pf2_layer,1,1); | |
| 546 | tilemap_mark_all_tiles_dirty(state->pf2_layer); | |
| 547 | tilemap_set_scroll_rows(state->pf2_layer,1); | |
| 548 | tilemap_set_scrollx( state->pf2_layer,0, state->video_data[0xf000/2]+68); | |
| 549 | tilemap_set_scrolly( state->pf2_layer,0, state->video_data[0xf002/2]+4); | |
| 550 | tilemap_draw(bitmap,cliprect,state->pf2_layer,0,0); | |
| 551 | tilemap_draw(bitmap,cliprect,state->pf2_layer,1,1); | |
| 545 | 552 | } |
| 546 | 553 | |
| 547 | 554 | dynablsb_draw_sprites(screen->machine,bitmap,cliprect); |
| r10613 | r10614 | |
|---|---|---|
| 2 | 2 | #include "video/ppu2c0x.h" |
| 3 | 3 | #include "includes/playch10.h" |
| 4 | 4 | |
| 5 | static int pc10_bios; | |
| 6 | 5 | |
| 7 | static tilemap_t *bg_tilemap; | |
| 8 | 6 | |
| 9 | 7 | WRITE8_HANDLER( playch10_videoram_w ) |
| 10 | 8 | { |
| 11 | 9 | playch10_state *state = space->machine->driver_data<playch10_state>(); |
| 12 | 10 | UINT8 *videoram = state->videoram; |
| 13 | if (pc10_sdcs) | |
| 11 | if (state->pc10_sdcs) | |
| 14 | 12 | { |
| 15 | 13 | videoram[offset] = data; |
| 16 | tilemap_mark_tile_dirty(bg_tilemap, offset / 2); | |
| 14 | tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2); | |
| 17 | 15 | } |
| 18 | 16 | } |
| 19 | 17 | |
| r10613 | r10614 | |
| 61 | 59 | |
| 62 | 60 | static void ppu_irq( device_t *device, int *ppu_regs ) |
| 63 | 61 | { |
| 62 | playch10_state *state = device->machine->driver_data<playch10_state>(); | |
| 64 | 63 | cputag_set_input_line(device->machine, "cart", INPUT_LINE_NMI, PULSE_LINE ); |
| 65 | pc10_int_detect = 1; | |
| 64 | state->pc10_int_detect = 1; | |
| 66 | 65 | } |
| 67 | 66 | |
| 68 | 67 | /* our ppu interface */ |
| r10613 | r10614 | |
| 98 | 97 | |
| 99 | 98 | VIDEO_START( playch10 ) |
| 100 | 99 | { |
| 100 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 101 | 101 | const UINT8 *bios = machine->region("maincpu")->base(); |
| 102 | pc10_bios = (bios[3] == 0x2a) ? 1 : 2; | |
| 102 | state->pc10_bios = (bios[3] == 0x2a) ? 1 : 2; | |
| 103 | 103 | |
| 104 | bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, | |
| 104 | state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, | |
| 105 | 105 | 8, 8, 32, 32); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | VIDEO_START( playch10_hboard ) |
| 109 | 109 | { |
| 110 | playch10_state *state = machine->driver_data<playch10_state>(); | |
| 110 | 111 | const UINT8 *bios = machine->region("maincpu")->base(); |
| 111 | pc10_bios = (bios[3] == 0x2a) ? 1 : 2; | |
| 112 | state->pc10_bios = (bios[3] == 0x2a) ? 1 : 2; | |
| 112 | 113 | |
| 113 | bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, | |
| 114 | state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, | |
| 114 | 115 | 8, 8, 32, 32); |
| 115 | 116 | } |
| 116 | 117 | |
| r10613 | r10614 | |
| 122 | 123 | |
| 123 | 124 | SCREEN_UPDATE( playch10 ) |
| 124 | 125 | { |
| 126 | playch10_state *state = screen->machine->driver_data<playch10_state>(); | |
| 125 | 127 | device_t *ppu = screen->machine->device("ppu"); |
| 126 | 128 | |
| 127 | 129 | /* Dual monitor version */ |
| 128 | if (pc10_bios == 1) | |
| 130 | if (state->pc10_bios == 1) | |
| 129 | 131 | { |
| 130 | 132 | device_t *top_screen = screen->machine->device("top"); |
| 131 | 133 | |
| r10613 | r10614 | |
| 137 | 139 | |
| 138 | 140 | if (screen == top_screen) |
| 139 | 141 | { |
| 140 | if ( !pc10_dispmask ) | |
| 142 | if ( !state->pc10_dispmask ) | |
| 141 | 143 | /* render the ppu */ |
| 142 | 144 | ppu2c0x_render( ppu, bitmap, 0, 0, 0, 0 ); |
| 143 | 145 | else |
| r10613 | r10614 | |
| 147 | 149 | { |
| 148 | 150 | /* When the bios is accessing vram, the video circuitry can't access it */ |
| 149 | 151 | |
| 150 | if ( !pc10_sdcs ) | |
| 151 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); | |
| 152 | if ( !state->pc10_sdcs ) | |
| 153 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 152 | 154 | else |
| 153 | 155 | bitmap_fill(bitmap, cliprect, 0); |
| 154 | 156 | } |
| r10613 | r10614 | |
| 159 | 161 | |
| 160 | 162 | top_monitor.max_y = ( top_monitor.max_y - top_monitor.min_y ) / 2; |
| 161 | 163 | |
| 162 | if(pc10_dispmask_old != pc10_dispmask) | |
| 164 | if(state->pc10_dispmask_old != state->pc10_dispmask) | |
| 163 | 165 | { |
| 164 | pc10_dispmask_old = pc10_dispmask; | |
| 166 | state->pc10_dispmask_old = state->pc10_dispmask; | |
| 165 | 167 | |
| 166 | if(pc10_dispmask) | |
| 167 | pc10_game_mode ^= 1; | |
| 168 | if(state->pc10_dispmask) | |
| 169 | state->pc10_game_mode ^= 1; | |
| 168 | 170 | } |
| 169 | 171 | |
| 170 | if ( pc10_game_mode ) | |
| 172 | if ( state->pc10_game_mode ) | |
| 171 | 173 | /* render the ppu */ |
| 172 | 174 | ppu2c0x_render( ppu, bitmap, 0, 0, 0, 0 ); |
| 173 | 175 | else |
| 174 | 176 | { |
| 175 | 177 | /* When the bios is accessing vram, the video circuitry can't access it */ |
| 176 | if ( !pc10_sdcs ) | |
| 177 | tilemap_draw(bitmap, &top_monitor, bg_tilemap, 0, 0); | |
| 178 | if ( !state->pc10_sdcs ) | |
| 179 | tilemap_draw(bitmap, &top_monitor, state->bg_tilemap, 0, 0); | |
| 178 | 180 | } |
| 179 | 181 | } |
| 180 | 182 | return 0; |
| r10613 | r10614 | |
|---|---|---|
| 2353 | 2353 | |
| 2354 | 2354 | static void print_mixer_data(segas32_state *state, int which) |
| 2355 | 2355 | { |
| 2356 | static int count = 0; | |
| 2357 | if (++count > 60 * 5) | |
| 2356 | if (++state->print_count > 60 * 5) | |
| 2358 | 2357 | { |
| 2359 | 2358 | mame_printf_debug("\n"); |
| 2360 | 2359 | mame_printf_debug("OP: %04X\n", state->system32_videoram[0x1ff8e/2]); |
| r10613 | r10614 | |
| 2418 | 2417 | state->mixer_control[which][0x2d], |
| 2419 | 2418 | state->mixer_control[which][0x2e], |
| 2420 | 2419 | state->mixer_control[which][0x2f]); |
| 2421 | count = 0; | |
| 2420 | state->print_count = 0; | |
| 2422 | 2421 | } |
| 2423 | 2422 | } |
| 2424 | 2423 |
| r10613 | r10614 | |
|---|---|---|
| 12 | 12 | #include "includes/gomoku.h" |
| 13 | 13 | |
| 14 | 14 | |
| 15 | static int gomoku_flipscreen; | |
| 16 | static int gomoku_bg_dispsw; | |
| 17 | static tilemap_t *fg_tilemap; | |
| 18 | static bitmap_t *gomoku_bg_bitmap; | |
| 19 | ||
| 20 | UINT8 *gomoku_videoram; | |
| 21 | UINT8 *gomoku_colorram; | |
| 22 | UINT8 *gomoku_bgram; | |
| 23 | ||
| 24 | ||
| 25 | 15 | /****************************************************************************** |
| 26 | 16 | |
| 27 | 17 | palette RAM |
| r10613 | r10614 | |
| 65 | 55 | |
| 66 | 56 | static TILE_GET_INFO( get_fg_tile_info ) |
| 67 | 57 | { |
| 68 | int code = (gomoku_videoram[tile_index]); | |
| 69 | int attr = (gomoku_colorram[tile_index]); | |
| 58 | gomoku_state *state = machine->driver_data<gomoku_state>(); | |
| 59 | int code = (state->videoram[tile_index]); | |
| 60 | int attr = (state->colorram[tile_index]); | |
| 70 | 61 | int color = (attr& 0x0f); |
| 71 | 62 | int flipyx = (attr & 0xc0) >> 6; |
| 72 | 63 | |
| r10613 | r10614 | |
| 79 | 70 | |
| 80 | 71 | WRITE8_HANDLER( gomoku_videoram_w ) |
| 81 | 72 | { |
| 82 | gomoku_videoram[offset] = data; | |
| 83 | tilemap_mark_tile_dirty(fg_tilemap,offset); | |
| 73 | gomoku_state *state = space->machine->driver_data<gomoku_state>(); | |
| 74 | state->videoram[offset] = data; | |
| 75 | tilemap_mark_tile_dirty(state->fg_tilemap,offset); | |
| 84 | 76 | } |
| 85 | 77 | |
| 86 | 78 | WRITE8_HANDLER( gomoku_colorram_w ) |
| 87 | 79 | { |
| 88 | gomoku_colorram[offset] = data; | |
| 89 | tilemap_mark_tile_dirty(fg_tilemap,offset); | |
| 80 | gomoku_state *state = space->machine->driver_data<gomoku_state>(); | |
| 81 | state->colorram[offset] = data; | |
| 82 | tilemap_mark_tile_dirty(state->fg_tilemap,offset); | |
| 90 | 83 | } |
| 91 | 84 | |
| 92 | 85 | WRITE8_HANDLER( gomoku_bgram_w ) |
| 93 | 86 | { |
| 94 | gomoku_bgram[offset] = data; | |
| 87 | gomoku_state *state = space->machine->driver_data<gomoku_state>(); | |
| 88 | state->bgram[offset] = data; | |
| 95 | 89 | } |
| 96 | 90 | |
| 97 | 91 | WRITE8_HANDLER( gomoku_flipscreen_w ) |
| 98 | 92 | { |
| 99 | gomoku_flipscreen = (data & 0x02) ? 0 : 1; | |
| 93 | gomoku_state *state = space->machine->driver_data<gomoku_state>(); | |
| 94 | state->flipscreen = (data & 0x02) ? 0 : 1; | |
| 100 | 95 | } |
| 101 | 96 | |
| 102 | 97 | WRITE8_HANDLER( gomoku_bg_dispsw_w ) |
| 103 | 98 | { |
| 104 | gomoku_bg_dispsw = (data & 0x02) ? 0 : 1; | |
| 99 | gomoku_state *state = space->machine->driver_data<gomoku_state>(); | |
| 100 | state->bg_dispsw = (data & 0x02) ? 0 : 1; | |
| 105 | 101 | } |
| 106 | 102 | |
| 107 | 103 | |
| r10613 | r10614 | |
| 113 | 109 | |
| 114 | 110 | VIDEO_START( gomoku ) |
| 115 | 111 | { |
| 112 | gomoku_state *state = machine->driver_data<gomoku_state>(); | |
| 116 | 113 | UINT8 *GOMOKU_BG_X = machine->region( "user1" )->base(); |
| 117 | 114 | UINT8 *GOMOKU_BG_Y = machine->region( "user2" )->base(); |
| 118 | 115 | UINT8 *GOMOKU_BG_D = machine->region( "user3" )->base(); |
| r10613 | r10614 | |
| 120 | 117 | int bgdata; |
| 121 | 118 | int color; |
| 122 | 119 | |
| 123 | | |
| 120 | state->bg_bitmap = machine->primary_screen->alloc_compatible_bitmap(); | |
| 124 | 121 | |
| 125 | fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,32, 32); | |
| 122 | state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,32, 32); | |
| 126 | 123 | |
| 127 | tilemap_set_transparent_pen(fg_tilemap,0); | |
| 124 | tilemap_set_transparent_pen(state->fg_tilemap,0); | |
| 128 | 125 | |
| 129 | 126 | /* make background bitmap */ |
| 130 | bitmap_fill( | |
| 127 | bitmap_fill(state->bg_bitmap, 0, 0x20); | |
| 131 | 128 | |
| 132 | 129 | // board |
| 133 | 130 | for (y = 0; y < 256; y++) |
| r10613 | r10614 | |
| 141 | 138 | if (bgdata & 0x01) color = 0x21; // board (brown) |
| 142 | 139 | if (bgdata & 0x02) color = 0x20; // frame line (while) |
| 143 | 140 | |
| 144 | *BITMAP_ADDR16( | |
| 141 | *BITMAP_ADDR16(state->bg_bitmap, (255 - y - 1) & 0xff, (255 - x + 7) & 0xff) = color; | |
| 145 | 142 | } |
| 146 | 143 | } |
| 147 | 144 | } |
| r10613 | r10614 | |
| 155 | 152 | |
| 156 | 153 | SCREEN_UPDATE( gomoku ) |
| 157 | 154 | { |
| 155 | gomoku_state *state = screen->machine->driver_data<gomoku_state>(); | |
| 158 | 156 | UINT8 *GOMOKU_BG_X = screen->machine->region( "user1" )->base(); |
| 159 | 157 | UINT8 *GOMOKU_BG_Y = screen->machine->region( "user2" )->base(); |
| 160 | 158 | UINT8 *GOMOKU_BG_D = screen->machine->region( "user3" )->base(); |
| r10613 | r10614 | |
| 165 | 163 | int color; |
| 166 | 164 | |
| 167 | 165 | /* draw background layer */ |
| 168 | if ( | |
| 166 | if (state->bg_dispsw) | |
| 169 | 167 | { |
| 170 | 168 | /* copy bg bitmap */ |
| 171 | copybitmap(bitmap, | |
| 169 | copybitmap(bitmap, state->bg_bitmap, 0, 0, 0, 0, cliprect); | |
| 172 | 170 | |
| 173 | 171 | // stone |
| 174 | 172 | for (y = 0; y < 256; y++) |
| r10613 | r10614 | |
| 178 | 176 | bgoffs = ((((255 - x - 2) / 14) | (((255 - y - 10) / 14) << 4)) & 0xff); |
| 179 | 177 | |
| 180 | 178 | bgdata = GOMOKU_BG_D[ GOMOKU_BG_X[x] + (GOMOKU_BG_Y[y] << 4) ]; |
| 181 | bgram = | |
| 179 | bgram = state->bgram[bgoffs]; | |
| 182 | 180 | |
| 183 | 181 | if (bgdata & 0x04) |
| 184 | 182 | { |
| r10613 | r10614 | |
| 206 | 204 | bgoffs = ((((255 - x - 2) / 14) | (((255 - y - 10) / 14) << 4)) & 0xff); |
| 207 | 205 | |
| 208 | 206 | bgdata = GOMOKU_BG_D[ GOMOKU_BG_X[x] + (GOMOKU_BG_Y[y] << 4) ]; |
| 209 | bgram = | |
| 207 | bgram = state->bgram[bgoffs]; | |
| 210 | 208 | |
| 211 | 209 | if (bgdata & 0x08) |
| 212 | 210 | { |
| r10613 | r10614 | |
| 231 | 229 | bitmap_fill(bitmap, 0, 0x20); |
| 232 | 230 | } |
| 233 | 231 | |
| 234 | tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); | |
| 232 | tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0); | |
| 235 | 233 | return 0; |
| 236 | 234 | } |
| r10613 | r10614 | |
|---|---|---|
| 11 | 11 | #include "video/resnet.h" |
| 12 | 12 | |
| 13 | 13 | |
| 14 | UINT8 *tubep_textram; | |
| 15 | UINT8 *rjammer_backgroundram; | |
| 16 | UINT8 *tubep_backgroundram; | |
| 17 | UINT8 *tubep_sprite_colorsharedram; | |
| 18 | ||
| 19 | static UINT8 *spritemap; | |
| 20 | static UINT8 prom2[32]; | |
| 21 | ||
| 22 | /* Globals */ | |
| 23 | /*static UINT8 graph_ctrl[10];*/ | |
| 24 | static UINT32 romD_addr =0; | |
| 25 | static UINT32 romEF_addr =0; | |
| 26 | static UINT32 E16_add_b = 0; | |
| 27 | static UINT32 HINV = 0; | |
| 28 | static UINT32 VINV = 0; | |
| 29 | static UINT32 XSize = 0; | |
| 30 | static UINT32 YSize = 0; | |
| 31 | static UINT32 mark_1 = 0; | |
| 32 | static UINT32 mark_2 = 0; | |
| 33 | static UINT32 colorram_addr_hi = 0; | |
| 34 | static UINT32 ls273_g6 = 0; | |
| 35 | static UINT32 ls273_j6 = 0; | |
| 36 | static UINT32 romHI_addr_mid = 0; | |
| 37 | static UINT32 romHI_addr_msb = 0; | |
| 38 | static UINT8 DISP = 0; | |
| 39 | static UINT8 background_romsel = 0; | |
| 40 | static UINT8 color_A4 = 0; | |
| 41 | static UINT8 ls175_b7; | |
| 42 | static UINT8 ls175_e8; | |
| 43 | static UINT8 ls377_data = 0; | |
| 44 | static UINT32 page = 0; | |
| 45 | ||
| 46 | ||
| 47 | ||
| 48 | 14 | /*************************************************************************** |
| 49 | 15 | |
| 50 | 16 | Convert the color PROMs into a more useable format. |
| r10613 | r10614 | |
| 167 | 133 | |
| 168 | 134 | PALETTE_INIT( tubep ) |
| 169 | 135 | { |
| 136 | tubep_state *state = machine->driver_data<tubep_state>(); | |
| 170 | 137 | int i,r,g,b; |
| 171 | 138 | |
| 172 | 139 | /* background/sprites palette variables */ |
| r10613 | r10614 | |
| 230 | 197 | /* sprites use the second PROM to control 8 x LS368. We copy content of this PROM over here */ |
| 231 | 198 | for (i = 0; i < 32; i++) |
| 232 | 199 | { |
| 233 | prom2[i] = *color_prom; | |
| 200 | state->prom2[i] = *color_prom; | |
| 234 | 201 | color_prom++; |
| 235 | 202 | } |
| 236 | 203 | |
| r10613 | r10614 | |
| 371 | 338 | |
| 372 | 339 | VIDEO_START( tubep ) |
| 373 | 340 | { |
| 374 | spritemap = auto_alloc_array(machine, UINT8, 256*256*2); | |
| 341 | tubep_state *state = machine->driver_data<tubep_state>(); | |
| 342 | state->spritemap = auto_alloc_array(machine, UINT8, 256*256*2); | |
| 375 | 343 | |
| 376 | 344 | /* Set up save state */ |
| 377 | state_save_register_global(machine, romD_addr); | |
| 378 | state_save_register_global(machine, romEF_addr); | |
| 379 | state_save_register_global(machine, E16_add_b); | |
| 380 | state_save_register_global(machine, HINV); | |
| 381 | state_save_register_global(machine, VINV); | |
| 382 | state_save_register_global(machine, XSize); | |
| 383 | state_save_register_global(machine, YSize); | |
| 384 | state_save_register_global(machine, mark_1); | |
| 385 | state_save_register_global(machine, mark_2); | |
| 386 | state_save_register_global(machine, colorram_addr_hi); | |
| 387 | state_save_register_global(machine, ls273_g6); | |
| 388 | state_save_register_global(machine, ls273_j6); | |
| 389 | state_save_register_global(machine, romHI_addr_mid); | |
| 390 | state_save_register_global(machine, romHI_addr_msb); | |
| 391 | state_save_register_global(machine, DISP); | |
| 392 | state_save_register_global(machine, background_romsel); | |
| 393 | state_save_register_global(machine, color_A4); | |
| 394 | state_save_register_global(machine, ls175_b7); | |
| 395 | state_save_register_global(machine, ls175_e8); | |
| 396 | state_save_register_global(machine, ls377_data); | |
| 397 | state_save_register_global(machine, page); | |
| 345 | state_save_register_global(machine, state->romD_addr); | |
| 346 | state_save_register_global(machine, state->romEF_addr); | |
| 347 | state_save_register_global(machine, state->E16_add_b); | |
| 348 | state_save_register_global(machine, state->HINV); | |
| 349 | state_save_register_global(machine, state->VINV); | |
| 350 | state_save_register_global(machine, state->XSize); | |
| 351 | state_save_register_global(machine, state->YSize); | |
| 352 | state_save_register_global(machine, state->mark_1); | |
| 353 | state_save_register_global(machine, state->mark_2); | |
| 354 | state_save_register_global(machine, state->colorram_addr_hi); | |
| 355 | state_save_register_global(machine, state->ls273_g6); | |
| 356 | state_save_register_global(machine, state->ls273_j6); | |
| 357 | state_save_register_global(machine, state->romHI_addr_mid); | |
| 358 | state_save_register_global(machine, state->romHI_addr_msb); | |
| 359 | state_save_register_global(machine, state->DISP); | |
| 360 | state_save_register_global(machine, state->background_romsel); | |
| 361 | state_save_register_global(machine, state->color_A4); | |
| 362 | state_save_register_global(machine, state->ls175_b7); | |
| 363 | state_save_register_global(machine, state->ls175_e8); | |
| 364 | state_save_register_global(machine, state->ls377_data); | |
| 365 | state_save_register_global(machine, state->page); | |
| 398 | 366 | } |
| 399 | 367 | |
| 400 | 368 | |
| 401 | 369 | VIDEO_RESET( tubep ) |
| 402 | 370 | { |
| 403 | memset(spritemap,0,256*256*2); | |
| 371 | tubep_state *state = machine->driver_data<tubep_state>(); | |
| 372 | memset(state->spritemap,0,256*256*2); | |
| 404 | 373 | |
| 405 | romD_addr = 0; | |
| 406 | romEF_addr = 0; | |
| 407 | E16_add_b = 0; | |
| 408 | HINV = 0; | |
| 409 | VINV = 0; | |
| 410 | XSize = 0; | |
| 411 | YSize = 0; | |
| 412 | mark_1 = 0; | |
| 413 | mark_2 = 0; | |
| 414 | colorram_addr_hi = 0; | |
| 415 | ls273_g6 = 0; | |
| 416 | ls273_j6 = 0; | |
| 417 | romHI_addr_mid = 0; | |
| 418 | romHI_addr_msb = 0; | |
| 419 | DISP = 0; | |
| 420 | background_romsel = 0; | |
| 421 | color_A4 = 0; | |
| 422 | ls175_b7 = 0x0f | 0xf0; | |
| 423 | ls175_e8 = 0x0f; | |
| 424 | ls377_data = 0; | |
| 425 | page = 0; | |
| 374 | state->romD_addr = 0; | |
| 375 | state->romEF_addr = 0; | |
| 376 | state->E16_add_b = 0; | |
| 377 | state->HINV = 0; | |
| 378 | state->VINV = 0; | |
| 379 | state->XSize = 0; | |
| 380 | state->YSize = 0; | |
| 381 | state->mark_1 = 0; | |
| 382 | state->mark_2 = 0; | |
| 383 | state->colorram_addr_hi = 0; | |
| 384 | state->ls273_g6 = 0; | |
| 385 | state->ls273_j6 = 0; | |
| 386 | state->romHI_addr_mid = 0; | |
| 387 | state->romHI_addr_msb = 0; | |
| 388 | state->DISP = 0; | |
| 389 | state->background_romsel = 0; | |
| 390 | state->color_A4 = 0; | |
| 391 | state->ls175_b7 = 0x0f | 0xf0; | |
| 392 | state->ls175_e8 = 0x0f; | |
| 393 | state->ls377_data = 0; | |
| 394 | state->page = 0; | |
| 426 | 395 | } |
| 427 | 396 | |
| 428 | 397 | |
| 429 | 398 | WRITE8_HANDLER( tubep_textram_w ) |
| 430 | 399 | { |
| 431 | tubep_textram[offset] = data; | |
| 400 | tubep_state *state = space->machine->driver_data<tubep_state>(); | |
| 401 | state->textram[offset] = data; | |
| 432 | 402 | } |
| 433 | 403 | |
| 434 | 404 | |
| 435 | 405 | WRITE8_HANDLER( tubep_background_romselect_w ) |
| 436 | 406 | { |
| 437 | background_romsel = data & 1; | |
| 407 | tubep_state *state = space->machine->driver_data<tubep_state>(); | |
| 408 | state->background_romsel = data & 1; | |
| 438 | 409 | } |
| 439 | 410 | |
| 440 | 411 | |
| 441 | 412 | WRITE8_HANDLER( tubep_colorproms_A4_line_w ) |
| 442 | 413 | { |
| 443 | color_A4 = (data & 1)<<4; | |
| 414 | tubep_state *state = space->machine->driver_data<tubep_state>(); | |
| 415 | state->color_A4 = (data & 1)<<4; | |
| 444 | 416 | } |
| 445 | 417 | |
| 446 | 418 | |
| 447 | 419 | WRITE8_HANDLER( tubep_background_a000_w ) |
| 448 | 420 | { |
| 449 | ls175_b7 = ((data & 0x0f) ^ 0x0f) | 0xf0; | |
| 421 | tubep_state *state = space->machine->driver_data<tubep_state>(); | |
| 422 | state->ls175_b7 = ((data & 0x0f) ^ 0x0f) | 0xf0; | |
| 450 | 423 | } |
| 451 | 424 | |
| 452 | 425 | |
| 453 | 426 | WRITE8_HANDLER( tubep_background_c000_w ) |
| 454 | 427 | { |
| 455 | ls175_e8 = ((data & 0x0f) ^ 0x0f); | |
| 428 | tubep_state *state = space->machine->driver_data<tubep_state>(); | |
| 429 | state->ls175_e8 = ((data & 0x0f) ^ 0x0f); | |
| 456 | 430 | } |
| 457 | 431 | |
| 458 | 432 | |
| r10613 | r10614 | |
| 464 | 438 | |
| 465 | 439 | static void draw_sprite(running_machine *machine) |
| 466 | 440 | { |
| 441 | tubep_state *state = machine->driver_data<tubep_state>(); | |
| 467 | 442 | UINT32 XDOT; |
| 468 | 443 | UINT32 YDOT; |
| 469 | 444 | UINT8 * romCxx = machine->region("user2")->base()+0x00000; |
| r10613 | r10614 | |
| 472 | 447 | UINT8 * romHI2 = romCxx+0x14000; |
| 473 | 448 | |
| 474 | 449 | |
| 475 | for (YDOT=0; (YDOT^YSize) != 0x00; YDOT++) | |
| 450 | for (YDOT=0; (YDOT^state->YSize) != 0x00; YDOT++) | |
| 476 | 451 | { |
| 477 | 452 | /* upper part of the schematic */ |
| 478 | UINT32 ls273_e12 = romD10[ romD_addr | YDOT ] & 0x7f; | |
| 479 | UINT32 romEF_addr_now = romEF_addr | ls273_e12; | |
| 453 | UINT32 ls273_e12 = romD10[ state->romD_addr | YDOT ] & 0x7f; | |
| 454 | UINT32 romEF_addr_now = state->romEF_addr | ls273_e12; | |
| 480 | 455 | UINT32 E16_add_a = romEF13[ romEF_addr_now ] | |
| 481 | 456 | ((romEF13[0x1000 + romEF_addr_now ]&0x0f)<<8); |
| 482 | UINT32 F16_add_b = E16_add_a + E16_add_b; | |
| 457 | UINT32 F16_add_b = E16_add_a + state->E16_add_b; | |
| 483 | 458 | |
| 484 | 459 | /* lower part of the schematic */ |
| 485 | UINT32 romHI_addr = (YDOT) | (romHI_addr_mid) | (((romHI_addr_msb + 0x800) )&0x1800); | |
| 460 | UINT32 romHI_addr = (YDOT) | (state->romHI_addr_mid) | (((state->romHI_addr_msb + 0x800) )&0x1800); | |
| 486 | 461 | UINT32 ls273_g4 = romHI2[ romHI_addr ]; |
| 487 | 462 | UINT32 ls273_j4 = romHI2[0x2000+ romHI_addr ]; |
| 488 | UINT32 ls86_gh5 = ls273_g4 ^ VINV; | |
| 489 | UINT32 ls86_ij5 = ls273_j4 ^ VINV; | |
| 463 | UINT32 ls86_gh5 = ls273_g4 ^ state->VINV; | |
| 464 | UINT32 ls86_ij5 = ls273_j4 ^ state->VINV; | |
| 490 | 465 | |
| 491 | UINT32 ls157_gh7= ls273_g6 | (mark_2); | |
| 492 | UINT32 ls157_ij7= ls273_j6 | (mark_1); | |
| 493 | UINT32 ls283_gh8= (VINV & 1) + ls86_gh5 + ((ls86_gh5 & 0x80)<<1) + ls157_gh7; | |
| 494 | UINT32 ls283_ij8= (VINV & 1) + ls86_ij5 + ((ls86_ij5 & 0x80)<<1) + ls157_ij7; | |
| 466 | UINT32 ls157_gh7= state->ls273_g6 | (state->mark_2); | |
| 467 | UINT32 ls157_ij7= state->ls273_j6 | (state->mark_1); | |
| 468 | UINT32 ls283_gh8= (state->VINV & 1) + ls86_gh5 + ((ls86_gh5 & 0x80)<<1) + ls157_gh7; | |
| 469 | UINT32 ls283_ij8= (state->VINV & 1) + ls86_ij5 + ((ls86_ij5 & 0x80)<<1) + ls157_ij7; | |
| 495 | 470 | |
| 496 | 471 | UINT32 ls273_g9 = ls283_gh8; |
| 497 | 472 | UINT32 ls273_j9 = ls283_ij8; |
| 498 | 473 | |
| 499 | for (XDOT=0; (XDOT^XSize) != 0x00; XDOT++) | |
| 474 | for (XDOT=0; (XDOT^state->XSize) != 0x00; XDOT++) | |
| 500 | 475 | { |
| 501 | 476 | /* upper part of the schematic */ |
| 502 | UINT32 romD10_out = romD10[ romD_addr | XDOT ]; | |
| 477 | UINT32 romD10_out = romD10[ state->romD_addr | XDOT ]; | |
| 503 | 478 | UINT32 F16_add_a = (romD10_out & 0x7e) >>1; |
| 504 | 479 | UINT32 romCxx_addr = (F16_add_a + F16_add_b ) & 0xffff; |
| 505 | 480 | UINT32 romCxx_out = romCxx[ romCxx_addr ]; |
| 506 | 481 | |
| 507 | 482 | UINT32 colorram_addr_lo = (romD10_out&1) ? (romCxx_out>>4)&0x0f: (romCxx_out>>0)&0x0f; |
| 508 | 483 | |
| 509 | UINT8 sp_data = t | |
| 484 | UINT8 sp_data = state->sprite_colorsharedram[ state->colorram_addr_hi | colorram_addr_lo ] & 0x0f; /* 2114 4-bit RAM */ | |
| 510 | 485 | |
| 511 | 486 | /* lower part of the schematic */ |
| 512 | romHI_addr = (XDOT) | (romHI_addr_mid) | (romHI_addr_msb); | |
| 487 | romHI_addr = (XDOT) | (state->romHI_addr_mid) | (state->romHI_addr_msb); | |
| 513 | 488 | ls273_g4 = romHI2[ romHI_addr ]; |
| 514 | 489 | ls273_j4 = romHI2[0x2000+ romHI_addr ]; |
| 515 | ls86_gh5 = ls273_g4 ^ HINV; | |
| 516 | ls86_ij5 = ls273_j4 ^ HINV; | |
| 490 | ls86_gh5 = ls273_g4 ^ state->HINV; | |
| 491 | ls86_ij5 = ls273_j4 ^ state->HINV; | |
| 517 | 492 | |
| 518 | 493 | ls157_gh7= ls273_g9; |
| 519 | 494 | ls157_ij7= ls273_j9; |
| 520 | ls283_gh8= (HINV & 1) + ls86_gh5 + ((ls86_gh5 & 0x80)<<1) + ls157_gh7; | |
| 521 | ls283_ij8= (HINV & 1) + ls86_ij5 + ((ls86_ij5 & 0x80)<<1) + ls157_ij7; | |
| 495 | ls283_gh8= (state->HINV & 1) + ls86_gh5 + ((ls86_gh5 & 0x80)<<1) + ls157_gh7; | |
| 496 | ls283_ij8= (state->HINV & 1) + ls86_ij5 + ((ls86_ij5 & 0x80)<<1) + ls157_ij7; | |
| 522 | 497 | |
| 523 | 498 | |
| 524 | 499 | if ( !((ls283_gh8&256) | (ls283_ij8&256)) ) /* skip wrapped sprite area - PAL12L6 (PLA019 in Roller Jammer schematics)*/ |
| 525 | 500 | { |
| 526 | if ( spritemap[ (ls283_gh8&255) + (ls283_ij8&255)*256 + DISP*256*256 ] == 0x0f ) | |
| 527 | spritemap[ (ls283_gh8&255) + (ls283_ij8&255)*256 + DISP*256*256 ] = sp_data; | |
| 501 | if ( state->spritemap[ (ls283_gh8&255) + (ls283_ij8&255)*256 + state->DISP*256*256 ] == 0x0f ) | |
| 502 | state->spritemap[ (ls283_gh8&255) + (ls283_ij8&255)*256 + state->DISP*256*256 ] = sp_data; | |
| 528 | 503 | } |
| 529 | 504 | } |
| 530 | 505 | } |
| r10613 | r10614 | |
| 533 | 508 | |
| 534 | 509 | WRITE8_HANDLER( tubep_sprite_control_w ) |
| 535 | 510 | { |
| 511 | tubep_state *state = space->machine->driver_data<tubep_state>(); | |
| 536 | 512 | if (offset < 10) |
| 537 | 513 | { |
| 538 | 514 | /*graph_ctrl[offset] = data;*/ |
| 539 | 515 | switch(offset) |
| 540 | 516 | { |
| 541 | 517 | case 0: /*a*/ |
| 542 | romEF_addr = (0x010 | (data & 0x0f))<<7; /*roms @F13, @E13 have A11 lines connected to +5V directly */ | |
| 543 | HINV = (data & 0x10) ? 0xff: 0x00; | |
| 544 | VINV = (data & 0x20) ? 0xff: 0x00; | |
| 518 | state->romEF_addr = (0x010 | (data & 0x0f))<<7; /*roms @F13, @E13 have A11 lines connected to +5V directly */ | |
| 519 | state->HINV = (data & 0x10) ? 0xff: 0x00; | |
| 520 | state->VINV = (data & 0x20) ? 0xff: 0x00; | |
| 545 | 521 | break; |
| 546 | 522 | |
| 547 | 523 | case 1: /*b: XSize-1 */ |
| 548 | XSize = data & 0x7f; | |
| 549 | mark_2 = (data&0x80)<<1; | |
| 524 | state->XSize = data & 0x7f; | |
| 525 | state->mark_2 = (data&0x80)<<1; | |
| 550 | 526 | break; |
| 551 | 527 | |
| 552 | 528 | case 2: /*c: YSize-1 */ |
| 553 | YSize = data & 0x7f; | |
| 554 | mark_1 = (data&0x80)<<1; | |
| 529 | state->YSize = data & 0x7f; | |
| 530 | state->mark_1 = (data&0x80)<<1; | |
| 555 | 531 | break; |
| 556 | 532 | |
| 557 | 533 | case 3: /*d*/ |
| 558 | ls273_g6 = (data & 0xff); | |
| 534 | state->ls273_g6 = (data & 0xff); | |
| 559 | 535 | break; |
| 560 | 536 | |
| 561 | 537 | case 4: /*e*/ |
| 562 | ls273_j6 = (data & 0xff); | |
| 538 | state->ls273_j6 = (data & 0xff); | |
| 563 | 539 | break; |
| 564 | 540 | |
| 565 | 541 | case 5: /*f*/ |
| 566 | romHI_addr_mid = (data & 0x0f)<<7; | |
| 567 | romHI_addr_msb = (data & 0x30)<<7; | |
| 542 | state->romHI_addr_mid = (data & 0x0f)<<7; | |
| 543 | state->romHI_addr_msb = (data & 0x30)<<7; | |
| 568 | 544 | break; |
| 569 | 545 | |
| 570 | 546 | case 6: /*g*/ |
| 571 | romD_addr = (data & 0x3f)<<7; | |
| 547 | state->romD_addr = (data & 0x3f)<<7; | |
| 572 | 548 | break; |
| 573 | 549 | |
| 574 | 550 | case 7: /*h: adder input LSB*/ |
| 575 | E16_add_b = ((data & 0xff) << 0) | (E16_add_b & 0xff00); | |
| 551 | state->E16_add_b = ((data & 0xff) << 0) | (state->E16_add_b & 0xff00); | |
| 576 | 552 | break; |
| 577 | 553 | |
| 578 | 554 | case 8: /*J: adder input MSB*/ |
| 579 | E16_add_b = ((data & 0xff) << 8) | (E16_add_b & 0x00ff); | |
| 555 | state->E16_add_b = ((data & 0xff) << 8) | (state->E16_add_b & 0x00ff); | |
| 580 | 556 | break; |
| 581 | 557 | |
| 582 | 558 | case 9: /*K*/ |
| 583 | 559 | /*write to: LS174 @J3 to set color bank (hi address lines to 2114 colorram @J1 ) */ |
| 584 | colorram_addr_hi = (data & 0x3f) << 4; | |
| 560 | state->colorram_addr_hi = (data & 0x3f) << 4; | |
| 585 | 561 | |
| 586 | 562 | /*write to: LS74 @D13 to clear the interrupt line /SINT |
| 587 | /SINT line will be reasserted in XSize * YSize cycles (RH0 signal cycles) | |
| 563 | /SINT line will be reasserted in state->XSize * state->YSize cycles (RH0 signal cycles) | |
| 588 | 564 | */ |
| 589 | 565 | /* 1.clear the /SINT interrupt line */ |
| 590 | 566 | cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE); |
| 591 | 567 | |
| 592 | 568 | /* 2.assert /SINT again after this time */ |
| 593 | space->machine->scheduler().timer_set( attotime::from_hz(19968000/8) * ((XSize+1)*(YSize+1)), FUNC(sprite_timer_callback)); | |
| 569 | space->machine->scheduler().timer_set( attotime::from_hz(19968000/8) * ((state->XSize+1)*(state->YSize+1)), FUNC(sprite_timer_callback)); | |
| 594 | 570 | |
| 595 | 571 | /* 3.clear of /SINT starts sprite drawing circuit */ |
| 596 | 572 | draw_sprite(space->machine); |
| r10613 | r10614 | |
| 599 | 575 | } |
| 600 | 576 | } |
| 601 | 577 | |
| 602 | void tubep_vblank_end( | |
| 578 | void tubep_vblank_end(running_machine *machine) | |
| 603 | 579 | { |
| 604 | DISP = DISP ^ 1; | |
| 605 | /* logerror("EOF: DISP after this is=%i, and clearing it now.\n", DISP); */ | |
| 580 | tubep_state *state = machine->driver_data<tubep_state>(); | |
| 581 | state->DISP = state->DISP ^ 1; | |
| 582 | /* logerror("EOF: DISP after this is=%i, and clearing it now.\n", state->DISP); */ | |
| 606 | 583 | /* clear the new frame (the one that was (just) displayed)*/ |
| 607 | memset(spritemap+DISP*256*256, 0x0f, 256*256); | |
| 584 | memset(state->spritemap+state->DISP*256*256, 0x0f, 256*256); | |
| 608 | 585 | } |
| 609 | 586 | |
| 610 | 587 | |
| 611 | 588 | SCREEN_UPDATE( tubep ) |
| 612 | 589 | { |
| 613 | int DISP_ = DISP^1; | |
| 590 | tubep_state *state = screen->machine->driver_data<tubep_state>(); | |
| 591 | int DISP_ = state->DISP^1; | |
| 614 | 592 | |
| 615 | 593 | pen_t pen_base = 32; //change it later |
| 616 | 594 | |
| 617 | 595 | UINT32 v; |
| 618 | 596 | UINT8 *text_gfx_base = screen->machine->region("gfx1")->base(); |
| 619 | UINT8 *romBxx = screen->machine->region("user1")->base() + 0x2000*background_romsel; | |
| 597 | UINT8 *romBxx = screen->machine->region("user1")->base() + 0x2000*state->background_romsel; | |
| 620 | 598 | |
| 621 | /* logerror(" update: from DISP=%i y_min=%3i y_max=%3i\n", DISP_, cliprect->min_y, cliprect->max_y+1); */ | |
| 599 | /* logerror(" update: from state->DISP=%i y_min=%3i y_max=%3i\n", DISP_, cliprect->min_y, cliprect->max_y+1); */ | |
| 622 | 600 | |
| 623 | 601 | for (v = cliprect->min_y; v <= cliprect->max_y; v++) /* only for current scanline */ |
| 624 | 602 | { |
| r10613 | r10614 | |
| 632 | 610 | |
| 633 | 611 | sp_data2 = sp_data1; |
| 634 | 612 | sp_data1 = sp_data0; |
| 635 | sp_data0 = spritemap[ h + v*256 +(DISP_*256*256) ]; | |
| 613 | sp_data0 = state->spritemap[ h + v*256 +(DISP_*256*256) ]; | |
| 636 | 614 | |
| 637 | 615 | text_offs = ((v >> 3) << 6) | ((h >> 3) << 1); |
| 638 | text_code = t | |
| 616 | text_code = state->textram[text_offs]; | |
| 639 | 617 | text_gfx_data = text_gfx_base[(text_code << 3) | (v & 0x07)]; |
| 640 | 618 | |
| 641 | 619 | if (text_gfx_data & (0x80 >> (h & 0x07))) |
| 642 | *BITMAP_ADDR16(bitmap, v, h) = (t | |
| 620 | *BITMAP_ADDR16(bitmap, v, h) = (state->textram[text_offs + 1] & 0x0f) | state->color_A4; | |
| 643 | 621 | else |
| 644 | 622 | { |
| 645 | 623 | UINT32 bg_data; |
| r10613 | r10614 | |
| 653 | 631 | UINT8 romB_data_h = romBxx[ 0x4000 + 0x4000*rom_select + romB_addr ]; |
| 654 | 632 | /* romB_data_h = output of LS374 @B3 or @B4 */ |
| 655 | 633 | |
| 656 | UINT32 VR_addr = ((romB_data_h + ls175_b7) & 0xfe) << 2; | |
| 634 | UINT32 VR_addr = ((romB_data_h + state->ls175_b7) & 0xfe) << 2; | |
| 657 | 635 | /* VR_addr = output of LS157s @B1 and @B6 */ |
| 658 | 636 | |
| 659 | UINT8 xor_logic = (((h^v)&0x80)>>7) ^ (background_romsel & (((v&0x80)>>7)^1)); | |
| 637 | UINT8 xor_logic = (((h^v)&0x80)>>7) ^ (state->background_romsel & (((v&0x80)>>7)^1)); | |
| 660 | 638 | |
| 661 | 639 | /* read from ROMs: B1/2 */ |
| 662 | 640 | UINT8 romB_data_l = romBxx[ romB_addr ] ^ (xor_logic?0xff:0x00); |
| r10613 | r10614 | |
| 664 | 642 | |
| 665 | 643 | UINT8 ls157_b11 = (romB_data_l >> ((rom_select==0)?4:0))&0x0f; |
| 666 | 644 | |
| 667 | UINT8 ls283_b12 = (ls157_b11 + ls175_e8) & 0x0f; | |
| 645 | UINT8 ls283_b12 = (ls157_b11 + state->ls175_e8) & 0x0f; | |
| 668 | 646 | |
| 669 | 647 | VR_addr |= (ls283_b12>>1); |
| 670 | 648 | |
| 671 | bg_data = t | |
| 649 | bg_data = state->backgroundram[ VR_addr ]; | |
| 672 | 650 | |
| 673 | 651 | romB_data_h>>=2; |
| 674 | 652 | |
| r10613 | r10614 | |
| 678 | 656 | sp_data = sp_data1; |
| 679 | 657 | |
| 680 | 658 | if (sp_data != 0x0f) |
| 681 | bg_data = prom2[sp_data | color_A4]; | |
| 659 | bg_data = state->prom2[sp_data | state->color_A4]; | |
| 682 | 660 | |
| 683 | 661 | *BITMAP_ADDR16(bitmap, v, h) = pen_base + bg_data*64 + romB_data_h; |
| 684 | 662 | } |
| r10613 | r10614 | |
| 753 | 731 | |
| 754 | 732 | WRITE8_HANDLER( rjammer_background_LS377_w ) |
| 755 | 733 | { |
| 756 | ls377_data = data & 0xff; | |
| 734 | tubep_state *state = space->machine->driver_data<tubep_state>(); | |
| 735 | state->ls377_data = data & 0xff; | |
| 757 | 736 | } |
| 758 | 737 | |
| 759 | 738 | |
| 760 | 739 | WRITE8_HANDLER( rjammer_background_page_w ) |
| 761 | 740 | { |
| 762 | page = (data & 1) * 0x200; | |
| 741 | tubep_state *state = space->machine->driver_data<tubep_state>(); | |
| 742 | state->page = (data & 1) * 0x200; | |
| 763 | 743 | } |
| 764 | 744 | |
| 765 | 745 | |
| 766 | 746 | SCREEN_UPDATE( rjammer ) |
| 767 | 747 | { |
| 768 | int DISP_ = DISP^1; | |
| 748 | tubep_state *state = screen->machine->driver_data<tubep_state>(); | |
| 749 | int DISP_ = state->DISP^1; | |
| 769 | 750 | |
| 770 | 751 | UINT32 v; |
| 771 | 752 | UINT8 *text_gfx_base = screen->machine->region("gfx1")->base(); |
| r10613 | r10614 | |
| 785 | 766 | UINT8 pal14h4_pin18; |
| 786 | 767 | UINT8 pal14h4_pin13; |
| 787 | 768 | |
| 788 | UINT32 addr = (v*2) | page; | |
| 789 | UINT32 ram_data = rjammer_backgroundram[ addr ] + 256*(rjammer_backgroundram[ addr+1 ]&0x2f); | |
| 769 | UINT32 addr = (v*2) | state->page; | |
| 770 | UINT32 ram_data = state->rjammer_backgroundram[ addr ] + 256*(state->rjammer_backgroundram[ addr+1 ]&0x2f); | |
| 790 | 771 | |
| 791 | addr = (v>>3) | ((ls377_data&0x1f)<<5); | |
| 772 | addr = (v>>3) | ((state->ls377_data&0x1f)<<5); | |
| 792 | 773 | pal14h4_pin13 = (rom19C[addr] >> ((v&7)^7) ) &1; |
| 793 | 774 | pal14h4_pin19 = (ram_data>>13) & 1; |
| 794 | 775 | |
| r10613 | r10614 | |
| 800 | 781 | |
| 801 | 782 | sp_data2 = sp_data1; |
| 802 | 783 | sp_data1 = sp_data0; |
| 803 | sp_data0 = spritemap[ h + v*256 +(DISP_*256*256) ]; | |
| 784 | sp_data0 = state->spritemap[ h + v*256 +(DISP_*256*256) ]; | |
| 804 | 785 | |
| 805 | 786 | text_offs = ((v >> 3) << 6) | ((h >> 3) << 1); |
| 806 | text_code = t | |
| 787 | text_code = state->textram[text_offs]; | |
| 807 | 788 | text_gfx_data = text_gfx_base[(text_code << 3) | (v & 0x07)]; |
| 808 | 789 | |
| 809 | 790 | if (text_gfx_data & (0x80 >> (h & 0x07))) |
| 810 | *BITMAP_ADDR16(bitmap, v, h) = 0x10 | (t | |
| 791 | *BITMAP_ADDR16(bitmap, v, h) = 0x10 | (state->textram[text_offs + 1] & 0x0f); | |
| 811 | 792 | else |
| 812 | 793 | { |
| 813 | 794 | UINT32 sp_data; |
| r10613 | r10614 | |
| 842 | 823 | else |
| 843 | 824 | bg_data = (rom11_data>>4) & 0x0f; |
| 844 | 825 | |
| 845 | addr = (h>>3) | (ls377_data<<5); | |
| 826 | addr = (h>>3) | (state->ls377_data<<5); | |
| 846 | 827 | pal14h4_pin18 = (rom19C[addr] >> ((h&7)^7) ) &1; |
| 847 | 828 | |
| 848 | 829 | /* |
| r10613 | r10614 | |
|---|---|---|
| 9 | 9 | #include "includes/exidy.h" |
| 10 | 10 | |
| 11 | 11 | |
| 12 | UINT8 *exidy_videoram; | |
| 13 | UINT8 *exidy_characterram; | |
| 14 | UINT8 *exidy_color_latch; | |
| 15 | UINT8 *exidy_sprite1_xpos; | |
| 16 | UINT8 *exidy_sprite1_ypos; | |
| 17 | UINT8 *exidy_sprite2_xpos; | |
| 18 | UINT8 *exidy_sprite2_ypos; | |
| 19 | UINT8 *exidy_spriteno; | |
| 20 | UINT8 *exidy_sprite_enable; | |
| 21 | 12 | |
| 22 | static UINT8 collision_mask; | |
| 23 | static UINT8 collision_invert; | |
| 24 | static int is_2bpp; | |
| 25 | static UINT8 int_condition; | |
| 26 | ||
| 27 | static bitmap_t *background_bitmap; | |
| 28 | static bitmap_t *motion_object_1_vid; | |
| 29 | static bitmap_t *motion_object_2_vid; | |
| 30 | static bitmap_t *motion_object_2_clip; | |
| 31 | ||
| 32 | ||
| 33 | ||
| 34 | 13 | /************************************* |
| 35 | 14 | * |
| 36 | 15 | * Video configuration |
| 37 | 16 | * |
| 38 | 17 | *************************************/ |
| 39 | 18 | |
| 40 | void exidy_video_config(UINT8 _collision_mask, UINT8 _collision_invert, int _is_2bpp) | |
| 19 | void exidy_video_config(running_machine *machine, UINT8 _collision_mask, UINT8 _collision_invert, int _is_2bpp) | |
| 41 | 20 | { |
| 42 | collision_mask = _collision_mask; | |
| 43 | collision_invert = _collision_invert; | |
| 44 | is_2bpp = _is_2bpp; | |
| 21 | exidy_state *state = machine->driver_data<exidy_state>(); | |
| 22 | state->collision_mask = _collision_mask; | |
| 23 | state->collision_invert = _collision_invert; | |
| 24 | state->is_2bpp = _is_2bpp; | |
| 45 | 25 | } |
| 46 | 26 | |
| 47 | 27 | |
| r10613 | r10614 | |
| 54 | 34 | |
| 55 | 35 | VIDEO_START( exidy ) |
| 56 | 36 | { |
| 37 | exidy_state *state = machine->driver_data<exidy_state>(); | |
| 57 | 38 | bitmap_format format = machine->primary_screen->format(); |
| 58 | 39 | |
| 59 | background_bitmap = machine->primary_screen->alloc_compatible_bitmap(); | |
| 60 | motion_object_1_vid = auto_bitmap_alloc(machine, 16, 16, format); | |
| 61 | motion_object_2_vid = auto_bitmap_alloc(machine, 16, 16, format); | |
| 62 | motion_object_2_clip = auto_bitmap_alloc(machine, 16, 16, format); | |
| 40 | state->background_bitmap = machine->primary_screen->alloc_compatible_bitmap(); | |
| 41 | state->motion_object_1_vid = auto_bitmap_alloc(machine, 16, 16, format); | |
| 42 | state->motion_object_2_vid = auto_bitmap_alloc(machine, 16, 16, format); | |
| 43 | state->motion_object_2_clip = auto_bitmap_alloc(machine, 16, 16, format); | |
| 63 | 44 | |
| 64 | state_save_register_global(machine, collision_mask); | |
| 65 | state_save_register_global(machine, collision_invert); | |
| 66 | state_save_register_global(machine, is_2bpp); | |
| 67 | state_save_register_global(machine, int_condition); | |
| 68 | state_save_register_global_bitmap(machine, background_bitmap); | |
| 69 | state_save_register_global_bitmap(machine, motion_object_1_vid); | |
| 70 | state_save_register_global_bitmap(machine, motion_object_2_vid); | |
| 71 | state_save_register_global_bitmap(machine, motion_object_2_clip); | |
| 45 | state_save_register_global(machine, state->collision_mask); | |
| 46 | state_save_register_global(machine, state->collision_invert); | |
| 47 | state_save_register_global(machine, state->is_2bpp); | |
| 48 | state_save_register_global(machine, state->int_condition); | |
| 49 | state_save_register_global_bitmap(machine, state->background_bitmap); | |
| 50 | state_save_register_global_bitmap(machine, state->motion_object_1_vid); | |
| 51 | state_save_register_global_bitmap(machine, state->motion_object_2_vid); | |
| 52 | state_save_register_global_bitmap(machine, state->motion_object_2_clip); | |
| 72 | 53 | } |
| 73 | 54 | |
| 74 | 55 | |
| r10613 | r10614 | |
| 81 | 62 | |
| 82 | 63 | INLINE void latch_condition(running_machine *machine, int collision) |
| 83 | 64 | { |
| 84 | collision ^= collision_invert; | |
| 85 | int_condition = (input_port_read(machine, "INTSOURCE") & ~0x1c) | (collision & collision_mask); | |
| 65 | exidy_state *state = machine->driver_data<exidy_state>(); | |
| 66 | collision ^= state->collision_invert; | |
| 67 | state->int_condition = (input_port_read(machine, "INTSOURCE") & ~0x1c) | (collision & state->collision_mask); | |
| 86 | 68 | } |
| 87 | 69 | |
| 88 | 70 | |
| 89 | 71 | INTERRUPT_GEN( exidy_vblank_interrupt ) |
| 90 | 72 | { |
| 73 | exidy_state *state = device->machine->driver_data<exidy_state>(); | |
| 91 | 74 | /* latch the current condition */ |
| 92 | 75 | latch_condition(device->machine, 0); |
| 93 | int_condition &= ~0x80; | |
| 76 | state->int_condition &= ~0x80; | |
| 94 | 77 | |
| 95 | 78 | /* set the IRQ line */ |
| 96 | 79 | cpu_set_input_line(device, 0, ASSERT_LINE); |
| r10613 | r10614 | |
| 110 | 93 | |
| 111 | 94 | READ8_HANDLER( exidy_interrupt_r ) |
| 112 | 95 | { |
| 96 | exidy_state *state = space->machine->driver_data<exidy_state>(); | |
| 113 | 97 | /* clear any interrupts */ |
| 114 | 98 | cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); |
| 115 | 99 | |
| 116 | 100 | /* return the latched condition */ |
| 117 | return int_condition; | |
| 101 | return state->int_condition; | |
| 118 | 102 | } |
| 119 | 103 | |
| 120 | 104 | |
| r10613 | r10614 | |
| 127 | 111 | |
| 128 | 112 | INLINE void set_1_color(running_machine *machine, int index, int which) |
| 129 | 113 | { |
| 114 | exidy_state *state = machine->driver_data<exidy_state>(); | |
| 130 | 115 | palette_set_color_rgb(machine, index, |
| 131 | pal1bit(exidy_color_latch[2] >> which), | |
| 132 | pal1bit(exidy_color_latch[1] >> which), | |
| 133 | pal1bit(exidy_color_latch[0] >> which)); | |
| 116 | pal1bit(state->color_latch[2] >> which), | |
| 117 | pal1bit(state->color_latch[1] >> which), | |
| 118 | pal1bit(state->color_latch[0] >> which)); | |
| 134 | 119 | } |
| 135 | 120 | |
| 136 | 121 | static void set_colors(running_machine *machine) |
| r10613 | r10614 | |
| 158 | 143 | * |
| 159 | 144 | *************************************/ |
| 160 | 145 | |
| 161 | static void draw_background( | |
| 146 | static void draw_background(running_machine *machine) | |
| 162 | 147 | { |
| 148 | exidy_state *state = machine->driver_data<exidy_state>(); | |
| 163 | 149 | offs_t offs; |
| 164 | 150 | |
| 165 | 151 | pen_t off_pen = 0; |
| r10613 | r10614 | |
| 170 | 156 | pen_t on_pen_1, on_pen_2; |
| 171 | 157 | |
| 172 | 158 | UINT8 y = offs >> 5 << 3; |
| 173 | UINT8 code = e | |
| 159 | UINT8 code = state-> | |
| 174 | 160 | |
| 175 | if (is_2bpp) | |
| 161 | if (state->is_2bpp) | |
| 176 | 162 | { |
| 177 | 163 | on_pen_1 = 4 + ((code >> 6) & 0x02); |
| 178 | 164 | on_pen_2 = 5 + ((code >> 6) & 0x02); |
| r10613 | r10614 | |
| 188 | 174 | int i; |
| 189 | 175 | UINT8 x = offs << 3; |
| 190 | 176 | |
| 191 | if (is_2bpp) | |
| 177 | if (state->is_2bpp) | |
| 192 | 178 | { |
| 193 | UINT8 data1 = exidy_characterram[0x000 | (code << 3) | cy]; | |
| 194 | UINT8 data2 = exidy_characterram[0x800 | (code << 3) | cy]; | |
| 179 | UINT8 data1 = state->characterram[0x000 | (code << 3) | cy]; | |
| 180 | UINT8 data2 = state->characterram[0x800 | (code << 3) | cy]; | |
| 195 | 181 | |
| 196 | 182 | for (i = 0; i < 8; i++) |
| 197 | 183 | { |
| 198 | 184 | if (data1 & 0x80) |
| 199 | *BITMAP_ADDR16(background_bitmap, y, x) = (data2 & 0x80) ? on_pen_2 : on_pen_1; | |
| 185 | *BITMAP_ADDR16(state->background_bitmap, y, x) = (data2 & 0x80) ? on_pen_2 : on_pen_1; | |
| 200 | 186 | else |
| 201 | *BITMAP_ADDR16(background_bitmap, y, x) = off_pen; | |
| 187 | *BITMAP_ADDR16(state->background_bitmap, y, x) = off_pen; | |
| 202 | 188 | |
| 203 | 189 | x = x + 1; |
| 204 | 190 | data1 = data1 << 1; |
| r10613 | r10614 | |
| 208 | 194 | /* 1bpp */ |
| 209 | 195 | else |
| 210 | 196 | { |
| 211 | UINT8 data = e | |
| 197 | UINT8 data = state-> | |
| 212 | 198 | |
| 213 | 199 | for (i = 0; i < 8; i++) |
| 214 | 200 | { |
| 215 | *BITMAP_ADDR16(background_bitmap, y, x) = (data & 0x80) ? on_pen_1 : off_pen; | |
| 201 | *BITMAP_ADDR16(state->background_bitmap, y, x) = (data & 0x80) ? on_pen_1 : off_pen; | |
| 216 | 202 | |
| 217 | 203 | x = x + 1; |
| 218 | 204 | data = data << 1; |
| r10613 | r10614 | |
| 232 | 218 | * |
| 233 | 219 | *************************************/ |
| 234 | 220 | |
| 235 | INLINE int sprite_1_enabled( | |
| 221 | INLINE int sprite_1_enabled(exidy_state *state) | |
| 236 | 222 | { |
| 237 | 223 | /* if the collision_mask is 0x00, then we are on old hardware that always has */ |
| 238 | 224 | /* sprite 1 enabled regardless */ |
| 239 | return (!(*e | |
| 225 | return (!(*state-> | |
| 240 | 226 | } |
| 241 | 227 | |
| 242 | 228 | |
| 243 | 229 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) |
| 244 | 230 | { |
| 231 | exidy_state *state = machine->driver_data<exidy_state>(); | |
| 245 | 232 | /* draw sprite 2 first */ |
| 246 | int sprite_set_2 = ((*e | |
| 233 | int sprite_set_2 = ((*state-> | |
| 247 | 234 | |
| 248 | int sx = 236 - *exidy_sprite2_xpos - 4; | |
| 249 | int sy = 244 - *exidy_sprite2_ypos - 4; | |
| 235 | int sx = 236 - *state->sprite2_xpos - 4; | |
| 236 | int sy = 244 - *state->sprite2_ypos - 4; | |
| 250 | 237 | |
| 251 | 238 | drawgfx_transpen(bitmap, cliprect, machine->gfx[0], |
| 252 | ((*e | |
| 239 | ((*state-> | |
| 253 | 240 | 0, 0, sx, sy, 0); |
| 254 | 241 | |
| 255 | 242 | /* draw sprite 1 next */ |
| 256 | if (sprite_1_enabled()) | |
| 243 | if (sprite_1_enabled(state)) | |
| 257 | 244 | { |
| 258 | int sprite_set_1 = ((*e | |
| 245 | int sprite_set_1 = ((*state-> | |
| 259 | 246 | |
| 260 | sx = 236 - *exidy_sprite1_xpos - 4; | |
| 261 | sy = 244 - *exidy_sprite1_ypos - 4; | |
| 247 | sx = 236 - *state->sprite1_xpos - 4; | |
| 248 | sy = 244 - *state->sprite1_ypos - 4; | |
| 262 | 249 | |
| 263 | 250 | if (sy < 0) sy = 0; |
| 264 | 251 | |
| 265 | 252 | drawgfx_transpen(bitmap, cliprect, machine->gfx[0], |
| 266 | (*e | |
| 253 | (*state-> | |
| 267 | 254 | 0, 0, sx, sy, 0); |
| 268 | 255 | } |
| 269 | 256 | |
| r10613 | r10614 | |
| 301 | 288 | |
| 302 | 289 | static void check_collision(running_machine *machine) |
| 303 | 290 | { |
| 304 | UINT8 sprite_set_1 = ((*exidy_sprite_enable & 0x20) != 0); | |
| 305 | UINT8 sprite_set_2 = ((*exidy_sprite_enable & 0x40) != 0); | |
| 306 | static const rectangle clip = { 0, 15, 0, 15 }; | |
| 307 | int org_1_x = 0, org_1_y = 0; | |
| 308 | int org_2_x = 0, org_2_y = 0; | |
| 309 | int sx, sy; | |
| 291 | exidy_state *state = machine->driver_data<exidy_state>(); | |
| 292 | UINT8 sprite_set_1 = ((*state->sprite_enable & 0x20) != 0); | |
| 293 | UINT8 sprite_set_2 = ((*state->sprite_enable & 0x40) != 0); | |
| 294 | static const rectangle clip = { 0, 15, 0, 15 }; | |
| 295 | int org_1_x = 0, org_1_y = 0; | |
| 296 | int org_2_x = 0, org_2_y = 0; | |
| 297 | int sx, sy; | |
| 310 | 298 | int count = 0; |
| 311 | 299 | |
| 312 | 300 | /* if there is nothing to detect, bail */ |
| 313 | if (collision_mask == 0) | |
| 301 | if (state->collision_mask == 0) | |
| 314 | 302 | return; |
| 315 | 303 | |
| 316 | 304 | /* draw sprite 1 */ |
| 317 | bitmap_fill(motion_object_1_vid, &clip, 0xff); | |
| 318 | if (sprite_1_enabled()) | |
| 305 | bitmap_fill(state->motion_object_1_vid, &clip, 0xff); | |
| 306 | if (sprite_1_enabled(state)) | |
| 319 | 307 | { |
| 320 | org_1_x = 236 - *exidy_sprite1_xpos - 4; | |
| 321 | org_1_y = 244 - *exidy_sprite1_ypos - 4; | |
| 322 | drawgfx_transpen(motion_object_1_vid, &clip, machine->gfx[0], | |
| 323 | (*exidy_spriteno & 0x0f) + 16 * sprite_set_1, 0, | |
| 308 | org_1_x = 236 - *state->sprite1_xpos - 4; | |
| 309 | org_1_y = 244 - *state->sprite1_ypos - 4; | |
| 310 | drawgfx_transpen(state->motion_object_1_vid, &clip, machine->gfx[0], | |
| 311 | (*state->spriteno & 0x0f) + 16 * sprite_set_1, 0, | |
| 324 | 312 | 0, 0, 0, 0, 0); |
| 325 | 313 | } |
| 326 | 314 | |
| 327 | 315 | /* draw sprite 2 */ |
| 328 | bitmap_fill(motion_object_2_vid, &clip, 0xff); | |
| 329 | org_2_x = 236 - *exidy_sprite2_xpos - 4; | |
| 330 | org_2_y = 244 - *exidy_sprite2_ypos - 4; | |
| 331 | drawgfx_transpen(motion_object_2_vid, &clip, machine->gfx[0], | |
| 332 | ((*exidy_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0, | |
| 316 | bitmap_fill(state->motion_object_2_vid, &clip, 0xff); | |
| 317 | org_2_x = 236 - *state->sprite2_xpos - 4; | |
| 318 | org_2_y = 244 - *state->sprite2_ypos - 4; | |
| 319 | drawgfx_transpen(state->motion_object_2_vid, &clip, machine->gfx[0], | |
| 320 | ((*state->spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0, | |
| 333 | 321 | 0, 0, 0, 0, 0); |
| 334 | 322 | |
| 335 | 323 | /* draw sprite 2 clipped to sprite 1's location */ |
| 336 | bitmap_fill(motion_object_2_clip, &clip, 0xff); | |
| 337 | if (sprite_1_enabled()) | |
| 324 | bitmap_fill(state->motion_object_2_clip, &clip, 0xff); | |
| 325 | if (sprite_1_enabled(state)) | |
| 338 | 326 | { |
| 339 | 327 | sx = org_2_x - org_1_x; |
| 340 | 328 | sy = org_2_y - org_1_y; |
| 341 | drawgfx_transpen(motion_object_2_clip, &clip, machine->gfx[0], | |
| 342 | ((*exidy_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0, | |
| 329 | drawgfx_transpen(state->motion_object_2_clip, &clip, machine->gfx[0], | |
| 330 | ((*state->spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0, | |
| 343 | 331 | 0, 0, sx, sy, 0); |
| 344 | 332 | } |
| 345 | 333 | |
| r10613 | r10614 | |
| 347 | 335 | for (sy = 0; sy < 16; sy++) |
| 348 | 336 | for (sx = 0; sx < 16; sx++) |
| 349 | 337 | { |
| 350 | ||
| 338 | ||
| 351 | 339 | { |
| 352 | 340 | UINT8 current_collision_mask = 0; |
| 353 | 341 | |
| 354 | 342 | /* check for background collision (M1CHAR) */ |
| 355 | if (*BITMAP_ADDR16(background_bitmap, org_1_y + sy, org_1_x + sx) != 0) | |
| 343 | if (*BITMAP_ADDR16(state->background_bitmap, org_1_y + sy, org_1_x + sx) != 0) | |
| 356 | 344 | current_collision_mask |= 0x04; |
| 357 | 345 | |
| 358 | 346 | /* check for motion object collision (M1M2) */ |
| 359 | if (*BITMAP_ADDR16(motion_object_2_clip, sy, sx) != 0xff) | |
| 347 | if (*BITMAP_ADDR16(state->motion_object_2_clip, sy, sx) != 0xff) | |
| 360 | 348 | current_collision_mask |= 0x10; |
| 361 | 349 | |
| 362 | 350 | /* if we got one, trigger an interrupt */ |
| 363 | if ((current_collision_mask & collision_mask) && (count++ < 128)) | |
| 351 | if ((current_collision_mask & state->collision_mask) && (count++ < 128)) | |
| 364 | 352 | machine->scheduler().timer_set(machine->primary_screen->time_until_pos(org_1_x + sx, org_1_y + sy), FUNC(collision_irq_callback), current_collision_mask); |
| 365 | 353 | } |
| 366 | 354 | |
| 367 | if (*BITMAP_ADDR16(motion_object_2_vid, sy, sx) != 0xff) | |
| 355 | if (*BITMAP_ADDR16(state->motion_object_2_vid, sy, sx) != 0xff) | |
| 368 | 356 | { |
| 369 | 357 | /* check for background collision (M2CHAR) */ |
| 370 | if (*BITMAP_ADDR16(background_bitmap, org_2_y + sy, org_2_x + sx) != 0) | |
| 371 | if ((collision_mask & 0x08) && (count++ < 128)) | |
| 358 | if (*BITMAP_ADDR16(state->background_bitmap, org_2_y + sy, org_2_x + sx) != 0) | |
| 359 | if ((state->collision_mask & 0x08) && (count++ < 128)) | |
| 372 | 360 | machine->scheduler().timer_set(machine->primary_screen->time_until_pos(org_2_x + sx, org_2_y + sy), FUNC(collision_irq_callback), 0x08); |
| 373 | 361 | } |
| 374 | 362 | } |
| r10613 | r10614 | |
| 384 | 372 | |
| 385 | 373 | SCREEN_UPDATE( exidy ) |
| 386 | 374 | { |
| 375 | exidy_state *state = screen->machine->driver_data<exidy_state>(); | |
| 387 | 376 | /* refresh the colors from the palette (static or dynamic) */ |
| 388 | 377 | set_colors(screen->machine); |
| 389 | 378 | |
| 390 | 379 | /* update the background and draw it */ |
| 391 | draw_background(); | |
| 392 | copybitmap(bitmap, background_bitmap, 0, 0, 0, 0, cliprect); | |
| 380 | draw_background(screen->machine); | |
| 381 | copybitmap(bitmap, state->background_bitmap, 0, 0, 0, 0, cliprect); | |
| 393 | 382 | |
| 394 | 383 | /* draw the sprites */ |
| 395 | 384 | draw_sprites(screen->machine, bitmap, NULL); |
| r10613 | r10614 | |
|---|---|---|
| 10 | 10 | #include "includes/nb1413m3.h" |
| 11 | 11 | #include "includes/hyhoo.h" |
| 12 | 12 | |
| 13 | UINT8 *hyhoo_clut; | |
| 14 | 13 | |
| 15 | static int blitter_destx, blitter_desty; | |
| 16 | static int blitter_sizex, blitter_sizey; | |
| 17 | static int blitter_src_addr; | |
| 18 | static int blitter_direction_x, blitter_direction_y; | |
| 19 | static int hyhoo_gfxrom; | |
| 20 | static int hyhoo_dispflag; | |
| 21 | static int hyhoo_highcolorflag; | |
| 22 | static int hyhoo_flipscreen; | |
| 23 | ||
| 24 | static bitmap_t *hyhoo_tmpbitmap; | |
| 25 | 14 | static void hyhoo_gfxdraw(running_machine *machine); |
| 26 | 15 | |
| 27 | 16 | |
| 28 | 17 | WRITE8_HANDLER( hyhoo_blitter_w ) |
| 29 | 18 | { |
| 19 | hyhoo_state *state = space->machine->driver_data<hyhoo_state>(); | |
| 30 | 20 | switch (offset) |
| 31 | 21 | { |
| 32 | case 0x00: blitter_src_addr = (blitter_src_addr & 0xff00) | data; | |
| 22 | case 0x00: state->blitter_src_addr = (state->blitter_src_addr & 0xff00) | data; | |
| 33 | 23 | nb1413m3_gfxradr_l_w(space, 0, data); break; |
| 34 | case 0x01: blitter_src_addr = (blitter_src_addr & 0x00ff) | (data << 8); | |
| 24 | case 0x01: state->blitter_src_addr = (state->blitter_src_addr & 0x00ff) | (data << 8); | |
| 35 | 25 | nb1413m3_gfxradr_h_w(space, 0, data); break; |
| 36 | case 0x02: blitter_destx = data; break; | |
| 37 | case 0x03: blitter_desty = data; break; | |
| 38 | case 0x04: blitter_sizex = data; break; | |
| 39 | case 0x05: blitter_sizey = data; | |
| 26 | case 0x02: state->blitter_destx = data; break; | |
| 27 | case 0x03: state->blitter_desty = data; break; | |
| 28 | case 0x04: state->blitter_sizex = data; break; | |
| 29 | case 0x05: state->blitter_sizey = data; | |
| 40 | 30 | /* writing here also starts the blit */ |
| 41 | 31 | hyhoo_gfxdraw(space->machine); |
| 42 | 32 | break; |
| 43 | case 0x06: blitter_direction_x = (data >> 0) & 0x01; | |
| 44 | blitter_direction_y = (data >> 1) & 0x01; | |
| 45 | hyhoo_flipscreen = (~data >> 2) & 0x01; | |
| 46 | hyhoo_dispflag = (~data >> 3) & 0x01; | |
| 33 | case 0x06: state->blitter_direction_x = (data >> 0) & 0x01; | |
| 34 | state->blitter_direction_y = (data >> 1) & 0x01; | |
| 35 | state->flipscreen = (~data >> 2) & 0x01; | |
| 36 | state->dispflag = (~data >> 3) & 0x01; | |
| 47 | 37 | break; |
| 48 | 38 | case 0x07: break; |
| 49 | 39 | } |
| r10613 | r10614 | |
| 52 | 42 | |
| 53 | 43 | WRITE8_HANDLER( hyhoo_romsel_w ) |
| 54 | 44 | { |
| 45 | hyhoo_state *state = space->machine->driver_data<hyhoo_state>(); | |
| 55 | 46 | int gfxlen = space->machine->region("gfx1")->bytes(); |
| 56 | hyhoo_gfxrom = (((data & 0xc0) >> 4) + (data & 0x03)); | |
| 57 | hyhoo_highcolorflag = data; | |
| 47 | state->gfxrom = (((data & 0xc0) >> 4) + (data & 0x03)); | |
| 48 | state->highcolorflag = data; | |
| 58 | 49 | nb1413m3_gfxrombank_w(space, 0, data); |
| 59 | 50 | |
| 60 | if ((0x20000 * | |
| 51 | if ((0x20000 * state->gfxrom) > (gfxlen - 1)) | |
| 61 | 52 | { |
| 62 | 53 | #ifdef MAME_DEBUG |
| 63 | 54 | popmessage("GFXROM BANK OVER!!"); |
| 64 | 55 | #endif |
| 65 | | |
| 56 | state->gfxrom &= (gfxlen / 0x20000 - 1); | |
| 66 | 57 | } |
| 67 | 58 | } |
| 68 | 59 | |
| r10613 | r10614 | |
| 74 | 65 | |
| 75 | 66 | static void hyhoo_gfxdraw(running_machine *machine) |
| 76 | 67 | { |
| 68 | hyhoo_state *state = machine->driver_data<hyhoo_state>(); | |
| 77 | 69 | UINT8 *GFX = machine->region("gfx1")->base(); |
| 78 | 70 | |
| 79 | 71 | int x, y; |
| r10613 | r10614 | |
| 89 | 81 | |
| 90 | 82 | nb1413m3_busyctr = 0; |
| 91 | 83 | |
| 92 | | |
| 84 | state->gfxrom |= ((nb1413m3_sndrombank1 & 0x02) << 3); | |
| 93 | 85 | |
| 94 | startx = blitter_destx + blitter_sizex; | |
| 95 | starty = blitter_desty + blitter_sizey; | |
| 86 | startx = state->blitter_destx + state->blitter_sizex; | |
| 87 | starty = state->blitter_desty + state->blitter_sizey; | |
| 96 | 88 | |
| 97 | if (blitter_direction_x) | |
| 89 | if (state->blitter_direction_x) | |
| 98 | 90 | { |
| 99 | sizex = blitter_sizex ^ 0xff; | |
| 91 | sizex = state->blitter_sizex ^ 0xff; | |
| 100 | 92 | skipx = 1; |
| 101 | 93 | } |
| 102 | 94 | else |
| 103 | 95 | { |
| 104 | sizex = blitter_sizex; | |
| 96 | sizex = state->blitter_sizex; | |
| 105 | 97 | skipx = -1; |
| 106 | 98 | } |
| 107 | 99 | |
| 108 | if (blitter_direction_y) | |
| 100 | if (state->blitter_direction_y) | |
| 109 | 101 | { |
| 110 | sizey = blitter_sizey ^ 0xff; | |
| 102 | sizey = state->blitter_sizey ^ 0xff; | |
| 111 | 103 | skipy = 1; |
| 112 | 104 | } |
| 113 | 105 | else |
| 114 | 106 | { |
| 115 | sizey = blitter_sizey; | |
| 107 | sizey = state->blitter_sizey; | |
| 116 | 108 | skipy = -1; |
| 117 | 109 | } |
| 118 | 110 | |
| 119 | 111 | gfxlen = machine->region("gfx1")->bytes(); |
| 120 | gfxaddr = ( | |
| 112 | gfxaddr = (state->gfxrom << 17) + (state->blitter_src_addr << 1); | |
| 121 | 113 | |
| 122 | 114 | for (y = starty, ctry = sizey; ctry >= 0; y += skipy, ctry--) |
| 123 | 115 | { |
| r10613 | r10614 | |
| 137 | 129 | dx2 = (2 * x + 1) & 0x1ff; |
| 138 | 130 | dy = y & 0xff; |
| 139 | 131 | |
| 140 | if ( | |
| 132 | if (state->highcolorflag & 0x04) | |
| 141 | 133 | { |
| 142 | 134 | // direct mode |
| 143 | 135 | |
| 144 | 136 | if (color != 0xff) |
| 145 | 137 | { |
| 146 | if ( | |
| 138 | if (state->highcolorflag & 0x20) | |
| 147 | 139 | { |
| 148 | 140 | /* least significant bits */ |
| 149 | 141 | |
| r10613 | r10614 | |
| 156 | 148 | |
| 157 | 149 | pen = MAKE_RGB(pal6bit(r), pal5bit(g), pal5bit(b)); |
| 158 | 150 | |
| 159 | *BITMAP_ADDR32(hyhoo_tmpbitmap, dy, dx1) = *BITMAP_ADDR32(hyhoo_tmpbitmap, dy, dx1) | pen; | |
| 160 | *BITMAP_ADDR32(hyhoo_tmpbitmap, dy, dx2) = *BITMAP_ADDR32(hyhoo_tmpbitmap, dy, dx2) | pen; | |
| 151 | *BITMAP_ADDR32(state->tmpbitmap, dy, dx1) = *BITMAP_ADDR32(state->tmpbitmap, dy, dx1) | pen; | |
| 152 | *BITMAP_ADDR32(state->tmpbitmap, dy, dx2) = *BITMAP_ADDR32(state->tmpbitmap, dy, dx2) | pen; | |
| 161 | 153 | } |
| 162 | 154 | else |
| 163 | 155 | { |
| r10613 | r10614 | |
| 172 | 164 | |
| 173 | 165 | pen = MAKE_RGB(pal6bit(r << 3), pal5bit(g << 2), pal5bit(b << 3)); |
| 174 | 166 | |
| 175 | *BITMAP_ADDR32(hyhoo_tmpbitmap, dy, dx1) = pen; | |
| 176 | *BITMAP_ADDR32(hyhoo_tmpbitmap, dy, dx2) = pen; | |
| 167 | *BITMAP_ADDR32(state->tmpbitmap, dy, dx1) = pen; | |
| 168 | *BITMAP_ADDR32(state->tmpbitmap, dy, dx2) = pen; | |
| 177 | 169 | } |
| 178 | 170 | } |
| 179 | 171 | } |
| r10613 | r10614 | |
| 181 | 173 | { |
| 182 | 174 | // lookup table mode |
| 183 | 175 | |
| 184 | if (blitter_direction_x) | |
| 176 | if (state->blitter_direction_x) | |
| 185 | 177 | { |
| 186 | 178 | // flip |
| 187 | 179 | color1 = (color & 0x0f) >> 0; |
| r10613 | r10614 | |
| 194 | 186 | color2 = (color & 0x0f) >> 0; |
| 195 | 187 | } |
| 196 | 188 | |
| 197 | if ( | |
| 189 | if (state->clut[color1]) | |
| 198 | 190 | { |
| 199 | 191 | // src xxxxxxxx_bbgggrrr |
| 200 | 192 | // dst bbxxxggg_xxrrrxxx |
| 201 | 193 | |
| 202 | r = ((~hyhoo_clut[color1] & 0x07) >> 0) & 0x07; | |
| 203 | g = ((~hyhoo_clut[color1] & 0x38) >> 3) & 0x07; | |
| 204 | b = ((~hyhoo_clut[color1] & 0xc0) >> 6) & 0x03; | |
| 194 | r = ((~state->clut[color1] & 0x07) >> 0) & 0x07; | |
| 195 | g = ((~state->clut[color1] & 0x38) >> 3) & 0x07; | |
| 196 | b = ((~state->clut[color1] & 0xc0) >> 6) & 0x03; | |
| 205 | 197 | |
| 206 | 198 | pen = MAKE_RGB(pal6bit(r << 3), pal5bit(g << 2), pal5bit(b << 3)); |
| 207 | 199 | |
| 208 | *BITMAP_ADDR32( | |
| 200 | *BITMAP_ADDR32(state->tmpbitmap, dy, dx1) = pen; | |
| 209 | 201 | } |
| 210 | 202 | |
| 211 | if ( | |
| 203 | if (state->clut[color2]) | |
| 212 | 204 | { |
| 213 | 205 | // src xxxxxxxx_bbgggrrr |
| 214 | 206 | // dst bbxxxggg_xxrrrxxx |
| 215 | 207 | |
| 216 | r = ((~hyhoo_clut[color2] & 0x07) >> 0) & 0x07; | |
| 217 | g = ((~hyhoo_clut[color2] & 0x38) >> 3) & 0x07; | |
| 218 | b = ((~hyhoo_clut[color2] & 0xc0) >> 6) & 0x03; | |
| 208 | r = ((~state->clut[color2] & 0x07) >> 0) & 0x07; | |
| 209 | g = ((~state->clut[color2] & 0x38) >> 3) & 0x07; | |
| 210 | b = ((~state->clut[color2] & 0xc0) >> 6) & 0x03; | |
| 219 | 211 | |
| 220 | 212 | pen = MAKE_RGB(pal6bit(r << 3), pal5bit(g << 2), pal5bit(b << 3)); |
| 221 | 213 | |
| 222 | *BITMAP_ADDR32( | |
| 214 | *BITMAP_ADDR32(state->tmpbitmap, dy, dx2) = pen; | |
| 223 | 215 | } |
| 224 | 216 | } |
| 225 | 217 | |
| r10613 | r10614 | |
| 234 | 226 | |
| 235 | 227 | VIDEO_START( hyhoo ) |
| 236 | 228 | { |
| 237 | hyhoo_tmpbitmap = machine->primary_screen->alloc_compatible_bitmap(); | |
| 229 | hyhoo_state *state = machine->driver_data<hyhoo_state>(); | |
| 230 | state->tmpbitmap = machine->primary_screen->alloc_compatible_bitmap(); | |
| 238 | 231 | } |
| 239 | 232 | |
| 240 | 233 | |
| 241 | 234 | SCREEN_UPDATE( hyhoo ) |
| 242 | 235 | { |
| 243 | if (hyhoo_dispflag) | |
| 244 | copybitmap(bitmap, hyhoo_tmpbitmap, hyhoo_flipscreen, hyhoo_flipscreen, 0, 0, cliprect); | |
| 236 | hyhoo_state *state = screen->machine->driver_data<hyhoo_state>(); | |
| 237 | if (state->dispflag) | |
| 238 | copybitmap(bitmap, state->tmpbitmap, state->flipscreen, state->flipscreen, 0, 0, cliprect); | |
| 245 | 239 | else |
| 246 | 240 | bitmap_fill(bitmap, cliprect, RGB_BLACK); |
| 247 | 241 |
| r10613 | r10614 | |
|---|---|---|
| 313 | 313 | xoffsethack = 0; |
| 314 | 314 | |
| 315 | 315 | bg_tilemap = tilemap_create( machine, pacman_get_tile_info, pacman_scan_rows, 8, 8, 36, 28 ); |
| 316 | ||
| 317 | tilemap_set_scrolldx( bg_tilemap, 0, 384 - 288 ); | |
| 318 | tilemap_set_scrolldy( bg_tilemap, 0, 264 - 224 ); | |
| 316 | 319 | } |
| 317 | 320 | |
| 318 | 321 | WRITE8_HANDLER( pengo_palettebank_w ) |
| r10613 | r10614 | |
|---|---|---|
| 33 | 33 | #include "emu.h" |
| 34 | 34 | #include "includes/clshroad.h" |
| 35 | 35 | |
| 36 | /* Variables only used here: */ | |
| 37 | 36 | |
| 38 | static tilemap_t *tilemap_0a, *tilemap_0b, *tilemap_1; | |
| 39 | ||
| 40 | /* Variables & functions needed by drivers: */ | |
| 41 | ||
| 42 | UINT8 *clshroad_vram_0, *clshroad_vram_1; | |
| 43 | UINT8 *clshroad_vregs; | |
| 44 | ||
| 45 | 37 | WRITE8_HANDLER( clshroad_flipscreen_w ) |
| 46 | 38 | { |
| 47 | 39 | flip_screen_set(space->machine, data & 1 ); |
| r10613 | r10614 | |
| 112 | 104 | |
| 113 | 105 | static TILE_GET_INFO( get_tile_info_0a ) |
| 114 | 106 | { |
| 107 | clshroad_state *state = machine->driver_data<clshroad_state>(); | |
| 115 | 108 | UINT8 code; |
| 116 | 109 | tile_index = (tile_index & 0x1f) + (tile_index & ~0x1f)*2; |
| 117 | code = clshroad_vram_0[ tile_index * 2 + 0x40 ]; | |
| 118 | // color = clshroad_vram_0[ tile_index * 2 + 0x41 ]; | |
| 110 | code = state->vram_0[ tile_index * 2 + 0x40 ]; | |
| 111 | // color = state->vram_0[ tile_index * 2 + 0x41 ]; | |
| 119 | 112 | SET_TILE_INFO( |
| 120 | 113 | 1, |
| 121 | 114 | code, |
| r10613 | r10614 | |
| 125 | 118 | |
| 126 | 119 | static TILE_GET_INFO( get_tile_info_0b ) |
| 127 | 120 | { |
| 121 | clshroad_state *state = machine->driver_data<clshroad_state>(); | |
| 128 | 122 | UINT8 code; |
| 129 | 123 | tile_index = (tile_index & 0x1f) + (tile_index & ~0x1f)*2; |
| 130 | code = clshroad_vram_0[ tile_index * 2 + 0x00 ]; | |
| 131 | // color = clshroad_vram_0[ tile_index * 2 + 0x01 ]; | |
| 124 | code = state->vram_0[ tile_index * 2 + 0x00 ]; | |
| 125 | // color = state->vram_0[ tile_index * 2 + 0x01 ]; | |
| 132 | 126 | SET_TILE_INFO( |
| 133 | 127 | 1, |
| 134 | 128 | code, |
| r10613 | r10614 | |
| 138 | 132 | |
| 139 | 133 | WRITE8_HANDLER( clshroad_vram_0_w ) |
| 140 | 134 | { |
| 135 | clshroad_state *state = space->machine->driver_data<clshroad_state>(); | |
| 141 | 136 | int tile_index = offset / 2; |
| 142 | 137 | int tile = (tile_index & 0x1f) + (tile_index & ~0x3f)/2; |
| 143 | clshroad_vram_0[offset] = data; | |
| 144 | if (tile_index & 0x20) tilemap_mark_tile_dirty(tilemap_0a, tile); | |
| 145 | else tilemap_mark_tile_dirty(tilemap_0b, tile); | |
| 138 | state->vram_0[offset] = data; | |
| 139 | if (tile_index & 0x20) tilemap_mark_tile_dirty(state->tilemap_0a, tile); | |
| 140 | else tilemap_mark_tile_dirty(state->tilemap_0b, tile); | |
| 146 | 141 | } |
| 147 | 142 | |
| 148 | 143 | /*************************************************************************** |
| r10613 | r10614 | |
| 182 | 177 | |
| 183 | 178 | static TILE_GET_INFO( get_tile_info_fb1 ) |
| 184 | 179 | { |
| 185 | UINT8 code = clshroad_vram_1[ tile_index + 0x000 ]; | |
| 186 | UINT8 color = clshroad_vram_1[ tile_index + 0x400 ] & 0x3f; | |
| 180 | clshroad_state *state = machine->driver_data<clshroad_state>(); | |
| 181 | UINT8 code = state->vram_1[ tile_index + 0x000 ]; | |
| 182 | UINT8 color = state->vram_1[ tile_index + 0x400 ] & 0x3f; | |
| 187 | 183 | tileinfo->group = color; |
| 188 | 184 | SET_TILE_INFO( |
| 189 | 185 | 2, |
| r10613 | r10614 | |
| 194 | 190 | |
| 195 | 191 | static TILE_GET_INFO( get_tile_info_1 ) |
| 196 | 192 | { |
| 197 | UINT8 code = clshroad_vram_1[ tile_index + 0x000 ]; | |
| 198 | UINT8 color = clshroad_vram_1[ tile_index + 0x400 ]; | |
| 193 | clshroad_state *state = machine->driver_data<clshroad_state>(); | |
| 194 | UINT8 code = state->vram_1[ tile_index + 0x000 ]; | |
| 195 | UINT8 color = state->vram_1[ tile_index + 0x400 ]; | |
| 199 | 196 | SET_TILE_INFO( |
| 200 | 197 | 2, |
| 201 | 198 | code + ((color & 0xf0)<<4), |
| r10613 | r10614 | |
| 205 | 202 | |
| 206 | 203 | WRITE8_HANDLER( clshroad_vram_1_w ) |
| 207 | 204 | { |
| 208 | clshroad_vram_1[offset] = data; | |
| 209 | tilemap_mark_tile_dirty(tilemap_1, offset % 0x400); | |
| 205 | clshroad_state *state = space->machine->driver_data<clshroad_state>(); | |
| 206 | state->vram_1[offset] = data; | |
| 207 | tilemap_mark_tile_dirty(state->tilemap_1, offset % 0x400); | |
| 210 | 208 | } |
| 211 | 209 | |
| 212 | 210 | |
| 213 | 211 | VIDEO_START( firebatl ) |
| 214 | 212 | { |
| 213 | clshroad_state *state = machine->driver_data<clshroad_state>(); | |
| 215 | 214 | /* These 2 use the graphics and scroll value */ |
| 216 | tilemap_0a = tilemap_create(machine, get_tile_info_0a,tilemap_scan_rows,16,16,0x20,0x10); | |
| 217 | tilemap_0b = tilemap_create(machine, get_tile_info_0b,tilemap_scan_rows,16,16,0x20,0x10); | |
| 215 | state->tilemap_0a = tilemap_create(machine, get_tile_info_0a,tilemap_scan_rows,16,16,0x20,0x10); | |
| 216 | state->tilemap_0b = tilemap_create(machine, get_tile_info_0b,tilemap_scan_rows,16,16,0x20,0x10); | |
| 218 | 217 | /* Text (No scrolling) */ |
| 219 | tilemap_1 = tilemap_create(machine, get_tile_info_fb1,tilemap_scan_rows_extra,8,8,0x24,0x20); | |
| 218 | state->tilemap_1 = tilemap_create(machine, get_tile_info_fb1,tilemap_scan_rows_extra,8,8,0x24,0x20); | |
| 220 | 219 | |
| 221 | tilemap_set_scroll_rows( tilemap_0a, 1); | |
| 222 | tilemap_set_scroll_rows( tilemap_0b, 1); | |
| 223 | tilemap_set_scroll_rows( tilemap_1, 1); | |
| 220 | tilemap_set_scroll_rows( state->tilemap_0a, 1); | |
| 221 | tilemap_set_scroll_rows( state->tilemap_0b, 1); | |
| 222 | tilemap_set_scroll_rows( state->tilemap_1, 1); | |
| 224 | 223 | |
| 225 | tilemap_set_scroll_cols( tilemap_0a, 1); | |
| 226 | tilemap_set_scroll_cols( tilemap_0b, 1); | |
| 227 | tilemap_set_scroll_cols( tilemap_1, 1); | |
| 224 | tilemap_set_scroll_cols( state->tilemap_0a, 1); | |
| 225 | tilemap_set_scroll_cols( state->tilemap_0b, 1); | |
| 226 | tilemap_set_scroll_cols( state->tilemap_1, 1); | |
| 228 | 227 | |
| 229 | tilemap_set_scrolldx( tilemap_0a, -0x30, -0xb5); | |
| 230 | tilemap_set_scrolldx( tilemap_0b, -0x30, -0xb5); | |
| 228 | tilemap_set_scrolldx( state->tilemap_0a, -0x30, -0xb5); | |
| 229 | tilemap_set_scrolldx( state->tilemap_0b, -0x30, -0xb5); | |
| 231 | 230 | |
| 232 | tilemap_set_transparent_pen( tilemap_0b, 0 ); | |
| 233 | colortable_configure_tilemap_groups(machine->colortable, tilemap_1, machine->gfx[2], 0x0f); | |
| 231 | tilemap_set_transparent_pen( state->tilemap_0b, 0 ); | |
| 232 | colortable_configure_tilemap_groups(machine->colortable, state->tilemap_1, machine->gfx[2], 0x0f); | |
| 234 | 233 | } |
| 235 | 234 | |
| 236 | 235 | VIDEO_START( clshroad ) |
| 237 | 236 | { |
| 237 | clshroad_state *state = machine->driver_data<clshroad_state>(); | |
| 238 | 238 | /* These 2 use the graphics and scroll value */ |
| 239 | tilemap_0a = tilemap_create(machine, get_tile_info_0a,tilemap_scan_rows,16,16,0x20,0x10); | |
| 240 | tilemap_0b = tilemap_create(machine, get_tile_info_0b,tilemap_scan_rows,16,16,0x20,0x10); | |
| 239 | state->tilemap_0a = tilemap_create(machine, get_tile_info_0a,tilemap_scan_rows,16,16,0x20,0x10); | |
| 240 | state->tilemap_0b = tilemap_create(machine, get_tile_info_0b,tilemap_scan_rows,16,16,0x20,0x10); | |
| 241 | 241 | /* Text (No scrolling) */ |
| 242 | tilemap_1 = tilemap_create(machine, get_tile_info_1,tilemap_scan_rows_extra,8,8,0x24,0x20); | |
| 242 | state->tilemap_1 = tilemap_create(machine, get_tile_info_1,tilemap_scan_rows_extra,8,8,0x24,0x20); | |
| 243 | 243 | |
| 244 | tilemap_set_scroll_rows( tilemap_0a, 1); | |
| 245 | tilemap_set_scroll_rows( tilemap_0b, 1); | |
| 246 | tilemap_set_scroll_rows( tilemap_1, 1); | |
| 244 | tilemap_set_scroll_rows( state->tilemap_0a, 1); | |
| 245 | tilemap_set_scroll_rows( state->tilemap_0b, 1); | |
| 246 | tilemap_set_scroll_rows( state->tilemap_1, 1); | |
| 247 | 247 | |
| 248 | tilemap_set_scroll_cols( tilemap_0a, 1); | |
| 249 | tilemap_set_scroll_cols( tilemap_0b, 1); | |
| 250 | tilemap_set_scroll_cols( tilemap_1, 1); | |
| 248 | tilemap_set_scroll_cols( state->tilemap_0a, 1); | |
| 249 | tilemap_set_scroll_cols( state->tilemap_0b, 1); | |
| 250 | tilemap_set_scroll_cols( state->tilemap_1, 1); | |
| 251 | 251 | |
| 252 | tilemap_set_scrolldx( tilemap_0a, -0x30, -0xb5); | |
| 253 | tilemap_set_scrolldx( tilemap_0b, -0x30, -0xb5); | |
| 252 | tilemap_set_scrolldx( state->tilemap_0a, -0x30, -0xb5); | |
| 253 | tilemap_set_scrolldx( state->tilemap_0b, -0x30, -0xb5); | |
| 254 | 254 | |
| 255 | tilemap_set_transparent_pen( tilemap_0b, 0x0f ); | |
| 256 | tilemap_set_transparent_pen( tilemap_1, 0x0f ); | |
| 255 | tilemap_set_transparent_pen( state->tilemap_0b, 0x0f ); | |
| 256 | tilemap_set_transparent_pen( state->tilemap_1, 0x0f ); | |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | |
| r10613 | r10614 | |
| 328 | 328 | |
| 329 | 329 | SCREEN_UPDATE( clshroad ) |
| 330 | 330 | { |
| 331 | int scrollx = clshroad_vregs[ 0 ] + (clshroad_vregs[ 1 ] << 8); | |
| 332 | // int priority = clshroad_vregs[ 2 ]; | |
| 331 | clshroad_state *state = screen->machine->driver_data<clshroad_state>(); | |
| 332 | int scrollx = state->vregs[ 0 ] + (state->vregs[ 1 ] << 8); | |
| 333 | // int priority = state->vregs[ 2 ]; | |
| 333 | 334 | |
| 334 | 335 | /* Only horizontal scrolling (these 2 layers use the same value) */ |
| 335 | tilemap_set_scrollx(tilemap_0a, 0, scrollx); | |
| 336 | tilemap_set_scrollx(tilemap_0b, 0, scrollx); | |
| 336 | tilemap_set_scrollx(state->tilemap_0a, 0, scrollx); | |
| 337 | tilemap_set_scrollx(state->tilemap_0b, 0, scrollx); | |
| 337 | 338 | |
| 338 | tilemap_draw(bitmap,cliprect,tilemap_0a,0,0); // Opaque | |
| 339 | tilemap_draw(bitmap,cliprect,tilemap_0b,0,0); | |
| 339 | tilemap_draw(bitmap,cliprect,state->tilemap_0a,0,0); // Opaque | |
| 340 | tilemap_draw(bitmap,cliprect,state->tilemap_0b,0,0); | |
| 340 | 341 | draw_sprites(screen->machine,bitmap,cliprect); |
| 341 | tilemap_draw(bitmap,cliprect,tilemap_1,0,0); | |
| 342 | tilemap_draw(bitmap,cliprect,state->tilemap_1,0,0); | |
| 342 | 343 | return 0; |
| 343 | 344 | } |
| r10613 | r10614 | |
|---|---|---|
| 99 | 99 | |
| 100 | 100 | /************************************* |
| 101 | 101 | * |
| 102 | * Global variables | |
| 103 | * | |
| 104 | *************************************/ | |
| 105 | ||
| 106 | /* RAM globals */ | |
| 107 | UINT8 *williams_videoram; | |
| 108 | UINT8 *williams2_tileram; | |
| 109 | UINT8 *blaster_palette_0; | |
| 110 | UINT8 *blaster_scanline_control; | |
| 111 | ||
| 112 | /* blitter globals */ | |
| 113 | UINT8 williams_blitter_config; | |
| 114 | UINT16 williams_blitter_clip_address; | |
| 115 | UINT8 williams_blitter_window_enable; | |
| 116 | ||
| 117 | /* tilemap globals */ | |
| 118 | UINT8 williams2_tilemap_config; | |
| 119 | ||
| 120 | /* rendering globals */ | |
| 121 | UINT8 williams_cocktail; | |
| 122 | ||
| 123 | ||
| 124 | ||
| 125 | /************************************* | |
| 126 | * | |
| 127 | * Static global variables | |
| 128 | * | |
| 129 | *************************************/ | |
| 130 | ||
| 131 | /* palette variables */ | |
| 132 | static rgb_t *palette_lookup; | |
| 133 | ||
| 134 | /* blitter variables */ | |
| 135 | static UINT8 blitterram[8]; | |
| 136 | static UINT8 blitter_xor; | |
| 137 | static UINT8 blitter_remap_index; | |
| 138 | static const UINT8 *blitter_remap; | |
| 139 | static UINT8 *blitter_remap_lookup; | |
| 140 | ||
| 141 | /* Blaster-specific variables */ | |
| 142 | static rgb_t blaster_color0; | |
| 143 | static UINT8 blaster_video_control; | |
| 144 | ||
| 145 | /* tilemap variables */ | |
| 146 | static tilemap_t *bg_tilemap; | |
| 147 | static UINT16 tilemap_xscroll; | |
| 148 | static UINT8 williams2_fg_color; | |
| 149 | ||
| 150 | ||
| 151 | ||
| 152 | /************************************* | |
| 153 | * | |
| 154 | 102 | * Prototypes |
| 155 | 103 | * |
| 156 | 104 | *************************************/ |
| r10613 | r10614 | |
| 170 | 118 | |
| 171 | 119 | static void state_save_register(running_machine *machine) |
| 172 | 120 | { |
| 173 | state_save_register_global(machine, williams_blitter_window_enable); | |
| 174 | state_save_register_global(machine, williams_cocktail); | |
| 175 | state_save_register_global_array(machine, blitterram); | |
| 176 | state_save_register_global(machine, blitter_remap_index); | |
| 177 | state_save_register_global(machine, blaster_color0); | |
| 178 | state_save_register_global(machine, blaster_video_control); | |
| 179 | state_save_register_global(machine, tilemap_xscroll); | |
| 180 | state_save_register_global(machine, williams2_fg_color); | |
| 121 | williams_state *state = machine->driver_data<williams_state>(); | |
| 122 | state_save_register_global(machine, state->blitter_window_enable); | |
| 123 | state_save_register_global(machine, state->cocktail); | |
| 124 | state_save_register_global_array(machine, state->blitterram); | |
| 125 | state_save_register_global(machine, state->blitter_remap_index); | |
| 126 | state_save_register_global(machine, state->blaster_color0); | |
| 127 | state_save_register_global(machine, state->blaster_video_control); | |
| 128 | state_save_register_global(machine, state->tilemap_xscroll); | |
| 129 | state_save_register_global(machine, state->williams2_fg_color); | |
| 181 | 130 | } |
| 182 | 131 | |
| 183 | 132 | |
| 184 | 133 | VIDEO_START( williams ) |
| 185 | 134 | { |
| 186 | blitter_init(machine, williams_blitter_config, NULL); | |
| 135 | williams_state *state = machine->driver_data<williams_state>(); | |
| 136 | blitter_init(machine, state->blitter_config, NULL); | |
| 187 | 137 | create_palette_lookup(machine); |
| 188 | 138 | state_save_register(machine); |
| 189 | 139 | } |
| r10613 | r10614 | |
| 191 | 141 | |
| 192 | 142 | VIDEO_START( blaster ) |
| 193 | 143 | { |
| 194 | blitter_init(machine, williams_blitter_config, machine->region("proms")->base()); | |
| 144 | williams_state *state = machine->driver_data<williams_state>(); | |
| 145 | blitter_init(machine, state->blitter_config, machine->region("proms")->base()); | |
| 195 | 146 | create_palette_lookup(machine); |
| 196 | 147 | state_save_register(machine); |
| 197 | 148 | } |
| r10613 | r10614 | |
| 199 | 150 | |
| 200 | 151 | VIDEO_START( williams2 ) |
| 201 | 152 | { |
| 202 | blitter_init(machine, williams_blitter_config, NULL); | |
| 153 | williams_state *state = machine->driver_data<williams_state>(); | |
| 154 | blitter_init(machine, state->blitter_config, NULL); | |
| 203 | 155 | |
| 204 | 156 | /* allocate paletteram */ |
| 205 | 157 | machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x400 * 2); |
| 206 | 158 | state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x400 * 2); |
| 207 | 159 | |
| 208 | 160 | /* create the tilemap */ |
| 209 | bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_cols, 24,16, 128,16); | |
| 210 | tilemap_set_scrolldx(bg_tilemap, 2, 0); | |
| 161 | state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_cols, 24,16, 128,16); | |
| 162 | tilemap_set_scrolldx(state->bg_tilemap, 2, 0); | |
| 211 | 163 | |
| 212 | 164 | state_save_register(machine); |
| 213 | 165 | } |
| r10613 | r10614 | |
| 222 | 174 | |
| 223 | 175 | SCREEN_UPDATE( williams ) |
| 224 | 176 | { |
| 177 | williams_state *state = screen->machine->driver_data<williams_state>(); | |
| 225 | 178 | rgb_t pens[16]; |
| 226 | 179 | int x, y; |
| 227 | 180 | |
| 228 | 181 | /* precompute the palette */ |
| 229 | 182 | for (x = 0; x < 16; x++) |
| 230 | pens[x] = palette_lookup[screen->machine->generic.paletteram.u8[x]]; | |
| 183 | pens[x] = state->palette_lookup[screen->machine->generic.paletteram.u8[x]]; | |
| 231 | 184 | |
| 232 | 185 | /* loop over rows */ |
| 233 | 186 | for (y = cliprect->min_y; y <= cliprect->max_y; y++) |
| 234 | 187 | { |
| 235 | UINT8 *source = & | |
| 188 | UINT8 *source = & | |
| 236 | 189 | UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0); |
| 237 | 190 | |
| 238 | 191 | /* loop over columns */ |
| r10613 | r10614 | |
| 249 | 202 | |
| 250 | 203 | SCREEN_UPDATE( blaster ) |
| 251 | 204 | { |
| 205 | williams_state *state = screen->machine->driver_data<williams_state>(); | |
| 252 | 206 | rgb_t pens[16]; |
| 253 | 207 | int x, y; |
| 254 | 208 | |
| 255 | 209 | /* precompute the palette */ |
| 256 | 210 | for (x = 0; x < 16; x++) |
| 257 | pens[x] = palette_lookup[screen->machine->generic.paletteram.u8[x]]; | |
| 211 | pens[x] = state->palette_lookup[screen->machine->generic.paletteram.u8[x]]; | |
| 258 | 212 | |
| 259 | 213 | /* if we're blitting from the top, start with a 0 for color 0 */ |
| 260 | if (cliprect->min_y == screen->visible_area().min_y || !(blaster_video_control & 1)) | |
| 261 | blaster_color0 = pens[0]; | |
| 214 | if (cliprect->min_y == screen->visible_area().min_y || !(state->blaster_video_control & 1)) | |
| 215 | state->blaster_color0 = pens[0]; | |
| 262 | 216 | |
| 263 | 217 | /* loop over rows */ |
| 264 | 218 | for (y = cliprect->min_y; y <= cliprect->max_y; y++) |
| 265 | 219 | { |
| 266 | int erase_behind = blaster_video_control & blaster_scanline_control[y] & 2; | |
| 267 | UINT8 *source = &williams_videoram[y]; | |
| 220 | int erase_behind = state->blaster_video_control & state->blaster_scanline_control[y] & 2; | |
| 221 | UINT8 *source = &state->videoram[y]; | |
| 268 | 222 | UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0); |
| 269 | 223 | |
| 270 | 224 | /* latch a new color0 pen? */ |
| 271 | if (blaster_video_control & blaster_scanline_control[y] & 1) | |
| 272 | blaster_color0 = palette_lookup[blaster_palette_0[y] ^ 0xff]; | |
| 225 | if (state->blaster_video_control & state->blaster_scanline_control[y] & 1) | |
| 226 | state->blaster_color0 = state->palette_lookup[state->blaster_palette_0[y] ^ 0xff]; | |
| 273 | 227 | |
| 274 | 228 | /* loop over columns */ |
| 275 | 229 | for (x = cliprect->min_x & ~1; x <= cliprect->max_x; x += 2) |
| r10613 | r10614 | |
| 281 | 235 | source[(x/2) * 256] = 0; |
| 282 | 236 | |
| 283 | 237 | /* now draw */ |
| 284 | dest[x+0] = (pix & 0xf0) ? pens[pix >> 4] : blaster_color0; | |
| 285 | dest[x+1] = (pix & 0x0f) ? pens[pix & 0x0f] : blaster_color0; | |
| 238 | dest[x+0] = (pix & 0xf0) ? pens[pix >> 4] : state->blaster_color0; | |
| 239 | dest[x+1] = (pix & 0x0f) ? pens[pix & 0x0f] : state->blaster_color0; | |
| 286 | 240 | } |
| 287 | 241 | } |
| 288 | 242 | return 0; |
| r10613 | r10614 | |
| 291 | 245 | |
| 292 | 246 | SCREEN_UPDATE( williams2 ) |
| 293 | 247 | { |
| 248 | williams_state *state = screen->machine->driver_data<williams_state>(); | |
| 294 | 249 | rgb_t pens[16]; |
| 295 | 250 | int x, y; |
| 296 | 251 | |
| 297 | 252 | /* draw the background */ |
| 298 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); | |
| 253 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 299 | 254 | |
| 300 | 255 | /* fetch the relevant pens */ |
| 301 | 256 | for (x = 1; x < 16; x++) |
| 302 | pens[x] = palette_get_color(screen->machine, williams2_fg_color * 16 + x); | |
| 257 | pens[x] = palette_get_color(screen->machine, state->williams2_fg_color * 16 + x); | |
| 303 | 258 | |
| 304 | 259 | /* loop over rows */ |
| 305 | 260 | for (y = cliprect->min_y; y <= cliprect->max_y; y++) |
| 306 | 261 | { |
| 307 | UINT8 *source = & | |
| 262 | UINT8 *source = & | |
| 308 | 263 | UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0); |
| 309 | 264 | |
| 310 | 265 | /* loop over columns */ |
| r10613 | r10614 | |
| 331 | 286 | |
| 332 | 287 | static void create_palette_lookup(running_machine *machine) |
| 333 | 288 | { |
| 289 | williams_state *state = machine->driver_data<williams_state>(); | |
| 334 | 290 | static const int resistances_rg[3] = { 1200, 560, 330 }; |
| 335 | 291 | static const int resistances_b[2] = { 560, 330 }; |
| 336 | 292 | double weights_r[3], weights_g[3], weights_b[2]; |
| r10613 | r10614 | |
| 345 | 301 | 2, resistances_b, weights_b, 0, 0); |
| 346 | 302 | |
| 347 | 303 | /* build a palette lookup */ |
| 348 | palette_lookup = auto_alloc_array(machine, rgb_t, 256); | |
| 304 | state->palette_lookup = auto_alloc_array(machine, rgb_t, 256); | |
| 349 | 305 | for (i = 0; i < 256; i++) |
| 350 | 306 | { |
| 351 | 307 | int r = combine_3_weights(weights_r, BIT(i,0), BIT(i,1), BIT(i,2)); |
| 352 | 308 | int g = combine_3_weights(weights_g, BIT(i,3), BIT(i,4), BIT(i,5)); |
| 353 | 309 | int b = combine_2_weights(weights_b, BIT(i,6), BIT(i,7)); |
| 354 | 310 | |
| 355 | palette_lookup[i] = MAKE_RGB(r, g, b); | |
| 311 | state->palette_lookup[i] = MAKE_RGB(r, g, b); | |
| 356 | 312 | } |
| 357 | 313 | } |
| 358 | 314 | |
| r10613 | r10614 | |
| 384 | 340 | |
| 385 | 341 | WRITE8_HANDLER( williams2_fg_select_w ) |
| 386 | 342 | { |
| 387 | williams2_fg_color = data & 0x3f; | |
| 343 | williams_state *state = space->machine->driver_data<williams_state>(); | |
| 344 | state->williams2_fg_color = data & 0x3f; | |
| 388 | 345 | } |
| 389 | 346 | |
| 390 | 347 | |
| r10613 | r10614 | |
| 416 | 373 | |
| 417 | 374 | static TILE_GET_INFO( get_tile_info ) |
| 418 | 375 | { |
| 376 | williams_state *state = machine->driver_data<williams_state>(); | |
| 419 | 377 | int mask = machine->gfx[0]->total_elements - 1; |
| 420 | int data = williams2_tileram[tile_index]; | |
| 378 | int data = state->williams2_tileram[tile_index]; | |
| 421 | 379 | int y = (tile_index >> 1) & 7; |
| 422 | 380 | int color = 0; |
| 423 | 381 | |
| 424 | switch (williams2_tilemap_config) | |
| 382 | switch (state->williams2_tilemap_config) | |
| 425 | 383 | { |
| 426 | 384 | case WILLIAMS_TILEMAP_MYSTICM: |
| 427 | 385 | { |
| r10613 | r10614 | |
| 450 | 408 | |
| 451 | 409 | WRITE8_HANDLER( williams2_bg_select_w ) |
| 452 | 410 | { |
| 411 | williams_state *state = space->machine->driver_data<williams_state>(); | |
| 453 | 412 | /* based on the tilemap config, only certain bits are used */ |
| 454 | 413 | /* the rest are determined by other factors */ |
| 455 | switch (williams2_tilemap_config) | |
| 414 | switch (state->williams2_tilemap_config) | |
| 456 | 415 | { |
| 457 | 416 | case WILLIAMS_TILEMAP_MYSTICM: |
| 458 | 417 | /* IC79 is a 74LS85 comparator that controls the low bit */ |
| r10613 | r10614 | |
| 469 | 428 | data &= 0x3f; |
| 470 | 429 | break; |
| 471 | 430 | } |
| 472 | tilemap_set_palette_offset(bg_tilemap, data * 16); | |
| 431 | tilemap_set_palette_offset(state->bg_tilemap, data * 16); | |
| 473 | 432 | } |
| 474 | 433 | |
| 475 | 434 | |
| 476 | 435 | WRITE8_HANDLER( williams2_tileram_w ) |
| 477 | 436 | { |
| 478 | williams2_tileram[offset] = data; | |
| 479 | tilemap_mark_tile_dirty(bg_tilemap, offset); | |
| 437 | williams_state *state = space->machine->driver_data<williams_state>(); | |
| 438 | state->williams2_tileram[offset] = data; | |
| 439 | tilemap_mark_tile_dirty(state->bg_tilemap, offset); | |
| 480 | 440 | } |
| 481 | 441 | |
| 482 | 442 | |
| 483 | 443 | WRITE8_HANDLER( williams2_xscroll_low_w ) |
| 484 | 444 | { |
| 485 | tilemap_xscroll = (tilemap_xscroll & ~0x00f) | ((data & 0x80) >> 4) | (data & 0x07); | |
| 486 | tilemap_set_scrollx(bg_tilemap, 0, (tilemap_xscroll & 7) + ((tilemap_xscroll >> 3) * 6)); | |
| 445 | williams_state *state = space->machine->driver_data<williams_state>(); | |
| 446 | state->tilemap_xscroll = (state->tilemap_xscroll & ~0x00f) | ((data & 0x80) >> 4) | (data & 0x07); | |
| 447 | tilemap_set_scrollx(state->bg_tilemap, 0, (state->tilemap_xscroll & 7) + ((state->tilemap_xscroll >> 3) * 6)); | |
| 487 | 448 | } |
| 488 | 449 | |
| 489 | 450 | |
| 490 | 451 | WRITE8_HANDLER( williams2_xscroll_high_w ) |
| 491 | 452 | { |
| 492 | tilemap_xscroll = (tilemap_xscroll & 0x00f) | (data << 4); | |
| 493 | tilemap_set_scrollx(bg_tilemap, 0, (tilemap_xscroll & 7) + ((tilemap_xscroll >> 3) * 6)); | |
| 453 | williams_state *state = space->machine->driver_data<williams_state>(); | |
| 454 | state->tilemap_xscroll = (state->tilemap_xscroll & 0x00f) | (data << 4); | |
| 455 | tilemap_set_scrollx(state->bg_tilemap, 0, (state->tilemap_xscroll & 7) + ((state->tilemap_xscroll >> 3) * 6)); | |
| 494 | 456 | } |
| 495 | 457 | |
| 496 | 458 | |
| r10613 | r10614 | |
| 503 | 465 | |
| 504 | 466 | WRITE8_HANDLER( blaster_remap_select_w ) |
| 505 | 467 | { |
| 506 | blitter_remap_index = data; | |
| 507 | blitter_remap = blitter_remap_lookup + data * 256; | |
| 468 | williams_state *state = space->machine->driver_data<williams_state>(); | |
| 469 | state->blitter_remap_index = data; | |
| 470 | state->blitter_remap = state->blitter_remap_lookup + data * 256; | |
| 508 | 471 | } |
| 509 | 472 | |
| 510 | 473 | |
| 511 | 474 | WRITE8_HANDLER( blaster_video_control_w ) |
| 512 | 475 | { |
| 513 | blaster_video_control = data; | |
| 476 | williams_state *state = space->machine->driver_data<williams_state>(); | |
| 477 | state->blaster_video_control = data; | |
| 514 | 478 | } |
| 515 | 479 | |
| 516 | 480 | |
| r10613 | r10614 | |
| 523 | 487 | |
| 524 | 488 | static void blitter_init(running_machine *machine, int blitter_config, const UINT8 *remap_prom) |
| 525 | 489 | { |
| 490 | williams_state *state = machine->driver_data<williams_state>(); | |
| 526 | 491 | static const UINT8 dummy_table[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 }; |
| 527 | 492 | int i,j; |
| 528 | 493 | |
| 529 | 494 | /* by default, there is no clipping window - this will be touched only by games that have one */ |
| 530 | | |
| 495 | | |
| 531 | 496 | |
| 532 | 497 | /* switch off the video config */ |
| 533 | blitter_xor = (blitter_config == WILLIAMS_BLITTER_SC01) ? 4 : 0; | |
| 498 | state->blitter_xor = (blitter_config == WILLIAMS_BLITTER_SC01) ? 4 : 0; | |
| 534 | 499 | |
| 535 | 500 | /* create the remap table; if no PROM, make an identity remap table */ |
| 536 | blitter_remap_lookup = auto_alloc_array(machine, UINT8, 256 * 256); | |
| 537 | blitter_remap_index = 0; | |
| 538 | blitter_remap = blitter_remap_lookup; | |
| 501 | state->blitter_remap_lookup = auto_alloc_array(machine, UINT8, 256 * 256); | |
| 502 | state->blitter_remap_index = 0; | |
| 503 | state->blitter_remap = state->blitter_remap_lookup; | |
| 539 | 504 | for (i = 0; i < 256; i++) |
| 540 | 505 | { |
| 541 | 506 | const UINT8 *table = remap_prom ? (remap_prom + (i & 0x7f) * 16) : dummy_table; |
| 542 | 507 | for (j = 0; j < 256; j++) |
| 543 | blitter_remap_lookup[i * 256 + j] = (table[j >> 4] << 4) | table[j & 0x0f]; | |
| 508 | state->blitter_remap_lookup[i * 256 + j] = (table[j >> 4] << 4) | table[j & 0x0f]; | |
| 544 | 509 | } |
| 545 | 510 | } |
| 546 | 511 | |
| 547 | 512 | |
| 548 | 513 | WRITE8_HANDLER( williams_blitter_w ) |
| 549 | 514 | { |
| 515 | williams_state *state = space->machine->driver_data<williams_state>(); | |
| 550 | 516 | int sstart, dstart, w, h, accesses; |
| 551 | 517 | int estimated_clocks_at_4MHz; |
| 552 | 518 | |
| 553 | 519 | /* store the data */ |
| 554 | blitterram[offset] = data; | |
| 520 | state->blitterram[offset] = data; | |
| 555 | 521 | |
| 556 | 522 | /* only writes to location 0 trigger the blit */ |
| 557 | 523 | if (offset != 0) |
| 558 | 524 | return; |
| 559 | 525 | |
| 560 | 526 | /* compute the starting locations */ |
| 561 | sstart = (blitterram[2] << 8) + blitterram[3]; | |
| 562 | dstart = (blitterram[4] << 8) + blitterram[5]; | |
| 527 | sstart = (state->blitterram[2] << 8) + state->blitterram[3]; | |
| 528 | dstart = (state->blitterram[4] << 8) + state->blitterram[5]; | |
| 563 | 529 | |
| 564 | 530 | /* compute the width and height */ |
| 565 | w = blitterram[6] ^ blitter_xor; | |
| 566 | h = blitterram[7] ^ blitter_xor; | |
| 531 | w = state->blitterram[6] ^ state->blitter_xor; | |
| 532 | h = state->blitterram[7] ^ state->blitter_xor; | |
| 567 | 533 | |
| 568 | 534 | /* adjust the width and height */ |
| 569 | 535 | if (w == 0) w = 1; |
| r10613 | r10614 | |
| 582 | 548 | /* Log blits */ |
| 583 | 549 | logerror("%04X:Blit @ %3d : %02X%02X -> %02X%02X, %3dx%3d, mask=%02X, flags=%02X, icount=%d, win=%d\n", |
| 584 | 550 | cpu_get_pc(space->cpu), space->machine->primary_screen->vpos(), |
| 585 | blitterram[2], blitterram[3], | |
| 586 | blitterram[4], blitterram[5], | |
| 587 | blitterram[6], blitterram[7], | |
| 588 | blitterram[1], blitterram[0], | |
| 589 | ((estimated_clocks_at_4MHz + 3) / 4), williams_blitter_window_enable); | |
| 551 | state->blitterram[2], state->blitterram[3], | |
| 552 | state->blitterram[4], state->blitterram[5], | |
| 553 | state->blitterram[6], state->blitterram[7], | |
| 554 | state->blitterram[1], state->blitterram[0], | |
| 555 | ((estimated_clocks_at_4MHz + 3) / 4), state->blitter_window_enable); | |
| 590 | 556 | } |
| 591 | 557 | |
| 592 | 558 | |
| 593 | 559 | WRITE8_HANDLER( williams2_blit_window_enable_w ) |
| 594 | 560 | { |
| 595 | williams_blitter_window_enable = data & 0x01; | |
| 561 | williams_state *state = space->machine->driver_data<williams_state>(); | |
| 562 | state->blitter_window_enable = data & 0x01; | |
| 596 | 563 | } |
| 597 | 564 | |
| 598 | 565 | |
| r10613 | r10614 | |
| 605 | 572 | |
| 606 | 573 | INLINE void blit_pixel(address_space *space, int offset, int srcdata, int data, int mask, int solid) |
| 607 | 574 | { |
| 575 | williams_state *state = space->machine->driver_data<williams_state>(); | |
| 608 | 576 | /* always read from video RAM regardless of the bank setting */ |
| 609 | int pix = (offset < 0xc000) ? | |
| 577 | int pix = (offset < 0xc000) ? | |
| 610 | 578 | |
| 611 | 579 | /* handle transparency */ |
| 612 | 580 | if (data & 0x08) |
| r10613 | r10614 | |
| 625 | 593 | /* if the window is enabled, only blit to videoram below the clipping address */ |
| 626 | 594 | /* note that we have to allow blits to non-video RAM (e.g. tileram) because those */ |
| 627 | 595 | /* are not blocked by the window enable */ |
| 628 | if (! | |
| 596 | if (! | |
| 629 | 597 | space->write_byte(offset, pix); |
| 630 | 598 | } |
| 631 | 599 | |
| 632 | 600 | |
| 633 | 601 | static int blitter_core(address_space *space, int sstart, int dstart, int w, int h, int data) |
| 634 | 602 | { |
| 603 | williams_state *state = space->machine->driver_data<williams_state>(); | |
| 635 | 604 | int source, sxadv, syadv; |
| 636 | 605 | int dest, dxadv, dyadv; |
| 637 | 606 | int i, j, solid; |
| r10613 | r10614 | |
| 652 | 621 | return accesses; |
| 653 | 622 | |
| 654 | 623 | /* set the solid pixel value to the mask value */ |
| 655 | solid = blitterram[1]; | |
| 624 | solid = state->blitterram[1]; | |
| 656 | 625 | |
| 657 | 626 | /* first case: no shifting */ |
| 658 | 627 | if (!(data & 0x20)) |
| r10613 | r10614 | |
| 666 | 635 | /* loop over the width */ |
| 667 | 636 | for (j = w; j > 0; j--) |
| 668 | 637 | { |
| 669 | blit_pixel(space, dest, blitter_remap[space->read_byte(source)], data, keepmask, solid); | |
| 638 | blit_pixel(space, dest, state->blitter_remap[space->read_byte(source)], data, keepmask, solid); | |
| 670 | 639 | accesses += 2; |
| 671 | 640 | |
| 672 | 641 | /* advance */ |
| r10613 | r10614 | |
| 700 | 669 | dest = dstart & 0xffff; |
| 701 | 670 | |
| 702 | 671 | /* left edge case */ |
| 703 | pixdata = blitter_remap[space->read_byte(source)]; | |
| 672 | pixdata = state->blitter_remap[space->read_byte(source)]; | |
| 704 | 673 | blit_pixel(space, dest, (pixdata >> 4) & 0x0f, data, keepmask | 0xf0, solid); |
| 705 | 674 | accesses += 2; |
| 706 | 675 | |
| r10613 | r10614 | |
| 710 | 679 | /* loop over the width */ |
| 711 | 680 | for (j = w - 1; j > 0; j--) |
| 712 | 681 | { |
| 713 | pixdata = (pixdata << 8) | blitter_remap[space->read_byte(source)]; | |
| 682 | pixdata = (pixdata << 8) | state->blitter_remap[space->read_byte(source)]; | |
| 714 | 683 | blit_pixel(space, dest, (pixdata >> 4) & 0xff, data, keepmask, solid); |
| 715 | 684 | accesses += 2; |
| 716 | 685 |
| r10613 | r10614 | |
|---|---|---|
| 8 | 8 | #include "includes/triplhnt.h" |
| 9 | 9 | |
| 10 | 10 | |
| 11 | UINT8* triplhnt_playfield_ram; | |
| 12 | UINT8* triplhnt_hpos_ram; | |
| 13 | UINT8* triplhnt_vpos_ram; | |
| 14 | UINT8* triplhnt_code_ram; | |
| 15 | UINT8* triplhnt_orga_ram; | |
| 16 | ||
| 17 | int triplhnt_sprite_zoom; | |
| 18 | int triplhnt_sprite_bank; | |
| 19 | ||
| 20 | static bitmap_t* helper; | |
| 21 | static tilemap_t* bg_tilemap; | |
| 22 | ||
| 23 | ||
| 24 | 11 | static TILE_GET_INFO( get_tile_info ) |
| 25 | 12 | { |
| 26 | int code = triplhnt_playfield_ram[tile_index] & 0x3f; | |
| 13 | triplhnt_state *state = machine->driver_data<triplhnt_state>(); | |
| 14 | int code = state->playfield_ram[tile_index] & 0x3f; | |
| 27 | 15 | |
| 28 | 16 | SET_TILE_INFO(2, code, code == 0x3f ? 1 : 0, 0); |
| 29 | 17 | } |
| r10613 | r10614 | |
| 31 | 19 | |
| 32 | 20 | VIDEO_START( triplhnt ) |
| 33 | 21 | { |
| 34 | helper = machine->primary_screen->alloc_compatible_bitmap(); | |
| 22 | triplhnt_state *state = machine->driver_data<triplhnt_state>(); | |
| 23 | state->helper = machine->primary_screen->alloc_compatible_bitmap(); | |
| 35 | 24 | |
| 36 | bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 16, 16, 16, 16); | |
| 25 | state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 16, 16, 16, 16); | |
| 37 | 26 | } |
| 38 | 27 | |
| 39 | 28 | |
| r10613 | r10614 | |
| 45 | 34 | |
| 46 | 35 | static void draw_sprites(running_machine *machine, bitmap_t* bitmap, const rectangle* cliprect) |
| 47 | 36 | { |
| 37 | triplhnt_state *state = machine->driver_data<triplhnt_state>(); | |
| 48 | 38 | int i; |
| 49 | 39 | |
| 50 | 40 | int hit_line = 999; |
| r10613 | r10614 | |
| 54 | 44 | { |
| 55 | 45 | rectangle rect; |
| 56 | 46 | |
| 57 | int j = (t | |
| 47 | int j = (sta | |
| 58 | 48 | |
| 59 | 49 | /* software sorts sprites by x and stores order in orga RAM */ |
| 60 | 50 | |
| 61 | int hpos = triplhnt_hpos_ram[j] ^ 255; | |
| 62 | int vpos = triplhnt_vpos_ram[j] ^ 255; | |
| 63 | int code = triplhnt_code_ram[j] ^ 255; | |
| 51 | int hpos = state->hpos_ram[j] ^ 255; | |
| 52 | int vpos = state->vpos_ram[j] ^ 255; | |
| 53 | int code = state->code_ram[j] ^ 255; | |
| 64 | 54 | |
| 65 | 55 | if (hpos == 255) |
| 66 | 56 | continue; |
| 67 | 57 | |
| 68 | 58 | /* sprite placement might be wrong */ |
| 69 | 59 | |
| 70 | if (t | |
| 60 | if (sta | |
| 71 | 61 | { |
| 72 | 62 | rect.min_x = hpos - 16; |
| 73 | 63 | rect.min_y = 196 - vpos; |
| r10613 | r10614 | |
| 84 | 74 | |
| 85 | 75 | /* render sprite to auxiliary bitmap */ |
| 86 | 76 | |
| 87 | drawgfx_opaque(helper, cliprect, machine->gfx[triplhnt_sprite_zoom], | |
| 88 | 2 * code + triplhnt_sprite_bank, 0, code & 8, 0, | |
| 77 | drawgfx_opaque(state->helper, cliprect, machine->gfx[state->sprite_zoom], | |
| 78 | 2 * code + state->sprite_bank, 0, code & 8, 0, | |
| 89 | 79 | rect.min_x, rect.min_y); |
| 90 | 80 | |
| 91 | 81 | if (rect.min_x < cliprect->min_x) |
| r10613 | r10614 | |
| 107 | 97 | { |
| 108 | 98 | for (y = rect.min_y; y <= rect.max_y; y++) |
| 109 | 99 | { |
| 110 | pen_t a = *BITMAP_ADDR16(helper, y, x); | |
| 100 | pen_t a = *BITMAP_ADDR16(state->helper, y, x); | |
| 111 | 101 | pen_t b = *BITMAP_ADDR16(bitmap, y, x); |
| 112 | 102 | |
| 113 | 103 | if (a == 2 && b == 7) |
| r10613 | r10614 | |
| 130 | 120 | |
| 131 | 121 | SCREEN_UPDATE( triplhnt ) |
| 132 | 122 | { |
| 123 | triplhnt_state *state = screen->machine->driver_data<triplhnt_state>(); | |
| 133 | 124 | device_t *discrete = screen->machine->device("discrete"); |
| 134 | 125 | |
| 135 | tilemap_mark_all_tiles_dirty(bg_tilemap); | |
| 126 | tilemap_mark_all_tiles_dirty(state->bg_tilemap); | |
| 136 | 127 | |
| 137 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); | |
| 128 | tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); | |
| 138 | 129 | |
| 139 | 130 | draw_sprites(screen->machine, bitmap, cliprect); |
| 140 | 131 | |
| 141 | discrete_sound_w(discrete, TRIPLHNT_BEAR_ROAR_DATA, triplhnt_playfield_ram[0xfa] & 15); | |
| 142 | discrete_sound_w(discrete, TRIPLHNT_SHOT_DATA, triplhnt_playfield_ram[0xfc] & 15); | |
| 132 | discrete_sound_w(discrete, TRIPLHNT_BEAR_ROAR_DATA, state->playfield_ram[0xfa] & 15); | |
| 133 | discrete_sound_w(discrete, TRIPLHNT_SHOT_DATA, state->playfield_ram[0xfc] & 15); | |
| 143 | 134 | return 0; |
| 144 | 135 | } |
| r10613 | r10614 | |
|---|---|---|
| 2 | 2 | #include "includes/pirates.h" |
| 3 | 3 | |
| 4 | 4 | |
| 5 | UINT16 *pirates_tx_tileram, *pirates_spriteram; | |
| 6 | UINT16 *pirates_fg_tileram, *pirates_bg_tileram; | |
| 7 | UINT16 *pirates_scroll; | |
| 8 | ||
| 9 | static tilemap_t *tx_tilemap, *fg_tilemap, *bg_tilemap; | |
| 10 | ||
| 11 | 5 | /* Video Hardware */ |
| 12 | 6 | |
| 13 | 7 | /* tilemaps */ |
| 14 | 8 | |
| 15 | 9 | static TILE_GET_INFO( get_tx_tile_info ) |
| 16 | 10 | { |
| 17 | int code = pirates_tx_tileram[tile_index*2]; | |
| 18 | int colr = pirates_tx_tileram[tile_index*2+1]; | |
| 11 | pirates_state *state = machine->driver_data<pirates_state>(); | |
| 12 | int code = state->tx_tileram[tile_index*2]; | |
| 13 | int colr = state->tx_tileram[tile_index*2+1]; | |
| 19 | 14 | |
| 20 | 15 | SET_TILE_INFO(0,code,colr,0); |
| 21 | 16 | } |
| 22 | 17 | |
| 23 | 18 | static TILE_GET_INFO( get_fg_tile_info ) |
| 24 | 19 | { |
| 25 | int code = pirates_fg_tileram[tile_index*2]; | |
| 26 | int colr = pirates_fg_tileram[tile_index*2+1]+0x80; | |
| 20 | pirates_state *state = machine->driver_data<pirates_state>(); | |
| 21 | int code = state->fg_tileram[tile_index*2]; | |
| 22 | int colr = state->fg_tileram[tile_index*2+1]+0x80; | |
| 27 | 23 | |
| 28 | 24 | SET_TILE_INFO(0,code,colr,0); |
| 29 | 25 | } |
| 30 | 26 | |
| 31 | 27 | static TILE_GET_INFO( get_bg_tile_info ) |
| 32 | 28 | { |
| 33 | int code = pirates_bg_tileram[tile_index*2]; | |
| 34 | int colr = pirates_bg_tileram[tile_index*2+1]+ 0x100; | |
| 29 | pirates_state *state = machine->driver_data<pirates_state>(); | |
| 30 | int code = state->bg_tileram[tile_index*2]; | |
| 31 | int colr = state->bg_tileram[tile_index*2+1]+ 0x100; | |
| 35 | 32 | |
| 36 | 33 | SET_TILE_INFO(0,code,colr,0); |
| 37 | 34 | } |
| r10613 | r10614 | |
| 41 | 38 | |
| 42 | 39 | VIDEO_START(pirates) |
| 43 | 40 | { |
| 44 | tx_tilemap = tilemap_create(machine, get_tx_tile_info,tilemap_scan_cols,8,8,36,32); | |
| 41 | pirates_state *state = machine->driver_data<pirates_state>(); | |
| 42 | state->tx_tilemap = tilemap_create(machine, get_tx_tile_info,tilemap_scan_cols,8,8,36,32); | |
| 45 | 43 | |
| 46 | 44 | /* Not sure how big they can be, Pirates uses only 32 columns, Genix 44 */ |
| 47 | fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_cols,8,8,64,32); | |
| 48 | bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_cols, 8,8,64,32); | |
| 45 | state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_cols,8,8,64,32); | |
| 46 | state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_cols, 8,8,64,32); | |
| 49 | 47 | |
| 50 | tilemap_set_transparent_pen(tx_tilemap,0); | |
| 51 | tilemap_set_transparent_pen(fg_tilemap,0); | |
| 48 | tilemap_set_transparent_pen(state->tx_tilemap,0); | |
| 49 | tilemap_set_transparent_pen(state->fg_tilemap,0); | |
| 52 | 50 | } |
| 53 | 51 | |
| 54 | 52 | |
| 55 | 53 | |
| 56 | 54 | WRITE16_HANDLER( pirates_tx_tileram_w ) |
| 57 | 55 | { |
| 58 | COMBINE_DATA(pirates_tx_tileram+offset); | |
| 59 | tilemap_mark_tile_dirty(tx_tilemap,offset/2); | |
| 56 | pirates_state *state = space->machine->driver_data<pirates_state>(); | |
| 57 | COMBINE_DATA(state->tx_tileram+offset); | |
| 58 | tilemap_mark_tile_dirty(state->tx_tilemap,offset/2); | |
| 60 | 59 | } |
| 61 | 60 | |
| 62 | 61 | WRITE16_HANDLER( pirates_fg_tileram_w ) |
| 63 | 62 | { |
| 64 | COMBINE_DATA(pirates_fg_tileram+offset); | |
| 65 | tilemap_mark_tile_dirty(fg_tilemap,offset/2); | |
| 63 | pirates_state *state = space->machine->driver_data<pirates_state>(); | |
| 64 | COMBINE_DATA(state->fg_tileram+offset); | |
| 65 | tilemap_mark_tile_dirty(state->fg_tilemap,offset/2); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | WRITE16_HANDLER( pirates_bg_tileram_w ) |
| 69 | 69 | { |
| 70 | COMBINE_DATA(pirates_bg_tileram+offset); | |
| 71 | tilemap_mark_tile_dirty(bg_tilemap,offset/2); | |
| 70 | pirates_state *state = space->machine->driver_data<pirates_state>(); | |
| 71 | COMBINE_DATA(state->bg_tileram+offset); | |
| 72 | tilemap_mark_tile_dirty(state->bg_tilemap,offset/2); | |
| 72 | 73 | } |
| 73 | 74 | |
| 74 | 75 | |
| 75 | 76 | |
| 76 | 77 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) |
| 77 | 78 | { |
| 79 | pirates_state *state = machine->driver_data<pirates_state>(); | |
| 78 | 80 | const gfx_element *gfx = machine->gfx[1]; |
| 79 | UINT16 *source = | |
| 81 | UINT16 *source = st | |
| 80 | 82 | UINT16 *finish = source + 0x800/2-4; |
| 81 | 83 | |
| 82 | 84 | while( source<finish ) |
| r10613 | r10614 | |
| 107 | 109 | |
| 108 | 110 | SCREEN_UPDATE(pirates) |
| 109 | 111 | { |
| 110 | tilemap_set_scrollx(bg_tilemap,0,pirates_scroll[0]); | |
| 111 | tilemap_set_scrollx(fg_tilemap,0,pirates_scroll[0]); | |
| 112 | tilemap_draw(bitmap,cliprect,bg_tilemap,0,0); | |
| 113 | tilemap_draw(bitmap,cliprect,fg_tilemap,0,0); | |
| 112 | pirates_state *state = screen->machine->driver_data<pirates_state>(); | |
| 113 | tilemap_set_scrollx(state->bg_tilemap,0,state->scroll[0]); | |
| 114 | tilemap_set_scrollx(state->fg_tilemap,0,state->scroll[0]); | |
| 115 | tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0); | |
| 116 | tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0); | |
| 114 | 117 | draw_sprites(screen->machine,bitmap,cliprect); |
| 115 | tilemap_draw(bitmap,cliprect,tx_tilemap,0,0); | |
| 118 | tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0); | |
| 116 | 119 | return 0; |
| 117 | 120 | } |
| r10613 | r10614 | |
|---|---|---|
| 487 | 487 | void Load(char *name,byte *buffer,int from, int length) |
| 488 | 488 | { |
| 489 | 489 | /* |
| 490 | emu_file file(options, NULL, OPEN_FLAG_READ); | |
| 491 | file_error filerr = file.open(name); | |
| 492 | if (filerr != FILERR_NONE) | |
| 493 | return; | |
| 494 | while (length--) | |
| 495 | buffer[from++]=file->getc(); | |
| 490 | emu_file file(options, NULL, OPEN_FLAG_READ); | |
| 491 | file_error filerr = file.open(name); | |
| 492 | if (filerr != FILERR_NONE) | |
| 493 | return; | |
| 494 | while (length--) | |
| 495 | buffer[from++]=file->getc(); | |
| 496 | 496 | */ |
| 497 | 497 | } |
| 498 | 498 |
| r10613 | r10614 | |
|---|---|---|
| 1 | 1 | <?xml version="1.0"?> |
| 2 | 2 | <mamelayout version="2"> |
| 3 | <element name="overlay"> | |
| 3 | <element name="overlay_green"> | |
| 4 | 4 | <rect> |
| 5 | <bounds left="0" top="0" right=" | |
| 5 | <bounds left="0" top="0" right="4 | |
| 6 | 6 | <color red="0.25" green="1.0" blue="0.125" /> |
| 7 | 7 | </rect> |
| 8 | 8 | </element> |
| 9 | <element name="overlay_yellow"> | |
| 10 | <rect> | |
| 11 | <bounds left="0" top="0" right="4" bottom="3" /> | |
| 12 | <color red="1.0" green="1.0" blue="0.125" /> | |
| 13 | </rect> | |
| 14 | </element> | |
| 9 | 15 | |
| 10 | <view name=" | |
| 16 | <view name="G | |
| 11 | 17 | <screen index="0"> |
| 12 | 18 | <bounds left="0" top="0" right="4" bottom="3" /> |
| 13 | 19 | </screen> |
| 14 | <overlay name="overlay" element="overlay"> | |
| 20 | <overlay name="overlay" element="overlay_green"> | |
| 15 | 21 | <bounds left="0" top="0" right="4" bottom="3" /> |
| 16 | 22 | </overlay> |
| 17 | 23 | </view> |
| 24 | <view name="Yellow Overlay"> | |
| 25 | <screen index="0"> | |
| 26 | <bounds left="0" top="0" right="4" bottom="3" /> | |
| 27 | </screen> | |
| 28 | <overlay name="overlay" element="overlay_yellow"> | |
| 29 | <bounds left="0" top="0" right="4" bottom="3" /> | |
| 30 | </overlay> | |
| 31 | </view> | |
| 18 | 32 | </mamelayout> |
| r10613 | r10614 | |
|---|---|---|
| 3 | 3 | <element name="shifter" defstate="0"> |
| 4 | 4 | <rect> |
| 5 | 5 | <bounds left="0" right="32" top="0" bottom="64" /> |
| 6 | <color red="0.8" green="0. | |
| 6 | <color red="0.8" green="0.4" blue="0.3" /> | |
| 7 | 7 | </rect> |
| 8 | 8 | <rect> |
| 9 | 9 | <bounds left="2" right="30" top="2" bottom="62" /> |
| 10 | <color red="0. | |
| 10 | <color red="0.2" green="0.18" blue="0.16" /> | |
| 11 | 11 | </rect> |
| 12 | 12 | <rect> |
| 13 | 13 | <bounds left="14" right="18" top="15" bottom="49" /> |
| r10613 | r10614 | |
| 23 | 23 | </disk> |
| 24 | 24 | <text string="LOW" state="0"> |
| 25 | 25 | <bounds left="3" right="29" top="2" bottom="12" /> |
| 26 | <color red="1.0" green="1.0" blue="0. | |
| 26 | <color red="1.0" green="1.0" blue="0.4" /> | |
| 27 | 27 | </text> |
| 28 | 28 | <text string="LOW" state="1"> |
| 29 | 29 | <bounds left="3" right="29" top="2" bottom="12" /> |
| r10613 | r10614 | |
| 36 | 36 | </text> |
| 37 | 37 | <text string="HIGH" state="1"> |
| 38 | 38 | <bounds left="3" right="29" top="52" bottom="62" /> |
| 39 | <color red="1.0" green="1.0" blue="0. | |
| 39 | <color red="1.0" green="1.0" blue="0.4" /> | |
| 40 | 40 | </text> |
| 41 | 41 | <disk state="0"> |
| 42 | 42 | <bounds left="9" right="23" top="14" bottom="28" /> |
| 43 | <color red="0.8" green="0. | |
| 43 | <color red="0.8" green="0.4" blue="0.3" /> | |
| 44 | 44 | </disk> |
| 45 | 45 | <disk state="1"> |
| 46 | 46 | <bounds left="9" right="23" top="36" bottom="50" /> |
| 47 | <color red="0.8" green="0. | |
| 47 | <color red="0.8" green="0.4" blue="0.3" /> | |
| 48 | 48 | </disk> |
| 49 | 49 | </element> |
| 50 | 50 | <view name="Shifter-R"> |
| r10613 | r10614 | |
| 53 | 53 | </screen> |
| 54 | 54 | <bezel element="shifter" inputtag="SERVICE" inputmask="0x10"> |
| 55 | 55 | <bounds x="606" y="414" width="32" height="64" /> |
| 56 | <color alpha="0. | |
| 56 | <color alpha="0.6" /> | |
| 57 | 57 | </bezel> |
| 58 | 58 | </view> |
| 59 | 59 | <view name="Shifter-L"> |
| r10613 | r10614 | |
| 62 | 62 | </screen> |
| 63 | 63 | <bezel element="shifter" inputtag="SERVICE" inputmask="0x10"> |
| 64 | 64 | <bounds x="2" y="414" width="32" height="64" /> |
| 65 | <color alpha="0. | |
| 65 | <color alpha="0.6" /> | |
| 66 | 66 | </bezel> |
| 67 | 67 | </view> |
| 68 | 68 | </mamelayout> |
| r10613 | r10614 | |
|---|---|---|
| 1 | 1 | <?xml version="1.0"?> |
| 2 | 2 | <mamelayout version="2"> |
| 3 | <element name="overlay" defstate="1"> | |
| 4 | <rect state="1"> | |
| 5 | <bounds left="0" top="0" right="28" bottom="34" /> | |
| 3 | <element name="overlay"> | |
| 4 | <rect> | |
| 5 | <bounds left="0" top="0" right="224" bottom="272" /> | |
| 6 | 6 | <color red="1" green="1" blue="1" /> |
| 7 | 7 | </rect> |
| 8 | <rect state="1"> | |
| 9 | <bounds left="0" top="0" right="1" bottom="0" /> | |
| 10 | <color red="1" green="1" blue="1" /> | |
| 11 | </rect> | |
| 12 | <rect state="1"> | |
| 13 | <bounds left="0" top="32" right="28" bottom="34" /> | |
| 14 | <color red="1" green="1" blue="1" /> | |
| 15 | </rect> | |
| 16 | 8 | |
| 17 | <rect state="1"> | |
| 18 | <bounds left="0" top="1" right="28" bottom="4" /> | |
| 19 | <color red="0.878" green="0" blue="0.627" /> | |
| 20 | </rect> | |
| 21 | ||
| 22 | <rect state="1"> | |
| 23 | <bounds left="24" top="4" right="28" bottom="5" /> | |
| 9 | <rect> | |
| 10 | <bounds left="191.5" top="7.5" right="224" bottom="40.5" /> | |
| 24 | 11 | <color red="0.627" green="0" blue="0.878" /> |
| 25 | 12 | </rect> |
| 26 | <rect state="1"> | |
| 27 | <bounds left="0" top="4" right="4" bottom="5" /> | |
| 13 | <rect> | |
| 14 | <bounds left="0" top="7.5" right="32.5" bottom="40.5" /> | |
| 28 | 15 | <color red="0.627" green="0" blue="0.878" /> |
| 29 | 16 | </rect> |
| 30 | 17 | |
| 31 | <rect state="1"> | |
| 32 | <bounds left="4" top="4" right="24" bottom="5" /> | |
| 18 | <rect> | |
| 19 | <bounds left="23.5" top="7.5" right="200.5" bottom="32.5" /> | |
| 20 | <color red="0.878" green="0" blue="0.627" /> | |
| 21 | </rect> | |
| 22 | ||
| 23 | <rect> | |
| 24 | <bounds left="32.5" top="32.5" right="191.5" bottom="40.5" /> | |
| 33 | 25 | <color red="1" green="0.816" blue="0" /> |
| 34 | 26 | </rect> |
| 35 | 27 | |
| 36 | <rect state="1"> | |
| 37 | <bounds left="27" top="5" right="28" bottom="28" /> | |
| 28 | <rect> | |
| 29 | <bounds left="215.5" top="40.5" right="224" bottom="223.5" /> | |
| 38 | 30 | <color red="0.627" green="0" blue="0.878" /> |
| 39 | 31 | </rect> |
| 40 | <rect state="1"> | |
| 41 | <bounds left="0" top="5" right="1" bottom="28" /> | |
| 32 | <rect> | |
| 33 | <bounds left="0" top="40.5" right="8.5" bottom="223.5" /> | |
| 42 | 34 | <color red="0.627" green="0" blue="0.878" /> |
| 43 | 35 | </rect> |
| 44 | 36 | |
| 45 | <rect state="1"> | |
| 46 | <bounds left="24" top="5" right="27" bottom="28" /> | |
| 47 | <color red="0" green="0" blue="1" /> | |
| 37 | <rect> | |
| 38 | <bounds left="191.5" top="40.5" right="215.5" bottom="223.5" /> | |
| 39 | <color red="0" green="0.333" blue="1" /> | |
| 48 | 40 | </rect> |
| 49 | <rect state="1"> | |
| 50 | <bounds left="1" top="5" right="4" bottom="28" /> | |
| 51 | <color red="0" green="0" blue="1" /> | |
| 41 | <rect> | |
| 42 | <bounds left="8.5" top="40.5" right="32.5" bottom="223.5" /> | |
| 43 | <color red="0" green="0.333" blue="1" /> | |
| 52 | 44 | </rect> |
| 53 | <rect state="1"> | |
| 54 | <bounds left="13" top="12" right="15" bottom="13" /> | |
| 55 | <color red="0" green="0" blue="1" /> | |
| 45 | <rect> | |
| 46 | <bounds left="103.625" top="95.5" right="120.375" bottom="104.5" /> | |
| 47 | <color red="0" green="0.333" blue="1" /> | |
| 56 | 48 | </rect> |
| 57 | <rect state="1"> | |
| 58 | <bounds left="16" top="21" right="18" bottom="23" /> | |
| 59 | <color red="0" green="0" blue="1" /> | |
| 49 | <rect> | |
| 50 | <bounds left="128" top="168" right="144" bottom="184" /> | |
| 51 | <color red="0" green="0.333" blue="1" /> | |
| 60 | 52 | </rect> |
| 61 | <rect state="1"> | |
| 62 | <bounds left="10" top="21" right="12" bottom="23" /> | |
| 63 | <color red="0" green="0" blue="1" /> | |
| 53 | <rect> | |
| 54 | <bounds left="80" top="168" right="96" bottom="184" /> | |
| 55 | <color red="0" green="0.333" blue="1" /> | |
| 64 | 56 | </rect> |
| 65 | 57 | |
| 66 | <rect state="1"> | |
| 67 | <bounds left="0" top="28" right="28" bottom="29" /> | |
| 58 | <rect> | |
| 59 | <bounds left="0" top="223.5" right="224" bottom="232.5" /> | |
| 68 | 60 | <color red="0.878" green="0" blue="0.627" /> |
| 69 | 61 | </rect> |
| 70 | <rect state="1"> | |
| 71 | <bounds left="0" top="29" right="28" bottom="32" /> | |
| 62 | <rect> | |
| 63 | <bounds left="0" top="232.5" right="224" bottom="256" /> | |
| 72 | 64 | <color red="0.627" green="0" blue="0.878" /> |
| 73 | 65 | </rect> |
| 74 | 66 | </element> |
| r0 | r10614 | |
|---|---|---|
| 1 | <?xml version="1.0"?> | |
| 2 | <mamelayout version="2"> | |
| 3 | <element name="overlay"> | |
| 4 | <rect> | |
| 5 | <bounds left="0" top="0" right="224" bottom="272" /> | |
| 6 | <color red="0.2" green="0.9" blue="1" /> | |
| 7 | </rect> | |
| 8 | ||
| 9 | <rect> | |
| 10 | <bounds left="22" top="33" right="202" bottom="238" /> | |
| 11 | <color red="0.2" green="1" blue="0.2" /> | |
| 12 | </rect> | |
| 13 | <rect> | |
| 14 | <bounds left="22" top="23" right="25" bottom="247" /> | |
| 15 | <color red="0.2" green="1.0" blue="0.2" /> | |
| 16 | </rect> | |
| 17 | <rect> | |
| 18 | <bounds left="199" top="23" right="202" bottom="247" /> | |
| 19 | <color red="0.2" green="1.0" blue="0.2" /> | |
| 20 | </rect> | |
| 21 | ||
| 22 | <rect> | |
| 23 | <bounds left="97" top="97" right="127" bottom="127" /> | |
| 24 | <color red="1" green="0.9" blue="0.2" /> | |
| 25 | </rect> | |
| 26 | </element> | |
| 27 | ||
| 28 | <view name="Color Overlay"> | |
| 29 | <screen index="0"> | |
| 30 | <bounds left="0" top="0" right="3" bottom="4" /> | |
| 31 | </screen> | |
| 32 | <overlay name="overlay" element="overlay"> | |
| 33 | <bounds left="0" top="0" right="3" bottom="4" /> | |
| 34 | </overlay> | |
| 35 | </view> | |
| 36 | </mamelayout> |
| r10613 | r10614 | |
|---|---|---|
| 415 | 415 | |
| 416 | 416 | MCFG_PALETTE_INIT(mainsnk) |
| 417 | 417 | MCFG_VIDEO_START(mainsnk) |
| 418 | ||
| 418 | ||
| 419 | 419 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 420 | 420 | |
| 421 | 421 | MCFG_SOUND_ADD("ay1", AY8910, 2000000) |
| r10613 | r10614 | |
|---|---|---|
| 1494 | 1494 | MCFG_GFXDECODE(wb) |
| 1495 | 1495 | MCFG_SCREEN_MODIFY("screen") |
| 1496 | 1496 | MCFG_SCREEN_UPDATE(wintbob) |
| 1497 | MCFG_SCREEN_EOF(0) | |
| 1497 | 1498 | MACHINE_CONFIG_END |
| 1498 | 1499 | |
| 1499 | 1500 |
| r10613 | r10614 | |
|---|---|---|
| 37 | 37 | #endif |
| 38 | 38 | |
| 39 | 39 | |
| 40 | static int nbmj9195_inputport; | |
| 41 | static int nbmj9195_dipswbitsel; | |
| 42 | static int nbmj9195_outcoin_flag; | |
| 43 | static int mscoutm_inputport; | |
| 44 | ||
| 45 | ||
| 46 | static UINT8 *nbmj9195_nvram; | |
| 47 | static size_t nbmj9195_nvram_size; | |
| 48 | ||
| 49 | ||
| 50 | 40 | static NVRAM_HANDLER( nbmj9195 ) |
| 51 | 41 | { |
| 42 | nbmj9195_state *state = machine->driver_data<nbmj9195_state>(); | |
| 52 | 43 | if (read_or_write) |
| 53 | file->write(n | |
| 44 | file->write(state->n | |
| 54 | 45 | else { |
| 55 | 46 | if (file) |
| 56 | file->read(n | |
| 47 | file->read(state->n | |
| 57 | 48 | else |
| 58 | memset(n | |
| 49 | memset(state->n | |
| 59 | 50 | } |
| 60 | 51 | } |
| 61 | 52 | |
| r10613 | r10614 | |
| 81 | 72 | soundlatch_clear_w(space, 0, 0); |
| 82 | 73 | } |
| 83 | 74 | |
| 84 | static void nbmj9195_outcoin_flag_w(int data) | |
| 75 | static void nbmj9195_outcoin_flag_w(address_space *space, int data) | |
| 85 | 76 | { |
| 77 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 86 | 78 | // bit0: coin in counter |
| 87 | 79 | // bit1: coin out counter |
| 88 | 80 | // bit2: hopper |
| 89 | 81 | // bit3: coin lockout |
| 90 | 82 | |
| 91 | if (data & 0x04) nbmj9195_outcoin_flag ^= 1; | |
| 92 | else nbmj9195_outcoin_flag = 1; | |
| 83 | if (data & 0x04) state->outcoin_flag ^= 1; | |
| 84 | else state->outcoin_flag = 1; | |
| 93 | 85 | } |
| 94 | 86 | |
| 95 | 87 | static WRITE8_HANDLER( nbmj9195_inputportsel_w ) |
| 96 | 88 | { |
| 97 | nbmj9195_inputport = (data ^ 0xff); | |
| 89 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 90 | state->inputport = (data ^ 0xff); | |
| 98 | 91 | } |
| 99 | 92 | |
| 100 | 93 | static int nbmj9195_dipsw_r(running_machine *machine) |
| 101 | 94 | { |
| 102 | return ((((input_port_read(machine, "DSWA") & 0xff) | ((input_port_read(machine, "DSWB") & 0xff) << 8)) >> nbmj9195_dipswbitsel) & 0x01); | |
| 95 | nbmj9195_state *state = machine->driver_data<nbmj9195_state>(); | |
| 96 | return ((((input_port_read(machine, "DSWA") & 0xff) | ((input_port_read(machine, "DSWB") & 0xff) << 8)) >> state->dipswbitsel) & 0x01); | |
| 103 | 97 | } |
| 104 | 98 | |
| 105 | static void nbmj9195_dipswbitsel_w(int data) | |
| 99 | static void nbmj9195_dipswbitsel_w(address_space *space, int data) | |
| 106 | 100 | { |
| 101 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 107 | 102 | switch (data & 0xc0) |
| 108 | 103 | { |
| 109 | 104 | case 0x00: |
| 110 | | |
| 105 | state-> | |
| 111 | 106 | break; |
| 112 | 107 | case 0x40: |
| 113 | 108 | break; |
| 114 | 109 | case 0x80: |
| 115 | 110 | break; |
| 116 | 111 | case 0xc0: |
| 117 | | |
| 112 | state-> | |
| 118 | 113 | break; |
| 119 | 114 | default: |
| 120 | 115 | break; |
| 121 | 116 | } |
| 122 | 117 | } |
| 123 | 118 | |
| 124 | static void mscoutm_inputportsel_w(int data) | |
| 119 | static void mscoutm_inputportsel_w(address_space *space, int data) | |
| 125 | 120 | { |
| 126 | mscoutm_inputport = (data ^ 0xff); | |
| 121 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 122 | state->mscoutm_inputport = (data ^ 0xff); | |
| 127 | 123 | } |
| 128 | 124 | |
| 129 | 125 | static READ8_HANDLER( mscoutm_dipsw_0_r ) |
| r10613 | r10614 | |
| 147 | 143 | |
| 148 | 144 | /* TMPZ84C011 PIO emulation */ |
| 149 | 145 | |
| 150 | static UINT8 pio_dir[5 * 2], pio_latch[5 * 2]; | |
| 151 | 146 | |
| 152 | 147 | static READ8_HANDLER( tmpz84c011_pio_r ) |
| 153 | 148 | { |
| 149 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 154 | 150 | int portdata; |
| 155 | 151 | |
| 156 | 152 | if ((!strcmp(space->machine->gamedrv->name, "mscoutm")) || |
| r10613 | r10614 | |
| 166 | 162 | break; |
| 167 | 163 | case 1: /* PB_0 */ |
| 168 | 164 | // PLAYER1 KEY, DIPSW A/B |
| 169 | switch (mscoutm_inputport) | |
| 165 | switch (state->mscoutm_inputport) | |
| 170 | 166 | { |
| 171 | 167 | case 0x01: |
| 172 | 168 | portdata = input_port_read(space->machine, "KEY0"); |
| r10613 | r10614 | |
| 191 | 187 | break; |
| 192 | 188 | case 2: /* PC_0 */ |
| 193 | 189 | // PLAYER2 KEY |
| 194 | switch (mscoutm_inputport) | |
| 190 | switch (state->mscoutm_inputport) | |
| 195 | 191 | { |
| 196 | 192 | case 0x01: |
| 197 | 193 | portdata = input_port_read(space->machine, "KEY5"); |
| r10613 | r10614 | |
| 249 | 245 | { |
| 250 | 246 | case 0: /* PA_0 */ |
| 251 | 247 | // COIN IN, ETC... |
| 252 | portdata = ((input_port_read(space->machine, "SYSTEM") & 0xfe) | | |
| 248 | portdata = ((input_port_read(space->machine, "SYSTEM") & 0xfe) | state-> | |
| 253 | 249 | break; |
| 254 | 250 | case 1: /* PB_0 */ |
| 255 | 251 | // PLAYER1 KEY, DIPSW A/B |
| 256 | switch ( | |
| 252 | switch (state-> | |
| 257 | 253 | { |
| 258 | 254 | case 0x01: |
| 259 | 255 | portdata = input_port_read(space->machine, "KEY0"); |
| r10613 | r10614 | |
| 277 | 273 | break; |
| 278 | 274 | case 2: /* PC_0 */ |
| 279 | 275 | // PLAYER2 KEY |
| 280 | switch ( | |
| 276 | switch (state-> | |
| 281 | 277 | { |
| 282 | 278 | case 0x01: |
| 283 | 279 | portdata = input_port_read(space->machine, "KEY5"); |
| r10613 | r10614 | |
| 342 | 338 | switch (offset) |
| 343 | 339 | { |
| 344 | 340 | case 0: /* PA_0 */ |
| 345 | mscoutm_inputportsel_w(data); // NB22090 | |
| 341 | mscoutm_inputportsel_w(space, data); // NB22090 | |
| 346 | 342 | break; |
| 347 | 343 | case 1: /* PB_0 */ |
| 348 | 344 | break; |
| 349 | 345 | case 2: /* PC_0 */ |
| 350 | 346 | break; |
| 351 | 347 | case 3: /* PD_0 */ |
| 352 | nbmj9195_clutsel_w(data); | |
| 348 | nbmj9195_clutsel_w(space, data); | |
| 353 | 349 | break; |
| 354 | 350 | case 4: /* PE_0 */ |
| 355 | nbmj9195_gfxflag2_w(data); // NB22090 | |
| 351 | nbmj9195_gfxflag2_w(space, data); // NB22090 | |
| 356 | 352 | break; |
| 357 | 353 | |
| 358 | 354 | case 5: /* PA_1 */ |
| r10613 | r10614 | |
| 384 | 380 | case 1: /* PB_0 */ |
| 385 | 381 | break; |
| 386 | 382 | case 2: /* PC_0 */ |
| 387 | nbmj9195_dipswbitsel_w(data); | |
| 383 | nbmj9195_dipswbitsel_w(space, data); | |
| 388 | 384 | break; |
| 389 | 385 | case 3: /* PD_0 */ |
| 390 | nbmj9195_clutsel_w(data); | |
| 386 | nbmj9195_clutsel_w(space, data); | |
| 391 | 387 | break; |
| 392 | 388 | case 4: /* PE_0 */ |
| 393 | nbmj9195_outcoin_flag_w(data); | |
| 389 | nbmj9195_outcoin_flag_w(space, data); | |
| 394 | 390 | break; |
| 395 | 391 | |
| 396 | 392 | case 5: /* PA_1 */ |
| r10613 | r10614 | |
| 419 | 415 | /* CPU interface */ |
| 420 | 416 | |
| 421 | 417 | /* device 0 */ |
| 422 | static READ8_HANDLER( tmpz84c011_0_pa_r ) { return (tmpz84c011_pio_r(space,0) & ~pio_dir[0]) | (pio_latch[0] & pio_dir[0]); } | |
| 423 | static READ8_HANDLER( tmpz84c011_0_pb_r ) { return (tmpz84c011_pio_r(space,1) & ~pio_dir[1]) | (pio_latch[1] & pio_dir[1]); } | |
| 424 | static READ8_HANDLER( tmpz84c011_0_pc_r ) { return (tmpz84c011_pio_r(space,2) & ~pio_dir[2]) | (pio_latch[2] & pio_dir[2]); } | |
| 425 | static READ8_HANDLER( tmpz84c011_0_pd_r ) { return (tmpz84c011_pio_r(space,3) & ~pio_dir[3]) | (pio_latch[3] & pio_dir[3]); } | |
| 426 | static READ8_HANDLER( tmpz84c011_0_pe_r ) { return (tmpz84c011_pio_r(space,4) & ~pio_dir[4]) | (pio_latch[4] & pio_dir[4]); } | |
| 418 | static READ8_HANDLER( tmpz84c011_0_pa_r ) | |
| 419 | { | |
| 420 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,0) & ~state->pio_dir[0]) | (state->pio_latch[0] & state->pio_dir[0]); | |
| 421 | } | |
| 422 | static READ8_HANDLER( tmpz84c011_0_pb_r ) | |
| 423 | { | |
| 424 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,1) & ~state->pio_dir[1]) | (state->pio_latch[1] & state->pio_dir[1]); | |
| 425 | } | |
| 427 | 426 | |
| 428 | static WRITE8_HANDLER( tmpz84c011_0_pa_w ) { pio_latch[0] = data; tmpz84c011_pio_w(space, 0, data); } | |
| 429 | static WRITE8_HANDLER( tmpz84c011_0_pb_w ) { pio_latch[1] = data; tmpz84c011_pio_w(space, 1, data); } | |
| 430 | static WRITE8_HANDLER( tmpz84c011_0_pc_w ) { pio_latch[2] = data; tmpz84c011_pio_w(space, 2, data); } | |
| 431 | static WRITE8_HANDLER( tmpz84c011_0_pd_w ) { pio_latch[3] = data; tmpz84c011_pio_w(space, 3, data); } | |
| 432 | static WRITE8_HANDLER( tmpz84c011_0_pe_w ) { pio_latch[4] = data; tmpz84c011_pio_w(space, 4, data); } | |
| 427 | static READ8_HANDLER( tmpz84c011_0_pc_r ) | |
| 428 | { | |
| 429 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,2) & ~state->pio_dir[2]) | (state->pio_latch[2] & state->pio_dir[2]); | |
| 430 | } | |
| 433 | 431 | |
| 434 | static READ8_HANDLER( tmpz84c011_0_dir_pa_r ) { return pio_dir[0]; } | |
| 435 | static READ8_HANDLER( tmpz84c011_0_dir_pb_r ) { return pio_dir[1]; } | |
| 436 | static READ8_HANDLER( tmpz84c011_0_dir_pc_r ) { return pio_dir[2]; } | |
| 437 | static READ8_HANDLER( tmpz84c011_0_dir_pd_r ) { return pio_dir[3]; } | |
| 438 | static READ8_HANDLER( tmpz84c011_0_dir_pe_r ) { return pio_dir[4]; } | |
| 432 | static READ8_HANDLER( tmpz84c011_0_pd_r ) | |
| 433 | { | |
| 434 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,3) & ~state->pio_dir[3]) | (state->pio_latch[3] & state->pio_dir[3]); | |
| 435 | } | |
| 439 | 436 | |
| 440 | static WRITE8_HANDLER( tmpz84c011_0_dir_pa_w ) { pio_dir[0] = data; } | |
| 441 | static WRITE8_HANDLER( tmpz84c011_0_dir_pb_w ) { pio_dir[1] = data; } | |
| 442 | static WRITE8_HANDLER( tmpz84c011_0_dir_pc_w ) { pio_dir[2] = data; } | |
| 443 | static WRITE8_HANDLER( tmpz84c011_0_dir_pd_w ) { pio_dir[3] = data; } | |
| 444 | static WRITE8_HANDLER( tmpz84c011_0_dir_pe_w ) { pio_dir[4] = data; } | |
| 437 | static READ8_HANDLER( tmpz84c011_0_pe_r ) | |
| 438 | { | |
| 439 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,4) & ~state->pio_dir[4]) | (state->pio_latch[4] & state->pio_dir[4]); | |
| 440 | } | |
| 445 | 441 | |
| 442 | ||
| 443 | static WRITE8_HANDLER( tmpz84c011_0_pa_w ) | |
| 444 | { | |
| 445 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 446 | state->pio_latch[0] = data; | |
| 447 | tmpz84c011_pio_w(space, 0, data); | |
| 448 | } | |
| 449 | ||
| 450 | static WRITE8_HANDLER( tmpz84c011_0_pb_w ) | |
| 451 | { | |
| 452 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 453 | state->pio_latch[1] = data; | |
| 454 | tmpz84c011_pio_w(space, 1, data); | |
| 455 | } | |
| 456 | ||
| 457 | static WRITE8_HANDLER( tmpz84c011_0_pc_w ) | |
| 458 | { | |
| 459 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 460 | state->pio_latch[2] = data; | |
| 461 | tmpz84c011_pio_w(space, 2, data); | |
| 462 | } | |
| 463 | ||
| 464 | static WRITE8_HANDLER( tmpz84c011_0_pd_w ) | |
| 465 | { | |
| 466 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 467 | state->pio_latch[3] = data; | |
| 468 | tmpz84c011_pio_w(space, 3, data); | |
| 469 | } | |
| 470 | ||
| 471 | static WRITE8_HANDLER( tmpz84c011_0_pe_w ) | |
| 472 | { | |
| 473 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 474 | state->pio_latch[4] = data; | |
| 475 | tmpz84c011_pio_w(space, 4, data); | |
| 476 | } | |
| 477 | ||
| 478 | ||
| 479 | static READ8_HANDLER( tmpz84c011_0_dir_pa_r ) | |
| 480 | { | |
| 481 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return state->pio_dir[0]; | |
| 482 | } | |
| 483 | ||
| 484 | static READ8_HANDLER( tmpz84c011_0_dir_pb_r ) | |
| 485 | { | |
| 486 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return state->pio_dir[1]; | |
| 487 | } | |
| 488 | ||
| 489 | static READ8_HANDLER( tmpz84c011_0_dir_pc_r ) | |
| 490 | { | |
| 491 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return state->pio_dir[2]; | |
| 492 | } | |
| 493 | ||
| 494 | static READ8_HANDLER( tmpz84c011_0_dir_pd_r ) | |
| 495 | { | |
| 496 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return state->pio_dir[3]; | |
| 497 | } | |
| 498 | ||
| 499 | static READ8_HANDLER( tmpz84c011_0_dir_pe_r ) | |
| 500 | { | |
| 501 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return state->pio_dir[4]; | |
| 502 | } | |
| 503 | ||
| 504 | ||
| 505 | static WRITE8_HANDLER( tmpz84c011_0_dir_pa_w ) | |
| 506 | { | |
| 507 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 508 | state->pio_dir[0] = data; | |
| 509 | } | |
| 510 | ||
| 511 | static WRITE8_HANDLER( tmpz84c011_0_dir_pb_w ) | |
| 512 | { | |
| 513 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 514 | state->pio_dir[1] = data; | |
| 515 | } | |
| 516 | ||
| 517 | static WRITE8_HANDLER( tmpz84c011_0_dir_pc_w ) | |
| 518 | { | |
| 519 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 520 | state->pio_dir[2] = data; | |
| 521 | } | |
| 522 | ||
| 523 | static WRITE8_HANDLER( tmpz84c011_0_dir_pd_w ) | |
| 524 | { | |
| 525 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 526 | state->pio_dir[3] = data; | |
| 527 | } | |
| 528 | ||
| 529 | static WRITE8_HANDLER( tmpz84c011_0_dir_pe_w ) | |
| 530 | { | |
| 531 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 532 | state->pio_dir[4] = data; | |
| 533 | } | |
| 534 | ||
| 535 | ||
| 446 | 536 | /* device 1 */ |
| 447 | static READ8_HANDLER( tmpz84c011_1_pa_r ) { return (tmpz84c011_pio_r(space,5) & ~pio_dir[5]) | (pio_latch[5] & pio_dir[5]); } | |
| 448 | static READ8_HANDLER( tmpz84c011_1_pb_r ) { return (tmpz84c011_pio_r(space,6) & ~pio_dir[6]) | (pio_latch[6] & pio_dir[6]); } | |
| 449 | static READ8_HANDLER( tmpz84c011_1_pc_r ) { return (tmpz84c011_pio_r(space,7) & ~pio_dir[7]) | (pio_latch[7] & pio_dir[7]); } | |
| 450 | static READ8_HANDLER( tmpz84c011_1_pd_r ) { return (tmpz84c011_pio_r(space,8) & ~pio_dir[8]) | (pio_latch[8] & pio_dir[8]); } | |
| 451 | static READ8_HANDLER( tmpz84c011_1_pe_r ) { return (tmpz84c011_pio_r(space,9) & ~pio_dir[9]) | (pio_latch[9] & pio_dir[9]); } | |
| 537 | static READ8_HANDLER( tmpz84c011_1_pa_r ) | |
| 538 | { | |
| 539 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,5) & ~state->pio_dir[5]) | (state->pio_latch[5] & state->pio_dir[5]); | |
| 540 | } | |
| 452 | 541 | |
| 453 | static WRITE8_HANDLER( tmpz84c011_1_pa_w ) { pio_latch[5] = data; tmpz84c011_pio_w(space, 5, data); } | |
| 454 | static WRITE8_HANDLER( tmpz84c011_1_pb_w ) { pio_latch[6] = data; tmpz84c011_pio_w(space, 6, data); } | |
| 455 | static WRITE8_HANDLER( tmpz84c011_1_pc_w ) { pio_latch[7] = data; tmpz84c011_pio_w(space, 7, data); } | |
| 456 | static WRITE8_HANDLER( tmpz84c011_1_pd_w ) { pio_latch[8] = data; tmpz84c011_pio_w(space, 8, data); } | |
| 457 | static WRITE8_HANDLER( tmpz84c011_1_pe_w ) { pio_latch[9] = data; tmpz84c011_pio_w(space, 9, data); } | |
| 542 | static READ8_HANDLER( tmpz84c011_1_pb_r ) | |
| 543 | { | |
| 544 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,6) & ~state->pio_dir[6]) | (state->pio_latch[6] & state->pio_dir[6]); | |
| 545 | } | |
| 458 | 546 | |
| 459 | static READ8_HANDLER( tmpz84c011_1_dir_pa_r ) { return pio_dir[5]; } | |
| 460 | static READ8_HANDLER( tmpz84c011_1_dir_pb_r ) { return pio_dir[6]; } | |
| 461 | static READ8_HANDLER( tmpz84c011_1_dir_pc_r ) { return pio_dir[7]; } | |
| 462 | static READ8_HANDLER( tmpz84c011_1_dir_pd_r ) { return pio_dir[8]; } | |
| 463 | static READ8_HANDLER( tmpz84c011_1_dir_pe_r ) { return pio_dir[9]; } | |
| 547 | static READ8_HANDLER( tmpz84c011_1_pc_r ) | |
| 548 | { | |
| 549 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,7) & ~state->pio_dir[7]) | (state->pio_latch[7] & state->pio_dir[7]); | |
| 550 | } | |
| 464 | 551 | |
| 465 | static WRITE8_HANDLER( tmpz84c011_1_dir_pa_w ) { pio_dir[5] = data; } | |
| 466 | static WRITE8_HANDLER( tmpz84c011_1_dir_pb_w ) { pio_dir[6] = data; } | |
| 467 | static WRITE8_HANDLER( tmpz84c011_1_dir_pc_w ) { pio_dir[7] = data; } | |
| 468 | static WRITE8_HANDLER( tmpz84c011_1_dir_pd_w ) { pio_dir[8] = data; } | |
| 469 | static WRITE8_HANDLER( tmpz84c011_1_dir_pe_w ) { pio_dir[9] = data; } | |
| 552 | static READ8_HANDLER( tmpz84c011_1_pd_r ) | |
| 553 | { | |
| 554 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,8) & ~state->pio_dir[8]) | (state->pio_latch[8] & state->pio_dir[8]); | |
| 555 | } | |
| 470 | 556 | |
| 557 | static READ8_HANDLER( tmpz84c011_1_pe_r ) | |
| 558 | { | |
| 559 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,9) & ~state->pio_dir[9]) | (state->pio_latch[9] & state->pio_dir[9]); | |
| 560 | } | |
| 561 | ||
| 562 | ||
| 563 | static WRITE8_HANDLER( tmpz84c011_1_pa_w ) | |
| 564 | { | |
| 565 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 566 | state->pio_latch[5] = data; | |
| 567 | tmpz84c011_pio_w(space, 5, data); | |
| 568 | } | |
| 569 | ||
| 570 | static WRITE8_HANDLER( tmpz84c011_1_pb_w ) | |
| 571 | { | |
| 572 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 573 | state->pio_latch[6] = data; | |
| 574 | tmpz84c011_pio_w(space, 6, data); | |
| 575 | } | |
| 576 | ||
| 577 | static WRITE8_HANDLER( tmpz84c011_1_pc_w ) | |
| 578 | { | |
| 579 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 580 | state->pio_latch[7] = data; | |
| 581 | tmpz84c011_pio_w(space, 7, data); | |
| 582 | } | |
| 583 | ||
| 584 | static WRITE8_HANDLER( tmpz84c011_1_pd_w ) | |
| 585 | { | |
| 586 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 587 | state->pio_latch[8] = data; | |
| 588 | tmpz84c011_pio_w(space, 8, data); | |
| 589 | } | |
| 590 | ||
| 591 | static WRITE8_HANDLER( tmpz84c011_1_pe_w ) | |
| 592 | { | |
| 593 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 594 | state->pio_latch[9] = data; | |
| 595 | tmpz84c011_pio_w(space, 9, data); | |
| 596 | } | |
| 597 | ||
| 598 | ||
| 599 | static READ8_HANDLER( tmpz84c011_1_dir_pa_r ) | |
| 600 | { | |
| 601 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return state->pio_dir[5]; | |
| 602 | } | |
| 603 | ||
| 604 | static READ8_HANDLER( tmpz84c011_1_dir_pb_r ) | |
| 605 | { | |
| 606 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return state->pio_dir[6]; | |
| 607 | } | |
| 608 | ||
| 609 | static READ8_HANDLER( tmpz84c011_1_dir_pc_r ) | |
| 610 | { | |
| 611 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return state->pio_dir[7]; | |
| 612 | } | |
| 613 | ||
| 614 | static READ8_HANDLER( tmpz84c011_1_dir_pd_r ) | |
| 615 | { | |
| 616 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return state->pio_dir[8]; | |
| 617 | } | |
| 618 | ||
| 619 | static READ8_HANDLER( tmpz84c011_1_dir_pe_r ) | |
| 620 | { | |
| 621 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return state->pio_dir[9]; | |
| 622 | } | |
| 623 | ||
| 624 | ||
| 625 | static WRITE8_HANDLER( tmpz84c011_1_dir_pa_w ) | |
| 626 | { | |
| 627 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 628 | state->pio_dir[5] = data; | |
| 629 | } | |
| 630 | ||
| 631 | static WRITE8_HANDLER( tmpz84c011_1_dir_pb_w ) | |
| 632 | { | |
| 633 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 634 | state->pio_dir[6] = data; | |
| 635 | } | |
| 636 | ||
| 637 | static WRITE8_HANDLER( tmpz84c011_1_dir_pc_w ) | |
| 638 | { | |
| 639 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 640 | state->pio_dir[7] = data; | |
| 641 | } | |
| 642 | ||
| 643 | static WRITE8_HANDLER( tmpz84c011_1_dir_pd_w ) | |
| 644 | { | |
| 645 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 646 | state->pio_dir[8] = data; | |
| 647 | } | |
| 648 | ||
| 649 | static WRITE8_HANDLER( tmpz84c011_1_dir_pe_w ) | |
| 650 | { | |
| 651 | nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); | |
| 652 | state->pio_dir[9] = data; | |
| 653 | } | |
| 654 | ||
| 471 | 655 | /* CTC of main cpu, ch0 trigger is vblank */ |
| 472 | 656 | static INTERRUPT_GEN( ctc0_trg1 ) |
| 473 | 657 | { |
| r10613 | r10614 | |
| 496 | 680 | |
| 497 | 681 | static MACHINE_RESET( sailorws ) |
| 498 | 682 | { |
| 683 | nbmj9195_state *state = machine->driver_data<nbmj9195_state>(); | |
| 499 | 684 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 500 | 685 | int i; |
| 501 | 686 | |
| 502 | 687 | // initialize TMPZ84C011 PIO |
| 503 | 688 | for (i = 0; i < (5 * 2); i++) |
| 504 | 689 | { |
| 505 | pio_dir[i] = pio_latch[i] = 0; | |
| 690 | state->pio_dir[i] = state->pio_latch[i] = 0; | |
| 506 | 691 | tmpz84c011_pio_w(space, i, 0); |
| 507 | 692 | } |
| 508 | 693 | } |
| r10613 | r10614 | |
| 536 | 721 | static ADDRESS_MAP_START( sailorws_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 537 | 722 | AM_RANGE(0x0000, 0xefff) AM_ROM |
| 538 | 723 | AM_RANGE(0xf000, 0xf1ff) AM_READWRITE(nbmj9195_palette_r,nbmj9195_palette_w) |
| 539 | AM_RANGE(0xf800, 0xffff) AM_RAM AM_BASE( | |
| 724 | AM_RANGE(0xf800, 0xffff) AM_RAM AM_BASE_MEMBER( | |
| 540 | 725 | ADDRESS_MAP_END |
| 541 | 726 | |
| 542 | 727 | static ADDRESS_MAP_START( mjuraden_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r10613 | r10614 | |
| 548 | 733 | static ADDRESS_MAP_START( koinomp_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 549 | 734 | AM_RANGE(0x0000, 0xdfff) AM_ROM |
| 550 | 735 | AM_RANGE(0xe000, 0xe1ff) AM_READWRITE(nbmj9195_palette_r,nbmj9195_palette_w) |
| 551 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE( | |
| 736 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE_MEMBER( | |
| 552 | 737 | ADDRESS_MAP_END |
| 553 | 738 | |
| 554 | 739 | static ADDRESS_MAP_START( ngpgal_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r10613 | r10614 | |
| 2911 | 3096 | }; |
| 2912 | 3097 | |
| 2913 | 3098 | |
| 2914 | static MACHINE_CONFIG_START( NBMJDRV1, | |
| 3099 | static MACHINE_CONFIG_START( NBMJDRV1, nbmj9195_stat | |
| 2915 | 3100 | |
| 2916 | 3101 | /* basic machine hardware */ |
| 2917 | 3102 | MCFG_CPU_ADD("maincpu", Z80, 12000000/2) /* TMPZ84C011, 6.00 MHz */ |
| r10613 | r10614 | |
|---|---|---|
| 25 | 25 | #include "machine/nvram.h" |
| 26 | 26 | #include "cpu/h83002/h8.h" |
| 27 | 27 | |
| 28 | static bitmap_t *vdp0_bitmap; | |
| 29 | 28 | |
| 29 | class csplayh5_state : public driver_device | |
| 30 | { | |
| 31 | public: | |
| 32 | csplayh5_state(running_machine &machine, const driver_device_config_base &config) | |
| 33 | : driver_device(machine, config) { } | |
| 34 | ||
| 35 | bitmap_t *vdp0_bitmap; | |
| 36 | UINT16 mux_data; | |
| 37 | UINT8 pio_dir[5]; | |
| 38 | UINT8 pio_latch[5]; | |
| 39 | }; | |
| 40 | ||
| 41 | ||
| 42 | ||
| 30 | 43 | #define USE_H8 0 |
| 31 | 44 | |
| 32 | 45 | // from MSX2 driver, may be not accurate for this HW |
| r10613 | r10614 | |
| 45 | 58 | |
| 46 | 59 | static VIDEO_START( csplayh5 ) |
| 47 | 60 | { |
| 48 | vdp0_bitmap = machine->primary_screen->alloc_compatible_bitmap(); | |
| 49 | v9938_init (machine, 0, *machine->primary_screen, vdp0_bitmap, MODEL_V9958, 0x20000, csplayh5_vdp0_interrupt); | |
| 61 | csplayh5_state *state = machine->driver_data<csplayh5_state>(); | |
| 62 | state->vdp0_bitmap = machine->primary_screen->alloc_compatible_bitmap(); | |
| 63 | v9938_init (machine, 0, *machine->primary_screen, state->vdp0_bitmap, MODEL_V9958, 0x20000, csplayh5_vdp0_interrupt); | |
| 50 | 64 | v9938_reset(0); |
| 51 | 65 | } |
| 52 | 66 | |
| 53 | 67 | static SCREEN_UPDATE( csplayh5 ) |
| 54 | 68 | { |
| 69 | csplayh5_state *state = screen->machine->driver_data<csplayh5_state>(); | |
| 55 | 70 | bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); |
| 56 | 71 | |
| 57 | copybitmap(bitmap, vdp0_bitmap, 0, 0, 0, 0, cliprect); | |
| 72 | copybitmap(bitmap, state->vdp0_bitmap, 0, 0, 0, 0, cliprect); | |
| 58 | 73 | |
| 59 | 74 | return 0; |
| 60 | 75 | } |
| 61 | 76 | |
| 62 | static UINT16 mux_data; | |
| 63 | 77 | |
| 64 | 78 | static READ16_HANDLER( csplayh5_mux_r ) |
| 65 | 79 | { |
| 66 | switch(mux_data) | |
| 80 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 81 | switch(state->mux_data) | |
| 67 | 82 | { |
| 68 | 83 | case 0x01: return input_port_read(space->machine, "KEY0"); |
| 69 | 84 | case 0x02: return input_port_read(space->machine, "KEY1"); |
| r10613 | r10614 | |
| 77 | 92 | |
| 78 | 93 | static WRITE16_HANDLER( csplayh5_mux_w ) |
| 79 | 94 | { |
| 80 | mux_data = (~data & 0x1f); | |
| 95 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 96 | state->mux_data = (~data & 0x1f); | |
| 81 | 97 | } |
| 82 | 98 | |
| 83 | 99 | static WRITE16_HANDLER( csplayh5_sound_w ) |
| r10613 | r10614 | |
| 133 | 149 | */ |
| 134 | 150 | |
| 135 | 151 | /* TMPZ84C011 PIO emulation */ |
| 136 | static UINT8 pio_dir[5], pio_latch[5]; | |
| 137 | 152 | |
| 138 | 153 | #define SIGNED_DAC 0 // 0:unsigned DAC, 1:signed DAC |
| 139 | 154 | #if SIGNED_DAC |
| r10613 | r10614 | |
| 217 | 232 | |
| 218 | 233 | |
| 219 | 234 | /* CPU interface */ |
| 220 | static READ8_HANDLER( tmpz84c011_0_pa_r ) { return (tmpz84c011_pio_r(space,0) & ~pio_dir[0]) | (pio_latch[0] & pio_dir[0]); } | |
| 221 | static READ8_HANDLER( tmpz84c011_0_pb_r ) { return (tmpz84c011_pio_r(space,1) & ~pio_dir[1]) | (pio_latch[1] & pio_dir[1]); } | |
| 222 | static READ8_HANDLER( tmpz84c011_0_pc_r ) { return (tmpz84c011_pio_r(space,2) & ~pio_dir[2]) | (pio_latch[2] & pio_dir[2]); } | |
| 223 | static READ8_HANDLER( tmpz84c011_0_pd_r ) { return (tmpz84c011_pio_r(space,3) & ~pio_dir[3]) | (pio_latch[3] & pio_dir[3]); } | |
| 224 | static READ8_HANDLER( tmpz84c011_0_pe_r ) { return (tmpz84c011_pio_r(space,4) & ~pio_dir[4]) | (pio_latch[4] & pio_dir[4]); } | |
| 235 | static READ8_HANDLER( tmpz84c011_0_pa_r ) | |
| 236 | { | |
| 237 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 238 | return (tmpz84c011_pio_r(space,0) & ~state->pio_dir[0]) | (state->pio_latch[0] & state->pio_dir[0]); | |
| 239 | } | |
| 225 | 240 | |
| 226 | static WRITE8_HANDLER( tmpz84c011_0_pa_w ) { pio_latch[0] = data; tmpz84c011_pio_w(space, 0, data); } | |
| 227 | static WRITE8_HANDLER( tmpz84c011_0_pb_w ) { pio_latch[1] = data; tmpz84c011_pio_w(space, 1, data); } | |
| 228 | static WRITE8_HANDLER( tmpz84c011_0_pc_w ) { pio_latch[2] = data; tmpz84c011_pio_w(space, 2, data); } | |
| 229 | static WRITE8_HANDLER( tmpz84c011_0_pd_w ) { pio_latch[3] = data; tmpz84c011_pio_w(space, 3, data); } | |
| 230 | static WRITE8_HANDLER( tmpz84c011_0_pe_w ) { pio_latch[4] = data; tmpz84c011_pio_w(space, 4, data); } | |
| 241 | static READ8_HANDLER( tmpz84c011_0_pb_r ) | |
| 242 | { | |
| 243 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 244 | return (tmpz84c011_pio_r(space,1) & ~state->pio_dir[1]) | (state->pio_latch[1] & state->pio_dir[1]); | |
| 245 | } | |
| 231 | 246 | |
| 232 | static READ8_HANDLER( tmpz84c011_0_dir_pa_r ) { return pio_dir[0]; } | |
| 233 | static READ8_HANDLER( tmpz84c011_0_dir_pb_r ) { return pio_dir[1]; } | |
| 234 | static READ8_HANDLER( tmpz84c011_0_dir_pc_r ) { return pio_dir[2]; } | |
| 235 | static READ8_HANDLER( tmpz84c011_0_dir_pd_r ) { return pio_dir[3]; } | |
| 236 | static READ8_HANDLER( tmpz84c011_0_dir_pe_r ) { return pio_dir[4]; } | |
| 247 | static READ8_HANDLER( tmpz84c011_0_pc_r ) | |
| 248 | { | |
| 249 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 250 | return (tmpz84c011_pio_r(space,2) & ~state->pio_dir[2]) | (state->pio_latch[2] & state->pio_dir[2]); | |
| 251 | } | |
| 237 | 252 | |
| 238 | static WRITE8_HANDLER( tmpz84c011_0_dir_pa_w ) { pio_dir[0] = data; } | |
| 239 | static WRITE8_HANDLER( tmpz84c011_0_dir_pb_w ) { pio_dir[1] = data; } | |
| 240 | static WRITE8_HANDLER( tmpz84c011_0_dir_pc_w ) { pio_dir[2] = data; } | |
| 241 | static WRITE8_HANDLER( tmpz84c011_0_dir_pd_w ) { pio_dir[3] = data; } | |
| 242 | static WRITE8_HANDLER( tmpz84c011_0_dir_pe_w ) { pio_dir[4] = data; } | |
| 253 | static READ8_HANDLER( tmpz84c011_0_pd_r ) | |
| 254 | { | |
| 255 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 256 | return (tmpz84c011_pio_r(space,3) & ~state->pio_dir[3]) | (state->pio_latch[3] & state->pio_dir[3]); | |
| 257 | } | |
| 243 | 258 | |
| 259 | static READ8_HANDLER( tmpz84c011_0_pe_r ) | |
| 260 | { | |
| 261 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 262 | return (tmpz84c011_pio_r(space,4) & ~state->pio_dir[4]) | (state->pio_latch[4] & state->pio_dir[4]); | |
| 263 | } | |
| 264 | ||
| 265 | static WRITE8_HANDLER( tmpz84c011_0_pa_w ) | |
| 266 | { | |
| 267 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 268 | state->pio_latch[0] = data; | |
| 269 | tmpz84c011_pio_w(space, 0, data); | |
| 270 | } | |
| 271 | ||
| 272 | static WRITE8_HANDLER( tmpz84c011_0_pb_w ) | |
| 273 | { | |
| 274 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 275 | state->pio_latch[1] = data; | |
| 276 | tmpz84c011_pio_w(space, 1, data); | |
| 277 | } | |
| 278 | ||
| 279 | static WRITE8_HANDLER( tmpz84c011_0_pc_w ) | |
| 280 | { | |
| 281 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 282 | state->pio_latch[2] = data; | |
| 283 | tmpz84c011_pio_w(space, 2, data); | |
| 284 | } | |
| 285 | ||
| 286 | static WRITE8_HANDLER( tmpz84c011_0_pd_w ) | |
| 287 | { | |
| 288 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 289 | state->pio_latch[3] = data; | |
| 290 | tmpz84c011_pio_w(space, 3, data); | |
| 291 | } | |
| 292 | ||
| 293 | static WRITE8_HANDLER( tmpz84c011_0_pe_w ) | |
| 294 | { | |
| 295 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 296 | state->pio_latch[4] = data; | |
| 297 | tmpz84c011_pio_w(space, 4, data); | |
| 298 | } | |
| 299 | ||
| 300 | ||
| 301 | static READ8_HANDLER( tmpz84c011_0_dir_pa_r ) | |
| 302 | { | |
| 303 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 304 | return state->pio_dir[0]; | |
| 305 | } | |
| 306 | ||
| 307 | static READ8_HANDLER( tmpz84c011_0_dir_pb_r ) | |
| 308 | { | |
| 309 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 310 | return state->pio_dir[1]; | |
| 311 | } | |
| 312 | ||
| 313 | static READ8_HANDLER( tmpz84c011_0_dir_pc_r ) | |
| 314 | { | |
| 315 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 316 | return state->pio_dir[2]; | |
| 317 | } | |
| 318 | ||
| 319 | static READ8_HANDLER( tmpz84c011_0_dir_pd_r ) | |
| 320 | { | |
| 321 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 322 | return state->pio_dir[3]; | |
| 323 | } | |
| 324 | ||
| 325 | static READ8_HANDLER( tmpz84c011_0_dir_pe_r ) | |
| 326 | { | |
| 327 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 328 | return state->pio_dir[4]; | |
| 329 | } | |
| 330 | ||
| 331 | ||
| 332 | static WRITE8_HANDLER( tmpz84c011_0_dir_pa_w ) | |
| 333 | { | |
| 334 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 335 | state->pio_dir[0] = data; | |
| 336 | } | |
| 337 | ||
| 338 | static WRITE8_HANDLER( tmpz84c011_0_dir_pb_w ) | |
| 339 | { | |
| 340 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 341 | state->pio_dir[1] = data; | |
| 342 | } | |
| 343 | ||
| 344 | static WRITE8_HANDLER( tmpz84c011_0_dir_pc_w ) | |
| 345 | { | |
| 346 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 347 | state->pio_dir[2] = data; | |
| 348 | } | |
| 349 | ||
| 350 | static WRITE8_HANDLER( tmpz84c011_0_dir_pd_w ) | |
| 351 | { | |
| 352 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 353 | state->pio_dir[3] = data; | |
| 354 | } | |
| 355 | ||
| 356 | static WRITE8_HANDLER( tmpz84c011_0_dir_pe_w ) | |
| 357 | { | |
| 358 | csplayh5_state *state = space->machine->driver_data<csplayh5_state>(); | |
| 359 | state->pio_dir[4] = data; | |
| 360 | } | |
| 361 | ||
| 362 | ||
| 244 | 363 | static ADDRESS_MAP_START( csplayh5_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 245 | 364 | AM_RANGE(0x0000, 0x77ff) AM_ROM |
| 246 | 365 | AM_RANGE(0x7800, 0x7fff) AM_RAM |
| r10613 | r10614 | |
| 467 | 586 | |
| 468 | 587 | static MACHINE_RESET( csplayh5 ) |
| 469 | 588 | { |
| 589 | csplayh5_state *state = machine->driver_data<csplayh5_state>(); | |
| 470 | 590 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 471 | 591 | int i; |
| 472 | 592 | |
| 473 | 593 | // initialize TMPZ84C011 PIO |
| 474 | 594 | for (i = 0; i < 5; i++) |
| 475 | 595 | { |
| 476 | pio_dir[i] = pio_latch[i] = 0; | |
| 596 | state->pio_dir[i] = state->pio_latch[i] = 0; | |
| 477 | 597 | tmpz84c011_pio_w(space, i, 0); |
| 478 | 598 | } |
| 479 | 599 | } |
| r10613 | r10614 | |
| 497 | 617 | }; |
| 498 | 618 | |
| 499 | 619 | |
| 500 | static MACHINE_CONFIG_START( csplayh5, | |
| 620 | static MACHINE_CONFIG_START( csplayh5, | |
| 501 | 621 | |
| 502 | 622 | /* basic machine hardware */ |
| 503 | 623 | MCFG_CPU_ADD("maincpu",M68000,16000000) /* TMP68301-16 */ |
| r10613 | r10614 | |
|---|---|---|
| 1051 | 1051 | MCFG_SCREEN_REFRESH_RATE(60) |
| 1052 | 1052 | MCFG_SCREEN_SIZE(512, 384) |
| 1053 | 1053 | MCFG_SCREEN_VISIBLE_AREA(0, 511, 0, 383) |
| 1054 | MCFG_SCREEN_UPDATE(hornet_2board) | |
| 1054 | MCFG_SCREEN_UPDATE(hornet_2board) | |
| 1055 | 1055 | |
| 1056 | 1056 | MCFG_SCREEN_ADD("rscreen", RASTER) |
| 1057 | 1057 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 1058 | 1058 | MCFG_SCREEN_REFRESH_RATE(60) |
| 1059 | 1059 | MCFG_SCREEN_SIZE(512, 384) |
| 1060 | 1060 | MCFG_SCREEN_VISIBLE_AREA(0, 511, 0, 383) |
| 1061 | MCFG_SCREEN_UPDATE(hornet_2board) | |
| 1061 | MCFG_SCREEN_UPDATE(hornet_2board) | |
| 1062 | 1062 | MACHINE_CONFIG_END |
| 1063 | 1063 | |
| 1064 | 1064 | static MACHINE_CONFIG_DERIVED( terabrst, hornet_2board ) |
| r10613 | r10614 | |
|---|---|---|
| 640 | 640 | |
| 641 | 641 | MCFG_CPU_MODIFY("audiocpu") |
| 642 | 642 | MCFG_CPU_PROGRAM_MAP(ctribe_sound_map) |
| 643 | ||
| 643 | ||
| 644 | 644 | MCFG_SCREEN_MODIFY("screen") |
| 645 | 645 | MCFG_SCREEN_UPDATE(ctribe) |
| 646 | 646 |
| r10613 | r10614 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | |
| 8 | 8 | CPU : TMP68301* |
| 9 | ColdFire | |
| 9 | ColdFire + H8/3007 + PIC12C508 (for FUNCUBE) | |
| 10 | 10 | |
| 11 | Custom : X1-010 Sound: 8 Bit PCM | |
| 12 | DX-101 Sprites | |
| 11 | Video : DX-101 | |
| 13 | 12 | DX-102 x3 |
| 14 | 13 | |
| 15 | OSC: 50.00000MHz | |
| 16 | 32.53047MHz | |
| 14 | Sound : X1-010 | |
| 17 | 15 | |
| 16 | OSC : 50.00000MHz | |
| 17 | 32.53047MHz | |
| 18 | ||
| 18 | 19 | * The Toshiba TMP68301 is a 68HC000 + serial I/O, parallel I/O, |
| 19 | 20 | 3 timers, address decoder, wait generator, interrupt controller, |
| 20 | 21 | all integrated in a single chip. |
| r10613 | r10614 | |
| 35 | 36 | B0-006B 2001 Funcube 4 Namco |
| 36 | 37 | B0-010A 2001 Wing Shooting Championship Sammy |
| 37 | 38 | B0-010A 2002 Trophy Hunting - Bear & Moose Sammy |
| 39 | - ???? Reel'N Quake <unknown> | |
| 38 | 40 | ------------------------------------------------------------------------------------------- |
| 39 | 41 | |
| 40 | 42 | TODO: |
| r10613 | r10614 | |
| 42 | 44 | - Proper emulation of the TMP68301 CPU, in a core file. |
| 43 | 45 | - Proper emulation of the ColdFire CPU, in a core file. |
| 44 | 46 | - Flip screen / Zooming support. |
| 45 | - Fix some graphics imperfections (e.g. color depth selection, | |
| 46 | "tilemap" sprites) [all done? - NS] | |
| 47 | - Fix some graphics imperfections (e.g. color depth selection, "tilemap" sprites) [all done? - NS] | |
| 47 | 48 | - I added a kludge involving a -0x10 yoffset, this fixes the lifeline in myangel. |
| 48 | 49 | I didn't find a better way to do it without breaking pzlbowl's title screen. |
| 49 | 50 | |
| r10613 | r10614 | |
| 57 | 58 | that's how the palette is preinitialized by MAME, but the game never sets up those |
| 58 | 59 | palette entries. The game selects color depth "1", whose meaning is uncertain, and |
| 59 | 60 | color code 0 so I see no way to point to a different section of palette RAM. |
| 60 | ||
| 61 | 61 | - there are glitches in the bg horizontal scroll in the wedding sequence at the end of |
| 62 | 62 | the game. It looks like "scrollx" should be delayed one frame wrt "xoffs". |
| 63 | - there's a 4 pixel gap at the top of the title screen since clipping was reimplemented. | |
| 63 | 64 | |
| 64 | 65 | myangel2: |
| 65 | 66 | - before each level, the background image is shown with completely wrong colors. It |
| r10613 | r10614 | |
| 68 | 69 | grdians: |
| 69 | 70 | - the map screen after the character selection needs zooming. There is a global |
| 70 | 71 | zoom register that should affect the background map and the level picture but |
| 71 | not the frontmost frame. This latter should use color 7ff (the last one) | |
| 72 | and ignore the individual color codes in the tiles data. Zooming is also | |
| 73 | used briefly in pengbros. | |
| 72 | not the frontmost frame. This latter should use color 7ff (the last one) and | |
| 73 | ignore the individual color codes in the tiles data. Note: the frontmost frame | |
| 74 | has the shadow bit set, and has become invisible after implementing it. | |
| 74 | 75 | |
| 76 | pengbros: | |
| 77 | - Zooming is used briefly. | |
| 78 | ||
| 75 | 79 | deerhunt,wschamp: |
| 76 | - offset tilemap sprite during demo | |
| 80 | - offset tilemap sprite during demo. In deerhunt intro, the hunter should zoom | |
| 81 | in to the deer. In wschamp intro the GPS unit should zoom to the high scores. | |
| 77 | 82 | |
| 78 | 83 | trophyh: |
| 79 | 84 | - mame hangs for around 15 seconds every now and then, at scene changes. |
| r10613 | r10614 | |
| 84 | 89 | - Hacked to run, as they use a ColdFire CPU. |
| 85 | 90 | - Pay-out key causes "unknown error". |
| 86 | 91 | |
| 87 | ***************************************************************************/ | |
| 92 | reelquak: | |
| 93 | - Needs an x offset for tilemap sprites. | |
| 94 | - There are one frame glitches in the reels scroll. | |
| 88 | 95 | |
| 89 | /*************************************************************************** | |
| 90 | ||
| 91 | MS Gundam Ex Revue | |
| 92 | Banpresto, 1994 | |
| 93 | ||
| 94 | This game runs on Seta/Allumer hardware | |
| 95 | ||
| 96 | PCB Layout | |
| 97 | ---------- | |
| 98 | ||
| 99 | PO-113A BP949KA | |
| 100 | |----------------------------------| | |
| 101 | | X1-010 6264 U28 | | |
| 102 | | 581001 U19 | | |
| 103 | | U3 U5 U2 U4 581001 U17 | | |
| 104 | | 62256 62256 U15 | | |
| 105 | |J U20 | | |
| 106 | |A U77 68301 U18 | | |
| 107 | |M * U16 | | |
| 108 | |M 93C46 U23 | | |
| 109 | |A U22 | | |
| 110 | | U21 | | |
| 111 | | DSW1 50MHz | | |
| 112 | | DSW2 PAL 32.5304MHz | | |
| 113 | | 20MHz PAL | | |
| 114 | |----------------------------------| | |
| 115 | ||
| 116 | Notes: | |
| 117 | *: unknown QFP208 (has large heatsink on it). Should be similar to other known | |
| 118 | graphics chips used on Seta hardware of this era. | |
| 119 | 68301 clock: 16.000MHz (?? From what OSC + divider??) | |
| 120 | VSync: 60Hz | |
| 121 | ||
| 122 | 96 | ***************************************************************************/ |
| 123 | 97 | |
| 124 | /*************************************************************************** | |
| 125 | ||
| 126 | Guardians | |
| 127 | Banpresto, 1995 | |
| 128 | ||
| 129 | This hardware is not common Banpresto hardware. Possibly licensed | |
| 130 | to them from another manufacturer? Or an early design that they decided | |
| 131 | not to use for future games? Either way, this game is _extremely_ rare :-) | |
| 132 | ||
| 133 | PCB Layout | |
| 134 | ---------- | |
| 135 | ||
| 136 | P-FG01-1 | |
| 137 | ------------------------------------------------------ | |
| 138 | | X1-010 6264 U32 CXK581000 | | |
| 139 | | CXK581000 U16 | | |
| 140 | | | | |
| 141 | | U20 | | |
| 142 | | U3 U5 U2 U4 62256 CXK58257 | | |
| 143 | | 62256 CXK58257 U15 | | |
| 144 | | | | |
| 145 | |J U19 | | |
| 146 | |A TMP68301AF-16 | | |
| 147 | |M U18 | | |
| 148 | |M NEC | | |
| 149 | |A NEC DX-101 U22 | | |
| 150 | | DX-102 | | |
| 151 | | U17 | | |
| 152 | | PAL 50MHz | | |
| 153 | | U21 | | |
| 154 | | DSW1(8) | | |
| 155 | | DSW2(8) CXK58257 NEC | | |
| 156 | | CXK58257 DX-102| | |
| 157 | ------------------------------------------------------ | |
| 158 | ||
| 159 | Notes: | |
| 160 | HSync: 15.23kHz | |
| 161 | VSync: 58.5Hz | |
| 162 | ||
| 163 | ***************************************************************************/ | |
| 164 | ||
| 165 | /*************************************************************************** | |
| 166 | ||
| 167 | Penguin Brothers (Japan) | |
| 168 | ||
| 169 | (c)2000 Subsino | |
| 170 | ||
| 171 | CPU: Toshiba TMP68301AF-16 (100 Pin PQFP) | |
| 172 | Video: NEC DX-101 (240 Pin PQFP) | |
| 173 | NEC DX-102 (52 Pin PQFP x3) | |
| 174 | Sound: X1-010 (Mitsubishi M60016 Gate Array, 80 Pin PQFP) | |
| 175 | OSC: 50MHz, 32.53047MHz & 28MHz | |
| 176 | Other: 8 Position Dipswitch x 2 | |
| 177 | Lattice ispLSI2032 | |
| 178 | ||
| 179 | PCB Number: P0-142A | |
| 180 | +-----------------------------------------------------------+ | |
| 181 | | VOL +------+ | | |
| 182 | | |Seta | M1 | | |
| 183 | | +---+ +---+ |X1-010| | | |
| 184 | | | | | | M M | | +---+ | | |
| 185 | +-+ | U | | U | 1 1 +------+ | | | | |
| 186 | | | 0 | | 0 | 74HC00 | | | | |
| 187 | +-+ | 7 | | 6 | M M | U | | | |
| 188 | | | | | | 1 1 | 1 | | | |
| 189 | | +---+ +---+ | 8 | | | |
| 190 | | Lattice | | | | |
| 191 | |J D D +---+ ispLSI2032 | | | | |
| 192 | |A S S |DX | +-------+ +---+ | | |
| 193 | |M W W |102| |Toshiba| CN2 | | |
| 194 | |M 1 2 +---+ BAT1* | TMP | | | |
| 195 | |A | 68301 | U50* | | |
| 196 | | +-------+ | | |
| 197 | |C | | |
| 198 | |o 50MHz +----------+ 28MHz | | |
| 199 | |n +---+ | | | | |
| 200 | |n |DX | SW1 | NEC | M M | | |
| 201 | |e |102| | DX-101 | 2 2 | | |
| 202 | |c +---+ M M | | | | |
| 203 | |t 1 1 | | | | |
| 204 | |e +----------+ | | |
| 205 | |r | | |
| 206 | | +---+ +---++---++---+ | | |
| 207 | | | | | || || | | | |
| 208 | | +---+ | | | || || | | | |
| 209 | +-+ |DX | | U | | U || U || U | | | |
| 210 | | |102| 32.53047MHz | 4 | | 4 || 3 || 3 | | | |
| 211 | +-+ +---+ | 0 | | 1 || 8 || 9 | | | |
| 212 | | | | | || || | | | |
| 213 | | | | | || || | | | |
| 214 | | +---+ +---++---++---+ | | |
| 215 | +-----------------------------------------------------------+ | |
| 216 | ||
| 217 | Notes: pzlbowl PCB with these extra parts: | |
| 218 | 28MHz OSC | |
| 219 | 2x 62256 SRAM | |
| 220 | 74HC00 | |
| 221 | ||
| 222 | U50* Unpopulated 93LC46BX EEPROM | |
| 223 | BAT1* Unpopulated CR2032 3Volt battery | |
| 224 | ||
| 225 | Ram M1 are NEC D43001GU-70LL | |
| 226 | Ram M2 are LGS GM76C8128ALLFW70 | |
| 227 | ||
| 228 | ***************************************************************************/ | |
| 229 | ||
| 230 | /*************************************************************************** | |
| 231 | ||
| 232 | Puzzle De Bowling (Japan) | |
| 233 | ||
| 234 | (c)1999 Nihon System / Moss | |
| 235 | ||
| 236 | CPU: Toshiba TMP68301AF-16 (100 Pin PQFP) | |
| 237 | Video: NEC DX-101 (240 Pin PQFP) | |
| 238 | NEC DX-102 (52 Pin PQFP x3) | |
| 239 | Sound: X1-010 (Mitsubishi M60016 Gate Array, 80 Pin PQFP) | |
| 240 | OSC: 50MHz & 32.53047MHz | |
| 241 | Other: 8 Position Dipswitch x 2 | |
| 242 | Lattice ispLSI2032 - stamped "KUDEC" | |
| 243 | ||
| 244 | PCB Number: P0-142A | |
| 245 | +-----------------------------------------------------------+ | |
| 246 | | VOL +------+ | | |
| 247 | | |Seta | M1 | | |
| 248 | | +---+ +---+ |X1-010| | | |
| 249 | | | | | | U4* M | | +---+ | | |
| 250 | +-+ | U | | U | 1 +------+ | K | | | |
| 251 | | | 0 | | 0 | U30* | U | | | |
| 252 | +-+ | 7 | | 6 | U5* M | S | | | |
| 253 | | | | | | 1 | | | | |
| 254 | | +---+ +---+ | U | | | |
| 255 | | Lattice | 1 | | | |
| 256 | |J D D +---+ ispLSI2032 | 8 | | | |
| 257 | |A S S |DX | +-------+ +---+ | | |
| 258 | |M W W |102| |Toshiba| CN2 | | |
| 259 | |M 1 2 +---+ BAT1* | TMP | | | |
| 260 | |A | 68301 | U50* | | |
| 261 | | +-------+ | | |
| 262 | |C | | |
| 263 | |o 50MHz +----------+ XM2* | | |
| 264 | |n +---+ | | | | |
| 265 | |n |DX | SW1 | NEC | M M | | |
| 266 | |e |102| | DX-101 | 2 2 | | |
| 267 | |c +---+ M M | | | | |
| 268 | |t 1 1 | | | | |
| 269 | |e +----------+ | | |
| 270 | |r | | |
| 271 | | +---+ +---++---++---+ | | |
| 272 | | | K | | K || K || K | | | |
| 273 | | +---+ | U | | U || U || U | | | |
| 274 | +-+ |DX | | C | | C || C || C | | | |
| 275 | | |102| 32.53047MHz | | | || || | | | |
| 276 | +-+ +---+ | U | | U || U || U | | | |
| 277 | | | 4 | | 4 || 3 || 3 | | | |
| 278 | | | 0 | | 1 || 8 || 9 | | | |
| 279 | | +---+ +---++---++---+ | | |
| 280 | +-----------------------------------------------------------+ | |
| 281 | ||
| 282 | * Unpopulated: | |
| 283 | U4 & U5 RAM HM62256 equivalent | |
| 284 | U50 93LC46BX EEPROM | |
| 285 | U30 74HC00 | |
| 286 | BAT1 CR2032 3Volt battery | |
| 287 | XM2 OSC | |
| 288 | ||
| 289 | Ram M1 are NEC D43001GU-70LL | |
| 290 | Ram M2 are LGS GM76C8128ALLFW70 | |
| 291 | ||
| 292 | KUP-U06-I03 U06 Program rom ST27C4001 (even) | |
| 293 | KUP-U07-I03 U07 Program rom ST27C4001 (odd) | |
| 294 | ||
| 295 | KUS-U18-I00 U18 Mask rom (Samples 23C32000 32Mbit) | |
| 296 | ||
| 297 | KUC-U38-I00 U38 Mask rom (Graphics 23C32000 32Mbit) | |
| 298 | KUC-U39-I00 U39 Mask rom (Graphics 23C32000 32Mbit) | |
| 299 | KUC-U40-I00 U40 Mask rom (Graphics 23C32000 32Mbit) | |
| 300 | KUC-U41-I00 U41 Mask rom (Graphics 23C32000 32Mbit) | |
| 301 | ||
| 302 | ***************************************************************************/ | |
| 303 | ||
| 304 | /*************************************************************************** | |
| 305 | ||
| 306 | Sammy USA Outdoor Shooting Series PCB | |
| 307 | ||
| 308 | PCB B0-003A (or B0-003B): | |
| 309 | Deer Hunting USA (c) 2000 Sammy USA | |
| 310 | Turkey Hunting USA (c) 2001 Sammy USA | |
| 311 | ||
| 312 | PCB B0-010A: | |
| 313 | Wing Shooting Championship (c) 2001 Sammy USA | |
| 314 | Trophy Hunting - Bear & Moose (c) 2002 Sammy USA | |
| 315 | ||
| 316 | ||
| 317 | CPU: Toshiba TMP68301AF-16 (100 Pin PQFP) | |
| 318 | Video: NEC DX-101 (240 Pin PQFP) | |
| 319 | NEC DX-102 (52 Pin PQFP x3) | |
| 320 | Sound: X1-010 (Mitsubishi M60016 Gate Array, 80 Pin PQFP) | |
| 321 | EEPROM: 93LC46BX (1K Low-power 64 x 16-bit organization serial EEPROM) | |
| 322 | OSC: 50MHz & 28MHz | |
| 323 | Other: 8 Position Dipswitch x 2 | |
| 324 | Lattice ispLSI2032 - stamped "KW001" | |
| 325 | Lattice isp1016E - stamped "GUN" (2 for PCB B0-010A, used for light gun input) | |
| 326 | BAT1 - CR2032 3Volt | |
| 327 | ||
| 328 | PCB Number: B0-003A (or B0-003B) | |
| 329 | +-----------------------------------------------------------+ | |
| 330 | | VOL +------+ | | |
| 331 | | |X1-010| M1 | | |
| 332 | | +---+ +---+ |M60016| | | |
| 333 | | | | | | M M |CALRUA| +---+ | | |
| 334 | +-+ | U | | U | 2 1 +------+ | | | | |
| 335 | | | 0 | | 0 | | | | | |
| 336 | +-+ | 7 | | 6 | M M | U | | | |
| 337 | | | | | | 2 1 | 1 | | | |
| 338 | | +---+ +---+ | 8 | | | |
| 339 | | Lattice | | | | |
| 340 | |J D +---+ C ispLSI2032 | | | | |
| 341 | |A S |DX | N BAT1 +-------+ +---+ | | |
| 342 | |M W |102| 5 |Toshiba| D | | |
| 343 | |M 1 +---+ | TMP | S EEPROM C | | |
| 344 | |A C | 68301 | W N | | |
| 345 | | N Lattice +-------+ 2 2 | | |
| 346 | |C 6 isp1016E | | |
| 347 | |o +----------+ 50MHz | | |
| 348 | |n +---+ | | | | |
| 349 | |n |DX | SW1 | NEC | M M | | |
| 350 | |e |102| | DX-101 | 3 3 | | |
| 351 | |c +---+ M M | | | | |
| 352 | |t 1 1 | | | | |
| 353 | |e +----------+ | | |
| 354 | |r | | |
| 355 | | +---+ +---++---++---+ | | |
| 356 | | 28MHz | | | || || | | | |
| 357 | | +---+ | | | || || | | | |
| 358 | +-+ |DX | | U | | U || U || U | | | |
| 359 | | |102| | 4 | | 4 || 3 || 3 | | | |
| 360 | +-+ +---+ | 0 | | 1 || 8 || 9 | | | |
| 361 | | | | | || || | | | |
| 362 | | | | | || || | | | |
| 363 | | +---+ +---++---++---+ | | |
| 364 | +-----------------------------------------------------------+ | |
| 365 | ||
| 366 | PCB Number: B0-010A - This PCB is slightly revised for 2 player play | |
| 367 | +-----------------------------------------------------------+ | |
| 368 | | VOL +------+ | | |
| 369 | | |X1-010| M1 | | |
| 370 | | +---+ +---+ |M60016| | | |
| 371 | | | | | | M M |CALRUA| +---+ | | |
| 372 | +-+ | U | | U | 2 1 +------+ | | | | |
| 373 | | | 0 | | 0 | | | | | |
| 374 | +-+ | 7 | | 6 | M M | U | | | |
| 375 | | | | | | 2 1 | 1 | | | |
| 376 | | +---+ +---+ | 8 | | | |
| 377 | | Lattice | | | | |
| 378 | |J D +---+ C ispLSI2032 | | | | |
| 379 | |A S |DX | N BAT1 +-------+ +---+ | | |
| 380 | |M W |102| 5 |Toshiba| D | | |
| 381 | |M 1 +---+ | TMP | S EEPROM C | | |
| 382 | |A C | 68301 | W N | | |
| 383 | | N Lattice +-------+ 2 2 | | |
| 384 | |C 6 isp1016E | | |
| 385 | |o +----------+ 50MHz | | |
| 386 | |n +---+ | | | | |
| 387 | |n |DX | SW1 | NEC | M M | | |
| 388 | |e |102| | DX-101 | 3 3 | | |
| 389 | |c +---+ M M | | | | |
| 390 | |t 1 1 | | | | |
| 391 | |e +----------+ | | |
| 392 | |r | | |
| 393 | | +---+ +---++---++---+ | | |
| 394 | | 28MHz | | | || || | | | |
| 395 | | +---+ C | | | || || | | | |
| 396 | +-+ |DX | N | U | | U || U || U | | | |
| 397 | | |102| 7 | 4 | | 4 || 3 || 3 | | | |
| 398 | +-+ +---+ | 0 | | 1 || 8 || 9 | | | |
| 399 | | Lattice C | | | || || | | | |
| 400 | | isp1016E N | | | || || | | | |
| 401 | | 8 +---+ +---++---++---+ | | |
| 402 | +-----------------------------------------------------------+ | |
| 403 | ||
| 404 | Ram M1 are Toshiba TC55257DFL-70L | |
| 405 | Ram M2 are NEC D43001GU-70L | |
| 406 | Ram M3 are ISSI IS62C1024L-70Q | |
| 407 | ||
| 408 | U06 Program rom ST27C801 (even) | |
| 409 | U07 Program rom ST27C801 (odd) | |
| 410 | ||
| 411 | U18 Mask rom (Samples 23C32000 32Mbit (read as 27C322)) | |
| 412 | ||
| 413 | U38 - U40 Mask roms (Graphics 23c64020 64Mbit) - 23C64020 read as 27C322 with pin11 +5v & 27C322 with pin11 GND | |
| 414 | ||
| 415 | -------------------------------------------------------------------------- | |
| 416 | ||
| 417 | From the WSC upgrade instruction sheet: | |
| 418 | ||
| 419 | Wing Shooting Championship | |
| 420 | Game Echancement | |
| 421 | 1/23/02 | |
| 422 | ||
| 423 | New Program chip Ver. 2.00 For Wing Shooting Championship | |
| 424 | We are announcing NEW GAME FEATURES to enhance game play. Please refer below. | |
| 425 | ||
| 426 | NEW FEATURES | |
| 427 | ------------ | |
| 428 | ||
| 429 | * Easier play for the first 3 hunting spots in every state with the addition of more birds. | |
| 430 | * The "BEGINNER" weapon has been changed to the 5-shot PUMP SHOTGUN plus the "hit area" | |
| 431 | for each shot has been increased. Same as the 3-shot SEMI-AUTO SHOTGUN. | |
| 432 | * Player can now advance through all result screens faster by pulling gun trigger. | |
| 433 | * The Auto Select bird is now GOOSE (easiest target) if player fails to choose bird at start of game. | |
| 434 | ||
| 435 | ***************************************************************************/ | |
| 436 | ||
| 437 | /*************************************************************************** | |
| 438 | ||
| 439 | FUNCUBE (BET) Series, includes 2 through 5? | |
| 440 | ||
| 441 | PCB Number: B0-006B (also known as EVA3_A system and is non-JAMMA) | |
| 442 | +------------------------------------------------+ | |
| 443 | |+--+ S +---+ +---+ CN5 | | |
| 444 | || | W | | | | CN6?| | |
| 445 | || | 4 | U | | U | | | |
| 446 | || | | 4 | | 4 | +---+ CN2?| | |
| 447 | || | | 2 | | 3 | |DX | | | |
| 448 | || | | | | | |102| | | |
| 449 | ||C | | | | | +---+ | | |
| 450 | ||N | +---+ +---+ | | |
| 451 | ||4 | | | |
| 452 | || | +----------+ M1 | | |
| 453 | || | M3 | | C | | |
| 454 | || | | NEC | M1 N | | |
| 455 | || | M3 | DX-101 | 3 | | |
| 456 | || | | | | | |
| 457 | || | | | 50MHz | | |
| 458 | |+--+ +----------+ | | |
| 459 | | PIC 25.447MHz +-----------+ | | |
| 460 | | CN7 | U47 | | | |
| 461 | | +-----------+ | | |
| 462 | | +-----------+ +---+ +---+ D | | |
| 463 | | | U3 | |OKI| |DX | S | | |
| 464 | | M2 +-----------+ | | |102| W | | |
| 465 | | +---+ +---+ 1 | | |
| 466 | | ispLSI2032 | | |
| 467 | | M1 +---+ | | |
| 468 | | +----------+ |IDT| +--+| | |
| 469 | | | | C | | | || | |
| 470 | | C | ColdFire | N +---+ | || | |
| 471 | | N M2 | XCF5206E | 8 | || | |
| 472 | | 1 | | +---+ |C || | |
| 473 | | | | |H8 | |N || | |
| 474 | | M1 +----------+ +---+ D |9 || | |
| 475 | | 14.7456MHz S | || | |
| 476 | | +-----------+W | || | |
| 477 | | SW1 BAT1 | U49 |2 +--+| | |
| 478 | | +-----------+ | | |
| 479 | +------------------------------------------------+ | |
| 480 | ||
| 481 | CPU: ColdFire XCF5206EFT54 (160 Pin PQFP) | |
| 482 | Hitachi H8/3007 (64130007F20) used for touch screen I/O | |
| 483 | Video: NEC DX-101 (240 Pin PQFP) | |
| 484 | NEC DX-102 (52 Pin PQFP x2) | |
| 485 | Sound: OKI MSM9810B 8-Channel Mixing ADPCM Type Voice Synthesis LSI | |
| 486 | OSC: 50MHz, 25.447MHz & 14.7456MHz | |
| 487 | Other: Lattice ispLSI2032 - stamped "EVA3A" | |
| 488 | BAT1 - CR2032 3Volt | |
| 489 | ||
| 490 | ColdFire XCF5206EFT54: | |
| 491 | 68K/ColdFire V2 core family | |
| 492 | 8K internal SRAM | |
| 493 | 54MHz (max) Bus Frequency | |
| 494 | 32bit External Bus Width | |
| 495 | 2 UART Serial Interfaces | |
| 496 | 2 Timer Channels | |
| 497 | ||
| 498 | PIC - PIC12C508 MCU used for security | |
| 499 | Labeled FC21A for Funcube 2 | |
| 500 | Labeled FC41A for Funcube 4 | |
| 501 | ||
| 502 | Ram M1 are Toshiba TC55257DFL-70L | |
| 503 | Ram M2 are NEC D43001GU-70L | |
| 504 | Ram M3 are ISSI IS62C1024L-70Q | |
| 505 | IDT - IDT 7130 64-pin TQFP High-speed 1K x 8 Dual-Port Static RAM | |
| 506 | ||
| 507 | CN1 - Unused 64 pin double row connecter | |
| 508 | CN2? 2x2 connecter | |
| 509 | CN3 - Unused 50 pin double row connecter | |
| 510 | CN4 - 96 pin triple row connecter | |
| 511 | CN5 - 2x3 pin connecter | |
| 512 | CN6? 3x3 connecter | |
| 513 | CN7 - Unused 20 pin connecter | |
| 514 | CN8 - 8 pin single row connecter | |
| 515 | CN9 - 40 pin double row connecter | |
| 516 | ||
| 517 | DSW1 - 8 position dipswitch | |
| 518 | DSW2 - 2 position dipswitch | |
| 519 | SW1 - Pushbutton | |
| 520 | SW4 - Single position slider switch | |
| 521 | ||
| 522 | U3 - Is a 27C4002 EPROM | |
| 523 | U49 - Is a 27C1001 EPROM | |
| 524 | U42, U43 & U47 are MASK ROMs read as 27C322 | |
| 525 | ||
| 526 | The same H8/3007 code "FC21 IOPR-0" at U49 is used for FUNCUBE 2,3,4 & 5 | |
| 527 | ||
| 528 | ***************************************************************************/ | |
| 529 | ||
| 530 | 98 | #include "emu.h" |
| 531 | 99 | #include "memconv.h" |
| 532 | 100 | #include "deprecat.h" |
| 101 | #include "includes/seta2.h" | |
| 533 | 102 | #include "cpu/m68000/m68000.h" |
| 534 | 103 | #include "machine/tmp68301.h" |
| 535 | 104 | #include "cpu/h83002/h8.h" |
| 105 | #include "sound/okim9810.h" | |
| 106 | #include "sound/x1_010.h" | |
| 536 | 107 | #include "machine/eeprom.h" |
| 537 | #include "sound/x1_010.h" | |
| 538 | #include "sound/okim9810.h" | |
| 539 | #include "includes/seta2.h" | |
| 540 | 108 | #include "machine/nvram.h" |
| 109 | #include "machine/ticket.h" | |
| 541 | 110 | |
| 542 | 111 | /*************************************************************************** |
| 543 | 112 | |
| r10613 | r10614 | |
| 818 | 387 | |
| 819 | 388 | |
| 820 | 389 | /*************************************************************************** |
| 390 | Reel'N Quake | |
| 391 | ***************************************************************************/ | |
| 392 | ||
| 393 | static WRITE16_HANDLER( reelquak_leds_w ) | |
| 394 | { | |
| 395 | if (ACCESSING_BITS_0_7) | |
| 396 | { | |
| 397 | set_led_status( space->machine, 0, data & 0x0001 ); // start | |
| 398 | set_led_status( space->machine, 1, data & 0x0002 ); // small | |
| 399 | set_led_status( space->machine, 2, data & 0x0004 ); // bet | |
| 400 | set_led_status( space->machine, 3, data & 0x0008 ); // big | |
| 401 | set_led_status( space->machine, 4, data & 0x0010 ); // double up | |
| 402 | set_led_status( space->machine, 5, data & 0x0020 ); // collect | |
| 403 | set_led_status( space->machine, 6, data & 0x0040 ); // bet cancel | |
| 404 | } | |
| 405 | if (ACCESSING_BITS_8_15) | |
| 406 | { | |
| 407 | ticket_dispenser_w(space->machine->device("ticket"), 0, (data & 0x0100) >> 1); // ticket dispenser | |
| 408 | } | |
| 409 | ||
| 410 | // popmessage("LED %04X", data); | |
| 411 | } | |
| 412 | ||
| 413 | static WRITE16_HANDLER( reelquak_coin_w ) | |
| 414 | { | |
| 415 | if (ACCESSING_BITS_0_7) | |
| 416 | { | |
| 417 | coin_counter_w(space->machine, 0, data & 0x01); // coin in | |
| 418 | coin_counter_w(space->machine, 1, data & 0x02); // coin in | |
| 419 | coin_counter_w(space->machine, 2, data & 0x04); // pay out | |
| 420 | coin_counter_w(space->machine, 3, data & 0x08); // key in | |
| 421 | // data & 0x10); // Sound IRQ Ack.? 1->0 | |
| 422 | // data & 0x20); // Vblank IRQ.? 1 | |
| 423 | } | |
| 424 | // popmessage("COIN %04X", data & 0xffff); | |
| 425 | } | |
| 426 | ||
| 427 | static ADDRESS_MAP_START( reelquak_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 428 | AM_RANGE(0x000000, 0x0fffff) AM_ROM // ROM | |
| 429 | AM_RANGE(0x200000, 0x20ffff) AM_RAM // RAM | |
| 430 | AM_RANGE(0x300000, 0x303fff) AM_RAM AM_SHARE("nvram") // NVRAM (Battery Backed) | |
| 431 | AM_RANGE(0x400000, 0x400001) AM_READ_PORT("P1") // P1 | |
| 432 | AM_RANGE(0x400002, 0x400003) AM_READ_PORT("TICKET") // Tickets | |
| 433 | AM_RANGE(0x400004, 0x400005) AM_READ_PORT("SYSTEM") // Coins | |
| 434 | AM_RANGE(0x400006, 0x400007) AM_READ(watchdog_reset16_r) // Watchdog | |
| 435 | AM_RANGE(0x400200, 0x400201) AM_WRITE(reelquak_coin_w) // Coin Counters / IRQ Ack | |
| 436 | AM_RANGE(0x400300, 0x400301) AM_READ_PORT("DSW1") // DSW 1 | |
| 437 | AM_RANGE(0x400302, 0x400303) AM_READ_PORT("DSW2") // DSW 2 | |
| 438 | AM_RANGE(0x400300, 0x40030f) AM_WRITE(seta2_sound_bank_w) // Samples Banks | |
| 439 | AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE("x1snd", seta_sound_word_r,seta_sound_word_w) // Sound | |
| 440 | AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_BASE_SIZE_MEMBER(seta2_state, spriteram, spriteram_size) // Sprites | |
| 441 | AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE_GENERIC(paletteram) // Palette | |
| 442 | AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_BASE_MEMBER(seta2_state, vregs) // Video Registers | |
| 443 | AM_RANGE(0xfffd0a, 0xfffd0b) AM_WRITE( reelquak_leds_w ) // parallel data register (leds) | |
| 444 | AM_RANGE(0xfffc00, 0xffffff) AM_READWRITE(tmp68301_regs_r, tmp68301_regs_w) // TMP68301 Registers | |
| 445 | ADDRESS_MAP_END | |
| 446 | ||
| 447 | ||
| 448 | /*************************************************************************** | |
| 821 | 449 | Sammy Outdoor Shooting |
| 822 | 450 | ***************************************************************************/ |
| 823 | 451 | |
| r10613 | r10614 | |
| 1846 | 1474 | |
| 1847 | 1475 | |
| 1848 | 1476 | /*************************************************************************** |
| 1477 | Reel'N Quake | |
| 1478 | ***************************************************************************/ | |
| 1479 | ||
| 1480 | static INPUT_PORTS_START( reelquak ) | |
| 1481 | PORT_START("DSW1") // $400300.w | |
| 1482 | PORT_DIPNAME( 0x0001, 0x0001, "Game Style" ) | |
| 1483 | PORT_DIPSETTING( 0x0001, DEF_STR( Standard ) ) | |
| 1484 | PORT_DIPSETTING( 0x0000, "Redemption" ) | |
| 1485 | PORT_DIPNAME( 0x000e, 0x000e, "Key-In Credits" ) | |
| 1486 | PORT_DIPSETTING( 0x000c, "1 Turn / 2 Credits" ) | |
| 1487 | PORT_DIPSETTING( 0x000a, "1 Turn / 3 Credits" ) | |
| 1488 | PORT_DIPSETTING( 0x0008, "1 Turn / 5 Credits" ) | |
| 1489 | PORT_DIPSETTING( 0x000e, "1 Turn / 10 Credits" ) | |
| 1490 | PORT_DIPSETTING( 0x0006, "1 Turn / 20 Credits" ) | |
| 1491 | PORT_DIPSETTING( 0x0004, "1 Turn / 25 Credits" ) | |
| 1492 | PORT_DIPSETTING( 0x0002, "1 Turn / 50 Credits" ) | |
| 1493 | PORT_DIPSETTING( 0x0000, "1 Turn / 100 Credits" ) | |
| 1494 | PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) ) | |
| 1495 | PORT_DIPSETTING( 0x0030, DEF_STR( 1C_1C ) ) | |
| 1496 | PORT_DIPSETTING( 0x0020, DEF_STR( 1C_2C ) ) | |
| 1497 | PORT_DIPSETTING( 0x0010, DEF_STR( 1C_5C ) ) | |
| 1498 | PORT_DIPSETTING( 0x0000, "1 Coin/10 Credits" ) | |
| 1499 | PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) ) // bit 7 tested according to game style | |
| 1500 | PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_1C ) ) | |
| 1501 | PORT_DIPSETTING( 0x0080, DEF_STR( 1C_2C ) ) | |
| 1502 | PORT_DIPSETTING( 0x0040, DEF_STR( 1C_5C ) ) | |
| 1503 | PORT_DIPSETTING( 0x0000, "1 Coin/10 Credits" ) | |
| 1504 | ||
| 1505 | PORT_START("DSW2") // $400302.w | |
| 1506 | PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) // used | |
| 1507 | PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) | |
| 1508 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1509 | PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) | |
| 1510 | PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) | |
| 1511 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1512 | PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) | |
| 1513 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) | |
| 1514 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1515 | PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) | |
| 1516 | PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) | |
| 1517 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1518 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) | |
| 1519 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) | |
| 1520 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1521 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) | |
| 1522 | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) | |
| 1523 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1524 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) | |
| 1525 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) | |
| 1526 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1527 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) | |
| 1528 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) | |
| 1529 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 1530 | ||
| 1531 | PORT_START("P1") // $400001.b | |
| 1532 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) // bet cancel | |
| 1533 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) // collect | |
| 1534 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) // double up | |
| 1535 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) // big | |
| 1536 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_POKER_BET ) // bet | |
| 1537 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) // small | |
| 1538 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) // start | |
| 1539 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1540 | ||
| 1541 | PORT_START("TICKET") // $400003.b | |
| 1542 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket", ticket_dispenser_line_r) // ticket sensor | |
| 1543 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1544 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1545 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // knock down | |
| 1546 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Ticket Clear") // ticket clear | |
| 1547 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Ticket Resume") // ticket resume | |
| 1548 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) // key in | |
| 1549 | PORT_SERVICE_NO_TOGGLE(0x0080, IP_ACTIVE_LOW ) // test mode | |
| 1550 | ||
| 1551 | PORT_START("SYSTEM") // $400005.b | |
| 1552 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin a | |
| 1553 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // coin b | |
| 1554 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service | |
| 1555 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // diagnostic | |
| 1556 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1557 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1558 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1559 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1560 | INPUT_PORTS_END | |
| 1561 | ||
| 1562 | ||
| 1563 | /*************************************************************************** | |
| 1849 | 1564 | Sammy Outdoor Shooting |
| 1850 | 1565 | ***************************************************************************/ |
| 1851 | 1566 | |
| r10613 | r10614 | |
| 2179 | 1894 | /* Tiles are 8bpp, but the hardware is additionally able to discard |
| 2180 | 1895 | some bitplanes and use the low 4 bits only, or the high 4 bits only */ |
| 2181 | 1896 | static GFXDECODE_START( seta2 ) |
| 2182 | GFXDECODE_ENTRY( "gfx1", 0, layout_4bpp_lo, 0, 0x8000/16 ) | |
| 2183 | GFXDECODE_ENTRY( "gfx1", 0, layout_4bpp_hi, 0, 0x8000/16 ) | |
| 2184 | GFXDECODE_ENTRY( "gfx1", 0, layout_6bpp, 0, 0x8000/16 ) /* 6bpp, but 4bpp granularity */ | |
| 2185 | GFXDECODE_ENTRY( "gfx1", 0, layout_8bpp, 0, 0x8000/16 ) /* 8bpp, but 4bpp granularity */ | |
| 2186 | GFXDECODE_ENTRY( "gfx1", 0, layout_3bpp_lo, 0, 0x8000/16 ) /* 3bpp, but 4bpp granularity */ | |
| 2187 | GFXDECODE_ENTRY( "gfx1", 0, layout_2bpp_hi, 0, 0x8000/16 ) /* ??? */ | |
| 1897 | GFXDECODE_ENTRY( "sprites", 0, layout_4bpp_lo, 0, 0x8000/16 ) | |
| 1898 | GFXDECODE_ENTRY( "sprites", 0, layout_4bpp_hi, 0, 0x8000/16 ) | |
| 1899 | GFXDECODE_ENTRY( "sprites", 0, layout_6bpp, 0, 0x8000/16 ) // 6bpp, but 4bpp color granularity | |
| 1900 | GFXDECODE_ENTRY( "sprites", 0, layout_8bpp, 0, 0x8000/16 ) // 8bpp, but 4bpp color granularity | |
| 1901 | GFXDECODE_ENTRY( "sprites", 0, layout_3bpp_lo, 0, 0x8000/16 ) // 3bpp, but 4bpp color granularity | |
| 1902 | GFXDECODE_ENTRY( "sprites", 0, layout_2bpp_hi, 0, 0x8000/16 ) // 2bpp, but 4bpp color granularity | |
| 2188 | 1903 | GFXDECODE_END |
| 2189 | 1904 | |
| 2190 | 1905 | /*************************************************************************** |
| r10613 | r10614 | |
| 2260 | 1975 | /* Tiles are 8bpp, but the hardware is additionally able to discard |
| 2261 | 1976 | some bitplanes and use the low 4 bits only, or the high 4 bits only */ |
| 2262 | 1977 | static GFXDECODE_START( funcube ) |
| 2263 | GFXDECODE_ENTRY( "gfx1", 0, funcube_layout_4bpp_lo, 0, 0x8000/16 ) | |
| 2264 | GFXDECODE_ENTRY( "gfx1", 0, funcube_layout_4bpp_hi, 0, 0x8000/16 ) | |
| 2265 | GFXDECODE_ENTRY( "gfx1", 0, funcube_layout_6bpp, 0, 0x8000/16 ) // 6bpp, but 4bpp granularity | |
| 2266 | GFXDECODE_ENTRY( "gfx1", 0, funcube_layout_8bpp, 0, 0x8000/16 ) // 8bpp, but 4bpp granularity | |
| 2267 | GFXDECODE_ENTRY( "gfx1", 0, funcube_layout_3bpp_lo, 0, 0x8000/16 ) // 3bpp, but 4bpp granularity | |
| 2268 | GFXDECODE_ENTRY( "gfx1", 0, funcube_layout_2bpp_hi, 0, 0x8000/16 ) // ??? | |
| 1978 | GFXDECODE_ENTRY( "sprites", 0, funcube_layout_4bpp_lo, 0, 0x8000/16 ) | |
| 1979 | GFXDECODE_ENTRY( "sprites", 0, funcube_layout_4bpp_hi, 0, 0x8000/16 ) | |
| 1980 | GFXDECODE_ENTRY( "sprites", 0, funcube_layout_6bpp, 0, 0x8000/16 ) // 6bpp, but 4bpp color granularity | |
| 1981 | GFXDECODE_ENTRY( "sprites", 0, funcube_layout_8bpp, 0, 0x8000/16 ) // 8bpp, but 4bpp color granularity | |
| 1982 | GFXDECODE_ENTRY( "sprites", 0, funcube_layout_3bpp_lo, 0, 0x8000/16 ) // 3bpp, but 4bpp color granularity | |
| 1983 | GFXDECODE_ENTRY( "sprites", 0, funcube_layout_2bpp_hi, 0, 0x8000/16 ) // 2bpp, but 4bpp color granularity | |
| 2269 | 1984 | GFXDECODE_END |
| 2270 | 1985 | |
| 2271 | 1986 | |
| r10613 | r10614 | |
| 2304 | 2019 | 0x0000, /* address */ |
| 2305 | 2020 | }; |
| 2306 | 2021 | |
| 2307 | ||
| 2308 | static MACHINE_CONFIG_START( mj4simai, seta2_state ) | |
| 2309 | ||
| 2310 | /* basic machine hardware */ | |
| 2311 | MCFG_CPU_ADD("maincpu",M68000,50000000/3) /* !! TMP68301 @ 16.666666MHz !! */ | |
| 2022 | static MACHINE_CONFIG_START( seta2, seta2_state ) | |
| 2023 | MCFG_CPU_ADD("maincpu", M68000, XTAL_50MHz/3) // !! TMP68301 !! | |
| 2312 | 2024 | MCFG_CPU_PROGRAM_MAP(mj4simai_map) |
| 2313 | 2025 | MCFG_CPU_VBLANK_INT("screen", seta2_interrupt) |
| 2314 | 2026 | |
| 2315 | 2027 | MCFG_MACHINE_START( tmp68301 ) |
| 2316 | 2028 | MCFG_MACHINE_RESET( tmp68301 ) |
| 2317 | 2029 | |
| 2318 | / | |
| 2030 | // video hardware | |
| 2319 | 2031 | MCFG_SCREEN_ADD("screen", RASTER) |
| 2320 | 2032 | MCFG_SCREEN_REFRESH_RATE(60) |
| 2321 | 2033 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| r10613 | r10614 | |
| 2326 | 2038 | MCFG_SCREEN_EOF(seta2) |
| 2327 | 2039 | |
| 2328 | 2040 | MCFG_GFXDECODE(seta2) |
| 2329 | MCFG_PALETTE_LENGTH(0x8000+0xf0) / | |
| 2041 | MCFG_PALETTE_LENGTH(0x8000+0xf0) // extra 0xf0 because we might draw 256-color object with 16-color granularity | |
| 2330 | 2042 | |
| 2331 | 2043 | MCFG_VIDEO_START(seta2) |
| 2332 | 2044 | |
| 2333 | / | |
| 2045 | // sound hardware | |
| 2334 | 2046 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 2335 | 2047 | |
| 2336 | MCFG_SOUND_ADD("x1snd", X1_010, 50 | |
| 2048 | MCFG_SOUND_ADD("x1snd", X1_010, XTAL_50MHz | |
| 2337 | 2049 | MCFG_SOUND_CONFIG(x1_010_sound_intf) |
| 2338 | 2050 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 2339 | 2051 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 2340 | 2052 | MACHINE_CONFIG_END |
| 2341 | 2053 | |
| 2342 | static MACHINE_CONFIG_DERIVED( gundamex, mj4simai ) | |
| 2343 | 2054 | |
| 2344 | ||
| 2055 | ||
| 2345 | 2056 | MCFG_CPU_MODIFY("maincpu") |
| 2057 | MCFG_CPU_PROGRAM_MAP(mj4simai_map) | |
| 2058 | ||
| 2059 | // video hardware | |
| 2060 | MCFG_SCREEN_MODIFY("screen") | |
| 2061 | MCFG_SCREEN_VISIBLE_AREA(0x40, 0x1c0-1, 0x80, 0x170-1) | |
| 2062 | MACHINE_CONFIG_END | |
| 2063 | ||
| 2064 | ||
| 2065 | static MACHINE_CONFIG_DERIVED( gundamex, seta2 ) | |
| 2066 | MCFG_CPU_MODIFY("maincpu") | |
| 2346 | 2067 | MCFG_CPU_PROGRAM_MAP(gundamex_map) |
| 2347 | 2068 | |
| 2348 | 2069 | MCFG_EEPROM_93C46_ADD("eeprom") |
| 2349 | 2070 | |
| 2350 | / | |
| 2071 | // video hardware | |
| 2351 | 2072 | MCFG_SCREEN_MODIFY("screen") |
| 2352 | 2073 | MCFG_SCREEN_VISIBLE_AREA(0x00, 0x180-1, 0x100, 0x1e0-1) |
| 2353 | 2074 | MACHINE_CONFIG_END |
| 2354 | 2075 | |
| 2355 | static MACHINE_CONFIG_DERIVED( grdians, mj4simai ) | |
| 2076 | ||
| 2077 | static MACHINE_CONFIG_DERIVED( grdians, seta2 ) | |
| 2356 | 2078 | MCFG_CPU_MODIFY("maincpu") |
| 2357 | 2079 | MCFG_CPU_PROGRAM_MAP(grdians_map) |
| 2358 | 2080 | |
| 2359 | / | |
| 2081 | // video hardware | |
| 2360 | 2082 | MCFG_SCREEN_MODIFY("screen") |
| 2361 | 2083 | MCFG_SCREEN_VISIBLE_AREA(0x80, 0x80 + 0x130 -1, 0x80, 0x80 + 0xe8 -1) |
| 2362 | 2084 | MACHINE_CONFIG_END |
| 2363 | 2085 | |
| 2364 | 2086 | |
| 2365 | static MACHINE_CONFIG_DERIVED( myangel, mj4simai ) | |
| 2366 | ||
| 2367 | /* basic machine hardware */ | |
| 2087 | static MACHINE_CONFIG_DERIVED( myangel, seta2 ) | |
| 2368 | 2088 | MCFG_CPU_MODIFY("maincpu") |
| 2369 | 2089 | MCFG_CPU_PROGRAM_MAP(myangel_map) |
| 2370 | 2090 | |
| 2371 | / | |
| 2091 | // video hardware | |
| 2372 | 2092 | MCFG_SCREEN_MODIFY("screen") |
| 2373 | 2093 | MCFG_SCREEN_VISIBLE_AREA(0, 0x178-1, 0x00, 0xf0-1) |
| 2374 | 2094 | |
| 2375 | MCFG_VIDEO_START(seta2_offset) | |
| 2095 | MCFG_VIDEO_START(seta2_yoffset) | |
| 2376 | 2096 | MACHINE_CONFIG_END |
| 2377 | 2097 | |
| 2378 | 2098 | |
| 2379 | static MACHINE_CONFIG_DERIVED( myangel2, mj4simai ) | |
| 2380 | ||
| 2381 | /* basic machine hardware */ | |
| 2099 | static MACHINE_CONFIG_DERIVED( myangel2, seta2 ) | |
| 2382 | 2100 | MCFG_CPU_MODIFY("maincpu") |
| 2383 | 2101 | MCFG_CPU_PROGRAM_MAP(myangel2_map) |
| 2384 | 2102 | |
| 2385 | / | |
| 2103 | // video hardware | |
| 2386 | 2104 | MCFG_SCREEN_MODIFY("screen") |
| 2387 | 2105 | MCFG_SCREEN_VISIBLE_AREA(0, 0x178-1, 0x00, 0xf0-1) |
| 2388 | 2106 | |
| 2389 | MCFG_VIDEO_START(seta2_offset) | |
| 2107 | MCFG_VIDEO_START(seta2_yoffset) | |
| 2390 | 2108 | MACHINE_CONFIG_END |
| 2391 | 2109 | |
| 2392 | 2110 | |
| 2393 | static MACHINE_CONFIG_DERIVED( pzlbowl, mj4simai ) | |
| 2394 | ||
| 2395 | /* basic machine hardware */ | |
| 2111 | static MACHINE_CONFIG_DERIVED( pzlbowl, seta2 ) | |
| 2396 | 2112 | MCFG_CPU_MODIFY("maincpu") |
| 2397 | 2113 | MCFG_CPU_PROGRAM_MAP(pzlbowl_map) |
| 2398 | 2114 | |
| 2399 | / | |
| 2115 | // video hardware | |
| 2400 | 2116 | MCFG_SCREEN_MODIFY("screen") |
| 2401 | 2117 | MCFG_SCREEN_VISIBLE_AREA(0x10, 0x190-1, 0x100, 0x1f0-1) |
| 2402 | 2118 | MACHINE_CONFIG_END |
| 2403 | 2119 | |
| 2404 | 2120 | |
| 2405 | static MACHINE_CONFIG_DERIVED( penbros, mj4simai ) | |
| 2406 | ||
| 2407 | /* basic machine hardware */ | |
| 2121 | static MACHINE_CONFIG_DERIVED( penbros, seta2 ) | |
| 2408 | 2122 | MCFG_CPU_MODIFY("maincpu") |
| 2409 | 2123 | MCFG_CPU_PROGRAM_MAP(penbros_map) |
| 2410 | 2124 | |
| 2411 | / | |
| 2125 | // video hardware | |
| 2412 | 2126 | MCFG_SCREEN_MODIFY("screen") |
| 2413 | 2127 | MCFG_SCREEN_VISIBLE_AREA(0, 0x140-1, 0x80, 0x160-1) |
| 2414 | 2128 | MACHINE_CONFIG_END |
| 2415 | 2129 | |
| 2416 | static MACHINE_CONFIG_DERIVED( samshoot, mj4simai ) | |
| 2417 | 2130 | |
| 2418 | ||
| 2131 | ||
| 2419 | 2132 | MCFG_CPU_MODIFY("maincpu") |
| 2133 | MCFG_CPU_PROGRAM_MAP(reelquak_map) | |
| 2134 | ||
| 2135 | MCFG_NVRAM_ADD_0FILL("nvram") | |
| 2136 | MCFG_TICKET_DISPENSER_ADD("ticket", 200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) | |
| 2137 | ||
| 2138 | // video hardware | |
| 2139 | MCFG_SCREEN_MODIFY("screen") | |
| 2140 | MCFG_SCREEN_VISIBLE_AREA(0x40, 0x180-1, 0x80, 0x170-1) | |
| 2141 | ||
| 2142 | MCFG_VIDEO_START(seta2_xoffset) | |
| 2143 | MACHINE_CONFIG_END | |
| 2144 | ||
| 2145 | ||
| 2146 | static MACHINE_CONFIG_DERIVED( samshoot, seta2 ) | |
| 2147 | MCFG_CPU_MODIFY("maincpu") | |
| 2420 | 2148 | MCFG_CPU_PROGRAM_MAP(samshoot_map) |
| 2421 | 2149 | MCFG_CPU_VBLANK_INT_HACK(samshoot_interrupt,2) |
| 2422 | 2150 | |
| 2423 | 2151 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 2424 | 2152 | |
| 2425 | / | |
| 2153 | // video hardware | |
| 2426 | 2154 | MCFG_SCREEN_MODIFY("screen") |
| 2427 | 2155 | MCFG_SCREEN_VISIBLE_AREA(0x40, 0x180-1, 0x40, 0x130-1) |
| 2428 | 2156 | MACHINE_CONFIG_END |
| r10613 | r10614 | |
| 2493 | 2221 | |
| 2494 | 2222 | MCFG_MACHINE_RESET( funcube ) |
| 2495 | 2223 | |
| 2496 | / | |
| 2224 | // video hardware | |
| 2497 | 2225 | MCFG_SCREEN_ADD("screen", RASTER) |
| 2498 | 2226 | MCFG_SCREEN_REFRESH_RATE(60) |
| 2499 | 2227 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // not accurate |
| r10613 | r10614 | |
| 2504 | 2232 | MCFG_SCREEN_EOF(seta2) |
| 2505 | 2233 | |
| 2506 | 2234 | MCFG_GFXDECODE(funcube) |
| 2507 | MCFG_PALETTE_LENGTH(0x8000+0xf0) / | |
| 2235 | MCFG_PALETTE_LENGTH(0x8000+0xf0) // extra 0xf0 because we might draw 256-color object with 16-color granularity | |
| 2508 | 2236 | |
| 2509 | 2237 | MCFG_VIDEO_START(seta2) |
| 2510 | 2238 | |
| 2511 | / | |
| 2239 | // sound hardware | |
| 2512 | 2240 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 2513 | 2241 | |
| 2514 | 2242 | MCFG_OKIM9810_ADD("oki", XTAL_4_096MHz) |
| 2515 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.80) | |
| 2516 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.80) | |
| 2243 | MCFG_SOUND_ROUTE(0, "lspeaker", 0.80) | |
| 2244 | MCFG_SOUND_ROUTE(1, "rspeaker", 0.80) | |
| 2517 | 2245 | MACHINE_CONFIG_END |
| 2518 | 2246 | |
| 2519 | 2247 | |
| r10613 | r10614 | |
| 2523 | 2251 | |
| 2524 | 2252 | ***************************************************************************/ |
| 2525 | 2253 | |
| 2526 | ROM_START( gundamex ) | |
| 2527 | ROM_REGION( 0x600000, "maincpu", 0 ) /* TMP68301 Code */ | |
| 2528 | ROM_LOAD16_BYTE( "ka002002.u2", 0x000000, 0x080000, CRC(e850f6d8) SHA1(026325e305676b1f8d3d9e7573920f8b70d7bccb) ) | |
| 2529 | ROM_LOAD16_BYTE( "ka002004.u3", 0x000001, 0x080000, CRC(c0fb1208) SHA1(84b25e4c73cb8e023ee5dbf69f588be98700b43f) ) | |
| 2530 | ROM_LOAD16_BYTE( "ka002001.u4", 0x100000, 0x080000, CRC(553ebe6b) SHA1(7fb8a159513d31a1d60520ff14e4c4d133fd3e19) ) | |
| 2531 | ROM_LOAD16_BYTE( "ka002003.u5", 0x100001, 0x080000, CRC(946185aa) SHA1(524911c4c510d6c3e17a7ab42c7077c2fffbf06b) ) | |
| 2532 | ROM_LOAD16_WORD_SWAP( "ka001005.u77", 0x500000, 0x080000, CRC(f01d3d00) SHA1(ff12834e99a76261d619f10d186f4b329fb9cb7a) ) | |
| 2254 | /*************************************************************************** | |
| 2533 | 2255 | |
| 2534 | ROM_REGION( 0x2000000, "gfx1", ROMREGION_ERASE) /* Sprites */ | |
| 2535 | ROM_LOAD( "ka001009.u16", 0x0000000, 0x200000, CRC(997d8d93) SHA1(4cb4cdb7e8208af4b14483610d9d6aa5e13acd89) ) | |
| 2536 | ROM_LOAD( "ka001010.u18", 0x0200000, 0x200000, CRC(811b67ca) SHA1(c8cfae6f54c76d63bd625ff011c872ffb75fd2e2) ) | |
| 2537 | ROM_LOAD( "ka001011.u20", 0x0400000, 0x200000, CRC(08a72700) SHA1(fb8003aa02dd249c30a757cb43b516260b41c1bf) ) | |
| 2538 | ROM_LOAD( "ka001012.u15", 0x0800000, 0x200000, CRC(b789e4a8) SHA1(400b773f24d677a9d47466fdbbe68cb6efc1ad37) ) | |
| 2539 | ROM_LOAD( "ka001013.u17", 0x0a00000, 0x200000, CRC(d8a0201f) SHA1(fe8a2407c872adde8aec8e9340b00be4f00a2872) ) | |
| 2540 | ROM_LOAD( "ka001014.u19", 0x0c00000, 0x200000, CRC(7635e026) SHA1(116a3daab14a17faca85c4a956b356aaf0fc2276) ) | |
| 2541 | ROM_LOAD( "ka001006.u21", 0x1000000, 0x200000, CRC(6aac2f2f) SHA1(fac5478ca2941a93c57f670a058ff626e537bcde) ) | |
| 2542 | ROM_LOAD( "ka001007.u22", 0x1200000, 0x200000, CRC(588f9d63) SHA1(ed5148d09d02e3bc12c50c39c5c86e6356b2dd7a) ) | |
| 2543 | ROM_LOAD( "ka001008.u23", 0x1400000, 0x200000, CRC(db55a60a) SHA1(03d118c7284ca86219891c473e2a89489710ea27) ) | |
| 2544 | ROM_FILL( 0x1800000, 0x600000, 0 ) /* 6bpp instead of 8bpp */ | |
| 2256 | FUNCUBE (BET) Series, includes 2 through 5? | |
| 2545 | 2257 | |
| 2546 | ROM_REGION( 0x300000, "x1snd", 0 ) /* Samples */ | |
| 2547 | /* Leave 1MB empty (addressable by the chip) */ | |
| 2548 | ROM_LOAD( "ka001015.u28", 0x100000, 0x200000, CRC(ada2843b) SHA1(09d06026031bc7558da511c3c0e29187ea0a0099) ) | |
| 2258 | PCB Number: B0-006B (also known as EVA3_A system and is non-JAMMA) | |
| 2259 | +------------------------------------------------+ | |
| 2260 | |+--+ S +---+ +---+ CN5 | | |
| 2261 | || | W | | | | CN6?| | |
| 2262 | || | 4 | U | | U | | | |
| 2263 | || | | 4 | | 4 | +---+ CN2?| | |
| 2264 | || | | 2 | | 3 | |DX | | | |
| 2265 | || | | | | | |102| | | |
| 2266 | ||C | | | | | +---+ | | |
| 2267 | ||N | +---+ +---+ | | |
| 2268 | ||4 | | | |
| 2269 | || | +----------+ M1 | | |
| 2270 | || | M3 | | C | | |
| 2271 | || | | NEC | M1 N | | |
| 2272 | || | M3 | DX-101 | 3 | | |
| 2273 | || | | | | | |
| 2274 | || | | | 50MHz | | |
| 2275 | |+--+ +----------+ | | |
| 2276 | | PIC 25.447MHz +-----------+ | | |
| 2277 | | CN7 | U47 | | | |
| 2278 | | +-----------+ | | |
| 2279 | | +-----------+ +---+ +---+ D | | |
| 2280 | | | U3 | |OKI| |DX | S | | |
| 2281 | | M2 +-----------+ | | |102| W | | |
| 2282 | | +---+ +---+ 1 | | |
| 2283 | | ispLSI2032 | | |
| 2284 | | M1 +---+ | | |
| 2285 | | +----------+ |IDT| +--+| | |
| 2286 | | | | C | | | || | |
| 2287 | | C | ColdFire | N +---+ | || | |
| 2288 | | N M2 | XCF5206E | 8 | || | |
| 2289 | | 1 | | +---+ |C || | |
| 2290 | | | | |H8 | |N || | |
| 2291 | | M1 +----------+ +---+ D |9 || | |
| 2292 | | 14.7456MHz S | || | |
| 2293 | | +-----------+W | || | |
| 2294 | | SW1 BAT1 | U49 |2 +--+| | |
| 2295 | | +-----------+ | | |
| 2296 | +------------------------------------------------+ | |
| 2549 | 2297 | |
| 2550 | ROM_REGION16_BE( 0x80, "eeprom", 0 ) | |
| 2551 | ROM_LOAD( "eeprom.bin", 0x0000, 0x0080, CRC(80f8e248) SHA1(1a9787811e56d95f7acbedfb00225b6e7df265eb) ) | |
| 2298 | CPU: ColdFire XCF5206EFT54 (160 Pin PQFP) | |
| 2299 | Hitachi H8/3007 (64130007F20) used for touch screen I/O | |
| 2300 | Video: NEC DX-101 (240 Pin PQFP) | |
| 2301 | NEC DX-102 (52 Pin PQFP x2) | |
| 2302 | Sound: OKI MSM9810B 8-Channel Mixing ADPCM Type Voice Synthesis LSI | |
| 2303 | OSC: 50MHz, 25.447MHz & 14.7456MHz | |
| 2304 | Other: Lattice ispLSI2032 - stamped "EVA3A" | |
| 2305 | BAT1 - CR2032 3Volt | |
| 2306 | ||
| 2307 | ColdFire XCF5206EFT54: | |
| 2308 | 68K/ColdFire V2 core family | |
| 2309 | 8K internal SRAM | |
| 2310 | 54MHz (max) Bus Frequency | |
| 2311 | 32bit External Bus Width | |
| 2312 | 2 UART Serial Interfaces | |
| 2313 | 2 Timer Channels | |
| 2314 | ||
| 2315 | PIC - PIC12C508 MCU used for security | |
| 2316 | Labeled FC21A for Funcube 2 | |
| 2317 | Labeled FC41A for Funcube 4 | |
| 2318 | ||
| 2319 | Ram M1 are Toshiba TC55257DFL-70L | |
| 2320 | Ram M2 are NEC D43001GU-70L | |
| 2321 | Ram M3 are ISSI IS62C1024L-70Q | |
| 2322 | IDT - IDT 7130 64-pin TQFP High-speed 1K x 8 Dual-Port Static RAM | |
| 2323 | ||
| 2324 | CN1 - Unused 64 pin double row connecter | |
| 2325 | CN2? 2x2 connecter | |
| 2326 | CN3 - Unused 50 pin double row connecter | |
| 2327 | CN4 - 96 pin triple row connecter | |
| 2328 | CN5 - 2x3 pin connecter | |
| 2329 | CN6? 3x3 connecter | |
| 2330 | CN7 - Unused 20 pin connecter | |
| 2331 | CN8 - 8 pin single row connecter | |
| 2332 | CN9 - 40 pin double row connecter | |
| 2333 | ||
| 2334 | DSW1 - 8 position dipswitch | |
| 2335 | DSW2 - 2 position dipswitch | |
| 2336 | SW1 - Pushbutton | |
| 2337 | SW4 - Single position slider switch | |
| 2338 | ||
| 2339 | U3 - Is a 27C4002 EPROM | |
| 2340 | U49 - Is a 27C1001 EPROM | |
| 2341 | U42, U43 & U47 are MASK ROMs read as 27C322 | |
| 2342 | ||
| 2343 | The same H8/3007 code "FC21 IOPR-0" at U49 is used for FUNCUBE 2,3,4 & 5 | |
| 2344 | ||
| 2345 | ***************************************************************************/ | |
| 2346 | ||
| 2347 | ROM_START( funcube2 ) | |
| 2348 | ROM_REGION( 0x80000, "maincpu", 0 ) // XCF5206 Code | |
| 2349 | ROM_LOAD( "fc21_prg-0b.u3", 0x00000, 0x80000, CRC(add1c8a6) SHA1(bf91518da659098a4bad4e756533525fcc910570) ) | |
| 2350 | ||
| 2351 | ROM_REGION( 0x20000, "sub", 0 ) // H8/3007 Code | |
| 2352 | ROM_LOAD( "fc21_iopr-0.u49", 0x00000, 0x20000, CRC(314555ef) SHA1(b17e3926c8ef7f599856c198c330d2051aae13ad) ) | |
| 2353 | ||
| 2354 | ROM_REGION( 0x300, "pic", 0 ) // PIC12C508? Code | |
| 2355 | ROM_LOAD( "fc21a", 0x000, 0x300, NO_DUMP ) | |
| 2356 | ||
| 2357 | ROM_REGION( 0x800000, "sprites", 0 ) | |
| 2358 | ROM_LOAD32_WORD( "fc21_obj-0.u43", 0x000000, 0x400000, CRC(08cfe6d9) SHA1(d10f362dcde01f7a9855d8f76af3084b5dd1573a) ) | |
| 2359 | ROM_LOAD32_WORD( "fc21_obj-1.u42", 0x000002, 0x400000, CRC(4c1fbc20) SHA1(ff83691c19ce3600b31c494eaec26d2ac79e0028) ) | |
| 2360 | ||
| 2361 | ROM_REGION( 0x1000000, "oki", 0 ) | |
| 2362 | ROM_LOAD( "fc21_voi0.u47", 0x000000, 0x400000, CRC(25b5fc3f) SHA1(18b16a14e9ee62f3fea382e9d3fdcd43bdb165f5) ) | |
| 2552 | 2363 | ROM_END |
| 2553 | 2364 | |
| 2365 | ROM_START( funcube4 ) | |
| 2366 | ROM_REGION( 0x80000, "maincpu", 0 ) // XCF5206 Code | |
| 2367 | ROM_LOAD( "fc41_prg-0.u3", 0x00000, 0x80000, CRC(ef870874) SHA1(dcb8dc3f780ca135df55e4b4f3c95620597ad28f) ) | |
| 2368 | ||
| 2369 | ROM_REGION( 0x20000, "sub", 0 ) // H8/3007 Code | |
| 2370 | ROM_LOAD( "fc21_iopr-0.u49", 0x00000, 0x20000, CRC(314555ef) SHA1(b17e3926c8ef7f599856c198c330d2051aae13ad) ) | |
| 2371 | ||
| 2372 | ROM_REGION( 0x300, "pic", 0 ) // PIC12C508? Code | |
| 2373 | ROM_LOAD( "fc41a", 0x000, 0x300, NO_DUMP ) | |
| 2374 | ||
| 2375 | ROM_REGION( 0x800000, "sprites", 0 ) | |
| 2376 | ROM_LOAD32_WORD( "fc41_obj-0.u43", 0x000000, 0x400000, CRC(9ff029d5) SHA1(e057f4929aa745ecaf9d4ff7e39974c82e440146) ) | |
| 2377 | ROM_LOAD32_WORD( "fc41_obj-1.u42", 0x000002, 0x400000, CRC(5ab7b087) SHA1(c600158b2358cdf947357170044dda2deacd4f37) ) | |
| 2378 | ||
| 2379 | ROM_REGION( 0x1000000, "oki", 0 ) | |
| 2380 | ROM_LOAD( "fc41_snd0.u47", 0x000000, 0x400000, CRC(48337257) SHA1(d1755024b824100070b489f48f6ae921765329e8) ) | |
| 2381 | ROM_END | |
| 2382 | ||
| 2383 | static DRIVER_INIT( funcube2 ) | |
| 2384 | { | |
| 2385 | UINT32 *main_cpu = (UINT32 *) machine->region("maincpu")->base(); | |
| 2386 | UINT16 *sub_cpu = (UINT16 *) machine->region("sub")->base(); | |
| 2387 | ||
| 2388 | main_cpu[0x810/4] = 0xe0214e71; | |
| 2389 | main_cpu[0x814/4] = 0x4e71203c; | |
| 2390 | ||
| 2391 | main_cpu[0x81c/4] = 0x4e714e71; | |
| 2392 | ||
| 2393 | main_cpu[0xa5c/4] = 0x4e713e3c; | |
| 2394 | main_cpu[0xa74/4] = 0x4e713e3c; | |
| 2395 | main_cpu[0xa8c/4] = 0x4e7141f9; | |
| 2396 | ||
| 2397 | // Sub CPU | |
| 2398 | sub_cpu[0x4d4/2] = 0x5470; // rte -> rts | |
| 2399 | ||
| 2400 | // Audio | |
| 2401 | // The first half of the rom appears to be a dupe of the second half with 0xffs destructively interleaved | |
| 2402 | UINT8* oki = (UINT8*) machine->region("oki")->base(); | |
| 2403 | for (int i = 0; i < 0x200000; i++) | |
| 2404 | { | |
| 2405 | oki[i] = oki[i+0x200000]; | |
| 2406 | } | |
| 2407 | } | |
| 2408 | ||
| 2409 | // Note: same as funcube2 | |
| 2410 | static DRIVER_INIT( funcube4 ) | |
| 2411 | { | |
| 2412 | UINT32 *main_cpu = (UINT32 *) machine->region("maincpu")->base(); | |
| 2413 | UINT16 *sub_cpu = (UINT16 *) machine->region("sub")->base(); | |
| 2414 | ||
| 2415 | main_cpu[0x810/4] = 0xe0214e71; | |
| 2416 | main_cpu[0x814/4] = 0x4e71203c; | |
| 2417 | ||
| 2418 | main_cpu[0x81c/4] = 0x4e714e71; | |
| 2419 | ||
| 2420 | main_cpu[0xa5c/4] = 0x4e713e3c; | |
| 2421 | main_cpu[0xa74/4] = 0x4e713e3c; | |
| 2422 | main_cpu[0xa8c/4] = 0x4e7141f9; | |
| 2423 | ||
| 2424 | // Sub CPU | |
| 2425 | sub_cpu[0x4d4/2] = 0x5470; // rte -> rts | |
| 2426 | ||
| 2427 | // Audio | |
| 2428 | // The first half of the rom appears to be a dupe of the second half with 0xffs destructively interleaved | |
| 2429 | UINT8* oki = (UINT8*) machine->region("oki")->base(); | |
| 2430 | for (int i = 0; i < 0x200000; i++) | |
| 2431 | { | |
| 2432 | oki[i] = oki[i+0x200000]; | |
| 2433 | } | |
| 2434 | } | |
| 2435 | ||
| 2436 | /*************************************************************************** | |
| 2437 | ||
| 2438 | Guardians | |
| 2439 | Banpresto, 1995 | |
| 2440 | ||
| 2441 | This hardware is not common Banpresto hardware. Possibly licensed | |
| 2442 | to them from another manufacturer? Or an early design that they decided | |
| 2443 | not to use for future games? Either way, this game is _extremely_ rare :-) | |
| 2444 | ||
| 2445 | PCB Layout | |
| 2446 | ---------- | |
| 2447 | ||
| 2448 | P-FG01-1 | |
| 2449 | ------------------------------------------------------ | |
| 2450 | | X1-010 6264 U32 CXK581000 | | |
| 2451 | | CXK581000 U16 | | |
| 2452 | | | | |
| 2453 | | U20 | | |
| 2454 | | U3 U5 U2 U4 62256 CXK58257 | | |
| 2455 | | 62256 CXK58257 U15 | | |
| 2456 | | | | |
| 2457 | |J U19 | | |
| 2458 | |A TMP68301AF-16 | | |
| 2459 | |M U18 | | |
| 2460 | |M NEC | | |
| 2461 | |A NEC DX-101 U22 | | |
| 2462 | | DX-102 | | |
| 2463 | | U17 | | |
| 2464 | | PAL 50MHz | | |
| 2465 | | U21 | | |
| 2466 | | DSW1(8) | | |
| 2467 | | DSW2(8) CXK58257 NEC | | |
| 2468 | | CXK58257 DX-102| | |
| 2469 | ------------------------------------------------------ | |
| 2470 | ||
| 2471 | Notes: | |
| 2472 | HSync: 15.23kHz | |
| 2473 | VSync: 58.5Hz | |
| 2474 | ||
| 2475 | ***************************************************************************/ | |
| 2476 | ||
| 2554 | 2477 | ROM_START( grdians ) |
| 2555 | ROM_REGION( 0x200000, "maincpu", 0 ) | |
| 2478 | ROM_REGION( 0x200000, "maincpu", 0 ) | |
| 2556 | 2479 | ROM_LOAD16_BYTE( "u2.bin", 0x000000, 0x080000, CRC(36adc6f2) SHA1(544e87f88179fe1342e7a06a8948ac1828e85108) ) |
| 2557 | 2480 | ROM_LOAD16_BYTE( "u3.bin", 0x000001, 0x080000, CRC(2704f416) SHA1(9081a12cbb9927d36e1c50b52aa2c6003810ee42) ) |
| 2558 | 2481 | ROM_LOAD16_BYTE( "u4.bin", 0x100000, 0x080000, CRC(bb52447b) SHA1(61433f683210ab2bc2cf1cc4b5b7a39cc5b6493d) ) |
| 2559 | 2482 | ROM_LOAD16_BYTE( "u5.bin", 0x100001, 0x080000, CRC(9c164a3b) SHA1(6d688c7af9e7e8e8d54b2e4dfbf41f59c79242eb) ) |
| 2560 | 2483 | |
| 2561 | ROM_REGION( 0x2000000, " | |
| 2484 | ROM_REGION( 0x2000000, "sprites", ROMREGION_ERASE) // Sprites | |
| 2562 | 2485 | ROM_LOAD( "u16.bin", 0x0000000, 0x400000, CRC(6a65f265) SHA1(6cad11f718f8bbcff464d41eb4717460769237ed) ) |
| 2563 | 2486 | ROM_LOAD( "u20.bin", 0x0600000, 0x200000, CRC(a7226ab7) SHA1(408580dd35c568ffef1ebbd87359e3ec1f867020) ) |
| 2564 | 2487 | ROM_CONTINUE( 0x0400000, 0x200000 ) |
| r10613 | r10614 | |
| 2575 | 2498 | ROM_LOAD( "u21.bin", 0x1e00000, 0x200000, CRC(6f95e466) SHA1(28482fad16a3ac9302f152d81552e6f84a44f3e4) ) |
| 2576 | 2499 | ROM_CONTINUE( 0x1c00000, 0x200000 ) |
| 2577 | 2500 | |
| 2578 | ROM_REGION( 0x200000, "x1snd", 0 ) /* Samples */ | |
| 2579 | /* Leave 1MB empty (addressable by the chip) */ | |
| 2501 | ROM_REGION( 0x200000, "x1snd", 0 ) // Samples | |
| 2502 | // Leave 1MB empty (addressable by the chip) | |
| 2580 | 2503 | ROM_LOAD( "u32.bin", 0x100000, 0x100000, CRC(cf0f3017) SHA1(8376d3a674f71aec72f52c72758fbc53d9feb1a1) ) |
| 2581 | 2504 | ROM_END |
| 2582 | 2505 | |
| 2506 | /*************************************************************************** | |
| 2507 | ||
| 2508 | MS Gundam Ex Revue | |
| 2509 | Banpresto, 1994 | |
| 2510 | ||
| 2511 | This game runs on Seta/Allumer hardware | |
| 2512 | ||
| 2513 | PCB Layout | |
| 2514 | ---------- | |
| 2515 | ||
| 2516 | PO-113A BP949KA | |
| 2517 | |----------------------------------| | |
| 2518 | | X1-010 6264 U28 | | |
| 2519 | | 581001 U19 | | |
| 2520 | | U3 U5 U2 U4 581001 U17 | | |
| 2521 | | 62256 62256 U15 | | |
| 2522 | |J U20 | | |
| 2523 | |A U77 68301 U18 | | |
| 2524 | |M * U16 | | |
| 2525 | |M 93C46 U23 | | |
| 2526 | |A U22 | | |
| 2527 | | U21 | | |
| 2528 | | DSW1 50MHz | | |
| 2529 | | DSW2 PAL 32.5304MHz | | |
| 2530 | | 20MHz PAL | | |
| 2531 | |----------------------------------| | |
| 2532 | ||
| 2533 | Notes: | |
| 2534 | *: unknown QFP208 (has large heatsink on it). Should be similar to other known | |
| 2535 | graphics chips used on Seta hardware of this era. | |
| 2536 | 68301 clock: 16.000MHz (?? From what OSC + divider??) | |
| 2537 | VSync: 60Hz | |
| 2538 | ||
| 2539 | ***************************************************************************/ | |
| 2540 | ||
| 2541 | ROM_START( gundamex ) | |
| 2542 | ROM_REGION( 0x600000, "maincpu", 0 ) // TMP68301 Code | |
| 2543 | ROM_LOAD16_BYTE( "ka002002.u2", 0x000000, 0x080000, CRC(e850f6d8) SHA1(026325e305676b1f8d3d9e7573920f8b70d7bccb) ) | |
| 2544 | ROM_LOAD16_BYTE( "ka002004.u3", 0x000001, 0x080000, CRC(c0fb1208) SHA1(84b25e4c73cb8e023ee5dbf69f588be98700b43f) ) | |
| 2545 | ROM_LOAD16_BYTE( "ka002001.u4", 0x100000, 0x080000, CRC(553ebe6b) SHA1(7fb8a159513d31a1d60520ff14e4c4d133fd3e19) ) | |
| 2546 | ROM_LOAD16_BYTE( "ka002003.u5", 0x100001, 0x080000, CRC(946185aa) SHA1(524911c4c510d6c3e17a7ab42c7077c2fffbf06b) ) | |
| 2547 | ROM_LOAD16_WORD_SWAP( "ka001005.u77", 0x500000, 0x080000, CRC(f01d3d00) SHA1(ff12834e99a76261d619f10d186f4b329fb9cb7a) ) | |
| 2548 | ||
| 2549 | ROM_REGION( 0x2000000, "sprites", ROMREGION_ERASE) // Sprites | |
| 2550 | ROM_LOAD( "ka001009.u16", 0x0000000, 0x200000, CRC(997d8d93) SHA1(4cb4cdb7e8208af4b14483610d9d6aa5e13acd89) ) | |
| 2551 | ROM_LOAD( "ka001010.u18", 0x0200000, 0x200000, CRC(811b67ca) SHA1(c8cfae6f54c76d63bd625ff011c872ffb75fd2e2) ) | |
| 2552 | ROM_LOAD( "ka001011.u20", 0x0400000, 0x200000, CRC(08a72700) SHA1(fb8003aa02dd249c30a757cb43b516260b41c1bf) ) | |
| 2553 | ROM_LOAD( "ka001012.u15", 0x0800000, 0x200000, CRC(b789e4a8) SHA1(400b773f24d677a9d47466fdbbe68cb6efc1ad37) ) | |
| 2554 | ROM_LOAD( "ka001013.u17", 0x0a00000, 0x200000, CRC(d8a0201f) SHA1(fe8a2407c872adde8aec8e9340b00be4f00a2872) ) | |
| 2555 | ROM_LOAD( "ka001014.u19", 0x0c00000, 0x200000, CRC(7635e026) SHA1(116a3daab14a17faca85c4a956b356aaf0fc2276) ) | |
| 2556 | ROM_LOAD( "ka001006.u21", 0x1000000, 0x200000, CRC(6aac2f2f) SHA1(fac5478ca2941a93c57f670a058ff626e537bcde) ) | |
| 2557 | ROM_LOAD( "ka001007.u22", 0x1200000, 0x200000, CRC(588f9d63) SHA1(ed5148d09d02e3bc12c50c39c5c86e6356b2dd7a) ) | |
| 2558 | ROM_LOAD( "ka001008.u23", 0x1400000, 0x200000, CRC(db55a60a) SHA1(03d118c7284ca86219891c473e2a89489710ea27) ) | |
| 2559 | ROM_FILL( 0x1800000, 0x600000, 0 ) // 6bpp instead of 8bpp | |
| 2560 | ||
| 2561 | ROM_REGION( 0x300000, "x1snd", 0 ) // Samples | |
| 2562 | // Leave 1MB empty (addressable by the chip) | |
| 2563 | ROM_LOAD( "ka001015.u28", 0x100000, 0x200000, CRC(ada2843b) SHA1(09d06026031bc7558da511c3c0e29187ea0a0099) ) | |
| 2564 | ||
| 2565 | ROM_REGION16_BE( 0x80, "eeprom", 0 ) | |
| 2566 | ROM_LOAD( "eeprom.bin", 0x0000, 0x0080, CRC(80f8e248) SHA1(1a9787811e56d95f7acbedfb00225b6e7df265eb) ) | |
| 2567 | ROM_END | |
| 2568 | ||
| 2569 | /*************************************************************************** | |
| 2570 | ||
| 2571 | Wakakusamonogatari Mahjong Yonshimai (JPN Ver.) | |
| 2572 | (c)1996 Maboroshi Ware | |
| 2573 | ||
| 2574 | Board: P0-123A | |
| 2575 | ||
| 2576 | CPU: TMP68301 (68000 core) | |
| 2577 | OSC: 50.0000MHz | |
| 2578 | 32.5304MHz | |
| 2579 | ||
| 2580 | Sound: X1-010 | |
| 2581 | ||
| 2582 | ***************************************************************************/ | |
| 2583 | ||
| 2583 | 2584 | ROM_START( mj4simai ) |
| 2584 | ROM_REGION( 0x200000, "maincpu", 0 ) | |
| 2585 | ROM_REGION( 0x200000, "maincpu", 0 ) | |
| 2585 | 2586 | ROM_LOAD16_BYTE( "ll.u2", 0x000000, 0x080000, CRC(7be9c781) SHA1(d29e579706d98909933f6bed2ee292c88ed10d2c) ) |
| 2586 | 2587 | ROM_LOAD16_BYTE( "lh1.u3", 0x000001, 0x080000, CRC(82aa3f72) SHA1(a93d5dc7cdf12f852a692759d91f6f2951b6b5b5) ) |
| 2587 | 2588 | ROM_LOAD16_BYTE( "hl.u4", 0x100000, 0x080000, CRC(226063b7) SHA1(1737baffc16ff7261f887911187ece96925fa6ff) ) |
| 2588 | 2589 | ROM_LOAD16_BYTE( "hh.u5", 0x100001, 0x080000, CRC(23aaf8df) SHA1(b3d678afce4ddef32e48d690c6d07b723dd0c28f) ) |
| 2589 | 2590 | |
| 2590 | ROM_REGION( 0x2000000, " | |
| 2591 | ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites | |
| 2591 | 2592 | ROM_LOAD( "cha-03.u16", 0x0000000, 0x400000, CRC(d367429a) SHA1(b32c215ef85c3d0a4c5550cef4f5c4c0e7030b7c) ) |
| 2592 | 2593 | ROM_LOAD( "cha-04.u18", 0x0400000, 0x400000, CRC(7f2008c3) SHA1(e45d863540eb2381f5d7660d64cdfef87c890768) ) |
| 2593 | 2594 | ROM_LOAD( "cha-05.u15", 0x0800000, 0x400000, CRC(e94ec40a) SHA1(2685dbc5680b5f76688c6b4fbe40ae682c525bfe) ) |
| 2594 | 2595 | ROM_LOAD( "cha-06.u17", 0x0c00000, 0x400000, CRC(5cb0b3a9) SHA1(92fb82d45b4c46326d5796981f812e20a8ddb4f2) ) |
| 2595 | 2596 | ROM_LOAD( "cha-01.u21", 0x1000000, 0x400000, CRC(35f47b37) SHA1(4a8eb088890272f2a069e2c3f00fadf6421f7b0e) ) |
| 2596 | 2597 | ROM_LOAD( "cha-02.u22", 0x1400000, 0x400000, CRC(f6346860) SHA1(4eebd3fa315b97964fa39b88224f9de7622ba881) ) |
| 2597 | ROM_FILL( 0x1800000, 0x800000, 0 ) / | |
| 2598 | ROM_FILL( 0x1800000, 0x800000, 0 ) // 6bpp instead of 8bpp | |
| 2598 | 2599 | |
| 2599 | ROM_REGION( 0x500000, "x1snd", 0 ) /* Samples */ | |
| 2600 | /* Leave 1MB empty (addressable by the chip) */ | |
| 2600 | ROM_REGION( 0x500000, "x1snd", 0 ) // Samples | |
| 2601 | // Leave 1MB empty (addressable by the chip) | |
| 2601 | 2602 | ROM_LOAD( "cha-07.u32", 0x100000, 0x400000, CRC(817519ee) SHA1(ed09740cdbf61a328f7b50eb569cf498fb749416) ) |
| 2602 | 2603 | ROM_END |
| 2603 | 2604 | |
| 2605 | /*************************************************************************** | |
| 2606 | ||
| 2607 | Kosodate Quiz My Angel (JPN Ver.) | |
| 2608 | (c)1996 Namco | |
| 2609 | ||
| 2610 | Board: KE (Namco) ; P0-125A (Seta) | |
| 2611 | ||
| 2612 | CPU: TMP68301 (68000 core) | |
| 2613 | OSC: 50.0000MHz | |
| 2614 | 32.5304MHz | |
| 2615 | ||
| 2616 | Sound: X1-010 | |
| 2617 | ||
| 2618 | ***************************************************************************/ | |
| 2619 | ||
| 2604 | 2620 | ROM_START( myangel ) |
| 2605 | ROM_REGION( 0x200000, "maincpu", 0 ) / | |
| 2621 | ROM_REGION( 0x200000, "maincpu", 0 ) // TMP68301 Code | |
| 2606 | 2622 | ROM_LOAD16_BYTE( "kq1-prge.u2", 0x000000, 0x080000, CRC(6137d4c0) SHA1(762341e11b56e4a7787a0662833b702b78aee0a9) ) |
| 2607 | 2623 | ROM_LOAD16_BYTE( "kq1-prgo.u3", 0x000001, 0x080000, CRC(4aad10d8) SHA1(a08e1c4f57c64be829e0807ae2791da947fd60aa) ) |
| 2608 | 2624 | ROM_LOAD16_BYTE( "kq1-tble.u4", 0x100000, 0x080000, CRC(e332a514) SHA1(dfd255239c80c48c9865e70681b9ddd175b8bf55) ) |
| 2609 | 2625 | ROM_LOAD16_BYTE( "kq1-tblo.u5", 0x100001, 0x080000, CRC(760cab15) SHA1(fa7ea85ec2ebfaab3111b8631ea6ea3d794d449c) ) |
| 2610 | 2626 | |
| 2611 | ROM_REGION( 0x1000000, " | |
| 2627 | ROM_REGION( 0x1000000, "sprites", 0 ) // Sprites | |
| 2612 | 2628 | ROM_LOAD( "kq1-cg2.u20", 0x000000, 0x200000, CRC(80b4e8de) SHA1(c8685c4f4e3c0415ce0ec88e0288835e504cab00) ) |
| 2613 | 2629 | ROM_LOAD( "kq1-cg0.u16", 0x200000, 0x200000, CRC(f8ae9a05) SHA1(4f3b41386a48a1608aa96b911e6b74ca775260fb) ) |
| 2614 | 2630 | ROM_LOAD( "kq1-cg3.u19", 0x400000, 0x200000, CRC(9bdc35c9) SHA1(fd0a1eb3dd10705bce5462263667353632558b58) ) |
| r10613 | r10614 | |
| 2618 | 2634 | ROM_LOAD( "kq1-cg7.u21", 0xc00000, 0x200000, CRC(9f48382c) SHA1(80dfc33a55123b5d3cdb3ed97b43a527f0254d61) ) |
| 2619 | 2635 | ROM_LOAD( "kq1-cg5.u17", 0xe00000, 0x200000, CRC(a4bc4516) SHA1(0eb11fa54d16bba1b96f9dd943a68949a3bb9a2f) ) |
| 2620 | 2636 | |
| 2621 | ROM_REGION( 0x300000, "x1snd", 0 ) /* Samples */ | |
| 2622 | /* Leave 1MB empty (addressable by the chip) */ | |
| 2637 | ROM_REGION( 0x300000, "x1snd", 0 ) // Samples | |
| 2638 | // Leave 1MB empty (addressable by the chip) | |
| 2623 | 2639 | ROM_LOAD( "kq1-snd.u32", 0x100000, 0x200000, CRC(8ca1b449) SHA1(f54096fb5400843af4879135c96760485b6cb319) ) |
| 2624 | 2640 | ROM_END |
| 2625 | 2641 | |
| 2642 | /*************************************************************************** | |
| 2643 | ||
| 2644 | Kosodate Quiz My Angel 2 (JPN Ver.) | |
| 2645 | (c)1997 Namco | |
| 2646 | ||
| 2647 | Board: KL (Namco) ; P0-136A (Seta) | |
| 2648 | ||
| 2649 | CPU: TMP68301 (68000 core) | |
| 2650 | OSC: 50.0000MHz | |
| 2651 | 32.5304MHz | |
| 2652 | ||
| 2653 | Sound: X1-010 | |
| 2654 | ||
| 2655 | ***************************************************************************/ | |
| 2656 | ||
| 2626 | 2657 | ROM_START( myangel2 ) |
| 2627 | ROM_REGION( 0x200000, "maincpu", 0 ) | |
| 2658 | ROM_REGION( 0x200000, "maincpu", 0 ) | |
| 2628 | 2659 | ROM_LOAD16_BYTE( "kqs1ezpr.u2", 0x000000, 0x080000, CRC(2469aac2) SHA1(7dade2de31252e305d24c659c4801dd4687ad1f6) ) |
| 2629 | 2660 | ROM_LOAD16_BYTE( "kqs1ozpr.u3", 0x000001, 0x080000, CRC(6336375c) SHA1(72089f77e94832e74e0512944acadeccd0dec8b0) ) |
| 2630 | 2661 | ROM_LOAD16_BYTE( "kqs1e-tb.u4", 0x100000, 0x080000, CRC(e759b4cc) SHA1(4f806a144a47935b2710f8af800ec0d771f12a18) ) |
| 2631 | 2662 | ROM_LOAD16_BYTE( "kqs1o-tb.u5", 0x100001, 0x080000, CRC(b6168737) SHA1(4c3de877c0c1dca1c43ac737a0bf231335237d3a) ) |
| 2632 | 2663 | |
| 2633 | ROM_REGION( 0x1800000, " | |
| 2664 | ROM_REGION( 0x1800000, "sprites", 0 ) // Sprites | |
| 2634 | 2665 | ROM_LOAD( "kqs1-cg4.u20", 0x0000000, 0x200000, CRC(d1802241) SHA1(52c45a13d46f7ee8043e85b99d07b1765ca93dcc) ) |
| 2635 | 2666 | ROM_LOAD( "kqs1-cg0.u16", 0x0200000, 0x400000, CRC(c21a33a7) SHA1(bc6f479a8f4c716ba79a725f160ddeb95fdedbcb) ) |
| 2636 | 2667 | ROM_LOAD( "kqs1-cg5.u19", 0x0600000, 0x200000, CRC(d86cf19c) SHA1(da5a5b576ce107433605b24d8b9dcd0abd46bcde) ) |
| r10613 | r10614 | |
| 2640 | 2671 | ROM_LOAD( "kqs1-cg7.u21", 0x1200000, 0x200000, CRC(2c977904) SHA1(2589447f2471cdc414266b34aff552044c680d93) ) |
| 2641 | 2672 | ROM_LOAD( "kqs1-cg3.u17", 0x1400000, 0x400000, CRC(de3b2191) SHA1(d7d6ea07b665cfd834747d3c0776b968ce03bc6a) ) |
| 2642 | 2673 | |
| 2643 | ROM_REGION( 0x500000, "x1snd", 0 ) /* Samples */ | |
| 2644 | /* Leave 1MB empty (addressable by the chip) */ | |
| 2674 | ROM_REGION( 0x500000, "x1snd", 0 ) // Samples | |
| 2675 | // Leave 1MB empty (addressable by the chip) | |
| 2645 | 2676 | ROM_LOAD( "kqs1-snd.u32", 0x100000, 0x400000, CRC(792a6b49) SHA1(341b4e8f248b5032217733bada32e353c67e3888) ) |
| 2646 | 2677 | ROM_END |
| 2647 | 2678 | |
| 2679 | /*************************************************************************** | |
| 2680 | ||
| 2681 | Puzzle De Bowling (Japan) | |
| 2682 | ||
| 2683 | (c)1999 Nihon System / Moss | |
| 2684 | ||
| 2685 | CPU: Toshiba TMP68301AF-16 (100 Pin PQFP) | |
| 2686 | Video: NEC DX-101 (240 Pin PQFP) | |
| 2687 | NEC DX-102 (52 Pin PQFP x3) | |
| 2688 | Sound: X1-010 (Mitsubishi M60016 Gate Array, 80 Pin PQFP) | |
| 2689 | OSC: 50MHz & 32.53047MHz | |
| 2690 | Other: 8 Position Dipswitch x 2 | |
| 2691 | Lattice ispLSI2032 - stamped "KUDEC" | |
| 2692 | ||
| 2693 | PCB Number: P0-142A | |
| 2694 | +-----------------------------------------------------------+ | |
| 2695 | | VOL +------+ | | |
| 2696 | | |Seta | M1 | | |
| 2697 | | +---+ +---+ |X1-010| | | |
| 2698 | | | | | | U4* M | | +---+ | | |
| 2699 | +-+ | U | | U | 1 +------+ | K | | | |
| 2700 | | | 0 | | 0 | U30* | U | | | |
| 2701 | +-+ | 7 | | 6 | U5* M | S | | | |
| 2702 | | | | | | 1 | | | | |
| 2703 | | +---+ +---+ | U | | | |
| 2704 | | Lattice | 1 | | | |
| 2705 | |J D D +---+ ispLSI2032 | 8 | | | |
| 2706 | |A S S |DX | +-------+ +---+ | | |
| 2707 | |M W W |102| |Toshiba| CN2 | | |
| 2708 | |M 1 2 +---+ BAT1* | TMP | | | |
| 2709 | |A | 68301 | U50* | | |
| 2710 | | +-------+ | | |
| 2711 | |C | | |
| 2712 | |o 50MHz +----------+ XM2* | | |
| 2713 | |n +---+ | | | | |
| 2714 | |n |DX | SW1 | NEC | M M | | |
| 2715 | |e |102| | DX-101 | 2 2 | | |
| 2716 | |c +---+ M M | | | | |
| 2717 | |t 1 1 | | | | |
| 2718 | |e +----------+ | | |
| 2719 | |r | | |
| 2720 | | +---+ +---++---++---+ | | |
| 2721 | | | K | | K || K || K | | | |
| 2722 | | +---+ | U | | U || U || U | | | |
| 2723 | +-+ |DX | | C | | C || C || C | | | |
| 2724 | | |102| 32.53047MHz | | | || || | | | |
| 2725 | +-+ +---+ | U | | U || U || U | | | |
| 2726 | | | 4 | | 4 || 3 || 3 | | | |
| 2727 | | | 0 | | 1 || 8 || 9 | | | |
| 2728 | | +---+ +---++---++---+ | | |
| 2729 | +-----------------------------------------------------------+ | |
| 2730 | ||
| 2731 | * Unpopulated: | |
| 2732 | U4 & U5 RAM HM62256 equivalent | |
| 2733 | U50 93LC46BX EEPROM | |
| 2734 | U30 74HC00 | |
| 2735 | BAT1 CR2032 3Volt battery | |
| 2736 | XM2 OSC | |
| 2737 | ||
| 2738 | Ram M1 are NEC D43001GU-70LL | |
| 2739 | Ram M2 are LGS GM76C8128ALLFW70 | |
| 2740 | ||
| 2741 | KUP-U06-I03 U06 Program rom ST27C4001 (even) | |
| 2742 | KUP-U07-I03 U07 Program rom ST27C4001 (odd) | |
| 2743 | ||
| 2744 | KUS-U18-I00 U18 Mask rom (Samples 23C32000 32Mbit) | |
| 2745 | ||
| 2746 | KUC-U38-I00 U38 Mask rom (Graphics 23C32000 32Mbit) | |
| 2747 | KUC-U39-I00 U39 Mask rom (Graphics 23C32000 32Mbit) | |
| 2748 | KUC-U40-I00 U40 Mask rom (Graphics 23C32000 32Mbit) | |
| 2749 | KUC-U41-I00 U41 Mask rom (Graphics 23C32000 32Mbit) | |
| 2750 | ||
| 2751 | ***************************************************************************/ | |
| 2752 | ||
| 2648 | 2753 | ROM_START( pzlbowl ) |
| 2649 | ROM_REGION( 0x100000, "maincpu", 0 ) | |
| 2754 | ROM_REGION( 0x100000, "maincpu", 0 ) | |
| 2650 | 2755 | ROM_LOAD16_BYTE( "kup-u06.i03", 0x000000, 0x080000, CRC(314e03ac) SHA1(999398e55161dd75570d418f4c9899e3bf311cc8) ) |
| 2651 | 2756 | ROM_LOAD16_BYTE( "kup-u07.i03", 0x000001, 0x080000, CRC(a0423a04) SHA1(9539023c5c2f2bf72ee3fb6105443ffd3d61e2f8) ) |
| 2652 | 2757 | |
| 2653 | ROM_REGION( 0x1000000, " | |
| 2758 | ROM_REGION( 0x1000000, "sprites", 0 ) // Sprites | |
| 2654 | 2759 | ROM_LOAD( "kuc-u38.i00", 0x000000, 0x400000, CRC(3db24172) SHA1(89c39963e15c53b799994185d0c8b2e795478939) ) |
| 2655 | 2760 | ROM_LOAD( "kuc-u39.i00", 0x400000, 0x400000, CRC(9b26619b) SHA1(ea7a0bf46641d15353217b01e761d1a148bee4e7) ) |
| 2656 | 2761 | ROM_LOAD( "kuc-u40.i00", 0x800000, 0x400000, CRC(7e49a2cf) SHA1(d24683addbc54515c33fb620ac500e6702bd9e17) ) |
| 2657 | 2762 | ROM_LOAD( "kuc-u41.i00", 0xc00000, 0x400000, CRC(2febf19b) SHA1(8081ac590c0463529777b5e4817305a1a6f6ea41) ) |
| 2658 | 2763 | |
| 2659 | ROM_REGION( 0x500000, "x1snd", 0 ) /* Samples */ | |
| 2660 | /* Leave 1MB empty (addressable by the chip) */ | |
| 2764 | ROM_REGION( 0x500000, "x1snd", 0 ) // Samples | |
| 2765 | // Leave 1MB empty (addressable by the chip) | |
| 2661 | 2766 | ROM_LOAD( "kus-u18.i00", 0x100000, 0x400000, CRC(e2b1dfcf) SHA1(fb0b8be119531a1a27efa46ed7b86b05a37ed585) ) |
| 2662 | 2767 | ROM_END |
| 2663 | 2768 | |
| 2769 | /*************************************************************************** | |
| 2770 | ||
| 2771 | Penguin Brothers (Japan) | |
| 2772 | (c)2000 Subsino | |
| 2773 | ||
| 2774 | CPU: Toshiba TMP68301AF-16 (100 Pin PQFP) | |
| 2775 | Video: NEC DX-101 (240 Pin PQFP) | |
| 2776 | NEC DX-102 (52 Pin PQFP x3) | |
| 2777 | Sound: X1-010 (Mitsubishi M60016 Gate Array, 80 Pin PQFP) | |
| 2778 | OSC: 50MHz, 32.53047MHz & 28MHz | |
| 2779 | Other: 8 Position Dipswitch x 2 | |
| 2780 | Lattice ispLSI2032 | |
| 2781 | ||
| 2782 | PCB Number: P0-142A | |
| 2783 | +-----------------------------------------------------------+ | |
| 2784 | | VOL +------+ | | |
| 2785 | | |Seta | M1 | | |
| 2786 | | +---+ +---+ |X1-010| | | |
| 2787 | | | | | | M M | | +---+ | | |
| 2788 | +-+ | U | | U | 1 1 +------+ | | | | |
| 2789 | | | 0 | | 0 | 74HC00 | | | | |
| 2790 | +-+ | 7 | | 6 | M M | U | | | |
| 2791 | | | | | | 1 1 | 1 | | | |
| 2792 | | +---+ +---+ | 8 | | | |
| 2793 | | Lattice | | | | |
| 2794 | |J D D +---+ ispLSI2032 | | | | |
| 2795 | |A S S |DX | +-------+ +---+ | | |
| 2796 | |M W W |102| |Toshiba| CN2 | | |
| 2797 | |M 1 2 +---+ BAT1* | TMP | | | |
| 2798 | |A | 68301 | U50* | | |
| 2799 | | +-------+ | | |
| 2800 | |C | | |
| 2801 | |o 50MHz +----------+ 28MHz | | |
| 2802 | |n +---+ | | | | |
| 2803 | |n |DX | SW1 | NEC | M M | | |
| 2804 | |e |102| | DX-101 | 2 2 | | |
| 2805 | |c +---+ M M | | | | |
| 2806 | |t 1 1 | | | | |
| 2807 | |e +----------+ | | |
| 2808 | |r | | |
| 2809 | | +---+ +---++---++---+ | | |
| 2810 | | | | | || || | | | |
| 2811 | | +---+ | | | || || | | | |
| 2812 | +-+ |DX | | U | | U || U || U | | | |
| 2813 | | |102| 32.53047MHz | 4 | | 4 || 3 || 3 | | | |
| 2814 | +-+ +---+ | 0 | | 1 || 8 || 9 | | | |
| 2815 | | | | | || || | | | |
| 2816 | | | | | || || | | | |
| 2817 | | +---+ +---++---++---+ | | |
| 2818 | +-----------------------------------------------------------+ | |
| 2819 | ||
| 2820 | Notes: pzlbowl PCB with these extra parts: | |
| 2821 | 28MHz OSC | |
| 2822 | 2x 62256 SRAM | |
| 2823 | 74HC00 | |
| 2824 | ||
| 2825 | U50* Unpopulated 93LC46BX EEPROM | |
| 2826 | BAT1* Unpopulated CR2032 3Volt battery | |
| 2827 | ||
| 2828 | Ram M1 are NEC D43001GU-70LL | |
| 2829 | Ram M2 are LGS GM76C8128ALLFW70 | |
| 2830 | ||
| 2831 | ***************************************************************************/ | |
| 2832 | ||
| 2664 | 2833 | ROM_START( penbros ) |
| 2665 | ROM_REGION( 0x100000, "maincpu", 0 ) | |
| 2834 | ROM_REGION( 0x100000, "maincpu", 0 ) | |
| 2666 | 2835 | ROM_LOAD16_BYTE( "u06.bin", 0x000000, 0x080000, CRC(7bbdffac) SHA1(d5766cb171b8d2e4c04a6bae37181fa5ada9d797) ) |
| 2667 | 2836 | ROM_LOAD16_BYTE( "u07.bin", 0x000001, 0x080000, CRC(d50cda5f) SHA1(fc66f55f2070b447c5db85c948ce40adc37512f7) ) |
| 2668 | 2837 | |
| 2669 | ROM_REGION( 0x1000000, " | |
| 2838 | ROM_REGION( 0x1000000, "sprites", 0 ) // Sprites | |
| 2670 | 2839 | ROM_LOAD( "u38.bin", 0x000000, 0x400000, CRC(4247b39e) SHA1(f273931293beced312e02c870bf35e9cf0c91a8b) ) |
| 2671 | 2840 | ROM_LOAD( "u39.bin", 0x400000, 0x400000, CRC(f9f07faf) SHA1(66fc4a9ad422fb384d2c775e43619137226898fc) ) |
| 2672 | 2841 | ROM_LOAD( "u40.bin", 0x800000, 0x400000, CRC(dc9e0a96) SHA1(c2c8ccf9039ee0e179b08fdd2d37f29899349cda) ) |
| 2673 | ROM_FILL( 0xc00000, 0x400000, 0 ) / | |
| 2842 | ROM_FILL( 0xc00000, 0x400000, 0 ) // 6bpp instead of 8bpp | |
| 2674 | 2843 | |
| 2675 | ROM_REGION( 0x300000, "x1snd", 0 ) /* Samples */ | |
| 2676 | /* Leave 1MB empty (addressable by the chip) */ | |
| 2844 | ROM_REGION( 0x300000, "x1snd", 0 ) // Samples | |
| 2845 | // Leave 1MB empty (addressable by the chip) | |
| 2677 | 2846 | ROM_LOAD( "u18.bin", 0x100000, 0x200000, CRC(de4e65e2) SHA1(82d4e590c714b3e9bf0ffaf1500deb24fd315595) ) |
| 2678 | 2847 | ROM_END |
| 2679 | 2848 | |
| 2849 | /*************************************************************************** | |
| 2850 | ||
| 2851 | Reel'N Quake! | |
| 2852 | ||
| 2853 | Board: | |
| 2854 | 0594 (Sticker) | |
| 2855 | ||
| 2856 | CPU: | |
| 2857 | TMP68301AF-16 CPU | |
| 2858 | 50MHz Osc. | |
| 2859 | ||
| 2860 | Video: | |
| 2861 | NEC DX-101? 9546KK002 (@ U10) | |
| 2862 | 3 x NEC DX-102? (@ U28, U30 & U45) | |
| 2863 | 28MHz Osc. | |
| 2864 | ||
| 2865 | Sound: | |
| 2866 | Seta X1-010 (@ U32) | |
| 2867 | Volume Trimmer | |
| 2868 | ||
| 2869 | Other: | |
| 2870 | Push Button (@ SW1) | |
| 2871 | 2 x DSW8 (@ DSW1 & DSW2) | |
| 2872 | 3.6V Battery (@ BT1) | |
| 2873 | MAX232CPE (@ U60) | |
| 2874 | ||
| 2875 | ROMs: | |
| 2876 | 2 x 27C4001 (@ U2-3) | |
| 2877 | 5 x 23C32000 (@ U15-18, U32) | |
| 2878 | GAL 16V8? (@ U38) | |
| 2879 | ||
| 2880 | Note: | |
| 2881 | ||
| 2882 | The PCB is silkscreened with 23C32000 which would be equal to the 27C322. | |
| 2883 | The graphics roms dumped that way have the first half as a bad mirror | |
| 2884 | of the second half (even <- odd, odd <- FF). They seem OK dumped as 27C160. | |
| 2885 | ||
| 2886 | ***************************************************************************/ | |
| 2887 | ||
| 2888 | ROM_START( reelquak ) | |
| 2889 | ROM_REGION( 0x100000, "maincpu", 0 ) // TMP68301 Code | |
| 2890 | ROM_LOAD16_BYTE( "rq_ver1.05.u2", 0x00000, 0x80000, CRC(7740d7a4) SHA1(21c28db5d4d7eea5a2506cb51b58533eba28c2cb) ) | |
| 2891 | ROM_LOAD16_BYTE( "rq_ver1.05.u3", 0x00001, 0x80000, CRC(8c78889e) SHA1(584ba123e9caafdbddc96a4d9b2b6f6994fa84b0) ) | |
| 2892 | ||
| 2893 | ROM_REGION( 0x800000, "sprites", 0 ) // Sprites | |
| 2894 | ROM_LOAD( "kf-001-005_t42.u16", 0x000000, 0x200000, CRC(25e07d5c) SHA1(dd0818611f39be25dc6f0c737da4e79c6c0f9659) ) | |
| 2895 | ROM_LOAD( "kf-001-006_t43.u15", 0x200000, 0x200000, CRC(67e2ecc4) SHA1(35cdaf7fcd29e0229da104baced41fa7620dba3d) ) | |
| 2896 | ROM_LOAD( "kf-001-007_t44.u18", 0x400000, 0x200000, CRC(9daec83d) SHA1(07de144898deac5058d05466f29682d7840323b7) ) | |
| 2897 | ROM_LOAD( "kf-001-008_t45.u17", 0x600000, 0x200000, CRC(f6ef6e41) SHA1(c3e838dd4dc340f44abdf45ec0b90de24f50dda9) ) | |
| 2898 | ||
| 2899 | ROM_REGION( 0x300000, "x1snd", 0 ) // Samples | |
| 2900 | // Leave 1MB empty (addressable by the chip) | |
| 2901 | ROM_LOAD( "kf-001-009_t46.u32", 0x100000, 0x200000, CRC(2a9641f9) SHA1(efb9df78f1877eddf29c4dae2461546adb9cea8f) ) | |
| 2902 | ||
| 2903 | ROM_REGION( 0x117, "plds", 0 ) | |
| 2904 | ROM_LOAD( "gal16v8_kf-001.u38", 0x000, 0x117, NO_DUMP ) | |
| 2905 | ROM_END | |
| 2906 | ||
| 2907 | /*************************************************************************** | |
| 2908 | ||
| 2909 | Sammy USA Outdoor Shooting Series PCB | |
| 2910 | ||
| 2911 | PCB B0-003A (or B0-003B): | |
| 2912 | Deer Hunting USA (c) 2000 Sammy USA | |
| 2913 | Turkey Hunting USA (c) 2001 Sammy USA | |
| 2914 | ||
| 2915 | PCB B0-010A: | |
| 2916 | Wing Shooting Championship (c) 2001 Sammy USA | |
| 2917 | Trophy Hunting - Bear & Moose (c) 2002 Sammy USA | |
| 2918 | ||
| 2919 | ||
| 2920 | CPU: Toshiba TMP68301AF-16 (100 Pin PQFP) | |
| 2921 | Video: NEC DX-101 (240 Pin PQFP) | |
| 2922 | NEC DX-102 (52 Pin PQFP x3) | |
| 2923 | Sound: X1-010 (Mitsubishi M60016 Gate Array, 80 Pin PQFP) | |
| 2924 | EEPROM: 93LC46BX (1K Low-power 64 x 16-bit organization serial EEPROM) | |
| 2925 | OSC: 50MHz & 28MHz | |
| 2926 | Other: 8 Position Dipswitch x 2 | |
| 2927 | Lattice ispLSI2032 - stamped "KW001" | |
| 2928 | Lattice isp1016E - stamped "GUN" (2 for PCB B0-010A, used for light gun input) | |
| 2929 | BAT1 - CR2032 3Volt | |
| 2930 | ||
| 2931 | PCB Number: B0-003A (or B0-003B) | |
| 2932 | +-----------------------------------------------------------+ | |
| 2933 | | VOL +------+ | | |
| 2934 | | |X1-010| M1 | | |
| 2935 | | +---+ +---+ |M60016| | | |
| 2936 | | | | | | M M |CALRUA| +---+ | | |
| 2937 | +-+ | U | | U | 2 1 +------+ | | | | |
| 2938 | | | 0 | | 0 | | | | | |
| 2939 | +-+ | 7 | | 6 | M M | U | | | |
| 2940 | | | | | | 2 1 | 1 | | | |
| 2941 | | +---+ +---+ | 8 | | | |
| 2942 | | Lattice | | | | |
| 2943 | |J D +---+ C ispLSI2032 | | | | |
| 2944 | |A S |DX | N BAT1 +-------+ +---+ | | |
| 2945 | |M W |102| 5 |Toshiba| D | | |
| 2946 | |M 1 +---+ | TMP | S EEPROM C | | |
| 2947 | |A C | 68301 | W N | | |
| 2948 | | N Lattice +-------+ 2 2 | | |
| 2949 | |C 6 isp1016E | | |
| 2950 | |o +----------+ 50MHz | | |
| 2951 | |n +---+ | | | | |
| 2952 | |n |DX | SW1 | NEC | M M | | |
| 2953 | |e |102| | DX-101 | 3 3 | | |
| 2954 | |c +---+ M M | | | | |
| 2955 | |t 1 1 | | | | |
| 2956 | |e +----------+ | | |
| 2957 | |r | | |
| 2958 | | +---+ +---++---++---+ | | |
| 2959 | | 28MHz | | | || || | | | |
| 2960 | | +---+ | | | || || | | | |
| 2961 | +-+ |DX | | U | | U || U || U | | | |
| 2962 | | |102| | 4 | | 4 || 3 || 3 | | | |
| 2963 | +-+ +---+ | 0 | | 1 || 8 || 9 | | | |
| 2964 | | | | | || || | | | |
| 2965 | | | | | || || | | | |
| 2966 | | +---+ +---++---++---+ | | |
| 2967 | +-----------------------------------------------------------+ | |
| 2968 | ||
| 2969 | PCB Number: B0-010A - This PCB is slightly revised for 2 player play | |
| 2970 | +-----------------------------------------------------------+ | |
| 2971 | | VOL +------+ | | |
| 2972 | | |X1-010| M1 | | |
| 2973 | | +---+ +---+ |M60016| | | |
| 2974 | | | | | | M M |CALRUA| +---+ | | |
| 2975 | +-+ | U | | U | 2 1 +------+ | | | | |
| 2976 | | | 0 | | 0 | | | | | |
| 2977 | +-+ | 7 | | 6 | M M | U | | | |
| 2978 | | | | | | 2 1 | 1 | | | |
| 2979 | | +---+ +---+ | 8 | | | |
| 2980 | | Lattice | | | | |
| 2981 | |J D +---+ C ispLSI2032 | | | | |
| 2982 | |A S |DX | N BAT1 +-------+ +---+ | | |
| 2983 | |M W |102| 5 |Toshiba| D | | |
| 2984 | |M 1 +---+ | TMP | S EEPROM C | | |
| 2985 | |A C | 68301 | W N | | |
| 2986 | | N Lattice +-------+ 2 2 | | |
| 2987 | |C 6 isp1016E | | |
| 2988 | |o +----------+ 50MHz | | |
| 2989 | |n +---+ | | | | |
| 2990 | |n |DX | SW1 | NEC | M M | | |
| 2991 | |e |102| | DX-101 | 3 3 | | |
| 2992 | |c +---+ M M | | | | |
| 2993 | |t 1 1 | | | | |
| 2994 | |e +----------+ | | |
| 2995 | |r | | |
| 2996 | | +---+ +---++---++---+ | | |
| 2997 | | 28MHz | | | || || | | | |
| 2998 | | +---+ C | | | || || | | | |
| 2999 | +-+ |DX | N | U | | U || U || U | | | |
| 3000 | | |102| 7 | 4 | | 4 || 3 || 3 | | | |
| 3001 | +-+ +---+ | 0 | | 1 || 8 || 9 | | | |
| 3002 | | Lattice C | | | || || | | | |
| 3003 | | isp1016E N | | | || || | | | |
| 3004 | | 8 +---+ +---++---++---+ | | |
| 3005 | +-----------------------------------------------------------+ | |
| 3006 | ||
| 3007 | Ram M1 are Toshiba TC55257DFL-70L | |
| 3008 | Ram M2 are NEC D43001GU-70L | |
| 3009 | Ram M3 are ISSI IS62C1024L-70Q | |
| 3010 | ||
| 3011 | U06 Program rom ST27C801 (even) | |
| 3012 | U07 Program rom ST27C801 (odd) | |
| 3013 | ||
| 3014 | U18 Mask rom (Samples 23C32000 32Mbit (read as 27C322)) | |
| 3015 | ||
| 3016 | U38 - U40 Mask roms (Graphics 23c64020 64Mbit) - 23C64020 read as 27C322 with pin11 +5v & 27C322 with pin11 GND | |
| 3017 | ||
| 3018 | -------------------------------------------------------------------------- | |
| 3019 | ||
| 3020 | From the WSC upgrade instruction sheet: | |
| 3021 | ||
| 3022 | Wing Shooting Championship | |
| 3023 | Game Echancement | |
| 3024 | 1/23/02 | |
| 3025 | ||
| 3026 | New Program chip Ver. 2.00 For Wing Shooting Championship | |
| 3027 | We are announcing NEW GAME FEATURES to enhance game play. Please refer below. | |
| 3028 | ||
| 3029 | NEW FEATURES | |
| 3030 | ------------ | |
| 3031 | ||
| 3032 | * Easier play for the first 3 hunting spots in every state with the addition of more birds. | |
| 3033 | * The "BEGINNER" weapon has been changed to the 5-shot PUMP SHOTGUN plus the "hit area" | |
| 3034 | for each shot has been increased. Same as the 3-shot SEMI-AUTO SHOTGUN. | |
| 3035 | * Player can now advance through all result screens faster by pulling gun trigger. | |
| 3036 | * The Auto Select bird is now GOOSE (easiest target) if player fails to choose bird at start of game. | |
| 3037 | ||
| 3038 | ***************************************************************************/ | |
| 3039 | ||
| 2680 | 3040 | ROM_START( deerhunt ) /* Deer Hunting USA V4.3 (11/1/2000) - The "E05" breaks version label conventions but is correct & verified */ |
| 2681 | ROM_REGION( 0x200000, "maincpu", 0 ) | |
| 3041 | ROM_REGION( 0x200000, "maincpu", 0 ) | |
| 2682 | 3042 | ROM_LOAD16_BYTE( "as0906e05.u06", 0x000000, 0x100000, CRC(20c81f17) SHA1(d41d93d6ee88738cec55f7bf3ce6be1dbec68e09) ) /* checksum 694E printed on label */ |
| 2683 | 3043 | ROM_LOAD16_BYTE( "as0907e05.u07", 0x000001, 0x100000, CRC(1731aa2a) SHA1(cffae7a99a7f960a62ef0c4454884df17a93c1a6) ) /* checksum 5D89 printed on label */ |
| 2684 | 3044 | |
| 2685 | ROM_REGION( 0x2000000, " | |
| 3045 | ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites | |
| 2686 | 3046 | ROM_LOAD( "as0901m01.u38", 0x0000000, 0x800000, CRC(1d6acf8f) SHA1(6f61fe21bebb7c87e8e6c3ef3ba73b8cf327dde9) ) |
| 2687 | 3047 | ROM_LOAD( "as0902m01.u39", 0x0800000, 0x800000, CRC(c7ca2128) SHA1(86be3a3ec2f86f61acfa3d4d261faea3c27dc378) ) |
| 2688 | 3048 | ROM_LOAD( "as0903m01.u40", 0x1000000, 0x800000, CRC(e8ef81b3) SHA1(97666942ca6cca5b8ea6451314a2aaabad9e06ba) ) |
| 2689 | 3049 | ROM_LOAD( "as0904m01.u41", 0x1800000, 0x800000, CRC(d0f97fdc) SHA1(776c9d42d03a9f61155521212305e1ed696eaf47) ) |
| 2690 | 3050 | |
| 2691 | ROM_REGION( 0x500000, "x1snd", 0 ) /* Samples */ | |
| 2692 | /* Leave 1MB empty (addressable by the chip) */ | |
| 3051 | ROM_REGION( 0x500000, "x1snd", 0 ) // Samples | |
| 3052 | // Leave 1MB empty (addressable by the chip) | |
| 2693 | 3053 | ROM_LOAD( "as0905m01.u18", 0x100000, 0x400000, CRC(8d8165bb) SHA1(aca7051613d260734ee787b4c3db552c336bd600) ) |
| 2694 | 3054 | ROM_END |
| 2695 | 3055 | |
| 2696 | 3056 | ROM_START( deerhunta ) /* Deer Hunting USA V4.2 (xx/x/2000) */ |
| 2697 | ROM_REGION( 0x200000, "maincpu", 0 ) | |
| 3057 | ROM_REGION( 0x200000, "maincpu", 0 ) | |
| 2698 | 3058 | ROM_LOAD16_BYTE( "as0906e04-v4_2.u06", 0x000000, 0x100000, CRC(bb3af36f) SHA1(f04071347e8ad361bf666fcb6c0136e522f19d47) ) /* checksum 6640 printed on label */ |
| 2699 | 3059 | ROM_LOAD16_BYTE( "as0907e04-v4_2.u07", 0x000001, 0x100000, CRC(83f02117) SHA1(70fc2291bc93af3902aae88688be6a8078f7a07e) ) /* checksum 595A printed on label */ |
| 2700 | 3060 | |
| 2701 | ROM_REGION( 0x2000000, " | |
| 3061 | ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites | |
| 2702 | 3062 | ROM_LOAD( "as0901m01.u38", 0x0000000, 0x800000, CRC(1d6acf8f) SHA1(6f61fe21bebb7c87e8e6c3ef3ba73b8cf327dde9) ) |
| 2703 | 3063 | ROM_LOAD( "as0902m01.u39", 0x0800000, 0x800000, CRC(c7ca2128) SHA1(86be3a3ec2f86f61acfa3d4d261faea3c27dc378) ) |
| 2704 | 3064 | ROM_LOAD( "as0903m01.u40", 0x1000000, 0x800000, CRC(e8ef81b3) SHA1(97666942ca6cca5b8ea6451314a2aaabad9e06ba) ) |
| 2705 | 3065 | ROM_LOAD( "as0904m01.u41", 0x1800000, 0x800000, CRC(d0f97fdc) SHA1(776c9d42d03a9f61155521212305e1ed696eaf47) ) |
| 2706 | 3066 | |
| 2707 | ROM_REGION( 0x500000, "x1snd", 0 ) /* Samples */ | |
| 2708 | /* Leave 1MB empty (addressable by the chip) */ | |
| 3067 | ROM_REGION( 0x500000, "x1snd", 0 ) // Samples | |
| 3068 | // Leave 1MB empty (addressable by the chip) | |
| 2709 | 3069 | ROM_LOAD( "as0905m01.u18", 0x100000, 0x400000, CRC(8d8165bb) SHA1(aca7051613d260734ee787b4c3db552c336bd600) ) |
| 2710 | 3070 | ROM_END |
| 2711 | 3071 | |
| 2712 | 3072 | ROM_START( deerhuntb ) /* Deer Hunting USA V4.0 (6/15/2000) */ |
| 2713 | ROM_REGION( 0x200000, "maincpu", 0 ) / | |
| 3073 | ROM_REGION( 0x200000, "maincpu", 0 ) // TMP68301 Code | |
| 2714 | 3074 | ROM_LOAD16_BYTE( "as0906e04.u06", 0x000000, 0x100000, CRC(07d9b64a) SHA1(f9aac644aab920bbac84b14836ee589ccd51f6db) ) /* checksum 7BBB printed on label */ |
| 2715 | 3075 | ROM_LOAD16_BYTE( "as0907e04.u07", 0x000001, 0x100000, CRC(19973d08) SHA1(da1cc02ce480a62ccaf94d0af1246a340f054b43) ) /* checksum 4C78 printed on label */ |
| 2716 | 3076 | |
| 2717 | ROM_REGION( 0x2000000, " | |
| 3077 | ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites | |
| 2718 | 3078 | ROM_LOAD( "as0901m01.u38", 0x0000000, 0x800000, CRC(1d6acf8f) SHA1(6f61fe21bebb7c87e8e6c3ef3ba73b8cf327dde9) ) |
| 2719 | 3079 | ROM_LOAD( "as0902m01.u39", 0x0800000, 0x800000, CRC(c7ca2128) SHA1(86be3a3ec2f86f61acfa3d4d261faea3c27dc378) ) |
| 2720 | 3080 | ROM_LOAD( "as0903m01.u40", 0x1000000, 0x800000, CRC(e8ef81b3) SHA1(97666942ca6cca5b8ea6451314a2aaabad9e06ba) ) |
| 2721 | 3081 | ROM_LOAD( "as0904m01.u41", 0x1800000, 0x800000, CRC(d0f97fdc) SHA1(776c9d42d03a9f61155521212305e1ed696eaf47) ) |
| 2722 | 3082 | |
| 2723 | ROM_REGION( 0x500000, "x1snd", 0 ) /* Samples */ | |
| 2724 | /* Leave 1MB empty (addressable by the chip) */ | |
| 3083 | ROM_REGION( 0x500000, "x1snd", 0 ) // Samples | |
| 3084 | // Leave 1MB empty (addressable by the chip) | |
| 2725 | 3085 | ROM_LOAD( "as0905m01.u18", 0x100000, 0x400000, CRC(8d8165bb) SHA1(aca7051613d260734ee787b4c3db552c336bd600) ) |
| 2726 | 3086 | ROM_END |
| 2727 | 3087 | |
| 2728 | 3088 | /* There are known versions 3.x of Deer Hunting USA.... just none are currently dumped. roms should be "AS0906 E03 U06" & "AS0907 E03 U07" */ |
| 2729 | 3089 | |
| 2730 | 3090 | ROM_START( deerhuntc ) /* Deer Hunting USA V2.x - No version number is printed to screen but "E02" in EPROM label signifies V2 */ |
| 2731 | ROM_REGION( 0x200000, "maincpu", 0 ) | |
| 3091 | ROM_REGION( 0x200000, "maincpu", 0 ) | |
| 2732 | 3092 | ROM_LOAD16_BYTE( "as0906e02.u06", 0x000000, 0x100000, CRC(190cca42) SHA1(aef63f5e8c71ed0156b8b0104c5d23872c119167) ) /* Version in program code is listed as 0.00 */ |
| 2733 | 3093 | ROM_LOAD16_BYTE( "as0907e02.u07", 0x000001, 0x100000, CRC(9de2b901) SHA1(d271bc54c41e30c0d9962eedd22f3ef2b7b8c9e5) ) /* Verified with two different sets of chips */ |
| 2734 | 3094 | |
| 2735 | ROM_REGION( 0x2000000, " | |
| 3095 | ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites | |
| 2736 | 3096 | ROM_LOAD( "as0901m01.u38", 0x0000000, 0x800000, CRC(1d6acf8f) SHA1(6f61fe21bebb7c87e8e6c3ef3ba73b8cf327dde9) ) |
| 2737 | 3097 | ROM_LOAD( "as0902m01.u39", 0x0800000, 0x800000, CRC(c7ca2128) SHA1(86be3a3ec2f86f61acfa3d4d261faea3c27dc378) ) |
| 2738 | 3098 | ROM_LOAD( "as0903m01.u40", 0x1000000, 0x800000, CRC(e8ef81b3) SHA1(97666942ca6cca5b8ea6451314a2aaabad9e06ba) ) |
| 2739 | 3099 | ROM_LOAD( "as0904m01.u41", 0x1800000, 0x800000, CRC(d0f97fdc) SHA1(776c9d42d03a9f61155521212305e1ed696eaf47) ) |
| 2740 | 3100 | |
| 2741 | ROM_REGION( 0x500000, "x1snd", 0 ) /* Samples */ | |
| 2742 | /* Leave 1MB empty (addressable by the chip) */ | |
| 3101 | ROM_REGION( 0x500000, "x1snd", 0 ) // Samples | |
| 3102 | // Leave 1MB empty (addressable by the chip) | |
| 2743 | 3103 | ROM_LOAD( "as0905m01.u18", 0x100000, 0x400000, CRC(8d8165bb) SHA1(aca7051613d260734ee787b4c3db552c336bd600) ) |
| 2744 | 3104 | ROM_END |
| 2745 | 3105 | |
| 2746 | 3106 | ROM_START( turkhunt ) /* V1.0 is currently the only known version */ |
| 2747 | ROM_REGION( 0x200000, "maincpu", 0 ) | |
| 3107 | ROM_REGION( 0x200000, "maincpu", 0 ) | |
| 2748 | 3108 | ROM_LOAD16_BYTE( "asx906e01.u06", 0x000000, 0x100000, CRC(c96266e1) SHA1(0ca462b3b0f27198e36384eee6ea5c5d4e7e1293) ) /* checksum E510 printed on label */ |
| 2749 | 3109 | ROM_LOAD16_BYTE( "asx907e01.u07", 0x000001, 0x100000, CRC(7c67b502) SHA1(6a0e8883a115dac4095d86897e7eca2a007a1c71) ) /* checksum AB40 printed on label */ |
| 2750 | 3110 | |
| 2751 | ROM_REGION( 0x2000000, " | |
| 3111 | ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites | |
| 2752 | 3112 | ROM_LOAD( "asx901m01.u38", 0x0000000, 0x800000, CRC(eabd3f44) SHA1(5a1ac986d11a8b019e18761cf4ea0a6f49fbdbfc) ) |
| 2753 | 3113 | ROM_LOAD( "asx902m01.u39", 0x0800000, 0x800000, CRC(c32130c8) SHA1(70d56ebed1f51657aaee02f95ac51589733e6eb7) ) |
| 2754 | 3114 | ROM_LOAD( "asx903m01.u40", 0x1000000, 0x800000, CRC(5f86c322) SHA1(5a72adb99eea176199f172384cb051e2b045ab94) ) |
| 2755 | 3115 | ROM_LOAD( "asx904m01.u41", 0x1800000, 0x800000, CRC(c77e0b66) SHA1(0eba30e62e4bd38c198fa6cb69fb94d002ded77a) ) |
| 2756 | 3116 | |
| 2757 | ROM_REGION( 0x500000, "x1snd", 0 ) /* Samples */ | |
| 2758 | /* Leave 1MB empty (addressable by the chip) */ | |
| 3117 | ROM_REGION( 0x500000, "x1snd", 0 ) // Samples | |
| 3118 | // Leave 1MB empty (addressable by the chip) | |
| 2759 | 3119 | ROM_LOAD( "asx905m01.u18", 0x100000, 0x400000, CRC(8d9dd9a9) SHA1(1fc2f3688d2c24c720dca7357bca6bf5f4016c53) ) |
| 2760 | 3120 | ROM_END |
| 2761 | 3121 | |
| 2762 | 3122 | ROM_START( wschamp ) /* Wing Shootiong Championship V2.00 (01/23/2002) */ |
| 2763 | ROM_REGION( 0x200000, "maincpu", 0 ) | |
| 3123 | ROM_REGION( 0x200000, "maincpu", 0 ) | |
| 2764 | 3124 | ROM_LOAD16_BYTE( "as1006e03.u06", 0x000000, 0x100000, CRC(0ad01677) SHA1(63e09b9f7cc8b781af1756f86caa0cc0962ae584) ) /* checksum 421E printed on label */ |
| 2765 | 3125 | ROM_LOAD16_BYTE( "as1007e03.u07", 0x000001, 0x100000, CRC(572624f0) SHA1(0c2f67daa22f4edd66a2be990dc6cd999faff0fa) ) /* checksum A48F printed on label */ |
| 2766 | 3126 | |
| 2767 | ROM_REGION( 0x2000000, " | |
| 3127 | ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites | |
| 2768 | 3128 | ROM_LOAD( "as1001m01.u38", 0x0000000, 0x800000, CRC(92595579) SHA1(75a7131aedb18b7103677340c3cca7c91aaca2bf) ) |
| 2769 | 3129 | ROM_LOAD( "as1002m01.u39", 0x0800000, 0x800000, CRC(16c2bb08) SHA1(63926464c8bd8db7d05905a953765e645942beb4) ) |
| 2770 | 3130 | ROM_LOAD( "as1003m01.u40", 0x1000000, 0x800000, CRC(89618858) SHA1(a8bd07f233482e8f5a256af7ff9577648eb58ef4) ) |
| 2771 | 3131 | ROM_LOAD( "as1004m01.u41", 0x1800000, 0x800000, CRC(500c0909) SHA1(73ff27d46b9285f34a50a81c21c54437f21e1939) ) |
| 2772 | 3132 | |
| 2773 | ROM_REGION( 0x500000, "x1snd", 0 ) /* Samples */ | |
| 2774 | /* Leave 1MB empty (addressable by the chip) */ | |
| 3133 | ROM_REGION( 0x500000, "x1snd", 0 ) // Samples | |
| 3134 | // Leave 1MB empty (addressable by the chip) | |
| 2775 | 3135 | ROM_LOAD( "as1005m01.u18", 0x100000, 0x400000, CRC(e4b137b8) SHA1(4d8d15073c51f7d383282cc5755ae5b2eab6226c) ) |
| 2776 | 3136 | ROM_END |
| 2777 | 3137 | |
| 2778 | 3138 | ROM_START( wschampa ) /* Wing Shootiong Championship V1.01 */ |
| 2779 | ROM_REGION( 0x200000, "maincpu", 0 ) | |
| 3139 | ROM_REGION( 0x200000, "maincpu", 0 ) | |
| 2780 | 3140 | ROM_LOAD16_BYTE( "as1006e02.u06", 0x000000, 0x100000, CRC(d3d3b2b5) SHA1(2d036d795b40a4ed78bb9f7751f875cfc76276a9) ) /* checksum 31EF printed on label */ |
| 2781 | 3141 | ROM_LOAD16_BYTE( "as1007e02.u07", 0x000001, 0x100000, CRC(78ede6d9) SHA1(e6d10f52cd4c6bf97288df44911f23bb64fc012c) ) /* checksum 615E printed on label */ |
| 2782 | 3142 | |
| 2783 | ROM_REGION( 0x2000000, " | |
| 3143 | ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites | |
| 2784 | 3144 | ROM_LOAD( "as1001m01.u38", 0x0000000, 0x800000, CRC(92595579) SHA1(75a7131aedb18b7103677340c3cca7c91aaca2bf) ) |
| 2785 | 3145 | ROM_LOAD( "as1002m01.u39", 0x0800000, 0x800000, CRC(16c2bb08) SHA1(63926464c8bd8db7d05905a953765e645942beb4) ) |
| 2786 | 3146 | ROM_LOAD( "as1003m01.u40", 0x1000000, 0x800000, CRC(89618858) SHA1(a8bd07f233482e8f5a256af7ff9577648eb58ef4) ) |
| 2787 | 3147 | ROM_LOAD( "as1004m01.u41", 0x1800000, 0x800000, CRC(500c0909) SHA1(73ff27d46b9285f34a50a81c21c54437f21e1939) ) |
| 2788 | 3148 | |
| 2789 | ROM_REGION( 0x500000, "x1snd", 0 ) /* Samples */ | |
| 2790 | /* Leave 1MB empty (addressable by the chip) */ | |
| 3149 | ROM_REGION( 0x500000, "x1snd", 0 ) // Samples | |
| 3150 | // Leave 1MB empty (addressable by the chip) | |
| 2791 | 3151 | ROM_LOAD( "as1005m01.u18", 0x100000, 0x400000, CRC(e4b137b8) SHA1(4d8d15073c51f7d383282cc5755ae5b2eab6226c) ) |
| 2792 | 3152 | ROM_END |
| 2793 | 3153 | |
| 2794 | 3154 | ROM_START( trophyh ) /* V1.0 is currently the only known version */ |
| 2795 | ROM_REGION( 0x200000, "maincpu", 0 ) | |
| 3155 | ROM_REGION( 0x200000, "maincpu", 0 ) | |
| 2796 | 3156 | ROM_LOAD16_BYTE( "as1106e01.u06", 0x000000, 0x100000, CRC(b4950882) SHA1(2749f7ffc5b543c9f39815f0913a1d1e385b63f4) ) /* checksum D8DA printed on label */ |
| 2797 | 3157 | ROM_LOAD16_BYTE( "as1107e01.u07", 0x000001, 0x100000, CRC(19ee67cb) SHA1(e75ce66d3ff5aad46ba997c09d6514260e617f55) ) /* checksum CEEF printed on label */ |
| 2798 | 3158 | |
| 2799 | ROM_REGION( 0x2000000, " | |
| 3159 | ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites | |
| 2800 | 3160 | ROM_LOAD( "as1101m01.u38", 0x0000000, 0x800000, CRC(855ed675) SHA1(84ce229a9feb6331413253a5aed10b362e8102e5) ) |
| 2801 | 3161 | ROM_LOAD( "as1102m01.u39", 0x0800000, 0x800000, CRC(d186d271) SHA1(3c54438b35adfab8be91df0a633270d6db49beef) ) |
| 2802 | 3162 | ROM_LOAD( "as1103m01.u40", 0x1000000, 0x800000, CRC(adf8a54e) SHA1(bb28bf219d18082246f7964851a5c49b9c0ba7f5) ) |
| 2803 | 3163 | ROM_LOAD( "as1104m01.u41", 0x1800000, 0x800000, CRC(387882e9) SHA1(0fdd0c77dabd1066c6f3bd64e357236a76f524ab) ) |
| 2804 | 3164 | |
| 2805 | ROM_REGION( 0x500000, "x1snd", 0 ) /* Samples */ | |
| 2806 | /* Leave 1MB empty (addressable by the chip) */ | |
| 3165 | ROM_REGION( 0x500000, "x1snd", 0 ) // Samples | |
| 3166 | // Leave 1MB empty (addressable by the chip) | |
| 2807 | 3167 | ROM_LOAD( "as1105m01.u18", 0x100000, 0x400000, CRC(633d0df8) SHA1(3401c424f5c207ef438a9269e0c0e7d482771fed) ) |
| 2808 | 3168 | ROM_END |
| 2809 | 3169 | |
| 2810 | ROM_START( funcube2 ) | |
| 2811 | ROM_REGION( 0x80000, "maincpu", 0 ) /* XCF5206 Code */ | |
| 2812 | ROM_LOAD( "fc21_prg-0b.u3", 0x00000, 0x80000, CRC(add1c8a6) SHA1(bf91518da659098a4bad4e756533525fcc910570) ) | |
| 2813 | 3170 | |
| 2814 | ROM_REGION( 0x20000, "sub", 0 ) /* H8/3007 Code */ | |
| 2815 | ROM_LOAD( "fc21_iopr-0.u49", 0x00000, 0x20000, CRC(314555ef) SHA1(b17e3926c8ef7f599856c198c330d2051aae13ad) ) | |
| 2816 | ||
| 2817 | ROM_REGION( 0x300, "pic", 0 ) /* PIC12C508? Code */ | |
| 2818 | ROM_LOAD( "fc21a", 0x000, 0x300, NO_DUMP ) | |
| 2819 | ||
| 2820 | ROM_REGION( 0x800000, "gfx1", 0 ) | |
| 2821 | ROM_LOAD32_WORD( "fc21_obj-0.u43", 0x000000, 0x400000, CRC(08cfe6d9) SHA1(d10f362dcde01f7a9855d8f76af3084b5dd1573a) ) | |
| 2822 | ROM_LOAD32_WORD( "fc21_obj-1.u42", 0x000002, 0x400000, CRC(4c1fbc20) SHA1(ff83691c19ce3600b31c494eaec26d2ac79e0028) ) | |
| 2823 | ||
| 2824 | ROM_REGION( 0x1000000, "oki", 0 ) | |
| 2825 | ROM_LOAD( "fc21_voi0.u47", 0x000000, 0x400000, CRC(25b5fc3f) SHA1(18b16a14e9ee62f3fea382e9d3fdcd43bdb165f5) ) | |
| 2826 | ROM_END | |
| 2827 | ||
| 2828 | ROM_START( funcube4 ) | |
| 2829 | ROM_REGION( 0x80000, "maincpu", 0 ) /* XCF5206 Code */ | |
| 2830 | ROM_LOAD( "fc41_prg-0.u3", 0x00000, 0x80000, CRC(ef870874) SHA1(dcb8dc3f780ca135df55e4b4f3c95620597ad28f) ) | |
| 2831 | ||
| 2832 | ROM_REGION( 0x20000, "sub", 0 ) /* H8/3007 Code */ | |
| 2833 | ROM_LOAD( "fc21_iopr-0.u49", 0x00000, 0x20000, CRC(314555ef) SHA1(b17e3926c8ef7f599856c198c330d2051aae13ad) ) | |
| 2834 | ||
| 2835 | ROM_REGION( 0x300, "pic", 0 ) /* PIC12C508? Code */ | |
| 2836 | ROM_LOAD( "fc41a", 0x000, 0x300, NO_DUMP ) | |
| 2837 | ||
| 2838 | ROM_REGION( 0x800000, "gfx1", 0 ) | |
| 2839 | ROM_LOAD32_WORD( "fc41_obj-0.u43", 0x000000, 0x400000, CRC(9ff029d5) SHA1(e057f4929aa745ecaf9d4ff7e39974c82e440146) ) | |
| 2840 | ROM_LOAD32_WORD( "fc41_obj-1.u42", 0x000002, 0x400000, CRC(5ab7b087) SHA1(c600158b2358cdf947357170044dda2deacd4f37) ) | |
| 2841 | ||
| 2842 | ROM_REGION( 0x1000000, "oki", 0 ) | |
| 2843 | ROM_LOAD( "fc41_snd0.u47", 0x000000, 0x400000, CRC(48337257) SHA1(d1755024b824100070b489f48f6ae921765329e8) ) | |
| 2844 | ROM_END | |
| 2845 | ||
| 2846 | static DRIVER_INIT( funcube2 ) | |
| 2847 | { | |
| 2848 | UINT32 *main_cpu = (UINT32 *) machine->region("maincpu")->base(); | |
| 2849 | UINT16 *sub_cpu = (UINT16 *) machine->region("sub")->base(); | |
| 2850 | ||
| 2851 | main_cpu[0x810/4] = 0xe0214e71; | |
| 2852 | main_cpu[0x814/4] = 0x4e71203c; | |
| 2853 | ||
| 2854 | main_cpu[0x81c/4] = 0x4e714e71; | |
| 2855 | ||
| 2856 | main_cpu[0xa5c/4] = 0x4e713e3c; | |
| 2857 | main_cpu[0xa74/4] = 0x4e713e3c; | |
| 2858 | main_cpu[0xa8c/4] = 0x4e7141f9; | |
| 2859 | ||
| 2860 | // Sub CPU | |
| 2861 | sub_cpu[0x4d4/2] = 0x5470; // rte -> rts | |
| 2862 | ||
| 2863 | // Audio | |
| 2864 | // The first half of the rom appears to be a dupe of the second half with 0xffs destructively interleaved | |
| 2865 | UINT8* oki = (UINT8*) machine->region("oki")->base(); | |
| 2866 | for (int i = 0; i < 0x200000; i++) | |
| 2867 | { | |
| 2868 | oki[i] = oki[i+0x200000]; | |
| 2869 | } | |
| 2870 | } | |
| 2871 | ||
| 2872 | // Note: same as funcube2 | |
| 2873 | static DRIVER_INIT( funcube4 ) | |
| 2874 | { | |
| 2875 | UINT32 *main_cpu = (UINT32 *) machine->region("maincpu")->base(); | |
| 2876 | UINT16 *sub_cpu = (UINT16 *) machine->region("sub")->base(); | |
| 2877 | ||
| 2878 | main_cpu[0x810/4] = 0xe0214e71; | |
| 2879 | main_cpu[0x814/4] = 0x4e71203c; | |
| 2880 | ||
| 2881 | main_cpu[0x81c/4] = 0x4e714e71; | |
| 2882 | ||
| 2883 | main_cpu[0xa5c/4] = 0x4e713e3c; | |
| 2884 | main_cpu[0xa74/4] = 0x4e713e3c; | |
| 2885 | main_cpu[0xa8c/4] = 0x4e7141f9; | |
| 2886 | ||
| 2887 | // Sub CPU | |
| 2888 | sub_cpu[0x4d4/2] = 0x5470; // rte -> rts | |
| 2889 | ||
| 2890 | // Audio | |
| 2891 | // The first half of the rom appears to be a dupe of the second half with 0xffs destructively interleaved | |
| 2892 | UINT8* oki = (UINT8*) machine->region("oki")->base(); | |
| 2893 | for (int i = 0; i < 0x200000; i++) | |
| 2894 | { | |
| 2895 | oki[i] = oki[i+0x200000]; | |
| 2896 | } | |
| 2897 | } | |
| 2898 | ||
| 2899 | 3171 | GAME( 1994, gundamex, 0, gundamex, gundamex, 0, ROT0, "Banpresto", "Mobile Suit Gundam EX Revue", 0 ) |
| 2900 | 3172 | GAME( 1995, grdians, 0, grdians, grdians, 0, ROT0, "Banpresto", "Guardians / Denjin Makai II", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS ) // Displays (c) Winky Soft at game's end. |
| 2901 | 3173 | GAME( 1996, mj4simai, 0, mj4simai, mj4simai, 0, ROT0, "Maboroshi Ware", "Wakakusamonogatari Mahjong Yonshimai (Japan)", GAME_NO_COCKTAIL ) |
| r10613 | r10614 | |
| 2911 | 3183 | GAME( 2001, wschamp, 0, samshoot, wschamp, 0, ROT0, "Sammy USA Corporation", "Wing Shooting Championship V2.00", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS ) |
| 2912 | 3184 | GAME( 2001, wschampa, wschamp, samshoot, wschamp, 0, ROT0, "Sammy USA Corporation", "Wing Shooting Championship V1.01", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS ) |
| 2913 | 3185 | GAME( 2002, trophyh, 0, samshoot, trophyh, 0, ROT0, "Sammy USA Corporation", "Trophy Hunting - Bear & Moose V1.0", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS ) |
| 2914 | GAME( 2001, funcube2, 0, funcube, funcube, funcube2, ROT0, "Namco", "Funcube 2 (v1.1)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND ) | |
| 2915 | GAME( 2001, funcube4, 0, funcube, funcube4, funcube4, ROT0, "Namco", "Funcube 4 (v1.0)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND ) | |
| 3186 | GAME( 2001, funcube2, 0, funcube, funcube, funcube2, ROT0, "Namco", "Funcube 2 (v1.1)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS ) | |
| 3187 | GAME( 2001, funcube4, 0, funcube, funcube4, funcube4, ROT0, "Namco", "Funcube 4 (v1.0)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS ) | |
| 3188 | GAME( ????, reelquak, 0, reelquak, reelquak, 0, ROT0, "<unknown>", "Reel'N Quake! (Ver. 1.05)", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS ) |
| r10613 | r10614 | |
|---|---|---|
| 89 | 89 | #include "sound/3526intf.h" |
| 90 | 90 | #include "includes/terracre.h" |
| 91 | 91 | |
| 92 | static const UINT16 *mpProtData; | |
| 93 | static UINT8 mAmazonProtCmd; | |
| 94 | static UINT8 mAmazonProtReg[6]; | |
| 95 | 92 | |
| 96 | 93 | static const UINT16 mAmazonProtData[] = |
| 97 | 94 | { |
| r10613 | r10614 | |
| 161 | 158 | |
| 162 | 159 | static READ16_HANDLER( amazon_protection_r ) |
| 163 | 160 | { |
| 164 | offset = mAmazonProtReg[2]; | |
| 161 | terracre_state *state = space->machine->driver_data<terracre_state>(); | |
| 162 | offset = state->mAmazonProtReg[2]; | |
| 165 | 163 | if( offset<=0x56 ) |
| 166 | 164 | { |
| 167 | 165 | UINT16 data; |
| 168 | data = mpProtData[offset/2]; | |
| 166 | data = state->mpProtData[offset/2]; | |
| 169 | 167 | if( offset&1 ) return data&0xff; |
| 170 | 168 | return data>>8; |
| 171 | 169 | } |
| r10613 | r10614 | |
| 174 | 172 | |
| 175 | 173 | static WRITE16_HANDLER( amazon_protection_w ) |
| 176 | 174 | { |
| 175 | terracre_state *state = space->machine->driver_data<terracre_state>(); | |
| 177 | 176 | if( ACCESSING_BITS_0_7 ) |
| 178 | 177 | { |
| 179 | 178 | if( offset==1 ) |
| 180 | 179 | { |
| 181 | mAmazonProtCmd = data; | |
| 180 | state->mAmazonProtCmd = data; | |
| 182 | 181 | } |
| 183 | 182 | else |
| 184 | 183 | { |
| 185 | if( mAmazonProtCmd>=32 && mAmazonProtCmd<=0x37 ) | |
| 184 | if( state->mAmazonProtCmd>=32 && state->mAmazonProtCmd<=0x37 ) | |
| 186 | 185 | { |
| 187 | mAmazonProtReg[mAmazonProtCmd-0x32] = data; | |
| 186 | state->mAmazonProtReg[state->mAmazonProtCmd-0x32] = data; | |
| 188 | 187 | } |
| 189 | 188 | } |
| 190 | 189 | } |
| r10613 | r10614 | |
| 192 | 191 | |
| 193 | 192 | static MACHINE_START( amazon ) |
| 194 | 193 | { |
| 194 | terracre_state *state = machine->driver_data<terracre_state>(); | |
| 195 | 195 | /* set up for save */ |
| 196 | state_save_register_global(machine, mAmazonProtCmd); | |
| 197 | state_save_register_global_array(machine, mAmazonProtReg); | |
| 196 | state_save_register_global(machine, state->mAmazonProtCmd); | |
| 197 | state_save_register_global_array(machine, state->mAmazonProtReg); | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | static ADDRESS_MAP_START( terracre_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 201 | 201 | AM_RANGE(0x000000, 0x01ffff) AM_ROM |
| 202 | 202 | AM_RANGE(0x020000, 0x0201ff) AM_RAM AM_BASE_GENERIC(spriteram) |
| 203 | 203 | AM_RANGE(0x020200, 0x021fff) AM_RAM |
| 204 | AM_RANGE(0x022000, 0x022fff) AM_WRITE(amazon_background_w) AM_BASE( | |
| 204 | AM_RANGE(0x022000, 0x022fff) AM_WRITE(amazon_background_w) AM_BASE_MEMBER(terracre_state, amazon_videoram) | |
| 205 | 205 | AM_RANGE(0x023000, 0x023fff) AM_RAM |
| 206 | 206 | AM_RANGE(0x024000, 0x024001) AM_READ_PORT("P1") |
| 207 | 207 | AM_RANGE(0x024002, 0x024003) AM_READ_PORT("P2") |
| r10613 | r10614 | |
| 218 | 218 | AM_RANGE(0x000000, 0x01ffff) AM_ROM |
| 219 | 219 | AM_RANGE(0x040000, 0x0401ff) AM_RAM AM_BASE_GENERIC(spriteram) |
| 220 | 220 | AM_RANGE(0x040200, 0x040fff) AM_RAM |
| 221 | AM_RANGE(0x042000, 0x042fff) AM_WRITE(amazon_background_w) AM_BASE( | |
| 221 | AM_RANGE(0x042000, 0x042fff) AM_WRITE(amazon_background_w) AM_BASE_MEMBER(terracre_state, amazon_videoram) | |
| 222 | 222 | AM_RANGE(0x044000, 0x044001) AM_READ_PORT("IN0") |
| 223 | 223 | AM_RANGE(0x044002, 0x044003) AM_READ_PORT("IN1") |
| 224 | 224 | AM_RANGE(0x044004, 0x044005) AM_READ_PORT("IN2") |
| r10613 | r10614 | |
| 978 | 978 | |
| 979 | 979 | static DRIVER_INIT( amazon ) |
| 980 | 980 | { |
| 981 | mpProtData = mAmazonProtData; | |
| 981 | terracre_state *state = machine->driver_data<terracre_state>(); | |
| 982 | state->mpProtData = mAmazonProtData; | |
| 982 | 983 | } |
| 983 | 984 | |
| 984 | 985 | static DRIVER_INIT( amatelas ) |
| 985 | 986 | { |
| 986 | mpProtData = mAmatelasProtData; | |
| 987 | terracre_state *state = machine->driver_data<terracre_state>(); | |
| 988 | state->mpProtData = mAmatelasProtData; | |
| 987 | 989 | } |
| 988 | 990 | |
| 989 | 991 | static DRIVER_INIT( horekid ) |
| 990 | 992 | { |
| 991 | mpProtData = mHoreKidProtData; | |
| 993 | terracre_state *state = machine->driver_data<terracre_state>(); | |
| 994 | state->mpProtData = mHoreKidProtData; | |
| 992 | 995 | memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x44004, 0x44005, 0, 0, horekid_IN2_r); |
| 993 | 996 | } |
| 994 | 997 |
| r10613 | r10614 | |
|---|---|---|
| 334 | 334 | |
| 335 | 335 | /* video hardware */ |
| 336 | 336 | MCFG_TLC34076_ADD("tlc34076", TLC34076_6_BIT) |
| 337 | ||
| 337 | ||
| 338 | 338 | MCFG_SCREEN_ADD("screen", RASTER) |
| 339 | 339 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 340 | 340 | MCFG_SCREEN_RAW_PARAMS(10000000, 640, 114, 626, 257, 24, 248) |
| r10613 | r10614 | |
|---|---|---|
| 148 | 148 | cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, CLEAR_LINE); |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | static int rp5c01_mode_sel; /* Mode selector */ | |
| 152 | static int rp5c01_mem[16*4]; | |
| 153 | 151 | |
| 154 | 152 | static READ8_HANDLER( spunchout_rp5c01_r ) |
| 155 | 153 | { |
| 154 | punchout_state *state = space->machine->driver_data<punchout_state>(); | |
| 156 | 155 | logerror("%04x: prot_r %x\n", cpu_get_previouspc(space->cpu), offset); |
| 157 | 156 | |
| 158 | 157 | if (offset <= 0x0c) |
| 159 | 158 | { |
| 160 | switch (rp5c01_mode_sel & 3) | |
| 159 | switch (state->rp5c01_mode_sel & 3) | |
| 161 | 160 | { |
| 162 | 161 | case 0: // time |
| 163 | 162 | switch ( offset ) |
| 164 | 163 | { |
| 165 | 164 | case 0x00: // 1-second counter |
| 166 | return rp5c01_mem[0x00]; | |
| 165 | return state->rp5c01_mem[0x00]; | |
| 167 | 166 | |
| 168 | 167 | case 0x01: // 10-second counter |
| 169 | return rp5c01_mem[0x01] & 0x7; | |
| 168 | return state->rp5c01_mem[0x01] & 0x7; | |
| 170 | 169 | |
| 171 | 170 | case 0x02: // 1-minute counter |
| 172 | return rp5c01_mem[0x02]; | |
| 171 | return state->rp5c01_mem[0x02]; | |
| 173 | 172 | |
| 174 | 173 | case 0x03: // 10-minute counter |
| 175 | return rp5c01_mem[0x03] & 0x07; | |
| 174 | return state->rp5c01_mem[0x03] & 0x07; | |
| 176 | 175 | |
| 177 | 176 | case 0x04: // 1-hour counter |
| 178 | return rp5c01_mem[0x04]; | |
| 177 | return state->rp5c01_mem[0x04]; | |
| 179 | 178 | |
| 180 | 179 | case 0x05: // 10-hour counter |
| 181 | return rp5c01_mem[0x05] & 0x03; | |
| 180 | return state->rp5c01_mem[0x05] & 0x03; | |
| 182 | 181 | |
| 183 | 182 | case 0x06: // day-of-the-week counter |
| 184 | return rp5c01_mem[0x06] & 0x07; | |
| 183 | return state->rp5c01_mem[0x06] & 0x07; | |
| 185 | 184 | |
| 186 | 185 | case 0x07: // 1-day counter |
| 187 | return rp5c01_mem[0x07]; | |
| 186 | return state->rp5c01_mem[0x07]; | |
| 188 | 187 | |
| 189 | 188 | case 0x08: // 10-day counter |
| 190 | return rp5c01_mem[0x08] & 0x03; | |
| 189 | return state->rp5c01_mem[0x08] & 0x03; | |
| 191 | 190 | |
| 192 | 191 | case 0x09: // 1-month counter |
| 193 | return rp5c01_mem[0x09]; | |
| 192 | return state->rp5c01_mem[0x09]; | |
| 194 | 193 | |
| 195 | 194 | case 0x0a: // 10-month counter |
| 196 | return rp5c01_mem[0x0a] & 0x01; | |
| 195 | return state->rp5c01_mem[0x0a] & 0x01; | |
| 197 | 196 | |
| 198 | 197 | case 0x0b: // 1-year counter |
| 199 | return rp5c01_mem[0x0b]; | |
| 198 | return state->rp5c01_mem[0x0b]; | |
| 200 | 199 | |
| 201 | 200 | case 0x0c: // 10-year counter |
| 202 | return rp5c01_mem[0x0c]; | |
| 201 | return state->rp5c01_mem[0x0c]; | |
| 203 | 202 | } |
| 204 | 203 | break; |
| 205 | 204 | |
| r10613 | r10614 | |
| 213 | 212 | return 0x00; |
| 214 | 213 | |
| 215 | 214 | case 0x02: // 1-minute alarm register |
| 216 | return rp5c01_mem[0x12]; | |
| 215 | return state->rp5c01_mem[0x12]; | |
| 217 | 216 | |
| 218 | 217 | case 0x03: // 10-minute alarm register |
| 219 | return rp5c01_mem[0x13] & 0x07; | |
| 218 | return state->rp5c01_mem[0x13] & 0x07; | |
| 220 | 219 | |
| 221 | 220 | case 0x04: // 1-hour alarm register |
| 222 | return rp5c01_mem[0x14]; | |
| 221 | return state->rp5c01_mem[0x14]; | |
| 223 | 222 | |
| 224 | 223 | case 0x05: // 10-hour alarm register |
| 225 | return rp5c01_mem[0x15] & 0x03; | |
| 224 | return state->rp5c01_mem[0x15] & 0x03; | |
| 226 | 225 | |
| 227 | 226 | case 0x06: // day-of-the-week alarm register |
| 228 | return rp5c01_mem[0x16] & 0x07; | |
| 227 | return state->rp5c01_mem[0x16] & 0x07; | |
| 229 | 228 | |
| 230 | 229 | case 0x07: // 1-day alarm register |
| 231 | return rp5c01_mem[0x17]; | |
| 230 | return state->rp5c01_mem[0x17]; | |
| 232 | 231 | |
| 233 | 232 | case 0x08: // 10-day alarm register |
| 234 | return rp5c01_mem[0x18] & 0x03; | |
| 233 | return state->rp5c01_mem[0x18] & 0x03; | |
| 235 | 234 | |
| 236 | 235 | case 0x09: // n/a |
| 237 | 236 | return 0x00; |
| 238 | 237 | |
| 239 | 238 | case 0x0a: // /12/24 select register |
| 240 | return rp5c01_mem[0x1a] & 0x01; | |
| 239 | return state->rp5c01_mem[0x1a] & 0x01; | |
| 241 | 240 | |
| 242 | 241 | case 0x0b: // leap year count |
| 243 | return rp5c01_mem[0x1b] & 0x03; | |
| 242 | return state->rp5c01_mem[0x1b] & 0x03; | |
| 244 | 243 | |
| 245 | 244 | case 0x0c: // n/a |
| 246 | 245 | return 0x00; |
| r10613 | r10614 | |
| 249 | 248 | |
| 250 | 249 | case 2: // RAM BLOCK 10 |
| 251 | 250 | case 3: // RAM BLOCK 11 |
| 252 | return rp5c01_mem[0x10 * (rp5c01_mode_sel & 3) + offset]; | |
| 251 | return state->rp5c01_mem[0x10 * (state->rp5c01_mode_sel & 3) + offset]; | |
| 253 | 252 | } |
| 254 | 253 | } |
| 255 | 254 | else if (offset == 0x0d) |
| 256 | 255 | { |
| 257 | return rp5c01_mode_sel; | |
| 256 | return state->rp5c01_mode_sel; | |
| 258 | 257 | } |
| 259 | 258 | |
| 260 | logerror("Read from unknown protection? port %02x ( selector = %02x )\n", offset, rp5c01_mode_sel ); | |
| 259 | logerror("Read from unknown protection? port %02x ( selector = %02x )\n", offset, state->rp5c01_mode_sel ); | |
| 261 | 260 | return 0; |
| 262 | 261 | } |
| 263 | 262 | |
| 264 | 263 | static WRITE8_HANDLER( spunchout_rp5c01_w ) |
| 265 | 264 | { |
| 265 | punchout_state *state = space->machine->driver_data<punchout_state>(); | |
| 266 | 266 | data &= 0x0f; |
| 267 | 267 | |
| 268 | 268 | logerror("%04x: prot_w %x = %02x\n",cpu_get_previouspc(space->cpu),offset,data); |
| 269 | 269 | |
| 270 | 270 | if (offset <= 0x0c) |
| 271 | 271 | { |
| 272 | rp5c01_mem[0x10 * (rp5c01_mode_sel & 3) + offset] = data; | |
| 272 | state->rp5c01_mem[0x10 * (state->rp5c01_mode_sel & 3) + offset] = data; | |
| 273 | 273 | } |
| 274 | 274 | else if (offset == 0x0d) |
| 275 | 275 | { |
| 276 | rp5c01_mode_sel = data; | |
| 276 | state->rp5c01_mode_sel = data; | |
| 277 | 277 | logerror("MODE: Timer EN = %d Alarm EN = %d MODE %d\n",BIT(data,3),BIT(data,2),data&3); |
| 278 | 278 | } |
| 279 | 279 | else if (offset == 0x0e) |
| r10613 | r10614 | |
| 317 | 317 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 318 | 318 | AM_RANGE(0xc000, 0xc3ff) AM_RAM AM_SHARE("nvram") |
| 319 | 319 | AM_RANGE(0xd000, 0xd7ff) AM_RAM |
| 320 | AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(punchout_bg_top_videoram_w) AM_BASE(&punchout_bg_top_videoram) | |
| 321 | AM_RANGE(0xdff0, 0xdff7) AM_BASE(&punchout_spr1_ctrlram) | |
| 322 | AM_RANGE(0xdff8, 0xdffc) AM_BASE(&punchout_spr2_ctrlram) | |
| 323 | AM_RANGE(0xdffd, 0xdffd) AM_BASE(&punchout_palettebank) | |
| 324 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(punchout_spr1_videoram_w) AM_BASE(&punchout_spr1_videoram) | |
| 325 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(punchout_spr2_videoram_w) AM_BASE(&punchout_spr2_videoram) | |
| 326 | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(punchout_bg_bot_videoram_w) AM_BASE(&punchout_bg_bot_videoram) // also contains scroll RAM | |
| 320 | AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(punchout_bg_top_videoram_w) AM_BASE_MEMBER(punchout_state, bg_top_videoram) | |
| 321 | AM_RANGE(0xdff0, 0xdff7) AM_BASE_MEMBER(punchout_state, spr1_ctrlram) | |
| 322 | AM_RANGE(0xdff8, 0xdffc) AM_BASE_MEMBER(punchout_state, spr2_ctrlram) | |
| 323 | AM_RANGE(0xdffd, 0xdffd) AM_BASE_MEMBER(punchout_state, palettebank) | |
| 324 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(punchout_spr1_videoram_w) AM_BASE_MEMBER(punchout_state, spr1_videoram) | |
| 325 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(punchout_spr2_videoram_w) AM_BASE_MEMBER(punchout_state, spr2_videoram) | |
| 326 | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(punchout_bg_bot_videoram_w) AM_BASE_MEMBER(punchout_state, bg_bot_videoram) // also contains scroll RAM | |
| 327 | 327 | ADDRESS_MAP_END |
| 328 | 328 | |
| 329 | 329 | |
| r10613 | r10614 | |
| 331 | 331 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 332 | 332 | AM_RANGE(0xc000, 0xc3ff) AM_RAM AM_SHARE("nvram") |
| 333 | 333 | AM_RANGE(0xd000, 0xd7ff) AM_RAM |
| 334 | AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(armwrest_fg_videoram_w) AM_BASE(&armwrest_fg_videoram) | |
| 335 | AM_RANGE(0xdff0, 0xdff7) AM_BASE(&punchout_spr1_ctrlram) | |
| 336 | AM_RANGE(0xdff8, 0xdffc) AM_BASE(&punchout_spr2_ctrlram) | |
| 337 | AM_RANGE(0xdffd, 0xdffd) AM_BASE(&punchout_palettebank) | |
| 338 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(punchout_spr1_videoram_w) AM_BASE(&punchout_spr1_videoram) | |
| 339 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(punchout_spr2_videoram_w) AM_BASE(&punchout_spr2_videoram) | |
| 340 | AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(punchout_bg_bot_videoram_w) AM_BASE(&punchout_bg_bot_videoram) | |
| 341 | AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(punchout_bg_top_videoram_w) AM_BASE(&punchout_bg_top_videoram) | |
| 334 | AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(armwrest_fg_videoram_w) AM_BASE_MEMBER(punchout_state, armwrest_fg_videoram) | |
| 335 | AM_RANGE(0xdff0, 0xdff7) AM_BASE_MEMBER(punchout_state, spr1_ctrlram) | |
| 336 | AM_RANGE(0xdff8, 0xdffc) AM_BASE_MEMBER(punchout_state, spr2_ctrlram) | |
| 337 | AM_RANGE(0xdffd, 0xdffd) AM_BASE_MEMBER(punchout_state, palettebank) | |
| 338 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(punchout_spr1_videoram_w) AM_BASE_MEMBER(punchout_state, spr1_videoram) | |
| 339 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(punchout_spr2_videoram_w) AM_BASE_MEMBER(punchout_state, spr2_videoram) | |
| 340 | AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(punchout_bg_bot_videoram_w) AM_BASE_MEMBER(punchout_state, bg_bot_videoram) | |
| 341 | AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(punchout_bg_top_videoram_w) AM_BASE_MEMBER(punchout_state, bg_top_videoram) | |
| 342 | 342 | ADDRESS_MAP_END |
| 343 | 343 | |
| 344 | 344 | |
| r10613 | r10614 | |
| 918 | 918 | |
| 919 | 919 | static MACHINE_RESET( punchout ) |
| 920 | 920 | { |
| 921 | rp5c01_mode_sel = 0; | |
| 922 | memset(rp5c01_mem, 0, sizeof(rp5c01_mem)); | |
| 921 | punchout_state *state = machine->driver_data<punchout_state>(); | |
| 922 | state->rp5c01_mode_sel = 0; | |
| 923 | memset(state->rp5c01_mem, 0, sizeof(state->rp5c01_mem)); | |
| 923 | 924 | } |
| 924 | 925 | |
| 925 | 926 | |
| 926 | static MACHINE_CONFIG_START( punchout, | |
| 927 | static MACHINE_CONFIG_START( punchout, pun | |
| 927 | 928 | |
| 928 | 929 | /* basic machine hardware */ |
| 929 | 930 | MCFG_CPU_ADD("maincpu", Z80, 8000000/2) /* 4 MHz */ |
| r10613 | r10614 | |
|---|---|---|
| 1824 | 1824 | |
| 1825 | 1825 | MCFG_PALETTE_INIT(berlwall) |
| 1826 | 1826 | MCFG_VIDEO_START(berlwall) |
| 1827 | ||
| 1827 | ||
| 1828 | 1828 | /* sound hardware */ |
| 1829 | 1829 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1830 | 1830 |
| r10613 | r10614 | |
|---|---|---|
| 31 | 31 | *NFL Classic Football (C) Namco, 2003 |
| 32 | 32 | *Panicuru Panekuru (PPA1 Ver.A) (C) Namco, 2001 |
| 33 | 33 | *Photo Battole (C) Namco, 2001 |
| 34 | Point Blank 3 / Gunbalina (GNN2 Ver. A) | |
| 34 | Point Blank 3 / Gunbalina (GNN2 Ver. A) (C) Namco, 2000 | |
| 35 | 35 | *Ren-ai Quiz High School Angel (C) Namco, 2002 |
| 36 | 36 | *Seishun Quiz Colorful High School (C) Namco, 2002 |
| 37 | 37 | Star Trigon (STT1 Ver.A) (C) Namco, 2002 |
| r10613 | r10614 | |
| 628 | 628 | ROM_FILL( 0x0000000, 0x400000, 0x55 ) |
| 629 | 629 | |
| 630 | 630 | ROM_REGION( 0x2100000, "user2", 0 ) /* main prg */ |
| 631 | ROM_LOAD( "0.8e", 0x0000000, 0x1080000, CRC(31b39221) SHA1(7fcb14aaa26c531928a6cd704e746d0e3ae3e031) ) | |
| 632 | ROM_LOAD( "1.8d", 0x1080000, 0x1080000, CRC(82d2cfb5) SHA1(4b5e713a55e74a7b32b1b9b5811892df2df86256) ) | |
| 631 | ROM_LOAD( "0.8e", 0x0000000, 0x1080000, CRC(31b39221) SHA1(7fcb14aaa26c531928a6cd704e746d0e3ae3e031) ) | |
| 632 | ROM_LOAD( "1.8d", 0x1080000, 0x1080000, CRC(82d2cfb5) SHA1(4b5e713a55e74a7b32b1b9b5811892df2df86256) ) | |
| 633 | 633 | ROM_END |
| 634 | 634 | |
| 635 | 635 | ROM_START( chocovdr ) |
| r10613 | r10614 | |
| 637 | 637 | ROM_FILL( 0x0000000, 0x400000, 0x55 ) |
| 638 | 638 | |
| 639 | 639 | ROM_REGION( 0x5280000, "user2", 0 ) /* main prg */ |
| 640 | ROM_LOAD( "0.8e", 0x0000000, 0x1080000, CRC(f265b1b6) SHA1(f327e7bac0bc1bd31aa3362e36233130a6b240ea) ) | |
| 641 | ROM_LOAD( "1.8d", 0x1080000, 0x1080000, CRC(05d01cd2) SHA1(e9947ebea24d618e8b9a69f582ef0b9d97bb4cad) ) | |
| 642 | ROM_LOAD( "2.7e", 0x2100000, 0x1080000, CRC(2e308d20) SHA1(4ff072f0d488b12f77ef7d119822f89b5b5a6712) ) | |
| 643 | ROM_LOAD( "3.7d", 0x3180000, 0x1080000, CRC(126c9e6f) SHA1(32de87f01fd1c8c26a68bf42a062f5f44bcc5a3b) ) | |
| 644 | ROM_LOAD( "4.6e", 0x4200000, 0x1080000, CRC(6c18678d) SHA1(410a282397e4a4b5763467811080172b462bfcef) ) | |
| 640 | ROM_LOAD( "0.8e", 0x0000000, 0x1080000, CRC(f265b1b6) SHA1(f327e7bac0bc1bd31aa3362e36233130a6b240ea) ) | |
| 641 | ROM_LOAD( "1.8d", 0x1080000, 0x1080000, CRC(05d01cd2) SHA1(e9947ebea24d618e8b9a69f582ef0b9d97bb4cad) ) | |
| 642 | ROM_LOAD( "2.7e", 0x2100000, 0x1080000, CRC(2e308d20) SHA1(4ff072f0d488b12f77ef7d119822f89b5b5a6712) ) | |
| 643 | ROM_LOAD( "3.7d", 0x3180000, 0x1080000, CRC(126c9e6f) SHA1(32de87f01fd1c8c26a68bf42a062f5f44bcc5a3b) ) | |
| 644 | ROM_LOAD( "4.6e", 0x4200000, 0x1080000, CRC(6c18678d) SHA1(410a282397e4a4b5763467811080172b462bfcef) ) | |
| 645 | 645 | ROM_END |
| 646 | 646 | |
| 647 | 647 | GAME( 2000, mrdrilr2, 0, namcos10, namcos10, mrdrilr2, ROT0, "Namco", "Mr. Driller 2 (Japan, DR21 Ver.A)", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| r10613 | r10614 | |
|---|---|---|
| 237 | 237 | #include "mpu4ext.lh" |
| 238 | 238 | #define MPU4_MASTER_CLOCK (6880000) |
| 239 | 239 | |
| 240 | /* local vars */ | |
| 241 | static int mod_number; | |
| 242 | static int mmtr_data; | |
| 243 | static int alpha_data_line; | |
| 244 | static int alpha_clock; | |
| 245 | static int ay8913_address; | |
| 246 | static int serial_data; | |
| 247 | static int signal_50hz; | |
| 248 | static int ic4_input_b; | |
| 249 | static int aux1_input; | |
| 250 | static int aux2_input; | |
| 251 | static int IC23G1; | |
| 252 | static int IC23G2A; | |
| 253 | static int IC23G2B; | |
| 254 | static int IC23GC; | |
| 255 | static int IC23GB; | |
| 256 | static int IC23GA; | |
| 257 | static int prot_col; | |
| 258 | static int lamp_col; | |
| 259 | static int reel_flag; | |
| 260 | static int ic23_active; | |
| 261 | static int led_lamp; | |
| 262 | static int link7a_connected; | |
| 263 | static emu_timer *ic24_timer; | |
| 264 | 240 | static TIMER_CALLBACK( ic24_timeout ); |
| 265 | 241 | |
| 266 | static int expansion_latch;// OKI MOD 4 and above only (PIA on Gamecard) | |
| 267 | static int global_volume;// OKI MOD 4 and above only (PIA on Gamecard) | |
| 268 | 242 | /* 32 multiplexed inputs - but a further 8 possible per AUX. |
| 269 | 243 | Two connectors 'orange' (sampled every 8ms) and 'black' (sampled every 16ms) |
| 270 | 244 | Each connector carries two banks of eight inputs and two enable signals */ |
| 271 | static int input_strobe; /* IC23 74LS138 A = CA2 IC7, B = CA2 IC4, C = CA2 IC8 */ | |
| 272 | static UINT8 lamp_strobe,lamp_strobe2; | |
| 273 | static UINT8 lamp_data; | |
| 274 | static UINT8 ay_data; | |
| 275 | 245 | |
| 276 | static UINT8 Lamps[224]; /* 128 multiplexed lamps + 96 extension */ | |
| 277 | static int optic_pattern; | |
| 278 | static int active_reel; | |
| 279 | static int remote_meter; | |
| 280 | 246 | |
| 281 | static UINT8 reel_mux_table[8]= {0,4,2,6,1,5,3,7};//include 7, although I don't think it's used | |
| 282 | static UINT8 reel_mux_table7[8]= {3,1,5,6,4,2,0,7}; | |
| 247 | static const UINT8 reel_mux_table[8]= {0,4,2,6,1,5,3,7};//include 7, although I don't think it's used | |
| 248 | static const UINT8 reel_mux_table7[8]= {3,1,5,6,4,2,0,7}; | |
| 283 | 249 | |
| 284 | static int reel_mux; /* added support for up to 8 reels */ | |
| 285 | 250 | #define STANDARD_REEL 0 /* As originally designed 3/4 reels*/ |
| 286 | 251 | #define FIVE_REEL_5TO8 1 /* Interfaces to meter port, allows some mechanical metering, but there is significant 'bounce' in the extra reel*/ |
| 287 | 252 | #define FIVE_REEL_8TO5 2 /* Mounted backwards for space reasons, but different board*/ |
| r10613 | r10614 | |
| 290 | 255 | #define SIX_REEL_5TO8 5 /* Like FIVE_REEL_5TO8, but with an extra reel elsewhere*/ |
| 291 | 256 | #define SEVEN_REEL 6 /* Mainly club machines, significant reworking of reel hardware*/ |
| 292 | 257 | |
| 293 | static int lamp_extender;/* Plug in boards that add additional lamps and leds via the AUX ports. */ | |
| 294 | static int last_b7; | |
| 295 | static int last_latch; | |
| 296 | 258 | #define NO_EXTENDER 0 /* As originally designed */ |
| 297 | 259 | #define SMALL_CARD 1 |
| 298 | 260 | #define LARGE_CARD_A 2 //96 Lamps |
| 299 | 261 | #define LARGE_CARD_B 3 // 96 Lamps, 16 LEDs - as used by BwB |
| 300 | 262 | #define LARGE_CARD_C 4 //Identical to B, no built in LED support |
| 301 | 263 | |
| 302 | static int lamp_sense; | |
| 303 | static int card_live; | |
| 304 | 264 | |
| 305 | static int led_extender; /* Plug in boards that add leds via the AUX ports. */ | |
| 306 | 265 | #define CARD_A 1 |
| 307 | 266 | #define CARD_B 2 |
| 308 | 267 | #define CARD_C 3 |
| 309 | 268 | |
| 310 | static int hopper =0; | |
| 311 | 269 | #define TUBES 0 |
| 312 | 270 | #define HOPPER_DUART_A 1 |
| 313 | 271 | #define HOPPER_DUART_B 2 |
| r10613 | r10614 | |
| 322 | 280 | UINT8 response; |
| 323 | 281 | }; |
| 324 | 282 | |
| 325 | static const mpu4_chr_table* mpu4_current_chr_table; | |
| 283 | struct ef9369_t | |
| 284 | { | |
| 285 | UINT32 addr; | |
| 286 | UINT16 clut[16]; /* 13-bits - a marking bit and a 444 color */ | |
| 287 | }; | |
| 326 | 288 | |
| 289 | struct bt471_t | |
| 290 | { | |
| 291 | UINT8 address; | |
| 292 | UINT8 addr_cnt; | |
| 293 | UINT8 pixmask; | |
| 294 | UINT8 command; | |
| 295 | rgb_t color; | |
| 296 | }; | |
| 297 | ||
| 298 | ||
| 299 | class mpu4_state : public driver_device | |
| 300 | { | |
| 301 | public: | |
| 302 | mpu4_state(running_machine &machine, const driver_device_config_base &config) | |
| 303 | : driver_device(machine, config) { } | |
| 304 | ||
| 305 | int mod_number; | |
| 306 | int mmtr_data; | |
| 307 | int alpha_data_line; | |
| 308 | int alpha_clock; | |
| 309 | int ay8913_address; | |
| 310 | int serial_data; | |
| 311 | int signal_50hz; | |
| 312 | int ic4_input_b; | |
| 313 | int aux1_input; | |
| 314 | int aux2_input; | |
| 315 | int IC23G1; | |
| 316 | int IC23G2A; | |
| 317 | int IC23G2B; | |
| 318 | int IC23GC; | |
| 319 | int IC23GB; | |
| 320 | int IC23GA; | |
| 321 | int prot_col; | |
| 322 | int lamp_col; | |
| 323 | int reel_flag; | |
| 324 | int ic23_active; | |
| 325 | int led_lamp; | |
| 326 | int link7a_connected; | |
| 327 | emu_timer *ic24_timer; | |
| 328 | int expansion_latch; | |
| 329 | int global_volume; | |
| 330 | int input_strobe; | |
| 331 | UINT8 lamp_strobe; | |
| 332 | UINT8 lamp_strobe2; | |
| 333 | UINT8 lamp_data; | |
| 334 | UINT8 ay_data; | |
| 335 | UINT8 Lamps[224]; | |
| 336 | int optic_pattern; | |
| 337 | int active_reel; | |
| 338 | int remote_meter; | |
| 339 | int reel_mux; | |
| 340 | int lamp_extender; | |
| 341 | int last_b7; | |
| 342 | int last_latch; | |
| 343 | int lamp_sense; | |
| 344 | int card_live; | |
| 345 | int led_extender; | |
| 346 | int hopper; | |
| 347 | const mpu4_chr_table* current_chr_table; | |
| 348 | UINT8 led_segs[40]; | |
| 349 | ||
| 350 | UINT8 m6840_irq_state; | |
| 351 | UINT8 m6850_irq_state; | |
| 352 | UINT8 scn2674_irq_state; | |
| 353 | UINT8 m68k_m6809_line; | |
| 354 | UINT8 m6809_m68k_line; | |
| 355 | UINT8 m68k_acia_cts; | |
| 356 | UINT8 m6809_acia_cts; | |
| 357 | UINT8 m6809_acia_rts; | |
| 358 | UINT8 m6809_acia_dcd; | |
| 359 | int gfx_index; | |
| 360 | UINT16 * vid_vidram; | |
| 361 | UINT16 * vid_mainram; | |
| 362 | UINT8 scn2674_IR[16]; | |
| 363 | UINT8 scn2675_IR_pointer; | |
| 364 | UINT8 scn2674_screen1_l; | |
| 365 | UINT8 scn2674_screen1_h; | |
| 366 | UINT8 scn2674_cursor_l; | |
| 367 | UINT8 scn2674_cursor_h; | |
| 368 | UINT8 scn2674_screen2_l; | |
| 369 | UINT8 scn2674_screen2_h; | |
| 370 | UINT8 scn2674_irq_register; | |
| 371 | UINT8 scn2674_status_register; | |
| 372 | UINT8 scn2674_irq_mask; | |
| 373 | UINT8 scn2674_gfx_enabled; | |
| 374 | UINT8 scn2674_display_enabled; | |
| 375 | UINT8 scn2674_cursor_enabled; | |
| 376 | UINT8 IR0_scn2674_double_ht_wd; | |
| 377 | UINT8 IR0_scn2674_scanline_per_char_row; | |
| 378 | UINT8 IR0_scn2674_sync_select; | |
| 379 | UINT8 IR0_scn2674_buffer_mode_select; | |
| 380 | UINT8 IR1_scn2674_interlace_enable; | |
| 381 | UINT8 IR1_scn2674_equalizing_constant; | |
| 382 | UINT8 IR2_scn2674_row_table; | |
| 383 | UINT8 IR2_scn2674_horz_sync_width; | |
| 384 | UINT8 IR2_scn2674_horz_back_porch; | |
| 385 | UINT8 IR3_scn2674_vert_front_porch; | |
| 386 | UINT8 IR3_scn2674_vert_back_porch; | |
| 387 | UINT8 IR4_scn2674_rows_per_screen; | |
| 388 | UINT8 IR4_scn2674_character_blink_rate; | |
| 389 | UINT8 IR5_scn2674_character_per_row; | |
| 390 | UINT8 IR8_scn2674_display_buffer_first_address_LSB; | |
| 391 | UINT8 IR9_scn2674_display_buffer_first_address_MSB; | |
| 392 | UINT8 IR9_scn2674_display_buffer_last_address; | |
| 393 | UINT8 IR10_scn2674_display_pointer_address_lower; | |
| 394 | UINT8 IR11_scn2674_display_pointer_address_upper; | |
| 395 | UINT8 IR12_scn2674_scroll_start; | |
| 396 | UINT8 IR12_scn2674_split_register_1; | |
| 397 | UINT8 IR13_scn2674_scroll_end; | |
| 398 | UINT8 IR13_scn2674_split_register_2; | |
| 399 | INT8 cur[2]; | |
| 400 | UINT8 *dealem_videoram; | |
| 401 | int rowcounter; | |
| 402 | int linecounter; | |
| 403 | struct ef9369_t pal; | |
| 404 | struct bt471_t bt471; | |
| 405 | }; | |
| 406 | ||
| 327 | 407 | /* |
| 328 | 408 | LED Segments related to pins (5 is not connected): |
| 329 | 409 | Unlike the controllers emulated in the layout code, each |
| r10613 | r10614 | |
| 343 | 423 | 8 display enables (pins 10 - 17) |
| 344 | 424 | */ |
| 345 | 425 | |
| 346 | static UINT8 led_segs[40];//8 regular, up to 32 on extender cards | |
| 347 | 426 | |
| 348 | 427 | |
| 349 | 428 | /* Process lamp and LED data for output system */ |
| r10613 | r10614 | |
| 353 | 432 | } |
| 354 | 433 | |
| 355 | 434 | |
| 356 | static void draw_lamps( | |
| 435 | static void draw_lamps(mpu4_state *state) | |
| 357 | 436 | { |
| 358 | 437 | int i,j; |
| 359 | 438 | |
| 360 | 439 | for (i = 0; i < 8; i++) |
| 361 | 440 | { |
| 362 | output_set_lamp_value((8*input_strobe)+i, (Lamps[(8*input_strobe)+i])); | |
| 363 | output_set_lamp_value((8*input_strobe)+i+64, (Lamps[(8*input_strobe)+i+64])); | |
| 441 | output_set_lamp_value((8*state->input_strobe)+i, (state->Lamps[(8*state->input_strobe)+i])); | |
| 442 | output_set_lamp_value((8*state->input_strobe)+i+64, (state->Lamps[(8*state->input_strobe)+i+64])); | |
| 364 | 443 | } |
| 365 | if (lamp_extender) | |
| 444 | if (state->lamp_extender) | |
| 366 | 445 | { |
| 367 | 446 | for (j = 0; j < 6; j++) |
| 368 | 447 | { |
| 369 | output_set_lamp_value((6*input_strobe)+128+j, (Lamps[(6*input_strobe)+128+j])); | |
| 370 | output_set_lamp_value((6*input_strobe)+176+j, (Lamps[(6*input_strobe)+176+j])); | |
| 448 | output_set_lamp_value((6*state->input_strobe)+128+j, (state->Lamps[(6*state->input_strobe)+128+j])); | |
| 449 | output_set_lamp_value((6*state->input_strobe)+176+j, (state->Lamps[(6*state->input_strobe)+176+j])); | |
| 371 | 450 | } |
| 372 | 451 | } |
| 373 | 452 | } |
| 374 | 453 | |
| 375 | static void update_lamps( | |
| 454 | static void update_lamps(mpu4_state *state) | |
| 376 | 455 | { |
| 377 | 456 | int i,j; |
| 378 | 457 | |
| 379 | 458 | for (i = 0; i < 8; i++) |
| 380 | 459 | { |
| 381 | Lamps[(8*input_strobe)+i] = (lamp_strobe & (1 << i)) != 0; | |
| 382 | Lamps[(8*input_strobe)+i+64] = (lamp_strobe2 & (1 << i)) != 0; | |
| 460 | state->Lamps[(8*state->input_strobe)+i] = (state->lamp_strobe & (1 << i)) != 0; | |
| 461 | state->Lamps[(8*state->input_strobe)+i+64] = (state->lamp_strobe2 & (1 << i)) != 0; | |
| 383 | 462 | } |
| 384 | 463 | |
| 385 | if (led_lamp) | |
| 464 | if (state->led_lamp) | |
| 386 | 465 | { |
| 387 | 466 | /* Some games (like Connect 4) use 'programmable' LED displays, built from light display lines. */ |
| 388 | 467 | UINT8 pled_segs[2] = {0,0}; |
| r10613 | r10614 | |
| 400 | 479 | mpu4_draw_led(9, pled_segs[1]); |
| 401 | 480 | } |
| 402 | 481 | |
| 403 | draw_lamps(); | |
| 404 | mpu4_draw_led(input_strobe, led_segs[input_strobe]); | |
| 405 | if (led_extender) | |
| 482 | draw_lamps(state); | |
| 483 | mpu4_draw_led(state->input_strobe, state->led_segs[state->input_strobe]); | |
| 484 | if (state->led_extender) | |
| 406 | 485 | { |
| 407 | 486 | for (j = 0; j < 5; j++) |
| 408 | 487 | { |
| 409 | mpu4_draw_led(((8*input_strobe)+8+j), led_segs[((8*input_strobe)+8+j)]); | |
| 488 | mpu4_draw_led(((8*state->input_strobe)+8+j), state->led_segs[((8*state->input_strobe)+8+j)]); | |
| 410 | 489 | } |
| 411 | 490 | } |
| 412 | 491 | } |
| 413 | 492 | |
| 414 | static void lamp_extend_small(int data) | |
| 493 | static void lamp_extend_small(mpu4_state *state, int data) | |
| 415 | 494 | { |
| 416 | 495 | int lamp_strobe_ext,column,i; |
| 417 | 496 | column = data & 0x07; |
| r10613 | r10614 | |
| 421 | 500 | { |
| 422 | 501 | for (i = 0; i < 5; i++) |
| 423 | 502 | { |
| 424 | Lamps[(5*column)+i+128] = (lamp_strobe_ext & (1 << i)) != 0; | |
| 503 | state->Lamps[(5*column)+i+128] = (lamp_strobe_ext & (1 << i)) != 0; | |
| 425 | 504 | } |
| 426 | 505 | } |
| 427 | 506 | } |
| 428 | 507 | |
| 429 | static void lamp_extend_largea(int data,int column,int active) | |
| 508 | static void lamp_extend_largea(mpu4_state *state, int data,int column,int active) | |
| 430 | 509 | { |
| 431 | 510 | int lampbase,i,byte7; |
| 432 | 511 | |
| 433 | lamp_sense = 0; | |
| 512 | state->lamp_sense = 0; | |
| 434 | 513 | byte7 = data & 0x80; |
| 435 | if ( byte7 != last_b7 ) | |
| 514 | if ( byte7 != state->last_b7 ) | |
| 436 | 515 | { |
| 437 | 516 | if ( byte7 ) |
| 438 | 517 | { |
| r10613 | r10614 | |
| 444 | 523 | } |
| 445 | 524 | if ( data & 0x3f ) |
| 446 | 525 | { |
| 447 | | |
| 526 | state->lamp_sense = 1; | |
| 448 | 527 | } |
| 449 | 528 | if ( active ) |
| 450 | 529 | { |
| 451 | 530 | for (i = 0; i < 6; i++) |
| 452 | 531 | { |
| 453 | Lamps[(lampbase)+i] = (data & (1 << i)) != 0; | |
| 532 | state->Lamps[(lampbase)+i] = (data & (1 << i)) != 0; | |
| 454 | 533 | } |
| 455 | 534 | } |
| 456 | 535 | } |
| 457 | last_b7 = byte7; | |
| 536 | state->last_b7 = byte7; | |
| 458 | 537 | } |
| 459 | 538 | |
| 460 | static void lamp_extend_largebc(int data,int column,int active) | |
| 539 | static void lamp_extend_largebc(mpu4_state *state, int data,int column,int active) | |
| 461 | 540 | { |
| 462 | 541 | int lampbase,i,byte7; |
| 463 | 542 | |
| 464 | lamp_sense = 0; | |
| 543 | state->lamp_sense = 0; | |
| 465 | 544 | byte7 = data & 0x80; |
| 466 | if ( byte7 != last_b7 ) | |
| 545 | if ( byte7 != state->last_b7 ) | |
| 467 | 546 | { |
| 468 | card_live = 1; | |
| 469 | if ( byte7 ) | |
| 547 | state->card_live = 1; | |
| 548 | if ( byte7 ) | |
| 470 | 549 | { |
| 471 | 550 | lampbase = 128 + column * 8; |
| 472 | 551 | } |
| r10613 | r10614 | |
| 476 | 555 | } |
| 477 | 556 | if ( data & 0x3f ) |
| 478 | 557 | { |
| 479 | lamp_sense = 1; | |
| 558 | state->lamp_sense = 1; | |
| 480 | 559 | } |
| 481 | ||
| 560 | | |
| 482 | 561 | { |
| 483 | 562 | for (i = 0; i < 6; i++) |
| 484 | 563 | { |
| 485 | Lamps[(lampbase)+i] = (data & (1 << i)) != 0; | |
| 564 | state->Lamps[(lampbase)+i] = (data & (1 << i)) != 0; | |
| 486 | 565 | } |
| 487 | 566 | } |
| 488 | last_b7 = byte7; | |
| 567 | state->last_b7 = byte7; | |
| 489 | 568 | } |
| 490 | 569 | else |
| 491 | 570 | { |
| 492 | card_live = 0; | |
| 571 | state->card_live = 0; | |
| 493 | 572 | } |
| 494 | 573 | } |
| 495 | 574 | |
| 496 | static void led_write_latch(int latch, int data, int column) | |
| 575 | static void led_write_latch(mpu4_state *state, int latch, int data, int column) | |
| 497 | 576 | { |
| 498 | 577 | int diff; |
| 499 | 578 | |
| 500 | diff = (latch ^ last_latch) & latch; | |
| 579 | diff = (latch ^ state->last_latch) & latch; | |
| 501 | 580 | column = 7 - column; |
| 502 | 581 | data = ~data;//inverted? |
| 503 | 582 | |
| 504 | 583 | if ( diff & 1 ) |
| 505 | 584 | { |
| 506 | led_segs[column] = data; | |
| 507 | } | |
| 585 | state->led_segs[column] = data; | |
| 586 | } | |
| 508 | 587 | if ( diff & 2 ) |
| 509 | 588 | { |
| 510 | led_segs[8+column] = data; | |
| 589 | state->led_segs[8+column] = data; | |
| 511 | 590 | } |
| 512 | 591 | if ( diff & 4 ) |
| 513 | 592 | { |
| 514 | led_segs[16+column] = data; | |
| 593 | state->led_segs[16+column] = data; | |
| 515 | 594 | } |
| 516 | 595 | if ( diff & 8 ) |
| 517 | 596 | { |
| 518 | led_segs[24+column] = data; | |
| 597 | state->led_segs[24+column] = data; | |
| 519 | 598 | } |
| 520 | 599 | if ( diff & 16 ) |
| 521 | 600 | { |
| 522 | led_segs[32+column] = data; | |
| 601 | state->led_segs[32+column] = data; | |
| 523 | 602 | } |
| 524 | last_latch = diff; | |
| 603 | state->last_latch = diff; | |
| 525 | 604 | } |
| 526 | 605 | |
| 527 | 606 | |
| 528 | static void update_meters( | |
| 607 | static void update_meters(mpu4_state *state) | |
| 529 | 608 | { |
| 530 | 609 | int meter; |
| 531 | int data = ((mmtr_data & 0x7f) | remote_meter); | |
| 532 | switch (reel_mux) | |
| 610 | int data = ((state->mmtr_data & 0x7f) | state->remote_meter); | |
| 611 | switch (state->reel_mux) | |
| 533 | 612 | { |
| 534 | 613 | case STANDARD_REEL: |
| 535 | 614 | // Change nothing |
| r10613 | r10614 | |
| 573 | 652 | { |
| 574 | 653 | MechMtr_update(meter, (data & (1 << meter))); |
| 575 | 654 | } |
| 576 | if (reel_mux == STANDARD_REEL) | |
| 655 | if (state->reel_mux == STANDARD_REEL) | |
| 577 | 656 | { |
| 578 | 657 | for (meter = 4; meter < 7; meter ++) |
| 579 | 658 | { |
| r10613 | r10614 | |
| 583 | 662 | } |
| 584 | 663 | |
| 585 | 664 | /* called if board is reset */ |
| 586 | static void mpu4_stepper_reset( | |
| 665 | static void mpu4_stepper_reset(mpu4_state *state) | |
| 587 | 666 | { |
| 588 | 667 | int pattern = 0,reel; |
| 589 | 668 | for (reel = 0; reel < 6; reel++) |
| r10613 | r10614 | |
| 591 | 670 | stepper_reset_position(reel); |
| 592 | 671 | if (stepper_optic_state(reel)) pattern |= 1<<reel; |
| 593 | 672 | } |
| 594 | optic_pattern = pattern; | |
| 673 | state->optic_pattern = pattern; | |
| 595 | 674 | } |
| 596 | 675 | |
| 597 | 676 | |
| 598 | 677 | static MACHINE_RESET( mpu4 ) |
| 599 | 678 | { |
| 679 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 600 | 680 | ROC10937_reset(0); /* reset display1 */ |
| 601 | 681 | |
| 602 | mpu4_stepper_reset(); | |
| 682 | mpu4_stepper_reset(state); | |
| 603 | 683 | |
| 604 | lamp_strobe = 0; | |
| 605 | lamp_strobe2 = 0; | |
| 606 | lamp_data = 0; | |
| 684 | state->lamp_strobe = 0; | |
| 685 | state->lamp_strobe2 = 0; | |
| 686 | state->lamp_data = 0; | |
| 607 | 687 | |
| 608 | IC23GC = 0; | |
| 609 | IC23GB = 0; | |
| 610 | IC23GA = 0; | |
| 611 | IC23G1 = 1; | |
| 612 | IC23G2A = 0; | |
| 613 | IC23G2B = 0; | |
| 688 | state->IC23GC = 0; | |
| 689 | state->IC23GB = 0; | |
| 690 | state->IC23GA = 0; | |
| 691 | state->IC23G1 = 1; | |
| 692 | state->IC23G2A = 0; | |
| 693 | state->IC23G2B = 0; | |
| 614 | 694 | |
| 615 | prot_col = 0; | |
| 695 | state->prot_col = 0; | |
| 616 | 696 | |
| 617 | 697 | /* init rom bank, some games don't set this */ |
| 618 | 698 | { |
| r10613 | r10614 | |
| 630 | 710 | /* 6809 IRQ handler */ |
| 631 | 711 | static WRITE_LINE_DEVICE_HANDLER( cpu0_irq ) |
| 632 | 712 | { |
| 713 | mpu4_state *drvstate = device->machine->driver_data<mpu4_state>(); | |
| 633 | 714 | device_t *pia3 = device->machine->device("pia_ic3"); |
| 634 | 715 | device_t *pia4 = device->machine->device("pia_ic4"); |
| 635 | 716 | device_t *pia5 = device->machine->device("pia_ic5"); |
| r10613 | r10614 | |
| 647 | 728 | pia6821_get_irq_a(pia8) | pia6821_get_irq_b(pia8) | |
| 648 | 729 | ptm6840_get_irq(ptm2); |
| 649 | 730 | |
| 650 | if (!link7a_connected) //7B = IRQ, 7A = FIRQ, both = NMI | |
| 731 | if (!drvstate->link7a_connected) //7B = IRQ, 7A = FIRQ, both = NMI | |
| 651 | 732 | { |
| 652 | 733 | cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); |
| 653 | 734 | LOG(("6809 int%d \n", combined_state)); |
| r10613 | r10614 | |
| 717 | 798 | /* IC3, lamp data lines + alpha numeric display */ |
| 718 | 799 | static WRITE8_DEVICE_HANDLER( pia_ic3_porta_w ) |
| 719 | 800 | { |
| 801 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 720 | 802 | LOG_IC3(("%s: IC3 PIA Port A Set to %2x (lamp strobes 1 - 9)\n", device->machine->describe_context(),data)); |
| 721 | 803 | |
| 722 | if(ic23_active) | |
| 804 | if(state->ic23_active) | |
| 723 | 805 | { |
| 724 | lamp_strobe = data; | |
| 806 | state->lamp_strobe = data; | |
| 725 | 807 | } |
| 726 | 808 | } |
| 727 | 809 | |
| 728 | 810 | |
| 729 | 811 | static WRITE8_DEVICE_HANDLER( pia_ic3_portb_w ) |
| 730 | 812 | { |
| 813 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 731 | 814 | LOG_IC3(("%s: IC3 PIA Port B Set to %2x (lamp strobes 10 - 17)\n", device->machine->describe_context(),data)); |
| 732 | 815 | |
| 733 | if(ic23_active) | |
| 816 | if(state->ic23_active) | |
| 734 | 817 | { |
| 735 | lamp_strobe2 = data; | |
| 818 | state->lamp_strobe2 = data; | |
| 736 | 819 | } |
| 737 | 820 | } |
| 738 | 821 | |
| 739 | 822 | |
| 740 | 823 | static WRITE_LINE_DEVICE_HANDLER( pia_ic3_ca2_w ) |
| 741 | 824 | { |
| 825 | mpu4_state *drvstate = device->machine->driver_data<mpu4_state>(); | |
| 742 | 826 | LOG_IC3(("%s: IC3 PIA Write CA2 (alpha data), %02X\n", device->machine->describe_context(),state)); |
| 743 | 827 | |
| 744 | alpha_data_line = state; | |
| 828 | drvstate->alpha_data_line = state; | |
| 745 | 829 | ROC10937_draw_16seg(0); |
| 746 | 830 | } |
| 747 | 831 | |
| r10613 | r10614 | |
| 779 | 863 | |
| 780 | 864 | It is used as a multiplexer for the LEDs, lamp selects and inputs.*/ |
| 781 | 865 | |
| 782 | static void ic23_update( | |
| 866 | static void ic23_update(mpu4_state *state) | |
| 783 | 867 | { |
| 784 | if (!IC23G2A) | |
| 868 | if (!state->IC23G2A) | |
| 785 | 869 | { |
| 786 | if (!IC23G2B) | |
| 870 | if (!state->IC23G2B) | |
| 787 | 871 | { |
| 788 | if (IC23G1) | |
| 872 | if (state->IC23G1) | |
| 789 | 873 | { |
| 790 | if ( IC23GA ) input_strobe |= 0x01; | |
| 791 | else input_strobe &= ~0x01; | |
| 874 | if ( state->IC23GA ) state->input_strobe |= 0x01; | |
| 875 | else state->input_strobe &= ~0x01; | |
| 792 | 876 | |
| 793 | if ( IC23GB ) input_strobe |= 0x02; | |
| 794 | else input_strobe &= ~0x02; | |
| 877 | if ( state->IC23GB ) state->input_strobe |= 0x02; | |
| 878 | else state->input_strobe &= ~0x02; | |
| 795 | 879 | |
| 796 | if ( IC23GC ) input_strobe |= 0x04; | |
| 797 | else input_strobe &= ~0x04; | |
| 880 | if ( state->IC23GC ) state->input_strobe |= 0x04; | |
| 881 | else state->input_strobe &= ~0x04; | |
| 798 | 882 | } |
| 799 | 883 | } |
| 800 | 884 | } |
| 801 | 885 | else |
| 802 | if ((IC23G2A)||(IC23G2B)) | |
| 886 | if ((state->IC23G2A)||(state->IC23G2B)) | |
| 803 | 887 | { |
| 804 | input_strobe = 0x00; | |
| 888 | state->input_strobe = 0x00; | |
| 805 | 889 | } |
| 806 | 890 | } |
| 807 | 891 | |
| r10613 | r10614 | |
| 814 | 898 | CLEAR and B2 are tied high and A1 and A2 tied low, meaning any pulse |
| 815 | 899 | on B1 will give a low pulse on the output pin. |
| 816 | 900 | */ |
| 817 | static void ic24_output(int data) | |
| 901 | static void ic24_output(mpu4_state *state, int data) | |
| 818 | 902 | { |
| 819 | IC23G2A = data; | |
| 820 | ic23_update(); | |
| 903 | state->IC23G2A = data; | |
| 904 | ic23_update(state); | |
| 821 | 905 | } |
| 822 | 906 | |
| 823 | 907 | |
| 824 | static void ic24_setup( | |
| 908 | static void ic24_setup(mpu4_state *state) | |
| 825 | 909 | { |
| 826 | if (IC23GA) | |
| 910 | if (state->IC23GA) | |
| 827 | 911 | { |
| 828 | 912 | double duration = TIME_OF_74LS123((220*1000),(0.1*0.000001)); |
| 829 | 913 | { |
| 830 | ic23_active=1; | |
| 831 | ic24_output(0); | |
| 832 | ic24_timer->adjust(attotime::from_double(duration)); | |
| 914 | state->ic23_active=1; | |
| 915 | ic24_output(state, 0); | |
| 916 | state->ic24_timer->adjust(attotime::from_double(duration)); | |
| 833 | 917 | } |
| 834 | 918 | } |
| 835 | 919 | } |
| r10613 | r10614 | |
| 837 | 921 | |
| 838 | 922 | static TIMER_CALLBACK( ic24_timeout ) |
| 839 | 923 | { |
| 840 | ic23_active=0; | |
| 841 | ic24_output(1); | |
| 924 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 925 | state->ic23_active=0; | |
| 926 | ic24_output(state, 1); | |
| 842 | 927 | } |
| 843 | 928 | |
| 844 | 929 | |
| 845 | 930 | /* IC4, 7 seg leds, 50Hz timer reel sensors, current sensors */ |
| 846 | 931 | static WRITE8_DEVICE_HANDLER( pia_ic4_porta_w ) |
| 847 | 932 | { |
| 848 | if(ic23_active) | |
| 933 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 934 | if(state->ic23_active) | |
| 849 | 935 | { |
| 850 | if (((lamp_extender == NO_EXTENDER)||(lamp_extender == SMALL_CARD)||(lamp_extender == LARGE_CARD_C))&& (led_extender == NO_EXTENDER)) | |
| 851 | led_segs[input_strobe] = data; | |
| 936 | if (((state->lamp_extender == NO_EXTENDER)||(state->lamp_extender == SMALL_CARD)||(state->lamp_extender == LARGE_CARD_C))&& (state->led_extender == NO_EXTENDER)) | |
| 937 | state->led_segs[state->input_strobe] = data; | |
| 852 | 938 | } |
| 853 | 939 | } |
| 854 | 940 | |
| 855 | 941 | static WRITE8_DEVICE_HANDLER( pia_ic4_portb_w ) |
| 856 | 942 | { |
| 857 | if (reel_mux) | |
| 943 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 944 | if (state->reel_mux) | |
| 858 | 945 | { |
| 859 | 946 | /* A write here connects one reel (and only one) |
| 860 | 947 | to the optic test circuit. This allows 8 reels |
| 861 | 948 | to be supported instead of 4. */ |
| 862 | if (reel_mux == SEVEN_REEL) | |
| 949 | if (state->reel_mux == SEVEN_REEL) | |
| 863 | 950 | { |
| 864 | active_reel= reel_mux_table7[(data >> 4) & 0x07]; | |
| 951 | state->active_reel= reel_mux_table7[(data >> 4) & 0x07]; | |
| 865 | 952 | } |
| 866 | 953 | else |
| 867 | active_reel= reel_mux_table[(data >> 4) & 0x07]; | |
| 954 | state->active_reel= reel_mux_table[(data >> 4) & 0x07]; | |
| 868 | 955 | } |
| 869 | 956 | } |
| 870 | 957 | |
| 871 | 958 | |
| 872 | 959 | static READ8_DEVICE_HANDLER( pia_ic4_portb_r ) |
| 873 | 960 | { |
| 874 | if ( serial_data ) | |
| 961 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 962 | if ( state->serial_data ) | |
| 875 | 963 | { |
| 876 | ic4_input_b |= 0x80; | |
| 964 | state->ic4_input_b |= 0x80; | |
| 877 | 965 | pia6821_cb1_w(device, 1); |
| 878 | 966 | } |
| 879 | 967 | else |
| 880 | 968 | { |
| 881 | ic4_input_b &= ~0x80; | |
| 969 | state->ic4_input_b &= ~0x80; | |
| 882 | 970 | pia6821_cb1_w(device, 0); |
| 883 | 971 | } |
| 884 | 972 | |
| 885 | if (!reel_mux) | |
| 973 | if (!state->reel_mux) | |
| 886 | 974 | { |
| 887 | if ( optic_pattern & 0x01 ) ic4_input_b |= 0x40; /* reel A tab */ | |
| 888 | else ic4_input_b &= ~0x40; | |
| 975 | if ( state->optic_pattern & 0x01 ) state->ic4_input_b |= 0x40; /* reel A tab */ | |
| 976 | else state->ic4_input_b &= ~0x40; | |
| 889 | 977 | |
| 890 | if ( optic_pattern & 0x02 ) ic4_input_b |= 0x20; /* reel B tab */ | |
| 891 | else ic4_input_b &= ~0x20; | |
| 978 | if ( state->optic_pattern & 0x02 ) state->ic4_input_b |= 0x20; /* reel B tab */ | |
| 979 | else state->ic4_input_b &= ~0x20; | |
| 892 | 980 | |
| 893 | if ( optic_pattern & 0x04 ) ic4_input_b |= 0x10; /* reel C tab */ | |
| 894 | else ic4_input_b &= ~0x10; | |
| 981 | if ( state->optic_pattern & 0x04 ) state->ic4_input_b |= 0x10; /* reel C tab */ | |
| 982 | else state->ic4_input_b &= ~0x10; | |
| 895 | 983 | |
| 896 | if ( optic_pattern & 0x08 ) ic4_input_b |= 0x08; /* reel D tab */ | |
| 897 | else ic4_input_b &= ~0x08; | |
| 984 | if ( state->optic_pattern & 0x08 ) state->ic4_input_b |= 0x08; /* reel D tab */ | |
| 985 | else state->ic4_input_b &= ~0x08; | |
| 898 | 986 | |
| 899 | 987 | } |
| 900 | 988 | else |
| 901 | 989 | { |
| 902 | if (stepper_optic_state(active_reel)) | |
| 990 | if (stepper_optic_state(state->active_reel)) | |
| 903 | 991 | { |
| 904 | ic4_input_b |= 0x08; | |
| 992 | state->ic4_input_b |= 0x08; | |
| 905 | 993 | } |
| 906 | 994 | else |
| 907 | 995 | { |
| 908 | ic4_input_b &= ~0x08; | |
| 996 | state->ic4_input_b &= ~0x08; | |
| 909 | 997 | } |
| 910 | 998 | } |
| 911 | if ( signal_50hz ) ic4_input_b |= 0x04; /* 50 Hz */ | |
| 912 | else ic4_input_b &= ~0x04; | |
| 999 | if ( state->signal_50hz ) state->ic4_input_b |= 0x04; /* 50 Hz */ | |
| 1000 | else state->ic4_input_b &= ~0x04; | |
| 913 | 1001 | |
| 914 | if (ic4_input_b & 0x02) | |
| 1002 | if (state->ic4_input_b & 0x02) | |
| 915 | 1003 | { |
| 916 | ic4_input_b &= ~0x02; | |
| 1004 | state->ic4_input_b &= ~0x02; | |
| 917 | 1005 | } |
| 918 | 1006 | else |
| 919 | 1007 | { |
| 920 | ic4_input_b |= 0x02; //Pulse the overcurrent line with every read to show the CPU each lamp has lit | |
| 1008 | state->ic4_input_b |= 0x02; //Pulse the overcurrent line with every read to show the CPU each lamp has lit | |
| 921 | 1009 | } |
| 922 | 1010 | #ifdef UNUSED_FUNCTION |
| 923 | if ( lamp_undercurrent ) ic4_input_b |= 0x01; | |
| 1011 | if ( lamp_undercurrent ) state->ic4_input_b |= 0x01; | |
| 924 | 1012 | #endif |
| 925 | 1013 | |
| 926 | LOG_IC3(("%s: IC4 PIA Read of Port B %x\n",device->machine->describe_context(),ic4_input_b)); | |
| 927 | return ic4_input_b; | |
| 1014 | LOG_IC3(("%s: IC4 PIA Read of Port B %x\n",device->machine->describe_context(),state->ic4_input_b)); | |
| 1015 | return state->ic4_input_b; | |
| 928 | 1016 | } |
| 929 | 1017 | |
| 930 | 1018 | |
| 931 | 1019 | static WRITE_LINE_DEVICE_HANDLER( pia_ic4_ca2_w ) |
| 932 | 1020 | { |
| 1021 | mpu4_state *drvstate = device->machine->driver_data<mpu4_state>(); | |
| 933 | 1022 | LOG_IC3(("%s: IC4 PIA Write CA (input MUX strobe /LED B), %02X\n", device->machine->describe_context(),state)); |
| 934 | 1023 | |
| 935 | IC23GB = state; | |
| 936 | ic23_update(); | |
| 1024 | drvstate->IC23GB = state; | |
| 1025 | ic23_update(drvstate); | |
| 937 | 1026 | } |
| 938 | 1027 | |
| 939 | 1028 | static WRITE_LINE_DEVICE_HANDLER( pia_ic4_cb2_w ) |
| 940 | 1029 | { |
| 1030 | mpu4_state *drvstate = device->machine->driver_data<mpu4_state>(); | |
| 941 | 1031 | LOG_IC3(("%s: IC4 PIA Write CA (input MUX strobe /LED B), %02X\n", device->machine->describe_context(),state)); |
| 942 | reel_flag=state; | |
| 1032 | drvstate->reel_flag=state; | |
| 943 | 1033 | } |
| 944 | 1034 | static const pia6821_interface pia_ic4_intf = |
| 945 | 1035 | { |
| r10613 | r10614 | |
| 960 | 1050 | /* IC5, AUX ports, coin lockouts and AY sound chip select (MODs below 4 only) */ |
| 961 | 1051 | static READ8_DEVICE_HANDLER( pia_ic5_porta_r ) |
| 962 | 1052 | { |
| 963 | if (lamp_extender == LARGE_CARD_A) | |
| 1053 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 1054 | if (state->lamp_extender == LARGE_CARD_A) | |
| 964 | 1055 | { |
| 965 | if (lamp_sense && ic23_active) | |
| 1056 | if (state->lamp_sense && state->ic23_active) | |
| 966 | 1057 | { |
| 967 | aux1_input |= 0x40; | |
| 1058 | state->aux1_input |= 0x40; | |
| 968 | 1059 | } |
| 969 | 1060 | else |
| 970 | 1061 | { |
| 971 | aux1_input &= ~0x40; //Pulse the overcurrent line with every read to show the CPU each lamp has lit | |
| 1062 | state->aux1_input &= ~0x40; //Pulse the overcurrent line with every read to show the CPU each lamp has lit | |
| 972 | 1063 | } |
| 973 | 1064 | } |
| 974 | if (hopper == HOPPER_NONDUART_A) | |
| 1065 | if (state->hopper == HOPPER_NONDUART_A) | |
| 975 | 1066 | { |
| 976 | 1067 | /* if (hopper1_active) |
| 977 | 1068 | { |
| 978 | aux1_input |= 0x04; | |
| 1069 | state->aux1_input |= 0x04; | |
| 979 | 1070 | } |
| 980 | 1071 | else |
| 981 | 1072 | { |
| 982 | aux1_input &= ~0x04; | |
| 1073 | state->aux1_input &= ~0x04; | |
| 983 | 1074 | }*/ |
| 984 | 1075 | } |
| 985 | 1076 | LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",device->machine->describe_context())); |
| 986 | 1077 | |
| 987 | return input_port_read(device->machine, "AUX1")|aux1_input; | |
| 1078 | return input_port_read(device->machine, "AUX1")|state->aux1_input; | |
| 988 | 1079 | } |
| 989 | 1080 | |
| 990 | 1081 | static WRITE8_DEVICE_HANDLER( pia_ic5_porta_w ) |
| 991 | 1082 | { |
| 1083 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 992 | 1084 | device_t *pia_ic4 = device->machine->device("pia_ic5"); |
| 993 | if (hopper == HOPPER_NONDUART_A) | |
| 1085 | if (state->hopper == HOPPER_NONDUART_A) | |
| 994 | 1086 | { |
| 995 | 1087 | //hopper1_drive_sensor(data&0x10); |
| 996 | 1088 | } |
| 997 | switch (lamp_extender) | |
| 1089 | switch (state->lamp_extender) | |
| 998 | 1090 | { |
| 999 | 1091 | case NO_EXTENDER: |
| 1000 | if (led_extender == CARD_B) | |
| 1092 | if (state->led_extender == CARD_B) | |
| 1001 | 1093 | { |
| 1002 | led_write_latch(data & 0x1f, pia6821_get_output_a(pia_ic4),input_strobe); | |
| 1094 | led_write_latch(state, data & 0x1f, pia6821_get_output_a(pia_ic4),state->input_strobe); | |
| 1003 | 1095 | } |
| 1004 | else if ((led_extender != CARD_A)||(led_extender != NO_EXTENDER)) | |
| 1096 | else if ((state->led_extender != CARD_A)||(state->led_extender != NO_EXTENDER)) | |
| 1005 | 1097 | { |
| 1006 | led_segs[(input_strobe+8)] = data; | |
| 1098 | state->led_segs[(state->input_strobe+8)] = data; | |
| 1007 | 1099 | } |
| 1008 | 1100 | break; |
| 1009 | 1101 | case SMALL_CARD: |
| 1010 | if(ic23_active) | |
| 1102 | if(state->ic23_active) | |
| 1011 | 1103 | { |
| 1012 | lamp_extend_small(data); | |
| 1104 | lamp_extend_small(state, data); | |
| 1013 | 1105 | } |
| 1014 | 1106 | break; |
| 1015 | 1107 | case LARGE_CARD_A: |
| 1016 | lamp_extend_largea(data,input_strobe,ic23_active); | |
| 1108 | lamp_extend_largea(state,data,state->input_strobe,state->ic23_active); | |
| 1017 | 1109 | break; |
| 1018 | 1110 | case LARGE_CARD_B: |
| 1019 | lamp_extend_largebc(data,input_strobe,ic23_active); | |
| 1020 | if ((ic23_active) && card_live) | |
| 1111 | lamp_extend_largebc(state,data,state->input_strobe,state->ic23_active); | |
| 1112 | if ((state->ic23_active) && state->card_live) | |
| 1021 | 1113 | { |
| 1022 | led_segs[(8*(last_b7 >>7))+input_strobe] = (~data); | |
| 1114 | state->led_segs[(8*(state->last_b7 >>7))+state->input_strobe] = (~data); | |
| 1023 | 1115 | } |
| 1024 | 1116 | break; |
| 1025 | 1117 | case LARGE_CARD_C: |
| 1026 | lamp_extend_largebc(data,input_strobe,ic23_active); | |
| 1118 | lamp_extend_largebc(state,data,state->input_strobe,state->ic23_active); | |
| 1027 | 1119 | break; |
| 1028 | 1120 | } |
| 1029 | if (reel_mux == SIX_REEL_5TO8) | |
| 1121 | if (state->reel_mux == SIX_REEL_5TO8) | |
| 1030 | 1122 | { |
| 1031 | 1123 | stepper_update(4, data&0x0F); |
| 1032 | 1124 | stepper_update(5, (data >> 4)&0x0F); |
| r10613 | r10614 | |
| 1034 | 1126 | awp_draw_reel(5); |
| 1035 | 1127 | } |
| 1036 | 1128 | else |
| 1037 | if (reel_mux == SEVEN_REEL) | |
| 1129 | if (state->reel_mux == SEVEN_REEL) | |
| 1038 | 1130 | { |
| 1039 | 1131 | stepper_update(1, data&0x0F); |
| 1040 | 1132 | stepper_update(2, (data >> 4)&0x0F); |
| r10613 | r10614 | |
| 1046 | 1138 | |
| 1047 | 1139 | static WRITE8_DEVICE_HANDLER( pia_ic5_portb_w ) |
| 1048 | 1140 | { |
| 1049 | if (hopper == HOPPER_NONDUART_B) | |
| 1141 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 1142 | if (state->hopper == HOPPER_NONDUART_B) | |
| 1050 | 1143 | { |
| 1051 | 1144 | //hopper1_drive_motor(data &0x01) |
| 1052 | 1145 | //hopper1_drive_sensor(data &0x08) |
| 1053 | 1146 | } |
| 1054 | if (led_extender == CARD_A) | |
| 1147 | if (state->led_extender == CARD_A) | |
| 1055 | 1148 | { |
| 1056 | // led_write_latch(data & 0x07, pia_get_output_a(pia_ic4),input_strobe) | |
| 1149 | // led_write_latch(state, data & 0x07, pia_get_output_a(pia_ic4),state->input_strobe) | |
| 1057 | 1150 | } |
| 1058 | 1151 | } |
| 1059 | 1152 | static READ8_DEVICE_HANDLER( pia_ic5_portb_r ) |
| 1060 | 1153 | { |
| 1154 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 1061 | 1155 | device_t *pia_ic5 = device->machine->device("pia_ic5"); |
| 1062 | if (hopper == HOPPER_NONDUART_B) | |
| 1156 | if (state->hopper == HOPPER_NONDUART_B) | |
| 1063 | 1157 | {/* |
| 1064 | 1158 | if (hopper1_active) |
| 1065 | 1159 | { |
| 1066 | aux2_input |= 0x08; | |
| 1160 | state->aux2_input |= 0x08; | |
| 1067 | 1161 | } |
| 1068 | 1162 | else |
| 1069 | 1163 | { |
| 1070 | aux2_input &= ~0x08; | |
| 1164 | state->aux2_input &= ~0x08; | |
| 1071 | 1165 | }*/ |
| 1072 | 1166 | } |
| 1073 | 1167 | |
| r10613 | r10614 | |
| 1076 | 1170 | coin_lockout_w(device->machine, 1, (pia6821_get_output_b(pia_ic5) & 0x02) ); |
| 1077 | 1171 | coin_lockout_w(device->machine, 2, (pia6821_get_output_b(pia_ic5) & 0x04) ); |
| 1078 | 1172 | coin_lockout_w(device->machine, 3, (pia6821_get_output_b(pia_ic5) & 0x08) ); |
| 1079 | return input_port_read(device->machine, "AUX2") | aux2_input; | |
| 1173 | return input_port_read(device->machine, "AUX2") | state->aux2_input; | |
| 1080 | 1174 | } |
| 1081 | 1175 | |
| 1082 | 1176 | |
| 1083 | 1177 | static WRITE_LINE_DEVICE_HANDLER( pia_ic5_ca2_w ) |
| 1084 | 1178 | { |
| 1179 | mpu4_state *drvstate = device->machine->driver_data<mpu4_state>(); | |
| 1085 | 1180 | LOG(("%s: IC5 PIA Write CA2 (Serial Tx) %2x\n",device->machine->describe_context(),state)); |
| 1086 | serial_data = state; | |
| 1181 | drvstate->serial_data = state; | |
| 1087 | 1182 | } |
| 1088 | 1183 | |
| 1089 | 1184 | |
| r10613 | r10614 | |
| 1112 | 1207 | /* PSG function selected */ |
| 1113 | 1208 | static void update_ay(device_t *device) |
| 1114 | 1209 | { |
| 1210 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 1115 | 1211 | if (!pia6821_get_output_cb2(device)) |
| 1116 | 1212 | { |
| 1117 | switch (ay8913_address) | |
| 1213 | switch (state->ay8913_address) | |
| 1118 | 1214 | { |
| 1119 | 1215 | case 0x00: |
| 1120 | 1216 | { |
| 1121 | 1217 | /* Inactive */ |
| 1122 | 1218 | break; |
| 1123 | | |
| 1219 | | |
| 1124 | 1220 | case 0x01: |
| 1125 | 1221 | { /* CA2 = 1 CB2 = 0? : Read from selected PSG register and make the register data available to Port A */ |
| 1126 | 1222 | device_t *pia_ic6 = device->machine->device("pia_ic6"); |
| r10613 | r10614 | |
| 1179 | 1275 | /* IC6, Reel A and B and AY registers (MODs below 4 only) */ |
| 1180 | 1276 | static WRITE8_DEVICE_HANDLER( pia_ic6_portb_w ) |
| 1181 | 1277 | { |
| 1278 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 1182 | 1279 | LOG(("%s: IC6 PIA Port B Set to %2x (Reel A and B)\n", device->machine->describe_context(),data)); |
| 1183 | 1280 | |
| 1184 | if (reel_mux == SEVEN_REEL) | |
| 1281 | if (state->reel_mux == SEVEN_REEL) | |
| 1185 | 1282 | { |
| 1186 | 1283 | stepper_update(3, data&0x0F); |
| 1187 | 1284 | stepper_update(4, (data >> 4)&0x0F); |
| r10613 | r10614 | |
| 1196 | 1293 | awp_draw_reel(1); |
| 1197 | 1294 | } |
| 1198 | 1295 | |
| 1199 | if (reel_flag && (reel_mux == STANDARD_REEL)) | |
| 1296 | if (state->reel_flag && (state->reel_mux == STANDARD_REEL)) | |
| 1200 | 1297 | { |
| 1201 | if ( stepper_optic_state(0) ) optic_pattern |= 0x01; | |
| 1202 | else optic_pattern &= ~0x01; | |
| 1298 | if ( stepper_optic_state(0) ) state->optic_pattern |= 0x01; | |
| 1299 | else state->optic_pattern &= ~0x01; | |
| 1203 | 1300 | |
| 1204 | if ( stepper_optic_state(1) ) optic_pattern |= 0x02; | |
| 1205 | else optic_pattern &= ~0x02; | |
| 1301 | if ( stepper_optic_state(1) ) state->optic_pattern |= 0x02; | |
| 1302 | else state->optic_pattern &= ~0x02; | |
| 1206 | 1303 | } |
| 1207 | 1304 | } |
| 1208 | 1305 | |
| 1209 | 1306 | |
| 1210 | 1307 | static WRITE8_DEVICE_HANDLER( pia_ic6_porta_w ) |
| 1211 | 1308 | { |
| 1309 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 1212 | 1310 | LOG(("%s: IC6 PIA Write A %2x\n", device->machine->describe_context(),data)); |
| 1213 | if (mod_number <4) | |
| 1311 | if (state->mod_number <4) | |
| 1214 | 1312 | { |
| 1215 | ay_data = data; | |
| 1216 | update_ay(device); | |
| 1313 | state->ay_data = data; | |
| 1314 | update_ay(device); | |
| 1217 | 1315 | } |
| 1218 | 1316 | } |
| 1219 | 1317 | |
| 1220 | 1318 | |
| 1221 | 1319 | static WRITE_LINE_DEVICE_HANDLER( pia_ic6_ca2_w ) |
| 1222 | 1320 | { |
| 1321 | mpu4_state *drvstate = device->machine->driver_data<mpu4_state>(); | |
| 1223 | 1322 | LOG(("%s: IC6 PIA write CA2 %2x (AY8913 BC1)\n", device->machine->describe_context(),state)); |
| 1224 | if (mod_number <4) | |
| 1323 | if (drvstate->mod_number <4) | |
| 1225 | 1324 | { |
| 1226 | if ( state ) ay8913_address |= 0x01; | |
| 1227 | else ay8913_address &= ~0x01; | |
| 1325 | if ( state ) drvstate->ay8913_address |= 0x01; | |
| 1326 | else drvstate->ay8913_address &= ~0x01; | |
| 1228 | 1327 | update_ay(device); |
| 1229 | 1328 | } |
| 1230 | 1329 | } |
| r10613 | r10614 | |
| 1232 | 1331 | |
| 1233 | 1332 | static WRITE_LINE_DEVICE_HANDLER( pia_ic6_cb2_w ) |
| 1234 | 1333 | { |
| 1334 | mpu4_state *drvstate = device->machine->driver_data<mpu4_state>(); | |
| 1235 | 1335 | LOG(("%s: IC6 PIA write CB2 %2x (AY8913 BCDIR)\n", device->machine->describe_context(),state)); |
| 1236 | if (mod_number <4) | |
| 1336 | if (drvstate->mod_number <4) | |
| 1237 | 1337 | { |
| 1238 | if ( state ) ay8913_address |= 0x02; | |
| 1239 | else ay8913_address &= ~0x02; | |
| 1338 | if ( state ) drvstate->ay8913_address |= 0x02; | |
| 1339 | else drvstate->ay8913_address &= ~0x02; | |
| 1240 | 1340 | update_ay(device); |
| 1241 | 1341 | } |
| 1242 | 1342 | } |
| r10613 | r10614 | |
| 1262 | 1362 | /* IC7 Reel C and D, mechanical meters/Reel E and F, input strobe bit A */ |
| 1263 | 1363 | static WRITE8_DEVICE_HANDLER( pia_ic7_porta_w ) |
| 1264 | 1364 | { |
| 1365 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 1265 | 1366 | LOG(("%s: IC7 PIA Port A Set to %2x (Reel C and D)\n", device->machine->describe_context(),data)); |
| 1266 | if (reel_mux == SEVEN_REEL) | |
| 1367 | if (state->reel_mux == SEVEN_REEL) | |
| 1267 | 1368 | { |
| 1268 | 1369 | stepper_update(5, data&0x0F); |
| 1269 | 1370 | stepper_update(6, (data >> 4)&0x0F); |
| r10613 | r10614 | |
| 1278 | 1379 | awp_draw_reel(3); |
| 1279 | 1380 | } |
| 1280 | 1381 | |
| 1281 | if (reel_flag && (reel_mux == STANDARD_REEL)) | |
| 1382 | if (state->reel_flag && (state->reel_mux == STANDARD_REEL)) | |
| 1282 | 1383 | { |
| 1283 | if ( stepper_optic_state(2) ) optic_pattern |= 0x04; | |
| 1284 | else optic_pattern &= ~0x04; | |
| 1285 | if ( stepper_optic_state(3) ) optic_pattern |= 0x08; | |
| 1286 | else optic_pattern &= ~0x08; | |
| 1384 | if ( stepper_optic_state(2) ) state->optic_pattern |= 0x04; | |
| 1385 | else state->optic_pattern &= ~0x04; | |
| 1386 | if ( stepper_optic_state(3) ) state->optic_pattern |= 0x08; | |
| 1387 | else state->optic_pattern &= ~0x08; | |
| 1287 | 1388 | } |
| 1288 | 1389 | } |
| 1289 | 1390 | |
| 1290 | 1391 | static WRITE8_DEVICE_HANDLER( pia_ic7_portb_w ) |
| 1291 | 1392 | { |
| 1292 | if (hopper == HOPPER_DUART_A) | |
| 1393 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 1394 | if (state->hopper == HOPPER_DUART_A) | |
| 1293 | 1395 | { |
| 1294 | 1396 | //duart write data |
| 1295 | 1397 | } |
| 1296 | else if (hopper == HOPPER_NONDUART_A) | |
| 1398 | else if (state->hopper == HOPPER_NONDUART_A) | |
| 1297 | 1399 | { |
| 1298 | 1400 | //hoppr1_drive_motor(data & 0x10); |
| 1299 | 1401 | } |
| 1300 | 1402 | |
| 1301 | mmtr_data = data; | |
| 1403 | state->mmtr_data = data; | |
| 1302 | 1404 | } |
| 1303 | 1405 | |
| 1304 | 1406 | static READ8_DEVICE_HANDLER( pia_ic7_portb_r ) |
| r10613 | r10614 | |
| 1338 | 1440 | |
| 1339 | 1441 | static WRITE_LINE_DEVICE_HANDLER( pia_ic7_ca2_w ) |
| 1340 | 1442 | { |
| 1443 | mpu4_state *drvstate = device->machine->driver_data<mpu4_state>(); | |
| 1341 | 1444 | LOG(("%s: IC7 PIA write CA2 %2x (input strobe bit 0 / LED A)\n", device->machine->describe_context(),state)); |
| 1342 | 1445 | |
| 1343 | IC23GA = state; | |
| 1344 | ic24_setup(); | |
| 1345 | ic23_update(); | |
| 1446 | drvstate->IC23GA = state; | |
| 1447 | ic24_setup(drvstate); | |
| 1448 | ic23_update(drvstate); | |
| 1346 | 1449 | } |
| 1347 | 1450 | |
| 1348 | 1451 | static WRITE_LINE_DEVICE_HANDLER( pia_ic7_cb2_w ) |
| 1349 | 1452 | { |
| 1350 | remote_meter = state?0x80:0x00; | |
| 1453 | mpu4_state *drvstate = device->machine->driver_data<mpu4_state>(); | |
| 1454 | drvstate->remote_meter = state?0x80:0x00; | |
| 1351 | 1455 | } |
| 1352 | 1456 | |
| 1353 | 1457 | static const pia6821_interface pia_ic7_intf = |
| r10613 | r10614 | |
| 1370 | 1474 | /* IC8, Inputs, TRIACS, alpha clock */ |
| 1371 | 1475 | static READ8_DEVICE_HANDLER( pia_ic8_porta_r ) |
| 1372 | 1476 | { |
| 1477 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 1373 | 1478 | static const char *const portnames[] = { "ORANGE1", "ORANGE2", "BLACK1", "BLACK2", "ORANGE1", "ORANGE2", "DIL1", "DIL2" }; |
| 1374 | 1479 | device_t *pia_ic5 = device->machine->device("pia_ic5"); |
| 1375 | 1480 | |
| r10613 | r10614 | |
| 1378 | 1483 | This is achieved via connecting every input line to an AND gate, thus allowing two strobes |
| 1379 | 1484 | to represent each orange input bank (strobes are active low). */ |
| 1380 | 1485 | pia6821_cb1_w(pia_ic5, (input_port_read(device->machine, "AUX2") & 0x80)); |
| 1381 | return input_port_read(device->machine, portnames[input_strobe]); | |
| 1486 | return input_port_read(device->machine, portnames[state->input_strobe]); | |
| 1382 | 1487 | } |
| 1383 | 1488 | |
| 1384 | 1489 | |
| 1385 | 1490 | static WRITE8_DEVICE_HANDLER( pia_ic8_portb_w ) |
| 1386 | 1491 | { |
| 1387 | if (hopper == HOPPER_DUART_B) | |
| 1492 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 1493 | if (state->hopper == HOPPER_DUART_B) | |
| 1388 | 1494 | { |
| 1389 | 1495 | // duart.drive_sensor(data & 0x04, data & 0x01, 0, 0); |
| 1390 | 1496 | } |
| 1391 | else if (hopper == HOPPER_DUART_C) | |
| 1497 | else if (state->hopper == HOPPER_DUART_C) | |
| 1392 | 1498 | { |
| 1393 | 1499 | // duart.drive_sensor(data & 0x04, data & 0x01, data & 0x04, data & 0x02); |
| 1394 | 1500 | } |
| r10613 | r10614 | |
| 1402 | 1508 | |
| 1403 | 1509 | static WRITE_LINE_DEVICE_HANDLER( pia_ic8_ca2_w ) |
| 1404 | 1510 | { |
| 1405 | LOG_IC8(("%s: IC8 PIA write CA2 (input_strobe bit 2 / LED C) %02X\n", device->machine->describe_context(), state & 0xFF)); | |
| 1511 | mpu4_state *drvstate = device->machine->driver_data<mpu4_state>(); | |
| 1512 | LOG_IC8(("%s: IC8 PIA write CA2 (drvstate->input_strobe bit 2 / LED C) %02X\n", device->machine->describe_context(), state & 0xFF)); | |
| 1406 | 1513 | |
| 1407 | IC23GC = state; | |
| 1408 | ic23_update(); | |
| 1514 | drvstate->IC23GC = state; | |
| 1515 | ic23_update(drvstate); | |
| 1409 | 1516 | } |
| 1410 | 1517 | |
| 1411 | 1518 | |
| 1412 | 1519 | static WRITE_LINE_DEVICE_HANDLER( pia_ic8_cb2_w ) |
| 1413 | 1520 | { |
| 1521 | mpu4_state *drvstate = device->machine->driver_data<mpu4_state>(); | |
| 1414 | 1522 | LOG_IC8(("%s: IC8 PIA write CB2 (alpha clock) %02X\n", device->machine->describe_context(), state & 0xFF)); |
| 1415 | 1523 | |
| 1416 | if ( !alpha_clock && (state) ) | |
| 1524 | if ( !drvstate->alpha_clock && (state) ) | |
| 1417 | 1525 | { |
| 1418 | ROC10937_shift_data(0, alpha_data_line&0x01?0:1); | |
| 1526 | ROC10937_shift_data(0, drvstate->alpha_data_line&0x01?0:1); | |
| 1419 | 1527 | } |
| 1420 | alpha_clock = state; | |
| 1528 | drvstate->alpha_clock = state; | |
| 1421 | 1529 | ROC10937_draw_16seg(0); |
| 1422 | 1530 | } |
| 1423 | 1531 | |
| r10613 | r10614 | |
| 1449 | 1557 | |
| 1450 | 1558 | static WRITE8_DEVICE_HANDLER( pia_gb_portb_w ) |
| 1451 | 1559 | { |
| 1452 | int changed = expansion_latch^data; | |
| 1560 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 1561 | int changed = state->expansion_latch^data; | |
| 1453 | 1562 | |
| 1454 | 1563 | LOG_SS(("%s: GAMEBOARD: PIA Port A Set to %2x\n", device->machine->describe_context(),data)); |
| 1455 | 1564 | |
| 1456 | expansion_latch = data; | |
| 1565 | state->expansion_latch = data; | |
| 1457 | 1566 | |
| 1458 | 1567 | if ( changed & 0x20) |
| 1459 | 1568 | { // digital volume clock line changed |
| r10613 | r10614 | |
| 1461 | 1570 | { // changed from high to low, |
| 1462 | 1571 | if ( !(data & 0x10) ) |
| 1463 | 1572 | { |
| 1464 | if ( global_volume < 31 ) global_volume++; //steps unknown | |
| 1573 | if ( state->global_volume < 31 ) state->global_volume++; //steps unknown | |
| 1465 | 1574 | } |
| 1466 | 1575 | else |
| 1467 | 1576 | { |
| 1468 | if ( global_volume > 0 ) global_volume--; | |
| 1577 | if ( state->global_volume > 0 ) state->global_volume--; | |
| 1469 | 1578 | } |
| 1470 | 1579 | |
| 1471 | 1580 | { |
| 1472 | // float percent = (32-global_volume)/32.0; //volume_override?1.0:(32-global_volume)/32.0; | |
| 1581 | // float percent = (32-state->global_volume)/32.0; //volume_override?1.0:(32-state->global_volume)/32.0; | |
| 1473 | 1582 | // LOG(("GAMEBOARD: OKI volume %f \n",percent)); |
| 1474 | 1583 | } |
| 1475 | 1584 | } |
| r10613 | r10614 | |
| 1922 | 2031 | /* Common configurations */ |
| 1923 | 2032 | static void mpu4_config_common(running_machine *machine) |
| 1924 | 2033 | { |
| 1925 | ic24_timer = machine->scheduler().timer_alloc(FUNC(ic24_timeout)); | |
| 2034 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2035 | state->ic24_timer = machine->scheduler().timer_alloc(FUNC(ic24_timeout)); | |
| 1926 | 2036 | } |
| 1927 | 2037 | |
| 1928 | 2038 | static void mpu4_config_common_reels(running_machine *machine,int reels) |
| r10613 | r10614 | |
| 1938 | 2048 | |
| 1939 | 2049 | static MACHINE_START( mpu4mod2 ) |
| 1940 | 2050 | { |
| 2051 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 1941 | 2052 | mpu4_config_common(machine); |
| 1942 | 2053 | |
| 1943 | link7a_connected=0; | |
| 1944 | mod_number=2; | |
| 2054 | state->link7a_connected=0; | |
| 2055 | state->mod_number=2; | |
| 1945 | 2056 | |
| 1946 | 2057 | /* setup 8 mechanical meters */ |
| 1947 | 2058 | MechMtr_config(machine,8); |
| r10613 | r10614 | |
| 1952 | 2063 | |
| 1953 | 2064 | static MACHINE_START( mpu4dutch ) |
| 1954 | 2065 | { |
| 2066 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 1955 | 2067 | mpu4_config_common(machine); |
| 1956 | 2068 | |
| 1957 | link7a_connected=0; | |
| 2069 | state->link7a_connected=0; | |
| 1958 | 2070 | |
| 1959 | 2071 | // setup 8 mechanical meters //////////////////////////////////////////// |
| 1960 | 2072 | MechMtr_config(machine,8); |
| r10613 | r10614 | |
| 1965 | 2077 | |
| 1966 | 2078 | static MACHINE_START( mpu4mod4 ) |
| 1967 | 2079 | { |
| 2080 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 1968 | 2081 | mpu4_config_common(machine); |
| 1969 | 2082 | |
| 1970 | link7a_connected=0; | |
| 1971 | mod_number=4; | |
| 2083 | state->link7a_connected=0; | |
| 2084 | state->mod_number=4; | |
| 1972 | 2085 | |
| 1973 | 2086 | // setup 8 mechanical meters //////////////////////////////////////////// |
| 1974 | 2087 | MechMtr_config(machine,8); |
| r10613 | r10614 | |
| 2003 | 2116 | |
| 2004 | 2117 | static WRITE8_HANDLER( characteriser_w ) |
| 2005 | 2118 | { |
| 2119 | mpu4_state *state = space->machine->driver_data<mpu4_state>(); | |
| 2006 | 2120 | int x; |
| 2007 | 2121 | int call=data; |
| 2008 | 2122 | LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X", cpu_get_previouspc(space->cpu),offset,data)); |
| 2009 | if (! | |
| 2123 | if (!state->current_chr_table) | |
| 2010 | 2124 | fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(space->cpu)); |
| 2011 | 2125 | |
| 2012 | 2126 | if (offset == 0) |
| r10613 | r10614 | |
| 2014 | 2128 | { |
| 2015 | 2129 | if (call == 0) |
| 2016 | 2130 | { |
| 2017 | prot_col = 0; | |
| 2131 | state->prot_col = 0; | |
| 2018 | 2132 | } |
| 2019 | 2133 | else |
| 2020 | 2134 | { |
| 2021 | for (x = prot_col; x < 64; x++) | |
| 2135 | for (x = state->prot_col; x < 64; x++) | |
| 2022 | 2136 | { |
| 2023 | if ( | |
| 2137 | if (state->current_chr_table[(x)].call == call) | |
| 2024 | 2138 | { |
| 2025 | prot_col = x; | |
| 2026 | LOG_CHR(("Characteriser find column %02X\n",prot_col)); | |
| 2139 | state->prot_col = x; | |
| 2140 | LOG_CHR(("Characteriser find column %02X\n",state->prot_col)); | |
| 2027 | 2141 | break; |
| 2028 | 2142 | } |
| 2029 | 2143 | } |
| r10613 | r10614 | |
| 2037 | 2151 | // Rather than the search strategy, we can map the calls directly here. Note that they are hex versions of the square number series |
| 2038 | 2152 | { |
| 2039 | 2153 | case 0x00: |
| 2040 | lamp_col = 0; | |
| 2154 | state->lamp_col = 0; | |
| 2041 | 2155 | break; |
| 2042 | 2156 | case 0x01: |
| 2043 | lamp_col = 1; | |
| 2157 | state->lamp_col = 1; | |
| 2044 | 2158 | break; |
| 2045 | 2159 | case 0x04: |
| 2046 | lamp_col = 2; | |
| 2160 | state->lamp_col = 2; | |
| 2047 | 2161 | break; |
| 2048 | 2162 | case 0x09: |
| 2049 | lamp_col = 3; | |
| 2163 | state->lamp_col = 3; | |
| 2050 | 2164 | break; |
| 2051 | 2165 | case 0x10: |
| 2052 | lamp_col = 4; | |
| 2166 | state->lamp_col = 4; | |
| 2053 | 2167 | break; |
| 2054 | 2168 | case 0x19: |
| 2055 | lamp_col = 5; | |
| 2169 | state->lamp_col = 5; | |
| 2056 | 2170 | break; |
| 2057 | 2171 | case 0x24: |
| 2058 | lamp_col = 6; | |
| 2172 | state->lamp_col = 6; | |
| 2059 | 2173 | break; |
| 2060 | 2174 | case 0x31: |
| 2061 | lamp_col = 7; | |
| 2175 | state->lamp_col = 7; | |
| 2062 | 2176 | break; |
| 2063 | 2177 | } |
| 2064 | LOG_CHR(("Characteriser find 2 column %02X\n",lamp_col)); | |
| 2178 | LOG_CHR(("Characteriser find 2 column %02X\n",state->lamp_col)); | |
| 2065 | 2179 | } |
| 2066 | 2180 | } |
| 2067 | 2181 | |
| 2068 | 2182 | |
| 2069 | 2183 | static READ8_HANDLER( characteriser_r ) |
| 2070 | 2184 | { |
| 2071 | if (!mpu4_current_chr_table) | |
| 2185 | mpu4_state *state = space->machine->driver_data<mpu4_state>(); | |
| 2186 | if (!state->current_chr_table) | |
| 2072 | 2187 | fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(space->cpu)); |
| 2073 | 2188 | |
| 2074 | 2189 | LOG_CHR(("Characteriser read offset %02X \n",offset)); |
| 2075 | 2190 | if (offset == 0) |
| 2076 | 2191 | { |
| 2077 | LOG_CHR(("Characteriser read data %02X \n",mpu4_current_chr_table[prot_col].response)); | |
| 2078 | return mpu4_current_chr_table[prot_col].response; | |
| 2192 | LOG_CHR(("Characteriser read data %02X \n",state->current_chr_table[state->prot_col].response)); | |
| 2193 | return state->current_chr_table[state->prot_col].response; | |
| 2079 | 2194 | } |
| 2080 | 2195 | if (offset == 3) |
| 2081 | 2196 | { |
| 2082 | LOG_CHR(("Characteriser read data off 3 %02X \n",mpu4_current_chr_table[lamp_col+64].response)); | |
| 2083 | return mpu4_current_chr_table[lamp_col+64].response; | |
| 2197 | LOG_CHR(("Characteriser read data off 3 %02X \n",state->current_chr_table[state->lamp_col+64].response)); | |
| 2198 | return state->current_chr_table[state->lamp_col+64].response; | |
| 2084 | 2199 | } |
| 2085 | 2200 | return 0; |
| 2086 | 2201 | } |
| r10613 | r10614 | |
| 2135 | 2250 | |
| 2136 | 2251 | static DRIVER_INIT (m_oldtmr) |
| 2137 | 2252 | { |
| 2138 | reel_mux=SIX_REEL_1TO8; | |
| 2253 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2254 | state->reel_mux=SIX_REEL_1TO8; | |
| 2139 | 2255 | |
| 2140 | 2256 | stepper_config(machine, 0, &barcrest_opto1_interface); |
| 2141 | 2257 | stepper_config(machine, 1, &barcrest_opto1_interface); |
| r10613 | r10614 | |
| 2145 | 2261 | stepper_config(machine, 5, &barcrest_opto1_interface); |
| 2146 | 2262 | |
| 2147 | 2263 | awp_reel_setup(); |
| 2148 | | |
| 2264 | state->current_chr_table = oldtmr_data; | |
| 2149 | 2265 | } |
| 2150 | 2266 | |
| 2151 | 2267 | static DRIVER_INIT (m_ccelbr) |
| 2152 | 2268 | { |
| 2153 | reel_mux=STANDARD_REEL; | |
| 2269 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2270 | state->reel_mux=STANDARD_REEL; | |
| 2154 | 2271 | // setup 4 default 96 half step reels /////////////////////////////////// |
| 2155 | 2272 | mpu4_config_common_reels(machine,4); |
| 2156 | 2273 | |
| 2157 | | |
| 2274 | state->current_chr_table = ccelbr_data; | |
| 2158 | 2275 | } |
| 2159 | 2276 | |
| 2160 | 2277 | static DRIVER_INIT (m_gmball) |
| 2161 | 2278 | { |
| 2162 | reel_mux=STANDARD_REEL; | |
| 2279 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2280 | state->reel_mux=STANDARD_REEL; | |
| 2163 | 2281 | // setup 4 default 96 half step reels /////////////////////////////////// |
| 2164 | 2282 | mpu4_config_common_reels(machine,4); |
| 2165 | 2283 | |
| 2166 | | |
| 2284 | state->current_chr_table = gmball_data; | |
| 2167 | 2285 | } |
| 2168 | 2286 | |
| 2169 | 2287 | static DRIVER_INIT (m_grtecp) |
| 2170 | 2288 | { |
| 2171 | reel_mux=FIVE_REEL_5TO8; | |
| 2172 | lamp_extender=SMALL_CARD; | |
| 2289 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2290 | state->reel_mux=FIVE_REEL_5TO8; | |
| 2291 | state->lamp_extender=SMALL_CARD; | |
| 2173 | 2292 | // setup 5 default 96 half step reels with the mux board |
| 2174 | 2293 | mpu4_config_common_reels(machine,5); |
| 2175 | | |
| 2294 | state->current_chr_table = grtecp_data; | |
| 2176 | 2295 | } |
| 2177 | 2296 | |
| 2178 | 2297 | static DRIVER_INIT (mpu4tst2) |
| 2179 | 2298 | { |
| 2180 | reel_mux=STANDARD_REEL; | |
| 2299 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2300 | state->reel_mux=STANDARD_REEL; | |
| 2181 | 2301 | // setup 5 default 96 half step reels with the mux board |
| 2182 | 2302 | mpu4_config_common_reels(machine,4); |
| 2183 | 2303 | |
| r10613 | r10614 | |
| 2185 | 2305 | |
| 2186 | 2306 | static DRIVER_INIT (mpu4utst) |
| 2187 | 2307 | { |
| 2188 | reel_mux=STANDARD_REEL; | |
| 2308 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2309 | state->reel_mux=STANDARD_REEL; | |
| 2189 | 2310 | // setup 4 default 96 half step reels /////////////////////////////////// |
| 2190 | 2311 | mpu4_config_common_reels(machine,4); |
| 2191 | 2312 | } |
| 2192 | 2313 | |
| 2193 | 2314 | static DRIVER_INIT (connect4) |
| 2194 | 2315 | { |
| 2195 | led_lamp=1; | |
| 2316 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2317 | state->led_lamp=1; | |
| 2196 | 2318 | } |
| 2197 | 2319 | |
| 2198 | 2320 | /* generate a 50 Hz signal (based on an RC time) */ |
| 2199 | 2321 | static TIMER_DEVICE_CALLBACK( gen_50hz ) |
| 2200 | 2322 | { |
| 2323 | mpu4_state *state = timer.machine->driver_data<mpu4_state>(); | |
| 2201 | 2324 | /* Although reported as a '50Hz' signal, the fact that both rising and |
| 2202 | 2325 | falling edges of the pulse are used means the timer actually gives a 100Hz |
| 2203 | 2326 | oscillating signal.*/ |
| 2204 | signal_50hz = signal_50hz?0:1; | |
| 2205 | update_lamps(); | |
| 2206 | pia6821_ca1_w(timer.machine->device("pia_ic4"), signal_50hz); /* signal is connected to IC4 CA1 */ | |
| 2327 | state->signal_50hz = state->signal_50hz?0:1; | |
| 2328 | update_lamps(state); | |
| 2329 | pia6821_ca1_w(timer.machine->device("pia_ic4"), state->signal_50hz); /* signal is connected to IC4 CA1 */ | |
| 2207 | 2330 | |
| 2208 | if (signal_50hz) | |
| 2331 | if (state->signal_50hz) | |
| 2209 | 2332 | { |
| 2210 | update_meters(); | |
| 2333 | update_meters(state); | |
| 2211 | 2334 | } |
| 2212 | 2335 | |
| 2213 | 2336 | } |
| r10613 | r10614 | |
| 2319 | 2442 | |
| 2320 | 2443 | |
| 2321 | 2444 | /* machine driver for MOD 2 board */ |
| 2322 | static MACHINE_CONFIG_START( mpu4mod2, | |
| 2445 | static MACHINE_CONFIG_START( mpu4mod2, mpu4 | |
| 2323 | 2446 | |
| 2324 | 2447 | MCFG_MACHINE_START(mpu4mod2) |
| 2325 | 2448 | MCFG_MACHINE_RESET(mpu4) |
| r10613 | r10614 | |
|---|---|---|
| 1545 | 1545 | /* video hardware */ |
| 1546 | 1546 | MCFG_GFXDECODE(cookrace) |
| 1547 | 1547 | MCFG_PALETTE_LENGTH(16) |
| 1548 | ||
| 1548 | ||
| 1549 | 1549 | MCFG_SCREEN_MODIFY("screen") |
| 1550 | 1550 | MCFG_SCREEN_UPDATE(cookrace) |
| 1551 | 1551 | MACHINE_CONFIG_END |
| r10613 | r10614 | |
|---|---|---|
| 975 | 975 | ROM_RELOAD(0x200000 + 0x80000, 0x80000) |
| 976 | 976 | ROM_END |
| 977 | 977 | |
| 978 | /*------------------------------------------------------------------- | |
| 979 | / Wack-A-Doodle-Doo (Redemption) | |
| 980 | /-------------------------------------------------------------------*/ | |
| 981 | ROM_START(wackadoo) | |
| 982 | ROM_REGION(0x80000, "user1", 0) | |
| 983 | ROM_LOAD("wackcpu.100", 0x00000, 0x20000, CRC(995e0219) SHA1(57b2352a5a96e71ff48f838fde87a158afbf3701)) | |
| 984 | ROM_RELOAD(0x20000, 0x20000) | |
| 985 | ROM_RELOAD(0x40000, 0x20000) | |
| 986 | ROM_RELOAD(0x60000, 0x20000) | |
| 987 | ROM_REGION(0x10000, "maincpu", 0) | |
| 988 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 989 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 990 | ROM_REGION(0x80000, "gfx3", 0) | |
| 991 | ROM_LOAD("wackdisp.bin", 0x00000, 0x80000, CRC(8b46f074) SHA1(38a98fff56186d1a152e2c2e321496fd24e9ad56)) | |
| 992 | ROM_REGION(0x010000, "cpu2", 0) | |
| 993 | ROM_LOAD("wacku7.bin", 0x0000, 0x10000, CRC(99df3022) SHA1(5a38cf0816b95ea399d659d724b3259fadb42a62)) | |
| 994 | ROM_REGION(0x200000, "sound1", 0) | |
| 995 | ROM_LOAD("wacku17.bin", 0x000000, 0x80000, CRC(1876e659) SHA1(1ff3a6d7a7b2582d0482eae024efa078d0a61dbe)) | |
| 996 | ROM_RELOAD(0x000000 + 0x80000, 0x80000) | |
| 997 | ROM_LOAD("wacku21.bin", 0x100000, 0x80000, CRC(a3207296) SHA1(19af8ebab298a353fe42fc297b61182d8f772347)) | |
| 998 | ROM_RELOAD(0x100000 + 0x80000, 0x80000) | |
| 999 | ROM_END | |
| 1000 | ||
| 1001 | /*------------------------------------------------------------------- | |
| 1002 | / Titanic (Coin dropper) | |
| 1003 | /-------------------------------------------------------------------*/ | |
| 1004 | ROM_START(titanic) | |
| 1005 | ROM_REGION(0x80000, "user1", 0) | |
| 1006 | ROM_LOAD("titacpu.101", 0x00000, 0x20000, CRC(4217becf) SHA1(8b7aacbe75717f13623f6ceaa4ba2de61b1b732a)) | |
| 1007 | ROM_RELOAD(0x20000, 0x20000) | |
| 1008 | ROM_RELOAD(0x40000, 0x20000) | |
| 1009 | ROM_RELOAD(0x60000, 0x20000) | |
| 1010 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1011 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1012 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1013 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1014 | ROM_LOAD("titadspa.101", 0x00000, 0x80000, CRC(5b4300b6) SHA1(c2b2de20f6c74b71d2a9ac43c17694eadd795586)) | |
| 1015 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1016 | ROM_LOAD("titau7.101", 0x0000, 0x10000, CRC(544fe1ac) SHA1(5c62eef6a42660b13e626d1a6bb8cd09b77b0cc1)) | |
| 1017 | ROM_REGION(0x200000, "sound1", 0) | |
| 1018 | ROM_LOAD("titau17.100", 0x000000, 0x80000, CRC(ab919e99) SHA1(8735b632a62d9cd3db26b3c832785c48552ba231)) | |
| 1019 | ROM_RELOAD(0x000000 + 0x80000, 0x80000) | |
| 1020 | ROM_LOAD("titau21.100", 0x100000, 0x80000, CRC(76ca05f8) SHA1(3e1c56fe37393c345111665fd8ab730d53cb6970)) | |
| 1021 | ROM_RELOAD(0x100000 + 0x80000, 0x80000) | |
| 1022 | ROM_END | |
| 1023 | ||
| 1024 | /*------------------------------------------------------------------- | |
| 1025 | / Monopoly (Coin dropper) | |
| 1026 | /-------------------------------------------------------------------*/ | |
| 1027 | ROM_START(monopred) | |
| 1028 | ROM_REGION(0x80000, "user1", 0) | |
| 1029 | ROM_LOAD("monopcpu.401", 0x00000, 0x20000, CRC(2d0ff130) SHA1(c0b7baa6973db8743186a950b0a1ad3383db5c98)) | |
| 1030 | ROM_RELOAD(0x20000, 0x20000) | |
| 1031 | ROM_RELOAD(0x40000, 0x20000) | |
| 1032 | ROM_RELOAD(0x60000, 0x20000) | |
| 1033 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1034 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1035 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1036 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1037 | ROM_LOAD("monopdsp.400", 0x00000, 0x80000, CRC(0105572b) SHA1(fd9e1dfa4f396b953f82ccde11b54ee638382bee)) | |
| 1038 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1039 | ROM_LOAD("monopred.u7", 0x0000, 0x10000, CRC(1ca0cf63) SHA1(c4ce78718e3e3f1a8451b134f2869dd6410fee30)) | |
| 1040 | ROM_REGION(0x200000, "sound1", 0) | |
| 1041 | ROM_LOAD("monopred.u17", 0x000000, 0x100000, CRC(467dca62) SHA1(c727748b6b0b39ead19ce98bddd89fd05fb62d00)) | |
| 1042 | ROM_END | |
| 1043 | ||
| 1044 | 978 | GAME(1983, rab_320, 0, de_3, de_3, de_3, ROT0, "Data East", "Adventures of Rocky and Bullwinkle and Friends (3.20)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 1045 | 979 | GAME(1993, rab_130, rab_320, de_3, de_3, de_3, ROT0, "Data East", "Adventures of Rocky and Bullwinkle and Friends (1.30)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 1046 | 980 | GAME(1993, rab_103, rab_320, de_3, de_3, de_3, ROT0, "Data East", "Adventures of Rocky and Bullwinkle and Friends (1.03 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| r10613 | r10614 | |
| 1091 | 1025 | GAME(1994, tomy_h30, tomy_400, de_3, de_3, de_3, ROT0, "Data East", "The Who's Tommy Pinball Wizard (3.00 Holland)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 1092 | 1026 | GAME(1994, wwfr_106, 0, de_3, de_3, de_3, ROT0, "Data East", "WWF Royal Rumble (1.06)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 1093 | 1027 | GAME(1994, wwfr_103, wwfr_106, de_3, de_3, de_3, ROT0, "Data East", "WWF Royal Rumble (1.03)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 1094 | GAME(1998, titanic, 0, de_3, de_3, de_3, ROT0, "Sega", "Titanic (Coin dropper)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1095 | GAME(2002, monopred, 0, de_3, de_3, de_3, ROT0, "Stern", "Monopoly (Coin dropper)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1096 | GAME(1998, wackadoo, 0, de_3, de_3, de_3, ROT0, "Sega", "Wack-A-Doodle-Doo (Redemption)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| r10613 | r10614 | |
|---|---|---|
| 1138 | 1138 | |
| 1139 | 1139 | MCFG_PALETTE_LENGTH(16) |
| 1140 | 1140 | |
| 1141 | MCFG_PALETTE_INIT(cosmicg) | |
| 1141 | MCFG_PALETTE_INIT(cosmicg) | |
| 1142 | 1142 | |
| 1143 | 1143 | /* sound hardware */ |
| 1144 | 1144 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| r10613 | r10614 | |
|---|---|---|
| 39 | 39 | #include "includes/wiping.h" |
| 40 | 40 | |
| 41 | 41 | |
| 42 | static UINT8 *sharedram1,*sharedram2; | |
| 43 | ||
| 44 | 42 | static READ8_HANDLER( shared1_r ) |
| 45 | 43 | { |
| 46 | return sharedram1[offset]; | |
| 44 | wiping_state *state = space->machine->driver_data<wiping_state>(); | |
| 45 | return state->sharedram1[offset]; | |
| 47 | 46 | } |
| 48 | 47 | |
| 49 | 48 | static READ8_HANDLER( shared2_r ) |
| 50 | 49 | { |
| 51 | return sharedram2[offset]; | |
| 50 | wiping_state *state = space->machine->driver_data<wiping_state>(); | |
| 51 | return state->sharedram2[offset]; | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | static WRITE8_HANDLER( shared1_w ) |
| 55 | 55 | { |
| 56 | sharedram1[offset] = data; | |
| 56 | wiping_state *state = space->machine->driver_data<wiping_state>(); | |
| 57 | state->sharedram1[offset] = data; | |
| 57 | 58 | } |
| 58 | 59 | |
| 59 | 60 | static WRITE8_HANDLER( shared2_w ) |
| 60 | 61 | { |
| 61 | sharedram2[offset] = data; | |
| 62 | wiping_state *state = space->machine->driver_data<wiping_state>(); | |
| 63 | state->sharedram2[offset] = data; | |
| 62 | 64 | } |
| 63 | 65 | |
| 64 | 66 | |
| r10613 | r10614 | |
| 86 | 88 | |
| 87 | 89 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 88 | 90 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 89 | AM_RANGE(0x8000, 0x83ff) AM_BASE(&wiping_videoram) | |
| 90 | AM_RANGE(0x8400, 0x87ff) AM_BASE(&wiping_colorram) | |
| 91 | AM_RANGE(0x8000, 0x83ff) AM_BASE_MEMBER(wiping_state, videoram) | |
| 92 | AM_RANGE(0x8400, 0x87ff) AM_BASE_MEMBER(wiping_state, colorram) | |
| 91 | 93 | AM_RANGE(0x8800, 0x88ff) AM_BASE_SIZE_GENERIC(spriteram) |
| 92 | 94 | AM_RANGE(0x8000, 0x8bff) AM_RAM |
| 93 | AM_RANGE(0x9000, 0x93ff) AM_READWRITE(shared1_r,shared1_w) AM_BASE(&sharedram1) | |
| 94 | AM_RANGE(0x9800, 0x9bff) AM_READWRITE(shared2_r,shared2_w) AM_BASE(&sharedram2) | |
| 95 | AM_RANGE(0x9000, 0x93ff) AM_READWRITE(shared1_r,shared1_w) AM_BASE_MEMBER(wiping_state, sharedram1) | |
| 96 | AM_RANGE(0x9800, 0x9bff) AM_READWRITE(shared2_r,shared2_w) AM_BASE_MEMBER(wiping_state, sharedram2) | |
| 95 | 97 | AM_RANGE(0xa000, 0xa000) AM_WRITE(interrupt_enable_w) |
| 96 | 98 | AM_RANGE(0xa002, 0xa002) AM_WRITE(wiping_flipscreen_w) |
| 97 | 99 | AM_RANGE(0xa003, 0xa003) AM_WRITE(subcpu_reset_w) |
| r10613 | r10614 | |
| 279 | 281 | |
| 280 | 282 | |
| 281 | 283 | |
| 282 | static MACHINE_CONFIG_START( wiping, | |
| 284 | static MACHINE_CONFIG_START( wiping, w | |
| 283 | 285 | |
| 284 | 286 | /* basic machine hardware */ |
| 285 | 287 | MCFG_CPU_ADD("maincpu", Z80,18432000/6) /* 3.072 MHz */ |
| r10613 | r10614 | |
|---|---|---|
| 31 | 31 | |
| 32 | 32 | /* the protection device simply returns the last two values written shifted left */ |
| 33 | 33 | /* by a variable amount. */ |
| 34 | static UINT8 prot0,prot1,prot_shift; | |
| 35 | 34 | |
| 36 | 35 | static READ8_HANDLER( protection_r ) |
| 37 | 36 | { |
| 37 | popeye_state *state = space->machine->driver_data<popeye_state>(); | |
| 38 | 38 | if (offset == 0) |
| 39 | 39 | { |
| 40 | return ((prot1 << prot_shift) | (prot0 >> (8-prot_shift))) & 0xff; | |
| 40 | return ((state->prot1 << state->prot_shift) | (state->prot0 >> (8-state->prot_shift))) & 0xff; | |
| 41 | 41 | } |
| 42 | 42 | else /* offset == 1 */ |
| 43 | 43 | { |
| r10613 | r10614 | |
| 48 | 48 | |
| 49 | 49 | static WRITE8_HANDLER( protection_w ) |
| 50 | 50 | { |
| 51 | popeye_state *state = space->machine->driver_data<popeye_state>(); | |
| 51 | 52 | if (offset == 0) |
| 52 | 53 | { |
| 53 | 54 | /* this is the same as the level number (1-3) */ |
| 54 | prot_shift = data & 0x07; | |
| 55 | state->prot_shift = data & 0x07; | |
| 55 | 56 | } |
| 56 | 57 | else /* offset == 1 */ |
| 57 | 58 | { |
| 58 | prot0 = prot1; | |
| 59 | prot1 = data; | |
| 59 | state->prot0 = state->prot1; | |
| 60 | state->prot1 = data; | |
| 60 | 61 | } |
| 61 | 62 | } |
| 62 | 63 | |
| r10613 | r10614 | |
| 66 | 67 | static ADDRESS_MAP_START( skyskipr_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 67 | 68 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 68 | 69 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 69 | AM_RANGE(0x8c00, 0x8c02) AM_RAM AM_BASE(&popeye_background_pos) | |
| 70 | AM_RANGE(0x8c03, 0x8c03) AM_RAM AM_BASE(&popeye_palettebank) | |
| 70 | AM_RANGE(0x8c00, 0x8c02) AM_RAM AM_BASE_MEMBER(popeye_state, background_pos) | |
| 71 | AM_RANGE(0x8c03, 0x8c03) AM_RAM AM_BASE_MEMBER(popeye_state, palettebank) | |
| 71 | 72 | AM_RANGE(0x8c04, 0x8e7f) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) |
| 72 | 73 | AM_RANGE(0x8e80, 0x8fff) AM_RAM |
| 73 | AM_RANGE(0xa000, 0xa3ff) AM_WRITE(popeye_videoram_w) AM_BASE(&popeye_videoram) | |
| 74 | AM_RANGE(0xa400, 0xa7ff) AM_WRITE(popeye_colorram_w) AM_BASE(&popeye_colorram) | |
| 74 | AM_RANGE(0xa000, 0xa3ff) AM_WRITE(popeye_videoram_w) AM_BASE_MEMBER(popeye_state, videoram) | |
| 75 | AM_RANGE(0xa400, 0xa7ff) AM_WRITE(popeye_colorram_w) AM_BASE_MEMBER(popeye_state, colorram) | |
| 75 | 76 | AM_RANGE(0xc000, 0xcfff) AM_WRITE(skyskipr_bitmap_w) |
| 76 | 77 | AM_RANGE(0xe000, 0xe001) AM_READWRITE(protection_r,protection_w) |
| 77 | 78 | ADDRESS_MAP_END |
| r10613 | r10614 | |
| 80 | 81 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 81 | 82 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 82 | 83 | AM_RANGE(0x8800, 0x8bff) AM_RAM |
| 83 | AM_RANGE(0x8c00, 0x8c02) AM_RAM AM_BASE(&popeye_background_pos) | |
| 84 | AM_RANGE(0x8c03, 0x8c03) AM_RAM AM_BASE(&popeye_palettebank) | |
| 84 | AM_RANGE(0x8c00, 0x8c02) AM_RAM AM_BASE_MEMBER(popeye_state, background_pos) | |
| 85 | AM_RANGE(0x8c03, 0x8c03) AM_RAM AM_BASE_MEMBER(popeye_state, palettebank) | |
| 85 | 86 | AM_RANGE(0x8c04, 0x8e7f) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) |
| 86 | 87 | AM_RANGE(0x8e80, 0x8fff) AM_RAM |
| 87 | AM_RANGE(0xa000, 0xa3ff) AM_WRITE(popeye_videoram_w) AM_BASE(&popeye_videoram) | |
| 88 | AM_RANGE(0xa400, 0xa7ff) AM_WRITE(popeye_colorram_w) AM_BASE(&popeye_colorram) | |
| 88 | AM_RANGE(0xa000, 0xa3ff) AM_WRITE(popeye_videoram_w) AM_BASE_MEMBER(popeye_state, videoram) | |
| 89 | AM_RANGE(0xa400, 0xa7ff) AM_WRITE(popeye_colorram_w) AM_BASE_MEMBER(popeye_state, colorram) | |
| 89 | 90 | AM_RANGE(0xc000, 0xdfff) AM_WRITE(popeye_bitmap_w) |
| 90 | 91 | AM_RANGE(0xe000, 0xe001) AM_READWRITE(protection_r,protection_w) |
| 91 | 92 | ADDRESS_MAP_END |
| r10613 | r10614 | |
| 93 | 94 | static ADDRESS_MAP_START( popeyebl_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 94 | 95 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 95 | 96 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 96 | AM_RANGE(0x8c00, 0x8c02) AM_RAM AM_BASE(&popeye_background_pos) | |
| 97 | AM_RANGE(0x8c03, 0x8c03) AM_RAM AM_BASE(&popeye_palettebank) | |
| 97 | AM_RANGE(0x8c00, 0x8c02) AM_RAM AM_BASE_MEMBER(popeye_state, background_pos) | |
| 98 | AM_RANGE(0x8c03, 0x8c03) AM_RAM AM_BASE_MEMBER(popeye_state, palettebank) | |
| 98 | 99 | AM_RANGE(0x8c04, 0x8e7f) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) |
| 99 | 100 | AM_RANGE(0x8e80, 0x8fff) AM_RAM |
| 100 | AM_RANGE(0xa000, 0xa3ff) AM_WRITE(popeye_videoram_w) AM_BASE(&popeye_videoram) | |
| 101 | AM_RANGE(0xa400, 0xa7ff) AM_WRITE(popeye_colorram_w) AM_BASE(&popeye_colorram) | |
| 101 | AM_RANGE(0xa000, 0xa3ff) AM_WRITE(popeye_videoram_w) AM_BASE_MEMBER(popeye_state, videoram) | |
| 102 | AM_RANGE(0xa400, 0xa7ff) AM_WRITE(popeye_colorram_w) AM_BASE_MEMBER(popeye_state, colorram) | |
| 102 | 103 | AM_RANGE(0xc000, 0xcfff) AM_WRITE(skyskipr_bitmap_w) |
| 103 | 104 | AM_RANGE(0xe000, 0xe01f) AM_ROM |
| 104 | 105 | ADDRESS_MAP_END |
| r10613 | r10614 | |
| 391 | 392 | |
| 392 | 393 | |
| 393 | 394 | |
| 394 | static int dswbit; | |
| 395 | 395 | |
| 396 | 396 | static WRITE8_DEVICE_HANDLER( popeye_portB_w ) |
| 397 | 397 | { |
| 398 | popeye_state *state = device->machine->driver_data<popeye_state>(); | |
| 398 | 399 | /* bit 0 flips screen */ |
| 399 | 400 | flip_screen_set(device->machine, data & 1); |
| 400 | 401 | |
| 401 | 402 | /* bits 1-3 select DSW1 bit to read */ |
| 402 | dswbit = (data & 0x0e) >> 1; | |
| 403 | state->dswbit = (data & 0x0e) >> 1; | |
| 403 | 404 | } |
| 404 | 405 | |
| 405 | 406 | static READ8_DEVICE_HANDLER( popeye_portA_r ) |
| 406 | 407 | { |
| 408 | popeye_state *state = device->machine->driver_data<popeye_state>(); | |
| 407 | 409 | int res; |
| 408 | 410 | |
| 409 | 411 | |
| 410 | 412 | res = input_port_read(device->machine, "DSW0"); |
| 411 | res |= (input_port_read(device->machine, "DSW1") << (7-dswbit)) & 0x80; | |
| 413 | res |= (input_port_read(device->machine, "DSW1") << (7-state->dswbit)) & 0x80; | |
| 412 | 414 | |
| 413 | 415 | return res; |
| 414 | 416 | } |
| r10613 | r10614 | |
| 425 | 427 | |
| 426 | 428 | |
| 427 | 429 | |
| 428 | static MACHINE_CONFIG_START( skyskipr, | |
| 430 | static MACHINE_CONFIG_START( skyskipr, pop | |
| 429 | 431 | /* basic machine hardware */ |
| 430 | 432 | MCFG_CPU_ADD("maincpu", Z80, XTAL_8MHz/2) /* 4 MHz */ |
| 431 | 433 | MCFG_CPU_PROGRAM_MAP(skyskipr_map) |
| r10613 | r10614 | |
| 619 | 621 | |
| 620 | 622 | static DRIVER_INIT( skyskipr ) |
| 621 | 623 | { |
| 624 | popeye_state *state = machine->driver_data<popeye_state>(); | |
| 622 | 625 | UINT8 *buffer; |
| 623 | 626 | UINT8 *rom = machine->region("maincpu")->base(); |
| 624 | 627 | int len = 0x10000; |
| r10613 | r10614 | |
| 633 | 636 | auto_free(machine, buffer); |
| 634 | 637 | } |
| 635 | 638 | |
| 636 | state_save_register_global(machine, prot0); | |
| 637 | state_save_register_global(machine, prot1); | |
| 638 | state_save_register_global(machine, prot_shift); | |
| 639 | state_save_register_global(machine, state->prot0); | |
| 640 | state_save_register_global(machine, state->prot1); | |
| 641 | state_save_register_global(machine, state->prot_shift); | |
| 639 | 642 | } |
| 640 | 643 | |
| 641 | 644 | static DRIVER_INIT( popeye ) |
| 642 | 645 | { |
| 646 | popeye_state *state = machine->driver_data<popeye_state>(); | |
| 643 | 647 | UINT8 *buffer; |
| 644 | 648 | UINT8 *rom = machine->region("maincpu")->base(); |
| 645 | 649 | int len = 0x10000; |
| r10613 | r10614 | |
| 654 | 658 | auto_free(machine, buffer); |
| 655 | 659 | } |
| 656 | 660 | |
| 657 | state_save_register_global(machine, prot0); | |
| 658 | state_save_register_global(machine, prot1); | |
| 659 | state_save_register_global(machine, prot_shift); | |
| 661 | state_save_register_global(machine, state->prot0); | |
| 662 | state_save_register_global(machine, state->prot1); | |
| 663 | state_save_register_global(machine, state->prot_shift); | |
| 660 | 664 | } |
| 661 | 665 | |
| 662 | 666 |
| r10613 | r10614 | |
|---|---|---|
| 272 | 272 | MCFG_GFXDECODE(compgolf) |
| 273 | 273 | |
| 274 | 274 | MCFG_VIDEO_START(compgolf) |
| 275 | ||
| 275 | ||
| 276 | 276 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 277 | 277 | |
| 278 | 278 | MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) |
| r10613 | r10614 | |
|---|---|---|
| 163 | 163 | |
| 164 | 164 | static WRITE8_HANDLER(port0_w) |
| 165 | 165 | { |
| 166 | ||
| 166 | // printf("P0 %x = %x\n",cpu_get_pc(space->cpu),data); | |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | static WRITE8_HANDLER(port1_w) |
| 170 | 170 | { |
| 171 | ||
| 171 | // printf("P1 %x = %x\n",cpu_get_pc(space->cpu),data); | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | static WRITE8_HANDLER(port2_w) |
| 175 | 175 | { |
| 176 | ||
| 176 | // printf("P2 %x = %x\n",cpu_get_pc(space->cpu),data); | |
| 177 | 177 | coordy=data; |
| 178 | 178 | } |
| 179 | 179 |
| r10613 | r10614 | |
|---|---|---|
| 370 | 370 | ROM_RELOAD(0x100000 + 0x80000, 0x80000) |
| 371 | 371 | ROM_END |
| 372 | 372 | |
| 373 | ROM_START(mav_400) | |
| 374 | ROM_REGION(0x10000, "maincpu", 0) | |
| 375 | ROM_LOAD("mavgc5.400", 0x0000, 0x10000, CRC(e2d0a88b) SHA1(d1571edba47aecc871ac0cfdaabca31774f70fa1)) | |
| 376 | ROM_REGION(0x01000000, "cpu3", 0) | |
| 377 | ROM_LOAD16_BYTE("mavdisp0.400", 0x00000001, 0x00080000, CRC(b6069484) SHA1(2878d9a0151194bd4a0e12e2f75b02a5d7316b68)) | |
| 378 | ROM_LOAD16_BYTE("mavdisp3.400", 0x00000000, 0x00080000, CRC(149f871f) SHA1(e29a8bf149b77bccaeed202786cf76d9a4fd51df)) | |
| 379 | ROM_REGION(0x010000, "cpu2", 0) | |
| 380 | ROM_LOAD("mavu7.dat", 0x0000, 0x10000, CRC(427e6ab9) SHA1(6ad9295097f3d498383c91adf4ca667f797f29b1)) | |
| 381 | ROM_REGION(0x200000, "sound1", 0) | |
| 382 | ROM_LOAD("mavu17.dat", 0x000000, 0x80000, CRC(cba377b8) SHA1(b7551b6cb64357cdacf1a96cedfccbabf4bd070a)) | |
| 383 | ROM_RELOAD(0x000000 + 0x80000, 0x80000) | |
| 384 | ROM_LOAD("mavu21.dat", 0x100000, 0x80000, CRC(be0c6a6f) SHA1(4fee912d9f0d4b196dbfacf06a4202b2fa3037b1)) | |
| 385 | ROM_RELOAD(0x100000 + 0x80000, 0x80000) | |
| 386 | ROM_END | |
| 387 | ||
| 373 | 388 | ROM_START(mav_100) |
| 374 | 389 | ROM_REGION(0x10000, "maincpu", 0) |
| 375 | 390 | ROM_LOAD("mavcpu.100", 0x0000, 0x10000, CRC(13fdc959) SHA1(f8155f0fe5d4c3fe55000ab3b57f298fd9229fef)) |
| r10613 | r10614 | |
| 386 | 401 | ROM_END |
| 387 | 402 | |
| 388 | 403 | /*------------------------------------------------------------- |
| 404 | / Cut The Cheese (Redemption, Data East hardware) | |
| 405 | /------------------------------------------------------------*/ | |
| 406 | ROM_START(ctcheese) | |
| 407 | ROM_REGION(0x10000, "maincpu", 0) | |
| 408 | ROM_LOAD("ctcc5.bin", 0x0000, 0x10000, CRC(465d41de) SHA1(0e30b527d5b47f8823cbe6f196052b090e69e907)) | |
| 409 | ROM_REGION(0x01000000, "cpu3", 0) | |
| 410 | ROM_LOAD16_BYTE("ctcdsp0.bin", 0x00000001, 0x00080000, CRC(6885734d) SHA1(9ac82c9c8bf4e66d2999fbfd08617ef6c266dfe8)) | |
| 411 | ROM_LOAD16_BYTE("ctcdsp3.bin", 0x00000000, 0x00080000, CRC(0c2b3f3c) SHA1(cb730cc6fdd2a2786d25b46b1c45466ee56132d1)) | |
| 412 | ROM_REGION(0x010000, "cpu2", 0) | |
| 413 | ROM_LOAD("ctcu7.bin", 0x0000, 0x10000, CRC(406b9b9e) SHA1(f3f86c368c92ee0cb47323e6e0ca0fa05b6122bd)) | |
| 414 | ROM_REGION(0x200000, "sound1", 0) | |
| 415 | ROM_LOAD("ctcu17.bin", 0x000000, 0x80000, NO_DUMP) | |
| 416 | ROM_RELOAD(0x000000 + 0x80000, 0x80000) | |
| 417 | ROM_LOAD("ctcu21.bin", 0x100000, 0x80000, NO_DUMP) | |
| 418 | ROM_RELOAD(0x100000 + 0x80000, 0x80000) | |
| 419 | ROM_END | |
| 420 | ||
| 421 | /*------------------------------------------------------------- | |
| 389 | 422 | / Roach Racers |
| 390 | 423 | /------------------------------------------------------------*/ |
| 391 | 424 | |
| r10613 | r10614 | |
| 419 | 452 | GAME(1995, frankstg, frankst, de_3b, de_3b, de_3b, ROT0, "Sega", "Mary Shelley's Frankenstein (Germany)",GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 420 | 453 | GAME(1994, mav_402, 0, de_3b, de_3b, de_3b, ROT0, "Sega", "Maverick (Display Rev. 4.02)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 421 | 454 | GAME(1994, mav_401, mav_402, de_3b, de_3b, de_3b, ROT0, "Sega", "Maverick (Display Rev. 4.01)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 455 | GAME(1994, mav_400, mav_402, de_3b, de_3b, de_3b, ROT0, "Sega", "Maverick (Display Rev. 4.00)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 422 | 456 | GAME(1994, mav_100, mav_402, de_3b, de_3b, de_3b, ROT0, "Sega", "Maverick (1.00)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 423 | 457 | GAME(1998, detest, 0, de_3b, de_3b, de_3b, ROT0, "Data East", "Data East Test Chip", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 458 | GAME(1996, ctcheese, 0, de_3b, de_3b, de_3b, ROT0, "Sega", "Cut The Cheese (Redemption)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| r10613 | r10614 | |
|---|---|---|
| 115 | 115 | ROM_START(nightrdr) |
| 116 | 116 | ROM_REGION(0x10000, "maincpu", 0) |
| 117 | 117 | ROM_LOAD( "721-21_1.716", 0x1000, 0x0800, CRC(237c4060) SHA1(4ce3dba9189fe7666fc76a2c8ee7fff9b12d4c00)) |
| 118 | ROM_LOAD( "720-20_6.716", 0x1800, 0x0800, CRC(f394e357) SHA1(73444f848825a398515153d18de027792b57bcc7)) | |
| 119 | ROM_RELOAD( 0xf800, 0x0800) | |
| 120 | ROM_END | |
| 121 | ||
| 122 | ROM_START(nightr20) | |
| 123 | ROM_REGION(0x10000, "maincpu", 0) | |
| 124 | ROM_LOAD( "721-21_1.716", 0x1000, 0x0800, CRC(237c4060) SHA1(4ce3dba9189fe7666fc76a2c8ee7fff9b12d4c00)) | |
| 118 | 125 | ROM_LOAD( "720-20_6.716", 0x1800, 0x0800, CRC(0c17aa4d) SHA1(729e61a29691857112579efcdb96a35e8e5b1279)) |
| 119 | 126 | ROM_RELOAD( 0xf800, 0x0800) |
| 120 | 127 | ROM_END |
| r10613 | r10614 | |
| 149 | 156 | GAME( 1977, evelknie, 0, by17, by17, by17, ROT0, "Bally","Evel Knievel", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 150 | 157 | GAME( 1977, freedom, 0, by17, by17, by17, ROT0, "Bally","Freedom", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 151 | 158 | GAME( 1978, matahari, 0, by17, by17, by17, ROT0, "Bally","Mata Hari", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 152 | GAME( 1977, nightrdr, 0, by17, by17, by17, ROT0, "Bally","Night Rider", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 159 | GAME( 1977, nightrdr, 0, by17, by17, by17, ROT0, "Bally","Night Rider (rev. 21)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 160 | GAME( 1977, nightr20, nightrdr, by17, by17, by17, ROT0, "Bally","Night Rider (rev. 20)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 153 | 161 | GAME( 1978, pwerplay, 0, by17, by17, by17, ROT0, "Bally","Power Play (Pinball)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 154 | 162 | GAME( 1978, stk_sprs, 0, by17, by17, by17, ROT0, "Bally","Strikes and Spares", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| r10613 | r10614 | |
|---|---|---|
| 3244 | 3244 | ROM_LOAD( "m1200.rom", 0x800000, 0x800000, CRC(b0d88720) SHA1(44ab137e3f8e15b7cb5697ffbd9b1143d8210c4f) ) |
| 3245 | 3245 | ROM_END |
| 3246 | 3246 | |
| 3247 | ROM_START( kov2101 ) | |
| 3248 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ | |
| 3249 | PGM_68K_BIOS | |
| 3250 | ROM_LOAD16_WORD_SWAP( "u18.101", 0x100000, 0x400000, CRC(c9926f35) SHA1(a9c72d0c5d239164107894c7d3fffe4af29ed201) ) | |
| 3251 | ||
| 3252 | ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */ | |
| 3253 | ROM_LOAD( "kov2_v100_hongkong.asic", 0x000000, 0x04000, CRC(e0d7679f) SHA1(e1c2d127eba4ddbeb8ad173c55b90ac1467e1ca8) ) | |
| 3254 | ||
| 3255 | ROM_REGION32_LE( 0x400000, "user1", 0 ) /* Protection Data (encrypted external ARM data) */ | |
| 3256 | ROM_LOAD( "u19.101", 0x000000, 0x200000, CRC(8c35f2fe) SHA1(d4858f97fcfad0f342fccbc9cf1590276cc3c69c) ) | |
| 3257 | ||
| 3258 | ROM_REGION( 0xc00000, "tiles", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */ | |
| 3259 | PGM_VIDEO_BIOS | |
| 3260 | ROM_LOAD( "t1200.rom", 0x180000, 0x800000, CRC(d7e26609) SHA1(bdad810f82fcf1d50a8791bdc495374ec5a309c6) ) | |
| 3261 | ||
| 3262 | ROM_REGION( 0x2800000, "sprcol", 0 ) /* Sprite Colour Data */ | |
| 3263 | ROM_LOAD( "a1200.rom", 0x0000000, 0x0800000, CRC(ceeb81d8) SHA1(5476729443fc1bc9593ae10fbf7cbc5d7290b017) ) | |
| 3264 | ROM_LOAD( "a1201.rom", 0x0800000, 0x0800000, CRC(82f0a878) SHA1(ddd13e404252a71de1b2b3b974b910f899f51c38) ) | |
| 3265 | ROM_LOAD( "a1202.rom", 0x1000000, 0x0800000, CRC(4bb92fae) SHA1(f0b6d72ed425de1c69dc8f8d5795ea760a4a59b0) ) | |
| 3266 | ROM_LOAD( "a1203.rom", 0x1800000, 0x0800000, CRC(e73cb627) SHA1(4c6e48b845a5d1e8f9899010fbf273d54c2b8899) ) | |
| 3267 | ROM_LOAD( "a1204.rom", 0x2000000, 0x0800000, CRC(27527099) SHA1(e23cf366bdeaca1e009a5cec6b13164310a34384) ) | |
| 3268 | ||
| 3269 | ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ | |
| 3270 | ROM_LOAD( "b1200.rom", 0x0000000, 0x0800000, CRC(bed7d994) SHA1(019dfba8154256d64cd249eb0fa4c451edce34b8) ) | |
| 3271 | ROM_LOAD( "b1201.rom", 0x0800000, 0x0800000, CRC(f251eb57) SHA1(56a5fc14ab7822f83379cecb26638e5bb266349a) ) | |
| 3272 | ||
| 3273 | ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ | |
| 3274 | PGM_AUDIO_BIOS | |
| 3275 | ROM_LOAD( "m1200.rom", 0x800000, 0x800000, CRC(b0d88720) SHA1(44ab137e3f8e15b7cb5697ffbd9b1143d8210c4f) ) | |
| 3276 | ROM_END | |
| 3277 | ||
| 3247 | 3278 | ROM_START( kov2100 ) |
| 3248 | 3279 | ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */ |
| 3249 | 3280 | PGM_68K_BIOS |
| r10613 | r10614 | |
| 4171 | 4202 | |
| 4172 | 4203 | ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ |
| 4173 | 4204 | ROM_LOAD( "a04401w064.u7", 0x0000000, 0x0800000, CRC(ed229794) SHA1(1cf1863495a18c7c7d277a9be43ec116b00960b0) ) //image-1 |
| 4174 | ROM_LOAD( "a04402w064.u8", 0x0800000, 0x0800000, | |
| 4205 | ROM_LOAD( "a04402w064.u8", 0x0800000, 0x0800000, | |
| 4175 | 4206 | |
| 4176 | 4207 | ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ |
| 4177 | ROM_LOAD( "b04401w064.u1", 0x0000000, 0x0800000, | |
| 4208 | ROM_LOAD( "b04401w064.u1", 0x0000000, 0x0800000, | |
| 4178 | 4209 | |
| 4179 | 4210 | ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ |
| 4180 | 4211 | ROM_LOAD( "pgm_m01s.rom", 0x000000, 0x200000, CRC(45ae7159) SHA1(d3ed3ff3464557fd0df6b069b2e431528b0ebfa8) ) // same as standard PGM bios |
| 4181 | ROM_LOAD( "m04401b032.u17", 0x400000, 0x400000, | |
| 4212 | ROM_LOAD( "m04401b032.u17", 0x400000, 0x400000, | |
| 4182 | 4213 | |
| 4183 | 4214 | ROM_REGION( 0x20000, "sram", 0 ) /* default settings */ |
| 4184 | 4215 | ROM_LOAD( "ddp3_defaults.nv", 0x0000000, 0x020000, CRC(571e96c0) SHA1(348940c77ca348213331b85b9b1d3aabb96a528a) ) |
| r10613 | r10614 | |
| 4202 | 4233 | |
| 4203 | 4234 | ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ |
| 4204 | 4235 | ROM_LOAD( "a04401w064.u7", 0x0000000, 0x0800000, CRC(ed229794) SHA1(1cf1863495a18c7c7d277a9be43ec116b00960b0) ) //image-1 |
| 4205 | ROM_LOAD( "a04402w064.u8", 0x0800000, 0x0800000, | |
| 4236 | ROM_LOAD( "a04402w064.u8", 0x0800000, 0x0800000, | |
| 4206 | 4237 | |
| 4207 | 4238 | ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ |
| 4208 | ROM_LOAD( "b04401w064.u1", 0x0000000, 0x0800000, | |
| 4239 | ROM_LOAD( "b04401w064.u1", 0x0000000, 0x0800000, | |
| 4209 | 4240 | |
| 4210 | 4241 | ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ |
| 4211 | 4242 | ROM_LOAD( "pgm_m01s.rom", 0x000000, 0x200000, CRC(45ae7159) SHA1(d3ed3ff3464557fd0df6b069b2e431528b0ebfa8) ) // same as standard PGM bios |
| 4212 | ROM_LOAD( "m04401b032.u17", 0x400000, 0x400000, | |
| 4243 | ROM_LOAD( "m04401b032.u17", 0x400000, 0x400000, | |
| 4213 | 4244 | |
| 4214 | 4245 | ROM_REGION( 0x20000, "sram", 0 ) /* default settings */ |
| 4215 | 4246 | ROM_LOAD( "ddp3_defaults.nv", 0x0000000, 0x020000, CRC(571e96c0) SHA1(348940c77ca348213331b85b9b1d3aabb96a528a) ) |
| r10613 | r10614 | |
| 4232 | 4263 | |
| 4233 | 4264 | ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ |
| 4234 | 4265 | ROM_LOAD( "a04401w064.u7", 0x0000000, 0x0800000, CRC(ed229794) SHA1(1cf1863495a18c7c7d277a9be43ec116b00960b0) ) //image-1 |
| 4235 | ROM_LOAD( "a04402w064.u8", 0x0800000, 0x0800000, | |
| 4266 | ROM_LOAD( "a04402w064.u8", 0x0800000, 0x0800000, | |
| 4236 | 4267 | |
| 4237 | 4268 | ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ |
| 4238 | ROM_LOAD( "b04401w064.u1", 0x0000000, 0x0800000, | |
| 4269 | ROM_LOAD( "b04401w064.u1", 0x0000000, 0x0800000, | |
| 4239 | 4270 | |
| 4240 | 4271 | ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ |
| 4241 | 4272 | ROM_LOAD( "pgm_m01s.rom", 0x000000, 0x200000, CRC(45ae7159) SHA1(d3ed3ff3464557fd0df6b069b2e431528b0ebfa8) ) // same as standard PGM bios |
| 4242 | ROM_LOAD( "m04401b032.u17", 0x400000, 0x400000, | |
| 4273 | ROM_LOAD( "m04401b032.u17", 0x400000, 0x400000, | |
| 4243 | 4274 | |
| 4244 | 4275 | ROM_REGION( 0x20000, "sram", 0 ) /* default settings */ |
| 4245 | 4276 | ROM_LOAD( "ddp3_defaults.nv", 0x0000000, 0x020000, CRC(571e96c0) SHA1(348940c77ca348213331b85b9b1d3aabb96a528a) ) |
| r10613 | r10614 | |
| 4263 | 4294 | |
| 4264 | 4295 | ROM_REGION( 0x1c00000, "sprcol", 0 ) /* Sprite Colour Data */ |
| 4265 | 4296 | ROM_LOAD( "a04401w064.u7", 0x0000000, 0x0800000, CRC(ed229794) SHA1(1cf1863495a18c7c7d277a9be43ec116b00960b0) ) //image-1 |
| 4266 | ROM_LOAD( "a04402w064.u8", 0x0800000, 0x0800000, | |
| 4297 | ROM_LOAD( "a04402w064.u8", 0x0800000, 0x0800000, | |
| 4267 | 4298 | |
| 4268 | 4299 | ROM_REGION( 0x1000000, "sprmask", 0 ) /* Sprite Masks + Colour Indexes */ |
| 4269 | ROM_LOAD( "b04401w064.u1", 0x0000000, 0x0800000, | |
| 4300 | ROM_LOAD( "b04401w064.u1", 0x0000000, 0x0800000, | |
| 4270 | 4301 | |
| 4271 | 4302 | ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */ |
| 4272 | 4303 | ROM_LOAD( "pgm_m01s.rom", 0x000000, 0x200000, CRC(45ae7159) SHA1(d3ed3ff3464557fd0df6b069b2e431528b0ebfa8) ) // same as standard PGM bios |
| 4273 | ROM_LOAD( "m04401b032.u17", 0x400000, 0x400000, | |
| 4304 | ROM_LOAD( "m04401b032.u17", 0x400000, 0x400000, | |
| 4274 | 4305 | |
| 4275 | 4306 | ROM_REGION( 0x20000, "sram", 0 ) /* NVRAM with factory programmed values - needed to boot */ |
| 4276 | 4307 | ROM_LOAD( "ddp3blk_defaults.nv", 0x0000000, 0x020000, CRC(a1651904) SHA1(5b80d3c4c764895c40953a66161d4dd84f742604) ) |
| 4277 | 4308 | ROM_END |
| 4278 | 4309 | |
| 4279 | 4310 | /* this is on PGM2, the main board contains 2 custom ASICs, no roms or other kind of bios, I don't know how compatible the |
| 4280 | hardware is otherwise, but I imagine it's well protected */ | |
| 4311 | hardware is otherwise, but I imagine it's well protected | |
| 4312 | ||
| 4313 | they appear to have the main program inside a custom ASIC (probably ARM again) as the carts will boot to 'PROGRAM ERROR' | |
| 4314 | even if you strip them of program roms. | |
| 4315 | ||
| 4316 | */ | |
| 4281 | 4317 | ROM_START( orleg2 ) |
| 4282 | 4318 | ROM_REGION( 0x800000, "maincpu", 0 ) /* 68000 Code */ |
| 4283 | 4319 | ROM_LOAD16_WORD_SWAP( "xyj2_v104cn.u7", 0x000000, 0x800000, CRC(7c24a4f5) SHA1(3cd9f9264ef2aad0869afdf096e88eb8d74b2570) ) |
| r10613 | r10614 | |
| 5304 | 5340 | |
| 5305 | 5341 | pgm_basic_init(machine); |
| 5306 | 5342 | kovsh_latch_init(machine); |
| 5307 | pgm_ | |
| 5343 | pgm_mm | |
| 5308 | 5344 | |
| 5309 | 5345 | mem16[0x11e90c / 2] = 0x4e71; |
| 5310 | 5346 | mem16[0x11e90e / 2] = 0x4e71; |
| r10613 | r10614 | |
| 5831 | 5867 | GAME( 2000, kov2106, kov2, kov2, sango, kov2, ROT0, "IGS", "Knights of Valour 2 / Sangoku Senki 2 (ver. 106, 102, 100KH)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // 02/27/01 13:26:46 V106 (Ext. Arm V102, Int. Arm V100HK) |
| 5832 | 5868 | GAME( 2000, kov2103, kov2, kov2, sango, kov2, ROT0, "IGS", "Knights of Valour 2 / Sangoku Senki 2 (ver. 103, 101, 100HK)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // 12/28/00 15:09:31 V103 (Ext. Arm V101, Int. Arm V100HK) |
| 5833 | 5869 | GAME( 2000, kov2102, kov2, kov2, sango, kov2, ROT0, "IGS", "Knights of Valour 2 / Sangoku Senki 2 (ver. 102, 101, 100HK)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // 12/14/00 10:33:36 V102 (Ext. Arm V101, Int. Arm V100HK) |
| 5870 | GAME( 2000, kov2101, kov2, kov2, sango, kov2, ROT0, "IGS", "Knights of Valour 2 / Sangoku Senki 2 (ver. 101, 101, 100HK)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // 11/29/00 11:03:08 V100 (Ext. Arm V100, Int. Arm V100HK) | |
| 5834 | 5871 | GAME( 2000, kov2100, kov2, kov2, sango, kov2, ROT0, "IGS", "Knights of Valour 2 / Sangoku Senki 2 (ver. 100, 100, 100HK)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // 11/29/00 11:03:08 V100 (Ext. Arm V100, Int. Arm V100HK) |
| 5835 | 5872 | |
| 5836 | 5873 | GAME( 2001, martmast, pgm, kov2, sango, martmast, ROT0, "IGS", "Martial Masters (ver. 104, 102, 102US)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // 68k V104, Ext Arm 102, Int Arm 102US |
| r10613 | r10614 | |
|---|---|---|
| 142 | 142 | #include "includes/snes.h" |
| 143 | 143 | #include "audio/snes_snd.h" |
| 144 | 144 | |
| 145 | static INT8 *shared_ram; | |
| 146 | static UINT8 ffight2b_coins; | |
| 147 | 145 | |
| 146 | class snesb_state : public snes_state | |
| 147 | { | |
| 148 | public: | |
| 149 | snesb_state(running_machine &machine, const driver_device_config_base &config) | |
| 150 | : snes_state(machine, config) { } | |
| 151 | ||
| 152 | INT8 *shared_ram; | |
| 153 | UINT8 ffight2b_coins; | |
| 154 | INT32 oldinput; | |
| 155 | INT32 oldcoin; | |
| 156 | UINT8 cnt; | |
| 157 | }; | |
| 158 | ||
| 159 | ||
| 160 | ||
| 148 | 161 | static READ8_HANDLER(sharedram_r) |
| 149 | 162 | { |
| 150 | stat | |
| 163 | snesb_state | |
| 151 | 164 | INT32 coincnt; |
| 152 | 165 | INT32 input = input_port_read(space->machine, "COIN"); |
| 153 | 166 | |
| 154 | 167 | if(input&3) |
| 155 | 168 | { |
| 156 | if( ((input&1)==1)&&((oldinput&1)==0)) {shared_ram[0]++;} | |
| 169 | if( ((input&1)==1)&&((state->oldinput&1)==0)) {state->shared_ram[0]++;} | |
| 157 | 170 | |
| 158 | coincnt=shared_ram[0]; | |
| 171 | coincnt=state->shared_ram[0]; | |
| 159 | 172 | |
| 160 | 173 | if(coincnt>99){coincnt=99;} |
| 161 | 174 | |
| 162 | shared_ram[0xb]=(coincnt/10)+'0'; | |
| 163 | shared_ram[0xa]=(coincnt%10)+'0'; | |
| 175 | state->shared_ram[0xb]=(coincnt/10)+'0'; | |
| 176 | state->shared_ram[0xa]=(coincnt%10)+'0'; | |
| 164 | 177 | } |
| 165 | oldinput=input; | |
| 166 | return shared_ram[offset]; | |
| 178 | state->oldinput=input; | |
| 179 | return state->shared_ram[offset]; | |
| 167 | 180 | } |
| 168 | 181 | |
| 169 | 182 | static WRITE8_HANDLER(sharedram_w) |
| 170 | 183 | { |
| 171 | shared_ram[offset]=data; | |
| 184 | snesb_state *state = space->machine->driver_data<snesb_state>(); | |
| 185 | state->shared_ram[offset]=data; | |
| 172 | 186 | } |
| 173 | 187 | |
| 174 | 188 | static READ8_HANDLER(ffight2b_coin_r) |
| 175 | 189 | { |
| 176 | stat | |
| 190 | snesb_state | |
| 177 | 191 | INT32 input = input_port_read(space->machine, "COIN"); |
| 178 | 192 | |
| 179 | if( ((input&1)==1)&&((oldin | |
| 193 | if( ((input&1)==1)&&((state->oldcoin | |
| 180 | 194 | { |
| 181 | INT32 coin_cnt=(ffight2b_coins&0xf)+10*(ffight2b_coins>>4); | |
| 195 | INT32 coin_cnt=(state->ffight2b_coins&0xf)+10*(state->ffight2b_coins>>4); | |
| 182 | 196 | if(++coin_cnt>99) coin_cnt=99; |
| 183 | ffight2b_coins=(coin_cnt%10)|((coin_cnt/10)<<4); | |
| 197 | state->ffight2b_coins=(coin_cnt%10)|((coin_cnt/10)<<4); | |
| 184 | 198 | } |
| 185 | oldinput=input; | |
| 186 | return ffight2b_coins; | |
| 199 | state->oldcoin=input; | |
| 200 | return state->ffight2b_coins; | |
| 187 | 201 | } |
| 188 | 202 | |
| 189 | 203 | /* Sonic blast man 2 turbo */ |
| 190 | 204 | |
| 191 | 205 | static READ8_HANDLER(sb2b_75bd37_r) |
| 192 | 206 | { |
| 207 | snesb_state *state = space->machine->driver_data<snesb_state>(); | |
| 193 | 208 | /* protection check */ |
| 194 | static UINT8 cnt=0; | |
| 195 | return ++cnt; | |
| 209 | return ++state->cnt; | |
| 196 | 210 | } |
| 197 | 211 | |
| 198 | 212 | static READ8_HANDLER(sb2b_6a6xxx_r) |
| r10613 | r10614 | |
| 497 | 511 | INPUT_PORTS_END |
| 498 | 512 | |
| 499 | 513 | |
| 500 | static MACHINE_CONFIG_START( kinstb, snes_state ) | |
| 514 | static MACHINE_CONFIG_START( kinstb, snesb_state ) | |
| 501 | 515 | |
| 502 | 516 | /* basic machine hardware */ |
| 503 | 517 | MCFG_CPU_ADD("maincpu", _5A22, 3580000*6) /* 2.68Mhz, also 3.58Mhz */ |
| r10613 | r10614 | |
| 529 | 543 | |
| 530 | 544 | static DRIVER_INIT(kinstb) |
| 531 | 545 | { |
| 546 | snesb_state *state = machine->driver_data<snesb_state>(); | |
| 532 | 547 | INT32 i; |
| 533 | 548 | UINT8 *rom = machine->region("user3")->base(); |
| 534 | 549 | |
| r10613 | r10614 | |
| 537 | 552 | rom[i] = BITSWAP8(rom[i], 5, 0, 6, 1, 7, 4, 3, 2); |
| 538 | 553 | } |
| 539 | 554 | |
| 540 | shared_ram = auto_alloc_array(machine, INT8, 0x100); | |
| 555 | state->shared_ram = auto_alloc_array(machine, INT8, 0x100); | |
| 541 | 556 | memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x781000, 0x7810ff, 0, 0, sharedram_r, sharedram_w); |
| 542 | 557 | |
| 543 | 558 | DRIVER_INIT_CALL(snes_hirom); |
| r10613 | r10614 | |
| 545 | 560 | |
| 546 | 561 | static DRIVER_INIT( ffight2b ) |
| 547 | 562 | { |
| 563 | snesb_state *state = machine->driver_data<snesb_state>(); | |
| 548 | 564 | INT32 i; |
| 549 | 565 | UINT8 *rom = machine->region("user3")->base(); |
| 550 | 566 | |
| r10613 | r10614 | |
| 578 | 594 | rom[0x7ffd] = 0x89; |
| 579 | 595 | rom[0x7ffc] = 0x54; |
| 580 | 596 | |
| 581 | ffight2b_coins = 0; | |
| 597 | state->ffight2b_coins = 0; | |
| 582 | 598 | memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x7eadce, 0x7eadce, 0, 0, ffight2b_coin_r); |
| 583 | 599 | |
| 584 | 600 | DRIVER_INIT_CALL(snes); |
| r10613 | r10614 | |
|---|---|---|
| 190 | 190 | if ((gearval & 0x0f) != 0x0f) |
| 191 | 191 | state->gear = gearval & 0x0f; |
| 192 | 192 | |
| 193 | /* add the start key into the mix -- note that it overlaps 4th | |
| 193 | /* add the start key into the mix -- note that it overlaps 4th | |
| 194 | 194 | if (!(input_port_read(space->machine, "INPUTS") & 0x80)) |
| 195 | 195 | state->gear &= ~0x08; |
| 196 | 196 |
| r10613 | r10614 | |
|---|---|---|
| 6 | 6 | TO DO: |
| 7 | 7 | - check palette |
| 8 | 8 | - check blitter command 0x00 |
| 9 | - screen orientation is wrong (should clearly be ROT90 or 270 with blitter mods) | |
| 9 | 10 | |
| 10 | 11 | Has 36 pin Cherry master looking edge connector |
| 11 | 12 |
| r10613 | r10614 | |
|---|---|---|
| 181 | 181 | ROM_LOAD("838-10_5.532", 0xf000, 0x1000, CRC(9c63925d) SHA1(abd1fa6308d3569e16ee10bfabce269a124d8f26)) |
| 182 | 182 | ROM_END |
| 183 | 183 | |
| 184 | ROM_START(eballd14) | |
| 185 | ROM_REGION(0x10000, "maincpu", 0) | |
| 186 | ROM_LOAD( "838-14_2.732", 0x1000, 0x0800, CRC(27eeabde) SHA1(a8f81dbb70202bdad1c9734d629e8a5c27f2a835)) | |
| 187 | ROM_CONTINUE( 0x5000, 0x0800) | |
| 188 | ROM_LOAD( "720-52_6.732", 0x1800, 0x0800, CRC(2a43d9fb) SHA1(9ff903c32b80780383578a9abaa3ef9d3bcecbc7) ) | |
| 189 | ROM_CONTINUE( 0x5800, 0x0800) | |
| 190 | ROM_RELOAD( 0xf000, 0x1000) | |
| 191 | ROM_REGION(0x10000, "cpu2", 0) | |
| 192 | ROM_LOAD("838-08_3.532", 0xd000, 0x1000, CRC(c39478d7) SHA1(8148aca7c4113921ab882da32d6d88e66abb22cc)) | |
| 193 | ROM_LOAD("838-09_4.716", 0xe000, 0x0800, CRC(518ea89e) SHA1(a387274ef530bb57f31819733b35615a39260126)) | |
| 194 | ROM_RELOAD(0xe800, 0x0800) | |
| 195 | ROM_LOAD("838-10_5.532", 0xf000, 0x1000, CRC(9c63925d) SHA1(abd1fa6308d3569e16ee10bfabce269a124d8f26)) | |
| 196 | ROM_END | |
| 197 | ||
| 184 | 198 | /*-------------------------------- |
| 185 | 199 | / Elektra |
| 186 | 200 | /-------------------------------*/ |
| r10613 | r10614 | |
| 1269 | 1283 | GAME( 1985, cosflash, flashgdn, by35, by35, by35, ROT0, "Bell Games","Cosmic Flash", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 1270 | 1284 | GAME( 1985, cybrnaut, 0, by35, by35, by35, ROT0, "Bally","Cybernaut", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 1271 | 1285 | GAME( 1979, dollyptn, 0, by35, by35, by35, ROT0, "Bally","Dolly Parton", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 1272 | GAME( 1981, eballdlx, 0, by35, by35, by35, ROT0, "Bally","Eight Ball Deluxe", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1286 | GAME( 1981, eballdlx, 0, by35, by35, by35, ROT0, "Bally","Eight Ball Deluxe (rev. 15)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1287 | GAME( 1981, eballd14, eballdlx, by35, by35, by35, ROT0, "Bally","Eight Ball Deluxe (rev. 14)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1273 | 1288 | GAME( 1981, elektra, 0, by35, by35, by35, ROT0, "Bally","Elektra", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 1274 | 1289 | GAME( 1981, embryon, 0, by35, by35, by35, ROT0, "Bally","Embryon", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 1275 | 1290 | GAME( 1981, fathom, 0, by35, by35, by35, ROT0, "Bally","Fathom", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| r10613 | r10614 | |
|---|---|---|
| 186 | 186 | |
| 187 | 187 | **************************************************************************/ |
| 188 | 188 | |
| 189 | static READ16_HANDLER( sharedram1_r ) { | |
| 190 | cischeat_state *state = space->machine->driver_data<cischeat_state>();return state->sharedram1[offset];} | |
| 191 | static READ16_HANDLER( sharedram2_r ) { | |
| 192 | cischeat_state *state = space->machine->driver_data<cischeat_state>();return state->sharedram2[offset];} | |
| 189 | static READ16_HANDLER( sharedram1_r ) | |
| 190 | { | |
| 191 | cischeat_state *state = space->machine->driver_data<cischeat_state>(); | |
| 192 | return state->sharedram1[offset]; | |
| 193 | } | |
| 193 | 194 | |
| 194 | static WRITE16_HANDLER( sharedram1_w ) { | |
| 195 | cischeat_state *state = space->machine->driver_data<cischeat_state>();COMBINE_DATA(&state->sharedram1[offset]);} | |
| 196 | static WRITE16_HANDLER( sharedram2_w ) { | |
| 197 | cischeat_state *state = space->machine->driver_data<cischeat_state>();COMBINE_DATA(&state->sharedram2[offset]);} | |
| 195 | static READ16_HANDLER( sharedram2_r ) | |
| 196 | { | |
| 197 | cischeat_state *state = space->machine->driver_data<cischeat_state>(); | |
| 198 | return state->sharedram2[offset]; | |
| 199 | } | |
| 198 | 200 | |
| 199 | static READ16_HANDLER( rom_1_r ) { | |
| 200 | cischeat_state *state = space->machine->driver_data<cischeat_state>();return state->rom_1[offset];} | |
| 201 | static READ16_HANDLER( rom_2_r ) { | |
| 202 | cischeat_state *state = space->machine->driver_data<cischeat_state>();return state->rom_2[offset];} | |
| 203 | static READ16_HANDLER( rom_3_r ) { | |
| 204 | cischeat_state *state = space->machine->driver_data<cischeat_state>();return state->rom_3[offset];} | |
| 201 | static WRITE16_HANDLER( sharedram1_w ) | |
| 202 | { | |
| 203 | cischeat_state *state = space->machine->driver_data<cischeat_state>(); | |
| 204 | COMBINE_DATA(&state->sharedram1[offset]); | |
| 205 | } | |
| 205 | 206 | |
| 207 | static WRITE16_HANDLER( sharedram2_w ) | |
| 208 | { | |
| 209 | cischeat_state *state = space->machine->driver_data<cischeat_state>(); | |
| 210 | COMBINE_DATA(&state->sharedram2[offset]); | |
| 211 | } | |
| 206 | 212 | |
| 213 | static READ16_HANDLER( rom_1_r ) | |
| 214 | { | |
| 215 | cischeat_state *state = space->machine->driver_data<cischeat_state>(); | |
| 216 | return state->rom_1[offset]; | |
| 217 | } | |
| 218 | ||
| 219 | static READ16_HANDLER( rom_2_r ) | |
| 220 | { | |
| 221 | cischeat_state *state = space->machine->driver_data<cischeat_state>(); | |
| 222 | return state->rom_2[offset]; | |
| 223 | } | |
| 224 | ||
| 225 | static READ16_HANDLER( rom_3_r ) | |
| 226 | { | |
| 227 | cischeat_state *state = space->machine->driver_data<cischeat_state>(); | |
| 228 | return state->rom_3[offset]; | |
| 229 | } | |
| 230 | ||
| 231 | ||
| 207 | 232 | /************************************************************************** |
| 208 | 233 | Big Run |
| 209 | 234 | **************************************************************************/ |
| r10613 | r10614 | |
|---|---|---|
| 123 | 123 | * |
| 124 | 124 | *************************************/ |
| 125 | 125 | |
| 126 | static emu_timer *interrupt_timer; | |
| 127 | 126 | |
| 128 | ||
| 129 | 127 | static TIMER_CALLBACK( interrupt_callback ) |
| 130 | 128 | { |
| 129 | spacefb_state *state = machine->driver_data<spacefb_state>(); | |
| 131 | 130 | int next_vpos; |
| 132 | 131 | |
| 133 | 132 | /* compute vector and set the interrupt line */ |
| r10613 | r10614 | |
| 141 | 140 | else |
| 142 | 141 | next_vpos = SPACEFB_INT_TRIGGER_COUNT_1; |
| 143 | 142 | |
| 144 | interrupt_timer->adjust(machine->primary_screen->time_until_pos(next_vpos)); | |
| 143 | state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(next_vpos)); | |
| 145 | 144 | } |
| 146 | 145 | |
| 147 | 146 | |
| 148 | 147 | static void create_interrupt_timer(running_machine *machine) |
| 149 | 148 | { |
| 150 | interrupt_timer = machine->scheduler().timer_alloc(FUNC(interrupt_callback)); | |
| 149 | spacefb_state *state = machine->driver_data<spacefb_state>(); | |
| 150 | state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(interrupt_callback)); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | |
| 154 | 154 | static void start_interrupt_timer(running_machine *machine) |
| 155 | 155 | { |
| 156 | interrupt_timer->adjust(machine->primary_screen->time_until_pos(SPACEFB_INT_TRIGGER_COUNT_1)); | |
| 156 | spacefb_state *state = machine->driver_data<spacefb_state>(); | |
| 157 | state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(SPACEFB_INT_TRIGGER_COUNT_1)); | |
| 157 | 158 | } |
| 158 | 159 | |
| 159 | 160 | |
| r10613 | r10614 | |
| 199 | 200 | static ADDRESS_MAP_START( spacefb_main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 200 | 201 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 201 | 202 | AM_RANGE(0x4000, 0x7fff) AM_NOP |
| 202 | AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x3c00) AM_RAM AM_BASE( | |
| 203 | AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x3c00) AM_RAM AM_BASE_MEMBER( | |
| 203 | 204 | AM_RANGE(0xc000, 0xc7ff) AM_MIRROR(0x3000) AM_RAM |
| 204 | 205 | AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_NOP |
| 205 | 206 | ADDRESS_MAP_END |
| r10613 | r10614 | |
| 333 | 334 | * |
| 334 | 335 | *************************************/ |
| 335 | 336 | |
| 336 | static MACHINE_CONFIG_START( spacefb, | |
| 337 | static MACHINE_CONFIG_START( spacefb, spacefb_stat | |
| 337 | 338 | |
| 338 | 339 | /* basic machine hardware */ |
| 339 | 340 | MCFG_CPU_ADD("maincpu", Z80, SPACEFB_MAIN_CPU_CLOCK) |
| r10613 | r10614 | |
|---|---|---|
| 123 | 123 | |
| 124 | 124 | TODO: |
| 125 | 125 | - I arbitrarily assigned a uniform blue overlay to sos. I don't know how it's |
| 126 | supposed to be. | |
| 126 | supposed to be. | |
| 127 | 127 | |
| 128 | 128 | ***************************************************************************/ |
| 129 | 129 | |
| 130 | 130 | #include "emu.h" |
| 131 | 131 | #include "cpu/i8085/i8085.h" |
| 132 | 132 | #include "includes/warpwarp.h" |
| 133 | ||
| 133 | 134 | #include "geebee.lh" |
| 135 | #include "navarone.lh" | |
| 134 | 136 | #include "sos.lh" |
| 135 | 137 | |
| 136 | 138 | #define MASTER_CLOCK XTAL_18_432MHz |
| 137 | 139 | |
| 138 | 140 | |
| 139 | /******************************************************* | |
| 140 | * | |
| 141 | * Gee Bee overlay | |
| 142 | * | |
| 143 | *******************************************************/ | |
| 144 | 141 | |
| 145 | 142 | static int handle_joystick; |
| 146 | 143 | |
| r10613 | r10614 | |
| 923 | 920 | { |
| 924 | 921 | handle_joystick = 0; |
| 925 | 922 | |
| 926 | // turn off overlay in cocktail mode; this assumes that the cabinet dip switch | |
| 927 | // is bit 0 of input port 2 | |
| 928 | geebee_handleoverlay = 1; | |
| 929 | ||
| 930 | 923 | warpwarp_ball_pen = 1; |
| 931 | 924 | warpwarp_ball_sizex = 4; |
| 932 | 925 | warpwarp_ball_sizey = 4; |
| r10613 | r10614 | |
| 935 | 928 | static DRIVER_INIT( navarone ) |
| 936 | 929 | { |
| 937 | 930 | handle_joystick = 1; |
| 938 | geebee_handleoverlay = 0; | |
| 939 | 931 | |
| 940 | 932 | warpwarp_ball_pen = 1; |
| 941 | 933 | warpwarp_ball_sizex = 4; |
| r10613 | r10614 | |
| 945 | 937 | static DRIVER_INIT( kaitein ) |
| 946 | 938 | { |
| 947 | 939 | handle_joystick = 1; |
| 948 | geebee_handleoverlay = 0; | |
| 949 | 940 | |
| 950 | 941 | warpwarp_ball_pen = 1; |
| 951 | 942 | warpwarp_ball_sizex = 1; |
| r10613 | r10614 | |
| 955 | 946 | static DRIVER_INIT( kaitei ) |
| 956 | 947 | { |
| 957 | 948 | handle_joystick = 0; |
| 958 | geebee_handleoverlay = 0; | |
| 959 | 949 | |
| 960 | 950 | warpwarp_ball_pen = 1; |
| 961 | 951 | warpwarp_ball_sizex = 1; |
| r10613 | r10614 | |
| 966 | 956 | { |
| 967 | 957 | handle_joystick = 1; |
| 968 | 958 | |
| 969 | geebee_handleoverlay = 0; | |
| 970 | ||
| 971 | 959 | warpwarp_ball_pen = 0; |
| 972 | 960 | warpwarp_ball_sizex = 4; |
| 973 | 961 | warpwarp_ball_sizey = 2; |
| r10613 | r10614 | |
| 976 | 964 | static DRIVER_INIT( bombbee ) |
| 977 | 965 | { |
| 978 | 966 | handle_joystick = 0; |
| 979 | geebee_handleoverlay = 0; | |
| 980 | 967 | |
| 981 | 968 | warpwarp_ball_pen = 0x200; |
| 982 | 969 | warpwarp_ball_sizex = 4; |
| r10613 | r10614 | |
| 986 | 973 | static DRIVER_INIT( warpwarp ) |
| 987 | 974 | { |
| 988 | 975 | handle_joystick = 1; |
| 989 | geebee_handleoverlay = 0; | |
| 990 | 976 | |
| 991 | 977 | warpwarp_ball_pen = 0x200; |
| 992 | 978 | warpwarp_ball_sizex = 4; |
| r10613 | r10614 | |
| 999 | 985 | GAMEL(1978, geebeeb, geebee, geebee, geebeeb, geebee, ROT90, "Namco (F.lli Bertolino license)", "Gee Bee (Europe)", 0, layout_geebee ) // Fratelli Bertolino |
| 1000 | 986 | GAMEL(1978, geebeeg, geebee, geebee, geebee, geebee, ROT90, "Namco (Gremlin license)", "Gee Bee (US)", 0, layout_geebee ) |
| 1001 | 987 | |
| 1002 | GAME( | |
| 988 | GAMEL( | |
| 1003 | 989 | GAME( 1980, kaitein, kaitei, navarone, kaitein, kaitein, ROT90, "K.K. Tokki (Namco license)", "Kaitei Takara Sagashi (Namco license)", 0 ) |
| 1004 | 990 | GAME( 1980, kaitei, 0, navarone, kaitei, kaitei, ROT90, "K.K. Tokki", "Kaitei Takara Sagashi", 0 ) |
| 1005 | GAMEL(1980, sos, 0, navarone, sos, sos, ROT90, "Namco", "SOS", GAME_IMPERFECT_SOUND, layout_sos ) | |
| 991 | GAMEL(1980, sos, 0, navarone, sos, sos, ROT90, "Namco", "SOS", GAME_IMPERFECT_SOUND, layout_sos ) // developed by Shoei? | |
| 1006 | 992 | |
| 1007 | 993 | /* Color games */ |
| 1008 | 994 | GAME( 1979, bombbee, 0, bombbee, bombbee, bombbee, ROT90, "Namco", "Bomb Bee", 0 ) |
| r10613 | r10614 | |
|---|---|---|
| 2606 | 2606 | |
| 2607 | 2607 | |
| 2608 | 2608 | |
| 2609 | static MACHINE_CONFIG_START( gionbana, | |
| 2609 | static MACHINE_CONFIG_START( gionbana, nbmj8891_stat | |
| 2610 | 2610 | |
| 2611 | 2611 | /* basic machine hardware */ |
| 2612 | 2612 | MCFG_CPU_ADD("maincpu", Z80, 20000000/4) /* 5.00 MHz ? */ |
| r10613 | r10614 | |
|---|---|---|
| 36 | 36 | |
| 37 | 37 | - all games that uses YUV just updates one frame then dies, why? |
| 38 | 38 | |
| 39 | - all or almost all games seems to have issues with the sound loops, for example sfz3ugd keeps to say "This-This-This ..." at start-up | |
| 40 | instead of completing the phrase; | |
| 39 | - SH to ARM sound streaming doesn't work (used by ADX compression system) | |
| 41 | 40 | |
| 42 | - suchie3: used to boot (at least go over the I/O test), it doesn't now, might be protection related. | |
| 43 | ||
| 44 | 41 | - ngdup23a, ngdup23c: missing DIMM emulation, hence they can't possibly work, emulate the DIMM means to add an extra SH-4 ... |
| 45 | 42 | |
| 46 | - totd: emulation exits at some point during attract mode without any output. | |
| 47 | ||
| 48 | - spkrbtl: ARM CPU crashes sometimes? Also, it crashes when entering into the gameplay. | |
| 49 | ||
| 50 | 43 | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| 51 | 44 | |
| 52 | 45 | Guru's Readme |
| r10613 | r10614 | |
| 932 | 925 | Atomis Wave (system overview) |
| 933 | 926 | Sammy/SEGA, 2002 |
| 934 | 927 | |
| 935 | Th | |
| 928 | Th | |
| 936 | 929 | |
| 937 | 930 | PCB Layout |
| 938 | 931 | ---------- |
| r10613 | r10614 | |
| 1033 | 1026 | The bottom of the PCB contains nothing significant except some connectors. One for the game cart, one for special controls |
| 1034 | 1027 | or I/O, one for a communication module, one for a cooling fan and one for the serial connection daughterboard. |
| 1035 | 1028 | |
| 1036 | --------------------------------------------------------------------------------------------------------------------------------- | |
| 1029 | --------------------------------------------------------------------------------------------------------------------------------- | |
| 1037 | 1030 | |
| 1038 | 1031 | |
| 1039 | 1032 | |
| 1040 | Atomiswave cart PCB layout and game usage (revision | |
| 1033 | Atomiswave cart PCB layout and game usage (revision 1.0 26/2/2011 5:59pm) | |
| 1041 | 1034 | ----------------------------------------- |
| 1042 | 1035 | |
| 1043 | 1036 | Type 1 ROM Board: |
| r10613 | r10614 | |
| 1075 | 1068 | Dolphin Blue AX0401F01 |
| 1076 | 1069 | Maximum Speed AX0501F01 |
| 1077 | 1070 | Demolish Fist AX0601F01 |
| 1071 | Guilty Gear X Ver. 1.5 AX0801F01 | |
| 1078 | 1072 | Guilt Gear Isuka AX1201F01 |
| 1079 | 1073 | Knights Of Valour Seven Spirits AX1301F01 |
| 1080 | 1074 | Salaryman Kintaro AX1401F01 |
| r10613 | r10614 | |
| 1090 | 1084 | The name in the archive has been devised purely for convenience. |
| 1091 | 1085 | This ROM holds the main program. |
| 1092 | 1086 | |
| 1093 | IC10 to IC17 - Custom-badged 128M TSOP48 mask ROMs. I suspect they are Macronix | |
| 1094 | ROMs because the ROM on the main board is also a custom Macronix | |
| 1095 | ROM and they have a history of producing custom ROMs for other | |
| 1096 | companies that hide their ROM types like Nintendo etc. May as well | |
| 1097 | be MX23L12810 or MR27V12800J, which have the same pinout. | |
| 1098 | ||
| 1087 | IC10 to IC17 - Custom-badged 128M TSOP48 mask ROMs. | |
| 1099 | 1088 | IC10 - Not Populated for 7 ROMs or less (ROM 01 if 8 ROMs are populated) |
| 1100 | 1089 | IC11 - ROM 01 (or ROM 02 if 8 ROMs are populated) |
| 1101 | 1090 | IC12 - ROM 02 (or ROM 03 if 8 ROMs are populated) |
| r10613 | r10614 | |
| 1114 | 1103 | Dolphin Blue AX0401M01 to AX0405M01 5 |
| 1115 | 1104 | Maximum Speed AX0501M01 to AX0505M01 5 |
| 1116 | 1105 | Demolish Fist AX0601M01 to AX0607M01 7 |
| 1106 | Guilty Gear X Ver. 1.5 AX0801M01 to AX0807M01 7 | |
| 1117 | 1107 | Guilty Gear Isuka AX1201M01 to AX1208M01 8 |
| 1118 | 1108 | Knights Of Valour Seven Spirits AX1301M01 to AX1307M01 7 |
| 1119 | 1109 | Salaryman Kintaro AX1401M01 to AX1407M01 7 |
| r10613 | r10614 | |
| 1158 | 1148 | Game (sorted by code) Code |
| 1159 | 1149 | ----------------------------------------------- |
| 1160 | 1150 | Samurai Spirits Tenkaichi Kenkakuden AX2901F01 |
| 1151 | Metal Slug 6 AX3001F01 | |
| 1161 | 1152 | The King Of Fighters XI AX3201F01 |
| 1162 | 1153 | Neogeo Battle Coliseum AX3301F01 |
| 1163 | 1154 | Rumble Fish 2 AX3401F01 |
| r10613 | r10614 | |
| 1169 | 1160 | is a TSOP48, using the middle pins. The other 2 pins on each side of the ROM |
| 1170 | 1161 | are not connected to anything. |
| 1171 | 1162 | |
| 1172 | MROM* - Custom-badged SSOP70 mask ROMs. These may be OKI MR26V25605 or MR26V25655 (256M) | |
| 1173 | or possibly 26V51253 (512M) or something else similar. | |
| 1163 | MROM* - Custom-badged 256M SSOP70 mask ROMs | |
| 1174 | 1164 | |
| 1175 | 1165 | ROM Codes |
| 1176 | 1166 | --------- |
| r10613 | r10614 | |
| 1178 | 1168 | Game (sorted by code) Code of ROMs |
| 1179 | 1169 | ----------------------------------------------------------------------- |
| 1180 | 1170 | Samurai Spirits Tenkaichi Kenkakuden AX2901M01 to AX2907M01 7 |
| 1171 | Metal Slug 6 AX3001M01 to AX3004M01 4 | |
| 1181 | 1172 | The King Of Fighters XI AX3201M01 to AX3207M01 7 |
| 1182 | 1173 | Neogeo Battle Coliseum AX3301M01 to AX3307M01 7 |
| 1183 | 1174 | Rumble Fish 2 AX3401M01 to AX3405M01 5 |
| r10613 | r10614 | |
| 1190 | 1181 | 171-8355A |
| 1191 | 1182 | PC BD A/W 128M FLASH |
| 1192 | 1183 | 837-14608 (sticker for Extreme Hunting 2 Tournament Edition) |
| 1184 | 837-14695 (sticker for Dirty Pigskin Football) | |
| 1193 | 1185 | |----------------------------| |
| 1194 | 1186 | | XC9536* U16 U2* | |
| 1195 | 1187 | | | |
| r10613 | r10614 | |
| 1215 | 1207 | Game Part# Sticker |
| 1216 | 1208 | --------------------------------------------------------- |
| 1217 | 1209 | Extreme Hunting 2 Tournament Edition 315-6428P 315-6248 |
| 1210 | Dirty Pigskin Football ? ? | |
| 1218 | 1211 | |
| 1219 | 1212 | U* - Fujitsu MBM29PL12LM-10PCN 128M MirrorFlash TSOP56 flash ROM. |
| 1220 | 1213 | (configured as 16Mbytes x8bit or 8Mwords x16bit) |
| 1221 | 1214 | This ROM has no additional custom markings. The name in the archive has been devised |
| 1222 | purely for convenience. The number of ROMs may vary between games. So far all 8 | |
| 1223 | positions have been seen populated. It's also possible all positions are present | |
| 1224 | when manufactured, each board is programmed to requirements and depending on the total | |
| 1225 | data length, some ROMs may be empty. | |
| 1215 | purely for convenience using the Sega 837- sticker number. The number of ROMs may vary | |
| 1216 | between games. So far all 8 positions have been seen populated. It's also possible all | |
| 1217 | positions are present when manufactured, each board is programmed to requirements and | |
| 1218 | depending on the total data length, some ROMs may be empty. | |
| 1226 | 1219 | |
| 1227 | 1220 | |
| 1228 | Other games not dumped (some may have been cancelled, * = known to be released) | |
| 1229 | ---------------------- | |
| 1230 | Chase 1929 | |
| 1231 | Dirty Pigskin | |
| 1232 | Force Five | |
| 1233 | Guilty Gear X Version 1.5 * | |
| 1234 | Kenju | |
| 1235 | Metal Slug 6 * | |
| 1236 | Premier Eleven | |
| 1237 | Sushi Bar | |
| 1238 | The King Of Fighters XI * | |
| 1239 | Sega Clay Challenge * | |
| 1240 | Sega Bass Fishing Challenge * | |
| 1241 | 1221 | |
| 1242 | ||
| 1243 | 1222 | Network Board |
| 1244 | 1223 | ------------- |
| 1245 | 1224 | |
| 1246 | This board is required for Extreme Hunting 2 Tournament Edition, although it doesn't need to be connected | |
| 1247 | to a network or another Atomiswave unit to boot up. However it must be plugged into the PCB in the | |
| 1248 | communication slot or the game will not go in-game. It will boot but then displays NETWORK BOARD ERROR | |
| 1249 | if not present. Externally there's a hole for an RJ45 network cable and a slot for a PIC16C621/PIC16C622 | |
| 1250 | PIC enclosed in a black plastic housing. This is the same type as used in NAOMI etc. This board probably acts | |
| 1251 | like the NAOMI network DIMM board minus the on-board DIMM RAM storage. | |
| 1225 | This board is required for Extreme Hunting 2 Tournament Edition (and possibly some other Sega-made Atomiswave carts) | |
| 1226 | although it doesn't need to be connected to a network or another Atomiswave unit to boot up. However it must be | |
| 1227 | plugged into the PCB in the communication slot or the game will not go in-game. It will boot but then displays | |
| 1228 | NETWORK BOARD ERROR if not present. Externally there's a hole for an RJ45 network cable and a slot for a | |
| 1229 | PIC16C621/PIC16C622 PIC enclosed in a black plastic housing. This is the same type as used in NAOMI etc. This | |
| 1230 | board probably acts like the NAOMI network DIMM board minus the on-board DIMM RAM storage. | |
| 1252 | 1231 | |
| 1253 | 1232 | 837-14508R |
| 1254 | 1233 | 171-8324C |
| r10613 | r10614 | |
| 1286 | 1265 | --------------------------------------------------- |
| 1287 | 1266 | Extreme Hunting 2 Tournament Edition 317-0445-COM |
| 1288 | 1267 | |
| 1268 | ||
| 1289 | 1269 | AW-NET Network Board |
| 1290 | 1270 | -------------------- |
| 1291 | 1271 | |
| r10613 | r10614 | |
| 1334 | 1314 | CN3 - Gun connection for player 2 pump switch |
| 1335 | 1315 | CN4 - Gun connection for player 1 trigger and optical |
| 1336 | 1316 | CN5 - Gun connection for player 1 pump switch |
| 1317 | ||
| 1318 | ||
| 1319 | Other games not dumped (some may have been cancelled) | |
| 1320 | ---------------------- | |
| 1321 | Chase 1929 | |
| 1322 | Force Five | |
| 1323 | Kenju | |
| 1324 | Premier Eleven | |
| 1325 | Sushi Bar | |
| 1326 | Sega Clay Challenge | |
| 1327 | Sega Bass Fishing Challenge | |
| 1328 | ||
| 1337 | 1329 | */ |
| 1338 | 1330 | |
| 1339 | 1331 | #include "emu.h" |
| r10613 | r10614 | |
| 2652 | 2644 | // on-cart X76F100 eeprom contents |
| 2653 | 2645 | ROM_REGION( 0x84, "naomibd_eeprom", 0 ) |
| 2654 | 2646 | ROM_LOAD( "841-0003.sf", 0x000000, 0x000084, CRC(3a119a17) SHA1(d37a092cca7c9cfc5f2637b355af90a65d04013e) ) |
| 2655 | ||
| 2656 | // trojaned protection data (filename is word offset) | |
| 2657 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 2658 | ROM_LOAD( "00000500.bin", 0x000000, 0x020000, CRC(3751d50e) SHA1(08d56e7befd3e1bc2c29217c60dee0c862af65ed) ) | |
| 2659 | ROM_LOAD( "00020504.bin", 0x020000, 0x020000, CRC(6b4ab9f6) SHA1(205c355a5a55659f35645d3e66dc1dcff703727c) ) | |
| 2660 | ROM_LOAD( "00040508.bin", 0x040000, 0x020000, CRC(dae5d37d) SHA1(63d0cde73b86e77ea7b5e1d71643566c500f9933) ) | |
| 2661 | ROM_LOAD( "0006050c.bin", 0x060000, 0x020000, CRC(c2b7ea51) SHA1(59f1cb01b140e7fdea7d945acad464e08e3adf44) ) | |
| 2662 | ROM_LOAD( "00080510.bin", 0x080000, 0x020000, CRC(7b84acb4) SHA1(e48448795c058c0fc3a9e9108de18a3181db5417) ) | |
| 2663 | ROM_LOAD( "000a0514.bin", 0x0a0000, 0x020000, CRC(f954ffcd) SHA1(3015dfc298de1e16db07406e9ecb5fc0e2aae0a8) ) | |
| 2664 | ROM_LOAD( "000c0518.bin", 0x0c0000, 0x020000, CRC(28fce8ad) SHA1(180ae2dc9181bbe4215093e4e933c9e78d3af7a8) ) | |
| 2665 | ROM_LOAD( "000e051c.bin", 0x0e0000, 0x020000, CRC(a7f7a5c1) SHA1(6b39aa8f8a762ffe61b07f77713cca5c95a8dfcf) ) | |
| 2666 | ROM_LOAD( "00100520.bin", 0x100000, 0x020000, CRC(85417674) SHA1(0d35aa0f3d5f451bbf4daad343b9ad1ebd9d9551) ) | |
| 2667 | ROM_LOAD( "00118a3a.bin", 0x120000, 0x020000, CRC(72e58444) SHA1(09ae85c131f7b4a0638efd1dff0807cc20b59637) ) | |
| 2668 | ROM_LOAD( "0012c0d8.bin", 0x140000, 0x020000, CRC(84e8e517) SHA1(f1e81913181b9c6276a430988fefc00597e33e89) ) | |
| 2669 | ROM_LOAD( "00147e22.bin", 0x160000, 0x020000, CRC(66efd53e) SHA1(40cfc20df93f9ec1f260fc3f56bb5ac0be775cc6) ) | |
| 2670 | ROM_LOAD( "001645ce.bin", 0x180000, 0x020000, CRC(adc73d19) SHA1(4df4bd7db6bf2f9af06d9d3ec9466970bec7833c) ) | |
| 2671 | ROM_LOAD( "0017c6b2.bin", 0x1a0000, 0x020000, CRC(717f2e91) SHA1(e03d778a1c39cf01827f79a1b10c03a4a6047962) ) | |
| 2672 | ROM_LOAD( "0019902e.bin", 0x1c0000, 0x020000, CRC(f4882ea8) SHA1(a27e52062780e095675f749191e0ea22755152eb) ) | |
| 2673 | ROM_LOAD( "001b562a.bin", 0x1e0000, 0x013e00, CRC(01ae0721) SHA1(b9f24e0bb8609b8cb1a45e7c1e1dc1f271bbdcaf) ) | |
| 2674 | 2647 | ROM_END |
| 2675 | 2648 | |
| 2676 | 2649 | /* |
| r10613 | r10614 | |
| 2741 | 2714 | // on-cart X76F100 eeprom contents |
| 2742 | 2715 | ROM_REGION( 0x84, "naomibd_eeprom", 0 ) |
| 2743 | 2716 | ROM_LOAD( "841-0003.sf", 0x000000, 0x000084, CRC(3a119a17) SHA1(d37a092cca7c9cfc5f2637b355af90a65d04013e) ) |
| 2744 | ||
| 2745 | // trojaned protection data (filename is word offset) | |
| 2746 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 2747 | ROM_LOAD( "00000500.bin", 0x000000, 0x020000, CRC(a42f0337) SHA1(0aaeff753a4e2f9b5d287cd80952533f0ced430c) ) | |
| 2748 | ROM_LOAD( "00020504.bin", 0x020000, 0x020000, CRC(3d3bfbe4) SHA1(4748ca4c14a31da623ebd3a1acff93635c039888) ) | |
| 2749 | ROM_LOAD( "00040508.bin", 0x040000, 0x020000, CRC(d0c3699c) SHA1(11a4e8b47cb6ae827307cd44689477ebfe23d690) ) | |
| 2750 | ROM_LOAD( "0006050c.bin", 0x060000, 0x020000, CRC(bc2e8e71) SHA1(253561a58caf15607d87d932d9b98d6ffa779669) ) | |
| 2751 | ROM_LOAD( "00080510.bin", 0x080000, 0x020000, CRC(a26a6159) SHA1(8e4f0a2091b5b2eb825bb9220c5e4dfe9ab935fe) ) | |
| 2752 | ROM_LOAD( "000a0514.bin", 0x0a0000, 0x020000, CRC(83138b3b) SHA1(6b69e43b6e6c4b75278045a883337cb7abcf9501) ) | |
| 2753 | ROM_LOAD( "000c0518.bin", 0x0c0000, 0x020000, CRC(9f246058) SHA1(bc54f3bdc23a278b14867e096c3f644447b9c0a6) ) | |
| 2754 | ROM_LOAD( "000e051c.bin", 0x0e0000, 0x020000, CRC(7cfd53d5) SHA1(d77ff8d3edbc2d41334d6416d17339ea2c764887) ) | |
| 2755 | ROM_LOAD( "00100520.bin", 0x100000, 0x020000, CRC(8dd856d3) SHA1(9952fdf9017bdb8c50b413de5817a746c24901e9) ) | |
| 2756 | ROM_LOAD( "0011a5b4.bin", 0x120000, 0x020000, CRC(484c511d) SHA1(02c8c1b46ce8a27b85652d3f032f4f42be5341ba) ) | |
| 2757 | ROM_LOAD( "0012e7c4.bin", 0x140000, 0x020000, CRC(ceffdd4b) SHA1(36dfa9fd4857429cf9b505d04d7a82d3bc161b90) ) | |
| 2758 | ROM_LOAD( "001471f6.bin", 0x160000, 0x020000, CRC(263d0706) SHA1(194e259b78d3006372ad007a7e3b9456f607b922) ) | |
| 2759 | ROM_LOAD( "001640c4.bin", 0x180000, 0x020000, CRC(3addb31e) SHA1(97794166b0811ff9535b3a3f598e0cb3da9fc7b3) ) | |
| 2760 | ROM_LOAD( "001806ca.bin", 0x1a0000, 0x020000, CRC(dbfddad2) SHA1(72696b5ed942fe3ef0bc271f6d66d5f089221192) ) | |
| 2761 | ROM_LOAD( "00199df4.bin", 0x1c0000, 0x020000, CRC(2ab0d0c3) SHA1(10642e9d8c9c24f366359fbe7890a0f1347a7a1a) ) | |
| 2762 | ROM_LOAD( "001b5d0a.bin", 0x1e0000, 0x017e00, CRC(c9c3bbd5) SHA1(6f3853e3e1614993b5d658ebec6bf5183577ab36) ) | |
| 2763 | 2717 | ROM_END |
| 2764 | 2718 | |
| 2765 | 2719 | /* |
| r10613 | r10614 | |
| 3424 | 3378 | ROM_LOAD("mpr-23353.ic12", 0x6000000, 0x0800000, CRC(daa0ca24) SHA1(afce14e213e79add7fded838e71bb4447425906a) ) |
| 3425 | 3379 | ROM_LOAD("mpr-23354.ic13", 0x6800000, 0x0800000, CRC(cea127f7) SHA1(11f12472ebfc93eb72b764c780e30afd4812dbe9) ) |
| 3426 | 3380 | ROM_LOAD("mpr-23355.ic14", 0x7000000, 0x0800000, CRC(e809685f) SHA1(dc052b4eb4fdcfdc22c4807316ce34ee7a0d58a6) ) |
| 3427 | ||
| 3428 | // trojaned protection data | |
| 3429 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 3430 | ROM_LOAD( "a0100000.bin", 0x000000, 0x010000, CRC(cbe5a37a) SHA1(63f40758ef94d02a53ad860b2bed9c41e20a8263) ) | |
| 3431 | ROM_LOAD( "a010b268.bin", 0x010000, 0x010000, CRC(7f0ba37e) SHA1(2d33703c9ec08800c3fae23991859f713f8c944b) ) | |
| 3432 | ROM_LOAD( "a0115558.bin", 0x020000, 0x010000, CRC(882c945f) SHA1(60bf8fe3dcf079464f660c7c210d2a379b2ef04f) ) | |
| 3433 | ROM_LOAD( "a0120b28.bin", 0x030000, 0x010000, CRC(024952c0) SHA1(98e4ce87b5ac1169b5ab1ba9cc7553069e09cbbe) ) | |
| 3434 | ROM_LOAD( "a012987a.bin", 0x040000, 0x010000, CRC(50ea6621) SHA1(ea4e5e0b9563c5e49794a634c08be8d2e81fb773) ) | |
| 3435 | ROM_LOAD( "a012e320.bin", 0x050000, 0x010000, CRC(e445906e) SHA1(cd585100b78253bdd16f3895fdb37ff1e08690f6) ) | |
| 3436 | ROM_LOAD( "a0133cf6.bin", 0x060000, 0x00f014, CRC(5763d154) SHA1(645b0a10fd196f53ff7f656b8db798c8e753c4ed) ) | |
| 3437 | ROM_LOAD( "a0170000.bin", 0x070000, 0x010000, CRC(e153030a) SHA1(e1738ec558f0e3d5a796e34618c533cfcd6928ed) ) | |
| 3438 | ROM_LOAD( "a017cf18.bin", 0x080000, 0x010000, CRC(def783cf) SHA1(911e6b99f8ce498ddd5048ea655b76cad33f47c0) ) | |
| 3439 | ROM_LOAD( "a018a45a.bin", 0x090000, 0x010000, CRC(408cd99b) SHA1(110f9922cded7ffc5108ed964b82ac39beb6ce6b) ) | |
| 3440 | ROM_LOAD( "a0197852.bin", 0x0a0000, 0x010000, CRC(09d10a60) SHA1(04bfdba2ea9a45cb10a60fe95d7d2e0997012b4f) ) | |
| 3441 | ROM_LOAD( "a01a4916.bin", 0x0b0000, 0x010000, CRC(3895730e) SHA1(b2c0a839e330916e598c8f27f2a4873bbaaddbde) ) | |
| 3442 | ROM_LOAD( "a01b1c3e.bin", 0x0c0000, 0x010000, CRC(eecb6a13) SHA1(0203c54b98aaf203e7d1b3646102efe63c550115) ) | |
| 3443 | ROM_LOAD( "a01bef38.bin", 0x0d0000, 0x010000, CRC(7d9a497c) SHA1(680a49389e7774aa03ebe6fc844dea53b430796f) ) | |
| 3444 | ROM_LOAD( "a01cbb10.bin", 0x0e0000, 0x010000, CRC(69b770bd) SHA1(aac5801d9a8a48ef77e932195cd7c30ae562bc38) ) | |
| 3445 | ROM_LOAD( "a01d7500.bin", 0x0f0000, 0x010000, CRC(a1119fca) SHA1(1acda8f73a5b1fb180985245b8b0eb9453db0cea) ) | |
| 3446 | ROM_LOAD( "a0200000.bin", 0x100000, 0x010000, CRC(21662b41) SHA1(4dab25dcc92d1a7418d308542499bdec6c3b3b2b) ) | |
| 3447 | ROM_LOAD( "a0210004.bin", 0x110000, 0x010000, CRC(07166890) SHA1(529c28bf925243468fc00b0ad5ea57429d4de907) ) | |
| 3448 | ROM_LOAD( "a0220008.bin", 0x120000, 0x008000, CRC(09cd1354) SHA1(83f6b36aec4e7c5aa1b8bc21dc6fabf8f283ed55) ) | |
| 3449 | ROM_LOAD( "a0228000.bin", 0x130000, 0x008000, CRC(628a4917) SHA1(cf36bc2413cb63fb511936ab4b5f11b7c8cbb057) ) | |
| 3450 | 3381 | ROM_END |
| 3451 | 3382 | |
| 3452 | 3383 | /* |
| r10613 | r10614 | |
| 3640 | 3571 | ROM_LOAD("mpr-23061.ic30", 0x7000000, 0x0800000, CRC(fb1844c4) SHA1(1d1571516a6dbed0c4ded3b80efde9cc9281f66f) ) |
| 3641 | 3572 | ROM_LOAD("mpr-23083.ic31", 0x7800000, 0x0400000, CRC(c61d2dfe) SHA1(a05fb979ed7c8040de91716fc8814e6bd995efa2) ) |
| 3642 | 3573 | ROM_LOAD("mpr-23084.ic32", 0x8000000, 0x0400000, CRC(e228cdfd) SHA1(d02a2e3557bd24cf34c5ddb42d41ca15e78ae885) ) |
| 3643 | ||
| 3644 | ||
| 3645 | ||
| 3646 | // DMA protection data | |
| 3647 | ROM_LOAD("88000000.bin", 0x8800000, 0x025f00, CRC(77d79823) SHA1(2545d28eee47114e8ffb9bc6d7a910e90fc48420) ) | |
| 3648 | ROM_LOAD("88026440.bin", 0x8830000, 0x016520, CRC(dad9ebbd) SHA1(39c0697caa2b5ee11d99e75726e92ed86a23f10b) ) | |
| 3649 | ROM_LOAD("8803bda0.bin", 0x8850000, 0x01e5e0, CRC(9e0b8202) SHA1(729bed557c1a00da13c990603bbadab38d90285e) ) | |
| 3650 | ROM_LOAD("8805a560.bin", 0x8870000, 0x0017a0, CRC(7bc27482) SHA1(6ce6074cf47989f42af02deb7aac52883912784a) ) | |
| 3651 | ROM_LOAD("8805b720.bin", 0x8880000, 0x02b5a0, CRC(485d0aef) SHA1(853f4b49b489cc512c906edcaf3cd8b5bf4c64c0) ) | |
| 3652 | ROM_LOAD("8808b7e0.bin", 0x88a0000, 0x013ec0, CRC(0fc8f363) SHA1(dad30d43cef89d01ce80301b1d796aabad755de6) ) | |
| 3653 | 3574 | ROM_END |
| 3654 | 3575 | |
| 3655 | 3576 | /* toy fighter - 1999 sega */ |
| r10613 | r10614 | |
| 3744 | 3665 | ROM_LOAD( "mpr-22182.ic19s", 0x9800000, 0x800000, CRC(c5606c42) SHA1(5871104ff1c7acde0493e13b9a4d0abdf8a40728) ) |
| 3745 | 3666 | ROM_LOAD( "mpr-22183.ic20s", 0xa000000, 0x800000, CRC(776af308) SHA1(7d29cb4dce75d34c622549fea7e102868d0da60a) ) |
| 3746 | 3667 | |
| 3747 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 3748 | ROM_LOAD( "00800000.bin", 0x000000, 0x002000, CRC(7fc42084) SHA1(7c7b9e7e0b8885e690f3edd25e6d26201c899f2f) ) | |
| 3749 | ||
| 3750 | 3668 | // JVS I/O board 837-13844, code is for a Z80 of unknown type (it's inside the big Sega ASIC) |
| 3751 | 3669 | ROM_REGION( 0x20000, "jvsio", ROMREGION_ERASEFF) |
| 3752 | 3670 | ROM_LOAD( "epr-21868.ic7", 0x000000, 0x010000, CRC(c306a51f) SHA1(7833b73dc34c4c62401a30637968f46b949ceac0) ) |
| r10613 | r10614 | |
| 3803 | 3721 | ROM_LOAD( "mpr-22913.ic4", 0x2000000, 0x800000, CRC(1fbdc41a) SHA1(eb8b9577b7677b9e9aec05ae950dee516ae15bf5) ) |
| 3804 | 3722 | ROM_LOAD( "mpr-22914.ic5", 0x2800000, 0x800000, CRC(77844b60) SHA1(65d71febb8a160d00778ac7b53e082253cad9834) ) |
| 3805 | 3723 | ROM_LOAD( "mpr-22915.ic6", 0x3000000, 0x800000, CRC(e48148ac) SHA1(c1273353eeaf9bb6b185f133281d7d04271bc895) ) |
| 3806 | ||
| 3807 | // trojaned protection data (filename is address read from) | |
| 3808 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 3809 | ROM_LOAD( "a0cad0c0.bin", 0x000000, 0x0101b2, CRC(0db80e6d) SHA1(74f8e817e3e69c64391b2eff2c8c504dcad9f84f) ) | |
| 3810 | 3724 | ROM_END |
| 3811 | 3725 | |
| 3812 | 3726 | /* |
| r10613 | r10614 | |
| 4102 | 4016 | ROM_LOAD32_WORD("mpr-23226.ic32", 0x8000002, 0x0800000, CRC(cd5da506) SHA1(2e76c8892c1d389b0f12a0046213f43d2ab07d78) ) //ic 17 |
| 4103 | 4017 | |
| 4104 | 4018 | ROM_COPY( "user1", 0x1400000, 0x0800000, 0x0800000 ) // mirror data for IC1 (no test on this game, but layout is the same as gram2000) |
| 4105 | ||
| 4106 | // trojaned protection data (must be in the "user1" region because it's accessed via DMA) | |
| 4107 | ROM_LOAD( "81452000_dma.bin", 0x9000000, 0x000120, CRC(96049488) SHA1(e2b98e8986f8cbf026db50a652300081a8e470b0) ) | |
| 4108 | 4019 | ROM_END |
| 4109 | 4020 | |
| 4110 | 4021 | /* |
| r10613 | r10614 | |
| 4695 | 4606 | ROM_LOAD32_WORD( "mpr-22322.32", 0x7800002, 0x800000, CRC(21bf1caf) SHA1(bc1828db2f5f71ef87153a81b49b2ba72ba176e1) ) |
| 4696 | 4607 | ROM_LOAD32_WORD( "mpr-22323.33s", 0x8800000, 0x800000, CRC(0bd632ab) SHA1(21acab5336dd0ba317839176f2557df95917729e) ) |
| 4697 | 4608 | ROM_LOAD32_WORD( "mpr-22324.34", 0x8800002, 0x800000, CRC(ff2571d4) SHA1(c2cbb2345163bbf1973e63cefb9a952e5a52a6cf) ) |
| 4698 | ||
| 4699 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 4700 | ROM_LOAD( "01f169c0.bin", 0x000000, 0x000100, CRC(b0a330f4) SHA1(10c7a7f4d6c7f265a32887beaca73686c4cb1e03) ) | |
| 4701 | 4609 | ROM_END |
| 4702 | 4610 | |
| 4703 | 4611 | ROM_START( kick4csh ) |
| r10613 | r10614 | |
| 6137 | 6045 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) |
| 6138 | 6046 | //PIC16C622A (317-0345-JPN) |
| 6139 | 6047 | //(sticker 253-5508-0345J) |
| 6140 | ROM_LOAD( "317-0345-jpn.pic", 0x000000, 0x004000, CRC(56e1274a) SHA1(735a6071226f3297de64bc0a38be741e87f5d023) ) | |
| 6048 | ROM_LOAD( "317-0345-jpn.pic", 0x000000, 0x004000, CRC(56e1274a) SHA1(735a6071226f3297de64bc0a38be741e87f5d023) ) | |
| 6141 | 6049 | ROM_END |
| 6142 | 6050 | |
| 6143 | 6051 | ROM_START( initdv2jo ) |
| 6144 | NAOMI | |
| 6052 | NAOMIGD_BIOS | |
| 6145 | 6053 | NAOMI_DEFAULT_EEPROM |
| 6146 | 6054 | |
| 6147 | 6055 | DISK_REGION( "gdrom" ) |
| r10613 | r10614 | |
| 6163 | 6071 | |
| 6164 | 6072 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) |
| 6165 | 6073 | //PIC16C622A (317-0357-EXP) |
| 6166 | ROM_LOAD( "317-0357-exp.pic", 0x000000, 0x004000, CRC(38f84b4d) SHA1(03c12d8580da1a4b3a554e62fd8b1f3447b7ebbd) ) | |
| 6074 | ROM_LOAD( "317-0357-exp.pic", 0x000000, 0x004000, CRC(38f84b4d) SHA1(03c12d8580da1a4b3a554e62fd8b1f3447b7ebbd) ) | |
| 6167 | 6075 | ROM_END |
| 6168 | 6076 | |
| 6169 | 6077 | ROM_START( initdv3j ) |
| r10613 | r10614 | |
| 6181 | 6089 | ROM_END |
| 6182 | 6090 | |
| 6183 | 6091 | ROM_START( initdv3jb ) |
| 6184 | NAOMI | |
| 6092 | NAOMIGD_BIOS | |
| 6185 | 6093 | NAOMI_DEFAULT_EEPROM |
| 6186 | 6094 | |
| 6187 | 6095 | DISK_REGION( "gdrom" ) |
| r10613 | r10614 | |
| 6923 | 6831 | static const UINT32 mslug6_key = 0x53627; |
| 6924 | 6832 | static const UINT32 samsptk_key = 0xe935f; |
| 6925 | 6833 | static const UINT32 ggx15_key = 0x91257; |
| 6834 | static const UINT32 rumblef2_key = 0xd674a; | |
| 6926 | 6835 | |
| 6927 | 6836 | static DRIVER_INIT( atomiswave ) |
| 6928 | 6837 | { |
| r10613 | r10614 | |
| 6975 | 6884 | AW_DRIVER_INIT(mslug6) |
| 6976 | 6885 | AW_DRIVER_INIT(samsptk) |
| 6977 | 6886 | AW_DRIVER_INIT(ggx15) |
| 6887 | AW_DRIVER_INIT(rumblef2) | |
| 6978 | 6888 | |
| 6979 | 6889 | ROM_START( fotns ) |
| 6980 | 6890 | ROM_REGION( 0x200000, "awflash", 0) |
| r10613 | r10614 | |
| 7287 | 7197 | AW_BIOS |
| 7288 | 7198 | |
| 7289 | 7199 | ROM_REGION( 0x8000000, "user1", ROMREGION_ERASE) |
| 7290 | ROM_LOAD( "ax0801p01.ic18", 0x0000000, 0x0800000, CRC(d920c6bb) SHA1(ab34bbef3c71396447bc5322d8e8786041fc832a) ) | |
| 7291 | ROM_LOAD( "ax0801m01.ic11", 0x1000000, 0x1000000, CRC(61879b2d) SHA1(9592fbd979cef9d8f465cd92d0f00b9c13ecf7ba) ) | |
| 7292 | ROM_LOAD( "ax0802m01.ic12", 0x2000000, 0x1000000, CRC(c0ff124d) SHA1(dd403d10de2f097fbaa6b93bc311e2b9e893828d) ) | |
| 7293 | ROM_LOAD( "ax0803m01.ic13", 0x3000000, 0x1000000, CRC(4400c89a) SHA1(4e13536c01103ecfbfc9e3e33746ceae7a91a520) ) | |
| 7294 | ROM_LOAD( "ax0804m01.ic14", 0x4000000, 0x1000000, CRC(70f58ab4) SHA1(cd2def19bbad945c87567f8d28f3a2a179a7f7f6) ) | |
| 7295 | ROM_LOAD( "ax0805m01.ic15", 0x5000000, 0x1000000, CRC(72740e45) SHA1(646eded89f10008c9176cd6772a8ac9d1bf4271a) ) | |
| 7296 | ROM_LOAD( "ax0806m01.ic16", 0x6000000, 0x1000000, CRC(3bf8ecba) SHA1(43e7fbf21d8ee60bab72ce558640730fd9c3e3b8) ) | |
| 7297 | ROM_LOAD( "ax0807m01.ic17", 0x7000000, 0x1000000, CRC(e397dd79) SHA1(5fec32dc19dd71ef0d451f8058186f998015723b) ) | |
| 7200 | ROM_LOAD( "ax0801p01.ic18", 0x0000000, 0x0800000, CRC(d920c6bb) SHA1(ab34bbef3c71396447bc5322d8e8786041fc832a) ) | |
| 7201 | ROM_LOAD( "ax0801m01.ic11", 0x1000000, 0x1000000, CRC(61879b2d) SHA1(9592fbd979cef9d8f465cd92d0f00b9c13ecf7ba) ) | |
| 7202 | ROM_LOAD( "ax0802m01.ic12", 0x2000000, 0x1000000, CRC(c0ff124d) SHA1(dd403d10de2f097fbaa6b93bc311e2b9e893828d) ) | |
| 7203 | ROM_LOAD( "ax0803m01.ic13", 0x3000000, 0x1000000, CRC(4400c89a) SHA1(4e13536c01103ecfbfc9e3e33746ceae7a91a520) ) | |
| 7204 | ROM_LOAD( "ax0804m01.ic14", 0x4000000, 0x1000000, CRC(70f58ab4) SHA1(cd2def19bbad945c87567f8d28f3a2a179a7f7f6) ) | |
| 7205 | ROM_LOAD( "ax0805m01.ic15", 0x5000000, 0x1000000, CRC(72740e45) SHA1(646eded89f10008c9176cd6772a8ac9d1bf4271a) ) | |
| 7206 | ROM_LOAD( "ax0806m01.ic16", 0x6000000, 0x1000000, CRC(3bf8ecba) SHA1(43e7fbf21d8ee60bab72ce558640730fd9c3e3b8) ) | |
| 7207 | ROM_LOAD( "ax0807m01.ic17", 0x7000000, 0x1000000, CRC(e397dd79) SHA1(5fec32dc19dd71ef0d451f8058186f998015723b) ) | |
| 7298 | 7208 | ROM_END |
| 7299 | 7209 | |
| 7210 | ROM_START( rumblef2 ) | |
| 7211 | ROM_REGION( 0x200000, "awflash", 0) | |
| 7212 | AW_BIOS | |
| 7213 | ||
| 7214 | ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) | |
| 7215 | ROM_LOAD( "ax3401p01.fmem1", 0x0000000, 0x0800000, CRC(a33601cf) SHA1(2dd60a9c3a2517f2257ab69288fa95645de133fa) ) | |
| 7216 | ROM_LOAD( "ax3401m01.mrom1", 0x1000000, 0x2000000, CRC(60894d4c) SHA1(5b21af3c7c82d4d64bfd8498c26283111ada1298) ) | |
| 7217 | ROM_LOAD( "ax3402m01.mrom2", 0x3000000, 0x2000000, CRC(e4224cc9) SHA1(dcab06fcf48cda286f93d2b37f03a83abf3230cb) ) | |
| 7218 | ROM_LOAD( "ax3403m01.mrom3", 0x5000000, 0x2000000, CRC(081c0edb) SHA1(63a3f1b5f9d7ca4367868c492236406f23996cc3) ) | |
| 7219 | ROM_LOAD( "ax3404m01.mrom4", 0x7000000, 0x2000000, CRC(a426b443) SHA1(617aab42e432a80b0663281fb7faa6c14ef4f149) ) | |
| 7220 | ROM_LOAD( "ax3405m01.mrom5", 0x9000000, 0x2000000, CRC(4766ce56) SHA1(349b82013a75905ae5520b14a87702c9038a5def) ) | |
| 7221 | ROM_COPY( "user1", 0x9000000, 0xb000000, 0x2000000) | |
| 7222 | ROM_END | |
| 7223 | ||
| 7300 | 7224 | /* Atomiswave */ |
| 7301 | 7225 | GAME( 2001, awbios, 0, aw, aw, atomiswave, ROT0, "Sammy", "Atomiswave Bios", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT ) |
| 7302 | 7226 | |
| r10613 | r10614 | |
| 7313 | 7237 | GAME( 2004, ftspeed, awbios, aw, aw, ftspeed, ROT0, "Sammy", "Faster Than Speed", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 7314 | 7238 | GAME( 2004, kov7sprt, awbios, aw, aw, kov7sprt, ROT0, "Sammy / IGS", "Knights of Valour - The Seven Spirits", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND ) |
| 7315 | 7239 | GAME( 2005, vfurlong, awbios, aw, aw, vfurlong, ROT0, "Sammy", "Net Select Keiba Victory Furlong", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 7240 | GAME( 2004, rumblef2, awbios, aw, aw, rumblef2, ROT0, "Sammy / Dimps", "The Rumble Fish 2", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 7316 | 7241 | GAME( 2005, ngbc, awbios, aw, aw, ngbc, ROT0, "Sammy / SNK Playmore", "Neo-Geo Battle Coliseum", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 7317 | 7242 | GAME( 2005, samsptk, awbios, aw, aw, samsptk, ROT0, "Sammy / SNK Playmore", "Samurai Spirits Tenkaichi Kenkakuden", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 7318 | 7243 | GAME( 2005, kofxi, awbios, aw, aw, kofxi, ROT0, "Sammy / SNK Playmore", "The King of Fighters XI", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| r10613 | r10614 | |
|---|---|---|
| 504 | 504 | MCFG_SCREEN_SIZE(342,262) |
| 505 | 505 | MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 224-1) |
| 506 | 506 | MCFG_SCREEN_UPDATE(mtnew) |
| 507 | ||
| 508 | MCFG_SCREEN_MODIFY("megadriv") | |
| 509 | MCFG_SCREEN_UPDATE(mtnew) | |
| 507 | 510 | MCFG_SCREEN_EOF(mtnew) |
| 508 | 511 | |
| 509 | 512 | /* sound hardware */ |
| r10613 | r10614 | |
|---|---|---|
| 651 | 651 | MCFG_SCREEN_UPDATE(fromanc2) |
| 652 | 652 | |
| 653 | 653 | MCFG_VIDEO_START(fromancr) |
| 654 | ||
| 654 | ||
| 655 | 655 | /* sound hardware */ |
| 656 | 656 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 657 | 657 |
| r10613 | r10614 | |
|---|---|---|
| 2917 | 2917 | |
| 2918 | 2918 | |
| 2919 | 2919 | |
| 2920 | static MACHINE_CONFIG_START( NBMJDRV_4096, | |
| 2920 | static MACHINE_CONFIG_START( NBMJDRV_4096, nbmj8688_stat | |
| 2921 | 2921 | |
| 2922 | 2922 | /* basic machine hardware */ |
| 2923 | 2923 | MCFG_CPU_ADD("maincpu", Z80, 5000000) /* 5.00 MHz */ |
| r10613 | r10614 | |
| 3039 | 3039 | MACHINE_CONFIG_END |
| 3040 | 3040 | |
| 3041 | 3041 | |
| 3042 | static MACHINE_CONFIG_START( mbmj_p16bit_LCD, | |
| 3042 | static MACHINE_CONFIG_START( mbmj_p16bit_LCD, nbmj8688_stat | |
| 3043 | 3043 | |
| 3044 | 3044 | /* basic machine hardware */ |
| 3045 | 3045 | MCFG_CPU_ADD("maincpu", Z80, 5000000) /* 5.00 MHz */ |
| r10613 | r10614 | |
|---|---|---|
| 148 | 148 | |
| 149 | 149 | /******************************************************************************/ |
| 150 | 150 | |
| 151 | /* local stuff */ | |
| 152 | static UINT8 *work_ram, *work_ram_1; | |
| 153 | static int coin; | |
| 154 | 151 | |
| 155 | 152 | static WRITE8_HANDLER( sprite_dma_0_w ) |
| 156 | 153 | { |
| r10613 | r10614 | |
| 166 | 163 | |
| 167 | 164 | static WRITE8_HANDLER( vsnes_coin_counter_w ) |
| 168 | 165 | { |
| 166 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 169 | 167 | coin_counter_w( space->machine, 0, data & 0x01 ); |
| 170 | coin = data; | |
| 168 | state->coin = data; | |
| 171 | 169 | |
| 172 | 170 | //"bnglngby" and "cluclu" |
| 173 | 171 | if( data & 0xfe ) |
| r10613 | r10614 | |
| 178 | 176 | |
| 179 | 177 | static READ8_HANDLER( vsnes_coin_counter_r ) |
| 180 | 178 | { |
| 179 | vsnes_state *state = space->machine->driver_data<vsnes_state>(); | |
| 181 | 180 | //only for platoon |
| 182 | return coin; | |
| 181 | return state->coin; | |
| 183 | 182 | } |
| 184 | 183 | |
| 185 | 184 | static WRITE8_HANDLER( vsnes_coin_counter_1_w ) |
| r10613 | r10614 | |
| 210 | 209 | } |
| 211 | 210 | |
| 212 | 211 | static ADDRESS_MAP_START( vsnes_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 213 | AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x1800) AM_RAM AM_BASE( | |
| 212 | AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x1800) AM_RAM AM_BASE_MEMBER(vsnes_state, work_ram) | |
| 214 | 213 | AM_RANGE(0x2000, 0x3fff) AM_DEVREADWRITE("ppu1", ppu2c0x_r, ppu2c0x_w) |
| 215 | 214 | AM_RANGE(0x4011, 0x4011) AM_DEVWRITE("dac1", dac_w) |
| 216 | 215 | AM_RANGE(0x4000, 0x4013) AM_DEVREADWRITE("nes1", nes_psg_r, nes_psg_w) |
| r10613 | r10614 | |
| 224 | 223 | ADDRESS_MAP_END |
| 225 | 224 | |
| 226 | 225 | static ADDRESS_MAP_START( vsnes_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 227 | AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x1800) AM_RAM AM_BASE( | |
| 226 | AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x1800) AM_RAM AM_BASE_MEMBER(vsnes_state, work_ram_1) | |
| 228 | 227 | AM_RANGE(0x2000, 0x3fff) AM_DEVREADWRITE("ppu2", ppu2c0x_r, ppu2c0x_w) |
| 229 | 228 | AM_RANGE(0x4011, 0x4011) AM_DEVWRITE("dac2", dac_w) |
| 230 | 229 | AM_RANGE(0x4000, 0x4013) AM_DEVREADWRITE("nes2", nes_psg_r, nes_psg_w) |
| r10613 | r10614 | |
| 1641 | 1640 | "sub" |
| 1642 | 1641 | }; |
| 1643 | 1642 | |
| 1644 | static MACHINE_CONFIG_START( vsnes, | |
| 1643 | static MACHINE_CONFIG_START( vsnes, | |
| 1645 | 1644 | |
| 1646 | 1645 | /* basic machine hardware */ |
| 1647 | 1646 | MCFG_CPU_ADD("maincpu", N2A03,N2A03_DEFAULTCLOCK) |
| r10613 | r10614 | |
| 1700 | 1699 | MCFG_PPU2C05_04_ADD("ppu1", vsnes_ppu_interface_1) |
| 1701 | 1700 | MACHINE_CONFIG_END |
| 1702 | 1701 | |
| 1703 | static MACHINE_CONFIG_START( vsdual, | |
| 1702 | static MACHINE_CONFIG_START( vsdual, | |
| 1704 | 1703 | |
| 1705 | 1704 | /* basic machine hardware */ |
| 1706 | 1705 | MCFG_CPU_ADD("maincpu", N2A03,N2A03_DEFAULTCLOCK) |
| r10613 | r10614 | |
|---|---|---|
| 129 | 129 | AM_RANGE(0xc000, 0xc0ff) AM_READ(victory_video_control_r) |
| 130 | 130 | AM_RANGE(0xc100, 0xc1ff) AM_WRITE(victory_video_control_w) |
| 131 | 131 | AM_RANGE(0xc200, 0xc3ff) AM_WRITE(victory_paletteram_w) |
| 132 | AM_RANGE(0xc400, 0xc7ff) AM_RAM AM_BASE(&victory_videoram) | |
| 133 | AM_RANGE(0xc800, 0xdfff) AM_RAM AM_BASE(&victory_charram) | |
| 132 | AM_RANGE(0xc400, 0xc7ff) AM_RAM AM_BASE_MEMBER(victory_state, videoram) | |
| 133 | AM_RANGE(0xc800, 0xdfff) AM_RAM AM_BASE_MEMBER(victory_state, charram) | |
| 134 | 134 | AM_RANGE(0xe000, 0xefff) AM_RAM |
| 135 | 135 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE("nvram") |
| 136 | 136 | AM_RANGE(0xf800, 0xf800) AM_MIRROR(0x07fc) AM_DEVREADWRITE("custom", victory_sound_response_r, victory_sound_command_w) |
| r10613 | r10614 | |
| 208 | 208 | * |
| 209 | 209 | *************************************/ |
| 210 | 210 | |
| 211 | static MACHINE_CONFIG_START( victory, | |
| 211 | static MACHINE_CONFIG_START( victory, | |
| 212 | 212 | |
| 213 | 213 | /* basic machine hardware */ |
| 214 | 214 | MCFG_CPU_ADD("maincpu", Z80, VICTORY_MAIN_CPU_CLOCK) |
| r10613 | r10614 | |
|---|---|---|
| 1475 | 1475 | }; |
| 1476 | 1476 | |
| 1477 | 1477 | |
| 1478 | static MACHINE_CONFIG_START( nbmjdrv1, | |
| 1478 | static MACHINE_CONFIG_START( nbmjdrv1, nbmj8991_stat | |
| 1479 | 1479 | |
| 1480 | 1480 | /* basic machine hardware */ |
| 1481 | 1481 | MCFG_CPU_ADD("maincpu", Z80, 25000000/5) /* 5.00 MHz ? */ |
| r10613 | r10614 | |
| 1508 | 1508 | MACHINE_CONFIG_END |
| 1509 | 1509 | |
| 1510 | 1510 | |
| 1511 | static MACHINE_CONFIG_START( nbmjdrv2, | |
| 1511 | static MACHINE_CONFIG_START( nbmjdrv2, nbmj8991_stat | |
| 1512 | 1512 | |
| 1513 | 1513 | /* basic machine hardware */ |
| 1514 | 1514 | MCFG_CPU_ADD("maincpu", Z80, 6000000/2) /* 3.00 MHz */ |
| r10613 | r10614 | |
|---|---|---|
| 242 | 242 | #define MAIN_CPU_CLOCK (EXIDY440_MASTER_CLOCK / 8) |
| 243 | 243 | |
| 244 | 244 | |
| 245 | /* local variables */ | |
| 246 | static UINT8 exidy440_bank; | |
| 247 | ||
| 248 | static const UINT8 *showdown_bank_data[2]; | |
| 249 | static INT8 showdown_bank_select; | |
| 250 | static UINT8 showdown_bank_offset; | |
| 251 | ||
| 252 | 245 | static READ8_HANDLER( showdown_bank0_r ); |
| 253 | 246 | |
| 254 | 247 | |
| r10613 | r10614 | |
| 276 | 269 | |
| 277 | 270 | static CUSTOM_INPUT( firq_beam_r ) |
| 278 | 271 | { |
| 279 | return exidy440_firq_beam; | |
| 272 | exidy440_state *state = field->port->machine->driver_data<exidy440_state>(); | |
| 273 | return state->firq_beam; | |
| 280 | 274 | } |
| 281 | 275 | |
| 282 | 276 | |
| 283 | 277 | static CUSTOM_INPUT( firq_vblank_r ) |
| 284 | 278 | { |
| 285 | return exidy440_firq_vblank; | |
| 279 | exidy440_state *state = field->port->machine->driver_data<exidy440_state>(); | |
| 280 | return state->firq_vblank; | |
| 286 | 281 | } |
| 287 | 282 | |
| 288 | 283 | |
| r10613 | r10614 | |
| 303 | 298 | |
| 304 | 299 | void exidy440_bank_select(running_machine *machine, UINT8 bank) |
| 305 | 300 | { |
| 301 | exidy440_state *state = machine->driver_data<exidy440_state>(); | |
| 306 | 302 | /* for the showdown case, bank 0 is a PLD */ |
| 307 | if (showdown_bank_data[0] != NULL) | |
| 303 | if (state->showdown_bank_data[0] != NULL) | |
| 308 | 304 | { |
| 309 | if (bank == 0 && e | |
| 305 | if (bank == 0 && state-> | |
| 310 | 306 | memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4000, 0x7fff, 0, 0, showdown_bank0_r); |
| 311 | else if (bank != 0 && e | |
| 307 | else if (bank != 0 && state-> | |
| 312 | 308 | memory_install_read_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4000, 0x7fff, 0, 0, "bank1"); |
| 313 | 309 | } |
| 314 | 310 | |
| 315 | 311 | /* select the bank and update the bank pointer */ |
| 316 | exidy440_bank = bank; | |
| 317 | memory_set_bankptr(machine, "bank1", &machine->region("maincpu")->base()[0x10000 + exidy440_bank * 0x4000]); | |
| 312 | state->bank = bank; | |
| 313 | memory_set_bankptr(machine, "bank1", &machine->region("maincpu")->base()[0x10000 + state->bank * 0x4000]); | |
| 318 | 314 | } |
| 319 | 315 | |
| 320 | 316 | |
| 321 | 317 | static WRITE8_HANDLER( bankram_w ) |
| 322 | 318 | { |
| 319 | exidy440_state *state = space->machine->driver_data<exidy440_state>(); | |
| 323 | 320 | /* EEROM lives in the upper 8k of bank 15 */ |
| 324 | if (e | |
| 321 | if (state-> | |
| 325 | 322 | { |
| 326 | 323 | space->machine->region("maincpu")->base()[0x10000 + 15 * 0x4000 + offset] = data; |
| 327 | 324 | logerror("W EEROM[%04X] = %02X\n", offset - 0x2000, data); |
| r10613 | r10614 | |
| 398 | 395 | |
| 399 | 396 | static READ8_HANDLER( showdown_bank0_r ) |
| 400 | 397 | { |
| 398 | exidy440_state *state = space->machine->driver_data<exidy440_state>(); | |
| 401 | 399 | /* showdown relies on different values from different memory locations */ |
| 402 | 400 | /* yukon relies on multiple reads from the same location returning different values */ |
| 403 | 401 | UINT8 result = 0xff; |
| 404 | 402 | |
| 405 | 403 | /* fetch the special data if a bank is selected */ |
| 406 | if (showdown_bank_select >= 0) | |
| 404 | if (state->showdown_bank_select >= 0) | |
| 407 | 405 | { |
| 408 | result = showdown_bank_data[showdown_bank_select][showdown_bank_offset++]; | |
| 406 | result = state->showdown_bank_data[state->showdown_bank_select][state->showdown_bank_offset++]; | |
| 409 | 407 | |
| 410 | 408 | /* after 24 bytes, stop and revert back to the beginning */ |
| 411 | if (showdown_bank_offset == 0x18) | |
| 412 | showdown_bank_offset = 0; | |
| 409 | if (state->showdown_bank_offset == 0x18) | |
| 410 | state->showdown_bank_offset = 0; | |
| 413 | 411 | } |
| 414 | 412 | |
| 415 | 413 | /* look for special offsets to adjust our behavior */ |
| 416 | 414 | if (offset == 0x0055) |
| 417 | showdown_bank_select = -1; | |
| 418 | else if (showdown_bank_select == -1) | |
| 415 | state->showdown_bank_select = -1; | |
| 416 | else if (state->showdown_bank_select == -1) | |
| 419 | 417 | { |
| 420 | showdown_bank_select = (offset == 0x00ed) ? 0 : (offset == 0x1243) ? 1 : 0; | |
| 421 | showdown_bank_offset = 0; | |
| 418 | state->showdown_bank_select = (offset == 0x00ed) ? 0 : (offset == 0x1243) ? 1 : 0; | |
| 419 | state->showdown_bank_offset = 0; | |
| 422 | 420 | } |
| 423 | 421 | |
| 424 | 422 | return result; |
| r10613 | r10614 | |
| 439 | 437 | |
| 440 | 438 | static WRITE8_HANDLER( topsecex_yscroll_w ) |
| 441 | 439 | { |
| 442 | *topsecex_yscroll = data; | |
| 440 | exidy440_state *state = space->machine->driver_data<exidy440_state>(); | |
| 441 | *state->topsecex_yscroll = data; | |
| 443 | 442 | } |
| 444 | 443 | |
| 445 | 444 | |
| r10613 | r10614 | |
| 459 | 458 | |
| 460 | 459 | static MACHINE_RESET( exidy440 ) |
| 461 | 460 | { |
| 462 | exidy440_bank = 0xff; | |
| 461 | exidy440_state *state = machine->driver_data<exidy440_state>(); | |
| 462 | state->bank = 0xff; | |
| 463 | 463 | exidy440_bank_select(machine, 0); |
| 464 | 464 | } |
| 465 | 465 | |
| r10613 | r10614 | |
| 472 | 472 | *************************************/ |
| 473 | 473 | |
| 474 | 474 | static ADDRESS_MAP_START( exidy440_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 475 | AM_RANGE(0x0000, 0x1fff) AM_RAM AM_BASE( | |
| 475 | AM_RANGE(0x0000, 0x1fff) AM_RAM AM_BASE_MEMBER( | |
| 476 | 476 | AM_RANGE(0x2000, 0x209f) AM_RAM_WRITE(exidy440_spriteram_w) AM_BASE_GENERIC(spriteram) |
| 477 | 477 | AM_RANGE(0x20a0, 0x29ff) AM_RAM |
| 478 | 478 | AM_RANGE(0x2a00, 0x2aff) AM_READWRITE(exidy440_videoram_r, exidy440_videoram_w) |
| 479 | 479 | AM_RANGE(0x2b00, 0x2b00) AM_READ(exidy440_vertical_pos_r) |
| 480 | 480 | AM_RANGE(0x2b01, 0x2b01) AM_READWRITE(exidy440_horizontal_pos_r, exidy440_interrupt_clear_w) |
| 481 | AM_RANGE(0x2b02, 0x2b02) AM_RAM AM_BASE( | |
| 481 | AM_RANGE(0x2b02, 0x2b02) AM_RAM AM_BASE_MEMBER( | |
| 482 | 482 | AM_RANGE(0x2b03, 0x2b03) AM_READ_PORT("IN0") AM_WRITE(exidy440_control_w) |
| 483 | 483 | AM_RANGE(0x2c00, 0x2dff) AM_READWRITE(exidy440_paletteram_r, exidy440_paletteram_w) |
| 484 | 484 | AM_RANGE(0x2e00, 0x2e1f) AM_RAM_WRITE(sound_command_w) |
| r10613 | r10614 | |
| 1001 | 1001 | * |
| 1002 | 1002 | *************************************/ |
| 1003 | 1003 | |
| 1004 | static MACHINE_CONFIG_START( exidy440, | |
| 1004 | static MACHINE_CONFIG_START( exidy440, | |
| 1005 | 1005 | |
| 1006 | 1006 | /* basic machine hardware */ |
| 1007 | 1007 | MCFG_CPU_ADD("maincpu", M6809, MAIN_CPU_CLOCK) |
| r10613 | r10614 | |
| 1933 | 1933 | |
| 1934 | 1934 | static DRIVER_INIT( exidy440 ) |
| 1935 | 1935 | { |
| 1936 | showdown_bank_data[0] = showdown_bank_data[1] = NULL; | |
| 1936 | exidy440_state *state = machine->driver_data<exidy440_state>(); | |
| 1937 | state->showdown_bank_data[0] = state->showdown_bank_data[1] = NULL; | |
| 1937 | 1938 | } |
| 1938 | 1939 | |
| 1939 | 1940 | |
| r10613 | r10614 | |
| 1947 | 1948 | |
| 1948 | 1949 | static DRIVER_INIT( topsecex ) |
| 1949 | 1950 | { |
| 1951 | exidy440_state *state = machine->driver_data<exidy440_state>(); | |
| 1950 | 1952 | DRIVER_INIT_CALL(exidy440); |
| 1951 | 1953 | |
| 1952 | 1954 | /* extra input ports and scrolling */ |
| r10613 | r10614 | |
| 1954 | 1956 | memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2ec6, 0x2ec6, 0, 0, "AN0"); |
| 1955 | 1957 | memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2ec7, 0x2ec7, 0, 0, "IN4"); |
| 1956 | 1958 | |
| 1957 | topsecex_yscroll = memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2ec1, 0x2ec1, 0, 0, topsecex_yscroll_w); | |
| 1959 | state->topsecex_yscroll = memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2ec1, 0x2ec1, 0, 0, topsecex_yscroll_w); | |
| 1958 | 1960 | } |
| 1959 | 1961 | |
| 1960 | 1962 | |
| 1961 | 1963 | static DRIVER_INIT( showdown ) |
| 1962 | 1964 | { |
| 1965 | exidy440_state *state = machine->driver_data<exidy440_state>(); | |
| 1963 | 1966 | static const UINT8 bankdata0[0x18] = |
| 1964 | 1967 | { |
| 1965 | 1968 | 0x15,0x40,0xc1,0x8d,0x4c,0x84,0x0e,0xce, |
| r10613 | r10614 | |
| 1976 | 1979 | DRIVER_INIT_CALL(exidy440); |
| 1977 | 1980 | |
| 1978 | 1981 | /* set up the fake PLD */ |
| 1979 | showdown_bank_data[0] = bankdata0; | |
| 1980 | showdown_bank_data[1] = bankdata1; | |
| 1982 | state->showdown_bank_data[0] = bankdata0; | |
| 1983 | state->showdown_bank_data[1] = bankdata1; | |
| 1981 | 1984 | } |
| 1982 | 1985 | |
| 1983 | 1986 | |
| 1984 | 1987 | static DRIVER_INIT( yukon ) |
| 1985 | 1988 | { |
| 1989 | exidy440_state *state = machine->driver_data<exidy440_state>(); | |
| 1986 | 1990 | static const UINT8 bankdata0[0x18] = |
| 1987 | 1991 | { |
| 1988 | 1992 | 0x31,0x40,0xc1,0x95,0x54,0x90,0x16,0xd6, |
| r10613 | r10614 | |
| 1999 | 2003 | DRIVER_INIT_CALL(exidy440); |
| 2000 | 2004 | |
| 2001 | 2005 | /* set up the fake PLD */ |
| 2002 | showdown_bank_data[0] = bankdata0; | |
| 2003 | showdown_bank_data[1] = bankdata1; | |
| 2006 | state->showdown_bank_data[0] = bankdata0; | |
| 2007 | state->showdown_bank_data[1] = bankdata1; | |
| 2004 | 2008 | } |
| 2005 | 2009 | |
| 2006 | 2010 |
| r10613 | r10614 | |
|---|---|---|
| 439 | 439 | #include "sound/msm5205.h" |
| 440 | 440 | #include "machine/nvram.h" |
| 441 | 441 | |
| 442 | /* RAM areas */ | |
| 443 | static UINT8* mastboy_tileram; | |
| 444 | static UINT8* mastboy_vram; | |
| 445 | static UINT8* mastboy_colram; | |
| 446 | static UINT8* mastboy_workram; | |
| 447 | 442 | |
| 448 | /* Bank Control */ | |
| 449 | static UINT8 mastboy_bank; | |
| 450 | ||
| 451 | /* General */ | |
| 452 | static int mastboy_irq0_ack; | |
| 453 | static int mastboy_backupram_enabled; | |
| 454 | ||
| 455 | /* MSM5205 */ | |
| 456 | static int mastboy_m5205_next; | |
| 457 | static int mastboy_m5205_part; | |
| 458 | static int mastboy_m5205_sambit0, mastboy_m5205_sambit1; | |
| 459 | ||
| 460 | 443 | class mastboy_state : public driver_device |
| 461 | 444 | { |
| 462 | 445 | public: |
| r10613 | r10614 | |
| 465 | 448 | m_nvram(*this, "nvram") { } |
| 466 | 449 | |
| 467 | 450 | required_shared_ptr<UINT8> m_nvram; |
| 451 | UINT8* tileram; | |
| 452 | UINT8* vram; | |
| 453 | UINT8* colram; | |
| 454 | UINT8* workram; | |
| 455 | UINT8 bank; | |
| 456 | int irq0_ack; | |
| 457 | int backupram_enabled; | |
| 458 | int m5205_next; | |
| 459 | int m5205_part; | |
| 460 | int m5205_sambit0; | |
| 461 | int m5205_sambit1; | |
| 468 | 462 | }; |
| 469 | 463 | |
| 470 | 464 | |
| r10613 | r10614 | |
| 472 | 466 | |
| 473 | 467 | static VIDEO_START(mastboy) |
| 474 | 468 | { |
| 475 | gfx_element_set_source(machine->gfx[0], mastboy_vram); | |
| 469 | mastboy_state *state = machine->driver_data<mastboy_state>(); | |
| 470 | gfx_element_set_source(machine->gfx[0], state->vram); | |
| 476 | 471 | } |
| 477 | 472 | |
| 478 | 473 | static SCREEN_UPDATE(mastboy) |
| 479 | 474 | { |
| 475 | mastboy_state *state = screen->machine->driver_data<mastboy_state>(); | |
| 480 | 476 | int y,x,i; |
| 481 | 477 | int count = 0x000; |
| 482 | 478 | |
| 483 | 479 | for (i=0;i<0x200;i+=2) |
| 484 | 480 | { |
| 485 | int coldat = | |
| 481 | int coldat = | |
| 486 | 482 | |
| 487 | 483 | palette_set_color_rgb(screen->machine,i/2,pal4bit(coldat>>8),pal4bit(coldat>>12),pal4bit(coldat>>4)); |
| 488 | 484 | } |
| r10613 | r10614 | |
| 492 | 488 | for (x=0;x<32;x++) |
| 493 | 489 | { |
| 494 | 490 | /* bytes 0 and 3 seem to be unused for rendering , they appear to contain data the game uses internally */ |
| 495 | int tileno = (mastboy_tileram[count+1]|(mastboy_tileram[count+2]<<8))&0xfff; | |
| 496 | int attr = (mastboy_tileram[count+2]&0xf0)>>4; | |
| 491 | int tileno = (state->tileram[count+1]|(state->tileram[count+2]<<8))&0xfff; | |
| 492 | int attr = (state->tileram[count+2]&0xf0)>>4; | |
| 497 | 493 | gfx_element *gfx; |
| 498 | 494 | |
| 499 | 495 | if (tileno&0x800) |
| r10613 | r10614 | |
| 523 | 519 | |
| 524 | 520 | static READ8_HANDLER(banked_ram_r) |
| 525 | 521 | { |
| 526 | if ((mastboy_bank&0x80) == 0x00) | |
| 522 | mastboy_state *state = space->machine->driver_data<mastboy_state>(); | |
| 523 | if ((state->bank&0x80) == 0x00) | |
| 527 | 524 | { |
| 528 | 525 | int bank; |
| 529 | bank = mastboy_bank & 0x07; | |
| 530 | //if (mastboy_bank&0xf8) printf("invalid bank bits in vram/vrom read\n"); | |
| 526 | bank = state->bank & 0x07; | |
| 527 | //if (state->bank&0xf8) printf("invalid bank bits in vram/vrom read\n"); | |
| 531 | 528 | |
| 532 | 529 | if (bank>0x3) // ROM access |
| 533 | 530 | { |
| r10613 | r10614 | |
| 539 | 536 | { |
| 540 | 537 | bank &=0x3; |
| 541 | 538 | /* we have to invert the data for the GFX decode */ |
| 542 | return | |
| 539 | return | |
| 543 | 540 | } |
| 544 | 541 | } |
| 545 | 542 | else |
| 546 | 543 | { |
| 547 | 544 | UINT8 *src; |
| 548 | 545 | int bank; |
| 549 | bank = | |
| 546 | bank = | |
| 550 | 547 | src = space->machine->region ( "user1" )->base() + bank * 0x4000; |
| 551 | 548 | return src[offset]; |
| 552 | 549 | } |
| r10613 | r10614 | |
| 554 | 551 | |
| 555 | 552 | static WRITE8_HANDLER( banked_ram_w ) |
| 556 | 553 | { |
| 557 | if ((mastboy_bank&0x80) == 0x00) | |
| 554 | mastboy_state *state = space->machine->driver_data<mastboy_state>(); | |
| 555 | if ((state->bank&0x80) == 0x00) | |
| 558 | 556 | { |
| 559 | 557 | int bank; |
| 560 | bank = | |
| 558 | bank = | |
| 561 | 559 | //if (data&0xf8) printf("invalid bank bits in vram/vrom write\n"); |
| 562 | 560 | |
| 563 | 561 | if (bank>0x3) // ROM access |
| r10613 | r10614 | |
| 573 | 571 | offs = offset+(bank*0x4000); |
| 574 | 572 | |
| 575 | 573 | /* we have to invert the data for the GFX decode */ |
| 576 | | |
| 574 | | |
| 577 | 575 | |
| 578 | 576 | /* Decode the new tile */ |
| 579 | 577 | gfx_element_mark_dirty(space->machine->gfx[0], offs/32); |
| r10613 | r10614 | |
| 587 | 585 | |
| 588 | 586 | static WRITE8_HANDLER( mastboy_bank_w ) |
| 589 | 587 | { |
| 588 | mastboy_state *state = space->machine->driver_data<mastboy_state>(); | |
| 590 | 589 | // controls access to banked ram / rom |
| 591 | | |
| 590 | | |
| 592 | 591 | } |
| 593 | 592 | |
| 594 | 593 | /* Backup RAM access */ |
| r10613 | r10614 | |
| 602 | 601 | static WRITE8_HANDLER( mastboy_backupram_w ) |
| 603 | 602 | { |
| 604 | 603 | mastboy_state *state = space->machine->driver_data<mastboy_state>(); |
| 605 | // if ( | |
| 604 | // if ( | |
| 606 | 605 | // { |
| 607 | 606 | state->m_nvram[offset] = data; |
| 608 | 607 | // } |
| r10613 | r10614 | |
| 614 | 613 | |
| 615 | 614 | static WRITE8_HANDLER( backupram_enable_w ) |
| 616 | 615 | { |
| 616 | mastboy_state *state = space->machine->driver_data<mastboy_state>(); | |
| 617 | 617 | /* This is some kind of enable / disable control for backup ram (see Charles's notes) but I'm not |
| 618 | 618 | sure how it works in practice, if we use it then it writes a lot of data with it disabled */ |
| 619 | | |
| 619 | | |
| 620 | 620 | } |
| 621 | 621 | |
| 622 | 622 | /* MSM5205 Related */ |
| 623 | 623 | |
| 624 | 624 | static WRITE8_HANDLER( msm5205_mastboy_m5205_sambit0_w ) |
| 625 | 625 | { |
| 626 | mastboy_state *state = space->machine->driver_data<mastboy_state>(); | |
| 626 | 627 | device_t *adpcm = space->machine->device("msm"); |
| 627 | 628 | |
| 628 | mastboy_m5205_sambit0 = data & 1; | |
| 629 | msm5205_playmode_w(adpcm, (1 << 2) | (mastboy_m5205_sambit1 << 1) | (mastboy_m5205_sambit0) ); | |
| 629 | state->m5205_sambit0 = data & 1; | |
| 630 | msm5205_playmode_w(adpcm, (1 << 2) | (state->m5205_sambit1 << 1) | (state->m5205_sambit0) ); | |
| 630 | 631 | |
| 631 | 632 | logerror("msm5205 samplerate bit 0, set to %02x\n",data); |
| 632 | 633 | } |
| 633 | 634 | |
| 634 | 635 | static WRITE8_HANDLER( msm5205_mastboy_m5205_sambit1_w ) |
| 635 | 636 | { |
| 637 | mastboy_state *state = space->machine->driver_data<mastboy_state>(); | |
| 636 | 638 | device_t *adpcm = space->machine->device("msm"); |
| 637 | 639 | |
| 638 | | |
| 640 | | |
| 639 | 641 | |
| 640 | msm5205_playmode_w(adpcm, (1 << 2) | ( | |
| 642 | msm5205_playmode_w(adpcm, (1 << 2) | ( | |
| 641 | 643 | |
| 642 | 644 | logerror("msm5205 samplerate bit 0, set to %02x\n",data); |
| 643 | 645 | } |
| 644 | 646 | |
| 645 | 647 | static WRITE8_DEVICE_HANDLER( mastboy_msm5205_reset_w ) |
| 646 | 648 | { |
| 647 | mastboy_m5205_part = 0; | |
| 649 | mastboy_state *state = device->machine->driver_data<mastboy_state>(); | |
| 650 | state->m5205_part = 0; | |
| 648 | 651 | msm5205_reset_w(device,data&1); |
| 649 | 652 | } |
| 650 | 653 | |
| 651 | 654 | static WRITE8_HANDLER( mastboy_msm5205_data_w ) |
| 652 | 655 | { |
| 653 | mastboy_m5205_next = data; | |
| 656 | mastboy_state *state = space->machine->driver_data<mastboy_state>(); | |
| 657 | state->m5205_next = data; | |
| 654 | 658 | } |
| 655 | 659 | |
| 656 | 660 | static void mastboy_adpcm_int(device_t *device) |
| 657 | 661 | { |
| 658 | msm5205_data_w(device, mastboy_m5205_next); | |
| 659 | mastboy_m5205_next >>= 4; | |
| 662 | mastboy_state *state = device->machine->driver_data<mastboy_state>(); | |
| 663 | msm5205_data_w(device, state->m5205_next); | |
| 664 | state->m5205_next >>= 4; | |
| 660 | 665 | |
| 661 | mastboy_m5205_part ^= 1; | |
| 662 | if(!mastboy_m5205_part) | |
| 666 | state->m5205_part ^= 1; | |
| 667 | if(!state->m5205_part) | |
| 663 | 668 | cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE); |
| 664 | 669 | } |
| 665 | 670 | |
| r10613 | r10614 | |
| 674 | 679 | |
| 675 | 680 | static WRITE8_HANDLER( mastboy_irq0_ack_w ) |
| 676 | 681 | { |
| 677 | mastboy_irq0_ack = data; | |
| 682 | mastboy_state *state = space->machine->driver_data<mastboy_state>(); | |
| 683 | state->irq0_ack = data; | |
| 678 | 684 | if ((data & 1) == 1) |
| 679 | 685 | cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); |
| 680 | 686 | } |
| 681 | 687 | |
| 682 | 688 | static INTERRUPT_GEN( mastboy_interrupt ) |
| 683 | 689 | { |
| 684 | if ((mastboy_irq0_ack & 1) == 1) | |
| 690 | mastboy_state *state = device->machine->driver_data<mastboy_state>(); | |
| 691 | if ((state->irq0_ack & 1) == 1) | |
| 685 | 692 | { |
| 686 | 693 | cpu_set_input_line(device, 0, ASSERT_LINE); |
| 687 | 694 | } |
| r10613 | r10614 | |
| 693 | 700 | AM_RANGE(0x0000, 0x3fff) AM_ROM // Internal ROM |
| 694 | 701 | AM_RANGE(0x4000, 0x7fff) AM_ROM // External ROM |
| 695 | 702 | |
| 696 | AM_RANGE(0x8000, 0x8fff) AM_RAM AM_BASE(&mastboy_workram)// work ram | |
| 697 | AM_RANGE(0x9000, 0x9fff) AM_RAM AM_BASE(&mastboy_tileram)// tilemap ram | |
| 698 | AM_RANGE(0xa000, 0xa1ff) AM_RAM AM_BASE(&mastboy_colram) AM_MIRROR(0x0e00) // colour ram | |
| 703 | AM_RANGE(0x8000, 0x8fff) AM_RAM AM_BASE_MEMBER(mastboy_state, workram)// work ram | |
| 704 | AM_RANGE(0x9000, 0x9fff) AM_RAM AM_BASE_MEMBER(mastboy_state, tileram)// tilemap ram | |
| 705 | AM_RANGE(0xa000, 0xa1ff) AM_RAM AM_BASE_MEMBER(mastboy_state, colram) AM_MIRROR(0x0e00) // colour ram | |
| 699 | 706 | |
| 700 | 707 | AM_RANGE(0xc000, 0xffff) AM_READWRITE(banked_ram_r,banked_ram_w) // mastboy bank area read / write |
| 701 | 708 | |
| r10613 | r10614 | |
| 856 | 863 | |
| 857 | 864 | static MACHINE_RESET( mastboy ) |
| 858 | 865 | { |
| 866 | mastboy_state *state = machine->driver_data<mastboy_state>(); | |
| 859 | 867 | /* clear some ram */ |
| 860 | memset( mastboy_workram, 0x00, 0x01000); | |
| 861 | memset( mastboy_tileram, 0x00, 0x01000); | |
| 862 | memset( mastboy_colram, 0x00, 0x00200); | |
| 863 | memset( mastboy_vram, 0x00, 0x10000); | |
| 868 | memset( state->workram, 0x00, 0x01000); | |
| 869 | memset( state->tileram, 0x00, 0x01000); | |
| 870 | memset( state->colram, 0x00, 0x00200); | |
| 871 | memset( state->vram, 0x00, 0x10000); | |
| 864 | 872 | |
| 865 | | |
| 873 | | |
| 866 | 874 | msm5205_reset_w(machine->device("msm"),1); |
| 867 | | |
| 875 | | |
| 868 | 876 | } |
| 869 | 877 | |
| 870 | 878 | |
| r10613 | r10614 | |
| 984 | 992 | |
| 985 | 993 | static DRIVER_INIT( mastboy ) |
| 986 | 994 | { |
| 987 | mastboy_vram = machine->region( "gfx1" )->base(); // makes decoding the RAM based tiles easier this way | |
| 995 | mastboy_state *state = machine->driver_data<mastboy_state>(); | |
| 996 | state->vram = machine->region( "gfx1" )->base(); // makes decoding the RAM based tiles easier this way | |
| 988 | 997 | } |
| 989 | 998 | |
| 990 | 999 | GAME( 1991, mastboy, 0, mastboy, mastboy, mastboy, ROT0, "Gaelco", "Master Boy (Spanish, PCB Rev A)", 0 ) |
| r10613 | r10614 | |
|---|---|---|
| 674 | 674 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 675 | 675 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 676 | 676 | |
| 677 | // | |
| 677 | // PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) | |
| 678 | 678 | |
| 679 | 679 | PORT_START( "Controls" ) /* IN7 - 53003 */ |
| 680 | 680 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Controls ) ) PORT_DIPLOCATION("DSW2:1,2") |
| 681 | // | |
| 681 | // PORT_DIPSETTING( 0x01, "Lightgun" ) | |
| 682 | 682 | PORT_DIPSETTING( 0x03, "Lightgun" ) |
| 683 | 683 | PORT_DIPSETTING( 0x00, DEF_STR( Trackball ) ) |
| 684 | 684 | PORT_DIPSETTING( 0x02, DEF_STR( Joystick ) ) |
| 685 | 685 | PORT_DIPNAME( 0x04, 0x04, "Sound Test" ) PORT_DIPLOCATION("DSW2:3") |
| 686 | 686 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 687 | 687 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 688 | PORT_DIPNAME( 0x08, 0x08, "Free Bullets" ) PORT_DIPLOCATION("DSW2:4") | |
| 688 | PORT_DIPNAME( 0x08, 0x08, "Free Bullets" ) PORT_DIPLOCATION("DSW2:4") | |
| 689 | 689 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 690 | 690 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 691 | 691 | PORT_DIPUNUSED_DIPLOC( 0x10, 0x0010, "DSW2:5" ) |
| r10613 | r10614 | |
|---|---|---|
| 1 | /* | |
| 2 | Commodore Amiga CD-32 and related hardware | |
| 3 | (Cubo CD32 for arcades) | |
| 1 | /* | |
| 2 | Commodore Amiga CD-32 and related hardware | |
| 3 | (Cubo CD32 for arcades) | |
| 4 | 4 | |
| 5 | 5 | Driver by Mariusz Wojcieszek |
| 6 | 6 | CD-ROM controller by Ernesto Corvi |
| r10613 | r10614 | |
| 854 | 854 | /* |
| 855 | 855 | |
| 856 | 856 | Cubo CD32 (additional hardware and games by CD Express, Milan, Italy) |
| 857 | ||
| 857 | ||
| 858 | 858 | The CuboCD32 is a stock retail CD32 unit with additional hardware to adapt it |
| 859 | 859 | for JAMMA use |
| 860 | 860 |
| r10613 | r10614 | |
|---|---|---|
| 35 | 35 | #include "sound/2151intf.h" |
| 36 | 36 | #include "includes/m90.h" |
| 37 | 37 | |
| 38 | static UINT32 bankaddress; | |
| 39 | 38 | |
| 40 | 39 | /***************************************************************************/ |
| 41 | 40 | |
| 42 | 41 | static void set_m90_bank(running_machine *machine) |
| 43 | 42 | { |
| 43 | m90_state *state = machine->driver_data<m90_state>(); | |
| 44 | 44 | UINT8 *rom = machine->region("user1")->base(); |
| 45 | 45 | |
| 46 | 46 | if (!rom) |
| 47 | 47 | popmessage("bankswitch with no banked ROM!"); |
| 48 | 48 | else |
| 49 | memory_set_bankptr(machine, "bank1",rom + bankaddress); | |
| 49 | memory_set_bankptr(machine, "bank1",rom + state->bankaddress); | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /***************************************************************************/ |
| r10613 | r10614 | |
| 64 | 64 | |
| 65 | 65 | static WRITE16_HANDLER( quizf1_bankswitch_w ) |
| 66 | 66 | { |
| 67 | m90_state *state = space->machine->driver_data<m90_state>(); | |
| 67 | 68 | if (ACCESSING_BITS_0_7) |
| 68 | 69 | { |
| 69 | bankaddress = 0x10000 * (data & 0x0f); | |
| 70 | state->bankaddress = 0x10000 * (data & 0x0f); | |
| 70 | 71 | set_m90_bank(space->machine); |
| 71 | 72 | } |
| 72 | 73 | } |
| r10613 | r10614 | |
| 84 | 85 | AM_RANGE(0x00000, 0x7ffff) AM_ROM |
| 85 | 86 | AM_RANGE(0x80000, 0x8ffff) AM_ROMBANK("bank1") /* Quiz F1 only */ |
| 86 | 87 | AM_RANGE(0xa0000, 0xa3fff) AM_RAM |
| 87 | AM_RANGE(0xd0000, 0xdffff) AM_RAM_WRITE(m90_video_w) AM_BASE( | |
| 88 | AM_RANGE(0xd0000, 0xdffff) AM_RAM_WRITE(m90_video_w) AM_BASE_MEMBER( | |
| 88 | 89 | AM_RANGE(0xe0000, 0xe03ff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 89 | 90 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 90 | 91 | ADDRESS_MAP_END |
| r10613 | r10614 | |
| 93 | 94 | AM_RANGE(0x00000, 0x3ffff) AM_ROM |
| 94 | 95 | AM_RANGE(0x6000e, 0x60fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) |
| 95 | 96 | AM_RANGE(0xa0000, 0xa3fff) AM_RAM |
| 96 | AM_RANGE(0xd0000, 0xdffff) AM_RAM_WRITE(m90_video_w) AM_BASE( | |
| 97 | AM_RANGE(0xd0000, 0xdffff) AM_RAM_WRITE(m90_video_w) AM_BASE_MEMBER( | |
| 97 | 98 | AM_RANGE(0xe0000, 0xe03ff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 98 | 99 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 99 | 100 | ADDRESS_MAP_END |
| r10613 | r10614 | |
| 102 | 103 | AM_RANGE(0x00000, 0x7ffff) AM_ROM |
| 103 | 104 | AM_RANGE(0xa0000, 0xa3fff) AM_RAM |
| 104 | 105 | AM_RANGE(0xc000e, 0xc0fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) |
| 105 | AM_RANGE(0xd0000, 0xdffff) AM_RAM_WRITE(m90_video_w) AM_BASE( | |
| 106 | AM_RANGE(0xd0000, 0xdffff) AM_RAM_WRITE(m90_video_w) AM_BASE_MEMBER( | |
| 106 | 107 | AM_RANGE(0xe0000, 0xe03ff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 107 | 108 | AM_RANGE(0xffff0, 0xfffff) AM_ROM |
| 108 | 109 | ADDRESS_MAP_END |
| r10613 | r10614 | |
| 695 | 696 | |
| 696 | 697 | |
| 697 | 698 | /* Basic hardware -- no decryption table is setup for CPU */ |
| 698 | static MACHINE_CONFIG_START( m90, | |
| 699 | static MACHINE_CONFIG_START( m90, m90 | |
| 699 | 700 | /* basic machine hardware */ |
| 700 | 701 | MCFG_CPU_ADD("maincpu", V35,XTAL_32MHz/2) |
| 701 | 702 | MCFG_CPU_PROGRAM_MAP(m90_main_cpu_map) |
| r10613 | r10614 | |
| 1144 | 1145 | |
| 1145 | 1146 | static DRIVER_INIT( quizf1 ) |
| 1146 | 1147 | { |
| 1147 | bankaddress = 0; | |
| 1148 | m90_state *state = machine->driver_data<m90_state>(); | |
| 1149 | state->bankaddress = 0; | |
| 1148 | 1150 | set_m90_bank(machine); |
| 1149 | 1151 | |
| 1150 | state_save_register_global(machine, bankaddress); | |
| 1152 | state_save_register_global(machine, state->bankaddress); | |
| 1151 | 1153 | machine->state().register_postload(quizf1_postload, NULL); |
| 1152 | 1154 | } |
| 1153 | 1155 |
| r10613 | r10614 | |
|---|---|---|
| 204 | 204 | #define CLIP_H (VIS_MAXY - VIS_MINY + 1) |
| 205 | 205 | #define CLIP_BYTEW (CLIP_W << 1) |
| 206 | 206 | |
| 207 | static UINT16 *render_layer[MAX_LAYERS]; | |
| 208 | static UINT8 sound_fifo[MAX_SOUNDS]; | |
| 209 | static UINT8 *gfx_plane02, *gfx_plane13, *collision_list; | |
| 210 | static UINT8 *scrolly0, *scrollx0, *scrolly1, *scrollx1; | |
| 211 | static UINT32 *internal_palette, *alpha_table; | |
| 212 | 207 | |
| 213 | static UINT8 *cpu1_base, *gfx1_base, *blitter_ram, *io_ram; | |
| 214 | static size_t blitter_ramsize, io_ramsize; | |
| 208 | class halleys_state : public driver_device | |
| 209 | { | |
| 210 | public: | |
| 211 | halleys_state(running_machine &machine, const driver_device_config_base &config) | |
| 212 | : driver_device(machine, config) { } | |
| 215 | 213 | |
| 216 | static int game_id, blitter_busy, collision_count, stars_enabled, bgcolor, ffcount, ffhead, fftail; | |
| 217 | static int mVectorType, sndnmi_mask, firq_level; | |
| 218 | static emu_timer *blitter_reset_timer; | |
| 214 | UINT16 *render_layer[MAX_LAYERS]; | |
| 215 | UINT8 sound_fifo[MAX_SOUNDS]; | |
| 216 | UINT8 *gfx_plane02; | |
| 217 | UINT8 *gfx_plane13; | |
| 218 | UINT8 *collision_list; | |
| 219 | UINT8 *scrolly0; | |
| 220 | UINT8 *scrollx0; | |
| 221 | UINT8 *scrolly1; | |
| 222 | UINT8 *scrollx1; | |
| 223 | UINT32 *internal_palette; | |
| 224 | UINT32 *alpha_table; | |
| 225 | UINT8 *cpu1_base; | |
| 226 | UINT8 *gfx1_base; | |
| 227 | UINT8 *blitter_ram; | |
| 228 | UINT8 *io_ram; | |
| 229 | size_t blitter_ramsize; | |
| 230 | size_t io_ramsize; | |
| 231 | int game_id; | |
| 232 | int blitter_busy; | |
| 233 | int collision_count; | |
| 234 | int stars_enabled; | |
| 235 | int bgcolor; | |
| 236 | int ffcount; | |
| 237 | int ffhead; | |
| 238 | int fftail; | |
| 239 | int mVectorType; | |
| 240 | int sndnmi_mask; | |
| 241 | int firq_level; | |
| 242 | emu_timer *blitter_reset_timer; | |
| 243 | offs_t collision_detection; | |
| 244 | int latch_delay; | |
| 245 | }; | |
| 219 | 246 | |
| 220 | static offs_t halleys_collision_detection; | |
| 221 | 247 | |
| 222 | 248 | |
| 223 | 249 | //************************************************************************** |
| 224 | 250 | // MB1551x Blitter Functions |
| 225 | 251 | |
| 226 | static void blit(int offset) | |
| 252 | static void blit(halleys_state *state, int offset) | |
| 227 | 253 | { |
| 228 | 254 | /* |
| 229 | 255 | The render layers can be converted to standard MAME bitmaps but |
| r10613 | r10614 | |
| 307 | 333 | UINT16 ax; UINT8 al, ah; // partial regs |
| 308 | 334 | |
| 309 | 335 | |
| 310 | param = blitter_ram + offset; | |
| 336 | param = state->blitter_ram + offset; | |
| 311 | 337 | |
| 312 | 338 | |
| 313 | 339 | #if HALLEYS_DEBUG |
| r10613 | r10614 | |
| 329 | 355 | // update sprite status |
| 330 | 356 | layer = (code>>3 & 2) | (code>>7 & 1); |
| 331 | 357 | offset >>= 4; |
| 332 | status = (stptr) ? cpu1_base[stptr] : ACTIVE; | |
| 358 | status = (stptr) ? state->cpu1_base[stptr] : ACTIVE; | |
| 333 | 359 | flags = mode; |
| 334 | 360 | group = mode & GROUP; |
| 335 | 361 | command = code & COMMAND; |
| 336 | if (game_id == GAME_HALLEYS) | |
| 362 | if (state->game_id == GAME_HALLEYS) | |
| 337 | 363 | { |
| 338 | 364 | if (!layer) flags |= PPCD_ON; |
| 339 | 365 | if (offset >= HALLEYS_SPLIT) flags |= AD_HIGH; else |
| r10613 | r10614 | |
| 361 | 387 | src1 &= 0x3fff; |
| 362 | 388 | src2 &= 0x3fff; |
| 363 | 389 | bank = ((code & BANKBIT0) | (color & BANKBIT1)) << 8; |
| 364 | pal_ptr = internal_palette; | |
| 390 | pal_ptr = state->internal_palette; | |
| 365 | 391 | |
| 366 | 392 | |
| 367 | 393 | // the crossroad of fate |
| r10613 | r10614 | |
| 408 | 434 | |
| 409 | 435 | |
| 410 | 436 | // calculate entry points and loop constants |
| 411 | src1_ptr = gfx_plane02 + ((bank + src1)<<3) + eax; | |
| 412 | src2_ptr = gfx_plane13 + ((bank + src2)<<3) + eax; | |
| 437 | src1_ptr = state->gfx_plane02 + ((bank + src1)<<3) + eax; | |
| 438 | src2_ptr = state->gfx_plane13 + ((bank + src2)<<3) + eax; | |
| 413 | 439 | |
| 414 | 440 | if (!(flags & (S1_IDLE | S2_IDLE))) |
| 415 | 441 | { |
| r10613 | r10614 | |
| 419 | 445 | } |
| 420 | 446 | else src_dy = src_dx = 0; |
| 421 | 447 | |
| 422 | dst_ptr = render_layer[layer] + dst_skip; | |
| 448 | dst_ptr = state->render_layer[layer] + dst_skip; | |
| 423 | 449 | |
| 424 | 450 | |
| 425 | 451 | // look up pen values and set rendering flags |
| r10613 | r10614 | |
| 529 | 555 | // update collision list if object collided with the other group |
| 530 | 556 | if (status & ACTIVE && ax & SP_COLLD) |
| 531 | 557 | { |
| 532 | collision_list[collision_count & (MAX_SPRITES-1)] = offset; | |
| 533 | collision_count++; | |
| 558 | state->collision_list[state->collision_count & (MAX_SPRITES-1)] = offset; | |
| 559 | state->collision_count++; | |
| 534 | 560 | |
| 535 | 561 | #if HALLEYS_DEBUG |
| 536 | popmessage("ID:%02x CC:%3d", offset, collision_count); | |
| 562 | popmessage("ID:%02x CC:%3d", offset, state->collision_count); | |
| 537 | 563 | #endif |
| 538 | 564 | } |
| 539 | 565 | |
| r10613 | r10614 | |
| 678 | 704 | if (flags & S1_IDLE) src_dx = 0; else src_dx = 1; |
| 679 | 705 | if (flags & S1_REV ) src_dx = -src_dx; |
| 680 | 706 | |
| 681 | src_base = gfx1_base + bank; | |
| 707 | src_base = state->gfx1_base + bank; | |
| 682 | 708 | |
| 683 | 709 | if (command == STARPASS1 || command == STARPASS2) layer = (layer & 1) + 4; |
| 684 | dst_base = render_layer[layer]; | |
| 710 | dst_base = state->render_layer[layer]; | |
| 685 | 711 | |
| 686 | 712 | |
| 687 | 713 | //-------------------------------------------------------------------------- |
| r10613 | r10614 | |
| 705 | 731 | if (!command && y == 0xff && h == 1) |
| 706 | 732 | { |
| 707 | 733 | y = 0; h = SCREEN_HEIGHT; |
| 708 | dst_base = render_layer[(layer&1)+4]; | |
| 734 | dst_base = state->render_layer[(layer&1)+4]; | |
| 709 | 735 | WARP_WIPE_COMMON |
| 710 | 736 | |
| 711 | stars_enabled = ~layer & 1; | |
| 737 | state->stars_enabled = ~layer & 1; | |
| 712 | 738 | } |
| 713 | 739 | |
| 714 | 740 | // wipe background and chain-wipe corresponding sprite layer when the command is zero |
| 715 | 741 | else |
| 716 | 742 | { |
| 717 | 743 | WARP_WIPE_COMMON |
| 718 | if (!command) { dst_base = render_layer[layer&1]; WARP_WIPE_COMMON } | |
| 744 | if (!command) { dst_base = state->render_layer[layer&1]; WARP_WIPE_COMMON } | |
| 719 | 745 | } |
| 720 | 746 | |
| 721 | 747 | } else |
| r10613 | r10614 | |
| 767 | 793 | } |
| 768 | 794 | } |
| 769 | 795 | |
| 770 | stars_enabled = layer & 1; | |
| 796 | state->stars_enabled = layer & 1; | |
| 771 | 797 | |
| 772 | 798 | #undef RORB |
| 773 | 799 | #undef C2S |
| r10613 | r10614 | |
| 835 | 861 | if (flags & IGNORE_0) { w=8; h=8; WARP_WIPE_COMMON } |
| 836 | 862 | |
| 837 | 863 | src1_ptr = src_base + src1; |
| 838 | dst_ptr = render_layer[2] + (y << SCREEN_WIDTH_L2); | |
| 864 | dst_ptr = state->render_layer[2] + (y << SCREEN_WIDTH_L2); | |
| 839 | 865 | |
| 840 | 866 | src1_ptr += 8; |
| 841 | 867 | edx = -8; |
| r10613 | r10614 | |
| 949 | 975 | // draws Ben Bero Beh's color backdrop(verification required) |
| 950 | 976 | static WRITE8_HANDLER( bgtile_w ) |
| 951 | 977 | { |
| 978 | halleys_state *state = space->machine->driver_data<halleys_state>(); | |
| 952 | 979 | int yskip, xskip, ecx; |
| 953 | 980 | UINT16 *edi; |
| 954 | 981 | UINT16 ax; |
| 955 | 982 | |
| 956 | cpu1_base[0x1f00+offset] = data; | |
| 983 | state->cpu1_base[0x1f00+offset] = data; | |
| 957 | 984 | offset -= 0x18; |
| 958 | 985 | |
| 959 | 986 | if (offset >= 191) return; |
| r10613 | r10614 | |
| 964 | 991 | yskip = yskip * 48 + 24; |
| 965 | 992 | xskip = xskip * 5 + 2; |
| 966 | 993 | |
| 967 | edi = render_layer[2] + (yskip<<SCREEN_WIDTH_L2) + xskip + (48<<SCREEN_WIDTH_L2); | |
| 994 | edi = state->render_layer[2] + (yskip<<SCREEN_WIDTH_L2) + xskip + (48<<SCREEN_WIDTH_L2); | |
| 968 | 995 | ecx = -(48<<SCREEN_WIDTH_L2); |
| 969 | 996 | ax = (UINT16)data | BG_RGB; |
| 970 | 997 | |
| r10613 | r10614 | |
| 974 | 1001 | |
| 975 | 1002 | static READ8_HANDLER( blitter_status_r ) |
| 976 | 1003 | { |
| 977 | if (game_id==GAME_HALLEYS && cpu_get_pc(space->cpu)==0x8017) return(0x55); // HACK: trick SRAM test on startup | |
| 1004 | halleys_state *state = space->machine->driver_data<halleys_state>(); | |
| 1005 | if (state->game_id==GAME_HALLEYS && cpu_get_pc(space->cpu)==0x8017) return(0x55); // HACK: trick SRAM test on startup | |
| 978 | 1006 | |
| 979 | 1007 | return(0); |
| 980 | 1008 | } |
| r10613 | r10614 | |
| 982 | 1010 | |
| 983 | 1011 | static READ8_HANDLER( blitter_r ) |
| 984 | 1012 | { |
| 1013 | halleys_state *state = space->machine->driver_data<halleys_state>(); | |
| 985 | 1014 | int i = offset & 0xf; |
| 986 | 1015 | |
| 987 | 1016 | if (i==0 || i==4) return(1); |
| 988 | 1017 | |
| 989 | return(blitter_ram[offset]); | |
| 1018 | return(state->blitter_ram[offset]); | |
| 990 | 1019 | } |
| 991 | 1020 | |
| 992 | 1021 | |
| 993 | 1022 | static TIMER_CALLBACK( blitter_reset ) |
| 994 | 1023 | { |
| 995 | blitter_busy = 0; | |
| 1024 | halleys_state *state = machine->driver_data<halleys_state>(); | |
| 1025 | state->blitter_busy = 0; | |
| 996 | 1026 | } |
| 997 | 1027 | |
| 998 | 1028 | |
| 999 | 1029 | static WRITE8_HANDLER( blitter_w ) |
| 1000 | 1030 | { |
| 1031 | halleys_state *state = space->machine->driver_data<halleys_state>(); | |
| 1001 | 1032 | int i = offset & 0xf; |
| 1002 | 1033 | |
| 1003 | blitter_ram[offset] = data; | |
| 1034 | state->blitter_ram[offset] = data; | |
| 1004 | 1035 | |
| 1005 | if (i==0) blit(offset); | |
| 1036 | if (i==0) blit(state, offset); | |
| 1006 | 1037 | |
| 1007 | if (game_id == GAME_BENBEROB) | |
| 1038 | if (state->game_id == GAME_BENBEROB) | |
| 1008 | 1039 | { |
| 1009 | 1040 | if (i==0 || (i==4 && !data)) |
| 1010 | 1041 | { |
| 1011 | blitter_busy = 0; | |
| 1012 | if (firq_level) cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE); // make up delayed FIRQ's | |
| 1042 | state->blitter_busy = 0; | |
| 1043 | if (state->firq_level) cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE); // make up delayed FIRQ's | |
| 1013 | 1044 | } |
| 1014 | 1045 | else |
| 1015 | 1046 | { |
| 1016 | blitter_busy = 1; | |
| 1017 | blitter_reset_timer->adjust(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(100)); // free blitter if no updates in 100 cycles | |
| 1047 | state->blitter_busy = 1; | |
| 1048 | state->blitter_reset_timer->adjust(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(100)); // free blitter if no updates in 100 cycles | |
| 1018 | 1049 | } |
| 1019 | 1050 | } |
| 1020 | 1051 | } |
| r10613 | r10614 | |
| 1022 | 1053 | |
| 1023 | 1054 | static READ8_HANDLER( collision_id_r ) |
| 1024 | 1055 | { |
| 1056 | halleys_state *state = space->machine->driver_data<halleys_state>(); | |
| 1025 | 1057 | /* |
| 1026 | 1058 | Collision detection abstract: |
| 1027 | 1059 | |
| r10613 | r10614 | |
| 1044 | 1076 | UPDATE: re-implemented pixel collision to accompany the hack method. |
| 1045 | 1077 | */ |
| 1046 | 1078 | |
| 1047 | if (game_id==GAME_HALLEYS && cpu_get_pc(space->cpu)== | |
| 1079 | if (state->game_id==GAME_HALLEYS && cpu_get_pc(space->cpu)==stat | |
| 1048 | 1080 | { |
| 1049 | if (collision_count) { collision_count--; return(collision_list[collision_count]); } | |
| 1081 | if (state->collision_count) { state->collision_count--; return(state->collision_list[state->collision_count]); } | |
| 1050 | 1082 | |
| 1051 | 1083 | return(0); |
| 1052 | 1084 | } |
| 1053 | 1085 | |
| 1054 | return(io_ram[0x66]); | |
| 1086 | return(state->io_ram[0x66]); | |
| 1055 | 1087 | } |
| 1056 | 1088 | |
| 1057 | 1089 | |
| r10613 | r10614 | |
| 1060 | 1092 | |
| 1061 | 1093 | static PALETTE_INIT( halleys ) |
| 1062 | 1094 | { |
| 1095 | halleys_state *state = machine->driver_data<halleys_state>(); | |
| 1063 | 1096 | UINT32 d, r, g, b, i, j, count; |
| 1064 | UINT32 *pal_ptr = internal_palette; | |
| 1097 | UINT32 *pal_ptr = state->internal_palette; | |
| 1065 | 1098 | |
| 1066 | 1099 | for (count=0; count<1024; count++) |
| 1067 | 1100 | { |
| r10613 | r10614 | |
| 1153 | 1186 | |
| 1154 | 1187 | static WRITE8_HANDLER( halleys_paletteram_IIRRGGBB_w ) |
| 1155 | 1188 | { |
| 1189 | halleys_state *state = space->machine->driver_data<halleys_state>(); | |
| 1156 | 1190 | UINT32 d, r, g, b, i, j; |
| 1157 | UINT32 *pal_ptr = internal_palette; | |
| 1191 | UINT32 *pal_ptr = state->internal_palette; | |
| 1158 | 1192 | |
| 1159 | 1193 | space->machine->generic.paletteram.u8[offset] = data; |
| 1160 | 1194 | d = (UINT32)data; |
| r10613 | r10614 | |
| 1182 | 1216 | |
| 1183 | 1217 | static VIDEO_START( halleys ) |
| 1184 | 1218 | { |
| 1219 | halleys_state *state = machine->driver_data<halleys_state>(); | |
| 1185 | 1220 | #define HALLEYS_Y0 0x8e |
| 1186 | 1221 | #define HALLEYS_X0 0x9a |
| 1187 | 1222 | #define HALLEYS_Y1 0xa2 |
| r10613 | r10614 | |
| 1190 | 1225 | int dst, src, c; |
| 1191 | 1226 | |
| 1192 | 1227 | // create short cuts to scroll registers |
| 1193 | scrolly0 = io_ram + HALLEYS_Y0; | |
| 1194 | scrollx0 = io_ram + HALLEYS_X0; | |
| 1195 | scrolly1 = io_ram + HALLEYS_Y1; | |
| 1196 | scrollx1 = io_ram + HALLEYS_X1; | |
| 1228 | state->scrolly0 = state->io_ram + HALLEYS_Y0; | |
| 1229 | state->scrollx0 = state->io_ram + HALLEYS_X0; | |
| 1230 | state->scrolly1 = state->io_ram + HALLEYS_Y1; | |
| 1231 | state->scrollx1 = state->io_ram + HALLEYS_X1; | |
| 1197 | 1232 | |
| 1198 | 1233 | // fill alpha table |
| 1199 | 1234 | for (src=0; src<256; src++) |
| r10613 | r10614 | |
| 1204 | 1239 | c += (((src&0x0c)+(dst&0x0c))>>1) & 0x0c; |
| 1205 | 1240 | c += (((src&0x03)+(dst&0x03))>>1) & 0x03; |
| 1206 | 1241 | |
| 1207 | alpha_table[(src<<8)+dst] = c | BG_RGB; | |
| 1242 | state->alpha_table[(src<<8)+dst] = c | BG_RGB; | |
| 1208 | 1243 | } |
| 1209 | 1244 | } |
| 1210 | 1245 | |
| r10613 | r10614 | |
| 1388 | 1423 | } |
| 1389 | 1424 | |
| 1390 | 1425 | |
| 1391 | static void filter_bitmap(bitmap_t *bitmap, int mask) | |
| 1426 | static void filter_bitmap(running_machine *machine, bitmap_t *bitmap, int mask) | |
| 1392 | 1427 | { |
| 1428 | halleys_state *state = machine->driver_data<halleys_state>(); | |
| 1393 | 1429 | int dst_pitch; |
| 1394 | 1430 | |
| 1395 | 1431 | UINT32 *pal_ptr, *edi; |
| 1396 | 1432 | int esi, eax, ebx, ecx, edx; |
| 1397 | 1433 | |
| 1398 | pal_ptr = internal_palette; | |
| 1434 | pal_ptr = state->internal_palette; | |
| 1399 | 1435 | esi = mask | 0xffffff00; |
| 1400 | 1436 | edi = (UINT32*)BITMAP_ADDR16(bitmap, VIS_MINY, VIS_MINX + CLIP_W); |
| 1401 | 1437 | dst_pitch = bitmap->rowpixels >> 1; |
| r10613 | r10614 | |
| 1430 | 1466 | |
| 1431 | 1467 | static SCREEN_UPDATE( halleys ) |
| 1432 | 1468 | { |
| 1469 | halleys_state *state = screen->machine->driver_data<halleys_state>(); | |
| 1433 | 1470 | int i, j; |
| 1434 | 1471 | |
| 1435 | if (stars_enabled) | |
| 1472 | if (state->stars_enabled) | |
| 1436 | 1473 | { |
| 1437 | copy_scroll_op(bitmap, render_layer[5], *scrollx0, *scrolly0); | |
| 1438 | copy_scroll_xp(bitmap, render_layer[4], *scrollx1, *scrolly1); | |
| 1474 | copy_scroll_op(bitmap, state->render_layer[5], *state->scrollx0, *state->scrolly0); | |
| 1475 | copy_scroll_xp(bitmap, state->render_layer[4], *state->scrollx1, *state->scrolly1); | |
| 1439 | 1476 | } |
| 1440 | 1477 | else |
| 1441 | bitmap_fill(bitmap, cliprect, bgcolor); | |
| 1478 | bitmap_fill(bitmap, cliprect, state->bgcolor); | |
| 1442 | 1479 | |
| 1443 | 1480 | #ifdef MAME_DEBUG |
| 1444 | if (input_port_read(screen->machine, "DEBUG")) copy_scroll_xp(bitmap, render_layer[3], *scrollx0, *scrolly0); // not used??? | |
| 1481 | if (input_port_read(screen->machine, "DEBUG")) copy_scroll_xp(bitmap, state->render_layer[3], *state->scrollx0, *state->scrolly0); // not used??? | |
| 1445 | 1482 | #endif |
| 1446 | 1483 | |
| 1447 | copy_scroll_xp(bitmap, render_layer[2], *scrollx1, *scrolly1); | |
| 1448 | copy_fixed_2b (bitmap, render_layer[1]); | |
| 1449 | copy_fixed_xp (bitmap, render_layer[0]); | |
| 1484 | copy_scroll_xp(bitmap, state->render_layer[2], *state->scrollx1, *state->scrolly1); | |
| 1485 | copy_fixed_2b (bitmap, state->render_layer[1]); | |
| 1486 | copy_fixed_xp (bitmap, state->render_layer[0]); | |
| 1450 | 1487 | |
| 1451 | 1488 | // HALF-HACK: apply RGB filter when the following conditions are met |
| 1452 | i = io_ram[0xa0]; | |
| 1453 | j = io_ram[0xa1]; | |
| 1454 | if (io_ram[0x2b] && (i>0xc6 && i<0xfe) && (j==0xc0 || j==0xed)) filter_bitmap(bitmap, i); | |
| 1489 | i = state->io_ram[0xa0]; | |
| 1490 | j = state->io_ram[0xa1]; | |
| 1491 | if (state->io_ram[0x2b] && (i>0xc6 && i<0xfe) && (j==0xc0 || j==0xed)) filter_bitmap(screen->machine, bitmap, i); | |
| 1455 | 1492 | return 0; |
| 1456 | 1493 | } |
| 1457 | 1494 | |
| 1458 | 1495 | |
| 1459 | 1496 | static SCREEN_UPDATE( benberob ) |
| 1460 | 1497 | { |
| 1461 | if (io_ram[0xa0] & 0x80) | |
| 1462 | copy_scroll_op(bitmap, render_layer[2], *scrollx1, *scrolly1); | |
| 1498 | halleys_state *state = screen->machine->driver_data<halleys_state>(); | |
| 1499 | if (state->io_ram[0xa0] & 0x80) | |
| 1500 | copy_scroll_op(bitmap, state->render_layer[2], *state->scrollx1, *state->scrolly1); | |
| 1463 | 1501 | else |
| 1464 | bitmap_fill(bitmap, cliprect, bgcolor); | |
| 1502 | bitmap_fill(bitmap, cliprect, state->bgcolor); | |
| 1465 | 1503 | |
| 1466 | copy_fixed_xp (bitmap, render_layer[1]); | |
| 1467 | copy_fixed_xp (bitmap, render_layer[0]); | |
| 1504 | copy_fixed_xp (bitmap, state->render_layer[1]); | |
| 1505 | copy_fixed_xp (bitmap, state->render_layer[0]); | |
| 1468 | 1506 | return 0; |
| 1469 | 1507 | } |
| 1470 | 1508 | |
| r10613 | r10614 | |
| 1476 | 1514 | |
| 1477 | 1515 | static READ8_HANDLER( zero_r ) { return(0); } |
| 1478 | 1516 | |
| 1479 | static READ8_HANDLER( debug_r ) { return(io_ram[offset]); } | |
| 1517 | static READ8_HANDLER( debug_r ) | |
| 1518 | { | |
| 1519 | halleys_state *state = space->machine->driver_data<halleys_state>(); | |
| 1520 | return(state->io_ram[offset]); | |
| 1521 | } | |
| 1480 | 1522 | |
| 1481 | 1523 | #endif |
| 1482 | 1524 | |
| r10613 | r10614 | |
| 1486 | 1528 | |
| 1487 | 1529 | static INTERRUPT_GEN( halleys_interrupt ) |
| 1488 | 1530 | { |
| 1489 | stat | |
| 1531 | halleys_state | |
| 1490 | 1532 | UINT8 latch_data; |
| 1491 | 1533 | |
| 1492 | 1534 | switch (cpu_getiloops(device)) |
| r10613 | r10614 | |
| 1505 | 1547 | |
| 1506 | 1548 | Current implementation is quite safe although not 100% foul-proof. |
| 1507 | 1549 | */ |
| 1508 | if (latch_delay) latch_delay--; else | |
| 1509 | if (ffcount) | |
| 1550 | if (state->latch_delay) state->latch_delay--; else | |
| 1551 | if (state->ffcount) | |
| 1510 | 1552 | { |
| 1511 | ffcount--; | |
| 1512 | latch_data = sound_fifo[fftail]; | |
| 1513 | fftail = (fftail + 1) & (MAX_SOUNDS - 1); | |
| 1514 | latch_delay = (latch_data) ? 0 : 4; | |
| 1553 | state->ffcount--; | |
| 1554 | latch_data = state->sound_fifo[state->fftail]; | |
| 1555 | state->fftail = (state->fftail + 1) & (MAX_SOUNDS - 1); | |
| 1556 | state->latch_delay = (latch_data) ? 0 : 4; | |
| 1515 | 1557 | soundlatch_w( cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM), 0, latch_data); |
| 1516 | 1558 | cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 1517 | 1559 | } |
| 1518 | 1560 | |
| 1519 | 1561 | // clear collision list of this frame unconditionally |
| 1520 | collision_count = 0; | |
| 1562 | state->collision_count = 0; | |
| 1521 | 1563 | break; |
| 1522 | 1564 | |
| 1523 | 1565 | // In Halley's Comet, NMI is used exclusively to handle coin input |
| r10613 | r10614 | |
| 1527 | 1569 | |
| 1528 | 1570 | // FIRQ drives gameplay; we need both types of NMI each frame. |
| 1529 | 1571 | case 2: |
| 1530 | mVectorType = 1; cpu_set_input_line(device, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 1572 | state->mVectorType = 1; cpu_set_input_line(device, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 1531 | 1573 | break; |
| 1532 | 1574 | |
| 1533 | 1575 | case 3: |
| 1534 | mVectorType = 0; cpu_set_input_line(device, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 1576 | state->mVectorType = 0; cpu_set_input_line(device, M6809_FIRQ_LINE, ASSERT_LINE); | |
| 1535 | 1577 | break; |
| 1536 | 1578 | } |
| 1537 | 1579 | } |
| r10613 | r10614 | |
| 1539 | 1581 | |
| 1540 | 1582 | static INTERRUPT_GEN( benberob_interrupt ) |
| 1541 | 1583 | { |
| 1542 | stat | |
| 1584 | halleys_state | |
| 1543 | 1585 | UINT8 latch_data; |
| 1544 | 1586 | |
| 1545 | 1587 | switch (cpu_getiloops(device)) |
| 1546 | 1588 | { |
| 1547 | 1589 | case 0: |
| 1548 | if (latch_delay) latch_delay--; else | |
| 1549 | if (ffcount) | |
| 1590 | if (state->latch_delay) state->latch_delay--; else | |
| 1591 | if (state->ffcount) | |
| 1550 | 1592 | { |
| 1551 | ffcount--; | |
| 1552 | latch_data = sound_fifo[fftail]; | |
| 1553 | fftail = (fftail + 1) & (MAX_SOUNDS - 1); | |
| 1554 | latch_delay = (latch_data) ? 0 : 4; | |
| 1593 | state->ffcount--; | |
| 1594 | latch_data = state->sound_fifo[state->fftail]; | |
| 1595 | state->fftail = (state->fftail + 1) & (MAX_SOUNDS - 1); | |
| 1596 | state->latch_delay = (latch_data) ? 0 : 4; | |
| 1555 | 1597 | soundlatch_w(cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM), 0, latch_data); |
| 1556 | 1598 | cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 1557 | 1599 | } |
| r10613 | r10614 | |
| 1564 | 1606 | case 2: |
| 1565 | 1607 | case 3: |
| 1566 | 1608 | // FIRQ must not happen when the blitter is being updated or it'll cause serious screen artifacts |
| 1567 | if (!blitter_busy) cpu_set_input_line(device, M6809_FIRQ_LINE, ASSERT_LINE); else firq_level++; | |
| 1609 | if (!state->blitter_busy) cpu_set_input_line(device, M6809_FIRQ_LINE, ASSERT_LINE); else state->firq_level++; | |
| 1568 | 1610 | break; |
| 1569 | 1611 | } |
| 1570 | 1612 | } |
| r10613 | r10614 | |
| 1572 | 1614 | |
| 1573 | 1615 | static READ8_HANDLER( vector_r ) |
| 1574 | 1616 | { |
| 1575 | return(cpu1_base[0xffe0 + (offset^(mVectorType<<4))]); | |
| 1617 | halleys_state *state = space->machine->driver_data<halleys_state>(); | |
| 1618 | return(state->cpu1_base[0xffe0 + (offset^(state->mVectorType<<4))]); | |
| 1576 | 1619 | } |
| 1577 | 1620 | |
| 1578 | 1621 | |
| 1579 | 1622 | static WRITE8_HANDLER( firq_ack_w ) |
| 1580 | 1623 | { |
| 1581 | io_ram[0x9c] = data; | |
| 1624 | halleys_state *state = space->machine->driver_data<halleys_state>(); | |
| 1625 | state->io_ram[0x9c] = data; | |
| 1582 | 1626 | |
| 1583 | if (firq_level) firq_level--; | |
| 1627 | if (state->firq_level) state->firq_level--; | |
| 1584 | 1628 | cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE, CLEAR_LINE); |
| 1585 | 1629 | } |
| 1586 | 1630 | |
| 1587 | 1631 | |
| 1588 | 1632 | static WRITE8_DEVICE_HANDLER( sndnmi_msk_w ) |
| 1589 | 1633 | { |
| 1590 | sndnmi_mask = data & 1; | |
| 1634 | halleys_state *state = device->machine->driver_data<halleys_state>(); | |
| 1635 | state->sndnmi_mask = data & 1; | |
| 1591 | 1636 | } |
| 1592 | 1637 | |
| 1593 | 1638 | |
| 1594 | 1639 | static WRITE8_HANDLER( soundcommand_w ) |
| 1595 | 1640 | { |
| 1596 | if (ffcount < MAX_SOUNDS) | |
| 1641 | halleys_state *state = space->machine->driver_data<halleys_state>(); | |
| 1642 | if (state->ffcount < MAX_SOUNDS) | |
| 1597 | 1643 | { |
| 1598 | ffcount++; | |
| 1599 | sound_fifo[ffhead] = io_ram[0x8a] = data; | |
| 1600 | ffhead = (ffhead + 1) & (MAX_SOUNDS - 1); | |
| 1644 | state->ffcount++; | |
| 1645 | state->sound_fifo[state->ffhead] = state->io_ram[0x8a] = data; | |
| 1646 | state->ffhead = (state->ffhead + 1) & (MAX_SOUNDS - 1); | |
| 1601 | 1647 | } |
| 1602 | 1648 | } |
| 1603 | 1649 | |
| r10613 | r10614 | |
| 1631 | 1677 | // Memory Maps |
| 1632 | 1678 | |
| 1633 | 1679 | static ADDRESS_MAP_START( halleys_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 1634 | AM_RANGE(0x0000, 0x0fff) AM_READWRITE(blitter_r, blitter_w) AM_BASE( | |
| 1680 | AM_RANGE(0x0000, 0x0fff) AM_READWRITE(blitter_r, blitter_w) AM_BASE_MEMBER(halleys_state, blitter_ram) AM_SIZE_MEMBER(halleys_state, blitter_ramsize) | |
| 1635 | 1681 | AM_RANGE(0x1f00, 0x1fff) AM_WRITE(bgtile_w) // background tiles?(Ben Bero Beh only) |
| 1636 | 1682 | AM_RANGE(0x1000, 0xefff) AM_ROM |
| 1637 | 1683 | AM_RANGE(0xf000, 0xfeff) AM_RAM // work ram |
| r10613 | r10614 | |
| 1649 | 1695 | AM_RANGE(0xff96, 0xff96) AM_READ_PORT("DSW2") // dipswitch 3 |
| 1650 | 1696 | AM_RANGE(0xff97, 0xff97) AM_READ_PORT("DSW3") // dipswitch 2 |
| 1651 | 1697 | AM_RANGE(0xff9c, 0xff9c) AM_WRITE(firq_ack_w) |
| 1652 | AM_RANGE(0xff00, 0xffbf) AM_RAM AM_BASE( | |
| 1698 | AM_RANGE(0xff00, 0xffbf) AM_RAM AM_BASE_MEMBER(halleys_state, io_ram) AM_SIZE_MEMBER(halleys_state, io_ramsize) // I/O write fall-through | |
| 1653 | 1699 | |
| 1654 | 1700 | AM_RANGE(0xffc0, 0xffdf) AM_RAM_WRITE(halleys_paletteram_IIRRGGBB_w) AM_BASE_GENERIC(paletteram) |
| 1655 | 1701 | AM_RANGE(0xffe0, 0xffff) AM_READ(vector_r) |
| r10613 | r10614 | |
| 1909 | 1955 | |
| 1910 | 1956 | static MACHINE_RESET( halleys ) |
| 1911 | 1957 | { |
| 1912 | mVectorType = 0; | |
| 1913 | firq_level = 0; | |
| 1914 | blitter_busy = 0; | |
| 1915 | collision_count = 0; | |
| 1916 | stars_enabled = 0; | |
| 1917 | bgcolor = get_black_pen(machine); | |
| 1918 | fftail = ffhead = ffcount = 0; | |
| 1958 | halleys_state *state = machine->driver_data<halleys_state>(); | |
| 1959 | state->mVectorType = 0; | |
| 1960 | state->firq_level = 0; | |
| 1961 | state->blitter_busy = 0; | |
| 1962 | state->collision_count = 0; | |
| 1963 | state->stars_enabled = 0; | |
| 1964 | state->bgcolor = get_black_pen(machine); | |
| 1965 | state->fftail = state->ffhead = state->ffcount = 0; | |
| 1919 | 1966 | |
| 1920 | memset(io_ram, 0xff, io_ramsize); | |
| 1921 | memset(render_layer[0], 0, SCREEN_BYTESIZE * MAX_LAYERS); | |
| 1967 | memset(state->io_ram, 0xff, state->io_ramsize); | |
| 1968 | memset(state->render_layer[0], 0, SCREEN_BYTESIZE * MAX_LAYERS); | |
| 1922 | 1969 | } |
| 1923 | 1970 | |
| 1924 | 1971 | |
| r10613 | r10614 | |
| 1933 | 1980 | }; |
| 1934 | 1981 | |
| 1935 | 1982 | |
| 1936 | static MACHINE_CONFIG_START( halleys, | |
| 1983 | static MACHINE_CONFIG_START( halleys, halleys_stat | |
| 1937 | 1984 | MCFG_CPU_ADD("maincpu", M6809, XTAL_19_968MHz/12) /* verified on pcb */ |
| 1938 | 1985 | MCFG_CPU_PROGRAM_MAP(halleys_map) |
| 1939 | 1986 | MCFG_CPU_VBLANK_INT_HACK(halleys_interrupt, 4) |
| r10613 | r10614 | |
| 1981 | 2028 | MCFG_CPU_MODIFY("maincpu") |
| 1982 | 2029 | MCFG_CPU_CLOCK(XTAL_19_968MHz/12) /* not verified but pcb identical to halley's comet */ |
| 1983 | 2030 | MCFG_CPU_VBLANK_INT_HACK(benberob_interrupt, 4) |
| 1984 | ||
| 2031 | ||
| 1985 | 2032 | MCFG_SCREEN_MODIFY("screen") |
| 1986 | 2033 | MCFG_SCREEN_UPDATE(benberob) |
| 1987 | 2034 | MACHINE_CONFIG_END |
| r10613 | r10614 | |
| 2133 | 2180 | |
| 2134 | 2181 | static void init_common(running_machine *machine) |
| 2135 | 2182 | { |
| 2183 | halleys_state *state = machine->driver_data<halleys_state>(); | |
| 2136 | 2184 | UINT8 *buf, *rom; |
| 2137 | 2185 | int addr, i; |
| 2138 | 2186 | UINT8 al, ah, dl, dh; |
| r10613 | r10614 | |
| 2140 | 2188 | |
| 2141 | 2189 | // allocate memory for unpacked graphics |
| 2142 | 2190 | buf = auto_alloc_array(machine, UINT8, 0x100000); |
| 2143 | gfx_plane02 = buf; | |
| 2144 | gfx_plane13 = buf + 0x80000; | |
| 2191 | state->gfx_plane02 = buf; | |
| 2192 | state->gfx_plane13 = buf + 0x80000; | |
| 2145 | 2193 | |
| 2146 | 2194 | |
| 2147 | 2195 | // allocate memory for render layers |
| 2148 | 2196 | buf = auto_alloc_array(machine, UINT8, SCREEN_BYTESIZE * MAX_LAYERS); |
| 2149 | for (i=0; i<MAX_LAYERS; buf+=SCREEN_BYTESIZE, i++) render_layer[i] = (UINT16*)buf; | |
| 2197 | for (i=0; i<MAX_LAYERS; buf+=SCREEN_BYTESIZE, i++) state->render_layer[i] = (UINT16*)buf; | |
| 2150 | 2198 | |
| 2151 | 2199 | |
| 2152 | 2200 | // allocate memory for pre-processed ROMs |
| 2153 | gfx1_base = auto_alloc_array(machine, UINT8, 0x20000); | |
| 2201 | state->gfx1_base = auto_alloc_array(machine, UINT8, 0x20000); | |
| 2154 | 2202 | |
| 2155 | 2203 | |
| 2156 | 2204 | // allocate memory for alpha table |
| 2157 | alpha_table = auto_alloc_array(machine, UINT32, 0x10000); | |
| 2205 | state->alpha_table = auto_alloc_array(machine, UINT32, 0x10000); | |
| 2158 | 2206 | |
| 2159 | 2207 | |
| 2160 | 2208 | // allocate memory for internal palette |
| 2161 | internal_palette = auto_alloc_array(machine, UINT32, PALETTE_SIZE); | |
| 2209 | state->internal_palette = auto_alloc_array(machine, UINT32, PALETTE_SIZE); | |
| 2162 | 2210 | |
| 2163 | 2211 | |
| 2164 | 2212 | // allocate memory for hardware collision list |
| 2165 | collision_list = auto_alloc_array(machine, UINT8, MAX_SPRITES); | |
| 2213 | state->collision_list = auto_alloc_array(machine, UINT8, MAX_SPRITES); | |
| 2166 | 2214 | |
| 2167 | 2215 | |
| 2168 | 2216 | // decrypt main program ROM |
| 2169 | rom = cpu1_base = machine->region("maincpu")->base(); | |
| 2170 | buf = gfx1_base; | |
| 2217 | rom = state->cpu1_base = machine->region("maincpu")->base(); | |
| 2218 | buf = state->gfx1_base; | |
| 2171 | 2219 | |
| 2172 | 2220 | for (i=0; i<0x10000; i++) |
| 2173 | 2221 | { |
| r10613 | r10614 | |
| 2180 | 2228 | |
| 2181 | 2229 | // swap graphics ROM addresses and unpack each pixel |
| 2182 | 2230 | rom = machine->region("gfx1")->base(); |
| 2183 | buf = gfx_plane02; | |
| 2231 | buf = state->gfx_plane02; | |
| 2184 | 2232 | |
| 2185 | 2233 | for (i=0xffff; i>=0; i--) |
| 2186 | 2234 | { |
| 2187 | 2235 | al = rom[i]; |
| 2188 | 2236 | ah = rom[i+0x10000]; |
| 2189 | gfx1_base[0xffff-i] = al; | |
| 2190 | gfx1_base[0x1ffff-i] = ah; | |
| 2237 | state->gfx1_base[0xffff-i] = al; | |
| 2238 | state->gfx1_base[0x1ffff-i] = ah; | |
| 2191 | 2239 | |
| 2192 | 2240 | buf[0] = dl = (al & 1) | (ah<<2 & 4); dl <<= 1; |
| 2193 | 2241 | buf[1] = dh = (al>>1 & 1) | (ah<<1 & 4); dh <<= 1; |
| r10613 | r10614 | |
| 2213 | 2261 | |
| 2214 | 2262 | static DRIVER_INIT( benberob ) |
| 2215 | 2263 | { |
| 2216 | game_id = GAME_BENBEROB; | |
| 2264 | halleys_state *state = machine->driver_data<halleys_state>(); | |
| 2265 | state->game_id = GAME_BENBEROB; | |
| 2217 | 2266 | |
| 2218 | 2267 | init_common(machine); |
| 2219 | 2268 | |
| 2220 | blitter_reset_timer = machine->scheduler().timer_alloc(FUNC(blitter_reset)); | |
| 2269 | state->blitter_reset_timer = machine->scheduler().timer_alloc(FUNC(blitter_reset)); | |
| 2221 | 2270 | } |
| 2222 | 2271 | |
| 2223 | 2272 | |
| 2224 | 2273 | static DRIVER_INIT( halleys ) |
| 2225 | 2274 | { |
| 2226 | game_id = GAME_HALLEYS; | |
| 2227 | halleys_collision_detection = 0xb114; | |
| 2275 | halleys_state *state = machine->driver_data<halleys_state>(); | |
| 2276 | state->game_id = GAME_HALLEYS; | |
| 2277 | state->collision_detection = 0xb114; | |
| 2228 | 2278 | |
| 2229 | 2279 | init_common(machine); |
| 2230 | 2280 | } |
| 2231 | 2281 | |
| 2232 | 2282 | static DRIVER_INIT( halley87 ) |
| 2233 | 2283 | { |
| 2234 | game_id = GAME_HALLEYS; | |
| 2235 | halleys_collision_detection = 0xb10d; | |
| 2284 | halleys_state *state = machine->driver_data<halleys_state>(); | |
| 2285 | state->game_id = GAME_HALLEYS; | |
| 2286 | state->collision_detection = 0xb10d; | |
| 2236 | 2287 | |
| 2237 | 2288 | init_common(machine); |
| 2238 | 2289 | } |
| r10613 | r10614 | |
|---|---|---|
| 3861 | 3861 | |
| 3862 | 3862 | /* video hardware */ |
| 3863 | 3863 | MCFG_VIDEO_START(taitof2_qzchikyu) |
| 3864 | MCFG_SCREEN_MODIFY("screen") | |
| 3864 | MCFG_SCREEN_MODIFY("screen") | |
| 3865 | 3865 | MCFG_SCREEN_EOF(taitof2_partial_buffer_delayed_qzchikyu) |
| 3866 | 3866 | |
| 3867 | 3867 | MCFG_TC0100SCN_ADD("tc0100scn", qzchikyu_tc0100scn_intf) |
| r10613 | r10614 | |
|---|---|---|
| 438 | 438 | gottlieb_state *state = machine->driver_data<gottlieb_state>(); |
| 439 | 439 | int newcode = laserdisc_get_field_code(state->laserdisc, (param == 17) ? LASERDISC_CODE_LINE17 : LASERDISC_CODE_LINE18, TRUE); |
| 440 | 440 | |
| 441 | /* the PR8210 sends line 17/18 data on each frame; the | |
| 441 | /* the PR8210 sends line 17/18 data on each frame; the | |
| 442 | 442 | board receives notification and latches the most recent frame number */ |
| 443 | 443 | |
| 444 | 444 | /* the logic detects a valid code when the top 4 bits are all 1s */ |
| r10613 | r10614 | |
|---|---|---|
| 63 | 63 | * Royale (set 1). 198?, Unknown. |
| 64 | 64 | * Royale (set 2). 198?, Unknown. |
| 65 | 65 | * Maverik. 198?, Unknown. |
| 66 | * Brasil'89. 1989, Unknown. | |
| 66 | * Brasil 86. 1986, Unknown. | |
| 67 | * Brasil 87. 1987, Unknown. | |
| 68 | * Brasil 89 (set 1). 1989, Unknown. | |
| 69 | * Brasil 89 (set 2). 1989, Unknown. | |
| 70 | * Brasil 93. 1993, Unknown. | |
| 67 | 71 | * Poker 91. 1991, Unknown. |
| 68 | 72 | * Genie. 198?, Video Fun Games Ltd. |
| 69 | 73 | * Silver Game. 1983, Unknown. |
| r10613 | r10614 | |
| 4215 | 4219 | ROM_LOAD( "82s129.9c", 0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) /* PROM dump needed */ |
| 4216 | 4220 | ROM_END |
| 4217 | 4221 | |
| 4222 | /***************************** | |
| 4223 | ||
| 4224 | Brasil XX sets... | |
| 4225 | ||
| 4226 | ****************************/ | |
| 4227 | ROM_START( brasil86 ) | |
| 4228 | ROM_REGION( 0x10000, "maincpu", 0 ) /* brasil86.128: Brasil 86, BS clone. */ | |
| 4229 | ROM_LOAD( "brasil86.128", 0x4000, 0x4000, CRC(0e88b434) SHA1(80f921c277f4253c29ee80e9cfb046ade1f66300) ) | |
| 4230 | ||
| 4231 | ROM_REGION( 0x3000, "gfx1", 0 ) | |
| 4232 | ROM_FILL( 0x0000, 0x2000, 0 ) /* filling the R-G bitplanes */ | |
| 4233 | ROM_LOAD( "4s.bin", 0x2000, 0x1000, CRC(0ac197eb) SHA1(fdf2b134c662f3c4d4a19d93a82d130ba643ace8) ) /* text layer */ | |
| 4234 | ||
| 4235 | ROM_REGION( 0x3000, "gfx2", 0 ) | |
| 4236 | ROM_LOAD( "7.bin", 0x0000, 0x1000, CRC(28ecfaea) SHA1(19d73ed0fdb5a873447b46e250ad6e71abe257cd) ) /* cards deck gfx, bitplane1 */ | |
| 4237 | ROM_LOAD( "6.bin", 0x1000, 0x1000, CRC(eeec8862) SHA1(ae03aba1bd43c3ffd140f76770fc1c8cf89ea115) ) /* cards deck gfx, bitplane2 */ | |
| 4238 | ROM_LOAD( "5.bin", 0x2000, 0x1000, CRC(2712f297) SHA1(d3cc1469d07c3febbbe4a645cd6bdb57e09cf504) ) /* cards deck gfx, bitplane3 */ | |
| 4239 | ||
| 4240 | ROM_REGION( 0x0100, "proms", 0 ) | |
| 4241 | ROM_LOAD( "82s129.9c", 0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) /* PROM dump needed */ | |
| 4242 | ROM_END | |
| 4243 | ||
| 4244 | ROM_START( brasil87 ) | |
| 4245 | ROM_REGION( 0x10000, "maincpu", 0 ) /* brasil87.128: Brasil 87, BS clone. */ | |
| 4246 | ROM_LOAD( "brasil87.128", 0x4000, 0x4000, CRC(6cfdaea9) SHA1(0704e61c1c573e99e130c22787b529ac5544c631) ) | |
| 4247 | ||
| 4248 | ROM_REGION( 0x3000, "gfx1", 0 ) | |
| 4249 | ROM_FILL( 0x0000, 0x2000, 0 ) /* filling the R-G bitplanes */ | |
| 4250 | ROM_LOAD( "4s.bin", 0x2000, 0x1000, CRC(0ac197eb) SHA1(fdf2b134c662f3c4d4a19d93a82d130ba643ace8) ) /* text layer */ | |
| 4251 | ||
| 4252 | ROM_REGION( 0x3000, "gfx2", 0 ) | |
| 4253 | ROM_LOAD( "7.bin", 0x0000, 0x1000, CRC(28ecfaea) SHA1(19d73ed0fdb5a873447b46e250ad6e71abe257cd) ) /* cards deck gfx, bitplane1 */ | |
| 4254 | ROM_LOAD( "6.bin", 0x1000, 0x1000, CRC(eeec8862) SHA1(ae03aba1bd43c3ffd140f76770fc1c8cf89ea115) ) /* cards deck gfx, bitplane2 */ | |
| 4255 | ROM_LOAD( "5.bin", 0x2000, 0x1000, CRC(2712f297) SHA1(d3cc1469d07c3febbbe4a645cd6bdb57e09cf504) ) /* cards deck gfx, bitplane3 */ | |
| 4256 | ||
| 4257 | ROM_REGION( 0x0100, "proms", 0 ) | |
| 4258 | ROM_LOAD( "82s129.9c", 0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) /* PROM dump needed */ | |
| 4259 | ROM_END | |
| 4260 | ||
| 4218 | 4261 | ROM_START( brasil89 ) |
| 4219 | 4262 | ROM_REGION( 0x10000, "maincpu", 0 ) /* brasil89.128: Brasil 89, BS clone. */ |
| 4220 | 4263 | ROM_LOAD( "brasil89.128", 0x4000, 0x4000, CRC(9030e0db) SHA1(d073ed0ddd3e5df6a3387e10e05ca34bc491eb35) ) |
| r10613 | r10614 | |
| 4232 | 4275 | ROM_LOAD( "82s129.9c", 0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) /* PROM dump needed */ |
| 4233 | 4276 | ROM_END |
| 4234 | 4277 | |
| 4278 | ROM_START( brasil89a ) | |
| 4279 | ROM_REGION( 0x10000, "maincpu", 0 ) /* brasil89a.128: Brasil 89a, BS clone. */ | |
| 4280 | ROM_LOAD( "brasil89a.128", 0x4000, 0x4000, CRC(41a93a99) SHA1(70eeaddbdd9d3a587d1330b81d21d881ab0a8c91) ) | |
| 4281 | ||
| 4282 | ROM_REGION( 0x3000, "gfx1", 0 ) | |
| 4283 | ROM_FILL( 0x0000, 0x2000, 0 ) /* filling the R-G bitplanes */ | |
| 4284 | ROM_LOAD( "4s.bin", 0x2000, 0x1000, CRC(0ac197eb) SHA1(fdf2b134c662f3c4d4a19d93a82d130ba643ace8) ) /* text layer */ | |
| 4285 | ||
| 4286 | ROM_REGION( 0x3000, "gfx2", 0 ) | |
| 4287 | ROM_LOAD( "7.bin", 0x0000, 0x1000, CRC(28ecfaea) SHA1(19d73ed0fdb5a873447b46e250ad6e71abe257cd) ) /* cards deck gfx, bitplane1 */ | |
| 4288 | ROM_LOAD( "6.bin", 0x1000, 0x1000, CRC(eeec8862) SHA1(ae03aba1bd43c3ffd140f76770fc1c8cf89ea115) ) /* cards deck gfx, bitplane2 */ | |
| 4289 | ROM_LOAD( "5.bin", 0x2000, 0x1000, CRC(2712f297) SHA1(d3cc1469d07c3febbbe4a645cd6bdb57e09cf504) ) /* cards deck gfx, bitplane3 */ | |
| 4290 | ||
| 4291 | ROM_REGION( 0x0100, "proms", 0 ) | |
| 4292 | ROM_LOAD( "82s129.9c", 0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) /* PROM dump needed */ | |
| 4293 | ROM_END | |
| 4294 | ||
| 4295 | ROM_START( brasil93 ) | |
| 4296 | ROM_REGION( 0x10000, "maincpu", 0 ) /* brasil93.128: Brasil 93, BS clone. No lights */ | |
| 4297 | ROM_LOAD( "brasil93.128", 0x4000, 0x4000, CRC(cc25909f) SHA1(635184022bcb8936c396cb9fcfa6367fcae906fb) ) | |
| 4298 | ||
| 4299 | ROM_REGION( 0x3000, "gfx1", 0 ) | |
| 4300 | ROM_FILL( 0x0000, 0x2000, 0 ) /* filling the R-G bitplanes */ | |
| 4301 | ROM_LOAD( "4s.bin", 0x2000, 0x1000, CRC(0ac197eb) SHA1(fdf2b134c662f3c4d4a19d93a82d130ba643ace8) ) /* text layer */ | |
| 4302 | ||
| 4303 | ROM_REGION( 0x3000, "gfx2", 0 ) | |
| 4304 | ROM_LOAD( "7.bin", 0x0000, 0x1000, CRC(28ecfaea) SHA1(19d73ed0fdb5a873447b46e250ad6e71abe257cd) ) /* cards deck gfx, bitplane1 */ | |
| 4305 | ROM_LOAD( "6.bin", 0x1000, 0x1000, CRC(eeec8862) SHA1(ae03aba1bd43c3ffd140f76770fc1c8cf89ea115) ) /* cards deck gfx, bitplane2 */ | |
| 4306 | ROM_LOAD( "5.bin", 0x2000, 0x1000, CRC(2712f297) SHA1(d3cc1469d07c3febbbe4a645cd6bdb57e09cf504) ) /* cards deck gfx, bitplane3 */ | |
| 4307 | ||
| 4308 | ROM_REGION( 0x0100, "proms", 0 ) | |
| 4309 | ROM_LOAD( "82s129.9c", 0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) /* PROM dump needed */ | |
| 4310 | ROM_END | |
| 4311 | ||
| 4235 | 4312 | ROM_START( poker91 ) |
| 4236 | 4313 | ROM_REGION( 0x10000, "maincpu", 0 ) /* bs_pok91.bin: Poker 91. Based on witchcrd */ |
| 4237 | 4314 | ROM_LOAD( "bs_pok91.bin", 0x0000, 0x8000, CRC(90c88b45) SHA1(9b5842075ece5f96a6869d7a8c874dee2b2abde2) ) |
| r10613 | r10614 | |
| 4749 | 4826 | GAME( 1993, sloco93, 0, witchcrd, sloco93, 0, ROT0, "<unknown>", "Super Loco 93 (Spanish, set 1)", 0 ) |
| 4750 | 4827 | GAME( 1993, sloco93a, sloco93, witchcrd, sloco93, 0, ROT0, "<unknown>", "Super Loco 93 (Spanish, set 2)", 0 ) |
| 4751 | 4828 | GAME( 198?, maverik, 0, witchcrd, bsuerte, 0, ROT0, "<unknown>", "Maverik", 0 ) |
| 4752 | GAMEL( 1989, brasil89, 0, witchcrd, bsuerte, 0, ROT0, "<unknown>", "Brasil 89", 0, layout_goldnpkr ) | |
| 4829 | GAMEL( 1986, brasil86, 0, witchcrd, bsuerte, 0, ROT0, "<unknown>", "Brasil 86", 0, layout_goldnpkr ) | |
| 4830 | GAMEL( 1987, brasil87, 0, witchcrd, bsuerte, 0, ROT0, "<unknown>", "Brasil 87", 0, layout_goldnpkr ) | |
| 4831 | GAMEL( 1989, brasil89, 0, witchcrd, bsuerte, 0, ROT0, "<unknown>", "Brasil 89 (set 1)", 0, layout_goldnpkr ) | |
| 4832 | GAMEL( 1989, brasil89a,brasil89, witchcrd, bsuerte, 0, ROT0, "<unknown>", "Brasil 89 (set 2)", 0, layout_goldnpkr ) | |
| 4833 | GAME( 1993, brasil93, 0, witchcrd, bsuerte, 0, ROT0, "<unknown>", "Brasil 93", 0 ) // no lamps | |
| 4753 | 4834 | GAME( 1991, poker91, 0, witchcrd, poker91, 0, ROT0, "<unknown>", "Poker 91", 0 ) |
| 4754 | 4835 | GAME( 198?, genie, 0, genie, genie, 0, ROT0, "Video Fun Games Ltd.", "Genie", 0 ) |
| 4755 | 4836 |
| r10613 | r10614 | |
|---|---|---|
| 63 | 63 | AM_RANGE(0x90, 0x97) AM_WRITE(hyhoo_blitter_w) |
| 64 | 64 | AM_RANGE(0xa0, 0xa0) AM_READWRITE(nb1413m3_inputport1_r, nb1413m3_inputportsel_w) |
| 65 | 65 | AM_RANGE(0xb0, 0xb0) AM_READWRITE(nb1413m3_inputport2_r, nb1413m3_sndrombank1_w) |
| 66 | AM_RANGE(0xc0, 0xcf) AM_WRITEONLY AM_BASE( | |
| 66 | AM_RANGE(0xc0, 0xcf) AM_WRITEONLY AM_BASE_MEMBER( | |
| 67 | 67 | AM_RANGE(0xd0, 0xd0) AM_READNOP AM_DEVWRITE("dac", DAC_WRITE) // unknown read |
| 68 | 68 | AM_RANGE(0xe0, 0xe0) AM_WRITE(hyhoo_romsel_w) |
| 69 | 69 | AM_RANGE(0xe0, 0xe1) AM_READ(nb1413m3_gfxrom_r) |
| r10613 | r10614 | |
| 245 | 245 | }; |
| 246 | 246 | |
| 247 | 247 | |
| 248 | static MACHINE_CONFIG_START( hyhoo, | |
| 248 | static MACHINE_CONFIG_START( hyhoo, hyhoo | |
| 249 | 249 | |
| 250 | 250 | /* basic machine hardware */ |
| 251 | 251 | MCFG_CPU_ADD("maincpu", Z80, 5000000) /* 5.00 MHz ?? */ |
| r10613 | r10614 | |
|---|---|---|
| 790 | 790 | MCFG_TLC34076_ADD("tlc34076", TLC34076_6_BIT) |
| 791 | 791 | |
| 792 | 792 | MCFG_VIDEO_START(tickee) |
| 793 | ||
| 793 | ||
| 794 | 794 | MCFG_SCREEN_ADD("screen", RASTER) |
| 795 | 795 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 796 | 796 | MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK/2, 444, 0, 320, 233, 0, 200) |
| r10613 | r10614 | |
|---|---|---|
| 189 | 189 | static WRITE8_HANDLER( destroyr_output_w ) |
| 190 | 190 | { |
| 191 | 191 | if (offset & 8) destroyr_misc_w(space, 8, data); |
| 192 | ||
| 192 | ||
| 193 | 193 | else switch (offset & 7) |
| 194 | 194 | { |
| 195 | 195 | case 0: |
| r10613 | r10614 | |
|---|---|---|
| 71 | 71 | #include "sound/nes_apu.h" |
| 72 | 72 | #include "video/ppu2c0x.h" |
| 73 | 73 | |
| 74 | ||
| 75 | class multigam_state : public driver_device | |
| 76 | { | |
| 77 | public: | |
| 78 | multigam_state(running_machine &machine, const driver_device_config_base &config) | |
| 79 | : driver_device(machine, config) { } | |
| 80 | ||
| 81 | UINT8* nt_ram; | |
| 82 | UINT8* vram; | |
| 83 | UINT8* nt_page[4]; | |
| 84 | UINT32 in_0; | |
| 85 | UINT32 in_1; | |
| 86 | UINT32 in_0_shift; | |
| 87 | UINT32 in_1_shift; | |
| 88 | UINT32 in_dsw; | |
| 89 | UINT32 in_dsw_shift; | |
| 90 | int game_gfx_bank; | |
| 91 | int multigam3_mmc3_scanline_counter; | |
| 92 | int multigam3_mmc3_scanline_latch; | |
| 93 | int multigam3_mmc3_banks[2]; | |
| 94 | int multigam3_mmc3_4screen; | |
| 95 | int multigam3_mmc3_last_bank; | |
| 96 | UINT8* multigmc_mmc3_6000_ram; | |
| 97 | UINT8* multigam3_mmc3_prg_base; | |
| 98 | int multigam3_mmc3_prg_size; | |
| 99 | int multigam3_mmc3_chr_bank_base; | |
| 100 | int multigam3_mmc3_command; | |
| 101 | UINT8* mapper02_prg_base; | |
| 102 | int mapper02_prg_size; | |
| 103 | int mmc1_shiftreg; | |
| 104 | int mmc1_shiftcount; | |
| 105 | int mmc1_rom_mask; | |
| 106 | UINT8* mmc1_prg_base; | |
| 107 | int mmc1_prg_size; | |
| 108 | int mmc1_chr_bank_base; | |
| 109 | int mmc1_reg_write_enable; | |
| 110 | int size16k; | |
| 111 | int switchlow; | |
| 112 | int vrom4k; | |
| 113 | UINT8 supergm3_prg_bank; | |
| 114 | UINT8 supergm3_chr_bank; | |
| 115 | }; | |
| 116 | ||
| 117 | ||
| 74 | 118 | /****************************************************** |
| 75 | 119 | |
| 76 | 120 | PPU external bus interface |
| 77 | 121 | |
| 78 | 122 | *******************************************************/ |
| 79 | 123 | |
| 80 | static UINT8* nt_ram; | |
| 81 | static UINT8* vram; | |
| 82 | static UINT8* nt_page[4]; | |
| 83 | 124 | |
| 84 | static void set_mirroring(int mirroring) | |
| 125 | static void set_mirroring(multigam_state *state, int mirroring) | |
| 85 | 126 | { |
| 86 | 127 | switch(mirroring) |
| 87 | 128 | { |
| 88 | 129 | case PPU_MIRROR_LOW: |
| 89 | nt_page[0] = nt_page[1] = nt_page[2] = nt_page[3] = nt_ram; | |
| 130 | state->nt_page[0] = state->nt_page[1] = state->nt_page[2] = state->nt_page[3] = state->nt_ram; | |
| 90 | 131 | break; |
| 91 | 132 | case PPU_MIRROR_HIGH: |
| 92 | nt_page[0] = nt_page[1] = nt_page[2] = nt_page[3] = nt_ram + 0x400; | |
| 133 | state->nt_page[0] = state->nt_page[1] = state->nt_page[2] = state->nt_page[3] = state->nt_ram + 0x400; | |
| 93 | 134 | break; |
| 94 | 135 | case PPU_MIRROR_HORZ: |
| 95 | nt_page[0] = nt_ram; | |
| 96 | nt_page[1] = nt_ram; | |
| 97 | nt_page[2] = nt_ram + 0x400; | |
| 98 | nt_page[3] = nt_ram + 0x400; | |
| 136 | state->nt_page[0] = state->nt_ram; | |
| 137 | state->nt_page[1] = state->nt_ram; | |
| 138 | state->nt_page[2] = state->nt_ram + 0x400; | |
| 139 | state->nt_page[3] = state->nt_ram + 0x400; | |
| 99 | 140 | break; |
| 100 | 141 | case PPU_MIRROR_VERT: |
| 101 | nt_page[0] = nt_ram; | |
| 102 | nt_page[1] = nt_ram + 0x400; | |
| 103 | nt_page[2] = nt_ram; | |
| 104 | nt_page[3] = nt_ram + 0x400; | |
| 142 | state->nt_page[0] = state->nt_ram; | |
| 143 | state->nt_page[1] = state->nt_ram + 0x400; | |
| 144 | state->nt_page[2] = state->nt_ram; | |
| 145 | state->nt_page[3] = state->nt_ram + 0x400; | |
| 105 | 146 | break; |
| 106 | 147 | case PPU_MIRROR_NONE: |
| 107 | 148 | default: |
| 108 | nt_page[0] = nt_ram; | |
| 109 | nt_page[1] = nt_ram + 0x400; | |
| 110 | nt_page[2] = nt_ram + 0x800; | |
| 111 | nt_page[3] = nt_ram + 0xc00; | |
| 149 | state->nt_page[0] = state->nt_ram; | |
| 150 | state->nt_page[1] = state->nt_ram + 0x400; | |
| 151 | state->nt_page[2] = state->nt_ram + 0x800; | |
| 152 | state->nt_page[3] = state->nt_ram + 0xc00; | |
| 112 | 153 | break; |
| 113 | 154 | } |
| 114 | 155 | } |
| 115 | 156 | |
| 116 | 157 | static WRITE8_HANDLER (multigam_nt_w) |
| 117 | 158 | { |
| 159 | multigam_state *state = space->machine->driver_data<multigam_state>(); | |
| 118 | 160 | int page = ((offset & 0xc00) >> 10); |
| 119 | nt_page[page][offset & 0x3ff] = data; | |
| 161 | state->nt_page[page][offset & 0x3ff] = data; | |
| 120 | 162 | } |
| 121 | 163 | |
| 122 | 164 | |
| 123 | 165 | static READ8_HANDLER (multigam_nt_r) |
| 124 | 166 | { |
| 167 | multigam_state *state = space->machine->driver_data<multigam_state>(); | |
| 125 | 168 | int page = ((offset & 0xc00) >> 10); |
| 126 | return nt_page[page][offset & 0x3ff]; | |
| 169 | return state->nt_page[page][offset & 0x3ff]; | |
| 127 | 170 | } |
| 128 | 171 | |
| 129 | 172 | static const char * const banknames[] = { "bank2", "bank3", "bank4", "bank5", "bank6", "bank7", "bank8", "bank9" }; |
| r10613 | r10614 | |
| 142 | 185 | |
| 143 | 186 | static void set_videoram_bank(running_machine* machine, int start, int count, int bank, int bank_size_in_kb) |
| 144 | 187 | { |
| 188 | multigam_state *state = machine->driver_data<multigam_state>(); | |
| 145 | 189 | int i; |
| 146 | 190 | int offset = bank * (bank_size_in_kb * 0x400); |
| 147 | 191 | /* bank_size_in_kb is used to determine how large the "bank" parameter is */ |
| 148 | 192 | /* count determines the size of the area mapped in KB */ |
| 149 | 193 | for (i = 0; i < count; i++, offset += 0x400) |
| 150 | 194 | { |
| 151 | memory_set_bankptr(machine, banknames[i + start], vram + offset); | |
| 195 | memory_set_bankptr(machine, banknames[i + start], state->vram + offset); | |
| 152 | 196 | } |
| 153 | 197 | } |
| 154 | 198 | |
| r10613 | r10614 | |
| 185 | 229 | |
| 186 | 230 | *******************************************************/ |
| 187 | 231 | |
| 188 | static UINT32 in_0; | |
| 189 | static UINT32 in_1; | |
| 190 | static UINT32 in_0_shift; | |
| 191 | static UINT32 in_1_shift; | |
| 192 | static UINT32 multigam_in_dsw; | |
| 193 | static UINT32 multigam_in_dsw_shift; | |
| 194 | 232 | |
| 195 | 233 | static READ8_HANDLER( multigam_IN0_r ) |
| 196 | 234 | { |
| 197 | return ((in_0 >> in_0_shift++) & 0x01) | 0x40; | |
| 235 | multigam_state *state = space->machine->driver_data<multigam_state>(); | |
| 236 | return ((state->in_0 >> state->in_0_shift++) & 0x01) | 0x40; | |
| 198 | 237 | } |
| 199 | 238 | |
| 200 | 239 | static WRITE8_HANDLER( multigam_IN0_w ) |
| 201 | 240 | { |
| 241 | multigam_state *state = space->machine->driver_data<multigam_state>(); | |
| 202 | 242 | if (data & 0x01) |
| 203 | 243 | { |
| 204 | 244 | return; |
| 205 | 245 | } |
| 206 | 246 | |
| 207 | in_0_shift = 0; | |
| 208 | in_1_shift = 0; | |
| 247 | state->in_0_shift = 0; | |
| 248 | state->in_1_shift = 0; | |
| 209 | 249 | |
| 210 | in_0 = input_port_read(space->machine, "P1"); | |
| 211 | in_1 = input_port_read(space->machine, "P2"); | |
| 250 | state->in_0 = input_port_read(space->machine, "P1"); | |
| 251 | state->in_1 = input_port_read(space->machine, "P2"); | |
| 212 | 252 | |
| 213 | multigam_in_dsw_shift = 0; | |
| 214 | multigam_in_dsw = input_port_read_safe(space->machine, "DSW", 0); | |
| 253 | state->in_dsw_shift = 0; | |
| 254 | state->in_dsw = input_port_read_safe(space->machine, "DSW", 0); | |
| 215 | 255 | } |
| 216 | 256 | |
| 217 | 257 | static READ8_HANDLER( multigam_IN1_r ) |
| 218 | 258 | { |
| 219 | return ((in_1 >> in_1_shift++) & 0x01) | 0x40; | |
| 259 | multigam_state *state = space->machine->driver_data<multigam_state>(); | |
| 260 | return ((state->in_1 >> state->in_1_shift++) & 0x01) | 0x40; | |
| 220 | 261 | } |
| 221 | 262 | |
| 222 | 263 | static CUSTOM_INPUT( multigam_inputs_r ) |
| 223 | 264 | { |
| 265 | multigam_state *state = field->port->machine->driver_data<multigam_state>(); | |
| 224 | 266 | /* bit 0: serial input (dsw) |
| 225 | 267 | bit 1: coin */ |
| 226 | return ( | |
| 268 | return (s | |
| 227 | 269 | } |
| 228 | 270 | |
| 229 | 271 | |
| r10613 | r10614 | |
| 233 | 275 | |
| 234 | 276 | *******************************************************/ |
| 235 | 277 | |
| 236 | static int multigam_game_gfx_bank = 0; | |
| 237 | 278 | |
| 238 | 279 | static WRITE8_HANDLER(multigam_switch_prg_rom) |
| 239 | 280 | { |
| r10613 | r10614 | |
| 258 | 299 | |
| 259 | 300 | static WRITE8_HANDLER(multigam_switch_gfx_rom) |
| 260 | 301 | { |
| 302 | multigam_state *state = space->machine->driver_data<multigam_state>(); | |
| 261 | 303 | memory_set_bankptr(space->machine, "bank1", space->machine->region("gfx1")->base() + (0x2000 * (data & 0x3f))); |
| 262 | set_mirroring(data & 0x40 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); | |
| 263 | multigam_game_gfx_bank = data; | |
| 304 | set_mirroring(state, data & 0x40 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); | |
| 305 | state->game_gfx_bank = data; | |
| 264 | 306 | }; |
| 265 | 307 | |
| 266 | 308 | |
| 267 | 309 | static WRITE8_HANDLER(multigam_mapper2_w) |
| 268 | 310 | { |
| 269 | if (multigam_game_gfx_bank & 0x80) | |
| 311 | multigam_state *state = space->machine->driver_data<multigam_state>(); | |
| 312 | if (state->game_gfx_bank & 0x80) | |
| 270 | 313 | { |
| 271 | memory_set_bankptr(space->machine, "bank1", space->machine->region("gfx1")->base() + (0x2000 * ((data & 0x3) + ( | |
| 314 | memory_set_bankptr(space->machine, "bank1", space->machine->region("gfx1")->base() + (0x2000 * ((data & 0x3) + (s | |
| 272 | 315 | } |
| 273 | 316 | else |
| 274 | 317 | { |
| r10613 | r10614 | |
| 324 | 367 | |
| 325 | 368 | *******************************************************/ |
| 326 | 369 | |
| 327 | static int multigam3_mmc3_scanline_counter; | |
| 328 | static int multigam3_mmc3_scanline_latch; | |
| 329 | static int multigam3_mmc3_banks[2]; | |
| 330 | static int multigam3_mmc3_4screen; | |
| 331 | static int multigam3_mmc3_last_bank; | |
| 332 | static UINT8* multigmc_mmc3_6000_ram; | |
| 333 | static UINT8* multigam3_mmc3_prg_base; | |
| 334 | static int multigam3_mmc3_prg_size; | |
| 335 | static int multigam3_mmc3_chr_bank_base; | |
| 336 | 370 | |
| 337 | 371 | static void multigam3_mmc3_scanline_cb( device_t *device, int scanline, int vblank, int blanked ) |
| 338 | 372 | { |
| 373 | multigam_state *state = device->machine->driver_data<multigam_state>(); | |
| 339 | 374 | if (!vblank && !blanked) |
| 340 | 375 | { |
| 341 | if (--multigam3_mmc3_scanline_counter == -1) | |
| 376 | if (--state->multigam3_mmc3_scanline_counter == -1) | |
| 342 | 377 | { |
| 343 | multigam3_mmc3_scanline_counter = multigam3_mmc3_scanline_latch; | |
| 378 | state->multigam3_mmc3_scanline_counter = state->multigam3_mmc3_scanline_latch; | |
| 344 | 379 | generic_pulse_irq_line(device->machine->device("maincpu"), 0); |
| 345 | 380 | } |
| 346 | 381 | } |
| r10613 | r10614 | |
| 348 | 383 | |
| 349 | 384 | static WRITE8_HANDLER( multigam3_mmc3_rom_switch_w ) |
| 350 | 385 | { |
| 386 | multigam_state *state = space->machine->driver_data<multigam_state>(); | |
| 351 | 387 | device_t *ppu = space->machine->device("ppu"); |
| 352 | 388 | |
| 353 | 389 | /* basically, a MMC3 mapper from the nes */ |
| 354 | static int multigam3_mmc3_command; | |
| 355 | int bankmask = multigam3_mmc3_prg_size == 0x40000 ? 0x1f : 0x0f; | |
| 390 | int bankmask = state->multigam3_mmc3_prg_size == 0x40000 ? 0x1f : 0x0f; | |
| 356 | 391 | |
| 357 | 392 | switch(offset & 0x7001) |
| 358 | 393 | { |
| 359 | 394 | case 0x0000: |
| 360 | multigam3_mmc3_command = data; | |
| 395 | state->multigam3_mmc3_command = data; | |
| 361 | 396 | |
| 362 | if (multigam3_mmc3_last_bank != (data & 0xc0)) | |
| 397 | if (state->multigam3_mmc3_last_bank != (data & 0xc0)) | |
| 363 | 398 | { |
| 364 | 399 | int bank; |
| 365 | 400 | UINT8 *prg = space->machine->region("maincpu")->base(); |
| 366 | 401 | |
| 367 | 402 | /* reset the banks */ |
| 368 | if (multigam3_mmc3_command & 0x40) | |
| 403 | if (state->multigam3_mmc3_command & 0x40) | |
| 369 | 404 | { |
| 370 | 405 | /* high bank */ |
| 371 | bank = (multigam3_mmc3_banks[0] & bankmask) * 0x2000; | |
| 406 | bank = (state->multigam3_mmc3_banks[0] & bankmask) * 0x2000; | |
| 372 | 407 | |
| 373 | memcpy(&prg[0x0c000], &multigam3_mmc3_prg_base[bank], 0x2000); | |
| 374 | memcpy(&prg[0x08000], &multigam3_mmc3_prg_base[multigam3_mmc3_prg_size - 0x4000], 0x2000); | |
| 408 | memcpy(&prg[0x0c000], &state->multigam3_mmc3_prg_base[bank], 0x2000); | |
| 409 | memcpy(&prg[0x08000], &state->multigam3_mmc3_prg_base[state->multigam3_mmc3_prg_size - 0x4000], 0x2000); | |
| 375 | 410 | } |
| 376 | 411 | else |
| 377 | 412 | { |
| 378 | 413 | /* low bank */ |
| 379 | bank = (multigam3_mmc3_banks[0] & bankmask) * 0x2000; | |
| 414 | bank = (state->multigam3_mmc3_banks[0] & bankmask) * 0x2000; | |
| 380 | 415 | |
| 381 | memcpy(&prg[0x08000], &multigam3_mmc3_prg_base[bank], 0x2000); | |
| 382 | memcpy(&prg[0x0c000], &multigam3_mmc3_prg_base[multigam3_mmc3_prg_size - 0x4000], 0x2000); | |
| 416 | memcpy(&prg[0x08000], &state->multigam3_mmc3_prg_base[bank], 0x2000); | |
| 417 | memcpy(&prg[0x0c000], &state->multigam3_mmc3_prg_base[state->multigam3_mmc3_prg_size - 0x4000], 0x2000); | |
| 383 | 418 | } |
| 384 | 419 | |
| 385 | 420 | /* mid bank */ |
| 386 | bank = (multigam3_mmc3_banks[1] & bankmask) * 0x2000; | |
| 387 | memcpy(&prg[0x0a000], &multigam3_mmc3_prg_base[bank], 0x2000); | |
| 421 | bank = (state->multigam3_mmc3_banks[1] & bankmask) * 0x2000; | |
| 422 | memcpy(&prg[0x0a000], &state->multigam3_mmc3_prg_base[bank], 0x2000); | |
| 388 | 423 | |
| 389 | multigam3_mmc3_last_bank = data & 0xc0; | |
| 424 | state->multigam3_mmc3_last_bank = data & 0xc0; | |
| 390 | 425 | } |
| 391 | 426 | break; |
| 392 | 427 | |
| 393 | 428 | case 0x0001: |
| 394 | 429 | { |
| 395 | UINT8 cmd = multigam3_mmc3_command & 0x07; | |
| 396 | int page = (multigam3_mmc3_command & 0x80) >> 5; | |
| 430 | UINT8 cmd = state->multigam3_mmc3_command & 0x07; | |
| 431 | int page = (state->multigam3_mmc3_command & 0x80) >> 5; | |
| 397 | 432 | int bank; |
| 398 | 433 | |
| 399 | 434 | switch (cmd) |
| r10613 | r10614 | |
| 402 | 437 | case 1: /* char banking */ |
| 403 | 438 | data &= 0xfe; |
| 404 | 439 | page ^= (cmd << 1); |
| 405 | set_videorom_bank(space->machine, page, 2, multigam3_mmc3_chr_bank_base + data, 1); | |
| 440 | set_videorom_bank(space->machine, page, 2, state->multigam3_mmc3_chr_bank_base + data, 1); | |
| 406 | 441 | break; |
| 407 | 442 | |
| 408 | 443 | case 2: /* char banking */ |
| r10613 | r10614 | |
| 410 | 445 | case 4: /* char banking */ |
| 411 | 446 | case 5: /* char banking */ |
| 412 | 447 | page ^= cmd + 2; |
| 413 | set_videorom_bank(space->machine, page, 1, multigam3_mmc3_chr_bank_base + data, 1); | |
| 448 | set_videorom_bank(space->machine, page, 1, state->multigam3_mmc3_chr_bank_base + data, 1); | |
| 414 | 449 | break; |
| 415 | 450 | |
| 416 | 451 | case 6: /* program banking */ |
| 417 | 452 | { |
| 418 | 453 | UINT8 *prg = space->machine->region("maincpu")->base(); |
| 419 | if (multigam3_mmc3_command & 0x40) | |
| 454 | if (state->multigam3_mmc3_command & 0x40) | |
| 420 | 455 | { |
| 421 | 456 | /* high bank */ |
| 422 | multigam3_mmc3_banks[0] = data & bankmask; | |
| 423 | bank = (multigam3_mmc3_banks[0]) * 0x2000; | |
| 457 | state->multigam3_mmc3_banks[0] = data & bankmask; | |
| 458 | bank = (state->multigam3_mmc3_banks[0]) * 0x2000; | |
| 424 | 459 | |
| 425 | memcpy(&prg[0x0c000], &multigam3_mmc3_prg_base[bank], 0x2000); | |
| 426 | memcpy(&prg[0x08000], &multigam3_mmc3_prg_base[multigam3_mmc3_prg_size - 0x4000], 0x2000); | |
| 460 | memcpy(&prg[0x0c000], &state->multigam3_mmc3_prg_base[bank], 0x2000); | |
| 461 | memcpy(&prg[0x08000], &state->multigam3_mmc3_prg_base[state->multigam3_mmc3_prg_size - 0x4000], 0x2000); | |
| 427 | 462 | } |
| 428 | 463 | else |
| 429 | 464 | { |
| 430 | 465 | /* low bank */ |
| 431 | multigam3_mmc3_banks[0] = data & bankmask; | |
| 432 | bank = (multigam3_mmc3_banks[0]) * 0x2000; | |
| 466 | state->multigam3_mmc3_banks[0] = data & bankmask; | |
| 467 | bank = (state->multigam3_mmc3_banks[0]) * 0x2000; | |
| 433 | 468 | |
| 434 | memcpy(&prg[0x08000], &multigam3_mmc3_prg_base[bank], 0x2000); | |
| 435 | memcpy(&prg[0x0c000], &multigam3_mmc3_prg_base[multigam3_mmc3_prg_size - 0x4000], 0x2000); | |
| 469 | memcpy(&prg[0x08000], &state->multigam3_mmc3_prg_base[bank], 0x2000); | |
| 470 | memcpy(&prg[0x0c000], &state->multigam3_mmc3_prg_base[state->multigam3_mmc3_prg_size - 0x4000], 0x2000); | |
| 436 | 471 | } |
| 437 | 472 | } |
| 438 | 473 | break; |
| r10613 | r10614 | |
| 442 | 477 | /* mid bank */ |
| 443 | 478 | UINT8 *prg = space->machine->region("maincpu")->base(); |
| 444 | 479 | |
| 445 | multigam3_mmc3_banks[1] = data & bankmask; | |
| 446 | bank = multigam3_mmc3_banks[1] * 0x2000; | |
| 480 | state->multigam3_mmc3_banks[1] = data & bankmask; | |
| 481 | bank = state->multigam3_mmc3_banks[1] * 0x2000; | |
| 447 | 482 | |
| 448 | memcpy(&prg[0x0a000], &multigam3_mmc3_prg_base[bank], 0x2000); | |
| 483 | memcpy(&prg[0x0a000], &state->multigam3_mmc3_prg_base[bank], 0x2000); | |
| 449 | 484 | } |
| 450 | 485 | break; |
| 451 | 486 | } |
| r10613 | r10614 | |
| 453 | 488 | break; |
| 454 | 489 | |
| 455 | 490 | case 0x2000: /* mirroring */ |
| 456 | if (!multigam3_mmc3_4screen) | |
| 491 | if (!state->multigam3_mmc3_4screen) | |
| 457 | 492 | { |
| 458 | 493 | if (data & 0x40) |
| 459 | set_mirroring(PPU_MIRROR_HIGH); | |
| 494 | set_mirroring(state, PPU_MIRROR_HIGH); | |
| 460 | 495 | else |
| 461 | set_mirroring((data & 1) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); | |
| 496 | set_mirroring(state, (data & 1) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); | |
| 462 | 497 | } |
| 463 | 498 | break; |
| 464 | 499 | |
| 465 | 500 | case 0x2001: /* enable ram at $6000 */ |
| 466 | 501 | if (data & 0x80) |
| 467 | 502 | { |
| 468 | memory_set_bankptr(space->machine, "bank10", multigmc_mmc3_6000_ram); | |
| 503 | memory_set_bankptr(space->machine, "bank10", state->multigmc_mmc3_6000_ram); | |
| 469 | 504 | } |
| 470 | 505 | else |
| 471 | 506 | { |
| r10613 | r10614 | |
| 478 | 513 | break; |
| 479 | 514 | |
| 480 | 515 | case 0x4000: /* scanline counter */ |
| 481 | multigam3_mmc3_scanline_counter = data; | |
| 516 | state->multigam3_mmc3_scanline_counter = data; | |
| 482 | 517 | break; |
| 483 | 518 | |
| 484 | 519 | case 0x4001: /* scanline latch */ |
| 485 | multigam3_mmc3_scanline_latch = data; | |
| 520 | state->multigam3_mmc3_scanline_latch = data; | |
| 486 | 521 | break; |
| 487 | 522 | |
| 488 | 523 | case 0x6000: /* disable irqs */ |
| r10613 | r10614 | |
| 497 | 532 | |
| 498 | 533 | static void multigam_init_mmc3(running_machine *machine, UINT8 *prg_base, int prg_size, int chr_bank_base) |
| 499 | 534 | { |
| 535 | multigam_state *state = machine->driver_data<multigam_state>(); | |
| 500 | 536 | UINT8* dst = machine->region("maincpu")->base(); |
| 501 | 537 | |
| 502 | 538 | // Tom & Jerry in Super Game III enables 6000 ram, but does not read/write it |
| 503 | 539 | // however, it expects ROM from 6000 there (code jumps to $6xxx) |
| 504 | memcpy(multigmc_mmc3_6000_ram, dst + 0x6000, 0x2000); | |
| 540 | memcpy(state->multigmc_mmc3_6000_ram, dst + 0x6000, 0x2000); | |
| 505 | 541 | |
| 506 | 542 | memcpy(&dst[0x8000], prg_base + (prg_size - 0x4000), 0x4000); |
| 507 | 543 | memcpy(&dst[0xc000], prg_base + (prg_size - 0x4000), 0x4000); |
| 508 | 544 | |
| 509 | 545 | memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, multigam3_mmc3_rom_switch_w ); |
| 510 | 546 | |
| 511 | multigam3_mmc3_banks[0] = 0x1e; | |
| 512 | multigam3_mmc3_banks[1] = 0x1f; | |
| 513 | multigam3_mmc3_scanline_counter = 0; | |
| 514 | multigam3_mmc3_scanline_latch = 0; | |
| 515 | multigam3_mmc3_4screen = 0; | |
| 516 | multigam3_mmc3_last_bank = 0xff; | |
| 517 | multigam3_mmc3_prg_base = prg_base; | |
| 518 | multigam3_mmc3_chr_bank_base = chr_bank_base; | |
| 519 | multigam3_mmc3_prg_size = prg_size; | |
| 547 | state->multigam3_mmc3_banks[0] = 0x1e; | |
| 548 | state->multigam3_mmc3_banks[1] = 0x1f; | |
| 549 | state->multigam3_mmc3_scanline_counter = 0; | |
| 550 | state->multigam3_mmc3_scanline_latch = 0; | |
| 551 | state->multigam3_mmc3_4screen = 0; | |
| 552 | state->multigam3_mmc3_last_bank = 0xff; | |
| 553 | state->multigam3_mmc3_prg_base = prg_base; | |
| 554 | state->multigam3_mmc3_chr_bank_base = chr_bank_base; | |
| 555 | state->multigam3_mmc3_prg_size = prg_size; | |
| 520 | 556 | }; |
| 521 | 557 | |
| 522 | 558 | static WRITE8_HANDLER(multigm3_mapper2_w) |
| 523 | 559 | { |
| 524 | if (multigam_game_gfx_bank & 0x80) | |
| 560 | multigam_state *state = space->machine->driver_data<multigam_state>(); | |
| 561 | if (state->game_gfx_bank & 0x80) | |
| 525 | 562 | { |
| 526 | set_videorom_bank(space->machine, 0, 8, ( | |
| 563 | set_videorom_bank(space->machine, 0, 8, (s | |
| 527 | 564 | } |
| 528 | 565 | else |
| 529 | 566 | { |
| r10613 | r10614 | |
| 533 | 570 | |
| 534 | 571 | static WRITE8_HANDLER(multigm3_switch_gfx_rom) |
| 535 | 572 | { |
| 573 | multigam_state *state = space->machine->driver_data<multigam_state>(); | |
| 536 | 574 | set_videorom_bank(space->machine, 0, 8, data & 0x3f, 8); |
| 537 | set_mirroring(data & 0x40 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); | |
| 538 | multigam_game_gfx_bank = data; | |
| 575 | set_mirroring(state, data & 0x40 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); | |
| 576 | state->game_gfx_bank = data; | |
| 539 | 577 | }; |
| 540 | 578 | |
| 541 | 579 | static WRITE8_HANDLER(multigm3_switch_prg_rom) |
| r10613 | r10614 | |
| 601 | 639 | |
| 602 | 640 | *******************************************************/ |
| 603 | 641 | |
| 604 | static UINT8* multigam_mapper02_prg_base; | |
| 605 | static int multigam_mapper02_prg_size; | |
| 606 | 642 | |
| 607 | 643 | static WRITE8_HANDLER(multigam3_mapper02_rom_switch_w) |
| 608 | 644 | { |
| 645 | multigam_state *state = space->machine->driver_data<multigam_state>(); | |
| 609 | 646 | UINT8* mem = space->machine->region("maincpu")->base(); |
| 610 | int bankmask = (multigam_mapper02_prg_size/0x4000) - 1; | |
| 611 | memcpy(mem + 0x8000, multigam_mapper02_prg_base + 0x4000*(data & bankmask), 0x4000); | |
| 647 | int bankmask = (state->mapper02_prg_size/0x4000) - 1; | |
| 648 | memcpy(mem + 0x8000, state->mapper02_prg_base + 0x4000*(data & bankmask), 0x4000); | |
| 612 | 649 | } |
| 613 | 650 | |
| 614 | 651 | static void multigam_init_mapper02(running_machine *machine, UINT8* prg_base, int prg_size) |
| 615 | 652 | { |
| 653 | multigam_state *state = machine->driver_data<multigam_state>(); | |
| 616 | 654 | UINT8* mem = machine->region("maincpu")->base(); |
| 617 | 655 | memcpy(mem + 0x8000, prg_base + prg_size - 0x8000, 0x8000); |
| 618 | 656 | memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, multigam3_mapper02_rom_switch_w ); |
| 619 | 657 | |
| 620 | multigam_mapper02_prg_base = prg_base; | |
| 621 | multigam_mapper02_prg_size = prg_size; | |
| 658 | state->mapper02_prg_base = prg_base; | |
| 659 | state->mapper02_prg_size = prg_size; | |
| 622 | 660 | |
| 623 | 661 | ppu2c0x_set_scanline_callback(machine->device("ppu"), 0); |
| 624 | 662 | } |
| r10613 | r10614 | |
| 629 | 667 | |
| 630 | 668 | *******************************************************/ |
| 631 | 669 | |
| 632 | static int mmc1_shiftreg; | |
| 633 | static int mmc1_shiftcount; | |
| 634 | static int mmc1_rom_mask; | |
| 635 | static UINT8* multigam_mmc1_prg_base; | |
| 636 | static int multigam_mmc1_prg_size; | |
| 637 | static int multigam_mmc1_chr_bank_base; | |
| 638 | static int multigam_mmc1_reg_write_enable; | |
| 639 | 670 | |
| 640 | 671 | static TIMER_CALLBACK( mmc1_resync_callback ) |
| 641 | 672 | { |
| 642 | multigam_mmc1_reg_write_enable = 1; | |
| 673 | multigam_state *state = machine->driver_data<multigam_state>(); | |
| 674 | state->mmc1_reg_write_enable = 1; | |
| 643 | 675 | } |
| 644 | 676 | |
| 645 | 677 | static WRITE8_HANDLER( mmc1_rom_switch_w ) |
| 646 | 678 | { |
| 679 | multigam_state *state = space->machine->driver_data<multigam_state>(); | |
| 647 | 680 | /* basically, a MMC1 mapper from the nes */ |
| 648 | static int size16k, switchlow, vrom4k; | |
| 649 | 681 | |
| 650 | if ( | |
| 682 | if ( s | |
| 651 | 683 | { |
| 652 | 684 | return; |
| 653 | 685 | } |
| 654 | 686 | else |
| 655 | 687 | { |
| 656 | | |
| 688 | s | |
| 657 | 689 | space->machine->scheduler().synchronize(FUNC(mmc1_resync_callback)); |
| 658 | 690 | } |
| 659 | 691 | |
| r10613 | r10614 | |
| 662 | 694 | /* reset mapper */ |
| 663 | 695 | if (data & 0x80) |
| 664 | 696 | { |
| 665 | mmc1_shiftreg = mmc1_shiftcount = 0; | |
| 697 | state->mmc1_shiftreg = state->mmc1_shiftcount = 0; | |
| 666 | 698 | |
| 667 | size16k = 1; | |
| 668 | switchlow = 1; | |
| 669 | vrom4k = 0; | |
| 699 | state->size16k = 1; | |
| 700 | state->switchlow = 1; | |
| 701 | state->vrom4k = 0; | |
| 670 | 702 | |
| 671 | 703 | return; |
| 672 | 704 | } |
| 673 | 705 | |
| 674 | 706 | /* see if we need to clock in data */ |
| 675 | if (mmc1_shiftcount < 5) | |
| 707 | if (state->mmc1_shiftcount < 5) | |
| 676 | 708 | { |
| 677 | mmc1_shiftreg >>= 1; | |
| 678 | mmc1_shiftreg |= (data & 1) << 4; | |
| 679 | mmc1_shiftcount++; | |
| 709 | state->mmc1_shiftreg >>= 1; | |
| 710 | state->mmc1_shiftreg |= (data & 1) << 4; | |
| 711 | state->mmc1_shiftcount++; | |
| 680 | 712 | } |
| 681 | 713 | |
| 682 | 714 | /* are we done shifting? */ |
| 683 | if (mmc1_shiftcount == 5) | |
| 715 | if (state->mmc1_shiftcount == 5) | |
| 684 | 716 | { |
| 685 | 717 | /* reset count */ |
| 686 | mmc1_shiftcount = 0; | |
| 718 | state->mmc1_shiftcount = 0; | |
| 687 | 719 | |
| 688 | 720 | /* apply data to registers */ |
| 689 | 721 | switch (reg) |
| r10613 | r10614 | |
| 692 | 724 | { |
| 693 | 725 | int _mirroring; |
| 694 | 726 | |
| 695 | vrom4k = mmc1_shiftreg & 0x10; | |
| 696 | size16k = mmc1_shiftreg & 0x08; | |
| 697 | switchlow = mmc1_shiftreg & 0x04; | |
| 727 | state->vrom4k = state->mmc1_shiftreg & 0x10; | |
| 728 | state->size16k = state->mmc1_shiftreg & 0x08; | |
| 729 | state->switchlow = state->mmc1_shiftreg & 0x04; | |
| 698 | 730 | |
| 699 | switch (mmc1_shiftreg & 3) | |
| 731 | switch (state->mmc1_shiftreg & 3) | |
| 700 | 732 | { |
| 701 | 733 | case 0: |
| 702 | 734 | _mirroring = PPU_MIRROR_LOW; |
| r10613 | r10614 | |
| 717 | 749 | } |
| 718 | 750 | |
| 719 | 751 | /* apply mirroring */ |
| 720 | set_mirroring(_mirroring); | |
| 752 | set_mirroring(state, _mirroring); | |
| 721 | 753 | } |
| 722 | 754 | break; |
| 723 | 755 | |
| 724 | 756 | case 1: /* video rom banking - bank 0 - 4k or 8k */ |
| 725 | if (multigam_mmc1_chr_bank_base == 0) | |
| 726 | set_videoram_bank(space->machine, 0, (vrom4k) ? 4 : 8, (mmc1_shiftreg & 0x1f), 4); | |
| 757 | if (state->mmc1_chr_bank_base == 0) | |
| 758 | set_videoram_bank(space->machine, 0, (state->vrom4k) ? 4 : 8, (state->mmc1_shiftreg & 0x1f), 4); | |
| 727 | 759 | else |
| 728 | set_videorom_bank(space->machine, 0, (vrom4k) ? 4 : 8, | |
| 760 | set_videorom_bank(space->machine, 0, (state->vrom4k) ? 4 : 8, s | |
| 729 | 761 | break; |
| 730 | 762 | |
| 731 | 763 | case 2: /* video rom banking - bank 1 - 4k only */ |
| 732 | if (vrom4k) | |
| 764 | if (state->vrom4k) | |
| 733 | 765 | { |
| 734 | if (multigam_mmc1_chr_bank_base == 0) | |
| 735 | set_videoram_bank(space->machine, 0, (vrom4k) ? 4 : 8, (mmc1_shiftreg & 0x1f), 4); | |
| 766 | if (state->mmc1_chr_bank_base == 0) | |
| 767 | set_videoram_bank(space->machine, 0, (state->vrom4k) ? 4 : 8, (state->mmc1_shiftreg & 0x1f), 4); | |
| 736 | 768 | else |
| 737 | set_videorom_bank(space->machine, 4, 4, | |
| 769 | set_videorom_bank(space->machine, 4, 4, s | |
| 738 | 770 | } |
| 739 | 771 | break; |
| 740 | 772 | |
| 741 | 773 | case 3: /* program banking */ |
| 742 | 774 | { |
| 743 | int bank = (mmc1_shiftreg & mmc1_rom_mask) * 0x4000; | |
| 775 | int bank = (state->mmc1_shiftreg & state->mmc1_rom_mask) * 0x4000; | |
| 744 | 776 | UINT8 *prg = space->machine->region("maincpu")->base(); |
| 745 | 777 | |
| 746 | if (!size16k) | |
| 778 | if (!state->size16k) | |
| 747 | 779 | { |
| 748 | bank = ((mmc1_shiftreg >> 1) & mmc1_rom_mask) * 0x4000; | |
| 780 | bank = ((state->mmc1_shiftreg >> 1) & state->mmc1_rom_mask) * 0x4000; | |
| 749 | 781 | /* switch 32k */ |
| 750 | memcpy(&prg[0x08000], | |
| 782 | memcpy(&prg[0x08000], s | |
| 751 | 783 | } |
| 752 | 784 | else |
| 753 | 785 | { |
| 754 | 786 | /* switch 16k */ |
| 755 | if (switchlow) | |
| 787 | if (state->switchlow) | |
| 756 | 788 | { |
| 757 | 789 | /* low */ |
| 758 | memcpy(&prg[0x08000], multigam_mmc1_prg_base + bank, 0x4000); | |
| 759 | memcpy(&prg[0x0c000], multigam_mmc1_prg_base + (0x0f & mmc1_rom_mask) * 0x4000, 0x4000); | |
| 790 | memcpy(&prg[0x08000], state->mmc1_prg_base + bank, 0x4000); | |
| 791 | memcpy(&prg[0x0c000], state->mmc1_prg_base + (0x0f & state->mmc1_rom_mask) * 0x4000, 0x4000); | |
| 760 | 792 | } |
| 761 | 793 | else |
| 762 | 794 | { |
| 763 | 795 | /* high */ |
| 764 | memcpy(&prg[0x08000], multigam_mmc1_prg_base + (0x00 & mmc1_rom_mask) * 0x4000, 0x4000); | |
| 765 | memcpy(&prg[0x0c000], multigam_mmc1_prg_base + bank, 0x4000); | |
| 796 | memcpy(&prg[0x08000], state->mmc1_prg_base + (0x00 & state->mmc1_rom_mask) * 0x4000, 0x4000); | |
| 797 | memcpy(&prg[0x0c000], state->mmc1_prg_base + bank, 0x4000); | |
| 766 | 798 | } |
| 767 | 799 | } |
| 768 | 800 | } |
| r10613 | r10614 | |
| 773 | 805 | |
| 774 | 806 | static void multigam_init_mmc1(running_machine *machine, UINT8 *prg_base, int prg_size, int chr_bank_base) |
| 775 | 807 | { |
| 808 | multigam_state *state = machine->driver_data<multigam_state>(); | |
| 776 | 809 | UINT8* dst = machine->region("maincpu")->base(); |
| 777 | 810 | |
| 778 | 811 | memcpy(&dst[0x8000], prg_base + (prg_size - 0x8000), 0x8000); |
| 779 | 812 | |
| 780 | 813 | memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, mmc1_rom_switch_w ); |
| 781 | 814 | |
| 782 | multigam_mmc1_reg_write_enable = 1; | |
| 783 | mmc1_rom_mask = (prg_size / 0x4000) - 1; | |
| 784 | multigam_mmc1_prg_base = prg_base; | |
| 785 | multigam_mmc1_prg_size = prg_size; | |
| 786 | multigam_mmc1_chr_bank_base = chr_bank_base; | |
| 815 | state->mmc1_reg_write_enable = 1; | |
| 816 | state->mmc1_rom_mask = (prg_size / 0x4000) - 1; | |
| 817 | state->mmc1_prg_base = prg_base; | |
| 818 | state->mmc1_prg_size = prg_size; | |
| 819 | state->mmc1_chr_bank_base = chr_bank_base; | |
| 787 | 820 | |
| 788 | 821 | ppu2c0x_set_scanline_callback(machine->device("ppu"), 0); |
| 789 | 822 | |
| r10613 | r10614 | |
| 811 | 844 | xxxx CHR rom bank, each bank has 0x8000 bytes (32KB) |
| 812 | 845 | */ |
| 813 | 846 | |
| 814 | static UINT8 supergm3_prg_bank; | |
| 815 | static UINT8 supergm3_chr_bank; | |
| 816 | 847 | |
| 817 | 848 | static void supergm3_set_bank(running_machine *machine) |
| 818 | 849 | { |
| 850 | multigam_state *state = machine->driver_data<multigam_state>(); | |
| 819 | 851 | device_t *ppu = machine->device("ppu"); |
| 820 | 852 | UINT8* mem = machine->region("maincpu")->base(); |
| 821 | 853 | |
| 822 | 854 | // video bank |
| 823 | if (supergm3_chr_bank == 0x10 || | |
| 824 | supergm3_chr_bank == 0x40 ) | |
| 855 | if (state->supergm3_chr_bank == 0x10 || | |
| 856 | state->supergm3_chr_bank == 0x40 ) | |
| 825 | 857 | { |
| 826 | 858 | // VRAM |
| 827 | 859 | memory_install_read_bank(cpu_get_address_space(ppu, ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank1"); |
| 828 | 860 | memory_install_write_bank(cpu_get_address_space(ppu, ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank1"); |
| 829 | memory_set_bankptr(machine, "bank1", vram); | |
| 861 | memory_set_bankptr(machine, "bank1", state->vram); | |
| 830 | 862 | |
| 831 | if (supergm3_chr_bank == 0x40) | |
| 832 | set_mirroring(PPU_MIRROR_VERT); | |
| 863 | if (state->supergm3_chr_bank == 0x40) | |
| 864 | set_mirroring(state, PPU_MIRROR_VERT); | |
| 833 | 865 | } |
| 834 | 866 | else |
| 835 | 867 | { |
| r10613 | r10614 | |
| 847 | 879 | } |
| 848 | 880 | |
| 849 | 881 | // prg bank |
| 850 | if ((supergm3_prg_bank & 0x80) == 0) | |
| 882 | if ((state->supergm3_prg_bank & 0x80) == 0) | |
| 851 | 883 | { |
| 852 | 884 | // title screen |
| 853 | 885 | memcpy(mem + 0x8000, mem + 0x18000, 0x8000); |
| 854 | 886 | memory_set_bankptr(machine, "bank10", mem + 0x6000); |
| 855 | 887 | ppu2c0x_set_scanline_callback(ppu, 0); |
| 856 | 888 | } |
| 857 | else if ((supergm3_prg_bank & 0x40) == 0) | |
| 889 | else if ((state->supergm3_prg_bank & 0x40) == 0) | |
| 858 | 890 | { |
| 859 | 891 | // mapper 02 |
| 860 | 892 | multigam_init_mapper02(machine, |
| 861 | machine->region("user1")->base() + (supergm3_prg_bank & 0x1f)*0x20000, | |
| 893 | machine->region("user1")->base() + (state->supergm3_prg_bank & 0x1f)*0x20000, | |
| 862 | 894 | 0x20000); |
| 863 | 895 | } |
| 864 | else if (supergm3_chr_bank & 0x10) | |
| 896 | else if (state->supergm3_chr_bank & 0x10) | |
| 865 | 897 | { |
| 866 | 898 | // MMC3 |
| 867 | 899 | multigam_init_mmc3(machine, |
| 868 | machine->region("user1")->base() + (supergm3_prg_bank & 0x1f)*0x20000, | |
| 869 | (supergm3_prg_bank & 0x20) ? 0x20000 : 0x40000, | |
| 870 | (supergm3_chr_bank & 0x0f)*0x80); | |
| 900 | machine->region("user1")->base() + (state->supergm3_prg_bank & 0x1f)*0x20000, | |
| 901 | (state->supergm3_prg_bank & 0x20) ? 0x20000 : 0x40000, | |
| 902 | (state->supergm3_chr_bank & 0x0f)*0x80); | |
| 871 | 903 | } |
| 872 | 904 | else |
| 873 | 905 | { |
| 874 | 906 | //MMC1 |
| 875 | 907 | multigam_init_mmc1(machine, |
| 876 | machine->region("user1")->base() + (supergm3_prg_bank & 0x1f)*0x20000, | |
| 908 | machine->region("user1")->base() + (state->supergm3_prg_bank & 0x1f)*0x20000, | |
| 877 | 909 | 0x20000, |
| 878 | (supergm3_chr_bank & 0x0f)*0x80/4 ); | |
| 910 | (state->supergm3_chr_bank & 0x0f)*0x80/4 ); | |
| 879 | 911 | } |
| 880 | 912 | } |
| 881 | 913 | |
| 882 | 914 | static WRITE8_HANDLER(supergm3_prg_bank_w) |
| 883 | 915 | { |
| 884 | supergm3_prg_bank = data; | |
| 916 | multigam_state *state = space->machine->driver_data<multigam_state>(); | |
| 917 | state->supergm3_prg_bank = data; | |
| 885 | 918 | } |
| 886 | 919 | |
| 887 | 920 | static WRITE8_HANDLER(supergm3_chr_bank_w) |
| 888 | 921 | { |
| 889 | supergm3_chr_bank = data; | |
| 922 | multigam_state *state = space->machine->driver_data<multigam_state>(); | |
| 923 | state->supergm3_chr_bank = data; | |
| 890 | 924 | supergm3_set_bank(space->machine); |
| 891 | 925 | } |
| 892 | 926 | |
| r10613 | r10614 | |
| 1086 | 1120 | |
| 1087 | 1121 | static MACHINE_START( multigam ) |
| 1088 | 1122 | { |
| 1089 | nt_ram = auto_alloc_array(machine, UINT8, 0x1000); | |
| 1090 | nt_page[0] = nt_ram; | |
| 1091 | nt_page[1] = nt_ram + 0x400; | |
| 1092 | nt_page[2] = nt_ram + 0x800; | |
| 1093 | nt_page[3] = nt_ram + 0xc00; | |
| 1123 | multigam_state *state = machine->driver_data<multigam_state>(); | |
| 1124 | state->nt_ram = auto_alloc_array(machine, UINT8, 0x1000); | |
| 1125 | state->nt_page[0] = state->nt_ram; | |
| 1126 | state->nt_page[1] = state->nt_ram + 0x400; | |
| 1127 | state->nt_page[2] = state->nt_ram + 0x800; | |
| 1128 | state->nt_page[3] = state->nt_ram + 0xc00; | |
| 1094 | 1129 | |
| 1095 | 1130 | memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, multigam_nt_r, multigam_nt_w); |
| 1096 | 1131 | memory_install_read_bank(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x0000, 0x1fff, 0, 0, "bank1"); |
| r10613 | r10614 | |
| 1099 | 1134 | |
| 1100 | 1135 | static MACHINE_START( multigm3 ) |
| 1101 | 1136 | { |
| 1102 | nt_ram = auto_alloc_array(machine, UINT8, 0x1000); | |
| 1103 | nt_page[0] = nt_ram; | |
| 1104 | nt_page[1] = nt_ram + 0x400; | |
| 1105 | nt_page[2] = nt_ram + 0x800; | |
| 1106 | nt_page[3] = nt_ram + 0xc00; | |
| 1137 | multigam_state *state = machine->driver_data<multigam_state>(); | |
| 1138 | state->nt_ram = auto_alloc_array(machine, UINT8, 0x1000); | |
| 1139 | state->nt_page[0] = state->nt_ram; | |
| 1140 | state->nt_page[1] = state->nt_ram + 0x400; | |
| 1141 | state->nt_page[2] = state->nt_ram + 0x800; | |
| 1142 | state->nt_page[3] = state->nt_ram + 0xc00; | |
| 1107 | 1143 | |
| 1108 | 1144 | memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, multigam_nt_r, multigam_nt_w); |
| 1109 | 1145 | |
| r10613 | r10614 | |
| 1121 | 1157 | |
| 1122 | 1158 | static MACHINE_START( supergm3 ) |
| 1123 | 1159 | { |
| 1124 | nt_ram = auto_alloc_array(machine, UINT8, 0x1000); | |
| 1125 | nt_page[0] = nt_ram; | |
| 1126 | nt_page[1] = nt_ram + 0x400; | |
| 1127 | nt_page[2] = nt_ram + 0x800; | |
| 1128 | nt_page[3] = nt_ram + 0xc00; | |
| 1160 | multigam_state *state = machine->driver_data<multigam_state>(); | |
| 1161 | state->nt_ram = auto_alloc_array(machine, UINT8, 0x1000); | |
| 1162 | state->nt_page[0] = state->nt_ram; | |
| 1163 | state->nt_page[1] = state->nt_ram + 0x400; | |
| 1164 | state->nt_page[2] = state->nt_ram + 0x800; | |
| 1165 | state->nt_page[3] = state->nt_ram + 0xc00; | |
| 1129 | 1166 | |
| 1130 | 1167 | memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, multigam_nt_r, multigam_nt_w); |
| 1131 | 1168 | |
| 1132 | vram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 1133 | multigmc_mmc3_6000_ram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 1169 | state->vram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 1170 | state->multigmc_mmc3_6000_ram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 1134 | 1171 | } |
| 1135 | 1172 | |
| 1136 | static MACHINE_CONFIG_START( multigam, | |
| 1173 | static MACHINE_CONFIG_START( multigam, multigam_stat | |
| 1137 | 1174 | /* basic machine hardware */ |
| 1138 | 1175 | MCFG_CPU_ADD("maincpu", N2A03, N2A03_DEFAULTCLOCK) |
| 1139 | 1176 | MCFG_CPU_PROGRAM_MAP(multigam_map) |
| r10613 | r10614 | |
| 1321 | 1358 | |
| 1322 | 1359 | static DRIVER_INIT(multigm3) |
| 1323 | 1360 | { |
| 1361 | multigam_state *state = machine->driver_data<multigam_state>(); | |
| 1324 | 1362 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 1325 | 1363 | |
| 1326 | 1364 | const UINT8 decode[16] = { 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a }; |
| r10613 | r10614 | |
| 1328 | 1366 | multigm3_decrypt(machine->region("maincpu")->base(), machine->region("maincpu")->bytes(), decode ); |
| 1329 | 1367 | multigm3_decrypt(machine->region("user1")->base(), machine->region("user1")->bytes(), decode ); |
| 1330 | 1368 | |
| 1331 | multigmc_mmc3_6000_ram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 1369 | state->multigmc_mmc3_6000_ram = auto_alloc_array(machine, UINT8, 0x2000); | |
| 1332 | 1370 | |
| 1333 | 1371 | multigam_switch_prg_rom(space, 0x0, 0x01); |
| 1334 | 1372 | } |
| r10613 | r10614 | |
|---|---|---|
| 584 | 584 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 585 | 585 | MCFG_SCREEN_RAW_PARAMS(XTAL_12MHz / 2, 400, 0, 256, 291, 0, 208) |
| 586 | 586 | MCFG_SCREEN_UPDATE(vcombat) |
| 587 | ||
| 587 | ||
| 588 | 588 | MCFG_SCREEN_ADD("aux", RASTER) |
| 589 | 589 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 590 | 590 | MCFG_SCREEN_RAW_PARAMS(XTAL_12MHz / 2, 400, 0, 256, 291, 0, 208) |
| r10613 | r10614 | |
|---|---|---|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | |
| 159 | printf("%02x %02x %02x %02x|%02x %02x %02x %02x|%02x %02x %02x %02x|%02x %02x %02x %02x\n" | |
| 160 | ,blit_ram[0],blit_ram[1],blit_ram[2],blit_ram[3] | |
| 161 | ,blit_ram[4],blit_ram[5],blit_ram[6],blit_ram[7] | |
| 162 | ,blit_ram[8],blit_ram[9],blit_ram[0xa],blit_ram[0xb] | |
| 163 | ,blit_ram[0xc],blit_ram[0xd],blit_ram[0xe],blit_ram[0xf]); | |
| 159 | // printf("%02x %02x %02x %02x|%02x %02x %02x %02x|%02x %02x %02x %02x|%02x %02x %02x %02x\n" | |
| 160 | // ,blit_ram[0],blit_ram[1],blit_ram[2],blit_ram[3] | |
| 161 | // ,blit_ram[4],blit_ram[5],blit_ram[6],blit_ram[7] | |
| 162 | // ,blit_ram[8],blit_ram[9],blit_ram[0xa],blit_ram[0xb] | |
| 163 | // ,blit_ram[0xc],blit_ram[0xd],blit_ram[0xe],blit_ram[0xf]); | |
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 |
| r10613 | r10614 | |
|---|---|---|
| 74 | 74 | #include "sound/ay8910.h" |
| 75 | 75 | #include "machine/tait8741.h" |
| 76 | 76 | |
| 77 | static UINT8 *cyclemb_vram,*cyclemb_cram; | |
| 78 | static UINT8 *cyclemb_obj1_ram,*cyclemb_obj2_ram,*cyclemb_obj3_ram; | |
| 79 | 77 | |
| 78 | class cyclemb_state : public driver_device | |
| 79 | { | |
| 80 | public: | |
| 81 | cyclemb_state(running_machine &machine, const driver_device_config_base &config) | |
| 82 | : driver_device(machine, config) { } | |
| 83 | ||
| 84 | UINT8 *vram; | |
| 85 | UINT8 *cram; | |
| 86 | UINT8 *obj1_ram; | |
| 87 | UINT8 *obj2_ram; | |
| 88 | UINT8 *obj3_ram; | |
| 89 | }; | |
| 90 | ||
| 91 | ||
| 92 | ||
| 80 | 93 | static PALETTE_INIT( cyclemb ) |
| 81 | 94 | { |
| 82 | 95 | int i,r,g,b,val; |
| r10613 | r10614 | |
| 110 | 123 | |
| 111 | 124 | static SCREEN_UPDATE( cyclemb ) |
| 112 | 125 | { |
| 126 | cyclemb_state *state = screen->machine->driver_data<cyclemb_state>(); | |
| 113 | 127 | int x,y,count; |
| 114 | 128 | const gfx_element *gfx = screen->machine->gfx[0]; |
| 115 | 129 | UINT8 flip_screen = flip_screen_get(screen->machine); |
| r10613 | r10614 | |
| 120 | 134 | { |
| 121 | 135 | for (x=0;x<64;x++) |
| 122 | 136 | { |
| 123 | int attr = cyclemb_cram[count]; | |
| 124 | int tile = (cyclemb_vram[count]) | ((attr & 3)<<8); | |
| 137 | int attr = state->cram[count]; | |
| 138 | int tile = (state->vram[count]) | ((attr & 3)<<8); | |
| 125 | 139 | int color = ((attr & 0xf8) >> 3) ^ 0x1f; |
| 126 | 140 | int odd_line = y & 1 ? 0x40 : 0x00; |
| 127 | 141 | // int sx_offs = flip_screen ? 512 : 0 |
| 128 | int scrollx = (( | |
| 142 | int scrollx = ((state-> | |
| 129 | 143 | |
| 130 | 144 | if(flip_screen) |
| 131 | 145 | { |
| r10613 | r10614 | |
| 170 | 184 | |
| 171 | 185 | for(i=0;i<0x40;i+=2) |
| 172 | 186 | { |
| 173 | y = 0xf1 - cyclemb_obj2_ram[i]; | |
| 174 | x = cyclemb_obj2_ram[i+1] - 56; | |
| 175 | spr_offs = (cyclemb_obj1_ram[i+0]); | |
| 176 | col = (cyclemb_obj1_ram[i+1] & 0x3f); | |
| 177 | region = ((cyclemb_obj3_ram[i] & 0x10) >> 4) + 1; | |
| 187 | y = 0xf1 - state->obj2_ram[i]; | |
| 188 | x = state->obj2_ram[i+1] - 56; | |
| 189 | spr_offs = (state->obj1_ram[i+0]); | |
| 190 | col = (state->obj1_ram[i+1] & 0x3f); | |
| 191 | region = ((state->obj3_ram[i] & 0x10) >> 4) + 1; | |
| 178 | 192 | if(region == 2) |
| 179 | 193 | { |
| 180 | 194 | spr_offs >>= 2; |
| 181 | spr_offs += (( | |
| 195 | spr_offs += ((state-> | |
| 182 | 196 | y-=16; |
| 183 | 197 | } |
| 184 | 198 | |
| 185 | if( | |
| 199 | if(state-> | |
| 186 | 200 | x+=256; |
| 187 | //if( | |
| 201 | //if(state-> | |
| 188 | 202 | // x-=256; |
| 189 | fx = (cyclemb_obj3_ram[i+0] & 4) >> 2; | |
| 190 | fy = (cyclemb_obj3_ram[i+0] & 8) >> 3; | |
| 203 | fx = (state->obj3_ram[i+0] & 4) >> 2; | |
| 204 | fy = (state->obj3_ram[i+0] & 8) >> 3; | |
| 191 | 205 | |
| 192 | 206 | if(flip_screen) |
| 193 | 207 | { |
| r10613 | r10614 | |
| 238 | 252 | static ADDRESS_MAP_START( cyclemb_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 239 | 253 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 240 | 254 | AM_RANGE(0x8000, 0x8fff) AM_ROMBANK("bank1") |
| 241 | AM_RANGE(0x9000, 0x97ff) AM_RAM AM_BASE(&cyclemb_vram) | |
| 242 | AM_RANGE(0x9800, 0x9fff) AM_RAM AM_BASE(&cyclemb_cram) | |
| 243 | AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_BASE(&cyclemb_obj1_ram) //ORAM1 (only a000-a3ff tested) | |
| 244 | AM_RANGE(0xa800, 0xafff) AM_RAM AM_BASE(&cyclemb_obj2_ram) //ORAM2 (only a800-abff tested) | |
| 245 | AM_RANGE(0xb000, 0xb7ff) AM_RAM AM_BASE(&cyclemb_obj3_ram) //ORAM3 (only b000-b3ff tested) | |
| 255 | AM_RANGE(0x9000, 0x97ff) AM_RAM AM_BASE_MEMBER(cyclemb_state, vram) | |
| 256 | AM_RANGE(0x9800, 0x9fff) AM_RAM AM_BASE_MEMBER(cyclemb_state, cram) | |
| 257 | AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_BASE_MEMBER(cyclemb_state, obj1_ram) //ORAM1 (only a000-a3ff tested) | |
| 258 | AM_RANGE(0xa800, 0xafff) AM_RAM AM_BASE_MEMBER(cyclemb_state, obj2_ram) //ORAM2 (only a800-abff tested) | |
| 259 | AM_RANGE(0xb000, 0xb7ff) AM_RAM AM_BASE_MEMBER(cyclemb_state, obj3_ram) //ORAM3 (only b000-b3ff tested) | |
| 246 | 260 | AM_RANGE(0xb800, 0xbfff) AM_RAM //WRAM |
| 247 | 261 | ADDRESS_MAP_END |
| 248 | 262 | |
| r10613 | r10614 | |
| 512 | 526 | GFXDECODE_ENTRY( "sprite_data_2", 0, spritelayout_32x32, 0x00, 0x40 ) |
| 513 | 527 | GFXDECODE_END |
| 514 | 528 | |
| 515 | static MACHINE_CONFIG_START( cyclemb, | |
| 529 | static MACHINE_CONFIG_START( cyclemb, cyclemb_stat | |
| 516 | 530 | /* basic machine hardware */ |
| 517 | 531 | MCFG_CPU_ADD("maincpu",Z80,18000000/4) |
| 518 | 532 | MCFG_CPU_PROGRAM_MAP(cyclemb_map) |
| r10613 | r10614 | |
|---|---|---|
| 46 | 46 | AM_RANGE(0xa001, 0xa001) AM_WRITENOP // ? Interrupt related |
| 47 | 47 | AM_RANGE(0xa004, 0xa004) AM_WRITE(clshroad_flipscreen_w) |
| 48 | 48 | AM_RANGE(0xa100, 0xa107) AM_READ(clshroad_input_r) |
| 49 | AM_RANGE(0xa800, 0xafff) AM_RAM_WRITE(clshroad_vram_1_w) AM_BASE(&clshroad_vram_1) // Layer 1 | |
| 50 | AM_RANGE(0xb000, 0xb003) AM_WRITEONLY AM_BASE(&clshroad_vregs) // Scroll | |
| 51 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(clshroad_vram_0_w) AM_BASE(&clshroad_vram_0) // Layer 0 | |
| 49 | AM_RANGE(0xa800, 0xafff) AM_RAM_WRITE(clshroad_vram_1_w) AM_BASE_MEMBER(clshroad_state, vram_1) // Layer 1 | |
| 50 | AM_RANGE(0xb000, 0xb003) AM_WRITEONLY AM_BASE_MEMBER(clshroad_state, vregs) // Scroll | |
| 51 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(clshroad_vram_0_w) AM_BASE_MEMBER(clshroad_state, vram_0) // Layer 0 | |
| 52 | 52 | ADDRESS_MAP_END |
| 53 | 53 | |
| 54 | 54 | static ADDRESS_MAP_START( clshroad_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r10613 | r10614 | |
| 226 | 226 | |
| 227 | 227 | |
| 228 | 228 | |
| 229 | static MACHINE_CONFIG_START( firebatl, | |
| 229 | static MACHINE_CONFIG_START( firebatl, clshroa | |
| 230 | 230 | |
| 231 | 231 | /* basic machine hardware */ |
| 232 | 232 | MCFG_CPU_ADD("maincpu", Z80, 3000000) /* ? */ |
| r10613 | r10614 | |
| 261 | 261 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 262 | 262 | MACHINE_CONFIG_END |
| 263 | 263 | |
| 264 | static MACHINE_CONFIG_START( clshroad, | |
| 264 | static MACHINE_CONFIG_START( clshroad, clshroa | |
| 265 | 265 | |
| 266 | 266 | /* basic machine hardware */ |
| 267 | 267 | MCFG_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/4) /* ? real speed unknown. 3MHz is too low and causes problems */ |
| r10613 | r10614 | |
|---|---|---|
| 42 | 42 | treat it as 1 8bpp layer and ignore the 2nd set of registers. |
| 43 | 43 | - some unknown reads / writes |
| 44 | 44 | |
| 45 | 18.02.2011. Tomasz Slanina | |
| 45 | 18.02.2011. Tomasz Slanina | |
| 46 | 46 | -------------------------- |
| 47 | 47 | Few notes about the 2xYM2203 games: |
| 48 | 48 | |
| 49 | Interrupts are generated by both YM chips. Sound CPU checks interrupt source | |
| 50 | (tests timer flag in 1st YM) and restarts appropriate timer | |
| 49 | Interrupts are generated by both YM chips. Sound CPU checks interrupt source | |
| 50 | (tests timer flag in 1st YM) and restarts appropriate timer | |
| 51 | 51 | (and clears int line) then process sfx or music data. |
| 52 | 52 | |
| 53 | Due to bad timing/incorrect int line handling - interrupt is skipped if | |
| 54 | fires when another one is being processed and int line is still asserted | |
| 55 | (and not cleared). This situation results in missing or incomplete audio, | |
| 53 | Due to bad timing/incorrect int line handling - interrupt is skipped if | |
| 54 | fires when another one is being processed and int line is still asserted | |
| 55 | (and not cleared). This situation results in missing or incomplete audio, | |
| 56 | 56 | becasue one of interrupt sources is _dead_ (timer never restarts). |
| 57 | 57 | |
| 58 | 58 | Music tempo and audio pitch depends on (unknown) YM clocks. |
| r10613 | r10614 | |
| 64 | 64 | until we find real PCB and verify clocks and trace int lines. |
| 65 | 65 | |
| 66 | 66 | Pollux: |
| 67 | Many (all? at least pollux, primella and flying tiger) use some kind of | |
| 67 | Many (all? at least pollux, primella and flying tiger) use some kind of | |
| 68 | 68 | banked palette ram. Bit 1 at address 0xf008 controls banking (both palettes |
| 69 | 69 | are almost identical, except for much darker BG layer colors). |
| 70 | 70 | There's also significant gfx problem on title screen - gfx over left pilot's |
| 71 | 71 | shoulder (right part of the screen) should be - according to pics from flyer - |
| 72 | 72 | blue with orange/red flame (palette 2 instead palette 1). Also some explosions |
| 73 | and stars should be red instead blue (also pal 2 instead pal 1). I have no | |
| 74 | idea how to fix it without breaking other parts of game. Title screen should | |
| 73 | and stars should be red instead blue (also pal 2 instead pal 1). I have no | |
| 74 | idea how to fix it without breaking other parts of game. Title screen should | |
| 75 | 75 | be verified on real PCB. |
| 76 | 76 | |
| 77 | 77 | ***************************************************************************/ |
| r10613 | r10614 | |
|---|---|---|
| 60 | 60 | #include "sound/nes_apu.h" |
| 61 | 61 | #include "video/ppu2c0x.h" |
| 62 | 62 | |
| 63 | static UINT8* nt_ram; | |
| 64 | static UINT8* nt_page[4]; | |
| 65 | 63 | |
| 66 | ||
| 64 | ||
| 67 | 65 | { |
| 66 | public: | |
| 67 | cham24_state(running_machine &machine, const driver_device_config_base &config) | |
| 68 | : driver_device(machine, config) { } | |
| 69 | ||
| 70 | UINT8* nt_ram; | |
| 71 | UINT8* nt_page[4]; | |
| 72 | UINT32 in_0; | |
| 73 | UINT32 in_1; | |
| 74 | UINT32 in_0_shift; | |
| 75 | UINT32 in_1_shift; | |
| 76 | }; | |
| 77 | ||
| 78 | ||
| 79 | ||
| 80 | static void cham24_set_mirroring( running_machine *machine, int mirroring ) | |
| 81 | { | |
| 82 | cham24_state *state = machine->driver_data<cham24_state>(); | |
| 68 | 83 | switch(mirroring) |
| 69 | 84 | { |
| 70 | 85 | case PPU_MIRROR_LOW: |
| 71 | nt_page[0] = nt_page[1] = nt_page[2] = nt_page[3] = nt_ram; | |
| 86 | state->nt_page[0] = state->nt_page[1] = state->nt_page[2] = state->nt_page[3] = state->nt_ram; | |
| 72 | 87 | break; |
| 73 | 88 | case PPU_MIRROR_HIGH: |
| 74 | nt_page[0] = nt_page[1] = nt_page[2] = nt_page[3] = nt_ram + 0x400; | |
| 89 | state->nt_page[0] = state->nt_page[1] = state->nt_page[2] = state->nt_page[3] = state->nt_ram + 0x400; | |
| 75 | 90 | break; |
| 76 | 91 | case PPU_MIRROR_HORZ: |
| 77 | nt_page[0] = nt_ram; | |
| 78 | nt_page[1] = nt_ram; | |
| 79 | nt_page[2] = nt_ram + 0x400; | |
| 80 | nt_page[3] = nt_ram + 0x400; | |
| 92 | state->nt_page[0] = state->nt_ram; | |
| 93 | state->nt_page[1] = state->nt_ram; | |
| 94 | state->nt_page[2] = state->nt_ram + 0x400; | |
| 95 | state->nt_page[3] = state->nt_ram + 0x400; | |
| 81 | 96 | break; |
| 82 | 97 | case PPU_MIRROR_VERT: |
| 83 | nt_page[0] = nt_ram; | |
| 84 | nt_page[1] = nt_ram + 0x400; | |
| 85 | nt_page[2] = nt_ram; | |
| 86 | nt_page[3] = nt_ram + 0x400; | |
| 98 | state->nt_page[0] = state->nt_ram; | |
| 99 | state->nt_page[1] = state->nt_ram + 0x400; | |
| 100 | state->nt_page[2] = state->nt_ram; | |
| 101 | state->nt_page[3] = state->nt_ram + 0x400; | |
| 87 | 102 | break; |
| 88 | 103 | case PPU_MIRROR_NONE: |
| 89 | 104 | default: |
| 90 | nt_page[0] = nt_ram; | |
| 91 | nt_page[1] = nt_ram + 0x400; | |
| 92 | nt_page[2] = nt_ram + 0x800; | |
| 93 | nt_page[3] = nt_ram + 0xc00; | |
| 105 | state->nt_page[0] = state->nt_ram; | |
| 106 | state->nt_page[1] = state->nt_ram + 0x400; | |
| 107 | state->nt_page[2] = state->nt_ram + 0x800; | |
| 108 | state->nt_page[3] = state->nt_ram + 0xc00; | |
| 94 | 109 | break; |
| 95 | 110 | } |
| 96 | 111 | } |
| 97 | 112 | |
| 98 | 113 | static WRITE8_HANDLER( nt_w ) |
| 99 | 114 | { |
| 115 | cham24_state *state = space->machine->driver_data<cham24_state>(); | |
| 100 | 116 | int page = ((offset & 0xc00) >> 10); |
| 101 | nt_page[page][offset & 0x3ff] = data; | |
| 117 | state->nt_page[page][offset & 0x3ff] = data; | |
| 102 | 118 | } |
| 103 | 119 | |
| 104 | 120 | static READ8_HANDLER( nt_r ) |
| 105 | 121 | { |
| 122 | cham24_state *state = space->machine->driver_data<cham24_state>(); | |
| 106 | 123 | int page = ((offset & 0xc00) >> 10); |
| 107 | return nt_page[page][offset & 0x3ff]; | |
| 124 | return state->nt_page[page][offset & 0x3ff]; | |
| 108 | 125 | |
| 109 | 126 | } |
| 110 | 127 | |
| r10613 | r10614 | |
| 129 | 146 | nes_psg_w(device,0x17, data); |
| 130 | 147 | } |
| 131 | 148 | |
| 132 | static UINT32 in_0; | |
| 133 | static UINT32 in_1; | |
| 134 | static UINT32 in_0_shift; | |
| 135 | static UINT32 in_1_shift; | |
| 136 | 149 | |
| 137 | 150 | static READ8_HANDLER( cham24_IN0_r ) |
| 138 | 151 | { |
| 139 | return ((in_0 >> in_0_shift++) & 0x01) | 0x40; | |
| 152 | cham24_state *state = space->machine->driver_data<cham24_state>(); | |
| 153 | return ((state->in_0 >> state->in_0_shift++) & 0x01) | 0x40; | |
| 140 | 154 | } |
| 141 | 155 | |
| 142 | 156 | static WRITE8_HANDLER( cham24_IN0_w ) |
| 143 | 157 | { |
| 158 | cham24_state *state = space->machine->driver_data<cham24_state>(); | |
| 144 | 159 | if (data & 0xfe) |
| 145 | 160 | { |
| 146 | 161 | //logerror("Unhandled cham24_IN0_w write: data = %02X\n", data); |
| r10613 | r10614 | |
| 151 | 166 | return; |
| 152 | 167 | } |
| 153 | 168 | |
| 154 | in_0_shift = 0; | |
| 155 | in_1_shift = 0; | |
| 169 | state->in_0_shift = 0; | |
| 170 | state->in_1_shift = 0; | |
| 156 | 171 | |
| 157 | in_0 = input_port_read(space->machine, "P1"); | |
| 158 | in_1 = input_port_read(space->machine, "P2"); | |
| 172 | state->in_0 = input_port_read(space->machine, "P1"); | |
| 173 | state->in_1 = input_port_read(space->machine, "P2"); | |
| 159 | 174 | |
| 160 | 175 | } |
| 161 | 176 | |
| 162 | 177 | static READ8_HANDLER( cham24_IN1_r ) |
| 163 | 178 | { |
| 164 | return ((in_1 >> in_1_shift++) & 0x01) | 0x40; | |
| 179 | cham24_state *state = space->machine->driver_data<cham24_state>(); | |
| 180 | return ((state->in_1 >> state->in_1_shift++) & 0x01) | 0x40; | |
| 165 | 181 | } |
| 166 | 182 | |
| 167 | 183 | static WRITE8_HANDLER( cham24_mapper_w ) |
| r10613 | r10614 | |
| 179 | 195 | memory_set_bankptr(space->machine, "bank1", space->machine->region("gfx1")->base() + (0x2000 * gfx_bank)); |
| 180 | 196 | |
| 181 | 197 | // set gfx mirroring |
| 182 | cham24_set_mirroring(gfx_mirroring != 0 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); | |
| 198 | cham24_set_mirroring(space->machine, gfx_mirroring != 0 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); | |
| 183 | 199 | |
| 184 | 200 | // switch PRG bank |
| 185 | 201 | if (prg_bank_page_size == 0) |
| r10613 | r10614 | |
| 279 | 295 | |
| 280 | 296 | static MACHINE_START( cham24 ) |
| 281 | 297 | { |
| 298 | cham24_state *state = machine->driver_data<cham24_state>(); | |
| 282 | 299 | /* switch PRG rom */ |
| 283 | 300 | UINT8* dst = machine->region("maincpu")->base(); |
| 284 | 301 | UINT8* src = machine->region("user1")->base(); |
| r10613 | r10614 | |
| 291 | 308 | memory_set_bankptr(machine, "bank1", machine->region("gfx1")->base()); |
| 292 | 309 | |
| 293 | 310 | /* need nametable ram, though. I doubt this uses more than 2k, but it starts up configured for 4 */ |
| 294 | nt_ram = auto_alloc_array(machine, UINT8, 0x1000); | |
| 295 | nt_page[0] = nt_ram; | |
| 296 | nt_page[1] = nt_ram + 0x400; | |
| 297 | nt_page[2] = nt_ram + 0x800; | |
| 298 | nt_page[3] = nt_ram + 0xc00; | |
| 311 | state->nt_ram = auto_alloc_array(machine, UINT8, 0x1000); | |
| 312 | state->nt_page[0] = state->nt_ram; | |
| 313 | state->nt_page[1] = state->nt_ram + 0x400; | |
| 314 | state->nt_page[2] = state->nt_ram + 0x800; | |
| 315 | state->nt_page[3] = state->nt_ram + 0xc00; | |
| 299 | 316 | |
| 300 | 317 | /* and read/write handlers */ |
| 301 | 318 | memory_install_readwrite8_handler(cpu_get_address_space(machine->device("ppu"), ADDRESS_SPACE_PROGRAM), 0x2000, 0x3eff, 0, 0, nt_r, nt_w); |
| r10613 | r10614 | |
| 309 | 326 | /* none, the ppu generates one */ |
| 310 | 327 | GFXDECODE_END |
| 311 | 328 | |
| 312 | static MACHINE_CONFIG_START( cham24, | |
| 329 | static MACHINE_CONFIG_START( cham24, | |
| 313 | 330 | /* basic machine hardware */ |
| 314 | 331 | MCFG_CPU_ADD("maincpu", N2A03, N2A03_DEFAULTCLOCK) |
| 315 | 332 | MCFG_CPU_PROGRAM_MAP(cham24_map) |
| r10613 | r10614 | |
|---|---|---|
| 1267 | 1267 | MCFG_SCREEN_SIZE(128*8, 64*8) |
| 1268 | 1268 | MCFG_SCREEN_VISIBLE_AREA(0*8, 512-1, 0*8, 288-1) |
| 1269 | 1269 | MCFG_SCREEN_UPDATE(sfbonus) |
| 1270 | ||
| 1270 | ||
| 1271 | 1271 | MCFG_PALETTE_LENGTH(0x100*2) // *2 for priority workaraound / custom drawing |
| 1272 | 1272 | |
| 1273 | 1273 | MCFG_VIDEO_START(sfbonus) |
| r10613 | r10614 | |
|---|---|---|
| 68 | 68 | #include "render.h" |
| 69 | 69 | #include "machine/laserdsc.h" |
| 70 | 70 | |
| 71 | ||
| 72 | class lgp_state : public driver_device | |
| 73 | { | |
| 74 | public: | |
| 75 | lgp_state(running_machine &machine, const driver_device_config_base &config) | |
| 76 | : driver_device(machine, config) { } | |
| 77 | ||
| 78 | device_t *laserdisc; | |
| 79 | UINT8 *tile_ram; | |
| 80 | UINT8 *tile_control_ram; | |
| 81 | emu_timer *irq_timer; | |
| 82 | }; | |
| 83 | ||
| 84 | ||
| 71 | 85 | /* From italiandoh's notes */ |
| 72 | 86 | #define CPU_PCB_CLOCK (8000000) |
| 73 | 87 | #define SOUND_PCB_CLOCK (6000000) |
| 74 | 88 | |
| 75 | /* Misc variables */ | |
| 76 | static device_t *laserdisc; | |
| 77 | 89 | |
| 78 | static UINT8 *tile_ram; | |
| 79 | static UINT8 *tile_control_ram; | |
| 80 | ||
| 81 | static emu_timer *irq_timer; | |
| 82 | ||
| 83 | ||
| 84 | 90 | /* VIDEO GOODS */ |
| 85 | 91 | static SCREEN_UPDATE( lgp ) |
| 86 | 92 | { |
| 93 | lgp_state *state = screen->machine->driver_data<lgp_state>(); | |
| 87 | 94 | int charx, chary; |
| 88 | 95 | |
| 89 | 96 | /* make color 0 transparent */ |
| r10613 | r10614 | |
| 102 | 109 | /* Somewhere there's a flag that offsets the tilemap by 0x100*x */ |
| 103 | 110 | /* Palette is likely set somewhere as well (tile_control_ram?) */ |
| 104 | 111 | drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], |
| 105 | tile_ram[current_screen_character], | |
| 112 | state->tile_ram[current_screen_character], | |
| 106 | 113 | 0, |
| 107 | 114 | 0, 0, charx*8, chary*8, 0); |
| 108 | 115 | } |
| r10613 | r10614 | |
| 116 | 123 | /* Main Z80 R/W */ |
| 117 | 124 | static READ8_HANDLER(ldp_read) |
| 118 | 125 | { |
| 119 | return laserdisc_data_r(laserdisc); | |
| 126 | lgp_state *state = space->machine->driver_data<lgp_state>(); | |
| 127 | return laserdisc_data_r(state->laserdisc); | |
| 120 | 128 | } |
| 121 | 129 | |
| 122 | 130 | static WRITE8_HANDLER(ldp_write) |
| 123 | 131 | { |
| 124 | laserdisc_data_w(laserdisc,data); | |
| 132 | lgp_state *state = space->machine->driver_data<lgp_state>(); | |
| 133 | laserdisc_data_w(state->laserdisc,data); | |
| 125 | 134 | } |
| 126 | 135 | |
| 127 | 136 | |
| r10613 | r10614 | |
| 131 | 140 | /* PROGRAM MAPS */ |
| 132 | 141 | static ADDRESS_MAP_START( main_program_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 133 | 142 | AM_RANGE(0x0000,0x7fff) AM_ROM |
| 134 | AM_RANGE(0xe000,0xe3ff) AM_RAM AM_BASE(&tile_ram) | |
| 135 | AM_RANGE(0xe400,0xe7ff) AM_RAM AM_BASE(&tile_control_ram) | |
| 143 | AM_RANGE(0xe000,0xe3ff) AM_RAM AM_BASE_MEMBER(lgp_state, tile_ram) | |
| 144 | AM_RANGE(0xe400,0xe7ff) AM_RAM AM_BASE_MEMBER(lgp_state, tile_control_ram) | |
| 136 | 145 | |
| 137 | 146 | // AM_RANGE(0xef00,0xef00) AM_READ_PORT("IN_TEST") |
| 138 | 147 | AM_RANGE(0xef80,0xef80) AM_READWRITE(ldp_read,ldp_write) |
| r10613 | r10614 | |
| 324 | 333 | |
| 325 | 334 | static INTERRUPT_GEN( vblank_callback_lgp ) |
| 326 | 335 | { |
| 336 | lgp_state *state = device->machine->driver_data<lgp_state>(); | |
| 327 | 337 | // NMI |
| 328 | 338 | //cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); |
| 329 | 339 | |
| 330 | 340 | // IRQ |
| 331 | 341 | cpu_set_input_line(device, 0, ASSERT_LINE); |
| 332 | irq_timer->adjust(attotime::from_usec(50)); | |
| 342 | state->irq_timer->adjust(attotime::from_usec(50)); | |
| 333 | 343 | } |
| 334 | 344 | |
| 335 | 345 | |
| 336 | 346 | static MACHINE_START( lgp ) |
| 337 | 347 | { |
| 338 | laserdisc = machine->device("laserdisc"); | |
| 339 | irq_timer = machine->scheduler().timer_alloc(FUNC(irq_stop)); | |
| 348 | lgp_state *state = machine->driver_data<lgp_state>(); | |
| 349 | state->laserdisc = machine->device("laserdisc"); | |
| 350 | state->irq_timer = machine->scheduler().timer_alloc(FUNC(irq_stop)); | |
| 340 | 351 | } |
| 341 | 352 | |
| 342 | 353 | |
| 343 | 354 | /* DRIVER */ |
| 344 | static MACHINE_CONFIG_START( lgp, | |
| 355 | static MACHINE_CONFIG_START( lgp, lgp | |
| 345 | 356 | /* main cpu */ |
| 346 | 357 | MCFG_CPU_ADD("maincpu", Z80, CPU_PCB_CLOCK) |
| 347 | 358 | MCFG_CPU_PROGRAM_MAP(main_program_map) |
| r10613 | r10614 | |
|---|---|---|
| 53 | 53 | #endif |
| 54 | 54 | |
| 55 | 55 | |
| 56 | ||
| 57 | static int musobana_inputport; | |
| 58 | static int musobana_outcoin_flag; | |
| 59 | ||
| 60 | ||
| 61 | 56 | static void niyanpai_soundbank_w(running_machine *machine, int data) |
| 62 | 57 | { |
| 63 | 58 | UINT8 *SNDROM = machine->region("audiocpu")->base(); |
| r10613 | r10614 | |
| 82 | 77 | |
| 83 | 78 | |
| 84 | 79 | /* TMPZ84C011 PIO emulation */ |
| 85 | static UINT8 pio_dir[5], pio_latch[5]; | |
| 86 | 80 | |
| 87 | 81 | static READ8_HANDLER( tmpz84c011_pio_r ) |
| 88 | 82 | { |
| r10613 | r10614 | |
| 141 | 135 | } |
| 142 | 136 | |
| 143 | 137 | /* CPU interface */ |
| 144 | static READ8_HANDLER( tmpz84c011_0_pa_r ) { return (tmpz84c011_pio_r(space,0) & ~pio_dir[0]) | (pio_latch[0] & pio_dir[0]); } | |
| 145 | static READ8_HANDLER( tmpz84c011_0_pb_r ) { return (tmpz84c011_pio_r(space,1) & ~pio_dir[1]) | (pio_latch[1] & pio_dir[1]); } | |
| 146 | static READ8_HANDLER( tmpz84c011_0_pc_r ) { return (tmpz84c011_pio_r(space,2) & ~pio_dir[2]) | (pio_latch[2] & pio_dir[2]); } | |
| 147 | static READ8_HANDLER( tmpz84c011_0_pd_r ) { return (tmpz84c011_pio_r(space,3) & ~pio_dir[3]) | (pio_latch[3] & pio_dir[3]); } | |
| 148 | static READ8_HANDLER( tmpz84c011_0_pe_r ) { return (tmpz84c011_pio_r(space,4) & ~pio_dir[4]) | (pio_latch[4] & pio_dir[4]); } | |
| 138 | static READ8_HANDLER( tmpz84c011_0_pa_r ) | |
| 139 | { | |
| 140 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 141 | return (tmpz84c011_pio_r(space,0) & ~state->pio_dir[0]) | (state->pio_latch[0] & state->pio_dir[0]); | |
| 142 | } | |
| 149 | 143 | |
| 150 | static WRITE8_HANDLER( tmpz84c011_0_pa_w ) { pio_latch[0] = data; tmpz84c011_pio_w(space, 0, data); } | |
| 151 | static WRITE8_HANDLER( tmpz84c011_0_pb_w ) { pio_latch[1] = data; tmpz84c011_pio_w(space, 1, data); } | |
| 152 | static WRITE8_HANDLER( tmpz84c011_0_pc_w ) { pio_latch[2] = data; tmpz84c011_pio_w(space, 2, data); } | |
| 153 | static WRITE8_HANDLER( tmpz84c011_0_pd_w ) { pio_latch[3] = data; tmpz84c011_pio_w(space, 3, data); } | |
| 154 | static WRITE8_HANDLER( tmpz84c011_0_pe_w ) { pio_latch[4] = data; tmpz84c011_pio_w(space, 4, data); } | |
| 144 | static READ8_HANDLER( tmpz84c011_0_pb_r ) | |
| 145 | { | |
| 146 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 147 | return (tmpz84c011_pio_r(space,1) & ~state->pio_dir[1]) | (state->pio_latch[1] & state->pio_dir[1]); | |
| 148 | } | |
| 155 | 149 | |
| 156 | static READ8_HANDLER( tmpz84c011_0_dir_pa_r ) { return pio_dir[0]; } | |
| 157 | static READ8_HANDLER( tmpz84c011_0_dir_pb_r ) { return pio_dir[1]; } | |
| 158 | static READ8_HANDLER( tmpz84c011_0_dir_pc_r ) { return pio_dir[2]; } | |
| 159 | static READ8_HANDLER( tmpz84c011_0_dir_pd_r ) { return pio_dir[3]; } | |
| 160 | static READ8_HANDLER( tmpz84c011_0_dir_pe_r ) { return pio_dir[4]; } | |
| 150 | static READ8_HANDLER( tmpz84c011_0_pc_r ) | |
| 151 | { | |
| 152 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 153 | return (tmpz84c011_pio_r(space,2) & ~state->pio_dir[2]) | (state->pio_latch[2] & state->pio_dir[2]); | |
| 154 | } | |
| 161 | 155 | |
| 162 | static WRITE8_HANDLER( tmpz84c011_0_dir_pa_w ) { pio_dir[0] = data; } | |
| 163 | static WRITE8_HANDLER( tmpz84c011_0_dir_pb_w ) { pio_dir[1] = data; } | |
| 164 | static WRITE8_HANDLER( tmpz84c011_0_dir_pc_w ) { pio_dir[2] = data; } | |
| 165 | static WRITE8_HANDLER( tmpz84c011_0_dir_pd_w ) { pio_dir[3] = data; } | |
| 166 | static WRITE8_HANDLER( tmpz84c011_0_dir_pe_w ) { pio_dir[4] = data; } | |
| 156 | static READ8_HANDLER( tmpz84c011_0_pd_r ) | |
| 157 | { | |
| 158 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 159 | return (tmpz84c011_pio_r(space,3) & ~state->pio_dir[3]) | (state->pio_latch[3] & state->pio_dir[3]); | |
| 160 | } | |
| 167 | 161 | |
| 162 | static READ8_HANDLER( tmpz84c011_0_pe_r ) | |
| 163 | { | |
| 164 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 165 | return (tmpz84c011_pio_r(space,4) & ~state->pio_dir[4]) | (state->pio_latch[4] & state->pio_dir[4]); | |
| 166 | } | |
| 168 | 167 | |
| 168 | static WRITE8_HANDLER( tmpz84c011_0_pa_w ) | |
| 169 | { | |
| 170 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 171 | state->pio_latch[0] = data; | |
| 172 | tmpz84c011_pio_w(space, 0, data); | |
| 173 | } | |
| 174 | ||
| 175 | static WRITE8_HANDLER( tmpz84c011_0_pb_w ) | |
| 176 | { | |
| 177 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 178 | state->pio_latch[1] = data; | |
| 179 | tmpz84c011_pio_w(space, 1, data); | |
| 180 | } | |
| 181 | static WRITE8_HANDLER( tmpz84c011_0_pc_w ) | |
| 182 | { | |
| 183 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 184 | state->pio_latch[2] = data; | |
| 185 | tmpz84c011_pio_w(space, 2, data); | |
| 186 | } | |
| 187 | ||
| 188 | static WRITE8_HANDLER( tmpz84c011_0_pd_w ) | |
| 189 | { | |
| 190 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 191 | state->pio_latch[3] = data; | |
| 192 | tmpz84c011_pio_w(space, 3, data); | |
| 193 | } | |
| 194 | ||
| 195 | static WRITE8_HANDLER( tmpz84c011_0_pe_w ) | |
| 196 | { | |
| 197 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 198 | state->pio_latch[4] = data; | |
| 199 | tmpz84c011_pio_w(space, 4, data); | |
| 200 | } | |
| 201 | ||
| 202 | static READ8_HANDLER( tmpz84c011_0_dir_pa_r ) | |
| 203 | { | |
| 204 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 205 | return state->pio_dir[0]; | |
| 206 | } | |
| 207 | ||
| 208 | static READ8_HANDLER( tmpz84c011_0_dir_pb_r ) | |
| 209 | { | |
| 210 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 211 | return state->pio_dir[1]; | |
| 212 | } | |
| 213 | ||
| 214 | static READ8_HANDLER( tmpz84c011_0_dir_pc_r ) | |
| 215 | { | |
| 216 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 217 | return state->pio_dir[2]; | |
| 218 | } | |
| 219 | ||
| 220 | static READ8_HANDLER( tmpz84c011_0_dir_pd_r ) | |
| 221 | { | |
| 222 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 223 | return state->pio_dir[3]; | |
| 224 | } | |
| 225 | ||
| 226 | static READ8_HANDLER( tmpz84c011_0_dir_pe_r ) | |
| 227 | { | |
| 228 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 229 | return state->pio_dir[4]; | |
| 230 | } | |
| 231 | ||
| 232 | static WRITE8_HANDLER( tmpz84c011_0_dir_pa_w ) | |
| 233 | { | |
| 234 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 235 | state->pio_dir[0] = data; | |
| 236 | } | |
| 237 | ||
| 238 | static WRITE8_HANDLER( tmpz84c011_0_dir_pb_w ) | |
| 239 | { | |
| 240 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 241 | state->pio_dir[1] = data; | |
| 242 | } | |
| 243 | ||
| 244 | static WRITE8_HANDLER( tmpz84c011_0_dir_pc_w ) | |
| 245 | { | |
| 246 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 247 | state->pio_dir[2] = data; | |
| 248 | } | |
| 249 | ||
| 250 | static WRITE8_HANDLER( tmpz84c011_0_dir_pd_w ) | |
| 251 | { | |
| 252 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 253 | state->pio_dir[3] = data; | |
| 254 | } | |
| 255 | ||
| 256 | static WRITE8_HANDLER( tmpz84c011_0_dir_pe_w ) | |
| 257 | { | |
| 258 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 259 | state->pio_dir[4] = data; | |
| 260 | } | |
| 261 | ||
| 262 | ||
| 169 | 263 | static Z80CTC_INTERFACE( ctc_intf ) |
| 170 | 264 | { |
| 171 | 265 | 0, /* timer disables */ |
| r10613 | r10614 | |
| 177 | 271 | |
| 178 | 272 | static MACHINE_RESET( niyanpai ) |
| 179 | 273 | { |
| 274 | niyanpai_state *state = machine->driver_data<niyanpai_state>(); | |
| 180 | 275 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 181 | 276 | int i; |
| 182 | 277 | |
| 183 | 278 | // initialize TMPZ84C011 PIO |
| 184 | 279 | for (i = 0; i < 5; i++) |
| 185 | 280 | { |
| 186 | pio_dir[i] = pio_latch[i] = 0; | |
| 281 | state->pio_dir[i] = state->pio_latch[i] = 0; | |
| 187 | 282 | tmpz84c011_pio_w(space, i, 0); |
| 188 | 283 | } |
| 189 | 284 | } |
| 190 | 285 | |
| 191 | 286 | static DRIVER_INIT( niyanpai ) |
| 192 | 287 | { |
| 288 | niyanpai_state *state = machine->driver_data<niyanpai_state>(); | |
| 193 | 289 | UINT8 *SNDROM = machine->region("audiocpu")->base(); |
| 194 | 290 | |
| 195 | 291 | // sound program patch |
| r10613 | r10614 | |
| 199 | 295 | niyanpai_soundbank_w(machine, 0); |
| 200 | 296 | |
| 201 | 297 | // initialize out coin flag (musobana) |
| 202 | musobana_outcoin_flag = 1; | |
| 298 | state->musobana_outcoin_flag = 1; | |
| 203 | 299 | } |
| 204 | 300 | |
| 205 | 301 | |
| r10613 | r10614 | |
| 222 | 318 | |
| 223 | 319 | static READ16_HANDLER( musobana_inputport_0_r ) |
| 224 | 320 | { |
| 321 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 225 | 322 | int portdata; |
| 226 | 323 | |
| 227 | switch ((musobana_inputport ^ 0xff00) >> 8) | |
| 324 | switch ((state->musobana_inputport ^ 0xff00) >> 8) | |
| 228 | 325 | { |
| 229 | 326 | case 0x01: portdata = input_port_read(space->machine, "KEY0"); break; |
| 230 | 327 | case 0x02: portdata = input_port_read(space->machine, "KEY1"); break; |
| r10613 | r10614 | |
| 240 | 337 | |
| 241 | 338 | static CUSTOM_INPUT( musobana_outcoin_flag_r ) |
| 242 | 339 | { |
| 340 | niyanpai_state *state = field->port->machine->driver_data<niyanpai_state>(); | |
| 243 | 341 | address_space *space = cputag_get_address_space(field->port->machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 244 | 342 | // tmp68301_parallel_interface[0x05] |
| 245 | 343 | // bit 0 coin counter |
| 246 | 344 | // bit 2 motor on |
| 247 | 345 | // bit 3 coin lock |
| 248 | 346 | |
| 249 | if (tmp68301_parallel_interface_r(space, 0x0005, 0x00ff) & 0x0004) musobana_outcoin_flag ^= 1; | |
| 250 | else musobana_outcoin_flag = 1; | |
| 347 | if (tmp68301_parallel_interface_r(space, 0x0005, 0x00ff) & 0x0004) state->musobana_outcoin_flag ^= 1; | |
| 348 | else state->musobana_outcoin_flag = 1; | |
| 251 | 349 | |
| 252 | return musobana_outcoin_flag & 0x01; | |
| 350 | return state->musobana_outcoin_flag & 0x01; | |
| 253 | 351 | } |
| 254 | 352 | |
| 255 | 353 | static WRITE16_HANDLER ( musobana_inputport_w ) |
| 256 | 354 | { |
| 257 | musobana_inputport = data; | |
| 355 | niyanpai_state *state = space->machine->driver_data<niyanpai_state>(); | |
| 356 | state->musobana_inputport = data; | |
| 258 | 357 | } |
| 259 | 358 | |
| 260 | 359 | static ADDRESS_MAP_START( tmp68301_regs, ADDRESS_SPACE_PROGRAM, 16 ) |
| r10613 | r10614 | |
| 765 | 864 | }; |
| 766 | 865 | |
| 767 | 866 | |
| 768 | static MACHINE_CONFIG_START( niyanpai, | |
| 867 | static MACHINE_CONFIG_START( niyanpai, n | |
| 769 | 868 | |
| 770 | 869 | /* basic machine hardware */ |
| 771 | 870 | MCFG_CPU_ADD("maincpu", M68000, 12288000/2) /* TMP68301, 6.144 MHz */ |
| r10613 | r10614 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | video: Sprite positions still kludged slightly (see skns_sprite_kludge) |
| 35 | 35 | |
| 36 | general: bios is still being skipped, gets stuck at last bios screen if we run it (see #define BIOS_SKIP) | |
| 36 | general: bios is still being skipped, gets stuck at last bios screen if we run it (see #define BIOS_SKIP) | |
| 37 | 37 | |
| 38 | 38 | ------------------ |
| 39 | 39 |
| r10613 | r10614 | |
|---|---|---|
| 4958 | 4958 | MCFG_SCREEN_SIZE(512, 256) |
| 4959 | 4959 | MCFG_SCREEN_VISIBLE_AREA(4, 512-1, 4, 255-8-4) // hide first 4 horizontal pixels (see scroll of gal 4 in test mode) |
| 4960 | 4960 | MCFG_SCREEN_UPDATE(hnoridur) |
| 4961 | ||
| 4961 | ||
| 4962 | 4962 | MCFG_PALETTE_LENGTH(16*256) |
| 4963 | 4963 | |
| 4964 | 4964 | MCFG_VIDEO_START(mjelctrn) |
| r10613 | r10614 | |
| 5027 | 5027 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 5028 | 5028 | MCFG_SCREEN_SIZE(256, 256) |
| 5029 | 5029 | MCFG_SCREEN_VISIBLE_AREA(2, 256-1, 16, 256-1) |
| 5030 | MCFG_SCREEN_UPDATE(mjdialq2) | |
| 5030 | MCFG_SCREEN_UPDATE(mjdialq2) | |
| 5031 | 5031 | |
| 5032 | 5032 | MCFG_PALETTE_LENGTH(512) |
| 5033 | 5033 | MCFG_PALETTE_INIT(sprtmtch) // static palette |
| r10613 | r10614 | |
|---|---|---|
| 70 | 70 | |
| 71 | 71 | To Do: |
| 72 | 72 | |
| 73 | - KL5C80 emulation is needed to consolidate the sammymdl games in one memory map and to run the BIOS | |
| 73 | 74 | - Remove ROM patches from gegege |
| 74 | 75 | - gegege checks the EEPROM output after reset, and wants a timed 0->1 transition or locks up while |
| 75 | 76 | saving setting in service mode. Using a reset_delay of 7 works, unless when "play style" is set |
| 76 | 77 | to "coin" (it probably changes the number of reads from port $C0). |
| 77 | 78 | I guess the reset_delay mechanism should be implemented with a timer in eeprom.c. |
| 79 | - animalc needs a green backgound during part of the intro (floating animals in and out of the screen). | |
| 80 | This can be achieved using either pen 0 or ff as background color, but messes up the other games. | |
| 81 | - pyenaget intro: when the theater scrolls out to the left, the train should scroll in from the right, | |
| 82 | with no visible gaps. It currently leaves the screen empty instead, for several seconds. | |
| 78 | 83 | |
| 79 | 84 | Notes: |
| 80 | 85 | |
| r10613 | r10614 | |
| 347 | 352 | static void show_outputs() |
| 348 | 353 | { |
| 349 | 354 | #ifdef MAME_DEBUG |
| 350 | // | |
| 355 | // popmessage("0: %02X 4: %02X 6: %02X 8: %02X",c0,c4,c6,c8); | |
| 351 | 356 | #endif |
| 352 | 357 | } |
| 353 | 358 | |
| r10613 | r10614 | |
| 600 | 605 | static void show_3_outputs() |
| 601 | 606 | { |
| 602 | 607 | #ifdef MAME_DEBUG |
| 603 | // | |
| 608 | // popmessage("COIN: %02X LED: %02X HOP: %02X", out[0], out[1], out[2]); | |
| 604 | 609 | #endif |
| 605 | 610 | } |
| 606 | 611 | // Port 31 |
| r10613 | r10614 | |
| 610 | 615 | coin_counter_w(space->machine, 1, data & 0x02 ); // coin2 in |
| 611 | 616 | coin_counter_w(space->machine, 2, data & 0x04 ); // medal in |
| 612 | 617 | |
| 613 | // coin_lockout_w(space->machine, 1, (~data) & 0x08 ); // coin2 lockout? | |
| 614 | // coin_lockout_w(space->machine, 0, (~data) & 0x10 ); // coin1 lockout | |
| 615 | // coin_lockout_w(space->machine, 2, (~data) & 0x20 ); // medal lockout? | |
| 618 | // coin_lockout_w(space->machine, 1, (~data) & 0x08 ); // coin2 lockout? | |
| 619 | // coin_lockout_w(space->machine, 0, (~data) & 0x10 ); // coin1 lockout | |
| 620 | // coin_lockout_w(space->machine, 2, (~data) & 0x20 ); // medal lockout? | |
| 616 | 621 | |
| 617 | 622 | out[0] = data; |
| 618 | 623 | show_3_outputs(); |
| r10613 | r10614 | |
| 648 | 653 | return ret; |
| 649 | 654 | } |
| 650 | 655 | |
| 651 | // Sound | |
| 652 | static WRITE8_DEVICE_HANDLER( sammymdl_sound_w ) | |
| 653 | { | |
| 654 | if (offset) | |
| 655 | downcast<okim9810_device *>(device)->write_TMP_register(data); | |
| 656 | else | |
| 657 | downcast<okim9810_device *>(device)->write_command(data); | |
| 658 | } | |
| 659 | static READ8_DEVICE_HANDLER( sammymdl_sound_r ) | |
| 660 | { | |
| 661 | // Needed for haekaka (Oki read status is not implemented yet) | |
| 662 | return device->machine->rand(); | |
| 663 | } | |
| 664 | ||
| 665 | 656 | static UINT8 *nvram; |
| 666 | 657 | static ADDRESS_MAP_START( animalc_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 667 | 658 | AM_RANGE( 0x0000, 0x3fff ) AM_ROM |
| r10613 | r10614 | |
| 692 | 683 | AM_RANGE( 0x31, 0x31 ) AM_WRITE( sammymdl_coin_w ) |
| 693 | 684 | AM_RANGE( 0x32, 0x32 ) AM_WRITE( sammymdl_leds_w ) |
| 694 | 685 | AM_RANGE( 0x34, 0x34 ) AM_READ( unk_34_r ) |
| 695 | AM_RANGE( 0x90, 0x91 ) AM_DEVWRITE("oki", sammymdl_sound_w ) | |
| 696 | AM_RANGE( 0x92, 0x92 ) AM_DEVWRITE("oki", sammymdl_sound_r ) | |
| 686 | AM_RANGE( 0x90, 0x90 ) AM_DEVWRITE_MODERN("oki", okim9810_device, write ) | |
| 687 | AM_RANGE( 0x91, 0x91 ) AM_DEVWRITE_MODERN("oki", okim9810_device, write_TMP_register ) | |
| 688 | AM_RANGE( 0x92, 0x92 ) AM_DEVREAD_MODERN("oki", okim9810_device, read ) | |
| 697 | 689 | AM_RANGE( 0xb0, 0xb0 ) AM_WRITE( sammymdl_hopper_w ) |
| 698 | 690 | AM_RANGE( 0xc0, 0xc0 ) AM_WRITE( watchdog_reset_w ) // 1 |
| 699 | 691 | ADDRESS_MAP_END |
| r10613 | r10614 | |
| 836 | 828 | case 0x65: // SPRITERAM |
| 837 | 829 | if (offset < 0x1000) |
| 838 | 830 | return space->machine->generic.spriteram.u8[offset]; |
| 839 | ||
| 831 | ||
| 840 | 832 | case 0x67: // PALETTERAM + TABLE? + REGS |
| 841 | 833 | if (offset < 0x200) |
| 842 | 834 | return space->machine->generic.paletteram.u8[offset]; |
| r10613 | r10614 | |
| 860 | 852 | return; |
| 861 | 853 | } |
| 862 | 854 | break; |
| 863 | ||
| 855 | ||
| 864 | 856 | case 0x67: // PALETTERAM + TABLE? + REGS |
| 865 | 857 | if (offset < 0x200) |
| 866 | 858 | { |
| 867 | 859 | paletteram_xRRRRRGGGGGBBBBB_be_w(space, offset, data); |
| 868 | // | |
| 860 | // space->machine->generic.paletteram.u8[offset] = data; | |
| 869 | 861 | return; |
| 870 | 862 | } |
| 871 | 863 | else if ((offset >= 0x800) && (offset < 0x880)) |
| r10613 | r10614 | |
| 898 | 890 | static WRITE8_HANDLER( haekaka_coin_w ) |
| 899 | 891 | { |
| 900 | 892 | coin_counter_w(space->machine, 0, data & 0x01 ); // medal out |
| 901 | // data & 0x02 ? | |
| 902 | // data & 0x04 ? | |
| 903 | // data & 0x10 ? | |
| 893 | // data & 0x02 ? | |
| 894 | // data & 0x04 ? | |
| 895 | // data & 0x10 ? | |
| 904 | 896 | |
| 905 | 897 | out[0] = data; |
| 906 | 898 | show_3_outputs(); |
| r10613 | r10614 | |
| 923 | 915 | AM_RANGE( 0x30, 0x30 ) AM_READ_PORT( "BUTTON" ) |
| 924 | 916 | AM_RANGE( 0x31, 0x31 ) AM_WRITE( haekaka_coin_w ) |
| 925 | 917 | AM_RANGE( 0x32, 0x32 ) AM_WRITE( haekaka_leds_w ) |
| 926 | AM_RANGE( 0x90, 0x91 ) AM_DEVWRITE("oki", sammymdl_sound_w ) | |
| 927 | AM_RANGE( 0x92, 0x92 ) AM_DEVWRITE("oki", sammymdl_sound_r ) | |
| 918 | AM_RANGE( 0x90, 0x90 ) AM_DEVWRITE_MODERN("oki", okim9810_device, write ) | |
| 919 | AM_RANGE( 0x91, 0x91 ) AM_DEVWRITE_MODERN("oki", okim9810_device, write_TMP_register ) | |
| 920 | AM_RANGE( 0x92, 0x92 ) AM_DEVREAD_MODERN("oki", okim9810_device, read ) | |
| 928 | 921 | AM_RANGE( 0xb0, 0xb0 ) AM_WRITE( sammymdl_hopper_w ) |
| 929 | 922 | AM_RANGE( 0xc0, 0xc0 ) AM_WRITE( watchdog_reset_w ) // 1 |
| 930 | 923 | ADDRESS_MAP_END |
| r10613 | r10614 | |
| 1160 | 1153 | AM_RANGE( 0x30, 0x30 ) AM_READ_PORT( "BUTTON" ) |
| 1161 | 1154 | AM_RANGE( 0x31, 0x31 ) AM_WRITE( sammymdl_coin_w ) |
| 1162 | 1155 | AM_RANGE( 0x32, 0x32 ) AM_WRITE( sammymdl_leds_w ) |
| 1163 | AM_RANGE( 0x90, 0x91 ) AM_DEVWRITE("oki", sammymdl_sound_w ) | |
| 1164 | AM_RANGE( 0x92, 0x92 ) AM_DEVWRITE("oki", sammymdl_sound_r ) | |
| 1156 | AM_RANGE( 0x90, 0x90 ) AM_DEVWRITE_MODERN("oki", okim9810_device, write ) | |
| 1157 | AM_RANGE( 0x91, 0x91 ) AM_DEVWRITE_MODERN("oki", okim9810_device, write_TMP_register ) | |
| 1158 | AM_RANGE( 0x92, 0x92 ) AM_DEVREAD_MODERN("oki", okim9810_device, read ) | |
| 1165 | 1159 | AM_RANGE( 0xb0, 0xb0 ) AM_WRITE( sammymdl_hopper_w ) |
| 1166 | 1160 | AM_RANGE( 0xc0, 0xc0 ) AM_WRITE( watchdog_reset_w ) // 1 |
| 1167 | 1161 | ADDRESS_MAP_END |
| r10613 | r10614 | |
| 1337 | 1331 | return; |
| 1338 | 1332 | } |
| 1339 | 1333 | break; |
| 1340 | ||
| 1334 | ||
| 1341 | 1335 | case 0x66: // PALETTERAM + TABLE? |
| 1342 | 1336 | if (offset < 0x200) |
| 1343 | 1337 | { |
| 1344 | 1338 | paletteram_xRRRRRGGGGGBBBBB_be_w(space, offset, data); |
| 1345 | // | |
| 1339 | // space->machine->generic.paletteram.u8[offset] = data; | |
| 1346 | 1340 | return; |
| 1347 | 1341 | } |
| 1348 | 1342 | else if ((offset >= 0x800) && (offset < 0x880)) |
| r10613 | r10614 | |
| 1373 | 1367 | AM_RANGE( 0x30, 0x30 ) AM_READ_PORT( "BUTTON" ) |
| 1374 | 1368 | AM_RANGE( 0x31, 0x31 ) AM_WRITE( sammymdl_coin_w ) |
| 1375 | 1369 | AM_RANGE( 0x32, 0x32 ) AM_WRITE( sammymdl_leds_w ) |
| 1376 | AM_RANGE( 0x90, 0x91 ) AM_DEVWRITE("oki", sammymdl_sound_w ) | |
| 1377 | AM_RANGE( 0x92, 0x92 ) AM_DEVWRITE("oki", sammymdl_sound_r ) | |
| 1370 | AM_RANGE( 0x90, 0x90 ) AM_DEVWRITE_MODERN("oki", okim9810_device, write ) | |
| 1371 | AM_RANGE( 0x91, 0x91 ) AM_DEVWRITE_MODERN("oki", okim9810_device, write_TMP_register ) | |
| 1372 | AM_RANGE( 0x92, 0x92 ) AM_DEVREAD_MODERN("oki", okim9810_device, read ) | |
| 1378 | 1373 | AM_RANGE( 0xb0, 0xb0 ) AM_WRITE( sammymdl_hopper_w ) |
| 1379 | 1374 | AM_RANGE( 0xc0, 0xc0 ) AM_WRITE( watchdog_reset_w ) // 1 |
| 1380 | 1375 | ADDRESS_MAP_END |
| r10613 | r10614 | |
| 1591 | 1586 | |
| 1592 | 1587 | static MACHINE_CONFIG_START( sammymdl, driver_device ) |
| 1593 | 1588 | MCFG_CPU_ADD("maincpu", Z80, XTAL_20MHz / 2) // !! KL5C80A120FP @ 10MHz? (actually 4 times faster than Z80) !! |
| 1589 | MCFG_CPU_PROGRAM_MAP( animalc_map ) | |
| 1590 | MCFG_CPU_IO_MAP( animalc_io ) | |
| 1594 | 1591 | |
| 1595 | 1592 | MCFG_MACHINE_RESET( sammymdl ) |
| 1596 | 1593 | |
| r10613 | r10614 | |
| 1615 | 1612 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1616 | 1613 | |
| 1617 | 1614 | MCFG_OKIM9810_ADD("oki", XTAL_4_096MHz) |
| 1618 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.80) | |
| 1619 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.80) | |
| 1615 | MCFG_SOUND_ROUTE(0, "lspeaker", 0.80) | |
| 1616 | MCFG_SOUND_ROUTE(1, "rspeaker", 0.80) | |
| 1620 | 1617 | MACHINE_CONFIG_END |
| 1621 | 1618 | |
| 1622 | 1619 | |
| r10613 | r10614 | |
| 1861 | 1858 | |
| 1862 | 1859 | ***************************************************************************/ |
| 1863 | 1860 | |
| 1861 | #define SAMMYMDL_BIOS \ | |
| 1862 | ROM_REGION( 0x80000, "mainbios", 0 ) \ | |
| 1863 | ROM_SYSTEM_BIOS( 0, "v5", "IPL Ver. 5.0" ) \ | |
| 1864 | ROM_LOAD( "vm1211l01.u2", 0x000000, 0x080000, CRC(c3c74dc5) SHA1(07352e6dba7514214e778ba39e1ca773e4698858) ) | |
| 1864 | 1865 | |
| 1866 | ROM_START( sammymdl ) | |
| 1867 | SAMMYMDL_BIOS | |
| 1868 | ||
| 1869 | ROM_REGION( 0x1000000, "oki", ROMREGION_ERASEFF ) | |
| 1870 | ||
| 1871 | ROM_REGION( 0x40000, "maincpu", ROMREGION_ERASEFF ) | |
| 1872 | ||
| 1873 | ROM_REGION( 0x200000, "sprites", ROMREGION_ERASEFF ) | |
| 1874 | ROM_END | |
| 1875 | ||
| 1865 | 1876 | /*************************************************************************** |
| 1866 | 1877 | |
| 1867 | 1878 | Animal Catch ( VX2002L02 ANIMALCAT 200011211536 SAMMY CORP. AM ) |
| r10613 | r10614 | |
| 1873 | 1884 | ***************************************************************************/ |
| 1874 | 1885 | |
| 1875 | 1886 | ROM_START( animalc ) |
| 1887 | SAMMYMDL_BIOS | |
| 1888 | ||
| 1876 | 1889 | ROM_REGION( 0x1000000, "oki", 0 ) |
| 1877 | 1890 | ROM_LOAD( "vx2302l01.u021", 0x00000, 0x200000, CRC(84cf123b) SHA1(d8b425c93ff1a560e3f92c70d7eb93a05c3581af) ) |
| 1878 | 1891 | |
| r10613 | r10614 | |
| 1908 | 1921 | ***************************************************************************/ |
| 1909 | 1922 | |
| 1910 | 1923 | ROM_START( itazuram ) |
| 1924 | SAMMYMDL_BIOS | |
| 1925 | ||
| 1911 | 1926 | ROM_REGION( 0x1000000, "oki", 0 ) |
| 1912 | 1927 | ROM_LOAD( "vx2002l01.u021", 0x00000, 0x200000, CRC(ddbdd2f3) SHA1(91f67a938929be0261442e066e3d2c03b5e9f06a) ) |
| 1913 | 1928 | |
| r10613 | r10614 | |
| 1963 | 1978 | ***************************************************************************/ |
| 1964 | 1979 | |
| 1965 | 1980 | ROM_START( tdoboon ) |
| 1981 | SAMMYMDL_BIOS | |
| 1982 | ||
| 1966 | 1983 | ROM_REGION( 0x1000000, "oki", 0 ) |
| 1967 | 1984 | ROM_LOAD( "em4210l01.u021.bin", 0x00000, 0x200000, CRC(3523e314) SHA1(d07c5d17d3f285be4cde810547f427e84f98968f) ) |
| 1968 | 1985 | |
| r10613 | r10614 | |
| 1983 | 2000 | ***************************************************************************/ |
| 1984 | 2001 | |
| 1985 | 2002 | ROM_START( pyenaget ) |
| 2003 | SAMMYMDL_BIOS | |
| 2004 | ||
| 1986 | 2005 | ROM_REGION( 0x1000000, "oki", 0 ) |
| 1987 | 2006 | ROM_LOAD( "vx1802l01.u021", 0x00000, 0x200000, CRC(7a22a657) SHA1(2a98085862fd958209253c5401e41eae4f7c06ea) ) |
| 1988 | 2007 | |
| r10613 | r10614 | |
| 2017 | 2036 | ***************************************************************************/ |
| 2018 | 2037 | |
| 2019 | 2038 | ROM_START( haekaka ) |
| 2039 | SAMMYMDL_BIOS | |
| 2040 | ||
| 2020 | 2041 | ROM_REGION( 0x1000000, "oki", 0 ) |
| 2021 | 2042 | ROM_LOAD( "em4208l01.u021.bin", 0x00000, 0x200000, CRC(d23bb748) SHA1(38d5b6c4b2cd470b3a68574aeca3f9fa9032245e) ) |
| 2022 | 2043 | |
| r10613 | r10614 | |
| 2048 | 2069 | |
| 2049 | 2070 | ***************************************************************************/ |
| 2050 | 2071 | |
| 2051 | GAME( 1997, gegege, 0, gegege, gegege, gegege, ROT0, "Banpresto / Sigma", "GeGeGe no Kitarou Youkai Slot", 0 | |
| 2072 | GAME( 1997, gegege, 0, gegege, gegege, gegege, ROT0, "Banpresto / Sigma", "GeGeGe no Kitarou Youkai Slot", 0 | |
| 2052 | 2073 | // Sammy Medal Games: |
| 2053 | GAME( 2000, animalc, 0, animalc, sammymdl, animalc, ROT0, "Sammy", "Animal Catch", GAME_IMPERFECT_SOUND ) | |
| 2054 | GAME( 2000, itazuram, 0, itazuram, sammymdl, itazuram, ROT0, "Sammy", "Itazura Monkey", GAME_IMPERFECT_SOUND ) | |
| 2055 | GAME( 2000, pyenaget, 0, pyenaget, sammymdl, haekaka, ROT0, "Sammy", "Pye-nage Taikai", GAME_IMPERFECT_SOUND ) | |
| 2056 | GAME( 2000, tdoboon, 0, tdoboon, haekaka, haekaka, ROT0, "Sammy", "Taihou de Doboon", GAME_IMPERFECT_SOUND ) | |
| 2057 | GAME( 2001, haekaka, 0, haekaka, haekaka, haekaka, ROT0, "Sammy", "Hae Hae Ka Ka Ka", GAME_IMPERFECT_SOUND ) | |
| 2074 | GAME( 2000, sammymdl, 0, sammymdl, sammymdl, 0, ROT0, "Sammy", "Sammy Medal Game System Bios", GAME_IS_BIOS_ROOT ) | |
| 2075 | GAME( 2000, animalc, sammymdl, animalc, sammymdl, animalc, ROT0, "Sammy", "Animal Catch", 0 ) | |
| 2076 | GAME( 2000, itazuram, sammymdl, itazuram, sammymdl, itazuram, ROT0, "Sammy", "Itazura Monkey", 0 ) | |
| 2077 | GAME( 2000, pyenaget, sammymdl, pyenaget, sammymdl, haekaka, ROT0, "Sammy", "Pye-nage Taikai", 0 ) | |
| 2078 | GAME( 2000, tdoboon, sammymdl, tdoboon, haekaka, haekaka, ROT0, "Sammy", "Taihou de Doboon", 0 ) | |
| 2079 | GAME( 2001, haekaka, sammymdl, haekaka, haekaka, haekaka, ROT0, "Sammy", "Hae Hae Ka Ka Ka", 0 ) |
| r10613 | r10614 | |
|---|---|---|
| 924 | 924 | /* video hardware */ |
| 925 | 925 | MCFG_SCREEN_MODIFY("screen") |
| 926 | 926 | MCFG_SCREEN_UPDATE(comad) |
| 927 | MCFG_SCREEN_EOF(0) | |
| 927 | 928 | MACHINE_CONFIG_END |
| 928 | 929 | |
| 929 | 930 | static MACHINE_CONFIG_DERIVED( supmodel, comad ) |
| r10613 | r10614 | |
| 937 | 938 | /* video hardware */ |
| 938 | 939 | MCFG_SCREEN_MODIFY("screen") |
| 939 | 940 | MCFG_SCREEN_UPDATE(comad) |
| 941 | MCFG_SCREEN_EOF(0) | |
| 940 | 942 | |
| 941 | 943 | /* sound hardware */ |
| 942 | 944 | MCFG_OKIM6295_REPLACE("oki", 1584000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified |
| r10613 | r10614 | |
| 954 | 956 | /* video hardware */ |
| 955 | 957 | MCFG_SCREEN_MODIFY("screen") |
| 956 | 958 | MCFG_SCREEN_UPDATE(comad) |
| 959 | MCFG_SCREEN_EOF(0) | |
| 957 | 960 | MACHINE_CONFIG_END |
| 958 | 961 | |
| 959 | 962 | static MACHINE_CONFIG_DERIVED( galhustl, comad ) |
| r10613 | r10614 | |
| 967 | 970 | /* video hardware */ |
| 968 | 971 | MCFG_SCREEN_MODIFY("screen") |
| 969 | 972 | MCFG_SCREEN_UPDATE(comad) |
| 973 | MCFG_SCREEN_EOF(0) | |
| 970 | 974 | |
| 971 | 975 | /* sound hardware */ |
| 972 | 976 | MCFG_OKIM6295_REPLACE("oki", 1056000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified |
| r10613 | r10614 | |
|---|---|---|
| 1047 | 1047 | MCFG_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 ) |
| 1048 | 1048 | MCFG_SCREEN_UPDATE(armedf) |
| 1049 | 1049 | MCFG_SCREEN_EOF(armedf) |
| 1050 | ||
| 1050 | ||
| 1051 | 1051 | MCFG_GFXDECODE(armedf) |
| 1052 | 1052 | MCFG_PALETTE_LENGTH(2048) |
| 1053 | 1053 |
| r10613 | r10614 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | #include "emu.h" |
| 20 | 20 | #include "cpu/i386/i386.h" |
| 21 | #include "memconv.h" | |
| 22 | #include "devconv.h" | |
| 23 | #include "machine/8237dma.h" | |
| 24 | 21 | #include "machine/pic8259.h" |
| 25 | 22 | #include "machine/pit8253.h" |
| 26 | 23 | #include "machine/mc146818.h" |
| 27 | #include "machine/pcshare.h" | |
| 28 | #include "machine/pci.h" | |
| 29 | 24 | #include "machine/8042kbdc.h" |
| 30 | #include "machine/pckeybrd.h" | |
| 31 | #include "machine/idectrl.h" | |
| 32 | #include "sound/beep.h" | |
| 25 | #include "machine/pcshare.h" | |
| 26 | #include "video/pc_vga.h" | |
| 27 | #include "video/pc_video.h" | |
| 33 | 28 | |
| 34 | static UINT32 *vga_vram; | |
| 35 | static UINT8 vga_regs[0x19]; | |
| 36 | ||
| 37 | #define SET_VISIBLE_AREA(_x_,_y_) \ | |
| 38 | { \ | |
| 39 | rectangle visarea; \ | |
| 40 | visarea.min_x = 0; \ | |
| 41 | visarea.max_x = _x_-1; \ | |
| 42 | visarea.min_y = 0; \ | |
| 43 | visarea.max_y = _y_-1; \ | |
| 44 | machine->primary_screen->configure(_x_, _y_, visarea, machine->primary_screen->frame_period().attoseconds ); \ | |
| 45 | } \ | |
| 46 | ||
| 47 | #define RES_320x200 0 | |
| 48 | #define RES_640x200 1 | |
| 49 | ||
| 50 | static VIDEO_START(pcat_dyn) | |
| 51 | { | |
| 52 | } | |
| 53 | ||
| 54 | ||
| 55 | ||
| 56 | static void cga_alphanumeric_tilemap(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,UINT16 size,UINT32 map_offs,UINT8 gfx_num) | |
| 57 | { | |
| 58 | static UINT32 offs,x,y,max_x,max_y; | |
| 59 | int tile,color; | |
| 60 | ||
| 61 | /*define the visible area*/ | |
| 62 | switch(size) | |
| 63 | { | |
| 64 | case RES_320x200: | |
| 65 | SET_VISIBLE_AREA(320,200); | |
| 66 | max_x = 40; | |
| 67 | max_y = 25; | |
| 68 | break; | |
| 69 | case RES_640x200: | |
| 70 | SET_VISIBLE_AREA(640,200); | |
| 71 | max_x = 80; | |
| 72 | max_y = 25; | |
| 73 | break; | |
| 74 | } | |
| 75 | ||
| 76 | offs = map_offs; | |
| 77 | ||
| 78 | for(y=0;y<max_y;y++) | |
| 79 | for(x=0;x<max_x;x+=2) | |
| 80 | { | |
| 81 | tile = (vga_vram[offs] & 0x00ff0000)>>16; | |
| 82 | color = (vga_vram[offs] & 0xff000000)>>24; | |
| 83 | ||
| 84 | drawgfx_opaque(bitmap,cliprect,machine->gfx[gfx_num], | |
| 85 | tile, | |
| 86 | color, | |
| 87 | 0,0, | |
| 88 | (x+1)*8,y*8); | |
| 89 | ||
| 90 | ||
| 91 | tile = (vga_vram[offs] & 0x000000ff); | |
| 92 | color = (vga_vram[offs] & 0x0000ff00)>>8; | |
| 93 | ||
| 94 | drawgfx_opaque(bitmap,cliprect,machine->gfx[gfx_num], | |
| 95 | tile, | |
| 96 | color, | |
| 97 | 0,0, | |
| 98 | (x+0)*8,y*8); | |
| 99 | ||
| 100 | offs++; | |
| 101 | } | |
| 102 | } | |
| 103 | ||
| 104 | static SCREEN_UPDATE(pcat_dyn) | |
| 105 | { | |
| 106 | cga_alphanumeric_tilemap(screen->machine,bitmap,cliprect,RES_640x200,0x10000/4,0); | |
| 107 | ||
| 108 | return 0; | |
| 109 | } | |
| 110 | ||
| 111 | static struct { | |
| 112 | device_t *pit8253; | |
| 113 | device_t *pic8259_1; | |
| 114 | device_t *pic8259_2; | |
| 115 | device_t *dma8237_1; | |
| 116 | device_t *dma8237_2; | |
| 117 | } pcat_dyn_devices; | |
| 118 | ||
| 119 | /****************** | |
| 120 | DMA8237 Controller | |
| 121 | ******************/ | |
| 122 | ||
| 123 | static int dma_channel; | |
| 124 | static UINT8 dma_offset[2][4]; | |
| 125 | static UINT8 at_pages[0x10]; | |
| 126 | ||
| 127 | ||
| 128 | static READ8_HANDLER(dma_page_select_r) | |
| 129 | { | |
| 130 | UINT8 data = at_pages[offset % 0x10]; | |
| 131 | ||
| 132 | switch(offset % 8) | |
| 133 | { | |
| 134 | case 1: | |
| 135 | data = dma_offset[(offset / 8) & 1][2]; | |
| 136 | break; | |
| 137 | case 2: | |
| 138 | data = dma_offset[(offset / 8) & 1][3]; | |
| 139 | break; | |
| 140 | case 3: | |
| 141 | data = dma_offset[(offset / 8) & 1][1]; | |
| 142 | break; | |
| 143 | case 7: | |
| 144 | data = dma_offset[(offset / 8) & 1][0]; | |
| 145 | break; | |
| 146 | } | |
| 147 | return data; | |
| 148 | } | |
| 149 | ||
| 150 | ||
| 151 | static WRITE8_HANDLER(dma_page_select_w) | |
| 152 | { | |
| 153 | at_pages[offset % 0x10] = data; | |
| 154 | ||
| 155 | switch(offset % 8) | |
| 156 | { | |
| 157 | case 1: | |
| 158 | dma_offset[(offset / 8) & 1][2] = data; | |
| 159 | break; | |
| 160 | case 2: | |
| 161 | dma_offset[(offset / 8) & 1][3] = data; | |
| 162 | break; | |
| 163 | case 3: | |
| 164 | dma_offset[(offset / 8) & 1][1] = data; | |
| 165 | break; | |
| 166 | case 7: | |
| 167 | dma_offset[(offset / 8) & 1][0] = data; | |
| 168 | break; | |
| 169 | } | |
| 170 | } | |
| 171 | ||
| 172 | ||
| 173 | static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed ) | |
| 174 | { | |
| 175 | cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE); | |
| 176 | ||
| 177 | /* Assert HLDA */ | |
| 178 | i8237_hlda_w( device, state ); | |
| 179 | } | |
| 180 | ||
| 181 | ||
| 182 | static READ8_HANDLER( pc_dma_read_byte ) | |
| 183 | { | |
| 184 | offs_t page_offset = (((offs_t) dma_offset[0][dma_channel]) << 16) | |
| 185 | & 0xFF0000; | |
| 186 | ||
| 187 | return space->read_byte(page_offset + offset); | |
| 188 | } | |
| 189 | ||
| 190 | ||
| 191 | static WRITE8_HANDLER( pc_dma_write_byte ) | |
| 192 | { | |
| 193 | offs_t page_offset = (((offs_t) dma_offset[0][dma_channel]) << 16) | |
| 194 | & 0xFF0000; | |
| 195 | ||
| 196 | space->write_byte(page_offset + offset, data); | |
| 197 | } | |
| 198 | ||
| 199 | static void set_dma_channel(device_t *device, int channel, int state) | |
| 200 | { | |
| 201 | if (!state) dma_channel = channel; | |
| 202 | } | |
| 203 | ||
| 204 | static WRITE_LINE_DEVICE_HANDLER( pc_dack0_w ) { set_dma_channel(device, 0, state); } | |
| 205 | static WRITE_LINE_DEVICE_HANDLER( pc_dack1_w ) { set_dma_channel(device, 1, state); } | |
| 206 | static WRITE_LINE_DEVICE_HANDLER( pc_dack2_w ) { set_dma_channel(device, 2, state); } | |
| 207 | static WRITE_LINE_DEVICE_HANDLER( pc_dack3_w ) { set_dma_channel(device, 3, state); } | |
| 208 | ||
| 209 | static I8237_INTERFACE( dma8237_1_config ) | |
| 210 | { | |
| 211 | DEVCB_LINE(pc_dma_hrq_changed), | |
| 212 | DEVCB_NULL, | |
| 213 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_read_byte), | |
| 214 | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, pc_dma_write_byte), | |
| 215 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, | |
| 216 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, | |
| 217 | { DEVCB_LINE(pc_dack0_w), DEVCB_LINE(pc_dack1_w), DEVCB_LINE(pc_dack2_w), DEVCB_LINE(pc_dack3_w) } | |
| 218 | }; | |
| 219 | ||
| 220 | static I8237_INTERFACE( dma8237_2_config ) | |
| 221 | { | |
| 222 | DEVCB_NULL, | |
| 223 | DEVCB_NULL, | |
| 224 | DEVCB_NULL, | |
| 225 | DEVCB_NULL, | |
| 226 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, | |
| 227 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }, | |
| 228 | { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL } | |
| 229 | }; | |
| 230 | ||
| 231 | ||
| 232 | /****************** | |
| 233 | 8259 IRQ controller | |
| 234 | ******************/ | |
| 235 | ||
| 236 | static WRITE_LINE_DEVICE_HANDLER( pic8259_1_set_int_line ) | |
| 237 | { | |
| 238 | cputag_set_input_line(device->machine, "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE); | |
| 239 | } | |
| 240 | ||
| 241 | static const struct pic8259_interface pic8259_1_config = | |
| 242 | { | |
| 243 | DEVCB_LINE(pic8259_1_set_int_line) | |
| 244 | }; | |
| 245 | ||
| 246 | static const struct pic8259_interface pic8259_2_config = | |
| 247 | { | |
| 248 | DEVCB_DEVICE_LINE("pic8259_1", pic8259_ir2_w) | |
| 249 | }; | |
| 250 | ||
| 251 | static IRQ_CALLBACK(irq_callback) | |
| 252 | { | |
| 253 | int r = 0; | |
| 254 | r = pic8259_acknowledge(pcat_dyn_devices.pic8259_2); | |
| 255 | if (r==0) | |
| 256 | { | |
| 257 | r = pic8259_acknowledge(pcat_dyn_devices.pic8259_1); | |
| 258 | } | |
| 259 | return r; | |
| 260 | } | |
| 261 | ||
| 262 | static WRITE_LINE_DEVICE_HANDLER( at_pit8254_out0_changed ) | |
| 263 | { | |
| 264 | if ( pcat_dyn_devices.pic8259_1 ) | |
| 265 | { | |
| 266 | pic8259_ir0_w(pcat_dyn_devices.pic8259_1, state); | |
| 267 | } | |
| 268 | } | |
| 269 | ||
| 270 | ||
| 271 | static WRITE_LINE_DEVICE_HANDLER( at_pit8254_out2_changed ) | |
| 272 | { | |
| 273 | //at_speaker_set_input( state ? 1 : 0 ); | |
| 274 | } | |
| 275 | ||
| 276 | ||
| 277 | static const struct pit8253_config at_pit8254_config = | |
| 278 | { | |
| 279 | { | |
| 280 | { | |
| 281 | 4772720/4, /* heartbeat IRQ */ | |
| 282 | DEVCB_NULL, | |
| 283 | DEVCB_LINE(at_pit8254_out0_changed) | |
| 284 | }, { | |
| 285 | 4772720/4, /* dram refresh */ | |
| 286 | DEVCB_NULL, | |
| 287 | DEVCB_NULL | |
| 288 | }, { | |
| 289 | 4772720/4, /* pio port c pin 4, and speaker polling enough */ | |
| 290 | DEVCB_NULL, | |
| 291 | DEVCB_LINE(at_pit8254_out2_changed) | |
| 292 | } | |
| 293 | } | |
| 294 | }; | |
| 295 | ||
| 296 | 29 | //ce9b8 |
| 297 | 30 | /* TODO: understand the proper ROM loading.*/ |
| 298 | 31 | static ADDRESS_MAP_START( pcat_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 299 | 32 | AM_RANGE(0x00000000, 0x0009ffff) AM_RAM |
| 300 | AM_RANGE(0x000a0000, 0x000bffff) AM_RAM AM_BASE(&vga_vram) | |
| 301 | AM_RANGE(0x000c0000, 0x000c7fff) AM_RAM AM_REGION("video_bios", 0) | |
| 33 | AM_RANGE(0x000a0000, 0x000bffff) AM_RAM | |
| 34 | AM_RANGE(0x000c0000, 0x000c7fff) AM_ROM AM_REGION("video_bios", 0) | |
| 302 | 35 | AM_RANGE(0x000c8000, 0x000cffff) AM_RAM |
| 303 | 36 | // AM_RANGE(0x000d0000, 0x000d7fff) AM_RAM AM_REGION("disk_bios", 0) |
| 304 | 37 | // AM_RANGE(0x000d8000, 0x000dffff) AM_RAM AM_REGION("disk_bios", 0) |
| 305 | 38 | // AM_RANGE(0x000e0000, 0x000effff) AM_ROM AM_REGION("game_prg", 0) |
| 306 | 39 | AM_RANGE(0x000f0000, 0x000fffff) AM_ROM AM_REGION("bios", 0 ) |
| 307 | 40 | AM_RANGE(0x00100000, 0x001fffff) AM_RAM //AM_REGION("game_prg", 0) |
| 308 | AM_RANGE(0x00200000, 0x00ffffff) AM_RAM | |
| 309 | AM_RANGE(0x01000000, 0x01ffffff) AM_RAM | |
| 41 | // AM_RANGE(0x00200000, 0x00ffffff) AM_RAM | |
| 42 | //AM_RANGE(0x01000000, 0x01ffffff) AM_RAM | |
| 310 | 43 | AM_RANGE(0xffff0000, 0xffffffff) AM_ROM AM_REGION("bios", 0 ) |
| 311 | 44 | ADDRESS_MAP_END |
| 312 | 45 | |
| 313 | ||
| 314 | static READ32_HANDLER( kludge_r ) | |
| 315 | { | |
| 316 | return space->machine->rand(); | |
| 317 | } | |
| 318 | ||
| 319 | /* 3c8-3c9 -> ramdac*/ | |
| 320 | static WRITE32_HANDLER( vga_ramdac_w ) | |
| 321 | { | |
| 322 | static int pal_offs,r,g,b,internal_pal_offs; | |
| 323 | ||
| 324 | if (ACCESSING_BITS_0_7) | |
| 325 | { | |
| 326 | //printf("%02x X\n",data); | |
| 327 | pal_offs = internal_pal_offs = data; | |
| 328 | } | |
| 329 | if (ACCESSING_BITS_8_15) | |
| 330 | { | |
| 331 | //printf("%02x\n",data); | |
| 332 | data>>=8; | |
| 333 | switch(internal_pal_offs) | |
| 334 | { | |
| 335 | case 0: | |
| 336 | r = ((data & 0x3f) << 2) | ((data & 0x30) >> 4); | |
| 337 | internal_pal_offs++; | |
| 338 | break; | |
| 339 | case 1: | |
| 340 | g = ((data & 0x3f) << 2) | ((data & 0x30) >> 4); | |
| 341 | internal_pal_offs++; | |
| 342 | break; | |
| 343 | case 2: | |
| 344 | b = ((data & 0x3f) << 2) | ((data & 0x30) >> 4); | |
| 345 | palette_set_color(space->machine, 0x200+pal_offs, MAKE_RGB(r, g, b)); | |
| 346 | internal_pal_offs = 0; | |
| 347 | pal_offs++; | |
| 348 | break; | |
| 349 | } | |
| 350 | } | |
| 351 | } | |
| 352 | ||
| 353 | static WRITE32_HANDLER( vga_regs_w ) | |
| 354 | { | |
| 355 | static UINT8 vga_address; | |
| 356 | ||
| 357 | if (ACCESSING_BITS_0_7) | |
| 358 | vga_address = data; | |
| 359 | if (ACCESSING_BITS_8_15) | |
| 360 | { | |
| 361 | if(vga_address < 0x19) | |
| 362 | { | |
| 363 | vga_regs[vga_address] = data>>8; | |
| 364 | logerror("VGA reg %02x with data %02x\n",vga_address,vga_regs[vga_address]); | |
| 365 | } | |
| 366 | else | |
| 367 | logerror("Warning: used undefined VGA reg %02x with data %02x\n",vga_address,data>>8); | |
| 368 | } | |
| 369 | } | |
| 370 | ||
| 371 | 46 | static ADDRESS_MAP_START( pcat_io, ADDRESS_SPACE_IO, 32 ) |
| 372 | AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8("dma8237_1", i8237_r, i8237_w, 0xffffffff) | |
| 373 | AM_RANGE(0x0020, 0x003f) AM_DEVREADWRITE8("pic8259_1", pic8259_r, pic8259_w, 0xffffffff) | |
| 374 | AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8("pit8254", pit8253_r, pit8253_w, 0xffffffff) | |
| 375 | AM_RANGE(0x0060, 0x006f) AM_READWRITE(kbdc8042_32le_r, kbdc8042_32le_w) | |
| 47 | AM_IMPORT_FROM(pcat32_io_common) | |
| 376 | 48 | AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE8_MODERN("rtc", mc146818_device, read, write, 0xffffffff) |
| 377 | AM_RANGE(0x0080, 0x009f) AM_READWRITE8(dma_page_select_r,dma_page_select_w, 0xffffffff) | |
| 378 | AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8("pic8259_2", pic8259_r, pic8259_w, 0xffffffff) | |
| 379 | AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE8("dma8237_2", i8237_r, i8237_w, 0xffff) | |
| 380 | AM_RANGE(0x0220, 0x022f) AM_RAM //Sound card, according to ROMs | |
| 381 | AM_RANGE(0x0278, 0x027f) AM_RAM //parallel port 2 | |
| 382 | AM_RANGE(0x0378, 0x037f) AM_RAM //parallel port | |
| 383 | AM_RANGE(0x03c0, 0x03c3) AM_RAM | |
| 384 | AM_RANGE(0x03cc, 0x03cf) AM_RAM | |
| 385 | AM_RANGE(0x03b4, 0x03b7) AM_WRITE(vga_regs_w) | |
| 386 | AM_RANGE(0x03c4, 0x03c7) AM_RAM //vga regs | |
| 387 | AM_RANGE(0x03c8, 0x03cb) AM_WRITE(vga_ramdac_w) | |
| 388 | AM_RANGE(0x03b8, 0x03bb) AM_READ(kludge_r) //hv_retrace | |
| 389 | AM_RANGE(0x03c8, 0x03cb) AM_READ(kludge_r) //hv_retrace | |
| 390 | AM_RANGE(0x03d4, 0x03d7) AM_WRITE(vga_regs_w) | |
| 391 | AM_RANGE(0x03d8, 0x03db) AM_READ(kludge_r) | |
| 392 | AM_RANGE(0x03bc, 0x03bf) AM_RAM //parallel port 3 | |
| 393 | 49 | ADDRESS_MAP_END |
| 394 | 50 | |
| 395 | 51 | #define AT_KEYB_HELPER(bit, text, key1) \ |
| r10613 | r10614 | |
| 426 | 82 | PORT_START("pc_keyboard_7") |
| 427 | 83 | INPUT_PORTS_END |
| 428 | 84 | |
| 429 | static | |
| 85 | static void pcat_dyn_set_keyb_int(running_machine *machine, int state) | |
| 430 | 86 | { |
| 431 | MAKE_RGB(0x00,0x00,0x00), | |
| 432 | MAKE_RGB(0x00,0x00,0xaa), | |
| 433 | MAKE_RGB(0x00,0xaa,0x00), | |
| 434 | MAKE_RGB(0x00,0xaa,0xaa), | |
| 435 | MAKE_RGB(0xaa,0x00,0x00), | |
| 436 | MAKE_RGB(0xaa,0x00,0xaa), | |
| 437 | MAKE_RGB(0xaa,0xaa,0x00), | |
| 438 | MAKE_RGB(0xaa,0xaa,0xaa), | |
| 439 | MAKE_RGB(0x55,0x55,0x55), | |
| 440 | MAKE_RGB(0x55,0x55,0xff), | |
| 441 | MAKE_RGB(0x55,0xff,0x55), | |
| 442 | MAKE_RGB(0x55,0xff,0xff), | |
| 443 | MAKE_RGB(0xff,0x55,0x55), | |
| 444 | MAKE_RGB(0xff,0x55,0xff), | |
| 445 | MAKE_RGB(0xff,0xff,0x55), | |
| 446 | MAKE_RGB(0xff,0xff,0xff) | |
| 447 | }; | |
| 87 | pic8259_ir1_w(machine->device("pic8259_1"), state); | |
| 88 | } | |
| 448 | 89 | |
| 449 | static | |
| 90 | static const struct pc_vga_interface vga_interface = | |
| 450 | 91 | { |
| 451 | /*Note:palette colors are 6bpp... | |
| 452 | xxxx xx-- | |
| 453 | */ | |
| 454 | int ix,iy; | |
| 92 | NULL, | |
| 93 | NULL, | |
| 94 | NULL, | |
| 95 | ADDRESS_SPACE_IO, | |
| 96 | 0x0000 | |
| 97 | }; | |
| 455 | 98 | |
| 456 | for(ix=0;ix<0x300;ix++) | |
| 457 | palette_set_color(machine, ix,MAKE_RGB(0x00,0x00,0x00)); | |
| 458 | ||
| 459 | //regular colors | |
| 460 | for(iy=0;iy<0x10;iy++) | |
| 461 | { | |
| 462 | for(ix=0;ix<0x10;ix++) | |
| 463 | { | |
| 464 | palette_set_color(machine,(ix*2)+1+(iy*0x20),defcolors[ix]); | |
| 465 | palette_set_color(machine,(ix*2)+0+(iy*0x20),defcolors[iy]); | |
| 466 | } | |
| 467 | } | |
| 468 | ||
| 469 | //bitmap mode | |
| 470 | for(ix=0;ix<0x10;ix++) | |
| 471 | palette_set_color(machine, 0x200+ix,defcolors[ix]); | |
| 472 | //todo: 256 colors | |
| 99 | static void set_gate_a20(running_machine *machine, int a20) | |
| 100 | { | |
| 101 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_A20, a20); | |
| 473 | 102 | } |
| 474 | 103 | |
| 475 | static void | |
| 104 | static void | |
| 476 | 105 | { |
| 477 | pic8259_ir1_w( | |
| 106 | pic8259_ir1_w(m | |
| 478 | 107 | } |
| 479 | 108 | |
| 109 | static int pcat_dyn_get_out2(running_machine *machine) { | |
| 110 | return pit8253_get_output(machine->device("pit8254"), 2 ); | |
| 111 | } | |
| 480 | 112 | |
| 113 | ||
| 114 | static const struct kbdc8042_interface at8042 = | |
| 115 | { | |
| 116 | KBDC8042_AT386, set_gate_a20, keyboard_interrupt, pcat_dyn_get_out2 | |
| 117 | }; | |
| 118 | ||
| 481 | 119 | static MACHINE_START( pcat_dyn ) |
| 482 | 120 | { |
| 483 | // bank = -1; | |
| 484 | // lastvalue = -1; | |
| 485 | // hv_blank = 0; | |
| 486 | cpu_set_irq_callback(machine->device("maincpu"), irq_callback); | |
| 487 | pcat_dyn_devices.pit8253 = machine->device( "pit8254" ); | |
| 488 | pcat_dyn_devices.pic8259_1 = machine->device( "pic8259_1" ); | |
| 489 | pcat_dyn_devices.pic8259_2 = machine->device( "pic8259_2" ); | |
| 490 | pcat_dyn_devices.dma8237_1 = machine->device( "dma8237_1" ); | |
| 491 | pcat_dyn_devices.dma8237_2 = machine->device( "dma8237_2" ); | |
| 492 | 121 | |
| 122 | cpu_set_irq_callback(machine->device("maincpu"), pcat_irq_callback); | |
| 493 | 123 | init_pc_common(machine, PCCOMMON_KEYBOARD_AT, pcat_dyn_set_keyb_int); |
| 124 | kbdc8042_init(machine, &at8042); | |
| 494 | 125 | } |
| 495 | 126 | |
| 496 | static const gfx_layout CGA_charlayout = | |
| 497 | { | |
| 498 | 8,8, | |
| 499 | 256, | |
| 500 | 1, | |
| 501 | { 0 }, | |
| 502 | { 0,1,2,3,4,5,6,7 }, | |
| 503 | { 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8 }, | |
| 504 | 8*8 | |
| 505 | }; | |
| 506 | ||
| 507 | static GFXDECODE_START( pcat_dyn ) | |
| 508 | GFXDECODE_ENTRY( "video_bios", 0x09cb*8, CGA_charlayout, 0, 256 ) | |
| 509 | // there's a 8x16 charset just after the 8x8 one | |
| 510 | GFXDECODE_END | |
| 511 | ||
| 512 | 127 | static MACHINE_CONFIG_START( pcat_dyn, driver_device ) |
| 513 | 128 | /* basic machine hardware */ |
| 514 | 129 | MCFG_CPU_ADD("maincpu", I486, 40000000) /* Am486 DX-40 */ |
| r10613 | r10614 | |
| 516 | 131 | MCFG_CPU_IO_MAP(pcat_io) |
| 517 | 132 | |
| 518 | 133 | /* video hardware */ |
| 519 | MCFG_SCREEN_ADD("screen", RASTER) | |
| 520 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) | |
| 134 | MCFG_FRAGMENT_ADD( pcvideo_vga ) | |
| 135 | MCFG_SCREEN_MODIFY("screen") | |
| 521 | 136 | MCFG_SCREEN_REFRESH_RATE(60) |
| 522 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 523 | MCFG_SCREEN_SIZE(64*8, 32*8) | |
| 524 | MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1) | |
| 525 | MCFG_SCREEN_UPDATE(pcat_dyn) | |
| 526 | MCFG_GFXDECODE( pcat_dyn ) | |
| 527 | ||
| 137 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ | |
| 528 | 138 | MCFG_MACHINE_START(pcat_dyn) |
| 529 | 139 | MCFG_MC146818_ADD( "rtc", MC146818_STANDARD ) |
| 530 | 140 | |
| 531 | // MCFG_FRAGMENT_ADD( at_kbdc8042 ) | |
| 532 | MCFG_PIC8259_ADD( "pic8259_1", pic8259_1_config ) | |
| 533 | MCFG_PIC8259_ADD( "pic8259_2", pic8259_2_config ) | |
| 534 | MCFG_I8237_ADD( "dma8237_1", XTAL_14_31818MHz/3, dma8237_1_config ) | |
| 535 | MCFG_I8237_ADD( "dma8237_2", XTAL_14_31818MHz/3, dma8237_2_config ) | |
| 536 | MCFG_PIT8254_ADD( "pit8254", at_pit8254_config ) | |
| 537 | ||
| 538 | MCFG_PALETTE_INIT(pcat_286) | |
| 539 | ||
| 540 | MCFG_PALETTE_LENGTH(0x300) | |
| 541 | ||
| 542 | MCFG_VIDEO_START(pcat_dyn) | |
| 141 | MCFG_FRAGMENT_ADD( pcat_common ) | |
| 543 | 142 | MACHINE_CONFIG_END |
| 544 | 143 | |
| 545 | 144 | /*************************************** |
| r10613 | r10614 | |
| 581 | 180 | ROM_LOAD("prom.7", 0xe0000, 0x02000, CRC(154c8092) SHA1(4439ee82f36d5d5c334494ba7bb4848e839213a7)) |
| 582 | 181 | ROM_END |
| 583 | 182 | |
| 584 | GAME( 1995, toursol, 0, pcat_dyn, pcat_dyn, 0, ROT0, "Dynamo", "Tournament Solitaire (V1.06, 08/03/95)", GAME_NOT_WORKING|GAME_NO_SOUND ) | |
| 585 | GAME( 1995, toursol1, toursol, pcat_dyn, pcat_dyn, 0, ROT0, "Dynamo", "Tournament Solitaire (V1.04, 06/22/95)", GAME_NOT_WORKING|GAME_NO_SOUND ) | |
| 183 | static DRIVER_INIT(pcat_dyn) | |
| 184 | { | |
| 185 | pc_vga_init(machine, &vga_interface, NULL); | |
| 186 | } | |
| 586 | 187 | |
| 188 | GAME( 1995, toursol, 0, pcat_dyn, pcat_dyn, pcat_dyn, ROT0, "Dynamo", "Tournament Solitaire (V1.06, 08/03/95)", GAME_NOT_WORKING|GAME_NO_SOUND ) | |
| 189 | GAME( 1995, toursol1, toursol, pcat_dyn, pcat_dyn, pcat_dyn, ROT0, "Dynamo", "Tournament Solitaire (V1.04, 06/22/95)", GAME_NOT_WORKING|GAME_NO_SOUND ) |
| r10613 | r10614 | |
|---|---|---|
| 66 | 66 | ROM_END |
| 67 | 67 | |
| 68 | 68 | /*------------------------------------------------------------------- |
| 69 | / Austin Powers | |
| 69 | / Austin Powers (3.01) | |
| 70 | 70 | /-------------------------------------------------------------------*/ |
| 71 | ROM_START(aust | |
| 71 | ROM_START(aust301) | |
| 72 | 72 | ROM_REGION(0x80000, "user1", 0) |
| 73 | ROM_LOAD("apcpu.302", 0x00000, 0x20000, CRC(2920b59b) SHA1(280cebbb39980fbcfd91fc1cf87a40ad926ffecb)) // ver 3.02 | |
| 74 | //ROM_LOAD("apcpu.300", 0x00000, 0x20000, CRC(a06b2b03) SHA1(4c36212b43fdc497773425e586f64c3064e7000c)) // ver 3.00 | |
| 75 | //ROM_LOAD("apcpu.201", 0x00000, 0x20000, CRC(a4ddcdca) SHA1(c1eb1ae3b9c9b10410d107165f3bddaa514c2113)) // ver 2.01 | |
| 73 | ROM_LOAD("apcpu.301", 0x00000, 0x20000, CRC(868d1f38) SHA1(df08b48437f88e66c4caa80602c28a2223f180b9)) | |
| 76 | 74 | ROM_RELOAD(0x20000, 0x20000) |
| 77 | 75 | ROM_RELOAD(0x40000, 0x20000) |
| 78 | 76 | ROM_RELOAD(0x60000, 0x20000) |
| r10613 | r10614 | |
| 81 | 79 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) |
| 82 | 80 | ROM_REGION(0x80000, "gfx3", 0) |
| 83 | 81 | ROM_LOAD("apdsp-a.300", 0x00000, 0x80000, CRC(ecf2c3bb) SHA1(952a7873067b8c70043a38a39a8f65089103336b)) // ver 3.00 |
| 84 | //ROM_LOAD("apdsp-a.200", 0x00000, 0x80000, CRC(f3ca7fca) SHA1(b6b702ad7af75b3010a280adb99e4ee484a03242)) // ver 2.00 | |
| 85 | 82 | ROM_REGION(0x010000, "cpu2", 0) |
| 86 | 83 | ROM_LOAD("apsndu7.100",0x0000,0x10000,CRC(d0e79d59) SHA1(7c3f1fa79ff193a976986339a551e3d03208550f)) |
| 87 | 84 | ROM_REGION(0x400000, "sound1", 0) |
| r10613 | r10614 | |
| 90 | 87 | ROM_LOAD("apsndu36.100", 0x200000, 0x100000, CRC(f70f2828) SHA1(9efbed4f68c22eb26e9100afaca5ebe85a97b605)) |
| 91 | 88 | ROM_LOAD("apsndu37.100", 0x300000, 0x100000, CRC(ddf0144b) SHA1(c2a56703a41ee31841993d63385491259d5a13f8)) |
| 92 | 89 | ROM_END |
| 90 | ||
| 91 | /*------------------------------------------------------------------- | |
| 92 | / Austin Powers (3.00) | |
| 93 | /-------------------------------------------------------------------*/ | |
| 94 | ROM_START(aust300) | |
| 95 | ROM_REGION(0x80000, "user1", 0) | |
| 96 | ROM_LOAD("apcpu.300", 0x00000, 0x20000, CRC(a06b2b03) SHA1(4c36212b43fdc497773425e586f64c3064e7000c)) | |
| 97 | ROM_RELOAD(0x20000, 0x20000) | |
| 98 | ROM_RELOAD(0x40000, 0x20000) | |
| 99 | ROM_RELOAD(0x60000, 0x20000) | |
| 100 | ROM_REGION(0x10000, "maincpu", 0) | |
| 101 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 102 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 103 | ROM_REGION(0x80000, "gfx3", 0) | |
| 104 | ROM_LOAD("apdsp-a.300", 0x00000, 0x80000, CRC(ecf2c3bb) SHA1(952a7873067b8c70043a38a39a8f65089103336b)) | |
| 105 | ROM_REGION(0x010000, "cpu2", 0) | |
| 106 | ROM_LOAD("apsndu7.100",0x0000,0x10000,CRC(d0e79d59) SHA1(7c3f1fa79ff193a976986339a551e3d03208550f)) | |
| 107 | ROM_REGION(0x400000, "sound1", 0) | |
| 108 | ROM_LOAD("apsndu17.100", 0x000000, 0x100000, CRC(c1e33fee) SHA1(5a3581584cc1a841d884de4628f7b65d8670f96a)) | |
| 109 | ROM_LOAD("apsndu21.100", 0x100000, 0x100000, CRC(07c3e077) SHA1(d48020f7da400c3682035d537289ce9a30732d74)) | |
| 110 | ROM_LOAD("apsndu36.100", 0x200000, 0x100000, CRC(f70f2828) SHA1(9efbed4f68c22eb26e9100afaca5ebe85a97b605)) | |
| 111 | ROM_LOAD("apsndu37.100", 0x300000, 0x100000, CRC(ddf0144b) SHA1(c2a56703a41ee31841993d63385491259d5a13f8)) | |
| 112 | ROM_END | |
| 113 | ||
| 114 | /*------------------------------------------------------------------- | |
| 115 | / Austin Powers (2.01) | |
| 116 | /-------------------------------------------------------------------*/ | |
| 117 | ROM_START(aust201) | |
| 118 | ROM_REGION(0x80000, "user1", 0) | |
| 119 | ROM_LOAD("apcpu.201", 0x00000, 0x20000, CRC(a4ddcdca) SHA1(c1eb1ae3b9c9b10410d107165f3bddaa514c2113)) | |
| 120 | ROM_RELOAD(0x20000, 0x20000) | |
| 121 | ROM_RELOAD(0x40000, 0x20000) | |
| 122 | ROM_RELOAD(0x60000, 0x20000) | |
| 123 | ROM_REGION(0x10000, "maincpu", 0) | |
| 124 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 125 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 126 | ROM_REGION(0x80000, "gfx3", 0) | |
| 127 | ROM_LOAD("apdsp-a.200", 0x00000, 0x80000, CRC(f3ca7fca) SHA1(b6b702ad7af75b3010a280adb99e4ee484a03242)) | |
| 128 | ROM_REGION(0x010000, "cpu2", 0) | |
| 129 | ROM_LOAD("apsndu7.100",0x0000,0x10000,CRC(d0e79d59) SHA1(7c3f1fa79ff193a976986339a551e3d03208550f)) | |
| 130 | ROM_REGION(0x400000, "sound1", 0) | |
| 131 | ROM_LOAD("apsndu17.100", 0x000000, 0x100000, CRC(c1e33fee) SHA1(5a3581584cc1a841d884de4628f7b65d8670f96a)) | |
| 132 | ROM_LOAD("apsndu21.100", 0x100000, 0x100000, CRC(07c3e077) SHA1(d48020f7da400c3682035d537289ce9a30732d74)) | |
| 133 | ROM_LOAD("apsndu36.100", 0x200000, 0x100000, CRC(f70f2828) SHA1(9efbed4f68c22eb26e9100afaca5ebe85a97b605)) | |
| 134 | ROM_LOAD("apsndu37.100", 0x300000, 0x100000, CRC(ddf0144b) SHA1(c2a56703a41ee31841993d63385491259d5a13f8)) | |
| 135 | ROM_END | |
| 136 | ||
| 137 | /*------------------------------------------------------------------- | |
| 138 | / Austin Powers (3.02) | |
| 139 | /-------------------------------------------------------------------*/ | |
| 140 | ROM_START(austin) | |
| 141 | ROM_REGION(0x80000, "user1", 0) | |
| 142 | ROM_LOAD("apcpu.302", 0x00000, 0x20000, CRC(2920b59b) SHA1(280cebbb39980fbcfd91fc1cf87a40ad926ffecb)) | |
| 143 | ROM_RELOAD(0x20000, 0x20000) | |
| 144 | ROM_RELOAD(0x40000, 0x20000) | |
| 145 | ROM_RELOAD(0x60000, 0x20000) | |
| 146 | ROM_REGION(0x10000, "maincpu", 0) | |
| 147 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 148 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 149 | ROM_REGION(0x80000, "gfx3", 0) | |
| 150 | ROM_LOAD("apdsp-a.300", 0x00000, 0x80000, CRC(ecf2c3bb) SHA1(952a7873067b8c70043a38a39a8f65089103336b)) | |
| 151 | ROM_REGION(0x010000, "cpu2", 0) | |
| 152 | ROM_LOAD("apsndu7.100",0x0000,0x10000,CRC(d0e79d59) SHA1(7c3f1fa79ff193a976986339a551e3d03208550f)) | |
| 153 | ROM_REGION(0x400000, "sound1", 0) | |
| 154 | ROM_LOAD("apsndu17.100", 0x000000, 0x100000, CRC(c1e33fee) SHA1(5a3581584cc1a841d884de4628f7b65d8670f96a)) | |
| 155 | ROM_LOAD("apsndu21.100", 0x100000, 0x100000, CRC(07c3e077) SHA1(d48020f7da400c3682035d537289ce9a30732d74)) | |
| 156 | ROM_LOAD("apsndu36.100", 0x200000, 0x100000, CRC(f70f2828) SHA1(9efbed4f68c22eb26e9100afaca5ebe85a97b605)) | |
| 157 | ROM_LOAD("apsndu37.100", 0x300000, 0x100000, CRC(ddf0144b) SHA1(c2a56703a41ee31841993d63385491259d5a13f8)) | |
| 158 | ROM_END | |
| 93 | 159 | ROM_START(austnew) |
| 94 | 160 | ROM_REGION(0x80000, "user1", 0) |
| 95 | 161 | ROM_LOAD("apcpu.302", 0x00000, 0x20000, CRC(2920b59b) SHA1(280cebbb39980fbcfd91fc1cf87a40ad926ffecb)) |
| r10613 | r10614 | |
| 769 | 835 | /-------------------------------------------------------------------*/ |
| 770 | 836 | |
| 771 | 837 | /*------------------------------------------------------------------- |
| 772 | / Monopoly | |
| 838 | / Monopoly (3.20) | |
| 773 | 839 | /-------------------------------------------------------------------*/ |
| 774 | 840 | ROM_START(monopolp) |
| 775 | 841 | ROM_REGION(0x80000, "user1", 0) |
| 776 | ROM_LOAD("moncpu.320", 0x00000, 0x20000, CRC(6c107c8b) SHA1(236d85b971c70a30e663787d643e6d589591d582)) // ver 3.20 | |
| 777 | //ROM_LOAD("moncpu.301", 0x00000, 0x20000, CRC(24978872) SHA1(48ef94fd720cdafc61f8de5efd5c6b6731237b18)) // ver 3.01 | |
| 778 | //ROM_LOAD("moncpu.233", 0x00000, 0x20000, CRC(f20a5ca6) SHA1(12ae56bd149aa6635c19f4dd73580db550b26963)) // ver 2.33 | |
| 842 | ROM_LOAD("moncpu.320", 0x00000, 0x20000, CRC(6c107c8b) SHA1(236d85b971c70a30e663787d643e6d589591d582)) | |
| 779 | 843 | ROM_RELOAD(0x20000, 0x20000) |
| 780 | 844 | ROM_RELOAD(0x40000, 0x20000) |
| 781 | 845 | ROM_RELOAD(0x60000, 0x20000) |
| r10613 | r10614 | |
| 783 | 847 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) |
| 784 | 848 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) |
| 785 | 849 | ROM_REGION(0x80000, "gfx3", 0) |
| 786 | ROM_LOAD("mondsp-a.301", 0x00000, 0x80000, CRC(c4e2e032) SHA1(691f7b6ed0616338683f7e3f316d64a70db58dd4)) // ver 3.01 | |
| 787 | //ROM_LOAD("mondsp-a.206", 0x00000, 0x80000, CRC(6df6e158) SHA1(d3a9be2dc189b44b9e4b9f77f5011ed931df5634)) // ver 2.06 | |
| 850 | ROM_LOAD("mondsp-a.301", 0x00000, 0x80000, CRC(c4e2e032) SHA1(691f7b6ed0616338683f7e3f316d64a70db58dd4)) | |
| 788 | 851 | ROM_REGION(0x010000, "cpu2", 0) |
| 789 | 852 | ROM_LOAD("mnsndu7.100",0x0000,0x10000,CRC(400442e7) SHA1(d6c075dc439d5366b7ae71b5a523b86543b1ecd6)) |
| 790 | 853 | ROM_REGION(0x400000, "sound1", 0) |
| r10613 | r10614 | |
| 793 | 856 | ROM_LOAD("mnsndu36.100", 0x200000, 0x100000, CRC(c845aa97) SHA1(2632aa8c5576b7afcb96693fa524c7d0350ac9a8)) |
| 794 | 857 | ROM_END |
| 795 | 858 | |
| 796 | ROM_START(monopole) | |
| 859 | /*------------------------------------------------------------------- | |
| 860 | / Monopoly (3.03) | |
| 861 | /-------------------------------------------------------------------*/ | |
| 862 | ROM_START(monop303) | |
| 797 | 863 | ROM_REGION(0x80000, "user1", 0) |
| 798 | 864 | ROM_LOAD("moncpu.303", 0x00000, 0x20000, CRC(4a66c9e4) SHA1(a368b0ced32f1017e781a59108670b979b50c9d7)) |
| 799 | 865 | ROM_RELOAD(0x20000, 0x20000) |
| r10613 | r10614 | |
| 811 | 877 | ROM_LOAD("mnsndu21.100", 0x100000, 0x100000, CRC(e0727e1f) SHA1(2093dba6e2f59cd1d1fc49c8d995b603ea0913ba)) |
| 812 | 878 | ROM_LOAD("mnsndu36.100", 0x200000, 0x100000, CRC(c845aa97) SHA1(2632aa8c5576b7afcb96693fa524c7d0350ac9a8)) |
| 813 | 879 | ROM_END |
| 880 | ||
| 881 | /*------------------------------------------------------------------- | |
| 882 | / Monopoly (3.01) | |
| 883 | /-------------------------------------------------------------------*/ | |
| 884 | ROM_START(monop301) | |
| 885 | ROM_REGION(0x80000, "user1", 0) | |
| 886 | ROM_LOAD("moncpu.301", 0x00000, 0x20000, CRC(24978872) SHA1(48ef94fd720cdafc61f8de5efd5c6b6731237b18)) | |
| 887 | ROM_RELOAD(0x20000, 0x20000) | |
| 888 | ROM_RELOAD(0x40000, 0x20000) | |
| 889 | ROM_RELOAD(0x60000, 0x20000) | |
| 890 | ROM_REGION(0x10000, "maincpu", 0) | |
| 891 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 892 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 893 | ROM_REGION(0x80000, "gfx3", 0) | |
| 894 | ROM_LOAD("mondsp-a.301", 0x00000, 0x80000, CRC(c4e2e032) SHA1(691f7b6ed0616338683f7e3f316d64a70db58dd4)) | |
| 895 | ROM_REGION(0x010000, "cpu2", 0) | |
| 896 | ROM_LOAD("mnsndu7.100",0x0000,0x10000,CRC(400442e7) SHA1(d6c075dc439d5366b7ae71b5a523b86543b1ecd6)) | |
| 897 | ROM_REGION(0x400000, "sound1", 0) | |
| 898 | ROM_LOAD("mnsndu17.100", 0x000000, 0x100000, CRC(f9bc55e8) SHA1(7dc41521305021961927ebde4dcf22611e3d622d)) | |
| 899 | ROM_LOAD("mnsndu21.100", 0x100000, 0x100000, CRC(e0727e1f) SHA1(2093dba6e2f59cd1d1fc49c8d995b603ea0913ba)) | |
| 900 | ROM_LOAD("mnsndu36.100", 0x200000, 0x100000, CRC(c845aa97) SHA1(2632aa8c5576b7afcb96693fa524c7d0350ac9a8)) | |
| 901 | ROM_END | |
| 902 | ||
| 903 | /*------------------------------------------------------------------- | |
| 904 | / Monopoly (2.51) | |
| 905 | /-------------------------------------------------------------------*/ | |
| 906 | ROM_START(monop251) | |
| 907 | ROM_REGION(0x80000, "user1", 0) | |
| 908 | ROM_LOAD("moncpu.251", 0x00000, 0x20000, CRC(0645cfae) SHA1(d979234150b7fb62718debbeeeca1466a6c0344f)) | |
| 909 | ROM_RELOAD(0x20000, 0x20000) | |
| 910 | ROM_RELOAD(0x40000, 0x20000) | |
| 911 | ROM_RELOAD(0x60000, 0x20000) | |
| 912 | ROM_REGION(0x10000, "maincpu", 0) | |
| 913 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 914 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 915 | ROM_REGION(0x80000, "gfx3", 0) | |
| 916 | ROM_LOAD("mondsp-a.206", 0x00000, 0x80000, CRC(6df6e158) SHA1(d3a9be2dc189b44b9e4b9f77f5011ed931df5634)) | |
| 917 | ROM_REGION(0x010000, "cpu2", 0) | |
| 918 | ROM_LOAD("mnsndu7.100",0x0000,0x10000,CRC(400442e7) SHA1(d6c075dc439d5366b7ae71b5a523b86543b1ecd6)) | |
| 919 | ROM_REGION(0x400000, "sound1", 0) | |
| 920 | ROM_LOAD("mnsndu17.100", 0x000000, 0x100000, CRC(f9bc55e8) SHA1(7dc41521305021961927ebde4dcf22611e3d622d)) | |
| 921 | ROM_LOAD("mnsndu21.100", 0x100000, 0x100000, CRC(e0727e1f) SHA1(2093dba6e2f59cd1d1fc49c8d995b603ea0913ba)) | |
| 922 | ROM_LOAD("mnsndu36.100", 0x200000, 0x100000, CRC(c845aa97) SHA1(2632aa8c5576b7afcb96693fa524c7d0350ac9a8)) | |
| 923 | ROM_END | |
| 924 | ||
| 925 | /*------------------------------------------------------------------- | |
| 926 | / Monopoly (2.33) | |
| 927 | /-------------------------------------------------------------------*/ | |
| 928 | ROM_START(monop233) | |
| 929 | ROM_REGION(0x80000, "user1", 0) | |
| 930 | ROM_LOAD("moncpu.233", 0x00000, 0x20000, CRC(f20a5ca6) SHA1(12ae56bd149aa6635c19f4dd73580db550b26963)) | |
| 931 | ROM_RELOAD(0x20000, 0x20000) | |
| 932 | ROM_RELOAD(0x40000, 0x20000) | |
| 933 | ROM_RELOAD(0x60000, 0x20000) | |
| 934 | ROM_REGION(0x10000, "maincpu", 0) | |
| 935 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 936 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 937 | ROM_REGION(0x80000, "gfx3", 0) | |
| 938 | ROM_LOAD("mondsp-a.203", 0x00000, 0x80000, CRC(6e4678fb) SHA1(c0f41f01e9e20e741f1b13d3bd6e824486ba9a0a)) | |
| 939 | ROM_REGION(0x010000, "cpu2", 0) | |
| 940 | ROM_LOAD("mnsndu7.100",0x0000,0x10000,CRC(400442e7) SHA1(d6c075dc439d5366b7ae71b5a523b86543b1ecd6)) | |
| 941 | ROM_REGION(0x400000, "sound1", 0) | |
| 942 | ROM_LOAD("mnsndu17.100", 0x000000, 0x100000, CRC(f9bc55e8) SHA1(7dc41521305021961927ebde4dcf22611e3d622d)) | |
| 943 | ROM_LOAD("mnsndu21.100", 0x100000, 0x100000, CRC(e0727e1f) SHA1(2093dba6e2f59cd1d1fc49c8d995b603ea0913ba)) | |
| 944 | ROM_LOAD("mnsndu36.100", 0x200000, 0x100000, CRC(c845aa97) SHA1(2632aa8c5576b7afcb96693fa524c7d0350ac9a8)) | |
| 945 | ROM_END | |
| 946 | ||
| 947 | /*------------------------------------------------------------------- | |
| 948 | / Monopoly (3.20) (ARM7 Sound Board) | |
| 949 | /-------------------------------------------------------------------*/ | |
| 814 | 950 | ROM_START(mononew) |
| 815 | 951 | ROM_REGION(0x80000, "user1", 0) |
| 816 | 952 | ROM_LOAD("moncpu.320", 0x00000, 0x20000, CRC(6c107c8b) SHA1(236d85b971c70a30e663787d643e6d589591d582)) |
| r10613 | r10614 | |
| 832 | 968 | ROM_LOAD("mnsndu21.100", 0x100000, 0x100000, CRC(e0727e1f) SHA1(2093dba6e2f59cd1d1fc49c8d995b603ea0913ba)) |
| 833 | 969 | ROM_LOAD("mnsndu36.100", 0x200000, 0x100000, CRC(c845aa97) SHA1(2632aa8c5576b7afcb96693fa524c7d0350ac9a8)) |
| 834 | 970 | ROM_END |
| 971 | ||
| 972 | /*------------------------------------------------------------------- | |
| 973 | / Monopoly (France) | |
| 974 | /-------------------------------------------------------------------*/ | |
| 835 | 975 | ROM_START(monopolf) |
| 836 | 976 | ROM_REGION(0x80000, "user1", 0) |
| 837 | 977 | ROM_LOAD("moncpu.320", 0x00000, 0x20000, CRC(6c107c8b) SHA1(236d85b971c70a30e663787d643e6d589591d582)) |
| r10613 | r10614 | |
| 850 | 990 | ROM_LOAD("mnsndu21.100", 0x100000, 0x100000, CRC(e0727e1f) SHA1(2093dba6e2f59cd1d1fc49c8d995b603ea0913ba)) |
| 851 | 991 | ROM_LOAD("mnsndu36.100", 0x200000, 0x100000, CRC(c845aa97) SHA1(2632aa8c5576b7afcb96693fa524c7d0350ac9a8)) |
| 852 | 992 | ROM_END |
| 993 | ||
| 994 | /*------------------------------------------------------------------- | |
| 995 | / Monopoly (France) | |
| 996 | /-------------------------------------------------------------------*/ | |
| 853 | 997 | ROM_START(monopolg) |
| 854 | 998 | ROM_REGION(0x80000, "user1", 0) |
| 855 | 999 | ROM_LOAD("moncpu.320", 0x00000, 0x20000, CRC(6c107c8b) SHA1(236d85b971c70a30e663787d643e6d589591d582)) |
| r10613 | r10614 | |
| 868 | 1012 | ROM_LOAD("mnsndu21.100", 0x100000, 0x100000, CRC(e0727e1f) SHA1(2093dba6e2f59cd1d1fc49c8d995b603ea0913ba)) |
| 869 | 1013 | ROM_LOAD("mnsndu36.100", 0x200000, 0x100000, CRC(c845aa97) SHA1(2632aa8c5576b7afcb96693fa524c7d0350ac9a8)) |
| 870 | 1014 | ROM_END |
| 1015 | ||
| 1016 | /*------------------------------------------------------------------- | |
| 1017 | / Monopoly (Italy) | |
| 1018 | /-------------------------------------------------------------------*/ | |
| 871 | 1019 | ROM_START(monopoli) |
| 872 | 1020 | ROM_REGION(0x80000, "user1", 0) |
| 873 | 1021 | ROM_LOAD("moncpu.320", 0x00000, 0x20000, CRC(6c107c8b) SHA1(236d85b971c70a30e663787d643e6d589591d582)) |
| r10613 | r10614 | |
| 886 | 1034 | ROM_LOAD("mnsndu21.100", 0x100000, 0x100000, CRC(e0727e1f) SHA1(2093dba6e2f59cd1d1fc49c8d995b603ea0913ba)) |
| 887 | 1035 | ROM_LOAD("mnsndu36.100", 0x200000, 0x100000, CRC(c845aa97) SHA1(2632aa8c5576b7afcb96693fa524c7d0350ac9a8)) |
| 888 | 1036 | ROM_END |
| 1037 | ||
| 1038 | /*------------------------------------------------------------------- | |
| 1039 | / Monopoly (Spain) | |
| 1040 | /-------------------------------------------------------------------*/ | |
| 889 | 1041 | ROM_START(monopoll) |
| 890 | 1042 | ROM_REGION(0x80000, "user1", 0) |
| 891 | 1043 | ROM_LOAD("moncpu.320", 0x00000, 0x20000, CRC(6c107c8b) SHA1(236d85b971c70a30e663787d643e6d589591d582)) |
| r10613 | r10614 | |
| 934 | 1086 | /-------------------------------------------------------------------*/ |
| 935 | 1087 | ROM_START(playboys) |
| 936 | 1088 | ROM_REGION(0x80000, "user1", 0) |
| 937 | ROM_LOAD("pbcpu.500", 0x00000, 0x20000, CRC(e4d924ae) SHA1(2aab64eee57e9569c3cc1bde28cda69ff4cacc69)) // ver 5.00 | |
| 938 | //ROM_LOAD("pbcpu.303", 0x00000, 0x20000, CRC(6a6f6aab) SHA1(cac5d68d699db4016244ffd56355e2834be3da1f)) // ver 3.03 | |
| 939 | //ROM_LOAD("pbcpu.300", 0x00000, 0x20000, CRC(d7e5bada) SHA1(e4d5bc015751a559eb95acb6da04246b7418eaf5)) // ver 3.00 | |
| 1089 | ROM_LOAD("pbcpu.500", 0x00000, 0x20000, CRC(e4d924ae) SHA1(2aab64eee57e9569c3cc1bde28cda69ff4cacc69)) | |
| 940 | 1090 | ROM_RELOAD(0x20000, 0x20000) |
| 941 | 1091 | ROM_RELOAD(0x40000, 0x20000) |
| 942 | 1092 | ROM_RELOAD(0x60000, 0x20000) |
| r10613 | r10614 | |
| 944 | 1094 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) |
| 945 | 1095 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) |
| 946 | 1096 | ROM_REGION(0x80000, "gfx3", 0) |
| 947 | ROM_LOAD("pbdispa.500", 0x00000, 0x80000, CRC(40450165) SHA1(80295466838cb08fe1499b19a98bf759fb7a306e)) // ver 5.00 | |
| 948 | //ROM_LOAD("pbdispa.300", 0x00000, 0x80000, CRC(2dbb372a) SHA1(b694ae06f380ea9f9730ea6bbfab7f9f7ec7342b)) // ver 3.00 | |
| 1097 | ROM_LOAD("pbdispa.500", 0x00000, 0x80000, CRC(40450165) SHA1(80295466838cb08fe1499b19a98bf759fb7a306e)) | |
| 949 | 1098 | ROM_REGION(0x010000, "cpu2", 0) |
| 950 | 1099 | ROM_LOAD("pbsndu7.102",0x0000,0x10000,CRC(12a68f34) SHA1(f2cd42918dec353883bc465f6302c2d94dcd6b87)) |
| 951 | 1100 | ROM_REGION(0x400000, "sound1", 0) |
| r10613 | r10614 | |
| 954 | 1103 | ROM_LOAD("pbsndu36.100", 0x200000, 0x100000, CRC(d10f14a3) SHA1(972b480c23d484b627ecdce0322c08fe760a127f)) |
| 955 | 1104 | ROM_LOAD("pbsndu37.100", 0x300000, 0x100000, CRC(6642524a) SHA1(9d0c0be5887cf4510c11243ee47b11c08cbae17c)) |
| 956 | 1105 | ROM_END |
| 1106 | ROM_START(playboys_303) | |
| 1107 | ROM_REGION(0x80000, "user1", 0) | |
| 1108 | ROM_LOAD("pbcpu.303", 0x00000, 0x20000, CRC(6a6f6aab) SHA1(cac5d68d699db4016244ffd56355e2834be3da1f)) | |
| 1109 | ROM_RELOAD(0x20000, 0x20000) | |
| 1110 | ROM_RELOAD(0x40000, 0x20000) | |
| 1111 | ROM_RELOAD(0x60000, 0x20000) | |
| 1112 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1113 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1114 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1115 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1116 | ROM_LOAD("pbdispa.300", 0x00000, 0x80000, CRC(2dbb372a) SHA1(b694ae06f380ea9f9730ea6bbfab7f9f7ec7342b)) | |
| 1117 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1118 | ROM_LOAD("pbsndu7.102",0x0000,0x10000,CRC(12a68f34) SHA1(f2cd42918dec353883bc465f6302c2d94dcd6b87)) | |
| 1119 | ROM_REGION(0x400000, "sound1", 0) | |
| 1120 | ROM_LOAD("pbsndu17.100", 0x000000, 0x100000, CRC(f5502fec) SHA1(c8edd56e0c4365dd6b4bef0f1c7cc83ea5fd73d6)) | |
| 1121 | ROM_LOAD("pbsndu21.100", 0x100000, 0x100000, CRC(7869d34f) SHA1(48a051045523c14ca06a7227b34ed9e3818828d0)) | |
| 1122 | ROM_LOAD("pbsndu36.100", 0x200000, 0x100000, CRC(d10f14a3) SHA1(972b480c23d484b627ecdce0322c08fe760a127f)) | |
| 1123 | ROM_LOAD("pbsndu37.100", 0x300000, 0x100000, CRC(6642524a) SHA1(9d0c0be5887cf4510c11243ee47b11c08cbae17c)) | |
| 1124 | ROM_END | |
| 1125 | ROM_START(playboys_300) | |
| 1126 | ROM_REGION(0x80000, "user1", 0) | |
| 1127 | ROM_LOAD("pbcpu.300", 0x00000, 0x20000, CRC(d7e5bada) SHA1(e4d5bc015751a559eb95acb6da04246b7418eaf5)) | |
| 1128 | ROM_RELOAD(0x20000, 0x20000) | |
| 1129 | ROM_RELOAD(0x40000, 0x20000) | |
| 1130 | ROM_RELOAD(0x60000, 0x20000) | |
| 1131 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1132 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1133 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1134 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1135 | ROM_LOAD("pbdispa.300", 0x00000, 0x80000, CRC(2dbb372a) SHA1(b694ae06f380ea9f9730ea6bbfab7f9f7ec7342b)) | |
| 1136 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1137 | ROM_LOAD("pbsndu7.102",0x0000,0x10000,CRC(12a68f34) SHA1(f2cd42918dec353883bc465f6302c2d94dcd6b87)) | |
| 1138 | ROM_REGION(0x400000, "sound1", 0) | |
| 1139 | ROM_LOAD("pbsndu17.100", 0x000000, 0x100000, CRC(f5502fec) SHA1(c8edd56e0c4365dd6b4bef0f1c7cc83ea5fd73d6)) | |
| 1140 | ROM_LOAD("pbsndu21.100", 0x100000, 0x100000, CRC(7869d34f) SHA1(48a051045523c14ca06a7227b34ed9e3818828d0)) | |
| 1141 | ROM_LOAD("pbsndu36.100", 0x200000, 0x100000, CRC(d10f14a3) SHA1(972b480c23d484b627ecdce0322c08fe760a127f)) | |
| 1142 | ROM_LOAD("pbsndu37.100", 0x300000, 0x100000, CRC(6642524a) SHA1(9d0c0be5887cf4510c11243ee47b11c08cbae17c)) | |
| 1143 | ROM_END | |
| 957 | 1144 | ROM_START(playnew) |
| 958 | 1145 | ROM_REGION(0x80000, "user1", 0) |
| 959 | 1146 | ROM_LOAD("pbcpu.500", 0x00000, 0x20000, CRC(e4d924ae) SHA1(2aab64eee57e9569c3cc1bde28cda69ff4cacc69)) |
| r10613 | r10614 | |
| 986 | 1173 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) |
| 987 | 1174 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) |
| 988 | 1175 | ROM_REGION(0x80000, "gfx3", 0) |
| 989 | ROM_LOAD("pbdispf.500", 0x00000, 0x80000, CRC(aedc6c32) SHA1(c930ae1b1308ae641553de34f8249b17f408be56)) // ver 5.00 | |
| 990 | //ROM_LOAD("pbdispf.300", 0x00000, 0x80000, CRC(69ab3bb2) SHA1(59d7ad5eca701d1216200cd489d2d07825a0856e)) // ver 3.00 | |
| 1176 | ROM_LOAD("pbdispf.500", 0x00000, 0x80000, CRC(aedc6c32) SHA1(c930ae1b1308ae641553de34f8249b17f408be56)) | |
| 991 | 1177 | ROM_REGION(0x010000, "cpu2", 0) |
| 992 | 1178 | ROM_LOAD("pbsndu7.102",0x0000,0x10000,CRC(12a68f34) SHA1(f2cd42918dec353883bc465f6302c2d94dcd6b87)) |
| 993 | 1179 | ROM_REGION(0x400000, "sound1", 0) |
| r10613 | r10614 | |
| 996 | 1182 | ROM_LOAD("pbsndu36.100", 0x200000, 0x100000, CRC(d10f14a3) SHA1(972b480c23d484b627ecdce0322c08fe760a127f)) |
| 997 | 1183 | ROM_LOAD("pbsndu37.100", 0x300000, 0x100000, CRC(6642524a) SHA1(9d0c0be5887cf4510c11243ee47b11c08cbae17c)) |
| 998 | 1184 | ROM_END |
| 1185 | ROM_START(playboyf_303) | |
| 1186 | ROM_REGION(0x80000, "user1", 0) | |
| 1187 | ROM_LOAD("pbcpu.303", 0x00000, 0x20000, CRC(6a6f6aab) SHA1(cac5d68d699db4016244ffd56355e2834be3da1f)) | |
| 1188 | ROM_RELOAD(0x20000, 0x20000) | |
| 1189 | ROM_RELOAD(0x40000, 0x20000) | |
| 1190 | ROM_RELOAD(0x60000, 0x20000) | |
| 1191 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1192 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1193 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1194 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1195 | ROM_LOAD("pbdispf.300", 0x00000, 0x80000, CRC(69ab3bb2) SHA1(59d7ad5eca701d1216200cd489d2d07825a0856e)) | |
| 1196 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1197 | ROM_LOAD("pbsndu7.102",0x0000,0x10000,CRC(12a68f34) SHA1(f2cd42918dec353883bc465f6302c2d94dcd6b87)) | |
| 1198 | ROM_REGION(0x400000, "sound1", 0) | |
| 1199 | ROM_LOAD("pbsndu17.100", 0x000000, 0x100000, CRC(f5502fec) SHA1(c8edd56e0c4365dd6b4bef0f1c7cc83ea5fd73d6)) | |
| 1200 | ROM_LOAD("pbsndu21.100", 0x100000, 0x100000, CRC(7869d34f) SHA1(48a051045523c14ca06a7227b34ed9e3818828d0)) | |
| 1201 | ROM_LOAD("pbsndu36.100", 0x200000, 0x100000, CRC(d10f14a3) SHA1(972b480c23d484b627ecdce0322c08fe760a127f)) | |
| 1202 | ROM_LOAD("pbsndu37.100", 0x300000, 0x100000, CRC(6642524a) SHA1(9d0c0be5887cf4510c11243ee47b11c08cbae17c)) | |
| 1203 | ROM_END | |
| 1204 | ROM_START(playboyf_300) | |
| 1205 | ROM_REGION(0x80000, "user1", 0) | |
| 1206 | ROM_LOAD("pbcpu.300", 0x00000, 0x20000, CRC(d7e5bada) SHA1(e4d5bc015751a559eb95acb6da04246b7418eaf5)) | |
| 1207 | ROM_RELOAD(0x20000, 0x20000) | |
| 1208 | ROM_RELOAD(0x40000, 0x20000) | |
| 1209 | ROM_RELOAD(0x60000, 0x20000) | |
| 1210 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1211 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1212 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1213 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1214 | ROM_LOAD("pbdispf.300", 0x00000, 0x80000, CRC(69ab3bb2) SHA1(59d7ad5eca701d1216200cd489d2d07825a0856e)) | |
| 1215 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1216 | ROM_LOAD("pbsndu7.102",0x0000,0x10000,CRC(12a68f34) SHA1(f2cd42918dec353883bc465f6302c2d94dcd6b87)) | |
| 1217 | ROM_REGION(0x400000, "sound1", 0) | |
| 1218 | ROM_LOAD("pbsndu17.100", 0x000000, 0x100000, CRC(f5502fec) SHA1(c8edd56e0c4365dd6b4bef0f1c7cc83ea5fd73d6)) | |
| 1219 | ROM_LOAD("pbsndu21.100", 0x100000, 0x100000, CRC(7869d34f) SHA1(48a051045523c14ca06a7227b34ed9e3818828d0)) | |
| 1220 | ROM_LOAD("pbsndu36.100", 0x200000, 0x100000, CRC(d10f14a3) SHA1(972b480c23d484b627ecdce0322c08fe760a127f)) | |
| 1221 | ROM_LOAD("pbsndu37.100", 0x300000, 0x100000, CRC(6642524a) SHA1(9d0c0be5887cf4510c11243ee47b11c08cbae17c)) | |
| 1222 | ROM_END | |
| 999 | 1223 | ROM_START(playboyg) |
| 1000 | 1224 | ROM_REGION(0x80000, "user1", 0) |
| 1001 | 1225 | ROM_LOAD("pbcpu.500", 0x00000, 0x20000, CRC(e4d924ae) SHA1(2aab64eee57e9569c3cc1bde28cda69ff4cacc69)) |
| r10613 | r10614 | |
| 1006 | 1230 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) |
| 1007 | 1231 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) |
| 1008 | 1232 | ROM_REGION(0x80000, "gfx3", 0) |
| 1009 | ROM_LOAD("pbdispg.500", 0x00000, 0x80000, CRC(681392fe) SHA1(23011d538282da144b8ff9cbb7c5655567017e5e)) // ver 5.00 | |
| 1010 | //ROM_LOAD("pbdispg.300", 0x00000, 0x80000, CRC(ed7b7c62) SHA1(28b0ab490f8abd5f29e8cb0996da9e7200918157)) // ver 3.00 | |
| 1233 | ROM_LOAD("pbdispg.500", 0x00000, 0x80000, CRC(681392fe) SHA1(23011d538282da144b8ff9cbb7c5655567017e5e)) | |
| 1011 | 1234 | ROM_REGION(0x010000, "cpu2", 0) |
| 1012 | 1235 | ROM_LOAD("pbsndu7.102",0x0000,0x10000,CRC(12a68f34) SHA1(f2cd42918dec353883bc465f6302c2d94dcd6b87)) |
| 1013 | 1236 | ROM_REGION(0x400000, "sound1", 0) |
| r10613 | r10614 | |
| 1016 | 1239 | ROM_LOAD("pbsndu36.100", 0x200000, 0x100000, CRC(d10f14a3) SHA1(972b480c23d484b627ecdce0322c08fe760a127f)) |
| 1017 | 1240 | ROM_LOAD("pbsndu37.100", 0x300000, 0x100000, CRC(6642524a) SHA1(9d0c0be5887cf4510c11243ee47b11c08cbae17c)) |
| 1018 | 1241 | ROM_END |
| 1242 | ROM_START(playboyg_303) | |
| 1243 | ROM_REGION(0x80000, "user1", 0) | |
| 1244 | ROM_LOAD("pbcpu.303", 0x00000, 0x20000, CRC(6a6f6aab) SHA1(cac5d68d699db4016244ffd56355e2834be3da1f)) | |
| 1245 | ROM_RELOAD(0x20000, 0x20000) | |
| 1246 | ROM_RELOAD(0x40000, 0x20000) | |
| 1247 | ROM_RELOAD(0x60000, 0x20000) | |
| 1248 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1249 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1250 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1251 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1252 | ROM_LOAD("pbdispg.300", 0x00000, 0x80000, CRC(ed7b7c62) SHA1(28b0ab490f8abd5f29e8cb0996da9e7200918157)) | |
| 1253 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1254 | ROM_LOAD("pbsndu7.102",0x0000,0x10000,CRC(12a68f34) SHA1(f2cd42918dec353883bc465f6302c2d94dcd6b87)) | |
| 1255 | ROM_REGION(0x400000, "sound1", 0) | |
| 1256 | ROM_LOAD("pbsndu17.100", 0x000000, 0x100000, CRC(f5502fec) SHA1(c8edd56e0c4365dd6b4bef0f1c7cc83ea5fd73d6)) | |
| 1257 | ROM_LOAD("pbsndu21.100", 0x100000, 0x100000, CRC(7869d34f) SHA1(48a051045523c14ca06a7227b34ed9e3818828d0)) | |
| 1258 | ROM_LOAD("pbsndu36.100", 0x200000, 0x100000, CRC(d10f14a3) SHA1(972b480c23d484b627ecdce0322c08fe760a127f)) | |
| 1259 | ROM_LOAD("pbsndu37.100", 0x300000, 0x100000, CRC(6642524a) SHA1(9d0c0be5887cf4510c11243ee47b11c08cbae17c)) | |
| 1260 | ROM_END | |
| 1261 | ROM_START(playboyg_300) | |
| 1262 | ROM_REGION(0x80000, "user1", 0) | |
| 1263 | ROM_LOAD("pbcpu.300", 0x00000, 0x20000, CRC(d7e5bada) SHA1(e4d5bc015751a559eb95acb6da04246b7418eaf5)) | |
| 1264 | ROM_RELOAD(0x20000, 0x20000) | |
| 1265 | ROM_RELOAD(0x40000, 0x20000) | |
| 1266 | ROM_RELOAD(0x60000, 0x20000) | |
| 1267 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1268 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1269 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1270 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1271 | ROM_LOAD("pbdispg.300", 0x00000, 0x80000, CRC(ed7b7c62) SHA1(28b0ab490f8abd5f29e8cb0996da9e7200918157)) | |
| 1272 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1273 | ROM_LOAD("pbsndu7.102",0x0000,0x10000,CRC(12a68f34) SHA1(f2cd42918dec353883bc465f6302c2d94dcd6b87)) | |
| 1274 | ROM_REGION(0x400000, "sound1", 0) | |
| 1275 | ROM_LOAD("pbsndu17.100", 0x000000, 0x100000, CRC(f5502fec) SHA1(c8edd56e0c4365dd6b4bef0f1c7cc83ea5fd73d6)) | |
| 1276 | ROM_LOAD("pbsndu21.100", 0x100000, 0x100000, CRC(7869d34f) SHA1(48a051045523c14ca06a7227b34ed9e3818828d0)) | |
| 1277 | ROM_LOAD("pbsndu36.100", 0x200000, 0x100000, CRC(d10f14a3) SHA1(972b480c23d484b627ecdce0322c08fe760a127f)) | |
| 1278 | ROM_LOAD("pbsndu37.100", 0x300000, 0x100000, CRC(6642524a) SHA1(9d0c0be5887cf4510c11243ee47b11c08cbae17c)) | |
| 1279 | ROM_END | |
| 1019 | 1280 | ROM_START(playboyi) |
| 1020 | 1281 | ROM_REGION(0x80000, "user1", 0) |
| 1021 | 1282 | ROM_LOAD("pbcpu.500", 0x00000, 0x20000, CRC(e4d924ae) SHA1(2aab64eee57e9569c3cc1bde28cda69ff4cacc69)) |
| r10613 | r10614 | |
| 1026 | 1287 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) |
| 1027 | 1288 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) |
| 1028 | 1289 | ROM_REGION(0x80000, "gfx3", 0) |
| 1029 | ROM_LOAD("pbdispi.500", 0x00000, 0x80000, CRC(d90d7ec6) SHA1(7442160f403a8ccabfc9dc8dc53f8b44f5df26bc)) // ver 5.00 | |
| 1030 | //ROM_LOAD("pbdispi.300", 0x00000, 0x80000, CRC(74c8cedf) SHA1(474ad1939ea0a58852003e549ed85478e239a67c)) // ver 3.00 | |
| 1290 | ROM_LOAD("pbdispi.500", 0x00000, 0x80000, CRC(d90d7ec6) SHA1(7442160f403a8ccabfc9dc8dc53f8b44f5df26bc)) | |
| 1031 | 1291 | ROM_REGION(0x010000, "cpu2", 0) |
| 1032 | 1292 | ROM_LOAD("pbsndu7.102",0x0000,0x10000,CRC(12a68f34) SHA1(f2cd42918dec353883bc465f6302c2d94dcd6b87)) |
| 1033 | 1293 | ROM_REGION(0x400000, "sound1", 0) |
| r10613 | r10614 | |
| 1036 | 1296 | ROM_LOAD("pbsndu36.100", 0x200000, 0x100000, CRC(d10f14a3) SHA1(972b480c23d484b627ecdce0322c08fe760a127f)) |
| 1037 | 1297 | ROM_LOAD("pbsndu37.100", 0x300000, 0x100000, CRC(6642524a) SHA1(9d0c0be5887cf4510c11243ee47b11c08cbae17c)) |
| 1038 | 1298 | ROM_END |
| 1299 | ROM_START(playboyi_303) | |
| 1300 | ROM_REGION(0x80000, "user1", 0) | |
| 1301 | ROM_LOAD("pbcpu.303", 0x00000, 0x20000, CRC(6a6f6aab) SHA1(cac5d68d699db4016244ffd56355e2834be3da1f)) | |
| 1302 | ROM_RELOAD(0x20000, 0x20000) | |
| 1303 | ROM_RELOAD(0x40000, 0x20000) | |
| 1304 | ROM_RELOAD(0x60000, 0x20000) | |
| 1305 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1306 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1307 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1308 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1309 | ROM_LOAD("pbdispi.300", 0x00000, 0x80000, CRC(74c8cedf) SHA1(474ad1939ea0a58852003e549ed85478e239a67c)) | |
| 1310 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1311 | ROM_LOAD("pbsndu7.102",0x0000,0x10000,CRC(12a68f34) SHA1(f2cd42918dec353883bc465f6302c2d94dcd6b87)) | |
| 1312 | ROM_REGION(0x400000, "sound1", 0) | |
| 1313 | ROM_LOAD("pbsndu17.100", 0x000000, 0x100000, CRC(f5502fec) SHA1(c8edd56e0c4365dd6b4bef0f1c7cc83ea5fd73d6)) | |
| 1314 | ROM_LOAD("pbsndu21.100", 0x100000, 0x100000, CRC(7869d34f) SHA1(48a051045523c14ca06a7227b34ed9e3818828d0)) | |
| 1315 | ROM_LOAD("pbsndu36.100", 0x200000, 0x100000, CRC(d10f14a3) SHA1(972b480c23d484b627ecdce0322c08fe760a127f)) | |
| 1316 | ROM_LOAD("pbsndu37.100", 0x300000, 0x100000, CRC(6642524a) SHA1(9d0c0be5887cf4510c11243ee47b11c08cbae17c)) | |
| 1317 | ROM_END | |
| 1318 | ROM_START(playboyi_300) | |
| 1319 | ROM_REGION(0x80000, "user1", 0) | |
| 1320 | ROM_LOAD("pbcpu.300", 0x00000, 0x20000, CRC(d7e5bada) SHA1(e4d5bc015751a559eb95acb6da04246b7418eaf5)) | |
| 1321 | ROM_RELOAD(0x20000, 0x20000) | |
| 1322 | ROM_RELOAD(0x40000, 0x20000) | |
| 1323 | ROM_RELOAD(0x60000, 0x20000) | |
| 1324 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1325 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1326 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1327 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1328 | ROM_LOAD("pbdispi.300", 0x00000, 0x80000, CRC(74c8cedf) SHA1(474ad1939ea0a58852003e549ed85478e239a67c)) | |
| 1329 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1330 | ROM_LOAD("pbsndu7.102",0x0000,0x10000,CRC(12a68f34) SHA1(f2cd42918dec353883bc465f6302c2d94dcd6b87)) | |
| 1331 | ROM_REGION(0x400000, "sound1", 0) | |
| 1332 | ROM_LOAD("pbsndu17.100", 0x000000, 0x100000, CRC(f5502fec) SHA1(c8edd56e0c4365dd6b4bef0f1c7cc83ea5fd73d6)) | |
| 1333 | ROM_LOAD("pbsndu21.100", 0x100000, 0x100000, CRC(7869d34f) SHA1(48a051045523c14ca06a7227b34ed9e3818828d0)) | |
| 1334 | ROM_LOAD("pbsndu36.100", 0x200000, 0x100000, CRC(d10f14a3) SHA1(972b480c23d484b627ecdce0322c08fe760a127f)) | |
| 1335 | ROM_LOAD("pbsndu37.100", 0x300000, 0x100000, CRC(6642524a) SHA1(9d0c0be5887cf4510c11243ee47b11c08cbae17c)) | |
| 1336 | ROM_END | |
| 1039 | 1337 | ROM_START(playboyl) |
| 1040 | 1338 | ROM_REGION(0x80000, "user1", 0) |
| 1041 | 1339 | ROM_LOAD("pbcpu.500", 0x00000, 0x20000, CRC(e4d924ae) SHA1(2aab64eee57e9569c3cc1bde28cda69ff4cacc69)) |
| r10613 | r10614 | |
| 1046 | 1344 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) |
| 1047 | 1345 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) |
| 1048 | 1346 | ROM_REGION(0x80000, "gfx3", 0) |
| 1049 | ROM_LOAD("pbdispl.500", 0x00000, 0x80000, CRC(b019f0f6) SHA1(184a9905cd3af9d272577e43666aed5e5a8a5281)) // ver 5.00 | |
| 1050 | //ROM_LOAD("pbdispl.300", 0x00000, 0x80000, CRC(e7697fc3) SHA1(7a9796e7b99af0d3d2079876a8054209a3067e64)) // ver 3.00 | |
| 1347 | ROM_LOAD("pbdispl.500", 0x00000, 0x80000, CRC(b019f0f6) SHA1(184a9905cd3af9d272577e43666aed5e5a8a5281)) | |
| 1051 | 1348 | ROM_REGION(0x010000, "cpu2", 0) |
| 1052 | 1349 | ROM_LOAD("pbsndu7.102",0x0000,0x10000,CRC(12a68f34) SHA1(f2cd42918dec353883bc465f6302c2d94dcd6b87)) |
| 1053 | 1350 | ROM_REGION(0x400000, "sound1", 0) |
| r10613 | r10614 | |
| 1056 | 1353 | ROM_LOAD("pbsndu36.100", 0x200000, 0x100000, CRC(d10f14a3) SHA1(972b480c23d484b627ecdce0322c08fe760a127f)) |
| 1057 | 1354 | ROM_LOAD("pbsndu37.100", 0x300000, 0x100000, CRC(6642524a) SHA1(9d0c0be5887cf4510c11243ee47b11c08cbae17c)) |
| 1058 | 1355 | ROM_END |
| 1059 | ||
| 1356 | ROM_START(playboyl_303) | |
| 1357 | ROM_REGION(0x80000, "user1", 0) | |
| 1358 | ROM_LOAD("pbcpu.303", 0x00000, 0x20000, CRC(6a6f6aab) SHA1(cac5d68d699db4016244ffd56355e2834be3da1f)) | |
| 1359 | ROM_RELOAD(0x20000, 0x20000) | |
| 1360 | ROM_RELOAD(0x40000, 0x20000) | |
| 1361 | ROM_RELOAD(0x60000, 0x20000) | |
| 1362 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1363 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1364 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1365 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1366 | ROM_LOAD("pbdispl.300", 0x00000, 0x80000, CRC(e7697fc3) SHA1(7a9796e7b99af0d3d2079876a8054209a3067e64)) | |
| 1367 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1368 | ROM_LOAD("pbsndu7.102",0x0000,0x10000,CRC(12a68f34) SHA1(f2cd42918dec353883bc465f6302c2d94dcd6b87)) | |
| 1369 | ROM_REGION(0x400000, "sound1", 0) | |
| 1370 | ROM_LOAD("pbsndu17.100", 0x000000, 0x100000, CRC(f5502fec) SHA1(c8edd56e0c4365dd6b4bef0f1c7cc83ea5fd73d6)) | |
| 1371 | ROM_LOAD("pbsndu21.100", 0x100000, 0x100000, CRC(7869d34f) SHA1(48a051045523c14ca06a7227b34ed9e3818828d0)) | |
| 1372 | ROM_LOAD("pbsndu36.100", 0x200000, 0x100000, CRC(d10f14a3) SHA1(972b480c23d484b627ecdce0322c08fe760a127f)) | |
| 1373 | ROM_LOAD("pbsndu37.100", 0x300000, 0x100000, CRC(6642524a) SHA1(9d0c0be5887cf4510c11243ee47b11c08cbae17c)) | |
| 1374 | ROM_END | |
| 1375 | ROM_START(playboyl_300) | |
| 1376 | ROM_REGION(0x80000, "user1", 0) | |
| 1377 | ROM_LOAD("pbcpu.300", 0x00000, 0x20000, CRC(d7e5bada) SHA1(e4d5bc015751a559eb95acb6da04246b7418eaf5)) | |
| 1378 | ROM_RELOAD(0x20000, 0x20000) | |
| 1379 | ROM_RELOAD(0x40000, 0x20000) | |
| 1380 | ROM_RELOAD(0x60000, 0x20000) | |
| 1381 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1382 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1383 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1384 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1385 | ROM_LOAD("pbdispl.300", 0x00000, 0x80000, CRC(e7697fc3) SHA1(7a9796e7b99af0d3d2079876a8054209a3067e64)) | |
| 1386 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1387 | ROM_LOAD("pbsndu7.102",0x0000,0x10000,CRC(12a68f34) SHA1(f2cd42918dec353883bc465f6302c2d94dcd6b87)) | |
| 1388 | ROM_REGION(0x400000, "sound1", 0) | |
| 1389 | ROM_LOAD("pbsndu17.100", 0x000000, 0x100000, CRC(f5502fec) SHA1(c8edd56e0c4365dd6b4bef0f1c7cc83ea5fd73d6)) | |
| 1390 | ROM_LOAD("pbsndu21.100", 0x100000, 0x100000, CRC(7869d34f) SHA1(48a051045523c14ca06a7227b34ed9e3818828d0)) | |
| 1391 | ROM_LOAD("pbsndu36.100", 0x200000, 0x100000, CRC(d10f14a3) SHA1(972b480c23d484b627ecdce0322c08fe760a127f)) | |
| 1392 | ROM_LOAD("pbsndu37.100", 0x300000, 0x100000, CRC(6642524a) SHA1(9d0c0be5887cf4510c11243ee47b11c08cbae17c)) | |
| 1393 | ROM_END | |
| 1060 | 1394 | /*------------------------------------------------------------------- |
| 1061 | 1395 | / Roller Coaster Tycoon |
| 1062 | 1396 | /-------------------------------------------------------------------*/ |
| 1063 | 1397 | ROM_START(rctycn) |
| 1064 | 1398 | ROM_REGION(0x80000, "user1", 0) |
| 1065 | ROM_LOAD("rctcpu.702", 0x00000, 0x20000, CRC(5736a816) SHA1(fcfd06eeca74df0bca2c0bc57aeaa00400e4ab55)) // ver 7.02 | |
| 1066 | //ROM_LOAD("rctcpu.400", 0x00000, 0x20000, CRC(4691de23) SHA1(f47fc03f9b030cb7a1201d015bbec5a426176338)) // ver 4.00 | |
| 1067 | //ROM_LOAD( "rctcpu.701", 0x0000, 0x20000, CRC(e1fe89f6) SHA1(9a76a5c267e055fcf0418394762bcea758da02d6)) | |
| 1068 | //ROM_LOAD( "rctdispa.700", 0x0000, 0x80000, CRC(6a8925d7) SHA1(82a6c069f1e8f8e053fec708f56c8ffe56d70fc8)) | |
| 1069 | //ROM_LOAD( "rctdispf.700", 0x0000, 0x80000, CRC(2de0eec8) SHA1(5b48eabddc1fb735866767ae008baf58205954db)) | |
| 1070 | //ROM_LOAD( "rctdispg.700", 0x0000, 0x80000, CRC(0babf1ed) SHA1(db683aa392968d255d355d4a1b0c9d8d4fb9e799)) | |
| 1071 | //ROM_LOAD( "rctdispi.700", 0x0000, 0x80000, CRC(0d07d8f2) SHA1(3ffd8ad7183ba20844c1e5d1933c8002ca4707aa)) | |
| 1072 | //ROM_LOAD( "rctdisps.700", 0x0000, 0x80000, CRC(6921d8cc) SHA1(1ada415af8e949829ceac75da507982ea2091f4d)) | |
| 1073 | ||
| 1399 | ROM_LOAD("rctcpu.702", 0x00000, 0x20000, CRC(5736a816) SHA1(fcfd06eeca74df0bca2c0bc57aeaa00400e4ab55)) | |
| 1074 | 1400 | ROM_RELOAD(0x20000, 0x20000) |
| 1075 | 1401 | ROM_RELOAD(0x40000, 0x20000) |
| 1076 | 1402 | ROM_RELOAD(0x60000, 0x20000) |
| r10613 | r10614 | |
| 1078 | 1404 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) |
| 1079 | 1405 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) |
| 1080 | 1406 | ROM_REGION(0x80000, "gfx3", 0) |
| 1081 | ROM_LOAD("rctdispa.701", 0x00000, 0x80000, CRC(0d527f13) SHA1(954116a79578b2a7679c401a2bb99b5bbfb603f2)) // ver 7.01 | |
| 1082 | //ROM_LOAD("rctdispa.400", 0x00000, 0x80000, CRC(d128a8fa) SHA1(8fece3df33d21da020ba06d14d588384d90dd89f)) // ver 4.00 | |
| 1407 | ROM_LOAD("rctdispa.701", 0x00000, 0x80000, CRC(0d527f13) SHA1(954116a79578b2a7679c401a2bb99b5bbfb603f2)) | |
| 1083 | 1408 | ROM_REGION(0x010000, "cpu2", 0) |
| 1084 | 1409 | ROM_LOAD("rcsndu7.100",0x0000,0x10000,CRC(e6cde9b1) SHA1(cbaadafd18ad9c0338bf2cce94b2c2a89e734778)) |
| 1085 | 1410 | ROM_REGION(0x400000, "sound1", 0) |
| r10613 | r10614 | |
| 1087 | 1412 | ROM_LOAD("rcsndu21.100", 0x100000, 0x100000, CRC(64b19c11) SHA1(9ac714d372437cf1d8c4e01512c0647f13e40ddb)) |
| 1088 | 1413 | ROM_LOAD("rcsndu36.100", 0x200000, 0x100000, CRC(05c8bac9) SHA1(0771a393d5361c9a35d42a18b6c6a105b7752e03)) |
| 1089 | 1414 | ROM_END |
| 1415 | ROM_START(rctycn_701) | |
| 1416 | ROM_REGION(0x80000, "user1", 0) | |
| 1417 | ROM_LOAD("rctcpu.701", 0x0000, 0x20000, CRC(e1fe89f6) SHA1(9a76a5c267e055fcf0418394762bcea758da02d6)) | |
| 1418 | ROM_RELOAD(0x20000, 0x20000) | |
| 1419 | ROM_RELOAD(0x40000, 0x20000) | |
| 1420 | ROM_RELOAD(0x60000, 0x20000) | |
| 1421 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1422 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1423 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1424 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1425 | ROM_LOAD("rctdispa.700", 0x0000, 0x80000, CRC(6a8925d7) SHA1(82a6c069f1e8f8e053fec708f56c8ffe56d70fc8)) | |
| 1426 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1427 | ROM_LOAD("rcsndu7.100",0x0000,0x10000,CRC(e6cde9b1) SHA1(cbaadafd18ad9c0338bf2cce94b2c2a89e734778)) | |
| 1428 | ROM_REGION(0x400000, "sound1", 0) | |
| 1429 | ROM_LOAD("rcsndu17.100", 0x000000, 0x100000, CRC(18ba20ec) SHA1(c6e7a8a5fd6029b8e884a6eeb779a10d819e8c7c)) | |
| 1430 | ROM_LOAD("rcsndu21.100", 0x100000, 0x100000, CRC(64b19c11) SHA1(9ac714d372437cf1d8c4e01512c0647f13e40ddb)) | |
| 1431 | ROM_LOAD("rcsndu36.100", 0x200000, 0x100000, CRC(05c8bac9) SHA1(0771a393d5361c9a35d42a18b6c6a105b7752e03)) | |
| 1432 | ROM_END | |
| 1433 | ROM_START(rctycn_400) | |
| 1434 | ROM_REGION(0x80000, "user1", 0) | |
| 1435 | ROM_LOAD("rctcpu.400", 0x00000, 0x20000, CRC(4691de23) SHA1(f47fc03f9b030cb7a1201d015bbec5a426176338)) | |
| 1436 | ROM_RELOAD(0x20000, 0x20000) | |
| 1437 | ROM_RELOAD(0x40000, 0x20000) | |
| 1438 | ROM_RELOAD(0x60000, 0x20000) | |
| 1439 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1440 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1441 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1442 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1443 | ROM_LOAD("rctdispa.400", 0x00000, 0x80000, CRC(d128a8fa) SHA1(8fece3df33d21da020ba06d14d588384d90dd89f)) | |
| 1444 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1445 | ROM_LOAD("rcsndu7.100",0x0000,0x10000,CRC(e6cde9b1) SHA1(cbaadafd18ad9c0338bf2cce94b2c2a89e734778)) | |
| 1446 | ROM_REGION(0x400000, "sound1", 0) | |
| 1447 | ROM_LOAD("rcsndu17.100", 0x000000, 0x100000, CRC(18ba20ec) SHA1(c6e7a8a5fd6029b8e884a6eeb779a10d819e8c7c)) | |
| 1448 | ROM_LOAD("rcsndu21.100", 0x100000, 0x100000, CRC(64b19c11) SHA1(9ac714d372437cf1d8c4e01512c0647f13e40ddb)) | |
| 1449 | ROM_LOAD("rcsndu36.100", 0x200000, 0x100000, CRC(05c8bac9) SHA1(0771a393d5361c9a35d42a18b6c6a105b7752e03)) | |
| 1450 | ROM_END | |
| 1090 | 1451 | ROM_START(rctnew) |
| 1091 | 1452 | ROM_REGION(0x80000, "user1", 0) |
| 1092 | 1453 | ROM_LOAD("rctcpu.702", 0x00000, 0x20000, CRC(5736a816) SHA1(fcfd06eeca74df0bca2c0bc57aeaa00400e4ab55)) |
| r10613 | r10614 | |
| 1118 | 1479 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) |
| 1119 | 1480 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) |
| 1120 | 1481 | ROM_REGION(0x80000, "gfx3", 0) |
| 1121 | ROM_LOAD("rctdispg.701", 0x00000, 0x80000, CRC(6c70ab29) SHA1(fa3b713b79c0d724b918fa318795681308a4fce3)) // ver 7.01 | |
| 1122 | //ROM_LOAD("rctdispg.400", 0x00000, 0x80000, CRC(c88dc915) SHA1(894c3bb7f5d200448740f021b5b9421f6ee74c5f)) // ver 4.00 | |
| 1482 | ROM_LOAD("rctdispg.701", 0x00000, 0x80000, CRC(6c70ab29) SHA1(fa3b713b79c0d724b918fa318795681308a4fce3)) | |
| 1123 | 1483 | ROM_REGION(0x010000, "cpu2", 0) |
| 1124 | 1484 | ROM_LOAD("rcsndu7.100",0x0000,0x10000,CRC(e6cde9b1) SHA1(cbaadafd18ad9c0338bf2cce94b2c2a89e734778)) |
| 1125 | 1485 | ROM_REGION(0x400000, "sound1", 0) |
| r10613 | r10614 | |
| 1127 | 1487 | ROM_LOAD("rcsndu21.100", 0x100000, 0x100000, CRC(64b19c11) SHA1(9ac714d372437cf1d8c4e01512c0647f13e40ddb)) |
| 1128 | 1488 | ROM_LOAD("rcsndu36.100", 0x200000, 0x100000, CRC(05c8bac9) SHA1(0771a393d5361c9a35d42a18b6c6a105b7752e03)) |
| 1129 | 1489 | ROM_END |
| 1490 | ROM_START(rctycng_701) | |
| 1491 | ROM_REGION(0x80000, "user1", 0) | |
| 1492 | ROM_LOAD("rctcpu.701", 0x00000, 0x20000, CRC(e1fe89f6) SHA1(9a76a5c267e055fcf0418394762bcea758da02d6)) | |
| 1493 | ROM_RELOAD(0x20000, 0x20000) | |
| 1494 | ROM_RELOAD(0x40000, 0x20000) | |
| 1495 | ROM_RELOAD(0x60000, 0x20000) | |
| 1496 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1497 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1498 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1499 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1500 | ROM_LOAD("rctdispg.700", 0x00000, 0x80000, CRC(0babf1ed) SHA1(db683aa392968d255d355d4a1b0c9d8d4fb9e799)) | |
| 1501 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1502 | ROM_LOAD("rcsndu7.100",0x0000,0x10000,CRC(e6cde9b1) SHA1(cbaadafd18ad9c0338bf2cce94b2c2a89e734778)) | |
| 1503 | ROM_REGION(0x400000, "sound1", 0) | |
| 1504 | ROM_LOAD("rcsndu17.100", 0x000000, 0x100000, CRC(18ba20ec) SHA1(c6e7a8a5fd6029b8e884a6eeb779a10d819e8c7c)) | |
| 1505 | ROM_LOAD("rcsndu21.100", 0x100000, 0x100000, CRC(64b19c11) SHA1(9ac714d372437cf1d8c4e01512c0647f13e40ddb)) | |
| 1506 | ROM_LOAD("rcsndu36.100", 0x200000, 0x100000, CRC(05c8bac9) SHA1(0771a393d5361c9a35d42a18b6c6a105b7752e03)) | |
| 1507 | ROM_END | |
| 1508 | ROM_START(rctycng_400) | |
| 1509 | ROM_REGION(0x80000, "user1", 0) | |
| 1510 | ROM_LOAD("rctcpu.400", 0x00000, 0x20000, CRC(4691de23) SHA1(f47fc03f9b030cb7a1201d015bbec5a426176338)) | |
| 1511 | ROM_RELOAD(0x20000, 0x20000) | |
| 1512 | ROM_RELOAD(0x40000, 0x20000) | |
| 1513 | ROM_RELOAD(0x60000, 0x20000) | |
| 1514 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1515 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1516 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1517 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1518 | ROM_LOAD("rctdispg.400", 0x00000, 0x80000, CRC(c88dc915) SHA1(894c3bb7f5d200448740f021b5b9421f6ee74c5f)) | |
| 1519 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1520 | ROM_LOAD("rcsndu7.100",0x0000,0x10000,CRC(e6cde9b1) SHA1(cbaadafd18ad9c0338bf2cce94b2c2a89e734778)) | |
| 1521 | ROM_REGION(0x400000, "sound1", 0) | |
| 1522 | ROM_LOAD("rcsndu17.100", 0x000000, 0x100000, CRC(18ba20ec) SHA1(c6e7a8a5fd6029b8e884a6eeb779a10d819e8c7c)) | |
| 1523 | ROM_LOAD("rcsndu21.100", 0x100000, 0x100000, CRC(64b19c11) SHA1(9ac714d372437cf1d8c4e01512c0647f13e40ddb)) | |
| 1524 | ROM_LOAD("rcsndu36.100", 0x200000, 0x100000, CRC(05c8bac9) SHA1(0771a393d5361c9a35d42a18b6c6a105b7752e03)) | |
| 1525 | ROM_END | |
| 1130 | 1526 | ROM_START(rctycnf) |
| 1131 | 1527 | ROM_REGION(0x80000, "user1", 0) |
| 1132 | 1528 | ROM_LOAD("rctcpu.702", 0x00000, 0x20000, CRC(5736a816) SHA1(fcfd06eeca74df0bca2c0bc57aeaa00400e4ab55)) |
| r10613 | r10614 | |
| 1137 | 1533 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) |
| 1138 | 1534 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) |
| 1139 | 1535 | ROM_REGION(0x80000, "gfx3", 0) |
| 1140 | ROM_LOAD("rctdispf.701", 0x00000, 0x80000, CRC(4a3bb40c) SHA1(053f494765ac7708401a7816af7186e71083fe8d)) // ver 7.01 | |
| 1141 | //ROM_LOAD("rctdispf.400", 0x00000, 0x80000, CRC(5b41893b) SHA1(66930d0f5d6542b41f22995df55447ba0e435576)) // ver 4.00 | |
| 1536 | ROM_LOAD("rctdispf.701", 0x00000, 0x80000, CRC(4a3bb40c) SHA1(053f494765ac7708401a7816af7186e71083fe8d)) | |
| 1142 | 1537 | ROM_REGION(0x010000, "cpu2", 0) |
| 1143 | 1538 | ROM_LOAD("rcsndu7.100",0x0000,0x10000,CRC(e6cde9b1) SHA1(cbaadafd18ad9c0338bf2cce94b2c2a89e734778)) |
| 1144 | 1539 | ROM_REGION(0x400000, "sound1", 0) |
| r10613 | r10614 | |
| 1146 | 1541 | ROM_LOAD("rcsndu21.100", 0x100000, 0x100000, CRC(64b19c11) SHA1(9ac714d372437cf1d8c4e01512c0647f13e40ddb)) |
| 1147 | 1542 | ROM_LOAD("rcsndu36.100", 0x200000, 0x100000, CRC(05c8bac9) SHA1(0771a393d5361c9a35d42a18b6c6a105b7752e03)) |
| 1148 | 1543 | ROM_END |
| 1544 | ROM_START(rctycnf_701) | |
| 1545 | ROM_REGION(0x80000, "user1", 0) | |
| 1546 | ROM_LOAD("rctcpu.701", 0x00000, 0x20000, CRC(e1fe89f6) SHA1(9a76a5c267e055fcf0418394762bcea758da02d6)) | |
| 1547 | ROM_RELOAD(0x20000, 0x20000) | |
| 1548 | ROM_RELOAD(0x40000, 0x20000) | |
| 1549 | ROM_RELOAD(0x60000, 0x20000) | |
| 1550 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1551 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1552 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1553 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1554 | ROM_LOAD("rctdispf.700", 0x00000, 0x80000, CRC(2de0eec8) SHA1(5b48eabddc1fb735866767ae008baf58205954db)) | |
| 1555 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1556 | ROM_LOAD("rcsndu7.100",0x0000,0x10000,CRC(e6cde9b1) SHA1(cbaadafd18ad9c0338bf2cce94b2c2a89e734778)) | |
| 1557 | ROM_REGION(0x400000, "sound1", 0) | |
| 1558 | ROM_LOAD("rcsndu17.100", 0x000000, 0x100000, CRC(18ba20ec) SHA1(c6e7a8a5fd6029b8e884a6eeb779a10d819e8c7c)) | |
| 1559 | ROM_LOAD("rcsndu21.100", 0x100000, 0x100000, CRC(64b19c11) SHA1(9ac714d372437cf1d8c4e01512c0647f13e40ddb)) | |
| 1560 | ROM_LOAD("rcsndu36.100", 0x200000, 0x100000, CRC(05c8bac9) SHA1(0771a393d5361c9a35d42a18b6c6a105b7752e03)) | |
| 1561 | ROM_END | |
| 1562 | ROM_START(rctycnf_400) | |
| 1563 | ROM_REGION(0x80000, "user1", 0) | |
| 1564 | ROM_LOAD("rctcpu.400", 0x00000, 0x20000, CRC(4691de23) SHA1(f47fc03f9b030cb7a1201d015bbec5a426176338)) | |
| 1565 | ROM_RELOAD(0x20000, 0x20000) | |
| 1566 | ROM_RELOAD(0x40000, 0x20000) | |
| 1567 | ROM_RELOAD(0x60000, 0x20000) | |
| 1568 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1569 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1570 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1571 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1572 | ROM_LOAD("rctdispf.400", 0x00000, 0x80000, CRC(5b41893b) SHA1(66930d0f5d6542b41f22995df55447ba0e435576)) | |
| 1573 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1574 | ROM_LOAD("rcsndu7.100",0x0000,0x10000,CRC(e6cde9b1) SHA1(cbaadafd18ad9c0338bf2cce94b2c2a89e734778)) | |
| 1575 | ROM_REGION(0x400000, "sound1", 0) | |
| 1576 | ROM_LOAD("rcsndu17.100", 0x000000, 0x100000, CRC(18ba20ec) SHA1(c6e7a8a5fd6029b8e884a6eeb779a10d819e8c7c)) | |
| 1577 | ROM_LOAD("rcsndu21.100", 0x100000, 0x100000, CRC(64b19c11) SHA1(9ac714d372437cf1d8c4e01512c0647f13e40ddb)) | |
| 1578 | ROM_LOAD("rcsndu36.100", 0x200000, 0x100000, CRC(05c8bac9) SHA1(0771a393d5361c9a35d42a18b6c6a105b7752e03)) | |
| 1579 | ROM_END | |
| 1149 | 1580 | ROM_START(rctycni) |
| 1150 | 1581 | ROM_REGION(0x80000, "user1", 0) |
| 1151 | 1582 | ROM_LOAD("rctcpu.702", 0x00000, 0x20000, CRC(5736a816) SHA1(fcfd06eeca74df0bca2c0bc57aeaa00400e4ab55)) |
| r10613 | r10614 | |
| 1156 | 1587 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) |
| 1157 | 1588 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) |
| 1158 | 1589 | ROM_REGION(0x80000, "gfx3", 0) |
| 1159 | ROM_LOAD("rctdispi.701", 0x00000, 0x80000, CRC(6adc8236) SHA1(bb908c88e47987777c921f2948dfb802ee29c868)) // ver 7.01 | |
| 1160 | //ROM_LOAD("rctdispi.400", 0x00000, 0x80000, CRC(7c1c0adb) SHA1(c9321a64ee4af8d475b441ae2385120bba66ccf9)) // ver 4.00 | |
| 1590 | ROM_LOAD("rctdispi.701", 0x00000, 0x80000, CRC(6adc8236) SHA1(bb908c88e47987777c921f2948dfb802ee29c868)) | |
| 1161 | 1591 | ROM_REGION(0x010000, "cpu2", 0) |
| 1162 | 1592 | ROM_LOAD("rcsndu7.100",0x0000,0x10000,CRC(e6cde9b1) SHA1(cbaadafd18ad9c0338bf2cce94b2c2a89e734778)) |
| 1163 | 1593 | ROM_REGION(0x400000, "sound1", 0) |
| r10613 | r10614 | |
| 1165 | 1595 | ROM_LOAD("rcsndu21.100", 0x100000, 0x100000, CRC(64b19c11) SHA1(9ac714d372437cf1d8c4e01512c0647f13e40ddb)) |
| 1166 | 1596 | ROM_LOAD("rcsndu36.100", 0x200000, 0x100000, CRC(05c8bac9) SHA1(0771a393d5361c9a35d42a18b6c6a105b7752e03)) |
| 1167 | 1597 | ROM_END |
| 1598 | ROM_START(rctycni_701) | |
| 1599 | ROM_REGION(0x80000, "user1", 0) | |
| 1600 | ROM_LOAD("rctcpu.701", 0x00000, 0x20000, CRC(e1fe89f6) SHA1(9a76a5c267e055fcf0418394762bcea758da02d6)) | |
| 1601 | ROM_RELOAD(0x20000, 0x20000) | |
| 1602 | ROM_RELOAD(0x40000, 0x20000) | |
| 1603 | ROM_RELOAD(0x60000, 0x20000) | |
| 1604 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1605 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1606 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1607 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1608 | ROM_LOAD("rctdispi.700", 0x00000, 0x80000, CRC(0d07d8f2) SHA1(3ffd8ad7183ba20844c1e5d1933c8002ca4707aa)) | |
| 1609 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1610 | ROM_LOAD("rcsndu7.100",0x0000,0x10000,CRC(e6cde9b1) SHA1(cbaadafd18ad9c0338bf2cce94b2c2a89e734778)) | |
| 1611 | ROM_REGION(0x400000, "sound1", 0) | |
| 1612 | ROM_LOAD("rcsndu17.100", 0x000000, 0x100000, CRC(18ba20ec) SHA1(c6e7a8a5fd6029b8e884a6eeb779a10d819e8c7c)) | |
| 1613 | ROM_LOAD("rcsndu21.100", 0x100000, 0x100000, CRC(64b19c11) SHA1(9ac714d372437cf1d8c4e01512c0647f13e40ddb)) | |
| 1614 | ROM_LOAD("rcsndu36.100", 0x200000, 0x100000, CRC(05c8bac9) SHA1(0771a393d5361c9a35d42a18b6c6a105b7752e03)) | |
| 1615 | ROM_END | |
| 1616 | ROM_START(rctycni_400) | |
| 1617 | ROM_REGION(0x80000, "user1", 0) | |
| 1618 | ROM_LOAD("rctcpu.400", 0x00000, 0x20000, CRC(4691de23) SHA1(f47fc03f9b030cb7a1201d015bbec5a426176338)) | |
| 1619 | ROM_RELOAD(0x20000, 0x20000) | |
| 1620 | ROM_RELOAD(0x40000, 0x20000) | |
| 1621 | ROM_RELOAD(0x60000, 0x20000) | |
| 1622 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1623 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1624 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1625 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1626 | ROM_LOAD("rctdispi.400", 0x00000, 0x80000, CRC(7c1c0adb) SHA1(c9321a64ee4af8d475b441ae2385120bba66ccf9)) | |
| 1627 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1628 | ROM_LOAD("rcsndu7.100",0x0000,0x10000,CRC(e6cde9b1) SHA1(cbaadafd18ad9c0338bf2cce94b2c2a89e734778)) | |
| 1629 | ROM_REGION(0x400000, "sound1", 0) | |
| 1630 | ROM_LOAD("rcsndu17.100", 0x000000, 0x100000, CRC(18ba20ec) SHA1(c6e7a8a5fd6029b8e884a6eeb779a10d819e8c7c)) | |
| 1631 | ROM_LOAD("rcsndu21.100", 0x100000, 0x100000, CRC(64b19c11) SHA1(9ac714d372437cf1d8c4e01512c0647f13e40ddb)) | |
| 1632 | ROM_LOAD("rcsndu36.100", 0x200000, 0x100000, CRC(05c8bac9) SHA1(0771a393d5361c9a35d42a18b6c6a105b7752e03)) | |
| 1633 | ROM_END | |
| 1168 | 1634 | ROM_START(rctycnl) |
| 1169 | 1635 | ROM_REGION(0x80000, "user1", 0) |
| 1170 | 1636 | ROM_LOAD("rctcpu.702", 0x00000, 0x20000, CRC(5736a816) SHA1(fcfd06eeca74df0bca2c0bc57aeaa00400e4ab55)) |
| 1637 | //ROM_LOAD("rctcpu.400", 0x00000, 0x20000, CRC(4691de23) SHA1(f47fc03f9b030cb7a1201d015bbec5a426176338)) | |
| 1638 | //ROM_LOAD("rctcpu.701", 0x00000, 0x20000, CRC(e1fe89f6) SHA1(9a76a5c267e055fcf0418394762bcea758da02d6)) | |
| 1171 | 1639 | ROM_RELOAD(0x20000, 0x20000) |
| 1172 | 1640 | ROM_RELOAD(0x40000, 0x20000) |
| 1173 | 1641 | ROM_RELOAD(0x60000, 0x20000) |
| r10613 | r10614 | |
| 1176 | 1644 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) |
| 1177 | 1645 | ROM_REGION(0x80000, "gfx3", 0) |
| 1178 | 1646 | ROM_LOAD("rctdisps.701", 0x00000, 0x80000, CRC(0efa8208) SHA1(6706ea3e31b478970fc65a8cf9db749db9c0fa39)) // ver 7.01 |
| 1647 | //ROM_LOAD("rctdisps.700", 0x00000, 0x80000, CRC(6921d8cc) SHA1(1ada415af8e949829ceac75da507982ea2091f4d)) | |
| 1179 | 1648 | //ROM_LOAD("rctdisps.400", 0x00000, 0x80000, CRC(c06e6669) SHA1(af389ba74e62d7065b3bc7d5f771a3461704cbe3)) // ver 4.00 |
| 1180 | 1649 | ROM_REGION(0x010000, "cpu2", 0) |
| 1181 | 1650 | ROM_LOAD("rcsndu7.100",0x0000,0x10000,CRC(e6cde9b1) SHA1(cbaadafd18ad9c0338bf2cce94b2c2a89e734778)) |
| r10613 | r10614 | |
| 1184 | 1653 | ROM_LOAD("rcsndu21.100", 0x100000, 0x100000, CRC(64b19c11) SHA1(9ac714d372437cf1d8c4e01512c0647f13e40ddb)) |
| 1185 | 1654 | ROM_LOAD("rcsndu36.100", 0x200000, 0x100000, CRC(05c8bac9) SHA1(0771a393d5361c9a35d42a18b6c6a105b7752e03)) |
| 1186 | 1655 | ROM_END |
| 1187 | ||
| 1656 | ROM_START(rctycnl_701) | |
| 1657 | ROM_REGION(0x80000, "user1", 0) | |
| 1658 | ROM_LOAD("rctcpu.701", 0x00000, 0x20000, CRC(e1fe89f6) SHA1(9a76a5c267e055fcf0418394762bcea758da02d6)) | |
| 1659 | ROM_RELOAD(0x20000, 0x20000) | |
| 1660 | ROM_RELOAD(0x40000, 0x20000) | |
| 1661 | ROM_RELOAD(0x60000, 0x20000) | |
| 1662 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1663 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1664 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1665 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1666 | ROM_LOAD("rctdisps.700", 0x00000, 0x80000, CRC(6921d8cc) SHA1(1ada415af8e949829ceac75da507982ea2091f4d)) | |
| 1667 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1668 | ROM_LOAD("rcsndu7.100",0x0000,0x10000,CRC(e6cde9b1) SHA1(cbaadafd18ad9c0338bf2cce94b2c2a89e734778)) | |
| 1669 | ROM_REGION(0x400000, "sound1", 0) | |
| 1670 | ROM_LOAD("rcsndu17.100", 0x000000, 0x100000, CRC(18ba20ec) SHA1(c6e7a8a5fd6029b8e884a6eeb779a10d819e8c7c)) | |
| 1671 | ROM_LOAD("rcsndu21.100", 0x100000, 0x100000, CRC(64b19c11) SHA1(9ac714d372437cf1d8c4e01512c0647f13e40ddb)) | |
| 1672 | ROM_LOAD("rcsndu36.100", 0x200000, 0x100000, CRC(05c8bac9) SHA1(0771a393d5361c9a35d42a18b6c6a105b7752e03)) | |
| 1673 | ROM_END | |
| 1674 | ROM_START(rctycnl_400) | |
| 1675 | ROM_REGION(0x80000, "user1", 0) | |
| 1676 | ROM_LOAD("rctcpu.400", 0x00000, 0x20000, CRC(4691de23) SHA1(f47fc03f9b030cb7a1201d015bbec5a426176338)) | |
| 1677 | ROM_RELOAD(0x20000, 0x20000) | |
| 1678 | ROM_RELOAD(0x40000, 0x20000) | |
| 1679 | ROM_RELOAD(0x60000, 0x20000) | |
| 1680 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1681 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1682 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1683 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1684 | ROM_LOAD("rctdisps.400", 0x00000, 0x80000, CRC(c06e6669) SHA1(af389ba74e62d7065b3bc7d5f771a3461704cbe3)) | |
| 1685 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1686 | ROM_LOAD("rcsndu7.100",0x0000,0x10000,CRC(e6cde9b1) SHA1(cbaadafd18ad9c0338bf2cce94b2c2a89e734778)) | |
| 1687 | ROM_REGION(0x400000, "sound1", 0) | |
| 1688 | ROM_LOAD("rcsndu17.100", 0x000000, 0x100000, CRC(18ba20ec) SHA1(c6e7a8a5fd6029b8e884a6eeb779a10d819e8c7c)) | |
| 1689 | ROM_LOAD("rcsndu21.100", 0x100000, 0x100000, CRC(64b19c11) SHA1(9ac714d372437cf1d8c4e01512c0647f13e40ddb)) | |
| 1690 | ROM_LOAD("rcsndu36.100", 0x200000, 0x100000, CRC(05c8bac9) SHA1(0771a393d5361c9a35d42a18b6c6a105b7752e03)) | |
| 1691 | ROM_END | |
| 1188 | 1692 | /*------------------------------------------------------------------- |
| 1189 | 1693 | / Sharkey's Shootout |
| 1190 | 1694 | /-------------------------------------------------------------------*/ |
| 1191 | 1695 | ROM_START(shrkysht) |
| 1192 | 1696 | ROM_REGION(0x80000, "user1", 0) |
| 1193 | ROM_LOAD("sscpu.211", 0x00000, 0x20000, CRC(66a0e5ce) SHA1(d33615081cd8cdf8a17a44b389c6d9746e093510)) // ver 2.11 | |
| 1194 | //ROM_LOAD("sscpu.207", 0x00000, 0x20000, CRC(7355d65d) SHA1(d501cf1ff8b4be01970d47997f71f539df57b702)) // ver 2.07 | |
| 1697 | ROM_LOAD("sscpu.211", 0x00000, 0x20000, CRC(66a0e5ce) SHA1(d33615081cd8cdf8a17a44b389c6d9746e093510)) | |
| 1195 | 1698 | ROM_RELOAD(0x20000, 0x20000) |
| 1196 | 1699 | ROM_RELOAD(0x40000, 0x20000) |
| 1197 | 1700 | ROM_RELOAD(0x60000, 0x20000) |
| r10613 | r10614 | |
| 1228 | 1731 | ROM_LOAD("sssndu21.100", 0x100000, 0x100000, CRC(e1fa3f2a) SHA1(08731fd53ef81453a8f20602e76d435c6771bbb9)) |
| 1229 | 1732 | ROM_LOAD("sssndu36.100", 0x200000, 0x100000, CRC(d22fcfa3) SHA1(3fa407f72ecc64f9d00b92122c4e4d85022e4202)) |
| 1230 | 1733 | ROM_END |
| 1231 | ROM_START(shrky | |
| 1734 | ROM_START(shrky | |
| 1232 | 1735 | ROM_REGION(0x80000, "user1", 0) |
| 1233 | 1736 | ROM_LOAD("sscpu.211", 0x00000, 0x20000, CRC(66a0e5ce) SHA1(d33615081cd8cdf8a17a44b389c6d9746e093510)) |
| 1234 | 1737 | ROM_RELOAD(0x20000, 0x20000) |
| r10613 | r10614 | |
| 1246 | 1749 | ROM_LOAD("sssndu21.100", 0x100000, 0x100000, CRC(e1fa3f2a) SHA1(08731fd53ef81453a8f20602e76d435c6771bbb9)) |
| 1247 | 1750 | ROM_LOAD("sssndu36.100", 0x200000, 0x100000, CRC(d22fcfa3) SHA1(3fa407f72ecc64f9d00b92122c4e4d85022e4202)) |
| 1248 | 1751 | ROM_END |
| 1249 | ROM_START(shrky | |
| 1752 | ROM_START(shrky | |
| 1250 | 1753 | ROM_REGION(0x80000, "user1", 0) |
| 1251 | 1754 | ROM_LOAD("sscpu.211", 0x00000, 0x20000, CRC(66a0e5ce) SHA1(d33615081cd8cdf8a17a44b389c6d9746e093510)) |
| 1252 | 1755 | ROM_RELOAD(0x20000, 0x20000) |
| r10613 | r10614 | |
| 1264 | 1767 | ROM_LOAD("sssndu21.100", 0x100000, 0x100000, CRC(e1fa3f2a) SHA1(08731fd53ef81453a8f20602e76d435c6771bbb9)) |
| 1265 | 1768 | ROM_LOAD("sssndu36.100", 0x200000, 0x100000, CRC(d22fcfa3) SHA1(3fa407f72ecc64f9d00b92122c4e4d85022e4202)) |
| 1266 | 1769 | ROM_END |
| 1267 | ROM_START(shrky | |
| 1770 | ROM_START(shrky | |
| 1268 | 1771 | ROM_REGION(0x80000, "user1", 0) |
| 1269 | 1772 | ROM_LOAD("sscpu.211", 0x00000, 0x20000, CRC(66a0e5ce) SHA1(d33615081cd8cdf8a17a44b389c6d9746e093510)) |
| 1270 | 1773 | ROM_RELOAD(0x20000, 0x20000) |
| r10613 | r10614 | |
| 1283 | 1786 | ROM_LOAD("sssndu36.100", 0x200000, 0x100000, CRC(d22fcfa3) SHA1(3fa407f72ecc64f9d00b92122c4e4d85022e4202)) |
| 1284 | 1787 | ROM_END |
| 1285 | 1788 | |
| 1789 | ROM_START(shrky_207) | |
| 1790 | ROM_REGION(0x80000, "user1", 0) | |
| 1791 | ROM_LOAD("sscpu.207", 0x00000, 0x20000, CRC(7355d65d) SHA1(d501cf1ff8b4be01970d47997f71f539df57b702)) | |
| 1792 | ROM_RELOAD(0x20000, 0x20000) | |
| 1793 | ROM_RELOAD(0x40000, 0x20000) | |
| 1794 | ROM_RELOAD(0x60000, 0x20000) | |
| 1795 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1796 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1797 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1798 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1799 | ROM_LOAD("ssdispa.201", 0x00000, 0x80000, CRC(3360300b) SHA1(3169651a49bb7168fc04b2ae678b696ec6a21c85)) | |
| 1800 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1801 | ROM_LOAD("sssndu7.101",0x0000,0x10000,CRC(fbc6267b) SHA1(e6e70662031e5209385f8b9c59296d7423cc03b4)) | |
| 1802 | ROM_REGION(0x400000, "sound1", 0) | |
| 1803 | ROM_LOAD("sssndu17.100", 0x000000, 0x100000, CRC(dae78d8d) SHA1(a0e1722a19505e7d08266c490d27f772357722d3)) | |
| 1804 | ROM_LOAD("sssndu21.100", 0x100000, 0x100000, CRC(e1fa3f2a) SHA1(08731fd53ef81453a8f20602e76d435c6771bbb9)) | |
| 1805 | ROM_LOAD("sssndu36.100", 0x200000, 0x100000, CRC(d22fcfa3) SHA1(3fa407f72ecc64f9d00b92122c4e4d85022e4202)) | |
| 1806 | ROM_END | |
| 1807 | ROM_START(shrkygr_207) | |
| 1808 | ROM_REGION(0x80000, "user1", 0) | |
| 1809 | ROM_LOAD("sscpu.207", 0x00000, 0x20000, CRC(7355d65d) SHA1(d501cf1ff8b4be01970d47997f71f539df57b702)) | |
| 1810 | ROM_RELOAD(0x20000, 0x20000) | |
| 1811 | ROM_RELOAD(0x40000, 0x20000) | |
| 1812 | ROM_RELOAD(0x60000, 0x20000) | |
| 1813 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1814 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1815 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1816 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1817 | ROM_LOAD("ssdispg.201", 0x00000, 0x80000, CRC(1ad88b75) SHA1(f82ae59b59e545e2023879aad7e99862d9d339c5)) | |
| 1818 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1819 | ROM_LOAD("sssndu7.101",0x0000,0x10000,CRC(fbc6267b) SHA1(e6e70662031e5209385f8b9c59296d7423cc03b4)) | |
| 1820 | ROM_REGION(0x400000, "sound1", 0) | |
| 1821 | ROM_LOAD("sssndu17.100", 0x000000, 0x100000, CRC(dae78d8d) SHA1(a0e1722a19505e7d08266c490d27f772357722d3)) | |
| 1822 | ROM_LOAD("sssndu21.100", 0x100000, 0x100000, CRC(e1fa3f2a) SHA1(08731fd53ef81453a8f20602e76d435c6771bbb9)) | |
| 1823 | ROM_LOAD("sssndu36.100", 0x200000, 0x100000, CRC(d22fcfa3) SHA1(3fa407f72ecc64f9d00b92122c4e4d85022e4202)) | |
| 1824 | ROM_END | |
| 1825 | ROM_START(shrkyfr_207) | |
| 1826 | ROM_REGION(0x80000, "user1", 0) | |
| 1827 | ROM_LOAD("sscpu.207", 0x00000, 0x20000, CRC(7355d65d) SHA1(d501cf1ff8b4be01970d47997f71f539df57b702)) | |
| 1828 | ROM_RELOAD(0x20000, 0x20000) | |
| 1829 | ROM_RELOAD(0x40000, 0x20000) | |
| 1830 | ROM_RELOAD(0x60000, 0x20000) | |
| 1831 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1832 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1833 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1834 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1835 | ROM_LOAD("ssdispf.201", 0x00000, 0x80000, CRC(89eaaebf) SHA1(0945a11a8f632cea3b9e9982cc4aed54f12ec55a)) | |
| 1836 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1837 | ROM_LOAD("sssndu7.101",0x0000,0x10000,CRC(fbc6267b) SHA1(e6e70662031e5209385f8b9c59296d7423cc03b4)) | |
| 1838 | ROM_REGION(0x400000, "sound1", 0) | |
| 1839 | ROM_LOAD("sssndu17.100", 0x000000, 0x100000, CRC(dae78d8d) SHA1(a0e1722a19505e7d08266c490d27f772357722d3)) | |
| 1840 | ROM_LOAD("sssndu21.100", 0x100000, 0x100000, CRC(e1fa3f2a) SHA1(08731fd53ef81453a8f20602e76d435c6771bbb9)) | |
| 1841 | ROM_LOAD("sssndu36.100", 0x200000, 0x100000, CRC(d22fcfa3) SHA1(3fa407f72ecc64f9d00b92122c4e4d85022e4202)) | |
| 1842 | ROM_END | |
| 1843 | ROM_START(shrkyit_207) | |
| 1844 | ROM_REGION(0x80000, "user1", 0) | |
| 1845 | ROM_LOAD("sscpu.207", 0x00000, 0x20000, CRC(7355d65d) SHA1(d501cf1ff8b4be01970d47997f71f539df57b702)) | |
| 1846 | ROM_RELOAD(0x20000, 0x20000) | |
| 1847 | ROM_RELOAD(0x40000, 0x20000) | |
| 1848 | ROM_RELOAD(0x60000, 0x20000) | |
| 1849 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1850 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1851 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1852 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1853 | ROM_LOAD("ssdispi.201", 0x00000, 0x80000, CRC(fb70641d) SHA1(d152838eeacacc5dfe6fc3bc3f26b4d3e9e4c9cc)) | |
| 1854 | ROM_REGION(0x010000, "cpu2", 0) | |
| 1855 | ROM_LOAD("sssndu7.101",0x0000,0x10000,CRC(fbc6267b) SHA1(e6e70662031e5209385f8b9c59296d7423cc03b4)) | |
| 1856 | ROM_REGION(0x400000, "sound1", 0) | |
| 1857 | ROM_LOAD("sssndu17.100", 0x000000, 0x100000, CRC(dae78d8d) SHA1(a0e1722a19505e7d08266c490d27f772357722d3)) | |
| 1858 | ROM_LOAD("sssndu21.100", 0x100000, 0x100000, CRC(e1fa3f2a) SHA1(08731fd53ef81453a8f20602e76d435c6771bbb9)) | |
| 1859 | ROM_LOAD("sssndu36.100", 0x200000, 0x100000, CRC(d22fcfa3) SHA1(3fa407f72ecc64f9d00b92122c4e4d85022e4202)) | |
| 1860 | ROM_END | |
| 1861 | ||
| 1286 | 1862 | /*------------------------------------------------------------------- |
| 1287 | 1863 | / South Park |
| 1288 | 1864 | /-------------------------------------------------------------------*/ |
| r10613 | r10614 | |
| 1626 | 2202 | ROM_START(term3) |
| 1627 | 2203 | ROM_REGION(0x80000, "user1", 0) |
| 1628 | 2204 | ROM_LOAD("t3cpu.400", 0x00000, 0x20000, CRC(872f9351) SHA1(8fa8b503d8c3dbac66df1cb0ba400dbd58ee28ee)) |
| 1629 | //ROM_LOAD( "t3cpu.205", 0x0000, 0x20000, CRC(219d8155) SHA1(dac3c390d238872703a0ec65cb3dddc89630359c)) | |
| 1630 | //ROM_LOAD( "t3dispa.201", 0x0000, 0x80000, CRC(a314acd1) SHA1(4d5072e65f8041d24c1bab2985ef5b30e1895bf3)) | |
| 1631 | //ROM_LOAD( "t3dispf.201", 0x0000, 0x80000, CRC(ced87154) SHA1(893c071bb2427429ca45f4d2088b015c5f638207)) | |
| 1632 | //ROM_LOAD( "t3dispi.201", 0x0000, 0x80000, CRC(c1f3604f) SHA1(8a391e6471ced52662aa69261ac29a279c7b8a7d)) | |
| 1633 | //ROM_LOAD( "t3displ.201", 0x0000, 0x80000, CRC(180b55a2) SHA1(1d8161fc806804e0712ee8a07a2cac0561949f0c)) | |
| 1634 | ||
| 1635 | 2205 | ROM_RELOAD(0x20000, 0x20000) |
| 1636 | 2206 | ROM_RELOAD(0x40000, 0x20000) |
| 1637 | 2207 | ROM_RELOAD(0x60000, 0x20000) |
| r10613 | r10614 | |
| 1648 | 2218 | ROM_LOAD("t3100.u36", 0x200000, 0x100000, CRC(9eb512e9) SHA1(fa2fecf6cb0c1af3c6db244f9d94ba53d13e10fc)) |
| 1649 | 2219 | ROM_LOAD("t3100.u37", 0x300000, 0x100000, CRC(3efb0c19) SHA1(6894295eef05891d64c7274512ba27f2b63ca3ec)) |
| 1650 | 2220 | ROM_END |
| 2221 | ROM_START(term3_205) | |
| 2222 | ROM_REGION(0x80000, "user1", 0) | |
| 2223 | ROM_LOAD( "t3cpu.205", 0x0000, 0x20000, CRC(219d8155) SHA1(dac3c390d238872703a0ec65cb3dddc89630359c)) | |
| 2224 | ROM_RELOAD(0x20000, 0x20000) | |
| 2225 | ROM_RELOAD(0x40000, 0x20000) | |
| 2226 | ROM_RELOAD(0x60000, 0x20000) | |
| 2227 | ROM_REGION(0x10000, "maincpu", 0) | |
| 2228 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 2229 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 2230 | ROM_REGION(0x80000, "gfx3", 0) | |
| 2231 | ROM_LOAD( "t3dispa.201", 0x0000, 0x80000, CRC(a314acd1) SHA1(4d5072e65f8041d24c1bab2985ef5b30e1895bf3)) | |
| 2232 | ROM_REGION(0x010000, "cpu2", 0) | |
| 2233 | ROM_LOAD("t3100.u7",0x0000,0x10000,CRC(7f99e3af) SHA1(4916c074e2a4c947d1a658300f9f9629da1a8bb8)) | |
| 2234 | ROM_REGION(0x400000, "sound1", 0) | |
| 2235 | ROM_LOAD("t3100.u17", 0x000000, 0x100000, CRC(f0c71b5d) SHA1(e9f726a232fbd4f34b8b07069f337dbb3daf394a)) | |
| 2236 | ROM_LOAD("t3100.u21", 0x100000, 0x100000, CRC(694331f7) SHA1(e9ae8c5db2e59c0f9df923c98f6e75896e150807)) | |
| 2237 | ROM_LOAD("t3100.u36", 0x200000, 0x100000, CRC(9eb512e9) SHA1(fa2fecf6cb0c1af3c6db244f9d94ba53d13e10fc)) | |
| 2238 | ROM_LOAD("t3100.u37", 0x300000, 0x100000, CRC(3efb0c19) SHA1(6894295eef05891d64c7274512ba27f2b63ca3ec)) | |
| 2239 | ROM_END | |
| 1651 | 2240 | ROM_START(t3new) |
| 1652 | 2241 | ROM_REGION(0x80000, "user1", 0) |
| 1653 | 2242 | ROM_LOAD("t3cpu.400", 0x00000, 0x20000, CRC(872f9351) SHA1(8fa8b503d8c3dbac66df1cb0ba400dbd58ee28ee)) |
| r10613 | r10614 | |
| 1708 | 2297 | ROM_LOAD("t3100.u36", 0x200000, 0x100000, CRC(9eb512e9) SHA1(fa2fecf6cb0c1af3c6db244f9d94ba53d13e10fc)) |
| 1709 | 2298 | ROM_LOAD("t3100.u37", 0x300000, 0x100000, CRC(3efb0c19) SHA1(6894295eef05891d64c7274512ba27f2b63ca3ec)) |
| 1710 | 2299 | ROM_END |
| 2300 | ROM_START(term3l_205) | |
| 2301 | ROM_REGION(0x80000, "user1", 0) | |
| 2302 | ROM_LOAD( "t3cpu.205", 0x0000, 0x20000, CRC(219d8155) SHA1(dac3c390d238872703a0ec65cb3dddc89630359c)) | |
| 2303 | ROM_RELOAD(0x20000, 0x20000) | |
| 2304 | ROM_RELOAD(0x40000, 0x20000) | |
| 2305 | ROM_RELOAD(0x60000, 0x20000) | |
| 2306 | ROM_REGION(0x10000, "maincpu", 0) | |
| 2307 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 2308 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 2309 | ROM_REGION(0x80000, "gfx3", 0) | |
| 2310 | ROM_LOAD( "t3displ.201", 0x0000, 0x80000, CRC(180b55a2) SHA1(1d8161fc806804e0712ee8a07a2cac0561949f0c)) | |
| 2311 | ROM_REGION(0x010000, "cpu2", 0) | |
| 2312 | ROM_LOAD("t3100.u7",0x0000,0x10000,CRC(7f99e3af) SHA1(4916c074e2a4c947d1a658300f9f9629da1a8bb8)) | |
| 2313 | ROM_REGION(0x400000, "sound1", 0) | |
| 2314 | ROM_LOAD("t3100.u17", 0x000000, 0x100000, CRC(f0c71b5d) SHA1(e9f726a232fbd4f34b8b07069f337dbb3daf394a)) | |
| 2315 | ROM_LOAD("t3100.u21", 0x100000, 0x100000, CRC(694331f7) SHA1(e9ae8c5db2e59c0f9df923c98f6e75896e150807)) | |
| 2316 | ROM_LOAD("t3100.u36", 0x200000, 0x100000, CRC(9eb512e9) SHA1(fa2fecf6cb0c1af3c6db244f9d94ba53d13e10fc)) | |
| 2317 | ROM_LOAD("t3100.u37", 0x300000, 0x100000, CRC(3efb0c19) SHA1(6894295eef05891d64c7274512ba27f2b63ca3ec)) | |
| 2318 | ROM_END | |
| 1711 | 2319 | ROM_START(term3f) |
| 1712 | 2320 | ROM_REGION(0x80000, "user1", 0) |
| 1713 | 2321 | ROM_LOAD("t3cpu.400", 0x00000, 0x20000, CRC(872f9351) SHA1(8fa8b503d8c3dbac66df1cb0ba400dbd58ee28ee)) |
| r10613 | r10614 | |
| 1727 | 2335 | ROM_LOAD("t3100.u36", 0x200000, 0x100000, CRC(9eb512e9) SHA1(fa2fecf6cb0c1af3c6db244f9d94ba53d13e10fc)) |
| 1728 | 2336 | ROM_LOAD("t3100.u37", 0x300000, 0x100000, CRC(3efb0c19) SHA1(6894295eef05891d64c7274512ba27f2b63ca3ec)) |
| 1729 | 2337 | ROM_END |
| 2338 | ROM_START(term3f_205) | |
| 2339 | ROM_REGION(0x80000, "user1", 0) | |
| 2340 | ROM_LOAD( "t3cpu.205", 0x0000, 0x20000, CRC(219d8155) SHA1(dac3c390d238872703a0ec65cb3dddc89630359c)) | |
| 2341 | ROM_RELOAD(0x20000, 0x20000) | |
| 2342 | ROM_RELOAD(0x40000, 0x20000) | |
| 2343 | ROM_RELOAD(0x60000, 0x20000) | |
| 2344 | ROM_REGION(0x10000, "maincpu", 0) | |
| 2345 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 2346 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 2347 | ROM_REGION(0x80000, "gfx3", 0) | |
| 2348 | ROM_LOAD( "t3dispf.201", 0x0000, 0x80000, CRC(ced87154) SHA1(893c071bb2427429ca45f4d2088b015c5f638207)) | |
| 2349 | ROM_REGION(0x010000, "cpu2", 0) | |
| 2350 | ROM_LOAD("t3100.u7",0x0000,0x10000,CRC(7f99e3af) SHA1(4916c074e2a4c947d1a658300f9f9629da1a8bb8)) | |
| 2351 | ROM_REGION(0x400000, "sound1", 0) | |
| 2352 | ROM_LOAD("t3100.u17", 0x000000, 0x100000, CRC(f0c71b5d) SHA1(e9f726a232fbd4f34b8b07069f337dbb3daf394a)) | |
| 2353 | ROM_LOAD("t3100.u21", 0x100000, 0x100000, CRC(694331f7) SHA1(e9ae8c5db2e59c0f9df923c98f6e75896e150807)) | |
| 2354 | ROM_LOAD("t3100.u36", 0x200000, 0x100000, CRC(9eb512e9) SHA1(fa2fecf6cb0c1af3c6db244f9d94ba53d13e10fc)) | |
| 2355 | ROM_LOAD("t3100.u37", 0x300000, 0x100000, CRC(3efb0c19) SHA1(6894295eef05891d64c7274512ba27f2b63ca3ec)) | |
| 2356 | ROM_END | |
| 1730 | 2357 | ROM_START(term3i) |
| 1731 | 2358 | ROM_REGION(0x80000, "user1", 0) |
| 1732 | 2359 | ROM_LOAD("t3cpu.400", 0x00000, 0x20000, CRC(872f9351) SHA1(8fa8b503d8c3dbac66df1cb0ba400dbd58ee28ee)) |
| r10613 | r10614 | |
| 1747 | 2374 | ROM_LOAD("t3100.u37", 0x300000, 0x100000, CRC(3efb0c19) SHA1(6894295eef05891d64c7274512ba27f2b63ca3ec)) |
| 1748 | 2375 | ROM_END |
| 1749 | 2376 | |
| 2377 | ROM_START(term3i_205) | |
| 2378 | ROM_REGION(0x80000, "user1", 0) | |
| 2379 | ROM_LOAD( "t3cpu.205", 0x0000, 0x20000, CRC(219d8155) SHA1(dac3c390d238872703a0ec65cb3dddc89630359c)) | |
| 2380 | ROM_RELOAD(0x20000, 0x20000) | |
| 2381 | ROM_RELOAD(0x40000, 0x20000) | |
| 2382 | ROM_RELOAD(0x60000, 0x20000) | |
| 2383 | ROM_REGION(0x10000, "maincpu", 0) | |
| 2384 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 2385 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 2386 | ROM_REGION(0x80000, "gfx3", 0) | |
| 2387 | ROM_LOAD( "t3dispi.201", 0x0000, 0x80000, CRC(c1f3604f) SHA1(8a391e6471ced52662aa69261ac29a279c7b8a7d)) | |
| 2388 | ROM_REGION(0x010000, "cpu2", 0) | |
| 2389 | ROM_LOAD("t3100.u7",0x0000,0x10000,CRC(7f99e3af) SHA1(4916c074e2a4c947d1a658300f9f9629da1a8bb8)) | |
| 2390 | ROM_REGION(0x400000, "sound1", 0) | |
| 2391 | ROM_LOAD("t3100.u17", 0x000000, 0x100000, CRC(f0c71b5d) SHA1(e9f726a232fbd4f34b8b07069f337dbb3daf394a)) | |
| 2392 | ROM_LOAD("t3100.u21", 0x100000, 0x100000, CRC(694331f7) SHA1(e9ae8c5db2e59c0f9df923c98f6e75896e150807)) | |
| 2393 | ROM_LOAD("t3100.u36", 0x200000, 0x100000, CRC(9eb512e9) SHA1(fa2fecf6cb0c1af3c6db244f9d94ba53d13e10fc)) | |
| 2394 | ROM_LOAD("t3100.u37", 0x300000, 0x100000, CRC(3efb0c19) SHA1(6894295eef05891d64c7274512ba27f2b63ca3ec)) | |
| 2395 | ROM_END | |
| 2396 | ||
| 1750 | 2397 | /*------------------------------------------------------------------- |
| 1751 | 2398 | / The Brain |
| 1752 | 2399 | /-------------------------------------------------------------------*/ |
| r10613 | r10614 | |
| 1799 | 2446 | ROM_START(simpprty) |
| 1800 | 2447 | ROM_REGION(0x80000, "user1", 0) |
| 1801 | 2448 | ROM_LOAD("spp-cpu.500", 0x00000, 0x20000, CRC(215ce09c) SHA1(f3baaaa1b9f12a98109da55746031eb9f5f8790c)) // ver 5.00 |
| 1802 | //ROM_LOAD("spp-cpu.204", 0x00000, 0x20000, CRC(5bc155f7) SHA1(78d793cecbc6561a891ff8007f33c63ec5515e9f)) // ver 2.04 | |
| 2449 | //ROM_LOAD( "spp-cpu.400", 0x0000, 0x20000, CRC(530b9782) SHA1(573b20cac205b7989cdefceb2c31cb7d88c2951a)) | |
| 2450 | //ROM_LOAD( "sppdspa.400", 0x0000, 0x80000, CRC(cd5eaab7) SHA1(a06bef6fc0e7f3c0616439cb0e0431a3d52cdfa1)) | |
| 2451 | //ROM_LOAD("spp-cpu.204", 0x00000, 0x20000, CRC(5bc155f7) SHA1(78d793cecbc6561a891ff8007f33c63ec5515e9f)) // ver 2.04 | |
| 1803 | 2452 | //ROM_LOAD( "sppdspf.400", 0x0000, 0x80000, CRC(6cc306e2) SHA1(bfe6ef0cd5d0cb5e3b29d85ade1700005e22d81b)) |
| 1804 | 2453 | //ROM_LOAD( "sppdspg.400", 0x0000, 0x80000, CRC(3b408fe2) SHA1(ce8d7f0d58b5f8fb4df0b9811449e4dc0e1e6580)) |
| 1805 | 2454 | //ROM_LOAD( "sppdspi.400", 0x0000, 0x80000, CRC(ebe45dee) SHA1(4cdf0f01b1df1fa35df67f19c67b82a39d887be8)) |
| 1806 | 2455 | //ROM_LOAD( "sppdspl.400", 0x0000, 0x80000, CRC(a0bf567e) SHA1(ce6eb65da6bff15aeb787fd2cdac7cf6b4300108)) |
| 1807 | //ROM_LOAD( "spp-cpu.400", 0x0000, 0x20000, CRC(530b9782) SHA1(573b20cac205b7989cdefceb2c31cb7d88c2951a)) | |
| 1808 | //ROM_LOAD( "sppdspa.400", 0x0000, 0x80000, CRC(cd5eaab7) SHA1(a06bef6fc0e7f3c0616439cb0e0431a3d52cdfa1)) | |
| 1809 | 2456 | |
| 1810 | 2457 | ROM_RELOAD(0x20000, 0x20000) |
| 1811 | 2458 | ROM_RELOAD(0x40000, 0x20000) |
| r10613 | r10614 | |
| 2057 | 2704 | ROM_RELOAD(0x300000 + 0x80000, 0x80000) |
| 2058 | 2705 | ROM_END |
| 2059 | 2706 | |
| 2707 | /*------------------------------------------------------------- | |
| 2708 | / Cut The Cheese Deluxe (Redemption, Whitestar hardware) | |
| 2709 | /------------------------------------------------------------*/ | |
| 2710 | ROM_START(ctchzdlx) | |
| 2711 | ROM_REGION(0x80000, "user1", 0) | |
| 2712 | ROM_LOAD("ctcdxcpu.100", 0x00000, 0x20000, CRC(faad6656) SHA1(4d868bc31f35e848424e3bb66cb87efe0cf24eca)) | |
| 2713 | ROM_RELOAD(0x20000, 0x20000) | |
| 2714 | ROM_RELOAD(0x40000, 0x20000) | |
| 2715 | ROM_RELOAD(0x60000, 0x20000) | |
| 2716 | ROM_REGION(0x10000, "maincpu", 0) | |
| 2717 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 2718 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 2719 | ROM_REGION(0x80000, "gfx3", 0) | |
| 2720 | ROM_LOAD("ctcdxdsp.100", 0x00000, 0x80000, CRC(de61b12e) SHA1(2ef8f02ca995e67d1feebd33306f92e885077101)) | |
| 2721 | ROM_REGION(0x010000, "cpu2", 0) | |
| 2722 | ROM_LOAD("ctcu7d.bin", 0x0000, 0x10000, CRC(92bfe454) SHA1(8182f7ac84addf8bdb7976a85c801edf3424d16b)) | |
| 2723 | ROM_REGION(0x200000, "sound1", 0) | |
| 2724 | ROM_LOAD("ctcu17.bin", 0x000000, 0x80000, NO_DUMP) | |
| 2725 | ROM_RELOAD(0x000000 + 0x80000, 0x80000) | |
| 2726 | ROM_LOAD("ctcu21.bin", 0x100000, 0x80000, NO_DUMP) | |
| 2727 | ROM_RELOAD(0x100000 + 0x80000, 0x80000) | |
| 2728 | ROM_END | |
| 2729 | ||
| 2730 | /*------------------------------------------------------------------- | |
| 2731 | / Wack-A-Doodle-Doo (Redemption) | |
| 2732 | /-------------------------------------------------------------------*/ | |
| 2733 | ROM_START(wackadoo) | |
| 2734 | ROM_REGION(0x80000, "user1", 0) | |
| 2735 | ROM_LOAD("wackcpu.100", 0x00000, 0x20000, CRC(995e0219) SHA1(57b2352a5a96e71ff48f838fde87a158afbf3701)) | |
| 2736 | ROM_RELOAD(0x20000, 0x20000) | |
| 2737 | ROM_RELOAD(0x40000, 0x20000) | |
| 2738 | ROM_RELOAD(0x60000, 0x20000) | |
| 2739 | ROM_REGION(0x10000, "maincpu", 0) | |
| 2740 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 2741 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 2742 | ROM_REGION(0x80000, "gfx3", 0) | |
| 2743 | ROM_LOAD("wackdisp.bin", 0x00000, 0x80000, CRC(8b46f074) SHA1(38a98fff56186d1a152e2c2e321496fd24e9ad56)) | |
| 2744 | ROM_REGION(0x010000, "cpu2", 0) | |
| 2745 | ROM_LOAD("wacku7.bin", 0x0000, 0x10000, CRC(99df3022) SHA1(5a38cf0816b95ea399d659d724b3259fadb42a62)) | |
| 2746 | ROM_REGION(0x200000, "sound1", 0) | |
| 2747 | ROM_LOAD("wacku17.bin", 0x000000, 0x80000, CRC(1876e659) SHA1(1ff3a6d7a7b2582d0482eae024efa078d0a61dbe)) | |
| 2748 | ROM_RELOAD(0x000000 + 0x80000, 0x80000) | |
| 2749 | ROM_LOAD("wacku21.bin", 0x100000, 0x80000, CRC(a3207296) SHA1(19af8ebab298a353fe42fc297b61182d8f772347)) | |
| 2750 | ROM_RELOAD(0x100000 + 0x80000, 0x80000) | |
| 2751 | ROM_END | |
| 2752 | ||
| 2753 | /*------------------------------------------------------------------- | |
| 2754 | / Titanic (Coin dropper) | |
| 2755 | /-------------------------------------------------------------------*/ | |
| 2756 | ROM_START(titanic) | |
| 2757 | ROM_REGION(0x80000, "user1", 0) | |
| 2758 | ROM_LOAD("titacpu.101", 0x00000, 0x20000, CRC(4217becf) SHA1(8b7aacbe75717f13623f6ceaa4ba2de61b1b732a)) | |
| 2759 | ROM_RELOAD(0x20000, 0x20000) | |
| 2760 | ROM_RELOAD(0x40000, 0x20000) | |
| 2761 | ROM_RELOAD(0x60000, 0x20000) | |
| 2762 | ROM_REGION(0x10000, "maincpu", 0) | |
| 2763 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 2764 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 2765 | ROM_REGION(0x80000, "gfx3", 0) | |
| 2766 | ROM_LOAD("titadspa.101", 0x00000, 0x80000, CRC(5b4300b6) SHA1(c2b2de20f6c74b71d2a9ac43c17694eadd795586)) | |
| 2767 | ROM_REGION(0x010000, "cpu2", 0) | |
| 2768 | ROM_LOAD("titau7.101", 0x0000, 0x10000, CRC(544fe1ac) SHA1(5c62eef6a42660b13e626d1a6bb8cd09b77b0cc1)) | |
| 2769 | ROM_REGION(0x200000, "sound1", 0) | |
| 2770 | ROM_LOAD("titau17.100", 0x000000, 0x80000, CRC(ab919e99) SHA1(8735b632a62d9cd3db26b3c832785c48552ba231)) | |
| 2771 | ROM_RELOAD(0x000000 + 0x80000, 0x80000) | |
| 2772 | ROM_LOAD("titau21.100", 0x100000, 0x80000, CRC(76ca05f8) SHA1(3e1c56fe37393c345111665fd8ab730d53cb6970)) | |
| 2773 | ROM_RELOAD(0x100000 + 0x80000, 0x80000) | |
| 2774 | ROM_END | |
| 2775 | ||
| 2776 | /*------------------------------------------------------------------- | |
| 2777 | / Monopoly (Coin dropper) | |
| 2778 | /-------------------------------------------------------------------*/ | |
| 2779 | ROM_START(monopred) | |
| 2780 | ROM_REGION(0x80000, "user1", 0) | |
| 2781 | ROM_LOAD("monopcpu.401", 0x00000, 0x20000, CRC(2d0ff130) SHA1(c0b7baa6973db8743186a950b0a1ad3383db5c98)) | |
| 2782 | ROM_RELOAD(0x20000, 0x20000) | |
| 2783 | ROM_RELOAD(0x40000, 0x20000) | |
| 2784 | ROM_RELOAD(0x60000, 0x20000) | |
| 2785 | ROM_REGION(0x10000, "maincpu", 0) | |
| 2786 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 2787 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 2788 | ROM_REGION(0x80000, "gfx3", 0) | |
| 2789 | ROM_LOAD("monopdsp.400", 0x00000, 0x80000, CRC(0105572b) SHA1(fd9e1dfa4f396b953f82ccde11b54ee638382bee)) | |
| 2790 | ROM_REGION(0x010000, "cpu2", 0) | |
| 2791 | ROM_LOAD("monopred.u7", 0x0000, 0x10000, CRC(1ca0cf63) SHA1(c4ce78718e3e3f1a8451b134f2869dd6410fee30)) | |
| 2792 | ROM_REGION(0x200000, "sound1", 0) | |
| 2793 | ROM_LOAD("monopred.u17", 0x000000, 0x100000, CRC(467dca62) SHA1(c727748b6b0b39ead19ce98bddd89fd05fb62d00)) | |
| 2794 | ROM_END | |
| 2795 | ||
| 2060 | 2796 | GAME(1995, apollo13, 0, whitestar, whitestar, whitestar, ROT0, "Sega", "Apollo 13", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2061 | 2797 | GAME(2001, austin, 0, whitestar, whitestar, whitestar, ROT0, "Stern", "Austin Powers (3.02)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2798 | GAME(2001, aust301, austin, whitestar, whitestar, whitestar, ROT0, "Stern", "Austin Powers (3.01)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2799 | GAME(2001, aust300, austin, whitestar, whitestar, whitestar, ROT0, "Stern", "Austin Powers (3.00)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2800 | GAME(2001, aust201, austin, whitestar, whitestar, whitestar, ROT0, "Stern", "Austin Powers (2.01)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2062 | 2801 | GAME(2001, austnew, austin, whitestar, whitestar, whitestar, ROT0, "Stern", "Austin Powers (ARM7 Sound Board)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2063 | 2802 | GAME(2001, austinf, austin, whitestar, whitestar, whitestar, ROT0, "Stern", "Austin Powers (France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2064 | 2803 | GAME(2001, austing, austin, whitestar, whitestar, whitestar, ROT0, "Stern", "Austin Powers (Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| r10613 | r10614 | |
| 2092 | 2831 | GAME(1996, id4, 0, whitestar, whitestar, whitestar, ROT0, "Sega", "Independence Day", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2093 | 2832 | GAME(1998, lostspc, 0, whitestar, whitestar, whitestar, ROT0, "Sega", "Lost in Space", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2094 | 2833 | GAME(2001, monopolp, 0, whitestar, whitestar, whitestar, ROT0, "Stern", "Monopoly (3.20)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2095 | GAME(2002, monopole, monopolp, whitestar, whitestar, whitestar, ROT0, "Stern", "Monopoly (3.03)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2834 | GAME(2002, monop303, monopolp, whitestar, whitestar, whitestar, ROT0, "Stern", "Monopoly (3.03)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2835 | GAME(2002, monop301, monopolp, whitestar, whitestar, whitestar, ROT0, "Stern", "Monopoly (3.01)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2836 | GAME(2002, monop251, monopolp, whitestar, whitestar, whitestar, ROT0, "Stern", "Monopoly (2.51)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2837 | GAME(2002, monop233, monopolp, whitestar, whitestar, whitestar, ROT0, "Stern", "Monopoly (2.33)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2096 | 2838 | GAME(2002, monopolf, monopolp, whitestar, whitestar, whitestar, ROT0, "Stern", "Monopoly (France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2097 | 2839 | GAME(2002, monopolg, monopolp, whitestar, whitestar, whitestar, ROT0, "Stern", "Monopoly (Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2098 | 2840 | GAME(2002, monopoli, monopolp, whitestar, whitestar, whitestar, ROT0, "Stern", "Monopoly (Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| r10613 | r10614 | |
| 2100 | 2842 | GAME(2002, mononew, monopolp, whitestar, whitestar, whitestar, ROT0, "Stern", "Monopoly (ARM7 Sound Board)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2101 | 2843 | GAME(2001, nfl, 0, whitestar, whitestar, whitestar, ROT0, "Stern", "NFL", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2102 | 2844 | GAME(2002, playboys, 0, whitestar, whitestar, whitestar, ROT0, "Stern", "Playboy (5.00)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2845 | GAME(2002, playboys_303,playboys, whitestar, whitestar, whitestar, ROT0, "Stern", "Playboy (3.03)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2846 | GAME(2002, playboys_300,playboys, whitestar, whitestar, whitestar, ROT0, "Stern", "Playboy (3.00)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2103 | 2847 | GAME(2002, playnew, playboys, whitestar, whitestar, whitestar, ROT0, "Stern", "Playboy (ARM7 Sound Board)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2104 | GAME(2002, playboyf, playboys, whitestar, whitestar, whitestar, ROT0, "Stern", "Playboy (France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2105 | GAME(2002, playboyg, playboys, whitestar, whitestar, whitestar, ROT0, "Stern", "Playboy (Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2106 | GAME(2002, playboyi, playboys, whitestar, whitestar, whitestar, ROT0, "Stern", "Playboy (Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2107 | GAME(2002, playboyl, playboys, whitestar, whitestar, whitestar, ROT0, "Stern", "Playboy (Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2848 | GAME(2002, playboyf, 0, whitestar, whitestar, whitestar, ROT0, "Stern", "Playboy (5.00 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2849 | GAME(2002, playboyf_303,playboyf, whitestar, whitestar, whitestar, ROT0, "Stern", "Playboy (3.03 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2850 | GAME(2002, playboyf_300,playboyf, whitestar, whitestar, whitestar, ROT0, "Stern", "Playboy (3.00 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2851 | GAME(2002, playboyg, 0, whitestar, whitestar, whitestar, ROT0, "Stern", "Playboy (5.00 Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2852 | GAME(2002, playboyg_303,playboyg, whitestar, whitestar, whitestar, ROT0, "Stern", "Playboy (3.03 Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2853 | GAME(2002, playboyg_300,playboyg, whitestar, whitestar, whitestar, ROT0, "Stern", "Playboy (3.00 Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2854 | GAME(2002, playboyi, 0, whitestar, whitestar, whitestar, ROT0, "Stern", "Playboy (5.00 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2855 | GAME(2002, playboyi_303,playboyi, whitestar, whitestar, whitestar, ROT0, "Stern", "Playboy (3.03 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2856 | GAME(2002, playboyi_300,playboyi, whitestar, whitestar, whitestar, ROT0, "Stern", "Playboy (3.00 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2857 | GAME(2002, playboyl, 0, whitestar, whitestar, whitestar, ROT0, "Stern", "Playboy (5.00 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2858 | GAME(2002, playboyl_303,playboyl, whitestar, whitestar, whitestar, ROT0, "Stern", "Playboy (3.03 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2859 | GAME(2002, playboyl_300,playboyl, whitestar, whitestar, whitestar, ROT0, "Stern", "Playboy (3.00 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2108 | 2860 | GAME(2002, rctycn, 0, whitestar, whitestar, whitestar, ROT0, "Stern", "Roller Coaster Tycoon (7.02)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2861 | GAME(2002, rctycn_701, rctycn, whitestar, whitestar, whitestar, ROT0, "Stern", "Roller Coaster Tycoon (7.01)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2862 | GAME(2002, rctycn_400, rctycn, whitestar, whitestar, whitestar, ROT0, "Stern", "Roller Coaster Tycoon (4.00)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2109 | 2863 | GAME(2002, rctnew, rctycn, whitestar, whitestar, whitestar, ROT0, "Stern", "Roller Coaster Tycoon (ARM7 Sound Board)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2110 | GAME(2002, rctycng, rctycn, whitestar, whitestar, whitestar, ROT0, "Stern", "Roller Coaster Tycoon (Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2111 | GAME(2002, rctycnf, rctycn, whitestar, whitestar, whitestar, ROT0, "Stern", "Roller Coaster Tycoon (France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2112 | GAME(2002, rctycni, rctycn, whitestar, whitestar, whitestar, ROT0, "Stern", "Roller Coaster Tycoon (Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2113 | GAME(2002, rctycnl, rctycn, whitestar, whitestar, whitestar, ROT0, "Stern", "Roller Coaster Tycoon (Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2864 | GAME(2002, rctycng, 0, whitestar, whitestar, whitestar, ROT0, "Stern", "Roller Coaster Tycoon (7.02 Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2865 | GAME(2002, rctycng_701,rctycng, whitestar, whitestar, whitestar, ROT0, "Stern", "Roller Coaster Tycoon (7.01 Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2866 | GAME(2002, rctycng_400,rctycng, whitestar, whitestar, whitestar, ROT0, "Stern", "Roller Coaster Tycoon (4.00 Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2867 | GAME(2002, rctycnf, 0, whitestar, whitestar, whitestar, ROT0, "Stern", "Roller Coaster Tycoon (7.02 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2868 | GAME(2002, rctycnf_701,rctycnf, whitestar, whitestar, whitestar, ROT0, "Stern", "Roller Coaster Tycoon (7.01 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2869 | GAME(2002, rctycnf_400,rctycnf, whitestar, whitestar, whitestar, ROT0, "Stern", "Roller Coaster Tycoon (4.00 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2870 | GAME(2002, rctycni, 0, whitestar, whitestar, whitestar, ROT0, "Stern", "Roller Coaster Tycoon (7.02 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2871 | GAME(2002, rctycni_701,rctycni, whitestar, whitestar, whitestar, ROT0, "Stern", "Roller Coaster Tycoon (7.01 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2872 | GAME(2002, rctycni_400,rctycni, whitestar, whitestar, whitestar, ROT0, "Stern", "Roller Coaster Tycoon (4.00 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2873 | GAME(2002, rctycnl, 0, whitestar, whitestar, whitestar, ROT0, "Stern", "Roller Coaster Tycoon (7.02 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2874 | GAME(2002, rctycnl_701,rctycnl, whitestar, whitestar, whitestar, ROT0, "Stern", "Roller Coaster Tycoon (7.01 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2875 | GAME(2002, rctycnl_400,rctycnl, whitestar, whitestar, whitestar, ROT0, "Stern", "Roller Coaster Tycoon (4.00 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2114 | 2876 | GAME(2000, shrkysht, 0, whitestar, whitestar, whitestar, ROT0, "Stern", "Sharkey's Shootout (2.11)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2877 | GAME(2000, shrky_207, shrkysht, whitestar, whitestar, whitestar, ROT0, "Stern", "Sharkey's Shootout (2.07)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2115 | 2878 | GAME(2001, shrknew, shrkysht, whitestar, whitestar, whitestar, ROT0, "Stern", "Sharkey's Shootout (ARM7 Sound Board)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2116 | GAME(2001, shrky_gr, shrkysht, whitestar, whitestar, whitestar, ROT0, "Stern", "Sharkey's Shootout (Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2117 | GAME(2001, shrky_fr, shrkysht, whitestar, whitestar, whitestar, ROT0, "Stern", "Sharkey's Shootout (France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2118 | GAME(2001, shrky_it, shrkysht, whitestar, whitestar, whitestar, ROT0, "Stern", "Sharkey's Shootout (Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2879 | GAME(2001, shrkygr, shrkysht, whitestar, whitestar, whitestar, ROT0, "Stern", "Sharkey's Shootout (2.11 Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2880 | GAME(2001, shrkygr_207,shrkysht, whitestar, whitestar, whitestar, ROT0, "Stern", "Sharkey's Shootout (2.07 Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2881 | GAME(2001, shrkyfr, shrkysht, whitestar, whitestar, whitestar, ROT0, "Stern", "Sharkey's Shootout (2.11 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2882 | GAME(2001, shrkyfr_207,shrkysht, whitestar, whitestar, whitestar, ROT0, "Stern", "Sharkey's Shootout (2.07 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2883 | GAME(2001, shrkyit, shrkysht, whitestar, whitestar, whitestar, ROT0, "Stern", "Sharkey's Shootout (2.11 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2884 | GAME(2001, shrkyit_207,shrkysht, whitestar, whitestar, whitestar, ROT0, "Stern", "Sharkey's Shootout (2.07 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2119 | 2885 | GAME(1999, sprk_103, 0, whitestar, whitestar, whitestar, ROT0, "Sega", "South Park (1.03)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2120 | 2886 | GAME(1999, sprk_090, sprk_103, whitestar, whitestar, whitestar, ROT0, "Sega", "South Park (0.90)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2121 | 2887 | GAME(1997, spacejam, 0, whitestar, whitestar, whitestar, ROT0, "Sega", "Space Jam", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| r10613 | r10614 | |
| 2133 | 2899 | GAME(1999, strxt_it, strikext, whitestar, whitestar, whitestar, ROT0, "Stern", "Striker Xtreme (Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2134 | 2900 | GAME(1999, strxt_sp, strikext, whitestar, whitestar, whitestar, ROT0, "Stern", "Striker Xtreme (Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2135 | 2901 | GAME(2003, term3, 0, whitestar, whitestar, whitestar, ROT0, "Stern", "Terminator 3: Rise of the Machines (4.00)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2136 | GAME(2003, t3new, term3, whitestar, whitestar, whitestar, ROT0, "Stern", "Terminator 3: Rise of the Machines (Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2137 | GAME(2003, term3g, term3, whitestar, whitestar, whitestar, ROT0, "Stern", "Terminator 3: Rise of the Machines (ARM7 Sound Board)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2138 | GAME(2003, term3l, term3, whitestar, whitestar, whitestar, ROT0, "Stern", "Terminator 3: Rise of the Machines (Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2139 | GAME(2003, term3f, term3, whitestar, whitestar, whitestar, ROT0, "Stern", "Terminator 3: Rise of the Machines (France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2140 | GAME(2003, term3i, term3, whitestar, whitestar, whitestar, ROT0, "Stern", "Terminator 3: Rise of the Machines (Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2902 | GAME(2003, term3_205, term3, whitestar, whitestar, whitestar, ROT0, "Stern", "Terminator 3: Rise of the Machines (2.05)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2903 | GAME(2003, t3new, term3, whitestar, whitestar, whitestar, ROT0, "Stern", "Terminator 3: Rise of the Machines (ARM7 Sound Board)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2904 | GAME(2003, term3g, term3, whitestar, whitestar, whitestar, ROT0, "Stern", "Terminator 3: Rise of the Machines (4.00 Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2905 | GAME(2003, term3l, term3, whitestar, whitestar, whitestar, ROT0, "Stern", "Terminator 3: Rise of the Machines (4.00 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2906 | GAME(2003, term3l_205, term3, whitestar, whitestar, whitestar, ROT0, "Stern", "Terminator 3: Rise of the Machines (2.05 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2907 | GAME(2003, term3f, term3, whitestar, whitestar, whitestar, ROT0, "Stern", "Terminator 3: Rise of the Machines (4.00 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2908 | GAME(2003, term3f_205, term3, whitestar, whitestar, whitestar, ROT0, "Stern", "Terminator 3: Rise of the Machines (2.05 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2909 | GAME(2003, term3i, term3, whitestar, whitestar, whitestar, ROT0, "Stern", "Terminator 3: Rise of the Machines (4.00 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2910 | GAME(2003, term3i_205, term3, whitestar, whitestar, whitestar, ROT0, "Stern", "Terminator 3: Rise of the Machines (2.05 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2141 | 2911 | GAME(1997, jplstw22, 0, whitestar, whitestar, whitestar, ROT0, "Sega", "Lost World: Jurassic Park, The (2.02)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2142 | 2912 | GAME(1997, jplstw20, jplstw22, whitestar, whitestar, whitestar, ROT0, "Sega", "Lost World: Jurassic Park, The (2.00)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2143 | 2913 | GAME(2003, simpprty, 0, whitestar, whitestar, whitestar, ROT0, "Stern", "Simpsons Pinball Party, The (5.00)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| r10613 | r10614 | |
| 2152 | 2922 | GAME(1996, twst_404, twst_405, whitestar, whitestar, whitestar, ROT0, "Sega", "Twister (4.04)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2153 | 2923 | GAME(1996, twst_300, twst_405, whitestar, whitestar, whitestar, ROT0, "Sega", "Twister (3.00)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2154 | 2924 | GAME(1998, viprsega, 0, whitestar, whitestar, whitestar, ROT0, "Sega", "Viper Night Drivin'", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 2925 | GAME(1998, ctchzdlx, ctcheese, whitestar, whitestar, whitestar, ROT0, "Sega", "Cut The Cheese Deluxe (Redemption)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2926 | GAME(1998, titanic, 0, whitestar, whitestar, whitestar, ROT0, "Sega", "Titanic (Coin dropper)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2927 | GAME(2002, monopred, 0, whitestar, whitestar, whitestar, ROT0, "Stern", "Monopoly (Coin dropper)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 2928 | GAME(1998, wackadoo, 0, whitestar, whitestar, whitestar, ROT0, "Sega", "Wack-A-Doodle-Doo (Redemption)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| r10613 | r10614 | |
|---|---|---|
| 350 | 350 | |
| 351 | 351 | static CUSTOM_INPUT( high_port_r ) { return input_port_read(field->port->machine, (const char *)param) >> 4; } |
| 352 | 352 | static CUSTOM_INPUT( low_port_r ) { return input_port_read(field->port->machine, (const char *)param) & 0x0f; } |
| 353 | static CUSTOM_INPUT( auto_start_r ) { | |
| 354 | polepos_state *state = field->port->machine->driver_data<polepos_state>(); return state->auto_start_mask; } | |
| 353 | static CUSTOM_INPUT( auto_start_r ) | |
| 354 | { | |
| 355 | polepos_state *state = field->port->machine->driver_data<polepos_state>(); | |
| 356 | return state->auto_start_mask; | |
| 357 | } | |
| 355 | 358 | |
| 356 | 359 | static WRITE8_DEVICE_HANDLER( out_0 ) |
| 357 | 360 | { |
| r10613 | r10614 | |
|---|---|---|
| 126 | 126 | MCFG_PALETTE_INIT(atari) |
| 127 | 127 | |
| 128 | 128 | MCFG_VIDEO_START(atari) |
| 129 | ||
| 129 | ||
| 130 | 130 | /* sound hardware */ |
| 131 | 131 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 132 | 132 | MCFG_SOUND_ADD("pokey", POKEY, FREQ_17_EXACT) |
| r10613 | r10614 | |
|---|---|---|
| 400 | 400 | MCFG_SCREEN_UPDATE(atetris) |
| 401 | 401 | |
| 402 | 402 | MCFG_VIDEO_START(atetris) |
| 403 | ||
| 403 | ||
| 404 | 404 | /* sound hardware */ |
| 405 | 405 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 406 | 406 |
| r10613 | r10614 | |
|---|---|---|
| 593 | 593 | GAMEL(1976, blockade, 0, blockade, blockade, 0, ROT0, "Gremlin", "Blockade", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_blockade ) |
| 594 | 594 | GAMEL(1976, comotion, 0, blockade, comotion, 0, ROT0, "Gremlin", "Comotion", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_blockade ) |
| 595 | 595 | GAME( 1978, blasto, 0, blasto, blasto, 0, ROT0, "Gremlin", "Blasto", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // b/w, no overlay |
| 596 | GAMEL(1977, hustle, 0, blasto, hustle, 0, ROT0, "Gremlin", "Hustle", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_blockade ) | |
| 596 | GAMEL(1977, hustle, 0, blasto, hustle, 0, ROT0, "Gremlin", "Hustle", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_blockade ) | |
| 597 | 597 | GAME( 1977, mineswpr, 0, blasto, mineswpr, 0, ROT0, "Amutech", "Minesweeper", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| 598 | 598 | GAME( 1977, mineswpr4, mineswpr, blasto, mineswpr4,0, ROT0, "Amutech", "Minesweeper (4-Player)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| r10613 | r10614 | |
|---|---|---|
| 1820 | 1820 | MCFG_PALETTE_LENGTH((64*16)+(64*16)) |
| 1821 | 1821 | |
| 1822 | 1822 | MCFG_VIDEO_START(toaplan1) |
| 1823 | ||
| 1823 | ||
| 1824 | 1824 | /* sound hardware */ |
| 1825 | 1825 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1826 | 1826 |
| r10613 | r10614 | |
|---|---|---|
| 1107 | 1107 | AM_RANGE( 0xfc00, 0xfdff ) AM_RAM_WRITE(subsino_reel3_ram_w) AM_BASE(&reel3_ram) |
| 1108 | 1108 | ADDRESS_MAP_END |
| 1109 | 1109 | |
| 1110 | ||
| 1111 | /*************************************************************************** | |
| 1112 | Magic Train (Clear NVRAM ROM?) | |
| 1113 | ***************************************************************************/ | |
| 1114 | ||
| 1115 | static ADDRESS_MAP_START( mtrainnv_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 1116 | AM_RANGE( 0x00000, 0x0bfff ) AM_ROM | |
| 1117 | ||
| 1118 | AM_RANGE( 0x0c000, 0x0cfff ) AM_RAM | |
| 1119 | ||
| 1120 | AM_RANGE( 0x0d000, 0x0d000 ) AM_READ_PORT( "SW1" ) | |
| 1121 | AM_RANGE( 0x0d001, 0x0d001 ) AM_READ_PORT( "SW2" ) | |
| 1122 | AM_RANGE( 0x0d002, 0x0d002 ) AM_READ_PORT( "SW3" ) | |
| 1123 | ||
| 1124 | AM_RANGE( 0x0d004, 0x0d004 ) AM_READ_PORT( "SW4" ) | |
| 1125 | AM_RANGE( 0x0d005, 0x0d005 ) AM_READ_PORT( "INB" ) | |
| 1126 | AM_RANGE( 0x0d006, 0x0d006 ) AM_READ_PORT( "INA" ) | |
| 1127 | // AM_RANGE( 0x0d008, 0x0d008 ) AM_READWRITE | |
| 1128 | // AM_RANGE( 0x0d009, 0x0d009 ) AM_WRITE | |
| 1129 | // AM_RANGE( 0x0d00a, 0x0d00a ) AM_WRITE | |
| 1130 | // AM_RANGE( 0x0d00b, 0x0d00b ) AM_WRITE | |
| 1131 | AM_RANGE( 0x0d00c, 0x0d00c ) AM_READ_PORT( "INC" ) | |
| 1132 | ||
| 1133 | AM_RANGE( 0x0d010, 0x0d013 ) AM_WRITE(colordac_w) | |
| 1134 | ||
| 1135 | // AM_RANGE( 0x0d012, 0x0d012 ) AM_WRITE | |
| 1136 | ||
| 1137 | AM_RANGE( 0x0d016, 0x0d017 ) AM_DEVWRITE( "ymsnd", ym3812_w ) | |
| 1138 | ||
| 1139 | // AM_RANGE( 0x0d018, 0x0d018 ) AM_DEVREADWRITE_MODERN("oki", okim6295_device, read, write) | |
| 1140 | ||
| 1141 | AM_RANGE( 0x0e000, 0x0e7ff ) AM_RAM_WRITE( subsino_colorram_w ) AM_BASE( &colorram ) | |
| 1142 | AM_RANGE( 0x0e800, 0x0efff ) AM_RAM_WRITE( subsino_videoram_w ) AM_BASE( &videoram ) | |
| 1143 | ||
| 1144 | AM_RANGE( 0xf000, 0xf7ff ) AM_READWRITE(reel_scrollattr_r, reel_scrollattr_w) | |
| 1145 | ||
| 1146 | AM_RANGE( 0xf800, 0xf9ff ) AM_RAM_WRITE(subsino_reel1_ram_w) AM_BASE(&reel1_ram) | |
| 1147 | AM_RANGE( 0xfa00, 0xfbff ) AM_RAM_WRITE(subsino_reel2_ram_w) AM_BASE(&reel2_ram) | |
| 1148 | AM_RANGE( 0xfc00, 0xfdff ) AM_RAM_WRITE(subsino_reel3_ram_w) AM_BASE(&reel3_ram) | |
| 1149 | ADDRESS_MAP_END | |
| 1150 | ||
| 1151 | ||
| 1110 | 1152 | static ADDRESS_MAP_START( subsino_iomap, ADDRESS_SPACE_IO, 8 ) |
| 1111 | 1153 | AM_RANGE( 0x0000, 0x003f ) AM_RAM // internal regs |
| 1112 | 1154 | ADDRESS_MAP_END |
| r10613 | r10614 | |
| 2626 | 2668 | MCFG_PALETTE_INIT(subsino_3proms) |
| 2627 | 2669 | |
| 2628 | 2670 | MCFG_VIDEO_START(subsino) |
| 2629 | ||
| 2671 | ||
| 2630 | 2672 | /* sound hardware */ |
| 2631 | 2673 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 2632 | 2674 | |
| r10613 | r10614 | |
| 2703 | 2745 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 2704 | 2746 | MACHINE_CONFIG_END |
| 2705 | 2747 | |
| 2748 | static MACHINE_CONFIG_DERIVED( mtrainnv, stisub ) | |
| 2706 | 2749 | |
| 2750 | /* basic machine hardware */ | |
| 2751 | MCFG_CPU_MODIFY("maincpu") | |
| 2752 | MCFG_CPU_PROGRAM_MAP(mtrainnv_map) | |
| 2753 | MACHINE_CONFIG_END | |
| 2754 | ||
| 2755 | ||
| 2707 | 2756 | /*************************************************************************** |
| 2708 | 2757 | * ROMs Loading * |
| 2709 | 2758 | ***************************************************************************/ |
| r10613 | r10614 | |
| 3356 | 3405 | |
| 3357 | 3406 | |
| 3358 | 3407 | /*************************************************************************** |
| 3408 | ||
| 3409 | This is allegedly Magic Train - Clear NVRAM ROM: | |
| 3410 | ||
| 3411 | Subsino sold a "Settings/Clear ROM" for some released titles. | |
| 3412 | These devices are *extremely* expensive (and ultra rare, only sold | |
| 3413 | to big casino corporations), and should be placed in the empty socket | |
| 3414 | to fix a dead board due to NVRAM corruption. | |
| 3415 | ||
| 3416 | A version of Magic Train running on subsino.c (unlike mtrain, which is | |
| 3417 | subsino2.c) is needed to match this program ROM. | |
| 3418 | ||
| 3419 | ***************************************************************************/ | |
| 3420 | ||
| 3421 | ROM_START( mtrainnv ) | |
| 3422 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 3423 | ROM_LOAD( "mtrain_settings.bin", 0x00000, 0x10000, CRC(584af1b5) SHA1(91d966d282823dddfdc455bb03728fcdf3713dd7) ) | |
| 3424 | ||
| 3425 | ROM_REGION( 0x10000, "tilemap", 0 ) | |
| 3426 | ROM_COPY( "maincpu", 0x0000, 0x00000, 0x10000 ) // just to show something | |
| 3427 | ||
| 3428 | ROM_REGION( 0x10000, "reels", 0 ) | |
| 3429 | ROM_COPY( "maincpu", 0x0000, 0x00000, 0x10000 ) // just to show something | |
| 3430 | ROM_END | |
| 3431 | ||
| 3432 | ||
| 3433 | /*************************************************************************** | |
| 3359 | 3434 | * Driver Init / Decryption * |
| 3360 | 3435 | ***************************************************************************/ |
| 3361 | 3436 | |
| r10613 | r10614 | |
| 3529 | 3604 | reel1_attr = auto_alloc_array(machine, UINT8, 0x200); |
| 3530 | 3605 | reel2_attr = auto_alloc_array(machine, UINT8, 0x200); |
| 3531 | 3606 | reel3_attr = auto_alloc_array(machine, UINT8, 0x200); |
| 3607 | } | |
| 3532 | 3608 | |
| 3609 | static DRIVER_INIT( mtrainnv ) | |
| 3610 | { | |
| 3611 | stisub_colorram = auto_alloc_array(machine, UINT8, 256*3); | |
| 3612 | ||
| 3613 | reel1_scroll = auto_alloc_array(machine, UINT8, 0x40); | |
| 3614 | reel2_scroll = auto_alloc_array(machine, UINT8, 0x40); | |
| 3615 | reel3_scroll = auto_alloc_array(machine, UINT8, 0x40); | |
| 3616 | ||
| 3617 | reel1_attr = auto_alloc_array(machine, UINT8, 0x200); | |
| 3618 | reel2_attr = auto_alloc_array(machine, UINT8, 0x200); | |
| 3619 | reel3_attr = auto_alloc_array(machine, UINT8, 0x200); | |
| 3533 | 3620 | } |
| 3534 | 3621 | |
| 3535 | 3622 | |
| r10613 | r10614 | |
| 3537 | 3624 | * Game Drivers * |
| 3538 | 3625 | ***************************************************************************/ |
| 3539 | 3626 | |
| 3540 | /* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS LAYOUT */ | |
| 3541 | GAMEL( 1990, victor21, 0, victor21, victor21, victor21, ROT0, "Subsino / Buffy", "Victor 21", 0, layout_victor21 ) | |
| 3542 | GAMEL( 1991, victor5, 0, victor5, victor5, victor5, ROT0, "Subsino", "G.E.A.", 0, layout_victor5 ) // PCB black-box was marked 'victor 5' - in-game says G.E.A with no manufacturer info? | |
| 3543 | GAMEL( 1992, tisub, 0, tisub, tisub, tisub, ROT0, "Subsino", "Treasure Island (Subsino, set 1)", 0, layout_tisub ) | |
| 3544 | GAMEL( 1992, tisuba, tisub, tisub, tisub, tisuba, ROT0, "Subsino", "Treasure Island (Subsino, set 2)", 0, layout_tisub ) | |
| 3545 | GAMEL( 1991, crsbingo, 0, crsbingo, crsbingo, crsbingo, ROT0, "Subsino", "Poker Carnival", 0, layout_crsbingo ) | |
| 3546 | GAMEL( 1995, stisub, 0, stisub, stisub, stisub, ROT0, "American Alpha", "Treasure Bonus (Subsino)", 0, layout_stisub ) // board CPU module marked 'Super Treasure Island' (alt title?) | |
| 3547 | GAMEL( 1996, sharkpy, 0, sharkpy, sharkpy, sharkpy, ROT0, "Subsino", "Shark Party (Italy, v1.3)", 0, layout_sharkpy ) // missing POST messages? | |
| 3548 | GAMEL( 1996, sharkpya, sharkpy, sharkpy, sharkpy, sharkpy, ROT0, "Subsino", "Shark Party (Italy, v1.6)", 0, layout_sharkpy ) // missing POST messages? | |
| 3549 | GAMEL( 1995, sharkpye, sharkpy, sharkpy, sharkpye, sharkpye, ROT0, "American Alpha", "Shark Party (English, Alpha license)", 0, layout_sharkpye ) // PCB black-box was marked 'victor 6' | |
| 3550 | GAMEL( 1995, victor6, 0, sharkpy, victor6, sharkpye, ROT0, "American Alpha", "Victor 6 (v2.3N)", 0, layout_sharkpye ) // ^^ | |
| 3551 | GAMEL( 1995, victor6a, victor6, sharkpy, victor6a, sharkpye, ROT0, "American Alpha", "Victor 6 (v2.3)", 0, layout_sharkpye ) // ^^ | |
| 3552 | GAMEL( 1995, victor6b, victor6, sharkpy, victor6b, sharkpye, ROT0, "American Alpha", "Victor 6 (v1.2)", 0, layout_sharkpye ) // ^^ Version # according to label, not displayed | |
| 3553 | GAMEL( 1996, smoto20, 0, srider, smoto20, smoto20, ROT0, "Subsino", "Super Rider (Italy, v2.0)", 0, layout_smoto ) | |
| 3554 | GAMEL( 1996, smoto16, smoto20, srider, smoto16, smoto16, ROT0, "Subsino", "Super Moto (Italy, v1.6)", 0, layout_smoto ) | |
| 3627 | // YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS LAYOUT | |
| 3628 | GAMEL( 1990, victor21, 0, victor21, victor21, victor21, ROT0, "Subsino / Buffy", "Victor 21", 0, layout_victor21 ) | |
| 3629 | GAMEL( 1991, victor5, 0, victor5, victor5, victor5, ROT0, "Subsino", "G.E.A.", 0, layout_victor5 ) // PCB black-box was marked 'victor 5' - in-game says G.E.A with no manufacturer info? | |
| 3630 | GAMEL( 1992, tisub, 0, tisub, tisub, tisub, ROT0, "Subsino", "Treasure Island (Subsino, set 1)", 0, layout_tisub ) | |
| 3631 | GAMEL( 1992, tisuba, tisub, tisub, tisub, tisuba, ROT0, "Subsino", "Treasure Island (Subsino, set 2)", 0, layout_tisub ) | |
| 3632 | GAMEL( 1991, crsbingo, 0, crsbingo, crsbingo, crsbingo, ROT0, "Subsino", "Poker Carnival", 0, layout_crsbingo ) | |
| 3633 | GAMEL( 1995, stisub, 0, stisub, stisub, stisub, ROT0, "American Alpha", "Treasure Bonus (Subsino)", 0, layout_stisub ) // board CPU module marked 'Super Treasure Island' (alt title?) | |
| 3634 | GAMEL( 1996, sharkpy, 0, sharkpy, sharkpy, sharkpy, ROT0, "Subsino", "Shark Party (Italy, v1.3)", 0, layout_sharkpy ) // missing POST messages? | |
| 3635 | GAMEL( 1996, sharkpya, sharkpy, sharkpy, sharkpy, sharkpy, ROT0, "Subsino", "Shark Party (Italy, v1.6)", 0, layout_sharkpy ) // missing POST messages? | |
| 3636 | GAMEL( 1995, sharkpye, sharkpy, sharkpy, sharkpye, sharkpye, ROT0, "American Alpha", "Shark Party (English, Alpha license)", 0, layout_sharkpye ) // PCB black-box was marked 'victor 6' | |
| 3637 | GAMEL( 1995, victor6, 0, sharkpy, victor6, sharkpye, ROT0, "American Alpha", "Victor 6 (v2.3N)", 0, layout_sharkpye ) // ^^ | |
| 3638 | GAMEL( 1995, victor6a, victor6, sharkpy, victor6a, sharkpye, ROT0, "American Alpha", "Victor 6 (v2.3)", 0, layout_sharkpye ) // ^^ | |
| 3639 | GAMEL( 1995, victor6b, victor6, sharkpy, victor6b, sharkpye, ROT0, "American Alpha", "Victor 6 (v1.2)", 0, layout_sharkpye ) // ^^ Version # according to label, not displayed | |
| 3640 | GAMEL( 1996, smoto20, 0, srider, smoto20, smoto20, ROT0, "Subsino", "Super Rider (Italy, v2.0)", 0, layout_smoto ) | |
| 3641 | GAMEL( 1996, smoto16, smoto20, srider, smoto16, smoto16, ROT0, "Subsino", "Super Moto (Italy, v1.6)", 0, layout_smoto ) | |
| 3642 | GAME ( 1996, mtrainnv, mtrain, mtrainnv, stisub, mtrainnv, ROT0, "Subsino", "Magic Train (Clear NVRAM ROM?)", GAME_NOT_WORKING ) |
| r10613 | r10614 | |
|---|---|---|
| 689 | 689 | MCFG_PALETTE_LENGTH(0x10000) |
| 690 | 690 | |
| 691 | 691 | MCFG_VIDEO_START(jchan) |
| 692 | ||
| 692 | ||
| 693 | 693 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 694 | 694 | |
| 695 | 695 | /* sound hardware */ |
| r10613 | r10614 | |
| 792 | 792 | |
| 793 | 793 | |
| 794 | 794 | memset(state->mcu_com, 0, 4 * sizeof( UINT16 ) ); |
| 795 | ||
| 795 | ||
| 796 | 796 | machine->device<nvram_device>("nvram")->set_base(state->nvram_data, sizeof(state->nvram_data)); |
| 797 | 797 | } |
| 798 | 798 |
| r10613 | r10614 | |
|---|---|---|
| 27 | 27 | #include "sound/2151intf.h" |
| 28 | 28 | #include "sound/msm5205.h" |
| 29 | 29 | |
| 30 | static UINT16 * ml_tileram; | |
| 31 | static UINT16 *g_ram; | |
| 32 | static UINT16 * ml_dotram; | |
| 33 | static UINT16 *dma_ram; | |
| 34 | static UINT32 adpcm_pos,adpcm_end; | |
| 35 | static int adpcm_data; | |
| 36 | static UINT8 adpcm_idle; | |
| 37 | static UINT8 pal_fg_bank; | |
| 38 | static int dma_active; | |
| 39 | static UINT16 dsp_HOLD_signal; | |
| 40 | static UINT8 *mecha_ram; | |
| 41 | 30 | |
| 31 | class mlanding_state : public driver_device | |
| 32 | { | |
| 33 | public: | |
| 34 | mlanding_state(running_machine &machine, const driver_device_config_base &config) | |
| 35 | : driver_device(machine, config) { } | |
| 36 | ||
| 37 | UINT16 * ml_tileram; | |
| 38 | UINT16 *g_ram; | |
| 39 | UINT16 * ml_dotram; | |
| 40 | UINT16 *dma_ram; | |
| 41 | UINT32 adpcm_pos; | |
| 42 | UINT32 adpcm_end; | |
| 43 | int adpcm_data; | |
| 44 | UINT8 adpcm_idle; | |
| 45 | UINT8 pal_fg_bank; | |
| 46 | int dma_active; | |
| 47 | UINT16 dsp_HOLD_signal; | |
| 48 | UINT8 *mecha_ram; | |
| 49 | UINT8 trigger; | |
| 50 | }; | |
| 51 | ||
| 52 | ||
| 53 | ||
| 42 | 54 | static VIDEO_START(mlanding) |
| 43 | 55 | { |
| 44 | 56 | } |
| r10613 | r10614 | |
| 49 | 61 | // 768: plane landing sequence |
| 50 | 62 | static SCREEN_UPDATE(mlanding) |
| 51 | 63 | { |
| 64 | mlanding_state *state = screen->machine->driver_data<mlanding_state>(); | |
| 52 | 65 | int x, y; |
| 53 | 66 | |
| 54 | 67 | for (y = cliprect->min_y; y <= cliprect->max_y; ++y) |
| 55 | 68 | { |
| 56 | UINT16 *src = &g_ram[y * 512/2 + cliprect->min_x]; | |
| 69 | UINT16 *src = &state->g_ram[y * 512/2 + cliprect->min_x]; | |
| 57 | 70 | UINT16 *dst = BITMAP_ADDR16(bitmap, y, cliprect->min_x); |
| 58 | 71 | |
| 59 | 72 | for (x = cliprect->min_x; x <= cliprect->max_x; x += 2) |
| 60 | 73 | { |
| 61 | 74 | UINT16 srcpix = *src++; |
| 62 | 75 | |
| 63 | *dst++ = screen->machine->pens[256+(srcpix & 0xff) + (pal_fg_bank & 1 ? 0x100 : 0x000)]; | |
| 64 | *dst++ = screen->machine->pens[256+(srcpix >> 8) + (pal_fg_bank & 1 ? 0x100 : 0x000)]; | |
| 76 | *dst++ = screen->machine->pens[256+(srcpix & 0xff) + (state->pal_fg_bank & 1 ? 0x100 : 0x000)]; | |
| 77 | *dst++ = screen->machine->pens[256+(srcpix >> 8) + (state->pal_fg_bank & 1 ? 0x100 : 0x000)]; | |
| 65 | 78 | } |
| 66 | 79 | } |
| 67 | 80 | |
| r10613 | r10614 | |
| 69 | 82 | } |
| 70 | 83 | |
| 71 | 84 | /* Return the number of pixels processed for timing purposes? */ |
| 72 | static int start_dma( | |
| 85 | static int start_dma(running_machine *machine) | |
| 73 | 86 | { |
| 87 | mlanding_state *state = machine->driver_data<mlanding_state>(); | |
| 74 | 88 | /* Traverse the DMA RAM list */ |
| 75 | 89 | int offs; |
| 76 | 90 | |
| r10613 | r10614 | |
| 85 | 99 | |
| 86 | 100 | int j, k; |
| 87 | 101 | |
| 88 | UINT16 attr = dma_ram[offs]; | |
| 102 | UINT16 attr = state->dma_ram[offs]; | |
| 89 | 103 | |
| 90 | 104 | if (attr == 0) |
| 91 | 105 | continue; |
| 92 | 106 | |
| 93 | x = dma_ram[offs + 1]; | |
| 94 | y = dma_ram[offs + 2]; | |
| 95 | colour = dma_ram[offs + 3]; | |
| 107 | x = state->dma_ram[offs + 1]; | |
| 108 | y = state->dma_ram[offs + 2]; | |
| 109 | colour = state->dma_ram[offs + 3]; | |
| 96 | 110 | |
| 97 | 111 | dx = x >> 11; |
| 98 | 112 | dy = y >> 11; |
| r10613 | r10614 | |
| 127 | 141 | // Draw the 8x8 chunk |
| 128 | 142 | for (y1 = 0; y1 < 8; ++y1) |
| 129 | 143 | { |
| 130 | UINT16 *src = &ml_tileram[(code * 2 * 8) + y1*2]; | |
| 131 | UINT16 *dst = &g_ram[(y + k*8+y1)*512/2 + (j*8+x)/2]; | |
| 144 | UINT16 *src = &state->ml_tileram[(code * 2 * 8) + y1*2]; | |
| 145 | UINT16 *dst = &state->g_ram[(y + k*8+y1)*512/2 + (j*8+x)/2]; | |
| 132 | 146 | |
| 133 | 147 | UINT8 p2 = *src & 0xff; |
| 134 | 148 | UINT8 p1 = *src++ >> 8; |
| r10613 | r10614 | |
| 175 | 189 | for(y1 = 0; y1 < dy*8; y1++) |
| 176 | 190 | { |
| 177 | 191 | int x1; |
| 178 | UINT16 *dst = &g_ram[((y + y1) * 512/2) + x/2]; | |
| 192 | UINT16 *dst = &state->g_ram[((y + y1) * 512/2) + x/2]; | |
| 179 | 193 | |
| 180 | 194 | for(x1 = 0; x1 < dx*8; x1+=2) |
| 181 | 195 | { |
| r10613 | r10614 | |
| 189 | 203 | |
| 190 | 204 | static WRITE16_HANDLER(ml_tileram_w) |
| 191 | 205 | { |
| 192 | COMBINE_DATA(&ml_tileram[offset]); | |
| 206 | mlanding_state *state = space->machine->driver_data<mlanding_state>(); | |
| 207 | COMBINE_DATA(&state->ml_tileram[offset]); | |
| 193 | 208 | } |
| 194 | 209 | |
| 195 | 210 | static READ16_HANDLER(ml_tileram_r) |
| 196 | 211 | { |
| 197 | return ml_tileram[offset]; | |
| 212 | mlanding_state *state = space->machine->driver_data<mlanding_state>(); | |
| 213 | return state->ml_tileram[offset]; | |
| 198 | 214 | } |
| 199 | 215 | |
| 200 | 216 | |
| 201 | 217 | static READ16_HANDLER( io1_r ) //240006 |
| 202 | 218 | { |
| 219 | mlanding_state *state = space->machine->driver_data<mlanding_state>(); | |
| 203 | 220 | /* |
| 204 | 221 | fedcba9876543210 |
| 205 | 222 | x - mecha driver status |
| r10613 | r10614 | |
| 211 | 228 | */ |
| 212 | 229 | // multiplexed? or just overriden? |
| 213 | 230 | |
| 214 | int retval = (dma_active << 15) | (input_port_read(space->machine, "DSW") & 0x7fff); | |
| 231 | int retval = (state->dma_active << 15) | (input_port_read(space->machine, "DSW") & 0x7fff); | |
| 215 | 232 | return retval; |
| 216 | 233 | } |
| 217 | 234 | |
| 218 | 235 | /* output */ |
| 219 | 236 | static WRITE16_HANDLER(ml_output_w) |
| 220 | 237 | { |
| 238 | mlanding_state *state = space->machine->driver_data<mlanding_state>(); | |
| 221 | 239 | /* |
| 222 | 240 | x--- ---- palette fg bankswitch |
| 223 | 241 | ---x ---- coin lockout? |
| r10613 | r10614 | |
| 226 | 244 | */ |
| 227 | 245 | // popmessage("%04x",data); |
| 228 | 246 | |
| 229 | pal_fg_bank = (data & 0x80)>>7; | |
| 247 | state->pal_fg_bank = (data & 0x80)>>7; | |
| 230 | 248 | } |
| 231 | 249 | |
| 232 | 250 | static WRITE8_DEVICE_HANDLER( sound_bankswitch_w ) |
| r10613 | r10614 | |
| 237 | 255 | |
| 238 | 256 | static void ml_msm5205_vck(device_t *device) |
| 239 | 257 | { |
| 240 | stat | |
| 258 | mlanding_state | |
| 241 | 259 | |
| 242 | // popmessage("%08x",adpcm_pos); | |
| 260 | // popmessage("%08x",state->adpcm_pos); | |
| 243 | 261 | |
| 244 | if (adpcm_pos >= 0x50000 || adpcm_idle) | |
| 262 | if (state->adpcm_pos >= 0x50000 || state->adpcm_idle) | |
| 245 | 263 | { |
| 246 | //adpcm_idle = 1; | |
| 264 | //state->adpcm_idle = 1; | |
| 247 | 265 | msm5205_reset_w(device,1); |
| 248 | trigger = 0; | |
| 266 | state->trigger = 0; | |
| 249 | 267 | } |
| 250 | 268 | else |
| 251 | 269 | { |
| 252 | 270 | UINT8 *ROM = device->machine->region("adpcm")->base(); |
| 253 | 271 | |
| 254 | adpcm_data = ((trigger ? (ROM[adpcm_pos] & 0x0f) : (ROM[adpcm_pos] & 0xf0)>>4) ); | |
| 255 | msm5205_data_w(device,adpcm_data & 0xf); | |
| 256 | trigger^=1; | |
| 257 | if(trigger == 0) | |
| 272 | state->adpcm_data = ((state->trigger ? (ROM[state->adpcm_pos] & 0x0f) : (ROM[state->adpcm_pos] & 0xf0)>>4) ); | |
| 273 | msm5205_data_w(device,state->adpcm_data & 0xf); | |
| 274 | state->trigger^=1; | |
| 275 | if(state->trigger == 0) | |
| 258 | 276 | { |
| 259 | adpcm_pos++; | |
| 277 | state->adpcm_pos++; | |
| 260 | 278 | //cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); |
| 261 | 279 | /*TODO: simplify this */ |
| 262 | if(ROM[adpcm_pos] == 0x00 && ROM[adpcm_pos+1] == 0x00 && ROM[adpcm_pos+2] == 0x00 && ROM[adpcm_pos+3] == 0x00 | |
| 263 | && ROM[adpcm_pos+4] == 0x00 && ROM[adpcm_pos+5] == 0x00 && ROM[adpcm_pos+6] == 0x00 && ROM[adpcm_pos+7] == 0x00 | |
| 264 | && ROM[adpcm_pos+8] == 0x00 && ROM[adpcm_pos+9] == 0x00 && ROM[adpcm_pos+10] == 0x00 && ROM[adpcm_pos+11] == 0x00 | |
| 265 | && ROM[adpcm_pos+12] == 0x00 && ROM[adpcm_pos+13] == 0x00 && ROM[adpcm_pos+14] == 0x00 && ROM[adpcm_pos+15] == 0x00) | |
| 266 | adpcm_idle = 1; | |
| 280 | if(ROM[state->adpcm_pos] == 0x00 && ROM[state->adpcm_pos+1] == 0x00 && ROM[state->adpcm_pos+2] == 0x00 && ROM[state->adpcm_pos+3] == 0x00 | |
| 281 | && ROM[state->adpcm_pos+4] == 0x00 && ROM[state->adpcm_pos+5] == 0x00 && ROM[state->adpcm_pos+6] == 0x00 && ROM[state->adpcm_pos+7] == 0x00 | |
| 282 | && ROM[state->adpcm_pos+8] == 0x00 && ROM[state->adpcm_pos+9] == 0x00 && ROM[state->adpcm_pos+10] == 0x00 && ROM[state->adpcm_pos+11] == 0x00 | |
| 283 | && ROM[state->adpcm_pos+12] == 0x00 && ROM[state->adpcm_pos+13] == 0x00 && ROM[state->adpcm_pos+14] == 0x00 && ROM[state->adpcm_pos+15] == 0x00) | |
| 284 | state->adpcm_idle = 1; | |
| 267 | 285 | } |
| 268 | 286 | } |
| 269 | 287 | } |
| 270 | 288 | |
| 271 | 289 | static TIMER_CALLBACK( dma_complete ) |
| 272 | 290 | { |
| 273 | dma_active = 0; | |
| 291 | mlanding_state *state = machine->driver_data<mlanding_state>(); | |
| 292 | state->dma_active = 0; | |
| 274 | 293 | } |
| 275 | 294 | |
| 276 | 295 | /* TODO: this uses many bits */ |
| 277 | 296 | static WRITE16_HANDLER( ml_sub_reset_w ) |
| 278 | 297 | { |
| 298 | mlanding_state *state = space->machine->driver_data<mlanding_state>(); | |
| 279 | 299 | int pixels; |
| 280 | 300 | |
| 281 | 301 | // Return the number of pixels drawn? |
| 282 | pixels = start_dma(); | |
| 302 | pixels = start_dma(space->machine); | |
| 283 | 303 | |
| 284 | 304 | if (pixels) |
| 285 | 305 | { |
| 286 | dma_active = 1; | |
| 306 | state->dma_active = 1; | |
| 287 | 307 | space->machine->scheduler().timer_set(attotime::from_msec(20), FUNC(dma_complete)); |
| 288 | 308 | } |
| 289 | 309 | |
| r10613 | r10614 | |
| 295 | 315 | if(!(data & 0x80)) // unknown line used |
| 296 | 316 | { |
| 297 | 317 | cputag_set_input_line(space->machine, "dsp", INPUT_LINE_RESET, CLEAR_LINE); |
| 298 | dsp_HOLD_signal = data & 0x80; | |
| 318 | state->dsp_HOLD_signal = data & 0x80; | |
| 299 | 319 | } |
| 300 | 320 | } |
| 301 | 321 | |
| r10613 | r10614 | |
| 366 | 386 | |
| 367 | 387 | static READ16_HANDLER( ml_analog2_msb_r ) |
| 368 | 388 | { |
| 369 | static UINT8 res; | |
| 370 | static UINT16 y_adc,x_adc; | |
| 389 | UINT8 res; | |
| 390 | UINT16 y_adc,x_adc; | |
| 371 | 391 | |
| 372 | 392 | y_adc = input_port_read(space->machine, "STICKY"); |
| 373 | 393 | x_adc = input_port_read(space->machine, "STICKZ"); |
| r10613 | r10614 | |
| 391 | 411 | |
| 392 | 412 | static READ16_HANDLER( ml_analog3_msb_r ) |
| 393 | 413 | { |
| 394 | static UINT8 z_adc,res; | |
| 395 | static UINT16 x_adc; | |
| 414 | UINT8 z_adc,res; | |
| 415 | UINT16 x_adc; | |
| 396 | 416 | |
| 397 | 417 | z_adc = input_port_read(space->machine, "STICKX"); |
| 398 | 418 | x_adc = input_port_read(space->machine, "STICKZ"); |
| r10613 | r10614 | |
| 419 | 439 | |
| 420 | 440 | static READ16_HANDLER( ml_mecha_ram_r ) |
| 421 | 441 | { |
| 422 | return (mecha_ram[offset*2]<<8)|mecha_ram[offset*2+1]; | |
| 442 | mlanding_state *state = space->machine->driver_data<mlanding_state>(); | |
| 443 | return (state->mecha_ram[offset*2]<<8)|state->mecha_ram[offset*2+1]; | |
| 423 | 444 | } |
| 424 | 445 | |
| 425 | 446 | static WRITE16_HANDLER( ml_mecha_ram_w ) |
| 426 | 447 | { |
| 427 | COMBINE_DATA(mecha_ram+offset*2+1); | |
| 448 | mlanding_state *state = space->machine->driver_data<mlanding_state>(); | |
| 449 | COMBINE_DATA(state->mecha_ram+offset*2+1); | |
| 428 | 450 | data >>= 8; |
| 429 | 451 | mem_mask >>= 8; |
| 430 | COMBINE_DATA(mecha_ram+offset*2); | |
| 452 | COMBINE_DATA(state->mecha_ram+offset*2); | |
| 431 | 453 | } |
| 432 | 454 | |
| 433 | 455 | static ADDRESS_MAP_START( mlanding_mem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 434 | 456 | AM_RANGE(0x000000, 0x05ffff) AM_ROM |
| 435 | 457 | AM_RANGE(0x080000, 0x08ffff) AM_RAM |
| 436 | 458 | |
| 437 | AM_RANGE(0x100000, 0x17ffff) AM_RAM AM_BASE(&g_ram)// 512kB G RAM - enough here for double buffered 512x400x8 frame | |
| 438 | AM_RANGE(0x180000, 0x1bffff) AM_READWRITE(ml_tileram_r, ml_tileram_w) AM_BASE(&ml_tileram) | |
| 439 | AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM AM_SHARE("share2") AM_BASE(&dma_ram) | |
| 459 | AM_RANGE(0x100000, 0x17ffff) AM_RAM AM_BASE_MEMBER(mlanding_state, g_ram)// 512kB G RAM - enough here for double buffered 512x400x8 frame | |
| 460 | AM_RANGE(0x180000, 0x1bffff) AM_READWRITE(ml_tileram_r, ml_tileram_w) AM_BASE_MEMBER(mlanding_state, ml_tileram) | |
| 461 | AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM AM_SHARE("share2") AM_BASE_MEMBER(mlanding_state, dma_ram) | |
| 440 | 462 | AM_RANGE(0x1c4000, 0x1cffff) AM_RAM AM_SHARE("share1") |
| 441 | 463 | |
| 442 | 464 | AM_RANGE(0x1d0000, 0x1d0001) AM_WRITE(ml_sub_reset_w) |
| r10613 | r10614 | |
| 474 | 496 | AM_RANGE(0x050000, 0x0503ff) AM_RAM AM_SHARE("share3") |
| 475 | 497 | AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM AM_SHARE("share2") |
| 476 | 498 | AM_RANGE(0x1c4000, 0x1cffff) AM_RAM AM_SHARE("share1") |
| 477 | AM_RANGE(0x200000, 0x203fff) AM_RAM AM_BASE( | |
| 499 | AM_RANGE(0x200000, 0x203fff) AM_RAM AM_BASE_MEMBER(mlanding_state, ml_dotram) | |
| 478 | 500 | ADDRESS_MAP_END |
| 479 | 501 | |
| 480 | 502 | static WRITE8_DEVICE_HANDLER( ml_msm_start_lsb_w ) |
| 481 | 503 | { |
| 482 | adpcm_pos = (adpcm_pos & 0x0f0000) | ((data & 0xff)<<8) | 0x20; | |
| 483 | adpcm_idle = 0; | |
| 504 | mlanding_state *state = device->machine->driver_data<mlanding_state>(); | |
| 505 | state->adpcm_pos = (state->adpcm_pos & 0x0f0000) | ((data & 0xff)<<8) | 0x20; | |
| 506 | state->adpcm_idle = 0; | |
| 484 | 507 | msm5205_reset_w(device,0); |
| 485 | adpcm_end = (adpcm_pos+0x800); | |
| 508 | state->adpcm_end = (state->adpcm_pos+0x800); | |
| 486 | 509 | } |
| 487 | 510 | |
| 488 | 511 | static WRITE8_HANDLER( ml_msm_start_msb_w ) |
| 489 | 512 | { |
| 490 | adpcm_pos = (adpcm_pos & 0x00ff00) | ((data & 0x0f)<<16) | 0x20; | |
| 513 | mlanding_state *state = space->machine->driver_data<mlanding_state>(); | |
| 514 | state->adpcm_pos = (state->adpcm_pos & 0x00ff00) | ((data & 0x0f)<<16) | 0x20; | |
| 491 | 515 | } |
| 492 | 516 | |
| 493 | 517 | static ADDRESS_MAP_START( mlanding_z80_mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r10613 | r10614 | |
| 508 | 532 | |
| 509 | 533 | static READ16_HANDLER( ml_dotram_r ) |
| 510 | 534 | { |
| 511 | return ml_dotram[offset]; | |
| 535 | mlanding_state *state = space->machine->driver_data<mlanding_state>(); | |
| 536 | return state->ml_dotram[offset]; | |
| 512 | 537 | } |
| 513 | 538 | |
| 514 | 539 | static WRITE16_HANDLER( ml_dotram_w ) |
| 515 | 540 | { |
| 516 | ml_dotram[offset] = data; | |
| 541 | mlanding_state *state = space->machine->driver_data<mlanding_state>(); | |
| 542 | state->ml_dotram[offset] = data; | |
| 517 | 543 | } |
| 518 | 544 | |
| 519 | 545 | static READ16_HANDLER( dsp_HOLD_signal_r ) |
| 520 | 546 | { |
| 521 | return dsp_HOLD_signal; | |
| 547 | mlanding_state *state = space->machine->driver_data<mlanding_state>(); | |
| 548 | return state->dsp_HOLD_signal; | |
| 522 | 549 | } |
| 523 | 550 | |
| 524 | 551 | |
| r10613 | r10614 | |
| 530 | 557 | //mecha driver ? |
| 531 | 558 | static ADDRESS_MAP_START( mlanding_z80_sub_mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 532 | 559 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 533 | AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE( | |
| 560 | AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE_MEMBER(mlanding_state, mecha_ram) | |
| 534 | 561 | AM_RANGE(0x8800, 0x8fff) AM_RAM |
| 535 | 562 | |
| 536 | 563 | AM_RANGE(0x9000, 0x9001) AM_READ(test_r) |
| r10613 | r10614 | |
| 708 | 735 | |
| 709 | 736 | static MACHINE_RESET( mlanding ) |
| 710 | 737 | { |
| 738 | mlanding_state *state = machine->driver_data<mlanding_state>(); | |
| 711 | 739 | cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, ASSERT_LINE); |
| 712 | 740 | cputag_set_input_line(machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE); |
| 713 | 741 | cputag_set_input_line(machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE); |
| 714 | adpcm_pos = 0; | |
| 715 | adpcm_data = -1; | |
| 716 | adpcm_idle = 1; | |
| 717 | dsp_HOLD_signal = 0; | |
| 742 | state->adpcm_pos = 0; | |
| 743 | state->adpcm_data = -1; | |
| 744 | state->adpcm_idle = 1; | |
| 745 | state->dsp_HOLD_signal = 0; | |
| 718 | 746 | } |
| 719 | 747 | |
| 720 | static MACHINE_CONFIG_START( mlanding, d | |
| 748 | static MACHINE_CONFIG_START( mlanding, mland | |
| 721 | 749 | |
| 722 | 750 | /* basic machine hardware */ |
| 723 | 751 | MCFG_CPU_ADD("maincpu", M68000, 12000000 ) /* 12 MHz ??? (guess) */ |
| r10613 | r10614 | |
|---|---|---|
| 47 | 47 | { |
| 48 | 48 | UINT8 *ROM = space->machine->region("voice")->base(); |
| 49 | 49 | |
| 50 | return ROM[pastelg_blitter_src_addr_r() & 0x7fff]; | |
| 50 | return ROM[pastelg_blitter_src_addr_r(space) & 0x7fff]; | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | static ADDRESS_MAP_START( pastelg_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r10613 | r10614 | |
| 77 | 77 | AM_RANGE(0xe0, 0xe0) AM_READ_PORT("DSWC") |
| 78 | 78 | ADDRESS_MAP_END |
| 79 | 79 | |
| 80 | static UINT8 mux_data; | |
| 81 | 80 | |
| 82 | 81 | static READ8_HANDLER( threeds_inputport1_r ) |
| 83 | 82 | { |
| 84 | switch(mux_data) | |
| 83 | pastelg_state *state = space->machine->driver_data<pastelg_state>(); | |
| 84 | switch(state->mux_data) | |
| 85 | 85 | { |
| 86 | 86 | case 0x01: return input_port_read(space->machine,"KEY0_PL1"); |
| 87 | 87 | case 0x02: return input_port_read(space->machine,"KEY1_PL1"); |
| r10613 | r10614 | |
| 95 | 95 | |
| 96 | 96 | static READ8_HANDLER( threeds_inputport2_r ) |
| 97 | 97 | { |
| 98 | switch(mux_data) | |
| 98 | pastelg_state *state = space->machine->driver_data<pastelg_state>(); | |
| 99 | switch(state->mux_data) | |
| 99 | 100 | { |
| 100 | 101 | case 0x01: return input_port_read(space->machine,"KEY0_PL2"); |
| 101 | 102 | case 0x02: return input_port_read(space->machine,"KEY1_PL2"); |
| r10613 | r10614 | |
| 109 | 110 | |
| 110 | 111 | static WRITE8_HANDLER( threeds_inputportsel_w ) |
| 111 | 112 | { |
| 112 | mux_data = ~data; | |
| 113 | pastelg_state *state = space->machine->driver_data<pastelg_state>(); | |
| 114 | state->mux_data = ~data; | |
| 113 | 115 | } |
| 114 | 116 | |
| 115 | 117 | static ADDRESS_MAP_START( threeds_io_map, ADDRESS_SPACE_IO, 8 ) |
| r10613 | r10614 | |
| 405 | 407 | }; |
| 406 | 408 | |
| 407 | 409 | |
| 408 | static MACHINE_CONFIG_START( pastelg, | |
| 410 | static MACHINE_CONFIG_START( pastelg, pastelg_stat | |
| 409 | 411 | |
| 410 | 412 | /* basic machine hardware */ |
| 411 | 413 | MCFG_CPU_ADD("maincpu", Z80, 19968000/4) /* unknown divider, galds definitely relies on this for correct voice pitch */ |
| r10613 | r10614 | |
| 465 | 467 | |
| 466 | 468 | */ |
| 467 | 469 | |
| 468 | static MACHINE_CONFIG_START( threeds, | |
| 470 | static MACHINE_CONFIG_START( threeds, pastelg_stat | |
| 469 | 471 | |
| 470 | 472 | /* basic machine hardware */ |
| 471 | 473 | MCFG_CPU_ADD("maincpu", Z80, 19968000/4) /* unknown divider, galds definitely relies on this for correct voice pitch */ |
| r10613 | r10614 | |
|---|---|---|
| 291 | 291 | |
| 292 | 292 | static void guardians_sloop_tweak(atarig42_state *state, int offset) |
| 293 | 293 | { |
| 294 | | |
| 294 | | |
| 295 | 295 | |
| 296 | 296 | if (offset >= 0x7f7c0/2) |
| 297 | 297 | { |
| r10613 | r10614 | |
|---|---|---|
| 197 | 197 | |
| 198 | 198 | #define VIDEO_MASTER_CLOCK XTAL_10MHz |
| 199 | 199 | |
| 200 | /* IRQ states for 68k */ | |
| 201 | static UINT8 m6840_irq_state; | |
| 202 | static UINT8 m6850_irq_state; | |
| 203 | static UINT8 scn2674_irq_state; | |
| 204 | 200 | |
| 205 | /* UART source/sinks */ | |
| 206 | static UINT8 m68k_m6809_line; | |
| 207 | static UINT8 m6809_m68k_line; | |
| 208 | static UINT8 m68k_acia_cts; | |
| 209 | static UINT8 m6809_acia_cts; | |
| 210 | static UINT8 m6809_acia_rts; | |
| 211 | static UINT8 m6809_acia_dcd; | |
| 212 | ||
| 213 | /* SCN2674 AVDC stuff */ | |
| 214 | static int mpu4_gfx_index; | |
| 215 | static UINT16 * mpu4_vid_vidram; | |
| 216 | static UINT16 * mpu4_vid_mainram; | |
| 217 | ||
| 218 | static UINT8 scn2674_IR[16]; | |
| 219 | static UINT8 scn2675_IR_pointer; | |
| 220 | static UINT8 scn2674_screen1_l; | |
| 221 | static UINT8 scn2674_screen1_h; | |
| 222 | static UINT8 scn2674_cursor_l; | |
| 223 | static UINT8 scn2674_cursor_h; | |
| 224 | static UINT8 scn2674_screen2_l; | |
| 225 | static UINT8 scn2674_screen2_h; | |
| 226 | ||
| 227 | static UINT8 scn2674_irq_register = 0; | |
| 228 | static UINT8 scn2674_status_register = 0; | |
| 229 | static UINT8 scn2674_irq_mask = 0; | |
| 230 | static UINT8 scn2674_gfx_enabled; | |
| 231 | static UINT8 scn2674_display_enabled; | |
| 232 | static UINT8 scn2674_cursor_enabled; | |
| 233 | ||
| 234 | 201 | static READ16_HANDLER( characteriser16_r ); |
| 235 | 202 | static WRITE16_HANDLER( characteriser16_w ); |
| 236 | 203 | |
| r10613 | r10614 | |
| 258 | 225 | |
| 259 | 226 | static void update_mpu68_interrupts(running_machine *machine) |
| 260 | 227 | { |
| 261 | cputag_set_input_line(machine, "video", 1, m6840_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 262 | cputag_set_input_line(machine, "video", 2, m6850_irq_state ? CLEAR_LINE : ASSERT_LINE); | |
| 263 | cputag_set_input_line(machine, "video", 3, scn2674_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 228 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 229 | cputag_set_input_line(machine, "video", 1, state->m6840_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 230 | cputag_set_input_line(machine, "video", 2, state->m6850_irq_state ? CLEAR_LINE : ASSERT_LINE); | |
| 231 | cputag_set_input_line(machine, "video", 3, state->scn2674_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 264 | 232 | } |
| 265 | 233 | |
| 266 | 234 | /* Communications with 6809 board */ |
| r10613 | r10614 | |
| 268 | 236 | |
| 269 | 237 | static READ_LINE_DEVICE_HANDLER( m6809_acia_rx_r ) |
| 270 | 238 | { |
| 271 | return m68k_m6809_line; | |
| 239 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 240 | return state->m68k_m6809_line; | |
| 272 | 241 | } |
| 273 | 242 | |
| 274 | 243 | static WRITE_LINE_DEVICE_HANDLER( m6809_acia_tx_w ) |
| 275 | 244 | { |
| 276 | m6809_m68k_line = state; | |
| 245 | mpu4_state *drvstate = device->machine->driver_data<mpu4_state>(); | |
| 246 | drvstate->m6809_m68k_line = state; | |
| 277 | 247 | } |
| 278 | 248 | |
| 279 | 249 | static READ_LINE_DEVICE_HANDLER( m6809_acia_cts_r ) |
| 280 | 250 | { |
| 281 | return m6809_acia_cts; | |
| 251 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 252 | return state->m6809_acia_cts; | |
| 282 | 253 | } |
| 283 | 254 | |
| 284 | 255 | static WRITE_LINE_DEVICE_HANDLER( m6809_acia_rts_w ) |
| 285 | 256 | { |
| 286 | m6809_acia_rts = state; | |
| 257 | mpu4_state *drvstate = device->machine->driver_data<mpu4_state>(); | |
| 258 | drvstate->m6809_acia_rts = state; | |
| 287 | 259 | } |
| 288 | 260 | |
| 289 | 261 | static READ_LINE_DEVICE_HANDLER( m6809_acia_dcd_r ) |
| 290 | 262 | { |
| 291 | return m6809_acia_dcd; | |
| 263 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 264 | return state->m6809_acia_dcd; | |
| 292 | 265 | } |
| 293 | 266 | |
| 294 | 267 | static WRITE_LINE_DEVICE_HANDLER( m6809_acia_irq ) |
| 295 | 268 | { |
| 296 | m68k_acia_cts = !state; | |
| 269 | mpu4_state *drvstate = device->machine->driver_data<mpu4_state>(); | |
| 270 | drvstate->m68k_acia_cts = !state; | |
| 297 | 271 | cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, state ? CLEAR_LINE : ASSERT_LINE); |
| 298 | 272 | } |
| 299 | 273 | |
| r10613 | r10614 | |
| 311 | 285 | |
| 312 | 286 | static READ_LINE_DEVICE_HANDLER( m68k_acia_rx_r ) |
| 313 | 287 | { |
| 314 | return m6809_m68k_line; | |
| 288 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 289 | return state->m6809_m68k_line; | |
| 315 | 290 | } |
| 316 | 291 | |
| 317 | 292 | static WRITE_LINE_DEVICE_HANDLER( m68k_acia_tx_w ) |
| 318 | 293 | { |
| 319 | m68k_m6809_line = state; | |
| 294 | mpu4_state *drvstate = device->machine->driver_data<mpu4_state>(); | |
| 295 | drvstate->m68k_m6809_line = state; | |
| 320 | 296 | } |
| 321 | 297 | |
| 322 | 298 | static READ_LINE_DEVICE_HANDLER( m68k_acia_cts_r ) |
| 323 | 299 | { |
| 324 | return m68k_acia_cts; | |
| 300 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 301 | return state->m68k_acia_cts; | |
| 325 | 302 | } |
| 326 | 303 | |
| 327 | 304 | static WRITE_LINE_DEVICE_HANDLER( m68k_acia_rts_w ) |
| 328 | 305 | { |
| 329 | m6809_acia_dcd = state; | |
| 306 | mpu4_state *drvstate = device->machine->driver_data<mpu4_state>(); | |
| 307 | drvstate->m6809_acia_dcd = state; | |
| 330 | 308 | } |
| 331 | 309 | |
| 332 | 310 | static READ_LINE_DEVICE_HANDLER( m68k_acia_dcd_r ) |
| 333 | 311 | { |
| 334 | return m6809_acia_rts; | |
| 312 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 313 | return state->m6809_acia_rts; | |
| 335 | 314 | } |
| 336 | 315 | |
| 337 | 316 | static WRITE_LINE_DEVICE_HANDLER( m68k_acia_irq ) |
| 338 | 317 | { |
| 339 | m6809_acia_cts = !state; | |
| 340 | m6850_irq_state = state; | |
| 318 | mpu4_state *drvstate = device->machine->driver_data<mpu4_state>(); | |
| 319 | drvstate->m6809_acia_cts = !state; | |
| 320 | drvstate->m6850_irq_state = state; | |
| 341 | 321 | update_mpu68_interrupts(device->machine); |
| 342 | 322 | } |
| 343 | 323 | |
| r10613 | r10614 | |
| 356 | 336 | |
| 357 | 337 | static WRITE_LINE_DEVICE_HANDLER( cpu1_ptm_irq ) |
| 358 | 338 | { |
| 359 | m6840_irq_state = state; | |
| 339 | mpu4_state *drvstate = device->machine->driver_data<mpu4_state>(); | |
| 340 | drvstate->m6840_irq_state = state; | |
| 360 | 341 | update_mpu68_interrupts(device->machine); |
| 361 | 342 | } |
| 362 | 343 | |
| r10613 | r10614 | |
| 460 | 441 | }; |
| 461 | 442 | |
| 462 | 443 | |
| 463 | static UINT8 IR0_scn2674_double_ht_wd; | |
| 464 | static UINT8 IR0_scn2674_scanline_per_char_row; | |
| 465 | static UINT8 IR0_scn2674_sync_select; | |
| 466 | static UINT8 IR0_scn2674_buffer_mode_select; | |
| 467 | static UINT8 IR1_scn2674_interlace_enable; | |
| 468 | static UINT8 IR1_scn2674_equalizing_constant; | |
| 469 | static UINT8 IR2_scn2674_row_table; | |
| 470 | static UINT8 IR2_scn2674_horz_sync_width; | |
| 471 | static UINT8 IR2_scn2674_horz_back_porch; | |
| 472 | static UINT8 IR3_scn2674_vert_front_porch; | |
| 473 | static UINT8 IR3_scn2674_vert_back_porch; | |
| 474 | static UINT8 IR4_scn2674_rows_per_screen; | |
| 475 | static UINT8 IR4_scn2674_character_blink_rate; | |
| 476 | static UINT8 IR5_scn2674_character_per_row; | |
| 477 | static UINT8 IR8_scn2674_display_buffer_first_address_LSB; | |
| 478 | static UINT8 IR9_scn2674_display_buffer_first_address_MSB; | |
| 479 | static UINT8 IR9_scn2674_display_buffer_last_address; | |
| 480 | static UINT8 IR10_scn2674_display_pointer_address_lower; | |
| 481 | static UINT8 IR11_scn2674_display_pointer_address_upper; | |
| 482 | static UINT8 IR12_scn2674_scroll_start; | |
| 483 | static UINT8 IR12_scn2674_split_register_1; | |
| 484 | static UINT8 IR13_scn2674_scroll_end; | |
| 485 | static UINT8 IR13_scn2674_split_register_2; | |
| 486 | 444 | |
| 487 | 445 | |
| 488 | 446 | static SCREEN_UPDATE( mpu4_vid ) |
| 489 | 447 | { |
| 448 | mpu4_state *state = screen->machine->driver_data<mpu4_state>(); | |
| 490 | 449 | int x, y/*, count = 0*/; |
| 491 | 450 | |
| 492 | 451 | bitmap_fill(bitmap,cliprect,0); |
| r10613 | r10614 | |
| 495 | 454 | /* count = 0x0018b6/2; - crmaze count = 0x004950/2; - turnover */ |
| 496 | 455 | |
| 497 | 456 | /* we're in row table mode...thats why */ |
| 498 | for(y = 0; y <= IR4_scn2674_rows_per_screen; y++) | |
| 457 | for(y = 0; y <= state->IR4_scn2674_rows_per_screen; y++) | |
| 499 | 458 | { |
| 500 | int screen2_base = (scn2674_screen2_h << 8) | scn2674_screen2_l; | |
| 459 | int screen2_base = (state->scn2674_screen2_h << 8) | state->scn2674_screen2_l; | |
| 501 | 460 | |
| 502 | UINT16 rowbase = ( | |
| 461 | UINT16 rowbase = (state->vid_mainram[1+screen2_base+(y*2)]<<8)|state->vid_mainram[screen2_base+(y*2)]; | |
| 503 | 462 | int dbl_size; |
| 504 | 463 | int gfxregion = 0; |
| 505 | 464 | |
| r10613 | r10614 | |
| 507 | 466 | |
| 508 | 467 | if (dbl_size&2) gfxregion = 1; |
| 509 | 468 | |
| 510 | for(x = 0; x <= IR5_scn2674_character_per_row; x++) | |
| 469 | for(x = 0; x <= state->IR5_scn2674_character_per_row; x++) | |
| 511 | 470 | { |
| 512 | 471 | UINT16 tiledat; |
| 513 | 472 | UINT16 attr; |
| 514 | 473 | |
| 515 | tiledat = | |
| 474 | tiledat = state->vid_mainram[(rowbase+x)&0x7fff]; | |
| 516 | 475 | attr = tiledat >>12; |
| 517 | 476 | |
| 518 | 477 | if (attr) |
| r10613 | r10614 | |
| 531 | 490 | |
| 532 | 491 | static READ16_HANDLER( mpu4_vid_vidram_r ) |
| 533 | 492 | { |
| 534 | return mpu4_vid_vidram[offset]; | |
| 493 | mpu4_state *state = space->machine->driver_data<mpu4_state>(); | |
| 494 | return state->vid_vidram[offset]; | |
| 535 | 495 | } |
| 536 | 496 | |
| 537 | 497 | |
| 538 | 498 | static WRITE16_HANDLER( mpu4_vid_vidram_w ) |
| 539 | 499 | { |
| 540 | COMBINE_DATA(&mpu4_vid_vidram[offset]); | |
| 500 | mpu4_state *state = space->machine->driver_data<mpu4_state>(); | |
| 501 | COMBINE_DATA(&state->vid_vidram[offset]); | |
| 541 | 502 | offset <<= 1; |
| 542 | gfx_element_mark_dirty(space->machine->gfx[mpu4_gfx_index+0], offset/0x20); | |
| 543 | gfx_element_mark_dirty(space->machine->gfx[mpu4_gfx_index+1], offset/0x20); | |
| 544 | gfx_element_mark_dirty(space->machine->gfx[mpu4_gfx_index+2], offset/0x20); | |
| 545 | gfx_element_mark_dirty(space->machine->gfx[mpu4_gfx_index+3], offset/0x20); | |
| 503 | gfx_element_mark_dirty(space->machine->gfx[state->gfx_index+0], offset/0x20); | |
| 504 | gfx_element_mark_dirty(space->machine->gfx[state->gfx_index+1], offset/0x20); | |
| 505 | gfx_element_mark_dirty(space->machine->gfx[state->gfx_index+2], offset/0x20); | |
| 506 | gfx_element_mark_dirty(space->machine->gfx[state->gfx_index+3], offset/0x20); | |
| 546 | 507 | } |
| 547 | 508 | |
| 548 | 509 | |
| r10613 | r10614 | |
| 571 | 532 | */ |
| 572 | 533 | |
| 573 | 534 | |
| 574 | static void scn2674_write_init_regs(UINT8 data) | |
| 535 | static void scn2674_write_init_regs(mpu4_state *state, UINT8 data) | |
| 575 | 536 | { |
| 576 | LOGSTUFF(("scn2674_write_init_regs %02x %02x\n",scn2675_IR_pointer,data)); | |
| 537 | LOGSTUFF(("scn2674_write_init_regs %02x %02x\n",state->scn2675_IR_pointer,data)); | |
| 577 | 538 | |
| 578 | scn2674_IR[scn2675_IR_pointer]=data; | |
| 539 | state->scn2674_IR[state->scn2675_IR_pointer]=data; | |
| 579 | 540 | |
| 580 | 541 | |
| 581 | switch ( scn2675_IR_pointer) /* display some debug info, set mame specific variables */ | |
| 542 | switch ( state->scn2675_IR_pointer) /* display some debug info, set mame specific variables */ | |
| 582 | 543 | { |
| 583 | 544 | case 0: |
| 584 | IR0_scn2674_double_ht_wd = (data & 0x80)>>7; | |
| 585 | IR0_scn2674_scanline_per_char_row = (data & 0x78)>>3; | |
| 586 | IR0_scn2674_sync_select = (data&0x04)>>2; | |
| 587 | IR0_scn2674_buffer_mode_select = (data&0x03); | |
| 545 | state->IR0_scn2674_double_ht_wd = (data & 0x80)>>7; | |
| 546 | state->IR0_scn2674_scanline_per_char_row = (data & 0x78)>>3; | |
| 547 | state->IR0_scn2674_sync_select = (data&0x04)>>2; | |
| 548 | state->IR0_scn2674_buffer_mode_select = (data&0x03); | |
| 588 | 549 | |
| 589 | LOGSTUFF(("IR0 - Double Ht Wd %02x\n",IR0_scn2674_double_ht_wd)); | |
| 590 | LOGSTUFF(("IR0 - Scanlines per Character Row %02x\n",IR0_scn2674_scanline_per_char_row)); | |
| 591 | LOGSTUFF(("IR0 - Sync Select %02x\n",IR0_scn2674_sync_select)); | |
| 592 | LOGSTUFF(("IR0 - Buffer Mode Select %02x\n",IR0_scn2674_buffer_mode_select)); | |
| 550 | LOGSTUFF(("IR0 - Double Ht Wd %02x\n",state->IR0_scn2674_double_ht_wd)); | |
| 551 | LOGSTUFF(("IR0 - Scanlines per Character Row %02x\n",state->IR0_scn2674_scanline_per_char_row)); | |
| 552 | LOGSTUFF(("IR0 - Sync Select %02x\n",state->IR0_scn2674_sync_select)); | |
| 553 | LOGSTUFF(("IR0 - Buffer Mode Select %02x\n",state->IR0_scn2674_buffer_mode_select)); | |
| 593 | 554 | break; |
| 594 | 555 | |
| 595 | 556 | case 1: |
| 596 | IR1_scn2674_interlace_enable = (data&0x80)>>7; | |
| 597 | IR1_scn2674_equalizing_constant = (data&0x7f); | |
| 557 | state->IR1_scn2674_interlace_enable = (data&0x80)>>7; | |
| 558 | state->IR1_scn2674_equalizing_constant = (data&0x7f); | |
| 598 | 559 | |
| 599 | LOGSTUFF(("IR1 - Interlace Enable %02x\n",IR1_scn2674_interlace_enable)); | |
| 600 | LOGSTUFF(("IR1 - Equalizing Constant %02x\n",IR1_scn2674_equalizing_constant)); | |
| 560 | LOGSTUFF(("IR1 - Interlace Enable %02x\n",state->IR1_scn2674_interlace_enable)); | |
| 561 | LOGSTUFF(("IR1 - Equalizing Constant %02x\n",state->IR1_scn2674_equalizing_constant)); | |
| 601 | 562 | break; |
| 602 | 563 | |
| 603 | 564 | case 2: |
| 604 | IR2_scn2674_row_table = (data&0x80)>>7; | |
| 605 | IR2_scn2674_horz_sync_width = (data&0x78)>>3; | |
| 606 | IR2_scn2674_horz_back_porch = (data&0x07); | |
| 565 | state->IR2_scn2674_row_table = (data&0x80)>>7; | |
| 566 | state->IR2_scn2674_horz_sync_width = (data&0x78)>>3; | |
| 567 | state->IR2_scn2674_horz_back_porch = (data&0x07); | |
| 607 | 568 | |
| 608 | LOGSTUFF(("IR2 - Row Table %02x\n",IR2_scn2674_row_table)); | |
| 609 | LOGSTUFF(("IR2 - Horizontal Sync Width %02x\n",IR2_scn2674_horz_sync_width)); | |
| 610 | LOGSTUFF(("IR2 - Horizontal Back Porch %02x\n",IR2_scn2674_horz_back_porch)); | |
| 569 | LOGSTUFF(("IR2 - Row Table %02x\n",state->IR2_scn2674_row_table)); | |
| 570 | LOGSTUFF(("IR2 - Horizontal Sync Width %02x\n",state->IR2_scn2674_horz_sync_width)); | |
| 571 | LOGSTUFF(("IR2 - Horizontal Back Porch %02x\n",state->IR2_scn2674_horz_back_porch)); | |
| 611 | 572 | break; |
| 612 | 573 | |
| 613 | 574 | case 3: |
| 614 | IR3_scn2674_vert_front_porch = (data&0xe0)>>5; | |
| 615 | IR3_scn2674_vert_back_porch = (data&0x1f)>>0; | |
| 575 | state->IR3_scn2674_vert_front_porch = (data&0xe0)>>5; | |
| 576 | state->IR3_scn2674_vert_back_porch = (data&0x1f)>>0; | |
| 616 | 577 | |
| 617 | LOGSTUFF(("IR3 - Vertical Front Porch %02x\n",IR3_scn2674_vert_front_porch)); | |
| 618 | LOGSTUFF(("IR3 - Vertical Back Porch %02x\n",IR3_scn2674_vert_back_porch)); | |
| 578 | LOGSTUFF(("IR3 - Vertical Front Porch %02x\n",state->IR3_scn2674_vert_front_porch)); | |
| 579 | LOGSTUFF(("IR3 - Vertical Back Porch %02x\n",state->IR3_scn2674_vert_back_porch)); | |
| 619 | 580 | break; |
| 620 | 581 | |
| 621 | 582 | case 4: |
| 622 | IR4_scn2674_rows_per_screen = data&0x7f; | |
| 623 | IR4_scn2674_character_blink_rate = (data & 0x80)>>7; | |
| 583 | state->IR4_scn2674_rows_per_screen = data&0x7f; | |
| 584 | state->IR4_scn2674_character_blink_rate = (data & 0x80)>>7; | |
| 624 | 585 | |
| 625 | LOGSTUFF(("IR4 - Rows Per Screen %02x\n",IR4_scn2674_rows_per_screen)); | |
| 626 | LOGSTUFF(("IR4 - Character Blink Rate %02x\n",IR4_scn2674_character_blink_rate)); | |
| 586 | LOGSTUFF(("IR4 - Rows Per Screen %02x\n",state->IR4_scn2674_rows_per_screen)); | |
| 587 | LOGSTUFF(("IR4 - Character Blink Rate %02x\n",state->IR4_scn2674_character_blink_rate)); | |
| 627 | 588 | break; |
| 628 | 589 | |
| 629 | 590 | case 5: |
| 630 | 591 | /* IR5 - Active Characters Per Row |
| 631 | 592 | cccc cccc |
| 632 | 593 | c = Characters Per Row */ |
| 633 | IR5_scn2674_character_per_row = data; | |
| 634 | LOGSTUFF(("IR5 - Active Characters Per Row %02x\n",IR5_scn2674_character_per_row)); | |
| 594 | state->IR5_scn2674_character_per_row = data; | |
| 595 | LOGSTUFF(("IR5 - Active Characters Per Row %02x\n",state->IR5_scn2674_character_per_row)); | |
| 635 | 596 | break; |
| 636 | 597 | |
| 637 | 598 | case 6: |
| r10613 | r10614 | |
| 641 | 602 | break; |
| 642 | 603 | |
| 643 | 604 | case 8: |
| 644 | IR8_scn2674_display_buffer_first_address_LSB = data; | |
| 645 | LOGSTUFF(("IR8 - Display Buffer First Address LSB %02x\n",IR8_scn2674_display_buffer_first_address_LSB)); | |
| 605 | state->IR8_scn2674_display_buffer_first_address_LSB = data; | |
| 606 | LOGSTUFF(("IR8 - Display Buffer First Address LSB %02x\n",state->IR8_scn2674_display_buffer_first_address_LSB)); | |
| 646 | 607 | break; |
| 647 | 608 | |
| 648 | 609 | case 9: |
| 649 | IR9_scn2674_display_buffer_first_address_MSB = data & 0x0f; | |
| 650 | IR9_scn2674_display_buffer_last_address = (data & 0xf0)>>4; | |
| 651 | LOGSTUFF(("IR9 - Display Buffer First Address MSB %02x\n",IR9_scn2674_display_buffer_first_address_MSB)); | |
| 652 | LOGSTUFF(("IR9 - Display Buffer Last Address %02x\n",IR9_scn2674_display_buffer_last_address)); | |
| 610 | state->IR9_scn2674_display_buffer_first_address_MSB = data & 0x0f; | |
| 611 | state->IR9_scn2674_display_buffer_last_address = (data & 0xf0)>>4; | |
| 612 | LOGSTUFF(("IR9 - Display Buffer First Address MSB %02x\n",state->IR9_scn2674_display_buffer_first_address_MSB)); | |
| 613 | LOGSTUFF(("IR9 - Display Buffer Last Address %02x\n",state->IR9_scn2674_display_buffer_last_address)); | |
| 653 | 614 | break; |
| 654 | 615 | |
| 655 | 616 | case 10: |
| 656 | IR10_scn2674_display_pointer_address_lower = data; | |
| 657 | LOGSTUFF(("IR10 - Display Pointer Address Lower %02x\n",IR10_scn2674_display_pointer_address_lower)); | |
| 617 | state->IR10_scn2674_display_pointer_address_lower = data; | |
| 618 | LOGSTUFF(("IR10 - Display Pointer Address Lower %02x\n",state->IR10_scn2674_display_pointer_address_lower)); | |
| 658 | 619 | break; |
| 659 | 620 | |
| 660 | 621 | case 11: |
| 661 | IR11_scn2674_display_pointer_address_upper= data&0x3f; | |
| 662 | LOGSTUFF(("IR11 - Display Pointer Address Lower %02x\n",IR11_scn2674_display_pointer_address_upper)); | |
| 622 | state->IR11_scn2674_display_pointer_address_upper= data&0x3f; | |
| 623 | LOGSTUFF(("IR11 - Display Pointer Address Lower %02x\n",state->IR11_scn2674_display_pointer_address_upper)); | |
| 663 | 624 | break; |
| 664 | 625 | |
| 665 | 626 | case 12: |
| 666 | IR12_scn2674_scroll_start = (data & 0x80)>>7; | |
| 667 | IR12_scn2674_split_register_1 = (data & 0x7f); | |
| 668 | LOGSTUFF(("IR12 - Scroll Start %02x\n",IR12_scn2674_scroll_start)); | |
| 669 | LOGSTUFF(("IR12 - Split Register 1 %02x\n",IR12_scn2674_split_register_1)); | |
| 627 | state->IR12_scn2674_scroll_start = (data & 0x80)>>7; | |
| 628 | state->IR12_scn2674_split_register_1 = (data & 0x7f); | |
| 629 | LOGSTUFF(("IR12 - Scroll Start %02x\n",state->IR12_scn2674_scroll_start)); | |
| 630 | LOGSTUFF(("IR12 - Split Register 1 %02x\n",state->IR12_scn2674_split_register_1)); | |
| 670 | 631 | break; |
| 671 | 632 | |
| 672 | 633 | case 13: |
| 673 | IR13_scn2674_scroll_end = (data & 0x80)>>7; | |
| 674 | IR13_scn2674_split_register_2 = (data & 0x7f); | |
| 675 | LOGSTUFF(("IR13 - Scroll End %02x\n",IR13_scn2674_scroll_end)); | |
| 676 | LOGSTUFF(("IR13 - Split Register 2 %02x\n",IR13_scn2674_split_register_2)); | |
| 634 | state->IR13_scn2674_scroll_end = (data & 0x80)>>7; | |
| 635 | state->IR13_scn2674_split_register_2 = (data & 0x7f); | |
| 636 | LOGSTUFF(("IR13 - Scroll End %02x\n",state->IR13_scn2674_scroll_end)); | |
| 637 | LOGSTUFF(("IR13 - Split Register 2 %02x\n",state->IR13_scn2674_split_register_2)); | |
| 677 | 638 | break; |
| 678 | 639 | |
| 679 | 640 | case 14: |
| r10613 | r10614 | |
| 684 | 645 | |
| 685 | 646 | } |
| 686 | 647 | |
| 687 | scn2675_IR_pointer++; | |
| 688 | if (scn2675_IR_pointer>14)scn2675_IR_pointer=14; | |
| 648 | state->scn2675_IR_pointer++; | |
| 649 | if (state->scn2675_IR_pointer>14)state->scn2675_IR_pointer=14; | |
| 689 | 650 | } |
| 690 | 651 | |
| 691 | 652 | static void scn2674_write_command(running_machine *machine, UINT8 data) |
| 692 | 653 | { |
| 654 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 693 | 655 | UINT8 oprand; |
| 694 | 656 | int i; |
| 695 | 657 | |
| r10613 | r10614 | |
| 699 | 661 | { |
| 700 | 662 | /* master reset, configures registers */ |
| 701 | 663 | LOGSTUFF(("master reset\n")); |
| 702 | scn2675_IR_pointer=0; | |
| 703 | scn2674_irq_register = 0x20; | |
| 704 | scn2674_status_register = 0x20; | |
| 705 | scn2674_irq_mask = 0x20; | |
| 706 | scn2674_gfx_enabled = 0; | |
| 707 | scn2674_display_enabled = 0; | |
| 708 | scn2674_cursor_enabled = 0; | |
| 709 | IR2_scn2674_row_table = 0; | |
| 664 | state->scn2675_IR_pointer=0; | |
| 665 | state->scn2674_irq_register = 0x20; | |
| 666 | state->scn2674_status_register = 0x20; | |
| 667 | state->scn2674_irq_mask = 0x20; | |
| 668 | state->scn2674_gfx_enabled = 0; | |
| 669 | state->scn2674_display_enabled = 0; | |
| 670 | state->scn2674_cursor_enabled = 0; | |
| 671 | state->IR2_scn2674_row_table = 0; | |
| 710 | 672 | } |
| 711 | 673 | |
| 712 | 674 | if ((data&0xf0)==0x10) |
| r10613 | r10614 | |
| 715 | 677 | LOGSTUFF(("set IR pointer %02x\n",data)); |
| 716 | 678 | |
| 717 | 679 | oprand = data & 0x0f; |
| 718 | scn2675_IR_pointer=oprand; | |
| 680 | state->scn2675_IR_pointer=oprand; | |
| 719 | 681 | |
| 720 | 682 | } |
| 721 | 683 | |
| r10613 | r10614 | |
| 725 | 687 | { |
| 726 | 688 | /* Disable GFX */ |
| 727 | 689 | LOGSTUFF(("disable GFX %02x\n",data)); |
| 728 | scn2674_gfx_enabled = 0; | |
| 690 | state->scn2674_gfx_enabled = 0; | |
| 729 | 691 | } |
| 730 | 692 | |
| 731 | 693 | if ((data&0xe3)==0x23) |
| 732 | 694 | { |
| 733 | 695 | /* Enable GFX */ |
| 734 | 696 | LOGSTUFF(("enable GFX %02x\n",data)); |
| 735 | scn2674_gfx_enabled = 1; | |
| 697 | state->scn2674_gfx_enabled = 1; | |
| 736 | 698 | } |
| 737 | 699 | |
| 738 | 700 | if ((data&0xe9)==0x28) |
| r10613 | r10614 | |
| 740 | 702 | /* Display off */ |
| 741 | 703 | oprand = data & 0x04; |
| 742 | 704 | |
| 743 | scn2674_display_enabled = 0; | |
| 705 | state->scn2674_display_enabled = 0; | |
| 744 | 706 | |
| 745 | 707 | if (oprand) |
| 746 | 708 | LOGSTUFF(("display OFF - float DADD bus %02x\n",data)); |
| r10613 | r10614 | |
| 753 | 715 | /* Display on */ |
| 754 | 716 | oprand = data & 0x04; |
| 755 | 717 | |
| 756 | scn2674_display_enabled = 1; | |
| 718 | state->scn2674_display_enabled = 1; | |
| 757 | 719 | |
| 758 | 720 | if (oprand) |
| 759 | 721 | LOGSTUFF(("display ON - next field %02x\n",data)); |
| r10613 | r10614 | |
| 765 | 727 | { |
| 766 | 728 | /* Cursor Off */ |
| 767 | 729 | LOGSTUFF(("cursor off %02x\n",data)); |
| 768 | scn2674_cursor_enabled = 0; | |
| 730 | state->scn2674_cursor_enabled = 0; | |
| 769 | 731 | } |
| 770 | 732 | |
| 771 | 733 | if ((data&0xf1)==0x31) |
| 772 | 734 | { |
| 773 | 735 | /* Cursor On */ |
| 774 | 736 | LOGSTUFF(("cursor on %02x\n",data)); |
| 775 | scn2674_cursor_enabled = 1; | |
| 737 | state->scn2674_cursor_enabled = 1; | |
| 776 | 738 | } |
| 777 | 739 | |
| 778 | 740 | /* END */ |
| r10613 | r10614 | |
| 789 | 751 | LOGSTUFF(("Line Zero IRQ: %d Reset\n",(data>>3)&1)); |
| 790 | 752 | LOGSTUFF(("V-Blank IRQ: %d Reset\n",(data>>4)&1)); |
| 791 | 753 | |
| 792 | scn2674_irq_register &= ((data & 0x1f)^0x1f); | |
| 793 | scn2674_status_register &= ((data & 0x1f)^0x1f); | |
| 754 | state->scn2674_irq_register &= ((data & 0x1f)^0x1f); | |
| 755 | state->scn2674_status_register &= ((data & 0x1f)^0x1f); | |
| 794 | 756 | |
| 795 | scn2674_irq_state = 0; | |
| 796 | if (scn2674_irq_register) | |
| 757 | state->scn2674_irq_state = 0; | |
| 758 | if (state->scn2674_irq_register) | |
| 797 | 759 | { |
| 798 | scn2674_irq_state = 1; | |
| 760 | state->scn2674_irq_state = 1; | |
| 799 | 761 | } |
| 800 | 762 | update_mpu68_interrupts(machine); |
| 801 | 763 | } |
| r10613 | r10614 | |
| 810 | 772 | LOGSTUFF(("Line Zero IRQ: %d Disabled\n",(data>>3)&1)); |
| 811 | 773 | LOGSTUFF(("V-Blank IRQ: %d Disabled\n",(data>>4)&1)); |
| 812 | 774 | |
| 813 | /* scn2674_irq_mask &= ((data & 0x1f)^0x1f); disables.. doesn't enable? */ | |
| 775 | /* state->scn2674_irq_mask &= ((data & 0x1f)^0x1f); disables.. doesn't enable? */ | |
| 814 | 776 | |
| 815 | scn2674_irq_mask &= ~(data & 0x1f); | |
| 777 | state->scn2674_irq_mask &= ~(data & 0x1f); | |
| 816 | 778 | |
| 817 | scn2674_irq_state = 0; | |
| 779 | state->scn2674_irq_state = 0; | |
| 818 | 780 | |
| 819 | 781 | for (i = 0; i < 5; i++) |
| 820 | 782 | { |
| 821 | if ((scn2674_irq_register>>i&1)&(scn2674_irq_mask>>i&1)) | |
| 783 | if ((state->scn2674_irq_register>>i&1)&(state->scn2674_irq_mask>>i&1)) | |
| 822 | 784 | { |
| 823 | scn2674_irq_state = 1; | |
| 785 | state->scn2674_irq_state = 1; | |
| 824 | 786 | } |
| 825 | 787 | } |
| 826 | 788 | update_mpu68_interrupts(machine); |
| r10613 | r10614 | |
| 837 | 799 | LOGSTUFF(("Line Zero IRQ: %d Enabled\n",(data>>3)&1)); |
| 838 | 800 | LOGSTUFF(("V-Blank IRQ: %d Enabled\n",(data>>4)&1)); |
| 839 | 801 | |
| 840 | scn2674_irq_mask |= (data & 0x1f); /* enables .. doesn't disable? */ | |
| 802 | state->scn2674_irq_mask |= (data & 0x1f); /* enables .. doesn't disable? */ | |
| 841 | 803 | |
| 842 | scn2674_irq_state = 0; | |
| 804 | state->scn2674_irq_state = 0; | |
| 843 | 805 | |
| 844 | 806 | for (i = 0; i < 5; i++) |
| 845 | 807 | { |
| 846 | if ((scn2674_irq_register>>i&1)&(scn2674_irq_mask>>i&1)) | |
| 808 | if ((state->scn2674_irq_register>>i&1)&(state->scn2674_irq_mask>>i&1)) | |
| 847 | 809 | { |
| 848 | scn2674_irq_state = 1; | |
| 810 | state->scn2674_irq_state = 1; | |
| 849 | 811 | } |
| 850 | 812 | } |
| 851 | 813 | update_mpu68_interrupts(machine); |
| r10613 | r10614 | |
| 911 | 873 | |
| 912 | 874 | static READ16_HANDLER( mpu4_vid_scn2674_r ) |
| 913 | 875 | { |
| 876 | mpu4_state *state = space->machine->driver_data<mpu4_state>(); | |
| 914 | 877 | /* |
| 915 | 878 | Offset: Purpose |
| 916 | 879 | 0 Interrupt Register |
| r10613 | r10614 | |
| 941 | 904 | |
| 942 | 905 | case 0: |
| 943 | 906 | LOGSTUFF(("Read Irq Register %06x\n",cpu_get_pc(space->cpu))); |
| 944 | return scn2674_irq_register; | |
| 907 | return state->scn2674_irq_register; | |
| 945 | 908 | |
| 946 | 909 | case 1: |
| 947 | 910 | LOGSTUFF(("Read Status Register %06x\n",cpu_get_pc(space->cpu))); |
| 948 | return scn2674_status_register; | |
| 911 | return state->scn2674_status_register; | |
| 949 | 912 | |
| 950 | case 2: LOGSTUFF(("Read Screen1_l Register %06x\n",cpu_get_pc(space->cpu)));return scn2674_screen1_l; | |
| 951 | case 3: LOGSTUFF(("Read Screen1_h Register %06x\n",cpu_get_pc(space->cpu)));return scn2674_screen1_h; | |
| 952 | case 4: LOGSTUFF(("Read Cursor_l Register %06x\n",cpu_get_pc(space->cpu)));return scn2674_cursor_l; | |
| 953 | case 5: LOGSTUFF(("Read Cursor_h Register %06x\n",cpu_get_pc(space->cpu)));return scn2674_cursor_h; | |
| 954 | case 6: LOGSTUFF(("Read Screen2_l Register %06x\n",cpu_get_pc(space->cpu)));return scn2674_screen2_l; | |
| 955 | case 7: LOGSTUFF(("Read Screen2_h Register %06x\n",cpu_get_pc(space->cpu)));return scn2674_screen2_h; | |
| 913 | case 2: LOGSTUFF(("Read Screen1_l Register %06x\n",cpu_get_pc(space->cpu)));return state->scn2674_screen1_l; | |
| 914 | case 3: LOGSTUFF(("Read Screen1_h Register %06x\n",cpu_get_pc(space->cpu)));return state->scn2674_screen1_h; | |
| 915 | case 4: LOGSTUFF(("Read Cursor_l Register %06x\n",cpu_get_pc(space->cpu)));return state->scn2674_cursor_l; | |
| 916 | case 5: LOGSTUFF(("Read Cursor_h Register %06x\n",cpu_get_pc(space->cpu)));return state->scn2674_cursor_h; | |
| 917 | case 6: LOGSTUFF(("Read Screen2_l Register %06x\n",cpu_get_pc(space->cpu)));return state->scn2674_screen2_l; | |
| 918 | case 7: LOGSTUFF(("Read Screen2_h Register %06x\n",cpu_get_pc(space->cpu)));return state->scn2674_screen2_h; | |
| 956 | 919 | } |
| 957 | 920 | |
| 958 | 921 | return 0xffff; |
| r10613 | r10614 | |
| 961 | 924 | |
| 962 | 925 | static WRITE16_HANDLER( mpu4_vid_scn2674_w ) |
| 963 | 926 | { |
| 927 | mpu4_state *state = space->machine->driver_data<mpu4_state>(); | |
| 964 | 928 | /* |
| 965 | 929 | Offset: Purpose |
| 966 | 930 | 0 Initialization Registers |
| r10613 | r10614 | |
| 978 | 942 | switch (offset) |
| 979 | 943 | { |
| 980 | 944 | case 0: |
| 981 | scn2674_write_init_regs(data); | |
| 945 | scn2674_write_init_regs(state, data); | |
| 982 | 946 | break; |
| 983 | 947 | |
| 984 | 948 | case 1: |
| 985 | 949 | scn2674_write_command(space->machine, data); |
| 986 | 950 | break; |
| 987 | 951 | |
| 988 | case 2: scn2674_screen1_l = data; break; | |
| 989 | case 3: scn2674_screen1_h = data; break; | |
| 990 | case 4: scn2674_cursor_l = data; break; | |
| 991 | case 5: scn2674_cursor_h = data; break; | |
| 992 | case 6: scn2674_screen2_l = data; break; | |
| 993 | case 7: scn2674_screen2_h = data; break; | |
| 952 | case 2: state->scn2674_screen1_l = data; break; | |
| 953 | case 3: state->scn2674_screen1_h = data; break; | |
| 954 | case 4: state->scn2674_cursor_l = data; break; | |
| 955 | case 5: state->scn2674_cursor_h = data; break; | |
| 956 | case 6: state->scn2674_screen2_l = data; break; | |
| 957 | case 7: state->scn2674_screen2_h = data; break; | |
| 994 | 958 | } |
| 995 | 959 | } |
| 996 | 960 | |
| 997 | 961 | |
| 998 | 962 | static VIDEO_START( mpu4_vid ) |
| 999 | 963 | { |
| 964 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 1000 | 965 | /* if anything uses tile sizes other than 8x8 we can't really do it this way.. we'll have to draw tiles by hand. |
| 1001 | 966 | maybe we will anyway, but for now we don't need to */ |
| 1002 | 967 | |
| 1003 | | |
| 968 | state->vid_vidram = auto_alloc_array(machine, UINT16, 0x20000/2); | |
| 1004 | 969 | |
| 1005 | memset( | |
| 970 | memset(state->vid_vidram,0,0x20000); | |
| 1006 | 971 | |
| 1007 | 972 | /* find first empty slot to decode gfx */ |
| 1008 | for (mpu4_gfx_index = 0; mpu4_gfx_index < MAX_GFX_ELEMENTS; mpu4_gfx_index++) | |
| 1009 | if (machine->gfx[mpu4_gfx_index] == 0) | |
| 973 | for (state->gfx_index = 0; state->gfx_index < MAX_GFX_ELEMENTS; state->gfx_index++) | |
| 974 | if (machine->gfx[state->gfx_index] == 0) | |
| 1010 | 975 | break; |
| 1011 | 976 | |
| 1012 | assert( | |
| 977 | assert(state->gfx_index != MAX_GFX_ELEMENTS); | |
| 1013 | 978 | |
| 1014 | 979 | /* create the char set (gfx will then be updated dynamically from RAM) */ |
| 1015 | machine->gfx[mpu4_gfx_index+0] = gfx_element_alloc(machine, &mpu4_vid_char_8x8_layout, (UINT8 *)mpu4_vid_vidram, machine->total_colors() / 16, 0); | |
| 1016 | machine->gfx[mpu4_gfx_index+1] = gfx_element_alloc(machine, &mpu4_vid_char_8x16_layout, (UINT8 *)mpu4_vid_vidram, machine->total_colors() / 16, 0); | |
| 1017 | machine->gfx[mpu4_gfx_index+2] = gfx_element_alloc(machine, &mpu4_vid_char_16x8_layout, (UINT8 *)mpu4_vid_vidram, machine->total_colors() / 16, 0); | |
| 1018 | machine->gfx[mpu4_gfx_index+3] = gfx_element_alloc(machine, &mpu4_vid_char_16x16_layout, (UINT8 *)mpu4_vid_vidram, machine->total_colors() / 16, 0); | |
| 980 | machine->gfx[state->gfx_index+0] = gfx_element_alloc(machine, &mpu4_vid_char_8x8_layout, (UINT8 *)state->vid_vidram, machine->total_colors() / 16, 0); | |
| 981 | machine->gfx[state->gfx_index+1] = gfx_element_alloc(machine, &mpu4_vid_char_8x16_layout, (UINT8 *)state->vid_vidram, machine->total_colors() / 16, 0); | |
| 982 | machine->gfx[state->gfx_index+2] = gfx_element_alloc(machine, &mpu4_vid_char_16x8_layout, (UINT8 *)state->vid_vidram, machine->total_colors() / 16, 0); | |
| 983 | machine->gfx[state->gfx_index+3] = gfx_element_alloc(machine, &mpu4_vid_char_16x16_layout, (UINT8 *)state->vid_vidram, machine->total_colors() / 16, 0); | |
| 1019 | 984 | |
| 1020 | scn2675_IR_pointer = 0; | |
| 985 | state->scn2675_IR_pointer = 0; | |
| 1021 | 986 | } |
| 1022 | 987 | |
| 1023 | 988 | |
| r10613 | r10614 | |
| 1028 | 993 | * (16 colors from 4096) |
| 1029 | 994 | ****************************/ |
| 1030 | 995 | |
| 1031 | static struct ef9369 | |
| 1032 | { | |
| 1033 | UINT32 addr; | |
| 1034 | UINT16 clut[16]; /* 13-bits - a marking bit and a 444 color */ | |
| 1035 | } pal; | |
| 1036 | ||
| 1037 | ||
| 1038 | 996 | /* Non-multiplexed mode */ |
| 1039 | 997 | |
| 1040 | 998 | static WRITE16_HANDLER( ef9369_w ) |
| 1041 | 999 | { |
| 1000 | mpu4_state *state = space->machine->driver_data<mpu4_state>(); | |
| 1001 | struct ef9369_t &pal = state->pal; | |
| 1042 | 1002 | data &= 0x00ff; |
| 1043 | 1003 | |
| 1044 | 1004 | /* Address register */ |
| r10613 | r10614 | |
| 1079 | 1039 | |
| 1080 | 1040 | static READ16_HANDLER( ef9369_r ) |
| 1081 | 1041 | { |
| 1042 | mpu4_state *state = space->machine->driver_data<mpu4_state>(); | |
| 1043 | struct ef9369_t &pal = state->pal; | |
| 1082 | 1044 | if ((offset & 1) == 0) |
| 1083 | 1045 | { |
| 1084 | 1046 | UINT16 col = pal.clut[pal.addr >> 1]; |
| r10613 | r10614 | |
| 1102 | 1064 | * Impact, may not be 100% (that has a 477) |
| 1103 | 1065 | ******************************************/ |
| 1104 | 1066 | |
| 1105 | static struct | |
| 1106 | { | |
| 1107 | UINT8 address; | |
| 1108 | UINT8 addr_cnt; | |
| 1109 | UINT8 pixmask; | |
| 1110 | UINT8 command; | |
| 1111 | rgb_t color; | |
| 1112 | } bt471; | |
| 1113 | ||
| 1114 | ||
| 1115 | 1067 | /* |
| 1116 | 1068 | * 0 0 0 Address register (RAM write mode) |
| 1117 | 1069 | * 0 0 1 Color palette RAMs |
| r10613 | r10614 | |
| 1124 | 1076 | |
| 1125 | 1077 | WRITE16_HANDLER( bt471_w ) |
| 1126 | 1078 | { |
| 1079 | mpu4_state *state = space->machine->driver_data<mpu4_state>(); | |
| 1080 | struct bt471_t &bt471 = state->bt471; | |
| 1127 | 1081 | UINT8 val = data & 0xff; |
| 1128 | 1082 | { |
| 1129 | 1083 | popmessage("Bt477: Unhandled write access (offset:%x, data:%x)", offset, val); |
| r10613 | r10614 | |
| 1182 | 1136 | |
| 1183 | 1137 | static READ8_DEVICE_HANDLER( pia_ic5_porta_track_r ) |
| 1184 | 1138 | { |
| 1139 | mpu4_state *state = device->machine->driver_data<mpu4_state>(); | |
| 1185 | 1140 | /* The SWP trackball interface connects a standard trackball to the AUX1 port on the MPU4 |
| 1186 | 1141 | mainboard. As per usual, they've taken the cheap route here, reading and processing the |
| 1187 | 1142 | raw quadrature signal from the encoder wheels for a 4 bit interface, rather than use any |
| r10613 | r10614 | |
| 1193 | 1148 | |
| 1194 | 1149 | LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",device->machine->describe_context())); |
| 1195 | 1150 | |
| 1196 | static INT8 cur[2]; | |
| 1197 | 1151 | |
| 1198 | 1152 | UINT8 data = input_port_read(device->machine, "AUX1"); |
| 1199 | 1153 | |
| 1200 | 1154 | INT8 dx = input_port_read(device->machine, "TRACKX"); |
| 1201 | 1155 | INT8 dy = input_port_read(device->machine, "TRACKY"); |
| 1202 | 1156 | |
| 1203 | cur[0] = dy + dx; | |
| 1204 | cur[1] = dy - dx; | |
| 1157 | state->cur[0] = dy + dx; | |
| 1158 | state->cur[1] = dy - dx; | |
| 1205 | 1159 | |
| 1206 | 1160 | UINT8 xa, xb, ya, yb; |
| 1207 | 1161 | |
| 1208 | 1162 | /* generate pulses for the input port (A and B are 1 unit out of phase for direction sensing)*/ |
| 1209 | xa = ((cur[0] + 1) & 3) <= 1; | |
| 1210 | xb = (cur[0] & 3) <= 1; | |
| 1211 | ya = ((cur[1] + 1) & 3) <= 1; | |
| 1212 | yb = (cur[1] & 3) <= 1; | |
| 1163 | xa = ((state->cur[0] + 1) & 3) <= 1; | |
| 1164 | xb = (state->cur[0] & 3) <= 1; | |
| 1165 | ya = ((state->cur[1] + 1) & 3) <= 1; | |
| 1166 | yb = (state->cur[1] & 3) <= 1; | |
| 1213 | 1167 | |
| 1214 | 1168 | data |= (xa << 4); // XA |
| 1215 | 1169 | data |= (ya << 5); // YA |
| r10613 | r10614 | |
| 1965 | 1919 | /* machine start (called only once) */ |
| 1966 | 1920 | static MACHINE_START( mpu4_vid ) |
| 1967 | 1921 | { |
| 1922 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 1968 | 1923 | mpu4_config_common(machine); |
| 1969 | 1924 | |
| 1970 | mod_number=4; //No AY chip | |
| 1925 | state->mod_number=4; //No AY chip | |
| 1971 | 1926 | /* setup communications */ |
| 1972 | link7a_connected = 1; | |
| 1927 | state->link7a_connected = 1; | |
| 1973 | 1928 | |
| 1974 | 1929 | /* setup 8 mechanical meters */ |
| 1975 | 1930 | MechMtr_config(machine,8); |
| r10613 | r10614 | |
| 1983 | 1938 | |
| 1984 | 1939 | static MACHINE_RESET( mpu4_vid ) |
| 1985 | 1940 | { |
| 1941 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 1986 | 1942 | ROC10937_reset(0); |
| 1987 | 1943 | |
| 1988 | mpu4_stepper_reset(); | |
| 1944 | mpu4_stepper_reset(state); | |
| 1989 | 1945 | |
| 1990 | lamp_strobe = 0; | |
| 1991 | lamp_strobe2 = 0; | |
| 1992 | lamp_data = 0; | |
| 1946 | state->lamp_strobe = 0; | |
| 1947 | state->lamp_strobe2 = 0; | |
| 1948 | state->lamp_data = 0; | |
| 1993 | 1949 | |
| 1994 | IC23GC = 0; | |
| 1995 | IC23GB = 0; | |
| 1996 | IC23GA = 0; | |
| 1997 | IC23G1 = 1; | |
| 1998 | IC23G2A = 0; | |
| 1999 | IC23G2B = 0; | |
| 1950 | state->IC23GC = 0; | |
| 1951 | state->IC23GB = 0; | |
| 1952 | state->IC23GA = 0; | |
| 1953 | state->IC23G1 = 1; | |
| 1954 | state->IC23G2A = 0; | |
| 1955 | state->IC23G2B = 0; | |
| 2000 | 1956 | |
| 2001 | prot_col = 0; | |
| 1957 | state->prot_col = 0; | |
| 2002 | 1958 | } |
| 2003 | 1959 | |
| 2004 | 1960 | static ADDRESS_MAP_START( mpu4_68k_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 2005 | 1961 | AM_RANGE(0x000000, 0x7fffff) AM_ROM |
| 2006 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE( | |
| 1962 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE_MEMBER( | |
| 2007 | 1963 | AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8("saa", saa1099_data_w, 0x00ff) |
| 2008 | 1964 | AM_RANGE(0x900002, 0x900003) AM_DEVWRITE8("saa", saa1099_control_w, 0x00ff) |
| 2009 | 1965 | AM_RANGE(0xa00000, 0xa00003) AM_READWRITE(ef9369_r, ef9369_w) |
| r10613 | r10614 | |
| 2036 | 1992 | |
| 2037 | 1993 | static ADDRESS_MAP_START( vp_68k_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 2038 | 1994 | AM_RANGE(0x000000, 0x7fffff) AM_ROM |
| 2039 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE( | |
| 1995 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE_MEMBER( | |
| 2040 | 1996 | AM_RANGE(0x810000, 0x81ffff) AM_RAM /* ? */ |
| 2041 | 1997 | AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8("saa", saa1099_data_w, 0x00ff) |
| 2042 | 1998 | AM_RANGE(0x900002, 0x900003) AM_DEVWRITE8("saa", saa1099_control_w, 0x00ff) |
| r10613 | r10614 | |
| 2070 | 2026 | |
| 2071 | 2027 | static ADDRESS_MAP_START( bwbvid_68k_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 2072 | 2028 | AM_RANGE(0x000000, 0x7fffff) AM_ROM |
| 2073 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE( | |
| 2029 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE_MEMBER( | |
| 2074 | 2030 | AM_RANGE(0x810000, 0x81ffff) AM_RAM /* ? */ |
| 2075 | 2031 | AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8("saa", saa1099_data_w, 0x00ff) |
| 2076 | 2032 | AM_RANGE(0x900002, 0x900003) AM_DEVWRITE8("saa", saa1099_control_w, 0x00ff) |
| r10613 | r10614 | |
| 2086 | 2042 | |
| 2087 | 2043 | static ADDRESS_MAP_START( bwbvid5_68k_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 2088 | 2044 | AM_RANGE(0x000000, 0x7fffff) AM_ROM |
| 2089 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE( | |
| 2045 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE_MEMBER( | |
| 2090 | 2046 | AM_RANGE(0x810000, 0x81ffff) AM_RAM /* ? */ |
| 2091 | 2047 | AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8("saa", saa1099_data_w, 0x00ff) |
| 2092 | 2048 | AM_RANGE(0x900002, 0x900003) AM_DEVWRITE8("saa", saa1099_control_w, 0x00ff) |
| r10613 | r10614 | |
| 2127 | 2083 | GFXDECODE_END |
| 2128 | 2084 | |
| 2129 | 2085 | |
| 2130 | static UINT8 *dealem_videoram; | |
| 2131 | 2086 | |
| 2132 | 2087 | /*************************************************************************** |
| 2133 | 2088 | |
| r10613 | r10614 | |
| 2190 | 2145 | |
| 2191 | 2146 | static SCREEN_UPDATE(dealem) |
| 2192 | 2147 | { |
| 2148 | mpu4_state *state = screen->machine->driver_data<mpu4_state>(); | |
| 2193 | 2149 | int x,y; |
| 2194 | 2150 | int count = 0; |
| 2195 | 2151 | |
| r10613 | r10614 | |
| 2197 | 2153 | { |
| 2198 | 2154 | for (x = 0; x < 40; x++) |
| 2199 | 2155 | { |
| 2200 | int tile = dealem_videoram[count + 0x1000] | (dealem_videoram[count] << 8); | |
| 2156 | int tile = state->dealem_videoram[count + 0x1000] | (state->dealem_videoram[count] << 8); | |
| 2201 | 2157 | count++; |
| 2202 | 2158 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,0,0,0,x * 8,y * 8); |
| 2203 | 2159 | } |
| r10613 | r10614 | |
| 2251 | 2207 | AM_RANGE(0x0e00, 0x0e03) AM_DEVREADWRITE("pia_ic7", pia6821_r, pia6821_w) /* PIA6821 IC7 */ |
| 2252 | 2208 | AM_RANGE(0x0f00, 0x0f03) AM_DEVREADWRITE("pia_ic8", pia6821_r, pia6821_w) /* PIA6821 IC8 */ |
| 2253 | 2209 | |
| 2254 | AM_RANGE(0x1000, 0x2fff) AM_RAM AM_BASE( | |
| 2210 | AM_RANGE(0x1000, 0x2fff) AM_RAM AM_BASE_MEMBER(mpu4_state, dealem_videoram) | |
| 2255 | 2211 | AM_RANGE(0x8000, 0xffff) AM_ROM AM_WRITENOP/* 64k paged ROM (4 pages) */ |
| 2256 | 2212 | ADDRESS_MAP_END |
| 2257 | 2213 | |
| 2258 | static int rowcounter = 0; | |
| 2259 | static int linecounter = 0; | |
| 2260 | 2214 | |
| 2261 | 2215 | |
| 2262 | 2216 | static TIMER_DEVICE_CALLBACK( scanline_timer_callback ) |
| 2263 | 2217 | { |
| 2218 | mpu4_state *state = timer.machine->driver_data<mpu4_state>(); | |
| 2264 | 2219 | int current_scanline=param; |
| 2265 | 2220 | timer.machine->scheduler().synchronize(); |
| 2266 | 2221 | |
| r10613 | r10614 | |
| 2269 | 2224 | { |
| 2270 | 2225 | // these will be used to track which row / line we're on eventually |
| 2271 | 2226 | // and used by the renderer to render the correct data |
| 2272 | rowcounter = 0; linecounter = 0; | |
| 2227 | state->rowcounter = 0; state->linecounter = 0; | |
| 2273 | 2228 | |
| 2274 | // scn2674_status_register &= ~0x10; // clear vblank | |
| 2229 | // state->scn2674_status_register &= ~0x10; // clear vblank | |
| 2275 | 2230 | |
| 2276 | scn2674_status_register |= 0x02; | |
| 2231 | state->scn2674_status_register |= 0x02; | |
| 2277 | 2232 | /* Ready - this triggers for the first scanline of the screen */ |
| 2278 | if (scn2674_irq_mask&0x02) | |
| 2233 | if (state->scn2674_irq_mask&0x02) | |
| 2279 | 2234 | { |
| 2280 | 2235 | LOGSTUFF(("SCN2674 Ready\n")); |
| 2281 | scn2674_irq_state = 1; | |
| 2282 | scn2674_irq_register |= 0x02; | |
| 2236 | state->scn2674_irq_state = 1; | |
| 2237 | state->scn2674_irq_register |= 0x02; | |
| 2283 | 2238 | update_mpu68_interrupts(timer.machine); |
| 2284 | 2239 | } |
| 2285 | 2240 | } |
| r10613 | r10614 | |
| 2287 | 2242 | // should be triggered at the start of each ROW (line zero for that row) |
| 2288 | 2243 | if ((current_scanline%8 == 7) && (current_scanline<296)) |
| 2289 | 2244 | { |
| 2290 | scn2674_status_register |= 0x08; | |
| 2291 | if (scn2674_irq_mask&0x08) | |
| 2245 | state->scn2674_status_register |= 0x08; | |
| 2246 | if (state->scn2674_irq_mask&0x08) | |
| 2292 | 2247 | { |
| 2293 | 2248 | LOGSTUFF(("SCN2674 Line Zero\n")); |
| 2294 | scn2674_irq_state = 1; | |
| 2295 | scn2674_irq_register |= 0x08; | |
| 2249 | state->scn2674_irq_state = 1; | |
| 2250 | state->scn2674_irq_register |= 0x08; | |
| 2296 | 2251 | update_mpu68_interrupts(timer.machine); |
| 2297 | 2252 | } |
| 2298 | 2253 | } |
| 2299 | 2254 | |
| 2300 | 2255 | // this is ROWS not scanlines!! |
| 2301 | if (current_scanline == IR12_scn2674_split_register_1*8) | |
| 2256 | if (current_scanline == state->IR12_scn2674_split_register_1*8) | |
| 2302 | 2257 | /* Split Screen 1 */ |
| 2303 | 2258 | { |
| 2304 | if (scn2674_screen2_h & 0x40) | |
| 2259 | if (state->scn2674_screen2_h & 0x40) | |
| 2305 | 2260 | { |
| 2306 | 2261 | popmessage("Split screen 1 address shift required, contact MAMEDEV"); |
| 2307 | 2262 | } |
| 2308 | scn2674_status_register |= 0x04; | |
| 2309 | if (scn2674_irq_mask&0x04) | |
| 2263 | state->scn2674_status_register |= 0x04; | |
| 2264 | if (state->scn2674_irq_mask&0x04) | |
| 2310 | 2265 | { |
| 2311 | 2266 | LOGSTUFF(("SCN2674 Split Screen 1\n")); |
| 2312 | scn2674_irq_state = 1; | |
| 2267 | state->scn2674_irq_state = 1; | |
| 2313 | 2268 | update_mpu68_interrupts(timer.machine); |
| 2314 | 2269 | timer.machine->primary_screen->update_partial(timer.machine->primary_screen->vpos()); |
| 2315 | 2270 | |
| 2316 | scn2674_irq_register |= 0x04; | |
| 2271 | state->scn2674_irq_register |= 0x04; | |
| 2317 | 2272 | } |
| 2318 | 2273 | } |
| 2319 | 2274 | |
| 2320 | 2275 | // this is in ROWS not scanlines!!! |
| 2321 | if (current_scanline == IR13_scn2674_split_register_2*8) | |
| 2276 | if (current_scanline == state->IR13_scn2674_split_register_2*8) | |
| 2322 | 2277 | /* Split Screen 2 */ |
| 2323 | 2278 | { |
| 2324 | if (scn2674_screen2_h & 0x80) | |
| 2279 | if (state->scn2674_screen2_h & 0x80) | |
| 2325 | 2280 | { |
| 2326 | 2281 | popmessage("Split screen 2 address shift required, contact MAMEDEV"); |
| 2327 | 2282 | } |
| 2328 | scn2674_status_register |= 0x01; | |
| 2329 | if (scn2674_irq_mask&0x01) | |
| 2283 | state->scn2674_status_register |= 0x01; | |
| 2284 | if (state->scn2674_irq_mask&0x01) | |
| 2330 | 2285 | { |
| 2331 | 2286 | LOGSTUFF(("SCN2674 Split Screen 2 irq\n")); |
| 2332 | scn2674_irq_state = 1; | |
| 2333 | scn2674_irq_register |= 0x01; | |
| 2287 | state->scn2674_irq_state = 1; | |
| 2288 | state->scn2674_irq_register |= 0x01; | |
| 2334 | 2289 | update_mpu68_interrupts(timer.machine); |
| 2335 | 2290 | timer.machine->primary_screen->update_partial(timer.machine->primary_screen->vpos()); |
| 2336 | 2291 | |
| r10613 | r10614 | |
| 2340 | 2295 | // vblank? |
| 2341 | 2296 | if (current_scanline == 300) |
| 2342 | 2297 | { |
| 2343 | /* if (scn2674_display_enabled) ? */ | |
| 2298 | /* if (state->scn2674_display_enabled) ? */ | |
| 2344 | 2299 | { |
| 2345 | if (scn2674_irq_mask&0x10) | |
| 2300 | if (state->scn2674_irq_mask&0x10) | |
| 2346 | 2301 | { |
| 2347 | 2302 | LOGSTUFF(("vblank irq\n")); |
| 2348 | scn2674_irq_state = 1; | |
| 2303 | state->scn2674_irq_state = 1; | |
| 2349 | 2304 | update_mpu68_interrupts(timer.machine); |
| 2350 | 2305 | |
| 2351 | scn2674_irq_register |= 0x10; | |
| 2306 | state->scn2674_irq_register |= 0x10; | |
| 2352 | 2307 | } |
| 2353 | 2308 | } |
| 2354 | scn2674_status_register |= 0x10; | |
| 2309 | state->scn2674_status_register |= 0x10; | |
| 2355 | 2310 | } |
| 2356 | 2311 | |
| 2357 | 2312 | // printf("scanline %d\n",current_scanline); |
| 2358 | 2313 | } |
| 2359 | 2314 | |
| 2360 | 2315 | |
| 2361 | static MACHINE_CONFIG_START( mpu4_vid, | |
| 2316 | static MACHINE_CONFIG_START( mpu4_vid, mpu4 | |
| 2362 | 2317 | MCFG_CPU_ADD("maincpu", M6809, MPU4_MASTER_CLOCK/4 ) |
| 2363 | 2318 | MCFG_CPU_PROGRAM_MAP(mpu4_6809_map) |
| 2364 | 2319 | MCFG_TIMER_ADD_PERIODIC("50hz",gen_50hz, attotime::from_hz(100)) |
| r10613 | r10614 | |
| 2423 | 2378 | MCFG_CPU_PROGRAM_MAP(vp_68k_map) |
| 2424 | 2379 | MACHINE_CONFIG_END |
| 2425 | 2380 | |
| 2426 | static MACHINE_CONFIG_START( bwbvid, | |
| 2381 | static MACHINE_CONFIG_START( bwbvid, mpu4 | |
| 2427 | 2382 | MCFG_CPU_ADD("maincpu", M6809, MPU4_MASTER_CLOCK/4 ) |
| 2428 | 2383 | MCFG_CPU_PROGRAM_MAP(bwbvid_6809_map) |
| 2429 | 2384 | MCFG_TIMER_ADD_PERIODIC("50hz",gen_50hz, attotime::from_hz(100)) |
| r10613 | r10614 | |
| 2488 | 2443 | MACHINE_CONFIG_END |
| 2489 | 2444 | |
| 2490 | 2445 | /* machine driver for Zenitone Deal 'Em board */ |
| 2491 | static MACHINE_CONFIG_START( dealem, | |
| 2446 | static MACHINE_CONFIG_START( dealem, mpu4 | |
| 2492 | 2447 | MCFG_MACHINE_START(mpu4mod2) /* main mpu4 board initialisation */ |
| 2493 | 2448 | MCFG_MACHINE_RESET(mpu4_vid) |
| 2494 | 2449 | MCFG_CPU_ADD("maincpu", M6809, MPU4_MASTER_CLOCK/4) |
| r10613 | r10614 | |
| 2548 | 2503 | |
| 2549 | 2504 | static WRITE16_HANDLER( characteriser16_w ) |
| 2550 | 2505 | { |
| 2506 | mpu4_state *state = space->machine->driver_data<mpu4_state>(); | |
| 2551 | 2507 | int x; |
| 2552 | 2508 | int call=data; |
| 2553 | 2509 | LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X", cpu_get_previouspc(space->cpu),offset,data)); |
| 2554 | 2510 | |
| 2555 | if (! | |
| 2511 | if (!state->current_chr_table) | |
| 2556 | 2512 | fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(space->cpu)); |
| 2557 | 2513 | |
| 2558 | for (x = prot_col; x < 64; x++) | |
| 2514 | for (x = state->prot_col; x < 64; x++) | |
| 2559 | 2515 | { |
| 2560 | 2516 | if (call == 0) |
| 2561 | 2517 | { |
| 2562 | prot_col = 0; | |
| 2518 | state->prot_col = 0; | |
| 2563 | 2519 | } |
| 2564 | 2520 | else |
| 2565 | 2521 | { |
| 2566 | if ( | |
| 2522 | if (state->current_chr_table[(x)].call == call) | |
| 2567 | 2523 | { |
| 2568 | prot_col = x; | |
| 2569 | LOG_CHR(("Characteriser find column %02X\n",prot_col)); | |
| 2524 | state->prot_col = x; | |
| 2525 | LOG_CHR(("Characteriser find column %02X\n",state->prot_col)); | |
| 2570 | 2526 | break; |
| 2571 | 2527 | } |
| 2572 | 2528 | } |
| r10613 | r10614 | |
| 2576 | 2532 | |
| 2577 | 2533 | static READ16_HANDLER( characteriser16_r ) |
| 2578 | 2534 | { |
| 2579 | LOG_CHR_FULL(("%04x Characteriser read offset %02X,data %02X", cpu_get_previouspc(space->cpu),offset,mpu4_current_chr_table[prot_col].response)); | |
| 2535 | mpu4_state *state = space->machine->driver_data<mpu4_state>(); | |
| 2536 | LOG_CHR_FULL(("%04x Characteriser read offset %02X,data %02X", cpu_get_previouspc(space->cpu),offset,state->current_chr_table[state->prot_col].response)); | |
| 2580 | 2537 | LOG_CHR(("Characteriser read offset %02X \n",offset)); |
| 2581 | LOG_CHR(("Characteriser read data %02X \n", | |
| 2538 | LOG_CHR(("Characteriser read data %02X \n",state->current_chr_table[state->prot_col].response)); | |
| 2582 | 2539 | |
| 2583 | if (! | |
| 2540 | if (!state->current_chr_table) | |
| 2584 | 2541 | fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(space->cpu)); |
| 2585 | 2542 | |
| 2586 | 2543 | |
| r10613 | r10614 | |
| 2590 | 2547 | return 0x00; |
| 2591 | 2548 | } |
| 2592 | 2549 | |
| 2593 | return | |
| 2550 | return state->current_chr_table[state->prot_col].response; | |
| 2594 | 2551 | } |
| 2595 | 2552 | |
| 2596 | 2553 | |
| r10613 | r10614 | |
| 2739 | 2696 | |
| 2740 | 2697 | static DRIVER_INIT (adders) |
| 2741 | 2698 | { |
| 2742 | mpu4_current_chr_table = adders_data; | |
| 2699 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2700 | state->current_chr_table = adders_data; | |
| 2743 | 2701 | } |
| 2744 | 2702 | |
| 2745 | 2703 | static DRIVER_INIT (crmaze) |
| 2746 | 2704 | { |
| 2747 | mpu4_current_chr_table = crmaze_data; | |
| 2705 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2706 | state->current_chr_table = crmaze_data; | |
| 2748 | 2707 | } |
| 2749 | 2708 | |
| 2750 | 2709 | static DRIVER_INIT (crmazea) |
| 2751 | 2710 | { |
| 2752 | mpu4_current_chr_table = crmazea_data; | |
| 2711 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2712 | state->current_chr_table = crmazea_data; | |
| 2753 | 2713 | } |
| 2754 | 2714 | |
| 2755 | 2715 | static DRIVER_INIT (crmaze2) |
| 2756 | 2716 | { |
| 2757 | mpu4_current_chr_table = crmaze2_data; | |
| 2717 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2718 | state->current_chr_table = crmaze2_data; | |
| 2758 | 2719 | } |
| 2759 | 2720 | |
| 2760 | 2721 | static DRIVER_INIT (crmaze3) |
| 2761 | 2722 | { |
| 2762 | mpu4_current_chr_table = crmaze3_data; | |
| 2723 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2724 | state->current_chr_table = crmaze3_data; | |
| 2763 | 2725 | } |
| 2764 | 2726 | |
| 2765 | 2727 | static DRIVER_INIT (crmaze3a) |
| 2766 | 2728 | { |
| 2767 | mpu4_current_chr_table = crmaze3a_data; | |
| 2729 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2730 | state->current_chr_table = crmaze3a_data; | |
| 2768 | 2731 | } |
| 2769 | 2732 | |
| 2770 | 2733 | static DRIVER_INIT (mating) |
| 2771 | 2734 | { |
| 2735 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2772 | 2736 | address_space *space = cputag_get_address_space(machine, "video", ADDRESS_SPACE_PROGRAM); |
| 2773 | 2737 | device_t *device = machine->device("oki"); |
| 2774 | 2738 | |
| r10613 | r10614 | |
| 2778 | 2742 | /* There is also an OKIM6376 present on the program card */ |
| 2779 | 2743 | memory_install_readwrite16_device_handler(space, device, 0xffa040, 0xffa0ff, 0, 0, oki_r, oki_w ); |
| 2780 | 2744 | |
| 2781 | | |
| 2745 | state->current_chr_table = mating_data; | |
| 2782 | 2746 | } |
| 2783 | 2747 | |
| 2784 | 2748 | |
| 2785 | 2749 | static DRIVER_INIT (skiltrek) |
| 2786 | 2750 | { |
| 2787 | mpu4_current_chr_table = skiltrek_data; | |
| 2751 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2752 | state->current_chr_table = skiltrek_data; | |
| 2788 | 2753 | } |
| 2789 | 2754 | |
| 2790 | 2755 | static DRIVER_INIT (timemchn) |
| 2791 | 2756 | { |
| 2792 | mpu4_current_chr_table = timemchn_data; | |
| 2757 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2758 | state->current_chr_table = timemchn_data; | |
| 2793 | 2759 | } |
| 2794 | 2760 | |
| 2795 | 2761 | static DRIVER_INIT (strikeit) |
| 2796 | 2762 | { |
| 2797 | mpu4_current_chr_table = strikeit_data; | |
| 2763 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2764 | state->current_chr_table = strikeit_data; | |
| 2798 | 2765 | } |
| 2799 | 2766 | |
| 2800 | 2767 | static DRIVER_INIT (turnover) |
| 2801 | 2768 | { |
| 2802 | mpu4_current_chr_table = turnover_data; | |
| 2769 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2770 | state->current_chr_table = turnover_data; | |
| 2803 | 2771 | } |
| 2804 | 2772 | |
| 2805 | 2773 | static DRIVER_INIT (eyesdown) |
| 2806 | 2774 | { |
| 2807 | mpu4_current_chr_table = eyesdown_data; | |
| 2775 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2776 | state->current_chr_table = eyesdown_data; | |
| 2808 | 2777 | } |
| 2809 | 2778 | |
| 2810 | 2779 | static DRIVER_INIT (quidgrid) |
| 2811 | 2780 | { |
| 2812 | mpu4_current_chr_table = quidgrid_data; | |
| 2781 | mpu4_state *state = machine->driver_data<mpu4_state>(); | |
| 2782 | state->current_chr_table = quidgrid_data; | |
| 2813 | 2783 | } |
| 2814 | 2784 | |
| 2815 | 2785 |
| r10613 | r10614 | |
|---|---|---|
| 91 | 91 | |
| 92 | 92 | #include "emu.h" |
| 93 | 93 | #include "cpu/i386/i386.h" |
| 94 | #include "machine/pic8259.h" | |
| 95 | #include "machine/pit8253.h" | |
| 96 | #include "machine/mc146818.h" | |
| 97 | #include "machine/8042kbdc.h" | |
| 98 | #include "machine/pcshare.h" | |
| 99 | #include "video/pc_vga.h" | |
| 100 | #include "video/pc_video.h" | |
| 94 | 101 | |
| 95 | static VIDEO_START(pangofun) | |
| 102 | static ADDRESS_MAP_START( pcat_map, ADDRESS_SPACE_PROGRAM, 32 ) | |
| 103 | AM_RANGE(0x00000000, 0x0009ffff) AM_RAM | |
| 104 | AM_RANGE(0x000a0000, 0x000bffff) AM_RAM | |
| 105 | AM_RANGE(0x000c0000, 0x000c7fff) AM_ROM AM_REGION("video_bios", 0) | |
| 106 | AM_RANGE(0x000f0000, 0x000fffff) AM_ROM AM_REGION("bios", 0 ) | |
| 107 | AM_RANGE(0x00100000, 0x001fffff) AM_RAM | |
| 108 | AM_RANGE(0xffff0000, 0xffffffff) AM_ROM AM_REGION("bios", 0 ) | |
| 109 | ADDRESS_MAP_END | |
| 110 | ||
| 111 | static ADDRESS_MAP_START( pcat_io, ADDRESS_SPACE_IO, 32 ) | |
| 112 | AM_IMPORT_FROM(pcat32_io_common) | |
| 113 | AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE8_MODERN("rtc", mc146818_device, read, write, 0xffffffff) | |
| 114 | ADDRESS_MAP_END | |
| 115 | ||
| 116 | #define AT_KEYB_HELPER(bit, text, key1) \ | |
| 117 | PORT_BIT( bit, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(text) PORT_CODE(key1) | |
| 118 | ||
| 119 | static INPUT_PORTS_START( pangofun ) | |
| 120 | PORT_START("pc_keyboard_0") | |
| 121 | PORT_BIT ( 0x0001, 0x0000, IPT_UNUSED ) /* unused scancode 0 */ | |
| 122 | AT_KEYB_HELPER( 0x0002, "Esc", KEYCODE_Q ) /* Esc 01 81 */ | |
| 123 | ||
| 124 | PORT_START("pc_keyboard_1") | |
| 125 | AT_KEYB_HELPER( 0x0020, "Y", KEYCODE_Y ) /* Y 15 95 */ | |
| 126 | AT_KEYB_HELPER( 0x1000, "Enter", KEYCODE_ENTER ) /* Enter 1C 9C */ | |
| 127 | ||
| 128 | PORT_START("pc_keyboard_2") | |
| 129 | ||
| 130 | PORT_START("pc_keyboard_3") | |
| 131 | AT_KEYB_HELPER( 0x0002, "N", KEYCODE_N ) /* N 31 B1 */ | |
| 132 | AT_KEYB_HELPER( 0x0800, "F1", KEYCODE_S ) /* F1 3B BB */ | |
| 133 | ||
| 134 | PORT_START("pc_keyboard_4") | |
| 135 | ||
| 136 | PORT_START("pc_keyboard_5") | |
| 137 | ||
| 138 | PORT_START("pc_keyboard_6") | |
| 139 | AT_KEYB_HELPER( 0x0040, "(MF2)Cursor Up", KEYCODE_UP ) /* Up 67 e7 */ | |
| 140 | AT_KEYB_HELPER( 0x0080, "(MF2)Page Up", KEYCODE_PGUP ) /* Page Up 68 e8 */ | |
| 141 | AT_KEYB_HELPER( 0x0100, "(MF2)Cursor Left", KEYCODE_LEFT ) /* Left 69 e9 */ | |
| 142 | AT_KEYB_HELPER( 0x0200, "(MF2)Cursor Right", KEYCODE_RIGHT ) /* Right 6a ea */ | |
| 143 | AT_KEYB_HELPER( 0x0800, "(MF2)Cursor Down", KEYCODE_DOWN ) /* Down 6c ec */ | |
| 144 | AT_KEYB_HELPER( 0x1000, "(MF2)Page Down", KEYCODE_PGDN ) /* Page Down 6d ed */ | |
| 145 | AT_KEYB_HELPER( 0x4000, "Del", KEYCODE_A ) /* Delete 6f ef */ | |
| 146 | ||
| 147 | PORT_START("pc_keyboard_7") | |
| 148 | INPUT_PORTS_END | |
| 149 | ||
| 150 | static void pangofun_set_keyb_int(running_machine *machine, int state) | |
| 96 | 151 | { |
| 152 | pic8259_ir1_w(machine->device("pic8259_1"), state); | |
| 97 | 153 | } |
| 98 | 154 | |
| 99 | static SCREEN_UPDATE(pangofun) | |
| 155 | static const struct pc_vga_interface vga_interface ={ | |
| 156 | NULL, | |
| 157 | NULL, | |
| 158 | NULL, | |
| 159 | ADDRESS_SPACE_IO, | |
| 160 | 0x0000 | |
| 161 | }; | |
| 162 | ||
| 163 | static void set_gate_a20(running_machine *machine, int a20) | |
| 100 | 164 | { |
| 101 | | |
| 165 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_A20, a20); | |
| 102 | 166 | } |
| 103 | 167 | |
| 104 | static ADDRESS_MAP_START( pangofun_map, ADDRESS_SPACE_PROGRAM, 32 ) | |
| 105 | AM_RANGE(0x00000000, 0x0001ffff) AM_ROM | |
| 106 | ADDRESS_MAP_END | |
| 168 | static void keyboard_interrupt(running_machine *machine, int state) | |
| 169 | { | |
| 170 | pic8259_ir1_w(machine->device("pic8259_1"), state); | |
| 171 | } | |
| 107 | 172 | |
| 173 | static int pcat_dyn_get_out2(running_machine *machine) { | |
| 174 | return pit8253_get_output(machine->device("pit8254"), 2 ); | |
| 175 | } | |
| 108 | 176 | |
| 109 | static INPUT_PORTS_START( pangofun ) | |
| 110 | INPUT_PORTS_END | |
| 111 | 177 | |
| 178 | static const struct kbdc8042_interface at8042 = | |
| 179 | { | |
| 180 | KBDC8042_AT386, set_gate_a20, keyboard_interrupt, pcat_dyn_get_out2 | |
| 181 | }; | |
| 112 | 182 | |
| 183 | static MACHINE_START( pangofun ) | |
| 184 | { | |
| 185 | cpu_set_irq_callback(machine->device("maincpu"), pcat_irq_callback); | |
| 186 | init_pc_common(machine, PCCOMMON_KEYBOARD_AT, pangofun_set_keyb_int); | |
| 187 | kbdc8042_init(machine, &at8042); | |
| 188 | } | |
| 189 | ||
| 190 | ||
| 113 | 191 | static MACHINE_CONFIG_START( pangofun, driver_device ) |
| 114 | 192 | /* basic machine hardware */ |
| 115 | MCFG_CPU_ADD("maincpu", I486, 14318180*2) /* I486 ?? Mhz */ | |
| 116 | MCFG_CPU_PROGRAM_MAP(pangofun_map) | |
| 193 | MCFG_CPU_ADD("maincpu", I486, 40000000 ) /* I486 ?? Mhz */ | |
| 194 | MCFG_CPU_PROGRAM_MAP(pcat_map) | |
| 195 | MCFG_CPU_IO_MAP(pcat_io) | |
| 117 | 196 | |
| 118 | 197 | /* video hardware */ |
| 119 | MCFG_SCREEN_ADD("screen", RASTER) | |
| 120 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 198 | MCFG_FRAGMENT_ADD( pcvideo_vga ) | |
| 199 | MCFG_SCREEN_MODIFY("screen") | |
| 121 | 200 | MCFG_SCREEN_REFRESH_RATE(60) |
| 122 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 123 | MCFG_SCREEN_SIZE(64*8, 32*8) | |
| 124 | MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1) | |
| 125 | MCFG_SCREEN_UPDATE(pangofun) | |
| 201 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ | |
| 126 | 202 | |
| 127 | MCFG_PALETTE_LENGTH(0x100) | |
| 128 | ||
| 129 | MCFG_VIDEO_START(pangofun) | |
| 203 | MCFG_MACHINE_START(pangofun) | |
| 204 | MCFG_MC146818_ADD( "rtc", MC146818_STANDARD ) | |
| 205 | MCFG_FRAGMENT_ADD( pcat_common ) | |
| 130 | 206 | MACHINE_CONFIG_END |
| 131 | 207 | |
| 132 | 208 | |
| 133 | 209 | ROM_START(pangofun) |
| 134 | ROM_REGION32_LE(0x20000, " | |
| 210 | ROM_REGION32_LE(0x20000, "b | |
| 135 | 211 | ROM_LOAD("bios.bin", 0x000000, 0x10000, CRC(e70168ff) SHA1(4a0d985c218209b7db2b2d33f606068aae539020) ) |
| 136 | 212 | |
| 137 | ROM_REGION32_LE(0x20000, "user1", 0) /* gfx card bios */ | |
| 138 | ROM_LOAD("vgabios.bin", 0x000000, 0x20000, NO_DUMP ) // 1x maskrom (28pin) | |
| 213 | // ROM_REGION32_LE(0x20000, "video_bios", 0) /* gfx card bios */ | |
| 214 | // ROM_LOAD("vgabios.bin", 0x000000, 0x20000, NO_DUMP ) // 1x maskrom (28pin) | |
| 215 | ROM_REGION(0x20000, "video_bios", 0) /* Trident TVGA9000 BIOS */ | |
| 216 | ROM_LOAD16_BYTE("prom.vid", 0x00000, 0x04000, CRC(ad7eadaf) SHA1(ab379187914a832284944e81e7652046c7d938cc) ) | |
| 217 | ROM_CONTINUE( 0x00001, 0x04000 ) | |
| 139 | 218 | |
| 140 | 219 | /* this is what was on the rom board, mapping unknown */ |
| 141 | ROM_REGION32_LE(0xa00000, " | |
| 220 | ROM_REGION32_LE(0xa00000, "game_prg", 0) /* rom board */ | |
| 142 | 221 | ROM_LOAD32_WORD("bank0.u11", 0x000000, 0x80000, CRC(6ce951d7) SHA1(1dd09491c651920a8a507bdc6584400367e5a292) ) |
| 143 | 222 | ROM_LOAD32_WORD("bank0.u31", 0x000002, 0x80000, CRC(b6c06baf) SHA1(79074b086d24737d629272d98f17de6e1e650485) ) |
| 144 | 223 | ROM_LOAD32_WORD("bank1.u12", 0x100000, 0x80000, CRC(5adc1f2e) SHA1(17abde7a2836d042a698661339eefe242dd9af0d) ) |
| r10613 | r10614 | |
| 159 | 238 | ROM_LOAD32_WORD("bank8.u39", 0x900002, 0x20000, CRC(72422c66) SHA1(40b8cca3f99925cf019053921165f6a4a30d784d) ) |
| 160 | 239 | ROM_END |
| 161 | 240 | |
| 241 | static DRIVER_INIT(pangofun) | |
| 242 | { | |
| 243 | pc_vga_init(machine, &vga_interface, NULL); | |
| 244 | } | |
| 162 | 245 | |
| 163 | GAME( 1995, pangofun, 0, pangofun, pangofun, | |
| 246 | GAME( 1995, pangofun, 0, pangofun, pangofun, pangofun, ROT0, "InfoCube", "Pango Fun (Italy)", GAME_NOT_WORKING|GAME_NO_SOUND ) |
| r10613 | r10614 | |
|---|---|---|
| 59 | 59 | #include "machine/i2cmem.h" |
| 60 | 60 | |
| 61 | 61 | |
| 62 | enum nand_mode_t | |
| 63 | { | |
| 64 | NAND_M_INIT, // initial state | |
| 65 | NAND_M_READ, // read page data | |
| 66 | }; | |
| 67 | ||
| 68 | struct nand_t | |
| 69 | { | |
| 70 | nand_mode_t mode; | |
| 71 | int page_addr; | |
| 72 | int byte_addr; | |
| 73 | int addr_load_ptr; | |
| 74 | }; | |
| 75 | ||
| 76 | ||
| 62 | 77 | class ghosteo_state : public driver_device |
| 63 | 78 | { |
| 64 | 79 | public: |
| r10613 | r10614 | |
| 69 | 84 | UINT32 *steppingstone; |
| 70 | 85 | int security_count; |
| 71 | 86 | UINT32 bballoon_port[20]; |
| 87 | struct nand_t nand; | |
| 72 | 88 | }; |
| 73 | 89 | |
| 74 | 90 | |
| r10613 | r10614 | |
| 98 | 114 | static const UINT8 security_data[] = { 0x01, 0xC4, 0xFF, 0x22 }; |
| 99 | 115 | |
| 100 | 116 | |
| 101 | enum nand_mode_t | |
| 102 | { | |
| 103 | NAND_M_INIT, // initial state | |
| 104 | NAND_M_READ, // read page data | |
| 105 | }; | |
| 106 | ||
| 107 | struct nand_t | |
| 108 | { | |
| 109 | nand_mode_t mode; | |
| 110 | int page_addr; | |
| 111 | int byte_addr; | |
| 112 | int addr_load_ptr; | |
| 113 | }; | |
| 114 | ||
| 115 | static struct nand_t nand; | |
| 116 | ||
| 117 | 117 | static UINT32 s3c2410_gpio_port_r( device_t *device, int port) |
| 118 | 118 | { |
| 119 | 119 | ghosteo_state *state = device->machine->driver_data<ghosteo_state>(); |
| r10613 | r10614 | |
| 167 | 167 | |
| 168 | 168 | static WRITE8_DEVICE_HANDLER( s3c2410_nand_command_w ) |
| 169 | 169 | { |
| 170 | ghosteo_state *state = device->machine->driver_data<ghosteo_state>(); | |
| 171 | struct nand_t &nand = state->nand; | |
| 170 | 172 | // device_t *nand = device->machine->device( "nand"); |
| 171 | 173 | logerror( "s3c2410_nand_command_w %02X\n", data); |
| 172 | 174 | switch (data) |
| r10613 | r10614 | |
| 189 | 191 | |
| 190 | 192 | static WRITE8_DEVICE_HANDLER( s3c2410_nand_address_w ) |
| 191 | 193 | { |
| 194 | ghosteo_state *state = device->machine->driver_data<ghosteo_state>(); | |
| 195 | struct nand_t &nand = state->nand; | |
| 192 | 196 | // device_t *nand = device->machine->device( "nand"); |
| 193 | 197 | logerror( "s3c2410_nand_address_w %02X\n", data); |
| 194 | 198 | switch (nand.mode) |
| r10613 | r10614 | |
| 221 | 225 | |
| 222 | 226 | static READ8_DEVICE_HANDLER( s3c2410_nand_data_r ) |
| 223 | 227 | { |
| 228 | ghosteo_state *state = device->machine->driver_data<ghosteo_state>(); | |
| 229 | struct nand_t &nand = state->nand; | |
| 224 | 230 | // device_t *nand = device->machine->device( "nand"); |
| 225 | 231 | UINT8 data = 0; |
| 226 | 232 | switch (nand.mode) |
| r10613 | r10614 | |
|---|---|---|
| 242 | 242 | } |
| 243 | 243 | #endif |
| 244 | 244 | |
| 245 | static INTERRUPT_GEN ( sound_interrupt ) { | |
| 246 | deco_ld_state *state = device->machine->driver_data<deco_ld_state>(); if (!state->nmimask) cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); } | |
| 245 | static INTERRUPT_GEN ( sound_interrupt ) | |
| 246 | { | |
| 247 | deco_ld_state *state = device->machine->driver_data<deco_ld_state>(); | |
| 248 | if (!state->nmimask) cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); | |
| 249 | } | |
| 247 | 250 | |
| 248 | 251 | |
| 249 | 252 | static ADDRESS_MAP_START( rblaster_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r10613 | r10614 | |
|---|---|---|
| 30 | 30 | #include "includes/magmax.h" |
| 31 | 31 | |
| 32 | 32 | |
| 33 | static UINT8 sound_latch = 0; | |
| 34 | static UINT8 LS74_clr = 0; | |
| 35 | static UINT8 LS74_q = 0; | |
| 36 | static UINT8 gain_control = 0; | |
| 37 | ||
| 38 | static emu_timer *interrupt_timer; | |
| 39 | ||
| 40 | 33 | static WRITE16_HANDLER( magmax_sound_w ) |
| 41 | 34 | { |
| 35 | magmax_state *state = space->machine->driver_data<magmax_state>(); | |
| 42 | 36 | if (ACCESSING_BITS_0_7) |
| 43 | 37 | { |
| 44 | sound_latch = (data & 0xff) << 1; | |
| 38 | state->sound_latch = (data & 0xff) << 1; | |
| 45 | 39 | cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE); |
| 46 | 40 | } |
| 47 | 41 | } |
| r10613 | r10614 | |
| 54 | 48 | |
| 55 | 49 | static READ8_HANDLER( magmax_sound_r ) |
| 56 | 50 | { |
| 57 | return (sound_latch | LS74_q); | |
| 51 | magmax_state *state = space->machine->driver_data<magmax_state>(); | |
| 52 | return (state->sound_latch | state->LS74_q); | |
| 58 | 53 | } |
| 59 | 54 | |
| 60 | 55 | static WRITE8_DEVICE_HANDLER( ay8910_portB_0_w ) |
| 61 | 56 | { |
| 57 | magmax_state *state = device->machine->driver_data<magmax_state>(); | |
| 62 | 58 | /*bit 0 is input to CLR line of the LS74*/ |
| 63 | LS74_clr = data & 1; | |
| 64 | if (LS74_clr == 0) | |
| 65 | LS74_q = 0; | |
| 59 | state->LS74_clr = data & 1; | |
| 60 | if (state->LS74_clr == 0) | |
| 61 | state->LS74_q = 0; | |
| 66 | 62 | } |
| 67 | 63 | |
| 68 | 64 | static TIMER_CALLBACK( scanline_callback ) |
| 69 | 65 | { |
| 66 | magmax_state *state = machine->driver_data<magmax_state>(); | |
| 70 | 67 | int scanline = param; |
| 71 | 68 | |
| 72 | 69 | /* bit 0 goes hi whenever line V6 from video part goes lo->hi */ |
| 73 | 70 | /* that is when scanline is 64 and 192 accordingly */ |
| 74 | if (LS74_clr != 0) | |
| 75 | LS74_q = 1; | |
| 71 | if (state->LS74_clr != 0) | |
| 72 | state->LS74_q = 1; | |
| 76 | 73 | |
| 77 | 74 | scanline += 128; |
| 78 | 75 | scanline &= 255; |
| 79 | 76 | |
| 80 | interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); | |
| 77 | state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); | |
| 81 | 78 | } |
| 82 | 79 | |
| 83 | 80 | static MACHINE_START( magmax ) |
| 84 | 81 | { |
| 82 | magmax_state *state = machine->driver_data<magmax_state>(); | |
| 85 | 83 | /* Create interrupt timer */ |
| 86 | interrupt_timer = machine->scheduler().timer_alloc(FUNC(scanline_callback)); | |
| 84 | state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(scanline_callback)); | |
| 87 | 85 | |
| 88 | 86 | /* Set up save state */ |
| 89 | state_save_register_global(machine, sound_latch); | |
| 90 | state_save_register_global(machine, LS74_clr); | |
| 91 | state_save_register_global(machine, LS74_q); | |
| 92 | state_save_register_global(machine, gain_control); | |
| 87 | state_save_register_global(machine, state->sound_latch); | |
| 88 | state_save_register_global(machine, state->LS74_clr); | |
| 89 | state_save_register_global(machine, state->LS74_q); | |
| 90 | state_save_register_global(machine, state->gain_control); | |
| 93 | 91 | } |
| 94 | 92 | |
| 95 | 93 | static MACHINE_RESET( magmax ) |
| 96 | 94 | { |
| 97 | interrupt_timer->adjust(machine->primary_screen->time_until_pos(64), 64); | |
| 95 | magmax_state *state = machine->driver_data<magmax_state>(); | |
| 96 | state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(64), 64); | |
| 98 | 97 | |
| 99 | 98 | #if 0 |
| 100 | 99 | { |
| r10613 | r10614 | |
| 109 | 108 | |
| 110 | 109 | static WRITE8_DEVICE_HANDLER( ay8910_portA_0_w ) |
| 111 | 110 | { |
| 111 | magmax_state *state = device->machine->driver_data<magmax_state>(); | |
| 112 | 112 | ay8910_device *ay1 = device->machine->device<ay8910_device>("ay1"); |
| 113 | 113 | ay8910_device *ay2 = device->machine->device<ay8910_device>("ay2"); |
| 114 | 114 | ay8910_device *ay3 = device->machine->device<ay8910_device>("ay3"); |
| r10613 | r10614 | |
| 158 | 158 | bit3 - SOUND Chan#8 name=AY-3-8910 #2 Ch C |
| 159 | 159 | */ |
| 160 | 160 | |
| 161 | if (gain_control == (data & 0x0f)) | |
| 161 | if (state->gain_control == (data & 0x0f)) | |
| 162 | 162 | return; |
| 163 | 163 | |
| 164 | gain_control = data & 0x0f; | |
| 164 | state->gain_control = data & 0x0f; | |
| 165 | 165 | |
| 166 | 166 | /*popmessage("gain_ctrl = %2x",data&0x0f);*/ |
| 167 | 167 | |
| 168 | percent = (gain_control & 1) ? 1.0 : 0.50; | |
| 168 | percent = (state->gain_control & 1) ? 1.0 : 0.50; | |
| 169 | 169 | ay1->set_output_gain(0, percent); |
| 170 | 170 | //fixme: set_RC_filter(0,10000,100000000,0,10000); /* 10K, 10000pF = 0.010uF */ |
| 171 | 171 | |
| 172 | percent = (gain_control & 2) ? 0.45 : 0.23; | |
| 172 | percent = (state->gain_control & 2) ? 0.45 : 0.23; | |
| 173 | 173 | ay1->set_output_gain(1, percent); |
| 174 | 174 | ay1->set_output_gain(2, percent); |
| 175 | 175 | ay2->set_output_gain(0, percent); |
| r10613 | r10614 | |
| 179 | 179 | //fixme: set_RC_filter(3,4700,100000000,0,4700); /* 4.7K, 4700pF = 0.0047uF */ |
| 180 | 180 | //fixme: set_RC_filter(4,4700,100000000,0,4700); /* 4.7K, 4700pF = 0.0047uF */ |
| 181 | 181 | |
| 182 | percent = (gain_control & 4) ? 0.45 : 0.23; | |
| 182 | percent = (state->gain_control & 4) ? 0.45 : 0.23; | |
| 183 | 183 | ay2->set_output_gain(2, percent); |
| 184 | 184 | ay3->set_output_gain(0, percent); |
| 185 | 185 | |
| 186 | percent = (gain_control & 8) ? 0.45 : 0.23; | |
| 186 | percent = (state->gain_control & 8) ? 0.45 : 0.23; | |
| 187 | 187 | ay3->set_output_gain(1, percent); |
| 188 | 188 | ay3->set_output_gain(2, percent); |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | static WRITE16_HANDLER( magmax_vreg_w ) |
| 192 | 192 | { |
| 193 | magmax_state *state = space->machine->driver_data<magmax_state>(); | |
| 193 | 194 | /* VRAM CONTROL REGISTER */ |
| 194 | 195 | /* bit0 - coin counter 1 */ |
| 195 | 196 | /* bit1 - coin counter 2 */ |
| r10613 | r10614 | |
| 198 | 199 | /* bit4 - sprite bank LSB (DP0) */ |
| 199 | 200 | /* bit5 - sprite bank MSB (DP1) */ |
| 200 | 201 | /* bit6 - BG display enable (BE)*/ |
| 201 | COMBINE_DATA( | |
| 202 | COMBINE_DATA(state-> | |
| 202 | 203 | } |
| 203 | 204 | |
| 204 | 205 | |
| r10613 | r10614 | |
| 212 | 213 | AM_RANGE(0x030002, 0x030003) AM_READ_PORT("P2") |
| 213 | 214 | AM_RANGE(0x030004, 0x030005) AM_READ_PORT("SYSTEM") |
| 214 | 215 | AM_RANGE(0x030006, 0x030007) AM_READ_PORT("DSW") |
| 215 | AM_RANGE(0x030010, 0x030011) AM_WRITE(magmax_vreg_w) AM_BASE(&magmax_vreg) | |
| 216 | AM_RANGE(0x030012, 0x030013) AM_WRITEONLY AM_BASE(&magmax_scroll_x) | |
| 217 | AM_RANGE(0x030014, 0x030015) AM_WRITEONLY AM_BASE(&magmax_scroll_y) | |
| 216 | AM_RANGE(0x030010, 0x030011) AM_WRITE(magmax_vreg_w) AM_BASE_MEMBER(magmax_state, vreg) | |
| 217 | AM_RANGE(0x030012, 0x030013) AM_WRITEONLY AM_BASE_MEMBER(magmax_state, scroll_x) | |
| 218 | AM_RANGE(0x030014, 0x030015) AM_WRITEONLY AM_BASE_MEMBER(magmax_state, scroll_y) | |
| 218 | 219 | AM_RANGE(0x03001c, 0x03001d) AM_WRITE(magmax_sound_w) |
| 219 | 220 | AM_RANGE(0x03001e, 0x03001f) AM_WRITENOP /* IRQ ack */ |
| 220 | 221 | ADDRESS_MAP_END |
| r10613 | r10614 | |
|---|---|---|
| 123 | 123 | |
| 124 | 124 | static PALETTE_INIT( ace ) |
| 125 | 125 | { |
| 126 | palette_set_color(machine, 0, MAKE_RGB(0x | |
| 126 | palette_set_color(machine, 0, MAKE_RGB(0x | |
| 127 | 127 | palette_set_color(machine, 1, MAKE_RGB(0xff,0xff,0xff)); /* white */ |
| 128 | 128 | } |
| 129 | 129 | |
| r10613 | r10614 | |
| 212 | 212 | |
| 213 | 213 | static INPUT_PORTS_START( ace ) |
| 214 | 214 | PORT_START("c008") /* player thrust */ |
| 215 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_NAME("P1 Thrust") | |
| 215 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_2WAY PORT_PLAYER(1) PORT_NAME("P1 Thrust") | |
| 216 | 216 | |
| 217 | 217 | PORT_START("c009") /* player slowdown */ |
| 218 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_ | |
| 218 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_2WAY PORT_PLAYER(1) PORT_NAME("P1 Slowdown") | |
| 219 | 219 | |
| 220 | 220 | PORT_START("c00a") /* player left */ |
| 221 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_ | |
| 221 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1) | |
| 222 | 222 | |
| 223 | 223 | PORT_START("c00b") /* player right */ |
| 224 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_ | |
| 224 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1) | |
| 225 | 225 | |
| 226 | 226 | PORT_START("c00c") /* player fire */ |
| 227 | 227 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Fire") |
| 228 | 228 | |
| 229 | 229 | PORT_START("c00d") /* enemy thrust */ |
| 230 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_NAME("P2 Thrust") | |
| 230 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_2WAY PORT_PLAYER(2) PORT_NAME("P2 Thrust") | |
| 231 | 231 | |
| 232 | 232 | PORT_START("c00e") /* enemy slowdown */ |
| 233 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_ | |
| 233 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_2WAY PORT_PLAYER(2) PORT_NAME("P2 Slowdown") | |
| 234 | 234 | |
| 235 | 235 | PORT_START("c00f") /* enemy left */ |
| 236 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_ | |
| 236 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2) | |
| 237 | 237 | |
| 238 | 238 | PORT_START("c010") /* enemy right */ |
| 239 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_ | |
| 239 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2) | |
| 240 | 240 | |
| 241 | 241 | PORT_START("c011") /* enemy fire */ |
| 242 | 242 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Fire") |
| r10613 | r10614 | |
| 390 | 390 | |
| 391 | 391 | ROM_END |
| 392 | 392 | |
| 393 | GAME( 1976, ace, 0, ace, ace, 0, ROT0, "Allied Leisure", "Ace", GAME_SUPPORTS_SAVE | GAME_NO_SOUND | |
| 393 | GAME( 1976, ace, 0, ace, ace, 0, ROT0, "Allied Leisure", "Ace", GAME_SUPPORTS_SAVE | GAME_NO_SOUND |
| r10613 | r10614 | |
|---|---|---|
| 1303 | 1303 | |
| 1304 | 1304 | MCFG_PALETTE_INIT(profpac) |
| 1305 | 1305 | MCFG_VIDEO_START(profpac) |
| 1306 | ||
| 1306 | ||
| 1307 | 1307 | MCFG_SCREEN_MODIFY("screen") |
| 1308 | 1308 | MCFG_SCREEN_UPDATE(profpac) |
| 1309 | 1309 | MACHINE_CONFIG_END |
| r10613 | r10614 | |
|---|---|---|
| 297 | 297 | #include "cpu/z80/z80.h" |
| 298 | 298 | #include "includes/snes.h" |
| 299 | 299 | |
| 300 | ||
| 301 | class nss_state : public snes_state | |
| 302 | { | |
| 303 | public: | |
| 304 | nss_state(running_machine &machine, const driver_device_config_base &config) | |
| 305 | : snes_state(machine, config) { } | |
| 306 | ||
| 307 | UINT8 m50458_rom_bank; | |
| 308 | UINT8 vblank_bit; | |
| 309 | }; | |
| 310 | ||
| 311 | ||
| 300 | 312 | static ADDRESS_MAP_START( snes_map, ADDRESS_SPACE_PROGRAM, 8) |
| 301 | 313 | AM_RANGE(0x000000, 0x2fffff) AM_READWRITE(snes_r_bank1, snes_w_bank1) /* I/O and ROM (repeats for each bank) */ |
| 302 | 314 | AM_RANGE(0x300000, 0x3fffff) AM_READWRITE(snes_r_bank2, snes_w_bank2) /* I/O and ROM (repeats for each bank) */ |
| r10613 | r10614 | |
| 366 | 378 | // printf("EEPROM write %02x\n",data); |
| 367 | 379 | } |
| 368 | 380 | |
| 369 | static UINT8 m50458_rom_bank; | |
| 370 | 381 | |
| 371 | 382 | static READ8_HANDLER( m50458_r ) |
| 372 | 383 | { |
| 373 | if(m50458_rom_bank) | |
| 384 | nss_state *state = space->machine->driver_data<nss_state>(); | |
| 385 | if(state->m50458_rom_bank) | |
| 374 | 386 | { |
| 375 | 387 | UINT8 *gfx_rom = space->machine->region("m50458_gfx")->base(); |
| 376 | 388 | |
| r10613 | r10614 | |
| 388 | 400 | |
| 389 | 401 | static WRITE8_HANDLER( m50458_w ) |
| 390 | 402 | { |
| 391 | if(m50458_rom_bank) | |
| 403 | nss_state *state = space->machine->driver_data<nss_state>(); | |
| 404 | if(state->m50458_rom_bank) | |
| 392 | 405 | logerror("Warning: write to M50458 GFX ROM!\n"); |
| 393 | 406 | else |
| 394 | 407 | { |
| r10613 | r10614 | |
| 411 | 424 | |
| 412 | 425 | static READ8_HANDLER( port00_r ) |
| 413 | 426 | { |
| 427 | nss_state *state = space->machine->driver_data<nss_state>(); | |
| 414 | 428 | /* |
| 415 | 429 | -x-- ---- almost certainly tied to the vblank signal |
| 416 | 430 | */ |
| 417 | 431 | |
| 418 | static UINT8 vblank_bit; | |
| 419 | 432 | |
| 420 | vblank_bit^=0x40; | |
| 433 | state->vblank_bit^=0x40; | |
| 421 | 434 | |
| 422 | return vblank_bit | 0xbf; | |
| 435 | return state->vblank_bit | 0xbf; | |
| 423 | 436 | } |
| 424 | 437 | |
| 425 | 438 | |
| r10613 | r10614 | |
| 451 | 464 | |
| 452 | 465 | static WRITE8_HANDLER( port80_w ) |
| 453 | 466 | { |
| 467 | nss_state *state = space->machine->driver_data<nss_state>(); | |
| 454 | 468 | /* |
| 455 | 469 | ---- -x-- written when 0x9000-0x9fff is read, probably a bankswitch |
| 456 | 470 | ---- --x- see port 0x02 note |
| r10613 | r10614 | |
| 458 | 472 | */ |
| 459 | 473 | |
| 460 | 474 | memory_set_bank(space->machine, "bank1", data & 1); |
| 461 | m50458_rom_bank = data & 4; | |
| 475 | state->m50458_rom_bank = data & 4; | |
| 462 | 476 | } |
| 463 | 477 | |
| 464 | 478 | static WRITE8_HANDLER( port82_w ) // EEPROM2? |
| r10613 | r10614 | |
| 485 | 499 | |
| 486 | 500 | static MACHINE_START( nss ) |
| 487 | 501 | { |
| 502 | nss_state *state = machine->driver_data<nss_state>(); | |
| 488 | 503 | UINT8 *ROM = machine->region("bios")->base(); |
| 489 | 504 | |
| 490 | 505 | memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x8000); |
| 491 | 506 | memory_set_bank(machine, "bank1", 0); |
| 492 | 507 | |
| 493 | m50458_rom_bank = 0; | |
| 508 | state->m50458_rom_bank = 0; | |
| 494 | 509 | |
| 495 | 510 | MACHINE_START_CALL(snes); |
| 496 | 511 | } |
| r10613 | r10614 | |
| 639 | 654 | GFXDECODE_ENTRY( "m50458_gfx", 0x00000, nss_char_layout_16x16, 0, 1 ) |
| 640 | 655 | GFXDECODE_END |
| 641 | 656 | |
| 642 | static MACHINE_CONFIG_START( snes, | |
| 657 | static MACHINE_CONFIG_START( snes, | |
| 643 | 658 | |
| 644 | 659 | /* basic machine hardware */ |
| 645 | 660 | MCFG_CPU_ADD("maincpu", _5A22, 3580000*6) /* 2.68Mhz, also 3.58Mhz */ |
| r10613 | r10614 | |
|---|---|---|
| 46 | 46 | ROM_START(elvisp) |
| 47 | 47 | ROM_REGION(0x80000, "user1", 0) |
| 48 | 48 | ROM_LOAD("elvscpua.500", 0x00000, 0x20000, CRC(aae9d65d) SHA1(d6e789f7257448e97697c406561c14a0abc45187)) |
| 49 | /* | |
| 50 | ROM_LOAD( "elvscpua.302", 0x0000, 0x20000, CRC(52fd7068) SHA1(548568aeb30a17541b07489dfecde9d4d63bf82b)) | |
| 51 | ROM_LOAD( "elvscpuf.302", 0x0000, 0x20000, CRC(893a5ac6) SHA1(4be45cf036cdd643f10ecbb4d0b1778d25cf778a)) | |
| 52 | ROM_LOAD( "elvscpug.302", 0x0000, 0x20000, CRC(9d907782) SHA1(3bad8d0429029b0055d09e50af16bca4da724e0f)) | |
| 53 | ROM_LOAD( "elvscpui.302", 0x0000, 0x20000, CRC(a2c15460) SHA1(dcd4d4b61745ab2ccba662f9d72f56774a830ea0)) | |
| 54 | ROM_LOAD( "elvscpul.302", 0x0000, 0x20000, CRC(0c6f1897) SHA1(ac71f833d4227c2d2d665a169eb0d12c73aeab04)) | |
| 55 | ROM_LOAD( "elvscpua.400", 0x0000, 0x20000, CRC(385be9ed) SHA1(c25b54a9b52bece17de9c394c019a4d2649bcf47)) | |
| 56 | ROM_LOAD( "elvsdspa.401", 0x0000, 0x80000, CRC(fb08d5c3) SHA1(03f9886381d32bfd012a2663d2b7331a76c8c1c0)) | |
| 57 | ROM_LOAD( "elvscpuf.400", 0x0000, 0x20000, CRC(9ae4f3c4) SHA1(5ec1590ca54f36565953467226a85491a96d2d3c)) | |
| 58 | ROM_LOAD( "elvsdspf.401", 0x0000, 0x80000, CRC(1ddd1823) SHA1(86c2bacb596265a28a4b6dce3cd47ed5a2cf74d7)) | |
| 59 | ROM_LOAD( "elvscpug.400", 0x0000, 0x20000, CRC(c5992b96) SHA1(0e8c285b76374daad17017994cd9d8e68a98ba42)) | |
| 60 | ROM_LOAD( "elvsdspg.401", 0x0000, 0x80000, CRC(a694f642) SHA1(a44febcc08445f53aa96b0c791a636d541cebb97)) | |
| 61 | ROM_LOAD( "elvscpui.400", 0x0000, 0x20000, CRC(dd2876fc) SHA1(3b860ad176e3fda58be1f165fc2f9965f36259ef)) | |
| 62 | ROM_LOAD( "elvsdspi.401", 0x0000, 0x80000, CRC(51f92cec) SHA1(a678dcb29f867b07641f39f5e0a9bf0e5daf9dc3)) | |
| 63 | ROM_LOAD( "elvscpul.400", 0x0000, 0x20000, CRC(536d4e3c) SHA1(3470ffdc32dbce9142dab82c25915d617e1429e6)) | |
| 64 | ROM_LOAD( "elvsdspl.401", 0x0000, 0x80000, CRC(57fc6ed2) SHA1(3349a56ce38ab4ffdf1469bac8dbc9d08c077f6e)) | |
| 65 | ROM_LOAD( "elvscpua.303", 0x0000, 0x20000, CRC(a0dd77d8) SHA1(2882eed805c2eb3cabadcfe51997a534ddac9050)) | |
| 66 | ROM_LOAD( "elvsdspa.302", 0x0000, 0x80000, CRC(892da6d2) SHA1(66a2f9faab9c7b925a90455ce7e1d31e19fce99e)) | |
| 67 | ROM_LOAD( "elvscpuf.303", 0x0000, 0x20000, CRC(bc5cc2b9) SHA1(f434164384153a3cca358af55ed82c7757e74fd9)) | |
| 68 | ROM_LOAD( "elvsdspf.302", 0x0000, 0x80000, CRC(410b6ae5) SHA1(ea29e1c81695df25ad61deedd84e6c3159976797)) | |
| 69 | ROM_LOAD( "elvscpug.303", 0x0000, 0x20000, CRC(66b50538) SHA1(2612c0618c1d438632ff56b3b779214cf6534ff8)) | |
| 70 | ROM_LOAD( "elvsdspg.302", 0x0000, 0x80000, CRC(6340bb11) SHA1(d510f1a913cd3fb9593ef88c5652e03a5d3c3ebb)) | |
| 71 | ROM_LOAD( "elvscpui.303", 0x0000, 0x20000, CRC(11f47b7a) SHA1(4fbe64ed49719408b77ebf6871bb2211e03de394)) | |
| 72 | ROM_LOAD( "elvsdspi.302", 0x0000, 0x80000, CRC(217c7d17) SHA1(bfd67e876ea85847212c936f9f8477aba8a7b573)) | |
| 73 | ROM_LOAD( "elvscpul.303", 0x0000, 0x20000, CRC(691b9882) SHA1(fd8ceef9dbae6c788964d417ad1c61a4bb8e0d9b)) | |
| 74 | ROM_LOAD( "elvsdspl.302", 0x0000, 0x80000, CRC(f75ea4cb) SHA1(aa351bb0912fd9dc93e9c95f96af2d31aaf03777)) | |
| 75 | */ | |
| 76 | 49 | ROM_RELOAD(0x20000, 0x20000) |
| 77 | 50 | ROM_RELOAD(0x40000, 0x20000) |
| 78 | 51 | ROM_RELOAD(0x60000, 0x20000) |
| r10613 | r10614 | |
| 92 | 65 | ROM_LOAD("elvis.u36", 0x200000, 0x100000, CRC(e98f0dc9) SHA1(6dbab09435e993fef97d6a80a73675723bea7c1d)) |
| 93 | 66 | ROM_LOAD("elvis.u37", 0x300000, 0x100000, CRC(88ba0966) SHA1(43ea198c9fcdc1c396d4180308042c6c08311829)) |
| 94 | 67 | ROM_END |
| 68 | ROM_START(elvisp4) | |
| 69 | ROM_REGION(0x80000, "user1", 0) | |
| 70 | ROM_LOAD( "elvscpua.400", 0x0000, 0x20000, CRC(385be9ed) SHA1(c25b54a9b52bece17de9c394c019a4d2649bcf47)) | |
| 71 | ROM_RELOAD(0x20000, 0x20000) | |
| 72 | ROM_RELOAD(0x40000, 0x20000) | |
| 73 | ROM_RELOAD(0x60000, 0x20000) | |
| 74 | ROM_REGION(0x10000, "maincpu", 0) | |
| 75 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 76 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 77 | ROM_REGION(0x80000, "gfx3", 0) | |
| 78 | ROM_LOAD( "elvsdspa.401", 0x0000, 0x80000, CRC(fb08d5c3) SHA1(03f9886381d32bfd012a2663d2b7331a76c8c1c0)) | |
| 79 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 80 | ROM_LOAD("bios1a.u8", 0x400000, 0x20000, CRC(e2e3fc18) SHA1(5ce564828c1d814b680788f20ba8b134249ccfb9)) | |
| 81 | ROM_RELOAD(0x0,0x20000) | |
| 82 | ROM_REGION(0x10000, "sound1", 0) | |
| 83 | ROM_LOAD("elvis.u7",0x0000,0x10000,CRC(1df6c1b5) SHA1(7a9ebfc555e54ce92ad140ac6fcb82d9848ad8a6)) | |
| 84 | ROM_REGION(0x400000, "sound2", 0) | |
| 85 | ROM_LOAD("elvis.u17", 0x000000, 0x100000, CRC(ff032897) SHA1(bf347c26a450bc07cdc94fc582dedf3a0cdc2a1b)) | |
| 86 | ROM_LOAD("elvis.u21", 0x100000, 0x100000, CRC(c3c19a40) SHA1(97f7f36eed62ca389c770bf5d746721724e17250)) | |
| 87 | ROM_LOAD("elvis.u36", 0x200000, 0x100000, CRC(e98f0dc9) SHA1(6dbab09435e993fef97d6a80a73675723bea7c1d)) | |
| 88 | ROM_LOAD("elvis.u37", 0x300000, 0x100000, CRC(88ba0966) SHA1(43ea198c9fcdc1c396d4180308042c6c08311829)) | |
| 89 | ROM_END | |
| 90 | ROM_START(elvisp303) | |
| 91 | ROM_REGION(0x80000, "user1", 0) | |
| 92 | ROM_LOAD( "elvscpua.303", 0x0000, 0x20000, CRC(a0dd77d8) SHA1(2882eed805c2eb3cabadcfe51997a534ddac9050)) | |
| 93 | ROM_RELOAD(0x20000, 0x20000) | |
| 94 | ROM_RELOAD(0x40000, 0x20000) | |
| 95 | ROM_RELOAD(0x60000, 0x20000) | |
| 96 | ROM_REGION(0x10000, "maincpu", 0) | |
| 97 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 98 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 99 | ROM_REGION(0x80000, "gfx3", 0) | |
| 100 | ROM_LOAD( "elvsdspa.302", 0x0000, 0x80000, CRC(892da6d2) SHA1(66a2f9faab9c7b925a90455ce7e1d31e19fce99e)) | |
| 101 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 102 | ROM_LOAD("bios1a.u8", 0x400000, 0x20000, CRC(e2e3fc18) SHA1(5ce564828c1d814b680788f20ba8b134249ccfb9)) | |
| 103 | ROM_RELOAD(0x0,0x20000) | |
| 104 | ROM_REGION(0x10000, "sound1", 0) | |
| 105 | ROM_LOAD("elvis.u7",0x0000,0x10000,CRC(1df6c1b5) SHA1(7a9ebfc555e54ce92ad140ac6fcb82d9848ad8a6)) | |
| 106 | ROM_REGION(0x400000, "sound2", 0) | |
| 107 | ROM_LOAD("elvis.u17", 0x000000, 0x100000, CRC(ff032897) SHA1(bf347c26a450bc07cdc94fc582dedf3a0cdc2a1b)) | |
| 108 | ROM_LOAD("elvis.u21", 0x100000, 0x100000, CRC(c3c19a40) SHA1(97f7f36eed62ca389c770bf5d746721724e17250)) | |
| 109 | ROM_LOAD("elvis.u36", 0x200000, 0x100000, CRC(e98f0dc9) SHA1(6dbab09435e993fef97d6a80a73675723bea7c1d)) | |
| 110 | ROM_LOAD("elvis.u37", 0x300000, 0x100000, CRC(88ba0966) SHA1(43ea198c9fcdc1c396d4180308042c6c08311829)) | |
| 111 | ROM_END | |
| 112 | ROM_START(elvisp302) | |
| 113 | ROM_REGION(0x80000, "user1", 0) | |
| 114 | ROM_LOAD( "elvscpua.302", 0x0000, 0x20000, CRC(52fd7068) SHA1(548568aeb30a17541b07489dfecde9d4d63bf82b)) | |
| 115 | ROM_RELOAD(0x20000, 0x20000) | |
| 116 | ROM_RELOAD(0x40000, 0x20000) | |
| 117 | ROM_RELOAD(0x60000, 0x20000) | |
| 118 | ROM_REGION(0x10000, "maincpu", 0) | |
| 119 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 120 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 121 | ROM_REGION(0x80000, "gfx3", 0) | |
| 122 | ROM_LOAD( "elvsdspa.302", 0x0000, 0x80000, CRC(892da6d2) SHA1(66a2f9faab9c7b925a90455ce7e1d31e19fce99e)) | |
| 123 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 124 | ROM_LOAD("bios1a.u8", 0x400000, 0x20000, CRC(e2e3fc18) SHA1(5ce564828c1d814b680788f20ba8b134249ccfb9)) | |
| 125 | ROM_RELOAD(0x0,0x20000) | |
| 126 | ROM_REGION(0x10000, "sound1", 0) | |
| 127 | ROM_LOAD("elvis.u7",0x0000,0x10000,CRC(1df6c1b5) SHA1(7a9ebfc555e54ce92ad140ac6fcb82d9848ad8a6)) | |
| 128 | ROM_REGION(0x400000, "sound2", 0) | |
| 129 | ROM_LOAD("elvis.u17", 0x000000, 0x100000, CRC(ff032897) SHA1(bf347c26a450bc07cdc94fc582dedf3a0cdc2a1b)) | |
| 130 | ROM_LOAD("elvis.u21", 0x100000, 0x100000, CRC(c3c19a40) SHA1(97f7f36eed62ca389c770bf5d746721724e17250)) | |
| 131 | ROM_LOAD("elvis.u36", 0x200000, 0x100000, CRC(e98f0dc9) SHA1(6dbab09435e993fef97d6a80a73675723bea7c1d)) | |
| 132 | ROM_LOAD("elvis.u37", 0x300000, 0x100000, CRC(88ba0966) SHA1(43ea198c9fcdc1c396d4180308042c6c08311829)) | |
| 133 | ROM_END | |
| 95 | 134 | |
| 96 | 135 | ROM_START(elvisl) |
| 97 | 136 | ROM_REGION(0x80000, "user1", 0) |
| r10613 | r10614 | |
| 115 | 154 | ROM_LOAD("elvisl.u36", 0x200000, 0x100000, CRC(01ebbdbe) SHA1(286fa471b20b6ffcb0114d66239ab6aebe9bca9d)) |
| 116 | 155 | ROM_LOAD("elvisl.u37", 0x300000, 0x100000, CRC(bed26746) SHA1(385cb77ec7599b12a4b021c53b42b8e9b9fb08a8)) |
| 117 | 156 | ROM_END |
| 157 | ROM_START(elvisl4) | |
| 158 | ROM_REGION(0x80000, "user1", 0) | |
| 159 | ROM_LOAD( "elvscpul.400", 0x0000, 0x20000, CRC(536d4e3c) SHA1(3470ffdc32dbce9142dab82c25915d617e1429e6)) | |
| 160 | ROM_RELOAD(0x20000, 0x20000) | |
| 161 | ROM_RELOAD(0x40000, 0x20000) | |
| 162 | ROM_RELOAD(0x60000, 0x20000) | |
| 163 | ROM_REGION(0x10000, "maincpu", 0) | |
| 164 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 165 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 166 | ROM_REGION(0x80000, "gfx3", 0) | |
| 167 | ROM_LOAD( "elvsdspl.401", 0x0000, 0x80000, CRC(57fc6ed2) SHA1(3349a56ce38ab4ffdf1469bac8dbc9d08c077f6e)) | |
| 168 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 169 | ROM_LOAD("bios1a.u8", 0x400000, 0x20000, CRC(e2e3fc18) SHA1(5ce564828c1d814b680788f20ba8b134249ccfb9)) | |
| 170 | ROM_RELOAD(0x0,0x20000) | |
| 171 | ROM_REGION(0x10000, "sound1", 0) | |
| 172 | ROM_LOAD("elvisl.u7",0x0000,0x10000,CRC(f0d70ee6) SHA1(9fa2c9d7b3690ec0c17645be066496d6833da5d1)) | |
| 173 | ROM_REGION(0x400000, "sound2", 0) | |
| 174 | ROM_LOAD("elvisl.u17", 0x000000, 0x100000, CRC(2f86bcda) SHA1(73972fd30e84a2f97478f076cc8771c501440be5)) | |
| 175 | ROM_LOAD("elvisl.u21", 0x100000, 0x100000, CRC(400c7174) SHA1(a4fa0d51b7c11e70f6b93068a6bf859cdf3359c3)) | |
| 176 | ROM_LOAD("elvisl.u36", 0x200000, 0x100000, CRC(01ebbdbe) SHA1(286fa471b20b6ffcb0114d66239ab6aebe9bca9d)) | |
| 177 | ROM_LOAD("elvisl.u37", 0x300000, 0x100000, CRC(bed26746) SHA1(385cb77ec7599b12a4b021c53b42b8e9b9fb08a8)) | |
| 178 | ROM_END | |
| 179 | ROM_START(elvisl303) | |
| 180 | ROM_REGION(0x80000, "user1", 0) | |
| 181 | ROM_LOAD( "elvscpul.303", 0x0000, 0x20000, CRC(691b9882) SHA1(fd8ceef9dbae6c788964d417ad1c61a4bb8e0d9b)) | |
| 182 | ROM_RELOAD(0x20000, 0x20000) | |
| 183 | ROM_RELOAD(0x40000, 0x20000) | |
| 184 | ROM_RELOAD(0x60000, 0x20000) | |
| 185 | ROM_REGION(0x10000, "maincpu", 0) | |
| 186 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 187 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 188 | ROM_REGION(0x80000, "gfx3", 0) | |
| 189 | ROM_LOAD( "elvsdspl.302", 0x0000, 0x80000, CRC(f75ea4cb) SHA1(aa351bb0912fd9dc93e9c95f96af2d31aaf03777)) | |
| 190 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 191 | ROM_LOAD("bios1a.u8", 0x400000, 0x20000, CRC(e2e3fc18) SHA1(5ce564828c1d814b680788f20ba8b134249ccfb9)) | |
| 192 | ROM_RELOAD(0x0,0x20000) | |
| 193 | ROM_REGION(0x10000, "sound1", 0) | |
| 194 | ROM_LOAD("elvisl.u7",0x0000,0x10000,CRC(f0d70ee6) SHA1(9fa2c9d7b3690ec0c17645be066496d6833da5d1)) | |
| 195 | ROM_REGION(0x400000, "sound2", 0) | |
| 196 | ROM_LOAD("elvisl.u17", 0x000000, 0x100000, CRC(2f86bcda) SHA1(73972fd30e84a2f97478f076cc8771c501440be5)) | |
| 197 | ROM_LOAD("elvisl.u21", 0x100000, 0x100000, CRC(400c7174) SHA1(a4fa0d51b7c11e70f6b93068a6bf859cdf3359c3)) | |
| 198 | ROM_LOAD("elvisl.u36", 0x200000, 0x100000, CRC(01ebbdbe) SHA1(286fa471b20b6ffcb0114d66239ab6aebe9bca9d)) | |
| 199 | ROM_LOAD("elvisl.u37", 0x300000, 0x100000, CRC(bed26746) SHA1(385cb77ec7599b12a4b021c53b42b8e9b9fb08a8)) | |
| 200 | ROM_END | |
| 201 | ROM_START(elvisl302) | |
| 202 | ROM_REGION(0x80000, "user1", 0) | |
| 203 | ROM_LOAD( "elvscpul.302", 0x0000, 0x20000, CRC(0c6f1897) SHA1(ac71f833d4227c2d2d665a169eb0d12c73aeab04)) | |
| 204 | ROM_RELOAD(0x20000, 0x20000) | |
| 205 | ROM_RELOAD(0x40000, 0x20000) | |
| 206 | ROM_RELOAD(0x60000, 0x20000) | |
| 207 | ROM_REGION(0x10000, "maincpu", 0) | |
| 208 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 209 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 210 | ROM_REGION(0x80000, "gfx3", 0) | |
| 211 | ROM_LOAD( "elvsdspl.302", 0x0000, 0x80000, CRC(f75ea4cb) SHA1(aa351bb0912fd9dc93e9c95f96af2d31aaf03777)) | |
| 212 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 213 | ROM_LOAD("bios1a.u8", 0x400000, 0x20000, CRC(e2e3fc18) SHA1(5ce564828c1d814b680788f20ba8b134249ccfb9)) | |
| 214 | ROM_RELOAD(0x0,0x20000) | |
| 215 | ROM_REGION(0x10000, "sound1", 0) | |
| 216 | ROM_LOAD("elvisl.u7",0x0000,0x10000,CRC(f0d70ee6) SHA1(9fa2c9d7b3690ec0c17645be066496d6833da5d1)) | |
| 217 | ROM_REGION(0x400000, "sound2", 0) | |
| 218 | ROM_LOAD("elvisl.u17", 0x000000, 0x100000, CRC(2f86bcda) SHA1(73972fd30e84a2f97478f076cc8771c501440be5)) | |
| 219 | ROM_LOAD("elvisl.u21", 0x100000, 0x100000, CRC(400c7174) SHA1(a4fa0d51b7c11e70f6b93068a6bf859cdf3359c3)) | |
| 220 | ROM_LOAD("elvisl.u36", 0x200000, 0x100000, CRC(01ebbdbe) SHA1(286fa471b20b6ffcb0114d66239ab6aebe9bca9d)) | |
| 221 | ROM_LOAD("elvisl.u37", 0x300000, 0x100000, CRC(bed26746) SHA1(385cb77ec7599b12a4b021c53b42b8e9b9fb08a8)) | |
| 222 | ROM_END | |
| 118 | 223 | |
| 119 | 224 | ROM_START(elvisg) |
| 120 | 225 | ROM_REGION(0x80000, "user1", 0) |
| r10613 | r10614 | |
| 138 | 243 | ROM_LOAD("elvisg.u36", 0x200000, 0x100000, CRC(25ba1ad4) SHA1(1e1a846af4ff43bb47f081b0cc179cd732c0bbea)) |
| 139 | 244 | ROM_LOAD("elvisg.u37", 0x300000, 0x100000, CRC(f6d7a2a0) SHA1(54c160a298c7ead1fe0404bce51bc16211da82cf)) |
| 140 | 245 | ROM_END |
| 246 | ROM_START(elvisg4) | |
| 247 | ROM_REGION(0x80000, "user1", 0) | |
| 248 | ROM_LOAD( "elvscpug.400", 0x0000, 0x20000, CRC(c5992b96) SHA1(0e8c285b76374daad17017994cd9d8e68a98ba42)) | |
| 249 | ROM_RELOAD(0x20000, 0x20000) | |
| 250 | ROM_RELOAD(0x40000, 0x20000) | |
| 251 | ROM_RELOAD(0x60000, 0x20000) | |
| 252 | ROM_REGION(0x10000, "maincpu", 0) | |
| 253 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 254 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 255 | ROM_REGION(0x80000, "gfx3", 0) | |
| 256 | ROM_LOAD( "elvsdspg.401", 0x0000, 0x80000, CRC(a694f642) SHA1(a44febcc08445f53aa96b0c791a636d541cebb97)) | |
| 257 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 258 | ROM_LOAD("bios1a.u8", 0x400000, 0x20000, CRC(e2e3fc18) SHA1(5ce564828c1d814b680788f20ba8b134249ccfb9)) | |
| 259 | ROM_RELOAD(0x0,0x20000) | |
| 260 | ROM_REGION(0x10000, "sound1", 0) | |
| 261 | ROM_LOAD("elvisg.u7",0x0000,0x10000,CRC(1085bd7c) SHA1(2c34ee7d7c44906b0894c0c01b0fad74cb0d2a32)) | |
| 262 | ROM_REGION(0x400000, "sound2", 0) | |
| 263 | ROM_LOAD("elvisg.u17", 0x000000, 0x100000, CRC(8b888d75) SHA1(b8c654d0fb558c205c338be2b458cbf931b23bac)) | |
| 264 | ROM_LOAD("elvisg.u21", 0x100000, 0x100000, CRC(79955b60) SHA1(36ad9e487408c9fd26641d484490b1b3bc8e1194)) | |
| 265 | ROM_LOAD("elvisg.u36", 0x200000, 0x100000, CRC(25ba1ad4) SHA1(1e1a846af4ff43bb47f081b0cc179cd732c0bbea)) | |
| 266 | ROM_LOAD("elvisg.u37", 0x300000, 0x100000, CRC(f6d7a2a0) SHA1(54c160a298c7ead1fe0404bce51bc16211da82cf)) | |
| 267 | ROM_END | |
| 268 | ROM_START(elvisg303) | |
| 269 | ROM_REGION(0x80000, "user1", 0) | |
| 270 | ROM_LOAD( "elvscpug.303", 0x0000, 0x20000, CRC(66b50538) SHA1(2612c0618c1d438632ff56b3b779214cf6534ff8)) | |
| 271 | ROM_RELOAD(0x20000, 0x20000) | |
| 272 | ROM_RELOAD(0x40000, 0x20000) | |
| 273 | ROM_RELOAD(0x60000, 0x20000) | |
| 274 | ROM_REGION(0x10000, "maincpu", 0) | |
| 275 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 276 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 277 | ROM_REGION(0x80000, "gfx3", 0) | |
| 278 | ROM_LOAD( "elvsdspg.302", 0x0000, 0x80000, CRC(6340bb11) SHA1(d510f1a913cd3fb9593ef88c5652e03a5d3c3ebb)) | |
| 279 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 280 | ROM_LOAD("bios1a.u8", 0x400000, 0x20000, CRC(e2e3fc18) SHA1(5ce564828c1d814b680788f20ba8b134249ccfb9)) | |
| 281 | ROM_RELOAD(0x0,0x20000) | |
| 282 | ROM_REGION(0x10000, "sound1", 0) | |
| 283 | ROM_LOAD("elvisg.u7",0x0000,0x10000,CRC(1085bd7c) SHA1(2c34ee7d7c44906b0894c0c01b0fad74cb0d2a32)) | |
| 284 | ROM_REGION(0x400000, "sound2", 0) | |
| 285 | ROM_LOAD("elvisg.u17", 0x000000, 0x100000, CRC(8b888d75) SHA1(b8c654d0fb558c205c338be2b458cbf931b23bac)) | |
| 286 | ROM_LOAD("elvisg.u21", 0x100000, 0x100000, CRC(79955b60) SHA1(36ad9e487408c9fd26641d484490b1b3bc8e1194)) | |
| 287 | ROM_LOAD("elvisg.u36", 0x200000, 0x100000, CRC(25ba1ad4) SHA1(1e1a846af4ff43bb47f081b0cc179cd732c0bbea)) | |
| 288 | ROM_LOAD("elvisg.u37", 0x300000, 0x100000, CRC(f6d7a2a0) SHA1(54c160a298c7ead1fe0404bce51bc16211da82cf)) | |
| 289 | ROM_END | |
| 290 | ROM_START(elvisg302) | |
| 291 | ROM_REGION(0x80000, "user1", 0) | |
| 292 | ROM_LOAD( "elvscpug.302", 0x0000, 0x20000, CRC(9d907782) SHA1(3bad8d0429029b0055d09e50af16bca4da724e0f)) | |
| 293 | ROM_RELOAD(0x20000, 0x20000) | |
| 294 | ROM_RELOAD(0x40000, 0x20000) | |
| 295 | ROM_RELOAD(0x60000, 0x20000) | |
| 296 | ROM_REGION(0x10000, "maincpu", 0) | |
| 297 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 298 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 299 | ROM_REGION(0x80000, "gfx3", 0) | |
| 300 | ROM_LOAD( "elvsdspg.302", 0x0000, 0x80000, CRC(6340bb11) SHA1(d510f1a913cd3fb9593ef88c5652e03a5d3c3ebb)) | |
| 301 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 302 | ROM_LOAD("bios1a.u8", 0x400000, 0x20000, CRC(e2e3fc18) SHA1(5ce564828c1d814b680788f20ba8b134249ccfb9)) | |
| 303 | ROM_RELOAD(0x0,0x20000) | |
| 304 | ROM_REGION(0x10000, "sound1", 0) | |
| 305 | ROM_LOAD("elvisg.u7",0x0000,0x10000,CRC(1085bd7c) SHA1(2c34ee7d7c44906b0894c0c01b0fad74cb0d2a32)) | |
| 306 | ROM_REGION(0x400000, "sound2", 0) | |
| 307 | ROM_LOAD("elvisg.u17", 0x000000, 0x100000, CRC(8b888d75) SHA1(b8c654d0fb558c205c338be2b458cbf931b23bac)) | |
| 308 | ROM_LOAD("elvisg.u21", 0x100000, 0x100000, CRC(79955b60) SHA1(36ad9e487408c9fd26641d484490b1b3bc8e1194)) | |
| 309 | ROM_LOAD("elvisg.u36", 0x200000, 0x100000, CRC(25ba1ad4) SHA1(1e1a846af4ff43bb47f081b0cc179cd732c0bbea)) | |
| 310 | ROM_LOAD("elvisg.u37", 0x300000, 0x100000, CRC(f6d7a2a0) SHA1(54c160a298c7ead1fe0404bce51bc16211da82cf)) | |
| 311 | ROM_END | |
| 141 | 312 | |
| 142 | 313 | ROM_START(elvisf) |
| 143 | 314 | ROM_REGION(0x80000, "user1", 0) |
| r10613 | r10614 | |
| 161 | 332 | ROM_LOAD("elvisf.u36", 0x200000, 0x100000, CRC(03ee0c04) SHA1(45a994589e3d9e6fe971db8722848b5f7432b675)) |
| 162 | 333 | ROM_LOAD("elvisf.u37", 0x300000, 0x100000, CRC(aa265440) SHA1(36b13ef0be4203936d9816e521098e72d6b4e4c1)) |
| 163 | 334 | ROM_END |
| 335 | ROM_START(elvisf4) | |
| 336 | ROM_REGION(0x80000, "user1", 0) | |
| 337 | ROM_LOAD( "elvscpuf.400", 0x0000, 0x20000, CRC(9ae4f3c4) SHA1(5ec1590ca54f36565953467226a85491a96d2d3c)) | |
| 338 | ROM_RELOAD(0x20000, 0x20000) | |
| 339 | ROM_RELOAD(0x40000, 0x20000) | |
| 340 | ROM_RELOAD(0x60000, 0x20000) | |
| 341 | ROM_REGION(0x10000, "maincpu", 0) | |
| 342 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 343 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 344 | ROM_REGION(0x80000, "gfx3", 0) | |
| 345 | ROM_LOAD( "elvsdspf.401", 0x0000, 0x80000, CRC(1ddd1823) SHA1(86c2bacb596265a28a4b6dce3cd47ed5a2cf74d7)) | |
| 346 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 347 | ROM_LOAD("bios1a.u8", 0x400000, 0x20000, CRC(e2e3fc18) SHA1(5ce564828c1d814b680788f20ba8b134249ccfb9)) | |
| 348 | ROM_RELOAD(0x0,0x20000) | |
| 349 | ROM_REGION(0x10000, "sound1", 0) | |
| 350 | ROM_LOAD("elvisf.u7",0x0000,0x10000,CRC(84a057cd) SHA1(70e626f13a164df184dc5b0c79e8d320eeafb13b)) | |
| 351 | ROM_REGION(0x400000, "sound2", 0) | |
| 352 | ROM_LOAD("elvisf.u17", 0x000000, 0x100000, CRC(9b13e40d) SHA1(7e7eac1be5cbc7bde4296d168a1cc0716bcb293a)) | |
| 353 | ROM_LOAD("elvisf.u21", 0x100000, 0x100000, CRC(5b668b6d) SHA1(9b104af5df5cc21c2504760b119f3e6584a1871b)) | |
| 354 | ROM_LOAD("elvisf.u36", 0x200000, 0x100000, CRC(03ee0c04) SHA1(45a994589e3d9e6fe971db8722848b5f7432b675)) | |
| 355 | ROM_LOAD("elvisf.u37", 0x300000, 0x100000, CRC(aa265440) SHA1(36b13ef0be4203936d9816e521098e72d6b4e4c1)) | |
| 356 | ROM_END | |
| 357 | ROM_START(elvisf303) | |
| 358 | ROM_REGION(0x80000, "user1", 0) | |
| 359 | ROM_LOAD( "elvscpuf.303", 0x0000, 0x20000, CRC(bc5cc2b9) SHA1(f434164384153a3cca358af55ed82c7757e74fd9)) | |
| 360 | ROM_RELOAD(0x20000, 0x20000) | |
| 361 | ROM_RELOAD(0x40000, 0x20000) | |
| 362 | ROM_RELOAD(0x60000, 0x20000) | |
| 363 | ROM_REGION(0x10000, "maincpu", 0) | |
| 364 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 365 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 366 | ROM_REGION(0x80000, "gfx3", 0) | |
| 367 | ROM_LOAD( "elvsdspf.302", 0x0000, 0x80000, CRC(410b6ae5) SHA1(ea29e1c81695df25ad61deedd84e6c3159976797)) | |
| 368 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 369 | ROM_LOAD("bios1a.u8", 0x400000, 0x20000, CRC(e2e3fc18) SHA1(5ce564828c1d814b680788f20ba8b134249ccfb9)) | |
| 370 | ROM_RELOAD(0x0,0x20000) | |
| 371 | ROM_REGION(0x10000, "sound1", 0) | |
| 372 | ROM_LOAD("elvisf.u7",0x0000,0x10000,CRC(84a057cd) SHA1(70e626f13a164df184dc5b0c79e8d320eeafb13b)) | |
| 373 | ROM_REGION(0x400000, "sound2", 0) | |
| 374 | ROM_LOAD("elvisf.u17", 0x000000, 0x100000, CRC(9b13e40d) SHA1(7e7eac1be5cbc7bde4296d168a1cc0716bcb293a)) | |
| 375 | ROM_LOAD("elvisf.u21", 0x100000, 0x100000, CRC(5b668b6d) SHA1(9b104af5df5cc21c2504760b119f3e6584a1871b)) | |
| 376 | ROM_LOAD("elvisf.u36", 0x200000, 0x100000, CRC(03ee0c04) SHA1(45a994589e3d9e6fe971db8722848b5f7432b675)) | |
| 377 | ROM_LOAD("elvisf.u37", 0x300000, 0x100000, CRC(aa265440) SHA1(36b13ef0be4203936d9816e521098e72d6b4e4c1)) | |
| 378 | ROM_END | |
| 379 | ROM_START(elvisf302) | |
| 380 | ROM_REGION(0x80000, "user1", 0) | |
| 381 | ROM_LOAD( "elvscpuf.302", 0x0000, 0x20000, CRC(893a5ac6) SHA1(4be45cf036cdd643f10ecbb4d0b1778d25cf778a)) | |
| 382 | ROM_RELOAD(0x20000, 0x20000) | |
| 383 | ROM_RELOAD(0x40000, 0x20000) | |
| 384 | ROM_RELOAD(0x60000, 0x20000) | |
| 385 | ROM_REGION(0x10000, "maincpu", 0) | |
| 386 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 387 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 388 | ROM_REGION(0x80000, "gfx3", 0) | |
| 389 | ROM_LOAD( "elvsdspf.302", 0x0000, 0x80000, CRC(410b6ae5) SHA1(ea29e1c81695df25ad61deedd84e6c3159976797)) | |
| 390 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 391 | ROM_LOAD("bios1a.u8", 0x400000, 0x20000, CRC(e2e3fc18) SHA1(5ce564828c1d814b680788f20ba8b134249ccfb9)) | |
| 392 | ROM_RELOAD(0x0,0x20000) | |
| 393 | ROM_REGION(0x10000, "sound1", 0) | |
| 394 | ROM_LOAD("elvisf.u7",0x0000,0x10000,CRC(84a057cd) SHA1(70e626f13a164df184dc5b0c79e8d320eeafb13b)) | |
| 395 | ROM_REGION(0x400000, "sound2", 0) | |
| 396 | ROM_LOAD("elvisf.u17", 0x000000, 0x100000, CRC(9b13e40d) SHA1(7e7eac1be5cbc7bde4296d168a1cc0716bcb293a)) | |
| 397 | ROM_LOAD("elvisf.u21", 0x100000, 0x100000, CRC(5b668b6d) SHA1(9b104af5df5cc21c2504760b119f3e6584a1871b)) | |
| 398 | ROM_LOAD("elvisf.u36", 0x200000, 0x100000, CRC(03ee0c04) SHA1(45a994589e3d9e6fe971db8722848b5f7432b675)) | |
| 399 | ROM_LOAD("elvisf.u37", 0x300000, 0x100000, CRC(aa265440) SHA1(36b13ef0be4203936d9816e521098e72d6b4e4c1)) | |
| 400 | ROM_END | |
| 164 | 401 | |
| 165 | 402 | ROM_START(elvisi) |
| 166 | 403 | ROM_REGION(0x80000, "user1", 0) |
| r10613 | r10614 | |
| 184 | 421 | ROM_LOAD("elvisi.u36", 0x200000, 0x100000, CRC(df6772d7) SHA1(96e98ff4e93fc0c6fb2d9924da99b97f0c436c44)) |
| 185 | 422 | ROM_LOAD("elvisi.u37", 0x300000, 0x100000, CRC(990fd624) SHA1(d5e104485dc8dd7386d8f3e7d99dc6cf7bf91568)) |
| 186 | 423 | ROM_END |
| 424 | ROM_START(elvisi4) | |
| 425 | ROM_REGION(0x80000, "user1", 0) | |
| 426 | ROM_LOAD( "elvscpui.400", 0x0000, 0x20000, CRC(dd2876fc) SHA1(3b860ad176e3fda58be1f165fc2f9965f36259ef)) | |
| 427 | ROM_RELOAD(0x20000, 0x20000) | |
| 428 | ROM_RELOAD(0x40000, 0x20000) | |
| 429 | ROM_RELOAD(0x60000, 0x20000) | |
| 430 | ROM_REGION(0x10000, "maincpu", 0) | |
| 431 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 432 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 433 | ROM_REGION(0x80000, "gfx3", 0) | |
| 434 | ROM_LOAD( "elvsdspi.401", 0x0000, 0x80000, CRC(51f92cec) SHA1(a678dcb29f867b07641f39f5e0a9bf0e5daf9dc3)) | |
| 435 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 436 | ROM_LOAD("bios1a.u8", 0x400000, 0x20000, CRC(e2e3fc18) SHA1(5ce564828c1d814b680788f20ba8b134249ccfb9)) | |
| 437 | ROM_RELOAD(0x0,0x20000) | |
| 438 | ROM_REGION(0x10000, "sound1", 0) | |
| 439 | ROM_LOAD("elvisi.u7",0x0000,0x10000,CRC(8c270da4) SHA1(6a21332fdd1f2714aa78a1730e0f90159022ad1c)) | |
| 440 | ROM_REGION(0x400000, "sound2", 0) | |
| 441 | ROM_LOAD("elvisi.u17", 0x000000, 0x100000, CRC(bd2e6580) SHA1(dc8c974860498d5766dbb0881cc9d6866c9a98a1)) | |
| 442 | ROM_LOAD("elvisi.u21", 0x100000, 0x100000, CRC(1932a22b) SHA1(864d6bc2c60e763431fd19511dc1a946cf131d63)) | |
| 443 | ROM_LOAD("elvisi.u36", 0x200000, 0x100000, CRC(df6772d7) SHA1(96e98ff4e93fc0c6fb2d9924da99b97f0c436c44)) | |
| 444 | ROM_LOAD("elvisi.u37", 0x300000, 0x100000, CRC(990fd624) SHA1(d5e104485dc8dd7386d8f3e7d99dc6cf7bf91568)) | |
| 445 | ROM_END | |
| 446 | ROM_START(elvisi303) | |
| 447 | ROM_REGION(0x80000, "user1", 0) | |
| 448 | ROM_LOAD( "elvscpui.303", 0x0000, 0x20000, CRC(11f47b7a) SHA1(4fbe64ed49719408b77ebf6871bb2211e03de394)) | |
| 449 | ROM_RELOAD(0x20000, 0x20000) | |
| 450 | ROM_RELOAD(0x40000, 0x20000) | |
| 451 | ROM_RELOAD(0x60000, 0x20000) | |
| 452 | ROM_REGION(0x10000, "maincpu", 0) | |
| 453 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 454 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 455 | ROM_REGION(0x80000, "gfx3", 0) | |
| 456 | ROM_LOAD( "elvsdspi.302", 0x0000, 0x80000, CRC(217c7d17) SHA1(bfd67e876ea85847212c936f9f8477aba8a7b573)) | |
| 457 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 458 | ROM_LOAD("bios1a.u8", 0x400000, 0x20000, CRC(e2e3fc18) SHA1(5ce564828c1d814b680788f20ba8b134249ccfb9)) | |
| 459 | ROM_RELOAD(0x0,0x20000) | |
| 460 | ROM_REGION(0x10000, "sound1", 0) | |
| 461 | ROM_LOAD("elvisi.u7",0x0000,0x10000,CRC(8c270da4) SHA1(6a21332fdd1f2714aa78a1730e0f90159022ad1c)) | |
| 462 | ROM_REGION(0x400000, "sound2", 0) | |
| 463 | ROM_LOAD("elvisi.u17", 0x000000, 0x100000, CRC(bd2e6580) SHA1(dc8c974860498d5766dbb0881cc9d6866c9a98a1)) | |
| 464 | ROM_LOAD("elvisi.u21", 0x100000, 0x100000, CRC(1932a22b) SHA1(864d6bc2c60e763431fd19511dc1a946cf131d63)) | |
| 465 | ROM_LOAD("elvisi.u36", 0x200000, 0x100000, CRC(df6772d7) SHA1(96e98ff4e93fc0c6fb2d9924da99b97f0c436c44)) | |
| 466 | ROM_LOAD("elvisi.u37", 0x300000, 0x100000, CRC(990fd624) SHA1(d5e104485dc8dd7386d8f3e7d99dc6cf7bf91568)) | |
| 467 | ROM_END | |
| 468 | ROM_START(elvisi302) | |
| 469 | ROM_REGION(0x80000, "user1", 0) | |
| 470 | ROM_LOAD( "elvscpui.302", 0x0000, 0x20000, CRC(a2c15460) SHA1(dcd4d4b61745ab2ccba662f9d72f56774a830ea0)) | |
| 471 | ROM_RELOAD(0x20000, 0x20000) | |
| 472 | ROM_RELOAD(0x40000, 0x20000) | |
| 473 | ROM_RELOAD(0x60000, 0x20000) | |
| 474 | ROM_REGION(0x10000, "maincpu", 0) | |
| 475 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 476 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 477 | ROM_REGION(0x80000, "gfx3", 0) | |
| 478 | ROM_LOAD( "elvsdspi.302", 0x0000, 0x80000, CRC(217c7d17) SHA1(bfd67e876ea85847212c936f9f8477aba8a7b573)) | |
| 479 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 480 | ROM_LOAD("bios1a.u8", 0x400000, 0x20000, CRC(e2e3fc18) SHA1(5ce564828c1d814b680788f20ba8b134249ccfb9)) | |
| 481 | ROM_RELOAD(0x0,0x20000) | |
| 482 | ROM_REGION(0x10000, "sound1", 0) | |
| 483 | ROM_LOAD("elvisi.u7",0x0000,0x10000,CRC(8c270da4) SHA1(6a21332fdd1f2714aa78a1730e0f90159022ad1c)) | |
| 484 | ROM_REGION(0x400000, "sound2", 0) | |
| 485 | ROM_LOAD("elvisi.u17", 0x000000, 0x100000, CRC(bd2e6580) SHA1(dc8c974860498d5766dbb0881cc9d6866c9a98a1)) | |
| 486 | ROM_LOAD("elvisi.u21", 0x100000, 0x100000, CRC(1932a22b) SHA1(864d6bc2c60e763431fd19511dc1a946cf131d63)) | |
| 487 | ROM_LOAD("elvisi.u36", 0x200000, 0x100000, CRC(df6772d7) SHA1(96e98ff4e93fc0c6fb2d9924da99b97f0c436c44)) | |
| 488 | ROM_LOAD("elvisi.u37", 0x300000, 0x100000, CRC(990fd624) SHA1(d5e104485dc8dd7386d8f3e7d99dc6cf7bf91568)) | |
| 489 | ROM_END | |
| 187 | 490 | |
| 188 | 491 | /*------------------------------------------------------------------- |
| 189 | 492 | / Grand Prix |
| r10613 | r10614 | |
| 395 | 698 | ROM_START(ripleys) |
| 396 | 699 | ROM_REGION(0x80000, "user1", 0) |
| 397 | 700 | ROM_LOAD("ripcpu.320", 0x00000, 0x20000, CRC(aa997826) SHA1(2f9701370e64dd55a9bafe0c65e7eb4b9c5dbdd2)) |
| 398 | //ROM_LOAD( "ripcpu.300", 0x0000, 0x20000, CRC(8c4bf2a9) SHA1(260dd5a99a36de541b5f852047ae4166afc621cc)) | |
| 399 | //ROM_LOAD( "ripcpu.310", 0x0000, 0x20000, CRC(669f87cc) SHA1(0e07bbcf337bf7c289a9093d3db805da617cbfef)) | |
| 400 | //ROM_LOAD( "ripcpu.302", 0x0000, 0x20000, CRC(ee79d9eb) SHA1(79b45ceac00ebd414a9fb1d97c05252d9f953872)) | |
| 701 | ROM_RELOAD(0x20000, 0x20000) | |
| 702 | ROM_RELOAD(0x40000, 0x20000) | |
| 703 | ROM_RELOAD(0x60000, 0x20000) | |
| 704 | ROM_REGION(0x10000, "maincpu", 0) | |
| 705 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 706 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 707 | ROM_REGION(0x80000, "gfx3", 0) | |
| 708 | ROM_LOAD("ripdispa.300", 0x00000, 0x80000, CRC(016907c9) SHA1(d37f1ca5ebe089fca879339cdaffc3fabf09c15c)) | |
| 709 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 710 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 711 | ROM_RELOAD(0x0,0x200000) | |
| 712 | ROM_REGION(0x10000, "sound1", 0) | |
| 713 | ROM_LOAD("ripsnd.u7",0x0000,0x10000,CRC(4573a759) SHA1(189c1a2eaf9d92c40a1bc145f59ac428c74a7318)) | |
| 714 | ROM_REGION(0x400000, "sound2", 0) | |
| 715 | ROM_LOAD("ripsnd.u17", 0x000000, 0x100000, CRC(d518f2da) SHA1(e7d75c6b7b45571ae6d39ed7405b1457e475b52a)) | |
| 716 | ROM_LOAD("ripsnd.u21", 0x100000, 0x100000, CRC(3d8680d7) SHA1(1368965106094d78be6540eb87a478f853ba774f)) | |
| 717 | ROM_LOAD("ripsnd.u36", 0x200000, 0x100000, CRC(b697b5cb) SHA1(b5cb426201287a6d1c40db8c81a58e2c656d1d81)) | |
| 718 | ROM_LOAD("ripsnd.u37", 0x300000, 0x100000, CRC(01b9f20e) SHA1(cffb6a0136d7d17ab4450b3bfd97632d8b669d39)) | |
| 719 | ROM_END | |
| 401 | 720 | |
| 402 | //ROM_LOAD( "ripdispf.300", 0x0000, 0x80000, CRC(b9901941) SHA1(653997ff5d63e7ee0270db08cad952ac8293a8cd)) | |
| 403 | //ROM_LOAD( "ripsnd.u7", 0x0000, 0x10000, CRC(e5c7edea) SHA1(c0075fb35c746afe54808d4901ddb61ba396f36d)) | |
| 404 | //ROM_LOAD( "ripsndf.u7", 0x0000, 0x10000, CRC(00fc94de) SHA1(207ceea5ccd39a99c5b5ed1f945dce3f1fc076d7)) | |
| 405 | //ROM_LOAD( "ripsndg.u7", 0x0000, 0x10000, CRC(ff7b6b55) SHA1(e2e0e1f6cfae0fbcb5151bf2cb17fbb52f2d9f23)) | |
| 406 | //ROM_LOAD( "ripsndi.u7", 0x0000, 0x10000, CRC(b966a2c1) SHA1(1aa83dc5b87fc16fc4281f577e61eb2661cfad09)) | |
| 407 | //ROM_LOAD( "ripsndl.u7", 0x0000, 0x10000, CRC(66bfcb7c) SHA1(8bdfaf01f367de8ccf15da59000ecff5268e0a4f)) | |
| 408 | //ROM_LOAD( "ripdispl.300", 0x0000, 0x80000, CRC(d2f496bb) SHA1(48622e25171030b83d8d1736735e97a13c5f47c6)) | |
| 721 | ROM_START(rip310) | |
| 722 | ROM_REGION(0x80000, "user1", 0) | |
| 723 | ROM_LOAD( "ripcpu.310", 0x0000, 0x20000, CRC(669f87cc) SHA1(0e07bbcf337bf7c289a9093d3db805da617cbfef)) | |
| 724 | ROM_RELOAD(0x20000, 0x20000) | |
| 725 | ROM_RELOAD(0x40000, 0x20000) | |
| 726 | ROM_RELOAD(0x60000, 0x20000) | |
| 727 | ROM_REGION(0x10000, "maincpu", 0) | |
| 728 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 729 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 730 | ROM_REGION(0x80000, "gfx3", 0) | |
| 731 | ROM_LOAD("ripdispa.300", 0x00000, 0x80000, CRC(016907c9) SHA1(d37f1ca5ebe089fca879339cdaffc3fabf09c15c)) | |
| 732 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 733 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 734 | ROM_RELOAD(0x0,0x200000) | |
| 735 | ROM_REGION(0x10000, "sound1", 0) | |
| 736 | ROM_LOAD("ripsnd.u7",0x0000,0x10000,CRC(4573a759) SHA1(189c1a2eaf9d92c40a1bc145f59ac428c74a7318)) | |
| 737 | ROM_REGION(0x400000, "sound2", 0) | |
| 738 | ROM_LOAD("ripsnd.u17", 0x000000, 0x100000, CRC(d518f2da) SHA1(e7d75c6b7b45571ae6d39ed7405b1457e475b52a)) | |
| 739 | ROM_LOAD("ripsnd.u21", 0x100000, 0x100000, CRC(3d8680d7) SHA1(1368965106094d78be6540eb87a478f853ba774f)) | |
| 740 | ROM_LOAD("ripsnd.u36", 0x200000, 0x100000, CRC(b697b5cb) SHA1(b5cb426201287a6d1c40db8c81a58e2c656d1d81)) | |
| 741 | ROM_LOAD("ripsnd.u37", 0x300000, 0x100000, CRC(01b9f20e) SHA1(cffb6a0136d7d17ab4450b3bfd97632d8b669d39)) | |
| 742 | ROM_END | |
| 409 | 743 | |
| 744 | ROM_START(rip302) | |
| 745 | ROM_REGION(0x80000, "user1", 0) | |
| 746 | ROM_LOAD( "ripcpu.302", 0x0000, 0x20000, CRC(ee79d9eb) SHA1(79b45ceac00ebd414a9fb1d97c05252d9f953872)) | |
| 410 | 747 | ROM_RELOAD(0x20000, 0x20000) |
| 411 | 748 | ROM_RELOAD(0x40000, 0x20000) |
| 412 | 749 | ROM_RELOAD(0x60000, 0x20000) |
| r10613 | r10614 | |
| 427 | 764 | ROM_LOAD("ripsnd.u37", 0x300000, 0x100000, CRC(01b9f20e) SHA1(cffb6a0136d7d17ab4450b3bfd97632d8b669d39)) |
| 428 | 765 | ROM_END |
| 429 | 766 | |
| 767 | ROM_START(rip300) | |
| 768 | ROM_REGION(0x80000, "user1", 0) | |
| 769 | ROM_LOAD( "ripcpu.300", 0x0000, 0x20000, CRC(8c4bf2a9) SHA1(260dd5a99a36de541b5f852047ae4166afc621cc)) | |
| 770 | ROM_RELOAD(0x20000, 0x20000) | |
| 771 | ROM_RELOAD(0x40000, 0x20000) | |
| 772 | ROM_RELOAD(0x60000, 0x20000) | |
| 773 | ROM_REGION(0x10000, "maincpu", 0) | |
| 774 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 775 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 776 | ROM_REGION(0x80000, "gfx3", 0) | |
| 777 | ROM_LOAD("ripdispa.300", 0x00000, 0x80000, CRC(016907c9) SHA1(d37f1ca5ebe089fca879339cdaffc3fabf09c15c)) | |
| 778 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 779 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 780 | ROM_RELOAD(0x0,0x200000) | |
| 781 | ROM_REGION(0x10000, "sound1", 0) | |
| 782 | ROM_LOAD( "ripsnd-30.u7", 0x0000, 0x10000, CRC(e5c7edea) SHA1(c0075fb35c746afe54808d4901ddb61ba396f36d)) | |
| 783 | ROM_REGION(0x400000, "sound2", 0) | |
| 784 | ROM_LOAD("ripsnd.u17", 0x000000, 0x100000, CRC(d518f2da) SHA1(e7d75c6b7b45571ae6d39ed7405b1457e475b52a)) | |
| 785 | ROM_LOAD("ripsnd.u21", 0x100000, 0x100000, CRC(3d8680d7) SHA1(1368965106094d78be6540eb87a478f853ba774f)) | |
| 786 | ROM_LOAD("ripsnd.u36", 0x200000, 0x100000, CRC(b697b5cb) SHA1(b5cb426201287a6d1c40db8c81a58e2c656d1d81)) | |
| 787 | ROM_LOAD("ripsnd.u37", 0x300000, 0x100000, CRC(01b9f20e) SHA1(cffb6a0136d7d17ab4450b3bfd97632d8b669d39)) | |
| 788 | ROM_END | |
| 430 | 789 | ROM_START(ripleysf) |
| 431 | 790 | ROM_REGION(0x80000, "user1", 0) |
| 432 | 791 | ROM_LOAD("ripcpu.320", 0x00000, 0x20000, CRC(aa997826) SHA1(2f9701370e64dd55a9bafe0c65e7eb4b9c5dbdd2)) |
| r10613 | r10614 | |
| 449 | 808 | ROM_LOAD("ripsndf.u36", 0x200000, 0x100000, CRC(0a57f2fd) SHA1(9dd057888294ee8abeb582e8f6650fd6e32cc9ff)) |
| 450 | 809 | ROM_LOAD("ripsndf.u37", 0x300000, 0x100000, CRC(5c858958) SHA1(f4a9833b8aee033ed381e3bdf9f801b935d6186a)) |
| 451 | 810 | ROM_END |
| 811 | ROM_START(ripf310) | |
| 812 | ROM_REGION(0x80000, "user1", 0) | |
| 813 | ROM_LOAD( "ripcpu.310", 0x0000, 0x20000, CRC(669f87cc) SHA1(0e07bbcf337bf7c289a9093d3db805da617cbfef)) | |
| 814 | ROM_RELOAD(0x20000, 0x20000) | |
| 815 | ROM_RELOAD(0x40000, 0x20000) | |
| 816 | ROM_RELOAD(0x60000, 0x20000) | |
| 817 | ROM_REGION(0x10000, "maincpu", 0) | |
| 818 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 819 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 820 | ROM_REGION(0x80000, "gfx3", 0) | |
| 821 | ROM_LOAD("ripdispf.301", 0x00000, 0x80000, CRC(e5ae9d99) SHA1(74929b324b457d08a925c641430e6a7036c7039d)) | |
| 822 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 823 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 824 | ROM_RELOAD(0x0,0x200000) | |
| 825 | ROM_REGION(0x10000, "sound1", 0) | |
| 826 | ROM_LOAD("ripsndf.u7",0x0000,0x10000,CRC(5808e3fc) SHA1(0c83399e8dc846607c469b7dd95878f3c2b9cb82)) | |
| 827 | ROM_REGION(0x400000, "sound2", 0) | |
| 828 | ROM_LOAD("ripsndf.u17", 0x000000, 0x100000, CRC(a6793b85) SHA1(96058777346be6e9ea7b1340d9aaf945ac3c853a)) | |
| 829 | ROM_LOAD("ripsndf.u21", 0x100000, 0x100000, CRC(60c02170) SHA1(900d9de3ccb541019e5f1528e01c57ad96dac262)) | |
| 830 | ROM_LOAD("ripsndf.u36", 0x200000, 0x100000, CRC(0a57f2fd) SHA1(9dd057888294ee8abeb582e8f6650fd6e32cc9ff)) | |
| 831 | ROM_LOAD("ripsndf.u37", 0x300000, 0x100000, CRC(5c858958) SHA1(f4a9833b8aee033ed381e3bdf9f801b935d6186a)) | |
| 832 | ROM_END | |
| 833 | ROM_START(ripf302) | |
| 834 | ROM_REGION(0x80000, "user1", 0) | |
| 835 | ROM_LOAD( "ripcpu.302", 0x0000, 0x20000, CRC(ee79d9eb) SHA1(79b45ceac00ebd414a9fb1d97c05252d9f953872)) | |
| 836 | ROM_RELOAD(0x20000, 0x20000) | |
| 837 | ROM_RELOAD(0x40000, 0x20000) | |
| 838 | ROM_RELOAD(0x60000, 0x20000) | |
| 839 | ROM_REGION(0x10000, "maincpu", 0) | |
| 840 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 841 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 842 | ROM_REGION(0x80000, "gfx3", 0) | |
| 843 | ROM_LOAD("ripdispf.301", 0x00000, 0x80000, CRC(e5ae9d99) SHA1(74929b324b457d08a925c641430e6a7036c7039d)) | |
| 844 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 845 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 846 | ROM_RELOAD(0x0,0x200000) | |
| 847 | ROM_REGION(0x10000, "sound1", 0) | |
| 848 | ROM_LOAD("ripsndf.u7",0x0000,0x10000,CRC(5808e3fc) SHA1(0c83399e8dc846607c469b7dd95878f3c2b9cb82)) | |
| 849 | ROM_REGION(0x400000, "sound2", 0) | |
| 850 | ROM_LOAD("ripsndf.u17", 0x000000, 0x100000, CRC(a6793b85) SHA1(96058777346be6e9ea7b1340d9aaf945ac3c853a)) | |
| 851 | ROM_LOAD("ripsndf.u21", 0x100000, 0x100000, CRC(60c02170) SHA1(900d9de3ccb541019e5f1528e01c57ad96dac262)) | |
| 852 | ROM_LOAD("ripsndf.u36", 0x200000, 0x100000, CRC(0a57f2fd) SHA1(9dd057888294ee8abeb582e8f6650fd6e32cc9ff)) | |
| 853 | ROM_LOAD("ripsndf.u37", 0x300000, 0x100000, CRC(5c858958) SHA1(f4a9833b8aee033ed381e3bdf9f801b935d6186a)) | |
| 854 | ROM_END | |
| 855 | ROM_START(ripf300) | |
| 856 | ROM_REGION(0x80000, "user1", 0) | |
| 857 | ROM_LOAD( "ripcpu.300", 0x0000, 0x20000, CRC(8c4bf2a9) SHA1(260dd5a99a36de541b5f852047ae4166afc621cc)) | |
| 858 | ROM_RELOAD(0x20000, 0x20000) | |
| 859 | ROM_RELOAD(0x40000, 0x20000) | |
| 860 | ROM_RELOAD(0x60000, 0x20000) | |
| 861 | ROM_REGION(0x10000, "maincpu", 0) | |
| 862 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 863 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 864 | ROM_REGION(0x80000, "gfx3", 0) | |
| 865 | ROM_LOAD( "ripdispf.300", 0x0000, 0x80000, CRC(b9901941) SHA1(653997ff5d63e7ee0270db08cad952ac8293a8cd)) | |
| 866 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 867 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 868 | ROM_RELOAD(0x0,0x200000) | |
| 869 | ROM_REGION(0x10000, "sound1", 0) | |
| 870 | ROM_LOAD( "ripsndf-30.u7", 0x0000, 0x10000, CRC(00fc94de) SHA1(207ceea5ccd39a99c5b5ed1f945dce3f1fc076d7)) | |
| 871 | ROM_REGION(0x400000, "sound2", 0) | |
| 872 | ROM_LOAD("ripsndf.u17", 0x000000, 0x100000, CRC(a6793b85) SHA1(96058777346be6e9ea7b1340d9aaf945ac3c853a)) | |
| 873 | ROM_LOAD("ripsndf.u21", 0x100000, 0x100000, CRC(60c02170) SHA1(900d9de3ccb541019e5f1528e01c57ad96dac262)) | |
| 874 | ROM_LOAD("ripsndf.u36", 0x200000, 0x100000, CRC(0a57f2fd) SHA1(9dd057888294ee8abeb582e8f6650fd6e32cc9ff)) | |
| 875 | ROM_LOAD("ripsndf.u37", 0x300000, 0x100000, CRC(5c858958) SHA1(f4a9833b8aee033ed381e3bdf9f801b935d6186a)) | |
| 876 | ROM_END | |
| 452 | 877 | |
| 453 | 878 | ROM_START(ripleysg) |
| 454 | 879 | ROM_REGION(0x80000, "user1", 0) |
| r10613 | r10614 | |
| 473 | 898 | ROM_LOAD("ripsndg.u37", 0x300000, 0x100000, CRC(2167617b) SHA1(62b55a39e2677eec9d56b10e8cc3e5d7c0d3bea5)) |
| 474 | 899 | ROM_END |
| 475 | 900 | |
| 901 | ROM_START(ripg310) | |
| 902 | ROM_REGION(0x80000, "user1", 0) | |
| 903 | ROM_LOAD( "ripcpu.310", 0x0000, 0x20000, CRC(669f87cc) SHA1(0e07bbcf337bf7c289a9093d3db805da617cbfef)) | |
| 904 | ROM_RELOAD(0x20000, 0x20000) | |
| 905 | ROM_RELOAD(0x40000, 0x20000) | |
| 906 | ROM_RELOAD(0x60000, 0x20000) | |
| 907 | ROM_REGION(0x10000, "maincpu", 0) | |
| 908 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 909 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 910 | ROM_REGION(0x80000, "gfx3", 0) | |
| 911 | ROM_LOAD("ripdispg.300", 0x00000, 0x80000, CRC(1a75883b) SHA1(0ef2f4af72e435e5be9d3d8a6b69c66ae18271a1)) | |
| 912 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 913 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 914 | ROM_RELOAD(0x0,0x200000) | |
| 915 | ROM_REGION(0x10000, "sound1", 0) | |
| 916 | ROM_LOAD("ripsndg.u7",0x0000,0x10000,CRC(400b8a45) SHA1(62101995e632264df3c014b746cc4b2ae72676d4)) | |
| 917 | ROM_REGION(0x400000, "sound2", 0) | |
| 918 | ROM_LOAD("ripsndg.u17", 0x000000, 0x100000, CRC(c387dcf0) SHA1(d4ef65d3f33ab82b63bf2782f335858ab4ad210a)) | |
| 919 | ROM_LOAD("ripsndg.u21", 0x100000, 0x100000, CRC(6388ae8d) SHA1(a39c7977194daabf3f5b10d0269dcd4118a939bc)) | |
| 920 | ROM_LOAD("ripsndg.u36", 0x200000, 0x100000, CRC(3143f9d3) SHA1(bd4ce64b245b5fcb9b9694bd8f71a9cd98303cae)) | |
| 921 | ROM_LOAD("ripsndg.u37", 0x300000, 0x100000, CRC(2167617b) SHA1(62b55a39e2677eec9d56b10e8cc3e5d7c0d3bea5)) | |
| 922 | ROM_END | |
| 923 | ||
| 924 | ROM_START(ripg302) | |
| 925 | ROM_REGION(0x80000, "user1", 0) | |
| 926 | ROM_LOAD( "ripcpu.302", 0x0000, 0x20000, CRC(ee79d9eb) SHA1(79b45ceac00ebd414a9fb1d97c05252d9f953872)) | |
| 927 | ROM_RELOAD(0x20000, 0x20000) | |
| 928 | ROM_RELOAD(0x40000, 0x20000) | |
| 929 | ROM_RELOAD(0x60000, 0x20000) | |
| 930 | ROM_REGION(0x10000, "maincpu", 0) | |
| 931 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 932 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 933 | ROM_REGION(0x80000, "gfx3", 0) | |
| 934 | ROM_LOAD("ripdispg.300", 0x00000, 0x80000, CRC(1a75883b) SHA1(0ef2f4af72e435e5be9d3d8a6b69c66ae18271a1)) | |
| 935 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 936 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 937 | ROM_RELOAD(0x0,0x200000) | |
| 938 | ROM_REGION(0x10000, "sound1", 0) | |
| 939 | ROM_LOAD("ripsndg.u7",0x0000,0x10000,CRC(400b8a45) SHA1(62101995e632264df3c014b746cc4b2ae72676d4)) | |
| 940 | ROM_REGION(0x400000, "sound2", 0) | |
| 941 | ROM_LOAD("ripsndg.u17", 0x000000, 0x100000, CRC(c387dcf0) SHA1(d4ef65d3f33ab82b63bf2782f335858ab4ad210a)) | |
| 942 | ROM_LOAD("ripsndg.u21", 0x100000, 0x100000, CRC(6388ae8d) SHA1(a39c7977194daabf3f5b10d0269dcd4118a939bc)) | |
| 943 | ROM_LOAD("ripsndg.u36", 0x200000, 0x100000, CRC(3143f9d3) SHA1(bd4ce64b245b5fcb9b9694bd8f71a9cd98303cae)) | |
| 944 | ROM_LOAD("ripsndg.u37", 0x300000, 0x100000, CRC(2167617b) SHA1(62b55a39e2677eec9d56b10e8cc3e5d7c0d3bea5)) | |
| 945 | ROM_END | |
| 946 | ||
| 947 | ROM_START(ripg300) | |
| 948 | ROM_REGION(0x80000, "user1", 0) | |
| 949 | ROM_LOAD( "ripcpu.300", 0x0000, 0x20000, CRC(8c4bf2a9) SHA1(260dd5a99a36de541b5f852047ae4166afc621cc)) | |
| 950 | ROM_RELOAD(0x20000, 0x20000) | |
| 951 | ROM_RELOAD(0x40000, 0x20000) | |
| 952 | ROM_RELOAD(0x60000, 0x20000) | |
| 953 | ROM_REGION(0x10000, "maincpu", 0) | |
| 954 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 955 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 956 | ROM_REGION(0x80000, "gfx3", 0) | |
| 957 | ROM_LOAD("ripdispg.300", 0x00000, 0x80000, CRC(1a75883b) SHA1(0ef2f4af72e435e5be9d3d8a6b69c66ae18271a1)) | |
| 958 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 959 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 960 | ROM_RELOAD(0x0,0x200000) | |
| 961 | ROM_REGION(0x10000, "sound1", 0) | |
| 962 | ROM_LOAD( "ripsndg-30.u7", 0x0000, 0x10000, CRC(ff7b6b55) SHA1(e2e0e1f6cfae0fbcb5151bf2cb17fbb52f2d9f23)) | |
| 963 | ROM_REGION(0x400000, "sound2", 0) | |
| 964 | ROM_LOAD("ripsndg.u17", 0x000000, 0x100000, CRC(c387dcf0) SHA1(d4ef65d3f33ab82b63bf2782f335858ab4ad210a)) | |
| 965 | ROM_LOAD("ripsndg.u21", 0x100000, 0x100000, CRC(6388ae8d) SHA1(a39c7977194daabf3f5b10d0269dcd4118a939bc)) | |
| 966 | ROM_LOAD("ripsndg.u36", 0x200000, 0x100000, CRC(3143f9d3) SHA1(bd4ce64b245b5fcb9b9694bd8f71a9cd98303cae)) | |
| 967 | ROM_LOAD("ripsndg.u37", 0x300000, 0x100000, CRC(2167617b) SHA1(62b55a39e2677eec9d56b10e8cc3e5d7c0d3bea5)) | |
| 968 | ROM_END | |
| 969 | ||
| 476 | 970 | ROM_START(ripleysi) |
| 477 | 971 | ROM_REGION(0x80000, "user1", 0) |
| 478 | 972 | ROM_LOAD("ripcpu.320", 0x00000, 0x20000, CRC(aa997826) SHA1(2f9701370e64dd55a9bafe0c65e7eb4b9c5dbdd2)) |
| r10613 | r10614 | |
| 495 | 989 | ROM_LOAD("ripsndi.u36", 0x200000, 0x100000, CRC(6a124fa6) SHA1(752c3d227b9a98dd859e4778ddd527edaa3cf512)) |
| 496 | 990 | ROM_LOAD("ripsndi.u37", 0x300000, 0x100000, CRC(7933c102) SHA1(f736ee86d7c67dab82c634d125d73a2453249706)) |
| 497 | 991 | ROM_END |
| 992 | ROM_START(ripi310) | |
| 993 | ROM_REGION(0x80000, "user1", 0) | |
| 994 | ROM_LOAD( "ripcpu.310", 0x0000, 0x20000, CRC(669f87cc) SHA1(0e07bbcf337bf7c289a9093d3db805da617cbfef)) | |
| 995 | ROM_RELOAD(0x20000, 0x20000) | |
| 996 | ROM_RELOAD(0x40000, 0x20000) | |
| 997 | ROM_RELOAD(0x60000, 0x20000) | |
| 998 | ROM_REGION(0x10000, "maincpu", 0) | |
| 999 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1000 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1001 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1002 | ROM_LOAD("ripdispi.300", 0x00000, 0x80000, CRC(c3541c04) SHA1(26256e8dee77bcfa96326d2e3f67b6fd3696c0c7)) | |
| 1003 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1004 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1005 | ROM_RELOAD(0x0,0x200000) | |
| 1006 | ROM_REGION(0x10000, "sound1", 0) | |
| 1007 | ROM_LOAD("ripsndi.u7",0x0000,0x10000,CRC(86b1b2b2) SHA1(9e2cf7368b31531998d546a1be2af274a9cbbd2f)) | |
| 1008 | ROM_REGION(0x400000, "sound2", 0) | |
| 1009 | ROM_LOAD("ripsndi.u17", 0x000000, 0x100000, CRC(a2911df4) SHA1(acb7956a6a30142c8da905b04778a074cb335807)) | |
| 1010 | ROM_LOAD("ripsndi.u21", 0x100000, 0x100000, CRC(1467eaff) SHA1(c6c4ea2abdad4334efbe3a084693e9e4d0dd0fd2)) | |
| 1011 | ROM_LOAD("ripsndi.u36", 0x200000, 0x100000, CRC(6a124fa6) SHA1(752c3d227b9a98dd859e4778ddd527edaa3cf512)) | |
| 1012 | ROM_LOAD("ripsndi.u37", 0x300000, 0x100000, CRC(7933c102) SHA1(f736ee86d7c67dab82c634d125d73a2453249706)) | |
| 1013 | ROM_END | |
| 1014 | ROM_START(ripi302) | |
| 1015 | ROM_REGION(0x80000, "user1", 0) | |
| 1016 | ROM_LOAD( "ripcpu.302", 0x0000, 0x20000, CRC(ee79d9eb) SHA1(79b45ceac00ebd414a9fb1d97c05252d9f953872)) | |
| 1017 | ROM_RELOAD(0x20000, 0x20000) | |
| 1018 | ROM_RELOAD(0x40000, 0x20000) | |
| 1019 | ROM_RELOAD(0x60000, 0x20000) | |
| 1020 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1021 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1022 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1023 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1024 | ROM_LOAD("ripdispi.300", 0x00000, 0x80000, CRC(c3541c04) SHA1(26256e8dee77bcfa96326d2e3f67b6fd3696c0c7)) | |
| 1025 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1026 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1027 | ROM_RELOAD(0x0,0x200000) | |
| 1028 | ROM_REGION(0x10000, "sound1", 0) | |
| 1029 | ROM_LOAD("ripsndi.u7",0x0000,0x10000,CRC(86b1b2b2) SHA1(9e2cf7368b31531998d546a1be2af274a9cbbd2f)) | |
| 1030 | ROM_REGION(0x400000, "sound2", 0) | |
| 1031 | ROM_LOAD("ripsndi.u17", 0x000000, 0x100000, CRC(a2911df4) SHA1(acb7956a6a30142c8da905b04778a074cb335807)) | |
| 1032 | ROM_LOAD("ripsndi.u21", 0x100000, 0x100000, CRC(1467eaff) SHA1(c6c4ea2abdad4334efbe3a084693e9e4d0dd0fd2)) | |
| 1033 | ROM_LOAD("ripsndi.u36", 0x200000, 0x100000, CRC(6a124fa6) SHA1(752c3d227b9a98dd859e4778ddd527edaa3cf512)) | |
| 1034 | ROM_LOAD("ripsndi.u37", 0x300000, 0x100000, CRC(7933c102) SHA1(f736ee86d7c67dab82c634d125d73a2453249706)) | |
| 1035 | ROM_END | |
| 1036 | ROM_START(ripi300) | |
| 1037 | ROM_REGION(0x80000, "user1", 0) | |
| 1038 | ROM_LOAD( "ripcpu.300", 0x0000, 0x20000, CRC(8c4bf2a9) SHA1(260dd5a99a36de541b5f852047ae4166afc621cc)) | |
| 1039 | ROM_RELOAD(0x20000, 0x20000) | |
| 1040 | ROM_RELOAD(0x40000, 0x20000) | |
| 1041 | ROM_RELOAD(0x60000, 0x20000) | |
| 1042 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1043 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1044 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1045 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1046 | ROM_LOAD("ripdispi.300", 0x00000, 0x80000, CRC(c3541c04) SHA1(26256e8dee77bcfa96326d2e3f67b6fd3696c0c7)) | |
| 1047 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1048 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1049 | ROM_RELOAD(0x0,0x200000) | |
| 1050 | ROM_REGION(0x10000, "sound1", 0) | |
| 1051 | ROM_LOAD( "ripsndi-30.u7", 0x0000, 0x10000, CRC(b966a2c1) SHA1(1aa83dc5b87fc16fc4281f577e61eb2661cfad09)) | |
| 1052 | ROM_REGION(0x400000, "sound2", 0) | |
| 1053 | ROM_LOAD("ripsndi.u17", 0x000000, 0x100000, CRC(a2911df4) SHA1(acb7956a6a30142c8da905b04778a074cb335807)) | |
| 1054 | ROM_LOAD("ripsndi.u21", 0x100000, 0x100000, CRC(1467eaff) SHA1(c6c4ea2abdad4334efbe3a084693e9e4d0dd0fd2)) | |
| 1055 | ROM_LOAD("ripsndi.u36", 0x200000, 0x100000, CRC(6a124fa6) SHA1(752c3d227b9a98dd859e4778ddd527edaa3cf512)) | |
| 1056 | ROM_LOAD("ripsndi.u37", 0x300000, 0x100000, CRC(7933c102) SHA1(f736ee86d7c67dab82c634d125d73a2453249706)) | |
| 1057 | ROM_END | |
| 498 | 1058 | |
| 499 | 1059 | ROM_START(ripleysl) |
| 500 | 1060 | ROM_REGION(0x80000, "user1", 0) |
| r10613 | r10614 | |
| 518 | 1078 | ROM_LOAD("ripsndl.u36", 0x200000, 0x100000, CRC(c5461b63) SHA1(fc574d44ad88ce1db590ea371225092c03fc6f80)) |
| 519 | 1079 | ROM_LOAD("ripsndl.u37", 0x300000, 0x100000, CRC(2a58f491) SHA1(1c33f419420b3165ef18598560007ef612b24814)) |
| 520 | 1080 | ROM_END |
| 1081 | ROM_START(ripl310) | |
| 1082 | ROM_REGION(0x80000, "user1", 0) | |
| 1083 | ROM_LOAD( "ripcpu.310", 0x0000, 0x20000, CRC(669f87cc) SHA1(0e07bbcf337bf7c289a9093d3db805da617cbfef)) | |
| 1084 | ROM_RELOAD(0x20000, 0x20000) | |
| 1085 | ROM_RELOAD(0x40000, 0x20000) | |
| 1086 | ROM_RELOAD(0x60000, 0x20000) | |
| 1087 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1088 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1089 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1090 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1091 | ROM_LOAD("ripdispl.301", 0x00000, 0x80000, CRC(47c87ad4) SHA1(eb372b9f17b28d0781c49a28cb850916ccec323d)) | |
| 1092 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1093 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1094 | ROM_RELOAD(0x0,0x200000) | |
| 1095 | ROM_REGION(0x10000, "sound1", 0) | |
| 1096 | ROM_LOAD("ripsndl.u7",0x0000,0x10000,CRC(25fb729a) SHA1(46b9ca8fd5fb5a692adbdb7495af34a1db89dc37)) | |
| 1097 | ROM_REGION(0x400000, "sound2", 0) | |
| 1098 | ROM_LOAD("ripsndl.u17", 0x000000, 0x100000, CRC(a98f4514) SHA1(e87ee8f5a87a8ae9ec996473bf9bc745105ea334)) | |
| 1099 | ROM_LOAD("ripsndl.u21", 0x100000, 0x100000, CRC(141f2b77) SHA1(15bab623beda8ae7ed9908f492ff2baab0a7954e)) | |
| 1100 | ROM_LOAD("ripsndl.u36", 0x200000, 0x100000, CRC(c5461b63) SHA1(fc574d44ad88ce1db590ea371225092c03fc6f80)) | |
| 1101 | ROM_LOAD("ripsndl.u37", 0x300000, 0x100000, CRC(2a58f491) SHA1(1c33f419420b3165ef18598560007ef612b24814)) | |
| 1102 | ROM_END | |
| 1103 | ROM_START(ripl302) | |
| 1104 | ROM_REGION(0x80000, "user1", 0) | |
| 1105 | ROM_LOAD( "ripcpu.302", 0x0000, 0x20000, CRC(ee79d9eb) SHA1(79b45ceac00ebd414a9fb1d97c05252d9f953872)) | |
| 1106 | ROM_RELOAD(0x20000, 0x20000) | |
| 1107 | ROM_RELOAD(0x40000, 0x20000) | |
| 1108 | ROM_RELOAD(0x60000, 0x20000) | |
| 1109 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1110 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1111 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1112 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1113 | ROM_LOAD("ripdispl.301", 0x00000, 0x80000, CRC(47c87ad4) SHA1(eb372b9f17b28d0781c49a28cb850916ccec323d)) | |
| 1114 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1115 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1116 | ROM_RELOAD(0x0,0x200000) | |
| 1117 | ROM_REGION(0x10000, "sound1", 0) | |
| 1118 | ROM_LOAD("ripsndl.u7",0x0000,0x10000,CRC(25fb729a) SHA1(46b9ca8fd5fb5a692adbdb7495af34a1db89dc37)) | |
| 1119 | ROM_REGION(0x400000, "sound2", 0) | |
| 1120 | ROM_LOAD("ripsndl.u17", 0x000000, 0x100000, CRC(a98f4514) SHA1(e87ee8f5a87a8ae9ec996473bf9bc745105ea334)) | |
| 1121 | ROM_LOAD("ripsndl.u21", 0x100000, 0x100000, CRC(141f2b77) SHA1(15bab623beda8ae7ed9908f492ff2baab0a7954e)) | |
| 1122 | ROM_LOAD("ripsndl.u36", 0x200000, 0x100000, CRC(c5461b63) SHA1(fc574d44ad88ce1db590ea371225092c03fc6f80)) | |
| 1123 | ROM_LOAD("ripsndl.u37", 0x300000, 0x100000, CRC(2a58f491) SHA1(1c33f419420b3165ef18598560007ef612b24814)) | |
| 1124 | ROM_END | |
| 1125 | ROM_START(ripl300) | |
| 1126 | ROM_REGION(0x80000, "user1", 0) | |
| 1127 | ROM_LOAD( "ripcpu.300", 0x0000, 0x20000, CRC(8c4bf2a9) SHA1(260dd5a99a36de541b5f852047ae4166afc621cc)) | |
| 1128 | ROM_RELOAD(0x20000, 0x20000) | |
| 1129 | ROM_RELOAD(0x40000, 0x20000) | |
| 1130 | ROM_RELOAD(0x60000, 0x20000) | |
| 1131 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1132 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1133 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1134 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1135 | ROM_LOAD( "ripdispl.300", 0x0000, 0x80000, CRC(d2f496bb) SHA1(48622e25171030b83d8d1736735e97a13c5f47c6)) | |
| 1136 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1137 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1138 | ROM_RELOAD(0x0,0x200000) | |
| 1139 | ROM_REGION(0x10000, "sound1", 0) | |
| 1140 | ROM_LOAD( "ripsndl-30.u7", 0x0000, 0x10000, CRC(66bfcb7c) SHA1(8bdfaf01f367de8ccf15da59000ecff5268e0a4f)) | |
| 1141 | ROM_REGION(0x400000, "sound2", 0) | |
| 1142 | ROM_LOAD("ripsndl.u17", 0x000000, 0x100000, CRC(a98f4514) SHA1(e87ee8f5a87a8ae9ec996473bf9bc745105ea334)) | |
| 1143 | ROM_LOAD("ripsndl.u21", 0x100000, 0x100000, CRC(141f2b77) SHA1(15bab623beda8ae7ed9908f492ff2baab0a7954e)) | |
| 1144 | ROM_LOAD("ripsndl.u36", 0x200000, 0x100000, CRC(c5461b63) SHA1(fc574d44ad88ce1db590ea371225092c03fc6f80)) | |
| 1145 | ROM_LOAD("ripsndl.u37", 0x300000, 0x100000, CRC(2a58f491) SHA1(1c33f419420b3165ef18598560007ef612b24814)) | |
| 1146 | ROM_END | |
| 521 | 1147 | |
| 1148 | ||
| 522 | 1149 | /*------------------------------------------------------------------- |
| 523 | 1150 | / The Lord Of The Rings |
| 524 | 1151 | /-------------------------------------------------------------------*/ |
| 525 | 1152 | ROM_START(lotr) |
| 526 | 1153 | ROM_REGION(0x80000, "user1", 0) |
| 527 | ROM_LOAD("lotrcpua.a00", 0x00000, 0x20000, CRC(00e43b70) SHA1(7100da644a1b166051915870d01cfa6baaf87293)) // ver 10.00 | |
| 528 | //ROM_LOAD("lotrcpu.401", 0x0000, 0x20000, CRC(b69cdecc) SHA1(40f7c2d25a1028255be8fe25e3aa6d11976edd25)) // ver 4.01 | |
| 529 | //ROM_LOAD("lotrcpu.700", 0x0000, 0x20000, CRC(208a4653) SHA1(570f3070c6b0f128d451f3dea01e41a9944081f2)) // ver 7.00 | |
| 530 | //ROM_LOAD("lotrcpu.800", 0x0000, 0x20000, CRC(655e5b3c) SHA1(bd6fd25e17cee40d6bb842367b1ce922bbd46003)) // ver 8.00 | |
| 531 | //ROM_LOAD("lotrcpu.900", 0x0000, 0x20000, CRC(eff1ab83) SHA1(cd9cfa3fa150224e44078602db7d8bbfe223b926)) // ver 9.00 | |
| 1154 | ROM_LOAD("lotrcpua.a00", 0x00000, 0x20000, CRC(00e43b70) SHA1(7100da644a1b166051915870d01cfa6baaf87293)) | |
| 532 | 1155 | ROM_RELOAD(0x20000, 0x20000) |
| 533 | 1156 | ROM_RELOAD(0x40000, 0x20000) |
| 534 | 1157 | ROM_RELOAD(0x60000, 0x20000) |
| r10613 | r10614 | |
| 537 | 1160 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) |
| 538 | 1161 | ROM_REGION(0x80000, "gfx3", 0) |
| 539 | 1162 | ROM_LOAD("lotrdspa.a00", 0x00000, 0x80000, CRC(99634603) SHA1(c40d1480e5df10a491bcd471c6a3a118a9120bcb)) |
| 540 | //ROM_LOAD( "lotrdspa.403", 0x0000, 0x80000, CRC(2630cef1) SHA1(1dfd929e7eb57983f2fd9184d471f2e919359de0)) // ver 4.03 | |
| 541 | //ROM_LOAD( "lotrdspa.700", 0x0000, 0x80000, CRC(233ef0ad) SHA1(1564ae806639dac49add0c464f4499f46b5589ab)) // ver 7.00 | |
| 542 | //ROM_LOAD( "lotrdspa.800", 0x0000, 0x80000, CRC(2aa1f00d) SHA1(e9df5b61b467c307aacdb5a6980a78af26492e6a)) // ver 8.00 | |
| 543 | //ROM_LOAD( "lotrdspa.900", 0x0000, 0x80000, CRC(2b1debd3) SHA1(eab1ffa7b5111bf224c47688bb6c0f40ee6e12fb)) // ver 9.00 | |
| 544 | 1163 | ROM_REGION32_LE(0x600000, "cpu2", 0) |
| 545 | 1164 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) |
| 546 | 1165 | ROM_RELOAD(0x0,0x200000) |
| r10613 | r10614 | |
| 552 | 1171 | ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) |
| 553 | 1172 | ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) |
| 554 | 1173 | ROM_END |
| 1174 | ROM_START(lotr9) | |
| 1175 | ROM_REGION(0x80000, "user1", 0) | |
| 1176 | ROM_LOAD("lotrcpu.900", 0x0000, 0x20000, CRC(eff1ab83) SHA1(cd9cfa3fa150224e44078602db7d8bbfe223b926)) | |
| 1177 | ROM_RELOAD(0x20000, 0x20000) | |
| 1178 | ROM_RELOAD(0x40000, 0x20000) | |
| 1179 | ROM_RELOAD(0x60000, 0x20000) | |
| 1180 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1181 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1182 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1183 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1184 | ROM_LOAD( "lotrdspa.900", 0x0000, 0x80000, CRC(2b1debd3) SHA1(eab1ffa7b5111bf224c47688bb6c0f40ee6e12fb)) | |
| 1185 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1186 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1187 | ROM_RELOAD(0x0,0x200000) | |
| 1188 | ROM_REGION(0x10000, "sound1", 0) | |
| 1189 | ROM_LOAD("lotr-u7.101",0x0000,0x10000,CRC(ba018c5c) SHA1(67e4b9729f086de5e8d56a6ac29fce1c7082e470)) | |
| 1190 | ROM_REGION(0x400000, "sound2", 0) | |
| 1191 | ROM_LOAD("lotr-u17.100", 0x000000, 0x100000, CRC(d503969d) SHA1(65a4313ca1b93391260c65fef6f878d264f9c8ab)) | |
| 1192 | ROM_LOAD("lotr-u21.100", 0x100000, 0x100000, CRC(8b3f41af) SHA1(9b2d04144edeb499b4ae68a97c65ccb8ef4d26c0)) | |
| 1193 | ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) | |
| 1194 | ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) | |
| 1195 | ROM_END | |
| 1196 | ROM_START(lotr8) | |
| 1197 | ROM_REGION(0x80000, "user1", 0) | |
| 1198 | ROM_LOAD("lotrcpu.800", 0x0000, 0x20000, CRC(655e5b3c) SHA1(bd6fd25e17cee40d6bb842367b1ce922bbd46003)) | |
| 1199 | ROM_RELOAD(0x20000, 0x20000) | |
| 1200 | ROM_RELOAD(0x40000, 0x20000) | |
| 1201 | ROM_RELOAD(0x60000, 0x20000) | |
| 1202 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1203 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1204 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1205 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1206 | ROM_LOAD( "lotrdspa.800", 0x0000, 0x80000, CRC(2aa1f00d) SHA1(e9df5b61b467c307aacdb5a6980a78af26492e6a)) | |
| 1207 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1208 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1209 | ROM_RELOAD(0x0,0x200000) | |
| 1210 | ROM_REGION(0x10000, "sound1", 0) | |
| 1211 | ROM_LOAD("lotr-u7.101",0x0000,0x10000,CRC(ba018c5c) SHA1(67e4b9729f086de5e8d56a6ac29fce1c7082e470)) | |
| 1212 | ROM_REGION(0x400000, "sound2", 0) | |
| 1213 | ROM_LOAD("lotr-u17.100", 0x000000, 0x100000, CRC(d503969d) SHA1(65a4313ca1b93391260c65fef6f878d264f9c8ab)) | |
| 1214 | ROM_LOAD("lotr-u21.100", 0x100000, 0x100000, CRC(8b3f41af) SHA1(9b2d04144edeb499b4ae68a97c65ccb8ef4d26c0)) | |
| 1215 | ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) | |
| 1216 | ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) | |
| 1217 | ROM_END | |
| 1218 | ROM_START(lotr7) | |
| 1219 | ROM_REGION(0x80000, "user1", 0) | |
| 1220 | ROM_LOAD("lotrcpu.700", 0x0000, 0x20000, CRC(208a4653) SHA1(570f3070c6b0f128d451f3dea01e41a9944081f2)) | |
| 1221 | ROM_RELOAD(0x20000, 0x20000) | |
| 1222 | ROM_RELOAD(0x40000, 0x20000) | |
| 1223 | ROM_RELOAD(0x60000, 0x20000) | |
| 1224 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1225 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1226 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1227 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1228 | ROM_LOAD( "lotrdspa.700", 0x0000, 0x80000, CRC(233ef0ad) SHA1(1564ae806639dac49add0c464f4499f46b5589ab)) // ver 7.00 | |
| 1229 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1230 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1231 | ROM_RELOAD(0x0,0x200000) | |
| 1232 | ROM_REGION(0x10000, "sound1", 0) | |
| 1233 | ROM_LOAD("lotr-u7.101",0x0000,0x10000,CRC(ba018c5c) SHA1(67e4b9729f086de5e8d56a6ac29fce1c7082e470)) | |
| 1234 | ROM_REGION(0x400000, "sound2", 0) | |
| 1235 | ROM_LOAD("lotr-u17.100", 0x000000, 0x100000, CRC(d503969d) SHA1(65a4313ca1b93391260c65fef6f878d264f9c8ab)) | |
| 1236 | ROM_LOAD("lotr-u21.100", 0x100000, 0x100000, CRC(8b3f41af) SHA1(9b2d04144edeb499b4ae68a97c65ccb8ef4d26c0)) | |
| 1237 | ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) | |
| 1238 | ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) | |
| 1239 | ROM_END | |
| 1240 | ROM_START(lotr401) | |
| 1241 | ROM_REGION(0x80000, "user1", 0) | |
| 1242 | ROM_LOAD("lotrcpu.401", 0x0000, 0x20000, CRC(b69cdecc) SHA1(40f7c2d25a1028255be8fe25e3aa6d11976edd25)) | |
| 1243 | ROM_RELOAD(0x20000, 0x20000) | |
| 1244 | ROM_RELOAD(0x40000, 0x20000) | |
| 1245 | ROM_RELOAD(0x60000, 0x20000) | |
| 1246 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1247 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1248 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1249 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1250 | ROM_LOAD( "lotrdspa.403", 0x0000, 0x80000, CRC(2630cef1) SHA1(1dfd929e7eb57983f2fd9184d471f2e919359de0)) | |
| 1251 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1252 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1253 | ROM_RELOAD(0x0,0x200000) | |
| 1254 | ROM_REGION(0x10000, "sound1", 0) | |
| 1255 | ROM_LOAD("lotr-u7.101",0x0000,0x10000,CRC(ba018c5c) SHA1(67e4b9729f086de5e8d56a6ac29fce1c7082e470)) | |
| 1256 | ROM_REGION(0x400000, "sound2", 0) | |
| 1257 | ROM_LOAD("lotr-u17.100", 0x000000, 0x100000, CRC(d503969d) SHA1(65a4313ca1b93391260c65fef6f878d264f9c8ab)) | |
| 1258 | ROM_LOAD("lotr-u21.100", 0x100000, 0x100000, CRC(8b3f41af) SHA1(9b2d04144edeb499b4ae68a97c65ccb8ef4d26c0)) | |
| 1259 | ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) | |
| 1260 | ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) | |
| 1261 | ROM_END | |
| 555 | 1262 | |
| 556 | 1263 | ROM_START(lotr_sp) |
| 557 | 1264 | ROM_REGION(0x80000, "user1", 0) |
| 558 | 1265 | ROM_LOAD("lotrcpul.a00", 0x00000, 0x20000, CRC(c62aba47) SHA1(2fef599313e5cd9bded3ab00b933631586e2a1e7)) |
| 559 | //ROM_LOAD( "lotrcpul.401", 0x0000, 0x20000, CRC(a9571728) SHA1(f21dd77003f42fafd9293fab3a077c5abf6d572a)) // ver 4.01 | |
| 560 | //ROM_LOAD( "lotrcpul.700", 0x0000, 0x20000, CRC(58d8611b) SHA1(ff1e1668993c7c31f04efc22f04ae53112219a1d)) // ver 7.00 | |
| 561 | //ROM_LOAD( "lotrcpul.800", 0x0000, 0x20000, CRC(38e83068) SHA1(603b1236bf195c72d32e5a1088a2806e77176436)) // ver 8.00 | |
| 562 | //ROM_LOAD( "lotrcpul.900", 0x0000, 0x20000, CRC(155b5d5b) SHA1(c032e3828ed256240a5155ec4c7820d615a2cbe1)) // ver 9.00 | |
| 563 | 1266 | ROM_RELOAD(0x20000, 0x20000) |
| 564 | 1267 | ROM_RELOAD(0x40000, 0x20000) |
| 565 | 1268 | ROM_RELOAD(0x60000, 0x20000) |
| r10613 | r10614 | |
| 568 | 1271 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) |
| 569 | 1272 | ROM_REGION(0x80000, "gfx3", 0) |
| 570 | 1273 | ROM_LOAD("lotrdspl.a00", 0x00000, 0x80000, CRC(2494a5ee) SHA1(5b95711858d88eeb445503cac8b9b754cf8e9960)) |
| 571 | //ROM_LOAD( "lotrdspl.403", 0x0000, 0x80000, CRC(6d4075c9) SHA1(7944ba597cb476c33060cead4feaf6dcad4f4b16)) // ver 4.03 | |
| 572 | //ROM_LOAD( "lotrdspl.700", 0x0000, 0x80000, CRC(3be0283d) SHA1(e019c69cd452b67d6427ddda12b5c3f341afb414)) // ver 7.00 | |
| 573 | //ROM_LOAD( "lotrdspl.800", 0x0000, 0x80000, CRC(137c1255) SHA1(43d9ffec18ab2aa80f30b195ca5270d4574d7b8d)) // ver 8.00 | |
| 574 | //ROM_LOAD( "lotrdspl.900", 0x0000, 0x80000, CRC(00f98242) SHA1(9a0e7e572e209b20691392a694a524192daa0d2a)) // ver 9.00 | |
| 575 | 1274 | ROM_REGION32_LE(0x600000, "cpu2", 0) |
| 576 | 1275 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) |
| 577 | 1276 | ROM_RELOAD(0x0,0x200000) |
| r10613 | r10614 | |
| 583 | 1282 | ROM_LOAD("lotrlu36.100", 0x200000, 0x100000, CRC(502c3d93) SHA1(4ee42d70bccb9253fe1f8f441de6b5018257f107)) |
| 584 | 1283 | ROM_LOAD("lotrlu37.100", 0x300000, 0x100000, CRC(61f21c6d) SHA1(3e9781b4981bd18cdb8c59c55b9942de6ae286db)) |
| 585 | 1284 | ROM_END |
| 1285 | ROM_START(lotr_sp9) | |
| 1286 | ROM_REGION(0x80000, "user1", 0) | |
| 1287 | ROM_LOAD( "lotrcpul.900", 0x0000, 0x20000, CRC(155b5d5b) SHA1(c032e3828ed256240a5155ec4c7820d615a2cbe1)) | |
| 1288 | ROM_RELOAD(0x20000, 0x20000) | |
| 1289 | ROM_RELOAD(0x40000, 0x20000) | |
| 1290 | ROM_RELOAD(0x60000, 0x20000) | |
| 1291 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1292 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1293 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1294 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1295 | ROM_LOAD( "lotrdspl.900", 0x0000, 0x80000, CRC(00f98242) SHA1(9a0e7e572e209b20691392a694a524192daa0d2a)) | |
| 1296 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1297 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1298 | ROM_RELOAD(0x0,0x200000) | |
| 1299 | ROM_REGION(0x10000, "sound1", 0) | |
| 1300 | ROM_LOAD("lotrlu7.100",0x0000,0x10000,CRC(980d970a) SHA1(cf70deddcc146ef9eaa64baec74ae800bebf8715)) | |
| 1301 | ROM_REGION(0x400000, "sound2", 0) | |
| 1302 | ROM_LOAD("lotrlu17.100", 0x000000, 0x100000, CRC(c16d3e20) SHA1(43d9f186db361abb3aa119a7252f1bb13bbbbe39)) | |
| 1303 | ROM_LOAD("lotrlu21.100", 0x100000, 0x100000, CRC(f956a1be) SHA1(2980e85463704a154ed81d3241f866442d1ea2e6)) | |
| 1304 | ROM_LOAD("lotrlu36.100", 0x200000, 0x100000, CRC(502c3d93) SHA1(4ee42d70bccb9253fe1f8f441de6b5018257f107)) | |
| 1305 | ROM_LOAD("lotrlu37.100", 0x300000, 0x100000, CRC(61f21c6d) SHA1(3e9781b4981bd18cdb8c59c55b9942de6ae286db)) | |
| 1306 | ROM_END | |
| 586 | 1307 | |
| 1308 | ROM_START(lotr_sp8) | |
| 1309 | ROM_REGION(0x80000, "user1", 0) | |
| 1310 | ROM_LOAD( "lotrcpul.800", 0x0000, 0x20000, CRC(38e83068) SHA1(603b1236bf195c72d32e5a1088a2806e77176436)) | |
| 1311 | ROM_RELOAD(0x20000, 0x20000) | |
| 1312 | ROM_RELOAD(0x40000, 0x20000) | |
| 1313 | ROM_RELOAD(0x60000, 0x20000) | |
| 1314 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1315 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1316 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1317 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1318 | ROM_LOAD( "lotrdspl.800", 0x0000, 0x80000, CRC(137c1255) SHA1(43d9ffec18ab2aa80f30b195ca5270d4574d7b8d)) | |
| 1319 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1320 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1321 | ROM_RELOAD(0x0,0x200000) | |
| 1322 | ROM_REGION(0x10000, "sound1", 0) | |
| 1323 | ROM_LOAD("lotrlu7.100",0x0000,0x10000,CRC(980d970a) SHA1(cf70deddcc146ef9eaa64baec74ae800bebf8715)) | |
| 1324 | ROM_REGION(0x400000, "sound2", 0) | |
| 1325 | ROM_LOAD("lotrlu17.100", 0x000000, 0x100000, CRC(c16d3e20) SHA1(43d9f186db361abb3aa119a7252f1bb13bbbbe39)) | |
| 1326 | ROM_LOAD("lotrlu21.100", 0x100000, 0x100000, CRC(f956a1be) SHA1(2980e85463704a154ed81d3241f866442d1ea2e6)) | |
| 1327 | ROM_LOAD("lotrlu36.100", 0x200000, 0x100000, CRC(502c3d93) SHA1(4ee42d70bccb9253fe1f8f441de6b5018257f107)) | |
| 1328 | ROM_LOAD("lotrlu37.100", 0x300000, 0x100000, CRC(61f21c6d) SHA1(3e9781b4981bd18cdb8c59c55b9942de6ae286db)) | |
| 1329 | ROM_END | |
| 1330 | ROM_START(lotr_sp7) | |
| 1331 | ROM_REGION(0x80000, "user1", 0) | |
| 1332 | ROM_LOAD( "lotrcpul.700", 0x0000, 0x20000, CRC(58d8611b) SHA1(ff1e1668993c7c31f04efc22f04ae53112219a1d)) | |
| 1333 | ROM_RELOAD(0x20000, 0x20000) | |
| 1334 | ROM_RELOAD(0x40000, 0x20000) | |
| 1335 | ROM_RELOAD(0x60000, 0x20000) | |
| 1336 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1337 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1338 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1339 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1340 | ROM_LOAD( "lotrdspl.700", 0x0000, 0x80000, CRC(3be0283d) SHA1(e019c69cd452b67d6427ddda12b5c3f341afb414)) | |
| 1341 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1342 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1343 | ROM_RELOAD(0x0,0x200000) | |
| 1344 | ROM_REGION(0x10000, "sound1", 0) | |
| 1345 | ROM_LOAD("lotrlu7.100",0x0000,0x10000,CRC(980d970a) SHA1(cf70deddcc146ef9eaa64baec74ae800bebf8715)) | |
| 1346 | ROM_REGION(0x400000, "sound2", 0) | |
| 1347 | ROM_LOAD("lotrlu17.100", 0x000000, 0x100000, CRC(c16d3e20) SHA1(43d9f186db361abb3aa119a7252f1bb13bbbbe39)) | |
| 1348 | ROM_LOAD("lotrlu21.100", 0x100000, 0x100000, CRC(f956a1be) SHA1(2980e85463704a154ed81d3241f866442d1ea2e6)) | |
| 1349 | ROM_LOAD("lotrlu36.100", 0x200000, 0x100000, CRC(502c3d93) SHA1(4ee42d70bccb9253fe1f8f441de6b5018257f107)) | |
| 1350 | ROM_LOAD("lotrlu37.100", 0x300000, 0x100000, CRC(61f21c6d) SHA1(3e9781b4981bd18cdb8c59c55b9942de6ae286db)) | |
| 1351 | ROM_END | |
| 1352 | ROM_START(lotr_sp401) | |
| 1353 | ROM_REGION(0x80000, "user1", 0) | |
| 1354 | ROM_LOAD( "lotrcpul.401", 0x0000, 0x20000, CRC(a9571728) SHA1(f21dd77003f42fafd9293fab3a077c5abf6d572a)) | |
| 1355 | ROM_RELOAD(0x20000, 0x20000) | |
| 1356 | ROM_RELOAD(0x40000, 0x20000) | |
| 1357 | ROM_RELOAD(0x60000, 0x20000) | |
| 1358 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1359 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1360 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1361 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1362 | ROM_LOAD( "lotrdspl.403", 0x0000, 0x80000, CRC(6d4075c9) SHA1(7944ba597cb476c33060cead4feaf6dcad4f4b16)) | |
| 1363 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1364 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1365 | ROM_RELOAD(0x0,0x200000) | |
| 1366 | ROM_REGION(0x10000, "sound1", 0) | |
| 1367 | ROM_LOAD("lotrlu7.100",0x0000,0x10000,CRC(980d970a) SHA1(cf70deddcc146ef9eaa64baec74ae800bebf8715)) | |
| 1368 | ROM_REGION(0x400000, "sound2", 0) | |
| 1369 | ROM_LOAD("lotrlu17.100", 0x000000, 0x100000, CRC(c16d3e20) SHA1(43d9f186db361abb3aa119a7252f1bb13bbbbe39)) | |
| 1370 | ROM_LOAD("lotrlu21.100", 0x100000, 0x100000, CRC(f956a1be) SHA1(2980e85463704a154ed81d3241f866442d1ea2e6)) | |
| 1371 | ROM_LOAD("lotrlu36.100", 0x200000, 0x100000, CRC(502c3d93) SHA1(4ee42d70bccb9253fe1f8f441de6b5018257f107)) | |
| 1372 | ROM_LOAD("lotrlu37.100", 0x300000, 0x100000, CRC(61f21c6d) SHA1(3e9781b4981bd18cdb8c59c55b9942de6ae286db)) | |
| 1373 | ROM_END | |
| 1374 | ||
| 1375 | ||
| 587 | 1376 | ROM_START(lotr_gr) |
| 588 | 1377 | ROM_REGION(0x80000, "user1", 0) |
| 589 | 1378 | ROM_LOAD("lotrcpua.a00", 0x00000, 0x20000, CRC(00e43b70) SHA1(7100da644a1b166051915870d01cfa6baaf87293)) |
| r10613 | r10614 | |
| 595 | 1384 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) |
| 596 | 1385 | ROM_REGION(0x80000, "gfx3", 0) |
| 597 | 1386 | ROM_LOAD("lotrdspg.a00", 0x00000, 0x80000, CRC(6743a910) SHA1(977773515f00af3937aa59426917e8111ec855ab)) |
| 598 | //ROM_LOAD( "lotrdspg.403", 0x0000, 0x80000, CRC(74e925cb) SHA1(2edc8666d53f212a053b7a356d2bf6e3180d7bfb)) // ver 4.03 | |
| 599 | //ROM_LOAD( "lotrdspg.700", 0x0000, 0x80000, CRC(137f223c) SHA1(bb06a6f587bf86555aea85bc1c0402e2137e1c76)) // ver 7.00 | |
| 600 | //ROM_LOAD( "lotrdspg.800", 0x0000, 0x80000, CRC(55765c23) SHA1(690a72e8cb1099a6873eb3214e72bb0fea54fa22)) // ver 8.00 | |
| 601 | //ROM_LOAD( "lotrdspg.900", 0x0000, 0x80000, CRC(f5fdd2c2) SHA1(0c5f1b1efe3d38063e2327e2ccfe40936f3988b8)) // ver 9.00 | |
| 602 | 1387 | ROM_REGION32_LE(0x600000, "cpu2", 0) |
| 603 | 1388 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) |
| 604 | 1389 | ROM_RELOAD(0x0,0x200000) |
| r10613 | r10614 | |
| 610 | 1395 | ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) |
| 611 | 1396 | ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) |
| 612 | 1397 | ROM_END |
| 1398 | ROM_START(lotr_gr9) | |
| 1399 | ROM_REGION(0x80000, "user1", 0) | |
| 1400 | ROM_LOAD("lotrcpu.900", 0x0000, 0x20000, CRC(eff1ab83) SHA1(cd9cfa3fa150224e44078602db7d8bbfe223b926)) | |
| 1401 | ROM_RELOAD(0x20000, 0x20000) | |
| 1402 | ROM_RELOAD(0x40000, 0x20000) | |
| 1403 | ROM_RELOAD(0x60000, 0x20000) | |
| 1404 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1405 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1406 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1407 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1408 | ROM_LOAD( "lotrdspg.900", 0x0000, 0x80000, CRC(f5fdd2c2) SHA1(0c5f1b1efe3d38063e2327e2ccfe40936f3988b8)) | |
| 1409 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1410 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1411 | ROM_RELOAD(0x0,0x200000) | |
| 1412 | ROM_REGION(0x10000, "sound1", 0) | |
| 1413 | ROM_LOAD("lotr-u7.101",0x0000,0x10000,CRC(ba018c5c) SHA1(67e4b9729f086de5e8d56a6ac29fce1c7082e470)) | |
| 1414 | ROM_REGION(0x400000, "sound2", 0) | |
| 1415 | ROM_LOAD("lotr-u17.100", 0x000000, 0x100000, CRC(d503969d) SHA1(65a4313ca1b93391260c65fef6f878d264f9c8ab)) | |
| 1416 | ROM_LOAD("lotr-u21.100", 0x100000, 0x100000, CRC(8b3f41af) SHA1(9b2d04144edeb499b4ae68a97c65ccb8ef4d26c0)) | |
| 1417 | ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) | |
| 1418 | ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) | |
| 1419 | ROM_END | |
| 1420 | ROM_START(lotr_gr8) | |
| 1421 | ROM_REGION(0x80000, "user1", 0) | |
| 1422 | ROM_LOAD("lotrcpu.800", 0x0000, 0x20000, CRC(655e5b3c) SHA1(bd6fd25e17cee40d6bb842367b1ce922bbd46003)) | |
| 1423 | ROM_RELOAD(0x20000, 0x20000) | |
| 1424 | ROM_RELOAD(0x40000, 0x20000) | |
| 1425 | ROM_RELOAD(0x60000, 0x20000) | |
| 1426 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1427 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1428 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1429 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1430 | ROM_LOAD( "lotrdspg.800", 0x0000, 0x80000, CRC(55765c23) SHA1(690a72e8cb1099a6873eb3214e72bb0fea54fa22)) | |
| 1431 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1432 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1433 | ROM_RELOAD(0x0,0x200000) | |
| 1434 | ROM_REGION(0x10000, "sound1", 0) | |
| 1435 | ROM_LOAD("lotr-u7.101",0x0000,0x10000,CRC(ba018c5c) SHA1(67e4b9729f086de5e8d56a6ac29fce1c7082e470)) | |
| 1436 | ROM_REGION(0x400000, "sound2", 0) | |
| 1437 | ROM_LOAD("lotr-u17.100", 0x000000, 0x100000, CRC(d503969d) SHA1(65a4313ca1b93391260c65fef6f878d264f9c8ab)) | |
| 1438 | ROM_LOAD("lotr-u21.100", 0x100000, 0x100000, CRC(8b3f41af) SHA1(9b2d04144edeb499b4ae68a97c65ccb8ef4d26c0)) | |
| 1439 | ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) | |
| 1440 | ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) | |
| 1441 | ROM_END | |
| 1442 | ROM_START(lotr_gr7) | |
| 1443 | ROM_REGION(0x80000, "user1", 0) | |
| 1444 | ROM_LOAD("lotrcpu.700", 0x0000, 0x20000, CRC(208a4653) SHA1(570f3070c6b0f128d451f3dea01e41a9944081f2)) | |
| 1445 | ROM_RELOAD(0x20000, 0x20000) | |
| 1446 | ROM_RELOAD(0x40000, 0x20000) | |
| 1447 | ROM_RELOAD(0x60000, 0x20000) | |
| 1448 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1449 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1450 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1451 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1452 | ROM_LOAD( "lotrdspg.700", 0x0000, 0x80000, CRC(137f223c) SHA1(bb06a6f587bf86555aea85bc1c0402e2137e1c76)) | |
| 1453 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1454 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1455 | ROM_RELOAD(0x0,0x200000) | |
| 1456 | ROM_REGION(0x10000, "sound1", 0) | |
| 1457 | ROM_LOAD("lotr-u7.101",0x0000,0x10000,CRC(ba018c5c) SHA1(67e4b9729f086de5e8d56a6ac29fce1c7082e470)) | |
| 1458 | ROM_REGION(0x400000, "sound2", 0) | |
| 1459 | ROM_LOAD("lotr-u17.100", 0x000000, 0x100000, CRC(d503969d) SHA1(65a4313ca1b93391260c65fef6f878d264f9c8ab)) | |
| 1460 | ROM_LOAD("lotr-u21.100", 0x100000, 0x100000, CRC(8b3f41af) SHA1(9b2d04144edeb499b4ae68a97c65ccb8ef4d26c0)) | |
| 1461 | ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) | |
| 1462 | ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) | |
| 1463 | ROM_END | |
| 1464 | ROM_START(lotr_gr401) | |
| 1465 | ROM_REGION(0x80000, "user1", 0) | |
| 1466 | ROM_LOAD("lotrcpu.401", 0x0000, 0x20000, CRC(b69cdecc) SHA1(40f7c2d25a1028255be8fe25e3aa6d11976edd25)) | |
| 1467 | ROM_RELOAD(0x20000, 0x20000) | |
| 1468 | ROM_RELOAD(0x40000, 0x20000) | |
| 1469 | ROM_RELOAD(0x60000, 0x20000) | |
| 1470 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1471 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1472 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1473 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1474 | ROM_LOAD( "lotrdspg.403", 0x0000, 0x80000, CRC(74e925cb) SHA1(2edc8666d53f212a053b7a356d2bf6e3180d7bfb)) | |
| 1475 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1476 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1477 | ROM_RELOAD(0x0,0x200000) | |
| 1478 | ROM_REGION(0x10000, "sound1", 0) | |
| 1479 | ROM_LOAD("lotr-u7.101",0x0000,0x10000,CRC(ba018c5c) SHA1(67e4b9729f086de5e8d56a6ac29fce1c7082e470)) | |
| 1480 | ROM_REGION(0x400000, "sound2", 0) | |
| 1481 | ROM_LOAD("lotr-u17.100", 0x000000, 0x100000, CRC(d503969d) SHA1(65a4313ca1b93391260c65fef6f878d264f9c8ab)) | |
| 1482 | ROM_LOAD("lotr-u21.100", 0x100000, 0x100000, CRC(8b3f41af) SHA1(9b2d04144edeb499b4ae68a97c65ccb8ef4d26c0)) | |
| 1483 | ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) | |
| 1484 | ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) | |
| 1485 | ROM_END | |
| 613 | 1486 | |
| 614 | 1487 | ROM_START(lotr_fr) |
| 615 | 1488 | ROM_REGION(0x80000, "user1", 0) |
| r10613 | r10614 | |
| 622 | 1495 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) |
| 623 | 1496 | ROM_REGION(0x80000, "gfx3", 0) |
| 624 | 1497 | ROM_LOAD("lotrdspf.a00", 0x00000, 0x80000, CRC(15c26c2d) SHA1(c8e4b442d717aa5881f3d92f044c44d29a14126c)) |
| 625 | //ROM_LOAD( "lotrdspf.403", 0x0000, 0x80000, CRC(d02a77cf) SHA1(8cf4312a04ad486714de5c0041cacb1eb475478f)) // ver 4.03 | |
| 626 | //ROM_LOAD( "lotrdspf.700", 0x0000, 0x80000, CRC(c98aeb30) SHA1(16b0ae41db8b4083121cc5ebf2706320d554dd08)) // ver 7.00 | |
| 627 | //ROM_LOAD( "lotrdspf.800", 0x0000, 0x80000, CRC(e1ccc04b) SHA1(1d5c7ea06f0cb2e1965c968ed01330867aae8e2b)) // ver 8.00 | |
| 628 | //ROM_LOAD( "lotrdspf.900", 0x0000, 0x80000, CRC(f2d8296e) SHA1(3eb6e1e6ba299b720816bf165b1e20e02f6c0c1e)) // ver 9.00 | |
| 629 | 1498 | ROM_REGION32_LE(0x600000, "cpu2", 0) |
| 630 | 1499 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) |
| 631 | 1500 | ROM_RELOAD(0x0,0x200000) |
| r10613 | r10614 | |
| 637 | 1506 | ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) |
| 638 | 1507 | ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) |
| 639 | 1508 | ROM_END |
| 1509 | ROM_START(lotr_fr9) | |
| 1510 | ROM_REGION(0x80000, "user1", 0) | |
| 1511 | ROM_LOAD("lotrcpu.900", 0x0000, 0x20000, CRC(eff1ab83) SHA1(cd9cfa3fa150224e44078602db7d8bbfe223b926)) | |
| 1512 | ROM_RELOAD(0x20000, 0x20000) | |
| 1513 | ROM_RELOAD(0x40000, 0x20000) | |
| 1514 | ROM_RELOAD(0x60000, 0x20000) | |
| 1515 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1516 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1517 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1518 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1519 | ROM_LOAD( "lotrdspf.900", 0x0000, 0x80000, CRC(f2d8296e) SHA1(3eb6e1e6ba299b720816bf165b1e20e02f6c0c1e)) | |
| 1520 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1521 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1522 | ROM_RELOAD(0x0,0x200000) | |
| 1523 | ROM_REGION(0x10000, "sound1", 0) | |
| 1524 | ROM_LOAD("lotr-u7.101",0x0000,0x10000,CRC(ba018c5c) SHA1(67e4b9729f086de5e8d56a6ac29fce1c7082e470)) | |
| 1525 | ROM_REGION(0x400000, "sound2", 0) | |
| 1526 | ROM_LOAD("lotr-u17.100", 0x000000, 0x100000, CRC(d503969d) SHA1(65a4313ca1b93391260c65fef6f878d264f9c8ab)) | |
| 1527 | ROM_LOAD("lotr-u21.100", 0x100000, 0x100000, CRC(8b3f41af) SHA1(9b2d04144edeb499b4ae68a97c65ccb8ef4d26c0)) | |
| 1528 | ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) | |
| 1529 | ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) | |
| 1530 | ROM_END | |
| 1531 | ROM_START(lotr_fr8) | |
| 1532 | ROM_REGION(0x80000, "user1", 0) | |
| 1533 | ROM_LOAD("lotrcpu.800", 0x0000, 0x20000, CRC(655e5b3c) SHA1(bd6fd25e17cee40d6bb842367b1ce922bbd46003)) | |
| 1534 | ROM_RELOAD(0x20000, 0x20000) | |
| 1535 | ROM_RELOAD(0x40000, 0x20000) | |
| 1536 | ROM_RELOAD(0x60000, 0x20000) | |
| 1537 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1538 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1539 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1540 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1541 | ROM_LOAD( "lotrdspf.800", 0x0000, 0x80000, CRC(e1ccc04b) SHA1(1d5c7ea06f0cb2e1965c968ed01330867aae8e2b)) | |
| 1542 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1543 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1544 | ROM_RELOAD(0x0,0x200000) | |
| 1545 | ROM_REGION(0x10000, "sound1", 0) | |
| 1546 | ROM_LOAD("lotr-u7.101",0x0000,0x10000,CRC(ba018c5c) SHA1(67e4b9729f086de5e8d56a6ac29fce1c7082e470)) | |
| 1547 | ROM_REGION(0x400000, "sound2", 0) | |
| 1548 | ROM_LOAD("lotr-u17.100", 0x000000, 0x100000, CRC(d503969d) SHA1(65a4313ca1b93391260c65fef6f878d264f9c8ab)) | |
| 1549 | ROM_LOAD("lotr-u21.100", 0x100000, 0x100000, CRC(8b3f41af) SHA1(9b2d04144edeb499b4ae68a97c65ccb8ef4d26c0)) | |
| 1550 | ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) | |
| 1551 | ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) | |
| 1552 | ROM_END | |
| 1553 | ROM_START(lotr_fr7) | |
| 1554 | ROM_REGION(0x80000, "user1", 0) | |
| 1555 | ROM_LOAD("lotrcpu.700", 0x0000, 0x20000, CRC(208a4653) SHA1(570f3070c6b0f128d451f3dea01e41a9944081f2)) | |
| 1556 | ROM_RELOAD(0x20000, 0x20000) | |
| 1557 | ROM_RELOAD(0x40000, 0x20000) | |
| 1558 | ROM_RELOAD(0x60000, 0x20000) | |
| 1559 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1560 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1561 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1562 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1563 | ROM_LOAD( "lotrdspf.700", 0x0000, 0x80000, CRC(c98aeb30) SHA1(16b0ae41db8b4083121cc5ebf2706320d554dd08)) | |
| 1564 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1565 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1566 | ROM_RELOAD(0x0,0x200000) | |
| 1567 | ROM_REGION(0x10000, "sound1", 0) | |
| 1568 | ROM_LOAD("lotr-u7.101",0x0000,0x10000,CRC(ba018c5c) SHA1(67e4b9729f086de5e8d56a6ac29fce1c7082e470)) | |
| 1569 | ROM_REGION(0x400000, "sound2", 0) | |
| 1570 | ROM_LOAD("lotr-u17.100", 0x000000, 0x100000, CRC(d503969d) SHA1(65a4313ca1b93391260c65fef6f878d264f9c8ab)) | |
| 1571 | ROM_LOAD("lotr-u21.100", 0x100000, 0x100000, CRC(8b3f41af) SHA1(9b2d04144edeb499b4ae68a97c65ccb8ef4d26c0)) | |
| 1572 | ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) | |
| 1573 | ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) | |
| 1574 | ROM_END | |
| 1575 | ROM_START(lotr_fr401) | |
| 1576 | ROM_REGION(0x80000, "user1", 0) | |
| 1577 | ROM_LOAD("lotrcpu.401", 0x0000, 0x20000, CRC(b69cdecc) SHA1(40f7c2d25a1028255be8fe25e3aa6d11976edd25)) | |
| 1578 | ROM_RELOAD(0x20000, 0x20000) | |
| 1579 | ROM_RELOAD(0x40000, 0x20000) | |
| 1580 | ROM_RELOAD(0x60000, 0x20000) | |
| 1581 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1582 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1583 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1584 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1585 | ROM_LOAD( "lotrdspf.403", 0x0000, 0x80000, CRC(d02a77cf) SHA1(8cf4312a04ad486714de5c0041cacb1eb475478f)) | |
| 1586 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1587 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1588 | ROM_RELOAD(0x0,0x200000) | |
| 1589 | ROM_REGION(0x10000, "sound1", 0) | |
| 1590 | ROM_LOAD("lotr-u7.101",0x0000,0x10000,CRC(ba018c5c) SHA1(67e4b9729f086de5e8d56a6ac29fce1c7082e470)) | |
| 1591 | ROM_REGION(0x400000, "sound2", 0) | |
| 1592 | ROM_LOAD("lotr-u17.100", 0x000000, 0x100000, CRC(d503969d) SHA1(65a4313ca1b93391260c65fef6f878d264f9c8ab)) | |
| 1593 | ROM_LOAD("lotr-u21.100", 0x100000, 0x100000, CRC(8b3f41af) SHA1(9b2d04144edeb499b4ae68a97c65ccb8ef4d26c0)) | |
| 1594 | ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) | |
| 1595 | ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) | |
| 1596 | ROM_END | |
| 640 | 1597 | |
| 641 | 1598 | ROM_START(lotr_it) |
| 642 | 1599 | ROM_REGION(0x80000, "user1", 0) |
| r10613 | r10614 | |
| 649 | 1606 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) |
| 650 | 1607 | ROM_REGION(0x80000, "gfx3", 0) |
| 651 | 1608 | ROM_LOAD("lotrdspi.a00", 0x00000, 0x80000, CRC(6c88f395) SHA1(365d5c6908f5861816b73f287194c85d2300635d)) |
| 652 | //ROM_LOAD( "lotrdspi.403", 0x0000, 0x80000, CRC(5922ce10) SHA1(c57f2de4e3344f16056405d71510c0c0b60ef86d)) // ver 4.03 | |
| 653 | //ROM_LOAD( "lotrdspi.700", 0x0000, 0x80000, CRC(6a0d2a6d) SHA1(2b3ca8b26d79919b7102c60515972ab142d1cbf1)) // ver 7.00 | |
| 654 | //ROM_LOAD( "lotrdspi.800", 0x0000, 0x80000, CRC(b80730d7) SHA1(552c0bfac1c7a6b246829378a30d58769e695f7e)) // ver 8.00 | |
| 655 | //ROM_LOAD( "lotrdspi.900", 0x0000, 0x80000, CRC(a09407d7) SHA1(2cdb70ee0bae7f67f4bf12b0dd3e6cf574087e3d)) // ver 9.00 | |
| 656 | 1609 | ROM_REGION32_LE(0x600000, "cpu2", 0) |
| 657 | 1610 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) |
| 658 | 1611 | ROM_RELOAD(0x0,0x200000) |
| r10613 | r10614 | |
| 664 | 1617 | ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) |
| 665 | 1618 | ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) |
| 666 | 1619 | ROM_END |
| 1620 | ROM_START(lotr_it9) | |
| 1621 | ROM_REGION(0x80000, "user1", 0) | |
| 1622 | ROM_LOAD("lotrcpu.900", 0x0000, 0x20000, CRC(eff1ab83) SHA1(cd9cfa3fa150224e44078602db7d8bbfe223b926)) | |
| 1623 | ROM_RELOAD(0x20000, 0x20000) | |
| 1624 | ROM_RELOAD(0x40000, 0x20000) | |
| 1625 | ROM_RELOAD(0x60000, 0x20000) | |
| 1626 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1627 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1628 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1629 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1630 | ROM_LOAD( "lotrdspi.900", 0x0000, 0x80000, CRC(a09407d7) SHA1(2cdb70ee0bae7f67f4bf12b0dd3e6cf574087e3d)) | |
| 1631 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1632 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1633 | ROM_RELOAD(0x0,0x200000) | |
| 1634 | ROM_REGION(0x10000, "sound1", 0) | |
| 1635 | ROM_LOAD("lotr-u7.101",0x0000,0x10000,CRC(ba018c5c) SHA1(67e4b9729f086de5e8d56a6ac29fce1c7082e470)) | |
| 1636 | ROM_REGION(0x400000, "sound2", 0) | |
| 1637 | ROM_LOAD("lotr-u17.100", 0x000000, 0x100000, CRC(d503969d) SHA1(65a4313ca1b93391260c65fef6f878d264f9c8ab)) | |
| 1638 | ROM_LOAD("lotr-u21.100", 0x100000, 0x100000, CRC(8b3f41af) SHA1(9b2d04144edeb499b4ae68a97c65ccb8ef4d26c0)) | |
| 1639 | ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) | |
| 1640 | ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) | |
| 1641 | ROM_END | |
| 1642 | ROM_START(lotr_it8) | |
| 1643 | ROM_REGION(0x80000, "user1", 0) | |
| 1644 | ROM_LOAD("lotrcpu.800", 0x0000, 0x20000, CRC(655e5b3c) SHA1(bd6fd25e17cee40d6bb842367b1ce922bbd46003)) | |
| 1645 | ROM_RELOAD(0x20000, 0x20000) | |
| 1646 | ROM_RELOAD(0x40000, 0x20000) | |
| 1647 | ROM_RELOAD(0x60000, 0x20000) | |
| 1648 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1649 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1650 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1651 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1652 | ROM_LOAD( "lotrdspi.800", 0x0000, 0x80000, CRC(b80730d7) SHA1(552c0bfac1c7a6b246829378a30d58769e695f7e)) | |
| 1653 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1654 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1655 | ROM_RELOAD(0x0,0x200000) | |
| 1656 | ROM_REGION(0x10000, "sound1", 0) | |
| 1657 | ROM_LOAD("lotr-u7.101",0x0000,0x10000,CRC(ba018c5c) SHA1(67e4b9729f086de5e8d56a6ac29fce1c7082e470)) | |
| 1658 | ROM_REGION(0x400000, "sound2", 0) | |
| 1659 | ROM_LOAD("lotr-u17.100", 0x000000, 0x100000, CRC(d503969d) SHA1(65a4313ca1b93391260c65fef6f878d264f9c8ab)) | |
| 1660 | ROM_LOAD("lotr-u21.100", 0x100000, 0x100000, CRC(8b3f41af) SHA1(9b2d04144edeb499b4ae68a97c65ccb8ef4d26c0)) | |
| 1661 | ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) | |
| 1662 | ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) | |
| 1663 | ROM_END | |
| 1664 | ROM_START(lotr_it7) | |
| 1665 | ROM_REGION(0x80000, "user1", 0) | |
| 1666 | ROM_LOAD("lotrcpu.700", 0x0000, 0x20000, CRC(208a4653) SHA1(570f3070c6b0f128d451f3dea01e41a9944081f2)) | |
| 1667 | ROM_RELOAD(0x20000, 0x20000) | |
| 1668 | ROM_RELOAD(0x40000, 0x20000) | |
| 1669 | ROM_RELOAD(0x60000, 0x20000) | |
| 1670 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1671 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1672 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1673 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1674 | ROM_LOAD( "lotrdspi.700", 0x0000, 0x80000, CRC(6a0d2a6d) SHA1(2b3ca8b26d79919b7102c60515972ab142d1cbf1)) | |
| 1675 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1676 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1677 | ROM_RELOAD(0x0,0x200000) | |
| 1678 | ROM_REGION(0x10000, "sound1", 0) | |
| 1679 | ROM_LOAD("lotr-u7.101",0x0000,0x10000,CRC(ba018c5c) SHA1(67e4b9729f086de5e8d56a6ac29fce1c7082e470)) | |
| 1680 | ROM_REGION(0x400000, "sound2", 0) | |
| 1681 | ROM_LOAD("lotr-u17.100", 0x000000, 0x100000, CRC(d503969d) SHA1(65a4313ca1b93391260c65fef6f878d264f9c8ab)) | |
| 1682 | ROM_LOAD("lotr-u21.100", 0x100000, 0x100000, CRC(8b3f41af) SHA1(9b2d04144edeb499b4ae68a97c65ccb8ef4d26c0)) | |
| 1683 | ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) | |
| 1684 | ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) | |
| 1685 | ROM_END | |
| 1686 | ROM_START(lotr_it401) | |
| 1687 | ROM_REGION(0x80000, "user1", 0) | |
| 1688 | ROM_LOAD("lotrcpu.401", 0x0000, 0x20000, CRC(b69cdecc) SHA1(40f7c2d25a1028255be8fe25e3aa6d11976edd25)) | |
| 1689 | ROM_RELOAD(0x20000, 0x20000) | |
| 1690 | ROM_RELOAD(0x40000, 0x20000) | |
| 1691 | ROM_RELOAD(0x60000, 0x20000) | |
| 1692 | ROM_REGION(0x10000, "maincpu", 0) | |
| 1693 | ROM_COPY( "user1", 0x18000, 0x8000, 0x8000) | |
| 1694 | ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) | |
| 1695 | ROM_REGION(0x80000, "gfx3", 0) | |
| 1696 | ROM_LOAD( "lotrdspi.403", 0x0000, 0x80000, CRC(5922ce10) SHA1(c57f2de4e3344f16056405d71510c0c0b60ef86d)) // ver 4.03 | |
| 1697 | ROM_REGION32_LE(0x600000, "cpu2", 0) | |
| 1698 | ROM_LOAD("bios.u8", 0x400000, 0x200000, CRC(c049bf99) SHA1(89e76760e8010fe642ed4312732de81c8a25f548)) | |
| 1699 | ROM_RELOAD(0x0,0x200000) | |
| 1700 | ROM_REGION(0x10000, "sound1", 0) | |
| 1701 | ROM_LOAD("lotr-u7.101",0x0000,0x10000,CRC(ba018c5c) SHA1(67e4b9729f086de5e8d56a6ac29fce1c7082e470)) | |
| 1702 | ROM_REGION(0x400000, "sound2", 0) | |
| 1703 | ROM_LOAD("lotr-u17.100", 0x000000, 0x100000, CRC(d503969d) SHA1(65a4313ca1b93391260c65fef6f878d264f9c8ab)) | |
| 1704 | ROM_LOAD("lotr-u21.100", 0x100000, 0x100000, CRC(8b3f41af) SHA1(9b2d04144edeb499b4ae68a97c65ccb8ef4d26c0)) | |
| 1705 | ROM_LOAD("lotr-u36.100", 0x200000, 0x100000, CRC(9575981e) SHA1(38083fd923c4a168a94d998ec3c4db42c1e2a2da)) | |
| 1706 | ROM_LOAD("lotr-u37.100", 0x300000, 0x100000, CRC(8e637a6f) SHA1(8087744ce36fc143381d49a312c98cf38b2f9854)) | |
| 1707 | ROM_END | |
| 667 | 1708 | |
| 1709 | ||
| 668 | 1710 | ROM_START(lotr_le) |
| 669 | 1711 | ROM_REGION(0x80000, "user1", 0) |
| 670 | 1712 | ROM_LOAD("lotrcpua.a02", 0x00000, 0x20000, CRC(f732aeb1) SHA1(8c28e91d37525b3e356bddf2cf1be42ea44f3629)) |
| r10613 | r10614 | |
| 854 | 1896 | ROM_END |
| 855 | 1897 | |
| 856 | 1898 | GAME(2004, elvisp, 0, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (5.00)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 857 | GAME(2004, elvisl, elvisp, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 858 | GAME(2004, elvisg, elvisp, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 859 | GAME(2004, elvisf, elvisp, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 860 | GAME(2004, elvisi, elvisp, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1899 | GAME(2004, elvisp4, elvisp, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (4.00)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1900 | GAME(2004, elvisp303, elvisp, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (3.03)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1901 | GAME(2004, elvisp302, elvisp, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (3.02)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1902 | GAME(2004, elvisl, 0, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (5.00 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1903 | GAME(2004, elvisl4, elvisl, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (4.00 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1904 | GAME(2004, elvisl303, elvisl, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (3.03 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1905 | GAME(2004, elvisl302, elvisl, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (3.02 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1906 | GAME(2004, elvisg, 0, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (5.00 Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1907 | GAME(2004, elvisg4, elvisg, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (4.00 Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1908 | GAME(2004, elvisg303, elvisg, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (3.03 Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1909 | GAME(2004, elvisg302, elvisg, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (3.02 Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1910 | GAME(2004, elvisf, 0, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (5.00 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1911 | GAME(2004, elvisf4, elvisf, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (4.00 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1912 | GAME(2004, elvisf303, elvisf, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (3.03 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1913 | GAME(2004, elvisf302, elvisf, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (3.02 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1914 | GAME(2004, elvisi, 0, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (5.00 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1915 | GAME(2004, elvisi4, elvisi, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (4.00 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1916 | GAME(2004, elvisi303, elvisi, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (3.03 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1917 | GAME(2004, elvisi302, elvisi, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Elvis (3.02 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 861 | 1918 | GAME(2005, gprix, 0, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Grand Prix (4.50)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 862 | 1919 | GAME(2005, gprixg, gprix, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Grand Prix (Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 863 | 1920 | GAME(2005, gprixl, gprix, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Grand Prix (Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| r10613 | r10614 | |
| 866 | 1923 | GAME(2005, nascar, 0, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Nascar (4.50)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 867 | 1924 | GAME(2005, nascarl, nascar, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Nascar (Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 868 | 1925 | GAME(2004, ripleys, 0, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (3.20)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 869 | GAME(2004, ripleysf, ripleys, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 870 | GAME(2004, ripleysg, ripleys, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (Germany)",GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 871 | GAME(2004, ripleysi, ripleys, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 872 | GAME(2004, ripleysl, ripleys, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1926 | GAME(2004, rip310, ripleys, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (3.10)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1927 | GAME(2004, rip302, ripleys, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (3.02)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1928 | GAME(2004, rip300, ripleys, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (3.00)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1929 | GAME(2004, ripleysf, 0, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (3.20 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1930 | GAME(2004, ripf310, ripleysf, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (3.10 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1931 | GAME(2004, ripf302, ripleysf, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (3.02 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1932 | GAME(2004, ripf300, ripleysf, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (3.00 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1933 | GAME(2004, ripleysg, 0, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (3.20 Germany)",GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1934 | GAME(2004, ripg310, ripleysg, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (3.10 Germany)",GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1935 | GAME(2004, ripg302, ripleysg, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (3.02 Germany)",GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1936 | GAME(2004, ripg300, ripleysg, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (3.00 Germany)",GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1937 | GAME(2004, ripleysi, 0, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (3.20 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1938 | GAME(2004, ripi310, ripleysi, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (3.10 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1939 | GAME(2004, ripi302, ripleysi, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (3.02 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1940 | GAME(2004, ripi300, ripleysi, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (3.00 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1941 | GAME(2004, ripleysl, 0, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (3.20 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1942 | GAME(2004, ripl310, ripleysl, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (3.10 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1943 | GAME(2004, ripl302, ripleysl, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (3.02 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1944 | GAME(2004, ripl300, ripleysl, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Ripley's Believe It or Not! (3.00 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 873 | 1945 | GAME(2003, lotr, 0, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (10.00)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 874 | 1946 | GAME(2003, lotr_le, lotr, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (10.02 Limited Edition)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 875 | GAME(2003, lotr_sp, lotr, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 876 | GAME(2003, lotr_gr, lotr, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 877 | GAME(2003, lotr_fr, lotr, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 878 | GAME(2003, lotr_it, lotr, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1947 | GAME(2003, lotr9, lotr, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (9.00)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1948 | GAME(2003, lotr8, lotr, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (8.00)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1949 | GAME(2003, lotr7, lotr, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (7.00)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1950 | GAME(2003, lotr401, lotr, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (4.01)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1951 | GAME(2003, lotr_sp, 0, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (10.00 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1952 | GAME(2003, lotr_sp9, lotr_sp, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (9.0 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1953 | GAME(2003, lotr_sp8, lotr_sp, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (8.0 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1954 | GAME(2003, lotr_sp7, lotr_sp, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (7.0 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1955 | GAME(2003, lotr_sp401, lotr_sp, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (4.01 Spain)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1956 | GAME(2003, lotr_gr, 0, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (10.00 Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1957 | GAME(2003, lotr_gr9, lotr_gr, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (9.0 Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1958 | GAME(2003, lotr_gr8, lotr_gr, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (8.0 Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1959 | GAME(2003, lotr_gr7, lotr_gr, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (7.0 Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1960 | GAME(2003, lotr_gr401, lotr_gr, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (4.01 Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1961 | GAME(2003, lotr_fr, 0, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (10.00 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1962 | GAME(2003, lotr_fr9, lotr_fr, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (9.0 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1963 | GAME(2003, lotr_fr8, lotr_fr, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (8.0 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1964 | GAME(2003, lotr_fr7, lotr_fr, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (7.0 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1965 | GAME(2003, lotr_fr401, lotr_fr, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (4.01 France)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1966 | GAME(2003, lotr_it, 0, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (10.00 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1967 | GAME(2003, lotr_it9, lotr_it, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (9.0 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1968 | GAME(2003, lotr_it8, lotr_it, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (8.0 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1969 | GAME(2003, lotr_it7, lotr_it, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (7.0 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1970 | GAME(2003, lotr_it401, lotr_it, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Lord Of The Rings, The (4.01 Italy)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 879 | 1971 | GAME(2005, sopranos, 0, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Sopranos, The (5.00)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 880 | 1972 | GAME(2005, soprano3, sopranos, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Sopranos, The (3.00)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| 881 | 1973 | GAME(2005, sopranog, sopranos, whitestar_mod, whitestar_mod, whitestar_mod, ROT0, "Stern", "Sopranos, The (Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| r10613 | r10614 | |
|---|---|---|
| 11 | 11 | #include "machine/nvram.h" |
| 12 | 12 | #include "includes/pingpong.h" |
| 13 | 13 | |
| 14 | static int intenable; | |
| 15 | 14 | |
| 16 | static int question_addr_high = 0; | |
| 17 | 15 | |
| 18 | 16 | static WRITE8_HANDLER( cashquiz_question_bank_high_w ) |
| 19 | 17 | { |
| 18 | pingpong_state *state = space->machine->driver_data<pingpong_state>(); | |
| 20 | 19 | if( data != 0xff ) |
| 21 | 20 | { |
| 22 | 21 | switch( ~data & 0xff ) |
| 23 | 22 | { |
| 24 | 23 | case 0x01: |
| 25 | question_addr_high = 0; | |
| 24 | state->question_addr_high = 0; | |
| 26 | 25 | break; |
| 27 | 26 | case 0x02: |
| 28 | question_addr_high = 0x8000; | |
| 27 | state->question_addr_high = 0x8000; | |
| 29 | 28 | break; |
| 30 | 29 | case 0x04: |
| 31 | question_addr_high = 0x10000; | |
| 30 | state->question_addr_high = 0x10000; | |
| 32 | 31 | break; |
| 33 | 32 | case 0x08: |
| 34 | question_addr_high = 0x18000; | |
| 33 | state->question_addr_high = 0x18000; | |
| 35 | 34 | break; |
| 36 | 35 | case 0x10: |
| 37 | question_addr_high = 0x20000; | |
| 36 | state->question_addr_high = 0x20000; | |
| 38 | 37 | break; |
| 39 | 38 | case 0x20: |
| 40 | question_addr_high = 0x28000; | |
| 39 | state->question_addr_high = 0x28000; | |
| 41 | 40 | break; |
| 42 | 41 | case 0x40: |
| 43 | question_addr_high = 0x30000; | |
| 42 | state->question_addr_high = 0x30000; | |
| 44 | 43 | break; |
| 45 | 44 | case 0x80: |
| 46 | question_addr_high = 0x38000; | |
| 45 | state->question_addr_high = 0x38000; | |
| 47 | 46 | break; |
| 48 | 47 | } |
| 49 | 48 | } |
| r10613 | r10614 | |
| 51 | 50 | |
| 52 | 51 | static WRITE8_HANDLER( cashquiz_question_bank_low_w ) |
| 53 | 52 | { |
| 53 | pingpong_state *state = space->machine->driver_data<pingpong_state>(); | |
| 54 | 54 | if(data >= 0x60 && data <= 0xdf) |
| 55 | 55 | { |
| 56 | 56 | static const char * const bankname[] = { "bank1", "bank2", "bank3", "bank4", "bank5", "bank6", "bank7", "bank8" }; |
| 57 | 57 | const char *bank = bankname[data & 7]; |
| 58 | int bankaddr = question_addr_high | ((data - 0x60) * 0x100); | |
| 58 | int bankaddr = state->question_addr_high | ((data - 0x60) * 0x100); | |
| 59 | 59 | UINT8 *questions = space->machine->region("user1")->base() + bankaddr; |
| 60 | 60 | memory_set_bankptr(space->machine, bank,questions); |
| 61 | 61 | |
| r10613 | r10614 | |
| 65 | 65 | |
| 66 | 66 | static WRITE8_HANDLER( coin_w ) |
| 67 | 67 | { |
| 68 | pingpong_state *state = space->machine->driver_data<pingpong_state>(); | |
| 68 | 69 | /* bit 2 = irq enable, bit 3 = nmi enable */ |
| 69 | intenable = data & 0x0c; | |
| 70 | state->intenable = data & 0x0c; | |
| 70 | 71 | |
| 71 | 72 | /* bit 0/1 = coin counters */ |
| 72 | 73 | coin_counter_w(space->machine, 0,data & 1); |
| r10613 | r10614 | |
| 77 | 78 | |
| 78 | 79 | static INTERRUPT_GEN( pingpong_interrupt ) |
| 79 | 80 | { |
| 81 | pingpong_state *state = device->machine->driver_data<pingpong_state>(); | |
| 80 | 82 | if (cpu_getiloops(device) == 0) |
| 81 | 83 | { |
| 82 | if (intenable & 0x04) cpu_set_input_line(device, 0, HOLD_LINE); | |
| 84 | if (state->intenable & 0x04) cpu_set_input_line(device, 0, HOLD_LINE); | |
| 83 | 85 | } |
| 84 | 86 | else if (cpu_getiloops(device) % 2) |
| 85 | 87 | { |
| 86 | if (intenable & 0x08) cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); | |
| 88 | if (state->intenable & 0x08) cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); | |
| 87 | 89 | } |
| 88 | 90 | } |
| 89 | 91 | |
| 90 | 92 | static ADDRESS_MAP_START( pingpong_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 91 | 93 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 92 | AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(pingpong_colorram_w) AM_BASE(&pingpong_colorram) | |
| 93 | AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(pingpong_videoram_w) AM_BASE(&pingpong_videoram) | |
| 94 | AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(pingpong_colorram_w) AM_BASE_MEMBER(pingpong_state, colorram) | |
| 95 | AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(pingpong_videoram_w) AM_BASE_MEMBER(pingpong_state, videoram) | |
| 94 | 96 | AM_RANGE(0x9000, 0x9002) AM_RAM |
| 95 | 97 | AM_RANGE(0x9003, 0x9052) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) |
| 96 | 98 | AM_RANGE(0x9053, 0x97ff) AM_RAM |
| r10613 | r10614 | |
| 110 | 112 | AM_RANGE(0x5400, 0x57ff) AM_RAM |
| 111 | 113 | AM_RANGE(0x6000, 0x6007) AM_WRITENOP /* solenoid writes */ |
| 112 | 114 | AM_RANGE(0x7000, 0x7000) AM_READ_PORT("IN4") |
| 113 | AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(pingpong_colorram_w) AM_BASE(&pingpong_colorram) | |
| 114 | AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(pingpong_videoram_w) AM_BASE(&pingpong_videoram) | |
| 115 | AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(pingpong_colorram_w) AM_BASE_MEMBER(pingpong_state, colorram) | |
| 116 | AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(pingpong_videoram_w) AM_BASE_MEMBER(pingpong_state, videoram) | |
| 115 | 117 | AM_RANGE(0x9000, 0x9002) AM_RAM |
| 116 | 118 | AM_RANGE(0x9003, 0x9052) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) |
| 117 | 119 | AM_RANGE(0x9053, 0x97ff) AM_RAM |
| r10613 | r10614 | |
| 449 | 451 | |
| 450 | 452 | |
| 451 | 453 | |
| 452 | static MACHINE_CONFIG_START( pingpong, | |
| 454 | static MACHINE_CONFIG_START( pingpong, p | |
| 453 | 455 | |
| 454 | 456 | /* basic machine hardware */ |
| 455 | 457 | MCFG_CPU_ADD("maincpu",Z80,18432000/6) /* 3.072 MHz (probably) */ |
| r10613 | r10614 | |
|---|---|---|
| 334 | 334 | static WRITE8_HANDLER( iox_command_w ) |
| 335 | 335 | { |
| 336 | 336 | /* |
| 337 | bit wise command port apparently | |
| 338 | 0x01: selects both sides | |
| 339 | 0x02: selects p1 side | |
| 340 | 0x04: selects p2 side | |
| 341 | */ | |
| 337 | bit wise command port apparently | |
| 338 | 0x01: selects both sides | |
| 339 | 0x02: selects p1 side | |
| 340 | 0x04: selects p2 side | |
| 341 | */ | |
| 342 | 342 | |
| 343 | 343 | iox_mux = data; |
| 344 | 344 | iox_ff = 0; // this also set flip flop back to 0 |
| r10613 | r10614 | |
| 1542 | 1542 | |
| 1543 | 1543 | |
| 1544 | 1544 | |
| 1545 | GAME( 1987, srmp1, 0, srmp2, srmp2, 0, ROT0, "Seta", "Super Real Mahjong Part 1 (Japan)", 0 ) | |
| 1546 | GAME( 1987, srmp2, 0, srmp2, srmp2, 0, ROT0, "Seta", "Super Real Mahjong Part 2 (Japan)", 0 ) | |
| 1547 | GAME( 1988, srmp3, 0, srmp3, srmp3, 0, ROT0, "Seta", "Super Real Mahjong Part 3 (Japan)", 0 ) | |
| 1545 | GAME( 1987, srmp1, 0, srmp2, srmp2, 0, ROT0, "Seta", "Super Real Mahjong Part 1 (Japan)", 0 ) | |
| 1546 | GAME( 1987, srmp2, 0, srmp2, srmp2, 0, ROT0, "Seta", "Super Real Mahjong Part 2 (Japan)", 0 ) | |
| 1547 | GAME( 1988, srmp3, 0, srmp3, srmp3, 0, ROT0, "Seta", "Super Real Mahjong Part 3 (Japan)", 0 ) | |
| 1548 | 1548 | GAME( 1988, rmgoldyh, srmp3, rmgoldyh, rmgoldyh, 0, ROT0, "Seta (Alba license)", "Real Mahjong Gold Yumehai / Super Real Mahjong GOLD part.2 [BET] (Japan)", 0 ) |
| 1549 | GAME( 1990, mjyuugi, 0, mjyuugi, mjyuugi, 0, ROT0, "Visco", "Mahjong Yuugi (Japan set 1)", 0 ) | |
| 1550 | GAME( 1990, mjyuugia, mjyuugi, mjyuugi, mjyuugi, 0, ROT0, "Visco", "Mahjong Yuugi (Japan set 2)", 0 ) | |
| 1551 | GAME( 1991, ponchin, 0, mjyuugi, ponchin, 0, ROT0, "Visco", "Mahjong Pon Chin Kan (Japan set 1)", 0 ) | |
| 1552 | GAME( 1991, ponchina, ponchin, mjyuugi, ponchin, 0, ROT0, "Visco", "Mahjong Pon Chin Kan (Japan set 2)", 0 ) | |
| 1549 | GAME( 1990, mjyuugi, 0, mjyuugi, mjyuugi, 0, ROT0, "Visco", "Mahjong Yuugi (Japan set 1)", 0 ) | |
| 1550 | GAME( 1990, mjyuugia, mjyuugi, mjyuugi, mjyuugi, 0, ROT0, "Visco", "Mahjong Yuugi (Japan set 2)", 0 ) | |
| 1551 | GAME( 1991, ponchin, 0, mjyuugi, ponchin, 0, ROT0, "Visco", "Mahjong Pon Chin Kan (Japan set 1)", 0 ) | |
| 1552 | GAME( 1991, ponchina, ponchin, mjyuugi, ponchin, 0, ROT0, "Visco", "Mahjong Pon Chin Kan (Japan set 2)", 0 ) | |
| 1553 | 1553 | |
| 1554 | 1554 |
| r10613 | r10614 | |
|---|---|---|
| 2881 | 2881 | |
| 2882 | 2882 | if( s[ 0 ] != 0 ) |
| 2883 | 2883 | { |
| 2884 | // | |
| 2884 | // popmessage( "%s", s ); | |
| 2885 | 2885 | } |
| 2886 | 2886 | |
| 2887 | 2887 | break; |
| r10613 | r10614 | |
| 4672 | 4672 | ROM_LOAD( "gq918eaa.u1", 0x000000, 0x000224, CRC(f3342ff5) SHA1(d3d6ecc22396f74b99ad7aab7908cd542c518977) ) |
| 4673 | 4673 | |
| 4674 | 4674 | ROM_REGION( 0x200000, "onboard.0", 0 ) /* onboard flash */ |
| 4675 | ROM_LOAD( "gq918xxb.31m", 0x000000, 0x200000, CRC(3653b5d7) SHA1(1deb44335b7a38506fb30da40e0ca61b96aea7bb) ) | |
| 4675 | ROM_LOAD( "gq918xxb.31m", 0x000000, 0x200000, CRC(3653b5d7) SHA1(1deb44335b7a38506fb30da40e0ca61b96aea7bb) ) | |
| 4676 | 4676 | ROM_REGION( 0x200000, "onboard.1", 0 ) /* onboard flash */ |
| 4677 | ROM_LOAD( "gq918xxb.27m", 0x000000, 0x200000, CRC(27d48c97) SHA1(c140d4bdfa869fbcae1133bbfe73a346e6f46cb8) ) | |
| 4677 | ROM_LOAD( "gq918xxb.27m", 0x000000, 0x200000, CRC(27d48c97) SHA1(c140d4bdfa869fbcae1133bbfe73a346e6f46cb8) ) | |
| 4678 | 4678 | |
| 4679 | 4679 | ROM_REGION( 0x000008, "install_id", 0 ) /* security cart id */ |
| 4680 | 4680 | ROM_LOAD( "gq918eaa.u6", 0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) ) |
| r10613 | r10614 | |
| 4690 | 4690 | ROM_LOAD( "gq918aaa.u1", 0x000000, 0x000224, CRC(1a2c5d53) SHA1(ab7e44a83e8cd271e2bf8580881a3050d35641df) ) |
| 4691 | 4691 | |
| 4692 | 4692 | ROM_REGION( 0x200000, "onboard.0", 0 ) /* onboard flash */ |
| 4693 | ROM_LOAD( "gq918xxb.31m", 0x000000, 0x200000, CRC(3653b5d7) SHA1(1deb44335b7a38506fb30da40e0ca61b96aea7bb) ) | |
| 4693 | ROM_LOAD( "gq918xxb.31m", 0x000000, 0x200000, CRC(3653b5d7) SHA1(1deb44335b7a38506fb30da40e0ca61b96aea7bb) ) | |
| 4694 | 4694 | ROM_REGION( 0x200000, "onboard.1", 0 ) /* onboard flash */ |
| 4695 | ROM_LOAD( "gq918xxb.27m", 0x000000, 0x200000, CRC(27d48c97) SHA1(c140d4bdfa869fbcae1133bbfe73a346e6f46cb8) ) | |
| 4695 | ROM_LOAD( "gq918xxb.27m", 0x000000, 0x200000, CRC(27d48c97) SHA1(c140d4bdfa869fbcae1133bbfe73a346e6f46cb8) ) | |
| 4696 | 4696 | |
| 4697 | 4697 | ROM_REGION( 0x000008, "install_id", 0 ) /* security cart id */ |
| 4698 | 4698 | ROM_LOAD( "gq918aaa.u6", 0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) ) |
| r10613 | r10614 | |
| 4708 | 4708 | ROM_LOAD( "gq918kaa.u1", 0x000000, 0x000224, CRC(cf32990b) SHA1(bf49b8560f008696b45a3f7f03fa7b3395635b0f) ) |
| 4709 | 4709 | |
| 4710 | 4710 | ROM_REGION( 0x200000, "onboard.0", 0 ) /* onboard flash */ |
| 4711 | ROM_LOAD( "gq918xxb.31m", 0x000000, 0x200000, CRC(3653b5d7) SHA1(1deb44335b7a38506fb30da40e0ca61b96aea7bb) ) | |
| 4711 | ROM_LOAD( "gq918xxb.31m", 0x000000, 0x200000, CRC(3653b5d7) SHA1(1deb44335b7a38506fb30da40e0ca61b96aea7bb) ) | |
| 4712 | 4712 | ROM_REGION( 0x200000, "onboard.1", 0 ) /* onboard flash */ |
| 4713 | ROM_LOAD( "gq918xxb.27m", 0x000000, 0x200000, CRC(27d48c97) SHA1(c140d4bdfa869fbcae1133bbfe73a346e6f46cb8) ) | |
| 4713 | ROM_LOAD( "gq918xxb.27m", 0x000000, 0x200000, CRC(27d48c97) SHA1(c140d4bdfa869fbcae1133bbfe73a346e6f46cb8) ) | |
| 4714 | 4714 | |
| 4715 | 4715 | ROM_REGION( 0x000008, "install_id", 0 ) /* security cart id */ |
| 4716 | 4716 | ROM_LOAD( "gq918kaa.u6", 0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) ) |
| r10613 | r10614 | |
| 4726 | 4726 | ROM_LOAD( "gq918uaa.u1", 0x000000, 0x000224, CRC(e1b7e9ef) SHA1(5767f47cb9a689601fb92c6a494563c5ffdde04c) ) |
| 4727 | 4727 | |
| 4728 | 4728 | ROM_REGION( 0x200000, "onboard.0", 0 ) /* onboard flash */ |
| 4729 | ROM_LOAD( "gq918xxb.31m", 0x000000, 0x200000, CRC(3653b5d7) SHA1(1deb44335b7a38506fb30da40e0ca61b96aea7bb) ) | |
| 4729 | ROM_LOAD( "gq918xxb.31m", 0x000000, 0x200000, CRC(3653b5d7) SHA1(1deb44335b7a38506fb30da40e0ca61b96aea7bb) ) | |
| 4730 | 4730 | ROM_REGION( 0x200000, "onboard.1", 0 ) /* onboard flash */ |
| 4731 | ROM_LOAD( "gq918xxb.27m", 0x000000, 0x200000, CRC(27d48c97) SHA1(c140d4bdfa869fbcae1133bbfe73a346e6f46cb8) ) | |
| 4731 | ROM_LOAD( "gq918xxb.27m", 0x000000, 0x200000, CRC(27d48c97) SHA1(c140d4bdfa869fbcae1133bbfe73a346e6f46cb8) ) | |
| 4732 | 4732 | |
| 4733 | 4733 | ROM_REGION( 0x000008, "install_id", 0 ) /* security cart id */ |
| 4734 | 4734 | ROM_LOAD( "gq918uaa.u6", 0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) ) |
| r10613 | r10614 | |
| 5216 | 5216 | ROM_LOAD( "gq918jaa.u1", 0x000000, 0x000224, BAD_DUMP CRC(e4769787) SHA1(d60c6598c7c58b5cd8f86350ebf7f3f32c1ebe9b) ) |
| 5217 | 5217 | |
| 5218 | 5218 | ROM_REGION( 0x200000, "onboard.0", 0 ) /* onboard flash */ |
| 5219 | ROM_LOAD( "gq918xxb.31m", 0x000000, 0x200000, CRC(3653b5d7) SHA1(1deb44335b7a38506fb30da40e0ca61b96aea7bb) ) | |
| 5219 | ROM_LOAD( "gq918xxb.31m", 0x000000, 0x200000, CRC(3653b5d7) SHA1(1deb44335b7a38506fb30da40e0ca61b96aea7bb) ) | |
| 5220 | 5220 | ROM_REGION( 0x200000, "onboard.1", 0 ) /* onboard flash */ |
| 5221 | ROM_LOAD( "gq918xxb.27m", 0x000000, 0x200000, CRC(27d48c97) SHA1(c140d4bdfa869fbcae1133bbfe73a346e6f46cb8) ) | |
| 5221 | ROM_LOAD( "gq918xxb.27m", 0x000000, 0x200000, CRC(27d48c97) SHA1(c140d4bdfa869fbcae1133bbfe73a346e6f46cb8) ) | |
| 5222 | 5222 | |
| 5223 | 5223 | ROM_REGION( 0x000008, "install_id", 0 ) /* security cart id */ |
| 5224 | 5224 | ROM_LOAD( "gq918jaa.u6", 0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) ) |
| r10613 | r10614 | |
| 5231 | 5231 | SYS573_BIOS_A |
| 5232 | 5232 | |
| 5233 | 5233 | ROM_REGION( 0x0000224, "install_eeprom", 0 ) /* security cart eeprom */ |
| 5234 | ROM_LOAD( "gq918jab.u1", 0x000000, 0x000224, BAD_DUMP CRC(e4769787) SHA1(d60c6598c7c58b5cd8f86350ebf7f3f32c1ebe9b) ) | |
| 5234 | ROM_LOAD( "gq918jab.u1", 0x000000, 0x000224, BAD_DUMP CRC(e4769787) SHA1(d60c6598c7c58b5cd8f86350ebf7f3f32c1ebe9b) ) | |
| 5235 | 5235 | |
| 5236 | 5236 | ROM_REGION( 0x200000, "onboard.0", 0 ) /* onboard flash */ |
| 5237 | ROM_LOAD( "gq918xxb.31m", 0x000000, 0x200000, CRC(3653b5d7) SHA1(1deb44335b7a38506fb30da40e0ca61b96aea7bb) ) | |
| 5237 | ROM_LOAD( "gq918xxb.31m", 0x000000, 0x200000, CRC(3653b5d7) SHA1(1deb44335b7a38506fb30da40e0ca61b96aea7bb) ) | |
| 5238 | 5238 | ROM_REGION( 0x200000, "onboard.1", 0 ) /* onboard flash */ |
| 5239 | ROM_LOAD( "gq918xxb.27m", 0x000000, 0x200000, CRC(27d48c97) SHA1(c140d4bdfa869fbcae1133bbfe73a346e6f46cb8) ) | |
| 5239 | ROM_LOAD( "gq918xxb.27m", 0x000000, 0x200000, CRC(27d48c97) SHA1(c140d4bdfa869fbcae1133bbfe73a346e6f46cb8) ) | |
| 5240 | 5240 | |
| 5241 | 5241 | ROM_REGION( 0x000008, "install_id", 0 ) /* security cart id */ |
| 5242 | 5242 | ROM_LOAD( "gq918jab.u6", 0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) ) |
| r10613 | r10614 | |
| 5249 | 5249 | SYS573_BIOS_A |
| 5250 | 5250 | |
| 5251 | 5251 | ROM_REGION( 0x0000224, "install_eeprom", 0 ) /* security cart eeprom */ |
| 5252 | ROM_LOAD( "gqa09ja.u1", 0x000000, 0x000224, BAD_DUMP CRC(e1e4108f) SHA1(0605e2c7a7dcb2f4928350e96d2ffcc2ede4a762) ) | |
| 5252 | ROM_LOAD( "gqa09ja.u1", 0x000000, 0x000224, BAD_DUMP CRC(e1e4108f) SHA1(0605e2c7a7dcb2f4928350e96d2ffcc2ede4a762) ) | |
| 5253 | 5253 | |
| 5254 | 5254 | ROM_REGION( 0x200000, "onboard.0", 0 ) /* onboard flash */ |
| 5255 | ROM_LOAD( "gqa09ja.31m", 0x000000, 0x200000, CRC(b1043a91) SHA1(b474439c1a7da7855d9b6d2162d4a522f499d6ab) ) | |
| 5255 | ROM_LOAD( "gqa09ja.31m", 0x000000, 0x200000, CRC(b1043a91) SHA1(b474439c1a7da7855d9b6d2162d4a522f499d6ab) ) | |
| 5256 | 5256 | ROM_REGION( 0x200000, "onboard.1", 0 ) /* onboard flash */ |
| 5257 | ROM_LOAD( "gqa09ja.27m", 0x000000, 0x200000, CRC(09b1a70b) SHA1(0f3bcad879e05faaf8130133d774a2071031ee74) ) | |
| 5257 | ROM_LOAD( "gqa09ja.27m", 0x000000, 0x200000, CRC(09b1a70b) SHA1(0f3bcad879e05faaf8130133d774a2071031ee74) ) | |
| 5258 | 5258 | |
| 5259 | 5259 | ROM_REGION( 0x000008, "install_id", 0 ) /* security cart id */ |
| 5260 | 5260 | ROM_LOAD( "gqa09ja.u6", 0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) ) |
| r10613 | r10614 | |
|---|---|---|
| 996 | 996 | MCFG_PALETTE_LENGTH(4096) |
| 997 | 997 | |
| 998 | 998 | MCFG_VIDEO_START(zwackery) |
| 999 | ||
| 999 | ||
| 1000 | 1000 | /* sound hardware */ |
| 1001 | 1001 | MCFG_FRAGMENT_ADD(chip_squeak_deluxe) |
| 1002 | 1002 | MACHINE_CONFIG_END |
| r10613 | r10614 | |
|---|---|---|
| 316 | 316 | |
| 317 | 317 | |
| 318 | 318 | |
| 319 | static MACHINE_CONFIG_START( ohpaipee, | |
| 319 | static MACHINE_CONFIG_START( ohpaipee, nbmj8900_stat | |
| 320 | 320 | |
| 321 | 321 | /* basic machine hardware */ |
| 322 | 322 | MCFG_CPU_ADD("maincpu", Z80, 20000000/4) /* 5.00 MHz ? */ |
| r10613 | r10614 | |
|---|---|---|
| 622 | 622 | MCFG_SCREEN_MODIFY("screen") |
| 623 | 623 | MCFG_SCREEN_VISIBLE_AREA(0*8, 38*8-1, 2*8, 32*8-1) |
| 624 | 624 | MCFG_SCREEN_UPDATE(soccer) |
| 625 | MCFG_GFXDECODE(soccer) | |
| 625 | MCFG_GFXDECODE(soccer) | |
| 626 | 626 | MACHINE_CONFIG_END |
| 627 | 627 | |
| 628 | 628 |
| r10613 | r10614 | |
|---|---|---|
| 306 | 306 | |
| 307 | 307 | /******************************************************************************/ |
| 308 | 308 | |
| 309 | /* local stuff */ | |
| 310 | static UINT8 *ram_8w, *work_ram; | |
| 311 | static int up_8w; | |
| 312 | 309 | |
| 313 | 310 | static WRITE8_HANDLER( up8w_w ) |
| 314 | 311 | { |
| 315 | up_8w = data & 1; | |
| 312 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 313 | state->up_8w = data & 1; | |
| 316 | 314 | } |
| 317 | 315 | |
| 318 | 316 | static READ8_HANDLER( ram_8w_r ) |
| 319 | 317 | { |
| 320 | if ( offset >= 0x400 && up_8w ) | |
| 321 | return ram_8w[offset]; | |
| 318 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 319 | if ( offset >= 0x400 && state->up_8w ) | |
| 320 | return state->ram_8w[offset]; | |
| 322 | 321 | |
| 323 | return ram_8w[offset & 0x3ff]; | |
| 322 | return state->ram_8w[offset & 0x3ff]; | |
| 324 | 323 | } |
| 325 | 324 | |
| 326 | 325 | static WRITE8_HANDLER( ram_8w_w ) |
| 327 | 326 | { |
| 328 | if ( offset >= 0x400 && up_8w ) | |
| 329 | ram_8w[offset] = data; | |
| 327 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 328 | if ( offset >= 0x400 && state->up_8w ) | |
| 329 | state->ram_8w[offset] = data; | |
| 330 | 330 | else |
| 331 | ram_8w[offset & 0x3ff] = data; | |
| 331 | state->ram_8w[offset & 0x3ff] = data; | |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | static WRITE8_HANDLER( sprite_dma_w ) |
| r10613 | r10614 | |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | /* Only used in single monitor bios */ |
| 341 | static UINT8 *timedata; | |
| 342 | 341 | |
| 343 | 342 | static WRITE8_HANDLER( time_w ) |
| 344 | 343 | { |
| 344 | playch10_state *state = space->machine->driver_data<playch10_state>(); | |
| 345 | 345 | if(data == 0xf) |
| 346 | 346 | data = 0; |
| 347 | 347 | |
| 348 | timedata[offset] = data; | |
| 348 | state->timedata[offset] = data; | |
| 349 | 349 | |
| 350 | popmessage("Time: %d%d%d%d",timedata[3],timedata[2],timedata[1],timedata[0]); | |
| 350 | popmessage("Time: %d%d%d%d",state->timedata[3],state->timedata[2],state->timedata[1],state->timedata[0]); | |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | static READ8_DEVICE_HANDLER( psg_4015_r ) |
| r10613 | r10614 | |
| 371 | 371 | static ADDRESS_MAP_START( bios_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 372 | 372 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| 373 | 373 | AM_RANGE(0x8000, 0x87ff) AM_RAM // 8V |
| 374 | AM_RANGE(0x8800, 0x8fff) AM_READWRITE(ram_8w_r, ram_8w_w) AM_BASE( | |
| 374 | AM_RANGE(0x8800, 0x8fff) AM_READWRITE(ram_8w_r, ram_8w_w) AM_BASE_MEMBER(playch10_state, ram_8w) // 8W | |
| 375 | 375 | AM_RANGE(0x9000, 0x97ff) AM_RAM_WRITE(playch10_videoram_w) AM_BASE_MEMBER(playch10_state, videoram) |
| 376 | 376 | AM_RANGE(0xc000, 0xdfff) AM_ROM |
| 377 | 377 | AM_RANGE(0xe000, 0xffff) AM_READWRITE(pc10_prot_r, pc10_prot_w) |
| r10613 | r10614 | |
| 391 | 391 | AM_RANGE(0x0a, 0x0a) AM_WRITE(pc10_PPURES_w) |
| 392 | 392 | AM_RANGE(0x0b, 0x0e) AM_WRITE(pc10_CARTSEL_w) |
| 393 | 393 | AM_RANGE(0x0f, 0x0f) AM_WRITE(up8w_w) |
| 394 | AM_RANGE(0x10, 0x13) AM_WRITE(time_w) AM_BASE( | |
| 394 | AM_RANGE(0x10, 0x13) AM_WRITE(time_w) AM_BASE_MEMBER(playch10_state, timedata) | |
| 395 | 395 | ADDRESS_MAP_END |
| 396 | 396 | |
| 397 | 397 | static ADDRESS_MAP_START( cart_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 398 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_MIRROR(0x1800) AM_BASE( | |
| 398 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_MIRROR(0x1800) AM_BASE_MEMBER(playch10_state, work_ram) | |
| 399 | 399 | AM_RANGE(0x2000, 0x3fff) AM_DEVREADWRITE("ppu", ppu2c0x_r, ppu2c0x_w) |
| 400 | 400 | AM_RANGE(0x4011, 0x4011) AM_DEVWRITE("dac", dac_w) |
| 401 | 401 | AM_RANGE(0x4000, 0x4013) AM_DEVREADWRITE("nes", nes_psg_r, nes_psg_w) |
| r10613 | r10614 | |
| 657 | 657 | GFXDECODE_END |
| 658 | 658 | |
| 659 | 659 | static INTERRUPT_GEN( playch10_interrupt ) { |
| 660 | playch10_state *state = device->machine->driver_data<playch10_state>(); | |
| 660 | 661 | |
| 661 | 662 | /* LS161A, Sheet 1 - bottom left of Z80 */ |
| 662 | if ( !pc10_dog_di && !pc10_nmi_enable ) { | |
| 663 | if ( !state->pc10_dog_di && !state->pc10_nmi_enable ) { | |
| 663 | 664 | cpu_set_input_line(device, INPUT_LINE_RESET, PULSE_LINE ); |
| 664 | 665 | } |
| 665 | 666 | |
| 666 | else if ( pc10_nmi_enable ) | |
| 667 | else if ( state->pc10_nmi_enable ) | |
| 667 | 668 | cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); |
| 668 | 669 | } |
| 669 | 670 |
| r10613 | r10614 | |
|---|---|---|
| 37 | 37 | : amiga_state(machine, config) { } |
| 38 | 38 | |
| 39 | 39 | UINT8 m_nvram[0x100]; |
| 40 | UINT8 prev_cia1_porta; | |
| 41 | UINT8 parallel_data; | |
| 42 | UINT8 nvram_address_latch; | |
| 43 | UINT8 nvram_data_latch; | |
| 40 | 44 | }; |
| 41 | 45 | |
| 42 | 46 | |
| r10613 | r10614 | |
| 52 | 56 | |
| 53 | 57 | /************************************* |
| 54 | 58 | * |
| 55 | * Globals | |
| 56 | * | |
| 57 | *************************************/ | |
| 58 | ||
| 59 | static UINT8 prev_cia1_porta; | |
| 60 | static UINT8 parallel_data; | |
| 61 | static UINT8 nvram_address_latch; | |
| 62 | static UINT8 nvram_data_latch; | |
| 63 | ||
| 64 | ||
| 65 | ||
| 66 | /************************************* | |
| 67 | * | |
| 68 | 59 | * Reset state |
| 69 | 60 | * |
| 70 | 61 | *************************************/ |
| 71 | 62 | |
| 72 | 63 | static void upscope_reset(running_machine *machine) |
| 73 | 64 | { |
| 74 | prev_cia1_porta = 0xff; | |
| 65 | upscope_state *state = machine->driver_data<upscope_state>(); | |
| 66 | state->prev_cia1_porta = 0xff; | |
| 75 | 67 | } |
| 76 | 68 | |
| 77 | 69 | |
| r10613 | r10614 | |
| 125 | 117 | |
| 126 | 118 | static WRITE8_DEVICE_HANDLER( upscope_cia_0_portb_w ) |
| 127 | 119 | { |
| 128 | parallel_data = data; | |
| 120 | upscope_state *state = device->machine->driver_data<upscope_state>(); | |
| 121 | state->parallel_data = data; | |
| 129 | 122 | } |
| 130 | 123 | |
| 131 | 124 | static READ8_DEVICE_HANDLER( upscope_cia_0_portb_r ) |
| 132 | 125 | { |
| 133 | return nvram_data_latch; | |
| 126 | upscope_state *state = device->machine->driver_data<upscope_state>(); | |
| 127 | return state->nvram_data_latch; | |
| 134 | 128 | } |
| 135 | 129 | |
| 136 | 130 | |
| r10613 | r10614 | |
| 152 | 146 | |
| 153 | 147 | static READ8_DEVICE_HANDLER( upscope_cia_1_porta_r ) |
| 154 | 148 | { |
| 155 | return 0xf8 | (prev_cia1_porta & 0x07); | |
| 149 | upscope_state *state = device->machine->driver_data<upscope_state>(); | |
| 150 | return 0xf8 | (state->prev_cia1_porta & 0x07); | |
| 156 | 151 | } |
| 157 | 152 | |
| 158 | 153 | static WRITE8_DEVICE_HANDLER( upscope_cia_1_porta_w ) |
| 159 | 154 | { |
| 155 | upscope_state *state = device->machine->driver_data<upscope_state>(); | |
| 160 | 156 | /* on a low transition of POUT, we latch stuff for the NVRAM */ |
| 161 | if ((prev_cia1_porta & 2) && !(data & 2)) | |
| 157 | if ((state->prev_cia1_porta & 2) && !(data & 2)) | |
| 162 | 158 | { |
| 163 | 159 | /* if SEL == 1 && BUSY == 0, we latch an address */ |
| 164 | 160 | if ((data & 5) == 4) |
| 165 | 161 | { |
| 166 | if (LOG_IO) logerror("Latch address: %02X\n", parallel_data); | |
| 167 | nvram_address_latch = parallel_data; | |
| 162 | if (LOG_IO) logerror("Latch address: %02X\n", state->parallel_data); | |
| 163 | state->nvram_address_latch = state->parallel_data; | |
| 168 | 164 | } |
| 169 | 165 | |
| 170 | 166 | /* if SEL == 1 && BUSY == 1, we write data to internal registers */ |
| 171 | 167 | else if ((data & 5) == 5) |
| 172 | 168 | { |
| 173 | switch (nvram_address_latch) | |
| 169 | switch (state->nvram_address_latch) | |
| 174 | 170 | { |
| 175 | 171 | case 0x01: |
| 176 | 172 | /* lamps: |
| r10613 | r10614 | |
| 195 | 191 | break; |
| 196 | 192 | |
| 197 | 193 | default: |
| 198 | logerror("Internal register (%d) = %02X\n", nvram_address_latch, parallel_data); | |
| 194 | logerror("Internal register (%d) = %02X\n", state->nvram_address_latch, state->parallel_data); | |
| 199 | 195 | break; |
| 200 | 196 | } |
| 201 | 197 | } |
| r10613 | r10614 | |
| 203 | 199 | /* if SEL == 0 && BUSY == 1, we write data to NVRAM */ |
| 204 | 200 | else if ((data & 5) == 1) |
| 205 | 201 | { |
| 206 | upscope_state *state = device->machine->driver_data<upscope_state>(); | |
| 207 | if (LOG_IO) logerror("NVRAM data write @ %02X = %02X\n", nvram_address_latch, parallel_data); | |
| 208 | state->m_nvram[nvram_address_latch] = parallel_data; | |
| 202 | if (LOG_IO) logerror("NVRAM data write @ %02X = %02X\n", state->nvram_address_latch, state->parallel_data); | |
| 203 | state->m_nvram[state->nvram_address_latch] = state->parallel_data; | |
| 209 | 204 | } |
| 210 | 205 | |
| 211 | 206 | /* if SEL == 0 && BUSY == 0, who knows? */ |
| r10613 | r10614 | |
| 216 | 211 | } |
| 217 | 212 | |
| 218 | 213 | /* on a low transition of BUSY, we latch stuff for reading */ |
| 219 | else if ((prev_cia1_porta & 1) && !(data & 1)) | |
| 214 | else if ((state->prev_cia1_porta & 1) && !(data & 1)) | |
| 220 | 215 | { |
| 221 | 216 | /* if SEL == 1, we read internal data registers */ |
| 222 | 217 | if (data & 4) |
| 223 | 218 | { |
| 224 | if (LOG_IO) logerror("Internal register (%d) read\n", nvram_address_latch); | |
| 225 | nvram_data_latch = (nvram_address_latch == 0) ? input_port_read(device->machine, "IO0") : 0xff; | |
| 219 | if (LOG_IO) logerror("Internal register (%d) read\n", state->nvram_address_latch); | |
| 220 | state->nvram_data_latch = (state->nvram_address_latch == 0) ? input_port_read(device->machine, "IO0") : 0xff; | |
| 226 | 221 | } |
| 227 | 222 | |
| 228 | 223 | /* if SEL == 0, we read NVRAM */ |
| 229 | 224 | else |
| 230 | 225 | { |
| 231 | upscope_state *state = device->machine->driver_data<upscope_state>(); | |
| 232 | nvram_data_latch = state->m_nvram[nvram_address_latch]; | |
| 233 | if (LOG_IO) logerror("NVRAM data read @ %02X = %02X\n", nvram_address_latch, nvram_data_latch); | |
| 226 | state->nvram_data_latch = state->m_nvram[state->nvram_address_latch]; | |
| 227 | if (LOG_IO) logerror("NVRAM data read @ %02X = %02X\n", state->nvram_address_latch, state->nvram_data_latch); | |
| 234 | 228 | } |
| 235 | 229 | } |
| 236 | 230 | |
| 237 | 231 | /* remember the previous value */ |
| 238 | prev_cia1_porta = data; | |
| 232 | state->prev_cia1_porta = data; | |
| 239 | 233 | } |
| 240 | 234 | |
| 241 | 235 |
| r10613 | r10614 | |
|---|---|---|
| 672 | 672 | |
| 673 | 673 | MCFG_CPU_MODIFY("maincpu") |
| 674 | 674 | MCFG_CPU_PROGRAM_MAP(fspider_map) |
| 675 | ||
| 675 | ||
| 676 | 676 | MCFG_SCREEN_MODIFY("screen") |
| 677 | 677 | MCFG_SCREEN_UPDATE(fspider) |
| 678 | 678 |
| r10613 | r10614 | |
|---|---|---|
| 41 | 41 | static ADDRESS_MAP_START( gomoku_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 42 | 42 | AM_RANGE(0x0000, 0x47ff) AM_ROM |
| 43 | 43 | AM_RANGE(0x4800, 0x4fff) AM_RAM |
| 44 | AM_RANGE(0x5000, 0x53ff) AM_RAM_WRITE(gomoku_videoram_w) AM_BASE(&gomoku_videoram) | |
| 45 | AM_RANGE(0x5400, 0x57ff) AM_RAM_WRITE(gomoku_colorram_w) AM_BASE(&gomoku_colorram) | |
| 46 | AM_RANGE(0x5800, 0x58ff) AM_RAM_WRITE(gomoku_bgram_w) AM_BASE(&gomoku_bgram) | |
| 44 | AM_RANGE(0x5000, 0x53ff) AM_RAM_WRITE(gomoku_videoram_w) AM_BASE_MEMBER(gomoku_state, videoram) | |
| 45 | AM_RANGE(0x5400, 0x57ff) AM_RAM_WRITE(gomoku_colorram_w) AM_BASE_MEMBER(gomoku_state, colorram) | |
| 46 | AM_RANGE(0x5800, 0x58ff) AM_RAM_WRITE(gomoku_bgram_w) AM_BASE_MEMBER(gomoku_state, bgram) | |
| 47 | 47 | AM_RANGE(0x6000, 0x601f) AM_DEVWRITE("gomoku", gomoku_sound1_w) |
| 48 | 48 | AM_RANGE(0x6800, 0x681f) AM_DEVWRITE("gomoku", gomoku_sound2_w) |
| 49 | 49 | AM_RANGE(0x7000, 0x7000) AM_WRITENOP |
| r10613 | r10614 | |
| 117 | 117 | GFXDECODE_END |
| 118 | 118 | |
| 119 | 119 | |
| 120 | static MACHINE_CONFIG_START( gomoku, | |
| 120 | static MACHINE_CONFIG_START( gomoku, gomoku_stat | |
| 121 | 121 | /* basic machine hardware */ |
| 122 | 122 | MCFG_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/12) /* 1.536 MHz ? */ |
| 123 | 123 | MCFG_CPU_PROGRAM_MAP(gomoku_map) |
| r10613 | r10614 | |
|---|---|---|
| 1 | 1 | /************************************************************************ |
| 2 | ||
| 3 | 'RISC PC' hardware | |
| 4 | ||
| 2 | 5 | See See Find Out [Icarus 1999] |
| 3 | 6 | Pang Pang Car [Icarus 1999] |
| 7 | Tetris Fighters [Sego Entertainment 2001] | |
| 4 | 8 | |
| 5 | 9 | driver by |
| 6 | 10 | Tomasz Slanina analog[at]op.pl |
| r10613 | r10614 | |
| 307 | 311 | PS7500timer1->adjust( attotime::never); |
| 308 | 312 | } |
| 309 | 313 | |
| 314 | typedef void (*ssfindo_speedup_func)(address_space *space); | |
| 315 | ssfindo_speedup_func ssfindo_speedup; | |
| 316 | ||
| 317 | static void ssfindo_speedups(address_space* space) | |
| 318 | { | |
| 319 | if (cpu_get_pc(space->cpu)==0x2d6c8) // ssfindo | |
| 320 | cpu_spinuntil_time(space->cpu, attotime::from_usec(20)); | |
| 321 | else if (cpu_get_pc(space->cpu)==0x2d6bc) // ssfindo | |
| 322 | cpu_spinuntil_time(space->cpu, attotime::from_usec(20)); | |
| 323 | } | |
| 324 | ||
| 325 | static void ppcar_speedups(address_space* space) | |
| 326 | { | |
| 327 | if (cpu_get_pc(space->cpu)==0x000bc8) // ppcar | |
| 328 | cpu_spinuntil_time(space->cpu, attotime::from_usec(20)); | |
| 329 | else if (cpu_get_pc(space->cpu)==0x000bbc) // ppcar | |
| 330 | cpu_spinuntil_time(space->cpu, attotime::from_usec(20)); | |
| 331 | } | |
| 332 | ||
| 333 | ||
| 310 | 334 | static READ32_HANDLER(PS7500_IO_r) |
| 311 | 335 | { |
| 312 | 336 | |
| r10613 | r10614 | |
| 332 | 356 | return (PS7500_IO[IRQSTA] & PS7500_IO[IRQMSKA]) | 0x80; |
| 333 | 357 | |
| 334 | 358 | case IOCR: //TODO: nINT1, OD[n] p.81 |
| 359 | if (ssfindo_speedup) ssfindo_speedup(space); | |
| 360 | //printf("IOCR %08x\n",cpu_get_pc(space->cpu)); | |
| 335 | 361 | return (input_port_read(space->machine, "PS7500") & 0x80) | 0x34 | 3; |
| 336 | 362 | |
| 337 | 363 | case VIDCR: |
| r10613 | r10614 | |
| 519 | 545 | AM_RANGE(0x10000000, 0x10ffffff) AM_RAM AM_BASE (&vram) |
| 520 | 546 | ADDRESS_MAP_END |
| 521 | 547 | |
| 548 | static ADDRESS_MAP_START( tetfight_map, ADDRESS_SPACE_PROGRAM, 32 ) | |
| 549 | AM_RANGE(0x00000000, 0x001fffff) AM_ROM AM_REGION("user1", 0) | |
| 550 | AM_RANGE(0x03200000, 0x032001ff) AM_READWRITE(PS7500_IO_r,PS7500_IO_w) | |
| 551 | AM_RANGE(0x033c0000, 0x033c0003) AM_READ(io_r) AM_WRITE(io_w) | |
| 552 | AM_RANGE(0x03400000, 0x03400003) AM_WRITE(FIFO_w) | |
| 553 | AM_RANGE(0x10000000, 0x10ffffff) AM_RAM AM_BASE (&vram) | |
| 554 | ADDRESS_MAP_END | |
| 522 | 555 | |
| 523 | 556 | static MACHINE_RESET( ssfindo ) |
| 524 | 557 | { |
| r10613 | r10614 | |
| 614 | 647 | MCFG_PALETTE_LENGTH(256) |
| 615 | 648 | MACHINE_CONFIG_END |
| 616 | 649 | |
| 617 | static MACHINE_CONFIG_ | |
| 650 | static MACHINE_CONFIG_DE | |
| 618 | 651 | |
| 619 | 652 | /* basic machine hardware */ |
| 620 | MCFG_CPU_ | |
| 653 | MCFG_CPU_MODIFY("maincpu" | |
| 621 | 654 | MCFG_CPU_PROGRAM_MAP(ppcar_map) |
| 655 | MACHINE_CONFIG_END | |
| 622 | 656 | |
| 623 | MCFG_CPU_VBLANK_INT("screen", ssfindo_interrupt) | |
| 624 | MCFG_MACHINE_RESET(ssfindo) | |
| 657 | static MACHINE_CONFIG_DERIVED( tetfight, ssfindo ) | |
| 625 | 658 | |
| 626 | ||
| 627 | MCFG_SCREEN_ADD("screen", RASTER) | |
| 628 | MCFG_SCREEN_REFRESH_RATE(60) | |
| 629 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
| 630 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 631 | MCFG_SCREEN_SIZE(320, 256) | |
| 632 | MCFG_SCREEN_VISIBLE_AREA(0, 319, 0, 239) | |
| 633 | MCFG_SCREEN_UPDATE(ssfindo) | |
| 634 | ||
| 635 | MCFG_PALETTE_LENGTH(256) | |
| 659 | /* basic machine hardware */ | |
| 660 | MCFG_CPU_MODIFY("maincpu") | |
| 661 | MCFG_CPU_PROGRAM_MAP(tetfight_map) | |
| 636 | 662 | MACHINE_CONFIG_END |
| 637 | 663 | |
| 638 | ||
| 639 | 664 | ROM_START( ssfindo ) |
| 640 | 665 | ROM_REGION(0x100000, "user1", 0 ) /* ARM 32 bit code */ |
| 641 | 666 | ROM_LOAD16_BYTE( "a.u28", 0x000000, 0x80000, CRC(c93edbd3) SHA1(9c703cfef49b59ccd5d68bab9bd59344bd18d67e) ) |
| r10613 | r10614 | |
| 660 | 685 | ROM_REGION(0x100000, "user6", 0 ) /* samples - same internal structure as qdsp samples */ |
| 661 | 686 | ROM_LOAD( "c.u12", 0x000000, 0x80000, CRC(d24b5e56) SHA1(d89983cf4b0a6e0e4137f3799bdbcfd72c7bebe4) ) |
| 662 | 687 | ROM_LOAD( "d.u11", 0x080000, 0x80000, CRC(c0fdd82a) SHA1(a633045e0f5c144b4e24e04fb9446522fdb222f4) ) |
| 663 | ||
| 664 | 688 | ROM_END |
| 665 | 689 | |
| 666 | 690 | ROM_START( ppcar ) |
| r10613 | r10614 | |
| 685 | 709 | /* none */ |
| 686 | 710 | ROM_END |
| 687 | 711 | |
| 712 | ROM_START( tetfight ) | |
| 713 | ROM_REGION(0x200000, "user1", 0 ) /* ARM 32 bit code */ | |
| 714 | ROM_LOAD( "u42", 0x000000, 0x200000, CRC(9101c4d2) SHA1(39da953de734e687ebbf976c821bf1017830f36c) ) | |
| 688 | 715 | |
| 689 | static DRIVER_INIT(ssfindo) | |
| 716 | ROM_REGION(0x1000000, "user2", ROMREGION_ERASEFF ) /* flash roms */ | |
| 717 | /* nothing? */ | |
| 718 | ||
| 719 | ROM_REGION(0x100, "user3", 0 ) /* eeprom */ | |
| 720 | ROM_LOAD( "u1", 0x00, 0x100, CRC(dd207b40) SHA1(6689d9dfa980bdfbd4e4e6cef7973e22ebbfe22e) ) | |
| 721 | ||
| 722 | ROM_REGION(0x10000, "user4", 0 ) /* qdsp code */ | |
| 723 | ROM_LOAD( "u12", 0x000000, 0x10000, CRC(49976f7b) SHA1(eba5b97b81736f3c184ae0c19f1b10c5ae250d51) ) // = e.u14 on ssfindo | |
| 724 | ||
| 725 | ROM_REGION(0x100000, "user5", ROMREGION_ERASE00 )/* qdsp samples */ | |
| 726 | // probably the same, but wasn't dumped | |
| 727 | //ROM_LOAD( "1008s-1.u16", 0x000000, 0x100000, CRC(9aef9545) SHA1(f23ef72c3e3667923768dfdd0c5b4951b23dcbcf) ) | |
| 728 | ||
| 729 | ROM_REGION(0x100000, "user6", 0 ) /* samples - same internal structure as qdsp samples */ | |
| 730 | ROM_LOAD( "u11", 0x000000, 0x80000, CRC(073050f6) SHA1(07f362f3ba468bde2341a99e6b26931d11459a92) ) | |
| 731 | ROM_LOAD( "u15", 0x080000, 0x80000, CRC(477f8089) SHA1(8084facb254d60da7983d628d5945d27b9494e65) ) | |
| 732 | ROM_END | |
| 733 | ||
| 734 | static DRIVER_INIT(common) | |
| 690 | 735 | { |
| 691 | f | |
| 736 | ssfindo_s | |
| 692 | 737 | PS7500timer0 = machine->scheduler().timer_alloc(FUNC(PS7500_Timer0_callback)); |
| 693 | 738 | PS7500timer1 = machine->scheduler().timer_alloc(FUNC(PS7500_Timer1_callback)); |
| 739 | ||
| 694 | 740 | } |
| 695 | 741 | |
| 742 | static DRIVER_INIT(ssfindo) | |
| 743 | { | |
| 744 | DRIVER_INIT_CALL(common); | |
| 745 | flashType=0; | |
| 746 | ssfindo_speedup = ssfindo_speedups; | |
| 747 | } | |
| 748 | ||
| 696 | 749 | static DRIVER_INIT(ppcar) |
| 697 | 750 | { |
| 751 | DRIVER_INIT_CALL(common); | |
| 698 | 752 | flashType=1; |
| 699 | PS7500timer0 = machine->scheduler().timer_alloc(FUNC(PS7500_Timer0_callback)); | |
| 700 | PS7500timer1 = machine->scheduler().timer_alloc(FUNC(PS7500_Timer1_callback)); | |
| 753 | ssfindo_speedup = ppcar_speedups; | |
| 701 | 754 | } |
| 702 | 755 | |
| 756 | static DRIVER_INIT(tetfight) | |
| 757 | { | |
| 758 | DRIVER_INIT_CALL(common); | |
| 759 | flashType=0; //? | |
| 760 | } | |
| 761 | ||
| 703 | 762 | GAME( 1999, ssfindo, 0, ssfindo, ssfindo, ssfindo, ROT0, "Icarus", "See See Find Out", GAME_NO_SOUND ) |
| 704 | 763 | GAME( 1999, ppcar, 0, ppcar, ppcar, ppcar, ROT0, "Icarus", "Pang Pang Car", GAME_NO_SOUND ) |
| 764 | GAME( 2001, tetfight,0, tetfight, ssfindo, tetfight,ROT0, "Sego", "Tetris Fighters", GAME_NO_SOUND|GAME_NOT_WORKING ) |
| r10613 | r10614 | |
|---|---|---|
| 951 | 951 | /* video hardware */ |
| 952 | 952 | MCFG_SCREEN_MODIFY("screen") |
| 953 | 953 | MCFG_SCREEN_UPDATE(montecar) |
| 954 | ||
| 954 | ||
| 955 | 955 | MCFG_VIDEO_START(montecar) |
| 956 | 956 | MCFG_GFXDECODE(montecar) |
| 957 | 957 | |
| r10613 | r10614 | |
| 1042 | 1042 | |
| 1043 | 1043 | |
| 1044 | 1044 | GAME( 1977, superbug, 0, superbug, superbug, 0, ROT270, "Atari", "Super Bug", 0 ) |
| 1045 | GAME( 1978, firetrk, 0, firetrk, firetrk, 0, ROT270, "Atari", "Fire Truck", 0 ) | |
| 1045 | GAME( 1978, firetrk, 0, firetrk, firetrk, 0, ROT270, "Atari", "Fire Truck / Smokey Joe", 0 ) | |
| 1046 | 1046 | GAME( 1979, montecar, 0, montecar, montecar, 0, ROT270, "Atari", "Monte Carlo", 0 ) |
| r10613 | r10614 | |
|---|---|---|
| 228 | 228 | megadrive_vdp_palette_lookup_shadow[offset] = (tmpb) | (tmpg << 5) | (tmpr << 10); |
| 229 | 229 | |
| 230 | 230 | // how is it calculated on c2? |
| 231 | tmpr = tmpr | 0x10; | |
| 232 | tmpg = tmpg | 0x10; | |
| 231 | tmpr = tmpr | 0x10; | |
| 232 | tmpg = tmpg | 0x10; | |
| 233 | 233 | tmpb = tmpb | 0x10; |
| 234 | 234 | megadrive_vdp_palette_lookup_highlight[offset] = (tmpb) | (tmpg << 5) | (tmpr << 10); |
| 235 | 235 | } |
| r10613 | r10614 | |
|---|---|---|
| 104 | 104 | #include "cpu/m6805/m6805.h" |
| 105 | 105 | #include "sound/ay8910.h" |
| 106 | 106 | #include "sound/msm5205.h" |
| 107 | ||
| 108 | 107 | #include "includes/tubep.h" |
| 109 | 108 | |
| 110 | /* Global variables */ | |
| 111 | static UINT8 sound_latch; | |
| 112 | static UINT8 ls74 = 0; | |
| 113 | static UINT8 ls377 = 0; | |
| 114 | 109 | |
| 115 | static emu_timer *interrupt_timer; | |
| 116 | ||
| 117 | ||
| 118 | static int curr_scanline=0; | |
| 119 | ||
| 120 | ||
| 121 | ||
| 122 | ||
| 123 | 110 | /************************************* |
| 124 | 111 | * |
| 125 | 112 | * Main CPU on main PCB |
| r10613 | r10614 | |
| 160 | 147 | static ADDRESS_MAP_START( tubep_main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 161 | 148 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 162 | 149 | AM_RANGE(0xa000, 0xa7ff) AM_RAM |
| 163 | AM_RANGE(0xc000, 0xc7ff) AM_WRITE(tubep_textram_w) AM_BASE( | |
| 150 | AM_RANGE(0xc000, 0xc7ff) AM_WRITE(tubep_textram_w) AM_BASE_MEMBER( | |
| 164 | 151 | AM_RANGE(0xe000, 0xe7ff) AM_WRITEONLY AM_SHARE("share1") |
| 165 | 152 | AM_RANGE(0xe800, 0xebff) AM_WRITEONLY AM_SHARE("share4") /* row of 8 x 2147 RAMs on main PCB */ |
| 166 | 153 | ADDRESS_MAP_END |
| r10613 | r10614 | |
| 168 | 155 | |
| 169 | 156 | static WRITE8_HANDLER( main_cpu_irq_line_clear_w ) |
| 170 | 157 | { |
| 158 | tubep_state *state = space->machine->driver_data<tubep_state>(); | |
| 171 | 159 | cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); |
| 172 | logerror("CPU#0 VBLANK int clear at scanline=%3i\n", curr_scanline); | |
| 160 | logerror("CPU#0 VBLANK int clear at scanline=%3i\n", state->curr_scanline); | |
| 173 | 161 | return; |
| 174 | 162 | } |
| 175 | 163 | |
| 176 | 164 | |
| 177 | 165 | static WRITE8_HANDLER( tubep_soundlatch_w ) |
| 178 | 166 | { |
| 179 | sound_latch = (data&0x7f) | 0x80; | |
| 167 | tubep_state *state = space->machine->driver_data<tubep_state>(); | |
| 168 | state->sound_latch = (data&0x7f) | 0x80; | |
| 180 | 169 | } |
| 181 | 170 | |
| 182 | 171 | static ADDRESS_MAP_START( tubep_main_portmap, ADDRESS_SPACE_IO, 8 ) |
| r10613 | r10614 | |
| 204 | 193 | |
| 205 | 194 | static WRITE8_HANDLER( second_cpu_irq_line_clear_w ) |
| 206 | 195 | { |
| 196 | tubep_state *state = space->machine->driver_data<tubep_state>(); | |
| 207 | 197 | cputag_set_input_line(space->machine, "slave", 0, CLEAR_LINE); |
| 208 | logerror("CPU#1 VBLANK int clear at scanline=%3i\n", curr_scanline); | |
| 198 | logerror("CPU#1 VBLANK int clear at scanline=%3i\n", state->curr_scanline); | |
| 209 | 199 | return; |
| 210 | 200 | } |
| 211 | 201 | |
| r10613 | r10614 | |
| 215 | 205 | AM_RANGE(0xa000, 0xa000) AM_WRITE(tubep_background_a000_w) |
| 216 | 206 | AM_RANGE(0xc000, 0xc000) AM_WRITE(tubep_background_c000_w) |
| 217 | 207 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("share1") /* 6116 #1 */ |
| 218 | AM_RANGE(0xe800, 0xebff) AM_WRITEONLY AM_SHARE("share4") AM_BASE( | |
| 208 | AM_RANGE(0xe800, 0xebff) AM_WRITEONLY AM_SHARE("share4") AM_BASE_MEMBER( | |
| 219 | 209 | AM_RANGE(0xf000, 0xf3ff) AM_WRITEONLY AM_SHARE("share3") /* sprites color lookup table */ |
| 220 | 210 | AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("share2") /* program copies here part of shared ram ?? */ |
| 221 | 211 | ADDRESS_MAP_END |
| r10613 | r10614 | |
| 229 | 219 | |
| 230 | 220 | static READ8_HANDLER( tubep_soundlatch_r ) |
| 231 | 221 | { |
| 222 | tubep_state *state = space->machine->driver_data<tubep_state>(); | |
| 232 | 223 | int res; |
| 233 | 224 | |
| 234 | res = sound_latch; | |
| 235 | sound_latch = 0; /* "=0" ???? or "&= 0x7f" ????? works either way */ | |
| 225 | res = state->sound_latch; | |
| 226 | state->sound_latch = 0; /* "=0" ???? or "&= 0x7f" ????? works either way */ | |
| 236 | 227 | |
| 237 | 228 | return res; |
| 238 | 229 | } |
| r10613 | r10614 | |
| 269 | 260 | |
| 270 | 261 | static TIMER_CALLBACK( tubep_scanline_callback ) |
| 271 | 262 | { |
| 263 | tubep_state *state = machine->driver_data<tubep_state>(); | |
| 272 | 264 | int scanline = param; |
| 273 | 265 | |
| 274 | curr_scanline = scanline;//for debugging | |
| 266 | state->curr_scanline = scanline;//for debugging | |
| 275 | 267 | |
| 276 | 268 | /* CPU #0 interrupt */ |
| 277 | 269 | /* activates at the start of VBLANK signal which happens at the beginning of scaline number 240 */ |
| r10613 | r10614 | |
| 296 | 288 | if (scanline == 16) |
| 297 | 289 | { |
| 298 | 290 | logerror("/nmi CPU#3\n"); |
| 299 | tubep_vblank_end(); /* switch buffered sprite RAM page */ | |
| 291 | tubep_vblank_end(machine); /* switch buffered sprite RAM state->page */ | |
| 300 | 292 | cputag_set_input_line(machine, "mcu", INPUT_LINE_NMI, ASSERT_LINE); |
| 301 | 293 | } |
| 302 | 294 | /* CPU #3 MS2010-A NMI */ |
| r10613 | r10614 | |
| 325 | 317 | if (scanline >= 264) |
| 326 | 318 | scanline = 0; |
| 327 | 319 | |
| 328 | interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); | |
| 320 | state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); | |
| 329 | 321 | } |
| 330 | 322 | |
| 331 | 323 | |
| r10613 | r10614 | |
| 338 | 330 | |
| 339 | 331 | static void tubep_setup_save_state(running_machine *machine) |
| 340 | 332 | { |
| 333 | tubep_state *state = machine->driver_data<tubep_state>(); | |
| 341 | 334 | /* Set up save state */ |
| 342 | state_save_register_global(machine, sound_latch); | |
| 343 | state_save_register_global(machine, ls74); | |
| 344 | state_save_register_global(machine, ls377); | |
| 335 | state_save_register_global(machine, state->sound_latch); | |
| 336 | state_save_register_global(machine, state->ls74); | |
| 337 | state_save_register_global(machine, state->ls377); | |
| 345 | 338 | } |
| 346 | 339 | |
| 347 | 340 | |
| 348 | 341 | |
| 349 | 342 | static MACHINE_START( tubep ) |
| 350 | 343 | { |
| 344 | tubep_state *state = machine->driver_data<tubep_state>(); | |
| 351 | 345 | /* Create interrupt timer */ |
| 352 | interrupt_timer = machine->scheduler().timer_alloc(FUNC(tubep_scanline_callback)); | |
| 346 | state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(tubep_scanline_callback)); | |
| 353 | 347 | |
| 354 | 348 | tubep_setup_save_state(machine); |
| 355 | 349 | } |
| r10613 | r10614 | |
| 357 | 351 | |
| 358 | 352 | static MACHINE_RESET( tubep ) |
| 359 | 353 | { |
| 360 | interrupt_timer->adjust(machine->primary_screen->time_until_pos(0)); | |
| 354 | tubep_state *state = machine->driver_data<tubep_state>(); | |
| 355 | state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(0)); | |
| 361 | 356 | } |
| 362 | 357 | |
| 363 | 358 | |
| r10613 | r10614 | |
| 370 | 365 | |
| 371 | 366 | /* MS2010-A CPU (equivalent to NSC8105 with one new opcode: 0xec) on graphics PCB */ |
| 372 | 367 | static ADDRESS_MAP_START( nsc_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 373 | AM_RANGE(0x0000, 0x03ff) AM_RAM AM_SHARE("share3") AM_BASE( | |
| 368 | AM_RANGE(0x0000, 0x03ff) AM_RAM AM_SHARE("share3") AM_BASE_MEMBER( | |
| 374 | 369 | AM_RANGE(0x0800, 0x0fff) AM_RAM AM_SHARE("share2") |
| 375 | 370 | AM_RANGE(0x2000, 0x2009) AM_WRITE(tubep_sprite_control_w) |
| 376 | 371 | AM_RANGE(0x200a, 0x200b) AM_WRITENOP /* not used by the games - perhaps designed for debugging */ |
| r10613 | r10614 | |
| 404 | 399 | |
| 405 | 400 | static WRITE8_HANDLER( rjammer_soundlatch_w ) |
| 406 | 401 | { |
| 407 | sound_latch = data; | |
| 402 | tubep_state *state = space->machine->driver_data<tubep_state>(); | |
| 403 | state->sound_latch = data; | |
| 408 | 404 | cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE); |
| 409 | 405 | } |
| 410 | 406 | |
| r10613 | r10614 | |
| 412 | 408 | static ADDRESS_MAP_START( rjammer_main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 413 | 409 | AM_RANGE(0x0000, 0x9fff) AM_ROM |
| 414 | 410 | AM_RANGE(0xa000, 0xa7ff) AM_RAM /* MB8416 SRAM on daughterboard on main PCB (there are two SRAMs, this is the one on the left) */ |
| 415 | AM_RANGE(0xc000, 0xc7ff) AM_WRITE(tubep_textram_w) AM_BASE( | |
| 411 | AM_RANGE(0xc000, 0xc7ff) AM_WRITE(tubep_textram_w) AM_BASE_MEMBER( | |
| 416 | 412 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("share1") /* MB8416 SRAM on daughterboard (the one on the right) */ |
| 417 | 413 | ADDRESS_MAP_END |
| 418 | 414 | |
| r10613 | r10614 | |
| 436 | 432 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 437 | 433 | AM_RANGE(0xa000, 0xa7ff) AM_RAM /* M5M5117P @21G */ |
| 438 | 434 | AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("share1") /* MB8416 on daughterboard (the one on the right) */ |
| 439 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE( | |
| 435 | AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE_MEMBER(tubep_state, rjammer_backgroundram)/* M5M5117P @19B (background) */ | |
| 440 | 436 | AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("share2") |
| 441 | 437 | ADDRESS_MAP_END |
| 442 | 438 | |
| r10613 | r10614 | |
| 450 | 446 | |
| 451 | 447 | static TIMER_CALLBACK( rjammer_scanline_callback ) |
| 452 | 448 | { |
| 449 | tubep_state *state = machine->driver_data<tubep_state>(); | |
| 453 | 450 | int scanline = param; |
| 454 | 451 | |
| 455 | curr_scanline = scanline;//for debugging | |
| 452 | state->curr_scanline = scanline;//for debugging | |
| 456 | 453 | |
| 457 | 454 | /* CPU #0 interrupt */ |
| 458 | 455 | /* activates at the start of VBLANK signal which happens at the beginning of scaline number 240 */ |
| r10613 | r10614 | |
| 477 | 474 | if (scanline == 16) |
| 478 | 475 | { |
| 479 | 476 | logerror("/nmi CPU#3\n"); |
| 480 | tubep_vblank_end(); /* switch buffered sprite RAM page */ | |
| 477 | tubep_vblank_end(machine); /* switch buffered sprite RAM state->page */ | |
| 481 | 478 | cputag_set_input_line(machine, "mcu", INPUT_LINE_NMI, ASSERT_LINE); |
| 482 | 479 | } |
| 483 | 480 | /* CPU #3 MS2010-A NMI */ |
| r10613 | r10614 | |
| 505 | 502 | if (scanline >= 264) |
| 506 | 503 | scanline = 0; |
| 507 | 504 | |
| 508 | interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); | |
| 505 | state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline); | |
| 509 | 506 | } |
| 510 | 507 | |
| 511 | 508 | |
| 512 | 509 | static MACHINE_START( rjammer ) |
| 513 | 510 | { |
| 511 | tubep_state *state = machine->driver_data<tubep_state>(); | |
| 514 | 512 | /* Create interrupt timer */ |
| 515 | interrupt_timer = machine->scheduler().timer_alloc(FUNC(rjammer_scanline_callback)); | |
| 513 | state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(rjammer_scanline_callback)); | |
| 516 | 514 | |
| 517 | 515 | tubep_setup_save_state(machine); |
| 518 | 516 | } |
| 519 | 517 | |
| 520 | 518 | static MACHINE_RESET( rjammer ) |
| 521 | 519 | { |
| 522 | interrupt_timer->adjust(machine->primary_screen->time_until_pos(0)); | |
| 520 | tubep_state *state = machine->driver_data<tubep_state>(); | |
| 521 | state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(0)); | |
| 523 | 522 | } |
| 524 | 523 | |
| 525 | 524 | |
| r10613 | r10614 | |
| 532 | 531 | |
| 533 | 532 | static READ8_HANDLER( rjammer_soundlatch_r ) |
| 534 | 533 | { |
| 535 | int res = sound_latch; | |
| 534 | tubep_state *state = space->machine->driver_data<tubep_state>(); | |
| 535 | int res = state->sound_latch; | |
| 536 | 536 | return res; |
| 537 | 537 | } |
| 538 | 538 | |
| r10613 | r10614 | |
| 562 | 562 | |
| 563 | 563 | static void rjammer_adpcm_vck (device_t *device) |
| 564 | 564 | { |
| 565 | ls74 = (ls74 + 1) & 1; | |
| 565 | tubep_state *state = device->machine->driver_data<tubep_state>(); | |
| 566 | state->ls74 = (state->ls74 + 1) & 1; | |
| 566 | 567 | |
| 567 | if (ls74 == 1) | |
| 568 | if (state->ls74 == 1) | |
| 568 | 569 | { |
| 569 | msm5205_data_w(device, (ls377 >> 0) & 15 ); | |
| 570 | msm5205_data_w(device, (state->ls377 >> 0) & 15 ); | |
| 570 | 571 | cputag_set_input_line(device->machine, "soundcpu", 0, ASSERT_LINE ); |
| 571 | 572 | } |
| 572 | 573 | else |
| 573 | 574 | { |
| 574 | msm5205_data_w(device, (ls377 >> 4) & 15 ); | |
| 575 | msm5205_data_w(device, (state->ls377 >> 4) & 15 ); | |
| 575 | 576 | } |
| 576 | 577 | |
| 577 | 578 | } |
| r10613 | r10614 | |
| 579 | 580 | |
| 580 | 581 | static WRITE8_HANDLER( rjammer_voice_input_w ) |
| 581 | 582 | { |
| 583 | tubep_state *state = space->machine->driver_data<tubep_state>(); | |
| 582 | 584 | /* 8 bits of adpcm data for MSM5205 */ |
| 583 | 585 | /* need to buffer the data, and switch two nibbles on two following interrupts*/ |
| 584 | 586 | |
| 585 | ls377 = data; | |
| 587 | state->ls377 = data; | |
| 586 | 588 | |
| 587 | 589 | |
| 588 | 590 | /* NOTE: game resets interrupt line on ANY access to ANY I/O port. |
| r10613 | r10614 | |
| 892 | 894 | * |
| 893 | 895 | *************************************/ |
| 894 | 896 | |
| 895 | static MACHINE_CONFIG_START( tubep, | |
| 897 | static MACHINE_CONFIG_START( tubep, tub | |
| 896 | 898 | |
| 897 | 899 | /* basic machine hardware */ |
| 898 | 900 | MCFG_CPU_ADD("maincpu",Z80,16000000 / 4) /* 4 MHz */ |
| r10613 | r10614 | |
| 954 | 956 | MACHINE_CONFIG_END |
| 955 | 957 | |
| 956 | 958 | |
| 957 | static MACHINE_CONFIG_START( rjammer, | |
| 959 | static MACHINE_CONFIG_START( rjammer, tub | |
| 958 | 960 | |
| 959 | 961 | /* basic machine hardware */ |
| 960 | 962 | MCFG_CPU_ADD("maincpu",Z80,16000000 / 4) /* 4 MHz */ |
| r10613 | r10614 | |
|---|---|---|
| 150 | 150 | #include "includes/exidy.h" |
| 151 | 151 | |
| 152 | 152 | |
| 153 | static UINT8 last_dial; | |
| 154 | ||
| 155 | ||
| 156 | ||
| 157 | 153 | /************************************* |
| 158 | 154 | * |
| 159 | 155 | * Special Teeter Torture input |
| r10613 | r10614 | |
| 162 | 158 | |
| 163 | 159 | static CUSTOM_INPUT( teetert_input_r ) |
| 164 | 160 | { |
| 161 | exidy_state *state = field->port->machine->driver_data<exidy_state>(); | |
| 165 | 162 | UINT8 dial = input_port_read(field->port->machine, "DIAL"); |
| 166 | 163 | int result = 0; |
| 167 | 164 | |
| 168 | result = (dial != last_dial) << 4; | |
| 165 | result = (dial != state->last_dial) << 4; | |
| 169 | 166 | if (result != 0) |
| 170 | 167 | { |
| 171 | if (((dial - last_dial) & 0xff) < 0x80) | |
| 168 | if (((dial - state->last_dial) & 0xff) < 0x80) | |
| 172 | 169 | { |
| 173 | 170 | result |= 1; |
| 174 | last_dial++; | |
| 171 | state->last_dial++; | |
| 175 | 172 | } |
| 176 | 173 | else |
| 177 | last_dial--; | |
| 174 | state->last_dial--; | |
| 178 | 175 | } |
| 179 | 176 | |
| 180 | 177 | return result; |
| r10613 | r10614 | |
| 207 | 204 | |
| 208 | 205 | static ADDRESS_MAP_START( exidy_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 209 | 206 | AM_RANGE(0x0000, 0x03ff) AM_RAM |
| 210 | AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&exidy_videoram) | |
| 211 | AM_RANGE(0x5000, 0x5000) AM_MIRROR(0x003f) AM_WRITEONLY AM_BASE(&exidy_sprite1_xpos) | |
| 212 | AM_RANGE(0x5040, 0x5040) AM_MIRROR(0x003f) AM_WRITEONLY AM_BASE(&exidy_sprite1_ypos) | |
| 213 | AM_RANGE(0x5080, 0x5080) AM_MIRROR(0x003f) AM_WRITEONLY AM_BASE(&exidy_sprite2_xpos) | |
| 214 | AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0x003f) AM_WRITEONLY AM_BASE(&exidy_sprite2_ypos) | |
| 207 | AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0400) AM_RAM AM_BASE_MEMBER(exidy_state, videoram) | |
| 208 | AM_RANGE(0x5000, 0x5000) AM_MIRROR(0x003f) AM_WRITEONLY AM_BASE_MEMBER(exidy_state, sprite1_xpos) | |
| 209 | AM_RANGE(0x5040, 0x5040) AM_MIRROR(0x003f) AM_WRITEONLY AM_BASE_MEMBER(exidy_state, sprite1_ypos) | |
| 210 | AM_RANGE(0x5080, 0x5080) AM_MIRROR(0x003f) AM_WRITEONLY AM_BASE_MEMBER(exidy_state, sprite2_xpos) | |
| 211 | AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0x003f) AM_WRITEONLY AM_BASE_MEMBER(exidy_state, sprite2_ypos) | |
| 215 | 212 | AM_RANGE(0x5100, 0x5100) AM_MIRROR(0x00fc) AM_READ_PORT("DSW") |
| 216 | AM_RANGE(0x5100, 0x5100) AM_MIRROR(0x00fc) AM_WRITEONLY AM_BASE( | |
| 213 | AM_RANGE(0x5100, 0x5100) AM_MIRROR(0x00fc) AM_WRITEONLY AM_BASE_MEMBER( | |
| 217 | 214 | AM_RANGE(0x5101, 0x5101) AM_MIRROR(0x00fc) AM_READ_PORT("IN0") |
| 218 | AM_RANGE(0x5101, 0x5101) AM_MIRROR(0x00fc) AM_WRITEONLY AM_BASE( | |
| 215 | AM_RANGE(0x5101, 0x5101) AM_MIRROR(0x00fc) AM_WRITEONLY AM_BASE_MEMBER( | |
| 219 | 216 | AM_RANGE(0x5103, 0x5103) AM_MIRROR(0x00fc) AM_READ(exidy_interrupt_r) |
| 220 | AM_RANGE(0x5210, 0x5212) AM_WRITEONLY AM_BASE( | |
| 217 | AM_RANGE(0x5210, 0x5212) AM_WRITEONLY AM_BASE_MEMBER( | |
| 221 | 218 | AM_RANGE(0x5213, 0x5213) AM_READ_PORT("IN2") |
| 222 | 219 | ADDRESS_MAP_END |
| 223 | 220 | |
| 224 | 221 | |
| 225 | 222 | static ADDRESS_MAP_START( sidetrac_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 226 | 223 | AM_RANGE(0x0800, 0x3fff) AM_ROM |
| 227 | AM_RANGE(0x4800, 0x4fff) AM_ROM AM_BASE( | |
| 224 | AM_RANGE(0x4800, 0x4fff) AM_ROM AM_BASE_MEMBER( | |
| 228 | 225 | AM_RANGE(0x5200, 0x5200) AM_WRITE(targ_audio_1_w) |
| 229 | 226 | AM_RANGE(0x5201, 0x5201) AM_WRITE(spectar_audio_2_w) |
| 230 | 227 | AM_RANGE(0xff00, 0xffff) AM_ROM AM_REGION("maincpu", 0x3f00) |
| r10613 | r10614 | |
| 234 | 231 | |
| 235 | 232 | static ADDRESS_MAP_START( targ_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 236 | 233 | AM_RANGE(0x0800, 0x3fff) AM_ROM |
| 237 | AM_RANGE(0x4800, 0x4fff) AM_RAM AM_BASE( | |
| 234 | AM_RANGE(0x4800, 0x4fff) AM_RAM AM_BASE_MEMBER( | |
| 238 | 235 | AM_RANGE(0x5200, 0x5200) AM_WRITE(targ_audio_1_w) |
| 239 | 236 | AM_RANGE(0x5201, 0x5201) AM_WRITE(targ_audio_2_w) |
| 240 | 237 | AM_RANGE(0xff00, 0xffff) AM_ROM AM_REGION("maincpu", 0x3f00) |
| r10613 | r10614 | |
| 244 | 241 | |
| 245 | 242 | static ADDRESS_MAP_START( spectar_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 246 | 243 | AM_RANGE(0x0800, 0x3fff) AM_ROM |
| 247 | AM_RANGE(0x4800, 0x4fff) AM_RAM AM_BASE( | |
| 244 | AM_RANGE(0x4800, 0x4fff) AM_RAM AM_BASE_MEMBER( | |
| 248 | 245 | AM_RANGE(0x5200, 0x5200) AM_WRITE(targ_audio_1_w) |
| 249 | 246 | AM_RANGE(0x5201, 0x5201) AM_WRITE(spectar_audio_2_w) |
| 250 | 247 | AM_RANGE(0xff00, 0xffff) AM_ROM AM_REGION("maincpu", 0x3f00) |
| r10613 | r10614 | |
| 255 | 252 | static ADDRESS_MAP_START( rallys_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 256 | 253 | AM_RANGE(0x0000, 0x03ff) AM_RAM |
| 257 | 254 | AM_RANGE(0x0800, 0x3fff) AM_ROM |
| 258 | AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&exidy_videoram) | |
| 259 | AM_RANGE(0x4800, 0x4fff) AM_RAM AM_BASE(&exidy_characterram) | |
| 260 | AM_RANGE(0x5000, 0x5000) AM_WRITEONLY AM_BASE(&exidy_sprite1_xpos) | |
| 261 | AM_RANGE(0x5001, 0x5001) AM_WRITEONLY AM_BASE(&exidy_sprite1_ypos) | |
| 255 | AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0400) AM_RAM AM_BASE_MEMBER(exidy_state, videoram) | |
| 256 | AM_RANGE(0x4800, 0x4fff) AM_RAM AM_BASE_MEMBER(exidy_state, characterram) | |
| 257 | AM_RANGE(0x5000, 0x5000) AM_WRITEONLY AM_BASE_MEMBER(exidy_state, sprite1_xpos) | |
| 258 | AM_RANGE(0x5001, 0x5001) AM_WRITEONLY AM_BASE_MEMBER(exidy_state, sprite1_ypos) | |
| 262 | 259 | AM_RANGE(0x5100, 0x5100) AM_MIRROR(0x00fc) AM_READ_PORT("DSW") |
| 263 | AM_RANGE(0x5100, 0x5100) AM_MIRROR(0x00fc) AM_WRITEONLY AM_BASE( | |
| 260 | AM_RANGE(0x5100, 0x5100) AM_MIRROR(0x00fc) AM_WRITEONLY AM_BASE_MEMBER( | |
| 264 | 261 | AM_RANGE(0x5101, 0x5101) AM_MIRROR(0x00fc) AM_READ_PORT("IN0") |
| 265 | AM_RANGE(0x5101, 0x5101) AM_MIRROR(0x00fc) AM_WRITEONLY AM_BASE( | |
| 262 | AM_RANGE(0x5101, 0x5101) AM_MIRROR(0x00fc) AM_WRITEONLY AM_BASE_MEMBER( | |
| 266 | 263 | AM_RANGE(0x5103, 0x5103) AM_MIRROR(0x00fc) AM_READ(exidy_interrupt_r) |
| 267 | 264 | AM_RANGE(0x5200, 0x5200) AM_WRITE(targ_audio_1_w) |
| 268 | 265 | AM_RANGE(0x5201, 0x5201) AM_WRITE(spectar_audio_2_w) |
| 269 | AM_RANGE(0x5210, 0x5212) AM_WRITEONLY AM_BASE( | |
| 266 | AM_RANGE(0x5210, 0x5212) AM_WRITEONLY AM_BASE_MEMBER( | |
| 270 | 267 | AM_RANGE(0x5213, 0x5213) AM_READ_PORT("IN2") |
| 271 | AM_RANGE(0x5300, 0x5300) AM_WRITEONLY AM_BASE(&exidy_sprite2_xpos) | |
| 272 | AM_RANGE(0x5301, 0x5301) AM_WRITEONLY AM_BASE(&exidy_sprite2_ypos) | |
| 268 | AM_RANGE(0x5300, 0x5300) AM_WRITEONLY AM_BASE_MEMBER(exidy_state, sprite2_xpos) | |
| 269 | AM_RANGE(0x5301, 0x5301) AM_WRITEONLY AM_BASE_MEMBER(exidy_state, sprite2_ypos) | |
| 273 | 270 | AM_RANGE(0xff00, 0xffff) AM_ROM AM_REGION("maincpu", 0x3f00) |
| 274 | 271 | ADDRESS_MAP_END |
| 275 | 272 | |
| 276 | 273 | |
| 277 | 274 | static ADDRESS_MAP_START( venture_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 278 | AM_RANGE(0x4800, 0x4fff) AM_RAM AM_BASE( | |
| 275 | AM_RANGE(0x4800, 0x4fff) AM_RAM AM_BASE_MEMBER( | |
| 279 | 276 | AM_RANGE(0x5200, 0x520f) AM_DEVREADWRITE("pia0", pia6821_r, pia6821_w) |
| 280 | 277 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 281 | 278 | AM_IMPORT_FROM(exidy_map) |
| r10613 | r10614 | |
| 285 | 282 | static ADDRESS_MAP_START( pepper2_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 286 | 283 | AM_RANGE(0x4800, 0x4fff) AM_NOP |
| 287 | 284 | AM_RANGE(0x5200, 0x520f) AM_DEVREADWRITE("pia0", pia6821_r, pia6821_w) |
| 288 | AM_RANGE(0x6000, 0x6fff) AM_RAM AM_BASE( | |
| 285 | AM_RANGE(0x6000, 0x6fff) AM_RAM AM_BASE_MEMBER( | |
| 289 | 286 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 290 | 287 | AM_IMPORT_FROM(exidy_map) |
| 291 | 288 | ADDRESS_MAP_END |
| r10613 | r10614 | |
| 299 | 296 | AM_RANGE(0x2000, 0x3fff) AM_ROMBANK("bank1") |
| 300 | 297 | AM_RANGE(0x5200, 0x520f) AM_DEVREADWRITE("pia0", pia6821_r, pia6821_w) |
| 301 | 298 | AM_RANGE(0x5213, 0x5217) AM_WRITENOP /* empty control lines on color/sound board */ |
| 302 | AM_RANGE(0x6000, 0x6fff) AM_RAM AM_BASE( | |
| 299 | AM_RANGE(0x6000, 0x6fff) AM_RAM AM_BASE_MEMBER( | |
| 303 | 300 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 304 | 301 | AM_IMPORT_FROM(exidy_map) |
| 305 | 302 | ADDRESS_MAP_END |
| r10613 | r10614 | |
| 798 | 795 | |
| 799 | 796 | static MACHINE_START( teetert ) |
| 800 | 797 | { |
| 801 | state_save_register_global(machine, last_dial); | |
| 798 | exidy_state *state = machine->driver_data<exidy_state>(); | |
| 799 | state_save_register_global(machine, state->last_dial); | |
| 802 | 800 | } |
| 803 | 801 | |
| 804 | 802 | /************************************* |
| r10613 | r10614 | |
| 807 | 805 | * |
| 808 | 806 | *************************************/ |
| 809 | 807 | |
| 810 | static MACHINE_CONFIG_START( base, | |
| 808 | static MACHINE_CONFIG_START( base, | |
| 811 | 809 | |
| 812 | 810 | /* basic machine hardware */ |
| 813 | 811 | MCFG_CPU_ADD("maincpu", M6502, EXIDY_CPU_CLOCK) |
| r10613 | r10614 | |
| 1386 | 1384 | |
| 1387 | 1385 | static DRIVER_INIT( sidetrac ) |
| 1388 | 1386 | { |
| 1389 | exidy_video_config(0x00, 0x00, FALSE); | |
| 1387 | exidy_state *state = machine->driver_data<exidy_state>(); | |
| 1388 | exidy_video_config(machine, 0x00, 0x00, FALSE); | |
| 1390 | 1389 | |
| 1391 | 1390 | /* hard-coded palette controlled via 8x3 DIP switches on the board */ |
| 1392 | exidy_color_latch[2] = 0xf8; | |
| 1393 | exidy_color_latch[1] = 0xdc; | |
| 1394 | exidy_color_latch[0] = 0xb8; | |
| 1391 | state->color_latch[2] = 0xf8; | |
| 1392 | state->color_latch[1] = 0xdc; | |
| 1393 | state->color_latch[0] = 0xb8; | |
| 1395 | 1394 | } |
| 1396 | 1395 | |
| 1397 | 1396 | |
| 1398 | 1397 | static DRIVER_INIT( targ ) |
| 1399 | 1398 | { |
| 1400 | exidy_video_config(0x00, 0x00, FALSE); | |
| 1399 | exidy_state *state = machine->driver_data<exidy_state>(); | |
| 1400 | exidy_video_config(machine, 0x00, 0x00, FALSE); | |
| 1401 | 1401 | |
| 1402 | 1402 | /* hard-coded palette controlled via 8x3 DIP switches on the board */ |
| 1403 | exidy_color_latch[2] = 0x5c; | |
| 1404 | exidy_color_latch[1] = 0xee; | |
| 1405 | exidy_color_latch[0] = 0x6b; | |
| 1403 | state->color_latch[2] = 0x5c; | |
| 1404 | state->color_latch[1] = 0xee; | |
| 1405 | state->color_latch[0] = 0x6b; | |
| 1406 | 1406 | } |
| 1407 | 1407 | |
| 1408 | 1408 | |
| 1409 | 1409 | static DRIVER_INIT( spectar ) |
| 1410 | 1410 | { |
| 1411 | exidy_video_config(0x00, 0x00, FALSE); | |
| 1411 | exidy_state *state = machine->driver_data<exidy_state>(); | |
| 1412 | exidy_video_config(machine, 0x00, 0x00, FALSE); | |
| 1412 | 1413 | |
| 1413 | 1414 | /* hard-coded palette controlled via 8x3 DIP switches on the board */ |
| 1414 | exidy_color_latch[2] = 0x58; | |
| 1415 | exidy_color_latch[1] = 0xee; | |
| 1416 | exidy_color_latch[0] = 0x09; | |
| 1415 | state->color_latch[2] = 0x58; | |
| 1416 | state->color_latch[1] = 0xee; | |
| 1417 | state->color_latch[0] = 0x09; | |
| 1417 | 1418 | } |
| 1418 | 1419 | |
| 1419 | 1420 | static DRIVER_INIT( rallys ) |
| 1420 | 1421 | { |
| 1421 | exidy_video_config(0x00, 0x00, FALSE); | |
| 1422 | exidy_state *state = machine->driver_data<exidy_state>(); | |
| 1423 | exidy_video_config(machine, 0x00, 0x00, FALSE); | |
| 1422 | 1424 | |
| 1423 | 1425 | /* hard-coded palette controlled via 8x3 DIP switches on the board */ |
| 1424 | exidy_color_latch[2] = 0x58; | |
| 1425 | exidy_color_latch[1] = 0xee; | |
| 1426 | exidy_color_latch[0] = 0x09; | |
| 1426 | state->color_latch[2] = 0x58; | |
| 1427 | state->color_latch[1] = 0xee; | |
| 1428 | state->color_latch[0] = 0x09; | |
| 1427 | 1429 | } |
| 1428 | 1430 | |
| 1429 | 1431 | static DRIVER_INIT( phantoma ) |
| 1430 | 1432 | { |
| 1431 | exidy_video_config(0x00, 0x00, FALSE); | |
| 1433 | exidy_state *state = machine->driver_data<exidy_state>(); | |
| 1434 | exidy_video_config(machine, 0x00, 0x00, FALSE); | |
| 1432 | 1435 | |
| 1433 | 1436 | /* hard-coded palette controlled via 8x3 DIP switches on the board */ |
| 1434 | exidy_color_latch[2] = 0x58; | |
| 1435 | exidy_color_latch[1] = 0xee; | |
| 1436 | exidy_color_latch[0] = 0x09; | |
| 1437 | state->color_latch[2] = 0x58; | |
| 1438 | state->color_latch[1] = 0xee; | |
| 1439 | state->color_latch[0] = 0x09; | |
| 1437 | 1440 | |
| 1438 | 1441 | /* the ROM is actually mapped high */ |
| 1439 | 1442 | memory_install_read_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xf800, 0xffff, 0, 0, "bank1"); |
| r10613 | r10614 | |
| 1443 | 1446 | |
| 1444 | 1447 | static DRIVER_INIT( mtrap ) |
| 1445 | 1448 | { |
| 1446 | exidy_video_config(0x14, 0x00, FALSE); | |
| 1449 | exidy_video_config(machine, 0x14, 0x00, FALSE); | |
| 1447 | 1450 | } |
| 1448 | 1451 | |
| 1449 | 1452 | |
| 1450 | 1453 | static DRIVER_INIT( venture ) |
| 1451 | 1454 | { |
| 1452 | exidy_video_config(0x04, 0x04, FALSE); | |
| 1455 | exidy_video_config(machine, 0x04, 0x04, FALSE); | |
| 1453 | 1456 | } |
| 1454 | 1457 | |
| 1455 | 1458 | |
| 1456 | 1459 | static DRIVER_INIT( teetert ) |
| 1457 | 1460 | { |
| 1458 | exidy_video_config(0x0c, 0x0c, FALSE); | |
| 1461 | exidy_video_config(machine, 0x0c, 0x0c, FALSE); | |
| 1459 | 1462 | } |
| 1460 | 1463 | |
| 1461 | 1464 | |
| 1462 | 1465 | static DRIVER_INIT( pepper2 ) |
| 1463 | 1466 | { |
| 1464 | exidy_video_config(0x14, 0x04, TRUE); | |
| 1467 | exidy_video_config(machine, 0x14, 0x04, TRUE); | |
| 1465 | 1468 | } |
| 1466 | 1469 | |
| 1467 | 1470 | |
| r10613 | r10614 | |
| 1469 | 1472 | { |
| 1470 | 1473 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 1471 | 1474 | |
| 1472 | exidy_video_config(0x04, 0x04, TRUE); | |
| 1475 | exidy_video_config(machine, 0x04, 0x04, TRUE); | |
| 1473 | 1476 | |
| 1474 | 1477 | /* reset the ROM bank */ |
| 1475 | 1478 | fax_bank_select_w(space,0,0); |
| r10613 | r10614 | |
|---|---|---|
| 30 | 30 | C000 Option Switches |
| 31 | 31 | D000 Paddle Position and Interrupt Reset (where applicable) |
| 32 | 32 | |
| 33 | NOTES: | |
| 34 | - Circus: Taito licensed and releasd the game as "Acrobat TV" | |
| 33 | NOTES: | |
| 34 | - Circus: Taito licensed and releasd the game as "Acrobat TV" | |
| 35 | 35 | |
| 36 | TODO: | |
| 37 | - generic video timing (vsync, vblank, # of scanlines) | |
| 38 | - circus/ripcord collision detection: | |
| 39 | * is accurate? | |
| 40 | * move away from video update (fails with frameskipping) | |
| 41 | - crash: irq timing | |
| 42 | - improve discrete sound | |
| 36 | TODO: | |
| 37 | - generic video timing (vsync, vblank, # of scanlines) | |
| 38 | - circus/ripcord collision detection: | |
| 39 | * is accurate? | |
| 40 | * move away from video update (fails with frameskipping) | |
| 41 | - crash: irq timing | |
| 42 | - improve discrete sound | |
| 43 | 43 | |
| 44 | 44 | ***************************************************************************/ |
| 45 | 45 | |
| r10613 | r10614 | |
| 88 | 88 | PORT_DIPSETTING( 0x02, "7" ) |
| 89 | 89 | PORT_DIPSETTING( 0x03, "9" ) |
| 90 | 90 | PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Coinage ) ) PORT_DIPLOCATION("14A:4,5") |
| 91 | // | |
| 91 | // PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) | |
| 92 | 92 | PORT_DIPSETTING( 0x0c, DEF_STR( 2C_1C ) ) |
| 93 | 93 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_1C ) ) |
| 94 | 94 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) |
| r10613 | r10614 | |
| 127 | 127 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) |
| 128 | 128 | PORT_DIPSETTING( 0x08, DEF_STR( 1C_1C ) ) |
| 129 | 129 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) |
| 130 | // | |
| 130 | // PORT_DIPSETTING( 0x18, DEF_STR( 1C_2C ) ) | |
| 131 | 131 | PORT_DIPNAME( 0x60, 0x00, "Bowl Timer" ) PORT_DIPLOCATION("14A:1,2") |
| 132 | 132 | PORT_DIPSETTING( 0x00, "3 seconds" ) |
| 133 | 133 | PORT_DIPSETTING( 0x20, "5 seconds" ) |
| r10613 | r10614 | |
| 158 | 158 | PORT_DIPSETTING( 0x02, "4" ) |
| 159 | 159 | PORT_DIPSETTING( 0x03, "5" ) |
| 160 | 160 | PORT_DIPNAME( 0x0C, 0x04, DEF_STR( Coinage ) ) PORT_DIPLOCATION("14A:4,5") |
| 161 | // | |
| 161 | // PORT_DIPSETTING( 0x0c, DEF_STR( 2C_1C ) ) | |
| 162 | 162 | PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) |
| 163 | 163 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_1C ) ) |
| 164 | 164 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) |
| r10613 | r10614 | |
| 198 | 198 | PORT_DIPSETTING( 0x02, "7" ) |
| 199 | 199 | PORT_DIPSETTING( 0x03, "9" ) |
| 200 | 200 | PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Coinage ) ) PORT_DIPLOCATION("14A:4,5") |
| 201 | // | |
| 201 | // PORT_DIPSETTING( 0x0c, DEF_STR( 2C_1C ) ) | |
| 202 | 202 | PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) |
| 203 | 203 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_1C ) ) |
| 204 | 204 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) |
| r10613 | r10614 | |
|---|---|---|
| 70 | 70 | #include "machine/nvram.h" |
| 71 | 71 | |
| 72 | 72 | |
| 73 | struct blitter_t | |
| 74 | { | |
| 75 | ||
| 76 | UINT16 x, y, w, h, | |
| 77 | gfx_lo, gfx_hi, | |
| 78 | depth, | |
| 79 | pen, | |
| 80 | flags; | |
| 81 | ||
| 82 | }; | |
| 83 | ||
| 73 | 84 | class igs011_state : public driver_device |
| 74 | 85 | { |
| 75 | 86 | public: |
| r10613 | r10614 | |
| 93 | 104 | UINT16 igs003_reg[2]; |
| 94 | 105 | UINT16 lhb_irq_enable; |
| 95 | 106 | UINT16 *vbowl_trackball; |
| 107 | blitter_t blitter; | |
| 96 | 108 | }; |
| 97 | 109 | |
| 98 | 110 | |
| r10613 | r10614 | |
| 277 | 289 | |
| 278 | 290 | ***************************************************************************/ |
| 279 | 291 | |
| 280 | static struct | |
| 292 | ||
| 293 | static WRITE16_HANDLER( igs011_blit_x_w ) | |
| 281 | 294 | { |
| 295 | igs011_state *state = space->machine->driver_data<igs011_state>(); | |
| 296 | struct blitter_t &blitter = state->blitter; | |
| 297 | COMBINE_DATA(&blitter.x); | |
| 298 | } | |
| 282 | 299 | |
| 283 | UINT16 x, y, w, h, | |
| 284 | gfx_lo, gfx_hi, | |
| 285 | depth, | |
| 286 | pen, | |
| 287 | flags; | |
| 300 | static WRITE16_HANDLER( igs011_blit_y_w ) | |
| 301 | { | |
| 302 | igs011_state *state = space->machine->driver_data<igs011_state>(); | |
| 303 | struct blitter_t &blitter = state->blitter; | |
| 304 | COMBINE_DATA(&blitter.y); | |
| 305 | } | |
| 288 | 306 | |
| 289 | } blitter; | |
| 307 | static WRITE16_HANDLER( igs011_blit_gfx_lo_w ) | |
| 308 | { | |
| 309 | igs011_state *state = space->machine->driver_data<igs011_state>(); | |
| 310 | struct blitter_t &blitter = state->blitter; | |
| 311 | COMBINE_DATA(&blitter.gfx_lo); | |
| 312 | } | |
| 290 | 313 | |
| 314 | static WRITE16_HANDLER( igs011_blit_gfx_hi_w ) | |
| 315 | { | |
| 316 | igs011_state *state = space->machine->driver_data<igs011_state>(); | |
| 317 | struct blitter_t &blitter = state->blitter; | |
| 318 | COMBINE_DATA(&blitter.gfx_hi); | |
| 319 | } | |
| 291 | 320 | |
| 292 | static WRITE16_HANDLER( igs011_blit_x_w ) { COMBINE_DATA(&blitter.x); } | |
| 293 | static WRITE16_HANDLER( igs011_blit_y_w ) { COMBINE_DATA(&blitter.y); } | |
| 294 | static WRITE16_HANDLER( igs011_blit_gfx_lo_w ) { COMBINE_DATA(&blitter.gfx_lo); } | |
| 295 | static WRITE16_HANDLER( igs011_blit_gfx_hi_w ) { COMBINE_DATA(&blitter.gfx_hi); } | |
| 296 | static WRITE16_HANDLER( igs011_blit_w_w ) { COMBINE_DATA(&blitter.w); } | |
| 297 | static WRITE16_HANDLER( igs011_blit_h_w ) { COMBINE_DATA(&blitter.h); } | |
| 298 | static WRITE16_HANDLER( igs011_blit_depth_w ) { COMBINE_DATA(&blitter.depth); } | |
| 299 | static WRITE16_HANDLER( igs011_blit_pen_w ) { COMBINE_DATA(&blitter.pen); } | |
| 321 | static WRITE16_HANDLER( igs011_blit_w_w ) | |
| 322 | { | |
| 323 | igs011_state *state = space->machine->driver_data<igs011_state>(); | |
| 324 | struct blitter_t &blitter = state->blitter; | |
| 325 | COMBINE_DATA(&blitter.w); | |
| 326 | } | |
| 300 | 327 | |
| 328 | static WRITE16_HANDLER( igs011_blit_h_w ) | |
| 329 | { | |
| 330 | igs011_state *state = space->machine->driver_data<igs011_state>(); | |
| 331 | struct blitter_t &blitter = state->blitter; | |
| 332 | COMBINE_DATA(&blitter.h); | |
| 333 | } | |
| 301 | 334 | |
| 335 | static WRITE16_HANDLER( igs011_blit_depth_w ) | |
| 336 | { | |
| 337 | igs011_state *state = space->machine->driver_data<igs011_state>(); | |
| 338 | struct blitter_t &blitter = state->blitter; | |
| 339 | COMBINE_DATA(&blitter.depth); | |
| 340 | } | |
| 341 | ||
| 342 | static WRITE16_HANDLER( igs011_blit_pen_w ) | |
| 343 | { | |
| 344 | igs011_state *state = space->machine->driver_data<igs011_state>(); | |
| 345 | struct blitter_t &blitter = state->blitter; | |
| 346 | COMBINE_DATA(&blitter.pen); | |
| 347 | } | |
| 348 | ||
| 349 | ||
| 302 | 350 | static WRITE16_HANDLER( igs011_blit_flags_w ) |
| 303 | 351 | { |
| 304 | 352 | igs011_state *state = space->machine->driver_data<igs011_state>(); |
| 353 | struct blitter_t &blitter = state->blitter; | |
| 305 | 354 | int x, xstart, xend, xinc, flipx; |
| 306 | 355 | int y, ystart, yend, yinc, flipy; |
| 307 | 356 | int depth4, clear, opaque, z; |
| r10613 | r10614 | |
| 929 | 978 | /* |
| 930 | 979 | static READ16_HANDLER( igs011_prot_fake_r ) |
| 931 | 980 | { |
| 932 | ||
| 981 | igs011_state *state = space->machine->driver_data<igs011_state>(); | |
| 933 | 982 | switch (offset) |
| 934 | 983 | { |
| 935 | 984 | case 0: return state->prot1; |
| r10613 | r10614 | |
| 1155 | 1204 | /* |
| 1156 | 1205 | static READ16_HANDLER( igs012_prot_fake_r ) |
| 1157 | 1206 | { |
| 1158 | ||
| 1207 | igs011_state *state = space->machine->driver_data<igs011_state>(); | |
| 1159 | 1208 | switch (offset) |
| 1160 | 1209 | { |
| 1161 | 1210 | case 0: return state->igs012_prot; |
| r10613 | r10614 | |
|---|---|---|
| 450 | 450 | MCFG_PALETTE_LENGTH(64) |
| 451 | 451 | |
| 452 | 452 | MCFG_VIDEO_START(bwing) |
| 453 | ||
| 453 | ||
| 454 | 454 | // sound hardware |
| 455 | 455 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 456 | 456 |
| r10613 | r10614 | |
|---|---|---|
| 515 | 515 | *************************************/ |
| 516 | 516 | |
| 517 | 517 | static ADDRESS_MAP_START( defender_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 518 | AM_RANGE(0x0000, 0xbfff) AM_RAM AM_BASE( | |
| 518 | AM_RANGE(0x0000, 0xbfff) AM_RAM AM_BASE_MEMBER( | |
| 519 | 519 | /* range from 0xc000-0xcfff is mapped programmatically below */ |
| 520 | 520 | AM_RANGE(0xc000, 0xc00f) AM_BASE_GENERIC(paletteram) |
| 521 | 521 | AM_RANGE(0xc400, 0xc4ff) AM_SHARE("nvram") |
| r10613 | r10614 | |
| 552 | 552 | *************************************/ |
| 553 | 553 | |
| 554 | 554 | static ADDRESS_MAP_START( williams_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 555 | AM_RANGE(0x0000, 0x8fff) AM_READ_BANK("bank1") AM_WRITEONLY AM_BASE( | |
| 555 | AM_RANGE(0x0000, 0x8fff) AM_READ_BANK("bank1") AM_WRITEONLY AM_BASE_MEMBER( | |
| 556 | 556 | AM_RANGE(0x9000, 0xbfff) AM_RAM |
| 557 | 557 | AM_RANGE(0xc000, 0xc00f) AM_MIRROR(0x03f0) AM_WRITEONLY AM_BASE_GENERIC(paletteram) |
| 558 | 558 | AM_RANGE(0xc804, 0xc807) AM_MIRROR(0x00f0) AM_DEVREADWRITE("pia_0", pia6821_r, pia6821_w) |
| r10613 | r10614 | |
| 567 | 567 | |
| 568 | 568 | |
| 569 | 569 | static ADDRESS_MAP_START( williams_extra_ram_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 570 | AM_RANGE(0x0000, 0x8fff) AM_READ_BANK("bank1") AM_WRITEONLY AM_BASE( | |
| 570 | AM_RANGE(0x0000, 0x8fff) AM_READ_BANK("bank1") AM_WRITEONLY AM_BASE_MEMBER( | |
| 571 | 571 | AM_RANGE(0x9000, 0xbfff) AM_RAM |
| 572 | 572 | AM_RANGE(0xc000, 0xc00f) AM_MIRROR(0x03f0) AM_WRITEONLY AM_BASE_GENERIC(paletteram) |
| 573 | 573 | AM_RANGE(0xc804, 0xc807) AM_MIRROR(0x00f0) AM_DEVREADWRITE("pia_0", pia6821_r, pia6821_w) |
| r10613 | r10614 | |
| 590 | 590 | *************************************/ |
| 591 | 591 | |
| 592 | 592 | static ADDRESS_MAP_START( blaster_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 593 | AM_RANGE(0x0000, 0x3fff) AM_READ_BANK("bank1") AM_WRITEONLY AM_BASE( | |
| 593 | AM_RANGE(0x0000, 0x3fff) AM_READ_BANK("bank1") AM_WRITEONLY AM_BASE_MEMBER( | |
| 594 | 594 | AM_RANGE(0x4000, 0x8fff) AM_READ_BANK("bank2") AM_WRITEONLY |
| 595 | AM_RANGE(0xbb00, 0xbbff) AM_WRITEONLY AM_BASE(&blaster_palette_0) | |
| 596 | AM_RANGE(0xbc00, 0xbcff) AM_WRITEONLY AM_BASE(&blaster_scanline_control) | |
| 595 | AM_RANGE(0xbb00, 0xbbff) AM_WRITEONLY AM_BASE_MEMBER(williams_state, blaster_palette_0) | |
| 596 | AM_RANGE(0xbc00, 0xbcff) AM_WRITEONLY AM_BASE_MEMBER(williams_state, blaster_scanline_control) | |
| 597 | 597 | AM_RANGE(0x9000, 0xbfff) AM_RAM |
| 598 | 598 | AM_RANGE(0xc000, 0xc00f) AM_MIRROR(0x03f0) AM_WRITEONLY AM_BASE_GENERIC(paletteram) |
| 599 | 599 | AM_RANGE(0xc804, 0xc807) AM_MIRROR(0x00f0) AM_DEVREADWRITE("pia_0", pia6821_r, pia6821_w) |
| r10613 | r10614 | |
| 618 | 618 | *************************************/ |
| 619 | 619 | |
| 620 | 620 | static ADDRESS_MAP_START( williams2_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 621 | AM_RANGE(0x0000, 0x7fff) AM_READ_BANK("bank1") AM_WRITEONLY AM_BASE( | |
| 621 | AM_RANGE(0x0000, 0x7fff) AM_READ_BANK("bank1") AM_WRITEONLY AM_BASE_MEMBER( | |
| 622 | 622 | AM_RANGE(0x8000, 0xbfff) AM_RAM |
| 623 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(williams2_tileram_w) AM_BASE( | |
| 623 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(williams2_tileram_w) AM_BASE_MEMBER(williams_state, williams2_tileram) | |
| 624 | 624 | AM_RANGE(0xc800, 0xc87f) AM_WRITE(williams2_bank_select_w) |
| 625 | 625 | AM_RANGE(0xc880, 0xc887) AM_MIRROR(0x0078) AM_WRITE(williams_blitter_w) |
| 626 | 626 | AM_RANGE(0xc900, 0xc97f) AM_WRITE(williams2_watchdog_reset_w) |
| r10613 | r10614 | |
| 640 | 640 | |
| 641 | 641 | |
| 642 | 642 | static ADDRESS_MAP_START( williams2_extra_ram_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 643 | AM_RANGE(0x0000, 0x7fff) AM_READ_BANK("bank1") AM_WRITEONLY AM_BASE( | |
| 643 | AM_RANGE(0x0000, 0x7fff) AM_READ_BANK("bank1") AM_WRITEONLY AM_BASE_MEMBER( | |
| 644 | 644 | AM_RANGE(0x8000, 0xbfff) AM_RAM |
| 645 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(williams2_tileram_w) AM_BASE( | |
| 645 | AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(williams2_tileram_w) AM_BASE_MEMBER(williams_state, williams2_tileram) | |
| 646 | 646 | AM_RANGE(0xc800, 0xc87f) AM_WRITE(williams2_bank_select_w) |
| 647 | 647 | AM_RANGE(0xc880, 0xc887) AM_MIRROR(0x0078) AM_WRITE(williams_blitter_w) |
| 648 | 648 | AM_RANGE(0xc900, 0xc97f) AM_WRITE(williams2_watchdog_reset_w) |
| r10613 | r10614 | |
| 2688 | 2688 | *************************************/ |
| 2689 | 2689 | |
| 2690 | 2690 | #define CONFIGURE_BLITTER(x,c) \ |
| 2691 | williams_blitter_config = x; \ | |
| 2692 | williams_blitter_clip_address = c | |
| 2691 | state->blitter_config = x; \ | |
| 2692 | state->blitter_clip_address = c | |
| 2693 | 2693 | |
| 2694 | 2694 | #define CONFIGURE_TILEMAP(x) \ |
| 2695 | williams2_tilemap_config = x | |
| 2695 | state->williams2_tilemap_config = x | |
| 2696 | 2696 | |
| 2697 | 2697 | |
| 2698 | 2698 | |
| r10613 | r10614 | |
| 2704 | 2704 | |
| 2705 | 2705 | static DRIVER_INIT( defender ) |
| 2706 | 2706 | { |
| 2707 | williams_state *state = machine->driver_data<williams_state>(); | |
| 2707 | 2708 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_NONE, 0x0000); |
| 2708 | 2709 | } |
| 2709 | 2710 | |
| 2710 | 2711 | |
| 2711 | 2712 | static DRIVER_INIT( defndjeu ) |
| 2712 | 2713 | { |
| 2714 | williams_state *state = machine->driver_data<williams_state>(); | |
| 2713 | 2715 | UINT8 *rom = machine->region("maincpu")->base(); |
| 2714 | 2716 | int i; |
| 2715 | 2717 | |
| r10613 | r10614 | |
| 2723 | 2725 | |
| 2724 | 2726 | static DRIVER_INIT( mayday ) |
| 2725 | 2727 | { |
| 2728 | williams_state *state = machine->driver_data<williams_state>(); | |
| 2726 | 2729 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_NONE, 0x0000); |
| 2727 | 2730 | |
| 2728 | 2731 | /* install a handler to catch protection checks */ |
| 2729 | mayday_protection = memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa190, 0xa191, 0, 0, mayday_protection_r); | |
| 2732 | state->mayday_protection = memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa190, 0xa191, 0, 0, mayday_protection_r); | |
| 2730 | 2733 | } |
| 2731 | 2734 | |
| 2732 | 2735 | |
| r10613 | r10614 | |
| 2739 | 2742 | |
| 2740 | 2743 | static DRIVER_INIT( stargate ) |
| 2741 | 2744 | { |
| 2745 | williams_state *state = machine->driver_data<williams_state>(); | |
| 2742 | 2746 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_NONE, 0x0000); |
| 2743 | 2747 | } |
| 2744 | 2748 | |
| 2745 | 2749 | |
| 2746 | 2750 | static DRIVER_INIT( robotron ) |
| 2747 | 2751 | { |
| 2752 | williams_state *state = machine->driver_data<williams_state>(); | |
| 2748 | 2753 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000); |
| 2749 | 2754 | } |
| 2750 | 2755 | |
| 2751 | 2756 | |
| 2752 | 2757 | static DRIVER_INIT( joust ) |
| 2753 | 2758 | { |
| 2759 | williams_state *state = machine->driver_data<williams_state>(); | |
| 2754 | 2760 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000); |
| 2755 | 2761 | } |
| 2756 | 2762 | |
| 2757 | 2763 | |
| 2758 | 2764 | static DRIVER_INIT( bubbles ) |
| 2759 | 2765 | { |
| 2766 | williams_state *state = machine->driver_data<williams_state>(); | |
| 2760 | 2767 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000); |
| 2761 | 2768 | |
| 2762 | 2769 | /* bubbles has a full 8-bit-wide CMOS */ |
| r10613 | r10614 | |
| 2766 | 2773 | |
| 2767 | 2774 | static DRIVER_INIT( splat ) |
| 2768 | 2775 | { |
| 2776 | williams_state *state = machine->driver_data<williams_state>(); | |
| 2769 | 2777 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC02, 0xc000); |
| 2770 | 2778 | } |
| 2771 | 2779 | |
| 2772 | 2780 | |
| 2773 | 2781 | static DRIVER_INIT( sinistar ) |
| 2774 | 2782 | { |
| 2783 | williams_state *state = machine->driver_data<williams_state>(); | |
| 2775 | 2784 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0x7400); |
| 2776 | 2785 | } |
| 2777 | 2786 | |
| 2778 | 2787 | |
| 2779 | 2788 | static DRIVER_INIT( playball ) |
| 2780 | 2789 | { |
| 2790 | williams_state *state = machine->driver_data<williams_state>(); | |
| 2781 | 2791 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000); |
| 2782 | 2792 | } |
| 2783 | 2793 | |
| 2784 | 2794 | |
| 2785 | 2795 | static DRIVER_INIT( blaster ) |
| 2786 | 2796 | { |
| 2797 | williams_state *state = machine->driver_data<williams_state>(); | |
| 2787 | 2798 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC02, 0x9700); |
| 2788 | 2799 | } |
| 2789 | 2800 | |
| 2790 | 2801 | |
| 2791 | 2802 | static DRIVER_INIT( blastkit ) |
| 2792 | 2803 | { |
| 2804 | williams_state *state = machine->driver_data<williams_state>(); | |
| 2793 | 2805 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC02, 0x9700); |
| 2794 | 2806 | } |
| 2795 | 2807 | |
| 2796 | 2808 | |
| 2797 | 2809 | static DRIVER_INIT( spdball ) |
| 2798 | 2810 | { |
| 2811 | williams_state *state = machine->driver_data<williams_state>(); | |
| 2799 | 2812 | device_t *pia_3 = machine->device("pia_3"); |
| 2800 | 2813 | |
| 2801 | 2814 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000); |
| r10613 | r10614 | |
| 2813 | 2826 | |
| 2814 | 2827 | static DRIVER_INIT( alienar ) |
| 2815 | 2828 | { |
| 2829 | williams_state *state = machine->driver_data<williams_state>(); | |
| 2816 | 2830 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000); |
| 2817 | 2831 | memory_nop_write(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xcbff, 0xcbff, 0, 0); |
| 2818 | 2832 | } |
| r10613 | r10614 | |
| 2820 | 2834 | |
| 2821 | 2835 | static DRIVER_INIT( alienaru ) |
| 2822 | 2836 | { |
| 2837 | williams_state *state = machine->driver_data<williams_state>(); | |
| 2823 | 2838 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000); |
| 2824 | 2839 | memory_nop_write(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xcbff, 0xcbff, 0, 0); |
| 2825 | 2840 | } |
| r10613 | r10614 | |
| 2827 | 2842 | |
| 2828 | 2843 | static DRIVER_INIT( lottofun ) |
| 2829 | 2844 | { |
| 2845 | williams_state *state = machine->driver_data<williams_state>(); | |
| 2830 | 2846 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000); |
| 2831 | 2847 | } |
| 2832 | 2848 | |
| r10613 | r10614 | |
| 2840 | 2856 | |
| 2841 | 2857 | static DRIVER_INIT( mysticm ) |
| 2842 | 2858 | { |
| 2859 | williams_state *state = machine->driver_data<williams_state>(); | |
| 2843 | 2860 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC02, 0x9000); |
| 2844 | 2861 | CONFIGURE_TILEMAP(WILLIAMS_TILEMAP_MYSTICM); |
| 2845 | 2862 | } |
| r10613 | r10614 | |
| 2847 | 2864 | |
| 2848 | 2865 | static DRIVER_INIT( tshoot ) |
| 2849 | 2866 | { |
| 2867 | williams_state *state = machine->driver_data<williams_state>(); | |
| 2850 | 2868 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC02, 0x9000); |
| 2851 | 2869 | CONFIGURE_TILEMAP(WILLIAMS_TILEMAP_TSHOOT); |
| 2852 | 2870 | } |
| r10613 | r10614 | |
| 2854 | 2872 | |
| 2855 | 2873 | static DRIVER_INIT( inferno ) |
| 2856 | 2874 | { |
| 2875 | williams_state *state = machine->driver_data<williams_state>(); | |
| 2857 | 2876 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC02, 0x9000); |
| 2858 | 2877 | CONFIGURE_TILEMAP(WILLIAMS_TILEMAP_TSHOOT); |
| 2859 | 2878 | } |
| r10613 | r10614 | |
| 2861 | 2880 | |
| 2862 | 2881 | static DRIVER_INIT( joust2 ) |
| 2863 | 2882 | { |
| 2883 | williams_state *state = machine->driver_data<williams_state>(); | |
| 2864 | 2884 | CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC02, 0x9000); |
| 2865 | 2885 | CONFIGURE_TILEMAP(WILLIAMS_TILEMAP_JOUST2); |
| 2866 | 2886 | } |
| r10613 | r10614 | |
|---|---|---|
| 15 | 15 | #include "machine/nvram.h" |
| 16 | 16 | #include "includes/triplhnt.h" |
| 17 | 17 | |
| 18 | static UINT8 triplhnt_cmos[16]; | |
| 19 | static UINT8 triplhnt_da_latch; | |
| 20 | static UINT8 triplhnt_misc_flags; | |
| 21 | static UINT8 triplhnt_cmos_latch; | |
| 22 | static UINT8 triplhnt_hit_code; | |
| 23 | 18 | |
| 24 | 19 | |
| 25 | 20 | static DRIVER_INIT( triplhnt ) |
| 26 | 21 | { |
| 27 | machine->device<nvram_device>("nvram")->set_base(triplhnt_cmos, sizeof(triplhnt_cmos)); | |
| 22 | triplhnt_state *state = machine->driver_data<triplhnt_state>(); | |
| 23 | machine->device<nvram_device>("nvram")->set_base(state->cmos, sizeof(state->cmos)); | |
| 28 | 24 | } |
| 29 | 25 | |
| 30 | 26 | |
| 31 | 27 | void triplhnt_set_collision(running_machine *machine, int code) |
| 32 | 28 | { |
| 33 | triplhnt_hit_code = code; | |
| 29 | triplhnt_state *state = machine->driver_data<triplhnt_state>(); | |
| 30 | state->hit_code = code; | |
| 34 | 31 | |
| 35 | 32 | cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE); |
| 36 | 33 | } |
| r10613 | r10614 | |
| 38 | 35 | |
| 39 | 36 | static void triplhnt_update_misc(running_machine *machine, int offset) |
| 40 | 37 | { |
| 38 | triplhnt_state *state = machine->driver_data<triplhnt_state>(); | |
| 41 | 39 | device_t *samples = machine->device("samples"); |
| 42 | 40 | device_t *discrete = machine->device("discrete"); |
| 43 | 41 | UINT8 is_witch_hunt; |
| r10613 | r10614 | |
| 54 | 52 | |
| 55 | 53 | if (offset & 1) |
| 56 | 54 | { |
| 57 | t | |
| 55 | sta | |
| 58 | 56 | |
| 59 | 57 | if (bit == 5) |
| 60 | 58 | { |
| 61 | t | |
| 59 | sta | |
| 62 | 60 | } |
| 63 | 61 | } |
| 64 | 62 | else |
| 65 | 63 | { |
| 66 | t | |
| 64 | sta | |
| 67 | 65 | } |
| 68 | 66 | |
| 69 | triplhnt_sprite_zoom = (triplhnt_misc_flags >> 4) & 1; | |
| 70 | triplhnt_sprite_bank = (triplhnt_misc_flags >> 7) & 1; | |
| 67 | state->sprite_zoom = (state->misc_flags >> 4) & 1; | |
| 68 | state->sprite_bank = (state->misc_flags >> 7) & 1; | |
| 71 | 69 | |
| 72 | set_led_status(machine, 0, t | |
| 70 | set_led_status(machine, 0, sta | |
| 73 | 71 | |
| 74 | coin_lockout_w(machine, 0, !(triplhnt_misc_flags & 0x08)); | |
| 75 | coin_lockout_w(machine, 1, !(triplhnt_misc_flags & 0x08)); | |
| 72 | coin_lockout_w(machine, 0, !(state->misc_flags & 0x08)); | |
| 73 | coin_lockout_w(machine, 1, !(state->misc_flags & 0x08)); | |
| 76 | 74 | |
| 77 | discrete_sound_w(discrete, TRIPLHNT_SCREECH_EN, triplhnt_misc_flags & 0x04); // screech | |
| 78 | discrete_sound_w(discrete, TRIPLHNT_LAMP_EN, triplhnt_misc_flags & 0x02); // Lamp is used to reset noise | |
| 79 | discrete_sound_w(discrete, TRIPLHNT_BEAR_EN, triplhnt_misc_flags & 0x80); // bear | |
| 75 | discrete_sound_w(discrete, TRIPLHNT_SCREECH_EN, state->misc_flags & 0x04); // screech | |
| 76 | discrete_sound_w(discrete, TRIPLHNT_LAMP_EN, state->misc_flags & 0x02); // Lamp is used to reset noise | |
| 77 | discrete_sound_w(discrete, TRIPLHNT_BEAR_EN, state->misc_flags & 0x80); // bear | |
| 80 | 78 | |
| 81 | 79 | is_witch_hunt = input_port_read(machine, "0C09") == 0x40; |
| 82 | bit = ~t | |
| 80 | bit = ~sta | |
| 83 | 81 | |
| 84 | 82 | /* if we're not playing the sample yet, start it */ |
| 85 | 83 | if (!sample_playing(samples, 0)) |
| r10613 | r10614 | |
| 101 | 99 | |
| 102 | 100 | static READ8_HANDLER( triplhnt_cmos_r ) |
| 103 | 101 | { |
| 104 | triplhnt_cmos_latch = offset; | |
| 102 | triplhnt_state *state = space->machine->driver_data<triplhnt_state>(); | |
| 103 | state->cmos_latch = offset; | |
| 105 | 104 | |
| 106 | return t | |
| 105 | return sta | |
| 107 | 106 | } |
| 108 | 107 | |
| 109 | 108 | |
| r10613 | r10614 | |
| 116 | 115 | |
| 117 | 116 | static READ8_HANDLER( triplhnt_misc_r ) |
| 118 | 117 | { |
| 118 | triplhnt_state *state = space->machine->driver_data<triplhnt_state>(); | |
| 119 | 119 | triplhnt_update_misc(space->machine, offset); |
| 120 | return input_port_read(space->machine, "VBLANK") | t | |
| 120 | return input_port_read(space->machine, "VBLANK") | sta | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | |
| 124 | 124 | static READ8_HANDLER( triplhnt_da_latch_r ) |
| 125 | 125 | { |
| 126 | triplhnt_state *state = space->machine->driver_data<triplhnt_state>(); | |
| 126 | 127 | int cross_x = input_port_read(space->machine, "STICKX"); |
| 127 | 128 | int cross_y = input_port_read(space->machine, "STICKY"); |
| 128 | 129 | |
| 129 | t | |
| 130 | sta | |
| 130 | 131 | |
| 131 | 132 | /* the following is a slight simplification */ |
| 132 | 133 | |
| r10613 | r10614 | |
| 137 | 138 | static ADDRESS_MAP_START( triplhnt_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 138 | 139 | ADDRESS_MAP_GLOBAL_MASK(0x7fff) |
| 139 | 140 | AM_RANGE(0x0000, 0x00ff) AM_RAM AM_MIRROR(0x300) |
| 140 | AM_RANGE(0x0400, 0x04ff) AM_WRITEONLY AM_BASE(&triplhnt_playfield_ram) | |
| 141 | AM_RANGE(0x0800, 0x080f) AM_WRITEONLY AM_BASE(&triplhnt_vpos_ram) | |
| 142 | AM_RANGE(0x0810, 0x081f) AM_WRITEONLY AM_BASE(&triplhnt_hpos_ram) | |
| 143 | AM_RANGE(0x0820, 0x082f) AM_WRITEONLY AM_BASE(&triplhnt_orga_ram) | |
| 144 | AM_RANGE(0x0830, 0x083f) AM_WRITEONLY AM_BASE(&triplhnt_code_ram) | |
| 141 | AM_RANGE(0x0400, 0x04ff) AM_WRITEONLY AM_BASE_MEMBER(triplhnt_state, playfield_ram) | |
| 142 | AM_RANGE(0x0800, 0x080f) AM_WRITEONLY AM_BASE_MEMBER(triplhnt_state, vpos_ram) | |
| 143 | AM_RANGE(0x0810, 0x081f) AM_WRITEONLY AM_BASE_MEMBER(triplhnt_state, hpos_ram) | |
| 144 | AM_RANGE(0x0820, 0x082f) AM_WRITEONLY AM_BASE_MEMBER(triplhnt_state, orga_ram) | |
| 145 | AM_RANGE(0x0830, 0x083f) AM_WRITEONLY AM_BASE_MEMBER(triplhnt_state, code_ram) | |
| 145 | 146 | AM_RANGE(0x0c00, 0x0c00) AM_READ_PORT("0C00") |
| 146 | 147 | AM_RANGE(0x0c08, 0x0c08) AM_READ_PORT("0C08") |
| 147 | 148 | AM_RANGE(0x0c09, 0x0c09) AM_READ_PORT("0C09") |
| r10613 | r10614 | |
| 309 | 310 | } |
| 310 | 311 | |
| 311 | 312 | |
| 312 | static MACHINE_CONFIG_START( triplhnt, | |
| 313 | static MACHINE_CONFIG_START( triplhnt, triplhnt_stat | |
| 313 | 314 | |
| 314 | 315 | /* basic machine hardware */ |
| 315 | 316 | MCFG_CPU_ADD("maincpu", M6800, 800000) |
| r10613 | r10614 | |
|---|---|---|
| 168 | 168 | AM_RANGE(0x300000, 0x300001) AM_READ_PORT("INPUTS") |
| 169 | 169 | AM_RANGE(0x400000, 0x400001) AM_READ_PORT("SYSTEM") |
| 170 | 170 | // AM_RANGE(0x500000, 0x5007ff) AM_RAM |
| 171 | AM_RANGE(0x500000, 0x5007ff) AM_WRITEONLY AM_BASE( | |
| 171 | AM_RANGE(0x500000, 0x5007ff) AM_WRITEONLY AM_BASE_MEMBER( | |
| 172 | 172 | // AM_RANGE(0x500800, 0x50080f) AM_WRITENOP |
| 173 | 173 | AM_RANGE(0x600000, 0x600001) AM_WRITE(pirates_out_w) |
| 174 | AM_RANGE(0x700000, 0x700001) AM_WRITEONLY AM_BASE( | |
| 174 | AM_RANGE(0x700000, 0x700001) AM_WRITEONLY AM_BASE_MEMBER( | |
| 175 | 175 | AM_RANGE(0x800000, 0x803fff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE_GENERIC(paletteram) |
| 176 | 176 | AM_RANGE(0x900000, 0x90017f) AM_RAM // more of tilemaps ? |
| 177 | AM_RANGE(0x900180, 0x90137f) AM_RAM_WRITE(pirates_tx_tileram_w) AM_BASE(&pirates_tx_tileram) | |
| 178 | AM_RANGE(0x901380, 0x902a7f) AM_RAM_WRITE(pirates_fg_tileram_w) AM_BASE(&pirates_fg_tileram) | |
| 177 | AM_RANGE(0x900180, 0x90137f) AM_RAM_WRITE(pirates_tx_tileram_w) AM_BASE_MEMBER(pirates_state, tx_tileram) | |
| 178 | AM_RANGE(0x901380, 0x902a7f) AM_RAM_WRITE(pirates_fg_tileram_w) AM_BASE_MEMBER(pirates_state, fg_tileram) | |
| 179 | 179 | // AM_RANGE(0x902580, 0x902a7f) AM_RAM // more of tilemaps ? |
| 180 | AM_RANGE(0x902a80, 0x904187) AM_RAM_WRITE(pirates_bg_tileram_w) AM_BASE( | |
| 180 | AM_RANGE(0x902a80, 0x904187) AM_RAM_WRITE(pirates_bg_tileram_w) AM_BASE_MEMBER( | |
| 181 | 181 | // AM_RANGE(0x903c80, 0x904187) AM_RAM // more of tilemaps ? |
| 182 | 182 | AM_RANGE(0xa00000, 0xa00001) AM_DEVREADWRITE8_MODERN("oki", okim6295_device, read, write, 0x00ff) |
| 183 | 183 | ADDRESS_MAP_END |
| r10613 | r10614 | |
| 260 | 260 | |
| 261 | 261 | /* Machine Driver + Related bits */ |
| 262 | 262 | |
| 263 | static MACHINE_CONFIG_START( pirates, | |
| 263 | static MACHINE_CONFIG_START( pirates, p | |
| 264 | 264 | MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16mhz */ |
| 265 | 265 | MCFG_CPU_PROGRAM_MAP(pirates_map) |
| 266 | 266 | MCFG_CPU_VBLANK_INT("screen", irq1_line_hold) |
| r10613 | r10614 | |
|---|---|---|
| 329 | 329 | return CHDERR_FILE_NOT_FOUND; |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | // | |
| 332 | // printf("NER5 detected, chain offset: %x\n", chain_offs); | |
| 333 | 333 | |
| 334 | 334 | while (!done) |
| 335 | 335 | { |
| r10613 | r10614 | |
| 342 | 342 | |
| 343 | 343 | chunk_size = (buffer[7] | buffer[6]<<8 | buffer[5]<<16 | buffer[4]<<24); |
| 344 | 344 | |
| 345 | // | |
| 345 | // printf("Chunk type: %c%c%c%c, size %x\n", buffer[0], buffer[1], buffer[2], buffer[3], chunk_size); | |
| 346 | 346 | |
| 347 | 347 | // we want the DAOX chunk, which has the TOC information |
| 348 | 348 | if (!memcmp(buffer, "DAOX", 4)) |
| r10613 | r10614 | |
| 354 | 354 | fread(&start, 1, 1, infile); |
| 355 | 355 | fread(&end, 1, 1, infile); |
| 356 | 356 | |
| 357 | // | |
| 357 | // printf("TOC type: %08x. Start track %d End track: %d\n", toc_type, start, end); | |
| 358 | 358 | |
| 359 | 359 | outtoc->numtrks = (end-start) + 1; |
| 360 | 360 | |
| r10613 | r10614 | |
| 371 | 371 | index1 = read_uint64(infile); |
| 372 | 372 | index2 = read_uint64(infile); |
| 373 | 373 | |
| 374 | // | |
| 374 | // printf("Track %d: sector size %d mode %x index0 %llx index1 %llx index2 %llx (pregap %d sectors, length %d sectors)\n", track, size, mode, index0, index1, index2, (UINT32)(index1-index0)/size, (UINT32)(index2-index1)/size); | |
| 375 | 375 | |
| 376 | 376 | strcpy(outinfo->fname[track-1], tocfname); |
| 377 | 377 | outinfo->offset[track-1] = offset + (UINT32)(index1-index0); |
| r10613 | r10614 | |
|---|---|---|
| 89 | 89 | #if (!SDL_VERSION_ATLEAST(1,3,0)) |
| 90 | 90 | int extra_flags; /* Texture/surface flags */ |
| 91 | 91 | #else |
| 92 | //SDL_ScaleMode | |
| 92 | //SDL_ScaleMode sdl_scale_mode; /* sdl 1.3 scale mode */ | |
| 93 | 93 | int sdl_scale_mode; /* got removed recently - trying to get it in again */ |
| 94 | 94 | #endif |
| 95 | 95 | int pixel_format; /* Pixel/Overlay format */ |
| r10613 | r10614 | |
|---|---|---|
| 2091 | 2091 | * |
| 2092 | 2092 | * Shape the lut texture to achieve texture max size compliance and equal 2D partitioning |
| 2093 | 2093 | */ |
| 2094 | ||
| 2094 | ||
| 2095 | 2095 | if ( texture->format == SDL_TEXFORMAT_PALETTE16 ) |
| 2096 | 2096 | { |
| 2097 | 2097 | lut_texture_width = sqrt((double)(texture->lut_table_width)); |
| 2098 | 2098 | lut_texture_width = get_valid_pow2_value (lut_texture_width, 1); |
| 2099 | ||
| 2099 | ||
| 2100 | 2100 | texture->lut_table_height = texture->lut_table_width / lut_texture_width; |
| 2101 | ||
| 2101 | ||
| 2102 | 2102 | if ( lut_texture_width*texture->lut_table_height < texture->lut_table_width ) |
| 2103 | 2103 | { |
| 2104 | 2104 | texture->lut_table_height += 1; |
| 2105 | 2105 | } |
| 2106 | ||
| 2106 | ||
| 2107 | 2107 | texture->lut_table_width = lut_texture_width; |
| 2108 | } | |
| 2108 | } | |
| 2109 | 2109 | else |
| 2110 | 2110 | { |
| 2111 | 2111 | lut_texture_width = texture->lut_table_width; |
| r10613 | r10614 | |
|---|---|---|
| 96 | 96 | #if (SDL_VERSION_ATLEAST(1,3,0)) |
| 97 | 97 | // Needs to be here as well so we can identify window |
| 98 | 98 | SDL_Window *sdl_window; |
| 99 | SDL_Renderer | |
| 99 | SDL_Renderer | |
| 100 | 100 | // These are used in combine resizing events ... #if SDL13_COMBINE_RESIZE |
| 101 | 101 | int resize_width; |
| 102 | 102 | int resize_height; |
| r10613 | r10614 | |
|---|---|---|
| 1318 | 1318 | m68k->remaining_cycles -= 109; |
| 1319 | 1319 | break; |
| 1320 | 1320 | } |
| 1321 | // case 0x0e: // FSIN | |
| 1322 | // { | |
| 1323 | // // TODO | |
| 1324 | // break; | |
| 1325 | // } | |
| 1321 | // case 0x0e: // FSIN | |
| 1322 | // { | |
| 1323 | // // TODO | |
| 1324 | // break; | |
| 1325 | // } | |
| 1326 | 1326 | case 0x18: // FABS |
| 1327 | 1327 | { |
| 1328 | 1328 | REG_FP[dst] = source; |
| r10613 | r10614 | |
|---|---|---|
| 6701 | 6701 | m68k->cacr = REG_DA[(word2 >> 12) & 15] & 0x0f; |
| 6702 | 6702 | } |
| 6703 | 6703 | |
| 6704 | // | |
| 6704 | // logerror("movec to cacr=%04x\n", m68k->cacr); | |
| 6705 | 6705 | if (m68k->cacr & (M68K_CACR_CI | M68K_CACR_CEI)) |
| 6706 | 6706 | { |
| 6707 | 6707 | m68ki_ic_clear(m68k); |
| r10613 | r10614 | |
|---|---|---|
| 892 | 892 | |
| 893 | 893 | |
| 894 | 894 | /*********************************************************************************** |
| 895 | ||
| 895 | I/O ACCESS | |
| 896 | 896 | ***********************************************************************************/ |
| 897 | 897 | |
| 898 | 898 | INLINE UINT8 READPORT8(i386_state *cpustate, offs_t port) |
| r10613 | r10614 | |
|---|---|---|
| 445 | 445 | |
| 446 | 446 | void flip_screen_set(running_machine *machine, int on) |
| 447 | 447 | { |
| 448 | flip_screen_x_set(machine, on); | |
| 449 | flip_screen_y_set(machine, on); | |
| 448 | generic_video_private *state = machine->generic_video_data; | |
| 449 | if (on) on = ~0; | |
| 450 | if (state->flip_screen_x != on || state->flip_screen_y != on) | |
| 451 | { | |
| 452 | if (!on) updateflip(machine); // flip visarea back | |
| 453 | state->flip_screen_x = state->flip_screen_y = on; | |
| 454 | updateflip(machine); | |
| 455 | } | |
| 450 | 456 | } |
| 451 | 457 | |
| 452 | 458 | |
| r10613 | r10614 | |
| 463 | 469 | * bypass update_flip |
| 464 | 470 | */ |
| 465 | 471 | generic_video_private *state = machine->generic_video_data; |
| 472 | if (on) on = ~0; | |
| 466 | 473 | state->flip_screen_x = on; |
| 467 | 474 | } |
| 468 | 475 |
| r10613 | r10614 | |
|---|---|---|
| 458 | 458 | filerr = m_mngfile->open(name); |
| 459 | 459 | else |
| 460 | 460 | filerr = open_next(*m_mngfile, "mng"); |
| 461 | ||
| 461 | ||
| 462 | 462 | if (filerr == FILERR_NONE) |
| 463 | 463 | { |
| 464 | 464 | // start the capture |
| r10613 | r10614 | |
| 1096 | 1096 | |
| 1097 | 1097 | //------------------------------------------------- |
| 1098 | 1098 | // open_next - open the next non-existing file of |
| 1099 | // type filetype according to our numbering | |
| 1099 | // type filetype according to our numbering | |
| 1100 | 1100 | // scheme |
| 1101 | 1101 | //------------------------------------------------- |
| 1102 | 1102 |
| r10613 | r10614 | |
|---|---|---|
| 1003 | 1003 | if (config->input_ports()!=NULL) { |
| 1004 | 1004 | input_port_list_init(machine->m_portlist, config->input_ports(), errorbuf, sizeof(errorbuf), TRUE, config); |
| 1005 | 1005 | if (errorbuf[0] != 0) |
| 1006 | mame_printf_error("Input port errors:\n%s", errorbuf); | |
| 1006 | mame_printf_error("Input port errors:\n%s", errorbuf); | |
| 1007 | 1007 | } |
| 1008 | 1008 | } |
| 1009 | 1009 | |
| r10613 | r10614 | |
| 2937 | 2937 | field_config_insert(curfield, &maskbits, errorbuf, errorbuflen); |
| 2938 | 2938 | maskbits = 0; |
| 2939 | 2939 | |
| 2940 | string = TOKEN_GET_STRING(ipt); | |
| 2940 | string = TOKEN_GET_STRING(ipt); | |
| 2941 | 2941 | if (owner!=NULL) { |
| 2942 | 2942 | fulltag = core_strdup(owner->subtag(tempstring, string)); |
| 2943 | 2943 | } else { |
| r10613 | r10614 | |
|---|---|---|
| 152 | 152 | astring m_string; // string for text components |
| 153 | 153 | bitmap_t * m_bitmap; // source bitmap for images |
| 154 | 154 | astring m_dirname; // directory name of image file (for lazy loading) |
| 155 | emu_file * | |
| 155 | emu_file * | |
| 156 | 156 | astring m_imagefile; // name of the image file (for lazy loading) |
| 157 | 157 | astring m_alphafile; // name of the alpha file (for lazy loading) |
| 158 | 158 | bool m_hasalpha; // is there any alpha component present? |
| r10613 | r10614 | |
|---|---|---|
| 169 | 169 | chip->stream->update(); |
| 170 | 170 | shift = (offset & 1) ? 11 + 8 : 11; |
| 171 | 171 | |
| 172 | // | |
| 172 | // printf("%08x\n",(chip->chan[(offset & 0x0e) >> 1].addr)); | |
| 173 | 173 | |
| 174 | 174 | return (chip->chan[(offset & 0x0e) >> 1].addr) >> (shift); |
| 175 | 175 | } |
| r10613 | r10614 | |
|---|---|---|
| 18 | 18 | const device_type OKIM9810 = okim9810_device_config::static_alloc_device_config; |
| 19 | 19 | |
| 20 | 20 | |
| 21 | // volume lookup table. The manual lists a full 16 steps, 2dB per step. | |
| 21 | // volume lookup table. The manual lists a full 16 steps, 2dB per step. | |
| 22 | 22 | // Given the dB values, that seems to map to a 7-bit volume control. |
| 23 | 23 | const UINT8 okim9810_device::okim_voice::s_volume_table[16] = |
| 24 | 24 | { |
| r10613 | r10614 | |
| 41 | 41 | }; |
| 42 | 42 | |
| 43 | 43 | // sampling frequency lookup table. |
| 44 | const UINT32 okim9810_device::s_sampling_freq_table[16] = | |
| 44 | const UINT32 okim9810_device::s_sampling_freq_table[16] = | |
| 45 | 45 | { |
| 46 | 46 | 4000, |
| 47 | 47 | 8000, |
| r10613 | r10614 | |
| 150 | 150 | |
| 151 | 151 | // create the stream |
| 152 | 152 | //int divisor = m_config.m_pin7 ? 132 : 165; |
| 153 | m_stream = m_machine.sound().stream_alloc(*this, 0, | |
| 153 | m_stream = m_machine.sound().stream_alloc(*this, 0, 2, clock()); | |
| 154 | 154 | |
| 155 | 155 | // save state stuff |
| 156 | 156 | // m_TMP_register |
| r10613 | r10614 | |
| 196 | 196 | |
| 197 | 197 | void okim9810_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) |
| 198 | 198 | { |
| 199 | // reset the output stream | |
| 199 | // reset the output streams | |
| 200 | 200 | memset(outputs[0], 0, samples * sizeof(*outputs[0])); |
| 201 | ||
| 201 | memset(outputs[1], 0, samples * sizeof(*outputs[1])); | |
| 202 | ||
| 202 | 203 | // iterate over voices and accumulate sample data |
| 203 | 204 | for (int voicenum = 0; voicenum < OKIM9810_VOICES; voicenum++) |
| 204 | m_voice[voicenum].generate_audio(*m_direct, outputs | |
| 205 | m_voice[voicenum].generate_audio(*m_direct, outputs | |
| 205 | 206 | } |
| 206 | 207 | |
| 207 | 208 | |
| r10613 | r10614 | |
| 212 | 213 | UINT8 okim9810_device::read_status() |
| 213 | 214 | { |
| 214 | 215 | UINT8 result = 0x00; |
| 216 | UINT8 channelMask = 0x01; | |
| 217 | for (int i = 0; i < OKIM9810_VOICES; i++, channelMask <<= 1) | |
| 218 | { | |
| 219 | if (!m_voice[i].m_playing) | |
| 220 | result |= channelMask; | |
| 221 | } | |
| 215 | 222 | return result; |
| 216 | 223 | } |
| 217 | 224 | |
| 218 | 225 | |
| 219 | 226 | //------------------------------------------------- |
| 220 | // read - memory interface for read | |
| 227 | // read - memory interface for reading the active status | |
| 221 | 228 | //------------------------------------------------- |
| 222 | 229 | |
| 223 | 230 | READ8_MEMBER( okim9810_device::read ) |
| r10613 | r10614 | |
| 235 | 242 | { |
| 236 | 243 | const UINT8 cmd = (data & 0xf8) >> 3; |
| 237 | 244 | const UINT8 channel = (data & 0x07); |
| 238 | ||
| 245 | ||
| 239 | 246 | switch(cmd) |
| 240 | 247 | { |
| 241 | 248 | case 0x00: // START |
| 242 | 249 | { |
| 243 | mame_printf_ | |
| 250 | mame_printf_de | |
| 244 | 251 | UINT8 channelMask = 0x01; |
| 245 | 252 | for (int i = 0; i < OKIM9810_VOICES; i++, channelMask <<= 1) |
| 246 | 253 | { |
| 247 | 254 | if (channelMask & m_TMP_register) |
| 248 | 255 | { |
| 249 | 256 | m_voice[i].m_playing = true; |
| 250 | mame_printf_ | |
| 257 | mame_printf_de | |
| 251 | 258 | i, |
| 252 | 259 | m_voice[i].m_playbackAlgo, |
| 253 | 260 | m_voice[i].m_samplingFreq, |
| r10613 | r10614 | |
| 262 | 269 | } |
| 263 | 270 | case 0x01: // STOP |
| 264 | 271 | { |
| 265 | mame_printf_ | |
| 272 | mame_printf_de | |
| 266 | 273 | UINT8 channelMask = 0x01; |
| 267 | 274 | for (int i = 0; i < OKIM9810_VOICES; i++, channelMask <<= 1) |
| 268 | 275 | { |
| 269 | 276 | if (channelMask & m_TMP_register) |
| 270 | 277 | { |
| 271 | 278 | m_voice[i].m_playing = false; |
| 272 | mame_printf_ | |
| 279 | mame_printf_de | |
| 273 | 280 | } |
| 274 | 281 | } |
| 275 | 282 | break; |
| 276 | 283 | } |
| 277 | 284 | case 0x02: // LOOP |
| 278 | { | |
| 279 | mame_printf_verbose("LOOP channel mask %02x\n", m_TMP_register); | |
| 285 | { | |
| 286 | mame_printf_debug("LOOP channel mask %02x\n", m_TMP_register); | |
| 280 | 287 | UINT8 channelMask = 0x01; |
| 281 | 288 | for (int i = 0; i < OKIM9810_VOICES; i++, channelMask <<= 1) |
| 282 | 289 | { |
| 283 | 290 | if (channelMask & m_TMP_register) |
| 284 | 291 | { |
| 285 | 292 | m_voice[i].m_looping = true; |
| 286 | mame_printf_ | |
| 293 | mame_printf_de | |
| 287 | 294 | } |
| 288 | 295 | else |
| 289 | 296 | { |
| 290 | 297 | m_voice[i].m_looping = false; |
| 291 | mame_printf_ | |
| 298 | mame_printf_de | |
| 292 | 299 | } |
| 293 | 300 | } |
| 294 | 301 | break; |
| 295 | 302 | } |
| 296 | 303 | case 0x03: // OPT (options) |
| 297 | 304 | { |
| 298 | mame_printf_ | |
| 305 | mame_printf_de | |
| 299 | 306 | m_global_volume = (m_TMP_register & 0x18) >> 3; |
| 300 | 307 | m_filter_type = (m_TMP_register & 0x06) >> 1; |
| 301 | 308 | m_output_level = (m_TMP_register & 0x01); |
| 302 | mame_printf_verbose("\tOPT setting main volume scale to Vdd/%d\n", m_global_volume+1); | |
| 303 | mame_printf_verbose("\tOPT setting output filter type to %d\n", m_filter_type); | |
| 304 | mame_printf_verbose("\tOPT setting output amp level to %d\n", m_output_level); | |
| 309 | mame_printf_debug("\tOPT setting main volume scale to Vdd/%d\n", m_global_volume+1); | |
| 310 | mame_printf_debug("\tOPT setting output filter type to %d\n", m_filter_type); | |
| 311 | mame_printf_debug("\tOPT setting output amp level to %d\n", m_output_level); | |
| 305 | 312 | break; |
| 306 | 313 | } |
| 307 | 314 | case 0x04: // MUON (silence) |
| 308 | 315 | { |
| 309 | mame_printf_warning("MUON channel %d length %02x\n", channel, m_TMP_register); | |
| 316 | mame_printf_warning("MUON channel %d length %02x\n", channel, m_TMP_register); | |
| 310 | 317 | mame_printf_warning("MSM9810: UNIMPLEMENTED COMMAND!\n"); |
| 311 | 318 | break; |
| 312 | 319 | } |
| 313 | ||
| 320 | ||
| 314 | 321 | case 0x05: // FADR (phrase address) |
| 315 | 322 | { |
| 316 | 323 | const offs_t base = m_TMP_register * 8; |
| 317 | 324 | |
| 318 | 325 | offs_t startAddr; |
| 319 | | |
| 326 | | |
| 320 | 327 | startAddr = m_direct->read_raw_byte(base + 1) << 16; |
| 321 | 328 | startAddr |= m_direct->read_raw_byte(base + 2) << 8; |
| 322 | 329 | startAddr |= m_direct->read_raw_byte(base + 3) << 0; |
| 323 | 330 | |
| 324 | 331 | offs_t endAddr; |
| 325 | | |
| 332 | | |
| 326 | 333 | endAddr = m_direct->read_raw_byte(base + 5) << 16; |
| 327 | 334 | endAddr |= m_direct->read_raw_byte(base + 6) << 8; |
| 328 | 335 | endAddr |= m_direct->read_raw_byte(base + 7) << 0; |
| r10613 | r10614 | |
| 330 | 337 | // Sub-table |
| 331 | 338 | if (startFlags & 0x80) |
| 332 | 339 | { |
| 333 | offs_t oldStart = startAddr; | |
| 334 | // TODO: What does byte (oldStart + 0) refer to? | |
| 335 | startAddr = m_direct->read_raw_byte(oldStart + 1) << 16; | |
| 336 | startAddr |= m_direct->read_raw_byte(oldStart + 2) << 8; | |
| 337 | startAddr |= m_direct->read_raw_byte(oldStart + 3) << 0; | |
| 338 | ||
| 339 | // TODO: What does byte (oldStart + 4) refer to? | |
| 340 | endAddr = m_direct->read_raw_byte(oldStart + 5) << 16; | |
| 341 | endAddr |= m_direct->read_raw_byte(oldStart + 6) << 8; | |
| 342 | endAddr |= m_direct->read_raw_byte(oldStart + 7) << 0; | |
| 340 | offs_t subTable = startAddr; | |
| 341 | // TODO: New startFlags &= 0x80. Are there further subtables? | |
| 342 | startFlags = m_direct->read_raw_byte(subTable + 0); | |
| 343 | startAddr = m_direct->read_raw_byte(subTable + 1) << 16; | |
| 344 | startAddr |= m_direct->read_raw_byte(subTable + 2) << 8; | |
| 345 | startAddr |= m_direct->read_raw_byte(subTable + 3) << 0; | |
| 346 | ||
| 347 | // TODO: What does byte (subTable + 4) refer to? | |
| 348 | endAddr = m_direct->read_raw_byte(subTable + 5) << 16; | |
| 349 | endAddr |= m_direct->read_raw_byte(subTable + 6) << 8; | |
| 350 | endAddr |= m_direct->read_raw_byte(subTable + 7) << 0; | |
| 343 | 351 | } |
| 344 | 352 | |
| 345 | 353 | m_voice[channel].m_sample = 0; |
| 354 | m_voice[channel].m_interpSampleNum = 0; | |
| 346 | 355 | m_voice[channel].m_startFlags = startFlags; |
| 347 | 356 | m_voice[channel].m_base_offset = startAddr; |
| 348 | 357 | m_voice[channel].m_endFlags = endFlags; |
| 349 | m_voice[channel].m_count = (endAddr-startAddr) + 1; | |
| 358 | m_voice[channel].m_count = (endAddr-startAddr) + 1; | |
| 350 | 359 | |
| 351 | m_voice[channel].m_playbackAlgo = (startFlags & 0x30) >> 4; | |
| 360 | m_voice[channel].m_playbackAlgo = (startFlags & 0x30) >> 4; | |
| 352 | 361 | m_voice[channel].m_samplingFreq = s_sampling_freq_table[startFlags & 0x0f]; |
| 353 | if (m_voice[channel].m_playbackAlgo == OKIM9810_ADPCM_PLAYBACK || | |
| 362 | if (m_voice[channel].m_playbackAlgo == OKIM9810_ADPCM_PLAYBACK || | |
| 354 | 363 | m_voice[channel].m_playbackAlgo == OKIM9810_ADPCM2_PLAYBACK) |
| 355 | 364 | m_voice[channel].m_count *= 2; |
| 356 | 365 | else |
| 357 | mame_printf_warning("UNIMPLEMENTED PLAYBACK METHOD %d\n", m_voice[channel].m_playbackAlgo); | |
| 366 | mame_printf_warning("MSM9810: UNIMPLEMENTED PLAYBACK METHOD %d\n", m_voice[channel].m_playbackAlgo); | |
| 358 | 367 | |
| 359 | mame_printf_verbose("FADR channel %d phrase offset %02x => ", channel, m_TMP_register); | |
| 360 | mame_printf_verbose("startFlags(%02x) startAddr(%06x) endFlags(%02x) endAddr(%06x) bytes(%d)\n", startFlags, startAddr, endFlags, endAddr, endAddr-startAddr); | |
| 368 | mame_printf_debug("FADR channel %d phrase offset %02x => ", channel, m_TMP_register); | |
| 369 | mame_printf_debug("startFlags(%02x) startAddr(%06x) endFlags(%02x) endAddr(%06x) bytes(%d)\n", startFlags, startAddr, endFlags, endAddr, endAddr-startAddr); | |
| 361 | 370 | break; |
| 362 | 371 | } |
| 363 | 372 | |
| r10613 | r10614 | |
| 369 | 378 | } |
| 370 | 379 | case 0x07: // CVOL (channel volume) |
| 371 | 380 | { |
| 372 | mame_printf_verbose("CVOL channel %d data %02x\n", channel, m_TMP_register); | |
| 373 | mame_printf_verbose("\tChannel %d -> volume index %d.\n", channel, m_TMP_register & 0x0f); | |
| 381 | mame_printf_debug("CVOL channel %d data %02x\n", channel, m_TMP_register); | |
| 382 | mame_printf_debug("\tChannel %d -> volume index %d.\n", channel, m_TMP_register & 0x0f); | |
| 374 | 383 | |
| 375 | 384 | m_voice[channel].m_channel_volume = m_TMP_register & 0x0f; |
| 376 | 385 | break; |
| r10613 | r10614 | |
| 379 | 388 | { |
| 380 | 389 | const UINT8 leftVolIndex = (m_TMP_register & 0xf0) >> 4; |
| 381 | 390 | const UINT8 rightVolIndex = m_TMP_register & 0x0f; |
| 382 | mame_printf_verbose("PAN channel %d left index: %02x right index: %02x (%02x)\n", channel, leftVolIndex, rightVolIndex, m_TMP_register); | |
| 383 | mame_printf_verbose("\tChannel %d left -> %d right -> %d\n", channel, leftVolIndex, rightVolIndex); | |
| 391 | mame_printf_debug("PAN channel %d left index: %02x right index: %02x (%02x)\n", channel, leftVolIndex, rightVolIndex, m_TMP_register); | |
| 392 | mame_printf_debug("\tChannel %d left -> %d right -> %d\n", channel, leftVolIndex, rightVolIndex); | |
| 384 | 393 | m_voice[channel].m_pan_volume_left = leftVolIndex; |
| 385 | 394 | m_voice[channel].m_pan_volume_right = rightVolIndex; |
| 386 | 395 | break; |
| 387 | 396 | } |
| 388 | default: | |
| 397 | default: | |
| 389 | 398 | { |
| 390 | 399 | mame_printf_warning("MSM9810: UNKNOWN COMMAND!\n"); |
| 391 | 400 | break; |
| r10613 | r10614 | |
| 435 | 444 | m_sample(0), |
| 436 | 445 | m_channel_volume(0x00), |
| 437 | 446 | m_pan_volume_left(0x00), |
| 438 | m_pan_volume_right(0x00) | |
| 447 | m_pan_volume_right(0x00), | |
| 448 | m_startSample(0), | |
| 449 | m_endSample(0), | |
| 450 | m_interpSampleNum(0) | |
| 439 | 451 | { |
| 440 | 452 | } |
| 441 | 453 | |
| r10613 | r10614 | |
| 444 | 456 | // add them to an output stream |
| 445 | 457 | //------------------------------------------------- |
| 446 | 458 | |
| 447 | void okim9810_device::okim_voice::generate_audio(direct_read_data &direct, | |
| 448 | stream_sample_t *buffer, | |
| 459 | void okim9810_device::okim_voice::generate_audio(direct_read_data &direct, | |
| 460 | stream_sample_t **buffers, | |
| 449 | 461 | int samples, |
| 450 | const UINT8 global_volume) | |
| 462 | const UINT8 global_volume, | |
| 463 | const UINT32 clock, | |
| 464 | const UINT8 filter_type) | |
| 451 | 465 | { |
| 452 | 466 | // skip if not active |
| 453 | 467 | if (!m_playing) |
| 454 | 468 | return; |
| 455 | 469 | |
| 456 | // TODO: Stereo (it's only mono now [left channel]) | |
| 470 | // seperate out left and right channels | |
| 471 | stream_sample_t *outL = buffers[0]; | |
| 472 | stream_sample_t *outR = buffers[1]; | |
| 473 | ||
| 474 | // get left and right volumes | |
| 457 | 475 | UINT8 volume_scale_left = volume_scale(global_volume, m_channel_volume, m_pan_volume_left); |
| 476 | UINT8 volume_scale_right = volume_scale(global_volume, m_channel_volume, m_pan_volume_right); | |
| 458 | 477 | |
| 478 | // total samples per byte | |
| 479 | UINT32 totalInterpSamples = clock / m_samplingFreq; | |
| 480 | ||
| 459 | 481 | // loop while we still have samples to generate |
| 460 | 482 | while (samples-- != 0) |
| 461 | 483 | { |
| 462 | // fetch the next sample nibble | |
| 463 | int nibble = direct.read_raw_byte(m_base_offset + m_sample / 2) >> (((m_sample & 1) << 2) ^ 4); | |
| 464 | ||
| 465 | // output to the buffer, scaling by the volume | |
| 466 | // signal in range -2048..2047, volume in range 2..128 => signal * volume / 8 in range -32768..32767 | |
| 467 | switch (m_playbackAlgo) | |
| 484 | // If interpSampleNum == 0, we are at the beginning of a new interp chunk, gather data | |
| 485 | if (m_interpSampleNum == 0) | |
| 468 | 486 | { |
| 469 | case OKIM9810_ADPCM_PLAYBACK: | |
| 487 | // If m_sample == 0, we have begun to play a new voice. Get both the first nibble & the second. | |
| 488 | if (m_sample == 0) | |
| 470 | 489 | { |
| 471 | INT32 volSample = (INT32)m_adpcm.clock(nibble); | |
| 472 | volSample = (volSample * (INT32)volume_scale_left) / 8; | |
| 473 | *buffer++ += volSample; | |
| 474 | break; | |
| 490 | // fetch the first sample nibble | |
| 491 | int nibble0 = direct.read_raw_byte(m_base_offset + m_sample / 2) >> (((m_sample & 1) << 2) ^ 4); | |
| 492 | switch (m_playbackAlgo) | |
| 493 | { | |
| 494 | case OKIM9810_ADPCM_PLAYBACK: | |
| 495 | { | |
| 496 | m_adpcm.reset(); | |
| 497 | m_startSample = (INT32)m_adpcm.clock(nibble0); | |
| 498 | break; | |
| 499 | } | |
| 500 | case OKIM9810_ADPCM2_PLAYBACK: | |
| 501 | { | |
| 502 | m_adpcm2.reset(); | |
| 503 | m_startSample = (INT32)m_adpcm2.clock(nibble0); | |
| 504 | break; | |
| 505 | } | |
| 506 | default: | |
| 507 | break; | |
| 508 | } | |
| 475 | 509 | } |
| 476 | | |
| 510 | else | |
| 477 | 511 | { |
| 478 | INT32 volSample = (INT32)m_adpcm2.clock(nibble); | |
| 479 | volSample = (volSample * (INT32)volume_scale_left) / 8; | |
| 480 | *buffer++ += volSample; | |
| 481 | break; | |
| 512 | // Otherwise just move the second nibble back to the first spot. | |
| 513 | m_startSample = m_endSample; | |
| 482 | 514 | } |
| 483 | default: | |
| 484 | break; | |
| 515 | ||
| 516 | // And fetch the second sample nibble | |
| 517 | int nibble1 = direct.read_raw_byte(m_base_offset + (m_sample+1) / 2) >> ((((m_sample+1) & 1) << 2) ^ 4); | |
| 518 | switch (m_playbackAlgo) | |
| 519 | { | |
| 520 | case OKIM9810_ADPCM_PLAYBACK: | |
| 521 | { | |
| 522 | m_endSample = (INT32)m_adpcm.clock(nibble1); | |
| 523 | break; | |
| 524 | } | |
| 525 | case OKIM9810_ADPCM2_PLAYBACK: | |
| 526 | { | |
| 527 | m_endSample = (INT32)m_adpcm2.clock(nibble1); | |
| 528 | break; | |
| 529 | } | |
| 530 | default: | |
| 531 | break; | |
| 532 | } | |
| 485 | 533 | } |
| 486 | ||
| 487 | // next! | |
| 488 | if (++m_sample >= m_count) | |
| 534 | ||
| 535 | // TODO: Interpolate using proper numeric types. | |
| 536 | float progress = (float)m_interpSampleNum / (float)totalInterpSamples; | |
| 537 | INT32 interpValue = (INT32)((float)m_startSample + (((float)m_endSample-(float)m_startSample) * progress)); | |
| 538 | ||
| 539 | // if filtering is unwanted | |
| 540 | if (filter_type != OKIM9810_SECONDARY_FILTER && filter_type != OKIM9810_PRIMARY_FILTER) | |
| 541 | interpValue = m_startSample; | |
| 542 | ||
| 543 | // output to the stereo buffers, scaling by the volume | |
| 544 | // signal in range -2048..2047, volume in range 2..128 => signal * volume / 8 in range -32768..32767 | |
| 545 | INT32 interpValueL = (interpValue * (INT32)volume_scale_left) / 8; | |
| 546 | *outL++ += interpValueL; | |
| 547 | ||
| 548 | INT32 interpValueR = (interpValue * (INT32)volume_scale_right) / 8; | |
| 549 | *outR++ += interpValueR; | |
| 550 | ||
| 551 | // if the interpsample has reached its end, move on to the next sample | |
| 552 | m_interpSampleNum++; | |
| 553 | if (m_interpSampleNum >= totalInterpSamples) | |
| 554 | { | |
| 555 | m_interpSampleNum = 0; | |
| 556 | m_sample++; | |
| 557 | } | |
| 558 | ||
| 559 | // the end of the stream has been reached | |
| 560 | if (m_sample >= m_count) | |
| 489 | 561 | { |
| 490 | 562 | if (!m_looping) |
| 563 | { | |
| 491 | 564 | m_playing = false; |
| 565 | break; | |
| 566 | } | |
| 492 | 567 | else |
| 568 | { | |
| 493 | 569 | m_sample = 0; |
| 494 | ||
| 570 | } | |
| 495 | 571 | } |
| 496 | 572 | } |
| 497 | 573 | } |
| 498 | 574 | |
| 499 | 575 | |
| 500 | 576 | //------------------------------------------------- |
| 501 | // volume_scale - computes the volume equation as | |
| 502 | // seen on page 29 of the docs. | |
| 577 | // volume_scale - computes the volume equation as | |
| 578 | // seen on page 29 of the docs. | |
| 503 | 579 | // Returns a value from the volume lookup table. |
| 504 | 580 | //------------------------------------------------- |
| 505 | 581 | |
| 506 | UINT8 okim9810_device::okim_voice::volume_scale(const UINT8 global_volume, | |
| 507 | const UINT8 channel_volume, | |
| 508 | const UINT8 pan_volume) const | |
| 582 | UINT8 okim9810_device::okim_voice::volume_scale(const UINT8 global_volume_index, | |
| 583 | const UINT8 channel_volume_index, | |
| 584 | const UINT8 pan_volume_index) const | |
| 509 | 585 | { |
| 510 | const UINT8& V = channel_volume; | |
| 511 | const UINT8& L = pan_volume; | |
| 512 | const UINT8& O = global_volume; | |
| 586 | const UINT8& V = channel_volume_index; | |
| 587 | const UINT8& L = pan_volume_index; | |
| 588 | const UINT8& O = global_volume_index; | |
| 513 | 589 | UINT32 index = (V+L) + (O*3); |
| 514 | ||
| 590 | ||
| 515 | 591 | if (index > 15) |
| 516 | 592 | index = 15; |
| 517 | ||
| 593 | ||
| 518 | 594 | return s_volume_table[index]; |
| 519 | 595 | } |
| r10613 | r10614 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | OKI MSM9810 ADCPM(2) sound chip. |
| 6 | 6 | |
| 7 | Notes: | |
| 8 | The master clock frequency for this chip can range from 3.5MHz to 4.5Mhz. | |
| 7 | Notes: | |
| 8 | The master clock frequency for this chip can range from 3.5MHz to 4.5Mhz. | |
| 9 | 9 | The typical oscillator is a 4.096Mhz crystal. |
| 10 | 10 | |
| 11 | 11 | ***************************************************************************/ |
| r10613 | r10614 | |
| 24 | 24 | |
| 25 | 25 | enum |
| 26 | 26 | { |
| 27 | OKIM9810_SERIAL_PIN_LOW = 0, | |
| 28 | OKIM9810_SERIAL_PIN_HIGH = 1, | |
| 29 | // etc | |
| 30 | }; | |
| 31 | ||
| 32 | enum | |
| 33 | { | |
| 34 | 27 | OKIM9810_ADPCM_PLAYBACK = 0, |
| 35 | 28 | OKIM9810_ADPCM2_PLAYBACK = 1, |
| 36 | 29 | OKIM9810_STRAIGHT8_PLAYBACK = 2, |
| r10613 | r10614 | |
| 131 | 124 | { |
| 132 | 125 | public: |
| 133 | 126 | okim_voice(); |
| 134 | void generate_audio(direct_read_data &direct, | |
| 135 | stream_sample_t *buffer, | |
| 127 | void generate_audio(direct_read_data &direct, | |
| 128 | stream_sample_t **buffers, | |
| 136 | 129 | int samples, |
| 137 | const UINT8 global_volume); | |
| 130 | const UINT8 global_volume, | |
| 131 | const UINT32 clock, | |
| 132 | const UINT8 filter_type); | |
| 138 | 133 | |
| 139 | 134 | // computes volume scale from 3 volume numbers |
| 140 | 135 | UINT8 volume_scale(const UINT8 global_volume, |
| 141 | 136 | const UINT8 channel_volume, |
| 142 | 137 | const UINT8 pan_volume) const; |
| 143 | 138 | |
| 144 | oki_adpcm_state m_adpcm; // current ADPCM state | |
| 145 | oki_adpcm2_state m_adpcm2; // current ADPCM2 state | |
| 146 | UINT8 m_playbackAlgo; // current playback method | |
| 147 | bool m_looping; | |
| 148 | UINT8 m_startFlags; | |
| 149 | UINT8 m_endFlags; | |
| 150 | offs_t m_base_offset; // pointer to the base memory location | |
| 151 | UINT32 m_count; // total samples to play | |
| 152 | UINT32 m_samplingFreq; // voice sampling frequency | |
| 139 | oki_adpcm_state m_adpcm; // current ADPCM state | |
| 140 | oki_adpcm2_state m_adpcm2; // current ADPCM2 state | |
| 141 | UINT8 m_playbackAlgo; // current playback method | |
| 142 | bool m_looping; | |
| 143 | UINT8 m_startFlags; | |
| 144 | UINT8 m_endFlags; | |
| 145 | offs_t m_base_offset; // pointer to the base memory location | |
| 146 | UINT32 m_count; // total samples to play | |
| 147 | UINT32 m_samplingFreq; // voice sampling frequency | |
| 153 | 148 | |
| 154 | bool m_playing; // playback state | |
| 155 | UINT32 m_sample; // current sample number | |
| 149 | bool m_playing; // playback state | |
| 150 | UINT32 m_sample; // current sample number | |
| 156 | 151 | |
| 157 | UINT8 m_channel_volume; // volume set with the CVOL command | |
| 158 | UINT8 m_pan_volume_left; // volume set with the PAN command | |
| 159 | UINT8 m_pan_volume_right; // volume set with the PAN command | |
| 152 | UINT8 m_channel_volume; // volume index set with the CVOL command | |
| 153 | UINT8 m_pan_volume_left; // volume index set with the PAN command | |
| 154 | UINT8 m_pan_volume_right; // volume index set with the PAN command | |
| 160 | 155 | |
| 156 | INT32 m_startSample; // interpolation state - sample to interpolate from | |
| 157 | INT32 m_endSample; // interpolation state - sample to interpolate to | |
| 158 | UINT32 m_interpSampleNum; // interpolation state - fraction between start & end | |
| 159 | ||
| 161 | 160 | static const UINT8 s_volume_table[16]; |
| 162 | 161 | }; |
| 163 | 162 | |
| r10613 | r10614 | |
| 169 | 168 | direct_read_data* m_direct; |
| 170 | 169 | |
| 171 | 170 | UINT8 m_TMP_register; |
| 172 | ||
| 173 | UINT8 m_global_volume; // volume set with the OPT command | |
| 174 | UINT8 m_filter_type; | |
| 175 | UINT8 m_output_level; | |
| 176 | 171 | |
| 172 | UINT8 m_global_volume; // volume index set with the OPT command | |
| 173 | UINT8 m_filter_type; // interpolation filter type set with the OPT command | |
| 174 | UINT8 m_output_level; // flag stating if a voltage follower is connected | |
| 175 | ||
| 177 | 176 | static const int OKIM9810_VOICES = 8; |
| 178 | 177 | okim_voice m_voice[OKIM9810_VOICES]; |
| 179 | 178 |
| r10613 | r10614 | |
|---|---|---|
| 135 | 135 | #define MIFULL(aica) ((aica->udata.data[4]>>0x0)&0x0200) |
| 136 | 136 | #define MIEMPTY(aica) ((aica->udata.data[4]>>0x0)&0x0100) |
| 137 | 137 | |
| 138 | #define AFSEL(aica) ((aica->udata.data[6]>>0x0)&0x4000) | |
| 139 | #define MSLC(aica) ((aica->udata.data[6]>>0x8)&0x3F) | |
| 138 | #define AFSEL(aica) ((aica->udata.data[0xc/2]>>0x0)&0x4000) | |
| 139 | #define MSLC(aica) ((aica->udata.data[0xc/2]>>0x8)&0x3F) | |
| 140 | 140 | |
| 141 | 141 | #define SCILV0(aica) ((aica->udata.data[0xa8/2]>>0x0)&0xff) |
| 142 | 142 | #define SCILV1(aica) ((aica->udata.data[0xac/2]>>0x0)&0xff) |
| 143 | 143 | #define SCILV2(aica) ((aica->udata.data[0xb0/2]>>0x0)&0xff) |
| 144 | 144 | |
| 145 | #define MCIEB(aica) ((aica->udata.data[0xb4/2]>>0x0)&0xff) | |
| 146 | #define MCIPD(aica) ((aica->udata.data[0xb8/2]>>0x0)&0xff) | |
| 147 | #define MCIRE(aica) ((aica->udata.data[0xbc/2]>>0x0)&0xff) | |
| 148 | ||
| 145 | 149 | #define SCIEX0 0 |
| 146 | 150 | #define SCIEX1 1 |
| 147 | 151 | #define SCIEX2 2 |
| r10613 | r10614 | |
| 802 | 806 | AICA->IrqMidi=DecodeSCI(AICA,SCIMID); |
| 803 | 807 | } |
| 804 | 808 | break; |
| 809 | ||
| 810 | case 0xb4: | |
| 811 | case 0xb5: | |
| 812 | case 0xb6: | |
| 813 | case 0xb7: | |
| 814 | if (MCIEB(AICA) & 0x20) | |
| 815 | { | |
| 816 | logerror("AICA: Interrupt requested on SH-4!\n"); | |
| 817 | } | |
| 818 | break; | |
| 805 | 819 | } |
| 806 | 820 | } |
| 807 | 821 | |
| r10613 | r10614 | |
| 833 | 847 | case 0x10: // LP check |
| 834 | 848 | case 0x11: |
| 835 | 849 | { |
| 836 | int MSLC = (AICA->udata.data[0xc/2]>>8) & 0x3f; // which slot are we monitoring? | |
| 850 | int slotnum = MSLC(AICA); | |
| 851 | struct _SLOT *slot=AICA->Slots + slotnum; | |
| 852 | UINT16 LP = 0; | |
| 837 | 853 | if (!(AFSEL(AICA))) |
| 838 | 854 | { |
| 839 | struct _SLOT *slot=AICA->Slots + MSLC; | |
| 840 | UINT16 LP; | |
| 841 | 855 | UINT16 SGC; |
| 842 | 856 | int EG; |
| 843 | 857 | |
| r10613 | r10614 | |
| 851 | 865 | |
| 852 | 866 | AICA->udata.data[0x10/2] = (EG & 0x1FF8) | SGC | LP; |
| 853 | 867 | } |
| 868 | else | |
| 869 | { | |
| 870 | LP = slot->lpend ? 0x8000 : 0x0000; | |
| 871 | AICA->udata.data[0x10/2] = LP; | |
| 872 | } | |
| 854 | 873 | } |
| 855 | 874 | break; |
| 856 | 875 | |
| 857 | 876 | case 0x14: // CA (slot address) |
| 858 | 877 | case 0x15: |
| 859 | 878 | { |
| 860 | int MSLC = (AICA->udata.data[0xc/2]>>8) & 0x3f; // which slot are we monitoring? | |
| 861 | unsigned int CA = AICA->Slots[MSLC].cur_addr>>(SHIFT+12); | |
| 879 | int slotnum = MSLC(AICA); | |
| 880 | struct _SLOT *slot=AICA->Slots+slotnum; | |
| 881 | unsigned int CA = 0; | |
| 862 | 882 | |
| 883 | if (PCMS(slot) == 0) // 16-bit samples | |
| 884 | { | |
| 885 | CA = (slot->cur_addr>>(SHIFT-1))&AICA->RAM_MASK16; | |
| 886 | } | |
| 887 | else // 8-bit PCM and 4-bit ADPCM | |
| 888 | { | |
| 889 | CA = (slot->cur_addr>>SHIFT)&AICA->RAM_MASK; | |
| 890 | } | |
| 891 | ||
| 863 | 892 | AICA->udata.data[0x14/2] = CA; |
| 864 | 893 | } |
| 865 | 894 | break; |
| r10613 | r10614 | |
|---|---|---|
| 104 | 104 | frequency register, while the others have 0x400 as before. Should fix a bug |
| 105 | 105 | or two on sega games, particularly Vigilante on Sega Master System. Verified |
| 106 | 106 | on SMS hardware. |
| 107 | ||
| 107 | ||
| 108 | 108 | TODO: * Implement the TMS9919 - any difference to sn94624? |
| 109 | 109 | * Implement the T6W28; has registers in a weird order, needs writes |
| 110 | 110 | to be 'sanitized' first. Also is stereo, similar to game gear. |
| r10613 | r10614 | |
|---|---|---|
| 455 | 455 | 0x0334, 0x01B5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
| 456 | 456 | 0x0000, 0x0000, 0x01B4, 0x0136, 0x00B8, 0x005C, 0x8000, 0x8000 |
| 457 | 457 | }, |
| 458 | { // made up from studio small | |
| 458 | { // made up from studio small [used by BOF3] | |
| 459 | 459 | -0.3112f, |
| 460 | 460 | 0.7832f, |
| 461 | 461 | |
| r10613 | r10614 | |
| 476 | 476 | 0x031C, 0x025D, 0x025C, 0x018E, 0x022F, 0x0135, 0x01D2, 0x00B7, |
| 477 | 477 | 0x018F, 0x00B5, 0x00B4, 0x0080, 0x004C, 0x0026, 0x8000, 0x8000 |
| 478 | 478 | }, |
| 479 | { // made up from studio large | |
| 479 | { // made up from studio large [used by Fighters Impact] | |
| 480 | 480 | -0.3112f, |
| 481 | 481 | 0.7832f, |
| 482 | 482 |
| r10613 | r10614 | |
|---|---|---|
| 1 | 1 | /* |
| 2 | ||
| 2 | ||
| 3 | 3 | Sony PlayStation SPU (CXD2922BQ/CXD2925Q) emulator |
| 4 | 4 | by pSXAuthor |
| 5 | 5 | MAME adaptation by R. Belmont |
| 6 | ||
| 6 | ||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | #include "emu.h" |
| r10613 | r10614 | |
| 23 | 23 | //#define show_xa_debug |
| 24 | 24 | |
| 25 | 25 | //#ifndef _FINAL |
| 26 | // | |
| 26 | // #define show_cache_update | |
| 27 | 27 | //#endif |
| 28 | 28 | |
| 29 | 29 | #ifdef show_xa_debug |
| r10613 | r10614 | |
| 32 | 32 | #define debug_xa if (0) |
| 33 | 33 | #endif |
| 34 | 34 | |
| 35 | // | |
| 36 | 35 | // |
| 37 | 36 | // |
| 37 | // | |
| 38 | 38 | INLINE unsigned int min(unsigned int a, unsigned int b) |
| 39 | 39 | { |
| 40 | 40 | return (a > b) ? b : a; |
| r10613 | r10614 | |
| 125 | 125 | }; |
| 126 | 126 | |
| 127 | 127 | static const unsigned int sound_buffer_size=65536*4, |
| 128 | xa_sector_size=(18*28*8)<<1, | |
| 129 | xa_buffer_sectors=16, | |
| 130 | cdda_sector_size=2352, | |
| 131 | cdda_buffer_sectors=16, | |
| 128 | xa_sector_size=(18*28*8)<<1, | |
| 129 | xa_buffer_sectors=16, | |
| 130 | cdda_sector_size=2352, | |
| 131 | cdda_buffer_sectors=16, | |
| 132 | 132 | num_loop_cache_packets=4, |
| 133 | 133 | num_loop_cache_samples=num_loop_cache_packets*28, |
| 134 | 134 | spu_ram_size=512*1024, |
| r10613 | r10614 | |
| 341 | 341 | static unsigned int cache_size; |
| 342 | 342 | |
| 343 | 343 | sample_cache() |
| 344 | : | |
| 344 | : | |
| 345 | 345 | invalid_end(0), |
| 346 | 346 | last_update_end(0xffffffff), |
| 347 | 347 | data(NULL), |
| r10613 | r10614 | |
| 527 | 527 | public: |
| 528 | 528 | stream_buffer(const unsigned int _sector_size, |
| 529 | 529 | const unsigned int _num_sectors) |
| 530 | : | |
| 530 | : | |
| 531 | 531 | tail(0), |
| 532 | 532 | in(0), |
| 533 | 533 | sector_size(_sector_size), |
| 534 | 534 | num_sectors(_num_sectors), |
| 535 | marker_head(NULL), | |
| 535 | marker_head(NULL), | |
| 536 | 536 | marker_tail(NULL) |
| 537 | 537 | { |
| 538 | 538 | buffer_size=sector_size*num_sectors; |
| r10613 | r10614 | |
| 575 | 575 | |
| 576 | 576 | while ((marker_tail) && (marker_tail->sector>=sector)) |
| 577 | 577 | { |
| 578 | // | |
| 578 | // debug_xa("flushing: %d\n", marker_tail->sector); | |
| 579 | 579 | |
| 580 | 580 | stream_marker *xam=marker_tail; |
| 581 | 581 | head=xam->offset; |
| r10613 | r10614 | |
| 622 | 622 | bool passed=(((olddist==0) && (dist!=0)) || (dist>olddist)); |
| 623 | 623 | if (! passed) break; |
| 624 | 624 | |
| 625 | // | |
| 625 | // debug_xa("passed: %d\n",marker_head->sector); | |
| 626 | 626 | |
| 627 | 627 | stream_marker *xam=marker_head; |
| 628 | 628 | marker_head=xam->next; |
| r10613 | r10614 | |
| 896 | 896 | { |
| 897 | 897 | if ((cache) && (! cache->valid)) |
| 898 | 898 | { |
| 899 | /* log(log_spu,"cache_pointer::update: block %08x-%08x invalidated %08x-%08x\n", | |
| 900 | cache->start, | |
| 901 | cache->end, | |
| 902 | cache->invalid_start, | |
| 903 | cache->invalid_end);*/ | |
| 899 | /* log(log_spu,"cache_pointer::update: block %08x-%08x invalidated %08x-%08x\n", | |
| 900 | cache->start, | |
| 901 | cache->end, | |
| 902 | cache->invalid_start, | |
| 903 | cache->invalid_end);*/ | |
| 904 | 904 | |
| 905 | 905 | if (! cache->try_update(spu)) |
| 906 | 906 | { |
| r10613 | r10614 | |
| 1335 | 1335 | case 3: printf("exp dec: phase=%d val=%02x\n",(newval>>12)&1,newval&0x7f); break; |
| 1336 | 1336 | } |
| 1337 | 1337 | #endif |
| 1338 | } | |
| 1338 | } | |
| 1339 | 1339 | else |
| 1340 | 1340 | { |
| 1341 | 1341 | voice[v].vol[ch]=((int)newval<<17)>>17; |
| r10613 | r10614 | |
| 1397 | 1397 | for (unsigned int a=sc->start; a<sc->end; a+=16) |
| 1398 | 1398 | cache[a>>4]=NULL; |
| 1399 | 1399 | |
| 1400 | /* log_static(log_spu,"cache_invalidate: %08x->%08x\n", | |
| 1401 | sc->start, | |
| 1402 | sc->end);*/ | |
| 1400 | /* log_static(log_spu,"cache_invalidate: %08x->%08x\n", | |
| 1401 | sc->start, | |
| 1402 | sc->end);*/ | |
| 1403 | 1403 | |
| 1404 | 1404 | sc->invalid_start=min(sc->invalid_start,istart); |
| 1405 | 1405 | sc->invalid_end=max(sc->invalid_end,iend); |
| r10613 | r10614 | |
| 1413 | 1413 | |
| 1414 | 1414 | void spu_device::invalidate_cache(const unsigned int st, const unsigned int en) |
| 1415 | 1415 | { |
| 1416 | for (unsigned int a=st; a<en; a+=16) | |
| 1417 | if (cache[a>>4]) flush_cache(cache[a>>4],st,en); | |
| 1416 | for (unsigned int a=st; a<en; a+=16) | |
| 1417 | if (cache[a>>4]) flush_cache(cache[a>>4],st,en); | |
| 1418 | 1418 | } |
| 1419 | 1419 | |
| 1420 | 1420 | // |
| r10613 | r10614 | |
| 1423 | 1423 | |
| 1424 | 1424 | spu_device::sample_cache *spu_device::get_sample_cache(const unsigned int addr) |
| 1425 | 1425 | { |
| 1426 | // | |
| 1426 | // log_static(log_spu,"get_sample_cache: %08x\n",addr); | |
| 1427 | 1427 | |
| 1428 | 1428 | assert(addr<spu_ram_size); |
| 1429 | 1429 | sample_cache *sc=cache[addr>>4]; |
| r10613 | r10614 | |
| 1466 | 1466 | sc->dend=dp; |
| 1467 | 1467 | sc->add_ref(); |
| 1468 | 1468 | |
| 1469 | /* log_static(log_spu,"cache_add: %08x->%08x\n", | |
| 1470 | sc->start, | |
| 1471 | sc->end);*/ | |
| 1469 | /* log_static(log_spu,"cache_add: %08x->%08x\n", | |
| 1470 | sc->start, | |
| 1471 | sc->end);*/ | |
| 1472 | 1472 | |
| 1473 | 1473 | return sc; |
| 1474 | 1474 | } |
| r10613 | r10614 | |
| 1642 | 1642 | |
| 1643 | 1643 | void spu_device::update_voice_loop(const unsigned int v) |
| 1644 | 1644 | { |
| 1645 | // | |
| 1645 | // voicereg *vr=&spureg.voice[v]; | |
| 1646 | 1646 | voiceinfo *vi=&voice[v]; |
| 1647 | 1647 | unsigned int ra = 0; |
| 1648 | 1648 | |
| r10613 | r10614 | |
| 1723 | 1723 | // |
| 1724 | 1724 | // Process voice state and build output segments |
| 1725 | 1725 | // |
| 1726 | // Input: const unsigned int v Voice number | |
| 1727 | // const unsigned int sz Amount of time to process (in output samples) | |
| 1728 | // unsigned int *tleft Returned number of output samples remaining | |
| 1726 | // Input: const unsigned int v Voice number | |
| 1727 | // const unsigned int sz Amount of time to process (in output samples) | |
| 1728 | // unsigned int *tleft Returned number of output samples remaining | |
| 1729 | 1729 | // |
| 1730 | // | |
| 1730 | // Output: bool true if voice is still playing | |
| 1731 | 1731 | // |
| 1732 | 1732 | |
| 1733 | 1733 | bool spu_device::process_voice(const unsigned int v, |
| r10613 | r10614 | |
| 1761 | 1761 | |
| 1762 | 1762 | unsigned int ntoplay=fm?1:num, |
| 1763 | 1763 | nextevent=min(vi->samplestoend, |
| 1764 | | |
| 1764 | | |
| 1765 | 1765 | ntoplay=min(ntoplay,nextevent); |
| 1766 | 1766 | |
| 1767 | 1767 | if (ntoplay) |
| r10613 | r10614 | |
| 1931 | 1931 | // |
| 1932 | 1932 | // Generate voice output samples |
| 1933 | 1933 | // |
| 1934 | // Inputs: const unsigned int v Voice number | |
| 1935 | // void *ptr Output buffer (if no reverb) | |
| 1936 | // const unsigned int sz Number of samples to output | |
| 1934 | // Inputs: const unsigned int v Voice number | |
| 1935 | // void *ptr Output buffer (if no reverb) | |
| 1936 | // const unsigned int sz Number of samples to output | |
| 1937 | 1937 | // |
| 1938 | 1938 | |
| 1939 | 1939 | void spu_device::generate_voice(const unsigned int v, |
| r10613 | r10614 | |
| 1977 | 1977 | |
| 1978 | 1978 | vi->env_level+=(n*vi->env_delta); |
| 1979 | 1979 | |
| 1980 | if (noiseptr) | |
| 1980 | if (noiseptr) | |
| 1981 | 1981 | { |
| 1982 | 1982 | INT64 dptr=((INT64)n*vi->pitch)+vi->dptr; |
| 1983 | 1983 | unsigned int d=(unsigned int)(dptr>>12); |
| r10613 | r10614 | |
| 2087 | 2087 | sp+=(dptr>>12); |
| 2088 | 2088 | dptr&=0xfff; |
| 2089 | 2089 | } |
| 2090 | } | |
| 2090 | } | |
| 2091 | 2091 | else |
| 2092 | 2092 | { |
| 2093 | 2093 | while (n--) |
| r10613 | r10614 | |
| 2126 | 2126 | |
| 2127 | 2127 | if (! nsp) |
| 2128 | 2128 | { |
| 2129 | | |
| 2129 | | |
| 2130 | 2130 | if (vi->loop) nsp=vi->loop_cache->data; |
| 2131 | 2131 | } |
| 2132 | 2132 | |
| r10613 | r10614 | |
| 2143 | 2143 | |
| 2144 | 2144 | v+=((nv-v)*(int)dptr)>>12; |
| 2145 | 2145 | |
| 2146 | | |
| 2146 | | |
| 2147 | 2147 | r=(v*env_r)>>15; |
| 2148 | 2148 | env_l+=envdelta_l; |
| 2149 | 2149 | env_r+=envdelta_r; |
| r10613 | r10614 | |
| 2172 | 2172 | |
| 2173 | 2173 | v+=((nv-v)*(int)dptr)>>12; |
| 2174 | 2174 | |
| 2175 | | |
| 2175 | | |
| 2176 | 2176 | r=(v*env_r)>>15; |
| 2177 | 2177 | env_l+=envdelta_l; |
| 2178 | 2178 | env_r+=envdelta_r; |
| r10613 | r10614 | |
| 2287 | 2287 | |
| 2288 | 2288 | case 3: // sustain end |
| 2289 | 2289 | voice[v].envsamples=infinity; |
| 2290 | | |
| 2290 | | |
| 2291 | 2291 | if (voice[v].env_sr<=0.0f) |
| 2292 | 2292 | { |
| 2293 | 2293 | voice[v].env_level=0.0f; |
| r10613 | r10614 | |
| 2329 | 2329 | { |
| 2330 | 2330 | voice[v].loop.reset(); |
| 2331 | 2331 | |
| 2332 | // | |
| 2332 | // printf("key_on: %d @ %x (pitch %x)\n", v, spureg.voice[v].addr<<3, spureg.voice[v].pitch); | |
| 2333 | 2333 | |
| 2334 | 2334 | translate_sample_addr(spureg.voice[v].addr<<3,&voice[v].play); |
| 2335 | 2335 | assert(voice[v].play.ptr<voice[v].play.cache->dend); |
| r10613 | r10614 | |
| 2344 | 2344 | voice[v].forceloop=false; |
| 2345 | 2345 | |
| 2346 | 2346 | // Note: ChronoCross has note hang problems if this is 0 immediately |
| 2347 | // | |
| 2347 | // after key on | |
| 2348 | 2348 | spureg.voice[v].curvol=1; |
| 2349 | 2349 | |
| 2350 | 2350 | for (unsigned int ch=0; ch<2; ch++) |
| r10613 | r10614 | |
| 2392 | 2392 | } |
| 2393 | 2393 | } else |
| 2394 | 2394 | { |
| 2395 | | |
| 2395 | | |
| 2396 | 2396 | if (spureg.voice[v].srrr&srrr_sd) |
| 2397 | 2397 | voice[v].env_sr=-voice[v].env_sr; |
| 2398 | 2398 | } |
| r10613 | r10614 | |
| 2433 | 2433 | { |
| 2434 | 2434 | // Don't start playing until 8 frames worth of data are in |
| 2435 | 2435 | |
| 2436 | ||
| 2436 | ||
| 2437 | 2437 | { |
| 2438 | // debug_xa("waiting...\n"); | |
| 2439 | return; | |
| 2438 | // debug_xa("waiting...\n"); | |
| 2439 | return; | |
| 2440 | 2440 | } |
| 2441 | 2441 | |
| 2442 | 2442 | xa_playing=true; |
| r10613 | r10614 | |
| 2587 | 2587 | |
| 2588 | 2588 | void spu_device::key_off(const int v) |
| 2589 | 2589 | { |
| 2590 | // | |
| 2590 | // printf("key_off: %d\n", v); | |
| 2591 | 2591 | |
| 2592 | 2592 | if (voice[v].env_state<=3) |
| 2593 | 2593 | { |
| r10613 | r10614 | |
| 2608 | 2608 | |
| 2609 | 2609 | if (cur_reverb_preset==NULL) |
| 2610 | 2610 | { |
| 2611 | // | |
| 2611 | // printf("spu: reverb=unknown (reg 1c0 = %x)\n", reg[0x1c0]); | |
| 2612 | 2612 | } else |
| 2613 | 2613 | { |
| 2614 | // | |
| 2614 | // printf("spu: reverb=%s\n",cur_reverb_preset->name); | |
| 2615 | 2615 | spu_reverb_cfg=&cur_reverb_preset->cfg; |
| 2616 | 2616 | |
| 2617 | 2617 | if ((mame_stricmp("reverb off",cur_reverb_preset->name)) && (spu_reverb_cfg->band_gain<=0.0f)) |
| 2618 | 2618 | { |
| 2619 | // | |
| 2619 | // printf("spu: no reverb config for %s\n",cur_reverb_preset->name); | |
| 2620 | 2620 | } |
| 2621 | 2621 | } |
| 2622 | 2622 | |
| r10613 | r10614 | |
| 2970 | 2970 | for (int i=0; i<28; i++) |
| 2971 | 2971 | { |
| 2972 | 2972 | short d=xa[16+(i<<2)+s], |
| 2973 | d0=(d&0xf)<<12, | |
| 2974 | d1=(d>>4)<<12; | |
| 2973 | d0=(d&0xf)<<12, | |
| 2974 | d1=(d>>4)<<12; | |
| 2975 | 2975 | d0=clamp((int)(d0>>shift0)+(((l0*f0)+(l1*f1)+32)>>6)); |
| 2976 | 2976 | *dp++=d0; |
| 2977 | 2977 | l1=l0; |
| r10613 | r10614 | |
| 3000 | 3000 | /* |
| 3001 | 3001 | enum |
| 3002 | 3002 | { |
| 3003 | xaencoding_stereo_mask=3, | |
| 3004 | xaencoding_freq_shift=2, | |
| 3005 | xaencoding_freq_mask=3<<xaencoding_freq_shift, | |
| 3006 | xaencoding_bps_shift=4, | |
| 3007 | xaencoding_bps_mask=3<<xaencoding_bps_shift, | |
| 3008 | xaencoding_emphasis=(1<<6) | |
| 3003 | xaencoding_stereo_mask=3, | |
| 3004 | xaencoding_freq_shift=2, | |
| 3005 | xaencoding_freq_mask=3<<xaencoding_freq_shift, | |
| 3006 | xaencoding_bps_shift=4, | |
| 3007 | xaencoding_bps_mask=3<<xaencoding_bps_shift, | |
| 3008 | xaencoding_emphasis=(1<<6) | |
| 3009 | 3009 | }; |
| 3010 | 3010 | */ |
| 3011 | 3011 | |
| r10613 | r10614 | |
| 3015 | 3015 | |
| 3016 | 3016 | if (xa_buffer->get_bytes_free()<xa_sector_size) return false; |
| 3017 | 3017 | |
| 3018 | // | |
| 3018 | // debug_xa("play_xa: %d\n",sector); | |
| 3019 | 3019 | |
| 3020 | 3020 | // Get XA format from sector header |
| 3021 | 3021 | |
| r10613 | r10614 | |
| 3077 | 3077 | |
| 3078 | 3078 | void spu_device::flush_xa(const unsigned int sector) |
| 3079 | 3079 | { |
| 3080 | // | |
| 3080 | // debug_xa("flush_xa: %d\n",sector); | |
| 3081 | 3081 | |
| 3082 | 3082 | if (xa_playing) |
| 3083 | 3083 | { |
| r10613 | r10614 | |
| 3107 | 3107 | |
| 3108 | 3108 | void spu_device::flush_cdda(const unsigned int sector) |
| 3109 | 3109 | { |
| 3110 | // | |
| 3110 | // debug_xa("flush_cdda: %d\n",sector); | |
| 3111 | 3111 | |
| 3112 | 3112 | if (cdda_playing) |
| 3113 | 3113 | { |
| r10613 | r10614 | |
| 3134 | 3134 | spu_device *spu = machine->device<spu_device>("spu"); |
| 3135 | 3135 | UINT8 *psxram = (UINT8 *)memory_get_shared(*machine, "share1"); |
| 3136 | 3136 | |
| 3137 | // | |
| 3137 | // printf("SPU DMA write from %x, size %x\n", n_address, n_size); | |
| 3138 | 3138 | |
| 3139 | 3139 | spu->start_dma(psxram + n_address, true, n_size*4); |
| 3140 | 3140 | } |
| r10613 | r10614 | |
|---|---|---|
| 48 | 48 | |
| 49 | 49 | class stream_buffer; |
| 50 | 50 | |
| 51 | class spu_device : public device_t, public device_sound_interface | |
| 51 | class spu_device : public device_t, public device_sound_interface | |
| 52 | 52 | { |
| 53 | 53 | friend class spu_device_config; |
| 54 | 54 |
| r10613 | r10614 | |
|---|---|---|
| 111 | 111 | device_config_sound_interface(mconfig, *this), |
| 112 | 112 | device_config_memory_interface(mconfig, *this), |
| 113 | 113 | m_space_config("samples", ENDIANNESS_LITTLE, 8, 32, 0, NULL, *ADDRESS_MAP_NAME(bsmt2000)), |
| 114 | m_ready_callback(NULL) | |
| 114 | m_ready_callback(NULL) | |
| 115 | 115 | { |
| 116 | 116 | m_shortname = "bsmt2000"; |
| 117 | 117 | } |
| r10613 | r10614 | |
|---|---|---|
| 306 | 306 | // |
| 307 | 307 | |
| 308 | 308 | void reverb::process(signed short *output, |
| 309 | signed short *reverb_input, | |
| 310 | const reverb_params *rp, | |
| 311 | const int wetvol_l, | |
| 312 | const int wetvol_r, | |
| 309 | signed short *reverb_input, | |
| 310 | const reverb_params *rp, | |
| 311 | const int wetvol_l, | |
| 312 | const int wetvol_r, | |
| 313 | 313 | const unsigned int sz) |
| 314 | 314 | { |
| 315 | 315 | signed short *sp=(signed short *)reverb_input, |
| r10613 | r10614 | |
|---|---|---|
| 34 | 34 | const int wetvol_r, |
| 35 | 35 | const unsigned int _sz); |
| 36 | 36 | void comb_allpass4(signed short *sp, |
| 37 | signed short *dp, | |
| 38 | const comb_param &comb_delay, | |
| 39 | const int comb_gain, | |
| 40 | const int allpass_delay, | |
| 41 | const int allpass_gain, | |
| 42 | const int *rvol, | |
| 43 | const unsigned int sz); | |
| 37 | signed short *dp, | |
| 38 | const comb_param &comb_delay, | |
| 39 | const int comb_gain, | |
| 40 | const int allpass_delay, | |
| 41 | const int allpass_gain, | |
| 42 | const int *rvol, | |
| 43 | const unsigned int sz); | |
| 44 | 44 | void comb_allpass1(signed short *sp, |
| 45 | signed short *dp, | |
| 46 | const comb_param &comb_delay, | |
| 47 | const int comb_gain, | |
| 48 | const int allpass_delay, | |
| 49 | const int allpass_gain, | |
| 50 | const int *rvol, | |
| 51 | const unsigned int sz); | |
| 45 | signed short *dp, | |
| 46 | const comb_param &comb_delay, | |
| 47 | const int comb_gain, | |
| 48 | const int allpass_delay, | |
| 49 | const int allpass_gain, | |
| 50 | const int *rvol, | |
| 51 | const unsigned int sz); | |
| 52 | 52 | void bandpass(signed short *sp, |
| 53 | const reverb_params *rp, | |
| 54 | const unsigned int sz); | |
| 53 | const reverb_params *rp, | |
| 54 | const unsigned int sz); | |
| 55 | 55 | |
| 56 | 56 | public: |
| 57 | 57 | reverb(const int hz, const int maxdelay=65536); |
| r10613 | r10614 | |
|---|---|---|
| 176 | 176 | // compute the step value |
| 177 | 177 | int stepval = floor(floatstep * 1.08f); |
| 178 | 178 | floatstep = floatstep * 1.08f; |
| 179 | ||
| 179 | ||
| 180 | 180 | // loop over all nibbles and compute the difference |
| 181 | 181 | for (int nib = 0; nib < 16; nib++) |
| 182 | 182 | { |
| r10613 | r10614 | |
|---|---|---|
| 38 | 38 | // ======================> oki_adpcm2_state |
| 39 | 39 | |
| 40 | 40 | // Internal ADPCM2 state, used by external ADPCM generators with compatible specs to the OKI MSM9810. |
| 41 | // TODO: not thoroughly tested: is the output 15 bit? | |
| 41 | 42 | class oki_adpcm2_state |
| 42 | 43 | { |
| 43 | 44 | public: |
| r10613 | r10614 | |
|---|---|---|
| 461 | 461 | romdata->errorstring.catprintf(" EXPECTED: %s\n", hashes.macro_string(tempstr)); |
| 462 | 462 | romdata->errorstring.catprintf(" FOUND: %s\n", acthashes.macro_string(tempstr)); |
| 463 | 463 | |
| 464 | // warn about any ill-formed hashes | |
| 464 | // warn about any ill-formed hashes | |
| 465 | 465 | for (hash_base *hash = hashes.first(); hash != NULL; hash = hash->next()) |
| 466 | 466 | if (hash->parse_error()) |
| 467 | 467 | { |
| r10613 | r10614 | |
|---|---|---|
| 195 | 195 | { |
| 196 | 196 | hash_collection actual_hashes; |
| 197 | 197 | actual_hashes.compute((const UINT8 *)resource->ptr, resource->length, hash_collection::HASH_TYPES_CRC_SHA1); |
| 198 | ||
| 198 | ||
| 199 | 199 | hash_collection expected_hashes; |
| 200 | 200 | expected_hashes.add_from_string(hash_collection::HASH_SHA1, sha1, strlen(sha1)); |
| 201 | 201 |
| r10613 | r10614 | |
|---|---|---|
| 293 | 293 | |
| 294 | 294 | /* First allocate the new entry */ |
| 295 | 295 | new_entry = (feature_list *)pool_malloc_lib(swlist->pool, sizeof(feature_list) ); |
| 296 | ||
| 296 | ||
| 297 | 297 | if ( new_entry ) |
| 298 | 298 | { |
| 299 | 299 | new_entry->next = NULL; |
| r10613 | r10614 | |
| 455 | 455 | elem->other_info->name = NULL; |
| 456 | 456 | elem->other_info->value = NULL; |
| 457 | 457 | } |
| 458 | ||
| 458 | ||
| 459 | 459 | /* Handle the supported flag */ |
| 460 | 460 | elem->supported = SOFTWARE_SUPPORTED_YES; |
| 461 | 461 | if ( supported && ! strcmp( supported, "partial" ) ) |
| r10613 | r10614 | |
| 502 | 502 | { |
| 503 | 503 | const char *str_feature_name = NULL; |
| 504 | 504 | const char *str_feature_value = NULL; |
| 505 | ||
| 505 | ||
| 506 | 506 | for ( ; attributes[0]; attributes += 2 ) |
| 507 | 507 | { |
| 508 | 508 | if ( !strcmp( attributes[0], "name" ) ) |
| 509 | 509 | str_feature_name = attributes[1]; |
| 510 | ||
| 510 | ||
| 511 | 511 | if ( !strcmp( attributes[0], "value" ) ) |
| 512 | 512 | str_feature_value = attributes[1]; |
| 513 | 513 | } |
| 514 | ||
| 514 | ||
| 515 | 515 | /* Prepare for adding feature to feature list */ |
| 516 | 516 | if ( str_feature_name && swlist->softinfo ) |
| 517 | 517 | { |
| 518 | 518 | char *name = (char *)pool_malloc_lib(swlist->pool, ( strlen( str_feature_name ) + 1 ) * sizeof(char) ); |
| 519 | 519 | char *value = NULL; |
| 520 | ||
| 520 | ||
| 521 | 521 | if ( !name ) |
| 522 | 522 | return; |
| 523 | ||
| 523 | ||
| 524 | 524 | strcpy( name, str_feature_name ); |
| 525 | ||
| 525 | ||
| 526 | 526 | if ( str_feature_value ) |
| 527 | 527 | { |
| 528 | 528 | value = (char *)pool_malloc_lib(swlist->pool, ( strlen( str_feature_value ) + 1 ) * sizeof(char) ); |
| 529 | ||
| 529 | ||
| 530 | 530 | if ( !value ) |
| 531 | 531 | return; |
| 532 | ||
| 532 | ||
| 533 | 533 | strcpy( value, str_feature_value ); |
| 534 | 534 | } |
| 535 | ||
| 535 | ||
| 536 | 536 | add_info( swlist, name, value ); |
| 537 | 537 | } |
| 538 | 538 | } |
| r10613 | r10614 | |
| 862 | 862 | if ( swlist->softinfo && swlist->softinfo->other_info ) |
| 863 | 863 | { |
| 864 | 864 | feature_list *list = swlist->softinfo->other_info; |
| 865 | ||
| 865 | ||
| 866 | 866 | while( list->next ) |
| 867 | 867 | { |
| 868 | 868 | add_feature( swlist, list->next->name, list->next->value ); |
| r10613 | r10614 | |
|---|---|---|
| 59 | 59 | // construction/destruction |
| 60 | 60 | hash_crc(); |
| 61 | 61 | |
| 62 | // operators | |
| 62 | // operators | |
| 63 | 63 | operator UINT32() const { return (m_buffer[0] << 24) | (m_buffer[1] << 16) | (m_buffer[2] << 8) | m_buffer[3]; } |
| 64 | 64 | |
| 65 | 65 | // creation |
| r10613 | r10614 | |
| 153 | 153 | |
| 154 | 154 | int hash_base::fromhex(char c) |
| 155 | 155 | { |
| 156 | if (c >= '0' && c <= '9') | |
| 156 | if (c >= '0' && c <= '9') | |
| 157 | 157 | return c - '0'; |
| 158 | else if (c >= 'A' && c <= 'F') | |
| 158 | else if (c >= 'A' && c <= 'F') | |
| 159 | 159 | return c - 'A' + 10; |
| 160 | else if (c >= 'a' && c <= 'f') | |
| 160 | else if (c >= 'a' && c <= 'f') | |
| 161 | 161 | return (c - 'a' + 10); |
| 162 | 162 | else |
| 163 | 163 | return -1; |
| r10613 | r10614 | |
| 194 | 194 | |
| 195 | 195 | //------------------------------------------------- |
| 196 | 196 | // from_string - parse a string into the current |
| 197 | // | |
| 197 | // hash | |
| 198 | 198 | //------------------------------------------------- |
| 199 | 199 | |
| 200 | 200 | bool hash_base::from_string(const char *&string, int length) |
| 201 | 201 | { |
| 202 | // reset the error and our buffer | |
| 203 | m_parse_error = false; | |
| 204 | memset(m_bufptr, 0, m_length); | |
| 205 | ||
| 206 | // special case for idiom HASH(1) to map to a dummy (0) hash | |
| 207 | if (string[0] == '1' && fromhex(string[1]) == -1) | |
| 208 | { | |
| 209 | string++; | |
| 210 | return true; | |
| 211 | } | |
| 212 | ||
| 202 | 213 | // fail if we're too short |
| 203 | 214 | if (length < 2 * m_length) |
| 204 | 215 | return false; |
| 205 | 216 | |
| 206 | 217 | // loop over bytes |
| 207 | m_parse_error = false; | |
| 208 | 218 | for (int index = 0; index < m_length; index++) |
| 209 | 219 | { |
| 210 | 220 | // parse the upper digit |
| r10613 | r10614 | |
| 212 | 222 | if (upper == -1) |
| 213 | 223 | { |
| 214 | 224 | m_parse_error = true; |
| 215 | memset(m_bufptr, 0, m_length); | |
| 216 | 225 | return false; |
| 217 | 226 | } |
| 218 | ||
| 227 | ||
| 219 | 228 | // parse the lower digit |
| 220 | 229 | int lower = fromhex(string[1]); |
| 221 | 230 | if (lower == -1) |
| 222 | 231 | { |
| 223 | 232 | m_parse_error = true; |
| 224 | memset(m_bufptr, 0, m_length); | |
| 225 | 233 | return false; |
| 226 | 234 | } |
| 227 | 235 | |
| 228 | // set the byte and advance | |
| 236 | // set the byte and advance | |
| 229 | 237 | m_bufptr[index] = (upper << 4) | lower; |
| 230 | 238 | string += 2; |
| 231 | 239 | } |
| 232 | 240 | return true; |
| 233 | 241 | } |
| 234 | 242 | |
| 235 | ||
| 236 | 243 | |
| 244 | ||
| 237 | 245 | //************************************************************************** |
| 238 | 246 | // HASH CRC |
| 239 | 247 | //************************************************************************** |
| r10613 | r10614 | |
| 500 | 508 | |
| 501 | 509 | |
| 502 | 510 | //------------------------------------------------- |
| 503 | // add_from_buffer - add a new hash, importing | |
| 511 | // add_from_buffer - add a new hash, importing | |
| 504 | 512 | // from a buffer |
| 505 | 513 | //------------------------------------------------- |
| 506 | 514 | |
| r10613 | r10614 | |
| 515 | 523 | hash_base *newhash = alloc_by_id(type); |
| 516 | 524 | if (newhash == NULL) |
| 517 | 525 | return NULL; |
| 518 | ||
| 526 | ||
| 519 | 527 | // then import |
| 520 | 528 | if (!newhash->from_buffer(buffer, bufflen)) |
| 521 | 529 | { |
| 522 | 530 | global_free(newhash); |
| 523 | 531 | return NULL; |
| 524 | 532 | } |
| 525 | ||
| 533 | ||
| 526 | 534 | // and append to our list |
| 527 | 535 | return &m_hashlist.append(*newhash); |
| 528 | 536 | } |
| 529 | 537 | |
| 530 | 538 | |
| 531 | 539 | //------------------------------------------------- |
| 532 | // add_from_string - add a new hash, importing | |
| 540 | // add_from_string - add a new hash, importing | |
| 533 | 541 | // from a string |
| 534 | 542 | //------------------------------------------------- |
| 535 | 543 | |
| r10613 | r10614 | |
| 544 | 552 | hash_base *newhash = alloc_by_id(type); |
| 545 | 553 | if (newhash == NULL) |
| 546 | 554 | return NULL; |
| 547 | ||
| 555 | ||
| 548 | 556 | // then import |
| 549 | 557 | if (!newhash->from_string(buffer, length)) |
| 550 | 558 | { |
| 551 | 559 | global_free(newhash); |
| 552 | 560 | return NULL; |
| 553 | 561 | } |
| 554 | ||
| 562 | ||
| 555 | 563 | // and append to our list |
| 556 | 564 | return &m_hashlist.append(*newhash); |
| 557 | 565 | } |
| r10613 | r10614 | |
| 570 | 578 | m_hashlist.remove(*hash); |
| 571 | 579 | return true; |
| 572 | 580 | } |
| 573 | ||
| 581 | ||
| 574 | 582 | // didn't find it |
| 575 | 583 | return false; |
| 576 | 584 | } |
| r10613 | r10614 | |
| 605 | 613 | buffer[1] = crc >> 16; |
| 606 | 614 | buffer[2] = crc >> 8; |
| 607 | 615 | buffer[3] = crc >> 0; |
| 608 | ||
| 616 | ||
| 609 | 617 | // add it the standard way |
| 610 | 618 | return add_from_buffer(HASH_CRC, buffer, sizeof(buffer)); |
| 611 | 619 | } |
| 612 | 620 | |
| 613 | 621 | |
| 614 | 622 | //------------------------------------------------- |
| 615 | // internal_string - convert set of hashes and | |
| 616 | // flags to a string in our internal compact | |
| 623 | // internal_string - convert set of hashes and | |
| 624 | // flags to a string in our internal compact | |
| 617 | 625 | // format |
| 618 | 626 | //------------------------------------------------- |
| 619 | 627 | |
| 620 | 628 | const char *hash_collection::internal_string(astring &buffer) const |
| 621 | 629 | { |
| 622 | 630 | astring temp; |
| 623 | ||
| 631 | ||
| 624 | 632 | // output hashes first |
| 625 | 633 | buffer.reset(); |
| 626 | 634 | for (hash_base *hash = m_hashlist.first(); hash != NULL; hash = hash->next()) |
| r10613 | r10614 | |
| 633 | 641 | |
| 634 | 642 | |
| 635 | 643 | //------------------------------------------------- |
| 636 | // macro_string - convert set of hashes and | |
| 644 | // macro_string - convert set of hashes and | |
| 637 | 645 | // flags to a string in the macroized format |
| 638 | 646 | //------------------------------------------------- |
| 639 | 647 | |
| r10613 | r10614 | |
| 671 | 679 | // determine the end of the string |
| 672 | 680 | const char *stringend = string + strlen(string); |
| 673 | 681 | const char *ptr = string; |
| 674 | ||
| 682 | ||
| 675 | 683 | // loop until we hit it |
| 676 | 684 | bool errors = false; |
| 677 | 685 | while (ptr < stringend) |
| 678 | 686 | { |
| 679 | 687 | char c = *ptr++; |
| 680 | 688 | char lc = tolower(c); |
| 681 | ||
| 689 | ||
| 682 | 690 | // non-hex alpha values specify a hash type |
| 683 | 691 | if (lc >= 'g' && lc <= 'z') |
| 684 | 692 | { |
| r10613 | r10614 | |
| 692 | 700 | else |
| 693 | 701 | errors = true; |
| 694 | 702 | } |
| 695 | ||
| 703 | ||
| 696 | 704 | // hex values are ignored, though unexpected |
| 697 | 705 | else if ((lc >= '0' && lc <= '9') || (lc >= 'a' && lc <= 'f')) |
| 698 | 706 | errors = true; |
| 699 | ||
| 707 | ||
| 700 | 708 | // anything else is a flag |
| 701 | 709 | else |
| 702 | 710 | m_flags.cat(c); |
| r10613 | r10614 | |
| 718 | 726 | m_hashlist.append(*alloc_by_id(HASH_MD5)).begin(); |
| 719 | 727 | m_hashlist.append(*alloc_by_id(HASH_SHA1)).begin(); |
| 720 | 728 | } |
| 721 | ||
| 729 | ||
| 722 | 730 | // otherwise, just allocate the ones that are specified |
| 723 | 731 | else |
| 724 | 732 | { |
| r10613 | r10614 | |
| 728 | 736 | hash_base *existing = hash(*scan); |
| 729 | 737 | if (existing != NULL) |
| 730 | 738 | m_hashlist.remove(*existing); |
| 731 | ||
| 739 | ||
| 732 | 740 | // append a new one |
| 733 | 741 | m_hashlist.append(*alloc_by_id(*scan)).begin(); |
| 734 | 742 | } |
| r10613 | r10614 | |
| 763 | 771 | |
| 764 | 772 | |
| 765 | 773 | //------------------------------------------------- |
| 766 | // alloc_by_id - based on the ID character, | |
| 774 | // alloc_by_id - based on the ID character, | |
| 767 | 775 | // allocate a new hash |
| 768 | 776 | //------------------------------------------------- |
| 769 | 777 | |
| r10613 | r10614 | |
| 780 | 788 | |
| 781 | 789 | |
| 782 | 790 | //------------------------------------------------- |
| 783 | // copyfrom - copy everything from another | |
| 791 | // copyfrom - copy everything from another | |
| 784 | 792 | // collection |
| 785 | 793 | //------------------------------------------------- |
| 786 | 794 | |
| r10613 | r10614 | |
| 788 | 796 | { |
| 789 | 797 | // copy flags directly |
| 790 | 798 | m_flags = src.m_flags; |
| 791 | ||
| 799 | ||
| 792 | 800 | // rebuild the hashlist by copying from the source |
| 793 | 801 | m_hashlist.reset(); |
| 794 | 802 | for (hash_base *hash = src.first(); hash != NULL; hash = hash->next()) |
| r10613 | r10614 | |
|---|---|---|
| 73 | 73 | public: |
| 74 | 74 | // construction/destruction |
| 75 | 75 | hash_base(char id, const char *name, UINT8 length, UINT8 *bufptr); |
| 76 | ||
| 76 | ||
| 77 | 77 | // operators |
| 78 | 78 | bool operator==(const hash_base &rhs) const { return (m_length == rhs.m_length && memcmp(m_bufptr, rhs.m_bufptr, m_length) == 0); } |
| 79 | 79 | bool operator!=(const hash_base &rhs) const { return (m_length != rhs.m_length || memcmp(m_bufptr, rhs.m_bufptr, m_length) != 0); } |
| 80 | ||
| 80 | ||
| 81 | 81 | // getters |
| 82 | 82 | hash_base *next() const { return m_next; } |
| 83 | 83 | char id() const { return m_id; } |
| r10613 | r10614 | |
| 86 | 86 | bool in_progress() const { return m_in_progress; } |
| 87 | 87 | bool parse_error() const { return m_parse_error; } |
| 88 | 88 | UINT8 byte(int index) const { return (index >= 0 && index < m_length) ? m_bufptr[index] : 0; } |
| 89 | ||
| 89 | ||
| 90 | 90 | // buffer conversion |
| 91 | 91 | const UINT8 *buffer() { return m_bufptr; } |
| 92 | 92 | bool from_buffer(const UINT8 *buffer, int buflen); |
| 93 | ||
| 93 | ||
| 94 | 94 | // string conversion |
| 95 | 95 | const char *string(astring &buffer); |
| 96 | 96 | bool from_string(const char *&string, int length); |
| 97 | ||
| 97 | ||
| 98 | 98 | // creation |
| 99 | 99 | virtual void begin() = 0; |
| 100 | 100 | virtual void buffer(const UINT8 *data, UINT32 length) = 0; |
| 101 | 101 | virtual void end() = 0; |
| 102 | ||
| 102 | ||
| 103 | 103 | protected: |
| 104 | 104 | // internal helpers |
| 105 | 105 | int fromhex(char c); |
| 106 | ||
| 106 | ||
| 107 | 107 | // internal state |
| 108 | 108 | hash_base * m_next; |
| 109 | 109 | const char * m_name; |
| r10613 | r10614 | |
| 125 | 125 | static const char HASH_CRC = 'R'; |
| 126 | 126 | static const char HASH_MD5 = 'M'; |
| 127 | 127 | static const char HASH_SHA1 = 'S'; |
| 128 | ||
| 128 | ||
| 129 | 129 | // common combinations for requests |
| 130 | 130 | static const char *HASH_TYPES_CRC; |
| 131 | 131 | static const char *HASH_TYPES_CRC_SHA1; |
| 132 | 132 | static const char *HASH_TYPES_ALL; |
| 133 | ||
| 133 | ||
| 134 | 134 | // flags are identified by punctuation marks |
| 135 | 135 | static const char FLAG_NO_DUMP = '!'; |
| 136 | 136 | static const char FLAG_BAD_DUMP = '^'; |
| r10613 | r10614 | |
| 140 | 140 | hash_collection(const char *string); |
| 141 | 141 | hash_collection(const hash_collection &src); |
| 142 | 142 | ~hash_collection(); |
| 143 | ||
| 143 | ||
| 144 | 144 | // operators |
| 145 | 145 | hash_collection &operator=(const hash_collection &src); |
| 146 | 146 | bool operator==(const hash_collection &rhs) const; |
| r10613 | r10614 | |
| 158 | 158 | hash_base *add_from_buffer(char type, const UINT8 *buffer, int bufflen); |
| 159 | 159 | hash_base *add_from_string(char type, const char *buffer, int length); |
| 160 | 160 | bool remove(char type); |
| 161 | ||
| 161 | ||
| 162 | 162 | // CRC-specific helpers |
| 163 | 163 | bool crc(UINT32 &result); |
| 164 | 164 | hash_base *add_crc(UINT32 crc); |
| 165 | 165 | |
| 166 | // string conversion | |
| 166 | // string conversion | |
| 167 | 167 | const char *internal_string(astring &buffer) const; |
| 168 | 168 | const char *macro_string(astring &buffer) const; |
| 169 | 169 | bool from_internal_string(const char *string); |
| 170 | ||
| 170 | ||
| 171 | 171 | // creation |
| 172 | 172 | void begin(const char *types = NULL); |
| 173 | 173 | void buffer(const UINT8 *data, UINT32 length); |
| r10613 | r10614 | |
| 181 | 181 | |
| 182 | 182 | // internal state |
| 183 | 183 | astring m_flags; |
| 184 | simple_list<hash_base> | |
| 184 | simple_list<hash_base> | |
| 185 | 185 | }; |
| 186 | 186 | |
| 187 | 187 |
| r10613 | r10614 | |
|---|---|---|
| 456 | 456 | { |
| 457 | 457 | int parent; |
| 458 | 458 | const char *merge_name = NULL; |
| 459 | ||
| 459 | ||
| 460 | 460 | for (parent = 0; parent < parents; ++parent) |
| 461 | 461 | { |
| 462 | 462 | const machine_config *pconfig = &pinfoarray[parent]->mconfig; |
| r10613 | r10614 | |
| 1054 | 1054 | input_port_list_init(portlist, cfg->input_ports(), NULL, 0, FALSE, cfg); |
| 1055 | 1055 | } |
| 1056 | 1056 | } |
| 1057 | ||
| 1057 | ||
| 1058 | 1058 | /* print the header and the game name */ |
| 1059 | 1059 | fprintf(out, "\t<" XML_TOP); |
| 1060 | 1060 | fprintf(out, " name=\"%s\"", xml_normalize_string(game->name) ); |
| r10613 | r10614 | |
|---|---|---|
| 83 | 83 | const char * name; /* name of item */ |
| 84 | 84 | UINT32 explength; /* expected length of item */ |
| 85 | 85 | UINT32 length; /* actual length of item */ |
| 86 | hash_collection exphashes; | |
| 86 | hash_collection exphashes; | |
| 87 | 87 | hash_collection hashes; /* actual hash information */ |
| 88 | 88 | }; |
| 89 | 89 |
| r10613 | r10614 | |
|---|---|---|
| 183 | 183 | sdar = shift & 1; |
| 184 | 184 | shift >>= 1; |
| 185 | 185 | bit++; |
| 186 | ||
| 186 | ||
| 187 | 187 | if(bit == 8) { |
| 188 | 188 | bit = 0; |
| 189 | 189 | byte++; |
| r10613 | r10614 | |
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | 267 | break; |
| 268 | ||
| 268 | ||
| 269 | 269 | case STATE_READ_DATA: |
| 270 | 270 | if(bit < 8) { |
| 271 | 271 | if(bit == 0) { |
| r10613 | r10614 | |
|---|---|---|
| 11 | 11 | public: |
| 12 | 12 | device_secure_serial_flash_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock, UINT32 param = 0); |
| 13 | 13 | }; |
| 14 | ||
| 14 | ||
| 15 | 15 | class device_secure_serial_flash : public device_t, |
| 16 | 16 | public device_nvram_interface |
| 17 | 17 | { |
| r10613 | r10614 | |
|---|---|---|
| 335 | 335 | byte = 0; |
| 336 | 336 | break; |
| 337 | 337 | } |
| 338 | ||
| 338 | ||
| 339 | 339 | bit = 0; |
| 340 | 340 | shift = 0; |
| 341 | 341 | } |
| r10613 | r10614 | |
|---|---|---|
| 353 | 353 | inline attotime max(const attotime &left, const attotime &right) |
| 354 | 354 | { |
| 355 | 355 | if (left.seconds > right.seconds) |
| 356 | return left; | |
| 357 | if (left.seconds < right.seconds) | |
| 356 | 358 | return right; |
| 357 | if (left.seconds | |
| 359 | if (left.attoseconds > right.attoseconds) | |
| 358 | 360 | return left; |
| 359 | if (left.attoseconds > right.attoseconds) | |
| 360 | return right; | |
| 361 | return left; | |
| 361 | return right; | |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 |
| r10613 | r10614 | |
|---|---|---|
| 164 | 164 | const rectangle &visible_area() const { return m_visarea; } |
| 165 | 165 | bitmap_format format() const { return m_config.m_format; } |
| 166 | 166 | render_container &container() const { assert(m_container != NULL); return *m_container; } |
| 167 | bool screen_update(bitmap_t &bitmap, const rectangle &cliprect); | |
| 167 | bool screen_update(bitmap_t &bitmap, const rectangle &cliprect); | |
| 168 | 168 | void screen_eof(); |
| 169 | 169 | |
| 170 | 170 | // dynamic configuration |
| r10613 | r10614 | |
| 286 | 286 | #define SCREEN_EOF(name) void SCREEN_EOF_NAME(name)(screen_device *screen, running_machine *machine) |
| 287 | 287 | #define SCREEN_EOF_CALL(name) SCREEN_EOF_NAME(name)(screen, machine) |
| 288 | 288 | |
| 289 | #define screen_eof_0 NULL | |
| 290 | ||
| 289 | 291 | #define MCFG_SCREEN_ADD(_tag, _type) \ |
| 290 | 292 | MCFG_DEVICE_ADD(_tag, SCREEN, 0) \ |
| 291 | 293 | MCFG_SCREEN_TYPE(_type) \ |
| r10613 | r10614 | |
|---|---|---|
| 118 | 118 | |
| 119 | 119 | |
| 120 | 120 | //------------------------------------------------- |
| 121 | // next - return information about the next file | |
| 121 | // next - return information about the next file | |
| 122 | 122 | // in the search path |
| 123 | 123 | //------------------------------------------------- |
| 124 | 124 | |
| r10613 | r10614 | |
| 213 | 213 | for (const char *scan = types; *scan != 0; scan++) |
| 214 | 214 | if (m_hashes.hash(*scan) == NULL) |
| 215 | 215 | needed.cat(*scan); |
| 216 | ||
| 216 | ||
| 217 | 217 | // if we need nothing, skip it |
| 218 | 218 | if (!needed) |
| 219 | 219 | return m_hashes; |
| 220 | ||
| 220 | ||
| 221 | 221 | // load the ZIP file if needed |
| 222 | 222 | if (m_zipfile != NULL && load_zipped_file() != FILERR_NONE) |
| 223 | 223 | return m_hashes; |
| r10613 | r10614 | |
| 323 | 323 | // if we're open from a previous attempt, close up now |
| 324 | 324 | if (m_file != NULL) |
| 325 | 325 | close(); |
| 326 | ||
| 326 | ||
| 327 | 327 | // loop over paths |
| 328 | 328 | file_error filerr = FILERR_NOT_FOUND; |
| 329 | 329 | while (m_iterator.next(m_fullpath)) |
| r10613 | r10614 | |
| 351 | 351 | |
| 352 | 352 | |
| 353 | 353 | //------------------------------------------------- |
| 354 | // open_ram - open a "file" which is actually | |
| 354 | // open_ram - open a "file" which is actually | |
| 355 | 355 | // just an array of data in RAM |
| 356 | 356 | //------------------------------------------------- |
| 357 | 357 | |
| r10613 | r10614 | |
| 360 | 360 | // set a fake filename and CRC |
| 361 | 361 | m_filename = "RAM"; |
| 362 | 362 | m_crc = 0; |
| 363 | ||
| 363 | ||
| 364 | 364 | // use the core_file's built-in RAM support |
| 365 | 365 | return core_fopen_ram(data, length, m_openflags, &m_file); |
| 366 | 366 | } |
| r10613 | r10614 | |
| 377 | 377 | if (m_zipfile != NULL) |
| 378 | 378 | zip_file_close(m_zipfile); |
| 379 | 379 | m_zipfile = NULL; |
| 380 | ||
| 380 | ||
| 381 | 381 | if (m_file != NULL) |
| 382 | 382 | core_fclose(m_file); |
| 383 | 383 | m_file = NULL; |
| 384 | ||
| 384 | ||
| 385 | 385 | if (m_zipdata != NULL) |
| 386 | 386 | global_free(m_zipdata); |
| 387 | 387 | m_zipdata = NULL; |
| 388 | ||
| 388 | ||
| 389 | 389 | if (m_remove_on_close) |
| 390 | 390 | osd_rmfile(m_fullpath); |
| 391 | 391 | m_remove_on_close = false; |
| 392 | ||
| 392 | ||
| 393 | 393 | // reset our hashes and path as well |
| 394 | 394 | m_hashes.reset(); |
| 395 | 395 | m_fullpath.reset(); |
| r10613 | r10614 | |
|---|---|---|
| 97 | 97 | public: |
| 98 | 98 | // construction/destruction |
| 99 | 99 | path_iterator(core_options &options, const char *searchpath = ""); |
| 100 | ||
| 100 | ||
| 101 | 101 | // getters |
| 102 | 102 | bool next(astring &buffer); |
| 103 | ||
| 103 | ||
| 104 | 104 | // reset |
| 105 | 105 | void reset() { m_current = m_base; m_index = 0; } |
| 106 | 106 | |
| r10613 | r10614 | |
| 145 | 145 | emu_file(core_options &options, const char *searchpath, UINT32 openflags); |
| 146 | 146 | virtual ~emu_file(); |
| 147 | 147 | |
| 148 | // getters | |
| 148 | // getters | |
| 149 | 149 | operator core_file *(); |
| 150 | 150 | bool open() const { return (m_file != NULL); } |
| 151 | 151 | const char *filename() const { return m_filename; } |
| r10613 | r10614 | |
| 169 | 169 | file_error open_next(); |
| 170 | 170 | file_error open_ram(const void *data, UINT32 length); |
| 171 | 171 | void close(); |
| 172 | ||
| 172 | ||
| 173 | 173 | // control |
| 174 | 174 | file_error compress(int compress); |
| 175 | 175 | int seek(INT64 offset, int whence); |
| 176 | 176 | UINT64 tell(); |
| 177 | 177 | bool eof(); |
| 178 | 178 | UINT64 size(); |
| 179 | ||
| 179 | ||
| 180 | 180 | // reading |
| 181 | 181 | UINT32 read(void *buffer, UINT32 length); |
| 182 | 182 | int getc(); |
| 183 | 183 | int ungetc(int c); |
| 184 | 184 | char *gets(char *s, int n); |
| 185 | ||
| 185 | ||
| 186 | 186 | // writing |
| 187 | 187 | UINT32 write(const void *buffer, UINT32 length); |
| 188 | 188 | int puts(const char *s); |
| 189 | 189 | int vprintf(const char *fmt, va_list va); |
| 190 | 190 | int printf(const char *fmt, ...); |
| 191 | ||
| 191 | ||
| 192 | 192 | private: |
| 193 | 193 | // internal helpers |
| 194 | 194 | file_error attempt_zipped(); |
| 195 | 195 | file_error load_zipped_file(); |
| 196 | 196 | bool zip_filename_match(const zip_file_header &header, const astring &filename); |
| 197 | 197 | bool zip_header_is_path(const zip_file_header &header); |
| 198 | ||
| 198 | ||
| 199 | 199 | // internal state |
| 200 | 200 | astring m_filename; // original filename provided |
| 201 | 201 | astring m_fullpath; // full filename |
| r10613 | r10614 | |
|---|---|---|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | // segacd needs it like this.. investigate |
| 183 | // Angelo also says PCE tracks often start playing at the | |
| 183 | // Angelo also says PCE tracks often start playing at the | |
| 184 | 184 | // wrong address.. related? |
| 185 | 185 | INLINE UINT32 lba_to_msf_alt(int lba) |
| 186 | 186 | { |
| 187 | 187 | UINT32 ret = 0; |
| 188 | ||
| 188 | ||
| 189 | 189 | ret |= ((lba / (60 * 75))&0xff)<<16; |
| 190 | 190 | ret |= (((lba / 75) % 60)&0xff)<<8; |
| 191 | 191 | ret |= ((lba % 75)&0xff)<<0; |
| Previous | 15994 Revisions | Next |