LycanLambda wrote:Whoa, quite alot to digest. I understood a good bit, but most of it is still over my head to some degree, I'll bookmark this entire thread for future use

Don't you give up on HiROM just yet!

Once you understand the basic concept, along with its main difference as compared to LoROM, it's in fact not rocket science.
After fiddling around with my PowerPak code for some time, I managed to completely convert the project to HiROM. Works great!
Some things you have to take care of when doing HiROM are dummy jumps (see the dev. manual, can't remember the page right now, but it's mentioned somewhere in there), like the one at the beginning of Vblank, as well as setting up the data bank register correctly.
You probably won't notice from the screenshot, but reworking the text engine has actually been the hardest part. It was definitely worth it, though. Thanks to a rewritten data bank access, my new text routine is able to process strings from anywhere within the ROM.
I'm not releasing the project as of now, but here's the ROM structure code in case you want to try again. Note the START_OFFSET define, which is crucial -- I'm not really sure why, but the ROM won't work at all if you set START_OFFSET to anything below $8000. Also, you need to change the DBR to $00 just before your initialization routine, and the latter should include a
lda #$01 : sta $420D, which sets Memory-2 area to 3.58 MHz (FastROM).
Code: Select all
; ****************************** Defines *******************************
.BASE $C0
.DEFINE START_OFFSET $F000
.EMPTYFILL $FF
; ********************** ROM makeup, SNES header ***********************
.MEMORYMAP
DEFAULTSLOT 0
SLOTSIZE $10000
SLOT 0 $0000
.ENDME
.ROMBANKMAP
BANKSTOTAL 8
BANKSIZE $10000 ; ROM banks are 64 KBytes in size
BANKS 8 ; 8 ROM banks = 4Mbit
.ENDRO
.SNESHEADER ; this also calculates ROM checksum & complement
ID "SNES"
NAME "RAMSIS' HIROM DEMO "
HIROM
FASTROM
CARTRIDGETYPE $00
ROMSIZE $09
SRAMSIZE $00
COUNTRY $01
LICENSEECODE $33
VERSION $00
.ENDSNES
.BANK 0 SLOT 0
.ORG START_OFFSET + $FB0
.DB "00" ; new licensee code
; *************************** Vector tables ****************************
.SNESNATIVEVECTOR
COP EmptyHandler
BRK EmptyHandler
ABORT EmptyHandler
NMI VBlank
UNUSED $0000
IRQ EmptyHandler
.ENDNATIVEVECTOR
.SNESEMUVECTOR
COP EmptyHandler
UNUSED $0000
ABORT EmptyHandler
NMI EmptyHandler
RESET Startup
IRQBRK EmptyHandler
.ENDEMUVECTOR
.BANK 0 SLOT 0
.ORG START_OFFSET
.SECTION "EmptyVectors" SEMIFREE
EmptyHandler:
rti
.ENDS
; ************************** Global variables **************************
.INCLUDE "global_variables.asm"
; ********************** Library routines, macros **********************
.BANK 0 SLOT 0
.ORG 0
.SECTION "InitSNESCode" FORCE
.INCLUDE "hirom_initsnes.inc.asm"
.ENDS
.SECTION "Joypads" SEMIFREE
.INCLUDE "hirom_joypads.inc.asm"
.ENDS
.BANK 0 SLOT 0
.ORG START_OFFSET
.SECTION "ScreenSetup" SEMIFREE
.INCLUDE "hirom_setup.inc.asm" ; screen setup, Vblank, etc.
.ENDS
.SECTION "SpriteInit"
.INCLUDE "hirom_sprites.inc.asm"
.ENDS
; **************************** Main program ****************************
.BANK 0 SLOT 0
.ORG START_OFFSET + $FA0
.SECTION "begin" FORCE
Startup:
sei ; disable interrupts
clc
xce ; switch to native mode
jml Main
.ENDS
.BANK 0 SLOT 0
.ORG 0
.SECTION "MainCode" SEMIFREE
.INCLUDE "hirom_maincode.inc.asm"
.INCLUDE "hirom_text.inc.asm"
.ENDS
; *************************** Graphics data ****************************
.BANK 1 SLOT 0
.ORG 0
.SECTION "CharacterData"
.INCLUDE "hirom_gfxdata.inc" ; sprites, fonts, palettes
.ENDS
; ****************************** Strings *******************************
.BANK 2 SLOT 0
.ORG 0
.SECTION "TextStrings"
.INCLUDE "hirom_textstrings.inc" ; raw text
.ENDS
Good luck, and have fun!
