Day 11: 354 days left..
Potato tip:
To enable local labels in Pasmo, you use the command line option --alocal, in the code you start your local labels with the _ character. mmmm nice. This will help with readability.
Well there seems to be some light at the end of the tunnel (hopefully its not an oncoming vehicle
...)
Once I had the whole 'how does input work in Pasmo, passing values incident reasonably sorted, it opened the door to actually laying out the project in a more manageable manner. (so each file handles one part of the project..)
Besides being more tidy, it helped with testing new routines to see what was faster/slower (without having to go in with a calculator and start totting up t-states)
Also with the ability to use modular code within the project cut down significantly on the errors and enables project wide updates from one location. All good stuff.
The first thing I did was set up the menu system - well a bare bones version that I can build up. At the moment it just cycles through the different screens, each time a key is pressed you get a sound effect before being whisked to the next screen.
Simple stuff but at least it works. Nice thing about this is I can use it again for other projects.
Next is to add the Prak routine into the project, and finish the start screen/attract mode for the game. (the random value will position a graphic on the screen while the computer waits for input from the user.) Need to figure out how to play a ay ditty during this phase also but the Chuntey blogs I think have the answer to that.
In addition to that been looking at the excellent utilities for generating sound on the spectrum. While the games often get a lot of love for the spectrum the utilities are often cracking also. Had a look at soundFX and that was easy to use with the exception that I must have fluffed up the disassembly of the code somehow (see the programming section for that tale of woe.) But for a simple program its great. I think it will be useful once I get the hang of disassembling the code.
update: Thanks to r-tape for the fix. This little utility will help me build a library of zaps and farts for the game
Here is the code adapted from SoundFX so I can use it as a library...
b appears to regulate the length of the sound pulse.
Code: Select all
org 50000
wiggy:
ld d,100
ld e,50
ld b,60
call soundFXGen
ld d,90
ld e,50
ld b,60
call soundFXGen
ld d,80
ld e,50
ld b,60
call soundFXGen
ld d,70
ld e,50
ld b,60
call soundFXGen
ld d,60
ld e,50
ld b,60
call soundFXGen
ld d,50
ld e,50
ld b,60
call soundFXGen
ld d,40
ld e,50
ld b,60
call soundFXGen
ld d,30
ld e,50
ld b,60
call soundFXGen
ld d,20
ld e,50
ld b,60
call soundFXGen
ld d,10
ld e,50
ld b,60
call soundFXGen
ld d,1
ld e,50
ld b,60
call soundFXGen
ld d,255
ld e,50
ld b,60
call soundFXGen
ret
soundFXGen:
_S1: push bc
ld a,($5C48) ; 11T
srl a
srl a
srl a
set 4,a ; 8T
out(254),a ; 11T
ld b,d
_S2: nop ; 4T
nop ; 4T
nop ; 4T
djnz _S2 ; 50021
res 4,a
out(254),a ; 11T
ld b,e
_S3: nop ; 4T
nop ; 4T
nop ; 4T
djnz _S3 ; 50031
nop
dec e ; 4T
inc d ; 4T
inc e ; 4T
pop bc ; 10T
djnz _S1 ; 50006
ret
end wiggy
I would actually like to disassemble the whole program, as I think a few optimisations could be made to make it more efficient. (but that is a project for later, it apparently has no protection scheme and seems a fairly compact program so..)
The other utility I recall being on a cover tape years ago was a tracker to make music on the spectrum 128, When I found out browsing the interwebs that a fellow had written an entire tutorial on this I figured it would be worth my time having a look. Thanks for Hikoki for the pdf hookup.
In other project news - been experimenting with creating a better square highlighter for the chess board. It will be much more simple (just using the flash attribute) so that will save a lot of time especially with the modular code stuff its a much smaller program.
Another routine I am messing around with is a idle timer, if there is no keyboard interaction for a certain amount of time it will switch to the attract mode. But that is just in the planning stages. I am trying to think of games that did this on the spectrum..
Probably a useless feature but little things for little minds haha. Still it might come in handy for a future project.
Stuff that is left to do - create some fancy screen backgrounds for the menus, complete the chessmen sprites (been looking at the archive for chess games on the spectrum and what graphics they used for some inspiration on what is good/crap.)
Finish reading through the Chuntey blogs. I think I could really improve the quality of the game this way.
Thanks to all that gave me comments and suggestions. It helps a lot to hear your ideas and advice. I think you guys are right in that a lot of my problems are not having a clear idea of the platform or how the assembly works. Over time with some effort on my part I think I can get better and avoid the gotcha's so much. Another thing that is obvious is I need to learn the tools much better. Really understanding how to use Fuse for development and Zeus will avoid a lot of problems. Lol while still a potato I think compared to where I started a few weeks back, progress has been made. I hope this time next year I can do lots of self directed learning - That is my main goal to be in a position where I don't need to bother y'all with my wibble haha.