Need Help Converting A Nerdy Nights Tutorial to ASM6

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

That_Nintendo_Guy
Posts: 9
Joined: Wed Jan 07, 2015 11:24 am
Location: Where I am standing right now

Re: Need Help Converting A Nerdy Nights Tutorial to ASM6

Post by That_Nintendo_Guy » Thu Jan 08, 2015 3:47 pm

1. To be honest, yeah, the netbook would be really nice.
2. Well, I DO want to make games for it as well. If you read my OP you would know that.
3. I'm able to use ASM6 because SNGamer compiled s version that will work with Android assuming you have a command line tool to run it with on your device (which I do). Link to thread: viewtopic.php?p=132765
*Also, I dont see how you could find sequencers painful :) Well, I mean, I guess it depends on the kind of sequencer, what features it has, and how it's laid out... Like, threre is obviously a world of a difference between tracker based programs such as ModPlugTracker or Cybertracker versus apps like Caustic or Reason.

User avatar
koitsu
Posts: 4218
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Need Help Converting A Nerdy Nights Tutorial to ASM6

Post by koitsu » Thu Jan 08, 2015 3:59 pm

I put in an order for an AC adapter (only $8 off Amazon), and once I get that / reformat the thing / verify the MHDD hasn't developed any problems / reinstall the OS, I'd be happy to send it to you free of charge. It'll probably be a lot easier to develop on, although it's not really much of a power-house (older Atom CPU, built-in Intel graphics with (AFAIK) no 3D acceleration, etc.), but I imagine it'll make for a better development environment than a tablet. :-)

That_Nintendo_Guy
Posts: 9
Joined: Wed Jan 07, 2015 11:24 am
Location: Where I am standing right now

Re: Need Help Converting A Nerdy Nights Tutorial to ASM6

Post by That_Nintendo_Guy » Thu Jan 08, 2015 4:15 pm

Yeah, but I mean, it really doesn't take that much power to develop a NES game, so I wouldnt need all that other stuff anyway :).

tepples
Posts: 22014
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Need Help Converting A Nerdy Nights Tutorial to ASM6

Post by tepples » Thu Jan 08, 2015 5:08 pm

koitsu wrote:P.S. -- How is it you're able to run asm6, which is a Win32 executable, on Android then?
Apps that only read stdin and files and only write stdout and files can be recompiled to run under Bionic, the POSIX-style C support library of Android.
\Would a netbook interest you? Say, a Dell Inspiron Mini 10? I have one [...] and I'd be happy to donate it to you. It runs Windows XP.
Windows XP is no longer supported with security fixes but you can always wipe it and Linux it. I run Xubuntu on my own Dell Inspiron mini 1012, on which I made Thwaite, Zap Ruder, Action 53 menu, and RHDE. And for the past couple years, Wine has correctly run ModPlug, FamiTracker, and FCEUX for Windows
That_Nintendo_Guy wrote:Like, threre is obviously a world of a difference between tracker based programs such as ModPlugTracker or Cybertracker versus apps like Caustic or Reason.
FamiTracker is a lot like ModPlug Tracker, except you define instruments as frame-by-frame envelopes instead of samples. And there's a text export tool, so if you know Python, Perl, C++, or any other language for doing text processing, you can massage your FTM into a format that any music engine can use.

mikaelmoizt
Posts: 120
Joined: Sat Apr 12, 2014 12:11 pm
Location: Gothenburg, Sweden

Re: Need Help Converting A Nerdy Nights Tutorial to ASM6

Post by mikaelmoizt » Fri Jan 09, 2015 1:54 pm

All right then.. after about 2 hours of looking into this, it will assemble and (kinda) run. It runs on ecstacy right now :P
So there are still a few of things to work on here
  • Data/code mixed together (almost fixed I think)
    Joypad code does not execute what so ever, do not know why
    A biiig nasty mixup of immediate (#) and absolute ($) values (fixed now I hope)
    Include files now inserted into main file, split it up into smaller files once everything works
    Changing some .word, .dsb to dw and other things
    Organizing layout to constants -> code -> data
Now you can carry on working with on this.
Attachments
reconstructed.asm
(35.55 KiB) Downloaded 144 times
I´ve got %01100011 problems but the BITs aint one.

User avatar
koitsu
Posts: 4218
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Need Help Converting A Nerdy Nights Tutorial to ASM6

Post by koitsu » Sat Jan 10, 2015 5:11 pm

AC adapter arrived today, netbook is charging. :D

Edit: ...or not. Looks like the battery won't hold charge according to the power LED indicator. Sad panda. So a replacement battery has been purchased (2x the capacity too, though it sticks out the back of the netbook a bit more due to the added cells but oh well -- more lifespan when in use!).

Kind of amusing too: when it powers on, the first thing it complains about is the "battery not being identifiable" and forces you to press F1 (this never goes away). Supposedly this is fixed in a BIOS update. But the BIOS update won't work because the battery can't hold charge (DOS flash utility demands the battery have at least 10% charge, even if the AC charger is plugged in). *shakes head*

That_Nintendo_Guy
Posts: 9
Joined: Wed Jan 07, 2015 11:24 am
Location: Where I am standing right now

Re: Need Help Converting A Nerdy Nights Tutorial to ASM6

Post by That_Nintendo_Guy » Sat Jan 10, 2015 11:11 pm

Joypad code does not execute what so ever, do not know why
Maybe because in the code you gave me, the variables declared for the controller reading routine are commented out? :D (unless that's the reason you commented them out, because it doesn't work)
*wow, I thought I posted this yesterday... Guess not :)
**Oh, maybe another reason for the input codes misbehaving is because it is in the reset vector and not the NMI code? I dunno, maybe that's some sort of more advanced technique that I dont know about yet, but it still looks sort of odd to me.
***Scratch that. It would appear that you moved it out of there... I need to learn to read better :l
Last edited by That_Nintendo_Guy on Sun Jan 11, 2015 1:37 pm, edited 2 times in total.

mikaelmoizt
Posts: 120
Joined: Sat Apr 12, 2014 12:11 pm
Location: Gothenburg, Sweden

Re: Need Help Converting A Nerdy Nights Tutorial to ASM6

Post by mikaelmoizt » Sun Jan 11, 2015 2:58 am

That_Nintendo_Guy wrote: (unless that's the reason you commented them out, because it doesn't work)
Bingo :wink:
I also find it really hard to debug something that looks like this

Code: Select all

 ENUM $0000   
 joypad1: dsb 1 
 joypad1_old: dsb 1 
 joypad1_pressed: dsb 1 
 sleeping: dsb 1                       
 needdraw: dsb 1 
 dbuffer_index: dsb 1 
 ptr1: dsb 2
 sound_ptr: dsb 2 
 sound_ptr2: dsb 2 
 current_song: dsb 1 
 ENDE
instead of

Code: Select all

joypad equ $0
joypad1_old equ $1
(...)
but thats just me perhaps
I´ve got %01100011 problems but the BITs aint one.

User avatar
tokumaru
Posts: 11744
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Need Help Converting A Nerdy Nights Tutorial to ASM6

Post by tokumaru » Sun Jan 11, 2015 8:37 am

mikaelmoizt wrote:I also find it really hard to debug something that looks like this
It's easier to maintain. Consider you have a big game, with hundreds of variables, and late into development you decide that a certain variable needs to be 16-bit instead of 8. What's easier, adding 1 to the addresses of the 100+ variables that follow it or simply changing the .dsb 1 to .dsb 2? You're completely free to move your variables around, adding or removing some, without bothering to rewrite all the addresses every time you do.

If you really need the addresses for debugging purposes, you can generate a listing file when assembling, and that file will contain all the addresses in a way you can easily read.

Celius
Posts: 2157
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Re: Need Help Converting A Nerdy Nights Tutorial to ASM6

Post by Celius » Mon Jan 12, 2015 2:48 pm

tokumaru wrote:It's easier to maintain. Consider you have a big game, with hundreds of variables, and late into development you decide that a certain variable needs to be 16-bit instead of 8. What's easier, adding 1 to the addresses of the 100+ variables that follow it or simply changing the .dsb 1 to .dsb 2? You're completely free to move your variables around, adding or removing some, without bothering to rewrite all the addresses every time you do..
This is definitely true, but I have to say, I find myself looking at RAM values often enough where trying to count bytes in a list of .dsb statements would drive me insane. Personally, I've found it to be worthwhile to hardcode the memory addresses for this reason. Is there some other process you use to work around that?

User avatar
tokumaru
Posts: 11744
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Need Help Converting A Nerdy Nights Tutorial to ASM6

Post by tokumaru » Mon Jan 12, 2015 2:55 pm

Celius wrote:Is there some other process you use to work around that?
The listing file will give you the final addresses of all variables.

Celius
Posts: 2157
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Re: Need Help Converting A Nerdy Nights Tutorial to ASM6

Post by Celius » Mon Jan 12, 2015 3:03 pm

The listing file will give you the final addresses of all variables.
Well that sounds easy! I'll have to see if WLA supports such a thing. Or, eventually switch to an assembler that has decent documentation.

User avatar
koitsu
Posts: 4218
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Need Help Converting A Nerdy Nights Tutorial to ASM6

Post by koitsu » Mon Jan 12, 2015 5:39 pm

Celius wrote:Well that sounds easy! I'll have to see if WLA supports such a thing. Or, eventually switch to an assembler that has decent documentation.
It looks like you need to use the -i flag during the assemble stage (e.g. wla-6502.exe) to generate the necessary info headers that the linker will use, followed by also using -i during the linking stage (e.g. wlalink.exe), which should generate a .lst list file. I only hope that it generates something useful and coherent (because the WLA DX docs often are not -- and that's why I gave up bothering with it, which is sad because it seems to be quite useful/powerful).

Reference: http://www.villehelin.com/wla.txt

See section 10 (Linking) and section 15 (WLA Flags).

mikaelmoizt
Posts: 120
Joined: Sat Apr 12, 2014 12:11 pm
Location: Gothenburg, Sweden

Re: Need Help Converting A Nerdy Nights Tutorial to ASM6

Post by mikaelmoizt » Tue Jan 13, 2015 9:10 am

tokumaru wrote: It's easier to maintain. (...). What's easier, adding 1 to the addresses of the 100+ variables that follow it or simply changing the .dsb 1 to .dsb 2? You're completely free to move your variables around, adding or removing some, without bothering to rewrite all the addresses every time you do.

If you really need the addresses for debugging purposes, you can generate a listing file when assembling, and that file will contain all the addresses in a way you can easily read.
I see. Thanks for clearing that up. Still learning new things here :wink: When looking at the list file from a small test I made

Code: Select all

enum $0000
joypad: dsb 1
test: dsb 2
frame: dsb 2
banana: dsb 1
apple: dsb 4
orange: dsb 8
ende
became

Code: Select all

                                enum $0000
00000                           joypad: dsb 1
00001                           test: dsb 2
00003                           frame: dsb 2
00005                           banana: dsb 1
00006                           apple: dsb 4
0000A                           orange: dsb 8
00012                           ende
So, that greatly simplifies things for me. The readme says db though. :!:
I´ve got %01100011 problems but the BITs aint one.

tepples
Posts: 22014
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Need Help Converting A Nerdy Nights Tutorial to ASM6

Post by tepples » Tue Jan 13, 2015 10:15 am

And if you're using ca65, passing the -m map.txt option to ld65 will create a file listing every symbol that's exported in one file and imported in another.

Post Reply