Sonic and Sega Retro Message Board: Basic Questions & Answers thread - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Loading News Feed...
 

Basic Questions & Answers thread NEWBIES: Start here!

#5101 User is offline MainMemory 

Posted 11 April 2014 - 10:54 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3006
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339

View PostHCKTROX, on 11 April 2014 - 07:59 PM, said:

I have a pretty simple question... what's the ASM68k's equivalent for "narg" in AS? I'm trying to convert this macro to AS:

locVRAM:	macro loc,controlport
		if (narg=1)
		move.l	#($40000000+((loc&$3FFF)<<16)+((loc&$C000)>>14)),(vdp_control_port).l
		else
		move.l	#($40000000+((loc&$3FFF)<<16)+((loc&$C000)>>14)),controlport
		endif
		endm


This sounds like something you should be asking the AS User's Manual. The section on the macro directive says:

Quote

ARGCOUNT refers to the actual count of parameters passed to a macro. Note however that this number is never lower than the formal parameter count of the macro, since AS will fill up missing arguments with empty strings!
Because of that, what you should do instead is if "controlport"=="".
This post has been edited by MainMemory: 11 April 2014 - 10:56 PM

#5102 User is offline HCKTROX 

Posted 11 April 2014 - 11:02 PM

  • Meh
  • Posts: 13
  • Joined: 04-August 10
  • Gender:Female
  • Location:Chile
  • Project:Tails Into Dreams, Tails in Alphaomega
  • Wiki edits:4
Thanks a lot! Hopefully the guide will make my life a lot easier as well

#5103 User is offline KingofHarts 

Posted 16 April 2014 - 12:12 PM

  • Amigo
  • Posts: 1198
  • Joined: 07-August 10
  • Gender:Male
  • Location:On the way back home to AMERICA!
  • Project:Sonic Triad Studio
  • Wiki edits:1
COPIED FROM MY POST OVER AT SSRG

Quick easy question based on THIS:
http://sonicresearch...ic=3925&p=45577

About the lost rings bit... I'm wondering if SpirituInsanum's fix is necessary for the Lost Rings if I do the following:

Allocate a separate section of Object RAM specifically for the use of lost ring objects only. I believe this would solve that issue noted in this thread... AND also solve some other issues of objects not spawning when 32 lost rings are floating about... OR lost rings not spawning because there are too many other objects around.

My point is.. is this a feasible thing to do?

This post has been edited by KingofHarts: 16 April 2014 - 12:13 PM

#5104 User is offline Clownacy 

Posted 17 April 2014 - 08:56 PM

  • Posts: 46
  • Joined: 06-July 13
  • Gender:Male
Oh man, this is gonna drive me crazy... Does anyone know of a way of automating the process of changing this

	jmp	DisplaySprite


into this

	jmp	(DisplaySprite).l


This alone has made porting the Sonic 1 disasm to AS a dreadful experience. I could search-and-replace explicitly "jmp DisplaySprite", but then, what about every other jmp with a different label? Doing the same but with every label still takes forever! Is there any text editor that functions like a macro; where the label is treat as generic, and simply a string that has to be surrounded in the 'address range brackets'?

#5105 User is offline Super Egg 

Posted 17 April 2014 - 09:08 PM

  • Master of MS Paint.
  • Posts: 62
  • Joined: 01-July 10
  • Gender:Male
  • Location:Tomball, TEXAS
  • Project:Sonic 2 beta 3 hoax, SONIC X ABRIDGED BITCH!!!
  • Wiki edits:46

View PostClownacy, on 17 April 2014 - 08:56 PM, said:

Oh man, this is gonna drive me crazy... Does anyone know of a way of automating the process of changing this

	jmp	DisplaySprite


into this

	jmp	(DisplaySprite).l


This alone has made porting the Sonic 1 disasm to AS a dreadful experience. I could search-and-replace explicitly "jmp DisplaySprite", but then, what about every other jmp with a different label? Doing the same but with every label still takes forever! Is there any text editor that functions like a macro; where the label is treat as generic, and simply a string that has to be surrounded in the 'address range brackets'?


Not use AS =P

Honestly, there is no easier way. When it comes to conversion, you're gonna be here all day. Sheer curiosity, why are you making a S1 into AS disassembly? You're doing a bunch more work that doesn't need to be done.

#5106 User is offline Clownacy 

Posted 17 April 2014 - 09:39 PM

  • Posts: 46
  • Joined: 06-July 13
  • Gender:Male
Something about SMPS2ASM, some incompatibility that I couldn't overcome with asm68k. Also, I'm more familiar with AS. And then there's the knowledge to be gained, such as how AS and asm68k's interpretation of macros are different. For example, /1, /2, etc appear to be nameless 'macro inputs'. Say you have "locVRAM Unc_Sonic, $8000" /1 would be Unc_Sonic, /2 $8000. I think I saw /0 being used as ATTRIBUTE somewhere.

I've tried this before and failed, but now I have it down to a science. It's just this time consuming part that's driving me mad. And to think, in S2's disasm's changelog, someone did this to the whole disassembly and shrugged it off...

#5107 User is offline MarkeyJester 

Posted 17 April 2014 - 09:50 PM

  • Posts: 1439
  • Joined: 22-July 08
  • Gender:Male
  • Location:Japan
  • Wiki edits:16
I've never been too sure on assembler macros, I don't think I want to be either...

http://mrjester.hapi...c/JMPLABFIX.exe

Try that, drag and drop your source file onto it (I.e. pass it as the first argument), but I recommend you back up your source first.

#5108 User is offline Clownacy 

Posted 17 April 2014 - 10:19 PM

  • Posts: 46
  • Joined: 06-July 13
  • Gender:Male
Oh, I forgot one of my main reasons, Z80 assembling, I don't want to pre-assemble the DAC driver.

Thanks a lot, Markey! I'll give it whirl.

#5109 User is offline Tiddles 

Posted Yesterday, 04:24 AM

  • Diamond Dust
  • Posts: 410
  • Joined: 25-December 09
  • Gender:Male
  • Location:Nottingham, England
  • Project:Get in an accident and wake up in 1973
  • Wiki edits:31
Looks like you've got a solution anyway, but for academic purposes: I did this three years ago when I moved my Sonic 3 Complete stuff from the original Stealth disassembly on ASM68K to the then-SVN version on AS.

My solution was to feed the following into my favourite regular-expression-supporting text editor EditPlus:

Search: jmp\t([^(][^()\t;]+)([^)]*)$
Replace: jmp\t(\1).l\2

You might want to tweak it if your tab pattern is different or if there are some corner cases that get mashed up by this, but it worked for everything I had to do at the time.

I, for one, embrace our new AS overlords. It may have some strange quirks, but at least it's capable to begin with. I do miss the raw speed of ASM68K though, especially when compiling tens of patch builds at a time.

#5110 User is offline Clownacy 

Posted Yesterday, 06:33 AM

  • Posts: 46
  • Joined: 06-July 13
  • Gender:Male
This "regular expression" seems very capable for the many laborious search-and-replaces I find myself doing, I'll be sure to research this. Thanks!

EDIT: Got it working. For anyone using NotePad++, search "jmp\t([^(][^()\n;]+)$" and replace "jmp\t\(\1\).l" seem to work.

EDIT2: Ah, turns out mine hates comments.
This post has been edited by Clownacy: Yesterday, 08:46 AM

  • 341 Pages +
  • ◄ First
  • 339
  • 340
  • 341
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users