• 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.
Sign in to follow this  
Followers 0
  • entries
    2
  • comments
    2
  • views
    2513

Video memory on the pi

Sign in to follow this  
Followers 0
Segmented

835 views

I suppose a quick intro is in order, seeing as this is my first post. The purpose of this blog shall be to log the development of a game I am making for my three younger sisters for Christmas. There is quite an age gap between me and my sisters, the eldest is 10, and the youngest is 6, to give an idea of my target audience. I'm hoping to make it a coop game so that none of them will be left out, but this is difficult from a design standpoint considering the range in their coordination.

I'm making it on the raspberry pi, which for those of you who don't know is a credit card sized onboard computer. Why? For one thing, it allows a direct connection to your TV. For another, I've been wanting an excuse to play with the one on my shelf smile.png. You can boot linux on these little guys, but I decided to go the route of pain instead and code the game as an OS using raw ARM assembly (I'm crazy, yes I know).

Things have been going surprisingly well so far, considering. I've meddled with x86 assembly before, but this is the first time trying out ARM assembly, so its a bit of a change-up in CPU architecture, it being RISC and all. I was fortunate enough to find this tutorial, which helped a lot.

Heres what I've come up with so far:
.set MB_BASE, 0x2000B880 .set MB_STATUS, 0x18 .set MB_WRITE, 0x20 .arm mov sp, #0x8000 ldr r0, =MB_BASE mov r1, #0x80000000@@ Wait for the go-ahead to ask for the framebufferloop$: ldr r3, [r0,#MB_STATUS] tst r3, r1 bne loop$@@ Store a request for info about the framebuffer mov r4, #0x40000000 ldr r5, =framebufinfo add r1, r5, r4 add r1, #1 str r1, [r0,#MB_WRITE]@@ Wait for a response about the framebufferloop2$: ldr r3, [r0,#MB_STATUS] tst r3, r4 bne loop2$@@ Check that the response is valid mov r1, #15 ldr r3, [r0] cmp r3, #1 bne loop2$ ldr r7, [r5,#32]@@ Wait until vertical retrace. This is when we do all our drawing, since it@@ will appear on the next draw, and there will be no flicker. Note this is@@ based off a snippet I found on the internet, as documentation on the subject@@ proved to be practically non-existant.render$: ldr r0, =0x2000B214 mov r1, #0x00010000 str r1, [r0] ldr r0, =0x20600000 mov r1, #0 str r1, [r0] ldr r0, =0x2000B208wait_vsync$: ldr r1, [r0] tst r1, #0x00010000 beq wait_vsync$@@ Now lets draw something!!! mov r0, r7 @@ dest ldr r1, =spritesheet @@ src mov r2, #0x00f0 @@ drofs mov r3, #0x0000 @@ srofs mov r4, #0x0010 @@ rowsiz mov r5, #0x0010 @@ nrows bl blit b render$@@ Blit a spritesheet@ r0: dest@ r1: src@ r2: drofs@ r3: srofs@ r4: rowsiz@ r5: nrowsblit: push {r6-r8} add r6, r3, r4 mul r6, r5 add r6, r1outer$: add r7, r1, r4inner$: ldrb r8, [r1] strb r8, [r0] add r1, #1 add r0, #1 cmp r1, r7 blt inner$ add r0, r2 add r1, r3 cmp r1, r6 blt outer$ pop {r6-r8} mov pc, lr .poolspritesheet: .byte 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2 .byte 2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1 .byte 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2 .byte 2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1 .byte 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2 .byte 2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1 .byte 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2 .byte 2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1 .byte 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2 .byte 2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1 .byte 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2 .byte 2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1 .byte 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2 .byte 2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1 .byte 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2 .byte 2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1 .align 12framebufinfo: .int 640 .int 480 .int 256 .int 240 .int 0 .int 8 .int 0 .int 0 .int 0 .int 0I couldn't get FASMARM to work under OSX, so for now I'm stuck using gas to assemble, which isn't that different except for its inability to directly produce a raw image file (you have to use ld and objcopy).

I'd put a screenshot here of the result (as unexciting as it currently is) but I don't want to resort to taking a photo of my TV, so if anyone knows of a way to emulate the pi I would really love to know (for more than just screenshots actually).

Thats all for now, more to come smile.png Thanks for stopping by!

0
Sign in to follow this  
Followers 0


1 Comment


Yes, you're crazy. As someone who can't code in low-level languages, I'm curious to see how you go! :)

 

Good luck!

 

Ben

0

Share this comment


Link to comment

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