The new ZXDB database update will be applied today at 1600BST. The site goes down whilst this happens, and normally takes 30 minutes.
how about a more modern miner willy sprite?
- gabriele amore
- Microbot
- Posts: 183
- Joined: Thu Apr 16, 2020 11:28 pm
- Location: Palermo
Re: how about a more modern miner willy sprite?
willie is off the ground in frame 4 and 5 only. Otherwise is on one foot or both ...
Get my AY games here https://www.dropbox.com/sh/tfo83j5lzwmh ... Kkk7a?dl=0
- ParadigmShifter
- Dynamite Dan
- Posts: 1296
- Joined: Sat Sep 09, 2023 4:55 am
Re: how about a more modern miner willy sprite?
Yup, but you can stand still in that animation frame so you will look like you are floating?
It may also make horizontal jumps a bit weird since it just plays the same animations it just adjusts the Y position based on height.
I will do both on the ground at all times and as is as a test though, so we can see which looks best.
ETA for a very unoptimised version of that, hour or 2 maybe.
Maybe we could add idle frames and a jump animation though. Since no mods (i.e. drop in replacements for graphics) will support 8 frames like I intend to, there are no rules really (although for efficiency issues it is worth keeping most of the same rules for the horizontal guardians I think).
If we go all in, we could do all sorts of extra stuff (like a turn animation where Willy is face on or has back to you).
It may also make horizontal jumps a bit weird since it just plays the same animations it just adjusts the Y position based on height.
I will do both on the ground at all times and as is as a test though, so we can see which looks best.
ETA for a very unoptimised version of that, hour or 2 maybe.
Maybe we could add idle frames and a jump animation though. Since no mods (i.e. drop in replacements for graphics) will support 8 frames like I intend to, there are no rules really (although for efficiency issues it is worth keeping most of the same rules for the horizontal guardians I think).
If we go all in, we could do all sorts of extra stuff (like a turn animation where Willy is face on or has back to you).
Re: how about a more modern miner willy sprite?
gun! please, give him a gun! and some grenades! ;-)
Re: how about a more modern miner willy sprite?
That's the following project: Manic Gryzor.
- ParadigmShifter
- Dynamite Dan
- Posts: 1296
- Joined: Sat Sep 09, 2023 4:55 am
Re: how about a more modern miner willy sprite?
I think I have typed in the graphics correctly and mirrored them OK.
Will see when I draw them on the screen I guess![Wink ;)](./images/smilies/icon_e_wink.gif)
Although I think it may be better to tweak the frame order since the final frame fits within an 8x16 frame so would remove most of the problems I foresee with the collision (you will be able to stand on that ledge in telephones level on that anim frame and not get hit), whereas all the other frames are more than 8 wide.
I'd need to rejink the graphics a bit for that but I can do that on my own I think. It's not important right now anyway.
EDIT: Nope, I see the first frame is also 8 pixels wide, should be fine as is!
Anyway there is a BEER BUFFER UNDERFLOW issue to deal with before I do anything else.
Will see when I draw them on the screen I guess
![Wink ;)](./images/smilies/icon_e_wink.gif)
Code: Select all
gfx_willy0
dg .....##......... ;0
dg ..##.##......... ;1
dg .##............. ;2
dg .#..#........... ;3
dg ..###.#......... ;4
dg ...###.......... ;5
dg ................ ;6
dg .##.#.#......... ;7
dg #...###......... ;8
dg #....###........ ;9
dg .....###........ ;10
dg ###.###......... ;11
dg ##.#####........ ;12
dg ...##.##........ ;13
dg ................ ;14
dg ...###.#........ ;15
gfx_willy1
dg ......##........ ;0
dg ...##.##........ ;1
dg ..##............ ;2
dg ..#..#.......... ;3
dg ...###.#........ ;4
dg ....###......... ;5
dg ..##............ ;6
dg .#...#.#........ ;7
dg .....###........ ;8
dg .#....###....... ;9
dg ####..###....... ;10
dg ###..###........ ;11
dg ...###.##....... ;12
dg ...##........... ;13
dg .......###...... ;14
dg ...###.......... ;15
gfx_willy2
dg .......##....... ;0
dg ....##.##....... ;1
dg ...##........... ;2
dg ...#..#......... ;3
dg ....###.#....... ;4
dg .....###........ ;5
dg ...##........... ;6
dg ..#...#.#....... ;7
dg ..#...###....... ;8
dg ...###.###...... ;9
dg ..###..###...... ;10
dg ...#..###....... ;11
dg ....###......... ;12
dg ....##..###..... ;13
dg ...#............ ;14
dg ...##........... ;15
gfx_willy3
dg ........##...... ;0
dg .....##.##...... ;1
dg ....##.......... ;2
dg ....#..#........ ;3
dg .....###.#...... ;4
dg ......###....... ;5
dg .....#.......... ;6
dg ....#...#....... ;7
dg ....#.#..#...... ;8
dg .....###.##..... ;9
dg ......##.##..... ;10
dg ........##...... ;11
dg ....#.##..#..... ;12
dg ....#.#..###.... ;13
dg ....#........... ;14
dg ................ ;15
gfx_willy4
dg .........##..... ;0
dg ......##.##..... ;1
dg .....##......... ;2
dg .....#..#....... ;3
dg ......###.#..... ;4
dg .......###...... ;5
dg ......#......... ;6
dg .....#.......... ;7
dg .....#....#..... ;8
dg ......#..####... ;9
dg .......#..###... ;10
dg .....#.......... ;11
dg .....#.##....... ;12
dg .....#....###... ;13
dg ................ ;14
dg ................ ;15
gfx_willy5
dg ................ ;0
dg ..........##.... ;1
dg .......##.##.... ;2
dg ......##........ ;3
dg ......#..#...... ;4
dg .......###.#.... ;5
dg ........###..... ;6
dg .......#........ ;7
dg ......#......... ;8
dg ......#....#.... ;9
dg .......##.####.. ;10
dg .....#...#.###.. ;11
dg .....#.##....... ;12
dg .....#..####.... ;13
dg ................ ;14
dg ..........###... ;15
gfx_willy6
dg ................ ;0
dg ...........##... ;1
dg ........##.##... ;2
dg .......##....... ;3
dg .......#..#..... ;4
dg ........###.#... ;5
dg .........###.... ;6
dg ........#....... ;7
dg .......#........ ;8
dg .......#..#..... ;9
dg ........#.##.... ;10
dg .......#..##.... ;11
dg ......##.#..#... ;12
dg ......#...##.... ;13
dg ................ ;14
dg ..........###... ;15
gfx_willy7
dg .............##. ;0
dg ..........##.##. ;1
dg .........##..... ;2
dg .........#..#... ;3
dg ..........###.#. ;4
dg ...........###.. ;5
dg ................ ;6
dg .........#..#... ;7
dg ........#....#.. ;8
dg ........#.#..##. ;9
dg .........###.##. ;10
dg ..........##.##. ;11
dg ............###. ;12
dg ...........###.. ;13
dg ................ ;14
dg ...........###.. ;15
gfx_willy8
dg .........##..... ;0
dg .........##.##.. ;1
dg .............##. ;2
dg ...........#..#. ;3
dg .........#.###.. ;4
dg ..........###... ;5
dg ................ ;6
dg .........#.#.##. ;7
dg .........###...# ;8
dg ........###....# ;9
dg ........###..... ;10
dg .........###.### ;11
dg ........#####.## ;12
dg ........##.##... ;13
dg ................ ;14
dg ........#.###... ;15
gfx_willy9
dg ........##...... ;0
dg ........##.##... ;1
dg ............##.. ;2
dg ..........#..#.. ;3
dg ........#.###... ;4
dg .........###.... ;5
dg ............##.. ;6
dg ........#.#...#. ;7
dg ........###..... ;8
dg .......###....#. ;9
dg .......###..#### ;10
dg ........###..### ;11
dg .......##.###... ;12
dg ...........##... ;13
dg ......###....... ;14
dg ..........###... ;15
gfx_willy10
dg .......##....... ;0
dg .......##.##.... ;1
dg ...........##... ;2
dg .........#..#... ;3
dg .......#.###.... ;4
dg ........###..... ;5
dg ...........##... ;6
dg .......#.#...#.. ;7
dg .......###...#.. ;8
dg ......###.###... ;9
dg ......###..###.. ;10
dg .......###..#... ;11
dg .........###.... ;12
dg .....###..##.... ;13
dg ............#... ;14
dg ...........##... ;15
gfx_willy11
dg ......##........ ;0
dg ......##.##..... ;1
dg ..........##.... ;2
dg ........#..#.... ;3
dg ......#.###..... ;4
dg .......###...... ;5
dg ..........#..... ;6
dg .......#...#.... ;7
dg ......#..#.#.... ;8
dg .....##.###..... ;9
dg .....##.##...... ;10
dg ......##........ ;11
dg .....#..##.#.... ;12
dg ....###..#.#.... ;13
dg ...........#.... ;14
dg ................ ;15
gfx_willy12
dg .....##......... ;0
dg .....##.##...... ;1
dg .........##..... ;2
dg .......#..#..... ;3
dg .....#.###...... ;4
dg ......###....... ;5
dg .........#...... ;6
dg ..........#..... ;7
dg .....#....#..... ;8
dg ...####..#...... ;9
dg ...###..#....... ;10
dg ..........#..... ;11
dg .......##.#..... ;12
dg ...###....#..... ;13
dg ................ ;14
dg ................ ;15
gfx_willy13
dg ................ ;0
dg ....##.......... ;1
dg ....##.##....... ;2
dg ........##...... ;3
dg ......#..#...... ;4
dg ....#.###....... ;5
dg .....###........ ;6
dg ........#....... ;7
dg .........#...... ;8
dg ....#....#...... ;9
dg ..####.##....... ;10
dg ..###.#...#..... ;11
dg .......##.#..... ;12
dg ....####..#..... ;13
dg ................ ;14
dg ...###.......... ;15
gfx_willy14
dg ................ ;0
dg ...##........... ;1
dg ...##.##........ ;2
dg .......##....... ;3
dg .....#..#....... ;4
dg ...#.###........ ;5
dg ....###......... ;6
dg .......#........ ;7
dg ........#....... ;8
dg .....#..#....... ;9
dg ....##.#........ ;10
dg ....##..#....... ;11
dg ...#..#.##...... ;12
dg ....##...#...... ;13
dg ................ ;14
dg ...###.......... ;15
gfx_willy15
dg .##............. ;0
dg .##.##.......... ;1
dg .....##......... ;2
dg ...#..#......... ;3
dg .#.###.......... ;4
dg ..###........... ;5
dg ................ ;6
dg ...#..#......... ;7
dg ..#....#........ ;8
dg .##....#........ ;9
dg .##...#......... ;10
dg .##..###........ ;11
dg .###.##......... ;12
dg ..###........... ;13
dg ................ ;14
dg ..###........... ;15
I'd need to rejink the graphics a bit for that but I can do that on my own I think. It's not important right now anyway.
EDIT: Nope, I see the first frame is also 8 pixels wide, should be fine as is!
Anyway there is a BEER BUFFER UNDERFLOW issue to deal with before I do anything else.
- Lee Bee
- Dynamite Dan
- Posts: 1567
- Joined: Sat Nov 16, 2019 11:01 pm
- Location: Devon, England
- Contact:
Re: how about a more modern miner willy sprite?
Your new sprite looks good Gabriele! An update to the main sprite would be very welcome.
If the sprite is updated, you could also consider updating some other aspects of the player sprite and control:
1. Custom sprite for 'standing still'
2. Custom sprite for 'jumping' (or just freeze while jumping)
3. Idle animation?
4. When jumping, forward motion doesn't stop until you land or hit something
5. Player acceleration, from slow walking up to full speed running after approx. 1 second (may be tricky to integrate with existing level design)
6. Different sprites for 2 speeds
7. Dust under feet when you stop running or double-back
8. Skidding sprite for when you stop running
9. Perhaps slight inertia after you stop running
If the sprite is updated, you could also consider updating some other aspects of the player sprite and control:
1. Custom sprite for 'standing still'
2. Custom sprite for 'jumping' (or just freeze while jumping)
3. Idle animation?
4. When jumping, forward motion doesn't stop until you land or hit something
5. Player acceleration, from slow walking up to full speed running after approx. 1 second (may be tricky to integrate with existing level design)
6. Different sprites for 2 speeds
7. Dust under feet when you stop running or double-back
8. Skidding sprite for when you stop running
9. Perhaps slight inertia after you stop running
- ParadigmShifter
- Dynamite Dan
- Posts: 1296
- Joined: Sat Sep 09, 2023 4:55 am
Re: how about a more modern miner willy sprite?
Some good ideas there.
If first plan is to do a straight remake of Manic Miner and all the levels (but at 50fps, if possible) I don't think adding stuff like inertia is a good idea for the moment. I'd do a straight port first and then consider what else could be done.
Maybe we should make another thread for ongoing progress on programming and design ideas?
Another issue is each custom sprite is really 16 sprites because they are not shifted into position (and need mirroring as well). That's 512 bytes added per new sprite unless I do the shifting at runtime. If Willy is the only sprite affected it could be doable though (shifting at runtime).
If first plan is to do a straight remake of Manic Miner and all the levels (but at 50fps, if possible) I don't think adding stuff like inertia is a good idea for the moment. I'd do a straight port first and then consider what else could be done.
Maybe we should make another thread for ongoing progress on programming and design ideas?
Another issue is each custom sprite is really 16 sprites because they are not shifted into position (and need mirroring as well). That's 512 bytes added per new sprite unless I do the shifting at runtime. If Willy is the only sprite affected it could be doable though (shifting at runtime).
- HEXdidnt
- Manic Miner
- Posts: 238
- Joined: Thu Mar 09, 2023 2:40 pm
- Location: Harrow, London, UK
- Contact:
Re: how about a more modern miner willy sprite?
Much as I like these ideas in and of themselves, the game ceases to be Manic Miner if some of them are implemented. Acceleration, any form of 'dash', plus inertia, skidding, etc. turns it into Prince of Subterranean Surbiton or Manic Flashback (there's a couple of names anyone's free to use) rather than Manic Miner, which is all about caution and precision rather than dynamic action.Lee Bee wrote: ↑Sat Jun 22, 2024 8:05 pm If the sprite is updated, you could also consider updating some other aspects of the player sprite and control:
1. Custom sprite for 'standing still'
2. Custom sprite for 'jumping' (or just freeze while jumping)
3. Idle animation?
4. When jumping, forward motion doesn't stop until you land or hit something
5. Player acceleration, from slow walking up to full speed running after approx. 1 second (may be tricky to integrate with existing level design)
6. Different sprites for 2 speeds
7. Dust under feet when you stop running or double-back
8. Skidding sprite for when you stop running
9. Perhaps slight inertia after you stop running
A dedicated Jump sprite was something I suggested while working on The Lower Caverns, but it would have required reworking more of the code, which seemed like more effort than it would ultimately be worth. It's something we agreed to shelve and possibly consider when we get onto the follow-up.
Another thing, regarding the previously noted width of the sprites, when I redesigned the flaming barrel sprite, I initially made the flame wider than the barrel... but it quickly became apparent that it made some jumps almost impossible - partly because the sprite was wider and so more tricky to clear, but also because of the knock-on effect of its path being truncated. Six pixels shorter, even four, and there just wasn't the space to time a landing followed by an immediate jump over the barrel. There were also a few instances of wholly new sprites that started out as 16x16 pixels having to be made thinner, just to ensure they could be jumped over.
...Dropping litter in the zen garden of your mind
The Hub of all things HEXdidn't... | HEXdidn't... on YouTube ...on ZXArt ...on deviantart | A Pixel Art Odyssey
The Hub of all things HEXdidn't... | HEXdidn't... on YouTube ...on ZXArt ...on deviantart | A Pixel Art Odyssey
- ParadigmShifter
- Dynamite Dan
- Posts: 1296
- Joined: Sat Sep 09, 2023 4:55 am
Re: how about a more modern miner willy sprite?
Ok so I have it animating left to right only for now.
I'll add keyboard control soon
![Image](https://i.postimg.cc/Df910sxn/modernmm.gif)
I had to draw 2 sprites because just drawing 1 was faster than it took the scanline to reach the border area lol. Glitch when partially offscreen is because I am not clipping (you don't need to do clipping in MM or JSW so I can ignore it).
EDIT: Pretty sure any other glitches in the GIF are caused by Spin/Windows dropping frames while recording the GIF, which is annoying. Also every time you record a GIF in Spin it hangs after recording and you have to use Task Manager to kill it![Sad :(](./images/smilies/icon_e_sad.gif)
I'll add keyboard control soon
![Image](https://i.postimg.cc/Df910sxn/modernmm.gif)
I had to draw 2 sprites because just drawing 1 was faster than it took the scanline to reach the border area lol. Glitch when partially offscreen is because I am not clipping (you don't need to do clipping in MM or JSW so I can ignore it).
EDIT: Pretty sure any other glitches in the GIF are caused by Spin/Windows dropping frames while recording the GIF, which is annoying. Also every time you record a GIF in Spin it hangs after recording and you have to use Task Manager to kill it
![Sad :(](./images/smilies/icon_e_sad.gif)
- ParadigmShifter
- Dynamite Dan
- Posts: 1296
- Joined: Sat Sep 09, 2023 4:55 am
Re: how about a more modern miner willy sprite?
Yeah I agree if I am going to port the original levels we'd have to watch out for any graphics changes affecting the gameplay and difficulty.HEXdidnt wrote: ↑Sat Jun 22, 2024 9:45 pm Much as I like these ideas in and of themselves, the game ceases to be Manic Miner if some of them are implemented. Acceleration, any form of 'dash', plus inertia, skidding, etc. turns it into Prince of Subterranean Surbiton or Manic Flashback (there's a couple of names anyone's free to use) rather than Manic Miner, which is all about caution and precision rather than dynamic action.
A dedicated Jump sprite was something I suggested while working on The Lower Caverns, but it would have required reworking more of the code, which seemed like more effort than it would ultimately be worth. It's something we agreed to shelve and possibly consider when we get onto the follow-up.
Another thing, regarding the previously noted width of the sprites, when I redesigned the flaming barrel sprite, I initially made the flame wider than the barrel... but it quickly became apparent that it made some jumps almost impossible - partly because the sprite was wider and so more tricky to clear, but also because of the knock-on effect of its path being truncated. Six pixels shorter, even four, and there just wasn't the space to time a landing followed by an immediate jump over the barrel. There were also a few instances of wholly new sprites that started out as 16x16 pixels having to be made thinner, just to ensure they could be jumped over.
My rewrite is already hard enough since it is faster than the original. This new rewrite might be able to run at 50fps (I will update enemies at 25fps though) which makes it harder still.
I'm not very good at playing Manic Miner either we'd need testers once I get the gameplay in. Last time I tried I gave up on Revenge of the Mutant Kong Beast I think
![Wink ;)](./images/smilies/icon_e_wink.gif)
- HEXdidnt
- Manic Miner
- Posts: 238
- Joined: Thu Mar 09, 2023 2:40 pm
- Location: Harrow, London, UK
- Contact:
Re: how about a more modern miner willy sprite?
I'm a lot better at the SAM version than the Spectrum, as I proved by failing to prevent Wayne Robbins winning the Manic Miner competition at RetCon
Very curious to see how you handle some levels... not least in the light of this little snippet from an interview with Matthew Smith:
![Wink ;)](./images/smilies/icon_e_wink.gif)
Very curious to see how you handle some levels... not least in the light of this little snippet from an interview with Matthew Smith:
I had a couple of suggestions for that one as well, because I wasn't particularly keen on the beam effect in the SAM version... but it turned out to be so deeply enmeshed in the game code that we couldn't really alter its path. The McFarlane remix level had to be tweaked so as to utilise exactly the same changes of direction and the timing thereof. Clever coding, certainly, but disappointingly inflexible.The game used core code routines for most of the basic action, but special routines were introduced for particular events on each screen. "It upset the people trying to do a conversion to another machine", says Matthew. "People working on the Solar Power Generator become sick."
...Dropping litter in the zen garden of your mind
The Hub of all things HEXdidn't... | HEXdidn't... on YouTube ...on ZXArt ...on deviantart | A Pixel Art Odyssey
The Hub of all things HEXdidn't... | HEXdidn't... on YouTube ...on ZXArt ...on deviantart | A Pixel Art Odyssey
- ParadigmShifter
- Dynamite Dan
- Posts: 1296
- Joined: Sat Sep 09, 2023 4:55 am
Re: how about a more modern miner willy sprite?
Turbo Manic Miner was a complete from scratch rewrite so I didn't do anything the same way probably
It was what I used to teach myself Z80 and assembly programming (had only programmed in C before, and nothing for the Speccy).
I did rip off the Willy movement code since that was tricky to get right.
Events I did by having them call a routine when they were active IIRC. Switches were just normal platforms (with different graphics) and the event watched to see if you were in the correct cell, if so, call the custom routine.
These were the event codes/special level features I had
EVENT_KEYS EQU #fe ; event when all keys collected
EVENT_SWITCH_1 EQU #fd ; switch event 1
EVENT_SWITCH_2 EQU #fc ; switch event 2
EVENT_SOLAR EQU #fb ; solar power present on level
GFX_COPY EQU #fa ; copy gfx to level (for Final Barrier)
EVENT_KEYS was for turning Eugene angry.
The 2 switch events were for the Kong beast levels (remove a wall, and change a guardian path I think?)
Solar event is obvious, I think the position of the beam was hard coded though (can change that). I think the original had some quirky behaviour which I may not have reproduced exactly (does that matter I wonder?).
It's easy to add new events to the level format there's only 16 tiles max I think per level so most other numbers are available in the level format (which is run length compressed - I can compress it better this time though to save more space).
There was a special enemy type flag for Eugene, Skylabs and Kong to cope with their specific behaviour.
Code was terrible obvs since it was my first attempt
Joffa did say I had done a good job though!!!
Since I have all my old code I think I can probably drop it in to a new engine pretty easily, and improve it as I do so.
I may rip off the entire front end code though lol![Wink ;)](./images/smilies/icon_e_wink.gif)
You can give my old code a whirl here
https://spectrumcomputing.co.uk/entry/3 ... iner_Turbo
There's no scoring in that version but I did manage to do that (I think my PC I developed it on had a power supply explosion/fire soon afterwards though so actual code is unrecoverable).
Keys are as normal except you can't turn the music off I think. A quits to BASIC. S resets the level. D skips to next level.
![Wink ;)](./images/smilies/icon_e_wink.gif)
I did rip off the Willy movement code since that was tricky to get right.
Events I did by having them call a routine when they were active IIRC. Switches were just normal platforms (with different graphics) and the event watched to see if you were in the correct cell, if so, call the custom routine.
These were the event codes/special level features I had
EVENT_KEYS EQU #fe ; event when all keys collected
EVENT_SWITCH_1 EQU #fd ; switch event 1
EVENT_SWITCH_2 EQU #fc ; switch event 2
EVENT_SOLAR EQU #fb ; solar power present on level
GFX_COPY EQU #fa ; copy gfx to level (for Final Barrier)
EVENT_KEYS was for turning Eugene angry.
The 2 switch events were for the Kong beast levels (remove a wall, and change a guardian path I think?)
Solar event is obvious, I think the position of the beam was hard coded though (can change that). I think the original had some quirky behaviour which I may not have reproduced exactly (does that matter I wonder?).
It's easy to add new events to the level format there's only 16 tiles max I think per level so most other numbers are available in the level format (which is run length compressed - I can compress it better this time though to save more space).
There was a special enemy type flag for Eugene, Skylabs and Kong to cope with their specific behaviour.
Code was terrible obvs since it was my first attempt
![Wink ;)](./images/smilies/icon_e_wink.gif)
Since I have all my old code I think I can probably drop it in to a new engine pretty easily, and improve it as I do so.
I may rip off the entire front end code though lol
![Wink ;)](./images/smilies/icon_e_wink.gif)
You can give my old code a whirl here
https://spectrumcomputing.co.uk/entry/3 ... iner_Turbo
There's no scoring in that version but I did manage to do that (I think my PC I developed it on had a power supply explosion/fire soon afterwards though so actual code is unrecoverable).
Keys are as normal except you can't turn the music off I think. A quits to BASIC. S resets the level. D skips to next level.
- ParadigmShifter
- Dynamite Dan
- Posts: 1296
- Joined: Sat Sep 09, 2023 4:55 am
Re: how about a more modern miner willy sprite?
Day 1 progress then.
You can move left and right with Q and W. Miner Willy moonwalks since I only play right facing anims which I may sort out before bed if it's not too difficult
It is post-beer o'clock though.
Code was just thrown together from old bits I had in other projects.
You need sjasmplus to assemble it I expect (command line to use is first comment in code) - paste the code into a file called modernmm.asm
CLEAR 32767
Load binary file out.bin to address 32768
RANDOMISE USR 32768
Note: there's no code yet to draw Willy at a Y coordinate that is not a multiple of 8 since that is slower. So if you mess around with the code make sure willy_ypos is a multiple of 8.
You can move left and right with Q and W. Miner Willy moonwalks since I only play right facing anims which I may sort out before bed if it's not too difficult
![Wink ;)](./images/smilies/icon_e_wink.gif)
Code: Select all
ORGADDR EQU #8000
; sjasmplus.exe --sym=out.sym --syntax=f --raw=out.bin modernmm.asm
ORG ORGADDR
DISPLAY "ORIGIN ", /A, ORGADDR
SCRBASE EQU #4000
MACRO DWXYTOSCRADDR _x_, _y_
dw SCRBASE + (((_y_)|((_y_&#C0)>>3))<<8)|((_x_F)|((_y_&)<<2))
ENDM
MACRO SETBORDER bdr
ld a, bdr
out (#FE), a
ENDM
main:
SETBORDER 7
halt
SETBORDER 2
ld hl, willy_oldpos
ld a, (hl)
and ~7
rrca
rrca
rrca
ld c, a
inc l
ld a, (hl)
and ~7
rrca
rrca
rrca
ld b, a
call erase16x16ra
ld hl, willy_xpos
ld a, (hl)
ld d, a
and 7
rrca
rrca
rrca
ld e, a
ld a, d
and ~7
rrca
rrca
rrca
ld c, a
inc l
ld a, (hl)
and ~7
rrca
rrca
rrca
ld b, a
ld d, gfx_willy0/256
call sprite16x16ra
ld hl, willy_oldpos
ld a, (hl)
and ~7
rrca
rrca
rrca
ld c, a
inc l
ld a, (hl)
sub 24
and ~7
rrca
rrca
rrca
ld b, a
call erase16x16ra
ld hl, willy_xpos
ld a, (hl)
ld d, a
and 7
rrca
rrca
rrca
ld e, a
ld a, d
and ~7
rrca
rrca
rrca
ld c, a
inc l
ld a, (hl)
sub 24
and ~7
rrca
rrca
rrca
ld b, a
ld d, gfx_willy0/256
call sprite16x16ra
SETBORDER 4
ld de, willy_oldpos
ld hl, willy_xpos
ldi
ldi
call read_keyboard
ld hl, willy_xpos
ld a, (hl)
add c
ld (hl), a
jp main
ret
; B: row (in character cells, so [0-23])
; C: column
sprite16x16ra:
ld a, b
add b ; A = B*2
ld h, tbl_rows/256 ; high byte of screen address lookup table. Aligned 256 so low byte will be just row*2
ld l, a ; index into table
ld a, (hl) ; low byte of screen address
inc l ; point HL to high byte of screen address
ld h, (hl) ; read high byte of screen address
add c ; add on column to low byte of screen address
ld l, a ; and write it back. HL now holds correct screen address
; so we now know the address...
; HL: screen address
sprite16x16raKnowAddr:
REPT 8
ld a, (de)
inc e ; ok because gfx data is 8 byte aligned
or (hl)
ld (hl), a
inc l
ld a, (de)
inc e ; ok because gfx data is 8 byte aligned
or (hl)
ld (hl), a
inc h ; next row of pixels down
dec l
ENDR
; we could split this into 2 routines depending on whether we straddle a screen third boundary or not
; which we could work out before calling
; then we could remove the jr c
ld a, #20
add l
ld l, a
jr c, .ok
ld a, h
sub #8
ld h, a
.ok
REPT 7
ld a, (de)
inc e ; ok because gfx data is 8 byte aligned
or (hl)
ld (hl), a
inc l
ld a, (de)
inc e ; ok because gfx data is 8 byte aligned
or (hl)
ld (hl), a
inc h ; next row of pixels down
dec l
ENDR
; last row, don't need to increment gfx data pointer or screen row
ld a, (de)
inc e ; ok because gfx data is 8 byte aligned
or (hl)
ld (hl), a
inc l
ld a, (de)
or (hl)
ld (hl), a
ret
; B: row (in character cells, so [0-23])
; C: column
erase16x16ra:
ld a, b
add b ; A = B*2
ld h, tbl_rows/256 ; high byte of screen address lookup table. Aligned 256 so low byte will be just row*2
ld l, a ; index into table
ld a, (hl) ; low byte of screen address
inc l ; point HL to high byte of screen address
ld h, (hl) ; read high byte of screen address
add c ; add on column to low byte of screen address
ld l, a ; and write it back. HL now holds correct screen address
; so we now know the address...
; HL: screen address
erase16x16raKnowAddr:
xor a
REPT 8
ld (hl), a
inc l
ld (hl), a
inc h ; next row of pixels down
dec l
ENDR
; we could split this into 2 routines depending on whether we straddle a screen third boundary or not
; which we could work out before calling
; then we could remove the jr c
ld a, #20
add l
ld l, a
jr c, .ok
ld a, h
sub #8
ld h, a
.ok
xor a
REPT 7
ld (hl), a
inc l
ld (hl), a
inc h ; next row of pixels down
dec l
ENDR
ld (hl), a
inc l
ld (hl), a
ret
; at exit, C contains 1 if we pressed right and -1 if we pressed left
read_keyboard:
; Read these ports to scan keyboard
; bit N (0-based) is clear if the key is being pressed
; #FE - SHIFT, Z, X, C, & V
; #FD - A, S, D, F, & G
; #FB - Q, W, E, R, & T
; #F7 - 1, 2, 3, 4, & 5
; #EF - 0, 9, 8, 7, & 6
; #DF - P, O, I, U, & Y
; #BF - ENTER, L, K, J, & H
; #7F - SPACE, FULL-STOP, M, N, & B
; ld a, port
; in a, (#FE)
; to do the read of the port
ld bc, 0
; are we pressing W?
ld a, #FB
in a, (#FE)
bit 1, a
jr nz, .notpressingW
inc c
.notpressingW
; are we pressing Q?
bit 0, a
jr nz, .notpressingQ
dec c
.notpressingQ
ret
ALIGN 256
gfx_willy0
dg .....##......... ;0
dg ..##.##......... ;1
dg .##............. ;2
dg .#..#........... ;3
dg ..###.#......... ;4
dg ...###.......... ;5
dg ................ ;6
dg .##.#.#......... ;7
dg #...###......... ;8
dg #....###........ ;9
dg .....###........ ;10
dg ###.###......... ;11
dg ##.#####........ ;12
dg ...##.##........ ;13
dg ................ ;14
dg ...###.#........ ;15
gfx_willy1
dg ......##........ ;0
dg ...##.##........ ;1
dg ..##............ ;2
dg ..#..#.......... ;3
dg ...###.#........ ;4
dg ....###......... ;5
dg ..##............ ;6
dg .#...#.#........ ;7
dg .....###........ ;8
dg .#....###....... ;9
dg ####..###....... ;10
dg ###..###........ ;11
dg ...###.##....... ;12
dg ...##........... ;13
dg .......###...... ;14
dg ...###.......... ;15
gfx_willy2
dg .......##....... ;0
dg ....##.##....... ;1
dg ...##........... ;2
dg ...#..#......... ;3
dg ....###.#....... ;4
dg .....###........ ;5
dg ...##........... ;6
dg ..#...#.#....... ;7
dg ..#...###....... ;8
dg ...###.###...... ;9
dg ..###..###...... ;10
dg ...#..###....... ;11
dg ....###......... ;12
dg ....##..###..... ;13
dg ...#............ ;14
dg ...##........... ;15
gfx_willy3
dg ........##...... ;0
dg .....##.##...... ;1
dg ....##.......... ;2
dg ....#..#........ ;3
dg .....###.#...... ;4
dg ......###....... ;5
dg .....#.......... ;6
dg ....#...#....... ;7
dg ....#.#..#...... ;8
dg .....###.##..... ;9
dg ......##.##..... ;10
dg ........##...... ;11
dg ....#.##..#..... ;12
dg ....#.#..###.... ;13
dg ....#........... ;14
dg ................ ;15
gfx_willy4
dg .........##..... ;0
dg ......##.##..... ;1
dg .....##......... ;2
dg .....#..#....... ;3
dg ......###.#..... ;4
dg .......###...... ;5
dg ......#......... ;6
dg .....#.......... ;7
dg .....#....#..... ;8
dg ......#..####... ;9
dg .......#..###... ;10
dg .....#.......... ;11
dg .....#.##....... ;12
dg .....#....###... ;13
dg ................ ;14
dg ................ ;15
gfx_willy5
dg ................ ;0
dg ..........##.... ;1
dg .......##.##.... ;2
dg ......##........ ;3
dg ......#..#...... ;4
dg .......###.#.... ;5
dg ........###..... ;6
dg .......#........ ;7
dg ......#......... ;8
dg ......#....#.... ;9
dg .......##.####.. ;10
dg .....#...#.###.. ;11
dg .....#.##....... ;12
dg .....#..####.... ;13
dg ................ ;14
dg ..........###... ;15
gfx_willy6
dg ................ ;0
dg ...........##... ;1
dg ........##.##... ;2
dg .......##....... ;3
dg .......#..#..... ;4
dg ........###.#... ;5
dg .........###.... ;6
dg ........#....... ;7
dg .......#........ ;8
dg .......#..#..... ;9
dg ........#.##.... ;10
dg .......#..##.... ;11
dg ......##.#..#... ;12
dg ......#...##.... ;13
dg ................ ;14
dg ..........###... ;15
gfx_willy7
dg .............##. ;0
dg ..........##.##. ;1
dg .........##..... ;2
dg .........#..#... ;3
dg ..........###.#. ;4
dg ...........###.. ;5
dg ................ ;6
dg .........#..#... ;7
dg ........#....#.. ;8
dg ........#.#..##. ;9
dg .........###.##. ;10
dg ..........##.##. ;11
dg ............###. ;12
dg ...........###.. ;13
dg ................ ;14
dg ...........###.. ;15
gfx_willy8
dg .........##..... ;0
dg .........##.##.. ;1
dg .............##. ;2
dg ...........#..#. ;3
dg .........#.###.. ;4
dg ..........###... ;5
dg ................ ;6
dg .........#.#.##. ;7
dg .........###...# ;8
dg ........###....# ;9
dg ........###..... ;10
dg .........###.### ;11
dg ........#####.## ;12
dg ........##.##... ;13
dg ................ ;14
dg ........#.###... ;15
gfx_willy9
dg ........##...... ;0
dg ........##.##... ;1
dg ............##.. ;2
dg ..........#..#.. ;3
dg ........#.###... ;4
dg .........###.... ;5
dg ............##.. ;6
dg ........#.#...#. ;7
dg ........###..... ;8
dg .......###....#. ;9
dg .......###..#### ;10
dg ........###..### ;11
dg .......##.###... ;12
dg ...........##... ;13
dg ......###....... ;14
dg ..........###... ;15
gfx_willy10
dg .......##....... ;0
dg .......##.##.... ;1
dg ...........##... ;2
dg .........#..#... ;3
dg .......#.###.... ;4
dg ........###..... ;5
dg ...........##... ;6
dg .......#.#...#.. ;7
dg .......###...#.. ;8
dg ......###.###... ;9
dg ......###..###.. ;10
dg .......###..#... ;11
dg .........###.... ;12
dg .....###..##.... ;13
dg ............#... ;14
dg ...........##... ;15
gfx_willy11
dg ......##........ ;0
dg ......##.##..... ;1
dg ..........##.... ;2
dg ........#..#.... ;3
dg ......#.###..... ;4
dg .......###...... ;5
dg ..........#..... ;6
dg .......#...#.... ;7
dg ......#..#.#.... ;8
dg .....##.###..... ;9
dg .....##.##...... ;10
dg ......##........ ;11
dg .....#..##.#.... ;12
dg ....###..#.#.... ;13
dg ...........#.... ;14
dg ................ ;15
gfx_willy12
dg .....##......... ;0
dg .....##.##...... ;1
dg .........##..... ;2
dg .......#..#..... ;3
dg .....#.###...... ;4
dg ......###....... ;5
dg .........#...... ;6
dg ..........#..... ;7
dg .....#....#..... ;8
dg ...####..#...... ;9
dg ...###..#....... ;10
dg ..........#..... ;11
dg .......##.#..... ;12
dg ...###....#..... ;13
dg ................ ;14
dg ................ ;15
gfx_willy13
dg ................ ;0
dg ....##.......... ;1
dg ....##.##....... ;2
dg ........##...... ;3
dg ......#..#...... ;4
dg ....#.###....... ;5
dg .....###........ ;6
dg ........#....... ;7
dg .........#...... ;8
dg ....#....#...... ;9
dg ..####.##....... ;10
dg ..###.#...#..... ;11
dg .......##.#..... ;12
dg ....####..#..... ;13
dg ................ ;14
dg ...###.......... ;15
gfx_willy14
dg ................ ;0
dg ...##........... ;1
dg ...##.##........ ;2
dg .......##....... ;3
dg .....#..#....... ;4
dg ...#.###........ ;5
dg ....###......... ;6
dg .......#........ ;7
dg ........#....... ;8
dg .....#..#....... ;9
dg ....##.#........ ;10
dg ....##..#....... ;11
dg ...#..#.##...... ;12
dg ....##...#...... ;13
dg ................ ;14
dg ...###.......... ;15
gfx_willy15
dg .##............. ;0
dg .##.##.......... ;1
dg .....##......... ;2
dg ...#..#......... ;3
dg .#.###.......... ;4
dg ..###........... ;5
dg ................ ;6
dg ...#..#......... ;7
dg ..#....#........ ;8
dg .##....#........ ;9
dg .##...#......... ;10
dg .##..###........ ;11
dg .###.##......... ;12
dg ..###........... ;13
dg ................ ;14
dg ..###........... ;15
ALIGN 256
tbl_rows
REPT 24, row
DWXYTOSCRADDR 0, row*8
ENDR
ALIGN 2
willy_xpos db 0
willy_ypos db 104
willy_oldpos db 0, 104
IF 0
dg ................ ;0
dg ................ ;1
dg ................ ;2
dg ................ ;3
dg ................ ;4
dg ................ ;5
dg ................ ;6
dg ................ ;7
dg ................ ;8
dg ................ ;9
dg ................ ;10
dg ................ ;11
dg ................ ;12
dg ................ ;13
dg ................ ;14
dg ................ ;15
ENDIF
You need sjasmplus to assemble it I expect (command line to use is first comment in code) - paste the code into a file called modernmm.asm
CLEAR 32767
Load binary file out.bin to address 32768
RANDOMISE USR 32768
Note: there's no code yet to draw Willy at a Y coordinate that is not a multiple of 8 since that is slower. So if you mess around with the code make sure willy_ypos is a multiple of 8.
Last edited by ParadigmShifter on Sat Jun 22, 2024 11:37 pm, edited 1 time in total.
- ParadigmShifter
- Dynamite Dan
- Posts: 1296
- Joined: Sat Sep 09, 2023 4:55 am
Re: how about a more modern miner willy sprite?
Yeah I noticed that too. It's a nice sprite though although holding on some of the frames it looks a bit spindly, it's good when moving though.
I will do the top Willy with an alternate sprite which is always locked to the ground and I will draw a dummy floor tomorrow I think, so we can decide what looks best (or we could have both depending on whether you are moving or not?).
Sprites already use up 512 bytes of available memory. (Which is approx 40K). So that's about 1/80th of the RAM already gone.
Next up we need a collision map since Willy needs to move in front of platforms without erasing them. The erase function needs to copy tiles from the collision map instead of just erasing the cells. Collision map for a standard Manic Miner level is 512 bytes in size. (Although I think the original MM used attribs for the collision map which is a bad idea which I will not do, collision map makes everything much easier and you can have platforms and walls any colour you like then, even invisible). Different coloured versions of the same tile will count as different tiles though I think.
There will be a maximum of 16 different tile types (including blank, so 15 really) per level. My last version of this only had 10 tile types per level but I think 16 would make the engine better. I could also have different tiles for keys so they don't have to be all the same?
Main reason for the 16 tiles per level restriction is I store information about the crumbly tiles in the top 4 bits (and some other bits are used as flags if the tile is not crumbly IIRC). JSW does not have crumbly tiles though (I'm not interested in doing a rewrite of JSW though, I much prefer Manic Miner).
I will do the top Willy with an alternate sprite which is always locked to the ground and I will draw a dummy floor tomorrow I think, so we can decide what looks best (or we could have both depending on whether you are moving or not?).
Sprites already use up 512 bytes of available memory. (Which is approx 40K). So that's about 1/80th of the RAM already gone.
Next up we need a collision map since Willy needs to move in front of platforms without erasing them. The erase function needs to copy tiles from the collision map instead of just erasing the cells. Collision map for a standard Manic Miner level is 512 bytes in size. (Although I think the original MM used attribs for the collision map which is a bad idea which I will not do, collision map makes everything much easier and you can have platforms and walls any colour you like then, even invisible). Different coloured versions of the same tile will count as different tiles though I think.
There will be a maximum of 16 different tile types (including blank, so 15 really) per level. My last version of this only had 10 tile types per level but I think 16 would make the engine better. I could also have different tiles for keys so they don't have to be all the same?
Main reason for the 16 tiles per level restriction is I store information about the crumbly tiles in the top 4 bits (and some other bits are used as flags if the tile is not crumbly IIRC). JSW does not have crumbly tiles though (I'm not interested in doing a rewrite of JSW though, I much prefer Manic Miner).
- ParadigmShifter
- Dynamite Dan
- Posts: 1296
- Joined: Sat Sep 09, 2023 4:55 am
Re: how about a more modern miner willy sprite?
Other stuff about MM engine (and where JSW handles it differently I think)
I only need to logically OR Willy with the background (and when erasing copy background tiles before drawing willy), since guardian sprites never overlap each other or the scenery (I think that is also true in JSW? Not sure about overlapping the scenery - maybe some enemies do - need to special case that if it can occur). That means guardians can be drawn quicker than Willy.
In Manic Miner, enemies never go into cells containing keys and never overlap platforms (I know that in JSW guardians can move into cells with keys - at least the horizontal guardians anyway - the rabbit thing in the ballroom on the conveyor belt) - which means MM can draw horizontal guardians faster since I can just set the attribs to same ink and same paper to erase sprites rather than set 32 bytes on screen to 0.
I can make vertical guardians erase where they were previously drawn quicker than erasing their entire last position, another win. That would not apply if they could move diagonally though (I think some guardians in JSW or JSW2 move diagonally?) - those would need another sprite draw routine. (EDIT: Maybe? Maybe it would be fine, it is beer o'clock).
Conveyor belts are a bit weird in MM and JSW, they roll the top row one way and the third row the other way IIRC. Conveyors need to update their graphics every frame though (at least the 2 rows that change anyway). I could completely redraw and animate them maybe... or I could at least allow which rows are rolled to be specified on a per-level basis (which is easy). My old engine allowed any number of conveyors (MM only allows 1 conveyor per screen) and they don't have to be contiguous either - which is a limitation of the original MM code which I improved upon. EDIT: All conveyors had to move the same way though, which isn't too hard to change either really.
The exit is always drawn since in the Endorian Forest one of the guardians moves behind the exit and willy can stand in the exit too (exit overwrites anything underneath so Willy is not logically ORd with the exit).
Willy has to use a slow drawing method since it needs to logically OR what is on the screen I think. Other guardians can abuse the stack to blit them to screen really fast. That would mean they would have to be drawn before willy though I think (beer o'clock again though).
I only need to logically OR Willy with the background (and when erasing copy background tiles before drawing willy), since guardian sprites never overlap each other or the scenery (I think that is also true in JSW? Not sure about overlapping the scenery - maybe some enemies do - need to special case that if it can occur). That means guardians can be drawn quicker than Willy.
In Manic Miner, enemies never go into cells containing keys and never overlap platforms (I know that in JSW guardians can move into cells with keys - at least the horizontal guardians anyway - the rabbit thing in the ballroom on the conveyor belt) - which means MM can draw horizontal guardians faster since I can just set the attribs to same ink and same paper to erase sprites rather than set 32 bytes on screen to 0.
I can make vertical guardians erase where they were previously drawn quicker than erasing their entire last position, another win. That would not apply if they could move diagonally though (I think some guardians in JSW or JSW2 move diagonally?) - those would need another sprite draw routine. (EDIT: Maybe? Maybe it would be fine, it is beer o'clock).
Conveyor belts are a bit weird in MM and JSW, they roll the top row one way and the third row the other way IIRC. Conveyors need to update their graphics every frame though (at least the 2 rows that change anyway). I could completely redraw and animate them maybe... or I could at least allow which rows are rolled to be specified on a per-level basis (which is easy). My old engine allowed any number of conveyors (MM only allows 1 conveyor per screen) and they don't have to be contiguous either - which is a limitation of the original MM code which I improved upon. EDIT: All conveyors had to move the same way though, which isn't too hard to change either really.
The exit is always drawn since in the Endorian Forest one of the guardians moves behind the exit and willy can stand in the exit too (exit overwrites anything underneath so Willy is not logically ORd with the exit).
Willy has to use a slow drawing method since it needs to logically OR what is on the screen I think. Other guardians can abuse the stack to blit them to screen really fast. That would mean they would have to be drawn before willy though I think (beer o'clock again though).
- ParadigmShifter
- Dynamite Dan
- Posts: 1296
- Joined: Sat Sep 09, 2023 4:55 am
Re: how about a more modern miner willy sprite?
Not done the walking in the proper direction but I did work out that I had to reverse the order of the mirrored sprites, so here is double moonwalking Dr. Willio
![Image](https://i.postimg.cc/brXgXNvm/moonwalk.gif)
Walking in the opposite direction is of course very easy now I worked that out, but it is late.
Code: Select all
ORGADDR EQU #8000
; sjasmplus.exe --sym=out.sym --syntax=f --raw=out.bin modernmm.asm
ORG ORGADDR
DISPLAY "ORIGIN ", /A, ORGADDR
SCRBASE EQU #4000
MACRO DWXYTOSCRADDR _x_, _y_
dw SCRBASE + (((_y_)|((_y_&#C0)>>3))<<8)|((_x_F)|((_y_&)<<2))
ENDM
MACRO SETBORDER bdr
ld a, bdr
out (#FE), a
ENDM
main:
SETBORDER 7
halt
SETBORDER 2
ld hl, willy_oldpos
ld a, (hl)
and ~7
rrca
rrca
rrca
ld c, a
inc l
ld a, (hl)
and ~7
rrca
rrca
rrca
ld b, a
call erase16x16ra
ld hl, willy_xpos
ld a, (hl)
ld d, a
and 7
rrca
rrca
rrca
ld e, a
ld a, d
and ~7
rrca
rrca
rrca
ld c, a
inc l
ld a, (hl)
and ~7
rrca
rrca
rrca
ld b, a
ld d, gfx_willy0/256
call sprite16x16ra
ld hl, willy_oldpos
ld a, (hl)
and ~7
rrca
rrca
rrca
ld c, a
inc l
ld a, (hl)
sub 24
and ~7
rrca
rrca
rrca
ld b, a
call erase16x16ra
ld hl, willy_xpos
ld a, (hl)
ld d, a
and 7
rrca
rrca
rrca
ld e, a
ld a, d
and ~7
rrca
rrca
rrca
ld c, a
inc l
ld a, (hl)
sub 24
and ~7
rrca
rrca
rrca
ld b, a
ld d, gfx_willy8/256
call sprite16x16ra
SETBORDER 4
ld de, willy_oldpos
ld hl, willy_xpos
ldi
ldi
call read_keyboard
ld hl, willy_xpos
ld a, (hl)
add c
ld (hl), a
jp main
ret
; B: row (in character cells, so [0-23])
; C: column
sprite16x16ra:
ld a, b
add b ; A = B*2
ld h, tbl_rows/256 ; high byte of screen address lookup table. Aligned 256 so low byte will be just row*2
ld l, a ; index into table
ld a, (hl) ; low byte of screen address
inc l ; point HL to high byte of screen address
ld h, (hl) ; read high byte of screen address
add c ; add on column to low byte of screen address
ld l, a ; and write it back. HL now holds correct screen address
; so we now know the address...
; HL: screen address
sprite16x16raKnowAddr:
REPT 8
ld a, (de)
inc e ; ok because gfx data is 8 byte aligned
or (hl)
ld (hl), a
inc l
ld a, (de)
inc e ; ok because gfx data is 8 byte aligned
or (hl)
ld (hl), a
inc h ; next row of pixels down
dec l
ENDR
; we could split this into 2 routines depending on whether we straddle a screen third boundary or not
; which we could work out before calling
; then we could remove the jr c
ld a, #20
add l
ld l, a
jr c, .ok
ld a, h
sub #8
ld h, a
.ok
REPT 7
ld a, (de)
inc e ; ok because gfx data is 8 byte aligned
or (hl)
ld (hl), a
inc l
ld a, (de)
inc e ; ok because gfx data is 8 byte aligned
or (hl)
ld (hl), a
inc h ; next row of pixels down
dec l
ENDR
; last row, don't need to increment gfx data pointer or screen row
ld a, (de)
inc e ; ok because gfx data is 8 byte aligned
or (hl)
ld (hl), a
inc l
ld a, (de)
or (hl)
ld (hl), a
ret
; B: row (in character cells, so [0-23])
; C: column
erase16x16ra:
ld a, b
add b ; A = B*2
ld h, tbl_rows/256 ; high byte of screen address lookup table. Aligned 256 so low byte will be just row*2
ld l, a ; index into table
ld a, (hl) ; low byte of screen address
inc l ; point HL to high byte of screen address
ld h, (hl) ; read high byte of screen address
add c ; add on column to low byte of screen address
ld l, a ; and write it back. HL now holds correct screen address
; so we now know the address...
; HL: screen address
erase16x16raKnowAddr:
xor a
REPT 8
ld (hl), a
inc l
ld (hl), a
inc h ; next row of pixels down
dec l
ENDR
; we could split this into 2 routines depending on whether we straddle a screen third boundary or not
; which we could work out before calling
; then we could remove the jr c
ld a, #20
add l
ld l, a
jr c, .ok
ld a, h
sub #8
ld h, a
.ok
xor a
REPT 7
ld (hl), a
inc l
ld (hl), a
inc h ; next row of pixels down
dec l
ENDR
ld (hl), a
inc l
ld (hl), a
ret
; at exit, C contains 1 if we pressed right and -1 if we pressed left
read_keyboard:
; Read these ports to scan keyboard
; bit N (0-based) is clear if the key is being pressed
; #FE - SHIFT, Z, X, C, & V
; #FD - A, S, D, F, & G
; #FB - Q, W, E, R, & T
; #F7 - 1, 2, 3, 4, & 5
; #EF - 0, 9, 8, 7, & 6
; #DF - P, O, I, U, & Y
; #BF - ENTER, L, K, J, & H
; #7F - SPACE, FULL-STOP, M, N, & B
; ld a, port
; in a, (#FE)
; to do the read of the port
ld bc, 0
; are we pressing W?
ld a, #FB
in a, (#FE)
bit 1, a
jr nz, .notpressingW
inc c
.notpressingW
; are we pressing Q?
bit 0, a
jr nz, .notpressingQ
dec c
.notpressingQ
ret
ALIGN 256
gfx_willy0
dg .....##......... ;0
dg ..##.##......... ;1
dg .##............. ;2
dg .#..#........... ;3
dg ..###.#......... ;4
dg ...###.......... ;5
dg ................ ;6
dg .##.#.#......... ;7
dg #...###......... ;8
dg #....###........ ;9
dg .....###........ ;10
dg ###.###......... ;11
dg ##.#####........ ;12
dg ...##.##........ ;13
dg ................ ;14
dg ...###.#........ ;15
gfx_willy1
dg ......##........ ;0
dg ...##.##........ ;1
dg ..##............ ;2
dg ..#..#.......... ;3
dg ...###.#........ ;4
dg ....###......... ;5
dg ..##............ ;6
dg .#...#.#........ ;7
dg .....###........ ;8
dg .#....###....... ;9
dg ####..###....... ;10
dg ###..###........ ;11
dg ...###.##....... ;12
dg ...##........... ;13
dg .......###...... ;14
dg ...###.......... ;15
gfx_willy2
dg .......##....... ;0
dg ....##.##....... ;1
dg ...##........... ;2
dg ...#..#......... ;3
dg ....###.#....... ;4
dg .....###........ ;5
dg ...##........... ;6
dg ..#...#.#....... ;7
dg ..#...###....... ;8
dg ...###.###...... ;9
dg ..###..###...... ;10
dg ...#..###....... ;11
dg ....###......... ;12
dg ....##..###..... ;13
dg ...#............ ;14
dg ...##........... ;15
gfx_willy3
dg ........##...... ;0
dg .....##.##...... ;1
dg ....##.......... ;2
dg ....#..#........ ;3
dg .....###.#...... ;4
dg ......###....... ;5
dg .....#.......... ;6
dg ....#...#....... ;7
dg ....#.#..#...... ;8
dg .....###.##..... ;9
dg ......##.##..... ;10
dg ........##...... ;11
dg ....#.##..#..... ;12
dg ....#.#..###.... ;13
dg ....#........... ;14
dg ................ ;15
gfx_willy4
dg .........##..... ;0
dg ......##.##..... ;1
dg .....##......... ;2
dg .....#..#....... ;3
dg ......###.#..... ;4
dg .......###...... ;5
dg ......#......... ;6
dg .....#.......... ;7
dg .....#....#..... ;8
dg ......#..####... ;9
dg .......#..###... ;10
dg .....#.......... ;11
dg .....#.##....... ;12
dg .....#....###... ;13
dg ................ ;14
dg ................ ;15
gfx_willy5
dg ................ ;0
dg ..........##.... ;1
dg .......##.##.... ;2
dg ......##........ ;3
dg ......#..#...... ;4
dg .......###.#.... ;5
dg ........###..... ;6
dg .......#........ ;7
dg ......#......... ;8
dg ......#....#.... ;9
dg .......##.####.. ;10
dg .....#...#.###.. ;11
dg .....#.##....... ;12
dg .....#..####.... ;13
dg ................ ;14
dg ..........###... ;15
gfx_willy6
dg ................ ;0
dg ...........##... ;1
dg ........##.##... ;2
dg .......##....... ;3
dg .......#..#..... ;4
dg ........###.#... ;5
dg .........###.... ;6
dg ........#....... ;7
dg .......#........ ;8
dg .......#..#..... ;9
dg ........#.##.... ;10
dg .......#..##.... ;11
dg ......##.#..#... ;12
dg ......#...##.... ;13
dg ................ ;14
dg ..........###... ;15
gfx_willy7
dg .............##. ;0
dg ..........##.##. ;1
dg .........##..... ;2
dg .........#..#... ;3
dg ..........###.#. ;4
dg ...........###.. ;5
dg ................ ;6
dg .........#..#... ;7
dg ........#....#.. ;8
dg ........#.#..##. ;9
dg .........###.##. ;10
dg ..........##.##. ;11
dg ............###. ;12
dg ...........###.. ;13
dg ................ ;14
dg ...........###.. ;15
gfx_willy8
dg .##............. ;0
dg .##.##.......... ;1
dg .....##......... ;2
dg ...#..#......... ;3
dg .#.###.......... ;4
dg ..###........... ;5
dg ................ ;6
dg ...#..#......... ;7
dg ..#....#........ ;8
dg .##....#........ ;9
dg .##...#......... ;10
dg .##..###........ ;11
dg .###.##......... ;12
dg ..###........... ;13
dg ................ ;14
dg ..###........... ;15
gfx_willy9
dg ................ ;0
dg ...##........... ;1
dg ...##.##........ ;2
dg .......##....... ;3
dg .....#..#....... ;4
dg ...#.###........ ;5
dg ....###......... ;6
dg .......#........ ;7
dg ........#....... ;8
dg .....#..#....... ;9
dg ....##.#........ ;10
dg ....##..#....... ;11
dg ...#..#.##...... ;12
dg ....##...#...... ;13
dg ................ ;14
dg ...###.......... ;15
gfx_willy10
dg ................ ;0
dg ....##.......... ;1
dg ....##.##....... ;2
dg ........##...... ;3
dg ......#..#...... ;4
dg ....#.###....... ;5
dg .....###........ ;6
dg ........#....... ;7
dg .........#...... ;8
dg ....#....#...... ;9
dg ..####.##....... ;10
dg ..###.#...#..... ;11
dg .......##.#..... ;12
dg ....####..#..... ;13
dg ................ ;14
dg ...###.......... ;15
gfx_willy11
dg .....##......... ;0
dg .....##.##...... ;1
dg .........##..... ;2
dg .......#..#..... ;3
dg .....#.###...... ;4
dg ......###....... ;5
dg .........#...... ;6
dg ..........#..... ;7
dg .....#....#..... ;8
dg ...####..#...... ;9
dg ...###..#....... ;10
dg ..........#..... ;11
dg .......##.#..... ;12
dg ...###....#..... ;13
dg ................ ;14
dg ................ ;15
gfx_willy12
dg ......##........ ;0
dg ......##.##..... ;1
dg ..........##.... ;2
dg ........#..#.... ;3
dg ......#.###..... ;4
dg .......###...... ;5
dg ..........#..... ;6
dg .......#...#.... ;7
dg ......#..#.#.... ;8
dg .....##.###..... ;9
dg .....##.##...... ;10
dg ......##........ ;11
dg .....#..##.#.... ;12
dg ....###..#.#.... ;13
dg ...........#.... ;14
dg ................ ;15
gfx_willy13
dg .......##....... ;0
dg .......##.##.... ;1
dg ...........##... ;2
dg .........#..#... ;3
dg .......#.###.... ;4
dg ........###..... ;5
dg ...........##... ;6
dg .......#.#...#.. ;7
dg .......###...#.. ;8
dg ......###.###... ;9
dg ......###..###.. ;10
dg .......###..#... ;11
dg .........###.... ;12
dg .....###..##.... ;13
dg ............#... ;14
dg ...........##... ;15
gfx_willy14
dg ........##...... ;0
dg ........##.##... ;1
dg ............##.. ;2
dg ..........#..#.. ;3
dg ........#.###... ;4
dg .........###.... ;5
dg ............##.. ;6
dg ........#.#...#. ;7
dg ........###..... ;8
dg .......###....#. ;9
dg .......###..#### ;10
dg ........###..### ;11
dg .......##.###... ;12
dg ...........##... ;13
dg ......###....... ;14
dg ..........###... ;15
gfx_willy15
dg .........##..... ;0
dg .........##.##.. ;1
dg .............##. ;2
dg ...........#..#. ;3
dg .........#.###.. ;4
dg ..........###... ;5
dg ................ ;6
dg .........#.#.##. ;7
dg .........###...# ;8
dg ........###....# ;9
dg ........###..... ;10
dg .........###.### ;11
dg ........#####.## ;12
dg ........##.##... ;13
dg ................ ;14
dg ........#.###... ;15
ALIGN 256
tbl_rows
REPT 24, row
DWXYTOSCRADDR 0, row*8
ENDR
ALIGN 2
willy_xpos db 0
willy_ypos db 104
willy_oldpos db 0, 104
IF 0
dg ................ ;0
dg ................ ;1
dg ................ ;2
dg ................ ;3
dg ................ ;4
dg ................ ;5
dg ................ ;6
dg ................ ;7
dg ................ ;8
dg ................ ;9
dg ................ ;10
dg ................ ;11
dg ................ ;12
dg ................ ;13
dg ................ ;14
dg ................ ;15
ENDIF
![Image](https://i.postimg.cc/brXgXNvm/moonwalk.gif)
Walking in the opposite direction is of course very easy now I worked that out, but it is late.
Re: how about a more modern miner willy sprite?
It's looking great even with inverted ATTR. Great work fellas.
Deserves a Technician Ted style loader![Mr. Green :mrgreen:](./images/smilies/icon_mrgreen.gif)
Deserves a Technician Ted style loader
![Mr. Green :mrgreen:](./images/smilies/icon_mrgreen.gif)
- gabriele amore
- Microbot
- Posts: 183
- Joined: Thu Apr 16, 2020 11:28 pm
- Location: Palermo
Re: how about a more modern miner willy sprite?
please don't hate me but i thoght the white shirt looked better
also made a small improvement to the connection between last and first frame (first frame being also the standing willie)
![Image](https://i.postimg.cc/hzshH8Bj/manic-miner-moders-8-frames.jpg)
also made a small improvement to the connection between last and first frame (first frame being also the standing willie)
![Image](https://i.postimg.cc/hzshH8Bj/manic-miner-moders-8-frames.jpg)
Get my AY games here https://www.dropbox.com/sh/tfo83j5lzwmh ... Kkk7a?dl=0
- ParadigmShifter
- Dynamite Dan
- Posts: 1296
- Joined: Sat Sep 09, 2023 4:55 am
Re: how about a more modern miner willy sprite?
I can add those on a compile time switch. I'll have to manually rip the graphics again though, unless there's a better way to do that.
While I am still doing my Japanese Kanji for the day you may want to have a look at BasinC which can apparently take a screengrab and export as various different formats...
Unless you want to brave and turn them into DG statements yourself while you are waiting.
See my last posted code for the format I am using and order of the 16 frames.
Today I will get the movement right left working and add some simple collision (so you will be able to be blocked by walls), also so Willy can pass behind platforms in the foreground (in the proper MM way and not the crappy JSW2 way which XORs the sprites with the background - ugh!). May also do spiky cells (AKA fire cells) which kill Willy when entering the cell.
Once that is working I will look at dropping off ledges. Once that is working I will add jumping and the rest of the movement code.
I will also try doing a speed test, most number of enemies on a level is 8 (Amoebatrons' Revenge) so I will see how quickly I can draw 8 enemies and Willy. I may also drop the tune in since that uses a lot of frame time (when it actually plays a note - which is every 4 frames I think). I think it uses up to a third of the frame time that though lol.
EDIT: I'm still not convinced by having frames where Willy is off the ground though, which as I said will also affect the jump animation.
While I am still doing my Japanese Kanji for the day you may want to have a look at BasinC which can apparently take a screengrab and export as various different formats...
Unless you want to brave and turn them into DG statements yourself while you are waiting.
See my last posted code for the format I am using and order of the 16 frames.
Today I will get the movement right left working and add some simple collision (so you will be able to be blocked by walls), also so Willy can pass behind platforms in the foreground (in the proper MM way and not the crappy JSW2 way which XORs the sprites with the background - ugh!). May also do spiky cells (AKA fire cells) which kill Willy when entering the cell.
Once that is working I will look at dropping off ledges. Once that is working I will add jumping and the rest of the movement code.
I will also try doing a speed test, most number of enemies on a level is 8 (Amoebatrons' Revenge) so I will see how quickly I can draw 8 enemies and Willy. I may also drop the tune in since that uses a lot of frame time (when it actually plays a note - which is every 4 frames I think). I think it uses up to a third of the frame time that though lol.
EDIT: I'm still not convinced by having frames where Willy is off the ground though, which as I said will also affect the jump animation.
-
- Manic Miner
- Posts: 396
- Joined: Sun Nov 12, 2017 3:54 pm
Re: how about a more modern miner willy sprite?
Just a wee post to say I think the new Miner Willy is looking great. Going to the animation, there’s something not quite right about it, though, and I think it’s the standing frame that slightly “breaks” it. Obvs in the original, Willy seems to walk more rather than running with any haste, which makes sense due to to time limit, at least with having him walk you’ll at least have 1 foot on the ground at all times.
As for the jump, I take it you can’t have a totally different 8 frames for jumping?
As for the jump, I take it you can’t have a totally different 8 frames for jumping?
- gabriele amore
- Microbot
- Posts: 183
- Joined: Thu Apr 16, 2020 11:28 pm
- Location: Palermo
Re: how about a more modern miner willy sprite?
you are right: something is not right with the animation and probably it is that frist frame...redballoon wrote: ↑Sun Jun 23, 2024 3:19 pm Just a wee post to say I think the new Miner Willy is looking great. Going to the animation, there’s something not quite right about it, though, and I think it’s the standing frame that slightly “breaks” it. Obvs in the original, Willy seems to walk more rather than running with any haste, which makes sense due to to time limit, at least with having him walk you’ll at least have 1 foot on the ground at all times.
As for the jump, I take it you can’t have a totally different 8 frames for jumping?
any help to fix that will be appreciated
@ParadigmShifter I have no rush to do anything with these frames .. no intention to write a game or such
so take your time if you are willing to use them and if you make any mod I would like you to make sure the overall look is that one
Last edited by gabriele amore on Sun Jun 23, 2024 3:29 pm, edited 4 times in total.
Get my AY games here https://www.dropbox.com/sh/tfo83j5lzwmh ... Kkk7a?dl=0
- ParadigmShifter
- Dynamite Dan
- Posts: 1296
- Joined: Sat Sep 09, 2023 4:55 am
Re: how about a more modern miner willy sprite?
I'll do 2 versions of each sprite set - one with foot on ground at all times (will just move the graphics down a row or 2 if required) so we can see which one we prefer. Once I draw some dummy platforms underneath the walking test we will get a better idea of how things are going.redballoon wrote: ↑Sun Jun 23, 2024 3:19 pm Just a wee post to say I think the new Miner Willy is looking great. Going to the animation, there’s something not quite right about it, though, and I think it’s the standing frame that slightly “breaks” it. Obvs in the original, Willy seems to walk more rather than running with any haste, which makes sense due to to time limit, at least with having him walk you’ll
At least have 1 foot on the ground at all times.
It may be possible to store some data about the offset required to place Willy on the ground, which would mean I wouldn't have to copy all the frames, which would allow me to do either depending on whether you are running or walking? That's more advanced though and isn't needed at the moment but I might consider it.
EDIT: I'll probably do some code before adding new sprite data then if you want to tweak it, and do the sprite data after beer o'clock.
- Lee P
- Manic Miner
- Posts: 252
- Joined: Fri Jan 05, 2018 9:47 am
- Location: Face down in the last ditch
- Contact:
Re: how about a more modern miner willy sprite?
Once you're ready, I'd be happy to have a go on your Willy, even if it's really hard and I only manage to last thirty seconds (SNIIIIIIIP - knob gag police)ParadigmShifter wrote: ↑Sat Jun 22, 2024 10:02 pm I'm not very good at playing Manic Miner either we'd need testers once I get the gameplay in. Last time I tried I gave up on Revenge of the Mutant Kong Beast I thinkAnd harder levels to come (I don't like Skylabs, Warehouse or Solar Power Generator those are the hardest I think. Telephones is quite tricky too (but I managed to do that the other day when doing some research).
- ParadigmShifter
- Dynamite Dan
- Posts: 1296
- Joined: Sat Sep 09, 2023 4:55 am
Re: how about a more modern miner willy sprite?
Ok so I am still using sprites from yesterday for now.
![Image](https://i.postimg.cc/C14s3XcW/groundtest.png)
The sprite on the top always has feet on the ground.
Sprite below is sprites from yesterday, which has foot off the ground for 2 frames in the anim cycle.
* Willy facing implemented
* Some test floor and walls have been drawn, in glorious technicolour (temp code)
* Movement stops when you hit a wall (temp code)
Next up: Add a collision map and make the erase function draw the collision map contents instead of blanking the cells. That will allow Willy to walk in front of platforms.
![Image](https://i.postimg.cc/C14s3XcW/groundtest.png)
The sprite on the top always has feet on the ground.
Sprite below is sprites from yesterday, which has foot off the ground for 2 frames in the anim cycle.
* Willy facing implemented
* Some test floor and walls have been drawn, in glorious technicolour (temp code)
* Movement stops when you hit a wall (temp code)
Code: Select all
ORGADDR EQU #8000
; sjasmplus.exe --sym=out.sym --syntax=f --raw=out.bin modernmm.asm
ORG ORGADDR
DISPLAY "ORIGIN ", /A, ORGADDR
SCRBASE EQU #4000
ATTRIBS EQU #5800
TIMING EQU 1
MACRO DWXYTOSCRADDR _x_, _y_
dw SCRBASE + (((_y_)|((_y_&#C0)>>3))<<8)|((_x_F)|((_y_&)<<2))
ENDM
MACRO SETBORDER bdr
ld a, bdr
out (#FE), a
ENDM
main:
call draw_level
mainloop:
IF TIMING
SETBORDER 7
ENDIF
halt
IF TIMING
SETBORDER 2
ENDIF
ld hl, willy_oldpos
ld a, (hl)
and ~7
rrca
rrca
rrca
ld c, a
inc l
ld a, (hl)
and ~7
rrca
rrca
rrca
ld b, a
call erase16x16ra
ld hl, willy_xpos
ld a, (hl)
ld d, a
and 7
rrca
rrca
rrca
ld e, a
ld a, d
and ~7
rrca
rrca
rrca
ld c, a
inc l
ld a, (hl)
and ~7
rrca
rrca
rrca
ld b, a
ld d, gfx_willy0/256
ld a, (willy_facing)
dec a
jr z, .dontadjustdbottomsprite
inc d
.dontadjustdbottomsprite
call sprite16x16ra
ld hl, willy_oldpos
ld a, (hl)
and ~7
rrca
rrca
rrca
ld c, a
inc l
ld a, (hl)
sub 32
and ~7
rrca
rrca
rrca
ld b, a
call erase16x16ra
ld hl, willy_xpos
ld a, (hl)
ld d, a
and 7
rrca
rrca
rrca
ld e, a
ld a, d
and ~7
rrca
rrca
rrca
ld c, a
inc l
ld a, (hl)
sub 32
and ~7
rrca
rrca
rrca
ld b, a
ld d, gfx_gwilly0/256
ld a, (willy_facing)
dec a
jr z, .dontadjustdtopsprite
inc d
.dontadjustdtopsprite
call sprite16x16ra
IF TIMING
SETBORDER 4
ENDIF
ld de, willy_oldpos
ld hl, willy_xpos
ldi
ldi
call read_keyboard
ld hl, willy_xpos
ld a, (hl)
add c
cp 8
jr c, .doneupatepos
cp 240
jr nc, .doneupatepos
ld (hl), a
.doneupatepos
jp mainloop
ret
; B: row (in character cells, so [0-23])
; C: column
sprite16x16ra:
ld a, b
add b ; A = B*2
ld h, tbl_rows/256 ; high byte of screen address lookup table. Aligned 256 so low byte will be just row*2
ld l, a ; index into table
ld a, (hl) ; low byte of screen address
inc l ; point HL to high byte of screen address
ld h, (hl) ; read high byte of screen address
add c ; add on column to low byte of screen address
ld l, a ; and write it back. HL now holds correct screen address
; so we now know the address...
; HL: screen address
sprite16x16raKnowAddr:
REPT 8
ld a, (de)
inc e ; ok because gfx data is 8 byte aligned
or (hl)
ld (hl), a
inc l
ld a, (de)
inc e ; ok because gfx data is 8 byte aligned
or (hl)
ld (hl), a
inc h ; next row of pixels down
dec l
ENDR
; we could split this into 2 routines depending on whether we straddle a screen third boundary or not
; which we could work out before calling
; then we could remove the jr c
ld a, #20
add l
ld l, a
jr c, .ok
ld a, h
sub #8
ld h, a
.ok
REPT 7
ld a, (de)
inc e ; ok because gfx data is 8 byte aligned
or (hl)
ld (hl), a
inc l
ld a, (de)
inc e ; ok because gfx data is 8 byte aligned
or (hl)
ld (hl), a
inc h ; next row of pixels down
dec l
ENDR
; last row, don't need to increment gfx data pointer or screen row
ld a, (de)
inc e ; ok because gfx data is 8 byte aligned
or (hl)
ld (hl), a
inc l
ld a, (de)
or (hl)
ld (hl), a
ret
; B: row (in character cells, so [0-23])
; C: column
erase16x16ra:
ld a, b
add b ; A = B*2
ld h, tbl_rows/256 ; high byte of screen address lookup table. Aligned 256 so low byte will be just row*2
ld l, a ; index into table
ld a, (hl) ; low byte of screen address
inc l ; point HL to high byte of screen address
ld h, (hl) ; read high byte of screen address
add c ; add on column to low byte of screen address
ld l, a ; and write it back. HL now holds correct screen address
; so we now know the address...
; HL: screen address
erase16x16raKnowAddr:
xor a
REPT 8
ld (hl), a
inc l
ld (hl), a
inc h ; next row of pixels down
dec l
ENDR
; we could split this into 2 routines depending on whether we straddle a screen third boundary or not
; which we could work out before calling
; then we could remove the jr c
ld a, #20
add l
ld l, a
jr c, .ok
ld a, h
sub #8
ld h, a
.ok
xor a
REPT 7
ld (hl), a
inc l
ld (hl), a
inc h ; next row of pixels down
dec l
ENDR
ld (hl), a
inc l
ld (hl), a
ret
; B: row (in character cells, so [0-23])
; C: column
; DE: 8 rows 8x1 sprite data (8 byte aligned)
sprite8x8a:
ld a, b
add b ; A = B*2
ld h, tbl_rows/256 ; high byte of screen address lookup table. Aligned 256 so low byte will be just row*2
ld l, a ; index into table
ld a, (hl) ; low byte of screen address
inc l ; point HL to high byte of screen address
ld h, (hl) ; read high byte of screen address
add c ; add on column to low byte of screen address
ld l, a ; and write it back. HL now holds correct screen address
; so we now know the address...
; HL: screen address
; DE: 8 rows 8x1 sprite data (8 byte aligned)
sprite8x8aKnowAddr:
REPT 7
ld a, (de)
inc e ; ok because gfx data is 8 byte aligned
or (hl)
ld (hl), a
inc h ; next row of pixels down
ENDR
; last row, don't need to increment gfx data pointer or screen row
ld a, (de)
ld (hl), a
ret
draw_level:
SETBORDER 2
ld a, 7 ; white ink, non bright
call cls
ld b, 30
.floorloop
push bc
ld c, b
ld b, 15
ld de, gfx_platform0
call sprite8x8a
pop bc
ld hl, ATTRIBS+15*32
ld a, l
add b
ld l, a
ld (hl), 64+2 ; bright red
push bc
ld c, b
ld b, 11
ld de, gfx_platform0
call sprite8x8a
pop bc
ld hl, ATTRIBS+11*32
ld a, l
add b
ld l, a
ld (hl), 64+2 ; bright red
djnz .floorloop
ld b, 16
.wallloop
push bc
ld c, 0
dec b
ld de, gfx_wall0
call sprite8x8a
pop bc
ld l, b
dec l
ld h, 0
ld de, ATTRIBS
add hl, hl
add hl, hl
add hl, hl
add hl, hl
add hl, hl
add hl, de
ld (hl), 64+(2*8)+6 ; bright paper, yellow ink
push bc
ld c, 31
dec b
ld de, gfx_wall0
call sprite8x8a
pop bc
ld l, b
dec l
ld h, 0
ld de, ATTRIBS+31
add hl, hl
add hl, hl
add hl, hl
add hl, hl
add hl, hl
add hl, de
ld (hl), 64+(2*8)+6 ; bright paper, yellow ink
djnz .wallloop
ret
; A -> attrib to set when clearing screen
cls:
; set attribs
ld hl, #5800+767
ld de, #5800+766
ld bc, 768
ld (hl), a
lddr
; clear pixels
ld (hl), b ; since B=0 here
ld bc, 6144-1
lddr
ret
; at exit, C contains 1 if we pressed right and -1 if we pressed left
read_keyboard:
; Read these ports to scan keyboard
; bit N (0-based) is clear if the key is being pressed
; #FE - SHIFT, Z, X, C, & V
; #FD - A, S, D, F, & G
; #FB - Q, W, E, R, & T
; #F7 - 1, 2, 3, 4, & 5
; #EF - 0, 9, 8, 7, & 6
; #DF - P, O, I, U, & Y
; #BF - ENTER, L, K, J, & H
; #7F - SPACE, FULL-STOP, M, N, & B
; ld a, port
; in a, (#FE)
; to do the read of the port
ld bc, 0
; are we pressing W?
ld a, #FB
in a, (#FE)
bit 1, a
jr nz, .notpressingW
inc c
.notpressingW
; are we pressing Q?
bit 0, a
jr nz, .notpressingQ
dec c
.notpressingQ
ld a, c
or a
ret z ; not moving
ld hl, willy_facing
ld (hl), c
ret
ALIGN 256
gfx_willy0
dg .....##......... ;0
dg ..##.##......... ;1
dg .##............. ;2
dg .#..#........... ;3
dg ..###.#......... ;4
dg ...###.......... ;5
dg ................ ;6
dg .##.#.#......... ;7
dg #...###......... ;8
dg #....###........ ;9
dg .....###........ ;10
dg ###.###......... ;11
dg ##.#####........ ;12
dg ...##.##........ ;13
dg ................ ;14
dg ...###.#........ ;15
gfx_willy1
dg ......##........ ;0
dg ...##.##........ ;1
dg ..##............ ;2
dg ..#..#.......... ;3
dg ...###.#........ ;4
dg ....###......... ;5
dg ..##............ ;6
dg .#...#.#........ ;7
dg .....###........ ;8
dg .#....###....... ;9
dg ####..###....... ;10
dg ###..###........ ;11
dg ...###.##....... ;12
dg ...##........... ;13
dg .......###...... ;14
dg ...###.......... ;15
gfx_willy2
dg .......##....... ;0
dg ....##.##....... ;1
dg ...##........... ;2
dg ...#..#......... ;3
dg ....###.#....... ;4
dg .....###........ ;5
dg ...##........... ;6
dg ..#...#.#....... ;7
dg ..#...###....... ;8
dg ...###.###...... ;9
dg ..###..###...... ;10
dg ...#..###....... ;11
dg ....###......... ;12
dg ....##..###..... ;13
dg ...#............ ;14
dg ...##........... ;15
gfx_willy3
dg ........##...... ;0
dg .....##.##...... ;1
dg ....##.......... ;2
dg ....#..#........ ;3
dg .....###.#...... ;4
dg ......###....... ;5
dg .....#.......... ;6
dg ....#...#....... ;7
dg ....#.#..#...... ;8
dg .....###.##..... ;9
dg ......##.##..... ;10
dg ........##...... ;11
dg ....#.##..#..... ;12
dg ....#.#..###.... ;13
dg ....#........... ;14
dg ................ ;15
gfx_willy4
dg .........##..... ;0
dg ......##.##..... ;1
dg .....##......... ;2
dg .....#..#....... ;3
dg ......###.#..... ;4
dg .......###...... ;5
dg ......#......... ;6
dg .....#.......... ;7
dg .....#....#..... ;8
dg ......#..####... ;9
dg .......#..###... ;10
dg .....#.......... ;11
dg .....#.##....... ;12
dg .....#....###... ;13
dg ................ ;14
dg ................ ;15
gfx_willy5
dg ................ ;0
dg ..........##.... ;1
dg .......##.##.... ;2
dg ......##........ ;3
dg ......#..#...... ;4
dg .......###.#.... ;5
dg ........###..... ;6
dg .......#........ ;7
dg ......#......... ;8
dg ......#....#.... ;9
dg .......##.####.. ;10
dg .....#...#.###.. ;11
dg .....#.##....... ;12
dg .....#..####.... ;13
dg ................ ;14
dg ..........###... ;15
gfx_willy6
dg ................ ;0
dg ...........##... ;1
dg ........##.##... ;2
dg .......##....... ;3
dg .......#..#..... ;4
dg ........###.#... ;5
dg .........###.... ;6
dg ........#....... ;7
dg .......#........ ;8
dg .......#..#..... ;9
dg ........#.##.... ;10
dg .......#..##.... ;11
dg ......##.#..#... ;12
dg ......#...##.... ;13
dg ................ ;14
dg ..........###... ;15
gfx_willy7
dg .............##. ;0
dg ..........##.##. ;1
dg .........##..... ;2
dg .........#..#... ;3
dg ..........###.#. ;4
dg ...........###.. ;5
dg ................ ;6
dg .........#..#... ;7
dg ........#....#.. ;8
dg ........#.#..##. ;9
dg .........###.##. ;10
dg ..........##.##. ;11
dg ............###. ;12
dg ...........###.. ;13
dg ................ ;14
dg ...........###.. ;15
gfx_willy8
dg .##............. ;0
dg .##.##.......... ;1
dg .....##......... ;2
dg ...#..#......... ;3
dg .#.###.......... ;4
dg ..###........... ;5
dg ................ ;6
dg ...#..#......... ;7
dg ..#....#........ ;8
dg .##....#........ ;9
dg .##...#......... ;10
dg .##..###........ ;11
dg .###.##......... ;12
dg ..###........... ;13
dg ................ ;14
dg ..###........... ;15
gfx_willy9
dg ................ ;0
dg ...##........... ;1
dg ...##.##........ ;2
dg .......##....... ;3
dg .....#..#....... ;4
dg ...#.###........ ;5
dg ....###......... ;6
dg .......#........ ;7
dg ........#....... ;8
dg .....#..#....... ;9
dg ....##.#........ ;10
dg ....##..#....... ;11
dg ...#..#.##...... ;12
dg ....##...#...... ;13
dg ................ ;14
dg ...###.......... ;15
gfx_willy10
dg ................ ;0
dg ....##.......... ;1
dg ....##.##....... ;2
dg ........##...... ;3
dg ......#..#...... ;4
dg ....#.###....... ;5
dg .....###........ ;6
dg ........#....... ;7
dg .........#...... ;8
dg ....#....#...... ;9
dg ..####.##....... ;10
dg ..###.#...#..... ;11
dg .......##.#..... ;12
dg ....####..#..... ;13
dg ................ ;14
dg ...###.......... ;15
gfx_willy11
dg .....##......... ;0
dg .....##.##...... ;1
dg .........##..... ;2
dg .......#..#..... ;3
dg .....#.###...... ;4
dg ......###....... ;5
dg .........#...... ;6
dg ..........#..... ;7
dg .....#....#..... ;8
dg ...####..#...... ;9
dg ...###..#....... ;10
dg ..........#..... ;11
dg .......##.#..... ;12
dg ...###....#..... ;13
dg ................ ;14
dg ................ ;15
gfx_willy12
dg ......##........ ;0
dg ......##.##..... ;1
dg ..........##.... ;2
dg ........#..#.... ;3
dg ......#.###..... ;4
dg .......###...... ;5
dg ..........#..... ;6
dg .......#...#.... ;7
dg ......#..#.#.... ;8
dg .....##.###..... ;9
dg .....##.##...... ;10
dg ......##........ ;11
dg .....#..##.#.... ;12
dg ....###..#.#.... ;13
dg ...........#.... ;14
dg ................ ;15
gfx_willy13
dg .......##....... ;0
dg .......##.##.... ;1
dg ...........##... ;2
dg .........#..#... ;3
dg .......#.###.... ;4
dg ........###..... ;5
dg ...........##... ;6
dg .......#.#...#.. ;7
dg .......###...#.. ;8
dg ......###.###... ;9
dg ......###..###.. ;10
dg .......###..#... ;11
dg .........###.... ;12
dg .....###..##.... ;13
dg ............#... ;14
dg ...........##... ;15
gfx_willy14
dg ........##...... ;0
dg ........##.##... ;1
dg ............##.. ;2
dg ..........#..#.. ;3
dg ........#.###... ;4
dg .........###.... ;5
dg ............##.. ;6
dg ........#.#...#. ;7
dg ........###..... ;8
dg .......###....#. ;9
dg .......###..#### ;10
dg ........###..### ;11
dg .......##.###... ;12
dg ...........##... ;13
dg ......###....... ;14
dg ..........###... ;15
gfx_willy15
dg .........##..... ;0
dg .........##.##.. ;1
dg .............##. ;2
dg ...........#..#. ;3
dg .........#.###.. ;4
dg ..........###... ;5
dg ................ ;6
dg .........#.#.##. ;7
dg .........###...# ;8
dg ........###....# ;9
dg ........###..... ;10
dg .........###.### ;11
dg ........#####.## ;12
dg ........##.##... ;13
dg ................ ;14
dg ........#.###... ;15
gfx_gwilly0
dg .....##......... ;0
dg ..##.##......... ;1
dg .##............. ;2
dg .#..#........... ;3
dg ..###.#......... ;4
dg ...###.......... ;5
dg ................ ;6
dg .##.#.#......... ;7
dg #...###......... ;8
dg #....###........ ;9
dg .....###........ ;10
dg ###.###......... ;11
dg ##.#####........ ;12
dg ...##.##........ ;13
dg ................ ;14
dg ...###.#........ ;15
gfx_gwilly1
dg ......##........ ;0
dg ...##.##........ ;1
dg ..##............ ;2
dg ..#..#.......... ;3
dg ...###.#........ ;4
dg ....###......... ;5
dg ..##............ ;6
dg .#...#.#........ ;7
dg .....###........ ;8
dg .#....###....... ;9
dg ####..###....... ;10
dg ###..###........ ;11
dg ...###.##....... ;12
dg ...##........... ;13
dg .......###...... ;14
dg ...###.......... ;15
gfx_gwilly2
dg .......##....... ;0
dg ....##.##....... ;1
dg ...##........... ;2
dg ...#..#......... ;3
dg ....###.#....... ;4
dg .....###........ ;5
dg ...##........... ;6
dg ..#...#.#....... ;7
dg ..#...###....... ;8
dg ...###.###...... ;9
dg ..###..###...... ;10
dg ...#..###....... ;11
dg ....###......... ;12
dg ....##..###..... ;13
dg ...#............ ;14
dg ...##........... ;15
gfx_gwilly3
dg ................ ;0
dg ........##...... ;1
dg .....##.##...... ;2
dg ....##.......... ;3
dg ....#..#........ ;4
dg .....###.#...... ;5
dg ......###....... ;6
dg .....#.......... ;7
dg ....#...#....... ;8
dg ....#.#..#...... ;9
dg .....###.##..... ;10
dg ......##.##..... ;11
dg ........##...... ;12
dg ....#.##..#..... ;13
dg ....#.#..###.... ;14
dg ....#........... ;15
gfx_gwilly4
dg ................ ;0
dg ................ ;1
dg .........##..... ;2
dg ......##.##..... ;3
dg .....##......... ;4
dg .....#..#....... ;5
dg ......###.#..... ;6
dg .......###...... ;7
dg ......#......... ;8
dg .....#.......... ;9
dg .....#....#..... ;10
dg ......#..####... ;11
dg .......#..###... ;12
dg .....#.......... ;13
dg .....#.##....... ;14
dg .....#....###... ;15
gfx_gwilly5
dg ................ ;0
dg ..........##.... ;1
dg .......##.##.... ;2
dg ......##........ ;3
dg ......#..#...... ;4
dg .......###.#.... ;5
dg ........###..... ;6
dg .......#........ ;7
dg ......#......... ;8
dg ......#....#.... ;9
dg .......##.####.. ;10
dg .....#...#.###.. ;11
dg .....#.##....... ;12
dg .....#..####.... ;13
dg ................ ;14
dg ..........###... ;15
gfx_gwilly6
dg ................ ;0
dg ...........##... ;1
dg ........##.##... ;2
dg .......##....... ;3
dg .......#..#..... ;4
dg ........###.#... ;5
dg .........###.... ;6
dg ........#....... ;7
dg .......#........ ;8
dg .......#..#..... ;9
dg ........#.##.... ;10
dg .......#..##.... ;11
dg ......##.#..#... ;12
dg ......#...##.... ;13
dg ................ ;14
dg ..........###... ;15
gfx_gwilly7
dg .............##. ;0
dg ..........##.##. ;1
dg .........##..... ;2
dg .........#..#... ;3
dg ..........###.#. ;4
dg ...........###.. ;5
dg ................ ;6
dg .........#..#... ;7
dg ........#....#.. ;8
dg ........#.#..##. ;9
dg .........###.##. ;10
dg ..........##.##. ;11
dg ............###. ;12
dg ...........###.. ;13
dg ................ ;14
dg ...........###.. ;15
gfx_gwilly8
dg .##............. ;0
dg .##.##.......... ;1
dg .....##......... ;2
dg ...#..#......... ;3
dg .#.###.......... ;4
dg ..###........... ;5
dg ................ ;6
dg ...#..#......... ;7
dg ..#....#........ ;8
dg .##....#........ ;9
dg .##...#......... ;10
dg .##..###........ ;11
dg .###.##......... ;12
dg ..###........... ;13
dg ................ ;14
dg ..###........... ;15
gfx_gwilly9
dg ................ ;0
dg ...##........... ;1
dg ...##.##........ ;2
dg .......##....... ;3
dg .....#..#....... ;4
dg ...#.###........ ;5
dg ....###......... ;6
dg .......#........ ;7
dg ........#....... ;8
dg .....#..#....... ;9
dg ....##.#........ ;10
dg ....##..#....... ;11
dg ...#..#.##...... ;12
dg ....##...#...... ;13
dg ................ ;14
dg ...###.......... ;15
gfx_gwilly10
dg ................ ;0
dg ....##.......... ;1
dg ....##.##....... ;2
dg ........##...... ;3
dg ......#..#...... ;4
dg ....#.###....... ;5
dg .....###........ ;6
dg ........#....... ;7
dg .........#...... ;8
dg ....#....#...... ;9
dg ..####.##....... ;10
dg ..###.#...#..... ;11
dg .......##.#..... ;12
dg ....####..#..... ;13
dg ................ ;14
dg ...###.......... ;15
gfx_gwilly11
dg ................ ;0
dg ................ ;1
dg .....##......... ;2
dg .....##.##...... ;3
dg .........##..... ;4
dg .......#..#..... ;5
dg .....#.###...... ;6
dg ......###....... ;7
dg .........#...... ;8
dg ..........#..... ;9
dg .....#....#..... ;10
dg ...####..#...... ;11
dg ...###..#....... ;12
dg ..........#..... ;13
dg .......##.#..... ;14
dg ...###....#..... ;15
gfx_gwilly12
dg ................ ;0
dg ......##........ ;1
dg ......##.##..... ;2
dg ..........##.... ;3
dg ........#..#.... ;4
dg ......#.###..... ;5
dg .......###...... ;6
dg ..........#..... ;7
dg .......#...#.... ;8
dg ......#..#.#.... ;9
dg .....##.###..... ;10
dg .....##.##...... ;11
dg ......##........ ;12
dg .....#..##.#.... ;13
dg ....###..#.#.... ;14
dg ...........#.... ;15
gfx_gwilly13
dg .......##....... ;0
dg .......##.##.... ;1
dg ...........##... ;2
dg .........#..#... ;3
dg .......#.###.... ;4
dg ........###..... ;5
dg ...........##... ;6
dg .......#.#...#.. ;7
dg .......###...#.. ;8
dg ......###.###... ;9
dg ......###..###.. ;10
dg .......###..#... ;11
dg .........###.... ;12
dg .....###..##.... ;13
dg ............#... ;14
dg ...........##... ;15
gfx_gwilly14
dg ........##...... ;0
dg ........##.##... ;1
dg ............##.. ;2
dg ..........#..#.. ;3
dg ........#.###... ;4
dg .........###.... ;5
dg ............##.. ;6
dg ........#.#...#. ;7
dg ........###..... ;8
dg .......###....#. ;9
dg .......###..#### ;10
dg ........###..### ;11
dg .......##.###... ;12
dg ...........##... ;13
dg ......###....... ;14
dg ..........###... ;15
gfx_gwilly15
dg .........##..... ;0
dg .........##.##.. ;1
dg .............##. ;2
dg ...........#..#. ;3
dg .........#.###.. ;4
dg ..........###... ;5
dg ................ ;6
dg .........#.#.##. ;7
dg .........###...# ;8
dg ........###....# ;9
dg ........###..... ;10
dg .........###.### ;11
dg ........#####.## ;12
dg ........##.##... ;13
dg ................ ;14
dg ........#.###... ;15
gfx_8x8page:
gfx_blank BLOCK 8 ; sprite0
gfx_platform0 ; Spectrum platform sprite1
dg ######## ; ff
dg ######## ; ff
dg ##.##.## ; db
dg ###.###. ; ee
dg ##...#.# ; c5
dg .#...... ; 40
dg ........ ; 00
dg ........ ; 00
gfx_wall0 ; Spectrum wall sprite2
dg ..#...#. ; 22
dg ######## ; ff
dg #...#... ; 88
dg ######## ; ff
dg ..#...#. ; 22
dg ######## ; ff
dg #...#... ; 88
dg ######## ; ff
ALIGN 256
tbl_rows
REPT 24, row
DWXYTOSCRADDR 0, row*8
ENDR
ALIGN 2
willy_xpos db 8
willy_ypos db 104
willy_oldpos db 8, 104
willy_facing db 1 ; facing. 1 for right, -1 for left
IF 0
dg ................ ;0
dg ................ ;1
dg ................ ;2
dg ................ ;3
dg ................ ;4
dg ................ ;5
dg ................ ;6
dg ................ ;7
dg ................ ;8
dg ................ ;9
dg ................ ;10
dg ................ ;11
dg ................ ;12
dg ................ ;13
dg ................ ;14
dg ................ ;15
ENDIF