Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2011-05-17 09:58:01

stereochris
New member
Registered: 2010-06-24
Posts: 8

Stopwatch ROM, Looking for other programmers

heres a rom I put together: http://www.flatblackindustries.com/stopwatch.gb

its a simple stopwatch i coded in assembly for DMG, compiled with RGBDS

I can provide my source code if anyones interested, would love some feedback on how i did things

looking for other gameboy programmers to make art/demos with >> christopher dot antonellis @ gmail dot com

@Nitro - thanks for the blog, thanks for the forum, thanks for the GB file archive, thanks for answering my questions

Offline

 

#2 2011-05-21 09:37:50

sawakita
New member
Registered: 2011-05-21
Posts: 5

Re: Stopwatch ROM, Looking for other programmers

I gave it a shoot, and it really looks good, so great job. Did you work on every part of it on your own? I'd be mostly curious in the functions you used to arrange the various numbers' tiles since their graphics are really large. So, yes, I think I'd find the source code interesting.

looking for other gameboy programmers to make art/demos with

I'm more into ROM hacking, so I don't know if I would fit; what are your projects and plans, if I may ask?

Offline

 

#3 2011-05-24 10:25:49

stereochris
New member
Registered: 2010-06-24
Posts: 8

Re: Stopwatch ROM, Looking for other programmers

thanks, yes i did everything myself except for the GB hardware definitions, check out the source and tell me what you think. I'll explain whatever you want lol i'm psyched that someones interested. I setup interrupt arrays so i can add and remove interrupt functions depending on what i want to animate, so I can reuse a lot of the code in this project for other projects, ideally i want to build a simple animation library, i have fade in / fade out based on seconds but i really need the opinions of other programmers to make something sound and understandable.

The numbers you're talking about exist sequentially as tile data with fixed length (like 12 tiles each) and when placed on the screen have a fixed number of tiles to skip before drawing each new line of the number (29 tiles) . So i define the top left of each number as a variable, like $3F, and branch with functions from there. Timer Interrupt > Update Seconds > Update Ones Place > Load Digit > Load Digit Row. Then, load three tiles, add 29, load three more tiles, add 29...

http://www.flatblackindustries.com/stopwatch.zip

The fade in / fade out intro is much simpler, all the data is in that one file, ultra_intro.asm. Load tile data into VRAM > Change color palette to white > load / enable timer interrupt > turn screen on > Fade in (load 3 into b, fade will last 3 seconds) > wait (for 3 timer counts) > fade out (3 seconds) > then cleanup and start next program

what do you know about rom hacking? comfortable with ASM? I'm looking for examples of text displaying / compression / decompression in gameboy games. I want to make animated stories on the GB, like really long cutscenes, making use of large sprites and stuff like that... and ideally i want text displayed RPG style (tap A to continue) at the bottom of the screen, but I have no concept of how to make that efficient. any ideas or examples of games would help

beyond that just demos, scrolly stuff, pieces of art to pass around the internet

thanks dude!

Offline

 

#4 2011-05-24 16:21:28

sawakita
New member
Registered: 2011-05-21
Posts: 5

Re: Stopwatch ROM, Looking for other programmers

I gave a quick look at the source, it's pretty neat (even if I found it too much articulated, in terms of number of splitted files). By the way, why did you store graphics as "byte declarations", wasn't it less tedious if you saved them as binary files?
Also, I noticed that you always used "jp" even if a "jr" was usable; you probably didn't have problems of optimizations considering the small size of required space. For bigger projects, since you said you're going to re-use some code, you might consider to optimize some parts of code.

As for me, I think I'm pretty comfortable with ASM. Actually, I'm working on a couple of projects:
- a disassembly (for eventual translation) of an unlocalized japanese game (bitbucket link here), which is on hold at the moment (havent worked on it since ages);
- a ROM hack of Pokemon Blue, called Wood (link to the thread), which is my main work, and will sure take a lot of time to be finished.

About compression, are you looking for documentation or actual code?
About text displaying: I don't think it should be a problem for you implementing it, considering the work you just showed. Anyway, if you will, I can disassemble the code that pokemon blue uses, or write down the main parts (will take some time, though).

Last edited by sawakita (2011-05-25 17:36:10)

Offline

 

#5 2011-05-25 10:28:37

stereochris
New member
Registered: 2010-06-24
Posts: 8

Re: Stopwatch ROM, Looking for other programmers

I used tile designer / map builder by harry mulder to make the graphics, i only recently found a better program that does all the tile optimization for you, but i'm pretty sure both export bytes and binary on save, i just decided to use bytes. yeah I wasnt concerned with optimization yet, but i do realize now I could jump relative in alot of my functions. too articulated? you think i'm making it more complicated than necessary?

I'd like to check out your progress on either of those projects, and if you are interested, I'd definitely like to see the code from pokemon blue. Documentation if available too, but i figured it wasn't.

I appreciate the tip about optimization, thats exactly the type of input i'm looking for.

Offline

 

#6 2011-05-25 17:35:26

sawakita
New member
Registered: 2011-05-21
Posts: 5

Re: Stopwatch ROM, Looking for other programmers

When I said "too articulated" I was in a different mind, it was personal preference, since for my hack I keep all the code in one file (except for the Real Time Clock engine), and split data tables and constants on their own files (this is done because, since many routines aren't labeled, if I happen to disassemble a routine, I will then replace the raw address with the label given, so looking through a single file is faster than having more files). I realize that your project, being a development made from scratch, probably doesn't require this kind of "ploys".

Graphics' compression methods:
- Red/Blue/Yellow compression doc and my incomplete disassembly (a "c" program exists to decompress images from ROM, but no tools exist to compress data, as for now)
- Gold/Silver compression doc and compression tool
- some more compressions
It seems tha R/B/Y's compression is more efficient, but isn't usable unless you find a way to built a compressor (to simplify the method you could remove the meta-code part, if you aren't interested in mirroring on-the-fly, which seems to be one of the best advantages of this compression).
The G/S/C's compression is well documented and supported by more than one tool (I linked you the one I know, but I heard there are others)
If you're looking for something different you could implement a LZ compression (about which I know nearly nothing), which seems to be the most "trendy" (considering it's used very often in GBA and NDS games).

I should have said first that I haven't a good relationship with compressions (in fact I had to implement a "uncompressed-GFX branch" to the compression routine in Pokemon Blue/Wood [btw, I fixed the link in my previous post], to be able to add new monsters' pictures). So I'm probably the last person that should be giving advices about compression.

I'd definitely like to see the code from pokemon blue

What part of code are you referring at, exactly? Or you mean all of it? Because I use a partially disassembled ROM + "INCBINs". You can give a look at IIMarckus' WIP disassembly, on which I based mine (it's of Red, but Blue is almost the same).

About optimization:
another part you could have optimized was this (file is time_digit_functions.asm):

Code:

.nine:
    ld    bc,nine_map
    call    load_digit
    ret
.eight:
    ld    bc,eight_map
    call    load_digit
    ret

;(...)

.zero:
    ld    bc,zero_map
    call    load_digit
    ret

you could put:

Code:

.nine:
    ld    bc,nine_map
    jr .call_load_digit
.eight:
    ld    bc,eight_map
    jr .call_load_digit
.seven:
    ld    bc,seven_map
    jr .call_load_digit

;(...)

.zero:
    ld    bc,zero_map
.call_load_digit:
    jp    load_digit

when you have a "call" followed by a "ret" you should always use "jp" instead, because it uses less space in ROM and doesn't push anything in stack.
At devrs there's a document describing some optimization tips.

About Blue's text displaying routines, if you want them it will take me a while to reverse-engineering them.

Last edited by sawakita (2011-05-25 17:37:13)

Offline

 

#7 2011-05-31 08:46:02

stereochris
New member
Registered: 2010-06-24
Posts: 8

Re: Stopwatch ROM, Looking for other programmers

thanks for the links & the code critique, i appreciate it. I would like to see the pokemon text displaying routines, but if its too much work to disassemble and locate then don't worry about it. I'm going to implement the improvements you pointed out to me soon and improve the stopwatch rom, and include a visual counter for fractions of a second.

Got any other interesting source code I can check out? Thanks!

BTW, I don't know anything about disassembly but if you're still working on your hack of pokemon blue, I'd be available to help you develop graphics. I have a small library of pixel art I've done, let me know if you want to see it / are interested in the help. thanks again

Last edited by stereochris (2011-05-31 08:47:35)

Offline

 

#8 2011-06-09 07:33:14

sawakita
New member
Registered: 2011-05-21
Posts: 5

Re: Stopwatch ROM, Looking for other programmers

hey, sorry for the late reply, I sort of forgot about this forum. Anyway, do you remember the link I gave you about Pokemon Red disassembly? The owner is actually working on reversing the text-engine so you can look at it (or at least, at part of it).

Thank you for the GFX offer, although I already have what I need, except perhaps some new tilesets for the maps.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson