Jump to content
IGNORED

My first Intv program


Snafu-1982

Recommended Posts

Well it's my first foot into the intellivision programming pool, I just wanted to know if I'm on the right track with this. I kind of understand I've done some of it correctly, but I know the statements referring to choosing the colours, and specifying the location where graphics go is not right, I've used a "Plot" statement (old Apple IIe programming language) in place of what is suppose to be there.

 

The aim of the program is just to do a cartridge opening screen with a magenta border, black screen, white text, and a somewhat pixated version of my own logo (just for fun).

 

Here are also some screen shots on what I understand about the intellivision interface, and some of the hex values used for selecting colours and etc.

 

(the following images were created in photoshop for demonstration)

 

post-34079-0-03833700-1348801003_thumb.gif

 

post-34079-0-30729600-1348801011_thumb.gif

 

post-34079-0-35035300-1348801019_thumb.gif

 

============Start of program=======================

 

 

ROMW 16

ORG $5000

 

;------------------------------------------------------------------------------

; EXEC-friendly ROM header.

;------------------------------------------------------------------------------

ROMHDR: BIDECLE ZERO ; MOB picture base (points to NULL list)

BIDECLE ZERO ; Process table (points to NULL list)

BIDECLE MAIN ; Program start address

BIDECLE ZERO ; Bkgnd picture base (points to NULL list)

BIDECLE ONES ; GRAM pictures (points to NULL list)

BIDECLE TITLE ; Cartridge title/date

DECLE $03C0 ; Flags: No ECS title, run code after title,

; ... no clicks

ZERO: DECLE $0000 ; Screen border control

DECLE $0000 ; 0 = color stack, 1 = f/b mode

BIDECLE ONES ; GRAM pictures (points to NULL list)

ONES: DECLE 1, 1, 1, 1, 1 ; Color stack initialization

;------------------------------------------------------------------------------

 

TITLE DECLE 112, "BRC Australia", 0

 

=============Underlay of BRC Logo==============

 

 

Plot V2,H9 ;place card on second row down, and ninth column across

Color 7 ;Chooses white from Intv colour palette.

 

PROC

DECLE %00001000

DECLE %00000110

DECLE %00000010

DECLE %00000011

DECLE %00000011

DECLE %00000010

DECLE %00000110

DECLE %00001000

ENOP

 

Plot V2,H11 ;place card on second row down, and eleventh column across

Color 7 ;Chooses white from Intv colour palette.

 

PROC

DECLE %00001000

DECLE %00000110

DECLE %00000010

DECLE %00000011

DECLE %00000011

DECLE %00000010

DECLE %00000110

DECLE %00001000

ENOP

 

Plot V2,H13 ;place card on second row down, and thirteenth column across

Color 7 ;Chooses white from Intv colour palette.

 

PROC

DECLE %00001000

DECLE %00000110

DECLE %00000010

DECLE %00000011

DECLE %00000011

DECLE %00000010

DECLE %00000110

DECLE %00001000

ENOP

 

 

===============Colour overlay of BRC Logo============

 

 

Plot V2,H9 ;place card on second row down, and ninth column across

Color 9 ;Chooses orange from Intv colour palette.

 

PROC

DECLE %00110000

DECLE %01111000

DECLE %01111100

DECLE %11111100

DECLE %11111100

DECLE %01111100

DECLE %01111000

DECLE %00110000

ENOP

 

Plot V2,H11 ;place card on second row down, and eleventh column across

Color 6 ;Chooses yellow from Intv colour palette.

 

PROC

DECLE %00110000

DECLE %01111000

DECLE %01111100

DECLE %11111100

DECLE %11111100

DECLE %01111100

DECLE %01111000

DECLE %00110000

ENOP

 

Plot V2,H13 ;place card on second row down, and thirteenth column across

Color E ;Chooses bright green from Intv colour palette.

 

PROC

DECLE %00110000

DECLE %01111000

DECLE %01111100

DECLE %11111100

DECLE %11111100

DECLE %01111100

DECLE %01111000

DECLE %00110000

ENOP

 

MAIN EIS ; Enable interrupts

here B here ; Spin forever.

 

 

================END OF PROGRAM================

Edited by Snafu-1982
  • Like 1
Link to comment
Share on other sites

Looks good so far. Looks like you are getting things figured out.

 

The biggest problem I see is that you can't plot two cards at the same location in backtab. Each position on the grid is a memory location -

when you "plot" a card there it overwrites the last card.

 

In order to create your logo, you would have to do the "white parts" in backtab, as plotted characters, and then do the "color" parts as motion objects, which can be placed on top of the background.

 

Does this make any sense?

 

So far, so good!

 

Catsfolly

Link to comment
Share on other sites

Does this make any sense?

 

So far, so good!

 

Catsfolly

 

Thanks, Yes, that was helpful, I didn't realise only one object can be placed onto a card. So if I understand this correctly, I have to call the first three graphics from the background (BACKTAB), and three from the moving images memory? I'll look further into this "BACKTAB" statement, to see how it's used and so on. This paragraph from the Intellivision lives site did clarify the component set abit more.

 

http://intellivision.us/library/library/Games/Trivia/consoles.htm

 

SYSTEM RAM

The CPU and the STIC are linked together and served by the System RAM, the GI RA-3-9600. The System RAM is not just a simple dumb memory chip. It contains (1) 240 locations of information about the 240 background cards (BACKTAB), (2) 112 locations of simple 16-bit ram, used as the CPU stack and (3) a bus arbitration controller to control access to the Graphics ROM (GROM) and the Graphics RAM (GRAM), both of which are accessed by the CPU and the STIC (but never at the same time). The System RAM is crucial from the hardware point of view, but the timing features are transparent to the programmer.

 

I gotta thank the lads who have placed together the detailed documentation with the SDK 1600, that must of taken many months or years to compile. When reading it through this week, admitfully I found much of it daunting, as intv assembly is a very different beast to Apple or Vic Basic. I'm building my programs now in Elektronite's Intelliware, only downloaded this last night. Before I was using Nostalgia which seems to be a very buggy program, Intelliware works much smoother and is more user friendly.

Link to comment
Share on other sites

Thanks, Yes, that was helpful, I didn't realise only one object can be placed onto a card. So if I understand this correctly, I have to call the first three graphics from the background (BACKTAB), and three from the moving images memory? I'll look further into this "BACKTAB" statement, to see how it's used and so on.

 

The STIC is a character oriented display primarily. Character oriented displays have two main components: The character generator memory and the text buffer. In the Intellivision, we call the character generator memory the GROM and GRAM, and we call the text buffer the BACKTAB. (I don't know what the official name for BACKTAB is; I'm reusing the name Carl gave it.)

 

If you'd like to compare to other contemporary systems, you might look at the TMS9918 VDP used in the TI Home Computer, Colecovision and MSX. The VDP called these the "pattern table" and "name table" respectively. In fact, if you'd like an introduction to character graphics plus sprites (aka MOBs), TI's SPPU004 "Video Display Processors Programmer's Guide" is good reading. It covers TI's VDP, but the concept of a character-oriented displays overlaid with moving objects is common between the two. The STIC is closest to the VDP's "Graphics I" mode. Some links: Individual scanned pages and a handy zip file. (Note: If you think it'll confuse you more than it'll help you, skip the links.)

 

In any case, most of the character graphics based systems of the early 80s worked in a similar way. You have one memory that sets up the set of pictures fragment tiles you can display (fixed sized tiles), and another memory that says which of these tiles to display in each grid location and what colors to give each grid location. For systems that supported sprites/MOBs, you get an additional set of hardware controlled objects that you can then put over (or under) the character matrix, placing pictures at more arbitrary pixel positions. This makes it easy to set up, say, a maze or backdrop, and then put moving actors into the scene over that.

 

In the Intellivision (as well as the VDP), the tiles are 8 pixels by 8 pixels, with one bit per pixel. Setting a bit to 1 makes the pixel "on" or "foreground", and setting a bit to 0 makes the pixel "off" or "background." In the Intellivision, both character graphics and MOB (aka sprite) graphic pictures come from the exact same GROM / GRAM picture memory. Characters on the backdrop can only have two colors—foreground and background—and MOBs can only have one color. If you need more than 2 colors in a given tile, you can make up the deficit by overlaying MOBs on the scene.

 

 

This model is in stark contrast to the Apple ][ bitmap graphics model, which is closer to how computers today work. In that model, the computer just gives you a 280x192 array of pixels, and you're free to color them however you like. (Ok, in the Apple ][ specifically, it wasn't exactly a 280x192 color display; more like 140x192 with half-pixel positioning... but I digress.) In the bitmap model, as a programmer you might define tiles you want to overlay as a programming simplification, but under the hood the hardware just gives you a big array of pixels and everything else is a software construct on top of that.

 

It's worth noting that the Atari 2600 model is closer to the bitmap model, except it has a different constraint: It doesn't store the bitmap anywhere. It only has a 1 line buffer, and so the CPU must "chase the beam" and generate the display on the fly. It does have some limited notion of sprites, but otherwise, it's much more crude than the Intellivision's STIC.

 

For your particular title screen, you'll need to load two pictures into GRAM:

 

DECLE %00001000

DECLE %00000110

DECLE %00000010

DECLE %00000011

DECLE %00000011

DECLE %00000010

DECLE %00000110

DECLE %00001000

 

and

 

DECLE %00110000

DECLE %01111000

DECLE %01111100

DECLE %11111100

DECLE %11111100

DECLE %01111100

DECLE %01111000

DECLE %00110000

 

You'd then set three background cards to display one of the images and grab three MOBs to display the other as an overlay.

 

 

 

I gotta thank the lads who have placed together the detailed documentation with the SDK 1600, that must of taken many months or years to compile.

 

I wrote SDK-1600 and the documentation in it, but the vast majority of the information came from the reverse engineering work that Carl Mueller did years ago. I can't imagine how long that must have taken him. I was able to use his documentation to write up jzIntv and build the SDK.

 

When reading it through this week, admitfully I found much of it daunting, as intv assembly is a very different beast to Apple or Vic Basic.

 

If you read Intro to CP-1600, I did include some examples that show parallels between BASIC and CP-1600 code.

 

 

I'm building my programs now in Elektronite's Intelliware, only downloaded this last night. Before I was using Nostalgia which seems to be a very buggy program, Intelliware works much smoother and is more user friendly.

 

I've never used it. If I recall correctly, though, Intelliware is a repackaged version of jzIntv / SDK-1600. :-)

Edited by intvnut
Link to comment
Share on other sites

If you read Intro to CP-1600, I did include some examples that show parallels between BASIC and CP-1600 code.

 

Also, I have some other tutorial information I've written on the Intellivision Wiki that might help you bridge the language gap here:

 

There are some other tutorials, some written by me, some written by others on the Programming Tutorials page.

Link to comment
Share on other sites

For your particular title screen, you'll need to load two pictures into GRAM:

 

DECLE %00001000

DECLE %00000110

DECLE %00000010

DECLE %00000011

DECLE %00000011

DECLE %00000010

DECLE %00000110

DECLE %00001000

 

and

 

DECLE %00110000

DECLE %01111000

DECLE %01111100

DECLE %11111100

DECLE %11111100

DECLE %01111100

DECLE %01111000

DECLE %00110000

 

You'd then set three background cards to display one of the images and grab three MOBs to display the other as an overlay.

 

Okay, that gives me a better prospective on the concept, and makes things clearer.

 

 

I've never used it. If I recall correctly, though, Intelliware is a repackaged version of jzIntv / SDK-1600. :-)

 

 

I'm pretty sure you're right, aside from emulating games smoother then Nostalgia, it has a editor included which enables one to export .asm files to roms. It also gives an error report when exporting .asm files. Before I was cutting and chopping excerts out of the example files into notepad - a little crazy, but it was a starting point I guess. :) :)

 

I also had a quick look at the wiki last night, i'm sure again another excellent resource, and again thanks for all the suggestions, much stuff to look into.

Link to comment
Share on other sites

Reverse engineering the BACKTAB display format went fairly quickly. Fortunately, one of the first dumps I was provided with was Truckin', which unlike most Mattel-produced titles, makes few EXEC-calls talks directly to the display. I remember one of the most confounding things was the arrangement of the background color bits, the way they sandwich the "GRAM-toggle" bit and the MSB is not actually in the highest order position.

I think I got most of that, plus the STIC registers figured out in a couple of weeks time. The rest of the information came slowly, when I had more dumps to experiment with and work through most of my disassembly of the EXEC.

Good times. ;-)

Link to comment
Share on other sites

(I don't know what the official name for BACKTAB is; I'm reusing the name Carl gave it.)

 

I think that's the official name, from "Background Table." Even the document "Your Friend, The Exec" calls it that:

 

The 16-bit RAM consists of 352 words of dual port RAM, which sits on both the CPU and STIC busses. The first 240 words each represent a “card” of the background, and is known as “BACKTAB”.

Link to comment
Share on other sites

Well it's my first foot into the intellivision programming pool, I just wanted to know if I'm on the right track with this. I kind of understand I've done some of it correctly, but I know the statements referring to choosing the colours, and specifying the location where graphics go is not right, I've used a "Plot" statement (old Apple IIe programming language) in place of what is suppose to be there.

 

The aim of the program is just to do a cartridge opening screen with a magenta border, black screen, white text, and a somewhat pixated version of my own logo (just for fun).

 

Here are also some screen shots on what I understand about the intellivision interface, and some of the hex values used for selecting colours and etc.

 

(the following images were created in photoshop for demonstration)

 

post-34079-0-03833700-1348801003_thumb.gif

 

post-34079-0-30729600-1348801011_thumb.gif

 

post-34079-0-35035300-1348801019_thumb.gif

 

============Start of program=======================

 

 

ROMW 16

ORG $5000

 

;------------------------------------------------------------------------------

; EXEC-friendly ROM header.

;------------------------------------------------------------------------------

ROMHDR: BIDECLE ZERO ; MOB picture base (points to NULL list)

BIDECLE ZERO ; Process table (points to NULL list)

BIDECLE MAIN ; Program start address

BIDECLE ZERO ; Bkgnd picture base (points to NULL list)

BIDECLE ONES ; GRAM pictures (points to NULL list)

BIDECLE TITLE ; Cartridge title/date

DECLE $03C0 ; Flags: No ECS title, run code after title,

; ... no clicks

ZERO: DECLE $0000 ; Screen border control

DECLE $0000 ; 0 = color stack, 1 = f/b mode

BIDECLE ONES ; GRAM pictures (points to NULL list)

ONES: DECLE 1, 1, 1, 1, 1 ; Color stack initialization

;------------------------------------------------------------------------------

 

TITLE DECLE 112, "BRC Australia", 0

 

=============Underlay of BRC Logo==============

 

 

Plot V2,H9 ;place card on second row down, and ninth column across

Color 7 ;Chooses white from Intv colour palette.

 

PROC

DECLE %00001000

DECLE %00000110

DECLE %00000010

DECLE %00000011

DECLE %00000011

DECLE %00000010

DECLE %00000110

DECLE %00001000

ENOP

 

Plot V2,H11 ;place card on second row down, and eleventh column across

Color 7 ;Chooses white from Intv colour palette.

 

PROC

DECLE %00001000

DECLE %00000110

DECLE %00000010

DECLE %00000011

DECLE %00000011

DECLE %00000010

DECLE %00000110

DECLE %00001000

ENOP

 

Plot V2,H13 ;place card on second row down, and thirteenth column across

Color 7 ;Chooses white from Intv colour palette.

 

PROC

DECLE %00001000

DECLE %00000110

DECLE %00000010

DECLE %00000011

DECLE %00000011

DECLE %00000010

DECLE %00000110

DECLE %00001000

ENOP

 

 

===============Colour overlay of BRC Logo============

 

 

Plot V2,H9 ;place card on second row down, and ninth column across

Color 9 ;Chooses orange from Intv colour palette.

 

PROC

DECLE %00110000

DECLE %01111000

DECLE %01111100

DECLE %11111100

DECLE %11111100

DECLE %01111100

DECLE %01111000

DECLE %00110000

ENOP

 

Plot V2,H11 ;place card on second row down, and eleventh column across

Color 6 ;Chooses yellow from Intv colour palette.

 

PROC

DECLE %00110000

DECLE %01111000

DECLE %01111100

DECLE %11111100

DECLE %11111100

DECLE %01111100

DECLE %01111000

DECLE %00110000

ENOP

 

Plot V2,H13 ;place card on second row down, and thirteenth column across

Color E ;Chooses bright green from Intv colour palette.

 

PROC

DECLE %00110000

DECLE %01111000

DECLE %01111100

DECLE %11111100

DECLE %11111100

DECLE %01111100

DECLE %01111000

DECLE %00110000

ENOP

 

MAIN EIS ; Enable interrupts

here B here ; Spin forever.

 

 

================END OF PROGRAM================

 

Snafu,

 

That's great. I see that some very knowledgeable people have responded with some very interesting information. I just wanted to add a few things that may make things easier, especially while getting started.

 

The SDK-1600 contains a set of macros and library files that I've found very useful when setting these things up. First, check out the macro "cart.mac" in the "macros" folder. It encapsulates the "ROM Header" (that freaky boiler-plate chunk of data that must be included at the start of every program). It also contains additional macros for allocating memory, so that you don't have to keep track of memory locations yourself.

 

Then there's the "gimini.asm" module in the "library" folder. This module defines named constants for most of the Intellivision's memory map, and other useful values. For instance, it defines symbols for all the colours as well as the start of the BACKTAB and STIC registers, among many others.

 

Cheers!

-dZ.

Link to comment
Share on other sites

One last thing: Once you feel comfortable with the CP-1610 Assembly and you want to start writing your game, consider checking out P-Machinery. It's a simple "game engine" which combines many of the features available in the SDK-1600 to provide a basic event-driven skeleton for games.

 

It is not a "game making wizard," but more like a programming framework, albeit very limited at the moment. It includes a built-in task queue and scheduler (from the excellent TASKQ and TIMER libraries of the SDK-1600!), event-driven hand-controller input handler, and a few other amenities; already put together into a working engine.

 

It is the core of my Christmas Carol game, minus any graphics handler. It does contain a bunch of useful macros to allocate graphics in GRAM and manage the BACKTAB. I'm currently working on expanding it into a more complete game framework to include graphics and MOBs, but the current version should suffice to get a game going.

 

You can find information on the basic theory of P-Machinery in this thread.

 

-dZ.

Link to comment
Share on other sites

Just a further note. Although BACKTAB is apparently the official name, the nomenclatures I developed were not based on any official EXEC document (which I did not receive until long after I had finished the emulator, and which I never bothered to read in any detail). Most of what I came up with I took from the ECS programming book, like XS for XSIZE, and so forth.

There were also a couple of old USENET posts floating around that very vaguely described things, like how the scrolling worked and may have used some official terminology.

Finally, the Blue Sky Ranger's website did not go up until mid-1995, I believe. By the time I discovered it, the emulator was close to done and I even remember sending them a copy, "just for fun" at the time.

:-)

  • Like 1
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...