melonDS/src/DSi_SPI_TSC.h

58 lines
1.3 KiB
C
Raw Normal View History

2019-08-04 09:44:36 +00:00
/*
2024-06-15 15:01:19 +00:00
Copyright 2016-2024 melonDS team
2019-08-04 09:44:36 +00:00
This file is part of melonDS.
melonDS is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
melonDS is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with melonDS. If not, see http://www.gnu.org/licenses/.
*/
#ifndef DSI_SPI_TSC
#define DSI_SPI_TSC
#include "types.h"
#include "Savestate.h"
2023-11-03 19:17:00 +00:00
#include "SPI.h"
namespace melonDS
{
class DSi;
2023-11-03 19:17:00 +00:00
class DSi_TSC : public TSC
2019-08-04 09:44:36 +00:00
{
2023-11-03 19:17:00 +00:00
public:
DSi_TSC(melonDS::DSi& dsi);
2023-11-03 19:17:00 +00:00
~DSi_TSC() override;
2019-08-04 09:44:36 +00:00
2023-11-03 19:17:00 +00:00
void Reset() override;
2019-08-04 09:44:36 +00:00
2023-11-03 19:17:00 +00:00
void DoSavestate(Savestate* file) override;
2019-08-04 09:44:36 +00:00
2023-11-03 19:17:00 +00:00
// 00=DS-mode 01=normal
void SetMode(u8 mode);
2023-11-03 19:17:00 +00:00
void SetTouchCoords(u16 x, u16 y) override;
void MicInputFrame(const s16* data, int samples) override;
2019-08-04 09:44:36 +00:00
2023-11-03 19:17:00 +00:00
void Write(u8 val) override;
void Release() override;
2019-08-04 09:44:36 +00:00
2023-11-03 19:17:00 +00:00
private:
u8 Index;
u8 Bank;
u8 Bank3Regs[0x80];
u8 TSCMode;
};
2019-08-04 09:44:36 +00:00
}
2019-08-04 09:44:36 +00:00
#endif // DSI_SPI_TSC