[V9990] Q&A Official Thread

Страница 3/19
1 | 2 | | 4 | 5 | 6 | 7 | 8

By hit9918

Prophet (2866)

Аватар пользователя hit9918

02-03-2016, 15:28

about going out of memory, in BASIC there is the style "one code per screen".
and one cant do much more in the slow original BASIC.
else one can do same style as the asm games, "one code for the whole game".
and the 9990 has big vram, maybe some things can be put in vram.

By Kai Magazine

Paragon (1303)

Аватар пользователя Kai Magazine

02-03-2016, 15:46

I use "one code per stage" with turbo basic.
I use modified versions of the main engine to add variety on each stage/area/zone.
First I create a basic code to prepare all the vram data, load songs/samples, prepare variables/sprites, etc, and when everything is ready, I load and run the main engine for that particular stage/area/zone. This way I can save quite some memory. When the main engine concludes, I load a NEXUS code which binds everything and acts according to the results achieved in the main engine, by reading the variables from the VRAM.
So I use many codes, each one for it's pruppose. It is the best way I've found to make games with turbobasic.
For example: on Life on mars, the nexus code which binds the complex achievements and handles which stage to load and what attributes will the main character have when entering/reentering a particular area, is called NEXUS.BAS.
Each area of the game has it's own main engine with slight variations in it: Life(number).bas
On Nuts, the nexus is the MAP.COM (if I remember correctly) which is a bas file after all, and the individual engines for each stage are NKKK(number).com

On Life on Mars I used another basic code to handle all the events: events.bas Everything storyline related happens there and when some text has to appear or the story advances in any way, I load this routine and by reading the variables on the vram, it shows the right text and does the appropiate modifications to the vram variables (to record that this event has just happened).
vram variables are made of pixels, and each pixel contains a value from 0 to 15, so play with it...

On Nuts I created a code for each visual stage/event, and after the code completes, it returns to the nexus (map.com).

So as you can see there are many ways to handle things, but I am letting you know what works better for me in turbo basic, in case you want to use turbo basic/power basic as well.

By tvalenca

Paladin (728)

Аватар пользователя tvalenca

02-03-2016, 16:29

hit9918 wrote:

about going out of memory, in BASIC there is the style "one code per screen".
and one cant do much more in the slow original BASIC.
else one can do same style as the asm games, "one code for the whole game".
and the 9990 has big vram, maybe some things can be put in vram.

Yes, one big (or several smaller ones) BLOAD (actually, it will need a small ASM loader inside the binary file since -apart from PowerBASIC and GBASIC- no BASIC supports BLOADing files to V9990 VRAM) and then you're good to go. You can even use NestorBASIC to take advantage from the Mapper Support.

I sent Konamiman an email asking if there are any documentation for writting plugins for it, so we could work in V9990 support for NestorBASIC. Or, at least, if he has plans to support it himself. He didn't replied yet and since it's been more than a few days, I'm wondering if I insist.

By Kai Magazine

Paragon (1303)

Аватар пользователя Kai Magazine

02-03-2016, 21:11

Perhaps he is "out of business" (I belive it has been a while since anyone heard from him) or he is not aware of this new gfx9000 revolution.
Since he is Spanish (like me) I will ask the spanish community if anyone can contact him y other means.

By tvalenca

Paladin (728)

Аватар пользователя tvalenca

02-03-2016, 22:03

Thanks, Kai!

Just to mention: Just managed to load a 3-plane image on Video9000 emulation (back frame=v9958, mid frame P1 layer B and front frame P1 layer A)

Since I'm using plain BASIC, I BLOADed .SC5 files on Screen5, then copied using VPEEK and OUTed it to V9990. SLOW.LIKE.HELL!
BUT, there some catchs to make VIDEO9000 transparent:
First, you have to set Video9000 bits 3 and 4 on control port, to tell Video9000 that the output is Genlocked and both V9990 and video input will be displayed
Then set bit 6 to on V9990 R#8, to tell V9990 to output on pin /Ys when some color is meant to be transparent.
Finnaly you have to change the pallete color meant to be transparent setting the MSB on red component of that color code, because on V9990 you don't have a fixed color code for transparent color.

something like that:

1)
OUT &H6F,24 (you normally set to zero)

2)
OUT &H64,8:OUT&H63,162 (you normally set to 130)

3) 
OUT &H64,14:OUT&H63,0 (i'm setting color 0 is transparent)
OUT &H61,128:OUT &H61,0:OUT &H61,0

By Manuel

Ascended (15686)

Аватар пользователя Manuel

02-03-2016, 22:32

Kai Magazine wrote:

I use "one code per stage" with turbo basic.
I use modified versions of the main engine to add variety on each stage/area/zone.

That sounds like a software engineering nightmare, unless you have means to avoid code duplication between all these engine variations (i.e. the non-varying stuff is a single code base and is not copied and modified).

By Kai Magazine

Paragon (1303)

Аватар пользователя Kai Magazine

03-03-2016, 09:58

Manuel wrote:
Kai Magazine wrote:

I use "one code per stage" with turbo basic.
I use modified versions of the main engine to add variety on each stage/area/zone.

That sounds like a software engineering nightmare, unless you have means to avoid code duplication between all these engine variations (i.e. the non-varying stuff is a single code base and is not copied and modified).

I do not quite understand what you mean, and probably you did not understand me either, because it is not a nightmare at all, as a matter of fact it is quite simple.
For example:
If the nexus.bas recieves the order to prepare and load "stage1.bas", the nexus loads all the graphics and prepares all the data, and then runs" stage1.bas".
The same for the rest of the stages. Quite easy.
Each Stage*.bas is a copy of the first stage, but with slight variations in it.
For example, in the stage1.bas you can have a walking robot which shoots bullets and falls if it finds an edge, another robot which launches bombs and turns back when it finds an edge (instead of falling) and another robot which flies and drops bombs, all of them weak and easy to kill. (this is the first area of Life on mars, by the way)
To create another stage/area/set of enemies, I get this very same stage1.bas, I save it as "stage2.bas" and I modify the AI of the enemies so, instead of a walking robot, I make a plant which jumps every few frames, and I make the enemies slightly stronger and harder. Then I save again.
In another stage I modify one of the 3 enemies AI to be a running bird which will pursue you even if you evade it.
In another stage I modify one of the 3 enemies AI to be a zombie...
Etc.

On Nuts, there are 3 main engines:
One with no colisions with the floor and the level is a straight line (final fight style) but with pickable boxes.
Another with no colisions etc, but with pickable knives
Another with ground colisions and different levels of height, so you can climb objects and fall into pits, etc, but with no items.
Depending on the stage we play on, the nexus will load one of those 3 engines.
This is quite easy, really...

By Kai Magazine

Paragon (1303)

Аватар пользователя Kai Magazine

03-03-2016, 09:59

tvalenca wrote:

Thanks, Kai!

Just to mention: Just managed to load a 3-plane image on Video9000 emulation (back frame=v9958, mid frame P1 layer B and front frame P1 layer A)

Since I'm using plain BASIC, I BLOADed .SC5 files on Screen5, then copied using VPEEK and OUTed it to V9990. SLOW.LIKE.HELL!
BUT, there some catchs to make VIDEO9000 transparent:
First, you have to set Video9000 bits 3 and 4 on control port, to tell Video9000 that the output is Genlocked and both V9990 and video input will be displayed
Then set bit 6 to on V9990 R#8, to tell V9990 to output on pin /Ys when some color is meant to be transparent.
Finnaly you have to change the pallete color meant to be transparent setting the MSB on red component of that color code, because on V9990 you don't have a fixed color code for transparent color.

something like that:

1)
OUT &H6F,24 (you normally set to zero)

2)
OUT &H64,8:OUT&H63,162 (you normally set to 130)

3) 
OUT &H64,14:OUT&H63,0 (i'm setting color 0 is transparent)
OUT &H61,128:OUT &H61,0:OUT &H61,0

That is quite a success! I managed to do that with gbasic, but not with regular basic.
could you share the full code?

Beware of doing things for VIDEO9000 instead of GFX9000 and using the v9958 as well, since GFX9000 cannot superimpose it's source with the v9958, and Video9000 users are very scarce.

Anyway, a way to transfer data from v9958 to v9990 from plain basic is very interesting!
So, please share it Smile

By anonymous

incognito ergo sum (109)

Аватар пользователя anonymous

03-03-2016, 10:37

Kai Magazine wrote:

I do not quite understand what you mean, and probably you did not understand me either, because it is not a nightmare at all, as a matter of fact it is quite simple.

I think that what Manuel is saying is that if you detect a bug in the common code for all stage*.bas, then you have to correct all the stage*.bas and test them all again. That's the "nightmare" of code duplication.

By hit9918

Prophet (2866)

Аватар пользователя hit9918

03-03-2016, 11:10

are you using an objects rack.

	on objectid[i] gosub 1000,1100,1200...
	

1000 'this is a bullet
1010 x[i] = x[i] + dx[i]. ... return
...
1100 'this is a turtle
1120 some other move code ... return

how many bytes does a room need

	data 3,90,100	;create a type 3 ID on (90,100)
	data 4,80,80
	data -1		;-1 is end

in the end this could be in vram and no more consume RAM.

Страница 3/19
1 | 2 | | 4 | 5 | 6 | 7 | 8