Previous 199869 Revisions Next

r32553 Sunday 5th October, 2014 at 13:39:31 UTC by R. Belmont
awboard: add "offset protection" used by some carts.  samsptk and kofxi boot now.  [R. Belmont, MetalliC]
[src/mame/machine]awboard.c awboard.h

trunk/src/mame/machine/awboard.c
r32552r32553
108108   AM_RANGE(0x08, 0x09) AM_WRITE(mpr_first_file_index_w)
109109   AM_RANGE(0x0a, 0x0b) AM_WRITE(mpr_file_offsetl_w)
110110   AM_RANGE(0x0c, 0x0d) AM_WRITE(mpr_file_offseth_w)
111   AM_RANGE(0x40, 0x41) AM_READWRITE(adj_offset_r, adj_offset_w)
111112ADDRESS_MAP_END
112113
113114aw_rom_board::aw_rom_board(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
r32552r32553
238239   save_item(NAME(mpr_file_offset));
239240   save_item(NAME(dma_offset));
240241   save_item(NAME(dma_limit));
242   save_item(NAME(adjust_off));
241243}
242244
243245void aw_rom_board::device_reset()
r32552r32553
247249   mpr_record_index = 0;
248250   mpr_first_file_index = 0;
249251   mpr_file_offset = 0;
252   adjust_off = 0;
250253
251254   dma_offset = 0;
252255   dma_limit  = 0;
253256}
254257
258READ16_MEMBER(aw_rom_board::adj_offset_r)
259{
260   return adjust_off;
261}
262
263WRITE16_MEMBER(aw_rom_board::adj_offset_w)
264{
265   adjust_off = data;
266}
267
255268WRITE16_MEMBER(aw_rom_board::epr_offsetl_w)
256269{
257270   epr_offset = (epr_offset & 0xffff0000) | data;
r32552r32553
284297
285298WRITE16_MEMBER(aw_rom_board::mpr_file_offseth_w)
286299{
287   mpr_file_offset = (mpr_file_offset & 0x0000ffff) | (data << 16);
300   mpr_file_offset = ((mpr_file_offset & 0x0000ffff) | ((data -(adjust_off*0x0100))<< 16));
301
288302   recalc_dma_offset(MPR_FILE);
289303}
290304
trunk/src/mame/machine/awboard.h
r32552r32553
2222   DECLARE_WRITE16_MEMBER(mpr_first_file_index_w); // 5f7010
2323   DECLARE_WRITE16_MEMBER(mpr_file_offsetl_w);     // 5f7014
2424   DECLARE_WRITE16_MEMBER(mpr_file_offseth_w);     // 5f7018
25   DECLARE_READ16_MEMBER(adj_offset_r);         // 5f7080
26   DECLARE_WRITE16_MEMBER(adj_offset_w);         // 5f7080
2527
2628protected:
2729   virtual void device_start();
r32552r32553
3739   bool region_is_decrypted;
3840
3941   UINT32 epr_offset, mpr_file_offset;
40   UINT16 mpr_record_index, mpr_first_file_index;
42   UINT16 mpr_record_index, mpr_first_file_index, adjust_off;
4143
4244   UINT32 dma_offset, dma_limit;
4345

Previous 199869 Revisions Next


© 1997-2024 The MAME Team