Using 32x as a 3rd plane, possible?
Moderator: BigEvilCorporation
Using 32x as a 3rd plane, possible?
1) What I want to do is:
- MD/Genesis works as you expect, as it is alone (no exception table differences, for example)
- if MD detects 32x:
-----> 32x is initialized, a program is uploaded along some graphics
-----> All 32x does it wait for a word (command) to display this or those other screen
- MD runs the main program as there was no 32x, but if there is, sends the appropriate command for this stage, changing the optional 3rd layer
Is that possible? Work alongside the 32x but without interfering a normal MD program in any way.
2) Could 32x do transparencies? For example to do shadows, that is, taking the MD-VPD output and making it darker on certain areas.
- MD/Genesis works as you expect, as it is alone (no exception table differences, for example)
- if MD detects 32x:
-----> 32x is initialized, a program is uploaded along some graphics
-----> All 32x does it wait for a word (command) to display this or those other screen
- MD runs the main program as there was no 32x, but if there is, sends the appropriate command for this stage, changing the optional 3rd layer
Is that possible? Work alongside the 32x but without interfering a normal MD program in any way.
2) Could 32x do transparencies? For example to do shadows, that is, taking the MD-VPD output and making it darker on certain areas.
HELP. Spanish TVs are brain washing people to be hostile to me.
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Re: Using 32x as a 3rd plane, possible?
32X output can only be above or below MD layer, it cannot do intermediates. Only way you could do some shadowing etc. is to render the output of MD itself on 32X side and apply whatever you want.
As far as other stuff goes, no, you cannot really do that. 32X changes the memory map drastically, at best you need a 2in1 game, one that works on vanilla MD and other that works as 32X game.
As far as other stuff goes, no, you cannot really do that. 32X changes the memory map drastically, at best you need a 2in1 game, one that works on vanilla MD and other that works as 32X game.
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
Re: Using 32x as a 3rd plane, possible?
I was thinking something like "Crusader of Centy"/"Solei" when the clouds obscure the scenario but are not visible themselves. Zelda for GBA also does that.TmEE co.(TM) wrote: ↑Fri Apr 12, 2019 6:54 pm32X output can only be above or below MD layer, it cannot do intermediates. Only way you could do some shadowing etc. is to render the output of MD itself on 32X side and apply whatever you want.
HELP. Spanish TVs are brain washing people to be hostile to me.
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Re: Using 32x as a 3rd plane, possible?
Soleil does checkerboard pattern which you could do on the 32X too, but you're not gonna get any real shadow/highlight type stuff without recreating the MD image on 32X side.
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
Re: Using 32x as a 3rd plane, possible?
I'm probably missing something because, after looking docs a little bit, the only thing I can see is the very first 0x100 bytes are reassigned, but everything else remains the same, even better: is possible to control 32x video (audio?) hardware from the 68K, so no need to code anything in SH2.TmEE co.(TM) wrote: ↑Fri Apr 12, 2019 6:54 pmAs far as other stuff goes, no, you cannot really do that. 32X changes the memory map drastically, at best you need a 2in1 game, one that works on vanilla MD and other that works as 32X game.
What am I missing?
HELP. Spanish TVs are brain washing people to be hostile to me.
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Re: Using 32x as a 3rd plane, possible?
When 32X is enabled the ROM is only in $880000 to $9FFFFF, the first 4MB no longer has ROM in it. See page 15 for more info : http://www.tmeeco.eu/SMD/32x_hardware_manual.pdf
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
Re: Using 32x as a 3rd plane, possible?
Unless you set RV=1, in which case the 68000 mapping is mostly¹ restored (albeit the SH-2s won't be able to access cartridge area until RV becomes 0 again). Not useful if you want the SH-2s to access ROM tho.
¹The 68000 vectors keep pointing to the banked area so you still need to account for that, but at least it's easier to cope with the occasional case.
¹The 68000 vectors keep pointing to the banked area so you still need to account for that, but at least it's easier to cope with the occasional case.
Sik is pronounced as "seek", not as "sick".
Re: Using 32x as a 3rd plane, possible?
Perfect! that’s exactly what I want. Now how to handle those moved vectors…
Last edited by Miquel on Wed Mar 18, 2020 8:53 pm, edited 1 time in total.
HELP. Spanish TVs are brain washing people to be hostile to me.
Re: Using 32x as a 3rd plane, possible?
My game now has a dual boot, MG/Genesis and s32X/Mars mode in one: it executes and passes ok the needed code on 0x400-0x800.
To my understanding, everything is exactly where I need it, the 68k has control of everything. Then the default mode is intended to be a mix mode, so why no game is designed to be compatible with both modes?
What I don’t know is if I need to write a program for the SH2 or them are in some sort or waiting state. How I put them to sleep? Is there a sleep command?
To my understanding, everything is exactly where I need it, the 68k has control of everything. Then the default mode is intended to be a mix mode, so why no game is designed to be compatible with both modes?
What I don’t know is if I need to write a program for the SH2 or them are in some sort or waiting state. How I put them to sleep? Is there a sleep command?
Last edited by Miquel on Wed Mar 18, 2020 8:52 pm, edited 1 time in total.
HELP. Spanish TVs are brain washing people to be hostile to me.
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
Re: Using 32x as a 3rd plane, possible?
Yes, there is... it's called - "SLEEP".
SLEEP puts the SH2 in power down mode until an (enabled) interrupt arrives, which will wake the processor. Pretty standard stuff here. Oh, be sure you put the routine that sleeps in sdram as rom won't be available when RV = 0.
And no one made dual carts because they want people to have to buy separate carts if they want both versions. You make twice the money that way!
SLEEP puts the SH2 in power down mode until an (enabled) interrupt arrives, which will wake the processor. Pretty standard stuff here. Oh, be sure you put the routine that sleeps in sdram as rom won't be available when RV = 0.
And no one made dual carts because they want people to have to buy separate carts if they want both versions. You make twice the money that way!
Re: Using 32x as a 3rd plane, possible?
Roger Chilly Willy!
I expend some time reading SH2 and is pretty similar to 68k code, why Motorola didn’t do a pipelined version of the 68k then?
Anyway, the boot rom of the 32x at the end jumps at whatever is in 0x24000020, what happens if there is nothing written there?
The boot room first checks ram and the it clears it, so what is instruction 0x0000? Invalid opcode?
Another thing: is possible to force the slave cpu to only run CODE (not necessary data) from the cache only? I mean, seems the pretty obvious way to run at 100% performance.
I have accomplished to compile assembler code, but when I try with C code, bizarre results are obtained, let's see:
1) For the command:
Result:
True linkage is not done, but I didn't ask for it...??
2) The same command without the "-c" option:
Result:
Does it mean can't compile sh2 code? because is the "sh-elf-gcc.exe" file for sure
I expend some time reading SH2 and is pretty similar to 68k code, why Motorola didn’t do a pipelined version of the 68k then?
Anyway, the boot rom of the 32x at the end jumps at whatever is in 0x24000020, what happens if there is nothing written there?
The boot room first checks ram and the it clears it, so what is instruction 0x0000? Invalid opcode?
Another thing: is possible to force the slave cpu to only run CODE (not necessary data) from the cache only? I mean, seems the pretty obvious way to run at 100% performance.
I have accomplished to compile assembler code, but when I try with C code, bizarre results are obtained, let's see:
1) For the command:
Code: Select all
FLAGS32X := -m2 -mb -O6 -g -fomit-frame-pointer -Wall -Wextra -Wparentheses -Wno-unused -Wno-switch
bin/32x/sh-elf-gcc.exe $(FLAGS32X) -c $< -o $@
Code: Select all
sh-elf-gcc.exe: Rock.mdp/main.c32: linker input file unused because linking not done
2) The same command without the "-c" option:
Result:
Code: Select all
ld: unrecognised emulation mode: shelf
HELP. Spanish TVs are brain washing people to be hostile to me.
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Re: Using 32x as a 3rd plane, possible?
68040 and 68060 are the pipelined 68k series CPUs.
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
Re: Using 32x as a 3rd plane, possible?
I think you're misinterpreting the boot code. The boot code looks for a header in the rom that tells it things like where the data segment in the rom is, how big it is, where the vbr for each SH2 is, and a starting entry point. The header looks like thisAnyway, the boot rom of the 32x at the end jumps at whatever is in 0x24000020, what happens if there is nothing written there?
Code: Select all
! Standard Mars Header at 0x3C0
.ascii "JagDoom32X " /* module name */
.long 0x00000000 /* version */
.long __text_end-0x02000000 /* Source (offset in ROM) */
.long 0x00000000 /* Destination (offset in SDRAM) */
.long __data_size /* Size */
.long master_start /* Master SH2 entry point */
.long slave_start /* Slave SH2 entry point */
.long master_vbr /* Master SH2 VBR */
.long slave_vbr /* Slave SH2 VBR */
Re: Using 32x as a 3rd plane, possible?
And why end here? That bad was sales? Just around 1996 appeared plenty of cpus pushing speed around this concept
Yep, the boot room does this:
Code: Select all
org 0
dc.l reset ; 0: POWER ON RESET PC
org 0x140
reset:
org 0x2ea
mov.l @(0x050, pc), r8 ; 0x00000338, r8 = $24000018
...
mov.l @(0x008, r8), r10 ; r10 = $24000020
...
jmp @r10
org 0x338
dc.l $24000018
Conclusion: some sh2 code is needed even if you only want to stop/sleep it.
HELP. Spanish TVs are brain washing people to be hostile to me.
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Re: Using 32x as a 3rd plane, possible?
Motorola couldn't up the clocks and their chips started to lag behind others (intel, IBM etc.) who were getting faster and faster, their big flagship chips weren't competitive anymore and customers moved to new things. In the end they dropped 68k line and started doing PowerPC instead...
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen