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.
So, whilst looking around the debugging menu inside bgb, I spotted a suspiciously m=named function that isn't available to me within C, called sgb_transfer
Despite attempting to modify some of the compiler functions to allow me to include it as an accessible function on it's own to fail, I think I've got somewhere by doing a quick and dirty copy paste of the ASM code into differently named functions, which, handily, can be exposed to C and GBDK via ASM includes.
It seems that the function expects a memory address with a following 128 bytes worth of data, which is great, assuming it works of course. Will update later this week with any news on it.
Also, I've upped my games UI a fair bit as mentioned in my video and prepared some graphics for the ending of each race. Fingers crossed this works!
Offline
A few more tracks added and some sfx for button sounds, etc, etc. The SGB stuff is still stumping me though,any tips from anyone would be great. Looing to use this as a function inside GBDK called sgb_transfer_me_do with a reference to a point in memory to be called as such:
sgb_transfer_me_do(&startingpoint);
I'm hacking away at the ASM below whcih I've mostly lifted and renamed functions to but I'm not sure how to get the right starting point into memory. that and my ASM skills still need a LOT of work.
Any help would be greatly appreciated.
.globl _sgb_transfer_me_do _sgb_transfer_me_do: ; Added by Ryan LDA HL,2(SP) ; Top of command data ? Is this the first byte in the AND #0x03 RET Z LD B,A ; Number of translated packet LD C,#0x00 ; Lower part of #FF00 1$: PUSH BC XOR A ; Start to write LDH (C),A LD A,#0x30 LDH (C),A LD B,#0x10 ; Set counter to transfer 16 byte 2$: LD E,#0x08 ; Set counter to transfer 8 bit LD A,(HL+) LD D,A 3$: BIT 0,D LD A,#0x10 ; P14 = high, P15 = low (output "1") JR NZ,4$ LD A,#0x20 ; P14 = low, P15 = high (output "0") 4$: LDH (C),A LD A,#0x30 ; P14 = high, P15 = high LDH (C),A RR D ; Shift 1 bit to right DEC E JR NZ,3$ DEC B JR NZ,2$ LD A,#0x20 ; 129th bit "0" output LDH (C),A LD A,#0x30 LDH (C),A POP BC DEC B RET Z CALL .waitfour ; Software wait for about 4 frames JR 1$ .waitfour: LD DE,#7000 .1$: NOP ; 1 + NOP ; 1 + NOP ; 1 + DEC DE ; 2 + LD A,D ; 1 + OR E ; 1 + JR NZ,.1$ ; 3 = 10 cycles RET
Offline
Hi richan. I think you should take a look at this...
Coll Stuff...
Last edited by Ryoga (2016-04-25 15:07:16)
Offline
Formula Racing Now has just over half it's number of courses designed now. Boost pads, wind tiles, spikes and oil slicks all there to change the players race. I'm considering adding a small random element to each track just to keep each laps slightly different to the last one.
Offline
So, I demo'd formula racing on friday on the super gameboy and found out that I'm using a leetle too much CPU to sustain a solid 60fps on the classic gameboy, using wait_vbl_done(). Whilst there's not too many optimisations I can make to reduce it's usage down, would it be hardware okay in this case to remove the wait_vbl_done() to increase the framerate from 30fps to closer to 60?
There are some instances where I'm down to 75-80% CPU usage but those are tracable.
Also, 270 bytes left!
Offline
More bugs fixed over the weekend, working on getting the pasword system working for the Grand Prix Mode this week. It's sooo close to getting there!
Offline
I'm super excited for this. Just so you know
(and also. passwords, heck yeah!)
Offline
12 / 18 tracks completed and some more elements, including random tiles thrown in for good measure! (They'll either be a speed boost / oil or blank depending on DIV_REG)
Purchased a gameboy pocket for more testing and have got the game back down to ~60fps. It runs a lot faster than it was on the Super Gameboy, sooo, that's a good sign.
The new tiles are making the level designs a lot more interesting than the earlier ones, I'll go back through them at some point.
Also added some GUI fixes for the grand prix mode password screen.
Getting there! I'm suspecting I'll have to go for a 256kb ROM instead of my orginial 128kb target. No reason why I'd chosen 128kb, just felt like a good number But extra scenes for race over, grand prix endings need to be in there and I'm going to be tight on kb allowing for music also in any case!
Offline
Really impressed with your progress on this, reminds me of when I first started GameBoy coding.
The learning process as you add more bits to your game, adding colour, memory bank switching, sound, etc.
Keep up the good work.
Offline
Hey, thanks Quangdx! It's been lots of fun so far, and it's getting closer to completion, just a few more circuits, race ending and game completion / credits screens and a soundtrack from Nordloef and it'll be what I would consider to be a complete gameboy / gameboy colour game.
I'll save the SGB stuff for another game later on though!
Offline
Soo, I was unhappy with the A.I. this morning, it was just, a bit too samey...Soo, I've mixed things up a bit and not only has this made the A.I. a lot tougher, but I've reduced the bank space being used and reduced CPU usage, yay! But...Now I finish 7th where I used to finish much better...gahhh!
Offline
What are you using to create/play music in GBDK?
Offline
There's only sfx in there so far, but it's only setting the registers on channels 1,2 and 4 to certain values programatically. So, for an example, the engine noises frequency and loudness is based on speed of the vehicle, with the cpu car's loudness being determined on the vertical distance between the two cars.
Works really well and has the bonus of being low cost in both size and cpu work.
Offline
I would like to be able to play this someday.
Offline
Big ol' post detailling more progress on my website here if anyone want's a looksy
https://refreshgames.co.uk/2016/06/22/n … ent-stuff/
Offline
Apologies for the long delay, still working on this in the background between game jams and a few other bits 'n' bos going on at home This project will not die!
Offline
and then from out of nowhere gbdk has died on me... getting creation of temp file failed on all my builds, including previous working ones.....oh god. what has gone on here....
[edit]
Aha! Found what it was, 10,000 sdccxxx files in my %TEMP% directory.
Removed them all and tried compiling... thanks flip, that worked!
Last edited by rychan (2016-07-16 17:16:18)
Offline
Hey there, you're using GBDK which is based around an ancient 15+ year old version of the gbz80 compiler/linker/assembler. As I can see you've already run into issues due to bugs and you may want to check out GBDK-N, an updated version of the GBDK to work with the latest SDCC compiler suite.
https://github.com/rotmoset/gbdk-n
Offline
Wait what? I did not know about the "GBDK-N" version of Gameboy Development Kit.
Offline
Still coding and designing away. Although not on this game recently. But still, I've learnt some new bits 'n' bobs along the way, including making some handy scripts to get that 4bit DAC on sound channel 3 active and playing some sampled sound, some more code optimisation stuff and I'm currently trying to figure out how to do the whole sampled sound thing whilst gameplay is continuing.
The main thing for me is the learning about how channel 3 works, disabling the cahnnel, changing the DAC bits to certain waveforms, re-enabling it then looping. It almost sounds intelligible! Also I can now use it as a redimentary triangle / sine / another square wave channel for background music needs!
I'm going to succumb to the needs of a 9th bank however, which is kinda a shame as I was hoping to cram 18 race tracks of data into there, along with ending and game-ending screens. Sadly that doesn't look possible though, unless I remove some of the tracks, which I'm not overly keen on doing.
Still searching for a place to burn the finished cartridges onto for a reasonable price, but going over 32kb just cuts so many routes off.
Offline
Just a quick post to say that yes, still alive. Currently tackling my first game on the NES in NESASM. Will be coming back to this game afterwards. Also have a lil tool that converts stuff from Deflemask to GBDK usable music in the pipeline. Should be good to use with Formula Racing I Reckon
Offline