- Joined: 28 Jan 2017
- Posts: 556
- Location: Málaga, Spain
|
Smslib load sprites data
Posted: Fri Apr 14, 2017 10:08 pm
|
A little trouble i have.
I have (random?) console resets loading sprite data. This happens (sometimes) when i get to a boss which uses 160 sprites (its an 32x40x8 frames animation). The game load the psgcompr data ingame and it does it between beginsprites and finishsprites. It happens in middle of a retrace. It resets the console sometimes.
So.... how i can do this safely? Two ideas:
// fails sometimes (as ot is now)
Waitvblank
Finishsprites
Copyspritestosat
Beginsprites
Loadspritedata
Loop
// retrace is not important here
Finishsprites
Copyspritestosat
Loadspritedata
Beginsprites
//retrace IS important
Waittovblank
finishsprites
Copyspritestosat
Loadspritedata
Beginsprites
The point for me is if the vblank moment is key here or i need to do loadspritedata outside begin...finish state and after copyspritestosat (or it must be other bug from myself as the reset is not happening always)...
Thanks.
|
- Joined: 28 Jan 2017
- Posts: 556
- Location: Málaga, Spain
|
Posted: Fri Apr 14, 2017 11:36 pm
|
Ummmm... this is strange. Everything fails else if... COMPILE WITH opt-code-size. Even without optimization it fails.
With opt-code-speed l__code is around 7800 and rest of game runs well so it seems strange. If someone can help or has curiosity ill upload the code. Of course banks are all around 16300 but never bigger than 16384.
|
- Joined: 28 Jan 2017
- Posts: 556
- Location: Málaga, Spain
|
Posted: Sat Apr 15, 2017 10:32 am
|
Solved!
First I updated SDCC but no luck.
Second I updated SMSLib for the github last version.
It seems the psgcompr function had an error and now it funcs well.
|
- Joined: 05 Sep 2013
- Posts: 3865
- Location: Stockholm, Sweden
|
Posted: Thu May 04, 2017 8:41 am
|
sorry to come back to you so late... yes, I had found a bug in the psgcompr decompression (asm) code... I was trashing IX register, which is incompatible with SDCC (it uses it as the frame pointer).
Good you found it :)
|