Page 4 of 5
Re: Family BASIC Lessons
Posted: Mon May 22, 2017 9:23 am
by lancuster
Who knows, the engine of this program can support sprites larger than 2x2 tiles?
Re: Family BASIC Lessons
Posted: Tue May 23, 2017 2:22 am
by Pokun
The command DEF SPRITE allows you to define each 8x8 sprite (OAM entry) manually, if I remember correctly, while DEF MOVE will automatically make an animated 2x2 character metasprite. It was a long time ago I played around with this so I can't really help, sorry.
lancuster wrote:How to paste code into Nestopia?
It's in the emulator menu I think. Or just press F12.
Re: Family BASIC Lessons
Posted: Tue May 23, 2017 9:06 am
by lancuster
So I can insert sprites Mario or another character from another game without any changes? I'm asking to know if the game will work normally after I specify a larger number of tiles.
Re: Family BASIC Lessons
Posted: Wed May 24, 2017 6:03 am
by Pokun
Yes it should work. Though I'd test with a few sprites first to make sure it works as you expect. You need to follow the same format for animations to work.
I checked the manual and it seems DEF SPRITE doesn't simply make an OAM entry as I thought. It makes an animated 2x2 character big metasprite if you pass a 1 to parameter B (as explained in the manual on page 88). You have to pass 0 to parameter B if you only want a single 8x8 dot sprite (but it's also animated).
Just remember that doing bigger metasprites is going to take more code and therefore also use up more program memory.
Re: Family BASIC Lessons
Posted: Wed May 24, 2017 8:46 am
by lancuster
Clear. How to use the editor background and music which commands are responsible for it? I tried to draw back, but nothing happened.
Re: Family BASIC Lessons
Posted: Thu May 25, 2017 1:08 am
by Pokun
The background editor is accessed from a new command in V3, you type BGTOOL (in earlier versions you just access it from the BASIC menu). V3 also allows saving the background to battery RAM. Read the original manual (not the V3 manual) on how to use it, and read the V3 manual to see how you save and such in V3.
Sound is done using an MML (Music Macro Language) which allows you to use the APU's two square channels and the triangle channel. It's done with the PLAY command (page 80~81 in the original manual). Sound effects are simple to do in MML, but if you want to make background music that runs in parallel to your game using MML, you'll have to write a sound engine that runs every main loop of your program.
For the noise channel you either have to
POKE the APU registers or write the sound engine in 6502 subroutines and CALL them.
Re: Family BASIC Lessons
Posted: Thu May 25, 2017 4:47 am
by lancuster
I understand that a "spacebar" is responsible for the printing of tiles on the screen, and F1-F4 - for their palette. But I don't know how to choose the other tiles.
Also I wanted to clarify, whether the use of abbreviations to save more space for code.
Re: Family BASIC Lessons
Posted: Thu May 25, 2017 5:29 am
by Pokun
Have you downloaded the
manual at all? It explains how to use the editor better than I can.
Yes if memory is a concern you can sacrifice readability by using more abbreviations and cut down on spaces (the interpreter mostly ignores spaces). I've never done it, but I also never done a big enough project where memory became a problem.
Re: Family BASIC Lessons
Posted: Fri May 26, 2017 5:38 am
by lancuster
It turns out that the program can only play 7 notes plus the change of tone and other indicators?..
By the way, about BGTOOL in this document is not a word. Give me some examples or tutorials.
Re: Family BASIC Lessons
Posted: Fri May 26, 2017 12:56 pm
by Pokun
lancuster wrote:It turns out that the program can only play 7 notes plus the change of tone and other indicators?..
The MML gives you full control of the
square duty cycle setting (Y0~Y3), hardware saw envelope flag (M1 and M0 for on and off respectively) and volume (V0~V15, V0 is silent and V15 is loudest, only works for square channel and if saw envelope is off). You also have six full octaves (O0~O5) with twelve notes each (A~#F, plus a "rest" note R), eight levels of tempo per note (T1~T8) and a length counter per note (x0~x9).
Square channel 1 is called channel A in the manual, Square channel 2 is B and the Triangle channel is C. You can play all three of them at the same time as explained in the manual (multiphonic).
Making a sound engine in Family BASIC is probably very memory consuming so it's quite rare to see games with background music. Most games only use it for sound effects or when playing a short Title Screen or Game Over melody when the game isn't accepting input from the player, so that a sound engine isn't needed.
By the way, about BGTOOL in this document is not a word. Give me some examples or tutorials.
BGTOOL is a command in V3 only, and the original manual doesn't mention it. The name of the actual editor is BG GRAPHIC. Usage is explained on page 40 in the manual. The main difference in V3 is that you don't type SYSTEM (that will shut down the game), instead you type BGTOOL to access it. Read from page 40 and ask again if there's something that's not clear.
The V3 manual can be found
here. I included the translation in the attachment of this post.
Re: Family BASIC Lessons
Posted: Sun Jul 08, 2018 4:24 am
by lancuster
I just got back to deal.
I would like to find out what values are responsible for including BIGTOOL and other commands that can't be entered on a standard keyboard, due to the lack of such keys. Who can tell how to find these values in the ROM to move commands to existing keys for programming without a proprietary keyboard?
Like this:
CTRL+W - change language to English
CTRL+V - change language to Japanese
Re: Family BASIC Lessons
Posted: Sun Jul 08, 2018 7:58 am
by Pokun
It's BGTOOL not BIGTOOL and doesn't require any special characters to enter. But it's only available in V3. If it doesn't work I guess you are running V1 or V2.
I'm not sure what you are talking about standard keyboard. There is only one keyboard for Famicom unless you are using a Famiclone one? Or are you running on an emulator? The emulator should emulate all keys, but it may fail to support all PC keyboards. Some emulators doesn't allow my Swedish keyboard to use all keys (I forgot which).
For control codes look at page 104 in the manual. For example CTR+V is the same as the kana key and CTR+W goes back into alphanumeric mode. CTR+G is the same as entering BEEP and the most useful of all: CTR+D (restores sprites, palettes etc to default).
Re: Family BASIC Lessons
Posted: Sun Jul 08, 2018 1:40 pm
by lancuster
Pokun wrote:It's BGTOOL not BIGTOOL and doesn't require any special characters to enter. But it's only available in V3. If it doesn't work I guess you are running V1 or V2.
I'm not sure what you are talking about standard keyboard. There is only one keyboard for Famicom unless you are using a Famiclone one? Or are you running on an emulator? The emulator should emulate all keys, but it may fail to support all PC keyboards. Some emulators doesn't allow my Swedish keyboard to use all keys (I forgot which).
For control codes look at page 104 in the manual. For example CTR+V is the same as the kana key and CTR+W goes back into alphanumeric mode. CTR+G is the same as entering BEEP and the most useful of all: CTR+D (restores sprites, palettes etc to default).
On the emulator. I tried to find the missing keys on the keyboard (like "GRAPH") and didn't find them. On Virtuanes doesn't want to be printed ":" and ";". Because STŠ¢ONES only supports Virtuanes, I'll have to have programming on it.

Re: Family BASIC Lessons
Posted: Sun Jul 08, 2018 6:15 pm
by Gilbert
The
online help of VirtuaNES lists some of the key assignments:
STOP: End
CLR/HOME: Home
GRAPH: Press and hold/release PageDown,PageUp
KANA: F12
Re: Family BASIC Lessons
Posted: Sun Jul 08, 2018 7:10 pm
by tepples
Gilbert wrote:GRAPH: Press and hold/release PageDown,PageUp
How practical is that on laptops where PageDown and PageUp are behind the Fn modifier key? On a Dell Inspiron 11 3000 series, for example, they're Fn+Down and Fn+Up.