So, as a first note, I almost forgot to come here to start this all! On Twitter the other day, I posted a screenshot of my first assembler achievement for the C64. I managed to put together a replica of the PC version of the EFMB title screen, which I love. I ended up having to do several jiggery pokery things to make it work. Firstly, I drew the image in Aseprite. I then saved it as a .png file and imported it into Timanthes. I then had to fiddle around with the width, change it to bitmapped C64 colours, and then finally retouch several pixels where there were more than 4 colours per 8x8 pixel block. At least it wasn't that bad, so in the end, Aseprite did quite a good job in my opinion. I then had to export this image as a .prg file with $2000 as the start of the bitmap data. I then read up through various online tutorials and google searches on how to display a bitmap, and here you go...
Next task, I managed to get a sprite displayed. Multicolour too. At first 2 of the colours weren't correct, no matter how I exported it. I used Spritepad to draw the multicolour sprite, and no matter how I exported it, this didn't change the colours. Thanks to Andrew's asm experience however, he mentioned that perhaps the colour data isn't in the sprite date and that you have to set the colours yourself. As it turns out, it looks like he was right. So, I finally managed a few new milestones for this.. 1. Show a sprite 2. Change background and foreground colours. 3. Correct sprite's colours. 4. Move sprite with joystick up/down/left/right. 5. Implemented a semblance of a raster time check for checking CPU cycle usage going forward.
Small successes for anyone else. For me, huge.
Here's a small screeny of it so far...
Next task is to create Moby's animations and then implement animation code.
Bit delayed on the updates again hoho, but there are several, so here goes! Firstly, I followed the previous implementation of moby and attempted to move him. This meant understanding joystick control. I then also came across the 255 X position limit, where I needed to make sense of using the most significant byte to be set or unset to carry over the 255 limit up to 320. Thanks to Andrew for helping me figure that one out!
To me this was complicated, for you probably trivial
So as mentioned before, I now tried to animate moby. I drew some animations using Spritepad:
Then I brought that code into sublime and got to figuring out how to animate a sprite. I also implemented some animation timer code which I'm quite proud of, which lets you animate any sprite at any speed you like. This is useful for say a case where an enemy walks, and then runs, letting you change the animation speed accordingly.
As you can see, there's still some work needed to improve the animations. For some reason, the frames don't change to the next batch of frames quickly enough when you change direction, so it looks like moby does a bit of a moonwalk before turning, hohoho. Hopefully I'll solve this soon.
Next attempt I worked on was sprite multiplexing. Since EFMB64 shouldn't have more then 5 sprites on the same platform level, I don't think it will be "too" difficult to get this working in the actual game.
But for now, this was an attempt by me using the same sprite (as I was lazy), to draw multiple sprites on screen at once.
Note there were obviously no attempts made on using different sprites, animations or going over the 255 X limit checkign for MSB. This was purely a multiplexing sprite test!
My next task was to be able to write text on screen. Specifically multi-colour font text because I like them colours.. I quickly threw together a quick font in Charpad
And then got the right results after figuring out which bits to set in which registers
I also took the time to write a funky Kickassembler macro that allows me to place text on any part of the screen, of any length. This will be very useful in the game when I want to display things like Game over, or congrats or any other text that needs to be displayed on screen at any point in time.
Before I did the above, I also implemented some code to play music. I decided it would be nice to see some info of the song on the screen at the same time. It's this that got me into the above font idea and macro code.
No idea why, and I apologise for this, but the music in the video is WAY out of sync with what's on the screen. For some reason, FFMPEG takes ages to record video and audio in Vice and seems to be out of sync quite a bit But you get the idea of what I'm saying anyway..
And now finally, we reach the latest achievement I've managed to do. A real thanks to Andrew for helping me figure this out because, despite me being 99% there, I just couldn't crack the multicolour code implementation to show level graphics in all the right colours from the Charpad data. It was right in front of me, but I didn't see it. Ugh.
Anyway, so this is the level I drew as a test in Charpad:
And this is the final result in Vice:
I'm very happy with this, because this gives me the opportunity to utilise both "high-res" and multi-colour characters on the level graphics for the game. For those that don't know, this is because characters that use any of the first 8 colours, are seen as "high-res" chars, ie 8x8 pixels with one foreground and one background colour. Any characters that use colours up to 16 will be multi-colour, and they are 4x8, meaning double width pixels with 1 individual foreground colour, 2 shared (between all characters) multi-colours and 1 background colour. It's a bit limiting and not much better than monochrome frankly, but every little bit of colour helps!
So, plenty of updates from me today. I feel I am now in a position to actually start on the EFMB64 game proper. Having learned some lessons on the way, I "should" have enough knowledge to get started. I know I'm going to still stumble on many issues, especially since I'll now have to take everything I've learned and implement it all in one project, keeping in mind timing, interrupts, memory useage etc etc. But I wanted to do all these small tasks before I started on the game, so I have a slightly better understanding and appreciation for the limits I have to work with, both in hardware, RAM and my own experience
I'll post more update as and when I have something to report, but I imagine the updates will be more frequent now that I'll be actually starting on the game itself!
My next step will be to draw a level and moby in one project so I can test to see how high the level platforms should be, because I like the size of moby as he is and don't want to drop the quality by going smaller.
Then, I'll start with graphics things first though. Doing a full font, doing a game over screen, drawing all the sprites and animations I'll need and drawing all the levels and data for them.