Basic Questions and Answers Thread

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

  1. MarkeyJester

    MarkeyJester ! % # @ Member

    Joined:
    Jun 27, 2009
    Messages:
    2,755
    The sprite mappings for the HUD will need modifying, both the text and the numbers of the HUD have their art setup specifically for the sprite's rendering. Every HUD sprite will be given a shape that has a tile height usually of 2 (not sure why they didn't use 4 for the top but there you go), and the width is variable depending on the text/numbers. Usually these will be 4 width to make the most of a single sprite. Sprites render vertically first then horizontally afterwards, so every text/number is rendered top tile first, then second tile after, followed by the next digit/character's top tile, then bottom tile.

    To change the HUD such that it is 1 tile height, the shape of every sprite needs to be altered. Usually these sprites are D (for 2 height and 4 width, reducing this by 1 will reduce the height to 1, though, this will ruin the order of the tiles). However, I believe judging by your post, you've already modified the number rendering routine such that it already renders 1 tile at a time (and in order), so the sprite rearrangement should fall in-line with your modification.

    The VRAM addresses of the sprites will also need adjustments, the problem is, since we don't know the order of the text/number font/tiles in VRAM for your HUD, it's impossible to give you the exact shapes/pattern index. Another thing is, we don't know which game you are modifying, so it's difficult to give methods of modifications required.

    I will move onto the art rendering in Sonic 1 as an example:

    Code:
    loc_1C8FE:
    		tst.w	d4
    		beq.s	loc_1C92C
    		lsl.w	#6,d2		; <- Change to 5 (shift 6 is x40 (2 tiles), shift 5 is x20 (1 tile))
    		move.l	d0,4(a6)
    		lea	(a1,d2.w),a3
    		move.l	(a3)+,(a6)
    		move.l	(a3)+,(a6)
    		move.l	(a3)+,(a6)
    		move.l	(a3)+,(a6)
    		move.l	(a3)+,(a6)
    		move.l	(a3)+,(a6)
    		move.l	(a3)+,(a6)
    		move.l	(a3)+,(a6)
    		move.l	(a3)+,(a6)		; <- Remove these 8 lines, this is the second tile.
    		move.l	(a3)+,(a6)		; <- Remove
    		move.l	(a3)+,(a6)		; <- Remove
    		move.l	(a3)+,(a6)		; <- Remove
    		move.l	(a3)+,(a6)		; <- Remove
    		move.l	(a3)+,(a6)		; <- Remove
    		move.l	(a3)+,(a6)		; <- Remove
    		move.l	(a3)+,(a6)		; <- Remove
    
    loc_1C92C:
    		addi.l	#$200000,d0		; <- VRAM advancement to 20 bytes rather than 40
    		dbf	d6,Hud_ScoreLoop
    
    		rts	 
    Keep in mind the uncompressed number tile art will need to be digits 0 to 9 in order, one tile each.
     
    Last edited: Aug 14, 2019
    AsuharaMoon and ProjectFM like this.
  2. AsuharaMoon

    AsuharaMoon kakyoin did you lay this egg Member

    Joined:
    Aug 15, 2013
    Messages:
    55
    Great! It worked out fine enough, but there's still one last thing:

    [​IMG]

    Hud_LoadZero / Hud_Base seems to work a bit different that the others (I guess?), so.. yeah. I don't know where to begin with this.
     
  3. MarkeyJester

    MarkeyJester ! % # @ Member

    Joined:
    Jun 27, 2009
    Messages:
    2,755
    There is:

    Code:
    		move.w	#$F,d1
    Change the F to 7.
     
    AsuharaMoon likes this.
  4. Giovanni

    Giovanni sometimes comes out of his cave Member

    Joined:
    Apr 16, 2015
    Messages:
    114
    Location:
    Vercelli, Italy
    How do I make Sonic 1's Level Select start from a selection different from 0?
     
  5. MarkeyJester

    MarkeyJester ! % # @ Member

    Joined:
    Jun 27, 2009
    Messages:
    2,755
    Right above "MainGameLoop:" you will see:

    Code:
    		move.b	#0,($FFFFF600).w ; set Game Mode to Sega Screen
    Put this in just below it (but above MainGameLoop):

    Code:
    		move.w	#4,($FFFFFF82).w	; set level select Y position
     
    nineko and Giovanni like this.
  6. Pacca

    Pacca Why succeed when you can profit off of failure? Member

    Joined:
    Jul 5, 2014
    Messages:
    1,149
    Location:
    Triton (Moon)
    Does anyone know how to create images with built in palettes for use in importing into sonlvl? It has the feature to use an images built in, preexisting color order to assign colors to it (I often end up having to change the image format to work around this even), but I've no idea how to look at these built in palettes at all, let alone rearrange them. I vaguely recall that there's programs out there that lets you modify them, but I can't seem to search for them properly; I just get a bunch of silly tools to help artists find colors they like.
     
  7. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,767
    Location:
    italy
    Older versions of Paint Shop Pro (such as 5, which is easy to... make it work for more than 30 days) allow you to see and alter the palette of indexed images. I'd post a screenshot but I won't be at home until tomorrow.

    Besides, I'm sure someone else will recommend some more modern alternative soon. It's just that, unsurprisingly, I like to work with older software.
     
    Pacca likes this.
  8. Pacca

    Pacca Why succeed when you can profit off of failure? Member

    Joined:
    Jul 5, 2014
    Messages:
    1,149
    Location:
    Triton (Moon)
    Your suggestion jogged my memory and ended up leading me to search for indexed images! I found gimp does exactly what I need, if your looking for a similar solution!