~atomet/TeMaC

5ed766889998e66131b943fdb9e37b1c1b29fce7 — NeoTEo 1 year, 4 months ago 23de5ec
fix window resize logic.
1 files changed, 3 insertions(+), 3 deletions(-)

M src/temu.c
M src/temu.c => src/temu.c +3 -3
@@ 174,8 174,8 @@ static void display_write(TeMa *t,uint8 p,uint8 v) {
			// at this point the display device buffer is assumed to contain the x and y positions and an address
			uint16 xpos = BYTES2SHORT(d+0x08), ypos = BYTES2SHORT(d+0x0A), adr = BYTES2SHORT(d+0x0C);
			Layer* layer = *(d+0x0F) & 0x4 ? &scr.l1 : &scr.l0;
			char* layerid = *(d+0x0F) & 0x4 ? "fg" : "bg";
			printf("display_write received dma: about to blit %s at %d,%d\n",layerid,xpos,ypos);
			//char* layerid = *(d+0x0F) & 0x4 ? "fg" : "bg";
			//printf("display_write received dma: about to blit %s at %d,%d\n",layerid,xpos,ypos);
			if(xpos>=scr.wid || ypos>=scr.hgt) break;

			blit_sprite(&scr, layer->data, xpos, ypos,&t->ram[adr]) ;


@@ 293,7 293,7 @@ int handle_events(TeMa* tema) {
		case SDL_KEYDOWN: {
			if(ev.key.repeat == 1 ) break;
			// do check for host specific keys (like function keys)
			if(ev.key.keysym.sym == SDLK_F1) { wresx = (wresx+1)%3; update_window(); break; }
			if(ev.key.keysym.sym == SDLK_F1) { wresx = wresx<<1; if(wresx>4) wresx = 1; update_window(); break; }
			update_controller(ev.key.keysym.sym, &controller_state, 1);
			
			tema->device[0x83] = controller_state;