Jump to content
IGNORED

For my fellow newbs in 7800 programming


sgrddy

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 icon_wink.gif. 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

Link to comment
Share on other sites

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.com/forums/topic/141817-wasp-7800-homebrew-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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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".

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 icon_sad.gif. 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 icon_smile.gif ) 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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

 

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.

 

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 3 months later...

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
Link to comment
Share on other sites

  • 8 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...