[uae] Re: E-UAE on PalmOS

  • From: Richard Drummond <evilrich@xxxxxxxxxxxxxx>
  • To: uae@xxxxxxxxxxxxx
  • Date: Wed, 6 Apr 2005 20:22:39 -0500

On Wednesday 06 April 2005 08:10 pm, Richard Drummond wrote:
> On Wednesday 06 April 2005 06:37 am, Henk Jonas wrote:
> > I've fixed it with:
> >
> > STATIC_INLINE uae_u32 get_long(uaecptr addr)
> > {
> >  if ((addr >> 16) < MEMORY_BANKS)
> >      return longget_1(addr);
> >  else
> >   return 0;
> > ... <SNIP>
>
> That looks like it'd do the trick.

Actually, thinking about this, what you'd probably want to do is something 
like:

#ifdef ADDRESS_SPACE_24BIT
# define MEMORY_BANKS  256
# define MEMORY_RANGE_MASK ((1<<24)-1)
#else
# define MEMORY_BANKS  65536
# define MEMORY_RANGE_MASK (~0)
#endif

And then have the access functions as:

STATIC_INLINE uae_u32 get_long(uaecptr addr)
{
    return longget_1(addr & MEMORY_RANGE_MASK);
}

etc. etc.

Basically, you want the top 8 bits of an address to be don't cares on the 
68000.

I thought there was something like this tucked away in the code somewhere 
already, but some parts of uae are such a rabbit warren it's hard to find 
your way aroudn sometimes. Maybe this got lost somewhere along the line.

Cheers,
Rich

Other related posts: