mirror of
https://github.com/ksherlock/mpw.git
synced 2024-11-24 13:32:39 +00:00
fix stack frames with byte values
This commit is contained in:
parent
24e47c7f9b
commit
7eb33de435
@ -26,6 +26,9 @@ template<int Bytes, int Offset, typename... Args>
|
||||
uint32_t StackFrame__(uint32_t sp, uint32_t &x, Args&&... args);
|
||||
template<int Bytes, int Offset, typename... Args>
|
||||
uint32_t StackFrame__(uint32_t sp, uint16_t &x, Args&&... args);
|
||||
template<int Bytes, int Offset, typename... Args>
|
||||
uint32_t StackFrame__(uint32_t sp, uint8_t &x, Args&&... args);
|
||||
|
||||
template<int Bytes, int Offset>
|
||||
uint32_t StackFrame__(uint32_t sp);
|
||||
|
||||
@ -55,6 +58,16 @@ uint32_t StackFrame__(uint32_t sp, uint16_t &x, Args&&... args)
|
||||
return StackFrame__<Bytes, Offset - 2>(sp, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
|
||||
template<int Bytes, int Offset, typename... Args>
|
||||
uint32_t StackFrame__(uint32_t sp, uint8_t &x, Args&&... args)
|
||||
{
|
||||
// byte pushes as 2 bytes with 1 garbage byte
|
||||
x = memoryReadByte(sp + Offset - 2);
|
||||
|
||||
return StackFrame__<Bytes, Offset - 2>(sp, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template<int Bytes, typename... Args>
|
||||
uint32_t StackFrame(Args&&... args)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user