Skip to content

Commit 23d37f2

Browse files
Implement text parser
Several sprite animation commands now work Fix severe performance issue by MAPping the graphics screen into 16-bit space Message boxes can be created
1 parent 1d94e21 commit 23d37f2

27 files changed

Lines changed: 1096 additions & 285 deletions

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@ obj/*.o
22
obj/*.lst
33
*.lst
44
*.prg
5+
*.raw
6+
obj/
7+
*.d81
8+
*.cmap
9+
volumes/
510

.vscode/launch.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"name": "(MEGA65) Launch",
2020
"type": "cppvsdbg",
2121
"request": "launch",
22+
"preLaunchTask": "senddisk",
2223
"program": "C:\\CommandLineApps\\etherload.exe",
2324
"args": ["-r", "-m", "agi.d81", "-5", "--ntsc", "agi.prg"],
2425
"stopAtEntry": false,

.vscode/tasks.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
"$gcc"
1515
]
1616
},
17+
{
18+
"label" : "senddisk",
19+
"command" : "mega65_ftp",
20+
"args" : ["-e", "-c", "put agi.d81"]
21+
},
1722
{
1823
"label": "clean",
1924
"type": "shell",

Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ VPATH = src
22

33
# Common source files
44
ASM_SRCS = simplefile.s irq.s
5-
C_SRCS = main.c ncm.c pic.c volume.c sound.c view.c engine.c interrupt.c memmanage.c sprite.c logic.c
5+
C_SRCS = main.c ncm.c pic.c volume.c sound.c view.c engine.c interrupt.c memmanage.c sprite.c logic.c parser.c init.c
66
C1541 = c1541
77
INC = -I./include
88

@@ -22,22 +22,24 @@ obj/%-debug.o: %.s
2222
obj/%-debug.o: %.c
2323
cc6502 --target=mega65 --debug --list-file=$(@:%.o=%.clst) -o $@ $<
2424

25-
agi.prg: $(OBJS)
26-
ln6502 --target=mega65 mega65-agi.scm -o $@ $^ --output-format=prg --list-file=agi-mega65.cmap
25+
agi.prg: mega65-agi.scm $(OBJS)
26+
ln6502 --target=mega65 -o $@ $^ --raw-multiple-memories --output-format=prg --list-file=agi-mega65.cmap
2727

2828
agi.elf: $(OBJS_DEBUG)
29-
ln6502 --target=mega65 mega65-agi.scm --debug -o $@ $^ --list-file=agi-debug.cmap --semi-hosted
29+
ln6502 --target=mega65 --debug -o $@ $^ --list-file=agi-debug.cmap --semi-hosted
3030

3131
agi.d81: agi.prg
3232
$(C1541) -format "agi,a1" d81 agi.d81
3333
$(C1541) -attach agi.d81 -write agi.prg agi.c65
34+
$(C1541) -attach agi.d81 -write nographics.raw nographics,s
3435
$(C1541) -attach agi.d81 -write volumes/LOGDIR logdir,s
3536
$(C1541) -attach agi.d81 -write volumes/PICDIR picdir,s
3637
$(C1541) -attach agi.d81 -write volumes/SNDDIR snddir,s
3738
$(C1541) -attach agi.d81 -write volumes/VIEWDIR viewdir,s
3839
$(C1541) -attach agi.d81 -write volumes/VOL.0 vol.0,s
3940
$(C1541) -attach agi.d81 -write volumes/VOL.1 vol.1,s
4041
$(C1541) -attach agi.d81 -write volumes/VOL.2 vol.2,s
42+
$(C1541) -attach agi.d81 -write volumes/WORDS.TOK words.tok,s
4143

4244
clean:
4345
-rm $(OBJS) $(OBJS:%.o=%.clst) $(OBJS_DEBUG) $(OBJS_DEBUG:%.o=%.clst)

include/engine.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef ENGINE_H
22
#define ENGINE_H
33

4+
#include "main.h"
5+
46
extern uint8_t horizon_line;
57
extern bool player_control;
68

@@ -11,5 +13,6 @@ void engine_unblock(void);
1113
void engine_clear_keyboard(void);
1214
void engine_allowinput(bool allowed);
1315
void engine_statusline(bool enable);
16+
void engine_dialog_close(void);
1417

1518
#endif

include/gfx.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <stdbool.h>
55

66
extern volatile uint8_t __far *drawing_xpointer[2][160];
7+
extern uint8_t *fastdrawing_xpointer[160];
78
extern volatile uint8_t drawing_screen;
89
extern __far uint8_t priority_screen[16384];
910

@@ -20,10 +21,11 @@ void gfx_set_printpos(uint8_t x, uint8_t y);
2021
void gfx_clear_line(uint8_t y);
2122
void gfx_setupmem(void);
2223
void gfx_blackscreen(void);
23-
void gfx_cleargfx(void);
24+
void gfx_cleargfx(bool preserve_text);
2425
bool gfx_flippage(void);
2526
void gfx_hold_flip(bool hold);
2627
void gfx_switchto(void);
2728
void gfx_switchfrom(void);
29+
void gfx_set_textmode(bool enable_text);
2830

2931
#endif

include/init.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef INIT_H
2+
#define INIT_H
3+
4+
void init_load_raw(void);
5+
6+
#endif

include/irq.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
void hook_irq(void);
22
void unhook_irq(void);
3+
void select_graphics0_mem(void);
4+
void select_graphics1_mem(void);
5+
void select_execution_mem(void);

include/main.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef MAIN_H
22
#define MAIN_H
33

4+
#include "stdbool.h"
5+
46
struct __F018 {
57
uint8_t dmalowtrig;
68
uint8_t dmahigh;

include/memmanage.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
#define MEMMANAGE_H
33

44
extern uint8_t __far * const chipmem_base;
5+
extern uint8_t __far * const chipmem2_base;
56

67
void memmanage_init(void);
78
uint16_t chipmem_alloc(uint16_t size);
89
void chipmem_free(uint16_t offset);
910
void chipmem_lock(void);
1011
void chipmem_free_unlocked(void);
12+
uint16_t chipmem2_alloc(uint16_t size);
13+
void chipmem2_free(uint16_t offset);
1114

1215
#endif

0 commit comments

Comments
 (0)