Jump to content
  • entries
    14
  • comments
    81
  • views
    38,481

7800basic update #1. beans spilled, peek sneaked


RevEng

4,013 views

For a few months now I've been toiling behind the scenes on a port of batari basic for the 7800. Today I'm going public and showing off a little bit of what I've accomplished. Since a picture is worth a thousand words...

 

blogentry-23476-0-18606500-1391637484_thumb.png

adventurer.bas

adventurer.bas.bin

adventurer.bas.a78

 

...the source code for that quick and dirty demo is decidedly not a thousand words. It's 68 lines of pure 7800basic code, and 12 of those are simple commands to import png images.

 

There are already a bunch of useful features...

  • import of png graphics to any one of the 7800's mode formats, with the ability to reorder color indexes during the import.
  • plot sprites, values, and characters/tiles.
  • simple joystick polling, for both one and two button joysticks.
  • 32k and 48k formats are currently available. SuperGame formats to come.
  • switch between 7800's various display modes.
  • pick from a zone height of 8 or 16.

...in addition to all of the great features that 7800basic receives from its batari Basic heritage. A special thanks goes to batari, who gave his approval and encouragement for using the excellent bB code base.

 

There are still features to add, testing to do, and docs to write before 7800basic is ready for public beta, but it's in the home stretch now.

 

[edit]update #2 posted.

  • Like 16

30 Comments


Recommended Comments



Thanks for the support, guys!

 

@RT, a lot of the Windows devs seem to use the ProSystem Emulator. I don't know if there's an edge in emulation with it, or if its just easier to setup compared to MESS.

 

I'm on Linux, so I can really only choose MESS. (unless I resort to Wine or dual booting)

  • Like 1
Link to comment

The ProSystem Emulator is easier to use. Looks like that's the one I'll be using. Thanks.

 

Any hint on how many variables we might have using 7800BASIC?

Link to comment

Heh, I figured the implementation questions would start coming. :)

 

For bB style named variables, you'll have a-z and var0-var99. The memory block $2200-$27FF is also dedicated to the 7800basic program, so that's another 1.5k of RAM.

 

To use that block you just use a dim, like "dim kangaroopants=$2200"

 

When I get around to supporting SuperGame format... if on-cart RAM is provided, it will be accessed in the same fashion; just dim it and use it.

  • Like 1
Link to comment

Heh, I figured the implementation questions would start coming. :)

 

For bB style named variables, you'll have a-z and var0-var99. The memory block $2200-$27FF is also dedicated to the 7800basic program, so that's another 1.5k of RAM.

 

To use that block you just use a dim, like "dim kangaroopants=$2200"

 

When I get around to supporting SuperCart... if on-cart RAM is provided, it will be accessed in the same fashion; just dim it and use it.

 

Wow! Looks like any games I make in the future will be for the Atari 7800. I require those juicy, yummy variables for the kinds of games I've been waiting to make. Thanks!

  • Like 1
Link to comment

I like how the sprite wraps around the borders without glitching out.

 

It's going to be a tough call.. 256k Atari 2600 RPG or 32k Atari 7800 game?

Link to comment

Not trying to sway you one way or the other, but 7800basic can presently stretch to 48k. I confirmed with CPUWIZ that he could still produce those boards. And larger 7800 games will be possible with his new board, when I get to SuperGame format support.

 

I'll take partial credit for the vertical wrapping... I have code that limits the wrapping sprite from writing to memory it shouldn't be using when it's off or partially off the screen.

 

The horizontal wrapping is all MARIA. :)

  • Like 1
Link to comment

The tough part is testing on real systems. Cuttle Cart 2 is discontinued. The 7800 harmony is still in development. Eckhard's mod requires soldering experience and access to a special RAM cart, right?

 

It might be awhile before we realize if a feature really works on real hardware :/

Link to comment

This is way cool, dude! Maybe even I can do something on the 7800 now!

 

The demo you made works on the real system too!

 

Uh oh.. you've got a flash cart or a modded system? Are you available to test games occasionally? =)

Link to comment

Sweeeeeet. Thank-you very much for confirming, DracIsBack!

 

I was slightly concerned because I'm using interrupts to flag the start and end of the visible display, to give 7800basic programs all the cycles they can possibly get. I'm glad it worked out!

 

@theloon: Agreed about real hardware testing. (see above. :) )

 

batari announced he hopes to get Harmony 2 out later this year, for CGE 2014 or PRGE 2014. I think there's a pretty good chance he'll manage to do just that.

  • Like 2
Link to comment

It looks like it defaults to bB like settings. Did you notice the "DEMO" in the middle? I bet shiz like that can be positioned anywhere your heart desires :)

 

It'd be nice if there was some way to go traditional BASIC like:

 

LOCATE 10, 15

PRINT 'SCORE: ' + score

 

UPDATE: Which reminds me.. people were jonsing for a Thexder port. Character printing commands would work great to simulate the tile based scrolling in that game.

 

UPDATE II: I don't feel strongly about adhering to BASIC syntax. Just the prospect of either simulating or actually implementing tile based scrolling on the 7800 :)

Link to comment

The score can go anywhere, multiple places, or nowhere. There's still a 24-bit "score" variable, but I'll probably change that to be "score1" and "score2".

 

You can actually plot BCD values anywhere on the screen, and they can be any number of digits, within reason.

 

Regarding printing, 7800basic already has character printing ability with "plotchars" and "plotmap" commands. plotchars does a line of characters (or less) and plotmap does a 2d block of them.

 

The map data that plotmap works with can be bigger than the 2d block you display on the screen, so its suitable for displaying a smaller part of a larger area.

 

You can also use RAM with plotchars and plotmap, so you can instead generate the screen algorithmically.

 

I don't have fine scrolling in there yet. It's on the roadmap, but pretty far down.

Link to comment

It sounds like you do have fine scrolling. Like you said: have an array of chars in RAM and plot them on the screen at an offset. When the offset reaches the tile edges load up another row or column into the char array and reset the offset :) Rinse and repeat!

Link to comment

Horizontally yes. Vertically, not so much.

 

This will be in the docs in some form, but MARIA splits the screen into horizontal sections called zones. While a character can be offset by fine amounts in X, it can't be easily offset in Y within a zone like sprites can.

 

So to fine scroll vertically, 7800basic will need to resize the top and bottom zones, and adjust the bottom zone Y offset with an interrupt.

  • Like 1
Link to comment

Can you dynamically swap graphics in a tileset? Say, if you want to switch between a numerical font for the score and a icon set in place of the score. Something like replacing the tile for "1" with an icon for a bomb.

Link to comment

If you wanted to blow a bunch of RAM on tileset graphics, you could do a single character that way. But practically, no.

 

You pass the plotval command the tileset you want to use, so you could swap the whole tileset you're using with an if...then.

 

For similar effect, you could also use the old bB trick of defining hex digits to point to other images. Then you can enable the image you want by setting one of the nibbles of the score to $A or more.

Link to comment

Guest
Add a comment...

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