fix and clarify Sprite assembly comments

This commit is contained in:
Scott Allen 2017-08-28 21:31:10 -04:00
parent 420b958208
commit 383bdfc144
1 changed files with 8 additions and 7 deletions

View File

@ -341,19 +341,20 @@ void Sprites::drawBitmap(int16_t x, int16_t y,
[x_count] "l" (rendered_width), // lower register [x_count] "l" (rendered_width), // lower register
[sprite_ofs] "z" (bofs), [sprite_ofs] "z" (bofs),
[buffer_ofs] "x" (Arduboy2Base::sBuffer+ofs), [buffer_ofs] "x" (Arduboy2Base::sBuffer+ofs),
[buffer_ofs_jump] "a" (WIDTH-rendered_width), // lower register [buffer_ofs_jump] "a" (WIDTH-rendered_width), // upper reg (r16-r23)
[sprite_ofs_jump] "a" ((w-rendered_width)*2), // lower register [sprite_ofs_jump] "a" ((w-rendered_width)*2), // upper reg (r16-r23)
// [sprite_ofs_jump] "r" (0), // [sprite_ofs_jump] "r" (0),
[yOffset] "l" (yOffset), // lower register [yOffset] "l" (yOffset), // lower register
[mul_amt] "l" (mul_amt) // lower register [mul_amt] "l" (mul_amt) // lower register
// NOTE: We also clobber r28 and r29 but sometimes the compiler // NOTE: We also clobber r28 and r29 (y) but sometimes the compiler
// won't allow us so in order to make this work we don't tell it // won't allow us, so in order to make this work we don't tell it
// they we clobber them. Then we need to guarantee that the // that we clobber them. Instead, we push/pop to preserve them.
// the compiler doesn't put one of our own variables into r28/r29. // Then we need to guarantee that the the compiler doesn't put one of
// our own variables into r28/r29.
// We do that by specifying all the inputs and outputs use either // We do that by specifying all the inputs and outputs use either
// lower registers (l) or simple (r16-r23) upper registers (a). // lower registers (l) or simple (r16-r23) upper registers (a).
: // clobbers r28 and r29 : // pushes/clobbers/pops r28 and r29 (y)
); );
break; break;
} }