https://github.com/AnnoyedArt1256/6502kernel
A simple OS for 6502-based platforms (currently C64 only), i'll port this to a future 6502-based computer i will work on in the future
1 messages · Page 1 of 1 (latest)
https://github.com/AnnoyedArt1256/6502kernel
A simple OS for 6502-based platforms (currently C64 only), i'll port this to a future 6502-based computer i will work on in the future
so rn to prepare for the filesystem refactor, i first changed the file name limit from 64 to 48, so i could make the cluster size 64 bytes and have the rest of the properties fit in 16 bytes
next i will probably make the actual fat table
the thing is that i generate the FS with ca65 (macro assembler) macros
but thankfully ca65 is very flexible so i can generate and use vars/labels programatically with .ident
ok now i got the FAT table actually written at compile-time by ca65
now it's time to implement the required changes for the LAB_xxxx and fgetc functions to at least get sh to be loaded into memory and run grins
now the LAB_xxxx (and now fgetc) functions work with the new fs
and that makes fopen work as well
now, every syscall that accesses the FS is fixed to use the new fat-like fs
other than mkdir...
Unix V1 on a C64?
kinda? it's not a complete unix-like but i did do some things in a more unix way
especially recently i've started doing syscalls and shit in a more unix-type fashion (using the same names and for instance)
finally, after 1.5 fucking hours of torture and screaming, mkdir now works in my new FS
all because of two lines missing from readdir breaking ls somehow 😭
and now 6502kernel works on my (currently very basic) 6502 computer emulator
it currently has 16k rom for the OS (which just uploads the kernel to RAM), a timer and a basic image reader (set address -> read from data reg)
i added a keyboard to the emulator and modified the getch syscall to use it and it worked first try 🔥
thats neat
running your os on your emu
pretty impressive
it's just a 6502, so emulating it is dead simple
but my 6502 emulator is cycle accurate 
so, for the older C64 version of this OS i made a SID player that plays PSID files
but my new customer computer uses an AY-3-8910 soundchip, which makes the sid command useless
so i'm making a .pt3 player (pt3 is a format used a bunch of AY music trackers) that's for 6502
since most .pt3 players are for Z80-based platforms (the pt3 format originated from the zx spectrum, that's why)
maybe if it has a timer IRQ :D
it does!
you likely want 6522 VIA Timer 1
if I remember right
the one that drives the sound stuff
yeah 100hz event
so this channel has kinda been dead for a few days
but in that time i had been working on an super mario bros. port for my 6502 computer
since it and the NES use very similar CPUs
yay, what about sprite hardware and stuff, do you have an equivalent, like a blitter or something?
i have 64 sprites with a 2bpp palette
each sprite can use one of the first 16 2bpp palletes in pallete memory (there's a total of 32 shared between the bg and sprites)
it's already playable btw, i just have to add/fix sprite priorities and add sound (since i use an AY-3-8910 sound chip and the NES uses a custom APU [audio processing unit] in the CPU chip [2a03] itself)
that's really cool! are the sprites in layers or is it just whatever you call first rendered below?
because rn mario stands in front of pipes
like you said, sprite priorities
for now there's no layers, but i'll implement sprite layers in the future
it's my own 6502 computer anyway, i can add whatever i want technically
neat, how are you keeping the hud in it's place? do you also have sprite 0 hit or is it just a scanline interrupt
i just use a scanline interrupt