Jump to content
IGNORED

Antic - Display Lists, DLI's Assembly woes! need help


zenassem

Recommended Posts

Specifically: Atrari 800/xl/xe but anyone familiar with antic will know.

 

WARNING LONG POST!

But if you have the time to read, it would make a world of difference to my programming pursuits if you could offer any help.

 

 

I'm having a little bit of trouble in fully understanding setting up display lists and D.L.I's via MAC/65 assembly language. I'll outline my speciic confusion at the bottom of this post. What would really help me, is if someone could provide me a code snippet that approximately (I'm not accurately counting scan lines/mode lines here, so it may need to adjusted) does the following.

 

Top part of screen Antic mode# 4:

(1) A line that plot's some character fonts in 4 colors

(2) A linte that does the same as (1) but switches colors via a DLI

(3) A few lines same as (1) but has fine horizontal/vertical scrolling

 

Mid part of screen Antic Mode# E (basic mode 7+)

(1) draw some lines

(2) Switch colors via DLI

(3) If it's possible add some scrolling coarse AND/OR fine

 

Bottom part of screem Antic Mode# 2 (basic mode 0)

(1) line(s) that has text

(2) line(s) same as (1) but with a different bacground color and character luminance.

 

Some of my confusion on this topic:

I know I'm not the brightess bulb in the bunch, but I am having some problems understanding how to exactly customize my display. I have read chapters on this topic from a few different sources: De Re Atari, Atari Roots, Atari Graphics And Arcade Game design etc... But each one (to me) leaves out a few pieces of information... Or, right at the point where it should explain DLI's and other Advanced customizations, they jump to Basic code examples. Hence using basic loader to poke in values. rather than sticking with pure Assembly language.

 

It took me a a while to actually find a source (A user's webpage), that explained in detail how the the "TWO" byte values for the Antic instruction is derived, (ie. Added together). And what each Nybble is doing. So I was able to make a chart of all the values for LMS,Hscroll,& Vscroll. But I'm still confused on how to set it all up and then use DLI's on multiple mode lines. And if I see one more example of GR. 0 I am going lose my mind. I will worry about P/M setup in Assembly down the road. I'd be happy right now if I could have confidence in being to setup my screen the way I like.

 

Questions that may help me sort some of this out

1) I am looking for a pure Assembly approach. Is this the "right" idea, or should I do most of my game setup in BASIC, and only use machine language for the display routine?

 

2) I use RAMbrandt to draw some images, Logo's, Titlescreen Etc. It has utitilites to read the image file in BASIC, so that you can use your pictures in a BASIC program. I'm not sure exactly how to load these files from Assembler ONLY programs.

 

===============================================

I know this is a long post, and I don't really expect one person to answer it all. But If you can help clear up my confusion by even answering or supplying code for one part, I would be truly grateful.

 

I am sure it's not as complex as it seems to me right now. Eventually I'll pull enough of the texts together to make tails of it all, but I know that some help will expedite getting over this hurdle and save me weeks of frustration.

 

Well if you made it this far, I seriously want to thank you for taking the time. I know that there is an explanation of this topic, that will eventually tie all the lose pieces up for me.

 

Sincerely

~zenassem [/b]

Link to comment
Share on other sites

It took me a a while to actually find a source (A user's webpage), that explained in detail how the the "TWO"  byte values for the Antic instruction is derived, (ie. Added together). And what each Nybble is doing. So I was able to make a chart of all the values for LMS,Hscroll,& Vscroll.

 

You need to understand binary notation. In binary notation, each byte can be represented by eight bits. These bits can act as switches (on or off) and in this case, that is what they do act as. For instance, if the leftmost bit is on (a one), then a DLI is enabled for that scanline (actually it affects the next scanline in reality since you probably want any changes to be right after a WSYNC.) When you take all these switches and represent them in hex or decimal you get a number that you are familiar with.

 

But I'm still confused on how to set it all up and then use DLI's on multiple mode lines. And if I see one more example of GR. 0 I am going lose my mind.

 

DLIs with multiple lines are a little tricky, since the Atari engineers only gave us one DLI vector location to play with. That means you either have to:

 

a) use WSYNC on each and every line and code your DLI like a kernel (which is beneficial in some cases.)

 

b) or have some way in your DLI routine to tell it what code to run. A few ways to do that:

 

b1) change the DLI vector in each dli routine to point to the next one, and in the last one set it to point back to the first.

 

b2) maintain a variable that lets your code know which routine to jmp to that is incremented in each dli snippet, and reset the variable in the last one.

 

As for setting up your display list, you can either change the default one, or create your own and point the display list system variable to it. Make sure you have your DLI vector set first!

 

Questions that may help me sort some of this out

1) I am looking for a pure Assembly approach. Is this the "right" idea, or should I do most of my game setup in BASIC, and only use machine language for the display routine?

 

I think that a "high-level" language and assembly mix can be a good thing, since you can bang things out in a high-level language quickly and optimize in assembly those things that need it (VBIs and DLIs especially!). I wouldn't use BASIC myself though, since it eats up a bunch of the computers memory and is slow. I use the CC65 programming package myself.

 

I'll try to take a stab at setting the above program up when I have time. Probably not tonight though, I have to take my daughter swimming!

Link to comment
Share on other sites

Thanks shawn,

 

Btw, the Display list I requested doesn't actually have to be ONE program. I just wanted to see an example (100% assembly) of a display list that used the numerous options, mixed modes, and DLI's to change color registers.

 

I understand Binary and Hex notation. It just wasn't clicking for me the way that some of the books were describing it, and the order in which their explanation proceeded. For example, One of them started out showing a Gr.0 display list and then a GR.2 diaplay list. The only problem was they didn't have a picture/chart showing, nor did they do a good job of explaining the LMS instruction. It was if they were pulling the 2 byte hex numbers out of thin air. Sometimes a picture is worth a 1000 words. Once I was able to see what each bit related to it made sense.

 

At this point a can create my own display list. I grasp setting up mixed modes, but I can't seem to understand how to use DLI vectors and how to have a DLI change the color registers to get more colors on the screen at once.

Link to comment
Share on other sites

Here is an example program that does most of what you reqested. Although fairly simple, the listing is long (although a chunk of that is comments), so it is included here as a file attachment.

 

This example uses method b2) as Shawn described above to track which DLI routine to run. Note, that in addition to the two methods Shawn described, it is also possible to have the DLI watch the VCOUNT register to determine what to run. However, this is probably more trouble than it is worth.

 

A few things to be careful of when implementing the screen you described:

 

1) Enabling horizontal and vertical scrolling in the ANTIC 4 window at the top of the screen causes a few interesting side effects; When the HSCROLL bit is set, ANTIC will grab extra data on each mode line. In addition, to prevent jumping or popping of the display, a buffer mode line must be put in place for fine VSCROLL. This is done by not setting the VSCROLL bit on the last mode line of the fine scrolling display. ANTIC will treat this as a buffer

 

2) When the DLI bit is set, ANTIC completes the mode line it is drawing, then handles the interrupt. Because of this, the interrupt must be set on he mode line above the one you want to effect.

 

3) ANTIC screen memory cannot cross a 4k boundry without a JMP instruction; There are enough 7+ (ANTIC $0e) mode lines to cross this boundry. Therefore screen memory must be carefully arranged to allow seamless access.

dlist_demo.zip

Link to comment
Share on other sites

@Gauntman,

 

Thank you so much. That's "EXACTLY" what I needed. I had a chance to quickly glance at the source code, and already spotted where I was going wrong. I will experiment with it tonight.

 

You have no idea how much this helps me. I had a lot of the info, but nothing to see how to tie it all together. I really can't thank you enough =)

 

 

 

http://www.howell1964.freeserve.co.uk/Atar...ri_hw/antic.htm

 

Btw, If anyone else is having a hard time understanding How to work with the Antic chip, here is a link to the website that really explained how it works. While "DE RE Atari" and "Atari Roots" do a great job on a wide range of topics, I feel that they didn't have the space to explain the Antic in depth. I haven't received my mapping the Atari, or Your Atari 400/800, to see if they do a better job.

Link to comment
Share on other sites

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