Previous 199869 Revisions Next

r21798 Monday 11th March, 2013 at 09:17:39 UTC by Miodrag Milanović
direct update handler is not being used in snes, therefore removed together with snes_ram variable (nw)
[src/mame/includes]snes.h
[src/mame/machine]snes.c
[src/mess/machine]snescart.c

trunk/src/mess/machine/snescart.c
r21797r21798
899899
900900DRIVER_INIT_MEMBER(snes_state,snes_mess)
901901{
902   snes_ram = machine().root_device().memregion("maincpu")->base();
903   memset(snes_ram, 0, 0x1000000);
904902}
905903
906904DRIVER_INIT_MEMBER(snes_state,snesst)
trunk/src/mame/machine/snes.c
r21797r21798
2828#include "audio/snes_snd.h"
2929
3030
31/* -- Globals -- */
32UINT8  *snes_ram = NULL;        /* 65816 ram */
33
3431#define DMA_REG(a) m_dma_regs[a - 0x4300]   // regs 0x4300-0x437f
3532
36
3733void snes_state::video_start()
3834{
3935   m_ppu.ppu_start(machine());
r21797r21798
10551051      m_ppu.m_beam.current_vert = SNES_VTOTAL_PAL;
10561052}
10571053
1058#if 0
1059DIRECT_UPDATE_MEMBER(snes_state::snes_spc_direct)
1060{
1061   direct.explicit_configure(0x0000, 0xffff, 0xffff, spc_get_ram(machine().device("spc700")));
1062   return ~0;
1063}
1064#endif
1065
1066DIRECT_UPDATE_MEMBER(snes_state::snes_direct)
1067{
1068   direct.explicit_configure(0x0000, 0xffff, 0xffff, snes_ram);
1069   return ~0;
1070}
1071
10721054MACHINE_START( snes )
10731055{
10741056   snes_state *state = machine.driver_data<snes_state>();
r21797r21798
10781060   state->m_spc700 = machine.device<snes_sound_device>("spc700");
10791061   state->m_superfx = machine.device<cpu_device>("superfx");
10801062
1081   state->m_maincpu->space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(snes_state::snes_direct), state));
1082//  state->m_soundcpu->space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(snes_state::snes_spc_direct), state));
1083
10841063   // power-on sets these registers like this
10851064   SNES_CPU_REG_STATE(WRIO) = 0xff;
10861065//  SNES_CPU_REG_STATE(WRMPYA) = 0xff;
r21797r21798
12011180/* for mame we use an init, maybe we will need more for the different games */
12021181DRIVER_INIT_MEMBER(snes_state,snes)
12031182{
1204   snes_ram = auto_alloc_array_clear(machine(), UINT8, 0x1400000);
1205
12061183   m_cart[0].m_rom_size = memregion("user3")->bytes();
12071184   m_cart[0].m_rom = memregion("user3")->base();
12081185   rom_map_setup(m_cart[0].m_rom_size);
r21797r21798
12251202
12261203DRIVER_INIT_MEMBER(snes_state,snes_hirom)
12271204{
1228   snes_ram = auto_alloc_array(machine(), UINT8, 0x1400000);
1229   memset(snes_ram, 0, 0x1400000);
1230
12311205   m_cart[0].m_rom_size = memregion("user3")->bytes();
12321206   m_cart[0].m_rom = memregion("user3")->base();
12331207   rom_map_setup(m_cart[0].m_rom_size);
trunk/src/mame/includes/snes.h
r21797r21798
761761
762762DECLARE_READ8_HANDLER( snes_open_bus_r );
763763
764extern UINT8  *snes_ram;            /* Main memory */
765
766764#endif /* _SNES_H_ */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team