An idea 🤔

2

Sylveon 2025-02-11 02:32

So if you type this code :3

For I=0 to 255
Next I
Print I

It will show 256 :3

So does it increse overtime (way faster then the LowRes nx clock) or does it skip to 255? :3


SP4CEBAR 2025-02-11 19:31 (Edited)

Your FOR loop loops from 0 to 255. On each "NEXT I", "I" will be incremented by 1. After the last loop where I = 255 "NEXT I" will increment it to 256, since 256 is greater than 255 the loop will not run again. Your next line prints I as 256. Variables in other languages like JavaScript's const and let (but not var) variables "I" would be deleted at this point


was8bit 2025-02-12 04:28

CPU Cycles

LowRes NX has a simplified simulation of CPU cycles. There is a fixed limit of cycles per frame. This assures the same program execution speed on all devices, so if you optimize your program on your device to run smoothly, it will run the same on all other devices.

Each execution of a command, function or operator, as well as access to a variable or a constant count 1 cycle. Some operations have additional costs:

String creation and modification count 1 cycle per letter.
Array initialization counts 1 cycle per element.
Memory area modification counts 1 cycle per byte (not single byte modifications like POKE).
BG area modification and text output count 2 cycles per cell (not single cell modifications like CELL).
Total cycles per frame 17556
Cycles per VBL interrupt 1140
Cycles per raster interrupt 51
The main program may spend any number of cycles, but when the limit is reached before a WAIT VBL or WAIT command, the execution continues in the next frame. If interrupts exceed their limit, you will see black scanlines on the screen.


was8bit 2025-02-12 04:42

Sampler...

Cycles.nx | Open in app
2025-02-12 04:42

Sylveon 2025-02-12 14:12

Thx :3


was8bit 2025-02-12 22:06

:)


Sylveon 2025-02-13 14:14

:3


Log in to reply.