gtBASIC

Using, learning, programming and modding the Gigatron and anything related.
Forum rules
Be nice. No drama.
at67
Site Admin
Posts: 647
Joined: 14 May 2018, 08:29

Re: gtBASIC

Post by at67 »

It's a one time only deal, remember the LOAD command does not load anything once the Gigatron is executing code, all it does is allocate RAM and stuff data into it during the loading process. In this case Video RAM is allocated and the image is stuffed into it as the .gt1 file is loaded. Try it on a real Gigatron and you'll see it's not instant and you can actually see the image being downloaded in real time.

The only way to do what you want, is to do an OPEN and then LOAD from some sort of external device, (in this case Pluggy Reloaded, when the OPEN command is finished).
wbushby
Posts: 208
Joined: 16 Jul 2021, 10:59

Re: gtBASIC

Post by wbushby »

That makes sense. As I have pluggy reloaded I forget there is normally no storage medium

Plus while the house is being renovated, I am working on the emulator. No idea where my real hardware is at moment.
wbushby
Posts: 208
Joined: 16 Jul 2021, 10:59

Re: gtBASIC

Post by wbushby »

So I have reduced the number of LOAD BLIT, ... to 32.

It seems that the game slowed down considerably or crashes when I have 42 of these images.

I think I will be stuck with this game at 2 levels even though I still have free memory of 23,566 bytes.
The full game would require about 250 LOAD BLT statements, 30 LOAD SPRITE statements and 120 LOAD PATTERN statements.

I will consider the Sprite/Image count restriction when I pick future games to port/write for the Gigatron in basic
at67
Site Admin
Posts: 647
Joined: 14 May 2018, 08:29

Re: gtBASIC

Post by at67 »

Can you send me the code that crashes? You've most likely found a memory management bug.
wbushby
Posts: 208
Joined: 16 Jul 2021, 10:59

Re: gtBASIC

Post by wbushby »

OK, I will email it to you. Use QWER for going left, user UIOP for going right and Z to M to jump

When pressing ENTER to leave the title screen you need to try a few times. I haven't fixed that yet.

If the screen loads correctly it will go weird when you start moving

2 emails . I forgot to attach the source on the first
wbushby
Posts: 208
Joined: 16 Jul 2021, 10:59

Re: gtBASIC

Post by wbushby »

I have found a small bug with strings.

Score = 123
SC$ = "0000" + STR$(Score)
PRINT RIGHT$(SC$, 5)

It actually prints "30000"

This is to fix an issue with the PrintScore procedure in the code I sent you

This is my actual current code

PROC PrintScore

SC$ = "0000" + STR$(Score(0))

L = LEN(SC$)

IF L > 5
SC$ = RIGHT$(SC$, 5)
ENDIF

SET FG_COLOUR, &h3F ' White
SET BG_COLOUR, &h0 ' Black
AT 124, 111:PRINT SC$;

ENDPROC
wbushby
Posts: 208
Joined: 16 Jul 2021, 10:59

Re: gtBASIC

Post by wbushby »

I have changed the score routine from printing a string to using graphics of the numbers as you have in the Invaders and Pucmon

This gets around some issues that seem to pop up with strings. such as the concatenation.
wbushby
Posts: 208
Joined: 16 Jul 2021, 10:59

Re: gtBASIC

Post by wbushby »

So after much debugging and recoding I can summarise the issues I had were mostly due coding errors I made.

1) I had a few places where drawing a graphic such as a LINE or RECT went partially outside the screen.
2) I had an issue where the SPRITE or BLT went partially outside the screen.

These 2 issues may work OK for a while but will cause issues as code is added leading to false identification of the cause.

There does seem to be an issue with strings. I found that when I removed writing the score using strings on the bottom left of the screen with a trailing semi-colon that many issues cleared.

I have been able to use many more SPRITEs and BLTs now that I have corrected these issues.

Overall Basic vX0 is working very well
at67
Site Admin
Posts: 647
Joined: 14 May 2018, 08:29

Re: gtBASIC

Post by at67 »

That's great news!

The string bug you found I have fixed, but I haven't pushed the code changes yet, there's a little more to do hopefully by this weekend; for both gtBASIC and ROMvX0.
wbushby
Posts: 208
Joined: 16 Jul 2021, 10:59

Re: gtBASIC

Post by wbushby »

Is there a _maxNumPatterns_ like _maxNumBlits_ ?

I have 30 Patterns at moment and I think it may be over the limit
Post Reply