Search found 26 matches

by OrangyTang
Thu Oct 11, 2018 2:15 pm
Forum: Megadrive/Genesis
Topic: Gunstar Heroes Decompression - Format & C# code
Replies: 5
Views: 1772

Re: Gunstar Heroes Decompression - Format & C# code

I finally got around to tidying up the code so the annotated asm routine from the rom and the c# version have been added to the original post. It's worked on all of the compressed data I've managed to find so far, but without the palletes it's still rather garbled and not clear what things are. So p...
by OrangyTang
Tue Oct 09, 2018 8:49 pm
Forum: Megadrive/Genesis
Topic: Gunstar Heroes Decompression - Format & C# code
Replies: 5
Views: 1772

Re: Gunstar Heroes Decompression - Format & C# code

It's tied in with the vblank code, I had a thread about it a while ago http://gendev.spritesmind.net/forum/viewtopic.php?f=2&t=2864 The loading system seems to have 7 'command' types known, one of which seems to decompress patterns to ram and then DMA to vram. The others I haven't figured out yet bu...
by OrangyTang
Tue Oct 09, 2018 6:33 pm
Forum: Megadrive/Genesis
Topic: simple 68k loop
Replies: 21
Views: 4375

Re: simple 68k loop

That looks like the interupt table at the start of a ROM. You can't get that any smaller, that's just what the MD rom format is, every rom has to have it.
by OrangyTang
Tue Oct 09, 2018 8:36 am
Forum: Megadrive/Genesis
Topic: Gunstar Heroes Decompression - Format & C# code
Replies: 5
Views: 1772

Re: Gunstar Heroes Decompression - Format & C# code

No, no exceptions. As you say, it stops when it has 32 decoded bytes. But since it's bit-based, the 'read cursor' may be pointing to (for example) the 3rd bit in the 7th byte. And it only needs three 16-bit values to store it's state in order to resume later.
by OrangyTang
Mon Oct 08, 2018 11:13 pm
Forum: Megadrive/Genesis
Topic: Gunstar Heroes Decompression - Format & C# code
Replies: 5
Views: 1772

Gunstar Heroes Decompression - Format & C# code

I've been poking at Gunstar Heroes off-and-on for a few months now, mostly just working away at the edges, but I finally managed to figure out the compressed data format. :D Here's the GH font, decompressed from raw rom bytes with some custom C# code: https://i.imgur.com/j6FbB1c.png Compressed data ...
by OrangyTang
Wed Sep 26, 2018 10:47 am
Forum: Exodus
Topic: Feature request - breakpoint highlighting
Replies: 0
Views: 1501

Feature request - breakpoint highlighting

Hello! I'm just getting used to the debugger and find that I'm adding a *lot* of breakpoints. Which is fine, but it quickly gets confusing figuring out which is which. Could there be some way of linking the breakpoints in the breakpoints window with the Disassembly view? Possible ideas: 1. 'Breakkpo...
by OrangyTang
Tue Sep 18, 2018 3:16 pm
Forum: Megadrive/Genesis
Topic: Neat programming trick for optional operations
Replies: 3
Views: 1686

Neat programming trick for optional operations

Since work is now less crunchy, I actually managed to find some time to work on my Gunstar Heroes disassem, and stumbled across a neat trick (apologies if this is already known but I thought it was cool): MOVE.w $FFFF8002.w, D0 ; var indicating which processing to perform ; 0 will never overflow (so...
by OrangyTang
Fri Apr 27, 2018 1:00 pm
Forum: Megadrive/Genesis
Topic: Struct maros/syntax and naming conventions
Replies: 6
Views: 2257

Re: Struct maros/syntax and naming conventions

So I dug out the old manual for snasm68k, and I think the 'rs' and 'rsset' macros are what I need (see page 27) : https://segaretro.org/images/0/04/SNASM68K_68000_Cross_Assembler_System_Manual.pdf However I can't actually figure ou the usage syntax atm. This works to define a struct, but actually us...
by OrangyTang
Thu Apr 26, 2018 9:04 am
Forum: Megadrive/Genesis
Topic: Struct maros/syntax and naming conventions
Replies: 6
Views: 2257

Struct maros/syntax and naming conventions

Another day, another stupid question :) As I poke into the gameplay code of the disassembly, I'm finding more code like this: LEA $FFFFA400.w, A5 ; player 1 state struct BSR.w updatePlayer ... updatePlayer: MOVE.w $C8(A5), D0 ; read current player weapon into D0 Where there's basically an object/str...
by OrangyTang
Fri Apr 13, 2018 11:31 am
Forum: Megadrive/Genesis
Topic: Relative offsets in jump tables
Replies: 7
Views: 2020

Re: Relative offsets in jump tables

I guess that kinda makes sense - it's a 1Mb rom and only 176 bytes of spare padding at the end so things are pretty tight.

Having said that, there's also a massive 664 entry jump table (that I'm guessing is game object logic) that does things the long way. Nothing's perfect I guess. :)
by OrangyTang
Fri Apr 13, 2018 10:10 am
Forum: Megadrive/Genesis
Topic: Relative offsets in jump tables
Replies: 7
Views: 2020

Re: Relative offsets in jump tables

Aha! I did try that, but it didn't compile to identical code. Knowing that was the correct syntax I realised I need extra labels: ; The animated 'Treasure' logo TreasureScreen_00062892: MOVE.b Pad1Buttons.w, D0 OR.b Pad2Buttons.w, D0 BTST.l #Pad_Start, D0 BNE.w SkipToTitleScreen_00062B36 MOVE.w Curr...
by OrangyTang
Thu Apr 12, 2018 11:28 pm
Forum: Megadrive/Genesis
Topic: Relative offsets in jump tables
Replies: 7
Views: 2020

Relative offsets in jump tables

Hello! I've got an odd jump table implementation in my disassembly that I'm trying to make less hardcoded. It basically looks like this: MOVE.w CurrentScreenState.w, D0 LEA jmpTable_000628AE(PC,D0.w), A0 ADDA.w (A0), A0 JMP (A0) jmpTable_000628AE: dc.w $0B02 ; offset jmpTable_000628AE to loc_000633B...
by OrangyTang
Thu Apr 05, 2018 2:08 pm
Forum: Megadrive/Genesis
Topic: Game loops and Vertical Blank interupts
Replies: 29
Views: 5268

Re: Game loops and Vertical Blank interupts

Yeah, the more I think about it, the more it makes sense to be a background loading system. Especially as the main thread loop has what looks suspiciously like a decode routine and a whole bunch of vram copy routines. I suspect GH uses it more for boss loading (it has a lot of bosses in quick succes...
by OrangyTang
Wed Apr 04, 2018 3:45 pm
Forum: Megadrive/Genesis
Topic: Game loops and Vertical Blank interupts
Replies: 29
Views: 5268

Re: Game loops and Vertical Blank interupts

Yeah, I don't have much experience with MD programming, but in my mind interupts should do the smallest amount of work possible and finish as quickly as possible. Having said that - I wonder if what GH is doing is using the main thread as a background loading loop? It seems to be idle until memory a...
by OrangyTang
Wed Apr 04, 2018 2:45 pm
Forum: Megadrive/Genesis
Topic: Game loops and Vertical Blank interupts
Replies: 29
Views: 5268

Re: Game loops and Vertical Blank interupts

Ok, that makes sense, thanks!

I still don't know why they wouldn't do it a more 'normal' way, as there doesn't seem to be an advantage to it. Maybe I'll find out when i've taken it apart a bit more. :)