Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandro committed Aug 9, 2018
1 parent 33ea398 commit 316bc18
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 26 deletions.
5 changes: 1 addition & 4 deletions VGAX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ Minimum value must be 35 (calculate from Nick Gammon)
You can modify this value to center the framebuffer vertically, or not*/
#define SKIPLINES 90

//number of visible lines, after SKIPLINES
#define RENDERLCOUNT 359

static byte afreq, afreq0;
unsigned vtimer;
static byte aline, rlinecnt;
Expand Down Expand Up @@ -81,7 +78,7 @@ ISR(TIMER2_OVF_vect) {
vskip--;
return;
}
if (rlinecnt<60) {
if (rlinecnt<VGAX_HEIGHT) {
//interrupt jitter fix (needed to keep signal stable)
//code from https://github.com/cnlohr/avrcraft/tree/master/terminal
//modified from 4 nop align to 8 nop align
Expand Down
4 changes: 2 additions & 2 deletions VGAX.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ class VGAX {
* print(fnt, glyphscount, fntheight, hspace, vspace, str, dx, dy, color)
* fnt: font definition, generated from 2BITFONT tool
* glyphscount: number of symbols inside font definition (generated from
* 2bitfont tool)
* fntheight: font height (generated from 2bitfont tool)
* 2BITFONT tool)
* fntheight: font height (generated from 2BITFONT tool)
* hspace: horizontal space between each printed symbol
* vspace: vertical space between each printed symbol
* str: string to be printed. The string is readed from PROGMEM (FLASH)
Expand Down
20 changes: 0 additions & 20 deletions examples/MarioSprites/MarioSprites.ino
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,9 @@ void setup() {
vga.clear(11);
}
void loop() {
#if 0
int rx=rand() % (VGAX_WIDTH+16) -16;
int ry=rand() % (VGAX_HEIGHT+16)-16;
vga.blitwmask((byte*)(img_mario_data[0]), (byte*)(img_mariomask_data[0]), IMG_MARIO_WIDTH, IMG_MARIO_HEIGHT, rx, ry);
#else
#if 1
//static byte bpos=120;
static byte sidx=1;
//static byte off=0;
//for (int i=0; i!=9; i++) {
// vga.blit((byte*)(img_mario_data[12]), IMG_MARIO_WIDTH, IMG_MARIO_HEIGHT, i*16-off, 44);
//}
//off=(off+1)%16;
//vga.blit((byte*)(img_mario_data[sidx]), IMG_MARIO_WIDTH, IMG_MARIO_HEIGHT, 52, 28);
//vga.fillrect(60-IMG_MARIO_WIDTH/2, 29, IMG_MARIO_WIDTH, IMG_MARIO_HEIGHT, 3);
vga.blitwmask((byte*)(img_mario_data[sidx]), (byte*)(img_mariomask_data[sidx]), IMG_MARIO_WIDTH, IMG_MARIO_HEIGHT, rand()%VGAX_WIDTH-IMG_MARIO_WIDTH/2, rand()%VGAX_HEIGHT-IMG_MARIO_HEIGHT/2);
//vga.delay(10);
sidx=sidx==1 ? 2 : 1;
#endif
#endif
static unsigned cnt;
if (!(cnt % 5))
vga.noTone();
Expand All @@ -82,7 +65,4 @@ void loop() {
cnt=0;
vga.clear(3);
}
//8
//9 10
//11 12 13
}

0 comments on commit 316bc18

Please sign in to comment.