Advertisement
GenesisFan64

MarsTips

Feb 10th, 2020
429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. If you are making a Homebrew game for the Genesis but you want to port it to the 32X
  2. here's what you need to know:
  3.  
  4. *** NEW HEADER ***
  5.  
  6. A special ROM header is required enable the 32X, it contains a custom boot up sequence
  7. and pointers for transfering the SH2 code (for Master and Slave)
  8.  
  9. - The Entry point ALWAYS points to $3F0, don't change this
  10.  
  11. - The CHECKSUM routine is bundled within the security code,
  12. the byte calculation is -supposedly- to be done in SH2, because on the Genesis side
  13. it checks if the checksum result (at comm8) is the same as the value set in $18E ( if comm8 == ($18E) )
  14. BUT if you don't the time to generate a checksum, you can skip this by setting it to $0000
  15.  
  16. - The SH2 can be located anywhere in the 4MB of ROM, it can point to SDRAM (best way) or ROM (not recommended)
  17.  
  18.  
  19. *** NEW ROM MAPS ****
  20.  
  21. Due to the memory map changes, the Genesis code gets moved to these new locations:
  22.  
  23. $880000
  24. This section shows the first 512KB of the ROM, this is meant for code.
  25. If your game is 512KB or lower then it's fine, but if your game is larger than this, there's the
  26. next location:
  27.  
  28. $900000
  29. This shows a 1MB section of your ROM data, divided into 4 banks (the 4MB maximum)
  30. To change a bank, set your MB section at $A15104, examples:
  31.  
  32. move.w #0,($A15104).l
  33.  
  34. ROM
  35. Data
  36. + ------ +
  37. | Bank 0 | $900000
  38. + ------ + + -------+
  39. | Bank 1 | | |
  40. + -------+ | Bank 0 |
  41. | Bank 2 | | |
  42. + -------+ + -------+
  43. | Bank 3 |
  44. + -------+
  45.  
  46. move.w #2,($A15104).l
  47.  
  48. ROM
  49. Data
  50. + ------ +
  51. | Bank 0 | $900000
  52. + ------ + + -------+
  53. | Bank 1 | | |
  54. + -------+ | Bank 2 |
  55. | Bank 2 | | |
  56. + -------+ + -------+
  57. | Bank 3 |
  58. + -------+
  59.  
  60. But this change causes a new problem:
  61. VDP's ROM-to-VDP transfers still point to $000000-$3FFFFF, to solve this: you have to set the RV bit at
  62. $A15107 (bit 0), this bit temporally reverts the ROM section back to $000000
  63. BUT while this gets active, it will cause the following things:
  64.  
  65. - Lock $880000 and $900000 sections, if you set this bit while on ROM (ex. $880000) the next
  66. instruction will be trash data, to properly set this bit: your code must be running from RAM
  67. - Blocks access to ROM in the SH2 side, if the SH2 tries to read ROM while this bit is enabled, it will halt
  68. until ROM is accessible again (or probably freeze)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement