mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-22 12:33:29 +00:00
Merge branch 'master' into InST
This commit is contained in:
commit
07b600ccaf
@ -141,10 +141,12 @@ struct Microcycle {
|
||||
}
|
||||
|
||||
/*!
|
||||
@returns 0 if this byte access wants the low part of a 16-bit word; 8 if it wants the high part.
|
||||
@returns 0 if this byte access wants the low part of a 16-bit word; 8 if it wants the high part,
|
||||
i.e. take a word quantity and shift it right by this amount to get the quantity being
|
||||
accessed into the lowest value byte.
|
||||
*/
|
||||
forceinline unsigned int byte_shift() const {
|
||||
return (((*address) & 1) << 3) ^ 8;
|
||||
return ~(*address << 3) & 8;
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -153,7 +155,7 @@ struct Microcycle {
|
||||
@returns 0x00ff if this byte access wants the low part of a 16-bit word; 0xff00 if it wants the high part.
|
||||
*/
|
||||
forceinline uint16_t byte_mask() const {
|
||||
return uint16_t(0xff00) >> (((*address) & 1) << 3);
|
||||
return uint16_t(0xff00 >> ((*address << 3) & 8));
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -163,7 +165,7 @@ struct Microcycle {
|
||||
@returns 0xff00 if this byte access wants the low part of a 16-bit word; 0x00ff if it wants the high part.
|
||||
*/
|
||||
forceinline uint16_t untouched_byte_mask() const {
|
||||
return uint16_t(uint16_t(0xff) << (((*address) & 1) << 3));
|
||||
return uint16_t(0x00ff << ((*address << 3) & 8));
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -178,14 +180,14 @@ struct Microcycle {
|
||||
@returns non-zero if the 68000 LDS is asserted; zero otherwise.
|
||||
*/
|
||||
forceinline int lower_data_select() const {
|
||||
return ((operation & SelectByte) & (*address & 1)) | (operation & SelectWord);
|
||||
return (operation & SelectByte & *address) | (operation & SelectWord);
|
||||
}
|
||||
|
||||
/*!
|
||||
@returns non-zero if the 68000 UDS is asserted; zero otherwise.
|
||||
*/
|
||||
forceinline int upper_data_select() const {
|
||||
return ((operation & SelectByte) & ~(*address & 1)) | (operation & SelectWord);
|
||||
return (operation & SelectByte & ~*address) | (operation & SelectWord);
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -196,7 +198,15 @@ struct Microcycle {
|
||||
the address space, etc.
|
||||
*/
|
||||
forceinline uint32_t word_address() const {
|
||||
return (address ? (*address) & 0x00fffffe : 0) >> 1;
|
||||
return (address ? *address & 0x00fffffe : 0) >> 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
@returns the same value as word_address() for any Microcycle with the NewAddress or
|
||||
SameAddress flags set; undefined behaviour otherwise.
|
||||
*/
|
||||
forceinline uint32_t active_operation_word_address() const {
|
||||
return (*address & 0x00fffffe) >> 1;
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -214,7 +224,7 @@ struct Microcycle {
|
||||
#if TARGET_RT_BIG_ENDIAN
|
||||
return *address & 0xffffff;
|
||||
#else
|
||||
return (*address ^ (1 & operation & SelectByte)) & 0xffffff;
|
||||
return (*address ^ (operation & SelectByte)) & 0xffffff;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -264,30 +274,22 @@ struct Microcycle {
|
||||
if(operation & Microcycle::SelectWord) {
|
||||
value->w = uint16_t(0x00ff | (v << 8));
|
||||
} else {
|
||||
value->b = uint8_t(v | (0xff00 >> ((*address & 1) << 3)));
|
||||
value->b = uint8_t(v | byte_mask());
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
Equivalent to set_value16((v) | 0xff00).
|
||||
Equivalent to set_value16(v | 0xff00).
|
||||
*/
|
||||
forceinline void set_value8_low(uint8_t v) const {
|
||||
assert(operation & Microcycle::Read);
|
||||
if(operation & Microcycle::SelectWord) {
|
||||
value->w = 0xff00 | v;
|
||||
} else {
|
||||
value->b = uint8_t(v | (0x00ff << ((*address & 1) << 3)));
|
||||
value->b = uint8_t(v | untouched_byte_mask());
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
@returns the same value as word_address() for any Microcycle with the NewAddress or
|
||||
SameAddress flags set; undefined behaviour otherwise.
|
||||
*/
|
||||
forceinline uint32_t active_operation_word_address() const {
|
||||
return ((*address) & 0x00fffffe) >> 1;
|
||||
}
|
||||
|
||||
// PermitRead and PermitWrite are used as part of the read/write mask
|
||||
// supplied to @c apply; they are picked to be small enough values that
|
||||
// a byte can be used for storage.
|
||||
|
Loading…
Reference in New Issue
Block a user