How exactly did you go about fixing the demo exactly? Did you simply lock the controls, or did you use another method? Also, thank you Markey, I figured it was something that simple. =/
To do it, I used this HowTo: Guide. Again, I used the newest Retro disassembly and used the SVN disassembly method. I'm not exactly sure what it does. But from what I read it changed the value being read from $FFF604 to 602. I am starting to think it doesn't have to do with the button presses... as I retried the demo and it did this again with NO button press. It only happens on the demo with the first Crabmeat badnik. It doesn't happen in the Marble or Spring Yard demos... nor does it happen in normal gameplay. (Although normal gameplay has been modded to include an extra life per 50,000 pts.)
Strange, I grabbed a fresh copy of the HG version, and I did not run across that issue. It most likely has to do with the edit you did to the 1-up bonus for 50,000 points.
Perhaps. I'll take another look at what I did to that section and get back to ya. All I did to it was remove the part of code where it checks the revision, and then checks the region... so that it would just occur normally. I have it working in game with 0 problems... but for some reason THAT ONE Crabmeat in GHZ demo only is doing this... Perhaps if it goes to Demo mode instead of game mode... something hasn't been cleared or set up correctly???
I have a question reguarding the object I am working on, the Dash Rings from the modern games. You know, these things?. I've run into a slight issue I cannot seem to fix. If you simply jump into them, they work fine. However if I jumpdash into one, Sonic goes shooting off at some ridiculously insane speed. What would be a simply and effective way to clear Sonic's previous speed, and still have him shoot off as desired? Edit: here is the code that I am currently using to "shoot Sonic" Code (Text): lea (MainCharacter).w,a1 ; a1=character move.b #2,$24(a0) ; increase the routine counter bclr #0,status(a1) ; turn him right move.w #$A00,x_vel(a1) ; move Sonic forward (X axis) btst #1,subtype(a0) ; is the subtype 1? beq.s + ; if it is, skip move speed and turn delay timer move.b #-$2,y_vel(a1) ; sends Sonic up a bit bra ++ + move.b #-$47,y_vel(a1)
I think that you should be using 'move.w' instead of 'move.b' both times you set y_vel; unless you really want Sonic to shoot off at an insanely high speed upwards (that $47 there means that Sonic will shoot up at just under 11 times the speed of a normal jump) when bit 1 of subtype is set, in which case it is right. The code of the dash ring seems fine; the problem might actually be in the way that the jump dash code interacts with this. If there is a flag that causes the jump dash, you may want to clear it on the dash ring code and see what happens.
Edit: Ok, your suggestion seems to work well. However, the line move.b #-$47,y_vel(a1) no longer shoots Sonic off at the desired 47 degree angle I originally intended. The jump dash speed still interacts with the dash ring speed, but to a much lower extent. Clearing the jump dash flag did not help. =/
Unless you rewrote the moving functions (or disabled them while the dash ring controls Sonic), there is no way that 'move.b #-$47,y_vel(a1)' causes Sonic to go off at a 47 degree angle unless you had a corresponding 'move.b #$42,x_vel(a1)' line. A 47-degree angle is very close to a 45-degree angle; at a 45-degree angle, x_vel and y_vel need to be equal in magnitude. The discrepancy in the values you were setting give you an angle of about 82 degrees. You may be having an issue with the jump flag, which adds a vertical speed limit upwards (unless you are holding a jump button); try also clearing the jumping flag ('clr.b jumping(a1)' in S2 disassemblies).
I had to clear both the jumping flag and the walljump flag. Thank you for your assistance, flamewing. Edit: Ok, new issue. I can get subtype 0 and 1 to work just fine, but subtype 2 does not seem to be affected if I try to set it to do something different. =/
I've read through the working with objects guide, and I've gotten quite confused. Where on earth would I start with creating a new object by scratch in Sonic 1 (2005 Hivebrain)? And are there are free VRAM locations for something about the size as one signpost sprite? Not sure how much VRAM the "points from enemies" takes and I used some of that to extend Sonic's anyway.
Thinking about this I feel I wasn't exactly very clear with what I said. All I need the object to do is simply show up, it doesn't need to do anything. Simply be placeable and be visible, nothing special. Why I can't even figure that out is beyond me.
Open the file "_inc\Object pointers.asm" Code (Text): ; --------------------------------------------------------------------------- ; Object pointers ; --------------------------------------------------------------------------- dc.l Obj01, ObjectFall, ObjectFall, ObjectFall dc.l ObjectFall, ObjectFall, ObjectFall, Obj08 dc.l Obj09, Obj0A, Obj0B, Obj0C ... Change the "ObjectFall" that is on the left side of "Obj08" to "Obj07" like so: Code (Text): ; --------------------------------------------------------------------------- ; Object pointers ; --------------------------------------------------------------------------- dc.l Obj01, ObjectFall, ObjectFall, ObjectFall dc.l ObjectFall, ObjectFall, Obj07, Obj08 dc.l Obj09, Obj0A, Obj0B, Obj0C ... The "ObjectFall" slots are unused object slots, we have opened up slot 07 for usage, some code: Code (Text): ; =========================================================================== ; --------------------------------------------------------------------------- ; Object 07 - Simple Displaying/Animating Object ; --------------------------------------------------------------------------- Obj07: moveq #$00,d0 ; clear d0 move.b $24(a0),d0 ; load routine counter move.w Obj07_List(pc,d0.w),d0 ; load correct add address jmp Obj07_List(pc,d0.w) ; add and jump to correct routine ; =========================================================================== ; --------------------------------------------------------------------------- Obj07_List: dc.w Obj07_Setup-Obj07_List ; 00 dc.w Obj07_Display-Obj07_List ; 02 ; --------------------------------------------------------------------------- ; =========================================================================== ; --------------------------------------------------------------------------- ; Routine to setup the object ; --------------------------------------------------------------------------- Obj07_Setup: addq.b #$02,$24(a0) ; increase routine counter (next routine will run next frame) move.b #%00000100,$01(a0) ; set object as level-coordinated (not like a HUD) move.w #$0000,$02(a0) ; set V-Ram read address (starting at tile 000) move.l #MapObj07,$04(a0) ; set map list address move.b #$02,$18(a0) ; set priority of display (00 Closest | 07 Furthest Away) move.b #$10,$19(a0) ; set X draw out of screen distance (10 pixels from the centre of the object) move.b $28(a0),$1C(a0) ; load object sub-type and set as animation to use ; =========================================================================== ; --------------------------------------------------------------------------- ; Routine to set the object to display ; --------------------------------------------------------------------------- Obj07_Display: lea AniObj07(pc),a1 ; load animation script to run jsr AnimateSprite ; run animation script moveq #$FFFFFF80,d2 ; prepare and/add/sub value move.w $08(a0),d0 ; load X position and.w d2,d0 ; keep in range of multiples of 80 pixels move.w ($FFFFF700).w,d1 ; load screen X position add.w d2,d1 ; move back by 80 pixels (the deletion space is a distance outside the window area) and.w d2,d1 ; keep in range of multiples of 80 pixels sub.w d1,d0 ; subtract left void position from object position cmpi.w #$0280,d0 ; has the object gone outside the object loading space? bhi.s Obj07_Delete ; if so, branch to delete the object jmp DisplaySprite ; save object for display Obj07_Delete: jmp DeleteObject ; remove the object from the list and clean the ram space ; =========================================================================== ; --------------------------------------------------------------------------- ; Animation script list for Object 07 ; --------------------------------------------------------------------------- AniObj07: dc.w Ani07_Script00-AniObj07 ; 00 dc.w Ani07_Script01-AniObj07 ; 01 ; --------------------------------------------------------------------------- Ani07_Script00: dc.b $07,$00,$01,$02,$03,$FF Ani07_Script01: dc.b $03,$03,$02,$01,$00,$FF ; --------------------------------------------------------------------------- even ; --------------------------------------------------------------------------- ; =========================================================================== ; --------------------------------------------------------------------------- ; Map list for Object 07 ; --------------------------------------------------------------------------- MapObj07: dc.w Map07_Frame00-MapObj07 ; 00 dc.w Map07_Frame01-MapObj07 ; 01 dc.w Map07_Frame02-MapObj07 ; 02 dc.w Map07_Frame03-MapObj07 ; 03 ; --------------------------------------------------------------------------- Map07_Frame00: dc.b $01 dc.b $F0,$0F,$00,$00,$F0 Map07_Frame01: dc.b $01 dc.b $F4,$0A,$20,$01,$F4 Map07_Frame02: dc.b $01 dc.b $F8,$05,$40,$02,$F8 Map07_Frame03: dc.b $02 dc.b $F8,$00,$60,$03,$F8 dc.b $D8,$0F,$40,$00,$F0 ; --------------------------------------------------------------------------- even ; --------------------------------------------------------------------------- ; =========================================================================== This object will display 4 frames in an animated pattern using different palette lines each animation frame, it will choose a different animation depending on the sub-type you choose when placing it in the level.
Awesome thanks, got all that in and working alright. Though I'm not quite sure where I'd tell it to load it's art from a nemesis art file? I'm gonna keep looking of course, should probably look at other objects and see if I can figure it out.
Hello I'm Tehkaker, with a very simple question for you. I am doing an custom script for detecting collision on my objects, by reading this from the maps files (Sonic 1 format.). For now, I did want to do a test for this, making the object to delete if gets touched by Sonic, horizontally. But nothing happens. Here is my code, if you want to see: Code (Text): CustomColDetect: movem.l d0-a6,-(sp) moveq #0,d0 move.b $1A(a0),d0 lea (a0),a2 movea.l 4(a0),a1 movea.l 4(a0),a0 mulu.w #2,d0 adda.w d0,a0 adda.w (a0),a1 moveq #0,d0 move.b (a1)+,d0 ;Read how many sprites in map tst.b d0 beq @ret sub.b #1,d0 lea (a1),a0 @loop: moveq #0,d4 moveq #0,d5 moveq #0,d6 moveq #0,d2 moveq #0,d3 moveq #0,d1 moveq #0,d4 moveq #0,d7 move.b (a1),d4 move.b 1(a1),d6 lea 4(a1),a1 move.b (a1)+,d5 ;D3, D2, D1, A3. ;d4, d5, starting pos. ;d2, d3, final pos. ;d1, d7, sonic pos. add.w 8(a2),d4 add.w $C(a2),d5 lea (@sprsizes).l,a3 mulu.w #2,d6 adda.w d6,a3 move.b (a3)+,d2 move.b (a3),d3 add.w d4,d2 add.w d5,d3 move.w ($FFFFD008).w,d1 move.w ($FFFFD00C).w,d7 cmp.w d1,d2 bcs @chkcol @cont: dbf d0,@loop @ret: movem.l (sp)+,d0-a6 rts @chkcol: cmp.w d1,d4 bcs @cont ; cmp.w d7,d5 ; bcs @cont ; cmp.w d7,d3 ; bcs @cont2 ; bra @cont @cont2: move.b #0,(a2) bra @ret @sprsizes: ; Size to assign. ; FORMAT: Horiz pixels, Vert pixels. dc.b 8, 8 ;$00 dc.b 8, 16 ;$01 dc.b 8, 24 ;$02 dc.b 8, 32 ;$03 dc.b 16, 8 ;$04 dc.b 16, 16 ;$05 dc.b 16, 24 ;$06 dc.b 16, 32 ;$07 dc.b 24, 8 ;$08 dc.b 24, 16 ;$09 dc.b 24, 24 ;$0A dc.b 24, 32 ;$0B dc.b 32, 8 ;$0C dc.b 32, 16 ;$0D dc.b 32, 24 ;$0E dc.b 32, 32 ;$0F even
I see what you're trying to do here and I'm actually sort of impressed with your attempt, you have a pretty good deal of understanding of Sonic 1's mapping format, and seem to use it to your advantage. The problems with your code that I found are; What is in a2 to begin with? I'm assuming that this is the Sonic object that is loaded into a2 before the routine is ran, have you made sure that the Sonic object is loaded to a2 before the routine? Why not load the Sonic object to a2 inside this routine itself? When you loaded the X and Y position of the individual sprites in the mapping list, you didn't add the object's X and Y positions to them. Remember, this object might be in the level at X and Y of 221F and 0340, and Sonic might be around the X and Y of 21C0 and 0340, but your mapping's X and Y positions can only be from 00 to 7F (right/down) and 80 to FF (left/up), add the object's X position to the sprite's X position, and the object's Y position to the sprite's Y position, this will get you the exact X and Y position in the level. Here is a fatal error you should be careful of: Code (Text): move.b (a3)+,d2 move.b (a3),d3 add.w d4,d2 add.w d5,d3 You have loaded a "byte" to d2 and d3, but then you add a word to d2 and d3, to explain the problem better, let's pretend that d2 contains 00009F31 to begin with: Code (Text): move.b (a3)+,d2 We've loaded a byte, let's say it was "8" in this situation, d2 will now contain 00009F08. Next we add the word from d4 which we'll pretend is 0180: Code (Text): add.w d4,d2 d2 will now contain A088, this is wrong, you only wanted the 08 to be added to it. the best way to fix this potential error, is by clearing d2 and d3 before loading the byte from a3: Code (Text): moveq #$00,d2 moveq #$00,d3 move.b (a3)+,d2 move.b (a3),d3 add.w d4,d2 add.w d5,d3 This will ensure that d2 and d3 contain 00000000 to begin with. Of course, why don't you simply use the normal touch response that Sonic 1 already has (and uses)? To be very fair, I know it doesn't read the mapping's exact positions, but does it need to? In general though, I think you're well on your way to creating some awesome code and making yourself a respectable presents in the scene, this stuff (although buggy) is rather decent.
REV01 initialises v_scorelife to 5000 when a demo starts: Code (ASM): Demo_Level: move.b #3,(v_lives).w ; set lives to 3 moveq #0,d0 move.w d0,(v_rings).w ; clear rings move.l d0,(v_time).w ; clear time move.l d0,(v_score).w ; clear score if Revision=0 else move.l #5000,(v_scorelife).w ; extra life is awarded at 50000 points endc rts Make sure you have that line too. And while you're at it, make sure it's also there in LevSel_Level_SS.
Hello. Just popping in with a quick question here, I have made a custom level in Sonic 1. All I simply wanted to do was to put it in Sonic 2 with the level converter. Although the Tiles are messed up badly, and the collision is greatly corrupted, while all objects are placec quite perfectly. Yes I understand Hex/Binary and all (Hex = Numbers being represented with a base of 16, adding A, B, C, D, E, & F, and Binary Being 1s and 0s.), but I do not get why my collision & tiles are not loading properly, perhaps I am inserting something in the wrong place. Either way, if somebody could give me a cheat sheet of which file is supposed to replace which file I'd appreciate it. Just to quickly introduce myself, I wrote the Sonic 2 Extra Characters guide, created the Mario Kart Wii Custom Tracks Jungle Island and SM64DS Bob-Omb Battlefield, and I am a programmer (Wrote KCL/COL2OBJ.exe, and I know much about BDL & BMD, like what the MDL3 Section implies) I am very interested in also helping out in this community, and using my knowledge of hex, binary, Java/C/Python here.
So recently I've become interested in making custom music for Sonic 3&K. What tools/programs would be best for doing this? I have FL Studio but I also play around with trackers(?) every now and then.
How possible is it to port Sonic 1 and 2 levels over to Sonic 3&K? I know SonLVL only has read support for Sonic 3&K right now but is there a way to get that done?