Basic Questions and Answers Thread

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

  1. Pacca

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

    Joined:
    Jul 5, 2014
    Messages:
    1,149
    Location:
    Triton (Moon)
    Try removing the spindash rev and see if that fixes the issue. That's all I can think of that might cause this.
     
  2. Painto

    Painto Samodzierżca Najdłuższego Kija Member

    Joined:
    Mar 24, 2014
    Messages:
    315
    Location:
    Poland
    No effect :<.

    Do will porting SFXs from S3&K to S1 fix this by any way? If yes, how to do it?
     
  3. Chaotix

    Chaotix Boredom Incarnate Member

    Joined:
    Aug 21, 2014
    Messages:
    190
    Location:
    Teufort
    It's worth a try, I think there's a guide for it... not sure where but you'll probably find it. :p
     
    Last edited by a moderator: Sep 20, 2014
  4. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    911
    Location:
    the united states. where else?
    Perhaps you could attempt to port the S3K/flamewing driver to your hack? Mind you, there's no guide on S1, but there's a guide for S2 on this very site, which should give you more than a bit to work off of.
     
    Last edited by a moderator: Sep 20, 2014
  5. Ralakimus

    Ralakimus "I want to die alone tonight~" Member

    Joined:
    Aug 26, 2013
    Messages:
    1,002
    Location:
    Assville, Shittucky
    I am writing one right now.
     
  6. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    390
    Location:
    Town Creek, AL
    Try the addressed music tutorial on here. you can add sounds & music without adding them to sound test & may resolve your issue. I have no trouble with mine.
     
  7. Clownacy

    Clownacy Well-Known Member Staff

    Joined:
    Aug 15, 2014
    Messages:
    888
    What fixes?
     
  8. Painto

    Painto Samodzierżca Najdłuższego Kija Member

    Joined:
    Mar 24, 2014
    Messages:
    315
    Location:
    Poland
    These you gave me on Private Message.
     
  9. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    390
    Location:
    Town Creek, AL
    I've added in an extra character. an alternate sonic. Now what i have running is a copy of levsel_chksndtest changed to load character. however in the levsel_chkcharacterchoice (the copy of chksndtest) where do i add the subq.b #1,(character). w. I think I'm doing something wrong cause i tried this & the addq.b #1,(character).w for pushing right and it loads sonic & not Richter unless i change subq to clr & addq to move to have this work with no 3rd character. also how do i add digits below sound test's digits?
     
  10. Pacca

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

    Joined:
    Jul 5, 2014
    Messages:
    1,149
    Location:
    Triton (Moon)
    There's a guide on sonic retro to extend the sound test. Not sure about the first problem, it might be best to show the code, it's rather confusing when it needs to be explained.
     
  11. SuperEgg

    SuperEgg I'm a guy that knows that you know that I know Member

    Joined:
    Oct 17, 2009
    Messages:
    Location:
    THE BEST GOD DAMN STATE OF TEXAS
    It's the PSG frequencies. If you've went off and added in S3k's PSG FREQUENCIES, not tones, the jump, skid, and I think splash sfx goes down I tone. There's two ways to fix it.


    Add $12 to the PSG key in the sfx, or just plop in the S3k equivs. No real difference besides that one fix actually.
     
  12. Ralakimus

    Ralakimus "I want to die alone tonight~" Member

    Joined:
    Aug 26, 2013
    Messages:
    1,002
    Location:
    Assville, Shittucky
    I am done with it. I might still be improving upon it. You can PM me if you need to. Enjoy.

    Note as of now, you'll need to switch to AS, but the first step shows how to switch to AS. If I can figure it out, I'll replace the step with building the driver externally and have it incbin'd.
     
  13. JoenickROS

    JoenickROS ROS is on hiatus. (...again) Member

    Joined:
    Feb 5, 2012
    Messages:
    924
    Ok I have not asked a question in a while, but I'm wondering if its possible from keeping a higher subtyped star post, that was touched, from marking the lower subtypes as touched also? I need to figure this out so I can adapt it into my time posts code.
     
    Last edited by a moderator: Sep 21, 2014
  14. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,775
    Location:
    italy
    Premise: I'm not on my computer right now so I can't check if it works, but this sounds like a simple question, actually. The number of the lamp post is stored in $FFFFFE30, and the code at "Obj79_Main" is what you should look at. My guess is that removing all the code between "move.b ($FFFFFE30).w,d1" (included) and "Obj79_BlueLamp:" (not included) will cause all lamp posts to be blue, since the comparison between the value stored in $FFFFFE30 (now copied to d1) and the lamp post you hit (now copied to d2) will never happen.


    But again, this is only a guess. And it's likely to break the behaviour of the lamp post you hit, but I can't come up with more answers right now.
     
  15. Painto

    Painto Samodzierżca Najdłuższego Kija Member

    Joined:
    Mar 24, 2014
    Messages:
    315
    Location:
    Poland
    Maybe I'll sound now like an idiot but, where I can find the "PSG key in SFX"?
     
  16. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,775
    Location:
    italy
    It's in the header, and you should add 12 decimal (which means 12 semitones, or one octave), or $C, not $12. Unless they suddenly changed the format and SuperEgg knows something I don't, in which case please ignore me.
     
    Last edited by a moderator: Sep 21, 2014
  17. SuperEgg

    SuperEgg I'm a guy that knows that you know that I know Member

    Joined:
    Oct 17, 2009
    Messages:
    Location:
    THE BEST GOD DAMN STATE OF TEXAS
    Silly me. Seems I can't hex math. Thanks Nineko
     
  18. Pacca

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

    Joined:
    Jul 5, 2014
    Messages:
    1,149
    Location:
    Triton (Moon)
    How do you prevent the giant ring object from sending you to the special stage? I'm re-purposing it, so naturally, I don't want its original intended function to get in the way.
     
  19. Shockwave

    Shockwave 3 Time Stones Member

    Joined:
    Dec 18, 2013
    Messages:
    121
    Location:
    LA, CA
    The routine that sends Sonic to the special stage is actually controlled by the end of level object, so you need to look under Obj3A. Specifically, look for Obj3A_ChkSS:



    Obj3A_ChkSS: ; XREF: Obj3A_NextLevel
    clr.b ($FFFFFE30).w ; clear lamppost counter
    tst.b ($FFFFF7CD).w ; has Sonic jumped into a giant ring?
    beq.s loc_C6EA ; if not, branch
    move.b #$10,($FFFFF600).w ; set game mode to Special Stage (10)
    bra.s Obj3A_Display2


    Just remove the last 4 lines and you should be good.
     
    Last edited by a moderator: Sep 22, 2014
  20. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    390
    Location:
    Town Creek, AL
    I've already stated I'm trying to rebuild the Levelselect code, so that selection 1 changes level, 2 changes act, 3 plays level when A,B,C, or start is pressed. when trying to code it, I've noticed some errors. Going to sound test & turbo C (constantly listening to the first beat of any music or sound, watch the video to see what happens.

    also sometimes i'm unable to choose a level & instead plays a weird sound. when I turbo C on first option, it constantly plays this sound & it takes a while for it to play GHZ1. All other choices when this is happening plays a Glitched GHZ1, but it's a different "act" (example GHZFinal or GHZ scrambled graphics) I don't know what I did that caused this. here's the code to LevelSelect & levsel_Controls


    LevelSelect:
    move.b #4,($FFFFF62A).w
    bsr.w DelayProgram
    bsr.w LevSelControls
    bsr.w RunPLC_RAM
    tst.l ($FFFFF680).w
    bne.s LevelSelect
    andi.b #$F0,($FFFFF605).w ; is A, B, C, or Start pressed?
    beq.s LevelSelect ; if not, branch


    move.w ($FFFFFF82).w,d0
    cmpi.w #$14,d0 ; have you selected item $14 (sound test)?
    bne.w LevSel_Level_SS;LevSelLevSel_Level_SS ; if not, go to Level/SS subroutine
    move.w ($FFFFFF84).w,d0
    addi.w #$80,d0


    LevSel_NoCheat:
    cmpi.w #$9F,d0 ; is sound $80-$94 being played?
    bcs.s LevSel_PlaySnd ; if yes, branch
    cmpi.w #$A0,d0 ; is sound $95-$A0 being played?
    bcs.w LevelSelect ; if yes, branch

    LevSel_PlaySnd:
    cmpi.b #$A0,d0
    blt LevSel_NoSFX
    subi.b #$A0,d0
    andi.w #$007F,d0 ; MJ: keep in range
    add.w d0,d0 ; MJ: multiply by 4
    add.w d0,d0 ; MJ: ''
    jsr sndtst ; MJ: load correct address
    psls: bsr.w PlaySound ; MJ: play sound
    bra.w LevelSelect ; MJ: continue

    LevSel_NoSFX: subi.b #$80,d0 ; MJ: minus 80
    beq LevelSelect ; MJ: if null, branch
    subq.b #$01,d0 ; MJ: Minus 1
    andi.w #$001F,d0 ; MJ: keep in range
    add.w d0,d0 ; MJ: multiply by 4
    add.w d0,d0
    ; MJ: ''
    jsr mustst
    Mus_GoBack: bsr.w PlayMusic ; MJ: play music
    bra.w LevelSelect ; MJ: continue


    mustst: cmpi.b #1,(PlayListEntry).w
    beq PlayList2
    move.l SndTst_Musics(pc,d0.w),d0
    bra Mus_Goback
    Playlist2: jsr TheMusicDoes

    sndtst: jsr soundplayer
    ;lea (SndTst_Sounds),a1
    ;move.l (a1,d0.w),d0
    brapsls: bra psls
    ; ===========================================================================
    ; ---------------------------------------------------------------------------
    ; Music list for sound test
    ; ---------------------------------------------------------------------------

    include 'SoundTest.asm'

    ; ===========================================================================

    LevSel_Ending: ; XREF: LevelSelect
    move.b #$18,($FFFFF600).w ; set screen mode to $18 (Ending)
    move.w #$600,($FFFFFE10).w ; set level to 0600 (Ending)
    rts
    ; ===========================================================================

    LevSel_Credits: ; XREF: LevelSelect
    move.b #$1C,($FFFFF600).w ; set screen mode to $1C (Credits)
    move.l #Music91,d0 ; MJ: Sound
    bsr.w PlayMusic ; MJ: play credits music
    move.w #0,($FFFFFFF4).w
    rts
    ; ===========================================================================

    LevSel_Level_SS:

    add.w d0,d0
    move.w LSelectPointers(pc,d0.w),d0 ; load level number
    bmi.w LevelSelect
    cmpi.w #$700,d0 ; check if level is 0700 (Special Stage)
    bne.s LevSel_Level ; if not, branch
    move.b #$10,($FFFFF600).w ; set screen mode to $10 (Special Stage)
    clr.w ($FFFFFE10).w ; clear level
    move.b #3,($FFFFFE12).w ; set lives to 3
    moveq #0,d0
    move.w d0,($FFFFFE20).w ; clear rings
    move.l d0,($FFFFFE22).w ; clear time
    move.l d0,($FFFFFE26).w ; clear score
    rts
    ; ===========================================================================

    LevSel_Level: ; XREF: LevSel_Level_SS
    andi.w #$3FFF,d0
    move.w d0,($FFFFFE10).w ; set level number
    ;RTS
    PlayLevel: ; XREF: ROM:00003246j ...
    move.b #$C,($FFFFF600).w ; set screen mode to $0C (level)
    move.b #3,($FFFFFE12).w ; set lives to 3
    moveq #0,d0
    move.w d0,($FFFFFE20).w ; clear rings
    move.l d0,($FFFFFE22).w ; clear time
    move.l d0,($FFFFFE26).w ; clear score
    move.b d0,($FFFFFE16).w ; clear special stage number
    move.b d0,($FFFFFE57).w ; clear emeralds
    move.l d0,($FFFFFE58).w ; clear emeralds
    move.l d0,($FFFFFE5C).w ; clear emeralds
    move.b d0,($FFFFFE18).w ; clear continues
    clr.b (Final).w
    move.l #Sound_E0,d0 ; MJ: Sound
    bsr.w PlayControl ; MJ: fade out music
    rts
    Code:
    ; ---------------------------------------------------------------------------
    ; Subroutine to	change what you're selecting in the level select
    ; ---------------------------------------------------------------------------
    ;	
    ; ||||||||||||||| S U B	R O U T	I N E |||||||||||||||||||||||||||||||||||||||
    
    
    LevSelControls:					; XREF: LevelSelect
    		move.b	(v_jpadpress1).w,d1
    		andi.b	#btnUp+btnDn,d1		; is up/down pressed and held?
    		bne.s	LevSel_UpDown		; if yes, branch
    		subq.w	#1,(v_levseldelay).w	; subtract 1 from time to next move
    		bpl.w	LevSel_CHKsNDTEST	; if time remains, branch
    
    LevSel_UpDown:
    		move.w	#$B,(v_levseldelay).w	; reset time delay
    		move.b	(v_jpadhold1).w,d1
    		andi.b	#btnUp+btnDn,d1		; is up/down pressed?
    		beq.w	LevSel_ChkSndTest	; if not, branch
    		move.w	(v_levselitem).w,d0
    		btst	#bitUp,d1		; is up	pressed?
    		beq.s	LevSel_Down		; if not, branch
    		subq.w	#1,d0			; move up 1 selection
    		bhs.s	LevSel_Down
    		moveq	#$16,d0			; if selection moves below 0, jump to selection	$15
    
    LevSel_Down:
    		btst	#bitDn,d1		; is down pressed?
    		beq.s	LevSel_Refresh		; if not, branch
    		addq.w	#1,d0			; move down 1 selection
    		cmpi.w	#$17,d0
    		blo.s	LevSel_Refresh
    		moveq	#0,d0			; if selection moves above $15,	jump to	selection 0
    
    LevSel_Refresh:
    		move.w	d0,(v_levselitem).w ; set new selection
    		bsr.w	LevSelTextLoad	; refresh text
    		rts
    ; ===========================================================================
    
    LevSel_ChkSndTest:				; XREF: LevSelControls
    		cmpi.w	#$14,(v_levselitem).w	; is item $14 selected?
    		bne.s	LevSel_ChkCharacterChoice	; if not, branch
    		move.b	(v_jpadpress1).w,d1
    		andi.b	#btnR+btnL,d1		; is left/right	pressed?
    		beq.s	LevSel_NoMove		; if not, branch
    		move.w	(v_levselsound).w,d0
    		btst	#bitL,d1		; is left pressed?
    		beq.s	LevSel_Right		; if not, branch
    		subq.w	#1,d0			; subtract 1 from sound	test
    		bhs.s	LevSel_Right
    		moveq	#$4F,d0			; if sound test	moves below 0, set to $4F
    
    LevSel_Right:
    		btst	#bitR,d1		; is right pressed?
    		beq.s	LevSel_Refresh2		; if not, branch
    		addq.w	#1,d0			; add 1	to sound test
    		cmpi.w	#$4F,d0
    		blo.s	LevSel_Refresh2
    		moveq	#0,d0			; if sound test	moves above $4F, set to	0
    
    LevSel_Refresh2:
    		move.w	d0,(v_levselsound).w	; set sound test number
    		bsr.w	LevSelTextLoad		; refresh text
    
    LevSel_NoMove:
    		rts
    ; ===========================================================================
    
    LevSel_ChkCharacterChoice:			; XREF: LevSelControls
    		cmpi.w	#$15,(v_levselitem).w	; is item $15 selected?
    		bne.s	LevSel_Tracks 	; if not, branch
    		move.b	(v_jpadpress1).w,d1
    		andi.b	#btnR+btnL,d1		; is left/right	pressed?
    		beq.s	LevSel_NoMove_CHR	; if not, branch
    		move.w	(v_levselsound).w,d0
    		btst	#bitL,d1		; is left pressed?
    		beq.s	LevSel_Right_CHR	; if not, branch
    		SUBQ.W	#1,D0
    		clr.b	(Character).w			; subtract 1 from Character choice
    		bhs.s	LevSel_Right_CHR
    		moveq	#$00,d0
    		
    LevSel_Right_CHR:
    		btst	#bitR,d1		; is right pressed?
    		beq.s	LevSel_Refresh2_CHR	; if not, branch
    		ADDQ.W	#1,D0
    		move.b	#1,(Character).w					; add 1	to Character choice
    		cmpi.w	#$02,d0
    		blo.s	LevSel_Refresh2_CHR
    		moveq	#3,d0			; if gimmick choice moves above $10, set to 0
    		
    LevSel_Refresh2_CHR:
    		move.w	d0,($FFFFFF86).w	; set gimmick choice number
    		bsr.w	LevSelTextLoad		; refresh text
    
    LevSel_NoMove_CHR:
    		rts
    ; End of function LevSelControls
    
    Levsel_Tracks:	cmpi.w	#$16,(v_levselitem).w	; is item $15 selected?
    		bne.s	LevSel_gOlEVEL	; if not, branch
    		move.b	(v_jpadpress1).w,d1
    		andi.b	#btnR+btnL,d1		; is left/right	pressed?
    		beq.s	LevSel_NoMove_TCK	; if not, branch
    		move.w	(v_levselsound).w,d0
    		btst	#bitL,d1		; is left pressed?
    		beq.s	LevSel_Right_TCK	; if not, branch
    		SUBQ.W	#1,D0
    		clr.b	(PlaylistEntry).w			; subtract 1 from Character choice
    		bhs.s	LevSel_Right_TCK
    		moveq	#$02,d0			; if Character choice moves below 0, set to $4F
    
    LevSel_Right_TCK:
    		btst	#bitR,d1		; is right pressed?
    		beq.s	LevSel_Refresh2_TCK	; if not, branch
    		ADDQ.W	#1,D0
    		Move.b	#1,(PlaylistEntry).w					; add 1	to Character choice
    		cmpi.w	#$02,d0
    		blo.s	LevSel_Refresh2_TCK
    		moveq	#0,d0			; if gimmick choice moves above $10, set to 0
    
    LevSel_Refresh2_TCK:
    		move.w	d0,($FFFFFF88).w	; set gimmick choice number
    		bsr.w	LevSelTextLoad		; refresh text
    
    LevSel_NoMove_TCK:
    		rts
    Levsel_GoLevel:	tst.b	(v_levselitem).w	;Is this the first choice?
    		bne.s	LevSel_ChkAct 	; if not, branch
    		move.b	(v_jpadpress1).w,d1
    		andi.b	#btnR+btnL,d1		; is left/right	pressed?
    		beq.s	LevSel_NoMove_Level	; if not, branch
    		move.w	(v_levselsound).w,d0
    		btst	#bitL,d1		; is left pressed?
    		beq.s	LevSel_Right_Level	; if not, branch
    		SUBQ.W	#1,D0
    		clr.b	(Stage).w			; subtract 1 from Character choice
    		bhs.s	LevSel_Right_Level
    		moveq	#$07,d0			; if Level choice moves below 0, set to $4F
    
    LevSel_Right_Level:
    		btst	#bitR,d1		; is right pressed?
    		beq.s	LevSel_Refresh2_Level	; if not, branch
    		ADDQ.W	#1,D0
    		addq.b	#1,(Level).w					; add 1	to Character choice
    		cmpi.w	#$02,d0
    		blo.s	LevSel_Refresh2_Level
    		moveq	#0,d0			; if gimmick choice moves above $10, set to 0
    
    LevSel_Refresh2_Level:
    		move.w	d0,(Stage).w	; set gimmick choice number
    		bsr.w	LevSelTextLoad		; refresh text
    
    LevSel_NoMove_Level:
    		rts
    LevSel_ChkAct:			; XREF: LevSelControls
    		cmpi.w	#$01,(v_levselitem).w	; is item $15 selected?
    		bne.s	LevSel_PlayGivenLevel	; if not, branch
    		move.b	(v_jpadpress1).w,d1
    		andi.b	#btnR+btnL,d1		; is left/right	pressed?
    		beq.s	LevSel_NoMove_Act	; if not, branch
    		move.w	(v_levselsound).w,d0
    		btst	#bitL,d1		; is left pressed?
    		beq.s	LevSel_Right_Act	; if not, branch
    		SUBQ.W	#1,D0
    		clr.b	(Act).w			; subtract 1 from Character choice
    		bhs.s	LevSel_Right_Act
    		moveq	#$04,d0			; if Character choice moves below 0, set to $4F
    
    LevSel_Right_Act:
    		btst	#bitR,d1		; is right pressed?
    		beq.s	LevSel_Refresh2_Act	; if not, branch
    		ADDQ.W	#1,D0
    		Move.b	#1,(Act).w					; add 1	to Character choice
    		cmpi.w	#$04,d0
    		blo.s	LevSel_Refresh2_Act
    		moveq	#0,d0			; if gimmick choice moves above $10, set to 0
    
    LevSel_Refresh2_Act:
    		move.w	d0,($FFFFFF86).w	; set gimmick choice number
    		bsr.w	LevSelTextLoad		; refresh text
    
    LevSel_NoMove_Act:
    		rts
    LevSel_PlayGivenLevel:			; XREF: LevSelControls
    		cmpi.w	#$02,(v_levselitem).w	; is item $15 selected?
    		bne.s	LevSel_NoMove_PlayLevel 	; if not, branch
    		move.b	(v_jpadpress1).w,d1
    		andi.b	#Start,d1		; is left/right	pressed?
    		beq.s	LevSel_NoMove_PlayLevel	; if not, branch
    		jsr	PlayLevel
    LevSel_NoMove_PlayLevel:	rts
    ; End of function LevSelControls
    ; ---------------------------------------------------------------------------
    ; Subroutine to load level select text
    ; ---------------------------------------------------------------------------
    
    ; ||||||||||||||| S U B	R O U T	I N E |||||||||||||||||||||||||||||||||||||||
    
    
    LevSelTextLoad:				; XREF: GM_Title
    
    	textpos:	= ($40000000+(($E210&$3FFF)<<16)+(($E210&$C000)>>14))
    					; $E210 is a VRAM address
    
    		lea	(LevelMenuText).l,a1
    		lea	(vdp_data_port).l,a6
    		move.l	#textpos,d4	; text position on screen
    		move.w	#$E680,d3	; VRAM setting (4th palette, $680th tile)
    		moveq	#$15,d1		; number of lines of text
    
    	LevSel_DrawAll:
    		move.l	d4,4(a6)
    		bsr.w	LevSel_ChgLine	; draw line of text
    		addi.l	#$800000,d4	; jump to next line
    		dbf	d1,LevSel_DrawAll
    
    		moveq	#0,d0
    		move.w	(v_levselitem).w,d0
    		move.w	d0,d1
    		move.l	#textpos,d4
    		lsl.w	#7,d0
    		swap	d0
    		add.l	d0,d4
    		lea	(LevelMenuText).l,a1
    		lsl.w	#3,d1
    		move.w	d1,d0
    		add.w	d1,d1
    		add.w	d0,d1
    		adda.w	d1,a1
    		move.w	#$C680,d3	; VRAM setting (3rd palette, $680th tile)
    		move.l	d4,4(a6)
    		bsr.w	LevSel_ChgLine	; recolour selected line
    		move.w	#$E680,d3
    		cmpi.w	#$16,(v_levselitem).w
    		beq.w	LevSel_ChkSndTest3
    		bsr.w	LevSel_DrawCHR
    		bsr.w	LevSel_DrawPCM
    LevSel_ChkSndTest3:
    		cmpi.w	#$15,(v_levselitem).w
    		bne.s	LevSel_chksndtest2
    		move.w	#$B680,d3
    
    LevSel_ChkSndTest2:
    		cmpi.w	#$14,(v_levselitem).w
    		bne.s	LevSel_DrawSnd
    		move.w	#$C680,d3
    
    LevSel_DrawSnd:
    		move.l	#$6C300003,($C00004).l ; screen	position (sound	test)
    		move.w	(v_levselsound).w,d0
    		addi.w	#$80,d0
    		move.b	d0,d2
    		lsr.b	#4,d0
    		bsr.w	LevSel_ChgSnd	; draw 1st digit
    		move.b	d2,d0
    		bsr.w	LevSel_ChgSnd	; draw 2nd digit
    		rts
    
    LevSel_DrawCHR:	move.l #$6C300013,($C00004).l ; screen position (sound test
    		;move.l	#$6C30EC30,($C00004).l ; screen	position (sound	test)
    		move.w	($FFFFFF84).w,d0
    		addi.w	#$80,d0
    		move.b	d0,d2
    		lsr.b	#4,d0
    		bsr.w	LevSel_ChgChr	; draw 1st digit
    		move.b	d2,d0
    		bsr.w	LevSel_Chgchr	; draw 2nd digit
    		rts
    LevSel_DrawPCM:	move.l #$6C300023,($C00004).l ; screen position (sound test
    		;move.l	#$6C30EC30,($C00004).l ; screen	position (sound	test)
    		addi.w	#$80,d0
    		move.w	($FFFFFF86).w,d0
    		move.b	d0,d2
    		lsr.b	#4,d0
    		bsr.w	LevSel_Chgpcm	; draw 1st digit
    		move.b	d2,d0
    		bsr.w	LevSel_Chgpcm	; draw 2nd digit
    		rts
    ; End of function LevSelTextLoad
    
    
    ; ||||||||||||||| S U B	R O U T	I N E |||||||||||||||||||||||||||||||||||||||
    
    
    LevSel_ChgSnd:				; XREF: LevSelTextLoad
    		andi.w	#$F,d0
    		cmpi.b	#$A,d0		; is digit $A-$F?
    		blo.s	LevSel_Numb_Snd	; if not, branch
    		addi.b	#4,d0		; use alpha characters
    
    	LevSel_Numb_Snd:
    		add.w	d3,d0
    		move.w	d0,(a6)
    		rts
    ; End of function LevSel_ChgSnd
    LevSel_ChgChr:				; XREF: LevSelTextLoad
    		andi.w	#$F,d0
    		cmpi.b	#$A,d0		; is digit $A-$F?
    		blo.s	LevSel_Numb_Chr	; if not, branch
    		addi.b	#4,d0		; use alpha characters
    
    	LevSel_Numb_Chr:
    		add.w	d3,d0
    		move.w	d0,(a6)
    		rts
    LevSel_Chgpcm:				; XREF: LevSelTextLoad
    		andi.w	#$F,d0
    		cmpi.b	#$A,d0		; is digit $A-$F?
    		blo.s	LevSel_Numb_pcm	; if not, branch
    		addi.b	#4,d0		; use alpha characters
    
    	LevSel_Numb_pcm:
    		add.w	d3,d0
    		move.w	d0,(a6)
    		rts
    ; End of function LevSel_ChgSnd
    ; End of function LevSel_ChgSnd
    
    ; ||||||||||||||| S U B	R O U T	I N E |||||||||||||||||||||||||||||||||||||||
    
    
    LevSel_ChgLine:				; XREF: LevSelTextLoad
    		moveq	#$17,d2		; number of characters per line
    
    	LevSel_LineLoop:
    		moveq	#0,d0
    		move.b	(a1)+,d0	; get character
    		bpl.s	LevSel_CharOk	; branch if valid
    		move.w	#0,(a6)		; use blank character
    		dbf	d2,LevSel_LineLoop
    		rts
    
    
    	LevSel_CharOk:
    		cmp.w	#$40,d0		; Check for $40 (End of ASCII number area)
    		blt.s	@notText	; If this is not an ASCII text character, branch
    		sub.w	#$3,d0		; Subtract an extra 3 (Compensate for missing characters in the font)
    	@notText:
    		sub.w	#$30,d0		; Subtract #$33 (Convert to S2 font from ASCII)
    		add.w	d3,d0		; combine char with VRAM setting
    		move.w	d0,(a6)		; send to VRAM
    		dbf	d2,LevSel_LineLoop
    		rts
    ; End of function LevSel_ChgLine
    
    ; ===========================================================================
    ; ---------------------------------------------------------------------------
    ; Level	select menu text
    ; ---------------------------------------------------------------------------
    LevelMenuText:   ; if Revision=0
            dc.b    "LEVEL                   "
            dc.b    "ACT                       "
            dc.b    "PLAY                 "
            dc.b    "LABYRINTH ZONE   ACT   1"
            dc.b    "LABYRINTH ZONE   ACT   2"
            dc.b    "LABYRINTH ZONE   ACT   3"
            dc.b    "MARBLE ZONE      ACT   1"
            dc.b    "MARBLE ZONE      ACT   2"
            dc.b    "MARBLE ZONE      ACT   3"
            dc.b    "STAR LIGHT ZONE  ACT   1"
            dc.b    "STAR LIGHT ZONE  ACT   2"
            dc.b    "STAR LIGHT ZONE  ACT   3"
            dc.b    "SPRING YARD ZONE ACT   1"
            dc.b    "SPRING YARD ZONE ACT   2"
            dc.b    "SPRING YARD ZONE ACT   3"
            dc.b    "SCRAP BRAIN ZONE ACT   1"
            dc.b    "SCRAP BRAIN ZONE ACT   2"
            dc.b    "SCRAP BRAIN ZONE ACT   3"
            dc.b    "FINAL ZONE              "
            dc.b    "SPECIAL STAGE           "
            dc.b    "SOUND TEST              "
            dc.b    "CHARACTER               "
            dc.b	"PLAYLIST                                                              "
    	even
    
            dc.b    "GREEN HILL ZONE  STAGE 1"
            dc.b    "                 STAGE 2"
            dc.b    "                 STAGE 3"
            dc.b    "LABYRINTH        STAGE 1"
            dc.b    "                 STAGE 2"
            dc.b    "                 STAGE 3"
            dc.b    "MARBLE ZONE      STAGE 1"
            dc.b    "                 STAGE 2"
            dc.b    "                 STAGE 3"
            dc.b    "STAR LIGHT ZONE  STAGE 1"
            dc.b    "                 STAGE 2"
            dc.b    "                 STAGE 3"
            dc.b    "SPRING YARD ZONE STAGE 1"
            dc.b    "                 STAGE 2"
            dc.b    "                 STAGE 3"
            dc.b    "SCRAP BRAIN ZONE STAGE 1"
            dc.b    "                 STAGE 2"
            dc.b    "                 STAGE 3"
            dc.b    "FINAL ZONE              "
            dc.b    "SPECIAL STAGE           "
            dc.b    "SOUND TEST              "
          	dc.b    "CHARACTER               "
            dc.b	"SONIC			 "
    	dc.b	"RICHTER		 "
    	
    	even
    
    
    as you can see i've tried coding in a Character Select below sound test, no digits & tried everything to have them appear, also need 1 byte added to (character).w which is $FFFFFFFE untill 2 is reached, then back to 0 when right is pushed, 1 byte subtracted when left is pressed & tried the addq.b & subq.b & nothing, always loads sonic but move.b #1 goes richter, Clr.b is sonic. this works only for 2 characters, not 3. Also have a playlist option & it's fine, somewhat. Only appears when after selected, no digits, stays yellow after selected when another option is selected.
    EDIT: CONFIRMED. No tiles higher than $FFF allowed in Sonic 1 & SonMapEd.
     
    Last edited by a moderator: Sep 24, 2014