diff --git a/src/.gitignore b/src/.gitignore index 3d8486a..5887053 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -4,3 +4,4 @@ *.o *.sym *.map +dump.bin diff --git a/src/game.c b/src/game.c index 6ae70da..0d21a90 100644 --- a/src/game.c +++ b/src/game.c @@ -708,6 +708,6 @@ void wait_joystick_release(uint8_t joy_id) { do { read_joystick(joy_id, &joystat1, &joystat2, &joyconn); - sound_fill_buffers(); + //sound_fill_buffers(); } while(joystat1 != 0xFF || joystat2 != 0xFF); } \ No newline at end of file diff --git a/src/main.c b/src/main.c index 3419218..fcbb90e 100644 --- a/src/main.c +++ b/src/main.c @@ -26,6 +26,7 @@ #include "game.h" #include "menu.h" #include "mouse.h" +#include "sound.h" unsigned char keycode; @@ -34,13 +35,13 @@ void main() { init_screen(); load_tiles(); - // // enable mouse - init_mouse(); - // load sound engine init_sound(); start_bgmusic(); + // enable mouse + init_mouse(); + while(1) { while(gamestate == GAME_MENU) { clear_screen(); diff --git a/src/menu.c b/src/menu.c index f4692f9..0146cba 100644 --- a/src/menu.c +++ b/src/menu.c @@ -48,7 +48,6 @@ void game_menu() { print_choice(); while(1) { - // sample keyboard to make adjustments to the game settings asm("jsr $FFE4"); asm("sta %v", keycode); @@ -116,8 +115,8 @@ void game_menu() { return; } - asm("jsr $FF6B"); - asm("sta %v", mouse_buttons); + // asm("jsr $FF6B"); + // asm("sta %v", mouse_buttons); // update sound buffer sound_fill_buffers(); @@ -145,13 +144,13 @@ void print_choice() { // print board size switch(boardsize) { case 6: - memcpy(buf, "6 x 6 ", 7); + memcpy(buf, "6 x 6 ", 8); break; case 8: - memcpy(buf, "8 x 8 ", 7); + memcpy(buf, "8 x 8 ", 8); break; case 10: - memcpy(buf, "10 x 10", 7); + memcpy(buf, "10 x 10", 8); break; } write_string(buf, 9, 1); diff --git a/src/menu.h b/src/menu.h index 5862dd2..221d45b 100644 --- a/src/menu.h +++ b/src/menu.h @@ -27,6 +27,7 @@ #include "video.h" #include "game.h" #include "mouse.h" +#include "sound.h" /** * @brief Show game menu diff --git a/src/mouse.h b/src/mouse.h index 33fc544..d61592a 100644 --- a/src/mouse.h +++ b/src/mouse.h @@ -21,6 +21,6 @@ #ifndef _MOUSE_H #define _MOUSE_H -void init_mouse(); +void __fastcall__ init_mouse(); #endif // _MOUSE_H \ No newline at end of file diff --git a/src/mouse.s b/src/mouse.s index e0f7ac1..08f596d 100644 --- a/src/mouse.s +++ b/src/mouse.s @@ -22,6 +22,7 @@ .export _init_mouse +.code .proc _init_mouse: near sec jsr X16::Kernal::SCREEN_MODE diff --git a/src/othello.cfg b/src/othello.cfg index 374a536..2fdcbf6 100644 --- a/src/othello.cfg +++ b/src/othello.cfg @@ -16,20 +16,20 @@ MEMORY { BSS: file = "", start = __ONCE_RUN__, size = __HIMEM__ - __ONCE_RUN__ - __STACKSIZE__; } SEGMENTS { - ZEROPAGE: load = ZP, type = zp; - EXTZP: load = ZP, type = zp, optional = yes; - LOADADDR: load = LOADADDR, type = ro; - EXEHDR: load = HEADER, type = ro; - STARTUP: load = MAIN, type = ro, optional = yes; - LOWCODE: load = MAIN, type = ro, optional = yes; - CODE: load = MAIN, type = ro; - ZSMKITLIB: load = MAIN, type = ro; - ZSMKITBANK: load = HIRAM, type = bss, define = yes; - RODATA: load = MAIN, type = ro; - DATA: load = MAIN, type = rw; - INIT: load = MAIN, type = rw, optional = yes; # uninitialized, but reserves output space - ONCE: load = MAIN, type = ro, define = yes; - BSS: load = BSS, type = bss, define = yes; + ZEROPAGE: load = ZP, type = zp; + EXTZP: load = ZP, type = zp, optional = yes; + LOADADDR: load = LOADADDR, type = ro; + EXEHDR: load = HEADER, type = ro; + STARTUP: load = MAIN, type = ro, optional = yes; + LOWCODE: load = MAIN, type = ro, optional = yes; + CODE: load = MAIN, type = ro; + ZSMKITLIB: load = MAIN, type = ro; + ZSMKITBANK: load = HIRAM, type = bss, define = yes; + RODATA: load = MAIN, type = ro; + DATA: load = MAIN, type = rw; + INIT: load = MAIN, type = rw, optional = yes; # uninitialized, but reserves output space + ONCE: load = MAIN, type = ro, define = yes; + BSS: load = BSS, type = bss, define = yes; } FEATURES { CONDES: type = constructor, diff --git a/src/run.sh b/src/run.sh index 559618d..ef5d2cb 100644 --- a/src/run.sh +++ b/src/run.sh @@ -2,4 +2,4 @@ # # This BASH file is made for MINGW64 BASH # -../../emulator-win/x16emu.exe -prg OTHELLO.PRG -run +../../emulator-win/x16emu.exe -c02 -prg OTHELLO.PRG -run -debug