Discuss Scratch

RokCoder
Scratcher
1000+ posts

The Beeb - a full BBC Microcomputer emulator

supersonic61223 wrote:

i did that but the code is too long to posr
This is getting very repetitious. You know the preview button? The green tIck icon? Use the code and /code which will look too long and check it with the preview…


Scratch dabbling for fun…

RokCoder
Scratcher
1000+ posts

The Beeb - a full BBC Microcomputer emulator

Bearindigo105 wrote:

555345522044495300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004B000000020003200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

A recursive loop program
(press break to stop the loop)
That's a blank disk! Did you forget to save your program to the disk before getting the disk code?


Scratch dabbling for fun…

CyrusTheNiceGuy
Scratcher
100+ posts

The Beeb - a full BBC Microcomputer emulator

At a basic level, how are you able to display graphics on the computer?

My guess was that individual pixel-like sprites change colors when needed, but that doesn't seem to be the case when I look into the code.




Siggy image made by -@clove
samq64
Scratcher
1000+ posts

The Beeb - a full BBC Microcomputer emulator

CyrusTheNiceGuy wrote:

At a basic level, how are you able to display graphics on the computer?

My guess was that individual pixel-like sprites change colors when needed, but that doesn't seem to be the case when I look into the code.

I think it uses then pen.

Last edited by samq64 (May 24, 2021 12:22:10)

CyrusTheNiceGuy
Scratcher
100+ posts

The Beeb - a full BBC Microcomputer emulator

samq64 wrote:

CyrusTheNiceGuy wrote:

At a basic level, how are you able to display graphics on the computer?

My guess was that individual pixel-like sprites change colors when needed, but that doesn't seem to be the case when I look into the code.

I think it uses then pen.
That's a good guess, but I'm not sure- pen takes time to render, while the emulator responds instantly. Plus, the pen would have to cycle through colors for them to be changed. This might waste valuable CPU time.



Siggy image made by -@clove
Barthdry
Scratcher
500+ posts

The Beeb - a full BBC Microcomputer emulator

I need some way to make a emulator i think it is a complicated programming topic and not related much to scratch but once you understand it you can perhaps make in scratch or whatever language that has enough power with libraries and etc..
oxiti8
Scratcher
1000+ posts

The Beeb - a full BBC Microcomputer emulator

CyrusTheNiceGuy wrote:

samq64 wrote:

CyrusTheNiceGuy wrote:

At a basic level, how are you able to display graphics on the computer?

My guess was that individual pixel-like sprites change colors when needed, but that doesn't seem to be the case when I look into the code.

I think it uses then pen.
That's a good guess, but I'm not sure- pen takes time to render, while the emulator responds instantly. Plus, the pen would have to cycle through colors for them to be changed. This might waste valuable CPU time.
Pen is used. A custom block set to “run without screen refresh” dramatically speeds up draw speed. Individual sprites would be crazy slow, and the “stamp” method would be difficult due to the number of colors used.
RokCoder
Scratcher
1000+ posts

The Beeb - a full BBC Microcomputer emulator

oxiti8 wrote:

CyrusTheNiceGuy wrote:

samq64 wrote:

CyrusTheNiceGuy wrote:

At a basic level, how are you able to display graphics on the computer?

My guess was that individual pixel-like sprites change colors when needed, but that doesn't seem to be the case when I look into the code.

I think it uses then pen.
That's a good guess, but I'm not sure- pen takes time to render, while the emulator responds instantly. Plus, the pen would have to cycle through colors for them to be changed. This might waste valuable CPU time.
Pen is used. A custom block set to “run without screen refresh” dramatically speeds up draw speed. Individual sprites would be crazy slow, and the “stamp” method would be difficult due to the number of colors used.
It also caches the current screen and only draws pixels that have been updated. This is a massive time saver and also explains why hardware scrolling or palette changing emulate more slowly as every pixel needs updating for either operation. There are a few more optimisations I could add but it's too easy to stay on the same project, forever adding improvements. I think this one has reached a point where I'm satisfied with it


Scratch dabbling for fun…

CyrusTheNiceGuy
Scratcher
100+ posts

The Beeb - a full BBC Microcomputer emulator

RokCoder wrote:

It also caches the current screen and only draws pixels that have been updated. This is a massive time saver and also explains why hardware scrolling or palette changing emulate more slowly as every pixel needs updating for either operation. There are a few more optimisations I could add but it's too easy to stay on the same project, forever adding improvements. I think this one has reached a point where I'm satisfied with it.

Wow, that's amazing! Thanks for the info, guys.



Siggy image made by -@clove
ScratchcatandGobo
Scratcher
1000+ posts

The Beeb - a full BBC Microcomputer emulator

My first micro program: 555345522044495300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004B000000020003200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Yeah, but at least we've learned something today… that every moment of our life should be lived to the fullest because it can be very long or very short, my friend. - Gumball
I felt like I wanted to develop games on here, so I won't leave! (for now)
(last edited 2/8/24)





























ScratchcatandGobo
Scratcher
1000+ posts

The Beeb - a full BBC Microcomputer emulator

You can find more BBC micro games to download here
@scratchcatandGobo: BRING ON THE POWER!

Scratch

replit (unable to put link)

Last edited by ScratchcatandGobo (June 3, 2021 19:14:44)


Yeah, but at least we've learned something today… that every moment of our life should be lived to the fullest because it can be very long or very short, my friend. - Gumball
I felt like I wanted to develop games on here, so I won't leave! (for now)
(last edited 2/8/24)





























RokCoder
Scratcher
1000+ posts

The Beeb - a full BBC Microcomputer emulator

mariobros17 wrote:

bradylay24 wrote:

when i paste the code in….it says “disc loaded” but nothing happens
That happens to me too sometimes.
All you're doing is putting a disk in the disk drive. It won't do anything on its own. You need to boot the disk - press and hold the shift key, tap the break icon and then release the shift key. There are plenty of useful tips in the first post of this forum… including how to post your disk image codes in a single line


Scratch dabbling for fun…

Evanzap
Scratcher
100+ posts

The Beeb - a full BBC Microcomputer emulator

My first program, I made it myself with the help of the user guide, it was hard to make but fun too!
555345522044495300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004B000000020003200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Hi, I'm Evan! I'm not the best at coding.
Fun Fact: most of my usernames are Evanzap.
I play roblox! (User: 1newkidonthegame) I also play both versions of mc! (User: EvanZap)
Shift/Ctrl+Down

I use Scratch because it's fun to make projects. Whenever you get a view thats a real person who saw what you made. Sharing and creating is one of the best things about Scratch. It's hard to remember that each and every project on this platform is made by a real human. Each and every Like, Favorite and even View was done by a real person. Thats why I love Scratch, everyone is really nice to eachother and willing to help people out. (almost) Everything that I've heard people say about my projects were really nice things. Anyways, thanks for coming to my TED Talk.
RokCoder
Scratcher
1000+ posts

The Beeb - a full BBC Microcomputer emulator

Evanzap wrote:

My first program, I made it myself with the help of the user guide, it was hard to make but fun too!
 [quote]555345522044495300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004B000000020003200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
I don't think you saved it to the disk before exporting the disk code


Scratch dabbling for fun…

colinmacc
Scratcher
1000+ posts

The Beeb - a full BBC Microcomputer emulator

Here's something I recently spotted in a Facebook group (H/T Darren Northcott)

10MODE4:VDU19,7,3;0;23,1,0;0;0;0;
20PROCE(640,512,450,277,0,7)
30PROCE(640,512,436,268,0,0)
40PROCE(640,512,392,220,0,7)
50PROCE(640,512,360,200,0,0)
60VDU24,280;312;1000;716;
70PROCE(570,312,70,130,0,7)
80PROCE(710,312,70,130,0,7)
90PROCE(490,380,50,100,40,7)
100PROCE(790,380,50,100,140,7)
110PROCE(520,650,87,60,40,7)
120PROCE(760,650,87,60,140,7)
130GCOL0,0:MOVE550,570:MOVE590,710:PLOT85,640,600:MOVE732,570:PLOT85,693,710
140GCOL0,7:MOVE596,714:MOVE687,714:PLOT85,610,690:PLOT85,673,690
150VDU19,7,3;0;26
160REPEATUNTILGET=127
990END
1000DEFPROCE(X%,Y%,RX%,RY%,A%,C%)
1010GCOL0,C%:R=RAD(A%):T1=COS(R):T2=SIN(R):MOVEX%,Y%:DRAWX%+RX%*T1,Y%+RX%*T2
1020FORB%=0 TO 360 STEP 10
1030MOVEX%,Y%:R=RAD(B%):T3=COS(R):T4=SIN(R):X=RX%*T3:Y=RY%*T4:XT=X*T1-Y*T2+X%:YT=X*T2+Y*T1+Y%:PLOT85,XT,YT:NEXT
1040ENDPROC

Select all the code, and save it to a text file. Then use the “Paste” option to paste the text file into the keyboard buffer in the emulator.

Once it's fully loaded, type RUN followed by Enter.

Gotta go, dinner time!

Sample Projects

RokCoder
Scratcher
1000+ posts

The Beeb - a full BBC Microcomputer emulator

mariobros17 wrote:

RokCoder wrote:

mariobros17 wrote:

bradylay24 wrote:

when i paste the code in….it says “disc loaded” but nothing happens
That happens to me too sometimes.
All you're doing is putting a disk in the disk drive. It won't do anything on its own. You need to boot the disk - press and hold the shift key, tap the break icon and then release the shift key. There are plenty of useful tips in the first post of this forum… including how to post your disk image codes in a single line
I already do that every time. Some discs work, and some don't.
Some disks aren't bootable. You'd need to look at what's on them (using *cat) and then run the files manually.


Scratch dabbling for fun…

RokCoder
Scratcher
1000+ posts

The Beeb - a full BBC Microcomputer emulator

colinmacc wrote:

Select all the code, and save it to a text file. Then use the “Paste” option to paste the text file into the keyboard buffer in the emulator.

Once it's fully loaded, type RUN followed by Enter.

Gotta go, dinner time!

Very cool! I'd challenge anyone to guess what that code's going to do before trying it out


Scratch dabbling for fun…

Toper-games
Scratcher
42 posts

The Beeb - a full BBC Microcomputer emulator

555345522044495353424720202020240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004B0000000308032000192380F502CC020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000D000A0620DB0D00141A20F120222E2D2D544F5045522D47414D45532D2D2E220D001E2120F120222E2D2D53494D504C4520424154544C452047414D452D2D2E220D001F0B20E5208D5468400D00202420F1202254595045203120544F2041545441434B2C20352044414D4147452E220D00211E20F1202254595045203220544F204845414C2C20342048502E220D00222C20F1202254595045203320544F205350454349414C2041545441434B2C20332044414D4147452C220D00231520F120223130204946204C55434B592E220D00241E20F12022454E454D592044414D414745532034204F5220382E220D00250B20E5208D547C400D00282420E8202253454520494E535452554354494F4E532028592F4E29222C205349240D00321720E720534924203D20225922208C208D5460400D003C0C204850203D2035300D00460D20454850203D2035300D00501E20E82022574841542057494C4C20594F5520444F222C2053454C0D005A1520E72053454C203D2031208C208D4478400D00641520E72053454C203D2032208C208D744C400D006E1520E72053454C203D2033208C208D7460400D00781220454850203D20454850202D20350D00820B20E5208D6449400D008C10204850203D204850202B20340D00960B20E5208D6449400D00A010204C55434B203D20B32835290D00AA1620E7204C55434B203D2031208C208D6448400D00B41220454850203D20454850202D20330D00BE0B20E5208D6449400D00C81320454850203D20454850202D2031300D00C91220454E4C55434B203D20B32832290D00CD1B204850203D204850202D202834202A20454E4C55434B290D00D21520F12022594F55522048503A223B2048500D00DC1720F12022454E454D592048503A223B204548500D00E61420E7204850203C2031208C208D5444410D00F01520E720454850203C2031208C208D5458410D00FA0B20E5208D4450400D01041220F12022594F55204C4F53452E220D010E0620E00D01181120F12022594F552057494E21220D01220620E00DFF0000000000000000000000
That's disk data for my game.
It's called Simple Battle Game.
SBG for short.

When you loaded the disk, type in:
LOAD “SBG”
…and after that type:
RUN
…to run my game.
Instructions are included.
Have fun!

Last edited by Toper-games (June 15, 2021 16:45:43)


- @Toper-games
Check out my projects!!!! Go here: My profile.
RokCoder
Scratcher
1000+ posts

The Beeb - a full BBC Microcomputer emulator

Toper-games wrote:

555345522044495353424720202020240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004B0000000308032000192380F502CC020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000D000A0620DB0D00141A20F120222E2D2D544F5045522D47414D45532D2D2E220D001E2120F120222E2D2D53494D504C4520424154544C452047414D452D2D2E220D001F0B20E5208D5468400D00202420F1202254595045203120544F2041545441434B2C20352044414D4147452E220D00211E20F1202254595045203220544F204845414C2C20342048502E220D00222C20F1202254595045203320544F205350454349414C2041545441434B2C20332044414D4147452C220D00231520F120223130204946204C55434B592E220D00241E20F12022454E454D592044414D414745532034204F5220382E220D00250B20E5208D547C400D00282420E8202253454520494E535452554354494F4E532028592F4E29222C205349240D00321720E720534924203D20225922208C208D5460400D003C0C204850203D2035300D00460D20454850203D2035300D00501E20E82022574841542057494C4C20594F5520444F222C2053454C0D005A1520E72053454C203D2031208C208D4478400D00641520E72053454C203D2032208C208D744C400D006E1520E72053454C203D2033208C208D7460400D00781220454850203D20454850202D20350D00820B20E5208D6449400D008C10204850203D204850202B20340D00960B20E5208D6449400D00A010204C55434B203D20B32835290D00AA1620E7204C55434B203D2031208C208D6448400D00B41220454850203D20454850202D20330D00BE0B20E5208D6449400D00C81320454850203D20454850202D2031300D00C91220454E4C55434B203D20B32832290D00CD1B204850203D204850202D202834202A20454E4C55434B290D00D21520F12022594F55522048503A223B2048500D00DC1720F12022454E454D592048503A223B204548500D00E61420E7204850203C2031208C208D5444410D00F01520E720454850203C2031208C208D5458410D00FA0B20E5208D4450400D01041220F12022594F55204C4F53452E220D010E0620E00D01181120F12022594F552057494E21220D01220620E00DFF0000000000000000000000
That's disk data for my game.
It's called Simple Battle Game.
SBG for short.

When you loaded the disk, type in:
LOAD “SBG”
…and after that type:
RUN
…to run my game.
Instructions are included.
Have fun!
Thanks for sharing! I've played five times now and not won a single game but I shall persevere


Scratch dabbling for fun…

Toper-games
Scratcher
42 posts

The Beeb - a full BBC Microcomputer emulator

RokCoder wrote:

Toper-games wrote:

555345522044495353424720202020240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004B0000000308032000192380F502CC020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000D000A0620DB0D00141A20F120222E2D2D544F5045522D47414D45532D2D2E220D001E2120F120222E2D2D53494D504C4520424154544C452047414D452D2D2E220D001F0B20E5208D5468400D00202420F1202254595045203120544F2041545441434B2C20352044414D4147452E220D00211E20F1202254595045203220544F204845414C2C20342048502E220D00222C20F1202254595045203320544F205350454349414C2041545441434B2C20332044414D4147452C220D00231520F120223130204946204C55434B592E220D00241E20F12022454E454D592044414D414745532034204F5220382E220D00250B20E5208D547C400D00282420E8202253454520494E535452554354494F4E532028592F4E29222C205349240D00321720E720534924203D20225922208C208D5460400D003C0C204850203D2035300D00460D20454850203D2035300D00501E20E82022574841542057494C4C20594F5520444F222C2053454C0D005A1520E72053454C203D2031208C208D4478400D00641520E72053454C203D2032208C208D744C400D006E1520E72053454C203D2033208C208D7460400D00781220454850203D20454850202D20350D00820B20E5208D6449400D008C10204850203D204850202B20340D00960B20E5208D6449400D00A010204C55434B203D20B32835290D00AA1620E7204C55434B203D2031208C208D6448400D00B41220454850203D20454850202D20330D00BE0B20E5208D6449400D00C81320454850203D20454850202D2031300D00C91220454E4C55434B203D20B32832290D00CD1B204850203D204850202D202834202A20454E4C55434B290D00D21520F12022594F55522048503A223B2048500D00DC1720F12022454E454D592048503A223B204548500D00E61420E7204850203C2031208C208D5444410D00F01520E720454850203C2031208C208D5458410D00FA0B20E5208D4450400D01041220F12022594F55204C4F53452E220D010E0620E00D01181120F12022594F552057494E21220D01220620E00DFF0000000000000000000000
That's disk data for my game.
It's called Simple Battle Game.
SBG for short.

When you loaded the disk, type in:
LOAD “SBG”
…and after that type:
RUN
…to run my game.
Instructions are included.
Have fun!
Thanks for sharing! I've played five times now and not won a single game but I shall persevere
It's more like a hard game of luck.

Last edited by Toper-games (June 15, 2021 16:56:02)


- @Toper-games
Check out my projects!!!! Go here: My profile.

Powered by DjangoBB