For my fellow newbs in 7800 programming
Started by sgrddy, Sep 14 2009 9:48 PM
16 replies to this topic
#1
Posted Mon Sep 14, 2009 9:48 PM
Greetings all. I managed to compile the sprite demo by Dan Boris on my PC and get it to run. I have Windows 7 (64bit release candidate). I used DASM (the assembler) as was indicated in the source code. Since DASM will not run on Windows 7, I downloaded and installed DOSBOX. The "Make" file would not run, but I was able to compile the source code with the following:
C:\DASM>dasm 78db.s -f3 -o78db.bin -l78db.lst
"78db.s" is what I called the source file that I downloaded from Dan Boris's 7800 tech page. I don't know exactly the significance of the "-f3", but the "-o78db.bin" results in an output file "78db.bin" that can be loaded into the 7800 Prosystem emulator. I also don't know if it is necessary to type the "-l78db.lst" part or not.
I know the veterans are probably chuckling at this, but my programming experience is limited to C/C++ and various flavors of BASIC, and it has been ages since I have done any of that.
C:\DASM>dasm 78db.s -f3 -o78db.bin -l78db.lst
"78db.s" is what I called the source file that I downloaded from Dan Boris's 7800 tech page. I don't know exactly the significance of the "-f3", but the "-o78db.bin" results in an output file "78db.bin" that can be loaded into the 7800 Prosystem emulator. I also don't know if it is necessary to type the "-l78db.lst" part or not.
I know the veterans are probably chuckling at this, but my programming experience is limited to C/C++ and various flavors of BASIC, and it has been ages since I have done any of that.
#2
Posted Mon Sep 14, 2009 9:54 PM
All the DASM related commands are in the DASM manual. So the bin file worked in the emulator? What is your specific question?
Allan
Allan
#3
Posted Tue Sep 15, 2009 3:39 AM
sgrddy, on Mon Sep 14, 2009 9:48 PM, said:
I know the veterans are probably chuckling at this, but my programming experience is limited to C/C++ and various flavors of BASIC, and it has been ages since I have done any of that.
#4
Posted Tue Sep 15, 2009 4:53 AM
GroovyBee, on Tue Sep 15, 2009 3:39 AM, said:
sgrddy, on Mon Sep 14, 2009 9:48 PM, said:
I know the veterans are probably chuckling at this, but my programming experience is limited to C/C++ and various flavors of BASIC, and it has been ages since I have done any of that.
Hmm, C development system for the 7800. That sounds very interesting. Is it available for public use? Can you elaborate a bit?
tjb
#5
Posted Tue Sep 15, 2009 5:13 AM
tjb, on Tue Sep 15, 2009 4:53 AM, said:
Hmm, C development system for the 7800. That sounds very interesting. Is it available for public use? Can you elaborate a bit?
My first homebrew game Wasp! was written using it. The announcement is here :-
http://www.atariage....w-with-a-twist/
It was also used to make Harry's Hen House (which is still a work in progress and needs to be completed). Originally both of those games would only work in the emulator but that problem has long been solved and they both work on real hardware using my CC2.
The dev system is not available yet because I need to write some demo applications to show developers how to write a game framework using it. There is no documentation apart from header files either
It will also come with a graphics conversion tool that takes windows bitmap files and converts them into 160A, 160B and 320A display formats.
#6
Posted Tue Sep 15, 2009 5:18 AM
GroovyBee, on Tue Sep 15, 2009 3:39 AM, said:
sgrddy, on Mon Sep 14, 2009 9:48 PM, said:
I know the veterans are probably chuckling at this, but my programming experience is limited to C/C++ and various flavors of BASIC, and it has been ages since I have done any of that.
--Selgus
#7
Posted Tue Sep 15, 2009 5:35 AM
selgus, on Tue Sep 15, 2009 5:18 AM, said:
Is this based on the CC65 project, or something you started from scratch? Always wondered how clean/tight the machine code generated was from CC65? I have seen some peephole optimizers written for the backend though, so had kind of an idea what the output would look like.
Yep! I used the standard CC65 release. There is custom start-up code that detects the TV mode, puts the 7800 into 7800 mode, detects POKEY etc. You can even use malloc and free if you want
CC65 is good on some things and bad on others. I tend to write code that suits the target hardware and compiler system. If you don't continually think "its only 8 bits" while you're writing code you'll come unstuck.
My 7800 graphics library is nearly 100% 6502 assembler. This allows the game's logic and AI to be written in "C".
#8
Posted Tue Sep 15, 2009 5:45 AM
Allan, on Mon Sep 14, 2009 9:54 PM, said:
All the DASM related commands are in the DASM manual. So the bin file worked in the emulator? What is your specific question?
Allan
Allan
Yeah the bin file worked with the emulator. I don't have any specific question. It was just informational.
Yeah, I looked at that manual.
Edited by sgrddy, Tue Sep 15, 2009 5:46 AM.
#9
Posted Tue Sep 15, 2009 6:34 AM
sgrddy, on Tue Sep 15, 2009 5:45 AM, said:
Allan, on Mon Sep 14, 2009 9:54 PM, said:
All the DASM related commands are in the DASM manual. So the bin file worked in the emulator? What is your specific question?
Allan
Allan
Yeah the bin file worked with the emulator. I don't have any specific question. It was just informational.
Yeah, I looked at that manual.
Allan
#10
Posted Tue Sep 15, 2009 6:39 AM
GroovyBee, on Tue Sep 15, 2009 5:13 AM, said:
tjb, on Tue Sep 15, 2009 4:53 AM, said:
Hmm, C development system for the 7800. That sounds very interesting. Is it available for public use? Can you elaborate a bit?
My first homebrew game Wasp! was written using it. The announcement is here :-
http://www.atariage....w-with-a-twist/
It was also used to make Harry's Hen House (which is still a work in progress and needs to be completed). Originally both of those games would only work in the emulator but that problem has long been solved and they both work on real hardware using my CC2.
The dev system is not available yet because I need to write some demo applications to show developers how to write a game framework using it. There is no documentation apart from header files either
It will also come with a graphics conversion tool that takes windows bitmap files and converts them into 160A, 160B and 320A display formats.
That sounds really cool. I look forward to checking it out. I'm somewhat familar with Wasp! (I ordered a copy
tjb
#11
Posted Wed Sep 16, 2009 10:40 AM
sgrddy, on Mon Sep 14, 2009 9:48 PM, said:
C:\DASM>dasm 78db.s -f3 -o78db.bin -l78db.lst
"78db.s" is what I called the source file that I downloaded from Dan Boris's 7800 tech page. I don't know exactly the significance of the "-f3", but the "-o78db.bin" results in an output file "78db.bin" that can be loaded into the 7800 Prosystem emulator. I also don't know if it is necessary to type the "-l78db.lst" part or not.
"78db.s" is what I called the source file that I downloaded from Dan Boris's 7800 tech page. I don't know exactly the significance of the "-f3", but the "-o78db.bin" results in an output file "78db.bin" that can be loaded into the 7800 Prosystem emulator. I also don't know if it is necessary to type the "-l78db.lst" part or not.
Edited by EricBall, Wed Sep 16, 2009 10:40 AM.
#12
Posted Wed Sep 16, 2009 10:45 AM
EricBall, on Wed Sep 16, 2009 10:40 AM, said:
The -l78db.lst creates a list file, which will show you the specific address & bytes your code assembled to. It's not required if you write bug free code.
Similarly, -f3 specifes the error message verbosity. IIRC -f3 is almost required to get any useful info.
#13
Posted Wed Sep 16, 2009 6:55 PM
EricBall, on Wed Sep 16, 2009 10:40 AM, said:
The -l78db.lst creates a list file, which will show you the specific address & bytes your code assembled to. It's not required if you write bug free code.
GroovyBee, on Wed Sep 16, 2009 10:45 AM, said:
I think you meant to say -vN because -fN sets the output file format.
I saw those things about verbosity and list files in the electronic document that came with DASM. The manual didn't make a huge impression on me as to what I was then supposed to do with that or even how to pick one over the other.
Actually, if any of you guys know, would it be possible to assemble that exact same source file with Madmac?
Edited by sgrddy, Wed Sep 16, 2009 6:56 PM.
#14
Posted Wed Sep 16, 2009 6:58 PM
sgrddy, on Wed Sep 16, 2009 6:55 PM, said:
Actually, if any of you guys know, would it be possible to assemble that exact same source file with Madmac?
I can't help you with that
EDIT: Spelling.
Edited by GroovyBee, Thu Sep 17, 2009 3:33 AM.
#15
Posted Wed Sep 16, 2009 7:28 PM
GroovyBee, on Wed Sep 16, 2009 6:58 PM, said:
Well, I guess I could always give it a shot. I have a Falcon and a few STs, and STeem.
Update 9/17:
I tried to compile it with MadMac on Steem, but got tons of errors. I changed the processor line to ".6502" as stated in the MadMac reference manual. I thought perhaps the comments might be the cause, but the reference manual said comments with a semicolon were fine. I'll update again as I make progress.
Edited by sgrddy, Thu Sep 17, 2009 11:25 AM.
#16
Posted Wed Jan 13, 2010 1:32 PM
sgrddy, on Mon Sep 14, 2009 9:48 PM, said:
Greetings all. I managed to compile the sprite demo by Dan Boris on my PC and get it to run. I have Windows 7 (64bit release candidate). I used DASM (the assembler) as was indicated in the source code. Since DASM will not run on Windows 7, I downloaded and installed DOSBOX. The "Make" file would not run, but I was able to compile the source code with the following:
C:\DASM>dasm 78db.s -f3 -o78db.bin -l78db.lst
"78db.s" is what I called the source file that I downloaded from Dan Boris's 7800 tech page. I don't know exactly the significance of the "-f3", but the "-o78db.bin" results in an output file "78db.bin" that can be loaded into the 7800 Prosystem emulator. I also don't know if it is necessary to type the "-l78db.lst" part or not.
I know the veterans are probably chuckling at this, but my programming experience is limited to C/C++ and various flavors of BASIC, and it has been ages since I have done any of that.
C:\DASM>dasm 78db.s -f3 -o78db.bin -l78db.lst
"78db.s" is what I called the source file that I downloaded from Dan Boris's 7800 tech page. I don't know exactly the significance of the "-f3", but the "-o78db.bin" results in an output file "78db.bin" that can be loaded into the 7800 Prosystem emulator. I also don't know if it is necessary to type the "-l78db.lst" part or not.
I know the veterans are probably chuckling at this, but my programming experience is limited to C/C++ and various flavors of BASIC, and it has been ages since I have done any of that.
Any veteran that chuckles at you ought to hang his head in shame. They were once noobs too
and should be a bit more sensitive to what you are dealing with. I use a batch file too.
No biggy. Make files are over rated, especially for something like assembler on the 7800.
It's not like you are dealing with a trillion C files so the KISS method works fine here.
the -l outputs an assembly listing to let you know how the assembler is dealing with the source.
you dont really need it but I find them helpful. I have never met anyone that can write bug free
code. If they exsist, they certainly are not working for MS.
Though I may be a coding veteran, I certainly do not consider myself one concerning the 7800.
Edited by Gorf, Wed Jan 13, 2010 1:35 PM.
#17
Posted Mon Sep 13, 2010 1:41 PM
I also use Windows 7 64-bit. But, I don't use a DOSBOX and I have not had any issues with DASM. I simply use Windows' CMD window to compile my programs.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users














