It is currently Mon Jun 24, 2019 8:26 am

All times are UTC - 7 hours



Forum rules





Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Thu Jul 09, 2009 12:39 pm 
Offline
User avatar

Joined: Thu Jan 19, 2006 5:08 pm
Posts: 760
I need some code-converting help here.

I cannot convert SMBDIS to WLA-DX NES code, As it is part of my processing plan for converting it to SNES.

I need a real bunch of help on either converting Nevketsi's SNES Starterkit to CA65 or Converting SMBDIS to WLA-DX,

If anyone already converted SMBDIS to WLA-DX compatible code, please post it here,

The reason is that I hate the way WLA-DX handles lables and in-code math stuff compared to X816/CA65, When porting, you have to either ruin the code or leave it alone and forget about porting it to SNES!

_________________
AKA SmilyMZX/AtariHacker.


Top
 Profile  
 
PostPosted: Thu Jul 09, 2009 4:19 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21452
Location: NE Indiana, USA (NTSC)
Hamtaro126 wrote:
I need a real bunch of help on either converting Nevketsi's SNES Starterkit to CA65

I think this might be the better option, unless you really want WLA-DX for its SPC700 support and you really don't want to have two assemblers installed.

_________________
Pin Eight | Twitter | GitHub | Patreon


Top
 Profile  
 
PostPosted: Thu Jul 09, 2009 5:00 pm 
Offline
User avatar

Joined: Thu Jan 19, 2006 5:08 pm
Posts: 760
tepples wrote:
Hamtaro126 wrote:
I need a real bunch of help on either converting Nevketsi's SNES Starterkit to CA65

I think this might be the better option, unless you really want WLA-DX for its SPC700 support and you really don't want to have two assemblers installed.


Agreed, Converting it to CA65 is recommended. If Nevketsi was still around right now (Hopeing for a remade and updated version), It could save the SNESDEV scene's butt,

My comment on WLA-DX is it should be nicknamed ''Wierd and Lame Assembler'' (hence the capatalized W, L, and A)

_________________
AKA SmilyMZX/AtariHacker.


Top
 Profile  
 
PostPosted: Fri Jul 10, 2009 3:01 pm 
Offline

Joined: Thu Jun 22, 2006 11:39 pm
Posts: 205
EDIT: just looked up ca65. It's not the assembler I thought. I don't think this one was around when I was trying to choose an assembler. Looks interesting.
---

I don't understand why people complain about WLA DX so much.
A linker can be _very_ useful. It is very painful to arrange a lot of graphics and data by hand to never cross a bank boundary. Because of the linker step, WLA can do this for you.

Yes, you need to explain the memory map, but it is just a couple lines. And for code that will be relocated to RAM, wla's memory map "slot" feature can be quite useful. I also like the powerful macro features, and .enum to easily "allocate" variables in RAM.

I also like anonymous labels (which other assemblers support as well).

Basically, it has a lot of great features. If you don't like them, you don't have to use them ... with the exception of the linker and the couple lines for the memory map.

In the end, to each their own. But I feel people really misunderstand the power of the linker step.
Let me point out that d4s used WLA for his large coding project, probably for several of the same reasons I like it as well.

Hamtaro126 wrote:
I need a real bunch of help on either converting Nevketsi's SNES Starterkit to CA65 or Converting SMBDIS to WLA-DX

I'm not sure what you need the starter kit for.
When first learning to program for a new system, the most painful step is the time period between when you start coding and the first point you can get the system to give you some feedback ... at that point you can "test" and "play" and "debug" all you want. The starter kit was merely to let people start immediately at that point (and also have a couple reference docs about the CPU and PPU).

As an aside, many people misunderstood and I got complaints that it didn't help people learn how to use the system. But, to me at least, that was not the point ... it was not a tutorial. It was merely a starter kit with example code to let you jump into immediately playing with stuff.

In particular, my "init" routine is total overkill just to force everything to a known state.

Hamtaro126 wrote:
The reason is that I hate the way WLA-DX handles lables and in-code math stuff compared to X816/CA65, When porting, you have to either ruin the code or leave it alone and forget about porting it to SNES!

Out of curiousity, what exactly is WLA DX forcing you to do to the code?

If you prefer x816/CA65, let me know what routines you actually want from my code and I or others here can probably convert it for you. But converting the whole kit would be a pain since I so heavily use wla macro specific stuff in there.


Top
 Profile  
 
PostPosted: Fri Jul 10, 2009 4:50 pm 
Offline
User avatar

Joined: Thu Jan 19, 2006 5:08 pm
Posts: 760
neviksti wrote:
Out of curiousity, what exactly is WLA DX forcing you to do to the code?

If you prefer x816/CA65, let me know what routines you actually want from my code and I or others here can probably convert it for you. But converting the whole kit would be a pain since I so heavily use wla macro specific stuff in there.


Yes, Please! I'd like to let you have at least the INIT code, Palette code, VRAM, HDMA and DMA Upload code to be rewritten in this case.

If you can, ASM6 (somehow compatible with X816 with fewer modifications) by Loopy (Yes, The Legend himself) can be found at http://home.comcast.net/~olimar/NES/asm6.zip

_________________
AKA SmilyMZX/AtariHacker.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 10, 2009 5:03 pm 
Offline

Joined: Mon Mar 27, 2006 5:23 pm
Posts: 1477
Quote:
I don't understand why people complain about WLA DX so much.


Mostly because it's so different from the norm in terms of conventions, and most people working on SNES projects aren't writing large software programs.

xkas is vastly superior for small projects like emulator test ROMs and Japanese->English translations, because it lets you get right to business with no fuss. I compare it as the NASM to WLA-DX's MASM / TASM. No red tape.

To me, the biggest advantage of a linker is the ability to only need to compile changed files. But when you consider that building even ~200kb of assembler code takes about 100ms on a modern PC (and ~90% of that is disk overhead of writing the 4MB image file to disk), it's not really a big deal.

WLA-DX's automatic RAM variable allocation is nice, but that doesn't require a linker.

Not even WLA can handle code crossing bank boundaries (would have to rewrite JSR/JSLs and subsequently branches that are now too far apart to BRLs, etc), and any hobbyist code should really be using HiROM anyway which obviates the need to worry about data crossing boundaries.

Also, it's very rare to write more than 64kb (in assembled form) of pure ASM code anyway. Almost every game I've touched has put entire systems into their own specific banks. Both for speed reasons and because there's plenty of room for it.

Of course, there are other smaller linker advantages I haven't mentioned. And for someone used to traditional programming where each source file gets its own object file, WLA-DX can't be beat. At least not in the legal category (Psy-Q is quite a bit nicer, from what I hear.)


Top
 Profile  
 
PostPosted: Sat Jul 11, 2009 2:57 am 
Offline

Joined: Mon Jul 14, 2008 4:02 pm
Posts: 88
neviksti wrote:
In the end, to each their own. But I feel people really misunderstand the power of the linker step.
Let me point out that d4s used WLA for his large coding project, probably for several of the same reasons I like it as well.


Yeah, absolutely! (Although I'm not actually using the linker all that much)

I think it's a matter of preference in the end.
It's a good thing we have different solutions to choose from.
Wla-Dx has worked quite well for me in the past, so I'm sticking to that for now.


Top
 Profile  
 
PostPosted: Sat Jul 11, 2009 1:24 pm 
Offline
User avatar

Joined: Thu Jan 19, 2006 5:08 pm
Posts: 760
d4s wrote:
neviksti wrote:
In the end, to each their own. But I feel people really misunderstand the power of the linker step.
Let me point out that d4s used WLA for his large coding project, probably for several of the same reasons I like it as well.


Yeah, absolutely! (Although I'm not actally using the linker all that much)

I think it's a matter of preference in the end.
It's a good thing we have different solutions to choose from.
Wla-Dx has worked quite well for me in the past, so I'm sticking to that for now.


What about porting a certain assembly format to another, Like 2 posts before this, X816 to WLA-DX is almost impossible to do for my opinion, So many attemts even with the math the code has failed.

For example, I could not port:

Code:
LDA #$-0F


And then the worse happens while porting This:

Code:
#DEFINE TitlescreenDataOffset      <$1ec0


Similar effect:

Code:
.DC.B <GroundPaletteData .......
.......  .DC.B >GroundPaletteData


Now these, unlike X816, ASM6, DASM, CC65. Will create lots and lots of errors on WLADX, And I hate to (ask around or do it myself) rewrite SMBDIS for it to be compatible with WLA-DX!


Last edited by Hamtaro126 on Sun Jul 12, 2009 5:48 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 11, 2009 2:01 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3693
Location: Indianapolis
I find WLA-DX very weird and probably wouldn't use it, though I know some people swear by it. To clear up any confusion about CA65, it's more commonly referred to as CC65 (since that's the kit it comes with - C compiler, assembler, linker)

Quote:
And then the worse happens while porting This:

Code:
#DEFINE TitlescreenDataOffset = <$1ec0


I'd think I think if you take the '#DEFINE' part off, that should work in any assembler.


Top
 Profile  
 
PostPosted: Sat Jul 11, 2009 3:01 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 4115
Location: A world gone mad
Code:
LDA #$-0F


I have to assume this is the equivalent of LDA #-15, e.g. load -15 into the accumulator (e.g. $F1 (assembler is set to 8-bit accum) or $FFF1 (assembler is set to 16-bit accum))? If not, what does the assembler do with that?

Code:
#DEFINE TitlescreenDataOffset = <$1ec0


Who came up with this syntax?! What a travesty. "Hey man, I'm gonna mix a C-like syntax with an assembly-like syntax!" I'm sorry to see this kind of syntax being pushed, especially if that's the equivalent of an equate statement (e.g. Label EQU address, or Label = address).

Regarding "<", in many assemblers, the characters "<", ">", "^", and "!" can have special use -- but there's no standard. If this is X816 syntax, "<" loads the low byte ($c0) of the address, ">" loads the high byte ($1e), "^" loads the bank (known by the assembler and is based on .ORG or .BASE), and "!" loads the 16-bit word value ($1ec0).

However, if you were to use ORCA/M, you'd find that "<" loads the 16-bit word of an address, ">" induces long (24-bit) addressing, "^" loads the bank, and I forget what "!" does (I believe bitwise NOT on the immediate/literal value).


Code:
.DC.B <GroundPaletteData .......
.......  .DC.B >GroundPaletteData


See above for what "<" and ">" would do here, I think. And in X816, the directive would become .DCB.

Bottom line:

Welcome to working with different assemblers. I hate to sound rude, but you're crying over spilt milk here. As someone who has worked with numerous 6816 assemblers over the years (Merlin 16, Merlin 16+, ORCA/M, X816, and some custom ones), I don't have much sympathy. :-) I remember having to "port" some code from 65816 cross-assemblers on the Amiga to X816 and ORCA/M back in the day, and it was a tedious process -- and remember, just because something assembles w/out warnings or errors doesn't mean it's going to work!

If the disassembler you're using doesn't output code that's compatible with the assembler you're using, use a different disassembler, or use a different assembler. What you go with is your choice. You can ask people here what they'd recommend, but use whatever tools you feel comfortable with above all else.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 12, 2009 5:47 pm 
Offline
User avatar

Joined: Thu Jan 19, 2006 5:08 pm
Posts: 760
Memblers wrote:
I find WLA-DX very weird and probably wouldn't use it, though I know some people swear by it. To clear up any confusion about CA65, it's more commonly referred to as CC65 (since that's the kit it comes with - C compiler, assembler, linker)

Quote:
And then the worse happens while porting This:

Code:
#DEFINE TitlescreenDataOffset = <$1ec0


I'd think I think if you take the '#DEFINE' part off, that should work in any assembler.


Yeah, I screwed up on that part of syntax but corrected it.

Memblers is right, WLA-DX really should be left alone (Except for Sega 8bit development, in Which I could not learn Z80 Assembly, Too complex) until ''the new person'' is advanced enough for WLA-DX,

What CC65 (or in this case the assembler CA65) Has to offer is portable, better and eaiser than any other assembler I have seen, and is still in active development!

The banks are not screwy as in WLA-DX NES-wise, and X816 users simply can convert to CC65's CA65 with fewer modifications.

_________________
AKA SmilyMZX/AtariHacker.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: lidnariq and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group