Jump to content
IGNORED

7800basic beta, the release thread


RevEng

Recommended Posts

Thank you a million.

 

Cool! A new version of 7800basic!

 

Another question.

 

The Rand function produces a random number between 1 and 255.

 

Is there a way to limit the number? Say a number from 1 to 10?

 

I'm use to Atari Basic which has RND(1) which produces a random number from 0.00 to 1.00. Then you just tack on a *(some number) to make your limit.

 

10 A=INT(RND(1)*10)

 

Which would give you a number form 0 to 9.

 

Since I can't think of a way to do this in 7800basic.

 

Allan

Link to comment
Share on other sites

This one has initial pokey support. It will autodetect pokey in the standard cart memory location, and it should do the same for XBoard and XM hardware. (I'm unable to confirm)

 

 

MESS has the XM/Xboard/Versaboard additional POKEY location mapped and the program finds it...

 

post-18-0-67290400-1395345084_thumb.png

  • Like 1
Link to comment
Share on other sites

For sure. MESS is the emulator I use when developing 7800basic, and the fact that it found POKEY in that location gives me confidence. But until someone confirms its working on real XM/XBoard/Versaboard hardware, I'll keep the disclaimer. :D

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

Excellent improvement! I like having the POKEY commands ... here's a couple of other things:

 

Is there a provision for setting the AUDCTL register? This is a multipurpose audio register, which amongst many other things, allows for you to engage 16-bit POKEY mode ... where you can join two channels and increase your note resolution to $FFFF (65535). I used this trick for the Bentley Bear title music to get the low bass notes using distortion 10. Other settings involve fancy things like high-pass filters, or setting two-tone serial mode. On the Atari XL this is used to facilitate cassette or disk i/o, but it can also be used to make unique sounds.

 

This is a fairly good reference for AUDCTL and other things POKEY: http://www.atariarchives.org/dere/chapt07.php

 

One other possibility, is a DSOUND command (like in TurboBASIC), of the format:

 

DSOUND channel,note,waveform,volume

 

channel can be from 0 to 1, which determines whether channels 0 and 1, or 2 and 3 get joined. note is 0-65535, waveform and volume are as with psound command.

 

So basically, in ML terms, to use 16-bit mode, you would need to set bits 3 or 4 (to engage the 16-bit mode) and 5 or 6 (to change the clock rates on the combined channels to 1.79 mHz) ... the latter is needed so that you can get playable notes. In simpler terms: $20 in AUDCTL joins channel 0 and 1, $80 joins channel 2 and 3.

 

When combined, the first PAUDC register is set to $00. Volume and waveform are controlled from the second PAUDC register. The frequency is stored in both PAUDF registers, of the order: PAUDF0+256*PAUDF1

 

Hope this is of some help.

Link to comment
Share on other sites

Excellent improvement! I like having the POKEY commands ... here's a couple of other things:

 

Is there a provision for setting the AUDCTL register?

Sort of. There's a short entry in the docs on setting the pokey registers with assembly. This is a bit different than the usual way of setting the registers, as 7800basic uses indirect addressing because the pokey location can vary.

 

Eventually I'll get dsound implemented and wrap up some of the trickier stuff in a bow, but for now you can do it the assembly way. (and optionally still use psound to change the 16-bit frequencies one at a time)

 

Thanks for the reference links!

Link to comment
Share on other sites

(runs install.bat)

"YOU NEED A COPY OF SETX BEFORE YOU CAN BEGIN."

(installs SetX, runs install.bat again)

"YOU NEED A COPY OF SETX BEFORE YOU CAN BEGIN."

(makes noise Sideshow Bob did after he stepped on a rake for the thirteenth time)

 

We're not off to a great start here.

Link to comment
Share on other sites

*Sees RevEng's sig for the first time*

Ohmygodohmygodohmygod!

Will definitely dip my toes into this program soon. :)

Also:

 

When you double-click 7800bas.bat and see the window appear and disappear, it's normal. It does that because it's the batch file is meant to be run from a CMD window, instead of being double-clicked. (but I should probably add some kind of detection for this, with a warning message)

I can see alot of other programs ran from the command line benefiting from this...

  • Like 1
Link to comment
Share on other sites

Okay, it's working and compiling software now. I still have a lot of questions, though. I noticed you can use indexed graphic files with the compiler, but it looks like you have to define colors in the program itself. Is there a table of available 7800 colors? How do I know which colors to assign? What's the best tool to use to make graphics? Will IrfanView get the job done? How do I swap character graphics for animation? Is PRINT baked right in or do I have to create a character set like I did with Dragon BASIC on the Game Boy Advance?

 

I, uh, have a lot of questions.

Link to comment
Share on other sites

Is there a table of available 7800 colors? How do I know which colors to assign?

It's more or less the same as the VCS colors, except you can use odd values as well.

 

7800basic also creates color constants by doing a translation of each color index from the PNG's RGB to Atari's color scheme. In the manual under "incgraphic" it gives the example of using one of those color constants... "P0C1 = foobar3_color1"

 

 

What's the best tool to use to make graphics? Will IrfanView get the job done?

I don't know irfanView. I use The Gimp. A tool should work provided it can save an indexed png file at bit depths the user selects.

 

 

How do I swap character graphics for animation? Is PRINT baked right in or do I have to create a character set like I did with Dragon BASIC on the Game Boy Advance?

It depends on whether you're printing out ROM or RAM locations. If ROM, the easiest thing to do is use if...then to just switch which character is being displayed. If RAM, and you need to change a specific character, you could use pokechar to update the memory location.

 

There's no default character set, but 7800basic comes with a few. There's an example of printing text strings in the pokey sound test.

 

I will say that text is a little bit cumbersome because you need to define the text in an "alphadata" statement first. I'm looking into making it a bit more streamlined in an upcoming build.

 

In its present state it works fine for text labels and such in a game screen. Not so hot if you want to write a text adventure.

Edited by RevEng
Link to comment
Share on other sites

Yes, the palette differs from the 2600 (and 5200/XL/XE non-GTIA) one, in that it is a 256 (16 hue x 16 chroma) palette as opposed to the 128 (16 hue x 8 chroma) one found on the 2600 and Atari 5200/XL/XE (when using non GTIA modes).

 

What I have found, is that it's best if you can get a PNG of the Atari 256 palette and import it into the GIMP's palette dialog ...

 

Here's a sample palette:

 

post-23798-0-74468100-1396062863_thumb.png

 

Run GIMP, then take this picture above, load it into GIMP. Then do Windows/Dockable DIalogs/Palettes, and then when the Palette window. Right click inside the palette window and select Import Palette.

 

From there, look for the radio button that says "Import from image" and select it. The do "Import". The new palette (called Untitled) is now available in GIMP. You might want to rename it to "Atari 7800 palette". The palette should read as 256 colors.

 

Next, to reduce an image to, say, 12 colors (the number of colors available in 7800's 160B mode) you want to do this with your image:

 

Image/Mode/Indexed ... and select a 13 color index. You want 13, because the 7800 in 160B mode uses 12 plus the background.

Repeat this step (Image/Mode/Indexed) only this time, select "use Custom Palette". Click on the colored palette button, and select the 7800 palette you just created.

 

Also, when you do your indexing, make sure you don't do any dithering on the image.

 

The image should now be reduced to 12 colors which match the 7800 palette. From here, you can cut, paste, and put together an image which should import perfectly into 7800basic. The only issue is, it seems that 7800Basic operates on the PAL palette instead of the NTSC palette, which means that all chromas (except for grey) get shifted one value to the right.

Edited by Synthpopalooza
  • Like 2
Link to comment
Share on other sites

Is there a table of available 7800 colors?

Atari 7800 palette table showcasing a 26.7 degrees phase shift:

 

post-18-0-71025300-1396064257_thumb.png

 

Alternative in presentation and value here is a 26.2 degrees phase shift:

 

post-18-0-91709200-1396065621_thumb.png

More details here if interested.

 

Both values are well suited for the documented and actual palette color order.

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