Previous 15994 Revisions Next

r3942 Saturday 20th December, 2008 at 22:18:39 UTC by Wilbert Pol
Merged PPU code from mame.
Removed deprecat.h dependencies from machine/nes_mmc.c and video/nes.c.
[src/mame/video]ppu2c0x.c ppu2c0x.h
[src/mess/includes]nes.h
[src/mess/machine]nes.c nes_mmc.c nes_mmc.h
[src/mess/video]nes.c

src/mame/video/ppu2c0x.c
r3941r3942
2525******************************************************************************/
2626
2727#include "driver.h"
28#include "deprecat.h"
2928#include "profiler.h"
3029#include "video/ppu2c0x.h"
3130
r3941r3942
113112/* chips state - allocated at init time */
114113static ppu2c0x_chip *chips = 0;
115114
116static void update_scanline(int num );
115static void update_scanline(running_machine *machine, int num );
117116
118117static TIMER_CALLBACK( scanline_callback );
119118static TIMER_CALLBACK( hblank_callback );
r3941r3942
382381   int blanked = ( ppu_regs[PPU_CONTROL1] & ( PPU_CONTROL1_BACKGROUND | PPU_CONTROL1_SPRITES ) ) == 0;
383382   int vblank = ((this_ppu->scanline >= PPU_VBLANK_FIRST_SCANLINE-1) && (this_ppu->scanline < this_ppu->scanlines_per_frame-1)) ? 1 : 0;
384383
385//  update_scanline (num);
384//  update_scanline (machine, num);
386385
387386   if (this_ppu->hblank_callback_proc)
388      (*this_ppu->hblank_callback_proc) (num, this_ppu->scanline, vblank, blanked);
387      (*this_ppu->hblank_callback_proc) (machine, num, this_ppu->scanline, vblank, blanked);
389388
390389   timer_adjust_oneshot(chips[num].hblank_timer, attotime_never, num);
391390}
r3941r3942
397396
398397   // Actually fire the VMI
399398   if (intf->nmi_handler[num])
400      (*intf->nmi_handler[num]) (num, ppu_regs);
399      (*intf->nmi_handler[num]) (machine, num, ppu_regs);
401400
402401   timer_adjust_oneshot(chips[num].nmi_timer, attotime_never, num);
403402}
404403
405static void draw_background(const int num, UINT8 *line_priority )
404static void draw_background(running_machine *machine, int num, UINT8 *line_priority )
406405{
407406   /* cache some values locally */
408407   bitmap_t *bitmap = chips[num].bitmap;
r3941r3942
541540   }
542541}
543542
544static void draw_sprites(const int num, UINT8 *line_priority )
543static void draw_sprites(running_machine *machine, int num, UINT8 *line_priority )
545544{
546545   /* cache some values locally */
547546   bitmap_t *bitmap = chips[num].bitmap;
r3941r3942
727726 *  Scanline Rendering and Update
728727 *
729728 *************************************/
730static void render_scanline(int num)
729static void render_scanline(running_machine *machine, int num)
731730{
732731   UINT8   line_priority[VISIBLE_SCREEN_WIDTH];
733732   int      *ppu_regs = &chips[num].regs[0];
r3941r3942
743742
744743   /* see if we need to render the background */
745744   if ( ppu_regs[PPU_CONTROL1] & PPU_CONTROL1_BACKGROUND )
746      draw_background(num, line_priority );
745      draw_background(machine, num, line_priority );
747746   else
748747   {
749748      bitmap_t *bitmap = chips[num].bitmap;
r3941r3942
768767
769768   /* if sprites are on, draw them */
770769   if ( ppu_regs[PPU_CONTROL1] & PPU_CONTROL1_SPRITES )
771      draw_sprites( num, line_priority );
770      draw_sprites( machine, num, line_priority );
772771
773772    /* done updating, whew */
774773   profiler_mark(PROFILER_END);
775774}
776775
777static void update_scanline(int num )
776static void update_scanline(running_machine *machine, int num )
778777{
779778   ppu2c0x_chip* this_ppu;
780779   int scanline = chips[num].scanline;
r3941r3942
793792         this_ppu->refresh_data |= ( this_ppu->refresh_latch & 0x041f );
794793
795794//logerror("   updating refresh_data: %04x (scanline: %d)\n", this_ppu->refresh_data, this_ppu->scanline);
796         render_scanline( num );
795         render_scanline( machine, num );
797796      }
798797      else
799798      {
r3941r3942
867866
868867   /* if a callback is available, call it */
869868   if ( this_ppu->scanline_callback_proc )
870      (*this_ppu->scanline_callback_proc)( num, this_ppu->scanline, vblank, blanked );
869      (*this_ppu->scanline_callback_proc)( machine, num, this_ppu->scanline, vblank, blanked );
871870
872871   /* update the scanline that just went by */
873   update_scanline( num );
872   update_scanline( machine, num );
874873
875874   /* increment our scanline count */
876875   this_ppu->scanline++;
r3941r3942
10271026 *  PPU Registers Read
10281027 *
10291028 *************************************/
1030int ppu2c0x_r( int num, offs_t offset )
1029int ppu2c0x_r( const address_space *space, offs_t offset, int num )
10311030{
10321031   ppu2c0x_chip* this_ppu;
10331032
r3941r3942
11001099 *  PPU Registers Write
11011100 *
11021101 *************************************/
1103void ppu2c0x_w( int num, offs_t offset, UINT8 data )
1102void ppu2c0x_w( const address_space *space, offs_t offset, UINT8 data, int num )
11041103{
11051104   ppu2c0x_chip* this_ppu;
11061105   int color_base;
r3941r3942
11231122
11241123#ifdef MAME_DEBUG
11251124   if (this_ppu->scanline <= PPU_BOTTOM_VISIBLE_SCANLINE)
1126      logerror("  PPU register %d write %02x during non-vblank scanline %d (MAME %d, beam pos: %d)\n", offset, data, this_ppu->scanline, video_screen_get_vpos(Machine->primary_screen), video_screen_get_hpos(Machine->primary_screen));
1125   {
1126      const device_config *screen = space->machine->primary_screen;
1127      logerror("  PPU register %d write %02x during non-vblank scanline %d (MAME %d, beam pos: %d)\n", offset, data, this_ppu->scanline, video_screen_get_vpos(screen), video_screen_get_hpos(screen));
1128   }
11271129#endif
11281130
11291131   switch( offset & 7 )
r3941r3942
12251227
12261228            /* if there's a callback, call it now */
12271229            if ( this_ppu->vidaccess_callback_proc )
1228               data = (*this_ppu->vidaccess_callback_proc)( num, tempAddr, data );
1230               data = (*this_ppu->vidaccess_callback_proc)( space->machine, num, tempAddr, data );
12291231
12301232            /* see if it's on the chargen portion */
12311233            if ( tempAddr < 0x2000 )
r3941r3942
13291331   for (i = 0; i < SPRITERAM_SIZE; i++)
13301332   {
13311333      UINT8 spriteData = memory_read_byte(space, address + i);
1332      ppu2c0x_w (num, PPU_SPRITE_DATA, spriteData);
1334      ppu2c0x_w (space, PPU_SPRITE_DATA, spriteData, num);
13331335   }
13341336
13351337   // should last 513 CPU cycles.
r3941r3942
14151417      int count = num_pages * 0x400;
14161418      int rom_start = bank * bank_size * 16;
14171419
1418      memcpy( &chips[num].videomem[vram_start], &memory_region( Machine, intf->vrom_region[num] )[rom_start], count );
1420      memcpy( &chips[num].videomem[vram_start], &memory_region( chips[num].machine, intf->vrom_region[num] )[rom_start], count );
14191421   }
14201422}
14211423
r3941r3942
16441646
16451647READ8_HANDLER( ppu2c0x_0_r )
16461648{
1647   return ppu2c0x_r( 0, offset );
1649   return ppu2c0x_r( space, offset, 0 );
16481650}
16491651
16501652READ8_HANDLER( ppu2c0x_1_r )
16511653{
1652   return ppu2c0x_r( 1, offset );
1654   return ppu2c0x_r( space, offset, 1 );
16531655}
16541656
16551657WRITE8_HANDLER( ppu2c0x_0_w )
16561658{
1657   ppu2c0x_w( 0, offset, data );
1659   ppu2c0x_w( space, offset, data, 0 );
16581660}
16591661
16601662WRITE8_HANDLER( ppu2c0x_1_w )
16611663{
1662   ppu2c0x_w( 1, offset, data );
1664   ppu2c0x_w( space, offset, data, 1 );
16631665}
src/mame/video/ppu2c0x.h
r3941r3942
7979} ppu_t;
8080
8181/* callback datatypes */
82typedef void (*ppu2c0x_scanline_cb)( int num, int scanline, int vblank, int blanked );
83typedef void (*ppu2c0x_hblank_cb)( int num, int scanline, int vblank, int blanked );
84typedef void (*ppu2c0x_nmi_cb)( int num, int *ppu_regs );
85typedef int  (*ppu2c0x_vidaccess_cb)( int num, int address, int data );
82typedef void (*ppu2c0x_scanline_cb)( running_machine *machine, int num, int scanline, int vblank, int blanked );
83typedef void (*ppu2c0x_hblank_cb)( running_machine *machine, int num, int scanline, int vblank, int blanked );
84typedef void (*ppu2c0x_nmi_cb)( running_machine *machine, int num, int *ppu_regs );
85typedef int  (*ppu2c0x_vidaccess_cb)( running_machine *machine, int num, int address, int data );
8686
8787typedef struct _ppu2c0x_interface ppu2c0x_interface;
8888struct _ppu2c0x_interface
r3941r3942
118118//27/12/2002
119119extern void (*ppu_latch)( offs_t offset );
120120
121void ppu2c0x_w( int num, offs_t offset, UINT8 data );
122int ppu2c0x_r( int num, offs_t offset );
121void ppu2c0x_w( const address_space *space, offs_t offset, UINT8 data, int num );
122int ppu2c0x_r( const address_space *space, offs_t offset, int num );
123123
124124/* accesors */
125125READ8_HANDLER( ppu2c0x_0_r );
src/mess/video/nes.c
r3941r3942
66
77***************************************************************************/
88
9#include <math.h>
10
119#include "driver.h"
12#include "deprecat.h"
1310#include "video/ppu2c0x.h"
1411#include "includes/nes.h"
1512#include "machine/nes_mmc.h"
r3941r3942
1714int nes_vram_sprite[8]; /* Used only by mmc5 for now */
1815static int last_frame_flip = 0;
1916
20static void ppu_nmi(int num, int *ppu_regs)
17static void ppu_nmi(running_machine *machine, int num, int *ppu_regs)
2118{
22   cpu_set_input_line(Machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE);
19   cpu_set_input_line(machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE);
2320}
2421
2522static void nes_vh_reset(running_machine *machine)
r3941r3942
6461   add_reset_callback(machine, nes_vh_reset);
6562
6663   /* Reset the mapper variables. Will also mark the char-gen ram as dirty */
67   mapper_reset(nes.mapper);
64   mapper_reset(machine, nes.mapper);
6865}
6966
7067
src/mess/includes/nes.h
r3941r3942
8080READ8_HANDLER( nes_IN0_r );
8181READ8_HANDLER( nes_IN1_r );
8282
83int nes_ppu_vidaccess( int num, int address, int data );
83int nes_ppu_vidaccess( running_machine *machine, int num, int address, int data );
8484
8585void nes_partialhash(char *dest, const unsigned char *data,
8686   unsigned long length, unsigned int functions);
src/mess/machine/nes.c
r3941r3942
161161   memcpy (battery_ram, battery_data, BATTERY_SIZE);
162162}
163163
164int nes_ppu_vidaccess( int num, int address, int data )
164int nes_ppu_vidaccess( running_machine *machine, int num, int address, int data )
165165{
166166   /* TODO: this is a bit of a hack, needed to get Argus, ASO, etc to work */
167167   /* but, B-Wings, submath (j) seem to use this location differently... */
r3941r3942
180180   nes.mid_ram_enable = 1;
181181
182182   /* Reset the mapper variables. Will also mark the char-gen ram as dirty */
183   mapper_reset (nes.mapper);
183   mapper_reset (machine, nes.mapper);
184184
185185   /* Reset the serial input ports */
186186   in_0.shift = 0;
src/mess/machine/nes_mmc.c
r3941r3942
2323   really MMC3, Mapper 9 is MMC2 and Mapper 10 is MMC4. Makes perfect sense, right?
2424*/
2525
26#include <string.h>
27
2826#include "cpu/m6502/m6502.h"
2927#include "video/ppu2c0x.h"
30#include "osdepend.h"
31#include "deprecat.h"
3228#include "driver.h"
3329#include "includes/nes.h"
3430#include "nes_mmc.h"
r3941r3942
617613   ppu2c0x_set_videorom_bank(0, chr_page ^ 7, 1, MMC3_chr_base * 64 | ( MMC3_chr[5] & ( MMC3_chr_mask * 64 ) ), 1);
618614}
619615
620static void mapper4_irq ( int num, int scanline, int vblank, int blanked )
616static void mapper4_irq ( running_machine *machine, int num, int scanline, int vblank, int blanked )
621617{
622618   if ((scanline < PPU_BOTTOM_VISIBLE_SCANLINE) /*|| (scanline == ppu_scanlines_per_frame-1)*/)
623619   {
r3941r3942
632628
633629      if (IRQ_enable && !blanked && (IRQ_count == 0) && priorCount)
634630      {
635         logerror("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, video_screen_get_vpos(Machine->primary_screen), video_screen_get_hpos(Machine->primary_screen));
636         cpu_set_input_line(Machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
631         logerror("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, video_screen_get_vpos(machine->primary_screen), video_screen_get_hpos(machine->primary_screen));
632         cpu_set_input_line(machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
637633//         timer_adjust_oneshot(nes_irq_timer, cpu_clocks_to_attotime(machine->cpu[0], 4), 0);
638634      }
639635   }
r3941r3942
826822   }
827823}
828824
829static void mapper5_irq ( int num, int scanline, int vblank, int blanked )
825static void mapper5_irq ( running_machine *machine, int num, int scanline, int vblank, int blanked )
830826{
831827#if 1
832828   if (scanline == 0)
r3941r3942
838834   if (scanline == IRQ_count)
839835   {
840836      if (IRQ_enable)
841         cpu_set_input_line(Machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
837         cpu_set_input_line(machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
842838
843839      IRQ_status = 0xff;
844840   }
r3941r3942
15781574   }
15791575}
15801576
1581static void bandai_irq ( int num, int scanline, int vblank, int blanked )
1577static void bandai_irq ( running_machine *machine, int num, int scanline, int vblank, int blanked )
15821578{
15831579   /* 114 is the number of cycles per scanline */
15841580   /* TODO: change to reflect the actual number of cycles spent */
r3941r3942
15871583   {
15881584      if (IRQ_count <= 114)
15891585      {
1590         cpu_set_input_line(Machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
1586         cpu_set_input_line(machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
15911587      }
15921588      IRQ_count -= 114;
15931589   }
r3941r3942
17131709   }
17141710}
17151711
1716static void jaleco_irq ( int num, int scanline, int vblank, int blanked )
1712static void jaleco_irq ( running_machine *machine, int num, int scanline, int vblank, int blanked )
17171713{
17181714   if (scanline <= PPU_BOTTOM_VISIBLE_SCANLINE)
17191715   {
r3941r3942
17271723         {
17281724            if ((IRQ_count & 0x0f) == 0x00)
17291725               /* rollover every 0x10 */
1730               cpu_set_input_line(Machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
1726               cpu_set_input_line(machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
17311727         }
17321728         else if (IRQ_mode & 0x04)
17331729         {
17341730            if ((IRQ_count & 0x0ff) == 0x00)
17351731               /* rollover every 0x100 */
1736               cpu_set_input_line(Machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
1732               cpu_set_input_line(machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
17371733         }
17381734         else if (IRQ_mode & 0x02)
17391735         {
17401736            if ((IRQ_count & 0x0fff) == 0x000)
17411737               /* rollover every 0x1000 */
1742               cpu_set_input_line(Machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
1738               cpu_set_input_line(machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
17431739         }
17441740         else if (IRQ_count == 0)
17451741            /* rollover at 0x10000 */
1746            cpu_set_input_line(Machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
1742            cpu_set_input_line(machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
17471743      }
17481744   }
17491745   else
r3941r3942
19551951   }
19561952}
19571953
1958static void namcot_irq ( int num, int scanline, int vblank, int blanked )
1954static void namcot_irq ( running_machine *machine, int num, int scanline, int vblank, int blanked )
19591955{
19601956   IRQ_count ++;
19611957   /* Increment & check the IRQ scanline counter */
19621958   if (IRQ_enable && (IRQ_count == 0x7fff))
19631959   {
1964      cpu_set_input_line(Machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
1960      cpu_set_input_line(machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
19651961   }
19661962}
19671963
r3941r3942
20152011   }
20162012}
20172013
2018static void fds_irq ( int num, int scanline, int vblank, int blanked )
2014static void fds_irq ( running_machine *machine, int num, int scanline, int vblank, int blanked )
20192015{
20202016   if (IRQ_enable_latch)
2021      cpu_set_input_line(Machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
2017      cpu_set_input_line(machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
20222018
20232019   /* Increment & check the IRQ scanline counter */
20242020   if (IRQ_enable)
20252021   {
20262022      if (IRQ_count <= 114)
20272023      {
2028         cpu_set_input_line(Machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
2024         cpu_set_input_line(machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
20292025         IRQ_enable = 0;
20302026         nes_fds.status0 |= 0x01;
20312027      }
r3941r3942
21292125   LOG_FDS(("fds_w, address: %04x, data: %02x\n", offset + 0x4020, data));
21302126}
21312127
2132static void konami_irq ( int num, int scanline, int vblank, int blanked )
2128static void konami_irq ( running_machine *machine, int num, int scanline, int vblank, int blanked )
21332129{
21342130   /* Increment & check the IRQ scanline counter */
21352131   if (IRQ_enable && (++IRQ_count == 0x100))
21362132   {
21372133      IRQ_count = IRQ_count_latch;
21382134      IRQ_enable = IRQ_enable_latch;
2139      cpu_set_input_line(Machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
2135      cpu_set_input_line(machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
21402136   }
21412137}
21422138
r3941r3942
27962792   prg32 (space, data);
27972793}
27982794
2799static void mapper40_irq ( int num, int scanline, int vblank, int blanked )
2795static void mapper40_irq ( running_machine *machine, int num, int scanline, int vblank, int blanked )
28002796{
28012797   /* Decrement & check the IRQ scanline counter */
28022798   if (IRQ_enable)
28032799   {
28042800      if (--IRQ_count == 0)
28052801      {
2806         cpu_set_input_line(Machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
2802         cpu_set_input_line(machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
28072803      }
28082804   }
28092805}
r3941r3942
32413237   }
32423238}
32433239
3244static void irem_irq ( int num, int scanline, int vblank, int blanked )
3240static void irem_irq ( running_machine *machine, int num, int scanline, int vblank, int blanked )
32453241{
32463242   /* Increment & check the IRQ scanline counter */
32473243   if (IRQ_enable)
32483244   {
32493245      if (--IRQ_count == 0)
3250         cpu_set_input_line(Machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
3246         cpu_set_input_line(machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
32513247   }
32523248}
32533249
r3941r3942
33163312   chr8 (data & 0x03);
33173313}
33183314
3319static void sunsoft_irq ( int num, int scanline, int vblank, int blanked )
3315static void sunsoft_irq ( running_machine *machine, int num, int scanline, int vblank, int blanked )
33203316{
33213317   /* 114 is the number of cycles per scanline */
33223318   /* TODO: change to reflect the actual number of cycles spent */
r3941r3942
33253321   {
33263322      if (IRQ_count <= 114)
33273323      {
3328         cpu_set_input_line(Machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
3324         cpu_set_input_line(machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
33293325      }
33303326      IRQ_count -= 114;
33313327   }
r3941r3942
43094305   }
43104306}
43114307
4312static void mapper182_irq( int num, int scanline, int vblank, int blanked )
4308static void mapper182_irq( running_machine *machine, int num, int scanline, int vblank, int blanked )
43134309{
43144310   if ((scanline < PPU_BOTTOM_VISIBLE_SCANLINE) /*|| (scanline == ppu_scanlines_per_frame-1)*/)
43154311   {
r3941r3942
43244320
43254321      if (IRQ_enable && !blanked && (IRQ_count == 0) && priorCount)
43264322      {
4327         logerror("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, video_screen_get_vpos(Machine->primary_screen), video_screen_get_hpos(Machine->primary_screen));
4328         cpu_set_input_line(Machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
4323         logerror("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, video_screen_get_vpos(machine->primary_screen), video_screen_get_hpos(machine->primary_screen));
4324         cpu_set_input_line(machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
43294325      }
43304326   }
43314327}
r3941r3942
48154811   }
48164812}
48174813
4818static void mapper248_irq( int num, int scanline, int vblank, int blanked )
4814static void mapper248_irq( running_machine *machine, int num, int scanline, int vblank, int blanked )
48194815{
48204816   if ((scanline < PPU_BOTTOM_VISIBLE_SCANLINE) /*|| (scanline == ppu_scanlines_per_frame-1)*/)
48214817   {
r3941r3942
48304826
48314827      if (IRQ_enable && !blanked && (IRQ_count == 0) && priorCount)
48324828      {
4833         logerror("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, video_screen_get_vpos(Machine->primary_screen), video_screen_get_hpos(Machine->primary_screen));
4834         cpu_set_input_line(Machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
4829         logerror("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, video_screen_get_vpos(machine->primary_screen), video_screen_get_hpos(machine->primary_screen));
4830         cpu_set_input_line(machine->cpu[0], M6502_IRQ_LINE, HOLD_LINE);
48354831      }
48364832   }
48374833}
r3941r3942
48464842// 1 = no mapper found
48474843// 2 = mapper not supported
48484844*/
4849int mapper_reset (int mapperNum)
4845int mapper_reset (running_machine *machine, int mapperNum)
48504846{
4851   const address_space *space = cpu_get_address_space( Machine->cpu[0], ADDRESS_SPACE_PROGRAM );
4847   const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
48524848   int err = 0;
48534849   const mmc *mapper;
48544850
r3941r3942
48614857   ppu2c0x_set_hblank_callback (0, mapper ? mapper->mmc_hblank :  NULL);
48624858
48634859   if (!nes_irq_timer)
4864      nes_irq_timer = timer_alloc(Machine, nes_irq_callback, NULL);
4860      nes_irq_timer = timer_alloc(machine, nes_irq_callback, NULL);
48654861
48664862   mapper_warning = 0;
48674863   /* 8k mask */
src/mess/machine/nes_mmc.h
r3941r3942
2929extern read8_space_func mmc_read_mid;
3030extern write8_space_func mmc_write;
3131
32int mapper_reset (int mapperNum);
32int mapper_reset (running_machine *machine, int mapperNum);
3333
3434WRITE8_HANDLER( nes_low_mapper_w );
3535READ8_HANDLER ( nes_low_mapper_r );

Previous 15994 Revisions Next


© 1998-2018 The MESS Team