Video: Lesson P29 - Hardware detection and Bank Switching on the Sega Mastersystem/GameGear

The Master System & GameGear are virtually the same hardware!
Post Reply
User avatar
akuyou
Posts: 562
Joined: Mon Apr 22, 2019 3:19 am
Contact:

Video: Lesson P29 - Hardware detection and Bank Switching on the Sega Mastersystem/GameGear

Post by akuyou » Wed Apr 24, 2019 12:31 pm



www.chibiakumas.com/z80/platform3.php#LessonP29

It's time to move onto the consoles, lets see how we can detect the platform we're on, and how to use extra rom banking on those systems
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter! // 「チビ悪魔」可笑しいゴシックSTG ! // Work in Progress: ChibiAliens

Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809

Lee
Posts: 23
Joined: Sun Oct 10, 2021 1:26 am

Re: Video: Lesson P29 - Hardware detection and Bank Switching on the Sega Mastersystem/GameGear

Post by Lee » Mon Dec 12, 2022 10:03 pm

About the video I see you have 8 of 16KB banks or a 128KB cartridge. So org 49152 with 49152=16384*3 would be used to code the start address before the 16KB incbin data block or bank of the 4th 16KB bank in a 128KB master system cartridge and this works.
It basically looks like this in code

org 0000
;;some code
org 49152
incbin "16KB data block"


But how to use org 81920 with 81920=16384*5 for the start address before the 16KB incbin data block of the 5th 16KB bank because 81920 more than a 16bit number so what is the right way to express 81920 used to insert the 16KB incbin for the 5th bank into the program?

User avatar
akuyou
Posts: 562
Joined: Mon Apr 22, 2019 3:19 am
Contact:

Re: Video: Lesson P29 - Hardware detection and Bank Switching on the Sega Mastersystem/GameGear

Post by akuyou » Wed Dec 14, 2022 9:37 am

I don't think you'll be able to specify an org statement with a base over &FFFF

You could try an Align statement to align to the next 16k boundary (align 14 should do it),

The other alternative would be to split the project into multiple built binary files, and join the files using the binary copy commands to combine them into the final cartridge.
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter! // 「チビ悪魔」可笑しいゴシックSTG ! // Work in Progress: ChibiAliens

Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809

Post Reply

Return to “Master System & GameGear Assembly Programming”