Family BASIC Super Thread

Started by UglyJoe, July 05, 2015, 07:05:15 pm

Previous topic - Next topic

julgr

Here's a useful page on the keyboard matrix and hardware interface.

https://wiki.nesdev.com/w/index.php/Family_BASIC_Keyboard

It's on my list of future projects to create a USB adapter for my Family Basic keyboard. Some day...

leadedsolder

Does anyone know how to squelch the annoying background hum/noise that seems to be present in Game BASIC? I've muted the TV, but it makes for a little extra work.

dave99

Quote from: PALCOLOR on July 11, 2020, 08:10:37 pmUnfortunately I don't have a manual.
Cartridge only.

Link to ROM in this forum
I know that it is not desirable to attach it.
Please forgive me.

Playbox BASIC (Japan) (v1.0).zip

I have the manual for Family Basic v3
https://gamefaqs.gamespot.com/nes/938747-family-basic-v3/faqs/59317

dave99

Quote from: leadedsolder on May 09, 2021, 01:50:10 pmDoes anyone know how to squelch the annoying background hum/noise that seems to be present in Game BASIC? I've muted the TV, but it makes for a little extra work.

Try making an audio decoupling toroidal transformer
https://www.epanorama.net/documents/groundloop/audio_isolator_building.html

fredJ

I have this guidebok from Famitsu, it says how to get to 256 levels in Super Mario Bros. Same trick as you can do with Tennis.

I don't know if you guys know about it.

Selling  Japanese games in Sweden since 2011 (as "japanspel").
blog: http://japanspel.blogspot.com

P

An article describing the same thing is on Famicom World's frontpage. But it is indeed relevant to this thread. The BASIC code is found in the article.


VeganLies2Me

I may look like I'm egoistical with this but I think my game could be a nice addition to this thread, mainly because I released the source code.
https://vl2m-studio.itch.io/satin

smilimko

I'm wondering why the official family basic v3 manual does not have any mention of two commands (or maybe functions): SPC and TAB. These keywords can be found when viewing a memory dump. Does anybody know what they do and how they are used?

P

In other BASIC dialects, SPC() is used with PRINT for printing a specified number of spaces and TAB() is for printing as many spaces is needed to reach a set tabulator position.

That syntax does not seem to work in Family BASIC V3 though, I'm guessing neither of them are implemented and Hudson just forgot to remove the tokens or they are just part of some leftover code.

leadedsolder

Yesterday at 09:14:43 pm #40 Last Edit: Yesterday at 09:58:42 pm by leadedsolder
MOVE is kind of dumbfounding me. I'm using Family BASIC 2.1a, and trying to do a space shooter.

I decided I would use SPRITE for the space ship, and MOVE for the shots from the space ship. Obviously, I only want to have one at a time, so I've got code kind of like this:

10 X = 100 : Y = 100 : F = 0
11 DEF MOVE(0) = SPRITE(12, 3, 2, 128, 0, 0) ' laser shot
... sprite initialization here ...
30 REM loop
31 SPRITE 0,X,Y
... input handling, moving X and Y about on STICK() ...
40 S = STRIG(0)
50 IF (S AND 8) <> 0 THEN GOSUB 1500
51 IF (S AND 8) = 0 THEN F = 0
60 GOTO 30

1500 REM fire button handling
1501 IF F = 1 THEN RETURN
1502 F = 1
1503 POSITION 0, X + 4, Y + 4 ' put shot in front of space ship
1504 MOVE 0 ' send the shot on its way
1510 RETURN

if I tap the fire button, and then wait for the MOVE to clock out 256 pixels of movement, then hit the fire button again, it consistently clocks out 256 pixels of movement each time.

However, if I tap the fire button multiple times (interrupting the MOVE and starting it over again) it seems like the "counter" doesn't reset from being POSITION'd. It will count out fewer than 256 pixels before stopping short.

If I tap the button just right, the shot will actually not even move!

I've tried ERA 0 and CUT 0 before POSITION but they don't seem to make a difference. Is there a better way to work around this bug than redefining DEF MOVE(0) = ... inside my fire button handler? That seems to work, but feels inelegant.

It would also be nice if I could make a MOVE go a little faster. 1 (which the manual says is the fastest speed) is very boring.

P

Today at 04:46:12 pm #41 Last Edit: Today at 04:55:56 pm by P
From reading the manual it seems to me that you need to use DEF MOVE each iteration in order to reset the distance counter. POSITION only changes the position and not the distance counter. CUT and ERA also doesn't seem to affect the distance counter.
I guess that if you find out where it's stored in RAM, you could POKE the distance counter to reset it manually.

The manual says that MOVE is quite limited in speed, so the only way to move faster is to move the sprites manually using DEF SPRITE and SPRITE commands, coding your own metasprites, but that requires a lot more code (and I'm not sure it's faster for larger metasprites). I think these are just the limitations of BASIC, it's interpreted in real time so speed is hurt compared to when programming in assembly.

The secret to coding your own metasprites is to only move the metasprite's "hotspot" (which can be anywhere in the metasprite but is usually defined to be in the middle of it) and have the sprites drawn each frame based on a relative distance from this hotspot.

leadedsolder

Thanks, that's what I thought, unfortunately.

I'm going to need to do collision by hand anyway (since I'm not in V3) so I guess manually animating the position of a 1-frame sprite isn't that big of a deal either.