• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
  • entries
  • comments
  • views

VIC-II high resolution bit mapping mode

Sign in to follow this  
Followers 0


Today I stopped playing with the text mode and entered bit mapping mode ( or, for modern people - bitmap mode ).

VIC-II, C64's graphics chip allows for resolutions of up to 320x200. In text mode that display is divided into 40x25 ( 1000 continuous characters ), each of which is 8x8 pixels big. As I mentioned previously, the characters are stored as 8 bytes, with each bit being either or on off, and making the pixel respectively the color of the character or the color of the background.

This is all fine and dandy in text mode, but how does the high res gfx mode look like? First of all - in high res mode, each 8x8 pixel block can have only 2 colors, much like the text mode. The change is that not the color RAM governs it ( the 0xD800-0xDBE7 ), but the characters in the screen memory ( 0x400-0x7E7 ). How does it work precisely? Each byte consists of lower and higher 4 bits. Low bits are interpreted as the color for background ( off state ), high bits are interpreted as the color for foreground ( on state ). To have first char ( upper left 8x8 pixels ) have black background and white foreground, poke its position ( 1024 or 0x400 ) with 0 ( for black background ) + 16 * 1 ( for white foreground ). Green-blue would be 5 + 16 * 6. Etc. Btw, for color values refer to booklet, wiki page on VIC-II or any other source you can think of.

Ok, that's how the colors are picked. How about the bitmap itself? Well, things are bit complicated here. You designate a bitmap area, and poke it. Bitmap area is 8000 bytes long ( 8 bytes per 8x8 block, 1000 chars ), and it's stored on per-char basis. That means first 8 bytes are first character on the screen, next 8 bytes are the second character, and so forth. Makes for a really confusing plotting when you're trying to do some drawing.

It's not that bad though, and the C64 booklet is quick to help.

I converted yesterday's code to bitmap mode, and here's the result:


It took AGES to render ( minutes, even after turning emulator speed to 2500% of original C64 ). Clearly, it's because I've done it in BASIC and without any optimisations, but at a depth of 16 it looks really nice.

If anybody wants the code, here it is:

sc = 0: pc = 1
for i = 1024 to 2023
poke i,sc+16*pc
poke 53265,peek(53265)or 32
poke 53272,peek(53272)or 8
for i=8192 to 16191
poke i,0
next i
offset = 8192
for x = 0 to 319
for y = 0 to 199
ln= y and 7
by = offset + ro*320+8*ch+ln
bi = 7-( x and 7 )
x0 = ((x/320) * 3.5 - 2.5)
y0 = ((y/200) * 2 - 1)
iter = 0
maxiter = 2
a = 0
b = 0
if a*a + b*b < 4 then goto 27
goto 34
if iter < maxiter then goto 29
goto 34
atemp = a*a-b*b+x0
b = 2*a*b + y0
a = atemp
iter = iter + 1
goto 25
if iter > maxiter then goto 36
poke by,peek(by)or(2^BI)
next y
next x

Just add line numbers as your text editor shows them and you're ready to go. Oh yeah, if you're typing it on VICE, ^ symbol is the upper arrow and it's bound to DEL. And remember, to quit the GFX mode, use ESC-PGUP.

See you next time, when I'll be adding more colors to the high res image!

Also, I have found a website with over 2 GiB worth of old C64 books with awesome titles like 'Artificial Intelligence projects on C64', 'DIY robotics and sensors using C64', 'Make your C64 Sing', 'Start Programming with GORTEK AND THE MICROCHIPS' or 'Will you still love me when I'm 64' :DDDD

The website is here: http://www.bombjack.org/commodore/books.htm

Sign in to follow this  
Followers 0


There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now