Previous 15994 Revisions Next

r14911 Saturday 14th April, 2012 at 03:55:25 UTC by R. Belmont
Apple II: avoid some unnecessary tag lookups for a small speed boost (nw)
[src/mess]mess.mak
[src/mess/includes]apple2.h
[src/mess/machine]apple2.c

src/mess/machine/apple2.c
r14910r14911
1919#include "devices/appldriv.h"
2020#include "imagedev/flopdrv.h"
2121#include "imagedev/cassette.h"
22#include "machine/ram.h"
2322#include "sound/speaker.h"
2423#include "debugger.h"
2524
r14910r14911
204203         else
205204         {
206205            /* RAM */
207            if (end_r >= machine.device<ram_device>(RAM_TAG)->size())
208               end_r = machine.device<ram_device>(RAM_TAG)->size() - 1;
206            if (end_r >= state->m_ram->size())
207               end_r = state->m_ram->size() - 1;
209208            offset = meminfo.read_mem & APPLE2_MEM_MASK;
210209            if (end_r >= begin)
211               rbase = &machine.device<ram_device>(RAM_TAG)->pointer()[offset];
210               rbase = &state->m_ram->pointer()[offset];
212211         }
213212
214213         /* install the actual handlers */
r14910r14911
295294         else
296295         {
297296            /* RAM */
298            if (end_w >= machine.device<ram_device>(RAM_TAG)->size())
299               end_w = machine.device<ram_device>(RAM_TAG)->size() - 1;
297            if (end_w >= state->m_ram->size())
298               end_w = state->m_ram->size() - 1;
300299            offset = meminfo.write_mem & APPLE2_MEM_MASK;
301300            if (end_w >= begin)
302               wbase = &machine.device<ram_device>(RAM_TAG)->pointer()[offset];
301               wbase = &state->m_ram->pointer()[offset];
303302         }
304303
305304
r14910r14911
10931092      //CMemory::mState |= CMemory::kVBLBar; // N: VBL' is true // FIX: MESS?
10941093   }
10951094
1096   return machine.device<ram_device>(RAM_TAG)->pointer()[address % machine.device<ram_device>(RAM_TAG)->size()]; // FIX: this seems to work, but is it right!?
1095   return state->m_ram->pointer()[address % machine.device<ram_device>(RAM_TAG)->size()]; // FIX: this seems to work, but is it right!?
10971096}
10981097
10991098
src/mess/includes/apple2.h
r14910r14911
1111
1212#include "machine/a2bus.h"
1313#include "machine/applefdc.h"
14#include "machine/ram.h"
1415
1516
1617/***************************************************************************
r14910r14911
111112   apple2_state(const machine_config &mconfig, device_type type, const char *tag)
112113      : driver_device(mconfig, type, tag),
113114        m_maincpu(*this, "maincpu"),
115        m_ram(*this, RAM_TAG),
114116        m_a2bus(*this, "a2bus")
115117    { }
116118
117119   required_device<cpu_device> m_maincpu;
120    required_device<ram_device> m_ram;
118121    required_device<a2bus_device> m_a2bus;
119122
120123   UINT32 m_flags, m_flags_mask;
src/mess/mess.mak
r14910r14911
19851985$(MESS_MACHINE)/egret.o:   $(MESSSRC)/machine/egret.c\
19861986                           $(MESSSRC)/machine/egret.h
19871987
1988$(MESS_DRIVERS)/apple2.o:   $(MESSSRC)/includes/apple2.h
1989$(MESS_MACHINE)/apple2.o:   $(MESSSRC)/includes/apple2.h
1990$(MESS_VIDEO)/apple2.o:     $(MESSSRC)/includes/apple2.h
1991$(MESS_DRIVERS)/apple2gs.o: $(MESSSRC)/includes/apple2.h $(MESSSRC)/includes/apple2gs.h
1992$(MESS_MACHINE)/apple2gs.o: $(MESSSRC)/includes/apple2.h $(MESSSRC)/includes/apple2gs.h
1993$(MESS_VIDEO)/apple2gs.o:   $(MESSSRC)/includes/apple2.h $(MESSSRC)/includes/apple2gs.h
1994
1995
19881996# $(MESSSRC)/drivers/apollo.c includes m68kcpu.h and m68kcpu.h now includes m68kops.h
19891997$(MESS_DRIVERS)/apollo.o:   $(EMUSRC)/cpu/m68000/m68kcpu.h
19901998$(MESS_MACHINE)/apollo_dbg.o:   $(EMUSRC)/cpu/m68000/m68kcpu.h

Previous 15994 Revisions Next


© 1998-2018 The MESS Team