|
ForumsSega Master System / Mark III / Game GearSG-1000 / SC-3000 / SF-7000 / OMV |
Home - Forums - Games - Scans - Maps - Cheats - Credits Music - Videos - Development - Hacks - Translations - Homebrew |
![]() |
Goto page 1, 2 Next |
Rate this entry!
This poll has expired.
|
||||||||||||||||||||||||||||
Author | Message | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
[Coding competition 2015] Gaudream by DanySnowman, Davidian, Kusfo
![]() Last edited by Maxim on Fri Mar 27, 2015 11:03 pm; edited 1 time in total |
|||||||||||||||||||||||||||
http://www.smspower.org/Homebrew/Gaudream-SMS
|
||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
I really like the music here ~ | ||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
Does anyone else hear a note get stuck after you die? | ||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
I noticed that too. | ||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
Working to solve some problems, as we get over the 48k (when we inserted the obstacles), i've been using banking, but the rom gets stucked. Trying to get it solved today. | ||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
I could suggest you to move all the assets for the intro in a separate bank, since you're going to load them just at game start.
Also, if you need to load compressed tiles, I can try wrapping the PSGaiden asm code in a SMSlib C function. |
||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
i'm using 5 banks now, because the main screen takes almost 23kb, and also the gameover screen.
However now the game is doing starnge thinks, i suppose that's because the code goes past the first 32k.... :-S |
||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
*code* should be under 32KB, as the additional banks will be paged in (in slot 2) by the SMS_mapROMBank(n) macro.
Check if -by mistake- some assets are still allocated into 'code' space. |
||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
I think it "should" be in the first 32kb , cause its only 1.000 lines of code (with plenty of spaces ) | ||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
check the generated .map file for the code area:
Area Addr Size Decimal Bytes (Attributes)
-------------------------------- ---- ---- ------- ----- ------------ _CODE 00000200 000075E8 = 30184. bytes (REL,CON) under that it's the list of globals in the area, you should see there only SMSlib and your own functions. |
||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
It looks ok:
Area Addr Size Decimal Bytes (Attributes) -------------------------------- ---- ---- ------- ----- ------------ _CODE 00000200 000031DD = 12765. bytes (REL,CON) So, maybe the problem relays in that i'm looking for some data that's it's not mapped now ¿? |
||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
Title graphics and music are really good. There's not much of a game yet tho? Bring on the obstacles:) I wish the jump would react on pressing the button instead of releasing them, I often miss a jump because of that. At some point I get used to holding the button earlier in order to release just in case but it adds an extra bit of management and I still miss it sometimes.
We visited Park Güell in Barcelona last year, and couldn't find the Gaudi lizard in time and that kept haunting us. It's back haunting us now! |
||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
That's possible, even if I would expect a different outcome. I mean, if you load some KBs worth of tile data into VRAM and you have not mapped the correct bank I wouldn't expect the program to crash, simply you would find meaningless data in your VRAM...
I would check anyway if you've got a call of SMS_mapROMBank(n)
before each 'group' of load tiles/tilemaps/palettes from additional banks... Also keep in mind that SDCC still has some bugs :| |
||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
Didn't you enter from the door? ;) |
||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
I have the obstacles programed and ready...but now the rom is crashing when the game begins... I'm still trying to see the problem. |
||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
Cool. Let's see that we can update entries this week! But some people may vote early and/or forget to change their vote or hold a grudge on you for late update ;)
(We must have missed the lizard.. what door, maybe there's several of them? We were a bit in a rush and it was boiling outside) |
||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
Yes, there are few ways to get in. I was kidding. Anyway usually people enter from the 'entrance', where the two small houses are. From there, you can't miss the lizard. |
||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
Nice graphics, music and effects you can see the benefit of a team effort here. | ||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
Seems a linkage problem. Try compiling each C file separately and linking .rel files together with a last sdcc call. Remember to place the additional banks at the end sdcc -mz80 --std-sdcc99 --data-loc 0xC000 -Wl-b_BANK2=0x8000 -Wl-b_BANK3=0x8000 -Wl-b_BANK4=0x8000 main.rel someother.rel SMSlib.rel bank2.rel bank3.rel bank4.rel
edit: also check ihx2sms output, if it says the expected size (32KB+16KB per additional bank) |
||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
I've been playing with that for two days...and now all is full of chaotic bugs...
First of all, this is my build.bat (no mistery here) @echo off
echo Build bank2.c from bank2 folder folder2c bank2 bank2 sdcc -c -mz80 --std-sdcc99 --peep-file peep-rules.txt --constseg BANK2 bank2.c echo Build bank3.c from bank3 folder folder2c bank3 bank3 sdcc -c -mz80 --std-sdcc99 --peep-file peep-rules.txt --constseg BANK3 bank3.c echo Build bank4.c from bank4 folder folder2c bank4 bank4 sdcc -c -mz80 --std-sdcc99 --peep-file peep-rules.txt --constseg BANK4 bank4.c echo Build bank5.c from bank5 folder folder2c bank5 bank5 sdcc -c -mz80 --std-sdcc99 --peep-file peep-rules.txt --constseg BANK5 bank5.c echo Build bank6.c from bank6 folder folder2c bank6 bank6 sdcc -c -mz80 --std-sdcc99 --peep-file peep-rules.txt --constseg BANK6 bank6.c echo Build data.c from data folder folder2c data data sdcc -c -mz80 --std-sdcc99 --peep-file peep-rules.txt data.c echo Build Main sdcc -mz80 --std-sdcc99 --peep-file peep-rules.txt --data-loc 0xC000 -Wl-b_BANK2=0x8000 -Wl-b_BANK3=0x8000 -Wl-b_BANK4=0x8000 -Wl-b_BANK5=0x8000 -Wl-b_BANK6=0x8000 main.c .\SMSlib.rel .\PSGlib.rel .\data.rel .\bank2.rel .\bank3.rel .\bank4.rel .\bank5.rel .\bank6.rel ihx2sms main.ihx gaudream.sms The total size of the rom is 112 k (5 banks x 16kb + 32kb). All ok here. So, what's happening now? In a lot of places, the game crashes and makes a reset. At the begining i thought that the gameover flag was set in a wrong place, but commenting all the main loop doesn't solve the problem. So, i started commenting pieces of code.And i found something strange: // that line works flawlesly
if(currentFrame % 16 == 0) playerinfo.verticalVelocity = playerinfo.verticalVelocity + 1; //that line makes the rom crash if(currentFrame % 20 == 0) playerinfo.verticalVelocity = playerinfo.verticalVelocity + 1; Why? when the compiler translates a %16 operation, it becomes a logic AND with the value 15. But modulus 20 gets translated to call __moduint_rrx_s
Then, i found that other places that made the game crash where code get translated to calls to the SDCC libraries. Maybe SDCC internal libraries are stored past the first 32kb? I'm attaching my working directory, that's a bit of a mess now :-S |
||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
16 is a power of two so % 16 can be expressed with and mask but not 20. So what the compiler does is correct.
An actual divide/remainder operation is likely to be really really expensive. You can't do this sort of thing on a Z80 (well, you can but it's not like you can afford wasting lots of cycles :). Instead of doing % 20 you are better off incrementing a counter, testing when it's == 20 and then resetting the counter. |
||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
Yeah, i know, but it's not really important because i use that only one time every 16 frames
Now i've translated all the modulus by logic ANDS, but i still have lots of problems (every time a SDCC call is performed). And that didn't happened before using bank switching. |
||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
It all makes sense: the linker is putting SDCC library functions AFTER the banks. So try compiling main.c the same way you do with data.c, so to generate a main.rel.
Then link main.rel with all the other .rel files on the next sdcc call. I hope this would make things work correctly. |
||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
that's it!
Now i need to repair some thing's i've been doing, but it looks promisizing! |
||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
Wonderful! :)
(this bug haunted my dreams this night. I woke up at 5:05 thinking that I might have a bug in ihx2sms... I'm so happy you fixed that!) |
||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
Well, maybe i talked too soon. Changing the build.bat solved some problems (music returned, the random generator, etc), but it looks like something is still not right (i get some crashes again when pressing butons)
I've put these line at the end of the build, intending only to do the linkage step: echo Build Main
sdcc -c -mz80 --std-sdcc99 --peep-file peep-rules.txt main.c echo Link Everything sdcc -mz80 --std-sdcc99 --peep-file peep-rules.txt --data-loc 0xC000 -Wl-b_BANK2=0x8000 -Wl-b_BANK3=0x8000 -Wl-b_BANK4=0x8000 -Wl-b_BANK5=0x8000 -Wl-b_BANK6=0x8000 .\main.rel .\SMSlib.rel .\PSGlib.rel .\data.rel .\bank2.rel .\bank3.rel .\bank4.rel .\bank5.rel .\bank6.rel ihx2sms main.ihx gaudream.sms Maybe it's not enough to define the data-loc, and including the main.rel? I was looking if there's some command only for the linkage step, but it looks like that line should be enough... |
||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
Wanna know? The bug in ihx2sms I dreamt this night was really there!!!
Please download the updated ihx2sms tool I uploaded one minute ago... |
||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
oh!
I'll try this afternoon! |
||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
Really nice music and good gfx, too. The game itself is a little hard for me. I'm really no good at Flappy Bird style games. | ||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
I really like the sound and graphics here. Nice Flappy Bird twist with the underwater setting, even though I'm pretty sure I'm missing out on some of the context (is this game about a 'real' fish?, what is going on with the zoo discussed above?...). Edit: The Gaudi Lizard??
I second the suggestion about switching from button release to button press when you need to splash upwards. |
||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
News?
I feel a little disappointed for the bugs I left in the devkit code/tools... I probably should have stated that it's very "bleeding edge", I am unsure myself if it'll be ever safe enough to use it :| |
||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
Still, same problems.
I'll try to found if something is not ok. I'm attaching the map file, just in case... And i'm very happy to use the devKit, it's a wonderful step forward in homebrew development for Master System!. |
||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
This map file seems correct, I can't see anything wrong there.
Also, if I take the main.ihx from the zip you posted earlier and I pass it into the *FIXED* ihx2sms I obtain a ROM I can start... |
||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
try with that rom to touch the ceiling or the floor. If there's the dead animation, it's working, otherwise, it crashes and reboots. | ||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
There's the death animation, the gameover screen appears (even if wrong) but no crash (in Meka). Try the same you too. | ||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
I'm not able to have it working, it's specially awful now...
i'm attaching the main.ihx, the ihx2sms and my output rom...Maybe your ihx2sms it's diferent from the one in github? |
||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
where/when do you get that ihx2sms? it's not the one I updated this morning on github... please update that ASAP! | ||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
Just updated the repository this afternoon.....and as i suspected that something was not ok, i downloaded the zip file...
And now it's working!!! :-D (well, i have to restore everything...) Stay tuned. PD: I suspect that my cloned repositories is not ok, it asked me to perform a cleanup.. |
||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
Good! :)
Also, I noticed that there's a lot of free space left in your banks: if you check the map file for sizes you'll see that you can cram your data in less banks quite easily :) |
||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
yeah, it's enough with 3 banks for all data, but as i was trying to solve the strange bugs, i put all data apart in separate banks | ||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
oh, I see... sorry! | ||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
:-)
Once i've everything running smoothly, i'll reunite data to 3 banks ! |
||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
New version! After Banking Nightmare, now we've obstacles in the game!!
Enjoy! |
||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
Is it the one now called version 1.0 ? what's version 0.0 ? | ||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
0.0 is the (renamed) original release. | ||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
The header says 0.01 for the latest one. | ||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
Whoops. I was reading the header in a hex editor... It's renamed again. | ||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
I finally tried the game on hardware yesterday. It's quite hard so I don't know if there's a second level or if it goes on forever (like the game that inspired this...). Anyway there are minor graphical glitches on transitions, expecially when going from game to gameover screen. I think you should just wait next vblank, turn off screen, load new tiles/tilemap/palette and turn on screen again (or if fast enough you might even keep the screen on) | ||||||||||||||||||||||||||||
![]() ![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
Now it's only an infinite level, but we plan to put varios levels, moving obstacles, etc. For now, i'll center in making it more playable, because now it's hard as hell :-p
For the transitions, i'll try to use more palette fades |
||||||||||||||||||||||||||||
![]() ![]() |
||||||||||||||||||||||||||||
|
![]() |
|||||||||||||||||||||||||||
Wonderful! Thanks! :) | ||||||||||||||||||||||||||||
![]() ![]() ![]() |
![]() |
Goto page 1, 2 Next |