Basic Questions and Answers Thread

Discussion in 'Discussion & Q&A' started by Malevolence, Jul 7, 2009.

  1. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    It wouldn't be too difficult to change over to the Sonic 2 object layout format, just a matter of changing which bits the object manager checks for certain things. Transferring your layouts might be a bit involved, unless someone's written a specific tool, you'd have to run each level through LevelConverter, make sure "Convert objects as-is" is checked and "Convert known objects only" is unchecked, then grab the Objects.bin from each folder and replace the proper file with it.
     
  2. RouRouRou

    RouRouRou Ain't no fun if the aliens can't have none. Member

    Joined:
    Nov 20, 2016
    Messages:
    97
    Removing the flag? I'm interested in that.
    Could someone please tell me where to find the code?

    I'd also like to know how to get these new objects to properly load in SonLVL, but that's another problem for another day.
     
  3. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    Like I said, it would be a simple change to move the respawn flag from the ID byte to the Y position word and shift the X and Y flip flags over by one bit, to match Sonic 2's format. The code you need to edit is at loc_DA3C in S1 (any disassembly). The equivalent code in Sonic 2 is at ChkLoadObj.
     
  4. RouRouRou

    RouRouRou Ain't no fun if the aliens can't have none. Member

    Joined:
    Nov 20, 2016
    Messages:
    97
    Thanks, the 2005 disam has confusing labels, I'll try it out when I get time.
    Edit: I'll provide results as well.
    Edit 2: Let's just say that recently, there's been nothing worth showing off.
     
    Last edited: Sep 5, 2018
  5. Unused Account

    Unused Account Well-Known Member Member

    Joined:
    May 10, 2013
    Messages:
    154
    Probably a bit of a simple question, but I have no clue -
    How could I add custom art to Sonic 1? Wanted to just make some Sonic sprites and new tiles for GHZ, but I have no way to actually put them in the game. I found a tutorial for Sonic years ago, but I assume it's outdated and there's easier methods (I remember this tutorial taking ~20 minutes for a single sprite to be replaced).
     
  6. RouRouRou

    RouRouRou Ain't no fun if the aliens can't have none. Member

    Joined:
    Nov 20, 2016
    Messages:
    97
    There's a lot of methods for adding custom art to Sonic 1. For level art, the easiest would be using SonLVL's built in editor thst works like a paint program, (In my opinion) and for Sonic you could use SonMapED. Keep in mind you'll have to import the art, there's no built in editor.

    Of course, these are just my options and someone else will probably have spmething better.

    Edit: Typing on a phone is no fun.
    Edit 2: That's right, Flex 2 exists. I haven't used it though.
     
    Last edited: Sep 4, 2018
  7. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    You could use Flex 2, which is basically SonMapEd but better, or SonLVL's SpritePlotter.NET if you just want to import a sprite sheet. Possibly both.
     
  8. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,170
    Location:
    Limbo
    Does anyone have tips for optimizing Sonic 2s' TouchResponse routine? I'm trying to improve speed when multiple objects that use the routine are on screen, and it's taking up all the CPU time (for good reason, of course). Even just a little bit of a speed improvement might help drastically.

    EDIT: And is there any reason for there being a 'nop' right at the beginning of the routine? It seems completely pointless. It's not like it's trying to talk to the Z80 or anything along those lines...
     
    Last edited: Sep 5, 2018
  9. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,870
    I'm surprised no-one's answered yet, usually they answer before I finish work and beat me to the punch. Lucky me this time, eh? d=

    There are a few things you could do to speed it up, if you're willing of course. I've worked up a few ideas you can use, or perhaps you could improve on them. Here are a few minors:

    Code:
    	subi.w	#8,d2
    	moveq	#0,d5
    	move.b	y_radius(a0),d5
    	subq.b	#3,d5
    This can be changed with:
    Code:
    		subq.w	#$08,d2				; get left position
    		move.w	#-3&$FF,d5			; load Y radius
    		add.b	y_radius(a0),d5			; '' (reduce by -3 for touching)
    Code:
    	move.w	#$10,d4
    This can be changed to a moveq.

    Code:
    	lea	(Object_RAM+$400).w,a1
    	move.w	#$6F,d6
    ; loc_3F5A0:
    Touch_Loop:
    	move.b	collision_flags(a1),d0
    	bne.w	Touch_Height
    ; loc_3F5A8:
    Touch_NextObj:
    	lea	next_object(a1),a1 ; load obj address ; goto next object
    	dbf	d6,Touch_Loop ; repeat 6F more times
    This can be rearranged such that the bne is a beq back to the loop, but... this probably won't benefit you if you have lots of objects with touching collision, this would only improve speed if it's the other way around, but it's something to consider if one is looking for the opposition to your problem, so I thought I'd mention it here.

    Here are a few majors which will require sacrificing of size in favour