1
0
mirror of synced 2024-11-27 17:00:53 +01:00
TaikoArcadeLoader/PLUGINS.md

48 lines
2.2 KiB
Markdown
Raw Normal View History

2022-09-18 01:04:44 +02:00
### Guide for making additional plugins
Plugins are just libraries with certain exported functions that go in the plugins folder.
```
void PreInit()
```
Runs in dllmain, may run into loader locks. You can also just use your own dllmain for this but that involves writing out all the arguments.
```
void Init()
```
Runs on bngrw_Init, may be a bit late for some things but should generally allow functions which would cause loader locks to run fine if a bit late.
```
void Exit()
```
Runs on bnusio_Close, dispose of any data here.
```
2022-09-18 05:22:56 +02:00
void Update()
```
Runs once per frame.
```
2022-09-18 01:04:44 +02:00
void WaitTouch(i32 (*callback) (i32, i32, u8[168], u64), u64 data)
```
Runs on bngrw_reqWaitTouch. Call the callback like so when you wish to have a card scanned.
```
u8 cardData[168]= { 0x01, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x2E, 0x58, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x5C, 0x97, 0x44, 0xF0, 0x88, 0x04, 0x00, 0x43, 0x26, 0x2C, 0x33, 0x00, 0x04, 0x06, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4E, 0x42, 0x47, 0x49, 0x43, 0x36, 0x00, 0x00, 0xFA, 0xE9, 0x69, 0x00, 0xF6, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
memcpy (cardData + 0x2C, chipId, 33);
memcpy (cardData + 0x50, accessCode, 21);
callback(0, 0, cardData, data);
2022-10-10 12:05:19 +02:00
```
```
void Card1Insert()
```
2022-10-10 12:15:26 +02:00
Runs when user presses CARD_INSERT_1, causes TAL to not insert a card if any plugins have this present
2022-10-10 12:05:19 +02:00
```
void Card2Insert()
```
2022-10-10 12:15:26 +02:00
Runs when user presses CARD_INSERT_2, causes TAL to not insert a card if any plugins have this present
2022-10-12 22:09:13 +02:00
```
2022-10-15 18:13:29 +02:00
void BeforeCard1Insert()
2022-10-12 22:09:13 +02:00
```
2022-10-15 18:13:29 +02:00
Runs before CARD_INSERT_1 is handled
2022-10-12 22:09:13 +02:00
```
2022-10-15 18:13:29 +02:00
void BeforeCard2Insert()
2022-10-12 22:09:13 +02:00
```
2022-10-15 18:13:29 +02:00
Runs before CARD_INSERT_2 is handled