Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Smslib load sprites data

Reply to topic
Author Message
  • Joined: 28 Jan 2017
  • Posts: 549
  • Location: Málaga, Spain
Reply with quote
Smslib load sprites data
Post 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.
  View user's profile Send private message
  • Joined: 28 Jan 2017
  • Posts: 549
  • Location: Málaga, Spain
Reply with quote
Post 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.
  View user's profile Send private message
  • Joined: 28 Jan 2017
  • Posts: 549
  • Location: Málaga, Spain
Reply with quote
Post 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.
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3769
  • Location: Stockholm, Sweden
Reply with quote
Post 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 :)
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!