2017-02-26 16:00:41 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include "sdl-paddles.h"
|
|
|
|
|
2017-02-28 13:15:11 +00:00
|
|
|
#include "sdl-display.h"
|
2017-02-26 16:00:41 +00:00
|
|
|
|
|
|
|
#include "globals.h"
|
|
|
|
|
|
|
|
SDLPaddles::SDLPaddles()
|
|
|
|
{
|
|
|
|
p0 = p1 = 127;
|
|
|
|
}
|
|
|
|
|
|
|
|
SDLPaddles::~SDLPaddles()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void SDLPaddles::startReading()
|
|
|
|
{
|
|
|
|
g_vm->triggerPaddleInCycles(0, 12 * p0);
|
|
|
|
g_vm->triggerPaddleInCycles(1, 12 * p1);
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t SDLPaddles::paddle0()
|
|
|
|
{
|
|
|
|
return p0;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t SDLPaddles::paddle1()
|
|
|
|
{
|
|
|
|
return p1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SDLPaddles::gotMouseMovement(uint16_t x, uint16_t y)
|
|
|
|
{
|
2022-01-16 12:14:58 +00:00
|
|
|
// ***
|
|
|
|
p0 = ((float)x / (float)800) * (float) 255.0;
|
|
|
|
p1 = ((float)y / (float)480) * (float) 255.0;
|
2017-02-26 16:00:41 +00:00
|
|
|
}
|