1
0
Fork 0
mirror of https://github.com/notwa/mm synced 2024-05-18 05:23:22 -07:00

remove read-3/write-3 functions

This commit is contained in:
Connor Olding 2015-12-03 02:50:31 -08:00
parent b2817c9b5c
commit fcbedca20f
6 changed files with 49 additions and 23 deletions

View File

@ -1,8 +1,18 @@
return {
lottery_numbers = {
AL(0x1370, 3),
AL(0x1373, 3),
AL(0x1376, 3),
{
AL(0x1370, 1),
AL(0x1371, 1),
AL(0x1372, 1),
}, {
AL(0x1373, 1),
AL(0x1374, 1),
AL(0x1375, 1),
}, {
AL(0x1376, 1),
AL(0x1377, 1),
AL(0x1378, 1),
},
},
spider_mask_order = {
AL(0x1379, 1),

View File

@ -1,8 +1,18 @@
return {
lottery_numbers = {
AL(0x1370, 3),
AL(0x1373, 3),
AL(0x1376, 3),
{
AL(0x1370, 1),
AL(0x1371, 1),
AL(0x1372, 1),
}, {
AL(0x1373, 1),
AL(0x1374, 1),
AL(0x1375, 1),
}, {
AL(0x1376, 1),
AL(0x1377, 1),
AL(0x1378, 1),
},
},
spider_mask_order = {
AL(0x1379, 1),

View File

@ -169,9 +169,19 @@ return {
AL(0xFEB, 1),
},
lottery_numbers = {
AL(0xFEC, 3),
AL(0xFEF, 3),
AL(0xFF2, 3),
{
AL(0xFEC, 1),
AL(0xFED, 1),
AL(0xFEE, 1),
}, {
AL(0xFEF, 1),
AL(0xFF0, 1),
AL(0xFF1, 1),
}, {
AL(0xFF2, 1),
AL(0xFF3, 1),
AL(0xFF4, 1),
},
},
spider_mask_order = {
AL(0xFF5, 1), -- 0: red; 1: blue; 2: green; 3: yellow

View File

@ -62,7 +62,7 @@ return {
--magic_beans_avail = AL(0x9B, 1),
tunic_boots = AL(0x9C, 1),
sword_shield = AL(0x9D, 1),
upgrades = AL(0xA1, 3),
upgrades = AL(0xA0, 4),
quest_items = AL(0xA4, 4),
doubled_hearts = AL(0xCF, 1), -- set to 20 by the game
scene_flags_save = AL(0xD4, 0xB0C), -- 0x1C each

View File

@ -9,19 +9,16 @@ if bizstring then
R1 = mm.readbyte
R2 = mm.read_u16_be
R3 = mm.read_u24_be
R4 = mm.read_u32_be
RF = function(addr) return mm.readfloat(addr, true) end
W1 = mm.writebyte
W2 = mm.write_u16_be
W3 = mm.write_u24_be
W4 = mm.write_u32_be
WF = function(addr, value) mm.writefloat(addr, value, true) end
X1 = m.readbyte
X2 = m.read_u16_be
X3 = m.read_u24_be
X4 = m.read_u32_be
XF = function(addr) return m.readfloat(addr, true) end
else
@ -30,19 +27,16 @@ else
local rom = 0x90000000 -- might be wrong for upper 32MB of 64MB roms?
R1 = function(addr) return m64p.memory:read(addr+ram, 'u8') end
R2 = function(addr) return m64p.memory:read(addr+ram, 'u16') end
R3 = unimplemented
R4 = function(addr) return m64p.memory:read(addr+ram, 'u32') end
RF = function(addr) return m64p.memory:read(addr+ram, 'float') end
W1 = function(addr, value) m64p.memory:write(addr+ram, 'u8', value) end
W2 = function(addr, value) m64p.memory:write(addr+ram, 'u16', value) end
W3 = unimplemented
W4 = function(addr, value) m64p.memory:write(addr+ram, 'u32', value) end
WF = function(addr, value) m64p.memory:write(addr+ram, 'float', value) end
X1 = function(addr) return m64p.memory:read(addr+rom, 'u8') end
X2 = function(addr) return m64p.memory:read(addr+rom, 'u16') end
X3 = unimplemented
X4 = function(addr) return m64p.memory:read(addr+rom, 'u32') end
XF = function(addr) return m64p.memory:read(addr+rom, 'float') end
end
@ -53,9 +47,6 @@ end
local H2 = function(self, value)
return value and W2(self.addr, value) or R2(self.addr)
end
local H3 = function(self, value)
return value and W3(self.addr, value) or R3(self.addr)
end
local H4 = function(self, value)
return value and W4(self.addr, value) or R4(self.addr)
end
@ -66,7 +57,6 @@ end
local mts = {
[1] = {__call = H1},
[2] = {__call = H2},
[3] = {__call = H3},
[4] = {__call = H4},
['f'] = {__call = HF},
}

View File

@ -53,9 +53,15 @@ else
a.map_visited (0xFFFF)
a.banked_rupees (5000)
a.lottery_numbers[1](1*0x10000 + 2*0x100 + 3)
a.lottery_numbers[2](4*0x10000 + 5*0x100 + 6)
a.lottery_numbers[3](7*0x10000 + 8*0x100 + 9)
a.lottery_numbers[1][1](1)
a.lottery_numbers[1][2](2)
a.lottery_numbers[1][3](3)
a.lottery_numbers[2][1](4)
a.lottery_numbers[2][2](5)
a.lottery_numbers[2][3](6)
a.lottery_numbers[3][1](7)
a.lottery_numbers[3][2](8)
a.lottery_numbers[3][3](9)
a.spider_mask_order[1](0)
a.spider_mask_order[2](0)
a.spider_mask_order[3](0)