{"id":19003464,"url":"https://github.com/magnetic-fox/c64-tutorial-like","last_synced_at":"2025-08-22T06:44:37.805Z","repository":{"id":205434195,"uuid":"327945450","full_name":"Magnetic-Fox/C64-Tutorial-like","owner":"Magnetic-Fox","description":"Some easy projects for cc65 compiler suite. Mostly C-written.","archived":false,"fork":false,"pushed_at":"2021-01-10T19:25:47.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-11T03:59:24.128Z","etag":null,"topics":["assembler","assembler-6502","c","c64","examples","experiments","retroprogramming","simple","tutorial"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Magnetic-Fox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-01-08T15:49:53.000Z","updated_at":"2023-11-06T13:43:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"5f7c8bb5-4531-4f76-950c-6c69c75780d8","html_url":"https://github.com/Magnetic-Fox/C64-Tutorial-like","commit_stats":null,"previous_names":["magnetic-fox/c64-tutorial-like"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Magnetic-Fox/C64-Tutorial-like","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Magnetic-Fox%2FC64-Tutorial-like","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Magnetic-Fox%2FC64-Tutorial-like/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Magnetic-Fox%2FC64-Tutorial-like/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Magnetic-Fox%2FC64-Tutorial-like/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Magnetic-Fox","download_url":"https://codeload.github.com/Magnetic-Fox/C64-Tutorial-like/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Magnetic-Fox%2FC64-Tutorial-like/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271599839,"owners_count":24787802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assembler","assembler-6502","c","c64","examples","experiments","retroprogramming","simple","tutorial"],"created_at":"2024-11-08T18:19:11.393Z","updated_at":"2025-08-22T06:44:36.674Z","avatar_url":"https://github.com/Magnetic-Fox.png","language":"C","readme":"# C64 Tutorial-like Projects\n\nHere are some of my easy projects done for cc65 compiler suite.\nMost of them are written in C. However, there are also some assembler projects.\n\n## What is included in this repo?\n\nSome really simple programs showing that programming in C for C64 reminds programming in assembler (a bit) and consist of POKE-ing and PEEK-ing too much like in Basic if you want to do something more.\nOkay, maybe I'm exaggerating, but I think that coding for C64 is generally pushing and getting some data into and from memory or devices (both internal and external).\nMy codes here are really simple and shows some basic operations on Commodore 64 performed using C language, which might be helpful while beginning with cc65 compiler.\nHowever, the C64 memory map and 6502 instruction set (if you want to make some assembly in C codes or understand why some codes work) would be your friends from now - knowing what is where you would have 50% of work done. Really. ;)\n\n## How to compile these codes?\n\nYep, I know, that I haven't written any Makefiles for my codes. Shame on me, but it's just because I've done those codes really quick in breaks from sad university life. :P\nAnd also I love to write too much in the console while experimenting with some new programming tactics. ;)\n\nOK, not to say so much..\n\n### Compiling C codes\n\n...is really easy. :) Just type in console:\n```\ncl65 some_code.c -o some_code.prg\n```\nAnd it's done now. ;)\n\nWhy not to use cc65 and ld65 later? Because using cl65 is more comfortable. At least for me. :) Well, if you want to provide some additional settings to the compilation process, you can do it via cl65 too!\nJust type:\n```\ncl65 --help\n```\nor\n```\ncc65 --help\n```\nor\n```\nld65 --help\n```\nand look what you can set from your needs. :) As far as I know, the cl65 can forward most of the settings to both cc65 and ld65.\n\n### Compiling assembler codes\n\nAnd here is much more to say...\nMaybe I could start with saying that my assembler codes aren't perfect. Well, at least **c128check.asm** isn't perfect. It's just a stub that can be used combined with other program, so it's programmed the way it's not comfortable to compile.\n\nTo compile it properly you have to type:\n```\ncl65 c128check.asm --start-addr 2061 -t none -o c128check.prg\n```\n**AND IT'S NOT ALL YET!**\n\nOnly the assembler code is compiled and linked into machine code. But it doesn't contain Basic's startup code providing SYS 2061 line or similar. You need to provide it manually using some hex editor.\n\nTo make it properly, open c128check.prg in hex editor (for example Hex Fiend on Mac, or HxD Hex Editor on Windows) and add those bytes **AT THE BEGINNING** of the whole file:\n```\n01 08 0B 08 20 03 9E 32 30 36 31 00 00 00\n```\nThis will make a Basic startup code, and you will be able to run this code both on Commodore 64 and Commodore 128.\n\nI know, not really comfortable to work on it. I'll try to make some Makefiles next time. At least for assembly. ;)\n\n## Codes history\n\nIt was in late May 2019. I've still remembered last AmiParty from February, when I coded in Commodore Basic the whole saturday evening using MarX's C64. ;)\nI felt really interested in playing with these great 8-bit computers. Especially because I always loved classic computers and just wanted to try. I remember, that I dreamed of creating software which could save and load data from datassette.\nSo I decided to spent some days on trying to code some great software using Basic, but finally I've seen that programs written in this language are not really efficient even while coding some really basic stuff.\nI've thought whole evening how to do it better, and finally I've decided to code something in language needing compiling. But the choice wasn't really wide. \"Assembler is the best!\", of course. Everybody would say that.\nWell, for coding powerful demos it's probably the only solution, but I still wanted to code some basic stuff like simple notepad, image displayer or tape-to-disk file copier. I felt really confused to make it using assembly.\nSuddenly, I remembered, that some years ago I've accidentally found a C compiler for 6502-based computers. It was called **cc65**. I've found it on the internet and compiled simple \"Hello world!\" program.\nI felt perfect. \"I can make everything!\". :) But, there wasn't as good and easy as I've thought.\n\n### Documentation of cc65\n\nHaha, that's something that does not exists.. :D\nWell, to be fair, it nearly doesn't exists. The main documentation of procedures and structures of libraries available to use is in the include files and in archived mailing list (which is also not fully archived because it was deleted from cc65's official website due to GDPR).\nHowever, I decided to be stubborn and to find as much solutions for my problems as I'll be able to.\n\n## Disclaimer\n\nI've made much effort to provide here working and checked codes with hope it will be useful. Most of these programs were checked on a real hardware.\n**However, these codes are provided here \"AS IS\", with absolutely no warranty! I take no responsibility for using them - DO IT ON YOUR OWN RISK!**\n\n## License\n\nCodes provided here are free for personal use.\nIf you like to use any part of these codes in your software, just please give me some simple credits and it will be okay. ;)\nIn case you would like to make paid software and use parts of these codes - please, contact me before.\n\n*Bartłomiej \"Magnetic-Fox\" Węgrzyn,\n8th January, 2021*\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagnetic-fox%2Fc64-tutorial-like","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagnetic-fox%2Fc64-tutorial-like","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagnetic-fox%2Fc64-tutorial-like/lists"}