Announcement

Collapse

Forum etiquette

Our mission ...

This forum is part of our mission to promote the preservation of vintage computers through education and outreach. (In real life we also run events and have a museum.) We encourage you to join us, participate, share your knowledge, and enjoy.

This forum has been around in this format for over 15 years. These rules and guidelines help us maintain a healthy and active community, and we moderate the forum to keep things on track. Please familiarize yourself with these rules and guidelines.


Remain civil and respectful

There are several hundred people who actively participate here. People come from all different backgrounds and will have different ways of seeing things. You will not agree with everything you read here. Back-and-forth discussions are fine but do not cross the line into rude or disrespectful behavior.

Conduct yourself as you would at any other place where people come together in person to discuss their hobby. If you wouldn't say something to somebody in person, then you probably should not be writing it here.

This should be obvious but, just in case: profanity, threats, slurs against any group (sexual, racial, gender, etc.) will not be tolerated.


Stay close to the original topic being discussed
  • If you are starting a new thread choose a reasonable sub-forum to start your thread. (If you choose incorrectly don't worry, we can fix that.)
  • If you are responding to a thread, stay on topic - the original poster was trying to achieve something. You can always start a new thread instead of potentially "hijacking" an existing thread.



Contribute something meaningful

To put things in engineering terms, we value a high signal to noise ratio. Coming here should not be a waste of time.
  • This is not a chat room. If you are taking less than 30 seconds to make a post then you are probably doing something wrong. A post should be on topic, clear, and contribute something meaningful to the discussion. If people read your posts and feel that their time as been wasted, they will stop reading your posts. Worse yet, they will stop visiting and we'll lose their experience and contributions.
  • Do not bump threads.
  • Do not "necro-post" unless you are following up to a specific person on a specific thread. And even then, that person may have moved on. Just start a new thread for your related topic.
  • Use the Private Message system for posts that are targeted at a specific person.


"PM Sent!" messages (or, how to use the Private Message system)

This forum has a private message feature that we want people to use for messages that are not of general interest to other members.

In short, if you are going to reply to a thread and that reply is targeted to a specific individual and not of interest to anybody else (either now or in the future) then send a private message instead.

Here are some obvious examples of when you should not reply to a thread and use the PM system instead:
  • "PM Sent!": Do not tell the rest of us that you sent a PM ... the forum software will tell the other person that they have a PM waiting.
  • "How much is shipping to ....": This is a very specific and directed question that is not of interest to anybody else.


Why do we have this policy? Sending a "PM Sent!" type message basically wastes everybody else's time by making them having to scroll past a post in a thread that looks to be updated, when the update is not meaningful. And the person you are sending the PM to will be notified by the forum software that they have a message waiting for them. Look up at the top near the right edge where it says 'Notifications' ... if you have a PM waiting, it will tell you there.

Copyright and other legal issues

We are here to discuss vintage computing, so discussing software, books, and other intellectual property that is on-topic is fine. We don't want people using these forums to discuss or enable copyright violations or other things that are against the law; whether you agree with the law or not is irrelevant. Do not use our resources for something that is legally or morally questionable.

Our discussions here generally fall under "fair use." Telling people how to pirate a software title is an example of something that is not allowable here.


Reporting problematic posts

If you see spam, a wildly off-topic post, or something abusive or illegal please report the thread by clicking on the "Report Post" icon. (It looks like an exclamation point in a triangle and it is available under every post.) This send a notification to all of the moderators, so somebody will see it and deal with it.

If you are unsure you may consider sending a private message to a moderator instead.


New user moderation

New users are directly moderated so that we can weed spammers out early. This means that for your first 10 posts you will have some delay before they are seen. We understand this can be disruptive to the flow of conversation and we try to keep up with our new user moderation duties to avoid undue inconvenience. Please do not make duplicate posts, extra posts to bump your post count, or ask the moderators to expedite this process; 10 moderated posts will go by quickly.

New users also have a smaller personal message inbox limit and are rate limited when sending PMs to other users.


Other suggestions
  • Use Google, books, or other definitive sources. There is a lot of information out there.
  • Don't make people guess at what you are trying to say; we are not mind readers. Be clear and concise.
  • Spelling and grammar are not rated, but they do make a post easier to read.
See more
See less

Tandy graphics 320x200 16 colors programming

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Tandy graphics 320x200 16 colors programming

    Hi. I was looking for samples of tandy graphics, and I read it can map any ram address to 0xB800 00000.

    I didn't find any samples explaining how to do this, can it really map any address to that video ram?. If so, it would be able to do basic hardware scrolling, even if horizontal scrolling has to move 2 pixels at a time (because every byte stores two pixels).

    Thanks!.

    #2
    ftp://ftp.oldskool.org/pub/drivers/Tandy/1000/ should have the reference materials you need.

    Hardware scrolling is possible, but it may not be as usable/granular as you think. The Tandy 1000 (and the PCjr from which it was designed) can map pages in 16K boundaries; you can't just choose an arbitrary area. And while the 6845 can change the start address of displayed memory, it does so in 16-bit words as you found out, so the scrolling would be 4 pixels at a time.

    I don't recall the behavior of setting the 6845 start address register to point to something beyond what's visible; I don't recall if it shows memory beyond the area, or if it wraps around. Testing on real hardware might be necessary (ie. I'm not sure what emulators emulate Tandy video perfectly).
    Offering a bounty for:
    - A working Sanyo MBC-775 or Logabax 1600
    - Music Construction Set, IBM Music Feature edition (has red sticker on front stating IBM Music Feature)

    Comment


      #3
      Originally posted by Trixter View Post
      ftp://ftp.oldskool.org/pub/drivers/Tandy/1000/ should have the reference materials you need.

      Hardware scrolling is possible, but it may not be as usable/granular as you think. The Tandy 1000 (and the PCjr from which it was designed) can map pages in 16K boundaries; you can't just choose an arbitrary area. And while the 6845 can change the start address of displayed memory, it does so in 16-bit words as you found out, so the scrolling would be 4 pixels at a time.

      I don't recall the behavior of setting the 6845 start address register to point to something beyond what's visible; I don't recall if it shows memory beyond the area, or if it wraps around. Testing on real hardware might be necessary (ie. I'm not sure what emulators emulate Tandy video perfectly).
      Thanks for the link. It is a bit confusing because I does not explain everything, (or I didn't find it).

      I found the "CRT/Processor Page Register" (3DF).
      Bits:
      0 = CRT Page 0
      1 = CRT Page 1
      2 = CRT Page 2
      3 = Processor Page 0
      4 = Processor Page 1
      5 = Processor Page 2
      6 = Video Address Mode 0
      7 = Video Address Mode 0

      - CRT Page 0-2 select the 16K page used by the video. In 32K modes, bit 0 is ignored.
      - Processor Page 0-2 are combined with the CPU address to select the 32K segment of memory accessed at B8000. If an odd page number is selected (1,3,5, etc.) the window is reduced to 16K.

      I could not find what "CPU address" means .

      I also found an old post from vogons talking about vertical scrolling being possible on tandy 1000, but there is no sample code to show how to do it.

      Comment


        #4
        Correct, page 57 of Tandy_1000_Technical_Reference_Manual is what you need to look at (and really, everything on and after page 45).

        Both the PCjr and the Tandy 1000 use system ram as video ram. The page register points to eight 16k areas of a continuous 128KB area in both systems: The PCjr's area is the first 128K in the system, and the Tandy's is the *last* 128KB in the system (so on a 256K Tandy, it's from 128K-256K; on a 640K tandy, it's from 512K-640K).

        You don't need to know where in memory the pages are on the Tandy 1000; the CRT page function specifies which 16K or 32k (2 x 16K) pages are being displayed, whereas the Processor page function specifies which 16K or 32K areas are accessible at B800h. So you typically set the CRT register to which page (16K) or pages (32k) you want to be visible on the screen, and the page register to the pages you want readable/writable at B800:0000.

        (On a PCjr, you *do* need to know where in main memory the pages are if using 320x200x16 modes, as the PCjr can only access 16K at B800 instead of the full 32K. But this is not a concern for you if you're programming for Tandy.)

        Vertical scrolling on Tandy would probably (I've never tried it) be done by picking a page that is not the last page in the system, then using the 6845 3D4/3D5 ports to change the registers 12 and 13 (Start Address) to scroll upward, and hoping that the page directly after it is what appears at the bottom as the current page is scrolled off the top. But I have never tested this.
        Offering a bounty for:
        - A working Sanyo MBC-775 or Logabax 1600
        - Music Construction Set, IBM Music Feature edition (has red sticker on front stating IBM Music Feature)

        Comment


          #5
          Originally posted by Trixter View Post
          Vertical scrolling on Tandy would probably (I've never tried it) be done by picking a page that is not the last page in the system, then using the 6845 3D4/3D5 ports to change the registers 12 and 13 (Start Address) to scroll upward, and hoping that the page directly after it is what appears at the bottom as the current page is scrolled off the top. But I have never tested this.
          It looks like the same function I had to scroll EGA and VGA from my little game engine (Changing register 3d4) works also on Tandy, and even on CGA.

          On CGA it scrolls in 8 pixel steps (horizontal), and in two line steps (vertical).
          On tandy the screen moves in 4 pixel steps. Vertical scroll moves 4 lines at a time and wraps around the same image, I'll have to test if it can be configured to show two pages or to scroll 1 line at a time, because the memory is arranged interlacing 4 lines.

          I tested this on dosbox, I suppose tandy emulation is good enough for this.
          Last edited by Mills32; March 13, 2021, 02:43 AM.

          Comment


            #6
            Originally posted by Mills32 View Post
            I tested this on dosbox, I suppose tandy emulation is good enough for this.
            I wouldn't be too sure. If you're going to be messing with crt/page registers as well as scrolling, you should get access to real hardware to see what is actually possible.
            Offering a bounty for:
            - A working Sanyo MBC-775 or Logabax 1600
            - Music Construction Set, IBM Music Feature edition (has red sticker on front stating IBM Music Feature)

            Comment


              #7
              Yeah, never rely on DOSBox to be anything more than "good enough for the most common test cases."
              Computers: Amiga 1200, DEC VAXStation 4000/60, DEC MicroPDP-11/73
              Synthesizers: Roland JX-10/SH-09/MT-32/D-50, Yamaha DX7-II/V50/TX7/TG33/FB-01, Korg MS-20 Mini/ARP Odyssey/DW-8000/X5DR, Ensoniq SQ-80, E-mu Proteus/2, Moog Satellite, Oberheim SEM
              "'Legacy code' often differs from its suggested alternative by actually working and scaling." - Bjarne Stroustrup

              Comment


                #8
                Originally posted by commodorejohn View Post
                Yeah, never rely on DOSBox to be anything more than "good enough for the most common test cases."
                You are right, I'll leave this for the moment.

                Comment


                  #9
                  If you want to share a test program, I can tell you how it responds on second-generation Tandy hardware (1000RL) at least.
                  Computers: Amiga 1200, DEC VAXStation 4000/60, DEC MicroPDP-11/73
                  Synthesizers: Roland JX-10/SH-09/MT-32/D-50, Yamaha DX7-II/V50/TX7/TG33/FB-01, Korg MS-20 Mini/ARP Odyssey/DW-8000/X5DR, Ensoniq SQ-80, E-mu Proteus/2, Moog Satellite, Oberheim SEM
                  "'Legacy code' often differs from its suggested alternative by actually working and scaling." - Bjarne Stroustrup

                  Comment


                    #10
                    Originally posted by commodorejohn View Post
                    If you want to share a test program, I can tell you how it responds on second-generation Tandy hardware (1000RL) at least.
                    Sure, here it is, a little program that scrolls "titus the fox" intro. TANDY_SCROLL.zip
                    If tandy could increase "logical width" to update a column "off screen" it would be enough for the engine. I would also need to see two pages at the same time, so that I can update a row above or below the visible area.

                    Comment


                      #11
                      Well, finally got a chance to copy this over and test it. Both horizontal and vertical scrolling seem to increase the step by a hair too much, because they gradually "creep" in the perpendicular direction every time they wrap around the screen - horizontal scrolling moves "down" in the playfield about 8px, while vertical scrolling moves left by around 64-ish (spitballing here.) Still, the basic movement is fast and fluid, and there may well be a way to work around the wrapping issue.
                      Computers: Amiga 1200, DEC VAXStation 4000/60, DEC MicroPDP-11/73
                      Synthesizers: Roland JX-10/SH-09/MT-32/D-50, Yamaha DX7-II/V50/TX7/TG33/FB-01, Korg MS-20 Mini/ARP Odyssey/DW-8000/X5DR, Ensoniq SQ-80, E-mu Proteus/2, Moog Satellite, Oberheim SEM
                      "'Legacy code' often differs from its suggested alternative by actually working and scaling." - Bjarne Stroustrup

                      Comment


                        #12
                        Postscript: I think I figured it out - is the scrolling just a dumb loop that doesn't properly reset to the start of the buffer? If that's the case, then cycling through two 320x200 bitmaps (32,000 bytes) in sequence would mean a remainder of 768 bytes out of 32KB, which would be 4.8 lines of vertical creep and 0.8 lines of horizontal offset, for a left-creep of 0.2 lines, or 64 pixels - more or less what I thought I observed.
                        Computers: Amiga 1200, DEC VAXStation 4000/60, DEC MicroPDP-11/73
                        Synthesizers: Roland JX-10/SH-09/MT-32/D-50, Yamaha DX7-II/V50/TX7/TG33/FB-01, Korg MS-20 Mini/ARP Odyssey/DW-8000/X5DR, Ensoniq SQ-80, E-mu Proteus/2, Moog Satellite, Oberheim SEM
                        "'Legacy code' often differs from its suggested alternative by actually working and scaling." - Bjarne Stroustrup

                        Comment


                          #13
                          I discovered that CGA/TANDY/EGA and VGA "scrolling" are the same,. They are not like scrolling in consoles or other devices, you simply change the start address shown on screen like this:

                          Code:
                          			Scroll = 0		Scroll = 1		Scroll = 4
                          
                          Scanline 0		01234567		12345678		456789AB
                          Scanline 1		89ABCDEF		9ABCDEF0		CDEF0123
                          It's up to you to calculate the "x" and "y" positions, but it works.

                          Originally posted by commodorejohn View Post
                          and there may well be a way to work around the wrapping issue.
                          There is a way to update a column and/or a row, to redraw the edges so that it looks seamless (I did it with EGA/VGA).

                          EGA and VGA can scroll 1 pixel at a time using a special register, CGA scrolls 8 pixels at a time, and TANDY 4. Also CGA and Tandy skip lines because of the interlaced arrangement of the VRAM.

                          Originally posted by commodorejohn View Post
                          Postscript: I think I figured it out - is the scrolling just a dumb loop that doesn't properly reset to the start of the buffer? If that's the case, then cycling through two 320x200 bitmaps (32,000 bytes) in sequence would mean a remainder of 768 bytes out of 32KB, which would be 4.8 lines of vertical creep and 0.8 lines of horizontal offset, for a left-creep of 0.2 lines, or 64 pixels - more or less what I thought I observed.
                          There are some bytes at the end of the 16K page that I could not modify, and they show how the page does not end at a complete scanline, producing horizontal scrolling when going down.

                          tga_000.png

                          Comment


                            #14
                            Yeah, that makes sense.
                            Computers: Amiga 1200, DEC VAXStation 4000/60, DEC MicroPDP-11/73
                            Synthesizers: Roland JX-10/SH-09/MT-32/D-50, Yamaha DX7-II/V50/TX7/TG33/FB-01, Korg MS-20 Mini/ARP Odyssey/DW-8000/X5DR, Ensoniq SQ-80, E-mu Proteus/2, Moog Satellite, Oberheim SEM
                            "'Legacy code' often differs from its suggested alternative by actually working and scaling." - Bjarne Stroustrup

                            Comment


                              #15
                              Just a few ideas:

                              While you can (and maybe must at some point) try on the real hardware, using an accurate emulator could help you to accelerate the development process. 86Box, I you don't know it, is a fork of PCem, much more accurate in terms of CPU speed and graphic chips behavior. It's able to run very specialized CPU and video card oriented software that intensively touches the registers. It even runs, with only a few minor glitches, 8088mph and INTROjr (hi, Trixter ).



                              BTW, the executable you provided looked the same on DosBox and 86Box (both emulating Tandy). The most up to date version of 86Box is here: https://ci.86box.net/job/86Box as the Github releases are ages old.

                              Regarding the idea of horizontal scroll on Tandy 320x200x16 colors, as I'm aware of, there's no horizontal logical screen size register on the PCjr/Tandy. That makes hardware horizontal scrolling very difficult as there's no way to draw a column in advance, just like it can be made on EGA and VGA-ModeX. Maybe a solution for this would be manipulating the CRT registers to narrow the visible width, i.e. creating a custom 304x200 graphic mode. I speak theoretically as I didn't actually tried. The good part is that there are no known Tandy clones, and the only PCjr clone we know the existence of is the Tandy 1000, so there would be less problems of compatibility than with other cards.

                              Boulder Dash makes a lightning fast horizontal scroll, both on Tandy/PCjr and CGA:

                              https://www.youtube.com/watch?v=lAOWluiiYoc

                              How does it? If we run the game on DOSBox and on some moment the cycles are reduced to something very low (between 30-70 cycles), we can see a noticeable flicker on the right or left size (depending on where are you scrolling at). So it seems that the technique used here is:

                              - Drawing the next column in advance
                              - Change the start screen register for a few pixels
                              - Loop until the entire screen is scrolled

                              Because the CGA video memory is so limited, and due to the lack of a horizontal logical screen register, this is made very fast, much faster than 60-70 fps, in order to make the flicker unnoticeable to the human eye/brain. But I don't think this technique could be used for a smooth 30/60/70 fps horizontal scroll as the advanced column would be visible for a long time. In fact, the vertical scroll on the same game is slower and smoother. It also may be due to the fact that horizontally scrolls 4 pixels (1 byte) instead of 1 pixel.

                              Regarding the vertical scroll, it's been used on the PCjr since the beginning, at least on 160x200x16 colors mode. For example, on these games:

                              https://www.youtube.com/watch?v=ZP4EsbwN5mM

                              If you look at the first game, you will see that there's no horizontal scroll. When the stage changes, there's a very noticeable up to down drawing. But when the same game does vertical scroll, it's just great, so smooth, so perfect. As perfect as an arcade machine's. The second game (2:46) uses a perfect continuous vertical scroll. In my opinion, this is far easier to achieve on mode 8 (160x200) than in mode 9 (320x200) because in mode 8 you can have 2 pages using 32 kb of video RAM, while you can have only one page (and a few spare bytes) on mode 9. So, in mode 8 you can draw the row in advance to the invisible video memory and then change the start register for a few pixels, as you would do on EGA/VGA-ModeX. I'm not saying that making hardware scrolling on mode 9 would not be possible, I just don't know it. But, for making it possible, there would be made 64 kb available for video memory (or, at least, memory enough to draw a row in advance and then taking advantage of video memory wrapping). I don't know if it is possible nor how could it be done. The late Tandy 1000 models (SL/TL and later) can have access to 64 kb of video RAM (or, better said, they can assign 64 kb of system RAM to video, as there's no video RAM as it on the PCjr/Tandy). I just don't know if this can be done on earlier Tandys.

                              I wonder if Boulder Dash for CGA is manipulating the CRT registers in some way for achieving a custom 160x200x4 colors mode in order to have 8kb per page=2 video pages. The pixels are chunky and it looks like 160x200 but I don't know if the pixels are just doubled or, as I said before, it's a custom mode. If there's no custom mode, maybe the few spare bytes of the CGA buffer are enough to draw a row in advance, scroll and wrap the memory.

                              This other PCjr game (Touchdown Football) has a quite jerky horizontal scroll. My guess is that it's using a simple rep movsb or rep movsw to draw the scroll directly to the video memory.

                              P.S. I just saw that CGA Boulderdash uses a regular 320x200 mode (I noticed some of the letters at the bottom).
                              Last edited by carlos12; March 25, 2021, 06:47 AM.

                              Comment

                              Working...
                              X