Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug day #324

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 63 additions & 59 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,59 +1,63 @@
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# =========================
# Operating System Files
# =========================

# OSX
# =========================

.DS_Store
.AppleDouble
.LSOverride

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
bin/
!bin/myevic.bin
*.sh
disasm/
obj/
projects/
*.o
startfiles
driver/*.sys
*.map
genuine/
wrkspc.txt
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# =========================
# Operating System Files
# =========================

# OSX
# =========================

.DS_Store
.AppleDouble
.LSOverride

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
bin/
!bin/myevic.bin
*.sh
disasm/
obj/
projects/
*.o
startfiles
driver/*.sys
*.map
genuine/
wrkspc.txt
!/bin/
/bin/myevic.elf
/bin/myevic_dec.bin
/nbproject/
Empty file modified ISSUE_TEMPLATE.md
100755 → 100644
Empty file.
Empty file modified LICENSE.txt
100755 → 100644
Empty file.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ MYEVIC_OBJS := src/myevic.o \
src/storage.o \
src/flappy.o \
src/fbdata.o \
src/tetris.o \
src/ttdata.o \
src/fonts.o \
src/display.o \
src/SSD1306.o \
Expand Down Expand Up @@ -193,6 +195,9 @@ $(TARGET)_dec.bin: $(OBJS_FIXPATH) $(MYEVIC_OBJS)
$(LD) --start-group $(LIBS) $(OBJS_FIXPATH) $(MYEVIC_OBJS) --end-group $(LDFLAGS) -o $(OUTDIR)/$(TARGET).elf
$(OBJCOPY) -O binary -j .text -j .data $(OUTDIR)/$(TARGET).elf $(OUTDIR)/$(TARGET)_dec.bin

export LC_ALL=C.UTF-8
export LANG=C.UTF-8

$(TARGET).bin: $(TARGET)_dec.bin
evic convert $(OUTDIR)/$(TARGET)_dec.bin -o $(OUTDIR)/$(TARGET).bin

Expand Down
Empty file modified README_pt_BR.docx
100755 → 100644
Empty file.
Binary file modified bin/myevic.bin
100755 → 100644
Binary file not shown.
4 changes: 4 additions & 0 deletions inc/dataflash.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ typedef struct dfParams
/* 00E0 */ uint16_t Millis;
/* 00E2 */ uint8_t Profile;
/* 00E3 */ int8_t BVOffset[4];
/* 00E7 */ uint16_t TTBest;
/* 00E9 */ uint8_t TTSpeed;
}
dfParams_t;

Expand Down Expand Up @@ -349,6 +351,8 @@ extern dfStruct_t DataFlash;
#define dfSavedCfgPwr DFP(SavedCfgPwr)
#define dfFBBest DFP(FBBest)
#define dfFBSpeed DFP(FBSpeed)
#define dfTTBest DFP(TTBest)
#define dfTTSpeed DFP(TTSpeed)
#define dfBattPC DFP(BattPC)
#define dfContrast DFP(Contrast)
#define dfModesSel DFP(ModesSel)
Expand Down
4 changes: 2 additions & 2 deletions inc/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ extern const image_t **Images;

extern const image_t const *font0_1306[];
extern const image_t const *font0_1327[];
extern const image_t const *font1_1306[];
extern const image_t const *font1_1327[];
//extern const image_t const *font1_1306[];
//extern const image_t const *font1_1327[];

//-------------------------------------------------------------------------

Expand Down
3 changes: 3 additions & 0 deletions inc/events.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ extern uint8_t LastEvent;
#define EVENT_PROFILE_MENU 118
#define EVENT_NEXT_PROFILE 119
#define EVENT_POWER_CURVE 120
#define EVENT_TETRIS 121


//==============================================================================
Expand All @@ -91,6 +92,8 @@ enum
CLICK_ACTION_NEXT_MODE,
CLICK_ACTION_ON_OFF,
CLICK_ACTION_PROFILE,
CLICK_ACTION_TETRIS,
CLICK_ACTION_GAME,
CLICK_ACTION_MAX
};

Expand Down
1 change: 1 addition & 0 deletions inc/myevic.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ typedef struct
/* 00200000 */ int fading:1;
/* 00400000 */ int led_on:1;
/* 00800000 */ int splash:1;
/* 01000000 */ int playing_tt:1;
}

gFlags_t;
Expand Down
10 changes: 10 additions & 0 deletions inc/screens.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ extern const uint8_t String_Right[];
extern const uint8_t String_Left[];
extern const uint8_t String_Logo[];
extern const uint8_t String_Game[];
extern const uint8_t String_Tetris[];
extern const uint8_t String_Easy[];
extern const uint8_t String_Normal[];
extern const uint8_t String_Hard[];
Expand Down Expand Up @@ -299,6 +300,15 @@ extern const uint8_t String_Enable[];
extern const uint8_t String_Reset[];
extern const uint8_t String_Splash[];

//from display.c
extern const uint8_t String_Sunday[];
extern const uint8_t String_Monday[];
extern const uint8_t String_Tuesday[];
extern const uint8_t String_Wednesday[];
extern const uint8_t String_Thursday[];
extern const uint8_t String_Friday[];
extern const uint8_t String_Saturday[];
extern const uint8_t String_Survival[];

//==============================================================================

Expand Down
12 changes: 12 additions & 0 deletions inc/tetris.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef __TETRIS_H__
#define __TETRIS_H__

extern void ttInitTimeouts();
extern void ttSetTimeoutDelay( int );
extern void ttTickTimeouts();
extern void ttCallTimeouts();
extern void ttGame();
extern void ttStartGame();

#endif /* __TETRIS_H__ */

1 change: 1 addition & 0 deletions src/dataflash.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ __myevic__ void ResetDataFlash()
// dfFBBest = 0;
// dfFBSpeed = 0;
// dfBattPC = 0;
dfTTBest = 0;
dfContrast = 45;
// dfModesSel = 0;
dfClkRatio = RTC_DEF_CLK_RATIO;
Expand Down
36 changes: 32 additions & 4 deletions src/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ typedef struct
uint8_t sep2offset;
}
datefmt_t;

__myevic__ void DrawDate( int x, int y, S_RTC_TIME_DATA_T *rtd, int colors )
{
{
const datefmt_t format[] =
{
{ 0xC1, 0, 16, 32, 12, 28 },
Expand All @@ -179,6 +179,32 @@ __myevic__ void DrawDate( int x, int y, S_RTC_TIME_DATA_T *rtd, int colors )
if (colors&0x01) DrawValue( x + f->yearoffset, y, rtd->u32Year, 0, 0x0B, 4 );
if (colors&0x08) DrawImage( x + f->sep1offset, y, f->separator );
if (colors&0x02) DrawImage( x + f->sep2offset, y, f->separator );

y += 13;
switch ( rtd->u32DayOfWeek )
{
case 0:
DrawStringCentered( String_Sunday, y );
break;
case 1:
DrawStringCentered( String_Monday, y );
break;
case 2:
DrawStringCentered( String_Tuesday, y );
break;
case 3:
DrawStringCentered( String_Wednesday, y );
break;
case 4:
DrawStringCentered( String_Thursday, y );
break;
case 5:
DrawStringCentered( String_Friday, y );
break;
case 6:
DrawStringCentered( String_Saturday, y );
break;
}
}


Expand Down Expand Up @@ -668,13 +694,15 @@ __myevic__ void Screen2Bitmap( uint8_t *pu8Bitmap )
//-------------------------------------------------------------------------
__myevic__ void DisplaySetFont()
{
if ( dfStatus.font )
{
//if ( dfStatus.font )
//{
Images = font0_1306;
/*
}
else
{
Images = font1_1306;
}
*/
}

1 change: 1 addition & 0 deletions src/eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "meadc.h"
#include "atomizer.h"
#include "flappy.h"
#include "tetris.h"

//=========================================================================
// Globals
Expand Down
40 changes: 37 additions & 3 deletions src/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "atomizer.h"
#include "battery.h"
#include "flappy.h"
#include "tetris.h"
#include "timers.h"
#include "meusbd.h"

Expand Down Expand Up @@ -393,6 +394,14 @@ __myevic__ void GetUserInput()
case CLICK_ACTION_PROFILE:
FireClicksEvent = EVENT_NEXT_PROFILE; // Cycle profile
break;

case CLICK_ACTION_TETRIS:
FireClicksEvent = EVENT_TETRIS; // tetris
break;

case CLICK_ACTION_GAME:
FireClicksEvent = 41; // Game
break;
}
if ( dfStatus.off )
{
Expand Down Expand Up @@ -483,17 +492,28 @@ __myevic__ void GetUserInput()
}
else if ( !dfStatus.off )
{
if ( !gFlags.playing_fb )
if ( !gFlags.playing_fb && !gFlags.playing_tt)
{
Event = EVENT_ENTER_MENUS;
}
else
{
if ( gFlags.playing_fb)
{
gFlags.playing_fb = 0;
Event = 0;
fbInitTimeouts();
MainView();
}
}
if ( gFlags.playing_tt)
{
gFlags.playing_tt = 0;
Event = 0;
ttInitTimeouts();
MainView();
}

}
}
}
}
Expand Down Expand Up @@ -1269,7 +1289,21 @@ __myevic__ int CustomEvents()
EditModeTimer = 3000;
EditItemIndex = 0;
break;


case 40:
SetScreen( 107, 30 );
EditModeTimer = 3000;
EditItemIndex = 0;
break;

case 41:
fbStartGame();
break;

case EVENT_TETRIS:
ttStartGame();
break;

default:
vret = 0;
break;
Expand Down
Loading