mirror of
https://github.com/GearsProgress/Poke_Transporter_GB.git
synced 2026-03-21 17:34:42 -05:00
This commit removes all references to things in the libstdc++ library to remove a decent chunk of bloat. This means every std::to_string() call, std::string and std::vector. (as well as iostream related stuff). I replaced those with my own versions ptgb::to_string() and ptgb::vector. Especially the latter is not exactly the same, but close enough. I also replaced operator new and delete with my own implementation to avoid pulling in everything related to exceptions from libstdc++ Another problem was the fact that libtonc uses siscanf, which pulls in everything related to the scanf family of functions and locale support. The worst part of that was that it included a 13KB "categories" symbol from libc_a-categories.o, which was pulled in because of the locale support integrated into newlibc's siscanf() function. To fix that, I created a custom, extremely restricted implementation of siscanf. libtonc only used this function to parse at most 2 integers from a string anyway.
41 lines
1.5 KiB
C
41 lines
1.5 KiB
C
//Created by StevenChaulk https://github.com/stevenchaulk/arduino-poke-gen2
|
|
|
|
#ifndef GAMEBOY_COLOUR_H_
|
|
#define GAMEBOY_COLOUR_H_
|
|
|
|
#include <tonc.h>
|
|
#include "libraries/gba-link-connection/LinkSPI.hpp"
|
|
#include "pokemon_party.h"
|
|
|
|
/*
|
|
#define LINK_SPI_NO_DATA 0xffffffff
|
|
#define LINK_SPI_SIOCNT_NORMAL 0
|
|
#define LINK_SPI_BIT_CLOCK 0
|
|
#define LINK_SPI_BIT_CLOCK_SPEED 1
|
|
#define LINK_SPI_BIT_SI 2
|
|
#define LINK_SPI_BIT_SO 3
|
|
#define LINK_SPI_BIT_START 7
|
|
#define LINK_SPI_BIT_LENGTH 12
|
|
#define LINK_SPI_BIT_IRQ 14
|
|
#define LINK_SPI_BIT_GENERAL_PURPOSE_LOW 14
|
|
#define LINK_SPI_BIT_GENERAL_PURPOSE_HIGH 15
|
|
#define LINK_SPI_SET_HIGH(REG, BIT) REG |= 1 << BIT
|
|
#define LINK_SPI_SET_LOW(REG, BIT) REG &= ~(1 << BIT)
|
|
|
|
#define LINK_SPI_SET(REG, BIT, VALUE) VALUE ? LINK_SPI_SET_HIGH(REG, BIT) : LINK_SPI_SET_LOW(REG, BIT)
|
|
*/
|
|
|
|
|
|
// The number of frames(?) between changing the clock signals
|
|
#define FAST_SPEED 10
|
|
#define SLOW_SPEED 1000
|
|
|
|
void setup();
|
|
byte handleIncomingByte(byte in, byte *box_data_storage, byte *curr_payload, GB_ROM *curr_gb_rom, Simplified_Pokemon *curr_simple_array, bool cancel_connection);
|
|
int loop(byte *box_data_storage, byte *curr_payload, GB_ROM *curr_rom, Simplified_Pokemon *curr_simple_array, bool cancel_connection);
|
|
byte exchange_parties(byte curr_in, byte *curr_payload);
|
|
byte exchange_boxes(byte curr_in, byte *party_data, GB_ROM *curr_gb_rom);
|
|
byte exchange_remove_array(byte curr_in, Simplified_Pokemon *curr_simple_array, bool cancel_connection);
|
|
|
|
#endif /* GAMEBOY_COLOUR_H_ */
|