0 Members and 1 Guest are viewing this topic.
;note that this is all done in Mimas and that it is a work in progress, so there might be some kinda weird stuff;#SECTION "MAIN", CODE org userMem - 2 db 0BBh, 6DhmainMenu: B_CALL _ClrLCDFull di; fast mode ld a, 3 out (20h), a; set up display ld hl, 3A02h ld (penCol), hl ld hl, mainMenuOptions B_CALL _VPutS call LCD_BUSY_QUICK ld a, 07h out (10h), a call LCD_BUSY_QUICK ld a, 20h out (10h), a call LCD_BUSY_QUICK ld a, 0BAh out (10h), a ld hl, buttonBorderData ld b, 12buttonBorders: call LCD_BUSY_QUICK ld a, (hl) out (11h), a inc hl djnz buttonBorders call LCD_BUSY_QUICK ld a, 0B9h out (10h), a call LCD_BUSY_QUICK ld a, 20h out (10h), a ld b, 12 ld a, 0FFhsolidLine: call LCD_BUSY_QUICK out (11h), a djnz solidLine; install interrupt im 2 ld a, 99h ld i, a ld hl, 9900h ld de, 9901h ld bc, 256 ld (hl), 98h ldir ld a, 0C3h ld (9898h), a ld hl, interrupt ld (9899h), hl xor a out (03h), a ld a, 40h out (30h), a ld a, 2 out (31h), a ld a, 178 out (32h), a eimainMenuGetKey: ld a, 10111111b out (01h), a nop nop nop nop in a, (01h) rra jr nc, exit rra jr nc, help rra jr nc, settings rra jr nc, loadGame rra jr nc, newGame jr mainMenuGetKeynewGame:loadGame:settings:help:exit: di im 1 xor a out (31h), a ld a, 00001011b out (03h), a B_CALL _ClrLCDFull retinterrupt: ex af, af' exx; timers and stuff in a, (04h) ld b, a xor a out (03h), a bit 5, b jr z, exitInterrupt ld a, 40h out (30h), a ld a, 2 out (31h), a ld a, (grayscaleCounter) out (32h), a ld hl, mainMenuPicData; draw pic ld a, (grayCarry) rra ld a, (grayMask) push af ld c, 80hnewRow: call LCD_BUSY_QUICK ld a, 20h out (10h), a call LCD_BUSY_QUICK ld a, c cp 0B9h jr z, endDraw out (10h), a ld b, 12ditherLoop: pop af rra push af ld d, a and (hl) ld e, a inc hl ld a, d cpl and (hl) inc hl or e ld e, a call LCD_BUSY_QUICK ld a, e out (11h), a djnz ditherLoop pop af rla push af inc c jr newRowendDraw: pop af ld (grayMask), a ld a, 0 rla ld (grayCarry), a call LCD_BUSY_QUICKexitInterrupt: ex af, af' exx ei ret; general datagrayCarry: db 1grayMask: db 01101101bmainMenuOptions: db "New|Load|Settings|Help|Exit", 0buttonBorderData: db 00h, 00h, 80h, 00h, 20h, 00h, 00h, 01h, 00h, 00h, 80h, 00hmainMenuPicData: db 78h, 79h, 0D1h, 0EFh, 0C9h, 0ECh, 0BFh, 0BEh, 7Bh, 0E6h, 0FFh, 0BFh, 2Fh, 2Fh, 0FCh, 0E4h, 7Bh, 0E9h, 7Fh, 0B7h, 0FFh, 0FFh, 0EFh, 0FFh, 78h, 78h, 0C1h, 0FFh, 0E1h, 0EDh, 0BCh db 3Fh, 0EEh, 6Eh, 0FCh, 0BEh, 6Fh, 2Fh, 0ECh, 0FCh, 0E7h, 0EDh, 3Fh, 7Fh, 0FFh, 0F7h, 0FFh, 0EFh, 0F8h, 78h, 0C1h, 6Fh, 0E4h, 0FDh, 38h, 0FCh, 0ECh, 6Eh, 0FEh, 0FEh, 7Fh, 0CFh db 0E0h, 0D0h, 67h, 0EEh, 3Fh, 7Fh, 0FFh, 0F7h, 0FFh, 0FFh, 78h, 0F8h, 0C3h, 0C9h, 0ECh, 0C1h, 0B8h, 7Dh, 0ECh, 0F4h, 0FCh, 0FEh, 7Fh, 0FFh, 0E0h, 0E0h, 0E1h, 0EBh, 3Fh, 0F7h, 0F7h db 0FFh, 0FFh, 0FFh, 0F8h, 78h, 0DFh, 87h, 0E8h, 0DDh, 0F8h, 0F8h, 0C9h, 0ECh, 0ECh, 0FCh, 4Bh, 77h, 0C0h, 0ECh, 0E3h, 0E5h, 0BFh, 0FFh, 0F7h, 0FFh, 0FFh, 0FFh, 0F8h, 0F8h, 0CFh, 73h db 0E8h, 0E5h, 0F8h, 0BBh, 0C5h, 0CFh, 0CCh, 0CCh, 0C9h, 59h, 0C0h, 0E0h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