Page 34 of 44

Re: gtBASIC

Posted: 13 Feb 2023, 09:34
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).

Re: gtBASIC

Posted: 13 Feb 2023, 09:55
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.

Re: gtBASIC

Posted: 14 Feb 2023, 09:10
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

Re: gtBASIC

Posted: 14 Feb 2023, 09:21
by at67
Can you send me the code that crashes? You've most likely found a memory management bug.

Re: gtBASIC

Posted: 14 Feb 2023, 11:06
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

Re: gtBASIC

Posted: 17 Feb 2023, 10:25
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

Re: gtBASIC

Posted: 18 Feb 2023, 20:42
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.

Re: gtBASIC

Posted: 21 Feb 2023, 11:28
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

Re: gtBASIC

Posted: 21 Feb 2023, 13:14
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.

Re: gtBASIC

Posted: 22 Feb 2023, 15:33
by wbushby
Is there a _maxNumPatterns_ like _maxNumBlits_ ?

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