gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

OffTopic > And you think you've got it rough.....

#36510 - gauauu - Wed Feb 23, 2005 3:27 am

So yesterday I was reading a little bit about programming for the atari 2600.

And I thought GBA programming was tricky :)

Anyone care to guess how much ram you have to work with? 128.
Kilobytes, you ask? Nope, 128 BYTES. Ouch.

Then, to top it all off, you have to hold the display unit's hand through EACH scan line. The graphics hardware is only smart enough to know about one scanline at a time, so you have to write a bunch of really fast code to update the registers for EACH line you want to display.

Nasty stuff, really. Time to brush up on my 6502 assembly. I haven't used that since playing with my apple 2c.

#36512 - tepples - Wed Feb 23, 2005 3:45 am

I took one look at the Atari 2600 and said screw it; I'm staying with the NES, which also uses 6502 asm. Like you, I picked up 6502 asm from the Apple II series.

Topicality: Almost any valid NES program is a valid GBA program.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#36514 - Abscissa - Wed Feb 23, 2005 4:35 am

Heheh, yup. Atari 2600 coding is crazy. I've done a tiny bit of 6502 (Apple IIc) machine code, but it was a long time ago.

#36524 - isildur - Wed Feb 23, 2005 3:53 pm

Funny that you mention that, these days I was also studying Atari 2600 programming and couldn't believe it. Still, it is a fun challenge to do something cool with such a limited system. And there is still a big community of 2600 fans. You can still manufacture your own homebrew 2600 cartriges. Some people still buy em...

#36527 - Miked0801 - Wed Feb 23, 2005 6:09 pm

I've (been forced) to look at 6502 myself a few times and while my masculine ego says I'd love to work on such a challenge, my more realistic side says only if someone paid me quite a bit of money for the challenge. 3 registers, limited instructions, haha stack, and (on the 2600) little RAM makes for lots of fun.

#36530 - isildur - Wed Feb 23, 2005 7:04 pm

Hey, why would anybody need more than 3 registers? Don't be a wuss!

:)

#36531 - Dwedit - Wed Feb 23, 2005 7:23 pm

I feel like I've been spoiled, being able to use a powerful Z80 chip instead of having to use a 6502.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#36534 - Abscissa - Wed Feb 23, 2005 9:17 pm

isildur wrote:
Funny that you mention that, these days I was also studying Atari 2600 programming and couldn't believe it. Still, it is a fun challenge to do something cool with such a limited system.

You might want to take a look at the XGameStation. It's designed to help teach hardware design so it's design is rather simple in a very 2600-esque way. ie, no framebuffer, and NTSC/PAL are generated by timing-dependant software. I haven't picked one up myself just yet, but from what I gather it's somewhat like a souped-up 2600, at least in terms of video architecture.

#36537 - isildur - Wed Feb 23, 2005 9:36 pm

Yeah, it looks pretty cool. I first learned game programming by reading Lamothe's books a few years ago. It's a great idea he had with his XGameStation. Like you said, it looks like a 2600 with more horsepower. Do you know if there is an free emulator available so one could look at what this thing is capable of doing?

#36538 - Lupin - Wed Feb 23, 2005 10:32 pm

the problem with the XGS is that no one else will be able to play your game and therefor it really doesn't make any sense to actually start developing for it.

Actually i don't think that GBA programming is any hard, the GBA actually is a very easy to handle device, it has 15 registers! That's really a lot and it's really good for the compiler. I am currently working on Pokemon Mini stuff and i noticed that using 2 8bitx2/16 bit and 2 16 bit registers isn't really easy if you want to do a *bit* more complex stuff. Today i was just writing a little effect for the GBA and i noticed how easy it is to code ASM on GBA where you have so many registers and then i returned to PM and it really got a bit tougher ;)
Everyone who wants to do real tricky development should try to code something for the Pokemon Mini.
_________________
Team Pokeme
My blog and PM ASM tutorials

#36540 - Miked0801 - Wed Feb 23, 2005 11:02 pm

BTW, those 3 registers were 8-bit. To do any addressing, it takes 2 registers to read and the 3rd as dest (for most memory locations)

#36551 - tepples - Thu Feb 24, 2005 3:26 am

Dwedit wrote:
I feel like I've been spoiled, being able to use a powerful Z80 chip instead of having to use a 6502.

The 6502 has three internal registers, named A, X, and Y. On a system with a decent amount of RAM (such as the NES, Apple II, C=64, or Atari computer, but not the VCS), the 6502 can be thought of as having 256 registers stored in RAM bytes 0x0000-0x00FF. This "direct page" or "zero page" acts somewhat like a register file because of the addressing modes that you can use with them. However, if you're trying to make your program coexist with something else, such as a ROM BASIC interpreter or the Atari 2600's I/O, you'll quickly learn how other things can hog the zero page.

And no, it doesn't take all three internal registers to complete a read from an array in memory; it takes only two bytes of ZP plus registers A and Y.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#36556 - MumblyJoe - Thu Feb 24, 2005 5:16 am

Check out http://www.dcemulation.com/. I looked into it all a while ago, and while the Dreamcast itself is fine to work with (kinda), the VMU is... a little less fun. Check it out, especially if you don't know what a VMU is (most people don't).

Click here to quote me :P
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!

#36558 - gauauu - Thu Feb 24, 2005 6:42 am

tepples wrote:

And no, it doesn't take all three internal registers to complete a read from an array in memory; it takes only two bytes of ZP plus registers A and Y.


Thanks for mentioning that. I was so confused by Miked's comment about using all 3 registers for reading, but just assumed he knew what he talking about (since he does for all this GBA stuff).

I spent 15 minutes staring at the addressing modes list of Assembly in One Step trying to figure out which mode you (Mike) were referring to, afraid I had been doing it wrong this whole time.

#36566 - Miked0801 - Thu Feb 24, 2005 7:32 pm

Dumbass alert here - I don't know what the heck I was thinking - of course tepples is correct. I knew about the page0 stuff which is why I said most reads, still I was smoking something there...

#36629 - sgeos - Sat Feb 26, 2005 12:52 pm

gauauu wrote:
Anyone care to guess how much ram you have to work with? 128.
Kilobytes, you ask? Nope, 128 BYTES. Ouch.

Ouch! Are there any nice demos with source you can learn from? Thats not a lot of space to work with.

gauauu wrote:
Then, to top it all off, you have to hold the display unit's hand through EACH scan line. The graphics hardware is only smart enough to know about one scanline at a time, so you have to write a bunch of really fast code to update the registers for EACH line you want to display.

*cringes in horror*

-Brendan

#36632 - tepples - Sat Feb 26, 2005 3:03 pm

The complete source to Combat, one of the early 2600 games, has been reverse-engineered and commented heavily.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#36692 - gauauu - Mon Feb 28, 2005 7:51 am

The commented, dis-assembled code for Adventure is out there also:
http://www.toadstool.net/games/adventure/source.htm

It's really pretty fun to learn how he created that game. I spent way too many hours of my childhood chasing that stupid bat trying to get my sword back.