Previous 15994 Revisions Next

r1365 Monday 3rd December, 2007 at 02:45:32 UTC by Nathan Woods
memory.c update from Mamedev
[src/emu]memory.c

src/emu/memory.c
r1364r1365
367367
368368
369369/*-------------------------------------------------
370    INLINE FUNCTIONS
371-------------------------------------------------*/
372
373INLINE void force_opbase_update(void)
374{
375   opcode_entry = 0xff;
376   memory_set_opbase(activecpu_get_physical_pc_byte());
377}
378
379
380/*-------------------------------------------------
370381    FUNCTION PROTOTYPES
371382-------------------------------------------------*/
372383
r1364r1365
576587
577588void memory_set_opbase(offs_t pc)
578589{
579   address_space *space = &active_address_space[ADDRESS_SPACE_PROGRAM];
580
590   const address_space *space = &active_address_space[ADDRESS_SPACE_PROGRAM];
581591   UINT8 *base = NULL, *based = NULL;
582   handler_data *handlers;
592   const handler_data *handlers;
583593   UINT8 entry;
584594
585595   /* allow overrides */
586   if (opbasefunc)
596   if (opbasefunc != NULL)
587597   {
588598      pc = (*opbasefunc)(pc);
589599      if (pc == ~0)
r1364r1365
623633   /* if no decrypted opcodes, point to the same base */
624634   base = bank_ptr[entry];
625635   based = bankd_ptr[entry];
626   if (!based)
636   if (based == NULL)
627637      based = base;
628638
629639   /* compute the adjusted base */
r1364r1365
658668
659669            /* if this is live, adjust now */
660670            if (cpu_getactivecpu() >= 0 && cpunum == cur_context && opcode_entry == banknum)
661               memory_set_opbase(activecpu_get_physical_pc_byte());
671               force_opbase_update();
662672         }
663673         else if (bdata->base < end && bdata->end > start)
664674            fatalerror("memory_set_decrypted_region found straddled region %08X-%08X for CPU %d", start, end, cpunum);
r1364r1365
858868
859869   /* if we're executing out of this bank, adjust the opbase pointer */
860870   if (opcode_entry == banknum && cpu_getactivecpu() >= 0)
861   {
862      opcode_entry = 0xff;
863      memory_set_opbase(activecpu_get_physical_pc_byte());
864   }
871      force_opbase_update();
865872}
866873
867874
r1364r1365
887894
888895   /* if we're executing out of this bank, adjust the opbase pointer */
889896   if (opcode_entry == banknum && cpu_getactivecpu() >= 0)
890   {
891      opcode_entry = 0xff;
892      memory_set_opbase(activecpu_get_physical_pc_byte());
893   }
897      force_opbase_update();
894898}
895899
896900

Previous 15994 Revisions Next


© 1998-2018 The MESS Team