reading between the scanlines: c64 programmer’s reference

Character Set Accessibility Varies by VIC-II Bank

On page 124, the footnote states:

“The Commodore 64 character set is not available to the VIC-II chip in BANKS 1 and 3.”


Many programmers may know about video bank switching, but may not realize that if you switch to certain banks (specifically banks 1 or 3), the character generator ROM is not accessible to the VIC-II for screen rendering. This affects custom character graphics and can cause “garbage” characters if not properly managed.

Here’s some example Kick Assembler code that will simple switch to bank 1 and then set the charset memory pointers. Result is garbage written to your screen.

BasicUpstart2(start)

start:
   lda #%00000010 // Set VIC bank to BANK 1 (bit 1 = 1)
   sta $DD00 // CIA2 port A

   lda #$10 // Screen at $4000 (bits 4–7 = $10 << 6 = $4000)
   sta $D018 // Set VIC-II memory pointers (screen/charset)

   rts

ffmpeg recipes for tall ansi art

Output your ansi art to a png using your favorite tool like ansilove or an ansi art editor.

Convert PNG to 1080 width

ffmpeg -i input.png -vf "scale=1080:-1" output.png

Make instragram friendly MP4 from PNG (w/scrolling)

ffmpeg -loop 1 -i input.png -vf "fade=t=in:st=0:d=3,fade=t=out:st=15:d=3,scroll=vertical=0.001,s cale=-1:1920, crop=iw:1080:0:0,format=yuv420p" -t 20 output.mp4

Pause video at the beginning Create intro

ffmpeg -loop 1 -i judgedredd1080.png -vf "crop=iw:1920:0:0,format=yuv420p" -t 4 judgedredd-intro -1080x1920.mp4

telehack telebasic float to int cast rounding observations

I noticed there are two float to int casts in Telehack’s Telebasic. I was curious about the differences under the hood.

Instead of asking the great oracle search engines, I decided to do some simple blackbox testing CINT() and NINT() to gather observations

10 ? "NINT()":? "nint(3.4)=";:? nint(3.4):? "nint(3.5)=";:? nint(3.5):? "nint(3.6)=";:? nint(3.6)

20 ? "CINT()":? "cint(3.4)=";:? cint(3.4):? "cint(3.5)=";:? cint(3.5):? "cint(3.6)=";:? cint(3.6)

Results

NINT() - rounds down nint(3.4)= 3 nint(3.5)= 3 nint(3.6)= 4

CINT() - rounds up cint(3.4)= 3 cint(3.5)= 4 cint(3.6)= 4

NINT is Nearest INTeger CINT is Convert to INTeger