;**********************************************************************; ;* A T O M I C D E B U G G E R *; ;*--------------------------------------------------------------------*; ;* doel : machinetaal debugger voor Atom-in-PC met *; ;* ondersteuning van 6502, 65C02 en 65802 *; ;*--------------------------------------------------------------------*; ;* filenaam : options.inc *; ;* auteur : Roland Leurs *; ;* The Atomic Development Studio *; ;* ontwikkeld : maart 1998 *; ;* laatste update : *; ;*--------------------------------------------------------------------*; ;* assembleren : x6502 DEBUG *; ;*--------------------------------------------------------------------*; ;* oproep : DEBUG *; ;**********************************************************************; opttekst .db 31,68,12,"1..2:Toggle" .db 31,68,13,"Esc :Quit" .db 17,14 .db 31,28,15,"Atomic Debugger Options" .db 31,22,17,"[1] ROM debuggin' :" .db 31,22,18,"[2] Second monitor active :" .db 0 statusopt .db "Options menu",0 optfile .db "debug.ini",0,2 opt lda options ;laadt huidige opties pha ;bewaar deze op stack ldx #7 ldy #6 jsr scrcopy jsr osvclear ;maak window leeg ldx #opttekst jsr showmenu ldx #statusopt jsr statusline lda menutxtkleur ;zet juiste kleur jsr colour optmenu ldx #50 ;cursor naar juiste positie ldy #17 jsr gotoxy lda options ;laadt optie byte bmi optmenu1 jsr print ;print melding optie enabled .db "enabled ",$EA jmp optmenu2 ;spring naar invoer optmenu1 jsr print ;print melding optie disabled .db "disabled",$EA optmenu2 ldx #50 ;cursor naar juiste positie ldy #18 jsr gotoxy lda options ;laadt optie byte lsr a ;schuif bit 0 in carry bcs optmenu2a jsr print ; print melding yes/no .db "no ",$EA jmp optmenu3 optmenu2a jsr print .db "yes",$EA optmenu3 jsr rdch ;lees toets cmp #'1' ;test op '1' bne optmenu4 lda options ;toggle optie eor #$80 sta options jmp optmenu ;terug naar menu optmenu4 cmp #'2' ;test op '2' bne optmenu5 lda options ;toggle optie eor #$01 sta options jmp optmenu ;terug naar menu optmenu5 cmp #27 ;escape? bne optmenu3 ;spring indien ongeldige toets opt_end jsr opt_save ;bewaar opties in file ldx #6 ldy #7 jsr scrcopy pla ;laadt oude opties eor options ;exor met nieuwe opties lsr a ;schuif monitor bit in carry bcc opt_exit ;indien geen wijziging dan wegwezen lda options ;laadt nieuwe monitor optie lsr a ;schuif monitorbit in carry bcc opt_vga ;spring bij vga scherm jsr setsem ;vga monitor ff naar scherm 0 schakelen ldy #0 jsr screen1 jsr vdu_init ;initialiseer mda scherm jsr set_mda ;schakel naar mda scherm jmp restart ;herstart debugger opt_vga lda #12 ;wis monochroom scherm jsr wrch jsr hcuron ;mda cursor aanzetten jsr set_vga ;schakel naar vga scherm jmp restart ;herstart debugger opt_exit jsr osvclear ;wis venster lda mem_home ;refresh memory dump op scherm sta zp lda mem_home+1 sta zp+1 jsr memdump rts opt_open jsr setsem ;zet semafoor lda #$3F ;geef pc-commando om file te openen jsr pccom ldx #0 ;laadt pointer opt_open1 lda optfile,x ;laadt karakter jsr zendbyte ;stuur naar pc inx ;verhoog pointer cmp #2 ;test op einde string bne opt_open1 ;spring indien niet gelijk jsr leesbyte ;lees handle tay ;zet in y register rts ;einde routine opt_close lda #$40 ;geef pc-commando om file te sluiten jsr pccom tya ;handle naar pc sturen jsr zendbyte opt_close1 rts ;einde routine opt_save jsr opt_open ;open optie file cpy #0 ;test op geopende file beq opt_save1 ;spring als file niet geopend lda #$41 ;geef pc-commando om byte te schrijven jsr pccom tya ;handle naar pc sturen jsr zendbyte lda options ;lees optie byte jsr zendbyte ;schrijf naar file jsr leesbyte ;lees, maar negeer, statusbyte jsr opt_close ;sluit file opt_save1 jmp clrsem ;einde routine opt_load jsr opt_open ;open optie file cpy #0 ;test op geopende file beq opt_load3 ;spring als file niet geopend lda #$42 ;geef pc-commando om byte te lezen jsr pccom tya ;handle naar pc sturen jsr zendbyte jsr leesbyte ;lees statusbyte beq opt_load1 ;spring indien niets gelezen (file is leeg) jsr leesbyte ;lees optie byte sta options jmp opt_load2 ;spring altijd opt_load1 jsr leesbyte ;dummy read opt_load2 jsr opt_close ;sluit file opt_load3 jmp clrsem ;einde routine