Search found 33 matches

by OrangyTang
Thu Apr 26, 2018 9:04 am
Forum: Megadrive/Genesis
Topic: Struct maros/syntax and naming conventions
Replies: 6
Views: 9602

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: 6129

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: 6129

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: 6129

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: 20833

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: 20833

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: 20833

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. :)
by OrangyTang
Wed Apr 04, 2018 2:21 pm
Forum: Megadrive/Genesis
Topic: Game loops and Vertical Blank interupts
Replies: 29
Views: 20833

Re: Game loops and Vertical Blank interupts

Hmm, I guess that makes sense. Wouldn't this make it really had to do h-blank effects as well? Because now the vblank code is still running and hblanks can't interupt it to do fancy scanline effects (and from what I can tell, Gunstar Heroes has a lot of hblank effects).
by OrangyTang
Wed Apr 04, 2018 9:17 am
Forum: Megadrive/Genesis
Topic: Game loops and Vertical Blank interupts
Replies: 29
Views: 20833

Game loops and Vertical Blank interupts

I'm vaugely hacking around Gunstar Heroes, and one thing that's confusing me (actually lots of things are, but one at a time :) ) is how it's managing it's game loop. My understanding is that usually you'd do init and then game loop in the entry point, and wait on the vblank for end of frame. Meanwh...
by OrangyTang
Sun Feb 28, 2016 10:49 am
Forum: Megadrive/Genesis
Topic: Gunstar Heros disassembly?
Replies: 37
Views: 36736

Re: Gunstar Heros disassembly?

I've given up on whatever the hacked assembler AS.exe is with the sonicretro assemblies, and switched to ASM68 now (oddly, the VASM site appears down over the last couple of days, seems back now though). It's nice to have some actual documentation on the assembler now. :) And after basically marking...
by OrangyTang
Fri Feb 26, 2016 9:55 pm
Forum: Megadrive/Genesis
Topic: Gunstar Heros disassembly?
Replies: 37
Views: 36736

Re: Gunstar Heros disassembly?

Yeah, I've switched back to Win7 right now as most of the tools I've been experimenting with have required some flavour of windows. I have a super crude asm listing now which compiles (by making most of it data in IDA), but I think I have some kind of alignment issue. These ops: dc.b "GM MK-01077-0"...
by OrangyTang
Fri Feb 26, 2016 3:19 pm
Forum: Megadrive/Genesis
Topic: Gunstar Heros disassembly?
Replies: 37
Views: 36736

Re: Gunstar Heros disassembly?

Sorry, typing too fast. :) There's a version of AS in the Sonic 3 & Knuckles disassembly from sonicretro.org, which is the one Natsumi is referring to. After having to poke around in the internals ages ago to get it compiling on OSX, it is pretty crapping internally. :S
by OrangyTang
Fri Feb 26, 2016 2:01 pm
Forum: Megadrive/Genesis
Topic: Gunstar Heros disassembly?
Replies: 37
Views: 36736

Re: Gunstar Heros disassembly?

Actually, IDA could if you tell it or it thinks the bytes are opcodes get it wrong and thereby generate illegal code :D I guess this is my fundamental confusion - it seems like it should be straight forward for IDA to sanity check it's generated code, and if it's not valid, fall back to something s...
by OrangyTang
Fri Feb 26, 2016 12:38 pm
Forum: Megadrive/Genesis
Topic: Gunstar Heros disassembly?
Replies: 37
Views: 36736

Re: Gunstar Heros disassembly?

Well, it cannot be done automatically as you have several types of entries within the ROM, e.g. MD graphics data of various kinds, Z80 code, 68K code and other types of data. IDA does not know initially what the entire ROM comprises of at first - look up for the first and second pass disassembly pr...
by OrangyTang
Fri Feb 26, 2016 11:59 am
Forum: Megadrive/Genesis
Topic: Gunstar Heros disassembly?
Replies: 37
Views: 36736

Re: Gunstar Heros disassembly?

You need to tell us what a0 is set to but my guess is the VDP's control-port from the code you list here. I have begun to annotate your listing but I would need more contextual information to determine exactly what is going on and time :D See this is where I think I have a conceptual gap that means...