Jump to content
IGNORED

Help with Coding ANSI Terminal


Cybernoid

Recommended Posts

Hi. I have been coding a simple Color ANSI Terminal for the 8bit.

 

The first thing you are probably going to think when you read this is, "Why?". Well, I have been writing this program just as an example and to familiarize myself with programming for the 8bit in the hope that some of what I have learned could be applied to a game or two.

 

I have included the current executable and source code. ANSITERM.COM is coded in C and compiled using CC65. The terminal is 40 columns wide, but has a virtual 80 column screen (you can scroll left and right). It uses 8 colors for the characters, but it makes use of interlaced color to do this. I have tried to minimize the flicker, and it looks good on an NTSC TV. The emulator is okay, but I do not like how it emulates the interlacing. I am not sure how it would look on PAL, but I think that the flicker would be more noticable.

 

Also, the VT102 and VT52 state-machines are mostly implemented with the exception of inserting/deleting lines and chars (back space does work). The character set has room to grow to make use of special graphics characters as well.

 

 

I have finally gotten the code into a state with which I am happy, however, there are now a few problems I just cannot figure out:

 

 

If I try to read more than 1 character at a time, the char draws mess up. The characters are not placed where I expect them.

While trying to use ansiterm with APE and when it opens the R: dev, I think it is trying to access a disk drive. Is there an R-handler I have to install? I thought APE did this automatically... could be wrong.

 

 

 

 

Well, I thought that a terminal emulator would be an easy thing to code... :ponder: :) Anyway, there are a few other bugs and things I want to change. The code is currently a little messy.... If any one has any ideas, or wants to look at the code and help figure out a few things, GREAT!!! LMK!

 

Here are the CTRL-SHIFT key commands:

CTRL-SHIFT-R - Baud [R]ate (Was CTRL-SHIFT-B, need to check)

CTRL-SHIFT-F - Toggle Line [F]eeds (Was CTRL-SHIFT-L)

CTRL-SHIFT-E - Toggle Local [E]cho

CTRL-SHIFT-S - Toggle 80/40 columns (creen Size) (Was CTRL-SHIFT-C)

CTRL-SHIFT-W - Toggle Word [W]rap

CTRL-SHIFT-T - Toggle [T]erminal Emulation (ATASCII, ANSI, VT52 mode)

CTRL-SHIFT-H - [H]angUp

 

CTRL-SHIFT-X - Move screen Right ([X] doesn't work on real Atari)

CTRL-SHIFT-> "

CTRL-SHIFT-(UP_ARROW) "

CTRL-SHIFT-Z - Move screen Left ([Z] doesn't work on real Atari)

CTRL-SHIFT-< "

CTRL-SHIFT-(DOWN_ARROW) "

 

 

 

Thanks,

Chris

post-4398-1082747771_thumb.png

ansiterm_1.1.zip

Link to comment
Share on other sites

With APE, an 850 interface or PR Connection the handler is 'inside' the device, but you have to run a short program to boot load the handler into the Atari.

 

There is a program called RS232.COM on the spartados disk that does this. They are very short loaders, usually 1 sector long.

 

When it loads you should hear a long beeeeeeeep as the handler is downloaded.

 

Steve

Link to comment
Share on other sites

With APE, an 850 interface or PR Connection the handler is 'inside' the device, but you have to run a short program to boot load the handler into the Atari.

 

There is a program called RS232.COM on the spartados disk that does this.  They are very short loaders, usually 1 sector long.

 

When it loads you should hear a long beeeeeeeep as the handler is downloaded.

 

Steve

 

Thanks Steve! I forgot about this. (It's been too many years since I used it.) I found the RS232.COM program. Ran it. It beeeeeped. :) And, it seems to slow down the screen draws while still not working. Hmmm, there is still something wrong here. I am trying to figure out why this doesn't work on a real Atari with APE.

 

Do you know how the R-handler that APE installs works? Does it install anything for deferred or immediate VBI? Where in the memory does it install?

 

 

Also, do you know what the differences are between the RS232.COM and the AT_RS232.COM found on the SpartaDOS disks?

 

(I know... Lots of questions...)

 

 

Thanks,

Chris

Link to comment
Share on other sites

Do you know how the R-handler that APE installs works?  Does it install anything for deferred or immediate VBI?  Where in the memory does it install?

 

Also, do you know what the differences are between the RS232.COM and the AT_RS232.COM found on the SpartaDOS disks?

 

The R: handler only uses Pokey serial interrupts. The vectors are @ 20A, 20C and 20E. The handler installs at $1F00

 

I dont know the differences. Most of the programs designed to start the 850 interface dont actually do anything except send one SIO command and then turn over code execution to the driver.

 

Are you using code that works with a real 850 interface? Are you going through all the steps required to enter concurrent i/o mode before trying to send and receive data?

 

Steve

Link to comment
Share on other sites

The R: handler only uses Pokey serial interrupts.  The vectors are @ 20A, 20C and 20E.  The handler installs at $1F00

 

Do you know how big the handler is. The code for my program starts at $2000. So, if it is bigger than 256 bytes, my code is more than likely overwriting it. I'll mess with changing the load location...

 

Are you using code that works with a real 850 interface?  Are you going through all the steps required to enter concurrent i/o mode before trying to send and receive data?

 

I *think* I am using code that *should* work with a real 850 interface. I wrote the XIO routines myself, so there is potential there for them not to work. (Just another thing to debug.... :))

 

Basically, I have functions that should do the same thing as the basic OPEN, CLOSE, GET, and XIO routines... my init routine is:




#define R_DEV           4



 xio(36, R_DEV, 0xf, 0, "R:", 0); // Set 19.2kbps (BB), 9600bps (850), 8N1

 xio(38, R_DEV, 0x20, 0, "R:", 0); // No Translation, no LF, No Parity



 XIO_OPEN(R_DEV, 13, 0, "R:"); 





 // Do we need to set DTR ?

 xio(34, R_DEV, 0xc0, 0, "R:", 0); // DTR ON 

 

 //  Set concurrent mode.

 xio(40, R_DEV, 13, 0, "R:", 0); // For 850 & Linux EMU



 

 

Ooh, yeah. Looks like I have a typo for the xio 40 line... where did that 13 come from?

 

 

--C

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