| |
Night Mission Pinball Extended [2024] |
Released At :
KozMOS2024
Achievements :
Mixed Competition at KozMOS2024 : #2
Credits :
Code | .... | Barfly of Extend |
| | Grue of Beyond Force, Extend, Kasettilamerit |
| | TNT of Beyond Force, Kasettilamerit |
Music | .... | The Beasty Boy of Extend, Side B |
Graphics | .... | Duce of Extend, Phonics |
Idea | .... | Argon of Extend |
| | Grue of Beyond Force, Extend, Kasettilamerit |
Crack | .... | Grue of Beyond Force, Extend, Kasettilamerit |
Text | .... | Grue of Beyond Force, Extend, Kasettilamerit |
| | Rakki of Kasettilamerit |
NTSC-Fix | .... | Grue of Beyond Force, Extend, Kasettilamerit |
PAL-Fix | .... | Grue of Beyond Force, Extend, Kasettilamerit |
Bug-Fix | .... | Grue of Beyond Force, Extend, Kasettilamerit |
Loader | .... | Grue of Beyond Force, Extend, Kasettilamerit |
Docs | .... | Grue of Beyond Force, Extend, Kasettilamerit |
| | Rakki of Kasettilamerit |
Test | .... | Argon of Extend |
| | Grue of Beyond Force, Extend, Kasettilamerit |
| | Jmi of Kasettilamerit |
| | Kakka of Accession, Damones, Extend |
| | Rakki of Kasettilamerit |
| | Trurl of Extend |
Help | .... | Rakki of Kasettilamerit |
| | TNT of Beyond Force, Kasettilamerit |
Directory Art | .... | Kakka of Accession, Damones, Extend |
SIDs used in this release :
Download :
Look for downloads on external sites:
Pokefinder.org
Summary Submitted by Grue on 23 March 2024
Night Mission Pinball Extended
My favorite pinball game on the c64. It's from 1983, but it has a-w-e-s-o-m-e sounds (if you had 6581 with distortion and suitable cutoff)
All the ports of the game look quite awful on other platforms also, I always wished it had some color and more polish on it. The release of the C64 version has all the colors added and it looks even more horrible than the original game.
I have been doing (Grue) these game modifications and this time Barfly and Duce agreed to help me with the enormous task. I did the reverse engineering and created the source code for this release.
Copy protection was disk check-based and caused the ball to freeze randomly when the speed limit was calculated. It was pretty trivial to find as the code made just an infinite loop when triggered. Disk routines were so horrible that it was a fast decision to get rid of those and write my own compatible kernel-based routines. All drives should work with any device number.
The game ran in the loop and it wasn't synced to screen draw, there was just a busy loop to limit the ball going too fast and if the routines used more time, the game just got slower and slower instead of running at a constant speed.
So I just removed the busy loop and made the game wait for the next frame instead. To my surprise game ran most of the time just fine 50hz, but some situations took more than that, like using flippers, sometimes it took way over one frame to process. So I changed the code in a way, that if the game routines took more than one frame time, we skip waiting and continue on right away. That made the game run super smooth, even with a multiball game, but it got way slower when there was more than one ball in the game same time.
I started to examine the code in more detail and how it handled the graphics plotting and calculations etc, it became clear that many of the things are precalculated like the angles when the ball hits the table features, but accessing those tables could be optimized so I did. There are way too many things like changing indirect reads/writes into direct self-modded addressing which makes some cycles faster, but when you multiply some cycles with a lot of pixels you get the idea of how much it made the game faster in the end. I also managed to make some address calculations into lookup tables to speed it up even more. Keyboard reading routines of the original game took something like 16-20 lines of raster time, so with help from TNT I managed to squeeze essential controls during the gameplay into less than a line used raster time. That made a big difference in performance. The Original routines are still used when the ball is not on the playfield to maintain compatibility with the original game base. I also found a bug, missing RTS in the part that handles the operation of the flippers, that caused the game to use one extra frame of raster time when the left flipper hit the ball. After fixing that, the multiball game gained a nice speedup as you're using the flipper way more when there's more than one ball on the playfield.
When experimenting with color it became quite obvious that this game doesn't care a shit about an 8x8 grid, so it was quite a painful game to colorize when the ball is plotted into a bitmap. Barfly came up with the idea to put sprites on top of the balls to hide the clashes, and he implemented a nice sprite routine into the game, too bad he didn't have more time to help but I really appreciated that!
The game has this nice feature of plotting ball trails if it moves fast enough and I didn't want to remove it as it looks kind of cool, but you cannot hide the color clashes from the trail. It's a good thing that it doesn't look that bad when the ball itself is not affected.
Adding color is not just a new bitmap, you also need to handle the newly added color dimension and copy color info when it's affected by the graphics. Such things are quite painful to code and try to fit in the original game base code in a way that it won't cause glitching. So, most of the coding time took the boring part of fitting the new graphics into the game. The original game had the option to change the color theme and hires/multicolor mode, but I'm quite sure you'll agree that this new graphical look of the game is better than a crappy hacky way to change colors.
Duce did an almost impossible job on the graphics as the original playfield is not aligned to an 8x8 grid and it would have been wrong to change that, as it would have changed the game mechanics into something completely different which I didn't want to go into.
The original game had a B-17 Bomber on the graphics and the game is called Night Mission Pinball, but in WW2 they didn't use B17's for the Night Missions. So graphics have Lancaster bomber instead in the Gfx. It's all in the details ;)
The Game has a multiball feature where you can have 4 balls on the screen at the same time. 1Mhz C-64 is not up to the task, but we managed to optimize it quite a lot compared to the original release of the game. It has now 2Mhz mode in the border area using the $d030 register to make it go faster, but even with the plain old C64, you get almost the same speed with 3 balls as with just one. If you happen to own a C128 or other cpu speeder which utilizes the $d030 register you can have a smooth 50hz gameplay experience even with 4 balls on the playfield.
Supercpu users can play the original game as we had to use some illegal opcodes to gain more speed, sorry about that. The user base of the plain vanilla C-64 is so much greater than all the combined SuperCPU owners, I hope you'll understand that.
You can tune the filter cutoff with the +/- keys and save the setting with the W-key when the gameplay is not on. On the next session, you can restore settings and a high score with R-key. If you get a new high score, it's saved automatically.
Please note that if you change the SID type in your emulator on the fly while the game is running, you should reload the game as the SID recognition routine is only run once when the game initializes itself so you'll get a more sensible base value for the filter cutoff. 6581 is preferred here as it can resonate and distort the filter in a much more ballsy way if the cutoff is tuned just right.
The game controls are almost the same as in the original, They're not very nice with emulators though, but that's not really my problem as the target audience for this game is C64/C128 users.
C= key = Left flipper
CRSR right = Right flipper
Left Shift = Bumb the table to the right
CRSR dn = Bump the table to the left
F7 = Launch spring. Keep the key down and release for a launch (It is also possible to play with F1 if you're talented enough)
P = Pause
<- = Quit the game
Home = Exit from the FIX menu
Del = Return to the FIX menu only works when a ball is at the launch tube (not in multiball)
Credits:
Code: Grue, Barfly, TNT
Gfx: Duce
Testing: Grue, Rakki, Trurl, Jmi, Kakka, Argon
Quality assurance: Rakki, Trurl, Jmi, Argon
Special thanks to HOK / Remember for the C64 version manual photos
Tools Used:
6502Bench
Ghidra
RetroDebugger
VSCode Editor
64tass
010 Editor
Pixcen
cc1541
Nucrunch
Vice
Ultimate 64
Ide64
Changes:
- Reorganize code for more optimal memory usage
- this is an ongoing endeavor during the development to fill the memory holes.
- Score and balls counter, adjusted for 8x8 block for artistic needs
- Code optimizations for plotting graphics
- this has been ongoing during the development, cycles here and there, sometimes a lot of cycles.
- Sync game screen drawing to counter which is updated each frame to get rid of flashing ball
- this was a major one, resulting in a butter-smooth gameplay experience.
- Enable $d030 acceleration in the borders for C128 and other turbos
- It's now possible to use the cursor up/down to navigate in the FIX menu
- The cursor up key causes the keyboard buffer to trigger twice, a bug in the original game code
- seems to be a strange one, still investigating
- it was working okay, but the Retro debugger did handle it strangely.
- Fixed a bug in FIX screen numbers input check
- it was checking $30-$40 for numbers input string, fixed max value to $3a
- Implemented "tilt bump" effect on the screen with $d016
- The left and right bump keys move the screen in different directions using $d016. The center of the screen is $02
- Ball trails are disabled if there is more than one ball on the screen, in multiball situations
- more cycles to handle more balls with no slowdowns.
- Optimized ball status copy to zp and zp to ball data code, it's called frequently during multiball situations so every saved cycle counts.
- It is also called 2 times for a single ball, in and out during one frame of the gameplay.
- Now only active balls on the screen get their coordinates updated, every cycle counts...
- Found and fixed a bug in the original game code, which caused hitting a ball with the flipper to take more than 1/3 of the available raster time. This is a major performance boost in multi-ball game situations.
- the bug was one missing RTS command which resulted in other code running with faulty register inputs.
- Moved sound effects to run in IRQ to make them run more consistently when the game loop takes more than one frame to update.
- Replaced the original extra slow keyboard reading routine with something more sophisticated during the gameplay, the original routine took over 16 lines of time, new one less than a raster line.
- small fixes in the new keyboard handling
- this resulted later in more and more fixes to get everything to work like expected.
- pause handling was one of the major pains
- The game now starts when the player touches the spring controls, after this is not possible to add credits or more players.
- Balls have now a sprite layer on them to hide color clashes from the underlying bitmap
- sprite balls also move when a tilt bump is used.
- this made the new colorful playfield look acceptable and not like a spectrum game.
- Implemented a quit key, it's ctrl + q. You can Quit the game when it has started, and you need to wait until the ball exits the screen.
- I had to change that to <- key because of the original game keyboard handling, it messed up with the Q key to add more credits.
- You can have a maximum of 10 custom modes, there is no more RAM reserved for them.
- most likely you can only save one of them with a high score, haven't decided yet
- Tilt keys, fist bump is now "free" after that it's a coin toss if you get tilt. After 255 frames first bump is reset.
- The original code was stupid, very stupid. With the original code in competition mode, you got tilt if you hit the control on every 15th frame.
- The tilt sensitivity variable is not used anymore.
- Sid version check and if 8580 it auto-adjusts the cutoff frequency to fit better for 8580, it doesn't sound like 6581, but much better already.
- Kicker kick with more random force to prevent non-realistic looping ball patterns
- force wasn't enough as "random" is calculated using a frame counter.
- implemented a slight random variation to the time the ball is trapped in the kicker before launching back to the playfield.
- Ball launch now Hold and release type, if you don't release, the ball shoots out with maximum force.
- I found another bug in the original game code, RightVThresold wasn't used.
I corrected it, and it's now used. Dunno how useful that is though..
- Added Save and Restore functions. The original game had those too, but they didn't seem to work..
- The W key is for Erite (Save), and the R key is for Restore.
- Only the current active game mode with the high score is saved, if you change mode and write again, the original gets overwritten.
- Transitions are now much more nicer, the screen is closed before the content changes and finished drawing before switching it on again.
- added extra frames to delay, to make transitions look a bit bitter
- Disabled bumpers on the playfield when the game enters TILT, to make the ball fall down faster.
- also more realistic behavior in pinball machines.
- I didn't want to disable every other feature as every extra check makes the code more slow during gameplay
- disabling all the features makes the ball get stuck way too easy
- You can now change the SID filter cut-off with the +/- keys, the chosen cutoff will be included in the save file and restored upon save restore.
- by tuning the filter cut-off value, you can have much better explosions with distortion (if 6581 is used)
- default values might or might not work for you, there is 6581/8580 detection to set preset values.
- Automatic save if you get a new high score
- The score display can now show 6 million stars + active score, if the player gets to 7th million and more, the score is recorded but not shown on the screen.
- The original game did only 4 million
- A million stars changed from bitmap plot to bitmap color, it is a lot faster now
- Fitting color graphics for insert coin, start game, tilt, bomb again screens. The original game engine doesn't support color or didn't have any kind of base bitmap clearing and backup features which are now implemented.
- This took me ages to get working satisfactorily with no glitches, but I think now it behaves.
- Fixed tons of various bugs removed redundant graphics from the game engine and updated old assets to new ones.
- it takes a lot of time to place them on the playfield pixel-perfect and make them work as in the original game.
- Detected SID type is now printed on the title screen
- Detected sid type can now be changed with the C key.
- 10 frames Debounce added for cutoff change keys.
- Removed unused variables from the FIX menu, SelfPlay and Speed Adjust
- Speed Adjust was lost when I changed the game to wait for a new frame instead of a dummy loop-based speed. Speed Adjust was added to this loop duration.
- SelfPlay was a stupid feature, just a bad random flipper movements, I couldn't get myself to fix that after it broke changing the launch spring into press and release type.
- Adjusted variables to change from 38 to 36 in in-game help screens.
- removed one more variable that is not used. ball speed
- now only 35 variables can be changed.
- Fixed Save to work with action replay cartridges.
- it was messing zero page more than I was prepared and I also didn't handle $01 in my IRQ routine that one of the subroutines went into cartridge ROM instead of my own code.
- File operations compatibility fixes
- code now handles also action replay, retro replay and final cartridge 3 cartridge turbos.
- The game mode is now added to the file name. You can now have high scores and custom modes saved. To restore the score and earlier mode, you need to enter the mode first and then press R to load earlier settings and score. If you play as intended and do not change game parameters in the FIX menu, you can forget all this.
- Quit key game over fixes
- you cannot gain more score now if you quit the game
- in the game-over mode gained score is now properly reset before starting a new game.
- Drone sound is now paused in pause mode.
- Fixed a bunch of graphical misbehavior reported by Rakki
- bitmap color updates are now hopefully in sync with actual graphics on the screen.
- hitting quit in different phases of the ball action made some problems.
- Now it's not possible to enter FIX mode if there is a ball on the screen
- if you hit quit when there's a ball in the launch tube, the ball must be launched and allowed to exit the playfield before you can enter FIX mode.
- it might be possible to improve but let's just say that if you made an error, your punishment for that is to wait for the ball to exit the playfield.
- more unrolling of the loops and eliminating some jsr's to speed things up with the cost of using more memory. you need to spend your CPU cycles wisely ;)
- NTSC/PAL check added
- The game now adjusts ball speed limiter -1 when played on the NTSC system.
- this is due to 50/60hz, the game was just too fast on NTSC systems.
- Color effect on the explosion bitmap when we have an explosion in the game.
- WIP, bugs again on once-fixed features.
- 3 color changes, looks smoother now
- The default state of the game changed to make the explosion more effective
- Ball Entropy was the same for each ball on the table, it was possible to make 2 or more balls to share the same properties so they were on top of each other and followed the same route.
- Added random number generator from codebase64 org and changed it in a way that now every ball in the game gets a different value for entropy.
- If you manage to set up the balls on top of each other, it won't stay long anymore.
- Cpu speed test implemented.
- Plain old C64, you can have trails on for just one ball at the same time.
- C128 2Mhz speed you gain ball trails for 2 balls in multiball mode
- faster than that, all the balls have their trails on
- NTSC testing with a retro debugger revealed that the game froze occasionally. It was due to my frame waits: LDA $d012, BNE -
- NTSC doesn't have much lines between $d012 zero values and if your IRQ routine takes more time on some game situations, you might cause a situation where that main PRG never sees the line $0 on $d012...
- A dirty fix for a borderline case, if you manage to hit the quit key, when there is explosion animation going on, it will be ignored.
- file ops feedback can be seen on top of the ball reflection right side of the screen.
- Color will change on every interrupt that occurs.
- Intro created, hires screen with a scroll in the bottom border.
- Created a mask with the last byte of the bank, to give the scroller the same look as in more modern pinball games.
- it cannot be seen with LCD screens due to bad motion handling, on crt it looks awesome
- implemented pause command into scrolltext to show the mask for the LCD lamers.
- Implemented Del key to return to the fix menu, if you are in mode larger than 9
- if you mess up the settings so badly you cannot shoot out of the launch tube, you can go back to fix it.
- if you want to be 100% sure all your changes work, the safest way is to quit the game and start a new one so the settings are updated in all the places they need to be.
- Lots of JSR/RTS calls were removed and moved subroutine code inside the calling routine.
- 12 cycles saved with every JSR/RTS pair
- a lot of those for each ball to calculate and draw
- with 4-ball multiplayer, performance gain is significant
- lots of memory used for very nice performance gains.
- More optimizations, mostly 64tass -Woptimize suggested
- The original game updated all scores every 4th frame
- changed it so that if the game is running, only the current player score is updated
- a lot of CPU cycles saved every 4th frame
- Last minute add-on feature, thanks to Argon / Extend
- Night lane lites now move to the left with the left flipper key
- Originally only the right flipper key moved lites
- Ball trails are enabled always even on 1Mhz C64, code optimizations made that possible.
- You can disable ball trails in the fix menu if you want to experiment with how much it speeds things up |
|
|
|
| Search CSDb |
| Navigate | |
|
| Detailed Info | |
|
| Fun Stuff | |
· Goofs (1)
· Hidden Parts · Trivia
|
|
| Forum | |
|
| Support CSDb | |
|
| |
|