diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..aa33868 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +v0.1 \ No newline at end of file diff --git a/build_package.bat b/build_package.bat new file mode 100644 index 0000000..5ca7047 --- /dev/null +++ b/build_package.bat @@ -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= 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 diff --git a/dkcoach/plugin.json b/dkcoach/plugin.json index 72b9234..822b140 100644 --- a/dkcoach/plugin.json +++ b/dkcoach/plugin.json @@ -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" diff --git a/readme.md b/readme.md index 4fec894..b3dba2d 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -+# **DK Coach** # +# **DK Coach** # ## A MAME plugin to assist with Donkey Kong gameplay @@ -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. @@ -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. @@ -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. @@ -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 + diff --git a/screenshot.png b/screenshot.png index f52aca8..b7bdcd7 100644 Binary files a/screenshot.png and b/screenshot.png differ