Skip to content

Commit

Permalink
Resolve issue with highscore sync reported by Justin De Lucia
Browse files Browse the repository at this point in the history
Updated to version 1.4
  • Loading branch information
10yard committed Aug 3, 2023
1 parent 2c474a4 commit cc00031
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build_version.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set version=v1.2
set version=v1.4

set zip_path="C:\Program Files\7-Zip\7z"
del releases\galakong_plugin_%version%.zip
Expand Down
25 changes: 16 additions & 9 deletions galakong/init.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- GalaKong: A Galaga Themed Shoot 'Em Up Plugin for Donkey Kong (and Donkey Kong Junior)
-- by Jon Wilson (10yard)
--
-- Tested with latest MAME version 0.245
-- Tested with latest MAME version 0.254
-- Fully compatible with all MAME versions from 0.227
--
-- Jumpman is assisted by an accompanying ship which can take out barrels, fireballs, firefoxes, pies and springs.
Expand All @@ -28,7 +28,7 @@
-----------------------------------------------------------------------------------------
local exports = {}
exports.name = "galakong"
exports.version = "1.3"
exports.version = "1.4"
exports.description = "GalaKong: A Galaga Themed Shoot 'Em Up Plugin for Donkey Kong (and Donkey Kong Junior)"
exports.license = "GNU GPLv3"
exports.author = { name = "Jon Wilson (10yard)" }
Expand Down Expand Up @@ -744,16 +744,23 @@ function galakong.startplugin()
mem:write_u8(0x6a33, 256 - missile_y)
last_bonus = _frame

--7 digits for the calculation purposes incase we tick over the million
--7 digits for the calculation purposes incase we tick over the million
score = _format("%07d", tonumber(get_score_segment(0x60b4)..get_score_segment(0x60b3)..get_score_segment(0x60b2)) + bonus)
--update 6 digit score in ram
score = _sub(score, 2, 7)
set_score_segment(0x60b4, _sub(score, 1,2))
set_score_segment(0x60b4, _sub(score, 1,2)) --update score in ram
set_score_segment(0x60b3, _sub(score, 3,4))
set_score_segment(0x60b2, _sub(score, 5,6))

-- update score on screen
write_ram_message(0x7781, score)
set_score_segment(0x60b2, _sub(score, 5,6))
write_ram_message(0x7781, score) --update score on screen

-- update high score when necessary
high_score = _format("%06d", tonumber(get_score_segment(0x60ba)..get_score_segment(0x60b9)..get_score_segment(0x60b8)))
if tonumber(score) >= tonumber(high_score) then
-- update high score on screen
set_score_segment(0x60ba, _sub(score, 1,2)) --update score in ram
set_score_segment(0x60b9, _sub(score, 3,4))
set_score_segment(0x60b8, _sub(score, 5,6))
write_ram_message(0x7641, score) --update score on screen
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion galakong/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"plugin": {
"name": "galakong",
"description": "GalaKong: A Galaga Themed Shoot 'Em Up Plugin for Donkey Kong",
"version": "1.3",
"version": "1.4",
"author": "Jon Wilson (10yard)",
"type": "plugin",
"start": "false"
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# **GalaKong: A Galaga Themed Shoot 'Em Up Plugin for Donkey Kong (and Donkey Kong Junior)** #

Tested with latest MAME version 0.244
Tested with latest MAME version 0.254

Fully compatible with all MAME versions from 0.227

Expand Down

0 comments on commit cc00031

Please sign in to comment.