Menu

#19 Make rom2_sw return the original RAM page

1.0
closed
None
False
424:07bfcbc7a809
402:fb036ec1ee9e
2014-01-13
2013-07-27
No

There are only 2 callers of rom2_sw: plus3check() and dos_springboard().

plus3check() doesn't matter.
dos_springboard() currently starts by doing this:

_dos_springboard::
        call    _get_bankm_ram_page     ; Get current RAM page
        ex      de, hl                  ; Save in de (hl is needed)

        call    _rom2_sw                ; Also selects RAM page 7

We could avoid the explicit call to _get_bankm_ram_page by making rom2_sw return the current RAM page prior to switching in RAM page 7. We can simply return the current value of BANKM and pass this later to ram_sw, which will strip any non-RAM-page bits out.

Discussion

  • Brian Ruthven

    Brian Ruthven - 2013-07-27

    Correction, 3 callers, but dos_header() isn't used anywhere (and probably should be deleted anyway).

     
  • Brian Ruthven

    Brian Ruthven - 2014-01-13

    Saves two bytes.

     
  • Brian Ruthven

    Brian Ruthven - 2014-01-13
    • status: open --> closed
    • assigned_to: Brian Ruthven
    • Fixed in: --> 424:07bfcbc7a809
     

Log in to post a comment.