X-CulT Community Forums: Lag in Sonic 1 - X-CulT Community Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Lag in Sonic 1 Removing lag when many objets are loaded

#1 User is offline   carretero

Icon
Posts:
4
Joined:
25-August 07
Gender:
Male
Interest:
General Fan

Posted 29 June 2008 - 08:24 AM

-- What is lag and why it is generated? --While playing Sonic1 an infinite loop is executed in the main CPU (68000 uC). In this loop the CPU calculate the next state of the game and the video memory is updated.When the CPU doesn't have enough time to process all code, some frames can't be updated and an in-game delay appears. This delay is called lag.-- Where can it be noticed? --When many objects need to be loaded some delay appears for example if many rings spread out when sonic get hurt. Also when processing invincibility stars or breaking a wall in GHZ.-- How can it be removed? --While playing, the main CPU keeps a lot of time inactive. The CPU performs an active waiting whenever a write access in address $FFFFF62A is made.In order to improve the eficiency of the CPU, some code can be executed in spite of waiting.-- Disassembled code modification --1. In 'Level_MainLoop:' cut this instructions move.b #8,($FFFFF62A).w bsr.w DelayProgram2. Paste them here loc_3B14: move.b #8,($FFFFF62A).w jsr BuildSprites bsr.w DelayProgramThis way 'BuildSprites', that is a heavy routine, is executed in spite of wasting time. I recommend you to add this feature to your hack and to try other configurations.This modification is implemented in Sonic 1 - Return to the Origin. The lag in this hack is better than in any other Sonic 1 game.

#2 User is offline   ICEknight

Icon
Posts:
468
Joined:
01-January 06
Gender:
Male
Interest:
Researcher

Posted 23 July 2008 - 05:52 AM

Perhaps this would help getting rid of the slowdown in certain levels of Megamix?

#3 User is offline   JoseTB

Icon
Posts:
1
Joined:
26-July 08
Gender:
Male
Country:
Spain
Interest:
General Fan

Posted 26 July 2008 - 08:24 PM

Clever idea I must say, but that delay is actually on purpose to wait for the vsync to happen, so as not to fill the sprite table while the screen is still being drawn - if you call "buildsprites" before the vsync is met there are posibilities of getting the sprites unsynchronized in some or other way. Nonetheless I find it interesting, because it shouldn't affect this dramatically in the actual in-game "lag"...

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users