From 780b232259716bc9c13b263acae4ca30e5edc3a8 Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Mon, 24 Sep 2018 10:18:08 -0400 Subject: [PATCH] updated presets for new padding method --- doc/notes.txt | 1 + presets/galaxian-scramble/shoot2.c | 29 +++++++++++------------------ presets/mw8080bw/game2.c | 10 +++++----- 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/doc/notes.txt b/doc/notes.txt index ec68c825..476bbde9 100644 --- a/doc/notes.txt +++ b/doc/notes.txt @@ -67,6 +67,7 @@ TODO: - verilog: when paused scope doesn't work - resize memory dump window - C/asm formatter +- fix WebAudio (https://news.ycombinator.com/item?id=18066474) WEB WORKER FORMAT diff --git a/presets/galaxian-scramble/shoot2.c b/presets/galaxian-scramble/shoot2.c index 37663c3a..9ec2ed39 100644 --- a/presets/galaxian-scramble/shoot2.c +++ b/presets/galaxian-scramble/shoot2.c @@ -77,7 +77,7 @@ typedef enum { void main(); -void start() { +void start() __naked { __asm LD SP,#0x4800 EI @@ -87,8 +87,17 @@ __asm LD DE, #s__INITIALIZED LD HL, #s__INITIALIZER LDIR + JP _main +; padding to get to offset 0x66 + .ds 0x66 - (. - _start) __endasm; - main(); +} + +volatile byte video_framecount; // actual framecount + +// starts at address 0x66 +void rst_66() __interrupt { + video_framecount++; } const char __at (0x5000) palette[32] = {/*{pal:332,n:4}*/ @@ -136,26 +145,10 @@ void clrscr() { memset_safe(vram, BLANK, sizeof(vram)); } -volatile byte video_framecount; // actual framecount - void reset_video_framecount() __critical { video_framecount = 0; } -void _buffer() { -__asm -; padding to get to offset 0x66 - ld ix,#0 - ld ix,#0 - ld ix,#0 - nop -__endasm; -} - -void rst_66() __interrupt { - video_framecount++; -} - byte getchar(byte x, byte y) { return vram[29-x][y]; } diff --git a/presets/mw8080bw/game2.c b/presets/mw8080bw/game2.c index 7215e61c..def85add 100644 --- a/presets/mw8080bw/game2.c +++ b/presets/mw8080bw/game2.c @@ -1,4 +1,4 @@ - + #include typedef unsigned char byte; @@ -28,27 +28,27 @@ void scanline224() __interrupt; void main(); // start routine @ 0x0 // set stack pointer, enable interrupts -void start() { +void start() __naked { __asm LD SP,#0x2400 EI NOP + JP _main __endasm; - main(); } // scanline 96 interrupt @ 0x8 // we don't have enough bytes to make this an interrupt // because the next routine is at 0x10 -void _RST_8() { +void _RST_8() __naked { __asm NOP NOP NOP NOP NOP + JP _scanline96 __endasm; - scanline96(); } // scanline 224 interrupt @ 0x10