Detecting Screen Size & Using KERNAL Routines in BASIC (C64, C128, & VIC-20)

  Рет қаралды 1,030

Basic Bites

Basic Bites

Күн бұрын

Пікірлер: 14
@BreadboxBitfall
@BreadboxBitfall Жыл бұрын
Once again interesting information and great video, thanks!
@no1leader135
@no1leader135 Жыл бұрын
Great video!👏👏👏
@c128stuff
@c128stuff Жыл бұрын
The reason why the addresses for the a/x/y registers changed with the c128 is because the c128 does a lot of bankswitching, and calls between code in different banks need a similar mechanism of first storing x/y/a (and actually more), then switching banks, loading back the registers, calling a function, storing x/y/a, switching back to the original bank the calling code is in, reload x/y/a (etc) and then return. To ensure the addresses used for those are always available, and do all this saving/loading with as little overhead as possible, the storage for this must be on the zeropage. SYS uses part of the same mechanism. Commodore never considered the actual addresses used by the sys command for x/y/a as part of the kernal interface. The kernal interface is really intended to be used from assembler, not from basic. It being possible, and even usefull, to use if from basic not withstanding. That is a logical consequence of being able to call machine code from basic, but not an intended use of the kernal interface. And hence, while what you do is pretty neat and usefull, it is outside how this interface was intended to be used, and this kind of use was simply not considered as part of the 'standard'. You'll find those addresses also changed on some other 8 bit machines (b500/p500 and similar come to mind)
@BasicBitesCA
@BasicBitesCA Жыл бұрын
I appreciate the comment! I am very much still learning about the C128, but my understanding is that the entire bottom 1K of RAM is shared memory, hence I didn't see why the previous addresses couldn't have continued to work, for the benefit of BASIC programmers. If the memory management of the C128 resulted in those addresses being hit so frequently that efficiency became an issue, that would indeed explain why they allocated them precious zeropage space! -- JC
@c128stuff
@c128stuff Жыл бұрын
@@BasicBitesCA The amount of shared ram is configurable (common ram configuration in $d506), and is 1k at the bottom of ram by default. It can be disabled, enlarged, and you can also have common ram at the top of the address space. This is also observed by both the 8502 and the z80. Zeropage and stack however will always be shared, but the actual rules for where they are in physical ram are a bit too complex for a facebook comment. The mmu is great, lacking, simple and yet fairly complex all at the same time 🙂
@c128stuff
@c128stuff Жыл бұрын
@@BasicBitesCA btw, I see your point with regards to those addresses having changed. To at least partially make up for that however, basic 7 provides you a much more direct way to provide values for registers in a sys call by providing them as extra arguments to the sys command.
@bwack
@bwack Жыл бұрын
Great channel! :)
@BasicBitesCA
@BasicBitesCA Жыл бұрын
Thank you! I have enjoyed videos on your channel as well. ☺️ -- JC
@chainq68k
@chainq68k Жыл бұрын
"Not a bad idea for the next guy who'll read your code." - and by a very good chance, this next guy will be yourself, a few months or years down the line, scratching your head what the heck did you even do there. :)
@BasicBitesCA
@BasicBitesCA Жыл бұрын
Ain't that the truth! -- JC
@peachgrush
@peachgrush Жыл бұрын
Would be interesting to see if the same program runs properly on a PET or 16/116/+4 :)
@BasicBitesCA
@BasicBitesCA Жыл бұрын
My hunch is not without further modification -- but if those machines similarly contain a unique RESET vector at 65532, then further values of Machine Type can be added using the same method as is used to detect the C128, and tweaks made based upon that. I don't code for any of those machines, but VICE emulates them all, so I would encourage you to download the code and experiment with it further. ☺️ -- JC
@jack002tuber
@jack002tuber Жыл бұрын
I found this channel just now. Liked. Subscribed. I hope to get a vice emulator going again, I had it once then my hard drive died. Great content.
@BasicBitesCA
@BasicBitesCA Жыл бұрын
Thank you, and welcome! -- JC
All the Commodore 64 KERNAL Revisions: Bugs, Fixes, and More!
29:39
8-Bit Show And Tell
Рет қаралды 47 М.
iPhone or Chocolate??
00:16
Hungry FAM
Рет қаралды 38 МЛН
Running With Bigger And Bigger Lunchlys
00:18
MrBeast
Рет қаралды 104 МЛН
The Commodore 64 Program Pack
20:46
Basic Bites
Рет қаралды 2,1 М.
MASTEROM 64: Rediscovered 1987 Commodore 64 KERNAL Replacement
22:45
8-Bit Show And Tell
Рет қаралды 30 М.
A New  Mindblowing C64 Demo ! 2023
16:20
gazzaka
Рет қаралды 113 М.
Commodore 1541C: MORE than a facelifted 1541!
17:37
Basic Bites
Рет қаралды 5 М.
The C64 Mini - Reviewed
24:22
The 8-Bit Guy
Рет қаралды 1,2 МЛН
Birth of BASIC
38:13
Dartmouth
Рет қаралды 1,2 МЛН
Inside the Commodore 1571 Floppy Disk Drive (C128 / C64)
35:08
Basic Bites
Рет қаралды 6 М.
What is the Smallest Possible .EXE?
17:04
Inkbox
Рет қаралды 397 М.
F-BOMBS and Easter Eggs in Epyx Toolkit Basic | Commodore 64
11:02
Basic Bites
Рет қаралды 2,1 М.