Confirmed. I took out the button A press, the tiles remain, and no sprite jitters (also because the shots aren't being initailized due to this).D3thAdd3r wrote:I compiled it and it's strange about those tiles going black. Could you confirm that commenting out the print function here:fixes the black box issue on your end also?Code: Select all
//Shooting if(controller[num] & BTN_A) { playerShotTime[num]++; if(playerShotTime[num] == 8) { playerShotTime[num] = 0; } if(playerShotTime[num] == 0) { shotInitNext(num, playerPos[num], playerX[num], playerY[num]); playerScore[num] += 100; if(num == 0) { //PrintLong(7, 1, playerScore[num]); } else { PrintLong(29, 1, playerScore[num]); } } } else { playerShotTime[num] = 255; }
Sprite Jitterbug Issues
- ggvicviper
- Posts: 16
- Joined: Sat Oct 24, 2015 8:54 pm
Re: Sprite Jitterbug Issues
- ggvicviper
- Posts: 16
- Joined: Sat Oct 24, 2015 8:54 pm
Re: Sprite Jitterbug Issues
The jitter I'm experiencing is that maybe he sprite will be behind a half a frame and jumps back into place back and forth. It's happening on the shot sprites. It happens when you hold the fire button.D3thAdd3r wrote:Also I do not understand what you are meaning by sprite jitter. I attached what I compiled, does it exhibit the jitter you are talking about? If it does, could you explain a bit more what you mean? To me it looks good and the enemy movement is what I would expect from the code.
Re: Sprite Jitterbug Issues
I eliminated this line just to test:
then made changed the kernel flags:
as well as commenting out both PrintLong() for the player scores. After that it should be 1 tile shorter and centered vertically and not have that corruption you had previously. It was just to eliminate the possibility something weird was happening because you were out of free cycles in a frame. Maybe sprites only getting half blit before being shown or something. Also what version of the emulator are you using?
I didn't check it out, but you might save some cycles by turning this:
into this:
and likewise for the enemyUpdate(). I don't know if GCC would optimize away those function calls in those cases. If not that would be a big cycle gain maybe.
Code: Select all
// Print(1, 27, copyrightString);
Code: Select all
-DSCREEN_TILES_V=27 -DFIRST_RENDER_LINE=28
I didn't check it out, but you might save some cycles by turning this:
Code: Select all
//main()..
//...
i = MAX_SHOT_PLAYER;
while(i--) {
shotUpdate(i);
}
Code: Select all
shotUpdate();
//....in shot.c
[code]
void shotUpdate() {
i = MAX_SHOT_PLAYER;
while(i--) {
if(!(shotFlags[i] & FLAG_ACTIVE)) {
continue;//return;
}
//......
- Attachments
-
- hypergrid-invaders.hex
- more free cycles
- (56.06 KiB) Downloaded 331 times
- ggvicviper
- Posts: 16
- Joined: Sat Oct 24, 2015 8:54 pm
Re: Sprite Jitterbug Issues
I'll give all of those a try, thanks. Not sure if I could already be running out of cycles, but I guess we'll see. However, im not using an emulator. I'm running everything off the Uzebox JAMMA and running on arcade hardwareD3thAdd3r wrote:I eliminated this line just to test:then made changed the kernel flags:Code: Select all
// Print(1, 27, copyrightString);
as well as commenting out both PrintLong() for the player scores. After that it should be 1 tile shorter and centered vertically and not have that corruption you had previously. It was just to eliminate the possibility something weird was happening because you were out of free cycles in a frame. Maybe sprites only getting half blit before being shown or something. Also what version of the emulator are you using?Code: Select all
-DSCREEN_TILES_V=27 -DFIRST_RENDER_LINE=28
I didn't check it out, but you might save some cycles by turning this:into this:Code: Select all
//main().. //... i = MAX_SHOT_PLAYER; while(i--) { shotUpdate(i); }
and likewise for the enemyUpdate(). I don't know if GCC would optimize away those function calls in those cases. If not that would be a big cycle gain maybe.Code: Select all
shotUpdate(); //....in shot.c [code] void shotUpdate() { i = MAX_SHOT_PLAYER; while(i--) { if(!(shotFlags[i] & FLAG_ACTIVE)) { continue;//return; } //......
- ggvicviper
- Posts: 16
- Joined: Sat Oct 24, 2015 8:54 pm
Re: Sprite Jitterbug Issues
So, I have a bit of good news. I solved half the problem, which was the sprite jittering. Something must have been wrong with the order of which text was being written (and how often), so I moved it outside with a "old score vs new score" setup that notifies when to update the score. Sprite jittering gone.
The other issue remains - two of the BG tiles disappear when a score number is drawn. Any VRAM_TILES flags that have been suggested haven't been working particularly. I've attached the latest hex. Also, you can see my repo in git got updated with my latest code. I've also attached my latest hex. Button 1 now simply fires, but button 2 increases the score for the player.
The other issue remains - two of the BG tiles disappear when a score number is drawn. Any VRAM_TILES flags that have been suggested haven't been working particularly. I've attached the latest hex. Also, you can see my repo in git got updated with my latest code. I've also attached my latest hex. Button 1 now simply fires, but button 2 increases the score for the player.
- Attachments
-
- hypergrid-invaders.hex
- 10/25 build for Hypergrid Invaders
- (56.01 KiB) Downloaded 330 times