Add get_frame_counter() method to VGA module interface.
This commit is contained in:
parent
5f11fa209f
commit
c23bcc7f43
@ -29,7 +29,7 @@ int main()
|
||||
for (;;)
|
||||
{
|
||||
// moving sine
|
||||
const uint16_t fc = frame_counter;
|
||||
const uint16_t fc = vga_get_frame_counter();
|
||||
const uint16_t x = fc % 640;
|
||||
const uint16_t y = 380 + 100 * (abs(320 - x) / 640.0) * sin((fc % 640) / 12.738);
|
||||
|
||||
|
@ -26,7 +26,7 @@ static PIORun vga_hsync, vga_vsync, vga_pixel;
|
||||
static bool dma_ready = false;
|
||||
static int dma_channel;
|
||||
|
||||
unsigned long int frame_counter = 0;
|
||||
static unsigned long int frame_counter = 0;
|
||||
|
||||
static void setup_clocks(void)
|
||||
{
|
||||
@ -213,3 +213,8 @@ void vga_machines_init(void)
|
||||
|
||||
printf("Now running.\n");
|
||||
}
|
||||
|
||||
unsigned long int vga_get_frame_counter(void)
|
||||
{
|
||||
return frame_counter;
|
||||
}
|
Loading…
Reference in New Issue
Block a user