![]() |
|
[RetroHack] Start of competition |
HardTranceFan
Member #7,317
June 2006
![]() |
n/m - I think I'm a bit slow when it comes to understanding the colour schemes... -- |
Thomas Harte
Member #33
April 2000
![]() |
Big long, rambling post... Quote: Wasn't aware of that, sorry. I've never seen a BBC Micro in real life, and I'm not even sure they were ever available here (Poland being part of the socialist block back then). Anyway, I just want to get the most kick out of participating and trying new things - hence doing my own tracker is just something to boost my own satisfaction . Makes sense. And I was aware that the PSG file format is quite bloated and hard to create data for when I was implementing it. An earlier version of the library also had a RetroHack-specific file format implemented which tried to reach something a lot like a tracker format from compression of a PSG, but I couldn't really justify the time it was taking to get right. And it wouldn't have fixed the latter problem anyway. Quote: Thomas, any chance of modifying the library to play .ay files? It seems I may need to implement a fully functional Z80 emulator to fully support AY files, at least based on the docs I eventually found bundled with a program called AYMakeR. Well, strictly speaking I think I'd need a Z80 emulator and a 68000 emulator, but I'm assured that most PC players don't support the 68000 code so I think I can ignore that. Luckily I have a full Z80 emulator to hand but it's both very multithreaded (as an easy way to implement coroutines — I care about the accuracy of my emulators) and about 45 kB in size. Which is quite a lot out of 512 kB. Nevertheless I'll see what I can do. Responding to a request not on this thread, I also want to put some sort of graphics conversion tool together... Quote: Just starting here.. and I'm wondering about colors, each sprite can use one 16-color palette out of the following 48 palettes - did I interpret that right? The main difference I can see between yours and the ones I've just got the RetroHack simulator to spit out (subject to an observation below, source code attached) is in the RT_MIX set. Did you notice that the low two bits of the colour info in the sprite get separated, one becoming the high bit on the Cb channel and the other becoming the high bit on the Cr channel? This has actually uncovered another bug in version 1.0 of the library — it doesn't cram RT_MIX in correctly. An attached example program should display all the colour combos. At the minute, with the bug, it shows (please ignore my haphazard cropping): http://www.allegro.cc/files/attachment/593580 When fixed it should show: If you want to apply the fix yourself in the run up to version 1.1 then go into retrohack.c, find the two instances of "RT_MIX" (should be at or around lines 321 and 338) and change the lines beneath so that they're masking the first two things by 0xc instead of 0xb, i.e. putpixel(newgraphic->images[c], x, y, (((Colour & 0xc) << 4) | ((c&0xc) << 2) | ((Colour & 0x2) << 2) | ((c&0x2) << 1) | ((Colour & 0x1) << 1) | (c&0x1))^COLOUR_MASK); and newgraphic->MaskCols[c] = (((maskcol & 0xc) << 4) | ((c&0xc) << 2) | ((maskcol&0x2) << 2) | ((c&0x2) << 1) | ((maskcol&0x1) << 1) | (c&0x1))^COLOUR_MASK; Respectively. Quote: Jakub! Also You could release your tracker for other person using... like me Just to reiterate for any third parties dropping into the conversation: this is explicitly allowed. [My site] [Tetrominoes] |
Richard Phipps
Member #1,632
November 2001
![]() |
Has anyone got any progress to show yet? |
X-G
Member #856
December 2000
![]() |
Just this: http://www.allegro.cc/files/attachment/593582 I have to be honest, the thing that's most difficult to work around right now is the colors available. Not the bit depth... 16 colors is enough to make some real dandy sprites. No, the problem is the overabundance of green tones, the lack of any deep dark tones, and the fact that you can't mix-and-match colors the way you want. It means you end up wasting 60-80% of all the colors in each palette, which is annoying. The luma gamut is wider than it needs to be, and the chroma gamuts are too small. It makes you have to do some funky things, but that's all right. It's what this is about, working under constraints. Just mentioning what's giving me the most trouble right now. EDIT: Improved him a little. http://www.allegro.cc/files/attachment/593584 -- |
Elias
Member #358
May 2000
|
Quote: The main difference I can see between yours and the ones I've just got the RetroHack simulator to spit out (subject to an observation below, source code attached) is in the RT_MIX set. Did you notice that the low two bits of the colour info in the sprite get separated, one becoming the high bit on the Cb channel and the other becoming the high bit on the Cr channel? Thanks, indeed. (I updated the picture in my previous post to not confuse anyone.) -- |
Thomas Harte
Member #33
April 2000
![]() |
Right. A new test version 1.1 of the RetroHack library is attached. It hopefully addresses the issues found with:
Please test! I'll rebuild the sample programs for OS X and Windows, and be back promptly. EDIT: Never mind! I've finally managed to recreate HardTranceFan's sound issues under Windows on my own machine. Hopefully I can get completely to the bottom of this now. [My site] [Tetrominoes] |
Elias
Member #358
May 2000
|
The demo still works here in linux You might want to fix the following warnings for gcc -W -Wall to work: gcc -o retrohack.o -c -W -Wall -Wno-unused-parameter -I/usr/local/include retrohack.c retrohack.c: In function '__ay_Init': retrohack.c:792: warning: suggest parentheses around assignment used as truth value retrohack.c: In function '__ay_Update': retrohack.c:1099: warning: suggest parentheses around assignment used as truth value retrohack.c:1120: warning: comparison between signed and unsigned retrohack.c:1120: warning: comparison between signed and unsigned retrohack.c:1128: warning: comparison between signed and unsigned
[edit:] Oh, and I'm making a sequel to my last retrohack entry - "Tom the Tomato 2". This is the current placeholder for Tom, but I also got an artist now so it should improve a lot yet. http://www.allegro.cc/files/attachment/593586 -- |
HardTranceFan
Member #7,317
June 2006
![]() |
I now don't even have a blank screen anymore - my PC crashed on boot up this morning! -- |
Thomas Harte
Member #33
April 2000
![]() |
Right, I think I cracked the sound problems. Under Windows, Allegro seems to have an interesting 'feature' whereby get_audio_stream_buffer() won't return anything for quite a while, then will suddenly have four or five buffers ready to fill at once. That removes any way to know anything useful about where Allegro is in playing your audiostream (and is strictly contrary to the documented behaviour of the function, but I'll post in the right place to complain about that), which is what was confusing my code. I've rejigged it to deal with that, though it has the disadvantage that if your setup is one of those affected then sound latency can be quite bad. At the minute I can't think of a way to avoid that with Allegro, so commiserations to affected people. Fingers crossed this misbehaviour is related to the Allegro/sound driver combination and not to the Allegro/Windows combination. OS X, Linux and any other platform where Allegro works as described in the manual should be unaffected and continue to work well. Anyway, new test version of the library is here. Also: Windows test programs, OS X test programs. [My site] [Tetrominoes] |
HardTranceFan
Member #7,317
June 2006
![]() |
Quote: Responding to a request not on this thread, I also want to put some sort of graphics conversion tool together... Oh, yes please! Trying to get my head around the colour schemes is driving me nuts. I completely forgot about the colour formats until Elias pointed out the total of 48x16 colour palettes. I'm used to true colour and the Amstrad colour schemes, and I'm finding this is taking a little bit of thought. -- |
X-G
Member #856
December 2000
![]() |
This is a Python script I whipped out that converts a 16-bit paletted image into a format suitable for uploading to retrohack video memory, plus hints for what mode and nibble to use as well as frame size information. As you can see it's pretty hardcoded right now, but it reads a file called gfxconv.yaml in the same directory which looks like this: - infile: friedrich.bmp mode: MIX palette: 1 framesize: [26, 26] - infile: friedrich_b.bmp mode: CbCr palette: 0 framesize: [26, 26] It needs pyYAML and PIL, obviously. Do let me know if you find it useful. -- |
Thomas Harte
Member #33
April 2000
![]() |
Further to this general topic, a new RetroHack example program is attached (and will shortly appear on the website). It loads 8bpp PCX files (and exactly that format only), maps them onto the best fitting RetroHack palette (without dithering), uploads them to graphics memory and returns a colour parameter for you to pass to Blit or MaskedBlit. The one useful function is: void *rtSup_LoadPCX(char *Name, int *OtherNibble, int Masked) Where: Included in the demo is a luigi.pcx I just downloaded, and it should display this: Hope this helps! EDIT: note that it assumes the RT_MIX palettes are working correctly, as in the v1.1 test releases of the library above, not as in the bugged v1.0. So I recommend you test against that. Especially as I'd also like to know if 1.1 is suitable for proper release. [My site] [Tetrominoes] |
Elias
Member #358
May 2000
|
I found the AY data sheet PDF rather scary, but some googling turned up a page with this table, which has 100% of the same relevant info as the whole PDF (scroll down to Yamahatm YM-2149): So, basically, 14 registers, where I can set frequencies and volume, plus noise channel and envelope -- |
Thomas Harte
Member #33
April 2000
![]() |
Quote: So, basically, 14 registers, where I can set frequencies and volume, plus noise channel and envelope Yep, that sounds about right. And the only other potentially interesting thing is that per channel mixing is done with an active low bitwise OR. Which explains how you can get a level wave, as per the sample demo. [My site] [Tetrominoes] |
Paul Pridham
Member #250
April 2000
![]() |
Thomas, what's the license for this code, anyway? There's some neat stuff in there. ---- |
Thomas Harte
Member #33
April 2000
![]() |
Quote: Thomas, what's the license for this code, anyway? There's some neat stuff in there. It's not really that neat, but since there is the potential for other people to create games that are dependent on my code, I guess a license that is as permissive as possible is desirable. I guess I'll adopt the zlib license unless anybody wants anything more flexible? [My site] [Tetrominoes] |
Paul Pridham
Member #250
April 2000
![]() |
Looks good to me! ---- |
Jakub Wasilewski
Member #3,653
June 2003
![]() |
Having a job sucks. Especially if you want to participate in a competition, but instead, all your computer time at home goes into earning money... However, I finally managed to save up some time to actually put in a few hours into Retrohack, and I'm pretty happy with the (preliminary) results. The tracker is coming together nicely and I expect to have it somewhat finished by Saturday. I will probably release the source code and all revelant files once I have a "finished product". For now, I have a demo I would like you to test - it is a Windows binary with an example one-pattern module (with samples and the track itself ripped from Amiga's Lotus 2 and ported to my own text format). I'd like you to give it a few spins and let me know if there are any problems with the playback on your machine. Don't expect wonders though, the quality will be rather crap Thomas: Another thing regarding 1.1 - there is a problem with the retrohack.h header under C++. The Allegro header is wrapped in 'extern "C"', which makes the compiler misunderstand the definition of the fix class and throw an awful lot of errors. Moving #include <allegro.h> outside the 'extern "C"' helps. Oh, and the thread became awfully silent lately... Come on people, tell us about your progress! --------------------------- |
HardTranceFan
Member #7,317
June 2006
![]() |
Nothing from this corner as yet. Time has been rather sparse in it's availability. However, next week looks more promising for a few decent hours of coding. -- |
Jeff Bernard
Member #6,698
December 2005
![]() |
So, I started playing some NES games as research for my RetroHack entry because I want my entry to be kinda like an NES game. In other words, they game would be really fun despite not having breathtaking graphics or sounds. I've kinda gotten a bit carried away in the sense that I haven't programmed for about a week and I've beaten quite a few NES games and continue to play more. -- |
Jakub Wasilewski
Member #3,653
June 2003
![]() |
Quote: I'd like you to give it a few spins and let me know if there are any problems with the playback on your machine. So, did anyone try it? --------------------------- |
Elias
Member #358
May 2000
|
Quote: Oh, and the thread became awfully silent lately... Come on people, tell us about your progress!
We are making good progress here. Right now, we are using about 20K out of 64K of video ram - but if Paul keeps drawing sprite frames at the rate has has done until now, it will get a problem Oh, and I'm looking forward to your tracker. I wrote a crude ASCII format so you can define instrument envelopes and define tracks by writing the notes (like "C D E F F#") - but a proper tracker certainly would be preferable. -- |
Jeff Bernard
Member #6,698
December 2005
![]() |
Quote: So, did anyone try it? Nope. I've been too busy abandoning everything in my life to play as many NES games as I can.;D -- |
Paul Pridham
Member #250
April 2000
![]() |
Sorry, haven't tried it either. Too busy... we have a game to make. Oh yea people, it's on! ---- |
HardTranceFan
Member #7,317
June 2006
![]() |
@Jakub: I ran it, but it crashed part way through the tune (about 6 seconds into the piece). But the bit before the crash sounded really good -- |
|
|