Jump to content

Photo

Need optimization tips & advices

atarix ide optimization

7 replies to this topic

#1 IuriNery OFFLINE  

IuriNery

    Space Invader

  • 10 posts

Posted Sat Feb 10, 2018 5:23 AM

Hello everyone,

 

I'm a beginner on Atari programming and I'm creating an IDE to allow people to create Atari games without having to write a single line of code. I'm learning Assembly as I go through the IDE and add more stuff, it's helping me a lot.

 

This is what I've got so far:

atarix.jpg

 

A simple IDE that lets you draw the playfield and change the color of both playfield (COLUPF) and background (COLUBK).

 

 

If you hit the "Play" button, it will produce the following result on an emulator:

atarix_result.jpg

 

This also generates an assembly code file, please take a look at this file to help me with the questions:

Attached File  atarix_result.asm   38.23KB   29 downloads

 

 

So, considering I've read a few articles about programming, I've come to a conclusion that every single line of code matters when you're programming for Atari. So I would like to ask a few questions:

 

1. Looking at the file (atarix_result.asm), is the generated code bad? What optimizations should I look forward? How can I optimize this code?

2. What kind of things should I avoid when drawing to the playfield?

3. Also, is there a way to get rid of the parts showed on the second screenshot? (Where the arrows point at). Or is this an expected behavior?

 

Thanks!

 

 


  • scitari likes this

#2 Nukey Shay OFFLINE  

Nukey Shay

    Sheik Yerbouti

  • 21,885 posts
  • Location:The land of Gorch

Posted Sat Feb 10, 2018 6:20 PM

Creating something as complex as a game without any programming experience is going to be pretty much impossible on the 2600.  Ultimately, you would be substituting one language (low-level assembly) for another (high-level Basic or something similar).  bBasic is currently the go-to method there.

 

 

Since you are just plugging values into the PF registers line-by-line, there is no need to use such a large kernel to do it.  You could cut this down by using an indexed loop.

  LDX #192
Loop:
   STA WYSNC
   LDA PF0data-1,X
   STA PF0
   LDA PF1data-1,X
   STA PF1
   LDA PF2data-1,X
   STA PF2
   DEX
   BNE Loop

...then include 3 192-byte data tables for the values.  Also, delay timing is going to be needed if you include an asymmetrical option (i.e differing PF values for the left and right halves of the screen).

 

But there is really no need to reinvent the wheel.  The TIA Playfield Painter already covers this.

 

 

Not sure what you are trying to indicate with the arrows...when the PF colors appear and are removed on the screen?  Relocating your VBLANK calls would be that solution.


Edited by Nukey Shay, Sat Feb 10, 2018 6:22 PM.


#3 IuriNery OFFLINE  

IuriNery

    Space Invader

  • Topic Starter
  • 10 posts

Posted Sat Feb 10, 2018 11:48 PM

Creating something as complex as a game without any programming experience is going to be pretty much impossible on the 2600.  Ultimately, you would be substituting one language (low-level assembly) for another (high-level Basic or something similar).  bBasic is currently the go-to method there.

 

 

Since you are just plugging values into the PF registers line-by-line, there is no need to use such a large kernel to do it.  You could cut this down by using an indexed loop.

  LDX #192
Loop:
   STA WYSNC
   LDA PF0data-1,X
   STA PF0
   LDA PF1data-1,X
   STA PF1
   LDA PF2data-1,X
   STA PF2
   DEX
   BNE Loop

...then include 3 192-byte data tables for the values.  Also, delay timing is going to be needed if you include an asymmetrical option (i.e differing PF values for the left and right halves of the screen).

 

But there is really no need to reinvent the wheel.  The TIA Playfield Painter already covers this.

 

 

Not sure what you are trying to indicate with the arrows...when the PF colors appear and are removed on the screen?  Relocating your VBLANK calls would be that solution.

Hi,

What I mean by creating a game without any programming experience is that the user will be able to add stuff to modify a default game template as they wish, my goal is to create something to prototype and introduce beginners into atari development.

 

Thanks for your suggestion about the indexed loop, is there a real difference on the final binary file using this method? Or is it only for making the code more compact?

 

I haven't heard about TIA Playfield Painter before, I would love to test it but it seems it's only available on DOS. Just to be clear, my IDE will be more than a playfield painter, the user will be able to add objets, manage actions and so on.

About the arrows, it seems that there are extra pixels on top/bottom of the screen whenever I test , I was asking if there was a way to remove/clear those pixels or if it's a normal behavior that happens when you play on an emulator.

 

Thanks for taking your time to answer my questions.



#4 tokumaru OFFLINE  

tokumaru

    Moonsweeper

  • 263 posts
  • Location:Rio de Janeiro - Brazil

Posted Sun Feb 11, 2018 12:10 AM

Creating something as complex as a game without any programming experience is going to be pretty much impossible on the 2600.

 
The approach used by NESmaker is to provide a number of complete game engines for various game genres, that users can customize via the supplied tools. A lot of non-coders appear to be into that kind of thing, judging by the success of the Kickstarter campaign!


  • IuriNery likes this

#5 IuriNery OFFLINE  

IuriNery

    Space Invader

  • Topic Starter
  • 10 posts

Posted Sun Feb 11, 2018 7:52 PM

Hi again,

 

I have fixed the problem with the Top/Bottom edges of the screen by adding COLUPF & COLUBK to the Vertical Blank/Overscan.

 

atarix_2.jpg

 

atarix_result_2.jpg

 

 

I've also added the suggestion made by Nukey Shay.

Here is the generated assembly file:

Attached File  atarix_result.asm   21.3KB   26 downloads

 

 

 
The approach used by NESmaker is to provide a number of complete game engines for various game genres, that users can customize via the supplied tools. A lot of non-coders appear to be into that kind of thing, judging by the success of the Kickstarter campaign!

Exactly! I have a lot of friends who would like to start making games for Atari but are too scared of Assembly.



#6 vidak OFFLINE  

vidak

    Moonsweeper

  • 458 posts
  • Location:Sydney, Australia

Posted Mon Feb 12, 2018 10:09 AM

I love this project, but Nukey is right about the limitations of the Atari 2600.

 

I agree that probably the best way forward for this project would be to have some set made kernels which beginners and drag and drop some limited customisation onto.

 

Like you could have a Tank game, a Defender-like game, a Jungle Hunt game... 

 

I guess I'm also a lot stricter about how I like people to approach computers. I personally would like people to develop their computer literacy. I suppose this would be like a "gateway drug" for that. 

 

I think you should teach beginners about branching, indexing graphics in ROM, about variables, about loops and conditional statements... The beginner should probably also eventually come to learn about what makes the 2600 so unique (racing the beam).

 

Like Chairman Mao said, "let a thousand flowers bloom' - in other words, we should always encourage people to finish their projects and let many diverse plans be set.

 

I suppose I am a very smart person, but I don't see 2600 kernel writing as terribly difficult - really you're just writing to hardwired registers on a timer.

 

I'm here if you want some help!



#7 Mr SQL OFFLINE  

Mr SQL

    River Patroller

  • 2,089 posts

Posted Tue Feb 13, 2018 12:15 PM

Great project, looking forward to seeing this develop! :)

 

bB still requires a lot of programming knowledge, would be cool to see more game maker programs where coding is optional, imo the limitations of the 2600, don't cross over to the mainframe running the IDE.

 

Checkout the links in my signature for some related ideas - Flashback BASIC and SuperCharger BASIC support programming visuals and sound without any code required, as well as high level BASIC and also an old school BASIC mode like bitd.



#8 IuriNery OFFLINE  

IuriNery

    Space Invader

  • Topic Starter
  • 10 posts

Posted Tue Feb 13, 2018 1:28 PM

Hi again,

 

I've added the possibility to paint the lines with different colors, added a button to change the way the Playfield is drawn and I've also added a shortcut to use a Color Picker.

 

Here are the results:

 

1. Screenshot

atarix_result_3.jpg

 

2. Code

Attached File  atarix_result_3.asm   32.06KB   26 downloads

 

3. Binary

Attached File  atarix_result_3_bin.bin   4KB   34 downloads

 

There is still something weird happening to the playfield though, if you run the binary file you will see that there are some lines on the left of the screen that doesn't have the correct size or is at the wrong position (I don't know what is causing it yet).

 

 

I love this project, but Nukey is right about the limitations of the Atari 2600.

 

I agree that probably the best way forward for this project would be to have some set made kernels which beginners and drag and drop some limited customisation onto.

 

Like you could have a Tank game, a Defender-like game, a Jungle Hunt game... 

 

I guess I'm also a lot stricter about how I like people to approach computers. I personally would like people to develop their computer literacy. I suppose this would be like a "gateway drug" for that. 

 

I think you should teach beginners about branching, indexing graphics in ROM, about variables, about loops and conditional statements... The beginner should probably also eventually come to learn about what makes the 2600 so unique (racing the beam).

 

Like Chairman Mao said, "let a thousand flowers bloom' - in other words, we should always encourage people to finish their projects and let many diverse plans be set.

 

I suppose I am a very smart person, but I don't see 2600 kernel writing as terribly difficult - really you're just writing to hardwired registers on a timer.

 

I'm here if you want some help!

Thanks!

Yeah, I will have to study a lot to optimize the code, and having different game templates may be the way to go.

 

My IDE will have 2 options for the programmer to choose (Drag & Drop and Assembly), the Assembly is just a text editor with syntax hilighting, the Drag & Drop will feature more tools and will be much easier for the developer to add stuff into the game.

 

What I want to do is to add different pre-defined movements and actions so the programmer can choose which to use for each object. For example: if the programmer wanted to move the "Hero" around the playfield in 8 directions, the only thing he/she would need to do is to add a "8 Direction Movement" into that object, and adjust it's speed accordingly.

 

 

Great project, looking forward to seeing this develop! :)

 

bB still requires a lot of programming knowledge, would be cool to see more game maker programs where coding is optional, imo the limitations of the 2600, don't cross over to the mainframe running the IDE.

 

Checkout the links in my signature for some related ideas - Flashback BASIC and SuperCharger BASIC support programming visuals and sound without any code required, as well as high level BASIC and also an old school BASIC mode like bitd.

Thanks!

Cool, I will take a look into your project, looks pretty good from what I've seen.

 

 

If anyone wants to take a look and test the IDE, this is what I've got so far:

https://www.dropbox....AtariX.zip?dl=0

 

To use the Color Picker, just hold the "LEFT CONTROL" and click on the desired color on the playfield.

 







Also tagged with one or more of these keywords: atarix, ide, optimization

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users