1
0
mirror of https://github.com/lefticus/6502-cpp.git synced 2025-07-23 06:24:30 +00:00

Almost working programs with AVR conversion

* need to add a decent header address
 * probably need to fix sbrc and sbrs
This commit is contained in:
Jason Turner
2021-04-22 15:52:35 -06:00
parent 13af1e8cca
commit 5591249f2a
3 changed files with 166 additions and 25 deletions

View File

@@ -6,22 +6,22 @@ enum class Colors : uint8_t
BLACK=0x00
};
volatile uint8_t &memory_loc(const uint16_t loc)
inline volatile uint8_t &memory_loc(const uint16_t loc)
{
return *reinterpret_cast<volatile uint8_t *>(loc);
}
void decrement_border_color()
inline void decrement_border_color()
{
--memory_loc(0xd020);
}
void increment_border_color()
inline void increment_border_color()
{
++memory_loc(0xd020);
}
bool joystick_down()
inline bool joystick_down()
{
uint8_t joystick_state = memory_loc(0xDC00);
return (joystick_state & 0x2) == 0;