Skip to content

Commit

Permalink
Add script to package up the release
Browse files Browse the repository at this point in the history
  • Loading branch information
10yard committed Aug 24, 2021
1 parent 27a7d25 commit 4d0230a
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 67 deletions.
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v0.1
10 changes: 10 additions & 0 deletions build_package.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
echo ----------------------------------------------------------------------------------------------
echo Package the dkcoach plugin
echo ----------------------------------------------------------------------------------------------
copy readme.md dkcoach\ /Y

echo **** package into a release ZIP getting the version from version.txt
set /p version=<VERSION
set zip_path="C:\Program Files\7-Zip\7z"
del releases\dkcoach_plugin_%version%.zip
%zip_path% a releases\dkcoach_plugin_%version%.zip .\dkcoach\*
120 changes: 61 additions & 59 deletions dkcoach/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

local exports = {}
exports.name = "dkcoach"
exports.version = "0.1.0"
exports.version = "0.1"
exports.description = "Donkey Kong Coach"
exports.license = "GNU GPLv3"
exports.author = { name = "Jon Wilson (10yard)" }
Expand Down Expand Up @@ -114,71 +114,73 @@ function dkcoach.startplugin()
end

function spring_coach()
if mem:read_u8(0xc600a) == 0xc and help_setting > 1 then -- During gameplay

-- Change Jumpman's start position to focus coaching on DK's Girder.
if mem:read_u8(0x694c) == default_start_x and mem:read_u8(0x694f) == default_start_y then
write_message(0x75ed, "START ")
write_message(0x75ee, "HERE__")
change_jumpman_position(coach_start_x, coach_start_y)
else
if mem:read_u8(0x694f) < 112 then
write_message(0x75ed, " ")
write_message(0x75ee, " ")
if mem:read_u8(0xc600a) == 0xc then
if help_setting > 1 then -- During gameplay

-- Change Jumpman's start position to focus coaching on DK's Girder.
if mem:read_u8(0x694c) == default_start_x and mem:read_u8(0x694f) == default_start_y then
write_message(0x75ed, "START ")
write_message(0x75ee, "HERE__")
change_jumpman_position(coach_start_x, coach_start_y)
else
if mem:read_u8(0x694f) < 112 then
write_message(0x75ed, " ")
write_message(0x75ee, " ")
end
end
end

if help_setting == 3 then
-- Draw safe spots. Box includes a transparent bottom so you can reference jumpman's feet. Feet need to stay within box to be safe.
draw_zone("spring-safe", 185, 148, 168, 168)
draw_zone("spring-safe", 185, 100, 168, 118)
end
if help_setting == 3 then
-- Draw safe spots. Box includes a transparent bottom so you can reference jumpman's feet. Feet need to stay within box to be safe.
draw_zone("spring-safe", 185, 148, 168, 168)
draw_zone("spring-safe", 185, 100, 168, 118)
end

-- Determine the spring type (0-15) of generated springs
for _, address in pairs({0x6500, 0x6510, 0x6520, 0x6530, 0x6540, 0x6550}) do
local s_x = mem:read_u8(address + 3)
local s_y = mem:read_u8(address + 5)
if s_y == 80 then -- y start position of new springs is always 80
if s_x >= 248 then -- x start position is between 248 and 7
s_type = s_x - 248
elseif s_x <= 7 then
s_type = s_x + 8
-- Determine the spring type (0-15) of generated springs
for _, address in pairs({0x6500, 0x6510, 0x6520, 0x6530, 0x6540, 0x6550}) do
local s_x = mem:read_u8(address + 3)
local s_y = mem:read_u8(address + 5)
if s_y == 80 then -- y start position of new springs is always 80
if s_x >= 248 then -- x start position is between 248 and 7
s_type = s_x - 248
elseif s_x <= 7 then
s_type = s_x + 8
end
end
if (s_x >= 130 and s_x < 170 and s_y == 80) or s_type_trailing == nil or mem:read_i8(0x6229) < 4 then
-- Remember type of the trailing string.
s_type_trailing = s_type
end
end
if (s_x >= 130 and s_x < 170 and s_y == 80) or s_type_trailing == nil or mem:read_i8(0x6229) < 4 then
-- Remember type of the trailing string.
s_type_trailing = s_type
end
end

if s_type ~= nil then
-- Update screen with spring info
write_message(0x77a5, "T="..string.format("%02d", s_type))
write_message(0x77a6, " ")
if s_type >= 13 then
write_message(0x77a6, "'LONG'")
elseif s_type <= 6 then
write_message(0x77a6, "'SHORT'")
end
if help_setting == 3 then
--1st and 2nd bounce boxes use the latest spring type.
draw_zone("spring-hazard", 183, 20 + s_type, 168, 33 + s_type)
draw_zone("spring-hazard", 183, 20 + s_type + 50, 168, 33 + s_type + 50)
--3rd bounce box uses the trailing spring type on levels 4 and above
draw_zone("spring-hazard", 183, 20 + s_type_trailing + 100, 168, 33 + s_type_trailing + 100)
if s_type ~= nil then
-- Update screen with spring info
write_message(0x77a5, "T="..string.format("%02d", s_type))
write_message(0x77a6, " ")
if s_type >= 13 then
write_message(0x77a6, "'LONG'")
elseif s_type <= 6 then
write_message(0x77a6, "'SHORT'")
end
if help_setting == 3 then
--1st and 2nd bounce boxes use the latest spring type.
draw_zone("spring-hazard", 183, 20 + s_type, 168, 33 + s_type)
draw_zone("spring-hazard", 183, 20 + s_type + 50, 168, 33 + s_type + 50)
--3rd bounce box uses the trailing spring type on levels 4 and above
draw_zone("spring-hazard", 183, 20 + s_type_trailing + 100, 168, 33 + s_type_trailing + 100)
end
end
end
else
-- Clear screen info
write_message(0x77a5, " ")
write_message(0x77a6, " ")
write_message(0x75ed, " ")
write_message(0x75ee, " ")

-- Change Jumpman's position back to default if necessary.
if os.clock() - last_help_toggle < 0.05 then
if mem:read_u8(0x694c) == coach_start_x and mem:read_u8(0x694f) == coach_start_y then
change_jumpman_position(default_start_x, default_start_y)
else
-- Clear screen info
write_message(0x77a5, " ")
write_message(0x77a6, " ")
write_message(0x75ed, " ")
write_message(0x75ee, " ")

-- Change Jumpman's position back to default if necessary.
if os.clock() - last_help_toggle < 0.05 then
if mem:read_u8(0x694c) == coach_start_x and mem:read_u8(0x694f) == coach_start_y then
change_jumpman_position(default_start_x, default_start_y)
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion dkcoach/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"plugin": {
"name": "dkcoach",
"description": "Donkey Kong Coach",
"version": "0.1.0",
"version": "0.1",
"author": "Jon Wilson (10yard)",
"type": "plugin",
"start": "false"
Expand Down
33 changes: 26 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
+# **DK Coach** #
# **DK Coach** #

## A MAME plugin to assist with Donkey Kong gameplay

Expand All @@ -7,7 +7,8 @@ Tested with latest MAME version 0.234

At the moment, the plugin only helps you with the springs stage. I plan to add help to other stages.

### Springs Stage

## The Springs/Elevators Stage

The helper visualises the safe zones and danger zones on DK's girder. Information about generated springs helps you make quick decisions on when to make a run and when to sit tight or retreat back to safety.

Expand All @@ -24,7 +25,7 @@ Use "P2 Start" to toggle the helpfulness setting between 2 (Max Help), 1 (Min He
![Screenshot](https://github.com/10yard/dkcoach/blob/master/screenshot.png)


#### Process for progressing on the springs stage level 4+
#### Tips for completing the Springs stage, level 4+

- Navigate Jumpman to the first green safe spot on the far right of DK's girder.
- Move to the left edge of the safe spot, ensuring that Jumpman's feet remain inside the box.
Expand All @@ -36,7 +37,7 @@ Use "P2 Start" to toggle the helpfulness setting between 2 (Max Help), 1 (Min He
- As you become more confident on the springs stage, you should reduce helpers by pressing "P2 Start" button. See "Help Settings" below.


### Help Settings
## Help Settings

The default setting is "Max Help". Toggle the setting by pressing "P2 Start".
- Max Help: All of the available helpers are displayed.
Expand All @@ -46,18 +47,36 @@ The default setting is "Max Help". Toggle the setting by pressing "P2 Start".
As you become more confident with your gameplay, you should reduce help features by pressing "P2 Start" button. Switching from "Max Help" to "Min Help" to "No Help".


### Installing
## Installing and running

The Plugin is installed by copying the "dkcoach" folder into your MAME plugins folder.

The Plugin is activated by adding `-plugin dkcoach` to your mame arguments e.g.
The Plugin is run by adding `-plugin dkcoach` to your MAME arguments e.g.

```mame dkong -plugin dkcoach```

### Next up

## What's next?

Addition of barrel stage helper
- safe zones from wild barrels
- wild barrel alert
- probability of steering barrels down ladders %
- hammer timer countdown


## Thanks to

The Donkey Kong rom hacking resource
https://github.com/furrykef/dkdasm

The MAMEdev team
https://docs.mamedev.org/


## Feedback

Please send feedback to jon123wilson@hotmail.com

Jon

Binary file modified screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4d0230a

Please sign in to comment.