Search found 489 matches

by Miquel
Tue Mar 31, 2020 1:41 am
Forum: SGDK
Topic: Brainstorming a way to hscan colors in SGDK
Replies: 6
Views: 143

Re: Brainstorming a way to hscan colors in SGDK

Set the exception to jump to ram, there jump again to the desired h-int routine, you can use an absolute word jump, then wrote your routine in asm. It’s important to only push/pop the registers you’re going to use if you are cpu constrained; also there is the user stack pointer (usp) so you can swap...
by Miquel
Fri Mar 27, 2020 11:12 pm
Forum: SGDK
Topic: A challenge with tiles..
Replies: 1
Views: 80

Re: A challenge with tiles..

Let’s first agree on what’s the situation: as I understand you have a map, a 2D matrix, where each element is a metatile of 5x5 tiles. Is that correct? Something like this: struct Tile { int indexOfTileOnVRAM; int colisionResponseIndex; }; struct Metatile { Tile tiles[ 5 ][ 5 ]; }; const Metatile me...
by Miquel
Tue Mar 24, 2020 11:53 pm
Forum: SGDK
Topic: The small-questions-not-worth-dedicated-topics topic
Replies: 5
Views: 423

Re: The small-questions-not-worth-dedicated-topics topic

Here is my first one. I understand we use const to save data to the rom. But if I need to have a writable version of it in runtime, is there a proper way of doing things or do I just create a new variable and copy the values from a to b? Don't do that, you're making it worst. Use "const" for data t...
by Miquel
Wed Mar 04, 2020 6:15 pm
Forum: Hardware
Topic: Proper USB power mod for the Megadrive 2
Replies: 5
Views: 1922

Re: Proper USB power mod for the Megadrive 2

Usb requires to a least to power 500 mA, but there is no upper limit. But the point of this project, I think, is to reuse old usb chargers; I don’t see the scenario were data cables will be useful.
by Miquel
Mon Jan 06, 2020 3:22 pm
Forum: Megadrive/Genesis
Topic: General Gunstar Heroes rambling
Replies: 5
Views: 2322

Re: General Gunstar Heroes rambling

By dynamically loading I mean that, when the sprite changes, its tiles are loaded from rom to ram the previous frame, the space of vram that occupies the sprite is always the same. The idea is to have large animations for the main character, which is the most repetitive one, so can lead to visual sa...
by Miquel
Sat Jan 04, 2020 10:53 pm
Forum: Megadrive/Genesis
Topic: General Gunstar Heroes rambling
Replies: 5
Views: 2322

Re: General Gunstar Heroes rambling

The 'SEGA' animation at the start generates multiple scaled copes of the logo on the CPU on start-up and animates between them. The original unscaled SEGA logo appears to be the only uncompressed graphics in the rom. For some reason I just thought of it, the sprites of the two main characters/heroe...
by Miquel
Sat Jan 04, 2020 12:56 pm
Forum: Megadrive/Genesis
Topic: 68000 programming optimization tips? (for speed)
Replies: 28
Views: 10690

Re: 68000 programming optimization tips? (for speed)

The most stupid optimization, but useful since can be done in lot of occasions: move.b 0xA10001, d0 and.b #0xF , d0 Optimized: moveq.l #0xF, d0 and.b 0xA10001, d0 If you are going for bit operations probably can be done. Also clears the register which perhaps is what you need.
by Miquel
Wed Jan 01, 2020 12:50 pm
Forum: Megadrive/Genesis
Topic: General Gunstar Heroes rambling
Replies: 5
Views: 2322

Re: General Gunstar Heroes rambling

Palettes are defined independently as 16 uncompressed colours, then referenced in palette sets which are just pointers to 4 palettes to load at once. Makes sense that way, palettes can be loaded anytime. You can compress them do, there are unused bits, but bit manipulation is not cheap at cpu level...
by Miquel
Wed Dec 25, 2019 2:39 pm
Forum: Megadrive/Genesis
Topic: Shinobi arcade port
Replies: 3
Views: 1655

Re: Shinobi arcade port

Congratulations! Good job.
by Miquel
Sun Dec 22, 2019 4:41 am
Forum: Megadrive/Genesis
Topic: M68K Bus Control and Vdp
Replies: 25
Views: 4409

Re: M68K Bus Control and Vdp

You are right Eke, I thought that on cold start both z80 was stopped and without bus, so a fast position to check it, but it’s only stopped/reset. Just redid the experiment making sure the bus was acquired by the 68K and: Fusion: high byte Regen: high byte Gens KMOD: low byte MD1 Asian TMS: high byt...
by Miquel
Sun Dec 22, 2019 2:20 am
Forum: Megadrive/Genesis
Topic: Tilemap Compression
Replies: 1
Views: 1162

Re: Tilemap Compression

I haven’t studied 16bit Sonic games in detail, but I’m pretty confident they use a several level metatile as main compression system. In that case I don’t think is possible to compress the metatiles themselves, but I don’t know about the (top) map. Be sure to understand what I'm talking about becaus...
by Miquel
Sun Dec 22, 2019 1:38 am
Forum: Megadrive/Genesis
Topic: M68K Bus Control and Vdp
Replies: 25
Views: 4409

Re: M68K Bus Control and Vdp

I believe I do it with the Z80 stopped, but you could be right, let me check it again in a day or so.
by Miquel
Fri Dec 20, 2019 8:53 pm
Forum: Megadrive/Genesis
Topic: M68K Bus Control and Vdp
Replies: 25
Views: 4409

Re: M68K Bus Control and Vdp

Program tested: 0: move.w #0x00FF, 0xA00000 move.b 0xA00000, d0 jeq 0b Tested on (I could be using somewhat old versions of emulators): Gens KMOD: copies low byte Fusion: copies high byte Regen: copies low byte Real hardware TMS Asian: copies low byte Conclusion: it doesn’t matter since all those em...
by Miquel
Wed Dec 11, 2019 10:54 pm
Forum: Megadrive/Genesis
Topic: M68K Bus Control and Vdp
Replies: 25
Views: 4409

Re: M68K Bus Control and Vdp

I don’t know, my GUESS is: z80 bus is 8bit so you can't connect a word, it can’t be a buffer since there is no independent device working, therefor only d0-d7 are connected. The other option is d8-d15 are connected but that will be an unnecessary misconduct. move.b d0, 0xA00000 -> works for sure And...
by Miquel
Wed Dec 11, 2019 4:20 pm
Forum: Megadrive/Genesis
Topic: M68K Bus Control and Vdp
Replies: 25
Views: 4409

Re: M68K Bus Control and Vdp

No word access: Z80 memory space can only be accessed by the 68k in byte address mode, and that has to mean something.