Jump to content
IGNORED

Baby Steps


Opry99er

Recommended Posts

Neat info guys, and have played around and made progress since.

 

I have been able to stuff much more than 64 tiles into the program, and with proper labeling, and proper defining, I'm able to access any of them now.

 

I hope it doesn't violate any hardware restrictions (assuming I'm within proper file sizes). And I was wondering if there's more info with IntyBASIC and VBLANK - want to explore this "void which binds" in more detail. :)

Link to comment
Share on other sites

And I was wondering if there's more info with IntyBASIC and VBLANK - want to explore this "void which binds" in more detail. :)

What do you need to know? You can redefine 16 cards with music and 18 without. As well as reprogramming cards the VBLANK code handles colour stack and border colour changes, sprite positioning and collision, sounds, voice and scrolling.

Link to comment
Share on other sites

What do you need to know? You can redefine 16 cards with music and 18 without. As well as reprogramming cards the VBLANK code handles colour stack and border colour changes, sprite positioning and collision, sounds, voice and scrolling.

 

Voice too? I did not know that...

Link to comment
Share on other sites

What do you need to know? You can redefine 16 cards with music and 18 without. As well as reprogramming cards the VBLANK code handles colour stack and border colour changes, sprite positioning and collision, sounds, voice and scrolling.

 

Nothing more now that you made it simpler. :)

Link to comment
Share on other sites

This is a stupid question but this thread seems to mention converting games written in other versions of BASIC to IntyBASIC. In days gone by I have programmed in some other versions of BASIC and all of them that I can recall using had commands for drawing lines and such. Something like LINE(y1,x1,y2,x2).


Now I am pretty sure I didn't overlook the IntyBASIC version of a line command, but now that I see the video for "Missile Domination" I wanted to ask.

Is there an easy way to draw a line on the screen on the intellivision? (and I mean using IntyBASIC).

Link to comment
Share on other sites

Is there an easy way to draw a line on the screen on the intellivision? (and I mean using IntyBASIC).

"Easy" is a relative thing ;). There are no built in commands for IntyBASIC to draw lines. Coloured squares mode would give you a resolution of 40x24 (w x h) so its quite "chunky! and you can only use the first 8 colours in the palette. You'd have to implement your own Bresenham line drawing routine too. Missile Domination uses GRAM cards so you a limited in the number of lines you could draw on screen at once.

  • Like 1
Link to comment
Share on other sites

"Easy" is a relative thing ;). There are no built in commands for IntyBASIC to draw lines. Coloured squares mode would give you a resolution of 40x24 (w x h) so its quite "chunky! and you can only use the first 8 colours in the palette. You'd have to implement your own Bresenham line drawing routine too. Missile Domination uses GRAM cards so you a limited in the number of lines you could draw on screen at once.

That is what I thought. But it never hurts to ask.

Link to comment
Share on other sites

 

This is a stupid question...

 

 

Not at all. I was thinking of "turtle graphics" in this latest discussion, supported in other languages, and AFAIK fully supported in some versions of BASIC. (I think, likely though in some beginner's, or educational, versions of BASIC.)

 

I too can see this being "chunky" with IntyBASIC and the Intellivision.

 

IntyBASIC is indeed powerful, and can do lots. The only limitation it really has is the Intellivision hardware.

 

I'll add a coloured squares line drawing routine as an example into the SDK.

 

A function for this in the constants.bas would be nice. :)

Edited by PuzZLeR
Link to comment
Share on other sites

 

Not at all. I was thinking of "turtle graphics" in this latest discussion, supported in other languages, and AFAIK fully supported in some versions of BASIC. (I think, likely though in some beginner's, or educational, versions of BASIC.)

 

I too can see this being "chunky" with IntyBASIC and the Intellivision.

 

IntyBASIC is indeed powerful, and can do lots. The only limitation it really has is the Intellivision hardware.

 

 

A function for this in the constants.bas would be nice. :)

 

Chunky graphics on the Intellivision using Colored Squares mode is much too chunky for most applications -- at least in my opinion.

 

One limitation (or feature) of the Intellivision graphics is that they are character-based, not bitmapped. This is contrary to many other classic consoles.

 

This means that you cannot really "draw" on the screen like you would do on some ancient micros. You should think of Intellivision graphics instead like "character mode" or "text mode" in old micros, like when you draw graphics using PETSCII characters on a C=64 or ANSI graphics on DOS.

 

In that sense, there is no "hi-res" mode on the Intellivision, just "text mode." It just so happens that the built-in character set (GROM) includes graphics characters, just like some old micros did. The difference is that you get to define an additional 64 characters (GRAM).

 

-dZ.

Edited by DZ-Jay
  • Like 1
Link to comment
Share on other sites

The graphics "bloxels" and "lines" in GROM can be used to good effect for fancy borders and making shapes. You just have to get inventive to make the best use of whats available.

 

Exactly. And have been playing around with this.

 

Been looking at GROM here:

http://wiki.intellivision.us/index.php?title=Graphics_ROM

 

I'm sure it's been demonstrated similarly in other threads, but, anyway, the following draws the first of the lines:

print at 0, "\188"

More at 189-195, and more still from 200-207, and more shapes to expand upon if you're bored.

 

And you can always delete with the space ("\0"), or redraw, or reposition from 0-239. Hmmm. My point is that I just discovered that you can indeed create that "turtle graphics" effect with IntyBASIC. All you need is a few subroutines/functions with dimensions as parameters.

 

Maybe crude since it is character based (as mentioned), but possible.

 

Still working on my game, but wouldn't mind looking into giving Intellivision a Turtle Graphics ROM, or code for it, as a future pet project. :)

  • Like 1
Link to comment
Share on other sites

 

Chunky graphics on the Intellivision using Colored Squares mode is much too chunky for most applications -- at least in my opinion.

 

One limitation (or feature) of the Intellivision graphics is that they are character-based, not bitmapped. This is contrary to many other classic consoles.

 

This means that you cannot really "draw" on the screen like you would do on some ancient micros. You should think of Intellivision graphics instead like "character mode" or "text mode" in old micros, like when you draw graphics using PETSCII characters on a C=64 or ANSI graphics on DOS.

 

In that sense, there is no "hi-res" mode on the Intellivision, just "text mode." It just so happens that the built-in character set (GROM) includes graphics characters, just like some old micros did. The difference is that you get to define an additional 64 characters (GRAM).

 

-dZ.

 

Thanks. I think my original question could really have been ask as: does the intellivision hardware support a bitmapped graphics mode or just the character based mode? I suspected it did not have a graphics mode but figured it wouldn't hurt to ask.

 

IntyBASIC is indeed pretty incredible (IMO).

  • Like 1
Link to comment
Share on other sites

The graphics "bloxels" and "lines" in GROM can be used to good effect for fancy borders and making shapes. You just have to get inventive to make the best use of whats available.

 

Sure. I just went that it is not practical to implement graphics commands such as "LINE" or "CIRCLE."

 

-dZ.

Link to comment
Share on other sites

For computers that allow custom characters, but don't have a true bitmapped mode (e.g. VIC-20, but plenty of others I've understood), you can simulate a bitmap by using each custom character once on the screen and then routines to set or clear pixels within each character as if it was a bitmap. Thus the resolution depends on how many custom characters at once you can display, as using the same custom character twice means pixels you set within it will appear in both places.

 

The Intellivision thus has 64 GRAM characters, that could be arranged into a window of 64x64 pixels, or 128x32 pixels. I made a small demo program that goes POKE first into GRAM memory. As per the documentation I found, you can only change this memory during VBLANK2, thus the need to WAIT after plotting each pixel?

 

Anyway, the program probably can be optimized, tidyed up and more IntyBASIC friendly by using constructs that I'm not familiar with. Due to setting up the display, it takes a couple seconds before you see anything happen on the screen. I looked at DEFINE with VARPTR syntax, but that is only so you can have ready made BITMAP definitions and then have an array with pointers to different definitions so you can change the contents of one GRAM card with a different, albeit predefined pattern? Or can you set it to point to an array that you directly change the contents of for entirely dynamic changes?

 

 

 include "contrib/constants.bas"
 
  MODE 1
 
  REM Macro to read GRAM memory which begins at $3800
  DEF FN gramadr(x,y,r) = $3800+x*8+y*128+r
 
  REM Set up screen full of GRAM characters + clear GRAM memory
  FOR py=0 TO 3:FOR px=0 TO 15
    #BACKTAB(py*20+px)=((py*16)+px)*8+7+GRAM
    DEFINE py*16+px,1,blank:WAIT
  NEXT px:NEXT py
 
  FOR px=0 TO 127
   py=16+sinval(px%32)
   #adr=gramadr(px/8,py/8,py%
   POKE #adr,PEEK(#adr) OR bitval(px%:WAIT
  NEXT px
 
loop:
  GOTO loop
 
bitval:
  data 128,64,32,16,8,4,2,1 : REM Helper data to find out bit value
 
sinval:
  data 0,3,6,8,11,13,14,15,15,15,14,13,11,8,6,3
  data 0,-3,-6,-8,-11,-13,-14,-15,-15,-15,-14,-13,-11,-8,-6,-3
 
blank:
  BITMAP "........"
  BITMAP "........"
  BITMAP "........"
  BITMAP "........"
  BITMAP "........"
  BITMAP "........"
  BITMAP "........"
  BITMAP "........"
  • Like 3
Link to comment
Share on other sites

Cool demo, Carlsson!

 

You don't have to wait after every pixel plot.

 

if you change this line:

 POKE #adr,PEEK(#adr) OR bitval(px%:WAIT

to:

	POKE #adr,PEEK(#adr) OR bitval(px% 
	if (px AND 3) = 3 then wait

It will plot 4 pixels per vblank. I tried 8, but then there were gaps in the display:

 

4 pixels per vblank version:

 

post-14916-0-21901800-1452734880_thumb.gif

 

8 pixels per vblank version:

 

post-14916-0-09224800-1452734879_thumb.gif

 

Catsfolly

 

P.S. One approach to doing this would be to setup your bitmap in cartridge ram, which you can freely read and write to, and then use DEFINE statements to copy the cartridge ram to gram 16 cards at a time. Of course, I don't know if DEFINE will copy characters from cartridge ram definitions....

Edited by catsfolly
  • Like 1
Link to comment
Share on other sites

Thanks! At first I thought it was a matter how many pixels I'd plot before each WAIT, so I added a counter, but apparently it didn't work quite like that.

 

I don't know about the different cartridges with extra RAM, flashable ROM etc but I presume IntyBASIC can copy data from just about any mapped memory area.

 

Of course using up all 64 GRAM cards also leaves no room for sprites, but I suppose you could make a smaller window of say 64x32 pixels = 8x4 cards which would leave half the room for other graphics. It would result in a rather small bitmapped display, for whatever purpose you might need it. Perhaps a miniature radar display for a game like Rally-X or Defender?

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