Imagine haveing a 7mhz 6502

You can talk about almost anything that you want to on this board.

Moderator: Moderators

NewRisingSun
Posts: 1028
Joined: Thu May 19, 2005 11:30 am

Re: Imagine haveing a 7mhz 6502

Post by NewRisingSun » Mon Jan 14, 2019 4:03 am

On the IBM PC, 1984's Enhanced Graphics Adapter (EGA), and the backwards-compatible 1987 VGA chipset, have limited scroll and screen split support, though no sprites.

User avatar
TmEE
Posts: 712
Joined: Wed Feb 13, 2008 9:10 am
Location: Estonia, Rapla city (50 and 60Hz compatible :P)
Contact:

Re: Imagine haveing a 7mhz 6502

Post by TmEE » Mon Jan 14, 2019 4:10 am

There is usually one sprite, for mouse cursor on most post VGA chipsets. Scrolling can be done by changing framebuffer start address, especially on things with VESA VBE support.

Pokun
Posts: 1235
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Imagine haveing a 7mhz 6502

Post by Pokun » Mon Jan 14, 2019 6:06 am

Oh I remember hearing about hardware scrolling in VGA video cards, only in one axis though.

I see, the mouse is a sprite. Better than nothing!

tepples
Posts: 21710
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Imagine haveing a 7mhz 6502

Post by tepples » Mon Jan 14, 2019 7:42 am

Williams arcade PCBs and Atari Lynx handhelds didn't have sprites in the TMS9918 and VIC-II sense, but they did have a dedicated blitter unit that could draw pictures to a frame buffer. The PC adopted a blitter architecture beginning with IBM 8514 and S3 86C911, and a 2D GPU (sometimes branded a "Windows accelerator") became a standard feature on most PC video cards by 1995.

NewRisingSun
Posts: 1028
Joined: Thu May 19, 2005 11:30 am

Re: Imagine haveing a 7mhz 6502

Post by NewRisingSun » Mon Jan 14, 2019 10:48 am

No, both the 1984 EGA and 1987 VGA allow full diagonal scrolling, by specifying an X size larger than the screen width. The only limitation on both is that the split screen feature is limited on both in that the scrolling area must be the top one, and the fixed area the bottom one. That is why the PC version of Pinball Fantasies puts the scoreboard at the bottom, while the original Amiga version put it at the top of the screen. Another limitation that only exists on EGA and was lifted on VGA is that the fine X scroll carries over into the fixed split region.

The standard EGA and VGA cards have no provision for a hardware mouse cursor. As for later graphics cards, since the VESA Video BIOS Extensions provided no software interface for a hardware mouse cursor, any program using it would be card-model-specific. The Tseng ET3000 for example had the hardware cursor; for the more popular successor model ET4000, Tseng Labs apparently grew tired of that toy and removed it.

lidnariq
Posts: 8693
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Imagine haveing a 7mhz 6502

Post by lidnariq » Mon Jan 14, 2019 10:59 am

Pokun wrote:Oh I remember hearing about hardware scrolling in VGA video cards, only in one axis though.
Not only one axis.

They are split across multiple registers, one for sub-tile* horizontal scrolling ("3C0h index 13h (R/W): Attribute: Horizontal PEL Panning Register"), one for sub-tile vertical scrolling ("3d4h index 8 (R/W): CRTC: Preset Row Scan Register"), and two for coarse scrolling ("3d4h index {C,D}h (R/W): CRTC: Start Address {High,Low} Register").

The sub-tile vertical scrolling register is only used in text or vertically stretched ("3d4h index 9 (R/W): CRTC: Maximum Scan Line Register") modes. Because of how the VGA works, fine horizontal scrolling requires sub-tile scrolling.

The coarse scrolling registers are present in the 6845 that was used in the CGA/MDA card too.

* A tile is 4, 8, or 9 pixels wide, depending on configuration. Kinda similar to the SNES, the VGA could either use a single 32-bit-wide RAM at 3MHz to generate four 8-bit pixels every 3MHz (→ pixel clock of 12.6MHz, 320 pixel mode); eight 4-bit pixels (25.2MHz), or split it in two for text modes (fetching a tile and attribute in one 16-bit slice, and then using that to look up a scanline's contents in the other 16-bit slice). A tile is anywhere between 1 to 32 pixels tall, and can additionally be doublescanned. The master pixel clock could either be 25 or 28MHz, and all cards seemed to consistently support a mild overclock (running at 3.5MHz instead of 3.15MHz)

The reference I used when VGA programming still mattered: https://pdos.csail.mit.edu/6.828/2006/r ... GAREGS.TXT
NewRisingSun wrote:The Tseng ET3000 for example had the hardware cursor; for the more popular successor model ET4000, Tseng Labs apparently grew tired of that toy and removed it.
Newer SVGA cards seemed to consistently have one. Xfree86 called it "hardware mouse", and the majority of drivers seemed to support it. Only talking about "2d" cards, (edit) I don't know about anything from the past fifteen years.

edit: the ET4000 with the weitek32 accelerator did support a hardware cursor but it was strictly bilevel. There's a bit of other cruft in xfree86's driver that makes it hard to tell which cards supported what. Certainly in the final release, they dummied out support for everything but the hardware cursor on the ET6000.
Last edited by lidnariq on Sat May 04, 2019 6:25 pm, edited 6 times in total.

calima
Posts: 999
Joined: Tue Oct 06, 2015 10:16 am

Re: Imagine haveing a 7mhz 6502

Post by calima » Mon Jan 14, 2019 12:19 pm

HW cursors definitely exist in modern cards. It has plenty of benefits.

User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2030
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: Imagine haveing a 7mhz 6502

Post by FrankenGraphics » Mon Jan 14, 2019 12:25 pm

Yeah, you may experience delay or choppyness with software cursors.
http://www.frankengraphics.com - personal NES blog

Pokun
Posts: 1235
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Imagine haveing a 7mhz 6502

Post by Pokun » Mon Jan 14, 2019 2:13 pm

I see, so sprites are alive and kicking!
lidnariq wrote:
Pokun wrote:Oh I remember hearing about hardware scrolling in VGA video cards, only in one axis though.
Not only one axis.

They are split across multiple registers, one for sub-tile* horizontal scrolling ("3C0h index 13h (R/W): Attribute: Horizontal PEL Panning Register"), one for sub-tile vertical scrolling ("3d4h index 8 (R/W): CRTC: Preset Row Scan Register"), and two for coarse scrolling ("3d4h index {C,D}h (R/W): CRTC: Start Address {High,Low} Register")...
Oh yeah, I think I mixed it up with scroll mirroring. I was told that the scroll mirroring orientation on VGA isn't changeable like on the NES.

lidnariq
Posts: 8693
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Imagine haveing a 7mhz 6502

Post by lidnariq » Mon Jan 14, 2019 2:22 pm

scroll mirroring?

There isn't a concept of multiple nametables, if that's what you're referring to? Instead there's just a width for the source data, and a width & height for the viewport. Things don't usually work well if you specify a width narrower than the viewport.

Pokun
Posts: 1235
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Imagine haveing a 7mhz 6502

Post by Pokun » Mon Jan 14, 2019 5:30 pm

From what I understood of what was explained to me some years ago, you could "scroll around" in VRAM, but due to how it's setup you could only scroll in a certain direction without the viewport or whatever wraps around or mirrors or something (sounded a lot like the NES scroll/nametable mirroring to me). I think it involved that problem with Pinball Fantasy though so it's entirely possible I misunderstood everything. :)


BTW when I make games for IBM-PC in C++, I made a 2D graphic engine that uses software sprites and background layers (tiled or non-tiled) drawed in order of set priority in a way that closely resembles these classic video chips (PPU, TMS9918, HuC6270 etc) but much more flexible and tweakable on per game-basis. I have no idea if this makes sense or is effective (memory-wise, speed-wise and ease of use), especially if a lot of sprites and backgrounds are used.

This calls for a separate thread though.

User avatar
Sumez
Posts: 909
Joined: Thu Sep 15, 2016 6:29 am
Location: Denmark (PAL)

Re: Imagine haveing a 7mhz 6502

Post by Sumez » Tue Jan 15, 2019 1:04 am

Drew Sebastino wrote:Metal Slug 2 says "hi" :lol:
The Metal Slug 2 slowdown is such an obscene example due to it being a pretty simple bug. Not sure about the details, but supposedly the game accidentally checks all collisions twice every frame.

Post Reply