It is currently Sat Sep 22, 2018 11:43 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 64 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject: Re: Family BASIC Lessons
PostPosted: Mon May 22, 2017 9:23 am 
Offline

Joined: Thu Feb 18, 2016 3:20 am
Posts: 70
Who knows, the engine of this program can support sprites larger than 2x2 tiles?

_________________
See my hacks on Romhacking.net
I added level configs for 102 NES games in CaD Editor


Top
 Profile  
 
 Post subject: Re: Family BASIC Lessons
PostPosted: Tue May 23, 2017 2:22 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 1008
Location: Hokkaido, Japan
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.


Top
 Profile  
 
 Post subject: Re: Family BASIC Lessons
PostPosted: Tue May 23, 2017 9:06 am 
Offline

Joined: Thu Feb 18, 2016 3:20 am
Posts: 70
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.

_________________
See my hacks on Romhacking.net
I added level configs for 102 NES games in CaD Editor


Top
 Profile  
 
 Post subject: Re: Family BASIC Lessons
PostPosted: Wed May 24, 2017 6:03 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 1008
Location: Hokkaido, Japan
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.


Top
 Profile  
 
 Post subject: Re: Family BASIC Lessons
PostPosted: Wed May 24, 2017 8:46 am 
Offline

Joined: Thu Feb 18, 2016 3:20 am
Posts: 70
Clear. How to use the editor background and music which commands are responsible for it? I tried to draw back, but nothing happened.

_________________
See my hacks on Romhacking.net
I added level configs for 102 NES games in CaD Editor


Top
 Profile  
 
 Post subject: Re: Family BASIC Lessons
PostPosted: Thu May 25, 2017 1:08 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 1008
Location: Hokkaido, Japan
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.


Top
 Profile  
 
 Post subject: Re: Family BASIC Lessons
PostPosted: Thu May 25, 2017 4:47 am 
Offline

Joined: Thu Feb 18, 2016 3:20 am
Posts: 70
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.

_________________
See my hacks on Romhacking.net
I added level configs for 102 NES games in CaD Editor


Top
 Profile  
 
 Post subject: Re: Family BASIC Lessons
PostPosted: Thu May 25, 2017 5:29 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 1008
Location: Hokkaido, Japan
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.


Attachments:
File comment: The rest of the manual is in this text file, but it's mostly not related to BASIC.
fabaman-t_v1.0.txt [43.32 KiB]
Downloaded 70 times
Top
 Profile  
 
 Post subject: Re: Family BASIC Lessons
PostPosted: Fri May 26, 2017 5:38 am 
Offline

Joined: Thu Feb 18, 2016 3:20 am
Posts: 70
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.

_________________
See my hacks on Romhacking.net
I added level configs for 102 NES games in CaD Editor


Top
 Profile  
 
 Post subject: Re: Family BASIC Lessons
PostPosted: Fri May 26, 2017 12:56 pm 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 1008
Location: Hokkaido, Japan
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.

Quote:
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.


Attachments:
File comment: Translated V3 manual. Translation is incomplete but the most important parts are translated, including the register for the commands that are new in V3 and how to use the new backup features.
fambasv3_t.txt [41.06 KiB]
Downloaded 65 times
Top
 Profile  
 
 Post subject: Re: Family BASIC Lessons
PostPosted: Sun Jul 08, 2018 4:24 am 
Offline

Joined: Thu Feb 18, 2016 3:20 am
Posts: 70
I just got back to deal. :wink:
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

_________________
See my hacks on Romhacking.net
I added level configs for 102 NES games in CaD Editor


Top
 Profile  
 
 Post subject: Re: Family BASIC Lessons
PostPosted: Sun Jul 08, 2018 7:58 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 1008
Location: Hokkaido, Japan
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).


Top
 Profile  
 
 Post subject: Re: Family BASIC Lessons
PostPosted: Sun Jul 08, 2018 1:40 pm 
Offline

Joined: Thu Feb 18, 2016 3:20 am
Posts: 70
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.
Image

_________________
See my hacks on Romhacking.net
I added level configs for 102 NES games in CaD Editor


Top
 Profile  
 
 Post subject: Re: Family BASIC Lessons
PostPosted: Sun Jul 08, 2018 6:15 pm 
Offline
User avatar

Joined: Sun Dec 12, 2010 10:27 pm
Posts: 321
Location: Hong Kong
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


Top
 Profile  
 
 Post subject: Re: Family BASIC Lessons
PostPosted: Sun Jul 08, 2018 7:10 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20565
Location: NE Indiana, USA (NTSC)
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 64 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group