===========================================================================
| 607 | |
| 608 | //=========================================================================== |
| 609 | Update_t CmdBookmarkAdd (int nArgs ) |
| 610 | { |
| 611 | // BMA address |
| 612 | // BMA # address ; where # is [0...9] |
| 613 | if (! nArgs) |
| 614 | { |
| 615 | return CmdBookmarkList( 0 ); |
| 616 | } |
| 617 | |
| 618 | int iBookmark = 0; |
| 619 | |
| 620 | int iArg = 1; |
| 621 | if (nArgs > 1) |
| 622 | { |
| 623 | iBookmark = g_aArgs[ iArg ].nValue; |
| 624 | iArg++; |
| 625 | } |
| 626 | else |
| 627 | { |
| 628 | while ((iBookmark < MAX_BOOKMARKS) && g_aBookmarks[iBookmark].bSet) |
| 629 | iBookmark++; |
| 630 | } |
| 631 | |
| 632 | WORD nAddress = g_aArgs[ iArg ].nValue; |
| 633 | |
| 634 | if (iBookmark >= MAX_BOOKMARKS) |
| 635 | { |
| 636 | ConsoleDisplayPushFormat( "All bookmarks are currently in use. (Max: %d)", MAX_BOOKMARKS ); |
| 637 | return ConsoleUpdate(); |
| 638 | } |
| 639 | |
| 640 | if (Bookmark_Find( nAddress )) |
| 641 | _Bookmark_Del( nAddress ); |
| 642 | |
| 643 | bool bAdded = _Bookmark_Add( iBookmark, nAddress ); |
| 644 | if (!bAdded) |
| 645 | return Help_Arg_1( CMD_BOOKMARK_ADD ); |
| 646 | |
| 647 | return UPDATE_DISASM | ConsoleUpdate(); |
| 648 | } |
| 649 | |
| 650 | //=========================================================================== |
| 651 | Update_t CmdBookmarkClear (int nArgs) |
no test coverage detected