Skip to content

Commit

Permalink
DK Wizardry and DK Accelerate now support a limited HUD with score ta…
Browse files Browse the repository at this point in the history
…rgets shown

Slight increase to DK coin release frequency
Change first 3 machine unlock targets to 1000, 2000, 3000

Improvements suggested by Justin De Lucia:
Add-on download/install screens now feature an animated DK and pauline announces the download percentage progress
When getting the first place prize from a game, Donkey Kong shows his teeth while hoisting the gold trophy.
A mini trophy (gold, silver or bronze) appears next to each machine after a trophy is awarded, indicating the players best achievement. This achievement is stored.  Can the player achieve gold on all machines?
Fix bug with game description being active while jumpman is on a ladder
  • Loading branch information
10yard committed Aug 8, 2024
1 parent 262d395 commit 0a48af1
Show file tree
Hide file tree
Showing 19 changed files with 78 additions and 34 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.65
v0.66
Binary file modified artwork/icon/dkongpauline/dkongpe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/icon/shell/gbcolor_dk_japan_us.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/icon/shell/zx81_kong.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/icon/shell/zx81_krazykong_pss.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/sprite/cka3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/sprite/dka3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/sprite/dkblank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/sprite/pauline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/sprite/sm_cup1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/sprite/sm_cup2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/sprite/sm_cup3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions dk_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
SCORE_START = 500 # How many coins Jumpman starts with
TIMER_START = 8000 # Timer starts countdown from this number
COIN_VALUES = 0, 50, 100 # How many points awarded for collecting a coin. Integer
COIN_FREQUENCY = 3 # How frequently DK will grab a coin (1 = always, 2 = 1/2, 3 = 1/3 etc.)
COIN_FREQUENCY = 2 # How frequently DK will grab a coin (1 = always, 2 = 1/2, 3 = 1/3 etc.)
COIN_HIGH = 4 # Frequency of coin being higher value (1 = always, 2 = 1/2, 3 = 1/3 etc.)
COIN_SPEED = 1.6 # Number of pixels to move coin per display update. Decimal
COIN_CYCLE = 0.15 # How often the coin sprite is updated. Decimal
Expand Down Expand Up @@ -272,7 +272,7 @@
"ckongpt2a_2023")

# Roms that are not fully compatible
HUD_UNFRIENDLY = ["dkongwizardry", "dkongduel", "dkongkonkey", "dkongaccelerate"]
HUD_UNFRIENDLY = ["dkongduel", "dkongkonkey"]
HISCORE_UNFRIENDLY = ["dkongd2k"]
AUTOSTART_UNFRIENDLY = ["dkongduel", "dkongchorus"]
SKIPINTRO_UNFRIENDLY = ["dkongchorus"]
Expand Down
3 changes: 3 additions & 0 deletions dk_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,6 @@

# Playlist
tracklist, trackhistory = [], []

# Achieved Awards
achievements = {}
20 changes: 16 additions & 4 deletions dk_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,11 @@ def install_addons():
return
for addon in reversed(glob("dkafe_*_addon_*.zip")):
# Installing message...
from launch import write_text, update_screen, dk_font, pl_font, RED, GREY
from launch import write_text, update_screen, dk_font, pl_font, RED, GREY, MAGENTA, PINK, get_image
write_text("EXTRACTING ADD-ON PACK", font=dk_font, y=0, fg=RED)
write_text("The console add-on pack is being extracted and installed.", font=pl_font, y=14, fg=RED)
write_text("PLEASE WAIT...", font=dk_font, y=236, fg=RED)
_g.screen.blit(get_image("artwork/sprite/pauline.png"), (0, 215))
write_text("Please wait...", x=22, y=218, bg=MAGENTA, fg=PINK, bubble=True)
pygame.draw.rect(_g.screen, GREY, [0, 245, 224, 8], 0)
update_screen()

Expand All @@ -124,8 +125,19 @@ def install_addons():
file_list = zf.namelist()
for idx, file in enumerate(file_list):
if idx % 5 == 0:
percent = round((idx / len(file_list)) * 100)
pygame.draw.rect(_g.screen, RED, [0, 245, (DISPLAY[0] / 100) * percent, 8], 0)
_progress = round((idx / len(file_list)) * DISPLAY[0])
_percent = (idx / len(file_list)) * 100
_g.screen.blit(get_image("artwork/sprite/dkblank.png"), (167, 205))
if pygame.time.get_ticks() % 5000 < 2000:
_g.screen.blit(get_image("artwork/sprite/dk0.png"), (167, 205))
elif pygame.time.get_ticks() % 5000 < 3000:
_g.screen.blit(get_image("artwork/sprite/dk1.png"), (167, 205))
elif pygame.time.get_ticks() % 5000 < 4000:
_g.screen.blit(get_image("artwork/sprite/dk2.png"), (167, 205))
else:
_g.screen.blit(get_image("artwork/sprite/dk3.png"), (167, 205))
pygame.draw.rect(_g.screen, RED, [0, 245, _progress, 8], 0)
write_text(f'{_percent:.2f}' + "% installed", x=22, y=218, bg=MAGENTA, fg=PINK, bubble=True)
update_screen()
zf.extract(file)
update_screen()
Expand Down
12 changes: 8 additions & 4 deletions interface/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function display_awards(rom_offset)
if emu.romname() == "dkongx11" then
sep = {".", " C."}
end
if data_toggle_hud == 1 then
if data_toggle_hud == 1 or data_subfolder == "dkongwizardry" then
msg1, msg2, msg3 = "1"..sep[1]..data_score1_k, "2"..sep[1]..data_score2_k, "3"..sep[1]..data_score3_k
if data_subfolder == "dkonghrthnt" then
msg1 = " "..sep[1]..data_score1_k -- Workaround alternative palette colour for DK Hearthunt
Expand All @@ -182,9 +182,13 @@ function display_awards(rom_offset)
elseif data_toggle_hud == 3 then
data_toggle_hud = 0
end
write_message(0xc7500 + _rom_offset, msg1)
write_message(0xc7501 + _rom_offset, msg2)
write_message(0xc7502 + _rom_offset, msg3)
if data_subfolder ~= "dkongaccelerate" then -- workaround reduced space for DK Accelerate
write_message(0xc7500 + _rom_offset, msg1)
write_message(0xc7501 + _rom_offset, msg2)
end
if data_subfolder ~= "dkongwizardry" then -- workaround reduced space for DK Wizardry
write_message(0xc7502 + _rom_offset, msg3)
end
end
end

Expand Down
57 changes: 41 additions & 16 deletions launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def exit_program(confirm=False):
for attempt in 1, 2, 3:
try:
with open('save.p', 'wb') as f:
pickle.dump([_g.score, _g.timer_adjust, _g.last_selected], f)
pickle.dump([_g.score, _g.timer_adjust, _g.last_selected, _g.achievements], f)
break
except (EOFError, FileNotFoundError, IOError):
pygame.time.delay(250 * attempt)
Expand Down Expand Up @@ -120,9 +120,9 @@ def update_screen(delay_ms=0):
def load_frontend_state():
try:
with open('save.p', "rb") as f:
_g.score, _g.timer_adjust, _g.last_selected = pickle.load(f)
_g.score, _g.timer_adjust, _g.last_selected, _g.achievements = pickle.load(f)
except (EOFError, FileNotFoundError, IOError, ValueError):
_g.score, _g.timer_adjust = SCORE_START, 0
_g.score, _g.timer_adjust, _g.last_selected, _g.achievements = SCORE_START, 0, None, {}


def check_patches_available():
Expand Down Expand Up @@ -463,12 +463,16 @@ def display_icons(detect_only=False, with_background=False, below_y=None, above_
up_arrow = True

if not detect_only:
if not(_x == 90 and _y == 34):
if img:
_g.screen.blit(img, (_x, _y))
if up_arrow and not _g.ready:
if pygame.time.get_ticks() % 550 < 275:
_g.screen.blit(get_image(f"artwork/sprite/up.png"), (_x+1, _y+22))
if img:
_g.screen.blit(img, (_x, _y))
if sub+name in _g.achievements:
# Show previously awarded trophy against the machine
_tx = _x + (w / 2) - 9
_tx = _tx if _tx > 0 else 0
_g.screen.blit(get_image(f"artwork/sprite/sm_cup{str(_g.achievements[sub+name])}.png"), (_tx, _y + 14))
if up_arrow and not _g.ready:
if pygame.time.get_ticks() % 550 < 275:
_g.screen.blit(get_image(f"artwork/sprite/up.png"), (_x+1, _y+22))
if "-record" in _s.get_emulator(emu).lower() and not _g.showinfo:
# Show recording text above icon
if _g.timer.duration % 2 < 1:
Expand Down Expand Up @@ -732,7 +736,9 @@ def get_addon():
clear_screen()
write_text("DOWNLOADING ADD-ON PACK", font=dk_font, y=0, fg=RED)
write_text("The console add-on pack is being downloaded.", font=pl_font, y=14, fg=RED)
write_text("PLEASE WAIT...", font=dk_font, y=236, fg=RED)
_g.screen.blit(get_image("artwork/sprite/pauline.png"), (0, 215))
_g.screen.blit(get_image("artwork/sprite/dk0.png"), (167, 205))
write_text("Please wait...", x=22, y=218, bg=MAGENTA, fg=PINK, bubble=True)
pygame.draw.rect(_g.screen, GREY, [0, 245, 224, 8], 0)
update_screen()
try:
Expand All @@ -748,12 +754,23 @@ def get_addon():
if chunk:
f.write(chunk)
download_size += chunk_size
if pygame.time.get_ticks() % 50 == 0:
percent = round((download_size / total_size) * 100)
pygame.draw.rect(_g.screen, RED, [0, 245, (DISPLAY[0] / 100) * percent, 8], 0)
if pygame.time.get_ticks() % 30 == 0:
_progress = round((download_size / total_size) * DISPLAY[0])
_percent = (download_size / total_size) * 100
_g.screen.blit(get_image("artwork/sprite/dkblank.png"), (167, 205))
if pygame.time.get_ticks() % 5000 < 2000:
_g.screen.blit(get_image("artwork/sprite/dk0.png"), (167, 205))
elif pygame.time.get_ticks() % 5000 < 3000:
_g.screen.blit(get_image("artwork/sprite/dk1.png"), (167, 205))
elif pygame.time.get_ticks() % 5000 < 4000:
_g.screen.blit(get_image("artwork/sprite/dk2.png"), (167, 205))
else:
_g.screen.blit(get_image("artwork/sprite/dk3.png"), (167, 205))
pygame.draw.rect(_g.screen, RED, [0, 245, _progress, 8], 0)
write_text(f'{_percent:.2f}' + "% downloaded", x=22, y=218, bg=MAGENTA, fg=PINK, bubble=True)
update_screen()

# Allow up to 10 seconds for file to save fully.
# Allow up to 10 seconds for the file to save fully.
for i in range(0, 10):
if os.path.exists(latest_addon_path):
break
Expand Down Expand Up @@ -1136,6 +1153,10 @@ def launch_rom(info, launch_plugin=None, override_emu=None):
_g.timer.reset()
_g.lastexit = _g.timer.duration
_g.timer_adjust = 0
place = get_prize_placing(scored)[0]
if sub+name not in _g.achievements or place < _g.achievements[sub+name]:
# record your best trophy achievement
_g.achievements[sub+name] = place
for i, coin in enumerate(range(0, scored, COIN_VALUES[-1])):
movement = choice([-1, 1]) if _g.stage == 1 else 1
drop_coin(x=COIN_AWARD_POSX[_g.stage], y=i * 2, coin_type=len(COIN_VALUES) - 1, awarded=scored, movement=movement)
Expand Down Expand Up @@ -1305,7 +1326,11 @@ def process_interrupts():
_g.screen.blit(get_image(f"artwork/sprite/{dk_ck()}a1.png"), (11 + _g.dkx, 52 + _g.dky))
_g.screen.blit(get_image(f"artwork/sprite/cup{str(place)}.png"), (33 + _g.dkx, 60 + _g.dky))
else:
_g.screen.blit(get_image(f"artwork/sprite/{dk_ck()}a2.png"), (11 + _g.dkx, 45 + _g.dky))
if place == 1:
# Grinning DK on 1st place trophy
_g.screen.blit(get_image(f"artwork/sprite/{dk_ck()}a3.png"), (11 + _g.dkx, 45 + _g.dky))
else:
_g.screen.blit(get_image(f"artwork/sprite/{dk_ck()}a2.png"), (11 + _g.dkx, 45 + _g.dky))
_g.screen.blit(get_image(f"artwork/sprite/cup{str(place)}.png"), (33 + _g.dkx, 29 + _g.dky))
else:
_g.screen.blit(get_image(f"artwork/sprite/{dk_ck()}0.png"), (11 + _g.dkx, 52 + _g.dky))
Expand Down Expand Up @@ -1373,7 +1398,7 @@ def process_interrupts():
write_text("P1 START", x=108 + _g.psx, y=38 + _g.psy, bg=MAGENTA)

# Display game text
if SHOW_GAMETEXT:
if SHOW_GAMETEXT and not "LADDER_DETECTED" in get_map_info():
selected = sub if sub and sub != "shell" else name
for rom, text_lines in _g.gametext:
if rom == selected and text_lines:
Expand Down
10 changes: 5 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ The latest releases are available to download from below. Refer to the **How to

| Download Link | Version | Operating System |
| -------------------------------------------------------------------------------------------------------------------- | ------- | -------------------------------------------|
| [dkafe_win64_binary_v0.65.zip](https://github.com/10yard/dkafe/releases/download/v0.65/dkafe_win64_binary_v0.65.zip) | 0.65 | Windows 64 bit (x64) systems (Recommended) |
| [dkafe_win32_binary_v0.65.zip](https://github.com/10yard/dkafe/releases/download/v0.65/dkafe_win32_binary_v0.65.zip) | 0.65 | Windows 32 bit (x86) systems |
| [dkafe_win64_binary_v0.66.zip](https://github.com/10yard/dkafe/releases/download/v0.66/dkafe_win64_binary_v0.66.zip) | 0.66 | Windows 64 bit (x64) systems (Recommended) |
| [dkafe_win32_binary_v0.66.zip](https://github.com/10yard/dkafe/releases/download/v0.66/dkafe_win32_binary_v0.66.zip) | 0.66 | Windows 32 bit (x86) systems |
| [dkafe_winxp_binary_v0.64.zip](https://github.com/10yard/dkafe/releases/download/v0.64/dkafe_winxp_binary_v0.64.zip) | 0.64 | Windows XP only |
| [dkafe_rpi4_image_v0.55.gz](https://github.com/10yard/dkafe/releases/download/v0.55/dkafe_rpi4_image_v0.55.gz) | 0.55 | Raspberry Pi 4 and 400 only |

Expand Down Expand Up @@ -47,7 +47,7 @@ If you're not up for the challenge then it is possible to adjust things and have

The frontend can be configured to launch other emulators and roms.

Jumpman can traverse platforms using unbroken ladders and by utilising hammers (to teleport short distances). Jumpman can drop through an oilcan to quickly warp between barrel, rivet and pies stages.
Jumpman can traverse platforms using unbroken ladders and by utilising hammers (to teleport short distances). Jumpman can drop through an oilcan to quickly warp between barrel, rivet, pie and elevator stages.

![NEW Feature](https://github.com/10yard/dkafe/blob/master/artwork/about/new.png)
There is now a console add-on pack which adds extra stages and is packed out with hundreds of Donkey Kong ports, clones and hacks for a myriad of console and computer systems. See **Console Add-On Pack** section below.
Expand All @@ -61,7 +61,7 @@ There is now a console add-on pack which adds extra stages and is packed out wit
- Several Donkey Kong hacks and plugins made by me specifically for use with this frontend.
- A custom lightweight version of WolfMAME built specifically for Donkey Kong, and it's clones and bootlegs.
- MAME plugins and scripts that interface with the frontend to add cool features such as score targets, stage practice and a coaching mode.
- A built in music playlist that features 12 fantastic Donkey Kong remix tracks by default.
- A built in music playlist that features 14 fantastic Donkey Kong remix tracks by default.
- Extensive configuration options.
- An optional console add-on pack featuring over 250 ports, clones and hacks for classic gaming systems.

Expand Down Expand Up @@ -605,7 +605,7 @@ dtoverlay=gpio-key,gpio=26,keycode=1,label="KEY_ESC"
### Music Playlist

You can override the default Donkey Kong background music by setting `ENABLE_PLAYLIST = 1` in the settings.txt file.
12 Donkey Kong music remixes are included by default for your enjoyment - see thank you section below for a list of the included tracks and their creators. These files can be removed and replaced with your own favourite music tracks in **.mp3**, **.ogg** or **.wav** format.
14 Donkey Kong music remixes are included by default for your enjoyment - see thank you section below for a list of the included tracks and their creators. These files can be removed and replaced with your own favourite music tracks in **.mp3**, **.ogg** or **.wav** format.

The "Music Playlist" can also be activated via the frontend settings menu (by pressing the TAB key) or it can be toggle on/off by pressing the CONTROL_PLAYLIST key (p).
When music is playing you can skip to the next track by pressing the CONTROL_SKIP key (s).
Expand Down
4 changes: 2 additions & 2 deletions romlist.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ dkongjr,,DK Junior,,3.1,1,2,,10000,15000,30000
dkong,dkongpies,DK Pies,DK Pies Only,3.2,1,2,,10000,15000,30000
dkong,dkonggalakong,GalaKong,,4,1,2,,20000,40000,60000
dkongx11,dkongspooky,Spooky,DK Spooky Remix,6,1,2,1000,10000,15000,30000
dkong,dkongwizardry,DK Wizard,DK Wizardry,8,1,2,1000,10000,20000,40000
dkong,dkongpacmancross,Pac-X,DK Pac-Man Crossover,9,1,2,2000,8000,15000,30000
dkong,dkongwizardry,DK Wizard,DK Wizardry,8,1,2,2000,10000,20000,40000
dkong,dkongpacmancross,Pac-X,DK Pac-Man Crossover,9,1,2,3000,8000,15000,30000
dkong,dkong40,DK 40!!,DK Anniversary Edition,10,1,2,4000,10000,25000,40000
dkong,dkongspringy,DK Springy,DK Springs Only,11,1,2,6000,10000,15000,30000
dkong,dkonglava,DK Lava,DK Lava Panic!,13,1,2,8000,10000,20000,40000
Expand Down

0 comments on commit 0a48af1

Please sign in to comment.