Basic Questions and Answers Thread

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

  1. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    I made several private tools to convert stuff (objects, layouts, solidity, ... basically everything) between formats for other people, maybe one of these days I should just release everything, but I always thought there was no point since such tools are very specific.
     
    Last edited by a moderator: Jul 13, 2014
  2. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    There's no need for a private tool when LevelConverter can do the conversion for you.

    As for the object manager, you don't have to completely replace Sonic 1's with Sonic 2, you just have to change which bit it reads some values from and remove an andi.b #$7F,dN somewhere.
     
  3. sham1

    sham1 Newcomer Member

    Joined:
    Jul 8, 2014
    Messages:
    23
    Location:
    Somewhere in Northen Europe
    God damn it Stardust Gear. Could you please do some digging around yourself and not relay on everybody doing everything for you. I'd imagine that you have at least a brain cell to look at s2 split assembly to figure it out but NO. Everything has to be served to you in a silver platter. Anyway, I give you one hint: Look around in s2 assembly(probably Github version is way to go for you as you like it so much), look how it is implemented and implement it into s1. And if you figure that out, I'd imagine you being able to use the exciting algorithm for your advantage. Or just use LevelConverter as MainMemory said.

    ps: and yes, one more Trialist post wasted.
     
  4. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    I know, it's just that most of the tools I wrote predate your converter by several years, I was wondering if I should release them mainly for preservation reasons, I didn't imply anyone should actually use them.
     
  5. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    Does anyone know of an S3K disassembly that has been formatted properly (like the hivebrain one)?

    in other words, i need one that uses the "enter key" (i forgot the proper name :p) instead of just leaving the code in giant globs of text that stretch far off of the screen and is pratically impossible to cut-paste into my sonic 1 asm.
     
  6. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    Linebreak Fixer.

    Simply drag and drop the text/asm documents onto that application to change the linebreak values from "0A" to "0D 0A".

    Do not attempt to convert documents that have already been converted.
     
  7. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    How do you get it to work? It doesn't do anything when I drag it in beyond pasting in the files directory (I know because it doesn't move down a line, and lets me edit the directory), and pressing enter exits the program without making any changes.
     
  8. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    No, you don't drag the file onto the console window, you literally drag the file onto the application itself:

    [​IMG]

    Alternatively, you could create a batch file with the command:

    Code:
    LinebreakFixer.exe example.asm
    There are several alternate ways to do it, but I prefer the drag/drop method as it proves to be the most functional.
     
  9. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    Thank you so much :3

    Now to figure out what ram address goes to what counter...
     
  10. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    For future reference, most text editors that aren't Notepad should support Unix style linebreaks, for example, Notepad++.
     
  11. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    I did notice that the editor that this site uses for posts reads linebreaks properly (I planned to copy paste code from the disassembly as an example). I think I'm fine with notepad, though. The simpler, the better, especially for someone as new as me. Plus, it comes preinstalled on every windows computer ever :D
     
  12. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    Notepad is the worst possible editor, especially for something as large as disassemblies tend to be. It's not designed for large files, it can only undo one action, it only reads Windows-format linebreaks, it doesn't have automatic indenting which is useful for 68000 ASM that has to be indented to work.
     
  13. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    For the record, if you want to stick with programs which come by default with Windows, even Wordpad is able to read Unix-styled linebreaks, you can use it to open and resave the files you're interested into, and then keep on using Notepad afterwards. That, or MarkeyJester's neat program works just fine :p


    Trivia: even MS-DOS Editor can read Unix-styled linebreaks, in fact I used it more than a few times in the past, but that's another story.


    edit: damn it, what's with me being too slow these days? :p


    Yeah, I'm not advising to use Notepad, either. Just saying that he can, if he wants to.
     
    Last edited by a moderator: Jul 15, 2014
  14. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    Notepad does have a tendency to lag over minor edits, and the undo button's failure to go back by more than 1 edit is extremely annoying, but I often end up working on multiple different computers, and my other programs are hard enough to carry around as is. Plus, I fear that any formatting done by wordpad could screw up my code.
     
  15. TheInvisibleSun

    TheInvisibleSun Visible Member

    Joined:
    Jul 2, 2013
    Messages:
    424
    Location:
    Western New York, USA
    I use Wordpad, and I've never had any formatting issues.
     
  16. Painto

    Painto Arthurus Paintus Erinaceus Member

    Joined:
    Mar 24, 2014
    Messages:
    321
    Location:
    Lublin, Poland
    I added recently a sexy screen which I'm calling "Zone Checker".

    The only thing I need is to display the emblems. The problem is I don't know how to modify selected bytes from the file via ASM during the game, so the emblems will appear.

    I tried to add this emblem using this:

    ; ---------------------------------------------------------------------------
    ; Subroutine to load level select text
    ; ---------------------------------------------------------------------------

    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||


    SaveScreenTextLoad2:
    lea (SaveScreenText).l,a1
    lea ($C00000).l,a6
    move.w #$292A,d0

    cmpi.b #1,($FFFF1234).w
    bne.w Saved_NotGHZ1
    move.w d0,$E8(a1)
    Saved_NotGHZ1:
    cmpi.b #1,($FFFF4321).w
    bne.w Saved_NotGHZ2
    move.w d0,$10C(a1)
    Saved_NotGHZ2:
    cmpi.b #1,($FFFF1432).w
    bne.w Saved_NotGHZ3
    move.w d0,$130(a1)
    Saved_NotGHZ3:
    move.l #$60840003,d4 ; screen position (text)
    move.w #$E680,d3 ; VRAM setting
    moveq #24,d1 ; number of lines of text

    loc2_34FEa: ; XREF: SaveScreenTextLoad2+26j
    move.l d4,4(a6)
    jsr Intro_ChgLine2
    addi.l #$800000,d4
    dbf d1,loc2_34FEa
    rts
    Of course RAMs are random. And yes, idk why this don't worked. Ever after passing GHZ2 the emblem (that used in title screen menu) don't appeared at this offset (is one tile to the left from the "2" of GHZ). Is even possible to add this emblem using something like this? If yes, how? Or maybe there's a simpler way to add it? I need this, it's the only thing I need with this screen related. Thanks in advice.
     
    Last edited by a moderator: Jul 17, 2014
  17. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    I think I see the problem.

    move.l #$60840003,d4 ; screen position (text)The Sonic games have specified their plane A mappings to address at C000, and plane B mappings to address at E000. The VRAM address you've set there is E084, thus, you're writing to plane B. Thus, I have to assume your Sonic image is drawn onto plane A, and the text is on plane B.
    I am therefore assuming your screen here is a direct copy/paste of the level select code, hence why the BG is on the FG plane, and the FG text is on the BG plane. Sonic Team did this simply because of the title emblem being on the FG plane, writing text to the BG plane setting the high-plane flag would be more efficient than redrawing the FG onto the BG plane, so they had a good cause to do that.

    There are one of two things you can do, either;

    • Swap over the FG and BG so that the FG is on plane A (the text) and the BG is on plane B (Sonic's art).
    • Or change:
    Code:
    move.w #$292A,d0
    ...with:
    Code:
    move.w #$A92A,d0
    The later would be easier, but the former would be more efficient for your needs should you wish to expand upon the screen in an advanced way.
     
    Last edited by a moderator: Jul 18, 2014
  18. Painto

    Painto Arthurus Paintus Erinaceus Member

    Joined:
    Mar 24, 2014
    Messages:
    321
    Location:
    Lublin, Poland
    So, from what I understand i need to change

    move.l #$60840003,d4 ; screen position (text)to
    Code:
    move.l #$40840003,d4 ; screen position (text)
    Right?
    And yes, is just a copy of the levsel code. But I don't understand how changing tile number ($29 is the left part and $2A is the right part of emblem) will change the displayability of these.
     
    Last edited by a moderator: Jul 18, 2014
  19. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    Ah, so you're even using the level select's mapping method too?

    That explains why it won't work... I assumed you were mapping via words rather than via bytes, so the issue isn't plane priority at all.

    That must also mean that "SaveScreenText" is mapping data from inside the ROM itself. ROM is an abbreviation for Read Only Memory, you cannot write to the ROM space, only read. For your code to work, the mapping data needs to be in a rewrite-able memory space (Such as RAM), so, you'll first need to copy the mapping data into RAM, and then load the starting RAM address into a1 instead of "SaveScreenText".

    Or, write the emblem directly to VRAM in a similar way in which the sound test numbers are written.
     
    Last edited by a moderator: Jul 18, 2014
  20. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    416
    Location:
    Town Creek, AL
    I have a question about sonic 1's Title screen.

    First off i'm wanting 2  title screens... sort of. I've replaced the big sonic object to that of sonic 2's Big Sonic for the Sonic Game. want one for Richter.

    Looking at the continue screen sonic's coding I can see one part is possible.

    Using a part of Richter's Jumping animation to fall in & disappear into the Title, Then loading the Big Richter object afterward.

    Just wandering if possible , without corruption, before proceding with it