Jump to content

For my fellow newbs in 7800 programming


16 replies to this topic

#1  

    Star Raider

  • 85 posts
  • Joined: 20-July 09
  • Location:McMurray, PA

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.

#2  

    River Patroller

  • 4,151 posts
  • Joined: 11-June 01
  • Location:Wallingford, CT

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

#3  

    7800 Developer

  • 5,461 posts
  • Joined: 20-November 08
  • Busy bee!
  • Location:North, England

Posted Tue Sep 15, 2009 3:39 AM

View Postsgrddy, 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.
No chuckling from this one ;). I'm still trying to find the time to do some game demos so people can get going with my "C" development system for the 7800.

#4  

    Dragonstomper

  • 981 posts
  • Joined: 24-February 06
  • Let's play soccer
  • Location:San Antonio, Texas

Posted Tue Sep 15, 2009 4:53 AM

View PostGroovyBee, on Tue Sep 15, 2009 3:39 AM, said:

View Postsgrddy, 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.
No chuckling from this one Posted Image. I'm still trying to find the time to do some game demos so people can get going with my "C" development system for the 7800.

Hmm, C development system for the 7800. That sounds very interesting. Is it available for public use? Can you elaborate a bit?

tjb

#5  

    7800 Developer

  • 5,461 posts
  • Joined: 20-November 08
  • Busy bee!
  • Location:North, England

Posted Tue Sep 15, 2009 5:13 AM

View Posttjb, 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 :(. I'm also thinking about making it use a more flexible approach to display lists from the stuff I've learnt writing my first two games.

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  

    Moonsweeper

  • 293 posts
  • Joined: 25-November 08
  • Location:Orlando, Florida

Posted Tue Sep 15, 2009 5:18 AM

View PostGroovyBee, on Tue Sep 15, 2009 3:39 AM, said:

View Postsgrddy, 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.
No chuckling from this one ;). I'm still trying to find the time to do some game demos so people can get going with my "C" development system for the 7800.
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.
--Selgus

#7  

    7800 Developer

  • 5,461 posts
  • Joined: 20-November 08
  • Busy bee!
  • Location:North, England

Posted Tue Sep 15, 2009 5:35 AM

View Postselgus, 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 :lol:. It is also possible to use "C" in the interrupt handlers (using my library).

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  

    Star Raider

  • 85 posts
  • Joined: 20-July 09
  • Location:McMurray, PA

Posted Tue Sep 15, 2009 5:45 AM

View PostAllan, 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

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  

    River Patroller

  • 4,151 posts
  • Joined: 11-June 01
  • Location:Wallingford, CT

Posted Tue Sep 15, 2009 6:34 AM

View Postsgrddy, on Tue Sep 15, 2009 5:45 AM, said:

View PostAllan, 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

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.
Cool. Let us know how you progress. I started playing around with Dan's demo but then I got side-tracked and haven't got back to it yet. Hopefully soon.

Allan

#10  

    Dragonstomper

  • 981 posts
  • Joined: 24-February 06
  • Let's play soccer
  • Location:San Antonio, Texas

Posted Tue Sep 15, 2009 6:39 AM

View PostGroovyBee, on Tue Sep 15, 2009 5:13 AM, said:

View Posttjb, 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 Posted Image. I'm also thinking about making it use a more flexible approach to display lists from the stuff I've learnt writing my first two games.

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 Posted Image ) but I came in kind of at the tail-end and honestly didn't bother to read the thread from top to bottom. Sounds like I need to.

tjb

#11  

    Dragonstomper

  • 709 posts
  • Joined: 06-September 02
  • Location:Markham, Ontario, Canada

Posted Wed Sep 16, 2009 10:40 AM

View Postsgrddy, 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.
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.

Edited by EricBall, Wed Sep 16, 2009 10:40 AM.


#12  

    7800 Developer

  • 5,461 posts
  • Joined: 20-November 08
  • Busy bee!
  • Location:North, England

Posted Wed Sep 16, 2009 10:45 AM

View PostEricBall, 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.
I think you meant to say -vN because -fN sets the output file format.

#13  

    Star Raider

  • 85 posts
  • Joined: 20-July 09
  • Location:McMurray, PA

Posted Wed Sep 16, 2009 6:55 PM

View PostEricBall, 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.


View PostGroovyBee, 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  

    7800 Developer

  • 5,461 posts
  • Joined: 20-November 08
  • Busy bee!
  • Location:North, England

Posted Wed Sep 16, 2009 6:58 PM

View Postsgrddy, 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 :(. I only use CC65 and DASM for my 6502 projects.

EDIT: Spelling.

Edited by GroovyBee, Thu Sep 17, 2009 3:33 AM.


#15  

    Star Raider

  • 85 posts
  • Joined: 20-July 09
  • Location:McMurray, PA

Posted Wed Sep 16, 2009 7:28 PM

View PostGroovyBee, on Wed Sep 16, 2009 6:58 PM, said:

View Postsgrddy, 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 :(. I'm only use CC65 and DASM for my 6502 projects.

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  

    River Patroller

  • 4,633 posts
  • Joined: 24-April 03

Posted Wed Jan 13, 2010 1:32 PM

View Postsgrddy, 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.


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. :P

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  

    Moonsweeper

  • 336 posts
  • Joined: 25-March 08
  • Location:Moberly, Missouri

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