Workaround framebuffer bug if screen width >1024

Framebuffer can't properly blit the image if width is >1024. Bump the
buffer size to 4096 so widths up to 4096 (which should be enough for now)
work.
This commit is contained in:
Ilari Liusvaara 2013-03-10 23:28:35 +02:00
parent 5d9131d2dc
commit b53fb1fe75
6 changed files with 17 additions and 6 deletions

View file

@ -571,6 +571,8 @@ namespace sky
int16_t nxe = ceil(sl2 * j + c2);
int16_t dstart = nxs;
int16_t dend = nxe;
if(nxs >= nxe)
continue;
uint32_t cstep = 255 * 65536 / (nxe - nxs + 1);
uint32_t color = 0;
if(true) {
@ -634,6 +636,8 @@ namespace sky
int16_t nxe = ceil(sl2 * j + c2);
int16_t dstart = nxs;
int16_t dend = nxe;
if(nxe <= nxs)
continue;
uint32_t cstep = 255 * 65536 / (nxe - nxs + 1);
uint32_t color = 0;
int16_t cstart = ccenter;
@ -720,6 +724,8 @@ namespace sky
int16_t nxe = ceil(sl2 * j + c2);
int16_t dstart = nxs;
int16_t dend = nxe;
if(nxe <= nxs)
continue;
uint32_t cstep = 255 * 65536 / (nxe - nxs + 1);
uint32_t color = 0;
if(j < ymin2 && p1.y != p2.y) {

View file

@ -143,7 +143,7 @@ namespace sky
{
uint16_t minline = 0x8f;
uint16_t maxline = 0x8f;
uint16_t ptr = 320 * 0x8f + 0x2a + (col / 3);
uint16_t ptr = 320 * 0x8f + 0x2a + (col / FB_SCALE);
uint32_t px = origbuffer[ptr] ;
while(origbuffer[ptr] == px)
ptr -= 320;
@ -152,7 +152,7 @@ namespace sky
while(origbuffer[ptr] == px)
ptr += 320;
maxline = ptr / 320 - 1;
render_framebuffer_vline(col + 3 * 0x2a, minline, maxline, c | 0xFF000000U);
render_framebuffer_vline(col + FB_SCALE * 0x2a, minline, maxline, c | 0xFF000000U);
}
void blink_between(unsigned x, unsigned y, unsigned w, unsigned h, uint32_t c1, uint32_t c2)

View file

@ -282,7 +282,7 @@ namespace sky
return;
}
if(!death && vspeed < 0)
noise(sound_bounce);
noise(sound_bounce, false);
vspeed = -((5 * static_cast<int16_t>(vspeed)) / 10);
}
void physics::check_landing(level& stage) throw()

View file

@ -72,6 +72,7 @@ namespace sky
subsample = 0;
mdr = 128;
rate = 128;
_hipri = 0;
}
void active_sfx_dma::reset(const struct sound& snd)
@ -128,9 +129,10 @@ namespace sky
sound_noise_maker::~sound_noise_maker() {}
void sound_noise_maker::operator()(int sound, bool hipri)
{
if(!hipri && dma.busy())
if(!hipri && dma.hipri() && dma.busy())
return;
dma.reset(snds[sound]);
dma.hipri(hipri);
}
sound_noise_maker gsfx(soundfx, _gstate.dma);

View file

@ -56,13 +56,16 @@ namespace sky
void reset(const struct sound& snd);
void fetch(struct sounds& snds, int16_t* buffer, size_t samples); //Stereo!
bool busy() { return (left > 0); }
bool hipri() { return (_hipri > 0); }
void hipri(bool hi) { _hipri = hi ? 1 : 0; }
private:
uint8_t access(const struct sounds& snds, uint32_t addr) { snds.access(addr); }
int64_t left;
uint32_t pointer;
uint32_t subsample;
uint32_t padA;
uint16_t padB;
uint8_t padB;
uint8_t _hipri;
uint8_t mdr;
uint8_t rate;
};

View file

@ -324,7 +324,7 @@ framebuffer<X>::~framebuffer() throw()
delete[] mem;
}
#define DECBUF_SIZE 1024
#define DECBUF_SIZE 4096
template<bool X>
void framebuffer<X>::copy_from(framebuffer_raw& scr, size_t hscale, size_t vscale) throw()