Hacker News new | past | comments | ask | show | jobs | submit login

Lest people get the impression the C64 does not have 64K of RAM, I am here to assert that it does in fact have a full 64K of RAM.



Technically yes, but the system mapped the ROM into the RAM and so only 38,911 bytes were available to the user. There were various tricks game makers used to get at the mapped, normally off-limits RAM however.


Nothing tricky about it, just flip some bits at address $01. No sense keeping BASIC or the kernal around if you're not using it.

LDA $01

AND #$F8

STA $01


Thank you for that. I never actually learned how to do this as my own games, written as a kid, were way too small.


These days it is so much easier to have access to all kinds of technical information on the C64. I remember travelling half a day to the single bookshop that sold assembler books. Learning anything beyond those books was mostly a matter of figuring out other people's code (e.g. the 'sprites in the border' hack).


Pretty normal tricks for game makers. Someone writing this back in the day probably would have been able to easily use them, if they needed to. Not that this is exactly a game with a ton of art assets.

Hardcore was keeping data in the RAM normally hidden under the audio and video chips' address registers. Or the screen character color attribute RAM.


I think it is possible to get exactly 64Kb - 2 byte. The first two byte should not be written randomly as they tell the system whether it should include the ROM or not. If you use interrupts then the top few bytes (2 or 4 bytes, can't remember) are also occupied by a jump addresses.


Top 6, $FFFA-$FFFB and $FFFE-$FFFF were NMI and IRQ. $FFFC-$FFFD are the 'cold start' address that's run on reset, although as you point out, if you're not using them, they are free RAM.


I think that person meant the game code was actually using 38K of RAM out of the 64K. I'm assuming the system itself may be using some of the total memory?


The system itself is using a few bytes here and there if you let it. Only a couple bytes are totally off limits if you bank switch out the ROMs and turn off interrupts.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: