*** ETERNAL_STRIKER_M5 2019/2/11 ***

*Overview
-Works that ported STG [ETERNAL STRIKER Rr], which was operating in MIDP environment.
-When using the [M5Stack-SD-Menu] system, set [ETERNAL_STRIKER_M5.bin] to SD
 If you write it to [Root folder], it works only by selecting from [Menu].
-It corresponds to "FIRE (16 Mb aircraft)" and "ESP 32 Arduino SDK V 1.0.1 Version" from 2019/2/11 edition.

*FILES
-[For_SD_Uploader>ETERNAL_STRIKER_M5.bin]
 -For [M5Stack-SD-Menu] system.
  +[M5Stack-SD-Menu] > Copyright 2018 tobozo http://github.com/tobozo
   Released under the MIT license
   https://github.com/YukinobuKurata/YouTubeMagicBuyButton/blob/master/MIT-LICENSE.txt
 -ESP32 Arduino SDK V1.0.0 Version (OLD)
  +Compile with "M5Stack_Core_ESP32" Profile

+[For_SD_Uploader>ETERNAL_STRIKER_M5_For101.bin] 
 -For [M5Stack-SD-Menu] system.
 -ESP32 Arduino SDK V1.0.1 Version
  +Compile with "M5Stack_Core_ESP32" Profile

+[For_SD_Uploader>ETERNAL_STRIKER_M5_Fire_F101.bin]
 -For [M5Stack-SD-Menu] system.
 -ESP32 Arduino SDK V1.0.1 Version
  +Compile with "M5Stack_Fire" Profile

-[ETERNAL_STRIKER_M5_APL0.bin]
 -Binary image file of the application.
 -In "esptool.exe", transfer to the M5Stack terminal.
 -When it does not work well, please start writing something 【sketch】, please write.
 -Write "~_APL0" file from address 0x10000

-[ETERNAL_STRIKER_M5.bat]
 -Place "esptool.exe" in the folder and execute the batch file, you can transfer the application.
  -I'm sorry. It is compatible only with Windows OS.

-[ETERNAL_STRIKER_M5_APL0_V101(FIRE).bin]
 -Binary image file of the application.
 -In "esptool.exe", transfer to the M5Stack terminal.
 -When it does not work well, please start writing something 【sketch】, please write.
 -Write "~_APL0" file from address 0x10000 to 0x150000
 -ESP32 Arduino SDK V1.0.1 Version
  +Compile with "M5Stack_Fire" Profile

-[ETERNAL_STRIKER_M5_V101(FIRE).bat]
 -Place "esptool.exe" in the folder and execute the batch file, you can transfer the application.
  -I'm sorry. It is compatible only with Windows OS.
 -ESP32 Arduino SDK V1.0.1 Version
  +Compile with "M5Stack_Fire" Profile

*Excerpt of changes in [M5Stack library].
 +[const] version only. [8bitColor] specialized.
 +0 value handled transparently, Clipping supported, single color replacement supported.
 +Probably so fast processing.
 +Hopefully it will be helpful.
 (+[const]版のみ。[8bitColor]に特化。
  +０値を透過扱い、クリッピング対応、単一色置き換え対応。
  +多分まあまあの高速処理。参考になれば幸いです。)

//[Sprite.h]
//2018/10/5 T.K Add Function selector
#define SPR_ZERO_T (1<<4) //Transparent color(0) ON
#define SPR_CLIP (1<<5) //Clipping ON
#define SPR_COLOR (1<<6) //Color Replacement ON (SPR_ZERO_T ONLY)
//
  void     pushImage_D8AD(int32_t x0, int32_t y0, uint32_t w, uint32_t h, const uint8_t *data  ,uint16_t cl=0xffff);//Add Function Color data for replacement. (uint16_t cl)
//

//[Sprite.cpp]
*/
/***************************************************************************************
** Function name:           pushImage 8bitDIRECT ADVANCE Clipping/Transparent 2018/10/5 T.K Add
*************************************************************************************x*/
// TODO Need to add more area boundary checks
void  TFT_eSprite::pushImage_D8AD(int32_t x, int32_t y, uint32_t w, uint32_t h, const uint8_t *data ,uint16_t cl)
{
  if (!_created ||_bpp != 8 || (x >= _iwidth) || (y >= _iheight) || (w == 0) || (h == 0) ) return;
	int yp2,dx,dx2,dt;
	byte color;
	if(m&SPR_CLIP)//Clipping MODE
	for (int32_t yp = 0; yp < h; yp++)
	{
		//Cliping
		if(y+yp>=_iheight){break;}
		else
		if(y+yp<0){data+=w;continue;}
		yp2=(y+yp)*_iwidth;dx=x;dx2=x+w;
		if(dx<0){data+=dx*-1;dx=0;}
		if(dx2>=_iwidth){dt=dx2-_iwidth;dx2=_iwidth;}
		else
		dt=0;
		if(m&SPR_ZERO_T)//Transparent color(0) ON >Run
		{
			if(m&SPR_COLOR)
			for (int32_t xp = dx; xp < dx2; xp++){
				color = pgm_read_byte(data++);
			 	if(color)_img8[xp + yp2] = cl;
			}
			else
			for (int32_t xp = dx; xp < dx2; xp++){
				color = pgm_read_byte(data++);
			 	if(color)_img8[xp + yp2] = color;
			}
		}
		else
		for (int32_t xp = dx; xp < dx2; xp++){
			_img8[xp + yp2] = pgm_read_byte(data++);
		}
		data+=dt;
	}
	else//NORMAL
	if(m&SPR_ZERO_T)//Transparent color(0) ON >Run
		for (uint32_t yp = y; yp < y + h; yp++)
		{
			yp2=yp * _iwidth;
		  for (uint32_t xp = x; xp < x + w; xp++)
		  {
			color = pgm_read_byte(data++);
			if(color)_img8[xp + yp2] = color;
		  }
		}
		else//NO EFFECT
		for (uint32_t yp = y; yp < y + h; yp++)
		{
			yp2=yp * _iwidth;
		  for (uint32_t xp = x; xp < x + w; xp++)
		  {
			_img8[xp + yp2]= pgm_read_byte(data++);
		  }
		}
}

*Contact Information

TETUBUN KATAKOTO (Team Redherring)

Team Redherring/STUDIO Sequence
https://twitter.com/TEAM_REDHERRING
Follow me.

The recent work is here.

[Wrathgrave's detective story (RASUGUREIVU TANTEI TAN)]
http://opera-house.jp/wds/

Application:
https://play.google.com/store/apps/details?id=com.team_rh.ADV_DR_HG_EX1
https://play.google.com/store/apps/details?id=com.team_rh.ADV_DR_HG_G0
https://play.google.com/store/apps/details?id=com.team_rh.ADV_DR_HG_G1

An old type of reasoning adventure game.
Sorry, the application is only available in Japanese.

Others:
Somewhat old work. There are other new projects planned.

[ETARNAL STRIKER Ad]
https://play.google.com/store/apps/details?id=com.studiosequence.ESad_Lite
https://www.amazon.co.jp/Team-Redherring-STUDIO-Sequence-ETERNAL/dp/B00V591ZN6/

[BLOCK BREAKER AT]
https://play.google.com/store/apps/details?id=com.studiosequence.BB_AT
https://www.amazon.co.jp/Team-Redherring-STUDIO-Sequence-BRAEKER/dp/B019B4NAVQ/

