Jump to content

  • Log In with Google      Sign In   
  • Create Account






Resuming development

Posted by ManTis, in C64 05 March 2012 · 432 views

C64
I have finally returned to developing my C64 skills. I've set up a computer dedicated to that purpose, and now am able to play around with it. Currently following C64 programmer's reference guide 3 - programming graphics. I'm at the beginning, which is setting up charset. Unfortunately, the booklet with which I'm working is so old, I can barely read through some parts - the source scan mostly. Which means I have to write most of the code I'm copying couple times, so that funky things stop appearing.

Current part of the code should copy bit-by-bit charset from ROM into RAM, and make screen display chars from that. Effectively, nothing should happen visually ( it should use same charset as that in ROM ), but it seems I'm one off somewhere, which result in funky caesar-ciphred ( with offset 1 ) screen display Posted Image :

Posted Image

The only question I have to anyone out there is:

poke 52,48 : poke 56,48 : clr

reserves memory for my charset. What exactly is happening here? According to http://sta.c64.org/cbm64mem.html it sets pointer to beginning of string variable area and pointer to end of BASIC area to 48. Why would that reserve memory? How much memory is reserved? I don't like doing something 'because it works'. I'd prefer to know why ;).

Well, back to coding. See you soon!

##################################################

Update: thanks to Ben, it's clear now:

17:13 <@benryves> mantis: I'm no expert, but if the string table is the last thing in BASIC memory then moving it down would allow you to use the space between the old value and the new value as scratch RAM without worrying about the BASIC interpreter overwriting it. BBC BASIC makes things slightly clearer by calling that variable HIMEM and letting you refer to it directly (so HIMEM=HIMEM-100 reserves 100 bytes).
17:23 <@benryves> mantis: The 6502 is little-endian. If we assume that the string variable area is the same as the "end of BASIC" (&A000) then that becomes &3000. Which seems odd (reserving 12KB?) :|

The 0x3000 is where I'm storing the charset in RAM. And now it all makes sense.




PARTNERS