Jump to content
IGNORED

first steps in 7800basic


TXG/MNX

Recommended Posts

Hi I was busy with the sample code and did some cut and past to see what could be combined to see how things are handeld.

 

So I started ofcourse with simple + helloworld when I combined them it did work, set also 2 pallets no issues.

 

When I wanted to reuse the sprite data happy1.png I could not plot it as second sprite on the screen.

 

So my second approach was to load a happy2.png in memory for sprite 2 but then it stops compiling seems no memory left for graphics ?

 

So I got a question, is it possible to load 1 picture and display (plot) it severaltimes using a different pallet and move it seperatly ?

I got a 320A screen for text and 1 sprite what limit did I reach default the cart is 32K I did even check 128K and dmahole options but nothing. I am completly new to this so I would hit the wall many times I guess before I fully understand the 7800

Edited by TXG/MNX
Link to comment
Share on other sites

So I got a question, is it possible to load 1 picture and display (plot) it severaltimes using a different pallet and move it seperatly ?

I'm about to drop my daughter off at school, but I recommend compiling and running the multisprite sample. All of those sprites come from one image file.

 

If someone else doesn't get here before I get back, I'll drop a sample plotsprite code for multiple sprites from one image.

Link to comment
Share on other sites

Here's a simple code for plotting a handful of sprites. I think I've got this right; I'm trying to get little ones ready for preschool. (My wife is taking the elder child, so I'm free for about a minute.) If this is in error, can someone hit me with a ruler and fix my mistake please? :)

plotsprite herodown1 0 xpos1 ypos1 heroframe
plotsprite herodown1 0 xpos2 ypos2 heroframe
plotsprite herodown1 0 xpos3 ypos3 heroframe
plotsprite herodown1 0 xpos4 ypos4 heroframe

You can even change a sprite's color by selecting a user-defined palette.

  • Like 1
Link to comment
Share on other sites

I looked at the multisprite, it seems so easy just a look displaying x number of sprites in a loop.

 

I got this code (see attachment), it works, when enable the second plotsprite with the same sprite with other coordinates it gives an error ?!

 

d:\Rene\7800basic\samples\mygame>7800bas mygame.bas
7800basic 0.2 Jul 14 2014 15:45:17

*** (): INFO, GFX Block #0 starts @ $F000
face1 atascii
*** (): INFO, GFX block #0 has 1048 bytes left (131 x 8 bytes)


7800basic compilation complete.
User-defined 7800.asm found in current directory
d:\Rene\7800basic\samples\mygame\mygame.bas.asm (452): error: Syntax Error ''.

Unrecoverable error(s) in pass, aborting assembly!
Complete.
Cartridge data file must be at least 4K!

7800header 0.2 Jul 14 2014 15:45:17
opened parameter file a78info.cfg

mygame.bas

Edited by TXG/MNX
Link to comment
Share on other sites

The frame parameter you mention is only needed for animation right ? I did try with and without no succes.

 

I cannot figure out the difference between a for loop that does plotsprite sprite color x y a few times or using a few lines plotsprite

 

maybe I make another stupid mistake again, but thats the way to learn it I think, I try to understand instead of copy code until it works.

Link to comment
Share on other sites

Okay I did change it and works now.

 

I also did see that the priority of data on screen is based on the command given in the code

 

What I mean is

 

When you do plotsprite face1

the plotsprite face2

plotsprite face 3

 

face1 is the first sprite, face2 moves over face1 but under face3, face3 moves over face1 and face2 this is pretty easy to remember.

 

Now some questions.

If I want to change the list of sprites visible on a screen so swap face3 with face1 priority how should I do that best ?

 

I just thougt about an array or seperate subroutines but maybe someone has a better option.

Link to comment
Share on other sites

okay got it working but need to find a quick way to order the sprites how I want them, an array should maybe the best, and a screen build routine.

 

are the convertors that convert normal graphics to 7800 format or is the only way to use gimp like in the tutorial?

I rather create a simpel gfx file to test and maybe convert it in a batchfile to the right format.

Link to comment
Share on other sites

okay got it working but need to find a quick way to order the sprites how I want them, an array should maybe the best, and a screen build routine.

This sort of depends on "how you want them". If its a static order, then just order them that way in the code, with top-most object being drawn last. If you want them dynamic, you might consider how you'll sort the info. e.g. if you sort by Y coordinate for a pseudo-3d effect, you'll need to sort that into a "draw list".

 

It's easy enough to access variables like arrays. Just DIM them together, and you can use an array index to go through all of the variables.

 

Here's a brief code fragment showing one way, but its not the only way to do it.

 

 rem spriteorder is a memory array of size 5
 dim spriteorder=m : rem just skip over the next 5 memory slots for the next variable
 dim nextvar=r

 [...program code here sticks 0-4 into spriteorder array slots, depending on your requirements...]

 for mytemp1=0 to 4
   spriteindex=spriteorder[temp1]
   tempx=pigx[spriteindex]
   tempy=pigy[spriteindex]
   plotsprite pig1 2 tempx tempy
 next

 

are the convertors that convert normal graphics to 7800 format or is the only way to use gimp like in the tutorial?

I rather create a simpel gfx file to test and maybe convert it in a batchfile to the right format.

Gimp isn't a requirement, but its the one I use along with other folks, so it will get you the best support for issues. But by all means figure out something from batch, like ImageMagick. You just need an indexed/palettized PNG file with the appropriate number of colors for the mode you're working with.

Link to comment
Share on other sites

I'm assuming you're talking about GroovyBee's "160c". (for the record, isn't a true MARIA mode, but rather a technique that uses alternating luma and chroma information.)

 

It's indeed an impressive technique, but there are cons to using it too. It uses a ton of RAM. (if I was to support it, it would mean displaying a 160c on a stock system would wipe out game state.) It's also only useful for static images without a lot more external RAM. It eats a ton of ROM. The effect works best on PAL displays (where GB hails), less ideally on NTSC CRT TVs, and sometimes quite poorly on NTSC LCD TVs. It will use up a large chunk of CPU time that 7800basic gives to your game.

 

I'm not saying I won't ever support 160c import, but there are bigger fish to fry right now.

  • Like 1
Link to comment
Share on other sites

I'm assuming you're talking about GroovyBee's "160c". (for the record, isn't a true MARIA mode, but rather a technique that uses alternating luma and chroma information.)

 

It's indeed an impressive technique, but there are cons to using it too. It uses a ton of RAM. (if I was to support it, it would mean displaying a 160c on a stock system would wipe out game state.) It's also only useful for static images without a lot more external RAM. It eats a ton of ROM. The effect works best on PAL displays (where GB hails), less ideally on NTSC CRT TVs, and sometimes quite poorly on NTSC LCD TVs. It will use up a large chunk of CPU time that 7800basic gives to your game.

 

I'm not saying I won't ever support 160c import, but there are bigger fish to fry right now.

 

Indeed, going over the "160c" thread too, there was pretty much a consensus that even if applied, it would be best as a title/static screen only.

 

My reply/link to the thread where it's mentioned was in response to: "Would like to hear what people have managed to make on 7800 so resolution and color (maybe a link to the pictures)". It was not intended to be interpreted as applied throughout an entire game or utilized to program a game upon. Truly a demo of color/resolution with just static pictures.

 

To see a higher resolution (320) mode using a more than typical/usual amount of colors available to that mode in "real-game" application, here you go:

 

http://www.youtube.com/watch?v=JNU1iJzfPFA

 

To read an explanation from the developer on how the above was accomplished, please see here.

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