davervw / ch64edit

C64 Character Set Editor
https://techwithdave.davevw.com/2024/04/edit-vic-20-programmable-characters.html
MIT License
2 stars 0 forks source link

Nice to rework address space to move font and video screen to top of memory #7

Closed davervw closed 2 months ago

davervw commented 2 months ago

top of BASIC RAM is $9fff

The way the VIC II works, it can access any bank of 16K of RAM in the 64 (one of four). Usually it uses the first 16K with video at $0400 and characters at $1000 which magically maps to ROM $D000. The custom font at $0800 is visible to the VIC, but the second set at $1000 is not visible, so is copied to $3800 to be visible, and the scanline interrupts switch between $D000/$0800/$3800 for showing all three fonts.

But loading fonts also require copying to $3800 to display. And upper/lowercase switch has issues too.

proposed is to move VIC II RAM up to top of BASIC RAM. also need to update lower memory to include pointer to video memory. video $8c00-$8fff charset1 $9000-$97ff charset2 $9800-$9fff

Could also work better with user's own programs using multiple character sets, and upper/lowercase switch (e.g. CBM+SHIFT)

davervw commented 2 months ago

$9000-$9FFF is off limits to the VIC-II because it is designed to see character roms at address offset $1000 from whatever 16K bank is configured. See article

So better to move character sets to RAM under KERNAL ROM which can always be written to, and can bank to for reading

video $cc00-$cfff charset1 $f000-$f7ff charset2 $f800-$ffff

davervw commented 2 months ago

Maybe as advanced option or add-on program?

Better to keep video at $0400 for consistency, so option 1 in article probably best, move chars to $2000-$2fff and move up start of BASIC RAM even more. Then don't need NMI/IRQ handlers to retain VIC settings. This also adds Shift+Commodore character set switching support. Does take 10K total away from BASIC RAM, 6K can be used for 6502 ML instead.

Option 1 (First 16K) 0400-07FF screen memory (1K) = 1024 0800-1FFF free (6K) 2000-2FFF prog. chars. (4K) = 8192 3000-9FFF BASIC RAM (28K)

davervw commented 2 months ago

MOVED FONTS TO $2000-$2FFF, see prior comment for full map