Hi everyone and welcome to my guide on how to change the order of the levels in Sonic 1 GitHub Disassembly(https://github.com/sonicretro/s1disasm)! -Why this guide? I wanted to do this tutorial because of a lack of documentation on this argument and to help who is a beginner. Before starting I wanted to thank three members of this forum: Inferno,MarkeyJester, ProjectFM Without them there would not be this guide For more on how they helped me:http://sonicresearch.org/community/...ic-questions-and-answers-thread.1155/page-291 Part 1 (location and structure): In the old guides it is explained that the levels are in bin format (Level Order.bin or lvl_ord.bin),but in this disassembly they are in ASM format(3A Got Through Card.asm). To find the file go to:s1disasm-master\_incObj Look inside the file "LevelOrder" and you should find this: Code: ; --------------------------------------------------------------------------- ; Level order array ; --------------------------------------------------------------------------- LevelOrder: ; Green Hill Zone dc.b id_GHZ, 1 ; Act 1 dc.b id_GHZ, 2 ; Act 2 dc.b id_MZ, 0 ; Act 3 dc.b 0, 0 ; Labyrinth Zone dc.b id_LZ, 1 ; Act 1 dc.b id_LZ, 2 ; Act 2 dc.b id_SLZ, 0 ; Act 3 dc.b id_SBZ, 2 ; Scrap Brain Zone Act 3 ; Marble Zone dc.b id_MZ, 1 ; Act 1 dc.b id_MZ, 2 ; Act 2 dc.b id_SYZ, 0 ; Act 3 dc.b 0, 0 ; Star Light Zone dc.b id_SLZ, 1 ; Act 1 dc.b id_SLZ, 2 ; Act 2 dc.b id_SBZ, 0 ; Act 3 dc.b 0, 0 ; Spring Yard Zone dc.b id_SYZ, 1 ; Act 1 dc.b id_SYZ, 2 ; Act 2 dc.b id_LZ, 0 ; Act 3 dc.b 0, 0 ; Scrap Brain Zone dc.b id_SBZ, 1 ; Act 1 dc.b id_LZ, 3 ; Act 2 dc.b 0, 0 ; Final Zone dc.b 0, 0 even zonewarning LevelOrder,8 ; =========================================================================== This is the list of the zones! WARNING:the structure must not be changed,to change the order of the levels you have to change the date not the list! Part2 (code change): The code works like this: dc.b id_GHZ, 1 id_GHZ is the name of the zone(in this case Green Hill Zone) and 1 is the Act number to run next(in this case Act 2). To change the order of the level the only thing you need to do is modify the third element. For example: if we want that after Green Hill Zone , the level will be Labyrinth Zone,we have to make this change: Code: ; Green Hill Zone dc.b id_GHZ, 1 ; Act 1 dc.b id_GHZ, 2 ; Act 2 dc.b id_LZ, 0 ; Act 3 dc.b 0, 0 -What if I want to start on a different level? No problem,to change the starting zone(for example Spring Yard Zone) you have to go to "sonic.asm" (found at the beginning of the disassembly) and search for "Tit_ChkLevSel": Code: Tit_ChkLevSel: tst.b (f_levselcheat).w ; check if level select code is on beq.w PlayLevel ; if not, play level btst #bitA,(v_jpadhold1).w ; check if A is pressed beq.w PlayLevel ; if not, play level moveq #palid_LevelSel,d0 bsr.w PalLoad2 ; load level select palette lea (v_hscrolltablebuffer).w,a1 moveq #0,d0 move.w #$DF,d1 on the right add: Code: move.b #id_SYZ,(v_zone).w or: Code: move.w #(id_SYZ<<8)+0,(v_zone).w ; zero is the act number(in this case Act 1) Click on "build" and you're done! I personally tested the codes and they work (you can try it too). I hope this guide has been helpful, good work
The guide was helpful indeed. But now,i ran into this. In SBZ's and SYZ's place, what do i put? do i leave them as normal or what?
I don't know if you've tested the code but I'm afraid the problem may remain, because: Code: ; Green Hill Zone dc.b id_GHZ, 1 ; Act 1 dc.b id_GHZ, 2 ; Act 2 dc.b id_MZ, 0 ; Act 3 (In this part you are telling him to start with Marble zone anyway) dc.b 0, 0 To change the zone just change the third element: Code: ; Green Hill Zone (element 1) dc.b id_GHZ, 1 ; Act 1 (element 2)dc.b id_GHZ, 2 ; Act 2 (element 3)dc.b id_MZ, 0 ; Act 3 (element 4)dc.b 0, 0 ; Labyrinth Zone (element 1)dc.b id_LZ, 1 ; Act 1 (element 2)dc.b id_LZ, 2 ; Act 2 (element 3)dc.b id_SLZ, 0 ; Act 3 (element 4)dc.b id_SBZ, 2 ; Scrap Brain Zone Act 3 (Etc...) There is also the fact that you have deleted MZ acts( dc.b id_MZ, 1 & dc.b id_MZ, 2),and this could cause problems! How would you like the order of the levels? Or just want to remove Marble Zone?
> There is also the fact that you have deleted MZ acts( dc.b id_MZ, 1 & dc.b id_MZ, 2),and this could cause problems! Oh for hell's sake, it had to be me and my Low IQ! Well, I was intending to cut out MZ, and LZ. And well, adding an Extra Zone but i don't know how to do that lmao. > To change the zone just change the third element: Yeah, Darkex told me that, so i did it as i understood. Well i think assumptions are not the best choice!
Copy and paste this: Code: ; --------------------------------------------------------------------------- ; Level order array ; --------------------------------------------------------------------------- LevelOrder: ; Green Hill Zone dc.b id_GHZ, 1 ; Act 1 dc.b id_GHZ, 2 ; Act 2 dc.b id_SYZ, 0 ; Act 3 dc.b 0, 0 ; Labyrinth Zone dc.b id_LZ, 1 ; Act 1 dc.b id_LZ, 2 ; Act 2 dc.b id_SLZ, 0 ; Act 3 dc.b id_SBZ, 2 ; Scrap Brain Zone Act 3 ; Marble Zone dc.b id_MZ, 1 ; Act 1 dc.b id_MZ, 2 ; Act 2 dc.b id_SYZ, 0 ; Act 3 dc.b 0, 0 ; Star Light Zone dc.b id_SLZ, 1 ; Act 1 dc.b id_SLZ, 2 ; Act 2 dc.b id_SBZ, 0 ; Act 3 dc.b 0, 0 ; Spring Yard Zone dc.b id_SYZ, 1 ; Act 1 dc.b id_SYZ, 2 ; Act 2 dc.b id_SLZ, 0 ; Act 3 dc.b 0, 0 ; Scrap Brain Zone dc.b id_SBZ, 1 ; Act 1 dc.b id_LZ, 3 ; Act 2 dc.b 0, 0 ; Final Zone dc.b 0, 0 even zonewarning LevelOrder,8 ; =========================================================================== As you can see I only changed the third element of Green Hill Zone and Spring Yard Zone. You can try asking here for details: https://sonicresearch.org/community...dding-a-new-level-adding-water-to-zones.6055/
Hey there, for the starting on different level tutorial i have a question, what do you mean by "on the right add", could you show me how the code looks when you actually correctly modify it because im not sure where to put the line of code. Thanks in advance.
HI! If I have to tell you the truth, I'm very surprised that someone is asking me questions about this tutorial after all this time. To answer your question here is the code: -Before Code: Tit_ChkLevSel: tst.b (f_levselcheat).w ; check if level select code is on beq.w PlayLevel ; if not, play level btst #bitA,(v_jpadhold1).w ; check if A is pressed beq.w PlayLevel ; if not, play level moveq #palid_LevelSel,d0 bsr.w PalLoad ; load level select palette clearRAM v_hscrolltablebuffer move.l d0,(v_scrposy_vdp).w disable_ints lea (vdp_data_port).l,a6 locVRAM vram_bg move.w #plane_size_64x32/4-1,d1 -After Code: Tit_ChkLevSel: move.b #id_SYZ,(v_zone).w tst.b (f_levselcheat).w ; check if level select code is on beq.w PlayLevel ; if not, play level btst #bitA,(v_jpadhold1).w ; check if A is pressed beq.w PlayLevel ; if not, play level moveq #palid_LevelSel,d0 bsr.w PalLoad ; load level select palette clearRAM v_hscrolltablebuffer move.l d0,(v_scrposy_vdp).w disable_ints lea (vdp_data_port).l,a6 locVRAM vram_bg move.w #plane_size_64x32/4-1,d1 As you can see, the code has changed, but the procedure for changing the order of the levels does not change. If you have other questions I will try to answer them as best I can, because I don't edit the Disassembly for years. Let me know if the code works (I tried it and in my case it works)!