Jump to content
IGNORED

100 PICS you won't ever get on Colecovision...


Aking

Recommended Posts

  • 3 months later...

Debugging why these .bin don't work in Jum52:

 

Cart start address: $94A9

After a few steps in the debugger we get to $9492, which holds RTS instruction.

However there is no return address on the stack (we have JMP'ed here, no JSR or PHA yet), so RTS jumps to address $0001 and the program has crashed.

 

Am I missing something? Maybe some 6502 trick?

 

Is it possible to get source code for one of the pics .bin so I can see what's supposed to be happening?

 

(PS: If I skip the RTS in the debugger, then 1 get one or 2 frames of graphics, then the thing crashes again).

 

 

 

Link to comment
Share on other sites

There is no source because a tool converts them from an A8 Rasta Converter executable. There is some code in there which checks for user input which should really have been removed because if it gets any it will RTS and crash. So although on Altirra or Atari800Win Plus or real h/w the image will display ok, if you press the trigger it will crash.

 

Each image will use different amounts of memory so I can't say for sure, but if your RTS is at $9492 then I think you'll find the user input check around $9463. It should look like this (with different addresses):

 

A364: AD 10 C0 LDA TRIG0
A367: F0 13 BEQ $A37C
A369: AD 11 C0 LDA TRIG1
A36C: F0 0E BEQ $A37C
A36E: AD 1F C0 LDA CONSOL
A371: 29 01 AND #$01
A373: F0 07 BEQ $A37C
A375: AD 0F E8 LDA SKSTAT
A378: 29 04 AND #$04
A37A: D0 18 BNE $A394
A37C: A9 00 LDA #$00
A37E: 8D 1D C0 STA GRACTL
A381: AA TAX
A382: 9D 00 D0 STA $D000,X
A385: E8 INX
A386: D0 FA BNE $A382
A388: A9 FF LDA #$FF
A38A: 8D 80 02 STA $0280
A38D: A9 40 LDA #$40
A38F: 8D 0E D4 STA NMIEN
A392: 58 CLI
A393: 60 RTS
A394: 4C 1E 78 LA394 JMP $781E

 

Running through the above code in Alrirra (without pressing anything!), TRIG0 returns $01, TRIG1 returns $01, CONSOL returns $0F and SKSTAT returns $FF which avoids the RTS. Atari800Win Plus returns the same.

 

I couldn't work out how to repeat this in Jum but of those locations I guessed at CONSOL because you wouldn't normally expect to read it on a 5200. I wrote a program to repeatedly read CONSOL and it returns $00. I hacked one of the files to avoid the CONSOL check and it no longer crashes, but it does not display the image correctly.

 

So if you change a read of CONSOL to return $0F it should not crash at least. The way the Rasta Converter images work is that the 6502 is precisely timed to the display and changes the h/w registers at the exact moment necessary mid-scan line, I don't know if that might be the display issue here?

BlueSuperbird.BIN

  • Like 2
Link to comment
Share on other sites

Thanks for the info Paul - very useful :)

 

In my (slightly modified) Jum52 debugger, I am getting these values from the above code:

TRIG0 returns 0 (should be 1 if no button pressed!)

TRIG1 returns 1 (don't know why it would be different to TRIG0 if neither are pressed, must check Jum52 src code)

CONSOL returns 0 (CONSOL is write-only in 5200, used to select which controller to read)

SKSTAT returns 0xC (which means "neither side button of controller 1 or 2 pressed")

 

You were right - if I return 0xF for CONSOL it does not crash. Previously I was just returning it's current value (ie: the value that had previously been written to it). But of course games originally written for the 5200 would not be reading CONSOL anyway.

 

Jum52 uses a line-based renderer, so the image is never going to display correctly anyway.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...