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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user