6522 VIA emulation: PB7 toggling vs. PB7 mode

want to talk about MESS/model b/beebem/b-em/electrem/elkulator? do it here!
Post Reply
User avatar
scarybeasts
Posts: 165
Joined: Tue Feb 06, 2018 7:44 am
Contact:

6522 VIA emulation: PB7 toggling vs. PB7 mode

Post by scarybeasts » Mon Dec 31, 2018 9:21 am

Hi,

Simple test case VIA.PB2 (in attached SSD or pasted below via the magic of *SPOOL and bbcim). Probably not a very significant test case but I mentioned to Tom I'd put it together. MAME is the only emulator that gives 128 (as opposed to 0) and I suspect MAME has it right but we'll see.


Cheers
Chris

Code: Select all

   10 REM RESULTS FROM DEC 2018
   20 PRINT "VIA TEST: DOES PB7 TOGGLE IF ACR NOT IN PB7 MODE?"
   30 DIM MC% 256
   40 DIM R% 16
   50 P% = MC%
   60 [ 
   70 OPT 3 
   80 SEI
   90 LDA #&FF
  100 STA &FE62
  110 LDA #&00
  120 STA &FE60
  130 LDA #&7F
  140 STA &FE6E
  150 LDA #&80
  160 STA &FE6B
  170 LDA #&03
  180 STA &FE64
  190 LDA #&00
  200 STA &FE65
  210 STA &FE6B
  220 NOP
  230 NOP
  240 LDA #&80
  250 STA &FE6B
  260 LDA &FE60
  270 STA R%
  280 CLI
  290 RTS
  300 ] 
  310 CALL MC%
  320 REM B-EM: NO: 0 
  330 REM B2: NO: 0 
  340 REM BEEBEM: NO: 0 
  350 REM JSBEEB: NO: 0 
  360 REM MAME: YES: 128
  370 PRINT ?(R%)
Attachments
tests.ssd
(100 KiB) Downloaded 11 times

User avatar
BigEd
Posts: 2691
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: 6522 VIA emulation: PB7 toggling vs. PB7 mode

Post by BigEd » Mon Dec 31, 2018 9:27 am

Here you go, Beeb says this:

Code: Select all

>RUN
VIA TEST: DOES PB7 TOGGLE IF ACR NOT IN PB7 MODE?
1B26          
1B26          OPT 3 
1B26 78       SEI
1B27 A9 FF    LDA #&FF
1B29 8D 62 FE STA &FE62
1B2C A9 00    LDA #&00
1B2E 8D 60 FE STA &FE60
1B31 A9 7F    LDA #&7F
1B33 8D 6E FE STA &FE6E
1B36 A9 80    LDA #&80
1B38 8D 6B FE STA &FE6B
1B3B A9 03    LDA #&03
1B3D 8D 64 FE STA &FE64
1B40 A9 00    LDA #&00
1B42 8D 65 FE STA &FE65
1B45 8D 6B FE STA &FE6B
1B48 EA       NOP
1B49 EA       NOP
1B4A A9 80    LDA #&80
1B4C 8D 6B FE STA &FE6B
1B4F AD 60 FE LDA &FE60
1B52 8D 27 1C STA R%
1B55 58       CLI
1B56 60       RTS
       128

User avatar
scarybeasts
Posts: 165
Joined: Tue Feb 06, 2018 7:44 am
Contact:

Re: 6522 VIA emulation: PB7 toggling vs. PB7 mode

Post by scarybeasts » Mon Dec 31, 2018 6:56 pm

Thanks! Victory to MAME.

User avatar
Pernod
Posts: 1718
Joined: Fri Jun 08, 2012 10:01 pm
Location: Croydon, UK
Contact:

Re: 6522 VIA emulation: PB7 toggling vs. PB7 mode

Post by Pernod » Mon Dec 31, 2018 7:49 pm

scarybeasts wrote:
Mon Dec 31, 2018 6:56 pm
Thanks! Victory to MAME.
Apparently there are some known issues with the MAME implementation, there's an ongoing re-write in some branch somewhere.
- Nigel

BBC Model B: ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, BeebZIF, etc.

Post Reply