AtariAge Forums: For my fellow newbs in 7800 programming - AtariAge Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

For my fellow newbs in 7800 programming

User is offline sgrddy Icon
Posted Mon Sep 14, 2009 9:48 PM


  • Icon
  • Star Raider
  • PM this member
  • Posts: 72
  • Joined: 20-July 09
  • Location: McMurray, PA
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.
0

User is offline Allan Icon
Posted Mon Sep 14, 2009 9:54 PM


  • Icon
  • River Patroller
  • PM this member
  • View blog
  • Posts: 3,528
  • Joined: 11-June 01
  • Location: Wallingford, CT
All the DASM related commands are in the DASM manual. So the bin file worked in the emulator? What is your specific question?

Allan
0

User is offline GroovyBee Icon
Posted Tue Sep 15, 2009 3:39 AM

    • Busy bee!


  • Icon
  • River Patroller
  • PM this member
  • Posts: 2,092
  • Joined: 20-November 08
  • Location: North, England

View Postsgrddy, on Tue Sep 15, 2009 4:48 AM, 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.
0

User is offline tjb Icon
Posted Tue Sep 15, 2009 4:53 AM

    • Let's play soccer


  • Icon
  • Dragonstomper
  • PM this member
  • Posts: 840
  • Joined: 24-February 06
  • Location: San Antonio, Texas

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

View Postsgrddy, on Tue Sep 15, 2009 4:48 AM, 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
0

User is offline GroovyBee Icon
Posted Tue Sep 15, 2009 5:13 AM

    • Busy bee!


  • Icon
  • River Patroller
  • PM this member
  • Posts: 2,092
  • Joined: 20-November 08
  • Location: North, England

View Posttjb, on Tue Sep 15, 2009 11: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.
0

User is offline selgus Icon
Posted Tue Sep 15, 2009 5:18 AM


  • Icon
  • Moonsweeper
  • PM this member
  • Posts: 271
  • Joined: 25-November 08
  • Location: Orlando, Florida

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

View Postsgrddy, on Tue Sep 15, 2009 4:48 AM, 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
0

User is offline GroovyBee Icon
Posted Tue Sep 15, 2009 5:35 AM

    • Busy bee!


  • Icon
  • River Patroller
  • PM this member
  • Posts: 2,092
  • Joined: 20-November 08
  • Location: North, England

View Postselgus, on Tue Sep 15, 2009 12:18 PM, 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".
0

User is offline sgrddy Icon
Posted Tue Sep 15, 2009 5:45 AM


  • Icon
  • Star Raider
  • PM this member
  • Posts: 72
  • Joined: 20-July 09
  • Location: McMurray, PA

View PostAllan, on Mon Sep 14, 2009 11: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.

This post has been edited by sgrddy: Tue Sep 15, 2009 5:46 AM

0

User is offline Allan Icon
Posted Tue Sep 15, 2009 6:34 AM


  • Icon
  • River Patroller
  • PM this member
  • View blog
  • Posts: 3,528
  • Joined: 11-June 01
  • Location: Wallingford, CT

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

View PostAllan, on Mon Sep 14, 2009 11: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
0

User is offline tjb Icon
Posted Tue Sep 15, 2009 6:39 AM

    • Let's play soccer


  • Icon
  • Dragonstomper
  • PM this member
  • Posts: 840
  • Joined: 24-February 06
  • Location: San Antonio, Texas

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

View Posttjb, on Tue Sep 15, 2009 11: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
0

User is offline EricBall Icon
Posted Wed Sep 16, 2009 10:40 AM


  • Icon
  • Dragonstomper
  • PM this member
  • View blog
  • Posts: 674
  • Joined: 06-September 02
  • Location: Markham, Ontario, Canada

View Postsgrddy, on Mon Sep 14, 2009 11: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.

This post has been edited by EricBall: Wed Sep 16, 2009 10:40 AM

0

User is offline GroovyBee Icon
Posted Wed Sep 16, 2009 10:45 AM

    • Busy bee!


  • Icon
  • River Patroller
  • PM this member
  • Posts: 2,092
  • Joined: 20-November 08
  • Location: North, England

View PostEricBall, on Wed Sep 16, 2009 5:40 PM, 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.
0

User is offline sgrddy Icon
Posted Wed Sep 16, 2009 6:55 PM


  • Icon
  • Star Raider
  • PM this member
  • Posts: 72
  • Joined: 20-July 09
  • Location: McMurray, PA

View PostEricBall, on Wed Sep 16, 2009 12:40 PM, 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 12:45 PM, 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?

This post has been edited by sgrddy: Wed Sep 16, 2009 6:56 PM

0

User is offline GroovyBee Icon
Posted Wed Sep 16, 2009 6:58 PM

    • Busy bee!


  • Icon
  • River Patroller
  • PM this member
  • Posts: 2,092
  • Joined: 20-November 08
  • Location: North, England

View Postsgrddy, on Thu Sep 17, 2009 1:55 AM, 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.

This post has been edited by GroovyBee: Thu Sep 17, 2009 3:33 AM

0

User is offline sgrddy Icon
Posted Wed Sep 16, 2009 7:28 PM


  • Icon
  • Star Raider
  • PM this member
  • Posts: 72
  • Joined: 20-July 09
  • Location: McMurray, PA

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

View Postsgrddy, on Thu Sep 17, 2009 1:55 AM, 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.

This post has been edited by sgrddy: Thu Sep 17, 2009 11:25 AM

0

User is offline Gorf Icon
Posted Wed Jan 13, 2010 1:32 PM


  • Icon
  • River Patroller
  • PM this member
  • Posts: 4,525
  • Joined: 24-April 03

View Postsgrddy, on Mon Sep 14, 2009 10: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.
;)

This post has been edited by Gorf: Wed Jan 13, 2010 1:35 PM

0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


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