Jump to content

Photo

Programming a game - concepts


17 replies to this topic

#1 Xebec OFFLINE  

Xebec

    Chopper Commander

  • 105 posts

Posted Thu Apr 20, 2017 8:18 AM

Hi folks!

 

I'm a seriously unskilled programmer, and had a few basic questions about programming on the Atari 8-bit..

 

First is - when you're writing a game with background music that plays continuously while the game is running -- how often do you have to update POKEY to change tunes?  is it literally every time you want to change a note?  or can you send a series of instructions and come back later?  Is there some good place to read about this?

 

Second - C is what I used to write in years ago.. any real 'gotchas' writing applications or programs for the atari 800 in 'C' today?  any reason to throw 'C' in the trash and go with a different language?  (I'm assuming that certain 'advanced' routines may require some custom assembly code inserted of course)..

 

Finally - what are some good sources/books to read up on this kind of stuff - including code examples of the atari doing graphics, sound, and processing of logic at the same time?  (in any language)..

 

Thanks :)

 

John



#2 jvas OFFLINE  

jvas

    Moonsweeper

  • 391 posts
  • Location:Budapest, Hungary (Europe)

Posted Thu Apr 20, 2017 9:11 AM

http://www.wudsn.com...ri800/tutorials



#3 Xebec OFFLINE  

Xebec

    Chopper Commander

  • Topic Starter
  • 105 posts

Posted Thu Apr 20, 2017 10:40 AM

Excellent - thanks jvas!



#4 baktra OFFLINE  

baktra

    Moonsweeper

  • 252 posts
  • Location:Czech republic

Posted Thu Apr 20, 2017 12:06 PM

Second - C is what I used to write in years ago.. any real 'gotchas' writing applications or programs for the atari 800 in 'C' today?  any reason to throw 'C' in the trash and go with a different language?  (I'm assuming that certain 'advanced' routines may require some custom assembly code inserted of course)..

 

For any serious game programming for 8-bit Atari, you will need to combine C with assembler.

 

 

In general, it all depends on what games you want to create.

 

For board, logic, quiz games or simple platform games, you can try TURBOBASIC XL, C (with some assembler), or even Atari BASIC

For fast-paced action games that need to push the computer hard, you will have to resort to assembler. With WUDSN, macros, and MADS, it is not so bad choice.



#5 Xebec OFFLINE  

Xebec

    Chopper Commander

  • Topic Starter
  • 105 posts

Posted Thu Apr 20, 2017 12:08 PM

 

For any serious game programming for 8-bit Atari, you will need to combine C with assembler.

 

 

In general, it all depends on what games you want to create.

 

For board, logic, quiz games or simple platform games, you can try TURBOBASIC XL, C (with some assembler), or even Atari BASIC

For fast-paced action games that need to push the computer hard, you will have to resort to assembler. With WUDSN, macros, and MADS, it is not so bad choice.

 

I'm considering a variant on something like Ultima - so some ability to move a good portion of the screen with custom tiles, without taking 5 seconds to update the screen :).  (+ play music in the background and sounds when actions happen).  



#6 baktra OFFLINE  

baktra

    Moonsweeper

  • 252 posts
  • Location:Czech republic

Posted Thu Apr 20, 2017 12:30 PM

 

I'm considering a variant on something like Ultima - so some ability to move a good portion of the screen with custom tiles, without taking 5 seconds to update the screen :).  (+ play music in the background and sounds when actions happen).  

Could be a good candidate for C (game engine) with ASM (painting, MSX, SFX).

I assume that by C, you mean CC65.



#7 Xebec OFFLINE  

Xebec

    Chopper Commander

  • Topic Starter
  • 105 posts

Posted Thu Apr 20, 2017 12:32 PM

Could be a good candidate for C (game engine) with ASM (painting, MSX, SFX).

I assume that by C, you mean CC65.

 

I'm open for recommendations on a specific C - I will be able to watch the tutorial videos above this evening / start looking into the languages a little more then.  



#8 baktra OFFLINE  

baktra

    Moonsweeper

  • 252 posts
  • Location:Czech republic

Posted Thu Apr 20, 2017 2:28 PM

 

I'm open for recommendations on a specific C - I will be able to watch the tutorial videos above this evening / start looking into the languages a little more then.  

Then I would recommend CC65 for cross-platform development  :)

 

There are C compilers running on Atari, but they are somehow cumbersome to use - you either need lot of patience (because compiler and linker tend to be separate programs reading/writing a lot to/from floppies) or RAMDISK. What is more, 40-column screen is not exactly comfortable for writing programs in C.

 

CC65 can use computational power of today's PCs to generate optimized code. The 6502 CPU is not very friendly to C - not much support for linkage stack, but if you adapt certain coding style, it is good. And you can force Visual Studio or NetBeans to cooperate with cc65.

 

 

Take a look at this thread - games with C source code included.


Edited by baktra, Thu Apr 20, 2017 2:30 PM.


#9 _The Doctor__ OFFLINE  

_The Doctor__

    River Patroller

  • 2,043 posts
  • Location:10-0-11-00:02

Posted Thu Apr 20, 2017 3:23 PM

Bellcom ACE-C wasn't too bad back int the day but you need to be aware of some of their implementations as well. Gotta read their docs thoroughly...



#10 Paul Westphal OFFLINE  

Paul Westphal

    Stargunner

  • 1,138 posts
  • Location:Portland, Oregon

Posted Thu Apr 20, 2017 8:55 PM

Look on eBay, there are new copies of light-speed C.

#11 _The Doctor__ OFFLINE  

_The Doctor__

    River Patroller

  • 2,043 posts
  • Location:10-0-11-00:02

Posted Thu Apr 20, 2017 10:07 PM

http://www.atarimaga...programming.php

http://www.atarimaga...programming.php

https://atariage.com...ler-for-a-6502/

http://atariage.com/...-use/?p=2851371

http://atariage.com/...s-a-whitepaper/

 

Lightspeed C is an improved ACE-C same guy wrote both.... so Paul makes the perfect suggestion if your moving up please read the first link, if you have a double sided double density drive... or any large storage solution, put it all together, what once was 'considered' huge by some is easily manageable on the Atari today and actually was back then as well just not for everyone...

 

Please read the first two links then the white paper then the forum links


Edited by _The Doctor__, Thu Apr 20, 2017 10:17 PM.


#12 576XE OFFLINE  

576XE

    Dragonstomper

  • 690 posts
  • Location:Moscow, Russia

Posted Thu Apr 20, 2017 10:34 PM

I love PL65, but it lacks of 'records' data structure.

I think it may be achived with internal assembler (like access to CIO) but never seen codes.

 

Anyway, I personally prefere 'logistic' style games like "Swards and Souls" FE.

Step by step I earn/learn abilities by my choice and then move to next level.

 

Robbo itself is fantastically versatile game but lacks of logistic.

It may be the ultimate base of some logistic game.

(I mean deliveryng some needed ability at a time...)

 

It's my opinion only of course :)

ez



#13 Xebec OFFLINE  

Xebec

    Chopper Commander

  • Topic Starter
  • 105 posts

Posted Fri Apr 21, 2017 5:56 AM

Wow - this is a gold mine of info!  The whitepaper on 'efficient C code for 8-bit microcontrollers' is quite handy for a lot of things (Arduino included).  Thanks all!

 

On CC65 - One of the links above states "CC65 doesn't presently support Atari-specific features such as graphics and sound."

 

I assume this means to access said specific features you'd be writing those functions in assembler?  For example, the music playing routine for a game, or if you're using NTSC artifacting to add colors to a display (ala Ultima)?  (or having two resolutions so you can splash a few additional colors say at the bottom of the screen vs. the 'main display' at the top?)

 

I assume Lightspeed C (with appropriate documentation) would have all of these capabilities built in, without resorting to full assembler code ?



#14 Philsan OFFLINE  

Philsan

    River Patroller

  • 3,265 posts
  • New Orleans Saints Super Bowl XLIV Champions
  • Location:Switzerland

Posted Fri Apr 21, 2017 6:11 AM

There's a RMT music playing routine for Turbo-Basic XL.

#15 popmilo OFFLINE  

popmilo

    Stargunner

  • 1,368 posts
  • Location:Senta, Srbija

Posted Fri Apr 21, 2017 6:22 AM

First is - when you're writing a game with background music that plays continuously while the game is running -- how often do you have to update POKEY to change tunes?  is it literally every time you want to change a note?  or can you send a series of instructions and come back later?  Is there some good place to read about this?

Hi and congrats for a new game development :)

 

Standard route for Atari music is RMT tracker. All you need is to include some source files in your project (init+play routine). Then it all depends on your song file. Depending on "song speed" (parameter set by musician in track) you need to call "play_music" routine 1 or more times per frame. In practice it means you mostly call that routine from your IRQ routine or display list interrupt routine.

 

Tracks can contain sound effects and you can call them when you need. You put index of SFX in memory location and call something like "play_sfx"...

 

Downloads here:

http://raster.infos....ari/rmt/rmt.htm

 

There are example tracks and asm source files in that archive. How to exactly do it is here on AA in some topics. Look it up and if you get stuck just ask :)



#16 baktra OFFLINE  

baktra

    Moonsweeper

  • 252 posts
  • Location:Czech republic

Posted Fri Apr 21, 2017 9:46 AM

On CC65 - One of the links above states "CC65 doesn't presently support Atari-specific features such as graphics and sound."

 

That is a very strong statement, but not exactly a false one. With the C programming language  you cannot do much - manipulate data in memory and control the flow of your program. No more, no less.

The key is that C allows to have libraries of functions written in C, assembler, or other languages.

 

CC65 is shipped with a library that provides minimum support for Atari. You can refer to the atari.h header file to see what is available.

 

There can be other C-language based development suites that have libraries of functions supporting 8-bit Atari computers specifically, of course. But you can bet that the library functions are written in assembler. You can benefit from them.

 

Is absence of thorough 8-bit Atari support in CC65 a big problem? Maybe! Try Curse of the Lost Miner - this game has full graphics and sprites. If you check the source code, you can see that there is no assembly code for graphics and sprites. Because creation of graphics and sprites on Atari is just nothing else than moving the right bytes to the right address space locations. And you can do so just with pointers, memset(), memcpy(), and memmove(). If you use raster interrupts, you must write the interrupt handlers in assembler. But no library can help you with that anyway (unless there is a very special one).

 

If I sound like a promoter of CC65, then it is because I am a promoter of CC65  :)


Edited by baktra, Fri Apr 21, 2017 9:59 AM.


#17 Irgendwer OFFLINE  

Irgendwer

    Stargunner

  • 1,110 posts
  • Location:Germany

Posted Fri Apr 21, 2017 10:28 AM

For example, the music playing routine for a game, or if you're using NTSC artifacting to add colors to a display (ala Ultima)? 

 

You can find an example for RMT replay in cc65 here:

 

http://atariage.com/...n/#entry3720477

 

(please note the small corrections I made there later on)



#18 baktra OFFLINE  

baktra

    Moonsweeper

  • 252 posts
  • Location:Czech republic

Posted Fri Apr 21, 2017 11:19 PM

By the way, what is the status of the Atalan and Mad Pascal projects?






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users