├── Sim800 ├── Sim800.rc ├── PpsDES │ ├── hitote.ico │ ├── hitote.png │ ├── Cloaking.png │ ├── 16x16-tango │ │ ├── exec.png │ │ ├── info.png │ │ ├── zip.png │ │ ├── binary.png │ │ ├── empty.png │ │ ├── go-top.png │ │ ├── go-up.png │ │ ├── image.png │ │ ├── locked.png │ │ ├── sound.png │ │ ├── video.png │ │ ├── document.png │ │ ├── edit-find.png │ │ ├── edit-undo.png │ │ ├── filesave.png │ │ ├── go-bottom.png │ │ ├── go-down.png │ │ ├── go-first.png │ │ ├── list-add.png │ │ ├── tab-new.png │ │ ├── unlocked.png │ │ ├── edit-clear.png │ │ ├── emptytrash.png │ │ ├── filesaveas.png │ │ ├── list-remove.png │ │ ├── shellscript.png │ │ ├── emblem-system.png │ │ ├── trashcan_full.png │ │ ├── mail-attachment.png │ │ ├── system-shutdown.png │ │ ├── emblem-unreadable.png │ │ ├── preferences-desktop.png │ │ ├── drive-removable-media.png │ │ ├── emblem-symbolic-link.png │ │ └── application-certificate.png │ ├── 24x24-tango │ │ ├── exit.png │ │ ├── info.png │ │ ├── finish.png │ │ ├── locked.png │ │ ├── important.png │ │ ├── tab-new.png │ │ ├── unlocked.png │ │ ├── document-new.png │ │ ├── document-open.png │ │ ├── document-print.png │ │ ├── document-save.png │ │ ├── emblem-system.png │ │ ├── gnome-settings.png │ │ ├── stock_search.png │ │ ├── system-search.png │ │ ├── document-save-as.png │ │ ├── emblem-readonly.png │ │ ├── system-installer.png │ │ ├── emblem-unreadable.png │ │ ├── system-file-manager.png │ │ └── application-x-executable.png │ ├── 24x24-wise │ │ ├── add.png │ │ ├── remove.png │ │ ├── document-open.png │ │ ├── document-revert.png │ │ ├── document-save.png │ │ ├── extract-archive.png │ │ ├── application-exit.png │ │ ├── document-save-as.png │ │ ├── add-files-to-archive.png │ │ └── add-folder-to-archive.png │ ├── lcdstripe │ │ ├── WQX_UP.png │ │ ├── lcd_up.png │ │ ├── WQX_CAPS.png │ │ ├── WQX_DOWN.png │ │ ├── WQX_ENG.png │ │ ├── WQX_HBAR.png │ │ ├── WQX_LEFT.png │ │ ├── WQX_LINE.png │ │ ├── WQX_NUM.png │ │ ├── WQX_PGUP.png │ │ ├── WQX_STAR.png │ │ ├── WQX_TAPE.png │ │ ├── WQX_VBAR.png │ │ ├── lcd_caps.png │ │ ├── lcd_down.png │ │ ├── lcd_enc.png │ │ ├── lcd_eng.png │ │ ├── lcd_hbar.png │ │ ├── lcd_left.png │ │ ├── lcd_line.png │ │ ├── lcd_num.png │ │ ├── lcd_pgup.png │ │ ├── lcd_star.png │ │ ├── lcd_tape.png │ │ ├── lcd_vbar.png │ │ ├── lcdempty.png │ │ ├── lcdpixel.png │ │ ├── WQX_ALARM.png │ │ ├── WQX_BATTERY.png │ │ ├── WQX_FLASH.png │ │ ├── WQX_HFRAME.png │ │ ├── WQX_MINUS.png │ │ ├── WQX_PGDOWN.png │ │ ├── WQX_PGLEFT.png │ │ ├── WQX_PGRIGHT.png │ │ ├── WQX_POINT.png │ │ ├── WQX_RIGHT.png │ │ ├── WQX_SECRET.png │ │ ├── WQX_SEVEN_H.png │ │ ├── WQX_SEVEN_V.png │ │ ├── WQX_SHIFT.png │ │ ├── WQX_SOUND.png │ │ ├── WQX_SPEAKER.png │ │ ├── WQX_VFRAME.png │ │ ├── lcd_alarm.png │ │ ├── lcd_battery.png │ │ ├── lcd_flash.png │ │ ├── lcd_hframe.png │ │ ├── lcd_line5.png │ │ ├── lcd_minus.png │ │ ├── lcd_pgdown.png │ │ ├── lcd_pgleft.png │ │ ├── lcd_pgright.png │ │ ├── lcd_point.png │ │ ├── lcd_right.png │ │ ├── lcd_secret.png │ │ ├── lcd_shift.png │ │ ├── lcd_sound.png │ │ ├── lcd_speaker.png │ │ ├── lcd_vertbar.png │ │ ├── lcd_vframe.png │ │ ├── lcdshadow.png │ │ ├── WQX_KEYCLICK.png │ │ ├── WQX_SEMICOLON.png │ │ ├── WQX_SHARPBELL.png │ │ ├── lcd_keyclick.png │ │ ├── lcd_semicolon.png │ │ ├── lcd_sharpbell.png │ │ ├── WQX_MICROPHONE.png │ │ ├── lcd_microphone.png │ │ ├── lcd_seven_honz1.png │ │ ├── lcd_seven_honz2.png │ │ ├── lcd_seven_honz3.png │ │ ├── lcd_seven_vert1.png │ │ ├── lcd_seven_vert2.png │ │ ├── lcd_seven_vert3.png │ │ ├── lcd_seven_vert4.png │ │ ├── lcd_sever_hoz1.png │ │ ├── lcd_sever_hoz2.png │ │ ├── lcd_sever_hoz3.png │ │ ├── lcd_sever_vert1.png │ │ ├── lcd_sever_vert2.png │ │ ├── lcd_sever_vert3.png │ │ ├── lcd_sever_vert4.png │ │ └── lcd_speaker-30.png │ ├── toolbar │ │ ├── M_Browse.png │ │ ├── M_Manga.png │ │ ├── M_Capture.png │ │ ├── M_Wallpaper.png │ │ ├── M_Manga_Native.png │ │ ├── M_Manga_Single.png │ │ ├── M_Manga_nippon.png │ │ ├── VectorToolbar_Menu.png │ │ ├── VectorToolbarEx_Refresh.png │ │ ├── VectorToolbar_PowerOff.png │ │ ├── VectorToolbarEx_Navigate.png │ │ ├── VectorToolbarEx_Opt_Fanta.png │ │ ├── VectorToolbarEx_Opt_Manga.png │ │ ├── VectorToolbar_FullScreen.png │ │ └── VectorToolbarEx_Opt_Origin.png │ ├── 16x16-gnome2 │ │ ├── filesave.png │ │ ├── folder_open.png │ │ ├── stock_folder.png │ │ ├── view-sort-ascending.png │ │ ├── stock_data-query-rename.png │ │ └── gnome-mime-application-vnd.oasis.opendocument.presentation-template.png │ ├── 24x24-gnome │ │ ├── document.png │ │ └── folder_tar.png │ ├── 24x24-human │ │ └── applications-office.png │ └── 24x24-unofficetango │ │ ├── folder_tar.png │ │ └── gnome-mime-application-msword.png ├── KeypadFrm.ui ├── DirtyDefination.h ├── MyZoomWidget.cpp ├── MyZoomWidget.h ├── KeypadUnt.h ├── Sim800.pro ├── CC800IOName.h ├── AddonFuncUnt.h ├── MainUnt.h ├── DbCentre.h ├── NekoDriver.h ├── ANSI │ ├── 65C02.cpp │ ├── C65c02.cpp │ ├── w65c02cpu.cpp │ ├── 65C02.h │ ├── w65c02.h │ ├── C6502mak.h │ └── w65c02macro.h ├── main.cpp ├── DbCentre.cpp ├── KeypadUnt.cpp ├── MainFrm.ui ├── Sim800.qrc ├── NekoDriverDebug.cpp ├── NekoDriverIO.cpp └── NekoDriver.cpp ├── Sim800.sln └── .gitignore /Sim800/Sim800.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "PpsDES\\hitote.ico" 2 | 3 | -------------------------------------------------------------------------------- /Sim800/PpsDES/hitote.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/hitote.ico -------------------------------------------------------------------------------- /Sim800/PpsDES/hitote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/hitote.png -------------------------------------------------------------------------------- /Sim800/PpsDES/Cloaking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/Cloaking.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/exec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/exec.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/info.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/zip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/zip.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/exit.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/info.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-wise/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-wise/add.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_UP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_UP.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_up.png -------------------------------------------------------------------------------- /Sim800/PpsDES/toolbar/M_Browse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/toolbar/M_Browse.png -------------------------------------------------------------------------------- /Sim800/PpsDES/toolbar/M_Manga.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/toolbar/M_Manga.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/binary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/binary.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/empty.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/go-top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/go-top.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/go-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/go-up.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/image.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/locked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/locked.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/sound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/sound.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/video.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/finish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/finish.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/locked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/locked.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-wise/remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-wise/remove.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_CAPS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_CAPS.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_DOWN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_DOWN.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_ENG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_ENG.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_HBAR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_HBAR.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_LEFT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_LEFT.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_LINE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_LINE.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_NUM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_NUM.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_PGUP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_PGUP.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_STAR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_STAR.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_TAPE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_TAPE.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_VBAR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_VBAR.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_caps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_caps.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_down.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_enc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_enc.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_eng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_eng.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_hbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_hbar.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_left.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_line.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_num.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_num.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_pgup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_pgup.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_star.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_tape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_tape.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_vbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_vbar.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcdempty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcdempty.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcdpixel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcdpixel.png -------------------------------------------------------------------------------- /Sim800/PpsDES/toolbar/M_Capture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/toolbar/M_Capture.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-gnome2/filesave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-gnome2/filesave.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/document.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/document.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/edit-find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/edit-find.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/edit-undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/edit-undo.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/filesave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/filesave.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/go-bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/go-bottom.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/go-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/go-down.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/go-first.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/go-first.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/list-add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/list-add.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/tab-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/tab-new.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/unlocked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/unlocked.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-gnome/document.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-gnome/document.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/important.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/important.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/tab-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/tab-new.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/unlocked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/unlocked.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_ALARM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_ALARM.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_BATTERY.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_BATTERY.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_FLASH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_FLASH.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_HFRAME.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_HFRAME.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_MINUS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_MINUS.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_PGDOWN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_PGDOWN.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_PGLEFT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_PGLEFT.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_PGRIGHT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_PGRIGHT.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_POINT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_POINT.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_RIGHT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_RIGHT.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_SECRET.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_SECRET.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_SEVEN_H.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_SEVEN_H.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_SEVEN_V.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_SEVEN_V.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_SHIFT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_SHIFT.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_SOUND.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_SOUND.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_SPEAKER.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_SPEAKER.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_VFRAME.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_VFRAME.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_alarm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_alarm.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_battery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_battery.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_flash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_flash.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_hframe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_hframe.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_line5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_line5.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_minus.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_pgdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_pgdown.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_pgleft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_pgleft.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_pgright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_pgright.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_point.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_point.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_right.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_secret.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_secret.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_shift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_shift.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_sound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_sound.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_speaker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_speaker.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_vertbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_vertbar.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_vframe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_vframe.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcdshadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcdshadow.png -------------------------------------------------------------------------------- /Sim800/PpsDES/toolbar/M_Wallpaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/toolbar/M_Wallpaper.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/edit-clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/edit-clear.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/emptytrash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/emptytrash.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/filesaveas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/filesaveas.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/list-remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/list-remove.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/shellscript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/shellscript.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-gnome/folder_tar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-gnome/folder_tar.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_KEYCLICK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_KEYCLICK.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_SEMICOLON.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_SEMICOLON.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_SHARPBELL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_SHARPBELL.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_keyclick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_keyclick.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_semicolon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_semicolon.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_sharpbell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_sharpbell.png -------------------------------------------------------------------------------- /Sim800/PpsDES/toolbar/M_Manga_Native.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/toolbar/M_Manga_Native.png -------------------------------------------------------------------------------- /Sim800/PpsDES/toolbar/M_Manga_Single.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/toolbar/M_Manga_Single.png -------------------------------------------------------------------------------- /Sim800/PpsDES/toolbar/M_Manga_nippon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/toolbar/M_Manga_nippon.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-gnome2/folder_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-gnome2/folder_open.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-gnome2/stock_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-gnome2/stock_folder.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/emblem-system.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/emblem-system.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/trashcan_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/trashcan_full.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/document-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/document-new.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/document-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/document-open.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/document-print.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/document-print.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/document-save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/document-save.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/emblem-system.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/emblem-system.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/gnome-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/gnome-settings.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/stock_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/stock_search.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/system-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/system-search.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-wise/document-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-wise/document-open.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-wise/document-revert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-wise/document-revert.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-wise/document-save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-wise/document-save.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-wise/extract-archive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-wise/extract-archive.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/WQX_MICROPHONE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/WQX_MICROPHONE.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_microphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_microphone.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_seven_honz1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_seven_honz1.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_seven_honz2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_seven_honz2.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_seven_honz3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_seven_honz3.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_seven_vert1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_seven_vert1.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_seven_vert2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_seven_vert2.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_seven_vert3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_seven_vert3.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_seven_vert4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_seven_vert4.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_sever_hoz1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_sever_hoz1.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_sever_hoz2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_sever_hoz2.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_sever_hoz3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_sever_hoz3.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_sever_vert1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_sever_vert1.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_sever_vert2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_sever_vert2.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_sever_vert3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_sever_vert3.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_sever_vert4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_sever_vert4.png -------------------------------------------------------------------------------- /Sim800/PpsDES/lcdstripe/lcd_speaker-30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/lcdstripe/lcd_speaker-30.png -------------------------------------------------------------------------------- /Sim800/PpsDES/toolbar/VectorToolbar_Menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/toolbar/VectorToolbar_Menu.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/mail-attachment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/mail-attachment.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/system-shutdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/system-shutdown.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/document-save-as.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/document-save-as.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/emblem-readonly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/emblem-readonly.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/system-installer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/system-installer.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-wise/application-exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-wise/application-exit.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-wise/document-save-as.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-wise/document-save-as.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/emblem-unreadable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/emblem-unreadable.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/preferences-desktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/preferences-desktop.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-human/applications-office.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-human/applications-office.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/emblem-unreadable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/emblem-unreadable.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/system-file-manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/system-file-manager.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-unofficetango/folder_tar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-unofficetango/folder_tar.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-wise/add-files-to-archive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-wise/add-files-to-archive.png -------------------------------------------------------------------------------- /Sim800/PpsDES/toolbar/VectorToolbarEx_Refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/toolbar/VectorToolbarEx_Refresh.png -------------------------------------------------------------------------------- /Sim800/PpsDES/toolbar/VectorToolbar_PowerOff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/toolbar/VectorToolbar_PowerOff.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-gnome2/view-sort-ascending.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-gnome2/view-sort-ascending.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/drive-removable-media.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/drive-removable-media.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/emblem-symbolic-link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/emblem-symbolic-link.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-wise/add-folder-to-archive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-wise/add-folder-to-archive.png -------------------------------------------------------------------------------- /Sim800/PpsDES/toolbar/VectorToolbarEx_Navigate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/toolbar/VectorToolbarEx_Navigate.png -------------------------------------------------------------------------------- /Sim800/PpsDES/toolbar/VectorToolbarEx_Opt_Fanta.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/toolbar/VectorToolbarEx_Opt_Fanta.png -------------------------------------------------------------------------------- /Sim800/PpsDES/toolbar/VectorToolbarEx_Opt_Manga.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/toolbar/VectorToolbarEx_Opt_Manga.png -------------------------------------------------------------------------------- /Sim800/PpsDES/toolbar/VectorToolbar_FullScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/toolbar/VectorToolbar_FullScreen.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-gnome2/stock_data-query-rename.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-gnome2/stock_data-query-rename.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-tango/application-certificate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-tango/application-certificate.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-tango/application-x-executable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-tango/application-x-executable.png -------------------------------------------------------------------------------- /Sim800/PpsDES/toolbar/VectorToolbarEx_Opt_Origin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/toolbar/VectorToolbarEx_Opt_Origin.png -------------------------------------------------------------------------------- /Sim800/PpsDES/24x24-unofficetango/gnome-mime-application-msword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/24x24-unofficetango/gnome-mime-application-msword.png -------------------------------------------------------------------------------- /Sim800/PpsDES/16x16-gnome2/gnome-mime-application-vnd.oasis.opendocument.presentation-template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/banxian/Sim800/HEAD/Sim800/PpsDES/16x16-gnome2/gnome-mime-application-vnd.oasis.opendocument.presentation-template.png -------------------------------------------------------------------------------- /Sim800/KeypadFrm.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | TKeypadFrm 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Keypad 15 | 16 | 17 | true 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Sim800/DirtyDefination.h: -------------------------------------------------------------------------------- 1 | #ifndef _DIRTY_DEFINATIONS 2 | #define _DIRTY_DEFINATIONS 3 | 4 | #define MZ_IDC_TOOLBAR1 101 5 | 6 | #define IDC_PPM_CAPTURE 102 7 | #define IDC_PPM_BROWSE 103 8 | 9 | #define IDC_MENU_EXIT 0 10 | #define IDC_MENU_REFRESH 1 11 | #define IDC_MENU_FULLSCREEN 2 12 | #define IDC_MENU_OPTIMIZE 3 13 | #define IDC_MENU_MENU 4 14 | #define IDC_MENU_M_WALLPAPER 5 15 | #define IDC_MENU_M_CAPTURE 6 16 | #define IDC_MENU_M_MANGA 7 17 | #define IDC_MENU_M_BROWSE 8 18 | #define IDC_MENU_MANGA_SINGAL 9 19 | #define IDC_MENU_MANGA_NATIVE 10 20 | #define IDC_MENU_MANGA_NIPPON 11 21 | //#define IDC_MENU_MANGA_PHOTO 12 22 | 23 | 24 | #define IDT_SOMEMARKTIMEOUT 104 25 | #define IDT_SOMEHINTTIMEOUT 105 26 | 27 | #define WM_MZ_TOUCHNOTIFY 59369822 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /Sim800.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual Studio 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sim800", "Sim800\Sim800.vcproj", "{6D8DAC07-50C9-3514-AD12-F88BC0F7A37E}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | Shipping|Win32 = Shipping|Win32 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {6D8DAC07-50C9-3514-AD12-F88BC0F7A37E}.Debug|Win32.ActiveCfg = Debug|Win32 14 | {6D8DAC07-50C9-3514-AD12-F88BC0F7A37E}.Debug|Win32.Build.0 = Debug|Win32 15 | {6D8DAC07-50C9-3514-AD12-F88BC0F7A37E}.Release|Win32.ActiveCfg = Release|Win32 16 | {6D8DAC07-50C9-3514-AD12-F88BC0F7A37E}.Release|Win32.Build.0 = Release|Win32 17 | {6D8DAC07-50C9-3514-AD12-F88BC0F7A37E}.Shipping|Win32.ActiveCfg = Shipping|Win32 18 | {6D8DAC07-50C9-3514-AD12-F88BC0F7A37E}.Shipping|Win32.Build.0 = Shipping|Win32 19 | EndGlobalSection 20 | GlobalSection(SolutionProperties) = preSolution 21 | HideSolutionNode = FALSE 22 | EndGlobalSection 23 | EndGlobal 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | tmp 3 | debug 4 | release 5 | Deleted 6 | Makefile 7 | Makefile.Debug 8 | Makefile.Release 9 | __history 10 | GeneratedFiles 11 | Build 12 | Dist 13 | Target 14 | .settings 15 | .cproject 16 | .project 17 | *.ncb 18 | *.suo 19 | *.pdb 20 | *.idb 21 | *.ib_pdb_index 22 | *.bak 23 | *.swp 24 | *~ 25 | *.~* 26 | ~*.* 27 | *.ini 28 | *.identcache 29 | *.local 30 | *.dcu 31 | *.$$$ 32 | *.tvsconfig 33 | *.obj 34 | *.o 35 | *.ncb 36 | *.pch 37 | *.pchi 38 | *.pdb 39 | *.idb 40 | *.suo 41 | *.vcproj.*.user 42 | *.ilk 43 | *cache.dat 44 | *.dcu 45 | *.dsk 46 | *.~*~ 47 | *.$$$ 48 | *.exe 49 | *.obj 50 | __history 51 | *.sai 52 | *.psd 53 | *.rar 54 | *.zip 55 | *.cab 56 | *.7z 57 | *.dll 58 | *.dl~ 59 | *.exe 60 | *.ex~ 61 | *.00? 62 | *.a 63 | *.lib 64 | *.res 65 | *.html 66 | *.ax 67 | *.mp3 68 | *.mpc 69 | *.ogg 70 | *.wav 71 | *.mpg 72 | *.mp4 73 | *.aac 74 | *.m4a 75 | *.mkv 76 | *.mp2 77 | *.wma 78 | *.wdp 79 | thumb.db 80 | BuildLog.htm 81 | *.vspscc 82 | *.sln_old 83 | object_script.*.* 84 | *.user 85 | *.pro.user* 86 | *.sdf 87 | *.opensdf 88 | ipch 89 | *.txt 90 | wqxsimext 91 | Source\ Archives 92 | DL800NT 93 | __MACOSX 94 | .DS_Store 95 | Shipping -------------------------------------------------------------------------------- /Sim800/MyZoomWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "MyZoomWidget.h" 2 | 3 | MyZoomWidget::MyZoomWidget(QWidget *parent) 4 | :QLabel(parent) 5 | { 6 | 7 | } 8 | 9 | #ifndef QT_NO_GESTURES 10 | //bool MyZoomWidget::event( QEvent * e ) 11 | //{ 12 | // if (e->type() == QEvent::Gesture) 13 | // return gestureEvent(static_cast(e)); 14 | // return QWidget::event(e); 15 | //} 16 | 17 | //void MyZoomWidget::gestureEvent( QGestureEvent * e ) 18 | //{ 19 | 20 | //} 21 | #endif 22 | 23 | void MyZoomWidget::mousePressEvent( QMouseEvent * e ) 24 | { 25 | emit mousePressed(e->x(), e->y()); 26 | e->accept(); 27 | } 28 | 29 | void MyZoomWidget::mouseReleaseEvent( QMouseEvent * e ) 30 | { 31 | emit mouseReleased(e->x(), e->y()); 32 | e->accept(); 33 | } 34 | 35 | void MyZoomWidget::mouseDoubleClickEvent( QMouseEvent * e ) 36 | { 37 | emit mouseDoubleClicked(e->x(), e->y()); 38 | e->accept(); 39 | } 40 | 41 | void MyZoomWidget::mouseMoveEvent( QMouseEvent * e ) 42 | { 43 | emit mouseMoved(e->x(), e->y()); 44 | e->accept(); 45 | } 46 | 47 | void MyZoomWidget::resizeEvent( QResizeEvent * e ) 48 | { 49 | emit resized(e->size().width(), e->size().height()); 50 | e->accept(); 51 | } 52 | -------------------------------------------------------------------------------- /Sim800/MyZoomWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef MYZOOMWIDGET_H 2 | #define MYZOOMWIDGET_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | 11 | class MyZoomWidget : public QLabel 12 | { 13 | Q_OBJECT 14 | public: 15 | explicit MyZoomWidget(QWidget *parent = 0); 16 | 17 | protected: 18 | #ifndef QT_NO_GESTURES 19 | //bool event(QEvent *e); 20 | //void gestureEvent(QGestureEvent *e); 21 | #endif 22 | virtual void mousePressEvent(QMouseEvent *); 23 | virtual void mouseReleaseEvent(QMouseEvent *); 24 | virtual void mouseDoubleClickEvent(QMouseEvent *); 25 | virtual void mouseMoveEvent(QMouseEvent *); 26 | virtual void resizeEvent(QResizeEvent *); 27 | 28 | signals: 29 | void mousePressed(int x, int y); 30 | void mouseReleased(int x, int y); 31 | void mouseDoubleClicked(int x, int y); 32 | void mouseMoved(int x, int y); 33 | void longPressStart(int x, int y); 34 | void longPressTimeout(int x, int y); 35 | void zoomIn(int x, int y); 36 | void zoomOut(int x, int y); 37 | void zoomEnd(int x, int y); 38 | void resized(int w, int h); 39 | 40 | public slots: 41 | 42 | }; 43 | 44 | #endif // MYZOOMWIDGET_H 45 | -------------------------------------------------------------------------------- /Sim800/KeypadUnt.h: -------------------------------------------------------------------------------- 1 | #ifndef KEYPADUNT_H 2 | #define KEYPADUNT_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Ui { 8 | class TKeypadFrm; 9 | } 10 | 11 | class TKeypadFrm : public QDialog 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit TKeypadFrm(QWidget *parent = 0); 17 | ~TKeypadFrm(); 18 | 19 | private: 20 | Ui::TKeypadFrm *ui; 21 | QSet fPressedKeys; 22 | protected: 23 | virtual void keyPressEvent(QKeyEvent *); 24 | virtual void keyReleaseEvent(QKeyEvent *); 25 | 26 | }; 27 | 28 | class TKeyItem { 29 | public: 30 | explicit TKeyItem(int ID, const QString& graphic, int matchedkeycode); 31 | private: 32 | int fRow; 33 | int fColumn; 34 | bool fPressed; 35 | bool fHold; 36 | QString fGraphic; 37 | QString fSubscript; 38 | QSet fMatchedKeycodes; 39 | QRect fRect; 40 | public: 41 | void addKeycode(int matchedkeycode); 42 | void setRect(const QRect& rect); 43 | void setSubscript(const QString& subscript); 44 | bool inRect(const QPoint& point); 45 | void paintSelf(QImage& image); 46 | bool press(int keycode); 47 | bool release(int keycode); 48 | void hold(); 49 | void press(); 50 | void release(); 51 | bool pressed(); 52 | int row(); 53 | int column(); 54 | }; 55 | 56 | #endif // KEYPADUNT_H 57 | -------------------------------------------------------------------------------- /Sim800/Sim800.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2010-05-08T14:53:58 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui webkit xml sql 8 | 9 | #TARGET = Sim800 10 | TEMPLATE = app 11 | 12 | CONFIG += qt \ 13 | debug_and_relase 14 | CONFIG(debug, debug|release) { 15 | TARGET = Sim800_d 16 | DESTDIR = ../Target/GCC/Debug 17 | MOC_DIR += ./tmp/moc/Debug 18 | OBJECTS_DIR += ./tmp/obj/Debug 19 | } 20 | else { 21 | TARGET = Sim800 22 | DESTDIR = ../Target/GCC/Release 23 | MOC_DIR += ./tmp/moc/Release 24 | OBJECTS_DIR += ./tmp/obj/Release 25 | } 26 | DEPENDPATH += . 27 | UI_DIR += ./tmp 28 | RCC_DIR += ./tmp 29 | INCLUDEPATH += ./tmp \ 30 | $MOC_DIR \ 31 | . \ 32 | ./../FvQKOLLite 33 | LIBS += -lole32 \ 34 | -L"./PpsDES" 35 | 36 | 37 | SOURCES += main.cpp\ 38 | MainUnt.cpp \ 39 | DbCentre.cpp \ 40 | MyDropTreeWidget.cpp \ 41 | NewBookUnt.cpp \ 42 | SettingsUnt.cpp \ 43 | ReaderUnt.cpp \ 44 | MyZoomWidget.cpp \ 45 | KeypadUnt.cpp 46 | 47 | HEADERS += MainUnt.h \ 48 | DbCentre.h \ 49 | MyDropTreeWidget.h \ 50 | NewBookUnt.h \ 51 | SettingsUnt.h \ 52 | ReaderUnt.h \ 53 | MyZoomWidget.h \ 54 | KeypadUnt.h 55 | 56 | FORMS += MainFrm.ui \ 57 | KeypadFrm.ui 58 | 59 | RESOURCES += \ 60 | Sim800.qrc 61 | 62 | OTHER_FILES += \ 63 | Sim800_chs.ts 64 | -------------------------------------------------------------------------------- /Sim800/CC800IOName.h: -------------------------------------------------------------------------------- 1 | #ifndef _CC800_IO_NAME_H 2 | #define _CC800_IO_NAME_H 3 | 4 | #define io00_bank_switch 0x00 5 | #define io01_int_enable 0x01 6 | #define io01_int_status 0x01 7 | #define io02_timer0_val 0x02 8 | #define io03_timer1_val 0x03 9 | #define io04_stop_timer0 0x04 10 | #define io04_general_ctrl 0x04 11 | #define io05_start_timer0 0x05 12 | #define io05_clock_ctrl 0x05 13 | #define io06_stop_timer1 0x06 14 | #define io06_lcd_config 0x06 15 | #define io07_port_config 0x07 16 | #define io07_start_timer1 0x07 17 | #define io08_port0_data 0x08 18 | #define io09_port1_data 0x09 19 | #define io0A_bios_bsw 0x0A 20 | #define io0A_roa 0x0A 21 | #define io0B_port3_data 0x0B 22 | #define io0B_lcd_ctrl 0x0B 23 | #define io0C_general_status 0x0C 24 | #define io0C_timer01_ctrl 0x0C 25 | #define io0C_lcd_config 0x0C 26 | #define io0D_volumeid 0x0D 27 | #define io0D_lcd_segment 0x0D 28 | #define io0E_dac_data 0x0E 29 | #define io0F_zp_bsw 0x0F 30 | #define io0F_port0_dir 0x0F 31 | #define io15_port1_dir 0x15 32 | #define io16_port2_dir 0x16 33 | #define io17_port2_data 0x17 34 | #define io18_port4_data 0x18 35 | #define io19_ckv_select 0x19 36 | #define io1A_volume_set 0x1A 37 | #define io1B_pwm_data 0x1B 38 | #define io1C_batt_detect 0x1C 39 | #define io1E_batt_detect 0x1E 40 | #define io20_JG 0x20 41 | #define io23_unknow 0x23 42 | 43 | #define io_ROA_bit 0x80 // RAM/ROM (io_bios_bsw) 44 | 45 | #define map0000 0 46 | #define map2000 1 47 | #define map4000 2 48 | #define map6000 3 49 | #define map8000 4 50 | #define mapA000 5 51 | #define mapC000 6 52 | #define mapE000 7 53 | 54 | #endif -------------------------------------------------------------------------------- /Sim800/AddonFuncUnt.h: -------------------------------------------------------------------------------- 1 | #ifndef _ADDON_FUNC_UNIT 2 | #define _ADDON_FUNC_UNIT 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | //#include "WincePlaceHolder.h" 9 | 10 | using std::string; 11 | using std::wstring; 12 | 13 | 14 | enum TImageType { 15 | itUnknown = -1, itTarga, itBitmap, itPNG, itJPEG, itGif, itHDPhoto, itPKArchive, itRarArchive 16 | }; 17 | 18 | 19 | void Normalize8bitQImage( QImage& qimage ); // or Indexed8 20 | void QuantizeToGrayscaleQImage( QImage& qimage, bool dither = false ); // diffusion? 21 | void ReplaceAlphaWithChecker( QImage& qimage ); 22 | void UncropImage( QImage& qimage, int destwidth, int destheight ); 23 | void AutocropImage( QImage& qimage, bool fromdualpage, bool isleftpage ); 24 | bool IsGrayscaleImage(const QImage& qimage); 25 | void AutoExposureImage( QImage& qimage, bool heavy = false ); 26 | int GetFreePhysMemory(); 27 | quint16 readuint16(QIODevice& qfile, bool bigendian = false, bool peek = false); 28 | quint32 readuint32(QIODevice& qfile, bool bigendian = false, bool peek = false); 29 | QImage NewQImageFromEXIFThumbnail(QFile& qfile); 30 | TImageType GuessMIMEType(QIODevice* file); 31 | TImageType GuessMIMEType(const QString& filename); 32 | TImageType ExtToMIMEType(const QString& extname); 33 | QString MIMETypeToExt(TImageType type); 34 | 35 | wstring StringToWideString(const string& Source, unsigned int Codepage = CP_ACP); 36 | QByteArray qUncompressEx(const uchar* data, int nbytes, int outputbytes); 37 | QByteArray qUncompressEx1(const uchar* data, int nbytes, int outputbytes); 38 | QByteArray qCompressEx(const uchar* data, int nbytes, int compressionLevel); 39 | 40 | bool SaveByteArrayToFile( const QString& filename, const QByteArray& content ); 41 | 42 | int greedydiv(int n, int m); 43 | int getCpuCount(); 44 | #ifndef _WIN32 45 | unsigned int GetTickCount(); 46 | #endif 47 | #endif -------------------------------------------------------------------------------- /Sim800/MainUnt.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINUNT_H 2 | #define MAINUNT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "KeypadUnt.h" 14 | 15 | 16 | typedef struct tagLCDStripe { 17 | QImage bitmap; 18 | int left, top; 19 | } TLCDStripe; 20 | 21 | 22 | namespace Ui { 23 | class TMainFrm; 24 | } 25 | 26 | 27 | class TMainFrm : public QMainWindow { 28 | Q_OBJECT 29 | public: 30 | explicit TMainFrm(QWidget *parent = 0); 31 | ~TMainFrm(); 32 | 33 | protected: 34 | void changeEvent(QEvent *e); 35 | 36 | private: 37 | Ui::TMainFrm *ui; 38 | QFileDialog OpenSaveFileDialog; 39 | QString fLastSavedProjectFilename; 40 | QTranslator* fTranslator; 41 | QString fLastLangCode; 42 | QSet fPressedKeys; 43 | TKeyItem* fKeyItems[8][8]; 44 | TLCDStripe* fLCDStripes; 45 | QImage fLCDEmpty, fLCDPixel; 46 | private: 47 | void initKeypad(); 48 | void repaintKeypad(); 49 | void updateKeypadMatrix(); 50 | void initLcdStripe(); 51 | void DrawShadowOrPixel( QByteArray* buffer, QPainter &painter, bool semishadow ); 52 | 53 | protected: 54 | virtual bool eventFilter(QObject*, QEvent*); 55 | virtual void keyPressEvent(QKeyEvent *); 56 | virtual void keyReleaseEvent(QKeyEvent *); 57 | public: 58 | void StoreTranslator( QTranslator* translator ); 59 | private slots: 60 | void onEmulationStartClicked(); 61 | void onEmulationRestartClicked(); 62 | void onEmulationTestClicked(); 63 | void onBenchmarkClicked(); 64 | void onLanguageEnglishClicked(); 65 | void onLanguageChineseClicked(); 66 | //void onToolsOptionsClicked(); 67 | void onHelpContentsClicked(); 68 | void onKeypadSizeChanged(int, int); 69 | void onMouseDown(int x, int y); 70 | void onMouseUp(int x, int y); 71 | 72 | public slots: 73 | void onLCDBufferChanged(QByteArray* buffer); 74 | 75 | }; 76 | 77 | QString localLanguage(); 78 | #endif // MAINUNT_H 79 | -------------------------------------------------------------------------------- /Sim800/DbCentre.h: -------------------------------------------------------------------------------- 1 | #ifndef _DBCENTRE_H 2 | #define _DBCENTRE_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | typedef struct tagPathRecItem { 10 | QString LastSourceFolder; // Add pages 11 | QString LastStockBookFolder; // Extract snb 12 | QString LastCustomBookFolder; // Save output snb 13 | QString LastExportFolder; // xml folder 14 | QString LastImportFolder; // xml folder 15 | QString LastProjectFolder; // mbk 16 | int LastSelectedItemIndex; 17 | } TPathRecItem; 18 | 19 | typedef struct tagStateRecItem { 20 | bool WindowMaxium; 21 | QByteArray MainFrmState; 22 | QByteArray KeypadLayoutState; 23 | QByteArray MessageLayoutState; 24 | bool RegEditorMaxium; 25 | QByteArray RegFrmState; 26 | QByteArray KeyLayoutState; 27 | } TStateRecItem; 28 | 29 | typedef struct tagGlobalRecItem { 30 | bool AutoExposure; // Gamma? 31 | bool RemoveJPEGArtifacts; 32 | bool AutoCrop; 33 | bool UseSurfaceBlur; 34 | int SPDC1016Frequency; 35 | } TGlobalRecItem; 36 | 37 | 38 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 39 | // Project IO Helper 40 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 41 | // enum 42 | //QDataStream &operator<<(QDataStream &out, const MangaDoublePageMode &mode); 43 | //QDataStream &operator>>(QDataStream &in, MangaDoublePageMode &mode); 44 | //QDataStream &operator<<(QDataStream &out, const ScaleFilter &filter); 45 | //QDataStream &operator>>(QDataStream &in, ScaleFilter &filter); 46 | //QDataStream &operator<<(QDataStream &out, const TStreamCodec &codec); 47 | //QDataStream &operator>>(QDataStream &in, TStreamCodec &codec); 48 | 49 | // structural 50 | //QDataStream &operator<<(QDataStream &out, const TBookBundleRec &book); 51 | //QDataStream &operator<<(QDataStream &out, const TChapterBundleRec &chapter); 52 | //QDataStream &operator<<(QDataStream &out, const TPageBundleRec &page); 53 | 54 | //QDataStream &operator>>(QDataStream &in, TBookBundleRec &book); 55 | //QDataStream &operator>>(QDataStream &in, TChapterBundleRec &chapter); 56 | //QDataStream &operator>>(QDataStream &in, TPageBundleRec &page); 57 | 58 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 59 | // Used in NekoDriver etc 60 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 61 | extern TPathRecItem PathSetting; 62 | extern TStateRecItem StateSetting; 63 | extern TGlobalRecItem GlobalSetting; 64 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 65 | 66 | void LoadAppSettings( void ); 67 | void SaveAppSettings( void ); 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /Sim800/NekoDriver.h: -------------------------------------------------------------------------------- 1 | #ifndef _NEKO_DRIVER_UNIT_H 2 | #define _NEKO_DRIVER_UNIT_H 3 | 4 | #include "MainUnt.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | 14 | class EmulatorThread; 15 | 16 | class TNekoDriver: public QObject { 17 | Q_OBJECT 18 | public: 19 | TNekoDriver(); 20 | ~TNekoDriver(); 21 | private: 22 | QString fProjectViewNameFilter; 23 | EmulatorThread* fEmulatorThread; 24 | char* fNorBuffer; // for performance 25 | char* fBROMBuffer; 26 | QString fNorFilename; 27 | bool fFlashUpdated; 28 | private: 29 | bool LoadBROM(const QString& filename); 30 | bool LoadFullNorFlash(const QString& filename); 31 | bool LoadDemoNor(const QString& filename); 32 | bool SaveFullNorFlash(); 33 | 34 | public: 35 | bool IsProjectEmpty(); 36 | bool IsProjectModified(); 37 | void SwitchNorBank(int bank); 38 | void Switch4000toBFFF(unsigned char bank); // used 0A/0D value 39 | void InitInternalAddrs(); 40 | bool StartEmulation(); 41 | bool RunDemoBin(const QString& filename); 42 | bool StopEmulation(); 43 | bool PauseEmulation(); 44 | bool ResumeEmulation(); 45 | void CheckFlashProgramming(unsigned short addr, unsigned char data); 46 | 47 | public slots: 48 | void onLCDBufferChanged(QByteArray* buffer); 49 | //void onStepFinished(quint16 pc); 50 | signals: 51 | void lcdBufferChanged(QByteArray* buffer); 52 | //void stepFinished(quint16 pc); 53 | }; 54 | 55 | class EmulatorThread : public QThread 56 | { 57 | Q_OBJECT 58 | public: 59 | explicit EmulatorThread(char* brom, char* nor); 60 | ~EmulatorThread(); 61 | protected: 62 | char* fBROMBuffer; 63 | char* fNorBuffer; 64 | bool fKeeping; 65 | void* fLCDBuffer; 66 | private: 67 | unsigned int lastTicket; 68 | unsigned long long totalcycle; 69 | //const unsigned spdc1016freq = 3686400; 70 | bool measured; 71 | unsigned remeasure; 72 | unsigned batchlimiter; 73 | long batchcount; 74 | double sleepgap; 75 | long sleepcount; 76 | 77 | protected: 78 | void run(); 79 | 80 | #ifdef AUTOTEST 81 | private: 82 | bool enablelogging; 83 | void TryTest(unsigned line); 84 | #endif 85 | 86 | public: 87 | void StopKeeping(); 88 | signals: 89 | void lcdBufferChanged(QByteArray* buffer); 90 | //void stepFinished(quint16 pc); 91 | }; 92 | 93 | typedef TNekoDriver* PNekoDriver; 94 | extern PNekoDriver theNekoDriver; 95 | 96 | extern unsigned short lcdbuffaddr; // unused 97 | 98 | extern unsigned keypadmatrix[8][8]; // char -> uint32 99 | 100 | #define TF_STACKOVERFLOW 0x1 101 | #define TF_NMIFLAG 0x8 102 | #define TF_IRQFLAG 0x10 103 | #define TF_WATCHDOG 0x80 104 | 105 | #endif -------------------------------------------------------------------------------- /Sim800/ANSI/65C02.cpp: -------------------------------------------------------------------------------- 1 | #ifndef HANDYPSP 2 | 3 | extern "C" { 4 | #include "65c02.h" 5 | } 6 | #include 7 | 8 | DWORD autoboot = 0; 9 | BOOL restart = 0; 10 | WORD iorange = 0x0040; 11 | 12 | BOOL g_irq = 0; // FIXME: NO MORE REVERSE 13 | BOOL g_nmi = 0; // FIXME: NO MORE REVERSE 14 | BOOL g_stp = 0; 15 | BOOL g_wai = 0; 16 | 17 | 18 | 19 | //void ClearCounters() { 20 | // stmsecs = GetTickCount(); 21 | // totcycles = 0; 22 | // executed = 0; 23 | //} 24 | 25 | 26 | // extern WORD LogDisassembly (WORD offset, LPTSTR text); 27 | 28 | // extern bool timer0started; 29 | // extern bool timer1started; 30 | 31 | // void ContinueExecution () { 32 | // 33 | // DWORD processtime = totcycles;// needed for comm routines 34 | // DWORD loop = speed * 300;// watchdog timer 35 | // DWORD elapsed = 0; 36 | // DWORD CpuTicks = 0; 37 | // DWORD j = 0; 38 | // 39 | // if (benchmark == 2) { 40 | // ClearCounters(); 41 | // benchmark = 1; 42 | // } 43 | // 44 | // elapsed = GetTickCount()-stmsecs; 45 | // 46 | // while (loop && (totcycles < (elapsed * 100 * speed))) { 47 | // //qDebug("PC:0x%04x, opcode: 0x%06x", regs.pc, (*(LPDWORD)(mem+regs.pc)) & 0xFFFFFF); 48 | // //LogDisassembly(regs.pc, NULL); 49 | // CpuTicks = CpuExecute(); 50 | // totcycles += CpuTicks; 51 | // executed++; 52 | // //*** add checks for reset, IRQ, NMI, and other pin signals 53 | // elapsed = GetTickCount()-stmsecs; 54 | // loop--; 55 | // /* added for irq timing */ 56 | // if (irqclk) { 57 | // irqcnt += CpuTicks; 58 | // if (irqcnt >= irqclk) { 59 | // irq=0; 60 | // irqcnt = irqcnt - irqclk; 61 | // } 62 | // } 63 | // if (nmiclk) { 64 | // nmicnt += CpuTicks; 65 | // if (nmicnt >= nmiclk) { 66 | // nmi=0; 67 | // nmicnt = nmicnt - nmiclk; 68 | // } 69 | // } 70 | // if (timer0started) { 71 | // mem[02] = mem[02] + 1; 72 | // } 73 | // if (timer1started) { 74 | // mem[03] = mem[03] + 1; 75 | // } 76 | // 77 | // /* Throttling routine (simple delay loop) */ 78 | // if (throttle) for (j=throttle*CpuTicks;j>1;j--); 79 | // 80 | // } 81 | // /* Throttling update routine */ 82 | // if (throttle) { 83 | // if (totcycles < (elapsed * 100 * speed)) { 84 | // throttle--; 85 | // if (throttle < 1) throttle = 1; 86 | // } 87 | // else { 88 | // throttle++; 89 | // } 90 | // } 91 | // 92 | // 93 | // // if (benchmark && (elapsed >= 5000)) { 94 | // // DisplayBenchmark(elapsed); 95 | // // benchmark = 0; 96 | // // ClearCounters(); 97 | // // } 98 | // 99 | // // DrawStatusArea((HDC)0,0); 100 | // // if (Displayflag) TerminalDisplay(0); 101 | // // CommUpdate(totcycles - processtime); 102 | // 103 | // } 104 | 105 | 106 | #endif -------------------------------------------------------------------------------- /Sim800/main.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // UTF-8 without BOM 3 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "MainUnt.h" 11 | 12 | #ifdef QT_NODLL 13 | Q_IMPORT_PLUGIN(qjpegmod) 14 | Q_IMPORT_PLUGIN(qpngmod) 15 | //Q_IMPORT_PLUGIN(qgif) 16 | //Q_IMPORT_PLUGIN(qmng) 17 | #endif 18 | 19 | int main(int argc, char *argv[]) 20 | { 21 | QApplication app(argc, argv); 22 | 23 | QTranslator translator; 24 | translator.load(QString("Sim800_") + localLanguage(), app.applicationDirPath() + "/Language"); 25 | //translator.load("MPack_chs", app.applicationDirPath() + "/Language"); 26 | #ifdef __GNUC__ 27 | QStringList matchlist = QString::fromUtf16((ushort*)L"Tahoma;宋体;微软雅黑;MS ゴシック").split(";", QString::KeepEmptyParts, Qt::CaseInsensitive); 28 | #else 29 | // workaround for GCC utf8 BOM behavior 30 | static const ushort faces[] = { 31 | L'T', L'a', L'h', L'o', L'm', L'a', L';', 32 | 0x5B8B, 0x4F53, L';', 33 | 0x5FAE, 0x8F6F, 0x96C5, 0x9ED1, L';', 34 | 0xFF2D, 0xFF33, L' ', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 35 | 0x0 36 | }; 37 | QStringList matchlist = QString::fromUtf16(&faces[0]).split(";", QString::KeepEmptyParts, Qt::CaseInsensitive); 38 | #endif 39 | QFont::insertSubstitutions("Tahoma", matchlist); 40 | QFont::insertSubstitutions("MS Shell Dlg2", matchlist); 41 | QFont f(QLatin1String("Tahoma"), 8); 42 | if (translator.isEmpty() == false) { 43 | app.installTranslator(&translator); 44 | QStringList matchlist = QObject::tr("Tahoma;Arial Unicode MS").split(";", QString::KeepEmptyParts, Qt::CaseInsensitive); 45 | QFont::removeSubstitution("Tahoma"); 46 | QFont::insertSubstitutions("Tahoma", matchlist); 47 | f.setStyleStrategy(QFont::PreferAntialias); 48 | f.setPointSize(QObject::tr("9").toInt()); 49 | } 50 | QApplication::setFont(f); 51 | 52 | if (QSysInfo::WindowsVersion < QSysInfo::WV_5_1) { 53 | QApplication::setStyle("CleanLooks"); 54 | } else { 55 | #ifdef WIN32 56 | // API is damn 57 | // IsAppThemed 58 | /* 59 | typedef int (__stdcall *FARPROC)(long); 60 | QLibrary uxthemelib("uxtheme"); 61 | bool themed = false; 62 | FARPROC pEnableTheming = FARPROC(uxthemelib.resolve("EnableTheming")); 63 | if (pEnableTheming) { 64 | if (pEnableTheming(TRUE) != 0) { 65 | typedef int (__stdcall *FARPROC)(); 66 | FARPROC pIsAppThemed = FARPROC(uxthemelib.resolve("IsAppThemed")); 67 | if (pIsAppThemed && pIsAppThemed() == TRUE) { 68 | themed = true; 69 | } 70 | } else { 71 | // == S_OK 72 | themed = true; 73 | } 74 | } 75 | if (themed == false) { 76 | QApplication::setStyle("CleanLooks"); 77 | } 78 | */ 79 | // Simpler one 80 | typedef int (__stdcall *FARPROC)(); 81 | QLibrary uxthemelib("uxtheme"); 82 | FARPROC pIsAppThemed = FARPROC(uxthemelib.resolve("IsAppThemed")); 83 | if (pIsAppThemed && pIsAppThemed() == FALSE) { 84 | QApplication::setStyle("CleanLooks"); 85 | } 86 | #endif 87 | } 88 | 89 | TMainFrm mainfrm; 90 | mainfrm.StoreTranslator(&translator); 91 | //mainfrm.setAttribute( Qt::WA_DeleteOnClose, true ); 92 | #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) 93 | mainfrm.showMaximized(); 94 | #else 95 | mainfrm.show(); 96 | #endif 97 | return app.exec(); 98 | } 99 | -------------------------------------------------------------------------------- /Sim800/ANSI/C65c02.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2004 K. Wilkins 3 | // 4 | // This software is provided 'as-is', without any express or implied warranty. 5 | // In no event will the authors be held liable for any damages arising from 6 | // the use of this software. 7 | // 8 | // Permission is granted to anyone to use this software for any purpose, 9 | // including commercial applications, and to alter it and redistribute it 10 | // freely, subject to the following restrictions: 11 | // 12 | // 1. The origin of this software must not be misrepresented; you must not 13 | // claim that you wrote the original software. If you use this software 14 | // in a product, an acknowledgment in the product documentation would be 15 | // appreciated but is not required. 16 | // 17 | // 2. Altered source versions must be plainly marked as such, and must not 18 | // be misrepresented as being the original software. 19 | // 20 | // 3. This notice may not be removed or altered from any source distribution. 21 | // 22 | 23 | ////////////////////////////////////////////////////////////////////////////// 24 | // Handy - An Atari Lynx Emulator // 25 | // Copyright (c) 1996,1997 // 26 | // K. Wilkins // 27 | ////////////////////////////////////////////////////////////////////////////// 28 | // 65C02 Emulation class // 29 | ////////////////////////////////////////////////////////////////////////////// 30 | // // 31 | // This class emulates a 65C02 processor. It is interfaced to the rest of // 32 | // the system via the PEEK/POKE macros and a number of global variables // 33 | // // 34 | // K. Wilkins // 35 | // August 1997 // 36 | // // 37 | ////////////////////////////////////////////////////////////////////////////// 38 | // Revision History: // 39 | // ----------------- // 40 | // // 41 | // 16Oct2007 AK Moved non-speed-intensive routines to a separate CPP file // 42 | // 01Aug1997 KW Document header added & class documented. // 43 | // // 44 | ////////////////////////////////////////////////////////////////////////////// 45 | 46 | #include 47 | #include 48 | #include 49 | 50 | bool C65C02::ContextSave(FILE *fp) 51 | { 52 | TRACE_CPU0("ContextSave()"); 53 | 54 | int mPS; 55 | mPS=PS(); 56 | if(!fprintf(fp,"C6502::ContextSave")) return 0; 57 | if(!fwrite(&mA,sizeof(ULONG),1,fp)) return 0; 58 | if(!fwrite(&mX,sizeof(ULONG),1,fp)) return 0; 59 | if(!fwrite(&mY,sizeof(ULONG),1,fp)) return 0; 60 | if(!fwrite(&mSP,sizeof(ULONG),1,fp)) return 0; 61 | if(!fwrite(&mPS,sizeof(ULONG),1,fp)) return 0; 62 | if(!fwrite(&mPC,sizeof(ULONG),1,fp)) return 0; 63 | if(!fwrite(&mIRQActive,sizeof(ULONG),1,fp)) return 0; 64 | 65 | return 1; 66 | } 67 | 68 | bool C65C02::ContextLoad(FILE *fp) 69 | { 70 | //TRACE_CPU0("ContextLoad()"); 71 | //int mPS; 72 | //char teststr[100]="XXXXXXXXXXXXXXXXXX"; 73 | //if(!lss_read(teststr,sizeof(char),18,fp)) return 0; 74 | //if(strcmp(teststr,"C6502::ContextSave")!=0) return 0; 75 | //if(!lss_read(&mA,sizeof(ULONG),1,fp)) return 0; 76 | //if(!lss_read(&mX,sizeof(ULONG),1,fp)) return 0; 77 | //if(!lss_read(&mY,sizeof(ULONG),1,fp)) return 0; 78 | //if(!lss_read(&mSP,sizeof(ULONG),1,fp)) return 0; 79 | //if(!lss_read(&mPS,sizeof(ULONG),1,fp)) return 0; 80 | //if(!lss_read(&mPC,sizeof(ULONG),1,fp)) return 0; 81 | //if(!lss_read(&mIRQActive,sizeof(ULONG),1,fp)) return 0; 82 | //PS(mPS); 83 | //return 1; 84 | } 85 | -------------------------------------------------------------------------------- /Sim800/ANSI/w65c02cpu.cpp: -------------------------------------------------------------------------------- 1 | #ifdef HANDYPSP 2 | 3 | extern "C" { 4 | #include "w65c02.h" 5 | #include "w65c02macro.h" 6 | } 7 | 8 | DWORD autoboot = 0; 9 | BOOL restart = 0; 10 | WORD iorange = 0x0040; 11 | 12 | BOOL g_irq = 0; // FIXME: NO MORE REVERSE 13 | BOOL g_nmi = 0; // FIXME: NO MORE REVERSE 14 | BOOL g_stp = 0; 15 | BOOL g_wai = 0; 16 | BOOL g_wai_saved = 0; 17 | 18 | // CPU Flags & status 19 | 20 | int mA; // Accumulator 8 bits 21 | int mX; // X index register 8 bits 22 | int mY; // Y index register 8 bits 23 | int mSP; // Stack Pointer 8 bits 24 | int mOpcode; // Instruction opcode 8 bits 25 | int mOperand; // Instructions operand 16 bits 26 | int mPC; // Program Counter 16 bits 27 | 28 | int mN; // N flag for processor status register 29 | int mV; // V flag for processor status register 30 | int mB; // B flag for processor status register 31 | int mD; // D flag for processor status register 32 | int mI; // I flag for processor status register 33 | int mZ; // Z flag for processor status register 34 | int mC; // C flag for processor status register 35 | 36 | int mIRQActive; 37 | 38 | #ifdef _LYNXDBG 39 | int mPcBreakpoints[MAX_CPU_BREAKPOINTS]; 40 | int mDbgFlag; 41 | #endif 42 | //UBYTE *mRamPointer; 43 | 44 | // Associated lookup tables 45 | 46 | int mBCDTable[2][256]; 47 | 48 | 49 | //int PS(); 50 | //void PS(int ps); 51 | 52 | void CpuInitialize() 53 | { 54 | TRACE_CPU0("Reset()"); 55 | //mRamPointer=mSystem.GetRamPointer(); 56 | mA = 0; 57 | mX = 0; 58 | mY = 0; 59 | mSP = 0xff; 60 | mOpcode = 0; 61 | mOperand = 0; 62 | mPC = CPU_PEEKW(BOOT_VECTOR); 63 | mN = FALSE; 64 | mV = FALSE; 65 | mB = FALSE; 66 | mD = FALSE; 67 | mI = TRUE; 68 | mZ = FALSE; // GGV 69 | mC = FALSE; 70 | mIRQActive = FALSE; 71 | 72 | g_nmi = FALSE; // MERGE 73 | g_irq = FALSE; // MERGE 74 | g_wai = FALSE; 75 | g_wai_saved = FALSE; 76 | } 77 | 78 | //void SetRegs(C6502_REGS ®s) 79 | //{ 80 | // setPS(regs.PS); 81 | // mA = regs.A; 82 | // mX = regs.X; 83 | // mY = regs.Y; 84 | // mSP = regs.SP; 85 | // mOpcode = regs.Opcode; 86 | // mOperand = regs.Operand; 87 | // mPC = regs.PC; 88 | // g_wai = regs.WAIT; 89 | //#ifdef _LYNXDBG 90 | // for (int loop = 0; loop < MAX_CPU_BREAKPOINTS; loop++) mPcBreakpoints[loop] = regs.cpuBreakpoints[loop]; 91 | //#endif 92 | // g_nmi = regs.NMI; // MERGE 93 | // g_irq = regs.IRQ; // MERGE 94 | //} 95 | 96 | //void GetRegs(C6502_REGS ®s) 97 | //{ 98 | // regs.PS = PS(); 99 | // regs.A = mA; 100 | // regs.X = mX; 101 | // regs.Y = mY; 102 | // regs.SP = mSP; 103 | // regs.Opcode = mOpcode; 104 | // regs.Operand = mOperand; 105 | // regs.PC = mPC; 106 | // regs.WAIT = (g_wai) ? true : false; 107 | //#ifdef _LYNXDBG 108 | // for (int loop = 0; loop < MAX_CPU_BREAKPOINTS; loop++) regs.cpuBreakpoints[loop] = mPcBreakpoints[loop]; 109 | //#endif 110 | // regs.NMI = (g_nmi) ? true : false; 111 | // regs.IRQ = (g_irq) ? true : false; 112 | //} 113 | 114 | int GetPC(void) 115 | { 116 | return mPC; 117 | } 118 | 119 | void xILLEGAL(void) 120 | { 121 | //char addr[1024]; 122 | //sprintf(addr,"C65C02::Update() - Illegal opcode (%02x) at PC=$%04x.",mOpcode,mPC); 123 | //gError->Warning(addr); 124 | } 125 | 126 | // Answers value of the Processor Status register 127 | int PS() 128 | { 129 | unsigned char ps = 0x20; 130 | if (mN) ps |= 0x80; 131 | if (mV) ps |= 0x40; 132 | if (mB) ps |= 0x10; 133 | if (mD) ps |= 0x08; 134 | if (mI) ps |= 0x04; 135 | if (mZ) ps |= 0x02; 136 | if (mC) ps |= 0x01; 137 | return ps; 138 | } 139 | 140 | 141 | // Change the processor flags to correspond to the given value 142 | void setPS(int ps) 143 | { 144 | mN = ps & 0x80; 145 | mV = ps & 0x40; 146 | mB = ps & 0x10; 147 | mD = ps & 0x08; 148 | mI = ps & 0x04; 149 | mZ = ps & 0x02; 150 | mC = ps & 0x01; 151 | } 152 | 153 | #endif // HANDYPSP -------------------------------------------------------------------------------- /Sim800/ANSI/65C02.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #ifdef _WIN32 7 | #define WIN32_LEAN_AND_MEAN 8 | #include 9 | #else 10 | #include "wintypes.h" 11 | #include // BOOL 12 | #endif 13 | #include 14 | 15 | //#define BUILDNUMBER 2 // Rename to 65c02 16 | //#define BUILDNUMBER 3 // remove registry, use ini file 17 | //#define BUILDNUMBER 4 // remove disk drives 18 | //#define BUILDNUMBER 5 // remove joysticks 19 | //#define BUILDNUMBER 6 // remove video system 20 | //#define BUILDNUMBER 7 // remove dll libraries 21 | //#define BUILDNUMBER 8 // debug bad JMP (0000,x) 22 | //#define BUILDNUMBER 9 // Remove shadowed mem 23 | //#define BUILDNUMBER 10 // Initial screen output to $C020 24 | //#define BUILDNUMBER 11 // Define 32K ram, IO page@0x8000, 32K ROM (- 1 page) 25 | //#define BUILDNUMBER 12 /* Clean out remaining code in all mods 26 | // remove speaker support, added autoboot choice 27 | // and ROM selection choices to config */ 28 | //#define BUILDNUMBER 12 // Cleaned up bugs, added status lites, and IOpage to ini 29 | //#define BUILDNUMBER 13 // Cleaned up bugs, removed unused debugger cmds wrote help file 30 | //#define BUILDNUMBER 14 // converted buttons from right side to top of screen 31 | //#define BUILDNUMBER 15 // added irq and nmi inputs and load/save ram to disk 32 | //#define BUILDNUMBER 16 // corrected mem fill for io page below 0x8000 33 | //#define BUILDNUMBER 17 // corrected dialog boxes init cursor loc and tab order 34 | //#define BUILDNUMBER 18 // add ability to cause IRQ's & NMI's based on clock ticks 35 | // also replaced emulator with simulator throughout text 36 | //#define BUILDNUMBER 19 // add capture to file and fix ROM loading bug 37 | //#define BUILDNUMBER 20 // fix REL cmds cycle counting & debug tracefile output 38 | //#define BUILDNUMBER 21 // added all new W65C02S opcodes 39 | //#define BUILDNUMBER 22 // Convert source files to allow compiling under LCC 40 | #define BUILDNUMBER 23 // Fixed bug in debugger that caused program termination 41 | // when wrapping from $FFFF to $0000, added Tab support in terminal, 42 | // added instruction throttling to keep cycle timing more accurate 43 | // removed BUILDNUMBER from the ini config file structure 44 | 45 | 46 | 47 | #define __iocallconv __fastcall 48 | 49 | typedef BYTE (__iocallconv *iofunction1)(BYTE); 50 | typedef void (__iocallconv *iofunction2)(BYTE,BYTE); 51 | 52 | typedef struct _regsrec { 53 | BYTE a; // accumulator 54 | BYTE x; // index X 55 | BYTE y; // index Y 56 | BYTE ps; // processor status 57 | WORD pc; // program counter 58 | WORD sp; // stack pointer 59 | } regsrec, *regsptr; 60 | 61 | extern DWORD autoboot; 62 | extern iofunction1 ioread[0x40]; 63 | extern iofunction2 iowrite[0x40]; 64 | extern void checkflashprogram(WORD addr, BYTE data); 65 | 66 | // extern LPBYTE mem; 67 | extern unsigned char fixedram0000[0x10002]; // just like simulator 68 | extern unsigned char* pmemmap[8]; // 0000~1FFF ... E000~FFFF 69 | extern unsigned char* may4000ptr; // TODO: move into NekoDriver.h 70 | extern unsigned char* norbankheader[0x10]; 71 | extern unsigned char* volume0array[0x100]; 72 | extern unsigned char* volume1array[0x100]; 73 | extern unsigned char* bbsbankheader[0x10]; 74 | 75 | extern WORD iorange; 76 | extern regsrec regs; 77 | extern BOOL restart; 78 | extern BOOL g_irq; // FIXME: NO MORE REVERSE 79 | extern BOOL g_nmi; // FIXME: NO MORE REVERSE 80 | extern BOOL g_wai; 81 | extern BOOL g_stp; 82 | 83 | 84 | 85 | DWORD CpuExecute (); 86 | void CpuInitialize (); 87 | void MemDestroy (); 88 | void MemInitialize (); 89 | void MemReset (); 90 | 91 | 92 | 93 | unsigned char GetByte( unsigned short address ); 94 | unsigned short GetWord( unsigned short address ); 95 | 96 | // 97 | // Status Register Bits 98 | // 99 | #define AF_SIGN 0x80 100 | #define AF_OVERFLOW 0x40 101 | #define AF_RESERVED 0x20 102 | #define AF_BREAK 0x10 103 | #define AF_DECIMAL 0x08 104 | #define AF_INTERRUPT 0x04 105 | #define AF_ZERO 0x02 106 | #define AF_CARRY 0x01 -------------------------------------------------------------------------------- /Sim800/DbCentre.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "DbCentre.h" 5 | 6 | TPathRecItem PathSetting; // imp 7 | TStateRecItem StateSetting; // imp 8 | TGlobalRecItem GlobalSetting; 9 | 10 | void LoadAppSettings( void ) 11 | { 12 | QSettings settings(QApplication::applicationDirPath() + "/ConfMachine.ini", 13 | QSettings::IniFormat); 14 | PathSetting.LastSourceFolder = settings.value("Path/LastSourceFolder", "").toString(); 15 | PathSetting.LastStockBookFolder = settings.value("Path/LastStockBookFolder", "").toString(); 16 | PathSetting.LastCustomBookFolder = settings.value("Path/LastCustomBookFolder", "").toString(); 17 | PathSetting.LastExportFolder = settings.value("Path/LastExportFolder", "").toString(); 18 | PathSetting.LastImportFolder = settings.value("Path/LastImportFolder", "").toString(); 19 | PathSetting.LastProjectFolder = settings.value("Path/LastProjectFolder", "").toString(); 20 | PathSetting.LastSelectedItemIndex = settings.value("Path/LastSelectedItemIndex", 0).toInt(); 21 | 22 | StateSetting.WindowMaxium = settings.value("State/WindowMaxium", true).toBool(); 23 | StateSetting.MainFrmState = settings.value("State/MainFrmState", QByteArray()).toByteArray(); 24 | StateSetting.KeypadLayoutState = settings.value("State/KeypadLayoutState", QByteArray()).toByteArray(); 25 | StateSetting.MessageLayoutState = settings.value("State/MessageLayoutState", QByteArray()).toByteArray(); 26 | 27 | StateSetting.RegEditorMaxium = settings.value("State/RegEditorMaxium", true).toBool(); 28 | StateSetting.RegFrmState = settings.value("State/RegEditorMaxium", QByteArray()).toByteArray(); 29 | StateSetting.KeyLayoutState = settings.value("State/KeyLayoutState", QByteArray()).toByteArray(); 30 | 31 | GlobalSetting.AutoCrop = settings.value("Global/AutoCrop", true).toBool(); 32 | GlobalSetting.AutoExposure = settings.value("Global/AutoCrop", true).toBool(); 33 | GlobalSetting.UseSurfaceBlur = settings.value("Global/UseSurfaceBlur", false).toBool(); 34 | GlobalSetting.RemoveJPEGArtifacts = settings.value("Global/RemoveJPEGArtifacts", false).toBool(); 35 | GlobalSetting.SPDC1016Frequency = settings.value("Global/SPDC1016Frequency", 3686400).toUInt(); 36 | } 37 | 38 | void SaveAppSettings( void ) 39 | { 40 | QSettings settings(QApplication::applicationDirPath() + "/ConfMachine.ini", 41 | QSettings::IniFormat); 42 | settings.beginGroup("Path"); 43 | settings.setValue("LastSourceFolder", PathSetting.LastSourceFolder); 44 | settings.setValue("LastStockBookFolder", PathSetting.LastStockBookFolder); 45 | settings.setValue("LastCustomBookFolder", PathSetting.LastCustomBookFolder); 46 | settings.setValue("LastExportFolder", PathSetting.LastExportFolder); 47 | settings.setValue("LastImportFolder", PathSetting.LastImportFolder); 48 | settings.setValue("LastProjectFolder", PathSetting.LastProjectFolder); 49 | settings.setValue("LastSelectedItemIndex", PathSetting.LastSelectedItemIndex); 50 | settings.endGroup(); 51 | 52 | settings.beginGroup("State"); 53 | settings.setValue("WindowMaxium", StateSetting.WindowMaxium); 54 | settings.setValue("MainFrmState", StateSetting.MainFrmState); 55 | settings.setValue("KeypadLayoutState", StateSetting.KeypadLayoutState); 56 | settings.setValue("MessageLayoutState", StateSetting.MessageLayoutState); 57 | 58 | settings.setValue("RegEditorMaxium", StateSetting.RegEditorMaxium); 59 | settings.setValue("RegFrmState", StateSetting.RegFrmState); 60 | settings.setValue("KeyLayoutState", StateSetting.KeyLayoutState); 61 | settings.endGroup(); 62 | 63 | settings.beginGroup("Global"); 64 | settings.setValue("AutoCrop", GlobalSetting.AutoCrop); 65 | settings.setValue("AutoExposure", GlobalSetting.AutoExposure); 66 | settings.setValue("UseSurfaceBlur", GlobalSetting.UseSurfaceBlur); 67 | settings.setValue("RemoveJPEGArtifacts", GlobalSetting.RemoveJPEGArtifacts); 68 | settings.setValue("SPDC1016Frequency", GlobalSetting.SPDC1016Frequency); 69 | settings.endGroup(); 70 | } 71 | 72 | 73 | 74 | 75 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 76 | // Project IO Helper 77 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 78 | // QDataStream & operator<<( QDataStream &out, const TStreamCodec &codec ) 79 | // { 80 | // out << quint32(codec); 81 | // return out; 82 | // } 83 | // 84 | // QDataStream & operator>>( QDataStream &in, TStreamCodec &codec ) 85 | // { 86 | // quint32 dummy; 87 | // in >> dummy; 88 | // codec = TStreamCodec(dummy); 89 | // return in; 90 | // } 91 | -------------------------------------------------------------------------------- /Sim800/KeypadUnt.cpp: -------------------------------------------------------------------------------- 1 | #include "KeypadUnt.h" 2 | #include "ui_KeypadFrm.h" 3 | #include 4 | #include 5 | 6 | 7 | TKeypadFrm::TKeypadFrm(QWidget *parent) : 8 | QDialog(parent), 9 | ui(new Ui::TKeypadFrm) 10 | { 11 | ui->setupUi(this); 12 | } 13 | 14 | TKeypadFrm::~TKeypadFrm() 15 | { 16 | delete ui; 17 | } 18 | 19 | void TKeypadFrm::keyPressEvent( QKeyEvent* ev ) 20 | { 21 | fPressedKeys += (Qt::Key)ev->key(); 22 | qDebug("%d pressed", ev->key()); 23 | } 24 | 25 | void TKeypadFrm::keyReleaseEvent( QKeyEvent* ev ) 26 | { 27 | fPressedKeys -= (Qt::Key)ev->key(); 28 | qDebug("%d released", ev->key()); 29 | } 30 | 31 | TKeyItem::TKeyItem( int ID, const QString& graphic, int matchedkeycode ) 32 | : fRow(ID / 10) 33 | , fColumn(ID % 10) 34 | , fPressed(false) 35 | , fHold(false) 36 | , fGraphic(graphic) 37 | //, fMatchedKeycode(matchedkeycode) 38 | { 39 | fMatchedKeycodes.insert(matchedkeycode); 40 | } 41 | 42 | void TKeyItem::addKeycode( int matchedkeycode ) 43 | { 44 | fMatchedKeycodes.insert(matchedkeycode); 45 | } 46 | 47 | void TKeyItem::setRect( const QRect& rect ) 48 | { 49 | fRect = rect; 50 | // TODO: change font size 51 | 52 | } 53 | 54 | void TKeyItem::setSubscript( const QString& subscript ) 55 | { 56 | fSubscript = subscript; 57 | } 58 | 59 | bool TKeyItem::inRect( const QPoint& point ) 60 | { 61 | return fRect.contains(point); 62 | } 63 | 64 | void TKeyItem::paintSelf( QImage& image ) 65 | { 66 | if (fRect.isEmpty()) { 67 | return; 68 | } 69 | QPainter painter(&image); 70 | QBrush framebrush; 71 | QColor bgcolor; 72 | if (fHold) { 73 | painter.setPen(QPen(QColor(0x14C906), 2, Qt::SolidLine)); 74 | bgcolor = QColor(0x9AC986); 75 | } else if (fPressed) { 76 | painter.setPen(QPen(QColor(0x404906), 2, Qt::SolidLine)); 77 | bgcolor = Qt::lightGray; 78 | } else { 79 | painter.setPen(QPen(QColor(0x80C946), 2, Qt::SolidLine)); 80 | bgcolor = QColor(0xD9E9CD); 81 | } 82 | //QLinearGradient linearGradient(0, 0, 474, 36); 83 | //linearGradient.setColorAt(0.0, Qt::white); 84 | //linearGradient.setColorAt(0.2, Qt::lightGray); 85 | //linearGradient.setColorAt(0.6, Qt::lightGray); 86 | //linearGradient.setColorAt(1.0, Qt::darkGray); 87 | //painter.setBrush(linearGradient); 88 | //painter.setBrush(framebrush); 89 | framebrush.setStyle(Qt::SolidPattern); 90 | painter.setRenderHint(QPainter::Antialiasing); 91 | //painter.setOpacity(0.5); 92 | QBrush oldbrush = painter.brush(); 93 | //framebrush.setStyle(Qt::NoBrush); 94 | framebrush.setColor(bgcolor); 95 | painter.setBrush(framebrush); 96 | painter.drawRoundedRect(fRect, 4, 4, Qt::AbsoluteSize); 97 | if (fSubscript.isEmpty() == false) { 98 | QPolygon subbg; 99 | subbg.append(QPoint(fRect.x() + fRect.width() * 2 / 3 + 2, fRect.y() + fRect.height() * 2 / 3)); 100 | subbg.append(QPoint(fRect.x() + fRect.width(), fRect.y() + fRect.height() * 2 / 3)); 101 | subbg.append(QPoint(fRect.x() + fRect.width(), fRect.y() + fRect.height() - 2)); 102 | subbg.append(QPoint(fRect.x() + fRect.width() - 2, fRect.y() + fRect.height())); 103 | subbg.append(QPoint(fRect.x() + fRect.width() * 2 / 3 - 2, fRect.y() + fRect.height())); 104 | framebrush.setColor(painter.pen().color()); 105 | // same color as frame 106 | painter.setBrush(framebrush); 107 | painter.drawPolygon(subbg); 108 | } 109 | painter.drawText(fRect, Qt::AlignCenter | Qt::AlignHCenter | Qt::TextWrapAnywhere, fGraphic); 110 | if (fSubscript.isEmpty() == false) { 111 | painter.setPen(QPen(QColor(0xFFFDE8), 2, Qt::SolidLine)); 112 | painter.drawText(fRect.adjusted(2,2,-2,-2), Qt::AlignRight | Qt::AlignBottom | Qt::TextWrapAnywhere, fSubscript); 113 | } 114 | painter.setBrush(oldbrush); 115 | } 116 | 117 | bool TKeyItem::press( int keycode ) 118 | { 119 | if (fMatchedKeycodes.contains(keycode)) { 120 | fPressed = true; 121 | return true; 122 | } 123 | return false; 124 | } 125 | 126 | void TKeyItem::press() 127 | { 128 | fPressed = true; 129 | } 130 | 131 | bool TKeyItem::release( int keycode ) 132 | { 133 | if (fMatchedKeycodes.contains(keycode)) { 134 | fPressed = false; 135 | return true; 136 | } 137 | return false; 138 | } 139 | 140 | void TKeyItem::release() 141 | { 142 | fPressed = false; 143 | } 144 | 145 | bool TKeyItem::pressed() 146 | { 147 | return fPressed; 148 | } 149 | 150 | void TKeyItem::hold() 151 | { 152 | fPressed = true; 153 | fHold = true; 154 | } 155 | 156 | int TKeyItem::row() 157 | { 158 | return fRow; 159 | } 160 | 161 | int TKeyItem::column() 162 | { 163 | return fColumn; 164 | } 165 | -------------------------------------------------------------------------------- /Sim800/MainFrm.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | TMainFrm 4 | 5 | 6 | 7 | 0 8 | 0 9 | 807 10 | 675 11 | 12 | 13 | 14 | SIM800 15 | 16 | 17 | 18 | 19 | 20 | 21 | Qt::Vertical 22 | 23 | 24 | 25 | true 26 | 27 | 28 | 29 | 30 | 0 31 | 0 32 | 787 33 | 420 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 768 42 | 324 43 | 44 | 45 | 46 | 47 | 768 48 | 324 49 | 50 | 51 | 52 | 53 | 768 54 | 324 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 320 66 | 140 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 0 81 | 0 82 | 807 83 | 21 84 | 85 | 86 | 87 | 88 | &Emulation 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | &Start 100 | 101 | 102 | 103 | 104 | &Restart 105 | 106 | 107 | 108 | 109 | Boot FC bin 110 | 111 | 112 | 113 | 114 | 115 | MyZoomWidget 116 | QLabel 117 |
MyZoomWidget.h
118 |
119 |
120 | 121 | 122 | 123 | actionEmulationStart 124 | triggered() 125 | TMainFrm 126 | onEmulationStartClicked() 127 | 128 | 129 | -1 130 | -1 131 | 132 | 133 | 399 134 | 299 135 | 136 | 137 | 138 | 139 | actionEmulationRestart 140 | triggered() 141 | TMainFrm 142 | onEmulationRestartClicked() 143 | 144 | 145 | -1 146 | -1 147 | 148 | 149 | 399 150 | 299 151 | 152 | 153 | 154 | 155 | actionEmulationTest 156 | triggered() 157 | TMainFrm 158 | onEmulationTestClicked() 159 | 160 | 161 | -1 162 | -1 163 | 164 | 165 | 399 166 | 299 167 | 168 | 169 | 170 | 171 | 172 | onEmulationStartClicked() 173 | onEmulationRestartClicked() 174 | onEmulationTestClicked() 175 | 176 |
177 | -------------------------------------------------------------------------------- /Sim800/ANSI/w65c02.h: -------------------------------------------------------------------------------- 1 | #ifndef _WQX_65C02_H 2 | #define _WQX_65C02_H 3 | 4 | #ifdef _WIN32 5 | #define WIN32_LEAN_AND_MEAN 6 | #include 7 | #else 8 | #include "wintypes.h" 9 | #include 10 | #endif 11 | #include 12 | #include 13 | 14 | #define __iocallconv __fastcall 15 | 16 | typedef BYTE(__iocallconv *iofunction1)(BYTE); 17 | typedef void (__iocallconv *iofunction2)(BYTE, BYTE); 18 | 19 | typedef struct _regsrec { 20 | BYTE a; // accumulator 21 | BYTE x; // index X 22 | BYTE y; // index Y 23 | BYTE ps; // processor status 24 | WORD pc; // program counter 25 | WORD sp; // stack pointer 26 | } regsrec, *regsptr; 27 | 28 | extern iofunction1 ioread[0x40]; 29 | extern iofunction2 iowrite[0x40]; 30 | extern void checkflashprogram(WORD addr, BYTE data); 31 | 32 | extern unsigned char fixedram0000[0x10002]; // just like simulator 33 | extern unsigned char* pmemmap[8]; // 0000~1FFF ... E000~FFFF 34 | extern unsigned char* may4000ptr; // TODO: move into NekoDriver.h 35 | extern unsigned char* norbankheader[0x10]; 36 | extern unsigned char* volume0array[0x100]; 37 | extern unsigned char* volume1array[0x100]; 38 | extern unsigned char* bbsbankheader[0x10]; 39 | 40 | extern WORD iorange; 41 | extern regsrec regs; 42 | extern BOOL restart; 43 | extern BOOL g_irq; // FIXME: NO MORE REVERSE 44 | extern BOOL g_nmi; // FIXME: NO MORE REVERSE 45 | extern BOOL g_wai, g_wai_saved; 46 | extern BOOL g_stp; 47 | 48 | 49 | 50 | DWORD CpuExecute(); 51 | void CpuInitialize(); 52 | void MemDestroy(); 53 | void MemInitialize(); 54 | void MemReset(); 55 | 56 | 57 | 58 | unsigned char GetByte(unsigned short address); 59 | unsigned short GetWord(unsigned short address); 60 | 61 | // 62 | // Status Register Bits 63 | // 64 | #define AF_SIGN 0x80 65 | #define AF_OVERFLOW 0x40 66 | #define AF_RESERVED 0x20 67 | #define AF_BREAK 0x10 68 | #define AF_DECIMAL 0x08 69 | #define AF_INTERRUPT 0x04 70 | #define AF_ZERO 0x02 71 | #define AF_CARRY 0x01 72 | 73 | // Handy 74 | 75 | #ifdef TRACE_CPU 76 | 77 | #define TRACE_CPU0(msg) _RPT1(_CRT_WARN,"C65C02::"msg" (Time=%012d)\n",gSystemCycleCount) 78 | #define TRACE_CPU1(msg,arg1) _RPT2(_CRT_WARN,"C65C02::"msg" (Time=%012d)\n",arg1,gSystemCycleCount) 79 | #define TRACE_CPU2(msg,arg1,arg2) _RPT3(_CRT_WARN,"C65C02::"msg" (Time=%012d)\n",arg1,arg2,gSystemCycleCount) 80 | #define TRACE_CPU3(msg,arg1,arg2,arg3) _RPT4(_CRT_WARN,"C65C02::"msg" (Time=%012d)\n",arg1,arg2,arg3,gSystemCycleCount) 81 | 82 | #else 83 | 84 | #define TRACE_CPU0(msg) 85 | #define TRACE_CPU1(msg,arg1) 86 | #define TRACE_CPU2(msg,arg1,arg2) 87 | #define TRACE_CPU3(msg,arg1,arg2,arg3) 88 | 89 | #endif 90 | 91 | 92 | // 93 | // Handy definitions 94 | // 95 | 96 | #define NMI_VECTOR 0xfffa 97 | #define BOOT_VECTOR 0xfffc 98 | #define IRQ_VECTOR 0xfffe 99 | 100 | #define MAX_CPU_BREAKPOINTS 8 101 | 102 | // 103 | // ACCESS MACROS 104 | // 105 | 106 | //#define CPU_PEEK(m) (mSystem.Peek_CPU(m)) 107 | //#define CPU_PEEKW(m) (mSystem.PeekW_CPU(m)) 108 | //#define CPU_POKE(m1,m2) (mSystem.Poke_CPU(m1,m2)) 109 | 110 | //#define CPU_PEEK(m) (((m<0xfc00)?mRamPointer[m]:mSystem.Peek_CPU(m))) 111 | //#define CPU_PEEKW(m) (((m<0xfc00)?(mRamPointer[m]+(mRamPointer[m+1]<<8)):mSystem.PeekW_CPU(m))) 112 | //#define CPU_POKE(m1,m2) {if(m1<0xfc00) mRamPointer[m1]=m2; else mSystem.Poke_CPU(m1,m2);} 113 | 114 | // Don't use ++/-- in addr, or will be execute multi time 115 | #define CPU_PEEK(addr) ((addr < iorange) \ 116 | ? ioread[addr & 0xFF]((BYTE)(addr & 0xff)) \ 117 | : *(pmemmap[unsigned(addr) >> 0xD] + (addr & 0x1FFF))) 118 | #define CPU_PEEKW(addr) (CPU_PEEK((addr)) + (CPU_PEEK((addr + 1)) << 8)) 119 | #define CPU_POKE(addr, a) { if ((addr >= iorange)) { \ 120 | if ((addr < 0x4000)) { \ 121 | *(pmemmap[unsigned(addr) >> 0xD] + (addr & 0x1FFF)) = (BYTE)(a); \ 122 | } else { \ 123 | checkflashprogram(addr, (BYTE)(a)); \ 124 | } \ 125 | } else { \ 126 | iowrite[addr & 0xFF]((BYTE)(addr & 0xff),(BYTE)(a)); \ 127 | } \ 128 | } 129 | 130 | enum { illegal = 0, 131 | accu, 132 | imm, 133 | absl, 134 | zp, 135 | zpx, 136 | zpy, 137 | absx, 138 | absy, 139 | iabsx, 140 | impl, 141 | rel, 142 | zrel, 143 | indx, 144 | indy, 145 | iabs, 146 | ind 147 | }; 148 | 149 | //typedef struct { 150 | // int PS; // Processor status register 8 bits 151 | // int A; // Accumulator 8 bits 152 | // int X; // X index register 8 bits 153 | // int Y; // Y index register 8 bits 154 | // int SP; // Stack Pointer 8 bits 155 | // int Opcode; // Instruction opcode 8 bits 156 | // int Operand;// Instructions operand 16 bits 157 | // int PC; // Program Counter 16 bits 158 | // bool NMI; 159 | // bool IRQ; 160 | // bool WAIT; 161 | //#ifdef _LYNXDBG 162 | // int cpuBreakpoints[MAX_CPU_BREAKPOINTS]; 163 | //#endif 164 | //} C6502_REGS; 165 | 166 | //CSystemBase &mSystem; 167 | 168 | // CPU Flags & status 169 | 170 | extern int mA; // Accumulator 8 bits 171 | extern int mX; // X index register 8 bits 172 | extern int mY; // Y index register 8 bits 173 | extern int mSP; // Stack Pointer 8 bits 174 | extern int mOpcode; // Instruction opcode 8 bits 175 | extern int mOperand; // Instructions operand 16 bits 176 | extern int mPC; // Program Counter 16 bits 177 | 178 | extern int mN; // N flag for processor status register 179 | extern int mV; // V flag for processor status register 180 | extern int mB; // B flag for processor status register 181 | extern int mD; // D flag for processor status register 182 | extern int mI; // I flag for processor status register 183 | extern int mZ; // Z flag for processor status register 184 | extern int mC; // C flag for processor status register 185 | 186 | extern int mIRQActive; 187 | 188 | #ifdef _LYNXDBG 189 | extern int mPcBreakpoints[MAX_CPU_BREAKPOINTS]; 190 | extern int mDbgFlag; 191 | #endif 192 | //UBYTE *mRamPointer; 193 | 194 | // Associated lookup tables 195 | 196 | extern int mBCDTable[2][256]; 197 | 198 | // 199 | // Opcode prototypes 200 | // 201 | 202 | int PS(); 203 | void setPS(int ps); 204 | 205 | #endif 206 | -------------------------------------------------------------------------------- /Sim800/Sim800.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | PpsDES/24x24-tango/document-new.png 4 | PpsDES/24x24-tango/emblem-unreadable.png 5 | PpsDES/24x24-tango/document-open.png 6 | PpsDES/16x16-tango/go-first.png 7 | PpsDES/16x16-tango/emblem-symbolic-link.png 8 | PpsDES/16x16-tango/edit-undo.png 9 | PpsDES/16x16-tango/mail-attachment.png 10 | PpsDES/24x24-tango/document-save.png 11 | PpsDES/24x24-tango/system-installer.png 12 | PpsDES/16x16-tango/system-shutdown.png 13 | PpsDES/16x16-tango/drive-removable-media.png 14 | PpsDES/24x24-tango/system-file-manager.png 15 | PpsDES/24x24-tango/document-save-as.png 16 | PpsDES/24x24-tango/exit.png 17 | PpsDES/16x16-tango/application-certificate.png 18 | PpsDES/24x24-tango/document-print.png 19 | PpsDES/16x16-tango/edit-clear.png 20 | PpsDES/16x16-tango/edit-find.png 21 | PpsDES/16x16-tango/video.png 22 | PpsDES/16x16-tango/zip.png 23 | PpsDES/16x16-tango/document.png 24 | PpsDES/16x16-tango/emblem-system.png 25 | PpsDES/16x16-tango/emblem-unreadable.png 26 | PpsDES/16x16-tango/empty.png 27 | PpsDES/16x16-tango/emptytrash.png 28 | PpsDES/16x16-tango/exec.png 29 | PpsDES/16x16-tango/image.png 30 | PpsDES/16x16-tango/info.png 31 | PpsDES/16x16-tango/locked.png 32 | PpsDES/16x16-tango/preferences-desktop.png 33 | PpsDES/16x16-tango/shellscript.png 34 | PpsDES/16x16-tango/sound.png 35 | PpsDES/16x16-tango/trashcan_full.png 36 | PpsDES/Cloaking.png 37 | PpsDES/16x16-gnome2/folder_open.png 38 | PpsDES/16x16-gnome2/stock_folder.png 39 | PpsDES/24x24-tango/tab-new.png 40 | PpsDES/16x16-gnome2/stock_data-query-rename.png 41 | PpsDES/16x16-tango/tab-new.png 42 | PpsDES/16x16-gnome2/gnome-mime-application-vnd.oasis.opendocument.presentation-template.png 43 | PpsDES/16x16-gnome2/filesave.png 44 | PpsDES/16x16-tango/list-add.png 45 | PpsDES/16x16-tango/list-remove.png 46 | PpsDES/16x16-tango/go-bottom.png 47 | PpsDES/16x16-tango/go-down.png 48 | PpsDES/16x16-tango/go-top.png 49 | PpsDES/16x16-tango/go-up.png 50 | PpsDES/16x16-gnome2/view-sort-ascending.png 51 | PpsDES/24x24-gnome/document.png 52 | PpsDES/24x24-gnome/folder_tar.png 53 | PpsDES/24x24-unofficetango/folder_tar.png 54 | PpsDES/24x24-unofficetango/gnome-mime-application-msword.png 55 | 56 | 57 | PpsDES/lcdstripe/WQX_ALARM.png 58 | PpsDES/lcdstripe/WQX_BATTERY.png 59 | PpsDES/lcdstripe/WQX_CAPS.png 60 | PpsDES/lcdstripe/WQX_DOWN.png 61 | PpsDES/lcdstripe/WQX_ENG.png 62 | PpsDES/lcdstripe/WQX_FLASH.png 63 | PpsDES/lcdstripe/WQX_HBAR.png 64 | PpsDES/lcdstripe/WQX_KEYCLICK.png 65 | PpsDES/lcdstripe/WQX_LEFT.png 66 | PpsDES/lcdstripe/WQX_LINE.png 67 | PpsDES/lcdstripe/WQX_MICROPHONE.png 68 | PpsDES/lcdstripe/WQX_MINUS.png 69 | PpsDES/lcdstripe/WQX_NUM.png 70 | PpsDES/lcdstripe/WQX_PGDOWN.png 71 | PpsDES/lcdstripe/WQX_PGLEFT.png 72 | PpsDES/lcdstripe/WQX_PGUP.png 73 | PpsDES/lcdstripe/WQX_POINT.png 74 | PpsDES/lcdstripe/WQX_RIGHT.png 75 | PpsDES/lcdstripe/WQX_SECRET.png 76 | PpsDES/lcdstripe/WQX_SEMICOLON.png 77 | PpsDES/lcdstripe/WQX_SEVEN_H.png 78 | PpsDES/lcdstripe/WQX_SEVEN_V.png 79 | PpsDES/lcdstripe/WQX_SHARPBELL.png 80 | PpsDES/lcdstripe/WQX_SOUND.png 81 | PpsDES/lcdstripe/WQX_SPEAKER.png 82 | PpsDES/lcdstripe/WQX_STAR.png 83 | PpsDES/lcdstripe/WQX_TAPE.png 84 | PpsDES/lcdstripe/WQX_UP.png 85 | PpsDES/lcdstripe/WQX_VBAR.png 86 | PpsDES/lcdstripe/WQX_VFRAME.png 87 | PpsDES/lcdstripe/WQX_HFRAME.png 88 | PpsDES/lcdstripe/WQX_PGRIGHT.png 89 | PpsDES/lcdstripe/WQX_SHIFT.png 90 | PpsDES/lcdstripe/lcdpixel.png 91 | PpsDES/lcdstripe/lcdempty.png 92 | PpsDES/lcdstripe/lcd_alarm.png 93 | PpsDES/lcdstripe/lcd_caps.png 94 | PpsDES/lcdstripe/lcd_down.png 95 | PpsDES/lcdstripe/lcd_eng.png 96 | PpsDES/lcdstripe/lcd_flash.png 97 | PpsDES/lcdstripe/lcd_hbar.png 98 | PpsDES/lcdstripe/lcd_hframe.png 99 | PpsDES/lcdstripe/lcd_line.png 100 | PpsDES/lcdstripe/lcd_line5.png 101 | PpsDES/lcdstripe/lcd_minus.png 102 | PpsDES/lcdstripe/lcd_num.png 103 | PpsDES/lcdstripe/lcd_pgup.png 104 | PpsDES/lcdstripe/lcd_point.png 105 | PpsDES/lcdstripe/lcd_right.png 106 | PpsDES/lcdstripe/lcd_semicolon.png 107 | PpsDES/lcdstripe/lcd_sharpbell.png 108 | PpsDES/lcdstripe/lcd_shift.png 109 | PpsDES/lcdstripe/lcd_sound.png 110 | PpsDES/lcdstripe/lcd_speaker.png 111 | PpsDES/lcdstripe/lcd_star.png 112 | PpsDES/lcdstripe/lcd_tape.png 113 | PpsDES/lcdstripe/lcd_up.png 114 | PpsDES/lcdstripe/lcd_vframe.png 115 | PpsDES/lcdstripe/lcdshadow.png 116 | PpsDES/lcdstripe/lcd_keyclick.png 117 | PpsDES/lcdstripe/lcd_battery.png 118 | PpsDES/lcdstripe/lcd_left.png 119 | PpsDES/lcdstripe/lcd_pgdown.png 120 | PpsDES/lcdstripe/lcd_pgleft.png 121 | PpsDES/lcdstripe/lcd_pgright.png 122 | PpsDES/lcdstripe/lcd_secret.png 123 | PpsDES/lcdstripe/lcd_microphone.png 124 | PpsDES/lcdstripe/lcd_vbar.png 125 | PpsDES/lcdstripe/lcd_seven_honz1.png 126 | PpsDES/lcdstripe/lcd_seven_honz2.png 127 | PpsDES/lcdstripe/lcd_seven_honz3.png 128 | PpsDES/lcdstripe/lcd_seven_vert1.png 129 | PpsDES/lcdstripe/lcd_seven_vert2.png 130 | PpsDES/lcdstripe/lcd_seven_vert3.png 131 | PpsDES/lcdstripe/lcd_seven_vert4.png 132 | 133 | 134 | -------------------------------------------------------------------------------- /Sim800/NekoDriverDebug.cpp: -------------------------------------------------------------------------------- 1 | #include "NekoDriver.h" 2 | extern "C" { 3 | #ifdef HANDYPSP 4 | #include "ANSI/w65c02.h" 5 | #else 6 | #include "ANSI/65C02.h" 7 | #endif 8 | } 9 | #include 10 | 11 | 12 | 13 | #define INVALID1 1 14 | #define INVALID2 2 15 | #define INVALID3 3 16 | #define ADDR_IMM 4 17 | #define ADDR_ABS 5 18 | #define ADDR_ZPG 6 19 | #define ADDR_ABSX 7 20 | #define ADDR_ABSY 8 21 | #define ADDR_ZPGX 9 22 | #define ADDR_ZPGY 10 23 | #define ADDR_REL 11 24 | #define ADDR_BBREL 12 25 | #define ADDR_INDX 13 26 | #define ADDR_ABSIINDX 14 27 | #define ADDR_INDY 15 28 | #define ADDR_IZPG 16 29 | #define ADDR_IABS 17 30 | 31 | 32 | typedef struct _addrrec { 33 | char format[12]; 34 | int bytes; 35 | } addrrec, *addrptr; 36 | 37 | 38 | typedef struct _instrec { 39 | char mnemonic[5]; 40 | int addrmode; 41 | } instrec, *instptr; 42 | 43 | 44 | 45 | addrrec addressmode[19] = { {"" ,1}, // (implied) 46 | {"" ,1}, // INVALID1 47 | {"" ,2}, // INVALID2 48 | {"" ,3}, // INVALID3 49 | {"#$%02X" ,2}, // ADDR_IMM 50 | {"%s" ,3}, // ADDR_ABS 51 | {"%s" ,2}, // ADDR_ZPG 52 | {"%s,X" ,3}, // ADDR_ABSX 53 | {"%s,Y" ,3}, // ADDR_ABSY 54 | {"%s,X" ,2}, // ADDR_ZPGX 55 | {"%s,Y" ,2}, // ADDR_ZPGY 56 | {"%s" ,2}, // ADDR_REL 57 | {"%s %s" ,3}, // ADDR_BBREL 58 | {"(%s,X)" ,2}, // ADDR_INDX 59 | {"(%s,X)" ,3}, // ADDR_ABSIINDX 60 | {"(%s),Y" ,2}, // ADDR_INDY 61 | {"(%s)" ,2}, // ADDR_IZPG 62 | {"(%s)" ,3}, // ADDR_IABS 63 | {"IO PAGE" ,1} }; // ADDR_IO PAGE 64 | 65 | instrec instruction[257] = { {"BRK",ADDR_ABS}, // 00h 66 | {"ORA",ADDR_INDX}, // 01h 67 | {"NOP",INVALID2}, // 02h 68 | {"NOP",INVALID1}, // 03h 69 | {"TSB",ADDR_ZPG}, // 04h 70 | {"ORA",ADDR_ZPG}, // 05h 71 | {"ASL",ADDR_ZPG}, // 06h 72 | {"RMB0",ADDR_ZPG}, // 07h 73 | {"PHP",0}, // 08h 74 | {"ORA",ADDR_IMM}, // 09h 75 | {"ASL",0}, // 0Ah 76 | {"NOP",INVALID1}, // 0Bh 77 | {"TSB",ADDR_ABS}, // 0Ch 78 | {"ORA",ADDR_ABS}, // 0Dh 79 | {"ASL",ADDR_ABS}, // 0Eh 80 | {"BBR0",ADDR_BBREL}, // 0Fh 81 | {"BPL",ADDR_REL}, // 10h 82 | {"ORA",ADDR_INDY}, // 11h 83 | {"ORA",ADDR_IZPG}, // 12h 84 | {"NOP",INVALID1}, // 13h 85 | {"TRB",ADDR_ZPG}, // 14h 86 | {"ORA",ADDR_ZPGX}, // 15h 87 | {"ASL",ADDR_ZPGX}, // 16h 88 | {"RMB1",ADDR_ZPG}, // 17h 89 | {"CLC",0}, // 18h 90 | {"ORA",ADDR_ABSY}, // 19h 91 | {"INA",0}, // 1Ah 92 | {"NOP",INVALID1}, // 1Bh 93 | {"TRB",ADDR_ABS}, // 1Ch 94 | {"ORA",ADDR_ABSX}, // 1Dh 95 | {"ASL",ADDR_ABSX}, // 1Eh 96 | {"BBR1",ADDR_BBREL}, // 1Fh 97 | {"JSR",ADDR_ABS}, // 20h 98 | {"AND",ADDR_INDX}, // 21h 99 | {"NOP",INVALID2}, // 22h 100 | {"NOP",INVALID1}, // 23h 101 | {"BIT",ADDR_ZPG}, // 24h 102 | {"AND",ADDR_ZPG}, // 25h 103 | {"ROL",ADDR_ZPG}, // 26h 104 | {"RMB2",ADDR_ZPG}, // 27h 105 | {"PLP",0}, // 28h 106 | {"AND",ADDR_IMM}, // 29h 107 | {"ROL",0}, // 2Ah 108 | {"NOP",INVALID1}, // 2Bh 109 | {"BIT",ADDR_ABS}, // 2Ch 110 | {"AND",ADDR_ABS}, // 2Dh 111 | {"ROL",ADDR_ABS}, // 2Eh 112 | {"BBR2",ADDR_BBREL}, // 2Fh 113 | {"BMI",ADDR_REL}, // 30h 114 | {"AND",ADDR_INDY}, // 31h 115 | {"AND",ADDR_IZPG}, // 32h 116 | {"NOP",INVALID1}, // 33h 117 | {"BIT",ADDR_ZPGX}, // 34h 118 | {"AND",ADDR_ZPGX}, // 35h 119 | {"ROL",ADDR_ZPGX}, // 36h 120 | {"RMB3",ADDR_ZPG}, // 37h 121 | {"SEC",0}, // 38h 122 | {"AND",ADDR_ABSY}, // 39h 123 | {"DEA",0}, // 3Ah 124 | {"NOP",INVALID1}, // 3Bh 125 | {"BIT",ADDR_ABSX}, // 3Ch 126 | {"AND",ADDR_ABSX}, // 3Dh 127 | {"ROL",ADDR_ABSX}, // 3Eh 128 | {"BBR3",ADDR_BBREL}, // 3Fh 129 | {"RTI",0}, // 40h 130 | {"EOR",ADDR_INDX}, // 41h 131 | {"NOP",INVALID2}, // 42h 132 | {"NOP",INVALID1}, // 43h 133 | {"NOP",INVALID2}, // 44h 134 | {"EOR",ADDR_ZPG}, // 45h 135 | {"LSR",ADDR_ZPG}, // 46h 136 | {"RMB4",ADDR_ZPG}, // 47h 137 | {"PHA",0}, // 48h 138 | {"EOR",ADDR_IMM}, // 49h 139 | {"LSR",0}, // 4Ah 140 | {"NOP",INVALID1}, // 4Bh 141 | {"JMP",ADDR_ABS}, // 4Ch 142 | {"EOR",ADDR_ABS}, // 4Dh 143 | {"LSR",ADDR_ABS}, // 4Eh 144 | {"BBR4",ADDR_BBREL}, // 4Fh 145 | {"BVC",ADDR_REL}, // 50h 146 | {"EOR",ADDR_INDY}, // 51h 147 | {"EOR",ADDR_IZPG}, // 52h 148 | {"NOP",INVALID1}, // 53h 149 | {"NOP",INVALID2}, // 54h 150 | {"EOR",ADDR_ZPGX}, // 55h 151 | {"LSR",ADDR_ZPGX}, // 56h 152 | {"RMB5",ADDR_ZPG}, // 57h 153 | {"CLI",0}, // 58h 154 | {"EOR",ADDR_ABSY}, // 59h 155 | {"PHY",0}, // 5Ah 156 | {"NOP",INVALID1}, // 5Bh 157 | {"NOP",INVALID3}, // 5Ch 158 | {"EOR",ADDR_ABSX}, // 5Dh 159 | {"LSR",ADDR_ABSX}, // 5Eh 160 | {"BBR5",ADDR_BBREL}, // 5Fh 161 | {"RTS",0}, // 60h 162 | {"ADC",ADDR_INDX}, // 61h 163 | {"NOP",INVALID2}, // 62h 164 | {"NOP",INVALID1}, // 63h 165 | {"STZ",ADDR_ZPG}, // 64h 166 | {"ADC",ADDR_ZPG}, // 65h 167 | {"ROR",ADDR_ZPG}, // 66h 168 | {"RMB6",ADDR_ZPG}, // 67h 169 | {"PLA",0}, // 68h 170 | {"ADC",ADDR_IMM}, // 69h 171 | {"ROR",0}, // 6Ah 172 | {"NOP",INVALID1}, // 6Bh 173 | {"JMP",ADDR_IABS}, // 6Ch 174 | {"ADC",ADDR_ABS}, // 6Dh 175 | {"ROR",ADDR_ABS}, // 6Eh 176 | {"BBR6",ADDR_BBREL}, // 6Fh 177 | {"BVS",ADDR_REL}, // 70h 178 | {"ADC",ADDR_INDY}, // 71h 179 | {"ADC",ADDR_IZPG}, // 72h 180 | {"NOP",INVALID1}, // 73h 181 | {"STZ",ADDR_ZPGX}, // 74h 182 | {"ADC",ADDR_ZPGX}, // 75h 183 | {"ROR",ADDR_ZPGX}, // 76h 184 | {"RMB7",ADDR_ZPG}, // 77h 185 | {"SEI",0}, // 78h 186 | {"ADC",ADDR_ABSY}, // 79h 187 | {"PLY",0}, // 7Ah 188 | {"NOP",INVALID1}, // 7Bh 189 | {"JMP",ADDR_ABSIINDX}, // 7Ch 190 | {"ADC",ADDR_ABSX}, // 7Dh 191 | {"ROR",ADDR_ABSX}, // 7Eh 192 | {"BBR7",ADDR_BBREL}, // 7Fh 193 | {"BRA",ADDR_REL}, // 80h 194 | {"STA",ADDR_INDX}, // 81h 195 | {"NOP",INVALID2}, // 82h 196 | {"NOP",INVALID1}, // 83h 197 | {"STY",ADDR_ZPG}, // 84h 198 | {"STA",ADDR_ZPG}, // 85h 199 | {"STX",ADDR_ZPG}, // 86h 200 | {"SMB0",ADDR_ZPG}, // 87h 201 | {"DEY",0}, // 88h 202 | {"BIT",ADDR_IMM}, // 89h 203 | {"TXA",0}, // 8Ah 204 | {"NOP",INVALID1}, // 8Bh 205 | {"STY",ADDR_ABS}, // 8Ch 206 | {"STA",ADDR_ABS}, // 8Dh 207 | {"STX",ADDR_ABS}, // 8Eh 208 | {"BBS0",ADDR_BBREL}, // 8Fh 209 | {"BCC",ADDR_REL}, // 90h 210 | {"STA",ADDR_INDY}, // 91h 211 | {"STA",ADDR_IZPG}, // 92h 212 | {"NOP",INVALID1}, // 93h 213 | {"STY",ADDR_ZPGX}, // 94h 214 | {"STA",ADDR_ZPGX}, // 95h 215 | {"STX",ADDR_ZPGY}, // 96h 216 | {"SMB1",ADDR_ZPG}, // 97h 217 | {"TYA",0}, // 98h 218 | {"STA",ADDR_ABSY}, // 99h 219 | {"TXS",0}, // 9Ah 220 | {"NOP",INVALID1}, // 9Bh 221 | {"STZ",ADDR_ABS}, // 9Ch 222 | {"STA",ADDR_ABSX}, // 9Dh 223 | {"STZ",ADDR_ABSX}, // 9Eh 224 | {"BBS1",ADDR_BBREL}, // 9Fh 225 | {"LDY",ADDR_IMM}, // A0h 226 | {"LDA",ADDR_INDX}, // A1h 227 | {"LDX",ADDR_IMM}, // A2h 228 | {"NOP",INVALID1}, // A3h 229 | {"LDY",ADDR_ZPG}, // A4h 230 | {"LDA",ADDR_ZPG}, // A5h 231 | {"LDX",ADDR_ZPG}, // A6h 232 | {"SMB2",ADDR_ZPG}, // A7h 233 | {"TAY",0}, // A8h 234 | {"LDA",ADDR_IMM}, // A9h 235 | {"TAX",0}, // AAh 236 | {"NOP",INVALID1}, // ABh 237 | {"LDY",ADDR_ABS}, // ACh 238 | {"LDA",ADDR_ABS}, // ADh 239 | {"LDX",ADDR_ABS}, // AEh 240 | {"BBS2",ADDR_BBREL}, // AFh 241 | {"BCS",ADDR_REL}, // B0h 242 | {"LDA",ADDR_INDY}, // B1h 243 | {"LDA",ADDR_IZPG}, // B2h 244 | {"NOP",INVALID1}, // B3h 245 | {"LDY",ADDR_ZPGX}, // B4h 246 | {"LDA",ADDR_ZPGX}, // B5h 247 | {"LDX",ADDR_ZPGY}, // B6h 248 | {"SMB3",ADDR_ZPG}, // B7h 249 | {"CLV",0}, // B8h 250 | {"LDA",ADDR_ABSY}, // B9h 251 | {"TSX",0}, // BAh 252 | {"NOP",INVALID1}, // BBh 253 | {"LDY",ADDR_ABSX}, // BCh 254 | {"LDA",ADDR_ABSX}, // BDh 255 | {"LDX",ADDR_ABSY}, // BEh 256 | {"BBS3",ADDR_BBREL}, // BFh 257 | {"CPY",ADDR_IMM}, // C0h 258 | {"CMP",ADDR_INDX}, // C1h 259 | {"NOP",INVALID2}, // C2h 260 | {"NOP",INVALID1}, // C3h 261 | {"CPY",ADDR_ZPG}, // C4h 262 | {"CMP",ADDR_ZPG}, // C5h 263 | {"DEC",ADDR_ZPG}, // C6h 264 | {"SMB4",ADDR_ZPG}, // C7h 265 | {"INY",0}, // C8h 266 | {"CMP",ADDR_IMM}, // C9h 267 | {"DEX",0}, // CAh 268 | {"WAI",INVALID1}, // CBh 269 | {"CPY",ADDR_ABS}, // CCh 270 | {"CMP",ADDR_ABS}, // CDh 271 | {"DEC",ADDR_ABS}, // CEh 272 | {"BBS4",ADDR_BBREL}, // CFh 273 | {"BNE",ADDR_REL}, // D0h 274 | {"CMP",ADDR_INDY}, // D1h 275 | {"CMP",ADDR_IZPG}, // D2h 276 | {"NOP",INVALID1}, // D3h 277 | {"NOP",INVALID2}, // D4h 278 | {"CMP",ADDR_ZPGX}, // D5h 279 | {"DEC",ADDR_ZPGX}, // D6h 280 | {"SMB5",ADDR_ZPG}, // D7h 281 | {"CLD",0}, // D8h 282 | {"CMP",ADDR_ABSY}, // D9h 283 | {"PHX",0}, // DAh 284 | {"STP",INVALID1}, // DBh 285 | {"NOP",INVALID3}, // DCh 286 | {"CMP",ADDR_ABSX}, // DDh 287 | {"DEC",ADDR_ABSX}, // DEh 288 | {"BBS5",ADDR_BBREL}, // DFh 289 | {"CPX",ADDR_IMM}, // E0h 290 | {"SBC",ADDR_INDX}, // E1h 291 | {"NOP",INVALID2}, // E2h 292 | {"NOP",INVALID1}, // E3h 293 | {"CPX",ADDR_ZPG}, // E4h 294 | {"SBC",ADDR_ZPG}, // E5h 295 | {"INC",ADDR_ZPG}, // E6h 296 | {"SMB6",ADDR_ZPG}, // E7h 297 | {"INX",0}, // E8h 298 | {"SBC",ADDR_IMM}, // E9h 299 | {"NOP",0}, // EAh 300 | {"NOP",INVALID1}, // EBh 301 | {"CPX",ADDR_ABS}, // ECh 302 | {"SBC",ADDR_ABS}, // EDh 303 | {"INC",ADDR_ABS}, // EEh 304 | {"BBS6",ADDR_BBREL}, // EFh 305 | {"BEQ",ADDR_REL}, // F0h 306 | {"SBC",ADDR_INDY}, // F1h 307 | {"SBC",ADDR_IZPG}, // F2h 308 | {"NOP",INVALID1}, // F3h 309 | {"NOP",INVALID2}, // F4h 310 | {"SBC",ADDR_ZPGX}, // F5h 311 | {"INC",ADDR_ZPGX}, // F6h 312 | {"SMB7",ADDR_ZPG}, // F7h 313 | {"SED",0}, // F8h 314 | {"SBC",ADDR_ABSY}, // F9h 315 | {"PLX",0}, // FAh 316 | {"NOP",INVALID1}, // FBh 317 | {"NOP",INVALID3}, // FCh 318 | {"SBC",ADDR_ABSX}, // FDh 319 | {"INC",ADDR_ABSX}, // FEh 320 | {"BBS7",ADDR_BBREL}, // FFh 321 | {" ",18} }; // 100h 322 | 323 | 324 | FILE* logfile = NULL; 325 | 326 | const char* GetSymbol(WORD address, int bytes); 327 | const char* byte_to_binary(unsigned char c, char* b); 328 | 329 | 330 | unsigned logpos = 0; 331 | 332 | char logbuff [102400 * 50]; // 5M buffer. no need initialize 333 | 334 | WORD LogDisassembly(WORD offset, char* text) 335 | { 336 | if (logfile == NULL) { 337 | wchar_t* filepath = new wchar_t[MAX_PATH]; 338 | _wgetcwd(filepath, MAX_PATH); 339 | wcscat(filepath, L"\\Sim800.txt"); 340 | //logfile = _tfopen(filepath, TEXT("w")); 341 | errno_t error = _wfopen_s(&logfile, filepath, L"wt"); 342 | delete[] filepath; 343 | if (logfile == NULL) { 344 | return 0; // Fake! 345 | } 346 | fprintf(logfile, "================================\n"); 347 | } 348 | char addresstext[40] = ""; 349 | char bytestext[10] = ""; 350 | //char fulltext[50] = ""; 351 | WORD inst = GetByte(offset); 352 | 353 | if (offset < iorange) { 354 | // Register address can't be executed 355 | inst = 0x100; 356 | } 357 | 358 | int addrmode = instruction[inst].addrmode; 359 | WORD bytes = addressmode[addrmode].bytes; 360 | 361 | 362 | // Build a string containing the target address or symbol 363 | if (addressmode[addrmode].format[0]) { 364 | 365 | WORD address = GetWord((offset + 1) & 0xffff); 366 | 367 | if (bytes == 2) 368 | address &= 0xFF; 369 | 370 | if (addrmode == ADDR_IMM) { 371 | WORD address = GetWord((offset + 1) & 0xffff) & 0xFF; 372 | sprintf(addresstext, 373 | addressmode[addrmode].format, 374 | (unsigned)address); 375 | } 376 | if (addrmode == ADDR_REL) { 377 | address = (offset + 2 + (int)(signed char)address) & 0xffff; 378 | sprintf(addresstext, 379 | addressmode[addrmode].format, 380 | (LPSTR)GetSymbol(address, bytes)); 381 | } 382 | if (addrmode == ADDR_BBREL) { 383 | address &= 0xFF; 384 | WORD zpaddr = address; 385 | address = GetWord((offset + 2) & 0xffff); //*(LPWORD)(mem+((offset+2) & 0xffff)); 386 | address &= 0xFF; 387 | address = (offset + 3 + (int)(signed char)address) & 0xffff; 388 | 389 | char zptxt[14]; 390 | sprintf(zptxt, "%s", (LPSTR)GetSymbol(zpaddr, 2)); 391 | sprintf(addresstext, 392 | addressmode[addrmode].format, 393 | zptxt, 394 | (LPSTR)GetSymbol(address, 3)); 395 | } 396 | 397 | if (addresstext[0] == 0) {//else 398 | sprintf(addresstext, 399 | addressmode[addrmode].format, 400 | (LPSTR)GetSymbol(address, bytes)); 401 | } 402 | } 403 | 404 | // Build a string containing the actual bytes that make up this 405 | // instruction 406 | { 407 | int loop = 0; 408 | while (loop < bytes) 409 | sprintf(bytestext + strlen(bytestext), 410 | "%02X", 411 | GetByte(offset + (loop++))); 412 | while (strlen(bytestext) < 6) 413 | strcat(bytestext, " "); 414 | } 415 | 416 | 417 | // Put together all of the different elements that will make up the line 418 | //if (logpos > 102400*50 - 50) { 419 | // // Remove tail 420 | // logbuff[logpos - 1] = 0; 421 | // qDebug("%s", &logbuff); 422 | // // Reset 423 | // logpos = 0; 424 | //} 425 | if (logpos > 102400 * 50 - 80) { 426 | fwrite(logbuff, logpos, 1, logfile); 427 | fflush(logfile); 428 | logpos = 0; 429 | } 430 | char psbin[9]; 431 | #ifdef HANDYPSP 432 | byte_to_binary(PS(), psbin); 433 | #else 434 | byte_to_binary(regs.ps, psbin); 435 | #endif 436 | logpos += sprintf(&logbuff[logpos], 437 | //sprintf(fulltext, 438 | "%04X %s %-4s %-8s %02X %02X %02X %04X %s\n", 439 | (unsigned)offset, // 4000 440 | bytestext, // 0149__ 441 | //(LPSTR)GetSymbol(offset,0), // 442 | instruction[inst].mnemonic, // ORA_ 443 | addresstext, //); // ($49,X) 444 | #ifdef HANDYPSP 445 | mA, 446 | mX, 447 | mY, 448 | mSP | 0x100, 449 | #else 450 | regs.a, 451 | regs.x, 452 | regs.y, 453 | regs.sp, 454 | #endif 455 | psbin 456 | ); 457 | //if (text) 458 | // strcpy(text,fulltext); 459 | //qDebug("%s", fulltext); 460 | 461 | return bytes; 462 | } 463 | 464 | const char* GetSymbol(WORD address, int bytes) 465 | { 466 | // If there is no symbol for this address, then just return a string 467 | // containing the address number 468 | static char buffer[8]; 469 | switch (bytes) { 470 | case 2: 471 | sprintf(buffer, "$%02X", (unsigned)address); 472 | break; 473 | case 3: 474 | sprintf(buffer, "$%04X", (unsigned)address); 475 | break; 476 | default: 477 | buffer[0] = 0; 478 | break; 479 | } 480 | return buffer; 481 | } 482 | 483 | const char* byte_to_binary(unsigned char c, char* b) 484 | { 485 | //static char b[9]; // TODO: threadsafe 486 | 487 | int i = 0; 488 | for (unsigned char z = 128; z > 0; z >>= 1) { 489 | b[i] = ((c & z) == z ? '1' : '0'); 490 | i++; 491 | } 492 | b[i] = '\0'; 493 | 494 | return b; 495 | } 496 | 497 | void AppendLog(const char* text) 498 | { 499 | if (logpos > 102400 * 50 - 50) { 500 | fwrite(logbuff, logpos, 1, logfile); 501 | fflush(logfile); 502 | logpos = 0; 503 | } 504 | logpos += sprintf(&logbuff[logpos], "%s\n", text); 505 | } 506 | // 507 | // ----- ALL GLOBALLY ACCESSIBLE FUNCTIONS ARE BELOW THIS LINE ----- 508 | // 509 | 510 | -------------------------------------------------------------------------------- /Sim800/NekoDriverIO.cpp: -------------------------------------------------------------------------------- 1 | #include "NekoDriver.h" 2 | extern "C" { 3 | #ifdef HANDYPSP 4 | #include "ANSI/w65c02.h" 5 | #else 6 | #include "ANSI/65C02.h" 7 | #endif 8 | } 9 | #include "CC800IOName.h" 10 | #define WIN32_LEAN_AND_MEAN 11 | #include 12 | 13 | 14 | bool timer0started = false; 15 | bool timer1started = false; 16 | 17 | // WQXSIM 18 | bool timer0waveoutstart = false; 19 | int prevtimer0value = 0; 20 | unsigned short gThreadFlags; 21 | unsigned char* gGeneralCtrlPtr; 22 | unsigned short mayGenralnClockCtrlValue; 23 | 24 | BYTE __iocallconv Read05StartTimer0( BYTE ) // 05 25 | { 26 | // SPDC1016 27 | qDebug("ggv wanna start timer0"); 28 | timer0started = true; 29 | if (fixedram0000[io02_timer0_val] == 0x3F) { 30 | //gTimer0WaveoutStarted = 1; 31 | //mayTimer0Var1 = 0; 32 | //maypTimer0VarA8 = (int)&unk_4586A8; 33 | //mayTimer0Var2 = 0; 34 | //mayIO2345Var1 = 0; 35 | //ResetWaveout(&pwh); 36 | //OpenWaveout((DWORD_PTR)&pwh, 0x1F40u); 37 | timer0waveoutstart = true; 38 | } 39 | prevtimer0value = fixedram0000[io02_timer0_val]; 40 | return fixedram0000[io05_clock_ctrl]; // follow rulz by GGV 41 | } 42 | 43 | BYTE __iocallconv Read04StopTimer0( BYTE ) // 04 44 | { 45 | // SPDC1016 46 | qDebug("ggv wanna stop timer0"); 47 | //byte r = fixedram0000[io02_timer0_val]; 48 | //fixedram0000[io02_timer0_val] = 0; 49 | //if ( gTimer0WaveoutStarted ) 50 | //{ 51 | // if ( mayIO2345Var1 > 0 ) 52 | // byte_4603B8[mayIO45Var3x] = 1; 53 | // CloseWaveout(&pwh); 54 | // gTimer0WaveoutStarted = 0; 55 | //} 56 | timer0started = false; 57 | if (timer0waveoutstart) { 58 | timer0waveoutstart = false; 59 | } 60 | return fixedram0000[io04_general_ctrl]; 61 | } 62 | 63 | BYTE __iocallconv Read07StartTimer1( BYTE ) // 07 64 | { 65 | // SPDC1016 66 | //qDebug("ggv wanna start timer1"); 67 | //timer1started = true; 68 | gThreadFlags &= 0xFFFDu; // Remove 0x02 69 | return fixedram0000[io07_port_config]; 70 | } 71 | 72 | BYTE __iocallconv Read06StopTimer1( BYTE ) // 06 73 | { 74 | // Stop timer1, and return time1 value 75 | // SPDC1016 76 | //qDebug("ggv wanna stop timer1"); 77 | //byte r = fixedram0000[io03_timer1_val]; 78 | //fixedram0000[io03_timer1_val] = 0; 79 | //timer1started = false; 80 | gThreadFlags |= 0x02; // Add 0x02 81 | gGeneralCtrlPtr = &fixedram0000[io04_general_ctrl]; 82 | mayGenralnClockCtrlValue = *gGeneralCtrlPtr; 83 | return fixedram0000[io06_lcd_config]; 84 | } 85 | 86 | bool lcdoffshift0flag = false; 87 | 88 | void __iocallconv Write05ClockCtrl( BYTE write, BYTE value ) 89 | { 90 | // FROM WQXSIM 91 | // SPDC1016 92 | if (fixedram0000[io05_clock_ctrl] & 0x8) { 93 | // old bit3, LCDON 94 | // Previous LCD on 95 | if ((value & 0xF) == 0) { 96 | // new value bit0~3 is 0 97 | // LCD off, lcd shift clock select bit0~3 is 0 98 | lcdoffshift0flag = true; 99 | } 100 | } 101 | fixedram0000[io05_clock_ctrl] = value; 102 | (void)write; 103 | } 104 | 105 | unsigned short lcdbuffaddr; 106 | 107 | void __iocallconv Write06LCDStartAddr( BYTE write, BYTE value ) // 06 108 | { 109 | unsigned int t = ((fixedram0000[io0C_lcd_config] & 0x3) << 12); 110 | t = t | (value << 4); 111 | qDebug("ggv wanna change lcdbuf address to 0x%04x", t); 112 | fixedram0000[io06_lcd_config] = value; 113 | lcdbuffaddr = t; 114 | (void)write; 115 | // SPDC1016 116 | // don't know how wqxsim works. 117 | fixedram0000[io09_port1_data] &= 0xFEu; // remove bit0 of port1 (keypad) 118 | } 119 | 120 | void __iocallconv WriteTimer01Control( BYTE write, BYTE value ) // 0C 121 | { 122 | unsigned int t = ((value & 0x3) << 12); // lc12~lc13 123 | t = t | (fixedram0000[io06_lcd_config] << 4); // lc4~lc11 124 | qDebug("ggv wanna change lcdbuf address to 0x%04x", t); 125 | qDebug("ggv also wanna change timer settings to 0x%02x.", (value & 0xC)); 126 | fixedram0000[io0C_lcd_config] = value; 127 | lcdbuffaddr = t; 128 | (void)write; 129 | } 130 | 131 | void __iocallconv Write20JG( BYTE write, BYTE value ) 132 | { 133 | // SPDC1016 134 | 135 | if (value == 0x80u) { 136 | //memset(dword_44B988, 0, 0x20u); 137 | //gFixedRAM1_b20 = 0; // mem[20] change from 80 to 00 138 | //LOBYTE(mayIO23Index1) = 0; 139 | //mayIO20Flag1 = 1; 140 | fixedram0000[io20_JG] = 0; 141 | } else { 142 | fixedram0000[io20_JG] = value; 143 | } 144 | (void)write; 145 | } 146 | 147 | 148 | void __iocallconv Write23Unknow( BYTE write, BYTE value ) 149 | { 150 | // SPDC1023 151 | // io23 unknown 152 | //currentdata = tmpAXYValue; // current mem[23] value 153 | //if ( tmpAXYValue == 0xC2u ) 154 | //{ 155 | // // mayIO23Index used in some waveplay routine 156 | // dword_4603D4[(unsigned __int8)mayIO23Index1] = gFixedRAM1_b22; 157 | //} 158 | //else 159 | //{ 160 | // if ( tmpAXYValue == 0xC4u ) 161 | // { 162 | // // for PC1000? 163 | // dword_44EA1C[(unsigned __int8)mayIO23Index1] = gFixedRAM1_b22; 164 | // LOBYTE(mayIO23Index1) = mayIO23Index1 + 1; 165 | // } 166 | //} 167 | //if ( gTimer0WaveoutStarted ) 168 | //{ 169 | // *(_BYTE *)maypTimer0VarA8 = currentdata; 170 | // v2 = mayTimer0Var1 + 1; 171 | // ++maypTimer0VarA8; 172 | // overflowed = mayIO2345Var1 == 7999; 173 | // ++mayTimer0Var1; 174 | // ++mayIO2345Var1; 175 | // if ( overflowed ) 176 | // { 177 | // byte_4603B8[mayIO45Var3x] = 1; 178 | // if ( v2 == 8000 ) 179 | // WriteWaveout(&pwh); 180 | // mayIO2345Var1 = 0; 181 | // } 182 | // destaddr = mayDestAddr; 183 | //} 184 | //if ( tmpAXYValue == 0x80u ) 185 | //{ 186 | // gFixedRAM1_b20 = 0x80u; 187 | // mayIO20Flag1 = 0; 188 | // if ( (_BYTE)mayIO23Index1 > 0u ) 189 | // { 190 | // if ( !gTimer0WaveoutStarted ) 191 | // { 192 | // GenerateAndPlayJGWav(); 193 | // destaddr = mayDestAddr; 194 | // LOBYTE(mayIO23Index1) = 0; 195 | // } 196 | // } 197 | //} 198 | if (value == 0xC2u) { 199 | 200 | } else if (value == 0xC4) { 201 | 202 | } 203 | if (timer0waveoutstart) { 204 | 205 | } 206 | if (value == 0x80u) { 207 | if (!timer0waveoutstart) { 208 | 209 | } 210 | } 211 | fixedram0000[io23_unknow] = value; 212 | (void)write; 213 | } 214 | 215 | void __iocallconv Write02Timer0Value( BYTE write, BYTE value ) 216 | { 217 | // SPDC1016 218 | if (timer0started) { 219 | prevtimer0value = value; 220 | } 221 | fixedram0000[io02_timer0_val] = value; 222 | (void)write; 223 | } 224 | 225 | 226 | ////////////////////////////////////////////////////////////////////////// 227 | // Keypad registers 228 | ////////////////////////////////////////////////////////////////////////// 229 | unsigned /*char*/ keypadmatrix[8][8] = {0,}; 230 | 231 | void UpdateKeypadRegisters() 232 | { 233 | // TODO: 2pass check 234 | //qDebug("old [0015]:%02x [0009]:%02x [0008]:%02x", mem[0x15], mem[0x9], mem[0x8]); 235 | //int up = 0, down = 0; 236 | unsigned char port1control = fixedram0000[io15_port1_dir]; 237 | unsigned char port0control = fixedram0000[io0F_port0_dir] & 0xF0; // b4~b7 238 | unsigned char port1controlbit = 1; // aka, y control bit 239 | unsigned char tmpdest0 = 0, tmpdest1 = 0; 240 | unsigned char port1data = fixedram0000[io09_port1_data], port0data = fixedram0000[io08_port0_data]; 241 | for (int y = 0; y < 8; y++) { 242 | // y = Port10~Port17 243 | bool ysend = ((port1control & port1controlbit) != 0); 244 | unsigned char xbit = 1; 245 | for (int x = 0; x < 8; x++) { 246 | // x = Port00~Port07 247 | unsigned char port0controlbit; 248 | if (x < 2) { 249 | // 0, 1 = b4 b5 250 | port0controlbit = xbit << 4; 251 | } else if (x < 4) { 252 | // 2, 3 = b6 253 | port0controlbit = 0x40; 254 | } else { 255 | // 4, 5, 6, 7 = b7 256 | port0controlbit = 0x80u; 257 | } 258 | if (y < 2 && (port1data == 0x02 || port1data == 0x01)) { 259 | // Emulator rulz, only for port1 is single 0x02 0x01 260 | // TODO: invert when y < 2 (row 6,7) 261 | // 0,2 is both high 262 | if (ysend) { 263 | // port1y-> port0x 264 | // port1y is send but only set bit to high when port0 xbit is receive too 265 | if ((keypadmatrix[y][x] != 1) && ((port1data & port1controlbit) != 0) && ((port0control & port0controlbit) == 0)) { 266 | tmpdest0 |= xbit; 267 | } 268 | } else { 269 | // port0x -> port1y 270 | // port1y should be receive, only set bit to high when port0 xbit is send 271 | if ((keypadmatrix[y][x] != 1) && ((port0data & xbit) != 0) && ((port0control & port0controlbit) != 0)) { 272 | tmpdest1 |= xbit; 273 | } 274 | } 275 | } else if (keypadmatrix[y][x] != 2) { 276 | if (ysend) { 277 | // port1y-> port0x 278 | // port1y is send but only set bit to high when port0 xbit is receive too 279 | if ((keypadmatrix[y][x]) && ((port1data & port1controlbit) != 0) && ((port0control & port0controlbit) == 0)) { 280 | tmpdest0 |= xbit; 281 | } 282 | } else { 283 | // port0x -> port1y 284 | // port1y should be receive, only set bit to high when port0 xbit is send 285 | if ((keypadmatrix[y][x]) && ((port0data & xbit) != 0) && ((port0control & port0controlbit) != 0)) { 286 | tmpdest1 |= xbit; 287 | } 288 | } 289 | } 290 | xbit = xbit << 1; 291 | } 292 | port1controlbit = port1controlbit << 1; 293 | } 294 | if (port1control != 0xFFu) { 295 | // port1 should clean some bits 296 | // using port1control as port1mask 297 | // sometimes port10,11 should clean here 298 | port1data &= port1control; // pre set receive bits to 0 299 | } 300 | if (port1control != 0xF0u) { 301 | // clean port0 302 | // calculate port0 mask 303 | // in most case port0 will be set to 0 304 | unsigned char port0mask = (port0control >> 4) & 0x3; // bit4->0 bit5->1 305 | if (port0control & 0x40) { 306 | // bit6->2,3 307 | port0mask |= 0x0C; // 00001100 308 | } 309 | if (port0control & 0x80u) { 310 | // bit7->4,5,6,7 311 | port0mask |= 0xF0u; // 11110000 312 | } 313 | port0data &= port0mask; 314 | } 315 | port0data |= tmpdest0; 316 | port1data |= tmpdest1; 317 | if (fixedram0000[io09_port1_data] != port1data || fixedram0000[io08_port0_data] != port0data) { 318 | qDebug("old [0015]:%02x [0009]:%02x [0008]:%02x", fixedram0000[io15_port1_dir], fixedram0000[io09_port1_data], fixedram0000[io08_port0_data]); 319 | qDebug("new [0015]:%02x [0009]:%02x [0008]:%02x", fixedram0000[io15_port1_dir], port1data, port0data); 320 | } 321 | fixedram0000[io09_port1_data] = port1data; 322 | fixedram0000[io08_port0_data] = port0data; 323 | } 324 | 325 | BYTE __iocallconv ReadPort0( BYTE read ) 326 | { 327 | UpdateKeypadRegisters(); 328 | //qDebug("ggv wanna read keypad port0, [%04x] -> %02x", read, mem[read]); 329 | return fixedram0000[io08_port0_data]; 330 | (void)read; 331 | } 332 | 333 | BYTE __iocallconv ReadPort1( BYTE read ) 334 | { 335 | UpdateKeypadRegisters(); 336 | //qDebug("ggv wanna read keypad port1, [%04x] -> %02x", read, mem[read]); 337 | return fixedram0000[io09_port1_data]; 338 | (void)read; 339 | } 340 | 341 | void __iocallconv Write08Port0( BYTE write, BYTE value ) 342 | { 343 | //qDebug("ggv wanna write keypad port0, [%04x] (%02x) -> %02x", write, mem[write], value); 344 | fixedram0000[io08_port0_data] = value; 345 | // cosply simulator 346 | //// dest memory is already set to tmpAXYValue before writeio08 347 | //// simulator only support 09 output, 08 receive 348 | //newvalue = tmpAXYValue; 349 | //// P00~P07 350 | //// bit0~bit7 351 | //io0b = io0B_port3; 352 | //io0bvalue1 = gFixedRAM0[io0B_port3] | 1; // set bit0 (LCD DOT OUT DIRECTION BIT1) of lcd config 353 | //ishotkey = keypadmatrix1[6] == tmpAXYValue; // ram[io08] value is same to one of Hotkey in row6 354 | //gFixedRAM0[io0B_port3] = io0bvalue1; // Add LCDIR1 |= 0x1; 355 | //if ( ishotkey || !newvalue || keypadmatrix1[7] == 0xFB ) 356 | // // newvalue fit to some hotkey in row6 357 | // // or newvalue is 0 (all colume is 0) 358 | // // or row7 == FB (ON/OFF) 359 | // gFixedRAM0[io0b] = io0bvalue1 & 0xFE; // Remove LCDIR1 360 | unsigned char xbit = 1; 361 | unsigned char row6data = 0, row7data = 0; 362 | for (int x = 0; x < 8; x++) { 363 | if ((keypadmatrix[1][x] != 1)) { 364 | row6data |= xbit; 365 | } 366 | if ((keypadmatrix[0][x] != 1)) { 367 | row7data |= xbit; 368 | } 369 | xbit = xbit << 1; 370 | } 371 | // workaround? 372 | if (row6data == 0xFF) { 373 | row6data = 0; 374 | } 375 | if (row7data == 0xFF) { 376 | row7data = 0; 377 | } 378 | if (row6data == value || value == 0 || row7data == 0xFBu) { 379 | // newvalue fit to some hotkey in row6 380 | // or newvalue is 0 (all colume is 0) 381 | // or row7 == FB (ON/OFF) 382 | fixedram0000[io0B_lcd_ctrl] &= 0xFEu; // Remove LCDIR1 383 | } else { 384 | fixedram0000[io0B_lcd_ctrl] |= 0x01; // Add LCDIR1 |= 0x1 385 | } 386 | UpdateKeypadRegisters(); 387 | (void)write; 388 | } 389 | 390 | void __iocallconv Write09Port1( BYTE write, BYTE value ) 391 | { 392 | //qDebug("ggv wanna write keypad port1, [%04x] (%02x) -> %02x", write, mem[write], value); 393 | fixedram0000[io09_port1_data] = value; 394 | // cosply simulator 395 | unsigned char xbit = 1; 396 | unsigned char row6data = 0, row7data = 0; 397 | for (int x = 0; x < 8; x++) { 398 | if ((keypadmatrix[1][x] != 1)) { 399 | row6data |= xbit; 400 | } 401 | if ((keypadmatrix[0][x] != 1)) { 402 | row7data |= xbit; 403 | } 404 | xbit = xbit << 1; 405 | } 406 | // workaround 407 | if (row6data == 0xFF) { 408 | row6data = 0; 409 | } 410 | if (row7data == 0xFF) { 411 | row7data = 0; 412 | } 413 | unsigned char port0bit01 = fixedram0000[io08_port0_data] & 3; 414 | if (value == 0) { 415 | //case 0u: 416 | // // none of P10~P17 is set. 417 | // io0b_2 = io0B_port3; 418 | // port0bit01_ = gFixedRAM0[io08_port0_real] & 3;// 00 01 10 11 419 | // row6iszero = keypadmatrix1[6] == 0; // no hotkey 420 | // row7data = keypadmatrix1[7]; // ON/OFF 421 | // gFixedRAM0[io0B_port3] = port0bit01_;// remove b2~b7 422 | // if ( !row6iszero || row7data ) 423 | // // have hotkey, or have on/off 424 | // gFixedRAM0[io0b_2] = port0bit01_ ^ 3;// 00 -> 11 01 -> 10 10 -> 01 11 -> 00 425 | // if ( row7data == 0xFD ) 426 | // // row7 is record/play 427 | // gFixedRAM0[io0b_2] &= 0xFEu; // Remove LCDIR1 428 | // break; 429 | fixedram0000[io0B_lcd_ctrl] = port0bit01; // remove b2~b7 430 | if ((row6data != 0xFFu) || (row7data != 0xFFu)) { 431 | // hotkey or on/off 432 | fixedram0000[io0B_lcd_ctrl] = port0bit01 ^ 0x3; // remove b2~b7, reverse b0,b1 433 | } 434 | if (row7data == 0xFDu) { 435 | // record/play 436 | fixedram0000[io0B_lcd_ctrl] &= 0xFEu; 437 | } 438 | } 439 | if ((value == 0xFDu) || (value == 0xFEu)) { 440 | //case 0xFDu: 441 | //case 0xFEu: 442 | // // ~P16 ~P17 443 | // io0b_1 = io0B_port3; 444 | // port0bit01 = gFixedRAM0[io08_port0_real] & 3;// 00 01 10 11 445 | // issame = keypadmatrix1[7] == tmpAXYValue; 446 | // gFixedRAM0[io0B_port3] = port0bit01;// remove b2~b7 447 | // if ( issame ) 448 | // // row7 is same as [09] 449 | // gFixedRAM0[io0b_1] = port0bit01 ^ 3;// remove b2~b7, reverse b0,b1 450 | // break; 451 | fixedram0000[io0B_lcd_ctrl] = port0bit01; // remove b2~b7 452 | if (row7data == value) { 453 | // row7 is same as [09] 454 | fixedram0000[io0B_lcd_ctrl] = port0bit01 ^ 0x3; // remove b2~b7, reverse b0,b1 455 | } 456 | } 457 | if (value == 0x03) { 458 | //case 3u: 459 | // // both P11 P10, used for p00~p07 send and all 1, p10-p11 send and all 1 460 | // io0b = io0B_port3; 461 | // io08valuebit01 = gFixedRAM0[io08_port0_real] & 3; 462 | // gFixedRAM0[io0B_port3] = io08valuebit01;// remove b2~b7 463 | // if ( row7data_ == 0xFB ) 464 | // gFixedRAM0[io0b] = io08valuebit01 ^ 3;// remove b2~b7, reverse b0,b1 465 | // goto LABEL_19; 466 | fixedram0000[io0B_lcd_ctrl] = port0bit01; // remove b2~b7 467 | if (row7data == 0xFB) { 468 | // on/off 469 | fixedram0000[io0B_lcd_ctrl] = port0bit01 ^ 0x3; // remove b2~b7, reverse b0,b1 470 | } 471 | } 472 | // FIXME: 02, 01 Emulator rulz 473 | if (value == 0x02) { 474 | fixedram0000[io08_port0_data] = row6data; 475 | } 476 | if (value == 0x01) { 477 | fixedram0000[io08_port0_data] = row7data; 478 | } 479 | if (((value != 0xFDu) && (value != 0xFEu) && (value != 0x00) && (value != 0x02) && (value != 0x01) && (value != 0x03)) || ((value == 0x03) && (fixedram0000[io15_port1_dir] == 0xFCu))) { 480 | UpdateKeypadRegisters(); 481 | } 482 | (void)write; 483 | } 484 | 485 | void __iocallconv ControlPort1( BYTE write, BYTE value ) 486 | { 487 | //qDebug("ggv wanna config keypad port1, [%04x] (%02x) -> %02x", write, mem[write], value); 488 | fixedram0000[io15_port1_dir] = value; 489 | UpdateKeypadRegisters(); 490 | (void)write; 491 | } 492 | -------------------------------------------------------------------------------- /Sim800/NekoDriver.cpp: -------------------------------------------------------------------------------- 1 | #include "NekoDriver.h" 2 | #include "DBCentre.h" 3 | extern "C" { 4 | #ifdef HANDYPSP 5 | #include "ANSI/w65c02.h" 6 | #else 7 | #include "ANSI/65C02.h" 8 | #endif 9 | } 10 | #include "CC800IOName.h" 11 | 12 | 13 | // Storage 14 | PNekoDriver theNekoDriver; 15 | 16 | TNekoDriver::TNekoDriver() 17 | : fEmulatorThread(NULL) 18 | , fNorBuffer(NULL) 19 | , fBROMBuffer(NULL) 20 | , fFlashUpdated(false) 21 | { 22 | // Do initialization that must be repeated for a restart 23 | restart = 0; 24 | 25 | fBROMBuffer = (char*)malloc(512 * 0x8000); // 32K * 256 * 2 26 | for (int i = 0; i < 256; i++) { 27 | volume0array[i] = (unsigned char*)fBROMBuffer + i * 0x8000; 28 | volume1array[i] = volume0array[i] + 256 * 0x8000; 29 | } 30 | 31 | fNorBuffer = (char*)malloc(16 * 0x8000); // 32K * 16 32 | for (int i = 0; i < 16; i++) { 33 | norbankheader[i] = (unsigned char*)fNorBuffer + i * 0x8000; 34 | } 35 | 36 | // DebugInitialize(); 37 | MemInitialize(); 38 | // TermInitialize(); 39 | // FrameCreateWindow(); 40 | 41 | // enter the main message loop 42 | // EnterMessageLoop(); 43 | 44 | // fEmulatorThread->start(); 45 | } 46 | 47 | 48 | TNekoDriver::~TNekoDriver() 49 | { 50 | if (fNorBuffer) { 51 | free(fNorBuffer); 52 | fNorBuffer = NULL; 53 | } 54 | if (fBROMBuffer) { 55 | free(fBROMBuffer); 56 | fBROMBuffer = NULL; 57 | } 58 | } 59 | 60 | 61 | void TNekoDriver::onLCDBufferChanged( QByteArray* buffer ) 62 | { 63 | emit lcdBufferChanged(buffer); 64 | } 65 | 66 | //void TNekoDriver::onStepFinished( quint16 pc ) 67 | //{ 68 | // emit stepFinished(pc); 69 | //} 70 | 71 | bool TNekoDriver::StartEmulation() 72 | { 73 | fEmulatorThread = new EmulatorThread(NULL, NULL); 74 | connect(fEmulatorThread, SIGNAL(lcdBufferChanged(QByteArray*)), 75 | this, SLOT(onLCDBufferChanged(QByteArray*))); 76 | //connect(fEmulatorThread, SIGNAL(stepFinished(quint16)), 77 | // this, SLOT(onStepFinished(quint16))); 78 | fEmulatorThread->start(QThread::InheritPriority); 79 | return true; 80 | } 81 | 82 | bool TNekoDriver::StopEmulation() 83 | { 84 | if (fEmulatorThread) { 85 | fEmulatorThread->StopKeeping(); 86 | fEmulatorThread->wait(4000); 87 | fEmulatorThread->deleteLater(); 88 | fEmulatorThread = NULL; 89 | if (fFlashUpdated) { 90 | SaveFullNorFlash(); 91 | } 92 | } 93 | return true; 94 | } 95 | 96 | bool TNekoDriver::RunDemoBin( const QString& filename ) 97 | { 98 | if (filename.isEmpty()) { 99 | //LoadDemoNor(QApplication::applicationDirPath() + "/mario.bin"); 100 | LoadBROM(QApplication::applicationDirPath() + "/obj.bin"); 101 | LoadFullNorFlash(QApplication::applicationDirPath() + "/cc800.fls"); 102 | //fixedram0000[io00_bank_switch] = 2; 103 | //SwitchNorBank(2); 104 | //*(unsigned short*)&(pmemmap[mapE000][0x1FFC]) = 0x4018; // mario.bin 105 | } else { 106 | LoadDemoNor(filename); 107 | fixedram0000[io00_bank_switch] = 1; 108 | SwitchNorBank(1); 109 | *(unsigned short*)&(pmemmap[mapE000][0x1FFC]) = 0x4018; // mario.bin 110 | } 111 | //fEmulatorThread->start(QThread::InheritPriority); 112 | StopEmulation(); 113 | StartEmulation(); 114 | return true; 115 | } 116 | 117 | bool TNekoDriver::PauseEmulation() 118 | { 119 | return false; 120 | } 121 | 122 | bool TNekoDriver::ResumeEmulation() 123 | { 124 | return false; 125 | } 126 | 127 | 128 | 129 | EmulatorThread::EmulatorThread( char* brom, char* nor ) 130 | : fBROMBuffer(brom) 131 | , fNorBuffer(nor) 132 | , fKeeping(true) 133 | , fLCDBuffer(malloc(160*80/8)) 134 | , lastTicket(0) 135 | , totalcycle(0) 136 | , measured(false) 137 | #ifdef AUTOTEST 138 | , remeasure(0) 139 | #else 140 | , remeasure(2) 141 | #endif 142 | , batchlimiter(0) 143 | , batchcount(UINT_MAX) 144 | , sleepgap(10) 145 | , sleepcount(0) 146 | { 147 | 148 | } 149 | 150 | EmulatorThread::~EmulatorThread() 151 | { 152 | free(fLCDBuffer); 153 | } 154 | 155 | 156 | extern WORD LogDisassembly (WORD offset, char* text); 157 | extern void AppendLog(const char* text); 158 | 159 | extern bool timer0started; 160 | extern bool timer1started; 161 | extern unsigned short gThreadFlags; 162 | 163 | 164 | #if 0 165 | #define spdc1016freq 3686400 166 | #endif 167 | 168 | 169 | // WQXSIM 170 | extern bool timer0waveoutstart; 171 | extern int prevtimer0value; 172 | int gDeadlockCounter = 0; 173 | extern bool lcdoffshift0flag; 174 | bool matrixupdated = false; 175 | long nmicount = 0; 176 | long twohznmicycle; 177 | 178 | void Turnoff2HzNMIMaskAddIRQFlag(); 179 | void CheckTimebaseAndEnableIRQnEXIE1(); 180 | void EnableWatchDogFlag(); 181 | void CheckLCDOffShift0HotkeyAndEnableWatchDog(); 182 | 183 | void EmulatorThread::run() 184 | { 185 | // Load PC from Reset Vector 186 | CpuInitialize(); 187 | lcdoffshift0flag = false; 188 | //g_stp = 1; // test 189 | #ifndef FAKENMI 190 | unsigned int nmistart = GetTickCount(); 191 | #endif 192 | gThreadFlags &= 0xFFFEu; // Remove 0x01 from gThreadFlags (stack related) 193 | #ifdef AUTOTEST 194 | unsigned totalline = 0; // TODO: long long 195 | enablelogging = false; 196 | #endif 197 | while(fKeeping) { 198 | #if 1 199 | const unsigned spdc1016freq = GlobalSetting.SPDC1016Frequency; 200 | #endif 201 | #ifdef FAMENMI 202 | twohznmicycle = spdc1016freq / 2; 203 | #endif 204 | while (batchcount >= 0 && fKeeping) { 205 | #ifdef AUTOTEST 206 | totalline++; 207 | TryTest(totalline); 208 | #endif // AUTOTEST 209 | #ifdef LOGASM 210 | #ifdef AUTOTEST 211 | if (enablelogging) { 212 | #endif 213 | #ifdef HANDYPSP 214 | LogDisassembly(mPC, NULL); 215 | #else 216 | LogDisassembly(regs.pc, NULL); 217 | #endif // HANDYPSP 218 | #ifdef AUTOTEST 219 | } 220 | #endif // AUTOTEST 221 | #endif // LOGASM 222 | if (matrixupdated) { 223 | matrixupdated = false; 224 | AppendLog("keypadmatrix updated."); 225 | } 226 | 227 | nmicount++; // MERGEASM 228 | // 2Hz NMI 229 | // TODO: use batchcount as NMI source 230 | #ifdef FAKENMI 231 | if (nmicount % 400000 == 0) { 232 | nmicount = 0; // MERGEASM 233 | //if (twohznmicycle < 0) { 234 | // twohznmicycle = spdc1016freq / 2; // reset 235 | #else 236 | // in CC800 hardware, NMI is generated by 32.768k crystal, but spdc1016 use RC oscillator so cycle/NMI can be mismatched. 237 | unsigned int dummynow = GetTickCount(); 238 | if (dummynow - nmistart >= 500) { 239 | nmistart += 500; 240 | #endif 241 | //g_nmi = 0; // next CpuExecute will execute two instructions 242 | gThreadFlags |= 0x08; // Add NMIFlag 243 | } 244 | 245 | // NMI > IRQ 246 | if ((gThreadFlags & 0x08) != 0) { 247 | gThreadFlags &= 0xFFF7u; // remove 0x08 NMI Flag 248 | // FIXME: NO MORE REVERSE 249 | g_nmi = TRUE; // next CpuExecute will execute two instructions 250 | qDebug("ggv wanna NMI."); 251 | //fprintf(stderr, "ggv wanna NMI.\n"); 252 | gDeadlockCounter--; // wrong behavior of wqxsim 253 | #ifdef HANDYPSP 254 | } else if (((PS() & AF_INTERRUPT) == 0) && ((gThreadFlags & TF_IRQFLAG) != 0)) { 255 | #else 256 | } else if (((regs.ps & 0x4) == 0) && ((gThreadFlags & 0x10) != 0)) { 257 | #endif 258 | gThreadFlags &= 0xFFEFu; // remove 0x10 IRQ Flag 259 | g_irq = TRUE; // B flag (AF_BREAK) will remove in CpuExecute 260 | qDebug("ggv wanna IRQ."); 261 | gDeadlockCounter--; // wrong behavior of wqxsim 262 | } 263 | 264 | DWORD CpuTicks = CpuExecute(); 265 | totalcycle += CpuTicks; 266 | twohznmicycle -= CpuTicks; 267 | // add checks for reset, IRQ, NMI, and other pin signals 268 | if (lastTicket == 0) { 269 | lastTicket = GetTickCount(); 270 | } 271 | 272 | gDeadlockCounter++; 273 | if (gDeadlockCounter == 6000) { 274 | // overflowed 275 | gDeadlockCounter = 0; 276 | if ((gThreadFlags & 0x80u) == 0) { 277 | // CheckTimerbaseAndEnableIRQnEXIE1 278 | CheckTimebaseAndEnableIRQnEXIE1(); 279 | if (timer0started) { 280 | // mayDestAddr == 5 in ReadRegister 281 | // mayBaseTable have 0x100 elements? 282 | //increment = mayBasetable[mayDestAddr]; // mayBaseTable[5] == 3 283 | //t0overflow = (unsigned int)(increment + mayPreviousTimer0Value) < 0xFF; 284 | //mayPreviousTimer0Value += increment; 285 | //if ( !t0overflow ) 286 | //{ 287 | // mayPreviousTimer0Value = 0; 288 | // Turnoff2HzNMIMaskAddIRQFlag(); 289 | //} 290 | int increment = 3; 291 | prevtimer0value += increment; 292 | if (prevtimer0value >= 0xFFu) { 293 | prevtimer0value = 0; 294 | Turnoff2HzNMIMaskAddIRQFlag(); 295 | } 296 | } 297 | } else { 298 | // RESET 299 | fixedram0000[io01_int_enable] |= 0x1; // TIMER A INTERRUPT ENABLE 300 | fixedram0000[io02_timer0_val] |= 0x1; // [io01+1] Timer0 bit1 = 1 301 | gThreadFlags &= 0xFF7F; // remove 0x80 | 0x10 302 | #ifdef HANDYPSP 303 | mPC = *(unsigned short*)&pmemmap[mapE000][0x1FFC]; 304 | #else 305 | regs.pc = *(unsigned short*)&pmemmap[mapE000][0x1FFC]; 306 | #endif 307 | } 308 | } else { 309 | if (timer0started) { 310 | // mayDestAddr == 5 in ReadRegister 311 | // mayBaseTable have 0x100 elements? 312 | int increment = 3; 313 | prevtimer0value += increment; 314 | if (prevtimer0value >= 0xFFu) { 315 | prevtimer0value = 0; 316 | Turnoff2HzNMIMaskAddIRQFlag(); 317 | } 318 | } 319 | } 320 | 321 | 322 | //if (timer0started) { 323 | // fixedram0000[io02_timer0_val] = fixedram0000[io02_timer0_val] + 1; 324 | //} 325 | //if (timer1started) { 326 | // fixedram0000[io03_timer1_val] = fixedram0000[io03_timer1_val] + 1; 327 | //} 328 | 329 | // TODO: dynamic re-measure 330 | if (measured == false && totalcycle % spdc1016freq < 10 && totalcycle > spdc1016freq) { 331 | measured = true; 332 | #if 0 333 | // fixed rate on device 334 | // realworld time = 106 335 | #ifdef HANDYPSP 336 | batchlimiter = spdc1016freq / 88; // 12*10=120ms 337 | #else 338 | batchlimiter = spdc1016freq / 4; 339 | #endif 340 | batchcount = batchlimiter; 341 | #else 342 | if (totalcycle < spdc1016freq * 2) { 343 | // first loop check! 344 | // spdc1016 executed one second in fullspeed virtual timeline 345 | unsigned long long realworldtime = GetTickCount() - lastTicket; // should less than 1000ms 346 | lastTicket = GetTickCount(); 347 | //double virtual100ms = realworldtime / 100.0; 348 | qDebug("realworldtime:%llu", realworldtime); 349 | fprintf(stderr, "realworldtime:%llu\n", realworldtime); 350 | if (realworldtime > 1000) { 351 | // TODO: device may slower than simulator 352 | // in my test iPad I get 3528/3779/3630 msec to finish one sdpc1016freq loop 353 | // we should make screen refresh at least twice per real world second or screen will never been updated 354 | // 1000->500 2000->250 4000->125 355 | batchlimiter = 500 * spdc1016freq / realworldtime; 356 | if (remeasure) { 357 | qDebug("remeasure on batchlimiter: %u", batchlimiter); 358 | fprintf(stderr, "remeasure on batchlimiter: %u\n", batchlimiter); 359 | measured = false; 360 | totalcycle = 0; 361 | remeasure--; 362 | } 363 | batchcount = batchlimiter; 364 | } else if (batchlimiter == 0) { 365 | // 1000 - realworldtime = overflow time, overflow time / 10 = sleepcount, freq / sleepcount = batchcount 366 | //batchlimiter = spdc1016freq / ((1000 - realworldtime) / 10); 367 | sleepcount = (1000 - realworldtime) / sleepgap; 368 | batchlimiter = spdc1016freq * sleepgap / (1000 - realworldtime); 369 | } else { 370 | // wrong path? 371 | // sleep(0) is less than 10ms, but we'd never go here 372 | } 373 | batchcount = batchlimiter; 374 | } else { 375 | // totalcycle > spdc1016freq * 2 376 | // TODO: check once more 377 | } 378 | #endif // TARGET_IPHONE_SIMULATOR 379 | } // measured == false && totalcycle % spdc1016freq < 10 && totalcycle > spdc1016freq 380 | if (totalcycle % spdc1016freq > 10 && totalcycle > spdc1016freq) { 381 | // FIXME: bug on slow device 382 | //measured = false; 383 | } 384 | 385 | if (batchlimiter != 0) { 386 | batchcount -= CpuTicks; 387 | } 388 | 389 | //usleep(10); 390 | //Sleep(0); 391 | } 392 | 393 | if (memcmp(&fixedram0000[0x9C0], fLCDBuffer, 160*80/8) != 0) { 394 | memcpy(fLCDBuffer, &fixedram0000[0x9C0], 160*80/8); 395 | qDebug("lcdBufferChanged"); 396 | fprintf(stderr, "lcdBufferChanged\n"); 397 | emit lcdBufferChanged(new QByteArray((const char*)fLCDBuffer, 160*80/8)); 398 | } 399 | 400 | Sleep(10); // SleepGap. 10ms = 10us 401 | if (batchlimiter > 0) { 402 | batchcount = batchlimiter; 403 | } else { 404 | batchcount = spdc1016freq * 2; // dirty fix 405 | } 406 | } 407 | //this->deleteLater(); 408 | } 409 | 410 | void EmulatorThread::StopKeeping() 411 | { 412 | fKeeping = false; 413 | } 414 | 415 | #ifdef AUTOTEST 416 | void EmulatorThread::TryTest( unsigned line ) 417 | { 418 | // Network 419 | if (line == 1024000) { 420 | keypadmatrix[1][6] = 1; 421 | CheckLCDOffShift0HotkeyAndEnableWatchDog(); 422 | } 423 | if (line == 1064000) { 424 | keypadmatrix[1][6] = 0; 425 | CheckLCDOffShift0HotkeyAndEnableWatchDog(); 426 | } 427 | // Down 428 | if (line == 1224000) { 429 | keypadmatrix[6][3] = 1; 430 | CheckLCDOffShift0HotkeyAndEnableWatchDog(); 431 | } 432 | if (line == 1264000) { 433 | keypadmatrix[6][3] = 0; 434 | CheckLCDOffShift0HotkeyAndEnableWatchDog(); 435 | } 436 | // Enter 437 | if (line == 1424000) { 438 | keypadmatrix[6][5] = 1; 439 | CheckLCDOffShift0HotkeyAndEnableWatchDog(); 440 | enablelogging = true; 441 | } 442 | if (line == 1524000) { 443 | keypadmatrix[6][5] = 0; 444 | CheckLCDOffShift0HotkeyAndEnableWatchDog(); 445 | } 446 | // Splash 447 | if (line == 4724000) { 448 | keypadmatrix[6][5] = 1; 449 | CheckLCDOffShift0HotkeyAndEnableWatchDog(); 450 | } 451 | if (line == 4764000) { 452 | keypadmatrix[6][5] = 0; 453 | CheckLCDOffShift0HotkeyAndEnableWatchDog(); 454 | } 455 | 456 | } 457 | #endif 458 | 459 | void CheckLCDOffShift0HotkeyAndEnableWatchDog() 460 | { 461 | //// may check hotkey press 462 | //if ( gLcdoffShift0Flag ) 463 | //{ 464 | // if ( keypadmatrix1[6] || keypadmatrix1[7] ) 465 | // { 466 | // // Line6 Dict Card 467 | // // Line7 on/off 468 | // EnableWatchDogFlag(); // 0x80 469 | // gLcdoffShift0Flag = 0; 470 | // } 471 | //} 472 | //else 473 | //{ 474 | // // Set lcdoffshift0flag only when keypadmatrix3 == 0xFB 475 | // if ( keypadmatrix1[7] == 0xFBu ) 476 | // gLcdoffShift0Flag = 1; 477 | //} 478 | matrixupdated = true; 479 | if (lcdoffshift0flag) { 480 | // we don't have invert bit for row6,7 481 | //bool row67down = false; 482 | for (int y = 0; y < 2; y++) { 483 | for (int x = 0; x < 8; x++) { 484 | if (keypadmatrix[y][x] == 1) { 485 | //row6,7down = true; 486 | EnableWatchDogFlag(); 487 | lcdoffshift0flag = false; 488 | return; 489 | } 490 | } 491 | } 492 | } else { 493 | if (keypadmatrix[0][2] == 1) { 494 | lcdoffshift0flag = true; // this flag is used for UI? (IO05_ClockControl) 495 | } 496 | } 497 | } 498 | 499 | void CheckTimebaseAndEnableIRQnEXIE1() 500 | { 501 | //if ( gFixedRAM0_04_general_ctrl & 0xF ) 502 | //{ 503 | // // TimeBase Clock Select bit0~3 504 | // LOBYTE(gThreadFlags) = gThreadFlags | 0x10; // add 0x10 to gThreadFlags 505 | // gFixedRAM0[(unsigned __int8)io01_int_ctrl] |= 8u;// EXTERNAL INTERRUPT SELECT1 506 | //} 507 | if (fixedram0000[io04_general_ctrl] & 0x0F) { 508 | gThreadFlags |= 0x10; // Add IRQ flag 509 | //irq = 0; // TODO: move to NMI check 510 | fixedram0000[io01_int_enable] |= 0x8; // EXTERNAL INTERRUPT SELECT1 511 | } 512 | } 513 | 514 | void Turnoff2HzNMIMaskAddIRQFlag() 515 | { 516 | if ( fixedram0000[io04_general_ctrl] & 0xF ) 517 | { 518 | gThreadFlags |= 0x10u; // Add 0x10 Flag to gThreadFlag 519 | //irq = 0; // TODO: move to 520 | fixedram0000[io01_int_enable] |= 0x10u; // 2Hz NMI Mask off 521 | } 522 | } 523 | 524 | void EnableWatchDogFlag() 525 | { 526 | gThreadFlags |= 0x80; 527 | } 528 | -------------------------------------------------------------------------------- /Sim800/ANSI/C6502mak.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2004 K. Wilkins 3 | // 4 | // This software is provided 'as-is', without any express or implied warranty. 5 | // In no event will the authors be held liable for any damages arising from 6 | // the use of this software. 7 | // 8 | // Permission is granted to anyone to use this software for any purpose, 9 | // including commercial applications, and to alter it and redistribute it 10 | // freely, subject to the following restrictions: 11 | // 12 | // 1. The origin of this software must not be misrepresented; you must not 13 | // claim that you wrote the original software. If you use this software 14 | // in a product, an acknowledgment in the product documentation would be 15 | // appreciated but is not required. 16 | // 17 | // 2. Altered source versions must be plainly marked as such, and must not 18 | // be misrepresented as being the original software. 19 | // 20 | // 3. This notice may not be removed or altered from any source distribution. 21 | // 22 | 23 | ////////////////////////////////////////////////////////////////////////////// 24 | // Handy - An Atari Lynx Emulator // 25 | // Copyright (c) 1996,1997 // 26 | // K. Wilkins // 27 | ////////////////////////////////////////////////////////////////////////////// 28 | // 65C02 Macro definitions // 29 | ////////////////////////////////////////////////////////////////////////////// 30 | // // 31 | // This file contains all of the required address mode and operand // 32 | // macro definitions for the 65C02 emulation // 33 | // // 34 | // K. Wilkins // 35 | // August 1997 // 36 | // // 37 | ////////////////////////////////////////////////////////////////////////////// 38 | // Revision History: // 39 | // ----------------- // 40 | // // 41 | // 01Aug1997 KW Document header added & class documented. // 42 | // // 43 | ////////////////////////////////////////////////////////////////////////////// 44 | 45 | // 46 | // Addressing mode decoding 47 | // 48 | 49 | #define xIMMEDIATE() {mOperand=mPC;mPC++;} 50 | #define xABSOLUTE() {mOperand=CPU_PEEKW(mPC);mPC+=2;} 51 | #define xZEROPAGE() {mOperand=CPU_PEEK(mPC);mPC++;} 52 | #define xZEROPAGE_X() {mOperand=CPU_PEEK(mPC)+mX;mPC++;mOperand&=0xff;} 53 | #define xZEROPAGE_Y() {mOperand=CPU_PEEK(mPC)+mY;mPC++;mOperand&=0xff;} 54 | #define xABSOLUTE_X() {mOperand=CPU_PEEKW(mPC);mPC+=2;mOperand+=mX;mOperand&=0xffff;} 55 | #define xABSOLUTE_Y() {mOperand=CPU_PEEKW(mPC);mPC+=2;mOperand+=mY;mOperand&=0xffff;} 56 | #define xINDIRECT_ABSOLUTE_X() {mOperand=CPU_PEEKW(mPC);mPC+=2;mOperand+=mX;mOperand&=0xffff;mOperand=CPU_PEEKW(mOperand);} 57 | #define xRELATIVE() {mOperand=CPU_PEEK(mPC);mPC++;mOperand=(mPC+mOperand)&0xffff;} 58 | #define xINDIRECT_X() {mOperand=CPU_PEEK(mPC);mPC++;mOperand=mOperand+mX;mOperand&=0x00ff;mOperand=CPU_PEEKW(mOperand);} 59 | #define xINDIRECT_Y() {mOperand=CPU_PEEK(mPC);mPC++;mOperand=CPU_PEEKW(mOperand);mOperand=mOperand+mY;mOperand&=0xffff;} 60 | #define xINDIRECT_ABSOLUTE() {mOperand=CPU_PEEKW(mPC);mPC+=2;mOperand=CPU_PEEKW(mOperand);} 61 | #define xINDIRECT() {mOperand=CPU_PEEK(mPC);mPC++;mOperand=CPU_PEEKW(mOperand);} 62 | 63 | // 64 | // Helper Macros 65 | // 66 | //#define SET_Z(m) { mZ=(m)?false:true; } 67 | //#define SET_N(m) { mN=(m&0x80)?true:false; } 68 | //#define SET_NZ(m) SET_Z(m) SET_N(m) 69 | #define SET_Z(m) { mZ=!(m); } 70 | #define SET_N(m) { mN=(m)&0x80; } 71 | #define SET_NZ(m) { mZ=!(m); mN=(m)&0x80; } 72 | #define PULL(m) { mSP++; mSP&=0xff; m=CPU_PEEK(mSP+0x0100); } 73 | #define PUSH(m) { CPU_POKE(0x0100+mSP,m); mSP--; mSP&=0xff; } 74 | // 75 | // Opcode execution 76 | // 77 | 78 | /* 79 | #define xADC()\ 80 | {\ 81 | UBYTE value=CPU_PEEK(mOperand);\ 82 | UBYTE oldA=mA;\ 83 | if(!mD)\ 84 | {\ 85 | SWORD sum=(SWORD)((SBYTE)mA)+(SWORD)((SBYTE)value)+(mC?1:0);\ 86 | mV=((sum > 127) || (sum < -128));\ 87 | sum=(SWORD)mA + (SWORD)value + (mC?1:0);\ 88 | mA=(UBYTE)sum;\ 89 | mC=(sum>0xff);\ 90 | SET_NZ(mA);\ 91 | }\ 92 | else\ 93 | {\ 94 | SWORD sum=mBCDTable[0][mA]+mBCDTable[0][value]+(mC?1:0);\ 95 | mC=(sum > 99);\ 96 | mA=mBCDTable[1][sum & 0xff];\ 97 | SET_NZ(mA);\ 98 | mV=((oldA^mA)&0x80) && ((mA^value)&0x80);\ 99 | }\ 100 | } 101 | */ 102 | 103 | #define xADC()\ 104 | {\ 105 | int value=CPU_PEEK(mOperand);\ 106 | if(mD)\ 107 | {\ 108 | int c = mC?1:0;\ 109 | int lo = (mA & 0x0f) + (value & 0x0f) + c;\ 110 | int hi = (mA & 0xf0) + (value & 0xf0);\ 111 | mV=0;\ 112 | mC=0;\ 113 | if (lo > 0x09)\ 114 | {\ 115 | hi += 0x10;\ 116 | lo += 0x06;\ 117 | }\ 118 | if (~(mA^value) & (mA^hi) & 0x80) mV=1;\ 119 | if (hi > 0x90) hi += 0x60;\ 120 | if (hi & 0xff00) mC=1;\ 121 | mA = (lo & 0x0f) + (hi & 0xf0);\ 122 | }\ 123 | else\ 124 | {\ 125 | int c = mC?1:0;\ 126 | int sum = mA + value + c;\ 127 | mV=0;\ 128 | mC=0;\ 129 | if (~(mA^value) & (mA^sum) & 0x80) mV=1;\ 130 | if (sum & 0xff00) mC=1;\ 131 | mA = (UBYTE) sum;\ 132 | }\ 133 | SET_NZ(mA)\ 134 | } 135 | 136 | #define xAND()\ 137 | {\ 138 | mA&=CPU_PEEK(mOperand);\ 139 | SET_NZ(mA);\ 140 | } 141 | 142 | #define xASL()\ 143 | {\ 144 | int value=CPU_PEEK(mOperand);\ 145 | mC=value&0x80;\ 146 | value<<=1;\ 147 | value&=0xff;\ 148 | SET_NZ(value);\ 149 | CPU_POKE(mOperand,value);\ 150 | } 151 | 152 | #define xASLA()\ 153 | {\ 154 | mC=mA&0x80;\ 155 | mA<<=1;\ 156 | mA&=0xff;\ 157 | SET_NZ(mA);\ 158 | } 159 | 160 | #define xBCC()\ 161 | {\ 162 | if(!mC)\ 163 | {\ 164 | int offset=(signed char)CPU_PEEK(mPC);\ 165 | mPC++;\ 166 | mPC+=offset;\ 167 | mPC&=0xffff;\ 168 | }\ 169 | else\ 170 | {\ 171 | mPC++;\ 172 | mPC&=0xffff;\ 173 | }\ 174 | } 175 | 176 | #define xBCS()\ 177 | {\ 178 | if(mC)\ 179 | {\ 180 | int offset=(signed char)CPU_PEEK(mPC);\ 181 | mPC++;\ 182 | mPC+=offset;\ 183 | mPC&=0xffff;\ 184 | }\ 185 | else\ 186 | {\ 187 | mPC++;\ 188 | mPC&=0xffff;\ 189 | }\ 190 | } 191 | 192 | #define xBEQ()\ 193 | {\ 194 | if(mZ)\ 195 | {\ 196 | int offset=(signed char)CPU_PEEK(mPC);\ 197 | mPC++;\ 198 | mPC+=offset;\ 199 | mPC&=0xffff;\ 200 | }\ 201 | else\ 202 | {\ 203 | mPC++;\ 204 | mPC&=0xffff;\ 205 | }\ 206 | } 207 | 208 | #define xBIT()\ 209 | {\ 210 | int value=CPU_PEEK(mOperand);\ 211 | SET_Z(mA&value);\ 212 | \ 213 | if(mOpcode!=0x89)\ 214 | {\ 215 | mN=value&0x80;\ 216 | mV=value&0x40;\ 217 | }\ 218 | } 219 | 220 | /* 221 | // 222 | // DONT USE THIS VERSION OF BIT, IT BREAKS CALGAMES TITLE SCREEN !!!! 223 | // 224 | #define xBIT()\ 225 | {\ 226 | int value=CPU_PEEK(mOperand);\ 227 | SET_Z(mA&value);\ 228 | \ 229 | mN=value&0x80;\ 230 | mV=value&0x40;\ 231 | } 232 | */ 233 | 234 | #define xBMI()\ 235 | {\ 236 | if(mN)\ 237 | {\ 238 | int offset=(signed char)CPU_PEEK(mPC);\ 239 | mPC++;\ 240 | mPC+=offset;\ 241 | mPC&=0xffff;\ 242 | }\ 243 | else\ 244 | {\ 245 | mPC++;\ 246 | mPC&=0xffff;\ 247 | }\ 248 | } 249 | 250 | #define xBNE()\ 251 | {\ 252 | if(!mZ)\ 253 | {\ 254 | int offset=(signed char)CPU_PEEK(mPC);\ 255 | mPC++;\ 256 | mPC+=offset;\ 257 | mPC&=0xffff;\ 258 | }\ 259 | else\ 260 | {\ 261 | mPC++;\ 262 | mPC&=0xffff;\ 263 | }\ 264 | } 265 | 266 | #define xBPL()\ 267 | {\ 268 | if(!mN)\ 269 | {\ 270 | int offset=(signed char)CPU_PEEK(mPC);\ 271 | mPC++;\ 272 | mPC+=offset;\ 273 | mPC&=0xffff;\ 274 | }\ 275 | else\ 276 | {\ 277 | mPC++;\ 278 | mPC&=0xffff;\ 279 | }\ 280 | } 281 | 282 | #define xBRA()\ 283 | {\ 284 | int offset=(signed char)CPU_PEEK(mPC);\ 285 | mPC++;\ 286 | mPC+=offset;\ 287 | mPC&=0xffff;\ 288 | } 289 | 290 | /* 291 | #define xBRK()\ 292 | {\ 293 | mPC++;\ 294 | PUSH(mPC>>8);\ 295 | PUSH(mPC&0xff);\ 296 | PUSH(PS()|0x10);\ 297 | \ 298 | mD=FALSE;\ 299 | mI=TRUE;\ 300 | \ 301 | mPC=CPU_PEEKW(IRQ_VECTOR);\ 302 | } 303 | */ 304 | 305 | #define xBRK()\ 306 | {\ 307 | mPC++;\ 308 | PUSH(mPC>>8);\ 309 | PUSH(mPC&0xff);\ 310 | PUSH(PS()|0x10);\ 311 | \ 312 | mD=FALSE;\ 313 | mI=TRUE;\ 314 | \ 315 | mPC=CPU_PEEKW(IRQ_VECTOR);\ 316 | } 317 | // KW 4/11/98 B flag needed to be set IN the stack status word = 0x10. 318 | 319 | #define xBVC()\ 320 | {\ 321 | if(!mV)\ 322 | {\ 323 | int offset=(signed char)CPU_PEEK(mPC);\ 324 | mPC++;\ 325 | mPC+=offset;\ 326 | mPC&=0xffff;\ 327 | }\ 328 | else\ 329 | {\ 330 | mPC++;\ 331 | mPC&=0xffff;\ 332 | }\ 333 | } 334 | 335 | #define xBVS()\ 336 | {\ 337 | if(mV)\ 338 | {\ 339 | int offset=(signed char)CPU_PEEK(mPC);\ 340 | mPC++;\ 341 | mPC+=offset;\ 342 | mPC&=0xffff;\ 343 | }\ 344 | else\ 345 | {\ 346 | mPC++;\ 347 | mPC&=0xffff;\ 348 | }\ 349 | } 350 | 351 | #define xCLC()\ 352 | {\ 353 | mC=FALSE;\ 354 | } 355 | 356 | #define xCLD()\ 357 | {\ 358 | mD=FALSE;\ 359 | } 360 | 361 | #define xCLI()\ 362 | {\ 363 | mI=FALSE;\ 364 | } 365 | 366 | #define xCLV()\ 367 | {\ 368 | mV=FALSE;\ 369 | } 370 | 371 | // 372 | // Alternate CMP code 373 | // 374 | /* 375 | #define xCMP()\ 376 | {\ 377 | UBYTE value=CPU_PEEK(mOperand);\ 378 | if(mA+0x100-value>0xff) mC=TRUE; else mC=FALSE;\ 379 | value=mA+0x100-value;\ 380 | mZ=!value;\ 381 | mN=value&0x0080;\ 382 | } 383 | 384 | #define xCPX()\ 385 | {\ 386 | UBYTE value=CPU_PEEK(mOperand);\ 387 | if(mX+0x100-value>0xff) mC=TRUE; else mC=FALSE;\ 388 | value=mX+0x100-value;\ 389 | mZ=!value;\ 390 | mN=value&0x0080;\ 391 | } 392 | 393 | #define xCPY()\ 394 | {\ 395 | UBYTE value=CPU_PEEK(mOperand);\ 396 | if(mY+0x100-value>0xff) mC=TRUE; else mC=FALSE;\ 397 | value=mY+0x100-value;\ 398 | mZ=!value;\ 399 | mN=value&0x0080;\ 400 | } 401 | 402 | #define xCMP()\ 403 | {\ 404 | UWORD value=(UWORD)mA-CPU_PEEK(mOperand);\ 405 | SET_NZ(value);\ 406 | mC=!(value&0x0100);\ 407 | } 408 | */ 409 | #define xCMP()\ 410 | {\ 411 | int value=CPU_PEEK(mOperand);\ 412 | mC=0;\ 413 | if (mA >= value) mC=1;\ 414 | SET_NZ((UBYTE)(mA - value))\ 415 | } 416 | 417 | /* 418 | #define xCPX()\ 419 | {\ 420 | UWORD value=(UWORD)mX-CPU_PEEK(mOperand);\ 421 | SET_NZ(value);\ 422 | mC=!(value&0x0100);\ 423 | } 424 | */ 425 | 426 | #define xCPX()\ 427 | {\ 428 | int value=CPU_PEEK(mOperand);\ 429 | mC=0;\ 430 | if (mX >= value) mC=1;\ 431 | SET_NZ((UBYTE)(mX - value))\ 432 | } 433 | 434 | /* 435 | #define xCPY()\ 436 | {\ 437 | UWORD value=(UWORD)mY-CPU_PEEK(mOperand);\ 438 | SET_NZ(value);\ 439 | mC=!(value&0x0100);\ 440 | } 441 | */ 442 | 443 | #define xCPY()\ 444 | {\ 445 | int value=CPU_PEEK(mOperand);\ 446 | mC=0;\ 447 | if (mY >= value) mC=1;\ 448 | SET_NZ((UBYTE)(mY - value))\ 449 | } 450 | 451 | #define xDEC()\ 452 | {\ 453 | int value=CPU_PEEK(mOperand)-1;\ 454 | value&=0xff;\ 455 | CPU_POKE(mOperand,value);\ 456 | SET_NZ(value);\ 457 | } 458 | 459 | #define xDECA()\ 460 | {\ 461 | mA--;\ 462 | mA&=0xff;\ 463 | SET_NZ(mA);\ 464 | } 465 | 466 | #define xDEX()\ 467 | {\ 468 | mX--;\ 469 | mX&=0xff;\ 470 | SET_NZ(mX);\ 471 | } 472 | 473 | #define xDEY()\ 474 | {\ 475 | mY--;\ 476 | mY&=0xff;\ 477 | SET_NZ(mY);\ 478 | } 479 | 480 | #define xEOR()\ 481 | {\ 482 | mA^=CPU_PEEK(mOperand);\ 483 | SET_NZ(mA);\ 484 | } 485 | 486 | #define xINC()\ 487 | {\ 488 | int value=CPU_PEEK(mOperand)+1;\ 489 | value&=0xff;\ 490 | CPU_POKE(mOperand,value);\ 491 | SET_NZ(value);\ 492 | } 493 | 494 | #define xINCA()\ 495 | {\ 496 | mA++;\ 497 | mA&=0xff;\ 498 | SET_NZ(mA);\ 499 | } 500 | 501 | #define xINX()\ 502 | {\ 503 | mX++;\ 504 | mX&=0xff;\ 505 | SET_NZ(mX);\ 506 | } 507 | 508 | #define xINY()\ 509 | {\ 510 | mY++;\ 511 | mY&=0xff;\ 512 | SET_NZ(mY);\ 513 | } 514 | 515 | #define xJMP()\ 516 | {\ 517 | mPC=mOperand;\ 518 | } 519 | 520 | #define xJSR()\ 521 | {\ 522 | PUSH((mPC-1)>>8);\ 523 | PUSH((mPC-1)&0xff);\ 524 | mPC=mOperand;\ 525 | } 526 | 527 | #define xLDA()\ 528 | {\ 529 | mA=CPU_PEEK(mOperand);\ 530 | SET_NZ(mA);\ 531 | } 532 | 533 | #define xLDX()\ 534 | {\ 535 | mX=CPU_PEEK(mOperand);\ 536 | SET_NZ(mX);\ 537 | } 538 | 539 | #define xLDY()\ 540 | {\ 541 | mY=CPU_PEEK(mOperand);\ 542 | SET_NZ(mY);\ 543 | } 544 | 545 | #define xLSR()\ 546 | {\ 547 | int value=CPU_PEEK(mOperand);\ 548 | mC=value&0x01;\ 549 | value=(value>>1)&0x7f;\ 550 | CPU_POKE(mOperand,value);\ 551 | SET_NZ(value);\ 552 | } 553 | 554 | #define xLSRA()\ 555 | {\ 556 | mC=mA&0x01;\ 557 | mA=(mA>>1)&0x7f;\ 558 | SET_NZ(mA);\ 559 | } 560 | 561 | #define xNOP()\ 562 | {\ 563 | } 564 | 565 | #define xORA()\ 566 | {\ 567 | mA|=CPU_PEEK(mOperand);\ 568 | SET_NZ(mA);\ 569 | } 570 | 571 | #define xPHA()\ 572 | {\ 573 | PUSH(mA);\ 574 | } 575 | 576 | #define xPHP()\ 577 | {\ 578 | PUSH(PS());\ 579 | } 580 | 581 | #define xPHX()\ 582 | {\ 583 | PUSH(mX);\ 584 | } 585 | 586 | #define xPHY()\ 587 | {\ 588 | PUSH(mY);\ 589 | } 590 | 591 | #define xPLA()\ 592 | {\ 593 | PULL(mA);\ 594 | SET_NZ(mA);\ 595 | } 596 | 597 | #define xPLP()\ 598 | {\ 599 | int P;\ 600 | PULL(P);\ 601 | PS(P);\ 602 | } 603 | 604 | #define xPLX()\ 605 | {\ 606 | PULL(mX);\ 607 | SET_NZ(mX);\ 608 | } 609 | 610 | #define xPLY()\ 611 | {\ 612 | PULL(mY);\ 613 | SET_NZ(mY);\ 614 | } 615 | 616 | #define xROL()\ 617 | {\ 618 | int value=CPU_PEEK(mOperand);\ 619 | int oldC=mC;\ 620 | mC=value&0x80;\ 621 | value=(value<<1)|(oldC?1:0);\ 622 | value&=0xff;\ 623 | CPU_POKE(mOperand,value);\ 624 | SET_NZ(value);\ 625 | } 626 | 627 | #define xROLA()\ 628 | {\ 629 | int oldC=mC;\ 630 | mC=mA&0x80;\ 631 | mA=(mA<<1)|(oldC?1:0);\ 632 | mA&=0xff;\ 633 | SET_NZ(mA);\ 634 | } 635 | 636 | #define xROR()\ 637 | {\ 638 | int value=CPU_PEEK(mOperand);\ 639 | int oldC=mC;\ 640 | mC=value&0x01;\ 641 | value=((value>>1)&0x7f)|(oldC?0x80:0x00);\ 642 | value&=0xff;\ 643 | CPU_POKE(mOperand,value);\ 644 | SET_NZ(value);\ 645 | } 646 | 647 | #define xRORA()\ 648 | {\ 649 | int oldC=mC;\ 650 | mC=mA&0x01;\ 651 | mA=((mA>>1)&0x7f)|(oldC?0x80:0x00);\ 652 | mA&=0xff;\ 653 | SET_NZ(mA);\ 654 | } 655 | 656 | #define xRTI()\ 657 | {\ 658 | int tmp;\ 659 | PULL(tmp);\ 660 | PS(tmp);\ 661 | PULL(mPC);\ 662 | PULL(tmp);\ 663 | mPC|=tmp<<8;\ 664 | } 665 | 666 | #define xRTS()\ 667 | {\ 668 | int tmp;\ 669 | PULL(mPC);\ 670 | PULL(tmp);\ 671 | mPC|=tmp<<8;\ 672 | mPC++;\ 673 | } 674 | 675 | /* 676 | #define xSBC()\ 677 | {\ 678 | UBYTE oldA=mA;\ 679 | if(!mD)\ 680 | {\ 681 | UBYTE value=~(CPU_PEEK(mOperand));\ 682 | SWORD difference=(SWORD)((SBYTE)mA)+(SWORD)((SBYTE)value)+(mC?1:0);\ 683 | mV=((difference>127)||(difference<-128));\ 684 | difference=((SWORD)mA)+((SWORD)value)+ (mC?1:0);\ 685 | mA=(UBYTE)difference;\ 686 | mC=(difference>0xff);\ 687 | SET_NZ(mA);\ 688 | }\ 689 | else\ 690 | {\ 691 | UBYTE value=CPU_PEEK(mOperand);\ 692 | SWORD difference=mBCDTable[0][mA]-mBCDTable[0][value]-(mC?0:1);\ 693 | if(difference<0) difference+=100;\ 694 | mA=mBCDTable[1][difference];\ 695 | mC=(oldA>=(value+(mC?0:1)));\ 696 | mV=((oldA^mA)&0x80)&&((mA^value)&0x80);\ 697 | SET_NZ(mA);\ 698 | }\ 699 | } 700 | */ 701 | 702 | #define xSBC()\ 703 | {\ 704 | int value=CPU_PEEK(mOperand);\ 705 | if (mD)\ 706 | {\ 707 | int c = mC?0:1;\ 708 | int sum = mA - value - c;\ 709 | int lo = (mA & 0x0f) - (value & 0x0f) - c;\ 710 | int hi = (mA & 0xf0) - (value & 0xf0);\ 711 | mV=0;\ 712 | mC=0;\ 713 | if ((mA^value) & (mA^sum) & 0x80) mV=1;\ 714 | if (lo & 0xf0) lo -= 6;\ 715 | if (lo & 0x80) hi -= 0x10;\ 716 | if (hi & 0x0f00) hi -= 0x60;\ 717 | if ((sum & 0xff00) == 0) mC=1;\ 718 | mA = (lo & 0x0f) + (hi & 0xf0);\ 719 | }\ 720 | else\ 721 | {\ 722 | int c = mC?0:1;\ 723 | int sum = mA - value - c;\ 724 | mV=0;\ 725 | mC=0;\ 726 | if ((mA^value) & (mA^sum) & 0x80) mV=1;\ 727 | if ((sum & 0xff00) == 0) mC=1;\ 728 | mA = (UBYTE) sum;\ 729 | }\ 730 | SET_NZ(mA)\ 731 | } 732 | 733 | #define xSEC()\ 734 | {\ 735 | mC=true;\ 736 | } 737 | 738 | #define xSED()\ 739 | {\ 740 | mD=true;\ 741 | } 742 | 743 | #define xSEI()\ 744 | {\ 745 | mI=true;\ 746 | } 747 | 748 | #define xSTA()\ 749 | {\ 750 | CPU_POKE(mOperand,mA);\ 751 | } 752 | 753 | #define xSTP()\ 754 | {\ 755 | gSystemCPUSleep=TRUE;\ 756 | } 757 | 758 | #define xSTX()\ 759 | {\ 760 | CPU_POKE(mOperand,mX);\ 761 | } 762 | 763 | #define xSTY()\ 764 | {\ 765 | CPU_POKE(mOperand,mY);\ 766 | } 767 | 768 | #define xSTZ()\ 769 | {\ 770 | CPU_POKE(mOperand,0);\ 771 | } 772 | 773 | #define xTAX()\ 774 | {\ 775 | mX=mA;\ 776 | SET_NZ(mX);\ 777 | } 778 | 779 | #define xTAY()\ 780 | {\ 781 | mY=mA;\ 782 | SET_NZ(mY);\ 783 | } 784 | 785 | #define xTRB()\ 786 | {\ 787 | int value=CPU_PEEK(mOperand);\ 788 | SET_Z(mA&value);\ 789 | value=value&(mA^0xff);\ 790 | CPU_POKE(mOperand,value);\ 791 | } 792 | // 793 | // THE COMMENTED OUT CODE IS DERIVED FROM THE MAME 65C02 MODEL AND 794 | // LOOKS TO BE INCORRECT i.e When plugged into Handy things stop working 795 | // 796 | /* 797 | #define xTRB()\ 798 | {\ 799 | int value=CPU_PEEK(mOperand);\ 800 | value &= ~mA;\ 801 | SET_NZ(value);\ 802 | CPU_POKE(mOperand,value);\ 803 | } 804 | */ 805 | 806 | #define xTSB()\ 807 | {\ 808 | int value=CPU_PEEK(mOperand);\ 809 | SET_Z(mA&value);\ 810 | value=value|mA;\ 811 | CPU_POKE(mOperand,value);\ 812 | } 813 | // 814 | // THE COMMENTED OUT CODE IS DERIVED FROM THE MAME 65C02 MODEL AND 815 | // LOOKS TO BE INCORRECT i.e When plugged into Handy things stop working 816 | // 817 | /* 818 | #define xTSB()\ 819 | {\ 820 | int value=CPU_PEEK(mOperand);\ 821 | value |= mA;\ 822 | SET_NZ(value);\ 823 | CPU_POKE(mOperand,value);\ 824 | } 825 | */ 826 | 827 | #define xTSX()\ 828 | {\ 829 | mX=mSP;\ 830 | SET_NZ(mX);\ 831 | } 832 | 833 | #define xTXA()\ 834 | {\ 835 | mA=mX;\ 836 | SET_NZ(mA);\ 837 | } 838 | 839 | #define xTXS()\ 840 | {\ 841 | mSP=mX;\ 842 | } 843 | 844 | #define xTYA()\ 845 | {\ 846 | mA=mY;\ 847 | SET_NZ(mA);\ 848 | } 849 | 850 | #define xWAI()\ 851 | {\ 852 | gSystemCPUSleep=TRUE;\ 853 | } 854 | 855 | -------------------------------------------------------------------------------- /Sim800/ANSI/w65c02macro.h: -------------------------------------------------------------------------------- 1 | #ifndef _WQX_65C02_MACRO_H 2 | #define _WQX_65C02_MACRO_H 3 | 4 | // 5 | // Copyright (c) 2004 K. Wilkins 6 | // 7 | // This software is provided 'as-is', without any express or implied warranty. 8 | // In no event will the authors be held liable for any damages arising from 9 | // the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would be 18 | // appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source distribution. 24 | // 25 | 26 | ////////////////////////////////////////////////////////////////////////////// 27 | // Handy - An Atari Lynx Emulator // 28 | // Copyright (c) 1996,1997 // 29 | // K. Wilkins // 30 | ////////////////////////////////////////////////////////////////////////////// 31 | // 65C02 Macro definitions // 32 | ////////////////////////////////////////////////////////////////////////////// 33 | // // 34 | // This file contains all of the required address mode and operand // 35 | // macro definitions for the 65C02 emulation // 36 | // // 37 | // K. Wilkins // 38 | // August 1997 // 39 | // // 40 | ////////////////////////////////////////////////////////////////////////////// 41 | // Revision History: // 42 | // ----------------- // 43 | // // 44 | // 01Aug1997 KW Document header added & class documented. // 45 | // // 46 | ////////////////////////////////////////////////////////////////////////////// 47 | 48 | // 49 | // Addressing mode decoding 50 | // 51 | 52 | #define xIMMEDIATE() {mOperand=mPC;mPC++;} 53 | #define xABSOLUTE() {mOperand=CPU_PEEKW(mPC);mPC+=2;} 54 | #define xZEROPAGE() {mOperand=CPU_PEEK(mPC);mPC++;} 55 | #define xZEROPAGE_X() {mOperand=CPU_PEEK(mPC)+mX;mPC++;mOperand&=0xff;} 56 | #define xZEROPAGE_Y() {mOperand=CPU_PEEK(mPC)+mY;mPC++;mOperand&=0xff;} 57 | #define xABSOLUTE_X() {mOperand=CPU_PEEKW(mPC);mPC+=2;mOperand+=mX;mOperand&=0xffff;} 58 | #define xABSOLUTE_Y() {mOperand=CPU_PEEKW(mPC);mPC+=2;mOperand+=mY;mOperand&=0xffff;} 59 | #define xINDIRECT_ABSOLUTE_X() {mOperand=CPU_PEEKW(mPC);mPC+=2;mOperand+=mX;mOperand&=0xffff;mOperand=CPU_PEEKW(mOperand);} 60 | #define xRELATIVE() {mOperand=CPU_PEEK(mPC);mPC++;mOperand=(mPC+mOperand)&0xffff;} 61 | #define xINDIRECT_X() {mOperand=CPU_PEEK(mPC);mPC++;mOperand=mOperand+mX;mOperand&=0x00ff;mOperand=CPU_PEEKW(mOperand);} 62 | #define xINDIRECT_Y() {mOperand=CPU_PEEK(mPC);mPC++;mOperand=CPU_PEEKW(mOperand);mOperand=mOperand+mY;mOperand&=0xffff;} 63 | #define xINDIRECT_ABSOLUTE() {mOperand=CPU_PEEKW(mPC);mPC+=2;mOperand=CPU_PEEKW(mOperand);} 64 | #define xINDIRECT() {mOperand=CPU_PEEK(mPC);mPC++;mOperand=CPU_PEEKW(mOperand);} 65 | 66 | // 67 | // Helper Macros 68 | // 69 | //#define SET_Z(m) { mZ=(m)?false:true; } 70 | //#define SET_N(m) { mN=(m&0x80)?true:false; } 71 | //#define SET_NZ(m) SET_Z(m) SET_N(m) 72 | #define SET_Z(m) { mZ=!(m); } 73 | #define SET_N(m) { mN=(m)&0x80; } 74 | #define SET_NZ(m) { mZ=!(m); mN=(m)&0x80; } 75 | #define PULL(m) { mSP++; mSP&=0xff; m=CPU_PEEK(mSP+0x0100); } 76 | #define PUSH(m) { CPU_POKE(0x0100+mSP,m); mSP--; mSP&=0xff; } 77 | // 78 | // Opcode execution 79 | // 80 | 81 | /* 82 | #define xADC()\ 83 | {\ 84 | BYTE value=CPU_PEEK(mOperand);\ 85 | BYTE oldA=mA;\ 86 | if(!mD)\ 87 | {\ 88 | SWORD sum=(SWORD)((SBYTE)mA)+(SWORD)((SBYTE)value)+(mC?1:0);\ 89 | mV=((sum > 127) || (sum < -128));\ 90 | sum=(SWORD)mA + (SWORD)value + (mC?1:0);\ 91 | mA=(BYTE)sum;\ 92 | mC=(sum>0xff);\ 93 | SET_NZ(mA);\ 94 | }\ 95 | else\ 96 | {\ 97 | SWORD sum=mBCDTable[0][mA]+mBCDTable[0][value]+(mC?1:0);\ 98 | mC=(sum > 99);\ 99 | mA=mBCDTable[1][sum & 0xff];\ 100 | SET_NZ(mA);\ 101 | mV=((oldA^mA)&0x80) && ((mA^value)&0x80);\ 102 | }\ 103 | } 104 | */ 105 | 106 | #define xADC()\ 107 | {\ 108 | int value=CPU_PEEK(mOperand);\ 109 | if(mD)\ 110 | {\ 111 | int c = mC?1:0;\ 112 | int lo = (mA & 0x0f) + (value & 0x0f) + c;\ 113 | int hi = (mA & 0xf0) + (value & 0xf0);\ 114 | mV=0;\ 115 | mC=0;\ 116 | if (lo > 0x09)\ 117 | {\ 118 | hi += 0x10;\ 119 | lo += 0x06;\ 120 | }\ 121 | if (~(mA^value) & (mA^hi) & 0x80) mV=1;\ 122 | if (hi > 0x90) hi += 0x60;\ 123 | if (hi & 0xff00) mC=1;\ 124 | mA = (lo & 0x0f) + (hi & 0xf0);\ 125 | }\ 126 | else\ 127 | {\ 128 | int c = mC?1:0;\ 129 | int sum = mA + value + c;\ 130 | mV=0;\ 131 | mC=0;\ 132 | if (~(mA^value) & (mA^sum) & 0x80) mV=1;\ 133 | if (sum & 0xff00) mC=1;\ 134 | mA = (BYTE) sum;\ 135 | }\ 136 | SET_NZ(mA)\ 137 | } 138 | 139 | #define xAND()\ 140 | {\ 141 | mA&=CPU_PEEK(mOperand);\ 142 | SET_NZ(mA);\ 143 | } 144 | 145 | #define xASL()\ 146 | {\ 147 | int value=CPU_PEEK(mOperand);\ 148 | mC=value&0x80;\ 149 | value<<=1;\ 150 | value&=0xff;\ 151 | SET_NZ(value);\ 152 | CPU_POKE(mOperand,value);\ 153 | } 154 | 155 | #define xASLA()\ 156 | {\ 157 | mC=mA&0x80;\ 158 | mA<<=1;\ 159 | mA&=0xff;\ 160 | SET_NZ(mA);\ 161 | } 162 | 163 | #define xBCC()\ 164 | {\ 165 | if(!mC)\ 166 | {\ 167 | int offset=(signed char)CPU_PEEK(mPC);\ 168 | mPC++;\ 169 | mPC+=offset;\ 170 | mPC&=0xffff;\ 171 | }\ 172 | else\ 173 | {\ 174 | mPC++;\ 175 | mPC&=0xffff;\ 176 | }\ 177 | } 178 | 179 | #define xBCS()\ 180 | {\ 181 | if(mC)\ 182 | {\ 183 | int offset=(signed char)CPU_PEEK(mPC);\ 184 | mPC++;\ 185 | mPC+=offset;\ 186 | mPC&=0xffff;\ 187 | }\ 188 | else\ 189 | {\ 190 | mPC++;\ 191 | mPC&=0xffff;\ 192 | }\ 193 | } 194 | 195 | #define xBEQ()\ 196 | {\ 197 | if(mZ)\ 198 | {\ 199 | int offset=(signed char)CPU_PEEK(mPC);\ 200 | mPC++;\ 201 | mPC+=offset;\ 202 | mPC&=0xffff;\ 203 | }\ 204 | else\ 205 | {\ 206 | mPC++;\ 207 | mPC&=0xffff;\ 208 | }\ 209 | } 210 | 211 | #define xBIT()\ 212 | {\ 213 | int value=CPU_PEEK(mOperand);\ 214 | SET_Z(mA&value);\ 215 | \ 216 | if(mOpcode!=0x89)\ 217 | {\ 218 | mN=value&0x80;\ 219 | mV=value&0x40;\ 220 | }\ 221 | } 222 | 223 | /* 224 | // 225 | // DONT USE THIS VERSION OF BIT, IT BREAKS CALGAMES TITLE SCREEN !!!! 226 | // 227 | #define xBIT()\ 228 | {\ 229 | int value=CPU_PEEK(mOperand);\ 230 | SET_Z(mA&value);\ 231 | \ 232 | mN=value&0x80;\ 233 | mV=value&0x40;\ 234 | } 235 | */ 236 | 237 | #define xBMI()\ 238 | {\ 239 | if(mN)\ 240 | {\ 241 | int offset=(signed char)CPU_PEEK(mPC);\ 242 | mPC++;\ 243 | mPC+=offset;\ 244 | mPC&=0xffff;\ 245 | }\ 246 | else\ 247 | {\ 248 | mPC++;\ 249 | mPC&=0xffff;\ 250 | }\ 251 | } 252 | 253 | #define xBNE()\ 254 | {\ 255 | if(!mZ)\ 256 | {\ 257 | int offset=(signed char)CPU_PEEK(mPC);\ 258 | mPC++;\ 259 | mPC+=offset;\ 260 | mPC&=0xffff;\ 261 | }\ 262 | else\ 263 | {\ 264 | mPC++;\ 265 | mPC&=0xffff;\ 266 | }\ 267 | } 268 | 269 | #define xBPL()\ 270 | {\ 271 | if(!mN)\ 272 | {\ 273 | int offset=(signed char)CPU_PEEK(mPC);\ 274 | mPC++;\ 275 | mPC+=offset;\ 276 | mPC&=0xffff;\ 277 | }\ 278 | else\ 279 | {\ 280 | mPC++;\ 281 | mPC&=0xffff;\ 282 | }\ 283 | } 284 | 285 | #define xBRA()\ 286 | {\ 287 | int offset=(signed char)CPU_PEEK(mPC);\ 288 | mPC++;\ 289 | mPC+=offset;\ 290 | mPC&=0xffff;\ 291 | } 292 | 293 | /* 294 | #define xBRK()\ 295 | {\ 296 | mPC++;\ 297 | PUSH(mPC>>8);\ 298 | PUSH(mPC&0xff);\ 299 | PUSH(PS()|0x10);\ 300 | \ 301 | mD=FALSE;\ 302 | mI=TRUE;\ 303 | \ 304 | mPC=CPU_PEEKW(IRQ_VECTOR);\ 305 | } 306 | */ 307 | 308 | #ifdef MERGEGGVSIM 309 | #define xBRK()\ 310 | {\ 311 | mPC++;\ 312 | PUSH(mPC>>8);\ 313 | PUSH(mPC&0xff);\ 314 | PUSH(PS()|0x10);\ 315 | \ 316 | mD=FALSE;\ 317 | mI=TRUE;\ 318 | mB = TRUE; /* MERGE */ \ 319 | \ 320 | mPC=CPU_PEEKW(IRQ_VECTOR);\ 321 | } 322 | #else 323 | #define xBRK()\ 324 | {\ 325 | mPC++;\ 326 | PUSH(mPC>>8);\ 327 | PUSH(mPC&0xff);\ 328 | PUSH(PS()|0x10);\ 329 | \ 330 | mD=FALSE;\ 331 | mI=TRUE;\ 332 | \ 333 | mPC=CPU_PEEKW(IRQ_VECTOR);\ 334 | } 335 | #endif 336 | // KW 4/11/98 B flag needed to be set IN the stack status word = 0x10. 337 | 338 | #define xBVC()\ 339 | {\ 340 | if(!mV)\ 341 | {\ 342 | int offset=(signed char)CPU_PEEK(mPC);\ 343 | mPC++;\ 344 | mPC+=offset;\ 345 | mPC&=0xffff;\ 346 | }\ 347 | else\ 348 | {\ 349 | mPC++;\ 350 | mPC&=0xffff;\ 351 | }\ 352 | } 353 | 354 | #define xBVS()\ 355 | {\ 356 | if(mV)\ 357 | {\ 358 | int offset=(signed char)CPU_PEEK(mPC);\ 359 | mPC++;\ 360 | mPC+=offset;\ 361 | mPC&=0xffff;\ 362 | }\ 363 | else\ 364 | {\ 365 | mPC++;\ 366 | mPC&=0xffff;\ 367 | }\ 368 | } 369 | 370 | #define xCLC()\ 371 | {\ 372 | mC=FALSE;\ 373 | } 374 | 375 | #define xCLD()\ 376 | {\ 377 | mD=FALSE;\ 378 | } 379 | 380 | #define xCLI()\ 381 | {\ 382 | mI=FALSE;\ 383 | } 384 | 385 | #define xCLV()\ 386 | {\ 387 | mV=FALSE;\ 388 | } 389 | 390 | // 391 | // Alternate CMP code 392 | // 393 | /* 394 | #define xCMP()\ 395 | {\ 396 | BYTE value=CPU_PEEK(mOperand);\ 397 | if(mA+0x100-value>0xff) mC=TRUE; else mC=FALSE;\ 398 | value=mA+0x100-value;\ 399 | mZ=!value;\ 400 | mN=value&0x0080;\ 401 | } 402 | 403 | #define xCPX()\ 404 | {\ 405 | BYTE value=CPU_PEEK(mOperand);\ 406 | if(mX+0x100-value>0xff) mC=TRUE; else mC=FALSE;\ 407 | value=mX+0x100-value;\ 408 | mZ=!value;\ 409 | mN=value&0x0080;\ 410 | } 411 | 412 | #define xCPY()\ 413 | {\ 414 | BYTE value=CPU_PEEK(mOperand);\ 415 | if(mY+0x100-value>0xff) mC=TRUE; else mC=FALSE;\ 416 | value=mY+0x100-value;\ 417 | mZ=!value;\ 418 | mN=value&0x0080;\ 419 | } 420 | 421 | #define xCMP()\ 422 | {\ 423 | UWORD value=(UWORD)mA-CPU_PEEK(mOperand);\ 424 | SET_NZ(value);\ 425 | mC=!(value&0x0100);\ 426 | } 427 | */ 428 | #define xCMP()\ 429 | {\ 430 | int value=CPU_PEEK(mOperand);\ 431 | mC=0;\ 432 | if (mA >= value) mC=1;\ 433 | SET_NZ((BYTE)(mA - value))\ 434 | } 435 | 436 | /* 437 | #define xCPX()\ 438 | {\ 439 | UWORD value=(UWORD)mX-CPU_PEEK(mOperand);\ 440 | SET_NZ(value);\ 441 | mC=!(value&0x0100);\ 442 | } 443 | */ 444 | 445 | #define xCPX()\ 446 | {\ 447 | int value=CPU_PEEK(mOperand);\ 448 | mC=0;\ 449 | if (mX >= value) mC=1;\ 450 | SET_NZ((BYTE)(mX - value))\ 451 | } 452 | 453 | /* 454 | #define xCPY()\ 455 | {\ 456 | UWORD value=(UWORD)mY-CPU_PEEK(mOperand);\ 457 | SET_NZ(value);\ 458 | mC=!(value&0x0100);\ 459 | } 460 | */ 461 | 462 | #define xCPY()\ 463 | {\ 464 | int value=CPU_PEEK(mOperand);\ 465 | mC=0;\ 466 | if (mY >= value) mC=1;\ 467 | SET_NZ((BYTE)(mY - value))\ 468 | } 469 | 470 | #define xDEC()\ 471 | {\ 472 | int value=CPU_PEEK(mOperand)-1;\ 473 | value&=0xff;\ 474 | CPU_POKE(mOperand,value);\ 475 | SET_NZ(value);\ 476 | } 477 | 478 | #define xDECA()\ 479 | {\ 480 | mA--;\ 481 | mA&=0xff;\ 482 | SET_NZ(mA);\ 483 | } 484 | 485 | #define xDEX()\ 486 | {\ 487 | mX--;\ 488 | mX&=0xff;\ 489 | SET_NZ(mX);\ 490 | } 491 | 492 | #define xDEY()\ 493 | {\ 494 | mY--;\ 495 | mY&=0xff;\ 496 | SET_NZ(mY);\ 497 | } 498 | 499 | #define xEOR()\ 500 | {\ 501 | mA^=CPU_PEEK(mOperand);\ 502 | SET_NZ(mA);\ 503 | } 504 | 505 | #define xINC()\ 506 | {\ 507 | int value=CPU_PEEK(mOperand)+1;\ 508 | value&=0xff;\ 509 | CPU_POKE(mOperand,value);\ 510 | SET_NZ(value);\ 511 | } 512 | 513 | #define xINCA()\ 514 | {\ 515 | mA++;\ 516 | mA&=0xff;\ 517 | SET_NZ(mA);\ 518 | } 519 | 520 | #define xINX()\ 521 | {\ 522 | mX++;\ 523 | mX&=0xff;\ 524 | SET_NZ(mX);\ 525 | } 526 | 527 | #define xINY()\ 528 | {\ 529 | mY++;\ 530 | mY&=0xff;\ 531 | SET_NZ(mY);\ 532 | } 533 | 534 | #define xJMP()\ 535 | {\ 536 | mPC=mOperand;\ 537 | } 538 | 539 | #define xJSR()\ 540 | {\ 541 | PUSH((mPC-1)>>8);\ 542 | PUSH((mPC-1)&0xff);\ 543 | mPC=mOperand;\ 544 | } 545 | 546 | #define xLDA()\ 547 | {\ 548 | mA=CPU_PEEK(mOperand);\ 549 | SET_NZ(mA);\ 550 | } 551 | 552 | #define xLDX()\ 553 | {\ 554 | mX=CPU_PEEK(mOperand);\ 555 | SET_NZ(mX);\ 556 | } 557 | 558 | #define xLDY()\ 559 | {\ 560 | mY=CPU_PEEK(mOperand);\ 561 | SET_NZ(mY);\ 562 | } 563 | 564 | #define xLSR()\ 565 | {\ 566 | int value=CPU_PEEK(mOperand);\ 567 | mC=value&0x01;\ 568 | value=(value>>1)&0x7f;\ 569 | CPU_POKE(mOperand,value);\ 570 | SET_NZ(value);\ 571 | } 572 | 573 | #define xLSRA()\ 574 | {\ 575 | mC=mA&0x01;\ 576 | mA=(mA>>1)&0x7f;\ 577 | SET_NZ(mA);\ 578 | } 579 | 580 | #define xNOP()\ 581 | {\ 582 | } 583 | 584 | #define xORA()\ 585 | {\ 586 | mA|=CPU_PEEK(mOperand);\ 587 | SET_NZ(mA);\ 588 | } 589 | 590 | #define xPHA()\ 591 | {\ 592 | PUSH(mA);\ 593 | } 594 | 595 | #define xPHP()\ 596 | {\ 597 | PUSH(PS());\ 598 | } 599 | 600 | #define xPHX()\ 601 | {\ 602 | PUSH(mX);\ 603 | } 604 | 605 | #define xPHY()\ 606 | {\ 607 | PUSH(mY);\ 608 | } 609 | 610 | #define xPLA()\ 611 | {\ 612 | PULL(mA);\ 613 | SET_NZ(mA);\ 614 | } 615 | 616 | #define xPLP()\ 617 | {\ 618 | int P;\ 619 | PULL(P);\ 620 | setPS(P);\ 621 | } 622 | 623 | #define xPLX()\ 624 | {\ 625 | PULL(mX);\ 626 | SET_NZ(mX);\ 627 | } 628 | 629 | #define xPLY()\ 630 | {\ 631 | PULL(mY);\ 632 | SET_NZ(mY);\ 633 | } 634 | 635 | #define xROL()\ 636 | {\ 637 | int value=CPU_PEEK(mOperand);\ 638 | int oldC=mC;\ 639 | mC=value&0x80;\ 640 | value=(value<<1)|(oldC?1:0);\ 641 | value&=0xff;\ 642 | CPU_POKE(mOperand,value);\ 643 | SET_NZ(value);\ 644 | } 645 | 646 | #define xROLA()\ 647 | {\ 648 | int oldC=mC;\ 649 | mC=mA&0x80;\ 650 | mA=(mA<<1)|(oldC?1:0);\ 651 | mA&=0xff;\ 652 | SET_NZ(mA);\ 653 | } 654 | 655 | #define xROR()\ 656 | {\ 657 | int value=CPU_PEEK(mOperand);\ 658 | int oldC=mC;\ 659 | mC=value&0x01;\ 660 | value=((value>>1)&0x7f)|(oldC?0x80:0x00);\ 661 | value&=0xff;\ 662 | CPU_POKE(mOperand,value);\ 663 | SET_NZ(value);\ 664 | } 665 | 666 | #define xRORA()\ 667 | {\ 668 | int oldC=mC;\ 669 | mC=mA&0x01;\ 670 | mA=((mA>>1)&0x7f)|(oldC?0x80:0x00);\ 671 | mA&=0xff;\ 672 | SET_NZ(mA);\ 673 | } 674 | 675 | #ifdef MERGEGGVSIM 676 | #define xRTI()\ 677 | {\ 678 | int tmp;\ 679 | PULL(tmp);\ 680 | setPS(tmp);\ 681 | mI = FALSE; /* MERGE */ \ 682 | PULL(mPC);\ 683 | PULL(tmp);\ 684 | mPC|=tmp<<8;\ 685 | } 686 | #else 687 | #define xRTI()\ 688 | {\ 689 | int tmp;\ 690 | PULL(tmp);\ 691 | setPS(tmp);\ 692 | PULL(mPC);\ 693 | PULL(tmp);\ 694 | mPC|=tmp<<8;\ 695 | } 696 | #endif 697 | 698 | #define xRTS()\ 699 | {\ 700 | int tmp;\ 701 | PULL(mPC);\ 702 | PULL(tmp);\ 703 | mPC|=tmp<<8;\ 704 | mPC++;\ 705 | } 706 | 707 | /* 708 | #define xSBC()\ 709 | {\ 710 | BYTE oldA=mA;\ 711 | if(!mD)\ 712 | {\ 713 | BYTE value=~(CPU_PEEK(mOperand));\ 714 | SWORD difference=(SWORD)((SBYTE)mA)+(SWORD)((SBYTE)value)+(mC?1:0);\ 715 | mV=((difference>127)||(difference<-128));\ 716 | difference=((SWORD)mA)+((SWORD)value)+ (mC?1:0);\ 717 | mA=(BYTE)difference;\ 718 | mC=(difference>0xff);\ 719 | SET_NZ(mA);\ 720 | }\ 721 | else\ 722 | {\ 723 | BYTE value=CPU_PEEK(mOperand);\ 724 | SWORD difference=mBCDTable[0][mA]-mBCDTable[0][value]-(mC?0:1);\ 725 | if(difference<0) difference+=100;\ 726 | mA=mBCDTable[1][difference];\ 727 | mC=(oldA>=(value+(mC?0:1)));\ 728 | mV=((oldA^mA)&0x80)&&((mA^value)&0x80);\ 729 | SET_NZ(mA);\ 730 | }\ 731 | } 732 | */ 733 | 734 | #define xSBC()\ 735 | {\ 736 | int value=CPU_PEEK(mOperand);\ 737 | if (mD)\ 738 | {\ 739 | int c = mC?0:1;\ 740 | int sum = mA - value - c;\ 741 | int lo = (mA & 0x0f) - (value & 0x0f) - c;\ 742 | int hi = (mA & 0xf0) - (value & 0xf0);\ 743 | mV=0;\ 744 | mC=0;\ 745 | if ((mA^value) & (mA^sum) & 0x80) mV=1;\ 746 | if (lo & 0xf0) lo -= 6;\ 747 | if (lo & 0x80) hi -= 0x10;\ 748 | if (hi & 0x0f00) hi -= 0x60;\ 749 | if ((sum & 0xff00) == 0) mC=1;\ 750 | mA = (lo & 0x0f) + (hi & 0xf0);\ 751 | }\ 752 | else\ 753 | {\ 754 | int c = mC?0:1;\ 755 | int sum = mA - value - c;\ 756 | mV=0;\ 757 | mC=0;\ 758 | if ((mA^value) & (mA^sum) & 0x80) mV=1;\ 759 | if ((sum & 0xff00) == 0) mC=1;\ 760 | mA = (BYTE) sum;\ 761 | }\ 762 | SET_NZ(mA)\ 763 | } 764 | 765 | #define xSEC()\ 766 | {\ 767 | mC=true;\ 768 | } 769 | 770 | #define xSED()\ 771 | {\ 772 | mD=true;\ 773 | } 774 | 775 | #define xSEI()\ 776 | {\ 777 | mI=true;\ 778 | } 779 | 780 | #define xSTA()\ 781 | {\ 782 | CPU_POKE(mOperand,mA);\ 783 | } 784 | 785 | #define xSTP()\ 786 | {\ 787 | g_wai=TRUE;\ 788 | } 789 | 790 | #define xSTX()\ 791 | {\ 792 | CPU_POKE(mOperand,mX);\ 793 | } 794 | 795 | #define xSTY()\ 796 | {\ 797 | CPU_POKE(mOperand,mY);\ 798 | } 799 | 800 | #define xSTZ()\ 801 | {\ 802 | CPU_POKE(mOperand,0);\ 803 | } 804 | 805 | #define xTAX()\ 806 | {\ 807 | mX=mA;\ 808 | SET_NZ(mX);\ 809 | } 810 | 811 | #define xTAY()\ 812 | {\ 813 | mY=mA;\ 814 | SET_NZ(mY);\ 815 | } 816 | 817 | #define xTRB()\ 818 | {\ 819 | int value=CPU_PEEK(mOperand);\ 820 | SET_Z(mA&value);\ 821 | value=value&(mA^0xff);\ 822 | CPU_POKE(mOperand,value);\ 823 | } 824 | // 825 | // THE COMMENTED OUT CODE IS DERIVED FROM THE MAME 65C02 MODEL AND 826 | // LOOKS TO BE INCORRECT i.e When plugged into Handy things stop working 827 | // 828 | /* 829 | #define xTRB()\ 830 | {\ 831 | int value=CPU_PEEK(mOperand);\ 832 | value &= ~mA;\ 833 | SET_NZ(value);\ 834 | CPU_POKE(mOperand,value);\ 835 | } 836 | */ 837 | 838 | #define xTSB()\ 839 | {\ 840 | int value=CPU_PEEK(mOperand);\ 841 | SET_Z(mA&value);\ 842 | value=value|mA;\ 843 | CPU_POKE(mOperand,value);\ 844 | } 845 | // 846 | // THE COMMENTED OUT CODE IS DERIVED FROM THE MAME 65C02 MODEL AND 847 | // LOOKS TO BE INCORRECT i.e When plugged into Handy things stop working 848 | // 849 | /* 850 | #define xTSB()\ 851 | {\ 852 | int value=CPU_PEEK(mOperand);\ 853 | value |= mA;\ 854 | SET_NZ(value);\ 855 | CPU_POKE(mOperand,value);\ 856 | } 857 | */ 858 | 859 | #define xTSX()\ 860 | {\ 861 | mX=mSP;\ 862 | SET_NZ(mX);\ 863 | } 864 | 865 | #define xTXA()\ 866 | {\ 867 | mA=mX;\ 868 | SET_NZ(mA);\ 869 | } 870 | 871 | #define xTXS()\ 872 | {\ 873 | mSP=mX;\ 874 | } 875 | 876 | #define xTYA()\ 877 | {\ 878 | mA=mY;\ 879 | SET_NZ(mA);\ 880 | } 881 | 882 | #define xWAI()\ 883 | {\ 884 | g_wai=TRUE;\ 885 | } 886 | 887 | 888 | #endif // _WQX_65C02_MACRO_H 889 | --------------------------------------------------------------------------------