Jump to content
IGNORED

Beginner help with IntyBasic


dalves

Recommended Posts

  • 2 weeks later...

Just a quick follow up. I bought a new gaming computer with an AMD Ryzen 5 with Vega 11 graphics. I installed jzintv but was still having problems with it stretching even when maintaining aspect ratio on the video card settings. I found out this had been a glitch in AMD's Radeon settings software, and when I updated it, it had been fixed. Jzintv is now working in 4:3. The only problem now is the colors are slightly off. The "Tan" color is greener and the "Brown" is dark green. All other emulators look like the colors are correct. I've tried adjusting the colors in my display settings, but when Intellivision looks good, every thing else looks way off. It's only happening on this new computer, so it has to be a setting thing. I'll keep tweaking it and see if I can find a good balance.

 

Thanks for all the help getting it setup in 4:3 with the correct border.

Link to comment
Share on other sites

On my gaming computer, and my test computer, I'm using the jzintv version from 12/25/2018. The colors look fine when I use my test computer through it's monitor, but the gaming PC colors look off when going through my HDTV. I would have assumed this would mean the TV was off or the colors on my video card were off. However, when I run the same Intellivision ROMS on my gaming computer through MAME, the colors are perfect.

 

I'll certainly read more on the link you sent about defining your own color palette, but if the new version does have updated colors, is there an easy way to revert back to the previous color palette, or is it build into the jzintv.exe?

Link to comment
Share on other sites

Each emulator defines it's own intellivision colour palette. If mame looks the same on both displays then I would expect the same version of jzintv to also look like eachother. The roms have nothing to do with it.

 

The --gfx-palette command switch is the only way I know to change the colour palette other than reverting to an older jzintv.

Link to comment
Share on other sites

Joe wrote a couple of weeks ago:

 

 

 

jzIntv currently uses SDL1 and pure software rendering. SDL1 has been deprecated for awhile, and has noticeable performance issues on modern hardware

 

Perhaps the way the SDL1 framework addresses the graphics card could result in odd colours, while e.g. MAME might be using a different, more modern framework or library which gets the colours right? Just speculation here, I'm willing to accept this is entirely unthinkable.

Link to comment
Share on other sites

Thanks for the info. I was looking at the link about using a custom palette. I was wondering if this is data I would add to my current batch file or does this need to be it's own file?

 

FWIW, I've attached pictures showing the difference in colors between my current jzintv and MAME. The MAME colors seems to be more consistent with what I get from jzintv on my Raspberry Pi, or when I'm playing my Intellivision console.

 

post-38837-0-62417300-1548960124_thumb.png

Link to comment
Share on other sites

To use the jzintv custom colour palette first create a text file like the one posted here.

http://atariage.com/forums/topic/278354-gfx-palette-flag/?p=4021367

 

Add the switch to the command in your batch file. E.g.:

jzintv.exe "--gfx-palette=\path\jzipalette.txt" %1

 

Your raspberry pi is likely using an older jzintv with the old palette. Compare with the first two congo bongo images in this post.

http://atariage.com/forums/topic/278354-gfx-palette-flag/?p=4033511

Edited by mr_me
Link to comment
Share on other sites

  • 1 year later...

It's been a while since I've worked on any of my games. I am starting to get back into programming them and trying to make my code more efficient. I was wondering if it is possible to use a variable in a PRINT command for the GROM image to be used? I was thinking this may help keep my file sizes smaller if I didn't have to use a new PRINT line to change the GROM image at a specific location.

 

I also was wondering if I could use DATA to store GROM values for the same general purpose?

Link to comment
Share on other sites

I don't think IntyBASIC has the corresponding to PRINT CHR$(a), which is what you are asking for. However I think you can set #BACKTAB directly or in last case POKE values instead of PRINT. It takes a little more work, figuring out how to assemble the 16-bit value for each location: GROM/GRAM card, foreground, background etc but certainly doable and would let you keep card values in variables, unless you're having movable objects as MOBs (sprites) of course.

 

For the second question, the difference between BITMAP and DATA is only syntactic sugar. Once compiled, both take the same amount of ROM. BITMAP takes far more space in the source code but is more visual. DATA is good for bitmapped images generated e.g. through Intycolor where you have no need to worry about the graphics once generated and thus can keep it in a compact format in the code. The data is stored a bit backwards though, each DATA statement is a 16-bit value consisting of the bit patterns of second row in the upper 8 bits, followed by first row in the lower 8 bits, repeated four times for a full 8x8 card. That is relevant if you're trying to manually convert BITMAP to DATA for the graphics you already designed and have no need to alter or duplicate later.

 

Also GROM is part of the system and nothing you can change from the program. You are referring to GRAM, the cards you DEFINE in your program to go into the specific memory area for those.

Edited by carlsson
Link to comment
Share on other sites

The PRINT sentence allows to enter directly the STIC card codes for the screen.

 

For example: PRINT $0085

 

It will show a zero character (from GROM) in green color at the current cursor position.

 

Same effect can be achieved with this: PRINT COLOR 5,"0"

 

Remember the Color Stack mode allows to show all of the 256 characters from GROM (in colors 0-7), while the Foreground/Background mode only allows to show the first 64 characters.

 

 

  • Like 1
Link to comment
Share on other sites

Aha. So if he is working in FG/BG mode, something like this might work:

 

include "constants.bas"

 

REM The border colours are ordered 0-15 and work as array indexes here

my_bg = BORDER_BLACK

my_fg = BORDER_YELLOW : REM can only be 0-7 in BG/FG mode, all 16 colours in CS mode

#my_card = 256

pos = 100

 

PRINT AT pos, bg_col(my_bg) + my_fg + #my_card*8

 

bg_col:

  DATA BG_BLACK, BG_BLUE, BG_RED, BG_TAN, BG_DARKGREEN, BG_GREEN, BG_YELLOW, BG_WHITE

  DATA BG_GREY, BG_CYAN, BG_ORANGE, BG_BROWN, BG_PINK, BG_LIGHTBLUE, BG_YELLOWGREEN, BG_PURPLE

 

I'm not sure how efficient this is. Pretty much it equals a POKE but with the possibility to combine several prints in one statement. If the combination of background and foreground is precalculated, it would be slightly optimized.

  • Like 1
Link to comment
Share on other sites

On 10/30/2020 at 11:07 AM, dalves said:

It's been a while since I've worked on any of my games. I am starting to get back into programming them and trying to make my code more efficient. I was wondering if it is possible to use a variable in a PRINT command for the GROM image to be used? I was thinking this may help keep my file sizes smaller if I didn't have to use a new PRINT line to change the GROM image at a specific location.

 

I also was wondering if I could use DATA to store GROM values for the same general purpose?

There are a few different answers to your questions here.

 

For one thing, if you want a specific character from GROM, you can enter a backslash followed by the GROM character number.  For example, if you're in Color Stack mode (because Foreground/Background mode limits you to the first 64 characters in GROM), you can get an underscore character with this command:

PRINT "\207"

You can also create a constant (not a variable) for the underscore.

CONST PIC_UNDERSCORE = 8*207

As for keeping your file sizes smaller, I assume you mean the ROM image file.  In my latest project, I maxed out the ROM space allocated for part of my code, and in the most recent bugfix, I went over by one word.  So I made this little size optimization where I replaced a PRINT command to display the word "and" with three consecutive #backtab assignments:

 

PRINT AT 20*10+9 COLOR COL_WHITE, "and"

#backtab(20*10+9) = PIC_A_LOWER + COL_WHITE
#backtab(20*10+10) = PIC_N_LOWER + COL_WHITE
#backtab(20*10+11) = PIC_D_LOWER + COL_WHITE

The above is how you would get a GROM image at a specific location.

 

To answer your final question, use CONST instead of DATA.  You can have all the CONST lines you want, because those are just instructions to IntyBASIC to substitute the value whenever that constant name is encountered - they do not add to the ROM image size.  Using DATA would add to the ROM image size, and you would need additional code to fetch it, most likely a READ statement after having used a RESTORE statement to jump to a label before your data.

 

I hope that helps.

Edited by Zendocon
Foreground/Background Mode limits you to the first 64 characters, whose index values are 0-63.
  • Like 1
Link to comment
Share on other sites

As always, you guys are fantastic. Thank you so much for the information. I will have a few things to try.

 

The game I'm working on has some potential I think, but when I first created it, I was learning how to do different things and might have added too much to it. I figured I'd try slimming the game down a bit and see if that makes for better game play.

  • Like 1
Link to comment
Share on other sites

  • 5 weeks later...

A quick question. I am making a version of Activision's Pressure Cooker for Intellivision. There is intro music that plays when the game starts, and then there is background music that loops during gameplay. I was reading in the documentation about the different MUSIC options. I thought the MUSIC JUMP option may be what I need, but was having trouble getting it to work. Any insight would be appreciated.

 

I was going to post a ROM of the game so far, but I'd like to get a few more of the bugs worked out. I think some of them may be caused but not using WAIT correctly, but I'll have to see.

  • Like 2
Link to comment
Share on other sites

If you want it all in a single song, I would implement it as intro, followed by the background music and MUSIC JUMP at the end going back to where the background music begins. I have done something like that before so it should be doable.

 

Another way would to split it as two songs, where the first has MUSIC STOP. You would then poll in your main loop for MUSIC.PLAYING and if it is zero, start the background music which could have either MUSIC JUMP or MUSIC REPEAT.

 

If you're digging deep, you can even find the actual memory locations used by the player routine for more detailed control, though it might differ on compile time settings so not so dynamic. I experimented with this before in order to add lyrics to the screen as the music played along, by settings pseudo pointers in the music data where I wanted each lyric line to appear and then compare a memory location (in my case $0339 but it might differ) with the pointers to tell if a new line should be printed. I know this is not what you asked for, but an example of things you can do if you go beyond what the BASIC syntax has to offer.

Link to comment
Share on other sites

What exactly is wrong with MUSIC JUMP?

 

My way of starting music from the code block is:

MUSIC OFF
MUSIC PLAY SIMPLE NO DRUMS
MUSIC PLAY MyTune

In the section where the music is, use this:

MyTune:
DATA 5  ' Set tempo
MUSIC ...
MyTuneLoop:
MUSIC ...
MUSIC JUMP MyTuneLoop

How are you doing it?

  • Like 1
Link to comment
Share on other sites

Thanks for the help and information. My problem with MUSIC JUMP was I was apparently trying to do it while having the Intro music and Loop music set up as 2 songs. Using it with them as one song works fine. I may try doing them as a 2 song setup as the Loop music needs to be lower in volume than the Intro.

Link to comment
Share on other sites

Hm, in principle I think you should be able to jump from one song to another, and in the second song jump back to the same starting point though I haven't really tested how it works.

 

By the way, in my Christmas inspired game Merry Memory from last year, I used another song hack that I kind of hoped would find its way into the compiler but so far needs a work around. I have 10 different songs which I want to assign randomly and play dynamically, so I set up this structure:

 

song_pointers:
    DATA VARPTR jinglebells(0)
    DATA VARPTR deckthehalls(0)
    DATA VARPTR mommykiss(0)
    DATA VARPTR littledrummerboy(0)
    DATA VARPTR rudolph(0)
    DATA VARPTR feliznavidad(0)
    DATA VARPTR silentnight(0)
    DATA VARPTR christmassong(0)
    DATA VARPTR santaclausiscomin(0)
    DATA VARPTR whitechristmas(0)

 

Then in order to select a song, I use this code, where k holds a value 0-9:

 

    #ptr = song_pointers(k)
    ASM MVI var_&PTR,R0
    ASM CALL _play_music

    WHILE MUSIC.PLAYING:WEND
    PLAY OFF

 

_play_music is the internal label to the built-in player routine. R0 is loaded with the address of the music data, which normally is set at compile time but with this small ASM hack I made it to work dynamically. Yet again, this may not be something you have use of but an example of what you can do.

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

I'll have to give that a try. Still a lot I need to learn...

 

My Pressure Cooker game is taking shape. My code is still basically a million "IF" statements, but I feel I'm making some progress. I want to start adding some sound effects. Does anyone know of some good examples that show different ways to work with SOUND to create different effects. I was looking for something that may show a few ways to incorporate the noise channel to get different results?

Link to comment
Share on other sites

A while ago I made a rom in IntyBasic to interactively set PSG values, play sound, and show IntyBasic sound code.

https://atariage.com/forums/topic/262842-intybasic-sound-playing-routine-optimization-help/?do=findComment&comment=3863733

 

For the game Princess Lydie I did things differently, using data for values, where odd values also decrease volume. There's also a sound test option in the main menu. You'll find rom and source code is in the 2018 competition forum.

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