Previous 199869 Revisions Next

r30976 Saturday 14th June, 2014 at 19:43:08 UTC by hap
removed MCFG_LR35902_RESET_VALUES
[src/emu/cpu/lr35902]lr35902.c lr35902.h
[src/mess/drivers]gb.c

trunk/src/emu/cpu/lr35902/lr35902.h
r30975r30976
88   lr35902_cpu_device::set_timer_cb(*device, DEVCB_##_devcb);
99#define MCFG_LR35902_HALT_BUG \
1010   lr35902_cpu_device::set_halt_bug(*device);
11// This should be removed/improved once all gameboy boot roms have been dumped
12#define MCFG_LR35902_RESET_VALUES(_regs) \
13   lr35902_cpu_device::set_reset_values(*device, _regs);
1411
1512enum
1613{
r30975r30976
3229   // static configuration helpers
3330   template<class _Object> static devcb_base &set_timer_cb(device_t &device, _Object object) { return downcast<lr35902_cpu_device &>(device).m_timer_func.set_callback(object); }
3431   static void set_halt_bug(device_t &device) { downcast<lr35902_cpu_device &>(device).m_features |= LR35902_FEATURE_HALT_BUG; }
35   static void set_reset_values(device_t &device, const UINT16 *regs) { downcast<lr35902_cpu_device &>(device).c_regs = regs; }
3632
3733   UINT8 get_speed();
3834   void set_speed( UINT8 speed_request );
r30975r30976
108104   int m_enable;
109105   int m_doHALTbug;
110106   UINT8   m_features;
111   const UINT16 *c_regs;
112   const struct lr35902_config *m_config;
113107};
114108
115109extern const device_type LR35902;
trunk/src/emu/cpu/lr35902/lr35902.c
r30975r30976
7979   , m_timer_func(*this)
8080   , m_enable(0)
8181   , m_features(0)
82   , c_regs(NULL)
8382{
8483}
8584
r30975r30976
194193   }
195194}
196195
197/*** Reset lr353902 registers: ******************************/
198/*** This function can be used to reset the register      ***/
199/*** file before starting execution with lr35902_execute(cpustate)***/
200/*** It sets the registers to their initial values.       ***/
201/************************************************************/
202196void lr35902_cpu_device::device_reset()
203197{
204198   m_A = 0x00;
r30975r30976
211205   m_L = 0x00;
212206   m_SP = 0x0000;
213207   m_PC = 0x0000;
214   if ( c_regs ) {
215      m_A = c_regs[0] >> 8;
216      m_F = c_regs[0] & 0xFF;
217      m_B = c_regs[1] >> 8;
218      m_C = c_regs[1] & 0xFF;
219      m_D = c_regs[2] >> 8;
220      m_E = c_regs[2] & 0xFF;
221      m_H = c_regs[3] >> 8;
222      m_L = c_regs[3] & 0xFF;
223      m_SP = c_regs[4];
224      m_PC = c_regs[5];
225   }
226208
227209   m_enable = 0;
228210   m_IE = 0;
trunk/src/mess/drivers/gb.c
r30975r30976
425425#include "bus/gameboy/mbc.h"
426426
427427
428/* Initial value of the cpu registers (hacks until we get bios dumps) */
429static const UINT16 megaduck_cpu_regs[6] = { 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFE, 0x0000 };  /* Megaduck */
430
431
432428READ8_MEMBER(gb_state::gb_cart_r)
433429{
434430   if (m_bios_disable && m_cartslot)
r30975r30976
827823   MCFG_CPU_PROGRAM_MAP( megaduck_map)
828824   MCFG_LR35902_TIMER_CB( WRITE8( gb_state, gb_timer_callback ) )
829825   MCFG_LR35902_HALT_BUG
830   MCFG_LR35902_RESET_VALUES(megaduck_cpu_regs)
831826
832827   /* video hardware */
833828   MCFG_SCREEN_ADD("screen", LCD)
r30975r30976
899894CONS( 1996, gbpocket, gameboy, 0,       gbpocket, gameboy, driver_device, 0,    "Nintendo", "Game Boy Pocket", GAME_SUPPORTS_SAVE )
900895CONS( 1998, gbcolor,  gameboy, 0,       gbcolor,  gameboy, driver_device, 0,    "Nintendo", "Game Boy Color", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
901896
902/* Sound is not 100% yet, it generates some sounds which could be ok. Since we're lacking a real
903   system there's no way to verify. Same goes for the colors of the LCD. We are no using the default
904   Game Boy green colors */
905CONS( 1993, megaduck, 0,       0,       megaduck, gameboy, driver_device, 0,    "Creatronic/Videojet/Timlex/Cougar",  "MegaDuck/Cougar Boy" , GAME_SUPPORTS_SAVE )
897// Sound is not 100% yet, it generates some sounds which could be ok. Since we're lacking a real system there's no way to verify.
898CONS( 1993, megaduck, 0,       0,       megaduck, gameboy, driver_device, 0,    "Welback Holdings (Timlex International) / Creatronic / Videojet / Cougar USA", "Mega Duck / Cougar Boy", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team