diff options
author | Alec Murphy <alec@checksum.fail> | 2017-07-05 23:43:21 -0400 |
---|---|---|
committer | Alec Murphy <alec@checksum.fail> | 2017-07-05 23:43:21 -0400 |
commit | afb3915f3586df26ea2f7e8fe20d527cd20835a8 (patch) | |
tree | 79d918e5cda6beee55e4f5e1d37f112a8c55e9b1 | |
parent | fb796d0addefd0e49ed1c564a1137f2b216e91bc (diff) |
Fix sprite flicker in some games, actually fix 8x16 Y-flip bug this time
-rw-r--r-- | LCD.HC | 15 | ||||
-rw-r--r-- | Load.HC | 2 | ||||
-rw-r--r-- | Run.HC | 9 |
3 files changed, 16 insertions, 10 deletions
@@ -371,14 +371,17 @@ U0 drawFrameBuffer() { // if sprites enabled, draw SP0 to framebuffer - if (memory[0xFF40]>>1&1){ GrBlot(fb,0,0,sp0); }; + + GrBlot(fb,0,0,sp0); + // if (memory[0xFF40]>>1&1){ GrBlot(fb,0,0,sp0); }; // if bg enabled, draw BG rasterized to framebuffer if (memory[0xFF40]>>0&1){ GrBlot(fb,0,0,bgr); }; // if sprites enabled, draw SP1 to framebuffer if (memory[0xFF40]>>5&1){ GrBlot(fb,memory[0xFF4B]-7,memory[0xFF4A],win); }; // if sprites enabled, draw WIN to framebuffer - if (memory[0xFF40]>>1&1){ GrBlot(fb,0,0,sp1); }; + GrBlot(fb,0,0,sp1); + //if (memory[0xFF40]>>1&1){ GrBlot(fb,0,0,sp1); }; // if LCD enabled, draw framebuffer to LCD if ((memory[0xFF40]>>7)&1){ @@ -402,7 +405,8 @@ U0 renderSprites() s_tile=0; // Draw Sprites from OAM - if (memory[0xFF40]>>1&1) + if (TRUE) + //if (memory[0xFF40]>>1&1) { oam_ctr=156; while(oam_ctr>-4) @@ -460,7 +464,7 @@ U0 renderSprites() }; if (odc->color!=TRANSPARENT) { - if ((memory[0xFE00+oam_ctr+3]>>6)&1) + if ((memory[0xFE00+oam_ctr+3]>>6)&1 && !(memory[0xFF40]>>2&1)) { GrPlot(odc,memory[0xFE00+oam_ctr+1]-8+(7-sp_px),(-8*sp_yf)+8+memory[0xFE00+oam_ctr]-16+sp_py); } else { @@ -476,7 +480,7 @@ U0 renderSprites() if((tp2>>bg_px)&1){odc->color=sp01;}else{odc->color=TRANSPARENT;}; }; if (odc->color!=TRANSPARENT) { - if ((memory[0xFE00+oam_ctr+3]>>6)&1) + if ((memory[0xFE00+oam_ctr+3]>>6)&1 && !(memory[0xFF40]>>2&1)) { GrPlot(odc,memory[0xFE00+oam_ctr+1]-8+(7-sp_px),(8*sp_yf)+memory[0xFE00+oam_ctr]-16+sp_py); } else { @@ -499,4 +503,3 @@ U0 renderSprites() }; }; }; -
\ No newline at end of file @@ -1308,5 +1308,5 @@ U0 Run(U8 *rom_file) ROM=FileRead(rom_file,&ROMSize); StrCpy(StateFile,rom_file); StrCpy(StateFile+StrLen(StateFile)-3,".STA.Z"); - start; + start; } @@ -1,6 +1,6 @@ CTask *cherub; -U8 RunCmd[1024]; -U8 RomList[65536]; +U8 *RunCmd=CAlloc(1024); +U8 *RomList=CAlloc(65536); I64 pos=0; CDirEntry *rom_f; @@ -25,7 +25,7 @@ rom_f=roms; if (rom_i>-1) { - while (incr<rom_i) + while (incr<rom_i) { rom_f=rom_f->next; incr++; @@ -39,5 +39,8 @@ if (rom_i>-1) }; DirEntryDel(roms); +Free(RomList); +Free(RunCmd); rom_f=NULL; +
\ No newline at end of file |