Skip to content

Commit b101902

Browse files
committed
A5200: wait for key-press and reset console at program termination.
1 parent a5222a5 commit b101902

2 files changed

Lines changed: 20 additions & 6 deletions

File tree

rules.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ $(LIB_ROM_INT): $(RT_OBJS_ROM_INT) $(A800_ROM_OBJS) | build/compiler $(AR65_HOST
240240
$(Q)rm -f $@
241241
$(Q)$(AR65_HOST) a $@ $^
242242

243-
$(LIB_A5200): $(RT_OBJS_INT) $(A5200_OBJS) | build/compiler $(AR65_HOST)
243+
$(LIB_A5200): $(A5200_OBJS) | build/compiler $(AR65_HOST)
244244
$(ECHO) "Creating Atari-5200 INT library $@"
245245
$(Q)rm -f $@
246246
$(Q)$(AR65_HOST) a $@ $^

src/a5200cart.asm

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
; Startup and support code for the Atari 5200 port
2828
; ------------------------------------------------
2929

30-
.import start, set_grmode
30+
.import interpreter_run, set_grmode, bytecode_start, get_key
3131
; Linker vars
3232
.import __CART_PAL__
3333
.import __BSS_RUN__, __BSS_SIZE__
@@ -38,6 +38,7 @@
3838
.importzp move_dwn_src, move_dwn_dst
3939

4040
.exportzp COLRSH, DINDEX, COLCRS, ROWCRS, SAVMSC
41+
.exportzp BASIC_TOP, array_ptr
4142
.export STICK0, STICK1, STICK2, STICK3
4243
.export STRIG0, STRIG1, STRIG2, STRIG3
4344
.export PTRIG0
@@ -55,6 +56,10 @@ SAVMSC: .res 2
5556
COLCRS: .res 2
5657
ROWCRS: .res 1
5758

59+
; ZP locations used by FastBasic:
60+
array_ptr: .res 2 ; Top of array memory
61+
BASIC_TOP= array_ptr
62+
5863
.data
5964
; Emulate Atari 8-bit locations
6065
; This have fixed locations because we need to optimize the
@@ -165,13 +170,22 @@ copy_interpreter:
165170
lda #2
166171
sta SKCTL ;Enable keyboard scanning circuit (without debounce)
167172
cli
168-
; Set initial graphics mode
173+
174+
; Sets initial graphics mode
169175
lda #0
170176
jsr set_grmode
171177

172-
jsr start
173-
end_loop:
174-
jmp end_loop
178+
; Starts interpreter
179+
lda #<bytecode_start
180+
ldx #>bytecode_start
181+
jsr interpreter_run
182+
183+
; Waits for key press
184+
jsr get_key
185+
186+
; RESET
187+
jmp ($FFFC)
188+
175189

176190
.proc vbi_deferred
177191

0 commit comments

Comments
 (0)