Jump to content

Open Club  ·  76 members

StellaRT
IGNORED

Community-Built Unnamed 1970's Video Game Console-Compatible System (WIP)


Al_Nafuur

Recommended Posts

2 hours ago, Thomas Jentzsch said:

Let's compare these:

 #  address R/W description
--- ------- --- -------------------------------------------------
1    PC     R  fetch opcode, increment PC
2    PC     R  fetch low address byte, increment PC
3  $0100,S  R  internal operation (predecrement S?)
4  $0100,S  W  push PCH on stack, decrement S
5  $0100,S  W  push PCL on stack, decrement S
6    PC     R  copy low address byte to PCL, fetch high address byte to PCH
   
// JSR
case 0x20:
{
  const uInt8 low = peek(PC++, DISASM_CODE); // #2
  peek(0x0100 + SP, DISASM_NONE); // #3
  poke(0x0100 + SP--, PC >> 8, DISASM_WRITE); // #4
  poke(0x0100 + SP--, PC & 0xff, DISASM_WRITE); // #5, 0x1FE access
  PC = (low | (static_cast<uInt16>(peek(PC, DISASM_CODE)) << 8)); // #6
}   

Not sure if it is relevant, but lets talk about step #3, especially the "(predecrement S?)"

I thought this means that the stack pointer is decremented before it appears on the address bus, but in stella code it seems the original value of SP would appear on the bus ?
I don't think the original value of SP ever appears on the bus on the real console.
The way I understood above description of the cycles, in step #3 and 4, the wrong addresses would appear on the adress bus of our emulated console...
 

  • Like 1
Link to comment
Share on other sites

5 minutes ago, Kroko said:

I thought this means that the stack pointer is decremented before it appears on the address bus, but in stella code it seems the original value of SP would appear on the bus ?

Yes, it looks so. The 650x emulation code is not ours but taken from a very reliable source.

5 minutes ago, Kroko said:

I don't think the original value of SP ever appears on the bus on the real console.

It seems that step #3 is not 100% clear.

5 minutes ago, Kroko said:

The way I understood above description of the cycles, in step #3 and 4, the wrong addresses would appear on the address bus of our emulated console...

If that would be the case, Stella would read the wrong values, no? Then it wouldn't work at all. At least in step #4 it has to be correct one. 

Link to comment
Share on other sites

2 minutes ago, Thomas Jentzsch said:

If that would be the case, Stella would read the wrong values, no? Then it wouldn't work at all. At least in step #4 it has to be correct one. 

Yes I agree, but it is confusing ... especially the part with (predecrement S?) ...

Link to comment
Share on other sites

Here is the log with the next peek/poke after a $1FE access (first value is PC second the R/W value):

 

Spoiler

poke 0x1FE 13
peek lastAccessWasFE 61453 : 208
peek 0x1FE 13
peek lastAccessWasFE 510 : 13
poke 0x1FE 23
peek lastAccessWasFE 61463 : 209
peek 0x1FE 23
peek lastAccessWasFE 510 : 23
poke 0x1FE 26
peek lastAccessWasFE 61466 : 208
peek 0x1FE 26
peek lastAccessWasFE 510 : 26
poke 0x1FE 40
peek lastAccessWasFE 61480 : 208
peek 0x1FE 40
peek lastAccessWasFE 510 : 40
poke 0x1FE 104
peek lastAccessWasFE 61544 : 211
poke 0x1FE 13
peek lastAccessWasFE 61453 : 208
peek 0x1FE 13
peek lastAccessWasFE 510 : 13
poke 0x1FE 23
peek lastAccessWasFE 61463 : 209
peek 0x1FE 23
peek lastAccessWasFE 510 : 23
poke 0x1FE 26
peek lastAccessWasFE 61466 : 208
peek 0x1FE 26
peek lastAccessWasFE 510 : 26
poke 0x1FE 40
peek lastAccessWasFE 61480 : 208
peek 0x1FE 40
peek lastAccessWasFE 510 : 40
poke 0x1FE 104
peek lastAccessWasFE 61544 : 211
peek 0x1FE 104
peek lastAccessWasFE 510 : 104
poke 0x1FE 136
peek lastAccessWasFE 61576 : 210
peek 0x1FE 136
peek lastAccessWasFE 510 : 136
poke 0x1FE 105
peek lastAccessWasFE 62569 : 211
peek 0x1FE 105
peek lastAccessWasFE 510 : 105
poke 0x1FE 220
peek lastAccessWasFE 62684 : 254
peek 0x1FE 220
peek lastAccessWasFE 510 : 220
poke 0x1FE 220
peek lastAccessWasFE 62684 : 254
peek 0x1FE 220
peek lastAccessWasFE 510 : 220
poke 0x1FE 220
peek lastAccessWasFE 62684 : 254
peek 0x1FE 220
peek lastAccessWasFE 510 : 220
poke 0x1FE 220
peek lastAccessWasFE 62684 : 254
peek 0x1FE 220
peek lastAccessWasFE 510 : 220
poke 0x1FE 220
peek lastAccessWasFE 62684 : 254
peek 0x1FE 220
peek lastAccessWasFE 510 : 220
poke 0x1FE 220
peek lastAccessWasFE 62684 : 254
peek 0x1FE 220
peek lastAccessWasFE 510 : 220
poke 0x1FE 244
peek lastAccessWasFE 62708 : 254
peek 0x1FE 244
peek lastAccessWasFE 510 : 244
poke 0x1FE 5
peek lastAccessWasFE 62981 : 211
peek 0x1FE 5
peek lastAccessWasFE 510 : 5
poke 0x1FE 65
peek lastAccessWasFE 63041 : 211
peek 0x1FE 65
peek lastAccessWasFE 510 : 65
poke 0x1FE 68
peek lastAccessWasFE 63044 : 212
peek 0x1FE 68
peek lastAccessWasFE 510 : 68
poke 0x1FE 118
peek lastAccessWasFE 64118 : 212
peek 0x1FE 118
peek lastAccessWasFE 510 : 118
poke 0x1FE 23
peek lastAccessWasFE 61463 : 209
peek 0x1FE 23
peek lastAccessWasFE 510 : 23
poke 0x1FE 26
peek lastAccessWasFE 61466 : 208
peek 0x1FE 26
peek lastAccessWasFE 510 : 26
poke 0x1FE 40
peek lastAccessWasFE 61480 : 208
poke 0x1FE 105
peek lastAccessWasFE 54377 : 211
peek 0x1FE 105
peek lastAccessWasFE 510 : 105
poke 0x1FE 53
peek lastAccessWasFE 65534 : 200
poke 0x1FE 78
poke lastAccessWasFE 509 : 205
poke 0x1FE 205
poke lastAccessWasFE 509 : 53
poke 0x1FE 13
peek lastAccessWasFE 61453 : 208
peek 0x1FE 13
peek lastAccessWasFE 510 : 13
poke 0x1FE 23
peek lastAccessWasFE 61463 : 209
peek 0x1FE 23
peek lastAccessWasFE 510 : 23
poke 0x1FE 26
peek lastAccessWasFE 61466 : 208
peek 0x1FE 26
peek lastAccessWasFE 510 : 26
poke 0x1FE 40
peek lastAccessWasFE 61480 : 208
peek 0x1FE 40
peek lastAccessWasFE 510 : 40
poke 0x1FE 104
peek lastAccessWasFE 61544 : 211
peek 0x1FE 104
peek lastAccessWasFE 510 : 104
 

 

Link to comment
Share on other sites

4 minutes ago, Kroko said:

Yes I agree, but it is confusing ... especially the part with (predecrement S?) ...

Agreed. The predecrement S makes no sense, since the value of S is used afterwards. However, the 650x does these dummy peeks while doing internal calculations. So I wonder what is done there.

Link to comment
Share on other sites

12 minutes ago, Thomas Jentzsch said:
poke 0x1FE 104
peek lastAccessWasFE 61544 : 211 ($f068 : $d3)

That's the last byte of the JSR, we need the byte after the JSR.

No. The value is correct the high byte (bit5) of the address determines the bank.

 

 

Link to comment
Share on other sites

10 minutes ago, Thomas Jentzsch said:

Agreed. The predecrement S makes no sense, since the value of S is used afterwards. However, the 650x does these dummy peeks while doing internal calculations. So I wonder what is done there.

FWIW, I believe the cycle sequence for JSR is as follows. I don't believe there are any dummy peeks.

 

                                                    Address bus        Data bus
1 read opcode                                        PC                opcode
2 read lo byte of operand                            PC                lo operand byte
3 push hi byte of PC to stack. decrement SP          SP                (PC >> 8) & 0x00ff
4 push lo byte of PC to stack. decrement SP          SP                PC & 0x00ff
5 read hi byte of operand                            PC                hi operand byte
6 load pc                                            -                -

 

Link to comment
Share on other sites

what confuses me is the 1FE access with the value 53 shortly before the crash:

 

poke 0x1FE 53

it seems to be done from address 65534 ($FFFD !). After this access there are a few unusual accesses from 509 ($1FD )

 

Link to comment
Share on other sites

28 minutes ago, Thomas Jentzsch said:

Yes, but I would like to know what happens directly after the switch. 

🤔

If the bank switching was successful the PC will continue at the target address in new bank, if not it will continue at the target address in the old bank..

 

Link to comment
Share on other sites

34 minutes ago, Al_Nafuur said:

what confuses me is the 1FE access with the value 53 shortly before the crash:

 

poke 0x1FE 53

it seems to be done from address 65534 ($FFFD !). After this access there are a few unusual accesses from 509 ($1FD )

 

🤔 53 (0x35) doesn't occurs once in the bin file of Decathlon NTSC.

 

Link to comment
Share on other sites

2 minutes ago, Thomas Jentzsch said:

Yes, and if the bankswitch is in progress (= too early), then the value is undetermined.

If it is from an earlier bankswitching "still in progress" then it can't be this single value. There must be a whole chain of "undetermined" values that lead to a write to exactly $1FE. That's very very unlikely..

 

Link to comment
Share on other sites

2 minutes ago, JetSetIlly said:

I may have missed you mentioning it but do Tigervision, 3e+, and Superbank cartridges work?

good point!

 

3F is tested on the PlusCart working, but 3E+ is not on the list and untested. Do you have some example ROMs?

3F      Tigervision     River Patrol      OK                          untested              untested        untested (no cart)
Link to comment
Share on other sites

7 hours ago, Al_Nafuur said:

good point!

 

3F is tested on the PlusCart working, but 3E+ is not on the list and untested. Do you have some example ROMs?

3F      Tigervision     River Patrol      OK                          untested              untested        untested (no cart)

 

I'd like to see Circus Convoy working. There's no reason why it shouldn't because it's no more complicated than Tigervision but it would be a useful test

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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