Jump to content
IGNORED

IntyBASIC compiler


nanochess

Recommended Posts

I am wayyyy behind the power curve here but I really want to create programs with this basic compiler.

 

Was never interested in jzintv or emulation because I had a real Intellivision and Cuttle Cart, but well, this got me interested.

 

So how the hell do you even start jzintv? Not seeing a straight up binary, so what kind of compiler is needed to be in place to create a jzintv binary on the Intel Macs?

Link to comment
Share on other sites

I am wayyyy behind the power curve here but I really want to create programs with this basic compiler.

 

Was never interested in jzintv or emulation because I had a real Intellivision and Cuttle Cart, but well, this got me interested.

 

So how the hell do you even start jzintv? Not seeing a straight up binary, so what kind of compiler is needed to be in place to create a jzintv binary on the Intel Macs?

 

At this moment I cannot get into the web site :?

 

From this place http://spatula-city.org/~im14u2c/intv/ download the Mac OS X version and decompress it near your "Documents" folder (to ease access with terminal)

 

Use the terminal (or shell) which you can find in the Launchpad / Others, locate a folder called "bin" where are located the jzintv emulator and the as1600 assembler. You'll need to know the basic commands "cd" and "ls."

 

Download the IntyBASIC compiler and put it in a folder, write your programs with TextEdit (choose Format - Convert to normal text) and put in same folder. Also you can use the "vi" editor.

 

Compile your programs, move the .asm file to the "bin" folder and use as1600 and jzintv. That's all.

  • Like 1
Link to comment
Share on other sites

post-24767-0-59670500-1391141640_thumb.jpg

 

This is what I have so far.

main:
cls
wait
define 0,10,brick


for c=1 TO 239

PRINT COLOR 4, "\257"
next c
a=0
b=6
for c=0 TO 23
PRINT AT a COLOR 7, "\259"
a=a+1
if a=b then a=a+14:b=b+20
next c
print at 80 color 2, "\256\260\261\256\256\256"

print at 82 color 6, "\262"

a=8

for c=0 to 12
print at a color 3, "\258"
a=a+20
next c

for c=100 to 119
print at c color 3, "\258"
next c

for c=220 to 239
print at c color 3, "\258"
next c

a=14
b=20
for c=0 TO 20
PRINT AT a COLOR 1, "\95"
a=a+1
if a=b then a=a+14:b=b+20
next c
PRINT AT a COLOR 1, "\119"
PRINT AT 74 COLOR 1, "\126"

a=120
b=126
for c=0 TO 23
PRINT AT a COLOR 7, "\259"
a=a+1
if a=b then a=a+14:b=b+20
next c
print at 200 color 2, "\256\260\261\256\256\256"

print at 202 color 6, "\261"

a=134
b=140
for c=0 TO 23
PRINT AT a COLOR 7, "\259"
a=a+1
if a=b then a=a+14:b=b+20
next c
print at 214 color 2, "\256\263\260\256\263\256"

print at 215 color 1, "\263"

print at 218 color 1, "\263"

print at 90 color 5, "\264"
print at 110 color 5, "\265"



end:
goto end



brick:
 
BITMAP "11110011"
BITMAP "01110101"
BITMAP "10100010"
BITMAP "00000000"
BITMAP "00111111"
BITMAP "01010111"
BITMAP "00101010"
BITMAP "00000000"

BITMAP "00000001"
BITMAP "01000100"
BITMAP "01010100"
BITMAP "00010000"
BITMAP "10000010"
BITMAP "10100010"
BITMAP "00101000"
BITMAP "00001001"

BITMAP "11101110"
BITMAP "11101110"
BITMAP "11010110"
BITMAP "00111000"
BITMAP "11010110"
BITMAP "11101110"
BITMAP "11101110"
BITMAP "00000000"

BITMAP "10101010"
BITMAP "10111011"
BITMAP "10111011"
BITMAP "00010001"
BITMAP "10101010"
BITMAP "11101110"
BITMAP "11101110"
BITMAP "01000100"

BITMAP "00000000"
BITMAP "00010100"
BITMAP "01010101"
BITMAP "01010101"
BITMAP "00010101"
BITMAP "01010101"
BITMAP "01010101"
BITMAP "00000000"


BITMAP "01010110"
BITMAP "11101011"
BITMAP "11000011"
BITMAP "10111100"
BITMAP "10100111"
BITMAP "10111110"
BITMAP "10111101"
BITMAP "01000010"

BITMAP "00000000"
BITMAP "01111110"
BITMAP "10011001"
BITMAP "10100101"
BITMAP "10111101"
BITMAP "10111101"
BITMAP "11011011"
BITMAP "01100110"

BITMAP "00000000"
BITMAP "00101010"
BITMAP "01010100"
BITMAP "00101010"
BITMAP "01011110"
BITMAP "00111110"
BITMAP "00000000"
BITMAP "00000000"

BITMAP "10111101"
BITMAP "01111110"
BITMAP "10000001"
BITMAP "01011010"
BITMAP "01111110"
BITMAP "00111100"
BITMAP "11100111"
BITMAP "01111110"

BITMAP "11111111"
BITMAP "10100101"
BITMAP "10111101"
BITMAP "00000000"
BITMAP "00100100"
BITMAP "01100110"
BITMAP "00000000"
BITMAP "11100111"

Only thing I have to figure out how to get color number 8-15, and also change the tile back colors too. This should make thing a lot more colorful. I'm guessing the colors have it own 8x8 cell.

And also figure out how to calculate the sprite data. Is there a way to use binary? I haven't tried %00110010. I'll have to figure out what color stack means. I'm visual person and trying to see what it is.

This really reminds me of SmileBASIC that is on Petit Computer. There's many routines that I made that put tiles on display. Intellivision is more complicated due to data being 12 or 16 bit numbers. I did try to use 16-bit data in place of bitmap, I guess they are suppose to be 10-bit or 12-bit for each data instead of 8-bit. This is quite interesting to work with a new system :). Now it will take me awhile to master it. Colecovision C programming took a long time for me to completely understand it. SmileBASIC also tooks months. SmileBASIC I don't think I used PEEK or POKE. In time, I will eventually get a game made for the Intellivision. :)

  • Like 7
Link to comment
Share on other sites

attachicon.giftilingWIP.jpg

 

...

 

Only thing I have to figure out how to get color number 8-15, and also change the tile back colors too. This should make thing a lot more colorful. I'm guessing the colors have it own 8x8 cell.

 

And also figure out how to calculate the sprite data. Is there a way to use binary? I haven't tried %00110010. I'll have to figure out what color stack means. I'm visual person and trying to see what it is.

 

This really reminds me of SmileBASIC that is on Petit Computer. There's many routines that I made that put tiles on display. Intellivision is more complicated due to data being 12 or 16 bit numbers. I did try to use 16-bit data in place of bitmap, I guess they are suppose to be 10-bit or 12-bit for each data instead of 8-bit. This is quite interesting to work with a new system :). Now it will take me awhile to master it. Colecovision C programming took a long time for me to completely understand it. SmileBASIC also tooks months. SmileBASIC I don't think I used PEEK or POKE. In time, I will eventually get a game made for the Intellivision. :)

It's starting to look like a game already!

 

 

The upper colors are set by setting bit 12 in the screen memory. This only works for custom defined (gram) characters, not for the grom (built in) characters.

The "color stack" is a list of 4 colors set up for the background of the characters. Initially the first color in the list

is used for the background. If a character has the "advance color stack" bit set (bit 13), the background color advances to the next color in the list. If the 4th color is being displayed, the color will go back to the first color.

 

Catsfolly

;;--------------------------------------------------------------------------;;
			;; Useful bits for Color Stack Mode                                         ;;
			;;                                                                          ;;
			;; Display format word layout in Color Stack Mode:                          ;;
			;;   13   12    11   10    9    8    7    6    5    4    3    2    1    0   ;;
			;; +----+-----+----+----+----+----+----+----+----+----+----+----+----+----+ ;;
			;; |Adv.|FG   |GRAM|           GRAM/GROM Card #            |   FG Color   | ;;
			;; |col |Bit3/|GROM|    (0-255 for GROM, 0-63 for GRAM)    |   Bits 0-2   | ;;
			;; |stck|----------|                                       |              | ;;
			;; |    |col. sqr. |                                       |              | ;;
			;; |    |mode slct.|                                       |              | ;;
			;; +----+-----+----+----+----+----+----+----+----+----+----+----+----+----+ ;;
			;;                                                                          ;;
			;; Color Stack Notes:                                                       ;;
			;;  -- If GRAM card, two MSBs of Card # are ignored, and may be used by     ;;
			;;     the program to store other information.                              ;;
			;;                                                                          ;;
			;;  -- Bit 12 is set and Bit 11 is cleared, this word is treated as a       ;;
			;;     colored-square-mode display word, in the format below.               ;;
			;;                                                                          ;;
			;;  -- The color stack is reset to offset 0 at the start of the display.    ;;
			;;     Setting the 'advance' bit advances the color stack by one for that   ;;
			;;     card and all cards after it in normal left-to-right scanning order.  ;;
			;;                                                                          ;;
			;;  -- Bits 14 and 15 of the display format word are ignored and may be     ;;
			;;     used by the program to store status bits, etc.                       ;;
  • Like 2
Link to comment
Share on other sites

post-24767-0-80852600-1391146646_thumb.jpg

d=0
for c=220 to 227
print at c color d, "\258"
d=d+1
next c

d=0
for c=228 to 235
print at c color ($1000+d), "\258"
d=d+1
next c

I've got the upper bit colors now :D. Thanks Catsfolly :).

 

Oh this wiki page has the code for the GROM images.

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

I used the programming calculator, to convert the hex to dec.

Edited by Kiwi
  • Like 3
Link to comment
Share on other sites

I'm getting an "Illegal Instruction" message when I try to run intybasic on my macbook. (OSX 10.6. 8)

IntyBASIC.exe runs fine on my netbook.

 

Hmmm! It's built for OSX 10.9 64-bit, anyway it works in OSX 10.8

 

I've checked settings and I cannot find a 32-bit option nor a way to target 10.6.

 

Have you seen if it works without arguments? at least saying the usage?

 

attachicon.giftilingWIP.jpg

 

This is what I have so far.

And also figure out how to calculate the sprite data. Is there a way to use binary? I haven't tried %00110010. I'll have to figure out what color stack means. I'm visual person and trying to see what it is.

 

 

Way too cool! :) :thumbsup:

 

Sprite data is defined same way as tiles and share space in GRAM memory, so you can use BITMAP statement. (check game2.bas)

 

Every Intellivision sprite is 8 bits wide and you have the choice of 8 or 16 pixels high.

Link to comment
Share on other sites

 

Hmmm! It's built for OSX 10.9 64-bit, anyway it works in OSX 10.8

 

I've checked settings and I cannot find a 32-bit option nor a way to target 10.6.

 

Have you seen if it works without arguments? at least saying the usage?

 

 

I tried everything I could think of...

davids-macbook:basic dsa2020$ ../bin/intybasic 
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic game1.bas test.asm
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic -v
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic -?
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic help
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic a b c d e f 
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic game1.bas
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic nosuchfile.bas
Illegal instruction

Link to comment
Share on other sites

I tried everything I could think of...

davids-macbook:basic dsa2020$ ../bin/intybasic 
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic game1.bas test.asm
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic -v
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic -?
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic help
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic a b c d e f 
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic game1.bas
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic nosuchfile.bas
Illegal instruction

 

I can suppose only that your Mac is 32-bits :(

Link to comment
Share on other sites

Congrats on the new dev platform, nanochess!

 

I only have experience with OS X cross compiling from Linux, but I do know until recently Apple used the same custom patched version of gcc that I do for my builds, so I may have advice that will help...

 

Is there a way you can add "-arch i386 -m32" to your compilation flags? This would make a 32-bit binary that should run on both 32-bit and 64-bit.

 

I also found that folks using older versions like 10.4 couldn't run binaries built against newer SDKs, so I had to go with the Apple 1.5 SDK.

 

These two measures sorted out all of the reported OS X compatibility issues I ran into with the bB OS X binaries for bB.

  • Like 1
Link to comment
Share on other sites

 

Nice Ed! I'm still trying to track down my Cuttle Cart. When you added it to the cart was there anything special you needed to do? I recall the process of updating the cart to be a bit quirky and using a database to check CRCs values for known carts. With these obviously not being the database I was wondering what was needed. Thanks!

Yeah, the CC3 software is quirky. New games first need to be added to the database, then scan the directory so the new games show up, and then finally add them to the mirco-sd card.

Link to comment
Share on other sites

Congrats on the new dev platform, nanochess!

 

I only have experience with OS X cross compiling from Linux, but I do know until recently Apple used the same custom patched version of gcc that I do for my builds, so I may have advice that will help...

 

Is there a way you can add "-arch i386 -m32" to your compilation flags? This would make a 32-bit binary that should run on both 32-bit and 64-bit.

 

I also found that folks using older versions like 10.4 couldn't run binaries built against newer SDKs, so I had to go with the Apple 1.5 SDK.

 

These two measures sorted out all of the reported OS X compatibility issues I ran into with the bB OS X binaries for bB.

 

Thanks for the info! I've found an option in XCode which says Universal Binary 32-bit/64-bit

 

I tried everything I could think of...

davids-macbook:basic dsa2020$ ../bin/intybasic 
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic game1.bas test.asm
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic -v
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic -?
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic help
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic a b c d e f 
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic game1.bas
Illegal instruction
davids-macbook:basic dsa2020$ ../bin/intybasic nosuchfile.bas
Illegal instruction

 

Please test this executable.

intybasic.zip

Link to comment
Share on other sites

post-24767-0-73014000-1391226259.gif

 

This is a mock-up I did ages ago. I decided to convert this mockup over to the Intellvision. I thought it would be perfect since I don't know how to change the secondary color, black to a different color. I've noticed that boulderdash screen shot in the other thread had 2 different colors in a cell.

 

Catsfolly's bit table helped me a lot in regarding getting sprite data. I usually convert the card number to from dec to binary and then use the calculator to convert binary with the color data to hex.

 

I also understood nanochess's sprite example. First number x and y is dec and then it added to the hexidecimal which hold the sprite information.

 

Here is the result.

 

post-24767-0-30856300-1391226241_thumb.png

 

Source:Mockup1.bas

Edited by Kiwi
  • Like 4
Link to comment
Share on other sites

This is a mock-up I did ages ago. I decided to convert this mockup over to the Intellvision. I thought it would be perfect since I don't know how to change the secondary color, black to a different color. I've noticed that boulderdash screen shot in the other thread had 2 different colors in a cell.

 

Catsfolly's bit table helped me a lot in regarding getting sprite data. I usually convert the card number to from dec to binary and then use the calculator to convert binary with the color data to hex.

 

I also understood nanochess's sprite example. First number x and y is dec and then it added to the hexidecimal which hold the sprite information.

 

Here is the result.

 

Pretty cool!

 

BTW, I think probably you're using Nostalgia emulator.

 

I've tested with jzintv emulator and the sprites disrupt. I've noticed you're using 16-pixels high sprites but Intellivision requires these to be aligned in even GRAM boundary and you're using odd GRAM cards.

 

Suppose you define a character 8x8 in GRAM 0 (256) and then you add a sprite 8x16 in GRAM 1. Instead it should be in GRAM 2 to be aligned right.

Link to comment
Share on other sites

 

Thanks for the info! I've found an option in XCode which says Universal Binary 32-bit/64-bit

 

 

Please test this executable.

Now I get this error -

davids-macbook:basic dsa2020$ ../bin/intybasic game1.bas test.asm
dyld: Library not loaded: /usr/lib/libc++.1.dylib
  Referenced from: /Users/dsa2020/Downloads/jz/basic/../bin/intybasic
  Reason: image not found
Trace/BPT trap
davids-macbook:basic dsa2020$ 

Apple sure doesn't make it easy for people who don't upgrade to the latest OSX (I would upgrade, but Apple says that newer versions of their OSX are not compatible with my machine...)

I guess I'll just stick with the windows version...

Link to comment
Share on other sites

Now I get this error -

davids-macbook:basic dsa2020$ ../bin/intybasic game1.bas test.asm
dyld: Library not loaded: /usr/lib/libc++.1.dylib
  Referenced from: /Users/dsa2020/Downloads/jz/basic/../bin/intybasic
  Reason: image not found
Trace/BPT trap
davids-macbook:basic dsa2020$ 

Apple sure doesn't make it easy for people who don't upgrade to the latest OSX (I would upgrade, but Apple says that newer versions of their OSX are not compatible with my machine...)

I guess I'll just stick with the windows version...

 

Hmmmm! I needed to set up also the Mac OS X 10.6 SDK (fortunately I could found it) and then it failed with an error of C++ requiring 10.7 but I selected the GNU C++ libraries and it made the trick.

 

Please test this again :)

intybasic.zip

Link to comment
Share on other sites

BTW, Saturday's fun :D

 

Do you want to see what the compiler does with your BASIC source code?

 

Open the generated ASM file with a text-editor and see line-by-line how the compiler converted your source :) as the original BASIC source code is intermixed as comments.

 

Of course the final binary generated by assembler doesn't include a clue of source code.

Link to comment
Share on other sites

 

Pretty cool!

 

BTW, I think probably you're using Nostalgia emulator.

 

I've tested with jzintv emulator and the sprites disrupt. I've noticed you're using 16-pixels high sprites but Intellivision requires these to be aligned in even GRAM boundary and you're using odd GRAM cards.

 

Suppose you define a character 8x8 in GRAM 0 (256) and then you add a sprite 8x16 in GRAM 1. Instead it should be in GRAM 2 to be aligned right.

 

Yup, I'm using Nostalgia 5.0. I will keep the card number in mind to be even. All the 16 tall sprites were odd numbered. It a little too much work to change them all, although I will try to learn how to split the number up and add them back together.

 

My next step is to make a small game.

  • Like 1
Link to comment
Share on other sites

 

Yup, I'm using Nostalgia 5.0. I will keep the card number in mind to be even. All the 16 tall sprites were odd numbered. It a little too much work to change them all, although I will try to learn how to split the number up and add them back together.

 

My next step is to make a small game.

 

The easiest way would be to Insert a small null 8x8 bitmap before sprites and change GRAM numbers in SPRITE.

Link to comment
Share on other sites

I added another 8x8 tiles to push down the list. I was first thinking I would have to pull apart the hexadecimal and then change the card number and put it together. I just now thought why don't I just add 8 to the hexadecimal to advance the card to the next picture, simple eh? Sure enough it works. :)

 

Here's the new binary to try on the real system or jzinty. newprog.bin

 

I apologize and I'm not sure how to run jzinty. Thank you for testing it on jzinty. Nostalgia GUI helps me run test the program quickly. I have the Window's 'Run' program pinned to the task bar for quick compiling command, to compile the basic and then compile the asm using as1600.

 

also the updated source code: newprog.bas

  • Like 2
Link to comment
Share on other sites

I added another 8x8 tiles to push down the list. I was first thinking I would have to pull apart the hexadecimal and then change the card number and put it together. I just now thought why don't I just add 8 to the hexadecimal to advance the card to the next picture, simple eh? Sure enough it works. :)

 

Here's the new binary to try on the real system or jzinty.

 

I apologize and I'm not sure how to run jzinty. Thank you for testing it on jzinty. Nostalgia GUI helps me run test the program quickly. I have the Window's 'Run' program pinned to the task bar for quick compiling command, to compile the basic and then compile the asm using as1600.

 

Definitely it now works fine! :) :thumbsup:

  • Like 1
Link to comment
Share on other sites

post-24767-0-65717900-1391321247_thumb.jpg

 

I figured out how to use the color stack and change the border color.

 

initialization:

POKE $2C,$09 'border
POKE $28,$01 'first stack seems to be the default
POKE $29,$02 '2nd slot
POKE $2A,$03 '3rd slot
POKE $2B,$04 '4th slot

for c=160 to 167
print at c color $1006,"\256"
next c
print at 160 color $3003,"\258" 'I put this data here in here
for c=180 to 187
print at c color $1006,"\257"
next c

All of the following cards after that advance to the next color.

 

If I put $3000 in a for next loop, then it cycles through the 4 stack. I'm happy that I was able to figure out how to change the secondary color. This should make the graphics a bit more interesting. I really love the colors that this system has.

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