Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
mg_notes:apple_iic:iic_bugs [2017/11/10 02:08]
M.G. fix link, not markdown
mg_notes:apple_iic:iic_bugs [2017/11/10 03:37]
M.G.
Line 37: Line 37:
           lda   ​addrh,​x ​      ; <-- SEE COMMENTS BELOW           lda   ​addrh,​x ​      ; <-- SEE COMMENTS BELOW
           and   #​$0f ​         ; only lower nibble valid           and   #​$0f ​         ; only lower nibble valid
-          beq   ​tsnoram ​      ; no RAM somehow! +          beq   ​tsnoram ​      ; no RAM somehow! ​[note: if bank 0, skips checking result of RAM test] 
-          bcs   ​tsloop ​       ; loop until we find a bank+          bcs   ​tsloop ​       ; loop until we find a bank [carry set = no RAM in bank]
           adc   #​1 ​           ; C = 0 from compare           adc   #​1 ​           ; C = 0 from compare
 tsnoram ​  ​sta ​  ​numbanks,​y tsnoram ​  ​sta ​  ​numbanks,​y
Line 52: Line 52:
 That being said, MAME before ​ [[https://​github.com/​mamedev/​mame/​commit/​bdcb98307822e79c242782ee67bef966bf4c25de|bdcb983]] did not float the bus for $C0C0-$C0CF. ​ A non-floating bus results in ROM $03 hanging when the card is first accessed, and, due to changes made by Apple, a hang at boot for ROM $04 (and presumably IIc Plus ROM $05). That being said, MAME before ​ [[https://​github.com/​mamedev/​mame/​commit/​bdcb98307822e79c242782ee67bef966bf4c25de|bdcb983]] did not float the bus for $C0C0-$C0CF. ​ A non-floating bus results in ROM $03 hanging when the card is first accessed, and, due to changes made by Apple, a hang at boot for ROM $04 (and presumably IIc Plus ROM $05).
  
-Another minor issue is that the code wouldn'​t find a theoretical Slinky that had only one 64K bank built into it, as the loop terminates when the bank hits 0.+Another minor issue is that the code wouldn'​t find a theoretical Slinky that had only one 64K bank built into it, as the loop terminates when the bank hits 0 (beq tsnoram) even if the carry flag is clear because RAM was found in bank 0.
  
 The code could be fixed by using the stack to save the counter and comes out a few bytes shorter: The code could be fixed by using the stack to save the counter and comes out a few bytes shorter:
Line 118: Line 118:
  
 If it was undesirable to use the stack, we overwrite sizetemp anyway when the routine exits, so we could replace the pha/pla with sta sizetemp/​lda sizetemp at the cost of 4 bytes. If it was undesirable to use the stack, we overwrite sizetemp anyway when the routine exits, so we could replace the pha/pla with sta sizetemp/​lda sizetemp at the cost of 4 bytes.
-